@xopcai/xopc 0.0.233 → 0.0.235
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.
- package/dist/browser-ext/manifest.json +1 -1
- package/dist/extensions/feishu/src/outbound/media-load.js +1 -1
- package/dist/extensions/telegram/xopc.extension.json +1 -1
- package/dist/gateway/static/root/assets/{activity-store-DQ5L3PTi.js → activity-store-BzswYHcj.js} +1 -1
- package/dist/gateway/static/root/assets/{agent-avatar-dicebear-Bps8fvBp.js → agent-avatar-dicebear-dvh9aEm6.js} +1 -1
- package/dist/gateway/static/root/assets/agent-defaults-settings-panel-B9tkmkUj.js +1 -0
- package/dist/gateway/static/root/assets/agents-DTXYo-7z.js +1 -0
- package/dist/gateway/static/root/assets/{api-DE6tZKG0.js → api-7zOtMbaE.js} +1 -1
- package/dist/gateway/static/root/assets/{app-management-settings-panel-BryzDVod.js → app-management-settings-panel-DXFTk7x6.js} +1 -1
- package/dist/gateway/static/root/assets/{appearance-settings-BoweLBDm.js → appearance-settings-D-FD5SOq.js} +1 -1
- package/dist/gateway/static/root/assets/apps-page-BT102W58.js +1 -0
- package/dist/gateway/static/root/assets/{archive-plugin-DyujzZNu.js → archive-plugin-DawToDU8.js} +1 -1
- package/dist/gateway/static/root/assets/{attachment-load-DmXGUWve.js → attachment-load-DmBAKvsi.js} +1 -1
- package/dist/gateway/static/root/assets/{automations-page-DrTVSK7o.js → automations-page-BGkF6XNH.js} +1 -1
- package/dist/gateway/static/root/assets/automations-workspace-BRb45-_R.js +6 -0
- package/dist/gateway/static/root/assets/{binary-plugins-mFyeC74W.js → binary-plugins-B-6Ski7l.js} +1 -1
- package/dist/gateway/static/root/assets/{block-editor-D5yMFrgH.js → block-editor-BgeKQN1F.js} +3 -3
- package/dist/gateway/static/root/assets/browser-settings-page-BkRWxC7D.js +8 -0
- package/dist/gateway/static/root/assets/{browser-workflow-inputs-B6rLBtua.js → browser-workflow-inputs-4ooVX-Tx.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-workflows-page-C74sg50f.js → browser-workflows-page-D92g81lS.js} +2 -2
- package/dist/gateway/static/root/assets/capabilities-settings-panel-DfT-vWTA.js +7 -0
- package/dist/gateway/static/root/assets/channels-settings-C9oGpLR0.js +1 -0
- package/dist/gateway/static/root/assets/{channels-status-swr-DowVNjNw.js → channels-status-swr-BDJvMnA_.js} +1 -1
- package/dist/gateway/static/root/assets/{chat-terminal-dock-BO6_BgjE.js → chat-terminal-dock-C_9LUs7G.js} +2 -2
- package/dist/gateway/static/root/assets/connectors-page-SJKV6SHT.js +2 -0
- package/dist/gateway/static/root/assets/{cron-expression-CYMXfk4M.js → cron-expression-BYmr5ZuN.js} +1 -1
- package/dist/gateway/static/root/assets/{date-picker-DIM_OkQP.js → date-picker-FKL_b_S0.js} +1 -1
- package/dist/gateway/static/root/assets/{dependency-picker-Cp8I6rsL.js → dependency-picker-BP68vqBI.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-wzSzZ6S8.js → desktop-pet-DOXjRTqK.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-settings-NjPiz3M_.js → desktop-pet-settings-CuG2qYoY.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-debug-page-CoMl13ET.js → extension-debug-page-BeJ1-5ID.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-page-CXc1Lc8x.js → extension-page-CncDndLS.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-settings-page-CfEWpgjl.js → extension-settings-page-BxxL0HqU.js} +1 -1
- package/dist/gateway/static/root/assets/{files-Dp8_uGTO.js → files-DQjhZjr2.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-config-api-yH4KAEkK.js → gateway-config-api-Dc6A6HyJ.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-config-swr-YyZJKvFf.js → gateway-config-swr-R702lNJR.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-settings-BmjJIiKh.js → gateway-settings-C2XcazGD.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-startup-retry-Dnrl91pU.js → gateway-startup-retry-2rVSUvyw.js} +1 -1
- package/dist/gateway/static/root/assets/heartbeat-settings-BjUEqkkC.js +1 -0
- package/dist/gateway/static/root/assets/home-page-DTSjwfAQ.js +1 -0
- package/dist/gateway/static/root/assets/{image-generation-api-BNzAAw4Y.js → image-generation-api-B28USRCK.js} +1 -1
- package/dist/gateway/static/root/assets/index-DFfvY8IN.js +70 -0
- package/dist/gateway/static/root/assets/{keyboard-shortcuts-settings-CfNV1ysF.js → keyboard-shortcuts-settings-Cwinks_5.js} +1 -1
- package/dist/gateway/static/root/assets/local-app-workbench-page-0wntj9mK.js +2 -0
- package/dist/gateway/static/root/assets/{local-apps-page-MPd4Fl_l.js → local-apps-page-WeKm5vZ0.js} +1 -1
- package/dist/gateway/static/root/assets/{locale-store-D_dq_0LV.js → locale-store-8k4mvYGL.js} +1 -1
- package/dist/gateway/static/root/assets/logs-page-DFgJr7Zx.js +2 -0
- package/dist/gateway/static/root/assets/{management-settings-DeIjN4e0.js → management-settings-8bEvKO0R.js} +1 -1
- package/dist/gateway/static/root/assets/{markdown-split-BUAVv6Gu.js → markdown-split-B6wQhwLV.js} +1 -1
- package/dist/gateway/static/root/assets/{markdown-view-CPkBOY3h.js → markdown-view-D02mJdoU.js} +1 -1
- package/dist/gateway/static/root/assets/{media-plugins-DFsVnOY-.js → media-plugins-BSEPuO76.js} +1 -1
- package/dist/gateway/static/root/assets/{messages-D4qOHT4D.js → messages-CoovNoMn.js} +2 -2
- package/dist/gateway/static/root/assets/{mobile-device-api-D9JevyCE.js → mobile-device-api-CvjVB_TB.js} +1 -1
- package/dist/gateway/static/root/assets/models-hub-cache-CYr6LzvY.js +1 -0
- package/dist/gateway/static/root/assets/{notes-api-BWSfTP1w.js → notes-api-p2Pncp2B.js} +1 -1
- package/dist/gateway/static/root/assets/{notes-page-CV8UJj7g.js → notes-page-CPgbeO1u.js} +1 -1
- package/dist/gateway/static/root/assets/notes-workbench-DIXCtwhs.js +4 -0
- package/dist/gateway/static/root/assets/{oauth-api-DnanEBsf.js → oauth-api-DpLONwfK.js} +1 -1
- package/dist/gateway/static/root/assets/{product-open-page-zNg1KOy2.js → product-open-page-DNHWn_26.js} +1 -1
- package/dist/gateway/static/root/assets/project-detail-page-6jgRJg4w.js +1 -0
- package/dist/gateway/static/root/assets/projects-page-Bd4nXs4y.js +1 -0
- package/dist/gateway/static/root/assets/{registry-api-BeVzfRvs.js → registry-api-B7b0LJgI.js} +1 -1
- package/dist/gateway/static/root/assets/remote-access-hub-C_5-u9U-.js +1 -0
- package/dist/gateway/static/root/assets/{runtime-tools-settings-panel-BxoioSvT.js → runtime-tools-settings-panel-D3TCJGy3.js} +1 -1
- package/dist/gateway/static/root/assets/{schema-form-vzbmscrE.js → schema-form-DUAlwNoO.js} +1 -1
- package/dist/gateway/static/root/assets/sessions-page-BqYAR86S.js +1 -0
- package/dist/gateway/static/root/assets/settings-advanced-gate-a146I0uZ.js +1 -0
- package/dist/gateway/static/root/assets/{settings-form-section-x9k7MWD3.js → settings-form-section-D7nQ3Lfu.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-loading-skeleton-BLFOD9h9.js → settings-loading-skeleton-CwGM9zKH.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-CwgTooar.js → settings-page-CMAkMc3I.js} +1 -1
- package/dist/gateway/static/root/assets/setup-status-panel-rhaERxAL.js +1 -0
- package/dist/gateway/static/root/assets/{share-preview-page-COTrPAd-.js → share-preview-page-BzkXvuH6.js} +1 -1
- package/dist/gateway/static/root/assets/shares-settings-BvsM3Im5.js +1 -0
- package/dist/gateway/static/root/assets/skill-reload-api-u7E0gqFo.js +1 -0
- package/dist/gateway/static/root/assets/{skills-page-D9wM6_Jn.js → skills-page-DJRr5HFw.js} +1 -1
- package/dist/gateway/static/root/assets/{skills-page.utils-PtlQLM5a.js → skills-page.utils-DcrBe39q.js} +1 -1
- package/dist/gateway/static/root/assets/{system-settings-panel-BR74mNEK.js → system-settings-panel-BUsykmjx.js} +1 -1
- package/dist/gateway/static/root/assets/task-detail-page-C9QgWfYG.js +1 -0
- package/dist/gateway/static/root/assets/{theme-store-Bud54q9e.js → theme-store-CpcBI73Q.js} +1 -1
- package/dist/gateway/static/root/assets/{use-autosave-DH47MH7s.js → use-autosave-DDEypreQ.js} +1 -1
- package/dist/gateway/static/root/assets/user-context-page-Ch0cfQfI.js +1 -0
- package/dist/gateway/static/root/assets/{voice-api-key-field-B59GaqRa.js → voice-api-key-field-BLa_vdXE.js} +1 -1
- package/dist/gateway/static/root/assets/{voice-config-api-C0ahrZ0e.js → voice-config-api-ynE-vY6I.js} +1 -1
- package/dist/gateway/static/root/assets/{work-discovery-overlay-DTn4RCcx.js → work-discovery-overlay-DS3w1Fyq.js} +1 -1
- package/dist/gateway/static/root/assets/{workflow-run-setup-panel-yDFoEX06.js → workflow-run-setup-panel-jQl_wmYC.js} +2 -2
- package/dist/gateway/static/root/assets/workflows-page-DyTwkdzs.js +5 -0
- package/dist/gateway/static/root/index.html +13 -13
- package/dist/package.js +1 -1
- package/dist/src/agent/agent-manager.js +4 -4
- package/dist/src/agent/background-review/run-background-review.js +1 -1
- package/dist/src/agent/embedded/model-runtime.js +1 -1
- package/dist/src/agent/embedded/run-for-session.js +57 -8
- package/dist/src/agent/embedded/types.d.ts +5 -0
- package/dist/src/agent/image/tool-model-config.js +1 -1
- package/dist/src/agent/ipc/inbox.js +1 -1
- package/dist/src/agent/mcp/oauth/mcp-oauth-store.js +1 -1
- package/dist/src/agent/prompt/sections/tooling.js +1 -1
- package/dist/src/agent/service.js +2 -2
- package/dist/src/agent/session/session-inspector.js +1 -1
- package/dist/src/agent/skills/hub-lock.js +1 -1
- package/dist/src/agent/tasks/task-judge-service.js +3 -3
- package/dist/src/agent/tools/create-share-tool.js +1 -1
- package/dist/src/agent/tools/exec-command.d.ts +2 -0
- package/dist/src/agent/tools/exec-command.js +23 -7
- package/dist/src/agent/tools/factory.js +1 -1
- package/dist/src/agent/tools/index.js +1 -1
- package/dist/src/agent/tools/publish-artifacts.d.ts +6 -0
- package/dist/src/agent/tools/publish-artifacts.js +55 -42
- package/dist/src/agent/tools/send-media.js +1 -1
- package/dist/src/agent/tools/workflow-tool.js +1 -1
- package/dist/src/agent/tools/write.js +1 -1
- package/dist/src/agent/tools/xopc-use-tool.js +4 -4
- package/dist/src/ai-assist/text-assist.js +1 -1
- package/dist/src/auth/credentials.js +2 -2
- package/dist/src/auth/profiles/store.js +1 -1
- package/dist/src/auth/sync-provider-auth.js +2 -2
- package/dist/src/browser/providers/browser-ext-install.js +1 -1
- package/dist/src/cli/commands/channels.js +1 -1
- package/dist/src/cli/commands/connectors.js +1 -1
- package/dist/src/cli/commands/doctor/checks/provider-auth.js +1 -1
- package/dist/src/cli/commands/extension-marketplace.js +1 -1
- package/dist/src/cli/commands/gateway/lifecycle.js +1 -1
- package/dist/src/cli/commands/models.js +2 -2
- package/dist/src/cli/commands/onboard.js +1 -1
- package/dist/src/config/index.js +4 -4
- package/dist/src/config/loader.js +1 -1
- package/dist/src/config/models-json.js +1 -1
- package/dist/src/extensions/lockfile.js +1 -1
- package/dist/src/extensions/sdk/index.js +1 -1
- package/dist/src/files/file-service.d.ts +10 -2
- package/dist/src/files/file-service.js +33 -12
- package/dist/src/gateway/agent-builtin-tools.d.ts +1 -1
- package/dist/src/gateway/agents-admin.js +1 -1
- package/dist/src/gateway/chat-stream/mapper.js +5 -0
- package/dist/src/gateway/file-path-classifier.d.ts +30 -0
- package/dist/src/gateway/file-path-classifier.js +105 -0
- package/dist/src/gateway/file-reference-errors.d.ts +6 -0
- package/dist/src/gateway/file-reference-errors.js +21 -0
- package/dist/src/gateway/file-reference-registry.d.ts +34 -0
- package/dist/src/gateway/file-reference-registry.js +45 -0
- package/dist/src/gateway/file-space-service.d.ts +4 -0
- package/dist/src/gateway/file-space-service.js +19 -0
- package/dist/src/gateway/hono/app.js +3 -1
- package/dist/src/gateway/hono/lib/config-payload.js +1 -1
- package/dist/src/gateway/hono/routes/connectors.js +1 -1
- package/dist/src/gateway/hono/routes/file-references.d.ts +4 -0
- package/dist/src/gateway/hono/routes/file-references.js +98 -0
- package/dist/src/gateway/hono/routes/files.js +39 -17
- package/dist/src/gateway/hono/routes/html-preview.d.ts +4 -0
- package/dist/src/gateway/hono/routes/html-preview.js +45 -0
- package/dist/src/gateway/hono/routes/models.js +1 -1
- package/dist/src/gateway/hono/routes/shares.js +18 -10
- package/dist/src/gateway/hono/routes/tasks.js +3 -3
- package/dist/src/gateway/security/csp.d.ts +1 -1
- package/dist/src/gateway/security/csp.js +2 -2
- package/dist/src/gateway/service/config-coordinator.js +1 -1
- package/dist/src/gateway/service/run-gateway-agent.js +0 -35
- package/dist/src/gateway/service.js +8 -8
- package/dist/src/infra/update-restart.js +1 -1
- package/dist/src/providers/auth-runtime/resolve-auth.js +1 -1
- package/dist/src/providers/index.js +2 -2
- package/dist/src/providers/model-registry.js +1 -1
- package/dist/src/providers/register-runtime-providers.js +1 -1
- package/dist/src/session/store.js +4 -2
- package/dist/src/session/turn-outcome-projector.d.ts +9 -0
- package/dist/src/session/turn-outcome-projector.js +209 -0
- package/dist/src/share/hosted-session-share.js +1 -1
- package/dist/src/storage/sqlite/config-repository.d.ts +5 -0
- package/dist/src/storage/sqlite/config-repository.js +8 -1
- package/dist/src/tasks/home-query-service.js +2 -2
- package/dist/src/tasks/task-signal-service.js +1 -1
- package/dist/src/tui/backends/embedded-backend.js +1 -1
- package/dist/src/tui/tui-startup-resources.js +1 -1
- package/dist/src/tui/tui.js +1 -1
- package/dist/src/workflows/service/workflow-run-service.js +2 -2
- package/package.json +4 -4
- package/dist/gateway/static/root/assets/agent-defaults-settings-panel-JrK80PvP.js +0 -1
- package/dist/gateway/static/root/assets/agents-CJYEnz94.js +0 -1
- package/dist/gateway/static/root/assets/apps-page-Bt8_sWtU.js +0 -1
- package/dist/gateway/static/root/assets/automations-workspace-86UTesz3.js +0 -6
- package/dist/gateway/static/root/assets/browser-settings-page-DfMU7yXv.js +0 -8
- package/dist/gateway/static/root/assets/capabilities-settings-panel-lsHRuBlX.js +0 -7
- package/dist/gateway/static/root/assets/channels-settings-CxR_clkO.js +0 -1
- package/dist/gateway/static/root/assets/connectors-page-CpNLyKB4.js +0 -2
- package/dist/gateway/static/root/assets/heartbeat-settings-DGq9q4b6.js +0 -1
- package/dist/gateway/static/root/assets/home-page-Dj4B1wb3.js +0 -1
- package/dist/gateway/static/root/assets/index-BGf-TiZj.js +0 -70
- package/dist/gateway/static/root/assets/local-app-workbench-page-IJg75WaN.js +0 -2
- package/dist/gateway/static/root/assets/logs-page-NsfoazgK.js +0 -2
- package/dist/gateway/static/root/assets/models-hub-cache-C5y2gzMU.js +0 -1
- package/dist/gateway/static/root/assets/notes-workbench-DrjMVgEI.js +0 -4
- package/dist/gateway/static/root/assets/project-detail-page-tfcGYL-O.js +0 -1
- package/dist/gateway/static/root/assets/projects-page-BkjnXLdJ.js +0 -1
- package/dist/gateway/static/root/assets/remote-access-hub-BXn-3n2d.js +0 -1
- package/dist/gateway/static/root/assets/sessions-page-MLNjrOkw.js +0 -1
- package/dist/gateway/static/root/assets/settings-advanced-gate-ByNLBY2q.js +0 -1
- package/dist/gateway/static/root/assets/setup-status-panel-bnueBZg8.js +0 -1
- package/dist/gateway/static/root/assets/shares-settings-D-v_psqL.js +0 -1
- package/dist/gateway/static/root/assets/skill-reload-api-DJICr4wh.js +0 -1
- package/dist/gateway/static/root/assets/task-detail-page-B-rmeE8t.js +0 -1
- package/dist/gateway/static/root/assets/user-context-page-B6eyxxOT.js +0 -1
- package/dist/gateway/static/root/assets/workflows-page-BOwSbfWm.js +0 -5
- package/dist/src/gateway/chat-stream/turn-outcome-collector.d.ts +0 -16
- package/dist/src/gateway/chat-stream/turn-outcome-collector.js +0 -146
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png?v=20260713-1" />
|
|
12
12
|
<link rel="manifest" href="/site.webmanifest?v=20260713-1" />
|
|
13
13
|
<title>XOPC — Keep what matters moving.</title>
|
|
14
|
-
<script type="module" crossorigin src="/assets/index-
|
|
14
|
+
<script type="module" crossorigin src="/assets/index-DFfvY8IN.js"></script>
|
|
15
15
|
<link rel="modulepreload" crossorigin href="/assets/rolldown-runtime-aKtaBQYM.js">
|
|
16
16
|
<link rel="modulepreload" crossorigin href="/assets/preload-helper-zJ_50EbN.js">
|
|
17
17
|
<link rel="modulepreload" crossorigin href="/assets/vendor-react-BOUWij0V.js">
|
|
@@ -25,13 +25,13 @@
|
|
|
25
25
|
<link rel="modulepreload" crossorigin href="/assets/download-Dk-ZjtO6.js">
|
|
26
26
|
<link rel="modulepreload" crossorigin href="/assets/plus-Q2yW6OE7.js">
|
|
27
27
|
<link rel="modulepreload" crossorigin href="/assets/x-B_N4OPjy.js">
|
|
28
|
-
<link rel="modulepreload" crossorigin href="/assets/messages-
|
|
29
|
-
<link rel="modulepreload" crossorigin href="/assets/locale-store-
|
|
28
|
+
<link rel="modulepreload" crossorigin href="/assets/messages-CoovNoMn.js">
|
|
29
|
+
<link rel="modulepreload" crossorigin href="/assets/locale-store-8k4mvYGL.js">
|
|
30
30
|
<link rel="modulepreload" crossorigin href="/assets/cn-JdwAhgNB.js">
|
|
31
31
|
<link rel="modulepreload" crossorigin href="/assets/schemas-zIBW3wiV.js">
|
|
32
32
|
<link rel="modulepreload" crossorigin href="/assets/product-delivery-tRr-7IxY.js">
|
|
33
33
|
<link rel="modulepreload" crossorigin href="/assets/copy-to-clipboard-HOJ79TWv.js">
|
|
34
|
-
<link rel="modulepreload" crossorigin href="/assets/markdown-view-
|
|
34
|
+
<link rel="modulepreload" crossorigin href="/assets/markdown-view-D02mJdoU.js">
|
|
35
35
|
<link rel="modulepreload" crossorigin href="/assets/dist-DqPZM2MH2.js">
|
|
36
36
|
<link rel="modulepreload" crossorigin href="/assets/vendor-swr-BIWyz7Rc.js">
|
|
37
37
|
<link rel="modulepreload" crossorigin href="/assets/check-DUBLcKHA.js">
|
|
@@ -46,26 +46,26 @@
|
|
|
46
46
|
<link rel="modulepreload" crossorigin href="/assets/eye-off-DEAzt3g1.js">
|
|
47
47
|
<link rel="modulepreload" crossorigin href="/assets/eye-CABVeTq0.js">
|
|
48
48
|
<link rel="modulepreload" crossorigin href="/assets/globe-DSSGFWFn.js">
|
|
49
|
-
<link rel="modulepreload" crossorigin href="/assets/notes-api-
|
|
49
|
+
<link rel="modulepreload" crossorigin href="/assets/notes-api-p2Pncp2B.js">
|
|
50
50
|
<link rel="modulepreload" crossorigin href="/assets/loader-circle-CifKLtgG.js">
|
|
51
51
|
<link rel="modulepreload" crossorigin href="/assets/rotate-cw-LIg3Am9S.js">
|
|
52
52
|
<link rel="modulepreload" crossorigin href="/assets/search-DA7gz22f.js">
|
|
53
53
|
<link rel="modulepreload" crossorigin href="/assets/middleware-Pd0e8Igk.js">
|
|
54
|
-
<link rel="modulepreload" crossorigin href="/assets/files-
|
|
54
|
+
<link rel="modulepreload" crossorigin href="/assets/files-DQjhZjr2.js">
|
|
55
55
|
<link rel="modulepreload" crossorigin href="/assets/tool-activity-R8V9l6nk.js">
|
|
56
56
|
<link rel="modulepreload" crossorigin href="/assets/button-CSEbl4zT.js">
|
|
57
|
-
<link rel="modulepreload" crossorigin href="/assets/gateway-startup-retry-
|
|
58
|
-
<link rel="modulepreload" crossorigin href="/assets/registry-api-
|
|
57
|
+
<link rel="modulepreload" crossorigin href="/assets/gateway-startup-retry-2rVSUvyw.js">
|
|
58
|
+
<link rel="modulepreload" crossorigin href="/assets/registry-api-B7b0LJgI.js">
|
|
59
59
|
<link rel="modulepreload" crossorigin href="/assets/config-reload-event-Bjh2zoKp.js">
|
|
60
|
-
<link rel="modulepreload" crossorigin href="/assets/gateway-config-swr-
|
|
61
|
-
<link rel="modulepreload" crossorigin href="/assets/models-hub-cache-
|
|
60
|
+
<link rel="modulepreload" crossorigin href="/assets/gateway-config-swr-R702lNJR.js">
|
|
61
|
+
<link rel="modulepreload" crossorigin href="/assets/models-hub-cache-CYr6LzvY.js">
|
|
62
62
|
<link rel="modulepreload" crossorigin href="/assets/electron-env-DH5wF8X8.js">
|
|
63
|
-
<link rel="modulepreload" crossorigin href="/assets/oauth-api-
|
|
63
|
+
<link rel="modulepreload" crossorigin href="/assets/oauth-api-DpLONwfK.js">
|
|
64
64
|
<link rel="modulepreload" crossorigin href="/assets/form-field-width-DJw_jULe.js">
|
|
65
65
|
<link rel="modulepreload" crossorigin href="/assets/interaction-BmQogeqz.js">
|
|
66
66
|
<link rel="modulepreload" crossorigin href="/assets/is-masked-secret-DOkL5b_X.js">
|
|
67
|
-
<link rel="modulepreload" crossorigin href="/assets/activity-store-
|
|
68
|
-
<link rel="modulepreload" crossorigin href="/assets/theme-store-
|
|
67
|
+
<link rel="modulepreload" crossorigin href="/assets/activity-store-BzswYHcj.js">
|
|
68
|
+
<link rel="modulepreload" crossorigin href="/assets/theme-store-CpcBI73Q.js">
|
|
69
69
|
<link rel="stylesheet" crossorigin href="/assets/markdown-view-B1bGSQqt.css">
|
|
70
70
|
<link rel="stylesheet" crossorigin href="/assets/index-BTUuTnc9.css">
|
|
71
71
|
</head>
|
package/dist/package.js
CHANGED
|
@@ -5,16 +5,16 @@ import { getSessionMetadata } from "../storage/sqlite/session-repository.js";
|
|
|
5
5
|
import { getSessionConfig } from "../storage/sqlite/config-repository.js";
|
|
6
6
|
import "../storage/sqlite/index.js";
|
|
7
7
|
import { getAgentDefaultModelRef, init_schema } from "../config/schema.js";
|
|
8
|
-
import { applyConfigOverrides } from "../config/runtime-overrides.js";
|
|
9
8
|
import { expandWorkspacePathString, init_workspace_path } from "../config/workspace-path.js";
|
|
10
9
|
import { init_agent_scope, resolveAgentProfileDir } from "./agent-scope.js";
|
|
11
|
-
import { init_session_key, parseSessionKey } from "../routing/session-key.js";
|
|
12
|
-
import { resolveEffectiveAgentProfile, resolveEffectiveAgentProfileForSession } from "../config/agent-profile.js";
|
|
13
10
|
import { init_paths, resolveBundledSkillsDir } from "../config/paths.js";
|
|
14
|
-
import { init_sync_provider_auth, resolveProviderApiKeySync } from "../auth/sync-provider-auth.js";
|
|
15
11
|
import { CredentialResolver, init_credentials } from "../auth/credentials.js";
|
|
12
|
+
import { init_session_key, parseSessionKey } from "../routing/session-key.js";
|
|
13
|
+
import { init_sync_provider_auth, resolveProviderApiKeySync } from "../auth/sync-provider-auth.js";
|
|
16
14
|
import { getApiKeySync, getDefaultModelSync, init_providers, resolveModel } from "../providers/index.js";
|
|
17
15
|
import { createExtensionAwareStreamFn } from "../providers/extension-stream-bridge.js";
|
|
16
|
+
import { applyConfigOverrides } from "../config/runtime-overrides.js";
|
|
17
|
+
import { resolveEffectiveAgentProfile, resolveEffectiveAgentProfileForSession } from "../config/agent-profile.js";
|
|
18
18
|
import { extractTextContent } from "./context/workspace.js";
|
|
19
19
|
import { buildExecutionScopeContextForPrompt } from "./context/execution-scope.js";
|
|
20
20
|
import { clearBootstrapSnapshot } from "./bootstrap/bootstrap-cache.js";
|
|
@@ -4,10 +4,10 @@ import { finishContextExtractionRun } from "../../storage/sqlite/context-extract
|
|
|
4
4
|
import { getTurnPersonalization } from "../../storage/sqlite/user-context-repository.js";
|
|
5
5
|
import { loadCompactionSourceSnapshot } from "../../storage/sqlite/transcript-repository.js";
|
|
6
6
|
import "../../storage/sqlite/index.js";
|
|
7
|
-
import { extractProfileAgentId } from "../../config/agent-profile.js";
|
|
8
7
|
import { init_sync_provider_auth, resolveProviderApiKeySync } from "../../auth/sync-provider-auth.js";
|
|
9
8
|
import { getApiKeySync, init_providers, resolveModel } from "../../providers/index.js";
|
|
10
9
|
import { createExtensionAwareStreamFn } from "../../providers/extension-stream-bridge.js";
|
|
10
|
+
import { extractProfileAgentId } from "../../config/agent-profile.js";
|
|
11
11
|
import { extractTextContent } from "../context/workspace.js";
|
|
12
12
|
import { readAgentMessageContent } from "../memory/agent-message-access.js";
|
|
13
13
|
import { resolveAgentTurnTimeoutMs, runAgentTurnWithTimeout } from "../orchestration/run-agent-turn-with-timeout.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { init_paths, resolveModelsJsonPath } from "../../config/paths.js";
|
|
2
|
-
import { init_sync_provider_auth, resolveProviderApiKeySync } from "../../auth/sync-provider-auth.js";
|
|
3
2
|
import { CredentialResolver, init_credentials } from "../../auth/credentials.js";
|
|
3
|
+
import { init_sync_provider_auth, resolveProviderApiKeySync } from "../../auth/sync-provider-auth.js";
|
|
4
4
|
import { XopcModelCredentialStore, init_model_credential_store } from "../../auth/model-credential-store.js";
|
|
5
5
|
import { init_register_bundled_oauth_flows, registerBundledOAuthFlows } from "../../providers/register-bundled-oauth-flows.js";
|
|
6
6
|
import { init_register_runtime_providers, registerRuntimeProviders } from "../../providers/register-runtime-providers.js";
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import { createLogger } from "../../utils/logger/index.js";
|
|
2
2
|
import { init_logger } from "../../utils/logger.js";
|
|
3
|
-
import { resolveEffectiveAgentProfileForSession } from "../../config/agent-profile.js";
|
|
4
3
|
import { init_providers, resolveModel } from "../../providers/index.js";
|
|
4
|
+
import { parseTurnOutcome } from "../../../packages/gateway-contract/src/turn-outcome.js";
|
|
5
|
+
import { resolveEffectiveAgentProfileForSession } from "../../config/agent-profile.js";
|
|
5
6
|
import { resolveAgentTurnTimeoutMs } from "../orchestration/run-agent-turn-with-timeout.js";
|
|
6
7
|
import { resolvePromptCachePolicy } from "../../providers/prompt-cache-plan.js";
|
|
7
8
|
import { evaluateContextBudget } from "../memory/context-budget.js";
|
|
8
9
|
import { resolveCompactionPolicy } from "../memory/compaction-policy.js";
|
|
10
|
+
import { projectTurnOutcome } from "../../session/turn-outcome-projector.js";
|
|
9
11
|
import { runXopcEmbeddedTurn } from "./run-turn.js";
|
|
10
12
|
import { applyStartupContextToUserMessage } from "../reply/apply-turn-user-enrichment.js";
|
|
11
13
|
import { AgentRunSupervisor } from "../orchestration/agent-run-supervisor.js";
|
|
@@ -23,6 +25,41 @@ async function runEmbeddedTurnForSession(params) {
|
|
|
23
25
|
deadlineAtMs: params.deadlineAtMs,
|
|
24
26
|
parentSignal: params.abortSignal
|
|
25
27
|
});
|
|
28
|
+
const finish = async (result) => {
|
|
29
|
+
try {
|
|
30
|
+
const rows = await sessionStore.loadTranscriptRows(sessionKey);
|
|
31
|
+
const hasTurn = rows.some((source) => {
|
|
32
|
+
return source.turnId === runId;
|
|
33
|
+
});
|
|
34
|
+
const alreadyPersisted = rows.some((source) => {
|
|
35
|
+
const row = source;
|
|
36
|
+
return row.type === "custom" && row.customType === "turn_outcome" && parseTurnOutcome(row.data)?.turnId === runId;
|
|
37
|
+
});
|
|
38
|
+
if (!hasTurn || alreadyPersisted) return result;
|
|
39
|
+
const outcome = projectTurnOutcome({
|
|
40
|
+
rows,
|
|
41
|
+
turnId: runId,
|
|
42
|
+
runStatus: result.ok ? "success" : result.errorMessage === "aborted" ? "cancelled" : "error",
|
|
43
|
+
summary: result.errorMessage
|
|
44
|
+
});
|
|
45
|
+
await sessionStore.appendTranscriptCustomEntry(sessionKey, {
|
|
46
|
+
customType: "turn_outcome",
|
|
47
|
+
data: outcome
|
|
48
|
+
});
|
|
49
|
+
params.onEvent?.({
|
|
50
|
+
type: "turn_outcome",
|
|
51
|
+
runId,
|
|
52
|
+
outcome
|
|
53
|
+
});
|
|
54
|
+
} catch (err) {
|
|
55
|
+
log.warn({
|
|
56
|
+
err,
|
|
57
|
+
sessionKey,
|
|
58
|
+
runId
|
|
59
|
+
}, "Turn outcome persistence failed");
|
|
60
|
+
}
|
|
61
|
+
return result;
|
|
62
|
+
};
|
|
26
63
|
try {
|
|
27
64
|
await params.beforeTurn?.();
|
|
28
65
|
if (supervisor.signal.aborted) return {
|
|
@@ -169,7 +206,7 @@ async function runEmbeddedTurnForSession(params) {
|
|
|
169
206
|
attempt: i + 1,
|
|
170
207
|
total: resolvedCandidates.length
|
|
171
208
|
}, "Agent model fallback succeeded");
|
|
172
|
-
return turnResult;
|
|
209
|
+
return finish(turnResult);
|
|
173
210
|
}
|
|
174
211
|
lastResult = turnResult;
|
|
175
212
|
if (supervisor.signal.aborted || turnResult.retryable === false) break;
|
|
@@ -184,7 +221,13 @@ async function runEmbeddedTurnForSession(params) {
|
|
|
184
221
|
}, hasNextCandidate ? "Agent model turn failed, trying fallback" : "Agent model turn failed, no fallback remains");
|
|
185
222
|
} catch (err) {
|
|
186
223
|
lastError = err;
|
|
187
|
-
if (err instanceof DOMException && err.name === "AbortError")
|
|
224
|
+
if (err instanceof DOMException && err.name === "AbortError") {
|
|
225
|
+
await finish({
|
|
226
|
+
ok: false,
|
|
227
|
+
errorMessage: "aborted"
|
|
228
|
+
});
|
|
229
|
+
throw err;
|
|
230
|
+
}
|
|
188
231
|
log.warn({
|
|
189
232
|
err,
|
|
190
233
|
sessionKey,
|
|
@@ -209,13 +252,19 @@ async function runEmbeddedTurnForSession(params) {
|
|
|
209
252
|
resumeLastUserMessage = preparation === "resume";
|
|
210
253
|
}
|
|
211
254
|
}
|
|
212
|
-
if (lastResult) return lastResult;
|
|
213
|
-
if (lastError
|
|
214
|
-
|
|
215
|
-
|
|
255
|
+
if (lastResult) return finish(lastResult);
|
|
256
|
+
if (lastError != null) {
|
|
257
|
+
const result = await finish({
|
|
258
|
+
ok: false,
|
|
259
|
+
errorMessage: lastError instanceof Error ? lastError.message : String(lastError)
|
|
260
|
+
});
|
|
261
|
+
if (lastError instanceof Error) throw lastError;
|
|
262
|
+
throw new Error(result.errorMessage);
|
|
263
|
+
}
|
|
264
|
+
return finish({
|
|
216
265
|
ok: false,
|
|
217
266
|
errorMessage: "No model candidates available"
|
|
218
|
-
};
|
|
267
|
+
});
|
|
219
268
|
} finally {
|
|
220
269
|
supervisor.dispose();
|
|
221
270
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { AgentMessage, AgentToolResult, ThinkingLevel } from '@earendil-works/pi-agent-core';
|
|
2
2
|
import type { AssistantMessageEvent, Model, Api, ImageContent } from '@earendil-works/pi-ai';
|
|
3
|
+
import type { TurnOutcome } from '@xopcai/gateway-contract';
|
|
3
4
|
import type { SessionStore } from '../../session/store.js';
|
|
4
5
|
import type { EmbeddedTranscriptRuntime } from './transcript-runtime.js';
|
|
5
6
|
import type { AgentTurnPolicy } from '../orchestration/agent-turn-policy.js';
|
|
@@ -76,6 +77,10 @@ export type EmbeddedStreamEvent = {
|
|
|
76
77
|
type: 'error';
|
|
77
78
|
runId?: string;
|
|
78
79
|
content: string;
|
|
80
|
+
} | {
|
|
81
|
+
type: 'turn_outcome';
|
|
82
|
+
runId?: string;
|
|
83
|
+
outcome: TurnOutcome;
|
|
79
84
|
} | {
|
|
80
85
|
type: 'compaction';
|
|
81
86
|
runId?: string;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { getAgentDefaultImageModelConfig, getAgentDefaultModelRef, init_schema, parseModelRef } from "../../config/schema.js";
|
|
2
2
|
import { init_agent_scope, resolveDefaultAgentId } from "../agent-scope.js";
|
|
3
|
-
import { resolveEffectiveAgentConfigForAgent } from "../../config/agent-profile.js";
|
|
4
3
|
import { getDefaultModelSync, getModelsByProvider, init_providers, isProviderConfiguredSync, resolveModel } from "../../providers/index.js";
|
|
4
|
+
import { resolveEffectiveAgentConfigForAgent } from "../../config/agent-profile.js";
|
|
5
5
|
import { resolveAgentModelFallbackValues, resolveAgentModelPrimaryValue } from "../../config/model-input.js";
|
|
6
6
|
import { buildCapabilityPlansForConfig } from "../../capabilities/readiness/from-config.js";
|
|
7
7
|
import "../../capabilities/readiness/index.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createLogger } from "../../utils/logger/index.js";
|
|
2
2
|
import { init_logger } from "../../utils/logger.js";
|
|
3
|
-
import { init_paths, resolveAgentDir } from "../../config/paths.js";
|
|
4
3
|
import { init_write_file_atomic, writeTextAtomic } from "../../infra/write-file-atomic.js";
|
|
4
|
+
import { init_paths, resolveAgentDir } from "../../config/paths.js";
|
|
5
5
|
import { join } from "path";
|
|
6
6
|
import { existsSync, watch } from "fs";
|
|
7
7
|
import { mkdir, readFile, readdir, rename } from "fs/promises";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { init_paths, resolveMcpOAuthPath } from "../../../config/paths.js";
|
|
2
1
|
import { init_write_file_atomic, writeTextAtomic } from "../../../infra/write-file-atomic.js";
|
|
2
|
+
import { init_paths, resolveMcpOAuthPath } from "../../../config/paths.js";
|
|
3
3
|
import { createHash } from "node:crypto";
|
|
4
4
|
import { readFile, rm } from "node:fs/promises";
|
|
5
5
|
//#region src/agent/mcp/oauth/mcp-oauth-store.ts
|
|
@@ -135,7 +135,7 @@ function buildToolingSection(params) {
|
|
|
135
135
|
hasGrep || hasFind ? `Use ${[hasGrep ? `\`${grepToolName}\`` : "", hasFind ? `\`${findToolName}\`` : ""].filter(Boolean).join(" and ")} for text/file discovery; use code graph or symbol tools when available for definitions and call relationships.` : "",
|
|
136
136
|
hasExec ? `Use \`${execToolName}\` for verification and safe inspection, not routine file editing.` : "",
|
|
137
137
|
hasWrite || hasExec ? "When delivering a user-facing workspace file, include a clickable Markdown link in the final response using `xopc://workspace/file?path=<workspace-relative-path>`; URL-encode spaces and special characters, and do not invent an HTTP or `file://` URL." : "",
|
|
138
|
-
hasPublishArtifacts ? "
|
|
138
|
+
hasPublishArtifacts ? "Declare final user-facing files in `exec_command.outputs`. Use `publish_artifacts` only when files were created by another runtime or were not known when the command started. Do not publish temporary files, code edits, or build intermediates." : "",
|
|
139
139
|
hasPlan ? `Use \`${planToolName}\` for multi-step coding work: keep exactly one active step when work is in progress, and update it after meaningful progress or review.` : "",
|
|
140
140
|
hasToolManual ? "Some complex tools have built-in manuals. Use `tool_manual(tool)` before non-trivial use." : "",
|
|
141
141
|
hasDelegate ? "If a task is complex or long-running, delegate it. Completion is push-based: the sub-agent result returns when done." : "",
|
|
@@ -3,10 +3,10 @@ import { init_logger } from "../utils/logger.js";
|
|
|
3
3
|
import { getUserProfile } from "../storage/sqlite/user-context-repository.js";
|
|
4
4
|
import { parseNoteAttachmentTarget } from "../notes/attachment-ref.js";
|
|
5
5
|
import { getAgentDefaultModelRef, init_schema } from "../config/schema.js";
|
|
6
|
-
import { applyConfigOverrides } from "../config/runtime-overrides.js";
|
|
7
6
|
import { init_agent_scope, resolveAgentHomeDir, resolveDefaultAgentId } from "./agent-scope.js";
|
|
8
|
-
import { extractProfileAgentId } from "../config/agent-profile.js";
|
|
9
7
|
import { init_providers, resolveModel } from "../providers/index.js";
|
|
8
|
+
import { applyConfigOverrides } from "../config/runtime-overrides.js";
|
|
9
|
+
import { extractProfileAgentId } from "../config/agent-profile.js";
|
|
10
10
|
import { extractTextContent } from "./context/workspace.js";
|
|
11
11
|
import { effectiveWorkspacePathForSession } from "../session/session-workspace.js";
|
|
12
12
|
import { getProjectForSession } from "../projects/workspace.js";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { createLogger } from "../../utils/logger/index.js";
|
|
2
2
|
import { init_logger } from "../../utils/logger.js";
|
|
3
3
|
import { init_workspace_defaults, resolveDefaultAgentWorkspaceDir } from "../../config/workspace-defaults.js";
|
|
4
|
-
import { resolveEffectiveAgentProfileForSession } from "../../config/agent-profile.js";
|
|
5
4
|
import { init_providers, resolveModel } from "../../providers/index.js";
|
|
5
|
+
import { resolveEffectiveAgentProfileForSession } from "../../config/agent-profile.js";
|
|
6
6
|
import { effectiveWorkspacePathForSession, projectWorkspacePath } from "../../session/session-workspace.js";
|
|
7
7
|
import { getProjectForSession } from "../../projects/workspace.js";
|
|
8
8
|
import { resolveCompactionPolicy } from "../memory/compaction-policy.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { init_paths, resolveSkillsLockPath } from "../../config/paths.js";
|
|
2
1
|
import { init_write_file_atomic, writeTextAtomicSync } from "../../infra/write-file-atomic.js";
|
|
2
|
+
import { init_paths, resolveSkillsLockPath } from "../../config/paths.js";
|
|
3
3
|
import { existsSync, readFileSync } from "node:fs";
|
|
4
4
|
//#region src/agent/skills/hub-lock.ts
|
|
5
5
|
/**
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { createLogger } from "../../utils/logger/index.js";
|
|
2
2
|
import { init_logger } from "../../utils/logger.js";
|
|
3
|
+
import { extractAssistantText, getAssistantMessageErrorReason, stripCodeFences } from "../../providers/model-response.js";
|
|
3
4
|
import { getAgentDefaultModelRef, init_schema } from "../../config/schema.js";
|
|
4
|
-
import { resolveEffectiveAgentProfileForSession } from "../../config/agent-profile.js";
|
|
5
5
|
import { getApiKey, init_providers, resolveModel } from "../../providers/index.js";
|
|
6
|
+
import { completeWithResolvedCredentials } from "../../providers/model-call.js";
|
|
7
|
+
import { resolveEffectiveAgentProfileForSession } from "../../config/agent-profile.js";
|
|
6
8
|
import { TaskRepository } from "../../tasks/task-repository.js";
|
|
7
9
|
import { TaskConversationRepository } from "../../tasks/task-conversation-repository.js";
|
|
8
10
|
import { TaskRunRepository } from "../../tasks/task-run-repository.js";
|
|
9
|
-
import { completeWithResolvedCredentials } from "../../providers/model-call.js";
|
|
10
11
|
import { TaskApplicationService } from "../../tasks/task-application-service.js";
|
|
11
|
-
import { extractAssistantText, getAssistantMessageErrorReason, stripCodeFences } from "../../providers/model-response.js";
|
|
12
12
|
//#region src/agent/tasks/task-judge-service.ts
|
|
13
13
|
init_schema();
|
|
14
14
|
init_providers();
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { resolvePathUnderWorkspace } from "./tool-paths.js";
|
|
2
1
|
import { turnOutcomeKindFromFileName } from "../../../packages/gateway-contract/src/turn-outcome.js";
|
|
2
|
+
import { resolvePathUnderWorkspace } from "./tool-paths.js";
|
|
3
3
|
import { resolveGatewayEffectiveHost } from "../../config/gateway-bind.js";
|
|
4
4
|
import { resolveShareConfig } from "../../share/share-config.js";
|
|
5
5
|
import { mergeWithDefaults } from "../../share/site-share-config.js";
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { AgentTool } from '@earendil-works/pi-agent-core';
|
|
2
|
+
import type { TurnOutcomeDeliverable } from '@xopcai/gateway-contract';
|
|
2
3
|
export interface ExecCommandDetails {
|
|
3
4
|
command: string;
|
|
4
5
|
cwd: string;
|
|
@@ -15,6 +16,7 @@ export interface ExecCommandDetails {
|
|
|
15
16
|
stderr: string;
|
|
16
17
|
aggregatedOutput: string;
|
|
17
18
|
failureHint?: string;
|
|
19
|
+
artifacts?: TurnOutcomeDeliverable[];
|
|
18
20
|
}
|
|
19
21
|
export interface ExecCommandUpdateDetails {
|
|
20
22
|
kind: 'command_output_delta';
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { formatSize, truncateTail } from "./truncate.js";
|
|
2
2
|
import { evaluateExecPolicy } from "../sandbox/exec-policy.js";
|
|
3
|
+
import { publishArtifactPaths } from "./publish-artifacts.js";
|
|
3
4
|
import { resolve } from "node:path";
|
|
4
5
|
import { spawn } from "node:child_process";
|
|
5
6
|
import { Type } from "@sinclair/typebox";
|
|
@@ -12,7 +13,11 @@ const ExecCommandSchema = Type.Object({
|
|
|
12
13
|
cmd: Type.String({ description: "Shell command to execute." }),
|
|
13
14
|
cwd: Type.Optional(Type.String({ description: "Working directory. Relative paths are resolved under the agent workspace." })),
|
|
14
15
|
timeoutMs: Type.Optional(Type.Number({ description: "Command timeout in milliseconds. Defaults to 1800000 (30m) and is capped at 14400000 (4h)." })),
|
|
15
|
-
maxOutputChars: Type.Optional(Type.Number({ description: "Maximum characters returned to the model. UI streaming still receives output deltas." }))
|
|
16
|
+
maxOutputChars: Type.Optional(Type.Number({ description: "Maximum characters returned to the model. UI streaming still receives output deltas." })),
|
|
17
|
+
outputs: Type.Optional(Type.Array(Type.String({ minLength: 1 }), {
|
|
18
|
+
maxItems: 50,
|
|
19
|
+
description: "Final user-facing files created by this command. Relative paths resolve under the effective cwd and are persisted as chat deliverables after a successful command."
|
|
20
|
+
}))
|
|
16
21
|
});
|
|
17
22
|
function clampTimeoutMs(raw) {
|
|
18
23
|
return Math.min(MAX_COMMAND_TIMEOUT_MS, Math.max(1e3, Math.floor(typeof raw === "number" && Number.isFinite(raw) ? raw : DEFAULT_TIMEOUT_MS)));
|
|
@@ -95,7 +100,7 @@ function createExecCommandTool(workspaceCwd, options) {
|
|
|
95
100
|
"Run shell commands for code inspection, builds, tests, type checks, and verification.",
|
|
96
101
|
"Use apply_patch for file edits; do not edit files by shell redirection unless explicitly necessary.",
|
|
97
102
|
"Relative cwd values resolve under the current agent workspace.",
|
|
98
|
-
"When the command creates final user-facing files,
|
|
103
|
+
"When the command creates final user-facing files, declare all final paths in outputs so they are persisted with this command."
|
|
99
104
|
].join(" "),
|
|
100
105
|
parameters: ExecCommandSchema,
|
|
101
106
|
label: "Run Command",
|
|
@@ -103,7 +108,7 @@ function createExecCommandTool(workspaceCwd, options) {
|
|
|
103
108
|
supportsParallel: false,
|
|
104
109
|
idempotent: false,
|
|
105
110
|
finalGuardRelevant: true,
|
|
106
|
-
async execute(
|
|
111
|
+
async execute(toolCallId, params, signal, onUpdate) {
|
|
107
112
|
const command = (params.cmd ?? params.command ?? "").trim();
|
|
108
113
|
if (!command) return {
|
|
109
114
|
content: [{
|
|
@@ -207,7 +212,7 @@ function createExecCommandTool(workspaceCwd, options) {
|
|
|
207
212
|
}
|
|
208
213
|
});
|
|
209
214
|
};
|
|
210
|
-
const finish = (exitCode, errorText) => {
|
|
215
|
+
const finish = async (exitCode, errorText) => {
|
|
211
216
|
if (settled) return;
|
|
212
217
|
settled = true;
|
|
213
218
|
clearTimeout(timeout);
|
|
@@ -244,10 +249,21 @@ function createExecCommandTool(workspaceCwd, options) {
|
|
|
244
249
|
truncatedBy: formatted.truncatedBy,
|
|
245
250
|
outputBytes: formatted.outputBytes
|
|
246
251
|
};
|
|
252
|
+
let resultText = formatted.text;
|
|
253
|
+
if (details.status === "success" && params.outputs?.length) {
|
|
254
|
+
details.artifacts = await publishArtifactPaths({
|
|
255
|
+
paths: params.outputs,
|
|
256
|
+
baseDir: policy.effectiveCwd,
|
|
257
|
+
toolCallId
|
|
258
|
+
});
|
|
259
|
+
const published = details.artifacts.filter((item) => item.availability === "available").length;
|
|
260
|
+
const failed = details.artifacts.length - published;
|
|
261
|
+
resultText += `\n\nArtifacts: ${published} published${failed > 0 ? `, ${failed} failed` : ""}.`;
|
|
262
|
+
}
|
|
247
263
|
resolveTool({
|
|
248
264
|
content: [{
|
|
249
265
|
type: "text",
|
|
250
|
-
text:
|
|
266
|
+
text: resultText
|
|
251
267
|
}],
|
|
252
268
|
details
|
|
253
269
|
});
|
|
@@ -264,8 +280,8 @@ function createExecCommandTool(workspaceCwd, options) {
|
|
|
264
280
|
else signal?.addEventListener("abort", abort, { once: true });
|
|
265
281
|
proc.stdout?.on("data", (data) => publishDelta("stdout", data));
|
|
266
282
|
proc.stderr?.on("data", (data) => publishDelta("stderr", data));
|
|
267
|
-
proc.on("error", (err) => finish(null, `Error: ${err.message}`));
|
|
268
|
-
proc.on("close", (code) => finish(code));
|
|
283
|
+
proc.on("error", (err) => void finish(null, `Error: ${err.message}`));
|
|
284
|
+
proc.on("close", (code) => void finish(code));
|
|
269
285
|
});
|
|
270
286
|
}
|
|
271
287
|
};
|
|
@@ -11,6 +11,7 @@ import { createDefaultExternalToolGatewayTools } from "../external-tools/index.j
|
|
|
11
11
|
import { createReadFileTool } from "./read.js";
|
|
12
12
|
import { createWriteFileTool } from "./write.js";
|
|
13
13
|
import { createListDirTool } from "./list-dir.js";
|
|
14
|
+
import { createPublishArtifactsTool } from "./publish-artifacts.js";
|
|
14
15
|
import { createExecCommandTool } from "./exec-command.js";
|
|
15
16
|
import { createApplyPatchTool } from "./apply-patch.js";
|
|
16
17
|
import { createMemoryGetTool, createMemorySearchTool } from "./memory-tool.js";
|
|
@@ -22,7 +23,6 @@ import { createWebFetchTool, createWebSearchTool } from "./web.js";
|
|
|
22
23
|
import { createWebExtractTool } from "./web-extract.js";
|
|
23
24
|
import { createMessageTool } from "./communication.js";
|
|
24
25
|
import { createSendMediaTool } from "./send-media.js";
|
|
25
|
-
import { createPublishArtifactsTool } from "./publish-artifacts.js";
|
|
26
26
|
import { createReadMediaTool } from "./media-read-tool.js";
|
|
27
27
|
import { createCreateShareTool, isShareToolAvailable } from "./create-share-tool.js";
|
|
28
28
|
import { createTodoTool } from "./todo-tool.js";
|
|
@@ -4,6 +4,7 @@ import { DEFAULT_MAX_BYTES, DEFAULT_MAX_LINES, GREP_MAX_LINE_LENGTH, formatSize,
|
|
|
4
4
|
import { createReadFileTool } from "./read.js";
|
|
5
5
|
import { createWriteFileTool, writeFileTool } from "./write.js";
|
|
6
6
|
import { createListDirTool, listDirTool } from "./list-dir.js";
|
|
7
|
+
import { createPublishArtifactsTool } from "./publish-artifacts.js";
|
|
7
8
|
import { createExecCommandTool } from "./exec-command.js";
|
|
8
9
|
import { fuzzyFindText, generateDiffString, normalizeForFuzzyMatch, normalizeToLF, restoreLineEndings, stripBom } from "./edit-diff.js";
|
|
9
10
|
import { createApplyPatchTool } from "./apply-patch.js";
|
|
@@ -16,7 +17,6 @@ import { createWebFetchTool, createWebSearchTool } from "./web.js";
|
|
|
16
17
|
import { DEFAULT_WEB_EXTRACT_MAX_LENGTH, MAX_RAW_HTML_CHARS_FOR_WEB_EXTRACT, createWebExtractTool, stripHtmlBoilerplate } from "./web-extract.js";
|
|
17
18
|
import { createMessageTool } from "./communication.js";
|
|
18
19
|
import { createSendMediaTool } from "./send-media.js";
|
|
19
|
-
import { createPublishArtifactsTool } from "./publish-artifacts.js";
|
|
20
20
|
import { createReadMediaTool } from "./media-read-tool.js";
|
|
21
21
|
import { createCreateShareTool, isShareToolAvailable } from "./create-share-tool.js";
|
|
22
22
|
import { TodoStore, createTodoTool } from "./todo-tool.js";
|
|
@@ -1,2 +1,8 @@
|
|
|
1
1
|
import type { AgentTool } from '@earendil-works/pi-agent-core';
|
|
2
|
+
import { type TurnOutcomeDeliverable } from '@xopcai/gateway-contract';
|
|
3
|
+
export declare function publishArtifactPaths(params: {
|
|
4
|
+
paths: string[];
|
|
5
|
+
baseDir: string;
|
|
6
|
+
toolCallId: string;
|
|
7
|
+
}): Promise<TurnOutcomeDeliverable[]>;
|
|
2
8
|
export declare function createPublishArtifactsTool(workspace: string): AgentTool;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { checkFileSafety } from "../prompt/safety.js";
|
|
2
|
-
import { resolvePathUnderWorkspace } from "./tool-paths.js";
|
|
3
1
|
import { turnOutcomeKindFromFileName, turnOutcomeMimeTypeFromFileName } from "../../../packages/gateway-contract/src/turn-outcome.js";
|
|
2
|
+
import { resolvePathUnderWorkspace } from "./tool-paths.js";
|
|
3
|
+
import { evaluateFilePolicy } from "../sandbox/exec-policy.js";
|
|
4
4
|
import { persistToolMedia } from "./tool-media.js";
|
|
5
5
|
import { basename, isAbsolute } from "node:path";
|
|
6
6
|
import { readFile } from "node:fs/promises";
|
|
@@ -11,6 +11,53 @@ const PublishArtifactsSchema = Type.Object({ paths: Type.Array(Type.String({ min
|
|
|
11
11
|
maxItems: 50,
|
|
12
12
|
description: "Files to publish. Relative paths resolve under the current agent workspace."
|
|
13
13
|
}) });
|
|
14
|
+
async function publishArtifactPaths(params) {
|
|
15
|
+
const paths = [...new Set(params.paths.map((value) => value.trim()).filter(Boolean))];
|
|
16
|
+
const artifacts = [];
|
|
17
|
+
const publishedPaths = /* @__PURE__ */ new Set();
|
|
18
|
+
for (const [index, inputPath] of paths.entries()) {
|
|
19
|
+
const resolved = resolvePathUnderWorkspace(inputPath, params.baseDir);
|
|
20
|
+
if (publishedPaths.has(resolved)) continue;
|
|
21
|
+
publishedPaths.add(resolved);
|
|
22
|
+
try {
|
|
23
|
+
const policy = evaluateFilePolicy({
|
|
24
|
+
operation: "read",
|
|
25
|
+
path: resolved,
|
|
26
|
+
workspaceRoot: params.baseDir
|
|
27
|
+
});
|
|
28
|
+
if (!policy.allowed) throw new Error(policy.reason);
|
|
29
|
+
const media = await persistToolMedia({
|
|
30
|
+
buffer: await readFile(policy.canonicalPath ?? resolved),
|
|
31
|
+
filePath: resolved
|
|
32
|
+
});
|
|
33
|
+
const kind = turnOutcomeKindFromFileName(media.name);
|
|
34
|
+
artifacts.push({
|
|
35
|
+
artifactId: media.id,
|
|
36
|
+
title: media.name,
|
|
37
|
+
kind,
|
|
38
|
+
mimeType: media.mimeType,
|
|
39
|
+
sizeBytes: media.size,
|
|
40
|
+
availability: "available",
|
|
41
|
+
location: "artifact_store",
|
|
42
|
+
capabilities: kind === "archive" || kind === "file" ? ["download"] : ["preview", "download"],
|
|
43
|
+
uri: media.uri
|
|
44
|
+
});
|
|
45
|
+
} catch {
|
|
46
|
+
const title = basename(resolved);
|
|
47
|
+
const mimeType = turnOutcomeMimeTypeFromFileName(title);
|
|
48
|
+
artifacts.push({
|
|
49
|
+
artifactId: `publish-failed:${params.toolCallId}:${index}`,
|
|
50
|
+
title,
|
|
51
|
+
kind: turnOutcomeKindFromFileName(title),
|
|
52
|
+
...mimeType ? { mimeType } : {},
|
|
53
|
+
availability: "failed",
|
|
54
|
+
location: isAbsolute(inputPath) ? "external_host" : "workspace",
|
|
55
|
+
capabilities: ["regenerate"]
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
return artifacts;
|
|
60
|
+
}
|
|
14
61
|
function createPublishArtifactsTool(workspace) {
|
|
15
62
|
return {
|
|
16
63
|
name: "publish_artifacts",
|
|
@@ -23,45 +70,11 @@ function createPublishArtifactsTool(workspace) {
|
|
|
23
70
|
async execute(toolCallId, params) {
|
|
24
71
|
const paths = [...new Set(params.paths.map((value) => value.trim()).filter(Boolean))];
|
|
25
72
|
if (paths.length === 0) throw new Error("At least one artifact path is required");
|
|
26
|
-
const artifacts =
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
publishedPaths.add(resolved);
|
|
32
|
-
try {
|
|
33
|
-
const safety = checkFileSafety("read", resolved);
|
|
34
|
-
if (!safety.allowed) throw new Error(safety.message);
|
|
35
|
-
const media = await persistToolMedia({
|
|
36
|
-
buffer: await readFile(resolved),
|
|
37
|
-
filePath: resolved
|
|
38
|
-
});
|
|
39
|
-
const kind = turnOutcomeKindFromFileName(media.name);
|
|
40
|
-
artifacts.push({
|
|
41
|
-
artifactId: media.id,
|
|
42
|
-
title: media.name,
|
|
43
|
-
kind,
|
|
44
|
-
mimeType: media.mimeType,
|
|
45
|
-
sizeBytes: media.size,
|
|
46
|
-
availability: "available",
|
|
47
|
-
location: "artifact_store",
|
|
48
|
-
capabilities: kind === "archive" || kind === "file" ? ["download"] : ["preview", "download"],
|
|
49
|
-
uri: media.uri
|
|
50
|
-
});
|
|
51
|
-
} catch {
|
|
52
|
-
const title = basename(resolved);
|
|
53
|
-
const mimeType = turnOutcomeMimeTypeFromFileName(title);
|
|
54
|
-
artifacts.push({
|
|
55
|
-
artifactId: `publish-failed:${toolCallId}:${index}`,
|
|
56
|
-
title,
|
|
57
|
-
kind: turnOutcomeKindFromFileName(title),
|
|
58
|
-
...mimeType ? { mimeType } : {},
|
|
59
|
-
availability: "failed",
|
|
60
|
-
location: isAbsolute(inputPath) ? "external_host" : "workspace",
|
|
61
|
-
capabilities: ["regenerate"]
|
|
62
|
-
});
|
|
63
|
-
}
|
|
64
|
-
}
|
|
73
|
+
const artifacts = await publishArtifactPaths({
|
|
74
|
+
paths,
|
|
75
|
+
baseDir: workspace,
|
|
76
|
+
toolCallId
|
|
77
|
+
});
|
|
65
78
|
const publishedCount = artifacts.filter((item) => item.availability === "available").length;
|
|
66
79
|
const failedCount = artifacts.length - publishedCount;
|
|
67
80
|
return {
|
|
@@ -79,4 +92,4 @@ function createPublishArtifactsTool(workspace) {
|
|
|
79
92
|
};
|
|
80
93
|
}
|
|
81
94
|
//#endregion
|
|
82
|
-
export { createPublishArtifactsTool };
|
|
95
|
+
export { createPublishArtifactsTool, publishArtifactPaths };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { turnOutcomeKindFromFileName } from "../../../packages/gateway-contract/src/turn-outcome.js";
|
|
1
2
|
import { checkFileSafety } from "../prompt/safety.js";
|
|
2
3
|
import { resolvePathUnderWorkspace } from "./tool-paths.js";
|
|
3
|
-
import { turnOutcomeKindFromFileName } from "../../../packages/gateway-contract/src/turn-outcome.js";
|
|
4
4
|
import { persistToolMedia } from "./tool-media.js";
|
|
5
5
|
import { basename } from "node:path";
|
|
6
6
|
import { readFile } from "fs/promises";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createLogger } from "../../utils/logger/index.js";
|
|
2
2
|
import { init_logger } from "../../utils/logger.js";
|
|
3
|
-
import { extractProfileAgentId, resolveEffectiveAgentProfileForSession } from "../../config/agent-profile.js";
|
|
4
3
|
import { appendProductDeliveryText } from "../../../packages/gateway-contract/src/product-delivery.js";
|
|
4
|
+
import { extractProfileAgentId, resolveEffectiveAgentProfileForSession } from "../../config/agent-profile.js";
|
|
5
5
|
import { Type } from "@sinclair/typebox";
|
|
6
6
|
//#region src/agent/tools/workflow-tool.ts
|
|
7
7
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { appendProductDeliveryText } from "../../../packages/gateway-contract/src/product-delivery.js";
|
|
1
2
|
import { checkFileSafety } from "../prompt/safety.js";
|
|
2
3
|
import { isBareProfileMarkdownFileName, resolvePathUnderWorkspace, resolveProfileMarkdownPathIfBareName } from "./tool-paths.js";
|
|
3
|
-
import { appendProductDeliveryText } from "../../../packages/gateway-contract/src/product-delivery.js";
|
|
4
4
|
import { fileResourceId, fileSpaceId } from "../../files/file-service.js";
|
|
5
5
|
import { evaluateFilePolicy } from "../sandbox/exec-policy.js";
|
|
6
6
|
import { basename, dirname, relative, sep } from "path";
|