@desplega.ai/agent-swarm 1.135.1 → 1.136.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/{actions-cdtyz12q.js → actions-agcbc8nd.js} +6 -6
- package/dist/{anthropic-messages-706yad38.js → anthropic-messages-pm7pp23c.js} +36 -23
- package/dist/{app-bsbct708.js → app-g2s78xya.js} +3 -3
- package/dist/{assistant-139yzd1t.js → assistant-yd3jkb9d.js} +8 -8
- package/dist/{azure-openai-responses-40z2astx.js → azure-openai-responses-cwesc845.js} +13 -4
- package/dist/{boot-reembed-q7f385st.js → boot-reembed-6spqw4q0.js} +3 -3
- package/dist/{boot-reembed-gdzp4g2k.js → boot-reembed-b22s9w5x.js} +4 -4
- package/dist/{boot-scrub-logs-ammdkvre.js → boot-scrub-logs-6h3cqkc0.js} +2 -2
- package/dist/{claude-adapter-h67y60dz.js → claude-adapter-ng5y8zd7.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-0v7jxbvz.js +6724 -0
- package/dist/{cli-dntm4d6r.js → cli-35jknh9e.js} +5 -5
- package/dist/{cli-5vmvkwey.js → cli-3y553gws.js} +1 -1
- package/dist/{cli-6t91v11y.js → cli-4gzv54ss.js} +15 -6
- package/dist/{cli-j6fpcrdk.js → cli-4r4jkqep.js} +6 -6
- package/dist/{cli-17e3ydca.js → cli-54ht104h.js} +37 -11
- package/dist/{cli-t46mkxd2.js → cli-5bnz1t86.js} +1 -1
- package/dist/{cli-47d0y52n.js → cli-68vayryq.js} +2 -2
- package/dist/{cli-mgnrknyg.js → cli-6gwgzdgw.js} +5 -5
- package/dist/{cli-x0mnesvr.js → cli-84vrhesc.js} +1 -1
- package/dist/{cli-j8bhw4a7.js → cli-8v57p983.js} +14 -14
- package/dist/{cli-vtz6yj3v.js → cli-9phjbffs.js} +1 -1
- package/dist/{cli-vew6xw8p.js → cli-ads0hfw2.js} +103 -36
- package/dist/{cli-0rgbgtft.js → cli-bnq8h7ea.js} +6 -6
- package/dist/{cli-6ewfzrgz.js → cli-d5ygfv18.js} +7 -6
- package/dist/{cli-pnqdak88.js → cli-edwrx42s.js} +1 -1
- package/dist/{cli-7vk1ztap.js → cli-fpjmcbhz.js} +4 -4
- package/dist/{cli-z3h9zvty.js → cli-gpdtxzar.js} +6 -4
- package/dist/{cli-zg86g3q8.js → cli-hz5hp6wn.js} +1 -1
- package/dist/{cli-96sytm77.js → cli-j7qp8gtf.js} +10 -6
- package/dist/{cli-xmyqv00z.js → cli-j8dggbcr.js} +17 -11
- package/dist/{cli-pbatxkne.js → cli-jjhnma34.js} +5 -5
- package/dist/{cli-h8htvhk5.js → cli-m3z53bed.js} +1 -1
- package/dist/{cli-mqwe8xz0.js → cli-mgef08pc.js} +1 -1
- package/dist/{cli-9nrnc45k.js → cli-qckgdqmr.js} +2 -2
- package/dist/{cli-y37pxs1m.js → cli-qhfkxrpg.js} +230 -105
- package/dist/{cli-tv9f1kyb.js → cli-s73zwwqn.js} +97 -7
- package/dist/{cli-3zmdzfjf.js → cli-s9gpxh9q.js} +17 -2
- package/dist/{cli-41wfr4tp.js → cli-spf767vc.js} +1 -1
- package/dist/{cli-ysehve35.js → cli-tee8w7tq.js} +1 -1
- package/dist/{cli-q46hkq2p.js → cli-tmn19cdz.js} +98 -24
- package/dist/{cli-gkfzvf7n.js → cli-y16cesaq.js} +2 -2
- package/dist/{cli-3ad3q6j0.js → cli-z6e8eqrm.js} +2 -2
- package/dist/cli.js +19 -19
- package/dist/{codex-adapter-8vhjvnp9.js → codex-adapter-kw11ps3j.js} +4 -4
- package/dist/{codex-session-runner-xeq8w3ea.js → codex-session-runner-sffb69v7.js} +4 -4
- package/dist/{commands-zhm1v98e.js → commands-0xxp4tz8.js} +2 -2
- package/dist/{db-q436srrz.js → db-0npp39zd.js} +6 -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-cpratgdt.js → handlers-5p7a1jx6.js} +15 -9
- package/dist/{hook-wfe2rdyd.js → hook-hpefr0a8.js} +5 -5
- package/dist/{hook-j1sd08ay.js → hook-jjpxn4se.js} +3 -3
- package/dist/{http-g13pqz5z.js → http-wfp33653.js} +332 -71
- package/dist/{index-jbgemxkn.js → index-17h657rg.js} +13 -9
- package/dist/index-g9tttwkm.js +26012 -0
- package/dist/{index-g99vy4xs.js → index-m2p7ctyh.js} +11 -11
- package/dist/{index-dde8asrx.js → index-racb4wfq.js} +10 -10
- package/dist/{index-zqjz0kf8.js → index-zh66wm65.js} +9 -9
- package/dist/{keepalive-ep0a9f7r.js → keepalive-wxjd633a.js} +4 -4
- package/dist/{lead-gsw42hv0.js → lead-359ec2z0.js} +29 -29
- package/dist/{maintenance-et8rr4t5.js → maintenance-rr03qjtb.js} +4 -4
- package/dist/{mistral-conversations-2njwdwhj.js → mistral-conversations-qdrnmrb8.js} +10 -3
- package/dist/{oauth-refresh-sweep-tk3qn7zr.js → oauth-refresh-sweep-jwj22yb8.js} +3 -3
- package/dist/{onboard-354g4580.js → onboard-asnhchcv.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-yzftqrft.js} +134 -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-7y3szdz5.js → otel-impl-54cra6mw.js} +21 -7
- package/dist/{pi-messages-txp9f97r.js → pi-messages-2d3e7egd.js} +1 -1
- package/dist/{pi-mono-adapter-6vmrr3g8.js → pi-mono-adapter-29g7axgj.js} +96532 -130961
- package/dist/{pricing-refresh-zra6kqmc.js → pricing-refresh-mkyy7c2y.js} +4 -4
- package/dist/{rbac-roles-vsfaw815.js → rbac-roles-ak56tr75.js} +2 -2
- package/dist/{rbac-roles-2g89azp9.js → rbac-roles-kb3afm95.js} +3 -3
- package/dist/{render-v2-41schhkc.js → render-v2-434asg49.js} +3 -3
- package/dist/{seed-pricing-hh2j4y52.js → seed-pricing-nbmd7ah8.js} +3 -3
- package/dist/{setup-vk6apbbf.js → setup-wh4qmjs4.js} +2 -2
- package/dist/{worker-zj8qahay.js → worker-j1d27tjv.js} +29 -29
- package/openapi.json +182 -6
- package/package.json +6 -6
- package/src/be/db-retention.ts +275 -0
- package/src/be/db.ts +100 -7
- package/src/be/migrations/runner.ts +78 -17
- package/src/be/seed/agent-fs-provision.ts +37 -8
- package/src/be/swarm-config-guard.ts +30 -0
- package/src/heartbeat/heartbeat.ts +21 -0
- package/src/http/db-query.ts +20 -5
- package/src/http/index.ts +33 -33
- package/src/http/route-def.ts +93 -4
- package/src/http/stats.ts +37 -1
- package/src/http/task-templates.ts +1 -1
- package/src/http/tasks.ts +93 -0
- package/src/http/utils.ts +94 -0
- package/src/http/workflow-events.ts +2 -2
- package/src/otel-impl.ts +21 -3
- package/src/otel.ts +15 -4
- package/src/providers/claude-managed-models.ts +2 -12
- package/src/providers/pricing-sources.md +5 -5
- package/src/slack/blocks.ts +1 -0
- package/src/slack/handlers.ts +7 -0
- package/src/tasks/sibling-awareness.ts +1 -0
- package/src/tasks/sibling-block.ts +17 -4
- package/src/tests/agent-fs-provision-seeder.test.ts +82 -1
- package/src/tests/artifact-sdk.test.ts +20 -15
- package/src/tests/claude-managed-adapter.test.ts +8 -16
- package/src/tests/db-query.test.ts +95 -0
- package/src/tests/db-retention.test.ts +344 -0
- package/src/tests/docs-index-footprint.test.js +146 -0
- package/src/tests/draft-task-dispatch-race.test.ts +189 -0
- package/src/tests/events-http.test.ts +70 -27
- package/src/tests/fixtures/compiled-migrations-boot.ts +47 -0
- package/src/tests/migration-bunfs-compat.test.ts +167 -0
- package/src/tests/otel-abort-span.test.ts +156 -0
- package/src/tests/otel-span-kind.test.ts +59 -0
- package/src/tests/promote-draft-task-route.test.ts +175 -0
- package/src/tests/route-def-find-route.test.ts +90 -4
- package/src/tests/sibling-block.test.ts +29 -1
- package/src/tests/slack-assistant-comention-production.test.ts +7 -1
- package/src/tests/steering-enabled.test.ts +6 -0
- package/src/tests/swarm-config-reserved-keys.test.ts +27 -0
- package/src/tools/db-query.ts +5 -4
- package/src/types.ts +2 -1
- package/templates/skills/swarm-scripts/SKILL.md +4 -0
- package/templates/skills/swarm-scripts/content.md +4 -0
- package/dist/{cli-snz3p4yf.js → cli-06ghj6pe.js} +6 -6
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
resolveSlackUserId
|
|
3
|
-
} from "./cli-
|
|
4
|
-
import"./cli-
|
|
3
|
+
} from "./cli-y16cesaq.js";
|
|
4
|
+
import"./cli-spf767vc.js";
|
|
5
5
|
import {
|
|
6
6
|
createTaskWithSiblingAwareness
|
|
7
|
-
} from "./cli-
|
|
7
|
+
} from "./cli-gpdtxzar.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-d5ygfv18.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-tmn19cdz.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-j6fpcrdk.js";
|
|
35
34
|
import"./cli-mkq1rk7b.js";
|
|
35
|
+
import"./cli-4r4jkqep.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-d5ygfv18.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-tmn19cdz.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-j6fpcrdk.js";
|
|
18
17
|
import"./cli-mkq1rk7b.js";
|
|
18
|
+
import"./cli-4r4jkqep.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-35jknh9e.js";
|
|
6
6
|
import {
|
|
7
7
|
hasOtherUserMention
|
|
8
|
-
} from "./cli-
|
|
8
|
+
} from "./cli-84vrhesc.js";
|
|
9
9
|
import {
|
|
10
10
|
resolveSlackUserId,
|
|
11
11
|
rewriteSlackMentions
|
|
12
|
-
} from "./cli-
|
|
13
|
-
import"./cli-
|
|
12
|
+
} from "./cli-y16cesaq.js";
|
|
13
|
+
import"./cli-spf767vc.js";
|
|
14
14
|
import {
|
|
15
15
|
createTaskWithSiblingAwareness
|
|
16
|
-
} from "./cli-
|
|
16
|
+
} from "./cli-gpdtxzar.js";
|
|
17
17
|
import {
|
|
18
18
|
ackSlackMessage,
|
|
19
19
|
ensureSlackThreadTree,
|
|
20
20
|
isSlackRenderV2Enabled,
|
|
21
21
|
require_dist
|
|
22
|
-
} from "./cli-
|
|
22
|
+
} from "./cli-d5ygfv18.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-tmn19cdz.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-j6fpcrdk.js";
|
|
47
46
|
import"./cli-mkq1rk7b.js";
|
|
47
|
+
import"./cli-4r4jkqep.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";
|
|
@@ -3,21 +3,21 @@ import {
|
|
|
3
3
|
getEmbeddingProvider,
|
|
4
4
|
getMemoryStore,
|
|
5
5
|
init_constants
|
|
6
|
-
} from "./cli-
|
|
6
|
+
} from "./cli-hz5hp6wn.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-tmn19cdz.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-j6fpcrdk.js";
|
|
20
19
|
import"./cli-mkq1rk7b.js";
|
|
20
|
+
import"./cli-4r4jkqep.js";
|
|
21
21
|
import"./cli-pqv5gvyf.js";
|
|
22
22
|
import"./cli-pq2ee5ja.js";
|
|
23
23
|
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import {
|
|
2
2
|
embedScript,
|
|
3
3
|
embeddingProvider
|
|
4
|
-
} from "./cli-
|
|
5
|
-
import"./cli-
|
|
4
|
+
} from "./cli-qckgdqmr.js";
|
|
5
|
+
import"./cli-hz5hp6wn.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-tmn19cdz.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-j6fpcrdk.js";
|
|
19
18
|
import"./cli-mkq1rk7b.js";
|
|
19
|
+
import"./cli-4r4jkqep.js";
|
|
20
20
|
import"./cli-pqv5gvyf.js";
|
|
21
21
|
import"./cli-pq2ee5ja.js";
|
|
22
22
|
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getDbClient,
|
|
3
3
|
init_db
|
|
4
|
-
} from "./cli-
|
|
4
|
+
} from "./cli-tmn19cdz.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-j6fpcrdk.js";
|
|
12
11
|
import {
|
|
13
12
|
init_secret_scrubber,
|
|
14
13
|
scrubSecrets
|
|
15
14
|
} from "./cli-mkq1rk7b.js";
|
|
15
|
+
import"./cli-4r4jkqep.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-edwrx42s.js";
|
|
16
|
+
import"./cli-6gwgzdgw.js";
|
|
17
17
|
import"./cli-a3pkfpqs.js";
|
|
18
|
+
import"./cli-qhfkxrpg.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-j6fpcrdk.js";
|
|
39
38
|
import"./cli-mkq1rk7b.js";
|
|
39
|
+
import"./cli-4r4jkqep.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,
|