@sourcegraph/amp 0.0.1748592090-g82886f → 0.0.1748620891-gf6fd33
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/amp.js +2 -2
- package/dist/{color-KZLHE9lz.js → console-B_a7AZVs.js} +9921 -9906
- package/dist/console-B_a7AZVs.js.map +1 -0
- package/dist/{create_file.node-CeO77-N9.js → create_file.node-DLgtL-Xm.js} +2 -2
- package/dist/{create_file.node-CeO77-N9.js.map → create_file.node-DLgtL-Xm.js.map} +1 -1
- package/dist/{edit_file.node-BRayGlMY.js → edit_file.node-CrnktvWL.js} +9 -9
- package/dist/{edit_file.node-BRayGlMY.js.map → edit_file.node-CrnktvWL.js.map} +1 -1
- package/dist/{executable-rYoa-LRU.js → executable-BglMpb2E.js} +2 -2
- package/dist/{executable-rYoa-LRU.js.map → executable-BglMpb2E.js.map} +1 -1
- package/dist/{files-DRNnhOmo.js → files-gDsYEnW1.js} +2 -2
- package/dist/{files-DRNnhOmo.js.map → files-gDsYEnW1.js.map} +1 -1
- package/dist/{glob.node-agGBjrBg.js → glob.node-CMSCjukj.js} +40 -40
- package/dist/{glob.node-agGBjrBg.js.map → glob.node-CMSCjukj.js.map} +1 -1
- package/dist/{list_directory.node-TYM6mPMl.js → list_directory.node-BTLRHJ48.js} +2 -2
- package/dist/{list_directory.node-TYM6mPMl.js.map → list_directory.node-BTLRHJ48.js.map} +1 -1
- package/dist/{load-profile-DfzWNpRA.js → load-profile-DCv3-1Ka.js} +2 -2
- package/dist/{load-profile-DfzWNpRA.js.map → load-profile-DCv3-1Ka.js.map} +1 -1
- package/dist/{main-d0nDM7GJ.js → main-DQsFuGGG.js} +32815 -32767
- package/dist/main-DQsFuGGG.js.map +1 -0
- package/dist/{node-CDZC4DW9.js → node-4Pn7H_vJ.js} +3 -3
- package/dist/{node-CDZC4DW9.js.map → node-4Pn7H_vJ.js.map} +1 -1
- package/dist/{node-DkV0OdKk.js → node-B8WXoxgO.js} +14 -14
- package/dist/{node-DkV0OdKk.js.map → node-B8WXoxgO.js.map} +1 -1
- package/dist/{node-COuJYHx_.js → node-CBVbC8Le.js} +47 -47
- package/dist/{node-COuJYHx_.js.map → node-CBVbC8Le.js.map} +1 -1
- package/dist/{node-DWXaFMNz.js → node-CODo0ZrH.js} +2 -2
- package/dist/{node-DWXaFMNz.js.map → node-CODo0ZrH.js.map} +1 -1
- package/dist/{node-HdWhJMp3.js → node-Cb0kHKh8.js} +8 -8
- package/dist/{node-HdWhJMp3.js.map → node-Cb0kHKh8.js.map} +1 -1
- package/dist/{node-XQHPbSSO.js → node-u8kG41tu.js} +3 -3
- package/dist/{node-XQHPbSSO.js.map → node-u8kG41tu.js.map} +1 -1
- package/dist/{read_file.node-2KNKpy--.js → read_file.node-BD8KJm_C.js} +2 -2
- package/dist/{read_file.node-2KNKpy--.js.map → read_file.node-BD8KJm_C.js.map} +1 -1
- package/dist/{stdio-GkdttQu7.js → stdio-B8D5AKpo.js} +12 -12
- package/dist/{stdio-GkdttQu7.js.map → stdio-B8D5AKpo.js.map} +1 -1
- package/dist/storybook.js +1 -1
- package/dist/{undo_edit.node-C8Hv1wkP.js → undo_edit.node-CKspKBvM.js} +4 -4
- package/dist/{undo_edit.node-C8Hv1wkP.js.map → undo_edit.node-CKspKBvM.js.map} +1 -1
- package/package.json +1 -1
- package/dist/color-KZLHE9lz.js.map +0 -1
- package/dist/main-d0nDM7GJ.js.map +0 -1
@@ -1,6 +1,6 @@
|
|
1
1
|
#!/usr/bin/env node
|
2
2
|
import d from "node:path";
|
3
|
-
import { p as f,
|
3
|
+
import { p as f, aQ as l, av as u } from "./console-B_a7AZVs.js";
|
4
4
|
const w = ({ args: t }, { dir: a, dirs: i, trackFileChange: c, filesystem: r }) => f(async (e) => {
|
5
5
|
if (l(a), typeof t.content != "string")
|
6
6
|
throw new Error("create_file: content must be specified");
|
@@ -21,4 +21,4 @@ const w = ({ args: t }, { dir: a, dirs: i, trackFileChange: c, filesystem: r })
|
|
21
21
|
export {
|
22
22
|
w as nodeCreateFileTool
|
23
23
|
};
|
24
|
-
//# sourceMappingURL=create_file.node-
|
24
|
+
//# sourceMappingURL=create_file.node-DLgtL-Xm.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"create_file.node-
|
1
|
+
{"version":3,"file":"create_file.node-DLgtL-Xm.js","sources":["../../core/src/tools/builtin/filesystem/create_file.node.ts"],"sourcesContent":["import { promiseFactoryToObservable } from '@sourcegraph/observable'\nimport path from 'path'\nimport { checkDirURIIsFile } from '../node-helpers'\nimport type { createFileToolReg } from './create_file.common'\nimport { resolveArgumentPath } from './read_file.util'\n\nexport const nodeCreateFileTool: NonNullable<typeof createFileToolReg.fn> = (\n\t{ args },\n\t{ dir, dirs, trackFileChange, filesystem },\n) => {\n\treturn promiseFactoryToObservable(async (signal) => {\n\t\tcheckDirURIIsFile(dir)\n\t\tif (typeof args.content !== 'string') {\n\t\t\tthrow new Error('create_file: content must be specified')\n\t\t}\n\n\t\tsignal.throwIfAborted()\n\n\t\tconst fullPath = await resolveArgumentPath(filesystem, dirs, args.path, signal)\n\t\tconst dirname = path.dirname(fullPath)\n\t\tawait filesystem.mkdirp(dirname, signal)\n\n\t\tlet content = args.content\n\t\t// HACK: the Anthropic tool calling API appears to trim whitespace from around all tool args.\n\t\t// When we create files, we _almost always_ want to create them with a trailing newline.\n\t\t// More info here: https://sourcegraph.slack.com/archives/C04D0GRD1GB/p1747064252012509\n\t\tif (!content.endsWith('\\n')) {\n\t\t\tcontent += '\\n'\n\t\t}\n\t\tawait trackFileChange(fullPath, async (path) => {\n\t\t\tawait filesystem.writeFile(path, content, signal)\n\t\t})\n\t\treturn {\n\t\t\tstatus: 'done',\n\t\t\tresult: `Successfully created file ${args.path}`,\n\t\t\tfiles: [args.path],\n\t\t}\n\t})\n}\n"],"names":["nodeCreateFileTool","args","dir","dirs","trackFileChange","filesystem","promiseFactoryToObservable","signal","checkDirURIIsFile","fullPath","resolveArgumentPath","dirname","path","content"],"mappings":";;;AAMa,MAAAA,IAA+D,CAC3E,EAAE,MAAAC,KACF,EAAE,KAAAC,GAAK,MAAAC,GAAM,iBAAAC,GAAiB,YAAAC,QAEvBC,EAA2B,OAAOC,MAAW;AAE/C,MADJC,EAAkBN,CAAG,GACjB,OAAOD,EAAK,WAAY;AACrB,UAAA,IAAI,MAAM,wCAAwC;AAGzD,EAAAM,EAAO,eAAe;AAEtB,QAAME,IAAW,MAAMC,EAAoBL,GAAYF,GAAMF,EAAK,MAAMM,CAAM,GACxEI,IAAUC,EAAK,QAAQH,CAAQ;AAC/B,QAAAJ,EAAW,OAAOM,GAASJ,CAAM;AAEvC,MAAIM,IAAUZ,EAAK;AAInB,SAAKY,EAAQ,SAAS;AAAA,CAAI,MACdA,KAAA;AAAA,IAEN,MAAAT,EAAgBK,GAAU,OAAOG,MAAS;AAC/C,UAAMP,EAAW,UAAUO,GAAMC,GAASN,CAAM;AAAA,EAAA,CAChD,GACM;AAAA,IACN,QAAQ;AAAA,IACR,QAAQ,6BAA6BN,EAAK,IAAI;AAAA,IAC9C,OAAO,CAACA,EAAK,IAAI;AAAA,EAClB;AAAA,CACA;"}
|
@@ -1,7 +1,7 @@
|
|
1
1
|
#!/usr/bin/env node
|
2
|
-
import { p,
|
3
|
-
import { recordEdit as x } from "./undo_edit.node-
|
4
|
-
class
|
2
|
+
import { p, aQ as m, av as v, aR as F, aS as _, aT as b } from "./console-B_a7AZVs.js";
|
3
|
+
import { recordEdit as x } from "./undo_edit.node-CKspKBvM.js";
|
4
|
+
class R {
|
5
5
|
#e = !1;
|
6
6
|
#t = [];
|
7
7
|
/**
|
@@ -21,13 +21,13 @@ class T {
|
|
21
21
|
this.#t.length > 0 ? this.#t.shift()?.() : this.#e = !1;
|
22
22
|
}
|
23
23
|
}
|
24
|
-
const l = new
|
24
|
+
const l = new R(), k = ({ args: e }, { dir: t, dirs: d, threadID: u, trackFileChange: h, filesystem: i }) => p(async (a) => {
|
25
25
|
await l.acquire();
|
26
26
|
try {
|
27
|
-
|
28
|
-
const r = await
|
27
|
+
T(e), m(t);
|
28
|
+
const r = await v(i, d, e.path, a);
|
29
29
|
if (!i.exclusiveWriter) {
|
30
|
-
const s =
|
30
|
+
const s = F(r, u), c = await i.getMtime(r);
|
31
31
|
if (s && c && s !== c)
|
32
32
|
return {
|
33
33
|
status: "error",
|
@@ -58,11 +58,11 @@ const l = new T(), k = ({ args: e }, { dir: t, dirs: d, threadID: u, trackFileCh
|
|
58
58
|
l.release();
|
59
59
|
}
|
60
60
|
});
|
61
|
-
function
|
61
|
+
function T(e) {
|
62
62
|
if (e = b.parse(e), e.old_str === e.new_str)
|
63
63
|
throw new Error("old_str and new_str must be different from each other.");
|
64
64
|
}
|
65
65
|
export {
|
66
66
|
k as nodeEditFileTool
|
67
67
|
};
|
68
|
-
//# sourceMappingURL=edit_file.node-
|
68
|
+
//# sourceMappingURL=edit_file.node-CrnktvWL.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"edit_file.node-
|
1
|
+
{"version":3,"file":"edit_file.node-CrnktvWL.js","sources":["../../core/src/utils/async_mutex.ts","../../core/src/tools/builtin/filesystem/edit_file.node.ts"],"sourcesContent":["export class AsyncMutex {\n\t#locked = false\n\t#queue: (() => void)[] = []\n\n\t/**\n\t * Acquires the lock. If the lock is already held, waits until it is released.\n\t * @returns A promise that resolves when the lock is acquired.\n\t */\n\tasync acquire(): Promise<void> {\n\t\treturn new Promise<void>((resolve) => {\n\t\t\tif (!this.#locked) {\n\t\t\t\t// Lock is free, acquire it immediately\n\t\t\t\tthis.#locked = true\n\t\t\t\tresolve()\n\t\t\t} else {\n\t\t\t\t// Lock is held, add the resolver to the queue\n\t\t\t\tthis.#queue.push(resolve)\n\t\t\t}\n\t\t})\n\t}\n\n\t/**\n\t * Releases the lock. If there are waiters in the queue, the next one acquires the lock.\n\t * Otherwise, the lock becomes free.\n\t */\n\trelease(): void {\n\t\tif (this.#queue.length > 0) {\n\t\t\t// Pass the lock to the next waiter without setting #locked to false\n\t\t\tconst nextResolve = this.#queue.shift()\n\t\t\t// The next waiter's promise resolves, and *they* now hold the lock.\n\t\t\t// #locked remains true.\n\t\t\tnextResolve?.()\n\t\t} else {\n\t\t\t// No waiters, release the lock\n\t\t\tthis.#locked = false\n\t\t}\n\t}\n}\n","import { promiseFactoryToObservable } from '@sourcegraph/observable'\nimport { getFileModTime } from '../../../threads/file-tracking/common'\nimport { AsyncMutex } from '../../../utils/async_mutex'\nimport { checkDirURIIsFile } from '../node-helpers'\nimport type { EditFileToolDef, editFileToolReg } from './edit_file.common'\nimport { applyFileEdits, editFileArgsSchema } from './edit_file.common'\nimport { resolveArgumentPath } from './read_file.util'\nimport { recordEdit } from './undo_edit.node'\n\nconst runningMutex = new AsyncMutex()\n\nexport const nodeEditFileTool: NonNullable<(typeof editFileToolReg)['fn']> = (\n\t{ args },\n\t{ dir, dirs, threadID, trackFileChange, filesystem },\n) => {\n\treturn promiseFactoryToObservable(async (signal) => {\n\t\tawait runningMutex.acquire()\n\t\ttry {\n\t\t\tcheckEditArgs(args)\n\n\t\t\tcheckDirURIIsFile(dir)\n\n\t\t\tconst filePath = await resolveArgumentPath(filesystem, dirs, args.path, signal)\n\n\t\t\tif (!filesystem.exclusiveWriter) {\n\t\t\t\tconst lastReadTime = getFileModTime(filePath, threadID)\n\t\t\t\tconst currentMtime = await filesystem.getMtime(filePath)\n\t\t\t\tif (lastReadTime && currentMtime && lastReadTime !== currentMtime) {\n\t\t\t\t\treturn {\n\t\t\t\t\t\tstatus: 'error' as const,\n\t\t\t\t\t\tprogress: {},\n\t\t\t\t\t\terror: {\n\t\t\t\t\t\t\tmessage: `The file '${args.path}' has been modified since you last read it. Please use read_file to view the current version before making edits.`,\n\t\t\t\t\t\t},\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tconst content = await filesystem.readFile(filePath, signal)\n\t\t\tconst { modifiedContent, formattedDiff, lineRange } = await applyFileEdits(\n\t\t\t\targs.path,\n\t\t\t\tcontent,\n\t\t\t\targs.old_str,\n\t\t\t\targs.new_str,\n\t\t\t)\n\n\t\t\tawait recordEdit(args.path, content, modifiedContent)\n\n\t\t\tawait trackFileChange(filePath, async (path) => {\n\t\t\t\tawait filesystem.writeFile(path, modifiedContent, signal)\n\t\t\t})\n\n\t\t\tconst result = {\n\t\t\t\tdiff: formattedDiff,\n\t\t\t\tlineRange,\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\tstatus: 'done',\n\t\t\t\tprogress: {},\n\t\t\t\tresult,\n\t\t\t\tfiles: [args.path],\n\t\t\t}\n\t\t} finally {\n\t\t\trunningMutex.release()\n\t\t}\n\t})\n}\n\nfunction checkEditArgs(args: EditFileToolDef['args']): asserts args is EditFileToolDef['args'] {\n\targs = editFileArgsSchema.parse(args)\n\tif (args.old_str === args.new_str) {\n\t\tthrow new Error('old_str and new_str must be different from each other.')\n\t}\n}\n"],"names":["AsyncMutex","#locked","#queue","resolve","runningMutex","nodeEditFileTool","args","dir","dirs","threadID","trackFileChange","filesystem","promiseFactoryToObservable","signal","checkEditArgs","checkDirURIIsFile","filePath","resolveArgumentPath","lastReadTime","getFileModTime","currentMtime","content","modifiedContent","formattedDiff","lineRange","applyFileEdits","recordEdit","path","editFileArgsSchema"],"mappings":";;;AAAO,MAAMA,EAAW;AAAA,EACvBC,KAAU;AAAA,EACVC,KAAyB,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA,EAM1B,MAAM,UAAyB;AACvB,WAAA,IAAI,QAAc,CAACC,MAAY;AACjC,MAAC,KAAKF,KAMJ,KAAAC,GAAO,KAAKC,CAAO,KAJxB,KAAKF,KAAU,IACPE,EAAA;AAAA,IAIT,CACA;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOF,UAAgB;AACX,IAAA,KAAKD,GAAO,SAAS,IAEJ,KAAKA,GAAO,MAAM,IAGxB,IAGd,KAAKD,KAAU;AAAA,EAChB;AAEF;AC5BA,MAAMG,IAAe,IAAIJ,EAAW,GAEvBK,IAAgE,CAC5E,EAAE,MAAAC,EAAK,GACP,EAAE,KAAAC,GAAK,MAAAC,GAAM,UAAAC,GAAU,iBAAAC,GAAiB,YAAAC,QAEjCC,EAA2B,OAAOC,MAAW;AACnD,QAAMT,EAAa,QAAQ;AACvB,MAAA;AACH,IAAAU,EAAcR,CAAI,GAElBS,EAAkBR,CAAG;AAErB,UAAMS,IAAW,MAAMC,EAAoBN,GAAYH,GAAMF,EAAK,MAAMO,CAAM;AAE1E,QAAA,CAACF,EAAW,iBAAiB;AAC1B,YAAAO,IAAeC,EAAeH,GAAUP,CAAQ,GAChDW,IAAe,MAAMT,EAAW,SAASK,CAAQ;AACnD,UAAAE,KAAgBE,KAAgBF,MAAiBE;AAC7C,eAAA;AAAA,UACN,QAAQ;AAAA,UACR,UAAU,CAAC;AAAA,UACX,OAAO;AAAA,YACN,SAAS,aAAad,EAAK,IAAI;AAAA,UAAA;AAAA,QAEjC;AAAA,IACD;AAGD,UAAMe,IAAU,MAAMV,EAAW,SAASK,GAAUH,CAAM,GACpD,EAAE,iBAAAS,GAAiB,eAAAC,GAAe,WAAAC,EAAA,IAAc,MAAMC;AAAA,MAC3DnB,EAAK;AAAA,MACLe;AAAA,MACAf,EAAK;AAAA,MACLA,EAAK;AAAA,IACN;AAEA,iBAAMoB,EAAWpB,EAAK,MAAMe,GAASC,CAAe,GAE9C,MAAAZ,EAAgBM,GAAU,OAAOW,MAAS;AAC/C,YAAMhB,EAAW,UAAUgB,GAAML,GAAiBT,CAAM;AAAA,IAAA,CACxD,GAOM;AAAA,MACN,QAAQ;AAAA,MACR,UAAU,CAAC;AAAA,MACX,QARc;AAAA,QACd,MAAMU;AAAA,QACN,WAAAC;AAAA,MACD;AAAA,MAMC,OAAO,CAAClB,EAAK,IAAI;AAAA,IAClB;AAAA,EAAA,UACC;AACD,IAAAF,EAAa,QAAQ;AAAA,EAAA;AACtB,CACA;AAGF,SAASU,EAAcR,GAAwE;AAE1F,MADGA,IAAAsB,EAAmB,MAAMtB,CAAI,GAChCA,EAAK,YAAYA,EAAK;AACnB,UAAA,IAAI,MAAM,wDAAwD;AAE1E;"}
|
@@ -1,7 +1,7 @@
|
|
1
1
|
#!/usr/bin/env node
|
2
2
|
import { existsSync as o } from "node:fs";
|
3
3
|
import { createRequire as t } from "node:module";
|
4
|
-
import { n as i } from "./
|
4
|
+
import { n as i } from "./console-B_a7AZVs.js";
|
5
5
|
function g() {
|
6
6
|
try {
|
7
7
|
const r = t(import.meta.url)("@vscode/ripgrep")?.rgPath;
|
@@ -15,4 +15,4 @@ function g() {
|
|
15
15
|
export {
|
16
16
|
g as r
|
17
17
|
};
|
18
|
-
//# sourceMappingURL=executable-
|
18
|
+
//# sourceMappingURL=executable-BglMpb2E.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"executable-
|
1
|
+
{"version":3,"file":"executable-BglMpb2E.js","sources":["../../core/src/tools/builtin/grep/executable.ts"],"sourcesContent":["import { existsSync } from 'node:fs'\nimport { createRequire } from 'node:module'\nimport { homedir } from 'node:os'\nimport { join } from 'node:path'\nimport logger from '../../../common/logger'\n\nexport function ripgrepExecutable(): string {\n\tif (import.meta.env.VITE_PLATFORM === 'vscode') {\n\t\tconst possiblePaths = getVSCodeRipgrepPaths()\n\n\t\tfor (const path of possiblePaths) {\n\t\t\tif (existsSync(path)) {\n\t\t\t\treturn path\n\t\t\t}\n\t\t}\n\t} else if (import.meta.env.VITE_PLATFORM === 'node') {\n\t\ttry {\n\t\t\t// Create a require function that can be used in ESM context\n\t\t\tconst require = createRequire(import.meta.url)\n\n\t\t\t// Use the created require function to load @vscode/ripgrep\n\t\t\tconst ripgrepModule = require('@vscode/ripgrep') as { rgPath: string }\n\t\t\tconst rgPath = ripgrepModule?.rgPath\n\n\t\t\tif (rgPath && existsSync(rgPath)) {\n\t\t\t\treturn rgPath\n\t\t\t}\n\t\t} catch (error) {\n\t\t\tlogger.error('Error with ripgrep:', error)\n\t\t}\n\t}\n\n\treturn 'rg'\n}\n\nfunction getVSCodeRipgrepPaths(): string[] {\n\tconst platform = process.platform\n\tconst paths: string[] = []\n\n\ttry {\n\t\t// eslint-disable-next-line @typescript-eslint/no-require-imports\n\t\tconst vscode = require('vscode') as typeof import('vscode')\n\t\tconst binaryName = platform === 'win32' ? 'rg.exe' : 'rg'\n\t\tpaths.push(\n\t\t\tjoin(vscode.env.appRoot, 'node_modules', '@vscode', 'ripgrep', 'bin', binaryName),\n\t\t)\n\t} catch {\n\t\t// ignore\n\t}\n\n\t// This if statement should no longer be needed since vscode.env.appRoot\n\t// already handles it. However, keeping it here as a fallback just to be\n\t// sure we don't regress anything after adding appRoot support.\n\tif (platform === 'darwin') {\n\t\tpaths.push(\n\t\t\t'/Applications/Visual Studio Code.app/Contents/Resources/app/node_modules/@vscode/ripgrep/bin/rg',\n\t\t)\n\t} else if (platform === 'linux') {\n\t\tpaths.push(\n\t\t\t'/usr/share/code/resources/app/node_modules/@vscode/ripgrep/bin/rg',\n\t\t\tjoin(homedir(), '.vscode/extensions/ms-vscode.vscode-ripgrep-*/bin/rg'),\n\t\t)\n\t}\n\n\treturn paths\n}\n"],"names":["ripgrepExecutable","rgPath","createRequire","existsSync","error","logger"],"mappings":";;;;AAMO,SAASA,IAA4B;AAUtC,MAAA;AAMH,UAAMC,IAJUC,EAAc,YAAY,GAAG,EAGf,iBAAiB,GACjB;AAE1B,QAAAD,KAAUE,EAAWF,CAAM;AACvB,aAAAA;AAAA,WAEAG,GAAO;AACR,IAAAC,EAAA,MAAM,uBAAuBD,CAAK;AAAA,EAAA;AAIpC,SAAA;AACR;"}
|
@@ -1,6 +1,6 @@
|
|
1
1
|
#!/usr/bin/env node
|
2
2
|
import y from "node:path";
|
3
|
-
import {
|
3
|
+
import { b8 as I, b9 as T, n as z, ba as B, bb as P } from "./console-B_a7AZVs.js";
|
4
4
|
async function L(p, h, t) {
|
5
5
|
const b = await t.listFiles(h), i = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Map(), f = [], M = /\b([\w/_-]+(?:\\.|[\w/_-])*(?:\.[\w-]+)+)\b/g, F = /(\/(?:[\w-]+\/|[\w-]+\\[.\s\S])+[\w.-]+(?:\\.|[\w.-])*(?:\.[\w-]+)+)\b/g, x = /\b([A-Za-z]:[\\\\][^\s"'<>|]*(?:\.[\w-]+)+)\b/g;
|
6
6
|
await l(M, !1), await l(F, !0), await l(x, !0);
|
@@ -67,4 +67,4 @@ async function L(p, h, t) {
|
|
67
67
|
export {
|
68
68
|
L as getFileMentions
|
69
69
|
};
|
70
|
-
//# sourceMappingURL=files-
|
70
|
+
//# sourceMappingURL=files-gDsYEnW1.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"files-
|
1
|
+
{"version":3,"file":"files-gDsYEnW1.js","sources":["../../core/src/threads/files.ts"],"sourcesContent":["import path from 'node:path'\nimport logger from '../common/logger'\nimport type { FileSystem } from '../platform/fs/fs'\nimport { getImageFileMetadata } from '../tools/builtin/filesystem/file-type'\nimport { checkFileSizeLimit } from '../tools/builtin/filesystem/read_file.util'\nimport type { FileMention } from './file-mentions'\nimport { FileMentions } from './file-mentions'\nimport { isSupportedImageMIMEType } from './image-attachments'\n\nexport async function getFileMentions(\n\tcontent: string,\n\tworkspaceRoot: string,\n\tfilesystem: Pick<FileSystem, 'stat' | 'readFile' | 'readBinaryFile' | 'listFiles'>,\n): Promise<FileMentions> {\n\tconst files = await filesystem.listFiles(workspaceRoot)\n\tconst fileContents = new Map<string, string>()\n\tconst imageFiles = new Map<string, { mimeType: string; size: number }>() // Track image files separately\n\tconst mentions: FileMention[] = []\n\n\t// Regex patterns for file paths\n\t// Match relative paths with extension within workspace\n\tconst relativePathRegex = /\\b([\\w/_-]+(?:\\\\.|[\\w/_-])*(?:\\.[\\w-]+)+)\\b/g\n\t// Match absolute paths with extension (Unix/Linux/Mac)\n\tconst unixAbsolutePathRegex =\n\t\t/(\\/(?:[\\w-]+\\/|[\\w-]+\\\\[.\\s\\S])+[\\w.-]+(?:\\\\.|[\\w.-])*(?:\\.[\\w-]+)+)\\b/g\n\t// Match absolute paths with extension (Windows) - using a more permissive approach\n\tconst windowsAbsolutePathRegex = /\\b([A-Za-z]:[\\\\\\\\][^\\s\"'<>|]*(?:\\.[\\w-]+)+)\\b/g\n\n\t// Process matches for each regex pattern\n\tawait processMatches(relativePathRegex, false)\n\tawait processMatches(unixAbsolutePathRegex, true)\n\n\tawait processMatches(windowsAbsolutePathRegex, true)\n\n\t// Process matches from a regex pattern\n\tasync function processMatches(regex: RegExp, isAbsolutePath: boolean) {\n\t\t// Reset regex before execution to ensure we don't miss any matches\n\t\tregex.lastIndex = 0\n\n\t\tlet match\n\t\twhile ((match = regex.exec(content)) !== null) {\n\t\t\tconst [word] = match\n\t\t\t// Unescape special characters in the path\n\t\t\t// Unescape characters in file paths\n\t\t\tlet unescapedWord\n\t\t\t// Check if this is a Windows path with drive letter\n\t\t\tconst isWindowsPath = word.match(/^[A-Za-z]:[\\\\]/) !== null\n\t\t\tif (isWindowsPath) {\n\t\t\t\t// For Windows paths, preserve the backslashes as path separators but handle escaped characters\n\t\t\t\tunescapedWord = word\n\t\t\t} else {\n\t\t\t\t// For other paths, unescape everything\n\t\t\t\tunescapedWord = word.replace(/\\\\(.)/g, '$1')\n\t\t\t}\n\n\t\t\tconst isCached = fileContents.has(unescapedWord) || imageFiles.has(unescapedWord)\n\n\t\t\t// Skip if we've already processed this file path\n\t\t\tif (isCached) {\n\t\t\t\taddMention(unescapedWord, match.index)\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\t// Determine file path\n\t\t\tconst filePath = isAbsolutePath\n\t\t\t\t? unescapedWord\n\t\t\t\t: path.join(workspaceRoot, unescapedWord)\n\n\t\t\t// For relative paths, check if file exists in the workspace\n\t\t\tif (!isAbsolutePath && !files.includes(unescapedWord)) {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\t// For absolute paths, check if file exists on disk\n\t\t\tif (isAbsolutePath) {\n\t\t\t\ttry {\n\t\t\t\t\t// Just try to stat the file to see if it exists\n\t\t\t\t\tawait filesystem.stat(filePath)\n\t\t\t\t} catch (err) {\n\t\t\t\t\t// File doesn't exist or can't be accessed\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Process the file\n\t\t\ttry {\n\t\t\t\t// Check if this is an image file\n\t\t\t\tconst imageInfo = await getImageFileMetadata(filesystem, filePath)\n\n\t\t\t\tif (imageInfo && isSupportedImageMIMEType(imageInfo.mimeType)) {\n\t\t\t\t\t// This is an image file, treat it as an attachment\n\t\t\t\t\timageFiles.set(unescapedWord, imageInfo)\n\t\t\t\t\t// Read the image file as binary and convert to base64\n\t\t\t\t\ttry {\n\t\t\t\t\t\tconst imageBuffer = await filesystem.readBinaryFile(filePath)\n\t\t\t\t\t\tconst base64Data = imageBuffer.toString('base64')\n\t\t\t\t\t\t// Store the base64 data\n\t\t\t\t\t\tfileContents.set(unescapedWord, base64Data)\n\t\t\t\t\t} catch (error) {\n\t\t\t\t\t\tlogger.error(\n\t\t\t\t\t\t\t'Failed to read image as binary',\n\t\t\t\t\t\t\t{ path: unescapedWord },\n\t\t\t\t\t\t\terror,\n\t\t\t\t\t\t)\n\t\t\t\t\t\t// Set a placeholder in case of error\n\t\t\t\t\t\tfileContents.set(\n\t\t\t\t\t\t\tunescapedWord,\n\t\t\t\t\t\t\t`[Image file: ${unescapedWord} (${imageInfo.mimeType}, ${Math.round(imageInfo.size / 1024)} KB)]`,\n\t\t\t\t\t\t)\n\t\t\t\t\t}\n\t\t\t\t\taddMention(unescapedWord, match.index)\n\t\t\t\t} else {\n\t\t\t\t\t// Not an image file, handle normally\n\t\t\t\t\tconst isTooLarge = await checkFileSizeLimit(filesystem, filePath)\n\t\t\t\t\tif (isTooLarge) {\n\t\t\t\t\t\tcontinue\n\t\t\t\t\t}\n\n\t\t\t\t\tconst data = await filesystem.readFile(filePath)\n\t\t\t\t\tfileContents.set(unescapedWord, data)\n\t\t\t\t\taddMention(unescapedWord, match.index)\n\t\t\t\t}\n\t\t\t} catch (error) {\n\t\t\t\t// Skip file if there's any error reading it\n\t\t\t\tcontinue\n\t\t\t}\n\t\t}\n\t}\n\n\t// Helper function to add a mention\n\tfunction addMention(path: string, startIndex: number) {\n\t\tmentions.push({\n\t\t\tpath,\n\t\t\trange: {\n\t\t\t\tstart: startIndex,\n\t\t\t\tend: startIndex + path.length - 1,\n\t\t\t},\n\t\t})\n\t}\n\n\t// Create a FileMentions instance with both text and image file contents\n\tconst fileMentions = new FileMentions(fileContents, mentions)\n\n\t// Add image file metadata to the FileMentions instance\n\tfileMentions.imageFiles = imageFiles\n\n\treturn fileMentions\n}\n"],"names":["getFileMentions","content","workspaceRoot","filesystem","files","fileContents","imageFiles","mentions","relativePathRegex","unixAbsolutePathRegex","windowsAbsolutePathRegex","processMatches","regex","isAbsolutePath","match","word","unescapedWord","addMention","filePath","path","imageInfo","getImageFileMetadata","isSupportedImageMIMEType","base64Data","error","logger","checkFileSizeLimit","data","startIndex","fileMentions","FileMentions"],"mappings":";;;AASsB,eAAAA,EACrBC,GACAC,GACAC,GACwB;AACxB,QAAMC,IAAQ,MAAMD,EAAW,UAAUD,CAAa,GAChDG,wBAAmB,IAAoB,GACvCC,wBAAiB,IAAgD,GACjEC,IAA0B,CAAC,GAI3BC,IAAoB,gDAEpBC,IACL,2EAEKC,IAA2B;AAG3B,QAAAC,EAAeH,GAAmB,EAAK,GACvC,MAAAG,EAAeF,GAAuB,EAAI,GAE1C,MAAAE,EAAeD,GAA0B,EAAI;AAGpC,iBAAAC,EAAeC,GAAeC,GAAyB;AAErE,IAAAD,EAAM,YAAY;AAEd,QAAAE;AACJ,YAAQA,IAAQF,EAAM,KAAKX,CAAO,OAAO,QAAM;AACxC,YAAA,CAACc,CAAI,IAAID;AAGX,UAAAE;AAcJ,UAZsBD,EAAK,MAAM,gBAAgB,MAAM,OAGtCC,IAAAD,IAGAC,IAAAD,EAAK,QAAQ,UAAU,IAAI,GAG3BV,EAAa,IAAIW,CAAa,KAAKV,EAAW,IAAIU,CAAa,GAGlE;AACF,QAAAC,EAAAD,GAAeF,EAAM,KAAK;AACrC;AAAA,MAAA;AAID,YAAMI,IAAWL,IACdG,IACAG,EAAK,KAAKjB,GAAec,CAAa;AAGzC,UAAI,GAACH,KAAkB,CAACT,EAAM,SAASY,CAAa,IAKpD;AAAA,YAAIH;AACC,cAAA;AAEG,kBAAAV,EAAW,KAAKe,CAAQ;AAAA,kBACjB;AAEb;AAAA,UAAA;AAKE,YAAA;AAEH,gBAAME,IAAY,MAAMC,EAAqBlB,GAAYe,CAAQ;AAEjE,cAAIE,KAAaE,EAAyBF,EAAU,QAAQ,GAAG;AAEnD,YAAAd,EAAA,IAAIU,GAAeI,CAAS;AAEnC,gBAAA;AAEG,oBAAAG,KADc,MAAMpB,EAAW,eAAee,CAAQ,GAC7B,SAAS,QAAQ;AAEnC,cAAAb,EAAA,IAAIW,GAAeO,CAAU;AAAA,qBAClCC,GAAO;AACR,cAAAC,EAAA;AAAA,gBACN;AAAA,gBACA,EAAE,MAAMT,EAAc;AAAA,gBACtBQ;AAAA,cACD,GAEanB,EAAA;AAAA,gBACZW;AAAA,gBACA,gBAAgBA,CAAa,KAAKI,EAAU,QAAQ,KAAK,KAAK,MAAMA,EAAU,OAAO,IAAI,CAAC;AAAA,cAC3F;AAAA,YAAA;AAEU,YAAAH,EAAAD,GAAeF,EAAM,KAAK;AAAA,UAAA,OAC/B;AAGN,gBADmB,MAAMY,EAAmBvB,GAAYe,CAAQ;AAE/D;AAGD,kBAAMS,IAAO,MAAMxB,EAAW,SAASe,CAAQ;AAClC,YAAAb,EAAA,IAAIW,GAAeW,CAAI,GACzBV,EAAAD,GAAeF,EAAM,KAAK;AAAA,UAAA;AAAA,gBAEvB;AAEf;AAAA,QAAA;AAAA;AAAA,IACD;AAAA,EACD;AAIQ,WAAAG,EAAWE,GAAcS,GAAoB;AACrD,IAAArB,EAAS,KAAK;AAAA,MACb,MAAAY;AAAAA,MACA,OAAO;AAAA,QACN,OAAOS;AAAA,QACP,KAAKA,IAAaT,EAAK,SAAS;AAAA,MAAA;AAAA,IACjC,CACA;AAAA,EAAA;AAIF,QAAMU,IAAe,IAAIC,EAAazB,GAAcE,CAAQ;AAG5D,SAAAsB,EAAa,aAAavB,GAEnBuB;AACR;"}
|
@@ -1,7 +1,7 @@
|
|
1
1
|
#!/usr/bin/env node
|
2
2
|
import { spawn as yt } from "node:child_process";
|
3
|
-
import { k as Ht, O as $t, g as mt, m as
|
4
|
-
import { r as Ot } from "./executable-
|
3
|
+
import { k as Ht, O as $t, g as mt, m as Lt, aQ as Tt, n as vt } from "./console-B_a7AZVs.js";
|
4
|
+
import { r as Ot } from "./executable-BglMpb2E.js";
|
5
5
|
var pt = {}, ft, Et;
|
6
6
|
function it() {
|
7
7
|
if (Et) return ft;
|
@@ -23,7 +23,7 @@ function it() {
|
|
23
23
|
STAR: S,
|
24
24
|
START_ANCHOR: x,
|
25
25
|
SEP: "/"
|
26
|
-
},
|
26
|
+
}, T = {
|
27
27
|
...F,
|
28
28
|
SLASH_LITERAL: `[${p}]`,
|
29
29
|
QMARK: A,
|
@@ -174,7 +174,7 @@ function it() {
|
|
174
174
|
* Create GLOB_CHARS
|
175
175
|
*/
|
176
176
|
globChars(b) {
|
177
|
-
return b === !0 ?
|
177
|
+
return b === !0 ? T : F;
|
178
178
|
}
|
179
179
|
}, ft;
|
180
180
|
}
|
@@ -244,12 +244,12 @@ function wt() {
|
|
244
244
|
/* ) */
|
245
245
|
CHAR_RIGHT_SQUARE_BRACKET: y
|
246
246
|
/* ] */
|
247
|
-
} = /* @__PURE__ */ it(), S = (
|
248
|
-
|
247
|
+
} = /* @__PURE__ */ it(), S = (T) => T === a || T === d, I = (T) => {
|
248
|
+
T.isPrefix !== !0 && (T.depth = T.isGlobstar ? 1 / 0 : 1);
|
249
249
|
};
|
250
|
-
return ht = (
|
251
|
-
const b = G || {}, Y =
|
252
|
-
let M =
|
250
|
+
return ht = (T, G) => {
|
251
|
+
const b = G || {}, Y = T.length - 1, B = b.parts === !0 || b.scanToEnd === !0, W = [], w = [], st = [];
|
252
|
+
let M = T, H = -1, N = 0, tt = 0, rt = !1, j = !1, v = !1, et = !1, X = !1, s = !1, k = !1, z = !1, ut = !1, t = !1, e = 0, nt, l, C = { value: "", depth: 0, isGlob: !1 };
|
253
253
|
const V = () => H >= Y, J = () => M.charCodeAt(H + 1), U = () => (nt = l, M.charCodeAt(++H));
|
254
254
|
for (; H < Y; ) {
|
255
255
|
l = U();
|
@@ -368,7 +368,7 @@ function wt() {
|
|
368
368
|
N > 0 && (ot = M.slice(0, N), M = M.slice(N), tt -= N), D && v === !0 && tt > 0 ? (D = M.slice(0, tt), Z = M.slice(tt)) : v === !0 ? (D = "", Z = M) : D = M, D && D !== "" && D !== "/" && D !== M && S(D.charCodeAt(D.length - 1)) && (D = D.slice(0, -1)), b.unescape === !0 && (Z && (Z = p.removeBackslashes(Z)), D && k === !0 && (D = p.removeBackslashes(D)));
|
369
369
|
const h = {
|
370
370
|
prefix: ot,
|
371
|
-
input:
|
371
|
+
input: T,
|
372
372
|
start: N,
|
373
373
|
base: D,
|
374
374
|
glob: Z,
|
@@ -383,11 +383,11 @@ function wt() {
|
|
383
383
|
if (b.tokens === !0 && (h.maxDepth = 0, S(l) || w.push(C), h.tokens = w), b.parts === !0 || b.tokens === !0) {
|
384
384
|
let q;
|
385
385
|
for (let K = 0; K < W.length; K++) {
|
386
|
-
const i = q ? q + 1 : N,
|
387
|
-
b.tokens && (K === 0 && N !== 0 ? (w[K].isPrefix = !0, w[K].value = ot) : w[K].value = n, I(w[K]), h.maxDepth += w[K].depth), (K !== 0 || n !== "") && st.push(n), q =
|
386
|
+
const i = q ? q + 1 : N, L = W[K], n = T.slice(i, L);
|
387
|
+
b.tokens && (K === 0 && N !== 0 ? (w[K].isPrefix = !0, w[K].value = ot) : w[K].value = n, I(w[K]), h.maxDepth += w[K].depth), (K !== 0 || n !== "") && st.push(n), q = L;
|
388
388
|
}
|
389
|
-
if (q && q + 1 <
|
390
|
-
const K =
|
389
|
+
if (q && q + 1 < T.length) {
|
390
|
+
const K = T.slice(q + 1);
|
391
391
|
st.push(K), b.tokens && (w[w.length - 1].value = K, I(w[w.length - 1]), h.maxDepth += w[w.length - 1].depth);
|
392
392
|
}
|
393
393
|
h.slashes = W, h.parts = st;
|
@@ -424,7 +424,7 @@ function Nt() {
|
|
424
424
|
let m = c.length;
|
425
425
|
if (m > $)
|
426
426
|
throw new SyntaxError(`Input length: ${m}, exceeds maximum allowed length: ${$}`);
|
427
|
-
const y = { type: "bos", value: "", output: r.prepend || "" }, S = [y], I = r.capture ? "" : "?:", F = p.globChars(r.windows),
|
427
|
+
const y = { type: "bos", value: "", output: r.prepend || "" }, S = [y], I = r.capture ? "" : "?:", F = p.globChars(r.windows), T = p.extglobChars(F), {
|
428
428
|
DOT_LITERAL: G,
|
429
429
|
PLUS_LITERAL: b,
|
430
430
|
SLASH_LITERAL: Y,
|
@@ -460,8 +460,8 @@ function Nt() {
|
|
460
460
|
c = A.removePrefix(c, s), m = c.length;
|
461
461
|
const k = [], z = [], ut = [];
|
462
462
|
let t = y, e;
|
463
|
-
const nt = () => s.index === m - 1, l = s.peek = (i = 1) => c[s.index + i], C = s.advance = () => c[++s.index] || "", V = () => c.slice(s.index + 1), J = (i = "",
|
464
|
-
s.consumed += i, s.index +=
|
463
|
+
const nt = () => s.index === m - 1, l = s.peek = (i = 1) => c[s.index + i], C = s.advance = () => c[++s.index] || "", V = () => c.slice(s.index + 1), J = (i = "", L = 0) => {
|
464
|
+
s.consumed += i, s.index += L;
|
465
465
|
}, U = (i) => {
|
466
466
|
s.output += i.output != null ? i.output : i.value, J(i.value);
|
467
467
|
}, D = () => {
|
@@ -475,34 +475,34 @@ function Nt() {
|
|
475
475
|
s[i]--, ut.pop();
|
476
476
|
}, h = (i) => {
|
477
477
|
if (t.type === "globstar") {
|
478
|
-
const
|
479
|
-
i.type !== "slash" && i.type !== "paren" && !
|
478
|
+
const L = s.braces > 0 && (i.type === "comma" || i.type === "brace"), n = i.extglob === !0 || k.length && (i.type === "pipe" || i.type === "paren");
|
479
|
+
i.type !== "slash" && i.type !== "paren" && !L && !n && (s.output = s.output.slice(0, -t.output.length), t.type = "star", t.value = "*", t.output = X, s.output += t.output);
|
480
480
|
}
|
481
481
|
if (k.length && i.type !== "paren" && (k[k.length - 1].inner += i.value), (i.value || i.output) && U(i), t && t.type === "text" && i.type === "text") {
|
482
482
|
t.output = (t.output || t.value) + i.value, t.value += i.value;
|
483
483
|
return;
|
484
484
|
}
|
485
485
|
i.prev = t, S.push(i), t = i;
|
486
|
-
}, q = (i,
|
487
|
-
const n = { ...L
|
486
|
+
}, q = (i, L) => {
|
487
|
+
const n = { ...T[L], conditions: 1, inner: "" };
|
488
488
|
n.prev = t, n.parens = s.parens, n.output = s.output;
|
489
489
|
const _ = (r.capture ? "(" : "") + n.open;
|
490
|
-
ot("parens"), h({ type: i, value:
|
490
|
+
ot("parens"), h({ type: i, value: L, output: s.output ? "" : B }), h({ type: "paren", extglob: !0, value: C(), output: _ }), k.push(n);
|
491
491
|
}, K = (i) => {
|
492
|
-
let
|
492
|
+
let L = i.close + (r.capture ? ")" : ""), n;
|
493
493
|
if (i.type === "negate") {
|
494
494
|
let _ = X;
|
495
|
-
if (i.inner && i.inner.length > 1 && i.inner.includes("/") && (_ = j(r)), (_ !== X || nt() || /^\)+$/.test(V())) && (
|
495
|
+
if (i.inner && i.inner.length > 1 && i.inner.includes("/") && (_ = j(r)), (_ !== X || nt() || /^\)+$/.test(V())) && (L = i.close = `)$))${_}`), i.inner.includes("*") && (n = V()) && /^\.[^\\/.]+$/.test(n)) {
|
496
496
|
const O = x(n, { ...E, fastpaths: !1 }).output;
|
497
|
-
|
497
|
+
L = i.close = `)${O})${_})`;
|
498
498
|
}
|
499
499
|
i.prev.type === "bos" && (s.negatedExtglob = !0);
|
500
500
|
}
|
501
|
-
h({ type: "paren", extglob: !0, value: e, output:
|
501
|
+
h({ type: "paren", extglob: !0, value: e, output: L }), Z("parens");
|
502
502
|
};
|
503
503
|
if (r.fastpaths !== !1 && !/(^[*!]|[/()[\]{}"])/.test(c)) {
|
504
|
-
let i = !1,
|
505
|
-
return i === !0 && (r.unescape === !0 ?
|
504
|
+
let i = !1, L = c.replace(o, (n, _, O, Q, P, lt) => Q === "\\" ? (i = !0, n) : Q === "?" ? _ ? _ + Q + (P ? H.repeat(P.length) : "") : lt === 0 ? et + (P ? H.repeat(P.length) : "") : H.repeat(O.length) : Q === "." ? G.repeat(O.length) : Q === "*" ? _ ? _ + Q + (P ? X : "") : X : _ ? n : `\\${n}`);
|
505
|
+
return i === !0 && (r.unescape === !0 ? L = L.replace(/\\/g, "") : L = L.replace(/\\+/g, (n) => n.length % 2 === 0 ? "\\\\" : n ? "\\" : "")), L === c && r.contains === !0 ? (s.output = c, s) : (s.output = A.wrapOutput(L, s, E), s);
|
506
506
|
}
|
507
507
|
for (; !nt(); ) {
|
508
508
|
if (e = C(), e === "\0")
|
@@ -766,16 +766,16 @@ function Nt() {
|
|
766
766
|
s.output = s.output.slice(0, -t.output.length), t.type = "globstar", t.output = j(r), t.value += e, s.output += t.output, s.globstar = !0, J(e);
|
767
767
|
continue;
|
768
768
|
}
|
769
|
-
const
|
769
|
+
const L = { type: "star", value: e, output: X };
|
770
770
|
if (r.bash === !0) {
|
771
|
-
|
771
|
+
L.output = ".*?", (t.type === "bos" || t.type === "slash") && (L.output = v + L.output), h(L);
|
772
772
|
continue;
|
773
773
|
}
|
774
774
|
if (t && (t.type === "bracket" || t.type === "paren") && r.regex === !0) {
|
775
|
-
|
775
|
+
L.output = e, h(L);
|
776
776
|
continue;
|
777
777
|
}
|
778
|
-
(s.index === s.start || t.type === "slash" || t.type === "dot") && (t.type === "dot" ? (s.output += st, t.output += st) : r.dot === !0 ? (s.output += M, t.output += M) : (s.output += v, t.output += v), l() !== "*" && (s.output += B, t.output += B)), h(
|
778
|
+
(s.index === s.start || t.type === "slash" || t.type === "dot") && (t.type === "dot" ? (s.output += st, t.output += st) : r.dot === !0 ? (s.output += M, t.output += M) : (s.output += v, t.output += v), l() !== "*" && (s.output += B, t.output += B)), h(L);
|
779
779
|
}
|
780
780
|
for (; s.brackets > 0; ) {
|
781
781
|
if (r.strictBrackets === !0) throw new SyntaxError(f("closing", "]"));
|
@@ -806,12 +806,12 @@ function Nt() {
|
|
806
806
|
SLASH_LITERAL: S,
|
807
807
|
ONE_CHAR: I,
|
808
808
|
DOTS_SLASH: F,
|
809
|
-
NO_DOT:
|
809
|
+
NO_DOT: T,
|
810
810
|
NO_DOTS: G,
|
811
811
|
NO_DOTS_SLASH: b,
|
812
812
|
STAR: Y,
|
813
813
|
START_ANCHOR: B
|
814
|
-
} = p.globChars(r.windows), W = r.dot ? G :
|
814
|
+
} = p.globChars(r.windows), W = r.dot ? G : T, w = r.dot ? b : T, st = r.capture ? "" : "?:", M = { negated: !1, prefix: "" };
|
815
815
|
let H = r.bash === !0 ? ".*?" : Y;
|
816
816
|
r.capture && (H = `(${H})`);
|
817
817
|
const N = (v) => v.noglobstar === !0 ? H : `(${st}(?:(?!${B}${v.dot ? F : y}).)*?)`, tt = (v) => {
|
@@ -852,8 +852,8 @@ function It() {
|
|
852
852
|
if (Array.isArray(u)) {
|
853
853
|
const S = u.map((F) => o(F, a, f));
|
854
854
|
return (F) => {
|
855
|
-
for (const
|
856
|
-
const G =
|
855
|
+
for (const T of S) {
|
856
|
+
const G = T(F);
|
857
857
|
if (G) return G;
|
858
858
|
}
|
859
859
|
return !1;
|
@@ -870,7 +870,7 @@ function It() {
|
|
870
870
|
m = o(c.ignore, S, f);
|
871
871
|
}
|
872
872
|
const y = (S, I = !1) => {
|
873
|
-
const { isMatch: F, match:
|
873
|
+
const { isMatch: F, match: T, output: G } = o.test(S, r, a, { glob: u, posix: E }), b = { glob: u, state: $, regex: r, posix: E, input: S, output: G, match: T, isMatch: F };
|
874
874
|
return typeof c.onResult == "function" && c.onResult(b), F === !1 ? (b.isMatch = !1, I ? b : !1) : m(S) ? (typeof c.onIgnore == "function" && c.onIgnore(b), b.isMatch = !1, I ? b : !1) : (typeof c.onMatch == "function" && c.onMatch(b), I ? b : !0);
|
875
875
|
};
|
876
876
|
return f && (y.state = $), y;
|
@@ -932,7 +932,7 @@ function Gt(p, A, R) {
|
|
932
932
|
return mt(
|
933
933
|
...p.map((d) => Bt(d, A, R))
|
934
934
|
).pipe(
|
935
|
-
|
935
|
+
Lt((d) => {
|
936
936
|
const g = [];
|
937
937
|
for (const a of d)
|
938
938
|
a.status === "in-progress" ? g.push(...a?.progress ?? []) : a.status === "done" ? g.push(...a.result) : a.status === "error" ? g.push(...a.progress ?? []) : a.status === "cancelled" && g.push(...a.progress ?? []);
|
@@ -953,7 +953,7 @@ function Gt(p, A, R) {
|
|
953
953
|
);
|
954
954
|
}
|
955
955
|
function Bt(p, A, R) {
|
956
|
-
return
|
956
|
+
return Tt(p), new $t((d) => {
|
957
957
|
d.next({
|
958
958
|
status: "in-progress",
|
959
959
|
progress: []
|
@@ -1048,4 +1048,4 @@ export {
|
|
1048
1048
|
Xt as nodeGlobTool,
|
1049
1049
|
Mt as ripgrepFiles
|
1050
1050
|
};
|
1051
|
-
//# sourceMappingURL=glob.node-
|
1051
|
+
//# sourceMappingURL=glob.node-CMSCjukj.js.map
|