codiedev 0.7.10 → 0.8.0

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/mcp.js CHANGED
@@ -173,8 +173,8 @@ const TOOLS = [
173
173
  name: "codiedev_ping",
174
174
  description: "Send a message to a teammate on CodieDev, optionally attached to a " +
175
175
  "specific artifact. Use when the user asks to ping, ask, share with, " +
176
- "or get feedback from a teammate by name (e.g. 'ping Maya about this " +
177
- "spec'). Recipients are resolved by first name, full name, or email " +
176
+ "or get feedback from a teammate by name (e.g. 'ping a teammate about " +
177
+ "this spec'). Recipients are resolved by first name, full name, or email " +
178
178
  "within the current org. They're notified by email and can reply " +
179
179
  "from their own agent.",
180
180
  inputSchema: {
@@ -325,8 +325,8 @@ const TOOLS = [
325
325
  name: "codiedev_share_with",
326
326
  description: "Grant a teammate persistent read (or edit) access to an artifact " +
327
327
  "without sending a notification. Use when the user says 'share this " +
328
- "with Greg' or 'give Jason access', and doesn't want to surface it " +
329
- "as a message. If they want the teammate actively notified, use " +
328
+ "with a teammate' or 'give someone access', and doesn't want to surface " +
329
+ "it as a message. If they want the teammate actively notified, use " +
330
330
  "codiedev_send_to instead.",
331
331
  inputSchema: {
332
332
  type: "object",
@@ -349,8 +349,8 @@ const TOOLS = [
349
349
  {
350
350
  name: "codiedev_send_to",
351
351
  description: "Grant access to an artifact AND send a short message to a " +
352
- "teammate. Use when the user asks to 'send this to Greg', 'ask " +
353
- "Greg to look at this', or 'share this with Jason and tell him X'. " +
352
+ "teammate. Use when the user asks to 'send this to a teammate', 'ask " +
353
+ "someone to look at this', or 'share this with a teammate and tell them X'. " +
354
354
  "This is the active handoff version of codiedev_share_with — the " +
355
355
  "recipient gets a ping in their inbox.",
356
356
  inputSchema: {
@@ -439,7 +439,7 @@ const TOOLS = [
439
439
  "files surfaced as slash commands). Each row reports its `kind` " +
440
440
  "(doc | skill) and `tags`. Use when the user asks 'show me my " +
441
441
  "artifacts', 'what skills do we have?', 'what did I push?', 'what " +
442
- "has Greg shared with me?', or 'browse the library'. Filter by " +
442
+ "has a teammate shared with me?', or 'browse the library'. Filter by " +
443
443
  "`kind` to narrow to docs-only or skills-only.",
444
444
  inputSchema: {
445
445
  type: "object",
package/dist/utils.d.ts CHANGED
@@ -61,6 +61,28 @@ export declare function installCursorMcp(): void;
61
61
  * 100% diff-driven (no transcript dependency).
62
62
  */
63
63
  export declare function installVSCodeMcp(): void;
64
+ /**
65
+ * Removes `mcpServers.codiedev` from `~/.claude.json` if present. Leaves
66
+ * other MCP servers and unrelated top-level settings untouched.
67
+ */
68
+ export declare function cleanupClaudeCodeMcp(): void;
69
+ /**
70
+ * Removes `mcpServers.codiedev` from `~/.cursor/mcp.json` if present.
71
+ */
72
+ export declare function cleanupCursorMcp(): void;
73
+ /**
74
+ * Removes `servers.codiedev` from VS Code's user-scope mcp.json. VS Code
75
+ * uses a different schema (`servers` not `mcpServers`), so this is a
76
+ * separate helper.
77
+ */
78
+ export declare function cleanupVSCodeMcp(): void;
79
+ /**
80
+ * Removes the `# codiedev-mcp` block from `~/.codex/config.toml`. The
81
+ * install side appends a well-marked block; we strip it the same way —
82
+ * the marker line through the end of its TOML section. Whitespace-only
83
+ * gaps between sections are preserved.
84
+ */
85
+ export declare function cleanupCodexMcp(): void;
64
86
  /**
65
87
  * Best-effort append of the CodieDev MCP server block to ~/.codex/config.toml.
66
88
  *
package/dist/utils.js CHANGED
@@ -50,6 +50,10 @@ exports.installCursorInstructions = installCursorInstructions;
50
50
  exports.installClaudeCodeMcp = installClaudeCodeMcp;
51
51
  exports.installCursorMcp = installCursorMcp;
52
52
  exports.installVSCodeMcp = installVSCodeMcp;
53
+ exports.cleanupClaudeCodeMcp = cleanupClaudeCodeMcp;
54
+ exports.cleanupCursorMcp = cleanupCursorMcp;
55
+ exports.cleanupVSCodeMcp = cleanupVSCodeMcp;
56
+ exports.cleanupCodexMcp = cleanupCodexMcp;
53
57
  exports.installCodexMcp = installCodexMcp;
54
58
  exports.installCodexHook = installCodexHook;
55
59
  exports.installCursorHook = installCursorHook;
@@ -186,11 +190,8 @@ function resolveHookCommand(subcommand) {
186
190
  }
187
191
  return `npx codiedev-hook ${subcommand}`;
188
192
  }
189
- function isCodiedevHookCommand(cmd) {
190
- if (!cmd)
191
- return false;
192
- return cmd.includes("codiedev-hook") || /codiedev[\\/]dist[\\/]hook/.test(cmd);
193
- }
193
+ // `isCodiedevHookCommand` is defined in `./detection` so it's testable
194
+ // without mocking fs/path. Re-imported below; do not re-define here.
194
195
  function claudeBinOnPath() {
195
196
  try {
196
197
  (0, child_process_1.execSync)("command -v claude", { stdio: ["pipe", "pipe", "pipe"] });
@@ -254,9 +255,9 @@ function installHook() {
254
255
  const filtered = existing.filter((hook) => {
255
256
  const inner = hook.hooks;
256
257
  if (Array.isArray(inner)) {
257
- return !inner.some((h) => isCodiedevHookCommand(h.command));
258
+ return !inner.some((h) => (0, detection_1.isCodiedevHookCommand)(h.command));
258
259
  }
259
- return !isCodiedevHookCommand(hook.matcher);
260
+ return !(0, detection_1.isCodiedevHookCommand)(hook.matcher);
260
261
  });
261
262
  filtered.push({
262
263
  matcher: ".*",
@@ -294,20 +295,21 @@ thought, use the \`codiedev\` CLI via Bash:**
294
295
  | Intent | Command |
295
296
  |---|---|
296
297
  | "push this spec" / "save this as a skill" | \`codiedev push <file.md>\` |
297
- | "pull X" / "grab the latest spec-X" / "what did Maya push?" | \`codiedev pull <key>\` |
298
+ | "pull X" / "grab the latest spec-X" / "what did a teammate push?" | \`codiedev pull <key>\` |
298
299
  | "delete X" / "remove that test push" / "rm spec-old" | \`codiedev delete <key>\` (always confirm with the user first) |
299
- | "ping Nic about this" / "ask Maya for her take" | \`codiedev ping <name> "<msg>" [--with <key>]\` |
300
- | "any messages?" / "check my inbox" / "what did Nic say?" | \`codiedev inbox\` |
301
- | "read Nic's reply" / "mark that ping read" | \`codiedev read <ping-id>\` |
300
+ | "ping a teammate about this" / "ask someone for their take" | \`codiedev ping <name> "<msg>" [--with <key>]\` |
301
+ | "any messages?" / "check my inbox" / "what did a teammate say?" | \`codiedev inbox\` |
302
+ | "read that reply" / "mark that ping read" | \`codiedev read <ping-id>\` |
302
303
  | "note that X is a follow-up" / "remember X" | \`codiedev note "<text>"\` |
303
304
  | "promote the extracted spec" | \`codiedev promote <artifact-id>\` |
304
- | "post this to the team" / "publish to the feed" / "share with the team" | MCP tool \`codiedev_post_to_feed\` |
305
- | "share with Greg" / "give Jason access" (no notification) | MCP tool \`codiedev_share_with\` |
306
- | "send this to Greg" / "ask Greg to look at this" | MCP tool \`codiedev_send_to\` |
307
- | "find something about X" / "has anyone solved Y?" | MCP tool \`codiedev_search\` |
308
- | "why did we…?" / "what does the team know about X?" | MCP tool \`codiedev_ask\` (synthesized answer + citations) |
309
- | "show my library" / "what artifacts exist?" | MCP tool \`codiedev_get_library\` |
310
- | "react 🛠 to that post" / "mark as used" | MCP tool \`codiedev_react\` |
305
+ | "create a ticket" / "scope this into tickets" / "ticket this for me" | \`codiedev create-ticket [optional-inline-prompt]\` |
306
+ | "post this to the team" / "publish to the feed" / "share with the team" | \`codiedev post --title "<t>" --body "<b>" [--intent <intent>] [--filename <key>] [--mention <name>]\` |
307
+ | "share with a teammate" / "give someone access" (no notification) | \`codiedev share <key> <name> [--role read\\|edit]\` |
308
+ | "send this to a teammate" / "ask someone to look at this" | \`codiedev send <key> <name> ["<msg>"]\` |
309
+ | "find something about X" / "has anyone solved Y?" | \`codiedev search "<query>" [--limit N]\` |
310
+ | "why did we…?" / "what does the team know about X?" | \`codiedev ask "<question>"\` (synthesized answer + citations) |
311
+ | "show my library" / "what artifacts exist?" | \`codiedev library [--scope mine\\|shared\\|all] [--kind doc\\|skill]\` |
312
+ | "react 🛠 to that post" / "mark as used" | \`codiedev react <postId> <emoji>\` |
311
313
 
312
314
  **Just push the file — we'll figure out where it goes.** Every artifact
313
315
  is classified into one of two kinds at upload time:
@@ -332,16 +334,17 @@ read it back to the user so they can confirm.
332
334
  - If content was drafted inline in the conversation, write it to a file
333
335
  first (e.g., \`/tmp/spec-xxx.md\`) then push.
334
336
 
335
- **Teammate names:** first name usually works (\`codiedev ping nic ...\`).
337
+ **Teammate names:** first name usually works (\`codiedev ping <name> ...\`).
336
338
  If ambiguous, the CLI returns candidates — retry with the full email.
337
339
 
338
- **Feed posts (broad team reach):** use \`codiedev_post_to_feed\` when the
339
- user wants visibility beyond one teammate — e.g., announcing a new skill,
340
- asking the team who knows about X, proposing a change. Always pass an
341
- \`intent\` that matches the request: \`share\` (here's a skill),
340
+ **Feed posts (broad team reach):** use \`codiedev post\` when the user
341
+ wants visibility beyond one teammate — e.g., announcing a new skill,
342
+ asking the team who knows about X, proposing a change. Always pass
343
+ \`--intent\` to match the request: \`share\` (here's a skill),
342
344
  \`request_review\`, \`request_expertise\` (stuck, who knows this),
343
- \`link_share\` (fyi), or \`rfc\` (proposing a change). Attach a \`filename\`
344
- to link a specific artifact and \`mentions\` to tag teammates.
345
+ \`link_share\` (fyi), or \`rfc\` (proposing a change). Pass \`--filename\`
346
+ to link a specific artifact and \`--mention <name>\` (repeatable) to
347
+ tag teammates.
345
348
 
346
349
  **Default feed-post shape.** When the user explicitly says "push/share/post
347
350
  to the feed", default to this shape unless they ask for something else:
@@ -359,14 +362,19 @@ to the feed", default to this shape unless they ask for something else:
359
362
  This is the default. If the user wants a one-liner or a different
360
363
  structure, follow their lead.
361
364
 
362
- **Search before pushing.** For any "save this as …" request, call
363
- \`codiedev_search\` first with a relevant query. If prior art exists, pull
364
- it and iterate rather than duplicating.
365
+ **Search before pushing.** For any "save this as …" request, run
366
+ \`codiedev search "<query>"\` first. If prior art exists, pull it and
367
+ iterate rather than duplicating.
365
368
 
366
- **Sharing vs sending:** \`codiedev_share_with\` is silent (access only, no
367
- notification). \`codiedev_send_to\` both grants access AND pings the
369
+ **Sharing vs sending:** \`codiedev share\` is silent (access only, no
370
+ notification). \`codiedev send\` both grants access AND pings the
368
371
  recipient. Use send when the user is actively looping someone in.
369
372
 
373
+ **\`create-ticket\` flow:** when invoked without \`--submit\`, the CLI prints
374
+ skill instructions you should follow. Step 1 is asking the user about repos.
375
+ Step 4 calls \`codiedev create-ticket --submit <path>\` with the plan JSON.
376
+ Tell the user the portal URL when the submit returns.
377
+
370
378
  **Errors:**
371
379
  - "not connected" → user needs to run \`npx codiedev connect\` with their
372
380
  API token from https://codiedev.com/portal/integrations/claude-code
@@ -538,6 +546,94 @@ function installVSCodeMcp() {
538
546
  config.servers = servers;
539
547
  fs.writeFileSync(VSCODE_USER_MCP_PATH, JSON.stringify(config, null, 2), "utf8");
540
548
  }
549
+ // ─────────────────────────────────────────────────────────────────────────────
550
+ // Migration cleanup — strips MCP server entries written by pre-CLI-only
551
+ // versions of `codiedev connect`. Those entries pointed at `npx codiedev-mcp`,
552
+ // a binary that was removed from package.json in 0.3.4. Without these
553
+ // cleanups, customers who upgrade to 0.7.11+ keep seeing "MCP server failed
554
+ // to start" errors in their agent UIs even though the CLI works fine.
555
+ // All cleanup helpers are idempotent and safe to run when no entry exists.
556
+ // ─────────────────────────────────────────────────────────────────────────────
557
+ function removeJsonKey(filePath, parentKey) {
558
+ if (!fs.existsSync(filePath))
559
+ return;
560
+ let parsed;
561
+ try {
562
+ parsed = JSON.parse(fs.readFileSync(filePath, "utf8"));
563
+ }
564
+ catch {
565
+ return; // Don't damage a file we can't parse.
566
+ }
567
+ const parent = parsed[parentKey];
568
+ if (!parent || typeof parent !== "object")
569
+ return;
570
+ if (!("codiedev" in parent))
571
+ return;
572
+ delete parent.codiedev;
573
+ fs.writeFileSync(filePath, JSON.stringify(parsed, null, 2), "utf8");
574
+ }
575
+ /**
576
+ * Removes `mcpServers.codiedev` from `~/.claude.json` if present. Leaves
577
+ * other MCP servers and unrelated top-level settings untouched.
578
+ */
579
+ function cleanupClaudeCodeMcp() {
580
+ removeJsonKey(CLAUDE_USER_CONFIG_PATH, "mcpServers");
581
+ }
582
+ /**
583
+ * Removes `mcpServers.codiedev` from `~/.cursor/mcp.json` if present.
584
+ */
585
+ function cleanupCursorMcp() {
586
+ removeJsonKey(CURSOR_MCP_PATH, "mcpServers");
587
+ }
588
+ /**
589
+ * Removes `servers.codiedev` from VS Code's user-scope mcp.json. VS Code
590
+ * uses a different schema (`servers` not `mcpServers`), so this is a
591
+ * separate helper.
592
+ */
593
+ function cleanupVSCodeMcp() {
594
+ removeJsonKey(VSCODE_USER_MCP_PATH, "servers");
595
+ }
596
+ /**
597
+ * Removes the `# codiedev-mcp` block from `~/.codex/config.toml`. The
598
+ * install side appends a well-marked block; we strip it the same way —
599
+ * the marker line through the end of its TOML section. Whitespace-only
600
+ * gaps between sections are preserved.
601
+ */
602
+ function cleanupCodexMcp() {
603
+ if (!fs.existsSync(CODEX_CONFIG_PATH))
604
+ return;
605
+ const existing = fs.readFileSync(CODEX_CONFIG_PATH, "utf8");
606
+ const marker = "# codiedev-mcp";
607
+ if (!existing.includes(marker))
608
+ return;
609
+ const lines = existing.split("\n");
610
+ const out = [];
611
+ let skipping = false;
612
+ for (const line of lines) {
613
+ if (line.trim() === marker) {
614
+ skipping = true;
615
+ continue;
616
+ }
617
+ if (skipping) {
618
+ // Stay in skip mode through the [mcp_servers.codiedev] block until
619
+ // we hit a blank line or a different TOML section header.
620
+ const trimmed = line.trim();
621
+ if (trimmed === "") {
622
+ skipping = false;
623
+ continue; // also drop the blank that immediately follows the block
624
+ }
625
+ if (trimmed.startsWith("[") && !trimmed.startsWith("[mcp_servers.codiedev")) {
626
+ skipping = false;
627
+ out.push(line);
628
+ continue;
629
+ }
630
+ // Skip lines belonging to the codiedev block.
631
+ continue;
632
+ }
633
+ out.push(line);
634
+ }
635
+ fs.writeFileSync(CODEX_CONFIG_PATH, out.join("\n"), "utf8");
636
+ }
541
637
  /**
542
638
  * Best-effort append of the CodieDev MCP server block to ~/.codex/config.toml.
543
639
  *
@@ -592,7 +688,7 @@ function installCodexHook() {
592
688
  const inner = hook.hooks;
593
689
  if (!Array.isArray(inner))
594
690
  return true;
595
- return !inner.some((h) => isCodiedevHookCommand(h.command));
691
+ return !inner.some((h) => (0, detection_1.isCodiedevHookCommand)(h.command));
596
692
  });
597
693
  filtered.push({
598
694
  hooks: [
@@ -638,7 +734,7 @@ function installCursorHook() {
638
734
  hooks.sessionEnd = [];
639
735
  }
640
736
  const existing = hooks.sessionEnd;
641
- const filtered = existing.filter((h) => !isCodiedevHookCommand(h.command));
737
+ const filtered = existing.filter((h) => !(0, detection_1.isCodiedevHookCommand)(h.command));
642
738
  filtered.push({
643
739
  command: resolveHookCommand("capture-cursor"),
644
740
  type: "command",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "codiedev",
3
- "version": "0.7.10",
3
+ "version": "0.8.0",
4
4
  "description": "Connect Claude Code, Codex, Cursor, or VS Code Copilot to CodieDev for org-wide session capture and artifact collaboration",
5
5
  "bin": {
6
6
  "codiedev": "dist/cli.js",