@sourcegraph/amp 0.0.1748851339-g31df22 → 0.0.1748877319-g69d2be

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.
Files changed (52) hide show
  1. package/dist/amp.js +3 -2
  2. package/dist/amp.js.map +1 -1
  3. package/dist/client-CEMYqypS.js +35 -0
  4. package/dist/client-CEMYqypS.js.map +1 -0
  5. package/dist/{console-k3nh7b4U.js → console-Dz8kjLXq.js} +38668 -17361
  6. package/dist/console-Dz8kjLXq.js.map +1 -0
  7. package/dist/{create_file.node-Dxp9NAiW.js → create_file.node-Dkg9a9qS.js} +2 -2
  8. package/dist/{create_file.node-Dxp9NAiW.js.map → create_file.node-Dkg9a9qS.js.map} +1 -1
  9. package/dist/{edit_file.node-BlCpGVR-.js → edit_file.node-BzmJeIBM.js} +10 -10
  10. package/dist/{edit_file.node-BlCpGVR-.js.map → edit_file.node-BzmJeIBM.js.map} +1 -1
  11. package/dist/{executable-DTI1_xm7.js → executable-BfvtWYTF.js} +2 -2
  12. package/dist/{executable-DTI1_xm7.js.map → executable-BfvtWYTF.js.map} +1 -1
  13. package/dist/{files-DdjDm_B8.js → files-DLJqtzT7.js} +3 -3
  14. package/dist/{files-DdjDm_B8.js.map → files-DLJqtzT7.js.map} +1 -1
  15. package/dist/glob.node-D18uhtO0.js +137 -0
  16. package/dist/glob.node-D18uhtO0.js.map +1 -0
  17. package/dist/index-DDEnF9L5.js +922 -0
  18. package/dist/index-DDEnF9L5.js.map +1 -0
  19. package/dist/{list_directory.node-DDhJZGvT.js → list_directory.node-ldHqnCmb.js} +2 -2
  20. package/dist/{list_directory.node-DDhJZGvT.js.map → list_directory.node-ldHqnCmb.js.map} +1 -1
  21. package/dist/{load-profile-CWDhvBXX.js → load-profile-2hKEWJfV.js} +2 -2
  22. package/dist/{load-profile-CWDhvBXX.js.map → load-profile-2hKEWJfV.js.map} +1 -1
  23. package/dist/main-BnHTihL6.js +19700 -0
  24. package/dist/main-BnHTihL6.js.map +1 -0
  25. package/dist/{node-B1RLuGfG.js → node-BHe5RJPs.js} +41 -41
  26. package/dist/{node-B1RLuGfG.js.map → node-BHe5RJPs.js.map} +1 -1
  27. package/dist/{node-w5kFgl6-.js → node-BMzC1GPN.js} +47 -47
  28. package/dist/{node-w5kFgl6-.js.map → node-BMzC1GPN.js.map} +1 -1
  29. package/dist/node-BRxAOe2b.js +85 -0
  30. package/dist/node-BRxAOe2b.js.map +1 -0
  31. package/dist/{node-DGc3Eu0F.js → node-CUTKGt9Y.js} +3 -3
  32. package/dist/{node-DGc3Eu0F.js.map → node-CUTKGt9Y.js.map} +1 -1
  33. package/dist/{node-BZlRkYQw.js → node-CzSXw-Xz.js} +2 -2
  34. package/dist/{node-BZlRkYQw.js.map → node-CzSXw-Xz.js.map} +1 -1
  35. package/dist/{node-DuhaU87r.js → node-DcXu8fEU.js} +1090 -833
  36. package/dist/node-DcXu8fEU.js.map +1 -0
  37. package/dist/{read_file.node-CsATnmUF.js → read_file.node-6DnwIJAn.js} +2 -2
  38. package/dist/{read_file.node-CsATnmUF.js.map → read_file.node-6DnwIJAn.js.map} +1 -1
  39. package/dist/{stdio-Egb8ZIIg.js → stdio-B_076PGB.js} +29 -29
  40. package/dist/{stdio-Egb8ZIIg.js.map → stdio-B_076PGB.js.map} +1 -1
  41. package/dist/storybook.js +1 -1
  42. package/dist/{undo_edit.node-CHrrMPkn.js → undo_edit.node-WsSsWWo7.js} +10 -10
  43. package/dist/{undo_edit.node-CHrrMPkn.js.map → undo_edit.node-WsSsWWo7.js.map} +1 -1
  44. package/package.json +1 -1
  45. package/dist/console-k3nh7b4U.js.map +0 -1
  46. package/dist/glob.node-BnKeKl9M.js +0 -1051
  47. package/dist/glob.node-BnKeKl9M.js.map +0 -1
  48. package/dist/main-DuPQOPga.js +0 -40843
  49. package/dist/main-DuPQOPga.js.map +0 -1
  50. package/dist/node-3m0J6gBv.js +0 -72
  51. package/dist/node-3m0J6gBv.js.map +0 -1
  52. package/dist/node-DuhaU87r.js.map +0 -1
