重构仓库目录为统一的 runtime 分层并清理历史 openclaw 残留。

本次迁移将网关/通道/工具/技能/脚本与协议资源集中到新结构,统一路径常量与脚本转发机制,减少顶层噪音并保证运行与测试行为一致。

Made-with: Cursor
This commit is contained in:
oliver 2026-04-25 01:24:23 +08:00
parent ba3836f00f
commit 4a23b715a2
498 changed files with 2760 additions and 2200 deletions

View file

@ -0,0 +1,29 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "oclaw://schemas/agent.json",
"title": "AgentParams",
"type": "object",
"additionalProperties": false,
"required": ["message", "idempotencyKey"],
"properties": {
"message": { "type": "string", "minLength": 1 },
"agentId": { "type": "string", "minLength": 1 },
"provider": { "type": "string", "minLength": 1 },
"model": { "type": "string", "minLength": 1 },
"to": { "type": "string", "minLength": 1 },
"replyTo": { "type": "string", "minLength": 1 },
"sessionId": { "type": "string", "minLength": 1 },
"sessionKey": { "type": "string", "minLength": 1 },
"thinking": { "type": "string" },
"deliver": { "type": "boolean" },
"attachments": { "type": "array", "items": {} },
"channel": { "type": "string" },
"timeout": { "type": "integer", "minimum": 0 },
"extraSystemPrompt": { "type": "string" },
"bootstrapContextMode": { "enum": ["full", "lightweight"] },
"bootstrapContextRunKind": { "enum": ["default", "heartbeat", "cron"] },
"idempotencyKey": { "type": "string", "minLength": 1 },
"label": { "type": "string" }
}
}

View file

@ -0,0 +1,13 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "oclaw://schemas/agent_wait.json",
"title": "AgentWaitParams",
"type": "object",
"additionalProperties": false,
"required": ["runId"],
"properties": {
"runId": { "type": "string", "minLength": 1 },
"timeoutMs": { "type": "integer", "minimum": 0 }
}
}

View file

@ -0,0 +1,45 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "oclaw://schemas/chat.json",
"title": "ChatParams",
"$defs": {
"NonEmptyString": { "type": "string", "minLength": 1 },
"ChatSendParams": {
"type": "object",
"additionalProperties": false,
"required": ["sessionKey", "message", "idempotencyKey"],
"properties": {
"sessionKey": { "$ref": "#/$defs/NonEmptyString" },
"message": { "type": "string" },
"thinking": { "type": "string" },
"interaction_mode": { "type": "string" },
"specialist": { "type": "string" },
"relay_share_envelope": { "type": "object" },
"acp_parent_run_id": { "type": "string" },
"acp_child_run_id": { "type": "string" },
"attachments": { "type": "array", "items": {} },
"timeoutMs": { "type": "integer", "minimum": 0 },
"idempotencyKey": { "$ref": "#/$defs/NonEmptyString" }
}
},
"ChatHistoryParams": {
"type": "object",
"additionalProperties": false,
"required": ["sessionKey"],
"properties": {
"sessionKey": { "$ref": "#/$defs/NonEmptyString" },
"limit": { "type": "integer", "minimum": 1 },
"maxChars": { "type": "integer", "minimum": 1 }
}
},
"ChatAbortParams": {
"type": "object",
"additionalProperties": false,
"required": ["sessionKey"],
"properties": {
"sessionKey": { "$ref": "#/$defs/NonEmptyString" },
"runId": { "type": "string", "minLength": 1 }
}
}
}
}

View file

@ -0,0 +1,61 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "oclaw://schemas/connect.json",
"title": "ConnectParams",
"type": "object",
"additionalProperties": false,
"required": ["minProtocol", "maxProtocol", "client"],
"properties": {
"minProtocol": { "type": "integer", "minimum": 1 },
"maxProtocol": { "type": "integer", "minimum": 1 },
"client": {
"type": "object",
"additionalProperties": false,
"required": ["id", "version", "platform", "mode"],
"properties": {
"id": { "type": "string", "minLength": 1 },
"displayName": { "type": "string", "minLength": 1 },
"version": { "type": "string", "minLength": 1 },
"platform": { "type": "string", "minLength": 1 },
"deviceFamily": { "type": "string", "minLength": 1 },
"modelIdentifier": { "type": "string", "minLength": 1 },
"mode": { "type": "string", "minLength": 1 },
"instanceId": { "type": "string", "minLength": 1 }
}
},
"caps": { "type": "array", "items": { "type": "string", "minLength": 1 } },
"commands": { "type": "array", "items": { "type": "string", "minLength": 1 } },
"permissions": {
"type": "object",
"additionalProperties": { "type": "boolean" }
},
"pathEnv": { "type": "string" },
"role": { "type": "string", "minLength": 1 },
"scopes": { "type": "array", "items": { "type": "string", "minLength": 1 } },
"auth": {
"type": "object",
"additionalProperties": false,
"properties": {
"token": { "type": "string" },
"bootstrapToken": { "type": "string" },
"deviceToken": { "type": "string" },
"password": { "type": "string" }
}
},
"device": {
"type": "object",
"additionalProperties": false,
"required": ["id", "publicKey", "signature", "signedAt", "nonce"],
"properties": {
"id": { "type": "string", "minLength": 1 },
"publicKey": { "type": "string", "minLength": 1 },
"signature": { "type": "string", "minLength": 1 },
"signedAt": { "type": "integer", "minimum": 0 },
"nonce": { "type": "string", "minLength": 1 }
}
},
"locale": { "type": "string" },
"userAgent": { "type": "string" }
}
}

View file

