openclaw-openagent 1.0.11 → 1.0.13

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 (65) hide show
  1. package/dist/index.js +3 -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/config/config-schema.d.ts +9 -0
  5. package/dist/src/config/config-schema.js +6 -0
  6. package/dist/src/plugin-ui/adapters/adapters/oc-2026-04.js +103 -0
  7. package/dist/src/plugin-ui/adapters/adapters/oc-2026-05.js +125 -0
  8. package/dist/src/plugin-ui/adapters/adapters/oc-2026-06.js +125 -0
  9. package/dist/src/plugin-ui/adapters/adapters/oc-unknown.js +48 -0
  10. package/dist/src/plugin-ui/adapters/oc-2026-04.js +103 -0
  11. package/dist/src/plugin-ui/adapters/oc-2026-05.js +125 -0
  12. package/dist/src/plugin-ui/adapters/oc-2026-06.js +125 -0
  13. package/dist/src/plugin-ui/adapters/oc-unknown.js +48 -0
  14. package/dist/src/plugin-ui/assets/openagent-override.js +1129 -273
  15. package/dist/src/plugin-ui/index.d.ts +1 -1
  16. package/dist/src/plugin-ui/index.js +2 -2
  17. package/dist/src/plugin-ui/ui-extension-loader/index.d.ts +2 -1
  18. package/dist/src/plugin-ui/ui-extension-loader/index.js +5 -5
  19. package/dist/src/plugin-ui/ui-extension-loader/registry-regex.js +75 -8
  20. package/dist/src/plugin-ui/ui-extension-loader/types.d.ts +4 -1
  21. package/dist/src/proxy/auth-proxy.js +5 -0
  22. package/dist/src/runtime/update-checker.d.ts +18 -0
  23. package/dist/src/runtime/update-checker.js +253 -0
  24. package/dist/src/state/store.d.ts +21 -0
  25. package/dist/src/state/store.js +54 -0
  26. package/dist/src/transport/oasn/oasn-invocation.d.ts +3 -0
  27. package/dist/src/transport/oasn/oasn-invocation.js +28 -12
  28. package/dist/src/transport/oasn/oasn-types.d.ts +8 -4
  29. package/index.ts +4 -1
  30. package/package.json +4 -3
  31. package/src/app/remote-agent-tool.ts +131 -16
  32. package/src/app/types.ts +2 -2
  33. package/src/config/config-schema.ts +6 -0
  34. package/src/plugin-ui/adapters/oc-2026-04.js +103 -0
  35. package/src/plugin-ui/adapters/oc-2026-05.js +125 -0
  36. package/src/plugin-ui/adapters/oc-2026-06.js +125 -0
  37. package/src/plugin-ui/adapters/oc-unknown.js +48 -0
  38. package/src/plugin-ui/assets/openagent-override.js +1129 -273
  39. package/src/plugin-ui/build.cjs +249 -38
  40. package/src/plugin-ui/index.ts +2 -2
  41. package/src/plugin-ui/modules/agent-book/panel/agent-book.js +102 -12
  42. package/src/plugin-ui/modules/agent-book/panel/inject-ui.js +105 -3
  43. package/src/plugin-ui/modules/agent-book/panel/styles.js +54 -48
  44. package/src/plugin-ui/modules/agent-book/remote-agent-tool/components-core.js +4 -2
  45. package/src/plugin-ui/modules/agent-book/remote-agent-tool/thought-chain-card.js +4 -1
  46. package/src/plugin-ui/modules/agent-book/scanner.js +17 -5
  47. package/src/plugin-ui/modules/agent-book/travelcard/travel-styles.js +12 -1
  48. package/src/plugin-ui/modules/loader/bootstrap.js +95 -0
  49. package/src/plugin-ui/modules/loader/shared-state.js +244 -20
  50. package/src/plugin-ui/modules/remote-agent/execution-card.js +54 -16
  51. package/src/plugin-ui/modules/remote-agent/native-style-adapter.js +5 -23
  52. package/src/plugin-ui/modules/remote-agent/output-card.js +13 -7
  53. package/src/plugin-ui/modules/remote-agent/render-hooks.js +53 -41
  54. package/src/plugin-ui/modules/remote-agent/styles.js +238 -89
  55. package/src/plugin-ui/modules/remote-agent/tool-card-model.js +72 -4
  56. package/src/plugin-ui/postinstall-deploy.cjs +52 -0
  57. package/src/plugin-ui/ui-extension-loader/index.ts +6 -6
  58. package/src/plugin-ui/ui-extension-loader/registry-regex.ts +81 -9
  59. package/src/plugin-ui/ui-extension-loader/types.ts +5 -1
  60. package/src/proxy/auth-proxy.ts +5 -0
  61. package/src/runtime/update-checker.ts +286 -0
  62. package/src/state/store.ts +80 -0
  63. package/src/transport/oasn/oasn-invocation.ts +47 -12
  64. package/src/transport/oasn/oasn-types.ts +6 -2
  65. package/src/types/openclaw-plugin-sdk-media-store.d.ts +9 -0
