@sourcegraph/amp 0.0.1748929708-g4e0808 → 0.0.1748937736-gb61f9e

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 (45) hide show
  1. package/dist/amp.js +3 -3
  2. package/dist/{client-DM7cuALa.js → client-TG0TgWWB.js} +2 -2
  3. package/dist/client-TG0TgWWB.js.map +1 -0
  4. package/dist/{console-mWOvD6Pa.js → console-Dok1Wcwn.js} +3583 -3572
  5. package/dist/console-Dok1Wcwn.js.map +1 -0
  6. package/dist/{create_file.node-C811NWdx.js → create_file.node-C-YeOXhP.js} +2 -2
  7. package/dist/{create_file.node-C811NWdx.js.map → create_file.node-C-YeOXhP.js.map} +1 -1
  8. package/dist/{edit_file.node-BHKC-gQq.js → edit_file.node-Cvsfx7pt.js} +3 -3
  9. package/dist/{edit_file.node-BHKC-gQq.js.map → edit_file.node-Cvsfx7pt.js.map} +1 -1
  10. package/dist/{executable-C7hPnzew.js → executable-DmtB95BF.js} +2 -2
  11. package/dist/{executable-C7hPnzew.js.map → executable-DmtB95BF.js.map} +1 -1
  12. package/dist/{files-B8V2eCKM.js → files-4uCbUmV7.js} +2 -2
  13. package/dist/{files-B8V2eCKM.js.map → files-4uCbUmV7.js.map} +1 -1
  14. package/dist/{glob.node-BaOYqDt4.js → glob.node-RP059oWX.js} +4 -4
  15. package/dist/{glob.node-BaOYqDt4.js.map → glob.node-RP059oWX.js.map} +1 -1
  16. package/dist/{index-C8J8Ux8A.js → index-CPC32RPi.js} +2 -2
  17. package/dist/{index-C8J8Ux8A.js.map → index-CPC32RPi.js.map} +1 -1
  18. package/dist/{list_directory.node-BgRfRZbc.js → list_directory.node-JfCvF09W.js} +2 -2
  19. package/dist/{list_directory.node-BgRfRZbc.js.map → list_directory.node-JfCvF09W.js.map} +1 -1
  20. package/dist/{load-profile-zboUN1ze.js → load-profile-CLxEjyWl.js} +2 -2
  21. package/dist/{load-profile-zboUN1ze.js.map → load-profile-CLxEjyWl.js.map} +1 -1
  22. package/dist/{main-Bw6YRo_L.js → main-DpQQJHE4.js} +16 -16
  23. package/dist/{main-Bw6YRo_L.js.map → main-DpQQJHE4.js.map} +1 -1
  24. package/dist/{node-Cvj0SzTq.js → node-3gS1o4eu.js} +4 -4
  25. package/dist/{node-Cvj0SzTq.js.map → node-3gS1o4eu.js.map} +1 -1
  26. package/dist/{node-CcXhHJLX.js → node-B0o5uOa2.js} +3 -3
  27. package/dist/{node-CcXhHJLX.js.map → node-B0o5uOa2.js.map} +1 -1
  28. package/dist/{node-DoPUdUgl.js → node-Bjgpi_MV.js} +3 -3
  29. package/dist/{node-DoPUdUgl.js.map → node-Bjgpi_MV.js.map} +1 -1
  30. package/dist/{node-De4liSZz.js → node-CHXrHmHR.js} +2 -2
  31. package/dist/{node-De4liSZz.js.map → node-CHXrHmHR.js.map} +1 -1
  32. package/dist/{node-B-tg-yFK.js → node-CdCbaOgJ.js} +3 -3
  33. package/dist/{node-B-tg-yFK.js.map → node-CdCbaOgJ.js.map} +1 -1
  34. package/dist/{node-cHFAXE7T.js → node-D2BIeojc.js} +2 -2
  35. package/dist/{node-cHFAXE7T.js.map → node-D2BIeojc.js.map} +1 -1
  36. package/dist/{read_file.node-CljqDFUj.js → read_file.node-BEjFBYF8.js} +2 -2
  37. package/dist/{read_file.node-CljqDFUj.js.map → read_file.node-BEjFBYF8.js.map} +1 -1
  38. package/dist/{stdio-D9Zqzkf5.js → stdio-h4IgaI9t.js} +3 -3
  39. package/dist/{stdio-D9Zqzkf5.js.map → stdio-h4IgaI9t.js.map} +1 -1
  40. package/dist/storybook.js +1 -1
  41. package/dist/{undo_edit.node-BgCpAlBA.js → undo_edit.node-DnT_lcaR.js} +2 -2
  42. package/dist/{undo_edit.node-BgCpAlBA.js.map → undo_edit.node-DnT_lcaR.js.map} +1 -1
  43. package/package.json +1 -1
  44. package/dist/client-DM7cuALa.js.map +0 -1
  45. package/dist/console-mWOvD6Pa.js.map +0 -1
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
- import { p as f } from "./index-C8J8Ux8A.js";
3
- import { aB as m, g, m as c, aM as h, aN as d, aO as b, aP as E, c as S, O as _ } from "./console-mWOvD6Pa.js";
4
- import { r as v } from "./executable-C7hPnzew.js";
2
+ import { p as f } from "./index-CPC32RPi.js";
3
+ import { aB as m, g, m as c, aM as h, aN as d, aO as b, aP as E, c as S, O as _ } from "./console-Dok1Wcwn.js";
4
+ import { r as v } from "./executable-DmtB95BF.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
  P as ripgrepFiles
