@circuitwall/jarela 2.2.1 → 2.4.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/.next/standalone/.next/BUILD_ID +1 -1
- package/.next/standalone/.next/app-path-routes-manifest.json +2 -1
- package/.next/standalone/.next/build-manifest.json +2 -2
- package/.next/standalone/.next/prerender-manifest.json +3 -3
- package/.next/standalone/.next/routes-manifest.json +8 -0
- package/.next/standalone/.next/server/app/_global-error/page.js +68 -68
- package/.next/standalone/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/_global-error.html +1 -1
- package/.next/standalone/.next/server/app/_global-error.rsc +1 -1
- package/.next/standalone/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_not-found/page.js +76 -76
- package/.next/standalone/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/_not-found.html +2 -2
- package/.next/standalone/.next/server/app/_not-found.rsc +2 -2
- package/.next/standalone/.next/server/app/_not-found.segments/_full.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/_not-found.segments/_index.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/api/v1/access/[identity]/route.js +100 -93
- package/.next/standalone/.next/server/app/api/v1/access/route.js +176 -169
- package/.next/standalone/.next/server/app/api/v1/agents/[id]/compact/route.js +89 -56
- package/.next/standalone/.next/server/app/api/v1/agents/[id]/compact/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/v1/agents/[id]/display-filters/route.js +139 -127
- package/.next/standalone/.next/server/app/api/v1/agents/[id]/route.js +107 -100
- package/.next/standalone/.next/server/app/api/v1/agents/[id]/thread/route.js +765 -753
- package/.next/standalone/.next/server/app/api/v1/agents/route.js +72 -65
- package/.next/standalone/.next/server/app/api/v1/allowed-sites/[hostname]/route.js +371 -364
- package/.next/standalone/.next/server/app/api/v1/allowed-sites/route.js +809 -802
- package/.next/standalone/.next/server/app/api/v1/artifacts/lifecycle/route.js +9 -2
- package/.next/standalone/.next/server/app/api/v1/attachments/files/route.js +49 -49
- package/.next/standalone/.next/server/app/api/v1/attachments/images/route.js +910 -910
- package/.next/standalone/.next/server/app/api/v1/bridges/[id]/chats/route.js +583 -16
- package/.next/standalone/.next/server/app/api/v1/bridges/[id]/chats/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/v1/bridges/[id]/ignores/[remote_jid]/route.js +41 -30
- package/.next/standalone/.next/server/app/api/v1/bridges/[id]/ignores/route.js +48 -37
- package/.next/standalone/.next/server/app/api/v1/bridges/[id]/lookup/route.js +697 -130
- package/.next/standalone/.next/server/app/api/v1/bridges/[id]/lookup/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/v1/bridges/[id]/pair/route.js +703 -136
- package/.next/standalone/.next/server/app/api/v1/bridges/[id]/pair/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/v1/bridges/[id]/route.js +796 -229
- package/.next/standalone/.next/server/app/api/v1/bridges/[id]/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/v1/bridges/[id]/routes/[route_id]/route.js +762 -746
- package/.next/standalone/.next/server/app/api/v1/bridges/[id]/routes/route.js +1050 -1034
- package/.next/standalone/.next/server/app/api/v1/bridges/[id]/status/route.js +673 -106
- package/.next/standalone/.next/server/app/api/v1/bridges/[id]/status/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/v1/bridges/kinds/route.js +811 -804
- package/.next/standalone/.next/server/app/api/v1/bridges/kinds/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/v1/bridges/route.js +718 -706
- package/.next/standalone/.next/server/app/api/v1/bridges/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/v1/builtin-tools/route.js +9 -9
- package/.next/standalone/.next/server/app/api/v1/builtin-tools/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/v1/config/route.js +85 -85
- package/.next/standalone/.next/server/app/api/v1/credentials/[id]/route.js +709 -709
- package/.next/standalone/.next/server/app/api/v1/credentials/[id]/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/v1/credentials/route.js +2 -2
- package/.next/standalone/.next/server/app/api/v1/credentials/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/v1/dashboard/currency/route.js +10 -10
- package/.next/standalone/.next/server/app/api/v1/dashboard/metrics/route.js +796 -784
- package/.next/standalone/.next/server/app/api/v1/dashboard/pricing/route.js +30 -23
- package/.next/standalone/.next/server/app/api/v1/dashboard/pricing-task/route.js +86 -86
- package/.next/standalone/.next/server/app/api/v1/dashboard/pricing-task/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/v1/delegations/codex/[job_id]/route.js +57 -57
- package/.next/standalone/.next/server/app/api/v1/delegations/codex/[job_id]/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/v1/documents/search/route.js +385 -378
- package/.next/standalone/.next/server/app/api/v1/documents/settings/route.js +51 -44
- package/.next/standalone/.next/server/app/api/v1/documents/sources/[id]/reindex/route.js +65 -65
- package/.next/standalone/.next/server/app/api/v1/documents/sources/[id]/reindex/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/v1/documents/sources/[id]/route.js +122 -122
- package/.next/standalone/.next/server/app/api/v1/documents/sources/[id]/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/v1/documents/sources/route.js +37 -37
- package/.next/standalone/.next/server/app/api/v1/documents/sources/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/v1/env/route.js +9 -9
- package/.next/standalone/.next/server/app/api/v1/env-sync/allowlist/route.js +375 -368
- package/.next/standalone/.next/server/app/api/v1/env-sync/route.js +51 -44
- package/.next/standalone/.next/server/app/api/v1/events/route.js +745 -178
- package/.next/standalone/.next/server/app/api/v1/events/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/v1/events/test/route.js +77 -77
- package/.next/standalone/.next/server/app/api/v1/extension/agents/route.js +763 -763
- package/.next/standalone/.next/server/app/api/v1/extension/agents/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/v1/extension/browser/activate/route.js +51 -44
- package/.next/standalone/.next/server/app/api/v1/extension/browser/foreground/route.js +16 -9
- package/.next/standalone/.next/server/app/api/v1/extension/browser/history/route.js +72 -65
- package/.next/standalone/.next/server/app/api/v1/extension/browser/poll/route.js +41 -34
- package/.next/standalone/.next/server/app/api/v1/extension/browser/progress/route.js +211 -204
- package/.next/standalone/.next/server/app/api/v1/extension/browser/result/route.js +140 -133
- package/.next/standalone/.next/server/app/api/v1/extension/browser/retry/route.js +113 -106
- package/.next/standalone/.next/server/app/api/v1/extension/browser/status/route.js +121 -114
- package/.next/standalone/.next/server/app/api/v1/extension/browser/tabs/route.js +141 -134
- package/.next/standalone/.next/server/app/api/v1/extension/fill/route.js +690 -690
- package/.next/standalone/.next/server/app/api/v1/extension/fill/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/v1/extension/refine/route.js +93 -93
- package/.next/standalone/.next/server/app/api/v1/extension/refine/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/v1/extension/turn/route.js +9 -9
- package/.next/standalone/.next/server/app/api/v1/extension/turn/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/v1/extensions/route.js +185 -185
- package/.next/standalone/.next/server/app/api/v1/extensions/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/v1/extensions/tools/[name]/config/route.js +171 -171
- package/.next/standalone/.next/server/app/api/v1/extensions/tools/[name]/config/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/v1/extensions/tools/[name]/route.js +396 -396
- package/.next/standalone/.next/server/app/api/v1/extensions/tools/[name]/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/v1/extensions/tools/[name]/secrets/route.js +212 -212
- package/.next/standalone/.next/server/app/api/v1/extensions/tools/[name]/secrets/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/v1/files/[name]/route.js +235 -235
- package/.next/standalone/.next/server/app/api/v1/fs/browse/route.js +26 -26
- package/.next/standalone/.next/server/app/api/v1/harnesses/[id]/route.js +228 -221
- package/.next/standalone/.next/server/app/api/v1/harnesses/default/route.js +65 -58
- package/.next/standalone/.next/server/app/api/v1/harnesses/route.js +79 -72
- package/.next/standalone/.next/server/app/api/v1/health/probes/route.js +9 -9
- package/.next/standalone/.next/server/app/api/v1/health/probes/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/v1/health/route.js +783 -771
- package/.next/standalone/.next/server/app/api/v1/integrations/[name]/route.js +140 -133
- package/.next/standalone/.next/server/app/api/v1/integrations/[name]/test/route.js +9 -9
- package/.next/standalone/.next/server/app/api/v1/integrations/[name]/test/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/v1/integrations/gmail/oauth/callback/route.js +370 -363
- package/.next/standalone/.next/server/app/api/v1/integrations/gmail/oauth/start/route.js +240 -233
- package/.next/standalone/.next/server/app/api/v1/integrations/gmail/oauth/status/route.js +689 -682
- package/.next/standalone/.next/server/app/api/v1/integrations/outlook/oauth/callback/route.js +886 -879
- package/.next/standalone/.next/server/app/api/v1/integrations/outlook/oauth/start/route.js +115 -108
- package/.next/standalone/.next/server/app/api/v1/integrations/outlook/oauth/status/route.js +955 -948
- package/.next/standalone/.next/server/app/api/v1/integrations/route.js +223 -216
- package/.next/standalone/.next/server/app/api/v1/lifecycle/adoption/route.js +876 -847
- package/.next/standalone/.next/server/app/api/v1/lifecycle/adoption/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/v1/local-file/route.js +26 -26
- package/.next/standalone/.next/server/app/api/v1/logs/route.js +70 -70
- package/.next/standalone/.next/server/app/api/v1/maps/embed/route.js +79 -72
- package/.next/standalone/.next/server/app/api/v1/mcp-servers/[name]/route.js +991 -979
- package/.next/standalone/.next/server/app/api/v1/mcp-servers/registry/route.js +196 -196
- package/.next/standalone/.next/server/app/api/v1/mcp-servers/route.js +19 -7
- package/.next/standalone/.next/server/app/api/v1/memory/[namespace]/[key]/route.js +539 -532
- package/.next/standalone/.next/server/app/api/v1/memory/policy/route.js +86 -79
- package/.next/standalone/.next/server/app/api/v1/memory/route.js +58 -51
- package/.next/standalone/.next/server/app/api/v1/memory/search/route.js +138 -131
- package/.next/standalone/.next/server/app/api/v1/models/[name]/compact-threads/route.js +381 -369
- package/.next/standalone/.next/server/app/api/v1/models/[name]/compact-threads/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/v1/models/[name]/route.js +150 -143
- package/.next/standalone/.next/server/app/api/v1/models/route.js +634 -627
- package/.next/standalone/.next/server/app/api/v1/packages/catalog/route.js +445 -445
- package/.next/standalone/.next/server/app/api/v1/packages/defaults/[id]/route.js +120 -120
- package/.next/standalone/.next/server/app/api/v1/packages/defaults/[id]/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/v1/packages/install/[id]/route.js +234 -234
- package/.next/standalone/.next/server/app/api/v1/packages/install/[id]/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/v1/packages/install/route.js +407 -407
- package/.next/standalone/.next/server/app/api/v1/packages/install/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/v1/packages/manifests/[name]/enabled/route.js +37 -37
- package/.next/standalone/.next/server/app/api/v1/packages/manifests/[name]/enabled/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/v1/packages/manifests/[name]/route.js +107 -107
- package/.next/standalone/.next/server/app/api/v1/packages/manifests/[name]/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/v1/packages/manifests/route.js +228 -228
- package/.next/standalone/.next/server/app/api/v1/packages/manifests/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/v1/packages/reload/route.js +9 -9
- package/.next/standalone/.next/server/app/api/v1/packages/reload/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/v1/packages/route.js +148 -148
- package/.next/standalone/.next/server/app/api/v1/packages/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/v1/page-capture/route.js +787 -787
- package/.next/standalone/.next/server/app/api/v1/page-capture/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/v1/pending-actions/[id]/approve/route.js +529 -514
- package/.next/standalone/.next/server/app/api/v1/pending-actions/[id]/approve/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/v1/pending-actions/[id]/deny/route.js +181 -181
- package/.next/standalone/.next/server/app/api/v1/pending-actions/[id]/deny/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/v1/pending-actions/route.js +258 -258
- package/.next/standalone/.next/server/app/api/v1/pending-actions/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/v1/profile/location/route.js +37 -30
- package/.next/standalone/.next/server/app/api/v1/profile/route.js +171 -164
- package/.next/standalone/.next/server/app/api/v1/providers/[provider]/models/route.js +51 -44
- package/.next/standalone/.next/server/app/api/v1/providers/[provider]/probe/route.js +15 -8
- package/.next/standalone/.next/server/app/api/v1/providers/github-copilot/auth/route.js +171 -164
- package/.next/standalone/.next/server/app/api/v1/providers/route.js +101 -94
- package/.next/standalone/.next/server/app/api/v1/proxy-config/route.js +457 -450
- package/.next/standalone/.next/server/app/api/v1/redaction/init/route.js +44 -37
- package/.next/standalone/.next/server/app/api/v1/redaction/route.js +65 -58
- package/.next/standalone/.next/server/app/api/v1/scheduled-tasks/[id]/route.js +617 -605
- package/.next/standalone/.next/server/app/api/v1/scheduled-tasks/[id]/run/route.js +44 -44
- package/.next/standalone/.next/server/app/api/v1/scheduled-tasks/[id]/run/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/v1/scheduled-tasks/route.js +739 -732
- package/.next/standalone/.next/server/app/api/v1/security/idle-timeout/route.js +329 -322
- package/.next/standalone/.next/server/app/api/v1/security/pin/route.js +204 -197
- package/.next/standalone/.next/server/app/api/v1/security/state/route.js +58 -51
- package/.next/standalone/.next/server/app/api/v1/security/unlock/route.js +183 -176
- package/.next/standalone/.next/server/app/api/v1/security/verify-pin/route.js +194 -187
- package/.next/standalone/.next/server/app/api/v1/setup/test-key/route.js +26 -26
- package/.next/standalone/.next/server/app/api/v1/skills/[id]/route.js +776 -769
- package/.next/standalone/.next/server/app/api/v1/skills/repos/[id]/route.js +122 -115
- package/.next/standalone/.next/server/app/api/v1/skills/repos/route.js +334 -327
- package/.next/standalone/.next/server/app/api/v1/skills/route.js +873 -866
- package/.next/standalone/.next/server/app/api/v1/system/abort/route.js +838 -808
- package/.next/standalone/.next/server/app/api/v1/system/restart/route.js +177 -177
- package/.next/standalone/.next/server/app/api/v1/system/restart/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/v1/tailscale/route.js +164 -164
- package/.next/standalone/.next/server/app/api/v1/tasks/[agent_id]/route.js +122 -115
- package/.next/standalone/.next/server/app/api/v1/tasks/route.js +30 -23
- package/.next/standalone/.next/server/app/api/v1/threads/[thread_id]/activity/route.js +1436 -0
- package/.next/standalone/.next/server/app/api/v1/threads/[thread_id]/activity/route.js.nft.json +1 -0
- package/.next/standalone/.next/server/app/api/v1/threads/[thread_id]/activity/route_client-reference-manifest.js +1 -0
- package/.next/standalone/.next/server/app/api/v1/threads/[thread_id]/context-pin/route.js +638 -631
- package/.next/standalone/.next/server/app/api/v1/threads/[thread_id]/context-pin/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/v1/threads/[thread_id]/route.js +60 -439
- package/.next/standalone/.next/server/app/api/v1/threads/[thread_id]/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/v1/threads/[thread_id]/run/route.js +172 -173
- package/.next/standalone/.next/server/app/api/v1/threads/[thread_id]/run/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/v1/threads/route.js +925 -913
- package/.next/standalone/.next/server/app/api/v1/tools/route.js +2 -2
- package/.next/standalone/.next/server/app/api/v1/tools/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/v1/update/apply/route.js +17 -17
- package/.next/standalone/.next/server/app/api/v1/update/apply/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/v1/update/route.js +570 -570
- package/.next/standalone/.next/server/app/api/v1/voice/transcribe/route.js +241 -229
- package/.next/standalone/.next/server/app/api/v1/voice/tts/route.js +989 -977
- package/.next/standalone/.next/server/app/api/v1/watchers/[id]/route.js +40 -28
- package/.next/standalone/.next/server/app/api/v1/watchers/[id]/run/route.js +72 -72
- package/.next/standalone/.next/server/app/api/v1/watchers/[id]/run/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/v1/watchers/reaction-scripts/route.js +128 -128
- package/.next/standalone/.next/server/app/api/v1/watchers/route.js +164 -164
- package/.next/standalone/.next/server/app/api/v1/watchers/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/icon.svg/route.js +62 -62
- package/.next/standalone/.next/server/app/manifest.webmanifest/route.js +436 -436
- package/.next/standalone/.next/server/app/page.js +1179 -743
- package/.next/standalone/.next/server/app/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/setup/page.js +99 -91
- package/.next/standalone/.next/server/app/setup/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app-paths-manifest.json +2 -1
- package/.next/standalone/.next/server/chunks/{424.js → 1388.js} +441 -1022
- package/.next/standalone/.next/server/chunks/1433.js +1 -1
- package/.next/standalone/.next/server/chunks/1638.js +1 -2
- package/.next/standalone/.next/server/chunks/1738.js +1 -1
- package/.next/standalone/.next/server/chunks/2068.js +47 -10
- package/.next/standalone/.next/server/chunks/210.js +3 -3
- package/.next/standalone/.next/server/chunks/2151.js +31 -1
- package/.next/standalone/.next/server/chunks/2207.js +1 -0
- package/.next/standalone/.next/server/chunks/2447.js +10 -5
- package/.next/standalone/.next/server/chunks/2471.js +45 -45
- package/.next/standalone/.next/server/chunks/2504.js +1 -1
- package/.next/standalone/.next/server/chunks/2695.js +17 -17
- package/.next/standalone/.next/server/chunks/3042.js +24 -16
- package/.next/standalone/.next/server/chunks/{4540.js → 309.js} +104 -38
- package/.next/standalone/.next/server/chunks/{2350.js → 3272.js} +104 -37
- package/.next/standalone/.next/server/chunks/3399.js +526 -526
- package/.next/standalone/.next/server/chunks/3524.js +150 -67
- package/.next/standalone/.next/server/chunks/3566.js +1 -1
- package/.next/standalone/.next/server/chunks/4189.js +946 -0
- package/.next/standalone/.next/server/chunks/4433.js +146 -146
- package/.next/standalone/.next/server/chunks/4508.js +3 -3
- package/.next/standalone/.next/server/chunks/4588.js +1 -0
- package/.next/standalone/.next/server/chunks/46.js +78 -28
- package/.next/standalone/.next/server/chunks/466.js +12 -0
- package/.next/standalone/.next/server/chunks/4868.js +206 -206
- package/.next/standalone/.next/server/chunks/4992.js +13 -0
- package/.next/standalone/.next/server/chunks/5120.js +963 -0
- package/.next/standalone/.next/server/chunks/5701.js +1 -1
- package/.next/standalone/.next/server/chunks/5900.js +1 -1
- package/.next/standalone/.next/server/chunks/5908.js +63 -42
- package/.next/standalone/.next/server/chunks/6142.js +10 -2
- package/.next/standalone/.next/server/chunks/6210.js +1 -0
- package/.next/standalone/.next/server/chunks/6213.js +1 -1
- package/.next/standalone/.next/server/chunks/6649.js +3 -3
- package/.next/standalone/.next/server/chunks/6703.js +3 -3
- package/.next/standalone/.next/server/chunks/7445.js +1 -0
- package/.next/standalone/.next/server/chunks/8067.js +12 -0
- package/.next/standalone/.next/server/chunks/8461.js +24 -17
- package/.next/standalone/.next/server/chunks/8558.js +1 -1
- package/.next/standalone/.next/server/chunks/8724.js +1 -1
- package/.next/standalone/.next/server/chunks/8849.js +91 -91
- package/.next/standalone/.next/server/chunks/9032.js +4 -3
- package/.next/standalone/.next/server/chunks/{2563.js → 9164.js} +33389 -31418
- package/.next/standalone/.next/server/chunks/9237.js +396 -396
- package/.next/standalone/.next/server/chunks/{9640.js → 9304.js} +1672 -575
- package/.next/standalone/.next/server/chunks/9406.js +1 -1
- package/.next/standalone/.next/server/chunks/9590.js +68 -18
- package/.next/standalone/.next/server/chunks/9824.js +98 -98
- package/.next/standalone/.next/server/chunks/9826.js +1 -0
- package/.next/standalone/.next/server/middleware-build-manifest.js +2 -2
- package/.next/standalone/.next/server/middleware.js +486 -415
- package/.next/standalone/.next/server/pages/404.html +2 -2
- package/.next/standalone/.next/server/pages/500.html +1 -1
- package/.next/standalone/.next/server/preview-props.json +3 -3
- package/.next/standalone/.next/server/server-reference-manifest.json +1 -1
- package/.next/standalone/.next/static/chunks/{1395-a340fb0a345382a4.js → 1395-e4a99912b8f83044.js} +13 -1
- package/.next/standalone/.next/static/chunks/app/_global-error/{page-36cb8b428b38b26a.js → page-6fc5f8e744c81802.js} +1 -1
- package/.next/standalone/.next/static/chunks/app/api/v1/access/[identity]/{route-36cb8b428b38b26a.js → route-6fc5f8e744c81802.js} +1 -1
- package/.next/standalone/.next/static/chunks/app/api/v1/access/{route-36cb8b428b38b26a.js → route-6fc5f8e744c81802.js} +1 -1
- package/.next/standalone/.next/static/chunks/app/api/v1/agents/[id]/compact/{route-36cb8b428b38b26a.js → route-6fc5f8e744c81802.js} +1 -1
- package/.next/standalone/.next/static/chunks/app/api/v1/agents/[id]/display-filters/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/agents/[id]/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/agents/[id]/thread/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/agents/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/allowed-sites/[hostname]/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/allowed-sites/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/artifacts/lifecycle/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/attachments/files/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/attachments/images/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/bridges/[id]/chats/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/bridges/[id]/ignores/[remote_jid]/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/bridges/[id]/ignores/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/bridges/[id]/lookup/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/bridges/[id]/pair/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/bridges/[id]/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/bridges/[id]/routes/[route_id]/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/bridges/[id]/routes/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/bridges/[id]/status/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/bridges/kinds/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/bridges/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/builtin-tools/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/config/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/credentials/[id]/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/credentials/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/dashboard/currency/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/dashboard/metrics/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/dashboard/pricing/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/dashboard/pricing-task/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/delegations/codex/[job_id]/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/documents/search/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/documents/settings/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/documents/sources/[id]/reindex/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/documents/sources/[id]/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/documents/sources/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/env/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/env-sync/allowlist/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/env-sync/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/events/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/events/test/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/extension/agents/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/extension/browser/activate/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/extension/browser/foreground/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/extension/browser/history/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/extension/browser/poll/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/extension/browser/progress/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/extension/browser/result/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/extension/browser/retry/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/extension/browser/status/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/extension/browser/tabs/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/extension/fill/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/extension/refine/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/extension/turn/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/extensions/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/extensions/tools/[name]/config/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/extensions/tools/[name]/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/extensions/tools/[name]/secrets/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/files/[name]/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/fs/browse/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/harnesses/[id]/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/harnesses/default/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/harnesses/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/health/probes/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/health/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/integrations/[name]/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/integrations/[name]/test/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/integrations/gmail/oauth/callback/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/integrations/gmail/oauth/start/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/integrations/gmail/oauth/status/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/integrations/outlook/oauth/callback/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/integrations/outlook/oauth/start/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/integrations/outlook/oauth/status/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/integrations/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/lifecycle/adoption/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/local-file/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/logs/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/maps/embed/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/mcp-servers/[name]/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/mcp-servers/registry/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/mcp-servers/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/memory/[namespace]/[key]/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/memory/policy/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/memory/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/memory/search/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/models/[name]/compact-threads/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/models/[name]/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/models/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/packages/catalog/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/packages/defaults/[id]/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/packages/install/[id]/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/packages/install/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/packages/manifests/[name]/enabled/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/packages/manifests/[name]/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/packages/manifests/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/packages/reload/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/packages/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/page-capture/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/pending-actions/[id]/approve/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/pending-actions/[id]/deny/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/pending-actions/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/profile/location/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/profile/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/providers/[provider]/models/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/providers/[provider]/probe/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/providers/github-copilot/auth/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/providers/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/proxy-config/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/redaction/init/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/redaction/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/scheduled-tasks/[id]/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/scheduled-tasks/[id]/run/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/scheduled-tasks/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/security/idle-timeout/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/security/pin/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/security/state/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/security/unlock/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/security/verify-pin/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/setup/test-key/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/skills/[id]/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/skills/repos/[id]/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/skills/repos/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/skills/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/system/abort/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/system/restart/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/tailscale/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/tasks/[agent_id]/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/tasks/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/threads/[thread_id]/activity/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/threads/[thread_id]/context-pin/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/threads/[thread_id]/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/threads/[thread_id]/run/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/threads/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/tools/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/update/apply/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/update/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/voice/transcribe/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/voice/tts/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/watchers/[id]/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/watchers/[id]/run/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/watchers/reaction-scripts/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/watchers/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/manifest.webmanifest/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/{page-7017f07f8a7a083c.js → page-04748847c6ff866f.js} +1013 -585
- package/.next/standalone/.next/static/chunks/next/dist/client/components/builtin/app-error-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/next/dist/client/components/builtin/forbidden-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/next/dist/client/components/builtin/not-found-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/next/dist/client/components/builtin/unauthorized-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/css/{d80058f0b9b41c09.css → 2669e8744cc8c212.css} +2 -2
- package/.next/standalone/docs/adoption/changesets.json +358 -0
- package/.next/standalone/lib/skills/builtins/memory-organization/SKILL.md +16 -0
- package/.next/standalone/package.json +3 -3
- package/CHANGELOG.md +44 -0
- package/api/client.ts +9 -0
- package/api/types.ts +29 -0
- package/app/api/v1/lifecycle/adoption/route.ts +14 -2
- package/app/api/v1/models/[name]/compact-threads/route.ts +14 -11
- package/app/api/v1/threads/[thread_id]/activity/route.ts +19 -0
- package/app/api/v1/threads/[thread_id]/context-pin/route.test.ts +1 -0
- package/app/api/v1/threads/[thread_id]/context-pin/route.ts +2 -1
- package/app/api/v1/threads/[thread_id]/route.ts +5 -1
- package/app/api/v1/threads/[thread_id]/run/route.ts +0 -1
- package/components/chat/ChatView.tsx +52 -11
- package/components/chat/ContextBoundary.test.tsx +68 -1
- package/components/chat/ContextBoundary.tsx +92 -13
- package/components/chat/MessageBubble.tsx +12 -0
- package/components/chat/MessageList.test.tsx +31 -0
- package/components/chat/MessageList.tsx +49 -28
- package/components/chat/ToolList.test.tsx +92 -16
- package/components/chat/ToolList.tsx +59 -4
- package/components/chat/chat-helpers.test.tsx +24 -1
- package/components/chat/chat-helpers.ts +47 -4
- package/components/chat/useThreadActivity.test.tsx +113 -0
- package/components/chat/useThreadActivity.ts +94 -0
- package/components/chat/useThreadData.ts +16 -16
- package/components/chat/workflow-step-retry.ts +25 -0
- package/components/integrations/NetworkSection.tsx +2 -2
- package/components/ui/BootScreen.tsx +17 -0
- package/components/ui/WorkflowChecklist.tsx +71 -33
- package/hooks/useSSE.ts +28 -3
- package/lib/agents/citation-checker.test.ts +40 -2
- package/lib/agents/citation-checker.ts +56 -11
- package/lib/agents/compaction-pipeline.test.ts +202 -0
- package/lib/agents/compaction-pipeline.ts +483 -0
- package/lib/agents/context-boundary.ts +5 -6
- package/lib/agents/conversation-summary.ts +37 -21
- package/lib/agents/instruction-edits.test.ts +120 -0
- package/lib/agents/instruction-edits.ts +65 -42
- package/lib/agents/prepare/history-window.test.ts +18 -0
- package/lib/agents/prepare/history-window.ts +11 -2
- package/lib/agents/prepare/request.ts +4 -2
- package/lib/agents/prepare/system-prompt.test.ts +49 -0
- package/lib/agents/prepare/system-prompt.ts +16 -5
- package/lib/agents/prompt-registry.test.ts +5 -140
- package/lib/agents/prompt-registry.ts +45 -1
- package/lib/agents/prompt-variants.ts +146 -0
- package/lib/agents/proposals.test.ts +76 -0
- package/lib/agents/proposals.ts +13 -5
- package/lib/agents/run-registry.test.ts +22 -0
- package/lib/agents/run-registry.ts +29 -0
- package/lib/agents/run-thread.auto-boundary.test.ts +125 -5
- package/lib/agents/run-thread.retry.test.ts +67 -1
- package/lib/agents/run-thread.ts +110 -10
- package/lib/agents/sqlite-checkpoint-saver.test.ts +91 -0
- package/lib/agents/thread-activity.test.ts +31 -0
- package/lib/agents/thread-activity.ts +27 -0
- package/lib/agents/thread-compaction-state.test.ts +82 -0
- package/lib/agents/thread-compaction-state.ts +121 -0
- package/lib/agents/thread-compaction.test.ts +83 -4
- package/lib/agents/thread-compaction.ts +34 -11
- package/lib/agents/warm-summary-background.test.ts +219 -5
- package/lib/agents/warm-summary-background.ts +346 -143
- package/lib/agents/warm-topics.test.ts +191 -0
- package/lib/agents/warm-topics.ts +317 -0
- package/lib/agents/workflow-step-retry.test.ts +96 -0
- package/lib/agents/workflow-step-retry.ts +216 -0
- package/lib/api/browser-control.ts +0 -3
- package/lib/bridges/dispatcher.ts +1 -0
- package/lib/bridges/message-role.test.ts +81 -0
- package/lib/bridges/message-role.ts +23 -10
- package/lib/bridges/types.ts +6 -0
- package/lib/bridges/whatsapp-link.test.ts +32 -0
- package/lib/bridges/whatsapp-link.ts +21 -0
- package/lib/bridges/whatsapp.inbound.test.ts +239 -0
- package/lib/bridges/whatsapp.sender.test.ts +80 -1
- package/lib/bridges/whatsapp.ts +76 -38
- package/lib/db/migrations.ts +5 -0
- package/lib/env/config.ts +2 -0
- package/lib/env/schema.ts +12 -0
- package/lib/lifecycle/changeset-build.test.ts +93 -0
- package/lib/lifecycle/changeset-build.ts +210 -0
- package/lib/lifecycle/changesets.test.ts +101 -0
- package/lib/lifecycle/changesets.ts +166 -0
- package/lib/lifecycle/surface-collect.test.ts +88 -0
- package/lib/lifecycle/surface-collect.ts +64 -0
- package/lib/lifecycle/surface-snapshot.test.ts +104 -0
- package/lib/lifecycle/surface-snapshot.ts +210 -0
- package/lib/memory/record.ts +0 -2
- package/lib/pricing/snapshot.test.ts +70 -0
- package/lib/pricing/snapshot.ts +10 -2
- package/lib/providers/external.ts +0 -2
- package/lib/proxy/dispatcher.test.ts +119 -1
- package/lib/proxy/dispatcher.ts +22 -9
- package/lib/skills/builtins/memory-organization/SKILL.md +16 -0
- package/lib/stores/agent-configs.ts +10 -5
- package/lib/stores/bridges.test.ts +81 -0
- package/lib/stores/bridges.ts +9 -8
- package/lib/stores/proxy-config.test.ts +120 -0
- package/lib/stores/proxy-config.ts +22 -4
- package/lib/stores/threads.test.ts +9 -0
- package/lib/stores/threads.ts +33 -19
- package/lib/stores/version-adoption.test.ts +96 -0
- package/lib/stores/version-adoption.ts +239 -26
- package/lib/stores/workflow-progress.ts +3 -0
- package/lib/tools/communications/calendar.test.ts +43 -2
- package/lib/tools/communications/calendar.ts +2 -0
- package/lib/tools/communications/gmail.test.ts +51 -1
- package/lib/tools/communications/gmail.ts +44 -2
- package/lib/tools/communications/ms-todo.ts +0 -7
- package/lib/tools/communications/outlook-calendar.ts +2 -0
- package/lib/tools/communications/outlook.test.ts +33 -2
- package/lib/tools/communications/outlook.ts +2 -0
- package/lib/tools/filesystem/edit-match.test.ts +133 -0
- package/lib/tools/filesystem/edit-match.ts +7 -2
- package/lib/tools/general/memory.ts +1 -1
- package/lib/tools/general/workflow-progress.ts +2 -0
- package/lib/tools/runtime/catalog.ts +1 -25
- package/lib/tools/support/result-refs.test.ts +131 -0
- package/lib/tools/support/result-refs.ts +41 -9
- package/lib/triggers/registry.ts +0 -4
- package/lib/utils/source-link.test.ts +51 -0
- package/lib/utils/source-link.ts +45 -0
- package/package.json +3 -3
- package/scripts/install-to-system.ps1 +39 -11
- package/scripts/install-to-system.sh +37 -3
- package/.next/standalone/.next/server/chunks/3979.js +0 -581
- package/.next/standalone/.next/server/chunks/5936.js +0 -594
- package/.next/standalone/.next/static/chunks/app/api/v1/agents/[id]/display-filters/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/agents/[id]/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/agents/[id]/thread/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/agents/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/allowed-sites/[hostname]/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/allowed-sites/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/artifacts/lifecycle/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/attachments/files/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/attachments/images/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/bridges/[id]/chats/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/bridges/[id]/ignores/[remote_jid]/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/bridges/[id]/ignores/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/bridges/[id]/lookup/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/bridges/[id]/pair/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/bridges/[id]/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/bridges/[id]/routes/[route_id]/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/bridges/[id]/routes/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/bridges/[id]/status/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/bridges/kinds/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/bridges/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/builtin-tools/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/config/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/credentials/[id]/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/credentials/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/dashboard/currency/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/dashboard/metrics/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/dashboard/pricing/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/dashboard/pricing-task/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/delegations/codex/[job_id]/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/documents/search/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/documents/settings/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/documents/sources/[id]/reindex/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/documents/sources/[id]/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/documents/sources/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/env/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/env-sync/allowlist/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/env-sync/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/events/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/events/test/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/extension/agents/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/extension/browser/activate/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/extension/browser/foreground/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/extension/browser/history/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/extension/browser/poll/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/extension/browser/progress/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/extension/browser/result/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/extension/browser/retry/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/extension/browser/status/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/extension/browser/tabs/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/extension/fill/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/extension/refine/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/extension/turn/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/extensions/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/extensions/tools/[name]/config/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/extensions/tools/[name]/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/extensions/tools/[name]/secrets/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/files/[name]/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/fs/browse/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/harnesses/[id]/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/harnesses/default/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/harnesses/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/health/probes/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/health/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/integrations/[name]/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/integrations/[name]/test/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/integrations/gmail/oauth/callback/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/integrations/gmail/oauth/start/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/integrations/gmail/oauth/status/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/integrations/outlook/oauth/callback/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/integrations/outlook/oauth/start/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/integrations/outlook/oauth/status/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/integrations/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/lifecycle/adoption/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/local-file/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/logs/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/maps/embed/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/mcp-servers/[name]/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/mcp-servers/registry/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/mcp-servers/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/memory/[namespace]/[key]/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/memory/policy/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/memory/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/memory/search/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/models/[name]/compact-threads/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/models/[name]/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/models/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/packages/catalog/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/packages/defaults/[id]/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/packages/install/[id]/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/packages/install/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/packages/manifests/[name]/enabled/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/packages/manifests/[name]/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/packages/manifests/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/packages/reload/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/packages/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/page-capture/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/pending-actions/[id]/approve/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/pending-actions/[id]/deny/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/pending-actions/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/profile/location/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/profile/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/providers/[provider]/models/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/providers/[provider]/probe/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/providers/github-copilot/auth/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/providers/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/proxy-config/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/redaction/init/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/redaction/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/scheduled-tasks/[id]/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/scheduled-tasks/[id]/run/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/scheduled-tasks/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/security/idle-timeout/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/security/pin/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/security/state/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/security/unlock/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/security/verify-pin/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/setup/test-key/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/skills/[id]/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/skills/repos/[id]/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/skills/repos/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/skills/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/system/abort/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/system/restart/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/tailscale/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/tasks/[agent_id]/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/tasks/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/threads/[thread_id]/context-pin/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/threads/[thread_id]/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/threads/[thread_id]/run/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/threads/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/tools/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/update/apply/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/update/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/voice/transcribe/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/voice/tts/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/watchers/[id]/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/watchers/[id]/run/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/watchers/reaction-scripts/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/watchers/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/manifest.webmanifest/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/next/dist/client/components/builtin/app-error-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/next/dist/client/components/builtin/forbidden-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/next/dist/client/components/builtin/not-found-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/next/dist/client/components/builtin/unauthorized-36cb8b428b38b26a.js +0 -17
- /package/.next/standalone/.next/static/{NUrC9xax1sp1Q70nlFqS6 → hwujW4hR1b-r3k5WdMxZO}/_buildManifest.js +0 -0
- /package/.next/standalone/.next/static/{NUrC9xax1sp1Q70nlFqS6 → hwujW4hR1b-r3k5WdMxZO}/_ssgManifest.js +0 -0
|
@@ -0,0 +1,963 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
exports.id = 5120;
|
|
3
|
+
exports.ids = [3944,5120];
|
|
4
|
+
exports.modules = {
|
|
5
|
+
|
|
6
|
+
/***/ 3944:
|
|
7
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
8
|
+
|
|
9
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
10
|
+
/* harmony export */ M6: () => (/* binding */ enqueueThreadRun),
|
|
11
|
+
/* harmony export */ Zm: () => (/* binding */ QueueFullError),
|
|
12
|
+
/* harmony export */ getQueueDepth: () => (/* binding */ getQueueDepth),
|
|
13
|
+
/* harmony export */ vR: () => (/* binding */ QueueExpiredError)
|
|
14
|
+
/* harmony export */ });
|
|
15
|
+
/* unused harmony export __resetForTests */
|
|
16
|
+
/* harmony import */ var _lib_utils_global_state__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(15559);
|
|
17
|
+
// Per-thread priority queue for agent runs.
|
|
18
|
+
//
|
|
19
|
+
// A thread can have one active run. Waiting interactive runs are selected
|
|
20
|
+
// before waiting background runs, while FIFO order is preserved within each
|
|
21
|
+
// lane. Different threads drain independently.
|
|
22
|
+
//
|
|
23
|
+
// In-memory + single-process. Multi-instance deployment would need a shared
|
|
24
|
+
// lock (Redis, Postgres advisory locks) — explicitly out of scope.
|
|
25
|
+
|
|
26
|
+
const queues = (0,_lib_utils_global_state__WEBPACK_IMPORTED_MODULE_0__/* .getOrCreateGlobal */ .X)("__jarela_thread_run_queues", ()=>new Map());
|
|
27
|
+
const DEFAULT_MAX_DEPTH = 16;
|
|
28
|
+
const sourceLanes = {
|
|
29
|
+
user: "interactive",
|
|
30
|
+
bridge: "interactive",
|
|
31
|
+
delegate: "interactive",
|
|
32
|
+
scheduler: "background",
|
|
33
|
+
watcher: "background",
|
|
34
|
+
trigger: "background",
|
|
35
|
+
extension: "background"
|
|
36
|
+
};
|
|
37
|
+
class QueueFullError extends Error {
|
|
38
|
+
constructor(thread_id, depth){
|
|
39
|
+
super(`Per-thread run queue full for thread ${thread_id} (depth=${depth})`);
|
|
40
|
+
this.name = "QueueFullError";
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
class QueueExpiredError extends Error {
|
|
44
|
+
constructor(thread_id, expiresAt){
|
|
45
|
+
super(`Queued run expired for thread ${thread_id} at ${expiresAt}`);
|
|
46
|
+
this.name = "QueueExpiredError";
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
function depth(queue) {
|
|
50
|
+
return (queue.active ? 1 : 0) + queue.interactive.length + queue.background.length;
|
|
51
|
+
}
|
|
52
|
+
function drain(thread_id, queue) {
|
|
53
|
+
if (queue.active) return;
|
|
54
|
+
const job = queue.interactive.shift() ?? queue.background.shift();
|
|
55
|
+
if (!job) {
|
|
56
|
+
if (queues.get(thread_id) === queue) queues.delete(thread_id);
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
queue.active = job;
|
|
60
|
+
Promise.resolve().then(()=>{
|
|
61
|
+
if (job.expiresAt !== undefined && Date.now() >= job.expiresAt) {
|
|
62
|
+
throw new QueueExpiredError(thread_id, job.expiresAt);
|
|
63
|
+
}
|
|
64
|
+
return job.runner();
|
|
65
|
+
}).then((value)=>{
|
|
66
|
+
finish(thread_id, queue);
|
|
67
|
+
job.resolve(value);
|
|
68
|
+
}, (error)=>{
|
|
69
|
+
finish(thread_id, queue);
|
|
70
|
+
job.reject(error);
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
function finish(thread_id, queue) {
|
|
74
|
+
queue.active = undefined;
|
|
75
|
+
if (queues.get(thread_id) === queue) drain(thread_id, queue);
|
|
76
|
+
}
|
|
77
|
+
function enqueueThreadRun(thread_id, source, runner, options = {}) {
|
|
78
|
+
const queue = queues.get(thread_id) ?? {
|
|
79
|
+
interactive: [],
|
|
80
|
+
background: []
|
|
81
|
+
};
|
|
82
|
+
const currentDepth = depth(queue);
|
|
83
|
+
const max = options.maxDepth ?? DEFAULT_MAX_DEPTH;
|
|
84
|
+
if (currentDepth >= max) {
|
|
85
|
+
throw new QueueFullError(thread_id, currentDepth);
|
|
86
|
+
}
|
|
87
|
+
const lane = options.lane ?? sourceLanes[source];
|
|
88
|
+
const position = queue.active ? 1 + queue.interactive.length + (lane === "background" ? queue.background.length : 0) : queue.interactive.length + (lane === "background" ? queue.background.length : 0);
|
|
89
|
+
let resolve;
|
|
90
|
+
let reject;
|
|
91
|
+
const result = new Promise((res, rej)=>{
|
|
92
|
+
resolve = res;
|
|
93
|
+
reject = rej;
|
|
94
|
+
});
|
|
95
|
+
const job = {
|
|
96
|
+
runner,
|
|
97
|
+
expiresAt: options.expiresAt,
|
|
98
|
+
resolve,
|
|
99
|
+
reject
|
|
100
|
+
};
|
|
101
|
+
queue[lane].push(job);
|
|
102
|
+
queues.set(thread_id, queue);
|
|
103
|
+
drain(thread_id, queue);
|
|
104
|
+
return {
|
|
105
|
+
result,
|
|
106
|
+
position
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
/** Current queue depth for a thread, including the active job. */ function getQueueDepth(thread_id) {
|
|
110
|
+
const queue = queues.get(thread_id);
|
|
111
|
+
return queue ? depth(queue) : 0;
|
|
112
|
+
}
|
|
113
|
+
/** Reset all queue state. Test-only — never call from production code. */ function __resetForTests() {
|
|
114
|
+
queues.clear();
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
/***/ }),
|
|
119
|
+
|
|
120
|
+
/***/ 62174:
|
|
121
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
122
|
+
|
|
123
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
124
|
+
/* harmony export */ $V: () => (/* binding */ getLatestMessageUsageForThread),
|
|
125
|
+
/* harmony export */ kw: () => (/* binding */ getMessageUsageByIds),
|
|
126
|
+
/* harmony export */ up: () => (/* binding */ recordMessageUsage)
|
|
127
|
+
/* harmony export */ });
|
|
128
|
+
/* harmony import */ var _lib_db__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(46);
|
|
129
|
+
// ADR-0041. Immutable per-assistant-turn snapshot of LLM usage.
|
|
130
|
+
//
|
|
131
|
+
// Written once when an assistant turn is persisted (see
|
|
132
|
+
// `persistAssistantMessage` in lib/agents/run-thread.ts). Never updated.
|
|
133
|
+
// The dashboard reads this table in preference to recomputing tokens /
|
|
134
|
+
// cost from `messages.content` + current agent_configs joins.
|
|
135
|
+
|
|
136
|
+
function recordMessageUsage(input) {
|
|
137
|
+
const db = (0,_lib_db__WEBPACK_IMPORTED_MODULE_0__/* .getDb */ .Lf)();
|
|
138
|
+
const t = input.tier_usage ?? null;
|
|
139
|
+
db.prepare(`INSERT OR IGNORE INTO message_usage (
|
|
140
|
+
message_id, thread_id, agent_id, agent_name, provider, model_id,
|
|
141
|
+
model_config_name, input_tokens, output_tokens,
|
|
142
|
+
input_rate_usd_per_mtok, output_rate_usd_per_mtok, cost_usd, created_at,
|
|
143
|
+
hot_tokens, warm_tokens, facts_tokens, overhead_tokens,
|
|
144
|
+
hot_budget_tokens, warm_budget_tokens, facts_budget_tokens, context_window_tokens,
|
|
145
|
+
cache_creation_input_tokens, cache_read_input_tokens, thinking_tokens
|
|
146
|
+
) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)`).run(input.message_id, input.thread_id, input.agent_id, input.agent_name, input.provider, input.model_id, input.model_config_name, input.input_tokens, input.output_tokens, input.input_rate_usd_per_mtok, input.output_rate_usd_per_mtok, input.cost_usd, new Date().toISOString(), t?.hot_tokens ?? null, t?.warm_tokens ?? null, t?.facts_tokens ?? null, t?.overhead_tokens ?? null, t?.hot_budget_tokens ?? null, t?.warm_budget_tokens ?? null, t?.facts_budget_tokens ?? null, t?.context_window_tokens ?? null, input.cache_creation_input_tokens ?? null, input.cache_read_input_tokens ?? null, input.thinking_tokens ?? null);
|
|
147
|
+
}
|
|
148
|
+
function getMessageUsageByIds(messageIds) {
|
|
149
|
+
const out = new Map();
|
|
150
|
+
if (messageIds.length === 0) return out;
|
|
151
|
+
const placeholders = messageIds.map(()=>"?").join(",");
|
|
152
|
+
const rows = (0,_lib_db__WEBPACK_IMPORTED_MODULE_0__/* .getDb */ .Lf)().prepare(`SELECT * FROM message_usage WHERE message_id IN (${placeholders})`).all(...messageIds);
|
|
153
|
+
for (const row of rows)out.set(row.message_id, row);
|
|
154
|
+
return out;
|
|
155
|
+
}
|
|
156
|
+
function getLatestMessageUsageForThread(threadId) {
|
|
157
|
+
return (0,_lib_db__WEBPACK_IMPORTED_MODULE_0__/* .getDb */ .Lf)().prepare("SELECT * FROM message_usage WHERE thread_id=? ORDER BY created_at DESC LIMIT 1").get(threadId) ?? null;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
|
|
161
|
+
/***/ }),
|
|
162
|
+
|
|
163
|
+
/***/ 66963:
|
|
164
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
165
|
+
|
|
166
|
+
|
|
167
|
+
// EXPORTS
|
|
168
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
169
|
+
w: () => (/* binding */ getCheckpointer)
|
|
170
|
+
});
|
|
171
|
+
|
|
172
|
+
// EXTERNAL MODULE: external "node:path"
|
|
173
|
+
var external_node_path_ = __webpack_require__(76760);
|
|
174
|
+
// EXTERNAL MODULE: ./lib/db/data-dir.ts
|
|
175
|
+
var data_dir = __webpack_require__(57477);
|
|
176
|
+
// EXTERNAL MODULE: external "node:sqlite"
|
|
177
|
+
var external_node_sqlite_ = __webpack_require__(80099);
|
|
178
|
+
// EXTERNAL MODULE: ./node_modules/@langchain/langgraph-checkpoint/dist/index.js + 86 modules
|
|
179
|
+
var dist = __webpack_require__(8808);
|
|
180
|
+
;// ./lib/agents/sqlite-checkpoint-saver.ts
|
|
181
|
+
|
|
182
|
+
|
|
183
|
+
// In-tree LangGraph checkpoint saver backed by node:sqlite.
|
|
184
|
+
//
|
|
185
|
+
// Schema-compatible drop-in replacement for SqliteSaver from
|
|
186
|
+
// @langchain/langgraph-checkpoint-sqlite. The DDL is byte-identical so an
|
|
187
|
+
// existing checkpoints.db keeps working without migration.
|
|
188
|
+
const VALID_FILTER_KEYS = [
|
|
189
|
+
"source",
|
|
190
|
+
"step",
|
|
191
|
+
"parents"
|
|
192
|
+
];
|
|
193
|
+
function buildLatestSelect(includeCheckpointId) {
|
|
194
|
+
return `
|
|
195
|
+
SELECT
|
|
196
|
+
thread_id,
|
|
197
|
+
checkpoint_ns,
|
|
198
|
+
checkpoint_id,
|
|
199
|
+
parent_checkpoint_id,
|
|
200
|
+
type,
|
|
201
|
+
checkpoint,
|
|
202
|
+
metadata,
|
|
203
|
+
(
|
|
204
|
+
SELECT
|
|
205
|
+
json_group_array(
|
|
206
|
+
json_object(
|
|
207
|
+
'task_id', pw.task_id,
|
|
208
|
+
'channel', pw.channel,
|
|
209
|
+
'type', pw.type,
|
|
210
|
+
'value', CAST(pw.value AS TEXT)
|
|
211
|
+
)
|
|
212
|
+
)
|
|
213
|
+
FROM writes as pw
|
|
214
|
+
WHERE pw.thread_id = checkpoints.thread_id
|
|
215
|
+
AND pw.checkpoint_ns = checkpoints.checkpoint_ns
|
|
216
|
+
AND pw.checkpoint_id = checkpoints.checkpoint_id
|
|
217
|
+
) as pending_writes,
|
|
218
|
+
(
|
|
219
|
+
SELECT
|
|
220
|
+
json_group_array(
|
|
221
|
+
json_object(
|
|
222
|
+
'type', ps.type,
|
|
223
|
+
'value', CAST(ps.value AS TEXT)
|
|
224
|
+
)
|
|
225
|
+
)
|
|
226
|
+
FROM writes as ps
|
|
227
|
+
WHERE ps.thread_id = checkpoints.thread_id
|
|
228
|
+
AND ps.checkpoint_ns = checkpoints.checkpoint_ns
|
|
229
|
+
AND ps.checkpoint_id = checkpoints.parent_checkpoint_id
|
|
230
|
+
AND ps.channel = '${dist/* TASKS */.n3}'
|
|
231
|
+
ORDER BY ps.idx
|
|
232
|
+
) as pending_sends
|
|
233
|
+
FROM checkpoints
|
|
234
|
+
WHERE thread_id = ? AND checkpoint_ns = ? ${includeCheckpointId ? "AND checkpoint_id = ?" : "ORDER BY checkpoint_id DESC LIMIT 1"}`;
|
|
235
|
+
}
|
|
236
|
+
// node:sqlite rejects `undefined` parameter binds; coerce to null.
|
|
237
|
+
function nv(v) {
|
|
238
|
+
return v === undefined ? null : v;
|
|
239
|
+
}
|
|
240
|
+
class NodeSqliteSaver extends dist/* BaseCheckpointSaver */.R1 {
|
|
241
|
+
constructor(db, serde){
|
|
242
|
+
super(serde), this.isSetup = false;
|
|
243
|
+
this.db = db;
|
|
244
|
+
}
|
|
245
|
+
static fromConnString(connStringOrLocalPath) {
|
|
246
|
+
return new NodeSqliteSaver(new external_node_sqlite_.DatabaseSync(connStringOrLocalPath));
|
|
247
|
+
}
|
|
248
|
+
setup() {
|
|
249
|
+
if (this.isSetup) return;
|
|
250
|
+
this.db.exec("PRAGMA journal_mode=WAL");
|
|
251
|
+
this.db.exec(`
|
|
252
|
+
CREATE TABLE IF NOT EXISTS checkpoints (
|
|
253
|
+
thread_id TEXT NOT NULL,
|
|
254
|
+
checkpoint_ns TEXT NOT NULL DEFAULT '',
|
|
255
|
+
checkpoint_id TEXT NOT NULL,
|
|
256
|
+
parent_checkpoint_id TEXT,
|
|
257
|
+
type TEXT,
|
|
258
|
+
checkpoint BLOB,
|
|
259
|
+
metadata BLOB,
|
|
260
|
+
PRIMARY KEY (thread_id, checkpoint_ns, checkpoint_id)
|
|
261
|
+
);`);
|
|
262
|
+
this.db.exec(`
|
|
263
|
+
CREATE TABLE IF NOT EXISTS writes (
|
|
264
|
+
thread_id TEXT NOT NULL,
|
|
265
|
+
checkpoint_ns TEXT NOT NULL DEFAULT '',
|
|
266
|
+
checkpoint_id TEXT NOT NULL,
|
|
267
|
+
task_id TEXT NOT NULL,
|
|
268
|
+
idx INTEGER NOT NULL,
|
|
269
|
+
channel TEXT NOT NULL,
|
|
270
|
+
type TEXT,
|
|
271
|
+
value BLOB,
|
|
272
|
+
PRIMARY KEY (thread_id, checkpoint_ns, checkpoint_id, task_id, idx)
|
|
273
|
+
);`);
|
|
274
|
+
this.withoutCheckpoint = this.db.prepare(buildLatestSelect(false));
|
|
275
|
+
this.withCheckpoint = this.db.prepare(buildLatestSelect(true));
|
|
276
|
+
this.isSetup = true;
|
|
277
|
+
}
|
|
278
|
+
txn(fn) {
|
|
279
|
+
this.db.exec("BEGIN");
|
|
280
|
+
try {
|
|
281
|
+
const result = fn();
|
|
282
|
+
this.db.exec("COMMIT");
|
|
283
|
+
return result;
|
|
284
|
+
} catch (err) {
|
|
285
|
+
try {
|
|
286
|
+
this.db.exec("ROLLBACK");
|
|
287
|
+
} catch {
|
|
288
|
+
// ignore rollback failure; surface the original error
|
|
289
|
+
}
|
|
290
|
+
throw err;
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
async decodeRowState(row) {
|
|
294
|
+
const pendingWrites = await Promise.all(JSON.parse(String(row.pending_writes ?? "[]")).map(async (write)=>{
|
|
295
|
+
return [
|
|
296
|
+
write.task_id,
|
|
297
|
+
write.channel,
|
|
298
|
+
await this.serde.loadsTyped(write.type ?? "json", write.value ?? "")
|
|
299
|
+
];
|
|
300
|
+
}));
|
|
301
|
+
const checkpoint = await this.serde.loadsTyped(row.type ?? "json", row.checkpoint);
|
|
302
|
+
if (checkpoint.v < 4 && row.parent_checkpoint_id != null) {
|
|
303
|
+
await this.migratePendingSends(checkpoint, row.thread_id, row.parent_checkpoint_id);
|
|
304
|
+
}
|
|
305
|
+
const metadata = await this.serde.loadsTyped(row.type ?? "json", row.metadata);
|
|
306
|
+
return {
|
|
307
|
+
pendingWrites,
|
|
308
|
+
checkpoint,
|
|
309
|
+
metadata
|
|
310
|
+
};
|
|
311
|
+
}
|
|
312
|
+
async getTuple(config) {
|
|
313
|
+
this.setup();
|
|
314
|
+
const { thread_id, checkpoint_ns = "", checkpoint_id } = config.configurable ?? {};
|
|
315
|
+
const args = [
|
|
316
|
+
nv(thread_id),
|
|
317
|
+
checkpoint_ns
|
|
318
|
+
];
|
|
319
|
+
if (checkpoint_id) args.push(checkpoint_id);
|
|
320
|
+
const stmt = checkpoint_id ? this.withCheckpoint : this.withoutCheckpoint;
|
|
321
|
+
const row = stmt.get(...args);
|
|
322
|
+
if (row === undefined) return undefined;
|
|
323
|
+
let finalConfig = config;
|
|
324
|
+
if (!checkpoint_id) {
|
|
325
|
+
finalConfig = {
|
|
326
|
+
configurable: {
|
|
327
|
+
thread_id: row.thread_id,
|
|
328
|
+
checkpoint_ns,
|
|
329
|
+
checkpoint_id: row.checkpoint_id
|
|
330
|
+
}
|
|
331
|
+
};
|
|
332
|
+
}
|
|
333
|
+
if (finalConfig.configurable?.thread_id === undefined || finalConfig.configurable?.checkpoint_id === undefined) {
|
|
334
|
+
throw new Error("Missing thread_id or checkpoint_id");
|
|
335
|
+
}
|
|
336
|
+
const { pendingWrites, checkpoint, metadata } = await this.decodeRowState(row);
|
|
337
|
+
return {
|
|
338
|
+
checkpoint,
|
|
339
|
+
config: finalConfig,
|
|
340
|
+
metadata,
|
|
341
|
+
parentConfig: row.parent_checkpoint_id ? {
|
|
342
|
+
configurable: {
|
|
343
|
+
thread_id: row.thread_id,
|
|
344
|
+
checkpoint_ns,
|
|
345
|
+
checkpoint_id: row.parent_checkpoint_id
|
|
346
|
+
}
|
|
347
|
+
} : undefined,
|
|
348
|
+
pendingWrites
|
|
349
|
+
};
|
|
350
|
+
}
|
|
351
|
+
async *list(config, options) {
|
|
352
|
+
const { limit, before, filter } = options ?? {};
|
|
353
|
+
this.setup();
|
|
354
|
+
const thread_id = config.configurable?.thread_id;
|
|
355
|
+
const checkpoint_ns = config.configurable?.checkpoint_ns;
|
|
356
|
+
let sql = `
|
|
357
|
+
SELECT
|
|
358
|
+
thread_id,
|
|
359
|
+
checkpoint_ns,
|
|
360
|
+
checkpoint_id,
|
|
361
|
+
parent_checkpoint_id,
|
|
362
|
+
type,
|
|
363
|
+
checkpoint,
|
|
364
|
+
metadata,
|
|
365
|
+
(
|
|
366
|
+
SELECT
|
|
367
|
+
json_group_array(
|
|
368
|
+
json_object(
|
|
369
|
+
'task_id', pw.task_id,
|
|
370
|
+
'channel', pw.channel,
|
|
371
|
+
'type', pw.type,
|
|
372
|
+
'value', CAST(pw.value AS TEXT)
|
|
373
|
+
)
|
|
374
|
+
)
|
|
375
|
+
FROM writes as pw
|
|
376
|
+
WHERE pw.thread_id = checkpoints.thread_id
|
|
377
|
+
AND pw.checkpoint_ns = checkpoints.checkpoint_ns
|
|
378
|
+
AND pw.checkpoint_id = checkpoints.checkpoint_id
|
|
379
|
+
) as pending_writes,
|
|
380
|
+
(
|
|
381
|
+
SELECT
|
|
382
|
+
json_group_array(
|
|
383
|
+
json_object(
|
|
384
|
+
'type', ps.type,
|
|
385
|
+
'value', CAST(ps.value AS TEXT)
|
|
386
|
+
)
|
|
387
|
+
)
|
|
388
|
+
FROM writes as ps
|
|
389
|
+
WHERE ps.thread_id = checkpoints.thread_id
|
|
390
|
+
AND ps.checkpoint_ns = checkpoints.checkpoint_ns
|
|
391
|
+
AND ps.checkpoint_id = checkpoints.parent_checkpoint_id
|
|
392
|
+
AND ps.channel = '${dist/* TASKS */.n3}'
|
|
393
|
+
ORDER BY ps.idx
|
|
394
|
+
) as pending_sends
|
|
395
|
+
FROM checkpoints\n`;
|
|
396
|
+
const whereClause = [];
|
|
397
|
+
if (thread_id !== undefined && thread_id !== null) whereClause.push("thread_id = ?");
|
|
398
|
+
if (checkpoint_ns !== undefined && checkpoint_ns !== null) {
|
|
399
|
+
whereClause.push("checkpoint_ns = ?");
|
|
400
|
+
}
|
|
401
|
+
if (before?.configurable?.checkpoint_id !== undefined) {
|
|
402
|
+
whereClause.push("checkpoint_id < ?");
|
|
403
|
+
}
|
|
404
|
+
const sanitizedFilter = Object.fromEntries(Object.entries(filter ?? {}).filter(([key, value])=>value !== undefined && VALID_FILTER_KEYS.includes(key)));
|
|
405
|
+
whereClause.push(...Object.entries(sanitizedFilter).map(([key])=>`jsonb(CAST(metadata AS TEXT))->'$.${key}' = ?`));
|
|
406
|
+
if (whereClause.length > 0) sql += `WHERE\n ${whereClause.join(" AND\n ")}\n`;
|
|
407
|
+
sql += "\nORDER BY checkpoint_id DESC";
|
|
408
|
+
if (limit) sql += ` LIMIT ${parseInt(String(limit), 10)}`;
|
|
409
|
+
const args = [
|
|
410
|
+
thread_id,
|
|
411
|
+
checkpoint_ns,
|
|
412
|
+
before?.configurable?.checkpoint_id,
|
|
413
|
+
...Object.values(sanitizedFilter).map((value)=>JSON.stringify(value))
|
|
414
|
+
].filter((value)=>value !== undefined && value !== null);
|
|
415
|
+
const rows = this.db.prepare(sql).all(...args);
|
|
416
|
+
for (const row of rows){
|
|
417
|
+
const { pendingWrites, checkpoint, metadata } = await this.decodeRowState(row);
|
|
418
|
+
yield {
|
|
419
|
+
config: {
|
|
420
|
+
configurable: {
|
|
421
|
+
thread_id: row.thread_id,
|
|
422
|
+
checkpoint_ns: row.checkpoint_ns,
|
|
423
|
+
checkpoint_id: row.checkpoint_id
|
|
424
|
+
}
|
|
425
|
+
},
|
|
426
|
+
checkpoint,
|
|
427
|
+
metadata,
|
|
428
|
+
parentConfig: row.parent_checkpoint_id ? {
|
|
429
|
+
configurable: {
|
|
430
|
+
thread_id: row.thread_id,
|
|
431
|
+
checkpoint_ns: row.checkpoint_ns,
|
|
432
|
+
checkpoint_id: row.parent_checkpoint_id
|
|
433
|
+
}
|
|
434
|
+
} : undefined,
|
|
435
|
+
pendingWrites
|
|
436
|
+
};
|
|
437
|
+
}
|
|
438
|
+
}
|
|
439
|
+
async put(config, checkpoint, metadata) {
|
|
440
|
+
this.setup();
|
|
441
|
+
if (!config.configurable) throw new Error("Empty configuration supplied.");
|
|
442
|
+
const thread_id = config.configurable?.thread_id;
|
|
443
|
+
const checkpoint_ns = config.configurable?.checkpoint_ns ?? "";
|
|
444
|
+
const parent_checkpoint_id = config.configurable?.checkpoint_id;
|
|
445
|
+
if (!thread_id) {
|
|
446
|
+
throw new Error(`Missing "thread_id" field in passed "config.configurable".`);
|
|
447
|
+
}
|
|
448
|
+
const preparedCheckpoint = (0,dist/* copyCheckpoint */.IE)(checkpoint);
|
|
449
|
+
const [[type1, serializedCheckpoint], [type2, serializedMetadata]] = await Promise.all([
|
|
450
|
+
this.serde.dumpsTyped(preparedCheckpoint),
|
|
451
|
+
this.serde.dumpsTyped(metadata)
|
|
452
|
+
]);
|
|
453
|
+
if (type1 !== type2) {
|
|
454
|
+
throw new Error("Failed to serialized checkpoint and metadata to the same type.");
|
|
455
|
+
}
|
|
456
|
+
this.db.prepare(`INSERT OR REPLACE INTO checkpoints (thread_id, checkpoint_ns, checkpoint_id, parent_checkpoint_id, type, checkpoint, metadata) VALUES (?, ?, ?, ?, ?, ?, ?)`).run(thread_id, checkpoint_ns, checkpoint.id, nv(parent_checkpoint_id), type1, serializedCheckpoint, serializedMetadata);
|
|
457
|
+
return {
|
|
458
|
+
configurable: {
|
|
459
|
+
thread_id,
|
|
460
|
+
checkpoint_ns,
|
|
461
|
+
checkpoint_id: checkpoint.id
|
|
462
|
+
}
|
|
463
|
+
};
|
|
464
|
+
}
|
|
465
|
+
async putWrites(config, writes, taskId) {
|
|
466
|
+
this.setup();
|
|
467
|
+
if (!config.configurable) throw new Error("Empty configuration supplied.");
|
|
468
|
+
if (!config.configurable?.thread_id) {
|
|
469
|
+
throw new Error("Missing thread_id field in config.configurable.");
|
|
470
|
+
}
|
|
471
|
+
if (!config.configurable?.checkpoint_id) {
|
|
472
|
+
throw new Error("Missing checkpoint_id field in config.configurable.");
|
|
473
|
+
}
|
|
474
|
+
const stmt = this.db.prepare(`
|
|
475
|
+
INSERT OR REPLACE INTO writes
|
|
476
|
+
(thread_id, checkpoint_ns, checkpoint_id, task_id, idx, channel, type, value)
|
|
477
|
+
VALUES (?, ?, ?, ?, ?, ?, ?, ?)
|
|
478
|
+
`);
|
|
479
|
+
const rows = await Promise.all(writes.map(async (write, idx)=>{
|
|
480
|
+
const [type, serializedWrite] = await this.serde.dumpsTyped(write[1]);
|
|
481
|
+
return [
|
|
482
|
+
config.configurable?.thread_id,
|
|
483
|
+
config.configurable?.checkpoint_ns ?? "",
|
|
484
|
+
config.configurable?.checkpoint_id,
|
|
485
|
+
taskId,
|
|
486
|
+
idx,
|
|
487
|
+
write[0],
|
|
488
|
+
type,
|
|
489
|
+
serializedWrite
|
|
490
|
+
];
|
|
491
|
+
}));
|
|
492
|
+
this.txn(()=>{
|
|
493
|
+
for (const row of rows)stmt.run(...row);
|
|
494
|
+
});
|
|
495
|
+
}
|
|
496
|
+
async deleteThread(threadId) {
|
|
497
|
+
this.setup();
|
|
498
|
+
this.txn(()=>{
|
|
499
|
+
this.db.prepare(`DELETE FROM checkpoints WHERE thread_id = ?`).run(threadId);
|
|
500
|
+
this.db.prepare(`DELETE FROM writes WHERE thread_id = ?`).run(threadId);
|
|
501
|
+
});
|
|
502
|
+
}
|
|
503
|
+
async migratePendingSends(checkpoint, threadId, parentCheckpointId) {
|
|
504
|
+
const row = this.db.prepare(`
|
|
505
|
+
SELECT
|
|
506
|
+
checkpoint_id,
|
|
507
|
+
json_group_array(
|
|
508
|
+
json_object(
|
|
509
|
+
'type', ps.type,
|
|
510
|
+
'value', CAST(ps.value AS TEXT)
|
|
511
|
+
)
|
|
512
|
+
) as pending_sends
|
|
513
|
+
FROM writes as ps
|
|
514
|
+
WHERE ps.thread_id = ?
|
|
515
|
+
AND ps.checkpoint_id = ?
|
|
516
|
+
AND ps.channel = '${dist/* TASKS */.n3}'
|
|
517
|
+
ORDER BY ps.idx
|
|
518
|
+
`).get(threadId, parentCheckpointId);
|
|
519
|
+
const pendingSendsJson = String(row?.pending_sends ?? "[]");
|
|
520
|
+
const mutable = checkpoint;
|
|
521
|
+
mutable.channel_values ??= {};
|
|
522
|
+
mutable.channel_values[dist/* TASKS */.n3] = await Promise.all(JSON.parse(pendingSendsJson).map(({ type, value })=>this.serde.loadsTyped(type ?? "json", value ?? "")));
|
|
523
|
+
mutable.channel_versions[dist/* TASKS */.n3] = Object.keys(checkpoint.channel_versions).length > 0 ? (0,dist/* maxChannelVersion */.qU)(...Object.values(checkpoint.channel_versions)) : this.getNextVersion(undefined);
|
|
524
|
+
}
|
|
525
|
+
}
|
|
526
|
+
|
|
527
|
+
;// ./lib/agents/checkpointer.ts
|
|
528
|
+
|
|
529
|
+
|
|
530
|
+
|
|
531
|
+
// Persistent graph state per thread_id. Multi-step plans, scratchpad messages,
|
|
532
|
+
// and any pending tool-call sequence survive process restarts and resume on
|
|
533
|
+
// the next agent.stream() with the same thread_id.
|
|
534
|
+
//
|
|
535
|
+
// Stored in a separate DB file (~/.jarela/checkpoints.db) so LangGraph
|
|
536
|
+
// manages its own schema independently of our own migrations under
|
|
537
|
+
// lib/db/. Both files use WAL mode via the same node:sqlite driver.
|
|
538
|
+
const CHECKPOINT_PATH = (0,external_node_path_.join)((0,data_dir/* getDataDir */.o)(), "checkpoints.db");
|
|
539
|
+
let _saver = null;
|
|
540
|
+
function getCheckpointer() {
|
|
541
|
+
if (!_saver) {
|
|
542
|
+
_saver = NodeSqliteSaver.fromConnString(CHECKPOINT_PATH);
|
|
543
|
+
}
|
|
544
|
+
return _saver;
|
|
545
|
+
}
|
|
546
|
+
|
|
547
|
+
|
|
548
|
+
/***/ }),
|
|
549
|
+
|
|
550
|
+
/***/ 68564:
|
|
551
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
552
|
+
|
|
553
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
554
|
+
/* harmony export */ AD: () => (/* binding */ startRun),
|
|
555
|
+
/* harmony export */ B1: () => (/* binding */ subscribe),
|
|
556
|
+
/* harmony export */ Cs: () => (/* binding */ waitForRun),
|
|
557
|
+
/* harmony export */ ES: () => (/* binding */ abortAllRuns),
|
|
558
|
+
/* harmony export */ JH: () => (/* binding */ finishRun),
|
|
559
|
+
/* harmony export */ KD: () => (/* binding */ abortRun),
|
|
560
|
+
/* harmony export */ Mh: () => (/* binding */ getRun),
|
|
561
|
+
/* harmony export */ QK: () => (/* binding */ drainSteering),
|
|
562
|
+
/* harmony export */ mq: () => (/* binding */ broadcast),
|
|
563
|
+
/* harmony export */ mx: () => (/* binding */ pushSteering)
|
|
564
|
+
/* harmony export */ });
|
|
565
|
+
/* unused harmony export waitForRunsToSettle */
|
|
566
|
+
/* harmony import */ var _lib_env_config__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(67500);
|
|
567
|
+
/* harmony import */ var _lib_utils_global_state__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(15559);
|
|
568
|
+
|
|
569
|
+
|
|
570
|
+
// Read once at module init. JARELA_RUN_BUFFER_SIZE / JARELA_RUN_REGISTRY_TTL_MS
|
|
571
|
+
// override the defaults.
|
|
572
|
+
const MAX_BUFFERED = (0,_lib_env_config__WEBPACK_IMPORTED_MODULE_0__/* .getConfig */ .z)().runBufferSize;
|
|
573
|
+
const RECENT_TTL_MS = (0,_lib_env_config__WEBPACK_IMPORTED_MODULE_0__/* .getConfig */ .z)().runRegistryTtlMs;
|
|
574
|
+
// Idle (no-progress) ceiling and wall-clock ceiling: read fresh per-run
|
|
575
|
+
// from getConfig() so non-restart-required env reloads take effect.
|
|
576
|
+
function runIdleMs() {
|
|
577
|
+
return (0,_lib_env_config__WEBPACK_IMPORTED_MODULE_0__/* .getConfig */ .z)().runIdleMs;
|
|
578
|
+
}
|
|
579
|
+
function runMaxMs() {
|
|
580
|
+
return (0,_lib_env_config__WEBPACK_IMPORTED_MODULE_0__/* .getConfig */ .z)().runMaxMs;
|
|
581
|
+
}
|
|
582
|
+
const registryState = (0,_lib_utils_global_state__WEBPACK_IMPORTED_MODULE_1__/* .getOrCreateGlobal */ .X)("__jarela_active_run_registry", ()=>({
|
|
583
|
+
runs: new Map(),
|
|
584
|
+
waiters: new Map()
|
|
585
|
+
}));
|
|
586
|
+
const runs = registryState.runs;
|
|
587
|
+
// Cold-attach waiters: subscribers that opened a GET /run before the
|
|
588
|
+
// server-side run actually called startRun (typical for triggers /
|
|
589
|
+
// scheduler / watcher, which submit through `after()` + the per-thread
|
|
590
|
+
// queue, so there's a real delay between the user clicking "Run now"
|
|
591
|
+
// and the registry entry appearing). Resolved by `startRun` below.
|
|
592
|
+
const waiters = registryState.waiters;
|
|
593
|
+
/** Wait up to `timeoutMs` for a run to be registered on `thread_id`.
|
|
594
|
+
* Resolves immediately with the current run if one is already active,
|
|
595
|
+
* with the new run when `startRun` fires inside the window, or with
|
|
596
|
+
* `null` on timeout. `timeoutMs <= 0` short-circuits to the current
|
|
597
|
+
* state without waiting. Caller is responsible for closing the SSE
|
|
598
|
+
* stream when this resolves null. */ function waitForRun(thread_id, timeoutMs) {
|
|
599
|
+
const existing = runs.get(thread_id);
|
|
600
|
+
if (existing) return Promise.resolve(existing);
|
|
601
|
+
if (timeoutMs <= 0) return Promise.resolve(null);
|
|
602
|
+
return new Promise((resolve)=>{
|
|
603
|
+
let set = waiters.get(thread_id);
|
|
604
|
+
if (!set) {
|
|
605
|
+
set = new Set();
|
|
606
|
+
waiters.set(thread_id, set);
|
|
607
|
+
}
|
|
608
|
+
const fn = (run)=>{
|
|
609
|
+
clearTimeout(timer);
|
|
610
|
+
resolve(run);
|
|
611
|
+
};
|
|
612
|
+
set.add(fn);
|
|
613
|
+
const timer = setTimeout(()=>{
|
|
614
|
+
const cur = waiters.get(thread_id);
|
|
615
|
+
cur?.delete(fn);
|
|
616
|
+
if (cur && cur.size === 0) waiters.delete(thread_id);
|
|
617
|
+
resolve(null);
|
|
618
|
+
}, timeoutMs);
|
|
619
|
+
timer.unref?.();
|
|
620
|
+
});
|
|
621
|
+
}
|
|
622
|
+
function startRun(thread_id, agent_id) {
|
|
623
|
+
// If a stale completed run exists, drop it before starting a new one.
|
|
624
|
+
const existing = runs.get(thread_id);
|
|
625
|
+
if (existing && existing.status === "running") {
|
|
626
|
+
throw new Error(`A run is already active for thread ${thread_id}`);
|
|
627
|
+
}
|
|
628
|
+
const now = Date.now();
|
|
629
|
+
const run = {
|
|
630
|
+
thread_id,
|
|
631
|
+
agent_id,
|
|
632
|
+
started_at: now,
|
|
633
|
+
finished_at: null,
|
|
634
|
+
status: "running",
|
|
635
|
+
events: [],
|
|
636
|
+
subscribers: new Set(),
|
|
637
|
+
final_text: "",
|
|
638
|
+
abort: new AbortController(),
|
|
639
|
+
last_chunk_at: now,
|
|
640
|
+
inflight_tools: new Set(),
|
|
641
|
+
tool_started_at: new Map(),
|
|
642
|
+
tool_time_ms_done: 0,
|
|
643
|
+
steering: [],
|
|
644
|
+
phase: "starting",
|
|
645
|
+
phase_label: "Starting…"
|
|
646
|
+
};
|
|
647
|
+
runs.set(thread_id, run);
|
|
648
|
+
// Wake any GET subscribers that attached before the run was registered.
|
|
649
|
+
const pending = waiters.get(thread_id);
|
|
650
|
+
if (pending) {
|
|
651
|
+
waiters.delete(thread_id);
|
|
652
|
+
for (const fn of pending){
|
|
653
|
+
try {
|
|
654
|
+
fn(run);
|
|
655
|
+
} catch {}
|
|
656
|
+
}
|
|
657
|
+
}
|
|
658
|
+
scheduleIdleWatchdog(run);
|
|
659
|
+
scheduleMaxWatchdog(run);
|
|
660
|
+
return run;
|
|
661
|
+
}
|
|
662
|
+
// Synthesise a typed error chunk for the watchdog termination paths and
|
|
663
|
+
// fan it out to subscribers BEFORE flipping `status` to "error". The order
|
|
664
|
+
// matters: `broadcast()`'s status guard drops any chunk delivered after
|
|
665
|
+
// `finishRun()` has run, so calling finishRun first would silently swallow
|
|
666
|
+
// the error and the client's EventSource would just see the connection
|
|
667
|
+
// close with no terminal event — bubble keeps spinning, no toast. Doing
|
|
668
|
+
// it the other way around lets the client receive a real error event,
|
|
669
|
+
// render a "Run timed out" toast, and (if the consumer wires it up)
|
|
670
|
+
// trigger an auto-retry path. Followed by `done` so the consumer's
|
|
671
|
+
// for-await loop can break cleanly without waiting for an EOF.
|
|
672
|
+
function emitWatchdogTermination(run, code, message) {
|
|
673
|
+
if (run.status !== "running") return;
|
|
674
|
+
// Direct registry mutation so the broadcast goes through the regular
|
|
675
|
+
// path (subscribers + buffer + seq stamp) without re-entering any of
|
|
676
|
+
// the watchdog scheduling. Mirrors broadcast() but bypasses the
|
|
677
|
+
// status check we'd otherwise be racing against.
|
|
678
|
+
run.last_chunk_at = Date.now();
|
|
679
|
+
const errChunk = {
|
|
680
|
+
type: "error",
|
|
681
|
+
data: {
|
|
682
|
+
message,
|
|
683
|
+
code
|
|
684
|
+
}
|
|
685
|
+
};
|
|
686
|
+
if (run.events.length < MAX_BUFFERED) run.events.push(errChunk);
|
|
687
|
+
for (const fn of run.subscribers){
|
|
688
|
+
try {
|
|
689
|
+
fn(errChunk);
|
|
690
|
+
} catch {}
|
|
691
|
+
}
|
|
692
|
+
// Pair with a synthetic `done` so the client's consume() loop breaks
|
|
693
|
+
// on a terminal event rather than waiting for the EventSource to close.
|
|
694
|
+
const doneChunk = {
|
|
695
|
+
type: "done",
|
|
696
|
+
data: {}
|
|
697
|
+
};
|
|
698
|
+
if (run.events.length < MAX_BUFFERED) run.events.push(doneChunk);
|
|
699
|
+
for (const fn of run.subscribers){
|
|
700
|
+
try {
|
|
701
|
+
fn(doneChunk);
|
|
702
|
+
} catch {}
|
|
703
|
+
}
|
|
704
|
+
}
|
|
705
|
+
// Self-rearming idle watchdog. Fires when no chunk has arrived for
|
|
706
|
+
// `idleMs`; otherwise reschedules itself for `(last_chunk_at + idleMs) -
|
|
707
|
+
// now`. We never carry a handle on the run — the closure just bails if
|
|
708
|
+
// the run is no longer the registry's entry or no longer running.
|
|
709
|
+
function scheduleIdleWatchdog(run) {
|
|
710
|
+
const idleMs = runIdleMs();
|
|
711
|
+
const fireIn = Math.max(0, run.last_chunk_at + idleMs - Date.now());
|
|
712
|
+
setTimeout(()=>{
|
|
713
|
+
const cur = runs.get(run.thread_id);
|
|
714
|
+
if (cur !== run) return;
|
|
715
|
+
if (run.status !== "running") return;
|
|
716
|
+
const idle = Date.now() - run.last_chunk_at;
|
|
717
|
+
if (idle < idleMs) {
|
|
718
|
+
scheduleIdleWatchdog(run);
|
|
719
|
+
return;
|
|
720
|
+
}
|
|
721
|
+
if (run.inflight_tools.size > 0) {
|
|
722
|
+
// Tool execution in progress — silence here is the tool working,
|
|
723
|
+
// not a wedged provider stream. Skip the kill, re-check in idleMs.
|
|
724
|
+
// The tool_result will bump last_chunk_at when it lands.
|
|
725
|
+
setTimeout(()=>scheduleIdleWatchdog(run), idleMs).unref?.();
|
|
726
|
+
return;
|
|
727
|
+
}
|
|
728
|
+
console.warn(`[run-registry] idle watchdog: force-finishing stalled run for thread ${run.thread_id} after ${idle}ms of no progress`);
|
|
729
|
+
emitWatchdogTermination(run, "run_idle_timeout", `Run timed out — no progress for ${Math.round(idle / 1000)}s. The provider stream went silent before the agent finished. Try again, or split the request into smaller steps.`);
|
|
730
|
+
try {
|
|
731
|
+
run.abort.abort("run_idle_timeout");
|
|
732
|
+
} catch {}
|
|
733
|
+
finishRun(run, "error");
|
|
734
|
+
}, fireIn).unref?.();
|
|
735
|
+
}
|
|
736
|
+
// Wall-clock elapsed minus time spent inside tool calls (both completed and
|
|
737
|
+
// currently in flight). The wall-clock watchdog uses this so a 5-minute
|
|
738
|
+
// shell exec or a slow MCP roundtrip doesn't burn the agent's budget;
|
|
739
|
+
// tools enforce their own timeouts. See ActiveRun.tool_started_at for the
|
|
740
|
+
// rationale.
|
|
741
|
+
function effectiveElapsedMs(run, now) {
|
|
742
|
+
let inflightToolMs = 0;
|
|
743
|
+
for (const startedAt of run.tool_started_at.values()){
|
|
744
|
+
inflightToolMs += Math.max(0, now - startedAt);
|
|
745
|
+
}
|
|
746
|
+
return Math.max(0, now - run.started_at - run.tool_time_ms_done - inflightToolMs);
|
|
747
|
+
}
|
|
748
|
+
function scheduleMaxWatchdog(run) {
|
|
749
|
+
const max = runMaxMs();
|
|
750
|
+
const now = Date.now();
|
|
751
|
+
const fireIn = Math.max(0, max - effectiveElapsedMs(run, now));
|
|
752
|
+
setTimeout(()=>{
|
|
753
|
+
const cur = runs.get(run.thread_id);
|
|
754
|
+
if (cur !== run) return;
|
|
755
|
+
if (run.status !== "running") return;
|
|
756
|
+
const elapsed = effectiveElapsedMs(run, Date.now());
|
|
757
|
+
if (elapsed < max) {
|
|
758
|
+
// Tool time pushed the effective elapsed back below the ceiling —
|
|
759
|
+
// re-arm for the remaining budget. Without this, a tool that runs
|
|
760
|
+
// for longer than `max` between firing and resolving would let
|
|
761
|
+
// the next setTimeout overshoot.
|
|
762
|
+
scheduleMaxWatchdog(run);
|
|
763
|
+
return;
|
|
764
|
+
}
|
|
765
|
+
console.warn(`[run-registry] wall-clock watchdog: force-finishing run for thread ${run.thread_id} after ${elapsed}ms of agent time (excluding tool execution)`);
|
|
766
|
+
emitWatchdogTermination(run, "run_max_timeout", `Run exceeded the wall-clock limit (${Math.round(max / 1000)}s of agent time, excluding tool execution). The agent was force-stopped. Try a smaller scope or raise JARELA_RUN_MAX_MS if this is expected.`);
|
|
767
|
+
try {
|
|
768
|
+
run.abort.abort("run_watchdog_timeout");
|
|
769
|
+
} catch {}
|
|
770
|
+
finishRun(run, "error");
|
|
771
|
+
}, fireIn).unref?.();
|
|
772
|
+
}
|
|
773
|
+
// Mirrors the labels hooks/useSSE.ts derives from the same chunks.
|
|
774
|
+
function trackPhase(run, chunk) {
|
|
775
|
+
const data = chunk.data ?? {};
|
|
776
|
+
const set = (phase, label)=>{
|
|
777
|
+
run.phase = phase;
|
|
778
|
+
run.phase_label = label;
|
|
779
|
+
};
|
|
780
|
+
if (chunk.type === "status") {
|
|
781
|
+
const phase = typeof data.phase === "string" && data.phase ? data.phase : run.phase;
|
|
782
|
+
const label = typeof data.label === "string" && data.label.trim() ? data.label : "Thinking…";
|
|
783
|
+
set(phase, label);
|
|
784
|
+
} else if (chunk.type === "text_delta") {
|
|
785
|
+
set("responding", "Responding…");
|
|
786
|
+
} else if (chunk.type === "thinking_delta") {
|
|
787
|
+
if (run.inflight_tools.size === 0) set("thinking", "Thinking…");
|
|
788
|
+
} else if (chunk.type === "tool_call") {
|
|
789
|
+
const name = typeof data.name === "string" && data.name ? data.name : "tool";
|
|
790
|
+
set("tool", `Using ${name}…`);
|
|
791
|
+
} else if (chunk.type === "tool_result") {
|
|
792
|
+
const remaining = typeof data.id === "string" ? [
|
|
793
|
+
...run.inflight_tools
|
|
794
|
+
].filter((id)=>id !== data.id) : [
|
|
795
|
+
...run.inflight_tools
|
|
796
|
+
];
|
|
797
|
+
if (remaining.length === 0) set("thinking", "Thinking…");
|
|
798
|
+
}
|
|
799
|
+
}
|
|
800
|
+
function broadcast(run, chunk) {
|
|
801
|
+
// Identity-check: a superseded run must not smear trailing chunks onto
|
|
802
|
+
// the replacement entry in the registry.
|
|
803
|
+
if (runs.get(run.thread_id) !== run) return;
|
|
804
|
+
run.last_chunk_at = Date.now();
|
|
805
|
+
// Heartbeats exist solely to reset the idle watchdog when the provider
|
|
806
|
+
// is producing chunks that don't surface downstream (most commonly
|
|
807
|
+
// partial tool-call args while the model streams a large file_write
|
|
808
|
+
// body). The last_chunk_at bump above is the entire payload — don't
|
|
809
|
+
// buffer, don't fan out to subscribers, or the SSE wire would carry
|
|
810
|
+
// meaningless tick events.
|
|
811
|
+
if (chunk.type === "heartbeat") return;
|
|
812
|
+
trackPhase(run, chunk);
|
|
813
|
+
if (chunk.type === "text_delta") {
|
|
814
|
+
run.final_text += chunk.data.delta ?? "";
|
|
815
|
+
} else if (chunk.type === "reset_text") {
|
|
816
|
+
// Output-validator retry (ADR-0037) discarding a flagged completed
|
|
817
|
+
// reply — see StreamChunk in base.ts.
|
|
818
|
+
run.final_text = "";
|
|
819
|
+
} else if (chunk.type === "tool_call") {
|
|
820
|
+
const id = chunk.data.id;
|
|
821
|
+
if (id) {
|
|
822
|
+
run.inflight_tools.add(id);
|
|
823
|
+
run.tool_started_at.set(id, Date.now());
|
|
824
|
+
}
|
|
825
|
+
} else if (chunk.type === "tool_result") {
|
|
826
|
+
const id = chunk.data.id;
|
|
827
|
+
if (id) {
|
|
828
|
+
run.inflight_tools.delete(id);
|
|
829
|
+
const startedAt = run.tool_started_at.get(id);
|
|
830
|
+
if (startedAt !== undefined) {
|
|
831
|
+
run.tool_time_ms_done += Math.max(0, Date.now() - startedAt);
|
|
832
|
+
run.tool_started_at.delete(id);
|
|
833
|
+
// The tool just gave the agent its budget back; re-arm the
|
|
834
|
+
// wall-clock watchdog against the new effective elapsed.
|
|
835
|
+
scheduleMaxWatchdog(run);
|
|
836
|
+
}
|
|
837
|
+
}
|
|
838
|
+
}
|
|
839
|
+
if (run.events.length < MAX_BUFFERED) {
|
|
840
|
+
run.events.push(chunk);
|
|
841
|
+
}
|
|
842
|
+
for (const fn of run.subscribers){
|
|
843
|
+
try {
|
|
844
|
+
fn(chunk);
|
|
845
|
+
} catch {}
|
|
846
|
+
}
|
|
847
|
+
}
|
|
848
|
+
function finishRun(run, status) {
|
|
849
|
+
// Identity-check: a stale run finishing late must not flip the
|
|
850
|
+
// replacement's status or evict it from the registry.
|
|
851
|
+
if (runs.get(run.thread_id) !== run) return;
|
|
852
|
+
run.status = status;
|
|
853
|
+
run.finished_at = Date.now();
|
|
854
|
+
// Drop subscribers — late attachers should NOT keep getting events on a
|
|
855
|
+
// dead run. They'll get the buffered events on subscribe and that's it.
|
|
856
|
+
run.subscribers.clear();
|
|
857
|
+
// Auto-evict after TTL so memory doesn't grow with every conversation.
|
|
858
|
+
setTimeout(()=>{
|
|
859
|
+
const cur = runs.get(run.thread_id);
|
|
860
|
+
if (cur === run) runs.delete(run.thread_id);
|
|
861
|
+
}, RECENT_TTL_MS).unref?.();
|
|
862
|
+
}
|
|
863
|
+
function getRun(thread_id) {
|
|
864
|
+
return runs.get(thread_id) ?? null;
|
|
865
|
+
}
|
|
866
|
+
// Signal the agent stream to cancel. The stream loop in the route is wired
|
|
867
|
+
// to listen on the AbortController and exit early, emitting an error chunk
|
|
868
|
+
// the client (and the queue-drain hook) can react to. Idempotent.
|
|
869
|
+
function abortRun(thread_id, reason = "user_interrupted") {
|
|
870
|
+
const run = runs.get(thread_id);
|
|
871
|
+
if (!run || run.status !== "running") return false;
|
|
872
|
+
if (!run.abort.signal.aborted) {
|
|
873
|
+
try {
|
|
874
|
+
run.abort.abort(reason);
|
|
875
|
+
} catch {}
|
|
876
|
+
}
|
|
877
|
+
return true;
|
|
878
|
+
}
|
|
879
|
+
// Queue a user message typed while `thread_id` is streaming (ADR-0080).
|
|
880
|
+
// Returns false when there is nothing to steer, so the caller can fall back
|
|
881
|
+
// to starting a fresh turn.
|
|
882
|
+
function pushSteering(thread_id, text) {
|
|
883
|
+
const run = runs.get(thread_id);
|
|
884
|
+
if (!run || run.status !== "running" || run.abort.signal.aborted) return false;
|
|
885
|
+
const trimmed = text.trim();
|
|
886
|
+
if (!trimmed) return false;
|
|
887
|
+
run.steering.push(trimmed);
|
|
888
|
+
return true;
|
|
889
|
+
}
|
|
890
|
+
// Take everything queued so far, in arrival order. Deliberately not merged
|
|
891
|
+
// into a summary — collapsing several messages loses the user's intent.
|
|
892
|
+
function drainSteering(thread_id) {
|
|
893
|
+
const run = runs.get(thread_id);
|
|
894
|
+
if (!run || run.steering.length === 0) return [];
|
|
895
|
+
return run.steering.splice(0, run.steering.length);
|
|
896
|
+
}
|
|
897
|
+
// Abort every currently-running run. Used by the graceful-shutdown path so
|
|
898
|
+
// LangGraph stream loops bail out instead of continuing past process exit.
|
|
899
|
+
// Returns the number of runs that were signalled.
|
|
900
|
+
function abortAllRuns(reason = "server_shutdown") {
|
|
901
|
+
let count = 0;
|
|
902
|
+
for (const run of runs.values()){
|
|
903
|
+
if (run.status !== "running") continue;
|
|
904
|
+
if (run.abort.signal.aborted) continue;
|
|
905
|
+
try {
|
|
906
|
+
run.abort.abort(reason);
|
|
907
|
+
count++;
|
|
908
|
+
} catch {}
|
|
909
|
+
}
|
|
910
|
+
return count;
|
|
911
|
+
}
|
|
912
|
+
// Poll until every run has transitioned out of "running" (or until the
|
|
913
|
+
// caller-supplied deadline elapses). Used during graceful shutdown after
|
|
914
|
+
// `abortAllRuns()` so the stream `finally` blocks have a chance to flush
|
|
915
|
+
// the trailing error chunk and call `finishRun()`. Resolves to the count
|
|
916
|
+
// of runs still stuck in "running" when the deadline hit (0 = clean).
|
|
917
|
+
async function waitForRunsToSettle(timeoutMs) {
|
|
918
|
+
const deadline = Date.now() + Math.max(0, timeoutMs);
|
|
919
|
+
while(Date.now() < deadline){
|
|
920
|
+
let stillRunning = 0;
|
|
921
|
+
for (const run of runs.values())if (run.status === "running") stillRunning++;
|
|
922
|
+
if (stillRunning === 0) return 0;
|
|
923
|
+
await new Promise((resolve)=>setTimeout(resolve, 50));
|
|
924
|
+
}
|
|
925
|
+
let stillRunning = 0;
|
|
926
|
+
for (const run of runs.values())if (run.status === "running") stillRunning++;
|
|
927
|
+
return stillRunning;
|
|
928
|
+
}
|
|
929
|
+
// Replays buffered events synchronously, then subscribes for live ones.
|
|
930
|
+
// Returns an unsubscribe fn. Caller is responsible for calling it.
|
|
931
|
+
function subscribe(thread_id, onEvent) {
|
|
932
|
+
const run = runs.get(thread_id);
|
|
933
|
+
if (!run) return {
|
|
934
|
+
run: null,
|
|
935
|
+
unsubscribe: ()=>{}
|
|
936
|
+
};
|
|
937
|
+
// Replay buffered events first (so the new subscriber catches up).
|
|
938
|
+
for (const ev of run.events){
|
|
939
|
+
try {
|
|
940
|
+
onEvent(ev);
|
|
941
|
+
} catch {}
|
|
942
|
+
}
|
|
943
|
+
if (run.status !== "running") {
|
|
944
|
+
return {
|
|
945
|
+
run,
|
|
946
|
+
unsubscribe: ()=>{}
|
|
947
|
+
};
|
|
948
|
+
}
|
|
949
|
+
run.subscribers.add(onEvent);
|
|
950
|
+
return {
|
|
951
|
+
run,
|
|
952
|
+
unsubscribe: ()=>{
|
|
953
|
+
run.subscribers.delete(onEvent);
|
|
954
|
+
}
|
|
955
|
+
};
|
|
956
|
+
}
|
|
957
|
+
|
|
958
|
+
|
|
959
|
+
/***/ })
|
|
960
|
+
|
|
961
|
+
};
|
|
962
|
+
;
|
|
963
|
+
//# sourceMappingURL=5120.js.map
|