@sourcegraph/amp 0.0.1748751230-ga82eb7 → 0.0.1748779332-gb5cb75
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/{console-BHPG7ghh.js → console-BEoM5C3l.js} +10 -10
- package/dist/{console-BHPG7ghh.js.map → console-BEoM5C3l.js.map} +1 -1
- package/dist/{create_file.node-BfhNTTlb.js → create_file.node-BFS-uX0h.js} +2 -2
- package/dist/{create_file.node-BfhNTTlb.js.map → create_file.node-BFS-uX0h.js.map} +1 -1
- package/dist/{edit_file.node-DfNYbY3f.js → edit_file.node-D0utnpOc.js} +3 -3
- package/dist/{edit_file.node-DfNYbY3f.js.map → edit_file.node-D0utnpOc.js.map} +1 -1
- package/dist/{executable-Bg-Dnv9N.js → executable-Bm7iL2Wr.js} +2 -2
- package/dist/{executable-Bg-Dnv9N.js.map → executable-Bm7iL2Wr.js.map} +1 -1
- package/dist/{files-Ce5pZkWD.js → files-8V4d25dw.js} +2 -2
- package/dist/{files-Ce5pZkWD.js.map → files-8V4d25dw.js.map} +1 -1
- package/dist/{glob.node-RxL5iYzN.js → glob.node-CxhUfk73.js} +3 -3
- package/dist/{glob.node-RxL5iYzN.js.map → glob.node-CxhUfk73.js.map} +1 -1
- package/dist/{list_directory.node-DGhzMMXH.js → list_directory.node-BvKQRegC.js} +2 -2
- package/dist/{list_directory.node-DGhzMMXH.js.map → list_directory.node-BvKQRegC.js.map} +1 -1
- package/dist/{load-profile-DM9rbkOm.js → load-profile-DRELVkLs.js} +2 -2
- package/dist/{load-profile-DM9rbkOm.js.map → load-profile-DRELVkLs.js.map} +1 -1
- package/dist/{main-00oKVtTe.js → main-BNsPGXov.js} +501 -501
- package/dist/{main-00oKVtTe.js.map → main-BNsPGXov.js.map} +1 -1
- package/dist/{node-DmYohWBm.js → node-BuGshbyJ.js} +3 -3
- package/dist/{node-DmYohWBm.js.map → node-BuGshbyJ.js.map} +1 -1
- package/dist/{node-DO1f17bA.js → node-CcCnjzdp.js} +3 -3
- package/dist/{node-DO1f17bA.js.map → node-CcCnjzdp.js.map} +1 -1
- package/dist/{node-BHXqdrs5.js → node-DHEAQDoa.js} +2 -2
- package/dist/{node-BHXqdrs5.js.map → node-DHEAQDoa.js.map} +1 -1
- package/dist/{node-CQtpFy7X.js → node-DLBHbpFn.js} +3 -3
- package/dist/{node-CQtpFy7X.js.map → node-DLBHbpFn.js.map} +1 -1
- package/dist/{node-OczSPdLb.js → node-Dd5TcLk4.js} +3 -3
- package/dist/{node-OczSPdLb.js.map → node-Dd5TcLk4.js.map} +1 -1
- package/dist/{node-Cp6INRFE.js → node-xakp4FYv.js} +2 -2
- package/dist/{node-Cp6INRFE.js.map → node-xakp4FYv.js.map} +1 -1
- package/dist/{read_file.node-2VqMj-ax.js → read_file.node-Bh95y2qD.js} +2 -2
- package/dist/{read_file.node-2VqMj-ax.js.map → read_file.node-Bh95y2qD.js.map} +1 -1
- package/dist/{stdio-CO70V3Ze.js → stdio-B64CMOKT.js} +3 -3
- package/dist/{stdio-CO70V3Ze.js.map → stdio-B64CMOKT.js.map} +1 -1
- package/dist/storybook.js +1 -1
- package/dist/{undo_edit.node-B6m1Nlh6.js → undo_edit.node-BZBcJgmC.js} +2 -2
- package/dist/{undo_edit.node-B6m1Nlh6.js.map → undo_edit.node-BZBcJgmC.js.map} +1 -1
- package/package.json +1 -1
@@ -1,6 +1,6 @@
|
|
1
1
|
#!/usr/bin/env node
|
2
|
-
import { aQ as c, g, m as p, a_ as l, a$ as f, b0 as m, b1 as h, c as d, O as b } from "./console-
|
3
|
-
import { r as _ } from "./executable-
|
2
|
+
import { aQ as c, g, m as p, a_ as l, a$ as f, b0 as m, b1 as h, c as d, O as b } from "./console-BEoM5C3l.js";
|
3
|
+
import { r as _ } from "./executable-Bm7iL2Wr.js";
|
4
4
|
const A = ({ args: a }, { dirs: t }) => {
|
5
5
|
for (const e of t)
|
6
6
|
c(e);
|
@@ -69,4 +69,4 @@ function E(a, t) {
|
|
69
69
|
export {
|
70
70
|
A as nodeGrepTool
|
71
71
|
};
|
72
|
-
//# sourceMappingURL=node-
|
72
|
+
//# sourceMappingURL=node-BuGshbyJ.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"node-
|
1
|
+
{"version":3,"file":"node-BuGshbyJ.js","sources":["../../core/src/tools/builtin/grep/node.ts"],"sourcesContent":["import { catchError, combineLatest, map, Observable } from '@sourcegraph/observable'\nimport type { URI } from 'vscode-uri'\nimport type { ToolRun } from '../../tool-service'\nimport { checkArgSafety, checkDirURIIsFile, spawnAndObserveChildProcess } from '../node-helpers'\nimport type { GrepToolArgs } from './common'\nimport {\n\tGREP_MAX_COLUMN_LENGTH,\n\tGREP_MAX_RESULTS_PER_FILE,\n\ttype GrepToolDef,\n\ttype grepToolReg,\n} from './common'\nimport { ripgrepExecutable } from './executable'\n\nexport const nodeGrepTool: NonNullable<(typeof grepToolReg)['fn']> = ({ args }, { dirs }) => {\n\tfor (const dir of dirs) {\n\t\tcheckDirURIIsFile(dir)\n\t}\n\treturn combineLatest(...dirs.map((dir) => ripgrepFiles(dir, args))).pipe(\n\t\tmap<ToolRun<GrepToolDef>[], ToolRun<GrepToolDef>>((results) => {\n\t\t\tconst progress: string[] = []\n\t\t\tfor (const result of results) {\n\t\t\t\tif (result.status === 'in-progress') {\n\t\t\t\t\tprogress.push(...(result?.progress ?? []))\n\t\t\t\t} else if (result.status === 'done') {\n\t\t\t\t\tprogress.push(...result.result)\n\t\t\t\t} else if (result.status === 'cancelled') {\n\t\t\t\t\tprogress.push(...(result.progress ?? []))\n\t\t\t\t} else if (result.status === 'error') {\n\t\t\t\t\tprogress.push(...(result.progress ?? []))\n\t\t\t\t}\n\t\t\t}\n\t\t\tconst errors = results.filter((result) => result.status === 'error')\n\t\t\tif (errors.length > 0) {\n\t\t\t\treturn {\n\t\t\t\t\tstatus: 'error',\n\t\t\t\t\tprogress,\n\t\t\t\t\terror: {\n\t\t\t\t\t\tmessage: errors\n\t\t\t\t\t\t\t.map<string>((error) => error?.error?.message ?? '')\n\t\t\t\t\t\t\t.join('\\n'),\n\t\t\t\t\t},\n\t\t\t\t}\n\t\t\t}\n\t\t\tconst status = results.every((result) => result.status === 'done')\n\t\t\t\t? 'done'\n\t\t\t\t: results.some((result) => result.status === 'cancelled')\n\t\t\t\t\t? 'cancelled'\n\t\t\t\t\t: 'in-progress'\n\t\t\treturn {\n\t\t\t\tstatus,\n\t\t\t\tprogress,\n\t\t\t\tresult: progress,\n\t\t\t}\n\t\t}),\n\t)\n}\n\nfunction ripgrepFiles(dir: URI, args: GrepToolArgs): Observable<ToolRun<GrepToolDef>> {\n\tconst ripgrepArgs: string[] = [\n\t\t'--with-filename',\n\t\t'--line-number',\n\t\t'--no-heading',\n\t\t'--no-require-git',\n\t\t'--max-columns',\n\t\tGREP_MAX_COLUMN_LENGTH.toString(),\n\t\t'--trim',\n\t\t'--max-count',\n\t\tGREP_MAX_RESULTS_PER_FILE.toString(),\n\t]\n\tif (!args.caseSensitive) {\n\t\tripgrepArgs.push('-i')\n\t}\n\tripgrepArgs.push('--regexp', args.pattern)\n\tif (args.path) {\n\t\tcheckArgSafety(args.path)\n\t\tripgrepArgs.push(args.path)\n\t}\n\n\treturn spawnAndObserveChildProcess(ripgrepExecutable(), ripgrepArgs, {\n\t\tcwd: dir.fsPath,\n\t\tstdio: ['ignore', 'pipe', 'pipe'],\n\t}).pipe(\n\t\tmap(({ stdout, stderr: _stderr, exitCode, exited }): ToolRun<GrepToolDef> => {\n\t\t\tconst matches = stdout\n\t\t\t\t.trim()\n\t\t\t\t.split('\\n')\n\t\t\t\t.filter((line) => line.length > 0)\n\n\t\t\tif (!exited) {\n\t\t\t\treturn {\n\t\t\t\t\tstatus: 'in-progress',\n\t\t\t\t\tprogress: matches,\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// ripgrep exit code 1 means \"no matches found\"\n\t\t\tif (exited && exitCode && exitCode >= 2) {\n\t\t\t\treturn {\n\t\t\t\t\tstatus: 'error',\n\t\t\t\t\tprogress: matches,\n\t\t\t\t\terror: { message: `ripgrep exited with code ${exitCode}` },\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\tstatus: 'done',\n\t\t\t\tprogress: matches,\n\t\t\t\tresult: matches,\n\t\t\t}\n\t\t}),\n\t\tcatchError((error) =>\n\t\t\tObservable.of({\n\t\t\t\tstatus: 'error',\n\t\t\t\tprogress: [],\n\t\t\t\terror: { message: String(error) },\n\t\t\t}),\n\t\t),\n\t)\n}\n"],"names":["nodeGrepTool","args","dirs","dir","checkDirURIIsFile","combineLatest","ripgrepFiles","map","results","progress","result","errors","error","ripgrepArgs","GREP_MAX_COLUMN_LENGTH","GREP_MAX_RESULTS_PER_FILE","checkArgSafety","spawnAndObserveChildProcess","ripgrepExecutable","stdout","_stderr","exitCode","exited","matches","line","catchError","Observable"],"mappings":";;;AAaO,MAAMA,IAAwD,CAAC,EAAE,MAAAC,KAAQ,EAAE,MAAAC,QAAW;AAC5F,aAAWC,KAAOD;AACjB,IAAAE,EAAkBD,CAAG;AAEf,SAAAE,EAAc,GAAGH,EAAK,IAAI,CAACC,MAAQG,EAAaH,GAAKF,CAAI,CAAC,CAAC,EAAE;AAAA,IACnEM,EAAkD,CAACC,MAAY;AAC9D,YAAMC,IAAqB,CAAC;AAC5B,iBAAWC,KAAUF;AAChB,QAAAE,EAAO,WAAW,gBACrBD,EAAS,KAAK,GAAIC,GAAQ,YAAY,CAAA,CAAG,IAC/BA,EAAO,WAAW,SACnBD,EAAA,KAAK,GAAGC,EAAO,MAAM,IACpBA,EAAO,WAAW,cAC5BD,EAAS,KAAK,GAAIC,EAAO,YAAY,CAAA,CAAG,IAC9BA,EAAO,WAAW,WAC5BD,EAAS,KAAK,GAAIC,EAAO,YAAY,CAAA,CAAG;AAG1C,YAAMC,IAASH,EAAQ,OAAO,CAACE,MAAWA,EAAO,WAAW,OAAO;AAC/D,aAAAC,EA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;AAAA,QACR,UAAUE;AAAA,QACV,QAAQA;AAAA,MACT,IAnBQ;AAAA,QACN,QAAQ;AAAA,QACR,UAAUA;AAAA,MACX;AAAA,IAgBD,CACA;AAAA,IACDE;AAAA,MAAW,CAACb,MACXc,EAAW,GAAG;AAAA,QACb,QAAQ;AAAA,QACR,UAAU,CAAC;AAAA,QACX,OAAO,EAAE,SAAS,OAAOd,CAAK,EAAE;AAAA,MAChC,CAAA;AAAA,IAAA;AAAA,EAEH;AACD;"}
|
@@ -1,8 +1,8 @@
|
|
1
1
|
#!/usr/bin/env node
|
2
2
|
import * as oe from "node:os";
|
3
3
|
import { resolve as he } from "node:path";
|
4
|
-
import { b2 as ce, b3 as le, aV as re, b1 as ue, aU as fe, aQ as _e, O as te, b4 as de, b5 as ie, b6 as pe } from "./console-
|
5
|
-
import { loadProfileEnvironmentVariables as ge } from "./load-profile-
|
4
|
+
import { b2 as ce, b3 as le, aV as re, b1 as ue, aU as fe, aQ as _e, O as te, b4 as de, b5 as ie, b6 as pe } from "./console-BEoM5C3l.js";
|
5
|
+
import { loadProfileEnvironmentVariables as ge } from "./load-profile-DRELVkLs.js";
|
6
6
|
var se = {}, ne;
|
7
7
|
function ve() {
|
8
8
|
return ne || (ne = 1, function(W) {
|
@@ -3498,4 +3498,4 @@ function Ee(W) {
|
|
3498
3498
|
export {
|
3499
3499
|
ke as nodeBashTool
|
3500
3500
|
};
|
3501
|
-
//# sourceMappingURL=node-
|
3501
|
+
//# sourceMappingURL=node-CcCnjzdp.js.map
|