@desplega.ai/agent-swarm 1.166.0 → 1.168.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-zhejfecx.js +34 -0
- package/dist/{actions-qz3m692w.js → actions-7jg840nr.js} +25 -25
- package/dist/{amp-adapter-j1xbmsqz.js → amp-adapter-ye6rnetm.js} +4 -4
- package/dist/{anthropic-messages-hst62ws9.js → anthropic-messages-13yn502s.js} +4 -4
- package/dist/{app-43vrdmv8.js → app-ffes2kyf.js} +10 -9
- package/dist/{assistant-ertffmka.js → assistant-fhm5smyz.js} +26 -26
- package/dist/{azure-openai-responses-mh8tvf78.js → azure-openai-responses-9st34pfz.js} +5 -5
- package/dist/{boot-reembed-998jtpdg.js → boot-reembed-20q3nzvg.js} +9 -8
- package/dist/{boot-reembed-s7k7c6v2.js → boot-reembed-jvfadhsk.js} +9 -8
- package/dist/{boot-scrub-sweep-nepsk4t1.js → boot-scrub-sweep-jtfajzve.js} +10 -9
- package/dist/{boot-seeds-vvzs1zhk.js → boot-seeds-9qt0j8j2.js} +12 -11
- package/dist/{claude-adapter-2zvmekrp.js → claude-adapter-a8znhthz.js} +24 -22
- package/dist/{claude-managed-adapter-s49wbk8t.js → claude-managed-adapter-tzwxy803.js} +4 -4
- package/dist/{claude-managed-setup-cvhqq8qn.js → claude-managed-setup-nrhfx5b0.js} +3 -3
- package/dist/{claude-sdk-session-kkbxtw5q.js → claude-sdk-session-7x7chdrs.js} +7608 -7596
- package/dist/{cli-zsh093hk.js → cli-014vns2y.js} +63 -1
- package/dist/{cli-8kgvmkak.js → cli-0jngabtb.js} +1 -1
- package/dist/{cli-qvfk83fy.js → cli-13xwcqvj.js} +2 -2
- package/dist/{cli-0nhdwxd5.js → cli-43jg9xdw.js} +3 -3
- package/dist/{cli-cpfmqz3n.js → cli-47zfzshm.js} +5 -5
- package/dist/{cli-zy7vwsne.js → cli-5qkcdv8c.js} +16 -9
- package/dist/{cli-cwxhbf43.js → cli-5t5my0h8.js} +85 -2
- package/dist/{cli-y59h2pk9.js → cli-69egj654.js} +1 -1
- package/dist/{cli-68r1j4sg.js → cli-6bpvv8h4.js} +3 -3
- package/dist/{cli-yshaazs1.js → cli-74ez9b66.js} +63 -20
- package/dist/{cli-32bca7nr.js → cli-7avy4v8w.js} +1 -1
- package/dist/{cli-f2n17zhp.js → cli-7mhy3ths.js} +21 -18
- package/dist/{cli-q38n4bq0.js → cli-95zs84qw.js} +3 -3
- package/dist/{cli-fn697bnt.js → cli-9q0bh411.js} +21 -8
- package/dist/{cli-rggdq8wq.js → cli-9q24yyvs.js} +3 -3
- package/dist/cli-a35hzdve.js +33 -0
- package/dist/{cli-3qn4r334.js → cli-aj1e0h0d.js} +20 -14
- package/dist/{cli-rsy933yz.js → cli-bcspch6h.js} +30 -19
- package/dist/{cli-x3x0qwky.js → cli-bxqez1p0.js} +51 -23
- package/dist/{cli-ng97fjq7.js → cli-cmxkbzzs.js} +33 -7
- package/dist/{cli-df56tqdw.js → cli-ee0402n1.js} +198 -70
- package/dist/{cli-mwegs4af.js → cli-ew0c3a1j.js} +3 -3
- package/dist/{cli-ysnyhws9.js → cli-ewhwpyrb.js} +54 -51
- package/dist/{cli-j2jbr8af.js → cli-fhj4y16f.js} +1 -1
- package/dist/{cli-8t229cmr.js → cli-fqq06kkb.js} +30 -17
- package/dist/{cli-jvj6a0cv.js → cli-g6gx2dn1.js} +54 -19
- package/dist/{cli-nexwh8zg.js → cli-g7k7zbcz.js} +12 -5
- package/dist/{cli-ecknp7p1.js → cli-j05x7pnb.js} +10 -10
- package/dist/{cli-gt8azyet.js → cli-jb931ba2.js} +1 -1
- package/dist/{cli-nvvfd8bq.js → cli-jbzbr36n.js} +4091 -3793
- package/dist/{cli-3ddybbbx.js → cli-jvmtxqtc.js} +26 -14
- package/dist/{cli-pkke6geq.js → cli-km4x66j0.js} +83 -65
- package/dist/{cli-b0f70z24.js → cli-mn8qkd8v.js} +1 -1
- package/dist/{cli-0qjcsxgz.js → cli-nctfv2yy.js} +99 -9
- package/dist/{cli-4r1sjfc4.js → cli-ng1pmdx6.js} +10 -10
- package/dist/cli-nkqjj42q.js +104 -0
- package/dist/{cli-aqcey741.js → cli-p5jqk8fr.js} +1 -1
- package/dist/{cli-66zh26sp.js → cli-pgehz8e1.js} +57 -17
- package/dist/cli-q1vnz8wv.js +96 -0
- package/dist/{cli-fj86xr3c.js → cli-qd97v6z2.js} +2 -2
- package/dist/{cli-p4ztb80h.js → cli-r7eeddkq.js} +13 -8
- package/dist/{cli-8ssjez7e.js → cli-rhy7z1rp.js} +22 -11
- package/dist/{cli-vzc73wet.js → cli-rr5z1j4p.js} +87 -69
- package/dist/{cli-4mevd1hf.js → cli-s9y81s7j.js} +5 -5
- package/dist/{cli-dw2q9f7g.js → cli-svah6b6w.js} +4 -4
- package/dist/{cli-h3x613ze.js → cli-tc5zec7v.js} +6 -6
- package/dist/{cli-ttbsse3f.js → cli-tmhsxhb8.js} +1 -1
- package/dist/{cli-feh3dkah.js → cli-v1w7pbd8.js} +2 -1
- package/dist/{cli-10zmp1p7.js → cli-vr5avem2.js} +27 -32
- package/dist/{cli-bzr0ftht.js → cli-wnb9b2g3.js} +19 -0
- package/dist/{cli-krqm5f11.js → cli-xezn9nkh.js} +16 -13
- package/dist/{cli-8kt0bmgx.js → cli-xf713zz0.js} +2 -2
- package/dist/{cli-6zcfw0x7.js → cli-y195hv1a.js} +1 -1
- package/dist/{cli-x7kpr72a.js → cli-ytmmyj7f.js} +2 -2
- package/dist/{cli-v2a8x45d.js → cli-z48ggfyq.js} +11 -6
- package/dist/{cli-qbksc292.js → cli-zy39d433.js} +2 -0
- package/dist/cli.js +28 -28
- package/dist/{cloudflare-workers-ai-system-one-tt484t61.js → cloudflare-workers-ai-system-one-sta45jf9.js} +7 -5
- package/dist/{codex-adapter-dw1wxqt8.js → codex-adapter-n63k33d3.js} +18 -18
- package/dist/{codex-login-terbdsqq.js → codex-login-g1cyt5zm.js} +1 -1
- package/dist/{codex-session-runner-3cgb8y1g.js → codex-session-runner-xkxfd81a.js} +18 -18
- package/dist/{commands-mhxam6z2.js → commands-q4mfhn51.js} +9 -8
- package/dist/{cursor-adapter-2qda3st7.js → cursor-adapter-v8mm6bp5.js} +5 -5
- package/dist/{db-sjks418k.js → db-1t0bj3pc.js} +9 -8
- package/dist/{dispatcher-1es759rn.js → dispatcher-k1fhavcf.js} +24 -24
- package/dist/{dsh-adapter-bek4cyw9.js → dsh-adapter-5423p70m.js} +5 -5
- package/dist/{easter-egg-3d-mtpnw06s.js → easter-egg-3d-66zxervv.js} +2 -2
- package/dist/{execute-s4ccjq3n.js → execute-h4jgevyw.js} +61 -11
- package/dist/{google-generative-ai-d6nphg3q.js → google-generative-ai-b8zxrpax.js} +5 -5
- package/dist/{google-vertex-cpshkref.js → google-vertex-nrdd697t.js} +5 -5
- package/dist/{grok-adapter-ar9cw9jg.js → grok-adapter-phrndeb8.js} +18 -8
- package/dist/{handlers-1gkbhktr.js → handlers-59ywqwzh.js} +27 -27
- package/dist/{hook-vxa3tcsy.js → hook-atj0swc2.js} +14 -14
- package/dist/{hook-ds2zxq9v.js → hook-mew1chq9.js} +42 -31
- package/dist/{http-3h21z9md.js → http-ef2fnn9v.js} +953 -98
- package/dist/{index-n99fycq7.js → index-48pb9erw.js} +24 -24
- package/dist/{index-bn6cy8ps.js → index-9fc2h7ww.js} +24 -24
- package/dist/{index-9b65j1m5.js → index-gr69c43q.js} +9 -8
- package/dist/{index-f8xnqrye.js → index-h26wjcfy.js} +43 -24
- package/dist/{index-dkfxpkmm.js → index-w2yhye23.js} +25 -25
- package/dist/{keepalive-3xspa9jw.js → keepalive-qhcqz56v.js} +11 -10
- package/dist/{lead-6qphc124.js → lead-hpk5r3b1.js} +47 -47
- package/dist/{llama-cpp-classify-tgj35k8d.js → llama-cpp-classify-6erb7wwv.js} +3 -1
- package/dist/{maintenance-0teem1bb.js → maintenance-nvkyp2xe.js} +9 -8
- package/dist/{mistral-conversations-8445ddjn.js → mistral-conversations-059y51zt.js} +4 -4
- package/dist/{node-9sg7ajby.js → node-qm9eb6z0.js} +1 -1
- package/dist/{oauth-refresh-sweep-sh9q25xp.js → oauth-refresh-sweep-ngskthwh.js} +10 -9
- package/dist/{onboard-54qmnqxe.js → onboard-yfnkqhxc.js} +2 -2
- package/dist/{openai-codex-responses-9ynm88zy.js → openai-codex-responses-jzxkta9b.js} +8 -7
- package/dist/{openai-completions-nhqwjmaw.js → openai-completions-663yncfq.js} +4 -4
- package/dist/openai-decisions-vj9nkpf8.js +162 -0
- package/dist/{openai-responses-xx1c4kgm.js → openai-responses-m3g43rrt.js} +5 -5
- package/dist/{opencode-adapter-wjfa2wvd.js → opencode-adapter-yjyqynzf.js} +7 -7
- package/dist/{openrouter-images-8yx3487g.js → openrouter-images-kr60n6b9.js} +1 -1
- package/dist/{otel-impl-ycqzp2a1.js → otel-impl-hhm64r6m.js} +1 -1
- package/dist/{pi-messages-vxdt8v7j.js → pi-messages-xszk613n.js} +1 -1
- package/dist/{pi-mono-adapter-e77e9zst.js → pi-mono-adapter-0eg8kw2c.js} +68 -51
- package/dist/{pricing-refresh-atnkngqs.js → pricing-refresh-35f91nx2.js} +11 -10
- package/dist/{rbac-roles-j78wdksm.js → rbac-roles-97w370qj.js} +10 -9
- package/dist/{rbac-roles-9pjphh9q.js → rbac-roles-z6sje3gy.js} +9 -8
- package/dist/{render-v2-pxjs49fx.js → render-v2-n4v66bj3.js} +10 -9
- package/dist/{runtime-v2t1r79e.js → runtime-h9ha1mq6.js} +4 -4
- package/dist/{setup-ymej0xtx.js → setup-m3hhyv5f.js} +2 -2
- package/dist/{typesafe-system-one-datfr82p.js → typesafe-system-one-e988vty7.js} +7 -5
- package/dist/{virtual-modules-wm8mxdxx.js → virtual-modules-ftr9kwe8.js} +11 -11
- package/dist/{work-objects-3nh4ymzb.js → work-objects-mxf2c842.js} +27 -27
- package/dist/{worker-qa9fkz5s.js → worker-9t07z1gq.js} +47 -47
- package/openapi.json +72 -1
- package/package.json +10 -10
- package/src/be/memory/providers/openai-embedding.ts +7 -2
- package/src/be/memory/raters/llm-summarizer.ts +7 -2
- package/src/be/modelsdev-cache.json +61 -0
- package/src/be/script-connections.ts +40 -6
- package/src/be/seed-pricing.ts +84 -53
- package/src/be/swarm-config-guard.ts +14 -0
- package/src/commands/provider-credentials.ts +28 -5
- package/src/commands/runner.ts +7 -12
- package/src/extensions/catalog.generated.json +17 -0
- package/src/heartbeat/heartbeat.ts +91 -19
- package/src/hooks/hook.ts +72 -27
- package/src/http/mcp.ts +5 -0
- package/src/http/onboarding.ts +2 -0
- package/src/http/script-connections.ts +35 -0
- package/src/providers/acp-targets.ts +10 -5
- package/src/providers/amp-adapter.ts +1 -1
- package/src/providers/claude-adapter.ts +32 -0
- package/src/providers/claude-background-keepalive.ts +100 -0
- package/src/providers/claude-sdk-session.ts +6 -0
- package/src/providers/codex-adapter.ts +30 -3
- package/src/providers/codex-oauth/auth-json.ts +21 -4
- package/src/providers/codex-oauth/types.ts +2 -0
- package/src/providers/dsh-adapter.ts +11 -2
- package/src/providers/grok-adapter.ts +18 -2
- package/src/providers/opencode-adapter.ts +21 -5
- package/src/providers/pi-mono-extension.ts +56 -25
- package/src/providers/pricing-sources.md +2 -0
- package/src/scheduler/scheduler.ts +82 -13
- package/src/scripts-runtime/executors/registry.ts +1 -1
- package/src/server.ts +63 -3
- package/src/tests/acp-adapter.test.ts +152 -12
- package/src/tests/ci-unit-test-report.test.ts +73 -0
- package/src/tests/claude-background-keepalive-wiring.test.ts +220 -0
- package/src/tests/claude-background-keepalive.fixture.ts +162 -0
- package/src/tests/claude-background-keepalive.test.ts +139 -0
- package/src/tests/claude-default-route.test.ts +75 -0
- package/src/tests/claude-hook-output.test.ts +233 -0
- package/src/tests/codex-adapter-pool-auth-revalidate.test.ts +4 -2
- package/src/tests/codex-adapter.test.ts +166 -26
- package/src/tests/codex-oauth-auth-timestamps.test.ts +76 -0
- package/src/tests/codex-oauth.test.ts +4 -1
- package/src/tests/connection-embedded-auth.test.ts +51 -0
- package/src/tests/context-window.test.ts +2 -2
- package/src/tests/credential-check.test.ts +51 -1
- package/src/tests/docs-index-footprint.test.js +3 -3
- package/src/tests/dsh-adapter.test.ts +24 -2
- package/src/tests/enabled-tools.test.ts +269 -0
- package/src/tests/entrypoint-codex-oauth-seed.test.ts +12 -0
- package/src/tests/extensions-catalog.test.ts +1 -0
- package/src/tests/extensions-example-slack-reply-gate.test.ts +756 -0
- package/src/tests/grok-adapter.test.ts +13 -0
- package/src/tests/haiku-5-5-pricing.test.ts +38 -0
- package/src/tests/heartbeat-checklist.test.ts +158 -1
- package/src/tests/onboarding.test.ts +44 -0
- package/src/tests/opencode-adapter.test.ts +66 -3
- package/src/tests/opencode-plugin.test.ts +37 -0
- package/src/tests/openrouter-attribution-call-sites.test.ts +204 -0
- package/src/tests/openrouter-base-url.test.ts +30 -39
- package/src/tests/pi-mono-extension.test.ts +161 -2
- package/src/tests/pricing-refresh.test.ts +70 -1
- package/src/tests/reasoning-effort.test.ts +3 -1
- package/src/tests/schedule-target-type.test.ts +136 -0
- package/src/tests/script-connections-http.test.ts +45 -0
- package/src/tests/script-connections-mcp.test.ts +41 -0
- package/src/tests/script-executor-registry.test.ts +18 -0
- package/src/tests/send-task-self-send.test.ts +107 -0
- package/src/tests/telemetry-trigger.test.ts +12 -1
- package/src/tests/workflow-llm.test.ts +14 -0
- package/src/tests/workflow-system-one-decision-providers.test.ts +33 -0
- package/src/tools/request-human-input.ts +7 -2
- package/src/tools/script-connections/tool.ts +35 -3
- package/src/tools/send-task.ts +9 -1
- package/src/utils/enabled-tools.ts +27 -0
- package/src/utils/internal-ai/complete-structured.ts +11 -3
- package/src/utils/openrouter-base-url.ts +23 -0
- package/src/workflows/executors/raw-llm.ts +1 -0
- package/src/workflows/executors/system-one-decision.ts +2 -0
- package/src/workflows/executors/validate.ts +1 -0
- package/src/workflows/executors/workflow-llm.ts +9 -2
- package/templates/extensions/README.md +1 -0
- package/templates/extensions/slack-reply-gate/README.md +98 -0
- package/templates/extensions/slack-reply-gate/hooks.ts +582 -0
- package/templates/extensions/slack-reply-gate/manifest.json +8 -0
- package/templates/skills/agent-browser/SKILL.md +2 -0
- package/templates/skills/agent-browser/content.md +2 -0
- package/templates/skills/code-quality/content.md +1 -0
- package/templates/skills/heartbeat-runbook/content.md +1 -1
- package/templates/skills/swarm-scripts/SKILL.md +10 -0
- package/templates/skills/swarm-scripts/content.md +10 -0
- package/templates/skills/work-on-task/SKILL.md +4 -0
- package/templates/skills/work-on-task/content.md +4 -0
- package/templates/skills/workflow-iterate/content.md +9 -0
- package/dist/acp-adapter-yzfxn8vj.js +0 -23
- package/dist/cli-3dpj7atn.js +0 -11
- package/dist/cli-gvcgmx69.js +0 -183
- package/dist/{cli-jhm6hzjn.js → cli-mxvnnv5q.js} +7 -7
- package/dist/{codex-hook-d2rkvf39.js → codex-hook-15dgc4cb.js} +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getDb,
|
|
3
3
|
init_db1 as init_db
|
|
4
|
-
} from "./cli-
|
|
4
|
+
} from "./cli-74ez9b66.js";
|
|
5
5
|
|
|
6
6
|
// src/be/seed-pricing.ts
|
|
7
7
|
init_db();
|
|
@@ -152,16 +152,47 @@ function projectCostBlock(provider, model, cost, opts = {}) {
|
|
|
152
152
|
}
|
|
153
153
|
return rows;
|
|
154
154
|
}
|
|
155
|
-
function
|
|
155
|
+
function outranksSource(candidate, current, key) {
|
|
156
|
+
const a = candidate.toLowerCase();
|
|
157
|
+
const b = current.toLowerCase();
|
|
158
|
+
if (a === key !== (b === key))
|
|
159
|
+
return a === key;
|
|
160
|
+
return a > b;
|
|
161
|
+
}
|
|
162
|
+
function collapseNormalizedIds(sourced) {
|
|
163
|
+
const modelKey = (row) => `${row.provider}\x00${row.model}`;
|
|
164
|
+
const winners = new Map;
|
|
165
|
+
for (const { sourceId, row } of sourced) {
|
|
166
|
+
const current = winners.get(modelKey(row));
|
|
167
|
+
if (current === undefined || outranksSource(sourceId, current, row.model)) {
|
|
168
|
+
winners.set(modelKey(row), sourceId);
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
const seen = new Set;
|
|
156
172
|
const rows = [];
|
|
173
|
+
for (const { sourceId, row } of sourced) {
|
|
174
|
+
if (winners.get(modelKey(row)) !== sourceId)
|
|
175
|
+
continue;
|
|
176
|
+
const rowKey = `${modelKey(row)}\x00${row.tokenClass}`;
|
|
177
|
+
if (seen.has(rowKey))
|
|
178
|
+
continue;
|
|
179
|
+
seen.add(rowKey);
|
|
180
|
+
rows.push(row);
|
|
181
|
+
}
|
|
182
|
+
return rows;
|
|
183
|
+
}
|
|
184
|
+
function buildModelsDevSeedRows(cache) {
|
|
185
|
+
const sourced = [];
|
|
186
|
+
const add = (sourceId, projected) => {
|
|
187
|
+
for (const row of projected)
|
|
188
|
+
sourced.push({ sourceId, row });
|
|
189
|
+
};
|
|
157
190
|
const anthropic = cache.anthropic?.models ?? {};
|
|
158
191
|
for (const [id, model] of Object.entries(anthropic)) {
|
|
159
192
|
if (!model?.cost)
|
|
160
193
|
continue;
|
|
161
194
|
for (const provider of ["claude", "claude-managed"]) {
|
|
162
|
-
|
|
163
|
-
rows.push(row);
|
|
164
|
-
}
|
|
195
|
+
add(id, projectCostBlock(provider, id, model.cost));
|
|
165
196
|
}
|
|
166
197
|
}
|
|
167
198
|
for (const [shortname, fullId] of Object.entries(ANTHROPIC_SHORTNAME_TO_MODELSDEV)) {
|
|
@@ -169,96 +200,68 @@ function buildModelsDevSeedRows(cache) {
|
|
|
169
200
|
if (!cost)
|
|
170
201
|
continue;
|
|
171
202
|
for (const provider of ["claude", "claude-managed"]) {
|
|
172
|
-
|
|
173
|
-
rows.push(row);
|
|
174
|
-
}
|
|
203
|
+
add(shortname, projectCostBlock(provider, shortname, cost));
|
|
175
204
|
}
|
|
176
205
|
}
|
|
177
206
|
for (const [shortname, fullId] of Object.entries(ANTHROPIC_SHORTNAME_TO_MODELSDEV)) {
|
|
178
207
|
const cost = anthropic[fullId]?.cost ?? (cache.anthropic ? ANTHROPIC_SHORTNAME_PRICING_FALLBACKS[fullId] : undefined);
|
|
179
208
|
if (!cost)
|
|
180
209
|
continue;
|
|
181
|
-
|
|
182
|
-
rows.push(row);
|
|
183
|
-
}
|
|
210
|
+
add(shortname, projectCostBlock("pi", shortname, cost, { anthropicBilled: true }));
|
|
184
211
|
}
|
|
185
212
|
for (const section of ["anthropic", "openai", "google", "fireworks-ai"]) {
|
|
186
213
|
for (const [id, model] of Object.entries(cache[section]?.models ?? {})) {
|
|
187
214
|
if (!model?.cost)
|
|
188
215
|
continue;
|
|
189
|
-
|
|
190
|
-
rows.push(row);
|
|
191
|
-
}
|
|
216
|
+
add(id, projectCostBlock("amp", id, model.cost));
|
|
192
217
|
}
|
|
193
218
|
}
|
|
194
219
|
const openai = cache.openai?.models ?? {};
|
|
195
220
|
for (const [id, model] of Object.entries(openai)) {
|
|
196
221
|
if (!model?.cost)
|
|
197
222
|
continue;
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
}
|
|
201
|
-
for (const row of projectCostBlock("pi", id, model.cost)) {
|
|
202
|
-
rows.push(row);
|
|
203
|
-
}
|
|
223
|
+
add(id, projectCostBlock("codex", id, model.cost));
|
|
224
|
+
add(id, projectCostBlock("pi", id, model.cost));
|
|
204
225
|
}
|
|
205
226
|
for (const vendor of ["openai", "anthropic", "google", "xai"]) {
|
|
206
227
|
for (const [id, model] of Object.entries(cache[vendor]?.models ?? {})) {
|
|
207
228
|
if (!model?.cost)
|
|
208
229
|
continue;
|
|
209
|
-
|
|
210
|
-
rows.push(row);
|
|
211
|
-
}
|
|
230
|
+
add(id, projectCostBlock("cursor", id, model.cost, { anthropicBilled: false }));
|
|
212
231
|
}
|
|
213
232
|
}
|
|
214
233
|
for (const [id, model] of Object.entries(cache.xai?.models ?? {})) {
|
|
215
234
|
if (!model?.cost)
|
|
216
235
|
continue;
|
|
217
|
-
|
|
218
|
-
rows.push(row);
|
|
219
|
-
}
|
|
236
|
+
add(id, projectCostBlock("grok", id, model.cost, { anthropicBilled: false }));
|
|
220
237
|
}
|
|
221
238
|
const deepseek = cache.deepseek?.models ?? {};
|
|
222
239
|
for (const [id, model] of Object.entries(deepseek)) {
|
|
223
240
|
if (!model?.cost)
|
|
224
241
|
continue;
|
|
225
|
-
|
|
226
|
-
rows.push(row);
|
|
227
|
-
}
|
|
242
|
+
add(id, projectCostBlock("dsh", id, model.cost));
|
|
228
243
|
}
|
|
229
244
|
const openrouter = cache.openrouter?.models ?? {};
|
|
230
245
|
for (const [id, model] of Object.entries(openrouter)) {
|
|
231
246
|
if (!model?.cost)
|
|
232
247
|
continue;
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
}
|
|
236
|
-
for (const row of projectCostBlock("pi", id, model.cost, {
|
|
248
|
+
add(id, projectCostBlock("opencode", id, model.cost));
|
|
249
|
+
add(id, projectCostBlock("pi", id, model.cost, {
|
|
237
250
|
anthropicBilled: id.startsWith("anthropic/")
|
|
238
|
-
}))
|
|
239
|
-
|
|
240
|
-
}
|
|
241
|
-
for (const row of projectCostBlock("dsh", id, model.cost, {
|
|
251
|
+
}));
|
|
252
|
+
add(id, projectCostBlock("dsh", id, model.cost, {
|
|
242
253
|
anthropicBilled: id.startsWith("anthropic/")
|
|
243
|
-
}))
|
|
244
|
-
|
|
245
|
-
}
|
|
246
|
-
for (const row of projectCostBlock("grok", id, model.cost, {
|
|
254
|
+
}));
|
|
255
|
+
add(id, projectCostBlock("grok", id, model.cost, {
|
|
247
256
|
anthropicBilled: id.startsWith("anthropic/")
|
|
248
|
-
}))
|
|
249
|
-
rows.push(row);
|
|
250
|
-
}
|
|
257
|
+
}));
|
|
251
258
|
if (id.startsWith("google/")) {
|
|
252
259
|
const geminiKey = id.replace(/^google\//, "");
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
}
|
|
256
|
-
for (const row of projectCostBlock("gemini", id, model.cost)) {
|
|
257
|
-
rows.push(row);
|
|
258
|
-
}
|
|
260
|
+
add(geminiKey, projectCostBlock("gemini", geminiKey, model.cost));
|
|
261
|
+
add(id, projectCostBlock("gemini", id, model.cost));
|
|
259
262
|
}
|
|
260
263
|
}
|
|
261
|
-
return
|
|
264
|
+
return collapseNormalizedIds(sourced);
|
|
262
265
|
}
|
|
263
266
|
function buildPricingSeedRows(cache) {
|
|
264
267
|
const modelsdevRows = cache ? buildModelsDevSeedRows(cache) : [];
|
|
@@ -4,9 +4,15 @@ import {
|
|
|
4
4
|
import {
|
|
5
5
|
readPkgVersion
|
|
6
6
|
} from "./cli-gt4hxb8p.js";
|
|
7
|
+
import {
|
|
8
|
+
hasCodexOAuthPoolSlots
|
|
9
|
+
} from "./cli-bqjfjex4.js";
|
|
7
10
|
import {
|
|
8
11
|
buildOtelTraceparentEnv
|
|
9
12
|
} from "./cli-q2j38vre.js";
|
|
13
|
+
import {
|
|
14
|
+
summarizeSession
|
|
15
|
+
} from "./cli-r7eeddkq.js";
|
|
10
16
|
import {
|
|
11
17
|
CTX_MODE_NUDGE_EVERY
|
|
12
18
|
} from "./cli-zm7njwzd.js";
|
|
@@ -17,19 +23,13 @@ import {
|
|
|
17
23
|
CONTEXT_FORMULA,
|
|
18
24
|
clampContextPercent,
|
|
19
25
|
computeContextUsedUnified
|
|
20
|
-
} from "./cli-
|
|
21
|
-
import {
|
|
22
|
-
summarizeSession
|
|
23
|
-
} from "./cli-p4ztb80h.js";
|
|
24
|
-
import {
|
|
25
|
-
hasCodexOAuthPoolSlots
|
|
26
|
-
} from "./cli-bqjfjex4.js";
|
|
26
|
+
} from "./cli-7avy4v8w.js";
|
|
27
27
|
import {
|
|
28
28
|
SessionErrorTracker
|
|
29
29
|
} from "./cli-2pdaysab.js";
|
|
30
30
|
import {
|
|
31
31
|
applyReasoningEffort
|
|
32
|
-
} from "./cli-
|
|
32
|
+
} from "./cli-tmhsxhb8.js";
|
|
33
33
|
import {
|
|
34
34
|
buildRatingsFromLlm,
|
|
35
35
|
fetchRetrievalsForTask,
|
|
@@ -42,16 +42,16 @@ import {
|
|
|
42
42
|
import {
|
|
43
43
|
getApiKey
|
|
44
44
|
} from "./cli-f14fvzag.js";
|
|
45
|
+
import {
|
|
46
|
+
CodexOAuthRefreshError,
|
|
47
|
+
credentialsToAuthJson,
|
|
48
|
+
getValidCodexOAuth
|
|
49
|
+
} from "./cli-v1w7pbd8.js";
|
|
45
50
|
import {
|
|
46
51
|
detachedProcessGroup,
|
|
47
52
|
registerProcessGroup,
|
|
48
53
|
terminateProcessGroup
|
|
49
54
|
} from "./cli-zt3w1cn1.js";
|
|
50
|
-
import {
|
|
51
|
-
CodexOAuthRefreshError,
|
|
52
|
-
credentialsToAuthJson,
|
|
53
|
-
getValidCodexOAuth
|
|
54
|
-
} from "./cli-feh3dkah.js";
|
|
55
55
|
import {
|
|
56
56
|
DEFAULT_MODEL_TIER_MAP,
|
|
57
57
|
init_types
|
|
@@ -60,11 +60,11 @@ import {
|
|
|
60
60
|
init_runtime_model_catalog,
|
|
61
61
|
init_src,
|
|
62
62
|
runtimeCatalogModel
|
|
63
|
-
} from "./cli-
|
|
63
|
+
} from "./cli-014vns2y.js";
|
|
64
64
|
import {
|
|
65
65
|
init_package,
|
|
66
66
|
package_default
|
|
67
|
-
} from "./cli-
|
|
67
|
+
} from "./cli-ng1pmdx6.js";
|
|
68
68
|
import {
|
|
69
69
|
init_secret_scrubber,
|
|
70
70
|
scrubSecrets
|
|
@@ -1042,6 +1042,14 @@ class AppServerCodexThread {
|
|
|
1042
1042
|
case "thread/tokenUsage/updated": {
|
|
1043
1043
|
const tokenUsage = params.tokenUsage;
|
|
1044
1044
|
this.latestTotalUsage = normalizeUsage(tokenUsage?.total);
|
|
1045
|
+
const last = normalizeUsage(tokenUsage?.last);
|
|
1046
|
+
if (last) {
|
|
1047
|
+
push({
|
|
1048
|
+
type: "context.updated",
|
|
1049
|
+
usage: last,
|
|
1050
|
+
contextWindow: typeof tokenUsage?.modelContextWindow === "number" && tokenUsage.modelContextWindow > 0 ? tokenUsage.modelContextWindow : undefined
|
|
1051
|
+
});
|
|
1052
|
+
}
|
|
1045
1053
|
break;
|
|
1046
1054
|
}
|
|
1047
1055
|
case "error": {
|
|
@@ -1435,6 +1443,9 @@ class CodexSession {
|
|
|
1435
1443
|
case "turn.interrupted":
|
|
1436
1444
|
this.accountUsage(event.usage);
|
|
1437
1445
|
break;
|
|
1446
|
+
case "context.updated":
|
|
1447
|
+
this.emitContextUsage(event.usage, event.contextWindow ?? this.contextWindow);
|
|
1448
|
+
break;
|
|
1438
1449
|
case "error": {
|
|
1439
1450
|
const { message } = this.formatTerminalError(event.message, event.codexErrorInfo);
|
|
1440
1451
|
if (event.willRetry === true) {
|
|
@@ -1457,6 +1468,8 @@ class CodexSession {
|
|
|
1457
1468
|
output_tokens: this.accumulatedUsage.output_tokens + usage.output_tokens,
|
|
1458
1469
|
reasoning_output_tokens: this.accumulatedUsage.reasoning_output_tokens + usage.reasoning_output_tokens
|
|
1459
1470
|
} : usage;
|
|
1471
|
+
}
|
|
1472
|
+
emitContextUsage(usage, contextWindow) {
|
|
1460
1473
|
const contextUsed = computeContextUsedUnified({
|
|
1461
1474
|
inputTokens: usage.input_tokens,
|
|
1462
1475
|
cacheReadTokens: 0,
|
|
@@ -1466,8 +1479,8 @@ class CodexSession {
|
|
|
1466
1479
|
this.emit({
|
|
1467
1480
|
type: "context_usage",
|
|
1468
1481
|
contextUsedTokens: contextUsed,
|
|
1469
|
-
contextTotalTokens:
|
|
1470
|
-
contextPercent: clampContextPercent(contextUsed,
|
|
1482
|
+
contextTotalTokens: contextWindow,
|
|
1483
|
+
contextPercent: clampContextPercent(contextUsed, contextWindow) ?? 0,
|
|
1471
1484
|
outputTokens: usage.output_tokens,
|
|
1472
1485
|
contextFormula: CONTEXT_FORMULA
|
|
1473
1486
|
});
|
|
@@ -4,29 +4,25 @@ import {
|
|
|
4
4
|
import {
|
|
5
5
|
getApiKey
|
|
6
6
|
} from "./cli-f14fvzag.js";
|
|
7
|
+
import {
|
|
8
|
+
DEFAULT_MODEL,
|
|
9
|
+
resolveCredential
|
|
10
|
+
} from "./cli-7mhy3ths.js";
|
|
7
11
|
import {
|
|
8
12
|
detachedProcessGroup,
|
|
9
13
|
registerProcessGroup,
|
|
10
14
|
terminateProcessGroup
|
|
11
15
|
} from "./cli-zt3w1cn1.js";
|
|
12
|
-
import {
|
|
13
|
-
DEFAULT_MODEL,
|
|
14
|
-
resolveCredential
|
|
15
|
-
} from "./cli-f2n17zhp.js";
|
|
16
|
-
import {
|
|
17
|
-
DEFAULT_OPENROUTER_BASE_URL,
|
|
18
|
-
getOpenRouterBaseUrl
|
|
19
|
-
} from "./cli-3dpj7atn.js";
|
|
20
16
|
import {
|
|
21
17
|
calculatePKCECodeChallenge,
|
|
22
18
|
ensureAuthorizationTokenOrThrow,
|
|
23
19
|
generateRandomCodeVerifier,
|
|
24
20
|
generateRandomState,
|
|
25
21
|
oauthAppRowToProviderConfig
|
|
26
|
-
} from "./cli-
|
|
22
|
+
} from "./cli-fhj4y16f.js";
|
|
27
23
|
import {
|
|
28
24
|
getSlackApp
|
|
29
|
-
} from "./cli-
|
|
25
|
+
} from "./cli-j05x7pnb.js";
|
|
30
26
|
import {
|
|
31
27
|
CredentialBroker,
|
|
32
28
|
DEFAULT_CREDENTIAL_BINDINGS,
|
|
@@ -63,21 +59,27 @@ import {
|
|
|
63
59
|
updateAuthorizationTokens,
|
|
64
60
|
upsertAuthorization,
|
|
65
61
|
upsertSwarmConfig
|
|
66
|
-
} from "./cli-
|
|
62
|
+
} from "./cli-74ez9b66.js";
|
|
67
63
|
import {
|
|
68
64
|
TERMINAL_TASK_STATUSES,
|
|
69
65
|
defaultAssetKey,
|
|
70
66
|
init_key,
|
|
71
67
|
init_types
|
|
72
68
|
} from "./cli-xvdgasgy.js";
|
|
73
|
-
import {
|
|
74
|
-
getAppUrl,
|
|
75
|
-
init_constants
|
|
76
|
-
} from "./cli-gd4favx9.js";
|
|
77
69
|
import {
|
|
78
70
|
init_resolver,
|
|
79
71
|
resolveTemplate
|
|
80
72
|
} from "./cli-5c2j5yvx.js";
|
|
73
|
+
import {
|
|
74
|
+
DEFAULT_OPENROUTER_BASE_URL,
|
|
75
|
+
getOpenRouterAttributionHeaders,
|
|
76
|
+
getOpenRouterBaseUrl,
|
|
77
|
+
init_openrouter_base_url
|
|
78
|
+
} from "./cli-a35hzdve.js";
|
|
79
|
+
import {
|
|
80
|
+
getAppUrl,
|
|
81
|
+
init_constants
|
|
82
|
+
} from "./cli-gd4favx9.js";
|
|
81
83
|
import {
|
|
82
84
|
init_env_flag,
|
|
83
85
|
isEnvFlagEnabled
|
|
@@ -175207,6 +175209,7 @@ Additional information: BADCLIENT: Bad error code, ${badCode} not found in range
|
|
|
175207
175209
|
|
|
175208
175210
|
// src/workflows/executors/system-one-decision.ts
|
|
175209
175211
|
init_zod();
|
|
175212
|
+
init_openrouter_base_url();
|
|
175210
175213
|
init_secret_scrubber();
|
|
175211
175214
|
|
|
175212
175215
|
// src/workflows/executors/base.ts
|
|
@@ -175594,7 +175597,7 @@ class HumanInTheLoopExecutor extends BaseExecutor {
|
|
|
175594
175597
|
}
|
|
175595
175598
|
if (notification.channel === "slack") {
|
|
175596
175599
|
try {
|
|
175597
|
-
const { getSlackApp: getSlackApp2 } = await import("./app-
|
|
175600
|
+
const { getSlackApp: getSlackApp2 } = await import("./app-ffes2kyf.js");
|
|
175598
175601
|
const slackApp = getSlackApp2();
|
|
175599
175602
|
if (!slackApp) {
|
|
175600
175603
|
console.warn("[HITL] Slack not initialized — cannot send notification");
|
|
@@ -175681,6 +175684,9 @@ function formatTimeout(seconds) {
|
|
|
175681
175684
|
return mins > 0 ? `${hours}h ${mins}m` : `${hours}h`;
|
|
175682
175685
|
}
|
|
175683
175686
|
|
|
175687
|
+
// src/workflows/executors/system-one-providers.ts
|
|
175688
|
+
init_openrouter_base_url();
|
|
175689
|
+
|
|
175684
175690
|
// src/workflows/executors/system-one-wire.ts
|
|
175685
175691
|
class SystemOneWireError extends Error {
|
|
175686
175692
|
}
|
|
@@ -175856,6 +175862,7 @@ var OPENAI_DECISIONS_WIRE = {
|
|
|
175856
175862
|
};
|
|
175857
175863
|
|
|
175858
175864
|
// src/workflows/executors/workflow-llm.ts
|
|
175865
|
+
init_openrouter_base_url();
|
|
175859
175866
|
async function resolveWorkflowLlmConfig(requestedModel, env = process.env, options = {}) {
|
|
175860
175867
|
const credential = await resolveCredential({ env });
|
|
175861
175868
|
if (!credential) {
|
|
@@ -175869,9 +175876,11 @@ async function resolveWorkflowLlmConfig(requestedModel, env = process.env, optio
|
|
|
175869
175876
|
}
|
|
175870
175877
|
const providerPrefix = `${credential.kind}/`;
|
|
175871
175878
|
const model = requestedModel ?? DEFAULT_MODEL[credential.kind];
|
|
175879
|
+
const baseURL = credential.kind === "openrouter" ? getOpenRouterBaseUrl(env) : undefined;
|
|
175872
175880
|
return {
|
|
175873
175881
|
apiKey: credential.apiKey,
|
|
175874
|
-
baseURL
|
|
175882
|
+
baseURL,
|
|
175883
|
+
headers: baseURL ? getOpenRouterAttributionHeaders(baseURL, env) : {},
|
|
175875
175884
|
model: model.startsWith(providerPrefix) ? model.slice(providerPrefix.length) : model
|
|
175876
175885
|
};
|
|
175877
175886
|
}
|
|
@@ -176826,6 +176835,7 @@ class SystemOneDecisionExecutor extends BaseExecutor {
|
|
|
176826
176835
|
res = await doFetch(endpoint, {
|
|
176827
176836
|
method: "POST",
|
|
176828
176837
|
headers: {
|
|
176838
|
+
...getOpenRouterAttributionHeaders(endpoint, this.providerContext().env),
|
|
176829
176839
|
"content-type": "application/json",
|
|
176830
176840
|
accept: "application/json",
|
|
176831
176841
|
authorization: `Bearer ${apiKey}`
|
|
@@ -179505,6 +179515,31 @@ async function setScriptConnectionEnabled(id, enabled, userId) {
|
|
|
179505
179515
|
WHERE id = ? RETURNING *`, [enabled ? 1 : 0, new Date().toISOString(), userId ?? null, id]);
|
|
179506
179516
|
return row ? connectionFromRow(row) : null;
|
|
179507
179517
|
}
|
|
179518
|
+
async function deleteScriptConnection(id) {
|
|
179519
|
+
const deleted = await getDbClient().transaction(async (tx) => {
|
|
179520
|
+
await tx.run("PRAGMA defer_foreign_keys = ON");
|
|
179521
|
+
const row = await tx.get("SELECT * FROM script_connections WHERE id = ?", [
|
|
179522
|
+
id
|
|
179523
|
+
]);
|
|
179524
|
+
if (!row)
|
|
179525
|
+
return null;
|
|
179526
|
+
const connection = connectionFromRow(row);
|
|
179527
|
+
await deleteManagedBindingForConnection(id);
|
|
179528
|
+
await tx.run("DELETE FROM script_connections WHERE id = ?", [id]);
|
|
179529
|
+
const secretKey = derivedInlineSecretKey(connection);
|
|
179530
|
+
if (secretKey) {
|
|
179531
|
+
await deleteManagedConnectionSecret({
|
|
179532
|
+
scope: connection.scope,
|
|
179533
|
+
scopeId: connection.scopeId,
|
|
179534
|
+
key: secretKey
|
|
179535
|
+
});
|
|
179536
|
+
}
|
|
179537
|
+
return connection;
|
|
179538
|
+
});
|
|
179539
|
+
if (deleted && derivedInlineSecretKey(deleted))
|
|
179540
|
+
refreshSecretScrubberCache();
|
|
179541
|
+
return deleted;
|
|
179542
|
+
}
|
|
179508
179543
|
function getScriptApiConnectionDescriptors(context = {}) {
|
|
179509
179544
|
return listScriptConnections(context).filter((connection) => connection.kind === "openapi" || connection.kind === "graphql").map((connection) => {
|
|
179510
179545
|
if (!connection.generatedRuntimeJson)
|
|
@@ -180190,7 +180225,7 @@ var EXECUTORS = {
|
|
|
180190
180225
|
quickjs: () => new QuickJSScriptExecutor
|
|
180191
180226
|
};
|
|
180192
180227
|
function getScriptExecutor(name = process.env.SCRIPT_EXECUTOR ?? "native") {
|
|
180193
|
-
const factory = EXECUTORS[name];
|
|
180228
|
+
const factory = EXECUTORS[name.trim()];
|
|
180194
180229
|
if (!factory) {
|
|
180195
180230
|
throw new Error(`Unknown SCRIPT_EXECUTOR: ${name}. Available: ${Object.keys(EXECUTORS).join(", ")}`);
|
|
180196
180231
|
}
|
|
@@ -184917,4 +184952,4 @@ void _scriptMain;
|
|
|
184917
184952
|
});
|
|
184918
184953
|
}
|
|
184919
184954
|
|
|
184920
|
-
export { require_dist, isInvalidClientError, assertUrlSafe, publicEndpointSsrfOptions, discoverProtectedResourceMetadata, discoverAuthorizationServerMetadata, normalizeTokenEndpointAuthMethod, resolveAdvertisedTokenEndpointAuthMethod, authMethodForStoredClient, selectDcrTokenEndpointAuthMethod, registerClient, buildAuthorizeUrl, exchangeCodeForTokens, refreshMcpToken, revokeMcpToken, computeExpiresAt, getMcpOAuthToken, findReusableMcpOAuthClient, invalidateMcpOAuthClient, upsertMcpOAuthToken, applyMcpOAuthRefresh, markMcpOAuthTokenStatus, deleteMcpOAuthToken, insertMcpOAuthPending, consumeMcpOAuthPending, gcMcpOAuthPending, setMcpServerAuthMethod, ensureMcpToken, callMcpServerTool, listVendoredOpenapiEntries, ConnectionAuthInputSchema, connectionAuthSummary, listRelationalCredentialBindings, getCredentialBindingById, findCredentialBindingByIdentity, upsertCredentialBinding, disableCredentialBinding, listScriptConnections, listScriptConnectionsAsync, getScriptConnectionById, ScriptConnectionConflictError, connectionAuthInputFromFlat, upsertScriptConnection, refreshScriptConnection, setScriptConnectionEnabled, getScriptApiConnectionDescriptors, getScriptMcpConnectionDescriptors, getScriptApiTypes, getScriptMcpTypes, oauthAppToProviderConfig, getOAuthProviderConfig, getOAuthBindingTokenStatus, buildScriptCredentialBindingsWithFailures, buildScriptCredentialBindings, buildSandboxedCommand, sandboxSpawnEnv, createCappedStreamState, snapshotCapped, readStreamCapped, writeBareImportShim, MIN_SCRIPT_WALL_CLOCK_MS, SCRIPT_LONG_TIMEOUT_HINT_MS, MAX_SCRIPT_WALL_CLOCK_MS, DEFAULT_SCRIPT_RESOURCES, require_typescript, checkImportAllowlist, validateScriptImports, runScript, BaseExecutor, postApprovalCancellationUpdates, createApprovalFollowUpTask, HumanInTheLoopExecutor, resolveWorkflowLlmConfig, SYSTEM_ONE_DECISION_NODE_TYPE, systemOneRetryViolations, systemOneUnresolvedError, SystemOneDecisionExecutor, getNextTargets, generateEdges, findEntryNodes, resolveValidationPort, getSuccessors, definitionNodeIds, validateDefinition, applyDefinitionPatch, extractScriptSignature, extractArgsJsonSchema, getSavedScriptOwnerAgentId, runSavedScriptAsAgent, resolveSyncRunAs, AppNameSchema, ColumnKindSchema, isIso8601Date, SYSTEM_COLUMN_KINDS, SORTABLE_SYSTEM_DATE_COLUMNS, AppElementsSchema, AppDefinitionSchema, collectScriptReferences, parseAppDefinition, applyAppDefinitionPatch, upgradeAppDefinition, decodeAppDefinition, appDefinitionNeedsRepair, createApp, getApp, listApps, listAppRecords, updateApp, deleteApp, getScriptAppTypes, SCRIPT_SDK_TYPES, scriptSdkTypesWithGeneratedApis, SCRIPT_STDLIB_MODULE_TYPES, scriptStdlibTypesWithGeneratedApis, typecheckWithAmbient, typecheckScript };
|
|
184955
|
+
export { require_dist, isInvalidClientError, assertUrlSafe, publicEndpointSsrfOptions, discoverProtectedResourceMetadata, discoverAuthorizationServerMetadata, normalizeTokenEndpointAuthMethod, resolveAdvertisedTokenEndpointAuthMethod, authMethodForStoredClient, selectDcrTokenEndpointAuthMethod, registerClient, buildAuthorizeUrl, exchangeCodeForTokens, refreshMcpToken, revokeMcpToken, computeExpiresAt, getMcpOAuthToken, findReusableMcpOAuthClient, invalidateMcpOAuthClient, upsertMcpOAuthToken, applyMcpOAuthRefresh, markMcpOAuthTokenStatus, deleteMcpOAuthToken, insertMcpOAuthPending, consumeMcpOAuthPending, gcMcpOAuthPending, setMcpServerAuthMethod, ensureMcpToken, callMcpServerTool, listVendoredOpenapiEntries, ConnectionAuthInputSchema, connectionAuthSummary, listRelationalCredentialBindings, getCredentialBindingById, findCredentialBindingByIdentity, upsertCredentialBinding, disableCredentialBinding, listScriptConnections, listScriptConnectionsAsync, getScriptConnectionById, ScriptConnectionConflictError, connectionAuthInputFromFlat, upsertScriptConnection, refreshScriptConnection, setScriptConnectionEnabled, deleteScriptConnection, getScriptApiConnectionDescriptors, getScriptMcpConnectionDescriptors, getScriptApiTypes, getScriptMcpTypes, oauthAppToProviderConfig, getOAuthProviderConfig, getOAuthBindingTokenStatus, buildScriptCredentialBindingsWithFailures, buildScriptCredentialBindings, buildSandboxedCommand, sandboxSpawnEnv, createCappedStreamState, snapshotCapped, readStreamCapped, writeBareImportShim, MIN_SCRIPT_WALL_CLOCK_MS, SCRIPT_LONG_TIMEOUT_HINT_MS, MAX_SCRIPT_WALL_CLOCK_MS, DEFAULT_SCRIPT_RESOURCES, require_typescript, checkImportAllowlist, validateScriptImports, runScript, BaseExecutor, postApprovalCancellationUpdates, createApprovalFollowUpTask, HumanInTheLoopExecutor, resolveWorkflowLlmConfig, SYSTEM_ONE_DECISION_NODE_TYPE, systemOneRetryViolations, systemOneUnresolvedError, SystemOneDecisionExecutor, getNextTargets, generateEdges, findEntryNodes, resolveValidationPort, getSuccessors, definitionNodeIds, validateDefinition, applyDefinitionPatch, extractScriptSignature, extractArgsJsonSchema, getSavedScriptOwnerAgentId, runSavedScriptAsAgent, resolveSyncRunAs, AppNameSchema, ColumnKindSchema, isIso8601Date, SYSTEM_COLUMN_KINDS, SORTABLE_SYSTEM_DATE_COLUMNS, AppElementsSchema, AppDefinitionSchema, collectScriptReferences, parseAppDefinition, applyAppDefinitionPatch, upgradeAppDefinition, decodeAppDefinition, appDefinitionNeedsRepair, createApp, getApp, listApps, listAppRecords, updateApp, deleteApp, getScriptAppTypes, SCRIPT_SDK_TYPES, scriptSdkTypesWithGeneratedApis, SCRIPT_STDLIB_MODULE_TYPES, scriptStdlibTypesWithGeneratedApis, typecheckWithAmbient, typecheckScript };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
AssistantMessageEventStream,
|
|
3
3
|
formatThrownValue
|
|
4
|
-
} from "./cli-
|
|
4
|
+
} from "./cli-wnb9b2g3.js";
|
|
5
5
|
|
|
6
6
|
// node_modules/@earendil-works/pi-ai/dist/utils/text.js
|
|
7
7
|
function contentText(content, separator = `
|
|
@@ -191,7 +191,7 @@ function resolveTranscriptTools(messages, supportsToolAdditions) {
|
|
|
191
191
|
}
|
|
192
192
|
|
|
193
193
|
// node_modules/@earendil-works/pi-ai/dist/api/lazy.js
|
|
194
|
-
function createSetupErrorMessage(model, error) {
|
|
194
|
+
function createSetupErrorMessage(model, error, timestamp) {
|
|
195
195
|
return {
|
|
196
196
|
role: "assistant",
|
|
197
197
|
content: [],
|
|
@@ -208,7 +208,7 @@ function createSetupErrorMessage(model, error) {
|
|
|
208
208
|
},
|
|
209
209
|
stopReason: "error",
|
|
210
210
|
errorMessage: error instanceof Error ? error.message : String(error),
|
|
211
|
-
timestamp
|
|
211
|
+
timestamp
|
|
212
212
|
};
|
|
213
213
|
}
|
|
214
214
|
function hasResult(source) {
|
|
@@ -221,9 +221,10 @@ async function forwardStream(target, source) {
|
|
|
221
221
|
target.end(hasResult(source) ? await source.result() : undefined);
|
|
222
222
|
}
|
|
223
223
|
function lazyStream(model, setup) {
|
|
224
|
+
const startedAt = Date.now();
|
|
224
225
|
const outer = new AssistantMessageEventStream;
|
|
225
226
|
setup().then((inner) => forwardStream(outer, inner)).catch((error) => {
|
|
226
|
-
const message = createSetupErrorMessage(model, error);
|
|
227
|
+
const message = createSetupErrorMessage(model, error, startedAt);
|
|
227
228
|
outer.push({ type: "error", reason: "error", error: message });
|
|
228
229
|
outer.end(message);
|
|
229
230
|
});
|
|
@@ -539,6 +540,11 @@ function assertClassifierModel(model) {
|
|
|
539
540
|
throw new ModelsError("provider", `Model ${model.provider}/${model.id} is not a classifier model`);
|
|
540
541
|
}
|
|
541
542
|
}
|
|
543
|
+
function assertClassifierInputSupported(model, context) {
|
|
544
|
+
if (context.images?.length && !model.input.includes("image")) {
|
|
545
|
+
throw new ModelsError("provider", `Model ${model.provider}/${model.id} does not accept image input`);
|
|
546
|
+
}
|
|
547
|
+
}
|
|
542
548
|
function imageErrorResult(model, error, aborted = false) {
|
|
543
549
|
return {
|
|
544
550
|
api: model.api,
|
|
@@ -1028,6 +1034,7 @@ class ModelsImpl {
|
|
|
1028
1034
|
async classify(model, context, options) {
|
|
1029
1035
|
try {
|
|
1030
1036
|
assertClassifierModel(model);
|
|
1037
|
+
assertClassifierInputSupported(model, context);
|
|
1031
1038
|
const provider = this.requireProvider(model);
|
|
1032
1039
|
if (!provider.classify) {
|
|
1033
1040
|
throw new ModelsError("provider", `Provider ${model.provider} does not support classification`);
|
|
@@ -1212,4 +1219,4 @@ function modelsAreEqual(a, b) {
|
|
|
1212
1219
|
return getModelType(a) === getModelType(b) && a.id === b.id && a.provider === b.provider;
|
|
1213
1220
|
}
|
|
1214
1221
|
|
|
1215
|
-
export { lazyStream, lazyApi, defaultProviderAuthContext, InMemoryCredentialStore, ModelsError, InMemoryModelsStore, getModelType, isModelType, assertChatModel, assertImageModel, assertClassifierModel, imageErrorResult, classifierErrorResult, contentText, getSystemMessageText, renderSystemMessageUpdate, createInitialSystemMessage, normalizeContext, getInitialSystemMessage, withoutInitialSystemMessage, getCurrentTools, getCurrentSystemMessage, getCurrentSystemPrompt, collapseSystemMessages, resolveTranscript, toToolDeclaration, declarationsEqual, getToolStateChanges, getDeclaredTools, hasToolRedefinitions, hasNonAdditiveToolChanges, resolveTranscriptTools, createModels, createProvider, hasApi, calculateCost, getSupportedThinkingLevels, clampThinkingLevel, modelsAreEqual };
|
|
1222
|
+
export { lazyStream, lazyApi, defaultProviderAuthContext, InMemoryCredentialStore, ModelsError, InMemoryModelsStore, getModelType, isModelType, assertChatModel, assertImageModel, assertClassifierModel, assertClassifierInputSupported, imageErrorResult, classifierErrorResult, contentText, getSystemMessageText, renderSystemMessageUpdate, createInitialSystemMessage, normalizeContext, getInitialSystemMessage, withoutInitialSystemMessage, getCurrentTools, getCurrentSystemMessage, getCurrentSystemPrompt, collapseSystemMessages, resolveTranscript, toToolDeclaration, declarationsEqual, getToolStateChanges, getDeclaredTools, hasToolRedefinitions, hasNonAdditiveToolChanges, resolveTranscriptTools, createModels, createProvider, hasApi, calculateCost, getSupportedThinkingLevels, clampThinkingLevel, modelsAreEqual };
|
|
@@ -69,7 +69,7 @@ import {
|
|
|
69
69
|
setSlackMessageTracking,
|
|
70
70
|
slackContextKey,
|
|
71
71
|
updateSlackMessageRecord
|
|
72
|
-
} from "./cli-
|
|
72
|
+
} from "./cli-74ez9b66.js";
|
|
73
73
|
import {
|
|
74
74
|
init_types,
|
|
75
75
|
isTerminalTaskStatus
|
|
@@ -77,7 +77,7 @@ import {
|
|
|
77
77
|
import {
|
|
78
78
|
init_task_attachment_links,
|
|
79
79
|
taskAttachmentDisplayUrl
|
|
80
|
-
} from "./cli-
|
|
80
|
+
} from "./cli-mxvnnv5q.js";
|
|
81
81
|
import {
|
|
82
82
|
getSlackConfiguration,
|
|
83
83
|
init_config
|
|
@@ -52915,7 +52915,7 @@ async function initOtel(serviceRole = process.env.AGENT_ROLE || "api") {
|
|
|
52915
52915
|
return;
|
|
52916
52916
|
initialized = true;
|
|
52917
52917
|
try {
|
|
52918
|
-
const impl = await import("./otel-impl-
|
|
52918
|
+
const impl = await import("./otel-impl-hhm64r6m.js");
|
|
52919
52919
|
await impl.boot(serviceRole, {
|
|
52920
52920
|
exportConsoleLogs: serviceRole === "api" && isApiLogExportEnabled()
|
|
52921
52921
|
});
|
|
@@ -54410,15 +54410,15 @@ async function initSlackApp() {
|
|
|
54410
54410
|
...clientOptions ? { clientOptions } : {}
|
|
54411
54411
|
});
|
|
54412
54412
|
initialized2 = true;
|
|
54413
|
-
const { registerMessageHandler } = await import("./handlers-
|
|
54414
|
-
const { registerCommandHandler } = await import("./commands-
|
|
54415
|
-
const { registerActionHandlers } = await import("./actions-
|
|
54416
|
-
const { registerWorkObjectHandlers } = await import("./work-objects-
|
|
54413
|
+
const { registerMessageHandler } = await import("./handlers-59ywqwzh.js");
|
|
54414
|
+
const { registerCommandHandler } = await import("./commands-q4mfhn51.js");
|
|
54415
|
+
const { registerActionHandlers } = await import("./actions-7jg840nr.js");
|
|
54416
|
+
const { registerWorkObjectHandlers } = await import("./work-objects-mxf2c842.js");
|
|
54417
54417
|
registerMessageHandler(app);
|
|
54418
54418
|
registerCommandHandler(app);
|
|
54419
54419
|
registerActionHandlers(app);
|
|
54420
54420
|
registerWorkObjectHandlers(app);
|
|
54421
|
-
const { createAssistant } = await import("./assistant-
|
|
54421
|
+
const { createAssistant } = await import("./assistant-fhm5smyz.js");
|
|
54422
54422
|
app.assistant(createAssistant());
|
|
54423
54423
|
return app;
|
|
54424
54424
|
}
|
|
@@ -54427,7 +54427,7 @@ async function startSlackApp() {
|
|
|
54427
54427
|
await initSlackApp();
|
|
54428
54428
|
}
|
|
54429
54429
|
if (app) {
|
|
54430
|
-
const { isSlackRenderV2Enabled: isSlackRenderV2Enabled2 } = await import("./render-v2-
|
|
54430
|
+
const { isSlackRenderV2Enabled: isSlackRenderV2Enabled2 } = await import("./render-v2-n4v66bj3.js");
|
|
54431
54431
|
if (isSlackRenderV2Enabled2())
|
|
54432
54432
|
await ensureSlackRenderV2Activation();
|
|
54433
54433
|
await app.start();
|
|
@@ -56191,4 +56191,4 @@ function _resetSlackRenderV2ForTests() {
|
|
|
56191
56191
|
}
|
|
56192
56192
|
var _noteOutcomeDeliveryFailureForTests = (task, tree, error) => noteOutcomeDeliveryFailure(task, tree, error, undefined);
|
|
56193
56193
|
|
|
56194
|
-
export { require_dist7 as require_dist, getSlackConnectionState, isPollTracingEnabled, initOtel, withSpan, startSpan, withSpanContext, withRemoteContext, injectTraceContext, recordSessionCost, recordDbRetentionSweep, recordDbRetentionStatement, slackTaskOutput, ackSlackMessage, getTaskLink, getTaskUrl, markdownToSlack, buildCaptionBlock, buildCancelledBlocks, buildBufferFlushBlocks, buildTreeBlocks, taskCitationIssues, stripInvalidTaskCitations, taskCitationSourceGroups, renderTaskCitations, taskCitationWarnings, MAX_TASK_CITATIONS, CitationInputSchema, TaskCitationSchema, upsertTaskCitations, getTaskCitations, getTaskCitationsForTasks, hasTaskCitationCheckRefusal, initialize, ensure2 as ensure, getAgentDisplayName, getAgentEmoji, markSlackSessionProcessing, isSlackRenderV2Enabled, isSlackDelegationEnabled, callSlackWithRetry, formatV2Duration, renderThreadTree, ensureSlackThreadTree, withStatusLead, childOutcomeContent, streamOutcomeCard, slackErrorCode2 as slackErrorCode, isTerminalSlackError, describeSlackError, slackErrorSummary, refreshResolvedDeferralCards, processSlackRenderV2, _resetSlackRenderV2ForTests, _noteOutcomeDeliveryFailureForTests, registerTreeMessage, getSlackApp, initSlackApp, startSlackApp, stopSlackApp };
|
|
56194
|
+
export { require_content_type, require_dist7 as require_dist, getSlackConnectionState, isPollTracingEnabled, initOtel, withSpan, startSpan, withSpanContext, withRemoteContext, injectTraceContext, recordSessionCost, recordDbRetentionSweep, recordDbRetentionStatement, slackTaskOutput, ackSlackMessage, getTaskLink, getTaskUrl, markdownToSlack, buildCaptionBlock, buildCancelledBlocks, buildBufferFlushBlocks, buildTreeBlocks, taskCitationIssues, stripInvalidTaskCitations, taskCitationSourceGroups, renderTaskCitations, taskCitationWarnings, MAX_TASK_CITATIONS, CitationInputSchema, TaskCitationSchema, upsertTaskCitations, getTaskCitations, getTaskCitationsForTasks, hasTaskCitationCheckRefusal, initialize, ensure2 as ensure, getAgentDisplayName, getAgentEmoji, markSlackSessionProcessing, isSlackRenderV2Enabled, isSlackDelegationEnabled, callSlackWithRetry, formatV2Duration, renderThreadTree, ensureSlackThreadTree, withStatusLead, childOutcomeContent, streamOutcomeCard, slackErrorCode2 as slackErrorCode, isTerminalSlackError, describeSlackError, slackErrorSummary, refreshResolvedDeferralCards, processSlackRenderV2, _resetSlackRenderV2ForTests, _noteOutcomeDeliveryFailureForTests, registerTreeMessage, getSlackApp, initSlackApp, startSlackApp, stopSlackApp };
|