codiedev 0.5.2 → 0.5.3

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 CHANGED
@@ -17,6 +17,7 @@
17
17
  Object.defineProperty(exports, "__esModule", { value: true });
18
18
  const connect_1 = require("./connect");
19
19
  const push_1 = require("./commands/push");
20
+ const delete_1 = require("./commands/delete");
20
21
  const pull_1 = require("./commands/pull");
21
22
  const ping_1 = require("./commands/ping");
22
23
  const inbox_1 = require("./commands/inbox");
@@ -39,6 +40,9 @@ Artifacts:
39
40
  codiedev push <file.md> Author or update an artifact
40
41
  codiedev pull <key> [--version N] [--out path]
41
42
  Fetch an artifact (stdout by default)
43
+ codiedev delete <key> [-y] Delete every version of an artifact you
44
+ authored (clean up bad/test pushes).
45
+ Asks for confirmation; -y to skip.
42
46
  codiedev promote <artifact-id> Promote an auto-extracted artifact
43
47
  to an authored one
44
48
  codiedev reverse-ticket [<pr-url>] Generate a Jira ticket draft.
@@ -363,6 +367,10 @@ async function main() {
363
367
  case "push":
364
368
  await (0, push_1.runPush)(rest);
365
369
  return;
370
+ case "delete":
371
+ case "rm":
372
+ await (0, delete_1.runDelete)(rest);
373
+ return;
366
374
  case "pull":
367
375
  await (0, pull_1.runPull)(rest);
368
376
  return;
@@ -0,0 +1 @@
1
+ export declare function runDelete(args: string[]): Promise<void>;
@@ -0,0 +1,96 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.runDelete = runDelete;
37
+ const readline = __importStar(require("readline"));
38
+ const shared_1 = require("./shared");
39
+ function parseArgs(args) {
40
+ let key;
41
+ let yes = false;
42
+ for (const a of args) {
43
+ if (a === "-y" || a === "--yes") {
44
+ yes = true;
45
+ }
46
+ else if (!a.startsWith("--") && !key) {
47
+ key = a;
48
+ }
49
+ }
50
+ if (!key) {
51
+ console.error("Usage: codiedev delete <key> [-y]");
52
+ console.error("Example: codiedev delete spec-old.md");
53
+ process.exit(1);
54
+ }
55
+ return { key, yes };
56
+ }
57
+ async function confirm(prompt) {
58
+ const rl = readline.createInterface({
59
+ input: process.stdin,
60
+ output: process.stdout,
61
+ });
62
+ const answer = await new Promise((resolve) => {
63
+ rl.question(prompt, (ans) => resolve(ans));
64
+ });
65
+ rl.close();
66
+ return /^y(es)?$/i.test(answer.trim());
67
+ }
68
+ async function runDelete(args) {
69
+ const { key, yes } = parseArgs(args);
70
+ const config = (0, shared_1.requireConfig)();
71
+ if (!yes) {
72
+ const ok = await confirm(`Delete every version of '${key}' (and its replies)? This cannot be undone. [y/N] `);
73
+ if (!ok) {
74
+ console.log("Cancelled.");
75
+ return;
76
+ }
77
+ }
78
+ try {
79
+ const res = await (0, shared_1.apiRequest)("POST", "/api/cli/delete", {
80
+ config,
81
+ body: { key },
82
+ });
83
+ if (res.deleted === 0) {
84
+ console.log(`No artifact found with key '${key}'. Nothing to delete.`);
85
+ return;
86
+ }
87
+ const cascaded = res.cascadedMessages > 0
88
+ ? ` + ${res.cascadedMessages} reply${res.cascadedMessages === 1 ? "" : "ies"}`
89
+ : "";
90
+ console.log(`✓ Deleted ${res.deleted} version${res.deleted === 1 ? "" : "s"}${cascaded} of '${res.key}'.`);
91
+ }
92
+ catch (err) {
93
+ console.error(`Delete failed: ${err.message}`);
94
+ process.exit(1);
95
+ }
96
+ }
package/dist/mcp.js CHANGED
@@ -137,6 +137,26 @@ const TOOLS = [
137
137
  required: ["key"],
138
138
  },
139
139
  },