@@ -407,15 +407,10 @@ export class OasnInvocation {
407
407
  };
408
408
  }
409
409
 
410
- // 失败/超时/取消 —— 文本统一用 user_error.message 兜底
411
- const userError = final.userError ?? final.user_error;
412
- const inlineResult = final.inlineResult ?? final.inline_result;
413
- const visible = final.visibleResult ?? final.visible_result;
414
- const message = userError?.message
415
- ?? inlineResult?.summary
416
- ?? visible?.inlineResultSummary
417
- ?? visible?.inline_result_summary
418
- ?? `Invocation ended with status=${final.status}`;
410
+ const message = this._invocationFailureMessage(
411
+ final,
412
+ `Invocation ended with status=${final.status}`,
413
+ );
419
414
  return {
420
415
  requestId: invocationId,
421
416
  status: 'error',
@@ -450,15 +445,55 @@ export class OasnInvocation {
450
445
 
451
446
  /** 终态错误专用 TransportError,便于上层 catch */
452
447
  private _terminalError(final: GetInvocationResponse, handle: TaskHandle): TransportError {
453
- const userError = final.userError ?? final.user_error;
454
- const code = userError?.code ?? `INVOCATION_${final.status.toUpperCase()}`;
455
- const msg = userError?.message ?? `Invocation ${final.status}`;
448
+ const code = this._invocationFailureCode(final) ?? `INVOCATION_${final.status.toUpperCase()}`;
449
+ const msg = this._invocationFailureMessage(final, `Invocation ${final.status}`);
456
450
  return makeTransportError(code, msg, {
457
451
  invocationId: handle.invocationId,
458
452
  sessionId: handle.sessionId,
459
453
  });
460
454
  }
461
455
 
456
+ private _invocationFailureCode(final: GetInvocationResponse): string | undefined {
457
+ return this._firstText(
458
+ final.userError?.code,
459
+ final.user_error?.code,
460
+ final.userErrorCode,
461
+ final.user_error_code,
462
+ );
463
+ }
464
+
465
+ private _invocationFailureMessage(final: GetInvocationResponse, fallback: string): string {
466
+ const userMessage = this._firstText(
467
+ final.userError?.message,
468
+ final.user_error?.message,
469
+ final.userErrorMessage,
470
+ final.user_error_message,
471
+ );
472
+ if (userMessage) return userMessage;
473
+
474
+ const inlineResult = final.inlineResult ?? final.inline_result;
475
+ const visible = final.visibleResult ?? final.visible_result;
476
+ const fallbackMessage = this._firstText(
477
+ inlineResult?.summary,
478
+ visible?.inlineResultSummary,
479
+ visible?.inline_result_summary,
480
+ final.progress?.safeStatusMessage,
481
+ final.progress?.safe_status_message,
482
+ );
483
+ const code = this._invocationFailureCode(final);
484
+ if (fallbackMessage && code && !fallbackMessage.includes(code)) return `${fallbackMessage} (${code})`;
485
+ return fallbackMessage ?? code ?? fallback;
486
+ }
487
+
488
+ private _firstText(...values: Array<unknown>): string | undefined {
489
+ for (const value of values) {
490
+ if (typeof value !== 'string') continue;
491
+ const trimmed = value.trim();
492
+ if (trimmed) return trimmed;
493
+ }
494
+ return undefined;
495
+ }
496
+
462
497
  private _toArtifactRef(art: ArtifactResponse): ArtifactRef {
463
498
  return {
464
499
  id: art.artifactId ?? art.artifact_id ?? '',
@@ -316,8 +316,12 @@ export interface GetInvocationResponse {
316
316
  nextPollAfterMs?: number | null;
317
317
  next_poll_after_ms?: number | null;
318
318
  warnings?: string[];
319
- userError?: { code: string; message: string };
320
- user_error?: { code: string; message: 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;
321
325
  createdAt?: string;
322
326
  created_at?: string;
323
327
  updatedAt?: string;
@@ -0,0 +1,9 @@
1
+ declare module 'openclaw/plugin-sdk/media-store' {
2
+ export function saveMediaBuffer(
3
+ buffer: Buffer,
4
+ mimeType: string,
5
+ namespace: string,
6
+ maxBytes: number,
7
+ filename?: string,
8
+ ): Promise<{ id: string }>;
9
+ }