indusagi 0.13.10 → 0.13.12
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/agent.js +204 -29
- package/dist/ai.js +204 -29
- package/dist/cli.js +92 -9
- package/dist/index.js +186 -21
- package/dist/llmgateway.js +81 -4
- package/dist/mcp.js +94 -12
- package/dist/react-host/jsx-dev-runtime.js +93 -0
- package/dist/react-ink.js +11 -5
- package/dist/runtime.js +81 -4
- package/dist/shell-app.js +92 -9
- package/dist/smithy.js +81 -4
- package/dist/swarm.js +81 -4
- package/dist/types/facade/agent.d.ts +1 -1
- package/dist/types/facade/agent.test.d.ts +1 -0
- package/dist/types/facade/ai.d.ts +1 -1
- package/dist/types/facade/bot/types.d.ts +3 -3
- package/dist/types/facade/mcp.d.ts +1 -1
- package/dist/types/facade/ml/adapters/openai-codex-responses.d.ts +1 -1
- package/dist/types/facade/ml/adapters/openai-codex-responses.test.d.ts +1 -0
- package/dist/types/facade/ml/adapters/openai-responses.d.ts +1 -1
- package/dist/types/facade/ml/adapters/openai-responses.test.d.ts +1 -0
- package/dist/types/facade/ml/adapters/simple-options.d.ts +2 -2
- package/dist/types/facade/ml/auth-store.d.ts +7 -0
- package/dist/types/facade/ml/auth-store.test.d.ts +1 -0
- package/dist/types/facade/ml/models.generated.d.ts +162 -0
- package/dist/types/facade/ml/types.d.ts +14 -1
- package/dist/types/llmgateway/connectors/openai-responses.test.d.ts +1 -0
- package/dist/types/llmgateway/contract/index.d.ts +2 -2
- package/dist/types/llmgateway/contract/model-card.d.ts +14 -0
- package/dist/types/llmgateway/contract/options.d.ts +3 -1
- package/dist/types/react-host/jsx-dev-runtime.d.ts +3 -0
- package/dist/types/react-host/loader.d.ts +1 -0
- package/dist/types/security/private-state.d.ts +3 -0
- package/dist/zoho.js +94 -12
- package/package.json +7 -2
package/dist/ai.js
CHANGED
|
@@ -4818,6 +4818,72 @@ var MODELS = {
|
|
|
4818
4818
|
contextWindow: 1e6,
|
|
4819
4819
|
maxTokens: 128e3
|
|
4820
4820
|
},
|
|
4821
|
+
"gpt-6-astra": {
|
|
4822
|
+
id: "gpt-6-astra",
|
|
4823
|
+
name: "GPT-6 Astra",
|
|
4824
|
+
api: "openai-responses",
|
|
4825
|
+
provider: "openai",
|
|
4826
|
+
baseUrl: "https://api.openai.com/v1",
|
|
4827
|
+
reasoning: true,
|
|
4828
|
+
reasoningEfforts: ["low", "medium", "high", "xhigh", "max"],
|
|
4829
|
+
input: ["text", "image"],
|
|
4830
|
+
cost: {
|
|
4831
|
+
input: 10,
|
|
4832
|
+
output: 50,
|
|
4833
|
+
cacheRead: 1,
|
|
4834
|
+
cacheWrite: 12.5
|
|
4835
|
+
},
|
|
4836
|
+
longContextPricing: {
|
|
4837
|
+
threshold: 272e3,
|
|
4838
|
+
multipliers: {
|
|
4839
|
+
input: 2,
|
|
4840
|
+
output: 1.5,
|
|
4841
|
+
cacheRead: 2,
|
|
4842
|
+
cacheWrite: 2
|
|
4843
|
+
}
|
|
4844
|
+
},
|
|
4845
|
+
contextWindow: 105e4,
|
|
4846
|
+
maxTokens: 128e3
|
|
4847
|
+
},
|
|
4848
|
+
"gpt-6-sol": {
|
|
4849
|
+
id: "gpt-6-sol",
|
|
4850
|
+
name: "GPT-6 Sol",
|
|
4851
|
+
api: "openai-responses",
|
|
4852
|
+
provider: "openai",
|
|
4853
|
+
baseUrl: "https://api.openai.com/v1",
|
|
4854
|
+
reasoning: true,
|
|
4855
|
+
reasoningEfforts: ["high"],
|
|
4856
|
+
input: ["text", "image"],
|
|
4857
|
+
cost: {
|
|
4858
|
+
input: 10,
|
|
4859
|
+
output: 50,
|
|
4860
|
+
cacheRead: 1,
|
|
4861
|
+
cacheWrite: 12.5
|
|
4862
|
+
},
|
|
4863
|
+
longContextPricing: {
|
|
4864
|
+
threshold: 272e3,
|
|
4865
|
+
multipliers: { input: 2, output: 1.5, cacheRead: 2, cacheWrite: 2 }
|
|
4866
|
+
},
|
|
4867
|
+
contextWindow: 105e4,
|
|
4868
|
+
maxTokens: 128e3
|
|
4869
|
+
},
|
|
4870
|
+
"gpt-6-luna": {
|
|
4871
|
+
id: "gpt-6-luna",
|
|
4872
|
+
name: "GPT-6 Luna",
|
|
4873
|
+
api: "openai-responses",
|
|
4874
|
+
provider: "openai",
|
|
4875
|
+
baseUrl: "https://api.openai.com/v1",
|
|
4876
|
+
reasoning: true,
|
|
4877
|
+
reasoningEfforts: ["low", "medium", "high", "xhigh", "max"],
|
|
4878
|
+
input: ["text", "image"],
|
|
4879
|
+
cost: { input: 0.1, output: 0.5, cacheRead: 0.01, cacheWrite: 0.125 },
|
|
4880
|
+
longContextPricing: {
|
|
4881
|
+
threshold: 272e3,
|
|
4882
|
+
multipliers: { input: 2, output: 1.5, cacheRead: 2, cacheWrite: 2 }
|
|
4883
|
+
},
|
|
4884
|
+
contextWindow: 105e4,
|
|
4885
|
+
maxTokens: 128e3
|
|
4886
|
+
},
|
|
4821
4887
|
"gpt-5.6-sol": {
|
|
4822
4888
|
id: "gpt-5.6-sol",
|
|
4823
4889
|
name: "GPT-5.6 Sol",
|
|
@@ -5280,6 +5346,67 @@ var MODELS = {
|
|
|
5280
5346
|
},
|
|
5281
5347
|
contextWindow: 105e4,
|
|
5282
5348
|
maxTokens: 128e3
|
|
5349
|
+
},
|
|
5350
|
+
"gpt-6-astra": {
|
|
5351
|
+
id: "gpt-6-astra",
|
|
5352
|
+
name: "GPT-6 Astra",
|
|
5353
|
+
api: "openai-codex-responses",
|
|
5354
|
+
provider: "openai-codex",
|
|
5355
|
+
baseUrl: "https://chatgpt.com/backend-api",
|
|
5356
|
+
reasoning: true,
|
|
5357
|
+
reasoningEfforts: ["low", "medium", "high", "xhigh", "max"],
|
|
5358
|
+
input: ["text", "image"],
|
|
5359
|
+
cost: {
|
|
5360
|
+
input: 10,
|
|
5361
|
+
output: 50,
|
|
5362
|
+
cacheRead: 1,
|
|
5363
|
+
cacheWrite: 12.5
|
|
5364
|
+
},
|
|
5365
|
+
longContextPricing: {
|
|
5366
|
+
threshold: 272e3,
|
|
5367
|
+
multipliers: { input: 2, output: 1.5, cacheRead: 2, cacheWrite: 2 }
|
|
5368
|
+
},
|
|
5369
|
+
contextWindow: 105e4,
|
|
5370
|
+
maxTokens: 128e3
|
|
5371
|
+
},
|
|
5372
|
+
"gpt-6-sol": {
|
|
5373
|
+
id: "gpt-6-sol",
|
|
5374
|
+
name: "GPT-6 Sol",
|
|
5375
|
+
api: "openai-codex-responses",
|
|
5376
|
+
provider: "openai-codex",
|
|
5377
|
+
baseUrl: "https://chatgpt.com/backend-api",
|
|
5378
|
+
reasoning: true,
|
|
5379
|
+
reasoningEfforts: ["high"],
|
|
5380
|
+
input: ["text", "image"],
|
|
5381
|
+
cost: {
|
|
5382
|
+
input: 10,
|
|
5383
|
+
output: 50,
|
|
5384
|
+
cacheRead: 1,
|
|
5385
|
+
cacheWrite: 12.5
|
|
5386
|
+
},
|
|
5387
|
+
longContextPricing: {
|
|
5388
|
+
threshold: 272e3,
|
|
5389
|
+
multipliers: { input: 2, output: 1.5, cacheRead: 2, cacheWrite: 2 }
|
|
5390
|
+
},
|
|
5391
|
+
contextWindow: 105e4,
|
|
5392
|
+
maxTokens: 128e3
|
|
5393
|
+
},
|
|
5394
|
+
"gpt-6-luna": {
|
|
5395
|
+
id: "gpt-6-luna",
|
|
5396
|
+
name: "GPT-6 Luna",
|
|
5397
|
+
api: "openai-codex-responses",
|
|
5398
|
+
provider: "openai-codex",
|
|
5399
|
+
baseUrl: "https://chatgpt.com/backend-api",
|
|
5400
|
+
reasoning: true,
|
|
5401
|
+
reasoningEfforts: ["low", "medium", "high", "xhigh", "max"],
|
|
5402
|
+
input: ["text", "image"],
|
|
5403
|
+
cost: { input: 0.1, output: 0.5, cacheRead: 0.01, cacheWrite: 0.125 },
|
|
5404
|
+
longContextPricing: {
|
|
5405
|
+
threshold: 272e3,
|
|
5406
|
+
multipliers: { input: 2, output: 1.5, cacheRead: 2, cacheWrite: 2 }
|
|
5407
|
+
},
|
|
5408
|
+
contextWindow: 105e4,
|
|
5409
|
+
maxTokens: 128e3
|
|
5283
5410
|
}
|
|
5284
5411
|
},
|
|
5285
5412
|
"opencode": {
|
|
@@ -12810,9 +12937,9 @@ function loadCustomModels(models) {
|
|
|
12810
12937
|
function calculateCost(model, usage) {
|
|
12811
12938
|
return modelRegistry.calculateCost(model, usage);
|
|
12812
12939
|
}
|
|
12813
|
-
var XHIGH_MODEL_IDS = /* @__PURE__ */ new Set(["gpt-5.1-codex-max", "gpt-5.2", "gpt-5.2-codex"]);
|
|
12940
|
+
var XHIGH_MODEL_IDS = /* @__PURE__ */ new Set(["gpt-5.1-codex-max", "gpt-5.2", "gpt-5.2-codex", "gpt-6-astra"]);
|
|
12814
12941
|
function supportsXhigh(model) {
|
|
12815
|
-
return XHIGH_MODEL_IDS.has(model.id);
|
|
12942
|
+
return model.reasoningEfforts?.includes("xhigh") ?? XHIGH_MODEL_IDS.has(model.id);
|
|
12816
12943
|
}
|
|
12817
12944
|
function modelsAreEqual(a, b) {
|
|
12818
12945
|
if (!a || !b) return false;
|
|
@@ -13551,12 +13678,12 @@ function buildBaseOptions(model, options, apiKey) {
|
|
|
13551
13678
|
return base;
|
|
13552
13679
|
}
|
|
13553
13680
|
function clampReasoning(effort) {
|
|
13554
|
-
if (effort === "xhigh") return "high";
|
|
13681
|
+
if (effort === "xhigh" || effort === "max") return "high";
|
|
13555
13682
|
return effort;
|
|
13556
13683
|
}
|
|
13557
13684
|
function mapThinkingLevel(level, provider = "clamp-xhigh") {
|
|
13558
13685
|
if (!level) return void 0;
|
|
13559
|
-
if (provider === "supports-xhigh") return level;
|
|
13686
|
+
if (provider === "supports-xhigh") return level === "max" ? "high" : level;
|
|
13560
13687
|
return clampReasoning(level);
|
|
13561
13688
|
}
|
|
13562
13689
|
var RESERVED_ANSWER_TOKENS = 1024;
|
|
@@ -13568,8 +13695,10 @@ var REASONING_BUDGET_DEFAULTS = {
|
|
|
13568
13695
|
// 2Ki
|
|
13569
13696
|
medium: BUDGET_UNIT * 8,
|
|
13570
13697
|
// 8Ki
|
|
13571
|
-
high: BUDGET_UNIT * 16
|
|
13698
|
+
high: BUDGET_UNIT * 16,
|
|
13572
13699
|
// 16Ki
|
|
13700
|
+
max: BUDGET_UNIT * 16
|
|
13701
|
+
// clamped to high for generic token-budget providers
|
|
13573
13702
|
};
|
|
13574
13703
|
function adjustMaxTokensForThinking(baseMaxTokens, modelMaxTokens, reasoningLevel, customBudgets) {
|
|
13575
13704
|
const budgets = { ...REASONING_BUDGET_DEFAULTS, ...customBudgets };
|
|
@@ -16788,7 +16917,7 @@ var OpenAIResponsesParamBuilder = class {
|
|
|
16788
16917
|
if (this.options?.maxTokens) {
|
|
16789
16918
|
params.max_output_tokens = this.options.maxTokens;
|
|
16790
16919
|
}
|
|
16791
|
-
if (this.options?.temperature !== void 0) {
|
|
16920
|
+
if (!(/* @__PURE__ */ new Set(["gpt-6-astra", "gpt-6-sol", "gpt-6-luna"])).has(this.model.id) && this.options?.temperature !== void 0) {
|
|
16792
16921
|
params.temperature = this.options.temperature;
|
|
16793
16922
|
}
|
|
16794
16923
|
if (this.options?.serviceTier !== void 0) {
|
|
@@ -16842,7 +16971,11 @@ var streamSimpleOpenAIResponses = (model, context, options) => {
|
|
|
16842
16971
|
throw new Error(`No API key for provider: ${model.provider}`);
|
|
16843
16972
|
}
|
|
16844
16973
|
const base = buildBaseOptions(model, options, apiKey);
|
|
16845
|
-
const
|
|
16974
|
+
const requestedEffort = options?.reasoning;
|
|
16975
|
+
const reasoningEffort = model.reasoningEfforts ? requestedEffort !== void 0 && requestedEffort !== "minimal" && model.reasoningEfforts.includes(requestedEffort) ? requestedEffort : void 0 : mapThinkingLevel(
|
|
16976
|
+
requestedEffort === "max" ? "high" : requestedEffort,
|
|
16977
|
+
supportsXhigh(model) ? "supports-xhigh" : "clamp-xhigh"
|
|
16978
|
+
);
|
|
16846
16979
|
return streamOpenAIResponses(model, context, {
|
|
16847
16980
|
...base,
|
|
16848
16981
|
reasoningEffort
|
|
@@ -16877,8 +17010,8 @@ if (typeof process !== "undefined" && (process.versions?.node || process.version
|
|
|
16877
17010
|
}
|
|
16878
17011
|
var CODEX_URL = "https://chatgpt.com/backend-api/codex/responses";
|
|
16879
17012
|
var JWT_CLAIM_PATH = "https://api.openai.com/auth";
|
|
16880
|
-
var MAX_RETRIES =
|
|
16881
|
-
var
|
|
17013
|
+
var MAX_RETRIES = 4;
|
|
17014
|
+
var RETRY_DELAY_MS = 1e4;
|
|
16882
17015
|
var CODEX_TOOL_CALL_PROVIDERS = /* @__PURE__ */ new Set(["openai", "openai-codex", "opencode"]);
|
|
16883
17016
|
var CODEX_RESPONSE_STATUSES = /* @__PURE__ */ new Set([
|
|
16884
17017
|
"completed",
|
|
@@ -16892,21 +17025,29 @@ var TRANSIENT_ERROR_PATTERNS = [
|
|
|
16892
17025
|
/rate.?limit/i,
|
|
16893
17026
|
/overloaded/i,
|
|
16894
17027
|
/service.?unavailable/i,
|
|
17028
|
+
/server.?error/i,
|
|
17029
|
+
/terminated/i,
|
|
16895
17030
|
/upstream.?connect/i,
|
|
16896
17031
|
/connection.?refused/i
|
|
16897
17032
|
];
|
|
16898
17033
|
var RETRYABLE_STATUS_CODES = /* @__PURE__ */ new Set([429, 500, 502, 503, 504]);
|
|
16899
17034
|
var CodexRetryExecutor = class _CodexRetryExecutor {
|
|
17035
|
+
static terminalErrorMarker = /* @__PURE__ */ Symbol("codexTerminalError");
|
|
16900
17036
|
static isRetryable(status, errorText) {
|
|
16901
17037
|
if (RETRYABLE_STATUS_CODES.has(status)) {
|
|
16902
17038
|
return true;
|
|
16903
17039
|
}
|
|
16904
17040
|
return TRANSIENT_ERROR_PATTERNS.some((pattern) => pattern.test(errorText));
|
|
16905
17041
|
}
|
|
16906
|
-
|
|
16907
|
-
|
|
16908
|
-
|
|
16909
|
-
|
|
17042
|
+
static backoffDelay(_attempt) {
|
|
17043
|
+
return RETRY_DELAY_MS;
|
|
17044
|
+
}
|
|
17045
|
+
static markTerminal(error) {
|
|
17046
|
+
error[_CodexRetryExecutor.terminalErrorMarker] = true;
|
|
17047
|
+
return error;
|
|
17048
|
+
}
|
|
17049
|
+
static isTerminal(error) {
|
|
17050
|
+
return Boolean(error[_CodexRetryExecutor.terminalErrorMarker]);
|
|
16910
17051
|
}
|
|
16911
17052
|
static sleep(ms, signal) {
|
|
16912
17053
|
return new Promise((resolve, reject) => {
|
|
@@ -16942,12 +17083,15 @@ var CodexRetryExecutor = class _CodexRetryExecutor {
|
|
|
16942
17083
|
statusText: response.statusText
|
|
16943
17084
|
});
|
|
16944
17085
|
const info = await CodexErrorInterpreter.parse(fakeResponse);
|
|
16945
|
-
throw new Error(info.friendlyMessage || info.message);
|
|
17086
|
+
throw _CodexRetryExecutor.markTerminal(new Error(info.friendlyMessage || info.message));
|
|
16946
17087
|
} catch (error) {
|
|
16947
17088
|
if (error instanceof Error && (error.name === "AbortError" || error.message === "Request was aborted")) {
|
|
16948
17089
|
throw new Error("Request was aborted");
|
|
16949
17090
|
}
|
|
16950
17091
|
lastError = error instanceof Error ? error : new Error(String(error));
|
|
17092
|
+
if (_CodexRetryExecutor.isTerminal(lastError)) {
|
|
17093
|
+
throw lastError;
|
|
17094
|
+
}
|
|
16951
17095
|
if (attempt < MAX_RETRIES && !lastError.message.includes("usage limit")) {
|
|
16952
17096
|
await _CodexRetryExecutor.sleep(_CodexRetryExecutor.backoffDelay(attempt), options?.signal);
|
|
16953
17097
|
continue;
|
|
@@ -17015,20 +17159,45 @@ var streamOpenAICodexResponses = (model, context, options) => {
|
|
|
17015
17159
|
const requestFactory = new CodexRequestFactory(model, context, options, apiKey);
|
|
17016
17160
|
const { body, bodyJson, headers } = requestFactory.buildPayload();
|
|
17017
17161
|
options?.onPayload?.(body);
|
|
17018
|
-
|
|
17019
|
-
|
|
17020
|
-
|
|
17021
|
-
|
|
17022
|
-
|
|
17023
|
-
|
|
17024
|
-
|
|
17025
|
-
|
|
17026
|
-
|
|
17027
|
-
|
|
17028
|
-
|
|
17162
|
+
let completedOutput;
|
|
17163
|
+
let completedEvents;
|
|
17164
|
+
for (let attempt = 0; attempt <= MAX_RETRIES; attempt++) {
|
|
17165
|
+
const response = await executeWithCodexRetry(
|
|
17166
|
+
() => fetch(CODEX_URL, {
|
|
17167
|
+
method: "POST",
|
|
17168
|
+
headers,
|
|
17169
|
+
body: bodyJson,
|
|
17170
|
+
signal: options?.signal
|
|
17171
|
+
}),
|
|
17172
|
+
options?.signal
|
|
17173
|
+
);
|
|
17174
|
+
if (!response.body) {
|
|
17175
|
+
throw new Error("No response body");
|
|
17176
|
+
}
|
|
17177
|
+
const attemptOutput = createAssistantMessageOutput(model);
|
|
17178
|
+
const attemptStream = new AssistantMessageEventStream();
|
|
17179
|
+
try {
|
|
17180
|
+
await processStream(response, attemptOutput, attemptStream, model);
|
|
17181
|
+
completedOutput = attemptOutput;
|
|
17182
|
+
completedEvents = [...attemptStream.getHistory()];
|
|
17183
|
+
break;
|
|
17184
|
+
} catch (error) {
|
|
17185
|
+
if (options?.signal?.aborted) {
|
|
17186
|
+
throw new Error("Request was aborted");
|
|
17187
|
+
}
|
|
17188
|
+
const message = error instanceof Error ? error.message : JSON.stringify(error);
|
|
17189
|
+
if (attempt >= MAX_RETRIES || !CodexRetryExecutor.isRetryable(200, message)) {
|
|
17190
|
+
throw error;
|
|
17191
|
+
}
|
|
17192
|
+
await CodexRetryExecutor.sleep(CodexRetryExecutor.backoffDelay(attempt), options?.signal);
|
|
17193
|
+
}
|
|
17194
|
+
}
|
|
17195
|
+
if (!completedOutput || !completedEvents) {
|
|
17196
|
+
throw new Error("Failed after retries");
|
|
17029
17197
|
}
|
|
17198
|
+
Object.assign(output, completedOutput);
|
|
17030
17199
|
events.start();
|
|
17031
|
-
|
|
17200
|
+
for (const event of completedEvents) stream2.push(event);
|
|
17032
17201
|
if (options?.signal?.aborted) {
|
|
17033
17202
|
throw new Error("Request was aborted");
|
|
17034
17203
|
}
|
|
@@ -17051,7 +17220,8 @@ var streamSimpleOpenAICodexResponses = (model, context, options) => {
|
|
|
17051
17220
|
throw new Error(`No API key for provider: ${model.provider}`);
|
|
17052
17221
|
}
|
|
17053
17222
|
const base = buildBaseOptions(model, options, apiKey);
|
|
17054
|
-
const
|
|
17223
|
+
const mappedEffort = options?.reasoning === "max" && model.reasoningEfforts?.includes("max") ? "max" : mapThinkingLevel(options?.reasoning, supportsXhigh(model) ? "supports-xhigh" : "clamp-xhigh");
|
|
17224
|
+
const reasoningEffort = mappedEffort && model.reasoningEfforts && (mappedEffort === "minimal" || !model.reasoningEfforts.includes(mappedEffort)) ? void 0 : mappedEffort;
|
|
17055
17225
|
return streamOpenAICodexResponses(model, context, {
|
|
17056
17226
|
...base,
|
|
17057
17227
|
reasoningEffort
|
|
@@ -17073,7 +17243,11 @@ function buildRequestBody(model, context, options) {
|
|
|
17073
17243
|
tool_choice: "auto",
|
|
17074
17244
|
parallel_tool_calls: true
|
|
17075
17245
|
};
|
|
17076
|
-
|
|
17246
|
+
const usesFixedGpt6CodexPayload = (/* @__PURE__ */ new Set(["gpt-6-astra", "gpt-6-sol", "gpt-6-luna"])).has(model.id);
|
|
17247
|
+
if (options?.maxTokens !== void 0 && !usesFixedGpt6CodexPayload) {
|
|
17248
|
+
body.max_output_tokens = options.maxTokens;
|
|
17249
|
+
}
|
|
17250
|
+
if (options?.temperature !== void 0 && !usesFixedGpt6CodexPayload) {
|
|
17077
17251
|
body.temperature = options.temperature;
|
|
17078
17252
|
}
|
|
17079
17253
|
if (context.tools) {
|
|
@@ -17730,7 +17904,8 @@ var CLAUDE_THINKING_BUDGETS = {
|
|
|
17730
17904
|
low: 1500,
|
|
17731
17905
|
medium: 6e3,
|
|
17732
17906
|
high: 2e4,
|
|
17733
|
-
xhigh: 2e4
|
|
17907
|
+
xhigh: 2e4,
|
|
17908
|
+
max: 2e4
|
|
17734
17909
|
};
|
|
17735
17910
|
function resolveThinkingPayload(model, options) {
|
|
17736
17911
|
if (!options.reasoning || !model.reasoning) {
|
package/dist/cli.js
CHANGED
|
@@ -410,6 +410,72 @@ var MODEL_CARDS = [
|
|
|
410
410
|
cacheReadPerMTok: 0.275
|
|
411
411
|
}
|
|
412
412
|
},
|
|
413
|
+
{
|
|
414
|
+
id: "gpt-6-astra",
|
|
415
|
+
provider: "openai",
|
|
416
|
+
api: "openai-responses",
|
|
417
|
+
displayName: "GPT-6 Astra",
|
|
418
|
+
baseUrl: "https://api.openai.com/v1",
|
|
419
|
+
contextWindow: 105e4,
|
|
420
|
+
maxOutputTokens: 128e3,
|
|
421
|
+
modalities: ["text", "image"],
|
|
422
|
+
reasoning: true,
|
|
423
|
+
reasoningEfforts: ["low", "medium", "high", "xhigh", "max"],
|
|
424
|
+
longContextPricing: {
|
|
425
|
+
threshold: 272e3,
|
|
426
|
+
multipliers: { input: 2, output: 1.5, cacheRead: 2, cacheWrite: 2 }
|
|
427
|
+
},
|
|
428
|
+
cost: {
|
|
429
|
+
inputPerMTok: 10,
|
|
430
|
+
outputPerMTok: 50,
|
|
431
|
+
cacheReadPerMTok: 1,
|
|
432
|
+
cacheWritePerMTok: 12.5
|
|
433
|
+
}
|
|
434
|
+
},
|
|
435
|
+
{
|
|
436
|
+
id: "gpt-6-luna",
|
|
437
|
+
provider: "openai",
|
|
438
|
+
api: "openai-responses",
|
|
439
|
+
displayName: "GPT-6 Luna",
|
|
440
|
+
baseUrl: "https://api.openai.com/v1",
|
|
441
|
+
contextWindow: 105e4,
|
|
442
|
+
maxOutputTokens: 128e3,
|
|
443
|
+
modalities: ["text", "image"],
|
|
444
|
+
reasoning: true,
|
|
445
|
+
reasoningEfforts: ["low", "medium", "high", "xhigh", "max"],
|
|
446
|
+
longContextPricing: {
|
|
447
|
+
threshold: 272e3,
|
|
448
|
+
multipliers: { input: 2, output: 1.5, cacheRead: 2, cacheWrite: 2 }
|
|
449
|
+
},
|
|
450
|
+
cost: {
|
|
451
|
+
inputPerMTok: 0.1,
|
|
452
|
+
outputPerMTok: 0.5,
|
|
453
|
+
cacheReadPerMTok: 0.01,
|
|
454
|
+
cacheWritePerMTok: 0.125
|
|
455
|
+
}
|
|
456
|
+
},
|
|
457
|
+
{
|
|
458
|
+
id: "gpt-6-sol",
|
|
459
|
+
provider: "openai",
|
|
460
|
+
api: "openai-responses",
|
|
461
|
+
displayName: "GPT-6 Sol",
|
|
462
|
+
baseUrl: "https://api.openai.com/v1",
|
|
463
|
+
contextWindow: 105e4,
|
|
464
|
+
maxOutputTokens: 128e3,
|
|
465
|
+
modalities: ["text", "image"],
|
|
466
|
+
reasoning: true,
|
|
467
|
+
reasoningEfforts: ["high"],
|
|
468
|
+
longContextPricing: {
|
|
469
|
+
threshold: 272e3,
|
|
470
|
+
multipliers: { input: 2, output: 1.5, cacheRead: 2, cacheWrite: 2 }
|
|
471
|
+
},
|
|
472
|
+
cost: {
|
|
473
|
+
inputPerMTok: 10,
|
|
474
|
+
outputPerMTok: 50,
|
|
475
|
+
cacheReadPerMTok: 1,
|
|
476
|
+
cacheWritePerMTok: 12.5
|
|
477
|
+
}
|
|
478
|
+
},
|
|
413
479
|
// ── Google (Gemini) ─────────────────────────────────────────────────────
|
|
414
480
|
{
|
|
415
481
|
id: "gemini-2.5-pro",
|
|
@@ -1113,6 +1179,7 @@ function anthropicThinkingBudget(level, maxOutput) {
|
|
|
1113
1179
|
low: 0.2,
|
|
1114
1180
|
medium: 0.4,
|
|
1115
1181
|
high: 0.6,
|
|
1182
|
+
xhigh: 0.8,
|
|
1116
1183
|
max: 0.8
|
|
1117
1184
|
};
|
|
1118
1185
|
if (level === "off") {
|
|
@@ -1917,13 +1984,17 @@ function readNumber2(o, key) {
|
|
|
1917
1984
|
const v = o[key];
|
|
1918
1985
|
return typeof v === "number" && Number.isFinite(v) ? v : void 0;
|
|
1919
1986
|
}
|
|
1920
|
-
function reasoningEffort(level) {
|
|
1987
|
+
function reasoningEffort(model, level) {
|
|
1988
|
+
if (model.reasoningEfforts?.includes(level)) {
|
|
1989
|
+
return level;
|
|
1990
|
+
}
|
|
1921
1991
|
switch (level) {
|
|
1922
1992
|
case "low":
|
|
1923
1993
|
return "low";
|
|
1924
1994
|
case "medium":
|
|
1925
1995
|
return "medium";
|
|
1926
1996
|
case "high":
|
|
1997
|
+
case "xhigh":
|
|
1927
1998
|
case "max":
|
|
1928
1999
|
return "high";
|
|
1929
2000
|
}
|
|
@@ -1964,14 +2035,18 @@ function buildBody2(model, c, opts) {
|
|
|
1964
2035
|
if (ceiling > 0) {
|
|
1965
2036
|
body.max_output_tokens = ceiling;
|
|
1966
2037
|
}
|
|
1967
|
-
|
|
2038
|
+
const usesFixedGpt6Sampling = ["gpt-6-astra", "gpt-6-sol", "gpt-6-luna"].includes(model.id);
|
|
2039
|
+
if (!usesFixedGpt6Sampling && opts.temperature !== void 0) {
|
|
1968
2040
|
body.temperature = opts.temperature;
|
|
1969
2041
|
}
|
|
1970
|
-
if (opts.topP !== void 0) {
|
|
2042
|
+
if (!usesFixedGpt6Sampling && opts.topP !== void 0) {
|
|
1971
2043
|
body.top_p = opts.topP;
|
|
1972
2044
|
}
|
|
1973
2045
|
if (model.reasoning && opts.thinking !== void 0 && opts.thinking !== "off") {
|
|
1974
|
-
|
|
2046
|
+
const effort = reasoningEffort(model, opts.thinking);
|
|
2047
|
+
if (effort !== void 0) {
|
|
2048
|
+
body.reasoning = { effort };
|
|
2049
|
+
}
|
|
1975
2050
|
}
|
|
1976
2051
|
return body;
|
|
1977
2052
|
}
|
|
@@ -2246,6 +2321,7 @@ function geminiThinkingBudget(level, maxOutput) {
|
|
|
2246
2321
|
low: 0.2,
|
|
2247
2322
|
medium: 0.4,
|
|
2248
2323
|
high: 0.6,
|
|
2324
|
+
xhigh: 0.8,
|
|
2249
2325
|
max: 0.8
|
|
2250
2326
|
};
|
|
2251
2327
|
const budget = Math.floor(maxOutput * fraction[level]);
|
|
@@ -2539,6 +2615,7 @@ function thinkingBudget(level, maxOutput) {
|
|
|
2539
2615
|
low: 0.2,
|
|
2540
2616
|
medium: 0.4,
|
|
2541
2617
|
high: 0.6,
|
|
2618
|
+
xhigh: 0.8,
|
|
2542
2619
|
max: 0.8
|
|
2543
2620
|
};
|
|
2544
2621
|
return Math.max(0, Math.floor(maxOutput * fraction[level]));
|
|
@@ -9763,9 +9840,9 @@ function formatToken(token, theme, highlight = null, listDepth = 0, orderedListN
|
|
|
9763
9840
|
const inner = (headingToken.tokens ?? []).map((child) => formatToken(child, theme, highlight)).join("");
|
|
9764
9841
|
const colored = theme.role("heading", inner);
|
|
9765
9842
|
if (headingToken.depth === 1) {
|
|
9766
|
-
return chalk2.bold.
|
|
9843
|
+
return chalk2.bold.underline(`${theme.role("heading", "\u25B0")} ${colored}`) + EOL;
|
|
9767
9844
|
}
|
|
9768
|
-
return chalk2.bold(colored) + EOL
|
|
9845
|
+
return chalk2.bold(`${theme.role("heading", "\u25C6")} ${colored}`) + EOL;
|
|
9769
9846
|
}
|
|
9770
9847
|
case "hr":
|
|
9771
9848
|
return "---";
|
|
@@ -9799,8 +9876,14 @@ function formatToken(token, theme, highlight = null, listDepth = 0, orderedListN
|
|
|
9799
9876
|
return (token.tokens ?? []).map(
|
|
9800
9877
|
(child) => `${" ".repeat(listDepth)}${formatToken(child, theme, highlight, listDepth + 1, orderedListNumber, token)}`
|
|
9801
9878
|
).join("");
|
|
9802
|
-
case "paragraph":
|
|
9803
|
-
|
|
9879
|
+
case "paragraph": {
|
|
9880
|
+
const children = token.tokens ?? [];
|
|
9881
|
+
const body = children.map((child) => formatToken(child, theme, highlight)).join("");
|
|
9882
|
+
if (children.length === 1 && children[0]?.type === "strong") {
|
|
9883
|
+
return `${theme.role("heading", "\u25C6")} ${body}${EOL}`;
|
|
9884
|
+
}
|
|
9885
|
+
return body + EOL;
|
|
9886
|
+
}
|
|
9804
9887
|
case "space":
|
|
9805
9888
|
case "br":
|
|
9806
9889
|
return EOL;
|
|
@@ -9810,7 +9893,7 @@ function formatToken(token, theme, highlight = null, listDepth = 0, orderedListN
|
|
|
9810
9893
|
return textToken.text;
|
|
9811
9894
|
}
|
|
9812
9895
|
if (parent?.type === "list_item") {
|
|
9813
|
-
const marker = orderedListNumber === null ? "
|
|
9896
|
+
const marker = orderedListNumber === null ? "\u2022" : `${getListNumber(listDepth, orderedListNumber)}.`;
|
|
9814
9897
|
const body = textToken.tokens ? textToken.tokens.map((child) => formatToken(child, theme, highlight, listDepth, orderedListNumber, token)).join("") : textToken.text;
|
|
9815
9898
|
return `${marker} ${body}${EOL}`;
|
|
9816
9899
|
}
|