openclaw-openagent 1.0.12 → 1.0.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (132) hide show
  1. package/dist/index.js +2 -0
  2. package/dist/src/config/config-schema.d.ts +9 -0
  3. package/dist/src/config/config-schema.js +6 -0
  4. package/dist/src/messaging/executor.d.ts +2 -3
  5. package/dist/src/messaging/executor.js +4 -31
  6. package/dist/src/plugin-ui/assets/openagent-override.js +124 -18
  7. package/dist/src/proxy/auth-proxy.js +5 -0
  8. package/dist/src/runtime/update-checker.d.ts +18 -0
  9. package/dist/src/runtime/update-checker.js +216 -0
  10. package/index.ts +3 -0
  11. package/package.json +1 -3
  12. package/src/app/channel-tools.ts +0 -249
  13. package/src/app/discovery-tools.ts +0 -273
  14. package/src/app/download-file-tool.ts +0 -133
  15. package/src/app/hooks.ts +0 -144
  16. package/src/app/index.ts +0 -84
  17. package/src/app/messaging-tools.ts +0 -79
  18. package/src/app/ops-tools.ts +0 -155
  19. package/src/app/remote-agent-tool.ts +0 -762
  20. package/src/app/types.ts +0 -68
  21. package/src/app/upload-file-tool.ts +0 -411
  22. package/src/app/verbose-preflight.ts +0 -190
  23. package/src/auth/config.ts +0 -266
  24. package/src/auth/credential-manager.ts +0 -146
  25. package/src/auth/index.ts +0 -24
  26. package/src/auth/verify.ts +0 -99
  27. package/src/channel.ts +0 -566
  28. package/src/compat.ts +0 -94
  29. package/src/config/config-schema.ts +0 -39
  30. package/src/messaging/aggregator.ts +0 -120
  31. package/src/messaging/collector.ts +0 -89
  32. package/src/messaging/executor.ts +0 -72
  33. package/src/messaging/inbound.ts +0 -150
  34. package/src/messaging/index.ts +0 -11
  35. package/src/messaging/mention-protocol.ts +0 -94
  36. package/src/messaging/process-c2c-request.ts +0 -564
  37. package/src/messaging/process-message.ts +0 -373
  38. package/src/messaging/scheduler.ts +0 -55
  39. package/src/messaging/types.ts +0 -38
  40. package/src/plugin-ui/adapters/oc-2026-04.js +0 -103
  41. package/src/plugin-ui/adapters/oc-2026-05.js +0 -125
  42. package/src/plugin-ui/adapters/oc-2026-06.js +0 -125
  43. package/src/plugin-ui/adapters/oc-unknown.js +0 -48
  44. package/src/plugin-ui/assets/agentbook-icon.svg +0 -5
  45. package/src/plugin-ui/assets/bg.png +0 -0
  46. package/src/plugin-ui/assets/icon.png +0 -0
  47. package/src/plugin-ui/assets/magic.svg +0 -5
  48. package/src/plugin-ui/assets/openagent-override.js +0 -11156
  49. package/src/plugin-ui/build.cjs +0 -463
  50. package/src/plugin-ui/index.ts +0 -18
  51. package/src/plugin-ui/modules/agent-book/panel/agent-book.js +0 -570
  52. package/src/plugin-ui/modules/agent-book/panel/agent-card.js +0 -170
  53. package/src/plugin-ui/modules/agent-book/panel/agent-data.js +0 -643
  54. package/src/plugin-ui/modules/agent-book/panel/inject-ui.js +0 -665
  55. package/src/plugin-ui/modules/agent-book/panel/mention-state.js +0 -206
  56. package/src/plugin-ui/modules/agent-book/panel/styles.js +0 -833
  57. package/src/plugin-ui/modules/agent-book/panel/theme-adapter.js +0 -86
  58. package/src/plugin-ui/modules/agent-book/remote-agent-tool/components-core.js +0 -295
  59. package/src/plugin-ui/modules/agent-book/remote-agent-tool/thought-chain-card.js +0 -211
  60. package/src/plugin-ui/modules/agent-book/scanner.js +0 -131
  61. package/src/plugin-ui/modules/agent-book/travelcard/travel-cards.js +0 -500
  62. package/src/plugin-ui/modules/agent-book/travelcard/travel-engine.js +0 -652
  63. package/src/plugin-ui/modules/agent-book/travelcard/travel-styles.js +0 -256
  64. package/src/plugin-ui/modules/loader/bootstrap.js +0 -38
  65. package/src/plugin-ui/modules/loader/shared-state.js +0 -838
  66. package/src/plugin-ui/modules/loader/ws-intercept.js +0 -199
  67. package/src/plugin-ui/modules/remote-agent/chunk-parser.js +0 -161
  68. package/src/plugin-ui/modules/remote-agent/execution-card.js +0 -530
  69. package/src/plugin-ui/modules/remote-agent/markdown-renderer.js +0 -256
  70. package/src/plugin-ui/modules/remote-agent/media-links.js +0 -151
  71. package/src/plugin-ui/modules/remote-agent/native-style-adapter.js +0 -134
  72. package/src/plugin-ui/modules/remote-agent/output-card.js +0 -342
  73. package/src/plugin-ui/modules/remote-agent/progress-store.js +0 -363
  74. package/src/plugin-ui/modules/remote-agent/render-hooks.js +0 -1700
  75. package/src/plugin-ui/modules/remote-agent/styles.js +0 -896
  76. package/src/plugin-ui/modules/remote-agent/tool-card-model.js +0 -130
  77. package/src/plugin-ui/postinstall-deploy.cjs +0 -52
  78. package/src/plugin-ui/ui-extension-loader/backup.ts +0 -92
  79. package/src/plugin-ui/ui-extension-loader/index.ts +0 -276
  80. package/src/plugin-ui/ui-extension-loader/locator.ts +0 -152
  81. package/src/plugin-ui/ui-extension-loader/manifest.ts +0 -57
  82. package/src/plugin-ui/ui-extension-loader/registry-regex.ts +0 -944
  83. package/src/plugin-ui/ui-extension-loader/removed-extensions.ts +0 -70
  84. package/src/plugin-ui/ui-extension-loader/types.ts +0 -72
  85. package/src/proxy/auth-proxy.ts +0 -409
  86. package/src/runtime/account.ts +0 -549
  87. package/src/runtime/index.ts +0 -7
  88. package/src/runtime/plugin-runtime.ts +0 -94
  89. package/src/runtime/registry.ts +0 -71
  90. package/src/sdk/CLASS_MAP.md +0 -143
  91. package/src/sdk/index.d.ts +0 -126
  92. package/src/sdk/index.js +0 -23990
  93. package/src/sdk/modules/cloud-search-module.js +0 -1117
  94. package/src/sdk/modules/follow-module.js +0 -1069
  95. package/src/sdk/modules/group-module.js +0 -7397
  96. package/src/sdk/modules/relationship-module.js +0 -2269
  97. package/src/sdk/modules/signaling-module.js +0 -1468
  98. package/src/sdk/modules/tim-upload-plugin.js +0 -730
  99. package/src/sdk/node-env/http-request.js +0 -90
  100. package/src/sdk/node-env/index.js +0 -57
  101. package/src/sdk/node-env/storage.js +0 -114
  102. package/src/sdk/package.json +0 -10
  103. package/src/sdk/tsconfig.json +0 -16
  104. package/src/state/pending-invocation-store.ts +0 -43
  105. package/src/state/store.ts +0 -756
  106. package/src/tim/c2c.ts +0 -451
  107. package/src/tim/channels.ts +0 -364
  108. package/src/tim/client.ts +0 -330
  109. package/src/tim/index.ts +0 -18
  110. package/src/tim/messages.ts +0 -166
  111. package/src/tim/sdk-logger-init.ts +0 -50
  112. package/src/tools.ts +0 -10
  113. package/src/transport/factory.ts +0 -95
  114. package/src/transport/oasn/index.ts +0 -17
  115. package/src/transport/oasn/oasn-agent-card.ts +0 -111
  116. package/src/transport/oasn/oasn-discovery.ts +0 -108
  117. package/src/transport/oasn/oasn-files.ts +0 -210
  118. package/src/transport/oasn/oasn-http.ts +0 -529
  119. package/src/transport/oasn/oasn-invocation.ts +0 -604
  120. package/src/transport/oasn/oasn-normalize.ts +0 -133
  121. package/src/transport/oasn/oasn-register.ts +0 -33
  122. package/src/transport/oasn/oasn-transport.ts +0 -318
  123. package/src/transport/oasn/oasn-types.ts +0 -404
  124. package/src/transport/tim/index.ts +0 -8
  125. package/src/transport/tim/tim-transport.ts +0 -515
  126. package/src/transport/types.ts +0 -538
  127. package/src/types/openclaw-plugin-sdk-media-store.d.ts +0 -9
  128. package/src/types/openclaw.d.ts +0 -97
  129. package/src/types/tencentcloud-chat.d.ts +0 -15
  130. package/src/util/http.ts +0 -113
  131. package/src/util/logger.ts +0 -131
  132. package/src/util/url-resolver.ts +0 -77
