@desplega.ai/agent-swarm 1.135.0 → 1.135.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/{actions-3fpj602h.js → actions-3az2vwwn.js} +6 -6
- package/dist/{anthropic-messages-706yad38.js → anthropic-messages-pm7pp23c.js} +36 -23
- package/dist/{app-12mwdsvg.js → app-vygnfvrh.js} +3 -3
- package/dist/{assistant-p87pt2b5.js → assistant-2jr2frrm.js} +8 -8
- package/dist/{azure-openai-responses-40z2astx.js → azure-openai-responses-cwesc845.js} +13 -4
- package/dist/{boot-reembed-jf6gx8yr.js → boot-reembed-ncbg16rb.js} +4 -4
- package/dist/{boot-reembed-vjkptm2x.js → boot-reembed-y7r9cxt0.js} +3 -3
- package/dist/{boot-scrub-logs-ah6bpjte.js → boot-scrub-logs-t82rwa0y.js} +2 -2
- package/dist/{claude-adapter-9ry59y9k.js → claude-adapter-vvx2aw3v.js} +5 -5
- package/dist/{claude-managed-adapter-m2v2e90a.js → claude-managed-adapter-5zr3n86v.js} +2 -2
- package/dist/{cli-77vf7z36.js → cli-0crn5kaz.js} +7 -16
- package/dist/{cli-h9gpdrzg.js → cli-0jhyxtdj.js} +2 -2
- package/dist/cli-0v7jxbvz.js +6724 -0
- package/dist/{cli-w3xch1b8.js → cli-1857msnd.js} +1 -1
- package/dist/{cli-y98ry8cz.js → cli-1dfatkzm.js} +1 -1
- package/dist/{cli-a2brkr6h.js → cli-1z01xdqh.js} +5 -5
- package/dist/{cli-d08xq4nz.js → cli-3f0tnh34.js} +102 -45
- package/dist/{cli-w4ezqgkj.js → cli-4dakdn30.js} +6 -6
- package/dist/{cli-10694wk0.js → cli-4rdjdddh.js} +1 -1
- package/dist/{cli-j2p3bfs3.js → cli-5a5nrq3g.js} +5 -5
- package/dist/{cli-dphm5tyw.js → cli-6290n4yz.js} +1 -1
- package/dist/{cli-f2tgry1v.js → cli-6bz2hzvw.js} +2 -2
- package/dist/{cli-bynsg176.js → cli-6mmwmy45.js} +20 -9
- package/dist/{cli-crkvptsz.js → cli-7ccy0h4r.js} +2 -2
- package/dist/{cli-wzmeara2.js → cli-83razmqg.js} +38 -12
- package/dist/{cli-8ca5b9j9.js → cli-8f4h27gm.js} +1 -1
- package/dist/{cli-vtz6yj3v.js → cli-9phjbffs.js} +1 -1
- package/dist/{cli-y37pxs1m.js → cli-a1zrc2g6.js} +146 -96
- package/dist/{cli-vd2twm2p.js → cli-cf6vq6qa.js} +1 -1
- package/dist/{cli-9kekm9yz.js → cli-cm4z7w7w.js} +2 -2
- package/dist/{cli-269pdgm4.js → cli-cv2vjg2y.js} +1 -1
- package/dist/{cli-3m4mkyqy.js → cli-ey09krp2.js} +1 -1
- package/dist/{cli-2gwpvmew.js → cli-fhsz3twr.js} +1 -171
- package/dist/{cli-yd6vqt1x.js → cli-fmha74ga.js} +9 -7
- package/dist/{cli-1gvam274.js → cli-j3xnd5b4.js} +22 -6
- package/dist/{cli-xmyqv00z.js → cli-j8dggbcr.js} +17 -11
- package/dist/{cli-p0sqfhw1.js → cli-jfrh963q.js} +14 -14
- package/dist/{cli-z6gdnbjy.js → cli-mfa2eaef.js} +5 -5
- package/dist/cli-n1q8q14d.js +177 -0
- package/dist/{cli-md759nb0.js → cli-nhvym0d2.js} +3 -3
- package/dist/{cli-prfghf4h.js → cli-qxn3g3yx.js} +72 -45
- package/dist/{cli-2ecesrtw.js → cli-r5vwg1ma.js} +4 -4
- package/dist/{cli-tv9f1kyb.js → cli-s73zwwqn.js} +97 -7
- package/dist/{cli-3zmdzfjf.js → cli-s9gpxh9q.js} +17 -2
- package/dist/{cli-1gzz6pmf.js → cli-w0ygcv43.js} +1 -1
- package/dist/{cli-v21nahej.js → cli-yw2z5kj9.js} +1 -1
- package/dist/cli.js +19 -19
- package/dist/{codex-adapter-6r08aepx.js → codex-adapter-6p290yq3.js} +4 -4
- package/dist/{codex-session-runner-9dk036pn.js → codex-session-runner-7b3dhpmx.js} +4 -4
- package/dist/{commands-kg7cm1jz.js → commands-wxg1g4nq.js} +2 -2
- package/dist/{db-g666qxpv.js → db-8fqeheve.js} +2 -2
- package/dist/{google-generative-ai-b0wzss55.js → google-generative-ai-6xxdj4t3.js} +20 -13
- package/dist/{google-vertex-e8q4dpya.js → google-vertex-zma18wb0.js} +19 -12
- package/dist/{handlers-58k0e9mc.js → handlers-gwtqp17c.js} +13 -10
- package/dist/{hook-gezxk50h.js → hook-gd9fwfp0.js} +5 -5
- package/dist/{hook-51ez1v2s.js → hook-mrqygs7p.js} +3 -3
- package/dist/{http-d4qhhnyy.js → http-x4mc1mqg.js} +50 -47
- package/dist/{index-c06j5e9e.js → index-2mdqrd0n.js} +10 -10
- package/dist/{index-kvgmhb7w.js → index-4djjkp9z.js} +9 -9
- package/dist/index-g9tttwkm.js +26012 -0
- package/dist/{index-ys39hr8t.js → index-pzgasj16.js} +11 -11
- package/dist/{index-h96j88n6.js → index-yd654kac.js} +9 -9
- package/dist/{keepalive-b6n7th6x.js → keepalive-3tycspcy.js} +4 -4
- package/dist/{lead-3wgc402v.js → lead-js1h3z7d.js} +30 -29
- package/dist/{maintenance-wr20z889.js → maintenance-y91ry8q4.js} +4 -4
- package/dist/{mistral-conversations-2njwdwhj.js → mistral-conversations-hdmnkf6h.js} +9 -2
- package/dist/{oauth-refresh-sweep-brxmpz1j.js → oauth-refresh-sweep-s33gtxrw.js} +3 -3
- package/dist/{onboard-88hgdp28.js → onboard-vndj64mb.js} +2 -2
- package/dist/{openai-codex-responses-kt84eq86.js → openai-codex-responses-xxca1qr1.js} +9 -6
- package/dist/{openai-completions-kasahkpq.js → openai-completions-cwy2kkzg.js} +105 -70
- package/dist/{openai-responses-175qgngv.js → openai-responses-e4dcwm9g.js} +10 -4
- package/dist/{opencode-adapter-rar9676j.js → opencode-adapter-sx38y7f7.js} +3 -3
- package/dist/{otel-impl-an7gh3eh.js → otel-impl-d2p84k6e.js} +4 -4
- package/dist/{pi-messages-txp9f97r.js → pi-messages-2d3e7egd.js} +1 -1
- package/dist/{pi-mono-adapter-6vmrr3g8.js → pi-mono-adapter-1phspz2y.js} +96035 -130798
- package/dist/{pricing-refresh-ettrct0b.js → pricing-refresh-c2bwsyk5.js} +4 -4
- package/dist/{rbac-roles-grtmky49.js → rbac-roles-2pedz5e9.js} +2 -2
- package/dist/{rbac-roles-wdwpg5fc.js → rbac-roles-reef5y2d.js} +3 -3
- package/dist/{registry-2g6d2p3n.js → registry-6nvn6bj0.js} +2 -1
- package/dist/{render-v2-k7h2sbmp.js → render-v2-zd5r5wgf.js} +3 -3
- package/dist/{seed-pricing-gtqxtqzc.js → seed-pricing-2kyk1vhg.js} +3 -3
- package/dist/{setup-3tcfqyz9.js → setup-5ys9pwyr.js} +2 -2
- package/dist/{worker-9tejebcv.js → worker-nb1f7k04.js} +30 -29
- package/openapi.json +16 -5
- package/package.json +6 -6
- package/src/be/db.ts +52 -26
- package/src/be/migrations/runner.ts +78 -17
- package/src/be/seed/agent-fs-provision.ts +37 -8
- package/src/http/db-query.ts +20 -5
- package/src/http/scripts.ts +2 -1
- package/src/http/task-templates.ts +1 -1
- package/src/http/workflow-events.ts +2 -2
- package/src/providers/claude-managed-models.ts +2 -12
- package/src/providers/pricing-sources.md +5 -5
- package/src/scripts-runtime/eval-harness.ts +1 -3
- package/src/scripts-runtime/import-allowlist.ts +7 -1
- package/src/slack/app.ts +9 -0
- package/src/slack/handlers.ts +22 -4
- package/src/slack/socket-mode-guard.test.ts +25 -0
- package/src/slack/socket-mode-guard.ts +10 -0
- package/src/tests/agent-fs-provision-seeder.test.ts +82 -1
- package/src/tests/claude-managed-adapter.test.ts +8 -16
- package/src/tests/db-query.test.ts +95 -0
- package/src/tests/docs-index-footprint.test.js +147 -0
- package/src/tests/fixtures/compiled-migrations-boot.ts +47 -0
- package/src/tests/migration-bunfs-compat.test.ts +167 -0
- package/src/tests/script-connections.test.ts +17 -7
- package/src/tests/scripts-import-allowlist.test.ts +23 -1
- package/src/tests/scripts-mcp-e2e.test.ts +32 -0
- package/src/tests/scripts-runtime-secret-egress.test.ts +33 -0
- package/src/tests/session-costs.test.ts +414 -0
- package/src/tests/slack-thread-buffer.test.ts +248 -2
- package/src/tests/store-progress-attachments-handler.test.ts +156 -23
- package/src/tests/workflow-ctx.test.ts +22 -7
- package/src/tools/db-query.ts +5 -4
- package/src/tools/store-progress.ts +83 -22
- package/dist/{cli-snz3p4yf.js → cli-06ghj6pe.js} +6 -6
package/README.md
CHANGED
|
@@ -131,7 +131,7 @@ Check [our templates](https://templates.agent-swarm.dev) for a quick start.
|
|
|
131
131
|
- **Mid-run task steering** — add context at the next turn boundary, request an immediate interrupt where the harness supports it, or degrade safely to a follow-up task. [Task steering →](https://docs.agent-swarm.dev/docs/guides/task-steering)
|
|
132
132
|
- **Operator configuration UI** — tune non-secret feature flags, limits, integration toggles, and runtime defaults from Settings → Configuration, with source and restart-required indicators. [Configuration →](https://docs.agent-swarm.dev/docs/ui/configuration)
|
|
133
133
|
- **Asset namespaces** — group tasks, workflows, schedules, pages, apps, scripts, and mapped files under canonical shared or personal keys, with inheritance, subtree filtering, audited moves, and cross-entity discovery. [Asset namespaces →](https://docs.agent-swarm.dev/docs/guides/asset-namespaces)
|
|
134
|
-
- **Persistent shared files via agent-fs** — co-deploy agent-fs for shared task attachments, previews, and search; late provisioning or config reloads activate the provider without an API restart, and tenant-authenticated control planes can invite shared-org members without receiving the bootstrap key. [Co-deployment guide →](https://docs.agent-swarm.dev/docs/guides/agent-fs-co-deployment)
|
|
134
|
+
- **Persistent shared files via agent-fs** — co-deploy agent-fs for shared task attachments, previews, and search; `store-progress` verifies attachment pointers before changing task state, late provisioning or config reloads activate the provider without an API restart, and tenant-authenticated control planes can invite shared-org members without receiving the bootstrap key. [Co-deployment guide →](https://docs.agent-swarm.dev/docs/guides/agent-fs-co-deployment)
|
|
135
135
|
- **Durable script workflows** — launch background script runs, inspect their journals, and track them from the dashboard when a one-shot `script-run` is too small. [Guide →](https://docs.agent-swarm.dev/docs/guides/script-workflow-runs)
|
|
136
136
|
- **Scripts-only MCP mode (code-mode)** — reduce the external MCP surface to eight script tools while retaining the full swarm SDK through `script-run`, cutting tool-schema context for capable coordinator models. [Guide →](https://docs.agent-swarm.dev/docs/guides/scripts-only-mode)
|
|
137
137
|
- **Scripts as external APIs** — expose a saved script as a public `POST /api/x/script/<id>` endpoint with optional bearer auth, typed input validation, and per-endpoint usage tracking. [Guide →](https://docs.agent-swarm.dev/docs/guides/scripts-external-apis)
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
resolveSlackUserId
|
|
3
|
-
} from "./cli-
|
|
4
|
-
import"./cli-
|
|
3
|
+
} from "./cli-7ccy0h4r.js";
|
|
4
|
+
import"./cli-yw2z5kj9.js";
|
|
5
5
|
import {
|
|
6
6
|
createTaskWithSiblingAwareness
|
|
7
|
-
} from "./cli-
|
|
7
|
+
} from "./cli-w0ygcv43.js";
|
|
8
8
|
import {
|
|
9
9
|
buildCancelledBlocks,
|
|
10
10
|
ensureSlackThreadTree,
|
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
getAgentEmoji,
|
|
13
13
|
getTaskLink,
|
|
14
14
|
isSlackRenderV2Enabled
|
|
15
|
-
} from "./cli-
|
|
15
|
+
} from "./cli-j3xnd5b4.js";
|
|
16
16
|
import"./cli-qf9kpsve.js";
|
|
17
17
|
import"./cli-g2p9bd1z.js";
|
|
18
18
|
import"./cli-5tnr64pm.js";
|
|
@@ -24,15 +24,15 @@ import {
|
|
|
24
24
|
init_context_key,
|
|
25
25
|
init_db,
|
|
26
26
|
slackContextKey
|
|
27
|
-
} from "./cli-
|
|
27
|
+
} from "./cli-qxn3g3yx.js";
|
|
28
28
|
import"./cli-d2epf5ae.js";
|
|
29
29
|
import"./cli-87zrjxdb.js";
|
|
30
30
|
import"./cli-a1rrkrb4.js";
|
|
31
31
|
import"./cli-qt5bt3vk.js";
|
|
32
32
|
import"./cli-nanaxrz6.js";
|
|
33
33
|
import"./cli-s35981d0.js";
|
|
34
|
-
import"./cli-w4ezqgkj.js";
|
|
35
34
|
import"./cli-mkq1rk7b.js";
|
|
35
|
+
import"./cli-4dakdn30.js";
|
|
36
36
|
import"./cli-pqv5gvyf.js";
|
|
37
37
|
import"./cli-qntkxysp.js";
|
|
38
38
|
import"./cli-497b685t.js";
|
|
@@ -5,12 +5,12 @@ import {
|
|
|
5
5
|
import {
|
|
6
6
|
retryProviderRequest
|
|
7
7
|
} from "./cli-s8s499xy.js";
|
|
8
|
-
import {
|
|
9
|
-
getPiUserAgent
|
|
10
|
-
} from "./cli-et1bbwqf.js";
|
|
11
8
|
import {
|
|
12
9
|
splitDeferredTools
|
|
13
10
|
} from "./cli-vfcth11k.js";
|
|
11
|
+
import {
|
|
12
|
+
getPiUserAgent
|
|
13
|
+
} from "./cli-et1bbwqf.js";
|
|
14
14
|
import {
|
|
15
15
|
getProviderEnvValue
|
|
16
16
|
} from "./cli-00w4hbam.js";
|
|
@@ -25,7 +25,7 @@ import {
|
|
|
25
25
|
getJsonSchemaToolParameters,
|
|
26
26
|
resolveJsonSchemaStrictSampling,
|
|
27
27
|
transformMessages
|
|
28
|
-
} from "./cli-
|
|
28
|
+
} from "./cli-j8dggbcr.js";
|
|
29
29
|
import {
|
|
30
30
|
sanitizeSurrogates
|
|
31
31
|
} from "./cli-y2apkfe2.js";
|
|
@@ -4919,6 +4919,10 @@ function convertContentBlocks(content) {
|
|
|
4919
4919
|
}
|
|
4920
4920
|
var FINE_GRAINED_TOOL_STREAMING_BETA = "fine-grained-tool-streaming-2025-05-14";
|
|
4921
4921
|
var INTERLEAVED_THINKING_BETA = "interleaved-thinking-2025-05-14";
|
|
4922
|
+
var SERVER_SIDE_FALLBACK_BETA = "server-side-fallback-2026-07-01";
|
|
4923
|
+
function shouldUseServerSideFallbackBeta(model) {
|
|
4924
|
+
return (model.compat?.allowedFallbackModels?.length ?? 0) > 0;
|
|
4925
|
+
}
|
|
4922
4926
|
function getAnthropicCompat(model) {
|
|
4923
4927
|
return {
|
|
4924
4928
|
supportsEagerToolInputStreaming: model.compat?.supportsEagerToolInputStreaming ?? true,
|
|
@@ -4950,16 +4954,8 @@ function mergeHeaders(...headerSources) {
|
|
|
4950
4954
|
}
|
|
4951
4955
|
return merged;
|
|
4952
4956
|
}
|
|
4953
|
-
function mergeClientHeaders(
|
|
4954
|
-
|
|
4955
|
-
if (model.provider === "kimi-coding") {
|
|
4956
|
-
for (const name of Object.keys(merged)) {
|
|
4957
|
-
if (name.toLowerCase() === "user-agent")
|
|
4958
|
-
delete merged[name];
|
|
4959
|
-
}
|
|
4960
|
-
merged["User-Agent"] = getPiUserAgent();
|
|
4961
|
-
}
|
|
4962
|
-
return merged;
|
|
4957
|
+
function mergeClientHeaders(...headerSources) {
|
|
4958
|
+
return mergeHeaders({ "User-Agent": getPiUserAgent() }, ...headerSources);
|
|
4963
4959
|
}
|
|
4964
4960
|
function hasHeader(headers, name) {
|
|
4965
4961
|
if (!headers)
|
|
@@ -5152,6 +5148,7 @@ var stream = (model, context, options) => {
|
|
|
5152
5148
|
try {
|
|
5153
5149
|
let client;
|
|
5154
5150
|
let isOAuth;
|
|
5151
|
+
let usageModel = model;
|
|
5155
5152
|
if (options?.client) {
|
|
5156
5153
|
client = options.client;
|
|
5157
5154
|
isOAuth = false;
|
|
@@ -5168,7 +5165,7 @@ var stream = (model, context, options) => {
|
|
|
5168
5165
|
}
|
|
5169
5166
|
const cacheRetention = resolveCacheRetention(options?.cacheRetention, options?.env);
|
|
5170
5167
|
const cacheSessionId = cacheRetention === "none" ? undefined : options?.sessionId;
|
|
5171
|
-
const created = createClient(model, apiKey, options?.interleavedThinking ?? true, shouldUseFineGrainedToolStreamingBeta(model, context), options?.headers, options?.fetch, copilotDynamicHeaders, cacheSessionId);
|
|
5168
|
+
const created = createClient(model, apiKey, options?.interleavedThinking ?? true, shouldUseFineGrainedToolStreamingBeta(model, context), shouldUseServerSideFallbackBeta(model), options?.headers, options?.fetch, copilotDynamicHeaders, cacheSessionId);
|
|
5172
5169
|
client = created.client;
|
|
5173
5170
|
isOAuth = created.isOAuthToken;
|
|
5174
5171
|
}
|
|
@@ -5193,13 +5190,16 @@ var stream = (model, context, options) => {
|
|
|
5193
5190
|
for await (const event of iterateAnthropicEvents(response, options?.signal)) {
|
|
5194
5191
|
if (event.type === "message_start") {
|
|
5195
5192
|
output.responseId = event.message.id;
|
|
5193
|
+
output.model = event.message.model;
|
|
5194
|
+
const fallbackCost = output.model === model.id ? undefined : model.compat?.allowedFallbackModels?.find((fallback) => fallback.provider === model.provider && fallback.model === output.model)?.cost;
|
|
5195
|
+
usageModel = fallbackCost ? { ...model, id: output.model, cost: fallbackCost } : model;
|
|
5196
5196
|
output.usage.input = event.message.usage.input_tokens || 0;
|
|
5197
5197
|
output.usage.output = event.message.usage.output_tokens || 0;
|
|
5198
5198
|
output.usage.cacheRead = event.message.usage.cache_read_input_tokens || 0;
|
|
5199
5199
|
output.usage.cacheWrite = event.message.usage.cache_creation_input_tokens || 0;
|
|
5200
5200
|
output.usage.cacheWrite1h = event.message.usage.cache_creation?.ephemeral_1h_input_tokens || 0;
|
|
5201
5201
|
output.usage.totalTokens = output.usage.input + output.usage.output + output.usage.cacheRead + output.usage.cacheWrite;
|
|
5202
|
-
calculateCost(
|
|
5202
|
+
calculateCost(usageModel, output.usage);
|
|
5203
5203
|
} else if (event.type === "content_block_start") {
|
|
5204
5204
|
if (event.content_block.type === "text") {
|
|
5205
5205
|
const block = {
|
|
@@ -5344,7 +5344,7 @@ var stream = (model, context, options) => {
|
|
|
5344
5344
|
}
|
|
5345
5345
|
}
|
|
5346
5346
|
output.usage.totalTokens = output.usage.input + output.usage.output + output.usage.cacheRead + output.usage.cacheWrite;
|
|
5347
|
-
calculateCost(
|
|
5347
|
+
calculateCost(usageModel, output.usage);
|
|
5348
5348
|
}
|
|
5349
5349
|
}
|
|
5350
5350
|
if (options?.signal?.aborted) {
|
|
@@ -5389,9 +5389,15 @@ function mapThinkingLevelToEffort(model, level) {
|
|
|
5389
5389
|
}
|
|
5390
5390
|
var streamSimple = (model, context, options) => {
|
|
5391
5391
|
assertRequestAuth(model.provider, options?.apiKey, options?.headers);
|
|
5392
|
-
const base =
|
|
5392
|
+
const base = {
|
|
5393
|
+
...buildBaseOptions(model, context, options, options?.apiKey),
|
|
5394
|
+
toolChoice: options?.toolChoice
|
|
5395
|
+
};
|
|
5393
5396
|
if (!options?.reasoning) {
|
|
5394
|
-
return stream(model, context, {
|
|
5397
|
+
return stream(model, context, {
|
|
5398
|
+
...base,
|
|
5399
|
+
thinkingEnabled: false
|
|
5400
|
+
});
|
|
5395
5401
|
}
|
|
5396
5402
|
if (model.compat?.forceAdaptiveThinking === true) {
|
|
5397
5403
|
const effort = mapThinkingLevelToEffort(model, options.reasoning);
|
|
@@ -5413,7 +5419,7 @@ var streamSimple = (model, context, options) => {
|
|
|
5413
5419
|
function isOAuthToken(apiKey) {
|
|
5414
5420
|
return apiKey.includes("sk-ant-oat");
|
|
5415
5421
|
}
|
|
5416
|
-
function createClient(model, apiKey, interleavedThinking, useFineGrainedToolStreamingBeta, optionsHeaders, fetch2, dynamicHeaders, sessionId) {
|
|
5422
|
+
function createClient(model, apiKey, interleavedThinking, useFineGrainedToolStreamingBeta, useServerSideFallbackBeta, optionsHeaders, fetch2, dynamicHeaders, sessionId) {
|
|
5417
5423
|
const needsInterleavedBeta = interleavedThinking && model.compat?.forceAdaptiveThinking !== true;
|
|
5418
5424
|
const betaFeatures = [];
|
|
5419
5425
|
if (useFineGrainedToolStreamingBeta) {
|
|
@@ -5422,6 +5428,9 @@ function createClient(model, apiKey, interleavedThinking, useFineGrainedToolStre
|
|
|
5422
5428
|
if (needsInterleavedBeta) {
|
|
5423
5429
|
betaFeatures.push(INTERLEAVED_THINKING_BETA);
|
|
5424
5430
|
}
|
|
5431
|
+
if (useServerSideFallbackBeta) {
|
|
5432
|
+
betaFeatures.push(SERVER_SIDE_FALLBACK_BETA);
|
|
5433
|
+
}
|
|
5425
5434
|
if (model.provider === "github-copilot") {
|
|
5426
5435
|
const client2 = new Anthropic({
|
|
5427
5436
|
apiKey: null,
|
|
@@ -5429,7 +5438,7 @@ function createClient(model, apiKey, interleavedThinking, useFineGrainedToolStre
|
|
|
5429
5438
|
baseURL: model.baseUrl,
|
|
5430
5439
|
dangerouslyAllowBrowser: true,
|
|
5431
5440
|
fetch: fetch2,
|
|
5432
|
-
defaultHeaders: mergeClientHeaders(
|
|
5441
|
+
defaultHeaders: mergeClientHeaders({
|
|
5433
5442
|
accept: "application/json",
|
|
5434
5443
|
"anthropic-dangerous-direct-browser-access": "true",
|
|
5435
5444
|
...betaFeatures.length > 0 ? { "anthropic-beta": betaFeatures.join(",") } : {}
|
|
@@ -5444,7 +5453,7 @@ function createClient(model, apiKey, interleavedThinking, useFineGrainedToolStre
|
|
|
5444
5453
|
baseURL: model.baseUrl,
|
|
5445
5454
|
dangerouslyAllowBrowser: true,
|
|
5446
5455
|
fetch: fetch2,
|
|
5447
|
-
defaultHeaders: mergeClientHeaders(
|
|
5456
|
+
defaultHeaders: mergeClientHeaders({
|
|
5448
5457
|
accept: "application/json",
|
|
5449
5458
|
"anthropic-dangerous-direct-browser-access": "true",
|
|
5450
5459
|
"anthropic-beta": ["claude-code-20250219", "oauth-2025-04-20", ...betaFeatures].join(","),
|
|
@@ -5455,7 +5464,7 @@ function createClient(model, apiKey, interleavedThinking, useFineGrainedToolStre
|
|
|
5455
5464
|
return { client: client2, isOAuthToken: true };
|
|
5456
5465
|
}
|
|
5457
5466
|
const sessionAffinityHeaders = sessionId && getAnthropicCompat(model).sendSessionAffinityHeaders ? { "x-session-affinity": sessionId } : {};
|
|
5458
|
-
const defaultHeaders = mergeClientHeaders(
|
|
5467
|
+
const defaultHeaders = mergeClientHeaders({
|
|
5459
5468
|
accept: "application/json",
|
|
5460
5469
|
"anthropic-dangerous-direct-browser-access": "true",
|
|
5461
5470
|
...betaFeatures.length > 0 ? { "anthropic-beta": betaFeatures.join(",") } : {}
|
|
@@ -5554,6 +5563,10 @@ function buildParams(model, context, isOAuthToken2, options) {
|
|
|
5554
5563
|
params.tool_choice = options.toolChoice;
|
|
5555
5564
|
}
|
|
5556
5565
|
}
|
|
5566
|
+
const allowedFallbackModels = model.compat?.allowedFallbackModels;
|
|
5567
|
+
if (allowedFallbackModels && allowedFallbackModels.length > 0) {
|
|
5568
|
+
params.fallbacks = allowedFallbackModels.map((fallback) => ({ model: fallback.model }));
|
|
5569
|
+
}
|
|
5557
5570
|
return params;
|
|
5558
5571
|
}
|
|
5559
5572
|
function normalizeToolCallId(id) {
|
|
@@ -3,19 +3,19 @@ import {
|
|
|
3
3
|
initSlackApp,
|
|
4
4
|
startSlackApp,
|
|
5
5
|
stopSlackApp
|
|
6
|
-
} from "./cli-
|
|
6
|
+
} from "./cli-j3xnd5b4.js";
|
|
7
7
|
import"./cli-qf9kpsve.js";
|
|
8
8
|
import"./cli-g2p9bd1z.js";
|
|
9
9
|
import"./cli-5tnr64pm.js";
|
|
10
|
-
import"./cli-
|
|
10
|
+
import"./cli-qxn3g3yx.js";
|
|
11
11
|
import"./cli-d2epf5ae.js";
|
|
12
12
|
import"./cli-87zrjxdb.js";
|
|
13
13
|
import"./cli-a1rrkrb4.js";
|
|
14
14
|
import"./cli-qt5bt3vk.js";
|
|
15
15
|
import"./cli-nanaxrz6.js";
|
|
16
16
|
import"./cli-s35981d0.js";
|
|
17
|
-
import"./cli-w4ezqgkj.js";
|
|
18
17
|
import"./cli-mkq1rk7b.js";
|
|
18
|
+
import"./cli-4dakdn30.js";
|
|
19
19
|
import"./cli-pqv5gvyf.js";
|
|
20
20
|
import"./cli-qntkxysp.js";
|
|
21
21
|
import"./cli-497b685t.js";
|
|
@@ -2,24 +2,24 @@ import {
|
|
|
2
2
|
bufferThreadMessage,
|
|
3
3
|
getBufferMessageCount,
|
|
4
4
|
wasEventSeen
|
|
5
|
-
} from "./cli-
|
|
5
|
+
} from "./cli-mfa2eaef.js";
|
|
6
6
|
import {
|
|
7
7
|
hasOtherUserMention
|
|
8
|
-
} from "./cli-
|
|
8
|
+
} from "./cli-1dfatkzm.js";
|
|
9
9
|
import {
|
|
10
10
|
resolveSlackUserId,
|
|
11
11
|
rewriteSlackMentions
|
|
12
|
-
} from "./cli-
|
|
13
|
-
import"./cli-
|
|
12
|
+
} from "./cli-7ccy0h4r.js";
|
|
13
|
+
import"./cli-yw2z5kj9.js";
|
|
14
14
|
import {
|
|
15
15
|
createTaskWithSiblingAwareness
|
|
16
|
-
} from "./cli-
|
|
16
|
+
} from "./cli-w0ygcv43.js";
|
|
17
17
|
import {
|
|
18
18
|
ackSlackMessage,
|
|
19
19
|
ensureSlackThreadTree,
|
|
20
20
|
isSlackRenderV2Enabled,
|
|
21
21
|
require_dist
|
|
22
|
-
} from "./cli-
|
|
22
|
+
} from "./cli-j3xnd5b4.js";
|
|
23
23
|
import"./cli-qf9kpsve.js";
|
|
24
24
|
import"./cli-g2p9bd1z.js";
|
|
25
25
|
import"./cli-5tnr64pm.js";
|
|
@@ -30,7 +30,7 @@ import {
|
|
|
30
30
|
init_context_key,
|
|
31
31
|
init_db,
|
|
32
32
|
slackContextKey
|
|
33
|
-
} from "./cli-
|
|
33
|
+
} from "./cli-qxn3g3yx.js";
|
|
34
34
|
import"./cli-d2epf5ae.js";
|
|
35
35
|
import {
|
|
36
36
|
init_resolver,
|
|
@@ -43,8 +43,8 @@ import {
|
|
|
43
43
|
isEnvFlagEnabled
|
|
44
44
|
} from "./cli-nanaxrz6.js";
|
|
45
45
|
import"./cli-s35981d0.js";
|
|
46
|
-
import"./cli-w4ezqgkj.js";
|
|
47
46
|
import"./cli-mkq1rk7b.js";
|
|
47
|
+
import"./cli-4dakdn30.js";
|
|
48
48
|
import"./cli-pqv5gvyf.js";
|
|
49
49
|
import"./cli-qntkxysp.js";
|
|
50
50
|
import"./cli-497b685t.js";
|
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
convertResponsesMessages,
|
|
3
3
|
convertResponsesTools,
|
|
4
4
|
processResponsesStream
|
|
5
|
-
} from "./cli-
|
|
5
|
+
} from "./cli-9phjbffs.js";
|
|
6
6
|
import {
|
|
7
7
|
clampOpenAIPromptCacheKey
|
|
8
8
|
} from "./cli-mrptpp86.js";
|
|
@@ -10,6 +10,9 @@ import"./cli-5m9j2spm.js";
|
|
|
10
10
|
import {
|
|
11
11
|
retryProviderRequest
|
|
12
12
|
} from "./cli-s8s499xy.js";
|
|
13
|
+
import {
|
|
14
|
+
getPiUserAgent
|
|
15
|
+
} from "./cli-et1bbwqf.js";
|
|
13
16
|
import {
|
|
14
17
|
AzureOpenAI,
|
|
15
18
|
init_openai
|
|
@@ -25,7 +28,7 @@ import"./cli-7jcc9y1r.js";
|
|
|
25
28
|
import {
|
|
26
29
|
buildBaseOptions,
|
|
27
30
|
createGrammarToolInputProperties
|
|
28
|
-
} from "./cli-
|
|
31
|
+
} from "./cli-j8dggbcr.js";
|
|
29
32
|
import"./cli-y2apkfe2.js";
|
|
30
33
|
import {
|
|
31
34
|
headersToRecord
|
|
@@ -144,7 +147,10 @@ var streamSimple = (model, context, options) => {
|
|
|
144
147
|
if (!apiKey) {
|
|
145
148
|
throw new Error(`No API key for provider: ${model.provider}`);
|
|
146
149
|
}
|
|
147
|
-
const base =
|
|
150
|
+
const base = {
|
|
151
|
+
...buildBaseOptions(model, context, options, apiKey),
|
|
152
|
+
toolChoice: options?.toolChoice
|
|
153
|
+
};
|
|
148
154
|
const clampedReasoning = options?.reasoning ? clampThinkingLevel(model, options.reasoning) : undefined;
|
|
149
155
|
const reasoningEffort = clampedReasoning === "off" ? undefined : clampedReasoning;
|
|
150
156
|
return stream(model, context, {
|
|
@@ -191,7 +197,7 @@ function resolveAzureConfig(model, options) {
|
|
|
191
197
|
};
|
|
192
198
|
}
|
|
193
199
|
function createClient(model, apiKey, options) {
|
|
194
|
-
const headers = { ...model.headers };
|
|
200
|
+
const headers = { "User-Agent": getPiUserAgent(), ...model.headers };
|
|
195
201
|
if (options?.headers) {
|
|
196
202
|
Object.assign(headers, options.headers);
|
|
197
203
|
}
|
|
@@ -228,6 +234,9 @@ function buildParams(model, context, options, deploymentName, grammarToolInputPr
|
|
|
228
234
|
supportsOpenAIGrammarTools: model.compat?.supportsOpenAIGrammarTools ?? false
|
|
229
235
|
});
|
|
230
236
|
}
|
|
237
|
+
if (options?.toolChoice !== undefined) {
|
|
238
|
+
params.tool_choice = options.toolChoice;
|
|
239
|
+
}
|
|
231
240
|
if (model.reasoning) {
|
|
232
241
|
if (options?.reasoningEffort || options?.reasoningSummary) {
|
|
233
242
|
const effort = options?.reasoningEffort ? model.thinkingLevelMap?.[options.reasoningEffort] ?? options.reasoningEffort : "medium";
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import {
|
|
2
2
|
embedScript,
|
|
3
3
|
embeddingProvider
|
|
4
|
-
} from "./cli-
|
|
5
|
-
import"./cli-
|
|
4
|
+
} from "./cli-0jhyxtdj.js";
|
|
5
|
+
import"./cli-4rdjdddh.js";
|
|
6
6
|
import"./cli-dr5tcz68.js";
|
|
7
7
|
import"./cli-vsap7a8d.js";
|
|
8
8
|
import {
|
|
9
9
|
getDbClient,
|
|
10
10
|
init_db
|
|
11
|
-
} from "./cli-
|
|
11
|
+
} from "./cli-qxn3g3yx.js";
|
|
12
12
|
import"./cli-d2epf5ae.js";
|
|
13
13
|
import"./cli-87zrjxdb.js";
|
|
14
14
|
import"./cli-a1rrkrb4.js";
|
|
15
15
|
import"./cli-qt5bt3vk.js";
|
|
16
16
|
import"./cli-nanaxrz6.js";
|
|
17
17
|
import"./cli-s35981d0.js";
|
|
18
|
-
import"./cli-w4ezqgkj.js";
|
|
19
18
|
import"./cli-mkq1rk7b.js";
|
|
19
|
+
import"./cli-4dakdn30.js";
|
|
20
20
|
import"./cli-pqv5gvyf.js";
|
|
21
21
|
import"./cli-pq2ee5ja.js";
|
|
22
22
|
|
|
@@ -3,21 +3,21 @@ import {
|
|
|
3
3
|
getEmbeddingProvider,
|
|
4
4
|
getMemoryStore,
|
|
5
5
|
init_constants
|
|
6
|
-
} from "./cli-
|
|
6
|
+
} from "./cli-4rdjdddh.js";
|
|
7
7
|
import"./cli-dr5tcz68.js";
|
|
8
8
|
import"./cli-vsap7a8d.js";
|
|
9
9
|
import {
|
|
10
10
|
getDbClient,
|
|
11
11
|
init_db
|
|
12
|
-
} from "./cli-
|
|
12
|
+
} from "./cli-qxn3g3yx.js";
|
|
13
13
|
import"./cli-d2epf5ae.js";
|
|
14
14
|
import"./cli-87zrjxdb.js";
|
|
15
15
|
import"./cli-a1rrkrb4.js";
|
|
16
16
|
import"./cli-qt5bt3vk.js";
|
|
17
17
|
import"./cli-nanaxrz6.js";
|
|
18
18
|
import"./cli-s35981d0.js";
|
|
19
|
-
import"./cli-w4ezqgkj.js";
|
|
20
19
|
import"./cli-mkq1rk7b.js";
|
|
20
|
+
import"./cli-4dakdn30.js";
|
|
21
21
|
import"./cli-pqv5gvyf.js";
|
|
22
22
|
import"./cli-pq2ee5ja.js";
|
|
23
23
|
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getDbClient,
|
|
3
3
|
init_db
|
|
4
|
-
} from "./cli-
|
|
4
|
+
} from "./cli-qxn3g3yx.js";
|
|
5
5
|
import"./cli-d2epf5ae.js";
|
|
6
6
|
import"./cli-87zrjxdb.js";
|
|
7
7
|
import"./cli-a1rrkrb4.js";
|
|
8
8
|
import"./cli-qt5bt3vk.js";
|
|
9
9
|
import"./cli-nanaxrz6.js";
|
|
10
10
|
import"./cli-s35981d0.js";
|
|
11
|
-
import"./cli-w4ezqgkj.js";
|
|
12
11
|
import {
|
|
13
12
|
init_secret_scrubber,
|
|
14
13
|
scrubSecrets
|
|
15
14
|
} from "./cli-mkq1rk7b.js";
|
|
15
|
+
import"./cli-4dakdn30.js";
|
|
16
16
|
import"./cli-pqv5gvyf.js";
|
|
17
17
|
import"./cli-pq2ee5ja.js";
|
|
18
18
|
|
|
@@ -12,14 +12,14 @@ import {
|
|
|
12
12
|
resolveClaudeBinary,
|
|
13
13
|
resolveClaudeBinaryArgv,
|
|
14
14
|
resolveClaudeBridgeEnabled
|
|
15
|
-
} from "./cli-
|
|
16
|
-
import"./cli-
|
|
15
|
+
} from "./cli-8f4h27gm.js";
|
|
16
|
+
import"./cli-1z01xdqh.js";
|
|
17
17
|
import"./cli-a3pkfpqs.js";
|
|
18
|
+
import"./cli-a1zrc2g6.js";
|
|
19
|
+
import"./cli-hp1n6zq3.js";
|
|
18
20
|
import"./cli-tng3131n.js";
|
|
19
21
|
import"./cli-zm7njwzd.js";
|
|
20
22
|
import"./cli-cw70hymf.js";
|
|
21
|
-
import"./cli-y37pxs1m.js";
|
|
22
|
-
import"./cli-hp1n6zq3.js";
|
|
23
23
|
import"./cli-v1mwc5v2.js";
|
|
24
24
|
import"./cli-8p37s71j.js";
|
|
25
25
|
import"./cli-e7d20cty.js";
|
|
@@ -35,8 +35,8 @@ import"./cli-a1rrkrb4.js";
|
|
|
35
35
|
import"./cli-qt5bt3vk.js";
|
|
36
36
|
import"./cli-nanaxrz6.js";
|
|
37
37
|
import"./cli-s35981d0.js";
|
|
38
|
-
import"./cli-w4ezqgkj.js";
|
|
39
38
|
import"./cli-mkq1rk7b.js";
|
|
39
|
+
import"./cli-4dakdn30.js";
|
|
40
40
|
import"./cli-pqv5gvyf.js";
|
|
41
41
|
import"./cli-darcwax3.js";
|
|
42
42
|
import"./cli-00w4hbam.js";
|
|
@@ -3,11 +3,11 @@ import {
|
|
|
3
3
|
checkClaudeManagedCredentials,
|
|
4
4
|
composeManagedUserMessage,
|
|
5
5
|
normalizeRepoUrl
|
|
6
|
-
} from "./cli-
|
|
6
|
+
} from "./cli-0crn5kaz.js";
|
|
7
7
|
import"./cli-hsxj0yar.js";
|
|
8
|
-
import"./cli-cw70hymf.js";
|
|
9
8
|
import"./cli-f64gdfxc.js";
|
|
10
9
|
import"./cli-hp1n6zq3.js";
|
|
10
|
+
import"./cli-cw70hymf.js";
|
|
11
11
|
import"./cli-jepmgn7r.js";
|
|
12
12
|
import"./cli-mkq1rk7b.js";
|
|
13
13
|
import"./cli-pq2ee5ja.js";
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createSwarmEventHandler
|
|
3
3
|
} from "./cli-hsxj0yar.js";
|
|
4
|
-
import {
|
|
5
|
-
CONTEXT_FORMULA,
|
|
6
|
-
clampContextPercent,
|
|
7
|
-
computeContextUsedUnified,
|
|
8
|
-
getContextWindowSize
|
|
9
|
-
} from "./cli-cw70hymf.js";
|
|
10
4
|
import {
|
|
11
5
|
readPkgVersion
|
|
12
6
|
} from "./cli-f64gdfxc.js";
|
|
13
7
|
import {
|
|
14
8
|
checkToolLoop
|
|
15
9
|
} from "./cli-hp1n6zq3.js";
|
|
10
|
+
import {
|
|
11
|
+
CONTEXT_FORMULA,
|
|
12
|
+
clampContextPercent,
|
|
13
|
+
computeContextUsedUnified,
|
|
14
|
+
getContextWindowSize
|
|
15
|
+
} from "./cli-cw70hymf.js";
|
|
16
16
|
import {
|
|
17
17
|
Anthropic
|
|
18
18
|
} from "./cli-jepmgn7r.js";
|
|
@@ -48,16 +48,7 @@ var CLAUDE_MANAGED_MODEL_PRICING = {
|
|
|
48
48
|
inputPerMillion: 2,
|
|
49
49
|
outputPerMillion: 10,
|
|
50
50
|
cacheReadPerMillion: 0.2,
|
|
51
|
-
cacheWritePerMillion: 2.5
|
|
52
|
-
scheduledChange: {
|
|
53
|
-
effectiveAt: "2026-09-01T00:00:00.000Z",
|
|
54
|
-
pricing: {
|
|
55
|
-
inputPerMillion: 3,
|
|
56
|
-
outputPerMillion: 15,
|
|
57
|
-
cacheReadPerMillion: 0.3,
|
|
58
|
-
cacheWritePerMillion: 3.75
|
|
59
|
-
}
|
|
60
|
-
}
|
|
51
|
+
cacheWritePerMillion: 2.5
|
|
61
52
|
},
|
|
62
53
|
"claude-sonnet-4-6": {
|
|
63
54
|
inputPerMillion: 3,
|
|
@@ -4,11 +4,11 @@ import {
|
|
|
4
4
|
getEmbeddingProvider,
|
|
5
5
|
init_embedding,
|
|
6
6
|
serializeEmbedding
|
|
7
|
-
} from "./cli-
|
|
7
|
+
} from "./cli-4rdjdddh.js";
|
|
8
8
|
import {
|
|
9
9
|
getDbClient,
|
|
10
10
|
init_db
|
|
11
|
-
} from "./cli-
|
|
11
|
+
} from "./cli-qxn3g3yx.js";
|
|
12
12
|
import {
|
|
13
13
|
init_secret_scrubber,
|
|
14
14
|
scrubSecrets
|