@eddyskywalker/dsh-chatgpt-subscription 0.79.0 → 0.80.1
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/CHANGELOG.md +26 -0
- package/lib/client.js.map +1 -1
- package/lib/index.js +238 -74
- package/lib/types/compat.d.ts +1 -1
- package/lib/types/host/antigravity-acp/catalog.d.ts +3 -0
- package/lib/types/host/antigravity-acp/catalog.d.ts.map +1 -1
- package/lib/types/host/antigravity-acp/settings.d.ts.map +1 -1
- package/lib/types/host/claude/adapter.d.ts.map +1 -1
- package/lib/types/host/claude/client.d.ts +4 -4
- package/lib/types/host/claude/client.d.ts.map +1 -1
- package/lib/types/host/claude/mapper.d.ts.map +1 -1
- package/lib/types/host/claude/model-catalog.d.ts +10 -5
- package/lib/types/host/claude/model-catalog.d.ts.map +1 -1
- package/lib/types/host/common/gpt-engineering-guidance.d.ts +16 -0
- package/lib/types/host/common/gpt-engineering-guidance.d.ts.map +1 -0
- package/lib/types/host/common/request-images.d.ts +3 -1
- package/lib/types/host/common/request-images.d.ts.map +1 -1
- package/lib/types/host/relayone/mapper-anthropic.d.ts +1 -1
- package/lib/types/host/relayone/mapper-anthropic.d.ts.map +1 -1
- package/lib/types/host/relayone/mapper-openai.d.ts.map +1 -1
- package/lib/types/host/relayone/mapper-shared.d.ts +1 -0
- package/lib/types/host/relayone/mapper-shared.d.ts.map +1 -1
- package/lib/types/host/relayone/model-catalog.d.ts +11 -0
- package/lib/types/host/relayone/model-catalog.d.ts.map +1 -1
- package/lib/types/host/responses-client.d.ts.map +1 -1
- package/lib/types/host/responses-mapper.d.ts +1 -0
- package/lib/types/host/responses-mapper.d.ts.map +1 -1
- package/package.json +1 -1
package/lib/index.js
CHANGED
|
@@ -832,7 +832,7 @@ const ROUTE_PREFIX$5 = "/api/dsh-chatgpt-subscription";
|
|
|
832
832
|
* `test/responses-client.test.ts` asserts the two agree, so a release that
|
|
833
833
|
* forgets this constant fails the suite instead of shipping quietly.
|
|
834
834
|
*/
|
|
835
|
-
const PLUGIN_VERSION = "0.
|
|
835
|
+
const PLUGIN_VERSION = "0.80.1";
|
|
836
836
|
const CODEX_CHATGPT_PROVIDER_ID = "codex-chatgpt";
|
|
837
837
|
const CODEX_API_BASE = "https://chatgpt.com/backend-api/codex";
|
|
838
838
|
const CODEX_RESPONSES_URL = `${CODEX_API_BASE}/responses`;
|
|
@@ -9569,6 +9569,19 @@ const toToolCallId = (id) => {
|
|
|
9569
9569
|
return (mod.ToolCallId ?? mod.CallId ?? ((x) => x))(id);
|
|
9570
9570
|
};
|
|
9571
9571
|
//#endregion
|
|
9572
|
+
//#region src/host/common/gpt-engineering-guidance.ts
|
|
9573
|
+
/** The shared guidance for a request that can actually use tools. */
|
|
9574
|
+
function gptEngineeringGuidance(tools) {
|
|
9575
|
+
if (!tools?.length) return void 0;
|
|
9576
|
+
return "Engineering execution rule for coding tasks: make the smallest COMPLETE change that addresses the root cause. Before editing, inspect the affected call sites, shared interfaces, and existing implementations; do not stop at a surface symptom, duplicate existing logic merely to reduce the diff, or perform unrelated refactors. Verify proportionally: start with the most focused relevant tests or checks. When neither code nor configuration has changed, do not rerun an equivalent check that already passed. Broaden to full suites, typechecks, or builds for shared contracts, build/release work, or other risk-relevant changes. If repeated actions produce no new evidence, substantive artifact change, or newly verified criterion, change approach or report the blocker instead of repeating the ritual.\n\nProgress communication rule: during multi-step tasks, output 1-2 concise, factual sentences at meaningful stage transitions, verified findings, blockers, or before a long wait. Do not narrate every tool call or repeat an unchanged status. Keep the comprehensive final answer and summary for the final delivery after the work is complete.";
|
|
9577
|
+
}
|
|
9578
|
+
/** Append shared guidance without inventing a leading separator for an empty base. */
|
|
9579
|
+
function appendGptEngineeringGuidance(base, tools) {
|
|
9580
|
+
const guidance = gptEngineeringGuidance(tools);
|
|
9581
|
+
if (guidance === void 0) return base;
|
|
9582
|
+
return base === "" ? guidance : base + "\n\n" + guidance;
|
|
9583
|
+
}
|
|
9584
|
+
//#endregion
|
|
9572
9585
|
//#region src/host/responses-mapper.ts
|
|
9573
9586
|
/**
|
|
9574
9587
|
* Base64 image payload one Codex request may carry.
|
|
@@ -9700,7 +9713,7 @@ async function buildResponsesPayload(options, attachments, localRawImages = {},
|
|
|
9700
9713
|
const instructionParts = [
|
|
9701
9714
|
options.system?.trim(),
|
|
9702
9715
|
latestSystemPrompt(options.messages),
|
|
9703
|
-
|
|
9716
|
+
gptEngineeringGuidance(options.tools),
|
|
9704
9717
|
commandToolInstruction(options.tools),
|
|
9705
9718
|
runCodeInstruction(options.tools)
|
|
9706
9719
|
].filter((value) => Boolean(value));
|
|
@@ -9927,6 +9940,7 @@ function toolRemovalNotice(names) {
|
|
|
9927
9940
|
const list = names.map((name) => `"${name}"`).join(", ");
|
|
9928
9941
|
return names.length === 1 ? `[The tool ${list} is no longer available. Do not call it again: any call will fail.]` : `[The tools ${list} are no longer available. Do not call them again: any call will fail.]`;
|
|
9929
9942
|
}
|
|
9943
|
+
const CODEX_BASE_INSTRUCTIONS_KIND = "model.base_instructions";
|
|
9930
9944
|
/**
|
|
9931
9945
|
* The base instructions as a developer message.
|
|
9932
9946
|
*
|
|
@@ -9945,7 +9959,7 @@ function developerMessageItem(text, idNamespace, useResponsesLite) {
|
|
|
9945
9959
|
text
|
|
9946
9960
|
}],
|
|
9947
9961
|
internal_chat_message_metadata_passthrough: {
|
|
9948
|
-
content_item_kinds: [
|
|
9962
|
+
content_item_kinds: [CODEX_BASE_INSTRUCTIONS_KIND],
|
|
9949
9963
|
...useResponsesLite ? { content_item_metadata: [{ provenance: {
|
|
9950
9964
|
type: "harness",
|
|
9951
9965
|
hook: false
|
|
@@ -10024,10 +10038,6 @@ function formatUuid(bytes) {
|
|
|
10024
10038
|
const hex = bytes.toString("hex");
|
|
10025
10039
|
return `${hex.slice(0, 8)}-${hex.slice(8, 12)}-${hex.slice(12, 16)}-${hex.slice(16, 20)}-${hex.slice(20)}`;
|
|
10026
10040
|
}
|
|
10027
|
-
function progressExplanationInstruction(tools) {
|
|
10028
|
-
if (!tools?.length) return void 0;
|
|
10029
|
-
return "Progress and tool execution rule: when executing multi-step tasks or invoking tools, output 1-2 concise sentences of progress, intent, or intermediate findings before each tool call. Keep progress text brief, professional, and factual. Only present the comprehensive final answer and summary in the final turn after all tool operations are completed.";
|
|
10030
|
-
}
|
|
10031
10041
|
function runCodeInstruction(tools) {
|
|
10032
10042
|
if (!tools?.some((tool) => tool.name === "run_code")) return void 0;
|
|
10033
10043
|
return "run_code compatibility rule: its code is parsed as strict JavaScript/TypeScript before execution. Shell commands are nested string data: JavaScript template literals may consume ${...}, backticks, backslashes, and escape sequences before PowerShell, Bash, or POSIX sh sees them. On Windows, avoid embedding PowerShell containing $, ${...}, backslashes, or here-strings in template literals; String.raw does not disable ${...} interpolation. On Linux, prefer ordinary quoted strings or write a script file before invoking bash/sh, especially for commands containing backticks or ${...}. Prefer arrays of ordinary quoted strings joined with \"\\n\", escaping backslashes, or use a file-write tool for large scripts.";
|
|
@@ -10636,9 +10646,22 @@ const REASONING_TRUNCATED_NOTICE = "\n\n[Reasoning summary truncated to keep the
|
|
|
10636
10646
|
const MAX_TRACKED_TURN_STATES = 200;
|
|
10637
10647
|
const codexPrefixRequests = new PrefixRequestCoordinator();
|
|
10638
10648
|
function codexColdGroupKey(payload, credentials) {
|
|
10639
|
-
const
|
|
10640
|
-
|
|
10641
|
-
const
|
|
10649
|
+
const input = Array.isArray(payload.input) ? payload.input : [];
|
|
10650
|
+
const head = record$4(input[0]);
|
|
10651
|
+
const liteTools = head?.type === "additional_tools" ? head.tools : void 0;
|
|
10652
|
+
const instructions = liteTools === void 0 ? head : record$4(input[1]);
|
|
10653
|
+
const kinds = record$4(instructions?.internal_chat_message_metadata_passthrough)?.content_item_kinds;
|
|
10654
|
+
if (instructions?.role !== "developer" || !Array.isArray(kinds) || !kinds.includes("model.base_instructions")) return void 0;
|
|
10655
|
+
const digest = createHash("sha256").update(JSON.stringify([
|
|
10656
|
+
instructions.content,
|
|
10657
|
+
liteTools,
|
|
10658
|
+
payload.tools,
|
|
10659
|
+
payload.tool_choice,
|
|
10660
|
+
payload.parallel_tool_calls,
|
|
10661
|
+
payload.reasoning,
|
|
10662
|
+
payload.text,
|
|
10663
|
+
payload.service_tier
|
|
10664
|
+
])).digest("hex");
|
|
10642
10665
|
return `${String(payload.model ?? "")}:${digest}:${authOwnerKey(credentials)}`;
|
|
10643
10666
|
}
|
|
10644
10667
|
var ResponsesClient = class {
|
|
@@ -24334,6 +24357,7 @@ const MAX_VIDEO_MESSAGE_BODY_BYTES = 64 * 1024 * 1024;
|
|
|
24334
24357
|
*/
|
|
24335
24358
|
const MAX_REQUEST_VIDEO_BYTES$1 = 48 * 1024 * 1024;
|
|
24336
24359
|
const OMITTED_IMAGE_TEXT$1 = "[image omitted to keep the request within its size limit; older images are omitted first. If this image is still needed, read its file again when a path is available; otherwise ask the user to attach it again.]";
|
|
24360
|
+
const STICKY_OMITTED_IMAGE_TEXT = "[image omitted to keep the request within its size limit. The same image will stay omitted in this conversation. If it is needed, use a smaller or cropped copy.]";
|
|
24337
24361
|
/** Media types both upstream wires accept as inline base64. */
|
|
24338
24362
|
const SUPPORTED_IMAGE_MEDIA_TYPES$3 = /* @__PURE__ */ new Set([
|
|
24339
24363
|
"image/png",
|
|
@@ -24604,7 +24628,7 @@ function requestImageKey(block, images) {
|
|
|
24604
24628
|
* included: a screenshot inside a tool result reaches the wire, so an
|
|
24605
24629
|
* occurrence the budget cannot see is an occurrence it cannot budget for.
|
|
24606
24630
|
*/
|
|
24607
|
-
function collectImageOccurrences(options, images) {
|
|
24631
|
+
function collectImageOccurrences(options, images, maxImageBytes = Number.POSITIVE_INFINITY) {
|
|
24608
24632
|
const occurrences = [];
|
|
24609
24633
|
const walk = (content) => {
|
|
24610
24634
|
if (!Array.isArray(content)) return;
|
|
@@ -24612,8 +24636,9 @@ function collectImageOccurrences(options, images) {
|
|
|
24612
24636
|
if (!isRecord$63(block)) continue;
|
|
24613
24637
|
if (block.type === "image") {
|
|
24614
24638
|
const bytes = requestImagePayloadLength(block, images);
|
|
24639
|
+
if (bytes === void 0 || bytes > maxImageBytes) continue;
|
|
24615
24640
|
const key = requestImageKey(block, images);
|
|
24616
|
-
if (
|
|
24641
|
+
if (key !== void 0) occurrences.push({
|
|
24617
24642
|
key,
|
|
24618
24643
|
bytes
|
|
24619
24644
|
});
|
|
@@ -24687,7 +24712,7 @@ function replaceDroppedRequestImages(options, droppedKeys, images) {
|
|
|
24687
24712
|
count += 1;
|
|
24688
24713
|
return {
|
|
24689
24714
|
type: "text",
|
|
24690
|
-
text:
|
|
24715
|
+
text: STICKY_OMITTED_IMAGE_TEXT
|
|
24691
24716
|
};
|
|
24692
24717
|
}
|
|
24693
24718
|
if (block.type === "tool-result" && Array.isArray(block.content)) {
|
|
@@ -24749,11 +24774,13 @@ function replaceDroppedRequestImages(options, droppedKeys, images) {
|
|
|
24749
24774
|
* @param inlineExcludedKeys - identities whose actual wire form is a hosted
|
|
24750
24775
|
* reference rather than inline bytes. They stay in request order with a zero
|
|
24751
24776
|
* byte weight; only genuinely inline images consume this budget.
|
|
24777
|
+
* @param maxImageBytes - per-image limit when the mapper independently replaces
|
|
24778
|
+
* larger images with placeholders. Those images do not consume the total budget.
|
|
24752
24779
|
*/
|
|
24753
|
-
function offloadRequestImagesWithStickyBudget(options, maxBytes = MAX_REQUEST_IMAGE_BYTES$1, lowBytes = Math.max(1, Math.floor(maxBytes / 2)), images, priorDroppedKeys, inlineExcludedKeys) {
|
|
24780
|
+
function offloadRequestImagesWithStickyBudget(options, maxBytes = MAX_REQUEST_IMAGE_BYTES$1, lowBytes = Math.max(1, Math.floor(maxBytes / 2)), images, priorDroppedKeys, inlineExcludedKeys, maxImageBytes = Number.POSITIVE_INFINITY) {
|
|
24754
24781
|
const allDroppedKeys = new Set(priorDroppedKeys ?? []);
|
|
24755
24782
|
const pending = /* @__PURE__ */ new Map();
|
|
24756
|
-
for (const occurrence of collectImageOccurrences(options, images)) {
|
|
24783
|
+
for (const occurrence of collectImageOccurrences(options, images, maxImageBytes)) {
|
|
24757
24784
|
if (allDroppedKeys.has(occurrence.key)) continue;
|
|
24758
24785
|
const bytes = inlineExcludedKeys?.has(occurrence.key) ? 0 : occurrence.bytes;
|
|
24759
24786
|
pending.set(occurrence.key, (pending.get(occurrence.key) ?? 0) + bytes);
|
|
@@ -27484,7 +27511,7 @@ function parseAntigravityAcpSettings(value) {
|
|
|
27484
27511
|
const record = value;
|
|
27485
27512
|
const enabledModelIds = record.enabledModelIds === null ? null : Array.isArray(record.enabledModelIds) ? record.enabledModelIds.filter((id) => typeof id === "string") : defaults.enabledModelIds;
|
|
27486
27513
|
return {
|
|
27487
|
-
enabled: typeof record.enabled === "boolean" ? record.enabled : false,
|
|
27514
|
+
enabled: typeof record.enabled === "boolean" ? record.enabled : record.enabled === void 0 ? defaults.enabled : false,
|
|
27488
27515
|
enabledModelIds,
|
|
27489
27516
|
defaultReasoningEffort: typeof record.defaultReasoningEffort === "string" ? record.defaultReasoningEffort : null,
|
|
27490
27517
|
permissionPolicy: record.permissionPolicy === "reject" ? "reject" : "allow",
|
|
@@ -27564,6 +27591,7 @@ var AcpCatalog = class {
|
|
|
27564
27591
|
scope;
|
|
27565
27592
|
now;
|
|
27566
27593
|
cached;
|
|
27594
|
+
failedAt;
|
|
27567
27595
|
inflight;
|
|
27568
27596
|
snapshotName;
|
|
27569
27597
|
/**
|
|
@@ -27599,9 +27627,15 @@ var AcpCatalog = class {
|
|
|
27599
27627
|
*/
|
|
27600
27628
|
async read(options = {}) {
|
|
27601
27629
|
const current = this.cached ?? await this.rehydrate();
|
|
27602
|
-
if (!options.force
|
|
27630
|
+
if (!options.force) {
|
|
27631
|
+
if (current !== void 0 && this.now() - current.fetchedAt < 9e5) return current;
|
|
27632
|
+
if (this.failedAt !== void 0 && this.now() - this.failedAt < 3e5) return current;
|
|
27633
|
+
}
|
|
27603
27634
|
if (this.inflight !== void 0) return this.inflight;
|
|
27604
|
-
this.inflight = this.refresh(options.signal).catch(() =>
|
|
27635
|
+
this.inflight = this.refresh(options.signal).catch(() => {
|
|
27636
|
+
this.failedAt = this.now();
|
|
27637
|
+
return current;
|
|
27638
|
+
}).finally(() => {
|
|
27605
27639
|
this.inflight = void 0;
|
|
27606
27640
|
});
|
|
27607
27641
|
return this.inflight;
|
|
@@ -27609,6 +27643,7 @@ var AcpCatalog = class {
|
|
|
27609
27643
|
/** Discard the in-memory listing; the next read rehydrates from disk. */
|
|
27610
27644
|
invalidate() {
|
|
27611
27645
|
this.cached = void 0;
|
|
27646
|
+
this.failedAt = void 0;
|
|
27612
27647
|
}
|
|
27613
27648
|
async refresh(signal) {
|
|
27614
27649
|
const launch = await this.resolveLaunch();
|
|
@@ -27622,6 +27657,7 @@ var AcpCatalog = class {
|
|
|
27622
27657
|
fetchedAt: this.now()
|
|
27623
27658
|
};
|
|
27624
27659
|
this.cached = read;
|
|
27660
|
+
this.failedAt = void 0;
|
|
27625
27661
|
await writeCatalogSnapshot(this.snapshotName, read.models, read.fetchedAt).catch(() => void 0);
|
|
27626
27662
|
return read;
|
|
27627
27663
|
} finally {
|
|
@@ -27642,7 +27678,7 @@ var AcpCatalog = class {
|
|
|
27642
27678
|
* @returns Collapsed models and the tier the server reported.
|
|
27643
27679
|
*/
|
|
27644
27680
|
async function readCatalogFrom(client, signal) {
|
|
27645
|
-
|
|
27681
|
+
await client.request("initialize", {
|
|
27646
27682
|
protocolVersion: 1,
|
|
27647
27683
|
clientCapabilities: {
|
|
27648
27684
|
fs: {
|
|
@@ -27655,25 +27691,12 @@ async function readCatalogFrom(client, signal) {
|
|
|
27655
27691
|
name: "dsh-chatgpt-subscription",
|
|
27656
27692
|
version: "1.0.0"
|
|
27657
27693
|
}
|
|
27694
|
+
}, signal);
|
|
27695
|
+
const session = asRecord$18(await client.request("session/new", {
|
|
27696
|
+
cwd: process.cwd(),
|
|
27697
|
+
mcpServers: []
|
|
27658
27698
|
}, signal));
|
|
27659
|
-
|
|
27660
|
-
const create = async () => {
|
|
27661
|
-
const value = asRecord$18(await client.request("session/new", {
|
|
27662
|
-
cwd: process.cwd(),
|
|
27663
|
-
mcpServers: []
|
|
27664
|
-
}, signal));
|
|
27665
|
-
if (value === void 0) throw new Error("Antigravity ACP did not return a session.");
|
|
27666
|
-
return value;
|
|
27667
|
-
};
|
|
27668
|
-
let session;
|
|
27669
|
-
try {
|
|
27670
|
-
session = await create();
|
|
27671
|
-
} catch (error) {
|
|
27672
|
-
const message = error instanceof Error ? error.message : String(error);
|
|
27673
|
-
if (!/authentication required/i.test(message) || authMethods.length === 0) throw error;
|
|
27674
|
-
await client.request("authenticate", { methodId: preferAuthMethod(authMethods) }, signal);
|
|
27675
|
-
session = await create();
|
|
27676
|
-
}
|
|
27699
|
+
if (session === void 0) throw new Error("Antigravity ACP did not return a session.");
|
|
27677
27700
|
const availableModels = readAvailableModels(asRecord$18(session.models)?.availableModels ?? session.availableModels);
|
|
27678
27701
|
const models = collapseModels(readOptionValues((Array.isArray(session.configOptions) ? session.configOptions : []).find((entry) => typeof entry === "object" && entry !== null && entry.id === "model")), availableModels);
|
|
27679
27702
|
const tier = readTier$1(session._meta);
|
|
@@ -52713,8 +52736,8 @@ function loopbackRedirectUri(port = DEFAULT_CALLBACK_PORT) {
|
|
|
52713
52736
|
//#endregion
|
|
52714
52737
|
//#region src/host/claude/model-catalog.ts
|
|
52715
52738
|
/**
|
|
52716
|
-
*
|
|
52717
|
-
*
|
|
52739
|
+
* Eighteen rows: the snapshot's own seventeen, plus Fable 5.2 from official
|
|
52740
|
+
* catalog 5102 (see LOCAL ADDITIONS above).
|
|
52718
52741
|
*
|
|
52719
52742
|
* The order matters and is not cosmetic. The test asserts the snapshot's ids
|
|
52720
52743
|
* appear in the table as a SUBSEQUENCE, so a curated row may be appended or
|
|
@@ -52776,6 +52799,24 @@ const CLAUDE_MODELS = Object.freeze([
|
|
|
52776
52799
|
],
|
|
52777
52800
|
canDisableThinking: false
|
|
52778
52801
|
},
|
|
52802
|
+
{
|
|
52803
|
+
id: "claude-fable-5-2",
|
|
52804
|
+
name: "Claude Fable 5.2",
|
|
52805
|
+
contextWindow: 1e6,
|
|
52806
|
+
maxTokens: 128e3,
|
|
52807
|
+
supportsImage: true,
|
|
52808
|
+
supportsTemperature: false,
|
|
52809
|
+
thinkingMode: "adaptive",
|
|
52810
|
+
reasoningEfforts: [
|
|
52811
|
+
"low",
|
|
52812
|
+
"medium",
|
|
52813
|
+
"high",
|
|
52814
|
+
"xhigh",
|
|
52815
|
+
"max"
|
|
52816
|
+
],
|
|
52817
|
+
canDisableThinking: false,
|
|
52818
|
+
bindsThinkingToPrefix: true
|
|
52819
|
+
},
|
|
52779
52820
|
{
|
|
52780
52821
|
id: "claude-haiku-4-5",
|
|
52781
52822
|
name: "Claude Haiku 4.5 (latest)",
|
|
@@ -53151,8 +53192,8 @@ function resolveClaudeModel(modelId, catalog = CLAUDE_MODELS) {
|
|
|
53151
53192
|
* the conversation where the instruction starts to apply.
|
|
53152
53193
|
*
|
|
53153
53194
|
* TRANSCRIBED from the vendor's own "Mid-conversation system messages and tool
|
|
53154
|
-
* changes" page, whose supported-model list names exactly these
|
|
53155
|
-
* Claude Fable 5.1, Claude Mythos 5.1, Claude Fable 5, Claude Mythos 5, Claude
|
|
53195
|
+
* changes" page, whose supported-model list names exactly these eleven models:
|
|
53196
|
+
* Claude Fable 5.2, Claude Fable 5.1, Claude Mythos 5.1, Claude Fable 5, Claude Mythos 5, Claude
|
|
53156
53197
|
* Mythos Preview, Claude Opus 5.5, Claude Opus 4.8, Claude Opus 5, Claude Sonnet
|
|
53157
53198
|
* 5.5 and Claude Haiku 5.5. No beta header is required for the feature.
|
|
53158
53199
|
*
|
|
@@ -53169,6 +53210,7 @@ function resolveClaudeModel(modelId, catalog = CLAUDE_MODELS) {
|
|
|
53169
53210
|
* as before.
|
|
53170
53211
|
*/
|
|
53171
53212
|
const CLAUDE_MID_CONVERSATION_SYSTEM_MESSAGE_MODEL_IDS = Object.freeze([
|
|
53213
|
+
"claude-fable-5-2",
|
|
53172
53214
|
"claude-fable-5-1",
|
|
53173
53215
|
"claude-mythos-5-1",
|
|
53174
53216
|
"claude-fable-5",
|
|
@@ -54215,10 +54257,10 @@ function mergeListingIntoCatalog(listing) {
|
|
|
54215
54257
|
* because the harness resolves EVERY model of EVERY provider when it builds the
|
|
54216
54258
|
* picker — without both, one picker build is one network round trip per model.
|
|
54217
54259
|
*
|
|
54218
|
-
* A failure is cached too, deliberately. The
|
|
54219
|
-
*
|
|
54220
|
-
*
|
|
54221
|
-
*
|
|
54260
|
+
* A failure is cached too, deliberately. The last successful live listing stays
|
|
54261
|
+
* in place when one exists; only a first failure uses the shipped table. NOT
|
|
54262
|
+
* caching the failure would put a dead endpoint behind fourteen sequential
|
|
54263
|
+
* 20-second timeouts on every picker build.
|
|
54222
54264
|
* {@link clearCachedCatalog} is the escape hatch: the sign-in path calls it so a
|
|
54223
54265
|
* user who just authenticated does not sit behind a failure recorded before
|
|
54224
54266
|
* they did.
|
|
@@ -54246,6 +54288,7 @@ function loadCatalog(credentials, options = {}) {
|
|
|
54246
54288
|
}
|
|
54247
54289
|
async function performCatalogLoad(credentials, options) {
|
|
54248
54290
|
const key = accountKeyFor(credentials);
|
|
54291
|
+
const previous = catalogCache;
|
|
54249
54292
|
const fetchFn = options.fetchFn ?? fetch;
|
|
54250
54293
|
let models;
|
|
54251
54294
|
let live = false;
|
|
@@ -54266,7 +54309,9 @@ async function performCatalogLoad(credentials, options) {
|
|
|
54266
54309
|
models = merged;
|
|
54267
54310
|
live = true;
|
|
54268
54311
|
} catch {
|
|
54269
|
-
|
|
54312
|
+
const lastLive = previous?.key === key && previous.live ? previous.models : void 0;
|
|
54313
|
+
models = lastLive ?? FALLBACK_MODELS;
|
|
54314
|
+
live = lastLive !== void 0;
|
|
54270
54315
|
}
|
|
54271
54316
|
catalogCache = {
|
|
54272
54317
|
at: now(),
|
|
@@ -55526,6 +55571,26 @@ const NO_RESOLVED_IMAGES$1 = /* @__PURE__ */ new Map();
|
|
|
55526
55571
|
* still catching the runaway case locally rather than as a 413.
|
|
55527
55572
|
*/
|
|
55528
55573
|
const MAX_REQUEST_IMAGE_BYTES = 8 * 1024 * 1024;
|
|
55574
|
+
/**
|
|
55575
|
+
* Base64 image payload ONE image may carry.
|
|
55576
|
+
*
|
|
55577
|
+
* A SEPARATE budget from {@link MAX_REQUEST_IMAGE_BYTES}, and enforced by a
|
|
55578
|
+
* separate pass. The two answer different questions: the per-image ceiling
|
|
55579
|
+
* asks whether THIS picture is acceptable to the endpoint, while the
|
|
55580
|
+
* per-request ceiling asks whether the conversation is still a reasonable
|
|
55581
|
+
* size. A single budget cannot answer both — one image can be over the
|
|
55582
|
+
* per-image ceiling while the request as a whole is small, and that request
|
|
55583
|
+
* is refused by the endpoint however small it is.
|
|
55584
|
+
*
|
|
55585
|
+
* 5 MB of base64 is the per-image figure the vendor publishes for the
|
|
55586
|
+
* narrower platforms, and it is the figure this line already targeted
|
|
55587
|
+
* indirectly: the request-version byte target below
|
|
55588
|
+
* ({@link REQUEST_IMAGE_VERSION_MAX_BYTES}) produces a payload of about
|
|
55589
|
+
* 4.7 MB of base64, which is under it. What was missing was the check
|
|
55590
|
+
* itself — an image that fitted the edge limit but not the byte limit was
|
|
55591
|
+
* sent as stored.
|
|
55592
|
+
*/
|
|
55593
|
+
const MAX_SINGLE_REQUEST_IMAGE_BYTES = 5 * 1024 * 1024;
|
|
55529
55594
|
const OMITTED_IMAGE_TEXT = "[image omitted to keep the request within its size limit; older images are omitted first. If this image is still needed, read its file again when a path is available; otherwise ask the user to attach it again.]";
|
|
55530
55595
|
/** Media types this wire accepts as inline base64. Transcribed from the API docs. */
|
|
55531
55596
|
const SUPPORTED_IMAGE_MEDIA_TYPES$1 = /* @__PURE__ */ new Set([
|
|
@@ -56162,7 +56227,7 @@ function markClaudeCacheBreakpoints(body, ttl = "5m") {
|
|
|
56162
56227
|
}
|
|
56163
56228
|
const tools = body.tools;
|
|
56164
56229
|
if (Array.isArray(tools) && tools.length > 0) {
|
|
56165
|
-
const last =
|
|
56230
|
+
const last = [...tools].reverse().find((entry) => isRecord$45(entry) && entry["defer_loading"] !== true);
|
|
56166
56231
|
if (last !== void 0) {
|
|
56167
56232
|
last.cache_control = { ...marker };
|
|
56168
56233
|
marked += 1;
|
|
@@ -58359,7 +58424,7 @@ function assertClaudeCliVersionMeetsFloor(modelId, catalog = FALLBACK_MODELS) {
|
|
|
58359
58424
|
throw new LlmError$1("Claude(订阅) will not serve " + modelId + " to a client reporting version " + effective + ": upstream requires " + floor + " or newer for this model, and a lower claim is refused with claude_code_version_too_old. This was caught locally, before the request was sent. Raise the reported version with the DSH_CLAUDE_CLI_VERSION environment variable, or with a setClaudeCliVersion pin, then retry. The stored sign-in is still valid — this is not a credential problem and signing in again will not change it.", "PROVIDER_ERROR");
|
|
58360
58425
|
}
|
|
58361
58426
|
const claudePrefixRequests = new PrefixRequestCoordinator();
|
|
58362
|
-
const claudeStickyImages = new StickyImageBudgetStore(
|
|
58427
|
+
const claudeStickyImages = new StickyImageBudgetStore(`claude-${MAX_REQUEST_IMAGE_BYTES}-${MAX_SINGLE_REQUEST_IMAGE_BYTES}`);
|
|
58363
58428
|
/**
|
|
58364
58429
|
* The immutable id of the account a token came from, presented as the two-method
|
|
58365
58430
|
* store oauth.ts wants. See module note 3.
|
|
@@ -58638,7 +58703,7 @@ var ClaudeAdapter = class ClaudeAdapter extends LlmAdapter {
|
|
|
58638
58703
|
const normalized = withStaticPrefixOrdering("claude", normalizeGenerateOptions(options), this.options.promptCache);
|
|
58639
58704
|
const images = await resolveRequestImages(normalized, this.options.attachments, signal);
|
|
58640
58705
|
const stickyImages = new Map([...images].map(([id, image]) => [id, image.kind === "oversized" ? { kind: "unavailable" } : image]));
|
|
58641
|
-
const sticky = promptCachePolicyOf("claude", this.options.promptCache).stickyImages ? offloadRequestImagesWithStickyBudget(normalized, MAX_REQUEST_IMAGE_BYTES
|
|
58706
|
+
const sticky = promptCachePolicyOf("claude", this.options.promptCache).stickyImages ? offloadRequestImagesWithStickyBudget(normalized, MAX_REQUEST_IMAGE_BYTES, MAX_SINGLE_REQUEST_IMAGE_BYTES, stickyImages, claudeStickyImages.priorDroppedKeys(normalized.sessionId), void 0, MAX_SINGLE_REQUEST_IMAGE_BYTES) : void 0;
|
|
58642
58707
|
const requestOptions = sticky?.options ?? offloadOldestRequestImages(normalized, images);
|
|
58643
58708
|
if (sticky !== void 0 && sticky.newlyDroppedKeys.length > 0) claudeStickyImages.record(normalized.sessionId, sticky.allDroppedKeys);
|
|
58644
58709
|
const toolNames = claudeToolNames(requestOptions.tools);
|
|
@@ -107593,7 +107658,46 @@ const DEFAULT_REASONING = [
|
|
|
107593
107658
|
"medium",
|
|
107594
107659
|
"high"
|
|
107595
107660
|
];
|
|
107596
|
-
|
|
107661
|
+
const ADAPTIVE_REASONING = [
|
|
107662
|
+
...DEFAULT_REASONING,
|
|
107663
|
+
"xhigh",
|
|
107664
|
+
"max"
|
|
107665
|
+
];
|
|
107666
|
+
const DISABLEABLE_ADAPTIVE_REASONING = ["none", ...ADAPTIVE_REASONING];
|
|
107667
|
+
/**
|
|
107668
|
+
* Public Messages capabilities, not the Claude Code subscription's OAuth/betas.
|
|
107669
|
+
* https://platform.claude.com/docs/en/build-with-claude/thinking#when-thinking-turns-on
|
|
107670
|
+
* https://platform.claude.com/docs/en/build-with-claude/effort#effort-levels
|
|
107671
|
+
*/
|
|
107672
|
+
function relayOneClaudeAdaptiveThinking(id) {
|
|
107673
|
+
const model = id.toLowerCase().replace(/-\d{8}$/, "");
|
|
107674
|
+
if (/^claude-(?:opus|sonnet)-4-6$/.test(model)) return {
|
|
107675
|
+
efforts: [...DEFAULT_REASONING, "max"],
|
|
107676
|
+
enabledByDefault: false,
|
|
107677
|
+
allowsTemperatureWhenOff: true
|
|
107678
|
+
};
|
|
107679
|
+
if (/^claude-opus-4-[78]$/.test(model)) return {
|
|
107680
|
+
efforts: ADAPTIVE_REASONING,
|
|
107681
|
+
enabledByDefault: false,
|
|
107682
|
+
allowsTemperatureWhenOff: false
|
|
107683
|
+
};
|
|
107684
|
+
if (/^claude-(?:(?:opus|sonnet)-5|haiku-5-5)$/.test(model)) return {
|
|
107685
|
+
efforts: DISABLEABLE_ADAPTIVE_REASONING,
|
|
107686
|
+
enabledByDefault: true,
|
|
107687
|
+
allowsTemperatureWhenOff: false
|
|
107688
|
+
};
|
|
107689
|
+
if (/^claude-(?:(?:opus|sonnet)-5-5|(?:fable|mythos)-5(?:-[12])?)$/.test(model)) return {
|
|
107690
|
+
efforts: ADAPTIVE_REASONING,
|
|
107691
|
+
enabledByDefault: true,
|
|
107692
|
+
allowsTemperatureWhenOff: false
|
|
107693
|
+
};
|
|
107694
|
+
if (model === "claude-mythos-preview") return {
|
|
107695
|
+
efforts: [...DEFAULT_REASONING, "max"],
|
|
107696
|
+
enabledByDefault: true,
|
|
107697
|
+
allowsTemperatureWhenOff: false
|
|
107698
|
+
};
|
|
107699
|
+
}
|
|
107700
|
+
function modelFacts(id, protocol) {
|
|
107597
107701
|
const normalized = id.toLowerCase();
|
|
107598
107702
|
if (/^(gpt-|o[134](?:-|$)|codex)/.test(normalized)) return {
|
|
107599
107703
|
contextWindow: 272e3,
|
|
@@ -107605,7 +107709,7 @@ function modelFacts(id) {
|
|
|
107605
107709
|
contextWindow: 2e5,
|
|
107606
107710
|
maxOutputTokens: 32768,
|
|
107607
107711
|
supportsImages: true,
|
|
107608
|
-
reasoningEfforts: DEFAULT_REASONING
|
|
107712
|
+
reasoningEfforts: (protocol === "anthropic" ? relayOneClaudeAdaptiveThinking(normalized) : void 0)?.efforts ?? DEFAULT_REASONING
|
|
107609
107713
|
};
|
|
107610
107714
|
if (normalized.includes("gemini") || normalized.includes("banana")) return {
|
|
107611
107715
|
contextWindow: 1e6,
|
|
@@ -107673,7 +107777,7 @@ function mergeRelayOneCatalog(listingPayload, pricingPayload) {
|
|
|
107673
107777
|
vendor,
|
|
107674
107778
|
description: row?.description ?? null,
|
|
107675
107779
|
parameterSchema: row?.parameterSchema ?? null,
|
|
107676
|
-
...modelFacts(model.id)
|
|
107780
|
+
...modelFacts(model.id, protocol)
|
|
107677
107781
|
}];
|
|
107678
107782
|
});
|
|
107679
107783
|
}
|
|
@@ -107775,7 +107879,7 @@ function parsePersistedRelayOneModelEntries(value) {
|
|
|
107775
107879
|
protocol,
|
|
107776
107880
|
vendor: text(raw.vendor),
|
|
107777
107881
|
description: text(raw.description),
|
|
107778
|
-
...modelFacts(id),
|
|
107882
|
+
...modelFacts(id, protocol),
|
|
107779
107883
|
parameterSchema: isRecord$1(raw.parameterSchema) ? structuredClone(raw.parameterSchema) : null
|
|
107780
107884
|
};
|
|
107781
107885
|
result.push(entry);
|
|
@@ -108189,11 +108293,14 @@ function relayOneTextOf(content) {
|
|
|
108189
108293
|
function relayOneToolResult(message) {
|
|
108190
108294
|
return message.content.find((block) => block.type === "tool-result");
|
|
108191
108295
|
}
|
|
108296
|
+
function relayOneInstructionText(message) {
|
|
108297
|
+
return relayOneTextOf(message.content.filter((block) => block.type !== "tool-addition" && block.type !== "tool-removal")).trim();
|
|
108298
|
+
}
|
|
108192
108299
|
function relayOneSystemText(options) {
|
|
108193
108300
|
const parts = [typeof options.system === "string" ? options.system.trim() : ""];
|
|
108194
108301
|
for (const message of options.messages) {
|
|
108195
108302
|
if (message.role !== "system" && message.role !== "developer") continue;
|
|
108196
|
-
const text =
|
|
108303
|
+
const text = relayOneInstructionText(message);
|
|
108197
108304
|
if (text !== "") parts.push(text);
|
|
108198
108305
|
}
|
|
108199
108306
|
return parts.filter(Boolean).join("\n\n");
|
|
@@ -108232,6 +108339,39 @@ function relayOneEffort(options, configured, supported) {
|
|
|
108232
108339
|
}
|
|
108233
108340
|
//#endregion
|
|
108234
108341
|
//#region src/host/relayone/mapper-openai.ts
|
|
108342
|
+
function relayOneGptGuidance(base, options, entry) {
|
|
108343
|
+
if (!/^gpt-/i.test(entry.id) || !options.tools?.length) return base;
|
|
108344
|
+
return appendGptEngineeringGuidance(base, options.tools) + "\n\nAfter a batch of related tool results gives you a meaningful finding or completes a stage, send one short, user-visible assistant text update before the next batch of tool calls, then continue working in the same turn. Say what the results established, not just what you intend to do. Put the update in assistant text, not hidden reasoning or a tool argument. Skip routine batches with nothing new to report, and do not repeat an update already delivered through progress_update. Leave the full recap for the final answer.";
|
|
108345
|
+
}
|
|
108346
|
+
function relayOneGptSystemText(options, entry) {
|
|
108347
|
+
return relayOneGptGuidance(relayOneSystemText(options), options, entry);
|
|
108348
|
+
}
|
|
108349
|
+
function usesCacheableDeveloperPrefix(id) {
|
|
108350
|
+
const version = /^gpt-(\d+)(?:\.(\d+))?(?:-|$)/i.exec(id);
|
|
108351
|
+
const major = Number(version?.[1]);
|
|
108352
|
+
return major > 6 || major === 6 && Number(version?.[2] ?? 0) >= 2;
|
|
108353
|
+
}
|
|
108354
|
+
function relayOneResponsesInstructions(options, entry) {
|
|
108355
|
+
if (!usesCacheableDeveloperPrefix(entry.id)) return {
|
|
108356
|
+
base: "",
|
|
108357
|
+
current: relayOneGptSystemText(options, entry)
|
|
108358
|
+
};
|
|
108359
|
+
const base = [options.system?.trim() ?? ""];
|
|
108360
|
+
const current = [];
|
|
108361
|
+
let pastPrefix = false;
|
|
108362
|
+
for (const message of options.messages) {
|
|
108363
|
+
if (message.role !== "system" && message.role !== "developer") {
|
|
108364
|
+
pastPrefix = true;
|
|
108365
|
+
continue;
|
|
108366
|
+
}
|
|
108367
|
+
const text = relayOneInstructionText(message);
|
|
108368
|
+
if (text !== "") (pastPrefix ? current : base).push(text);
|
|
108369
|
+
}
|
|
108370
|
+
return {
|
|
108371
|
+
base: relayOneGptGuidance(base.filter(Boolean).join("\n\n"), options, entry),
|
|
108372
|
+
current: current.join("\n\n")
|
|
108373
|
+
};
|
|
108374
|
+
}
|
|
108235
108375
|
function responseMessageContent(message, images, accepted) {
|
|
108236
108376
|
const parts = [];
|
|
108237
108377
|
const textType = message.role === "assistant" ? "output_text" : "input_text";
|
|
@@ -108254,7 +108394,15 @@ function responseMessageContent(message, images, accepted) {
|
|
|
108254
108394
|
function buildRelayOneResponsesRequest(options, images, entry, settings) {
|
|
108255
108395
|
const input = [];
|
|
108256
108396
|
const knownCalls = /* @__PURE__ */ new Set();
|
|
108257
|
-
const
|
|
108397
|
+
const { base, current } = relayOneResponsesInstructions(options, entry);
|
|
108398
|
+
if (base !== "") input.push({
|
|
108399
|
+
type: "message",
|
|
108400
|
+
role: "developer",
|
|
108401
|
+
content: [{
|
|
108402
|
+
type: "input_text",
|
|
108403
|
+
text: base
|
|
108404
|
+
}]
|
|
108405
|
+
});
|
|
108258
108406
|
for (const message of options.messages) {
|
|
108259
108407
|
if (message.role === "system" || message.role === "developer") continue;
|
|
108260
108408
|
const toolResult = relayOneToolResult(message);
|
|
@@ -108275,22 +108423,29 @@ function buildRelayOneResponsesRequest(options, images, entry, settings) {
|
|
|
108275
108423
|
});
|
|
108276
108424
|
continue;
|
|
108277
108425
|
}
|
|
108278
|
-
|
|
108279
|
-
const replay = relayOneReplayOutputItems(message);
|
|
108280
|
-
if (replay !== null) {
|
|
108281
|
-
input.push(...replay);
|
|
108282
|
-
for (const item of replay) if (item.type === "function_call" && typeof item.call_id === "string") knownCalls.add(item.call_id);
|
|
108283
|
-
continue;
|
|
108284
|
-
}
|
|
108285
|
-
}
|
|
108426
|
+
const replay = message.role === "assistant" ? relayOneReplayOutputItems(message) : null;
|
|
108286
108427
|
const content = responseMessageContent(message, images, entry.supportsImages);
|
|
108287
|
-
|
|
108428
|
+
const hasReplayText = replay?.some((item) => item.type === "message" && Array.isArray(item.content) && item.content.some((part) => {
|
|
108429
|
+
if (!isRelayOneRecord(part)) return false;
|
|
108430
|
+
const text = part.type === "output_text" ? relayOneString(part.text) : part.type === "refusal" ? relayOneString(part.refusal) : void 0;
|
|
108431
|
+
return Boolean(text?.trim());
|
|
108432
|
+
}));
|
|
108433
|
+
if (replay !== null) {
|
|
108434
|
+
const firstCall = replay.findIndex((item) => item.type === "function_call");
|
|
108435
|
+
if (!hasReplayText && content.length > 0) replay.splice(firstCall === -1 ? replay.length : firstCall, 0, {
|
|
108436
|
+
role: "assistant",
|
|
108437
|
+
content
|
|
108438
|
+
});
|
|
108439
|
+
input.push(...replay);
|
|
108440
|
+
for (const item of replay) if (item.type === "function_call" && typeof item.call_id === "string") knownCalls.add(item.call_id);
|
|
108441
|
+
} else if (content.length > 0) input.push({
|
|
108288
108442
|
role: message.role,
|
|
108289
108443
|
content
|
|
108290
108444
|
});
|
|
108291
108445
|
if (message.role === "assistant") for (const block of message.content) {
|
|
108292
108446
|
if (block.type !== "tool-call") continue;
|
|
108293
108447
|
const callId = String(block.id);
|
|
108448
|
+
if (knownCalls.has(callId)) continue;
|
|
108294
108449
|
knownCalls.add(callId);
|
|
108295
108450
|
input.push({
|
|
108296
108451
|
type: "function_call",
|
|
@@ -108311,7 +108466,7 @@ function buildRelayOneResponsesRequest(options, images, entry, settings) {
|
|
|
108311
108466
|
return {
|
|
108312
108467
|
model: options.model,
|
|
108313
108468
|
stream: true,
|
|
108314
|
-
...
|
|
108469
|
+
...current === "" ? {} : { instructions: current },
|
|
108315
108470
|
input,
|
|
108316
108471
|
...tools.length > 0 ? {
|
|
108317
108472
|
tools,
|
|
@@ -108344,7 +108499,7 @@ function chatContent(message, images, accepted) {
|
|
|
108344
108499
|
}
|
|
108345
108500
|
function buildRelayOneChatRequest(options, images, entry, settings) {
|
|
108346
108501
|
const messages = [];
|
|
108347
|
-
const system =
|
|
108502
|
+
const system = relayOneGptSystemText(options, entry);
|
|
108348
108503
|
if (system !== "") messages.push({
|
|
108349
108504
|
role: "system",
|
|
108350
108505
|
content: system
|
|
@@ -108713,17 +108868,28 @@ function buildRelayOneAnthropicRequest(options, images, entry, settings) {
|
|
|
108713
108868
|
description: tool.description,
|
|
108714
108869
|
input_schema: stripMetaSchema$1(tool.parameters)
|
|
108715
108870
|
}));
|
|
108716
|
-
const
|
|
108717
|
-
const
|
|
108871
|
+
const adaptive = relayOneClaudeAdaptiveThinking(entry.id);
|
|
108872
|
+
const effort = relayOneEffort(options, settings.defaultReasoningEffort, adaptive?.efforts ?? entry.reasoningEfforts);
|
|
108873
|
+
const enabled = effort !== "none" && (effort !== void 0 || adaptive?.enabledByDefault === true);
|
|
108874
|
+
const budget = adaptive === void 0 && enabled && effort !== void 0 ? {
|
|
108718
108875
|
minimal: 2048,
|
|
108719
108876
|
low: 4096,
|
|
108720
108877
|
medium: 8192,
|
|
108721
108878
|
high: 16384,
|
|
108722
108879
|
xhigh: 24576,
|
|
108723
108880
|
max: 32768
|
|
108724
|
-
}[effort] ?? 8192;
|
|
108881
|
+
}[effort] ?? 8192 : 0;
|
|
108725
108882
|
const baseMax = options.maxTokens ?? Math.min(entry.maxOutputTokens, 16384);
|
|
108726
108883
|
const maxTokens = Math.max(1024, Math.min(entry.maxOutputTokens, budget > 0 ? Math.max(baseMax, budget + 4096) : baseMax));
|
|
108884
|
+
const thinking = adaptive !== void 0 ? effort === "none" ? { type: "disabled" } : enabled ? {
|
|
108885
|
+
type: "adaptive",
|
|
108886
|
+
display: "summarized"
|
|
108887
|
+
} : void 0 : budget > 0 && maxTokens > budget ? {
|
|
108888
|
+
type: "enabled",
|
|
108889
|
+
budget_tokens: budget
|
|
108890
|
+
} : void 0;
|
|
108891
|
+
const outputConfig = adaptive !== void 0 && effort !== void 0 && effort !== "none" ? { effort } : void 0;
|
|
108892
|
+
const allowTemperature = !enabled && (adaptive?.allowsTemperatureWhenOff ?? true);
|
|
108727
108893
|
const system = relayOneSystemText(options);
|
|
108728
108894
|
return {
|
|
108729
108895
|
model: options.model,
|
|
@@ -108735,11 +108901,9 @@ function buildRelayOneAnthropicRequest(options, images, entry, settings) {
|
|
|
108735
108901
|
tools,
|
|
108736
108902
|
tool_choice: { type: "auto" }
|
|
108737
108903
|
} : {},
|
|
108738
|
-
...
|
|
108739
|
-
|
|
108740
|
-
|
|
108741
|
-
} } : {},
|
|
108742
|
-
...options.temperature === void 0 || budget > 0 ? {} : { temperature: options.temperature },
|
|
108904
|
+
...thinking === void 0 ? {} : { thinking },
|
|
108905
|
+
...outputConfig === void 0 ? {} : { output_config: outputConfig },
|
|
108906
|
+
...options.temperature === void 0 || !allowTemperature ? {} : { temperature: options.temperature },
|
|
108743
108907
|
...options.stop !== void 0 && options.stop.length > 0 ? { stop_sequences: options.stop } : {}
|
|
108744
108908
|
};
|
|
108745
108909
|
}
|
package/lib/types/compat.d.ts
CHANGED
|
@@ -76,7 +76,7 @@ export declare const ROUTE_PREFIX: "/api/dsh-chatgpt-subscription";
|
|
|
76
76
|
* `test/responses-client.test.ts` asserts the two agree, so a release that
|
|
77
77
|
* forgets this constant fails the suite instead of shipping quietly.
|
|
78
78
|
*/
|
|
79
|
-
export declare const PLUGIN_VERSION: "0.
|
|
79
|
+
export declare const PLUGIN_VERSION: "0.80.1";
|
|
80
80
|
export declare const CODEX_CHATGPT_PROVIDER_ID: "codex-chatgpt";
|
|
81
81
|
export { MINIMAX_CODE_PROVIDER_ID, MINIMAX_CODE_ROUTE_PREFIX } from './shared/minimax-code-contracts.ts';
|
|
82
82
|
export declare const CODEX_API_BASE: "https://chatgpt.com/backend-api/codex";
|
|
@@ -34,6 +34,8 @@ import type { AcpLaunch } from './adapter.ts';
|
|
|
34
34
|
* is what a user reaches for when it happens.
|
|
35
35
|
*/
|
|
36
36
|
export declare const CATALOG_TTL_MS: number;
|
|
37
|
+
/** A failed cold read is retried at most once per window unless explicitly forced. */
|
|
38
|
+
export declare const CATALOG_FAILURE_TTL_MS: number;
|
|
37
39
|
/** Budget for one catalogue read; a hung agent must not hold the picker. */
|
|
38
40
|
export declare const CATALOG_TIMEOUT_MS = 20000;
|
|
39
41
|
/** One read's result. */
|
|
@@ -56,6 +58,7 @@ export declare class AcpCatalog {
|
|
|
56
58
|
private readonly scope;
|
|
57
59
|
private readonly now;
|
|
58
60
|
private cached;
|
|
61
|
+
private failedAt;
|
|
59
62
|
private inflight;
|
|
60
63
|
private readonly snapshotName;
|
|
61
64
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"catalog.d.ts","sourceRoot":"","sources":["../../../../src/host/antigravity-acp/catalog.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAChD,OAAO,EAAE,SAAS,IAAI,MAAM,EAAE,MAAM,iBAAiB,CAAA;AAOrD,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,2CAA2C,CAAA;AACvF,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AAG7C;;;;;;;;;GASG;AACH,eAAO,MAAM,cAAc,QAAc,CAAA;AAEzC,4EAA4E;AAC5E,eAAO,MAAM,kBAAkB,QAAS,CAAA;AAExC,yBAAyB;AACzB,MAAM,WAAW,cAAc;IAC7B,MAAM,EAAE,sBAAsB,EAAE,CAAA;IAChC,mEAAmE;IACnE,IAAI,CAAC,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAA;IACnC,gFAAgF;IAChF,YAAY,EAAE,OAAO,CAAA;IACrB,mDAAmD;IACnD,SAAS,EAAE,MAAM,CAAA;CAClB;AAED,+CAA+C;AAC/C,qBAAa,UAAU;
|
|
1
|
+
{"version":3,"file":"catalog.d.ts","sourceRoot":"","sources":["../../../../src/host/antigravity-acp/catalog.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAChD,OAAO,EAAE,SAAS,IAAI,MAAM,EAAE,MAAM,iBAAiB,CAAA;AAOrD,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,2CAA2C,CAAA;AACvF,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AAG7C;;;;;;;;;GASG;AACH,eAAO,MAAM,cAAc,QAAc,CAAA;AAEzC,sFAAsF;AACtF,eAAO,MAAM,sBAAsB,QAAa,CAAA;AAEhD,4EAA4E;AAC5E,eAAO,MAAM,kBAAkB,QAAS,CAAA;AAExC,yBAAyB;AACzB,MAAM,WAAW,cAAc;IAC7B,MAAM,EAAE,sBAAsB,EAAE,CAAA;IAChC,mEAAmE;IACnE,IAAI,CAAC,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAA;IACnC,gFAAgF;IAChF,YAAY,EAAE,OAAO,CAAA;IACrB,mDAAmD;IACnD,SAAS,EAAE,MAAM,CAAA;CAClB;AAED,+CAA+C;AAC/C,qBAAa,UAAU;IAanB,OAAO,CAAC,QAAQ,CAAC,aAAa;IAC9B,OAAO,CAAC,QAAQ,CAAC,WAAW;IAC5B,OAAO,CAAC,QAAQ,CAAC,KAAK;IACtB,OAAO,CAAC,QAAQ,CAAC,GAAG;IAftB,OAAO,CAAC,MAAM,CAA4B;IAC1C,OAAO,CAAC,QAAQ,CAAoB;IACpC,OAAO,CAAC,QAAQ,CAAiD;IACjE,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAQ;IAErC;;;;;OAKG;gBAEgB,aAAa,EAAE,MAAM,OAAO,CAAC,SAAS,CAAC,EACvC,WAAW,EAAE,CAAC,MAAM,EAAE,SAAS,KAAK,SAAS,EAC7C,KAAK,GAAE,MAAkB,EACzB,GAAG,GAAE,MAAM,MAAiB;IAK/C,+EAA+E;IACzE,SAAS,IAAI,OAAO,CAAC,cAAc,GAAG,SAAS,CAAC;IAQtD;;;;;OAKG;IACG,IAAI,CAAC,OAAO,GAAE;QAAE,KAAK,CAAC,EAAE,OAAO,CAAC;QAAC,MAAM,CAAC,EAAE,WAAW,CAAA;KAAO,GAAG,OAAO,CAAC,cAAc,GAAG,SAAS,CAAC;IAkBxG,yEAAyE;IACzE,UAAU,IAAI,IAAI;YAKJ,OAAO;CAmBtB;AAED;;;;;;;;;;;GAWG;AACH,wBAAsB,eAAe,CACnC,MAAM,EAAE,SAAS,EACjB,MAAM,CAAC,EAAE,WAAW,GACnB,OAAO,CAAC;IAAE,MAAM,EAAE,sBAAsB,EAAE,CAAC;IAAC,IAAI,CAAC,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAA;CAAE,CAAC,CAyBpF;AA8ED,OAAO,EAAE,MAAM,EAAE,CAAA"}
|