@desplega.ai/agent-swarm 1.134.0 → 1.135.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/README.md +1 -1
- package/dist/{actions-7kast243.js → actions-3fpj602h.js} +16 -16
- package/dist/{app-0g84t8wf.js → app-12mwdsvg.js} +7 -7
- package/dist/{artifact-dje5ke4h.js → artifact-wpy087er.js} +1 -1
- package/dist/{assistant-ac4htcky.js → assistant-p87pt2b5.js} +19 -19
- package/dist/{azure-openai-responses-be59fbsz.js → azure-openai-responses-40z2astx.js} +5 -3
- package/dist/{boot-reembed-kw2541c4.js → boot-reembed-jf6gx8yr.js} +19 -19
- package/dist/{boot-reembed-b1rcqn85.js → boot-reembed-vjkptm2x.js} +17 -17
- package/dist/{boot-scrub-logs-ja29t92g.js → boot-scrub-logs-ah6bpjte.js} +31 -33
- package/dist/{claude-adapter-5cg1fv8s.js → claude-adapter-9ry59y9k.js} +11 -11
- package/dist/{claude-managed-adapter-9z9sdytx.js → claude-managed-adapter-m2v2e90a.js} +3 -3
- package/dist/cli-10694wk0.js +1093 -0
- package/dist/{cli-grt6qv91.js → cli-1gvam274.js} +398 -637
- package/dist/{cli-wf86d5t7.js → cli-1gzz6pmf.js} +11 -11
- package/dist/{cli-h0djenzm.js → cli-269pdgm4.js} +46 -46
- package/dist/{cli-480nehnh.js → cli-2ecesrtw.js} +23 -23
- package/dist/{cli-bnx54kxv.js → cli-2gwpvmew.js} +45 -5
- package/dist/{cli-h37gbjbf.js → cli-3m4mkyqy.js} +199 -111
- package/dist/{cli-qtekrty1.js → cli-6t2fgxpv.js} +1 -1
- package/dist/{cli-gtafvdy0.js → cli-77vf7z36.js} +2 -2
- package/dist/cli-87zrjxdb.js +658 -0
- package/dist/{cli-mp9sg4cg.js → cli-8ca5b9j9.js} +1 -1
- package/dist/{cli-pt43pdp1.js → cli-8p37s71j.js} +2 -2
- package/dist/{cli-f4wj0s3m.js → cli-9kekm9yz.js} +35 -36
- package/dist/{cli-jxj92gkt.js → cli-a2brkr6h.js} +5 -5
- package/dist/{cli-7bv8nckk.js → cli-bynsg176.js} +3 -3
- package/dist/{cli-g0j14czv.js → cli-crkvptsz.js} +23 -13
- package/dist/{cli-h39xxnq6.js → cli-d08xq4nz.js} +1717 -1332
- package/dist/cli-d2epf5ae.js +704 -0
- package/dist/{cli-43x36mty.js → cli-dphm5tyw.js} +166 -138
- package/dist/{cli-492e7ap5.js → cli-dr5tcz68.js} +2 -2
- package/dist/cli-dwwz52tw.js +6996 -0
- package/dist/{cli-snw62ze5.js → cli-f2tgry1v.js} +63 -47
- package/dist/{cli-rh6f3s9n.js → cli-h9gpdrzg.js} +29 -29
- package/dist/{cli-yv9dttkh.js → cli-hp1n6zq3.js} +13 -1
- package/dist/{cli-07er7wrs.js → cli-hsxj0yar.js} +1 -1
- package/dist/{cli-mrammd8c.js → cli-j2p3bfs3.js} +357 -282
- package/dist/{cli-brm3et47.js → cli-md759nb0.js} +122 -116
- package/dist/{cli-fyd58xgb.js → cli-mez7x2z0.js} +19 -106
- package/dist/{cli-zykjrwcx.js → cli-p0sqfhw1.js} +27 -32
- package/dist/cli-pmz8qr82.js +260 -0
- package/dist/{cli-ghexzd2d.js → cli-pqv5gvyf.js} +2562 -1664
- package/dist/{cli-m07313tr.js → cli-prfghf4h.js} +2568 -1726
- package/dist/{cli-1ybr6vw2.js → cli-s35981d0.js} +9 -1
- package/dist/{cli-k46t4664.js → cli-s9yg23fg.js} +2 -2
- package/dist/{cli-87t2gstf.js → cli-tdtmw1r5.js} +1 -1
- package/dist/cli-v21nahej.js +303 -0
- package/dist/{cli-15429qdw.js → cli-v3qda694.js} +1 -1
- package/dist/{cli-4bap00k0.js → cli-vd2twm2p.js} +1 -1
- package/dist/{cli-38taxznr.js → cli-vsap7a8d.js} +2066 -1399
- package/dist/{cli-c79a9zrc.js → cli-w3xch1b8.js} +2 -2
- package/dist/{cli-jmvk6et8.js → cli-w4ezqgkj.js} +7 -5
- package/dist/{cli-tkrr24mz.js → cli-wzmeara2.js} +62 -59
- package/dist/{cli-4bc8vmhm.js → cli-y37pxs1m.js} +8 -8
- package/dist/{cli-6x363v1z.js → cli-y98ry8cz.js} +6 -6
- package/dist/{cli-e07exmsb.js → cli-yd6vqt1x.js} +404 -233
- package/dist/{cli-aw8bb6sf.js → cli-z6gdnbjy.js} +20 -20
- package/dist/cli.js +22 -20
- package/dist/{codex-adapter-hsq6mz3m.js → codex-adapter-6r08aepx.js} +7 -7
- package/dist/{codex-hook-8c500gq8.js → codex-hook-7eb9d1d5.js} +2 -2
- package/dist/{codex-session-runner-c1x3x143.js → codex-session-runner-9dk036pn.js} +7 -7
- package/dist/{commands-rwtddtst.js → commands-kg7cm1jz.js} +8 -8
- package/dist/{db-j2b355vz.js → db-g666qxpv.js} +19 -18
- package/dist/{e2b-znpx78eg.js → e2b-b7jt70fc.js} +3 -3
- package/dist/{handlers-hchgrxkh.js → handlers-58k0e9mc.js} +24 -24
- package/dist/{hook-spb00w76.js → hook-51ez1v2s.js} +10 -10
- package/dist/{hook-p49egqc0.js → hook-gezxk50h.js} +9 -9
- package/dist/{http-nh14kkms.js → http-d4qhhnyy.js} +1296 -1455
- package/dist/{index-67pzqfrb.js → index-c06j5e9e.js} +15 -14
- package/dist/{index-dvsk64sm.js → index-h96j88n6.js} +350 -228
- package/dist/{index-4cbyhq2g.js → index-kvgmhb7w.js} +14 -13
- package/dist/{index-pyp7rexm.js → index-p13cfsc2.js} +2 -2
- package/dist/{index-j02xvjtd.js → index-pe58mf1r.js} +3 -3
- package/dist/{index-yrfphye1.js → index-ys39hr8t.js} +16 -15
- package/dist/{keepalive-9k51nqhc.js → keepalive-b6n7th6x.js} +9 -9
- package/dist/{lead-2xq3dxbz.js → lead-3wgc402v.js} +35 -34
- package/dist/{maintenance-0c0g6nym.js → maintenance-wr20z889.js} +10 -9
- package/dist/{oauth-refresh-sweep-273a64r2.js → oauth-refresh-sweep-brxmpz1j.js} +10 -10
- package/dist/{onboard-tsv9wwhz.js → onboard-88hgdp28.js} +11 -9
- package/dist/{openai-completions-mrypq7qp.js → openai-completions-kasahkpq.js} +5 -3
- package/dist/{openai-responses-qhrk21ez.js → openai-responses-175qgngv.js} +5 -3
- package/dist/{openrouter-images-684fysx9.js → openrouter-images-asqqnbvh.js} +5 -3
- package/dist/{otel-impl-wp1mfzd2.js → otel-impl-an7gh3eh.js} +40 -7014
- package/dist/{pi-mono-adapter-yz47kk8e.js → pi-mono-adapter-6vmrr3g8.js} +184 -7248
- package/dist/{pricing-refresh-jw1yw2fn.js → pricing-refresh-ettrct0b.js} +8 -8
- package/dist/{rbac-roles-p53cg5cv.js → rbac-roles-grtmky49.js} +51 -51
- package/dist/{rbac-roles-dg964c8p.js → rbac-roles-wdwpg5fc.js} +8 -8
- package/dist/{registry-mh12y17v.js → registry-2g6d2p3n.js} +1 -1
- package/dist/{render-v2-56vn2rk9.js → render-v2-k7h2sbmp.js} +7 -7
- package/dist/{seed-pricing-52xx6z63.js → seed-pricing-gtqxtqzc.js} +7 -7
- package/dist/{setup-e8gp79sy.js → setup-3tcfqyz9.js} +23 -21
- package/dist/{worker-s17f1g46.js → worker-9tejebcv.js} +35 -34
- package/openapi.json +1 -1
- package/package.json +7 -5
- package/plugin/commands/implement-issue.md +1 -1
- package/plugin/commands/start-leader.md +3 -3
- package/plugin/commands/work-on-task.md +2 -2
- package/plugin/pi-skills/implement-issue/SKILL.md +1 -1
- package/plugin/pi-skills/start-leader/SKILL.md +3 -3
- package/plugin/pi-skills/work-on-task/SKILL.md +2 -2
- package/src/agentmail/handlers.ts +15 -15
- package/src/apps/definition.ts +14 -10
- package/src/apps/page-validator.ts +18 -14
- package/src/apps/row-store.ts +98 -67
- package/src/apps/schema-migrate.ts +47 -34
- package/src/apps/script-types.ts +2 -2
- package/src/apps/store.ts +46 -53
- package/src/apps/sync-run-as.ts +2 -2
- package/src/apps/sync.ts +39 -31
- package/src/apps/user-config.ts +14 -16
- package/src/apps/version.ts +17 -16
- package/src/artifact-sdk/server.ts +4 -1
- package/src/be/asset-key-auth.ts +5 -2
- package/src/be/audit-user.ts +7 -7
- package/src/be/boot-scrub-logs.ts +36 -39
- package/src/be/budget-admission.ts +8 -8
- package/src/be/budget-refusal-notify.ts +9 -6
- package/src/be/db-client.ts +461 -0
- package/src/be/db-queries/mcp-oauth.ts +152 -148
- package/src/be/db-queries/oauth.ts +194 -192
- package/src/be/db-queries/task-artifacts.ts +12 -10
- package/src/be/db-queries/tracker.ts +105 -93
- package/src/be/db.ts +3287 -3589
- package/src/be/events.ts +80 -114
- package/src/be/identity.ts +7 -4
- package/src/be/mcp-proxy.ts +5 -5
- package/src/be/memory/boot-reembed.ts +11 -15
- package/src/be/memory/edges-store.ts +19 -13
- package/src/be/memory/graph-expansion.ts +7 -8
- package/src/be/memory/index-content.ts +144 -0
- package/src/be/memory/link-resolver.ts +47 -43
- package/src/be/memory/links-store.ts +27 -29
- package/src/be/memory/providers/sqlite-store.ts +251 -269
- package/src/be/memory/raters/retrieval.ts +15 -19
- package/src/be/memory/raters/run-server-raters.ts +5 -2
- package/src/be/memory/raters/store.ts +17 -27
- package/src/be/memory/retrieval-store.ts +13 -12
- package/src/be/memory/types.ts +19 -15
- package/src/be/memory/usefulness-stats.ts +85 -101
- package/src/be/migrations/runner.ts +2 -2
- package/src/be/multi-runtime.ts +137 -131
- package/src/be/oauth-credential-bindings.ts +13 -9
- package/src/be/oauth-refresh-sweep.ts +3 -3
- package/src/be/pricing-refresh.ts +43 -41
- package/src/be/rbac-audit.ts +66 -43
- package/src/be/rbac-roles.ts +55 -60
- package/src/be/script-connections.ts +249 -262
- package/src/be/script-credential-broker.ts +2 -2
- package/src/be/scripts/boot-reembed.ts +14 -19
- package/src/be/scripts/db.ts +133 -222
- package/src/be/scripts/embeddings.ts +42 -44
- package/src/be/scripts/retention.ts +49 -36
- package/src/be/scripts/run-saved.ts +9 -3
- package/src/be/scripts/type-contributors.ts +1 -1
- package/src/be/scripts/typecheck.ts +18 -15
- package/src/be/seed/agent-fs-provision.ts +52 -47
- package/src/be/seed/runner.ts +4 -4
- package/src/be/seed/state-db.ts +12 -10
- package/src/be/seed-capabilities.ts +6 -3
- package/src/be/seed-pricing.ts +2 -1
- package/src/be/seed-scripts/catalog/ops-catalog-audit.inline.ts +1 -1
- package/src/be/seed-scripts/catalog/ops-catalog-audit.ts +1 -1
- package/src/be/seed-scripts/index.ts +3 -3
- package/src/be/seed-skills/index.ts +52 -16
- package/src/be/skill-sync.ts +22 -20
- package/src/be/steering.ts +30 -27
- package/src/be/swarm-config-guard.ts +1 -0
- package/src/be/unmapped-identities.ts +6 -6
- package/src/be/users.ts +130 -138
- package/src/commands/onboard/types.ts +7 -1
- package/src/commands/onboard.tsx +10 -5
- package/src/commands/runner.ts +9 -12
- package/src/commands/setup.tsx +27 -17
- package/src/fs/agent-fs-provider.ts +83 -10
- package/src/fs/provider.ts +15 -1
- package/src/github/handlers.ts +57 -52
- package/src/gitlab/handlers.ts +36 -33
- package/src/heartbeat/heartbeat.ts +138 -130
- package/src/hooks/tool-loop-detection.test.ts +49 -0
- package/src/hooks/tool-loop-detection.ts +36 -1
- package/src/http/active-sessions.ts +9 -9
- package/src/http/agents.ts +76 -65
- package/src/http/api-keys.ts +22 -8
- package/src/http/approval-requests.ts +8 -8
- package/src/http/apps.ts +80 -77
- package/src/http/assets.ts +36 -27
- package/src/http/auth.ts +3 -3
- package/src/http/budgets.ts +17 -9
- package/src/http/codex-oauth-keep-warm.ts +1 -1
- package/src/http/config.ts +19 -19
- package/src/http/context.ts +5 -5
- package/src/http/core.ts +50 -32
- package/src/http/ecosystem.ts +1 -1
- package/src/http/events.ts +4 -4
- package/src/http/favorite-owner.ts +3 -3
- package/src/http/favorites.ts +4 -4
- package/src/http/fs.ts +46 -22
- package/src/http/inbox-state.ts +2 -2
- package/src/http/index.ts +22 -19
- package/src/http/integrations.ts +7 -7
- package/src/http/kv.ts +32 -32
- package/src/http/mcp-bridge.ts +3 -3
- package/src/http/mcp-oauth.ts +30 -30
- package/src/http/mcp-servers.ts +22 -22
- package/src/http/mcp-user.ts +8 -3
- package/src/http/mcp.ts +9 -6
- package/src/http/memory.ts +60 -160
- package/src/http/metrics.ts +22 -20
- package/src/http/oauth-callback.ts +16 -12
- package/src/http/oauth-locks.ts +2 -2
- package/src/http/page-proxy.ts +1 -1
- package/src/http/pages-public.ts +6 -6
- package/src/http/pages.ts +37 -31
- package/src/http/poll.ts +77 -62
- package/src/http/pricing.ts +7 -7
- package/src/http/prompt-templates.ts +25 -15
- package/src/http/repos.ts +5 -5
- package/src/http/schedules.ts +34 -28
- package/src/http/script-connection-proxy.ts +2 -2
- package/src/http/script-connections.ts +141 -120
- package/src/http/script-runs.ts +88 -64
- package/src/http/scripts.ts +97 -74
- package/src/http/session-cost-recompute.ts +20 -14
- package/src/http/session-data.ts +15 -15
- package/src/http/sessions.ts +9 -7
- package/src/http/skills.ts +34 -34
- package/src/http/stats.ts +13 -10
- package/src/http/status.ts +37 -37
- package/src/http/task-templates.ts +1 -1
- package/src/http/tasks.ts +114 -101
- package/src/http/trackers/jira.ts +10 -10
- package/src/http/trackers/linear.ts +10 -8
- package/src/http/users.ts +82 -65
- package/src/http/utils.ts +3 -3
- package/src/http/webhooks.ts +3 -3
- package/src/http/workflow-events.ts +1 -1
- package/src/http/workflows.ts +107 -129
- package/src/http/x.ts +8 -8
- package/src/integrations/kapso/config.ts +22 -17
- package/src/integrations/kapso/inbound.ts +15 -13
- package/src/jira/app.ts +2 -2
- package/src/jira/client.ts +4 -4
- package/src/jira/metadata.ts +15 -19
- package/src/jira/oauth.ts +5 -5
- package/src/jira/outbound.ts +2 -2
- package/src/jira/sync.ts +35 -35
- package/src/jira/webhook-lifecycle.ts +13 -14
- package/src/jira/webhook.ts +6 -6
- package/src/linear/app.ts +3 -3
- package/src/linear/client.ts +2 -2
- package/src/linear/oauth.ts +4 -4
- package/src/linear/outbound.ts +9 -9
- package/src/linear/sync.ts +43 -43
- package/src/metrics/version.ts +6 -3
- package/src/oauth/ensure-mcp-token.ts +6 -6
- package/src/oauth/ensure-token.ts +19 -16
- package/src/oauth/keepalive.ts +1 -1
- package/src/oauth/wrapper.ts +5 -5
- package/src/pages/version.ts +6 -3
- package/src/prompts/base-prompt.ts +239 -294
- package/src/prompts/defaults.ts +145 -96
- package/src/prompts/session-templates.ts +267 -765
- package/src/providers/claude-managed-adapter.ts +4 -2
- package/src/queue-stall-alarm.ts +14 -14
- package/src/scheduler/scheduler.test.ts +14 -14
- package/src/scheduler/scheduler.ts +22 -20
- package/src/script-workflows/supervisor.ts +34 -22
- package/src/scripts-runtime/credential-broker/broker.ts +1 -1
- package/src/scripts-runtime/credential-broker/types.ts +1 -1
- package/src/scripts-runtime/egress-secrets.ts +1 -1
- package/src/scripts-runtime/sdk-allowlist.ts +1 -0
- package/src/scripts-runtime/types/stdlib.d.ts +8 -0
- package/src/scripts-runtime/types/swarm-sdk.d.ts +8 -0
- package/src/server-user.ts +1 -1
- package/src/server.ts +4 -2
- package/src/slack/ack.ts +3 -3
- package/src/slack/actions.ts +6 -6
- package/src/slack/app.ts +2 -2
- package/src/slack/assistant.ts +7 -7
- package/src/slack/commands.ts +2 -2
- package/src/slack/enrich.ts +25 -12
- package/src/slack/handlers.ts +12 -12
- package/src/slack/render-v2.ts +96 -66
- package/src/slack/responses.ts +8 -8
- package/src/slack/router.ts +9 -6
- package/src/slack/steering.ts +9 -6
- package/src/slack/thread-buffer.ts +9 -9
- package/src/slack/watcher.ts +44 -32
- package/src/stdio.ts +16 -14
- package/src/tasks/sibling-awareness.ts +13 -13
- package/src/tasks/terminal-result-guard.ts +3 -3
- package/src/tasks/worker-follow-up.ts +30 -30
- package/src/tests/additive-buffer.test.ts +9 -6
- package/src/tests/agent-activity.test.ts +35 -35
- package/src/tests/agent-fs-provision-seeder.test.ts +46 -44
- package/src/tests/agentmail-handlers.test.ts +37 -34
- package/src/tests/agents-harness-provider.test.ts +81 -72
- package/src/tests/api-key-tracking.test.ts +41 -41
- package/src/tests/approval-requests.test.ts +131 -126
- package/src/tests/apps-elements.test.ts +73 -68
- package/src/tests/apps-rbac.test.ts +18 -13
- package/src/tests/apps-script-types.test.ts +11 -7
- package/src/tests/apps-spike.test.ts +39 -35
- package/src/tests/apps-spike2.test.ts +139 -131
- package/src/tests/apps-spike4.test.ts +54 -51
- package/src/tests/apps-spike5.test.ts +148 -149
- package/src/tests/apps-sync-engine.test.ts +233 -217
- package/src/tests/apps-sync.test.ts +14 -14
- package/src/tests/apps-user-config.test.ts +82 -58
- package/src/tests/artifact-sdk.test.ts +10 -49
- package/src/tests/asset-key-api.test.ts +26 -16
- package/src/tests/asset-key-invariants.test.ts +129 -102
- package/src/tests/asset-key-mcp.test.ts +27 -20
- package/src/tests/asset-key-migration.test.ts +15 -15
- package/src/tests/asyncdb-guard-races.test.ts +195 -0
- package/src/tests/audit-updated-by.test.ts +79 -76
- package/src/tests/audit-user.test.ts +72 -55
- package/src/tests/base-prompt.test.ts +759 -664
- package/src/tests/budget-admission.test.ts +90 -85
- package/src/tests/budget-claim-gate.test.ts +111 -62
- package/src/tests/budget-refusal-notification.test.ts +94 -66
- package/src/tests/budget-user-scope.test.ts +80 -83
- package/src/tests/budgets-routes.test.ts +14 -20
- package/src/tests/channel-activity.test.ts +37 -36
- package/src/tests/claude-managed-adapter.test.ts +86 -69
- package/src/tests/codex-oauth-keep-warm.test.ts +1 -1
- package/src/tests/codex-steering-hook.test.ts +17 -19
- package/src/tests/concurrency.test.ts +68 -68
- package/src/tests/config-api-only-keys.test.ts +10 -11
- package/src/tests/connection-embedded-auth.test.ts +95 -89
- package/src/tests/context-key-db.test.ts +42 -34
- package/src/tests/context-snapshot.test.ts +14 -14
- package/src/tests/context-versioning.test.ts +72 -60
- package/src/tests/core-auth.test.ts +3 -9
- package/src/tests/create-page-tool.test.ts +5 -5
- package/src/tests/create-task-validation.test.ts +29 -27
- package/src/tests/credential-broker.test.ts +10 -10
- package/src/tests/credential-status-api.test.ts +22 -17
- package/src/tests/credential-status-routing.test.ts +36 -36
- package/src/tests/db-capacity.test.ts +67 -67
- package/src/tests/db-client-busy-retry.test.ts +195 -0
- package/src/tests/db-client.test.ts +406 -0
- package/src/tests/db-queries-oauth.test.ts +98 -100
- package/src/tests/db-queries-tracker.test.ts +54 -54
- package/src/tests/db-query.test.ts +4 -3
- package/src/tests/delete-page-tool.test.ts +31 -28
- package/src/tests/devin-adapter.test.ts +8 -9
- package/src/tests/devin-api.test.ts +7 -9
- package/src/tests/ensure-token.test.ts +36 -36
- package/src/tests/entrypoint-codex-oauth-seed.test.ts +119 -89
- package/src/tests/events-db.test.ts +53 -53
- package/src/tests/events-http.test.ts +7 -15
- package/src/tests/favorites.test.ts +19 -18
- package/src/tests/follow-up-redelivery-guard.test.ts +82 -82
- package/src/tests/fs-provider.test.ts +105 -1
- package/src/tests/fs-routes.test.ts +56 -27
- package/src/tests/generate-default-claude-md.test.ts +152 -6
- package/src/tests/generate-identity-templates.test.ts +21 -25
- package/src/tests/github-event-filter.test.ts +1 -1
- package/src/tests/github-handlers-cancel-config.test.ts +39 -40
- package/src/tests/github-handlers-inline-comments.test.ts +19 -19
- package/src/tests/github-handlers.test.ts +52 -53
- package/src/tests/gitlab-handlers.test.ts +70 -71
- package/src/tests/gitlab-vcs-db.test.ts +21 -21
- package/src/tests/harness-provider-resolution.test.ts +22 -22
- package/src/tests/heartbeat-checklist.test.ts +170 -148
- package/src/tests/heartbeat-reroute-decision.test.ts +184 -162
- package/src/tests/heartbeat-supersede-resume.test.ts +163 -102
- package/src/tests/heartbeat.test.ts +393 -286
- package/src/tests/http/context-routes.test.ts +11 -14
- package/src/tests/http-api-integration.test.ts +11 -24
- package/src/tests/http-users.test.ts +123 -114
- package/src/tests/identity-field-budget.test.ts +24 -10
- package/src/tests/identity.test.ts +17 -17
- package/src/tests/integrations-http.test.ts +13 -14
- package/src/tests/jira-metadata.test.ts +44 -44
- package/src/tests/jira-oauth.test.ts +7 -7
- package/src/tests/jira-outbound-sync.test.ts +19 -19
- package/src/tests/jira-sync.test.ts +71 -62
- package/src/tests/jira-webhook-lifecycle.test.ts +15 -15
- package/src/tests/jira-webhook.test.ts +24 -24
- package/src/tests/kapso-inbound.test.ts +33 -33
- package/src/tests/kv-http.test.ts +10 -16
- package/src/tests/kv-namespace-resolution.test.ts +9 -15
- package/src/tests/kv-page-proxy.test.ts +7 -15
- package/src/tests/kv-storage.test.ts +141 -91
- package/src/tests/kv-tool.test.ts +7 -7
- package/src/tests/launch-password-rejection.test.ts +4 -3
- package/src/tests/linear-outbound-sync.test.ts +10 -10
- package/src/tests/linear-sync-identity.test.ts +72 -72
- package/src/tests/linear-webhook.test.ts +51 -45
- package/src/tests/list-endpoint-slimming.test.ts +36 -36
- package/src/tests/mcp-oauth-dcr-reuse.test.ts +64 -69
- package/src/tests/mcp-oauth-ensure-token.test.ts +25 -23
- package/src/tests/mcp-oauth-manual-client.test.ts +30 -19
- package/src/tests/mcp-oauth-queries.test.ts +161 -154
- package/src/tests/mcp-oauth-resolve-secrets.test.ts +35 -36
- package/src/tests/mcp-server-resolved-env.test.ts +14 -14
- package/src/tests/mcp-server-ssrf.test.ts +4 -4
- package/src/tests/mcp-tools-user.test.ts +37 -33
- package/src/tests/mcp-tools.test.ts +1 -1
- package/src/tests/mcp-user-route.test.ts +28 -41
- package/src/tests/memory-e2e.test.ts +117 -108
- package/src/tests/memory-edges.test.ts +101 -116
- package/src/tests/memory-edit.test.ts +46 -40
- package/src/tests/memory-get-tool.test.ts +24 -25
- package/src/tests/memory-graph-expansion.test.ts +84 -81
- package/src/tests/memory-http-recall-gating.test.ts +23 -17
- package/src/tests/memory-hybrid.test.ts +36 -33
- package/src/tests/memory-link-resolver.test.ts +69 -70
- package/src/tests/memory-rate-endpoint.test.ts +46 -60
- package/src/tests/memory-rater-e2e.test.ts +99 -114
- package/src/tests/memory-rater-implicit-citation.test.ts +86 -83
- package/src/tests/memory-rater-llm.test.ts +70 -86
- package/src/tests/memory-rater-store.test.ts +86 -94
- package/src/tests/memory-store-tool.test.ts +176 -0
- package/src/tests/memory-store.test.ts +128 -127
- package/src/tests/memory-usefulness-endpoint.test.ts +63 -57
- package/src/tests/memory.test.ts +109 -106
- package/src/tests/metrics-http.test.ts +7 -5
- package/src/tests/migration-046-budgets.test.ts +106 -130
- package/src/tests/migration-063-schema-relax.test.ts +32 -32
- package/src/tests/model-control.test.ts +109 -94
- package/src/tests/multi-runtime-registration.test.ts +743 -711
- package/src/tests/oauth-access-token-tool.test.ts +14 -14
- package/src/tests/oauth-callback-flow.test.ts +62 -66
- package/src/tests/oauth-credential-bindings.test.ts +57 -64
- package/src/tests/oauth-keepalive.test.ts +9 -9
- package/src/tests/oauth-presets.test.ts +4 -4
- package/src/tests/oauth-refresh-failure.test.ts +38 -34
- package/src/tests/oauth-refresh-sweep.test.ts +53 -56
- package/src/tests/oauth-wrapper.test.ts +4 -4
- package/src/tests/openapi-response-contract.test.ts +42 -30
- package/src/tests/otel-session-cost-metrics.test.ts +11 -16
- package/src/tests/page-proxy-authed.test.ts +7 -15
- package/src/tests/page-proxy.test.ts +7 -15
- package/src/tests/pages-actions-endpoint.test.ts +4 -3
- package/src/tests/pages-authed-mode.test.ts +4 -3
- package/src/tests/pages-http.test.ts +4 -5
- package/src/tests/pages-list-endpoint.test.ts +4 -5
- package/src/tests/pages-password-mode.test.ts +5 -4
- package/src/tests/pages-public-authed-401.test.ts +4 -3
- package/src/tests/pages-public-html.test.ts +4 -3
- package/src/tests/pages-public-json-redirect.test.ts +4 -3
- package/src/tests/pages-storage.test.ts +39 -40
- package/src/tests/pages-versioning.test.ts +4 -3
- package/src/tests/pagination-metrics.test.ts +49 -39
- package/src/tests/pool-affinity.test.ts +144 -124
- package/src/tests/pool-session-logs.test.ts +31 -31
- package/src/tests/preload.ts +96 -3
- package/src/tests/pricing-refresh.test.ts +29 -32
- package/src/tests/pricing-routes.test.ts +9 -15
- package/src/tests/profile-sync.test.ts +1 -1
- package/src/tests/progress-dedup.test.ts +14 -14
- package/src/tests/prompt-template-remaining.test.ts +11 -10
- package/src/tests/prompt-template-session.test.ts +201 -462
- package/src/tests/prompt-templates-db.test.ts +33 -33
- package/src/tests/queue-stall-alarm.test.ts +65 -54
- package/src/tests/rbac-admission.test.ts +33 -41
- package/src/tests/rbac-audit.test.ts +56 -59
- package/src/tests/rbac-charact-http.test.ts +19 -23
- package/src/tests/rbac-charact-misc-tools.test.ts +32 -27
- package/src/tests/rbac-charact-skills.test.ts +29 -24
- package/src/tests/rbac-charact-slack.test.ts +6 -6
- package/src/tests/rbac-e2e-helpers.ts +4 -18
- package/src/tests/rbac-roles.test.ts +112 -112
- package/src/tests/register-service-security.test.ts +7 -7
- package/src/tests/reload-config.test.ts +55 -52
- package/src/tests/rest-api.test.ts +45 -48
- package/src/tests/run-bun-tests.test.ts +208 -193
- package/src/tests/runner-context-preamble.test.ts +12 -11
- package/src/tests/runner-polling-api.test.ts +22 -25
- package/src/tests/sandboxed-process.test.ts +28 -11
- package/src/tests/schedule-http-triage-tools.test.ts +10 -11
- package/src/tests/schedule-target-type.test.ts +65 -59
- package/src/tests/scheduled-tasks-api.test.ts +19 -22
- package/src/tests/scheduled-tasks.test.ts +121 -105
- package/src/tests/scheduler-backoff.test.ts +22 -22
- package/src/tests/script-apis-mcp.test.ts +23 -19
- package/src/tests/script-connections-http.test.ts +102 -97
- package/src/tests/script-connections-mcp.test.ts +69 -54
- package/src/tests/script-connections.test.ts +63 -69
- package/src/tests/script-runs-http.test.ts +26 -26
- package/src/tests/script-workflows-runtime-e2e.test.ts +43 -35
- package/src/tests/scripts-boot-reembed.test.ts +30 -34
- package/src/tests/scripts-db.test.ts +52 -39
- package/src/tests/scripts-embeddings.test.ts +35 -39
- package/src/tests/scripts-external-api.test.ts +61 -60
- package/src/tests/scripts-http.test.ts +61 -44
- package/src/tests/scripts-mcp-e2e.test.ts +16 -11
- package/src/tests/scripts-only-gating.test.ts +48 -40
- package/src/tests/scripts-retention.test.ts +171 -125
- package/src/tests/scripts-runtime-identity.test.ts +49 -42
- package/src/tests/scripts-runtime.test.ts +5 -1
- package/src/tests/scripts-typecheck.test.ts +53 -54
- package/src/tests/sdk-allowlist.test.ts +4 -5
- package/src/tests/seed-capabilities.test.ts +18 -18
- package/src/tests/seed-scripts.test.ts +9 -9
- package/src/tests/seed-skills-bundled-files.test.ts +31 -28
- package/src/tests/seed.test.ts +5 -5
- package/src/tests/self-improvement.test.ts +75 -91
- package/src/tests/send-task-requested-by.test.ts +25 -23
- package/src/tests/send-task-slack-routing-guard.test.ts +15 -15
- package/src/tests/session-attach.test.ts +55 -56
- package/src/tests/session-cost-recompute-unit.test.ts +18 -18
- package/src/tests/session-costs-codex-recompute.test.ts +26 -32
- package/src/tests/session-costs-golden.test.ts +32 -36
- package/src/tests/session-costs-model-key-normalize.test.ts +17 -20
- package/src/tests/session-costs-recompute-all-providers.test.ts +19 -24
- package/src/tests/session-costs.test.ts +225 -191
- package/src/tests/session-logs.test.ts +25 -28
- package/src/tests/sessions.test.ts +47 -44
- package/src/tests/sibling-awareness-db.test.ts +26 -26
- package/src/tests/skill-files-http.test.ts +7 -6
- package/src/tests/skill-files.test.ts +41 -42
- package/src/tests/skill-get-file-tool.test.ts +2 -2
- package/src/tests/skill-sync.test.ts +48 -48
- package/src/tests/skill-update-scope.test.ts +16 -16
- package/src/tests/skills-signature.test.ts +35 -35
- package/src/tests/slack-actions.test.ts +23 -23
- package/src/tests/slack-assistant-comention-production.test.ts +9 -7
- package/src/tests/slack-assistant.test.ts +22 -22
- package/src/tests/slack-bot-filter.test.ts +22 -17
- package/src/tests/slack-channel-lifecycle.test.ts +1 -1
- package/src/tests/slack-delete.test.ts +2 -2
- package/src/tests/slack-identity-resolution.test.ts +66 -67
- package/src/tests/slack-metadata-inheritance.test.ts +105 -107
- package/src/tests/slack-queue-offline.test.ts +33 -23
- package/src/tests/slack-read-boundaries.test.ts +2 -2
- package/src/tests/slack-render-v2.test.ts +233 -209
- package/src/tests/slack-router-require-mention.test.ts +23 -18
- package/src/tests/slack-router.test.ts +31 -23
- package/src/tests/slack-steering.test.ts +66 -58
- package/src/tests/slack-thread-buffer.test.ts +16 -16
- package/src/tests/slack-thread-followups.test.ts +57 -52
- package/src/tests/slack-tool-blocks.test.ts +18 -16
- package/src/tests/slack-update.test.ts +2 -2
- package/src/tests/slack-upload-file.test.ts +5 -5
- package/src/tests/slack-watcher.test.ts +180 -172
- package/src/tests/spec-base-url.test.ts +3 -3
- package/src/tests/status.test.ts +252 -181
- package/src/tests/steer-task-tool.test.ts +34 -23
- package/src/tests/steering-core.test.ts +105 -106
- package/src/tests/steering-enabled.test.ts +32 -23
- package/src/tests/steering-promotion.test.ts +42 -38
- package/src/tests/steering-transport.test.ts +28 -29
- package/src/tests/store-progress-attachments-handler.test.ts +53 -53
- package/src/tests/store-progress-attachments.test.ts +60 -60
- package/src/tests/store-progress-cost.test.ts +16 -16
- package/src/tests/structured-output.test.ts +17 -14
- package/src/tests/swarm-config-encryption.test.ts +76 -81
- package/src/tests/swarm-config-reserved-keys.test.ts +58 -55
- package/src/tests/swarm-config-schema.test.ts +26 -27
- package/src/tests/swarm-repos.test.ts +66 -66
- package/src/tests/swarm-tool-result-gate.test.ts +70 -70
- package/src/tests/system-default-skills.test.ts +25 -27
- package/src/tests/task-artifacts.test.ts +87 -80
- package/src/tests/task-attachments-schema.test.ts +25 -26
- package/src/tests/task-cancellation.test.ts +77 -80
- package/src/tests/task-cascade-fail.test.ts +86 -84
- package/src/tests/task-completion-idempotency.test.ts +223 -220
- package/src/tests/task-lifecycle-telemetry.test.ts +24 -22
- package/src/tests/task-pause-resume.test.ts +120 -123
- package/src/tests/task-search-filter.test.ts +8 -8
- package/src/tests/task-supersede-resume.test.ts +153 -148
- package/src/tests/task-swarm-version.test.ts +17 -19
- package/src/tests/task-title-route.test.ts +6 -5
- package/src/tests/task-tools-ctx.test.ts +15 -15
- package/src/tests/task-tools-ownership.test.ts +26 -21
- package/src/tests/task-working-dir.test.ts +27 -27
- package/src/tests/tasks-requested-by-filter.test.ts +42 -38
- package/src/tests/test-net.ts +71 -0
- package/src/tests/test-proc.ts +86 -0
- package/src/tests/tool-annotations.test.ts +9 -8
- package/src/tests/tracker-fold.test.ts +44 -45
- package/src/tests/tracker-tools.test.ts +31 -31
- package/src/tests/trigger-claiming.test.ts +142 -142
- package/src/tests/update-profile-agentid.test.ts +41 -41
- package/src/tests/update-profile-api.test.ts +31 -34
- package/src/tests/update-profile-auth.test.ts +14 -14
- package/src/tests/update-schedule-mcp-tool.test.ts +19 -21
- package/src/tests/user-identity.test.ts +231 -221
- package/src/tests/user-token-rest-auth.test.ts +32 -32
- package/src/tests/user-token-routes.test.ts +21 -36
- package/src/tests/vcs-tracking.test.ts +39 -35
- package/src/tests/vendored-openapi.test.ts +6 -5
- package/src/tests/whoami-route.test.ts +10 -16
- package/src/tests/workflow-agent-task.test.ts +6 -6
- package/src/tests/workflow-async-v2.test.ts +76 -64
- package/src/tests/workflow-convergence.test.ts +35 -32
- package/src/tests/workflow-definition-telemetry.test.ts +8 -8
- package/src/tests/workflow-e2e.test.ts +19 -18
- package/src/tests/workflow-engine-v2.test.ts +94 -80
- package/src/tests/workflow-executors.test.ts +53 -37
- package/src/tests/workflow-foreach.test.ts +186 -177
- package/src/tests/workflow-hitl-routing.test.ts +29 -29
- package/src/tests/workflow-http-v2.test.ts +46 -35
- package/src/tests/workflow-input-redaction.test.ts +7 -7
- package/src/tests/workflow-integration-io.test.ts +44 -41
- package/src/tests/workflow-io-schemas.test.ts +28 -25
- package/src/tests/workflow-mcp-trigger-schema.test.ts +25 -26
- package/src/tests/workflow-registry.test.ts +19 -19
- package/src/tests/workflow-retry-v2.test.ts +32 -29
- package/src/tests/workflow-retry-validation.test.ts +13 -10
- package/src/tests/workflow-schedule-trigger.test.ts +17 -17
- package/src/tests/workflow-step-claims.test.ts +152 -0
- package/src/tests/workflow-swarm-script.test.ts +58 -54
- package/src/tests/workflow-trigger-schema.test.ts +21 -21
- package/src/tests/workflow-triggers-v2.test.ts +57 -55
- package/src/tests/workflow-validation-port-routing.test.ts +19 -19
- package/src/tests/workflow-versions.test.ts +85 -53
- package/src/tests/workflow-wait-builtin-events.test.ts +27 -21
- package/src/tests/workflow-wait-event.test.ts +60 -54
- package/src/tests/workflow-wait-http.test.ts +22 -19
- package/src/tests/workflow-wait-recovery.test.ts +28 -25
- package/src/tests/workflow-wait-state-queries.test.ts +70 -70
- package/src/tests/workflow-wait-time.test.ts +22 -19
- package/src/tests/workflow-workspace.test.ts +28 -28
- package/src/tools/accept-steer.ts +3 -3
- package/src/tools/app-diff.ts +8 -7
- package/src/tools/app-get.ts +6 -6
- package/src/tools/app-history.ts +4 -4
- package/src/tools/app-list.ts +2 -2
- package/src/tools/app-patch.ts +7 -7
- package/src/tools/app-rollback.ts +1 -1
- package/src/tools/app-sync.ts +2 -2
- package/src/tools/app-upsert.ts +9 -9
- package/src/tools/cancel-task.ts +70 -70
- package/src/tools/context-diff.ts +4 -4
- package/src/tools/context-history.ts +3 -3
- package/src/tools/create-channel.ts +1 -1
- package/src/tools/create-metric.ts +8 -8
- package/src/tools/create-page.ts +13 -10
- package/src/tools/credential-bindings/tool.ts +28 -24
- package/src/tools/delete-channel.ts +4 -4
- package/src/tools/delete-page.ts +4 -4
- package/src/tools/get-metrics.ts +1 -1
- package/src/tools/get-swarm.ts +1 -1
- package/src/tools/get-task-details.ts +6 -4
- package/src/tools/get-tasks.ts +2 -2
- package/src/tools/inject-learning.ts +4 -4
- package/src/tools/join-swarm.ts +5 -7
- package/src/tools/kv/kv-delete.ts +3 -3
- package/src/tools/kv/kv-get.ts +2 -2
- package/src/tools/kv/kv-incr.ts +3 -3
- package/src/tools/kv/kv-list.ts +3 -3
- package/src/tools/kv/kv-set.ts +3 -3
- package/src/tools/kv/kv-write-auth.ts +3 -3
- package/src/tools/kv/resolve-namespace.ts +3 -3
- package/src/tools/list-channels.ts +1 -1
- package/src/tools/list-services.ts +10 -8
- package/src/tools/manage-user.ts +21 -13
- package/src/tools/mcp-servers/mcp-server-create.ts +3 -3
- package/src/tools/mcp-servers/mcp-server-delete.ts +3 -3
- package/src/tools/mcp-servers/mcp-server-get.ts +6 -6
- package/src/tools/mcp-servers/mcp-server-install.ts +3 -3
- package/src/tools/mcp-servers/mcp-server-list.ts +2 -2
- package/src/tools/mcp-servers/mcp-server-uninstall.ts +2 -2
- package/src/tools/mcp-servers/mcp-server-update.ts +3 -3
- package/src/tools/memory-delete.ts +3 -3
- package/src/tools/memory-edit.ts +3 -3
- package/src/tools/memory-get.ts +5 -5
- package/src/tools/memory-search.ts +15 -11
- package/src/tools/memory-store.ts +89 -0
- package/src/tools/my-agent-info.ts +1 -1
- package/src/tools/oauth-access-token.ts +3 -3
- package/src/tools/poll-task.ts +24 -23
- package/src/tools/post-message.ts +4 -4
- package/src/tools/prompt-templates/delete.ts +2 -2
- package/src/tools/prompt-templates/get.ts +2 -2
- package/src/tools/prompt-templates/set.ts +15 -10
- package/src/tools/read-messages.ts +13 -13
- package/src/tools/register-agentmail-inbox.ts +9 -5
- package/src/tools/register-kapso-number.ts +7 -7
- package/src/tools/register-service.ts +2 -2
- package/src/tools/repos/get-repos.ts +1 -1
- package/src/tools/repos/update-repo.ts +1 -1
- package/src/tools/request-human-input.ts +3 -3
- package/src/tools/resolve-user.ts +8 -8
- package/src/tools/schedules/create-schedule.ts +8 -7
- package/src/tools/schedules/delete-schedule.ts +5 -5
- package/src/tools/schedules/list-schedules.ts +2 -2
- package/src/tools/schedules/patch-schedule.ts +11 -10
- package/src/tools/schedules/run-schedule-now.ts +3 -3
- package/src/tools/schedules/update-schedule.ts +11 -10
- package/src/tools/script-apis.ts +8 -8
- package/src/tools/script-connections/tool.ts +6 -6
- package/src/tools/send-task.ts +113 -77
- package/src/tools/skills/skill-create.ts +3 -3
- package/src/tools/skills/skill-delete.ts +3 -3
- package/src/tools/skills/skill-get-file.ts +2 -2
- package/src/tools/skills/skill-get.ts +6 -5
- package/src/tools/skills/skill-install-remote.ts +2 -2
- package/src/tools/skills/skill-install.ts +3 -3
- package/src/tools/skills/skill-list.ts +2 -2
- package/src/tools/skills/skill-publish.ts +4 -4
- package/src/tools/skills/skill-search.ts +1 -1
- package/src/tools/skills/skill-sync-remote.ts +5 -5
- package/src/tools/skills/skill-uninstall.ts +2 -2
- package/src/tools/skills/skill-update.ts +3 -3
- package/src/tools/slack-archive-channel.ts +1 -1
- package/src/tools/slack-create-channel.ts +1 -1
- package/src/tools/slack-delete.ts +1 -1
- package/src/tools/slack-download-file.ts +1 -1
- package/src/tools/slack-invite-to-channel.ts +1 -1
- package/src/tools/slack-list-channels.ts +1 -1
- package/src/tools/slack-post.ts +4 -4
- package/src/tools/slack-read.ts +3 -3
- package/src/tools/slack-reply.ts +7 -7
- package/src/tools/slack-start-thread.ts +3 -3
- package/src/tools/slack-update.ts +1 -1
- package/src/tools/slack-upload-file.ts +6 -4
- package/src/tools/steer-task.ts +3 -3
- package/src/tools/store-progress.ts +81 -75
- package/src/tools/swarm-config/delete-config.ts +4 -4
- package/src/tools/swarm-config/get-config.ts +2 -2
- package/src/tools/swarm-config/list-config.ts +2 -2
- package/src/tools/swarm-config/set-config.ts +2 -2
- package/src/tools/task-action.ts +70 -70
- package/src/tools/task-dedup.ts +3 -3
- package/src/tools/tool-config.ts +5 -4
- package/src/tools/tracker/tracker-link-task.ts +1 -1
- package/src/tools/tracker/tracker-map-agent.ts +1 -1
- package/src/tools/tracker/tracker-status.ts +13 -11
- package/src/tools/tracker/tracker-sync-status.ts +1 -1
- package/src/tools/tracker/tracker-unlink.ts +1 -1
- package/src/tools/unregister-service.ts +3 -3
- package/src/tools/update-profile.ts +6 -4
- package/src/tools/update-service-status.ts +3 -3
- package/src/tools/utils.ts +12 -9
- package/src/tools/whatsapp-message.ts +1 -1
- package/src/tools/workflows/cancel-workflow-run.ts +1 -1
- package/src/tools/workflows/create-workflow.ts +4 -3
- package/src/tools/workflows/delete-workflow.ts +1 -1
- package/src/tools/workflows/get-workflow-run.ts +5 -3
- package/src/tools/workflows/get-workflow.ts +1 -1
- package/src/tools/workflows/list-workflow-runs.ts +8 -6
- package/src/tools/workflows/list-workflows.ts +2 -2
- package/src/tools/workflows/patch-workflow-node.ts +20 -41
- package/src/tools/workflows/patch-workflow.ts +31 -45
- package/src/tools/workflows/trigger-workflow.ts +5 -4
- package/src/tools/workflows/update-workflow.ts +28 -22
- package/src/types.ts +2 -6
- package/src/utils/request-auth-context.ts +38 -3
- package/src/utils/sandboxed-process.ts +16 -1
- package/src/workflows/checkpoint.ts +16 -18
- package/src/workflows/cooldown.ts +6 -3
- package/src/workflows/engine.ts +94 -74
- package/src/workflows/executors/agent-task.ts +4 -4
- package/src/workflows/executors/foreach.ts +12 -12
- package/src/workflows/executors/human-in-the-loop.ts +3 -3
- package/src/workflows/executors/notify.ts +1 -1
- package/src/workflows/executors/swarm-script.ts +16 -15
- package/src/workflows/executors/wait.ts +3 -3
- package/src/workflows/foreach-join.ts +5 -5
- package/src/workflows/index.ts +3 -3
- package/src/workflows/input.ts +6 -4
- package/src/workflows/patch-definition.ts +72 -0
- package/src/workflows/recovery.ts +45 -45
- package/src/workflows/resume.ts +159 -98
- package/src/workflows/retry-poller.ts +13 -13
- package/src/workflows/task-step-routing.ts +98 -14
- package/src/workflows/triggers.ts +10 -10
- package/src/workflows/version.ts +59 -5
- package/src/workflows/wait-poller.ts +1 -1
- package/templates/skills/artifacts/config.json +1 -1
- package/templates/skills/code-quality/config.json +14 -0
- package/templates/skills/code-quality/content.md +61 -0
- package/templates/skills/heartbeat-runbook/config.json +14 -0
- package/templates/skills/heartbeat-runbook/content.md +59 -0
- package/templates/skills/memory/config.json +14 -0
- package/templates/skills/memory/content.md +66 -0
- package/templates/skills/pages/content.md +4 -2
- package/templates/skills/scheduling/config.json +14 -0
- package/templates/skills/scheduling/content.md +62 -0
- package/templates/skills/slack-interaction/config.json +14 -0
- package/templates/skills/slack-interaction/content.md +50 -0
- package/templates/skills/swarm-scripts/SKILL.md +93 -109
- package/templates/skills/swarm-scripts/config.json +2 -2
- package/templates/skills/swarm-scripts/content.md +92 -108
- package/dist/cli-2wv4kj0e.js +0 -1182
- package/dist/cli-34w2584r.js +0 -530
- package/dist/cli-589599p9.js +0 -269
- package/dist/cli-qs9hhsvb.js +0 -7206
- package/dist/cli-wrrea8xm.js +0 -176
package/README.md
CHANGED
|
@@ -122,7 +122,7 @@ Check [our templates](https://templates.agent-swarm.dev) for a quick start.
|
|
|
122
122
|
## Highlights
|
|
123
123
|
|
|
124
124
|
- **Lead/worker orchestration in Docker** — isolated dev environments, priority queues, pause/resume across deploys, and API-side alerts when claimable work stops being picked up. [Architecture →](https://docs.agent-swarm.dev/docs/architecture/overview)
|
|
125
|
-
- **Compounding memory & persistent identity** — agents remember past sessions and evolve their own persona, expertise, and notes, with ratcheting file budgets and visible recovery when local edits exceed prompt limits. [Memory →](https://docs.agent-swarm.dev/docs/architecture/memory) · [Agents →](https://docs.agent-swarm.dev/docs/architecture/agents)
|
|
125
|
+
- **Compounding memory & persistent identity** — agents explicitly capture reusable learnings with `memory-store`, remember past sessions, and evolve their own persona, expertise, and notes, with ratcheting file budgets and visible recovery when local edits exceed prompt limits. [Memory →](https://docs.agent-swarm.dev/docs/architecture/memory) · [Agents →](https://docs.agent-swarm.dev/docs/architecture/agents)
|
|
126
126
|
- **Hybrid + graph-linked memory recall** — memory retrieval can blend vector and full-text ranking, expand through linked memories, surface usefulness readouts, and let agents correct an existing memory without losing its ID or history. [Memory →](https://docs.agent-swarm.dev/docs/architecture/memory) · [MCP tools →](https://docs.agent-swarm.dev/docs/reference/mcp-tools#memory-tools)
|
|
127
127
|
- **Multi-channel inputs** — Slack, GitHub, GitLab, email, WhatsApp, Linear, Jira, and the HTTP API all create tasks. [Integrations](#integrations)
|
|
128
128
|
- **Slack operations and persistent thread trees** — lead agents can create, populate, and archive channels, while conversations can opt in to one editable task tree with streamed outcome cards and explicit Block Kit messages. [Slack guide →](https://docs.agent-swarm.dev/docs/guides/slack-integration)
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
resolveSlackUserId
|
|
3
|
-
} from "./cli-
|
|
4
|
-
import"./cli-
|
|
3
|
+
} from "./cli-crkvptsz.js";
|
|
4
|
+
import"./cli-v21nahej.js";
|
|
5
5
|
import {
|
|
6
6
|
createTaskWithSiblingAwareness
|
|
7
|
-
} from "./cli-
|
|
7
|
+
} from "./cli-1gzz6pmf.js";
|
|
8
8
|
import {
|
|
9
9
|
buildCancelledBlocks,
|
|
10
10
|
ensureSlackThreadTree,
|
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
getAgentEmoji,
|
|
13
13
|
getTaskLink,
|
|
14
14
|
isSlackRenderV2Enabled
|
|
15
|
-
} from "./cli-
|
|
15
|
+
} from "./cli-1gvam274.js";
|
|
16
16
|
import"./cli-qf9kpsve.js";
|
|
17
17
|
import"./cli-g2p9bd1z.js";
|
|
18
18
|
import"./cli-5tnr64pm.js";
|
|
@@ -24,16 +24,16 @@ import {
|
|
|
24
24
|
init_context_key,
|
|
25
25
|
init_db,
|
|
26
26
|
slackContextKey
|
|
27
|
-
} from "./cli-
|
|
28
|
-
import"./cli-
|
|
29
|
-
import"./cli-
|
|
27
|
+
} from "./cli-prfghf4h.js";
|
|
28
|
+
import"./cli-d2epf5ae.js";
|
|
29
|
+
import"./cli-87zrjxdb.js";
|
|
30
30
|
import"./cli-a1rrkrb4.js";
|
|
31
31
|
import"./cli-qt5bt3vk.js";
|
|
32
32
|
import"./cli-nanaxrz6.js";
|
|
33
|
-
import"./cli-
|
|
34
|
-
import"./cli-
|
|
33
|
+
import"./cli-s35981d0.js";
|
|
34
|
+
import"./cli-w4ezqgkj.js";
|
|
35
35
|
import"./cli-mkq1rk7b.js";
|
|
36
|
-
import"./cli-
|
|
36
|
+
import"./cli-pqv5gvyf.js";
|
|
37
37
|
import"./cli-qntkxysp.js";
|
|
38
38
|
import"./cli-497b685t.js";
|
|
39
39
|
import"./cli-pq2ee5ja.js";
|
|
@@ -93,15 +93,15 @@ function registerActionHandlers(app) {
|
|
|
93
93
|
const followUpText = view.state.values.follow_up_input?.follow_up_text?.value || "";
|
|
94
94
|
if (!taskId || !followUpText)
|
|
95
95
|
return;
|
|
96
|
-
const originalTask = getTaskById(taskId);
|
|
96
|
+
const originalTask = await getTaskById(taskId);
|
|
97
97
|
if (!originalTask || !originalTask.slackChannelId)
|
|
98
98
|
return;
|
|
99
|
-
const lead = getLeadAgent();
|
|
99
|
+
const lead = await getLeadAgent();
|
|
100
100
|
const requestedByUserId = await resolveSlackUserId(client, body.user.id, {
|
|
101
101
|
sampleEventType: "view_submission",
|
|
102
102
|
sampleContext: view.callback_id || "follow_up_submit"
|
|
103
103
|
});
|
|
104
|
-
const followUpTask = createTaskWithSiblingAwareness(followUpText, {
|
|
104
|
+
const followUpTask = await createTaskWithSiblingAwareness(followUpText, {
|
|
105
105
|
agentId: lead?.id,
|
|
106
106
|
source: "slack",
|
|
107
107
|
parentTaskId: taskId,
|
|
@@ -140,15 +140,15 @@ function registerActionHandlers(app) {
|
|
|
140
140
|
const taskId = action.value;
|
|
141
141
|
if (!taskId)
|
|
142
142
|
return;
|
|
143
|
-
const task = getTaskById(taskId);
|
|
143
|
+
const task = await getTaskById(taskId);
|
|
144
144
|
if (!task)
|
|
145
145
|
return;
|
|
146
|
-
const cancelled = cancelTask(taskId, "Cancelled via Slack");
|
|
146
|
+
const cancelled = await cancelTask(taskId, "Cancelled via Slack");
|
|
147
147
|
if (!cancelled) {
|
|
148
148
|
return;
|
|
149
149
|
}
|
|
150
150
|
if (task.slackChannelId && task.agentId) {
|
|
151
|
-
const agent = getAgentById(task.agentId);
|
|
151
|
+
const agent = await getAgentById(task.agentId);
|
|
152
152
|
const agentName = agent?.name || "Unknown";
|
|
153
153
|
const blocks = buildCancelledBlocks({ agentName, taskId: task.id });
|
|
154
154
|
try {
|
|
@@ -3,20 +3,20 @@ import {
|
|
|
3
3
|
initSlackApp,
|
|
4
4
|
startSlackApp,
|
|
5
5
|
stopSlackApp
|
|
6
|
-
} from "./cli-
|
|
6
|
+
} from "./cli-1gvam274.js";
|
|
7
7
|
import"./cli-qf9kpsve.js";
|
|
8
8
|
import"./cli-g2p9bd1z.js";
|
|
9
9
|
import"./cli-5tnr64pm.js";
|
|
10
|
-
import"./cli-
|
|
11
|
-
import"./cli-
|
|
12
|
-
import"./cli-
|
|
10
|
+
import"./cli-prfghf4h.js";
|
|
11
|
+
import"./cli-d2epf5ae.js";
|
|
12
|
+
import"./cli-87zrjxdb.js";
|
|
13
13
|
import"./cli-a1rrkrb4.js";
|
|
14
14
|
import"./cli-qt5bt3vk.js";
|
|
15
15
|
import"./cli-nanaxrz6.js";
|
|
16
|
-
import"./cli-
|
|
17
|
-
import"./cli-
|
|
16
|
+
import"./cli-s35981d0.js";
|
|
17
|
+
import"./cli-w4ezqgkj.js";
|
|
18
18
|
import"./cli-mkq1rk7b.js";
|
|
19
|
-
import"./cli-
|
|
19
|
+
import"./cli-pqv5gvyf.js";
|
|
20
20
|
import"./cli-qntkxysp.js";
|
|
21
21
|
import"./cli-497b685t.js";
|
|
22
22
|
import"./cli-pq2ee5ja.js";
|
|
@@ -2,24 +2,24 @@ import {
|
|
|
2
2
|
bufferThreadMessage,
|
|
3
3
|
getBufferMessageCount,
|
|
4
4
|
wasEventSeen
|
|
5
|
-
} from "./cli-
|
|
5
|
+
} from "./cli-z6gdnbjy.js";
|
|
6
6
|
import {
|
|
7
7
|
hasOtherUserMention
|
|
8
|
-
} from "./cli-
|
|
8
|
+
} from "./cli-y98ry8cz.js";
|
|
9
9
|
import {
|
|
10
10
|
resolveSlackUserId,
|
|
11
11
|
rewriteSlackMentions
|
|
12
|
-
} from "./cli-
|
|
13
|
-
import"./cli-
|
|
12
|
+
} from "./cli-crkvptsz.js";
|
|
13
|
+
import"./cli-v21nahej.js";
|
|
14
14
|
import {
|
|
15
15
|
createTaskWithSiblingAwareness
|
|
16
|
-
} from "./cli-
|
|
16
|
+
} from "./cli-1gzz6pmf.js";
|
|
17
17
|
import {
|
|
18
18
|
ackSlackMessage,
|
|
19
19
|
ensureSlackThreadTree,
|
|
20
20
|
isSlackRenderV2Enabled,
|
|
21
21
|
require_dist
|
|
22
|
-
} from "./cli-
|
|
22
|
+
} from "./cli-1gvam274.js";
|
|
23
23
|
import"./cli-qf9kpsve.js";
|
|
24
24
|
import"./cli-g2p9bd1z.js";
|
|
25
25
|
import"./cli-5tnr64pm.js";
|
|
@@ -30,22 +30,22 @@ import {
|
|
|
30
30
|
init_context_key,
|
|
31
31
|
init_db,
|
|
32
32
|
slackContextKey
|
|
33
|
-
} from "./cli-
|
|
34
|
-
import"./cli-
|
|
33
|
+
} from "./cli-prfghf4h.js";
|
|
34
|
+
import"./cli-d2epf5ae.js";
|
|
35
35
|
import {
|
|
36
36
|
init_resolver,
|
|
37
37
|
resolveTemplate
|
|
38
|
-
} from "./cli-
|
|
38
|
+
} from "./cli-87zrjxdb.js";
|
|
39
39
|
import"./cli-a1rrkrb4.js";
|
|
40
40
|
import"./cli-qt5bt3vk.js";
|
|
41
41
|
import {
|
|
42
42
|
init_env_flag,
|
|
43
43
|
isEnvFlagEnabled
|
|
44
44
|
} from "./cli-nanaxrz6.js";
|
|
45
|
-
import"./cli-
|
|
46
|
-
import"./cli-
|
|
45
|
+
import"./cli-s35981d0.js";
|
|
46
|
+
import"./cli-w4ezqgkj.js";
|
|
47
47
|
import"./cli-mkq1rk7b.js";
|
|
48
|
-
import"./cli-
|
|
48
|
+
import"./cli-pqv5gvyf.js";
|
|
49
49
|
import"./cli-qntkxysp.js";
|
|
50
50
|
import"./cli-497b685t.js";
|
|
51
51
|
import {
|
|
@@ -110,7 +110,7 @@ function createAssistant() {
|
|
|
110
110
|
const channelId = message.channel;
|
|
111
111
|
const messageText = msg.text || "";
|
|
112
112
|
const userId = msg.user || "";
|
|
113
|
-
const renderedMessageText = rewriteSlackMentions(messageText);
|
|
113
|
+
const renderedMessageText = await rewriteSlackMentions(messageText);
|
|
114
114
|
if (!cachedBotUserId) {
|
|
115
115
|
try {
|
|
116
116
|
const authResult = await client.auth.test();
|
|
@@ -130,7 +130,7 @@ function createAssistant() {
|
|
|
130
130
|
sampleEventType: "assistant_message",
|
|
131
131
|
sampleContext: messageText
|
|
132
132
|
}) : undefined;
|
|
133
|
-
const workingAgent = getAgentWorkingOnThread(channelId, threadTs);
|
|
133
|
+
const workingAgent = await getAgentWorkingOnThread(channelId, threadTs);
|
|
134
134
|
if (workingAgent && workingAgent.status !== "offline") {
|
|
135
135
|
if (isAdditiveSlack()) {
|
|
136
136
|
bufferThreadMessage(channelId, threadTs, messageText, userId, message.ts);
|
|
@@ -139,8 +139,8 @@ function createAssistant() {
|
|
|
139
139
|
await safeSetStatus("Queuing follow-up...");
|
|
140
140
|
return;
|
|
141
141
|
}
|
|
142
|
-
const latestTask = getMostRecentTaskInThread(channelId, threadTs);
|
|
143
|
-
const task2 = createTaskWithSiblingAwareness(renderedMessageText, {
|
|
142
|
+
const latestTask = await getMostRecentTaskInThread(channelId, threadTs);
|
|
143
|
+
const task2 = await createTaskWithSiblingAwareness(renderedMessageText, {
|
|
144
144
|
agentId: workingAgent.id,
|
|
145
145
|
source: "slack",
|
|
146
146
|
slackChannelId: channelId,
|
|
@@ -166,9 +166,9 @@ function createAssistant() {
|
|
|
166
166
|
const channelContext = ctx && typeof ctx === "object" && "channel_id" in ctx && ctx.channel_id ? `
|
|
167
167
|
|
|
168
168
|
[User is viewing channel <#${ctx.channel_id}>]` : "";
|
|
169
|
-
const lead = getLeadAgent();
|
|
169
|
+
const lead = await getLeadAgent();
|
|
170
170
|
if (!lead) {
|
|
171
|
-
const task2 = createTaskWithSiblingAwareness(renderedMessageText + channelContext, {
|
|
171
|
+
const task2 = await createTaskWithSiblingAwareness(renderedMessageText + channelContext, {
|
|
172
172
|
source: "slack",
|
|
173
173
|
slackChannelId: channelId,
|
|
174
174
|
slackThreadTs: threadTs,
|
|
@@ -186,7 +186,7 @@ function createAssistant() {
|
|
|
186
186
|
}
|
|
187
187
|
return;
|
|
188
188
|
}
|
|
189
|
-
const task = createTaskWithSiblingAwareness(renderedMessageText + channelContext, {
|
|
189
|
+
const task = await createTaskWithSiblingAwareness(renderedMessageText + channelContext, {
|
|
190
190
|
agentId: lead.id,
|
|
191
191
|
source: "slack",
|
|
192
192
|
slackChannelId: channelId,
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
AzureOpenAI
|
|
3
|
-
} from "./cli-qs9hhsvb.js";
|
|
4
1
|
import {
|
|
5
2
|
convertResponsesMessages,
|
|
6
3
|
convertResponsesTools,
|
|
@@ -13,6 +10,10 @@ import"./cli-5m9j2spm.js";
|
|
|
13
10
|
import {
|
|
14
11
|
retryProviderRequest
|
|
15
12
|
} from "./cli-s8s499xy.js";
|
|
13
|
+
import {
|
|
14
|
+
AzureOpenAI,
|
|
15
|
+
init_openai
|
|
16
|
+
} from "./cli-vsap7a8d.js";
|
|
16
17
|
import {
|
|
17
18
|
formatProviderError,
|
|
18
19
|
normalizeProviderError
|
|
@@ -38,6 +39,7 @@ import {
|
|
|
38
39
|
import"./cli-pq2ee5ja.js";
|
|
39
40
|
|
|
40
41
|
// node_modules/@earendil-works/pi-ai/dist/api/azure-openai-responses.js
|
|
42
|
+
init_openai();
|
|
41
43
|
var DEFAULT_AZURE_API_VERSION = "v1";
|
|
42
44
|
var AZURE_TOOL_CALL_PROVIDERS = new Set(["openai", "openai-codex", "opencode", "azure-openai-responses"]);
|
|
43
45
|
var OPENAI_RESPONSES_MIN_OUTPUT_TOKENS = 16;
|
|
@@ -1,22 +1,23 @@
|
|
|
1
1
|
import {
|
|
2
2
|
embedScript,
|
|
3
3
|
embeddingProvider
|
|
4
|
-
} from "./cli-
|
|
5
|
-
import"./cli-
|
|
6
|
-
import"./cli-
|
|
4
|
+
} from "./cli-h9gpdrzg.js";
|
|
5
|
+
import"./cli-10694wk0.js";
|
|
6
|
+
import"./cli-dr5tcz68.js";
|
|
7
|
+
import"./cli-vsap7a8d.js";
|
|
7
8
|
import {
|
|
8
|
-
|
|
9
|
+
getDbClient,
|
|
9
10
|
init_db
|
|
10
|
-
} from "./cli-
|
|
11
|
-
import"./cli-
|
|
12
|
-
import"./cli-
|
|
11
|
+
} from "./cli-prfghf4h.js";
|
|
12
|
+
import"./cli-d2epf5ae.js";
|
|
13
|
+
import"./cli-87zrjxdb.js";
|
|
13
14
|
import"./cli-a1rrkrb4.js";
|
|
14
15
|
import"./cli-qt5bt3vk.js";
|
|
15
16
|
import"./cli-nanaxrz6.js";
|
|
16
|
-
import"./cli-
|
|
17
|
-
import"./cli-
|
|
17
|
+
import"./cli-s35981d0.js";
|
|
18
|
+
import"./cli-w4ezqgkj.js";
|
|
18
19
|
import"./cli-mkq1rk7b.js";
|
|
19
|
-
import"./cli-
|
|
20
|
+
import"./cli-pqv5gvyf.js";
|
|
20
21
|
import"./cli-pq2ee5ja.js";
|
|
21
22
|
|
|
22
23
|
// src/be/scripts/boot-reembed.ts
|
|
@@ -31,15 +32,14 @@ function toScriptRecord(row) {
|
|
|
31
32
|
};
|
|
32
33
|
}
|
|
33
34
|
async function runBootReembedScripts() {
|
|
34
|
-
const db = getDb();
|
|
35
35
|
const provider = embeddingProvider();
|
|
36
36
|
const expectedBytes = provider.dimensions * Float32Array.BYTES_PER_ELEMENT;
|
|
37
|
-
const missing =
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
const wrongDim =
|
|
41
|
-
|
|
42
|
-
|
|
37
|
+
const missing = await getDbClient().query(`SELECT s.* FROM scripts s
|
|
38
|
+
LEFT JOIN script_embeddings e ON e.scriptId = s.id
|
|
39
|
+
WHERE s.isScratch = 0 AND e.scriptId IS NULL`);
|
|
40
|
+
const wrongDim = await getDbClient().query(`SELECT s.* FROM scripts s
|
|
41
|
+
JOIN script_embeddings e ON e.scriptId = s.id
|
|
42
|
+
WHERE s.isScratch = 0 AND length(e.embedding) != ${expectedBytes}`);
|
|
43
43
|
if (missing.length === 0 && wrongDim.length === 0) {
|
|
44
44
|
return;
|
|
45
45
|
}
|
|
@@ -65,8 +65,8 @@ async function runBootReembedScripts() {
|
|
|
65
65
|
console.error(`[boot-reembed-scripts] failed to embed "${row.name}":`, err.message);
|
|
66
66
|
}
|
|
67
67
|
}
|
|
68
|
-
const afterWrongDim =
|
|
69
|
-
WHERE length(embedding) != ${expectedBytes}`)
|
|
68
|
+
const afterWrongDim = (await getDbClient().get(`SELECT COUNT(*) as count FROM script_embeddings
|
|
69
|
+
WHERE length(embedding) != ${expectedBytes}`))?.count ?? 0;
|
|
70
70
|
console.log(`[boot-reembed-scripts] complete: embedded=${embedded} failed=${failed} remaining_wrong_dim=${afterWrongDim}`);
|
|
71
71
|
}
|
|
72
72
|
export {
|
|
@@ -3,21 +3,22 @@ import {
|
|
|
3
3
|
getEmbeddingProvider,
|
|
4
4
|
getMemoryStore,
|
|
5
5
|
init_constants
|
|
6
|
-
} from "./cli-
|
|
7
|
-
import"./cli-
|
|
6
|
+
} from "./cli-10694wk0.js";
|
|
7
|
+
import"./cli-dr5tcz68.js";
|
|
8
|
+
import"./cli-vsap7a8d.js";
|
|
8
9
|
import {
|
|
9
|
-
|
|
10
|
+
getDbClient,
|
|
10
11
|
init_db
|
|
11
|
-
} from "./cli-
|
|
12
|
-
import"./cli-
|
|
13
|
-
import"./cli-
|
|
12
|
+
} from "./cli-prfghf4h.js";
|
|
13
|
+
import"./cli-d2epf5ae.js";
|
|
14
|
+
import"./cli-87zrjxdb.js";
|
|
14
15
|
import"./cli-a1rrkrb4.js";
|
|
15
16
|
import"./cli-qt5bt3vk.js";
|
|
16
17
|
import"./cli-nanaxrz6.js";
|
|
17
|
-
import"./cli-
|
|
18
|
-
import"./cli-
|
|
18
|
+
import"./cli-s35981d0.js";
|
|
19
|
+
import"./cli-w4ezqgkj.js";
|
|
19
20
|
import"./cli-mkq1rk7b.js";
|
|
20
|
-
import"./cli-
|
|
21
|
+
import"./cli-pqv5gvyf.js";
|
|
21
22
|
import"./cli-pq2ee5ja.js";
|
|
22
23
|
|
|
23
24
|
// src/be/memory/boot-reembed.ts
|
|
@@ -26,9 +27,8 @@ init_constants();
|
|
|
26
27
|
var VECTOR_BYTES = EMBEDDING_DIMENSIONS * Float32Array.BYTES_PER_ELEMENT;
|
|
27
28
|
var BATCH_SIZE = 20;
|
|
28
29
|
async function runBootReembed() {
|
|
29
|
-
const
|
|
30
|
-
|
|
31
|
-
WHERE embedding IS NOT NULL AND length(embedding) != ${VECTOR_BYTES}`).get()?.count ?? 0;
|
|
30
|
+
const invalidCount = (await getDbClient().get(`SELECT COUNT(*) as count FROM agent_memory
|
|
31
|
+
WHERE embedding IS NOT NULL AND length(embedding) != ${VECTOR_BYTES}`))?.count ?? 0;
|
|
32
32
|
if (invalidCount === 0) {
|
|
33
33
|
return;
|
|
34
34
|
}
|
|
@@ -40,8 +40,8 @@ async function runBootReembed() {
|
|
|
40
40
|
}
|
|
41
41
|
console.log(`[boot-reembed] starting: ${invalidCount} rows with wrong embedding dimensions`);
|
|
42
42
|
const store = getMemoryStore();
|
|
43
|
-
const rows =
|
|
44
|
-
WHERE embedding IS NOT NULL AND length(embedding) != ${VECTOR_BYTES}`)
|
|
43
|
+
const rows = await getDbClient().query(`SELECT id, content FROM agent_memory
|
|
44
|
+
WHERE embedding IS NOT NULL AND length(embedding) != ${VECTOR_BYTES}`);
|
|
45
45
|
let reembedded = 0;
|
|
46
46
|
let failed = 0;
|
|
47
47
|
for (let i = 0;i < rows.length; i += BATCH_SIZE) {
|
|
@@ -50,7 +50,7 @@ async function runBootReembed() {
|
|
|
50
50
|
const embeddings = await provider.embedBatch(batch.map((m) => m.content));
|
|
51
51
|
for (let j = 0;j < embeddings.length; j++) {
|
|
52
52
|
if (embeddings[j]) {
|
|
53
|
-
store.updateEmbedding(batch[j].id, embeddings[j], provider.name);
|
|
53
|
+
await store.updateEmbedding(batch[j].id, embeddings[j], provider.name);
|
|
54
54
|
reembedded++;
|
|
55
55
|
}
|
|
56
56
|
}
|
|
@@ -59,8 +59,8 @@ async function runBootReembed() {
|
|
|
59
59
|
console.error(`[boot-reembed] batch ${Math.floor(i / BATCH_SIZE) + 1} failed:`, err.message);
|
|
60
60
|
}
|
|
61
61
|
}
|
|
62
|
-
const afterInvalid =
|
|
63
|
-
WHERE embedding IS NOT NULL AND length(embedding) != ${VECTOR_BYTES}`)
|
|
62
|
+
const afterInvalid = (await getDbClient().get(`SELECT COUNT(*) as count FROM agent_memory
|
|
63
|
+
WHERE embedding IS NOT NULL AND length(embedding) != ${VECTOR_BYTES}`))?.count ?? 0;
|
|
64
64
|
console.log(`[boot-reembed] complete: reembedded=${reembedded} failed=${failed} remaining_invalid=${afterInvalid}`);
|
|
65
65
|
}
|
|
66
66
|
export {
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
2
|
+
getDbClient,
|
|
3
3
|
init_db
|
|
4
|
-
} from "./cli-
|
|
5
|
-
import"./cli-
|
|
6
|
-
import"./cli-
|
|
4
|
+
} from "./cli-prfghf4h.js";
|
|
5
|
+
import"./cli-d2epf5ae.js";
|
|
6
|
+
import"./cli-87zrjxdb.js";
|
|
7
7
|
import"./cli-a1rrkrb4.js";
|
|
8
8
|
import"./cli-qt5bt3vk.js";
|
|
9
9
|
import"./cli-nanaxrz6.js";
|
|
10
|
-
import"./cli-
|
|
11
|
-
import"./cli-
|
|
10
|
+
import"./cli-s35981d0.js";
|
|
11
|
+
import"./cli-w4ezqgkj.js";
|
|
12
12
|
import {
|
|
13
13
|
init_secret_scrubber,
|
|
14
14
|
scrubSecrets
|
|
15
15
|
} from "./cli-mkq1rk7b.js";
|
|
16
|
-
import"./cli-
|
|
16
|
+
import"./cli-pqv5gvyf.js";
|
|
17
17
|
import"./cli-pq2ee5ja.js";
|
|
18
18
|
|
|
19
19
|
// src/be/boot-scrub-logs.ts
|
|
@@ -24,64 +24,62 @@ var CURSOR_KEY = "boot-scrub-logs-v2-cursor";
|
|
|
24
24
|
var BATCH_SIZE = 200;
|
|
25
25
|
var yieldTick = () => new Promise((r) => setTimeout(r, 5));
|
|
26
26
|
async function runBootScrubLogs() {
|
|
27
|
-
const
|
|
28
|
-
const done = db.prepare("SELECT key FROM seed_state WHERE kind = ? AND key = ?").get("maintenance", SCRUB_KEY);
|
|
27
|
+
const done = await getDbClient().get("SELECT key FROM seed_state WHERE kind = ? AND key = ?", ["maintenance", SCRUB_KEY]);
|
|
29
28
|
if (done)
|
|
30
29
|
return;
|
|
31
|
-
const savedCursor =
|
|
30
|
+
const savedCursor = (await getDbClient().get("SELECT seededHash FROM seed_state WHERE kind = ? AND key = ?", ["maintenance", CURSOR_KEY]))?.seededHash ?? "";
|
|
32
31
|
const lastProcessedId = savedCursor || "";
|
|
33
|
-
const totalRemaining =
|
|
32
|
+
const totalRemaining = (await getDbClient().get(`SELECT COUNT(*) as count FROM session_logs
|
|
34
33
|
WHERE id > ?
|
|
35
34
|
AND (content LIKE '%lin!_oauth!_%' ESCAPE '!'
|
|
36
35
|
OR content LIKE '%lin!_api!_%' ESCAPE '!'
|
|
37
36
|
OR content LIKE '%npm!_%' ESCAPE '!'
|
|
38
|
-
OR content LIKE '%ATATT%')
|
|
37
|
+
OR content LIKE '%ATATT%')`, [lastProcessedId]))?.count ?? 0;
|
|
39
38
|
if (totalRemaining === 0) {
|
|
40
|
-
markDone(
|
|
39
|
+
await markDone();
|
|
41
40
|
return;
|
|
42
41
|
}
|
|
43
42
|
console.log(`[boot-scrub-logs] starting: ${totalRemaining} candidate rows remaining` + (lastProcessedId ? ` (resuming from cursor ${lastProcessedId.slice(0, 8)}…)` : ""));
|
|
44
|
-
const
|
|
45
|
-
WHERE id > ?
|
|
46
|
-
AND (content LIKE '%lin!_oauth!_%' ESCAPE '!'
|
|
47
|
-
OR content LIKE '%lin!_api!_%' ESCAPE '!'
|
|
48
|
-
OR content LIKE '%npm!_%' ESCAPE '!'
|
|
49
|
-
OR content LIKE '%ATATT%')
|
|
50
|
-
ORDER BY id ASC
|
|
51
|
-
LIMIT ${BATCH_SIZE}`);
|
|
52
|
-
const update = db.prepare("UPDATE session_logs SET content = ? WHERE id = ?");
|
|
53
|
-
const saveCursor = db.prepare(`INSERT INTO seed_state (kind, key, seededHash, seededAt)
|
|
43
|
+
const saveCursorSql = `INSERT INTO seed_state (kind, key, seededHash, seededAt)
|
|
54
44
|
VALUES ('maintenance', '${CURSOR_KEY}', ?, datetime('now'))
|
|
55
|
-
ON CONFLICT (kind, key) DO UPDATE SET seededHash = ?, seededAt = datetime('now')
|
|
45
|
+
ON CONFLICT (kind, key) DO UPDATE SET seededHash = ?, seededAt = datetime('now')`;
|
|
56
46
|
let scrubbed = 0;
|
|
57
47
|
let scanned = 0;
|
|
58
48
|
let cursor = lastProcessedId;
|
|
59
49
|
for (;; ) {
|
|
60
|
-
const rows =
|
|
50
|
+
const rows = await getDbClient().query(`SELECT id, content FROM session_logs
|
|
51
|
+
WHERE id > ?
|
|
52
|
+
AND (content LIKE '%lin!_oauth!_%' ESCAPE '!'
|
|
53
|
+
OR content LIKE '%lin!_api!_%' ESCAPE '!'
|
|
54
|
+
OR content LIKE '%npm!_%' ESCAPE '!'
|
|
55
|
+
OR content LIKE '%ATATT%')
|
|
56
|
+
ORDER BY id ASC
|
|
57
|
+
LIMIT ${BATCH_SIZE}`, [cursor]);
|
|
61
58
|
if (rows.length === 0)
|
|
62
59
|
break;
|
|
63
60
|
const batchLastId = rows[rows.length - 1].id;
|
|
64
|
-
|
|
61
|
+
await getDbClient().transaction(async (tx) => {
|
|
65
62
|
for (const row of rows) {
|
|
66
63
|
const cleaned = scrubSecrets(row.content);
|
|
67
64
|
if (cleaned !== row.content) {
|
|
68
|
-
|
|
65
|
+
await tx.run("UPDATE session_logs SET content = ? WHERE id = ?", [cleaned, row.id]);
|
|
69
66
|
scrubbed++;
|
|
70
67
|
}
|
|
71
68
|
}
|
|
72
|
-
|
|
69
|
+
await tx.run(saveCursorSql, [batchLastId, batchLastId]);
|
|
73
70
|
});
|
|
74
|
-
tx();
|
|
75
71
|
scanned += rows.length;
|
|
76
72
|
cursor = batchLastId;
|
|
77
73
|
await yieldTick();
|
|
78
74
|
}
|
|
79
|
-
markDone(
|
|
80
|
-
|
|
75
|
+
await markDone();
|
|
76
|
+
await getDbClient().run("DELETE FROM seed_state WHERE kind = 'maintenance' AND key = ?", [
|
|
77
|
+
CURSOR_KEY
|
|
78
|
+
]);
|
|
81
79
|
console.log(`[boot-scrub-logs] complete: scanned=${scanned} scrubbed=${scrubbed}`);
|
|
82
80
|
}
|
|
83
|
-
function markDone(
|
|
84
|
-
|
|
81
|
+
async function markDone() {
|
|
82
|
+
await getDbClient().run(`INSERT INTO seed_state (kind, key, seededHash, seededAt)
|
|
85
83
|
VALUES ('maintenance', ?, 'done', datetime('now'))
|
|
86
84
|
ON CONFLICT (kind, key) DO UPDATE SET seededHash = 'done', seededAt = datetime('now')`, [SCRUB_KEY]);
|
|
87
85
|
}
|
|
@@ -12,32 +12,32 @@ import {
|
|
|
12
12
|
resolveClaudeBinary,
|
|
13
13
|
resolveClaudeBinaryArgv,
|
|
14
14
|
resolveClaudeBridgeEnabled
|
|
15
|
-
} from "./cli-
|
|
16
|
-
import"./cli-
|
|
15
|
+
} from "./cli-8ca5b9j9.js";
|
|
16
|
+
import"./cli-a2brkr6h.js";
|
|
17
17
|
import"./cli-a3pkfpqs.js";
|
|
18
18
|
import"./cli-tng3131n.js";
|
|
19
19
|
import"./cli-zm7njwzd.js";
|
|
20
20
|
import"./cli-cw70hymf.js";
|
|
21
|
-
import"./cli-
|
|
22
|
-
import"./cli-
|
|
21
|
+
import"./cli-y37pxs1m.js";
|
|
22
|
+
import"./cli-hp1n6zq3.js";
|
|
23
23
|
import"./cli-v1mwc5v2.js";
|
|
24
|
-
import"./cli-
|
|
24
|
+
import"./cli-8p37s71j.js";
|
|
25
25
|
import"./cli-e7d20cty.js";
|
|
26
26
|
import"./cli-8whqavk2.js";
|
|
27
27
|
import"./cli-qh4sqfws.js";
|
|
28
28
|
import"./cli-3dpj7atn.js";
|
|
29
29
|
import"./cli-f14fvzag.js";
|
|
30
|
-
import"./cli-
|
|
30
|
+
import"./cli-dr5tcz68.js";
|
|
31
31
|
import"./cli-whrvct19.js";
|
|
32
|
-
import"./cli-
|
|
33
|
-
import"./cli-
|
|
32
|
+
import"./cli-d2epf5ae.js";
|
|
33
|
+
import"./cli-87zrjxdb.js";
|
|
34
34
|
import"./cli-a1rrkrb4.js";
|
|
35
35
|
import"./cli-qt5bt3vk.js";
|
|
36
36
|
import"./cli-nanaxrz6.js";
|
|
37
|
-
import"./cli-
|
|
38
|
-
import"./cli-
|
|
37
|
+
import"./cli-s35981d0.js";
|
|
38
|
+
import"./cli-w4ezqgkj.js";
|
|
39
39
|
import"./cli-mkq1rk7b.js";
|
|
40
|
-
import"./cli-
|
|
40
|
+
import"./cli-pqv5gvyf.js";
|
|
41
41
|
import"./cli-darcwax3.js";
|
|
42
42
|
import"./cli-00w4hbam.js";
|
|
43
43
|
import"./cli-7jcc9y1r.js";
|
|
@@ -3,11 +3,11 @@ import {
|
|
|
3
3
|
checkClaudeManagedCredentials,
|
|
4
4
|
composeManagedUserMessage,
|
|
5
5
|
normalizeRepoUrl
|
|
6
|
-
} from "./cli-
|
|
7
|
-
import"./cli-
|
|
6
|
+
} from "./cli-77vf7z36.js";
|
|
7
|
+
import"./cli-hsxj0yar.js";
|
|
8
8
|
import"./cli-cw70hymf.js";
|
|
9
9
|
import"./cli-f64gdfxc.js";
|
|
10
|
-
import"./cli-
|
|
10
|
+
import"./cli-hp1n6zq3.js";
|
|
11
11
|
import"./cli-jepmgn7r.js";
|
|
12
12
|
import"./cli-mkq1rk7b.js";
|
|
13
13
|
import"./cli-pq2ee5ja.js";
|