@sourcegraph/amp 0.0.1749096401-g3a8a18 → 0.0.1749109595-g4e65be
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-CT0UspN7.js → client-Co7dVied.js} +2 -2
- package/dist/{client-CT0UspN7.js.map → client-Co7dVied.js.map} +1 -1
- package/dist/{console-CZXURH0C.js → console-9ChYTAuP.js} +20 -14
- package/dist/console-9ChYTAuP.js.map +1 -0
- package/dist/create_file.node-hHqtsH6T.js +22 -0
- package/dist/create_file.node-hHqtsH6T.js.map +1 -0
- package/dist/{edit_file.node-BqRltvHA.js → edit_file.node-C_QnSUCA.js} +3 -3
- package/dist/{edit_file.node-BqRltvHA.js.map → edit_file.node-C_QnSUCA.js.map} +1 -1
- package/dist/{executable-Dy1dmJR0.js → executable-Cos2zJOT.js} +2 -2
- package/dist/{executable-Dy1dmJR0.js.map → executable-Cos2zJOT.js.map} +1 -1
- package/dist/{files-yat9N0vH.js → files-DuJQGx_l.js} +2 -2
- package/dist/{files-yat9N0vH.js.map → files-DuJQGx_l.js.map} +1 -1
- package/dist/{glob.node-h1Swo4vr.js → glob.node-Ca3WEmvJ.js} +4 -4
- package/dist/{glob.node-h1Swo4vr.js.map → glob.node-Ca3WEmvJ.js.map} +1 -1
- package/dist/{index-D5lm6ANC.js → index-qB8r0Uhu.js} +2 -2
- package/dist/{index-D5lm6ANC.js.map → index-qB8r0Uhu.js.map} +1 -1
- package/dist/{list_directory.node-CEUOBF5h.js → list_directory.node-B2wxSFMa.js} +2 -2
- package/dist/{list_directory.node-CEUOBF5h.js.map → list_directory.node-B2wxSFMa.js.map} +1 -1
- package/dist/{load-profile-Dk7ZUf3s.js → load-profile-DpyLbaYS.js} +2 -2
- package/dist/{load-profile-Dk7ZUf3s.js.map → load-profile-DpyLbaYS.js.map} +1 -1
- package/dist/{main-CS_jpDsP.js → main-B4ln85Rg.js} +21 -16
- package/dist/main-B4ln85Rg.js.map +1 -0
- package/dist/{node-BtKYcfrH.js → node-BBnb2R8E.js} +3 -3
- package/dist/{node-BtKYcfrH.js.map → node-BBnb2R8E.js.map} +1 -1
- package/dist/{node-DVHX-oeS.js → node-BUT6Nvpy.js} +2 -2
- package/dist/{node-DVHX-oeS.js.map → node-BUT6Nvpy.js.map} +1 -1
- package/dist/{node-CRrSwIMO.js → node-BYuqVOkK.js} +4 -4
- package/dist/{node-CRrSwIMO.js.map → node-BYuqVOkK.js.map} +1 -1
- package/dist/{node-dAg24OS_.js → node-D6m-7fmx.js} +3 -3
- package/dist/{node-dAg24OS_.js.map → node-D6m-7fmx.js.map} +1 -1
- package/dist/{node-BJyrP3Sj.js → node-Dm9KQUgx.js} +2 -2
- package/dist/{node-BJyrP3Sj.js.map → node-Dm9KQUgx.js.map} +1 -1
- package/dist/{node-COZM4qQd.js → node-DzhEX6Qs.js} +1077 -1063
- package/dist/node-DzhEX6Qs.js.map +1 -0
- package/dist/{read_file.node-DbAEjkEn.js → read_file.node-QXBL6A9B.js} +2 -2
- package/dist/{read_file.node-DbAEjkEn.js.map → read_file.node-QXBL6A9B.js.map} +1 -1
- package/dist/{stdio-BxgTnYre.js → stdio-mZBGUxws.js} +3 -3
- package/dist/{stdio-BxgTnYre.js.map → stdio-mZBGUxws.js.map} +1 -1
- package/dist/storybook.js +1 -1
- package/dist/{undo_edit.node-DL1deBcE.js → undo_edit.node-CBJHZjZk.js} +2 -2
- package/dist/{undo_edit.node-DL1deBcE.js.map → undo_edit.node-CBJHZjZk.js.map} +1 -1
- package/package.json +1 -1
- package/dist/console-CZXURH0C.js.map +0 -1
- package/dist/create_file.node-Bg2Ha2Q0.js +0 -24
- package/dist/create_file.node-Bg2Ha2Q0.js.map +0 -1
- package/dist/main-CS_jpDsP.js.map +0 -1
- package/dist/node-COZM4qQd.js.map +0 -1
@@ -1,24 +0,0 @@
|
|
1
|
-
#!/usr/bin/env node
|
2
|
-
import d from "node:path";
|
3
|
-
import { p as f, aA as l, aB as u } from "./console-CZXURH0C.js";
|
4
|
-
const w = ({ args: t }, { dir: a, dirs: i, trackFileChange: c, filesystem: r }) => f(async (e) => {
|
5
|
-
if (l(a), typeof t.content != "string")
|
6
|
-
throw new Error("create_file: content must be specified");
|
7
|
-
e.throwIfAborted();
|
8
|
-
const n = await u(r, i, t.path, e), p = d.dirname(n);
|
9
|
-
await r.mkdirp(p, e);
|
10
|
-
let o = t.content;
|
11
|
-
return o.endsWith(`
|
12
|
-
`) || (o += `
|
13
|
-
`), await c(n, async (s) => {
|
14
|
-
await r.writeFile(s, o, e);
|
15
|
-
}), {
|
16
|
-
status: "done",
|
17
|
-
result: `Successfully created file ${t.path}`,
|
18
|
-
files: [t.path]
|
19
|
-
};
|
20
|
-
});
|
21
|
-
export {
|
22
|
-
w as nodeCreateFileTool
|
23
|
-
};
|
24
|
-
//# sourceMappingURL=create_file.node-Bg2Ha2Q0.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"create_file.node-Bg2Ha2Q0.js","sources":["../../core/src/tools/builtin/filesystem/create_file.node.ts"],"sourcesContent":["import { promiseFactoryToObservable } from '@sourcegraph/observable'\nimport path from 'path'\nimport { checkDirURIIsFile } from '../node-helpers'\nimport type { createFileToolReg } from './create_file.common'\nimport { resolveArgumentPath } from './read_file.util'\n\nexport const nodeCreateFileTool: NonNullable<typeof createFileToolReg.fn> = (\n\t{ args },\n\t{ dir, dirs, trackFileChange, filesystem },\n) => {\n\treturn promiseFactoryToObservable(async (signal) => {\n\t\tcheckDirURIIsFile(dir)\n\t\tif (typeof args.content !== 'string') {\n\t\t\tthrow new Error('create_file: content must be specified')\n\t\t}\n\n\t\tsignal.throwIfAborted()\n\n\t\tconst fullPath = await resolveArgumentPath(filesystem, dirs, args.path, signal)\n\t\tconst dirname = path.dirname(fullPath)\n\t\tawait filesystem.mkdirp(dirname, signal)\n\n\t\tlet content = args.content\n\t\t// HACK: the Anthropic tool calling API appears to trim whitespace from around all tool args.\n\t\t// When we create files, we _almost always_ want to create them with a trailing newline.\n\t\t// More info here: https://sourcegraph.slack.com/archives/C04D0GRD1GB/p1747064252012509\n\t\tif (!content.endsWith('\\n')) {\n\t\t\tcontent += '\\n'\n\t\t}\n\t\tawait trackFileChange(fullPath, async (path) => {\n\t\t\tawait filesystem.writeFile(path, content, signal)\n\t\t})\n\t\treturn {\n\t\t\tstatus: 'done',\n\t\t\tresult: `Successfully created file ${args.path}`,\n\t\t\tfiles: [args.path],\n\t\t}\n\t})\n}\n"],"names":["nodeCreateFileTool","args","dir","dirs","trackFileChange","filesystem","promiseFactoryToObservable","signal","checkDirURIIsFile","fullPath","resolveArgumentPath","dirname","path","content"],"mappings":";;;AAMa,MAAAA,IAA+D,CAC3E,EAAE,MAAAC,KACF,EAAE,KAAAC,GAAK,MAAAC,GAAM,iBAAAC,GAAiB,YAAAC,QAEvBC,EAA2B,OAAOC,MAAW;AAE/C,MADJC,EAAkBN,CAAG,GACjB,OAAOD,EAAK,WAAY;AACrB,UAAA,IAAI,MAAM,wCAAwC;AAGzD,EAAAM,EAAO,eAAe;AAEtB,QAAME,IAAW,MAAMC,EAAoBL,GAAYF,GAAMF,EAAK,MAAMM,CAAM,GACxEI,IAAUC,EAAK,QAAQH,CAAQ;AAC/B,QAAAJ,EAAW,OAAOM,GAASJ,CAAM;AAEvC,MAAIM,IAAUZ,EAAK;AAInB,SAAKY,EAAQ,SAAS;AAAA,CAAI,MACdA,KAAA;AAAA,IAEN,MAAAT,EAAgBK,GAAU,OAAOG,MAAS;AAC/C,UAAMP,EAAW,UAAUO,GAAMC,GAASN,CAAM;AAAA,EAAA,CAChD,GACM;AAAA,IACN,QAAQ;AAAA,IACR,QAAQ,6BAA6BN,EAAK,IAAI;AAAA,IAC9C,OAAO,CAACA,EAAK,IAAI;AAAA,EAClB;AAAA,CACA;"}
|