openclaw-openagent 1.0.11 → 1.0.12

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 (56) hide show
  1. package/dist/index.js +1 -1
  2. package/dist/src/app/remote-agent-tool.js +110 -14
  3. package/dist/src/app/types.d.ts +2 -2
  4. package/dist/src/plugin-ui/adapters/adapters/oc-2026-04.js +103 -0
  5. package/dist/src/plugin-ui/adapters/adapters/oc-2026-05.js +125 -0
  6. package/dist/src/plugin-ui/adapters/adapters/oc-2026-06.js +125 -0
  7. package/dist/src/plugin-ui/adapters/adapters/oc-unknown.js +48 -0
  8. package/dist/src/plugin-ui/adapters/oc-2026-04.js +103 -0
  9. package/dist/src/plugin-ui/adapters/oc-2026-05.js +125 -0
  10. package/dist/src/plugin-ui/adapters/oc-2026-06.js +125 -0
  11. package/dist/src/plugin-ui/adapters/oc-unknown.js +48 -0
  12. package/dist/src/plugin-ui/assets/openagent-override.js +1007 -258
  13. package/dist/src/plugin-ui/index.d.ts +1 -1
  14. package/dist/src/plugin-ui/index.js +2 -2
  15. package/dist/src/plugin-ui/ui-extension-loader/index.d.ts +2 -1
  16. package/dist/src/plugin-ui/ui-extension-loader/index.js +5 -5
  17. package/dist/src/plugin-ui/ui-extension-loader/registry-regex.js +75 -8
  18. package/dist/src/plugin-ui/ui-extension-loader/types.d.ts +4 -1
  19. package/dist/src/state/store.d.ts +21 -0
  20. package/dist/src/state/store.js +54 -0
  21. package/dist/src/transport/oasn/oasn-invocation.d.ts +3 -0
  22. package/dist/src/transport/oasn/oasn-invocation.js +28 -12
  23. package/dist/src/transport/oasn/oasn-types.d.ts +8 -4
  24. package/index.ts +1 -1
  25. package/package.json +4 -3
  26. package/src/app/remote-agent-tool.ts +131 -16
  27. package/src/app/types.ts +2 -2
  28. package/src/plugin-ui/adapters/oc-2026-04.js +103 -0
  29. package/src/plugin-ui/adapters/oc-2026-05.js +125 -0
  30. package/src/plugin-ui/adapters/oc-2026-06.js +125 -0
  31. package/src/plugin-ui/adapters/oc-unknown.js +48 -0
  32. package/src/plugin-ui/assets/openagent-override.js +1007 -258
  33. package/src/plugin-ui/build.cjs +249 -38
  34. package/src/plugin-ui/index.ts +2 -2
  35. package/src/plugin-ui/modules/agent-book/panel/agent-book.js +102 -12
  36. package/src/plugin-ui/modules/agent-book/panel/inject-ui.js +105 -3
  37. package/src/plugin-ui/modules/agent-book/panel/styles.js +42 -35
  38. package/src/plugin-ui/modules/agent-book/remote-agent-tool/components-core.js +4 -2
  39. package/src/plugin-ui/modules/agent-book/remote-agent-tool/thought-chain-card.js +4 -1
  40. package/src/plugin-ui/modules/agent-book/scanner.js +17 -5
  41. package/src/plugin-ui/modules/agent-book/travelcard/travel-styles.js +5 -0
  42. package/src/plugin-ui/modules/loader/shared-state.js +244 -20
  43. package/src/plugin-ui/modules/remote-agent/execution-card.js +54 -16
  44. package/src/plugin-ui/modules/remote-agent/native-style-adapter.js +5 -23
  45. package/src/plugin-ui/modules/remote-agent/output-card.js +13 -7
  46. package/src/plugin-ui/modules/remote-agent/render-hooks.js +53 -41
  47. package/src/plugin-ui/modules/remote-agent/styles.js +230 -88
  48. package/src/plugin-ui/modules/remote-agent/tool-card-model.js +72 -4
  49. package/src/plugin-ui/postinstall-deploy.cjs +52 -0
  50. package/src/plugin-ui/ui-extension-loader/index.ts +6 -6
  51. package/src/plugin-ui/ui-extension-loader/registry-regex.ts +81 -9
  52. package/src/plugin-ui/ui-extension-loader/types.ts +5 -1
  53. package/src/state/store.ts +80 -0
  54. package/src/transport/oasn/oasn-invocation.ts +47 -12
  55. package/src/transport/oasn/oasn-types.ts +6 -2
  56. package/src/types/openclaw-plugin-sdk-media-store.d.ts +9 -0
