@desplega.ai/agent-swarm 1.113.0 → 1.115.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 +2 -2
- package/dist/{actions-q4n7cz6e.js → actions-17ya5wde.js} +8 -9
- package/dist/{app-es4nzc71.js → app-4f718yk0.js} +6 -6
- package/dist/{assistant-0x8ey0vs.js → assistant-ah7csnjz.js} +19 -18
- package/dist/{boot-reembed-69agkhv6.js → boot-reembed-4jpxhb25.js} +6 -6
- package/dist/{boot-reembed-p0ny05t8.js → boot-reembed-qata34xa.js} +5 -5
- package/dist/{boot-scrub-logs-yybrkmvr.js → boot-scrub-logs-tv48nn3z.js} +4 -4
- package/dist/{claude-adapter-mma9a1yr.js → claude-adapter-3csn5bks.js} +3 -3
- package/dist/{claude-managed-adapter-pv2nbqy4.js → claude-managed-adapter-kysmkz89.js} +2 -2
- package/dist/cli-0pygq9r1.js +429 -0
- package/dist/{cli-hsetkkd3.js → cli-12vb0xg6.js} +33 -9
- package/dist/{cli-ncfgsqbd.js → cli-15y7qhzp.js} +262 -33
- package/dist/{cli-7ga43spr.js → cli-1yjrbg1f.js} +1 -1
- package/dist/{cli-36ymmpmp.js → cli-3samkyap.js} +2 -2
- package/dist/cli-52fg7s7x.js +269 -0
- package/dist/{cli-hjhvekf4.js → cli-65ekje01.js} +11 -8
- package/dist/{cli-h3k622d0.js → cli-6aq8xhvm.js} +90 -3
- package/dist/{cli-f3qa069v.js → cli-7xje5amz.js} +1 -1
- package/dist/cli-86fdnerz.js +405 -0
- package/dist/{cli-9cy6nc5m.js → cli-8fjwym53.js} +1 -1
- package/dist/{cli-c3frqf65.js → cli-b23axgz4.js} +3 -3
- package/dist/{cli-a0t7vapf.js → cli-bc89my0z.js} +1 -1
- package/dist/{cli-bnzbn8j8.js → cli-beea4a3y.js} +73 -24
- package/dist/{cli-q21d49ac.js → cli-bw80ck94.js} +1 -1
- package/dist/{cli-pwc5e83c.js → cli-cchksf5q.js} +12 -7
- package/dist/{cli-30bbaveh.js → cli-cmw9rzy5.js} +2 -2
- package/dist/{cli-y6mrptcn.js → cli-cnwssmsr.js} +1 -1
- package/dist/{cli-r5g6ngtn.js → cli-dcca6j8m.js} +46 -5
- package/dist/{cli-tkmm5nf9.js → cli-e61fs2hp.js} +59 -2
- package/dist/{cli-6wscj9z0.js → cli-e7306swv.js} +14 -14
- package/dist/{cli-dcfyyh3t.js → cli-ftyf58xj.js} +2 -2
- package/dist/{cli-4xyj9jtq.js → cli-hrhye2rm.js} +1062 -478
- package/dist/cli-jkhwmmgg.js +136 -0
- package/dist/{cli-y4ycrnjc.js → cli-k3y4z3h5.js} +1 -1
- package/dist/{cli-6xd0bvf8.js → cli-ma04faw5.js} +1 -1
- package/dist/{cli-2fc97xm5.js → cli-mnbgv3w7.js} +4 -4
- package/dist/{cli-trmapn9k.js → cli-pet3aev6.js} +95 -10
- package/dist/{cli-z46pnksz.js → cli-q1rx7g0d.js} +175 -28
- package/dist/{cli-qwgtacd6.js → cli-r9f6ngrf.js} +1244 -336
- package/dist/{cli-gtkqc144.js → cli-shvaxw27.js} +13 -7
- package/dist/{cli-ywez6yps.js → cli-sq7f72d6.js} +1 -1
- package/dist/cli-t0vqevnm.js +393 -0
- package/dist/{cli-tbw13sx8.js → cli-tece6zgm.js} +1 -1
- package/dist/{cli-bgvskydy.js → cli-tffvrh6j.js} +1 -1
- package/dist/cli-wh91zby6.js +187222 -0
- package/dist/{cli-anrj584m.js → cli-xz9aq0rf.js} +1 -1
- package/dist/{cli-mq580e06.js → cli-zsrdty74.js} +18 -18
- package/dist/cli.js +32 -15
- package/dist/{codex-adapter-5cmy858w.js → codex-adapter-de3w0nch.js} +10 -10
- package/dist/{codex-session-runner-46q8mrba.js → codex-session-runner-bnw8cysk.js} +10 -10
- package/dist/{commands-z5dbwta3.js → commands-hch4e2k1.js} +4 -4
- package/dist/{db-bbgahh4z.js → db-p3h2j06x.js} +14 -4
- package/dist/{handlers-6b44317z.js → handlers-9er4zx9q.js} +17 -31
- package/dist/{hook-sbp5fmps.js → hook-4axs756z.js} +7 -7
- package/dist/{http-2xz43gz3.js → http-809fvtz2.js} +1934 -886
- package/dist/{index-wz1ea15p.js → index-2dgfj9av.js} +3 -3
- package/dist/{index-nhat35em.js → index-47em3d2n.js} +14 -11
- package/dist/{index-5ghxn8s6.js → index-9fqaktjr.js} +12 -9
- package/dist/{index-0gzmqj4k.js → index-9ht8gr56.js} +13 -10
- package/dist/{index-vfedgdw6.js → index-rm85cfdx.js} +368 -40
- package/dist/{index-ykvs43z4.js → index-t2snazez.js} +4 -4
- package/dist/{keepalive-62gfj91d.js → keepalive-3cps6e3e.js} +7 -6
- package/dist/{lead-ag0akn0v.js → lead-fkk95wgq.js} +36 -32
- package/dist/{maintenance-xxrrzk5x.js → maintenance-fweqh0yj.js} +6 -6
- package/dist/{mistral-conversations-26yrnbf1.js → mistral-conversations-7gqnz2wt.js} +7 -7
- package/dist/oauth-refresh-sweep-sycqtbph.js +114 -0
- package/dist/{onboard-64zyfcbs.js → onboard-cy0rkgvx.js} +2 -2
- package/dist/{opencode-adapter-mqsxr170.js → opencode-adapter-p6bxnbm4.js} +2 -2
- package/dist/{otel-zjd9zaxs.js → otel-g299k41b.js} +2 -2
- package/dist/{otel-impl-b86qseaa.js → otel-impl-wbns8hf7.js} +1 -1
- package/dist/{pi-mono-adapter-kxjxpfgy.js → pi-mono-adapter-05sck1ds.js} +17 -109
- package/dist/{pricing-refresh-cgtkffpa.js → pricing-refresh-0hvazmkf.js} +6 -6
- package/dist/rbac-roles-kfesjy9y.js +28 -0
- package/dist/rbac-roles-mwcwhbxc.js +283 -0
- package/dist/{seed-pricing-1r1y1xkq.js → seed-pricing-h2kdq4cq.js} +5 -5
- package/dist/{setup-mkcgkjf7.js → setup-8506q97w.js} +2 -2
- package/dist/{worker-351sze63.js → worker-4r5c6zyb.js} +36 -32
- package/openapi.json +1327 -20
- package/package.json +3 -3
- package/src/agentmail/handlers.ts +16 -6
- package/src/agentmail/templates.ts +25 -5
- package/src/be/audit-user.ts +28 -4
- package/src/be/db-queries/oauth.ts +42 -0
- package/src/be/db.ts +314 -28
- package/src/be/identity.ts +79 -0
- package/src/be/mcp-proxy.ts +132 -0
- package/src/be/migrations/109_rbac_roles.sql +79 -0
- package/src/be/migrations/111_oauth_credential_bindings.sql +6 -0
- package/src/be/migrations/112_script_connections_graphql.sql +96 -0
- package/src/be/migrations/113_task_routing_affinity.sql +9 -0
- package/src/be/migrations/114_backfill_gpt_5_6_pricing.sql +15 -0
- package/src/be/modelsdev-cache.json +135 -0
- package/src/be/oauth-credential-bindings.ts +35 -0
- package/src/be/oauth-refresh-sweep.ts +159 -0
- package/src/be/rbac-audit.ts +52 -13
- package/src/be/rbac-roles.ts +424 -0
- package/src/be/script-connections.ts +459 -40
- package/src/be/script-credential-broker.ts +29 -3
- package/src/be/scripts/typecheck.ts +51 -7
- package/src/be/seed-scripts/catalog/catalog-report.inline.ts +325 -24
- package/src/be/seed-scripts/catalog/catalog-report.ts +325 -24
- package/src/be/users.ts +24 -0
- package/src/cli.tsx +17 -0
- package/src/github/handlers.ts +10 -9
- package/src/github/templates.ts +45 -9
- package/src/gitlab/handlers.ts +20 -8
- package/src/gitlab/templates.ts +18 -6
- package/src/heartbeat/heartbeat.ts +143 -21
- package/src/http/all-routes.ts +3 -0
- package/src/http/approval-requests.ts +12 -0
- package/src/http/config.ts +44 -10
- package/src/http/core.ts +30 -3
- package/src/http/favorites.ts +1 -5
- package/src/http/index.ts +25 -1
- package/src/http/mcp-oauth.ts +2 -0
- package/src/http/mcp-servers.ts +44 -3
- package/src/http/oauth-generic.ts +105 -0
- package/src/http/poll.ts +20 -3
- package/src/http/script-connection-proxy.ts +116 -0
- package/src/http/script-connections.ts +1657 -0
- package/src/http/scripts.ts +27 -7
- package/src/http/skills.ts +11 -0
- package/src/http/tasks.ts +27 -13
- package/src/http/x.ts +6 -2
- package/src/integrations/kapso/inbound.ts +23 -6
- package/src/jira/sync.ts +111 -17
- package/src/jira/templates.ts +10 -2
- package/src/mcp-client/http-client.ts +194 -0
- package/src/oauth/app-validation.ts +16 -0
- package/src/oauth/ensure-token.ts +69 -14
- package/src/oauth/mcp-wrapper.ts +15 -0
- package/src/oauth/wrapper.ts +48 -20
- package/src/prompts/session-templates.ts +3 -3
- package/src/providers/codex-models.ts +100 -30
- package/src/providers/modelsdev-reasoning.json +51 -0
- package/src/providers/pi-mono-mcp-client.ts +2 -133
- package/src/providers/reasoning-effort.ts +11 -5
- package/src/rbac/admission.ts +68 -0
- package/src/rbac/index.ts +2 -0
- package/src/rbac/legacy-policy.ts +12 -0
- package/src/rbac/permissions.ts +48 -0
- package/src/scheduler/scheduler.ts +9 -1
- package/src/scripts-runtime/api-client.ts +151 -19
- package/src/scripts-runtime/api-types.ts +38 -6
- package/src/scripts-runtime/credential-broker/default-bindings.ts +1 -0
- package/src/scripts-runtime/credential-broker/types.ts +8 -0
- package/src/scripts-runtime/ctx.ts +11 -1
- package/src/scripts-runtime/eval-harness.ts +5 -1
- package/src/scripts-runtime/executors/types.ts +2 -1
- package/src/scripts-runtime/loader.ts +3 -1
- package/src/scripts-runtime/mcp-client.ts +87 -0
- package/src/scripts-runtime/sdk-allowlist.ts +1 -0
- package/src/scripts-runtime/types/stdlib.d.ts +6 -0
- package/src/scripts-runtime/types/swarm-sdk.d.ts +19 -0
- package/src/server-user.ts +114 -59
- package/src/server.ts +12 -0
- package/src/slack/assistant.ts +14 -6
- package/src/slack/enrich.ts +17 -0
- package/src/slack/handlers.ts +8 -22
- package/src/slack/responses.ts +91 -1
- package/src/slack/thread-buffer.ts +6 -3
- package/src/slack/watcher.ts +9 -6
- package/src/tasks/worker-follow-up.ts +100 -3
- package/src/tests/agentmail-handlers.test.ts +32 -3
- package/src/tests/approval-requests.test.ts +61 -0
- package/src/tests/audit-user.test.ts +47 -1
- package/src/tests/codex-adapter.test.ts +46 -23
- package/src/tests/credential-broker.test.ts +5 -2
- package/src/tests/delete-page-tool.test.ts +197 -0
- package/src/tests/github-handlers.test.ts +28 -2
- package/src/tests/gitlab-handlers.test.ts +125 -0
- package/src/tests/heartbeat.test.ts +48 -3
- package/src/tests/identity.test.ts +117 -0
- package/src/tests/jira-sync.test.ts +99 -1
- package/src/tests/kapso-inbound.test.ts +7 -0
- package/src/tests/mcp-tools-user.test.ts +60 -6
- package/src/tests/model-control.test.ts +8 -2
- package/src/tests/oauth-credential-bindings.test.ts +490 -0
- package/src/tests/oauth-refresh-sweep.test.ts +160 -0
- package/src/tests/pool-affinity.test.ts +401 -0
- package/src/tests/prompt-template-remaining.test.ts +2 -2
- package/src/tests/rbac-admission-e2e.test.ts +386 -0
- package/src/tests/rbac-admission.test.ts +492 -0
- package/src/tests/rbac-e2e-helpers.ts +3 -0
- package/src/tests/rbac-engine.test.ts +50 -0
- package/src/tests/rbac-mcp-admission-e2e.test.ts +362 -0
- package/src/tests/rbac-roles.test.ts +328 -0
- package/src/tests/reasoning-effort.test.ts +15 -2
- package/src/tests/schedule-target-type.test.ts +50 -0
- package/src/tests/scheduled-tasks.test.ts +40 -0
- package/src/tests/script-apis-mcp.test.ts +37 -13
- package/src/tests/script-connections-http.test.ts +1158 -0
- package/src/tests/script-connections-mcp.test.ts +894 -0
- package/src/tests/script-connections.test.ts +754 -6
- package/src/tests/scripts-external-api.test.ts +49 -1
- package/src/tests/scripts-runtime-secret-egress.test.ts +1 -0
- package/src/tests/scripts-runtime.test.ts +291 -0
- package/src/tests/seed-scripts.test.ts +36 -0
- package/src/tests/slack-identity-resolution.test.ts +37 -3
- package/src/tests/slack-inline-output.test.ts +65 -0
- package/src/tests/slack-thread-buffer.test.ts +28 -0
- package/src/tests/tool-annotations.test.ts +1 -0
- package/src/tests/user-token-rest-auth.test.ts +140 -1
- package/src/tests/workflow-swarm-script.test.ts +44 -0
- package/src/tests/workflow-triggers-v2.test.ts +300 -1
- package/src/tools/credential-bindings/tool.ts +277 -18
- package/src/tools/delete-page.ts +145 -0
- package/src/tools/mcp-servers/mcp-server-delete.ts +7 -4
- package/src/tools/request-human-input.ts +2 -0
- package/src/tools/resolve-user.ts +77 -27
- package/src/tools/script-apis.ts +62 -3
- package/src/tools/script-connections/tool.ts +275 -31
- package/src/tools/send-task.ts +15 -1
- package/src/tools/task-action.ts +34 -2
- package/src/tools/templates.ts +53 -1
- package/src/tools/tool-config.ts +2 -1
- package/src/tools/utils.ts +2 -0
- package/src/tools/workflows/create-workflow.ts +8 -1
- package/src/tools/workflows/update-workflow.ts +11 -2
- package/src/types.ts +90 -11
- package/src/utils/scoped-resource.ts +25 -0
- package/src/workflows/executors/human-in-the-loop.ts +1 -0
- package/src/workflows/executors/swarm-script.ts +7 -1
- package/src/workflows/triggers.ts +146 -18
- package/templates/skills/swarm-scripts/content.md +33 -8
- package/dist/cli-bgef578c.js +0 -771
- package/dist/cli-c9mtm09b.js +0 -43
- package/dist/cli-ceewqajw.js +0 -1698
- package/dist/{anthropic-messages-8nc6r2dw.js → anthropic-messages-kq3pjhbp.js} +6 -6
- package/dist/{azure-openai-responses-6yfzw3qw.js → azure-openai-responses-gm1ejtmn.js} +7 -7
- package/dist/{cli-vbraamxr.js → cli-6b4wwmm8.js} +9 -9
- package/dist/{cli-2r7s8jhp.js → cli-sznberje.js} +3 -3
- package/dist/{google-generative-ai-vfq6ymz9.js → google-generative-ai-hyrra2jm.js} +3 -3
- package/dist/{google-vertex-mj5y5rfj.js → google-vertex-8bs2pzgn.js} +3 -3
- package/dist/{openai-codex-responses-8h6kvfv8.js → openai-codex-responses-3nkvje79.js} +4 -4
- package/dist/{openai-completions-x6kjnqjd.js → openai-completions-0asftkwg.js} +11 -11
- package/dist/{openai-responses-7jwyz3ds.js → openai-responses-pmatek45.js} +10 -10
|
@@ -1,63 +1,67 @@
|
|
|
1
1
|
import {
|
|
2
2
|
runAgent
|
|
3
|
-
} from "./cli-
|
|
4
|
-
import"./cli-ceewqajw.js";
|
|
5
|
-
import"./cli-6wscj9z0.js";
|
|
6
|
-
import"./cli-2r7s8jhp.js";
|
|
7
|
-
import"./cli-07er7wrs.js";
|
|
8
|
-
import"./cli-yv9dttkh.js";
|
|
3
|
+
} from "./cli-zsrdty74.js";
|
|
9
4
|
import"./cli-tyfxrrdd.js";
|
|
10
|
-
import"./cli-
|
|
5
|
+
import"./cli-bc89my0z.js";
|
|
11
6
|
import"./cli-yazx6hap.js";
|
|
7
|
+
import"./cli-wh91zby6.js";
|
|
12
8
|
import"./cli-r94z9p1z.js";
|
|
13
|
-
import"./cli-
|
|
9
|
+
import"./cli-e7306swv.js";
|
|
14
10
|
import"./cli-hx1dcevq.js";
|
|
11
|
+
import"./cli-sznberje.js";
|
|
12
|
+
import"./cli-07er7wrs.js";
|
|
13
|
+
import"./cli-d6n0thxw.js";
|
|
14
|
+
import"./cli-yv9dttkh.js";
|
|
15
15
|
import {
|
|
16
16
|
getEnabledCapabilities
|
|
17
|
-
} from "./cli-
|
|
17
|
+
} from "./cli-hrhye2rm.js";
|
|
18
18
|
import"./cli-1z7048dy.js";
|
|
19
|
-
import"./cli-
|
|
19
|
+
import"./cli-ftyf58xj.js";
|
|
20
20
|
import"./cli-tk9vyqzh.js";
|
|
21
21
|
import"./cli-gz9sbyk3.js";
|
|
22
|
-
import"./cli-
|
|
23
|
-
import"./cli-psrqtw2m.js";
|
|
22
|
+
import"./cli-mnbgv3w7.js";
|
|
24
23
|
import"./cli-tng3131n.js";
|
|
24
|
+
import"./cli-psrqtw2m.js";
|
|
25
25
|
import"./cli-zm7njwzd.js";
|
|
26
26
|
import"./cli-tghre7g6.js";
|
|
27
|
-
import"./cli-
|
|
28
|
-
import"./cli-
|
|
29
|
-
import"./cli-
|
|
30
|
-
import"./cli-
|
|
31
|
-
import"./cli-
|
|
27
|
+
import"./cli-e61fs2hp.js";
|
|
28
|
+
import"./cli-3samkyap.js";
|
|
29
|
+
import"./cli-tece6zgm.js";
|
|
30
|
+
import"./cli-52fg7s7x.js";
|
|
31
|
+
import"./cli-86fdnerz.js";
|
|
32
|
+
import"./cli-dcca6j8m.js";
|
|
32
33
|
import"./cli-fad8m16k.js";
|
|
33
|
-
import"./cli-
|
|
34
|
-
import"./cli-
|
|
34
|
+
import"./cli-shvaxw27.js";
|
|
35
|
+
import"./cli-q1rx7g0d.js";
|
|
35
36
|
import"./cli-f14fvzag.js";
|
|
36
|
-
import"./cli-
|
|
37
|
-
import"./cli-
|
|
38
|
-
import"./cli-
|
|
37
|
+
import"./cli-r9f6ngrf.js";
|
|
38
|
+
import"./cli-jkhwmmgg.js";
|
|
39
|
+
import"./cli-cmw9rzy5.js";
|
|
40
|
+
import"./cli-7xje5amz.js";
|
|
39
41
|
import"./cli-q25ejbyn.js";
|
|
40
|
-
import"./cli-
|
|
41
|
-
import"./cli-
|
|
42
|
+
import"./cli-t0vqevnm.js";
|
|
43
|
+
import"./cli-0pygq9r1.js";
|
|
44
|
+
import"./cli-tffvrh6j.js";
|
|
45
|
+
import"./cli-pet3aev6.js";
|
|
42
46
|
import"./cli-rkndnn90.js";
|
|
43
47
|
import"./cli-b0p7rfnd.js";
|
|
44
|
-
import"./cli-
|
|
45
|
-
import"./cli-
|
|
48
|
+
import"./cli-6aq8xhvm.js";
|
|
49
|
+
import"./cli-ma04faw5.js";
|
|
46
50
|
import"./cli-wspgs9bt.js";
|
|
47
|
-
import"./cli-
|
|
51
|
+
import"./cli-k3y4z3h5.js";
|
|
48
52
|
import"./cli-dh55d5fg.js";
|
|
49
|
-
import"./cli-
|
|
53
|
+
import"./cli-15y7qhzp.js";
|
|
50
54
|
import"./cli-z2zcxes1.js";
|
|
51
|
-
import"./cli-
|
|
52
|
-
import"./cli-
|
|
53
|
-
import"./cli-
|
|
55
|
+
import"./cli-bw80ck94.js";
|
|
56
|
+
import"./cli-xz9aq0rf.js";
|
|
57
|
+
import"./cli-b23axgz4.js";
|
|
54
58
|
import"./cli-4j2mrzag.js";
|
|
55
59
|
import"./cli-e15jhafb.js";
|
|
56
60
|
import"./cli-9aryf9tv.js";
|
|
57
61
|
import"./cli-7zd05xb4.js";
|
|
58
62
|
import"./cli-xw7p4wkq.js";
|
|
59
|
-
import"./cli-4wgngmwv.js";
|
|
60
63
|
import"./cli-zyxs93y9.js";
|
|
64
|
+
import"./cli-4wgngmwv.js";
|
|
61
65
|
import"./cli-m6pzzhqr.js";
|
|
62
66
|
import"./cli-7wmybrt5.js";
|
|
63
67
|
import"./cli-p9swy5t3.js";
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
reembedAllScripts
|
|
3
|
-
} from "./cli-
|
|
4
|
-
import"./cli-
|
|
3
|
+
} from "./cli-cmw9rzy5.js";
|
|
4
|
+
import"./cli-7xje5amz.js";
|
|
5
5
|
import"./cli-q25ejbyn.js";
|
|
6
|
-
import"./cli-
|
|
6
|
+
import"./cli-15y7qhzp.js";
|
|
7
7
|
import"./cli-z2zcxes1.js";
|
|
8
|
-
import"./cli-
|
|
9
|
-
import"./cli-
|
|
10
|
-
import"./cli-
|
|
8
|
+
import"./cli-bw80ck94.js";
|
|
9
|
+
import"./cli-xz9aq0rf.js";
|
|
10
|
+
import"./cli-b23axgz4.js";
|
|
11
11
|
import"./cli-4j2mrzag.js";
|
|
12
12
|
import"./cli-p9swy5t3.js";
|
|
13
13
|
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import {
|
|
2
|
+
shortHash
|
|
3
|
+
} from "./cli-5m9j2spm.js";
|
|
1
4
|
import {
|
|
2
5
|
BuiltInConnectors$inboundSchema,
|
|
3
6
|
BuiltInConnectors$outboundSchema,
|
|
@@ -33,11 +36,8 @@ import {
|
|
|
33
36
|
safeParse,
|
|
34
37
|
smartUnion,
|
|
35
38
|
unwrapAsync
|
|
36
|
-
} from "./cli-
|
|
37
|
-
import
|
|
38
|
-
shortHash
|
|
39
|
-
} from "./cli-5m9j2spm.js";
|
|
40
|
-
import"./cli-ywez6yps.js";
|
|
39
|
+
} from "./cli-1yjrbg1f.js";
|
|
40
|
+
import"./cli-sq7f72d6.js";
|
|
41
41
|
import {
|
|
42
42
|
ZodFirstPartyTypeKind
|
|
43
43
|
} from "./cli-fad8m16k.js";
|
|
@@ -64,7 +64,7 @@ import {
|
|
|
64
64
|
record,
|
|
65
65
|
string,
|
|
66
66
|
union
|
|
67
|
-
} from "./cli-
|
|
67
|
+
} from "./cli-xz9aq0rf.js";
|
|
68
68
|
import {
|
|
69
69
|
parseStreamingJson
|
|
70
70
|
} from "./cli-zyxs93y9.js";
|
|
@@ -327,7 +327,7 @@ async function getObservabilityModule() {
|
|
|
327
327
|
return observabilityModule;
|
|
328
328
|
}
|
|
329
329
|
try {
|
|
330
|
-
observabilityModule = await import("./otel-
|
|
330
|
+
observabilityModule = await import("./otel-g299k41b.js");
|
|
331
331
|
} catch {
|
|
332
332
|
observabilityModule = null;
|
|
333
333
|
}
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import {
|
|
2
|
+
forceRefreshTokenOrThrow,
|
|
3
|
+
getOAuthTokens,
|
|
4
|
+
listOAuthTokenSweepRows
|
|
5
|
+
} from "./cli-t0vqevnm.js";
|
|
6
|
+
import"./cli-0pygq9r1.js";
|
|
7
|
+
import"./cli-15y7qhzp.js";
|
|
8
|
+
import"./cli-z2zcxes1.js";
|
|
9
|
+
import"./cli-bw80ck94.js";
|
|
10
|
+
import"./cli-xz9aq0rf.js";
|
|
11
|
+
import"./cli-b23axgz4.js";
|
|
12
|
+
import {
|
|
13
|
+
init_secret_scrubber,
|
|
14
|
+
scrubSecrets
|
|
15
|
+
} from "./cli-4j2mrzag.js";
|
|
16
|
+
import"./cli-p9swy5t3.js";
|
|
17
|
+
|
|
18
|
+
// src/be/oauth-refresh-sweep.ts
|
|
19
|
+
init_secret_scrubber();
|
|
20
|
+
var EXPIRY_BUFFER_MS = 30 * 60 * 1000;
|
|
21
|
+
var STALE_ROW_MS = 7 * 24 * 60 * 60 * 1000;
|
|
22
|
+
var SWEEP_INTERVAL_MS = 15 * 60 * 1000;
|
|
23
|
+
var SWEEP_STARTUP_DELAY_MS = 60 * 1000;
|
|
24
|
+
async function sweepOAuthTokenRefresh() {
|
|
25
|
+
let checked = 0;
|
|
26
|
+
let refreshed = 0;
|
|
27
|
+
let skipped = 0;
|
|
28
|
+
const failed = [];
|
|
29
|
+
for (const row of listOAuthTokenSweepRows()) {
|
|
30
|
+
checked++;
|
|
31
|
+
if (!row.hasApp || !row.hasRefreshToken) {
|
|
32
|
+
skipped++;
|
|
33
|
+
continue;
|
|
34
|
+
}
|
|
35
|
+
const now = Date.now();
|
|
36
|
+
const expiringSoon = new Date(row.expiresAt).getTime() - now < EXPIRY_BUFFER_MS;
|
|
37
|
+
const stale = now - new Date(row.updatedAt).getTime() > STALE_ROW_MS;
|
|
38
|
+
if (!expiringSoon && !stale) {
|
|
39
|
+
skipped++;
|
|
40
|
+
continue;
|
|
41
|
+
}
|
|
42
|
+
const before = getOAuthTokens(row.provider);
|
|
43
|
+
try {
|
|
44
|
+
await forceRefreshTokenOrThrow(row.provider);
|
|
45
|
+
const after = getOAuthTokens(row.provider);
|
|
46
|
+
const changed = after !== null && (before === null || before.accessToken !== after.accessToken || before.expiresAt !== after.expiresAt || before.updatedAt !== after.updatedAt);
|
|
47
|
+
if (changed) {
|
|
48
|
+
refreshed++;
|
|
49
|
+
} else {
|
|
50
|
+
skipped++;
|
|
51
|
+
}
|
|
52
|
+
} catch (err) {
|
|
53
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
54
|
+
failed.push(`${row.provider}: ${message}`);
|
|
55
|
+
console.warn(scrubSecrets(`[oauth-refresh-sweep] ${row.provider} refresh failed: ${message}`));
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
return { checked, refreshed, skipped, failed };
|
|
59
|
+
}
|
|
60
|
+
var sweepInterval = null;
|
|
61
|
+
var startupTimeout = null;
|
|
62
|
+
var inflightSweep = null;
|
|
63
|
+
async function runSweepTick(trigger) {
|
|
64
|
+
if (inflightSweep)
|
|
65
|
+
return inflightSweep;
|
|
66
|
+
inflightSweep = (async () => {
|
|
67
|
+
try {
|
|
68
|
+
const result = await sweepOAuthTokenRefresh();
|
|
69
|
+
if (result.refreshed > 0 || result.failed.length > 0) {
|
|
70
|
+
console.log(scrubSecrets(`[oauth-refresh-sweep] ${trigger}: checked=${result.checked} refreshed=${result.refreshed} skipped=${result.skipped} failed=${result.failed.length}${result.failed.length > 0 ? ` (${result.failed.join("; ")})` : ""}`));
|
|
71
|
+
}
|
|
72
|
+
} catch (err) {
|
|
73
|
+
console.error("[oauth-refresh-sweep] sweep tick failed:", err);
|
|
74
|
+
} finally {
|
|
75
|
+
inflightSweep = null;
|
|
76
|
+
}
|
|
77
|
+
})();
|
|
78
|
+
return inflightSweep;
|
|
79
|
+
}
|
|
80
|
+
function startOAuthRefreshSweep() {
|
|
81
|
+
if (process.env.OAUTH_REFRESH_SWEEP_DISABLE === "true") {
|
|
82
|
+
console.log("[oauth-refresh-sweep] Disabled via OAUTH_REFRESH_SWEEP_DISABLE");
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
85
|
+
if (sweepInterval || startupTimeout)
|
|
86
|
+
return;
|
|
87
|
+
console.log(`[oauth-refresh-sweep] Starting (interval ${Math.round(SWEEP_INTERVAL_MS / 60000)}min, first run in ${Math.round(SWEEP_STARTUP_DELAY_MS / 1000)}s)`);
|
|
88
|
+
startupTimeout = setTimeout(() => {
|
|
89
|
+
startupTimeout = null;
|
|
90
|
+
runSweepTick("startup");
|
|
91
|
+
}, SWEEP_STARTUP_DELAY_MS);
|
|
92
|
+
startupTimeout.unref?.();
|
|
93
|
+
sweepInterval = setInterval(() => {
|
|
94
|
+
runSweepTick("interval");
|
|
95
|
+
}, SWEEP_INTERVAL_MS);
|
|
96
|
+
sweepInterval.unref?.();
|
|
97
|
+
}
|
|
98
|
+
async function stopOAuthRefreshSweep() {
|
|
99
|
+
if (startupTimeout) {
|
|
100
|
+
clearTimeout(startupTimeout);
|
|
101
|
+
startupTimeout = null;
|
|
102
|
+
}
|
|
103
|
+
if (sweepInterval) {
|
|
104
|
+
clearInterval(sweepInterval);
|
|
105
|
+
sweepInterval = null;
|
|
106
|
+
}
|
|
107
|
+
if (inflightSweep)
|
|
108
|
+
await inflightSweep;
|
|
109
|
+
}
|
|
110
|
+
export {
|
|
111
|
+
sweepOAuthTokenRefresh,
|
|
112
|
+
stopOAuthRefreshSweep,
|
|
113
|
+
startOAuthRefreshSweep
|
|
114
|
+
};
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
createDefaultMcpJson,
|
|
4
4
|
createDefaultSettingsLocal,
|
|
5
5
|
createHooksConfig
|
|
6
|
-
} from "./cli-
|
|
6
|
+
} from "./cli-cnwssmsr.js";
|
|
7
7
|
import {
|
|
8
8
|
require_jsx_dev_runtime
|
|
9
9
|
} from "./cli-wx82tw1k.js";
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
import {
|
|
14
14
|
init_package,
|
|
15
15
|
package_default
|
|
16
|
-
} from "./cli-
|
|
16
|
+
} from "./cli-b23axgz4.js";
|
|
17
17
|
import {
|
|
18
18
|
Box_default,
|
|
19
19
|
Select,
|
|
@@ -4,14 +4,14 @@ import {
|
|
|
4
4
|
_setOpenRouterModelCacheRefreshForTests,
|
|
5
5
|
checkOpencodeCredentials,
|
|
6
6
|
resolveContextModePluginPath
|
|
7
|
-
} from "./cli-
|
|
7
|
+
} from "./cli-bc89my0z.js";
|
|
8
8
|
import"./cli-yazx6hap.js";
|
|
9
9
|
import"./cli-r94z9p1z.js";
|
|
10
10
|
import"./cli-d6n0thxw.js";
|
|
11
11
|
import"./cli-tng3131n.js";
|
|
12
12
|
import"./cli-zm7njwzd.js";
|
|
13
13
|
import"./cli-tghre7g6.js";
|
|
14
|
-
import"./cli-
|
|
14
|
+
import"./cli-e61fs2hp.js";
|
|
15
15
|
import"./cli-z2zcxes1.js";
|
|
16
16
|
import"./cli-4j2mrzag.js";
|
|
17
17
|
import"./cli-p9swy5t3.js";
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
UsageInfo$outboundSchema,
|
|
3
3
|
completionChunkFromJSON
|
|
4
|
-
} from "./cli-
|
|
4
|
+
} from "./cli-1yjrbg1f.js";
|
|
5
5
|
import {
|
|
6
6
|
require_stable_attributes,
|
|
7
7
|
require_stable_events,
|
|
8
8
|
require_stable_metrics
|
|
9
9
|
} from "./cli-3te4jdkm.js";
|
|
10
|
-
import"./cli-
|
|
10
|
+
import"./cli-xz9aq0rf.js";
|
|
11
11
|
import {
|
|
12
12
|
require_src
|
|
13
13
|
} from "./cli-7zd05xb4.js";
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import {
|
|
2
|
+
require_cross_spawn
|
|
3
|
+
} from "./cli-yazx6hap.js";
|
|
1
4
|
import {
|
|
2
5
|
Compile,
|
|
3
6
|
completeSimple,
|
|
@@ -25,31 +28,31 @@ import {
|
|
|
25
28
|
streamSimple,
|
|
26
29
|
summarizeSession,
|
|
27
30
|
validateToolArguments
|
|
28
|
-
} from "./cli-
|
|
31
|
+
} from "./cli-e7306swv.js";
|
|
29
32
|
import {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
} from "./cli-yv9dttkh.js";
|
|
33
|
-
import {
|
|
34
|
-
require_cross_spawn
|
|
35
|
-
} from "./cli-yazx6hap.js";
|
|
33
|
+
cleanupSessionResources
|
|
34
|
+
} from "./cli-hx1dcevq.js";
|
|
36
35
|
import {
|
|
37
36
|
readPkgVersion
|
|
38
37
|
} from "./cli-d6n0thxw.js";
|
|
39
38
|
import {
|
|
40
|
-
|
|
41
|
-
|
|
39
|
+
checkToolLoop,
|
|
40
|
+
clearToolHistory
|
|
41
|
+
} from "./cli-yv9dttkh.js";
|
|
42
42
|
import {
|
|
43
43
|
buildRatingsFromLlm,
|
|
44
44
|
fetchRetrievalsForTask,
|
|
45
45
|
postRatings
|
|
46
|
-
} from "./cli-
|
|
46
|
+
} from "./cli-ftyf58xj.js";
|
|
47
47
|
import"./cli-tk9vyqzh.js";
|
|
48
48
|
import {
|
|
49
49
|
applyReasoningEffort
|
|
50
|
-
} from "./cli-
|
|
51
|
-
import
|
|
52
|
-
|
|
50
|
+
} from "./cli-e61fs2hp.js";
|
|
51
|
+
import {
|
|
52
|
+
McpHttpClient
|
|
53
|
+
} from "./cli-jkhwmmgg.js";
|
|
54
|
+
import"./cli-bw80ck94.js";
|
|
55
|
+
import"./cli-xz9aq0rf.js";
|
|
53
56
|
import {
|
|
54
57
|
init_secret_scrubber,
|
|
55
58
|
scrubSecrets
|
|
@@ -62,10 +65,10 @@ import {
|
|
|
62
65
|
source_default
|
|
63
66
|
} from "./cli-v69vk5h0.js";
|
|
64
67
|
import"./cli-xw7p4wkq.js";
|
|
65
|
-
import"./cli-4wgngmwv.js";
|
|
66
68
|
import {
|
|
67
69
|
parseStreamingJson
|
|
68
70
|
} from "./cli-zyxs93y9.js";
|
|
71
|
+
import"./cli-4wgngmwv.js";
|
|
69
72
|
import {
|
|
70
73
|
EventStream,
|
|
71
74
|
clampThinkingLevel,
|
|
@@ -157251,101 +157254,6 @@ function createSwarmHooksExtension(config) {
|
|
|
157251
157254
|
});
|
|
157252
157255
|
};
|
|
157253
157256
|
}
|
|
157254
|
-
|
|
157255
|
-
// src/providers/pi-mono-mcp-client.ts
|
|
157256
|
-
class McpHttpClient {
|
|
157257
|
-
baseUrl;
|
|
157258
|
-
apiKey;
|
|
157259
|
-
agentId;
|
|
157260
|
-
taskId;
|
|
157261
|
-
sessionId = null;
|
|
157262
|
-
nextId = 1;
|
|
157263
|
-
customHeaders = {};
|
|
157264
|
-
useRawUrl = false;
|
|
157265
|
-
constructor(baseUrl, apiKey, agentId, taskId) {
|
|
157266
|
-
this.baseUrl = baseUrl;
|
|
157267
|
-
this.apiKey = apiKey;
|
|
157268
|
-
this.agentId = agentId;
|
|
157269
|
-
this.taskId = taskId;
|
|
157270
|
-
}
|
|
157271
|
-
async send(body) {
|
|
157272
|
-
const headers = {
|
|
157273
|
-
"Content-Type": "application/json",
|
|
157274
|
-
Accept: "application/json, text/event-stream",
|
|
157275
|
-
Authorization: `Bearer ${this.apiKey}`,
|
|
157276
|
-
"X-Agent-ID": this.agentId,
|
|
157277
|
-
...this.customHeaders
|
|
157278
|
-
};
|
|
157279
|
-
if (this.taskId) {
|
|
157280
|
-
headers["X-Source-Task-Id"] = this.taskId;
|
|
157281
|
-
}
|
|
157282
|
-
if (this.sessionId) {
|
|
157283
|
-
headers["mcp-session-id"] = this.sessionId;
|
|
157284
|
-
}
|
|
157285
|
-
const url = this.useRawUrl ? this.baseUrl : `${this.baseUrl}/mcp`;
|
|
157286
|
-
const res = await fetch(url, {
|
|
157287
|
-
method: "POST",
|
|
157288
|
-
headers,
|
|
157289
|
-
body: JSON.stringify(body)
|
|
157290
|
-
});
|
|
157291
|
-
if (!res.ok) {
|
|
157292
|
-
throw new Error(`MCP request failed: ${res.status} ${res.statusText}`);
|
|
157293
|
-
}
|
|
157294
|
-
const sid = res.headers.get("mcp-session-id");
|
|
157295
|
-
if (sid)
|
|
157296
|
-
this.sessionId = sid;
|
|
157297
|
-
const contentType = res.headers.get("content-type") || "";
|
|
157298
|
-
if (contentType.includes("text/event-stream")) {
|
|
157299
|
-
const text = await res.text();
|
|
157300
|
-
const dataLines = text.split(`
|
|
157301
|
-
`).filter((l3) => l3.startsWith("data: ")).map((l3) => l3.slice(6));
|
|
157302
|
-
const lastData = dataLines[dataLines.length - 1];
|
|
157303
|
-
return { data: lastData ? JSON.parse(lastData) : null, headers: res.headers };
|
|
157304
|
-
}
|
|
157305
|
-
const data = await res.json();
|
|
157306
|
-
return { data, headers: res.headers };
|
|
157307
|
-
}
|
|
157308
|
-
async initialize() {
|
|
157309
|
-
const { data } = await this.send({
|
|
157310
|
-
jsonrpc: "2.0",
|
|
157311
|
-
id: this.nextId++,
|
|
157312
|
-
method: "initialize",
|
|
157313
|
-
params: {
|
|
157314
|
-
protocolVersion: "2025-03-26",
|
|
157315
|
-
capabilities: {},
|
|
157316
|
-
clientInfo: { name: "agent-swarm-pi-mono", version: "1.0.0" }
|
|
157317
|
-
}
|
|
157318
|
-
});
|
|
157319
|
-
if (!data || typeof data !== "object" || !("result" in data)) {
|
|
157320
|
-
throw new Error(`MCP initialize failed: ${JSON.stringify(data)}`);
|
|
157321
|
-
}
|
|
157322
|
-
await this.send({
|
|
157323
|
-
jsonrpc: "2.0",
|
|
157324
|
-
method: "notifications/initialized"
|
|
157325
|
-
});
|
|
157326
|
-
}
|
|
157327
|
-
async listTools() {
|
|
157328
|
-
const { data } = await this.send({
|
|
157329
|
-
jsonrpc: "2.0",
|
|
157330
|
-
id: this.nextId++,
|
|
157331
|
-
method: "tools/list",
|
|
157332
|
-
params: {}
|
|
157333
|
-
});
|
|
157334
|
-
const result = data;
|
|
157335
|
-
return result?.result?.tools ?? [];
|
|
157336
|
-
}
|
|
157337
|
-
async callTool(name, args) {
|
|
157338
|
-
const { data } = await this.send({
|
|
157339
|
-
jsonrpc: "2.0",
|
|
157340
|
-
id: this.nextId++,
|
|
157341
|
-
method: "tools/call",
|
|
157342
|
-
params: { name, arguments: args }
|
|
157343
|
-
});
|
|
157344
|
-
const result = data;
|
|
157345
|
-
return result?.result ?? { content: [{ type: "text", text: "No result" }] };
|
|
157346
|
-
}
|
|
157347
|
-
}
|
|
157348
|
-
|
|
157349
157257
|
// src/providers/pi-mono-adapter.ts
|
|
157350
157258
|
function modelToCredKeys(modelStr) {
|
|
157351
157259
|
if (!modelStr)
|
|
@@ -2,13 +2,13 @@ import {
|
|
|
2
2
|
PRICING_REFRESH_INTERVAL_MS,
|
|
3
3
|
refreshPricingFromModelsDev,
|
|
4
4
|
startPricingRefreshLoop
|
|
5
|
-
} from "./cli-
|
|
6
|
-
import"./cli-
|
|
7
|
-
import"./cli-
|
|
5
|
+
} from "./cli-3samkyap.js";
|
|
6
|
+
import"./cli-tece6zgm.js";
|
|
7
|
+
import"./cli-15y7qhzp.js";
|
|
8
8
|
import"./cli-z2zcxes1.js";
|
|
9
|
-
import"./cli-
|
|
10
|
-
import"./cli-
|
|
11
|
-
import"./cli-
|
|
9
|
+
import"./cli-bw80ck94.js";
|
|
10
|
+
import"./cli-xz9aq0rf.js";
|
|
11
|
+
import"./cli-b23axgz4.js";
|
|
12
12
|
import"./cli-4j2mrzag.js";
|
|
13
13
|
import"./cli-p9swy5t3.js";
|
|
14
14
|
export {
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import {
|
|
2
|
+
BUILTIN_ROLES,
|
|
3
|
+
DEFAULT_ROLE_ID,
|
|
4
|
+
attachRole,
|
|
5
|
+
detachRole,
|
|
6
|
+
ensureRbacSeedsSynced,
|
|
7
|
+
getUserGrant,
|
|
8
|
+
listUserRoles,
|
|
9
|
+
runRbacCliCommand
|
|
10
|
+
} from "./cli-52fg7s7x.js";
|
|
11
|
+
import"./cli-86fdnerz.js";
|
|
12
|
+
import"./cli-15y7qhzp.js";
|
|
13
|
+
import"./cli-z2zcxes1.js";
|
|
14
|
+
import"./cli-bw80ck94.js";
|
|
15
|
+
import"./cli-xz9aq0rf.js";
|
|
16
|
+
import"./cli-b23axgz4.js";
|
|
17
|
+
import"./cli-4j2mrzag.js";
|
|
18
|
+
import"./cli-p9swy5t3.js";
|
|
19
|
+
export {
|
|
20
|
+
runRbacCliCommand,
|
|
21
|
+
listUserRoles,
|
|
22
|
+
getUserGrant,
|
|
23
|
+
ensureRbacSeedsSynced,
|
|
24
|
+
detachRole,
|
|
25
|
+
attachRole,
|
|
26
|
+
DEFAULT_ROLE_ID,
|
|
27
|
+
BUILTIN_ROLES
|
|
28
|
+
};
|