@sourcegraph/amp 0.0.1748330494-g3f0084 → 0.0.1748332886-g724284
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-DcfjDd4A.js → client-Brt5PSmQ.js} +2 -2
- package/dist/{client-DcfjDd4A.js.map → client-Brt5PSmQ.js.map} +1 -1
- package/dist/{color-CXy0Mt1O.js → color-BESHF9Kn.js} +21 -18
- package/dist/color-BESHF9Kn.js.map +1 -0
- package/dist/{create_file.node-Cnd4Nn8b.js → create_file.node-DzdShAEK.js} +2 -2
- package/dist/{create_file.node-Cnd4Nn8b.js.map → create_file.node-DzdShAEK.js.map} +1 -1
- package/dist/{edit_file.node-Be3medtb.js → edit_file.node-CGjz-CjQ.js} +3 -3
- package/dist/{edit_file.node-Be3medtb.js.map → edit_file.node-CGjz-CjQ.js.map} +1 -1
- package/dist/{executable-BbAHdBVY.js → executable-BgLDvAH0.js} +2 -2
- package/dist/{executable-BbAHdBVY.js.map → executable-BgLDvAH0.js.map} +1 -1
- package/dist/{files--1Q-a1ZV.js → files-wO0_dqdF.js} +2 -2
- package/dist/{files--1Q-a1ZV.js.map → files-wO0_dqdF.js.map} +1 -1
- package/dist/{glob.node-CA1MWD1b.js → glob.node-w_rvEIQN.js} +3 -3
- package/dist/{glob.node-CA1MWD1b.js.map → glob.node-w_rvEIQN.js.map} +1 -1
- package/dist/{list_directory.node-C_O--JLs.js → list_directory.node-CWGn90hA.js} +2 -2
- package/dist/{list_directory.node-C_O--JLs.js.map → list_directory.node-CWGn90hA.js.map} +1 -1
- package/dist/{load-profile-0CuSgiWr.js → load-profile-D-dFWVzT.js} +2 -2
- package/dist/{load-profile-0CuSgiWr.js.map → load-profile-D-dFWVzT.js.map} +1 -1
- package/dist/{main-NdzEy1DN.js → main-B-Pg2140.js} +14 -14
- package/dist/{main-NdzEy1DN.js.map → main-B-Pg2140.js.map} +1 -1
- package/dist/{node-B029Told.js → node-B0jbn8t2.js} +3 -3
- package/dist/{node-B029Told.js.map → node-B0jbn8t2.js.map} +1 -1
- package/dist/{node-BRttyTrh.js → node-BM8mGi3n.js} +3 -3
- package/dist/{node-BRttyTrh.js.map → node-BM8mGi3n.js.map} +1 -1
- package/dist/{node-Dc7OwtlA.js → node-BgA31Dpt.js} +3 -3
- package/dist/{node-Dc7OwtlA.js.map → node-BgA31Dpt.js.map} +1 -1
- package/dist/{node-aMyd1IN4.js → node-DKVVBako.js} +3 -3
- package/dist/{node-aMyd1IN4.js.map → node-DKVVBako.js.map} +1 -1
- package/dist/{node-CS0yja_J.js → node-Dr8IF45b.js} +2 -2
- package/dist/{node-CS0yja_J.js.map → node-Dr8IF45b.js.map} +1 -1
- package/dist/{node-DJQHHl-X.js → node-PqFeF2rU.js} +2 -2
- package/dist/{node-DJQHHl-X.js.map → node-PqFeF2rU.js.map} +1 -1
- package/dist/{read_file.node-BjBOaIme.js → read_file.node-IpcUo_BE.js} +2 -2
- package/dist/{read_file.node-BjBOaIme.js.map → read_file.node-IpcUo_BE.js.map} +1 -1
- package/dist/{stdio-Cb3rNj8D.js → stdio-CbHLN4-D.js} +3 -3
- package/dist/{stdio-Cb3rNj8D.js.map → stdio-CbHLN4-D.js.map} +1 -1
- package/dist/storybook.js +1 -1
- package/dist/{undo_edit.node-DB9rujSj.js → undo_edit.node-CKgcVuoz.js} +2 -2
- package/dist/{undo_edit.node-DB9rujSj.js.map → undo_edit.node-CKgcVuoz.js.map} +1 -1
- package/package.json +1 -1
- package/dist/color-CXy0Mt1O.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-BESHF9Kn.js";
|
3
|
+
import "./main-B-Pg2140.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-Brt5PSmQ.js";
|
9
9
|
//# sourceMappingURL=amp.js.map
|
@@ -1,5 +1,5 @@
|
|
1
1
|
#!/usr/bin/env node
|
2
|
-
import { f as i, b7 as n, r as a, s as p, p as c } from "./color-
|
2
|
+
import { f as i, b7 as n, r as a, s as p, p as c } from "./color-BESHF9Kn.js";
|
3
3
|
const u = a.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-Brt5PSmQ.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"client-
|
1
|
+
{"version":3,"file":"client-Brt5PSmQ.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;"}
|
@@ -6986,7 +6986,7 @@ Prefer this tool over \`edit_file\` when you want to ovewrite the entire content
|
|
6986
6986
|
},
|
6987
6987
|
source: "builtin"
|
6988
6988
|
},
|
6989
|
-
fn: import("./create_file.node-
|
6989
|
+
fn: import("./create_file.node-DzdShAEK.js").then(
|
6990
6990
|
({ nodeCreateFileTool: t }) => t
|
6991
6991
|
)
|
6992
6992
|
}, Xt = "Grep", xC = 15, LC = 250, PC = `Search for exact text patterns in files using ripgrep, a fast keyword search tool.
|
@@ -7119,7 +7119,7 @@ COMPLEMENTARY USE WITH CODEBASE_SEARCH:
|
|
7119
7119
|
},
|
7120
7120
|
source: "builtin"
|
7121
7121
|
},
|
7122
|
-
fn: import("./node-
|
7122
|
+
fn: import("./node-DKVVBako.js").then(({ nodeGrepTool: t }) => t)
|
7123
7123
|
}, hr = "read_file", FC = 1e3, yn = {
|
7124
7124
|
spec: {
|
7125
7125
|
name: hr,
|
@@ -7151,7 +7151,7 @@ Returns the contents of the file with each line prefixed by its line number. For
|
|
7151
7151
|
switch ("node") {
|
7152
7152
|
case "node":
|
7153
7153
|
case "vscode":
|
7154
|
-
return import("./read_file.node-
|
7154
|
+
return import("./read_file.node-IpcUo_BE.js").then(({ nodeReadFileTool: t }) => t);
|
7155
7155
|
}
|
7156
7156
|
})()
|
7157
7157
|
}, BC = lC({
|
@@ -7180,7 +7180,7 @@ If you need to replace the entire contents of a file, use \`${ni}\` instead, sin
|
|
7180
7180
|
inputSchema: RD(BC),
|
7181
7181
|
source: "builtin"
|
7182
7182
|
},
|
7183
|
-
fn: import("./edit_file.node-
|
7183
|
+
fn: import("./edit_file.node-CGjz-CjQ.js").then(({ nodeEditFileTool: t }) => t)
|
7184
7184
|
};
|
7185
7185
|
async function eJ(t, e, r, n) {
|
7186
7186
|
e = Zn(e);
|
@@ -8149,7 +8149,7 @@ Note: Results are sorted by modification time with the most recently modified fi
|
|
8149
8149
|
},
|
8150
8150
|
source: "builtin"
|
8151
8151
|
},
|
8152
|
-
fn: import("./glob.node-
|
8152
|
+
fn: import("./glob.node-w_rvEIQN.js").then(({ nodeGlobTool: t }) => t)
|
8153
8153
|
}, si = "list_directory", u_ = {
|
8154
8154
|
spec: {
|
8155
8155
|
name: si,
|
@@ -8170,7 +8170,7 @@ Note: Results are sorted by modification time with the most recently modified fi
|
|
8170
8170
|
switch ("node") {
|
8171
8171
|
case "node":
|
8172
8172
|
case "vscode":
|
8173
|
-
return import("./list_directory.node-
|
8173
|
+
return import("./list_directory.node-CWGn90hA.js").then(
|
8174
8174
|
({ nodeListDirectoryTool: t }) => t
|
8175
8175
|
);
|
8176
8176
|
}
|
@@ -8920,22 +8920,25 @@ const ar = "Bash", x0 = 5e4, gJ = "run_terminal_command", L0 = `Executes the giv
|
|
8920
8920
|
- If the command will create new directories or files, first use the list_directory tool to verify the parent directory exists and is the correct location
|
8921
8921
|
- For example, before running a mkdir command, first use list_directory to check the parent directory exists
|
8922
8922
|
|
8923
|
-
2. Working directory
|
8924
|
-
- Your working directory is at the root of the user's
|
8925
|
-
- Use the \`cwd\` parameter to specify
|
8926
|
-
- You
|
8923
|
+
2. Working directory:
|
8924
|
+
- Your working directory is at the root of the user's workspace unless you override it for a command by setting the \`cwd\` parameter.
|
8925
|
+
- Use the \`cwd\` parameter to specify an absolute or relative path to a directory where the command should be executed (e.g., \`cwd: "core/src"\`).
|
8926
|
+
- You may use \`cd PATH && COMMAND\` if the user explicitly requests it, otherwise prefer using the \`cwd\` parameter.
|
8927
8927
|
|
8928
|
-
3. Multiple independent commands
|
8928
|
+
3. Multiple independent commands:
|
8929
8929
|
- Do NOT chain multiple independent commands with \`;\`
|
8930
8930
|
- Instead, make multiple separate tool calls for each command you want to run
|
8931
8931
|
|
8932
|
-
4. Shell escapes
|
8932
|
+
4. Shell escapes:
|
8933
8933
|
- Escape any special characters in the command if those are not to be interpreted by the shell
|
8934
8934
|
|
8935
|
-
5. Truncated output
|
8935
|
+
5. Truncated output:
|
8936
8936
|
- Only the last ${x0} characters of the output will be returned to you along with how many lines got truncated, if any
|
8937
8937
|
- If necessary, when the output is truncated, consider running the command again with a grep or head filter to search through the truncated lines
|
8938
8938
|
|
8939
|
+
6. Stateless environment:
|
8940
|
+
- Setting an environment variable or using \`cd\` only impacts a single command, it does not persist between commands
|
8941
|
+
|
8939
8942
|
## Examples
|
8940
8943
|
|
8941
8944
|
- To run 'go test ./...': use { cmd: 'go test ./...' }
|
@@ -8991,7 +8994,7 @@ It's VERY IMPORTANT to use specific tools when searching for files, instead of i
|
|
8991
8994
|
},
|
8992
8995
|
source: "builtin"
|
8993
8996
|
},
|
8994
|
-
fn: import("./node-
|
8997
|
+
fn: import("./node-BgA31Dpt.js").then(({ nodeBashTool: t }) => t)
|
8995
8998
|
}, P0 = [
|
8996
8999
|
"ls",
|
8997
9000
|
"dir",
|
@@ -9322,7 +9325,7 @@ This tool converts web content to markdown format for better readability.`,
|
|
9322
9325
|
requiresNetwork: !0
|
9323
9326
|
}
|
9324
9327
|
},
|
9325
|
-
fn: import("./node-
|
9328
|
+
fn: import("./node-Dr8IF45b.js").then(({ nodeReadWebPageTool: t }) => t)
|
9326
9329
|
}, oh = "think", Y0 = (t, e) => An(async () => ({ status: "done", result: "Thoughts have been logged." })), q0 = {
|
9327
9330
|
spec: {
|
9328
9331
|
name: oh,
|
@@ -9387,7 +9390,7 @@ the \`${Bu}\` with the url.
|
|
9387
9390
|
requiresNetwork: !0
|
9388
9391
|
}
|
9389
9392
|
},
|
9390
|
-
fn: import("./node-
|
9393
|
+
fn: import("./node-BM8mGi3n.js").then(({ nodeWebSearchTool: t }) => t)
|
9391
9394
|
}, Sn = "Task", Uu = [
|
9392
9395
|
u_,
|
9393
9396
|
sa,
|
@@ -10102,7 +10105,7 @@ Returns a git-style diff showing the changes that were undone as formatted markd
|
|
10102
10105
|
},
|
10103
10106
|
source: "builtin"
|
10104
10107
|
},
|
10105
|
-
fn: import("./undo_edit.node-
|
10108
|
+
fn: import("./undo_edit.node-CKgcVuoz.js").then(({ nodeUndoEditTool: t }) => t)
|
10106
10109
|
};
|
10107
10110
|
function CJ(t, e, r) {
|
10108
10111
|
const n = [], a = [];
|
@@ -54342,4 +54345,4 @@ export {
|
|
54342
54345
|
MZ as y,
|
54343
54346
|
$Z as z
|
54344
54347
|
};
|
54345
|
-
//# sourceMappingURL=color-
|
54348
|
+
//# sourceMappingURL=color-BESHF9Kn.js.map
|