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/mcp.js
CHANGED
|
@@ -1881,8 +1881,96 @@ function platformOpenCommand(url) {
|
|
|
1881
1881
|
}
|
|
1882
1882
|
|
|
1883
1883
|
// src/facade/mcp-core/oauth/token-store.ts
|
|
1884
|
-
import {
|
|
1885
|
-
|
|
1884
|
+
import { join as join2 } from "node:path";
|
|
1885
|
+
|
|
1886
|
+
// src/security/private-state.ts
|
|
1887
|
+
import {
|
|
1888
|
+
chmodSync,
|
|
1889
|
+
closeSync,
|
|
1890
|
+
constants,
|
|
1891
|
+
fchmodSync,
|
|
1892
|
+
fstatSync,
|
|
1893
|
+
lstatSync,
|
|
1894
|
+
mkdirSync as mkdirSync2,
|
|
1895
|
+
openSync,
|
|
1896
|
+
readFileSync as readFileSync2,
|
|
1897
|
+
renameSync,
|
|
1898
|
+
rmSync,
|
|
1899
|
+
writeFileSync as writeFileSync2
|
|
1900
|
+
} from "node:fs";
|
|
1901
|
+
import { randomUUID } from "node:crypto";
|
|
1902
|
+
import { dirname as dirname2 } from "node:path";
|
|
1903
|
+
var NO_FOLLOW = constants.O_NOFOLLOW ?? 0;
|
|
1904
|
+
var isPosix = () => process.platform !== "win32";
|
|
1905
|
+
function assertOwned(uid, path) {
|
|
1906
|
+
if (!isPosix() || process.getuid === void 0) return;
|
|
1907
|
+
if (uid !== process.getuid()) throw new Error(`Refusing sensitive path not owned by the current user: ${path}`);
|
|
1908
|
+
}
|
|
1909
|
+
function ensurePrivateDirectorySync(path) {
|
|
1910
|
+
try {
|
|
1911
|
+
const current = lstatSync(path);
|
|
1912
|
+
if (current.isSymbolicLink() || !current.isDirectory()) throw new Error(`Refusing non-directory sensitive state path: ${path}`);
|
|
1913
|
+
assertOwned(current.uid, path);
|
|
1914
|
+
} catch (error) {
|
|
1915
|
+
if (error.code !== "ENOENT") throw error;
|
|
1916
|
+
mkdirSync2(path, { recursive: true, mode: 448 });
|
|
1917
|
+
}
|
|
1918
|
+
if (isPosix()) chmodSync(path, 448);
|
|
1919
|
+
}
|
|
1920
|
+
function validateExistingFile(path) {
|
|
1921
|
+
try {
|
|
1922
|
+
const current = lstatSync(path);
|
|
1923
|
+
if (current.isSymbolicLink() || !current.isFile()) throw new Error(`Refusing non-regular sensitive file: ${path}`);
|
|
1924
|
+
assertOwned(current.uid, path);
|
|
1925
|
+
} catch (error) {
|
|
1926
|
+
if (error.code === "ENOENT") return;
|
|
1927
|
+
throw error;
|
|
1928
|
+
}
|
|
1929
|
+
}
|
|
1930
|
+
function readPrivateFileSync(path) {
|
|
1931
|
+
ensurePrivateDirectorySync(dirname2(path));
|
|
1932
|
+
validateExistingFile(path);
|
|
1933
|
+
let fd;
|
|
1934
|
+
try {
|
|
1935
|
+
fd = openSync(path, constants.O_RDONLY | NO_FOLLOW);
|
|
1936
|
+
} catch (error) {
|
|
1937
|
+
if (error.code === "ENOENT") return null;
|
|
1938
|
+
throw error;
|
|
1939
|
+
}
|
|
1940
|
+
try {
|
|
1941
|
+
const current = fstatSync(fd);
|
|
1942
|
+
if (!current.isFile()) throw new Error(`Refusing non-regular sensitive file: ${path}`);
|
|
1943
|
+
assertOwned(current.uid, path);
|
|
1944
|
+
if (isPosix()) fchmodSync(fd, 384);
|
|
1945
|
+
return readFileSync2(fd, "utf8");
|
|
1946
|
+
} finally {
|
|
1947
|
+
closeSync(fd);
|
|
1948
|
+
}
|
|
1949
|
+
}
|
|
1950
|
+
function atomicWritePrivateFileSync(path, content) {
|
|
1951
|
+
ensurePrivateDirectorySync(dirname2(path));
|
|
1952
|
+
validateExistingFile(path);
|
|
1953
|
+
const temporary = `${path}.tmp-${process.pid}-${randomUUID()}`;
|
|
1954
|
+
let fd;
|
|
1955
|
+
try {
|
|
1956
|
+
fd = openSync(temporary, constants.O_WRONLY | constants.O_CREAT | constants.O_EXCL | NO_FOLLOW, 384);
|
|
1957
|
+
writeFileSync2(fd, content, "utf8");
|
|
1958
|
+
if (isPosix()) fchmodSync(fd, 384);
|
|
1959
|
+
closeSync(fd);
|
|
1960
|
+
fd = void 0;
|
|
1961
|
+
renameSync(temporary, path);
|
|
1962
|
+
if (isPosix()) chmodSync(path, 384);
|
|
1963
|
+
} catch (error) {
|
|
1964
|
+
if (fd !== void 0) closeSync(fd);
|
|
1965
|
+
try {
|
|
1966
|
+
rmSync(temporary, { force: true });
|
|
1967
|
+
} catch {
|
|
1968
|
+
}
|
|
1969
|
+
throw error;
|
|
1970
|
+
}
|
|
1971
|
+
}
|
|
1972
|
+
|
|
1973
|
+
// src/facade/mcp-core/oauth/token-store.ts
|
|
1886
1974
|
function defaultCredentialsDir() {
|
|
1887
1975
|
const xdg = process.env.XDG_CONFIG_HOME;
|
|
1888
1976
|
const home = process.env.HOME ?? process.env.USERPROFILE ?? "";
|
|
@@ -1899,10 +1987,11 @@ function credentialsPath(credentialsDir, id) {
|
|
|
1899
1987
|
}
|
|
1900
1988
|
function readMcpOAuthState(credentialsDir, id) {
|
|
1901
1989
|
const path = credentialsPath(credentialsDir, id);
|
|
1902
|
-
if (!existsSync2(path)) return void 0;
|
|
1903
1990
|
let raw;
|
|
1904
1991
|
try {
|
|
1905
|
-
|
|
1992
|
+
const stored = readPrivateFileSync(path);
|
|
1993
|
+
if (stored === null) return void 0;
|
|
1994
|
+
raw = stored;
|
|
1906
1995
|
} catch (e) {
|
|
1907
1996
|
return void 0;
|
|
1908
1997
|
}
|
|
@@ -1917,15 +2006,8 @@ function readMcpOAuthState(credentialsDir, id) {
|
|
|
1917
2006
|
}
|
|
1918
2007
|
function writeMcpOAuthState(credentialsDir, state) {
|
|
1919
2008
|
const path = credentialsPath(credentialsDir, state.id);
|
|
1920
|
-
mkdirSync2(dirname2(path), { recursive: true });
|
|
1921
|
-
const tmp = `${path}.tmp-${process.pid}-${Date.now()}`;
|
|
1922
2009
|
const json = JSON.stringify({ ...state, updatedAt: Date.now() }, null, 2);
|
|
1923
|
-
|
|
1924
|
-
renameSync(tmp, path);
|
|
1925
|
-
try {
|
|
1926
|
-
chmodSync(path, 384);
|
|
1927
|
-
} catch {
|
|
1928
|
-
}
|
|
2010
|
+
atomicWritePrivateFileSync(path, json);
|
|
1929
2011
|
}
|
|
1930
2012
|
function clearMcpOAuthState(credentialsDir, id) {
|
|
1931
2013
|
const path = credentialsPath(credentialsDir, id);
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
// src/react-host/loader.ts
|
|
2
|
+
import { createRequire } from "node:module";
|
|
3
|
+
import fs from "node:fs";
|
|
4
|
+
import path from "node:path";
|
|
5
|
+
import { fileURLToPath, pathToFileURL } from "node:url";
|
|
6
|
+
function findPackageRoot(start) {
|
|
7
|
+
let current = path.resolve(start);
|
|
8
|
+
while (true) {
|
|
9
|
+
const packageJson = path.join(current, "package.json");
|
|
10
|
+
if (fs.existsSync(packageJson)) {
|
|
11
|
+
return current;
|
|
12
|
+
}
|
|
13
|
+
const parent = path.dirname(current);
|
|
14
|
+
if (parent === current) {
|
|
15
|
+
return null;
|
|
16
|
+
}
|
|
17
|
+
current = parent;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
function createPackageRequire(packageRoot) {
|
|
21
|
+
return createRequire(path.join(packageRoot, "package.json"));
|
|
22
|
+
}
|
|
23
|
+
function candidatePackageRoots() {
|
|
24
|
+
const roots = /* @__PURE__ */ new Set();
|
|
25
|
+
const addCandidate = (candidate) => {
|
|
26
|
+
if (!candidate) {
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
const root = findPackageRoot(candidate);
|
|
30
|
+
if (root) {
|
|
31
|
+
roots.add(root);
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
const argv1 = process.argv[1];
|
|
35
|
+
let argv1Real;
|
|
36
|
+
if (argv1) {
|
|
37
|
+
try {
|
|
38
|
+
argv1Real = fs.realpathSync(argv1);
|
|
39
|
+
} catch {
|
|
40
|
+
argv1Real = argv1;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
const packageRoot = fileURLToPath(new URL("../../..", import.meta.url));
|
|
44
|
+
addCandidate(process.env.INDUSAGI_REACT_HOST_ROOT);
|
|
45
|
+
addCandidate(argv1Real ? path.dirname(argv1Real) : void 0);
|
|
46
|
+
addCandidate(argv1 ? path.dirname(argv1) : void 0);
|
|
47
|
+
addCandidate(process.env.INIT_CWD);
|
|
48
|
+
addCandidate(process.cwd());
|
|
49
|
+
addCandidate(packageRoot);
|
|
50
|
+
return [...roots];
|
|
51
|
+
}
|
|
52
|
+
function resolveHostModule(specifier) {
|
|
53
|
+
const failures = [];
|
|
54
|
+
for (const packageRoot of candidatePackageRoots()) {
|
|
55
|
+
try {
|
|
56
|
+
return createPackageRequire(packageRoot).resolve(specifier);
|
|
57
|
+
} catch (error) {
|
|
58
|
+
failures.push(`${packageRoot}: ${String(error.message ?? error)}`);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
throw new Error(
|
|
62
|
+
`Unable to resolve host module "${specifier}" from any detected package root.
|
|
63
|
+
${failures.join("\n")}`
|
|
64
|
+
);
|
|
65
|
+
}
|
|
66
|
+
function normalizeModuleNamespace(moduleNamespace) {
|
|
67
|
+
const defaultExport = moduleNamespace.default;
|
|
68
|
+
if (defaultExport && typeof defaultExport === "object") {
|
|
69
|
+
return { ...defaultExport, ...moduleNamespace };
|
|
70
|
+
}
|
|
71
|
+
return moduleNamespace;
|
|
72
|
+
}
|
|
73
|
+
async function importHostModule(specifier) {
|
|
74
|
+
const resolved = resolveHostModule(specifier);
|
|
75
|
+
const moduleNamespace = await import(pathToFileURL(resolved).href);
|
|
76
|
+
return normalizeModuleNamespace(moduleNamespace);
|
|
77
|
+
}
|
|
78
|
+
var jsxDevRuntimeInstance = null;
|
|
79
|
+
function loadHostJsxDevRuntime() {
|
|
80
|
+
if (!jsxDevRuntimeInstance) {
|
|
81
|
+
jsxDevRuntimeInstance = importHostModule("react/jsx-dev-runtime");
|
|
82
|
+
}
|
|
83
|
+
return jsxDevRuntimeInstance;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
// src/react-host/jsx-dev-runtime.ts
|
|
87
|
+
var jsxDevRuntime = await loadHostJsxDevRuntime();
|
|
88
|
+
var Fragment = jsxDevRuntime.Fragment;
|
|
89
|
+
var jsxDEV = jsxDevRuntime.jsxDEV;
|
|
90
|
+
export {
|
|
91
|
+
Fragment,
|
|
92
|
+
jsxDEV
|
|
93
|
+
};
|
package/dist/react-ink.js
CHANGED
|
@@ -1209,9 +1209,9 @@ function formatToken(token, theme, highlight = null, listDepth = 0, orderedListN
|
|
|
1209
1209
|
const inner = (headingToken.tokens ?? []).map((child) => formatToken(child, theme, highlight)).join("");
|
|
1210
1210
|
const colored = theme.role("heading", inner);
|
|
1211
1211
|
if (headingToken.depth === 1) {
|
|
1212
|
-
return chalk2.bold.
|
|
1212
|
+
return chalk2.bold.underline(`${theme.role("heading", "\u25B0")} ${colored}`) + EOL;
|
|
1213
1213
|
}
|
|
1214
|
-
return chalk2.bold(colored) + EOL
|
|
1214
|
+
return chalk2.bold(`${theme.role("heading", "\u25C6")} ${colored}`) + EOL;
|
|
1215
1215
|
}
|
|
1216
1216
|
case "hr":
|
|
1217
1217
|
return "---";
|
|
@@ -1245,8 +1245,14 @@ function formatToken(token, theme, highlight = null, listDepth = 0, orderedListN
|
|
|
1245
1245
|
return (token.tokens ?? []).map(
|
|
1246
1246
|
(child) => `${" ".repeat(listDepth)}${formatToken(child, theme, highlight, listDepth + 1, orderedListNumber, token)}`
|
|
1247
1247
|
).join("");
|
|
1248
|
-
case "paragraph":
|
|
1249
|
-
|
|
1248
|
+
case "paragraph": {
|
|
1249
|
+
const children = token.tokens ?? [];
|
|
1250
|
+
const body = children.map((child) => formatToken(child, theme, highlight)).join("");
|
|
1251
|
+
if (children.length === 1 && children[0]?.type === "strong") {
|
|
1252
|
+
return `${theme.role("heading", "\u25C6")} ${body}${EOL}`;
|
|
1253
|
+
}
|
|
1254
|
+
return body + EOL;
|
|
1255
|
+
}
|
|
1250
1256
|
case "space":
|
|
1251
1257
|
case "br":
|
|
1252
1258
|
return EOL;
|
|
@@ -1256,7 +1262,7 @@ function formatToken(token, theme, highlight = null, listDepth = 0, orderedListN
|
|
|
1256
1262
|
return textToken.text;
|
|
1257
1263
|
}
|
|
1258
1264
|
if (parent?.type === "list_item") {
|
|
1259
|
-
const marker = orderedListNumber === null ? "
|
|
1265
|
+
const marker = orderedListNumber === null ? "\u2022" : `${getListNumber(listDepth, orderedListNumber)}.`;
|
|
1260
1266
|
const body = textToken.tokens ? textToken.tokens.map((child) => formatToken(child, theme, highlight, listDepth, orderedListNumber, token)).join("") : textToken.text;
|
|
1261
1267
|
return `${marker} ${body}${EOL}`;
|
|
1262
1268
|
}
|
package/dist/runtime.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",
|
|
@@ -1734,10 +1778,11 @@ function buildBody2(model, c, opts) {
|
|
|
1734
1778
|
if (ceiling > 0) {
|
|
1735
1779
|
body.max_output_tokens = ceiling;
|
|
1736
1780
|
}
|
|
1737
|
-
|
|
1781
|
+
const usesFixedGpt6Sampling = ["gpt-6-astra", "gpt-6-sol", "gpt-6-luna"].includes(model.id);
|
|
1782
|
+
if (!usesFixedGpt6Sampling && opts.temperature !== void 0) {
|
|
1738
1783
|
body.temperature = opts.temperature;
|
|
1739
1784
|
}
|
|
1740
|
-
if (
|
|
1785
|
+
if (!usesFixedGpt6Sampling && opts.topP !== void 0) {
|
|
1741
1786
|
body.top_p = opts.topP;
|
|
1742
1787
|
}
|
|
1743
1788
|
if (model.reasoning && opts.thinking !== void 0 && opts.thinking !== "off") {
|
package/dist/shell-app.js
CHANGED
|
@@ -430,6 +430,50 @@ var MODEL_CARDS = [
|
|
|
430
430
|
cacheWritePerMTok: 12.5
|
|
431
431
|
}
|
|
432
432
|
},
|
|
433
|
+
{
|
|
434
|
+
id: "gpt-6-luna",
|
|
435
|
+
provider: "openai",
|
|
436
|
+
api: "openai-responses",
|
|
437
|
+
displayName: "GPT-6 Luna",
|
|
438
|
+
baseUrl: "https://api.openai.com/v1",
|
|
439
|
+
contextWindow: 105e4,
|
|
440
|
+
maxOutputTokens: 128e3,
|
|
441
|
+
modalities: ["text", "image"],
|
|
442
|
+
reasoning: true,
|
|
443
|
+
reasoningEfforts: ["low", "medium", "high", "xhigh", "max"],
|
|
444
|
+
longContextPricing: {
|
|
445
|
+
threshold: 272e3,
|
|
446
|
+
multipliers: { input: 2, output: 1.5, cacheRead: 2, cacheWrite: 2 }
|
|
447
|
+
},
|
|
448
|
+
cost: {
|
|
449
|
+
inputPerMTok: 0.1,
|
|
450
|
+
outputPerMTok: 0.5,
|
|
451
|
+
cacheReadPerMTok: 0.01,
|
|
452
|
+
cacheWritePerMTok: 0.125
|
|
453
|
+
}
|
|
454
|
+
},
|
|
455
|
+
{
|
|
456
|
+
id: "gpt-6-sol",
|
|
457
|
+
provider: "openai",
|
|
458
|
+
api: "openai-responses",
|
|
459
|
+
displayName: "GPT-6 Sol",
|
|
460
|
+
baseUrl: "https://api.openai.com/v1",
|
|
461
|
+
contextWindow: 105e4,
|
|
462
|
+
maxOutputTokens: 128e3,
|
|
463
|
+
modalities: ["text", "image"],
|
|
464
|
+
reasoning: true,
|
|
465
|
+
reasoningEfforts: ["high"],
|
|
466
|
+
longContextPricing: {
|
|
467
|
+
threshold: 272e3,
|
|
468
|
+
multipliers: { input: 2, output: 1.5, cacheRead: 2, cacheWrite: 2 }
|
|
469
|
+
},
|
|
470
|
+
cost: {
|
|
471
|
+
inputPerMTok: 10,
|
|
472
|
+
outputPerMTok: 50,
|
|
473
|
+
cacheReadPerMTok: 1,
|
|
474
|
+
cacheWritePerMTok: 12.5
|
|
475
|
+
}
|
|
476
|
+
},
|
|
433
477
|
// ── Google (Gemini) ─────────────────────────────────────────────────────
|
|
434
478
|
{
|
|
435
479
|
id: "gemini-2.5-pro",
|
|
@@ -1989,10 +2033,11 @@ function buildBody2(model, c, opts) {
|
|
|
1989
2033
|
if (ceiling > 0) {
|
|
1990
2034
|
body.max_output_tokens = ceiling;
|
|
1991
2035
|
}
|
|
1992
|
-
|
|
2036
|
+
const usesFixedGpt6Sampling = ["gpt-6-astra", "gpt-6-sol", "gpt-6-luna"].includes(model.id);
|
|
2037
|
+
if (!usesFixedGpt6Sampling && opts.temperature !== void 0) {
|
|
1993
2038
|
body.temperature = opts.temperature;
|
|
1994
2039
|
}
|
|
1995
|
-
if (
|
|
2040
|
+
if (!usesFixedGpt6Sampling && opts.topP !== void 0) {
|
|
1996
2041
|
body.top_p = opts.topP;
|
|
1997
2042
|
}
|
|
1998
2043
|
if (model.reasoning && opts.thinking !== void 0 && opts.thinking !== "off") {
|
|
@@ -9803,9 +9848,9 @@ function formatToken(token, theme, highlight = null, listDepth = 0, orderedListN
|
|
|
9803
9848
|
const inner = (headingToken.tokens ?? []).map((child) => formatToken(child, theme, highlight)).join("");
|
|
9804
9849
|
const colored = theme.role("heading", inner);
|
|
9805
9850
|
if (headingToken.depth === 1) {
|
|
9806
|
-
return chalk2.bold.
|
|
9851
|
+
return chalk2.bold.underline(`${theme.role("heading", "\u25B0")} ${colored}`) + EOL;
|
|
9807
9852
|
}
|
|
9808
|
-
return chalk2.bold(colored) + EOL
|
|
9853
|
+
return chalk2.bold(`${theme.role("heading", "\u25C6")} ${colored}`) + EOL;
|
|
9809
9854
|
}
|
|
9810
9855
|
case "hr":
|
|
9811
9856
|
return "---";
|
|
@@ -9839,8 +9884,14 @@ function formatToken(token, theme, highlight = null, listDepth = 0, orderedListN
|
|
|
9839
9884
|
return (token.tokens ?? []).map(
|
|
9840
9885
|
(child) => `${" ".repeat(listDepth)}${formatToken(child, theme, highlight, listDepth + 1, orderedListNumber, token)}`
|
|
9841
9886
|
).join("");
|
|
9842
|
-
case "paragraph":
|
|
9843
|
-
|
|
9887
|
+
case "paragraph": {
|
|
9888
|
+
const children = token.tokens ?? [];
|
|
9889
|
+
const body = children.map((child) => formatToken(child, theme, highlight)).join("");
|
|
9890
|
+
if (children.length === 1 && children[0]?.type === "strong") {
|
|
9891
|
+
return `${theme.role("heading", "\u25C6")} ${body}${EOL}`;
|
|
9892
|
+
}
|
|
9893
|
+
return body + EOL;
|
|
9894
|
+
}
|
|
9844
9895
|
case "space":
|
|
9845
9896
|
case "br":
|
|
9846
9897
|
return EOL;
|
|
@@ -9850,7 +9901,7 @@ function formatToken(token, theme, highlight = null, listDepth = 0, orderedListN
|
|
|
9850
9901
|
return textToken.text;
|
|
9851
9902
|
}
|
|
9852
9903
|
if (parent?.type === "list_item") {
|
|
9853
|
-
const marker = orderedListNumber === null ? "
|
|
9904
|
+
const marker = orderedListNumber === null ? "\u2022" : `${getListNumber(listDepth, orderedListNumber)}.`;
|
|
9854
9905
|
const body = textToken.tokens ? textToken.tokens.map((child) => formatToken(child, theme, highlight, listDepth, orderedListNumber, token)).join("") : textToken.text;
|
|
9855
9906
|
return `${marker} ${body}${EOL}`;
|
|
9856
9907
|
}
|
package/dist/smithy.js
CHANGED
|
@@ -3671,6 +3671,50 @@ var MODEL_CARDS = [
|
|
|
3671
3671
|
cacheWritePerMTok: 12.5
|
|
3672
3672
|
}
|
|
3673
3673
|
},
|
|
3674
|
+
{
|
|
3675
|
+
id: "gpt-6-luna",
|
|
3676
|
+
provider: "openai",
|
|
3677
|
+
api: "openai-responses",
|
|
3678
|
+
displayName: "GPT-6 Luna",
|
|
3679
|
+
baseUrl: "https://api.openai.com/v1",
|
|
3680
|
+
contextWindow: 105e4,
|
|
3681
|
+
maxOutputTokens: 128e3,
|
|
3682
|
+
modalities: ["text", "image"],
|
|
3683
|
+
reasoning: true,
|
|
3684
|
+
reasoningEfforts: ["low", "medium", "high", "xhigh", "max"],
|
|
3685
|
+
longContextPricing: {
|
|
3686
|
+
threshold: 272e3,
|
|
3687
|
+
multipliers: { input: 2, output: 1.5, cacheRead: 2, cacheWrite: 2 }
|
|
3688
|
+
},
|
|
3689
|
+
cost: {
|
|
3690
|
+
inputPerMTok: 0.1,
|
|
3691
|
+
outputPerMTok: 0.5,
|
|
3692
|
+
cacheReadPerMTok: 0.01,
|
|
3693
|
+
cacheWritePerMTok: 0.125
|
|
3694
|
+
}
|
|
3695
|
+
},
|
|
3696
|
+
{
|
|
3697
|
+
id: "gpt-6-sol",
|
|
3698
|
+
provider: "openai",
|
|
3699
|
+
api: "openai-responses",
|
|
3700
|
+
displayName: "GPT-6 Sol",
|
|
3701
|
+
baseUrl: "https://api.openai.com/v1",
|
|
3702
|
+
contextWindow: 105e4,
|
|
3703
|
+
maxOutputTokens: 128e3,
|
|
3704
|
+
modalities: ["text", "image"],
|
|
3705
|
+
reasoning: true,
|
|
3706
|
+
reasoningEfforts: ["high"],
|
|
3707
|
+
longContextPricing: {
|
|
3708
|
+
threshold: 272e3,
|
|
3709
|
+
multipliers: { input: 2, output: 1.5, cacheRead: 2, cacheWrite: 2 }
|
|
3710
|
+
},
|
|
3711
|
+
cost: {
|
|
3712
|
+
inputPerMTok: 10,
|
|
3713
|
+
outputPerMTok: 50,
|
|
3714
|
+
cacheReadPerMTok: 1,
|
|
3715
|
+
cacheWritePerMTok: 12.5
|
|
3716
|
+
}
|
|
3717
|
+
},
|
|
3674
3718
|
// ── Google (Gemini) ─────────────────────────────────────────────────────
|
|
3675
3719
|
{
|
|
3676
3720
|
id: "gemini-2.5-pro",
|
|
@@ -5214,10 +5258,11 @@ function buildBody2(model, c, opts) {
|
|
|
5214
5258
|
if (ceiling > 0) {
|
|
5215
5259
|
body.max_output_tokens = ceiling;
|
|
5216
5260
|
}
|
|
5217
|
-
|
|
5261
|
+
const usesFixedGpt6Sampling = ["gpt-6-astra", "gpt-6-sol", "gpt-6-luna"].includes(model.id);
|
|
5262
|
+
if (!usesFixedGpt6Sampling && opts.temperature !== void 0) {
|
|
5218
5263
|
body.temperature = opts.temperature;
|
|
5219
5264
|
}
|
|
5220
|
-
if (
|
|
5265
|
+
if (!usesFixedGpt6Sampling && opts.topP !== void 0) {
|
|
5221
5266
|
body.top_p = opts.topP;
|
|
5222
5267
|
}
|
|
5223
5268
|
if (model.reasoning && opts.thinking !== void 0 && opts.thinking !== "off") {
|
package/dist/swarm.js
CHANGED
|
@@ -194,6 +194,50 @@ var MODEL_CARDS = [
|
|
|
194
194
|
cacheWritePerMTok: 12.5
|
|
195
195
|
}
|
|
196
196
|
},
|
|
197
|
+
{
|
|
198
|
+
id: "gpt-6-luna",
|
|
199
|
+
provider: "openai",
|
|
200
|
+
api: "openai-responses",
|
|
201
|
+
displayName: "GPT-6 Luna",
|
|
202
|
+
baseUrl: "https://api.openai.com/v1",
|
|
203
|
+
contextWindow: 105e4,
|
|
204
|
+
maxOutputTokens: 128e3,
|
|
205
|
+
modalities: ["text", "image"],
|
|
206
|
+
reasoning: true,
|
|
207
|
+
reasoningEfforts: ["low", "medium", "high", "xhigh", "max"],
|
|
208
|
+
longContextPricing: {
|
|
209
|
+
threshold: 272e3,
|
|
210
|
+
multipliers: { input: 2, output: 1.5, cacheRead: 2, cacheWrite: 2 }
|
|
211
|
+
},
|
|
212
|
+
cost: {
|
|
213
|
+
inputPerMTok: 0.1,
|
|
214
|
+
outputPerMTok: 0.5,
|
|
215
|
+
cacheReadPerMTok: 0.01,
|
|
216
|
+
cacheWritePerMTok: 0.125
|
|
217
|
+
}
|
|
218
|
+
},
|
|
219
|
+
{
|
|
220
|
+
id: "gpt-6-sol",
|
|
221
|
+
provider: "openai",
|
|
222
|
+
api: "openai-responses",
|
|
223
|
+
displayName: "GPT-6 Sol",
|
|
224
|
+
baseUrl: "https://api.openai.com/v1",
|
|
225
|
+
contextWindow: 105e4,
|
|
226
|
+
maxOutputTokens: 128e3,
|
|
227
|
+
modalities: ["text", "image"],
|
|
228
|
+
reasoning: true,
|
|
229
|
+
reasoningEfforts: ["high"],
|
|
230
|
+
longContextPricing: {
|
|
231
|
+
threshold: 272e3,
|
|
232
|
+
multipliers: { input: 2, output: 1.5, cacheRead: 2, cacheWrite: 2 }
|
|
233
|
+
},
|
|
234
|
+
cost: {
|
|
235
|
+
inputPerMTok: 10,
|
|
236
|
+
outputPerMTok: 50,
|
|
237
|
+
cacheReadPerMTok: 1,
|
|
238
|
+
cacheWritePerMTok: 12.5
|
|
239
|
+
}
|
|
240
|
+
},
|
|
197
241
|
// ── Google (Gemini) ─────────────────────────────────────────────────────
|
|
198
242
|
{
|
|
199
243
|
id: "gemini-2.5-pro",
|
|
@@ -1737,10 +1781,11 @@ function buildBody2(model, c, opts) {
|
|
|
1737
1781
|
if (ceiling > 0) {
|
|
1738
1782
|
body.max_output_tokens = ceiling;
|
|
1739
1783
|
}
|
|
1740
|
-
|
|
1784
|
+
const usesFixedGpt6Sampling = ["gpt-6-astra", "gpt-6-sol", "gpt-6-luna"].includes(model.id);
|
|
1785
|
+
if (!usesFixedGpt6Sampling && opts.temperature !== void 0) {
|
|
1741
1786
|
body.temperature = opts.temperature;
|
|
1742
1787
|
}
|
|
1743
|
-
if (
|
|
1788
|
+
if (!usesFixedGpt6Sampling && opts.topP !== void 0) {
|
|
1744
1789
|
body.top_p = opts.topP;
|
|
1745
1790
|
}
|
|
1746
1791
|
if (model.reasoning && opts.thinking !== void 0 && opts.thinking !== "off") {
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { OAuthCredentials } from "./kit/auth/types.js";
|
|
2
|
+
export type AuthStore = Record<string, {
|
|
3
|
+
type: "oauth";
|
|
4
|
+
} & OAuthCredentials>;
|
|
5
|
+
export declare function resolveAuthFile(home?: string): string;
|
|
6
|
+
export declare function loadAuthStore(path?: string): AuthStore;
|
|
7
|
+
export declare function saveAuthStore(auth: AuthStore, path?: string): void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|