@@ -1,404 +0,0 @@
1
- /**
2
- * OASN API 请求/响应类型定义
3
- *
4
- * 设计依据:
5
- * - docs/specs/2026-06-16-oasn-api-module-mapping.md
6
- * - oasn-01-onboarding/apis.md(agent / claim / auth / agent-card / discovery)
7
- * - oasn-02-access-layer/apis.md(invocation / file / artifact)
8
- *
9
- * 这些类型仅在 OASN transport 内部使用,对外暴露的通用类型在 src/transport/types.ts。
10
- * onboarding controller 的 Java record 当前使用 camelCase 请求/响应字段;
11
- * transport 层兼容历史 snake_case 响应,并对外归一到 src/transport/types.ts 的稳定模型。
12
- */
13
-
14
- // ═══════════════════════════════════════════════════════════════
15
- // 通用错误响应
16
- // ═══════════════════════════════════════════════════════════════
17
-
18
- /**
19
- * OASN 统一错误响应格式(所有 4xx/5xx 接口返回此结构)。
20
- * 详见 api-module-mapping.md §五 通用错误处理。
21
- */
22
- export interface OasnErrorBody {
23
- error: {
24
- /** 错误码:UNAUTHENTICATED / FORBIDDEN / TARGET_UNAVAILABLE / ... */
25
- code: string;
26
- /** 人类可读消息 */
27
- message: string;
28
- /** 客户端是否可重试(服务端裁决) */
29
- retryable: boolean;
30
- /** 附加上下文(端点定义具体字段) */
31
- details?: Record<string, unknown>;
32
- /** 排障追踪 id */
33
- request_id?: string;
34
- };
35
- }
36
-
37
- // ═══════════════════════════════════════════════════════════════
38
- // Agent 注册 / 认领
39
- // ═══════════════════════════════════════════════════════════════
40
-
41
- export interface RegisterAgentRequest {
42
- /** 当前固定为 "openclaw"(也可能是 "codex" / "claude_code" / "hermes") */
43
- platform: string;
44
- }
45
-
46
- export interface RegisterAgentResponse {
47
- agentId?: string;
48
- agent_id?: string;
49
- agentType?: 'client';
50
- agent_type?: 'client';
51
- /** 一次性明文 api_key,仅此响应返回;服务端只存 hash */
52
- apiKey?: string;
53
- api_key?: string;
54
- claimUrl?: string;
55
- claim_url?: string;
56
- status: 'unclaimed';
57
- agentCard?: AgentCardResponse;
58
- agent_card?: AgentCardResponse;
59
- }
60
-
61
- export interface AgentStatusResponse {
62
- agentId?: string;
63
- agent_id?: string;
64
- status: 'unclaimed' | 'claim_pending' | 'claimed';
65
- access_token?: string;
66
- accessToken?: string;
67
- }
68
-
69
- export interface AgentCardResponse {
70
- agentId?: string;
71
- agent_id?: string;
72
- agentType?: 'client' | 'service';
73
- agent_type?: 'client' | 'service';
74
- agentStatus?: string;
75
- agent_status?: string;
76
- claimStatus?: string;
77
- claim_status?: string;
78
- name: string;
79
- description: string | null;
80
- MOM: string | null;
81
- tags: Array<{ tagId?: string; tag_id?: string; name: string }>;
82
- category: string[];
83
- avatarRef?: string | null;
84
- avatar_ref?: string | null;
85
- avatarUrl?: string | null;
86
- avatar_url?: string | null;
87
- visibility?: 'public' | 'private';
88
- publicMetadata?: Record<string, unknown> | null;
89
- public_metadata?: Record<string, unknown> | null;
90
- updatedAt?: string;
91
- updated_at?: string;
92
- }
93
-
94
- export interface ClaimAgentRequest {
95
- agentId?: string;
96
- claimToken?: string;
97
- ownerEmail: string;
98
- }
99
-
100
- export interface ClaimAgentResponse {
101
- agentId?: string;
102
- agent_id?: string;
103
- status: 'claim_email_sent';
104
- ownerEmailMasked?: string;
105
- owner_email_masked?: string;
106
- expiresAt?: string;
107
- expires_at?: string;
108
- }
109
-
110
- export interface UpdateAgentCardRequest {
111
- name?: string | null;
112
- description?: string | null;
113
- MOM?: string | null;
114
- tags?: string[] | null;
115
- category?: string[] | null;
116
- avatarRef?: string | null;
117
- visibility?: 'public' | 'private';
118
- publicMetadata?: Record<string, unknown> | null;
119
- }
120
-
121
- // ═══════════════════════════════════════════════════════════════
122
- // Discovery
123
- // ═══════════════════════════════════════════════════════════════
124
-
125
- export interface CategoryNodeResponse {
126
- categoryId?: string;
127
- category_id?: string;
128
- name: string;
129
- children?: CategoryNodeResponse[];
130
- }
131
-
132
- export interface CategoryTreeResponse {
133
- categories: CategoryNodeResponse[];
134
- updatedAt?: string;
135
- updated_at?: string;
136
- }
137
-
138
- /** 三种搜索端点的请求结构 */
139
- export interface SearchByQueryRequest {
140
- query: string;
141
- agentTypes?: string[];
142
- sort?: string[];
143
- pageSize?: number;
144
- pageNum?: number;
145
- }
146
-
147
- export interface SearchByCategoryRequest {
148
- category: string[];
149
- agentTypes?: string[];
150
- sort?: string[];
151
- pageSize?: number;
152
- pageNum?: number;
153
- }
154
-
155
- export interface SearchByTagsRequest {
156
- tags: string[];
157
- agentTypes?: string[];
158
- sort?: string[];
159
- pageSize?: number;
160
- pageNum?: number;
161
- }
162
-
163
- export interface SearchResponse {
164
- searchId?: string;
165
- search_id?: string;
166
- agentCards?: AgentCardResponse[];
167
- agent_cards?: AgentCardResponse[];
168
- pageNum?: number;
169
- page_num?: number;
170
- pageSize?: number;
171
- page_size?: number;
172
- hasNext?: boolean;
173
- has_next?: boolean;
174
- }
175
-
176
- // ═══════════════════════════════════════════════════════════════
177
- // Invocation(核心路径 ⭐)
178
- // ═══════════════════════════════════════════════════════════════
179
-
180
- export interface CreateInvocationRequest {
181
- /** 客户端生成的幂等 key(详见 §11.1) */
182
- idempotency_key: string;
183
- service_agent_id: string;
184
- /** 显式输入意图,至少包含 task 字段 */
185
- input: { task: string } & Record<string, unknown>;
186
- session_id?: string;
187
- input_file_refs?: string[];
188
- input_artifact_refs?: string[];
189
- /** 期望超时(服务端裁决最终 effective_timeout_ms) */
190
- timeout_ms?: number;
191
- /** 客户端分组标识(可选) */
192
- client_request_group_id?: string;
193
- }
194
-
195
- export interface CreateInvocationResponse {
196
- invocationId?: string;
197
- invocation_id?: string;
198
- sessionId?: string;
199
- session_id?: string;
200
- status: 'accepted' | 'queued';
201
- serviceAgentId?: string;
202
- service_agent_id?: string;
203
- effectiveTimeoutMs?: number;
204
- effective_timeout_ms?: number;
205
- nextPollAfterMs?: number;
206
- next_poll_after_ms?: number;
207
- /** 是否幂等重放(同一 idempotency_key 多次请求返回 true) */
208
- idempotentReplay?: boolean;
209
- idempotent_replay?: boolean;
210
- createdAt?: string;
211
- created_at?: string;
212
- }
213
-
214
- /** Invocation 状态枚举 */
215
- export type InvocationStatus =
216
- | 'accepted'
217
- | 'queued'
218
- | 'running'
219
- | 'succeeded'
220
- | 'failed'
221
- | 'timed_out'
222
- | 'cancelled';
223
-
224
- /** 是否进入终态(停止轮询) */
225
- export function isInvocationTerminal(status: InvocationStatus): boolean {
226
- return status === 'succeeded'
227
- || status === 'failed'
228
- || status === 'timed_out'
229
- || status === 'cancelled';
230
- }
231
-
232
- export interface InvocationProgress {
233
- lifecycleState?: string;
234
- lifecycle_state?: string;
235
- activityCategory?: string;
236
- activity_category?: string;
237
- progressPercent?: number;
238
- progress_percent?: number;
239
- elapsedMs?: number;
240
- elapsed_ms?: number;
241
- /** 可对外展示的安全状态描述(已脱敏) */
242
- safeStatusMessage?: string;
243
- safe_status_message?: string;
244
- }
245
-
246
- export interface ArtifactResponse {
247
- artifactId?: string;
248
- artifact_id?: string;
249
- displayName?: string;
250
- display_name?: string;
251
- mimeType?: string;
252
- mime_type?: string;
253
- sizeBytes?: number;
254
- size_bytes?: number;
255
- contentAvailable?: boolean;
256
- content_available?: boolean;
257
- contentUrl?: string;
258
- content_url?: string;
259
- }
260
-
261
- /**
262
- * OASN WebUI continuation —— 标准 run 完成后,声明了 webui 能力的 ServiceAgent
263
- * 会在用户视图里暴露一个可继续打开 WebUI 的入口。
264
- *
265
- * 后端同时兼容 camelCase / snake_case,插件两侧都需要做 fallback 归一。
266
- * launch_url 通常是相对路径(如 /webui/continuations/{continuation_id}),
267
- * 由上层按 OASN Access base URL 解析为绝对地址。
268
- */
269
- export interface WebuiContinuationResponse {
270
- continuationId?: string;
271
- continuation_id?: string;
272
- type?: string;
273
- displayName?: string;
274
- display_name?: string;
275
- visibleState?: string;
276
- visible_state?: string;
277
- sessionId?: string;
278
- session_id?: string;
279
- launchUrl?: string;
280
- launch_url?: string;
281
- }
282
-
283
- /**
284
- * 用户视图结果 —— 后端在 sanitizeInvocationView() 后追加的结构。
285
- * 除已声明字段外,保留 index signature 以容纳后续新增字段。
286
- */
287
- export interface VisibleResultResponse {
288
- inlineResultSummary?: string;
289
- inline_result_summary?: string;
290
- webuiContinuation?: WebuiContinuationResponse;
291
- webui_continuation?: WebuiContinuationResponse;
292
- [key: string]: unknown;
293
- }
294
-
295
- export interface GetInvocationResponse {
296
- invocationId?: string;
297
- invocation_id?: string;
298
- sessionId?: string;
299
- session_id?: string;
300
- status: InvocationStatus;
301
- progress?: InvocationProgress;
302
- inlineResult?: {
303
- summary: string;
304
- [key: string]: unknown;
305
- };
306
- inline_result?: {
307
- summary: string;
308
- [key: string]: unknown;
309
- };
310
- /** 用户视图 —— 含 inline_result_summary 与 webui_continuation(camelCase) */
311
- visibleResult?: VisibleResultResponse;
312
- /** 用户视图 —— 含 inline_result_summary 与 webui_continuation(snake_case) */
313
- visible_result?: VisibleResultResponse;
314
- artifacts?: ArtifactResponse[];
315
- /** 终态时为 null */
316
- nextPollAfterMs?: number | null;
317
- next_poll_after_ms?: number | null;
318
- warnings?: string[];
319
- userError?: { code?: string; message?: string | null };
320
- user_error?: { code?: string; message?: string | null };
321
- userErrorCode?: string;
322
- user_error_code?: string;
323
- userErrorMessage?: string | null;
324
- user_error_message?: string | null;
325
- createdAt?: string;
326
- created_at?: string;
327
- updatedAt?: string;
328
- updated_at?: string;
329
- }
330
-
331
- // ═══════════════════════════════════════════════════════════════
332
- // File / Artifact
333
- // ═══════════════════════════════════════════════════════════════
334
-
335
- export interface UploadFileResponse {
336
- // snake_case (旧,向后兼容)
337
- file_ref?: string;
338
- display_name?: string;
339
- mime_type?: string;
340
- size_bytes?: number;
341
- /** ISO 8601 字符串 */
342
- expires_at?: string;
343
- created_at?: string;
344
- // camelCase (access 层实际返回,见 access-upload-download-api.md §2.2)
345
- fileRef?: string;
346
- displayName?: string;
347
- mimeType?: string;
348
- sizeBytes?: number;
349
- /** ISO 8601 字符串 */
350
- expiresAt?: string | null;
351
- createdAt?: string;
352
- }
353
-
354
- // Artifact 下载返回二进制,没有 JSON 结构 —— 详见 oasn-files.ts
355
-
356
- // ═══════════════════════════════════════════════════════════════
357
- // Owner
358
- // ═══════════════════════════════════════════════════════════════
359
-
360
- export interface OwnerInfoResponse {
361
- ownerId?: string;
362
- owner_id?: string;
363
- ownerType?: string;
364
- owner_type?: string;
365
- displayName?: string;
366
- display_name?: string;
367
- emailMasked?: string;
368
- email_masked?: string;
369
- emailVerifiedAt?: string;
370
- email_verified_at?: string;
371
- status: string;
372
- }
373
-
374
- // ═══════════════════════════════════════════════════════════════
375
- // 端点常量
376
- // ═══════════════════════════════════════════════════════════════
377
-
378
- /** OASN HTTP 端点路径(相对于 api_base) */
379
- export const OASN_ENDPOINTS = {
380
- // Agent
381
- REGISTER: '/api/agents/register',
382
- CLAIM: '/api/agents/claim',
383
- AGENT_STATUS: (agentId: string) => `/api/agents/${encodeURIComponent(agentId)}`,
384
-
385
- // AgentCard
386
- AGENT_CARD: (agentId: string) => `/api/agent-cards/${encodeURIComponent(agentId)}`,
387
-
388
- // Discovery
389
- CATEGORIES: '/api/agent-card-categories',
390
- SEARCH_BY_QUERY: '/api/agent-cards/search/by-query',
391
- SEARCH_BY_CATEGORY: '/api/agent-cards/search/by-category',
392
- SEARCH_BY_TAGS: '/api/agent-cards/search/by-tags',
393
-
394
- // Invocation
395
- INVOCATIONS: '/api/invocations',
396
- INVOCATION: (id: string) => `/api/invocations/${encodeURIComponent(id)}`,
397
-
398
- // File / Artifact
399
- FILES: '/api/files',
400
- ARTIFACT_CONTENT: (id: string) => `/api/artifacts/${encodeURIComponent(id)}/content`,
401
-
402
- // Owner
403
- USERS_ME: '/api/users/me',
404
- } as const;
@@ -1,8 +0,0 @@
1
- /**
2
- * TimTransport 模块导出
3
- *
4
- * 设计依据:docs/specs/2026-06-16-oasn-transport-abstraction-design.md §3.1
5
- */
6
-
7
- export { TimTransportImpl } from './tim-transport.js';
8
- export type { TimTransportInitOptions } from './tim-transport.js';