@xopcai/xopc 0.0.252 → 0.0.254
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/dist/background.js +59 -13
- package/dist/browser-ext/dist/content.js +0 -5
- package/dist/browser-ext/manifest.json +2 -1
- package/dist/extensions/telegram/src/inbound-processor.js +2 -2
- package/dist/extensions/telegram/src/plugin.js +3 -2
- package/dist/extensions/telegram/xopc.extension.json +1 -1
- package/dist/gateway/static/root/assets/{activity-store-w3eq3YpP.js → activity-store-Ci5Rxmi_.js} +1 -1
- package/dist/gateway/static/root/assets/{agent-avatar-dicebear-k039rbUz.js → agent-avatar-dicebear-D82jpmFL.js} +1 -1
- package/dist/gateway/static/root/assets/agent-defaults-settings-panel-vul32IsP.js +1 -0
- package/dist/gateway/static/root/assets/{agents-Bmth_bSQ.js → agents-p3kWyz1T.js} +1 -1
- package/dist/gateway/static/root/assets/{api-2joIfbrH.js → api-CXIzQJ2Z.js} +1 -1
- package/dist/gateway/static/root/assets/{app-management-settings-panel-ByJ4kiD0.js → app-management-settings-panel-mhxcQpkQ.js} +1 -1
- package/dist/gateway/static/root/assets/{appearance-settings-BK2Jga-B.js → appearance-settings-BIMwACUF.js} +1 -1
- package/dist/gateway/static/root/assets/apps-page-CJFJKNwS.js +1 -0
- package/dist/gateway/static/root/assets/{archive-plugin-DMDKtYpi.js → archive-plugin-C63Xp_sU.js} +1 -1
- package/dist/gateway/static/root/assets/{attachment-load-B764Ql3Z.js → attachment-load-D12KYOav.js} +1 -1
- package/dist/gateway/static/root/assets/{automations-page-D-sO8CZe.js → automations-page-DXj0o5CY.js} +1 -1
- package/dist/gateway/static/root/assets/automations-workspace-B2wxcpgq.js +6 -0
- package/dist/gateway/static/root/assets/{binary-plugins-fxtzYRpv.js → binary-plugins-Bcv8hun6.js} +1 -1
- package/dist/gateway/static/root/assets/{block-editor-Bcjtvckh.js → block-editor-C61LqK_-.js} +50 -50
- package/dist/gateway/static/root/assets/{browser-automation-inputs-BSmnusjD.js → browser-automation-inputs-CAclu735.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-automations-page-DC_OQIBk.js → browser-automations-page-BITfKX8L.js} +2 -2
- package/dist/gateway/static/root/assets/browser-settings-page-BMjY8cyv.js +8 -0
- package/dist/gateway/static/root/assets/capabilities-settings-panel-wB3Vgmp3.js +7 -0
- package/dist/gateway/static/root/assets/channels-settings-U5ffzu4r.js +1 -0
- package/dist/gateway/static/root/assets/{channels-status-swr-BuWjIG_a.js → channels-status-swr-Cmbx0E8O.js} +1 -1
- package/dist/gateway/static/root/assets/{chat-terminal-dock-5SevEo_I.js → chat-terminal-dock-CNBgHN9U.js} +1 -1
- package/dist/gateway/static/root/assets/connectors-page-BGaF--m5.js +2 -0
- package/dist/gateway/static/root/assets/{cron-expression-DtsfalBM.js → cron-expression-DCTN4QAG.js} +1 -1
- package/dist/gateway/static/root/assets/{date-picker-tDEQV5TP.js → date-picker-BuEyUxZn.js} +1 -1
- package/dist/gateway/static/root/assets/{dependency-picker-HhNwg0Y2.js → dependency-picker-l6IXzk0C.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-acU4Li-C.js → desktop-pet-cGn_20DO.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-settings-R84AR0Pe.js → desktop-pet-settings-DIfccDKS.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-debug-page-CrLlRkSN.js → extension-debug-page-CTS5RP_D.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-page-BH5lmZXE.js → extension-page-Dg9YssYH.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-settings-page-BscjNAd1.js → extension-settings-page-CWZYL8Fi.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-config-swr-9HidFZUd.js → gateway-config-swr-Chsr5wGH.js} +1 -1
- package/dist/gateway/static/root/assets/gateway-settings-vHI_Que8.js +1 -0
- package/dist/gateway/static/root/assets/{gateway-startup-retry-DRCPXONr.js → gateway-startup-retry-C9ynH6VV.js} +1 -1
- package/dist/gateway/static/root/assets/{heartbeat-settings-K5Zhl2rx.js → heartbeat-settings-WUhSfvob.js} +1 -1
- package/dist/gateway/static/root/assets/home-page-CYjlMzPx.js +1 -0
- package/dist/gateway/static/root/assets/{image-generation-api-CR6Kle8H.js → image-generation-api-D_TsVe7h.js} +1 -1
- package/dist/gateway/static/root/assets/index-BBlJYVxR.js +74 -0
- package/dist/gateway/static/root/assets/index-_I0dD2LN.css +2 -0
- package/dist/gateway/static/root/assets/{keyboard-shortcuts-settings-B1QR49-7.js → keyboard-shortcuts-settings-DGBf6YfD.js} +1 -1
- package/dist/gateway/static/root/assets/local-app-workbench-page-CLlIl83V.js +2 -0
- package/dist/gateway/static/root/assets/{local-apps-page-C74It-T8.js → local-apps-page-DGWP_xsQ.js} +1 -1
- package/dist/gateway/static/root/assets/{locale-store-BfZGZKSs.js → locale-store-B2v8mNJw.js} +1 -1
- package/dist/gateway/static/root/assets/logs-page-DuhCigiB.js +2 -0
- package/dist/gateway/static/root/assets/{management-settings-1kNnYL97.js → management-settings-DUAZ-dtt.js} +1 -1
- package/dist/gateway/static/root/assets/markdown-view-DBWu9d_n.js +201 -0
- package/dist/gateway/static/root/assets/{media-plugins-B5c0AoS1.js → media-plugins-CsUjcIBy.js} +1 -1
- package/dist/gateway/static/root/assets/messages-ChSTFZR5.js +3 -0
- package/dist/gateway/static/root/assets/{mobile-pairing-wizard-CsIZqK51.js → mobile-pairing-wizard-Dxu8twiQ.js} +1 -1
- package/dist/gateway/static/root/assets/note-detail-panel-DMdbaTZp.js +5 -0
- package/dist/gateway/static/root/assets/notes-page-xe_vX0nM.js +8 -0
- package/dist/gateway/static/root/assets/{page-tabs-CqJN6Ljz.js → page-tabs-YeJKwV-7.js} +1 -1
- package/dist/gateway/static/root/assets/{preview-open-alternatives-DqRIGxf4.js → preview-open-alternatives-BfJ3jMDG.js} +1 -1
- package/dist/gateway/static/root/assets/{product-open-page-DE2nPE_K.js → product-open-page-B7NRGPox.js} +1 -1
- package/dist/gateway/static/root/assets/project-detail-page-hG7ELibZ.js +1 -0
- package/dist/gateway/static/root/assets/projects-page-C5G2ET4w.js +1 -0
- package/dist/gateway/static/root/assets/{registry-api-Bpy8XX-5.js → registry-api-B9OZUdwC.js} +1 -1
- package/dist/gateway/static/root/assets/{remote-access-hub-Dnd73xWt.js → remote-access-hub-DTO-faxH.js} +1 -1
- package/dist/gateway/static/root/assets/{runtime-tools-settings-panel-Bb4b74-P.js → runtime-tools-settings-panel-uJ8Br3ZL.js} +1 -1
- package/dist/gateway/static/root/assets/{schema-form-DoPU5j3J.js → schema-form-CXwn6up5.js} +1 -1
- package/dist/gateway/static/root/assets/sessions-page-CwzsUCgP.js +1 -0
- package/dist/gateway/static/root/assets/settings-advanced-gate-Djc3EdoO.js +1 -0
- package/dist/gateway/static/root/assets/{settings-form-section-Ci-9WajJ.js → settings-form-section-YVNYsR0U.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-CL_2F95D.js → settings-page-cHqrIdVR.js} +1 -1
- package/dist/gateway/static/root/assets/setup-status-panel-MUAMcZLD.js +1 -0
- package/dist/gateway/static/root/assets/{share-preview-page-XUA3oKQX.js → share-preview-page-DnjSDQru.js} +1 -1
- package/dist/gateway/static/root/assets/shares-settings-C7A0aywX.js +1 -0
- package/dist/gateway/static/root/assets/skill-reload-api-D1xSGJAQ.js +1 -0
- package/dist/gateway/static/root/assets/{skills-page-sXXAZDc9.js → skills-page-DkrGEdiY.js} +1 -1
- package/dist/gateway/static/root/assets/{skills-page.utils-DD79Bl1I.js → skills-page.utils-CqZbiZuK.js} +1 -1
- package/dist/gateway/static/root/assets/{system-settings-panel-BEH64qBV.js → system-settings-panel-Dmw0RfxZ.js} +1 -1
- package/dist/gateway/static/root/assets/task-detail-page-BvZSCLUH.js +1 -0
- package/dist/gateway/static/root/assets/{theme-store-CISSxU1c.js → theme-store-CubltMKm.js} +1 -1
- package/dist/gateway/static/root/assets/{tunnel-api-DrKDhnJm.js → tunnel-api-CiieC6HP.js} +1 -1
- package/dist/gateway/static/root/assets/{use-autosave-CPYePL-Q.js → use-autosave-XQ3SuyB9.js} +1 -1
- package/dist/gateway/static/root/assets/user-model-page-BKJC7tyW.js +2 -0
- package/dist/gateway/static/root/assets/{voice-api-key-field-DKqzrCXx.js → voice-api-key-field-D4QzVgdt.js} +1 -1
- package/dist/gateway/static/root/assets/{voice-config-api-e9xWjwBX.js → voice-config-api-B1ZbyVmF.js} +1 -1
- package/dist/gateway/static/root/assets/{work-discovery-overlay-kTQug6bq.js → work-discovery-overlay-D5Tf8GRZ.js} +1 -1
- package/dist/gateway/static/root/assets/{workflow-run-setup-panel-m9SKj_GT.js → workflow-run-setup-panel-BW9p8Maz.js} +2 -2
- package/dist/gateway/static/root/assets/workflows-page-DuqRodIc.js +5 -0
- package/dist/gateway/static/root/index.html +10 -10
- package/dist/package.js +1 -1
- package/dist/packages/realtime-protocol/src/voice.js +6 -1
- package/dist/src/agent/agent-manager.js +24 -7
- package/dist/src/agent/background-review/run-background-review.js +1 -1
- package/dist/src/agent/embedded/execution-context.d.ts +2 -1
- package/dist/src/agent/embedded/execution-context.js +10 -4
- package/dist/src/agent/embedded/index.d.ts +1 -1
- package/dist/src/agent/embedded/index.js +2 -2
- package/dist/src/agent/embedded/model-runtime.js +1 -1
- package/dist/src/agent/embedded/run-for-session.js +5 -4
- package/dist/src/agent/embedded/run-turn.js +22 -3
- package/dist/src/agent/embedded/types.d.ts +1 -1
- package/dist/src/agent/image/tool-model-config.js +1 -1
- package/dist/src/agent/mcp/oauth/mcp-oauth-store.js +1 -1
- package/dist/src/agent/service/direct-turn-helpers.js +6 -3
- package/dist/src/agent/service/process-direct-streaming.js +6 -3
- package/dist/src/agent/service.d.ts +2 -0
- package/dist/src/agent/service.js +23 -9
- 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/browser/tool/browser-use-tool.js +17 -2
- package/dist/src/agent/tools/browser/tool/schemas.d.ts +85 -1
- package/dist/src/agent/tools/browser/tool/schemas.js +212 -5
- package/dist/src/agent/tools/clarify-tool.d.ts +17 -3
- package/dist/src/agent/tools/clarify-tool.js +27 -32
- package/dist/src/agent/tools/cli-clarify.js +23 -8
- package/dist/src/agent/tools/factory.js +14 -4
- package/dist/src/ai-assist/text-assist.js +1 -1
- package/dist/src/auth/credentials.js +2 -2
- package/dist/src/auth/oauth/xopc-cloud.js +1 -1
- package/dist/src/auth/profiles/store.js +1 -1
- package/dist/src/auth/sync-provider-auth.js +2 -2
- package/dist/src/automations/domain/validation.d.ts +4 -4
- package/dist/src/automations/draft/automation-draft-validator.d.ts +1 -1
- package/dist/src/browser/drivers/extension-driver.d.ts +4 -4
- package/dist/src/browser/drivers/extension-driver.js +20 -8
- package/dist/src/browser/drivers/playwright-driver.js +1 -1
- package/dist/src/browser/providers/browser-ext-install.d.ts +3 -0
- package/dist/src/browser/providers/browser-ext-install.js +19 -4
- package/dist/src/browser/providers/extension.d.ts +14 -1
- package/dist/src/browser/providers/extension.js +89 -11
- package/dist/src/browser/providers/playwright-install.js +8 -12
- package/dist/src/cli/commands/doctor/checks/database-schema.js +1 -1
- package/dist/src/cli/commands/doctor/checks/provider-auth.js +1 -1
- package/dist/src/cli/commands/models.js +1 -1
- package/dist/src/config/index.js +4 -4
- package/dist/src/config/loader.js +2 -2
- package/dist/src/config/models-json.js +1 -1
- package/dist/src/extensions/lockfile.js +1 -1
- package/dist/src/gateway/agents-admin.js +1 -1
- package/dist/src/gateway/chat-stream/mapper.js +5 -1
- package/dist/src/gateway/chat-stream/protocol.d.ts +5 -1
- package/dist/src/gateway/clarify-runtime.d.ts +7 -5
- package/dist/src/gateway/clarify-runtime.js +8 -11
- package/dist/src/gateway/ephemeral-clarification-waiter.d.ts +17 -0
- package/dist/src/gateway/ephemeral-clarification-waiter.js +46 -0
- package/dist/src/gateway/file-path-classifier.js +1 -1
- package/dist/src/gateway/heartbeat/service.js +1 -1
- package/dist/src/gateway/hono/lib/config-payload.js +1 -1
- package/dist/src/gateway/hono/routes/agent-stream.js +44 -18
- package/dist/src/gateway/hono/routes/browser.js +149 -27
- package/dist/src/gateway/hono/routes/lazy-bundles.js +1 -1
- package/dist/src/gateway/hono/routes/models.js +1 -1
- package/dist/src/gateway/hono/routes/session-input-handler.d.ts +10 -2
- package/dist/src/gateway/hono/routes/side-chats.js +24 -4
- package/dist/src/gateway/security/gateway-scopes.js +1 -1
- package/dist/src/gateway/service/agent-runner.d.ts +25 -36
- package/dist/src/gateway/service/agent-runner.js +103 -32
- package/dist/src/gateway/service/config-coordinator.js +1 -1
- package/dist/src/gateway/service/run-gateway-agent.js +5 -2
- package/dist/src/gateway/service/session-input-coordinator.js +4 -1
- package/dist/src/gateway/service/sessions-api.js +1 -1
- package/dist/src/gateway/service.d.ts +4 -2
- package/dist/src/gateway/service.js +36 -20
- package/dist/src/gateway/side-chat/manager.d.ts +2 -1
- package/dist/src/gateway/side-chat/manager.js +5 -4
- package/dist/src/gateway/side-chat/run-service.d.ts +5 -1
- package/dist/src/gateway/side-chat/run-service.js +24 -23
- package/dist/src/gateway/side-chat/types.d.ts +3 -1
- package/dist/src/heartbeat/index.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/model-thinking.js +57 -20
- package/dist/src/providers/register-runtime-providers.js +1 -1
- package/dist/src/storage/sqlite/clarification-wait-repository.d.ts +41 -0
- package/dist/src/storage/sqlite/clarification-wait-repository.js +418 -0
- package/dist/src/storage/sqlite/index.d.ts +2 -1
- package/dist/src/storage/sqlite/index.js +2 -1
- package/dist/src/storage/sqlite/migrations/154_session_clarification_waits.sql +60 -0
- package/dist/src/storage/sqlite/migrations/runner.d.ts +1 -1
- package/dist/src/storage/sqlite/migrations/runner.js +3 -3
- package/dist/src/storage/sqlite/migrations/runner.ts +1 -1
- package/dist/src/storage/sqlite/schema.js +1 -1
- package/dist/src/storage/sqlite/session-input-repository.d.ts +11 -6
- package/dist/src/tui/tui-startup-resources.js +1 -1
- package/dist/src/tui/tui.js +1 -1
- package/dist/src/voice/realtime/agentEngine.js +7 -2
- package/dist/src/voice/realtime/runtime.types.d.ts +5 -0
- package/dist/src/work-discovery/service.js +1 -1
- package/dist/src/workflows/service/workflow-run-service.js +1 -1
- package/package.json +3 -3
- package/skills/creative/hatch-pet/SKILL.md +1 -1
- package/dist/gateway/static/root/assets/agent-defaults-settings-panel-D4J4oq8p.js +0 -1
- package/dist/gateway/static/root/assets/apps-page-B3ky7cWU.js +0 -1
- package/dist/gateway/static/root/assets/automations-workspace-Ds5-_-9z.js +0 -6
- package/dist/gateway/static/root/assets/browser-settings-page-C1FojyG6.js +0 -3
- package/dist/gateway/static/root/assets/capabilities-settings-panel-Bs59UCut.js +0 -7
- package/dist/gateway/static/root/assets/channels-settings-CM9vNmoo.js +0 -1
- package/dist/gateway/static/root/assets/connectors-page-BPZ44D-V.js +0 -2
- package/dist/gateway/static/root/assets/gateway-settings-BxLcW6ij.js +0 -1
- package/dist/gateway/static/root/assets/home-page-CZAg9RBv.js +0 -1
- package/dist/gateway/static/root/assets/index-D4Ykja-U.js +0 -72
- package/dist/gateway/static/root/assets/index-zIJ3AXgR.css +0 -2
- package/dist/gateway/static/root/assets/local-app-workbench-page-wicoV-ti.js +0 -2
- package/dist/gateway/static/root/assets/logs-page-xX-7S49A.js +0 -2
- package/dist/gateway/static/root/assets/markdown-view-DjiwT28p.js +0 -201
- package/dist/gateway/static/root/assets/messages-DaIwVWar.js +0 -3
- package/dist/gateway/static/root/assets/note-detail-panel-CfWxopl4.js +0 -5
- package/dist/gateway/static/root/assets/notes-page-CYN-LCHJ.js +0 -8
- package/dist/gateway/static/root/assets/project-detail-page-B5G3LzDq.js +0 -1
- package/dist/gateway/static/root/assets/projects-page-CuVK2mKu.js +0 -1
- package/dist/gateway/static/root/assets/sessions-page-XL4LyKZe.js +0 -1
- package/dist/gateway/static/root/assets/settings-advanced-gate-0ForzDSS.js +0 -1
- package/dist/gateway/static/root/assets/setup-status-panel-DVws6XZc.js +0 -1
- package/dist/gateway/static/root/assets/shares-settings-BwDvcacF.js +0 -1
- package/dist/gateway/static/root/assets/skill-reload-api-BJjrATqE.js +0 -1
- package/dist/gateway/static/root/assets/task-detail-page-0jxMi75O.js +0 -1
- package/dist/gateway/static/root/assets/user-model-page-B6zLDfDl.js +0 -2
- package/dist/gateway/static/root/assets/workflows-page-Bcd1XqP7.js +0 -5
- package/dist/src/gateway/clarify-bridge.d.ts +0 -46
- package/dist/src/gateway/clarify-bridge.js +0 -111
|
@@ -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-BBlJYVxR.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-ChSTFZR5.js">
|
|
29
|
+
<link rel="modulepreload" crossorigin href="/assets/locale-store-B2v8mNJw.js">
|
|
30
30
|
<link rel="modulepreload" crossorigin href="/assets/cn-JdwAhgNB.js">
|
|
31
31
|
<link rel="modulepreload" crossorigin href="/assets/schemas-BHS7bo06.js">
|
|
32
32
|
<link rel="modulepreload" crossorigin href="/assets/product-delivery-CV4pDOtG.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-DBWu9d_n.js">
|
|
35
35
|
<link rel="modulepreload" crossorigin href="/assets/dist-DLmwHyAh.js">
|
|
36
36
|
<link rel="modulepreload" crossorigin href="/assets/vendor-swr-BIWyz7Rc.js">
|
|
37
37
|
<link rel="modulepreload" crossorigin href="/assets/check-DUBLcKHA.js">
|
|
@@ -48,15 +48,15 @@
|
|
|
48
48
|
<link rel="modulepreload" crossorigin href="/assets/files-BArWTfr7.js">
|
|
49
49
|
<link rel="modulepreload" crossorigin href="/assets/tool-activity-R8V9l6nk.js">
|
|
50
50
|
<link rel="modulepreload" crossorigin href="/assets/button-CtTvuElV.js">
|
|
51
|
-
<link rel="modulepreload" crossorigin href="/assets/gateway-startup-retry-
|
|
52
|
-
<link rel="modulepreload" crossorigin href="/assets/registry-api-
|
|
51
|
+
<link rel="modulepreload" crossorigin href="/assets/gateway-startup-retry-C9ynH6VV.js">
|
|
52
|
+
<link rel="modulepreload" crossorigin href="/assets/registry-api-B9OZUdwC.js">
|
|
53
53
|
<link rel="modulepreload" crossorigin href="/assets/config-reload-event-Bjh2zoKp.js">
|
|
54
|
-
<link rel="modulepreload" crossorigin href="/assets/gateway-config-swr-
|
|
54
|
+
<link rel="modulepreload" crossorigin href="/assets/gateway-config-swr-Chsr5wGH.js">
|
|
55
55
|
<link rel="modulepreload" crossorigin href="/assets/electron-env-DH5wF8X8.js">
|
|
56
|
-
<link rel="modulepreload" crossorigin href="/assets/activity-store-
|
|
57
|
-
<link rel="modulepreload" crossorigin href="/assets/theme-store-
|
|
56
|
+
<link rel="modulepreload" crossorigin href="/assets/activity-store-Ci5Rxmi_.js">
|
|
57
|
+
<link rel="modulepreload" crossorigin href="/assets/theme-store-CubltMKm.js">
|
|
58
58
|
<link rel="stylesheet" crossorigin href="/assets/markdown-view-Y68dCxuc.css">
|
|
59
|
-
<link rel="stylesheet" crossorigin href="/assets/index-
|
|
59
|
+
<link rel="stylesheet" crossorigin href="/assets/index-_I0dD2LN.css">
|
|
60
60
|
</head>
|
|
61
61
|
<body>
|
|
62
62
|
<div id="root"></div>
|
package/dist/package.js
CHANGED
|
@@ -159,8 +159,13 @@ z.discriminatedUnion("type", [
|
|
|
159
159
|
serverEnvelope("response.clarification", z.strictObject({
|
|
160
160
|
responseId: z.string().min(1).max(160),
|
|
161
161
|
requestId: z.string().min(1).max(160),
|
|
162
|
+
kind: z.enum(["input", "approval"]),
|
|
162
163
|
question: z.string().min(1).max(8e3),
|
|
163
|
-
choices: z.array(z.string().max(1e3)).max(20).optional()
|
|
164
|
+
choices: z.array(z.string().max(1e3)).max(20).optional(),
|
|
165
|
+
suggestedAnswer: z.string().max(1e3).optional(),
|
|
166
|
+
version: z.number().int().positive(),
|
|
167
|
+
createdAt: z.number().nonnegative(),
|
|
168
|
+
expiresAt: z.number().nonnegative().optional()
|
|
164
169
|
})),
|
|
165
170
|
serverEnvelope("response.text.delta", z.strictObject({
|
|
166
171
|
responseId: z.string().min(1).max(160),
|
|
@@ -2,25 +2,27 @@ import { resolveStateDir } from "../config/paths-state.js";
|
|
|
2
2
|
import { createLogger } from "../utils/logger/index.js";
|
|
3
3
|
import { init_logger } from "../utils/logger.js";
|
|
4
4
|
import { isXopcDatabaseOpen } from "../storage/sqlite/connection.js";
|
|
5
|
+
import { consumeClarificationApproval } from "../storage/sqlite/clarification-wait-repository.js";
|
|
5
6
|
import { getInteractionState } from "../storage/sqlite/interaction-state-repository.js";
|
|
6
7
|
import { getSessionMetadata } from "../storage/sqlite/session-repository.js";
|
|
7
8
|
import "../storage/sqlite/index.js";
|
|
8
9
|
import { getAgentDefaultModelRef, init_schema } from "../config/schema.js";
|
|
9
|
-
import { applyConfigOverrides } from "../config/runtime-overrides.js";
|
|
10
10
|
import { expandWorkspacePathString, init_workspace_path } from "../config/workspace-path.js";
|
|
11
11
|
import { init_agent_scope, resolveAgentProfileDir } from "./agent-scope.js";
|
|
12
|
-
import { init_session_key, parseSessionKey } from "../routing/session-key.js";
|
|
13
|
-
import { resolveEffectiveAgentProfile, resolveEffectiveAgentProfileForSession } from "../config/agent-profile.js";
|
|
14
12
|
import { init_paths, resolveBundledSkillsDir } from "../config/paths.js";
|
|
15
|
-
import { init_sync_provider_auth, resolveProviderApiKeySync } from "../auth/sync-provider-auth.js";
|
|
16
13
|
import { CredentialResolver, init_credentials } from "../auth/credentials.js";
|
|
14
|
+
import { init_session_key, parseSessionKey } from "../routing/session-key.js";
|
|
15
|
+
import { init_sync_provider_auth, resolveProviderApiKeySync } from "../auth/sync-provider-auth.js";
|
|
17
16
|
import { getApiKeySync, getDefaultModelSync, init_providers, resolveModel } from "../providers/index.js";
|
|
18
17
|
import { createExtensionAwareStreamFn } from "../providers/extension-stream-bridge.js";
|
|
18
|
+
import { applyConfigOverrides } from "../config/runtime-overrides.js";
|
|
19
|
+
import { resolveEffectiveAgentProfile, resolveEffectiveAgentProfileForSession } from "../config/agent-profile.js";
|
|
19
20
|
import { extractTextContent } from "./context/workspace.js";
|
|
20
21
|
import { buildExecutionScopeContextForPrompt } from "./context/execution-scope.js";
|
|
21
22
|
import { clearBootstrapSnapshot } from "./bootstrap/bootstrap-cache.js";
|
|
22
23
|
import { resolveBootstrapContextSync } from "./bootstrap/bootstrap-files.js";
|
|
23
24
|
import { loadProjectAgentsContextFile } from "./bootstrap/project-agents-context.js";
|
|
25
|
+
import { getEmbeddedExecutionRunId } from "./embedded/execution-context.js";
|
|
24
26
|
import { parseExternalToolRef } from "./external-tools/refs.js";
|
|
25
27
|
import { mcpToolPolicyId } from "./mcp/bundle-mcp-policy.js";
|
|
26
28
|
import { disposeAllSessionMcpRuntimes, retireSessionMcpRuntimeForSessionKey } from "./mcp/bundle-mcp-runtime.js";
|
|
@@ -47,6 +49,7 @@ import { maybeRequestChannelExecApproval } from "../channels/exec-approval-runti
|
|
|
47
49
|
import { SkillFilesystemWatcher } from "./skills/filesystem-watcher.js";
|
|
48
50
|
import { ProjectTrustStore, hasTrustRequiringProjectResources } from "../project-trust/trust-store.js";
|
|
49
51
|
import { basename, resolve, sep } from "node:path";
|
|
52
|
+
import { createHash } from "node:crypto";
|
|
50
53
|
import { Agent } from "@earendil-works/pi-agent-core";
|
|
51
54
|
//#region src/agent/agent-manager.ts
|
|
52
55
|
/**
|
|
@@ -1068,12 +1071,26 @@ var AgentManager = class {
|
|
|
1068
1071
|
async requestToolConfirmation(sessionKey, toolName, detail) {
|
|
1069
1072
|
const request = this.config.gatewayClarify?.requestClarification;
|
|
1070
1073
|
if (!request) return false;
|
|
1071
|
-
|
|
1074
|
+
const approvalKey = createHash("sha256").update(`${toolName}\0${detail}`).digest("hex");
|
|
1075
|
+
const existing = consumeClarificationApproval(sessionKey, approvalKey);
|
|
1076
|
+
if (existing) return existing === "approved";
|
|
1077
|
+
const runId = getEmbeddedExecutionRunId();
|
|
1078
|
+
if (!runId) return false;
|
|
1079
|
+
const result = await request({
|
|
1080
|
+
sessionKey,
|
|
1081
|
+
runId,
|
|
1082
|
+
toolCallId: `approval:${approvalKey}`
|
|
1083
|
+
}, {
|
|
1072
1084
|
kind: "approval",
|
|
1073
1085
|
question: `Allow ${toolName} to run once?\n${detail.slice(0, 500)}`,
|
|
1074
1086
|
choices: ["Allow once", "Deny"],
|
|
1075
|
-
|
|
1076
|
-
|
|
1087
|
+
suggestedAnswer: "Deny",
|
|
1088
|
+
approvalKey
|
|
1089
|
+
}).catch(() => ({
|
|
1090
|
+
status: "answered",
|
|
1091
|
+
answer: "Deny"
|
|
1092
|
+
}));
|
|
1093
|
+
return result.status === "answered" && result.answer === "Allow once";
|
|
1077
1094
|
}
|
|
1078
1095
|
refreshDynamicContextIfChanged(instance) {
|
|
1079
1096
|
const nextProjectContext = this.buildExecutionScopeContext(instance.sessionKey);
|
|
@@ -4,10 +4,10 @@ import { finishContextExtractionRun } from "../../storage/sqlite/context-extract
|
|
|
4
4
|
import { getSessionMetadata } from "../../storage/sqlite/session-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 { listUserAssertions } from "../../user-model/repository.js";
|
|
13
13
|
import { readAgentMessageContent } from "../memory/agent-message-access.js";
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
export declare function runWithEmbeddedExecutionSession<T>(sessionKey: string, run: () => T): T;
|
|
1
|
+
export declare function runWithEmbeddedExecutionSession<T>(sessionKey: string, run: () => T, runId?: string): T;
|
|
2
2
|
export declare function getEmbeddedExecutionSession(): string | undefined;
|
|
3
|
+
export declare function getEmbeddedExecutionRunId(): string | undefined;
|
|
@@ -1,11 +1,17 @@
|
|
|
1
1
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
2
2
|
//#region src/agent/embedded/execution-context.ts
|
|
3
3
|
const executionSessionStorage = new AsyncLocalStorage();
|
|
4
|
-
function runWithEmbeddedExecutionSession(sessionKey, run) {
|
|
5
|
-
return executionSessionStorage.run(
|
|
4
|
+
function runWithEmbeddedExecutionSession(sessionKey, run, runId) {
|
|
5
|
+
return executionSessionStorage.run({
|
|
6
|
+
sessionKey,
|
|
7
|
+
runId
|
|
8
|
+
}, run);
|
|
6
9
|
}
|
|
7
10
|
function getEmbeddedExecutionSession() {
|
|
8
|
-
return executionSessionStorage.getStore();
|
|
11
|
+
return executionSessionStorage.getStore()?.sessionKey;
|
|
12
|
+
}
|
|
13
|
+
function getEmbeddedExecutionRunId() {
|
|
14
|
+
return executionSessionStorage.getStore()?.runId;
|
|
9
15
|
}
|
|
10
16
|
//#endregion
|
|
11
|
-
export { getEmbeddedExecutionSession, runWithEmbeddedExecutionSession };
|
|
17
|
+
export { getEmbeddedExecutionRunId, getEmbeddedExecutionSession, runWithEmbeddedExecutionSession };
|
|
@@ -4,7 +4,7 @@ export { installSessionToolResultGuard, guardSessionManager, getRawSessionAppend
|
|
|
4
4
|
export { repairAssistantUsageInSessionManager } from './session-manager-init.js';
|
|
5
5
|
export { openSqliteHydratingSessionManager } from './sqlite-hydrating-session-manager.js';
|
|
6
6
|
export { createSqliteTranscriptRuntime, InMemoryTranscriptRuntime, type EmbeddedTranscriptRuntime, } from './transcript-runtime.js';
|
|
7
|
-
export { getEmbeddedExecutionSession, runWithEmbeddedExecutionSession } from './execution-context.js';
|
|
7
|
+
export { getEmbeddedExecutionRunId, getEmbeddedExecutionSession, runWithEmbeddedExecutionSession, } from './execution-context.js';
|
|
8
8
|
export { acquireEmbeddedSessionRunner, buildEmbeddedRunnerFingerprint, evictAllEmbeddedSessionRunners, evictEmbeddedSessionRunner, getEmbeddedSessionRunnerIdleTtlMs, getEmbeddedSessionRunnerStats, isEmbeddedSessionRunnerEnabled, resetEmbeddedSessionRunnerForTest, } from './session-runner.js';
|
|
9
9
|
export { DEFAULT_MAX_LIVE_TOOL_RESULT_CHARS, resolveLiveToolResultMaxChars, truncateToolResultMessage, } from './tool-result-truncation.js';
|
|
10
10
|
export { runXopcEmbeddedTurn, abortEmbeddedRun, queueEmbeddedSteer } from './run-turn.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { getEmbeddedExecutionSession, runWithEmbeddedExecutionSession } from "./execution-context.js";
|
|
1
|
+
import { getEmbeddedExecutionRunId, getEmbeddedExecutionSession, runWithEmbeddedExecutionSession } from "./execution-context.js";
|
|
2
2
|
import { abortEmbeddedRun, getEmbeddedRunBySessionKey, queueEmbeddedSteer } from "./runs.js";
|
|
3
3
|
import { DEFAULT_MAX_LIVE_TOOL_RESULT_CHARS, resolveLiveToolResultMaxChars, truncateToolResultMessage } from "./tool-result-truncation.js";
|
|
4
4
|
import { getRawSessionAppendMessage, guardSessionManager, installSessionToolResultGuard } from "./session-tool-result-guard.js";
|
|
@@ -9,4 +9,4 @@ import { InMemoryTranscriptRuntime, createSqliteTranscriptRuntime } from "./tran
|
|
|
9
9
|
import { runXopcEmbeddedTurn } from "./run-turn.js";
|
|
10
10
|
import { runEmbeddedTurnForSession } from "./run-for-session.js";
|
|
11
11
|
import { CURRENT_SESSION_VERSION, PiTranscriptManager } from "./pi-transcript.js";
|
|
12
|
-
export { CURRENT_SESSION_VERSION, DEFAULT_MAX_LIVE_TOOL_RESULT_CHARS, InMemoryTranscriptRuntime, PiTranscriptManager, abortEmbeddedRun, acquireEmbeddedSessionRunner, buildEmbeddedRunnerFingerprint, createSqliteTranscriptRuntime, evictAllEmbeddedSessionRunners, evictEmbeddedSessionRunner, getEmbeddedExecutionSession, getEmbeddedRunBySessionKey, getEmbeddedSessionRunnerIdleTtlMs, getEmbeddedSessionRunnerStats, getRawSessionAppendMessage, guardSessionManager, installSessionToolResultGuard, isEmbeddedSessionRunnerEnabled, openSqliteHydratingSessionManager, queueEmbeddedSteer, repairAssistantUsageInSessionManager, resetEmbeddedSessionRunnerForTest, resolveLiveToolResultMaxChars, runEmbeddedTurnForSession, runWithEmbeddedExecutionSession, runXopcEmbeddedTurn, truncateToolResultMessage };
|
|
12
|
+
export { CURRENT_SESSION_VERSION, DEFAULT_MAX_LIVE_TOOL_RESULT_CHARS, InMemoryTranscriptRuntime, PiTranscriptManager, abortEmbeddedRun, acquireEmbeddedSessionRunner, buildEmbeddedRunnerFingerprint, createSqliteTranscriptRuntime, evictAllEmbeddedSessionRunners, evictEmbeddedSessionRunner, getEmbeddedExecutionRunId, getEmbeddedExecutionSession, getEmbeddedRunBySessionKey, getEmbeddedSessionRunnerIdleTtlMs, getEmbeddedSessionRunnerStats, getRawSessionAppendMessage, guardSessionManager, installSessionToolResultGuard, isEmbeddedSessionRunnerEnabled, openSqliteHydratingSessionManager, queueEmbeddedSteer, repairAssistantUsageInSessionManager, resetEmbeddedSessionRunnerForTest, resolveLiveToolResultMaxChars, runEmbeddedTurnForSession, runWithEmbeddedExecutionSession, runXopcEmbeddedTurn, truncateToolResultMessage };
|
|
@@ -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,8 +1,9 @@
|
|
|
1
1
|
import { createLogger } from "../../utils/logger/index.js";
|
|
2
2
|
import { init_logger } from "../../utils/logger.js";
|
|
3
3
|
import { parseTurnOutcome } from "../../../packages/gateway-contract/src/turn-outcome.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
|
+
import { runWithEmbeddedExecutionSession } from "./execution-context.js";
|
|
6
7
|
import { resolveAgentTurnTimeoutMs } from "../orchestration/run-agent-turn-with-timeout.js";
|
|
7
8
|
import { resolvePromptCachePolicy } from "../../providers/prompt-cache-plan.js";
|
|
8
9
|
import { evaluateContextBudget } from "../memory/context-budget.js";
|
|
@@ -27,7 +28,7 @@ async function runEmbeddedTurnForSession(params) {
|
|
|
27
28
|
parentSignal: params.abortSignal
|
|
28
29
|
});
|
|
29
30
|
const finish = async (result) => {
|
|
30
|
-
if (result.stopReason === "connection_required") return result;
|
|
31
|
+
if (result.stopReason === "connection_required" || result.stopReason === "clarification_required") return result;
|
|
31
32
|
try {
|
|
32
33
|
const rows = await sessionStore.loadTranscriptRows(sessionKey);
|
|
33
34
|
const hasTurn = rows.some((source) => {
|
|
@@ -180,7 +181,7 @@ async function runEmbeddedTurnForSession(params) {
|
|
|
180
181
|
total: resolvedCandidates.length
|
|
181
182
|
}, "Agent model fallback started");
|
|
182
183
|
try {
|
|
183
|
-
const turnResult = await runXopcEmbeddedTurn({
|
|
184
|
+
const turnResult = await runWithEmbeddedExecutionSession(sessionKey, () => runXopcEmbeddedTurn({
|
|
184
185
|
sessionKey,
|
|
185
186
|
runId,
|
|
186
187
|
userMessage: userMessageForTurn,
|
|
@@ -199,7 +200,7 @@ async function runEmbeddedTurnForSession(params) {
|
|
|
199
200
|
onEvent: params.onEvent,
|
|
200
201
|
onAgentEvent: (event) => agentManager.emitRuntimeEvent(sessionKey, event),
|
|
201
202
|
resumeLastUserMessage
|
|
202
|
-
});
|
|
203
|
+
}), runId);
|
|
203
204
|
if (turnResult.ok) {
|
|
204
205
|
if (isFallbackAttempt) log.info({
|
|
205
206
|
sessionKey,
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { createLogger } from "../../utils/logger/index.js";
|
|
2
2
|
import { init_logger } from "../../utils/logger.js";
|
|
3
|
+
import { getClarificationResumeInput, isClarificationSuspended } from "../../storage/sqlite/clarification-wait-repository.js";
|
|
3
4
|
import { getConnectionResumeInput, isConnectionSuspended } from "../../storage/sqlite/connection-wait-repository.js";
|
|
4
5
|
import { EmbeddedRunConflictError, abortEmbeddedRun, acquireEmbeddedRunLease, queueEmbeddedSteer } from "./runs.js";
|
|
5
6
|
import { lastAssistantPlainText, subscribeEmbeddedSessionEvents } from "./subscribe-session.js";
|
|
@@ -235,6 +236,7 @@ async function runXopcEmbeddedTurn(params) {
|
|
|
235
236
|
});
|
|
236
237
|
let policyStopped = false;
|
|
237
238
|
let connectionStopped = false;
|
|
239
|
+
let clarificationStopped = false;
|
|
238
240
|
params.turnPolicy?.reset();
|
|
239
241
|
session.agent.beforeToolCall = async (context, signal) => {
|
|
240
242
|
if (connectionStopped) return {
|
|
@@ -242,6 +244,11 @@ async function runXopcEmbeddedTurn(params) {
|
|
|
242
244
|
reason: "Waiting for the user to connect an app.",
|
|
243
245
|
terminate: true
|
|
244
246
|
};
|
|
247
|
+
if (clarificationStopped) return {
|
|
248
|
+
block: true,
|
|
249
|
+
reason: "Waiting for the user to answer.",
|
|
250
|
+
terminate: true
|
|
251
|
+
};
|
|
245
252
|
const decision = await params.turnPolicy?.beforeToolCall(context, signal);
|
|
246
253
|
if (decision?.block) {
|
|
247
254
|
policyStopped ||= decision.terminate === true;
|
|
@@ -259,6 +266,7 @@ async function runXopcEmbeddedTurn(params) {
|
|
|
259
266
|
};
|
|
260
267
|
session.agent.afterToolCall = async (context) => {
|
|
261
268
|
connectionStopped ||= isConnectionSuspended(sessionKey, runId);
|
|
269
|
+
clarificationStopped ||= isClarificationSuspended(sessionKey, runId);
|
|
262
270
|
const scoped = context.toolCall.name === "read_file" ? await instructions.forTool(context.toolCall.name, context.args) : "";
|
|
263
271
|
const checked = await verification.afterTool(context);
|
|
264
272
|
if (scoped) checked.result.content.unshift({
|
|
@@ -273,7 +281,7 @@ async function runXopcEmbeddedTurn(params) {
|
|
|
273
281
|
};
|
|
274
282
|
session.agent.shouldStopAfterTurn = (context) => {
|
|
275
283
|
policyStopped ||= params.turnPolicy?.shouldStopAfterTurn(context) ?? false;
|
|
276
|
-
return policyStopped || connectionStopped;
|
|
284
|
+
return policyStopped || connectionStopped || clarificationStopped;
|
|
277
285
|
};
|
|
278
286
|
unsubscribe = subscribeEmbeddedSessionEvents(session, (event) => {
|
|
279
287
|
if (event.type === "message_end" && event.message.role === "assistant") recordPromptCacheTouch(sessionKey, resolvedModel, event.message.usage);
|
|
@@ -290,11 +298,17 @@ async function runXopcEmbeddedTurn(params) {
|
|
|
290
298
|
try {
|
|
291
299
|
await runAgentTurnWithTimeout(session.agent, async () => {
|
|
292
300
|
const connectionResume = getConnectionResumeInput(sessionKey, runId);
|
|
301
|
+
const clarificationResume = getClarificationResumeInput(sessionKey, runId);
|
|
293
302
|
if (connectionResume) await session.sendCustomMessage({
|
|
294
303
|
customType: "connection_resume",
|
|
295
304
|
content: connectionResume.content,
|
|
296
305
|
display: false
|
|
297
306
|
}, { triggerTurn: true });
|
|
307
|
+
else if (clarificationResume) await session.sendCustomMessage({
|
|
308
|
+
customType: "clarification_resume",
|
|
309
|
+
content: clarificationResume.content,
|
|
310
|
+
display: false
|
|
311
|
+
}, { triggerTurn: true });
|
|
298
312
|
else if (params.resumeLastUserMessage) await session.agent.continue();
|
|
299
313
|
else {
|
|
300
314
|
const text = userMessageToPromptText(userMessage);
|
|
@@ -302,7 +316,8 @@ async function runXopcEmbeddedTurn(params) {
|
|
|
302
316
|
await session.prompt(text, images.length > 0 ? { images } : void 0);
|
|
303
317
|
}
|
|
304
318
|
await session.agent.waitForIdle();
|
|
305
|
-
|
|
319
|
+
clarificationStopped ||= isClarificationSuspended(sessionKey, runId);
|
|
320
|
+
if (connectionStopped || clarificationStopped) return;
|
|
306
321
|
await maybeRetryTurnAfterTransientLlmFailure(session.agent, {
|
|
307
322
|
sessionKey,
|
|
308
323
|
log,
|
|
@@ -330,6 +345,10 @@ async function runXopcEmbeddedTurn(params) {
|
|
|
330
345
|
runId,
|
|
331
346
|
sessionKey
|
|
332
347
|
});
|
|
348
|
+
if (clarificationStopped) runner.piSm.appendCustomEntry("clarification_required", {
|
|
349
|
+
runId,
|
|
350
|
+
sessionKey
|
|
351
|
+
});
|
|
333
352
|
runner.piSm.appendCustomEntry("coding_verification", {
|
|
334
353
|
runId,
|
|
335
354
|
workspace: workspaceDir,
|
|
@@ -356,7 +375,7 @@ async function runXopcEmbeddedTurn(params) {
|
|
|
356
375
|
});
|
|
357
376
|
return {
|
|
358
377
|
ok: true,
|
|
359
|
-
...connectionStopped ? { stopReason: "connection_required" } : {},
|
|
378
|
+
...connectionStopped ? { stopReason: "connection_required" } : clarificationStopped ? { stopReason: "clarification_required" } : {},
|
|
360
379
|
lastAssistantText: lastAssistantPlainText(session)
|
|
361
380
|
};
|
|
362
381
|
} finally {
|
|
@@ -89,7 +89,7 @@ export type RunXopcEmbeddedTurnParams = {
|
|
|
89
89
|
};
|
|
90
90
|
export type RunXopcEmbeddedTurnResult = {
|
|
91
91
|
ok: boolean;
|
|
92
|
-
stopReason?: 'connection_required';
|
|
92
|
+
stopReason?: 'connection_required' | 'clarification_required';
|
|
93
93
|
/** False for harness failures that must not trigger another model attempt. */
|
|
94
94
|
retryable?: boolean;
|
|
95
95
|
errorMessage?: 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,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
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { getClarificationResumeInput } from "../../storage/sqlite/clarification-wait-repository.js";
|
|
1
2
|
import { getConnectionResumeInput } from "../../storage/sqlite/connection-wait-repository.js";
|
|
2
3
|
import { resolveImageHandlingStrategy } from "../image/vision-detection.js";
|
|
3
4
|
import { hydrateUserTurnForLlm } from "../inbound/attachment-pipeline.js";
|
|
@@ -87,6 +88,8 @@ async function tryRunSlashCommand(deps, ctx, content, options) {
|
|
|
87
88
|
async function runDirectAgentTurn(deps, input) {
|
|
88
89
|
const turnId = input.runId ?? crypto.randomUUID();
|
|
89
90
|
const isConnectionResume = Boolean(getConnectionResumeInput(input.sessionKey, turnId));
|
|
91
|
+
const isClarificationResume = Boolean(getClarificationResumeInput(input.sessionKey, turnId));
|
|
92
|
+
const isResume = isConnectionResume || isClarificationResume;
|
|
90
93
|
const userPlain = extractAgentUserPlainText(input.userMessage);
|
|
91
94
|
const userContext = await deps.agentManager.prepareUserTurnContext(input.userMessage, input.sessionKey, turnId);
|
|
92
95
|
const sourceContexts = input.sourceContexts ?? [];
|
|
@@ -111,11 +114,11 @@ async function runDirectAgentTurn(deps, input) {
|
|
|
111
114
|
getConfig: () => deps.config,
|
|
112
115
|
abortSignal: input.abortSignal,
|
|
113
116
|
deadlineAtMs: input.deadlineAtMs,
|
|
114
|
-
beforeTurn:
|
|
117
|
+
beforeTurn: isResume ? void 0 : () => deps.agentManager.beginBackgroundReviewUserTurn(input.sessionKey),
|
|
115
118
|
onEvent: input.onEvent
|
|
116
119
|
});
|
|
117
|
-
if (!
|
|
118
|
-
if (!
|
|
120
|
+
if (!isResume) await deps.agentManager.afterAgentTurn(input.sessionKey, userPlain, turnId);
|
|
121
|
+
if (!isResume && result.stopReason !== "connection_required" && result.stopReason !== "clarification_required") deps.agentManager.scheduleBackgroundReviewAfterUserTurn(input.sessionKey);
|
|
119
122
|
return result;
|
|
120
123
|
}
|
|
121
124
|
//#endregion
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { getClarificationResumeInput } from "../../storage/sqlite/clarification-wait-repository.js";
|
|
1
2
|
import { getConnectionResumeInput } from "../../storage/sqlite/connection-wait-repository.js";
|
|
2
3
|
import { readAgentMessageContent } from "../memory/agent-message-access.js";
|
|
3
4
|
import { abortEmbeddedRun } from "../embedded/runs.js";
|
|
@@ -126,6 +127,8 @@ function pushAssistantReceipt(queue, text, runId, metadata) {
|
|
|
126
127
|
async function* runProcessDirectStreaming(deps, input) {
|
|
127
128
|
const sessionKey = input.sessionKey ?? "agent:main:main";
|
|
128
129
|
const isConnectionResume = Boolean(input.runId && getConnectionResumeInput(sessionKey, input.runId));
|
|
130
|
+
const isClarificationResume = Boolean(input.runId && getClarificationResumeInput(sessionKey, input.runId));
|
|
131
|
+
const isInternalResume = isConnectionResume || isClarificationResume;
|
|
129
132
|
const { channel, chatId } = await deps.resolveSessionEndpoint(sessionKey);
|
|
130
133
|
const context = deps.initDirectStreamingSession(sessionKey, channel, chatId, input.origin);
|
|
131
134
|
const queue = new AsyncQueue({
|
|
@@ -276,7 +279,7 @@ async function* runProcessDirectStreaming(deps, input) {
|
|
|
276
279
|
if (sourceContext && !sourceContexts.some((context) => context.kind === sourceContext.kind && context.sourceId === sourceContext.sourceId)) sourceContexts.push(sourceContext);
|
|
277
280
|
}
|
|
278
281
|
}
|
|
279
|
-
if (channel === "webchat" && !
|
|
282
|
+
if (channel === "webchat" && !isInternalResume) {
|
|
280
283
|
pushVisible({
|
|
281
284
|
type: "user_message",
|
|
282
285
|
timestamp: userMessage.timestamp ?? Date.now(),
|
|
@@ -287,7 +290,7 @@ async function* runProcessDirectStreaming(deps, input) {
|
|
|
287
290
|
if (textForAgent.trim()) deps.enqueueProvisionalSessionTitle?.(sessionKey, textForAgent);
|
|
288
291
|
}
|
|
289
292
|
const pendingUserMessage = sourceContexts.length > 0 ? injectSourceContextsIntoUserMessage(userMessage, sourceContexts) : userMessage;
|
|
290
|
-
if (!
|
|
293
|
+
if (!isInternalResume) setPendingTranscriptUserMessage(sessionKey, pendingUserMessage);
|
|
291
294
|
try {
|
|
292
295
|
const result = await deps.agentManager.withSkillCapabilities(sessionKey, skillTurn.activatedCapabilityNames, () => runDirectAgentTurn({
|
|
293
296
|
sessionStore: deps.sessionStore,
|
|
@@ -314,7 +317,7 @@ async function* runProcessDirectStreaming(deps, input) {
|
|
|
314
317
|
content: formatStreamError(result.errorMessage)
|
|
315
318
|
});
|
|
316
319
|
} finally {
|
|
317
|
-
if (!
|
|
320
|
+
if (!isInternalResume) clearPendingTranscriptUserMessage(sessionKey, pendingUserMessage);
|
|
318
321
|
}
|
|
319
322
|
} catch (err) {
|
|
320
323
|
if (err instanceof AsyncQueueOverflowError) {
|
|
@@ -121,12 +121,14 @@ export declare class AgentService {
|
|
|
121
121
|
refreshUserProfileContext(): void;
|
|
122
122
|
getMemoryManager(): import("./memory/manager.js").MemoryManager;
|
|
123
123
|
getModelForSession(sessionKey: string): string;
|
|
124
|
+
getThinkingLevelForSession(sessionKey: string): ThinkingLevel;
|
|
124
125
|
/** Run a full tool-capable turn against a caller-owned, non-persistent transcript. */
|
|
125
126
|
runEphemeralTurn(params: {
|
|
126
127
|
executionSessionKey: string;
|
|
127
128
|
parentSessionKey: string;
|
|
128
129
|
runId: string;
|
|
129
130
|
content: string;
|
|
131
|
+
attachments?: InboundAttachmentInput[];
|
|
130
132
|
modelRef: string;
|
|
131
133
|
thinkingLevel?: ThinkingLevel;
|
|
132
134
|
transcriptRuntime: EmbeddedTranscriptRuntime;
|
|
@@ -2,10 +2,10 @@ import { createLogger } from "../utils/logger/index.js";
|
|
|
2
2
|
import { init_logger } from "../utils/logger.js";
|
|
3
3
|
import { parseNoteAttachmentTarget } from "../notes/attachment-ref.js";
|
|
4
4
|
import { getAgentDefaultModelRef, init_schema } from "../config/schema.js";
|
|
5
|
-
import { applyConfigOverrides } from "../config/runtime-overrides.js";
|
|
6
5
|
import { init_agent_scope, resolveAgentHomeDir, resolveDefaultAgentId } from "./agent-scope.js";
|
|
7
|
-
import { extractProfileAgentId } from "../config/agent-profile.js";
|
|
8
6
|
import { init_providers, resolveModel } from "../providers/index.js";
|
|
7
|
+
import { applyConfigOverrides } from "../config/runtime-overrides.js";
|
|
8
|
+
import { extractProfileAgentId } from "../config/agent-profile.js";
|
|
9
9
|
import { extractTextContent } from "./context/workspace.js";
|
|
10
10
|
import { effectiveWorkspacePathForSession } from "../session/session-workspace.js";
|
|
11
11
|
import { getProjectForSession } from "../projects/workspace.js";
|
|
@@ -19,6 +19,7 @@ import "../user-model/index.js";
|
|
|
19
19
|
import { resolveAgentTurnTimeoutMs } from "./orchestration/run-agent-turn-with-timeout.js";
|
|
20
20
|
import { onSessionTranscriptUpdate } from "../session/transcript-events.js";
|
|
21
21
|
import { persistInboundAttachments } from "../channels/attachments/inbound-persist.js";
|
|
22
|
+
import { buildTranscriptUserMessage, hydrateUserTurnForLlm } from "./inbound/attachment-pipeline.js";
|
|
22
23
|
import { runXopcEmbeddedTurn } from "./embedded/run-turn.js";
|
|
23
24
|
import { resolveResponseLanguageForSession } from "./prompt/response-language.js";
|
|
24
25
|
import { normalizeSkillInstallTarget } from "./skills/install-target.js";
|
|
@@ -577,19 +578,31 @@ var AgentService = class {
|
|
|
577
578
|
getModelForSession(sessionKey) {
|
|
578
579
|
return this.modelManager.getModelForSession(sessionKey);
|
|
579
580
|
}
|
|
581
|
+
getThinkingLevelForSession(sessionKey) {
|
|
582
|
+
return this.agentManager.getOrCreateAgent(sessionKey).state.thinkingLevel ?? "medium";
|
|
583
|
+
}
|
|
580
584
|
/** Run a full tool-capable turn against a caller-owned, non-persistent transcript. */
|
|
581
585
|
async runEphemeralTurn(params) {
|
|
582
586
|
const agent = this.agentManager.getOrCreateAgent(params.parentSessionKey);
|
|
583
587
|
const workspaceDir = this.agentManager.getResolvedWorkspaceForSession(params.parentSessionKey);
|
|
584
588
|
const model = resolveModel(params.modelRef);
|
|
589
|
+
const prepared = await this.prepareInboundAttachments(params.executionSessionKey, params.attachments);
|
|
590
|
+
const userMessage = await buildTranscriptUserMessage({
|
|
591
|
+
text: params.content,
|
|
592
|
+
prepared,
|
|
593
|
+
sessionKey: params.parentSessionKey,
|
|
594
|
+
modelRef: params.modelRef,
|
|
595
|
+
config: this.effectiveAppConfig(),
|
|
596
|
+
agentManager: this.agentManager
|
|
597
|
+
});
|
|
598
|
+
const llmTurn = await hydrateUserTurnForLlm({
|
|
599
|
+
message: userMessage,
|
|
600
|
+
modelRef: params.modelRef
|
|
601
|
+
});
|
|
585
602
|
return runWithEmbeddedExecutionSession(params.executionSessionKey, () => runXopcEmbeddedTurn({
|
|
586
603
|
sessionKey: params.executionSessionKey,
|
|
587
604
|
runId: params.runId,
|
|
588
|
-
userMessage
|
|
589
|
-
role: "user",
|
|
590
|
-
content: params.content,
|
|
591
|
-
timestamp: Date.now()
|
|
592
|
-
},
|
|
605
|
+
userMessage,
|
|
593
606
|
model,
|
|
594
607
|
modelRef: params.modelRef,
|
|
595
608
|
tools: agent.state.tools,
|
|
@@ -600,8 +613,9 @@ var AgentService = class {
|
|
|
600
613
|
timeoutMs: resolveAgentTurnTimeoutMs(this.effectiveAppConfig(), params.parentSessionKey),
|
|
601
614
|
turnPolicy: this.agentManager.createAgentTurnPolicy(params.parentSessionKey),
|
|
602
615
|
abortSignal: params.abortSignal,
|
|
603
|
-
onEvent: params.onEvent
|
|
604
|
-
|
|
616
|
+
onEvent: params.onEvent,
|
|
617
|
+
images: llmTurn.images
|
|
618
|
+
}), params.runId);
|
|
605
619
|
}
|
|
606
620
|
async switchModelForSession(sessionKey, modelId) {
|
|
607
621
|
if (!await this.modelManager.switchModelForSession(sessionKey, modelId)) return false;
|
|
@@ -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 { getExecutionEnvironmentForSession } from "../../execution-environments/subject.js";
|
|
7
7
|
import { effectiveWorkspacePathForSession, projectWorkspacePath } from "../../session/session-workspace.js";
|
|
8
8
|
import { getProjectForSession } from "../../projects/workspace.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,15 +1,15 @@
|
|
|
1
1
|
import { createLogger } from "../../utils/logger/index.js";
|
|
2
2
|
import { init_logger } from "../../utils/logger.js";
|
|
3
3
|
import { TaskRunRepository } from "../../tasks/task-run-repository.js";
|
|
4
|
+
import { extractAssistantText, getAssistantMessageErrorReason, stripCodeFences } from "../../providers/model-response.js";
|
|
4
5
|
import { getAgentDefaultModelRef, init_schema } from "../../config/schema.js";
|
|
5
|
-
import { resolveEffectiveAgentProfileForSession } from "../../config/agent-profile.js";
|
|
6
6
|
import { getApiKey, init_providers, resolveModel } from "../../providers/index.js";
|
|
7
|
+
import { completeWithResolvedCredentials } from "../../providers/model-call.js";
|
|
8
|
+
import { resolveEffectiveAgentProfileForSession } from "../../config/agent-profile.js";
|
|
7
9
|
import { TaskRepository } from "../../tasks/task-repository.js";
|
|
8
10
|
import { TaskConversationRepository } from "../../tasks/task-conversation-repository.js";
|
|
9
11
|
import { readWorkspaceRevision } from "../coding/workspace-revision.js";
|
|
10
|
-
import { completeWithResolvedCredentials } from "../../providers/model-call.js";
|
|
11
12
|
import { TaskApplicationService } from "../../tasks/task-application-service.js";
|
|
12
|
-
import { extractAssistantText, getAssistantMessageErrorReason, stripCodeFences } from "../../providers/model-response.js";
|
|
13
13
|
//#region src/agent/tasks/task-judge-service.ts
|
|
14
14
|
init_schema();
|
|
15
15
|
init_providers();
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { formatBrowserObservation } from "../../../../browser/observation/format.js";
|
|
2
|
-
import { BrowserUseSchema } from "./schemas.js";
|
|
2
|
+
import { BrowserUseSchema, decodeBrowserUseInput } from "./schemas.js";
|
|
3
3
|
//#region src/agent/tools/browser/tool/browser-use-tool.ts
|
|
4
4
|
function createBrowserUseTool(deps) {
|
|
5
5
|
return {
|
|
@@ -8,6 +8,21 @@ function createBrowserUseTool(deps) {
|
|
|
8
8
|
description: "Control a persistent browser through typed semantic actions. Start with observe or navigate, then use only refs and revision values from the latest observation. Screenshots are attached only when requested or semantic observation is insufficient.",
|
|
9
9
|
parameters: BrowserUseSchema,
|
|
10
10
|
async execute(_toolCallId, params, signal) {
|
|
11
|
+
const input = decodeBrowserUseInput(params);
|
|
12
|
+
if (!input) return {
|
|
13
|
+
content: [{
|
|
14
|
+
type: "text",
|
|
15
|
+
text: `[INVALID_INPUT] Invalid parameters for browser action "${params.action}".`
|
|
16
|
+
}],
|
|
17
|
+
details: {
|
|
18
|
+
ok: false,
|
|
19
|
+
kind: "browser_error",
|
|
20
|
+
error: {
|
|
21
|
+
code: "INVALID_INPUT",
|
|
22
|
+
message: `Invalid parameters for browser action "${params.action}".`
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
};
|
|
11
26
|
const readiness = await deps.getReadiness?.();
|
|
12
27
|
if (readiness) return {
|
|
13
28
|
content: [{
|
|
@@ -20,7 +35,7 @@ function createBrowserUseTool(deps) {
|
|
|
20
35
|
hint: readiness.hint
|
|
21
36
|
}
|
|
22
37
|
};
|
|
23
|
-
return presentResult(await deps.getRuntime().execute(deps.getTaskId(),
|
|
38
|
+
return presentResult(await deps.getRuntime().execute(deps.getTaskId(), input, signal));
|
|
24
39
|
}
|
|
25
40
|
};
|
|
26
41
|
}
|