@desplega.ai/agent-swarm 1.160.0 → 1.162.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 +4 -3
- package/dist/{acp-adapter-2mjwcsfh.js → acp-adapter-74m73ae9.js} +163 -49
- package/dist/{actions-e43rxskr.js → actions-4sr14gnt.js} +42 -38
- package/dist/{anthropic-messages-5qx80j9k.js → anthropic-messages-8xxrzky9.js} +22 -26
- package/dist/{app-mc7xfagn.js → app-pt68fbwp.js} +17 -14
- package/dist/{artifact-3v5t9jtg.js → artifact-fey7dvj9.js} +3 -2
- package/dist/{assistant-sedkzv3b.js → assistant-cv3jytks.js} +43 -39
- package/dist/{azure-openai-responses-nfb21z9a.js → azure-openai-responses-f5cqsyj8.js} +15 -10
- package/dist/{boot-reembed-m3656j2n.js → boot-reembed-4ht4gqth.js} +17 -14
- package/dist/{boot-reembed-cqz9swn5.js → boot-reembed-nxpcvpj9.js} +16 -13
- package/dist/{boot-scrub-logs-xbxf5d7w.js → boot-scrub-logs-k93kyw8k.js} +13 -10
- package/dist/boot-seeds-1skcrs0e.js +32 -0
- package/dist/{claude-adapter-dc6289mc.js → claude-adapter-r5g0tzge.js} +39 -30
- package/dist/{claude-managed-adapter-naaw51me.js → claude-managed-adapter-yxkfxg8j.js} +6 -5
- package/dist/{claude-managed-setup-eacvchx0.js → claude-managed-setup-pkyrgshb.js} +27 -27
- package/dist/{claude-sdk-session-bqp2xvym.js → claude-sdk-session-jxyxnrwd.js} +8041 -7910
- package/dist/{cli-4derpgyk.js → cli-2hhfhfq5.js} +6 -1
- package/dist/{cli-rykfmgwg.js → cli-2x0e561b.js} +1 -1
- package/dist/{cli-tzx2ke1v.js → cli-2zy95vhm.js} +137 -64
- package/dist/{cli-0x01kwrd.js → cli-4cwxn7gp.js} +47 -186
- package/dist/{cli-xjcywfsf.js → cli-4dcpaefp.js} +12 -11
- package/dist/{cli-v7fn5gms.js → cli-4x0csdjq.js} +164 -76
- package/dist/{cli-12tszpk9.js → cli-5bcd7sfy.js} +91 -29
- package/dist/{cli-jz4w45qt.js → cli-5k6k8ta3.js} +190 -50
- package/dist/{cli-tpq83z89.js → cli-5xhpb3kv.js} +20 -19
- package/dist/{cli-r1mxd1xh.js → cli-7af8yhav.js} +6 -179
- package/dist/{cli-jajnsm8q.js → cli-7tre70zp.js} +18160 -31345
- package/dist/{cli-447dt1h3.js → cli-8ev9xqnx.js} +218 -25
- package/dist/cli-bsky8g7w.js +449 -0
- package/dist/{cli-0z2v4nhw.js → cli-cat6h73s.js} +1 -1
- package/dist/{cli-25fcq4b4.js → cli-cebmgwsc.js} +15 -11
- package/dist/{cli-shkxm1vn.js → cli-cvatsam7.js} +189 -13
- package/dist/{cli-2658f6at.js → cli-cvk6yzw5.js} +6 -8
- package/dist/cli-dbmwby6a.js +9 -0
- package/dist/{cli-ptr8h7kp.js → cli-eg0b3p0k.js} +5 -218
- package/dist/cli-f9w1semm.js +413 -0
- package/dist/{cli-523679eh.js → cli-g739zqzt.js} +6 -5
- package/dist/{cli-dv6cdjs2.js → cli-gd4favx9.js} +28 -7
- package/dist/{cli-c8a36vcc.js → cli-gpqpmns7.js} +2 -2
- package/dist/{cli-5nbmpy8w.js → cli-hb5c2x5y.js} +1 -1
- package/dist/{cli-741yb0xx.js → cli-hmsw1gpy.js} +55 -169
- package/dist/{cli-qydf22qq.js → cli-jf7wmv1r.js} +2562 -735
- package/dist/{cli-mfe5btp9.js → cli-jxs2ygaw.js} +317 -121
- package/dist/{cli-kmcpfwn2.js → cli-jyy6pm2f.js} +19 -3
- package/dist/cli-kdkwd3yr.js +615 -0
- package/dist/{cli-6cs6wzxt.js → cli-kh04eqwe.js} +2 -2
- package/dist/{cli-9hsgwz4w.js → cli-kp42yek0.js} +1309 -391
- package/dist/cli-ma3zvh39.js +10404 -0
- package/dist/{cli-ybgv4kw2.js → cli-mbssg1xv.js} +9 -2
- package/dist/{cli-jsp14b6c.js → cli-mzfth0bp.js} +38 -1
- package/dist/{cli-r2ap2czm.js → cli-nexqx4ve.js} +6 -0
- package/dist/{cli-f8gy6r2r.js → cli-nq7yqw7b.js} +19 -8
- package/dist/{cli-10nhj6xq.js → cli-nt8hecg9.js} +34 -33
- package/dist/cli-p0r8sxj5.js +303 -0
- package/dist/{cli-58e8yr0d.js → cli-pkd6s2wy.js} +4 -2
- package/dist/{cli-a8dvhzrt.js → cli-q24re23n.js} +7 -5
- package/dist/cli-qjjvzwzd.js +222 -0
- package/dist/cli-qrgt5bqf.js +189 -0
- package/dist/{cli-et8m9xsv.js → cli-rfjw9jw2.js} +22 -10
- package/dist/{cli-7e398j1h.js → cli-rj0gqwwp.js} +3 -3
- package/dist/{cli-btfv8y88.js → cli-rnyzn44p.js} +2 -2
- package/dist/{cli-d5czme6m.js → cli-s3hwpt9v.js} +4754 -4945
- package/dist/{cli-0jwe9034.js → cli-sptrj5f5.js} +3 -3
- package/dist/{cli-0q3avq3s.js → cli-sqvfa090.js} +19 -11
- package/dist/{cli-azhgzetg.js → cli-swfmp1fx.js} +27 -27
- package/dist/{cli-jyk0ynw2.js → cli-t845n9xk.js} +23 -10
- package/dist/{cli-zpep9q5e.js → cli-tcen9p5w.js} +20 -15
- package/dist/{cli-74h9hscv.js → cli-tre4bdgq.js} +1 -1
- package/dist/{cli-pm1rst0h.js → cli-twrh04ap.js} +30 -15
- package/dist/{cli-phsaj4xq.js → cli-v0pvvhfq.js} +1 -1
- package/dist/{cli-ydmcgve1.js → cli-vc9bp061.js} +5 -5
- package/dist/{cli-g2whhdrf.js → cli-vxe6qa4h.js} +1 -1
- package/dist/{cli-vctdqs5h.js → cli-vy3ed88x.js} +15 -2
- package/dist/{cli-br0qdrnp.js → cli-vyqs9ya8.js} +18 -18
- package/dist/{cli-cpvsaqsw.js → cli-w0bwte75.js} +8 -5
- package/dist/cli-wbvnn6tk.js +861 -0
- package/dist/{cli-r94z9p1z.js → cli-wgbezhw2.js} +3 -0
- package/dist/{cli-evvtk35y.js → cli-wjgs5wxe.js} +7 -7
- package/dist/cli-wxkkd0e0.js +33 -0
- package/dist/{cli-0wgxmwf6.js → cli-xk79303e.js} +20 -7
- package/dist/{cli-ktmyrtpn.js → cli-xqpk3rp7.js} +33 -10
- package/dist/{cli-ygwm91nt.js → cli-yy6dew39.js} +1 -1
- package/dist/cli-zp38xvtm.js +9487 -0
- package/dist/{cli-tfky2838.js → cli-zvhd3f64.js} +4 -4
- package/dist/{cli-jayjpjmb.js → cli-zxqx25nz.js} +66 -23
- package/dist/cli.js +40 -32
- package/dist/{cloudflare-workers-ai-system-one-k6fbxw9d.js → cloudflare-workers-ai-system-one-k8ddqjkq.js} +8 -6
- package/dist/{codex-adapter-nmxcatww.js → codex-adapter-esvmnhn7.js} +24 -23
- package/dist/{codex-hook-20me6byw.js → codex-hook-m73jmqgx.js} +19 -3
- package/dist/{codex-login-w6fz4xbz.js → codex-login-cf7mzsgg.js} +2 -2
- package/dist/{codex-session-runner-90aa80ev.js → codex-session-runner-ban9excr.js} +24 -23
- package/dist/{commands-8wcq1kn7.js → commands-75413p2n.js} +13 -10
- package/dist/{db-j40kc4se.js → db-7f5pecwg.js} +17 -10
- package/dist/{dispatcher-4zqy768d.js → dispatcher-fh9at8nz.js} +41 -37
- package/dist/dsh-adapter-wpze65d4.js +24 -0
- package/dist/{e2b-ez07znam.js → e2b-gjgdjp91.js} +12 -9
- package/dist/easter-egg-3d-3w5c2n4c.js +1057 -0
- package/dist/{execute-6e7qeyk4.js → execute-f50wg9nh.js} +203 -49
- package/dist/{google-generative-ai-k6n5nbpp.js → google-generative-ai-jxxpnegy.js} +2 -2
- package/dist/{google-vertex-44xxtcvp.js → google-vertex-x7q1angm.js} +5 -5
- package/dist/{handlers-kjdce1w5.js → handlers-w13787bb.js} +44 -40
- package/dist/{hook-r2t4bqfg.js → hook-46g1jrvx.js} +34 -20
- package/dist/{hook-czx13n12.js → hook-4tpts2ry.js} +25 -21
- package/dist/{http-3bbb19be.js → http-19pzbfrt.js} +1440 -283
- package/dist/{index-668me3f0.js → index-8fd4dm4h.js} +42 -38
- package/dist/{index-fg0dsp6c.js → index-dqmp15bq.js} +41 -37
- package/dist/{index-kkv84jq9.js → index-qb4q1y3e.js} +41 -37
- package/dist/index-s75wc4wd.js +33 -0
- package/dist/{index-zg7vp46x.js → index-scptvdxg.js} +64 -38
- package/dist/{keepalive-yra8dy57.js → keepalive-xa5ts9cd.js} +15 -12
- package/dist/{lead-va0pad2c.js → lead-qp4xkvjq.js} +59 -54
- package/dist/{maintenance-hqewtmyg.js → maintenance-rm5885hm.js} +17 -14
- package/dist/{mistral-conversations-pc3ntnxt.js → mistral-conversations-rw7fbt22.js} +4 -4
- package/dist/{node-a5e00qhp.js → node-8zkdq42h.js} +834 -833
- package/dist/node-f0ykebbv.js +2107 -0
- package/dist/node-wyamey5r.js +19 -0
- package/dist/{oauth-refresh-sweep-7rdt1m9n.js → oauth-refresh-sweep-1csdfebf.js} +14 -11
- package/dist/{onboard-j6ms6d0x.js → onboard-r6b78cs4.js} +10 -10
- package/dist/{openai-codex-responses-bbancrr0.js → openai-codex-responses-efvrgrq3.js} +4 -4
- package/dist/{openai-completions-jpaj5g2b.js → openai-completions-bbbrrz4z.js} +12 -8
- package/dist/{openai-responses-200k1wx4.js → openai-responses-9jjyrcm1.js} +15 -10
- package/dist/{opencode-adapter-89rabkw2.js → opencode-adapter-kb3g6pkf.js} +12 -9
- package/dist/{otel-impl-a792rjz0.js → otel-impl-0y9knpky.js} +6 -6
- package/dist/{pi-mono-adapter-g7qzvr3v.js → pi-mono-adapter-z6s1bme2.js} +128 -37
- package/dist/{pricing-refresh-wx0tp7cb.js → pricing-refresh-mth26tgp.js} +15 -12
- package/dist/{rbac-roles-8tzawacv.js → rbac-roles-kwntb23q.js} +17 -12
- package/dist/rbac-roles-vpk4ebm8.js +45 -0
- package/dist/{registry-v5wytg0s.js → registry-km6t1jd2.js} +1 -1
- package/dist/{render-v2-mm7zswb8.js → render-v2-hcm7h00y.js} +17 -14
- package/dist/{runtime-zyssgse0.js → runtime-vfjsfsc5.js} +5 -4
- package/dist/{setup-8y70ys6t.js → setup-hbyzd65h.js} +2 -2
- package/dist/{virtual-modules-6nmk7h3n.js → virtual-modules-9bv7ry91.js} +9 -7
- package/dist/{work-objects-fg6xkb0n.js → work-objects-m09sxnhe.js} +44 -40
- package/dist/{worker-wmwhxsph.js → worker-0h35rvk4.js} +59 -54
- package/dist/{x-n3e0v3xa.js → x-f1gt1pz3.js} +2 -2
- package/openapi.json +699 -26
- package/package.json +19 -11
- package/src/azure-devops/api.ts +121 -0
- package/src/azure-devops/auth.ts +78 -0
- package/src/azure-devops/handlers.ts +413 -0
- package/src/azure-devops/index.ts +27 -0
- package/src/azure-devops/templates.ts +108 -0
- package/src/azure-devops/types.ts +90 -0
- package/src/be/api-drain.ts +184 -0
- package/src/be/db/tasks/read.ts +32 -7
- package/src/be/db/tasks/write.ts +21 -4
- package/src/be/db-client.ts +11 -2
- package/src/be/db-retention.ts +95 -32
- package/src/be/db.ts +44 -19
- package/src/be/memory/constants.ts +16 -0
- package/src/be/memory/graph-expansion.ts +8 -1
- package/src/be/memory/index-content.ts +20 -1
- package/src/be/memory/key-guard.ts +93 -0
- package/src/be/memory/key-paths.ts +103 -0
- package/src/be/memory/link-resolver.ts +29 -3
- package/src/be/memory/providers/sqlite-store.ts +152 -45
- package/src/be/memory/raters/llm-summarizer.ts +10 -4
- package/src/be/memory/raters/llm.ts +15 -5
- package/src/be/memory/raters/store.ts +6 -3
- package/src/be/memory/raters/types.ts +11 -0
- package/src/be/memory/reranker.ts +38 -7
- package/src/be/memory/types.ts +12 -1
- package/src/be/migrations/190_memory_rating_model.sql +7 -0
- package/src/be/migrations/191_context_versions_previous_index.sql +8 -0
- package/src/be/migrations/192_favorites_agent_fs_path.sql +36 -0
- package/src/be/onboarding.ts +7 -1
- package/src/be/pricing-normalize.ts +4 -2
- package/src/be/scripts/typecheck.ts +4 -3
- package/src/be/seed-pricing.ts +16 -0
- package/src/be/seed-prompt-templates.ts +1 -0
- package/src/be/swarm-config-guard.ts +46 -17
- package/src/be/task-citations.ts +11 -5
- package/src/be/users.ts +3 -0
- package/src/cli.tsx +3 -2
- package/src/comb/agent-fs.ts +39 -0
- package/src/comb/config.ts +37 -0
- package/src/comb/markers.ts +37 -0
- package/src/comb/review-batch.ts +486 -0
- package/src/comb/templates.ts +88 -0
- package/src/commands/claude-managed-setup.ts +33 -31
- package/src/commands/context-preamble.ts +4 -1
- package/src/commands/hook.ts +2 -1
- package/src/commands/provider-credentials.ts +28 -15
- package/src/commands/runner.ts +458 -110
- package/src/commands/templates.ts +10 -0
- package/src/e2b/env.ts +2 -0
- package/src/extensions/catalog.generated.json +17 -0
- package/src/extensions/contract-types.generated.ts +1 -1
- package/src/fs/agent-fs-provider.ts +106 -2
- package/src/github/handlers.ts +10 -74
- package/src/github/reactions.ts +119 -138
- package/src/github/task-reactions.ts +34 -11
- package/src/heartbeat/heartbeat.ts +4 -0
- package/src/hooks/codex-hook.ts +25 -1
- package/src/hooks/hook.ts +14 -1
- package/src/hooks/pr-body-guard.ts +983 -0
- package/src/http/agents.ts +1 -1
- package/src/http/all-routes.ts +1 -0
- package/src/http/assets.ts +5 -17
- package/src/http/comb.ts +131 -0
- package/src/http/core.ts +14 -1
- package/src/http/extensions.ts +51 -27
- package/src/http/fs.ts +9 -17
- package/src/http/index.ts +27 -9
- package/src/http/mcp-user.ts +8 -13
- package/src/http/mcp.ts +19 -12
- package/src/http/memory.ts +80 -14
- package/src/http/onboarding.ts +21 -2
- package/src/http/poll.ts +30 -3
- package/src/http/realtime.ts +62 -0
- package/src/http/request-principal.ts +22 -0
- package/src/http/session-data.ts +6 -4
- package/src/http/stats.ts +1 -0
- package/src/http/status.ts +34 -2
- package/src/http/tasks.ts +17 -3
- package/src/http/users.ts +1 -1
- package/src/http/webhooks.ts +120 -2
- package/src/kv-reserved-namespaces.ts +10 -5
- package/src/providers/claude-adapter.ts +84 -16
- package/src/providers/claude-managed-adapter.ts +29 -2
- package/src/providers/codex-adapter.ts +1 -1
- package/src/providers/codex-skill-resolver.ts +6 -0
- package/src/providers/dsh-adapter.ts +204 -7
- package/src/providers/opencode-adapter.ts +24 -3
- package/src/providers/pi-mono-adapter.ts +154 -5
- package/src/providers/pi-mono-extension.ts +1 -1
- package/src/providers/pricing-sources.md +5 -1
- package/src/providers/reasoning-effort.ts +10 -2
- package/src/providers/types.ts +1 -1
- package/src/rbac/legacy-policy.ts +3 -0
- package/src/rbac/permissions.ts +14 -0
- package/src/realtime/auth.ts +63 -1
- package/src/realtime/tickets.ts +52 -0
- package/src/realtime/transport.ts +51 -22
- package/src/scripts-runtime/types/stdlib.d.ts +13 -5
- package/src/scripts-runtime/types/swarm-extension.d.ts +7 -3
- package/src/scripts-runtime/types/swarm-sdk.d.ts +13 -5
- package/src/tasks/context-key.ts +38 -1
- package/src/telemetry-context.ts +175 -0
- package/src/telemetry-contract/EVENTS.md +81 -0
- package/src/telemetry-contract/SOURCE.json +9 -0
- package/src/telemetry-contract/catalog.json +1335 -0
- package/src/telemetry-contract/index.ts +60 -0
- package/src/telemetry-contract/types.gen.ts +1971 -0
- package/src/telemetry-identity.ts +129 -0
- package/src/telemetry-snapshot.ts +211 -0
- package/src/telemetry-trigger.ts +125 -0
- package/src/telemetry-types.typetest.ts +40 -0
- package/src/telemetry.ts +271 -67
- package/src/tests/api-drain-e2e.test.ts +249 -0
- package/src/tests/api-drain-worker-e2e.test.ts +216 -0
- package/src/tests/api-drain.test.ts +351 -0
- package/src/tests/azure-devops-auth.test.ts +100 -0
- package/src/tests/azure-devops-handlers.test.ts +324 -0
- package/src/tests/azure-devops-webhook-malformed.test.ts +96 -0
- package/src/tests/claude-default-route.test.ts +260 -0
- package/src/tests/claude-managed-adapter.test.ts +47 -0
- package/src/tests/claude-managed-setup.test.ts +48 -0
- package/src/tests/claude-prompt-body-once.test.ts +117 -0
- package/src/tests/claude-routes-e2e.test.ts +316 -0
- package/src/tests/comb-config-guard.test.ts +38 -0
- package/src/tests/comb-links.test.ts +162 -0
- package/src/tests/comb-markers.test.ts +68 -0
- package/src/tests/comb-review-batch.test.ts +770 -0
- package/src/tests/comb-status.test.ts +152 -0
- package/src/tests/context-versions-retention.test.ts +314 -0
- package/src/tests/core-auth.test.ts +7 -0
- package/src/tests/db-retention.test.ts +14 -14
- package/src/tests/db-task-read-contract.test.ts +3 -0
- package/src/tests/db-task-write-contract.test.ts +3 -0
- package/src/tests/docs-index-footprint.test.js +3 -3
- package/src/tests/dsh-adapter.test.ts +134 -2
- package/src/tests/dsh-usage.test.ts +153 -0
- package/src/tests/extensions-catalog.test.ts +1 -0
- package/src/tests/extensions-example-deploy-awareness.test.ts +301 -0
- package/src/tests/extensions-http.test.ts +137 -10
- package/src/tests/extensions-mcp-tools.test.ts +28 -0
- package/src/tests/favorites-agent-fs-path.test.ts +226 -0
- package/src/tests/fetch-resolved-env.test.ts +24 -0
- package/src/tests/fixtures/azure-devops/pull-request-commented.json +129 -0
- package/src/tests/fixtures/azure-devops/pull-request-created.json +88 -0
- package/src/tests/fixtures/fake-claude-routes.ts +229 -0
- package/src/tests/github-handlers-reactions.test.ts +486 -0
- package/src/tests/github-reactions.test.ts +280 -0
- package/src/tests/harness-cli-version.test.ts +62 -0
- package/src/tests/http-api-integration.test.ts +21 -0
- package/src/tests/http-task-write-ownership.test.ts +24 -1
- package/src/tests/internal-ai/complete-structured.test.ts +94 -0
- package/src/tests/internal-ai/credentials.test.ts +22 -0
- package/src/tests/internal-ai/models.test.ts +36 -2
- package/src/tests/internal-ai/schema-parity.test.ts +25 -1
- package/src/tests/internal-ai/summarize-session.test.ts +23 -7
- package/src/tests/mcp-user-route.test.ts +133 -0
- package/src/tests/memory-key-paths.test.ts +1055 -0
- package/src/tests/memory-link-resolver.test.ts +34 -0
- package/src/tests/memory-rate-endpoint.test.ts +66 -0
- package/src/tests/memory-rater-llm-summarizer.test.ts +2 -1
- package/src/tests/memory-rater-llm.test.ts +73 -0
- package/src/tests/memory-rater-store.test.ts +31 -0
- package/src/tests/memory-reranker.test.ts +40 -0
- package/src/tests/onboarding.test.ts +108 -0
- package/src/tests/opencode-adapter.test.ts +57 -0
- package/src/tests/opencode-plugin.test.ts +4 -0
- package/src/tests/pi-codemode.test.ts +82 -4
- package/src/tests/pi-mono-adapter.test.ts +265 -2
- package/src/tests/pr-body-leaks.test.ts +789 -0
- package/src/tests/preload.ts +14 -0
- package/src/tests/provider-registration.test.ts +0 -2
- package/src/tests/providers/pi-cost.test.ts +190 -4
- package/src/tests/rbac-engine.test.ts +25 -1
- package/src/tests/realtime-room-auth.test.ts +104 -1
- package/src/tests/realtime-tickets.test.ts +74 -0
- package/src/tests/realtime-transport.test.ts +131 -4
- package/src/tests/runner-api-drain.test.ts +301 -0
- package/src/tests/runner-fallback-output.test.ts +61 -0
- package/src/tests/runner-fenced-json-output.test.ts +178 -0
- package/src/tests/runner-slot-reconcile.test.ts +199 -0
- package/src/tests/script-connections.test.ts +6 -0
- package/src/tests/send-task-requested-by.test.ts +133 -15
- package/src/tests/session-costs-recompute-all-providers.test.ts +23 -0
- package/src/tests/task-lifecycle-telemetry.test.ts +8 -3
- package/src/tests/task-reactions.test.ts +29 -6
- package/src/tests/telemetry-context.test.ts +314 -0
- package/src/tests/telemetry-init.test.ts +51 -19
- package/src/tests/telemetry-snapshot.test.ts +229 -0
- package/src/tests/telemetry-trigger.test.ts +200 -0
- package/src/tests/template-registry-helpers.ts +1 -0
- package/src/tests/vcs-azure-devops.test.ts +73 -0
- package/src/tests/webhooks-task-blocked.test.ts +23 -0
- package/src/tests/workflow-agent-task-retry.test.ts +363 -0
- package/src/tests/workflow-definition-telemetry.test.ts +4 -4
- package/src/tests/workflow-llm.test.ts +14 -0
- package/src/tools/context-diff.ts +20 -0
- package/src/tools/extension-install.ts +27 -16
- package/src/tools/memory-edit.ts +47 -3
- package/src/tools/memory-search.ts +13 -1
- package/src/tools/memory-store.ts +55 -3
- package/src/tools/poll-task.ts +20 -1
- package/src/tools/send-task.ts +9 -1
- package/src/tools/task-action.ts +11 -0
- package/src/types.ts +45 -8
- package/src/utils/api-drain.ts +24 -0
- package/src/utils/constants.ts +57 -16
- package/src/utils/credentials.test.ts +31 -1
- package/src/utils/credentials.ts +20 -9
- package/src/utils/dsh-usage.ts +53 -0
- package/src/utils/harness-cli-version.ts +6 -4
- package/src/utils/internal-ai/complete-structured.ts +26 -3
- package/src/utils/internal-ai/credentials.ts +23 -9
- package/src/utils/internal-ai/index.ts +8 -1
- package/src/utils/internal-ai/models.ts +34 -8
- package/src/utils/internal-ai/summarize-session.ts +22 -8
- package/src/utils/pr-body-leaks.ts +172 -0
- package/src/utils/secret-scrubber.ts +8 -0
- package/src/utils/task-attachment-links.ts +14 -8
- package/src/vcs/azure-devops.ts +80 -0
- package/src/vcs/index.ts +5 -1
- package/src/vcs/types.ts +2 -2
- package/src/workflows/recovery.ts +26 -1
- package/src/workflows/resume.ts +31 -4
- package/src/workflows/task-step-routing.ts +75 -2
- package/templates/community/open-prompt-showreel/PLAYBOOK.md +336 -0
- package/templates/community/open-prompt-showreel/README.md +33 -0
- package/templates/community/open-prompt-showreel/example/tla-races/facts.ts +145 -0
- package/templates/community/open-prompt-showreel/example/tla-races/facts.v3.json +140 -0
- package/templates/community/open-prompt-showreel/example/tla-races/music.mist-city.json +8 -0
- package/templates/community/open-prompt-showreel/example/tla-races/reel.html +805 -0
- package/templates/community/open-prompt-showreel/example/tla-races/smoke.sh +48 -0
- package/templates/community/open-prompt-showreel/lead-prompt.md +89 -0
- package/templates/community/open-prompt-showreel/setup.sh +167 -0
- package/templates/community/open-prompt-showreel/skills/motion-design-replication/SKILL.md +85 -0
- package/templates/community/open-prompt-showreel/skills/motion-design-video-analysis/SKILL.md +115 -0
- package/templates/community/open-prompt-showreel/skills/open-prompt-showreel/SKILL.md +147 -0
- package/templates/community/open-prompt-showreel/skills/video-generation/SKILL.md +195 -0
- package/templates/community/open-prompt-showreel/tools/fetch-music.sh +65 -0
- package/templates/community/open-prompt-showreel/tools/music-analyze.py +69 -0
- package/templates/community/open-prompt-showreel/tools/music-current.sh +34 -0
- package/templates/community/open-prompt-showreel/tools/music-cut.sh +36 -0
- package/templates/community/open-prompt-showreel/tools/music-refine.py +39 -0
- package/templates/community/open-prompt-showreel/tools/render.mjs +157 -0
- package/templates/community/open-prompt-showreel/tools/sheet.sh +44 -0
- package/templates/community/open-prompt-showreel/tools/web-compress.sh +17 -0
- package/templates/community/open-prompt-showreel/tools/x-reencode.sh +21 -0
- package/templates/extensions/README.md +1 -0
- package/templates/extensions/deploy-awareness/README.md +28 -0
- package/templates/extensions/deploy-awareness/hooks.ts +152 -0
- package/templates/extensions/deploy-awareness/manifest.json +8 -0
- package/templates/skills/memory/config.json +2 -2
- package/templates/skills/memory/content.md +59 -5
- package/templates/skills/swarm-extensions/config.json +1 -1
- package/templates/skills/swarm-extensions/content.md +28 -5
- package/tsconfig.json +3 -0
- package/dist/boot-seeds-gsetbs5y.js +0 -28
- package/dist/cli-j490egb5.js +0 -5632
- package/dist/cli-tjf4cn8z.js +0 -9119
- package/dist/cli-tmqt7dpj.js +0 -572
- package/dist/dsh-adapter-mpnzgztj.js +0 -19
- package/dist/index-7aj368tw.js +0 -30
|
@@ -2,26 +2,29 @@ import {
|
|
|
2
2
|
forceRefreshAuthorizationOrThrow,
|
|
3
3
|
getAuthorizationById,
|
|
4
4
|
listAuthorizationSweepRows
|
|
5
|
-
} from "./cli-
|
|
6
|
-
import"./cli-
|
|
5
|
+
} from "./cli-kh04eqwe.js";
|
|
6
|
+
import"./cli-jf7wmv1r.js";
|
|
7
|
+
import"./cli-xqpk3rp7.js";
|
|
7
8
|
import"./cli-3qhyh31j.js";
|
|
8
|
-
import"./cli-
|
|
9
|
-
import"./cli-r1mxd1xh.js";
|
|
9
|
+
import"./cli-7af8yhav.js";
|
|
10
10
|
import"./cli-n7h1kqpf.js";
|
|
11
|
-
import"./cli-
|
|
12
|
-
import"./cli-
|
|
13
|
-
import"./cli-1a2j50m0.js";
|
|
14
|
-
import"./cli-0wgxmwf6.js";
|
|
11
|
+
import"./cli-eg0b3p0k.js";
|
|
12
|
+
import"./cli-xk79303e.js";
|
|
15
13
|
import"./cli-ywybs5as.js";
|
|
14
|
+
import"./cli-gd4favx9.js";
|
|
15
|
+
import"./cli-qrgt5bqf.js";
|
|
16
|
+
import"./cli-qjjvzwzd.js";
|
|
17
|
+
import"./cli-1a2j50m0.js";
|
|
18
|
+
import"./cli-f9w1semm.js";
|
|
16
19
|
import"./cli-ej6gbxfb.js";
|
|
17
|
-
import"./cli-
|
|
20
|
+
import"./cli-jyy6pm2f.js";
|
|
18
21
|
import"./cli-sd0mxa3c.js";
|
|
19
22
|
import"./cli-w5e1d1vv.js";
|
|
20
|
-
import"./cli-
|
|
23
|
+
import"./cli-sqvfa090.js";
|
|
21
24
|
import {
|
|
22
25
|
init_secret_scrubber,
|
|
23
26
|
scrubSecrets
|
|
24
|
-
} from "./cli-
|
|
27
|
+
} from "./cli-nexqx4ve.js";
|
|
25
28
|
import"./cli-zf8jjwex.js";
|
|
26
29
|
import"./cli-bc05qbss.js";
|
|
27
30
|
|
|
@@ -3,22 +3,13 @@ import {
|
|
|
3
3
|
createDefaultMcpJson,
|
|
4
4
|
createDefaultSettingsLocal,
|
|
5
5
|
createHooksConfig
|
|
6
|
-
} from "./cli-
|
|
6
|
+
} from "./cli-vxe6qa4h.js";
|
|
7
7
|
import {
|
|
8
8
|
require_jsx_dev_runtime
|
|
9
9
|
} from "./cli-t3p77qk1.js";
|
|
10
10
|
import {
|
|
11
11
|
getApiKey
|
|
12
12
|
} from "./cli-f14fvzag.js";
|
|
13
|
-
import {
|
|
14
|
-
getSlackConfiguration,
|
|
15
|
-
init_config,
|
|
16
|
-
isSlackConfigured
|
|
17
|
-
} from "./cli-n7h1kqpf.js";
|
|
18
|
-
import {
|
|
19
|
-
init_package,
|
|
20
|
-
package_default
|
|
21
|
-
} from "./cli-0q3avq3s.js";
|
|
22
13
|
import {
|
|
23
14
|
Box_default,
|
|
24
15
|
Select,
|
|
@@ -31,6 +22,15 @@ import {
|
|
|
31
22
|
} from "./cli-fkqhbg8g.js";
|
|
32
23
|
import"./cli-0xqde53b.js";
|
|
33
24
|
import"./cli-pqetb83f.js";
|
|
25
|
+
import {
|
|
26
|
+
getSlackConfiguration,
|
|
27
|
+
init_config,
|
|
28
|
+
isSlackConfigured
|
|
29
|
+
} from "./cli-n7h1kqpf.js";
|
|
30
|
+
import {
|
|
31
|
+
init_package,
|
|
32
|
+
package_default
|
|
33
|
+
} from "./cli-sqvfa090.js";
|
|
34
34
|
import {
|
|
35
35
|
__toESM
|
|
36
36
|
} from "./cli-bc05qbss.js";
|
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
convertResponsesMessages,
|
|
3
3
|
convertResponsesTools,
|
|
4
4
|
processResponsesStream
|
|
5
|
-
} from "./cli-
|
|
5
|
+
} from "./cli-g739zqzt.js";
|
|
6
6
|
import {
|
|
7
7
|
clampOpenAIPromptCacheKey
|
|
8
8
|
} from "./cli-mrptpp86.js";
|
|
@@ -24,13 +24,11 @@ import {
|
|
|
24
24
|
import {
|
|
25
25
|
buildBaseOptions,
|
|
26
26
|
createGrammarToolInputProperties
|
|
27
|
-
} from "./cli-
|
|
27
|
+
} from "./cli-mbssg1xv.js";
|
|
28
28
|
import"./cli-y2apkfe2.js";
|
|
29
29
|
import {
|
|
30
30
|
headersToRecord
|
|
31
31
|
} from "./cli-7kyk9jr3.js";
|
|
32
|
-
import"./cli-btbzvq95.js";
|
|
33
|
-
import"./cli-1m2e086m.js";
|
|
34
32
|
import {
|
|
35
33
|
clampThinkingLevel,
|
|
36
34
|
getDeclaredTools,
|
|
@@ -40,6 +38,8 @@ import {
|
|
|
40
38
|
resolveTranscript,
|
|
41
39
|
resolveTranscriptTools
|
|
42
40
|
} from "./cli-ykk5jaax.js";
|
|
41
|
+
import"./cli-btbzvq95.js";
|
|
42
|
+
import"./cli-1m2e086m.js";
|
|
43
43
|
import {
|
|
44
44
|
AssistantMessageEventStream,
|
|
45
45
|
appendAssistantMessageDiagnostic,
|
|
@@ -30,21 +30,16 @@ import {
|
|
|
30
30
|
getJsonSchemaToolParameters,
|
|
31
31
|
resolveGrammarConstrainedSampling,
|
|
32
32
|
resolveJsonSchemaStrictSampling,
|
|
33
|
+
resolveSamplingParams,
|
|
33
34
|
thinkingBudgetForLevel,
|
|
34
35
|
transformMessages
|
|
35
|
-
} from "./cli-
|
|
36
|
+
} from "./cli-mbssg1xv.js";
|
|
36
37
|
import {
|
|
37
38
|
sanitizeSurrogates
|
|
38
39
|
} from "./cli-y2apkfe2.js";
|
|
39
40
|
import {
|
|
40
41
|
headersToRecord
|
|
41
42
|
} from "./cli-7kyk9jr3.js";
|
|
42
|
-
import {
|
|
43
|
-
getProviderEnvValue
|
|
44
|
-
} from "./cli-btbzvq95.js";
|
|
45
|
-
import {
|
|
46
|
-
parseStreamingJson
|
|
47
|
-
} from "./cli-1m2e086m.js";
|
|
48
43
|
import {
|
|
49
44
|
calculateCost,
|
|
50
45
|
clampThinkingLevel,
|
|
@@ -54,6 +49,12 @@ import {
|
|
|
54
49
|
resolveTranscript,
|
|
55
50
|
resolveTranscriptTools
|
|
56
51
|
} from "./cli-ykk5jaax.js";
|
|
52
|
+
import {
|
|
53
|
+
getProviderEnvValue
|
|
54
|
+
} from "./cli-btbzvq95.js";
|
|
55
|
+
import {
|
|
56
|
+
parseStreamingJson
|
|
57
|
+
} from "./cli-1m2e086m.js";
|
|
57
58
|
import {
|
|
58
59
|
AssistantMessageEventStream
|
|
59
60
|
} from "./cli-bzr0ftht.js";
|
|
@@ -708,7 +709,10 @@ function buildParams(model, context, options, compat = getCompat(model), cacheRe
|
|
|
708
709
|
params.providerOptions = { gateway: gatewayOptions };
|
|
709
710
|
}
|
|
710
711
|
}
|
|
711
|
-
|
|
712
|
+
const samplingParams = resolveSamplingParams(model, options?.reasoningEffort ?? "off", options?.samplingParams);
|
|
713
|
+
if (samplingParams) {
|
|
714
|
+
Object.assign(params, samplingParams);
|
|
715
|
+
}
|
|
712
716
|
return params;
|
|
713
717
|
}
|
|
714
718
|
function resolveThinkingTokenBudgetField(compat) {
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
convertResponsesMessages,
|
|
7
7
|
convertResponsesTools,
|
|
8
8
|
processResponsesStream
|
|
9
|
-
} from "./cli-
|
|
9
|
+
} from "./cli-g739zqzt.js";
|
|
10
10
|
import {
|
|
11
11
|
clampOpenAIPromptCacheKey
|
|
12
12
|
} from "./cli-mrptpp86.js";
|
|
@@ -26,22 +26,23 @@ import {
|
|
|
26
26
|
} from "./cli-6map995v.js";
|
|
27
27
|
import {
|
|
28
28
|
buildBaseOptions,
|
|
29
|
-
createGrammarToolInputProperties
|
|
30
|
-
|
|
29
|
+
createGrammarToolInputProperties,
|
|
30
|
+
resolveSamplingParams
|
|
31
|
+
} from "./cli-mbssg1xv.js";
|
|
31
32
|
import"./cli-y2apkfe2.js";
|
|
32
33
|
import {
|
|
33
34
|
headersToRecord
|
|
34
35
|
} from "./cli-7kyk9jr3.js";
|
|
35
|
-
import {
|
|
36
|
-
getProviderEnvValue
|
|
37
|
-
} from "./cli-btbzvq95.js";
|
|
38
|
-
import"./cli-1m2e086m.js";
|
|
39
36
|
import {
|
|
40
37
|
clampThinkingLevel,
|
|
41
38
|
getDeclaredTools,
|
|
42
39
|
resolveTranscript,
|
|
43
40
|
resolveTranscriptTools
|
|
44
41
|
} from "./cli-ykk5jaax.js";
|
|
42
|
+
import {
|
|
43
|
+
getProviderEnvValue
|
|
44
|
+
} from "./cli-btbzvq95.js";
|
|
45
|
+
import"./cli-1m2e086m.js";
|
|
45
46
|
import {
|
|
46
47
|
AssistantMessageEventStream
|
|
47
48
|
} from "./cli-bzr0ftht.js";
|
|
@@ -273,9 +274,10 @@ function buildParams(model, context, options, compat = getCompat(model), grammar
|
|
|
273
274
|
if (options?.toolChoice !== undefined) {
|
|
274
275
|
params.tool_choice = options.toolChoice;
|
|
275
276
|
}
|
|
277
|
+
const reasoningEffort = options?.reasoningEffort ?? (options?.reasoningSummary ? "medium" : undefined);
|
|
276
278
|
if (model.reasoning) {
|
|
277
|
-
if (
|
|
278
|
-
const effort = options?.reasoningEffort ? model.thinkingLevelMap?.[options.reasoningEffort] ?? options.reasoningEffort :
|
|
279
|
+
if (reasoningEffort) {
|
|
280
|
+
const effort = options?.reasoningEffort ? model.thinkingLevelMap?.[options.reasoningEffort] ?? options.reasoningEffort : reasoningEffort;
|
|
279
281
|
params.reasoning = {
|
|
280
282
|
effort,
|
|
281
283
|
summary: options?.reasoningSummary || "auto"
|
|
@@ -289,7 +291,10 @@ function buildParams(model, context, options, compat = getCompat(model), grammar
|
|
|
289
291
|
if (model.provider === "xai")
|
|
290
292
|
params.include = ["reasoning.encrypted_content"];
|
|
291
293
|
}
|
|
292
|
-
|
|
294
|
+
const samplingParams = resolveSamplingParams(model, reasoningEffort ?? "off", options?.samplingParams);
|
|
295
|
+
if (samplingParams) {
|
|
296
|
+
Object.assign(params, samplingParams);
|
|
297
|
+
}
|
|
293
298
|
return params;
|
|
294
299
|
}
|
|
295
300
|
function getServiceTierCostMultiplier(model, serviceTier) {
|
|
@@ -1,27 +1,30 @@
|
|
|
1
1
|
import {
|
|
2
|
+
OPENCODE_SSE_MAX_RETRY_ATTEMPTS,
|
|
2
3
|
OpencodeAdapter,
|
|
3
4
|
OpencodeSession,
|
|
4
5
|
_setOpenRouterModelCacheRefreshForTests,
|
|
5
6
|
applyOpenRouterBaseUrlOverride,
|
|
6
7
|
checkOpencodeCredentials,
|
|
7
8
|
resolveContextModePluginPath
|
|
8
|
-
} from "./cli-
|
|
9
|
-
import"./cli-r94z9p1z.js";
|
|
9
|
+
} from "./cli-twrh04ap.js";
|
|
10
10
|
import"./cli-gt4hxb8p.js";
|
|
11
|
-
import"./cli-5bfdm1ah.js";
|
|
12
|
-
import"./cli-tng3131n.js";
|
|
13
11
|
import"./cli-zm7njwzd.js";
|
|
14
|
-
import"./cli-
|
|
15
|
-
import"./cli-
|
|
12
|
+
import"./cli-wgbezhw2.js";
|
|
13
|
+
import"./cli-tre4bdgq.js";
|
|
14
|
+
import"./cli-tng3131n.js";
|
|
15
|
+
import"./cli-5bfdm1ah.js";
|
|
16
|
+
import"./cli-2hhfhfq5.js";
|
|
16
17
|
import"./cli-re8z5p8p.js";
|
|
17
18
|
import"./cli-3dpj7atn.js";
|
|
18
|
-
import"./cli-
|
|
19
|
+
import"./cli-xk79303e.js";
|
|
19
20
|
import"./cli-ywybs5as.js";
|
|
21
|
+
import"./cli-f9w1semm.js";
|
|
20
22
|
import"./cli-ej6gbxfb.js";
|
|
21
|
-
import"./cli-
|
|
22
|
-
import"./cli-
|
|
23
|
+
import"./cli-jyy6pm2f.js";
|
|
24
|
+
import"./cli-nexqx4ve.js";
|
|
23
25
|
import"./cli-bc05qbss.js";
|
|
24
26
|
export {
|
|
27
|
+
OPENCODE_SSE_MAX_RETRY_ATTEMPTS,
|
|
25
28
|
OpencodeAdapter,
|
|
26
29
|
OpencodeSession,
|
|
27
30
|
_setOpenRouterModelCacheRefreshForTests,
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import {
|
|
2
2
|
require_dist
|
|
3
3
|
} from "./cli-7nxes1hs.js";
|
|
4
|
+
import {
|
|
5
|
+
exports_supports_color,
|
|
6
|
+
init_supports_color
|
|
7
|
+
} from "./cli-bd957dgb.js";
|
|
4
8
|
import {
|
|
5
9
|
init_package,
|
|
6
10
|
package_default
|
|
7
|
-
} from "./cli-
|
|
11
|
+
} from "./cli-sqvfa090.js";
|
|
8
12
|
import {
|
|
9
13
|
init_secret_scrubber,
|
|
10
14
|
scrubSecrets
|
|
11
|
-
} from "./cli-
|
|
12
|
-
import {
|
|
13
|
-
exports_supports_color,
|
|
14
|
-
init_supports_color
|
|
15
|
-
} from "./cli-bd957dgb.js";
|
|
15
|
+
} from "./cli-nexqx4ve.js";
|
|
16
16
|
import {
|
|
17
17
|
require_src
|
|
18
18
|
} from "./cli-knd276ed.js";
|
|
@@ -1,6 +1,16 @@
|
|
|
1
1
|
import {
|
|
2
2
|
readPkgVersion
|
|
3
3
|
} from "./cli-gt4hxb8p.js";
|
|
4
|
+
import {
|
|
5
|
+
summarizeSession
|
|
6
|
+
} from "./cli-4dcpaefp.js";
|
|
7
|
+
import {
|
|
8
|
+
checkToolLoop,
|
|
9
|
+
clearToolHistory
|
|
10
|
+
} from "./cli-hp1n6zq3.js";
|
|
11
|
+
import {
|
|
12
|
+
fetchInstalledMcpServers
|
|
13
|
+
} from "./cli-tng3131n.js";
|
|
4
14
|
import {
|
|
5
15
|
DefaultResourceLoader,
|
|
6
16
|
ModelRuntime,
|
|
@@ -10,82 +20,82 @@ import {
|
|
|
10
20
|
createCodemodeExtension,
|
|
11
21
|
createMcpExtension,
|
|
12
22
|
createToolSearchExtension
|
|
13
|
-
} from "./cli-
|
|
14
|
-
import"./cli-
|
|
15
|
-
import"./cli-
|
|
16
|
-
import"./cli-
|
|
23
|
+
} from "./cli-7tre70zp.js";
|
|
24
|
+
import"./cli-hmsw1gpy.js";
|
|
25
|
+
import"./cli-4cwxn7gp.js";
|
|
26
|
+
import"./cli-8ev9xqnx.js";
|
|
27
|
+
import"./cli-p0r8sxj5.js";
|
|
28
|
+
import"./cli-bsky8g7w.js";
|
|
17
29
|
import {
|
|
18
30
|
getAgentDir,
|
|
19
31
|
setEmbeddedQuickJSWasmPath
|
|
20
|
-
} from "./cli-
|
|
32
|
+
} from "./cli-s3hwpt9v.js";
|
|
21
33
|
import"./cli-5bfdm1ah.js";
|
|
22
34
|
import"./cli-0m7wct0d.js";
|
|
23
|
-
import {
|
|
24
|
-
summarizeSession
|
|
25
|
-
} from "./cli-xjcywfsf.js";
|
|
26
|
-
import {
|
|
27
|
-
checkToolLoop,
|
|
28
|
-
clearToolHistory
|
|
29
|
-
} from "./cli-hp1n6zq3.js";
|
|
30
|
-
import {
|
|
31
|
-
fetchInstalledMcpServers
|
|
32
|
-
} from "./cli-tng3131n.js";
|
|
33
35
|
import {
|
|
34
36
|
applyReasoningEffort
|
|
35
|
-
} from "./cli-
|
|
37
|
+
} from "./cli-2hhfhfq5.js";
|
|
36
38
|
import"./cli-7nxes1hs.js";
|
|
37
39
|
import {
|
|
38
40
|
buildRatingsFromLlm,
|
|
39
41
|
fetchRetrievalsForTask,
|
|
40
42
|
getMemoryRaterNames,
|
|
41
43
|
postRatings
|
|
42
|
-
} from "./cli-
|
|
44
|
+
} from "./cli-w0bwte75.js";
|
|
43
45
|
import {
|
|
44
46
|
swarmRuntimeInstanceId
|
|
45
47
|
} from "./cli-re8z5p8p.js";
|
|
46
48
|
import {
|
|
47
49
|
McpHttpClient
|
|
48
50
|
} from "./cli-epan13p1.js";
|
|
49
|
-
import"./cli-
|
|
50
|
-
import"./cli-
|
|
51
|
+
import"./cli-5bcd7sfy.js";
|
|
52
|
+
import"./cli-yy6dew39.js";
|
|
51
53
|
import {
|
|
52
54
|
DEFAULT_OPENROUTER_BASE_URL,
|
|
53
55
|
getOpenRouterBaseUrl
|
|
54
56
|
} from "./cli-3dpj7atn.js";
|
|
57
|
+
import"./cli-2x0e561b.js";
|
|
55
58
|
import {
|
|
56
59
|
getBuiltinModel,
|
|
57
60
|
getBuiltinModels
|
|
58
|
-
} from "./cli-
|
|
61
|
+
} from "./cli-nt8hecg9.js";
|
|
59
62
|
import {
|
|
60
63
|
exports_typebox
|
|
61
64
|
} from "./cli-rb9m6rpe.js";
|
|
62
|
-
import"./cli-rykfmgwg.js";
|
|
63
65
|
import"./cli-bsakbbkm.js";
|
|
64
66
|
import"./cli-trc24wk2.js";
|
|
65
67
|
import"./cli-3er6gcsn.js";
|
|
68
|
+
import"./cli-0xqde53b.js";
|
|
69
|
+
import"./cli-pqetb83f.js";
|
|
70
|
+
import"./cli-13hw4z91.js";
|
|
71
|
+
import"./cli-ykk5jaax.js";
|
|
72
|
+
import"./cli-btbzvq95.js";
|
|
73
|
+
import"./cli-1m2e086m.js";
|
|
74
|
+
import"./cli-bzr0ftht.js";
|
|
66
75
|
import {
|
|
67
76
|
CORE_TOOLS,
|
|
68
77
|
init_tool_config
|
|
69
78
|
} from "./cli-3qhyh31j.js";
|
|
79
|
+
import {
|
|
80
|
+
init_templates
|
|
81
|
+
} from "./cli-qrgt5bqf.js";
|
|
82
|
+
import {
|
|
83
|
+
init_resolver,
|
|
84
|
+
resolveTemplateAsync
|
|
85
|
+
} from "./cli-qjjvzwzd.js";
|
|
70
86
|
import"./cli-1a2j50m0.js";
|
|
87
|
+
import"./cli-f9w1semm.js";
|
|
71
88
|
import {
|
|
72
89
|
init_env_flag,
|
|
73
90
|
parseEnvFlag
|
|
74
91
|
} from "./cli-ej6gbxfb.js";
|
|
75
|
-
import"./cli-
|
|
92
|
+
import"./cli-jyy6pm2f.js";
|
|
76
93
|
import"./cli-sd0mxa3c.js";
|
|
77
94
|
import"./cli-w5e1d1vv.js";
|
|
78
95
|
import {
|
|
79
96
|
init_secret_scrubber,
|
|
80
97
|
scrubSecrets
|
|
81
|
-
} from "./cli-
|
|
82
|
-
import"./cli-0xqde53b.js";
|
|
83
|
-
import"./cli-pqetb83f.js";
|
|
84
|
-
import"./cli-13hw4z91.js";
|
|
85
|
-
import"./cli-btbzvq95.js";
|
|
86
|
-
import"./cli-1m2e086m.js";
|
|
87
|
-
import"./cli-ykk5jaax.js";
|
|
88
|
-
import"./cli-bzr0ftht.js";
|
|
98
|
+
} from "./cli-nexqx4ve.js";
|
|
89
99
|
import {
|
|
90
100
|
__require,
|
|
91
101
|
__toESM
|
|
@@ -102,6 +112,8 @@ var quickjs_default = "./quickjs-r1pq2107.wasm";
|
|
|
102
112
|
setEmbeddedQuickJSWasmPath(quickjs_default);
|
|
103
113
|
|
|
104
114
|
// src/providers/pi-mono-adapter.ts
|
|
115
|
+
init_templates();
|
|
116
|
+
init_resolver();
|
|
105
117
|
init_tool_config();
|
|
106
118
|
|
|
107
119
|
// src/utils/aws-error-classifier.ts
|
|
@@ -412,7 +424,7 @@ async function summarizeSessionForPi(config, sessionFile, deps = {}) {
|
|
|
412
424
|
return;
|
|
413
425
|
}
|
|
414
426
|
if (wantRatings && result.ratings && result.ratings.length > 0) {
|
|
415
|
-
const ratingEvents = _buildRatings(result.ratings, retrievals);
|
|
427
|
+
const ratingEvents = _buildRatings(result.ratings, retrievals, result.model);
|
|
416
428
|
if (ratingEvents.length > 0) {
|
|
417
429
|
await _postRatings({
|
|
418
430
|
apiUrl: config.apiUrl,
|
|
@@ -743,6 +755,9 @@ function isPiToolDeferralEnabled(env = process.env) {
|
|
|
743
755
|
function isPiCodemodeEnabled(env = process.env) {
|
|
744
756
|
return parseEnvFlag(env.PI_CODEMODE, false);
|
|
745
757
|
}
|
|
758
|
+
function isPiCodemodeModelsEnabled(env = process.env) {
|
|
759
|
+
return isPiCodemodeEnabled(env) && parseEnvFlag(env.PI_CODEMODE_MODELS, false);
|
|
760
|
+
}
|
|
746
761
|
function isCoreSwarmTool(tool) {
|
|
747
762
|
return CORE_TOOLS.has(tool.name) || tool._meta?.["anthropic/alwaysLoad"] === true;
|
|
748
763
|
}
|
|
@@ -968,6 +983,23 @@ function extractPiAssistantText(message) {
|
|
|
968
983
|
return "";
|
|
969
984
|
return extractTextContent(msg.content);
|
|
970
985
|
}
|
|
986
|
+
function safeLabel(value) {
|
|
987
|
+
return typeof value === "string" && /^[A-Za-z0-9_-]{1,32}$/.test(value) ? value : "other";
|
|
988
|
+
}
|
|
989
|
+
function describeAssistantTurn(message) {
|
|
990
|
+
const msg = message ?? {};
|
|
991
|
+
const blocks = Array.isArray(msg.content) ? msg.content : [];
|
|
992
|
+
const blockTypes = blocks.map((b) => safeLabel(b?.type));
|
|
993
|
+
const output = msg.usage?.output;
|
|
994
|
+
return {
|
|
995
|
+
stopReason: typeof msg.stopReason === "string" ? safeLabel(msg.stopReason) : undefined,
|
|
996
|
+
blockTypes: typeof msg.content === "string" && msg.content.trim() ? ["text"] : blockTypes,
|
|
997
|
+
outputTokens: typeof output === "number" ? output : undefined,
|
|
998
|
+
hasText: extractTextContent(msg.content) !== "",
|
|
999
|
+
hasToolCall: blockTypes.includes("toolCall")
|
|
1000
|
+
};
|
|
1001
|
+
}
|
|
1002
|
+
var TERMINAL_STORE_PROGRESS_STATUSES = new Set(["completed", "failed"]);
|
|
971
1003
|
|
|
972
1004
|
class PiMonoSession {
|
|
973
1005
|
listeners = [];
|
|
@@ -985,6 +1017,11 @@ class PiMonoSession {
|
|
|
985
1017
|
terminalError = null;
|
|
986
1018
|
appliedReasoningEffort;
|
|
987
1019
|
sessionEnded = false;
|
|
1020
|
+
lastAssistantTurn = null;
|
|
1021
|
+
pendingTerminalStoreProgress = new Set;
|
|
1022
|
+
terminalStoreProgressDone = false;
|
|
1023
|
+
emptyTurnReprompted = false;
|
|
1024
|
+
abortRequested = false;
|
|
988
1025
|
constructor(agentSession, config, createdSymlink, appliedReasoningEffort = null) {
|
|
989
1026
|
this.agentSession = agentSession;
|
|
990
1027
|
this.config = config;
|
|
@@ -1027,11 +1064,21 @@ class PiMonoSession {
|
|
|
1027
1064
|
case "message_end": {
|
|
1028
1065
|
const endMsg = event.message;
|
|
1029
1066
|
if (endMsg.role === "assistant") {
|
|
1067
|
+
const turn = describeAssistantTurn(event.message);
|
|
1068
|
+
this.lastAssistantTurn = turn;
|
|
1030
1069
|
if (endMsg.stopReason === "error") {
|
|
1031
1070
|
this.terminalError = endMsg.errorMessage ?? this.terminalError ?? "Unknown error";
|
|
1032
1071
|
break;
|
|
1033
1072
|
}
|
|
1034
1073
|
this.terminalError = null;
|
|
1074
|
+
if (!turn.hasText && !turn.hasToolCall) {
|
|
1075
|
+
const tokens = turn.outputTokens === undefined ? "" : `, outputTokens=${turn.outputTokens}`;
|
|
1076
|
+
this.emit({
|
|
1077
|
+
type: "raw_stderr",
|
|
1078
|
+
content: `[pi-mono] assistant turn ended with no text and no tool call (stopReason=${turn.stopReason ?? "none"}, content=[${turn.blockTypes.join(",")}]${tokens})
|
|
1079
|
+
`
|
|
1080
|
+
});
|
|
1081
|
+
}
|
|
1035
1082
|
}
|
|
1036
1083
|
const text = extractPiAssistantText(event.message);
|
|
1037
1084
|
if (text) {
|
|
@@ -1071,6 +1118,10 @@ class PiMonoSession {
|
|
|
1071
1118
|
break;
|
|
1072
1119
|
}
|
|
1073
1120
|
case "tool_execution_start": {
|
|
1121
|
+
const status = event.args?.status;
|
|
1122
|
+
if (event.toolName.endsWith("store-progress") && typeof status === "string" && TERMINAL_STORE_PROGRESS_STATUSES.has(status)) {
|
|
1123
|
+
this.pendingTerminalStoreProgress.add(event.toolCallId);
|
|
1124
|
+
}
|
|
1074
1125
|
const model = this.reportedModel();
|
|
1075
1126
|
this.emit({
|
|
1076
1127
|
type: "raw_log",
|
|
@@ -1094,6 +1145,9 @@ class PiMonoSession {
|
|
|
1094
1145
|
break;
|
|
1095
1146
|
}
|
|
1096
1147
|
case "tool_execution_end":
|
|
1148
|
+
if (this.pendingTerminalStoreProgress.delete(event.toolCallId) && !event.isError) {
|
|
1149
|
+
this.terminalStoreProgressDone = true;
|
|
1150
|
+
}
|
|
1097
1151
|
this.emit({
|
|
1098
1152
|
type: "raw_log",
|
|
1099
1153
|
content: JSON.stringify({
|
|
@@ -1133,6 +1187,7 @@ class PiMonoSession {
|
|
|
1133
1187
|
source: "rpc"
|
|
1134
1188
|
});
|
|
1135
1189
|
await this.waitForIdle();
|
|
1190
|
+
await this.repromptAfterEmptyFinalTurn();
|
|
1136
1191
|
const stats = this.agentSession.getSessionStats();
|
|
1137
1192
|
const cost = this.buildCostData(stats);
|
|
1138
1193
|
if (this.terminalError) {
|
|
@@ -1192,6 +1247,36 @@ class PiMonoSession {
|
|
|
1192
1247
|
this.agentSession.dispose();
|
|
1193
1248
|
}
|
|
1194
1249
|
}
|
|
1250
|
+
async repromptAfterEmptyFinalTurn() {
|
|
1251
|
+
if (this.emptyTurnReprompted || !this.finalTurnNeedsReprompt())
|
|
1252
|
+
return;
|
|
1253
|
+
this.emptyTurnReprompted = true;
|
|
1254
|
+
try {
|
|
1255
|
+
const reprompt = await resolveTemplateAsync("task.nudge.empty_final_turn", {});
|
|
1256
|
+
if (reprompt.skipped || !reprompt.text.trim())
|
|
1257
|
+
return;
|
|
1258
|
+
if (!this.finalTurnNeedsReprompt())
|
|
1259
|
+
return;
|
|
1260
|
+
this.emit({
|
|
1261
|
+
type: "raw_stderr",
|
|
1262
|
+
content: `[pi-mono] final turn had no text and no tool call; sending one reprompt
|
|
1263
|
+
`
|
|
1264
|
+
});
|
|
1265
|
+
await this.agentSession.prompt(reprompt.text, { source: "rpc" });
|
|
1266
|
+
await this.waitForIdle();
|
|
1267
|
+
} catch (err) {
|
|
1268
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
1269
|
+
this.emit({
|
|
1270
|
+
type: "raw_stderr",
|
|
1271
|
+
content: `[pi-mono] empty-turn reprompt failed: ${message}
|
|
1272
|
+
`
|
|
1273
|
+
});
|
|
1274
|
+
}
|
|
1275
|
+
}
|
|
1276
|
+
finalTurnNeedsReprompt() {
|
|
1277
|
+
const turn = this.lastAssistantTurn;
|
|
1278
|
+
return !(this.abortRequested || this.terminalError || this.terminalStoreProgressDone || !turn || turn.hasText || turn.hasToolCall || turn.stopReason === "aborted");
|
|
1279
|
+
}
|
|
1195
1280
|
waitForIdle() {
|
|
1196
1281
|
return new Promise((resolve) => {
|
|
1197
1282
|
if (!this.agentSession.isStreaming) {
|
|
@@ -1237,6 +1322,7 @@ class PiMonoSession {
|
|
|
1237
1322
|
return this.completionPromise;
|
|
1238
1323
|
}
|
|
1239
1324
|
async abort() {
|
|
1325
|
+
this.abortRequested = true;
|
|
1240
1326
|
await this.agentSession.abort();
|
|
1241
1327
|
}
|
|
1242
1328
|
async deliverSteering({ mode, text }) {
|
|
@@ -1265,8 +1351,11 @@ function piExtensionFactories(swarmExtension, features) {
|
|
|
1265
1351
|
factories.push(createToolSearchExtension());
|
|
1266
1352
|
if (features.installedMcp)
|
|
1267
1353
|
factories.push(createSwarmMcpExtension());
|
|
1268
|
-
if (features.codemode)
|
|
1269
|
-
factories.push(createBoundedCodemodeExtension(
|
|
1354
|
+
if (features.codemode) {
|
|
1355
|
+
factories.push(createBoundedCodemodeExtension(DEFAULT_CODEMODE_LIMITS, {
|
|
1356
|
+
models: features.codemodeModels === true
|
|
1357
|
+
}));
|
|
1358
|
+
}
|
|
1270
1359
|
return factories;
|
|
1271
1360
|
}
|
|
1272
1361
|
var PI_CODEMODE_TIMEOUT_MS = 120000;
|
|
@@ -1277,8 +1366,8 @@ var DEFAULT_CODEMODE_LIMITS = {
|
|
|
1277
1366
|
maxNestedCalls: PI_CODEMODE_MAX_NESTED_CALLS,
|
|
1278
1367
|
maxConcurrentCalls: PI_CODEMODE_MAX_CONCURRENT_CALLS
|
|
1279
1368
|
};
|
|
1280
|
-
function createBoundedCodemodeExtension(limits = DEFAULT_CODEMODE_LIMITS) {
|
|
1281
|
-
const codemode = createCodemodeExtension({ mode: "on", models:
|
|
1369
|
+
function createBoundedCodemodeExtension(limits = DEFAULT_CODEMODE_LIMITS, options = {}) {
|
|
1370
|
+
const codemode = createCodemodeExtension({ mode: "on", models: options.models === true });
|
|
1282
1371
|
return (pi) => codemode(new Proxy(pi, {
|
|
1283
1372
|
get(target, prop) {
|
|
1284
1373
|
if (prop === "registerTool") {
|
|
@@ -1471,10 +1560,11 @@ class PiMonoAdapter {
|
|
|
1471
1560
|
const features = {
|
|
1472
1561
|
toolDeferral: deferTools,
|
|
1473
1562
|
installedMcp: Object.keys(piMcpServers).length > 0,
|
|
1474
|
-
codemode: isPiCodemodeEnabled()
|
|
1563
|
+
codemode: isPiCodemodeEnabled(),
|
|
1564
|
+
codemodeModels: isPiCodemodeModelsEnabled()
|
|
1475
1565
|
};
|
|
1476
1566
|
if (features.codemode) {
|
|
1477
|
-
console.log(`\x1B[2m[${config.role}]\x1B[0m codemode on`);
|
|
1567
|
+
console.log(`\x1B[2m[${config.role}]\x1B[0m codemode on${features.codemodeModels ? " (models)" : ""}`);
|
|
1478
1568
|
}
|
|
1479
1569
|
const { resourceLoader, settingsManager } = await createPiResourceLoader({
|
|
1480
1570
|
cwd: config.cwd,
|
|
@@ -1532,6 +1622,7 @@ export {
|
|
|
1532
1622
|
extractPiAssistantText,
|
|
1533
1623
|
isCoreSwarmTool,
|
|
1534
1624
|
isPiCodemodeEnabled,
|
|
1625
|
+
isPiCodemodeModelsEnabled,
|
|
1535
1626
|
isPiToolDeferralEnabled,
|
|
1536
1627
|
mcpToolsToDefinitions,
|
|
1537
1628
|
piDefaultToolAdditions,
|
|
@@ -7,24 +7,27 @@ import {
|
|
|
7
7
|
requestModelCatalogRefresh,
|
|
8
8
|
resetModelCatalogRefreshGuardForTests,
|
|
9
9
|
startPricingRefreshLoop
|
|
10
|
-
} from "./cli-
|
|
11
|
-
import"./cli-
|
|
12
|
-
import"./cli-
|
|
10
|
+
} from "./cli-zvhd3f64.js";
|
|
11
|
+
import"./cli-vy3ed88x.js";
|
|
12
|
+
import"./cli-jf7wmv1r.js";
|
|
13
|
+
import"./cli-xqpk3rp7.js";
|
|
13
14
|
import"./cli-3qhyh31j.js";
|
|
14
|
-
import"./cli-
|
|
15
|
-
import"./cli-r1mxd1xh.js";
|
|
15
|
+
import"./cli-7af8yhav.js";
|
|
16
16
|
import"./cli-n7h1kqpf.js";
|
|
17
|
-
import"./cli-
|
|
18
|
-
import"./cli-
|
|
19
|
-
import"./cli-1a2j50m0.js";
|
|
20
|
-
import"./cli-0wgxmwf6.js";
|
|
17
|
+
import"./cli-eg0b3p0k.js";
|
|
18
|
+
import"./cli-xk79303e.js";
|
|
21
19
|
import"./cli-ywybs5as.js";
|
|
20
|
+
import"./cli-gd4favx9.js";
|
|
21
|
+
import"./cli-qrgt5bqf.js";
|
|
22
|
+
import"./cli-qjjvzwzd.js";
|
|
23
|
+
import"./cli-1a2j50m0.js";
|
|
24
|
+
import"./cli-f9w1semm.js";
|
|
22
25
|
import"./cli-ej6gbxfb.js";
|
|
23
|
-
import"./cli-
|
|
26
|
+
import"./cli-jyy6pm2f.js";
|
|
24
27
|
import"./cli-sd0mxa3c.js";
|
|
25
28
|
import"./cli-w5e1d1vv.js";
|
|
26
|
-
import"./cli-
|
|
27
|
-
import"./cli-
|
|
29
|
+
import"./cli-sqvfa090.js";
|
|
30
|
+
import"./cli-nexqx4ve.js";
|
|
28
31
|
import"./cli-zf8jjwex.js";
|
|
29
32
|
import"./cli-bc05qbss.js";
|
|
30
33
|
export {
|