@sourcegraph/amp 0.0.1748995311-g48c047 → 0.0.1749024087-g33af67

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-BkaI5kKG.js → client-CPGg8tRm.js} +2 -2
  3. package/dist/{client-BkaI5kKG.js.map → client-CPGg8tRm.js.map} +1 -1
  4. package/dist/{console-DlvnS_PE.js → console-DY9rQWrM.js} +2324 -2295
  5. package/dist/{console-DlvnS_PE.js.map → console-DY9rQWrM.js.map} +1 -1
  6. package/dist/{create_file.node-C2Op_dsu.js → create_file.node-B48ZHKo3.js} +2 -2
  7. package/dist/{create_file.node-C2Op_dsu.js.map → create_file.node-B48ZHKo3.js.map} +1 -1
  8. package/dist/{edit_file.node-DOXYI4BF.js → edit_file.node-DoDZvMoJ.js} +3 -3
  9. package/dist/{edit_file.node-DOXYI4BF.js.map → edit_file.node-DoDZvMoJ.js.map} +1 -1
  10. package/dist/{executable-J9OTPVlu.js → executable-CxIxK7vJ.js} +2 -2
  11. package/dist/{executable-J9OTPVlu.js.map → executable-CxIxK7vJ.js.map} +1 -1
  12. package/dist/{files-BK-FXTs6.js → files-LP9v826d.js} +2 -2
  13. package/dist/{files-BK-FXTs6.js.map → files-LP9v826d.js.map} +1 -1
  14. package/dist/{glob.node-DY9yT4AY.js → glob.node-BJLXov5T.js} +4 -4
  15. package/dist/{glob.node-DY9yT4AY.js.map → glob.node-BJLXov5T.js.map} +1 -1
  16. package/dist/{index-rcepANaJ.js → index-VY0YWJcj.js} +2 -2
  17. package/dist/{index-rcepANaJ.js.map → index-VY0YWJcj.js.map} +1 -1
  18. package/dist/{list_directory.node-D7qXHmRo.js → list_directory.node-Bi80mJM9.js} +2 -2
  19. package/dist/{list_directory.node-D7qXHmRo.js.map → list_directory.node-Bi80mJM9.js.map} +1 -1
  20. package/dist/{load-profile-BUHHcehO.js → load-profile-AW_lhfUQ.js} +2 -2
  21. package/dist/{load-profile-BUHHcehO.js.map → load-profile-AW_lhfUQ.js.map} +1 -1
  22. package/dist/{main-Dbpfm_So.js → main-DZ3ddwsv.js} +1200 -1185
  23. package/dist/main-DZ3ddwsv.js.map +1 -0
  24. package/dist/{node-xzPuMkqe.js → node-BeTgxAcj.js} +3 -3
  25. package/dist/{node-xzPuMkqe.js.map → node-BeTgxAcj.js.map} +1 -1
  26. package/dist/{node-DS9Hs9qY.js → node-CsrPPeTB.js} +264 -264
  27. package/dist/node-CsrPPeTB.js.map +1 -0
  28. package/dist/{node-DOiXkBGJ.js → node-D_4hSZ7t.js} +4 -4
  29. package/dist/{node-DOiXkBGJ.js.map → node-D_4hSZ7t.js.map} +1 -1
  30. package/dist/{node-BpmB5Fls.js → node-DoR5cBi5.js} +2 -2
  31. package/dist/{node-BpmB5Fls.js.map → node-DoR5cBi5.js.map} +1 -1
  32. package/dist/{node-BNvn2KY7.js → node-DrcVKZtX.js} +2 -2
  33. package/dist/{node-BNvn2KY7.js.map → node-DrcVKZtX.js.map} +1 -1
  34. package/dist/{node-CIBkZJEX.js → node-odO3HE4R.js} +3 -3
  35. package/dist/{node-CIBkZJEX.js.map → node-odO3HE4R.js.map} +1 -1
  36. package/dist/{read_file.node-CydSvhk-.js → read_file.node-N26TFyJs.js} +2 -2
  37. package/dist/{read_file.node-CydSvhk-.js.map → read_file.node-N26TFyJs.js.map} +1 -1
  38. package/dist/{stdio-MVEgcaUb.js → stdio-CkJOML7a.js} +3 -3
  39. package/dist/{stdio-MVEgcaUb.js.map → stdio-CkJOML7a.js.map} +1 -1
  40. package/dist/storybook.js +1 -1
  41. package/dist/{undo_edit.node-BuUtjMny.js → undo_edit.node-zFPearKX.js} +2 -2
  42. package/dist/{undo_edit.node-BuUtjMny.js.map → undo_edit.node-zFPearKX.js.map} +1 -1
  43. package/package.json +1 -1
  44. package/dist/main-Dbpfm_So.js.map +0 -1
  45. package/dist/node-DS9Hs9qY.js.map +0 -1
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
- import { i as a, F as c, f as i } from "./client-BkaI5kKG.js";
3
- import { p as m, aQ as l } from "./console-DlvnS_PE.js";
2
+ import { i as a, F as c, f as i } from "./client-CPGg8tRm.js";
3
+ import { p as m, aQ as l } from "./console-DY9rQWrM.js";
4
4
  const h = ({ args: e }, { threadID: o }) => m(async (s) => {
5
5
  try {
6
6
  const r = await a.webSearch(
@@ -40,4 +40,4 @@ const h = ({ args: e }, { threadID: o }) => m(async (s) => {
40
40
  export {
41
41
  h as nodeWebSearchTool
42
42
  };
43
- //# sourceMappingURL=node-xzPuMkqe.js.map
43
+ //# sourceMappingURL=node-BeTgxAcj.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"node-xzPuMkqe.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 {\n\tFALLBACK_TO_OLD_INTERNAL_API,\n\tinternalAPIClient,\n} from '../../../server-api/internal-api-client'\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\tconst resp = await internalAPIClient.webSearch(\n\t\t\t\t{\n\t\t\t\t\tquery: args.query,\n\t\t\t\t\tnumResults: args.num_results || 5,\n\t\t\t\t\tthread: threadID,\n\t\t\t\t},\n\t\t\t\t{ signal },\n\t\t\t)\n\t\t\tif (!resp.ok) {\n\t\t\t\tthrow new Error(\n\t\t\t\t\t`Failed to perform web search: ${resp.error.message || 'Unknown error'}`,\n\t\t\t\t)\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\tstatus: 'done' as const,\n\t\t\t\tresult: resp.result,\n\t\t\t}\n\t\t} catch (error) {\n\t\t\tif (FALLBACK_TO_OLD_INTERNAL_API) {\n\t\t\t\t// Fallback to old API\n\t\t\t\tconst url = `/api/web-search?query=${encodeURIComponent(args.query)}&numResults=${args.num_results || 5}`\n\t\t\t\tconst response = await fetchFromAmpServer(url, {\n\t\t\t\t\tmethod: 'GET',\n\t\t\t\t\tsignal,\n\t\t\t\t\theaders: threadID ? { [HEADER_KEY_THREAD_ID]: threadID } : undefined,\n\t\t\t\t})\n\n\t\t\t\tif (!response.ok) {\n\t\t\t\t\tconst errorText = await response.text()\n\t\t\t\t\tthrow new Error(`Server returned ${response.status}: ${errorText}`)\n\t\t\t\t}\n\n\t\t\t\tconst results = await response.json()\n\t\t\t\treturn {\n\t\t\t\t\tstatus: 'done' as const,\n\t\t\t\t\tresult: results,\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tthrow error\n\t\t\t}\n\t\t}\n\t})\n}\n"],"names":["nodeWebSearchTool","args","threadID","promiseFactoryToObservable","signal","resp","internalAPIClient","FALLBACK_TO_OLD_INTERNAL_API","url","response","fetchFromAmpServer","HEADER_KEY_THREAD_ID","errorText"],"mappings":";;;AASO,MAAMA,IAAkE,CAC9E,EAAE,MAAAC,KACF,EAAE,UAAAC,QAEKC,EAA2B,OAAOC,MAAW;AAC/C,MAAA;AACG,UAAAC,IAAO,MAAMC,EAAkB;AAAA,MACpC;AAAA,QACC,OAAOL,EAAK;AAAA,QACZ,YAAYA,EAAK,eAAe;AAAA,QAChC,QAAQC;AAAA,MACT;AAAA,MACA,EAAE,QAAAE,EAAO;AAAA,IACV;AACI,QAAA,CAACC,EAAK;AACT,YAAM,IAAI;AAAA,QACT,iCAAiCA,EAAK,MAAM,WAAW,eAAe;AAAA,MACvE;AAGM,WAAA;AAAA,MACN,QAAQ;AAAA,MACR,QAAQA,EAAK;AAAA,IACd;AAAA,UACe;AACf,QAAIE,GAA8B;AAE3B,YAAAC,IAAM,yBAAyB,mBAAmBP,EAAK,KAAK,CAAC,eAAeA,EAAK,eAAe,CAAC,IACjGQ,IAAW,MAAMC,EAAmBF,GAAK;AAAA,QAC9C,QAAQ;AAAA,QACR,QAAAJ;AAAA,QACA,SAASF,IAAW,EAAE,CAACS,CAAoB,GAAGT,EAAa,IAAA;AAAA,MAAA,CAC3D;AAEG,UAAA,CAACO,EAAS,IAAI;AACX,cAAAG,IAAY,MAAMH,EAAS,KAAK;AACtC,cAAM,IAAI,MAAM,mBAAmBA,EAAS,MAAM,KAAKG,CAAS,EAAE;AAAA,MAAA;AAI5D,aAAA;AAAA,QACN,QAAQ;AAAA,QACR,QAHe,MAAMH,EAAS,KAAK;AAAA,MAIpC;AAAA,IAAA;AAAA,EAGD;AACD,CACA;"}
1
+ {"version":3,"file":"node-BeTgxAcj.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 {\n\tFALLBACK_TO_OLD_INTERNAL_API,\n\tinternalAPIClient,\n} from '../../../server-api/internal-api-client'\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\tconst resp = await internalAPIClient.webSearch(\n\t\t\t\t{\n\t\t\t\t\tquery: args.query,\n\t\t\t\t\tnumResults: args.num_results || 5,\n\t\t\t\t\tthread: threadID,\n\t\t\t\t},\n\t\t\t\t{ signal },\n\t\t\t)\n\t\t\tif (!resp.ok) {\n\t\t\t\tthrow new Error(\n\t\t\t\t\t`Failed to perform web search: ${resp.error.message || 'Unknown error'}`,\n\t\t\t\t)\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\tstatus: 'done' as const,\n\t\t\t\tresult: resp.result,\n\t\t\t}\n\t\t} catch (error) {\n\t\t\tif (FALLBACK_TO_OLD_INTERNAL_API) {\n\t\t\t\t// Fallback to old API\n\t\t\t\tconst url = `/api/web-search?query=${encodeURIComponent(args.query)}&numResults=${args.num_results || 5}`\n\t\t\t\tconst response = await fetchFromAmpServer(url, {\n\t\t\t\t\tmethod: 'GET',\n\t\t\t\t\tsignal,\n\t\t\t\t\theaders: threadID ? { [HEADER_KEY_THREAD_ID]: threadID } : undefined,\n\t\t\t\t})\n\n\t\t\t\tif (!response.ok) {\n\t\t\t\t\tconst errorText = await response.text()\n\t\t\t\t\tthrow new Error(`Server returned ${response.status}: ${errorText}`)\n\t\t\t\t}\n\n\t\t\t\tconst results = await response.json()\n\t\t\t\treturn {\n\t\t\t\t\tstatus: 'done' as const,\n\t\t\t\t\tresult: results,\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tthrow error\n\t\t\t}\n\t\t}\n\t})\n}\n"],"names":["nodeWebSearchTool","args","threadID","promiseFactoryToObservable","signal","resp","internalAPIClient","FALLBACK_TO_OLD_INTERNAL_API","url","response","fetchFromAmpServer","HEADER_KEY_THREAD_ID","errorText"],"mappings":";;;AASO,MAAMA,IAAkE,CAC9E,EAAE,MAAAC,KACF,EAAE,UAAAC,QAEKC,EAA2B,OAAOC,MAAW;AAC/C,MAAA;AACG,UAAAC,IAAO,MAAMC,EAAkB;AAAA,MACpC;AAAA,QACC,OAAOL,EAAK;AAAA,QACZ,YAAYA,EAAK,eAAe;AAAA,QAChC,QAAQC;AAAA,MACT;AAAA,MACA,EAAE,QAAAE,EAAO;AAAA,IACV;AACI,QAAA,CAACC,EAAK;AACT,YAAM,IAAI;AAAA,QACT,iCAAiCA,EAAK,MAAM,WAAW,eAAe;AAAA,MACvE;AAGM,WAAA;AAAA,MACN,QAAQ;AAAA,MACR,QAAQA,EAAK;AAAA,IACd;AAAA,UACe;AACf,QAAIE,GAA8B;AAE3B,YAAAC,IAAM,yBAAyB,mBAAmBP,EAAK,KAAK,CAAC,eAAeA,EAAK,eAAe,CAAC,IACjGQ,IAAW,MAAMC,EAAmBF,GAAK;AAAA,QAC9C,QAAQ;AAAA,QACR,QAAAJ;AAAA,QACA,SAASF,IAAW,EAAE,CAACS,CAAoB,GAAGT,EAAa,IAAA;AAAA,MAAA,CAC3D;AAEG,UAAA,CAACO,EAAS,IAAI;AACX,cAAAG,IAAY,MAAMH,EAAS,KAAK;AACtC,cAAM,IAAI,MAAM,mBAAmBA,EAAS,MAAM,KAAKG,CAAS,EAAE;AAAA,MAAA;AAI5D,aAAA;AAAA,QACN,QAAQ;AAAA,QACR,QAHe,MAAMH,EAAS,KAAK;AAAA,MAIpC;AAAA,IAAA;AAAA,EAGD;AACD,CACA;"}