@xiaoso/dsh-tool-plus 0.1.16 → 0.1.17-beta.0
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-DZ54CaKU.mjs → abort-BTblp0Rt.mjs} +2 -2
- package/lib/{alibaba-coding-plan-DODpkcqi.mjs → alibaba-coding-plan-t3R4YKCB.mjs} +3 -3
- package/lib/{alibaba-token-plan-C6lpKCda.mjs → alibaba-token-plan-CO4djG1y.mjs} +4 -4
- package/lib/{alibaba-token-plan-CHGyWOfX.mjs → alibaba-token-plan-CUjYJX0-.mjs} +1 -1
- package/lib/{anthropic-Dv_GGX6g.mjs → anthropic-nf7w6so1.mjs} +48 -21
- package/lib/{api-key-validation-MnMf_ihX.mjs → api-key-validation-C_tZ7Y9a.mjs} +2 -2
- package/lib/behavior-BwvTUtag.mjs +111 -0
- package/lib/{browser-render-BZXt548F.mjs → browser-render-BQaEVK_n.mjs} +4 -4
- package/lib/{reference-CtvM4zLU.mjs → bundled-references-CrQ4dQcT.mjs} +57 -4
- package/lib/cascade-BWjRTD1q.mjs +30265 -0
- package/lib/{cline-pass-BT9CBEOj.mjs → cline-pass-Bjm-O8GG.mjs} +2 -2
- package/lib/cloudflare-CKXRJ0l9.mjs +37 -0
- package/lib/{cloudflare-ai-gateway-DReN6ohJ.mjs → cloudflare-ai-gateway-BpnBSjwV.mjs} +8 -4
- package/lib/cloudflare-workers-ai-odj9XswL.mjs +32 -0
- package/lib/collapse-_nkb2dn7.mjs +1945 -0
- package/lib/{coreweave-C82HrLpb.mjs → coreweave-CGDZOD8-.mjs} +1 -1
- package/lib/{coreweave-C68UgRQO.mjs → coreweave-DwffcgW5.mjs} +4 -4
- package/lib/cursor-BgOuV7Qf.mjs +794 -0
- package/lib/{cursor-_gHHq-Dq.mjs → cursor-CF1iHHbv.mjs} +68 -19
- package/lib/{cursor-proto-Cr_WEMuv.mjs → cursor-proto-BuNTjX3L.mjs} +823 -23
- package/lib/{devin-QpfTSl9H.mjs → devin-7OEeEb80.mjs} +112 -31
- package/lib/{devin-proto-DYhp4Ty6.mjs → devin-proto-C-QreeAv.mjs} +71 -5
- package/lib/{dom-DG3sPESc.mjs → dom-BmbZv4v9.mjs} +598 -182
- package/lib/{error-O63pC8zg.mjs → error-8LVo7tug.mjs} +725 -104
- package/lib/factory-droid-ChhmsGWb.mjs +71 -0
- package/lib/{fs-promises-shim-B2YFWkcd.mjs → fs-promises-shim-CANAxFWh.mjs} +10 -1
- package/lib/{github-copilot-BMEcw8N1.mjs → github-copilot-QwevdT30.mjs} +4 -4
- package/lib/{github-copilot-headers-DnjGEbko.mjs → github-copilot-headers-CAUZ0rUD.mjs} +138 -26
- package/lib/{gitlab-duo-DnHqJjFY.mjs → gitlab-duo-DigV7k_o.mjs} +2 -2
- package/lib/{google-antigravity-B1mSckrK.mjs → google-antigravity-D-oe0r8A.mjs} +6 -7
- package/lib/{google-gemini-cli-DJwThCCn.mjs → google-gemini-cli-CQBHgGJT.mjs} +5 -6
- package/lib/{google-oauth-shared-BctLpVUN.mjs → google-oauth-shared-CvgVIUwJ.mjs} +2 -2
- package/lib/google-validation-CdvRj4ec.mjs +126 -0
- package/lib/id-EJwVLDHE.mjs +2548 -0
- package/lib/index.mjs +248 -258
- package/lib/{kilo-BEgEwMJQ.mjs → kilo-5r6OffCa.mjs} +2 -2
- package/lib/{kimi-T9NldEIJ.mjs → kimi-DOOtbXmm.mjs} +9 -10
- package/lib/{launch-BIWNyrBB.mjs → launch-DkAjib7h.mjs} +1 -1
- package/lib/{markit-Dvp2JPdT.mjs → markit-CCcyeAds.mjs} +359 -140
- package/lib/{models-DnXMYGcJ.mjs → models-DCpDT_im.mjs} +199203 -112275
- package/lib/{muse-code-CNvqqAp6.mjs → muse-code-CYf8zj_B.mjs} +5 -5
- package/lib/{openai-codex-D5-CyTxa.mjs → openai-codex-Cj-TvSFh.mjs} +13 -10
- package/lib/{perplexity-A2PEoGaC.mjs → perplexity-Dh_Qgsmx.mjs} +68 -25
- package/lib/{pkce-BYjmugmw.mjs → pkce-DO-jBJLV.mjs} +1 -1
- package/lib/pricing-DusBEhwm.mjs +593 -0
- package/lib/{readability-uGhqb4GC.mjs → readability-XHK0o3bv.mjs} +287 -27
- package/lib/{scrapers-C1ujjV8k.mjs → scrapers-B6PADOVm.mjs} +13 -13
- package/lib/slugify-ynYWBIA5.mjs +11 -0
- package/lib/snowflake-B_jap6lz.mjs +666 -0
- package/lib/snowflake-Cu1ZyOp6.mjs +151 -0
- package/lib/{src-AELUUb5U.mjs → src-BhinCSpi.mjs} +1172 -458
- package/lib/{stream-AVOoe5Hj.mjs → stream-D2ivg3GH.mjs} +3740 -5311
- package/lib/{turndown-D6fof1OX.mjs → turndown-Vya8SavL.mjs} +82 -30
- package/lib/types/tools/hashline/native/index.d.ts +2 -2
- package/lib/types/tools/hashline/native/policy.d.ts +19 -21
- package/lib/types/tools/omp/session/agent-storage.d.ts +3 -3
- package/lib/types/tools/shared/bun-named-shim.d.ts +5 -0
- package/lib/{types-BLrLohwK.mjs → types-tH1v9uRm.mjs} +2 -2
- package/lib/{utils-cZX3f_Ls.mjs → utils-C_Ncya1r.mjs} +1737 -509
- package/lib/utils-D2tK38xq.mjs +34006 -0
- package/lib/{utils-I4I8azHN.mjs → utils-DrDwmNtu.mjs} +8 -3
- package/lib/{xai-oauth-CbeldUSV.mjs → xai-oauth-DLLzX6my.mjs} +4 -4
- package/lib/{xiaomi-Dl3VSs04.mjs → xiaomi-CqK-KivK.mjs} +2 -2
- package/lib/{zai-FyjGSypr.mjs → zai-DoJ2xPIH.mjs} +2 -2
- package/lib/{zip-DRrycScC.mjs → zip-DG1mUV6X.mjs} +1 -1
- package/package.json +8 -8
- package/lib/amazon-bedrock-Dx0rr9dY.mjs +0 -996
- package/lib/anthropic-ClCw0PV_.mjs +0 -3624
- package/lib/anthropic-wire-lbGAFzYb.mjs +0 -927
- package/lib/azure-openai-responses-WE_bgFWp.mjs +0 -285
- package/lib/bundled-references-DY3EJxZV.mjs +0 -56
- package/lib/cloudflare-ai-gateway-CrMa97Ap.mjs +0 -44
- package/lib/collapse-CkMNRNr7.mjs +0 -2304
- package/lib/cursor-C6jaIJDg.mjs +0 -283
- package/lib/cursor-D-XZYDf_.mjs +0 -4544
- package/lib/deterministic-id-CUEIMSqR.mjs +0 -17
- package/lib/devin-ExGIghmx.mjs +0 -69
- package/lib/devin-u0ljw5P6.mjs +0 -628
- package/lib/effort-BdtQMN-_.mjs +0 -23
- package/lib/event-stream-BKEtb45Y.mjs +0 -167
- package/lib/gemini-headers-Co9cVvex.mjs +0 -54
- package/lib/google-auth-qAN-6DMW.mjs +0 -232
- package/lib/google-gemini-cli-B2Aw1S5w.mjs +0 -844
- package/lib/google-lTxuq28n.mjs +0 -38
- package/lib/google-shared-Y01j9xOr.mjs +0 -856
- package/lib/google-validation-BEkNs-Bx.mjs +0 -18
- package/lib/google-vertex-DcM-FRC5.mjs +0 -99
- package/lib/hosts-00rjRzUD.mjs +0 -203
- package/lib/id-AL5obQzR.mjs +0 -71
- package/lib/idle-iterator-D0ZXEcUq.mjs +0 -366
- package/lib/ollama-6R0oXZks.mjs +0 -574
- package/lib/openai-codex-responses-C8bnBWOe.mjs +0 -3232
- package/lib/openai-completions-DNr3mUsn.mjs +0 -1430
- package/lib/openai-configuration-update-xMYUjaK_.mjs +0 -150
- package/lib/openai-reasoning-fallback-Ju-5pSR8.mjs +0 -380
- package/lib/openai-responses-CjpafAEr.mjs +0 -861
- package/lib/protobuf-BMgDYu_U.mjs +0 -717
- package/lib/provider-response-SqKSkkUc.mjs +0 -22
- package/lib/proxy-DxvCQOCA.mjs +0 -230
- package/lib/request-debug-BwPOqN_j.mjs +0 -183
- package/lib/sanitize-text-BCf5KmCf.mjs +0 -33
- package/lib/sse-debug-B-tkLCPW.mjs +0 -11
- package/lib/stream-markup-healing-CN3RsqG9.mjs +0 -267
- package/lib/strict-tool-validation-CBTz1dAA.mjs +0 -105
- package/lib/taxonomy-DSIM99rS.mjs +0 -15392
- package/lib/thinking-ngMwf_1Y.mjs +0 -336
- package/lib/type-guards-CttAANEx.mjs +0 -11
- package/lib/utils-CE3DSebh.mjs +0 -11763
- package/lib/vision-guard-BCpXWUj3.mjs +0 -77
package/lib/index.mjs
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { installBunShim as __installBunShim } from "./bun-shim.mjs";
|
|
2
2
|
__installBunShim();
|
|
3
|
-
import { n as fs_promises_shim_exports, t as exists } from "./fs-promises-shim-
|
|
4
|
-
import { i as setRuntimeLogger, n as systemChromiumCandidatesForTest, r as runtimeLogger } from "./launch-
|
|
5
|
-
import { $ as
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
3
|
+
import { n as fs_promises_shim_exports, t as exists } from "./fs-promises-shim-CANAxFWh.mjs";
|
|
4
|
+
import { i as setRuntimeLogger, n as systemChromiumCandidatesForTest, r as runtimeLogger } from "./launch-DkAjib7h.mjs";
|
|
5
|
+
import { $ as getAutoQaDbPath, D as error, E as debug, H as $env, I as installBunShim, J as stripWindowsExtendedLengthPathPrefix, L as formatAge, R as formatBytes$1, U as $envpos, W as $flag, Z as VERSION, _t as findOnPath, d as exec, dt as isEnoent, f as render, ft as isEnotdir, gt as untilAborted, it as getInstallId, k as warn, m as $which, mt as peekFile, ot as getPuppeteerDir, p as LRUCache, pt as isProbablyBinary, st as getRemoteDir, u as combineSignals, ut as hasFsCode, v as readImageMetadata, z as formatCount } from "./src-BhinCSpi.mjs";
|
|
6
|
+
import { S as truncateToWidth$1, _ as formatCodeFrameLine, a as fetchBinary, b as padding, c as getParallelExtractContent, d as convertFileWithMarkit, f as Settings, g as capParseErrors, h as OMP_DEFAULTS, i as convertWithMarkit, l as ensureTool, m as settings, o as extractWithParallel, p as isSettingsInitialized, s as findParallelApiKey, u as CONVERTIBLE_EXTENSIONS, v as formatParseErrors, x as replaceTabs, y as shortenPath } from "./utils-D2tK38xq.mjs";
|
|
7
|
+
import { ct as sanitizeText } from "./utils-C_Ncya1r.mjs";
|
|
8
|
+
import { h as isRecord$5 } from "./cascade-BWjRTD1q.mjs";
|
|
9
9
|
import { n as ToolError, r as throwIfAborted, t as ToolAbortError } from "./tool-errors-DoyxivAR.mjs";
|
|
10
|
-
import { a as openArchive, c as sniffArchiveFormat, d as writeArchive, i as listArchiveRoot, o as parseArchivePathCandidates, r as formatArchiveEntryLines, s as readArchiveEntries, t as archiveFormatFromPath } from "./zip-
|
|
11
|
-
import { a as finalizeOutput, d as looksLikeHtml, n as MAX_OUTPUT_CHARS, t as MAX_BYTES, u as loadPage } from "./types-
|
|
10
|
+
import { a as openArchive, c as sniffArchiveFormat, d as writeArchive, i as listArchiveRoot, o as parseArchivePathCandidates, r as formatArchiveEntryLines, s as readArchiveEntries, t as archiveFormatFromPath } from "./zip-DG1mUV6X.mjs";
|
|
11
|
+
import { a as finalizeOutput, d as looksLikeHtml, n as MAX_OUTPUT_CHARS, t as MAX_BYTES, u as loadPage } from "./types-tH1v9uRm.mjs";
|
|
12
12
|
import { createRequire } from "node:module";
|
|
13
13
|
import * as fs from "node:fs";
|
|
14
14
|
import { copyFileSync, existsSync, readFileSync, readdirSync } from "node:fs";
|
|
@@ -26,9 +26,9 @@ import * as url from "node:url";
|
|
|
26
26
|
import { fileURLToPath } from "node:url";
|
|
27
27
|
import { scheduler } from "node:timers/promises";
|
|
28
28
|
import { randomBytes } from "node:crypto";
|
|
29
|
-
import z from "@deepseek-ai/schemastery";
|
|
30
|
-
import { type } from "@oh-my-pi/omptype";
|
|
31
29
|
import { DatabaseSync } from "node:sqlite";
|
|
30
|
+
import { type } from "@oh-my-pi/omptype";
|
|
31
|
+
import z from "@deepseek-ai/schemastery";
|
|
32
32
|
//#region src/tools/bash/shell-tokenize.ts
|
|
33
33
|
/**
|
|
34
34
|
* Returns the flat shell command segments with the original text of each. Unlike
|
|
@@ -827,28 +827,7 @@ function injectRmSafe(snapshotPath, nodePath, cliPath) {
|
|
|
827
827
|
}
|
|
828
828
|
}
|
|
829
829
|
//#endregion
|
|
830
|
-
//#region node_modules/.pnpm/@oh-my-pi+pi-utils@18.
|
|
831
|
-
const WINDOWS_DRIVE_EXTENDED_PREFIX = /^\\\\[?]\\([A-Za-z]:[\\/].*)$/;
|
|
832
|
-
const WINDOWS_UNC_EXTENDED_PREFIX = /^\\\\[?]\\UNC[\\/]([^\\/]+)[\\/](.+)$/i;
|
|
833
|
-
const WINDOWS_DRIVE_EXTENDED_FORWARD_PREFIX = /^\/\/[?]\/([A-Za-z]:\/.*)$/;
|
|
834
|
-
const WINDOWS_UNC_EXTENDED_FORWARD_PREFIX = /^\/\/[?]\/UNC\/([^/]+)\/(.+)$/i;
|
|
835
|
-
const WINDOWS_DRIVE_NT_PREFIX = /^\\\\[?][?]\\([A-Za-z]:[\\/].*)$/;
|
|
836
|
-
const WINDOWS_UNC_NT_PREFIX = /^\\\\[?][?]\\UNC[\\/]([^\\/]+)[\\/](.+)$/i;
|
|
837
|
-
/** Removes Win32 extended-length prefixes before passing paths to Bun APIs. */
|
|
838
|
-
function stripWindowsExtendedLengthPathPrefix(filePath, platform = process.platform) {
|
|
839
|
-
if (platform !== "win32") return filePath;
|
|
840
|
-
const uncMatch = WINDOWS_UNC_EXTENDED_PREFIX.exec(filePath) ?? WINDOWS_UNC_NT_PREFIX.exec(filePath);
|
|
841
|
-
if (uncMatch) return `\\\\${uncMatch[1]}\\${uncMatch[2]}`;
|
|
842
|
-
const driveMatch = WINDOWS_DRIVE_EXTENDED_PREFIX.exec(filePath) ?? WINDOWS_DRIVE_NT_PREFIX.exec(filePath);
|
|
843
|
-
if (driveMatch) return driveMatch[1];
|
|
844
|
-
const forwardUncMatch = WINDOWS_UNC_EXTENDED_FORWARD_PREFIX.exec(filePath);
|
|
845
|
-
if (forwardUncMatch) return `//${forwardUncMatch[1]}/${forwardUncMatch[2]}`;
|
|
846
|
-
const forwardDriveMatch = WINDOWS_DRIVE_EXTENDED_FORWARD_PREFIX.exec(filePath);
|
|
847
|
-
if (forwardDriveMatch) return forwardDriveMatch[1];
|
|
848
|
-
return filePath;
|
|
849
|
-
}
|
|
850
|
-
//#endregion
|
|
851
|
-
//#region node_modules/.pnpm/@oh-my-pi+pi-utils@18.1.17/node_modules/@oh-my-pi/pi-utils/src/path-tree.ts
|
|
830
|
+
//#region node_modules/.pnpm/@oh-my-pi+pi-utils@18.12.6/node_modules/@oh-my-pi/pi-utils/src/path-tree.ts
|
|
852
831
|
/**
|
|
853
832
|
* Multi-level path tree shared by grouped file listings (find / grep / ast tools)
|
|
854
833
|
* and compaction file-operation lists.
|
|
@@ -974,6 +953,204 @@ function formatGroupedPaths(paths, annotate) {
|
|
|
974
953
|
return lines.join("\n");
|
|
975
954
|
}
|
|
976
955
|
//#endregion
|
|
956
|
+
//#region src/tools/shared/bun-sqlite-shim.ts
|
|
957
|
+
/**
|
|
958
|
+
* DSH bun:sqlite shim (node:sqlite implementation).
|
|
959
|
+
*
|
|
960
|
+
* OMP tool code (copied verbatim into adapter/omp) imports `bun:sqlite` and
|
|
961
|
+
* relies on Bun's synchronous SQLite API. Node 22 exposes the same SQLite
|
|
962
|
+
* engine through `node:sqlite` (`DatabaseSync` / `StatementSync`, experimental
|
|
963
|
+
* but flag-free since 22.13); this module re-implements the Bun API subset the
|
|
964
|
+
* ported code actually uses so the OMP sources type-check and run unchanged.
|
|
965
|
+
*
|
|
966
|
+
* API differences absorbed here:
|
|
967
|
+
* - `new Database(path, { readonly })` → `new DatabaseSync(path, { readOnly })`
|
|
968
|
+
* (node uses camelCase `readOnly`; bun uses lowercase `readonly`).
|
|
969
|
+
* - bun `create` / `strict` options have no node counterpart: `create` is
|
|
970
|
+
* honoured by refusing to open a missing file, and `strict` is ignored
|
|
971
|
+
* (node:sqlite STRICT-table handling is a per-CREATE concern, not a flag).
|
|
972
|
+
* - bun `db.run(sql)` → node `db.exec(sql)` (both execute SQL without a
|
|
973
|
+
* returned row set).
|
|
974
|
+
* - node `StatementSync.get` returns `undefined` (no row) — the shim maps it
|
|
975
|
+
* to `null` so bun-shaped callers that declare `T | null` type-check.
|
|
976
|
+
* - node `StatementSync.all` returns `[]` (no rows) — bun matches too; the
|
|
977
|
+
* shim keeps node's array and normalises `null` to `[]` defensively.
|
|
978
|
+
* - bun `Statement.paramsCount` / `Statement.columnNames` → derived from the
|
|
979
|
+
* node statement's `sourceSQL` (parameter scan) and `columns()` metadata.
|
|
980
|
+
* - node has no `Statement.finalize()` — statements are closed with the
|
|
981
|
+
* database, so `finalize()` is a safe no-op.
|
|
982
|
+
* - bun `db.transaction(fn)` → BEGIN/COMMIT/ROLLBACK wrapper.
|
|
983
|
+
*
|
|
984
|
+
* Bindings: bun accepts booleans; node:sqlite rejects them (see the note in
|
|
985
|
+
* `src/tools/shared/sqlite-reader.ts`). `SQLQueryBindings` therefore includes
|
|
986
|
+
* `boolean` to match the unmodified OMP write code, and the shim coerces
|
|
987
|
+
* booleans to `1`/`0` before handing values to node:sqlite.
|
|
988
|
+
*
|
|
989
|
+
* Node < 22.13 needs `--experimental-sqlite` and before 22.5 has no
|
|
990
|
+
* `node:sqlite` at all; when the module is missing we throw a clear error.
|
|
991
|
+
*/
|
|
992
|
+
/** Coerce a bun-legal binding into a node:sqlite-legal value (boolean → 1/0). */
|
|
993
|
+
function coerceBinding(value) {
|
|
994
|
+
if (typeof value === "boolean") return value ? 1 : 0;
|
|
995
|
+
if (value === null) return null;
|
|
996
|
+
if (typeof value === "string" || typeof value === "number" || typeof value === "bigint") return value;
|
|
997
|
+
if (value instanceof Uint8Array) return value;
|
|
998
|
+
return value;
|
|
999
|
+
}
|
|
1000
|
+
/**
|
|
1001
|
+
* Count SQL placeholder parameters (`?`/`?NNN`/`:name`/`@name`/`$name`)
|
|
1002
|
+
* outside quoted strings and comments. Replaces bun's `Statement.paramsCount`,
|
|
1003
|
+
* which node:sqlite does not expose.
|
|
1004
|
+
*/
|
|
1005
|
+
function countPlaceholders(sql) {
|
|
1006
|
+
let count = 0;
|
|
1007
|
+
let inSingleQuote = false;
|
|
1008
|
+
let inDoubleQuote = false;
|
|
1009
|
+
let inLineComment = false;
|
|
1010
|
+
let inBlockComment = false;
|
|
1011
|
+
for (let index = 0; index < sql.length; index++) {
|
|
1012
|
+
const char = sql[index];
|
|
1013
|
+
const next = index + 1 < sql.length ? sql[index + 1] : void 0;
|
|
1014
|
+
if (inLineComment) {
|
|
1015
|
+
if (char === "\n") inLineComment = false;
|
|
1016
|
+
continue;
|
|
1017
|
+
}
|
|
1018
|
+
if (inBlockComment) {
|
|
1019
|
+
if (char === "*" && next === "/") {
|
|
1020
|
+
inBlockComment = false;
|
|
1021
|
+
index++;
|
|
1022
|
+
}
|
|
1023
|
+
continue;
|
|
1024
|
+
}
|
|
1025
|
+
if (inSingleQuote) {
|
|
1026
|
+
if (char === "'" && next === "'") index++;
|
|
1027
|
+
else if (char === "'") inSingleQuote = false;
|
|
1028
|
+
continue;
|
|
1029
|
+
}
|
|
1030
|
+
if (inDoubleQuote) {
|
|
1031
|
+
if (char === "\"" && next === "\"") index++;
|
|
1032
|
+
else if (char === "\"") inDoubleQuote = false;
|
|
1033
|
+
continue;
|
|
1034
|
+
}
|
|
1035
|
+
if (char === "'") {
|
|
1036
|
+
inSingleQuote = true;
|
|
1037
|
+
continue;
|
|
1038
|
+
}
|
|
1039
|
+
if (char === "\"") {
|
|
1040
|
+
inDoubleQuote = true;
|
|
1041
|
+
continue;
|
|
1042
|
+
}
|
|
1043
|
+
if (char === "-" && next === "-") {
|
|
1044
|
+
inLineComment = true;
|
|
1045
|
+
index++;
|
|
1046
|
+
continue;
|
|
1047
|
+
}
|
|
1048
|
+
if (char === "/" && next === "*") {
|
|
1049
|
+
inBlockComment = true;
|
|
1050
|
+
index++;
|
|
1051
|
+
continue;
|
|
1052
|
+
}
|
|
1053
|
+
if (char === "?") {
|
|
1054
|
+
count++;
|
|
1055
|
+
continue;
|
|
1056
|
+
}
|
|
1057
|
+
if (char === ":" || char === "@" || char === "$") {
|
|
1058
|
+
const identStart = index + 1;
|
|
1059
|
+
let identEnd = identStart;
|
|
1060
|
+
while (identEnd < sql.length && /[A-Za-z0-9_]/.test(sql[identEnd])) identEnd++;
|
|
1061
|
+
if (identEnd > identStart) {
|
|
1062
|
+
count++;
|
|
1063
|
+
index = identEnd - 1;
|
|
1064
|
+
}
|
|
1065
|
+
}
|
|
1066
|
+
}
|
|
1067
|
+
return count;
|
|
1068
|
+
}
|
|
1069
|
+
/** Wrap a node `StatementSync` in Bun's `Statement` surface. */
|
|
1070
|
+
var Statement = class {
|
|
1071
|
+
#s;
|
|
1072
|
+
constructor(s) {
|
|
1073
|
+
this.#s = s;
|
|
1074
|
+
}
|
|
1075
|
+
/** First result row as `T`, or `null` when the query returned no row. */
|
|
1076
|
+
get(...params) {
|
|
1077
|
+
const row = this.#s.get(...params.map(coerceBinding));
|
|
1078
|
+
return row === void 0 || row === null ? null : row;
|
|
1079
|
+
}
|
|
1080
|
+
/** All result rows; node returns `[]` when there are none — normalise to that. */
|
|
1081
|
+
all(...params) {
|
|
1082
|
+
return this.#s.all(...params.map(coerceBinding)) ?? [];
|
|
1083
|
+
}
|
|
1084
|
+
/** Execute a write statement; returns affected-row and insert info. */
|
|
1085
|
+
run(...params) {
|
|
1086
|
+
const result = this.#s.run(...params.map(coerceBinding));
|
|
1087
|
+
return {
|
|
1088
|
+
changes: Number(result.changes),
|
|
1089
|
+
lastInsertRowid: result.lastInsertRowid
|
|
1090
|
+
};
|
|
1091
|
+
}
|
|
1092
|
+
/** Lazily iterate over result rows. */
|
|
1093
|
+
iterate(...params) {
|
|
1094
|
+
return this.#s.iterate(...params.map(coerceBinding));
|
|
1095
|
+
}
|
|
1096
|
+
/** Number of bind parameters in the prepared SQL. */
|
|
1097
|
+
get paramsCount() {
|
|
1098
|
+
return countPlaceholders(this.#s.sourceSQL);
|
|
1099
|
+
}
|
|
1100
|
+
/** Column names of the result set (for SELECT statements). */
|
|
1101
|
+
get columnNames() {
|
|
1102
|
+
try {
|
|
1103
|
+
return this.#s.columns().map((column) => column.name);
|
|
1104
|
+
} catch {
|
|
1105
|
+
return [];
|
|
1106
|
+
}
|
|
1107
|
+
}
|
|
1108
|
+
/** bun's `finalize()` — node closes statements with the database, so no-op. */
|
|
1109
|
+
finalize() {}
|
|
1110
|
+
};
|
|
1111
|
+
/** Wrap a node `DatabaseSync` in a bun `Database` surface. */
|
|
1112
|
+
var Database = class {
|
|
1113
|
+
s;
|
|
1114
|
+
constructor(path, opts) {
|
|
1115
|
+
if (typeof DatabaseSync === "undefined") throw new Error("DSH: node:sqlite is unavailable in this Node runtime. It requires Node >= 22.13 (without a flag) or >= 22.5 with --experimental-sqlite.");
|
|
1116
|
+
const readOnly = opts?.readonly === true;
|
|
1117
|
+
if (!readOnly && opts?.create === false && !existsSync(path)) throw new Error(`Unable to open database: no such file '${path}'`);
|
|
1118
|
+
this.s = new DatabaseSync(path, { readOnly });
|
|
1119
|
+
}
|
|
1120
|
+
/** Compile a prepared statement. */
|
|
1121
|
+
prepare(sql) {
|
|
1122
|
+
return new Statement(this.s.prepare(sql));
|
|
1123
|
+
}
|
|
1124
|
+
/** Execute a SQL string directly (bun `db.run`); no result row set. */
|
|
1125
|
+
run(sql) {
|
|
1126
|
+
this.s.exec(sql);
|
|
1127
|
+
}
|
|
1128
|
+
/** Execute one or more SQL statements. */
|
|
1129
|
+
exec(sql) {
|
|
1130
|
+
this.s.exec(sql);
|
|
1131
|
+
}
|
|
1132
|
+
/** Run `fn` inside a BEGIN/COMMIT transaction, rolling back on throw. */
|
|
1133
|
+
transaction(fn) {
|
|
1134
|
+
const wrapped = (...args) => {
|
|
1135
|
+
this.s.exec("BEGIN");
|
|
1136
|
+
try {
|
|
1137
|
+
const result = fn(...args);
|
|
1138
|
+
this.s.exec("COMMIT");
|
|
1139
|
+
return result;
|
|
1140
|
+
} catch (err) {
|
|
1141
|
+
try {
|
|
1142
|
+
this.s.exec("ROLLBACK");
|
|
1143
|
+
} catch {}
|
|
1144
|
+
throw err;
|
|
1145
|
+
}
|
|
1146
|
+
};
|
|
1147
|
+
return wrapped;
|
|
1148
|
+
}
|
|
1149
|
+
close() {
|
|
1150
|
+
this.s.close();
|
|
1151
|
+
}
|
|
1152
|
+
};
|
|
1153
|
+
//#endregion
|
|
977
1154
|
//#region src/tools/omp/utils/sixel.ts
|
|
978
1155
|
const SIXEL_START_REGEX = /\x1bP(?:[0-9;]*)q/u;
|
|
979
1156
|
const SIXEL_SEQUENCE_REGEX = /\x1bP(?:[0-9;]*)q[\s\S]*?(?:\x1b\\|\x07)/gu;
|
|
@@ -2960,7 +3137,8 @@ function expandTilde(filePath, home) {
|
|
|
2960
3137
|
return filePath;
|
|
2961
3138
|
}
|
|
2962
3139
|
function expandPath(filePath) {
|
|
2963
|
-
|
|
3140
|
+
const deColoned = /^:(?=[/\\~]|\.\.?[/\\]|[A-Za-z]:)/.test(filePath) ? filePath.slice(1) : filePath;
|
|
3141
|
+
return expandTilde(stripWindowsExtendedLengthPathPrefix(stripFileUrl(normalizeUnicodeSpaces(normalizeAtPrefix(deColoned)))));
|
|
2964
3142
|
}
|
|
2965
3143
|
function isAsciiDriveLetter(value) {
|
|
2966
3144
|
if (value.length !== 1) return false;
|
|
@@ -9338,204 +9516,6 @@ function appendBody(out, section) {
|
|
|
9338
9516
|
if (hidden > 0) out.push(`… (${hidden} more line${hidden === 1 ? "" : "s"})`);
|
|
9339
9517
|
}
|
|
9340
9518
|
//#endregion
|
|
9341
|
-
//#region src/tools/shared/bun-sqlite-shim.ts
|
|
9342
|
-
/**
|
|
9343
|
-
* DSH bun:sqlite shim (node:sqlite implementation).
|
|
9344
|
-
*
|
|
9345
|
-
* OMP tool code (copied verbatim into adapter/omp) imports `bun:sqlite` and
|
|
9346
|
-
* relies on Bun's synchronous SQLite API. Node 22 exposes the same SQLite
|
|
9347
|
-
* engine through `node:sqlite` (`DatabaseSync` / `StatementSync`, experimental
|
|
9348
|
-
* but flag-free since 22.13); this module re-implements the Bun API subset the
|
|
9349
|
-
* ported code actually uses so the OMP sources type-check and run unchanged.
|
|
9350
|
-
*
|
|
9351
|
-
* API differences absorbed here:
|
|
9352
|
-
* - `new Database(path, { readonly })` → `new DatabaseSync(path, { readOnly })`
|
|
9353
|
-
* (node uses camelCase `readOnly`; bun uses lowercase `readonly`).
|
|
9354
|
-
* - bun `create` / `strict` options have no node counterpart: `create` is
|
|
9355
|
-
* honoured by refusing to open a missing file, and `strict` is ignored
|
|
9356
|
-
* (node:sqlite STRICT-table handling is a per-CREATE concern, not a flag).
|
|
9357
|
-
* - bun `db.run(sql)` → node `db.exec(sql)` (both execute SQL without a
|
|
9358
|
-
* returned row set).
|
|
9359
|
-
* - node `StatementSync.get` returns `undefined` (no row) — the shim maps it
|
|
9360
|
-
* to `null` so bun-shaped callers that declare `T | null` type-check.
|
|
9361
|
-
* - node `StatementSync.all` returns `[]` (no rows) — bun matches too; the
|
|
9362
|
-
* shim keeps node's array and normalises `null` to `[]` defensively.
|
|
9363
|
-
* - bun `Statement.paramsCount` / `Statement.columnNames` → derived from the
|
|
9364
|
-
* node statement's `sourceSQL` (parameter scan) and `columns()` metadata.
|
|
9365
|
-
* - node has no `Statement.finalize()` — statements are closed with the
|
|
9366
|
-
* database, so `finalize()` is a safe no-op.
|
|
9367
|
-
* - bun `db.transaction(fn)` → BEGIN/COMMIT/ROLLBACK wrapper.
|
|
9368
|
-
*
|
|
9369
|
-
* Bindings: bun accepts booleans; node:sqlite rejects them (see the note in
|
|
9370
|
-
* `src/tools/shared/sqlite-reader.ts`). `SQLQueryBindings` therefore includes
|
|
9371
|
-
* `boolean` to match the unmodified OMP write code, and the shim coerces
|
|
9372
|
-
* booleans to `1`/`0` before handing values to node:sqlite.
|
|
9373
|
-
*
|
|
9374
|
-
* Node < 22.13 needs `--experimental-sqlite` and before 22.5 has no
|
|
9375
|
-
* `node:sqlite` at all; when the module is missing we throw a clear error.
|
|
9376
|
-
*/
|
|
9377
|
-
/** Coerce a bun-legal binding into a node:sqlite-legal value (boolean → 1/0). */
|
|
9378
|
-
function coerceBinding(value) {
|
|
9379
|
-
if (typeof value === "boolean") return value ? 1 : 0;
|
|
9380
|
-
if (value === null) return null;
|
|
9381
|
-
if (typeof value === "string" || typeof value === "number" || typeof value === "bigint") return value;
|
|
9382
|
-
if (value instanceof Uint8Array) return value;
|
|
9383
|
-
return value;
|
|
9384
|
-
}
|
|
9385
|
-
/**
|
|
9386
|
-
* Count SQL placeholder parameters (`?`/`?NNN`/`:name`/`@name`/`$name`)
|
|
9387
|
-
* outside quoted strings and comments. Replaces bun's `Statement.paramsCount`,
|
|
9388
|
-
* which node:sqlite does not expose.
|
|
9389
|
-
*/
|
|
9390
|
-
function countPlaceholders(sql) {
|
|
9391
|
-
let count = 0;
|
|
9392
|
-
let inSingleQuote = false;
|
|
9393
|
-
let inDoubleQuote = false;
|
|
9394
|
-
let inLineComment = false;
|
|
9395
|
-
let inBlockComment = false;
|
|
9396
|
-
for (let index = 0; index < sql.length; index++) {
|
|
9397
|
-
const char = sql[index];
|
|
9398
|
-
const next = index + 1 < sql.length ? sql[index + 1] : void 0;
|
|
9399
|
-
if (inLineComment) {
|
|
9400
|
-
if (char === "\n") inLineComment = false;
|
|
9401
|
-
continue;
|
|
9402
|
-
}
|
|
9403
|
-
if (inBlockComment) {
|
|
9404
|
-
if (char === "*" && next === "/") {
|
|
9405
|
-
inBlockComment = false;
|
|
9406
|
-
index++;
|
|
9407
|
-
}
|
|
9408
|
-
continue;
|
|
9409
|
-
}
|
|
9410
|
-
if (inSingleQuote) {
|
|
9411
|
-
if (char === "'" && next === "'") index++;
|
|
9412
|
-
else if (char === "'") inSingleQuote = false;
|
|
9413
|
-
continue;
|
|
9414
|
-
}
|
|
9415
|
-
if (inDoubleQuote) {
|
|
9416
|
-
if (char === "\"" && next === "\"") index++;
|
|
9417
|
-
else if (char === "\"") inDoubleQuote = false;
|
|
9418
|
-
continue;
|
|
9419
|
-
}
|
|
9420
|
-
if (char === "'") {
|
|
9421
|
-
inSingleQuote = true;
|
|
9422
|
-
continue;
|
|
9423
|
-
}
|
|
9424
|
-
if (char === "\"") {
|
|
9425
|
-
inDoubleQuote = true;
|
|
9426
|
-
continue;
|
|
9427
|
-
}
|
|
9428
|
-
if (char === "-" && next === "-") {
|
|
9429
|
-
inLineComment = true;
|
|
9430
|
-
index++;
|
|
9431
|
-
continue;
|
|
9432
|
-
}
|
|
9433
|
-
if (char === "/" && next === "*") {
|
|
9434
|
-
inBlockComment = true;
|
|
9435
|
-
index++;
|
|
9436
|
-
continue;
|
|
9437
|
-
}
|
|
9438
|
-
if (char === "?") {
|
|
9439
|
-
count++;
|
|
9440
|
-
continue;
|
|
9441
|
-
}
|
|
9442
|
-
if (char === ":" || char === "@" || char === "$") {
|
|
9443
|
-
const identStart = index + 1;
|
|
9444
|
-
let identEnd = identStart;
|
|
9445
|
-
while (identEnd < sql.length && /[A-Za-z0-9_]/.test(sql[identEnd])) identEnd++;
|
|
9446
|
-
if (identEnd > identStart) {
|
|
9447
|
-
count++;
|
|
9448
|
-
index = identEnd - 1;
|
|
9449
|
-
}
|
|
9450
|
-
}
|
|
9451
|
-
}
|
|
9452
|
-
return count;
|
|
9453
|
-
}
|
|
9454
|
-
/** Wrap a node `StatementSync` in Bun's `Statement` surface. */
|
|
9455
|
-
var Statement = class {
|
|
9456
|
-
#s;
|
|
9457
|
-
constructor(s) {
|
|
9458
|
-
this.#s = s;
|
|
9459
|
-
}
|
|
9460
|
-
/** First result row as `T`, or `null` when the query returned no row. */
|
|
9461
|
-
get(...params) {
|
|
9462
|
-
const row = this.#s.get(...params.map(coerceBinding));
|
|
9463
|
-
return row === void 0 || row === null ? null : row;
|
|
9464
|
-
}
|
|
9465
|
-
/** All result rows; node returns `[]` when there are none — normalise to that. */
|
|
9466
|
-
all(...params) {
|
|
9467
|
-
return this.#s.all(...params.map(coerceBinding)) ?? [];
|
|
9468
|
-
}
|
|
9469
|
-
/** Execute a write statement; returns affected-row and insert info. */
|
|
9470
|
-
run(...params) {
|
|
9471
|
-
const result = this.#s.run(...params.map(coerceBinding));
|
|
9472
|
-
return {
|
|
9473
|
-
changes: Number(result.changes),
|
|
9474
|
-
lastInsertRowid: result.lastInsertRowid
|
|
9475
|
-
};
|
|
9476
|
-
}
|
|
9477
|
-
/** Lazily iterate over result rows. */
|
|
9478
|
-
iterate(...params) {
|
|
9479
|
-
return this.#s.iterate(...params.map(coerceBinding));
|
|
9480
|
-
}
|
|
9481
|
-
/** Number of bind parameters in the prepared SQL. */
|
|
9482
|
-
get paramsCount() {
|
|
9483
|
-
return countPlaceholders(this.#s.sourceSQL);
|
|
9484
|
-
}
|
|
9485
|
-
/** Column names of the result set (for SELECT statements). */
|
|
9486
|
-
get columnNames() {
|
|
9487
|
-
try {
|
|
9488
|
-
return this.#s.columns().map((column) => column.name);
|
|
9489
|
-
} catch {
|
|
9490
|
-
return [];
|
|
9491
|
-
}
|
|
9492
|
-
}
|
|
9493
|
-
/** bun's `finalize()` — node closes statements with the database, so no-op. */
|
|
9494
|
-
finalize() {}
|
|
9495
|
-
};
|
|
9496
|
-
/** Wrap a node `DatabaseSync` in a bun `Database` surface. */
|
|
9497
|
-
var Database = class {
|
|
9498
|
-
s;
|
|
9499
|
-
constructor(path, opts) {
|
|
9500
|
-
if (typeof DatabaseSync === "undefined") throw new Error("DSH: node:sqlite is unavailable in this Node runtime. It requires Node >= 22.13 (without a flag) or >= 22.5 with --experimental-sqlite.");
|
|
9501
|
-
const readOnly = opts?.readonly === true;
|
|
9502
|
-
if (!readOnly && opts?.create === false && !existsSync(path)) throw new Error(`Unable to open database: no such file '${path}'`);
|
|
9503
|
-
this.s = new DatabaseSync(path, { readOnly });
|
|
9504
|
-
}
|
|
9505
|
-
/** Compile a prepared statement. */
|
|
9506
|
-
prepare(sql) {
|
|
9507
|
-
return new Statement(this.s.prepare(sql));
|
|
9508
|
-
}
|
|
9509
|
-
/** Execute a SQL string directly (bun `db.run`); no result row set. */
|
|
9510
|
-
run(sql) {
|
|
9511
|
-
this.s.exec(sql);
|
|
9512
|
-
}
|
|
9513
|
-
/** Execute one or more SQL statements. */
|
|
9514
|
-
exec(sql) {
|
|
9515
|
-
this.s.exec(sql);
|
|
9516
|
-
}
|
|
9517
|
-
/** Run `fn` inside a BEGIN/COMMIT transaction, rolling back on throw. */
|
|
9518
|
-
transaction(fn) {
|
|
9519
|
-
const wrapped = (...args) => {
|
|
9520
|
-
this.s.exec("BEGIN");
|
|
9521
|
-
try {
|
|
9522
|
-
const result = fn(...args);
|
|
9523
|
-
this.s.exec("COMMIT");
|
|
9524
|
-
return result;
|
|
9525
|
-
} catch (err) {
|
|
9526
|
-
try {
|
|
9527
|
-
this.s.exec("ROLLBACK");
|
|
9528
|
-
} catch {}
|
|
9529
|
-
throw err;
|
|
9530
|
-
}
|
|
9531
|
-
};
|
|
9532
|
-
return wrapped;
|
|
9533
|
-
}
|
|
9534
|
-
close() {
|
|
9535
|
-
this.s.close();
|
|
9536
|
-
}
|
|
9537
|
-
};
|
|
9538
|
-
//#endregion
|
|
9539
9519
|
//#region src/tools/omp/utils/image-resize.ts
|
|
9540
9520
|
const DEFAULT_OPTIONS = {
|
|
9541
9521
|
maxWidth: 1568,
|
|
@@ -11096,7 +11076,7 @@ function cleanFeedText(text) {
|
|
|
11096
11076
|
* Parse RSS/Atom feed to markdown
|
|
11097
11077
|
*/
|
|
11098
11078
|
async function parseFeedToMarkdown(content, maxItems = 10) {
|
|
11099
|
-
const { parseHTML } = await import("./dom-
|
|
11079
|
+
const { parseHTML } = await import("./dom-BmbZv4v9.mjs");
|
|
11100
11080
|
try {
|
|
11101
11081
|
const doc = parseHTML(content).document;
|
|
11102
11082
|
const channel = doc.querySelector("channel");
|
|
@@ -11258,7 +11238,7 @@ async function renderHtmlToText(url, html, timeout, settings, userSignal, storag
|
|
|
11258
11238
|
},
|
|
11259
11239
|
browser: async () => {
|
|
11260
11240
|
if (settings.get("browser.readerEnabled") === false) return null;
|
|
11261
|
-
const { renderUrlWithBrowser } = await import("./browser-render-
|
|
11241
|
+
const { renderUrlWithBrowser } = await import("./browser-render-BQaEVK_n.mjs");
|
|
11262
11242
|
return renderUrlWithBrowser(url, {
|
|
11263
11243
|
timeoutMs: remoteBudgetMs,
|
|
11264
11244
|
signal: userSignal
|
|
@@ -11479,7 +11459,7 @@ let specialHandlersPromise;
|
|
|
11479
11459
|
* requires a special handler, so we keep them out of the cold-startup graph.
|
|
11480
11460
|
*/
|
|
11481
11461
|
function loadSpecialHandlers() {
|
|
11482
|
-
specialHandlersPromise ??= import("./scrapers-
|
|
11462
|
+
specialHandlersPromise ??= import("./scrapers-B6PADOVm.mjs").then((m) => m.specialHandlers);
|
|
11483
11463
|
return specialHandlersPromise;
|
|
11484
11464
|
}
|
|
11485
11465
|
/**
|
|
@@ -15487,7 +15467,7 @@ async function writethroughNoop(dst, content, _signal, file) {
|
|
|
15487
15467
|
}
|
|
15488
15468
|
/** Async UTF-8 write (node:fs) used when no file handle is supplied. */
|
|
15489
15469
|
async function writeFileUtf8(dst, content) {
|
|
15490
|
-
const { writeFile, mkdir } = await import("./fs-promises-shim-
|
|
15470
|
+
const { writeFile, mkdir } = await import("./fs-promises-shim-CANAxFWh.mjs").then((n) => n.n);
|
|
15491
15471
|
const { dirname } = await import("node:path");
|
|
15492
15472
|
try {
|
|
15493
15473
|
await writeFile(dst, content, "utf8");
|
|
@@ -19356,6 +19336,16 @@ function canonicalCwd(cwd) {
|
|
|
19356
19336
|
}
|
|
19357
19337
|
}
|
|
19358
19338
|
/**
|
|
19339
|
+
* Mirror upstream `displayMaxColumns`: read's per-line cap bounded by the
|
|
19340
|
+
* shared `DEFAULT_MAX_COLUMN`, falling back to the constant when read never
|
|
19341
|
+
* cuts lines. The engine uses it to decide whether a hashline anchor that was
|
|
19342
|
+
* never displayed by `read` can still be trusted on a long line.
|
|
19343
|
+
*/
|
|
19344
|
+
function resolveMaxColumns(session) {
|
|
19345
|
+
const readMaxColumns = resolveOutputMaxColumns(session.settings);
|
|
19346
|
+
return readMaxColumns > 0 ? Math.min(readMaxColumns, 512) : 512;
|
|
19347
|
+
}
|
|
19348
|
+
/**
|
|
19359
19349
|
* Build the engine policy for one `hashline` tool call.
|
|
19360
19350
|
*
|
|
19361
19351
|
* Field sources (all reads go through the DSH settings facade, which maps the
|
|
@@ -19391,27 +19381,25 @@ function canonicalCwd(cwd) {
|
|
|
19391
19381
|
* documents `enforcePlanModeWrite` as a deliberate
|
|
19392
19382
|
* no-op), and no DSH session installs
|
|
19393
19383
|
* `getPlanModeState`, so this resolves to `false`.
|
|
19394
|
-
* - `
|
|
19395
|
-
* `
|
|
19396
|
-
*
|
|
19397
|
-
*
|
|
19398
|
-
*
|
|
19399
|
-
*
|
|
19400
|
-
*
|
|
19401
|
-
*
|
|
19402
|
-
*
|
|
19403
|
-
*
|
|
19404
|
-
*
|
|
19405
|
-
*
|
|
19406
|
-
*
|
|
19407
|
-
*
|
|
19408
|
-
*
|
|
19409
|
-
*
|
|
19410
|
-
*
|
|
19411
|
-
*
|
|
19412
|
-
*
|
|
19413
|
-
* - `vaultRoots` — upstream `isVaultEnabled() ? cachedVaultRoots() : …`.
|
|
19414
|
-
* DSH has no `vault://` protocol → `undefined`.
|
|
19384
|
+
* - `maxColumns` — upstream `displayMaxColumns(settings)`: read's
|
|
19385
|
+
* `tools.outputMaxColumns` bounded by
|
|
19386
|
+
* `DEFAULT_MAX_COLUMN` (512), or 512 when read never
|
|
19387
|
+
* cuts lines. DSH resolves the same setting through
|
|
19388
|
+
* `resolveOutputMaxColumns`, so the mapping stays
|
|
19389
|
+
* identical; the engine uses this cap to decide when a
|
|
19390
|
+
* hashline anchor on a long line needs recorded read
|
|
19391
|
+
* provenance.
|
|
19392
|
+
* - `urlSchemes` / `urlAliasSchemes` — upstream lists the internal-URL
|
|
19393
|
+
* router specs (and the schemes whose `scheme:/x`
|
|
19394
|
+
* spelling aliases `scheme://x`). DSH wires no
|
|
19395
|
+
* internal-URL router into the edit path and installs
|
|
19396
|
+
* no `resolveUrl` callback, so both stay empty: the
|
|
19397
|
+
* engine only ever sees plain paths here.
|
|
19398
|
+
* - `planWritableRoots` — upstream `router.sandboxRoots(context)`: plain-path
|
|
19399
|
+
* roots writable while plan mode is active. DSH's
|
|
19400
|
+
* plan mode is a hint layer with no sandbox roots, so
|
|
19401
|
+
* this stays empty while `planActive` still carries
|
|
19402
|
+
* the hint.
|
|
19415
19403
|
* - `homeDir` — `os.homedir()` (upstream :571); the engine uses it
|
|
19416
19404
|
* to recognise and refuse home-directory escapes.
|
|
19417
19405
|
* - `rawInput` — see {@link HashlinePolicyOptions.rawInput}.
|
|
@@ -19423,10 +19411,12 @@ function buildHashlineEditPolicy(session, options = {}) {
|
|
|
19423
19411
|
allowFuzzy: session.settings.get("edit.fuzzyMatch") !== false,
|
|
19424
19412
|
fuzzyThreshold: resolveFuzzyThreshold$1(session.settings.get("edit.fuzzyThreshold")),
|
|
19425
19413
|
enforceSeenLines: session.settings.get("edit.enforceSeenLines") === true,
|
|
19414
|
+
maxColumns: resolveMaxColumns(session),
|
|
19426
19415
|
blockAutoGenerated: session.settings.get("edit.blockAutoGenerated") !== false,
|
|
19427
19416
|
planActive: session.getPlanModeState?.()?.enabled ?? false,
|
|
19428
|
-
|
|
19429
|
-
|
|
19417
|
+
urlSchemes: [],
|
|
19418
|
+
urlAliasSchemes: [],
|
|
19419
|
+
planWritableRoots: [],
|
|
19430
19420
|
homeDir: os.homedir(),
|
|
19431
19421
|
rawInput: options.rawInput ?? false
|
|
19432
19422
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { installBunShim as __installBunShim } from "./bun-shim.mjs";
|
|
2
2
|
__installBunShim();
|
|
3
|
-
import {
|
|
4
|
-
//#region node_modules/.pnpm/@oh-my-pi+pi-ai@18.
|
|
3
|
+
import { _ as LoginCancelledError, h as OAuthError } from "./error-8LVo7tug.mjs";
|
|
4
|
+
//#region node_modules/.pnpm/@oh-my-pi+pi-ai@18.12.6/node_modules/@oh-my-pi/pi-ai/src/registry/oauth/kilo.ts
|
|
5
5
|
const KILO_DEVICE_AUTH_BASE_URL = "https://api.kilo.ai/api/device-auth";
|
|
6
6
|
const POLL_INTERVAL_MS = 5e3;
|
|
7
7
|
const ONE_YEAR_MS = 31536e6;
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { installBunShim as __installBunShim } from "./bun-shim.mjs";
|
|
2
2
|
__installBunShim();
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { i as __exportAll } from "./fs-promises-shim-CANAxFWh.mjs";
|
|
4
|
+
import { Q as getAgentDir, ht as once } from "./src-BhinCSpi.mjs";
|
|
5
5
|
import * as fs from "node:fs";
|
|
6
6
|
import * as path$1 from "node:path";
|
|
7
7
|
import * as os from "node:os";
|
|
8
8
|
import * as crypto from "node:crypto";
|
|
9
|
-
//#region node_modules/.pnpm/@oh-my-pi+pi-ai@18.
|
|
10
|
-
var version = "18.
|
|
9
|
+
//#region node_modules/.pnpm/@oh-my-pi+pi-ai@18.12.6/node_modules/@oh-my-pi/pi-ai/package.json
|
|
10
|
+
var version = "18.12.6";
|
|
11
11
|
//#endregion
|
|
12
|
-
//#region node_modules/.pnpm/@oh-my-pi+pi-ai@18.
|
|
12
|
+
//#region node_modules/.pnpm/@oh-my-pi+pi-ai@18.12.6/node_modules/@oh-my-pi/pi-ai/src/registry/oauth/kimi.ts
|
|
13
13
|
/**
|
|
14
14
|
* Kimi Code OAuth flow (device authorization grant)
|
|
15
15
|
*/
|
|
@@ -50,8 +50,9 @@ let getDeviceId = () => {
|
|
|
50
50
|
function sanitizeHeaderValue(value, fallback = "") {
|
|
51
51
|
return value.replace(/[^\x20-\x7E]/g, "").trim() || fallback;
|
|
52
52
|
}
|
|
53
|
-
|
|
54
|
-
|
|
53
|
+
/** Lazily resolve the process-stable device headers used by Kimi requests. */
|
|
54
|
+
const getKimiCommonHeaders = once(() => {
|
|
55
|
+
return Object.freeze({
|
|
55
56
|
"User-Agent": `KimiCLI/${version}`,
|
|
56
57
|
"X-Msh-Platform": "kimi_cli",
|
|
57
58
|
"X-Msh-Version": version,
|
|
@@ -60,8 +61,6 @@ let getKimiCommonHeaders = () => {
|
|
|
60
61
|
"X-Msh-Os-Version": sanitizeHeaderValue(os.version(), "unknown"),
|
|
61
62
|
"X-Msh-Device-Id": sanitizeHeaderValue(getDeviceId(), "unknown")
|
|
62
63
|
});
|
|
63
|
-
|
|
64
|
-
return headers;
|
|
65
|
-
};
|
|
64
|
+
});
|
|
66
65
|
//#endregion
|
|
67
66
|
export { kimi_exports as n, getKimiCommonHeaders as t };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { installBunShim as __installBunShim } from "./bun-shim.mjs";
|
|
2
2
|
__installBunShim();
|
|
3
|
-
import { d as
|
|
3
|
+
import { d as exec, m as $which } from "./src-BhinCSpi.mjs";
|
|
4
4
|
import * as fs from "node:fs";
|
|
5
5
|
import * as path$1 from "node:path";
|
|
6
6
|
import * as os from "node:os";
|