@maudecode/talaria-web 1.19.0 → 1.21.0
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/_release.json +8 -8
- package/dist/api/automation-raw.js +61 -6
- package/dist/api/automation-raw.js.map +1 -1
- package/dist/api/automation-router.d.ts +309 -2
- package/dist/api/automation-router.js +28 -2
- package/dist/api/automation-router.js.map +1 -1
- package/dist/api/chat-router.d.ts +646 -24
- package/dist/api/chat-router.js +54 -167
- package/dist/api/chat-router.js.map +1 -1
- package/dist/api/git-router.d.ts +54 -0
- package/dist/api/git-router.js +18 -5
- package/dist/api/git-router.js.map +1 -1
- package/dist/api/raw-routes.js +13 -1
- package/dist/api/raw-routes.js.map +1 -1
- package/dist/api/router.d.ts +3 -3
- package/dist/api/session-visibility.js +2 -2
- package/dist/api/session-visibility.js.map +1 -1
- package/dist/api/sessions-router.d.ts +1868 -79
- package/dist/api/sessions-router.js +72 -43
- package/dist/api/sessions-router.js.map +1 -1
- package/dist/api/settings-router.d.ts +34 -13
- package/dist/api/settings-router.js +54 -17
- package/dist/api/settings-router.js.map +1 -1
- package/dist/api/sse-routes.js +45 -21
- package/dist/api/sse-routes.js.map +1 -1
- package/dist/api/tools-router.d.ts +773 -39
- package/dist/api/tools-router.js +167 -45
- package/dist/api/tools-router.js.map +1 -1
- package/dist/app.js +15 -11
- package/dist/app.js.map +1 -1
- package/dist/auth/crypto.d.ts +3 -0
- package/dist/auth/crypto.js +18 -0
- package/dist/auth/crypto.js.map +1 -1
- package/dist/auth/gate.js +5 -1
- package/dist/auth/gate.js.map +1 -1
- package/dist/cli/ctl.js +6 -1
- package/dist/cli/ctl.js.map +1 -1
- package/dist/cli/main.js +23 -18
- package/dist/cli/main.js.map +1 -1
- package/dist/cli/supervise.d.ts +22 -0
- package/dist/cli/supervise.js +80 -2
- package/dist/cli/supervise.js.map +1 -1
- package/dist/config/agent-config.d.ts +3 -0
- package/dist/config/agent-config.js +36 -9
- package/dist/config/agent-config.js.map +1 -1
- package/dist/fs/atomic.d.ts +3 -0
- package/dist/fs/atomic.js +19 -5
- package/dist/fs/atomic.js.map +1 -1
- package/dist/fs/stat.d.ts +6 -0
- package/dist/fs/stat.js +18 -2
- package/dist/fs/stat.js.map +1 -1
- package/dist/http/context.d.ts +16 -0
- package/dist/http/context.js +48 -5
- package/dist/http/context.js.map +1 -1
- package/dist/profiles/profiles.d.ts +2 -0
- package/dist/profiles/profiles.js +1 -0
- package/dist/profiles/profiles.js.map +1 -1
- package/dist/providers/catalog.d.ts +11 -6
- package/dist/providers/catalog.js +76 -24
- package/dist/providers/catalog.js.map +1 -1
- package/dist/redact.d.ts +2 -0
- package/dist/redact.js +55 -16
- package/dist/redact.js.map +1 -1
- package/dist/release.js +5 -3
- package/dist/release.js.map +1 -1
- package/dist/runtime.js +118 -26
- package/dist/runtime.js.map +1 -1
- package/dist/server.js +25 -21
- package/dist/server.js.map +1 -1
- package/dist/sessions/admission.d.ts +21 -0
- package/dist/sessions/admission.js +176 -0
- package/dist/sessions/admission.js.map +1 -0
- package/dist/sessions/anchor.d.ts +4 -1
- package/dist/sessions/anchor.js +9 -5
- package/dist/sessions/anchor.js.map +1 -1
- package/dist/sessions/background-tasks.d.ts +41 -3
- package/dist/sessions/background-tasks.js +110 -10
- package/dist/sessions/background-tasks.js.map +1 -1
- package/dist/sessions/cli-sessions.d.ts +9 -2
- package/dist/sessions/cli-sessions.js +38 -57
- package/dist/sessions/cli-sessions.js.map +1 -1
- package/dist/sessions/completions.d.ts +8 -0
- package/dist/sessions/completions.js +55 -25
- package/dist/sessions/completions.js.map +1 -1
- package/dist/sessions/events.d.ts +3 -0
- package/dist/sessions/events.js +4 -0
- package/dist/sessions/events.js.map +1 -1
- package/dist/sessions/export.d.ts +2 -0
- package/dist/sessions/export.js +6 -2
- package/dist/sessions/export.js.map +1 -1
- package/dist/sessions/gateway-sessions.d.ts +92 -4
- package/dist/sessions/gateway-sessions.js +762 -93
- package/dist/sessions/gateway-sessions.js.map +1 -1
- package/dist/sessions/gateway-watcher.d.ts +10 -11
- package/dist/sessions/gateway-watcher.js +25 -21
- package/dist/sessions/gateway-watcher.js.map +1 -1
- package/dist/sessions/list.d.ts +9 -2
- package/dist/sessions/list.js +38 -26
- package/dist/sessions/list.js.map +1 -1
- package/dist/sessions/merge.d.ts +12 -5
- package/dist/sessions/merge.js +65 -18
- package/dist/sessions/merge.js.map +1 -1
- package/dist/sessions/prefix-index.d.ts +15 -4
- package/dist/sessions/prefix-index.js +35 -13
- package/dist/sessions/prefix-index.js.map +1 -1
- package/dist/sessions/prompt-queues.d.ts +36 -0
- package/dist/sessions/prompt-queues.js +318 -0
- package/dist/sessions/prompt-queues.js.map +1 -0
- package/dist/sessions/recovery.d.ts +1 -1
- package/dist/sessions/recovery.js +4 -3
- package/dist/sessions/recovery.js.map +1 -1
- package/dist/sessions/relay.d.ts +12 -1
- package/dist/sessions/relay.js +75 -17
- package/dist/sessions/relay.js.map +1 -1
- package/dist/sessions/service.d.ts +132 -37
- package/dist/sessions/service.js +688 -160
- package/dist/sessions/service.js.map +1 -1
- package/dist/sessions/session.d.ts +2 -0
- package/dist/sessions/session.js +5 -0
- package/dist/sessions/session.js.map +1 -1
- package/dist/sessions/state-db-worker.js +22 -5
- package/dist/sessions/state-db-worker.js.map +1 -1
- package/dist/sessions/state-db.d.ts +106 -15
- package/dist/sessions/state-db.js +651 -236
- package/dist/sessions/state-db.js.map +1 -1
- package/dist/sessions/state-saved.d.ts +1 -1
- package/dist/sessions/state-saved.js +35 -11
- package/dist/sessions/state-saved.js.map +1 -1
- package/dist/sessions/storage/backend.d.ts +10 -1
- package/dist/sessions/storage/backend.js.map +1 -1
- package/dist/sessions/storage/conformance.js +1 -1
- package/dist/sessions/storage/conformance.js.map +1 -1
- package/dist/sessions/storage/json-documents.d.ts +2 -0
- package/dist/sessions/storage/json-documents.js +71 -26
- package/dist/sessions/storage/json-documents.js.map +1 -1
- package/dist/sessions/storage/json-files.d.ts +13 -2
- package/dist/sessions/storage/json-files.js +126 -6
- package/dist/sessions/storage/json-files.js.map +1 -1
- package/dist/sessions/storage/json-journal.d.ts +6 -7
- package/dist/sessions/storage/json-journal.js +143 -73
- package/dist/sessions/storage/json-journal.js.map +1 -1
- package/dist/sessions/storage/json.d.ts +15 -1
- package/dist/sessions/storage/json.js +125 -33
- package/dist/sessions/storage/json.js.map +1 -1
- package/dist/sessions/store.d.ts +6 -1
- package/dist/sessions/store.js +68 -27
- package/dist/sessions/store.js.map +1 -1
- package/dist/sessions/streams.d.ts +10 -7
- package/dist/sessions/streams.js +49 -14
- package/dist/sessions/streams.js.map +1 -1
- package/dist/sessions/tool-display.d.ts +11 -2
- package/dist/sessions/tool-display.js +45 -4
- package/dist/sessions/tool-display.js.map +1 -1
- package/dist/sessions/turn-context.js +6 -2
- package/dist/sessions/turn-context.js.map +1 -1
- package/dist/sessions/turn.d.ts +27 -6
- package/dist/sessions/turn.js +186 -89
- package/dist/sessions/turn.js.map +1 -1
- package/dist/sidecar/client.d.ts +24 -1
- package/dist/sidecar/client.js +118 -38
- package/dist/sidecar/client.js.map +1 -1
- package/dist/sidecar/fake.d.ts +6 -2
- package/dist/sidecar/fake.js +15 -2
- package/dist/sidecar/fake.js.map +1 -1
- package/dist/spa.d.ts +9 -4
- package/dist/spa.js +36 -12
- package/dist/spa.js.map +1 -1
- package/dist/startup-timing.d.ts +66 -0
- package/dist/startup-timing.js +129 -0
- package/dist/startup-timing.js.map +1 -0
- package/dist/test/fs-handles.d.ts +11 -0
- package/dist/test/fs-handles.js +31 -0
- package/dist/test/fs-handles.js.map +1 -0
- package/dist/tools/connectors.d.ts +1 -1
- package/dist/tools/connectors.js +2 -2
- package/dist/tools/connectors.js.map +1 -1
- package/dist/tools/crons.d.ts +8 -4
- package/dist/tools/crons.js +25 -18
- package/dist/tools/crons.js.map +1 -1
- package/dist/tools/dashboard-plugins.d.ts +29 -0
- package/dist/tools/dashboard-plugins.js +132 -0
- package/dist/tools/dashboard-plugins.js.map +1 -1
- package/dist/tools/gateway-restart.d.ts +25 -5
- package/dist/tools/gateway-restart.js +103 -23
- package/dist/tools/gateway-restart.js.map +1 -1
- package/dist/tools/health.d.ts +13 -1
- package/dist/tools/health.js +80 -22
- package/dist/tools/health.js.map +1 -1
- package/dist/tools/insights.d.ts +1 -1
- package/dist/tools/insights.js +2 -2
- package/dist/tools/insights.js.map +1 -1
- package/dist/tools/kanban.d.ts +10 -1
- package/dist/tools/kanban.js +73 -1
- package/dist/tools/kanban.js.map +1 -1
- package/dist/tools/mcp-health.js +74 -24
- package/dist/tools/mcp-health.js.map +1 -1
- package/dist/tools/mcp.d.ts +3 -1
- package/dist/tools/mcp.js +92 -1
- package/dist/tools/mcp.js.map +1 -1
- package/dist/tools/memory.d.ts +28 -0
- package/dist/tools/memory.js +120 -14
- package/dist/tools/memory.js.map +1 -1
- package/dist/tools/plugin-oauth.d.ts +14 -0
- package/dist/tools/plugin-oauth.js +53 -0
- package/dist/tools/plugin-oauth.js.map +1 -0
- package/dist/tools/prune-advice.d.ts +50 -0
- package/dist/tools/prune-advice.js +114 -0
- package/dist/tools/prune-advice.js.map +1 -0
- package/dist/tools/skills.d.ts +5 -2
- package/dist/tools/skills.js +9 -6
- package/dist/tools/skills.js.map +1 -1
- package/dist/tools/update-notifications.d.ts +77 -9
- package/dist/tools/update-notifications.js +390 -46
- package/dist/tools/update-notifications.js.map +1 -1
- package/dist/tools/updates.d.ts +29 -3
- package/dist/tools/updates.js +166 -34
- package/dist/tools/updates.js.map +1 -1
- package/dist/workspace/managed-buffers.d.ts +58 -0
- package/dist/workspace/managed-buffers.js +76 -0
- package/dist/workspace/managed-buffers.js.map +1 -0
- package/dist/workspace/media.js +69 -20
- package/dist/workspace/media.js.map +1 -1
- package/dist/workspace/preview.js +4 -14
- package/dist/workspace/preview.js.map +1 -1
- package/dist/workspace/rollback.d.ts +6 -2
- package/dist/workspace/rollback.js +18 -8
- package/dist/workspace/rollback.js.map +1 -1
- package/package.json +3 -3
- package/sidecar/agent_dependency.json +4 -4
- package/sidecar/agent_support.json +30 -15
- package/sidecar/scripts/suite_runner.py +183 -27
- package/sidecar/scripts/test.sh +5 -7
- package/sidecar/talaria_sidecar/__init__.py +1 -1
- package/sidecar/talaria_sidecar/__main__.py +10 -3
- package/sidecar/talaria_sidecar/agent_mutation.py +246 -32
- package/sidecar/talaria_sidecar/agent_services.py +157 -34
- package/sidecar/talaria_sidecar/context_detail.py +59 -0
- package/sidecar/talaria_sidecar/home.py +97 -20
- package/sidecar/talaria_sidecar/methods/__init__.py +2 -2
- package/sidecar/talaria_sidecar/methods/aux.py +80 -18
- package/sidecar/talaria_sidecar/methods/chat.py +571 -106
- package/sidecar/talaria_sidecar/methods/checkpoints.py +29 -4
- package/sidecar/talaria_sidecar/methods/commands.py +277 -16
- package/sidecar/talaria_sidecar/methods/config.py +73 -3
- package/sidecar/talaria_sidecar/methods/connectors.py +45 -13
- package/sidecar/talaria_sidecar/methods/cron.py +8 -2
- package/sidecar/talaria_sidecar/methods/dashboard_plugins.py +301 -0
- package/sidecar/talaria_sidecar/methods/gateway.py +24 -4
- package/sidecar/talaria_sidecar/methods/gateway_sessions.py +304 -30
- package/sidecar/talaria_sidecar/methods/kanban.py +50 -3
- package/sidecar/talaria_sidecar/methods/managed_buffers.py +110 -0
- package/sidecar/talaria_sidecar/methods/mcp.py +55 -0
- package/sidecar/talaria_sidecar/methods/oauth.py +139 -11
- package/sidecar/talaria_sidecar/methods/outbound_drafts.py +165 -0
- package/sidecar/talaria_sidecar/methods/plugin_catalog.py +198 -0
- package/sidecar/talaria_sidecar/methods/plugin_oauth.py +234 -0
- package/sidecar/talaria_sidecar/methods/process.py +70 -6
- package/sidecar/talaria_sidecar/methods/profiles.py +4 -3
- package/sidecar/talaria_sidecar/methods/runtime.py +2 -0
- package/sidecar/talaria_sidecar/methods/skills.py +22 -7
- package/sidecar/talaria_sidecar/methods/state_db.py +128 -42
- package/sidecar/talaria_sidecar/methods/toolsets.py +4 -2
- package/sidecar/talaria_sidecar/methods/worktree.py +121 -2
- package/sidecar/talaria_sidecar/rpc.py +25 -3
- package/sidecar/talaria_sidecar/runtime.py +42 -3
- package/sidecar/talaria_sidecar/speed.py +13 -1
- package/sidecar/talaria_sidecar/startup_timing.py +119 -0
- package/static/dist/FILES.txt +240 -213
- package/static/dist/THIRD_PARTY_LICENSES.md +6 -22
- package/static/dist/assets/AppShell-c5989995.js +8 -0
- package/static/dist/assets/Button-nuaikybd.js +1 -0
- package/static/dist/assets/ChatPage-bfg4khph.js +6 -0
- package/static/dist/assets/ConnectTargets-k5wo9yo8.js +1 -0
- package/static/dist/assets/Dialog-o8vo2aws.js +1 -0
- package/static/dist/assets/ExtensionRoute-l1yjrso4.js +1 -0
- package/static/dist/assets/Field-j7o8cfps.js +1 -0
- package/static/dist/assets/HubRoute-efnwe4xz.js +2 -0
- package/static/dist/assets/LinkCheckContext-ix6zqqkk.js +1 -0
- package/static/dist/assets/Markdown-clqf5m22.js +2 -0
- package/static/dist/assets/MarkdownRenderer-ccgqrza3.js +302 -0
- package/static/dist/assets/MarkdownRenderer-i9o6nr38.css +1 -0
- package/static/dist/assets/OAuthSignIn-h7bjaqp6.js +1 -0
- package/static/dist/assets/ResourceSwitch-oai2zqaj.js +1 -0
- package/static/dist/assets/RightPanel-ho161a45.js +1 -0
- package/static/dist/assets/Select-d1g5a8bm.js +1 -0
- package/static/dist/assets/SessionListPanel-i7kaokhi.js +1 -0
- package/static/dist/assets/SettingsLayout-lnecm87w.js +1 -0
- package/static/dist/assets/States-easntmry.js +1 -0
- package/static/dist/assets/TerminalPanel-lxhwd4jl.js +16 -0
- package/static/dist/assets/Toaster-l4sciy8t.js +1 -0
- package/static/dist/assets/_app-mqexqbg8.js +1 -0
- package/static/dist/assets/_app.ext._extensionId-n797jp72.js +1 -0
- package/static/dist/assets/_app.index-ne43mdw2.js +1 -0
- package/static/dist/assets/_app.insights-fqonovb4.js +1 -0
- package/static/dist/assets/_app.kanban-kysliv19.js +1 -0
- package/static/dist/assets/_app.logs-febut82r.js +1 -0
- package/static/dist/assets/_app.memory-ha86oj1c.js +1 -0
- package/static/dist/assets/_app.profiles-cnu3gxxq.js +1 -0
- package/static/dist/assets/_app.session._sessionId-ifzjpcgn.js +1 -0
- package/static/dist/assets/_app.settings-nmakdiaf.js +1 -0
- package/static/dist/assets/_app.settings._section-djglnjmi.js +3 -0
- package/static/dist/assets/_app.skills-f3wad8yo.js +1 -0
- package/static/dist/assets/_app.tasks-l10py1c0.js +1 -0
- package/static/dist/assets/_app.todos-bml1m3r1.js +1 -0
- package/static/dist/assets/_app.workspaces-f3d066lx.js +1 -0
- package/static/dist/assets/abnfDiagram-VCTEODGH-i53jc4yp.js +1 -0
- package/static/dist/assets/{angular-html-nu6l31w3.js → angular-html-l28bd5fo.js} +1 -1
- package/static/dist/assets/{angular-ts-fbx4f8mm.js → angular-ts-ffzx1vj0.js} +1 -1
- package/static/dist/assets/{apl-bx2xr7dh.js → apl-b7h7mmy4.js} +1 -1
- package/static/dist/assets/{arc-7popfhbk.js → arc-fk1b21lm.js} +1 -1
- package/static/dist/assets/architecture-7GRP2DOG-e3bv5m6f.js +1 -0
- package/static/dist/assets/architectureDiagram-5GKGNRK7-pakekxu2.js +36 -0
- package/static/dist/assets/archive-ihqi7z2x.js +1 -0
- package/static/dist/assets/{astro-g77i97cb.js → astro-k117fy0t.js} +1 -1
- package/static/dist/assets/back-gu3nu279.js +1 -0
- package/static/dist/assets/{blade-boo0u92y.js → blade-npefsmn8.js} +1 -1
- package/static/dist/assets/{blockDiagram-I7D4REHJ-joedghi3.js → blockDiagram-I7D4REHJ-bc6bo1n6.js} +4 -4
- package/static/dist/assets/{c-cat0w3sc.js → c-2umg6kbn.js} +1 -1
- package/static/dist/assets/{c4Diagram-7LVT6UL2-hyrjrohe.js → c4Diagram-7LVT6UL2-btvwk2qx.js} +1 -1
- package/static/dist/assets/channel-jn4f8443.js +1 -0
- package/static/dist/assets/{chunk-4HAMMTFA-koouqbut.js → chunk-4HAMMTFA-dlwab11c.js} +20 -20
- package/static/dist/assets/{chunk-75Z2AOVW-bl4bhdnt.js → chunk-75Z2AOVW-dp5gh7i8.js} +1 -1
- package/static/dist/assets/chunk-DU6HZSFF-bi06zl1c.js +128 -0
- package/static/dist/assets/{chunk-F27PBJKO-d8xxi0zi.js → chunk-F27PBJKO-kvv1rnlh.js} +1 -1
- package/static/dist/assets/{chunk-FOHPRMQF-opuflp73.js → chunk-FOHPRMQF-ipewusgj.js} +8 -8
- package/static/dist/assets/{chunk-GMAD6QVW-jro0hl73.js → chunk-GMAD6QVW-ji0rx9by.js} +6 -6
- package/static/dist/assets/{chunk-GVQU2GXP-djn6gbyu.js → chunk-GVQU2GXP-nmz0j82p.js} +1 -1
- package/static/dist/assets/{chunk-IMKFNOWR-vw4p5p7o.js → chunk-IMKFNOWR-kmi1qx88.js} +5 -5
- package/static/dist/assets/{chunk-L3NEJ4N5-n1hj77q8.js → chunk-L3NEJ4N5-xhb7mebj.js} +1 -1
- package/static/dist/assets/chunk-OSK3NFVY-5a9sgscq.js +10 -0
- package/static/dist/assets/{chunk-P2QGCYS3-onf1hz6c.js → chunk-P2QGCYS3-dfezp4vu.js} +1 -1
- package/static/dist/assets/{chunk-POPQ4Y6H-m8sqn7cs.js → chunk-POPQ4Y6H-gd2vq3c0.js} +1 -1
- package/static/dist/assets/{chunk-PWAF6VOD-ek4smc8x.js → chunk-PWAF6VOD-wvw2nksf.js} +1 -1
- package/static/dist/assets/{chunk-SHT3W25Y-g9gfvefo.js → chunk-SHT3W25Y-f58q97px.js} +13 -13
- package/static/dist/assets/{chunk-SVP7TREG-f9nfv2cu.js → chunk-SVP7TREG-abgwpyz9.js} +4 -4
- package/static/dist/assets/{chunk-TICWLB2K-bnk3m1mq.js → chunk-TICWLB2K-h4sbs8ds.js} +6 -6
- package/static/dist/assets/{chunk-XXDRQBXY-n40pf9vy.js → chunk-XXDRQBXY-jkmnqu65.js} +1 -1
- package/static/dist/assets/classDiagram-ZZMXUADV-dzrw66se.js +1 -0
- package/static/dist/assets/classDiagram-v2-VYDZK3BY-dzrw66se.js +1 -0
- package/static/dist/assets/{cobol-go622aep.js → cobol-ssf9hkh7.js} +1 -1
- package/static/dist/assets/{coffee-jwo1xjhq.js → coffee-lsi9fwae.js} +1 -1
- package/static/dist/assets/completionAudio-ce86msbu.js +1 -0
- package/static/dist/assets/copied-bz3gkazh.js +1 -0
- package/static/dist/assets/copy-m9h56qa8.js +1 -0
- package/static/dist/assets/cose-bilkent-JH36ORCC-layy2r27.js +1 -0
- package/static/dist/assets/{cpp-nre7j0kq.js → cpp-lfrh4y55.js} +1 -1
- package/static/dist/assets/{crystal-lviso2je.js → crystal-efh4pte7.js} +1 -1
- package/static/dist/assets/{css-ywz9j4hb.js → css-i82qdo89.js} +1 -1
- package/static/dist/assets/cynefin-OW5HDTMX-g081vffs.js +1 -0
- package/static/dist/assets/cynefinDiagram-5FMLGOSQ-odxvjesk.js +62 -0
- package/static/dist/assets/cytoscape.esm-fjn2algp.js +321 -0
- package/static/dist/assets/dagre-GXQ25YYZ-cpdwzjs4.js +4 -0
- package/static/dist/assets/dagre-o5jmjz46.js +1 -0
- package/static/dist/assets/{diagram-S7CK7UJ4-m6aeoe7c.js → diagram-S7CK7UJ4-clv5mxvu.js} +4 -4
- package/static/dist/assets/diagram-UQ7AKVKN-m2ia1mbf.js +41 -0
- package/static/dist/assets/{diagram-VSXAHHWV-hbawi7hn.js → diagram-VSXAHHWV-ea6zv636.js} +1 -1
- package/static/dist/assets/diagram-VX7I27RA-oqlef685.js +24 -0
- package/static/dist/assets/diagram-Z3DM3KII-kjubcbwu.js +24 -0
- package/static/dist/assets/dist-carq1azj.js +44 -0
- package/static/dist/assets/dist-crc46di9.js +7 -0
- package/static/dist/assets/{dist-c4c2m3kv.js → dist-nb670eu6.js} +1 -1
- package/static/dist/assets/ebnfDiagram-PWID7BFC-fg0zri3e.js +1 -0
- package/static/dist/assets/{edge-dvv35byi.js → edge-lrob635n.js} +1 -1
- package/static/dist/assets/{elixir-i2f1ki1g.js → elixir-kdpxeq93.js} +1 -1
- package/static/dist/assets/{elm-cpepyjm4.js → elm-c8irj9uh.js} +1 -1
- package/static/dist/assets/erDiagram-RLTQ6QDP-eb7pmk3x.js +99 -0
- package/static/dist/assets/{erb-idlyfheg.js → erb-flwsv146.js} +1 -1
- package/static/dist/assets/eventmodeling-NTZA5JFV-gvi1fxhn.js +1 -0
- package/static/dist/assets/flowDiagram-HODETNUW-abekab15.js +1 -0
- package/static/dist/assets/folder-plus-ksaons88.js +1 -0
- package/static/dist/assets/{ganttDiagram-EL5Y4UJY-ma6jxj5i.js → ganttDiagram-EL5Y4UJY-jmisowrc.js} +1 -1
- package/static/dist/assets/{git-rebase-d9lpfpbn.js → git-rebase-bli19aoq.js} +1 -1
- package/static/dist/assets/gitGraph-4MIJSDKK-m7kt3u6e.js +1 -0
- package/static/dist/assets/{gitGraphDiagram-WWUBYQGX-hzltvsod.js → gitGraphDiagram-WWUBYQGX-nq7vfzh2.js} +1 -1
- package/static/dist/assets/{glimmer-js-39i0urfb.js → glimmer-js-d4icg38p.js} +1 -1
- package/static/dist/assets/{glimmer-ts-gdtd6n73.js → glimmer-ts-bk75772u.js} +1 -1
- package/static/dist/assets/{glsl-o1djm5pp.js → glsl-lqormp2b.js} +1 -1
- package/static/dist/assets/{graphql-kj6rz55t.js → graphql-hw6s5qzd.js} +1 -1
- package/static/dist/assets/{hack-pe1qqr2i.js → hack-ozrv6l4d.js} +1 -1
- package/static/dist/assets/{haml-cknnbcqs.js → haml-gytfosdt.js} +1 -1
- package/static/dist/assets/{handlebars-hwq64orh.js → handlebars-b6g7jffd.js} +1 -1
- package/static/dist/assets/highlighted-body-KPVGNVTW-gcu017ay.js +1 -0
- package/static/dist/assets/host-ipp4e84c.js +1 -0
- package/static/dist/assets/{html-derivative-h2i2pyjc.js → html-derivative-f1tqcroo.js} +1 -1
- package/static/dist/assets/{html-ha05xtvt.js → html-on6oj6yj.js} +1 -1
- package/static/dist/assets/{http-cf94zu27.js → http-odhufsl7.js} +1 -1
- package/static/dist/assets/{hurl-lslax568.js → hurl-mu680336.js} +1 -1
- package/static/dist/assets/index-d6vbxlra.js +13 -0
- package/static/dist/assets/index-ey6qo0zx.css +2 -0
- package/static/dist/assets/info-A6RAGUB7-idazwfqe.js +1 -0
- package/static/dist/assets/infoDiagram-27XIBGKW-bb9jh8gl.js +2 -0
- package/static/dist/assets/{ishikawaDiagram-5VMMS53U-e7bnwq7h.js → ishikawaDiagram-5VMMS53U-nqc132rv.js} +6 -6
- package/static/dist/assets/{java-ndjf2o89.js → java-nxbe8uju.js} +1 -1
- package/static/dist/assets/{javascript-coftlwy3.js → javascript-lz3kxcyz.js} +1 -1
- package/static/dist/assets/{jinja-etei9wy7.js → jinja-l5pk84gt.js} +1 -1
- package/static/dist/assets/{jison-hyekgft1.js → jison-jdutdwyy.js} +1 -1
- package/static/dist/assets/{journeyDiagram-3NMN7TZE-etd1bi6p.js → journeyDiagram-3NMN7TZE-fpvnhy44.js} +1 -1
- package/static/dist/assets/{json-lok0yaho.js → json-dnge4ssf.js} +1 -1
- package/static/dist/assets/{jsx-b64w0nbx.js → jsx-c3lwhkep.js} +1 -1
- package/static/dist/assets/{jsx-runtime-eu92a5pu.js → jsx-runtime-o40ukmjl.js} +1 -1
- package/static/dist/assets/{julia-jxxzz2yn.js → julia-hwd4rrcb.js} +1 -1
- package/static/dist/assets/{just-mc29iw9t.js → just-nka3oxdx.js} +1 -1
- package/static/dist/assets/{kanban-definition-UXKFOSKX-emb1g9dz.js → kanban-definition-UXKFOSKX-ndzqm6fu.js} +28 -28
- package/static/dist/assets/katex-cbdd1ohw.css +1 -0
- package/static/dist/assets/katex-pbij2oo6.js +257 -0
- package/static/dist/assets/{latex-pafa03ft.js → latex-iqmr7e40.js} +1 -1
- package/static/dist/assets/lazyRouteComponent-javud235.js +1 -0
- package/static/dist/assets/{line-h0ojzsvs.js → line-g625e7cj.js} +1 -1
- package/static/dist/assets/linear-jlwrvvy6.js +1 -0
- package/static/dist/assets/link-gfdaho08.js +2 -0
- package/static/dist/assets/{liquid-hz5c2pov.js → liquid-okmk9tbp.js} +1 -1
- package/static/dist/assets/locale-cs-n41hptse.js +5 -0
- package/static/dist/assets/locale-de-k7ht47ew.js +5 -0
- package/static/dist/assets/locale-es-ih078lco.js +5 -0
- package/static/dist/assets/locale-fr-ojabnf41.js +5 -0
- package/static/dist/assets/locale-it-kb96jufy.js +5 -0
- package/static/dist/assets/locale-ja-jpsp3xs1.js +7 -0
- package/static/dist/assets/locale-ko-cpzuy0n7.js +5 -0
- package/static/dist/assets/locale-pl-dbap4leu.js +5 -0
- package/static/dist/assets/locale-pt-nci7w72x.js +5 -0
- package/static/dist/assets/locale-ru-soghe4cs.js +7 -0
- package/static/dist/assets/locale-tr-ks00mu68.js +5 -0
- package/static/dist/assets/locale-vi-ij7twfm6.js +5 -0
- package/static/dist/assets/locale-zh-Hant-feakwr7a.js +5 -0
- package/static/dist/assets/locale-zh-ren0vjyv.js +7 -0
- package/static/dist/assets/login-iv6yq4xf.js +1 -0
- package/static/dist/assets/{lua-leyf8mlb.js → lua-krx4xj5h.js} +1 -1
- package/static/dist/assets/{marko-cn1fzpdv.js → marko-gbvpfehz.js} +1 -1
- package/static/dist/assets/{mdc-huhy88df.js → mdc-c21zlyi5.js} +1 -1
- package/static/dist/assets/mermaid-HWGCJPDP-cwj5cl6k.js +1 -0
- package/static/dist/assets/mermaid-parser.core-plzkuzov.js +7 -0
- package/static/dist/assets/micromark-factory-space-fnmnpi6s.js +1 -0
- package/static/dist/assets/{mindmap-definition-YA3MSWOX-o1vathns.js → mindmap-definition-YA3MSWOX-ojrgs569.js} +28 -28
- package/static/dist/assets/{nginx-e7lvhsmn.js → nginx-f3d68ed4.js} +1 -1
- package/static/dist/assets/{nim-dun5d8mk.js → nim-dw0jcy70.js} +1 -1
- package/static/dist/assets/onboarding-ff4emacu.js +1 -0
- package/static/dist/assets/packet-AYTQ26CC-gyaf9s8h.js +1 -0
- package/static/dist/assets/pegDiagram-XKGWAZYB-bf6xj8mq.js +1 -0
- package/static/dist/assets/{perl-bj3oqtet.js → perl-3c0r45c8.js} +1 -1
- package/static/dist/assets/{php-buzp12r0.js → php-rznhidvp.js} +1 -1
- package/static/dist/assets/pie-WAS4IAKB-f5ymzelo.js +1 -0
- package/static/dist/assets/pieDiagram-E7YTZNPT-d0qjl3zi.js +39 -0
- package/static/dist/assets/{pug-mjad7he9.js → pug-f2le4f3y.js} +1 -1
- package/static/dist/assets/{qml-d1gdp10s.js → qml-e2wbq9cr.js} +1 -1
- package/static/dist/assets/{quadrantDiagram-AXDQQJYC-owqc4uqn.js → quadrantDiagram-AXDQQJYC-oqy1mras.js} +1 -1
- package/static/dist/assets/queryKeys-x8fjxhut.js +9 -0
- package/static/dist/assets/{r-o3r9c7ao.js → r-epfzuw6q.js} +1 -1
- package/static/dist/assets/radar-RG4KPBEZ-b6jcjvda.js +1 -0
- package/static/dist/assets/railroad-74A4TZTK-e3a6lk5k.js +1 -0
- package/static/dist/assets/railroad-abnf-HS5TGJTU-ff5hocrx.js +1 -0
- package/static/dist/assets/railroad-ebnf-LZEXJU2U-exkhyw4n.js +1 -0
- package/static/dist/assets/railroad-peg-WCYAUIDC-jefk9b7c.js +1 -0
- package/static/dist/assets/railroadDiagram-O6MQD6OU-e4amks1i.js +1 -0
- package/static/dist/assets/{razor-ilc585yr.js → razor-pea1u1d0.js} +1 -1
- package/static/dist/assets/refresh-cw-lfp4u1oh.js +1 -0
- package/static/dist/assets/{regexp-mpjtcvwm.js → regexp-hzte0a5x.js} +1 -1
- package/static/dist/assets/registry-g7w3353u.js +1 -0
- package/static/dist/assets/requirementDiagram-BXWQKSXE-c77k1e2y.js +84 -0
- package/static/dist/assets/rolldown-runtime-bnnw9q4a.js +1 -0
- package/static/dist/assets/{rst-jrkwjdyi.js → rst-m6tugj5o.js} +1 -1
- package/static/dist/assets/{ruby-n4tjcbpz.js → ruby-l19vq3w1.js} +1 -1
- package/static/dist/assets/runtime-nlxpnegr.js +1 -0
- package/static/dist/assets/{sankeyDiagram-P5KCCOFB-iqc02emv.js → sankeyDiagram-P5KCCOFB-oa1cc52s.js} +1 -1
- package/static/dist/assets/{sas-hjo6y93k.js → sas-ktdxo397.js} +1 -1
- package/static/dist/assets/{scss-ncidjv48.js → scss-kn3oxfwf.js} +1 -1
- package/static/dist/assets/{sequenceDiagram-WJ2MYXX4-i0v116q0.js → sequenceDiagram-WJ2MYXX4-j20gqt22.js} +11 -11
- package/static/dist/assets/settings_section_extensions_title-fadc7o65.js +1 -0
- package/static/dist/assets/share._token-kmfoflw6.js +2 -0
- package/static/dist/assets/{shellscript-m8whjpqd.js → shellscript-l100jtrg.js} +1 -1
- package/static/dist/assets/{shellsession-i5bj6syz.js → shellsession-m5qukwow.js} +1 -1
- package/static/dist/assets/sizeCapture-INFHLROL-dk1io13w.js +1 -0
- package/static/dist/assets/sliders-horizontal-g5jkzd9k.js +1 -0
- package/static/dist/assets/{soy-hhh36ysq.js → soy-mexlscur.js} +1 -1
- package/static/dist/assets/{sql-j21bzcl6.js → sql-o0ho5suh.js} +1 -1
- package/static/dist/assets/src-h89s0hs4.js +1 -0
- package/static/dist/assets/{stata-bbu2onh1.js → stata-be9ck1q3.js} +1 -1
- package/static/dist/assets/stateDiagram-D77RDMKH-co2ghkdp.js +1 -0
- package/static/dist/assets/stateDiagram-v2-MP3YSRHH-faw1opgh.js +1 -0
- package/static/dist/assets/{surrealql-l5vczuco.js → surrealql-gk1xkkyy.js} +1 -1
- package/static/dist/assets/{svelte-idn422g6.js → svelte-k6ecjilf.js} +1 -1
- package/static/dist/assets/swimlanes-42K2YHIH-m30cktqe.js +1 -0
- package/static/dist/assets/swimlanesDiagram-VR7AAH4N-hfil433g.js +8 -0
- package/static/dist/assets/{templ-e22qou3c.js → templ-gf3bftk6.js} +1 -1
- package/static/dist/assets/{tex-deqpc5ee.js → tex-d21fqv1z.js} +1 -1
- package/static/dist/assets/{timeline-definition-24CTP7MA-ol2hnvma.js → timeline-definition-24CTP7MA-liuep6fl.js} +8 -8
- package/static/dist/assets/toast-zmb35u3r.js +56 -0
- package/static/dist/assets/treeView-Q6P3EWNA-np5d2jv2.js +1 -0
- package/static/dist/assets/treemap-WGGIJYW6-cmpltxh1.js +1 -0
- package/static/dist/assets/{ts-tags-ctnibc27.js → ts-tags-n0g61gr6.js} +1 -1
- package/static/dist/assets/{tsx-i163n32g.js → tsx-cvv7wv6q.js} +1 -1
- package/static/dist/assets/{twig-x0fi7wm8.js → twig-n1f67204.js} +1 -1
- package/static/dist/assets/{typescript-g18c34xz.js → typescript-og7o55cx.js} +1 -1
- package/static/dist/assets/untitled-mj86r4gz.js +1 -0
- package/static/dist/assets/useDebounced-g8r0ggve.js +1 -0
- package/static/dist/assets/useForm-f1udzsjf.js +1 -0
- package/static/dist/assets/{useParams-gjc70qru.js → useParams-ierevvts.js} +1 -1
- package/static/dist/assets/{useSearch-e6ae539u.js → useSearch-i7nr9ypl.js} +1 -1
- package/static/dist/assets/vennDiagram-4TSXK5OY-b2g42qrg.js +34 -0
- package/static/dist/assets/{vue-mwu5l1bb.js → vue-ej4xpwqw.js} +1 -1
- package/static/dist/assets/{vue-html-nskj3du0.js → vue-html-d48xsjuo.js} +1 -1
- package/static/dist/assets/{vue-vine-cqe77smq.js → vue-vine-pev88ip6.js} +1 -1
- package/static/dist/assets/wardley-WFR3VGLG-lb0eqbff.js +1 -0
- package/static/dist/assets/wardleyDiagram-VM6X3IG4-ermwaqha.js +78 -0
- package/static/dist/assets/with-selector-nu1b5z0v.js +1 -0
- package/static/dist/assets/{xml-gau7gvrv.js → xml-ifxp6gqb.js} +1 -1
- package/static/dist/assets/{xsl-ew09zq8b.js → xsl-fug2cckc.js} +1 -1
- package/static/dist/assets/{xychartDiagram-S5SC5T6Z-aqbgvujg.js → xychartDiagram-S5SC5T6Z-dll0jldk.js} +6 -6
- package/static/dist/assets/{yaml-ofnrxtvf.js → yaml-fjmafnlo.js} +1 -1
- package/static/dist/extension-sdk.js +1 -1
- package/static/dist/index.html +1 -1
- package/static/dist/sw.js +180 -136
- package/static/dist/assets/AppShell-cey33v9s.js +0 -8
- package/static/dist/assets/ChatPage-i8wnugr7.js +0 -18
- package/static/dist/assets/ConnectTargets-hg19553x.js +0 -1
- package/static/dist/assets/ExtensionRoute-cly4apm5.js +0 -1
- package/static/dist/assets/Field-j8uqoigz.js +0 -9
- package/static/dist/assets/HubRoute-e4bgz41j.js +0 -2
- package/static/dist/assets/Markdown-lahuichm.js +0 -598
- package/static/dist/assets/Markdown-lwviulmg.css +0 -1
- package/static/dist/assets/RightPanel-lbo4i0fn.js +0 -1
- package/static/dist/assets/Select-gqatm2e0.js +0 -1
- package/static/dist/assets/SessionListPanel-mfqayfjh.js +0 -1
- package/static/dist/assets/SettingsLayout-b8980u7k.js +0 -1
- package/static/dist/assets/States-e7dkgtxf.js +0 -1
- package/static/dist/assets/Toaster-bfqqy786.js +0 -1
- package/static/dist/assets/_app-n1n6pfx1.js +0 -1
- package/static/dist/assets/_app.ext._extensionId-buxjxav3.js +0 -1
- package/static/dist/assets/_app.index-jt8zwiu2.js +0 -1
- package/static/dist/assets/_app.insights-cv76ml71.js +0 -1
- package/static/dist/assets/_app.kanban-h6ts53j7.js +0 -1
- package/static/dist/assets/_app.logs-dm873z90.js +0 -1
- package/static/dist/assets/_app.memory-glk5y6m8.js +0 -1
- package/static/dist/assets/_app.profiles-ka6zpstq.js +0 -1
- package/static/dist/assets/_app.session._sessionId-g2vzghvc.js +0 -1
- package/static/dist/assets/_app.settings-hgjdhzcd.js +0 -1
- package/static/dist/assets/_app.settings._section-jf2kmhae.js +0 -3
- package/static/dist/assets/_app.skills-cii852yq.js +0 -1
- package/static/dist/assets/_app.tasks-fp9q7atm.js +0 -1
- package/static/dist/assets/_app.todos-dw94qzue.js +0 -1
- package/static/dist/assets/_app.workspaces-inyygzze.js +0 -1
- package/static/dist/assets/abnfDiagram-VCTEODGH-gjayq3ra.js +0 -1
- package/static/dist/assets/architecture-7GRP2DOG-lp56972r.js +0 -1
- package/static/dist/assets/architectureDiagram-5GKGNRK7-nwb3xovn.js +0 -36
- package/static/dist/assets/archive-b1j004vn.js +0 -1
- package/static/dist/assets/back-g74gkozu.js +0 -1
- package/static/dist/assets/channel-es95o4y8.js +0 -1
- package/static/dist/assets/chunk-DU6HZSFF-gpedttsp.js +0 -128
- package/static/dist/assets/chunk-OSK3NFVY-oy0gwn2n.js +0 -10
- package/static/dist/assets/classDiagram-ZZMXUADV-kmihoqxh.js +0 -1
- package/static/dist/assets/classDiagram-v2-VYDZK3BY-kmihoqxh.js +0 -1
- package/static/dist/assets/copied-bli9tbcx.js +0 -1
- package/static/dist/assets/copy-jamtd1pf.js +0 -1
- package/static/dist/assets/cose-bilkent-JH36ORCC-eclcy6ja.js +0 -1
- package/static/dist/assets/cynefin-OW5HDTMX-f8xfdd3f.js +0 -1
- package/static/dist/assets/cynefinDiagram-5FMLGOSQ-n9lb99h9.js +0 -62
- package/static/dist/assets/cytoscape.esm-bqu53u12.js +0 -321
- package/static/dist/assets/dagre-GXQ25YYZ-dgailddi.js +0 -4
- package/static/dist/assets/dagre-lkoknbjn.js +0 -1
- package/static/dist/assets/diagram-UQ7AKVKN-jall3j0x.js +0 -41
- package/static/dist/assets/diagram-VX7I27RA-hendl2tt.js +0 -24
- package/static/dist/assets/diagram-Z3DM3KII-igwc35p3.js +0 -24
- package/static/dist/assets/ebnfDiagram-PWID7BFC-c64knz08.js +0 -1
- package/static/dist/assets/erDiagram-RLTQ6QDP-brdu9lcm.js +0 -99
- package/static/dist/assets/eventmodeling-NTZA5JFV-njk1j8wl.js +0 -1
- package/static/dist/assets/flowDiagram-HODETNUW-nma6f0ga.js +0 -1
- package/static/dist/assets/folder-plus-lvt9kudb.js +0 -1
- package/static/dist/assets/gitGraph-4MIJSDKK-naa9w6xa.js +0 -1
- package/static/dist/assets/highlighted-body-KPVGNVTW-ghoavj8d.js +0 -1
- package/static/dist/assets/host-hzm8n85n.js +0 -1
- package/static/dist/assets/index-drdcaqeq.css +0 -2
- package/static/dist/assets/index-jzm844he.js +0 -11
- package/static/dist/assets/info-A6RAGUB7-mn2ut5ko.js +0 -1
- package/static/dist/assets/infoDiagram-27XIBGKW-h6kuqvsb.js +0 -2
- package/static/dist/assets/lazyRouteComponent-o816ytzl.js +0 -1
- package/static/dist/assets/linear-becwlnhk.js +0 -1
- package/static/dist/assets/link-k01ryaf9.js +0 -1
- package/static/dist/assets/login-bsae49ew.js +0 -1
- package/static/dist/assets/mermaid-HWGCJPDP-ihl34s74.js +0 -1
- package/static/dist/assets/mermaid-parser.core-bnre27u8.js +0 -7
- package/static/dist/assets/not-found-ccnnac39.js +0 -1
- package/static/dist/assets/onboarding-c65tysya.js +0 -1
- package/static/dist/assets/onboarding_model_label-gpn28uix.js +0 -1
- package/static/dist/assets/packet-AYTQ26CC-hatq7m2e.js +0 -1
- package/static/dist/assets/pegDiagram-XKGWAZYB-gwisz8jv.js +0 -1
- package/static/dist/assets/pie-WAS4IAKB-fpftf0mk.js +0 -1
- package/static/dist/assets/pieDiagram-E7YTZNPT-khm1o9a6.js +0 -39
- package/static/dist/assets/radar-RG4KPBEZ-cntfwjpq.js +0 -1
- package/static/dist/assets/railroad-74A4TZTK-a7t5eibp.js +0 -1
- package/static/dist/assets/railroad-abnf-HS5TGJTU-ol8cdktf.js +0 -1
- package/static/dist/assets/railroad-ebnf-LZEXJU2U-i8vzd429.js +0 -1
- package/static/dist/assets/railroad-peg-WCYAUIDC-nw3ulewz.js +0 -1
- package/static/dist/assets/railroadDiagram-O6MQD6OU-etuh0qa0.js +0 -1
- package/static/dist/assets/refresh-cw-mqbkv2a3.js +0 -1
- package/static/dist/assets/refresh-l29ljp76.js +0 -1
- package/static/dist/assets/requirementDiagram-BXWQKSXE-oq2ulk22.js +0 -84
- package/static/dist/assets/rolldown-runtime-b9miacsj.js +0 -1
- package/static/dist/assets/root-mbklpuv4.js +0 -1
- package/static/dist/assets/saved-ndd4t2xb.js +0 -1
- package/static/dist/assets/settings_section_extensions_title-jhfo6o8z.js +0 -1
- package/static/dist/assets/share._token-c1ri0hy1.js +0 -2
- package/static/dist/assets/sizeCapture-INFHLROL-g612l48j.js +0 -1
- package/static/dist/assets/sliders-horizontal-j3jjt9tv.js +0 -1
- package/static/dist/assets/src-hjyib4mu.js +0 -1
- package/static/dist/assets/stateDiagram-D77RDMKH-dnpt1ato.js +0 -1
- package/static/dist/assets/stateDiagram-v2-MP3YSRHH-bxjacpk6.js +0 -1
- package/static/dist/assets/swimlanes-42K2YHIH-loqbdazb.js +0 -1
- package/static/dist/assets/swimlanesDiagram-VR7AAH4N-id62p9hz.js +0 -8
- package/static/dist/assets/toast-i3h34v6o.js +0 -64
- package/static/dist/assets/treeView-Q6P3EWNA-idrj6iox.js +0 -1
- package/static/dist/assets/treemap-WGGIJYW6-lzr49vv5.js +0 -1
- package/static/dist/assets/untitled-oaoya4qj.js +0 -1
- package/static/dist/assets/useForm-nfaxgmsk.js +0 -1
- package/static/dist/assets/vennDiagram-4TSXK5OY-bvwr9o2z.js +0 -34
- package/static/dist/assets/wardley-WFR3VGLG-31ui8tma.js +0 -1
- package/static/dist/assets/wardleyDiagram-VM6X3IG4-k5wqtx4b.js +0 -78
- /package/static/dist/assets/{ChatPage-gmu5c7lf.css → TerminalPanel-gmu5c7lf.css} +0 -0
package/dist/sessions/turn.js
CHANGED
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
* (Python `api/routes.py::_start_chat_stream_for_session`,
|
|
6
6
|
* `api/streaming.py::_run_agent_streaming`, `cancel_stream`).
|
|
7
7
|
*/
|
|
8
|
+
import { StartupTiming, timingOutcome } from '../startup-timing.js';
|
|
8
9
|
import { randomUUID } from 'node:crypto';
|
|
9
10
|
import { closeSync, fstatSync, readFileSync } from 'node:fs';
|
|
10
11
|
import { openAnchoredFd } from '../workspace/fs.js';
|
|
@@ -12,33 +13,33 @@ import { isWithin, resolvePathLikePython } from '../workspace/paths.js';
|
|
|
12
13
|
import { runtimeFailureDetails, SidecarError } from '../sidecar/client.js';
|
|
13
14
|
import { HttpFailure, markSessionTitleGenerated } from './service.js';
|
|
14
15
|
import { StreamRegistry, SessionChannels } from './streams.js';
|
|
15
|
-
import { ChatUsageSchema, ConnectorOperationSnapshotSchema } from '@maudecode/talaria-web-contracts';
|
|
16
|
+
import { TRANSCRIPT_WINDOW, ChatUsageSchema, ConnectorOperationSnapshotSchema } from '@maudecode/talaria-web-contracts';
|
|
17
|
+
import { toolProgress } from './tool-display.js';
|
|
16
18
|
import { catalogNames, connectorOperation } from '../tools/connectors.js';
|
|
17
19
|
import { PendingPrompts, clarifyReply, isVaultPrompt, vaultReply } from './pending.js';
|
|
18
20
|
import { COMPRESSION_RECOVERY_ACTION_START_FOCUSED, COMPRESSION_RECOVERY_TERMINAL_STATE, CONTEXT_USAGE_FIELDS, Session, contextUsage, forgetContextFigures, titleFrom } from './session.js';
|
|
19
|
-
import { anchorMessageKey,
|
|
20
|
-
import { buildActiveTurnToken, completedToolIndex, publicToolFrame, redactNestedMessageContainers,
|
|
21
|
+
import { anchorMessageKey, markerSummary, visibleMessagesForAnchor } from './compress.js';
|
|
22
|
+
import { buildActiveTurnToken, completedToolIndex, publicToolFrame, redactNestedMessageContainers, redactString, withToolId } from '../redact.js';
|
|
21
23
|
import { dict, findPersonality } from '../config/agent-config.js';
|
|
22
24
|
import { ReasoningTitleTracker, reasoningEventPayload } from './reasoning-titles.js';
|
|
23
|
-
import {
|
|
24
|
-
import { UNSETTLED_TODO_KEY, attachTodoState, parseTodoToolResult } from './todo.js';
|
|
25
|
+
import { UNSETTLED_TODO_KEY, parseTodoToolResult } from './todo.js';
|
|
25
26
|
import { SessionNotices } from './notices.js';
|
|
26
27
|
import { SessionGoals } from './goals.js';
|
|
27
|
-
import {
|
|
28
|
+
import { turnTerminalState } from './anchor.js';
|
|
28
29
|
import { persistentStateChanges, persistentStateSnapshot } from './state-saved.js';
|
|
29
30
|
import { agentBuildParams, webuiEphemeralSystemPrompt, workspaceSystemMessage } from './turn-context.js';
|
|
30
|
-
import { agentSteerText, assistantReplyAddedAfterCurrentTurn, attachedFilesPrompt, buildPartialMessage, dedupeContext, checkpointTurnStart, extractToolCallsFromMessages, hasNativeImages, injectMaxIterationSummaryFallback, isDict, mergeDisplayMessagesAfterAgentResult, messageIdentity, messageText, pendingUserRow, sanitizeMessagesForApi, sessionLacksFinalAssistantAnswer, splitDisplayText, stateDbSeenId, joinReasoning, reasoningFieldsText, toolOutcome,
|
|
31
|
+
import { agentSteerText, assistantReplyAddedAfterCurrentTurn, attachedFilesPrompt, buildPartialMessage, dedupeContext, checkpointTurnStart, extractToolCallsFromMessages, hasNativeImages, injectMaxIterationSummaryFallback, isDict, mergeDisplayMessagesAfterAgentResult, messageIdentity, messageText, pendingUserRow, sanitizeMessagesForApi, withDataUseRequirements, sessionLacksFinalAssistantAnswer, splitDisplayText, stateDbSeenId, joinReasoning, reasoningFieldsText, toolOutcome, withoutMaxIterationSummaryRequest, withNativeImagesRestored, withoutNativeImages, withoutToolImages } from './merge.js';
|
|
31
32
|
import { mayBecomeSilentReply, turnOrigin, recordBackgroundReview, recordBackgroundUpdate } from './background-updates.js';
|
|
32
33
|
import { countExchanges, fallbackTitleFromExchange, firstExchangeSnippets, isGenericFallbackTitle, latestExchangeSnippets, looksInvalidGeneratedTitle, looksLikeDefaultCliTitle, sanitizeGeneratedTitle, titleLanguageMismatch, titlePrompts } from './titles.js';
|
|
33
34
|
import { WORKSPACE_BUSY_MESSAGE } from '../workspace/git.js';
|
|
34
35
|
import { CHECKPOINT_STORE_BUSY_MESSAGE } from '../workspace/rollback.js';
|
|
35
36
|
import { str } from '../util.js';
|
|
36
37
|
import { toolEditDiff } from './tool-display.js';
|
|
38
|
+
import { startsBackgroundWork } from './background-tasks.js';
|
|
37
39
|
import { recordWakeupPause } from './wakeup-pause.js';
|
|
38
40
|
import { displayName } from '../providers/catalog.js';
|
|
39
41
|
export const CHAT_LOCK_WAIT_SECONDS = 2;
|
|
40
42
|
const IMAGE_MODE_TIMEOUT_MS = 15_000;
|
|
41
|
-
const TERMINAL_SSE_VISIBLE_MESSAGE_LIMIT = 80;
|
|
42
43
|
/** TAL-397: streamed text reports the live meter at most this often (seconds); a counter change reports at once. */
|
|
43
44
|
const METERING_INTERVAL_S = 1;
|
|
44
45
|
/** The Agent's content frames, which end a rate-limit wait (TAL-821) and a compression span (TAL-1006). A terminal frame ends the run, its wait, and its span. */
|
|
@@ -227,6 +228,7 @@ export class TurnRunner {
|
|
|
227
228
|
/**
|
|
228
229
|
* TAL-364: what a Stop needs to write the turn's model context: its starting context, the prompt the Agent got, and
|
|
229
230
|
* whether a settlement already used a canonical checkpoint (which marks the stop boundary; later work never replaces it).
|
|
231
|
+
* TAL-1162: `startReadPending` while the turn's starting state.db read is still in flight.
|
|
230
232
|
*/
|
|
231
233
|
/** TAL-364: a Stop's in-flight `chat.interrupt` reply (null when it failed), so a worker that settles first can use its checkpoint. */
|
|
232
234
|
interrupts = new Map();
|
|
@@ -344,6 +346,25 @@ export class TurnRunner {
|
|
|
344
346
|
}
|
|
345
347
|
/** Python `_start_chat_stream_for_session`: persist pending state, register the channel, launch the worker. */
|
|
346
348
|
async admit(session, opts, releaseStopHold = false) {
|
|
349
|
+
const timing = opts.timing ?? new StartupTiming(this.deps.log);
|
|
350
|
+
timing.identify(session.session_id);
|
|
351
|
+
timing.begin('admission');
|
|
352
|
+
try {
|
|
353
|
+
const response = await this.admitTimed(session, { ...opts, timing }, releaseStopHold);
|
|
354
|
+
if (response._status !== undefined)
|
|
355
|
+
timing.finish('refused');
|
|
356
|
+
else if (!response.stream_id || !this.workers.has(response.stream_id))
|
|
357
|
+
timing.finish('noop');
|
|
358
|
+
return response;
|
|
359
|
+
}
|
|
360
|
+
catch (error) {
|
|
361
|
+
timing.finish(timingOutcome(error));
|
|
362
|
+
throw error;
|
|
363
|
+
}
|
|
364
|
+
}
|
|
365
|
+
async admitTimed(session, opts, releaseStopHold) {
|
|
366
|
+
const timing = opts.timing;
|
|
367
|
+
const closeChecks = timing.begin('admission_checks');
|
|
347
368
|
const s = session;
|
|
348
369
|
const readOnly = (await this.deps.service().readOnlyReason(s));
|
|
349
370
|
if (readOnly)
|
|
@@ -371,9 +392,14 @@ export class TurnRunner {
|
|
|
371
392
|
}
|
|
372
393
|
const accepted = isDict(s.extra.completion_acceptances) ? s.extra.completion_acceptances : {};
|
|
373
394
|
if (opts.completionKeys?.length && opts.completionKeys.every((key) => typeof accepted[key] === 'string' && accepted[key])) {
|
|
395
|
+
timing.identify(s.session_id, str(accepted[opts.completionKeys[0]]));
|
|
396
|
+
timing.finish('noop');
|
|
374
397
|
return { stream_id: str(accepted[opts.completionKeys[0]]), session_id: s.session_id };
|
|
375
398
|
}
|
|
399
|
+
opts.admissionCheck?.(s);
|
|
400
|
+
closeChecks();
|
|
376
401
|
const streamId = randomUUID().replace(/-/g, '');
|
|
402
|
+
timing.identify(s.session_id, streamId);
|
|
377
403
|
const wasHiddenEmpty = !s.messages.length && !s.context_messages.length && !s.hasPendingPrompt;
|
|
378
404
|
const attachments = opts.attachments ?? [];
|
|
379
405
|
// A background wakeup stays one in a forked session too (TAL-460).
|
|
@@ -384,6 +410,9 @@ export class TurnRunner {
|
|
|
384
410
|
const compactionDue = !opts.ephemeral && sameRuntime && this.deps.service().compactionDue(s);
|
|
385
411
|
if (!sameRuntime)
|
|
386
412
|
forgetContextFigures(s);
|
|
413
|
+
const notificationOwner = this.deps.notificationOwner();
|
|
414
|
+
if (notificationOwner)
|
|
415
|
+
s.extra.notification_owner = notificationOwner;
|
|
387
416
|
s.workspace = opts.workspace;
|
|
388
417
|
s.model = opts.model;
|
|
389
418
|
s.model_provider = opts.modelProvider;
|
|
@@ -415,10 +444,10 @@ export class TurnRunner {
|
|
|
415
444
|
const previousUpdates = s.extra.background_updates;
|
|
416
445
|
if (opts.backgroundUpdate)
|
|
417
446
|
recordBackgroundUpdate(s, streamId, opts.backgroundUpdate);
|
|
418
|
-
const admission = { stream_id: streamId, session_id: s.session_id, started_at: this.deps.now(), phase: 'starting', workspace: opts.workspace, model: opts.model, provider: opts.modelProvider, ephemeral: Boolean(opts.ephemeral), origin: turnOrigin(source), admitting: true };
|
|
447
|
+
const admission = { stream_id: streamId, session_id: s.session_id, started_at: this.deps.now(), phase: 'starting', workspace: opts.workspace, model: opts.model, provider: opts.modelProvider, ephemeral: Boolean(opts.ephemeral), ...(opts.activityParentSessionId ? { activity_parent_session_id: opts.activityParentSessionId } : {}), origin: turnOrigin(source), admitting: true };
|
|
419
448
|
this.registry.registerActiveRun(admission);
|
|
420
449
|
try {
|
|
421
|
-
|
|
450
|
+
await timing.measure('admission_persistence', () => this.deps.store.save(s));
|
|
422
451
|
}
|
|
423
452
|
catch (error) {
|
|
424
453
|
this.registry.activeRuns.delete(streamId);
|
|
@@ -431,16 +460,22 @@ export class TurnRunner {
|
|
|
431
460
|
// A new chat appears in the list; every turn tells open clients a run started (TAL-434).
|
|
432
461
|
this.deps.events.publish(wasHiddenEmpty ? 'session_new' : 'turn_started', { profile: s.profile, sessionId: s.session_id });
|
|
433
462
|
try {
|
|
434
|
-
|
|
463
|
+
this.deps.onTurnStart?.(s.session_id);
|
|
464
|
+
}
|
|
465
|
+
catch { /* best effort */ }
|
|
466
|
+
try {
|
|
467
|
+
await timing.measure('workspace_persistence', () => this.deps.workspaces.setLastWorkspace(opts.workspace, s.profile));
|
|
435
468
|
}
|
|
436
469
|
catch { /* best effort */ }
|
|
437
470
|
const channel = this.registry.create(streamId, s.session_id);
|
|
438
471
|
admission.admitting = false;
|
|
439
472
|
if (opts.goalRelated)
|
|
440
473
|
this.registry.goalRelated.add(streamId);
|
|
474
|
+
timing.end('admission');
|
|
441
475
|
const worker = this.run(s.session_id, streamId, channel, opts, compactionDue).catch((error) => {
|
|
476
|
+
timing.finish(timingOutcome(error));
|
|
442
477
|
this.deps.log(`[webui] ERROR turn ${streamId} crashed\n${error instanceof Error ? (error.stack ?? error.message) : String(error)}`);
|
|
443
|
-
}).finally(() => { this.workers.delete(streamId); });
|
|
478
|
+
}).finally(() => { timing.finish(this.registry.cancelled.has(streamId) ? 'cancelled' : undefined); this.workers.delete(streamId); });
|
|
444
479
|
this.workers.set(streamId, worker);
|
|
445
480
|
const response = { stream_id: streamId, session_id: s.session_id, pending_started_at: s.pending_started_at, turn_id: streamId, title: s.title };
|
|
446
481
|
if (opts.normalizedModel && opts.model)
|
|
@@ -463,6 +498,8 @@ export class TurnRunner {
|
|
|
463
498
|
// ── worker ───────────────────────────────────────────────────────────────
|
|
464
499
|
async run(sessionId, streamId, channel, opts, compactionDue) {
|
|
465
500
|
const { deps } = this;
|
|
501
|
+
const timing = opts.timing;
|
|
502
|
+
const closePreparation = timing?.begin('worker_preparation');
|
|
466
503
|
let writer = null;
|
|
467
504
|
try {
|
|
468
505
|
writer = (await deps.journal.writer(sessionId, streamId));
|
|
@@ -485,8 +522,11 @@ export class TurnRunner {
|
|
|
485
522
|
if (this.registry.cancelled.has(streamId) && !['cancel', 'apperror', 'steer_consumed', 'steer_withdrawn', 'run_status'].includes(event))
|
|
486
523
|
return;
|
|
487
524
|
const terminal = ['done', 'cancel', 'apperror', 'error', 'stream_end'].includes(event);
|
|
488
|
-
if (terminal)
|
|
525
|
+
if (terminal) {
|
|
489
526
|
statusEnded = true;
|
|
527
|
+
for (const call of this.registry.liveToolCalls.get(streamId) ?? [])
|
|
528
|
+
delete call.progress;
|
|
529
|
+
}
|
|
490
530
|
if (CONTENT_EVENTS.has(event) || terminal)
|
|
491
531
|
providerPhase = null;
|
|
492
532
|
if (event === 'rate_limit_wait')
|
|
@@ -527,6 +567,7 @@ export class TurnRunner {
|
|
|
527
567
|
return;
|
|
528
568
|
// `cancel()` already wrote the terminal row and closed the stream: the worker's unwind adds no second one.
|
|
529
569
|
if (event === 'cancel' && !this.registry.streams.has(streamId)) {
|
|
570
|
+
timing?.frame(event, data);
|
|
530
571
|
try {
|
|
531
572
|
deps.onTerminal?.(streamId, 'cancelled');
|
|
532
573
|
}
|
|
@@ -534,7 +575,7 @@ export class TurnRunner {
|
|
|
534
575
|
return;
|
|
535
576
|
}
|
|
536
577
|
let eventId = null;
|
|
537
|
-
if (writer) {
|
|
578
|
+
if (writer && event !== 'tool_progress') {
|
|
538
579
|
try {
|
|
539
580
|
eventId = (await writer.appendSseEvent(event, data, meta)).event_id;
|
|
540
581
|
}
|
|
@@ -544,6 +585,7 @@ export class TurnRunner {
|
|
|
544
585
|
}
|
|
545
586
|
}
|
|
546
587
|
channel.put([event, data, eventId, meta.redacted]);
|
|
588
|
+
timing?.frame(event, data);
|
|
547
589
|
if (event === 'done' || event === 'cancel' || event === 'apperror' || event === 'error') {
|
|
548
590
|
// Relay's phase follows the turn outcome, so a background Live Activity ends as the app would end it.
|
|
549
591
|
const state = str(data.terminal_state);
|
|
@@ -565,24 +607,27 @@ export class TurnRunner {
|
|
|
565
607
|
await this.teardown(sessionId, streamId);
|
|
566
608
|
return;
|
|
567
609
|
}
|
|
610
|
+
const notificationScope = { owner: str(s.extra.notification_owner) || 'local-owner', profile: s.profile ?? 'default' };
|
|
568
611
|
const msgText = opts.msg;
|
|
569
|
-
const history = () => {
|
|
612
|
+
const history = async () => {
|
|
570
613
|
// TAL-493: one state.db read builds the history and marks where this turn's own rows begin.
|
|
571
|
-
const
|
|
614
|
+
const reading = deps.service().beginStateDbTurn(s);
|
|
615
|
+
// TAL-1162: the read runs on the state.db worker. Until it lands, a Stop settles from the local history with no
|
|
616
|
+
// starting id, as a turn whose starting read failed does.
|
|
617
|
+
const local = this.turnHistory(s, streamId, []);
|
|
618
|
+
this.stopContexts.set(streamId, { previousContext: local.previousContext, historyLength: local.apiHistory.length, prompt: msgText, msgText, checkpointed: false, stateDbStartId: null, stateDbStartGeneration: null, startReadPending: true });
|
|
619
|
+
const startRead = await reading;
|
|
572
620
|
const previousMessages = structuredClone(s.messages);
|
|
573
|
-
|
|
574
|
-
//
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
// the Agent gets back the exact bytes it sent (TAL-541).
|
|
578
|
-
const apiHistory = sanitizeMessagesForApi(previousContext, { preserveApiContent: true, issuedReasoningSince: s.reasoning_replay_from });
|
|
579
|
-
this.stopContexts.set(streamId, { previousContext, historyLength: apiHistory.length, prompt: msgText, msgText, checkpointed: false, stateDbStartId: startRead.ok ? stateDbSeenId(startRead.rows) ?? 0 : null, stateDbStartGeneration: startRead.generation });
|
|
621
|
+
const { previousContext, apiHistory } = this.turnHistory(s, streamId, startRead.rows);
|
|
622
|
+
// A Stop that landed during the read already took the local entry.
|
|
623
|
+
if (!this.registry.cancelled.has(streamId))
|
|
624
|
+
this.stopContexts.set(streamId, { previousContext, historyLength: apiHistory.length, prompt: msgText, msgText, checkpointed: false, stateDbStartId: startRead.ok ? stateDbSeenId(startRead.rows) ?? 0 : null, stateDbStartGeneration: startRead.generation, startReadPending: false });
|
|
580
625
|
return { previousMessages, previousContext, apiHistory };
|
|
581
626
|
};
|
|
582
627
|
// Before the first await: a Stop can land at any point after admission.
|
|
583
|
-
let { previousMessages, previousContext, apiHistory } = history();
|
|
584
628
|
const controller = new AbortController();
|
|
585
629
|
this.abortControllers.set(streamId, controller);
|
|
630
|
+
let { previousMessages, previousContext, apiHistory } = await history();
|
|
586
631
|
// TAL-1005: an over-threshold session compacts in its joinable compression job before the turn reads its history, so
|
|
587
632
|
// a Stop ends only this wait and a resend joins the same job. The turn then reads the compacted session afresh.
|
|
588
633
|
const compacted = await deps.service().ensureCompacted(sessionId, { turn: streamId, signal: controller.signal, due: compactionDue, onWait: async () => { (await put('compressing', { session_id: sessionId, message: 'Compressing context' })); } });
|
|
@@ -592,7 +637,7 @@ export class TurnRunner {
|
|
|
592
637
|
}
|
|
593
638
|
catch { /* the cancel or error path below reports a deleted session */ }
|
|
594
639
|
;
|
|
595
|
-
({ previousMessages, previousContext, apiHistory } = history());
|
|
640
|
+
({ previousMessages, previousContext, apiHistory } = await history());
|
|
596
641
|
await put('compressed', this.compressedFrame(s));
|
|
597
642
|
}
|
|
598
643
|
const activeTurnToken = buildActiveTurnToken(streamId, s.pending_started_at);
|
|
@@ -674,7 +719,7 @@ export class TurnRunner {
|
|
|
674
719
|
// start an Agent turn (the client also refuses an already-aborted signal outright).
|
|
675
720
|
if (this.registry.cancelled.has(streamId)) {
|
|
676
721
|
await this.finalizeCancelled(s, streamId, opts.ephemeral);
|
|
677
|
-
await put('cancel', (await this.cancelFrame(sessionId)));
|
|
722
|
+
await put('cancel', (await this.cancelFrame(sessionId, streamId)));
|
|
678
723
|
return;
|
|
679
724
|
}
|
|
680
725
|
const turnContext = {
|
|
@@ -684,10 +729,13 @@ export class TurnRunner {
|
|
|
684
729
|
};
|
|
685
730
|
// Python `_public_prefill_context_status`: the session-recall prefill hook was dropped with TAL-245, so the
|
|
686
731
|
// context frame always reports the not-configured shape.
|
|
687
|
-
const
|
|
732
|
+
const persistentHome = deps.profileHome(s.profile);
|
|
733
|
+
const persistentBefore = await persistentStateSnapshot(persistentHome);
|
|
688
734
|
await put('context_status', { session_id: sessionId, prefill: { status: 'not_configured', source: 'none', label: '', message_count: 0 } });
|
|
689
|
-
// Setup awaits can outlive a gateway adoption
|
|
690
|
-
deps.service().assertWritable(s);
|
|
735
|
+
// Setup awaits can outlive a gateway adoption, so the owner is rechecked right before dispatch.
|
|
736
|
+
await deps.service().assertWritable(s);
|
|
737
|
+
closePreparation?.();
|
|
738
|
+
timing?.emit('dispatch');
|
|
691
739
|
agentDispatched = true;
|
|
692
740
|
const result = await sidecar.call('chat.start', {
|
|
693
741
|
profile_home: deps.profileHome(s.profile), session_id: sessionId, stream_id: streamId, ...this.agentWorkspace(s, opts.workspace), model: opts.model ?? '', model_provider: opts.modelProvider,
|
|
@@ -696,14 +744,26 @@ export class TurnRunner {
|
|
|
696
744
|
...(opts.connectCard ? { connect_card: true } : {}),
|
|
697
745
|
...(opts.skillSecret ? { skill_secret: true } : {}),
|
|
698
746
|
}, {
|
|
747
|
+
timing,
|
|
699
748
|
signal: controller.signal,
|
|
700
749
|
timeoutMs: 0,
|
|
701
750
|
onStream: (frame) => {
|
|
751
|
+
timing?.observe('first_sidecar_output');
|
|
702
752
|
const receivedAt = deps.now();
|
|
703
753
|
streamWrites = streamWrites.then(async () => {
|
|
704
754
|
const publish = put;
|
|
705
755
|
const emitFrame = (event, data, meta = {}) => publish(event, data, { ...meta, createdAt: receivedAt });
|
|
706
756
|
const data = isDict(frame.data) ? frame.data : {};
|
|
757
|
+
if ((frame.event === 'notice' || frame.event === 'notice_clear') && str(data.key).startsWith('startup-warning.')) {
|
|
758
|
+
try {
|
|
759
|
+
await deps.notifications.agentWarning(notificationScope, str(data.key), frame.event === 'notice' ? { text: str(data.text), level: data.level } : null);
|
|
760
|
+
}
|
|
761
|
+
catch (error) {
|
|
762
|
+
// Notification storage must not turn a successful Agent result into a failed chat.
|
|
763
|
+
deps.log(`[webui] startup warning persistence failed for ${sessionId}: ${String(error)}`);
|
|
764
|
+
}
|
|
765
|
+
return;
|
|
766
|
+
}
|
|
707
767
|
switch (frame.event) {
|
|
708
768
|
case 'token': {
|
|
709
769
|
tokenSent = true;
|
|
@@ -761,11 +821,23 @@ export class TurnRunner {
|
|
|
761
821
|
await emitFrame('tool', publicToolFrame(withToolId(data, toolIds.get(call)), redacted), { redacted });
|
|
762
822
|
return;
|
|
763
823
|
}
|
|
824
|
+
case 'tool_progress': {
|
|
825
|
+
if (statusEnded || this.registry.cancelled.has(streamId))
|
|
826
|
+
return;
|
|
827
|
+
const tc = liveToolCalls.findLast((call) => !call.done && call.tid === data.tool_call_id && Boolean(data.tool_call_id));
|
|
828
|
+
if (!tc)
|
|
829
|
+
return;
|
|
830
|
+
const redacted = deps.redactEnabled();
|
|
831
|
+
tc.progress = toolProgress({ ...data, message: typeof data.message === 'string' ? redactString(data.message, redacted) : null });
|
|
832
|
+
await emitFrame('tool_progress', { id: toolIds.get(tc), progress: tc.progress }, { redacted });
|
|
833
|
+
return;
|
|
834
|
+
}
|
|
764
835
|
case 'tool_complete': {
|
|
765
836
|
// TAL-313: the server decides failure from the sidecar's raw result, which never leaves the server; TAL-315: so
|
|
766
837
|
// are its display sections, which keep the stderr and exit code the flat preview drops.
|
|
767
838
|
const { raw_result: rawResult, todo_result: todoResult, result_diff: resultDiff, display_metadata: displayMetadata, ...complete } = data;
|
|
768
|
-
const outcome = toolOutcome(rawResult);
|
|
839
|
+
const outcome = toolOutcome(rawResult, data.name);
|
|
840
|
+
complete.progress = null;
|
|
769
841
|
complete.is_error = outcome.is_error;
|
|
770
842
|
if (rawResult !== undefined)
|
|
771
843
|
complete.result_view = outcome.result_view;
|
|
@@ -780,8 +852,10 @@ export class TurnRunner {
|
|
|
780
852
|
if (startedAt !== undefined)
|
|
781
853
|
complete.duration = Math.round(Math.max(0, receivedAt - startedAt) * 1000) / 1000;
|
|
782
854
|
// TAL-315: the decided view too, so a failed or cancelled turn's snapshot keeps the sections shown live.
|
|
783
|
-
Object.assign(tc, { done: true, snippet: data.preview, is_error: complete.is_error, duration: complete.duration ?? null, ...(complete.result_view ? { result_view: complete.result_view } : {}), ...(editDiff ? { edit_diff: editDiff } : {}) });
|
|
855
|
+
Object.assign(tc, { done: true, progress: null, snippet: data.preview, is_error: complete.is_error, duration: complete.duration ?? null, ...(complete.result_view ? { result_view: complete.result_view } : {}), ...(editDiff ? { edit_diff: editDiff } : {}) });
|
|
784
856
|
}
|
|
857
|
+
if (startsBackgroundWork(data.name, rawResult))
|
|
858
|
+
deps.onBackgroundWork?.(sessionId, s.profile ?? null);
|
|
785
859
|
const id = (tc && toolIds.get(tc)) || str(data.tid) || mintToolId();
|
|
786
860
|
this.lastCompletedTool.set(streamId, id);
|
|
787
861
|
const redacted = deps.redactEnabled();
|
|
@@ -899,6 +973,19 @@ export class TurnRunner {
|
|
|
899
973
|
result.messages = withImages(result.messages);
|
|
900
974
|
if (result.context_messages)
|
|
901
975
|
result.context_messages = withImages(result.context_messages);
|
|
976
|
+
// Snapshot IO must finish before the cancellation/ownership gates and final transcript writeback.
|
|
977
|
+
let persistentChanges = null;
|
|
978
|
+
if (!opts.ephemeral && result.status === 'completed' && !this.registry.cancelled.has(streamId)) {
|
|
979
|
+
try {
|
|
980
|
+
persistentChanges = persistentStateChanges(persistentBefore, await persistentStateSnapshot(persistentHome));
|
|
981
|
+
}
|
|
982
|
+
catch (error) {
|
|
983
|
+
deps.log(`[webui] persistent state change detection failed for ${sessionId}: ${error.message}`);
|
|
984
|
+
}
|
|
985
|
+
}
|
|
986
|
+
// TAL-1162: the settlement's one state.db read runs on the worker before the gates below decide, so a Stop that
|
|
987
|
+
// lands during it takes the cancel path instead of racing this writeback.
|
|
988
|
+
const settlement = await deps.service().settlementRead(s);
|
|
902
989
|
if (this.registry.cancelled.has(streamId) || result.status === 'cancelled') {
|
|
903
990
|
// The Stop's pre-interrupt snapshot is the boundary, even when its reply lands after this result (the sidecar
|
|
904
991
|
// answers each request on its own thread); without one, the Agent's interrupted result is its canonical transcript.
|
|
@@ -906,7 +993,7 @@ export class TurnRunner {
|
|
|
906
993
|
applyAgentUsage(liveUsage, result.usage);
|
|
907
994
|
this.liveUsage.set(streamId, liveUsage);
|
|
908
995
|
await this.finalizeCancelled(s, streamId, opts.ephemeral, interrupted?.checkpoint ? withImages(interrupted.checkpoint) : result.messages);
|
|
909
|
-
await put('cancel', (await this.cancelFrame(sessionId)));
|
|
996
|
+
await put('cancel', (await this.cancelFrame(sessionId, streamId)));
|
|
910
997
|
return;
|
|
911
998
|
}
|
|
912
999
|
// Writeback only while this stream still owns the session (Python `_stream_writeback_is_current`).
|
|
@@ -948,10 +1035,10 @@ export class TurnRunner {
|
|
|
948
1035
|
await this.steerRewrites.get(streamId);
|
|
949
1036
|
const { events: steerEvents, leftovers } = this.finalizeSteers(streamId, str(result.pending_steer), 'followup');
|
|
950
1037
|
followUp = leftovers;
|
|
951
|
-
await this.persistError(s, streamId, classification.label, payload, activeTurnToken, resultMessages, result.provider);
|
|
1038
|
+
await this.persistError(s, settlement, streamId, classification.label, payload, activeTurnToken, resultMessages, result.provider);
|
|
952
1039
|
// TAL-512: a btw error carries no session: its journaled frame must not keep a copy of the parent conversation.
|
|
953
1040
|
if (!opts.ephemeral)
|
|
954
|
-
payload.session = (await this.publicTerminalSession(s));
|
|
1041
|
+
payload.session = (await this.publicTerminalSession(s, streamId));
|
|
955
1042
|
payload.session_id = s.session_id;
|
|
956
1043
|
payload.old_session_id = sessionId;
|
|
957
1044
|
for (const [event, data] of steerEvents)
|
|
@@ -1087,7 +1174,7 @@ export class TurnRunner {
|
|
|
1087
1174
|
this.persistConsumedSteers(s, streamId, previousStartedAt(s, activeRun), now);
|
|
1088
1175
|
// TAL-493: the rows this turn's Agent wrote to state.db are now in the transcript, so the merge must not replay them
|
|
1089
1176
|
// (all of them, the dropped summary request too).
|
|
1090
|
-
this.settleStateDb(s, streamId, agentRows, { previousContext });
|
|
1177
|
+
this.settleStateDb(s, streamId, agentRows, { previousContext, read: settlement });
|
|
1091
1178
|
recordBackgroundReview(s, streamId);
|
|
1092
1179
|
await deps.store.save(s);
|
|
1093
1180
|
deps.pending.clearApprovals(sessionId);
|
|
@@ -1095,10 +1182,9 @@ export class TurnRunner {
|
|
|
1095
1182
|
deps.events.publish('session_done', { profile: s.profile, sessionId: s.session_id });
|
|
1096
1183
|
// Python `_persistent_state_changes`: toast memory/skill files the agent wrote during the turn.
|
|
1097
1184
|
try {
|
|
1098
|
-
|
|
1099
|
-
if (changes.memory_saved)
|
|
1185
|
+
if (persistentChanges?.memory_saved)
|
|
1100
1186
|
(await put('state_saved', { session_id: sessionId, kind: 'memory', action: 'saved' }));
|
|
1101
|
-
for (const change of
|
|
1187
|
+
for (const change of persistentChanges?.skills ?? [])
|
|
1102
1188
|
(await put('state_saved', { session_id: sessionId, kind: 'skill', action: change.action, name: change.name }));
|
|
1103
1189
|
}
|
|
1104
1190
|
catch (error) {
|
|
@@ -1115,7 +1201,7 @@ export class TurnRunner {
|
|
|
1115
1201
|
cache_hit_percent: cacheHit(cacheReadTokens, inputTokens), turn_cache_hit_percent: cacheHit(turnCacheRead, turnInput), duration_seconds: Math.round(duration * 1000) / 1000,
|
|
1116
1202
|
context_length: s.context_length ?? 0, threshold_tokens: s.threshold_tokens ?? 0, last_prompt_tokens: s.last_prompt_tokens ?? 0,
|
|
1117
1203
|
};
|
|
1118
|
-
const doneSession = (await this.publicTerminalSession(s));
|
|
1204
|
+
const doneSession = (await this.publicTerminalSession(s, streamId));
|
|
1119
1205
|
// TAL-299: the ring's figures match the terminal session's (and a detail reload's).
|
|
1120
1206
|
for (const key of CONTEXT_USAGE_FIELDS)
|
|
1121
1207
|
doneUsage[key] = doneSession[key];
|
|
@@ -1159,9 +1245,11 @@ export class TurnRunner {
|
|
|
1159
1245
|
await opts.onDone?.(lastAnswer(s.messages));
|
|
1160
1246
|
}
|
|
1161
1247
|
catch (error) {
|
|
1248
|
+
timing?.fail(error);
|
|
1162
1249
|
await streamWrites;
|
|
1163
1250
|
const readOnly = !agentDispatched ? (await deps.service().readOnlyReason(s)) : null;
|
|
1164
1251
|
if (readOnly) {
|
|
1252
|
+
timing?.fail({ status: 403 });
|
|
1165
1253
|
ownershipRefused = true;
|
|
1166
1254
|
if (this.registry.writebackOwners.get(sessionId) === streamId && s.active_stream_id === streamId) {
|
|
1167
1255
|
// Cancellation persists the prompt and a Stop row; an unstarted, refused turn must add neither.
|
|
@@ -1171,15 +1259,17 @@ export class TurnRunner {
|
|
|
1171
1259
|
s.extra.completion_acceptances = Object.fromEntries(Object.entries(s.extra.completion_acceptances).filter(([, value]) => value !== streamId));
|
|
1172
1260
|
await deps.store.save(s, { touchUpdatedAt: false });
|
|
1173
1261
|
}
|
|
1174
|
-
await put('apperror', { type: 'error', terminal_state: 'error', message: readOnly, session_id: sessionId, session: (await this.publicTerminalSession(s)) });
|
|
1262
|
+
await put('apperror', { type: 'error', terminal_state: 'error', message: readOnly, session_id: sessionId, session: (await this.publicTerminalSession(s, streamId)) });
|
|
1175
1263
|
return;
|
|
1176
1264
|
}
|
|
1177
1265
|
if (settledAt.value && !(error instanceof SidecarError)) {
|
|
1178
1266
|
deps.log(`[webui] ERROR settling turn ${streamId}\n${error instanceof Error ? (error.stack ?? error.message) : String(error)}`);
|
|
1179
1267
|
}
|
|
1268
|
+
// TAL-1162: the error's settlement read runs on the worker before the gates below decide.
|
|
1269
|
+
const settlement = await deps.service().settlementRead(s);
|
|
1180
1270
|
if (this.registry.cancelled.has(streamId)) {
|
|
1181
1271
|
await this.finalizeCancelled(s, streamId, opts.ephemeral);
|
|
1182
|
-
await put('cancel', (await this.cancelFrame(sessionId)));
|
|
1272
|
+
await put('cancel', (await this.cancelFrame(sessionId, streamId)));
|
|
1183
1273
|
return;
|
|
1184
1274
|
}
|
|
1185
1275
|
const message = error instanceof Error ? error.message : String(error);
|
|
@@ -1201,9 +1291,9 @@ export class TurnRunner {
|
|
|
1201
1291
|
if (current.active_stream_id === streamId) {
|
|
1202
1292
|
for (const [event, data] of this.takeSteerEventsBefore(streamId, 'apperror'))
|
|
1203
1293
|
(await put(event, data));
|
|
1204
|
-
await this.persistError(current, streamId, classification.label, payload, activeTurnToken);
|
|
1294
|
+
await this.persistError(current, settlement, streamId, classification.label, payload, activeTurnToken);
|
|
1205
1295
|
if (!opts.ephemeral)
|
|
1206
|
-
payload.session = (await this.publicTerminalSession(current));
|
|
1296
|
+
payload.session = (await this.publicTerminalSession(current, streamId));
|
|
1207
1297
|
}
|
|
1208
1298
|
}
|
|
1209
1299
|
catch (persistError) {
|
|
@@ -1305,29 +1395,13 @@ export class TurnRunner {
|
|
|
1305
1395
|
return images ? [{ type: 'text', text: withFiles() }, ...parts] : withFiles();
|
|
1306
1396
|
}
|
|
1307
1397
|
/** The settled session as a terminal frame carries it: the display window, redacted. */
|
|
1308
|
-
async publicTerminalSession(s) {
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
async terminalSessionPayload(s) {
|
|
1316
|
-
const payload = (await this.deps.service().wireRow(s));
|
|
1317
|
-
payload.automatic_turns_held = (await this.automaticTurnsHeld(s.session_id));
|
|
1318
|
-
payload.notices = this.sessionNotices(s.session_id);
|
|
1319
|
-
payload.goal = this.sessionGoal(s.session_id);
|
|
1320
|
-
const service = this.deps.service();
|
|
1321
|
-
const scened = (await service.backgroundLinked(s, hydrateAnchorActivityScenes(withToolCallOutcomes((await service.backgroundUpdates(s, withMarkerKinds(withTurnIds(withAttachmentObjects(s.messages)), s))), s.tool_calls, s.active_stream_id), s.anchor_activity_scenes, { activeTurnId: s.active_stream_id, clipToolResults: true })));
|
|
1322
|
-
const [window, offset] = messageWindowForDisplay(scened, TERMINAL_SSE_VISIBLE_MESSAGE_LIMIT, null);
|
|
1323
|
-
const limited = messagesForLimitedPayload(withBodyExcerpts(withDisplayMedia(window, (await service.mediaProjector(s))), s.active_stream_id, newestSettledReply(scened, s.active_stream_id), offset));
|
|
1324
|
-
payload.messages = limited;
|
|
1325
|
-
payload.message_count = s.messages.length;
|
|
1326
|
-
payload._messages_offset = offset;
|
|
1327
|
-
payload._messages_truncated = offset > 0;
|
|
1328
|
-
attachTodoState(payload, s.messages, s.extra[UNSETTLED_TODO_KEY]);
|
|
1329
|
-
payload.tool_calls = toolCallsForMessageWindow(s.tool_calls, offset, limited.length);
|
|
1330
|
-
payload.compression_reference = compressionReference(s, scened);
|
|
1398
|
+
async publicTerminalSession(s, streamId) {
|
|
1399
|
+
const terminal = streamId ? this.deps.service().activitySummary(s, streamId)?.terminalState : null;
|
|
1400
|
+
const payload = await this.deps.service().windowedDetail(s, TRANSCRIPT_WINDOW);
|
|
1401
|
+
if (!streamId)
|
|
1402
|
+
return payload;
|
|
1403
|
+
const terminalPhase = terminal === 'completed' || terminal === 'tool_limit_reached' ? 'completed' : terminal === 'cancelled' ? 'cancelled' : 'failed';
|
|
1404
|
+
payload.activity_phase = await this.deps.service().activityPhase(s, { excludeStreamId: streamId, terminalPhase });
|
|
1331
1405
|
return payload;
|
|
1332
1406
|
}
|
|
1333
1407
|
/** TAL-540, Python `_live_usage_snapshot`: a finished compression's frame, with the counters and the ring's post-compression figures, so clients update before `done`. */
|
|
@@ -1349,7 +1423,8 @@ export class TurnRunner {
|
|
|
1349
1423
|
}
|
|
1350
1424
|
/** Python `_materialize_pending_user_turn_before_error` + error message append + save. */
|
|
1351
1425
|
/** `runtimeProvider`: the provider the Agent resolved for the turn, when it reported one. */
|
|
1352
|
-
|
|
1426
|
+
/** `read`: the settlement's one state.db read, taken before the caller's gates decided (TAL-1162). */
|
|
1427
|
+
async persistError(s, read, streamId, label, payload, activeTurnToken, agentRows = [], runtimeProvider = '') {
|
|
1353
1428
|
const startedAt = s.pending_started_at;
|
|
1354
1429
|
// TAL-576: an automatic wakeup with no usable credentials pauses the next ones instead of failing each.
|
|
1355
1430
|
if (s.pending_user_source === 'process_wakeup' && payload.type === 'credential_pool_empty') {
|
|
@@ -1392,7 +1467,6 @@ export class TurnRunner {
|
|
|
1392
1467
|
this.persistConsumedSteers(s, streamId, startedAt, this.deps.now());
|
|
1393
1468
|
// TAL-921: the next prompt remembers the turn's work; an exhausted compression's work would only overflow again. One
|
|
1394
1469
|
// read builds the context and settles, so a row committed in between is never covered without reaching either.
|
|
1395
|
-
const read = this.deps.service().stateDbRead(s);
|
|
1396
1470
|
const context = payload.type === 'compression_exhausted' ? null : this.unsettledContext(streamId, agentRows, read);
|
|
1397
1471
|
if (context)
|
|
1398
1472
|
s.context_messages = context;
|
|
@@ -1409,11 +1483,19 @@ export class TurnRunner {
|
|
|
1409
1483
|
this.deps.pending.clearClarifies(s.session_id);
|
|
1410
1484
|
this.deps.events.publish('session_error', { profile: s.profile, sessionId: s.session_id });
|
|
1411
1485
|
}
|
|
1486
|
+
/** The model history a turn starts from: the session's context merged with `stateRows`, without the turn's own rows. */
|
|
1487
|
+
turnHistory(s, streamId, stateRows) {
|
|
1488
|
+
// TAL-578: an eager save already put this turn's prompt in the transcript; `user_message` carries it, so the history
|
|
1489
|
+
// leaves it out.
|
|
1490
|
+
const previousContext = structuredClone(this.deps.service().modelContext(s, stateRows)).filter((m) => m._turn_id !== streamId);
|
|
1491
|
+
// Python `_sanitize_messages_for_agent`: the model never sees display-only rows or a replayed cancelled prompt, and
|
|
1492
|
+
// the Agent gets back the exact bytes it sent (TAL-541).
|
|
1493
|
+
return { previousContext, apiHistory: sanitizeMessagesForApi(previousContext, { preserveApiContent: true, issuedReasoningSince: s.reasoning_replay_from }) };
|
|
1494
|
+
}
|
|
1412
1495
|
/** Every terminal path carries the same starting read's id and generation into settlement. */
|
|
1413
|
-
settleStateDb(s, streamId, agentRows, opts
|
|
1496
|
+
settleStateDb(s, streamId, agentRows, opts) {
|
|
1414
1497
|
const stop = this.stopContexts.get(streamId);
|
|
1415
|
-
|
|
1416
|
-
service.settleStateDb(s, { turnId: streamId, previousContext: stop?.previousContext ?? opts.previousContext ?? [], agentRows, startId: stop?.stateDbStartId ?? null, startGeneration: stop?.stateDbStartGeneration ?? null, read: opts.read ?? service.stateDbRead(s) });
|
|
1498
|
+
this.deps.service().settleStateDb(s, { turnId: streamId, previousContext: stop?.previousContext ?? opts.previousContext ?? [], agentRows, startId: stop?.stateDbStartId ?? null, startGeneration: stop?.stateDbStartGeneration ?? null, read: opts.read });
|
|
1417
1499
|
}
|
|
1418
1500
|
/**
|
|
1419
1501
|
* TAL-921: the model context a turn that ends without its settled result leaves: the work its Agent reported, else the
|
|
@@ -1472,11 +1554,11 @@ export class TurnRunner {
|
|
|
1472
1554
|
* Python `_emit_cancel_event`: the terminal frame carries the settled session so tabs can render the partial without a
|
|
1473
1555
|
* reload. TAL-364: no copy — clients show their one localized status for the `cancelled` outcome.
|
|
1474
1556
|
*/
|
|
1475
|
-
async cancelFrame(sessionId) {
|
|
1557
|
+
async cancelFrame(sessionId, streamId) {
|
|
1476
1558
|
let snapshot = null;
|
|
1477
1559
|
if (sessionId)
|
|
1478
1560
|
try {
|
|
1479
|
-
snapshot = (await this.publicTerminalSession((await this.deps.store.get(sessionId))));
|
|
1561
|
+
snapshot = (await this.publicTerminalSession((await this.deps.store.get(sessionId)), streamId));
|
|
1480
1562
|
}
|
|
1481
1563
|
catch {
|
|
1482
1564
|
snapshot = null;
|
|
@@ -1498,8 +1580,20 @@ export class TurnRunner {
|
|
|
1498
1580
|
catch {
|
|
1499
1581
|
return false;
|
|
1500
1582
|
}
|
|
1583
|
+
// TAL-921: one state.db read builds the context and settles the turn. TAL-1162: it runs on the state.db worker, before
|
|
1584
|
+
// any gate below decides.
|
|
1585
|
+
const read = await this.deps.service().settlementRead(current);
|
|
1586
|
+
if (this.registry.writebackOwners.get(s.session_id) !== streamId)
|
|
1587
|
+
return false;
|
|
1501
1588
|
if (current.active_stream_id !== null && current.active_stream_id !== streamId)
|
|
1502
1589
|
return false;
|
|
1590
|
+
const stop = this.stopContexts.get(streamId);
|
|
1591
|
+
if (stop?.startReadPending) {
|
|
1592
|
+
// TAL-1162: the Stop landed before the turn's starting read did, so the Agent never ran: every row this later read
|
|
1593
|
+
// holds predates the turn, and the context the turn would have started from keeps them. No row is its own work.
|
|
1594
|
+
const { previousContext, apiHistory } = this.turnHistory(current, streamId, read.rows);
|
|
1595
|
+
Object.assign(stop, { previousContext, historyLength: apiHistory.length, startReadPending: false });
|
|
1596
|
+
}
|
|
1503
1597
|
if (ephemeral) {
|
|
1504
1598
|
try {
|
|
1505
1599
|
await this.deps.store.delete(current.session_id, { tombstone: false });
|
|
@@ -1514,7 +1608,7 @@ export class TurnRunner {
|
|
|
1514
1608
|
if (quiet && current.active_stream_id === null) {
|
|
1515
1609
|
// TAL-493: rows its worker committed while unwinding are covered by what it reports; others are kept.
|
|
1516
1610
|
if (checkpoint) {
|
|
1517
|
-
this.settleStateDb(current, streamId, checkpoint);
|
|
1611
|
+
this.settleStateDb(current, streamId, checkpoint, { read });
|
|
1518
1612
|
try {
|
|
1519
1613
|
(await this.deps.store.save(current));
|
|
1520
1614
|
}
|
|
@@ -1524,10 +1618,8 @@ export class TurnRunner {
|
|
|
1524
1618
|
}
|
|
1525
1619
|
return true;
|
|
1526
1620
|
}
|
|
1527
|
-
const stop = this.stopContexts.get(streamId);
|
|
1528
1621
|
const canonical = stop !== undefined && checkpoint !== null && checkpointTurnStart(checkpoint, stop.msgText, stop.historyLength) !== null;
|
|
1529
|
-
|
|
1530
|
-
const settle = (read) => {
|
|
1622
|
+
const settle = () => {
|
|
1531
1623
|
if (!stop)
|
|
1532
1624
|
return null;
|
|
1533
1625
|
if (canonical)
|
|
@@ -1541,8 +1633,7 @@ export class TurnRunner {
|
|
|
1541
1633
|
const ownStop = current.messages.some((m) => isCancelMarker(m) && m._turn_id === streamId);
|
|
1542
1634
|
// TAL-493: the worker's rows committed after the first settlement are covered by what it reports; others are kept.
|
|
1543
1635
|
if (ownStop && checkpoint) {
|
|
1544
|
-
const
|
|
1545
|
-
const late = canonical && !stop.checkpointed ? settle(read) : null;
|
|
1636
|
+
const late = canonical && !stop.checkpointed ? settle() : null;
|
|
1546
1637
|
if (late)
|
|
1547
1638
|
current.context_messages = dedupeContext(late);
|
|
1548
1639
|
this.settleStateDb(current, streamId, checkpoint, { read });
|
|
@@ -1557,8 +1648,7 @@ export class TurnRunner {
|
|
|
1557
1648
|
}
|
|
1558
1649
|
const startedAt = current.pending_started_at;
|
|
1559
1650
|
this.materializePendingUserTurn(current, buildActiveTurnToken(streamId, current.pending_started_at), streamId);
|
|
1560
|
-
const
|
|
1561
|
-
const context = settle(read);
|
|
1651
|
+
const context = settle();
|
|
1562
1652
|
if (context)
|
|
1563
1653
|
current.context_messages = dedupeContext(context);
|
|
1564
1654
|
this.clearPendingTurn(current);
|
|
@@ -1641,6 +1731,7 @@ export class TurnRunner {
|
|
|
1641
1731
|
await service.deps.warmSessionModelRepair?.(s.profile);
|
|
1642
1732
|
const [model, provider] = service.turnModel(s);
|
|
1643
1733
|
const [qa, prompts] = titlePrompts(userText, assistantText);
|
|
1734
|
+
const source = [...s.messages, ...s.context_messages, ...await service.stateDbRows(s)];
|
|
1644
1735
|
let status = 'llm_error_aux';
|
|
1645
1736
|
for (const [idx, prompt] of prompts.entries()) {
|
|
1646
1737
|
if ((await this.deps.service().isReadOnly(s)))
|
|
@@ -1649,7 +1740,7 @@ export class TurnRunner {
|
|
|
1649
1740
|
try {
|
|
1650
1741
|
const result = await sidecar.call('aux.complete', {
|
|
1651
1742
|
profile_home: this.deps.profileHome(s.profile), task: 'title_generation',
|
|
1652
|
-
messages: [{ role: 'system', content: prompt }, { role: 'user', content: qa }], max_tokens: 64,
|
|
1743
|
+
messages: withDataUseRequirements([{ role: 'system', content: prompt }, { role: 'user', content: qa }], source), max_tokens: 64,
|
|
1653
1744
|
main_runtime: { model: model ?? '', provider }, main_fallback: true,
|
|
1654
1745
|
});
|
|
1655
1746
|
raw = str(result.text);
|
|
@@ -1680,9 +1771,10 @@ export class TurnRunner {
|
|
|
1680
1771
|
async refine(s, focus) {
|
|
1681
1772
|
if (!s)
|
|
1682
1773
|
return 'Nothing to refine yet — send a message first.';
|
|
1774
|
+
const context = await this.deps.service().readModelContext(s);
|
|
1683
1775
|
if (s.active_stream_id)
|
|
1684
1776
|
return 'Agent is running — wait for the turn to finish, then /refine.';
|
|
1685
|
-
const messages = sanitizeMessagesForApi(
|
|
1777
|
+
const messages = sanitizeMessagesForApi(context, { preserveApiContent: true, issuedReasoningSince: s.reasoning_replay_from });
|
|
1686
1778
|
if (!messages.length)
|
|
1687
1779
|
return 'Nothing to refine yet — the conversation is empty.';
|
|
1688
1780
|
// Like a turn: no agent is built in a profile whose home is going away.
|
|
@@ -1693,7 +1785,7 @@ export class TurnRunner {
|
|
|
1693
1785
|
throw new SidecarError('The Agent sidecar is not running; /refine is unavailable until it starts.', { condition: 'sidecar_unavailable' });
|
|
1694
1786
|
const [model, provider] = this.deps.service().turnModel(s);
|
|
1695
1787
|
const cfg = (await this.deps.profileConfig?.(s.profile ?? null)) ?? {};
|
|
1696
|
-
this.deps.service().assertWritable(s);
|
|
1788
|
+
await this.deps.service().assertWritable(s);
|
|
1697
1789
|
return (await sidecar.call('chat.refine', {
|
|
1698
1790
|
profile_home: this.deps.profileHome(s.profile), session_id: s.session_id, messages, focus, model: model ?? '', model_provider: provider,
|
|
1699
1791
|
enabled_toolsets: this.deps.toolsetsFor(s), ...agentBuildParams(cfg, 'webui', provider, this.deps.env ?? {}),
|
|
@@ -1721,7 +1813,7 @@ export class TurnRunner {
|
|
|
1721
1813
|
let rawPreview = '';
|
|
1722
1814
|
if (assistantText)
|
|
1723
1815
|
({ title: next, status: llmStatus, rawPreview } = await this.llmTitle(s, userText, assistantText));
|
|
1724
|
-
this.deps.service().assertWritable(s);
|
|
1816
|
+
await this.deps.service().assertWritable(s);
|
|
1725
1817
|
if (next)
|
|
1726
1818
|
return { title: next, status: llmStatus, rawPreview };
|
|
1727
1819
|
const fallback = fallbackTitleFromExchange(userText, assistantText);
|
|
@@ -1984,7 +2076,7 @@ export class TurnRunner {
|
|
|
1984
2076
|
(await emit(event, data));
|
|
1985
2077
|
this.runStatuses.delete(streamId);
|
|
1986
2078
|
await emit('run_status', { session_id: sessionId, status: null });
|
|
1987
|
-
await emit('cancel', (await this.cancelFrame(sessionId)));
|
|
2079
|
+
await emit('cancel', (await this.cancelFrame(sessionId, streamId)));
|
|
1988
2080
|
this.registry.streams.delete(streamId);
|
|
1989
2081
|
this.registry.liveIds.delete(streamId);
|
|
1990
2082
|
}
|
|
@@ -2243,7 +2335,7 @@ export class TurnRunner {
|
|
|
2243
2335
|
let decision;
|
|
2244
2336
|
try {
|
|
2245
2337
|
// The workspace the turn ran in, unrecovered: the Agent pauses the goal rather than run its gates anywhere else.
|
|
2246
|
-
this.deps.service().assertWritable(s);
|
|
2338
|
+
await this.deps.service().assertWritable(s);
|
|
2247
2339
|
decision = await sidecar.call('goals.evaluate', { session_id: sessionId, profile_home: this.deps.profileHome(s.profile), last_response: lastResponse, user_initiated: true, workspace: str(s.workspace) || undefined });
|
|
2248
2340
|
}
|
|
2249
2341
|
catch (error) {
|
|
@@ -2300,6 +2392,11 @@ export class TurnRunner {
|
|
|
2300
2392
|
const open = r.state === 'pending';
|
|
2301
2393
|
return { steer_id: r.steer_id, text: r.display_text, submitted_at: r.created_at, state: r.state, actions: { edit: open, cancel: open, send_now: open && r.can_redirect } };
|
|
2302
2394
|
}
|
|
2395
|
+
liveToolProgress(streamId) {
|
|
2396
|
+
if (this.registry.cancelled.has(streamId))
|
|
2397
|
+
return [];
|
|
2398
|
+
return (this.registry.liveToolCalls.get(streamId) ?? []).filter((call) => !call.done && call.progress).map((call) => ({ ...call, id: str(call.tid) }));
|
|
2399
|
+
}
|
|
2303
2400
|
runStatus(streamId) {
|
|
2304
2401
|
return this.runStatuses.get(streamId) ?? null;
|
|
2305
2402
|
}
|
|
@@ -2422,7 +2519,7 @@ export class TurnRunner {
|
|
|
2422
2519
|
}
|
|
2423
2520
|
// ── approvals / clarify ──────────────────────────────────────────────────
|
|
2424
2521
|
async respondApproval(sessionId, choice, approvalId, enableYolo) {
|
|
2425
|
-
if (this.deps.service().owner?.isOwned(sessionId)) {
|
|
2522
|
+
if (await this.deps.service().owner?.isOwned(sessionId)) {
|
|
2426
2523
|
if (enableYolo)
|
|
2427
2524
|
throw new HttpFailure(403, 'Change approval policy through the owning Agent');
|
|
2428
2525
|
await this.deps.service().owner.respond(sessionId, 'approval', approvalId, choice);
|
|
@@ -2551,7 +2648,7 @@ export class TurnRunner {
|
|
|
2551
2648
|
* did not acknowledge (prompt retained).
|
|
2552
2649
|
*/
|
|
2553
2650
|
async respondClarify(sessionId, clarifyId, reply) {
|
|
2554
|
-
if (this.deps.service().owner?.isOwned(sessionId)) {
|
|
2651
|
+
if (await this.deps.service().owner?.isOwned(sessionId)) {
|
|
2555
2652
|
await this.deps.service().owner.respond(sessionId, 'clarify', clarifyId, reply);
|
|
2556
2653
|
return { ok: true };
|
|
2557
2654
|
}
|