84
84
  };
85
- //# sourceMappingURL=node-Cvj0SzTq.js.map
85
+ //# sourceMappingURL=node-3gS1o4eu.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"node-Cvj0SzTq.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,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AA,MAAW,CAAChB,MACXiB,EAAW,GAAG;AAAA,QACb,QAAQ;AAAA,QACR,UAAU,CAAC;AAAA,QACX,OAAO,EAAE,SAAS,OAAOjB,CAAK,EAAE;AAAA,MAChC,CAAA;AAAA,IAAA;AAAA,EAEH;AACD;"}
1
+ {"version":3,"file":"node-3gS1o4eu.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,IAC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GjB,EAAK,MAAM,EAAE,QAAQ,CAACA,EAAK,eAAe,KAAK,GAAA,CAAM,IACxD;AAEI,SAAAkB,EAA4BC,EAAkB,GAAGP,GAAa;AAAA,IACpE,KAAKV;AAAA,IACL,OAAO,CAAC,UAAU,QAAQ,MAAM;AAAA,EAChC,CAAA,EAAE;AAAA,IACFI,EAAI,CAAC,EAAE,QAAAc,GAAQ,QAAQC,GAAS,UAAAC,GAAU,QAAAC,QAAmC;AACtE,YAAAC,IAAUJ,EACd,KAAK,EACL,MAAM;AAAA,CAAI,EACV,OAAO,CAACK,MAAS;AACb,YAAAA,EAAK,WAAW;AACZ,iBAAA;AAER,YAAIT,GAAoB;AACvB,gBAAM,CAACU,CAAQ,IAAID,EAAK,MAAM,KAAK,CAAC;AACpC,cAAIC,KAAY,CAACV,EAAmBU,CAAQ;AACpC,mBAAA;AAAA,QACR;AAEM,eAAA;AAAA,MAAA,CACP;AAEF,aAAKH,IAQDA,KAAUD,KAAYA,KAAY,IAC9B;AAAA,QACN,QAAQ;AAAA,QACR,UAAUE;AAAA,QACV,OAAO,EAAE,SAAS,4BAA4BF,CAAQ,GAAG;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,IACDG;AAAA,MAAW,CAAChB,MACXiB,EAAW,GAAG;AAAA,QACb,QAAQ;AAAA,QACR,UAAU,CAAC;AAAA,QACX,OAAO,EAAE,SAAS,OAAOjB,CAAK,EAAE;AAAA,MAChC,CAAA;AAAA,IAAA;AAAA,EAEH;AACD;"}
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
- import { f as a } from "./client-DM7cuALa.js";
3
- import { p as u, aQ as c } from "./console-mWOvD6Pa.js";
2
+ import { f as a } from "./client-TG0TgWWB.js";
3
+ import { p as u, aQ as c } from "./console-Dok1Wcwn.js";
4
4
  const l = ({ args: o }, { threadID: t }) => u(async (s) => {
5
5
  try {
6
6
  const r = `/api/web-search?query=${encodeURIComponent(o.query)}&numResults=${o.num_results || 5}`, e = await a(r, {
@@ -23,4 +23,4 @@ const l = ({ args: o }, { threadID: t }) => u(async (s) => {
23
23
  export {
24
24
  l as nodeWebSearchTool
25
25
  };
26
- //# sourceMappingURL=node-CcXhHJLX.js.map
26
+ //# sourceMappingURL=node-B0o5uOa2.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"node-CcXhHJLX.js","sources":["../../core/src/tools/builtin/web_search/node.ts"],"sourcesContent":["import { promiseFactoryToObservable } from '@sourcegraph/observable'\nimport { fetchFromAmpServer } from '../../../server-api/client'\nimport { HEADER_KEY_THREAD_ID } from '../../../server-api/headers'\nimport type { webSearchToolReg } from './common'\n\nexport const nodeWebSearchTool: NonNullable<(typeof webSearchToolReg)['fn']> = (\n\t{ args },\n\t{ threadID },\n) => {\n\treturn promiseFactoryToObservable(async (signal) => {\n\t\ttry {\n\t\t\t// Call the server endpoint using the fetchFromAmpServer helper\n\t\t\tconst url = `/api/web-search?query=${encodeURIComponent(args.query)}&numResults=${args.num_results || 5}`\n\t\t\tconst response = await fetchFromAmpServer(url, {\n\t\t\t\tmethod: 'GET',\n\t\t\t\tsignal,\n\t\t\t\theaders: threadID ? { [HEADER_KEY_THREAD_ID]: threadID } : undefined,\n\t\t\t})\n\n\t\t\tif (!response.ok) {\n\t\t\t\tconst errorText = await response.text()\n\t\t\t\tthrow new Error(`Server returned ${response.status}: ${errorText}`)\n\t\t\t}\n\n\t\t\tconst results = await response.json()\n\t\t\treturn {\n\t\t\t\tstatus: 'done' as const,\n\t\t\t\tresult: results,\n\t\t\t}\n\t\t} catch (error) {\n\t\t\tthrow new Error(`Failed to perform web search: ${(error as Error).message}`)\n\t\t}\n\t})\n}\n"],"names":["nodeWebSearchTool","args","threadID","promiseFactoryToObservable","signal","url","response","fetchFromAmpServer","HEADER_KEY_THREAD_ID","errorText","error"],"mappings":";;;AAKO,MAAMA,IAAkE,CAC9E,EAAE,MAAAC,KACF,EAAE,UAAAC,QAEKC,EAA2B,OAAOC,MAAW;AAC/C,MAAA;AAEG,UAAAC,IAAM,yBAAyB,mBAAmBJ,EAAK,KAAK,CAAC,eAAeA,EAAK,eAAe,CAAC,IACjGK,IAAW,MAAMC,EAAmBF,GAAK;AAAA,MAC9C,QAAQ;AAAA,MACR,QAAAD;AAAA,MACA,SAASF,IAAW,EAAE,CAACM,CAAoB,GAAGN,EAAa,IAAA;AAAA,IAAA,CAC3D;AAEG,QAAA,CAACI,EAAS,IAAI;AACX,YAAAG,IAAY,MAAMH,EAAS,KAAK;AACtC,YAAM,IAAI,MAAM,mBAAmBA,EAAS,MAAM,KAAKG,CAAS,EAAE;AAAA,IAAA;AAI5D,WAAA;AAAA,MACN,QAAQ;AAAA,MACR,QAHe,MAAMH,EAAS,KAAK;AAAA,IAIpC;AAAA,WACQI,GAAO;AACf,UAAM,IAAI,MAAM,iCAAkCA,EAAgB,OAAO,EAAE;AAAA,EAAA;AAC5E,CACA;"}
1
+ {"version":3,"file":"node-B0o5uOa2.js","sources":["../../core/src/tools/builtin/web_search/node.ts"],"sourcesContent":["import { promiseFactoryToObservable } from '@sourcegraph/observable'\nimport { fetchFromAmpServer } from '../../../server-api/client'\nimport { HEADER_KEY_THREAD_ID } from '../../../server-api/headers'\nimport type { webSearchToolReg } from './common'\n\nexport const nodeWebSearchTool: NonNullable<(typeof webSearchToolReg)['fn']> = (\n\t{ args },\n\t{ threadID },\n) => {\n\treturn promiseFactoryToObservable(async (signal) => {\n\t\ttry {\n\t\t\t// Call the server endpoint using the fetchFromAmpServer helper\n\t\t\tconst url = `/api/web-search?query=${encodeURIComponent(args.query)}&numResults=${args.num_results || 5}`\n\t\t\tconst response = await fetchFromAmpServer(url, {\n\t\t\t\tmethod: 'GET',\n\t\t\t\tsignal,\n\t\t\t\theaders: threadID ? { [HEADER_KEY_THREAD_ID]: threadID } : undefined,\n\t\t\t})\n\n\t\t\tif (!response.ok) {\n\t\t\t\tconst errorText = await response.text()\n\t\t\t\tthrow new Error(`Server returned ${response.status}: ${errorText}`)\n\t\t\t}\n\n\t\t\tconst results = await response.json()\n\t\t\treturn {\n\t\t\t\tstatus: 'done' as const,\n\t\t\t\tresult: results,\n\t\t\t}\n\t\t} catch (error) {\n\t\t\tthrow new Error(`Failed to perform web search: ${(error as Error).message}`)\n\t\t}\n\t})\n}\n"],"names":["nodeWebSearchTool","args","threadID","promiseFactoryToObservable","signal","url","response","fetchFromAmpServer","HEADER_KEY_THREAD_ID","errorText","error"],"mappings":";;;AAKO,MAAMA,IAAkE,CAC9E,EAAE,MAAAC,KACF,EAAE,UAAAC,QAEKC,EAA2B,OAAOC,MAAW;AAC/C,MAAA;AAEG,UAAAC,IAAM,yBAAyB,mBAAmBJ,EAAK,KAAK,CAAC,eAAeA,EAAK,eAAe,CAAC,IACjGK,IAAW,MAAMC,EAAmBF,GAAK;AAAA,MAC9C,QAAQ;AAAA,MACR,QAAAD;AAAA,MACA,SAASF,IAAW,EAAE,CAACM,CAAoB,GAAGN,EAAa,IAAA;AAAA,IAAA,CAC3D;AAEG,QAAA,CAACI,EAAS,IAAI;AACX,YAAAG,IAAY,MAAMH,EAAS,KAAK;AACtC,YAAM,IAAI,MAAM,mBAAmBA,EAAS,MAAM,KAAKG,CAAS,EAAE;AAAA,IAAA;AAI5D,WAAA;AAAA,MACN,QAAQ;AAAA,MACR,QAHe,MAAMH,EAAS,KAAK;AAAA,IAIpC;AAAA,WACQI,GAAO;AACf,UAAM,IAAI,MAAM,iCAAkCA,EAAgB,OAAO,EAAE;AAAA,EAAA;AAC5E,CACA;"}
@@ -1,8 +1,8 @@
1
1
  #!/usr/bin/env node
2
2
  import * as ce from "node:os";
3
3
  import ee, { resolve as ue } from "node:path";
4
- import { aS as fe, aT as _e, C as de, aU as ne, aV as pe, aW as ge, aH as ae, aP as ve, aG as me, aB as be, O as se } from "./console-mWOvD6Pa.js";
5
- import { loadProfileEnvironmentVariables as Se } from "./load-profile-zboUN1ze.js";
4
+ import { aS as fe, aT as _e, C as de, aU as ne, aV as pe, aW as ge, aH as ae, aP as ve, aG as me, aB as be, O as se } from "./console-Dok1Wcwn.js";
5
+ import { loadProfileEnvironmentVariables as Se } from "./load-profile-CLxEjyWl.js";
6
6
  const Ce = [
7
7
  "ls",
8
8
  "dir",
@@ -3755,4 +3755,4 @@ function Re(x) {
3755
3755
  export {
3756
3756
  Fe as nodeBashTool
3757
3757
  };
3758
- //# sourceMappingURL=node-DoPUdUgl.js.map
3758
+ //# sourceMappingURL=node-Bjgpi_MV.js.map