@ -0,0 +1,70 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "oclaw://schemas/frames.json",
"title": "GatewayFrame",
"type": "object",
"oneOf": [
{ "$ref": "#/$defs/RequestFrame" },
{ "$ref": "#/$defs/ResponseFrame" },
{ "$ref": "#/$defs/EventFrame" }
],
"$defs": {
"NonEmptyString": { "type": "string", "minLength": 1 },
"ErrorShape": {
"type": "object",
"additionalProperties": false,
"required": ["code", "message"],
"properties": {
"code": { "$ref": "#/$defs/NonEmptyString" },
"message": { "$ref": "#/$defs/NonEmptyString" },
"details": {},
"retryable": { "type": "boolean" },
"retryAfterMs": { "type": "integer", "minimum": 0 }
}
},
"RequestFrame": {
"type": "object",
"additionalProperties": false,
"required": ["type", "id", "method"],
"properties": {
"type": { "const": "req" },
"id": { "$ref": "#/$defs/NonEmptyString" },
"method": { "$ref": "#/$defs/NonEmptyString" },
"params": {}
}
},
"ResponseFrame": {
"type": "object",
"additionalProperties": false,
"required": ["type", "id", "ok"],
"properties": {
"type": { "const": "res" },
"id": { "$ref": "#/$defs/NonEmptyString" },
"ok": { "type": "boolean" },
"payload": {},
"error": { "$ref": "#/$defs/ErrorShape" }
}
},
"EventFrame": {
"type": "object",
"additionalProperties": false,
"required": ["type", "event"],
"properties": {
"type": { "const": "event" },
"event": { "$ref": "#/$defs/NonEmptyString" },
"payload": {},
"seq": { "type": "integer", "minimum": 0 },
"stateVersion": {
"type": "object",
"additionalProperties": false,
"required": ["presence", "health"],
"properties": {
"presence": { "type": "integer", "minimum": 0 },
"health": { "type": "integer", "minimum": 0 }
}
}
}
}
}
}

View file

@ -0,0 +1,86 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "oclaw://schemas/hello_ok.json",
"title": "HelloOk",
"type": "object",
"additionalProperties": false,
"required": ["type", "protocol", "server", "features", "snapshot", "policy"],
"properties": {
"type": { "const": "hello-ok" },
"protocol": { "type": "integer", "minimum": 1 },
"server": {
"type": "object",
"additionalProperties": false,
"required": ["version", "connId"],
"properties": {
"version": { "type": "string", "minLength": 1 },
"connId": { "type": "string", "minLength": 1 }
}
},
"features": {
"type": "object",
"additionalProperties": false,
"required": ["methods", "events"],
"properties": {
"methods": { "type": "array", "items": { "type": "string", "minLength": 1 } },
"events": { "type": "array", "items": { "type": "string", "minLength": 1 } }
}
},
"snapshot": {
"type": "object",
"additionalProperties": false,
"required": ["presence", "health", "stateVersion", "uptimeMs"],
"properties": {
"presence": { "type": "array", "items": { "type": "object" } },
"health": {},
"stateVersion": {
"type": "object",
"additionalProperties": false,
"required": ["presence", "health"],
"properties": {
"presence": { "type": "integer", "minimum": 0 },
"health": { "type": "integer", "minimum": 0 }
}
},
"uptimeMs": { "type": "integer", "minimum": 0 }
}
},
"policy": {
"type": "object",
"additionalProperties": false,
"required": ["maxPayload", "maxBufferedBytes", "tickIntervalMs"],
"properties": {
"maxPayload": { "type": "integer", "minimum": 1 },
"maxBufferedBytes": { "type": "integer", "minimum": 1 },
"tickIntervalMs": { "type": "integer", "minimum": 1 }
}
},
"canvasHostUrl": { "type": "string", "minLength": 1 },
"auth": {
"type": "object",
"additionalProperties": false,
"required": ["role", "scopes"],
"properties": {
"deviceToken": { "type": "string", "minLength": 1 },
"role": { "type": "string", "minLength": 1 },
"scopes": { "type": "array", "items": { "type": "string", "minLength": 1 } },
"issuedAtMs": { "type": "integer", "minimum": 0 },
"deviceTokens": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": false,
"required": ["deviceToken", "role", "scopes", "issuedAtMs"],
"properties": {
"deviceToken": { "type": "string", "minLength": 1 },
"role": { "type": "string", "minLength": 1 },
"scopes": { "type": "array", "items": { "type": "string", "minLength": 1 } },
"issuedAtMs": { "type": "integer", "minimum": 0 }
}
}
}
}
}
}
}

View file

@ -0,0 +1,38 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "oclaw://schemas/sessions.json",
"title": "SessionsParams",
"$defs": {
"NonEmptyString": { "type": "string", "minLength": 1 },
"SessionsListParams": {
"type": "object",
"additionalProperties": false,
"properties": {
"limit": { "type": "integer", "minimum": 1 },
"search": { "type": "string" }
}
},
"SessionsGetParams": {
"type": "object",
"additionalProperties": false,
"required": ["key"],
"properties": { "key": { "$ref": "#/$defs/NonEmptyString" } }
},
"SessionsSendParams": {
"type": "object",
"additionalProperties": false,
"required": ["key", "message"],
"properties": {
"key": { "$ref": "#/$defs/NonEmptyString" },
"message": { "type": "string" },
"thinking": { "type": "string" },
"attachments": { "type": "array", "items": {} },
"timeoutMs": { "type": "integer", "minimum": 0 },
"idempotencyKey": { "$ref": "#/$defs/NonEmptyString" },
"interaction_mode": { "$ref": "#/$defs/NonEmptyString" },
"specialist": { "$ref": "#/$defs/NonEmptyString" }
}
}
}
}