@sourcegraph/amp 0.0.1749073878-gd24060 → 0.0.1749096401-g3a8a18
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-DRkn40v5.js → client-CT0UspN7.js} +2 -2
- package/dist/{client-DRkn40v5.js.map → client-CT0UspN7.js.map} +1 -1
- package/dist/{console-cTFB4LXV.js → console-CZXURH0C.js} +4838 -4861
- package/dist/console-CZXURH0C.js.map +1 -0
- package/dist/{create_file.node-BnxKZkS8.js → create_file.node-Bg2Ha2Q0.js} +2 -2
- package/dist/{create_file.node-BnxKZkS8.js.map → create_file.node-Bg2Ha2Q0.js.map} +1 -1
- package/dist/{edit_file.node-BrpV91sY.js → edit_file.node-BqRltvHA.js} +5 -5
- package/dist/{edit_file.node-BrpV91sY.js.map → edit_file.node-BqRltvHA.js.map} +1 -1
- package/dist/{executable-CkOCFEBG.js → executable-Dy1dmJR0.js} +2 -2
- package/dist/{executable-CkOCFEBG.js.map → executable-Dy1dmJR0.js.map} +1 -1
- package/dist/{files-D5Q2JGfw.js → files-yat9N0vH.js} +2 -2
- package/dist/{files-D5Q2JGfw.js.map → files-yat9N0vH.js.map} +1 -1
- package/dist/{glob.node-Cub51teu.js → glob.node-h1Swo4vr.js} +6 -6
- package/dist/{glob.node-Cub51teu.js.map → glob.node-h1Swo4vr.js.map} +1 -1
- package/dist/{index-l6SSoCQL.js → index-D5lm6ANC.js} +2 -2
- package/dist/{index-l6SSoCQL.js.map → index-D5lm6ANC.js.map} +1 -1
- package/dist/{list_directory.node-RNgF574B.js → list_directory.node-CEUOBF5h.js} +2 -2
- package/dist/{list_directory.node-RNgF574B.js.map → list_directory.node-CEUOBF5h.js.map} +1 -1
- package/dist/{load-profile-BUNbamZ9.js → load-profile-Dk7ZUf3s.js} +2 -2
- package/dist/{load-profile-BUNbamZ9.js.map → load-profile-Dk7ZUf3s.js.map} +1 -1
- package/dist/{main-CMjLSaJf.js → main-CS_jpDsP.js} +619 -620
- package/dist/main-CS_jpDsP.js.map +1 -0
- package/dist/{node-D2i4QyuX.js → node-BJyrP3Sj.js} +2 -2
- package/dist/{node-D2i4QyuX.js.map → node-BJyrP3Sj.js.map} +1 -1
- package/dist/{node-HnDWqqri.js → node-BtKYcfrH.js} +3 -3
- package/dist/{node-HnDWqqri.js.map → node-BtKYcfrH.js.map} +1 -1
- package/dist/{node-rOj17fe_.js → node-COZM4qQd.js} +3 -3
- package/dist/{node-rOj17fe_.js.map → node-COZM4qQd.js.map} +1 -1
- package/dist/{node-Bu9szyQU.js → node-CRrSwIMO.js} +7 -7
- package/dist/{node-Bu9szyQU.js.map → node-CRrSwIMO.js.map} +1 -1
- package/dist/{node-C8KhLGcS.js → node-DVHX-oeS.js} +2 -2
- package/dist/{node-C8KhLGcS.js.map → node-DVHX-oeS.js.map} +1 -1
- package/dist/{node-C-6V_-yI.js → node-dAg24OS_.js} +14 -14
- package/dist/{node-C-6V_-yI.js.map → node-dAg24OS_.js.map} +1 -1
- package/dist/{read_file.node-5Ab8TOWo.js → read_file.node-DbAEjkEn.js} +2 -2
- package/dist/{read_file.node-5Ab8TOWo.js.map → read_file.node-DbAEjkEn.js.map} +1 -1
- package/dist/{stdio-FoEa-Lul.js → stdio-BxgTnYre.js} +3 -3
- package/dist/{stdio-FoEa-Lul.js.map → stdio-BxgTnYre.js.map} +1 -1
- package/dist/storybook.js +1 -1
- package/dist/{undo_edit.node-knBYg6rq.js → undo_edit.node-DL1deBcE.js} +5 -5
- package/dist/{undo_edit.node-knBYg6rq.js.map → undo_edit.node-DL1deBcE.js.map} +1 -1
- package/package.json +1 -1
- package/dist/console-cTFB4LXV.js.map +0 -1
- package/dist/main-CMjLSaJf.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-
|
3
|
-
import { p as m,
|
2
|
+
import { i as a, F as c, f as i } from "./client-CT0UspN7.js";
|
3
|
+
import { p as m, aP as l } from "./console-CZXURH0C.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-
|
43
|
+
//# sourceMappingURL=node-BtKYcfrH.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"node-
|
1
|
+
{"version":3,"file":"node-BtKYcfrH.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,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 {
|
5
|
-
import { loadProfileEnvironmentVariables as Se } from "./load-profile-
|
4
|
+
import { aR as fe, aS as de, C as _e, aT as ne, aU as pe, aV as ge, aG as ae, aO as ve, aF as me, aA as be, O as se } from "./console-CZXURH0C.js";
|
5
|
+
import { loadProfileEnvironmentVariables as Se } from "./load-profile-Dk7ZUf3s.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-
|
3758
|
+
//# sourceMappingURL=node-COZM4qQd.js.map
|