@xiaoso/dsh-tool-plus 0.1.7 → 0.1.8-beta.2
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/lib/{abort-Caqff3M6.mjs → abort-BtBy5Svf.mjs} +1 -1
- package/lib/{alibaba-coding-plan-DTupMiAi.mjs → alibaba-coding-plan-oxHCHJtG.mjs} +2 -2
- package/lib/{alibaba-token-plan-Dj3OZhEE.mjs → alibaba-token-plan-B0WzvYnB.mjs} +2 -2
- package/lib/{amazon-bedrock-DbFSYXfJ.mjs → amazon-bedrock-BvfYGhrD.mjs} +6 -6
- package/lib/{anthropic-CXfWlp-x.mjs → anthropic-C6-vdduI.mjs} +1 -1
- package/lib/{anthropic-CTJ3IQVa.mjs → anthropic-Id561lwb.mjs} +13 -13
- package/lib/{anthropic-wire-CKuhDwZ1.mjs → anthropic-wire-Cb8AQ1tS.mjs} +13 -13
- package/lib/{api-key-validation-CGCJFbFr.mjs → api-key-validation-BXJKlsJg.mjs} +1 -1
- package/lib/{azure-openai-responses-ChFbWaGj.mjs → azure-openai-responses-CGws_ijz.mjs} +8 -8
- package/lib/{browser-render-9o0Rknop.mjs → browser-render-i7uYOl4f.mjs} +2 -2
- package/lib/client.js +2045 -19
- package/lib/{cloudflare-ai-gateway-BupNXyKK.mjs → cloudflare-ai-gateway-BK6eadm9.mjs} +2 -2
- package/lib/{cloudflare-ai-gateway-EWo0VkP5.mjs → cloudflare-ai-gateway-B_kWnF30.mjs} +1 -1
- package/lib/{collapse-DOR8sOGf.mjs → collapse-DU3g7d3B.mjs} +1 -1
- package/lib/{coreweave-Ct8cF-da.mjs → coreweave-CkR_FlQi.mjs} +2 -2
- package/lib/{cursor-LKGjucn2.mjs → cursor-BXx_5h4a.mjs} +2 -2
- package/lib/{cursor-DJV_dcgB.mjs → cursor-BcHwv8qq.mjs} +10 -10
- package/lib/{cursor-B95LzVWV.mjs → cursor-BjWbJJLe.mjs} +1 -1
- package/lib/{cursor-proto-B8Wj8bv9.mjs → cursor-proto-DPXXYx8S.mjs} +1 -1
- package/lib/{devin-DSp0Rw_E.mjs → devin-BZBfzyIz.mjs} +6 -6
- package/lib/{devin-BMTdx_hx.mjs → devin-Ce3Wz8_E.mjs} +5 -5
- package/lib/{devin-proto-Br8fdyNl.mjs → devin-proto-B6HwDwHK.mjs} +1 -1
- package/lib/{error-CORgGg5a.mjs → error-DdCn4m1q.mjs} +3 -3
- package/lib/{event-stream-ulcDenZD.mjs → event-stream-ldcUvOA0.mjs} +1 -1
- package/lib/{github-copilot-Dstq1D3s.mjs → github-copilot-BT5dkIJl.mjs} +2 -2
- package/lib/{github-copilot-headers-DOh1gt_w.mjs → github-copilot-headers-BGL8JO5c.mjs} +2 -2
- package/lib/{gitlab-duo-DSCMrU0m.mjs → gitlab-duo-B0qSYCa3.mjs} +1 -1
- package/lib/{google-CtsKkOQK.mjs → google-6cRgRmh0.mjs} +3 -3
- package/lib/{google-antigravity-z-5KsEci.mjs → google-antigravity-D1llOVad.mjs} +3 -3
- package/lib/{google-auth-ieLBaneO.mjs → google-auth-DYhqX1rJ.mjs} +5 -5
- package/lib/{google-gemini-cli-CAIPSl7e.mjs → google-gemini-cli-ByQUuKp9.mjs} +7 -7
- package/lib/{google-gemini-cli-C6NE5mWz.mjs → google-gemini-cli-CjHy6mFG.mjs} +3 -3
- package/lib/{google-oauth-shared-DhMllAkt.mjs → google-oauth-shared-CSwCT0Yl.mjs} +1 -1
- package/lib/{google-shared-B0aNCYEH.mjs → google-shared-DYjJp0mQ.mjs} +5 -5
- package/lib/{google-vertex-Bbd1tYNc.mjs → google-vertex-CbOvlE5j.mjs} +4 -4
- package/lib/{idle-iterator-DlUkEfzW.mjs → idle-iterator-DTBaEIbM.mjs} +2 -2
- package/lib/index.mjs +1278 -184
- package/lib/{kilo-ChJL54wq.mjs → kilo-cVG1aNZM.mjs} +1 -1
- package/lib/{kimi-C2c_Zq8A.mjs → kimi-BFfnFDhu.mjs} +4 -4
- package/lib/{launch-DKDH71En.mjs → launch-Uq7920ng.mjs} +7 -7
- package/lib/{markit-CmRfm4E2.mjs → markit-BmsfOFVh.mjs} +18 -18
- package/lib/{muse-code-Di1VZmB1.mjs → muse-code-CtcevJab.mjs} +1 -1
- package/lib/{ollama-B8ic3sEp.mjs → ollama-B5hR1P1p.mjs} +8 -8
- package/lib/{openai-codex-DuJNC99x.mjs → openai-codex-CxkPyvyt.mjs} +2 -2
- package/lib/{openai-codex-responses-BL29nh9K.mjs → openai-codex-responses-BbM3Q7nJ.mjs} +9 -9
- package/lib/{openai-completions-BK2f2dBv.mjs → openai-completions-CffXVOCL.mjs} +13 -13
- package/lib/{openai-reasoning-fallback-BdB3RCbj.mjs → openai-reasoning-fallback-DFdD1ok5.mjs} +2 -2
- package/lib/{openai-responses-CGQPlIIy.mjs → openai-responses-DgqOvSn_.mjs} +9 -9
- package/lib/{perplexity-TBjz3VMB.mjs → perplexity-JFp3knZN.mjs} +2 -2
- package/lib/{protobuf-aab1UGVn.mjs → protobuf-BJHNU9-E.mjs} +1 -1
- package/lib/{proxy-5nWqRL1f.mjs → proxy-B51IWEMt.mjs} +2 -2
- package/lib/{scrapers-CtQrQ5kG.mjs → scrapers-DU4u4-Co.mjs} +7 -7
- package/lib/{src-BwW51vA5.mjs → src-DUUqyo9y.mjs} +42 -42
- package/lib/{stream-B_7qN-bA.mjs → stream-DHdFrAG4.mjs} +54 -54
- package/lib/{stream-markup-healing-DKT1lnkW.mjs → stream-markup-healing-DlJ9abTw.mjs} +2 -2
- package/lib/{thinking-CiLa2LFB.mjs → thinking-D6LJxkz_.mjs} +1 -1
- package/lib/types/client/locales.d.ts +1 -1
- package/lib/types/config/settings.d.ts +8 -0
- package/lib/types/tools/ast-grep/adapter/index.d.ts +23 -0
- package/lib/types/tools/edit/adapter/index.d.ts +3 -0
- package/lib/types/tools/glob/adapter/index.d.ts +2 -0
- package/lib/types/tools/grep/adapter/index.d.ts +4 -0
- package/lib/types/tools/read/adapter/index.d.ts +18 -0
- package/lib/types/tools/write/adapter/index.d.ts +2 -0
- package/lib/types/web/client/ToolCardShell.d.ts +111 -0
- package/lib/types/web/client/labels.d.ts +36 -0
- package/lib/types/web/client/registerToolCards.d.ts +35 -0
- package/lib/types/web/client/row-utils.d.ts +177 -0
- package/lib/types/web/client/rows/AstEditRow.d.ts +22 -0
- package/lib/types/web/client/rows/FileMutationRow.d.ts +23 -0
- package/lib/types/web/client/rows/ReadRow.d.ts +31 -0
- package/lib/types/web/client/rows/SearchRow.d.ts +21 -0
- package/lib/types/web/client/rows/TerminalRow.d.ts +24 -0
- package/lib/types/web/client/rows/WriteRow.d.ts +22 -0
- package/lib/types/web/client/rows/image-card.d.ts +60 -0
- package/lib/types/web/contract.d.ts +249 -0
- package/lib/types/web/host/ast-edit.d.ts +10 -0
- package/lib/types/web/host/bash.d.ts +30 -0
- package/lib/types/web/host/edit.d.ts +33 -0
- package/lib/types/web/host/read.d.ts +48 -0
- package/lib/types/web/host/search.d.ts +41 -0
- package/lib/types/web/host/write.d.ts +13 -0
- package/lib/{types-PVueGi9S.mjs → types-DT9vgZ3S.mjs} +1 -1
- package/lib/{utils-CUPhpw9A.mjs → utils-BMmwLB0f.mjs} +2 -2
- package/lib/{utils-ECAwvaPQ.mjs → utils-C-Lo_JC6.mjs} +41 -41
- package/lib/{utils-DeWqNWV8.mjs → utils-D31VFael.mjs} +1 -1
- package/lib/{vision-guard-_XwsL1DF.mjs → vision-guard-BlAAqGUC.mjs} +1 -1
- package/lib/{xai-oauth-CXhnz0gO.mjs → xai-oauth-QPyScm4X.mjs} +1 -1
- package/lib/{xiaomi-psoUItal.mjs → xiaomi-CLzjxHAi.mjs} +1 -1
- package/lib/{zai-ApJ8HBgT.mjs → zai-wDp0g7VC.mjs} +1 -1
- package/lib/{zip-Kd602XNe.mjs → zip-CNtIFfyV.mjs} +7 -7
- package/package.json +3 -1
- package/presets/package.json +1 -1
|
@@ -3,7 +3,7 @@ __installBunShim();
|
|
|
3
3
|
import { n as fs_promises_shim_exports } from "./fs-promises-shim-Bx0fpxuk.mjs";
|
|
4
4
|
import * as fs from "node:fs";
|
|
5
5
|
import { Process } from "@oh-my-pi/pi-natives";
|
|
6
|
-
import * as path from "node:path";
|
|
6
|
+
import * as path$1 from "node:path";
|
|
7
7
|
import * as os from "node:os";
|
|
8
8
|
import assert from "node:assert/strict";
|
|
9
9
|
import { parse, stringify } from "yaml";
|
|
@@ -46,15 +46,15 @@ function hasPathSeparator(command) {
|
|
|
46
46
|
function findOnPath(command, env = process.env) {
|
|
47
47
|
if (command.length === 0) return void 0;
|
|
48
48
|
if (hasPathSeparator(command)) try {
|
|
49
|
-
return fs.statSync(command).isFile() ? path.resolve(command) : void 0;
|
|
49
|
+
return fs.statSync(command).isFile() ? path$1.resolve(command) : void 0;
|
|
50
50
|
} catch {
|
|
51
51
|
return;
|
|
52
52
|
}
|
|
53
|
-
const dirs = (env.PATH ?? "").split(path.delimiter).filter(Boolean);
|
|
53
|
+
const dirs = (env.PATH ?? "").split(path$1.delimiter).filter(Boolean);
|
|
54
54
|
const extensions = process.platform === "win32" ? (env.PATHEXT && env.PATHEXT.length > 0 ? env.PATHEXT : WIN32_DEFAULT_PATHEXT).split(";").filter(Boolean) : [];
|
|
55
55
|
const candidates = process.platform === "win32" ? [command, ...extensions.map((ext) => command + ext)] : [command];
|
|
56
56
|
for (const dir of dirs) for (const candidate of candidates) {
|
|
57
|
-
const full = path.join(dir, candidate);
|
|
57
|
+
const full = path$1.join(dir, candidate);
|
|
58
58
|
try {
|
|
59
59
|
if (fs.statSync(full).isFile()) return full;
|
|
60
60
|
} catch {}
|
|
@@ -342,11 +342,11 @@ function readProfileFromEnvSafe() {
|
|
|
342
342
|
}
|
|
343
343
|
}
|
|
344
344
|
function getBaseConfigRoot() {
|
|
345
|
-
return path.join(os.homedir(), getConfigDirName());
|
|
345
|
+
return path$1.join(os.homedir(), getConfigDirName());
|
|
346
346
|
}
|
|
347
347
|
function getProfileConfigRoot(profile) {
|
|
348
348
|
const root = getBaseConfigRoot();
|
|
349
|
-
return profile ? path.join(root, "profiles", profile) : root;
|
|
349
|
+
return profile ? path$1.join(root, "profiles", profile) : root;
|
|
350
350
|
}
|
|
351
351
|
function readPiProfileFromEnvSafe() {
|
|
352
352
|
try {
|
|
@@ -356,7 +356,7 @@ function readPiProfileFromEnvSafe() {
|
|
|
356
356
|
}
|
|
357
357
|
}
|
|
358
358
|
function getProfileAgentDir(profile) {
|
|
359
|
-
return path.join(getProfileConfigRoot(profile), "agent");
|
|
359
|
+
return path$1.join(getProfileConfigRoot(profile), "agent");
|
|
360
360
|
}
|
|
361
361
|
function isProfileDerivedAgentDir(profile, agentDirEnv) {
|
|
362
362
|
return profile !== void 0 && agentDirEnv === getProfileAgentDir(profile);
|
|
@@ -385,7 +385,7 @@ function getProjectDir() {
|
|
|
385
385
|
os.tmpdir()
|
|
386
386
|
];
|
|
387
387
|
for (const candidate of candidates) {
|
|
388
|
-
if (!candidate || !path.isAbsolute(candidate)) continue;
|
|
388
|
+
if (!candidate || !path$1.isAbsolute(candidate)) continue;
|
|
389
389
|
try {
|
|
390
390
|
process.chdir(candidate);
|
|
391
391
|
projectDir = standardizeMacOSPath(candidate);
|
|
@@ -416,9 +416,9 @@ var DirResolver = class {
|
|
|
416
416
|
constructor(options = {}) {
|
|
417
417
|
const profile = normalizeProfileName(options.profile);
|
|
418
418
|
this.configRoot = getProfileConfigRoot(profile);
|
|
419
|
-
const defaultAgent = path.join(this.configRoot, "agent");
|
|
419
|
+
const defaultAgent = path$1.join(this.configRoot, "agent");
|
|
420
420
|
const agentDirOverride = profile ? void 0 : options.agentDirOverride;
|
|
421
|
-
this.agentDir = agentDirOverride ? path.resolve(agentDirOverride) : defaultAgent;
|
|
421
|
+
this.agentDir = agentDirOverride ? path$1.resolve(agentDirOverride) : defaultAgent;
|
|
422
422
|
const isDefault = this.agentDir === defaultAgent;
|
|
423
423
|
let xdgData;
|
|
424
424
|
let xdgState;
|
|
@@ -428,9 +428,9 @@ var DirResolver = class {
|
|
|
428
428
|
const value = process.env[envVar];
|
|
429
429
|
if (!value) return void 0;
|
|
430
430
|
try {
|
|
431
|
-
const appRoot = path.join(value, "omp");
|
|
431
|
+
const appRoot = path$1.join(value, "omp");
|
|
432
432
|
if (profile) {
|
|
433
|
-
const profilePath = path.join(appRoot, "profiles", profile);
|
|
433
|
+
const profilePath = path$1.join(appRoot, "profiles", profile);
|
|
434
434
|
if (fs.existsSync(profilePath)) return profilePath;
|
|
435
435
|
return;
|
|
436
436
|
}
|
|
@@ -457,7 +457,7 @@ var DirResolver = class {
|
|
|
457
457
|
const cached = this.#rootCache.get(subdir);
|
|
458
458
|
if (cached) return cached;
|
|
459
459
|
const base = xdg ? this.#rootDirs[xdg] : this.configRoot;
|
|
460
|
-
const result = path.join(base, subdir);
|
|
460
|
+
const result = path$1.join(base, subdir);
|
|
461
461
|
this.#rootCache.set(subdir, result);
|
|
462
462
|
return result;
|
|
463
463
|
}
|
|
@@ -467,11 +467,11 @@ var DirResolver = class {
|
|
|
467
467
|
const cached = this.#agentCache.get(subdir);
|
|
468
468
|
if (cached) return cached;
|
|
469
469
|
const base = xdg ? this.#agentDirs[xdg] : this.agentDir;
|
|
470
|
-
const result = path.join(base, subdir);
|
|
470
|
+
const result = path$1.join(base, subdir);
|
|
471
471
|
this.#agentCache.set(subdir, result);
|
|
472
472
|
return result;
|
|
473
473
|
}
|
|
474
|
-
return path.join(userAgentDir, subdir);
|
|
474
|
+
return path$1.join(userAgentDir, subdir);
|
|
475
475
|
}
|
|
476
476
|
};
|
|
477
477
|
/**
|
|
@@ -550,7 +550,7 @@ function getAutoQaDbPath() {
|
|
|
550
550
|
}
|
|
551
551
|
/** Get the document conversion cache directory (~/.omp/agent/cache/document-conversions; XDG default: $XDG_CACHE_HOME/omp/cache/document-conversions). */
|
|
552
552
|
function getDocumentConversionCacheDir(agentDir) {
|
|
553
|
-
return dirs.agentSubdir(agentDir, path.join("cache", "document-conversions"), "cache");
|
|
553
|
+
return dirs.agentSubdir(agentDir, path$1.join("cache", "document-conversions"), "cache");
|
|
554
554
|
}
|
|
555
555
|
/** Get the tools directory (~/.omp/agent/tools). */
|
|
556
556
|
function getToolsDir(agentDir) {
|
|
@@ -579,7 +579,7 @@ const UUID_RE = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/
|
|
|
579
579
|
*/
|
|
580
580
|
function getInstallId() {
|
|
581
581
|
if (cachedInstallId) return cachedInstallId;
|
|
582
|
-
const filePath = path.join(getBaseConfigRoot(), INSTALL_ID_FILE);
|
|
582
|
+
const filePath = path$1.join(getBaseConfigRoot(), INSTALL_ID_FILE);
|
|
583
583
|
let observedInvalid = false;
|
|
584
584
|
try {
|
|
585
585
|
const existing = fs.readFileSync(filePath, "utf8").trim();
|
|
@@ -591,7 +591,7 @@ function getInstallId() {
|
|
|
591
591
|
} catch {}
|
|
592
592
|
const next = crypto.randomUUID();
|
|
593
593
|
try {
|
|
594
|
-
fs.mkdirSync(path.dirname(filePath), { recursive: true });
|
|
594
|
+
fs.mkdirSync(path$1.dirname(filePath), { recursive: true });
|
|
595
595
|
if (observedInvalid) try {
|
|
596
596
|
fs.unlinkSync(filePath);
|
|
597
597
|
} catch {}
|
|
@@ -720,10 +720,10 @@ function parseEnvFile(filePath) {
|
|
|
720
720
|
for (const k in result) if (k.startsWith("OMP_")) result[`PI_${k.slice(4)}`] = result[k];
|
|
721
721
|
return result;
|
|
722
722
|
}
|
|
723
|
-
const homeEnv = parseEnvFile(path.join(os.homedir(), ".env"));
|
|
724
|
-
const piEnv = parseEnvFile(path.join(getConfigRootDir(), ".env"));
|
|
725
|
-
const agentEnv = parseEnvFile(path.join(getAgentDir(), ".env"));
|
|
726
|
-
const projectEnv = parseEnvFile(path.join(getProjectDir(), ".env"));
|
|
723
|
+
const homeEnv = parseEnvFile(path$1.join(os.homedir(), ".env"));
|
|
724
|
+
const piEnv = parseEnvFile(path$1.join(getConfigRootDir(), ".env"));
|
|
725
|
+
const agentEnv = parseEnvFile(path$1.join(getAgentDir(), ".env"));
|
|
726
|
+
const projectEnv = parseEnvFile(path$1.join(getProjectDir(), ".env"));
|
|
727
727
|
for (const key of Object.keys(Bun.env)) {
|
|
728
728
|
const value = Bun.env[key];
|
|
729
729
|
if (!isSafeEnvName(key) || isMacosMallocStackLoggingEnvName(key) || value === void 0 || !isSafeEnvValue(value)) delete Bun.env[key];
|
|
@@ -926,7 +926,7 @@ var BunFileShim = class {
|
|
|
926
926
|
}
|
|
927
927
|
}
|
|
928
928
|
get name() {
|
|
929
|
-
return path.basename(this.path);
|
|
929
|
+
return path$1.basename(this.path);
|
|
930
930
|
}
|
|
931
931
|
async exists() {
|
|
932
932
|
try {
|
|
@@ -1044,7 +1044,7 @@ var FileSinkShim = class {
|
|
|
1044
1044
|
this.#filePath = filePath;
|
|
1045
1045
|
}
|
|
1046
1046
|
#open() {
|
|
1047
|
-
fs.mkdirSync(path.dirname(this.#filePath), { recursive: true });
|
|
1047
|
+
fs.mkdirSync(path$1.dirname(this.#filePath), { recursive: true });
|
|
1048
1048
|
this.#fd = fs.openSync(this.#filePath, "a");
|
|
1049
1049
|
}
|
|
1050
1050
|
write(chunk) {
|
|
@@ -1064,7 +1064,7 @@ var FileSinkShim = class {
|
|
|
1064
1064
|
}
|
|
1065
1065
|
};
|
|
1066
1066
|
async function bunWrite(dest, data) {
|
|
1067
|
-
await fsp.mkdir(path.dirname(dest), { recursive: true });
|
|
1067
|
+
await fsp.mkdir(path$1.dirname(dest), { recursive: true });
|
|
1068
1068
|
if (typeof data === "string") await fsp.writeFile(dest, data);
|
|
1069
1069
|
else if (data instanceof Blob) await fsp.writeFile(dest, new Uint8Array(await data.arrayBuffer()));
|
|
1070
1070
|
else if (data instanceof ArrayBuffer) await fsp.writeFile(dest, new Uint8Array(data));
|
|
@@ -1212,7 +1212,7 @@ var GlobShim = class {
|
|
|
1212
1212
|
const root = opts.cwd ?? process.cwd();
|
|
1213
1213
|
const onlyFiles = opts.onlyFiles ?? true;
|
|
1214
1214
|
for await (const abs of walkFiles(root, onlyFiles)) {
|
|
1215
|
-
const rel = path.relative(root, abs).split(path.sep).join("/");
|
|
1215
|
+
const rel = path$1.relative(root, abs).split(path$1.sep).join("/");
|
|
1216
1216
|
if (this.#re.test(rel)) yield opts.absolute ? abs : rel;
|
|
1217
1217
|
}
|
|
1218
1218
|
}
|
|
@@ -1228,7 +1228,7 @@ async function* walkFiles(dir, onlyFiles) {
|
|
|
1228
1228
|
return;
|
|
1229
1229
|
}
|
|
1230
1230
|
for (const entry of entries) {
|
|
1231
|
-
const p = path.join(dir, entry.name);
|
|
1231
|
+
const p = path$1.join(dir, entry.name);
|
|
1232
1232
|
if (entry.isDirectory()) {
|
|
1233
1233
|
if (!onlyFiles) yield p;
|
|
1234
1234
|
yield* walkFiles(p, onlyFiles);
|
|
@@ -1295,12 +1295,12 @@ async function resolveSharp() {
|
|
|
1295
1295
|
const { createRequire } = await import("node:module");
|
|
1296
1296
|
const { fileURLToPath } = await import("node:url");
|
|
1297
1297
|
const { existsSync } = await import("node:fs");
|
|
1298
|
-
let dir = path.dirname(fileURLToPath(import.meta.url));
|
|
1298
|
+
let dir = path$1.dirname(fileURLToPath(import.meta.url));
|
|
1299
1299
|
for (let depth = 0; depth < 10; depth++) {
|
|
1300
|
-
const parent = path.dirname(dir);
|
|
1300
|
+
const parent = path$1.dirname(dir);
|
|
1301
1301
|
if (parent === dir) break;
|
|
1302
|
-
if (existsSync(path.join(parent, "node_modules", "@deepseek-ai", "dsh", "node_modules", "sharp", "package.json"))) {
|
|
1303
|
-
const sharp = normalizeSharp(createRequire(path.join(parent, "noop.js"))("sharp"));
|
|
1302
|
+
if (existsSync(path$1.join(parent, "node_modules", "@deepseek-ai", "dsh", "node_modules", "sharp", "package.json"))) {
|
|
1303
|
+
const sharp = normalizeSharp(createRequire(path$1.join(parent, "noop.js"))("sharp"));
|
|
1304
1304
|
if (sharp) return sharp;
|
|
1305
1305
|
}
|
|
1306
1306
|
dir = parent;
|
|
@@ -1464,7 +1464,7 @@ async function archiveWrite(destPath, record, opts) {
|
|
|
1464
1464
|
chunks.push(/* @__PURE__ */ new Uint8Array(1024));
|
|
1465
1465
|
let buf = Buffer.concat(chunks.map((c) => Buffer.from(c.buffer, c.byteOffset, c.byteLength)));
|
|
1466
1466
|
if (opts?.compress === "gzip") buf = gzipSync(buf);
|
|
1467
|
-
await fsp.mkdir(path.dirname(destPath), { recursive: true });
|
|
1467
|
+
await fsp.mkdir(path$1.dirname(destPath), { recursive: true });
|
|
1468
1468
|
await fsp.writeFile(destPath, buf);
|
|
1469
1469
|
}
|
|
1470
1470
|
/** Consume one escape sequence starting at `esc` (text[esc] === ESC); returns
|
|
@@ -1513,7 +1513,7 @@ function bunStripANSI(text) {
|
|
|
1513
1513
|
}
|
|
1514
1514
|
function bunWhich(command, options) {
|
|
1515
1515
|
const cwd = options?.cwd;
|
|
1516
|
-
return findOnPath(cwd !== void 0 && !path.isAbsolute(command) && (command.includes("/") || command.includes("\\")) ? path.resolve(cwd, command) : command, options?.PATH !== void 0 ? {
|
|
1516
|
+
return findOnPath(cwd !== void 0 && !path$1.isAbsolute(command) && (command.includes("/") || command.includes("\\")) ? path$1.resolve(cwd, command) : command, options?.PATH !== void 0 ? {
|
|
1517
1517
|
...process.env,
|
|
1518
1518
|
PATH: options.PATH
|
|
1519
1519
|
} : process.env) ?? null;
|
|
@@ -1707,7 +1707,7 @@ var RotatingFileSink = class {
|
|
|
1707
1707
|
}
|
|
1708
1708
|
#setActivePath(day, index) {
|
|
1709
1709
|
const suffix = index === 0 ? "" : `.${index}`;
|
|
1710
|
-
this.#activePath = path.join(this.#directory, `${this.#filenamePrefix}.${day}.${this.#filenameSuffix}.log${suffix}`);
|
|
1710
|
+
this.#activePath = path$1.join(this.#directory, `${this.#filenamePrefix}.${day}.${this.#filenameSuffix}.log${suffix}`);
|
|
1711
1711
|
try {
|
|
1712
1712
|
this.#activeBytes = fs.statSync(this.#activePath).size;
|
|
1713
1713
|
} catch {
|
|
@@ -1814,7 +1814,7 @@ function pruneStaleProcessLogs(dir) {
|
|
|
1814
1814
|
const auditMatch = PROCESS_AUDIT_PATTERN.exec(entry.name);
|
|
1815
1815
|
const pidText = logMatch?.[2] ?? auditMatch?.[1];
|
|
1816
1816
|
if (!pidText || processIsRunning(Number(pidText))) continue;
|
|
1817
|
-
const entryPath = path.join(dir, entry.name);
|
|
1817
|
+
const entryPath = path$1.join(dir, entry.name);
|
|
1818
1818
|
if (auditMatch) {
|
|
1819
1819
|
try {
|
|
1820
1820
|
fs.rmSync(entryPath, { force: true });
|
|
@@ -1919,7 +1919,7 @@ function makeFileTransport(dir) {
|
|
|
1919
1919
|
filenameSuffix: String(process.pid),
|
|
1920
1920
|
maxBytes: 10485760,
|
|
1921
1921
|
maxFiles: 5,
|
|
1922
|
-
auditFile: path.join(logsDir, `.omp.${process.pid}-audit.json`)
|
|
1922
|
+
auditFile: path$1.join(logsDir, `.omp.${process.pid}-audit.json`)
|
|
1923
1923
|
});
|
|
1924
1924
|
}
|
|
1925
1925
|
/**
|
|
@@ -3582,12 +3582,12 @@ function getMacosToolPaths() {
|
|
|
3582
3582
|
if (macosToolPaths) return macosToolPaths;
|
|
3583
3583
|
const paths = ["/Library/Developer/CommandLineTools/usr/bin"];
|
|
3584
3584
|
const devDir = getDeveloperDirs();
|
|
3585
|
-
if (devDir) paths.push(path.join(devDir, "usr/bin"), path.join(devDir, "Toolchains/XcodeDefault.xctoolchain/usr/bin"));
|
|
3585
|
+
if (devDir) paths.push(path$1.join(devDir, "usr/bin"), path$1.join(devDir, "Toolchains/XcodeDefault.xctoolchain/usr/bin"));
|
|
3586
3586
|
macosToolPaths = /* @__PURE__ */ new Map();
|
|
3587
3587
|
for (const dir of Array.from(new Set(paths))) try {
|
|
3588
3588
|
for (const entry of fs.readdirSync(dir, { withFileTypes: true })) if (entry.isFile() || entry.isSymbolicLink()) {
|
|
3589
3589
|
if (macosToolPaths.has(entry.name)) continue;
|
|
3590
|
-
macosToolPaths.set(entry.name, path.join(dir, entry.name));
|
|
3590
|
+
macosToolPaths.set(entry.name, path$1.join(dir, entry.name));
|
|
3591
3591
|
}
|
|
3592
3592
|
} catch {}
|
|
3593
3593
|
return macosToolPaths;
|
|
@@ -5467,7 +5467,7 @@ var TempDir = class TempDir {
|
|
|
5467
5467
|
return this.#path;
|
|
5468
5468
|
}
|
|
5469
5469
|
absolute() {
|
|
5470
|
-
return path.resolve(this.#path);
|
|
5470
|
+
return path$1.resolve(this.#path);
|
|
5471
5471
|
}
|
|
5472
5472
|
remove() {
|
|
5473
5473
|
if (this.#removePromise) return this.#removePromise;
|
|
@@ -5483,7 +5483,7 @@ var TempDir = class TempDir {
|
|
|
5483
5483
|
return this.#path;
|
|
5484
5484
|
}
|
|
5485
5485
|
join(...paths) {
|
|
5486
|
-
return path.join(this.#path, ...paths);
|
|
5486
|
+
return path$1.join(this.#path, ...paths);
|
|
5487
5487
|
}
|
|
5488
5488
|
async [Symbol.asyncDispose]() {
|
|
5489
5489
|
try {
|
|
@@ -5498,8 +5498,8 @@ var TempDir = class TempDir {
|
|
|
5498
5498
|
};
|
|
5499
5499
|
const kTempDir = os.tmpdir();
|
|
5500
5500
|
function normalizePrefix(prefix) {
|
|
5501
|
-
if (!prefix) return `${kTempDir}${path.sep}pi-temp-`;
|
|
5502
|
-
else if (prefix.startsWith("@")) return path.join(kTempDir, prefix.slice(1));
|
|
5501
|
+
if (!prefix) return `${kTempDir}${path$1.sep}pi-temp-`;
|
|
5502
|
+
else if (prefix.startsWith("@")) return path$1.join(kTempDir, prefix.slice(1));
|
|
5503
5503
|
return prefix;
|
|
5504
5504
|
}
|
|
5505
5505
|
const kRemoveOptions = {
|
|
@@ -1,40 +1,40 @@
|
|
|
1
1
|
import { installBunShim as __installBunShim } from "./bun-shim.mjs";
|
|
2
2
|
__installBunShim();
|
|
3
3
|
import { n as fs_promises_shim_exports } from "./fs-promises-shim-Bx0fpxuk.mjs";
|
|
4
|
-
import { B as USER_AGENT, C as warn, I as $pickenv, N as $env, _ as parseStreamingJson, h as classifyJsonPrefix, p as parseImageMetadata, q as getInstallId, rt as once, t as structuredCloneJSON, v as parseStreamingJsonThrottled } from "./src-
|
|
5
|
-
import { C as classify, E as is, G as fetchWithRetry, W as extractHttpStatusFromError, f as OAuthError, g as OnPromptRequiredError, h as MissingApiKeyError, i as isProviderRetryableError, m as LoginCancelledError, p as ApiKeyRequiredError, s as ProviderResponseError, t as ConfigurationError, v as Flag } from "./error-
|
|
6
|
-
import { C as kStreamingLastParseLen, H as getBundledModelReferenceIndex, U as stringifyJson, a as normalizeResponsesToolCallId, c as resolveCacheRetention, d as sanitizeOpenAIResponsesHistoryItemsForReplay, g as clearStreamingPartialJson, h as transformMessages, i as getOpenAIResponsesHistoryPayload, l as sanitizeOpenAIResponsesAssistantFallbackItemsForReplay, o as normalizeSystemPrompts, p as stripUnpairedOpenAIResponsesComputerReasoningIdsForReplay, r as getOpenAIResponsesHistoryItems, u as sanitizeOpenAIResponsesAssistantHistoryItemsForReplay, w as kStreamingPartialJson, y as kStreamingArgumentsDone } from "./utils-
|
|
4
|
+
import { B as USER_AGENT, C as warn, I as $pickenv, N as $env, _ as parseStreamingJson, h as classifyJsonPrefix, p as parseImageMetadata, q as getInstallId, rt as once, t as structuredCloneJSON, v as parseStreamingJsonThrottled } from "./src-DUUqyo9y.mjs";
|
|
5
|
+
import { C as classify, E as is, G as fetchWithRetry, W as extractHttpStatusFromError, f as OAuthError, g as OnPromptRequiredError, h as MissingApiKeyError, i as isProviderRetryableError, m as LoginCancelledError, p as ApiKeyRequiredError, s as ProviderResponseError, t as ConfigurationError, v as Flag } from "./error-DdCn4m1q.mjs";
|
|
6
|
+
import { C as kStreamingLastParseLen, H as getBundledModelReferenceIndex, U as stringifyJson, a as normalizeResponsesToolCallId, c as resolveCacheRetention, d as sanitizeOpenAIResponsesHistoryItemsForReplay, g as clearStreamingPartialJson, h as transformMessages, i as getOpenAIResponsesHistoryPayload, l as sanitizeOpenAIResponsesAssistantFallbackItemsForReplay, o as normalizeSystemPrompts, p as stripUnpairedOpenAIResponsesComputerReasoningIdsForReplay, r as getOpenAIResponsesHistoryItems, u as sanitizeOpenAIResponsesAssistantHistoryItemsForReplay, w as kStreamingPartialJson, y as kStreamingArgumentsDone } from "./utils-BMmwLB0f.mjs";
|
|
7
7
|
import { n as isRecord } from "./type-guards-CttAANEx.mjs";
|
|
8
8
|
import { d as compareRevision, f as parseRevision, l as auth, n as classifyModel, s as globMatch, t as billingVariantPlain, u as behavior$1 } from "./taxonomy-DSIM99rS.mjs";
|
|
9
9
|
import { r as parseAlibabaTokenPlanCredential, t as ALIBABA_TOKEN_PLAN_BASE_URL } from "./alibaba-token-plan-CHGyWOfX.mjs";
|
|
10
|
-
import { a as toNumber, i as toBoolean, n as discoveryFetch, o as toPositiveNumber, r as isAnthropicOAuthToken } from "./utils-
|
|
11
|
-
import { a as parseCloudflareAiGatewayCredential, i as CLOUDFLARE_AI_GATEWAY_OPENAI_BASE_URL, r as CLOUDFLARE_AI_GATEWAY_COMPAT_BASE_URL, t as CLOUDFLARE_AI_GATEWAY_ANTHROPIC_BASE_URL } from "./cloudflare-ai-gateway-
|
|
12
|
-
import { c as invalidateAwsCredentialCache, d as resolveAwsBearerToken, f as resolveAwsRegistryApiKey, h as resolveAwsRegion, i as getSupportedEfforts, l as resolveAwsCredentials, p as AUTHENTICATED_SENTINEL, u as signRequest } from "./anthropic-wire-
|
|
13
|
-
import "./abort-
|
|
14
|
-
import "./proxy-
|
|
10
|
+
import { a as toNumber, i as toBoolean, n as discoveryFetch, o as toPositiveNumber, r as isAnthropicOAuthToken } from "./utils-D31VFael.mjs";
|
|
11
|
+
import { a as parseCloudflareAiGatewayCredential, i as CLOUDFLARE_AI_GATEWAY_OPENAI_BASE_URL, r as CLOUDFLARE_AI_GATEWAY_COMPAT_BASE_URL, t as CLOUDFLARE_AI_GATEWAY_ANTHROPIC_BASE_URL } from "./cloudflare-ai-gateway-B_kWnF30.mjs";
|
|
12
|
+
import { c as invalidateAwsCredentialCache, d as resolveAwsBearerToken, f as resolveAwsRegistryApiKey, h as resolveAwsRegion, i as getSupportedEfforts, l as resolveAwsCredentials, p as AUTHENTICATED_SENTINEL, u as signRequest } from "./anthropic-wire-Cb8AQ1tS.mjs";
|
|
13
|
+
import "./abort-BtBy5Svf.mjs";
|
|
14
|
+
import "./proxy-B51IWEMt.mjs";
|
|
15
15
|
import { n as THINKING_EFFORTS } from "./effort-BdtQMN-_.mjs";
|
|
16
16
|
import { r as getBundledModels, t as calculateCost } from "./models-DnXMYGcJ.mjs";
|
|
17
17
|
import { i as removeBlankCoreWeaveProjectHeaders, n as coreWeaveProjectHeaders, r as hasCoreWeaveProjectHeader, t as COREWEAVE_PROJECT_HEADER } from "./coreweave-C82HrLpb.mjs";
|
|
18
|
-
import { a as resolveGitHubCopilotBaseUrl, b as parseGitHubCopilotApiKey, f as discoverGitHubCopilotApiEndpoint, g as mergeCopilotApiHeaders, i as resolveCopilotRequestIdentity, l as COPILOT_DISCOVERY_HEADERS, m as isPersonalGitHubCopilotBaseUrl, n as hasCopilotVisionInput, p as getGitHubCopilotBaseUrl, s as COPILOT_API_HEADERS, t as buildCopilotDynamicHeaders } from "./github-copilot-headers-
|
|
19
|
-
import { i as partitionVisionContent, o as shouldSendServiceTier, r as joinTextWithImagePlaceholder, t as NON_VISION_IMAGE_PLACEHOLDER } from "./vision-guard-
|
|
18
|
+
import { a as resolveGitHubCopilotBaseUrl, b as parseGitHubCopilotApiKey, f as discoverGitHubCopilotApiEndpoint, g as mergeCopilotApiHeaders, i as resolveCopilotRequestIdentity, l as COPILOT_DISCOVERY_HEADERS, m as isPersonalGitHubCopilotBaseUrl, n as hasCopilotVisionInput, p as getGitHubCopilotBaseUrl, s as COPILOT_API_HEADERS, t as buildCopilotDynamicHeaders } from "./github-copilot-headers-BGL8JO5c.mjs";
|
|
19
|
+
import { i as partitionVisionContent, o as shouldSendServiceTier, r as joinTextWithImagePlaceholder, t as NON_VISION_IMAGE_PLACEHOLDER } from "./vision-guard-BlAAqGUC.mjs";
|
|
20
20
|
import { r as resolveModelReference } from "./reference-CtvM4zLU.mjs";
|
|
21
|
-
import { t as AssistantMessageEventStream } from "./event-stream-
|
|
22
|
-
import { n as validateApiKeyAgainstModelsEndpoint, r as validateOpenAICompatibleApiKey, t as validateAnthropicCompatibleApiKey } from "./api-key-validation-
|
|
21
|
+
import { t as AssistantMessageEventStream } from "./event-stream-ldcUvOA0.mjs";
|
|
22
|
+
import { n as validateApiKeyAgainstModelsEndpoint, r as validateOpenAICompatibleApiKey, t as validateAnthropicCompatibleApiKey } from "./api-key-validation-BXJKlsJg.mjs";
|
|
23
23
|
import { t as generatePKCE } from "./pkce-BYjmugmw.mjs";
|
|
24
|
-
import { r as claudeCodeSdkVersion } from "./anthropic-
|
|
25
|
-
import { n as buildModel, r as resolveModelPolicy } from "./collapse-
|
|
26
|
-
import { n as parseMuseCodeCredential } from "./muse-code-
|
|
24
|
+
import { r as claudeCodeSdkVersion } from "./anthropic-C6-vdduI.mjs";
|
|
25
|
+
import { n as buildModel, r as resolveModelPolicy } from "./collapse-DU3g7d3B.mjs";
|
|
26
|
+
import { n as parseMuseCodeCredential } from "./muse-code-CtcevJab.mjs";
|
|
27
27
|
import { n as createReferenceResolver, r as toModelSpec, t as createBundledReferenceMap } from "./bundled-references-DY3EJxZV.mjs";
|
|
28
28
|
import { n as clinePassClientHeaders, t as CLINEPASS_API_BASE_URL } from "./cline-pass-Bwg3esu9.mjs";
|
|
29
29
|
import { t as DEVIN_DEFAULT_BASE_URL } from "./devin-ExGIghmx.mjs";
|
|
30
|
-
import "./idle-iterator-
|
|
31
|
-
import "./google-auth-
|
|
32
|
-
import "./kimi-
|
|
33
|
-
import "./thinking-
|
|
30
|
+
import "./idle-iterator-DTBaEIbM.mjs";
|
|
31
|
+
import "./google-auth-DYhqX1rJ.mjs";
|
|
32
|
+
import "./kimi-BFfnFDhu.mjs";
|
|
33
|
+
import "./thinking-D6LJxkz_.mjs";
|
|
34
34
|
import "./request-debug-NQN0BjHH.mjs";
|
|
35
35
|
import * as fs from "node:fs";
|
|
36
36
|
import { NativeOAuthCallback } from "@oh-my-pi/pi-natives";
|
|
37
|
-
import * as path from "node:path";
|
|
37
|
+
import * as path$1 from "node:path";
|
|
38
38
|
import * as os from "node:os";
|
|
39
39
|
import { scheduler } from "node:timers/promises";
|
|
40
40
|
import { type } from "@oh-my-pi/omptype";
|
|
@@ -2937,32 +2937,32 @@ const bedrockMantleTransport = {
|
|
|
2937
2937
|
//#endregion
|
|
2938
2938
|
//#region node_modules/.pnpm/@oh-my-pi+pi-ai@18.1.17/node_modules/@oh-my-pi/pi-ai/src/registry/hooks/api-key.ts
|
|
2939
2939
|
const API_KEY_HEADERS_HOOKS = {
|
|
2940
|
-
"coreweave-project": () => import("./coreweave-
|
|
2940
|
+
"coreweave-project": () => import("./coreweave-CkR_FlQi.mjs").then((m) => m.requireCoreWeaveProjectHeaders),
|
|
2941
2941
|
"cline-pass-client": () => import("./cline-pass-Bwg3esu9.mjs").then((n) => n.r).then((m) => m.clinePassClientHeaders)
|
|
2942
2942
|
};
|
|
2943
2943
|
const API_KEY_LOGIN_HOOKS = {
|
|
2944
|
-
"alibaba-coding-plan": () => import("./alibaba-coding-plan-
|
|
2945
|
-
"alibaba-token-plan": () => import("./alibaba-token-plan-
|
|
2946
|
-
"cloudflare-ai-gateway": () => import("./cloudflare-ai-gateway-
|
|
2947
|
-
kilo: () => import("./kilo-
|
|
2948
|
-
xiaomi: () => import("./xiaomi-
|
|
2944
|
+
"alibaba-coding-plan": () => import("./alibaba-coding-plan-oxHCHJtG.mjs").then((m) => m.loginAlibabaCodingPlan),
|
|
2945
|
+
"alibaba-token-plan": () => import("./alibaba-token-plan-B0WzvYnB.mjs").then((m) => m.loginAlibabaTokenPlan),
|
|
2946
|
+
"cloudflare-ai-gateway": () => import("./cloudflare-ai-gateway-BK6eadm9.mjs").then((m) => m.loginCloudflareAiGateway),
|
|
2947
|
+
kilo: () => import("./kilo-cVG1aNZM.mjs").then((m) => m.loginKilo),
|
|
2948
|
+
xiaomi: () => import("./xiaomi-CLzjxHAi.mjs").then((m) => m.loginXiaomi)
|
|
2949
2949
|
};
|
|
2950
2950
|
//#endregion
|
|
2951
2951
|
//#region node_modules/.pnpm/@oh-my-pi+pi-ai@18.1.17/node_modules/@oh-my-pi/pi-ai/src/registry/hooks/custom.ts
|
|
2952
2952
|
const CUSTOM_LOGIN_HOOKS = {
|
|
2953
|
-
"github-copilot": () => import("./github-copilot-
|
|
2954
|
-
cursor: () => import("./cursor-
|
|
2955
|
-
perplexity: () => import("./perplexity-
|
|
2953
|
+
"github-copilot": () => import("./github-copilot-BT5dkIJl.mjs").then((module) => module.loginGitHubCopilotHook),
|
|
2954
|
+
cursor: () => import("./cursor-BjWbJJLe.mjs").then((n) => n.t).then((module) => module.loginCursorHook),
|
|
2955
|
+
perplexity: () => import("./perplexity-JFp3knZN.mjs").then((module) => module.loginPerplexity)
|
|
2956
2956
|
};
|
|
2957
2957
|
const CUSTOM_REFRESH_HOOKS = {
|
|
2958
|
-
"github-copilot": () => import("./github-copilot-
|
|
2959
|
-
cursor: () => import("./cursor-
|
|
2958
|
+
"github-copilot": () => import("./github-copilot-BT5dkIJl.mjs").then((module) => module.refreshGitHubCopilotHook),
|
|
2959
|
+
cursor: () => import("./cursor-BjWbJJLe.mjs").then((n) => n.t).then((module) => module.refreshCursorHook)
|
|
2960
2960
|
};
|
|
2961
2961
|
//#endregion
|
|
2962
2962
|
//#region node_modules/.pnpm/@oh-my-pi+pi-ai@18.1.17/node_modules/@oh-my-pi/pi-ai/src/registry/hooks/device-code.ts
|
|
2963
|
-
const DEVICE_CODE_HEADERS_HOOKS = { "kimi-fingerprint": () => import("./kimi-
|
|
2964
|
-
const DEVICE_CODE_VALUE_HOOKS = { "xai-token-endpoint": () => import("./xai-oauth-
|
|
2965
|
-
const DEVICE_CODE_AFTER_EXCHANGE_HOOKS = { "muse-code-key": () => import("./muse-code-
|
|
2963
|
+
const DEVICE_CODE_HEADERS_HOOKS = { "kimi-fingerprint": () => import("./kimi-BFfnFDhu.mjs").then((n) => n.n).then((module) => module.getKimiCommonHeaders) };
|
|
2964
|
+
const DEVICE_CODE_VALUE_HOOKS = { "xai-token-endpoint": () => import("./xai-oauth-QPyScm4X.mjs").then((n) => n.a).then((module) => module.getXAITokenEndpoint) };
|
|
2965
|
+
const DEVICE_CODE_AFTER_EXCHANGE_HOOKS = { "muse-code-key": () => import("./muse-code-CtcevJab.mjs").then((n) => n.t).then((module) => module.attachMuseCodeApiKey) };
|
|
2966
2966
|
//#endregion
|
|
2967
2967
|
//#region node_modules/.pnpm/@oh-my-pi+pi-ai@18.1.17/node_modules/@oh-my-pi/pi-ai/src/utils/foundry.ts
|
|
2968
2968
|
function isFoundryEnabled() {
|
|
@@ -2981,7 +2981,7 @@ let cachedVertexAdcCredentialsExists = null;
|
|
|
2981
2981
|
function hasVertexAdcCredentials() {
|
|
2982
2982
|
if (cachedVertexAdcCredentialsExists === null) {
|
|
2983
2983
|
const gacPath = $env.GOOGLE_APPLICATION_CREDENTIALS;
|
|
2984
|
-
cachedVertexAdcCredentialsExists = fs.existsSync(gacPath ?? path.join(os.homedir(), ".config", "gcloud", "application_default_credentials.json"));
|
|
2984
|
+
cachedVertexAdcCredentialsExists = fs.existsSync(gacPath ?? path$1.join(os.homedir(), ".config", "gcloud", "application_default_credentials.json"));
|
|
2985
2985
|
}
|
|
2986
2986
|
return cachedVertexAdcCredentialsExists;
|
|
2987
2987
|
}
|
|
@@ -2999,15 +2999,15 @@ const ENV_HOOKS = {
|
|
|
2999
2999
|
//#endregion
|
|
3000
3000
|
//#region node_modules/.pnpm/@oh-my-pi+pi-ai@18.1.17/node_modules/@oh-my-pi/pi-ai/src/registry/hooks/oauth-code.ts
|
|
3001
3001
|
const OAUTH_CODE_AFTER_EXCHANGE_HOOKS = {
|
|
3002
|
-
"anthropic-identity": () => import("./anthropic-
|
|
3003
|
-
"gitlab-duo-clear-cache": () => import("./gitlab-duo-
|
|
3004
|
-
"openai-codex-profile": () => import("./openai-codex-
|
|
3005
|
-
"zai-mint-key": () => import("./zai-
|
|
3006
|
-
"google-gemini-cli-project": () => import("./google-gemini-cli-
|
|
3007
|
-
"google-antigravity-project": () => import("./google-antigravity-
|
|
3002
|
+
"anthropic-identity": () => import("./anthropic-C6-vdduI.mjs").then((n) => n.t).then((m) => m.anthropicIdentityHook),
|
|
3003
|
+
"gitlab-duo-clear-cache": () => import("./gitlab-duo-B0qSYCa3.mjs").then((m) => m.gitLabDuoClearCacheHook),
|
|
3004
|
+
"openai-codex-profile": () => import("./openai-codex-CxkPyvyt.mjs").then((m) => m.openAICodexProfileHook),
|
|
3005
|
+
"zai-mint-key": () => import("./zai-wDp0g7VC.mjs").then((m) => m.zaiMintKeyHook),
|
|
3006
|
+
"google-gemini-cli-project": () => import("./google-gemini-cli-CjHy6mFG.mjs").then((m) => m.googleGeminiCliProjectHook),
|
|
3007
|
+
"google-antigravity-project": () => import("./google-antigravity-D1llOVad.mjs").then((m) => m.googleAntigravityProjectHook)
|
|
3008
3008
|
};
|
|
3009
3009
|
const OAUTH_CODE_VALUE_HOOKS = {};
|
|
3010
|
-
const OAUTH_CODE_LOGIN_HOOKS = { "openai-codex-device": () => import("./openai-codex-
|
|
3010
|
+
const OAUTH_CODE_LOGIN_HOOKS = { "openai-codex-device": () => import("./openai-codex-CxkPyvyt.mjs").then((m) => m.loginOpenAICodexDevice) };
|
|
3011
3011
|
//#endregion
|
|
3012
3012
|
//#region node_modules/.pnpm/@oh-my-pi+pi-ai@18.1.17/node_modules/@oh-my-pi/pi-ai/src/registry/hooks/index.ts
|
|
3013
3013
|
/**
|
|
@@ -10533,31 +10533,31 @@ async function discoverGitLabRemoteProjectPath(cwd, baseUrl) {
|
|
|
10533
10533
|
return null;
|
|
10534
10534
|
}
|
|
10535
10535
|
async function readGitConfigText(startCwd) {
|
|
10536
|
-
let current = path.resolve(startCwd);
|
|
10536
|
+
let current = path$1.resolve(startCwd);
|
|
10537
10537
|
while (true) {
|
|
10538
|
-
const configText = await readGitConfigFromDotGit(path.join(current, ".git"));
|
|
10538
|
+
const configText = await readGitConfigFromDotGit(path$1.join(current, ".git"));
|
|
10539
10539
|
if (configText) return configText;
|
|
10540
|
-
const parent = path.dirname(current);
|
|
10540
|
+
const parent = path$1.dirname(current);
|
|
10541
10541
|
if (parent === current) return null;
|
|
10542
10542
|
current = parent;
|
|
10543
10543
|
}
|
|
10544
10544
|
}
|
|
10545
10545
|
async function readGitConfigFromDotGit(gitPath) {
|
|
10546
|
-
const directConfig = await readTextFile(path.join(gitPath, "config"));
|
|
10546
|
+
const directConfig = await readTextFile(path$1.join(gitPath, "config"));
|
|
10547
10547
|
if (directConfig !== null) return directConfig;
|
|
10548
10548
|
const dotGitFile = await readTextFile(gitPath);
|
|
10549
10549
|
if (dotGitFile === null) return null;
|
|
10550
10550
|
const gitDir = parseGitDirFile(dotGitFile);
|
|
10551
10551
|
if (!gitDir) return null;
|
|
10552
|
-
const gitDirPath = path.isAbsolute(gitDir) ? gitDir : path.resolve(path.dirname(gitPath), gitDir);
|
|
10553
|
-
const commonDir = await readTextFile(path.join(gitDirPath, "commondir"));
|
|
10552
|
+
const gitDirPath = path$1.isAbsolute(gitDir) ? gitDir : path$1.resolve(path$1.dirname(gitPath), gitDir);
|
|
10553
|
+
const commonDir = await readTextFile(path$1.join(gitDirPath, "commondir"));
|
|
10554
10554
|
if (commonDir) {
|
|
10555
10555
|
const trimmed = commonDir.trim();
|
|
10556
|
-
const commonDirPath = path.isAbsolute(trimmed) ? trimmed : path.resolve(gitDirPath, trimmed);
|
|
10557
|
-
const commonConfig = await readTextFile(path.join(commonDirPath, "config"));
|
|
10556
|
+
const commonDirPath = path$1.isAbsolute(trimmed) ? trimmed : path$1.resolve(gitDirPath, trimmed);
|
|
10557
|
+
const commonConfig = await readTextFile(path$1.join(commonDirPath, "config"));
|
|
10558
10558
|
if (commonConfig !== null) return commonConfig;
|
|
10559
10559
|
}
|
|
10560
|
-
return readTextFile(path.join(gitDirPath, "config"));
|
|
10560
|
+
return readTextFile(path$1.join(gitDirPath, "config"));
|
|
10561
10561
|
}
|
|
10562
10562
|
async function readTextFile(filePath) {
|
|
10563
10563
|
try {
|
|
@@ -10649,7 +10649,7 @@ function cursorModelManagerOptions(config = {}) {
|
|
|
10649
10649
|
} } : void 0
|
|
10650
10650
|
};
|
|
10651
10651
|
}
|
|
10652
|
-
const cursorDiscovery = once(() => import("./cursor-
|
|
10652
|
+
const cursorDiscovery = once(() => import("./cursor-BXx_5h4a.mjs"));
|
|
10653
10653
|
function gitLabDuoWorkflowModelManagerOptions(config = {}) {
|
|
10654
10654
|
const apiKey = config.apiKey;
|
|
10655
10655
|
return {
|
|
@@ -10747,7 +10747,7 @@ function devinModelManagerOptions(config = {}) {
|
|
|
10747
10747
|
} } : void 0
|
|
10748
10748
|
};
|
|
10749
10749
|
}
|
|
10750
|
-
const devinDiscovery = once(() => import("./devin-
|
|
10750
|
+
const devinDiscovery = once(() => import("./devin-Ce3Wz8_E.mjs"));
|
|
10751
10751
|
/** Creates model-manager options for Z.AI's mixed native and Anthropic transports. */
|
|
10752
10752
|
function zaiModelManagerOptions(_config = {}) {
|
|
10753
10753
|
return { providerId: "zai" };
|
|
@@ -11358,7 +11358,7 @@ function clearGitLabDuoDirectAccessCache() {
|
|
|
11358
11358
|
//#endregion
|
|
11359
11359
|
//#region node_modules/.pnpm/@oh-my-pi+pi-ai@18.1.17/node_modules/@oh-my-pi/pi-ai/src/providers/gitlab-duo-workflow-chatml-note.md
|
|
11360
11360
|
var gitlab_duo_workflow_chatml_note_default = "The task below is a transcript of the conversation so far, written as a plain-text log. Turn boundaries (`<|im_start|>role` … `<|im_end|>`) and any `<ran NAME>{…}</ran>` / `<ran:result>` entries inside it are a RECORD of what already happened — past tool calls and their results. They are not a syntax for you to emit. To call a tool, use your normal structured tool-calling channel; never write `<ran …>`, `<tool_call>`, `<|im_start|>`, or similar markers as your own output.";
|
|
11361
|
-
path.resolve(import.meta.dirname, "../../../../.tmp/gitlab-duo-workflow-trace.log");
|
|
11361
|
+
path$1.resolve(import.meta.dirname, "../../../../.tmp/gitlab-duo-workflow-trace.log");
|
|
11362
11362
|
gitlab_duo_workflow_chatml_note_default.trim();
|
|
11363
11363
|
new https.Agent({ keepAlive: true });
|
|
11364
11364
|
//#endregion
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { installBunShim as __installBunShim } from "./bun-shim.mjs";
|
|
2
2
|
__installBunShim();
|
|
3
|
-
import { E as createInbandScanner } from "./utils-
|
|
4
|
-
import { t as ThinkingInbandScanner } from "./thinking-
|
|
3
|
+
import { E as createInbandScanner } from "./utils-BMmwLB0f.mjs";
|
|
4
|
+
import { t as ThinkingInbandScanner } from "./thinking-D6LJxkz_.mjs";
|
|
5
5
|
//#region node_modules/.pnpm/@oh-my-pi+pi-ai@18.1.17/node_modules/@oh-my-pi/pi-ai/src/dialect/qwen-xml.ts
|
|
6
6
|
const SECTION_OPEN = "<tool_calls>";
|
|
7
7
|
const SECTION_CLOSE = "</tool_calls>";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { installBunShim as __installBunShim } from "./bun-shim.mjs";
|
|
2
2
|
__installBunShim();
|
|
3
|
-
import { D as FencedThinkingScanner, O as partialSuffixOverlapAny } from "./utils-
|
|
3
|
+
import { D as FencedThinkingScanner, O as partialSuffixOverlapAny } from "./utils-BMmwLB0f.mjs";
|
|
4
4
|
//#region node_modules/.pnpm/@oh-my-pi+pi-ai@18.1.17/node_modules/@oh-my-pi/pi-ai/src/dialect/thinking.ts
|
|
5
5
|
/**
|
|
6
6
|
* Every dialect's in-band thinking section in its canonical `renderThinking`
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* a compile error (the official registration enforces bilingual balance).
|
|
6
6
|
* @module @xiaoso/dsh-tool-plus/client
|
|
7
7
|
*/
|
|
8
|
-
export type BashPlusLocaleKey = 'title' | 'description' | 'nav' | 'pageTitle' | 'pageDescription' | 'tabBash' | 'tabRead' | 'tabWriteEdit' | 'tabGrep' | 'tabGlob' | 'tabAstGrep' | 'tabAstEdit' | 'tabReadImage' | 'groupTiming' | 'groupOutput' | 'groupTruncation' | 'groupBehavior' | 'groupReading' | 'groupSummary' | 'groupImages' | 'groupEditMode' | 'groupGuard' | 'groupGrep' | 'groupSearchDefaults' | 'groupFetch' | 'groupAst' | 'noConfigTitle' | 'noConfigHint' | 'readSummarizeEnabled' | 'readSummarizeEnabledHint' | 'readSummarizeProse' | 'readSummarizeProseHint' | 'readSummarizeMinBodyLines' | 'readSummarizeMinBodyLinesHint' | 'readSummarizeMinCommentLines' | 'readSummarizeMinCommentLinesHint' | 'readSummarizeMinTotalLines' | 'readSummarizeMinTotalLinesHint' | 'readSummarizeUnfoldUntil' | 'readSummarizeUnfoldUntilHint' | 'readSummarizeUnfoldLimit' | 'readSummarizeUnfoldLimitHint' | 'editBlockAutoGenerated' | 'editBlockAutoGeneratedHint' | 'readDefaultLimit' | 'readDefaultLimitHint' | 'readLineNumbers' | 'readLineNumbersHint' | 'readRenderMarkdown' | 'readRenderMarkdownHint' | 'readConcurrentSafe' | 'readConcurrentSafeHint' | 'editMode' | 'editModeHint' | 'editFuzzyMatch' | 'editFuzzyMatchHint' | 'editFuzzyThreshold' | 'editFuzzyThresholdHint' | 'editEnforceSeenLines' | 'editEnforceSeenLinesHint' | 'grepContextBefore' | 'grepContextBeforeHint' | 'grepContextAfter' | 'grepContextAfterHint' | 'grepCaseDefault' | 'grepCaseDefaultHint' | 'grepGitignoreDefault' | 'grepGitignoreDefaultHint' | 'globGitignoreDefault' | 'globGitignoreDefaultHint' | 'globHiddenDefault' | 'globHiddenDefaultHint' | 'astGrepEnabled' | 'astGrepEnabledHint' | 'astEditEnabled' | 'astEditEnabledHint' | 'optReplace' | 'optPatch' | 'optHashline' | 'optApplyPatch' | 'fetchEnabled' | 'fetchEnabledHint' | 'fetchMaxTimeoutSeconds' | 'fetchMaxTimeoutSecondsHint' | 'fetchReader' | 'fetchReaderHint' | 'browserReaderEnabled' | 'browserReaderEnabledHint' | 'browserProbe' | 'browserProbeHint' | 'browserProbeRunning' | 'browserProbeNone' | 'browserProbeFailed' | 'browserProbeUnavailable' | 'optReaderAuto' | 'optReaderNative' | 'optReaderTrafilatura' | 'optReaderLynx' | 'optReaderParallel' | 'optReaderJina' | 'optReaderBrowser' | 'imagesAutoResize' | 'imagesAutoResizeHint' | 'imagesBlockImages' | 'imagesBlockImagesHint' | 'imagesExcludeWebp' | 'imagesExcludeWebpHint' | 'imagesInputMaxBytes' | 'imagesInputMaxBytesHint' | 'imagesResizeMaxSide' | 'imagesResizeMaxSideHint' | 'imagesResizeMaxBytes' | 'imagesResizeMaxBytesHint' | 'imagesResizeMinSide' | 'imagesResizeMinSideHint' | 'imagesResizeJpegQuality' | 'imagesResizeJpegQualityHint' | 'autoBackgroundMs' | 'autoBackgroundMsHint' | 'defaultTimeoutMs' | 'defaultTimeoutMsHint' | 'maxTimeoutMs' | 'maxTimeoutMsHint' | 'maxBackgroundJobs' | 'maxBackgroundJobsHint' | 'outputMaxBytes' | 'outputMaxBytesHint' | 'outputSinkTailBytes' | 'outputSinkTailBytesHint' | 'outputSinkHeadBytes' | 'outputSinkHeadBytesHint' | 'minimizerEnabled' | 'minimizerEnabledHint' | 'enableRunInBackground' | 'enableRunInBackgroundHint' | 'interceptorEnabled' | 'interceptorEnabledHint' | 'nonInteractiveEnv' | 'nonInteractiveEnvHint' | 'snapshotEnabled' | 'snapshotEnabledHint' | 'rmSafe' | 'rmSafeHint' | 'rmSafeStatusInjected' | 'rmSafeStatusInjectedUnverified' | 'rmSafeStatusFailed' | 'rmSafeReasonSnapshotUnavailable' | 'rmSafeReasonCliMissing' | 'rmSafeReasonSnapshotWriteFailed' | 'rmSafeReasonRuntimeNotEffective' | 'useShellCommandWrapper' | 'useShellCommandWrapperHint' | 'outputTruncateStrategy' | 'outputTruncateStrategyHint' | 'outputTruncateTriggerBytes' | 'outputTruncateTriggerBytesHint' | 'outputTruncateTriggerLines' | 'outputTruncateTriggerLinesHint' | 'outputTruncateByteMode' | 'outputTruncateByteModeHint' | 'outputTruncateByteHeadBytes' | 'outputTruncateByteHeadBytesHint' | 'outputTruncateByteTailBytes' | 'outputTruncateByteTailBytesHint' | 'outputTruncateLineMode' | 'outputTruncateLineModeHint' | 'outputTruncateLineHeadLines' | 'outputTruncateLineHeadLinesHint' | 'outputTruncateLineTailLines' | 'outputTruncateLineTailLinesHint' | 'optBytes' | 'optLines' | 'optHead' | 'optTail' | 'optMiddle' | 'overridden' | 'reset' | 'readOnly' | 'expand' | 'collapse' | 'save' | 'saving' | 'discard' | 'unsaved' | 'saveFailed' | 'invalidNumber' | 'appliesTo';
|
|
8
|
+
export type BashPlusLocaleKey = 'title' | 'description' | 'nav' | 'pageTitle' | 'pageDescription' | 'tabBash' | 'tabRead' | 'tabWriteEdit' | 'tabGrep' | 'tabGlob' | 'tabAstGrep' | 'tabAstEdit' | 'tabReadImage' | 'groupTiming' | 'groupOutput' | 'groupTruncation' | 'groupBehavior' | 'groupReading' | 'groupSummary' | 'groupImages' | 'groupEditMode' | 'groupGuard' | 'groupGrep' | 'groupSearchDefaults' | 'groupFetch' | 'groupAst' | 'noConfigTitle' | 'noConfigHint' | 'readSummarizeEnabled' | 'readSummarizeEnabledHint' | 'readSummarizeProse' | 'readSummarizeProseHint' | 'readSummarizeMinBodyLines' | 'readSummarizeMinBodyLinesHint' | 'readSummarizeMinCommentLines' | 'readSummarizeMinCommentLinesHint' | 'readSummarizeMinTotalLines' | 'readSummarizeMinTotalLinesHint' | 'readSummarizeUnfoldUntil' | 'readSummarizeUnfoldUntilHint' | 'readSummarizeUnfoldLimit' | 'readSummarizeUnfoldLimitHint' | 'editBlockAutoGenerated' | 'editBlockAutoGeneratedHint' | 'readDefaultLimit' | 'readDefaultLimitHint' | 'readLineNumbers' | 'readLineNumbersHint' | 'readRenderMarkdown' | 'readRenderMarkdownHint' | 'readConcurrentSafe' | 'readConcurrentSafeHint' | 'editMode' | 'editModeHint' | 'editFuzzyMatch' | 'editFuzzyMatchHint' | 'editFuzzyThreshold' | 'editFuzzyThresholdHint' | 'editEnforceSeenLines' | 'editEnforceSeenLinesHint' | 'grepContextBefore' | 'grepContextBeforeHint' | 'grepContextAfter' | 'grepContextAfterHint' | 'grepCaseDefault' | 'grepCaseDefaultHint' | 'grepGitignoreDefault' | 'grepGitignoreDefaultHint' | 'globGitignoreDefault' | 'globGitignoreDefaultHint' | 'globHiddenDefault' | 'globHiddenDefaultHint' | 'astGrepEnabled' | 'astGrepEnabledHint' | 'astEditEnabled' | 'astEditEnabledHint' | 'optReplace' | 'optPatch' | 'optHashline' | 'optApplyPatch' | 'fetchEnabled' | 'fetchEnabledHint' | 'fetchMaxTimeoutSeconds' | 'fetchMaxTimeoutSecondsHint' | 'fetchReader' | 'fetchReaderHint' | 'browserReaderEnabled' | 'browserReaderEnabledHint' | 'browserProbe' | 'browserProbeHint' | 'browserProbeRunning' | 'browserProbeNone' | 'browserProbeFailed' | 'browserProbeUnavailable' | 'optReaderAuto' | 'optReaderNative' | 'optReaderTrafilatura' | 'optReaderLynx' | 'optReaderParallel' | 'optReaderJina' | 'optReaderBrowser' | 'imagesAutoResize' | 'imagesAutoResizeHint' | 'imagesBlockImages' | 'imagesBlockImagesHint' | 'imagesExcludeWebp' | 'imagesExcludeWebpHint' | 'imagesInputMaxBytes' | 'imagesInputMaxBytesHint' | 'imagesResizeMaxSide' | 'imagesResizeMaxSideHint' | 'imagesResizeMaxBytes' | 'imagesResizeMaxBytesHint' | 'imagesResizeMinSide' | 'imagesResizeMinSideHint' | 'imagesResizeJpegQuality' | 'imagesResizeJpegQualityHint' | 'autoBackgroundMs' | 'autoBackgroundMsHint' | 'defaultTimeoutMs' | 'defaultTimeoutMsHint' | 'maxTimeoutMs' | 'maxTimeoutMsHint' | 'maxBackgroundJobs' | 'maxBackgroundJobsHint' | 'outputMaxBytes' | 'outputMaxBytesHint' | 'outputSinkTailBytes' | 'outputSinkTailBytesHint' | 'outputSinkHeadBytes' | 'outputSinkHeadBytesHint' | 'minimizerEnabled' | 'minimizerEnabledHint' | 'enableRunInBackground' | 'enableRunInBackgroundHint' | 'interceptorEnabled' | 'interceptorEnabledHint' | 'nonInteractiveEnv' | 'nonInteractiveEnvHint' | 'snapshotEnabled' | 'snapshotEnabledHint' | 'rmSafe' | 'rmSafeHint' | 'rmSafeStatusInjected' | 'rmSafeStatusInjectedUnverified' | 'rmSafeStatusFailed' | 'rmSafeReasonSnapshotUnavailable' | 'rmSafeReasonCliMissing' | 'rmSafeReasonSnapshotWriteFailed' | 'rmSafeReasonRuntimeNotEffective' | 'useShellCommandWrapper' | 'useShellCommandWrapperHint' | 'webCards' | 'webCardsHint' | 'outputTruncateStrategy' | 'outputTruncateStrategyHint' | 'outputTruncateTriggerBytes' | 'outputTruncateTriggerBytesHint' | 'outputTruncateTriggerLines' | 'outputTruncateTriggerLinesHint' | 'outputTruncateByteMode' | 'outputTruncateByteModeHint' | 'outputTruncateByteHeadBytes' | 'outputTruncateByteHeadBytesHint' | 'outputTruncateByteTailBytes' | 'outputTruncateByteTailBytesHint' | 'outputTruncateLineMode' | 'outputTruncateLineModeHint' | 'outputTruncateLineHeadLines' | 'outputTruncateLineHeadLinesHint' | 'outputTruncateLineTailLines' | 'outputTruncateLineTailLinesHint' | 'optBytes' | 'optLines' | 'optHead' | 'optTail' | 'optMiddle' | 'overridden' | 'reset' | 'readOnly' | 'expand' | 'collapse' | 'save' | 'saving' | 'discard' | 'unsaved' | 'saveFailed' | 'invalidNumber' | 'appliesTo';
|
|
9
9
|
/** Simplified Chinese copy. */
|
|
10
10
|
export declare const zh: Record<BashPlusLocaleKey, string>;
|
|
11
11
|
/** English copy. */
|
|
@@ -61,6 +61,12 @@ export interface RuntimeConfig {
|
|
|
61
61
|
snapshotEnabled: boolean;
|
|
62
62
|
rmSafe: boolean;
|
|
63
63
|
useShellCommandWrapper: boolean;
|
|
64
|
+
/**
|
|
65
|
+
* Whether the browser half mounts this plugin's tool cards (the Node runtime
|
|
66
|
+
* never reads it; it rides the resolved config so the field table, the schema,
|
|
67
|
+
* and this projection stay a single source of truth).
|
|
68
|
+
*/
|
|
69
|
+
webCards: boolean;
|
|
64
70
|
maxBackgroundJobs: number;
|
|
65
71
|
outputTruncate: OutputTruncateConfig;
|
|
66
72
|
editBlockAutoGenerated: boolean;
|
|
@@ -137,6 +143,8 @@ export interface Config {
|
|
|
137
143
|
/** Redefine `rm` in the session shell to move into the system trash (default true). */
|
|
138
144
|
rmSafe?: boolean;
|
|
139
145
|
useShellCommandWrapper?: boolean;
|
|
146
|
+
/** Mount this plugin's browser tool cards (default true; off returns to the shipped rows). */
|
|
147
|
+
webCards?: boolean;
|
|
140
148
|
maxBackgroundJobs?: number;
|
|
141
149
|
outputTruncateStrategy?: OutputTruncateStrategy;
|
|
142
150
|
outputTruncateTriggerBytes?: number;
|
|
@@ -17,8 +17,31 @@
|
|
|
17
17
|
* model-facing `result.text` is surfaced directly.
|
|
18
18
|
*/
|
|
19
19
|
import type { Context } from '@deepseek-ai/cordis';
|
|
20
|
+
import type { AgentToolResult } from '@oh-my-pi/pi-agent-core';
|
|
20
21
|
import type { RuntimeConfig } from '../../../config/settings.ts';
|
|
21
22
|
export type { ToolSession } from './sdk.ts';
|
|
23
|
+
/** DSH ast_grep 工具输出形状(output.schema 镜像)。 */
|
|
24
|
+
export interface AstGrepToolOutput {
|
|
25
|
+
text: string;
|
|
26
|
+
matchCount?: number;
|
|
27
|
+
fileCount?: number;
|
|
28
|
+
files?: string[];
|
|
29
|
+
scopePath?: string;
|
|
30
|
+
truncated?: boolean;
|
|
31
|
+
/** 引擎给渲染器的分组显示文本(与 grep 同构)。 */
|
|
32
|
+
displayContent?: string;
|
|
33
|
+
/** 搜索时的会话 cwd:display 头里的相对路径按它还原成绝对路径。 */
|
|
34
|
+
cwd?: string;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* 把 OMP AgentToolResult 转成 DSH ast_grep 工具输出。
|
|
38
|
+
*
|
|
39
|
+
* 此前适配层只回 `{text}`,卡片拿不到任何结构化数据;现在把引擎的
|
|
40
|
+
* `displayContent`(分组显示文本)+ `files` + `matchCount` + `limitReached`
|
|
41
|
+
* 一并带出,供 `presentationMeta` 投影成 search 卡(§4.6)。isError 仍抛错,
|
|
42
|
+
* 报错文案不变。
|
|
43
|
+
*/
|
|
44
|
+
export declare function toAstGrepToolResult(result: AgentToolResult<any>): AstGrepToolOutput;
|
|
22
45
|
/**
|
|
23
46
|
* Register the ast_grep tool. Argument shape matches OMP verbatim:
|
|
24
47
|
* `pat` is a required AST pattern; `path` optionally selects files,
|
|
@@ -17,6 +17,7 @@
|
|
|
17
17
|
*/
|
|
18
18
|
import type { Context } from '@deepseek-ai/cordis';
|
|
19
19
|
import type { WritethroughCallback } from '../../omp/tools/writethrough.ts';
|
|
20
|
+
import type { CardDiffHunk } from '../../../web/contract.ts';
|
|
20
21
|
import type { RuntimeConfig } from '../../../config/settings.ts';
|
|
21
22
|
/** OMP 原版按模式渲染的 edit 描述(prompts/tools/*.md verbatim + native hashline 描述)。 */
|
|
22
23
|
export declare const EDIT_MODE_DESCRIPTIONS: {
|
|
@@ -37,6 +38,8 @@ export declare function createWritethrough(ctx: Context, exec: any): Writethroug
|
|
|
37
38
|
/** DSH edit 工具输出形状(output.schema 镜像)。 */
|
|
38
39
|
export interface EditToolOutput {
|
|
39
40
|
text: string;
|
|
41
|
+
/** 卡片用 diff(已按 EDIT_META_MAX_BYTES 截断;空/不可解析时不带该键)。 */
|
|
42
|
+
diffs?: CardDiffHunk[];
|
|
40
43
|
}
|
|
41
44
|
/**
|
|
42
45
|
* S-13:edit.fuzzyThreshold 解析——上游 settings 面原样放行显式 0/负值
|