140
+ {
141
+ name: "codiedev_delete",
142
+ description: "Delete every version of an artifact (and its replies) by key. Use " +
143
+ "when the user asks to delete, remove, undo, throw away, or clean up " +
144
+ "an artifact (e.g., 'delete that test push', 'remove the duplicate', " +
145
+ "'rm spec-old'). Authorship is enforced server-side: you can only " +
146
+ "delete artifacts you authored. Always confirm with the user before " +
147
+ "calling — deletions cannot be undone.",
148
+ inputSchema: {
149
+ type: "object",
150
+ properties: {
151
+ key: {
152
+ type: "string",
153
+ description: "Filename key of the artifact to delete, e.g. 'spec-214.md'. " +
154
+ "Every version of this key is removed.",
155
+ },
156
+ },
157
+ required: ["key"],
158
+ },
159
+ },
140
160
  {
141
161
  name: "codiedev_ping",
142
162
  description: "Send a message to a teammate on CodieDev, optionally attached to a " +
@@ -514,6 +534,8 @@ async function dispatchTool(name, args, config) {
514
534
  return await handlePush(args, config);
515
535
  case "codiedev_pull":
516
536
  return await handlePull(args, config);
537
+ case "codiedev_delete":
538
+ return await handleDelete(args, config);
517
539
  case "codiedev_ping":
518
540
  return await handlePing(args, config);
519
541
  case "codiedev_inbox":
@@ -587,6 +609,33 @@ async function handlePull(args, config) {
587
609
  content: [{ type: "text", text: header + a.markdown }],
588
610
  };
589
611
  }
612
+ async function handleDelete(args, config) {
613
+ const key = asString(args.key);
614
+ if (!key)
615
+ throw new Error("key required");
616
+ const res = await (0, shared_1.apiRequest)("POST", "/api/cli/delete", { config, body: { key } });
617
+ if (res.deleted === 0) {
618
+ return {
619
+ content: [
620
+ {
621
+ type: "text",
622
+ text: `No artifact found with key '${key}'. Nothing to delete.`,
623
+ },
624
+ ],
625
+ };
626
+ }
627
+ const cascaded = res.cascadedMessages > 0
628
+ ? ` + ${res.cascadedMessages} reply${res.cascadedMessages === 1 ? "" : "ies"}`
629
+ : "";
630
+ return {
631
+ content: [
632
+ {
633
+ type: "text",
634
+ text: `✓ Deleted ${res.deleted} version${res.deleted === 1 ? "" : "s"}${cascaded} of '${res.key}'.`,
635
+ },
636
+ ],
637
+ };
638
+ }
590
639
  async function handlePing(args, config) {
591
640
  const to = asString(args.to);
592
641
  const body = asString(args.body);
package/dist/utils.js CHANGED
@@ -208,6 +208,7 @@ thought, use the \`codiedev\` CLI via Bash:**
208
208
  |---|---|
209
209
  | "push this spec" / "save this as a skill" | \`codiedev push <file.md>\` |
210
210
  | "pull X" / "grab the latest spec-X" / "what did Maya push?" | \`codiedev pull <key>\` |
211
+ | "delete X" / "remove that test push" / "rm spec-old" | \`codiedev delete <key>\` (always confirm with the user first) |
211
212
  | "ping Nic about this" / "ask Maya for her take" | \`codiedev ping <name> "<msg>" [--with <key>]\` |
212
213
  | "any messages?" / "check my inbox" / "what did Nic say?" | \`codiedev inbox\` |
213
214
  | "read Nic's reply" / "mark that ping read" | \`codiedev read <ping-id>\` |
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "codiedev",
3
- "version": "0.5.2",
3
+ "version": "0.5.3",
4
4
  "description": "Connect Claude Code or Codex to CodieDev for org-wide session capture and artifact collaboration",
5
5
  "bin": {
6
6
  "codiedev": "./dist/cli.js",