indusagi 0.13.11 → 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 +82 -3
- package/dist/ai.js +82 -3
- package/dist/cli.js +58 -7
- package/dist/index.js +152 -19
- package/dist/llmgateway.js +47 -2
- 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 +47 -2
- package/dist/shell-app.js +58 -7
- package/dist/smithy.js +47 -2
- package/dist/swarm.js +47 -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 +108 -0
- 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/agent.js
CHANGED
|
@@ -4721,6 +4721,45 @@ var MODELS = {
|
|
|
4721
4721
|
contextWindow: 105e4,
|
|
4722
4722
|
maxTokens: 128e3
|
|
4723
4723
|
},
|
|
4724
|
+
"gpt-6-sol": {
|
|
4725
|
+
id: "gpt-6-sol",
|
|
4726
|
+
name: "GPT-6 Sol",
|
|
4727
|
+
api: "openai-responses",
|
|
4728
|
+
provider: "openai",
|
|
4729
|
+
baseUrl: "https://api.openai.com/v1",
|
|
4730
|
+
reasoning: true,
|
|
4731
|
+
reasoningEfforts: ["high"],
|
|
4732
|
+
input: ["text", "image"],
|
|
4733
|
+
cost: {
|
|
4734
|
+
input: 10,
|
|
4735
|
+
output: 50,
|
|
4736
|
+
cacheRead: 1,
|
|
4737
|
+
cacheWrite: 12.5
|
|
4738
|
+
},
|
|
4739
|
+
longContextPricing: {
|
|
4740
|
+
threshold: 272e3,
|
|
4741
|
+
multipliers: { input: 2, output: 1.5, cacheRead: 2, cacheWrite: 2 }
|
|
4742
|
+
},
|
|
4743
|
+
contextWindow: 105e4,
|
|
4744
|
+
maxTokens: 128e3
|
|
4745
|
+
},
|
|
4746
|
+
"gpt-6-luna": {
|
|
4747
|
+
id: "gpt-6-luna",
|
|
4748
|
+
name: "GPT-6 Luna",
|
|
4749
|
+
api: "openai-responses",
|
|
4750
|
+
provider: "openai",
|
|
4751
|
+
baseUrl: "https://api.openai.com/v1",
|
|
4752
|
+
reasoning: true,
|
|
4753
|
+
reasoningEfforts: ["low", "medium", "high", "xhigh", "max"],
|
|
4754
|
+
input: ["text", "image"],
|
|
4755
|
+
cost: { input: 0.1, output: 0.5, cacheRead: 0.01, cacheWrite: 0.125 },
|
|
4756
|
+
longContextPricing: {
|
|
4757
|
+
threshold: 272e3,
|
|
4758
|
+
multipliers: { input: 2, output: 1.5, cacheRead: 2, cacheWrite: 2 }
|
|
4759
|
+
},
|
|
4760
|
+
contextWindow: 105e4,
|
|
4761
|
+
maxTokens: 128e3
|
|
4762
|
+
},
|
|
4724
4763
|
"gpt-5.6-sol": {
|
|
4725
4764
|
id: "gpt-5.6-sol",
|
|
4726
4765
|
name: "GPT-5.6 Sol",
|
|
@@ -5205,6 +5244,45 @@ var MODELS = {
|
|
|
5205
5244
|
},
|
|
5206
5245
|
contextWindow: 105e4,
|
|
5207
5246
|
maxTokens: 128e3
|
|
5247
|
+
},
|
|
5248
|
+
"gpt-6-sol": {
|
|
5249
|
+
id: "gpt-6-sol",
|
|
5250
|
+
name: "GPT-6 Sol",
|
|
5251
|
+
api: "openai-codex-responses",
|
|
5252
|
+
provider: "openai-codex",
|
|
5253
|
+
baseUrl: "https://chatgpt.com/backend-api",
|
|
5254
|
+
reasoning: true,
|
|
5255
|
+
reasoningEfforts: ["high"],
|
|
5256
|
+
input: ["text", "image"],
|
|
5257
|
+
cost: {
|
|
5258
|
+
input: 10,
|
|
5259
|
+
output: 50,
|
|
5260
|
+
cacheRead: 1,
|
|
5261
|
+
cacheWrite: 12.5
|
|
5262
|
+
},
|
|
5263
|
+
longContextPricing: {
|
|
5264
|
+
threshold: 272e3,
|
|
5265
|
+
multipliers: { input: 2, output: 1.5, cacheRead: 2, cacheWrite: 2 }
|
|
5266
|
+
},
|
|
5267
|
+
contextWindow: 105e4,
|
|
5268
|
+
maxTokens: 128e3
|
|
5269
|
+
},
|
|
5270
|
+
"gpt-6-luna": {
|
|
5271
|
+
id: "gpt-6-luna",
|
|
5272
|
+
name: "GPT-6 Luna",
|
|
5273
|
+
api: "openai-codex-responses",
|
|
5274
|
+
provider: "openai-codex",
|
|
5275
|
+
baseUrl: "https://chatgpt.com/backend-api",
|
|
5276
|
+
reasoning: true,
|
|
5277
|
+
reasoningEfforts: ["low", "medium", "high", "xhigh", "max"],
|
|
5278
|
+
input: ["text", "image"],
|
|
5279
|
+
cost: { input: 0.1, output: 0.5, cacheRead: 0.01, cacheWrite: 0.125 },
|
|
5280
|
+
longContextPricing: {
|
|
5281
|
+
threshold: 272e3,
|
|
5282
|
+
multipliers: { input: 2, output: 1.5, cacheRead: 2, cacheWrite: 2 }
|
|
5283
|
+
},
|
|
5284
|
+
contextWindow: 105e4,
|
|
5285
|
+
maxTokens: 128e3
|
|
5208
5286
|
}
|
|
5209
5287
|
},
|
|
5210
5288
|
"opencode": {
|
|
@@ -16626,7 +16704,7 @@ var OpenAIResponsesParamBuilder = class {
|
|
|
16626
16704
|
if (this.options?.maxTokens) {
|
|
16627
16705
|
params.max_output_tokens = this.options.maxTokens;
|
|
16628
16706
|
}
|
|
16629
|
-
if (
|
|
16707
|
+
if (!(/* @__PURE__ */ new Set(["gpt-6-astra", "gpt-6-sol", "gpt-6-luna"])).has(this.model.id) && this.options?.temperature !== void 0) {
|
|
16630
16708
|
params.temperature = this.options.temperature;
|
|
16631
16709
|
}
|
|
16632
16710
|
if (this.options?.serviceTier !== void 0) {
|
|
@@ -16952,10 +17030,11 @@ function buildRequestBody(model, context, options) {
|
|
|
16952
17030
|
tool_choice: "auto",
|
|
16953
17031
|
parallel_tool_calls: true
|
|
16954
17032
|
};
|
|
16955
|
-
|
|
17033
|
+
const usesFixedGpt6CodexPayload = (/* @__PURE__ */ new Set(["gpt-6-astra", "gpt-6-sol", "gpt-6-luna"])).has(model.id);
|
|
17034
|
+
if (options?.maxTokens !== void 0 && !usesFixedGpt6CodexPayload) {
|
|
16956
17035
|
body.max_output_tokens = options.maxTokens;
|
|
16957
17036
|
}
|
|
16958
|
-
if (options?.temperature !== void 0 &&
|
|
17037
|
+
if (options?.temperature !== void 0 && !usesFixedGpt6CodexPayload) {
|
|
16959
17038
|
body.temperature = options.temperature;
|
|
16960
17039
|
}
|
|
16961
17040
|
if (context.tools) {
|
package/dist/ai.js
CHANGED
|
@@ -4845,6 +4845,45 @@ var MODELS = {
|
|
|
4845
4845
|
contextWindow: 105e4,
|
|
4846
4846
|
maxTokens: 128e3
|
|
4847
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
|
+
},
|
|
4848
4887
|
"gpt-5.6-sol": {
|
|
4849
4888
|
id: "gpt-5.6-sol",
|
|
4850
4889
|
name: "GPT-5.6 Sol",
|
|
@@ -5329,6 +5368,45 @@ var MODELS = {
|
|
|
5329
5368
|
},
|
|
5330
5369
|
contextWindow: 105e4,
|
|
5331
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
|
|
5332
5410
|
}
|
|
5333
5411
|
},
|
|
5334
5412
|
"opencode": {
|
|
@@ -16839,7 +16917,7 @@ var OpenAIResponsesParamBuilder = class {
|
|
|
16839
16917
|
if (this.options?.maxTokens) {
|
|
16840
16918
|
params.max_output_tokens = this.options.maxTokens;
|
|
16841
16919
|
}
|
|
16842
|
-
if (
|
|
16920
|
+
if (!(/* @__PURE__ */ new Set(["gpt-6-astra", "gpt-6-sol", "gpt-6-luna"])).has(this.model.id) && this.options?.temperature !== void 0) {
|
|
16843
16921
|
params.temperature = this.options.temperature;
|
|
16844
16922
|
}
|
|
16845
16923
|
if (this.options?.serviceTier !== void 0) {
|
|
@@ -17165,10 +17243,11 @@ function buildRequestBody(model, context, options) {
|
|
|
17165
17243
|
tool_choice: "auto",
|
|
17166
17244
|
parallel_tool_calls: true
|
|
17167
17245
|
};
|
|
17168
|
-
|
|
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) {
|
|
17169
17248
|
body.max_output_tokens = options.maxTokens;
|
|
17170
17249
|
}
|
|
17171
|
-
if (options?.temperature !== void 0 &&
|
|
17250
|
+
if (options?.temperature !== void 0 && !usesFixedGpt6CodexPayload) {
|
|
17172
17251
|
body.temperature = options.temperature;
|
|
17173
17252
|
}
|
|
17174
17253
|
if (context.tools) {
|
package/dist/cli.js
CHANGED
|
@@ -432,6 +432,50 @@ var MODEL_CARDS = [
|
|
|
432
432
|
cacheWritePerMTok: 12.5
|
|
433
433
|
}
|
|
434
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
|
+
},
|
|
435
479
|
// ── Google (Gemini) ─────────────────────────────────────────────────────
|
|
436
480
|
{
|
|
437
481
|
id: "gemini-2.5-pro",
|
|
@@ -1991,10 +2035,11 @@ function buildBody2(model, c, opts) {
|
|
|
1991
2035
|
if (ceiling > 0) {
|
|
1992
2036
|
body.max_output_tokens = ceiling;
|
|
1993
2037
|
}
|
|
1994
|
-
|
|
2038
|
+
const usesFixedGpt6Sampling = ["gpt-6-astra", "gpt-6-sol", "gpt-6-luna"].includes(model.id);
|
|
2039
|
+
if (!usesFixedGpt6Sampling && opts.temperature !== void 0) {
|
|
1995
2040
|
body.temperature = opts.temperature;
|
|
1996
2041
|
}
|
|
1997
|
-
if (
|
|
2042
|
+
if (!usesFixedGpt6Sampling && opts.topP !== void 0) {
|
|
1998
2043
|
body.top_p = opts.topP;
|
|
1999
2044
|
}
|
|
2000
2045
|
if (model.reasoning && opts.thinking !== void 0 && opts.thinking !== "off") {
|
|
@@ -9795,9 +9840,9 @@ function formatToken(token, theme, highlight = null, listDepth = 0, orderedListN
|
|
|
9795
9840
|
const inner = (headingToken.tokens ?? []).map((child) => formatToken(child, theme, highlight)).join("");
|
|
9796
9841
|
const colored = theme.role("heading", inner);
|
|
9797
9842
|
if (headingToken.depth === 1) {
|
|
9798
|
-
return chalk2.bold.
|
|
9843
|
+
return chalk2.bold.underline(`${theme.role("heading", "\u25B0")} ${colored}`) + EOL;
|
|
9799
9844
|
}
|
|
9800
|
-
return chalk2.bold(colored) + EOL
|
|
9845
|
+
return chalk2.bold(`${theme.role("heading", "\u25C6")} ${colored}`) + EOL;
|
|
9801
9846
|
}
|
|
9802
9847
|
case "hr":
|
|
9803
9848
|
return "---";
|
|
@@ -9831,8 +9876,14 @@ function formatToken(token, theme, highlight = null, listDepth = 0, orderedListN
|
|
|
9831
9876
|
return (token.tokens ?? []).map(
|
|
9832
9877
|
(child) => `${" ".repeat(listDepth)}${formatToken(child, theme, highlight, listDepth + 1, orderedListNumber, token)}`
|
|
9833
9878
|
).join("");
|
|
9834
|
-
case "paragraph":
|
|
9835
|
-
|
|
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
|
+
}
|
|
9836
9887
|
case "space":
|
|
9837
9888
|
case "br":
|
|
9838
9889
|
return EOL;
|
|
@@ -9842,7 +9893,7 @@ function formatToken(token, theme, highlight = null, listDepth = 0, orderedListN
|
|
|
9842
9893
|
return textToken.text;
|
|
9843
9894
|
}
|
|
9844
9895
|
if (parent?.type === "list_item") {
|
|
9845
|
-
const marker = orderedListNumber === null ? "
|
|
9896
|
+
const marker = orderedListNumber === null ? "\u2022" : `${getListNumber(listDepth, orderedListNumber)}.`;
|
|
9846
9897
|
const body = textToken.tokens ? textToken.tokens.map((child) => formatToken(child, theme, highlight, listDepth, orderedListNumber, token)).join("") : textToken.text;
|
|
9847
9898
|
return `${marker} ${body}${EOL}`;
|
|
9848
9899
|
}
|
package/dist/index.js
CHANGED
|
@@ -221,6 +221,50 @@ var MODEL_CARDS = [
|
|
|
221
221
|
cacheWritePerMTok: 12.5
|
|
222
222
|
}
|
|
223
223
|
},
|
|
224
|
+
{
|
|
225
|
+
id: "gpt-6-luna",
|
|
226
|
+
provider: "openai",
|
|
227
|
+
api: "openai-responses",
|
|
228
|
+
displayName: "GPT-6 Luna",
|
|
229
|
+
baseUrl: "https://api.openai.com/v1",
|
|
230
|
+
contextWindow: 105e4,
|
|
231
|
+
maxOutputTokens: 128e3,
|
|
232
|
+
modalities: ["text", "image"],
|
|
233
|
+
reasoning: true,
|
|
234
|
+
reasoningEfforts: ["low", "medium", "high", "xhigh", "max"],
|
|
235
|
+
longContextPricing: {
|
|
236
|
+
threshold: 272e3,
|
|
237
|
+
multipliers: { input: 2, output: 1.5, cacheRead: 2, cacheWrite: 2 }
|
|
238
|
+
},
|
|
239
|
+
cost: {
|
|
240
|
+
inputPerMTok: 0.1,
|
|
241
|
+
outputPerMTok: 0.5,
|
|
242
|
+
cacheReadPerMTok: 0.01,
|
|
243
|
+
cacheWritePerMTok: 0.125
|
|
244
|
+
}
|
|
245
|
+
},
|
|
246
|
+
{
|
|
247
|
+
id: "gpt-6-sol",
|
|
248
|
+
provider: "openai",
|
|
249
|
+
api: "openai-responses",
|
|
250
|
+
displayName: "GPT-6 Sol",
|
|
251
|
+
baseUrl: "https://api.openai.com/v1",
|
|
252
|
+
contextWindow: 105e4,
|
|
253
|
+
maxOutputTokens: 128e3,
|
|
254
|
+
modalities: ["text", "image"],
|
|
255
|
+
reasoning: true,
|
|
256
|
+
reasoningEfforts: ["high"],
|
|
257
|
+
longContextPricing: {
|
|
258
|
+
threshold: 272e3,
|
|
259
|
+
multipliers: { input: 2, output: 1.5, cacheRead: 2, cacheWrite: 2 }
|
|
260
|
+
},
|
|
261
|
+
cost: {
|
|
262
|
+
inputPerMTok: 10,
|
|
263
|
+
outputPerMTok: 50,
|
|
264
|
+
cacheReadPerMTok: 1,
|
|
265
|
+
cacheWritePerMTok: 12.5
|
|
266
|
+
}
|
|
267
|
+
},
|
|
224
268
|
// ── Google (Gemini) ─────────────────────────────────────────────────────
|
|
225
269
|
{
|
|
226
270
|
id: "gemini-2.5-pro",
|
|
@@ -1821,10 +1865,11 @@ function buildBody2(model, c, opts) {
|
|
|
1821
1865
|
if (ceiling > 0) {
|
|
1822
1866
|
body.max_output_tokens = ceiling;
|
|
1823
1867
|
}
|
|
1824
|
-
|
|
1868
|
+
const usesFixedGpt6Sampling = ["gpt-6-astra", "gpt-6-sol", "gpt-6-luna"].includes(model.id);
|
|
1869
|
+
if (!usesFixedGpt6Sampling && opts.temperature !== void 0) {
|
|
1825
1870
|
body.temperature = opts.temperature;
|
|
1826
1871
|
}
|
|
1827
|
-
if (
|
|
1872
|
+
if (!usesFixedGpt6Sampling && opts.topP !== void 0) {
|
|
1828
1873
|
body.top_p = opts.topP;
|
|
1829
1874
|
}
|
|
1830
1875
|
if (model.reasoning && opts.thinking !== void 0 && opts.thinking !== "off") {
|
|
@@ -9616,8 +9661,96 @@ function platformOpenCommand(url) {
|
|
|
9616
9661
|
}
|
|
9617
9662
|
|
|
9618
9663
|
// src/facade/mcp-core/oauth/token-store.ts
|
|
9619
|
-
import {
|
|
9620
|
-
|
|
9664
|
+
import { join as join2 } from "node:path";
|
|
9665
|
+
|
|
9666
|
+
// src/security/private-state.ts
|
|
9667
|
+
import {
|
|
9668
|
+
chmodSync,
|
|
9669
|
+
closeSync,
|
|
9670
|
+
constants,
|
|
9671
|
+
fchmodSync,
|
|
9672
|
+
fstatSync,
|
|
9673
|
+
lstatSync,
|
|
9674
|
+
mkdirSync,
|
|
9675
|
+
openSync,
|
|
9676
|
+
readFileSync,
|
|
9677
|
+
renameSync,
|
|
9678
|
+
rmSync,
|
|
9679
|
+
writeFileSync
|
|
9680
|
+
} from "node:fs";
|
|
9681
|
+
import { randomUUID } from "node:crypto";
|
|
9682
|
+
import { dirname } from "node:path";
|
|
9683
|
+
var NO_FOLLOW = constants.O_NOFOLLOW ?? 0;
|
|
9684
|
+
var isPosix = () => process.platform !== "win32";
|
|
9685
|
+
function assertOwned(uid, path2) {
|
|
9686
|
+
if (!isPosix() || process.getuid === void 0) return;
|
|
9687
|
+
if (uid !== process.getuid()) throw new Error(`Refusing sensitive path not owned by the current user: ${path2}`);
|
|
9688
|
+
}
|
|
9689
|
+
function ensurePrivateDirectorySync(path2) {
|
|
9690
|
+
try {
|
|
9691
|
+
const current = lstatSync(path2);
|
|
9692
|
+
if (current.isSymbolicLink() || !current.isDirectory()) throw new Error(`Refusing non-directory sensitive state path: ${path2}`);
|
|
9693
|
+
assertOwned(current.uid, path2);
|
|
9694
|
+
} catch (error) {
|
|
9695
|
+
if (error.code !== "ENOENT") throw error;
|
|
9696
|
+
mkdirSync(path2, { recursive: true, mode: 448 });
|
|
9697
|
+
}
|
|
9698
|
+
if (isPosix()) chmodSync(path2, 448);
|
|
9699
|
+
}
|
|
9700
|
+
function validateExistingFile(path2) {
|
|
9701
|
+
try {
|
|
9702
|
+
const current = lstatSync(path2);
|
|
9703
|
+
if (current.isSymbolicLink() || !current.isFile()) throw new Error(`Refusing non-regular sensitive file: ${path2}`);
|
|
9704
|
+
assertOwned(current.uid, path2);
|
|
9705
|
+
} catch (error) {
|
|
9706
|
+
if (error.code === "ENOENT") return;
|
|
9707
|
+
throw error;
|
|
9708
|
+
}
|
|
9709
|
+
}
|
|
9710
|
+
function readPrivateFileSync(path2) {
|
|
9711
|
+
ensurePrivateDirectorySync(dirname(path2));
|
|
9712
|
+
validateExistingFile(path2);
|
|
9713
|
+
let fd;
|
|
9714
|
+
try {
|
|
9715
|
+
fd = openSync(path2, constants.O_RDONLY | NO_FOLLOW);
|
|
9716
|
+
} catch (error) {
|
|
9717
|
+
if (error.code === "ENOENT") return null;
|
|
9718
|
+
throw error;
|
|
9719
|
+
}
|
|
9720
|
+
try {
|
|
9721
|
+
const current = fstatSync(fd);
|
|
9722
|
+
if (!current.isFile()) throw new Error(`Refusing non-regular sensitive file: ${path2}`);
|
|
9723
|
+
assertOwned(current.uid, path2);
|
|
9724
|
+
if (isPosix()) fchmodSync(fd, 384);
|
|
9725
|
+
return readFileSync(fd, "utf8");
|
|
9726
|
+
} finally {
|
|
9727
|
+
closeSync(fd);
|
|
9728
|
+
}
|
|
9729
|
+
}
|
|
9730
|
+
function atomicWritePrivateFileSync(path2, content) {
|
|
9731
|
+
ensurePrivateDirectorySync(dirname(path2));
|
|
9732
|
+
validateExistingFile(path2);
|
|
9733
|
+
const temporary = `${path2}.tmp-${process.pid}-${randomUUID()}`;
|
|
9734
|
+
let fd;
|
|
9735
|
+
try {
|
|
9736
|
+
fd = openSync(temporary, constants.O_WRONLY | constants.O_CREAT | constants.O_EXCL | NO_FOLLOW, 384);
|
|
9737
|
+
writeFileSync(fd, content, "utf8");
|
|
9738
|
+
if (isPosix()) fchmodSync(fd, 384);
|
|
9739
|
+
closeSync(fd);
|
|
9740
|
+
fd = void 0;
|
|
9741
|
+
renameSync(temporary, path2);
|
|
9742
|
+
if (isPosix()) chmodSync(path2, 384);
|
|
9743
|
+
} catch (error) {
|
|
9744
|
+
if (fd !== void 0) closeSync(fd);
|
|
9745
|
+
try {
|
|
9746
|
+
rmSync(temporary, { force: true });
|
|
9747
|
+
} catch {
|
|
9748
|
+
}
|
|
9749
|
+
throw error;
|
|
9750
|
+
}
|
|
9751
|
+
}
|
|
9752
|
+
|
|
9753
|
+
// src/facade/mcp-core/oauth/token-store.ts
|
|
9621
9754
|
function defaultCredentialsDir() {
|
|
9622
9755
|
const xdg = process.env.XDG_CONFIG_HOME;
|
|
9623
9756
|
const home = process.env.HOME ?? process.env.USERPROFILE ?? "";
|
|
@@ -9634,10 +9767,11 @@ function credentialsPath(credentialsDir, id) {
|
|
|
9634
9767
|
}
|
|
9635
9768
|
function readMcpOAuthState(credentialsDir, id) {
|
|
9636
9769
|
const path2 = credentialsPath(credentialsDir, id);
|
|
9637
|
-
if (!existsSync(path2)) return void 0;
|
|
9638
9770
|
let raw;
|
|
9639
9771
|
try {
|
|
9640
|
-
|
|
9772
|
+
const stored = readPrivateFileSync(path2);
|
|
9773
|
+
if (stored === null) return void 0;
|
|
9774
|
+
raw = stored;
|
|
9641
9775
|
} catch (e) {
|
|
9642
9776
|
return void 0;
|
|
9643
9777
|
}
|
|
@@ -9652,15 +9786,8 @@ function readMcpOAuthState(credentialsDir, id) {
|
|
|
9652
9786
|
}
|
|
9653
9787
|
function writeMcpOAuthState(credentialsDir, state) {
|
|
9654
9788
|
const path2 = credentialsPath(credentialsDir, state.id);
|
|
9655
|
-
mkdirSync(dirname(path2), { recursive: true });
|
|
9656
|
-
const tmp = `${path2}.tmp-${process.pid}-${Date.now()}`;
|
|
9657
9789
|
const json = JSON.stringify({ ...state, updatedAt: Date.now() }, null, 2);
|
|
9658
|
-
|
|
9659
|
-
renameSync(tmp, path2);
|
|
9660
|
-
try {
|
|
9661
|
-
chmodSync(path2, 384);
|
|
9662
|
-
} catch {
|
|
9663
|
-
}
|
|
9790
|
+
atomicWritePrivateFileSync(path2, json);
|
|
9664
9791
|
}
|
|
9665
9792
|
function clearMcpOAuthState(credentialsDir, id) {
|
|
9666
9793
|
const path2 = credentialsPath(credentialsDir, id);
|
|
@@ -15587,9 +15714,9 @@ function formatToken(token, theme, highlight = null, listDepth = 0, orderedListN
|
|
|
15587
15714
|
const inner = (headingToken.tokens ?? []).map((child) => formatToken(child, theme, highlight)).join("");
|
|
15588
15715
|
const colored = theme.role("heading", inner);
|
|
15589
15716
|
if (headingToken.depth === 1) {
|
|
15590
|
-
return chalk2.bold.
|
|
15717
|
+
return chalk2.bold.underline(`${theme.role("heading", "\u25B0")} ${colored}`) + EOL;
|
|
15591
15718
|
}
|
|
15592
|
-
return chalk2.bold(colored) + EOL
|
|
15719
|
+
return chalk2.bold(`${theme.role("heading", "\u25C6")} ${colored}`) + EOL;
|
|
15593
15720
|
}
|
|
15594
15721
|
case "hr":
|
|
15595
15722
|
return "---";
|
|
@@ -15623,8 +15750,14 @@ function formatToken(token, theme, highlight = null, listDepth = 0, orderedListN
|
|
|
15623
15750
|
return (token.tokens ?? []).map(
|
|
15624
15751
|
(child) => `${" ".repeat(listDepth)}${formatToken(child, theme, highlight, listDepth + 1, orderedListNumber, token)}`
|
|
15625
15752
|
).join("");
|
|
15626
|
-
case "paragraph":
|
|
15627
|
-
|
|
15753
|
+
case "paragraph": {
|
|
15754
|
+
const children = token.tokens ?? [];
|
|
15755
|
+
const body = children.map((child) => formatToken(child, theme, highlight)).join("");
|
|
15756
|
+
if (children.length === 1 && children[0]?.type === "strong") {
|
|
15757
|
+
return `${theme.role("heading", "\u25C6")} ${body}${EOL}`;
|
|
15758
|
+
}
|
|
15759
|
+
return body + EOL;
|
|
15760
|
+
}
|
|
15628
15761
|
case "space":
|
|
15629
15762
|
case "br":
|
|
15630
15763
|
return EOL;
|
|
@@ -15634,7 +15767,7 @@ function formatToken(token, theme, highlight = null, listDepth = 0, orderedListN
|
|
|
15634
15767
|
return textToken.text;
|
|
15635
15768
|
}
|
|
15636
15769
|
if (parent?.type === "list_item") {
|
|
15637
|
-
const marker = orderedListNumber === null ? "
|
|
15770
|
+
const marker = orderedListNumber === null ? "\u2022" : `${getListNumber(listDepth, orderedListNumber)}.`;
|
|
15638
15771
|
const body = textToken.tokens ? textToken.tokens.map((child) => formatToken(child, theme, highlight, listDepth, orderedListNumber, token)).join("") : textToken.text;
|
|
15639
15772
|
return `${marker} ${body}${EOL}`;
|
|
15640
15773
|
}
|
package/dist/llmgateway.js
CHANGED
|
@@ -191,6 +191,50 @@ var MODEL_CARDS = [
|
|
|
191
191
|
cacheWritePerMTok: 12.5
|
|
192
192
|
}
|
|
193
193
|
},
|
|
194
|
+
{
|
|
195
|
+
id: "gpt-6-luna",
|
|
196
|
+
provider: "openai",
|
|
197
|
+
api: "openai-responses",
|
|
198
|
+
displayName: "GPT-6 Luna",
|
|
199
|
+
baseUrl: "https://api.openai.com/v1",
|
|
200
|
+
contextWindow: 105e4,
|
|
201
|
+
maxOutputTokens: 128e3,
|
|
202
|
+
modalities: ["text", "image"],
|
|
203
|
+
reasoning: true,
|
|
204
|
+
reasoningEfforts: ["low", "medium", "high", "xhigh", "max"],
|
|
205
|
+
longContextPricing: {
|
|
206
|
+
threshold: 272e3,
|
|
207
|
+
multipliers: { input: 2, output: 1.5, cacheRead: 2, cacheWrite: 2 }
|
|
208
|
+
},
|
|
209
|
+
cost: {
|
|
210
|
+
inputPerMTok: 0.1,
|
|
211
|
+
outputPerMTok: 0.5,
|
|
212
|
+
cacheReadPerMTok: 0.01,
|
|
213
|
+
cacheWritePerMTok: 0.125
|
|
214
|
+
}
|
|
215
|
+
},
|
|
216
|
+
{
|
|
217
|
+
id: "gpt-6-sol",
|
|
218
|
+
provider: "openai",
|
|
219
|
+
api: "openai-responses",
|
|
220
|
+
displayName: "GPT-6 Sol",
|
|
221
|
+
baseUrl: "https://api.openai.com/v1",
|
|
222
|
+
contextWindow: 105e4,
|
|
223
|
+
maxOutputTokens: 128e3,
|
|
224
|
+
modalities: ["text", "image"],
|
|
225
|
+
reasoning: true,
|
|
226
|
+
reasoningEfforts: ["high"],
|
|
227
|
+
longContextPricing: {
|
|
228
|
+
threshold: 272e3,
|
|
229
|
+
multipliers: { input: 2, output: 1.5, cacheRead: 2, cacheWrite: 2 }
|
|
230
|
+
},
|
|
231
|
+
cost: {
|
|
232
|
+
inputPerMTok: 10,
|
|
233
|
+
outputPerMTok: 50,
|
|
234
|
+
cacheReadPerMTok: 1,
|
|
235
|
+
cacheWritePerMTok: 12.5
|
|
236
|
+
}
|
|
237
|
+
},
|
|
194
238
|
// ── Google (Gemini) ─────────────────────────────────────────────────────
|
|
195
239
|
{
|
|
196
240
|
id: "gemini-2.5-pro",
|
|
@@ -1791,10 +1835,11 @@ function buildBody2(model, c, opts) {
|
|
|
1791
1835
|
if (ceiling > 0) {
|
|
1792
1836
|
body.max_output_tokens = ceiling;
|
|
1793
1837
|
}
|
|
1794
|
-
|
|
1838
|
+
const usesFixedGpt6Sampling = ["gpt-6-astra", "gpt-6-sol", "gpt-6-luna"].includes(model.id);
|
|
1839
|
+
if (!usesFixedGpt6Sampling && opts.temperature !== void 0) {
|
|
1795
1840
|
body.temperature = opts.temperature;
|
|
1796
1841
|
}
|
|
1797
|
-
if (
|
|
1842
|
+
if (!usesFixedGpt6Sampling && opts.topP !== void 0) {
|
|
1798
1843
|
body.top_p = opts.topP;
|
|
1799
1844
|
}
|
|
1800
1845
|
if (model.reasoning && opts.thinking !== void 0 && opts.thinking !== "off") {
|