@desplega.ai/agent-swarm 1.165.0 → 1.167.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/dist/acp-adapter-zpvy6321.js +34 -0
- package/dist/{actions-jna0b3wm.js → actions-fq2zrwtf.js} +30 -34
- package/dist/{amp-adapter-0eve81pz.js → amp-adapter-5gbk7501.js} +7 -7
- package/dist/{anthropic-messages-hst62ws9.js → anthropic-messages-13yn502s.js} +4 -4
- package/dist/{app-75hm5cfa.js → app-nctetn1e.js} +11 -11
- package/dist/{assistant-yzd51j33.js → assistant-0aq8gjvj.js} +31 -35
- package/dist/{azure-openai-responses-mh8tvf78.js → azure-openai-responses-9st34pfz.js} +5 -5
- package/dist/{boot-reembed-z158xq32.js → boot-reembed-1ze5853n.js} +14 -16
- package/dist/{boot-reembed-2ex2mcsh.js → boot-reembed-fmp5ww69.js} +15 -16
- package/dist/boot-scrub-sweep-cbp8xd4e.js +212 -0
- package/dist/{boot-seeds-2bmnh18p.js → boot-seeds-22tx8a53.js} +13 -12
- package/dist/{claude-adapter-jbj1mycz.js → claude-adapter-0jhgeh1d.js} +25 -25
- package/dist/{claude-managed-adapter-17ggz09t.js → claude-managed-adapter-tzwxy803.js} +5 -5
- package/dist/{claude-managed-setup-ptm1nzm2.js → claude-managed-setup-nrhfx5b0.js} +5 -5
- package/dist/{claude-sdk-session-9re1g7r2.js → claude-sdk-session-wh77rh83.js} +2632 -2614
- package/dist/{cli-zsh093hk.js → cli-014vns2y.js} +63 -1
- package/dist/{cli-qvfk83fy.js → cli-13xwcqvj.js} +2 -2
- package/dist/{cli-8gpbwy09.js → cli-1yrcfa5s.js} +5 -5
- package/dist/{cli-xtgtyafv.js → cli-577bxkf6.js} +212 -451
- package/dist/{cli-ma3zvh39.js → cli-5qkcdv8c.js} +6118 -5874
- package/dist/{cli-cwxhbf43.js → cli-5t5my0h8.js} +85 -2
- package/dist/{cli-zvckv750.js → cli-69egj654.js} +2 -2
- package/dist/{cli-9xb89xca.js → cli-6bpvv8h4.js} +9 -9
- package/dist/{cli-90v942q1.js → cli-6qxmjpem.js} +8 -8
- package/dist/{cli-9866bd07.js → cli-6vfz44sr.js} +1 -1
- package/dist/{cli-32bca7nr.js → cli-7avy4v8w.js} +1 -1
- package/dist/{cli-xb3c6aat.js → cli-7mhy3ths.js} +21 -18
- package/dist/{cli-q38n4bq0.js → cli-95zs84qw.js} +3 -3
- package/dist/cli-a35hzdve.js +33 -0
- package/dist/{cli-x3x0qwky.js → cli-bxqez1p0.js} +51 -23
- package/dist/{cli-prt9emct.js → cli-c2tpw9ck.js} +3 -3
- package/dist/{cli-0n4fasz0.js → cli-c8r99akr.js} +16 -16
- package/dist/{cli-5anb0ev3.js → cli-cexctgn5.js} +89 -26
- package/dist/{cli-bns5c8k9.js → cli-cf2vgn9d.js} +105 -91
- package/dist/{cli-ng97fjq7.js → cli-cmxkbzzs.js} +33 -7
- package/dist/{cli-nexwh8zg.js → cli-g7k7zbcz.js} +12 -5
- package/dist/{cli-mmzwwptd.js → cli-hf5s9pgf.js} +1 -1
- package/dist/{cli-nvvfd8bq.js → cli-jbzbr36n.js} +4091 -3793
- package/dist/{cli-zn2v3t8v.js → cli-jvmtxqtc.js} +27 -15
- package/dist/{cli-pkke6geq.js → cli-km4x66j0.js} +83 -65
- package/dist/cli-kw0jcfje.js +516 -0
- package/dist/{cli-28smfvbn.js → cli-m7vmeepg.js} +32 -19
- package/dist/{cli-hpryr6em.js → cli-mb75wpxf.js} +1 -1
- package/dist/{cli-qdv8kgz7.js → cli-mkdsy1nq.js} +14018 -3333
- package/dist/{cli-b0f70z24.js → cli-mn8qkd8v.js} +1 -1
- package/dist/{cli-420bdgw0.js → cli-mv2520nm.js} +1 -1
- package/dist/{cli-n9ehc28t.js → cli-mxry91sa.js} +31 -10
- package/dist/{cli-wfajtmf7.js → cli-mxvnnv5q.js} +596 -13
- package/dist/cli-nkqjj42q.js +104 -0
- package/dist/{cli-e7t4snpa.js → cli-p8rt8spp.js} +5 -5
- package/dist/{cli-gh5yqzpe.js → cli-pkj1w46r.js} +12 -7
- package/dist/cli-q1vnz8wv.js +96 -0
- package/dist/{cli-fj86xr3c.js → cli-qd97v6z2.js} +2 -2
- package/dist/{cli-ba66wyhy.js → cli-qzmzwegq.js} +60 -20
- package/dist/{cli-5b2fjjzh.js → cli-r7eeddkq.js} +14 -9
- package/dist/{cli-8ssjez7e.js → cli-rhy7z1rp.js} +22 -11
- package/dist/{cli-4mevd1hf.js → cli-s9y81s7j.js} +5 -5
- package/dist/{cli-59jn5twa.js → cli-tc5zec7v.js} +7 -7
- package/dist/{cli-ttbsse3f.js → cli-tmhsxhb8.js} +1 -1
- package/dist/{cli-k6xx3pve.js → cli-tx2zvn23.js} +4 -4
- package/dist/{cli-pjxnr1jn.js → cli-ty4bzkqr.js} +5 -5
- package/dist/{cli-nfygw434.js → cli-v1pwxreq.js} +55 -52
- package/dist/{cli-ftry7975.js → cli-v1w7pbd8.js} +3 -2
- package/dist/{cli-10zmp1p7.js → cli-vr5avem2.js} +27 -32
- package/dist/{cli-bzr0ftht.js → cli-wnb9b2g3.js} +19 -0
- package/dist/cli-wt7ccy4r.js +2654 -0
- package/dist/{cli-50eg13rj.js → cli-wydz3feg.js} +549 -321
- package/dist/{cli-krqm5f11.js → cli-xezn9nkh.js} +16 -13
- package/dist/{cli-8kt0bmgx.js → cli-xf713zz0.js} +2 -2
- package/dist/{cli-x7afk5wm.js → cli-xvc3q9br.js} +1 -1
- package/dist/{cli-9s3h836g.js → cli-xvdgasgy.js} +1 -1
- package/dist/{cli-j0pdrmwg.js → cli-y0kjpfm9.js} +3 -3
- package/dist/{cli-6zcfw0x7.js → cli-y195hv1a.js} +1 -1
- package/dist/{cli-amwhs8h2.js → cli-ykt8f7va.js} +22 -9
- package/dist/{cli-1kzfvd1z.js → cli-ymmc1zxg.js} +15 -11
- package/dist/{cli-xnzrzets.js → cli-ypgba1a8.js} +2 -2
- package/dist/{cli-bdv39kgj.js → cli-z1dqhc9y.js} +31 -20
- package/dist/{cli-fw6vdcq5.js → cli-zp67qg5x.js} +34 -1
- package/dist/{cli-qbksc292.js → cli-zy39d433.js} +2 -0
- package/dist/cli.js +36 -32
- package/dist/{cloudflare-workers-ai-system-one-tt484t61.js → cloudflare-workers-ai-system-one-sta45jf9.js} +7 -5
- package/dist/{codex-adapter-3qnxshje.js → codex-adapter-cgesnjkr.js} +20 -20
- package/dist/{codex-login-brkxhhdg.js → codex-login-g1cyt5zm.js} +2 -2
- package/dist/{codex-session-runner-612wnapp.js → codex-session-runner-8kd7ddhr.js} +20 -20
- package/dist/{commands-2ybfcxkj.js → commands-h6zaaxym.js} +11 -10
- package/dist/{cursor-adapter-p3jgdehv.js → cursor-adapter-v8mm6bp5.js} +7 -7
- package/dist/{db-f4ans0jj.js → db-qg3myn53.js} +13 -10
- package/dist/{devin-adapter-dhzt01ff.js → devin-adapter-bffjj5n4.js} +2 -2
- package/dist/{dispatcher-pk182apd.js → dispatcher-7vnwj9qw.js} +28 -32
- package/dist/{dsh-adapter-7twaeps1.js → dsh-adapter-tz6hfp5r.js} +7 -7
- package/dist/{e2b-y8t3jzyz.js → e2b-nd50eccg.js} +1 -1
- package/dist/{easter-egg-3d-mtpnw06s.js → easter-egg-3d-66zxervv.js} +2 -2
- package/dist/{event-bus-w7ac4n3c.js → event-bus-vnfthafg.js} +2 -2
- package/dist/{execute-s4ccjq3n.js → execute-h4jgevyw.js} +61 -11
- package/dist/{google-generative-ai-d6nphg3q.js → google-generative-ai-b8zxrpax.js} +5 -5
- package/dist/{google-vertex-cpshkref.js → google-vertex-nrdd697t.js} +5 -5
- package/dist/grok-adapter-jdt2dz2s.js +39 -0
- package/dist/{handlers-g2wnr4t9.js → handlers-2qtkpncr.js} +31 -35
- package/dist/{hook-f7jt9vnm.js → hook-51yfcgsv.js} +48 -39
- package/dist/{hook-bbdpnkb4.js → hook-qnbdgwvd.js} +15 -17
- package/dist/{http-w40q4w94.js → http-jsmtag08.js} +536 -231
- package/dist/{index-056j5kzn.js → index-2t9kesn1.js} +13 -12
- package/dist/{index-cj1r9q83.js → index-bt8wkv1w.js} +29 -33
- package/dist/{index-7n70jwbb.js → index-cx1sb9bq.js} +42 -35
- package/dist/{index-9bfssf54.js → index-ekywyv2v.js} +28 -32
- package/dist/{index-fdk1t4d6.js → index-n0rxa4ca.js} +11962 -9900
- package/dist/{index-k8xc083e.js → index-t4g06w93.js} +28 -32
- package/dist/{keepalive-1tj10tf4.js → keepalive-4aezx4bj.js} +16 -12
- package/dist/{lead-st0bg7v4.js → lead-r44bkpm5.js} +52 -56
- package/dist/{llama-cpp-classify-tgj35k8d.js → llama-cpp-classify-6erb7wwv.js} +3 -1
- package/dist/{maintenance-nz71zats.js → maintenance-grz5jrzh.js} +12 -13
- package/dist/{mistral-conversations-8445ddjn.js → mistral-conversations-059y51zt.js} +4 -4
- package/dist/{node-f0ykebbv.js → node-qm9eb6z0.js} +25 -7
- package/dist/{oauth-refresh-sweep-aefzwvvq.js → oauth-refresh-sweep-wm4ctjfj.js} +15 -11
- package/dist/{onboard-kgpr9mbn.js → onboard-v60zgqf0.js} +2 -2
- package/dist/{openai-codex-responses-9ynm88zy.js → openai-codex-responses-jzxkta9b.js} +8 -7
- package/dist/{openai-completions-nhqwjmaw.js → openai-completions-663yncfq.js} +4 -4
- package/dist/openai-decisions-vj9nkpf8.js +162 -0
- package/dist/{openai-responses-xx1c4kgm.js → openai-responses-m3g43rrt.js} +5 -5
- package/dist/{opencode-adapter-0c8e70dk.js → opencode-adapter-yjyqynzf.js} +8 -8
- package/dist/{openrouter-images-8yx3487g.js → openrouter-images-kr60n6b9.js} +1 -1
- package/dist/{otel-impl-x8zp4y5a.js → otel-impl-ghh4dyf8.js} +2 -2
- package/dist/{pi-messages-vxdt8v7j.js → pi-messages-xszk613n.js} +1 -1
- package/dist/{pi-mono-adapter-t280ah5c.js → pi-mono-adapter-0eg8kw2c.js} +69 -52
- package/dist/{pricing-refresh-9e0q7cwk.js → pricing-refresh-mjrqvnvw.js} +12 -11
- package/dist/{rbac-roles-790j3ga8.js → rbac-roles-axv4d74x.js} +11 -10
- package/dist/{rbac-roles-kcp6zge2.js → rbac-roles-fd5tskj9.js} +11 -10
- package/dist/{render-v2-tch4nefj.js → render-v2-k50j33qd.js} +11 -11
- package/dist/{runtime-v2t1r79e.js → runtime-h9ha1mq6.js} +4 -4
- package/dist/{setup-rcm303ns.js → setup-4syh0pd2.js} +2 -2
- package/dist/{typesafe-system-one-datfr82p.js → typesafe-system-one-e988vty7.js} +7 -5
- package/dist/{virtual-modules-wm8mxdxx.js → virtual-modules-ftr9kwe8.js} +11 -11
- package/dist/{work-objects-ctg7t70w.js → work-objects-jcdbg8rr.js} +32 -36
- package/dist/{worker-5dp0xm55.js → worker-x8j8c9sx.js} +52 -56
- package/dist/{x-v3yw66zs.js → x-ma4gnfgy.js} +2 -2
- package/openapi.json +5 -2
- package/package.json +15 -11
- package/src/be/automation-preflight.ts +9 -4
- package/src/be/boot-scrub-sweep.ts +302 -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/openai-embedding.ts +7 -2
- package/src/be/memory/providers/sqlite-store.ts +63 -11
- package/src/be/memory/raters/llm-summarizer.ts +7 -2
- package/src/be/memory/types.ts +14 -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/modelsdev-cache.json +61 -0
- package/src/be/scripts/db.ts +28 -4
- package/src/be/scripts/source-secrets.ts +37 -0
- 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 +84 -53
- package/src/be/swarm-config-guard.ts +13 -0
- package/src/be/workflow-replay.ts +77 -0
- package/src/commands/provider-credentials.ts +28 -5
- package/src/commands/runner.ts +7 -12
- package/src/heartbeat/heartbeat.ts +91 -19
- package/src/hooks/hook.ts +72 -27
- package/src/http/codex-oauth-device.ts +8 -10
- 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/index.ts +23 -6
- package/src/http/mcp.ts +5 -0
- package/src/http/onboarding.ts +2 -0
- package/src/http/script-runs.ts +9 -1
- package/src/http/scripts.ts +15 -0
- package/src/http/workflows.ts +3 -2
- package/src/oauth/mcp-wrapper.ts +1 -1
- package/src/providers/acp-adapter.ts +25 -11
- package/src/providers/acp-target-catalog.ts +35 -1
- package/src/providers/acp-targets.ts +78 -7
- package/src/providers/amp-adapter.ts +1 -1
- package/src/providers/claude-adapter.ts +26 -0
- package/src/providers/codex-adapter.ts +30 -3
- package/src/providers/codex-oauth/auth-json.ts +21 -4
- package/src/providers/codex-oauth/types.ts +2 -0
- package/src/providers/cursor-adapter.ts +1 -1
- package/src/providers/dsh-adapter.ts +10 -1
- package/src/providers/grok-adapter.ts +18 -2
- package/src/providers/opencode-adapter.ts +21 -5
- package/src/providers/pi-mono-extension.ts +56 -25
- package/src/providers/pricing-sources.md +2 -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/server.ts +66 -4
- package/src/tests/acp-adapter.test.ts +277 -12
- package/src/tests/boot-scrub-sweep.test.ts +390 -0
- package/src/tests/check-text-columns.test.ts +145 -0
- package/src/tests/ci-unit-test-report.test.ts +73 -0
- package/src/tests/claude-default-route.test.ts +75 -0
- package/src/tests/claude-hook-output.test.ts +233 -0
- package/src/tests/claude-sdk-process.fixture.ts +13 -2
- package/src/tests/codex-adapter-pool-auth-revalidate.test.ts +4 -2
- package/src/tests/codex-adapter.test.ts +166 -26
- package/src/tests/codex-oauth-auth-timestamps.test.ts +76 -0
- package/src/tests/codex-oauth-device.test.ts +23 -37
- package/src/tests/codex-oauth.test.ts +4 -1
- package/src/tests/context-window.test.ts +2 -2
- package/src/tests/credential-check.test.ts +51 -1
- 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/dsh-adapter.test.ts +23 -1
- package/src/tests/enabled-tools.test.ts +269 -0
- package/src/tests/entrypoint-acp-target-binary.test.ts +31 -1
- package/src/tests/entrypoint-codex-oauth-seed.test.ts +12 -0
- package/src/tests/events-scrub.test.ts +88 -0
- package/src/tests/fixtures/secret-corpus.ts +320 -0
- package/src/tests/grok-adapter.test.ts +13 -0
- package/src/tests/haiku-5-5-pricing.test.ts +38 -0
- package/src/tests/heartbeat-checklist.test.ts +158 -1
- package/src/tests/onboarding.test.ts +44 -0
- package/src/tests/opencode-adapter.test.ts +66 -3
- package/src/tests/opencode-plugin.test.ts +37 -0
- package/src/tests/openrouter-attribution-call-sites.test.ts +204 -0
- package/src/tests/openrouter-base-url.test.ts +30 -39
- package/src/tests/pi-mono-extension.test.ts +161 -2
- package/src/tests/pricing-refresh.test.ts +70 -1
- package/src/tests/reasoning-effort.test.ts +3 -1
- package/src/tests/script-connections.test.ts +5 -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 +88 -1
- package/src/tests/script-runs-scrub.test.ts +275 -0
- package/src/tests/scripts-http.test.ts +82 -1
- 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 +3 -2
- package/src/tests/telemetry-trigger.test.ts +12 -1
- package/src/tests/workflow-llm.test.ts +14 -0
- 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 +33 -0
- package/src/tools/db-query.ts +1 -1
- package/src/tools/inject-learning.ts +1 -1
- package/src/tools/request-human-input.ts +7 -2
- package/src/tools/workflows/get-workflow-run.ts +3 -2
- package/src/types.ts +1 -1
- package/src/utils/enabled-tools.ts +27 -0
- package/src/utils/internal-ai/complete-structured.ts +11 -3
- package/src/utils/openrouter-base-url.ts +23 -0
- package/src/utils/secret-rules.generated.ts +2055 -0
- package/src/utils/secret-scrubber.ts +363 -29
- package/src/workflows/engine.ts +39 -4
- package/src/workflows/executors/raw-llm.ts +1 -0
- package/src/workflows/executors/system-one-decision.ts +2 -0
- package/src/workflows/executors/validate.ts +1 -0
- package/src/workflows/executors/workflow-llm.ts +9 -2
- package/src/workflows/recovery.ts +10 -1
- package/src/workflows/resume.ts +62 -3
- package/src/workflows/retry-poller.ts +3 -0
- package/templates/skills/agent-browser/SKILL.md +2 -0
- package/templates/skills/agent-browser/content.md +2 -0
- package/templates/skills/code-quality/content.md +1 -0
- package/templates/skills/heartbeat-runbook/content.md +1 -1
- package/templates/skills/work-on-task/SKILL.md +4 -0
- package/templates/skills/work-on-task/content.md +4 -0
- package/templates/skills/workflow-iterate/content.md +9 -0
- package/dist/acp-adapter-w6zws6me.js +0 -23
- package/dist/boot-scrub-logs-246yn076.js +0 -99
- package/dist/cli-3a4m1aws.js +0 -572
- package/dist/cli-3dpj7atn.js +0 -11
- package/dist/cli-a87b04k8.js +0 -951
- package/dist/cli-cvk6yzw5.js +0 -40
- package/dist/cli-gvcgmx69.js +0 -183
- package/dist/cli-h1spv8v4.js +0 -427
- package/dist/cli-jqt9hrnz.js +0 -168
- package/dist/cli-yhmwmv0g.js +0 -9281
- package/dist/grok-adapter-yt9pab3k.js +0 -29
- package/src/be/boot-scrub-logs.ts +0 -132
- package/dist/{codex-hook-d2rkvf39.js → codex-hook-15dgc4cb.js} +1 -1
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
ARMIN_HEIGHT,
|
|
3
3
|
ARMIN_WIDTH,
|
|
4
4
|
isArminPixel
|
|
5
|
-
} from "./cli-
|
|
5
|
+
} from "./cli-y195hv1a.js";
|
|
6
6
|
import {
|
|
7
7
|
backgroundAnsi,
|
|
8
8
|
colorToRgb,
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
rgbColor,
|
|
14
14
|
theme,
|
|
15
15
|
visibleWidth
|
|
16
|
-
} from "./cli-
|
|
16
|
+
} from "./cli-5t5my0h8.js";
|
|
17
17
|
import"./cli-5bfdm1ah.js";
|
|
18
18
|
import"./cli-0m7wct0d.js";
|
|
19
19
|
import"./cli-pqetb83f.js";
|
|
@@ -2,9 +2,9 @@ import {
|
|
|
2
2
|
InProcessEventBus,
|
|
3
3
|
init_event_bus,
|
|
4
4
|
workflowEventBus
|
|
5
|
-
} from "./cli-
|
|
5
|
+
} from "./cli-mb75wpxf.js";
|
|
6
6
|
import"./cli-zf8jjwex.js";
|
|
7
|
-
import"./cli-
|
|
7
|
+
import"./cli-wt7ccy4r.js";
|
|
8
8
|
import"./cli-bc05qbss.js";
|
|
9
9
|
init_event_bus();
|
|
10
10
|
|
|
@@ -10,15 +10,15 @@ import {
|
|
|
10
10
|
renderToolSample,
|
|
11
11
|
toCodemodeDeclaration,
|
|
12
12
|
toCodemodeIdentifier
|
|
13
|
-
} from "./cli-
|
|
13
|
+
} from "./cli-s9y81s7j.js";
|
|
14
14
|
import {
|
|
15
15
|
formatSize,
|
|
16
16
|
writeOutputFile
|
|
17
|
-
} from "./cli-
|
|
17
|
+
} from "./cli-rhy7z1rp.js";
|
|
18
18
|
import {
|
|
19
19
|
getCodemodeWorkerSpecifier,
|
|
20
20
|
getQuickJSWasmPath
|
|
21
|
-
} from "./cli-
|
|
21
|
+
} from "./cli-5t5my0h8.js";
|
|
22
22
|
import"./cli-5bfdm1ah.js";
|
|
23
23
|
import"./cli-0m7wct0d.js";
|
|
24
24
|
import"./cli-rb9m6rpe.js";
|
|
@@ -779,7 +779,7 @@ var PRELUDE_SOURCE = `(function (bridge, toolsJson, globalsJson, storeJson) {
|
|
|
779
779
|
const console = {};
|
|
780
780
|
for (const level of ["log", "info", "warn", "error", "debug"]) {
|
|
781
781
|
console[level] = (...args) => {
|
|
782
|
-
output("
|
|
782
|
+
output("console", args.map(format).join(" "));
|
|
783
783
|
};
|
|
784
784
|
}
|
|
785
785
|
Object.freeze(console);
|
|
@@ -906,13 +906,23 @@ function describeValue(value) {
|
|
|
906
906
|
}
|
|
907
907
|
return typeof value === "string" ? "a string" : `a ${typeof value}`;
|
|
908
908
|
}
|
|
909
|
-
var CLASSIFIER_CONTEXT_SHAPE = '{ state: { ... }, questions: { <id>: { type: "choice", instructions, criteria: { <label>: <meaning> } } | { type: "score", instructions, criteria: [<lowest level>, ..., <highest level>] } | { type: "bool", instructions, criteria: { true: <meaning>, false: <meaning> } } } }';
|
|
909
|
+
var CLASSIFIER_CONTEXT_SHAPE = '{ state: { ... }, images?: [{ type: "image", data: <base64>, mimeType }], questions: { <id>: { type: "choice", instructions, criteria: { <label>: <meaning> } } | { type: "score", instructions, criteria: [<lowest level>, ..., <highest level>] } | { type: "bool", instructions, criteria: { true: <meaning>, false: <meaning> } } } }';
|
|
910
910
|
function checkClassifierContext(context) {
|
|
911
911
|
const fail = (problem) => new Error(`models.classify() ${problem}. Expected context: ${CLASSIFIER_CONTEXT_SHAPE}. See "Classify" in ${CODEMODE_DOCS_PATH}.`);
|
|
912
912
|
if (!isRecord(context))
|
|
913
913
|
throw fail(`expects a context object as its second argument, got ${describeValue(context)}`);
|
|
914
914
|
if (!isRecord(context.state))
|
|
915
915
|
throw fail(`context.state must be an object, got ${describeValue(context.state)}`);
|
|
916
|
+
const { images } = context;
|
|
917
|
+
if (images !== undefined) {
|
|
918
|
+
if (!Array.isArray(images))
|
|
919
|
+
throw fail(`context.images must be an array, got ${describeValue(images)}`);
|
|
920
|
+
images.forEach((image, index) => {
|
|
921
|
+
if (!isRecord(image) || image.type !== "image" || typeof image.data !== "string" || typeof image.mimeType !== "string") {
|
|
922
|
+
throw fail(`context.images[${index}] must be an image block, got ${describeValue(image)}`);
|
|
923
|
+
}
|
|
924
|
+
});
|
|
925
|
+
}
|
|
916
926
|
const { questions } = context;
|
|
917
927
|
if (!isRecord(questions) || Object.keys(questions).length === 0) {
|
|
918
928
|
throw fail(`context.questions must map question IDs to questions, got ${describeValue(questions)}`);
|
|
@@ -1002,6 +1012,45 @@ function valueText(value) {
|
|
|
1002
1012
|
return value;
|
|
1003
1013
|
return JSON.stringify(value) ?? String(value);
|
|
1004
1014
|
}
|
|
1015
|
+
function formatOutput(output) {
|
|
1016
|
+
const total = output.filter((item) => item.type === "text" && !item.console).length;
|
|
1017
|
+
const items = [];
|
|
1018
|
+
const consoleLines = [];
|
|
1019
|
+
let index = 0;
|
|
1020
|
+
for (const item of output) {
|
|
1021
|
+
if (item.type === "image") {
|
|
1022
|
+
items.push(item);
|
|
1023
|
+
} else if (item.console) {
|
|
1024
|
+
consoleLines.push(item.text);
|
|
1025
|
+
} else {
|
|
1026
|
+
index++;
|
|
1027
|
+
items.push({ type: "text", text: total > 1 ? `==> text ${index}/${total} <==
|
|
1028
|
+
${item.text}` : item.text });
|
|
1029
|
+
}
|
|
1030
|
+
}
|
|
1031
|
+
if (consoleLines.length > 0) {
|
|
1032
|
+
items.push({ type: "text", text: `<console_output>
|
|
1033
|
+
${consoleLines.join(`
|
|
1034
|
+
`)}
|
|
1035
|
+
</console_output>` });
|
|
1036
|
+
}
|
|
1037
|
+
return items;
|
|
1038
|
+
}
|
|
1039
|
+
function joinAdjacentText(items) {
|
|
1040
|
+
const joined = [];
|
|
1041
|
+
for (const item of items) {
|
|
1042
|
+
const last = joined.at(-1);
|
|
1043
|
+
if (item.type === "text" && last?.type === "text") {
|
|
1044
|
+
const separator = last.text === "" || last.text.endsWith(`
|
|
1045
|
+
`) ? "" : `
|
|
1046
|
+
`;
|
|
1047
|
+
joined[joined.length - 1] = { type: "text", text: `${last.text}${separator}${item.text}` };
|
|
1048
|
+
} else {
|
|
1049
|
+
joined.push(item);
|
|
1050
|
+
}
|
|
1051
|
+
}
|
|
1052
|
+
return joined;
|
|
1053
|
+
}
|
|
1005
1054
|
function formatCallSummary(calls) {
|
|
1006
1055
|
if (calls.length === 0)
|
|
1007
1056
|
return "No tool calls were made.";
|
|
@@ -1158,26 +1207,27 @@ async function executeCodemode(toolCallId, input, signal, onUpdate, ctx, options
|
|
|
1158
1207
|
if (call.status === "running")
|
|
1159
1208
|
call.status = "cancelled";
|
|
1160
1209
|
}
|
|
1161
|
-
const
|
|
1210
|
+
const scriptOutput = [...result.output];
|
|
1162
1211
|
if (result.ok) {
|
|
1163
1212
|
const { set, delete: deleted } = result.storeWrites;
|
|
1164
1213
|
if (Object.keys(set).length > 0 || deleted.length > 0) {
|
|
1165
1214
|
options.appendEntry?.(CODEMODE_STORE_ENTRY_TYPE, { set, delete: deleted });
|
|
1166
1215
|
}
|
|
1167
1216
|
if (result.value !== undefined)
|
|
1168
|
-
|
|
1169
|
-
}
|
|
1217
|
+
scriptOutput.push({ type: "text", text: valueText(result.value) });
|
|
1218
|
+
}
|
|
1219
|
+
const items = formatOutput(scriptOutput);
|
|
1220
|
+
if (!result.ok)
|
|
1170
1221
|
items.push({ type: "text", text: `Script error:
|
|
1171
1222
|
${formatError(result, calls)}` });
|
|
1172
|
-
}
|
|
1173
1223
|
if (generatedImages > 0 && !items.some((item) => item.type === "image")) {
|
|
1174
1224
|
items.push({
|
|
1175
1225
|
type: "text",
|
|
1176
1226
|
text: `Note: models.generateImages() returned ${generatedImages} image${generatedImages === 1 ? "" : "s"} that the script did not show. Show each image block of result.output with image(block).`
|
|
1177
1227
|
});
|
|
1178
1228
|
}
|
|
1179
|
-
const truncated = await truncateOutput(items, sourceOptions.maxOutputTokens ?? DEFAULT_MAX_OUTPUT_TOKENS);
|
|
1180
|
-
const output = await saveImages(truncated.items);
|
|
1229
|
+
const truncated = await truncateOutput(joinAdjacentText(items), sourceOptions.maxOutputTokens ?? DEFAULT_MAX_OUTPUT_TOKENS);
|
|
1230
|
+
const output = joinAdjacentText(await saveImages(truncated.items));
|
|
1181
1231
|
const wallTime = ((performance.now() - startedAt) / 1000).toFixed(1);
|
|
1182
1232
|
const header = `${result.ok ? "Script completed" : "Script failed"}
|
|
1183
1233
|
Wall time ${wallTime} seconds
|
|
@@ -13,11 +13,11 @@ import {
|
|
|
13
13
|
toGoogleSdkThinkingLevel,
|
|
14
14
|
toGoogleThinkingLevel,
|
|
15
15
|
usesGoogleThinkingLevel
|
|
16
|
-
} from "./cli-
|
|
16
|
+
} from "./cli-95zs84qw.js";
|
|
17
17
|
import {
|
|
18
18
|
getPiUserAgent
|
|
19
19
|
} from "./cli-et1bbwqf.js";
|
|
20
|
-
import"./cli-
|
|
20
|
+
import"./cli-zy39d433.js";
|
|
21
21
|
import"./cli-yatxqynm.js";
|
|
22
22
|
import {
|
|
23
23
|
formatProviderError,
|
|
@@ -25,7 +25,7 @@ import {
|
|
|
25
25
|
} from "./cli-6map995v.js";
|
|
26
26
|
import {
|
|
27
27
|
buildBaseOptions
|
|
28
|
-
} from "./cli-
|
|
28
|
+
} from "./cli-xf713zz0.js";
|
|
29
29
|
import {
|
|
30
30
|
sanitizeSurrogates
|
|
31
31
|
} from "./cli-y2apkfe2.js";
|
|
@@ -39,10 +39,10 @@ import {
|
|
|
39
39
|
getCurrentTools,
|
|
40
40
|
getInitialSystemMessage,
|
|
41
41
|
getSystemMessageText
|
|
42
|
-
} from "./cli-
|
|
42
|
+
} from "./cli-g7k7zbcz.js";
|
|
43
43
|
import {
|
|
44
44
|
AssistantMessageEventStream
|
|
45
|
-
} from "./cli-
|
|
45
|
+
} from "./cli-wnb9b2g3.js";
|
|
46
46
|
import"./cli-76yrvwsa.js";
|
|
47
47
|
import"./cli-pzxba7gw.js";
|
|
48
48
|
import"./cli-bc05qbss.js";
|
|
@@ -14,11 +14,11 @@ import {
|
|
|
14
14
|
toGoogleSdkThinkingLevel,
|
|
15
15
|
toGoogleThinkingLevel,
|
|
16
16
|
usesGoogleThinkingLevel
|
|
17
|
-
} from "./cli-
|
|
17
|
+
} from "./cli-95zs84qw.js";
|
|
18
18
|
import {
|
|
19
19
|
getPiUserAgent
|
|
20
20
|
} from "./cli-et1bbwqf.js";
|
|
21
|
-
import"./cli-
|
|
21
|
+
import"./cli-zy39d433.js";
|
|
22
22
|
import"./cli-yatxqynm.js";
|
|
23
23
|
import {
|
|
24
24
|
formatProviderError,
|
|
@@ -26,7 +26,7 @@ import {
|
|
|
26
26
|
} from "./cli-6map995v.js";
|
|
27
27
|
import {
|
|
28
28
|
buildBaseOptions
|
|
29
|
-
} from "./cli-
|
|
29
|
+
} from "./cli-xf713zz0.js";
|
|
30
30
|
import {
|
|
31
31
|
sanitizeSurrogates
|
|
32
32
|
} from "./cli-y2apkfe2.js";
|
|
@@ -40,13 +40,13 @@ import {
|
|
|
40
40
|
getCurrentTools,
|
|
41
41
|
getInitialSystemMessage,
|
|
42
42
|
getSystemMessageText
|
|
43
|
-
} from "./cli-
|
|
43
|
+
} from "./cli-g7k7zbcz.js";
|
|
44
44
|
import {
|
|
45
45
|
getProviderEnvValue
|
|
46
46
|
} from "./cli-btbzvq95.js";
|
|
47
47
|
import {
|
|
48
48
|
AssistantMessageEventStream
|
|
49
|
-
} from "./cli-
|
|
49
|
+
} from "./cli-wnb9b2g3.js";
|
|
50
50
|
import"./cli-76yrvwsa.js";
|
|
51
51
|
import"./cli-pzxba7gw.js";
|
|
52
52
|
import"./cli-bc05qbss.js";
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import {
|
|
2
|
+
GROK_REQUIREMENTS_TOML,
|
|
3
|
+
GrokAdapter,
|
|
4
|
+
buildGrokConfigToml,
|
|
5
|
+
checkGrokCredentials,
|
|
6
|
+
grokOpenRouterModel,
|
|
7
|
+
installedClaudePluginNames
|
|
8
|
+
} from "./cli-ykt8f7va.js";
|
|
9
|
+
import"./cli-cexctgn5.js";
|
|
10
|
+
import"./cli-jvmtxqtc.js";
|
|
11
|
+
import"./cli-gt4hxb8p.js";
|
|
12
|
+
import"./cli-5bfdm1ah.js";
|
|
13
|
+
import"./cli-zp67qg5x.js";
|
|
14
|
+
import"./cli-tng3131n.js";
|
|
15
|
+
import"./cli-zm7njwzd.js";
|
|
16
|
+
import"./cli-ptcz1cqy.js";
|
|
17
|
+
import"./cli-7avy4v8w.js";
|
|
18
|
+
import"./cli-tmhsxhb8.js";
|
|
19
|
+
import"./cli-dpvkp2et.js";
|
|
20
|
+
import"./cli-re8z5p8p.js";
|
|
21
|
+
import"./cli-zt3w1cn1.js";
|
|
22
|
+
import"./cli-tadfgd0t.js";
|
|
23
|
+
import"./cli-ywybs5as.js";
|
|
24
|
+
import"./cli-f9w1semm.js";
|
|
25
|
+
import"./cli-a35hzdve.js";
|
|
26
|
+
import"./cli-ej6gbxfb.js";
|
|
27
|
+
import"./cli-014vns2y.js";
|
|
28
|
+
import"./cli-w5e1d1vv.js";
|
|
29
|
+
import"./cli-ymmc1zxg.js";
|
|
30
|
+
import"./cli-wt7ccy4r.js";
|
|
31
|
+
import"./cli-bc05qbss.js";
|
|
32
|
+
export {
|
|
33
|
+
GROK_REQUIREMENTS_TOML,
|
|
34
|
+
GrokAdapter,
|
|
35
|
+
buildGrokConfigToml,
|
|
36
|
+
checkGrokCredentials,
|
|
37
|
+
grokOpenRouterModel,
|
|
38
|
+
installedClaudePluginNames
|
|
39
|
+
};
|
|
@@ -5,73 +5,69 @@ import {
|
|
|
5
5
|
isUserAllowed,
|
|
6
6
|
registerMessageHandler,
|
|
7
7
|
resetSlackHandlerCachesForTesting
|
|
8
|
-
} from "./cli-
|
|
9
|
-
import"./cli-
|
|
10
|
-
import"./cli-
|
|
11
|
-
import"./cli-
|
|
12
|
-
import"./cli-
|
|
13
|
-
import"./cli-
|
|
8
|
+
} from "./cli-6qxmjpem.js";
|
|
9
|
+
import"./cli-1yrcfa5s.js";
|
|
10
|
+
import"./cli-y0kjpfm9.js";
|
|
11
|
+
import"./cli-wydz3feg.js";
|
|
12
|
+
import"./cli-xvc3q9br.js";
|
|
13
|
+
import"./cli-mv2520nm.js";
|
|
14
14
|
import"./cli-w0bwte75.js";
|
|
15
15
|
import"./cli-re8z5p8p.js";
|
|
16
|
-
import"./cli-
|
|
17
|
-
import"./cli-
|
|
18
|
-
import"./cli-
|
|
19
|
-
import"./cli-
|
|
16
|
+
import"./cli-tx2zvn23.js";
|
|
17
|
+
import"./cli-p8rt8spp.js";
|
|
18
|
+
import"./cli-v1pwxreq.js";
|
|
19
|
+
import"./cli-577bxkf6.js";
|
|
20
20
|
import"./cli-epan13p1.js";
|
|
21
21
|
import"./cli-f14fvzag.js";
|
|
22
|
+
import"./cli-7mhy3ths.js";
|
|
23
|
+
import"./cli-v1w7pbd8.js";
|
|
22
24
|
import"./cli-zt3w1cn1.js";
|
|
23
|
-
import"./cli-
|
|
24
|
-
import"./cli-ftry7975.js";
|
|
25
|
-
import"./cli-3dpj7atn.js";
|
|
26
|
-
import"./cli-2x0e561b.js";
|
|
27
|
-
import"./cli-pkke6geq.js";
|
|
25
|
+
import"./cli-km4x66j0.js";
|
|
28
26
|
import"./cli-rb9m6rpe.js";
|
|
27
|
+
import"./cli-2x0e561b.js";
|
|
28
|
+
import"./cli-kw0jcfje.js";
|
|
29
29
|
import"./cli-mzfth0bp.js";
|
|
30
|
-
import"./cli-jqt9hrnz.js";
|
|
31
|
-
import"./cli-yhmwmv0g.js";
|
|
32
|
-
import"./cli-wfajtmf7.js";
|
|
33
|
-
import"./cli-a87b04k8.js";
|
|
34
30
|
import"./cli-fad8m16k.js";
|
|
35
31
|
import"./cli-bsakbbkm.js";
|
|
36
32
|
import"./cli-zxg80zs9.js";
|
|
37
33
|
import"./cli-51tf7ac3.js";
|
|
38
34
|
import"./cli-ydt3zkwv.js";
|
|
39
|
-
import"./cli-
|
|
35
|
+
import"./cli-c8r99akr.js";
|
|
40
36
|
import"./cli-q51yprfq.js";
|
|
41
37
|
import"./cli-3er6gcsn.js";
|
|
42
|
-
import"./cli-cvk6yzw5.js";
|
|
43
38
|
import"./cli-yatxqynm.js";
|
|
44
|
-
import"./cli-
|
|
45
|
-
import"./cli-
|
|
39
|
+
import"./cli-mn8qkd8v.js";
|
|
40
|
+
import"./cli-g7k7zbcz.js";
|
|
46
41
|
import"./cli-btbzvq95.js";
|
|
47
42
|
import"./cli-1m2e086m.js";
|
|
48
|
-
import"./cli-
|
|
43
|
+
import"./cli-wnb9b2g3.js";
|
|
49
44
|
import"./cli-bd957dgb.js";
|
|
50
45
|
import"./cli-pzxba7gw.js";
|
|
51
|
-
import"./cli-
|
|
46
|
+
import"./cli-ypgba1a8.js";
|
|
52
47
|
import"./cli-rfphkzh5.js";
|
|
53
|
-
import"./cli-
|
|
54
|
-
import"./cli-9s3h836g.js";
|
|
48
|
+
import"./cli-mkdsy1nq.js";
|
|
55
49
|
import"./cli-3qhyh31j.js";
|
|
56
|
-
import"./cli-
|
|
50
|
+
import"./cli-xvdgasgy.js";
|
|
51
|
+
import"./cli-mxvnnv5q.js";
|
|
57
52
|
import"./cli-7mm2r1kp.js";
|
|
58
53
|
import"./cli-g5erf0zt.js";
|
|
59
54
|
import"./cli-dmtrxqhg.js";
|
|
60
|
-
import"./cli-tadfgd0t.js";
|
|
61
|
-
import"./cli-ywybs5as.js";
|
|
62
|
-
import"./cli-gd4favx9.js";
|
|
63
55
|
import"./cli-agamgm0p.js";
|
|
64
56
|
import"./cli-5c2j5yvx.js";
|
|
65
57
|
import"./cli-1a2j50m0.js";
|
|
58
|
+
import"./cli-tadfgd0t.js";
|
|
59
|
+
import"./cli-ywybs5as.js";
|
|
66
60
|
import"./cli-f9w1semm.js";
|
|
61
|
+
import"./cli-a35hzdve.js";
|
|
62
|
+
import"./cli-gd4favx9.js";
|
|
67
63
|
import"./cli-ej6gbxfb.js";
|
|
68
|
-
import"./cli-
|
|
64
|
+
import"./cli-014vns2y.js";
|
|
69
65
|
import"./cli-sd0mxa3c.js";
|
|
70
66
|
import"./cli-w5e1d1vv.js";
|
|
71
|
-
import"./cli-
|
|
72
|
-
import"./cli-
|
|
67
|
+
import"./cli-ymmc1zxg.js";
|
|
68
|
+
import"./cli-mb75wpxf.js";
|
|
73
69
|
import"./cli-zf8jjwex.js";
|
|
74
|
-
import"./cli-
|
|
70
|
+
import"./cli-wt7ccy4r.js";
|
|
75
71
|
import"./cli-bc05qbss.js";
|
|
76
72
|
export {
|
|
77
73
|
checkUserAccess,
|
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
import {
|
|
3
3
|
materializeClaudeMd,
|
|
4
4
|
stopClaudeMd
|
|
5
|
-
} from "./cli-
|
|
5
|
+
} from "./cli-69egj654.js";
|
|
6
6
|
import {
|
|
7
7
|
guardGhPrBody
|
|
8
8
|
} from "./cli-v6vv7dy8.js";
|
|
9
9
|
import {
|
|
10
10
|
summarizeSession
|
|
11
|
-
} from "./cli-
|
|
11
|
+
} from "./cli-r7eeddkq.js";
|
|
12
12
|
import {
|
|
13
13
|
checkToolLoop,
|
|
14
14
|
clearToolHistory
|
|
@@ -23,12 +23,19 @@ import {
|
|
|
23
23
|
import {
|
|
24
24
|
getApiKey
|
|
25
25
|
} from "./cli-f14fvzag.js";
|
|
26
|
-
import"./cli-
|
|
27
|
-
import"./cli-
|
|
28
|
-
import"./cli-
|
|
29
|
-
import"./cli-2x0e561b.js";
|
|
30
|
-
import"./cli-pkke6geq.js";
|
|
26
|
+
import"./cli-7mhy3ths.js";
|
|
27
|
+
import"./cli-v1w7pbd8.js";
|
|
28
|
+
import"./cli-km4x66j0.js";
|
|
31
29
|
import"./cli-rb9m6rpe.js";
|
|
30
|
+
import"./cli-2x0e561b.js";
|
|
31
|
+
import"./cli-bsakbbkm.js";
|
|
32
|
+
import"./cli-zxg80zs9.js";
|
|
33
|
+
import"./cli-ydt3zkwv.js";
|
|
34
|
+
import"./cli-mn8qkd8v.js";
|
|
35
|
+
import"./cli-g7k7zbcz.js";
|
|
36
|
+
import"./cli-btbzvq95.js";
|
|
37
|
+
import"./cli-1m2e086m.js";
|
|
38
|
+
import"./cli-wnb9b2g3.js";
|
|
32
39
|
import {
|
|
33
40
|
buildIndependentIdentityPayloads,
|
|
34
41
|
contentSha256,
|
|
@@ -36,40 +43,31 @@ import {
|
|
|
36
43
|
init_profile_sync,
|
|
37
44
|
readIdentityBaselines,
|
|
38
45
|
warnProfileFileTooLarge
|
|
39
|
-
} from "./cli-
|
|
40
|
-
import"./cli-bsakbbkm.js";
|
|
41
|
-
import"./cli-zxg80zs9.js";
|
|
42
|
-
import"./cli-ydt3zkwv.js";
|
|
43
|
-
import"./cli-cvk6yzw5.js";
|
|
44
|
-
import"./cli-b0f70z24.js";
|
|
45
|
-
import"./cli-nexwh8zg.js";
|
|
46
|
-
import"./cli-btbzvq95.js";
|
|
47
|
-
import"./cli-1m2e086m.js";
|
|
48
|
-
import"./cli-bzr0ftht.js";
|
|
49
|
-
import"./cli-3a4m1aws.js";
|
|
46
|
+
} from "./cli-mxvnnv5q.js";
|
|
50
47
|
import"./cli-7mm2r1kp.js";
|
|
51
48
|
import"./cli-g5erf0zt.js";
|
|
52
49
|
import"./cli-dmtrxqhg.js";
|
|
50
|
+
import"./cli-agamgm0p.js";
|
|
51
|
+
import"./cli-5c2j5yvx.js";
|
|
52
|
+
import"./cli-1a2j50m0.js";
|
|
53
|
+
import"./cli-f9w1semm.js";
|
|
54
|
+
import"./cli-a35hzdve.js";
|
|
53
55
|
import {
|
|
54
56
|
MAX_PROFILE_FILE_LENGTH,
|
|
55
57
|
getMcpBaseUrl,
|
|
56
58
|
init_constants
|
|
57
59
|
} from "./cli-gd4favx9.js";
|
|
58
|
-
import"./cli-agamgm0p.js";
|
|
59
|
-
import"./cli-5c2j5yvx.js";
|
|
60
|
-
import"./cli-1a2j50m0.js";
|
|
61
|
-
import"./cli-f9w1semm.js";
|
|
62
60
|
import"./cli-ej6gbxfb.js";
|
|
63
61
|
import"./cli-sd0mxa3c.js";
|
|
64
62
|
import"./cli-w5e1d1vv.js";
|
|
65
63
|
import {
|
|
66
64
|
init_package,
|
|
67
65
|
package_default
|
|
68
|
-
} from "./cli-
|
|
66
|
+
} from "./cli-ymmc1zxg.js";
|
|
69
67
|
import {
|
|
70
68
|
init_secret_scrubber,
|
|
71
69
|
scrubSecrets
|
|
72
|
-
} from "./cli-
|
|
70
|
+
} from "./cli-wt7ccy4r.js";
|
|
73
71
|
import"./cli-bc05qbss.js";
|
|
74
72
|
|
|
75
73
|
// src/hooks/hook.ts
|
|
@@ -539,9 +537,18 @@ async function handleHook() {
|
|
|
539
537
|
}
|
|
540
538
|
};
|
|
541
539
|
const outputBlockResponse = (reason) => {
|
|
540
|
+
const response = msg.hook_event_name === "PreToolUse" ? {
|
|
541
|
+
hookSpecificOutput: {
|
|
542
|
+
hookEventName: "PreToolUse",
|
|
543
|
+
permissionDecision: "deny",
|
|
544
|
+
permissionDecisionReason: reason
|
|
545
|
+
}
|
|
546
|
+
} : { decision: "block", reason };
|
|
547
|
+
console.log(JSON.stringify(response));
|
|
548
|
+
};
|
|
549
|
+
const outputToolContext = (hookEventName, additionalContext) => {
|
|
542
550
|
const response = {
|
|
543
|
-
|
|
544
|
-
reason
|
|
551
|
+
hookSpecificOutput: { hookEventName, additionalContext }
|
|
545
552
|
};
|
|
546
553
|
console.log(JSON.stringify(response));
|
|
547
554
|
};
|
|
@@ -625,7 +632,13 @@ async function handleHook() {
|
|
|
625
632
|
};
|
|
626
633
|
await ping();
|
|
627
634
|
const agentInfo = await getAgentInfo();
|
|
628
|
-
if (agentInfo) {
|
|
635
|
+
if (msg.hook_event_name === "UserPromptSubmit" && agentInfo && !agentInfo.isLead && agentInfo.status === "busy") {
|
|
636
|
+
if (await checkAndBlockIfCancelled(true)) {
|
|
637
|
+
return;
|
|
638
|
+
}
|
|
639
|
+
}
|
|
640
|
+
const isToolEvent = msg.hook_event_name === "PreToolUse" || msg.hook_event_name === "PostToolUse";
|
|
641
|
+
if (agentInfo && !isToolEvent) {
|
|
629
642
|
console.log(`You are registered as ${agentInfo.isLead ? "lead" : "worker"} agent "${agentInfo.name}" (ID: ${agentInfo.id}, status: ${agentInfo.status}).`);
|
|
630
643
|
if (agentInfo.inbox) {
|
|
631
644
|
const tray = formatSystemTray(agentInfo.inbox);
|
|
@@ -634,7 +647,7 @@ async function handleHook() {
|
|
|
634
647
|
}
|
|
635
648
|
}
|
|
636
649
|
} else if (shouldShowRegistrationNudge({
|
|
637
|
-
agentInfoPresent:
|
|
650
|
+
agentInfoPresent: Boolean(agentInfo),
|
|
638
651
|
eventType: msg.hook_event_name,
|
|
639
652
|
hasAgentIdHeader: hasAgentIdHeader()
|
|
640
653
|
})) {
|
|
@@ -743,6 +756,7 @@ You do not have a pre-defined agent ID, you will receive one when you join the s
|
|
|
743
756
|
return;
|
|
744
757
|
}
|
|
745
758
|
}
|
|
759
|
+
let loopWarning;
|
|
746
760
|
if (agentInfo && !agentInfo.isLead && agentInfo.status === "busy") {
|
|
747
761
|
const loopTaskFile = await readTaskFile();
|
|
748
762
|
if (loopTaskFile?.taskId && msg.tool_name && msg.tool_input) {
|
|
@@ -752,7 +766,7 @@ You do not have a pre-defined agent ID, you will receive one when you join the s
|
|
|
752
766
|
return;
|
|
753
767
|
}
|
|
754
768
|
if (loopResult.severity === "warning" && loopResult.reason) {
|
|
755
|
-
|
|
769
|
+
loopWarning = `Warning: ${loopResult.reason}`;
|
|
756
770
|
}
|
|
757
771
|
}
|
|
758
772
|
}
|
|
@@ -763,6 +777,9 @@ You do not have a pre-defined agent ID, you will receive one when you join the s
|
|
|
763
777
|
return;
|
|
764
778
|
}
|
|
765
779
|
}
|
|
780
|
+
if (loopWarning) {
|
|
781
|
+
outputToolContext("PreToolUse", loopWarning);
|
|
782
|
+
}
|
|
766
783
|
break;
|
|
767
784
|
}
|
|
768
785
|
case "PostToolUse":
|
|
@@ -780,7 +797,7 @@ You do not have a pre-defined agent ID, you will receive one when you join the s
|
|
|
780
797
|
method: "PUT",
|
|
781
798
|
headers: mcpConfig.headers
|
|
782
799
|
}).catch((e) => {
|
|
783
|
-
console.
|
|
800
|
+
console.error("Failed to update agent activity timestamp:", e);
|
|
784
801
|
});
|
|
785
802
|
}
|
|
786
803
|
if (agentInfo) {
|
|
@@ -825,19 +842,11 @@ You do not have a pre-defined agent ID, you will receive one when you join the s
|
|
|
825
842
|
if (agentInfo.isLead) {
|
|
826
843
|
if (msg.tool_name?.endsWith("send-task")) {
|
|
827
844
|
const maybeTaskId = msg.tool_response?.task?.id;
|
|
828
|
-
|
|
845
|
+
outputToolContext("PostToolUse", `Task sent successfully.${maybeTaskId ? ` Task ID: ${maybeTaskId}.` : ""} Monitor progress using the get-task-details tool periodically.`);
|
|
829
846
|
}
|
|
830
847
|
}
|
|
831
848
|
}
|
|
832
849
|
break;
|
|
833
|
-
case "UserPromptSubmit": {
|
|
834
|
-
if (agentInfo && !agentInfo.isLead && agentInfo.status === "busy") {
|
|
835
|
-
if (await checkAndBlockIfCancelled(true)) {
|
|
836
|
-
return;
|
|
837
|
-
}
|
|
838
|
-
}
|
|
839
|
-
break;
|
|
840
|
-
}
|
|
841
850
|
case "Stop":
|
|
842
851
|
try {
|
|
843
852
|
const pm2ListOutput = await Bun.$`pm2 jlist 2>/dev/null || echo "[]"`.text();
|
|
@@ -1,42 +1,40 @@
|
|
|
1
1
|
import {
|
|
2
2
|
handleHook
|
|
3
|
-
} from "./cli-
|
|
4
|
-
import"./cli-
|
|
3
|
+
} from "./cli-z1dqhc9y.js";
|
|
4
|
+
import"./cli-69egj654.js";
|
|
5
5
|
import"./cli-v6vv7dy8.js";
|
|
6
|
-
import"./cli-
|
|
6
|
+
import"./cli-r7eeddkq.js";
|
|
7
7
|
import"./cli-hp1n6zq3.js";
|
|
8
8
|
import"./cli-w0bwte75.js";
|
|
9
9
|
import"./cli-f14fvzag.js";
|
|
10
|
-
import"./cli-
|
|
11
|
-
import"./cli-
|
|
12
|
-
import"./cli-
|
|
13
|
-
import"./cli-2x0e561b.js";
|
|
14
|
-
import"./cli-pkke6geq.js";
|
|
10
|
+
import"./cli-7mhy3ths.js";
|
|
11
|
+
import"./cli-v1w7pbd8.js";
|
|
12
|
+
import"./cli-km4x66j0.js";
|
|
15
13
|
import"./cli-rb9m6rpe.js";
|
|
16
|
-
import"./cli-
|
|
14
|
+
import"./cli-2x0e561b.js";
|
|
17
15
|
import"./cli-bsakbbkm.js";
|
|
18
16
|
import"./cli-zxg80zs9.js";
|
|
19
17
|
import"./cli-ydt3zkwv.js";
|
|
20
|
-
import"./cli-
|
|
21
|
-
import"./cli-
|
|
22
|
-
import"./cli-nexwh8zg.js";
|
|
18
|
+
import"./cli-mn8qkd8v.js";
|
|
19
|
+
import"./cli-g7k7zbcz.js";
|
|
23
20
|
import"./cli-btbzvq95.js";
|
|
24
21
|
import"./cli-1m2e086m.js";
|
|
25
|
-
import"./cli-
|
|
26
|
-
import"./cli-
|
|
22
|
+
import"./cli-wnb9b2g3.js";
|
|
23
|
+
import"./cli-mxvnnv5q.js";
|
|
27
24
|
import"./cli-7mm2r1kp.js";
|
|
28
25
|
import"./cli-g5erf0zt.js";
|
|
29
26
|
import"./cli-dmtrxqhg.js";
|
|
30
|
-
import"./cli-gd4favx9.js";
|
|
31
27
|
import"./cli-agamgm0p.js";
|
|
32
28
|
import"./cli-5c2j5yvx.js";
|
|
33
29
|
import"./cli-1a2j50m0.js";
|
|
34
30
|
import"./cli-f9w1semm.js";
|
|
31
|
+
import"./cli-a35hzdve.js";
|
|
32
|
+
import"./cli-gd4favx9.js";
|
|
35
33
|
import"./cli-ej6gbxfb.js";
|
|
36
34
|
import"./cli-sd0mxa3c.js";
|
|
37
35
|
import"./cli-w5e1d1vv.js";
|
|
38
|
-
import"./cli-
|
|
39
|
-
import"./cli-
|
|
36
|
+
import"./cli-ymmc1zxg.js";
|
|
37
|
+
import"./cli-wt7ccy4r.js";
|
|
40
38
|
import"./cli-bc05qbss.js";
|
|
41
39
|
|
|
42
40
|
// src/commands/hook.ts
|