@sourcegraph/amp 0.0.1748534542-g657cb9 → 0.0.1748563307-g76b426
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-Bs5UNAQf.js → color-ldrInzKB.js} +4901 -4944
- package/dist/color-ldrInzKB.js.map +1 -0
- package/dist/{create_file.node-DhqtPKLL.js → create_file.node-pHiRAwrz.js} +2 -2
- package/dist/{create_file.node-DhqtPKLL.js.map → create_file.node-pHiRAwrz.js.map} +1 -1
- package/dist/{edit_file.node-_jUhb0Ej.js → edit_file.node-nAUP_3bW.js} +3 -3
- package/dist/{edit_file.node-_jUhb0Ej.js.map → edit_file.node-nAUP_3bW.js.map} +1 -1
- package/dist/{executable-De4-Iq-q.js → executable-D9Dr9Z2U.js} +2 -2
- package/dist/{executable-De4-Iq-q.js.map → executable-D9Dr9Z2U.js.map} +1 -1
- package/dist/{files-Cahfcbk6.js → files-C7vv9BDa.js} +2 -2
- package/dist/{files-Cahfcbk6.js.map → files-C7vv9BDa.js.map} +1 -1
- package/dist/{glob.node-DMC-mbKX.js → glob.node-Mg2vA9hM.js} +3 -3
- package/dist/{glob.node-DMC-mbKX.js.map → glob.node-Mg2vA9hM.js.map} +1 -1
- package/dist/{list_directory.node-BiNTY-zJ.js → list_directory.node-BQq4XK-y.js} +2 -2
- package/dist/{list_directory.node-BiNTY-zJ.js.map → list_directory.node-BQq4XK-y.js.map} +1 -1
- package/dist/{load-profile-Gn3gm8Ha.js → load-profile-D7KCxFft.js} +2 -2
- package/dist/{load-profile-Gn3gm8Ha.js.map → load-profile-D7KCxFft.js.map} +1 -1
- package/dist/{main-Dojlq-Ds.js → main-B8n5KdeK.js} +4406 -4384
- package/dist/main-B8n5KdeK.js.map +1 -0
- package/dist/{node-BSxJt4fE.js → node-4YOMf-Tu.js} +3 -3
- package/dist/{node-BSxJt4fE.js.map → node-4YOMf-Tu.js.map} +1 -1
- package/dist/{node-B-VoRsW5.js → node-C2XZ5nUw.js} +2 -2
- package/dist/{node-B-VoRsW5.js.map → node-C2XZ5nUw.js.map} +1 -1
- package/dist/{node-IbYXJXx-.js → node-CCnEMObW.js} +3 -3
- package/dist/{node-IbYXJXx-.js.map → node-CCnEMObW.js.map} +1 -1
- package/dist/{node-CD0uLwWO.js → node-CjTxUnpu.js} +3 -3
- package/dist/{node-CD0uLwWO.js.map → node-CjTxUnpu.js.map} +1 -1
- package/dist/{node-BeQHJ-gW.js → node-mEGuz3HH.js} +2 -2
- package/dist/{node-BeQHJ-gW.js.map → node-mEGuz3HH.js.map} +1 -1
- package/dist/{node-C9OGtvwV.js → node-n3roOnuX.js} +3 -3
- package/dist/{node-C9OGtvwV.js.map → node-n3roOnuX.js.map} +1 -1
- package/dist/{read_file.node-D_famz3I.js → read_file.node-Da0ma4-1.js} +2 -2
- package/dist/{read_file.node-D_famz3I.js.map → read_file.node-Da0ma4-1.js.map} +1 -1
- package/dist/{stdio-Ctzk1-2g.js → stdio-D2dcTskV.js} +3 -3
- package/dist/{stdio-Ctzk1-2g.js.map → stdio-D2dcTskV.js.map} +1 -1
- package/dist/storybook.js +1 -1
- package/dist/{undo_edit.node-C8sU5262.js → undo_edit.node-BH-4_Rkm.js} +2 -2
- package/dist/{undo_edit.node-C8sU5262.js.map → undo_edit.node-BH-4_Rkm.js.map} +1 -1
- package/package.json +1 -1
- package/dist/color-Bs5UNAQf.js.map +0 -1
- package/dist/main-Dojlq-Ds.js.map +0 -1
@@ -1,6 +1,6 @@
|
|
1
1
|
#!/usr/bin/env node
|
2
|
-
import { aT as c, g, m as p, b1 as l, b2 as f, b3 as m, aR as h, c as d, O as b } from "./color-
|
3
|
-
import { r as E } from "./executable-
|
2
|
+
import { aT as c, g, m as p, b1 as l, b2 as f, b3 as m, aR as h, c as d, O as b } from "./color-ldrInzKB.js";
|
3
|
+
import { r as E } from "./executable-D9Dr9Z2U.js";
|
4
4
|
const v = ({ args: a }, { dirs: t }) => {
|
5
5
|
for (const e of t)
|
6
6
|
c(e);
|
@@ -69,4 +69,4 @@ function _(a, t) {
|
|
69
69
|
export {
|
70
70
|
v as nodeGrepTool
|
71
71
|
};
|
72
|
-
//# sourceMappingURL=node-
|
72
|
+
//# sourceMappingURL=node-CCnEMObW.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"node-
|
1
|
+
{"version":3,"file":"node-CCnEMObW.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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AAAA,MAC1D,IAGM;AAAA,QACN,QAAQ;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 { aO as ce, aP as le, aQ as re, aR as ue, aS as fe, aT as _e, O as te, aU as de, aV as ie, aW as pe } from "./color-
|
5
|
-
import { loadProfileEnvironmentVariables as ge } from "./load-profile-
|
4
|
+
import { aO as ce, aP as le, aQ as re, aR as ue, aS as fe, aT as _e, O as te, aU as de, aV as ie, aW as pe } from "./color-ldrInzKB.js";
|
5
|
+
import { loadProfileEnvironmentVariables as ge } from "./load-profile-D7KCxFft.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-CjTxUnpu.js.map
|