@@ -1,72 +0,0 @@
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-k3nh7b4U.js";
3
- import { r as _ } from "./executable-DTI1_xm7.js";
4
- const A = ({ args: a }, { dirs: t }) => {
5
- for (const e of t)
6
- c(e);
7
- return g(...t.map((e) => E(e, a))).pipe(
8
- p((e) => {
9
- const s = [];
10
- for (const r of e)
11
- r.status === "in-progress" ? s.push(...r?.progress ?? []) : r.status === "done" ? s.push(...r.result) : r.status === "cancelled" ? s.push(...r.progress ?? []) : r.status === "error" && s.push(...r.progress ?? []);
12
- const i = e.filter((r) => r.status === "error");
13
- return i.length > 0 ? {
14
- status: "error",
15
- progress: s,
16
- error: {
17
- message: i.map((r) => r?.error?.message ?? "").join(`
18
- `)
19
- }
20
- } : {
21
- status: e.every((r) => r.status === "done") ? "done" : e.some((r) => r.status === "cancelled") ? "cancelled" : "in-progress",
22
- progress: s,
23
- result: s
24
- };
25
- })
26
- );
27
- };
28
- function E(a, t) {
29
- const e = [
30
- "--with-filename",
31
- "--line-number",
32
- "--no-heading",
33
- "--no-require-git",
34
- "--max-columns",
35
- l.toString(),
36
- "--trim",
37
- "--max-count",
38
- f.toString()
39
- ];
40
- return t.caseSensitive || e.push("-i"), e.push("--regexp", t.pattern), t.path && (m(t.path), e.push(t.path)), h(_(), e, {
41
- cwd: a.fsPath,
42
- stdio: ["ignore", "pipe", "pipe"]
43
- }).pipe(
44
- p(({ stdout: s, stderr: i, exitCode: o, exited: r }) => {
45
- const n = s.trim().split(`
46
- `).filter((u) => u.length > 0);
47
- return r ? r && o && o >= 2 ? {
48
- status: "error",
49
- progress: n,
50
- error: { message: `ripgrep exited with code ${o}` }
51
- } : {
52
- status: "done",
53
- progress: n,
54
- result: n
55
- } : {
56
- status: "in-progress",
57
- progress: n
58
- };
59
- }),
60
- d(
61
- (s) => b.of({
62
- status: "error",
63
- progress: [],
64
- error: { message: String(s) }
65
- })
66
- )
67
- );
68
- }
69
- export {
70
- A as nodeGrepTool
71
- };
72
- //# sourceMappingURL=node-3m0J6gBv.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"node-3m0J6gBv.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,EAAO,SAAS,IACZ;AAAA,QACN,QAAQ;AAAA,QACR,UAAAF;AAAA,QACA,OAAO;A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