@desplega.ai/agent-swarm 1.164.1 → 1.166.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/acp-adapter-yzfxn8vj.js +23 -0
- package/dist/{actions-hp2h32dx.js → actions-qz3m692w.js} +24 -28
- package/dist/{amp-adapter-zfd7djyx.js → amp-adapter-j1xbmsqz.js} +7 -7
- package/dist/{app-w2d26h4f.js → app-43vrdmv8.js} +9 -10
- package/dist/{assistant-45pc4en7.js → assistant-ertffmka.js} +25 -29
- package/dist/{boot-reembed-k1q2s4fc.js → boot-reembed-998jtpdg.js} +12 -15
- package/dist/{boot-reembed-6rhcpsjf.js → boot-reembed-s7k7c6v2.js} +13 -15
- package/dist/boot-scrub-sweep-nepsk4t1.js +211 -0
- package/dist/{boot-seeds-ex93edx7.js → boot-seeds-vvzs1zhk.js} +12 -12
- package/dist/{claude-adapter-hcxd0szm.js → claude-adapter-2zvmekrp.js} +15 -17
- package/dist/{claude-managed-adapter-fz7xps2r.js → claude-managed-adapter-s49wbk8t.js} +5 -5
- package/dist/{claude-managed-setup-xx6f15h9.js → claude-managed-setup-cvhqq8qn.js} +4 -4
- package/dist/{claude-sdk-session-6nb9raem.js → claude-sdk-session-kkbxtw5q.js} +2624 -2606
- package/dist/{cli-etbrt8x1.js → cli-0nhdwxd5.js} +4 -4
- package/dist/{cli-jeefgppq.js → cli-0qjcsxgz.js} +7 -7
- package/dist/{cli-6behs2bt.js → cli-32bca7nr.js} +1 -1
- package/dist/{cli-gt8v96qx.js → cli-3ddybbbx.js} +4 -4
- package/dist/{acp-adapter-rxvek4ym.js → cli-3qn4r334.js} +317 -35
- package/dist/{cli-1d3w4xm3.js → cli-4r1sjfc4.js} +14 -6
- package/dist/{cli-691f2rxm.js → cli-66zh26sp.js} +68 -16
- package/dist/{cli-et8wdyqh.js → cli-68r1j4sg.js} +9 -9
- package/dist/{cli-xb7kyanp.js → cli-8kgvmkak.js} +3 -3
- package/dist/{cli-fdpkw8vk.js → cli-8t229cmr.js} +8 -8
- package/dist/{cli-gc54qc0p.js → cli-aqcey741.js} +1 -1
- package/dist/{cli-4q4cmr4t.js → cli-cpfmqz3n.js} +8 -8
- package/dist/{cli-a9bw0xxt.js → cli-df56tqdw.js} +997 -408
- package/dist/{cli-n7h1kqpf.js → cli-dmtrxqhg.js} +6 -1
- package/dist/{cli-xfb7333f.js → cli-dw2q9f7g.js} +5 -5
- package/dist/{cli-4drstbb9.js → cli-ecknp7p1.js} +81 -23
- package/dist/{cli-v0pvvhfq.js → cli-efnd2kce.js} +36 -1
- package/dist/{cli-1wetf34q.js → cli-f2n17zhp.js} +1 -1
- package/dist/{cli-2c8eky5y.js → cli-feh3dkah.js} +1 -1
- package/dist/cli-fn697bnt.js +126 -0
- package/dist/{cli-v5pr2fgt.js → cli-gt8azyet.js} +3 -3
- package/dist/{cli-dbszf3rw.js → cli-h3x613ze.js} +4 -4
- package/dist/{cli-nwhb8y2e.js → cli-hf5s9pgf.js} +1 -1
- package/dist/cli-j2jbr8af.js +516 -0
- package/dist/{cli-agjzafns.js → cli-jhm6hzjn.js} +593 -10
- package/dist/{cli-j0tmc908.js → cli-jvj6a0cv.js} +484 -477
- package/dist/{cli-xxz89c2n.js → cli-mb75wpxf.js} +1 -1
- package/dist/{cli-07s39g1n.js → cli-mv2520nm.js} +1 -1
- package/dist/{cli-v90vfwyb.js → cli-mwegs4af.js} +5 -5
- package/dist/{cli-bz1gbac9.js → cli-p4ztb80h.js} +2 -2
- package/dist/{cli-1wd1n2ya.js → cli-rfphkzh5.js} +1 -1
- package/dist/{cli-976r1zqx.js → cli-rggdq8wq.js} +5 -5
- package/dist/{cli-3ajw5v5v.js → cli-rsy933yz.js} +6 -6
- package/dist/{cli-yj790e19.js → cli-tadfgd0t.js} +8 -1
- package/dist/{cli-cn53e7vc.js → cli-ttbsse3f.js} +6 -1
- package/dist/{cli-dyqsrqcf.js → cli-v2a8x45d.js} +4 -4
- package/dist/{cli-wbvnn6tk.js → cli-v6vv7dy8.js} +91 -9
- package/dist/{cli-z2ap2c0c.js → cli-vzc73wet.js} +90 -55
- package/dist/cli-wt7ccy4r.js +2654 -0
- package/dist/{cli-4cn19jvn.js → cli-x7kpr72a.js} +3 -3
- package/dist/{cli-003785v9.js → cli-xvc3q9br.js} +1 -1
- package/dist/{cli-v0e7jpr5.js → cli-xvdgasgy.js} +13 -4
- package/dist/{cli-asqeg4ve.js → cli-y59h2pk9.js} +2 -2
- package/dist/{cli-0wn3ypqv.js → cli-yshaazs1.js} +14121 -3478
- package/dist/{cli-wg8yjqtw.js → cli-ysnyhws9.js} +16 -3
- package/dist/cli-zp67qg5x.js +92 -0
- package/dist/{cli-g3qgrzck.js → cli-zsh093hk.js} +71 -3
- package/dist/{cli-ma3zvh39.js → cli-zy7vwsne.js} +6066 -5829
- package/dist/cli.js +79 -26
- package/dist/{codex-adapter-pcxdn10v.js → codex-adapter-dw1wxqt8.js} +10 -10
- package/dist/{codex-hook-b1fb7c2k.js → codex-hook-d2rkvf39.js} +1 -1
- package/dist/{codex-login-059nm145.js → codex-login-terbdsqq.js} +2 -2
- package/dist/{codex-session-runner-xzwwddp8.js → codex-session-runner-3cgb8y1g.js} +10 -10
- package/dist/{commands-98at8mkn.js → commands-mhxam6z2.js} +9 -9
- package/dist/{cursor-adapter-dkg6qnkp.js → cursor-adapter-2qda3st7.js} +6 -6
- package/dist/{db-01g8wtvw.js → db-sjks418k.js} +11 -9
- package/dist/{devin-adapter-qmttt2fz.js → devin-adapter-bffjj5n4.js} +2 -2
- package/dist/{dispatcher-nn2k1wxd.js → dispatcher-1es759rn.js} +22 -26
- package/dist/{dsh-adapter-w4d4vwdq.js → dsh-adapter-bek4cyw9.js} +6 -6
- package/dist/{e2b-9e4g2hvt.js → e2b-nd50eccg.js} +1 -1
- package/dist/{event-bus-z7v2t26e.js → event-bus-vnfthafg.js} +2 -2
- package/dist/grok-adapter-ar9cw9jg.js +29 -0
- package/dist/{handlers-b0kqsbg8.js → handlers-1gkbhktr.js} +25 -29
- package/dist/{hook-sap7v1aj.js → hook-ds2zxq9v.js} +16 -18
- package/dist/{hook-pz50gqep.js → hook-vxa3tcsy.js} +10 -12
- package/dist/{http-ncr8rmd0.js → http-3h21z9md.js} +679 -227
- package/dist/{index-c4aqcyz1.js → index-9b65j1m5.js} +11 -11
- package/dist/{index-r46s01nq.js → index-bn6cy8ps.js} +22 -26
- package/dist/{index-38kqdt3e.js → index-dkfxpkmm.js} +23 -27
- package/dist/{index-630kj5vd.js → index-f8xnqrye.js} +55 -43
- package/dist/{index-fdk1t4d6.js → index-n0rxa4ca.js} +11962 -9900
- package/dist/{index-9nrj7797.js → index-n99fycq7.js} +22 -26
- package/dist/{keepalive-31613r2h.js → keepalive-3xspa9jw.js} +14 -11
- package/dist/{lead-mx59tr5s.js → lead-6qphc124.js} +43 -43
- package/dist/{maintenance-55ff39ca.js → maintenance-0teem1bb.js} +10 -12
- package/dist/{node-f0ykebbv.js → node-9sg7ajby.js} +25 -7
- package/dist/{oauth-refresh-sweep-anma954w.js → oauth-refresh-sweep-sh9q25xp.js} +13 -10
- package/dist/{onboard-b2fy8ftb.js → onboard-54qmnqxe.js} +4 -3
- package/dist/{opencode-adapter-p1s92tmy.js → opencode-adapter-wjfa2wvd.js} +6 -6
- package/dist/{otel-impl-9brvt7xv.js → otel-impl-ycqzp2a1.js} +2 -2
- package/dist/{pi-mono-adapter-kz4rrwvd.js → pi-mono-adapter-e77e9zst.js} +6 -6
- package/dist/{pricing-refresh-7w8mbmva.js → pricing-refresh-atnkngqs.js} +10 -10
- package/dist/{rbac-roles-ejp7qwvb.js → rbac-roles-9pjphh9q.js} +10 -10
- package/dist/{rbac-roles-nhk4r7bc.js → rbac-roles-j78wdksm.js} +10 -10
- package/dist/{render-v2-2gzt8skq.js → render-v2-pxjs49fx.js} +9 -10
- package/dist/{setup-5et8t412.js → setup-ymej0xtx.js} +2 -2
- package/dist/{work-objects-tb0er7qa.js → work-objects-3nh4ymzb.js} +26 -30
- package/dist/{worker-62cv075d.js → worker-qa9fkz5s.js} +43 -43
- package/dist/{x-vbxb31jr.js → x-ma4gnfgy.js} +2 -2
- package/openapi.json +457 -31
- package/package.json +14 -6
- package/plugin/commands/create-pr.md +7 -1
- package/plugin/pi-skills/create-pr/SKILL.md +7 -1
- package/src/agentmail/app.ts +5 -4
- package/src/be/automation-preflight.ts +11 -9
- package/src/be/boot-scrub-sweep.ts +302 -0
- package/src/be/connector-codes.ts +81 -0
- package/src/be/crypto/key-bootstrap.ts +1 -1
- package/src/be/db/approvals.ts +15 -1
- package/src/be/db/codex-oauth-device-flows.ts +40 -0
- package/src/be/db/config-secrets.ts +31 -0
- package/src/be/db/runtime.ts +4 -0
- package/src/be/db/script-runs.ts +15 -0
- package/src/be/db/tasks/write.ts +1 -1
- package/src/be/db-queries/mcp-oauth.ts +5 -0
- package/src/be/db-queries/oauth.ts +77 -0
- package/src/be/db.ts +162 -59
- package/src/be/events.ts +17 -1
- package/src/be/memory/index-content.ts +2 -2
- package/src/be/memory/providers/sqlite-store.ts +63 -11
- package/src/be/memory/types.ts +14 -0
- package/src/be/migrations/197_connector_codes.sql +23 -0
- package/src/be/migrations/198_permission_audit_guest.sql +33 -0
- package/src/be/migrations/200_backfill_auto_memory_expiry.sql +20 -0
- package/src/be/migrations/201_workflow_replay_columns.sql +10 -0
- package/src/be/migrations/202_codex_oauth_device_flows.sql +24 -0
- package/src/be/model-tier-resolution.ts +2 -1
- package/src/be/model-validation.ts +1 -1
- package/src/be/pricing-normalize.ts +3 -0
- package/src/be/rbac-audit.ts +2 -1
- package/src/be/scripts/db.ts +28 -4
- package/src/be/scripts/source-secrets.ts +37 -0
- package/src/be/scripts/typecheck.ts +23 -2
- package/src/be/scrub-json.ts +32 -0
- package/src/be/sealed-json.ts +59 -0
- package/src/be/secret-registry.ts +131 -0
- package/src/be/seed-pricing.ts +14 -0
- package/src/be/users.ts +7 -1
- package/src/be/workflow-replay.ts +77 -0
- package/src/cli.tsx +7 -0
- package/src/commands/provider-credentials.ts +46 -8
- package/src/commands/runner.ts +2 -10
- package/src/extensions/contract-types.generated.ts +1 -1
- package/src/github/app.ts +4 -4
- package/src/heartbeat/heartbeat.ts +20 -8
- package/src/hooks/pr-body-guard.ts +1 -1
- package/src/http/agents.ts +1 -0
- package/src/http/approval-requests.ts +1 -0
- package/src/http/apps.ts +3 -0
- package/src/http/auth.ts +4 -1
- package/src/http/codex-oauth-device.ts +8 -10
- package/src/http/codex-oauth-keep-warm.ts +2 -2
- package/src/http/config-values.ts +59 -0
- package/src/http/config.ts +5 -0
- package/src/http/db-query-bounded.ts +3 -0
- package/src/http/db-query-shared.ts +107 -15
- package/src/http/db-query.ts +10 -2
- package/src/http/extensions.ts +1 -0
- package/src/http/index.ts +23 -6
- package/src/http/integrations.ts +1 -38
- package/src/http/ip-rate-limit.ts +82 -0
- package/src/http/kv.ts +38 -4
- package/src/http/mcp-servers.ts +1 -0
- package/src/http/memory.ts +9 -0
- package/src/http/models-catalog.ts +2 -0
- package/src/http/operator-actor.ts +4 -0
- package/src/http/page-proxy.ts +22 -0
- package/src/http/pages.ts +4 -2
- package/src/http/realtime.ts +1 -1
- package/src/http/request-principal.ts +14 -1
- package/src/http/script-connections.ts +8 -0
- package/src/http/script-runs.ts +12 -4
- package/src/http/scripts.ts +15 -0
- package/src/http/session-cost-recompute.ts +3 -2
- package/src/http/tasks.ts +9 -0
- package/src/http/users.ts +226 -0
- package/src/http/workflows.ts +3 -2
- package/src/http.ts +1 -0
- package/src/integrations/kapso/client.ts +3 -1
- package/src/jira/app.ts +2 -2
- package/src/kv-view.ts +324 -0
- package/src/linear/app.ts +2 -2
- package/src/oauth/mcp-wrapper.ts +1 -1
- package/src/prompts/memories.ts +42 -1
- package/src/providers/acp-adapter.ts +85 -24
- package/src/providers/acp-target-catalog.ts +54 -1
- package/src/providers/acp-targets.ts +358 -4
- package/src/providers/amp-adapter.ts +1 -1
- package/src/providers/cursor-adapter.ts +1 -1
- package/src/providers/grok-adapter.ts +186 -0
- package/src/providers/index.ts +5 -1
- package/src/providers/pricing-sources.md +6 -0
- package/src/providers/reasoning-effort.ts +17 -1
- package/src/providers/types.ts +2 -1
- package/src/rbac/can.ts +4 -3
- package/src/rbac/legacy-policy.ts +3 -3
- package/src/rbac/types.ts +6 -0
- package/src/script-workflows/supervisor.ts +11 -2
- package/src/scripts-runtime/eval-harness.ts +2 -12
- package/src/scripts-runtime/executors/quickjs-bundle.ts +152 -0
- package/src/scripts-runtime/executors/quickjs-prelude.ts +285 -0
- package/src/scripts-runtime/executors/quickjs-runner.ts +580 -0
- package/src/scripts-runtime/executors/quickjs-worker.ts +81 -0
- package/src/scripts-runtime/executors/quickjs.ts +196 -0
- package/src/scripts-runtime/executors/registry.ts +2 -0
- package/src/scripts-runtime/executors/sourcemap.ts +79 -0
- package/src/scripts-runtime/script-error-hints.ts +14 -0
- package/src/scripts-runtime/swarm-sdk.ts +9 -2
- package/src/scripts-runtime/types/stdlib.d.ts +27 -8
- package/src/scripts-runtime/types/swarm-extension.d.ts +3 -0
- package/src/scripts-runtime/types/swarm-sdk.d.ts +27 -8
- package/src/server-user.ts +2 -20
- package/src/server.ts +3 -1
- package/src/slack/app.ts +4 -0
- package/src/slack/config.ts +3 -1
- package/src/slack/egress-scrub.ts +87 -0
- package/src/tests/acp-adapter.test.ts +191 -2
- package/src/tests/boot-scrub-sweep.test.ts +390 -0
- package/src/tests/budget-user-scope.test.ts +7 -21
- package/src/tests/check-pr-body.test.ts +149 -6
- package/src/tests/check-text-columns.test.ts +145 -0
- package/src/tests/claude-adapter-binary.test.ts +1 -1
- package/src/tests/claude-sdk-process.fixture.ts +13 -2
- package/src/tests/codex-oauth-device.test.ts +23 -37
- package/src/tests/codex-oauth-keep-warm.test.ts +29 -0
- package/src/tests/console-scrub.test.ts +141 -0
- package/src/tests/credential-check.test.ts +90 -0
- package/src/tests/db-query-denylist.test.ts +202 -0
- package/src/tests/db-task-read-contract.test.ts +1 -0
- package/src/tests/db-task-write-contract.test.ts +1 -0
- package/src/tests/docs-index-footprint.test.js +3 -3
- package/src/tests/entrypoint-acp-target-binary.test.ts +44 -1
- package/src/tests/events-scrub.test.ts +88 -0
- package/src/tests/explicit-model-validation.test.ts +81 -0
- package/src/tests/extensions-pre-task.test.ts +33 -1
- package/src/tests/fixtures/grok/acp-updates-recorded.jsonl +53 -0
- package/src/tests/fixtures/grok/prompt-response-meta.json +36 -0
- package/src/tests/fixtures/secret-corpus.ts +320 -0
- package/src/tests/grok-adapter.test.ts +647 -0
- package/src/tests/heartbeat-checklist.test.ts +44 -0
- package/src/tests/integration-disable-flags.test.ts +156 -0
- package/src/tests/kv-http.test.ts +34 -0
- package/src/tests/kv-tool.test.ts +274 -1
- package/src/tests/kv-view.test.ts +147 -0
- package/src/tests/mcp-user-route.test.ts +257 -15
- package/src/tests/memory-injection-outcome.test.ts +143 -0
- package/src/tests/model-tier-resolution.test.ts +76 -3
- package/src/tests/page-guest-session.test.ts +424 -0
- package/src/tests/page-proxy.test.ts +1 -1
- package/src/tests/page-viewer-auth.test.ts +22 -1
- package/src/tests/pr-body-leaks.test.ts +157 -2
- package/src/tests/preload.ts +10 -0
- package/src/tests/provider-registration.test.ts +3 -1
- package/src/tests/rbac-audit.test.ts +32 -0
- package/src/tests/rbac-mcp-admission-e2e.test.ts +4 -62
- package/src/tests/script-connections.test.ts +9 -0
- package/src/tests/script-executor-conformance.test.ts +3 -0
- package/src/tests/script-executor-quickjs.test.ts +442 -0
- package/src/tests/script-executor-registry.test.ts +6 -1
- package/src/tests/script-runs-http.test.ts +126 -1
- package/src/tests/script-runs-scrub.test.ts +275 -0
- package/src/tests/scripts-http.test.ts +82 -1
- package/src/tests/scripts-mcp-e2e.test.ts +42 -6
- package/src/tests/scripts-runtime.test.ts +37 -0
- package/src/tests/scrubbed-text-12e.test.ts +289 -0
- package/src/tests/sealed-key-guard.test.ts +166 -0
- package/src/tests/secret-canary-sweep.test.ts +958 -0
- package/src/tests/secret-registry.test.ts +355 -0
- package/src/tests/secret-rules.test.ts +230 -0
- package/src/tests/secret-scrubber.test.ts +317 -1
- package/src/tests/session-costs-golden.test.ts +17 -0
- package/src/tests/slack-egress-scrub.test.ts +216 -0
- package/src/tests/swarm-tool-result-gate.test.ts +143 -30
- package/src/tests/task-tools-ctx.test.ts +3 -0
- package/src/tests/user-token-routes.test.ts +342 -3
- package/src/tests/workflow-replay.test.ts +518 -0
- package/src/tests/workflow-scrub.test.ts +242 -0
- package/src/tests/workflow-system-one-decision-providers.test.ts +737 -0
- package/src/tools/db-query.ts +1 -1
- package/src/tools/inject-learning.ts +1 -1
- package/src/tools/kv/kv-get.ts +136 -6
- package/src/tools/send-task.ts +61 -17
- package/src/tools/utils.ts +186 -43
- package/src/tools/workflows/get-workflow-run.ts +3 -2
- package/src/types.ts +16 -1
- package/src/utils/console-scrub-install.ts +5 -0
- package/src/utils/console-scrub.ts +57 -0
- package/src/utils/credentials.ts +8 -0
- package/src/utils/page-session.ts +6 -2
- package/src/utils/pr-body-leaks.ts +149 -10
- package/src/utils/request-auth-context.ts +2 -0
- package/src/utils/secret-rules.generated.ts +2055 -0
- package/src/utils/secret-scrubber.ts +662 -36
- package/src/workflows/engine.ts +39 -4
- package/src/workflows/executors/notify.ts +6 -1
- package/src/workflows/executors/system-one-decision.ts +31 -12
- package/src/workflows/executors/system-one-openai-wire.ts +168 -0
- package/src/workflows/executors/system-one-providers.ts +112 -11
- package/src/workflows/executors/system-one-wire.ts +79 -0
- package/src/workflows/recovery.ts +10 -1
- package/src/workflows/resume.ts +62 -3
- package/src/workflows/retry-poller.ts +3 -0
- package/templates/ai-toolbox.manifest.json +2 -2
- package/templates/skills/agent-browser/SKILL.md +5 -5
- package/templates/skills/agent-browser/config.json +1 -1
- package/templates/skills/agent-browser/content.md +4 -4
- package/templates/skills/artifacts/content.md +17 -7
- package/templates/skills/jira-interaction/config.json +1 -1
- package/templates/skills/jira-interaction/content.md +56 -205
- package/templates/skills/linear-interaction/config.json +1 -1
- package/templates/skills/linear-interaction/content.md +31 -50
- package/templates/skills/pages/content.md +8 -4
- package/templates/skills/qa/content.md +2 -2
- package/templates/skills/workflow-iterate/content.md +4 -4
- package/tsconfig.json +3 -3
- package/dist/boot-scrub-logs-t8xg7wd7.js +0 -99
- package/dist/cli-0a7r5331.js +0 -168
- package/dist/cli-93rxw9yd.js +0 -951
- package/dist/cli-cvk6yzw5.js +0 -40
- package/dist/cli-dgnj0zcc.js +0 -40
- package/dist/cli-qt5wzq6v.js +0 -256
- package/dist/cli-v7fqehqd.js +0 -9281
- package/dist/cli-vbr859rz.js +0 -572
- package/src/be/boot-scrub-logs.ts +0 -132
package/README.md
CHANGED
|
@@ -22,7 +22,7 @@ agent-swarm.dev is an open-source operating system for AI work. A lead agent del
|
|
|
22
22
|
- Workflows, schedules, scripts, and apps for recurring work
|
|
23
23
|
- [Extensions](https://docs.agent-swarm.dev/docs/guides/extensions) for trusted TypeScript hooks, installed as agent-owned inert drafts and activated by a trusted lead, operator, or dashboard user
|
|
24
24
|
- [Realtime rooms](./runbooks/realtime-rooms.md) for shared page state, presence, and live channels
|
|
25
|
-
- Your choice of harness and models: Claude Code, Codex, pi, opencode, [Cursor](https://docs.agent-swarm.dev/docs/guides/provider-auth/cursor), Amp, Devin, or ACP agents
|
|
25
|
+
- Your choice of harness and models: Claude Code, Codex, pi, opencode, [Cursor](https://docs.agent-swarm.dev/docs/guides/provider-auth/cursor), Amp, [Grok](https://docs.agent-swarm.dev/docs/guides/provider-auth/grok), Devin, or ACP agents
|
|
26
26
|
|
|
27
27
|
```mermaid
|
|
28
28
|
flowchart LR
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ACPAdapter,
|
|
3
|
+
applyConfiguredOptions,
|
|
4
|
+
sanitizeAcpConfigOptions,
|
|
5
|
+
toAcpMcpServers
|
|
6
|
+
} from "./cli-3qn4r334.js";
|
|
7
|
+
import"./cli-32bca7nr.js";
|
|
8
|
+
import"./cli-tng3131n.js";
|
|
9
|
+
import"./cli-zp67qg5x.js";
|
|
10
|
+
import"./cli-ttbsse3f.js";
|
|
11
|
+
import"./cli-dpvkp2et.js";
|
|
12
|
+
import"./cli-zt3w1cn1.js";
|
|
13
|
+
import"./cli-zsh093hk.js";
|
|
14
|
+
import"./cli-w5e1d1vv.js";
|
|
15
|
+
import"./cli-4r1sjfc4.js";
|
|
16
|
+
import"./cli-wt7ccy4r.js";
|
|
17
|
+
import"./cli-bc05qbss.js";
|
|
18
|
+
export {
|
|
19
|
+
ACPAdapter,
|
|
20
|
+
applyConfiguredOptions,
|
|
21
|
+
sanitizeAcpConfigOptions,
|
|
22
|
+
toAcpMcpServers
|
|
23
|
+
};
|
|
@@ -1,31 +1,28 @@
|
|
|
1
1
|
import {
|
|
2
2
|
resolveSlackUserId
|
|
3
|
-
} from "./cli-
|
|
3
|
+
} from "./cli-x7kpr72a.js";
|
|
4
4
|
import {
|
|
5
5
|
createTaskWithSiblingAwareness
|
|
6
|
-
} from "./cli-
|
|
7
|
-
import"./cli-
|
|
8
|
-
import"./cli-
|
|
6
|
+
} from "./cli-df56tqdw.js";
|
|
7
|
+
import"./cli-xvc3q9br.js";
|
|
8
|
+
import"./cli-mv2520nm.js";
|
|
9
9
|
import"./cli-w0bwte75.js";
|
|
10
10
|
import"./cli-re8z5p8p.js";
|
|
11
|
-
import"./cli-
|
|
12
|
-
import"./cli-
|
|
13
|
-
import"./cli-
|
|
14
|
-
import"./cli-
|
|
11
|
+
import"./cli-0nhdwxd5.js";
|
|
12
|
+
import"./cli-rggdq8wq.js";
|
|
13
|
+
import"./cli-ysnyhws9.js";
|
|
14
|
+
import"./cli-jvj6a0cv.js";
|
|
15
15
|
import"./cli-epan13p1.js";
|
|
16
16
|
import"./cli-f14fvzag.js";
|
|
17
17
|
import"./cli-zt3w1cn1.js";
|
|
18
|
-
import"./cli-
|
|
19
|
-
import"./cli-
|
|
18
|
+
import"./cli-f2n17zhp.js";
|
|
19
|
+
import"./cli-feh3dkah.js";
|
|
20
20
|
import"./cli-3dpj7atn.js";
|
|
21
21
|
import"./cli-2x0e561b.js";
|
|
22
22
|
import"./cli-pkke6geq.js";
|
|
23
23
|
import"./cli-rb9m6rpe.js";
|
|
24
24
|
import"./cli-mzfth0bp.js";
|
|
25
|
-
import"./cli-
|
|
26
|
-
import"./cli-v7fqehqd.js";
|
|
27
|
-
import"./cli-agjzafns.js";
|
|
28
|
-
import"./cli-93rxw9yd.js";
|
|
25
|
+
import"./cli-j2jbr8af.js";
|
|
29
26
|
import"./cli-fad8m16k.js";
|
|
30
27
|
import"./cli-bsakbbkm.js";
|
|
31
28
|
import"./cli-zxg80zs9.js";
|
|
@@ -38,10 +35,9 @@ import {
|
|
|
38
35
|
getAgentEmoji,
|
|
39
36
|
getTaskLink,
|
|
40
37
|
isSlackRenderV2Enabled
|
|
41
|
-
} from "./cli-
|
|
38
|
+
} from "./cli-ecknp7p1.js";
|
|
42
39
|
import"./cli-q51yprfq.js";
|
|
43
40
|
import"./cli-3er6gcsn.js";
|
|
44
|
-
import"./cli-cvk6yzw5.js";
|
|
45
41
|
import"./cli-yatxqynm.js";
|
|
46
42
|
import"./cli-b0f70z24.js";
|
|
47
43
|
import"./cli-nexwh8zg.js";
|
|
@@ -50,24 +46,24 @@ import"./cli-1m2e086m.js";
|
|
|
50
46
|
import"./cli-bzr0ftht.js";
|
|
51
47
|
import"./cli-bd957dgb.js";
|
|
52
48
|
import"./cli-pzxba7gw.js";
|
|
53
|
-
import"./cli-
|
|
54
|
-
import"./cli-
|
|
49
|
+
import"./cli-8kgvmkak.js";
|
|
50
|
+
import"./cli-rfphkzh5.js";
|
|
55
51
|
import {
|
|
56
52
|
cancelTask,
|
|
57
53
|
getAgentById,
|
|
58
54
|
getLeadAgent,
|
|
59
55
|
getTaskById,
|
|
60
56
|
init_context_key,
|
|
61
|
-
init_db,
|
|
57
|
+
init_db1 as init_db,
|
|
62
58
|
slackContextKey
|
|
63
|
-
} from "./cli-
|
|
64
|
-
import"./cli-
|
|
59
|
+
} from "./cli-yshaazs1.js";
|
|
60
|
+
import"./cli-xvdgasgy.js";
|
|
65
61
|
import"./cli-3qhyh31j.js";
|
|
66
|
-
import"./cli-
|
|
67
|
-
import"./cli-n7h1kqpf.js";
|
|
62
|
+
import"./cli-jhm6hzjn.js";
|
|
68
63
|
import"./cli-7mm2r1kp.js";
|
|
69
64
|
import"./cli-g5erf0zt.js";
|
|
70
|
-
import"./cli-
|
|
65
|
+
import"./cli-dmtrxqhg.js";
|
|
66
|
+
import"./cli-tadfgd0t.js";
|
|
71
67
|
import"./cli-ywybs5as.js";
|
|
72
68
|
import"./cli-gd4favx9.js";
|
|
73
69
|
import"./cli-agamgm0p.js";
|
|
@@ -75,13 +71,13 @@ import"./cli-5c2j5yvx.js";
|
|
|
75
71
|
import"./cli-1a2j50m0.js";
|
|
76
72
|
import"./cli-f9w1semm.js";
|
|
77
73
|
import"./cli-ej6gbxfb.js";
|
|
78
|
-
import"./cli-
|
|
74
|
+
import"./cli-zsh093hk.js";
|
|
79
75
|
import"./cli-sd0mxa3c.js";
|
|
80
76
|
import"./cli-w5e1d1vv.js";
|
|
81
|
-
import"./cli-
|
|
82
|
-
import"./cli-
|
|
77
|
+
import"./cli-4r1sjfc4.js";
|
|
78
|
+
import"./cli-mb75wpxf.js";
|
|
83
79
|
import"./cli-zf8jjwex.js";
|
|
84
|
-
import"./cli-
|
|
80
|
+
import"./cli-wt7ccy4r.js";
|
|
85
81
|
import"./cli-bc05qbss.js";
|
|
86
82
|
|
|
87
83
|
// src/slack/actions.ts
|
|
@@ -7,20 +7,20 @@ import {
|
|
|
7
7
|
parseAmpThreadCost,
|
|
8
8
|
parseAmpThreadUsage,
|
|
9
9
|
resolveAmpBinary
|
|
10
|
-
} from "./cli-
|
|
10
|
+
} from "./cli-mwegs4af.js";
|
|
11
11
|
import"./cli-ptcz1cqy.js";
|
|
12
|
-
import"./cli-
|
|
13
|
-
import"./cli-
|
|
14
|
-
import"./cli-
|
|
12
|
+
import"./cli-32bca7nr.js";
|
|
13
|
+
import"./cli-ttbsse3f.js";
|
|
14
|
+
import"./cli-mv2520nm.js";
|
|
15
15
|
import"./cli-re8z5p8p.js";
|
|
16
16
|
import"./cli-zt3w1cn1.js";
|
|
17
|
-
import"./cli-
|
|
17
|
+
import"./cli-xvdgasgy.js";
|
|
18
18
|
import"./cli-gd4favx9.js";
|
|
19
19
|
import"./cli-ej6gbxfb.js";
|
|
20
|
-
import"./cli-
|
|
20
|
+
import"./cli-zsh093hk.js";
|
|
21
21
|
import"./cli-sd0mxa3c.js";
|
|
22
22
|
import"./cli-w5e1d1vv.js";
|
|
23
|
-
import"./cli-
|
|
23
|
+
import"./cli-wt7ccy4r.js";
|
|
24
24
|
import"./cli-bc05qbss.js";
|
|
25
25
|
export {
|
|
26
26
|
AMP_PACKAGE,
|
|
@@ -3,21 +3,20 @@ import {
|
|
|
3
3
|
initSlackApp,
|
|
4
4
|
startSlackApp,
|
|
5
5
|
stopSlackApp
|
|
6
|
-
} from "./cli-
|
|
6
|
+
} from "./cli-ecknp7p1.js";
|
|
7
7
|
import"./cli-q51yprfq.js";
|
|
8
8
|
import"./cli-3er6gcsn.js";
|
|
9
|
-
import"./cli-cvk6yzw5.js";
|
|
10
9
|
import"./cli-yatxqynm.js";
|
|
11
10
|
import"./cli-bd957dgb.js";
|
|
12
11
|
import"./cli-pzxba7gw.js";
|
|
13
|
-
import"./cli-
|
|
14
|
-
import"./cli-
|
|
12
|
+
import"./cli-yshaazs1.js";
|
|
13
|
+
import"./cli-xvdgasgy.js";
|
|
15
14
|
import"./cli-3qhyh31j.js";
|
|
16
|
-
import"./cli-
|
|
17
|
-
import"./cli-n7h1kqpf.js";
|
|
15
|
+
import"./cli-jhm6hzjn.js";
|
|
18
16
|
import"./cli-7mm2r1kp.js";
|
|
19
17
|
import"./cli-g5erf0zt.js";
|
|
20
|
-
import"./cli-
|
|
18
|
+
import"./cli-dmtrxqhg.js";
|
|
19
|
+
import"./cli-tadfgd0t.js";
|
|
21
20
|
import"./cli-ywybs5as.js";
|
|
22
21
|
import"./cli-gd4favx9.js";
|
|
23
22
|
import"./cli-agamgm0p.js";
|
|
@@ -25,12 +24,12 @@ import"./cli-5c2j5yvx.js";
|
|
|
25
24
|
import"./cli-1a2j50m0.js";
|
|
26
25
|
import"./cli-f9w1semm.js";
|
|
27
26
|
import"./cli-ej6gbxfb.js";
|
|
28
|
-
import"./cli-
|
|
27
|
+
import"./cli-zsh093hk.js";
|
|
29
28
|
import"./cli-sd0mxa3c.js";
|
|
30
29
|
import"./cli-w5e1d1vv.js";
|
|
31
|
-
import"./cli-
|
|
30
|
+
import"./cli-4r1sjfc4.js";
|
|
32
31
|
import"./cli-zf8jjwex.js";
|
|
33
|
-
import"./cli-
|
|
32
|
+
import"./cli-wt7ccy4r.js";
|
|
34
33
|
import"./cli-bc05qbss.js";
|
|
35
34
|
export {
|
|
36
35
|
getSlackApp,
|
|
@@ -2,40 +2,37 @@ import {
|
|
|
2
2
|
bufferThreadMessage,
|
|
3
3
|
getBufferMessageCount,
|
|
4
4
|
wasEventSeen
|
|
5
|
-
} from "./cli-
|
|
5
|
+
} from "./cli-dw2q9f7g.js";
|
|
6
6
|
import {
|
|
7
7
|
resolveSlackUserId,
|
|
8
8
|
rewriteSlackMentions
|
|
9
|
-
} from "./cli-
|
|
9
|
+
} from "./cli-x7kpr72a.js";
|
|
10
10
|
import {
|
|
11
11
|
buildEffectiveText,
|
|
12
12
|
createSlackTaskWithFiles,
|
|
13
13
|
fetchSlackFiles,
|
|
14
14
|
hasOtherUserMention,
|
|
15
15
|
notifySlackFileFailures
|
|
16
|
-
} from "./cli-
|
|
17
|
-
import"./cli-
|
|
18
|
-
import"./cli-
|
|
16
|
+
} from "./cli-df56tqdw.js";
|
|
17
|
+
import"./cli-xvc3q9br.js";
|
|
18
|
+
import"./cli-mv2520nm.js";
|
|
19
19
|
import"./cli-w0bwte75.js";
|
|
20
20
|
import"./cli-re8z5p8p.js";
|
|
21
|
-
import"./cli-
|
|
22
|
-
import"./cli-
|
|
23
|
-
import"./cli-
|
|
24
|
-
import"./cli-
|
|
21
|
+
import"./cli-0nhdwxd5.js";
|
|
22
|
+
import"./cli-rggdq8wq.js";
|
|
23
|
+
import"./cli-ysnyhws9.js";
|
|
24
|
+
import"./cli-jvj6a0cv.js";
|
|
25
25
|
import"./cli-epan13p1.js";
|
|
26
26
|
import"./cli-f14fvzag.js";
|
|
27
27
|
import"./cli-zt3w1cn1.js";
|
|
28
|
-
import"./cli-
|
|
29
|
-
import"./cli-
|
|
28
|
+
import"./cli-f2n17zhp.js";
|
|
29
|
+
import"./cli-feh3dkah.js";
|
|
30
30
|
import"./cli-3dpj7atn.js";
|
|
31
31
|
import"./cli-2x0e561b.js";
|
|
32
32
|
import"./cli-pkke6geq.js";
|
|
33
33
|
import"./cli-rb9m6rpe.js";
|
|
34
34
|
import"./cli-mzfth0bp.js";
|
|
35
|
-
import"./cli-
|
|
36
|
-
import"./cli-v7fqehqd.js";
|
|
37
|
-
import"./cli-agjzafns.js";
|
|
38
|
-
import"./cli-93rxw9yd.js";
|
|
35
|
+
import"./cli-j2jbr8af.js";
|
|
39
36
|
import"./cli-fad8m16k.js";
|
|
40
37
|
import"./cli-bsakbbkm.js";
|
|
41
38
|
import"./cli-zxg80zs9.js";
|
|
@@ -47,10 +44,9 @@ import {
|
|
|
47
44
|
isSlackRenderV2Enabled,
|
|
48
45
|
markSlackSessionProcessing,
|
|
49
46
|
require_dist
|
|
50
|
-
} from "./cli-
|
|
47
|
+
} from "./cli-ecknp7p1.js";
|
|
51
48
|
import"./cli-q51yprfq.js";
|
|
52
49
|
import"./cli-3er6gcsn.js";
|
|
53
|
-
import"./cli-cvk6yzw5.js";
|
|
54
50
|
import"./cli-yatxqynm.js";
|
|
55
51
|
import"./cli-b0f70z24.js";
|
|
56
52
|
import"./cli-nexwh8zg.js";
|
|
@@ -59,24 +55,24 @@ import"./cli-1m2e086m.js";
|
|
|
59
55
|
import"./cli-bzr0ftht.js";
|
|
60
56
|
import"./cli-bd957dgb.js";
|
|
61
57
|
import"./cli-pzxba7gw.js";
|
|
62
|
-
import"./cli-
|
|
63
|
-
import"./cli-
|
|
58
|
+
import"./cli-8kgvmkak.js";
|
|
59
|
+
import"./cli-rfphkzh5.js";
|
|
64
60
|
import {
|
|
65
61
|
getAgentWorkingOnThread,
|
|
66
62
|
getLeadAgent,
|
|
67
63
|
getMostRecentTaskInThread,
|
|
68
64
|
init_context_key,
|
|
69
|
-
init_db,
|
|
65
|
+
init_db1 as init_db,
|
|
70
66
|
reactionName,
|
|
71
67
|
slackContextKey
|
|
72
|
-
} from "./cli-
|
|
73
|
-
import"./cli-
|
|
68
|
+
} from "./cli-yshaazs1.js";
|
|
69
|
+
import"./cli-xvdgasgy.js";
|
|
74
70
|
import"./cli-3qhyh31j.js";
|
|
75
|
-
import"./cli-
|
|
76
|
-
import"./cli-n7h1kqpf.js";
|
|
71
|
+
import"./cli-jhm6hzjn.js";
|
|
77
72
|
import"./cli-7mm2r1kp.js";
|
|
78
73
|
import"./cli-g5erf0zt.js";
|
|
79
|
-
import"./cli-
|
|
74
|
+
import"./cli-dmtrxqhg.js";
|
|
75
|
+
import"./cli-tadfgd0t.js";
|
|
80
76
|
import"./cli-ywybs5as.js";
|
|
81
77
|
import"./cli-gd4favx9.js";
|
|
82
78
|
import"./cli-agamgm0p.js";
|
|
@@ -90,13 +86,13 @@ import {
|
|
|
90
86
|
init_env_flag,
|
|
91
87
|
isEnvFlagEnabled
|
|
92
88
|
} from "./cli-ej6gbxfb.js";
|
|
93
|
-
import"./cli-
|
|
89
|
+
import"./cli-zsh093hk.js";
|
|
94
90
|
import"./cli-sd0mxa3c.js";
|
|
95
91
|
import"./cli-w5e1d1vv.js";
|
|
96
|
-
import"./cli-
|
|
97
|
-
import"./cli-
|
|
92
|
+
import"./cli-4r1sjfc4.js";
|
|
93
|
+
import"./cli-mb75wpxf.js";
|
|
98
94
|
import"./cli-zf8jjwex.js";
|
|
99
|
-
import"./cli-
|
|
95
|
+
import"./cli-wt7ccy4r.js";
|
|
100
96
|
import {
|
|
101
97
|
__callDispose,
|
|
102
98
|
__toESM,
|
|
@@ -1,21 +1,17 @@
|
|
|
1
1
|
import {
|
|
2
2
|
embedScript,
|
|
3
|
-
embeddingProvider
|
|
4
|
-
} from "./cli-0a7r5331.js";
|
|
5
|
-
import"./cli-v7fqehqd.js";
|
|
6
|
-
import"./cli-agjzafns.js";
|
|
7
|
-
import"./cli-cvk6yzw5.js";
|
|
8
|
-
import {
|
|
3
|
+
embeddingProvider,
|
|
9
4
|
getDbClient,
|
|
10
|
-
init_db
|
|
11
|
-
|
|
12
|
-
|
|
5
|
+
init_db1 as init_db,
|
|
6
|
+
init_embeddings
|
|
7
|
+
} from "./cli-yshaazs1.js";
|
|
8
|
+
import"./cli-xvdgasgy.js";
|
|
13
9
|
import"./cli-3qhyh31j.js";
|
|
14
|
-
import"./cli-
|
|
15
|
-
import"./cli-n7h1kqpf.js";
|
|
10
|
+
import"./cli-jhm6hzjn.js";
|
|
16
11
|
import"./cli-7mm2r1kp.js";
|
|
17
12
|
import"./cli-g5erf0zt.js";
|
|
18
|
-
import"./cli-
|
|
13
|
+
import"./cli-dmtrxqhg.js";
|
|
14
|
+
import"./cli-tadfgd0t.js";
|
|
19
15
|
import"./cli-ywybs5as.js";
|
|
20
16
|
import"./cli-gd4favx9.js";
|
|
21
17
|
import"./cli-agamgm0p.js";
|
|
@@ -23,16 +19,17 @@ import"./cli-5c2j5yvx.js";
|
|
|
23
19
|
import"./cli-1a2j50m0.js";
|
|
24
20
|
import"./cli-f9w1semm.js";
|
|
25
21
|
import"./cli-ej6gbxfb.js";
|
|
26
|
-
import"./cli-
|
|
22
|
+
import"./cli-zsh093hk.js";
|
|
27
23
|
import"./cli-sd0mxa3c.js";
|
|
28
24
|
import"./cli-w5e1d1vv.js";
|
|
29
|
-
import"./cli-
|
|
25
|
+
import"./cli-4r1sjfc4.js";
|
|
30
26
|
import"./cli-zf8jjwex.js";
|
|
31
|
-
import"./cli-
|
|
27
|
+
import"./cli-wt7ccy4r.js";
|
|
32
28
|
import"./cli-bc05qbss.js";
|
|
33
29
|
|
|
34
30
|
// src/be/scripts/boot-reembed.ts
|
|
35
31
|
init_db();
|
|
32
|
+
init_embeddings();
|
|
36
33
|
function toScriptRecord(row) {
|
|
37
34
|
return {
|
|
38
35
|
...row,
|
|
@@ -1,22 +1,19 @@
|
|
|
1
1
|
import {
|
|
2
2
|
EMBEDDING_DIMENSIONS,
|
|
3
|
+
getDbClient,
|
|
3
4
|
getEmbeddingProvider,
|
|
4
5
|
getMemoryStore,
|
|
5
|
-
init_constants
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
import
|
|
10
|
-
getDbClient,
|
|
11
|
-
init_db
|
|
12
|
-
} from "./cli-0wn3ypqv.js";
|
|
13
|
-
import"./cli-v0e7jpr5.js";
|
|
6
|
+
init_constants,
|
|
7
|
+
init_db1 as init_db,
|
|
8
|
+
init_memory
|
|
9
|
+
} from "./cli-yshaazs1.js";
|
|
10
|
+
import"./cli-xvdgasgy.js";
|
|
14
11
|
import"./cli-3qhyh31j.js";
|
|
15
|
-
import"./cli-
|
|
16
|
-
import"./cli-n7h1kqpf.js";
|
|
12
|
+
import"./cli-jhm6hzjn.js";
|
|
17
13
|
import"./cli-7mm2r1kp.js";
|
|
18
14
|
import"./cli-g5erf0zt.js";
|
|
19
|
-
import"./cli-
|
|
15
|
+
import"./cli-dmtrxqhg.js";
|
|
16
|
+
import"./cli-tadfgd0t.js";
|
|
20
17
|
import"./cli-ywybs5as.js";
|
|
21
18
|
import"./cli-gd4favx9.js";
|
|
22
19
|
import"./cli-agamgm0p.js";
|
|
@@ -24,17 +21,18 @@ import"./cli-5c2j5yvx.js";
|
|
|
24
21
|
import"./cli-1a2j50m0.js";
|
|
25
22
|
import"./cli-f9w1semm.js";
|
|
26
23
|
import"./cli-ej6gbxfb.js";
|
|
27
|
-
import"./cli-
|
|
24
|
+
import"./cli-zsh093hk.js";
|
|
28
25
|
import"./cli-sd0mxa3c.js";
|
|
29
26
|
import"./cli-w5e1d1vv.js";
|
|
30
|
-
import"./cli-
|
|
27
|
+
import"./cli-4r1sjfc4.js";
|
|
31
28
|
import"./cli-zf8jjwex.js";
|
|
32
|
-
import"./cli-
|
|
29
|
+
import"./cli-wt7ccy4r.js";
|
|
33
30
|
import"./cli-bc05qbss.js";
|
|
34
31
|
|
|
35
32
|
// src/be/memory/boot-reembed.ts
|
|
36
33
|
init_db();
|
|
37
34
|
init_constants();
|
|
35
|
+
init_memory();
|
|
38
36
|
var VECTOR_BYTES = EMBEDDING_DIMENSIONS * Float32Array.BYTES_PER_ELEMENT;
|
|
39
37
|
var BATCH_SIZE = 20;
|
|
40
38
|
var INVALID_EMBEDDING_WHERE = `embedding IS NULL OR length(embedding) != ${VECTOR_BYTES}`;
|
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
import {
|
|
2
|
+
breaksJsonValidity,
|
|
3
|
+
getDbClient,
|
|
4
|
+
getMemoryStore,
|
|
5
|
+
init_db1 as init_db,
|
|
6
|
+
init_memory,
|
|
7
|
+
init_scrub_json,
|
|
8
|
+
init_sealed_json,
|
|
9
|
+
sealJson
|
|
10
|
+
} from "./cli-yshaazs1.js";
|
|
11
|
+
import"./cli-xvdgasgy.js";
|
|
12
|
+
import"./cli-3qhyh31j.js";
|
|
13
|
+
import {
|
|
14
|
+
contentSha256,
|
|
15
|
+
init_profile_sync
|
|
16
|
+
} from "./cli-jhm6hzjn.js";
|
|
17
|
+
import"./cli-7mm2r1kp.js";
|
|
18
|
+
import"./cli-g5erf0zt.js";
|
|
19
|
+
import"./cli-dmtrxqhg.js";
|
|
20
|
+
import"./cli-tadfgd0t.js";
|
|
21
|
+
import"./cli-ywybs5as.js";
|
|
22
|
+
import"./cli-gd4favx9.js";
|
|
23
|
+
import"./cli-agamgm0p.js";
|
|
24
|
+
import"./cli-5c2j5yvx.js";
|
|
25
|
+
import"./cli-1a2j50m0.js";
|
|
26
|
+
import"./cli-f9w1semm.js";
|
|
27
|
+
import"./cli-ej6gbxfb.js";
|
|
28
|
+
import"./cli-zsh093hk.js";
|
|
29
|
+
import"./cli-sd0mxa3c.js";
|
|
30
|
+
import"./cli-w5e1d1vv.js";
|
|
31
|
+
import"./cli-4r1sjfc4.js";
|
|
32
|
+
import"./cli-zf8jjwex.js";
|
|
33
|
+
import {
|
|
34
|
+
SCRUBBER_RULES_VERSION,
|
|
35
|
+
init_secret_scrubber,
|
|
36
|
+
scrubSecrets
|
|
37
|
+
} from "./cli-wt7ccy4r.js";
|
|
38
|
+
import {
|
|
39
|
+
__require
|
|
40
|
+
} from "./cli-bc05qbss.js";
|
|
41
|
+
|
|
42
|
+
// src/be/boot-scrub-sweep.ts
|
|
43
|
+
init_profile_sync();
|
|
44
|
+
init_secret_scrubber();
|
|
45
|
+
init_db();
|
|
46
|
+
init_memory();
|
|
47
|
+
init_scrub_json();
|
|
48
|
+
init_sealed_json();
|
|
49
|
+
var DEFAULT_BATCH_SIZE = 200;
|
|
50
|
+
var yieldTick = () => new Promise((r) => setTimeout(r, 5));
|
|
51
|
+
var BOOT_SCRUB_TARGETS = [
|
|
52
|
+
{ table: "session_logs", columns: ["content"] },
|
|
53
|
+
{ table: "agent_tasks", columns: ["task", "output", "failureReason", "progress"] },
|
|
54
|
+
{ table: "agent_memory", columns: ["name", "content", "summary"], memory: true },
|
|
55
|
+
{
|
|
56
|
+
table: "agent_memory_version",
|
|
57
|
+
columns: ["content"],
|
|
58
|
+
hash: { column: "contentHash", of: "content" }
|
|
59
|
+
},
|
|
60
|
+
{ table: "events", columns: ["data"] },
|
|
61
|
+
{
|
|
62
|
+
table: "workflow_run_steps",
|
|
63
|
+
columns: ["input", "output", "error", "diagnostics"],
|
|
64
|
+
replay: { output: "output_replay" }
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
table: "workflow_runs",
|
|
68
|
+
columns: ["triggerData", "context", "error"],
|
|
69
|
+
replay: { context: "context_replay" }
|
|
70
|
+
}
|
|
71
|
+
];
|
|
72
|
+
function bootScrubDoneKey(version) {
|
|
73
|
+
return `boot-scrub-v${version}`;
|
|
74
|
+
}
|
|
75
|
+
function bootScrubCursorKey(version, table) {
|
|
76
|
+
return `boot-scrub-v${version}:${table}:cursor`;
|
|
77
|
+
}
|
|
78
|
+
async function runBootScrubSweep(opts = {}) {
|
|
79
|
+
const version = opts.version ?? SCRUBBER_RULES_VERSION;
|
|
80
|
+
const doneKey = bootScrubDoneKey(version);
|
|
81
|
+
const done = await getDbClient().get("SELECT key FROM seed_state WHERE kind = 'maintenance' AND key = ?", [doneKey]);
|
|
82
|
+
if (done)
|
|
83
|
+
return null;
|
|
84
|
+
const tag = `boot-scrub-v${version}`;
|
|
85
|
+
console.log(`[${tag}] starting`);
|
|
86
|
+
const stats = [];
|
|
87
|
+
for (const target of BOOT_SCRUB_TARGETS) {
|
|
88
|
+
const tableStats = await sweepTarget(target, version, opts);
|
|
89
|
+
stats.push(tableStats);
|
|
90
|
+
console.log(`${tag}: ${target.table} scanned=${tableStats.scanned} changed=${tableStats.changed} skipped_invalid_json=${tableStats.skippedInvalidJson}`);
|
|
91
|
+
}
|
|
92
|
+
await getDbClient().transaction(async (tx) => {
|
|
93
|
+
await tx.run(`INSERT INTO seed_state (kind, key, seededHash, seededAt)
|
|
94
|
+
VALUES ('maintenance', ?, 'done', datetime('now'))
|
|
95
|
+
ON CONFLICT (kind, key) DO UPDATE SET seededHash = 'done', seededAt = datetime('now')`, [doneKey]);
|
|
96
|
+
await tx.run("DELETE FROM seed_state WHERE kind = 'maintenance' AND key LIKE ? ESCAPE '!'", [
|
|
97
|
+
`${doneKey.replace(/[!%_]/g, "!$&")}:%:cursor`
|
|
98
|
+
]);
|
|
99
|
+
});
|
|
100
|
+
console.log(`[${tag}] complete`);
|
|
101
|
+
const memoryChanged = stats.find((s) => s.table === "agent_memory")?.changed ?? 0;
|
|
102
|
+
if (memoryChanged > 0 && opts.reembed !== false) {
|
|
103
|
+
const { runBootReembed } = await import("./boot-reembed-s7k7c6v2.js");
|
|
104
|
+
await runBootReembed();
|
|
105
|
+
}
|
|
106
|
+
return stats;
|
|
107
|
+
}
|
|
108
|
+
async function sweepTarget(target, version, opts) {
|
|
109
|
+
const client = getDbClient();
|
|
110
|
+
const scrub = opts.scrub ?? scrubSecrets;
|
|
111
|
+
const batchSize = opts.batchSize ?? DEFAULT_BATCH_SIZE;
|
|
112
|
+
const cursorKey = bootScrubCursorKey(version, target.table);
|
|
113
|
+
const stats = {
|
|
114
|
+
table: target.table,
|
|
115
|
+
scanned: 0,
|
|
116
|
+
changed: 0,
|
|
117
|
+
skippedInvalidJson: 0
|
|
118
|
+
};
|
|
119
|
+
let cursor = (await client.get("SELECT seededHash FROM seed_state WHERE kind = 'maintenance' AND key = ?", [cursorKey]))?.seededHash ?? "";
|
|
120
|
+
const selectCols = [
|
|
121
|
+
"id",
|
|
122
|
+
...target.columns,
|
|
123
|
+
...target.hash && !target.columns.includes(target.hash.column) ? [target.hash.column] : [],
|
|
124
|
+
...Object.values(target.replay ?? {})
|
|
125
|
+
];
|
|
126
|
+
for (;; ) {
|
|
127
|
+
const rows = await client.query(`SELECT ${selectCols.join(", ")} FROM ${target.table}
|
|
128
|
+
WHERE id > ? ORDER BY id ASC LIMIT ?`, [cursor, batchSize]);
|
|
129
|
+
if (rows.length === 0)
|
|
130
|
+
break;
|
|
131
|
+
const pending = [];
|
|
132
|
+
for (const row of rows) {
|
|
133
|
+
const after = {};
|
|
134
|
+
let differs = false;
|
|
135
|
+
let breaksJson = false;
|
|
136
|
+
for (const col of target.columns) {
|
|
137
|
+
const value = row[col];
|
|
138
|
+
if (typeof value !== "string" || value.length === 0) {
|
|
139
|
+
after[col] = value ?? null;
|
|
140
|
+
continue;
|
|
141
|
+
}
|
|
142
|
+
const cleaned = scrub(value);
|
|
143
|
+
after[col] = cleaned;
|
|
144
|
+
if (cleaned !== value) {
|
|
145
|
+
differs = true;
|
|
146
|
+
if (breaksJsonValidity(value, cleaned))
|
|
147
|
+
breaksJson = true;
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
if (!differs)
|
|
151
|
+
continue;
|
|
152
|
+
if (breaksJson) {
|
|
153
|
+
stats.skippedInvalidJson++;
|
|
154
|
+
continue;
|
|
155
|
+
}
|
|
156
|
+
for (const [col, replayCol] of Object.entries(target.replay ?? {})) {
|
|
157
|
+
const value = row[col];
|
|
158
|
+
if (after[col] === value || typeof value !== "string" || row[replayCol] != null)
|
|
159
|
+
continue;
|
|
160
|
+
try {
|
|
161
|
+
after[replayCol] = sealJson(JSON.parse(value));
|
|
162
|
+
} catch {}
|
|
163
|
+
}
|
|
164
|
+
pending.push({ id: row.id, before: row, after });
|
|
165
|
+
}
|
|
166
|
+
const batchLastId = rows[rows.length - 1].id;
|
|
167
|
+
await client.transaction(async (tx) => {
|
|
168
|
+
for (const { id, before, after } of pending) {
|
|
169
|
+
const wrote = target.memory ? await rewriteMemoryRow(id, before, after) : await rewriteRow(tx, target, id, before, after);
|
|
170
|
+
if (wrote)
|
|
171
|
+
stats.changed++;
|
|
172
|
+
}
|
|
173
|
+
await tx.run(`INSERT INTO seed_state (kind, key, seededHash, seededAt)
|
|
174
|
+
VALUES ('maintenance', ?, ?, datetime('now'))
|
|
175
|
+
ON CONFLICT (kind, key) DO UPDATE SET seededHash = excluded.seededHash, seededAt = datetime('now')`, [cursorKey, batchLastId]);
|
|
176
|
+
});
|
|
177
|
+
stats.scanned += rows.length;
|
|
178
|
+
cursor = batchLastId;
|
|
179
|
+
await opts.afterBatch?.({ table: target.table, ids: rows.map((r) => r.id) });
|
|
180
|
+
await yieldTick();
|
|
181
|
+
}
|
|
182
|
+
return stats;
|
|
183
|
+
}
|
|
184
|
+
async function rewriteRow(tx, target, id, before, after) {
|
|
185
|
+
const changedCols = target.columns.filter((c) => after[c] !== before[c]);
|
|
186
|
+
const sealedCols = Object.values(target.replay ?? {}).filter((c) => after[c] !== undefined);
|
|
187
|
+
const sets = [...changedCols, ...sealedCols].map((c) => `${c} = ?`);
|
|
188
|
+
const params = [...changedCols, ...sealedCols].map((c) => after[c] ?? null);
|
|
189
|
+
if (target.hash && changedCols.includes(target.hash.of)) {
|
|
190
|
+
sets.push(`${target.hash.column} = ?`);
|
|
191
|
+
params.push(contentSha256(after[target.hash.of] ?? ""));
|
|
192
|
+
}
|
|
193
|
+
const guards = [...changedCols.map((c) => `${c} IS ?`), ...sealedCols.map((c) => `${c} IS NULL`)];
|
|
194
|
+
params.push(id, ...changedCols.map((c) => before[c] ?? null));
|
|
195
|
+
const result = await tx.run(`UPDATE ${target.table} SET ${sets.join(", ")} WHERE id = ? AND ${guards.join(" AND ")}`, params);
|
|
196
|
+
return result.changes > 0;
|
|
197
|
+
}
|
|
198
|
+
async function rewriteMemoryRow(id, before, after) {
|
|
199
|
+
const pick = (r) => ({
|
|
200
|
+
name: r.name ?? "",
|
|
201
|
+
content: r.content ?? "",
|
|
202
|
+
summary: r.summary ?? null
|
|
203
|
+
});
|
|
204
|
+
return getMemoryStore().rewriteForScrub(id, pick(before), pick(after));
|
|
205
|
+
}
|
|
206
|
+
export {
|
|
207
|
+
BOOT_SCRUB_TARGETS,
|
|
208
|
+
bootScrubCursorKey,
|
|
209
|
+
bootScrubDoneKey,
|
|
210
|
+
runBootScrubSweep
|
|
211
|
+
};
|