@desplega.ai/agent-swarm 2.0.0 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{acp-adapter-sj2g0m84.js → acp-adapter-kr4abrsk.js} +10 -10
- package/dist/{actions-fegk44gr.js → actions-eh4g6w2r.js} +27 -27
- package/dist/{amp-adapter-ad8ft89x.js → amp-adapter-7h7wdt8q.js} +5 -5
- package/dist/{app-kfvgbvzy.js → app-7k8s9w5p.js} +9 -9
- package/dist/{assistant-z7zdy9ja.js → assistant-wswt2y7p.js} +28 -28
- package/dist/{boot-reembed-j8xa181e.js → boot-reembed-9apm9qw6.js} +7 -7
- package/dist/{boot-reembed-5c2z0mbe.js → boot-reembed-whzbdthj.js} +7 -7
- package/dist/{boot-scrub-sweep-hnkn3rgt.js → boot-scrub-sweep-ndzmvmgt.js} +8 -8
- package/dist/{boot-seeds-kwjq4d2z.js → boot-seeds-e9sta0yt.js} +13 -11
- package/dist/{claude-adapter-9vmvpvgd.js → claude-adapter-4mqd3r6r.js} +11 -11
- package/dist/{claude-managed-adapter-k9qae05j.js → claude-managed-adapter-9wswb52m.js} +3 -3
- package/dist/{claude-managed-setup-q54zx5q2.js → claude-managed-setup-tpe1effx.js} +4 -4
- package/dist/{claude-sdk-session-9jye6cxr.js → claude-sdk-session-q49ghmh9.js} +10340 -10197
- package/dist/{cli-ke896fcf.js → cli-01xvj1rq.js} +10 -10
- package/dist/{cli-tr4sxp68.js → cli-035vekcw.js} +2 -2
- package/dist/{cli-z5jjpaxw.js → cli-0pd8hzhc.js} +3 -3
- package/dist/{cli-n5vwg842.js → cli-0veb92a3.js} +6 -1
- package/dist/{cli-wayw93nt.js → cli-10jesr25.js} +3 -3
- package/dist/{cli-se8w6wny.js → cli-1y7yywmj.js} +1 -1
- package/dist/{cli-v1yb0rqb.js → cli-20krdhz5.js} +47 -19
- package/dist/{cli-d5f9ed5c.js → cli-29rja109.js} +39 -20
- package/dist/{cli-apx87jne.js → cli-2pwa0q4d.js} +15 -4
- package/dist/{cli-ee9gtz70.js → cli-4mengw46.js} +348 -25
- package/dist/{cli-03gedhng.js → cli-5twdke5x.js} +6 -6
- package/dist/{cli-6razj6t4.js → cli-711vwbxn.js} +2 -2
- package/dist/{cli-s2sp957d.js → cli-78vv7446.js} +1 -1
- package/dist/{cli-3fbmmawm.js → cli-7n6s5man.js} +4 -4
- package/dist/{cli-hnhtk6cj.js → cli-8wwxw8a3.js} +1 -1
- package/dist/{cli-hnmhtzvh.js → cli-9jzdj90z.js} +2 -0
- package/dist/{cli-skxvvpap.js → cli-cvv9k0hh.js} +28 -25
- package/dist/{cli-74ahz61x.js → cli-d9286m9h.js} +2 -2
- package/dist/{cli-4jxm2qtz.js → cli-gxzkg1de.js} +28 -16
- package/dist/{cli-zkpks3r3.js → cli-h1arqn31.js} +1 -1
- package/dist/{cli-r62a35ea.js → cli-hqr88ew6.js} +1 -1
- package/dist/{cli-ra0xzggj.js → cli-j67mh2vg.js} +2 -2
- package/dist/{cli-29jc5q7w.js → cli-ksphgh48.js} +2 -2
- package/dist/{cli-eejsgvm4.js → cli-mgz4nbgg.js} +4 -4
- package/dist/{cli-vatyhshy.js → cli-mz5as5ha.js} +4 -4
- package/dist/{cli-f7kr7svz.js → cli-n8ndw8j7.js} +2 -2
- package/dist/{cli-1e4b6bzh.js → cli-naqzr17j.js} +7 -7
- package/dist/{cli-q0ke1yww.js → cli-nm1p8jfr.js} +6 -6
- package/dist/{cli-m50t4309.js → cli-p3zbc1rw.js} +5 -5
- package/dist/{cli-cgtksawx.js → cli-pe05f8yk.js} +23 -3
- package/dist/{cli-vdach5a9.js → cli-qmzsbkvy.js} +4 -4
- package/dist/{cli-n3hzg89b.js → cli-qnm4e9e4.js} +57 -579
- package/dist/{cli-s4setq91.js → cli-qqy4q48b.js} +3 -3
- package/dist/{cli-k382tshb.js → cli-r35rw5de.js} +8 -7
- package/dist/{cli-k3dp5tpf.js → cli-r610p9bs.js} +2 -2
- package/dist/{cli-e6mpjhed.js → cli-rc6pf5kv.js} +1 -1
- package/dist/{cli-3dj8k4vy.js → cli-rdxm77k3.js} +1 -1
- package/dist/{cli-tqaazemc.js → cli-s69nfyeh.js} +1 -1
- package/dist/{cli-6jyj59nb.js → cli-sawv63e8.js} +2 -2
- package/dist/{cli-q50942rs.js → cli-sg19gbf0.js} +1 -1
- package/dist/{cli-p1x85d2t.js → cli-shk7r5cs.js} +12 -9
- package/dist/{cli-przpmdgr.js → cli-sksetb2q.js} +11 -1
- package/dist/{cli-d2qr7aj4.js → cli-t02z59f2.js} +1 -1
- package/dist/{cli-j0pfptdp.js → cli-v7g551te.js} +39 -43
- package/dist/{cli-bzszjf2p.js → cli-vgqzp4em.js} +519 -126
- package/dist/cli-wfnemr1t.js +86 -0
- package/dist/{cli-ne236afy.js → cli-wms6x9db.js} +8 -8
- package/dist/{cli-5hkm7whv.js → cli-x1r545x8.js} +1 -1
- package/dist/{cli-kt6zqg0e.js → cli-xczsgshn.js} +2 -2
- package/dist/{cli-ef1hg1wv.js → cli-y3167wt1.js} +430 -238
- package/dist/{cli-tsde1hdr.js → cli-yjmqpxt3.js} +12 -11
- package/dist/{cli-9nfx44eh.js → cli-z780ec7c.js} +1 -1
- package/dist/{cli-r2pnvj8g.js → cli-zm9t2vde.js} +2 -2
- package/dist/cli.js +24 -23
- package/dist/{codex-adapter-y81sssk0.js → codex-adapter-4z16v9n0.js} +8 -8
- package/dist/{codex-login-f2rcfpp9.js → codex-login-pkepy2j1.js} +2 -2
- package/dist/{codex-session-runner-8vx4j6a9.js → codex-session-runner-rvms9y2x.js} +8 -8
- package/dist/{commands-kcpvpcrr.js → commands-2a9rtyat.js} +8 -8
- package/dist/{controller-ywrmt6yd.js → controller-3k3madbn.js} +4 -4
- package/dist/{controllers-connect-kwpvj3rf.js → controllers-connect-v9yn8zb9.js} +30 -30
- package/dist/{cursor-adapter-cehv1qns.js → cursor-adapter-98gbhyzn.js} +4 -4
- package/dist/{db-ww5d7jq3.js → db-eywwsnjw.js} +9 -7
- package/dist/{db-k8ankj20.js → db-ncypk9np.js} +9 -9
- package/dist/{devin-adapter-x1022qb1.js → devin-adapter-zeq8b9gz.js} +2 -2
- package/dist/{dispatcher-e8gq5m68.js → dispatcher-w94kc575.js} +26 -26
- package/dist/{docker-ff6y1190.js → docker-b1e4cqab.js} +2 -2
- package/dist/{dsh-adapter-3epjm3af.js → dsh-adapter-47ztej36.js} +4 -4
- package/dist/{e2b-8ygwhg0f.js → e2b-bbt8ey45.js} +3 -3
- package/dist/{e2b-swhnpw3n.js → e2b-dp804sen.js} +3 -3
- package/dist/{event-bus-6axnngdj.js → event-bus-j2jdg3qb.js} +2 -2
- package/dist/{external-channel-h3359cwn.js → external-channel-zrkg8ar9.js} +8 -8
- package/dist/{grok-adapter-0d4x7gkx.js → grok-adapter-s9ncp9vy.js} +11 -11
- package/dist/{handlers-an1gzv21.js → handlers-kqftvjgw.js} +29 -29
- package/dist/{heartbeat-6dakeb61.js → heartbeat-9q96p8v9.js} +31 -31
- package/dist/{hook-6v6cv6d5.js → hook-56qe10dp.js} +7 -7
- package/dist/{hook-sa5xye4y.js → hook-yy6rw42k.js} +8 -8
- package/dist/{http-r7f3eky0.js → http-r2dnb8f8.js} +963 -75
- package/dist/{index-7ep4gzdk.js → index-3gtmkhc6.js} +26 -26
- package/dist/{index-v1v6n7hg.js → index-3k5hkz7r.js} +31 -31
- package/dist/{index-rmpw9a8q.js → index-5e101240.js} +26 -26
- package/dist/{index-s2wxgzr0.js → index-5wyfjc2c.js} +392 -15
- package/dist/{index-zk96aq1k.js → index-vxvhxxbn.js} +7 -7
- package/dist/{keepalive-be9vwy5h.js → keepalive-psj6j54c.js} +9 -9
- package/dist/{lead-0861cwrf.js → lead-hajz4688.js} +43 -43
- package/dist/{maintenance-mzzgc8bn.js → maintenance-ps02sb5m.js} +7 -7
- package/dist/{node-mn1zs7an.js → node-mwb5r697.js} +1 -1
- package/dist/{oauth-refresh-sweep-cpdnfwdj.js → oauth-refresh-sweep-0284h93b.js} +8 -8
- package/dist/{onboard-fh8qs4r3.js → onboard-rbf6bg01.js} +2 -2
- package/dist/{opencode-adapter-nm42wwj8.js → opencode-adapter-13dcatgq.js} +8 -8
- package/dist/{otel-impl-x6c1c9g4.js → otel-impl-zvqcbhp7.js} +2 -2
- package/dist/{pi-mono-adapter-9n2ya240.js → pi-mono-adapter-xxy47q4v.js} +7 -7
- package/dist/{pricing-refresh-qb0rv0ap.js → pricing-refresh-kefx9v3t.js} +9 -9
- package/dist/{rbac-roles-1gzdwbh1.js → rbac-roles-3m36rxm2.js} +8 -8
- package/dist/{rbac-roles-3mraey52.js → rbac-roles-z76xv0hq.js} +9 -9
- package/dist/{render-v2-agpa45zz.js → render-v2-wz73bs25.js} +9 -9
- package/dist/{resume-x0ydy9s9.js → resume-k4wzge8w.js} +14 -14
- package/dist/{setup-as9ga0d6.js → setup-2fp2pypp.js} +2 -2
- package/dist/{work-objects-y5g1y7ev.js → work-objects-6k0ywz3m.js} +29 -29
- package/dist/{worker-860c3e38.js → worker-5v3rxsdh.js} +43 -43
- package/dist/{x-m477fr0h.js → x-4mtdeym1.js} +2 -2
- package/openapi.json +777 -6
- package/package.json +8 -7
- package/src/agentmail/handlers.ts +21 -11
- package/src/apps/definition.ts +16 -0
- package/src/azure-devops/api.ts +52 -2
- package/src/azure-devops/boards-sync.ts +50 -20
- package/src/azure-devops/index.ts +1 -0
- package/src/azure-devops/outbound.ts +95 -0
- package/src/be/boot-seeds.ts +11 -0
- package/src/be/db/model-profiles.ts +315 -0
- package/src/be/db/tasks/read.ts +7 -0
- package/src/be/db.ts +53 -47
- package/src/be/migrations/219_relabel_pi_context_compactions.sql +22 -0
- package/src/be/migrations/220_model_profiles.sql +137 -0
- package/src/be/model-tier-resolution.ts +145 -11
- package/src/be/model-validation.ts +8 -1
- package/src/be/scripts/typecheck.ts +12 -0
- package/src/be/secret-registry.ts +6 -2
- package/src/be/seed-model-profiles.ts +41 -0
- package/src/be/seed-scripts/catalog/heartbeat-jev-gate.ts +368 -0
- package/src/be/seed-scripts/index.ts +9 -0
- package/src/be/swarm-config-guard.ts +1 -0
- package/src/commands/runner.ts +3 -17
- package/src/extensions/catalog.generated.json +17 -0
- package/src/extensions/contract-types.generated.ts +1 -1
- package/src/extensions/loader.ts +10 -5
- package/src/heartbeat/heartbeat.ts +2 -1
- package/src/http/agents.ts +49 -2
- package/src/http/all-routes.ts +1 -0
- package/src/http/apps.ts +30 -3
- package/src/http/config.ts +26 -2
- package/src/http/core.ts +4 -0
- package/src/http/index.ts +11 -1
- package/src/http/model-profiles.ts +303 -0
- package/src/http/pages-public.ts +11 -5
- package/src/http/poll.ts +16 -5
- package/src/http/script-runs.ts +1 -1
- package/src/http/scripts.ts +25 -2
- package/src/http/tasks.ts +18 -0
- package/src/http/webhooks.ts +1 -2
- package/src/pages/feedback-overlay.ts +65 -6
- package/src/providers/acp-targets.ts +1 -1
- package/src/providers/amp-adapter.ts +1 -1
- package/src/providers/dsh-adapter.ts +1 -1
- package/src/providers/pi-mono-extension.ts +17 -3
- package/src/providers/reasoning-effort.ts +10 -0
- package/src/rbac/legacy-policy.ts +8 -0
- package/src/rbac/permissions.ts +5 -0
- package/src/scheduler/deferred-task-waits.ts +18 -5
- package/src/scheduler/scheduler.ts +7 -1
- package/src/scripts-runtime/executors/quickjs-prelude.ts +75 -6
- package/src/scripts-runtime/executors/quickjs-runner.ts +85 -8
- package/src/scripts-runtime/executors/quickjs-web-shims.ts +1041 -0
- package/src/scripts-runtime/extract-args-schema.ts +9 -8
- package/src/scripts-runtime/quickjs-compat.ts +464 -0
- package/src/scripts-runtime/sdk-allowlist.ts +4 -0
- package/src/scripts-runtime/types/stdlib.d.ts +12 -0
- package/src/scripts-runtime/types/swarm-extension.d.ts +3 -0
- package/src/scripts-runtime/types/swarm-sdk.d.ts +12 -0
- package/src/server.ts +10 -1
- package/src/slack/blocks.ts +4 -2
- package/src/slack/reaction-shortcode.ts +14 -0
- package/src/slack/render-v2.ts +12 -7
- package/src/slack/responses.ts +5 -4
- package/src/slack/thread-buffer.ts +41 -22
- package/src/tasks/worker-follow-up.ts +11 -2
- package/src/tests/agentmail-filters.test.ts +47 -0
- package/src/tests/apps-spike2.test.ts +35 -0
- package/src/tests/azure-devops-outbound.test.ts +420 -0
- package/src/tests/db-task-read-contract.test.ts +2 -0
- package/src/tests/db-task-write-contract.test.ts +1 -0
- package/src/tests/deferred-task-wake.test.ts +78 -1
- package/src/tests/docs-index-footprint.test.js +2 -2
- package/src/tests/dsh-adapter.test.ts +1 -1
- package/src/tests/env-flag.test.ts +1 -0
- package/src/tests/extensions-catalog.test.ts +1 -0
- package/src/tests/extensions-example-comms-adherence-gate.test.ts +413 -0
- package/src/tests/extensions-loader.test.ts +15 -0
- package/src/tests/heartbeat-jev-gate-credentials.test.ts +168 -0
- package/src/tests/heartbeat-jev-gate.test.ts +385 -0
- package/src/tests/model-profile-backcompat.test.ts +327 -0
- package/src/tests/model-profile-providers.test.ts +302 -0
- package/src/tests/model-profile-runtime-secrets.test.ts +223 -0
- package/src/tests/model-profiles-api.test.ts +614 -0
- package/src/tests/pages-feedback-keys.test.ts +121 -0
- package/src/tests/pages-feedback.test.ts +3 -0
- package/src/tests/pi-context-compaction.test.ts +193 -0
- package/src/tests/profile-claim.test.ts +269 -0
- package/src/tests/quickjs-compat.test.ts +213 -0
- package/src/tests/rbac-engine.test.ts +21 -0
- package/src/tests/script-connections.test.ts +4 -0
- package/src/tests/script-executor-conformance.test.ts +252 -1
- package/src/tests/script-executor-quickjs.test.ts +96 -0
- package/src/tests/script-runs-http.test.ts +89 -0
- package/src/tests/scripts-http.test.ts +16 -0
- package/src/tests/secret-scrubber.test.ts +10 -0
- package/src/tests/seed-model-profiles.test.ts +174 -0
- package/src/tests/seed-scripts.test.ts +2 -2
- package/src/tests/skill-invocations.test.ts +4 -2
- package/src/tests/slack-blocks.test.ts +36 -0
- package/src/tests/slack-inline-output.test.ts +14 -0
- package/src/tests/slack-reaction-config.test.ts +20 -0
- package/src/tests/slack-render-v2.test.ts +37 -0
- package/src/tests/slack-thread-buffer.test.ts +98 -1
- package/src/tests/workflow-llm.test.ts +61 -0
- package/src/tools/model-profiles/list-model-profiles.ts +54 -0
- package/src/tools/request-human-input.ts +11 -3
- package/src/tools/script-apis.ts +5 -1
- package/src/tools/script-upsert.ts +4 -1
- package/src/tools/send-task.ts +24 -1
- package/src/tools/system-one-decide.ts +104 -0
- package/src/tools/task-action.ts +22 -1
- package/src/tools/tool-config.ts +6 -0
- package/src/types.ts +36 -1
- package/src/utils/secret-scrubber.ts +19 -12
- package/src/utils/vcs-repo-match.ts +29 -0
- package/src/workflows/executors/raw-llm.ts +8 -3
- package/src/workflows/executors/system-one-decision.ts +21 -11
- package/src/workflows/executors/workflow-llm.ts +22 -0
- package/src/workflows/index.ts +21 -12
- package/templates/extensions/README.md +1 -0
- package/templates/extensions/comms-adherence-gate/README.md +88 -0
- package/templates/extensions/comms-adherence-gate/hooks.ts +489 -0
- package/templates/extensions/comms-adherence-gate/manifest.json +8 -0
- package/dist/cli-5t4f29ez.js +0 -33
|
@@ -2,12 +2,12 @@ import {
|
|
|
2
2
|
COMPOSIO_HTTP_METHODS,
|
|
3
3
|
composioArgsFromParts,
|
|
4
4
|
executeComposioRequest
|
|
5
|
-
} from "./cli-
|
|
5
|
+
} from "./cli-h1arqn31.js";
|
|
6
6
|
import {
|
|
7
7
|
ampModelError,
|
|
8
8
|
ampPinCatalogError,
|
|
9
9
|
ampPinProviderError
|
|
10
|
-
} from "./cli-
|
|
10
|
+
} from "./cli-8wwxw8a3.js";
|
|
11
11
|
import {
|
|
12
12
|
LlmRater,
|
|
13
13
|
REFERENCES_SOURCE_MAX_LENGTH,
|
|
@@ -26,7 +26,7 @@ import {
|
|
|
26
26
|
requestModelCatalogRefresh,
|
|
27
27
|
startPricingRefreshLoop,
|
|
28
28
|
upsertModelCatalogOverlay
|
|
29
|
-
} from "./cli-
|
|
29
|
+
} from "./cli-0pd8hzhc.js";
|
|
30
30
|
import {
|
|
31
31
|
AppDefinitionSchema,
|
|
32
32
|
AppElementsSchema,
|
|
@@ -74,6 +74,7 @@ import {
|
|
|
74
74
|
runSavedScriptAsAgent,
|
|
75
75
|
runScript,
|
|
76
76
|
sandboxSpawnEnv,
|
|
77
|
+
scriptCompatWarnings,
|
|
77
78
|
setScriptConnectionEnabled,
|
|
78
79
|
snapshotCapped,
|
|
79
80
|
typecheckScript,
|
|
@@ -83,7 +84,7 @@ import {
|
|
|
83
84
|
upsertScriptConnection,
|
|
84
85
|
validateScriptImports,
|
|
85
86
|
writeBareImportShim
|
|
86
|
-
} from "./cli-
|
|
87
|
+
} from "./cli-4mengw46.js";
|
|
87
88
|
import {
|
|
88
89
|
detachedProcessGroup,
|
|
89
90
|
registerProcessGroup,
|
|
@@ -95,14 +96,15 @@ import {
|
|
|
95
96
|
ensureToken,
|
|
96
97
|
ensureTokenOrThrow,
|
|
97
98
|
onAuthorizationRefreshed
|
|
98
|
-
} from "./cli-
|
|
99
|
+
} from "./cli-711vwbxn.js";
|
|
99
100
|
import {
|
|
101
|
+
ensureModelProfilesSeeded,
|
|
100
102
|
ensurePricingSeeded,
|
|
101
103
|
ensureRbacSeeded
|
|
102
|
-
} from "./cli-
|
|
104
|
+
} from "./cli-wfnemr1t.js";
|
|
103
105
|
import {
|
|
104
106
|
loadModelsDevCache
|
|
105
|
-
} from "./cli-
|
|
107
|
+
} from "./cli-hqr88ew6.js";
|
|
106
108
|
import {
|
|
107
109
|
require_fast_deep_equal
|
|
108
110
|
} from "./cli-6cvfxs8r.js";
|
|
@@ -161,10 +163,13 @@ import {
|
|
|
161
163
|
walkGraph,
|
|
162
164
|
withSaveWarnings,
|
|
163
165
|
workflowSaveWarnings
|
|
164
|
-
} from "./cli-
|
|
166
|
+
} from "./cli-naqzr17j.js";
|
|
165
167
|
import {
|
|
166
168
|
BaseExecutor,
|
|
167
169
|
HumanInTheLoopExecutor,
|
|
170
|
+
SYSTEM_ONE_DECISION_NODE_TYPE,
|
|
171
|
+
SYSTEM_ONE_PROVIDER_IDS,
|
|
172
|
+
SystemOneDecisionConfigSchema,
|
|
168
173
|
SystemOneDecisionExecutor,
|
|
169
174
|
applyDefinitionPatch,
|
|
170
175
|
createApprovalFollowUpTask,
|
|
@@ -175,7 +180,7 @@ import {
|
|
|
175
180
|
resolveValidationPort,
|
|
176
181
|
resolveWorkflowLlmConfig,
|
|
177
182
|
validateDefinition
|
|
178
|
-
} from "./cli-
|
|
183
|
+
} from "./cli-20krdhz5.js";
|
|
179
184
|
import {
|
|
180
185
|
ZodFirstPartyTypeKind,
|
|
181
186
|
objectType
|
|
@@ -206,14 +211,14 @@ import {
|
|
|
206
211
|
taskCitationWarnings,
|
|
207
212
|
upsertTaskCitations,
|
|
208
213
|
withSpan
|
|
209
|
-
} from "./cli-
|
|
214
|
+
} from "./cli-cvv9k0hh.js";
|
|
210
215
|
import {
|
|
211
216
|
externalChannelToolError,
|
|
212
217
|
getChannelBlockReason,
|
|
213
218
|
slackCode,
|
|
214
219
|
slackMissingScopeMessage,
|
|
215
220
|
withAutoJoin
|
|
216
|
-
} from "./cli-
|
|
221
|
+
} from "./cli-r610p9bs.js";
|
|
217
222
|
import {
|
|
218
223
|
findOrCreateUserByEmail,
|
|
219
224
|
findUserByEmail,
|
|
@@ -231,15 +236,15 @@ import {
|
|
|
231
236
|
resolveUserByToken,
|
|
232
237
|
revokeRuntimeTokensForRuntime,
|
|
233
238
|
unlinkIdentity
|
|
234
|
-
} from "./cli-
|
|
239
|
+
} from "./cli-mgz4nbgg.js";
|
|
235
240
|
import {
|
|
236
241
|
canProvisionKind,
|
|
237
242
|
init_runtime_providers
|
|
238
|
-
} from "./cli-
|
|
243
|
+
} from "./cli-j67mh2vg.js";
|
|
239
244
|
import {
|
|
240
245
|
getUserGrant,
|
|
241
246
|
init_rbac_roles
|
|
242
|
-
} from "./cli-
|
|
247
|
+
} from "./cli-d9286m9h.js";
|
|
243
248
|
import {
|
|
244
249
|
can,
|
|
245
250
|
decideAdmission,
|
|
@@ -248,7 +253,7 @@ import {
|
|
|
248
253
|
init_rbac,
|
|
249
254
|
isRbacEnabled,
|
|
250
255
|
revokeLeadEquivalence
|
|
251
|
-
} from "./cli-
|
|
256
|
+
} from "./cli-sksetb2q.js";
|
|
252
257
|
import {
|
|
253
258
|
API_DRAIN_MAX_MS_LIMIT,
|
|
254
259
|
CANDIDATE_SET_MULTIPLIER,
|
|
@@ -333,6 +338,7 @@ import {
|
|
|
333
338
|
getActiveTaskCount,
|
|
334
339
|
getAgentById,
|
|
335
340
|
getAgentCurrentTask,
|
|
341
|
+
getAgentDefaultProfileName,
|
|
336
342
|
getAgentMailInboxMapping,
|
|
337
343
|
getAgentMailInboxMappingsByAgent,
|
|
338
344
|
getAgentMcpServers,
|
|
@@ -381,6 +387,7 @@ import {
|
|
|
381
387
|
getMetric,
|
|
382
388
|
getMetricBySlug,
|
|
383
389
|
getMetricVersions,
|
|
390
|
+
getModelProfileByName,
|
|
384
391
|
getOAuthApp,
|
|
385
392
|
getOAuthAppById,
|
|
386
393
|
getOAuthAppIdByProvider,
|
|
@@ -451,6 +458,7 @@ import {
|
|
|
451
458
|
init_enabled_tools,
|
|
452
459
|
init_key_paths,
|
|
453
460
|
init_memory,
|
|
461
|
+
init_model_profiles,
|
|
454
462
|
init_model_tier_keys,
|
|
455
463
|
init_oauth,
|
|
456
464
|
init_request_auth_context,
|
|
@@ -490,6 +498,7 @@ import {
|
|
|
490
498
|
listCancelledApprovalRequestsForRun,
|
|
491
499
|
listKv,
|
|
492
500
|
listMcpServers,
|
|
501
|
+
listModelProfiles,
|
|
493
502
|
listSkills,
|
|
494
503
|
listWorkflowRunsPage,
|
|
495
504
|
listWorkflows,
|
|
@@ -501,6 +510,7 @@ import {
|
|
|
501
510
|
markSteeringHandled,
|
|
502
511
|
markTaskSlackReplySent,
|
|
503
512
|
maskSecrets,
|
|
513
|
+
modelProfileRefError,
|
|
504
514
|
moveTaskFromBacklog,
|
|
505
515
|
moveTaskToBacklog,
|
|
506
516
|
normalizeDateRequired,
|
|
@@ -520,6 +530,7 @@ import {
|
|
|
520
530
|
rejectTask,
|
|
521
531
|
releaseMentionProcessing,
|
|
522
532
|
releaseTask,
|
|
533
|
+
repoModelOverrideKeys,
|
|
523
534
|
requestSteering,
|
|
524
535
|
rerank,
|
|
525
536
|
reservedKeyError,
|
|
@@ -538,6 +549,7 @@ import {
|
|
|
538
549
|
shouldBlockPolling,
|
|
539
550
|
startTask,
|
|
540
551
|
sweepExpiredKvPrefix,
|
|
552
|
+
taskProfileError,
|
|
541
553
|
telemetry,
|
|
542
554
|
tierConfigKey,
|
|
543
555
|
touchScratchScriptLastUsed,
|
|
@@ -569,7 +581,7 @@ import {
|
|
|
569
581
|
validateConfigValue,
|
|
570
582
|
validateExportToEnv,
|
|
571
583
|
workflowContextKey
|
|
572
|
-
} from "./cli-
|
|
584
|
+
} from "./cli-y3167wt1.js";
|
|
573
585
|
import {
|
|
574
586
|
$OpenAPIRegistry,
|
|
575
587
|
$OpenApiGeneratorV31,
|
|
@@ -629,7 +641,7 @@ import {
|
|
|
629
641
|
parseAssetKey,
|
|
630
642
|
parseModelTier,
|
|
631
643
|
splitLegacyModelAlias
|
|
632
|
-
} from "./cli-
|
|
644
|
+
} from "./cli-pe05f8yk.js";
|
|
633
645
|
import {
|
|
634
646
|
generateDefaultClaudeMd,
|
|
635
647
|
generateDefaultIdentityMd,
|
|
@@ -638,7 +650,7 @@ import {
|
|
|
638
650
|
init_task_attachment_links,
|
|
639
651
|
taskAttachmentDisplayUrl,
|
|
640
652
|
taskAttachmentFetchCommand
|
|
641
|
-
} from "./cli-
|
|
653
|
+
} from "./cli-78vv7446.js";
|
|
642
654
|
import {
|
|
643
655
|
getSlackConfiguration,
|
|
644
656
|
init_config
|
|
@@ -710,11 +722,11 @@ import {
|
|
|
710
722
|
import {
|
|
711
723
|
init_package,
|
|
712
724
|
package_default
|
|
713
|
-
} from "./cli-
|
|
725
|
+
} from "./cli-r35rw5de.js";
|
|
714
726
|
import {
|
|
715
727
|
init_event_bus,
|
|
716
728
|
workflowEventBus
|
|
717
|
-
} from "./cli-
|
|
729
|
+
} from "./cli-z780ec7c.js";
|
|
718
730
|
import {
|
|
719
731
|
init_bus,
|
|
720
732
|
realtimeBus
|
|
@@ -747,7 +759,7 @@ import {
|
|
|
747
759
|
registerVolatileSecret,
|
|
748
760
|
scrubObject,
|
|
749
761
|
scrubSecrets
|
|
750
|
-
} from "./cli-
|
|
762
|
+
} from "./cli-shk7r5cs.js";
|
|
751
763
|
import {
|
|
752
764
|
buildClaudeShortnameMap,
|
|
753
765
|
claudeCatalogModelId,
|
|
@@ -15265,12 +15277,14 @@ function resumedTaskModelSelection(task) {
|
|
|
15265
15277
|
|
|
15266
15278
|
// src/be/model-validation.ts
|
|
15267
15279
|
init_db3();
|
|
15280
|
+
init_model_profiles();
|
|
15268
15281
|
|
|
15269
15282
|
// src/be/model-tier-resolution.ts
|
|
15270
15283
|
init_src();
|
|
15271
15284
|
init_zod();
|
|
15272
15285
|
init_types();
|
|
15273
15286
|
init_db3();
|
|
15287
|
+
init_model_profiles();
|
|
15274
15288
|
|
|
15275
15289
|
// src/be/harness-model-support.ts
|
|
15276
15290
|
init_src();
|
|
@@ -15602,11 +15616,73 @@ async function applyCliSupport(resolution, harness, cliVersion) {
|
|
|
15602
15616
|
if (!fallback)
|
|
15603
15617
|
return resolution;
|
|
15604
15618
|
noticeCliUnsupported(harness, cliVersion, resolution.resolvedModel, fallback);
|
|
15605
|
-
const modelSource = resolution.modelSource === "model" ? "fallback:cli-unsupported:model" : "fallback:cli-unsupported";
|
|
15619
|
+
const modelSource = resolution.modelSource.startsWith("profile:") ? resolution.modelSource : resolution.modelSource === "model" ? "fallback:cli-unsupported:model" : "fallback:cli-unsupported";
|
|
15606
15620
|
return { ...resolution, resolvedModel: fallback, modelSource };
|
|
15607
15621
|
}
|
|
15608
|
-
async function
|
|
15622
|
+
async function resolveClaimProfile(name, source, harness) {
|
|
15623
|
+
const isTask = source === "profile:task";
|
|
15624
|
+
const profile = await getModelProfileByName(name);
|
|
15625
|
+
if (!profile) {
|
|
15626
|
+
return isTask ? { modelUnsupported: `[model-profile-missing] Model profile "${name}" no longer exists.` } : null;
|
|
15627
|
+
}
|
|
15628
|
+
if (profile.harness !== harness) {
|
|
15629
|
+
if (!isTask)
|
|
15630
|
+
return null;
|
|
15631
|
+
return {
|
|
15632
|
+
modelUnsupported: `[model-harness-mismatch] Model profile "${name}" runs on the ${profile.harness} harness, not on the ${harness ?? "unknown"} harness of this worker. Re-create the task with a ${harness ?? "matching"} profile.`
|
|
15633
|
+
};
|
|
15634
|
+
}
|
|
15635
|
+
let resolution = {
|
|
15636
|
+
resolvedModel: profile.model,
|
|
15637
|
+
modelSource: source,
|
|
15638
|
+
modelAlias: null
|
|
15639
|
+
};
|
|
15640
|
+
if (isAlias(profile.model)) {
|
|
15641
|
+
const resolved = await resolveLatestAlias(profile.model);
|
|
15642
|
+
if (!resolved) {
|
|
15643
|
+
if (!isTask)
|
|
15644
|
+
return null;
|
|
15645
|
+
return {
|
|
15646
|
+
modelUnsupported: `[model-profile-unresolved] Model profile "${name}" names ${profile.model}, which resolves to no usable model.`
|
|
15647
|
+
};
|
|
15648
|
+
}
|
|
15649
|
+
resolution = {
|
|
15650
|
+
resolvedModel: resolved,
|
|
15651
|
+
modelSource: source,
|
|
15652
|
+
modelAlias: profile.model.trim().toLowerCase()
|
|
15653
|
+
};
|
|
15654
|
+
}
|
|
15655
|
+
return { profile: { name: profile.name, effort: profile.effort }, resolution };
|
|
15656
|
+
}
|
|
15657
|
+
async function recordClaimModelResolution(task, agent, { includeRepoSecrets = true } = {}) {
|
|
15609
15658
|
const harnessProvider = agent.harnessProvider ?? agent.provider ?? null;
|
|
15659
|
+
if (!task.model?.trim()) {
|
|
15660
|
+
const taskProfile = task.profile?.trim();
|
|
15661
|
+
const agentDefault = taskProfile || parseModelTier(task.modelTier) ? null : await getAgentDefaultProfileName(agent.id);
|
|
15662
|
+
const repoKeys = agentDefault ? await repoModelOverrideKeys(task.vcsRepo, { includeSecrets: includeRepoSecrets }) : new Set;
|
|
15663
|
+
const defaultProfile = repoKeys.has("MODEL_OVERRIDE") ? null : agentDefault;
|
|
15664
|
+
const picked = taskProfile ? await resolveClaimProfile(taskProfile, "profile:task", harnessProvider) : defaultProfile ? await resolveClaimProfile(defaultProfile, "profile:agent-default", harnessProvider) : null;
|
|
15665
|
+
if (picked && "modelUnsupported" in picked)
|
|
15666
|
+
return { modelUnsupported: picked.modelUnsupported };
|
|
15667
|
+
if (picked) {
|
|
15668
|
+
const checked2 = await applyCliSupport(picked.resolution, harnessProvider, await getAgentHarnessCliVersion(agent.id));
|
|
15669
|
+
const resolution2 = "unsupported" in checked2 ? picked.resolution : checked2;
|
|
15670
|
+
await getDbClient().run("UPDATE agent_tasks SET resolvedModel = ?, modelSource = ?, modelAlias = ?, resolvedProfile = ? WHERE id = ?", [
|
|
15671
|
+
resolution2.resolvedModel,
|
|
15672
|
+
resolution2.modelSource,
|
|
15673
|
+
resolution2.modelAlias,
|
|
15674
|
+
picked.profile.name,
|
|
15675
|
+
task.id
|
|
15676
|
+
]);
|
|
15677
|
+
return {
|
|
15678
|
+
resolvedModel: resolution2.resolvedModel,
|
|
15679
|
+
modelSource: resolution2.modelSource,
|
|
15680
|
+
...resolution2.modelAlias ? { modelAlias: resolution2.modelAlias } : {},
|
|
15681
|
+
resolvedProfile: picked.profile.name,
|
|
15682
|
+
...!task.effort && picked.profile.effort && !repoKeys.has("REASONING_EFFORT_OVERRIDE") ? { effort: picked.profile.effort } : {}
|
|
15683
|
+
};
|
|
15684
|
+
}
|
|
15685
|
+
}
|
|
15610
15686
|
const resolved = await resolveTaskModel({
|
|
15611
15687
|
model: task.model,
|
|
15612
15688
|
modelTier: task.modelTier,
|
|
@@ -15614,8 +15690,9 @@ async function recordClaimModelResolution(task, agent) {
|
|
|
15614
15690
|
workerOverrides: await getAgentModelTierOverrides(agent.id)
|
|
15615
15691
|
});
|
|
15616
15692
|
if (!resolved) {
|
|
15617
|
-
await getDbClient().run(`UPDATE agent_tasks SET resolvedModel = NULL, modelSource = NULL, modelAlias = NULL
|
|
15618
|
-
WHERE id = ? AND (resolvedModel IS NOT NULL OR modelSource IS NOT NULL OR modelAlias IS NOT NULL
|
|
15693
|
+
await getDbClient().run(`UPDATE agent_tasks SET resolvedModel = NULL, modelSource = NULL, modelAlias = NULL, resolvedProfile = NULL
|
|
15694
|
+
WHERE id = ? AND (resolvedModel IS NOT NULL OR modelSource IS NOT NULL OR modelAlias IS NOT NULL
|
|
15695
|
+
OR resolvedProfile IS NOT NULL)`, [task.id]);
|
|
15619
15696
|
return {};
|
|
15620
15697
|
}
|
|
15621
15698
|
if ("harnessMismatch" in resolved)
|
|
@@ -15625,7 +15702,7 @@ async function recordClaimModelResolution(task, agent) {
|
|
|
15625
15702
|
return { modelUnsupported: checked.unsupported };
|
|
15626
15703
|
}
|
|
15627
15704
|
const resolution = checked;
|
|
15628
|
-
await getDbClient().run("UPDATE agent_tasks SET resolvedModel = ?, modelSource = ?, modelAlias =
|
|
15705
|
+
await getDbClient().run("UPDATE agent_tasks SET resolvedModel = ?, modelSource = ?, modelAlias = ?, resolvedProfile = NULL WHERE id = ?", [resolution.resolvedModel, resolution.modelSource, resolution.modelAlias, task.id]);
|
|
15629
15706
|
return resolution.modelAlias ? resolution : { resolvedModel: resolution.resolvedModel, modelSource: resolution.modelSource };
|
|
15630
15707
|
}
|
|
15631
15708
|
|
|
@@ -15663,6 +15740,11 @@ async function harnessModelErrorFor(model, harness) {
|
|
|
15663
15740
|
return harnessModelMismatch(model, harness, providers, {});
|
|
15664
15741
|
}
|
|
15665
15742
|
async function poolTaskRunsOnHarness(task, harness) {
|
|
15743
|
+
const profileName = task?.profile?.trim();
|
|
15744
|
+
if (profileName) {
|
|
15745
|
+
const profile = await getModelProfileByName(profileName);
|
|
15746
|
+
return !profile || !harness || profile.harness === harness;
|
|
15747
|
+
}
|
|
15666
15748
|
const model = taskModelPin(task ?? {})?.trim();
|
|
15667
15749
|
if (!model)
|
|
15668
15750
|
return true;
|
|
@@ -16058,15 +16140,22 @@ async function prepareDeferredWakeTask(scheduleId, reason, extraTags) {
|
|
|
16058
16140
|
return await prepareStandaloneScheduleTask(wakeSchedule(schedule, resolved.cause), extraTags);
|
|
16059
16141
|
}
|
|
16060
16142
|
var DEFERRED_WAIT_WOKE_EVENT = "task_deferred_wait_woke";
|
|
16061
|
-
async function
|
|
16143
|
+
async function prepareDeferredTaskWait(scheduleId, reason, extraTags = []) {
|
|
16062
16144
|
const client = getDbClient();
|
|
16063
16145
|
if (!await client.get("SELECT * FROM deferred_task_waits WHERE scheduleId = ?", [
|
|
16064
16146
|
scheduleId
|
|
16065
16147
|
]))
|
|
16066
16148
|
return;
|
|
16067
|
-
|
|
16149
|
+
return { task: await prepareDeferredWakeTask(scheduleId, reason, extraTags) };
|
|
16150
|
+
}
|
|
16151
|
+
async function dispatchDeferredTaskWait(scheduleId, reason, extraTags = [], triggerTaskId, prepared) {
|
|
16152
|
+
const preparation = prepared ?? await prepareDeferredTaskWait(scheduleId, reason, extraTags);
|
|
16153
|
+
if (!preparation)
|
|
16154
|
+
return;
|
|
16155
|
+
const preparedForWait = preparation.task;
|
|
16068
16156
|
if (!preparedForWait)
|
|
16069
16157
|
return {};
|
|
16158
|
+
const client = getDbClient();
|
|
16070
16159
|
return client.transaction(async () => {
|
|
16071
16160
|
const resolved = await resolveWaitCause(scheduleId, reason);
|
|
16072
16161
|
if (!resolved)
|
|
@@ -16374,13 +16463,14 @@ async function throwIfWorkflowNeedsSetup(scheduleId, runIds) {
|
|
|
16374
16463
|
}
|
|
16375
16464
|
}
|
|
16376
16465
|
async function claimScheduleOccurrence(snapshot, extraTags) {
|
|
16466
|
+
const preparedWait = await prepareDeferredTaskWait(snapshot.id, "ceiling", extraTags);
|
|
16377
16467
|
return getDbClient().transaction(async () => {
|
|
16378
16468
|
const current = await getScheduledTaskById(snapshot.id);
|
|
16379
16469
|
if (!current?.enabled || !current.nextRunAt || current.nextRunAt !== snapshot.nextRunAt) {
|
|
16380
16470
|
return null;
|
|
16381
16471
|
}
|
|
16382
16472
|
const schedule = renderScheduledTaskParams(current);
|
|
16383
|
-
const deferred = await dispatchDeferredTaskWait(schedule.id, "ceiling", extraTags);
|
|
16473
|
+
const deferred = preparedWait ? await dispatchDeferredTaskWait(schedule.id, "ceiling", extraTags, undefined, preparedWait) : undefined;
|
|
16384
16474
|
if (deferred) {
|
|
16385
16475
|
return {
|
|
16386
16476
|
schedule,
|
|
@@ -22712,23 +22802,25 @@ function extractNameFromField(from) {
|
|
|
22712
22802
|
const name = angleMatch?.[1]?.trim();
|
|
22713
22803
|
return name && name.length > 0 ? name : undefined;
|
|
22714
22804
|
}
|
|
22805
|
+
function matchesAddressFilter(email, filter) {
|
|
22806
|
+
const address = email.trim().toLowerCase();
|
|
22807
|
+
const domain = address.split("@")[1];
|
|
22808
|
+
if (!domain)
|
|
22809
|
+
return false;
|
|
22810
|
+
return filter.split(",").map((entry) => entry.trim().toLowerCase()).some((entry) => entry.includes("@") ? entry === address : entry === domain);
|
|
22811
|
+
}
|
|
22715
22812
|
function isInboxAllowed(inboxId, filter) {
|
|
22716
22813
|
if (!filter)
|
|
22717
22814
|
return true;
|
|
22718
|
-
|
|
22719
|
-
const inboxDomain = inboxId.split("@")[1]?.toLowerCase();
|
|
22720
|
-
return !!inboxDomain && allowedDomains.includes(inboxDomain);
|
|
22815
|
+
return matchesAddressFilter(inboxId, filter);
|
|
22721
22816
|
}
|
|
22722
22817
|
function isSenderAllowed(from, filter) {
|
|
22723
22818
|
if (!filter)
|
|
22724
22819
|
return true;
|
|
22725
|
-
const allowedDomains = filter.split(",").map((d) => d.trim().toLowerCase());
|
|
22726
22820
|
const fromAddresses = Array.isArray(from) ? from : [from || ""];
|
|
22727
22821
|
return fromAddresses.some((addr) => {
|
|
22728
22822
|
const emailMatch = addr.match(/<([^>]+)>/);
|
|
22729
|
-
|
|
22730
|
-
const domain = email.split("@")[1]?.toLowerCase();
|
|
22731
|
-
return !!domain && allowedDomains.includes(domain);
|
|
22823
|
+
return matchesAddressFilter(emailMatch?.[1] ?? addr, filter);
|
|
22732
22824
|
});
|
|
22733
22825
|
}
|
|
22734
22826
|
var processedEvents = new Map;
|
|
@@ -22935,6 +23027,9 @@ async function handleMessageReceived(payload) {
|
|
|
22935
23027
|
console.log(`[AgentMail] Created unassigned task ${task.id} (no lead or mapping available)`);
|
|
22936
23028
|
return { created: true, taskId: task.id };
|
|
22937
23029
|
}
|
|
23030
|
+
// src/azure-devops/api.ts
|
|
23031
|
+
init_secret_scrubber();
|
|
23032
|
+
|
|
22938
23033
|
// src/azure-devops/auth.ts
|
|
22939
23034
|
init_env_flag();
|
|
22940
23035
|
var initialized3 = false;
|
|
@@ -23099,12 +23194,32 @@ async function likeAzureDevOpsComment(ref, threadId, commentId) {
|
|
|
23099
23194
|
try {
|
|
23100
23195
|
const resp = await fetch(url, { method: "POST", headers: headers() });
|
|
23101
23196
|
if (!resp.ok) {
|
|
23102
|
-
console.error(`[AzureDevOps] Failed to like comment: ${resp.status} ${await resp.text()}`);
|
|
23197
|
+
console.error(`[AzureDevOps] Failed to like comment: ${resp.status} ${scrubSecrets(await resp.text())}`);
|
|
23103
23198
|
}
|
|
23104
23199
|
} catch (err) {
|
|
23105
23200
|
console.error(`[AzureDevOps] Error liking comment:`, err);
|
|
23106
23201
|
}
|
|
23107
23202
|
}
|
|
23203
|
+
async function updateWorkItemFields(orgBaseUrl, workItemId, ops) {
|
|
23204
|
+
const orgUrl2 = credentialedOrgUrl(orgBaseUrl);
|
|
23205
|
+
if (!orgUrl2)
|
|
23206
|
+
return false;
|
|
23207
|
+
try {
|
|
23208
|
+
const resp = await fetch(`${orgUrl2}/_apis/wit/workitems/${workItemId}?api-version=${API_VERSION}`, {
|
|
23209
|
+
method: "PATCH",
|
|
23210
|
+
headers: { ...headers(), "Content-Type": "application/json-patch+json" },
|
|
23211
|
+
body: JSON.stringify(ops),
|
|
23212
|
+
redirect: "error"
|
|
23213
|
+
});
|
|
23214
|
+
if (!resp.ok) {
|
|
23215
|
+
console.error(`[AzureDevOps] Failed to update work item #${workItemId}: ${resp.status} ${scrubSecrets(await resp.text())}`);
|
|
23216
|
+
}
|
|
23217
|
+
return resp.ok;
|
|
23218
|
+
} catch (err) {
|
|
23219
|
+
console.error(`[AzureDevOps] Error updating work item #${workItemId}:`, scrubSecrets(err instanceof Error ? err.message : String(err)));
|
|
23220
|
+
return false;
|
|
23221
|
+
}
|
|
23222
|
+
}
|
|
23108
23223
|
// src/azure-devops/boards-sync.ts
|
|
23109
23224
|
init_db3();
|
|
23110
23225
|
|
|
@@ -23254,6 +23369,7 @@ async function createTrackerAgentMapping(data) {
|
|
|
23254
23369
|
init_resolver();
|
|
23255
23370
|
init_context_key();
|
|
23256
23371
|
init_types();
|
|
23372
|
+
init_event_bus();
|
|
23257
23373
|
|
|
23258
23374
|
// src/azure-devops/handlers.ts
|
|
23259
23375
|
init_db3();
|
|
@@ -24078,7 +24194,7 @@ async function handleWorkItemUpdated(event) {
|
|
|
24078
24194
|
const org = orgFor(event);
|
|
24079
24195
|
if (!org)
|
|
24080
24196
|
return dropUntrustedOrg(event.eventType);
|
|
24081
|
-
|
|
24197
|
+
const routeAssignment = async () => {
|
|
24082
24198
|
const bot = await resolveBot(org.url);
|
|
24083
24199
|
if (!isBotString(change.newValue, bot) || isBotString(change.oldValue, bot)) {
|
|
24084
24200
|
return { created: false };
|
|
@@ -24093,6 +24209,19 @@ async function handleWorkItemUpdated(event) {
|
|
|
24093
24209
|
org,
|
|
24094
24210
|
actor: update.revisedBy ?? null
|
|
24095
24211
|
}, "assigned");
|
|
24212
|
+
};
|
|
24213
|
+
return await handleDelivery(org, event.id, update.workItemId, async () => {
|
|
24214
|
+
const result = await routeAssignment();
|
|
24215
|
+
workflowEventBus.emit("azure-devops.work_item.assigned", {
|
|
24216
|
+
work_item_id: update.workItemId,
|
|
24217
|
+
title: update.revision.fields["System.Title"],
|
|
24218
|
+
project: update.revision.fields["System.TeamProject"],
|
|
24219
|
+
action: "assigned",
|
|
24220
|
+
assigned_to: change.newValue,
|
|
24221
|
+
previous_assignee: change.oldValue,
|
|
24222
|
+
user_login: update.revisedBy?.uniqueName ?? update.revisedBy?.id
|
|
24223
|
+
});
|
|
24224
|
+
return result;
|
|
24096
24225
|
});
|
|
24097
24226
|
}
|
|
24098
24227
|
async function handleWorkItemCommented(event) {
|
|
@@ -24107,8 +24236,7 @@ async function handleWorkItemCommented(event) {
|
|
|
24107
24236
|
const org = orgFor(event);
|
|
24108
24237
|
if (!org)
|
|
24109
24238
|
return dropUntrustedOrg(event.eventType);
|
|
24110
|
-
const
|
|
24111
|
-
return await handleDelivery(org, event.id, item.id, async () => {
|
|
24239
|
+
const routeComment = async () => {
|
|
24112
24240
|
const bot = await resolveBot(org.url);
|
|
24113
24241
|
const actor = parseIdentityString(item.fields["System.ChangedBy"]);
|
|
24114
24242
|
if (isBotIdentity(actor, bot))
|
|
@@ -24124,6 +24252,19 @@ async function handleWorkItemCommented(event) {
|
|
|
24124
24252
|
org,
|
|
24125
24253
|
actor
|
|
24126
24254
|
}, "mentioned_comment", text);
|
|
24255
|
+
};
|
|
24256
|
+
const commentKey = ref ? `comment:${trackerKey(org, item.id)}:${ref.commentId}` : undefined;
|
|
24257
|
+
return await handleDelivery(org, event.id, item.id, async () => {
|
|
24258
|
+
const result = await routeComment();
|
|
24259
|
+
workflowEventBus.emit("azure-devops.work_item.commented", {
|
|
24260
|
+
work_item_id: item.id,
|
|
24261
|
+
title: item.fields["System.Title"],
|
|
24262
|
+
project: item.fields["System.TeamProject"],
|
|
24263
|
+
action: "commented",
|
|
24264
|
+
comment: item.fields["System.History"],
|
|
24265
|
+
user_login: item.fields["System.ChangedBy"]
|
|
24266
|
+
});
|
|
24267
|
+
return result;
|
|
24127
24268
|
}, commentKey);
|
|
24128
24269
|
}
|
|
24129
24270
|
async function handleWorkItemDeleted(event) {
|
|
@@ -24194,6 +24335,74 @@ async function handleWorkItemRestored(event) {
|
|
|
24194
24335
|
return { created: true, taskId };
|
|
24195
24336
|
});
|
|
24196
24337
|
}
|
|
24338
|
+
// src/azure-devops/outbound.ts
|
|
24339
|
+
init_db3();
|
|
24340
|
+
init_task_lifecycle_events();
|
|
24341
|
+
init_secret_scrubber();
|
|
24342
|
+
init_event_bus();
|
|
24343
|
+
var PROVIDER2 = "azure-devops";
|
|
24344
|
+
function getWorkItemState(which) {
|
|
24345
|
+
return process.env[`AZURE_DEVOPS_WORKITEM_STATE_${which}`]?.trim() || null;
|
|
24346
|
+
}
|
|
24347
|
+
async function transitionLinkedWorkItem(taskId, state) {
|
|
24348
|
+
const sync = await getTrackerSync(PROVIDER2, "task", taskId);
|
|
24349
|
+
if (!sync)
|
|
24350
|
+
return;
|
|
24351
|
+
const [orgKey, id] = sync.externalId.split("#");
|
|
24352
|
+
const workItemId = Number(id);
|
|
24353
|
+
if (!orgKey || !Number.isInteger(workItemId))
|
|
24354
|
+
return;
|
|
24355
|
+
const ok = await updateWorkItemFields(`https://${orgKey}`, workItemId, [
|
|
24356
|
+
{ op: "add", path: "/fields/System.State", value: state }
|
|
24357
|
+
]);
|
|
24358
|
+
if (ok) {
|
|
24359
|
+
console.log(scrubSecrets(`[AzureDevOps] Work item #${workItemId} -> ${state} (task ${taskId})`));
|
|
24360
|
+
}
|
|
24361
|
+
}
|
|
24362
|
+
var transitionChains = new Map;
|
|
24363
|
+
function enqueueTransition(taskId, state, eventName) {
|
|
24364
|
+
const run = (transitionChains.get(taskId) ?? Promise.resolve()).then(() => transitionLinkedWorkItem(taskId, state)).catch((error) => report(eventName, error));
|
|
24365
|
+
transitionChains.set(taskId, run);
|
|
24366
|
+
run.then(() => {
|
|
24367
|
+
if (transitionChains.get(taskId) === run)
|
|
24368
|
+
transitionChains.delete(taskId);
|
|
24369
|
+
});
|
|
24370
|
+
}
|
|
24371
|
+
function report(eventName, error) {
|
|
24372
|
+
console.error(`[AzureDevOps Outbound] ${eventName} handler failed:`, scrubSecrets(error instanceof Error ? error.message : String(error)));
|
|
24373
|
+
}
|
|
24374
|
+
function handleTaskStarted(task) {
|
|
24375
|
+
const state = getWorkItemState("STARTED");
|
|
24376
|
+
if (state)
|
|
24377
|
+
enqueueTransition(task.id, state, "task.started");
|
|
24378
|
+
}
|
|
24379
|
+
var onTaskCompleted = (data) => {
|
|
24380
|
+
const { taskId } = data ?? {};
|
|
24381
|
+
const state = getWorkItemState("DONE");
|
|
24382
|
+
if (taskId && state)
|
|
24383
|
+
enqueueTransition(taskId, state, "task.completed");
|
|
24384
|
+
};
|
|
24385
|
+
var subscribed = false;
|
|
24386
|
+
var startedHookRegistered = false;
|
|
24387
|
+
function initAzureDevOpsOutbound() {
|
|
24388
|
+
if (subscribed)
|
|
24389
|
+
return;
|
|
24390
|
+
subscribed = true;
|
|
24391
|
+
if (!startedHookRegistered) {
|
|
24392
|
+
startedHookRegistered = true;
|
|
24393
|
+
onTaskStarted((task) => {
|
|
24394
|
+
if (subscribed)
|
|
24395
|
+
getDbClient().afterCommit(() => handleTaskStarted(task));
|
|
24396
|
+
});
|
|
24397
|
+
}
|
|
24398
|
+
workflowEventBus.on("task.completed", onTaskCompleted);
|
|
24399
|
+
}
|
|
24400
|
+
function teardownAzureDevOpsOutbound() {
|
|
24401
|
+
if (!subscribed)
|
|
24402
|
+
return;
|
|
24403
|
+
subscribed = false;
|
|
24404
|
+
workflowEventBus.off("task.completed", onTaskCompleted);
|
|
24405
|
+
}
|
|
24197
24406
|
// src/http/core.ts
|
|
24198
24407
|
init_db3();
|
|
24199
24408
|
|
|
@@ -28798,7 +29007,7 @@ async function jiraFetch(path, init) {
|
|
|
28798
29007
|
}
|
|
28799
29008
|
|
|
28800
29009
|
// src/jira/outbound.ts
|
|
28801
|
-
var
|
|
29010
|
+
var subscribed2 = false;
|
|
28802
29011
|
var LOOP_PREVENTION_WINDOW_MS = 5000;
|
|
28803
29012
|
var OUTPUT_TRUNCATE_CHARS = 4000;
|
|
28804
29013
|
function observed(eventName, handler) {
|
|
@@ -28809,25 +29018,25 @@ function observed(eventName, handler) {
|
|
|
28809
29018
|
};
|
|
28810
29019
|
}
|
|
28811
29020
|
var onTaskCreated = observed("task.created", handleTaskCreated);
|
|
28812
|
-
var
|
|
29021
|
+
var onTaskCompleted2 = observed("task.completed", handleTaskCompleted);
|
|
28813
29022
|
var onTaskFailed = observed("task.failed", handleTaskFailed);
|
|
28814
29023
|
var onTaskCancelled = observed("task.cancelled", handleTaskCancelled);
|
|
28815
29024
|
function initJiraOutboundSync() {
|
|
28816
|
-
if (
|
|
29025
|
+
if (subscribed2)
|
|
28817
29026
|
return;
|
|
28818
|
-
|
|
29027
|
+
subscribed2 = true;
|
|
28819
29028
|
workflowEventBus.on("task.created", onTaskCreated);
|
|
28820
|
-
workflowEventBus.on("task.completed",
|
|
29029
|
+
workflowEventBus.on("task.completed", onTaskCompleted2);
|
|
28821
29030
|
workflowEventBus.on("task.failed", onTaskFailed);
|
|
28822
29031
|
workflowEventBus.on("task.cancelled", onTaskCancelled);
|
|
28823
29032
|
console.log("[Jira] Outbound sync subscribed to event bus");
|
|
28824
29033
|
}
|
|
28825
29034
|
function teardownJiraOutboundSync() {
|
|
28826
|
-
if (!
|
|
29035
|
+
if (!subscribed2)
|
|
28827
29036
|
return;
|
|
28828
|
-
|
|
29037
|
+
subscribed2 = false;
|
|
28829
29038
|
workflowEventBus.off("task.created", onTaskCreated);
|
|
28830
|
-
workflowEventBus.off("task.completed",
|
|
29039
|
+
workflowEventBus.off("task.completed", onTaskCompleted2);
|
|
28831
29040
|
workflowEventBus.off("task.failed", onTaskFailed);
|
|
28832
29041
|
workflowEventBus.off("task.cancelled", onTaskCancelled);
|
|
28833
29042
|
console.log("[Jira] Outbound sync unsubscribed from event bus");
|
|
@@ -29406,7 +29615,7 @@ async function notifySlack(text) {
|
|
|
29406
29615
|
return;
|
|
29407
29616
|
}
|
|
29408
29617
|
try {
|
|
29409
|
-
const { getSlackApp: getSlackApp2 } = await import("./app-
|
|
29618
|
+
const { getSlackApp: getSlackApp2 } = await import("./app-7k8s9w5p.js");
|
|
29410
29619
|
const app = getSlackApp2();
|
|
29411
29620
|
if (!app) {
|
|
29412
29621
|
console.warn("[Jira webhook keepalive] Slack not available, cannot send notification");
|
|
@@ -29477,7 +29686,7 @@ async function deleteJiraWebhook(webhookId) {
|
|
|
29477
29686
|
console.log(`[Jira webhook keepalive] Deleted webhook id=${webhookId}`);
|
|
29478
29687
|
}
|
|
29479
29688
|
async function overwriteWebhookIds(next) {
|
|
29480
|
-
const { getDbClient: getDbClient2 } = await import("./db-
|
|
29689
|
+
const { getDbClient: getDbClient2 } = await import("./db-eywwsnjw.js");
|
|
29481
29690
|
await getDbClient2().transaction(async (tx) => {
|
|
29482
29691
|
const row = await tx.get("SELECT metadata FROM oauth_apps WHERE provider = 'jira'");
|
|
29483
29692
|
if (!row) {
|
|
@@ -101949,7 +102158,7 @@ async function handleAgentSessionPrompted(event) {
|
|
|
101949
102158
|
}
|
|
101950
102159
|
|
|
101951
102160
|
// src/linear/outbound.ts
|
|
101952
|
-
var
|
|
102161
|
+
var subscribed3 = false;
|
|
101953
102162
|
var LOOP_PREVENTION_WINDOW_MS2 = 5000;
|
|
101954
102163
|
function observed2(eventName, handler) {
|
|
101955
102164
|
return (data) => {
|
|
@@ -101959,27 +102168,27 @@ function observed2(eventName, handler) {
|
|
|
101959
102168
|
};
|
|
101960
102169
|
}
|
|
101961
102170
|
var onTaskCreated2 = observed2("task.created", handleTaskCreated2);
|
|
101962
|
-
var
|
|
102171
|
+
var onTaskCompleted3 = observed2("task.completed", handleTaskCompleted2);
|
|
101963
102172
|
var onTaskFailed2 = observed2("task.failed", handleTaskFailed2);
|
|
101964
102173
|
var onTaskCancelled2 = observed2("task.cancelled", handleTaskCancelled2);
|
|
101965
102174
|
var onTaskProgress = observed2("task.progress", handleTaskProgress);
|
|
101966
102175
|
function initLinearOutboundSync() {
|
|
101967
|
-
if (
|
|
102176
|
+
if (subscribed3)
|
|
101968
102177
|
return;
|
|
101969
|
-
|
|
102178
|
+
subscribed3 = true;
|
|
101970
102179
|
workflowEventBus.on("task.created", onTaskCreated2);
|
|
101971
|
-
workflowEventBus.on("task.completed",
|
|
102180
|
+
workflowEventBus.on("task.completed", onTaskCompleted3);
|
|
101972
102181
|
workflowEventBus.on("task.failed", onTaskFailed2);
|
|
101973
102182
|
workflowEventBus.on("task.cancelled", onTaskCancelled2);
|
|
101974
102183
|
workflowEventBus.on("task.progress", onTaskProgress);
|
|
101975
102184
|
console.log("[Linear] Outbound sync subscribed to event bus");
|
|
101976
102185
|
}
|
|
101977
102186
|
function teardownLinearOutboundSync() {
|
|
101978
|
-
if (!
|
|
102187
|
+
if (!subscribed3)
|
|
101979
102188
|
return;
|
|
101980
|
-
|
|
102189
|
+
subscribed3 = false;
|
|
101981
102190
|
workflowEventBus.off("task.created", onTaskCreated2);
|
|
101982
|
-
workflowEventBus.off("task.completed",
|
|
102191
|
+
workflowEventBus.off("task.completed", onTaskCompleted3);
|
|
101983
102192
|
workflowEventBus.off("task.failed", onTaskFailed2);
|
|
101984
102193
|
workflowEventBus.off("task.cancelled", onTaskCancelled2);
|
|
101985
102194
|
workflowEventBus.off("task.progress", onTaskProgress);
|
|
@@ -103292,7 +103501,7 @@ async function reloadGlobalConfigsAndIntegrations() {
|
|
|
103292
103501
|
return runWithoutRequestAuth(() => reloadGlobalConfigsAndIntegrationsInner());
|
|
103293
103502
|
}
|
|
103294
103503
|
async function reloadGlobalConfigsAndIntegrationsInner() {
|
|
103295
|
-
const { getEmbeddingProvider: getEmbeddingProvider2, resetEmbeddingProvider } = await import("./index-
|
|
103504
|
+
const { getEmbeddingProvider: getEmbeddingProvider2, resetEmbeddingProvider } = await import("./index-vxvhxxbn.js");
|
|
103296
103505
|
const wasEmbeddingsConfigured = getEmbeddingProvider2().isConfigured();
|
|
103297
103506
|
const updated = await loadGlobalConfigsIntoEnv(true);
|
|
103298
103507
|
await syncTelemetryEnabled("settings").catch((err) => {
|
|
@@ -103308,10 +103517,10 @@ async function reloadGlobalConfigsAndIntegrationsInner() {
|
|
|
103308
103517
|
integrations.push("embeddings");
|
|
103309
103518
|
}
|
|
103310
103519
|
if (!wasEmbeddingsConfigured && isEmbeddingsConfigured) {
|
|
103311
|
-
import("./boot-reembed-
|
|
103520
|
+
import("./boot-reembed-whzbdthj.js").then(({ runBootReembed }) => runBootReembed()).catch((err) => {
|
|
103312
103521
|
console.error("[config-reload] memory backfill failed (non-fatal):", err);
|
|
103313
103522
|
});
|
|
103314
|
-
import("./boot-reembed-
|
|
103523
|
+
import("./boot-reembed-9apm9qw6.js").then(({ runBootReembedScripts }) => runBootReembedScripts()).catch((err) => {
|
|
103315
103524
|
console.error("[config-reload] script backfill failed (non-fatal):", err);
|
|
103316
103525
|
});
|
|
103317
103526
|
}
|
|
@@ -103330,6 +103539,9 @@ async function reloadGlobalConfigsAndIntegrationsInner() {
|
|
|
103330
103539
|
initAzureDevOps();
|
|
103331
103540
|
if (isAzureDevOpsEnabled())
|
|
103332
103541
|
integrations.push("azure-devops");
|
|
103542
|
+
teardownAzureDevOpsOutbound();
|
|
103543
|
+
if (isAzureDevOpsEnabled())
|
|
103544
|
+
initAzureDevOpsOutbound();
|
|
103333
103545
|
resetLinear();
|
|
103334
103546
|
if (await initLinear())
|
|
103335
103547
|
integrations.push("linear");
|
|
@@ -104493,7 +104705,7 @@ function setPreloadedTools(server, names) {
|
|
|
104493
104705
|
async function applyPreToolCall(name, args, requestInfo, inputSchema) {
|
|
104494
104706
|
if (requestInfo.callOrigin !== "mcp")
|
|
104495
104707
|
return { args };
|
|
104496
|
-
const dispatcher = await import("./dispatcher-
|
|
104708
|
+
const dispatcher = await import("./dispatcher-w94kc575.js");
|
|
104497
104709
|
const result = await dispatcher.dispatchPre("pre.tool.call", { tool: name, args, requestInfo }, inputSchema ? {
|
|
104498
104710
|
validateModify: async (data) => {
|
|
104499
104711
|
const schema = normalizeObjectSchema(inputSchema) ?? inputSchema;
|
|
@@ -106034,13 +106246,13 @@ function affectedModelNames(previousDefinition, nextDefinition, migration) {
|
|
|
106034
106246
|
});
|
|
106035
106247
|
}).sort();
|
|
106036
106248
|
}
|
|
106037
|
-
function applyDirective(rows, modelName, columnName, directive, oldColumn, nextColumn, oldModel, nextModel,
|
|
106249
|
+
function applyDirective(rows, modelName, columnName, directive, oldColumn, nextColumn, oldModel, nextModel, report2, issues, path2) {
|
|
106038
106250
|
if (isPurgeDirective(directive)) {
|
|
106039
106251
|
for (const row of rows) {
|
|
106040
106252
|
if (!Object.hasOwn(row, columnName))
|
|
106041
106253
|
continue;
|
|
106042
106254
|
delete row[columnName];
|
|
106043
|
-
|
|
106255
|
+
report2.purgedValues += 1;
|
|
106044
106256
|
}
|
|
106045
106257
|
return;
|
|
106046
106258
|
}
|
|
@@ -106049,7 +106261,7 @@ function applyDirective(rows, modelName, columnName, directive, oldColumn, nextC
|
|
|
106049
106261
|
if ("set" in directive) {
|
|
106050
106262
|
for (const row of rows) {
|
|
106051
106263
|
row[columnName] = directive.set;
|
|
106052
|
-
|
|
106264
|
+
report2.backfilled += 1;
|
|
106053
106265
|
}
|
|
106054
106266
|
return;
|
|
106055
106267
|
}
|
|
@@ -106074,13 +106286,13 @@ function applyDirective(rows, modelName, columnName, directive, oldColumn, nextC
|
|
|
106074
106286
|
value = directive.map[String(sourceValue)];
|
|
106075
106287
|
if (columnAccepts(nextColumn, value)) {
|
|
106076
106288
|
resolved = true;
|
|
106077
|
-
|
|
106289
|
+
report2.mapped += 1;
|
|
106078
106290
|
}
|
|
106079
106291
|
} else if (!directive.map && sourceValue !== undefined) {
|
|
106080
106292
|
value = sourceValue;
|
|
106081
106293
|
if (columnAccepts(nextColumn, value)) {
|
|
106082
106294
|
resolved = true;
|
|
106083
|
-
|
|
106295
|
+
report2.mapped += 1;
|
|
106084
106296
|
}
|
|
106085
106297
|
}
|
|
106086
106298
|
} else {
|
|
@@ -106090,14 +106302,14 @@ function applyDirective(rows, modelName, columnName, directive, oldColumn, nextC
|
|
|
106090
106302
|
value = converted;
|
|
106091
106303
|
resolved = true;
|
|
106092
106304
|
if (!Object.is(converted, sourceValue))
|
|
106093
|
-
|
|
106305
|
+
report2.coerced += 1;
|
|
106094
106306
|
}
|
|
106095
106307
|
}
|
|
106096
106308
|
if (!resolved) {
|
|
106097
106309
|
if (hasExplicitElse) {
|
|
106098
106310
|
value = directive.else;
|
|
106099
106311
|
resolved = true;
|
|
106100
|
-
|
|
106312
|
+
report2.elsed += 1;
|
|
106101
106313
|
} else if ("from" in directive && (nextColumn.hidden === true || nextColumn.required !== true)) {
|
|
106102
106314
|
if (Object.hasOwn(row, columnName))
|
|
106103
106315
|
delete row[columnName];
|
|
@@ -106131,7 +106343,7 @@ function ownSource(model, sourceName) {
|
|
|
106131
106343
|
const sources = model?.sources;
|
|
106132
106344
|
return sources && Object.hasOwn(sources, sourceName) ? sources[sourceName] : undefined;
|
|
106133
106345
|
}
|
|
106134
|
-
function planSources(modelName, oldModel, nextModel, rows,
|
|
106346
|
+
function planSources(modelName, oldModel, nextModel, rows, report2, issues) {
|
|
106135
106347
|
const sourceNames = new Set([
|
|
106136
106348
|
...Object.keys(oldModel?.sources ?? {}),
|
|
106137
106349
|
...Object.keys(nextModel?.sources ?? {})
|
|
@@ -106148,7 +106360,7 @@ function planSources(modelName, oldModel, nextModel, rows, report, issues) {
|
|
|
106148
106360
|
delete row.source;
|
|
106149
106361
|
delete row.syncedAt;
|
|
106150
106362
|
delete row.stale;
|
|
106151
|
-
|
|
106363
|
+
report2.detachedRows += 1;
|
|
106152
106364
|
}
|
|
106153
106365
|
continue;
|
|
106154
106366
|
}
|
|
@@ -106166,20 +106378,20 @@ function planSources(modelName, oldModel, nextModel, rows, report, issues) {
|
|
|
106166
106378
|
}
|
|
106167
106379
|
}
|
|
106168
106380
|
}
|
|
106169
|
-
async function planModel(appId2, modelName, oldModel, nextModel, migration, oldSideUnparseable,
|
|
106381
|
+
async function planModel(appId2, modelName, oldModel, nextModel, migration, oldSideUnparseable, report2, orphanFields, appliedDirectives) {
|
|
106170
106382
|
const persistedRows = await listAllAppRowsForMigrationUnlocked(appId2, modelName);
|
|
106171
106383
|
const rows = persistedRows.map((row) => structuredClone(row));
|
|
106172
106384
|
const issues = [];
|
|
106173
106385
|
const changedColumns = changedColumnNames(oldModel, nextModel);
|
|
106174
106386
|
const rebuildColumns = new Set(changedColumns);
|
|
106175
|
-
|
|
106387
|
+
report2.scanned += rows.length;
|
|
106176
106388
|
if (oldModel && !nextModel && rows.length > 0) {
|
|
106177
106389
|
issues.push({
|
|
106178
106390
|
path: `models.${modelName}`,
|
|
106179
106391
|
message: `model holds ${rows.length} ${rows.length === 1 ? "row" : "rows"} — delete its rows before removing the model`
|
|
106180
106392
|
});
|
|
106181
106393
|
}
|
|
106182
|
-
planSources(modelName, oldModel, nextModel, rows,
|
|
106394
|
+
planSources(modelName, oldModel, nextModel, rows, report2, issues);
|
|
106183
106395
|
for (const columnName of changedColumns) {
|
|
106184
106396
|
const oldColumn = ownColumn(oldModel, columnName);
|
|
106185
106397
|
const nextColumn = ownColumn(nextModel, columnName);
|
|
@@ -106236,7 +106448,7 @@ async function planModel(appId2, modelName, oldModel, nextModel, migration, oldS
|
|
|
106236
106448
|
if (Object.hasOwn(row, columnName) && row[columnName] !== null)
|
|
106237
106449
|
continue;
|
|
106238
106450
|
row[columnName] = nextColumn.default;
|
|
106239
|
-
|
|
106451
|
+
report2.backfilled += 1;
|
|
106240
106452
|
}
|
|
106241
106453
|
} else {
|
|
106242
106454
|
issues.push({
|
|
@@ -106276,7 +106488,7 @@ async function planModel(appId2, modelName, oldModel, nextModel, migration, oldS
|
|
|
106276
106488
|
if (nextColumn) {
|
|
106277
106489
|
issues.push(...validateDirectiveValues(modelName, columnName, nextColumn, directive));
|
|
106278
106490
|
}
|
|
106279
|
-
applyDirective(rows, modelName, columnName, directive, oldColumn, nextColumn, oldModel, nextModel,
|
|
106491
|
+
applyDirective(rows, modelName, columnName, directive, oldColumn, nextColumn, oldModel, nextModel, report2, issues, `migration.${columnName}`);
|
|
106280
106492
|
rebuildColumns.add(columnName);
|
|
106281
106493
|
}
|
|
106282
106494
|
if (nextModel) {
|
|
@@ -106303,12 +106515,12 @@ async function buildPlan(appId2, previousDefinition, previousRawDefinition, next
|
|
|
106303
106515
|
...validateDirectiveOrder(migration),
|
|
106304
106516
|
...await exportedElementCompatibilityIssues(appId2, previousDefinition, previousRawDefinition, nextDefinition, forceElementBreak)
|
|
106305
106517
|
];
|
|
106306
|
-
const
|
|
106518
|
+
const report2 = structuredClone(EMPTY_REPORT);
|
|
106307
106519
|
const userConfigNames = new Set([
|
|
106308
106520
|
...Object.keys(previousDefinition?.userConfig ?? {}),
|
|
106309
106521
|
...Object.keys(nextDefinition.userConfig ?? {})
|
|
106310
106522
|
]);
|
|
106311
|
-
|
|
106523
|
+
report2.userConfigChanged = [...userConfigNames].filter((name) => !definitionsEqual(previousDefinition?.userConfig?.[name], nextDefinition.userConfig?.[name])).sort();
|
|
106312
106524
|
const oldSideUnparseable = previousDefinition === undefined;
|
|
106313
106525
|
const affected = affectedModelNames(previousDefinition, nextDefinition, migration);
|
|
106314
106526
|
const orphanFields = new Set;
|
|
@@ -106317,9 +106529,9 @@ async function buildPlan(appId2, previousDefinition, previousRawDefinition, next
|
|
|
106317
106529
|
for (const modelName of affected) {
|
|
106318
106530
|
const previousModel = modelAt(previousDefinition, modelName);
|
|
106319
106531
|
const nextModel = modelAt(nextDefinition, modelName);
|
|
106320
|
-
const plan = await planModel(appId2, modelName, previousModel, nextModel, migration, oldSideUnparseable,
|
|
106532
|
+
const plan = await planModel(appId2, modelName, previousModel, nextModel, migration, oldSideUnparseable, report2, orphanFields, appliedDirectives);
|
|
106321
106533
|
issues.push(...plan.issues);
|
|
106322
|
-
|
|
106534
|
+
report2.idxRebuilt += plan.rebuildColumns.length;
|
|
106323
106535
|
models.push(plan);
|
|
106324
106536
|
}
|
|
106325
106537
|
for (const [columnName, directive] of Object.entries(migration)) {
|
|
@@ -106333,11 +106545,11 @@ async function buildPlan(appId2, previousDefinition, previousRawDefinition, next
|
|
|
106333
106545
|
});
|
|
106334
106546
|
}
|
|
106335
106547
|
const sortedOrphans = [...orphanFields].sort();
|
|
106336
|
-
|
|
106548
|
+
report2.orphanFields = sortedOrphans.slice(0, sortedOrphans.length > MAX_ORPHAN_FIELDS ? MAX_ORPHAN_FIELDS - 1 : MAX_ORPHAN_FIELDS);
|
|
106337
106549
|
if (sortedOrphans.length > MAX_ORPHAN_FIELDS) {
|
|
106338
|
-
|
|
106550
|
+
report2.orphanFields.push(`…and ${sortedOrphans.length - (MAX_ORPHAN_FIELDS - 1)} more`);
|
|
106339
106551
|
}
|
|
106340
|
-
return { issues, models, report };
|
|
106552
|
+
return { issues, models, report: report2 };
|
|
106341
106553
|
}
|
|
106342
106554
|
var APP_DEFINITION_LOCK_SENTINEL = "__definition__";
|
|
106343
106555
|
function withAppDefinitionLock(appId2, operation) {
|
|
@@ -106953,9 +107165,11 @@ var AppUserConfigFieldSchema = object({
|
|
|
106953
107165
|
label: string().optional()
|
|
106954
107166
|
});
|
|
106955
107167
|
var AppUserConfigSchema = record(AppNameSchema, AppUserConfigFieldSchema);
|
|
107168
|
+
var compatWarningsSchema = array(string()).optional().describe("Advisory quickjs-executor compatibility findings for the app's scripts.");
|
|
106956
107169
|
var appWriteResponseSchema = object({
|
|
106957
107170
|
app: AppRecordSchema,
|
|
106958
|
-
migration: AppMigrationReportSchema
|
|
107171
|
+
migration: AppMigrationReportSchema,
|
|
107172
|
+
warnings: compatWarningsSchema
|
|
106959
107173
|
});
|
|
106960
107174
|
var userConfigBodySchema = object({ values: record(string(), unknown()) }).strict();
|
|
106961
107175
|
var getUserConfigRoute = route({
|
|
@@ -107026,7 +107240,10 @@ var createAppRoute = route({
|
|
|
107026
107240
|
forceElementBreak: ForceElementBreakSchema.optional()
|
|
107027
107241
|
}),
|
|
107028
107242
|
responses: {
|
|
107029
|
-
201: {
|
|
107243
|
+
201: {
|
|
107244
|
+
description: "Created app",
|
|
107245
|
+
schema: object({ app: AppRecordSchema, warnings: compatWarningsSchema })
|
|
107246
|
+
},
|
|
107030
107247
|
400: { description: "Invalid app definition" },
|
|
107031
107248
|
403: { description: "Permission denied" }
|
|
107032
107249
|
},
|
|
@@ -107591,12 +107808,14 @@ async function handleApps(req, res, pathSegments, queryParams, myAgentId) {
|
|
|
107591
107808
|
invalidDefinition(res, definition.issues);
|
|
107592
107809
|
return true;
|
|
107593
107810
|
}
|
|
107811
|
+
const warnings = await scriptCompatWarnings(definition.definition);
|
|
107594
107812
|
createAppRoute.respond(res, 201, {
|
|
107595
107813
|
app: await createApp({
|
|
107596
107814
|
name: parsed.body.name,
|
|
107597
107815
|
description: parsed.body.description,
|
|
107598
107816
|
definition: definition.definition
|
|
107599
|
-
})
|
|
107817
|
+
}),
|
|
107818
|
+
...warnings.length > 0 ? { warnings } : {}
|
|
107600
107819
|
});
|
|
107601
107820
|
return true;
|
|
107602
107821
|
}
|
|
@@ -107978,6 +108197,7 @@ async function handleApps(req, res, pathSegments, queryParams, myAgentId) {
|
|
|
107978
108197
|
}
|
|
107979
108198
|
let app = null;
|
|
107980
108199
|
let migration;
|
|
108200
|
+
let writtenDefinition;
|
|
107981
108201
|
let responseHandled = false;
|
|
107982
108202
|
try {
|
|
107983
108203
|
await withAppDefinitionLock(parsed.params.id, async () => {
|
|
@@ -108009,6 +108229,8 @@ async function handleApps(req, res, pathSegments, queryParams, myAgentId) {
|
|
|
108009
108229
|
responseHandled = true;
|
|
108010
108230
|
return;
|
|
108011
108231
|
}
|
|
108232
|
+
if (parsed.body.definition !== undefined)
|
|
108233
|
+
writtenDefinition = definition.definition;
|
|
108012
108234
|
const migrated = await migrateAppSchema({
|
|
108013
108235
|
appId: parsed.params.id,
|
|
108014
108236
|
previousDefinition: existing.definition,
|
|
@@ -108049,7 +108271,12 @@ async function handleApps(req, res, pathSegments, queryParams, myAgentId) {
|
|
|
108049
108271
|
jsonError(res, "app not found", 404);
|
|
108050
108272
|
return true;
|
|
108051
108273
|
}
|
|
108052
|
-
|
|
108274
|
+
const warnings = writtenDefinition === undefined ? [] : await scriptCompatWarnings(writtenDefinition);
|
|
108275
|
+
patchAppRoute.respond(res, 200, {
|
|
108276
|
+
app,
|
|
108277
|
+
migration,
|
|
108278
|
+
...warnings.length > 0 ? { warnings } : {}
|
|
108279
|
+
});
|
|
108053
108280
|
return true;
|
|
108054
108281
|
}
|
|
108055
108282
|
if (updateAppRoute.match(req.method, pathSegments)) {
|
|
@@ -108066,6 +108293,7 @@ async function handleApps(req, res, pathSegments, queryParams, myAgentId) {
|
|
|
108066
108293
|
}
|
|
108067
108294
|
let app = null;
|
|
108068
108295
|
let migration;
|
|
108296
|
+
let writtenDefinition;
|
|
108069
108297
|
let responseHandled = false;
|
|
108070
108298
|
try {
|
|
108071
108299
|
await withAppDefinitionLock(parsed.params.id, async () => {
|
|
@@ -108095,6 +108323,7 @@ async function handleApps(req, res, pathSegments, queryParams, myAgentId) {
|
|
|
108095
108323
|
return;
|
|
108096
108324
|
}
|
|
108097
108325
|
const nextDefinition = definition ?? existing.definition;
|
|
108326
|
+
writtenDefinition = definition;
|
|
108098
108327
|
const migrated = await migrateAppSchema({
|
|
108099
108328
|
appId: parsed.params.id,
|
|
108100
108329
|
previousDefinition: appDefinitionNeedsRepair(existing) ? undefined : existing.definition,
|
|
@@ -108135,7 +108364,12 @@ async function handleApps(req, res, pathSegments, queryParams, myAgentId) {
|
|
|
108135
108364
|
jsonError(res, "app not found", 404);
|
|
108136
108365
|
return true;
|
|
108137
108366
|
}
|
|
108138
|
-
|
|
108367
|
+
const warnings = writtenDefinition === undefined ? [] : await scriptCompatWarnings(writtenDefinition);
|
|
108368
|
+
updateAppRoute.respond(res, 200, {
|
|
108369
|
+
app,
|
|
108370
|
+
migration,
|
|
108371
|
+
...warnings.length > 0 ? { warnings } : {}
|
|
108372
|
+
});
|
|
108139
108373
|
return true;
|
|
108140
108374
|
}
|
|
108141
108375
|
if (deleteAppRoute.match(req.method, pathSegments)) {
|
|
@@ -111487,7 +111721,8 @@ function inheritedModelSelection(parent) {
|
|
|
111487
111721
|
const model = taskModelPin(parent);
|
|
111488
111722
|
return {
|
|
111489
111723
|
...model ? { model } : {},
|
|
111490
|
-
...parent.modelTier ? { modelTier: parent.modelTier } : {}
|
|
111724
|
+
...parent.modelTier ? { modelTier: parent.modelTier } : {},
|
|
111725
|
+
...parent.profile ? { profile: parent.profile } : {}
|
|
111491
111726
|
};
|
|
111492
111727
|
}
|
|
111493
111728
|
function attachmentPointer(a) {
|
|
@@ -115919,6 +116154,46 @@ var registerModelCatalogOverlayUpsertTool = (server) => {
|
|
|
115919
116154
|
});
|
|
115920
116155
|
};
|
|
115921
116156
|
|
|
116157
|
+
// src/tools/model-profiles/list-model-profiles.ts
|
|
116158
|
+
init_zod();
|
|
116159
|
+
init_model_profiles();
|
|
116160
|
+
init_types();
|
|
116161
|
+
var registerListModelProfilesTool = (server) => {
|
|
116162
|
+
createToolRegistrar(server)("list-model-profiles", {
|
|
116163
|
+
title: "List Model Profiles",
|
|
116164
|
+
description: "List model profiles: named harness + model + effort combinations. Pass a profile's name as `profile` on send-task to run that task on it, or set it as an agent's default through PATCH /api/agents/{id}/runtime. A profile runs only on its own harness. Filter by `harness` to see what an agent on that harness can run.",
|
|
116165
|
+
annotations: { readOnlyHint: true },
|
|
116166
|
+
inputSchema: object({
|
|
116167
|
+
harness: ProviderNameSchema.optional().describe("Only profiles for this harness (claude, codex, pi, ...).")
|
|
116168
|
+
}),
|
|
116169
|
+
outputSchema: swarmToolOutputSchema({
|
|
116170
|
+
profiles: array(looseObject({
|
|
116171
|
+
name: string().optional(),
|
|
116172
|
+
harness: string().optional(),
|
|
116173
|
+
model: string().optional(),
|
|
116174
|
+
effort: string().nullable().optional(),
|
|
116175
|
+
description: string().nullable().optional()
|
|
116176
|
+
})).optional()
|
|
116177
|
+
})
|
|
116178
|
+
}, async ({ harness }) => {
|
|
116179
|
+
const profiles = await listModelProfiles({ harness });
|
|
116180
|
+
const lines = profiles.map((p) => `${p.name}: ${p.harness} / ${p.model}${p.effort ? ` / effort ${p.effort}` : ""}${p.description ? ` (${p.description})` : ""}`);
|
|
116181
|
+
return toolOk(`${profiles.length} model profile(s)${harness ? ` for ${harness}` : ""}.`, {
|
|
116182
|
+
details: lines.join(`
|
|
116183
|
+
`),
|
|
116184
|
+
data: {
|
|
116185
|
+
profiles: profiles.map((p) => ({
|
|
116186
|
+
name: p.name,
|
|
116187
|
+
harness: p.harness,
|
|
116188
|
+
model: p.model,
|
|
116189
|
+
effort: p.effort,
|
|
116190
|
+
description: p.description
|
|
116191
|
+
}))
|
|
116192
|
+
}
|
|
116193
|
+
});
|
|
116194
|
+
});
|
|
116195
|
+
};
|
|
116196
|
+
|
|
115922
116197
|
// src/tools/my-agent-info.ts
|
|
115923
116198
|
init_zod();
|
|
115924
116199
|
init_db3();
|
|
@@ -117538,19 +117813,20 @@ var registerRequestHumanInputTool = (server) => {
|
|
|
117538
117813
|
inputSchema: object({
|
|
117539
117814
|
title: string().min(1).describe("Title of the approval request"),
|
|
117540
117815
|
questions: array(QuestionSchema).min(1).describe("Questions to ask the human"),
|
|
117541
|
-
timeoutSeconds: number().int().min(1).optional().describe("Seconds until the request expires. After that the request becomes 'timeout' and you get a hitl-follow-up task. A request with no timeout is cancelled after APPROVAL_REQUEST_AUTO_CANCELLATION_DAYS days (default 7).")
|
|
117816
|
+
timeoutSeconds: number().int().min(1).optional().describe("Seconds until the request expires. After that the request becomes 'timeout' and you get a hitl-follow-up task. A request with no timeout is cancelled after APPROVAL_REQUEST_AUTO_CANCELLATION_DAYS days (default 7)."),
|
|
117817
|
+
detached: boolean().optional().describe("Do not attach the request to your current task, so no hitl-follow-up task is created. For scripts that read the request's status themselves.")
|
|
117542
117818
|
}),
|
|
117543
117819
|
outputSchema: swarmToolOutputSchema({
|
|
117544
117820
|
yourAgentId: string().optional(),
|
|
117545
117821
|
requestId: string().optional(),
|
|
117546
117822
|
url: string().optional()
|
|
117547
117823
|
})
|
|
117548
|
-
}, async ({ title, questions, timeoutSeconds }, requestInfo) => {
|
|
117824
|
+
}, async ({ title, questions, timeoutSeconds, detached }, requestInfo) => {
|
|
117549
117825
|
if (!requestInfo.agentId) {
|
|
117550
117826
|
return toolErr('Agent ID not found. The MCP client should define the "X-Agent-ID" header.', { data: { yourAgentId: requestInfo.agentId } });
|
|
117551
117827
|
}
|
|
117552
|
-
let sourceTaskId = requestInfo.sourceTaskId;
|
|
117553
|
-
if (!sourceTaskId && requestInfo.agentId) {
|
|
117828
|
+
let sourceTaskId = detached ? undefined : requestInfo.sourceTaskId;
|
|
117829
|
+
if (!sourceTaskId && !detached && requestInfo.agentId) {
|
|
117554
117830
|
const currentTask = await getAgentCurrentTask(requestInfo.agentId);
|
|
117555
117831
|
if (currentTask) {
|
|
117556
117832
|
sourceTaskId = currentTask.id;
|
|
@@ -125737,7 +126013,13 @@ var registerScriptApisTool = (server) => {
|
|
|
125737
126013
|
agentId: args2.agentId
|
|
125738
126014
|
},
|
|
125739
126015
|
requestInfo,
|
|
125740
|
-
successMessage: (data) =>
|
|
126016
|
+
successMessage: (data) => {
|
|
126017
|
+
const warnings = data.warnings ?? [];
|
|
126018
|
+
const note = warnings.length > 0 ? `
|
|
126019
|
+
${warnings.join(`
|
|
126020
|
+
`)}` : "";
|
|
126021
|
+
return `Endpoint ${data.id} created.${note}`;
|
|
126022
|
+
},
|
|
125741
126023
|
successDetails: (data) => {
|
|
125742
126024
|
const token = data.token;
|
|
125743
126025
|
return token ? `Bearer token (shown once — save it now): ${token}` : undefined;
|
|
@@ -126405,7 +126687,11 @@ var registerScriptUpsertTool = (server) => {
|
|
|
126405
126687
|
const name = typeof body.name === "string" ? body.name : args2.name;
|
|
126406
126688
|
const version = typeof body.version === "number" ? ` v${body.version}` : "";
|
|
126407
126689
|
const deduped = body.contentDeduped ? " (content unchanged — deduped)" : "";
|
|
126408
|
-
|
|
126690
|
+
const warnings = Array.isArray(body.warnings) ? body.warnings.map(String) : [];
|
|
126691
|
+
const note = warnings.length > 0 ? `
|
|
126692
|
+
${warnings.join(`
|
|
126693
|
+
`)}` : "";
|
|
126694
|
+
return `Script \`${name}\`${version} saved.${deduped}${note}`;
|
|
126409
126695
|
}
|
|
126410
126696
|
}));
|
|
126411
126697
|
};
|
|
@@ -126413,6 +126699,7 @@ var registerScriptUpsertTool = (server) => {
|
|
|
126413
126699
|
// src/tools/send-task.ts
|
|
126414
126700
|
init_zod();
|
|
126415
126701
|
init_db3();
|
|
126702
|
+
init_model_profiles();
|
|
126416
126703
|
init_rbac();
|
|
126417
126704
|
init_slack_routing();
|
|
126418
126705
|
|
|
@@ -126494,6 +126781,7 @@ var sendTaskInputSchema = object({
|
|
|
126494
126781
|
modelTier: ModelTierSchema.optional().describe("Portable model tier for this task: 'smol', 'regular', 'smart', or 'ultra'. Resolved at claim/run time using the assignee's harness/provider. Legacy model shortnames map as haiku→smol, sonnet→regular, opus→smart, fable→ultra."),
|
|
126495
126782
|
allowCustomModel: boolean().optional().describe("Accept a `model` the model catalog does not list. Without it an unknown model id is rejected. Only for ids the catalog cannot know yet (a fresh launch, a private deployment)."),
|
|
126496
126783
|
effort: ReasoningEffortSchema.optional().describe("Reasoning effort for this task: 'off', 'low', 'medium', 'high', 'xhigh', or 'max'. If omitted, the assignee's REASONING_EFFORT_OVERRIDE/default applies."),
|
|
126784
|
+
profile: string().trim().min(1).optional().describe("Model profile name (see list-model-profiles): a named harness + model + effort, applied when the task is claimed. Must run on the assignee's harness. Exclusive with model and modelTier. A set `effort` still wins over the profile's."),
|
|
126497
126785
|
allowDuplicate: boolean().default(false).describe("If true, skip duplicate detection and create the task even if a similar one exists."),
|
|
126498
126786
|
slackChannelId: string().optional().describe("Slack channel ID to post progress updates to. Use this to propagate Slack context when delegating from a Slack thread."),
|
|
126499
126787
|
slackThreadTs: string().optional().describe("Slack thread timestamp. Required with slackChannelId for thread-level updates."),
|
|
@@ -126569,6 +126857,7 @@ async function sendTaskHandler(ctx, {
|
|
|
126569
126857
|
modelTier,
|
|
126570
126858
|
allowCustomModel,
|
|
126571
126859
|
effort,
|
|
126860
|
+
profile,
|
|
126572
126861
|
allowDuplicate,
|
|
126573
126862
|
slackChannelId,
|
|
126574
126863
|
slackThreadTs,
|
|
@@ -126693,6 +126982,14 @@ async function sendTaskHandler(ctx, {
|
|
|
126693
126982
|
});
|
|
126694
126983
|
if (modelError)
|
|
126695
126984
|
return toolErr(modelError, { data: { yourAgentId: creatorAgentId } });
|
|
126985
|
+
const profileError = await taskProfileError({
|
|
126986
|
+
profile,
|
|
126987
|
+
model: normalizedModel.model,
|
|
126988
|
+
modelTier: normalizedModel.modelTier,
|
|
126989
|
+
agentId: effectiveAgentId
|
|
126990
|
+
});
|
|
126991
|
+
if (profileError)
|
|
126992
|
+
return toolErr(profileError, { data: { yourAgentId: creatorAgentId } });
|
|
126696
126993
|
const effectiveRoutingReason = requestedAgentId !== undefined ? requestedRoutingReason : effectiveAgentId ? "continuity" : undefined;
|
|
126697
126994
|
const effectiveRoutingNote = effectiveRoutingReason ? requestedRoutingNote : undefined;
|
|
126698
126995
|
const effectiveRoutingSource = ctx.kind === "user" ? "engine_default" : requestedAgentId !== undefined ? "declared" : effectiveAgentId ? "engine_default" : undefined;
|
|
@@ -126714,6 +127011,7 @@ async function sendTaskHandler(ctx, {
|
|
|
126714
127011
|
model: normalizedModel.model,
|
|
126715
127012
|
modelTier: normalizedModel.modelTier,
|
|
126716
127013
|
effort,
|
|
127014
|
+
profile,
|
|
126717
127015
|
slackChannelId,
|
|
126718
127016
|
slackThreadTs,
|
|
126719
127017
|
slackUserId,
|
|
@@ -126790,7 +127088,7 @@ async function sendTaskHandler(ctx, {
|
|
|
126790
127088
|
};
|
|
126791
127089
|
return guard.ok ? toolOk(guard.message, { data: guardData }) : toolErr(guard.message, { data: guardData });
|
|
126792
127090
|
}
|
|
126793
|
-
const
|
|
127091
|
+
const created = getDbClient().transaction(async () => {
|
|
126794
127092
|
const raced = await evaluateDedupGuards();
|
|
126795
127093
|
if (raced)
|
|
126796
127094
|
return { success: raced.ok, message: raced.message, task: raced.task };
|
|
@@ -126865,6 +127163,11 @@ async function sendTaskHandler(ctx, {
|
|
|
126865
127163
|
task: newTask
|
|
126866
127164
|
};
|
|
126867
127165
|
});
|
|
127166
|
+
const result = await created.catch((error) => {
|
|
127167
|
+
if (modelProfileRefError(error) !== "missing")
|
|
127168
|
+
throw error;
|
|
127169
|
+
return { success: false, message: `Unknown model profile "${profile}".`, task: undefined };
|
|
127170
|
+
});
|
|
126868
127171
|
const data = {
|
|
126869
127172
|
yourAgentId: creatorAgentId,
|
|
126870
127173
|
task: result.task
|
|
@@ -130408,6 +130711,64 @@ var registerSwarmXTool = (server) => {
|
|
|
130408
130711
|
});
|
|
130409
130712
|
};
|
|
130410
130713
|
|
|
130714
|
+
// src/tools/system-one-decide.ts
|
|
130715
|
+
init_zod();
|
|
130716
|
+
var registerSystemOneDecideTool = (server) => {
|
|
130717
|
+
createToolRegistrar(server)("system-one-decide", {
|
|
130718
|
+
title: "Ask a SystemOne decision model",
|
|
130719
|
+
annotations: { destructiveHint: false, openWorldHint: true },
|
|
130720
|
+
description: "Send a state and typed questions (noul, choice, score) to a SystemOne decision host such as Jev, and return the validated answers. " + "Same request, provider list, credentials and validation as the `system-one-decision` workflow node, without its human review band. " + "The provider credential is a global secret that stays on the server; this tool never returns it.",
|
|
130721
|
+
inputSchema: object({
|
|
130722
|
+
provider: _enum(SYSTEM_ONE_PROVIDER_IDS).optional().describe("Decision host (default typesafe)"),
|
|
130723
|
+
model: string().min(1).optional().describe("Provider model id (default: the provider's)"),
|
|
130724
|
+
state: union([string(), array(string()), record(string(), unknown())]).describe("The state to decide on"),
|
|
130725
|
+
questions: record(string(), record(string(), unknown())).describe("Questions by id, each `{ type: 'noul' | 'choice' | 'score', instructions, criteria }`"),
|
|
130726
|
+
timeoutMs: number().int().optional().describe("Time budget for the call, retries included (default 30000)"),
|
|
130727
|
+
maxRetries: number().int().optional().describe("Retries on transient failures inside the time budget (default 2)")
|
|
130728
|
+
}),
|
|
130729
|
+
outputSchema: swarmToolOutputSchema({
|
|
130730
|
+
model: string().optional(),
|
|
130731
|
+
answers: record(string(), unknown()).optional(),
|
|
130732
|
+
usage: record(string(), unknown()).optional(),
|
|
130733
|
+
requestId: string().optional()
|
|
130734
|
+
})
|
|
130735
|
+
}, async ({ provider, model, state: state2, questions, timeoutMs, maxRetries }, requestInfo) => {
|
|
130736
|
+
if (!requestInfo.agentId) {
|
|
130737
|
+
return toolErr('Agent ID not found. The MCP client should define the "X-Agent-ID" header.');
|
|
130738
|
+
}
|
|
130739
|
+
const returns = Object.fromEntries(Object.entries(questions).map(([id2, question]) => [id2, { type: question.type }]));
|
|
130740
|
+
const parsed = SystemOneDecisionConfigSchema.safeParse({
|
|
130741
|
+
provider,
|
|
130742
|
+
model,
|
|
130743
|
+
state: state2,
|
|
130744
|
+
questions,
|
|
130745
|
+
returns,
|
|
130746
|
+
timeoutMs,
|
|
130747
|
+
maxRetries
|
|
130748
|
+
});
|
|
130749
|
+
if (!parsed.success) {
|
|
130750
|
+
const issues = parsed.error.issues.map((issue) => `${issue.path.join(".") || "(root)"}: ${issue.message}`).join("; ");
|
|
130751
|
+
return toolErr(`Invalid decision request: ${issues}`.slice(0, 1000));
|
|
130752
|
+
}
|
|
130753
|
+
const executor = getExecutorRegistry().get(SYSTEM_ONE_DECISION_NODE_TYPE);
|
|
130754
|
+
if (!(executor instanceof SystemOneDecisionExecutor)) {
|
|
130755
|
+
return toolErr("The system-one-decision executor is not available");
|
|
130756
|
+
}
|
|
130757
|
+
const decided = await executor.decide(parsed.data);
|
|
130758
|
+
if (!decided.ok)
|
|
130759
|
+
return toolErr(decided.error);
|
|
130760
|
+
const { output } = decided;
|
|
130761
|
+
return toolOk(`Decision from ${output.model}`, {
|
|
130762
|
+
data: {
|
|
130763
|
+
model: output.model,
|
|
130764
|
+
answers: output.answers,
|
|
130765
|
+
usage: output.usage,
|
|
130766
|
+
requestId: output.requestId
|
|
130767
|
+
}
|
|
130768
|
+
});
|
|
130769
|
+
});
|
|
130770
|
+
};
|
|
130771
|
+
|
|
130411
130772
|
// src/tools/task-action.ts
|
|
130412
130773
|
init_zod();
|
|
130413
130774
|
|
|
@@ -130530,7 +130891,7 @@ async function emitBudgetRefusalSideEffects(ctx, inserted) {
|
|
|
130530
130891
|
console.warn(`[budget-refusal-notify] Failed to create follow-up task for budget refusal (task=${ctx.task.id.slice(0, 8)}): ${err}`);
|
|
130531
130892
|
}
|
|
130532
130893
|
}
|
|
130533
|
-
import("./event-bus-
|
|
130894
|
+
import("./event-bus-j2jdg3qb.js").then(({ workflowEventBus: workflowEventBus2 }) => {
|
|
130534
130895
|
workflowEventBus2.emit("task.budget_refused", {
|
|
130535
130896
|
taskId: ctx.task.id,
|
|
130536
130897
|
agentId: ctx.agentId,
|
|
@@ -130548,6 +130909,7 @@ async function emitBudgetRefusalSideEffects(ctx, inserted) {
|
|
|
130548
130909
|
|
|
130549
130910
|
// src/tools/task-action.ts
|
|
130550
130911
|
init_db3();
|
|
130912
|
+
init_model_profiles();
|
|
130551
130913
|
init_types();
|
|
130552
130914
|
var TaskActionSchema = _enum([
|
|
130553
130915
|
"create",
|
|
@@ -130573,6 +130935,7 @@ var taskActionInputSchema = object({
|
|
|
130573
130935
|
modelTier: ModelTierSchema.optional().describe("Portable model tier for the created task: 'smol', 'regular', 'smart', or 'ultra'. Resolved when a worker claims/runs the task. Only used with 'create' action."),
|
|
130574
130936
|
allowCustomModel: boolean().optional().describe("Accept a `model` the model catalog does not list. Without it an unknown model id is rejected. Only used with 'create' action."),
|
|
130575
130937
|
effort: ReasoningEffortSchema.optional().describe("Reasoning effort for the created task: 'off', 'low', 'medium', 'high', 'xhigh', or 'max'. Only used with 'create' action."),
|
|
130938
|
+
profile: string().trim().min(1).optional().describe("Model profile name for the created pool task (see list-model-profiles); only workers on its harness claim it. Exclusive with model and modelTier. Only used with 'create' action."),
|
|
130576
130939
|
requiredCapabilities: array(string()).optional().describe("Capabilities required for pool routing."),
|
|
130577
130940
|
leadOnly: boolean().default(false).describe("Structured authorization constraint: only Lead agents may claim this privileged task.")
|
|
130578
130941
|
});
|
|
@@ -130700,6 +131063,13 @@ async function taskActionHandler(ctx, input) {
|
|
|
130700
131063
|
});
|
|
130701
131064
|
if (modelError)
|
|
130702
131065
|
return taskActionResult({ success: false, message: modelError }, agentId);
|
|
131066
|
+
const profileError = await taskProfileError({
|
|
131067
|
+
profile: input.profile,
|
|
131068
|
+
model: normalizedModel.model,
|
|
131069
|
+
modelTier: normalizedModel.modelTier
|
|
131070
|
+
});
|
|
131071
|
+
if (profileError)
|
|
131072
|
+
return taskActionResult({ success: false, message: profileError }, agentId);
|
|
130703
131073
|
try {
|
|
130704
131074
|
assetKey = key ? await authorizeAssetKeyWrite(key, await resolveTaskAuditUserId(ctx.sourceTaskId, agentId)) : undefined;
|
|
130705
131075
|
} catch (error) {
|
|
@@ -130720,6 +131090,7 @@ async function taskActionHandler(ctx, input) {
|
|
|
130720
131090
|
model: normalizedModel.model,
|
|
130721
131091
|
modelTier: normalizedModel.modelTier,
|
|
130722
131092
|
effort: input.effort,
|
|
131093
|
+
profile: input.profile,
|
|
130723
131094
|
routingAffinity: leadOnly || requiredCapabilities?.length ? { leadOnly, capabilities: requiredCapabilities ?? [] } : undefined
|
|
130724
131095
|
},
|
|
130725
131096
|
origin: "mcp",
|
|
@@ -130734,7 +131105,7 @@ async function taskActionHandler(ctx, input) {
|
|
|
130734
131105
|
options: preCreate.options
|
|
130735
131106
|
};
|
|
130736
131107
|
}
|
|
130737
|
-
const
|
|
131108
|
+
const transacted = getDbClient().transaction(async () => {
|
|
130738
131109
|
switch (action) {
|
|
130739
131110
|
case "create": {
|
|
130740
131111
|
const newTask = await createTaskExtended(preparedCreate.description, preparedCreate.options);
|
|
@@ -131002,6 +131373,11 @@ async function taskActionHandler(ctx, input) {
|
|
|
131002
131373
|
return { success: false, message: `Unknown action: ${action}` };
|
|
131003
131374
|
}
|
|
131004
131375
|
});
|
|
131376
|
+
const result = await transacted.catch((error) => {
|
|
131377
|
+
if (modelProfileRefError(error) !== "missing")
|
|
131378
|
+
throw error;
|
|
131379
|
+
return { success: false, message: `Unknown model profile "${input.profile}".` };
|
|
131380
|
+
});
|
|
131005
131381
|
if ("refusalSideEffects" in result && result.refusalSideEffects && typeof result.refusalSideEffects === "object") {
|
|
131006
131382
|
const sideEffects = result.refusalSideEffects;
|
|
131007
131383
|
await emitBudgetRefusalSideEffects(sideEffects.context, sideEffects.inserted);
|
|
@@ -132356,6 +132732,11 @@ async function createServer(opts = {}) {
|
|
|
132356
132732
|
initDb(process.env.DATABASE_PATH);
|
|
132357
132733
|
ensurePricingSeeded();
|
|
132358
132734
|
startPricingRefreshLoop();
|
|
132735
|
+
try {
|
|
132736
|
+
await ensureModelProfilesSeeded();
|
|
132737
|
+
} catch (err) {
|
|
132738
|
+
console.error("[server] Failed to seed model profiles:", err);
|
|
132739
|
+
}
|
|
132359
132740
|
try {
|
|
132360
132741
|
ensureRbacSeeded();
|
|
132361
132742
|
} catch (err) {
|
|
@@ -132399,6 +132780,7 @@ async function createServer(opts = {}) {
|
|
|
132399
132780
|
registerGetTasksTool(server);
|
|
132400
132781
|
registerGetMetricsTool(server);
|
|
132401
132782
|
registerSendTaskTool(server);
|
|
132783
|
+
registerListModelProfilesTool(server);
|
|
132402
132784
|
registerGetTaskDetailsTool(server);
|
|
132403
132785
|
registerStoreProgressTool(server);
|
|
132404
132786
|
registerMyAgentInfoTool(server);
|
|
@@ -132503,6 +132885,7 @@ async function createServer(opts = {}) {
|
|
|
132503
132885
|
registerGetWorkflowRunTool(server);
|
|
132504
132886
|
registerRetryWorkflowRunTool(server);
|
|
132505
132887
|
registerCancelWorkflowRunTool(server);
|
|
132888
|
+
registerSystemOneDecideTool(server);
|
|
132506
132889
|
registerRequestHumanInputTool(server);
|
|
132507
132890
|
registerCancelApprovalRequestTool(server);
|
|
132508
132891
|
}
|
|
@@ -132674,6 +133057,7 @@ var SDK_TOOL_NAME_MAP = {
|
|
|
132674
133057
|
config_delete: "delete-config",
|
|
132675
133058
|
modelCatalog_refresh: "model-catalog-refresh",
|
|
132676
133059
|
modelCatalog_overlayUpsert: "model-catalog-overlay-upsert",
|
|
133060
|
+
modelProfile_list: "list-model-profiles",
|
|
132677
133061
|
slack_read: "slack-read",
|
|
132678
133062
|
slack_listChannels: "slack-list-channels",
|
|
132679
133063
|
slack_post: "slack-post",
|
|
@@ -132749,7 +133133,8 @@ var SDK_TOOL_NAME_MAP = {
|
|
|
132749
133133
|
page_delete: "delete-page",
|
|
132750
133134
|
metric_create: "create_metric",
|
|
132751
133135
|
request_humanInput: "request-human-input",
|
|
132752
|
-
approval_cancel: "cancel-approval-request"
|
|
133136
|
+
approval_cancel: "cancel-approval-request",
|
|
133137
|
+
systemOne_decide: "system-one-decide"
|
|
132753
133138
|
};
|
|
132754
133139
|
var SDK_ALLOWLIST = Object.keys(SDK_TOOL_NAME_MAP);
|
|
132755
133140
|
var MCP_TOOL_NAMES = new Set(Object.values(SDK_TOOL_NAME_MAP));
|
|
@@ -133540,7 +133925,7 @@ async function deactivateExtensionAgent(name) {
|
|
|
133540
133925
|
|
|
133541
133926
|
// src/extensions/loader.ts
|
|
133542
133927
|
import { tmpdir as tmpdir5 } from "node:os";
|
|
133543
|
-
import { resolve as resolve2 } from "node:path";
|
|
133928
|
+
import { dirname as dirname2, isAbsolute, relative, resolve as resolve2, sep } from "node:path";
|
|
133544
133929
|
import { pathToFileURL } from "node:url";
|
|
133545
133930
|
init_types();
|
|
133546
133931
|
init_secret_scrubber();
|
|
@@ -133610,11 +133995,12 @@ async function removeExtensionTmpRoot() {
|
|
|
133610
133995
|
}
|
|
133611
133996
|
async function loadExtension(input) {
|
|
133612
133997
|
const { record: record3 } = input;
|
|
133613
|
-
const directory =
|
|
133998
|
+
const directory = resolve2(EXTENSIONS_TMP_ROOT, record3.name, record3.contentHash);
|
|
133614
133999
|
try {
|
|
133615
134000
|
const bundlePath = (path2) => {
|
|
133616
134001
|
const filePath = resolve2(directory, path2);
|
|
133617
|
-
|
|
134002
|
+
const relativePath = relative(directory, filePath);
|
|
134003
|
+
if (!isSafeBundlePath(path2) || relativePath === ".." || relativePath.startsWith(`..${sep}`) || isAbsolute(relativePath)) {
|
|
133618
134004
|
throw new Error(`Unsafe bundle file path: ${JSON.stringify(path2)}`);
|
|
133619
134005
|
}
|
|
133620
134006
|
return filePath;
|
|
@@ -133623,8 +134009,7 @@ async function loadExtension(input) {
|
|
|
133623
134009
|
const files = Object.entries(input.files).map(([path2, content]) => [bundlePath(path2), content]);
|
|
133624
134010
|
await Bun.$`mkdir -p ${directory}`.quiet();
|
|
133625
134011
|
for (const [filePath, content] of files) {
|
|
133626
|
-
|
|
133627
|
-
await Bun.$`mkdir -p ${parent}`.quiet();
|
|
134012
|
+
await Bun.$`mkdir -p ${dirname2(filePath)}`.quiet();
|
|
133628
134013
|
await Bun.write(filePath, content);
|
|
133629
134014
|
}
|
|
133630
134015
|
await writeRuntimeShims(directory);
|
|
@@ -133684,7 +134069,7 @@ async function loadExtension(input) {
|
|
|
133684
134069
|
init_db3();
|
|
133685
134070
|
init_secret_scrubber();
|
|
133686
134071
|
init_event_bus();
|
|
133687
|
-
var
|
|
134072
|
+
var subscribed4 = false;
|
|
133688
134073
|
function observed3(eventName, handler) {
|
|
133689
134074
|
return (data) => {
|
|
133690
134075
|
handler(data).catch((error) => {
|
|
@@ -133703,7 +134088,7 @@ var onTaskCreated3 = observed3("task.created", async (data) => {
|
|
|
133703
134088
|
if (task)
|
|
133704
134089
|
await dispatchPost("post.task.created", { task }, { skipExtensionId: extensionIdForAgent(task.creatorAgentId) });
|
|
133705
134090
|
});
|
|
133706
|
-
var
|
|
134091
|
+
var onTaskCompleted4 = observed3("task.completed", async (data) => {
|
|
133707
134092
|
const task = await taskFrom(data);
|
|
133708
134093
|
if (!task)
|
|
133709
134094
|
return;
|
|
@@ -133925,11 +134310,11 @@ var onVcsEvent = (name, data) => {
|
|
|
133925
134310
|
});
|
|
133926
134311
|
};
|
|
133927
134312
|
function initExtensionPostBridge() {
|
|
133928
|
-
if (
|
|
134313
|
+
if (subscribed4)
|
|
133929
134314
|
return;
|
|
133930
|
-
|
|
134315
|
+
subscribed4 = true;
|
|
133931
134316
|
workflowEventBus.on("task.created", onTaskCreated3);
|
|
133932
|
-
workflowEventBus.on("task.completed",
|
|
134317
|
+
workflowEventBus.on("task.completed", onTaskCompleted4);
|
|
133933
134318
|
workflowEventBus.on("task.failed", onTaskFailed3);
|
|
133934
134319
|
workflowEventBus.on("task.cancelled", onTaskCancelled3);
|
|
133935
134320
|
workflowEventBus.on("task.superseded", onTaskSuperseded);
|
|
@@ -133945,11 +134330,11 @@ function initExtensionPostBridge() {
|
|
|
133945
134330
|
workflowEventBus.onPrefix(prefix, onVcsEvent);
|
|
133946
134331
|
}
|
|
133947
134332
|
function teardownExtensionPostBridge() {
|
|
133948
|
-
if (!
|
|
134333
|
+
if (!subscribed4)
|
|
133949
134334
|
return;
|
|
133950
|
-
|
|
134335
|
+
subscribed4 = false;
|
|
133951
134336
|
workflowEventBus.off("task.created", onTaskCreated3);
|
|
133952
|
-
workflowEventBus.off("task.completed",
|
|
134337
|
+
workflowEventBus.off("task.completed", onTaskCompleted4);
|
|
133953
134338
|
workflowEventBus.off("task.failed", onTaskFailed3);
|
|
133954
134339
|
workflowEventBus.off("task.cancelled", onTaskCancelled3);
|
|
133955
134340
|
workflowEventBus.off("task.superseded", onTaskSuperseded);
|
|
@@ -135199,7 +135584,7 @@ class NotifyExecutor extends BaseExecutor {
|
|
|
135199
135584
|
}
|
|
135200
135585
|
}
|
|
135201
135586
|
case "slack": {
|
|
135202
|
-
const { getSlackApp: getSlackApp2 } = await import("./app-
|
|
135587
|
+
const { getSlackApp: getSlackApp2 } = await import("./app-7k8s9w5p.js");
|
|
135203
135588
|
const app = getSlackApp2();
|
|
135204
135589
|
if (!app) {
|
|
135205
135590
|
return {
|
|
@@ -135311,6 +135696,7 @@ function evaluateCondition(op, actual, expected) {
|
|
|
135311
135696
|
|
|
135312
135697
|
// src/workflows/executors/raw-llm.ts
|
|
135313
135698
|
init_zod();
|
|
135699
|
+
init_secret_scrubber();
|
|
135314
135700
|
var RawLlmConfigSchema = exports_external.object({
|
|
135315
135701
|
prompt: exports_external.string(),
|
|
135316
135702
|
model: exports_external.string().optional(),
|
|
@@ -135359,7 +135745,7 @@ async function executeRawLlm(config) {
|
|
|
135359
135745
|
};
|
|
135360
135746
|
} catch (err) {
|
|
135361
135747
|
const httpStatus = err?.status ?? err?.statusCode;
|
|
135362
|
-
const isRateLimited = httpStatus === 429 || httpStatus === 529 || err instanceof Error && /rate.?limit|too many requests
|
|
135748
|
+
const isRateLimited = httpStatus === 429 || httpStatus === 529 || err instanceof Error && /rate.?limit|too many requests|\b529\b/i.test(err.message);
|
|
135363
135749
|
if (isRateLimited) {
|
|
135364
135750
|
throw err;
|
|
135365
135751
|
}
|
|
@@ -135367,12 +135753,12 @@ async function executeRawLlm(config) {
|
|
|
135367
135753
|
return {
|
|
135368
135754
|
status: "success",
|
|
135369
135755
|
output: { result: null, model: modelName },
|
|
135370
|
-
error: `LLM call failed, using fallback port: ${err instanceof Error ? err.message : String(err)}`
|
|
135756
|
+
error: scrubSecrets(`LLM call failed, using fallback port: ${err instanceof Error ? err.message : String(err)}`)
|
|
135371
135757
|
};
|
|
135372
135758
|
}
|
|
135373
135759
|
return {
|
|
135374
135760
|
status: "failed",
|
|
135375
|
-
error: `LLM call failed: ${err instanceof Error ? err.message : String(err)}`
|
|
135761
|
+
error: scrubSecrets(`LLM call failed: ${err instanceof Error ? err.message : String(err)}`)
|
|
135376
135762
|
};
|
|
135377
135763
|
}
|
|
135378
135764
|
}
|
|
@@ -135974,7 +136360,12 @@ function createExecutorRegistry(deps) {
|
|
|
135974
136360
|
|
|
135975
136361
|
// src/workflows/index.ts
|
|
135976
136362
|
var _registry = null;
|
|
135977
|
-
var
|
|
136363
|
+
var eventTriggerListenersInitialized = false;
|
|
136364
|
+
var EVENT_TRIGGER_NAMES = [
|
|
136365
|
+
"slack.message",
|
|
136366
|
+
"azure-devops.work_item.assigned",
|
|
136367
|
+
"azure-devops.work_item.commented"
|
|
136368
|
+
];
|
|
135978
136369
|
function createBuiltInExecutorRegistry() {
|
|
135979
136370
|
return createExecutorRegistry({
|
|
135980
136371
|
db: exports_db,
|
|
@@ -135986,20 +136377,22 @@ function getExecutorRegistry() {
|
|
|
135986
136377
|
_registry ??= createBuiltInExecutorRegistry();
|
|
135987
136378
|
return _registry;
|
|
135988
136379
|
}
|
|
135989
|
-
function
|
|
135990
|
-
if (
|
|
136380
|
+
function setupEventTriggerListeners() {
|
|
136381
|
+
if (eventTriggerListenersInitialized)
|
|
135991
136382
|
return;
|
|
135992
|
-
|
|
135993
|
-
|
|
135994
|
-
|
|
136383
|
+
for (const eventName of EVENT_TRIGGER_NAMES) {
|
|
136384
|
+
workflowEventBus.on(eventName, (payload) => {
|
|
136385
|
+
handleEventTrigger(eventName, payload, getExecutorRegistry()).catch((err) => {
|
|
136386
|
+
console.error(`[workflows] Failed to dispatch ${eventName} event trigger:`, scrubSecrets(err instanceof Error ? err.message : String(err)));
|
|
136387
|
+
});
|
|
135995
136388
|
});
|
|
135996
|
-
}
|
|
135997
|
-
|
|
136389
|
+
}
|
|
136390
|
+
eventTriggerListenersInitialized = true;
|
|
135998
136391
|
}
|
|
135999
136392
|
async function initWorkflows() {
|
|
136000
136393
|
_registry = getExecutorRegistry();
|
|
136001
136394
|
setupWorkflowResumeListener(workflowEventBus, _registry);
|
|
136002
|
-
|
|
136395
|
+
setupEventTriggerListeners();
|
|
136003
136396
|
recoverIncompleteRuns(_registry).catch((err) => {
|
|
136004
136397
|
console.error("[workflows] Failed to recover incomplete runs on startup:", err);
|
|
136005
136398
|
});
|
|
@@ -136009,4 +136402,4 @@ async function initWorkflows() {
|
|
|
136009
136402
|
logOpenWebhookTriggers();
|
|
136010
136403
|
}
|
|
136011
136404
|
|
|
136012
|
-
export { DEFAULT_NEGOTIATED_PROTOCOL_VERSION, SUPPORTED_PROTOCOL_VERSIONS, isJSONRPCRequest, isJSONRPCResultResponse, isJSONRPCErrorResponse, JSONRPCMessageSchema, isInitializeRequest, McpServer, isGitHubEnabled, initGitHub, verifyWebhookSignature, isAgentMailEnabled, initAgentMail, verifyAgentMailWebhook, resolveIdentity, renderIdentity, createAdditiveBuffer, taskModelPin, resumedTaskModelSelection, listHarnessModelSupport, recordHarnessModelSupport, agentRanModel, getAgentHarnessCliVersion, setAgentHarnessCliVersion, sanitizeModelTierOverrides, parseModelTierOverridesHeader, setAgentModelTierOverrides, previewModelTiers, recordClaimModelResolution, harnessModelErrorFor, poolTaskRunsOnHarness, explicitModelError, explicitModelErrorForAgent, referencedBundlePaths, skillDirs, TaskCreationBlockedError, recordUnmappedIdentity2 as recordUnmappedIdentity, MAX_TASK_ATTACHMENT_BYTES, recordTaskAttachmentUpload, buildEffectiveText, bufferedFileFailures, fetchSlackFiles, createSlackTaskWithFiles, notifySlackFileFailures, isRuntimePoolWakeable, isAgentReachable, hasOtherUserMention, broadcastMatches, routeMessage, extractTaskFromMessage, extractSlackMessageText, recoverIncompleteRuns, startRetryPoller, stopRetryPoller, validateTemplateVariables, instantiateTemplate, handleWebhookTrigger, logOpenWebhookTriggers, handleEventTrigger, handleScheduleTrigger, verifyHmacSignature, WebhookError, snapshotWorkflow, snapshotAndUpdateWorkflow, startWaitPoller, stopWaitPoller, RawLlmConfigSchema, RawLlmOutputSchema, executeRawLlm, getExecutorRegistry, initWorkflows, dispatchScheduleTarget, calculateNextRun, startScheduler, stopScheduler, runScheduleNow, ExtensionAssetConflictError, ExtensionOwnershipError, getExtensionFiles, getExtensionById, getExtensionByName, listExtensions, listExtensionVersions, updateExtensionMeta, listExtensionRuns, SDK_ALLOWLIST, mcpToolNameForSdkMethod, mcpOverflowAuthError, hasKvViewArgs, resolveKvView, toolErr, createToolRegistrar, duplicateGuardedQueryKey, warnIfCorsAllowsAnyOrigin, isOriginAllowedForCredentials, allowedCredentialRedirect, setCorsHeaders, parseQueryParams, getPathSegments, wireHttpSpanLifecycle, safeRequestUrlForLog, agentWithCapacity, parseBody, BODY_TOO_LARGE, enforceContentLengthCap, json, jsonError, writeUnhandledError, triggerSchemaErrorResponse, deriveApiBaseUrl, httpServerSemconvAttributes, runtimeInstanceHeader, describeRequestRoute, route, handleMcpBridge, Redacted, SCRIPT_SDK_RESPONSE_LIMIT_BYTES, readScriptSdkJsonResponse, ExtensionConfigError, ExtensionLifecycleError, setExtensionLoopbackBaseUrl, enableExtension, disableExtension, activateVersion, ExtensionAssetsInvalidError, installExtensionWithAssets, uninstallExtension, reloadExtension, loadEnabledExtensions, stopExtensionRuntime, ExtensionAbortedError, isRegistered, isExtensionAgentId, getExtensionBridgeToken, resolveBridgeCallOrigin, extensionIdForAgent, runContext, registerLoaded, unregister, listRegistered, dispatchPre, dispatchPost, stripSiblingBlock, createTaskWithSiblingAwareness, isInboxAllowed, isSenderAllowed, handleMessageReceived, isAzureDevOpsEnabled, initAzureDevOps, verifyAzureDevOpsWebhook, repointTrackerSyncBySwarmId, isAzureDevOpsUrl, canonicalAzureDevOpsRepoUrl, parseAzureDevOpsRepoUrl, createdPullRequestOf, commentedPayloadOf, handlePullRequestCreated, handlePullRequestCommented, handleWorkItemCreated, handleWorkItemUpdated, handleWorkItemCommented, handleWorkItemDeleted, handleWorkItemRestored, AGENT_MAX_TASKS_CONFIG_KEY, reconcileAgentMaxTasksPolicy, resetAgentMaxTasksMirror, upsertSwarmConfigWithPolicyMirror, runtimeStaleThresholdMinutes, upsertRuntimeInstance, getRuntimeInstanceById, insertProvisioningRuntime, markRuntimeTerminated, touchRuntimeInstance, countActiveRuntimeInstancesForAgent, listRuntimeInstancesForAgent, setRuntimeCredentialReady, reconcileAgentStatusFromRuntimes, agentsWithLiveRuntime, expireStaleRuntimeInstances, listRuntimeInstancesForPool, enqueueAuditRow, enqueueAdmissionRow, flushAuditBuffer, startAuditWriter, stopAuditWriter, startAuditGc, stopAuditGc, getTelemetryIngestAnchor, initApiTelemetry, syncTelemetryEnabled, handlePullRequest, handleIssue, handleComment, handlePullRequestReview, handleCheckRun, handleCheckSuite, handleWorkflowRun, isGitLabEnabled, initGitLab, verifyGitLabWebhook, handleMergeRequest, handleIssue2 as handleIssue1, handleNote, handlePipeline, isChatSdkEnabled, getChatSdkConfig, errorMessage, resolveAdapterApiUrl, trackBackground, TelegramBotApiError, callTelegramBotApi, isTrustedTeamsServiceUrl, isChatSdkStopping, startChatSdk, getChatInstance, isChatAdapterConfigured, getChatSdkHealth, stopChatSdk, getJiraMetadata, updateJiraMetadata, clearJiraMetadata, registerJiraWebhook, deleteJiraWebhook, isJiraEnabled, initJira, handleJiraWebhook, handleAgentSessionEvent, handleIssueUpdate, handleIssueDelete, handleAgentSessionPrompted, isLinearEnabled, initLinear, parseCookieHeader, extractAndVerifyCookie, issuePageSessionCookie, resolveHttpRequestAuth, loadGlobalConfigsIntoEnv, reloadGlobalConfigsAndIntegrations, scheduleIntegrationsReload, handleCore, userCtx, resolveTaskAuditUserId, resolveHttpAuditUserId, resolveHttpFavoriteOwner, handleApps, cancelApprovalRequest, cancelApprovalRequestAndRun, getUserCommsPrefs, getTaskDetailsInputSchema, getTaskDetailsOutputSchema, getTaskDetailsHandler, cancelTaskInputSchema, cancelTaskOutputSchema, cancelTaskHandler, executeReadOnlyQuery, assertSelectOnlyQuery, handleDbQuery, snapshotMetric, AssetKeyAuthorizationError, authorizeAssetKeyWrite, getPageEditCounter, snapshotPage, assertOAuthAppUrlsSafe, assertOAuthEgressUrlSafe, listOAuthPresets, listOAuthPresetIds, getOAuthPreset, hydrateOAuthAppFromPreset, scopedResourceScopeIdSchema, resolveScopedResourceId, dedupeMemoryDocumentIds, recordMemoryAccesses, recordRetrievals, ExplicitSelfDuplicateError, applyRating, shouldPersistAutomaticTaskMemory, REBOOT_RETRY_PIN_TAG, getPinCandidateAgent, resolveLeadOnlyRecoveryAssignment, getResumeGeneration, getNextResumeGeneration, inheritedModelSelection, createWorkerTaskFollowUp, createResumeFollowUp, createRerouteDecisionTask, createPoolStarvationDecisionTask, guardTerminalTaskResultWrite, getTasksInputSchema, getTasksOutputSchema, getTasksHandler, reservedNamespaceError, reservedRoomKeyError, updateMcpServerChecked, updateTouchesStdioExecution, MemoryKeyError, refreshLinks, canReadMemory, getLinksForMemory, expandCandidatesWithGraph, indexMemoryContent, isApiDraining, drainApi, markKapsoMessageRead, sendKapsoReaction, getKapsoConfig, getKapsoNumberMapping, markKapsoMessageSeen, changesAllowMerge, updateSwarmRepoChecked, getCombConfig, resolveRoomNamespace, roomRequestInfo, authorizeRoomNamespace, RoomOperationSchema, removeAwarenessStates, roomTopic, decodeRoomSnapshot, roomView, getRoom, changeRoom, applyRoomUpdate, resetRoom, sweepRooms, closeRooms, removeNamespaceRooms, MEMORY_KEYS_DEFAULT_PREFIX, MEMORY_KEYS_MAX_LIMIT, estimateTokens, posteriorMean, listMemoryKeys, checkChunkIntegrity, getMemoryChunks, getPosteriorsByIds, createEvent, createEventsBatch, getEventCountsFiltered, getEventsFiltered, mergeScheduleTiming, validateRecurringTiming, checkOutputSchemaShape, sendTaskOutputSchema, sendTaskHandler, steerTaskUserInputSchema, steerTaskOutputSchema, steerTaskHandler, canClaim, emitBudgetRefusalSideEffects, workflowModelErrors, patchWorkflowDefinition, resolveScriptsOnlyMode, ALL_CAPABILITIES, hasCapability, getEnabledCapabilities, createServer };
|
|
136405
|
+
export { DEFAULT_NEGOTIATED_PROTOCOL_VERSION, SUPPORTED_PROTOCOL_VERSIONS, isJSONRPCRequest, isJSONRPCResultResponse, isJSONRPCErrorResponse, JSONRPCMessageSchema, isInitializeRequest, McpServer, isGitHubEnabled, initGitHub, verifyWebhookSignature, isAgentMailEnabled, initAgentMail, verifyAgentMailWebhook, resolveIdentity, renderIdentity, createAdditiveBuffer, taskModelPin, resumedTaskModelSelection, listHarnessModelSupport, recordHarnessModelSupport, agentRanModel, getAgentHarnessCliVersion, setAgentHarnessCliVersion, sanitizeModelTierOverrides, parseModelTierOverridesHeader, setAgentModelTierOverrides, previewModelTiers, recordClaimModelResolution, harnessModelErrorFor, poolTaskRunsOnHarness, explicitModelError, explicitModelErrorForAgent, referencedBundlePaths, skillDirs, TaskCreationBlockedError, recordUnmappedIdentity2 as recordUnmappedIdentity, MAX_TASK_ATTACHMENT_BYTES, recordTaskAttachmentUpload, buildEffectiveText, bufferedFileFailures, fetchSlackFiles, createSlackTaskWithFiles, notifySlackFileFailures, isRuntimePoolWakeable, isAgentReachable, hasOtherUserMention, broadcastMatches, routeMessage, extractTaskFromMessage, extractSlackMessageText, recoverIncompleteRuns, startRetryPoller, stopRetryPoller, validateTemplateVariables, instantiateTemplate, handleWebhookTrigger, logOpenWebhookTriggers, handleEventTrigger, handleScheduleTrigger, verifyHmacSignature, WebhookError, snapshotWorkflow, snapshotAndUpdateWorkflow, startWaitPoller, stopWaitPoller, RawLlmConfigSchema, RawLlmOutputSchema, executeRawLlm, getExecutorRegistry, initWorkflows, dispatchScheduleTarget, calculateNextRun, startScheduler, stopScheduler, runScheduleNow, ExtensionAssetConflictError, ExtensionOwnershipError, getExtensionFiles, getExtensionById, getExtensionByName, listExtensions, listExtensionVersions, updateExtensionMeta, listExtensionRuns, SDK_ALLOWLIST, mcpToolNameForSdkMethod, mcpOverflowAuthError, hasKvViewArgs, resolveKvView, toolErr, createToolRegistrar, duplicateGuardedQueryKey, warnIfCorsAllowsAnyOrigin, isOriginAllowedForCredentials, allowedCredentialRedirect, setCorsHeaders, parseQueryParams, getPathSegments, wireHttpSpanLifecycle, safeRequestUrlForLog, agentWithCapacity, parseBody, BODY_TOO_LARGE, enforceContentLengthCap, json, jsonError, writeUnhandledError, triggerSchemaErrorResponse, deriveApiBaseUrl, httpServerSemconvAttributes, runtimeInstanceHeader, describeRequestRoute, route, handleMcpBridge, Redacted, SCRIPT_SDK_RESPONSE_LIMIT_BYTES, readScriptSdkJsonResponse, ExtensionConfigError, ExtensionLifecycleError, setExtensionLoopbackBaseUrl, enableExtension, disableExtension, activateVersion, ExtensionAssetsInvalidError, installExtensionWithAssets, uninstallExtension, reloadExtension, loadEnabledExtensions, stopExtensionRuntime, ExtensionAbortedError, isRegistered, isExtensionAgentId, getExtensionBridgeToken, resolveBridgeCallOrigin, extensionIdForAgent, runContext, registerLoaded, unregister, listRegistered, dispatchPre, dispatchPost, stripSiblingBlock, createTaskWithSiblingAwareness, isInboxAllowed, isSenderAllowed, handleMessageReceived, isAzureDevOpsEnabled, initAzureDevOps, verifyAzureDevOpsWebhook, repointTrackerSyncBySwarmId, isAzureDevOpsUrl, canonicalAzureDevOpsRepoUrl, parseAzureDevOpsRepoUrl, createdPullRequestOf, commentedPayloadOf, handlePullRequestCreated, handlePullRequestCommented, handleWorkItemCreated, handleWorkItemUpdated, handleWorkItemCommented, handleWorkItemDeleted, handleWorkItemRestored, initAzureDevOpsOutbound, AGENT_MAX_TASKS_CONFIG_KEY, reconcileAgentMaxTasksPolicy, resetAgentMaxTasksMirror, upsertSwarmConfigWithPolicyMirror, runtimeStaleThresholdMinutes, upsertRuntimeInstance, getRuntimeInstanceById, insertProvisioningRuntime, markRuntimeTerminated, touchRuntimeInstance, countActiveRuntimeInstancesForAgent, listRuntimeInstancesForAgent, setRuntimeCredentialReady, reconcileAgentStatusFromRuntimes, agentsWithLiveRuntime, expireStaleRuntimeInstances, listRuntimeInstancesForPool, enqueueAuditRow, enqueueAdmissionRow, flushAuditBuffer, startAuditWriter, stopAuditWriter, startAuditGc, stopAuditGc, getTelemetryIngestAnchor, initApiTelemetry, syncTelemetryEnabled, handlePullRequest, handleIssue, handleComment, handlePullRequestReview, handleCheckRun, handleCheckSuite, handleWorkflowRun, isGitLabEnabled, initGitLab, verifyGitLabWebhook, handleMergeRequest, handleIssue2 as handleIssue1, handleNote, handlePipeline, isChatSdkEnabled, getChatSdkConfig, errorMessage, resolveAdapterApiUrl, trackBackground, TelegramBotApiError, callTelegramBotApi, isTrustedTeamsServiceUrl, isChatSdkStopping, startChatSdk, getChatInstance, isChatAdapterConfigured, getChatSdkHealth, stopChatSdk, getJiraMetadata, updateJiraMetadata, clearJiraMetadata, registerJiraWebhook, deleteJiraWebhook, isJiraEnabled, initJira, handleJiraWebhook, handleAgentSessionEvent, handleIssueUpdate, handleIssueDelete, handleAgentSessionPrompted, isLinearEnabled, initLinear, parseCookieHeader, extractAndVerifyCookie, issuePageSessionCookie, resolveHttpRequestAuth, loadGlobalConfigsIntoEnv, reloadGlobalConfigsAndIntegrations, scheduleIntegrationsReload, handleCore, userCtx, resolveTaskAuditUserId, resolveHttpAuditUserId, resolveHttpFavoriteOwner, handleApps, cancelApprovalRequest, cancelApprovalRequestAndRun, getUserCommsPrefs, getTaskDetailsInputSchema, getTaskDetailsOutputSchema, getTaskDetailsHandler, cancelTaskInputSchema, cancelTaskOutputSchema, cancelTaskHandler, executeReadOnlyQuery, assertSelectOnlyQuery, handleDbQuery, snapshotMetric, AssetKeyAuthorizationError, authorizeAssetKeyWrite, getPageEditCounter, snapshotPage, assertOAuthAppUrlsSafe, assertOAuthEgressUrlSafe, listOAuthPresets, listOAuthPresetIds, getOAuthPreset, hydrateOAuthAppFromPreset, scopedResourceScopeIdSchema, resolveScopedResourceId, dedupeMemoryDocumentIds, recordMemoryAccesses, recordRetrievals, ExplicitSelfDuplicateError, applyRating, shouldPersistAutomaticTaskMemory, REBOOT_RETRY_PIN_TAG, getPinCandidateAgent, resolveLeadOnlyRecoveryAssignment, getResumeGeneration, getNextResumeGeneration, inheritedModelSelection, createWorkerTaskFollowUp, createResumeFollowUp, createRerouteDecisionTask, createPoolStarvationDecisionTask, guardTerminalTaskResultWrite, getTasksInputSchema, getTasksOutputSchema, getTasksHandler, reservedNamespaceError, reservedRoomKeyError, updateMcpServerChecked, updateTouchesStdioExecution, MemoryKeyError, refreshLinks, canReadMemory, getLinksForMemory, expandCandidatesWithGraph, indexMemoryContent, isApiDraining, drainApi, markKapsoMessageRead, sendKapsoReaction, getKapsoConfig, getKapsoNumberMapping, markKapsoMessageSeen, changesAllowMerge, updateSwarmRepoChecked, getCombConfig, resolveRoomNamespace, roomRequestInfo, authorizeRoomNamespace, RoomOperationSchema, removeAwarenessStates, roomTopic, decodeRoomSnapshot, roomView, getRoom, changeRoom, applyRoomUpdate, resetRoom, sweepRooms, closeRooms, removeNamespaceRooms, MEMORY_KEYS_DEFAULT_PREFIX, MEMORY_KEYS_MAX_LIMIT, estimateTokens, posteriorMean, listMemoryKeys, checkChunkIntegrity, getMemoryChunks, getPosteriorsByIds, createEvent, createEventsBatch, getEventCountsFiltered, getEventsFiltered, mergeScheduleTiming, validateRecurringTiming, checkOutputSchemaShape, sendTaskOutputSchema, sendTaskHandler, steerTaskUserInputSchema, steerTaskOutputSchema, steerTaskHandler, canClaim, emitBudgetRefusalSideEffects, workflowModelErrors, patchWorkflowDefinition, resolveScriptsOnlyMode, ALL_CAPABILITIES, hasCapability, getEnabledCapabilities, createServer };
|