@desplega.ai/agent-swarm 2.13.1 → 2.13.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/acp-adapter-t2q6nsqv.js +17 -0
- package/dist/{acp-targets-n7vm5atw.js → acp-targets-k8xs4tj8.js} +7 -7
- package/dist/{actions-hq6wp9xv.js → actions-pg5fxjer.js} +25 -25
- package/dist/{agent-fs-provision-y0qc1rdd.js → agent-fs-provision-vbk3fppw.js} +4 -4
- package/dist/{amp-adapter-1qqs6h91.js → amp-adapter-adbhxsz9.js} +2 -2
- package/dist/{app-7m4z44rv.js → app-b267ggx1.js} +8 -8
- package/dist/{approval-notifications-8sr41gjx.js → approval-notifications-evc1a9z5.js} +9 -9
- package/dist/{assistant-hkczwfv6.js → assistant-wgz2ab84.js} +26 -26
- package/dist/{boot-args-schema-8025snev.js → boot-args-schema-6tpk28j4.js} +1 -1
- package/dist/{boot-reembed-15m87nr1.js → boot-reembed-ankp369c.js} +1 -1
- package/dist/{boot-reembed-4bbpxjh1.js → boot-reembed-r1zyvefv.js} +1 -1
- package/dist/{boot-scrub-sweep-eajr97e9.js → boot-scrub-sweep-cgb6r5bd.js} +2 -2
- package/dist/{boot-seeds-9cwy39jx.js → boot-seeds-bjceqg7b.js} +4 -4
- package/dist/{claude-adapter-g61wa4rt.js → claude-adapter-knztdnff.js} +9 -6
- package/dist/{claude-managed-adapter-znkk0prm.js → claude-managed-adapter-qwejzqkk.js} +3 -3
- package/dist/{claude-managed-setup-f1wndkr2.js → claude-managed-setup-0vgz4d1j.js} +4 -4
- package/dist/{claude-sdk-session-687xzf21.js → claude-sdk-session-c3g6dv0g.js} +11984 -11775
- package/dist/{cli-4mj5g29m.js → cli-0j4qmc80.js} +7 -7
- package/dist/{cli-fn8aj7gb.js → cli-1606qw3n.js} +98 -71
- package/dist/{cli-w41bvvms.js → cli-1gnf5c7x.js} +1 -1
- package/dist/{cli-aebswqmz.js → cli-1wew39p0.js} +15 -15
- package/dist/{cli-0fx95c06.js → cli-268b3dgn.js} +2 -2
- package/dist/cli-2ap1the6.js +11 -0
- package/dist/{cli-w6c6dj91.js → cli-4dyhzhpx.js} +1 -1
- package/dist/{cli-grcc2h2g.js → cli-55fqpd9q.js} +8 -8
- package/dist/{cli-p7g7wd9n.js → cli-61fzwtjk.js} +7 -7
- package/dist/{cli-zaate0rd.js → cli-61p7ty8d.js} +2 -2
- package/dist/{cli-cp0m07wb.js → cli-7fa6yv98.js} +2 -2
- package/dist/{cli-5v6b2am8.js → cli-7kv5d674.js} +7 -7
- package/dist/{cli-6r1dwegd.js → cli-80d5g0fa.js} +2 -2
- package/dist/{cli-0xwb7zpt.js → cli-88np9va3.js} +1 -1
- package/dist/{cli-1b5axkt1.js → cli-8m6gqnf1.js} +2 -2
- package/dist/{cli-0a336ze7.js → cli-8pnawt98.js} +3 -3
- package/dist/{cli-7ewre3dm.js → cli-8sayvj48.js} +2 -2
- package/dist/{cli-yeh3g1q6.js → cli-9gmkw6xn.js} +53 -32
- package/dist/{cli-h03j6je3.js → cli-a21cwm89.js} +2 -2
- package/dist/{cli-s6fhqbz1.js → cli-aytna2fm.js} +1 -1
- package/dist/{cli-84xtgbn6.js → cli-b0m3bg0f.js} +100 -2
- package/dist/{cli-mwxez0pz.js → cli-b768ek79.js} +1 -1
- package/dist/{cli-9xx36trj.js → cli-bh53ppqm.js} +2 -2
- package/dist/{cli-1carhg8g.js → cli-czeh7x13.js} +3 -3
- package/dist/{cli-cd9acnvd.js → cli-djwt4mtn.js} +71 -5
- package/dist/{cli-sfajkbd7.js → cli-dq30fq3q.js} +2 -2
- package/dist/{cli-a8ts6x1n.js → cli-dw43pnzp.js} +5 -5
- package/dist/{cli-h9bejmkf.js → cli-e4gx499y.js} +52 -29
- package/dist/{cli-t90k0phh.js → cli-ea367bdn.js} +32 -23
- package/dist/{cli-cmgdptmx.js → cli-ef590376.js} +29 -5
- package/dist/{cli-8rbkw18r.js → cli-fbmgpt72.js} +2 -2
- package/dist/{cli-tzzas8rb.js → cli-g4dhd3pr.js} +2 -2
- package/dist/{cli-snypfjgj.js → cli-gc715jrc.js} +1 -1
- package/dist/{cli-c0tyzt73.js → cli-gkjw33x5.js} +1 -1
- package/dist/{cli-z6m6xzxt.js → cli-grk77aen.js} +26 -5
- package/dist/{cli-hs3mqswp.js → cli-gxqwm3k3.js} +5 -5
- package/dist/{cli-4h90xaet.js → cli-h3drhntp.js} +1 -1
- package/dist/{cli-qn79645p.js → cli-h9d3sdnc.js} +1 -1
- package/dist/{cli-byxsctca.js → cli-hd2a204w.js} +6 -6
- package/dist/{cli-1dr5at77.js → cli-hhb8kbwd.js} +12 -12
- package/dist/{cli-zvpkrgsc.js → cli-hpxcfvdm.js} +3 -3
- package/dist/{cli-cqxwjb93.js → cli-hxj888w3.js} +1 -1
- package/dist/{cli-82j36f2m.js → cli-jjzxsk47.js} +9 -3
- package/dist/{cli-13t0smbk.js → cli-ka4tqjzd.js} +185 -58
- package/dist/{cli-jhtvt7gn.js → cli-kh973792.js} +3 -3
- package/dist/{cli-x5yb8zc8.js → cli-kwm1bek7.js} +1 -1
- package/dist/{cli-bjmq14k9.js → cli-mgr3gatr.js} +4 -4
- package/dist/{cli-c8kqmzzf.js → cli-nbawx3s0.js} +2 -2
- package/dist/{cli-04103ryh.js → cli-ppf9ap9n.js} +1 -1
- package/dist/{cli-dd57p1gd.js → cli-pzsedyb0.js} +4 -4
- package/dist/{cli-32xndx6b.js → cli-r6xnchva.js} +2 -2
- package/dist/{cli-4tbvndmm.js → cli-r8ddn0hf.js} +1 -1
- package/dist/{cli-y6qqbpwc.js → cli-snwz16eg.js} +1 -1
- package/dist/{cli-w24f3j49.js → cli-sy2ge2ye.js} +7 -6
- package/dist/{cli-3m8vqehw.js → cli-syqcny89.js} +3 -3
- package/dist/{cli-qx1dwrr5.js → cli-tjf1bh1v.js} +2 -2
- package/dist/{cli-xhkek467.js → cli-v1v49t36.js} +28 -2
- package/dist/{cli-cn6fpa1p.js → cli-v8rpjrnx.js} +1 -1
- package/dist/{cli-mmw2sjaf.js → cli-vgh5adn9.js} +5 -5
- package/dist/{cli-3zyme1wt.js → cli-w24741sm.js} +3 -3
- package/dist/{cli-gq6qhmrr.js → cli-wsnradtk.js} +3 -3
- package/dist/{cli-nk8swfpx.js → cli-wtffytm8.js} +3 -3
- package/dist/{cli-0m77n7ej.js → cli-xc8m5cjn.js} +54 -12
- package/dist/{cli-8cmjkbvj.js → cli-y0q92v4r.js} +2 -2
- package/dist/{cli-gedf48yw.js → cli-y754psdt.js} +4 -4
- package/dist/cli.js +19 -18
- package/dist/{codex-adapter-ysfg6ty3.js → codex-adapter-493vb8cv.js} +5 -5
- package/dist/{codex-hook-c0nvm30r.js → codex-hook-ej8hn6z5.js} +9 -2
- package/dist/{codex-session-runner-823scr6g.js → codex-session-runner-ps5m4z1g.js} +5 -5
- package/dist/{commands-5rbm07fz.js → commands-shktk0b8.js} +3 -3
- package/dist/{controllers-connect-34jzhfft.js → controllers-connect-yft057ws.js} +24 -24
- package/dist/core-nheayfgm.js +42 -0
- package/dist/{cursor-adapter-w1681kp1.js → cursor-adapter-8fpm4dng.js} +1 -1
- package/dist/{db-6bkgbfwk.js → db-0ezhdhz5.js} +3 -3
- package/dist/{db-hcj16x7z.js → db-84pz2w5c.js} +2 -2
- package/dist/{dispatcher-jgjqrfzv.js → dispatcher-h2rz69f6.js} +23 -23
- package/dist/{easter-egg-3d-w17nsny6.js → easter-egg-3d-m41ad78v.js} +1 -1
- package/dist/{embedding-space-v06fwy7b.js → embedding-space-yam9zwzj.js} +6 -6
- package/dist/{embeddings-g50dxea4.js → embeddings-g2be0y8q.js} +1 -1
- package/dist/{execute-1n36haw1.js → execute-hhdejgzf.js} +1 -1
- package/dist/{external-channel-43tv8pg6.js → external-channel-kjt2yzfj.js} +2 -2
- package/dist/fx-adapter-8g7xsp8q.js +20 -0
- package/dist/{grok-adapter-my5j8mdf.js → grok-adapter-ztk2zkz1.js} +9 -9
- package/dist/handlers-9ywssz71.js +41 -0
- package/dist/{heartbeat-sf3nk937.js → heartbeat-2e5jdexj.js} +25 -25
- package/dist/{hook-dqph1e05.js → hook-34s8cmgn.js} +9 -6
- package/dist/{hook-m1m9dm6w.js → hook-acg9saz7.js} +8 -5
- package/dist/{http-w0th1cz9.js → http-ra2zr2f8.js} +304 -111
- package/dist/{index-pb03vans.js → index-2z1z7qx6.js} +26 -26
- package/dist/{index-p2f5xg64.js → index-3j803vnb.js} +36259 -34299
- package/dist/index-6mgbdtv1.js +44 -0
- package/dist/{index-e8pz8qdg.js → index-7dgxveck.js} +2 -2
- package/dist/{index-gkpfgpg7.js → index-93bw5wds.js} +1 -1
- package/dist/{index-c0e8en64.js → index-9q42cr54.js} +1 -1
- package/dist/{index-ffba0z8q.js → index-9r4j0a60.js} +28 -18
- package/dist/index-hqdsn2t2.js +39 -0
- package/dist/{index-k8ajc0g0.js → index-maddg9ys.js} +1 -1
- package/dist/{index-y4vd4mhn.js → index-mbpxhc4w.js} +1 -1
- package/dist/index-rz8ve510.js +569 -0
- package/dist/index-st231bqv.js +40 -0
- package/dist/{index-ez823q84.js → index-ym9fgxad.js} +1 -1
- package/dist/{keepalive-2v06q2e8.js → keepalive-vjnnqbkm.js} +4 -4
- package/dist/lead-mk0xkth2.js +82 -0
- package/dist/{maintenance-vx7vjhhy.js → maintenance-px2g599e.js} +1 -1
- package/dist/{oauth-refresh-sweep-g06k4bza.js → oauth-refresh-sweep-nkykf09m.js} +3 -3
- package/dist/{object-webhooks-3dzdq4fm.js → object-webhooks-gt9xnq21.js} +7 -7
- package/dist/{onboard-232pazny.js → onboard-1f134p65.js} +3 -3
- package/dist/{opencode-adapter-t0paqbh8.js → opencode-adapter-94976yab.js} +6 -6
- package/dist/{otel-impl-kmpkyp4y.js → otel-impl-5d4p2fqs.js} +1 -1
- package/dist/{pending-x0z3vx1x.js → pending-vkk0vx6n.js} +24 -24
- package/dist/{pi-mono-adapter-7pmypn6d.js → pi-mono-adapter-cyzdv5er.js} +11 -11
- package/dist/{pricing-refresh-ytjmtyd7.js → pricing-refresh-jtmjwss9.js} +2 -2
- package/dist/{rbac-roles-xyaxekh3.js → rbac-roles-1fvmdyeb.js} +2 -2
- package/dist/{rbac-roles-fgm5mxr2.js → rbac-roles-yd1fgpsn.js} +3 -3
- package/dist/{render-v2-ws972g4r.js → render-v2-kb5s3vx4.js} +8 -8
- package/dist/{resume-m6mjzhkp.js → resume-z1vs44n5.js} +11 -11
- package/dist/{runtime-zzpc0c8a.js → runtime-gk6ct7r7.js} +1 -1
- package/dist/{session-access-vp35xs91.js → session-access-nz6nre4d.js} +5 -5
- package/dist/{session-source-backfill-p73e8zbe.js → session-source-backfill-wb60zjkd.js} +1 -1
- package/dist/{setup-r4kd7rxg.js → setup-2x8g8j4s.js} +1 -1
- package/dist/thread-buffer-d50rqpev.js +42 -0
- package/dist/{tree-visibility-07h2tbs2.js → tree-visibility-ts3z30kw.js} +2 -2
- package/dist/{user-merge-jobs-96vg9rpe.js → user-merge-jobs-zetg26e0.js} +3 -3
- package/dist/{virtual-modules-vgn3f2x4.js → virtual-modules-674fka8x.js} +3 -3
- package/dist/{work-objects-74hbcx3e.js → work-objects-w52yyjxm.js} +26 -26
- package/dist/worker-662x1vse.js +82 -0
- package/dist/{worker-follow-up-ezavwn5d.js → worker-follow-up-dyfxyjbj.js} +23 -23
- package/openapi.json +6 -2
- package/package.json +7 -6
- package/src/be/migrations/341_user_token_expiry.sql +4 -0
- package/src/be/scripts/run-credential.ts +55 -1
- package/src/be/scripts/typecheck.ts +4 -4
- package/src/be/scripts/user-code-mode.ts +160 -0
- package/src/be/users.ts +48 -7
- package/src/commands/onboard/agent-fs-version.ts +1 -1
- package/src/commands/runner.ts +62 -6
- package/src/hooks/codex-hook.ts +15 -4
- package/src/hooks/hook.ts +7 -0
- package/src/http/script-connection-proxy.ts +18 -6
- package/src/http/scripts.ts +2 -11
- package/src/http/session-cost-recompute.ts +3 -1
- package/src/http/session-data.ts +3 -0
- package/src/http/users.ts +1 -0
- package/src/integrations/chat-sdk/adapters.ts +29 -0
- package/src/integrations/chat-sdk/limits.ts +3 -0
- package/src/integrations/chat-sdk/rocketchat/README.md +8 -0
- package/src/integrations/chat-sdk/rocketchat/index.ts +790 -0
- package/src/integrations/chat-sdk/rocketchat/markdown.ts +210 -0
- package/src/integrations/chat-sdk/rocketchat/types.ts +249 -0
- package/src/integrations/chat-sdk/runtime.ts +11 -5
- package/src/integrations/chat-sdk/schema.ts +37 -3
- package/src/integrations/chat-sdk/status.ts +9 -0
- package/src/prompts/base-prompt.ts +1 -1
- package/src/prompts/session-templates.ts +1 -1
- package/src/providers/acp-targets.ts +2 -2
- package/src/providers/amp-adapter.ts +1 -1
- package/src/providers/claude-adapter.ts +21 -1
- package/src/providers/claude-sdk-session.ts +22 -3
- package/src/providers/claude-session-events.ts +76 -1
- package/src/providers/cursor-adapter.ts +1 -1
- package/src/providers/fx-adapter.ts +2 -2
- package/src/providers/pricing-sources.md +3 -0
- package/src/providers/types.ts +13 -0
- package/src/rbac/legacy-policy.ts +1 -0
- package/src/rbac/permissions.ts +4 -0
- package/src/scripts-runtime/executors/native.ts +225 -67
- package/src/scripts-runtime/mcp-client.ts +2 -1
- package/src/scripts-runtime/swarm-sdk.ts +2 -1
- package/src/scripts-runtime/types/stdlib.d.ts +4 -4
- package/src/scripts-runtime/types/swarm-sdk.d.ts +4 -4
- package/src/server-user.ts +98 -0
- package/src/slack/render-v2.ts +27 -7
- package/src/tests/base-prompt.test.ts +6 -2
- package/src/tests/chat-sdk-rocketchat-vendored.test.ts +67 -0
- package/src/tests/chat-sdk-status-route.test.ts +13 -1
- package/src/tests/claude-adapter.test.ts +115 -0
- package/src/tests/codex-app-server.test.ts +4 -6
- package/src/tests/fixtures/fx/acp-updates-recorded.jsonl +1 -1
- package/src/tests/internal-ai/complete-structured.test.ts +105 -0
- package/src/tests/internal-ai/credentials.test.ts +149 -0
- package/src/tests/internal-ai/task-title.test.ts +78 -0
- package/src/tests/mcp-input-caps.test.ts +16 -11
- package/src/tests/mcp-user-route.test.ts +10 -1
- package/src/tests/runner-slot-reconcile.test.ts +102 -0
- package/src/tests/script-connections-mcp.test.ts +14 -10
- package/src/tests/script-connections-sql.test.ts +6 -2
- package/src/tests/script-connections.test.ts +2 -0
- package/src/tests/slack-render-v2.test.ts +85 -0
- package/src/tools/script-common.ts +37 -22
- package/src/tools/script-query-types.ts +1 -1
- package/src/tools/script-run.ts +1 -1
- package/src/tools/script-search.ts +12 -10
- package/src/tools/utils.ts +7 -1
- package/src/types.ts +2 -1
- package/src/utils/internal-ai/complete-structured.ts +36 -5
- package/src/utils/internal-ai/credentials.ts +78 -2
- package/src/utils/internal-ai/models.ts +37 -1
- package/src/utils/internal-ai/task-title.ts +31 -1
- package/templates/skills/chat-sdk/content.md +2 -2
- package/templates/skills/swarm-docs/content.md +10 -0
- package/dist/acp-adapter-xtj40wd8.js +0 -17
- package/dist/core-kdehq26g.js +0 -42
- package/dist/fx-adapter-bvh05t4a.js +0 -20
- package/dist/handlers-wyymeeqh.js +0 -41
- package/dist/index-22khdtby.js +0 -44
- package/dist/index-np0582ac.js +0 -40
- package/dist/index-vgkrj1jt.js +0 -39
- package/dist/lead-55z813ng.js +0 -79
- package/dist/thread-buffer-cm2nzq6t.js +0 -42
- package/dist/worker-5pn2vzx6.js +0 -79
- /package/dist/{cli-m4ejz4nj.js → cli-cah298e5.js} +0 -0
|
@@ -6,11 +6,11 @@ import {
|
|
|
6
6
|
getResolvedConfig2,
|
|
7
7
|
getAllUsers2,
|
|
8
8
|
init_db4
|
|
9
|
-
} from "./cli-
|
|
9
|
+
} from "./cli-e4gx499y.js";
|
|
10
10
|
import {
|
|
11
11
|
getUserGrant2,
|
|
12
12
|
init_rbac_roles
|
|
13
|
-
} from "./cli-
|
|
13
|
+
} from "./cli-tjf1bh1v.js";
|
|
14
14
|
import {
|
|
15
15
|
scrubSecrets,
|
|
16
16
|
init_secret_scrubber
|
|
@@ -316,6 +316,101 @@ function renderGfmTable(table) {
|
|
|
316
316
|
}
|
|
317
317
|
return lines;
|
|
318
318
|
}
|
|
319
|
+
function normalizeCodeFences(text, options = {}) {
|
|
320
|
+
const convertText = options.convertText ?? passThrough;
|
|
321
|
+
const convertCode = options.convertCode ?? passThrough;
|
|
322
|
+
if (!text.includes(CODE_FENCE)) {
|
|
323
|
+
return convertText(text);
|
|
324
|
+
}
|
|
325
|
+
let result = "";
|
|
326
|
+
let textStart = 0;
|
|
327
|
+
let cursor = 0;
|
|
328
|
+
let movedToOwnLine = false;
|
|
329
|
+
const flushTextBefore = (end) => {
|
|
330
|
+
let segment = text.slice(textStart, end);
|
|
331
|
+
if (movedToOwnLine) {
|
|
332
|
+
segment = escapeLeadingBlockMarker(segment);
|
|
333
|
+
movedToOwnLine = false;
|
|
334
|
+
}
|
|
335
|
+
result += convertText(segment);
|
|
336
|
+
};
|
|
337
|
+
while (cursor < text.length) {
|
|
338
|
+
if (text[cursor] !== "`") {
|
|
339
|
+
cursor += 1;
|
|
340
|
+
continue;
|
|
341
|
+
}
|
|
342
|
+
if (!text.startsWith(CODE_FENCE, cursor)) {
|
|
343
|
+
const spanEnd = findInlineCodeEnd(text, cursor);
|
|
344
|
+
cursor = spanEnd === -1 ? cursor + 1 : spanEnd;
|
|
345
|
+
continue;
|
|
346
|
+
}
|
|
347
|
+
const contentStart = cursor + CODE_FENCE.length;
|
|
348
|
+
const contentEnd = text.indexOf(CODE_FENCE, contentStart);
|
|
349
|
+
if (contentEnd === -1 || isOnBlockquoteLine(text, cursor)) {
|
|
350
|
+
cursor = contentStart;
|
|
351
|
+
continue;
|
|
352
|
+
}
|
|
353
|
+
flushTextBefore(cursor);
|
|
354
|
+
if (result.length > 0 && !result.endsWith(`
|
|
355
|
+
`)) {
|
|
356
|
+
result += `
|
|
357
|
+
`;
|
|
358
|
+
}
|
|
359
|
+
const content = text.slice(contentStart, contentEnd);
|
|
360
|
+
result += CODE_FENCE;
|
|
361
|
+
if (!content.startsWith(`
|
|
362
|
+
`)) {
|
|
363
|
+
result += `
|
|
364
|
+
`;
|
|
365
|
+
}
|
|
366
|
+
result += convertCode(content);
|
|
367
|
+
if (!content.endsWith(`
|
|
368
|
+
`)) {
|
|
369
|
+
result += `
|
|
370
|
+
`;
|
|
371
|
+
}
|
|
372
|
+
result += CODE_FENCE;
|
|
373
|
+
cursor = contentEnd + CODE_FENCE.length;
|
|
374
|
+
textStart = cursor;
|
|
375
|
+
if (cursor < text.length && text[cursor] !== `
|
|
376
|
+
`) {
|
|
377
|
+
result += `
|
|
378
|
+
`;
|
|
379
|
+
movedToOwnLine = true;
|
|
380
|
+
}
|
|
381
|
+
}
|
|
382
|
+
flushTextBefore(text.length);
|
|
383
|
+
return result;
|
|
384
|
+
}
|
|
385
|
+
function passThrough(value) {
|
|
386
|
+
return value;
|
|
387
|
+
}
|
|
388
|
+
function findInlineCodeEnd(text, index) {
|
|
389
|
+
const close = text.indexOf("`", index + 1);
|
|
390
|
+
if (close === -1) {
|
|
391
|
+
return -1;
|
|
392
|
+
}
|
|
393
|
+
const newline = text.indexOf(`
|
|
394
|
+
`, index + 1);
|
|
395
|
+
if (newline !== -1 && newline < close) {
|
|
396
|
+
return -1;
|
|
397
|
+
}
|
|
398
|
+
return close + 1;
|
|
399
|
+
}
|
|
400
|
+
function isOnBlockquoteLine(text, index) {
|
|
401
|
+
const lineStart = text.lastIndexOf(`
|
|
402
|
+
`, index - 1) + 1;
|
|
403
|
+
return text.slice(lineStart, index).trimStart().startsWith(">");
|
|
404
|
+
}
|
|
405
|
+
function escapeLeadingBlockMarker(text) {
|
|
406
|
+
const whitespace = LEADING_WHITESPACE_PATTERN.exec(text)?.[0] ?? "";
|
|
407
|
+
const prefix = whitespace.length > 0 ? " " : "";
|
|
408
|
+
const rest = text.slice(whitespace.length);
|
|
409
|
+
if (BLOCK_MARKER_PATTERN.test(rest)) {
|
|
410
|
+
return `${prefix}\\${rest}`;
|
|
411
|
+
}
|
|
412
|
+
return prefix + rest.replace(ORDERED_LIST_MARKER_PATTERN, "$1\\$2");
|
|
413
|
+
}
|
|
319
414
|
function encryptToken(plaintext, key) {
|
|
320
415
|
const iv = crypto.randomBytes(IV_LENGTH);
|
|
321
416
|
const cipher = crypto.createCipheriv(ALGORITHM, key, iv, {
|
|
@@ -562,7 +657,7 @@ async function downloadAttachment(value, options) {
|
|
|
562
657
|
throw error;
|
|
563
658
|
}
|
|
564
659
|
}
|
|
565
|
-
var AdapterError, AdapterRateLimitError, AuthenticationError3, ResourceNotFoundError, PermissionError, ValidationError, NetworkError, BUTTON_STYLE_MAPPINGS, ALGORITHM = "aes-256-gcm", IV_LENGTH = 12, AUTH_TAG_LENGTH = 16, HEX_KEY_PATTERN, LIMIT, REDIRECTS = 5, TIMEOUT = 30000, STATUSES, BRACKETS, IPV4, IPV6, DECODERS, BLOCKED4, BLOCKED6;
|
|
660
|
+
var AdapterError, AdapterRateLimitError, AuthenticationError3, ResourceNotFoundError, PermissionError, ValidationError, NetworkError, BUTTON_STYLE_MAPPINGS, CODE_FENCE = "```", LEADING_WHITESPACE_PATTERN, BLOCK_MARKER_PATTERN, ORDERED_LIST_MARKER_PATTERN, ALGORITHM = "aes-256-gcm", IV_LENGTH = 12, AUTH_TAG_LENGTH = 16, HEX_KEY_PATTERN, LIMIT, REDIRECTS = 5, TIMEOUT = 30000, STATUSES, BRACKETS, IPV4, IPV6, DECODERS, BLOCKED4, BLOCKED6;
|
|
566
661
|
var init_dist7 = __esm(() => {
|
|
567
662
|
init_chunk_5C7UKIZ7();
|
|
568
663
|
init_chunk_KGHU3EYG();
|
|
@@ -634,6 +729,9 @@ var init_dist7 = __esm(() => {
|
|
|
634
729
|
teams: { primary: "positive", danger: "destructive" },
|
|
635
730
|
discord: { primary: "primary", danger: "danger" }
|
|
636
731
|
};
|
|
732
|
+
LEADING_WHITESPACE_PATTERN = /^[ \t]+/;
|
|
733
|
+
BLOCK_MARKER_PATTERN = /^(?:[<>]|#{1,6}(?=[ \t\n]|$)|[-+*](?=[ \t\n]|$)|`{3,}|~{3,}|(?:[-*_][ \t]*){3,}(?=\n|$))/;
|
|
734
|
+
ORDERED_LIST_MARKER_PATTERN = /^(\d{1,9})([.)])(?=[ \t\n]|$)/;
|
|
637
735
|
HEX_KEY_PATTERN = /^[0-9a-fA-F]{64}$/;
|
|
638
736
|
LIMIT = 25 * 1024 * 1024;
|
|
639
737
|
STATUSES = /* @__PURE__ */ new Set([301, 302, 303, 307, 308]);
|
|
@@ -674,4 +772,4 @@ var init_dist7 = __esm(() => {
|
|
|
674
772
|
BLOCKED6 = blocklist(IPV6, "ipv6");
|
|
675
773
|
});
|
|
676
774
|
|
|
677
|
-
export { replaceBareMentions, maskCodeSpans, init_chunk_KGHU3EYG, encodeCallbackData, decodeCallbackData, extractCard, extractFiles, extractPostableAttachments, AdapterRateLimitError, AuthenticationError3, ResourceNotFoundError, PermissionError, ValidationError, NetworkError, toBuffer, bufferToDataUri, createEmojiConverter, mapButtonStyle, cardToFallbackText3, escapeTableCell, renderGfmTable, encryptToken, decryptToken, isEncryptedTokenData, decodeKey, downloadAttachment, init_dist7 };
|
|
775
|
+
export { replaceBareMentions, maskCodeSpans, init_chunk_KGHU3EYG, encodeCallbackData, decodeCallbackData, extractCard, extractFiles, extractPostableAttachments, AdapterRateLimitError, AuthenticationError3, ResourceNotFoundError, PermissionError, ValidationError, NetworkError, toBuffer, bufferToDataUri, createEmojiConverter, mapButtonStyle, cardToFallbackText3, escapeTableCell, renderGfmTable, normalizeCodeFences, encryptToken, decryptToken, isEncryptedTokenData, decodeKey, downloadAttachment, init_dist7 };
|
|
@@ -624,7 +624,7 @@ Task: {{task}}{{progressLine}}
|
|
|
624
624
|
registerTemplate({
|
|
625
625
|
eventType: "system.agent.tool_discovery.fx",
|
|
626
626
|
header: "",
|
|
627
|
-
defaultBody: "Most swarm tools are deferred behind `
|
|
627
|
+
defaultBody: "Most swarm tools are deferred behind `toolbox`. Each one is named `mcp_swarm_<tool>`, so `store-progress` is `mcp_swarm_store-progress`. Call a tool in your tool list directly. A deferred tool fails when called directly: find it with `toolbox` `search`, then call `toolbox` with `run` set to its name and `arguments` set to its arguments.",
|
|
628
628
|
variables: [],
|
|
629
629
|
category: "system"
|
|
630
630
|
});
|
|
@@ -3,10 +3,10 @@ import {
|
|
|
3
3
|
requireFxRoute,
|
|
4
4
|
fxSessionExists2,
|
|
5
5
|
fxTargetProfile2
|
|
6
|
-
} from "./cli-
|
|
6
|
+
} from "./cli-7fa6yv98.js";
|
|
7
7
|
import {
|
|
8
8
|
ACPAdapter2
|
|
9
|
-
} from "./cli-
|
|
9
|
+
} from "./cli-xc8m5cjn.js";
|
|
10
10
|
import {
|
|
11
11
|
getKnownContextWindowSize,
|
|
12
12
|
init_context_window
|
|
@@ -8,11 +8,11 @@ import {
|
|
|
8
8
|
getMemoryStore2,
|
|
9
9
|
init_memory,
|
|
10
10
|
init_db4
|
|
11
|
-
} from "./cli-
|
|
11
|
+
} from "./cli-e4gx499y.js";
|
|
12
12
|
import {
|
|
13
13
|
contentSha256,
|
|
14
14
|
init_profile_sync
|
|
15
|
-
} from "./cli-
|
|
15
|
+
} from "./cli-aytna2fm.js";
|
|
16
16
|
import {
|
|
17
17
|
SCRUBBER_RULES_VERSION,
|
|
18
18
|
createSweepScrubber,
|
|
@@ -142,7 +142,7 @@ async function runBootScrubSweep2(opts = {}) {
|
|
|
142
142
|
console.log(`[${tag}] complete`);
|
|
143
143
|
const memoryChanged = stats.find((s) => s.table === "agent_memory")?.changed ?? 0;
|
|
144
144
|
if (memoryChanged > 0 && opts.reembed !== false) {
|
|
145
|
-
const { runBootReembed } = await import("./boot-reembed-
|
|
145
|
+
const { runBootReembed } = await import("./boot-reembed-r1zyvefv.js");
|
|
146
146
|
await runBootReembed();
|
|
147
147
|
}
|
|
148
148
|
return stats;
|
|
@@ -2,10 +2,10 @@ import {
|
|
|
2
2
|
contextStatePath,
|
|
3
3
|
contextBoundNoteMarkerPath,
|
|
4
4
|
recordContextState
|
|
5
|
-
} from "./cli-
|
|
5
|
+
} from "./cli-88np9va3.js";
|
|
6
6
|
import {
|
|
7
7
|
runStopHookSessionSummarySubprocess
|
|
8
|
-
} from "./cli-
|
|
8
|
+
} from "./cli-vgh5adn9.js";
|
|
9
9
|
import {
|
|
10
10
|
redactRateLimitEventLine,
|
|
11
11
|
SessionErrorTracker,
|
|
@@ -49,7 +49,7 @@ import {
|
|
|
49
49
|
import {
|
|
50
50
|
withFileLock,
|
|
51
51
|
init_file_lock
|
|
52
|
-
} from "./cli-
|
|
52
|
+
} from "./cli-aytna2fm.js";
|
|
53
53
|
import {
|
|
54
54
|
routeCredentialStatus,
|
|
55
55
|
deriveDefaultRoute,
|
|
@@ -363,6 +363,64 @@ function costFromResult(json, state) {
|
|
|
363
363
|
provider: "claude"
|
|
364
364
|
};
|
|
365
365
|
}
|
|
366
|
+
|
|
367
|
+
class ClaudeUsageAccumulator {
|
|
368
|
+
byMessage = new Map;
|
|
369
|
+
unnamed = 0;
|
|
370
|
+
observe(json, fallbackModel) {
|
|
371
|
+
if (json.type !== "assistant" || !json.message?.usage)
|
|
372
|
+
return;
|
|
373
|
+
const id = json.message.id || `unnamed-${this.unnamed++}`;
|
|
374
|
+
const model = json.message.model || fallbackModel;
|
|
375
|
+
this.byMessage.set(id, { model, usage: json.message.usage });
|
|
376
|
+
}
|
|
377
|
+
toCost(state, opts) {
|
|
378
|
+
const perModel = new Map;
|
|
379
|
+
let cacheWrite5mTokens = 0;
|
|
380
|
+
let cacheWrite1hTokens = 0;
|
|
381
|
+
let thinkingTokens = 0;
|
|
382
|
+
for (const { model, usage } of this.byMessage.values()) {
|
|
383
|
+
const entry = perModel.get(model) ?? {
|
|
384
|
+
model,
|
|
385
|
+
inputTokens: 0,
|
|
386
|
+
outputTokens: 0,
|
|
387
|
+
cacheReadTokens: 0,
|
|
388
|
+
cacheWriteTokens: 0
|
|
389
|
+
};
|
|
390
|
+
entry.inputTokens += tokenCount(usage.input_tokens) ?? 0;
|
|
391
|
+
entry.outputTokens += tokenCount(usage.output_tokens) ?? 0;
|
|
392
|
+
entry.cacheReadTokens += tokenCount(usage.cache_read_input_tokens) ?? 0;
|
|
393
|
+
entry.cacheWriteTokens += tokenCount(usage.cache_creation_input_tokens) ?? 0;
|
|
394
|
+
perModel.set(model, entry);
|
|
395
|
+
cacheWrite5mTokens += tokenCount(usage.cache_creation?.ephemeral_5m_input_tokens) ?? 0;
|
|
396
|
+
cacheWrite1hTokens += tokenCount(usage.cache_creation?.ephemeral_1h_input_tokens) ?? 0;
|
|
397
|
+
thinkingTokens += tokenCount(usage.output_tokens_details?.thinking_tokens) ?? 0;
|
|
398
|
+
}
|
|
399
|
+
const models = [...perModel.values()].filter((m) => m.inputTokens + m.outputTokens + m.cacheReadTokens + m.cacheWriteTokens > 0);
|
|
400
|
+
if (models.length === 0)
|
|
401
|
+
return;
|
|
402
|
+
const sum = (key) => models.reduce((total, m) => total + m[key], 0);
|
|
403
|
+
return {
|
|
404
|
+
sessionId: "",
|
|
405
|
+
taskId: state.taskId,
|
|
406
|
+
agentId: state.agentId,
|
|
407
|
+
totalCostUsd: 0,
|
|
408
|
+
estimated: true,
|
|
409
|
+
inputTokens: sum("inputTokens"),
|
|
410
|
+
outputTokens: sum("outputTokens"),
|
|
411
|
+
cacheReadTokens: sum("cacheReadTokens"),
|
|
412
|
+
cacheWriteTokens: sum("cacheWriteTokens"),
|
|
413
|
+
...cacheWrite5mTokens + cacheWrite1hTokens > 0 ? { cacheWrite5mTokens, cacheWrite1hTokens } : {},
|
|
414
|
+
thinkingTokens,
|
|
415
|
+
models,
|
|
416
|
+
durationMs: opts.durationMs,
|
|
417
|
+
numTurns: null,
|
|
418
|
+
model: state.model,
|
|
419
|
+
isError: opts.isError,
|
|
420
|
+
provider: "claude"
|
|
421
|
+
};
|
|
422
|
+
}
|
|
423
|
+
}
|
|
366
424
|
function normalizeClaudeMessage(json, state) {
|
|
367
425
|
const events = [];
|
|
368
426
|
const transcriptEntries = [];
|
|
@@ -947,6 +1005,8 @@ class ClaudeSession {
|
|
|
947
1005
|
lastContextTokens;
|
|
948
1006
|
transcript;
|
|
949
1007
|
backgroundKeepalive;
|
|
1008
|
+
usage = new ClaudeUsageAccumulator;
|
|
1009
|
+
startedAt = Date.now();
|
|
950
1010
|
deliverSteering;
|
|
951
1011
|
constructor(config, model, taskFilePath, taskFileKey, sessionMcpConfig = null, claudeBinaryArgv = ["claude"], systemPromptFile = null, harnessVariant, harnessVariantMeta, queueSteeringSupported = false, runSessionSummary = runStopHookSessionSummarySubprocess, flagSettings = claudeFlagSettings()) {
|
|
952
1012
|
this.config = config;
|
|
@@ -1164,6 +1224,7 @@ ${scrubSecrets(stderrOutput)}`);
|
|
|
1164
1224
|
if (stdoutChunks === 0 && stderrChunks === 0) {
|
|
1165
1225
|
console.warn(`\x1B[33m[${this.config.role}] WARNING: No output from Claude for task ${this.config.taskId.slice(0, 8)} - check auth/startup\x1B[0m`);
|
|
1166
1226
|
}
|
|
1227
|
+
lastCost ??= this.usage.toCost({ taskId: this.config.taskId, agentId: this.config.agentId, model: this.model }, { durationMs: Date.now() - this.startedAt, isError: (exitCode ?? 1) !== 0 });
|
|
1167
1228
|
let failureReason;
|
|
1168
1229
|
if (exitCode !== 0 && this.errorTracker.hasErrors()) {
|
|
1169
1230
|
failureReason = this.errorTracker.buildFailureReason(exitCode ?? 1);
|
|
@@ -1186,6 +1247,7 @@ ${scrubSecrets(stderrOutput)}`);
|
|
|
1186
1247
|
try {
|
|
1187
1248
|
const json = JSON.parse(trimmed);
|
|
1188
1249
|
this.backgroundKeepalive.observe(json);
|
|
1250
|
+
this.usage.observe(json, this.model);
|
|
1189
1251
|
if (json.type === "result" && !this.backgroundKeepalive.holdInputForBackgroundWork(() => this.closeStdin())) {
|
|
1190
1252
|
this.closeStdin();
|
|
1191
1253
|
}
|
|
@@ -1231,6 +1293,10 @@ ${scrubSecrets(stderrOutput)}`);
|
|
|
1231
1293
|
async waitForCompletion() {
|
|
1232
1294
|
return this.completionPromise;
|
|
1233
1295
|
}
|
|
1296
|
+
finishInput() {
|
|
1297
|
+
this.backgroundKeepalive.stop();
|
|
1298
|
+
this.closeStdin();
|
|
1299
|
+
}
|
|
1234
1300
|
async abort() {
|
|
1235
1301
|
this.closeStdin();
|
|
1236
1302
|
try {
|
|
@@ -1274,7 +1340,7 @@ class ClaudeAdapter2 {
|
|
|
1274
1340
|
if (transport === "sdk" && isClaudeBridgeEffective(sourceEnv)) {
|
|
1275
1341
|
throw new Error("CLAUDE_TRANSPORT=sdk cannot run with an effective Claude Bridge configuration. Select CLI transport or disable the bridge.");
|
|
1276
1342
|
}
|
|
1277
|
-
const claudeSdk = transport === "sdk" ? await import("./claude-sdk-session-
|
|
1343
|
+
const claudeSdk = transport === "sdk" ? await import("./claude-sdk-session-c3g6dv0g.js") : undefined;
|
|
1278
1344
|
claudeSdk?.validateClaudeSdkAdditionalArgs([
|
|
1279
1345
|
...claudeBinaryArgv.slice(1),
|
|
1280
1346
|
...config.additionalArgs ?? []
|
|
@@ -1395,4 +1461,4 @@ ${stderr}`.trim();
|
|
|
1395
1461
|
}
|
|
1396
1462
|
}
|
|
1397
1463
|
|
|
1398
|
-
export { ClaudeBackgroundKeepalive, normalizeClaudeMessage, checkClaudeCredentials2, withClaudeRouteEnv2, cleanupTaskFile2, resolveClaudeBinaryArgv2, buildClaudeSessionEnvironment2, runClaudeSessionSummary2, ClaudeAdapter2 };
|
|
1464
|
+
export { ClaudeBackgroundKeepalive, ClaudeUsageAccumulator, normalizeClaudeMessage, checkClaudeCredentials2, withClaudeRouteEnv2, cleanupTaskFile2, resolveClaudeBinaryArgv2, buildClaudeSessionEnvironment2, runClaudeSessionSummary2, ClaudeAdapter2 };
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
addMcpServerConfig,
|
|
12
12
|
removeMcpServerConfig,
|
|
13
13
|
questionTerminal
|
|
14
|
-
} from "./cli-
|
|
14
|
+
} from "./cli-55fqpd9q.js";
|
|
15
15
|
import {
|
|
16
16
|
McpSignInCancelledError2,
|
|
17
17
|
McpOAuthCredentialStore2,
|
|
@@ -19,7 +19,7 @@ import {
|
|
|
19
19
|
McpServerLog2,
|
|
20
20
|
createDefaultTransport2,
|
|
21
21
|
McpServerConnection2
|
|
22
|
-
} from "./cli-
|
|
22
|
+
} from "./cli-y0q92v4r.js";
|
|
23
23
|
|
|
24
24
|
// node_modules/@earendil-works/pi-coding-agent/dist/extensions/mcp/cli.js
|
|
25
25
|
import { existsSync } from "node:fs";
|
|
@@ -15,24 +15,24 @@ import {
|
|
|
15
15
|
init_active_sessions,
|
|
16
16
|
getSteeringMessageById2,
|
|
17
17
|
init_db4
|
|
18
|
-
} from "./cli-
|
|
18
|
+
} from "./cli-e4gx499y.js";
|
|
19
19
|
import {
|
|
20
20
|
userHoldsExplicitVerb2,
|
|
21
21
|
getUserGrant2,
|
|
22
22
|
init_rbac_roles
|
|
23
|
-
} from "./cli-
|
|
23
|
+
} from "./cli-tjf1bh1v.js";
|
|
24
24
|
import {
|
|
25
25
|
hasSessionAccess,
|
|
26
26
|
getSessionRoot,
|
|
27
27
|
sessionAccessForRoot,
|
|
28
28
|
sessionAccess,
|
|
29
29
|
init_session_shares
|
|
30
|
-
} from "./cli-
|
|
30
|
+
} from "./cli-1gnf5c7x.js";
|
|
31
31
|
import {
|
|
32
32
|
findUserById,
|
|
33
33
|
findUserByExternalId,
|
|
34
34
|
init_users
|
|
35
|
-
} from "./cli-
|
|
35
|
+
} from "./cli-grk77aen.js";
|
|
36
36
|
import {
|
|
37
37
|
isGroupKey,
|
|
38
38
|
init_key
|
|
@@ -514,7 +514,7 @@ function route(def) {
|
|
|
514
514
|
try {
|
|
515
515
|
const rawBody = def.body ? await parseBody(req, def.maxBodyBytes) : undefined;
|
|
516
516
|
if (def.session && "bodyTaskIds" in def.session) {
|
|
517
|
-
const { bodySessionDenial } = await import("./session-access-
|
|
517
|
+
const { bodySessionDenial } = await import("./session-access-nz6nre4d.js");
|
|
518
518
|
const denial = await bodySessionDenial(req, def.session.bodyTaskIds(rawBody));
|
|
519
519
|
if (denial) {
|
|
520
520
|
jsonError(res, denial, 403);
|
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ampPinProviderError,
|
|
3
|
+
ampPinCatalogError,
|
|
4
|
+
ampModelError,
|
|
5
|
+
init_amp_models
|
|
6
|
+
} from "./cli-rfejbpe1.js";
|
|
1
7
|
import {
|
|
2
8
|
ALL_TOOLS,
|
|
3
9
|
init_tool_config
|
|
@@ -22,12 +28,6 @@ import {
|
|
|
22
28
|
getGitHubHostForSql,
|
|
23
29
|
init_github_host
|
|
24
30
|
} from "./cli-9ttx00s3.js";
|
|
25
|
-
import {
|
|
26
|
-
ampPinProviderError,
|
|
27
|
-
ampPinCatalogError,
|
|
28
|
-
ampModelError,
|
|
29
|
-
init_amp_models
|
|
30
|
-
} from "./cli-rfejbpe1.js";
|
|
31
31
|
import {
|
|
32
32
|
init_templates4,
|
|
33
33
|
generateDefaultClaudeMd2,
|
|
@@ -42,7 +42,7 @@ import {
|
|
|
42
42
|
init_identity_field_budget,
|
|
43
43
|
contentSha256,
|
|
44
44
|
init_profile_sync
|
|
45
|
-
} from "./cli-
|
|
45
|
+
} from "./cli-aytna2fm.js";
|
|
46
46
|
import {
|
|
47
47
|
isSlackConfigured,
|
|
48
48
|
init_config4
|
|
@@ -54,7 +54,7 @@ import {
|
|
|
54
54
|
import {
|
|
55
55
|
kindForModelString,
|
|
56
56
|
init_models2
|
|
57
|
-
} from "./cli-
|
|
57
|
+
} from "./cli-jjzxsk47.js";
|
|
58
58
|
import {
|
|
59
59
|
SUBSCRIPTION_KEY_TYPES,
|
|
60
60
|
planAllowsModelFamily,
|
|
@@ -71,10 +71,6 @@ import {
|
|
|
71
71
|
selectCredential,
|
|
72
72
|
init_credentials2
|
|
73
73
|
} from "./cli-5basv0e7.js";
|
|
74
|
-
import {
|
|
75
|
-
getOpenRouterAttributionHeaders,
|
|
76
|
-
init_openrouter_base_url
|
|
77
|
-
} from "./cli-dfyv0jdy.js";
|
|
78
74
|
import {
|
|
79
75
|
registerTemplate,
|
|
80
76
|
getAllTemplateDefinitions,
|
|
@@ -82,7 +78,11 @@ import {
|
|
|
82
78
|
configureDbResolver,
|
|
83
79
|
init_resolver,
|
|
84
80
|
init_session_templates
|
|
85
|
-
} from "./cli-
|
|
81
|
+
} from "./cli-b768ek79.js";
|
|
82
|
+
import {
|
|
83
|
+
getOpenRouterAttributionHeaders,
|
|
84
|
+
init_openrouter_base_url
|
|
85
|
+
} from "./cli-dfyv0jdy.js";
|
|
86
86
|
import {
|
|
87
87
|
normalizeAssetKey,
|
|
88
88
|
defaultAssetKey,
|
|
@@ -153,7 +153,7 @@ import {
|
|
|
153
153
|
import {
|
|
154
154
|
init_package,
|
|
155
155
|
package_default
|
|
156
|
-
} from "./cli-
|
|
156
|
+
} from "./cli-sy2ge2ye.js";
|
|
157
157
|
import {
|
|
158
158
|
getNodeEnv,
|
|
159
159
|
init_node_env
|
|
@@ -5702,7 +5702,7 @@ var init_telemetry = __esm(() => {
|
|
|
5702
5702
|
// src/telemetry-identity.ts
|
|
5703
5703
|
async function loadUserRole(userId) {
|
|
5704
5704
|
try {
|
|
5705
|
-
const { getUserGrant } = await import("./rbac-roles-
|
|
5705
|
+
const { getUserGrant } = await import("./rbac-roles-yd1fgpsn.js");
|
|
5706
5706
|
const grant = await getUserGrant(userId);
|
|
5707
5707
|
const role = grant.grantsAll ? "admin" : "member";
|
|
5708
5708
|
const user = await getDbClient2().get("SELECT json_extract(metadata, '$.jobFunction') AS jobFunction FROM users WHERE id = ? AND json_valid(metadata)", [userId]);
|
|
@@ -6590,7 +6590,7 @@ function scheduleApprovalCardUpdates(approvals) {
|
|
|
6590
6590
|
const posted = approvals.filter((approval) => approval.notificationChannels?.some((n) => n.channel === "slack" && n.messageTs));
|
|
6591
6591
|
if (posted.length === 0)
|
|
6592
6592
|
return;
|
|
6593
|
-
getDbClient2().afterCommit(() => import("./approval-notifications-
|
|
6593
|
+
getDbClient2().afterCommit(() => import("./approval-notifications-evc1a9z5.js").then(({ updateResolvedApprovalCards }) => updateResolvedApprovalCards(posted)).catch((err) => console.error("[HITL] Slack card update not run:", scrubSecrets(err instanceof Error ? err.message : String(err)))));
|
|
6594
6594
|
}
|
|
6595
6595
|
var init_approvals = __esm(() => {
|
|
6596
6596
|
init_secret_scrubber();
|
|
@@ -6971,6 +6971,7 @@ var init_legacy_policy = __esm(() => {
|
|
|
6971
6971
|
"script.global.write": leadOnly,
|
|
6972
6972
|
"script.global.delete": leadOnly,
|
|
6973
6973
|
"script.search": anyAuthenticated,
|
|
6974
|
+
"script.run": anyAuthenticated,
|
|
6974
6975
|
"script.api.read.secrets": leadOnly,
|
|
6975
6976
|
"script.api.create": leadOnly,
|
|
6976
6977
|
"script.api.update": leadOnly,
|
|
@@ -7365,6 +7366,10 @@ var init_permissions = __esm(() => {
|
|
|
7365
7366
|
description: "Search reusable scripts visible to the caller.",
|
|
7366
7367
|
namespace: "script"
|
|
7367
7368
|
},
|
|
7369
|
+
"script.run": {
|
|
7370
|
+
description: "Run a global or inline script as yourself from the user MCP.",
|
|
7371
|
+
namespace: "script"
|
|
7372
|
+
},
|
|
7368
7373
|
"script.api.read.secrets": {
|
|
7369
7374
|
description: "Reveal an external script API endpoint bearer token.",
|
|
7370
7375
|
namespace: "script"
|
|
@@ -12593,7 +12598,7 @@ async function cancelTask2(id, reason, options = {}) {
|
|
|
12593
12598
|
if (row.source === "schedule" && row.taskType === "deferred" && row.parentTaskId) {
|
|
12594
12599
|
getDbClient2().afterCommit(async () => {
|
|
12595
12600
|
try {
|
|
12596
|
-
const { createWorkerTaskFollowUp } = await import("./worker-follow-up-
|
|
12601
|
+
const { createWorkerTaskFollowUp } = await import("./worker-follow-up-dyfxyjbj.js");
|
|
12597
12602
|
await createWorkerTaskFollowUp({
|
|
12598
12603
|
task: rowToAgentTask(row),
|
|
12599
12604
|
status: "failed",
|
|
@@ -13599,7 +13604,7 @@ function forbiddenKeyIssues(value, ctx) {
|
|
|
13599
13604
|
}
|
|
13600
13605
|
}
|
|
13601
13606
|
function adapterSchema(shape) {
|
|
13602
|
-
return looseObject({ ...
|
|
13607
|
+
return looseObject({ ...COMMON_SHAPE, ...shape }).superRefine(forbiddenKeyIssues);
|
|
13603
13608
|
}
|
|
13604
13609
|
function draftShape(shape) {
|
|
13605
13610
|
return Object.fromEntries(Object.entries(shape).map(([key, field]) => [key, field.optional()]));
|
|
@@ -13648,15 +13653,22 @@ function validateChatSdkAdaptersValue(value) {
|
|
|
13648
13653
|
const result = ChatSdkAdaptersDraftSchema.safeParse(parsed);
|
|
13649
13654
|
return result.success ? null : firstIssueText(result.error);
|
|
13650
13655
|
}
|
|
13651
|
-
var CHAT_SDK_ADAPTER_NAMES, ConfigRefSchema, Str, FORBIDDEN_ADAPTER_KEYS, COMMON_SHAPE, TELEGRAM_SHAPE, SLACK_SHAPE, TelegramAdapterSchema, SlackAdapterSchema, DISCORD_PUBLIC_KEY_PATTERN, DISCORD_SHAPE, DiscordAdapterSchema, TEAMS_SHAPE, TeamsAdapterSchema, ChatSdkAdaptersSchema, CHAT_SDK_ADAPTER_SCHEMAS, ChatSdkAdaptersDraftSchema, CHAT_SDK_ADAPTER_FIELDS;
|
|
13656
|
+
var CHAT_SDK_ADAPTER_NAMES, ConfigRefSchema, Str, FORBIDDEN_ADAPTER_KEYS, COMMON_SHAPE, TELEGRAM_SHAPE, SLACK_SHAPE, TelegramAdapterSchema, SlackAdapterSchema, DISCORD_PUBLIC_KEY_PATTERN, DISCORD_SHAPE, DiscordAdapterSchema, TEAMS_SHAPE, TeamsAdapterSchema, ROCKETCHAT_SHAPE, RocketchatAdapterSchema, ChatSdkAdaptersSchema, CHAT_SDK_ADAPTER_SCHEMAS, ChatSdkAdaptersDraftSchema, CHAT_SDK_ADAPTER_FIELDS;
|
|
13652
13657
|
var init_schema = __esm(() => {
|
|
13653
13658
|
init_zod();
|
|
13654
|
-
CHAT_SDK_ADAPTER_NAMES = [
|
|
13659
|
+
CHAT_SDK_ADAPTER_NAMES = [
|
|
13660
|
+
"telegram",
|
|
13661
|
+
"slack",
|
|
13662
|
+
"discord",
|
|
13663
|
+
"teams",
|
|
13664
|
+
"rocketchat"
|
|
13665
|
+
];
|
|
13655
13666
|
ConfigRefSchema = strictObject2({ $config: string2().min(1) });
|
|
13656
13667
|
Str = union3([string2().trim().min(1), ConfigRefSchema]);
|
|
13657
13668
|
FORBIDDEN_ADAPTER_KEYS = [
|
|
13658
13669
|
"apiUrl",
|
|
13659
13670
|
"apiBaseUrl",
|
|
13671
|
+
"baseUrl",
|
|
13660
13672
|
"webhookVerifier",
|
|
13661
13673
|
"allowUnverifiedWebhooks"
|
|
13662
13674
|
];
|
|
@@ -13718,29 +13730,40 @@ var init_schema = __esm(() => {
|
|
|
13718
13730
|
});
|
|
13719
13731
|
}
|
|
13720
13732
|
});
|
|
13733
|
+
ROCKETCHAT_SHAPE = {
|
|
13734
|
+
token: Str,
|
|
13735
|
+
botUserId: Str,
|
|
13736
|
+
webhookToken: Str,
|
|
13737
|
+
userName: Str
|
|
13738
|
+
};
|
|
13739
|
+
RocketchatAdapterSchema = adapterSchema(ROCKETCHAT_SHAPE);
|
|
13721
13740
|
ChatSdkAdaptersSchema = strictObject2({
|
|
13722
13741
|
telegram: TelegramAdapterSchema,
|
|
13723
13742
|
slack: SlackAdapterSchema,
|
|
13724
13743
|
discord: DiscordAdapterSchema,
|
|
13725
|
-
teams: TeamsAdapterSchema
|
|
13744
|
+
teams: TeamsAdapterSchema,
|
|
13745
|
+
rocketchat: RocketchatAdapterSchema
|
|
13726
13746
|
}).partial();
|
|
13727
13747
|
CHAT_SDK_ADAPTER_SCHEMAS = {
|
|
13728
13748
|
telegram: TelegramAdapterSchema,
|
|
13729
13749
|
slack: SlackAdapterSchema,
|
|
13730
13750
|
discord: DiscordAdapterSchema,
|
|
13731
|
-
teams: TeamsAdapterSchema
|
|
13751
|
+
teams: TeamsAdapterSchema,
|
|
13752
|
+
rocketchat: RocketchatAdapterSchema
|
|
13732
13753
|
};
|
|
13733
13754
|
ChatSdkAdaptersDraftSchema = strictObject2({
|
|
13734
13755
|
telegram: adapterSchema(draftShape(TELEGRAM_SHAPE)),
|
|
13735
13756
|
slack: adapterSchema(draftShape(SLACK_SHAPE)),
|
|
13736
13757
|
discord: adapterSchema(draftShape(DISCORD_SHAPE)).superRefine(discordPublicKeyIssue),
|
|
13737
|
-
teams: adapterSchema(draftShape(TEAMS_SHAPE))
|
|
13758
|
+
teams: adapterSchema(draftShape(TEAMS_SHAPE)),
|
|
13759
|
+
rocketchat: adapterSchema(draftShape(ROCKETCHAT_SHAPE))
|
|
13738
13760
|
}).partial();
|
|
13739
13761
|
CHAT_SDK_ADAPTER_FIELDS = {
|
|
13740
13762
|
telegram: formFields(TelegramAdapterSchema.shape),
|
|
13741
13763
|
slack: formFields(SlackAdapterSchema.shape),
|
|
13742
13764
|
discord: formFields(DiscordAdapterSchema.shape),
|
|
13743
|
-
teams: formFields(TeamsAdapterSchema.shape)
|
|
13765
|
+
teams: formFields(TeamsAdapterSchema.shape),
|
|
13766
|
+
rocketchat: formFields(RocketchatAdapterSchema.shape)
|
|
13744
13767
|
};
|
|
13745
13768
|
});
|
|
13746
13769
|
|
|
@@ -23135,7 +23158,7 @@ function noteEmbeddingSuccess() {
|
|
|
23135
23158
|
const report = (what) => (err) => {
|
|
23136
23159
|
console.error(`[memory] ${what} backfill after embeddings recovered failed:`, err.message);
|
|
23137
23160
|
};
|
|
23138
|
-
backfill2 = import("./embedding-space-
|
|
23161
|
+
backfill2 = import("./embedding-space-yam9zwzj.js").then(({ runEmbeddingMaintenance }) => runEmbeddingMaintenance({ backfill: true })).catch(report("Embedding")).finally(() => {
|
|
23139
23162
|
backfill2 = null;
|
|
23140
23163
|
});
|
|
23141
23164
|
}
|
|
@@ -25704,7 +25727,7 @@ async function loadSecretRegistry() {
|
|
|
25704
25727
|
result.failed += 1;
|
|
25705
25728
|
}
|
|
25706
25729
|
try {
|
|
25707
|
-
const { loadRuntimeControllerSecrets } = await import("./db-
|
|
25730
|
+
const { loadRuntimeControllerSecrets } = await import("./db-0ezhdhz5.js");
|
|
25708
25731
|
const loaded = await loadRuntimeControllerSecrets();
|
|
25709
25732
|
result.runtimeController = loaded.count;
|
|
25710
25733
|
result.failed += loaded.failed;
|
|
@@ -25865,7 +25888,7 @@ async function requestSteering(args) {
|
|
|
25865
25888
|
}
|
|
25866
25889
|
const requestedMode = args.mode ?? "queue";
|
|
25867
25890
|
const onUnsupported = args.onUnsupported ?? "degrade";
|
|
25868
|
-
const { dispatchPre, extensionIdForAgent } = await import("./dispatcher-
|
|
25891
|
+
const { dispatchPre, extensionIdForAgent } = await import("./dispatcher-h2rz69f6.js");
|
|
25869
25892
|
const preSteer = await dispatchPre("pre.task.steer", {
|
|
25870
25893
|
task,
|
|
25871
25894
|
message: args.message,
|
|
@@ -29925,7 +29948,7 @@ async function deleteScheduledTask2(id) {
|
|
|
29925
29948
|
const parent = await getTaskById2(deferred.parentTaskId);
|
|
29926
29949
|
if (!parent?.deferredAt)
|
|
29927
29950
|
return;
|
|
29928
|
-
const { createWorkerTaskFollowUp } = await import("./worker-follow-up-
|
|
29951
|
+
const { createWorkerTaskFollowUp } = await import("./worker-follow-up-dyfxyjbj.js");
|
|
29929
29952
|
await createWorkerTaskFollowUp({
|
|
29930
29953
|
task: parent,
|
|
29931
29954
|
status: "failed",
|
|
@@ -34324,7 +34347,7 @@ var init_db4 = __esm(() => {
|
|
|
34324
34347
|
configureAgentDependencies({
|
|
34325
34348
|
createLogEntry: (entry) => createLogEntry2(entry),
|
|
34326
34349
|
installSystemDefaultSkillsForAgent: (agentId) => installSystemDefaultSkillsForAgent2(agentId),
|
|
34327
|
-
resolvePendingImportAssignments: async (agent) => (await import("./pending-
|
|
34350
|
+
resolvePendingImportAssignments: async (agent) => (await import("./pending-vkk0vx6n.js")).resolvePendingImportAssignments(agent)
|
|
34328
34351
|
});
|
|
34329
34352
|
configureTaskWriteDependencies({
|
|
34330
34353
|
createLogEntry: (...args) => createLogEntry2(...args),
|