@kelceyp/caw-server 1.0.146 → 1.0.151
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/cli.js +11 -3
- package/dist/main.js +394 -391
- package/dist/public_html/main.js +579 -579
- package/dist/public_html/styles.css +1 -1
- package/package.json +2 -2
package/dist/cli.js
CHANGED
|
@@ -8936,15 +8936,23 @@ var discard_default = Object.freeze({ create: create13 });
|
|
|
8936
8936
|
|
|
8937
8937
|
// src/commands/doc/delete.js
|
|
8938
8938
|
var create14 = ({ httpClient }) => {
|
|
8939
|
-
return createCommand("delete").summary("Delete a document").param((p) => p.name("sid").type("string").flag("sid", "s").required()).param((p) => p.name("id").type("string").flag("id").required()).run(async (ctx) => {
|
|
8940
|
-
const { sid, id } = ctx.params;
|
|
8939
|
+
return createCommand("delete").summary("Delete a document").param((p) => p.name("sid").type("string").flag("sid", "s").required()).param((p) => p.name("id").type("string").flag("id").required()).param((p) => p.name("ack").type("string").flag("ack")).run(async (ctx) => {
|
|
8940
|
+
const { sid, id, ack } = ctx.params;
|
|
8941
8941
|
const result = await httpClient.post(`/cli/mcp-client/${sid}/dispatch`, {
|
|
8942
8942
|
cwd: process.cwd(),
|
|
8943
8943
|
tool: "delete_document",
|
|
8944
|
-
args: { id }
|
|
8944
|
+
args: { id, ack }
|
|
8945
8945
|
});
|
|
8946
8946
|
ctx.stdio.stdout.write(JSON.stringify(result, null, 2) + `
|
|
8947
8947
|
`);
|
|
8948
|
+
if (result.isError === true && result.content?.[0]?.text) {
|
|
8949
|
+
const match = result.content[0].text.match(/ack: "([a-f0-9]+)"/);
|
|
8950
|
+
if (match) {
|
|
8951
|
+
const hash = match[1];
|
|
8952
|
+
ctx.stdio.stderr.write(`Hint: re-run with --ack to confirm deletion: caw doc delete --sid ${sid} --id ${id} --ack "${hash}"
|
|
8953
|
+
`);
|
|
8954
|
+
}
|
|
8955
|
+
}
|
|
8948
8956
|
}).onError({ exitCode: 1 }).build();
|
|
8949
8957
|
};
|
|
8950
8958
|
var delete_default = Object.freeze({ create: create14 });
|