@@ -206,14 +206,20 @@ function formatMediaDownloadLines(urls: string[]): string {
206
206
  function normalizeRemoteToolExecuteArgs(
207
207
  signalOrUpdate?: AbortSignal | ToolUpdateCallback,
208
208
  onUpdateOrContext?: ToolUpdateCallback | unknown,
209
- legacySignal?: AbortSignal,
210
- ): { signal?: AbortSignal; onUpdate?: ToolUpdateCallback; signature: string } {
209
+ contextOrSignal?: unknown,
210
+ ): { signal?: AbortSignal; onUpdate?: ToolUpdateCallback; context?: unknown; signature: string } {
211
+ const contextCandidate = (value: unknown): unknown | undefined => {
212
+ if (!value || typeof value !== 'object' || isAbortSignalLike(value)) return undefined;
213
+ return value;
214
+ };
215
+
211
216
  if (typeof signalOrUpdate === 'function') {
212
217
  return {
213
218
  onUpdate: signalOrUpdate,
214
- signal: isAbortSignalLike(legacySignal)
215
- ? legacySignal
219
+ signal: isAbortSignalLike(contextOrSignal)
220
+ ? contextOrSignal
216
221
  : getObjectSignal(onUpdateOrContext),
222
+ context: contextCandidate(onUpdateOrContext),
217
223
  signature: 'legacy:update-third',
218
224
  };
219
225
  }
@@ -222,7 +228,8 @@ function normalizeRemoteToolExecuteArgs(
222
228
  return {
223
229
  signal: isAbortSignalLike(signalOrUpdate) ? signalOrUpdate : undefined,
224
230
  onUpdate: onUpdateOrContext as ToolUpdateCallback,
225
- signature: 'modern:signal-update',
231
+ context: contextCandidate(contextOrSignal),
232
+ signature: contextCandidate(contextOrSignal) ? 'modern:signal-update-context' : 'modern:signal-update',
226
233
  };
227
234
  }
228
235
 
@@ -233,15 +240,108 @@ function normalizeRemoteToolExecuteArgs(
233
240
  const nestedSignal =
234
241
  isAbortSignalLike(signalOrUpdate)
235
242
  ? signalOrUpdate
236
- : getObjectSignal(onUpdateOrContext) || (isAbortSignalLike(legacySignal) ? legacySignal : undefined);
243
+ : getObjectSignal(onUpdateOrContext) || (isAbortSignalLike(contextOrSignal) ? contextOrSignal : undefined);
237
244
 
238
245
  return {
239
246
  signal: nestedSignal,
240
247
  onUpdate: nestedUpdate,
248
+ context: contextCandidate(contextOrSignal) || contextCandidate(onUpdateOrContext),
241
249
  signature: nestedUpdate ? 'context:update-callback' : 'unknown:no-update',
242
250
  };
243
251
  }
244
252
 
253
+ function readNonEmptyString(value: unknown): string | undefined {
254
+ return typeof value === 'string' && value.trim() ? value.trim() : undefined;
255
+ }
256
+
257
+ function readRecord(value: unknown): Record<string, unknown> | undefined {
258
+ return value && typeof value === 'object' ? value as Record<string, unknown> : undefined;
259
+ }
260
+
261
+ function callStringGetter(target: unknown, methodName: string): string | undefined {
262
+ const record = readRecord(target);
263
+ const fn = record?.[methodName];
264
+ if (typeof fn !== 'function') return undefined;
265
+ try {
266
+ return readNonEmptyString(fn.call(target));
267
+ } catch {
268
+ return undefined;
269
+ }
270
+ }
271
+
272
+ function readNestedString(root: unknown, path: string[]): string | undefined {
273
+ let cur: unknown = root;
274
+ for (const key of path) {
275
+ const record = readRecord(cur);
276
+ if (!record) return undefined;
277
+ cur = record[key];
278
+ }
279
+ return readNonEmptyString(cur);
280
+ }
281
+
282
+ function resolveOpenclawSessionKey(context: unknown): string | undefined {
283
+ const ctx = readRecord(context);
284
+ if (!ctx) return undefined;
285
+
286
+ const sessionManager = ctx.sessionManager;
287
+ const managerSessionId = callStringGetter(sessionManager, 'getSessionId');
288
+ if (managerSessionId) return `session:${managerSessionId}`;
289
+
290
+ const directSessionId =
291
+ readNonEmptyString(ctx.sessionId) ||
292
+ readNonEmptyString(ctx.openclawSessionId) ||
293
+ readNonEmptyString(ctx.agentSessionId) ||
294
+ readNestedString(ctx, ['session', 'sessionId']);
295
+ if (directSessionId) return `session:${directSessionId}`;
296
+
297
+ const sessionFile =
298
+ callStringGetter(sessionManager, 'getSessionFile') ||
299
+ readNestedString(ctx, ['session', 'sessionFile']);
300
+ if (sessionFile) return `file:${sessionFile}`;
301
+
302
+ return undefined;
303
+ }
304
+
305
+ function getRememberedRemoteSessionId(
306
+ runtime: { store?: { getRemoteAgentSession?: (openclawSessionKey: string, targetAgentId: string) => string | null } | null },
307
+ openclawSessionKey: string | undefined,
308
+ agentId: string,
309
+ ): string | undefined {
310
+ if (!openclawSessionKey) return undefined;
311
+ try {
312
+ return runtime.store?.getRemoteAgentSession?.(openclawSessionKey, agentId) || undefined;
313
+ } catch (err) {
314
+ logger.warn(`[remote-tool] Failed to read remembered OASN session: ${(err as Error).message}`);
315
+ return undefined;
316
+ }
317
+ }
318
+
319
+ function rememberRemoteSessionId(
320
+ runtime: {
321
+ store?: {
322
+ upsertRemoteAgentSession?: (record: {
323
+ openclaw_session_key: string;
324
+ target_agent_id: string;
325
+ session_id: string;
326
+ }) => void;
327
+ } | null;
328
+ },
329
+ openclawSessionKey: string | undefined,
330
+ agentId: string,
331
+ sessionId: string | undefined,
332
+ ): void {
333
+ if (!openclawSessionKey || !sessionId) return;
334
+ try {
335
+ runtime.store?.upsertRemoteAgentSession?.({
336
+ openclaw_session_key: openclawSessionKey,
337
+ target_agent_id: agentId,
338
+ session_id: sessionId,
339
+ });
340
+ } catch (err) {
341
+ logger.warn(`[remote-tool] Failed to remember OASN session: ${(err as Error).message}`);
342
+ }
343
+ }
344
+
245
345
  // ── Tool Factory ──
246
346
 
247
347
  /**
@@ -259,9 +359,9 @@ export function createCallRemoteAgentTool(): ToolDescriptor {
259
359
  label: 'Call Remote Agent',
260
360
  description:
261
361
  'Route a user request to a remote specialist Agent via the OpenAgent network. ' +
262
- 'TRIGGER: When the user message contains a {openagent_call_remote_agent:agent_id="...",agent_name="...",instruction="..."} marker, ' +
362
+ 'TRIGGER: When the user message contains a {openagent_call_remote_agent:agent_id="...",agent_name="...",agent_bio="...",instruction="..."} marker, ' +
263
363
  'call this tool to forward the request to the specified remote Agent. ' +
264
- 'Extract agent_id and agent_name from the marker; use the remaining natural-language text as the task parameter. ' +
364
+ 'Extract agent_id, agent_name, and optional agent_bio from the marker; use the remaining natural-language text as the task parameter. ' +
265
365
  'Do not display the raw marker to the user. ' +
266
366
  'mode "session" (default) preserves remote conversation history; mode "run" starts fresh — include full context in task.',
267
367
  parameters: {
@@ -275,6 +375,10 @@ export function createCallRemoteAgentTool(): ToolDescriptor {
275
375
  type: 'string',
276
376
  description: 'Display name of the remote Agent from the marker. Use this in your reply to the user.',
277
377
  },
378
+ agent_bio: {
379
+ type: 'string',
380
+ description: 'Short description of the remote Agent from the marker. Preserve it for UI display.',
381
+ },
278
382
  task: {
279
383
  type: 'string',
280
384
  description: 'The user\'s natural-language request text, excluding the marker.',
@@ -303,18 +407,18 @@ export function createCallRemoteAgentTool(): ToolDescriptor {
303
407
  params: ToolParams,
304
408
  signalOrUpdate?: AbortSignal | ToolUpdateCallback,
305
409
  onUpdateOrContext?: ToolUpdateCallback | unknown,
306
- legacySignal?: AbortSignal,
410
+ contextOrSignal?: unknown,
307
411
  ): Promise<ToolResult> {
308
- const { signal, onUpdate, signature } = normalizeRemoteToolExecuteArgs(
412
+ const { signal, onUpdate, context, signature } = normalizeRemoteToolExecuteArgs(
309
413
  signalOrUpdate,
310
414
  onUpdateOrContext,
311
- legacySignal,
415
+ contextOrSignal,
312
416
  );
313
417
  logger.info(
314
418
  `[remote-tool] Execute args: toolCallId=${String(_id)} signature=${signature} ` +
315
419
  `hasSignal=${Boolean(signal)} hasOnUpdate=${Boolean(onUpdate)} ` +
316
420
  `third=${describeExecuteArg(signalOrUpdate)} fourth=${describeExecuteArg(onUpdateOrContext)} ` +
317
- `fifth=${describeExecuteArg(legacySignal)}`,
421
+ `fifth=${describeExecuteArg(contextOrSignal)}`,
318
422
  );
319
423
 
320
424
  // ① Check runtime (same pattern as messaging-tools.ts)
@@ -334,7 +438,7 @@ export function createCallRemoteAgentTool(): ToolDescriptor {
334
438
 
335
439
  const agentId = String(params.agent_id || '').trim();
336
440
  const task = String(params.task || '').trim();
337
- const mode = String(params.mode || 'session').trim();
441
+ const mode = String(params.mode || 'session').trim() === 'run' ? 'run' : 'session';
338
442
 
339
443
  // ② Validate required params
340
444
  if (!agentId) {
@@ -402,15 +506,20 @@ export function createCallRemoteAgentTool(): ToolDescriptor {
402
506
  const inputFileRefs: string[] | undefined = Array.isArray(params.input_file_refs)
403
507
  ? (params.input_file_refs as string[]).filter((r: unknown) => typeof r === 'string' && r.trim())
404
508
  : undefined;
509
+ const openclawSessionKey = resolveOpenclawSessionKey(context);
510
+ const rememberedSessionId = mode === 'session'
511
+ ? getRememberedRemoteSessionId(rt, openclawSessionKey, agentId)
512
+ : undefined;
513
+ if (mode === 'session' && !openclawSessionKey) {
514
+ logger.warn('[remote-tool] OASN session mode requested but OpenClaw session scope is unavailable');
515
+ }
405
516
 
406
517
  const taskReq: TaskRequest = {
407
518
  requestId,
408
519
  task,
520
+ sessionId: rememberedSessionId,
409
521
  inputFileRefs: inputFileRefs?.length ? inputFileRefs : undefined,
410
522
  timeoutMs: OASN_INVOCATION_TIMEOUT_MS,
411
- // mode='session' 时不在协议层 join 已有 session(OASN 默认每次起新 Invocation)。
412
- // 上游若需要保留对话历史,请在 task 文本里显式带 session_id;
413
- // 暂不在工具层做 session 续传,避免误用导致跨用户串号。
414
523
  };
415
524
 
416
525
  let handle: TaskHandle;
@@ -424,6 +533,9 @@ export function createCallRemoteAgentTool(): ToolDescriptor {
424
533
  `[remote-tool] OASN invocation created: invocationId=${handle.invocationId} ` +
425
534
  `sessionId=${handle.sessionId ?? '-'} effectiveTimeoutMs=${handle.effectiveTimeoutMs ?? '-'}`,
426
535
  );
536
+ if (mode === 'session') {
537
+ rememberRemoteSessionId(rt, openclawSessionKey, agentId, handle.sessionId);
538
+ }
427
539
 
428
540
  try {
429
541
  const result = await oasnTransport.waitForTaskResult(handle, {
@@ -435,6 +547,9 @@ export function createCallRemoteAgentTool(): ToolDescriptor {
435
547
  const artifacts = result.artifacts ?? [];
436
548
  let content = result.content;
437
549
  let mediaUrls: string[] = [];
550
+ if (mode === 'session') {
551
+ rememberRemoteSessionId(rt, openclawSessionKey, agentId, result.webuiContinuation?.sessionId);
552
+ }
438
553
 
439
554
  if (!content.trim()) {
440
555
  for (const textArtifact of artifacts) {
package/src/app/types.ts CHANGED
@@ -41,7 +41,7 @@ export interface ToolDescriptor {
41
41
  * Execute the tool.
42
42
  *
43
43
  * OpenClaw runtime usually calls:
44
- * tool.execute(toolCallId, params, signal, onUpdate)
44
+ * tool.execute(toolCallId, params, signal, onUpdate, ctx)
45
45
  *
46
46
  * Older adapters used:
47
47
  * tool.execute(toolCallId, params, onUpdate, ctx, signal)
@@ -56,7 +56,7 @@ export interface ToolDescriptor {
56
56
  params: ToolParams,
57
57
  signalOrUpdate?: AbortSignal | ToolUpdateCallback,
58
58
  onUpdateOrContext?: ToolUpdateCallback | unknown,
59
- legacySignal?: AbortSignal,
59
+ contextOrSignal?: unknown,
60
60
  ) => Promise<ToolResult>;
61
61
  }
62
62
 
@@ -0,0 +1,103 @@
1
+ // ── OpenClaw 2026.4 host adapter ──
2
+ // Host DOM: chat-tool-msg-collapse -> chat-tool-msg-body -> chat-tool-card.
3
+
4
+ (function _clInstallHostAdapter202604() {
5
+ function _matches(node, selector) {
6
+ return !!(node && selector && node.matches && node.matches(selector));
7
+ }
8
+
9
+ var adapter = {
10
+ id: 'oc-2026-04',
11
+ family: '2026.4',
12
+ css: {
13
+ remoteShell: [
14
+ 'details.chat-tool-msg-collapse:has(.cl-remote-agent-card)',
15
+ '.chat-tool-msg-collapse:has(.cl-remote-agent-card)',
16
+ ],
17
+ outputHostMargin: [],
18
+ outputHostMarginReset: [
19
+ 'details.chat-tool-msg-collapse:has(.cl-remote-agent-card)',
20
+ '.chat-tool-msg-collapse:has(.cl-remote-agent-card)',
21
+ ],
22
+ summaryHidden: [
23
+ 'details.chat-tool-msg-collapse:has(.cl-remote-agent-card) > summary.chat-tool-msg-summary',
24
+ '.chat-tool-msg-collapse:has(.cl-remote-agent-card) > .chat-tool-msg-summary',
25
+ ],
26
+ hostShellRawText: [
27
+ '.chat-tool-msg-body.cl-remote-agent-host-shell > .chat-text',
28
+ ],
29
+ rawTextCardHosts: [
30
+ '.chat-tool-msg-body:has(.cl-remote-agent-card) > .chat-text',
31
+ '.chat-tool-card__detail:has(.cl-remote-agent-card) > .chat-text',
32
+ ],
33
+ rawTextPlaceholderHosts: [
34
+ '.chat-tool-msg-body:has(.cl-remote-agent-output-placeholder) > .chat-text',
35
+ '.chat-tool-card__detail:has(.cl-remote-agent-output-placeholder) > .chat-text',
36
+ ],
37
+ hostBody: [
38
+ 'details.chat-tool-msg-collapse:has(.cl-remote-agent-card) > .chat-tool-msg-body',
39
+ '.chat-tool-msg-collapse:has(.cl-remote-agent-card) > .chat-tool-msg-body',
40
+ ],
41
+ manualOpenReset: [
42
+ '.chat-tool-msg-collapse.chat-tool-msg-collapse--manual.is-open:has(.cl-remote-agent-card)',
43
+ ],
44
+ hostShellReset: [
45
+ '.cl-remote-agent-host-shell.chat-tool-card',
46
+ '.cl-remote-agent-host-shell.chat-tool-card__detail',
47
+ '.cl-remote-agent-host-shell.chat-tool-msg-body',
48
+ 'details.cl-remote-agent-host-shell',
49
+ ],
50
+ hostShellSummary: [
51
+ '.cl-remote-agent-host-shell > summary.chat-tool-msg-summary',
52
+ '.cl-remote-agent-host-shell > .chat-tool-msg-summary',
53
+ ],
54
+ modernCardLayout: false,
55
+ },
56
+ nativeStyle: {
57
+ shellSelectors: [
58
+ '.chat-tool-card:not(:has(.cl-remote-agent-card))',
59
+ '.chat-tool-msg-collapse:not(:has(.cl-remote-agent-card))',
60
+ ],
61
+ summarySelectors: [
62
+ '.chat-tool-card__header',
63
+ '.chat-tool-card__title',
64
+ '.chat-tool-msg-summary:not(.cl-remote-agent-host-shell *)',
65
+ ],
66
+ indentSelectors: [
67
+ '.chat-group.tool:not(:has(.cl-remote-agent-card))',
68
+ '.chat-bubble:not(:has(.cl-remote-agent-card))',
69
+ ],
70
+ },
71
+ selectors: {
72
+ textContext: '.chat-text, .chat-tool-card__detail, .chat-tool-msg-body',
73
+ summary: ':scope > .chat-tool-msg-summary, .chat-tool-msg-summary',
74
+ forceOpenHeader: '.chat-tool-msg-summary',
75
+ rawTextHostClosest: [
76
+ '.chat-tool-msg-body',
77
+ '.chat-tool-card__detail',
78
+ '.chat-bubble',
79
+ ],
80
+ rawTextHostsWithinShell: '.chat-tool-msg-body, .chat-tool-card__detail, .chat-bubble',
81
+ },
82
+ isRemoteNativeToolShellCandidate: function(node) {
83
+ return _matches(node, 'details.chat-tool-msg-collapse, .chat-tool-msg-collapse, .chat-tool-card');
84
+ },
85
+ isNativeToolShell: function(node) {
86
+ return _matches(node, 'details.chat-tool-msg-collapse, .chat-tool-msg-collapse');
87
+ },
88
+ isToolLikeShell: function(node) {
89
+ return _matches(node, 'details.chat-tool-msg-collapse, .chat-tool-msg-collapse, .chat-tool-card, .chat-tool-msg-body, .chat-tool-card__detail');
90
+ },
91
+ isToolBody: function(node) {
92
+ return _matches(node, '.chat-tool-msg-body');
93
+ },
94
+ isMarkableHost: function(node) {
95
+ return _matches(node, 'details.chat-tool-msg-collapse, .chat-tool-card, .chat-tool-card__detail, .chat-tool-msg-body');
96
+ },
97
+ };
98
+
99
+ CL.hostAdapter = adapter;
100
+ try {
101
+ document.documentElement.setAttribute('data-openagent-host-adapter', adapter.id);
102
+ } catch (e) {}
103
+ })();
@@ -0,0 +1,125 @@
1
+ // ── OpenClaw 2026.5 host adapter ──
2
+ // Host DOM uses the newer tools-collapse family, with msg-collapse kept as a
3
+ // compatible secondary path for mixed 2026.5 builds.
4
+
5
+ (function _clInstallHostAdapter202605() {
6
+ function _matches(node, selector) {
7
+ return !!(node && selector && node.matches && node.matches(selector));
8
+ }
9
+
10
+ var adapter = {
11
+ id: 'oc-2026-05',
12
+ family: '2026.5',
13
+ css: {
14
+ remoteShell: [
15
+ 'details.chat-tools-collapse:has(.cl-remote-agent-card)',
16
+ 'details.chat-tool-msg-collapse:has(.cl-remote-agent-card)',
17
+ '.chat-tools-collapse:has(.cl-remote-agent-card)',
18
+ '.chat-tool-msg-collapse:has(.cl-remote-agent-card)',
19
+ ],
20
+ outputHostMargin: [
21
+ 'details.chat-tools-collapse:has(.cl-output-card)',
22
+ '.chat-tools-collapse:has(.cl-output-card)',
23
+ 'details.chat-tool-msg-collapse:has(.cl-remote-agent-card)',
24
+ '.chat-tool-msg-collapse:has(.cl-remote-agent-card)',
25
+ ],
26
+ outputHostMarginReset: [],
27
+ summaryHidden: [
28
+ 'details.chat-tools-collapse:has(.cl-remote-agent-card) > summary.chat-tools-summary',
29
+ 'details.chat-tool-msg-collapse:has(.cl-remote-agent-card) > summary.chat-tool-msg-summary',
30
+ '.chat-tools-collapse:has(.cl-remote-agent-card) > .chat-tools-summary',
31
+ '.chat-tool-msg-collapse:has(.cl-remote-agent-card) > .chat-tool-msg-summary',
32
+ ],
33
+ hostShellRawText: [
34
+ '.chat-tools-collapse__body.cl-remote-agent-host-shell > .chat-text',
35
+ '.chat-tool-msg-body.cl-remote-agent-host-shell > .chat-text',
36
+ ],
37
+ rawTextCardHosts: [
38
+ '.chat-tools-collapse__body:has(.cl-remote-agent-card) > .chat-text',
39
+ '.chat-tool-msg-body:has(.cl-remote-agent-card) > .chat-text',
40
+ '.chat-tool-card__detail:has(.cl-remote-agent-card) > .chat-text',
41
+ ],
42
+ rawTextPlaceholderHosts: [
43
+ '.chat-tools-collapse__body:has(.cl-remote-agent-output-placeholder) > .chat-text',
44
+ '.chat-tool-msg-body:has(.cl-remote-agent-output-placeholder) > .chat-text',
45
+ '.chat-tool-card__detail:has(.cl-remote-agent-output-placeholder) > .chat-text',
46
+ ],
47
+ hostBody: [
48
+ 'details.chat-tools-collapse:has(.cl-remote-agent-card) > .chat-tools-collapse__body',
49
+ 'details.chat-tool-msg-collapse:has(.cl-remote-agent-card) > .chat-tool-msg-body',
50
+ '.chat-tools-collapse:has(.cl-remote-agent-card) > .chat-tools-collapse__body',
51
+ '.chat-tool-msg-collapse:has(.cl-remote-agent-card) > .chat-tool-msg-body',
52
+ ],
53
+ manualOpenReset: [
54
+ '.chat-tool-msg-collapse.chat-tool-msg-collapse--manual.is-open:has(.cl-remote-agent-card)',
55
+ ],
56
+ hostShellReset: [
57
+ '.cl-remote-agent-host-shell.chat-tool-card',
58
+ '.cl-remote-agent-host-shell.chat-tool-card__detail',
59
+ '.cl-remote-agent-host-shell.chat-tools-collapse__body',
60
+ '.cl-remote-agent-host-shell.chat-tool-msg-body',
61
+ 'details.cl-remote-agent-host-shell',
62
+ ],
63
+ hostShellSummary: [
64
+ '.cl-remote-agent-host-shell > summary.chat-tools-summary',
65
+ '.cl-remote-agent-host-shell > summary.chat-tool-msg-summary',
66
+ '.cl-remote-agent-host-shell > .chat-tools-summary',
67
+ '.cl-remote-agent-host-shell > .chat-tool-msg-summary',
68
+ ],
69
+ modernCardLayout: true,
70
+ },
71
+ nativeStyle: {
72
+ shellSelectors: [
73
+ '.chat-tool-card:not(:has(.cl-remote-agent-card))',
74
+ '.chat-tool-msg-collapse:not(:has(.cl-remote-agent-card))',
75
+ '.chat-tools-collapse:not(:has(.cl-remote-agent-card))',
76
+ '.tool-card:not(:has(.cl-remote-agent-card))',
77
+ '.chat-tool-card__wrapper:not(:has(.cl-remote-agent-card))',
78
+ ],
79
+ summarySelectors: [
80
+ '.chat-tool-card__header',
81
+ '.chat-tool-card__title',
82
+ '.chat-tool-msg-summary:not(.cl-remote-agent-host-shell *)',
83
+ '.chat-tools-summary:not(.cl-remote-agent-host-shell *)',
84
+ '.tool-card__header',
85
+ '.tool-card__title',
86
+ ],
87
+ indentSelectors: [
88
+ '.chat-group.tool:not(:has(.cl-remote-agent-card))',
89
+ '.chat-bubble:not(:has(.cl-remote-agent-card))',
90
+ ],
91
+ },
92
+ selectors: {
93
+ textContext: '.chat-text, .chat-tool-card__detail, .chat-tool-msg-body, .chat-tools-collapse__body',
94
+ summary: ':scope > summary, :scope > .chat-tools-summary, :scope > .chat-tool-msg-summary, .chat-tools-summary, .chat-tool-msg-summary',
95
+ forceOpenHeader: '.chat-tool-msg-summary, .chat-tools-summary',
96
+ rawTextHostClosest: [
97
+ '.chat-tools-collapse__body',
98
+ '.chat-tool-msg-body',
99
+ '.chat-tool-card__detail',
100
+ '.chat-bubble',
101
+ ],
102
+ rawTextHostsWithinShell: '.chat-tools-collapse__body, .chat-tool-msg-body, .chat-tool-card__detail, .chat-bubble',
103
+ },
104
+ isRemoteNativeToolShellCandidate: function(node) {
105
+ return _matches(node, 'details.chat-tools-collapse, details.chat-tool-msg-collapse, .chat-tools-collapse, .chat-tool-msg-collapse, .chat-tool-card');
106
+ },
107
+ isNativeToolShell: function(node) {
108
+ return _matches(node, 'details.chat-tools-collapse, details.chat-tool-msg-collapse, .chat-tools-collapse, .chat-tool-msg-collapse');
109
+ },
110
+ isToolLikeShell: function(node) {
111
+ return _matches(node, 'details.chat-tools-collapse, details.chat-tool-msg-collapse, .chat-tools-collapse, .chat-tool-msg-collapse, .chat-tool-card, .chat-tools-collapse__body, .chat-tool-msg-body, .chat-tool-card__detail');
112
+ },
113
+ isToolBody: function(node) {
114
+ return _matches(node, '.chat-tools-collapse__body, .chat-tool-msg-body');
115
+ },
116
+ isMarkableHost: function(node) {
117
+ return _matches(node, 'details.chat-tools-collapse, details.chat-tool-msg-collapse, .chat-tool-card, .chat-tool-card__detail, .chat-tools-collapse__body, .chat-tool-msg-body');
118
+ },
119
+ };
120
+
121
+ CL.hostAdapter = adapter;
122
+ try {
123
+ document.documentElement.setAttribute('data-openagent-host-adapter', adapter.id);
124
+ } catch (e) {}
125
+ })();
@@ -0,0 +1,125 @@
1
+ // ── OpenClaw 2026.6 host adapter ──
2
+ // 2026.6 uses the V2 OpenAgent card path and the newer tools-collapse host
3
+ // structure. Selector values intentionally mirror the 2026.5 adapter.
4
+
5
+ (function _clInstallHostAdapter202606() {
6
+ function _matches(node, selector) {
7
+ return !!(node && selector && node.matches && node.matches(selector));
8
+ }
9
+
10
+ var adapter = {
11
+ id: 'oc-2026-06',
12
+ family: '2026.6',
13
+ css: {
14
+ remoteShell: [
15
+ 'details.chat-tools-collapse:has(.cl-remote-agent-card)',
16
+ 'details.chat-tool-msg-collapse:has(.cl-remote-agent-card)',
17
+ '.chat-tools-collapse:has(.cl-remote-agent-card)',
18
+ '.chat-tool-msg-collapse:has(.cl-remote-agent-card)',
19
+ ],
20
+ outputHostMargin: [
21
+ 'details.chat-tools-collapse:has(.cl-output-card)',
22
+ '.chat-tools-collapse:has(.cl-output-card)',
23
+ 'details.chat-tool-msg-collapse:has(.cl-remote-agent-card)',
24
+ '.chat-tool-msg-collapse:has(.cl-remote-agent-card)',
25
+ ],
26
+ outputHostMarginReset: [],
27
+ summaryHidden: [
28
+ 'details.chat-tools-collapse:has(.cl-remote-agent-card) > summary.chat-tools-summary',
29
+ 'details.chat-tool-msg-collapse:has(.cl-remote-agent-card) > summary.chat-tool-msg-summary',
30
+ '.chat-tools-collapse:has(.cl-remote-agent-card) > .chat-tools-summary',
31
+ '.chat-tool-msg-collapse:has(.cl-remote-agent-card) > .chat-tool-msg-summary',
32
+ ],
33
+ hostShellRawText: [
34
+ '.chat-tools-collapse__body.cl-remote-agent-host-shell > .chat-text',
35
+ '.chat-tool-msg-body.cl-remote-agent-host-shell > .chat-text',
36
+ ],
37
+ rawTextCardHosts: [
38
+ '.chat-tools-collapse__body:has(.cl-remote-agent-card) > .chat-text',
39
+ '.chat-tool-msg-body:has(.cl-remote-agent-card) > .chat-text',
40
+ '.chat-tool-card__detail:has(.cl-remote-agent-card) > .chat-text',
41
+ ],
42
+ rawTextPlaceholderHosts: [
43
+ '.chat-tools-collapse__body:has(.cl-remote-agent-output-placeholder) > .chat-text',
44
+ '.chat-tool-msg-body:has(.cl-remote-agent-output-placeholder) > .chat-text',
45
+ '.chat-tool-card__detail:has(.cl-remote-agent-output-placeholder) > .chat-text',
46
+ ],
47
+ hostBody: [
48
+ 'details.chat-tools-collapse:has(.cl-remote-agent-card) > .chat-tools-collapse__body',
49
+ 'details.chat-tool-msg-collapse:has(.cl-remote-agent-card) > .chat-tool-msg-body',
50
+ '.chat-tools-collapse:has(.cl-remote-agent-card) > .chat-tools-collapse__body',
51
+ '.chat-tool-msg-collapse:has(.cl-remote-agent-card) > .chat-tool-msg-body',
52
+ ],
53
+ manualOpenReset: [
54
+ '.chat-tool-msg-collapse.chat-tool-msg-collapse--manual.is-open:has(.cl-remote-agent-card)',
55
+ ],
56
+ hostShellReset: [
57
+ '.cl-remote-agent-host-shell.chat-tool-card',
58
+ '.cl-remote-agent-host-shell.chat-tool-card__detail',
59
+ '.cl-remote-agent-host-shell.chat-tools-collapse__body',
60
+ '.cl-remote-agent-host-shell.chat-tool-msg-body',
61
+ 'details.cl-remote-agent-host-shell',
62
+ ],
63
+ hostShellSummary: [
64
+ '.cl-remote-agent-host-shell > summary.chat-tools-summary',
65
+ '.cl-remote-agent-host-shell > summary.chat-tool-msg-summary',
66
+ '.cl-remote-agent-host-shell > .chat-tools-summary',
67
+ '.cl-remote-agent-host-shell > .chat-tool-msg-summary',
68
+ ],
69
+ modernCardLayout: true,
70
+ },
71
+ nativeStyle: {
72
+ shellSelectors: [
73
+ '.chat-tool-card:not(:has(.cl-remote-agent-card))',
74
+ '.chat-tool-msg-collapse:not(:has(.cl-remote-agent-card))',
75
+ '.chat-tools-collapse:not(:has(.cl-remote-agent-card))',
76
+ '.tool-card:not(:has(.cl-remote-agent-card))',
77
+ '.chat-tool-card__wrapper:not(:has(.cl-remote-agent-card))',
78
+ ],
79
+ summarySelectors: [
80
+ '.chat-tool-card__header',
81
+ '.chat-tool-card__title',
82
+ '.chat-tool-msg-summary:not(.cl-remote-agent-host-shell *)',
83
+ '.chat-tools-summary:not(.cl-remote-agent-host-shell *)',
84
+ '.tool-card__header',
85
+ '.tool-card__title',
86
+ ],
87
+ indentSelectors: [
88
+ '.chat-group.tool:not(:has(.cl-remote-agent-card))',
89
+ '.chat-bubble:not(:has(.cl-remote-agent-card))',
90
+ ],
91
+ },
92
+ selectors: {
93
+ textContext: '.chat-text, .chat-tool-card__detail, .chat-tool-msg-body, .chat-tools-collapse__body',
94
+ summary: ':scope > summary, :scope > .chat-tools-summary, :scope > .chat-tool-msg-summary, .chat-tools-summary, .chat-tool-msg-summary',
95
+ forceOpenHeader: '.chat-tool-msg-summary, .chat-tools-summary',
96
+ rawTextHostClosest: [
97
+ '.chat-tools-collapse__body',
98
+ '.chat-tool-msg-body',
99
+ '.chat-tool-card__detail',
100
+ '.chat-bubble',
101
+ ],
102
+ rawTextHostsWithinShell: '.chat-tools-collapse__body, .chat-tool-msg-body, .chat-tool-card__detail, .chat-bubble',
103
+ },
104
+ isRemoteNativeToolShellCandidate: function(node) {
105
+ return _matches(node, 'details.chat-tools-collapse, details.chat-tool-msg-collapse, .chat-tools-collapse, .chat-tool-msg-collapse, .chat-tool-card');
106
+ },
107
+ isNativeToolShell: function(node) {
108
+ return _matches(node, 'details.chat-tools-collapse, details.chat-tool-msg-collapse, .chat-tools-collapse, .chat-tool-msg-collapse');
109
+ },
110
+ isToolLikeShell: function(node) {
111
+ return _matches(node, 'details.chat-tools-collapse, details.chat-tool-msg-collapse, .chat-tools-collapse, .chat-tool-msg-collapse, .chat-tool-card, .chat-tools-collapse__body, .chat-tool-msg-body, .chat-tool-card__detail');
112
+ },
113
+ isToolBody: function(node) {
114
+ return _matches(node, '.chat-tools-collapse__body, .chat-tool-msg-body');
115
+ },
116
+ isMarkableHost: function(node) {
117
+ return _matches(node, 'details.chat-tools-collapse, details.chat-tool-msg-collapse, .chat-tool-card, .chat-tool-card__detail, .chat-tools-collapse__body, .chat-tool-msg-body');
118
+ },
119
+ };
120
+
121
+ CL.hostAdapter = adapter;
122
+ try {
123
+ document.documentElement.setAttribute('data-openagent-host-adapter', adapter.id);
124
+ } catch (e) {}
125
+ })();
@@ -0,0 +1,48 @@
1
+ // ── Unknown OpenClaw host adapter ──
2
+ // Fail closed: render OpenAgent's own card, but do not apply host-structure
3
+ // takeover selectors when the host version is not one of the supported series.
4
+
5
+ (function _clInstallHostAdapterUnknown() {
6
+ function _false() { return false; }
7
+
8
+ var adapter = {
9
+ id: 'oc-unknown',
10
+ family: 'unknown',
11
+ css: {
12
+ remoteShell: [],
13
+ outputHostMargin: [],
14
+ outputHostMarginReset: [],
15
+ summaryHidden: [],
16
+ hostShellRawText: [],
17
+ rawTextCardHosts: [],
18
+ rawTextPlaceholderHosts: [],
19
+ hostBody: [],
20
+ manualOpenReset: [],
21
+ hostShellReset: [],
22
+ hostShellSummary: [],
23
+ modernCardLayout: false,
24
+ },
25
+ nativeStyle: {
26
+ shellSelectors: [],
27
+ summarySelectors: [],
28
+ indentSelectors: [],
29
+ },
30
+ selectors: {
31
+ textContext: '.chat-text',
32
+ summary: '',
33
+ forceOpenHeader: '',
34
+ rawTextHostClosest: [],
35
+ rawTextHostsWithinShell: '',
36
+ },
37
+ isRemoteNativeToolShellCandidate: _false,
38
+ isNativeToolShell: _false,
39
+ isToolLikeShell: _false,
40
+ isToolBody: _false,
41
+ isMarkableHost: _false,
42
+ };
43
+
44
+ CL.hostAdapter = adapter;
45
+ try {
46
+ document.documentElement.setAttribute('data-openagent-host-adapter', adapter.id);
47
+ } catch (e) {}
48
+ })();