@sourcegraph/amp 0.0.1748877319-g69d2be → 0.0.1748884278-g5bd3f6
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 +3 -3
- package/dist/{client-CEMYqypS.js → client-BdpLPYaH.js} +2 -2
- package/dist/{client-CEMYqypS.js.map → client-BdpLPYaH.js.map} +1 -1
- package/dist/{console-Dz8kjLXq.js → console-CqG_XvSY.js} +2326 -2327
- package/dist/console-CqG_XvSY.js.map +1 -0
- package/dist/{create_file.node-Dkg9a9qS.js → create_file.node-ADITw5B2.js} +2 -2
- package/dist/{create_file.node-Dkg9a9qS.js.map → create_file.node-ADITw5B2.js.map} +1 -1
- package/dist/{edit_file.node-BzmJeIBM.js → edit_file.node-DXreHiOg.js} +3 -3
- package/dist/{edit_file.node-BzmJeIBM.js.map → edit_file.node-DXreHiOg.js.map} +1 -1
- package/dist/{executable-BfvtWYTF.js → executable-CNRwugd8.js} +2 -2
- package/dist/{executable-BfvtWYTF.js.map → executable-CNRwugd8.js.map} +1 -1
- package/dist/{files-DLJqtzT7.js → files-BmtGFG0Q.js} +2 -2
- package/dist/{files-DLJqtzT7.js.map → files-BmtGFG0Q.js.map} +1 -1
- package/dist/{glob.node-D18uhtO0.js → glob.node-CVEV9zgB.js} +4 -4
- package/dist/{glob.node-D18uhtO0.js.map → glob.node-CVEV9zgB.js.map} +1 -1
- package/dist/{index-DDEnF9L5.js → index-BqIcA2B7.js} +2 -2
- package/dist/{index-DDEnF9L5.js.map → index-BqIcA2B7.js.map} +1 -1
- package/dist/{list_directory.node-ldHqnCmb.js → list_directory.node-BemKxEzJ.js} +2 -2
- package/dist/{list_directory.node-ldHqnCmb.js.map → list_directory.node-BemKxEzJ.js.map} +1 -1
- package/dist/{load-profile-2hKEWJfV.js → load-profile-DrobQ5m2.js} +2 -2
- package/dist/{load-profile-2hKEWJfV.js.map → load-profile-DrobQ5m2.js.map} +1 -1
- package/dist/{main-BnHTihL6.js → main-CN8Tv0Ze.js} +3745 -3707
- package/dist/main-CN8Tv0Ze.js.map +1 -0
- package/dist/{node-CUTKGt9Y.js → node-CIdEg4qU.js} +3 -3
- package/dist/{node-CUTKGt9Y.js.map → node-CIdEg4qU.js.map} +1 -1
- package/dist/{node-DcXu8fEU.js → node-CWIBdJry.js} +3 -3
- package/dist/{node-DcXu8fEU.js.map → node-CWIBdJry.js.map} +1 -1
- package/dist/{node-BRxAOe2b.js → node-CY_sNxT5.js} +4 -4
- package/dist/{node-BRxAOe2b.js.map → node-CY_sNxT5.js.map} +1 -1
- package/dist/{node-BMzC1GPN.js → node-D3-y_ogB.js} +2 -2
- package/dist/{node-BMzC1GPN.js.map → node-D3-y_ogB.js.map} +1 -1
- package/dist/{node-BHe5RJPs.js → node-DeysyjlP.js} +3 -3
- package/dist/{node-BHe5RJPs.js.map → node-DeysyjlP.js.map} +1 -1
- package/dist/{node-CzSXw-Xz.js → node-oyrvsiXU.js} +2 -2
- package/dist/{node-CzSXw-Xz.js.map → node-oyrvsiXU.js.map} +1 -1
- package/dist/{read_file.node-6DnwIJAn.js → read_file.node-6hnIOwx2.js} +2 -2
- package/dist/{read_file.node-6DnwIJAn.js.map → read_file.node-6hnIOwx2.js.map} +1 -1
- package/dist/{stdio-B_076PGB.js → stdio-Clg4okyZ.js} +3 -3
- package/dist/{stdio-B_076PGB.js.map → stdio-Clg4okyZ.js.map} +1 -1
- package/dist/storybook.js +1 -1
- package/dist/{undo_edit.node-WsSsWWo7.js → undo_edit.node-PvuGXz4H.js} +2 -2
- package/dist/{undo_edit.node-WsSsWWo7.js.map → undo_edit.node-PvuGXz4H.js.map} +1 -1
- package/package.json +1 -1
- package/dist/console-Dz8kjLXq.js.map +0 -1
- package/dist/main-BnHTihL6.js.map +0 -1
@@ -1,7 +1,7 @@
|
|
1
1
|
#!/usr/bin/env node
|
2
|
-
import { p as f } from "./index-
|
3
|
-
import { aA as m, g, m as c, aL as h, aM as d, aN as b, aO as E, c as S, O as _ } from "./console-
|
4
|
-
import { r as v } from "./executable-
|
2
|
+
import { p as f } from "./index-BqIcA2B7.js";
|
3
|
+
import { aA as m, g, m as c, aL as h, aM as d, aN as b, aO as E, c as S, O as _ } from "./console-CqG_XvSY.js";
|
4
|
+
import { r as v } from "./executable-CNRwugd8.js";
|
5
5
|
const O = ({ args: a }, { dirs: s }) => {
|
6
6
|
for (const e of s)
|
7
7
|
m(e);
|
@@ -82,4 +82,4 @@ export {
|
|
82
82
|
O as nodeGrepTool,
|
83
83
|
A as ripgrepFiles
|
84
84
|
};
|
85
|
-
//# sourceMappingURL=node-
|
85
|
+
//# sourceMappingURL=node-CY_sNxT5.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"node-
|
1
|
+
{"version":3,"file":"node-CY_sNxT5.js","sources":["../../core/src/tools/builtin/grep/node.ts"],"sourcesContent":["import { catchError, combineLatest, map, Observable } from '@sourcegraph/observable'\nimport pm from 'picomatch'\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.fsPath, 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\nexport function ripgrepFiles(dir: string, 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\t// Interpret the `glob` property in TypeScript instead of using the ripgrep\n\t// option `--glob` because using `--glob` disables the built-in gitignore\n\t// feature. We do the same thing in the Glob tool.\n\tconst matchesGlobPattern = args?.glob\n\t\t? pm(args.glob, { nocase: !args.caseSensitive, dot: true })\n\t\t: undefined\n\n\treturn spawnAndObserveChildProcess(ripgrepExecutable(), ripgrepArgs, {\n\t\tcwd: dir,\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) => {\n\t\t\t\t\tif (line.length === 0) {\n\t\t\t\t\t\treturn false\n\t\t\t\t\t}\n\t\t\t\t\tif (matchesGlobPattern) {\n\t\t\t\t\t\tconst [filename] = line.split(':', 1)\n\t\t\t\t\t\tif (filename && !matchesGlobPattern(filename)) {\n\t\t\t\t\t\t\treturn false\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\treturn true\n\t\t\t\t})\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","matchesGlobPattern","pm","spawnAndObserveChildProcess","ripgrepExecutable","stdout","_stderr","exitCode","exited","matches","line","filename","catchError","Observable"],"mappings":";;;;AAaO,MAAMA,IAAwD,CAAC,EAAE,MAAAC,KAAQ,EAAE,MAAAC,QAAW;AAC5F,aAAWC,KAAOD;AACjB,IAAAE,EAAkBD,CAAG;AAEtB,SAAOE,EAAc,GAAGH,EAAK,IAAI,CAACC,MAAQG,EAAaH,EAAI,QAAQF,CAAI,CAAC,CAAC,EAAE;AAAA,IAC1EM,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,EAAO,SAAS,IACZ;AAAA,QACN,QAAQ;AAAA,QACR,UAAAF;AAAA,QACA,OAAO;AAAA,UACN,SAASE,EACP,IAAY,CAACC,MAAUA,GAAO,OAAO,WAAW,EAAE,EAClD,KAAK;AAAA,CAAI;AAAA,QAAA;AAAA,MAEb,IAOM;AAAA,QACN,QANcJ,EAAQ,MAAM,CAACE,MAAWA,EAAO,WAAW,MAAM,IAC9D,SACAF,EAAQ,KAAK,CAACE,MAAWA,EAAO,WAAW,WAAW,IACrD,cACA;AAAA,QAGH,UAAAD;AAAA,QACA,QAAQA;AAAA,MACT;AAAA,IACA,CAAA;AAAA,EACF;AACD;AAEgB,SAAAH,EAAaH,GAAaF,GAAsD;AAC/F,QAAMY,IAAwB;AAAA,IAC7B;AAAA,IACA;AAAA,IACA;AAAA,IACA;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QACR,UAAU,CAAC;AAAA,QACX,OAAO,EAAE,SAAS,OAAOjB,CAAK,EAAE;AAAA,MAChC,CAAA;AAAA,IAAA;AAAA,EAEH;AACD;"}
|
@@ -1,5 +1,5 @@
|
|
1
1
|
#!/usr/bin/env node
|
2
|
-
import { a9 as Pe, a8 as st, p as lt } from "./console-
|
2
|
+
import { a9 as Pe, a8 as st, p as lt } from "./console-CqG_XvSY.js";
|
3
3
|
var pe = {}, Pu = {}, be = {}, Me;
|
4
4
|
function ne() {
|
5
5
|
return Me || (Me = 1, function(u) {
|
@@ -4850,4 +4850,4 @@ ${a}`
|
|
4850
4850
|
export {
|
4851
4851
|
ea as nodeReadWebPageTool
|
4852
4852
|
};
|
4853
|
-
//# sourceMappingURL=node-
|
4853
|
+
//# sourceMappingURL=node-D3-y_ogB.js.map
|