@sourcegraph/amp 0.0.1748361686-ga6cbdd → 0.0.1748376091-g59fbbf
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-DfrJv231.js → client-D37xwk4h.js} +2 -2
- package/dist/{client-DfrJv231.js.map → client-D37xwk4h.js.map} +1 -1
- package/dist/{color-Bf2jGwiV.js → color-BV9wbewg.js} +24 -20
- package/dist/color-BV9wbewg.js.map +1 -0
- package/dist/create_file.node-D2LDnTZ6.js +24 -0
- package/dist/create_file.node-D2LDnTZ6.js.map +1 -0
- package/dist/{edit_file.node-D2Wa6RXM.js → edit_file.node-Ccrf_Tyh.js} +3 -3
- package/dist/{edit_file.node-D2Wa6RXM.js.map → edit_file.node-Ccrf_Tyh.js.map} +1 -1
- package/dist/{executable-Cf6tmsfm.js → executable-DndKF3B_.js} +2 -2
- package/dist/{executable-Cf6tmsfm.js.map → executable-DndKF3B_.js.map} +1 -1
- package/dist/{files-U5BBkj-L.js → files-CApLN3XI.js} +2 -2
- package/dist/{files-U5BBkj-L.js.map → files-CApLN3XI.js.map} +1 -1
- package/dist/{glob.node-Cfv1JwiF.js → glob.node-C_0Pojo_.js} +3 -3
- package/dist/{glob.node-Cfv1JwiF.js.map → glob.node-C_0Pojo_.js.map} +1 -1
- package/dist/{list_directory.node-Dmx2XM_W.js → list_directory.node-CChuHPoL.js} +2 -2
- package/dist/{list_directory.node-Dmx2XM_W.js.map → list_directory.node-CChuHPoL.js.map} +1 -1
- package/dist/{load-profile-Bu7wgoOq.js → load-profile-CBXx5Izf.js} +2 -2
- package/dist/{load-profile-Bu7wgoOq.js.map → load-profile-CBXx5Izf.js.map} +1 -1
- package/dist/{main-CmK9yaC9.js → main-90Zv8RqJ.js} +487 -477
- package/dist/{main-CmK9yaC9.js.map → main-90Zv8RqJ.js.map} +1 -1
- package/dist/{node-DSPACSAV.js → node-B8I2GAD6.js} +3 -3
- package/dist/{node-DSPACSAV.js.map → node-B8I2GAD6.js.map} +1 -1
- package/dist/{node-7PIWGuuc.js → node-BGD834Zv.js} +4 -4
- package/dist/node-BGD834Zv.js.map +1 -0
- package/dist/{node-DUQOAXRE.js → node-BcU66Cp7.js} +3 -3
- package/dist/{node-DUQOAXRE.js.map → node-BcU66Cp7.js.map} +1 -1
- package/dist/{node-C1YHImbI.js → node-DgFnFiEl.js} +3 -3
- package/dist/{node-C1YHImbI.js.map → node-DgFnFiEl.js.map} +1 -1
- package/dist/{node-W217cnDV.js → node-Dmg_Tr9C.js} +3 -3
- package/dist/{node-W217cnDV.js.map → node-Dmg_Tr9C.js.map} +1 -1
- package/dist/{node-Bt-aqwyP.js → node-gL35nPzg.js} +2 -2
- package/dist/{node-Bt-aqwyP.js.map → node-gL35nPzg.js.map} +1 -1
- package/dist/{read_file.node-2sVFQX4N.js → read_file.node-FBiGQRUp.js} +2 -2
- package/dist/{read_file.node-2sVFQX4N.js.map → read_file.node-FBiGQRUp.js.map} +1 -1
- package/dist/{stdio-CNkqPrBz.js → stdio-8fytXW34.js} +3 -3
- package/dist/{stdio-CNkqPrBz.js.map → stdio-8fytXW34.js.map} +1 -1
- package/dist/storybook.js +1 -1
- package/dist/{undo_edit.node-CQG6mtZj.js → undo_edit.node-NCKppvcB.js} +2 -2
- package/dist/{undo_edit.node-CQG6mtZj.js.map → undo_edit.node-NCKppvcB.js.map} +1 -1
- package/package.json +1 -1
- package/dist/color-Bf2jGwiV.js.map +0 -1
- package/dist/create_file.node-BnMPGgD2.js +0 -22
- package/dist/create_file.node-BnMPGgD2.js.map +0 -1
- package/dist/node-7PIWGuuc.js.map +0 -1
package/dist/amp.js
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
#!/usr/bin/env node
|
2
|
-
import "./color-
|
3
|
-
import "./main-
|
2
|
+
import "./color-BV9wbewg.js";
|
3
|
+
import "./main-90Zv8RqJ.js";
|
4
4
|
import "node:crypto";
|
5
5
|
import "node:fs/promises";
|
6
6
|
import "node:path";
|
7
7
|
import "node:process";
|
8
|
-
import "./client-
|
8
|
+
import "./client-D37xwk4h.js";
|
9
9
|
//# sourceMappingURL=amp.js.map
|
@@ -1,5 +1,5 @@
|
|
1
1
|
#!/usr/bin/env node
|
2
|
-
import { f as i, r as o, ba as n, s as p, p as c } from "./color-
|
2
|
+
import { f as i, r as o, ba as n, s as p, p as c } from "./color-BV9wbewg.js";
|
3
3
|
const u = o.pipe(
|
4
4
|
p(({ settings: e, secrets: t }) => c(async () => await t.getToken("apiKey", e.url) !== void 0))
|
5
5
|
);
|
@@ -32,4 +32,4 @@ export {
|
|
32
32
|
w as f,
|
33
33
|
u as i
|
34
34
|
};
|
35
|
-
//# sourceMappingURL=client-
|
35
|
+
//# sourceMappingURL=client-D37xwk4h.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"client-
|
1
|
+
{"version":3,"file":"client-D37xwk4h.js","sources":["../../core/src/server-api/client.ts"],"sourcesContent":["import type { ThreadOperatorShare } from '@sourcegraph/amp-api-types'\nimport type { Observable } from '@sourcegraph/observable'\nimport {\n\tdistinctUntilChanged,\n\tfirstValueFrom,\n\tmap,\n\ttype pendingOperation,\n\tpromiseFactoryToObservable,\n\tswitchMap,\n\tswitchMapReplayOperation,\n} from '@sourcegraph/observable'\nimport { isEqualJSON } from '../common/isEqualJSON'\nimport { type PickResolvedConfiguration, resolvedConfig } from '../configuration/resolver'\nimport { clientIdentificationHeaders } from '../misc/known-clients'\nimport type { ThreadID } from '../threads/thread'\nimport type { ThreadService } from '../threads/thread-service'\n\nexport const isAmpServerConfigured = resolvedConfig.pipe(\n\tswitchMap(({ settings, secrets }) => {\n\t\treturn promiseFactoryToObservable(async () => {\n\t\t\tconst apiKey = await secrets.getToken('apiKey', settings.url)\n\t\t\treturn apiKey !== undefined\n\t\t})\n\t}),\n)\n\n/**\n * Returns the URL to a thread on the Amp server.\n */\nexport function threadURL(ampURL: URL, threadID: ThreadID): URL {\n\treturn new URL(`/threads/${threadID}`, ampURL)\n}\n\n/**\n * Makes a request to the Amp API with the proper configuration\n */\nexport async function fetchFromAmpServer(\n\tpathAndQuery: string,\n\tinit?: RequestInit,\n): Promise<Response> {\n\tconst config = await firstValueFrom(resolvedConfig, init?.signal ?? undefined)\n\treturn fetchFromAmpServerWithConfig(config, pathAndQuery, init)\n}\n\nexport function watchOnAmpServer<T>(\n\tpathAndQuery: string,\n\tinit?: Omit<RequestInit, 'signal'>,\n): Observable<T | typeof pendingOperation | Error> {\n\treturn resolvedConfig.pipe(\n\t\tmap(\n\t\t\t({ settings, secrets }) =>\n\t\t\t\t({\n\t\t\t\t\tsettings: {\n\t\t\t\t\t\turl: settings.url,\n\t\t\t\t\t},\n\t\t\t\t\tsecrets,\n\t\t\t\t}) satisfies PickResolvedConfiguration<{\n\t\t\t\t\tsettings: 'url'\n\t\t\t\t\tsecrets: true\n\t\t\t\t}>,\n\t\t),\n\t\tdistinctUntilChanged(\n\t\t\t(a, b) => isEqualJSON(a.settings, b.settings) && a.secrets === b.secrets,\n\t\t),\n\t\tswitchMapReplayOperation((config) =>\n\t\t\tpromiseFactoryToObservable(async (signal) => {\n\t\t\t\tconst resp = await fetchFromAmpServerWithConfig(config, pathAndQuery, {\n\t\t\t\t\t...init,\n\t\t\t\t\tsignal,\n\t\t\t\t})\n\t\t\t\tif (!resp.ok) {\n\t\t\t\t\tconst text = await resp.text()\n\t\t\t\t\tif (text) {\n\t\t\t\t\t\tthrow new Error(`HTTP ${resp.status}: ${text}`)\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthrow new Error(`HTTP ${resp.status}`)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn (await resp.json()) as T\n\t\t\t}),\n\t\t),\n\t)\n}\n\n/**\n * Share a thread with the operator (i.e., the Amp team).\n */\nexport async function shareThreadWithOperator(\n\tthreadService: ThreadService,\n\tthreadID: ThreadID,\n): Promise<void> {\n\tconst thread = await firstValueFrom(threadService.observe(threadID))\n\tif (!thread) {\n\t\tthrow new Error(`Thread not found: ${threadID}`)\n\t}\n\n\tconst response = await fetchFromAmpServer('/api/internal/share-thread-with-operator', {\n\t\tmethod: 'POST',\n\t\theaders: {\n\t\t\t'Content-Type': 'application/json',\n\t\t},\n\t\tbody: JSON.stringify({ threadData: thread } as Pick<ThreadOperatorShare, 'threadData'>),\n\t})\n\tif (!response.ok) {\n\t\tconst text = await response.text()\n\t\tthrow new Error(`Failed to share thread: ${response.status} ${text}`)\n\t}\n}\n\nasync function fetchFromAmpServerWithConfig(\n\tconfig: PickResolvedConfiguration<{\n\t\tsettings: 'url'\n\t\tsecrets: true\n\t}>,\n\tpathAndQuery: string,\n\tinit?: RequestInit,\n): Promise<Response> {\n\tif (pathAndQuery.startsWith('http:') || pathAndQuery.startsWith('https:')) {\n\t\tthrow new Error('input must be a path, not an absolute URL')\n\t}\n\tif (!pathAndQuery.startsWith('/')) {\n\t\tthrow new Error('pathAndQuery must start with /')\n\t}\n\n\tconst baseURL = config.settings.url\n\tif (!baseURL) {\n\t\tthrow new Error('amp.url is not set')\n\t}\n\n\tconst apiKey = await config.secrets.getToken('apiKey', baseURL)\n\tif (!apiKey) {\n\t\tthrow new Error('Amp API key is not set')\n\t}\n\n\treturn fetch(new URL(pathAndQuery, baseURL), {\n\t\t...init,\n\t\theaders: {\n\t\t\t...init?.headers,\n\t\t\t...clientIdentificationHeaders(),\n\t\t\t'Content-Type': 'application/json',\n\t\t\tAuthorization: `Bearer ${apiKey}`,\n\t\t},\n\t})\n}\n"],"names":["isAmpServerConfigured","resolvedConfig","switchMap","settings","secrets","promiseFactoryToObservable","fetchFromAmpServer","pathAndQuery","init","config","firstValueFrom","fetchFromAmpServerWithConfig","baseURL","apiKey","clientIdentificationHeaders"],"mappings":";;AAiBO,MAAMA,IAAwBC,EAAe;AAAA,EACnDC,EAAU,CAAC,EAAE,UAAAC,GAAU,SAAAC,QACfC,EAA2B,YAClB,MAAMD,EAAQ,SAAS,UAAUD,EAAS,GAAG,MAC1C,MAClB,CACD;AACF;AAYsB,eAAAG,EACrBC,GACAC,GACoB;AACpB,QAAMC,IAAS,MAAMC,EAAeT,GAAgBO,GAAM,UAAU,MAAS;AACtE,SAAAG,EAA6BF,GAAQF,GAAcC,CAAI;AAC/D;AAmEA,eAAeG,EACdF,GAIAF,GACAC,GACoB;AACpB,MAAID,EAAa,WAAW,OAAO,KAAKA,EAAa,WAAW,QAAQ;AACjE,UAAA,IAAI,MAAM,2CAA2C;AAE5D,MAAI,CAACA,EAAa,WAAW,GAAG;AACzB,UAAA,IAAI,MAAM,gCAAgC;AAG3C,QAAAK,IAAUH,EAAO,SAAS;AAChC,MAAI,CAACG;AACE,UAAA,IAAI,MAAM,oBAAoB;AAGrC,QAAMC,IAAS,MAAMJ,EAAO,QAAQ,SAAS,UAAUG,CAAO;AAC9D,MAAI,CAACC;AACE,UAAA,IAAI,MAAM,wBAAwB;AAGzC,SAAO,MAAM,IAAI,IAAIN,GAAcK,CAAO,GAAG;AAAA,IAC5C,GAAGJ;AAAA,IACH,SAAS;AAAA,MACR,GAAGA,GAAM;AAAA,MACT,GAAGM,EAA4B;AAAA,MAC/B,gBAAgB;AAAA,MAChB,eAAe,UAAUD,CAAM;AAAA,IAAA;AAAA,EAChC,CACA;AACF;"}
|
@@ -7057,7 +7057,7 @@ Prefer this tool over \`edit_file\` when you want to ovewrite the entire content
|
|
7057
7057
|
},
|
7058
7058
|
source: "builtin"
|
7059
7059
|
},
|
7060
|
-
fn: import("./create_file.node-
|
7060
|
+
fn: import("./create_file.node-D2LDnTZ6.js").then(
|
7061
7061
|
({ nodeCreateFileTool: t }) => t
|
7062
7062
|
)
|
7063
7063
|
}, Xt = "Grep", GC = 15, YC = 250, qC = `Search for exact text patterns in files using ripgrep, a fast keyword search tool.
|
@@ -7190,7 +7190,7 @@ COMPLEMENTARY USE WITH CODEBASE_SEARCH:
|
|
7190
7190
|
},
|
7191
7191
|
source: "builtin"
|
7192
7192
|
},
|
7193
|
-
fn: import("./node-
|
7193
|
+
fn: import("./node-DgFnFiEl.js").then(({ nodeGrepTool: t }) => t)
|
7194
7194
|
}, hr = "read_file", HC = 1e3, yn = {
|
7195
7195
|
spec: {
|
7196
7196
|
name: hr,
|
@@ -7222,7 +7222,7 @@ Returns the contents of the file with each line prefixed by its line number. For
|
|
7222
7222
|
switch ("node") {
|
7223
7223
|
case "node":
|
7224
7224
|
case "vscode":
|
7225
|
-
return import("./read_file.node-
|
7225
|
+
return import("./read_file.node-FBiGQRUp.js").then(({ nodeReadFileTool: t }) => t);
|
7226
7226
|
}
|
7227
7227
|
})()
|
7228
7228
|
}, $C = gC({
|
@@ -7251,7 +7251,7 @@ If you need to replace the entire contents of a file, use \`${ri}\` instead, sin
|
|
7251
7251
|
inputSchema: kD($C),
|
7252
7252
|
source: "builtin"
|
7253
7253
|
},
|
7254
|
-
fn: import("./edit_file.node-
|
7254
|
+
fn: import("./edit_file.node-Ccrf_Tyh.js").then(({ nodeEditFileTool: t }) => t)
|
7255
7255
|
};
|
7256
7256
|
async function lJ(t, e, r, n) {
|
7257
7257
|
e = Zn(e);
|
@@ -7669,7 +7669,11 @@ function s0(t) {
|
|
7669
7669
|
const e = [];
|
7670
7670
|
return t.currentlyVisibleFiles && (t.currentlyVisibleFiles.length > 0 ? e.push(
|
7671
7671
|
`Currently visible files user has open: ${t.currentlyVisibleFiles.join(", ")}`
|
7672
|
-
) : e.push("Currently visible files user has open: none")), t.
|
7672
|
+
) : e.push("Currently visible files user has open: none")), t.runningTerminalCommands && t.runningTerminalCommands.length > 0 && e.push(
|
7673
|
+
`Currently running terminal commands:
|
7674
|
+
${t.runningTerminalCommands.join(`
|
7675
|
+
`)}`
|
7676
|
+
), t.activeEditor && e.push(`Currently active editor: ${t.activeEditor}`), t.activeEditor && !rh(t.activeEditor) && (t.selectionRange ? (e.push(
|
7673
7677
|
`Selection range: ${t.selectionRange.start.line}:${t.selectionRange.start.column}-${t.selectionRange.end.line}:${t.selectionRange.end.column}`
|
7674
7678
|
), e.push(`Selected text: \`${t.selectionRange.content}\``)) : t.cursorLocation && (e.push(
|
7675
7679
|
`Current cursor location: ${t.cursorLocation.line}:${t.cursorLocation.column}`
|
@@ -8252,7 +8256,7 @@ Note: Results are sorted by modification time with the most recently modified fi
|
|
8252
8256
|
},
|
8253
8257
|
source: "builtin"
|
8254
8258
|
},
|
8255
|
-
fn: import("./glob.node-
|
8259
|
+
fn: import("./glob.node-C_0Pojo_.js").then(({ nodeGlobTool: t }) => t)
|
8256
8260
|
}, ii = "list_directory", u_ = {
|
8257
8261
|
spec: {
|
8258
8262
|
name: ii,
|
@@ -8273,7 +8277,7 @@ Note: Results are sorted by modification time with the most recently modified fi
|
|
8273
8277
|
switch ("node") {
|
8274
8278
|
case "node":
|
8275
8279
|
case "vscode":
|
8276
|
-
return import("./list_directory.node-
|
8280
|
+
return import("./list_directory.node-CChuHPoL.js").then(
|
8277
8281
|
({ nodeListDirectoryTool: t }) => t
|
8278
8282
|
);
|
8279
8283
|
}
|
@@ -9097,7 +9101,7 @@ It's VERY IMPORTANT to use specific tools when searching for files, instead of i
|
|
9097
9101
|
},
|
9098
9102
|
source: "builtin"
|
9099
9103
|
},
|
9100
|
-
fn: import("./node-
|
9104
|
+
fn: import("./node-B8I2GAD6.js").then(({ nodeBashTool: t }) => t)
|
9101
9105
|
}, $0 = [
|
9102
9106
|
"ls",
|
9103
9107
|
"dir",
|
@@ -9428,7 +9432,7 @@ This tool converts web content to markdown format for better readability.`,
|
|
9428
9432
|
requiresNetwork: !0
|
9429
9433
|
}
|
9430
9434
|
},
|
9431
|
-
fn: import("./node-
|
9435
|
+
fn: import("./node-gL35nPzg.js").then(({ nodeReadWebPageTool: t }) => t)
|
9432
9436
|
}, uh = "think", X0 = (t, e) => An(async () => ({ status: "done", result: "Thoughts have been logged." })), Z0 = {
|
9433
9437
|
spec: {
|
9434
9438
|
name: uh,
|
@@ -9493,7 +9497,7 @@ the \`${Bu}\` with the url.
|
|
9493
9497
|
requiresNetwork: !0
|
9494
9498
|
}
|
9495
9499
|
},
|
9496
|
-
fn: import("./node-
|
9500
|
+
fn: import("./node-BcU66Cp7.js").then(({ nodeWebSearchTool: t }) => t)
|
9497
9501
|
}, Sn = "Task", Uu = [
|
9498
9502
|
u_,
|
9499
9503
|
sa,
|
@@ -10208,7 +10212,7 @@ Returns a git-style diff showing the changes that were undone as formatted markd
|
|
10208
10212
|
},
|
10209
10213
|
source: "builtin"
|
10210
10214
|
},
|
10211
|
-
fn: import("./undo_edit.node-
|
10215
|
+
fn: import("./undo_edit.node-NCKppvcB.js").then(({ nodeUndoEditTool: t }) => t)
|
10212
10216
|
};
|
10213
10217
|
function xJ(t, e, r) {
|
10214
10218
|
const n = [], a = [];
|
@@ -54360,10 +54364,10 @@ export {
|
|
54360
54364
|
i0 as a7,
|
54361
54365
|
mJ as a8,
|
54362
54366
|
fJ as a9,
|
54363
|
-
|
54364
|
-
|
54365
|
-
|
54366
|
-
|
54367
|
+
hZ as aA,
|
54368
|
+
MT as aB,
|
54369
|
+
RZ as aC,
|
54370
|
+
rE as aD,
|
54367
54371
|
FJ as aE,
|
54368
54372
|
BJ as aF,
|
54369
54373
|
JZ as aG,
|
@@ -54409,10 +54413,10 @@ export {
|
|
54409
54413
|
nn as at,
|
54410
54414
|
FT as au,
|
54411
54415
|
m0 as av,
|
54412
|
-
|
54413
|
-
|
54414
|
-
|
54415
|
-
|
54416
|
+
En as aw,
|
54417
|
+
vJ as ax,
|
54418
|
+
qZ as ay,
|
54419
|
+
Ev as az,
|
54416
54420
|
OS as b,
|
54417
54421
|
hJ as b0,
|
54418
54422
|
xu as b1,
|
@@ -54451,4 +54455,4 @@ export {
|
|
54451
54455
|
vZ as y,
|
54452
54456
|
YZ as z
|
54453
54457
|
};
|
54454
|
-
//# sourceMappingURL=color-
|
54458
|
+
//# sourceMappingURL=color-BV9wbewg.js.map
|