cimux-mcp 0.2.1 → 0.2.2

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/README.md CHANGED
@@ -1,9 +1,39 @@
1
1
  # Cimux
2
2
 
3
+ [![npm version](https://img.shields.io/npm/v/cimux-mcp)](https://www.npmjs.com/package/cimux-mcp)
4
+ [![CI](https://github.com/jackkslash/cimux/actions/workflows/ci.yml/badge.svg)](https://github.com/jackkslash/cimux/actions/workflows/ci.yml)
5
+
3
6
  Local-first mailboxes for intentional AI agent context handoffs.
4
7
 
5
8
  Cimux gives concurrent coding agents a simple way to pass context without dumping every detail into every session. A sender creates a structured Context Package, addressed to a mailbox such as `codex/backend-auth` or `claude/frontend-login`. The receiver can preview the inbox cheaply, read the full package only when it matters, and ack it after loading.
6
9
 
10
+ ## What it looks like
11
+
12
+ One agent finishes a piece of work and hands off:
13
+
14
+ ```text
15
+ Codex session Claude Code session
16
+ ───────────────── ────────────────────
17
+ send_context ──────────────────────▶ (user types anything)
18
+ to: claude/frontend-login hook: "Cimux: 1 unread context
19
+ title: Login bug root cause package(s) for claude/frontend-login
20
+ summary: Session cookie dropped from codex/backend-auth. Call
21
+ on redirect check_inbox to preview."
22
+ artifacts: 2 files, 1 commit
23
+ check_inbox → preview (~40 tokens)
24
+ read_context → full body + artifacts
25
+ ack_context → sender can see it landed
26
+ ```
27
+
28
+ The receiver's context stays clean until the moment the handoff actually matters. Empty inboxes cost zero tokens — the hook prints nothing.
29
+
30
+ ## Why not just a shared notes file?
31
+
32
+ - **Token discipline.** A shared markdown file gets pasted into sessions whole. Cimux previews keep each unread handoff to a ~40-token summary until an agent decides to read it — bodies, code snippets, and payloads never enter context uninvited.
33
+ - **Delivery state.** Files can't tell you whether the other agent ever saw the note. Every Context Package tracks read and acknowledged state (first write wins, safe across concurrent processes), so a handoff is a receipt, not a hope.
34
+ - **Addressing.** Mailboxes are per harness and workstream (`codex/backend-auth`), inferred automatically from the git branch — parallel agents don't trample one shared document.
35
+ - **Cross-harness, repo-clean.** Works between Claude Code, Codex (app or CLI), and Cursor through one local SQLite database in `~/.cimux/` — nothing gets committed to your repo.
36
+
7
37
  The product idea is intentionally small:
8
38
 
9
39
  - anyone can send to an existing mailbox
@@ -18,25 +48,28 @@ The product idea is intentionally small:
18
48
  Included now:
19
49
 
20
50
  - Context Package schema
21
- - SQLite storage
51
+ - SQLite storage (WAL, safe for concurrent sessions)
22
52
  - mailbox registration and name inference
23
53
  - MCP server with mailbox tools
24
- - zero-token notification command
54
+ - zero-token notification hook and session-start briefing
55
+ - agent norms installed to `CLAUDE.md`/`AGENTS.md` so agents hand off without prompting
25
56
  - safe installer for Codex and Claude config targets
26
57
  - local CLI commands for debugging and demos
58
+ - prototype read-only mail viewer (`node scripts/mail-viewer.mjs`)
27
59
 
28
60
  Not included yet:
29
61
 
62
+ - message or mailbox deletion
30
63
  - hosted SaaS mode
31
64
  - vector search or embeddings
32
65
  - automatic routing
33
66
  - remote auth
34
- - read-only inspector UI
35
-
36
- See [docs/mvp-readiness.md](docs/mvp-readiness.md) for the release checklist and known limits.
67
+ - polished inspector UI (`cimux ui`)
37
68
 
38
69
  ## Install
39
70
 
71
+ Requires Node >= 22.13 (Cimux uses the built-in `node:sqlite` — no native dependencies).
72
+
40
73
  From npm (package `cimux-mcp`, command `cimux`):
41
74
 
42
75
  ```bash
@@ -45,6 +78,19 @@ cimux install --dry-run
45
78
  cimux install
46
79
  ```
47
80
 
81
+ `cimux install` detects which harnesses are on your machine and writes config only for those (`--harness <name>` for one, `--all` for every supported harness):
82
+
83
+ | | Claude Code | Codex (app or CLI) | Cursor |
84
+ | --- | --- | --- | --- |
85
+ | MCP server | `~/.claude.json` | `~/.codex/config.toml` | `~/.cursor/mcp.json` |
86
+ | Hooks | notify + brief, `~/.claude/settings.json` | notify + brief, `~/.codex/hooks.json` | session brief, `~/.cursor/hooks.json` |
87
+ | Agent norms | `~/.claude/CLAUDE.md` | `~/.codex/AGENTS.md` | — (via session brief) |
88
+
89
+ Harness notes:
90
+
91
+ - Codex asks you to trust the hooks once (and again after any change to them) — that's Codex's own safety prompt, expected behavior.
92
+ - Cursor has no context-injecting per-prompt hook, so agents get the mailbox briefing (including unread count) at session start rather than a notification on every prompt. Cursor keeps user-level rules in its settings GUI, so the handoff norms travel in the brief instead of a rules file.
93
+
48
94
  ## Install Locally
49
95
 
50
96
  From the repo:
@@ -76,6 +122,7 @@ For hook checks, users should not have to remember a name. `cimux notify --harne
76
122
  Cimux exposes:
77
123
 
78
124
  - `register_session`
125
+ - `list_mailboxes`
79
126
  - `send_context`
80
127
  - `check_inbox`
81
128
  - `read_context`
@@ -83,8 +130,8 @@ Cimux exposes:
83
130
 
84
131
  Typical flow:
85
132
 
86
- 1. A session registers or infers its mailbox.
87
- 2. Another session sends a Context Package to that mailbox.
133
+ 1. A session starts; the `SessionStart` hook briefs the agent on its mailbox and unread count.
134
+ 2. Another session finds the recipient with `list_mailboxes` and sends a Context Package.
88
135
  3. The receiver sees a hook notification on the next user prompt if unread mail exists.
89
136
  4. The receiver calls `check_inbox` to preview.
90
137
  5. The receiver calls `read_context` for the full package.
@@ -128,7 +175,3 @@ npm run build
128
175
  npm run demo:local
129
176
  npm pack --dry-run
130
177
  ```
131
-
132
- ## MVP Readiness
133
-
134
- Before calling a build MVP-complete, run the automated checks and manual harness verification in [docs/mvp-readiness.md](docs/mvp-readiness.md).
@@ -1,20 +1,31 @@
1
1
  import { createSessionBrief } from "../../service/cimux-mailbox-service.js";
2
- import { resolveRuntimeMailboxFromArgs, withStore } from "../shared.js";
2
+ import { readString, resolveRuntimeMailboxFromArgs, withStore } from "../shared.js";
3
3
  export const briefCommand = {
4
4
  name: "brief",
5
- usage: "cimux brief [--mailbox <harness/name> | --harness <name>]",
5
+ usage: "cimux brief [--mailbox <harness/name> | --harness <name>] [--format text|cursor]",
6
6
  options: {
7
7
  mailbox: { type: "string" },
8
- harness: { type: "string" }
8
+ harness: { type: "string" },
9
+ format: { type: "string" }
9
10
  },
10
11
  run(context) {
12
+ const format = readString(context.values, "format") ?? "text";
13
+ if (format !== "text" && format !== "cursor") {
14
+ throw new Error(`Unknown format: ${format} (supported: text, cursor)`);
15
+ }
11
16
  return withStore(context.env, async (store) => {
12
17
  const { mailbox } = resolveRuntimeMailboxFromArgs(context);
13
18
  // Runs from a SessionStart hook: register the session's mailbox, then
14
19
  // print the norms so agents use Cimux without being prompted.
15
20
  await store.createMailbox(mailbox);
16
21
  const result = await createSessionBrief(store, { mailbox });
17
- context.io.log(result.message);
22
+ // Cursor hooks reply with JSON on stdout instead of plain text.
23
+ if (format === "cursor") {
24
+ context.io.log(JSON.stringify({ additional_context: result.message }));
25
+ }
26
+ else {
27
+ context.io.log(result.message);
28
+ }
18
29
  return 0;
19
30
  });
20
31
  }
@@ -1 +1 @@
1
- {"version":3,"file":"brief.js","sourceRoot":"","sources":["../../../src/cli/commands/brief.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,wCAAwC,CAAC;AAC5E,OAAO,EAAE,6BAA6B,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAGxE,MAAM,CAAC,MAAM,YAAY,GAAgB;IACvC,IAAI,EAAE,OAAO;IACb,KAAK,EAAE,2DAA2D;IAClE,OAAO,EAAE;QACP,OAAO,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;QAC3B,OAAO,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;KAC5B;IACD,GAAG,CAAC,OAAO;QACT,OAAO,SAAS,CAAC,OAAO,CAAC,GAAG,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE;YAC5C,MAAM,EAAE,OAAO,EAAE,GAAG,6BAA6B,CAAC,OAAO,CAAC,CAAC;YAE3D,sEAAsE;YACtE,8DAA8D;YAC9D,MAAM,KAAK,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;YACnC,MAAM,MAAM,GAAG,MAAM,kBAAkB,CAAC,KAAK,EAAE,EAAE,OAA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AAI,MAAM,KAAK,QAAQ,EAAE,CAAC;gBACxB,OAAO,CAAC,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,kBAAkB,EAAE,MAAM,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC;YACzE,CAAC;iBAAM,CAAC;gBACN,OAAO,CAAC,EAAE,CAAC,GAAG,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;YACjC,CAAC;YACD,OAAO,CAAC,CAAC;QACX,CAAC,CAAC,CAAC;IACL,CAAC;CACF,CAAC"}
@@ -1,13 +1,24 @@
1
1
  import { applyInstallPlan, createInstallPlan } from "../../install/cimux-install-plan.js";
2
- import { resolvePackageCommand } from "../shared.js";
2
+ import { detectInstalledHarnesses, SUPPORTED_HARNESSES } from "../../install/harnesses/index.js";
3
+ import { readString, resolvePackageCommand } from "../shared.js";
3
4
  export const installCommand = {
4
5
  name: "install",
5
- usage: "cimux install [--dry-run]",
6
+ usage: "cimux install [--dry-run] [--all | --harness <name>]",
6
7
  options: {
7
- "dry-run": { type: "boolean" }
8
+ "dry-run": { type: "boolean" },
9
+ all: { type: "boolean" },
10
+ harness: { type: "string" }
8
11
  },
9
12
  run(context) {
10
- const plan = createInstallPlan({ packageCommand: resolvePackageCommand() });
13
+ const harnesses = selectHarnesses(context);
14
+ if (harnesses !== undefined && harnesses.length === 0) {
15
+ context.io.error(`No supported harnesses detected (looked for ${SUPPORTED_HARNESSES.map((name) => `~/.${name}`).join(", ")}). Use --all to write config for every supported harness.`);
16
+ return 1;
17
+ }
18
+ const plan = createInstallPlan({
19
+ packageCommand: resolvePackageCommand(),
20
+ ...(harnesses === undefined ? {} : { harnesses })
21
+ });
11
22
  if (context.values["dry-run"] !== true) {
12
23
  const results = applyInstallPlan(plan);
13
24
  for (const result of results) {
@@ -24,4 +35,21 @@ export const installCommand = {
24
35
  return 0;
25
36
  }
26
37
  };
38
+ // undefined means "no filter": --all installs every supported harness.
39
+ function selectHarnesses(context) {
40
+ const harness = readString(context.values, "harness");
41
+ if (harness !== undefined) {
42
+ if (!isHarnessName(harness)) {
43
+ throw new Error(`Unknown harness: ${harness} (supported: ${SUPPORTED_HARNESSES.join(", ")})`);
44
+ }
45
+ return [harness];
46
+ }
47
+ if (context.values.all === true) {
48
+ return undefined;
49
+ }
50
+ return detectInstalledHarnesses();
51
+ }
52
+ function isHarnessName(value) {
53
+ return SUPPORTED_HARNESSES.includes(value);
54
+ }
27
55
  //# sourceMappingURL=install.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"install.js","sourceRoot":"","sources":["../../../src/cli/commands/install.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,qCAAqC,CAAC;AAC1F,OAAO,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC;AAGrD,MAAM,CAAC,MAAM,cAAc,GAAgB;IACzC,IAAI,EAAE,SAAS;IACf,KAAK,EAAE,2BAA2B;IAClC,OAAO,EAAE;QACP,SAAS,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE;KAC/B;IACD,GAAG,CAAC,OAAO;QACT,MAAM,IAAI,GAAG,iBAAiB,CAAC,EAAE,cAAc,EAAE,qBAAqB,EAAE,EAAE,CAAC,CAAC;QAC5E,IAAI,OAAO,CAAC,MAAM,CAAC,SAAS,CAAC,KAAK,IAAI,EAAE,CAAC;YACvC,MAAM,OAAO,GAAG,gBAAgB,CAAC,IAAI,CAAC,CAAC;YACvC,KAAK,MAAM,MAAM,IAAI,OAAO,EAAE,CAAC;gBAC7B,MAAM,MAAM,GAAG,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,YAAY,MAAM,CAAC,UAAU,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;gBACxE,OAAO,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,MAAM,KAAK,MAAM,CAAC,IAAI,GAAG,MAAM,EAAE,CAAC,CAAC;YAC9D,CAAC;YACD,OAAO,CAAC,CAA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,IAAI,OAAO,KAAK,SAAS,EAAE,CAAC;QAC1B,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC,EAAE,CAAC;YAC5B,MAAM,IAAI,KAAK,CACb,oBAAoB,OAAO,gBAAgB,mBAAmB,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAC7E,CAAC;QACJ,CAAC;QACD,OAAO,CAAC,OAAO,CAAC,CAAC;IACnB,CAAC;IAED,IAAI,OAAO,CAAC,MAAM,CAAC,GAAG,KAAK,IAAI,EAAE,CAAC;QAChC,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,OAAO,wBAAwB,EAAE,CAAC;AACpC,CAAC;AAED,SAAS,aAAa,CAAC,KAAa;IAClC,OAAQ,mBAAyC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;AACpE,CAAC"}
@@ -8,6 +8,8 @@ export type CimuxCliEnv = {
8
8
  CIMUX_DB_PATH?: string;
9
9
  CIMUX_MAILBOX?: string;
10
10
  CIMUX_HARNESS?: string;
11
+ CURSOR_PROJECT_DIR?: string;
12
+ CLAUDE_PROJECT_DIR?: string;
11
13
  };
12
14
  export type ParsedValues = Record<string, string | boolean | undefined>;
13
15
  export type CommandContext = {
@@ -17,10 +17,13 @@ export function resolveRuntimeMailboxFromArgs(context) {
17
17
  if (!explicitMailbox && !harness) {
18
18
  throw new Error("Expected --mailbox <harness/name> or --harness <name>");
19
19
  }
20
+ // Some harnesses (Cursor) run hooks from their own directory, not the
21
+ // workspace, and pass the real project location through the environment.
22
+ const cwd = context.env.CURSOR_PROJECT_DIR ?? context.env.CLAUDE_PROJECT_DIR ?? context.cwd;
20
23
  return resolveRuntimeMailbox({
21
24
  ...(explicitMailbox === undefined ? {} : { explicitMailbox }),
22
25
  ...(harness === undefined ? {} : { harness }),
23
- cwd: context.cwd
26
+ cwd
24
27
  });
25
28
  }
26
29
  export function resolvePackageCommand() {
@@ -1 +1 @@
1
- {"version":3,"file":"shared.js","sourceRoot":"","sources":["../../src/cli/shared.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,EAAE,CAAC,CAAC;IACxC,CAAC;IAED,OAAO,KAAK,CAAC;AACf,CAAC;AAED,MAAM,UAAU,OAAO,CAAC,MAAoB,EAAE,IAAY;IACxD,MAAM,KAAK,GAAG,UAAU,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;IACvC,IAAI,CAAC,KAAK,EAAE,CAAC;QACX,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,OAAO,KAAK;SACT,KAAK,CAAC,GAAG,CAAC;SACV,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC;SAC1B,MAAM,CAAC,OAAO,CAAC,CAAC;AACrB,CAAC;AAED,MAAM,UAAU,QAAQ,CAAC,MAAoB,EAAE,IAAY;IACzD,MAAM,KAAK,GAAG,UAAU,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;IACvC,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;QACxB,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,IAAI,CAAC;QACH,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IAC3B,CAAC;IAAC,MAAM,CAAC;QACP,MAAM,IAAI,KAAK,CAAC,sBAAsB,IAAI,EAAE,CAAC,CAAC;IAChD,CAAC;AACH,CAAC;AAED,MAAM,UAAU,SAAS,CAAC,EAAc,EAAE,KAAc;IACtD,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;AACzC,CAAC"}
package/dist/index.d.ts CHANGED
@@ -7,6 +7,8 @@ export { ackStateSchema, artifactsSchema, codeSnippetArtifactSchema, commitArtif
7
7
  export { ackContext, checkInbox, ContextPackageNotFoundError, createInboxNotification, createSessionBrief, listMailboxes, MailboxAccessError, readContext, registerSession, sendContext } from "./service/cimux-mailbox-service.js";
8
8
  export { runCimuxCli } from "./cli/cimux-cli.js";
9
9
  export { applyInstallPlan, createInstallPlan } from "./install/cimux-install-plan.js";
10
+ export { detectInstalledHarnesses, SUPPORTED_HARNESSES } from "./install/harnesses/index.js";
11
+ export type { HarnessName } from "./install/harnesses/index.js";
10
12
  export { createCimuxMcpServer, defaultDatabasePath, runCimuxMcpServer } from "./mcp/cimux-mcp-server.js";
11
13
  export { inferMailboxName, registerMailbox, registerMailboxInputSchema, resolveRuntimeMailbox } from "./naming/mailbox-naming.js";
12
14
  export { SQLiteCimuxStore, UnknownMailboxError } from "./storage/sqlite-cimux-store.js";
package/dist/index.js CHANGED
@@ -6,6 +6,7 @@ export { ackStateSchema, artifactsSchema, codeSnippetArtifactSchema, commitArtif
6
6
  export { ackContext, checkInbox, ContextPackageNotFoundError, createInboxNotification, createSessionBrief, listMailboxes, MailboxAccessError, readContext, registerSession, sendContext } from "./service/cimux-mailbox-service.js";
7
7
  export { runCimuxCli } from "./cli/cimux-cli.js";
8
8
  export { applyInstallPlan, createInstallPlan } from "./install/cimux-install-plan.js";
9
+ export { detectInstalledHarnesses, SUPPORTED_HARNESSES } from "./install/harnesses/index.js";
9
10
  export { createCimuxMcpServer, defaultDatabasePath, runCimuxMcpServer } from "./mcp/cimux-mcp-server.js";
10
11
  export { inferMailboxName, registerMailbox, registerMailboxInputSchema, resolveRuntimeMailbox } from "./naming/mailbox-naming.js";
11
12
  export { SQLiteCimuxStore, UnknownMailboxError } from "./storage/sqlite-cimux-store.js";
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAE7C,MAAM,UAAU,eAAe;IAC7B,OAAO,WAAW,CAAC;AACrB,CAAC;AA6BD,OAAO,EACL,cAAc,EACd,eAAe,EACf,yBAAyB,EACzB,oBAAoB,EACpB,2BAA2B,EAC3B,oBAAoB,EACpB,2BAA2B,EAC3B,+BAA+B,EAC/B,2BAA2B,EAC3B,kB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ACV,UAAU,EACV,2BAA2B,EAC3B,uBAAuB,EACvB,kBAAkB,EAClB,aAAa,EACb,kBAAkB,EAClB,WAAW,EACX,eAAe,EACf,WAAW,EACZ,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AACtF,OAAO,EACL,wBAAwB,EACxB,mBAAmB,EACpB,MAAM,8BAA8B,CAAC;AAEtC,OAAO,EACL,oBAAoB,EACpB,mBAAmB,EACnB,iBAAiB,EAClB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACL,gBAAgB,EAChB,eAAe,EACf,0BAA0B,EAC1B,qBAAqB,EACtB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC"}
@@ -1,17 +1,21 @@
1
1
  import { z } from "zod";
2
+ import type { HarnessName } from "./harnesses/index.js";
2
3
  export declare const installPlanInputSchema: z.ZodObject<{
3
4
  packageCommand: z.ZodDefault<z.ZodString>;
4
5
  homeDirectory: z.ZodDefault<z.ZodString>;
6
+ harnesses: z.ZodOptional<z.ZodArray<z.ZodEnum<["codex", "claude", "cursor"]>, "many">>;
5
7
  }, "strip", z.ZodTypeAny, {
6
8
  packageCommand: string;
7
9
  homeDirectory: string;
10
+ harnesses?: ("codex" | "cursor" | "claude")[] | undefined;
8
11
  }, {
9
12
  packageCommand?: string | undefined;
10
13
  homeDirectory?: string | undefined;
14
+ harnesses?: ("codex" | "cursor" | "claude")[] | undefined;
11
15
  }>;
12
16
  export type InstallPlanInput = z.input<typeof installPlanInputSchema>;
13
17
  export type InstallPlanTarget = {
14
- harness: "codex" | "claude";
18
+ harness: HarnessName;
15
19
  path: string;
16
20
  purpose: string;
17
21
  format: "toml" | "json" | "markdown";
@@ -2,64 +2,51 @@ import fs from "node:fs";
2
2
  import os from "node:os";
3
3
  import path from "node:path";
4
4
  import { z } from "zod";
5
+ import { AGENT_NORMS_MARKER, createAgentNormsSnippet, createHookSnippet, HARNESS_DESCRIPTORS, HOOKS_PURPOSE, SUPPORTED_HARNESSES } from "./harnesses/index.js";
5
6
  export const installPlanInputSchema = z.object({
6
7
  packageCommand: z.string().min(1).default("cimux"),
7
- homeDirectory: z.string().min(1).default(os.homedir())
8
+ homeDirectory: z.string().min(1).default(os.homedir()),
9
+ harnesses: z.array(z.enum(SUPPORTED_HARNESSES)).min(1).optional()
8
10
  });
9
11
  export function createInstallPlan(input = {}) {
10
12
  const parsed = installPlanInputSchema.parse(input);
11
- const codexHome = path.join(parsed.homeDirectory, ".codex");
12
- const claudeHome = path.join(parsed.homeDirectory, ".claude");
13
+ const selected = HARNESS_DESCRIPTORS.filter((descriptor) => !parsed.harnesses || parsed.harnesses.includes(descriptor.name));
13
14
  return {
14
- targets: [
15
- {
16
- harness: "codex",
17
- path: path.join(codexHome, "config.toml"),
18
- purpose: "Register the Cimux MCP server for Codex.",
19
- format: "toml",
20
- snippet: createCodexMcpSnippet(parsed.packageCommand)
21
- },
22
- {
23
- harness: "codex",
24
- // Codex hooks share Claude Code's shape; Codex asks the user to trust
25
- // a hook on first use and after any change to it.
26
- path: path.join(codexHome, "hooks.json"),
27
- purpose: "Notify on unread mail each prompt; brief the agent on its mailbox at session start.",
28
- format: "json",
29
- snippet: createHookSnippet(parsed.packageCommand, "codex")
30
- },
31
- {
32
- harness: "codex",
33
- path: path.join(codexHome, "AGENTS.md"),
34
- purpose: "Teach Codex agents to check and send Cimux mail without prompting.",
35
- format: "markdown",
36
- snippet: createAgentNormsSnippet()
37
- },
38
- {
39
- harness: "claude",
40
- path: path.join(claudeHome, "settings.json"),
41
- purpose: "Notify on unread mail each prompt; brief the agent on its mailbox at session start.",
42
- format: "json",
43
- snippet: createHookSnippet(parsed.packageCommand, "claude")
44
- },
45
- {
46
- harness: "claude",
47
- path: path.join(claudeHome, "CLAUDE.md"),
48
- purpose: "Teach Claude Code agents to check and send Cimux mail without prompting.",
49
- format: "markdown",
50
- snippet: createAgentNormsSnippet()
51
- },
52
- {
53
- harness: "claude",
54
- // Claude Code reads user-scope MCP servers from ~/.claude.json.
55
- path: path.join(parsed.homeDirectory, ".claude.json"),
56
- purpose: "Register the Cimux MCP server for Claude Code (user scope).",
57
- format: "json",
58
- snippet: createClaudeMcpSnippet(parsed.packageCommand)
59
- }
60
- ]
15
+ targets: selected.flatMap((descriptor) => createHarnessTargets(descriptor, parsed.homeDirectory, parsed.packageCommand))
61
16
  };
62
17
  }
18
+ function createHarnessTargets(descriptor, homeDirectory, packageCommand) {
19
+ const targets = [
20
+ {
21
+ harness: descriptor.name,
22
+ path: path.join(homeDirectory, descriptor.mcp.path),
23
+ purpose: descriptor.mcp.purpose,
24
+ format: descriptor.mcp.format,
25
+ snippet: descriptor.mcp.snippet(packageCommand)
26
+ }
27
+ ];
28
+ if (descriptor.hooks) {
29
+ const snippet = descriptor.hooks.snippet ?? createHookSnippet;
30
+ targets.push({
31
+ harness: descriptor.name,
32
+ path: path.join(homeDirectory, descriptor.hooks.path),
33
+ purpose: descriptor.hooks.purpose ?? HOOKS_PURPOSE,
34
+ format: "json",
35
+ snippet: snippet(packageCommand, descriptor.name)
36
+ });
37
+ }
38
+ if (descriptor.norms) {
39
+ const snippet = descriptor.norms.snippet ?? createAgentNormsSnippet;
40
+ targets.push({
41
+ harness: descriptor.name,
42
+ path: path.join(homeDirectory, descriptor.norms.path),
43
+ purpose: descriptor.norms.purpose,
44
+ format: "markdown",
45
+ snippet: snippet()
46
+ });
47
+ }
48
+ return targets;
49
+ }
63
50
  export function applyInstallPlan(plan) {
64
51
  return plan.targets.map((target) => applyInstallTarget(target));
65
52
  }
@@ -193,62 +180,4 @@ function stableStringify(value) {
193
180
  }
194
181
  return JSON.stringify(sorted);
195
182
  }
196
- function createCodexMcpSnippet(packageCommand) {
197
- return `[mcp_servers.cimux]
198
- command = "${packageCommand}"
199
- args = ["mcp"]
200
- startup_timeout_sec = 10
201
- tool_timeout_sec = 60
202
- `;
203
- }
204
- // Codex and Claude Code share the same hooks JSON shape and event names.
205
- function createHookSnippet(packageCommand, harness) {
206
- return JSON.stringify({
207
- hooks: {
208
- UserPromptSubmit: [
209
- {
210
- hooks: [
211
- {
212
- type: "command",
213
- command: `${packageCommand} notify --harness ${harness}`
214
- }
215
- ]
216
- }
217
- ],
218
- SessionStart: [
219
- {
220
- hooks: [
221
- {
222
- type: "command",
223
- command: `${packageCommand} brief --harness ${harness}`
224
- }
225
- ]
226
- }
227
- ]
228
- }
229
- }, null, 2);
230
- }
231
- const AGENT_NORMS_MARKER = "<!-- cimux:norms -->";
232
- function createAgentNormsSnippet() {
233
- return `${AGENT_NORMS_MARKER}
234
- ## Cimux agent mail
235
-
236
- You have a Cimux mailbox (MCP server \`cimux\`). Follow these norms without being asked:
237
-
238
- - When notified of unread context packages, call \`check_inbox\`, use \`read_context\` on what is relevant, and \`ack_context\` after loading it.
239
- - When you finish work whose outcome another agent or a future session may need (root causes, decisions, gotchas, handoffs), send it with \`send_context\`: short title, tight summary, full detail in the body, artifact pointers instead of pasted file contents.
240
- - Find recipients with \`list_mailboxes\`; only existing mailboxes can receive mail. Register your own with \`register_session\` if unsure.
241
- <!-- cimux:end -->
242
- `;
243
- }
244
- function createClaudeMcpSnippet(packageCommand) {
245
- return JSON.stringify({
246
- mcpServers: {
247
- cimux: {
248
- command: packageCommand,
249
- args: ["mcp"]
250
- }
251
- }
252
- }, null, 2);
253
- }
254
183
  //# sourceMappingURL=cimux-install-plan.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"cimux-install-plan.js","sourceRoot":"","sources":["../../src/install/cimux-install-plan.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,M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,GAAG,IAAI,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC;QAC5C,MAAM,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC;IAC3B,CAAC;IAED,OAAO,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;AAChC,CAAC"}
@@ -0,0 +1,2 @@
1
+ import type { HarnessDescriptor } from "./shared.js";
2
+ export declare const claudeHarness: HarnessDescriptor;
@@ -0,0 +1,27 @@
1
+ export const claudeHarness = {
2
+ name: "claude",
3
+ detectDir: ".claude",
4
+ mcp: {
5
+ // Claude Code reads user-scope MCP servers from ~/.claude.json.
6
+ path: ".claude.json",
7
+ format: "json",
8
+ purpose: "Register the Cimux MCP server for Claude Code (user scope).",
9
+ snippet: createClaudeMcpSnippet
10
+ },
11
+ hooks: { path: ".claude/settings.json" },
12
+ norms: {
13
+ path: ".claude/CLAUDE.md",
14
+ purpose: "Teach Claude Code agents to check and send Cimux mail without prompting."
15
+ }
16
+ };
17
+ function createClaudeMcpSnippet(packageCommand) {
18
+ return JSON.stringify({
19
+ mcpServers: {
20
+ cimux: {
21
+ command: packageCommand,
22
+ args: ["mcp"]
23
+ }
24
+ }
25
+ }, null, 2);
26
+ }
27
+ //# sourceMappingURL=claude.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"claude.js","sourceRoot":"","sources":["../../../src/install/harnesses/claude.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,aAAa,GAAsB;IAC9C,IAAI,EAAE,QAAQ;IACd,SAAS,EAAE,SAAS;IACpB,GAAG,EAAE;QACH,gEAAgE;QAChE,IAAI,EAAE,cAAc;QACpB,MAAM,EAAE,MAAM;QACd,OAAO,EAAE,6DAA6D;QACtE,OAAO,EAAE,sBAAsB;KAChC;IACD,KAAK,EAAE,EAAE,IAAI,EAAE,uBAAuB,EAAE;IACxC,KAAK,EAAE;QACL,IAAI,EAAE,mBAAmB;QACzB,OAAO,EAAE,0EAA0E;KACpF;CACF,CAAC;AAEF,SAAS,sBAAsB,CAAC,cAAsB;IACpD,OAAO,IAAI,CAAC,SAAS,CACnB;QACE,UAAU,EAAE;YACV,KAAK,EAAE;gBACL,OAAO,EAAE,cAAc;gBACvB,IAAI,EAAE,CAAC,KAAK,CAAC;aACd;SACF;KACF,EACD,IAAI,EACJ,CAAC,CACF,CAAC;AACJ,CAAC"}
@@ -0,0 +1,2 @@
1
+ import type { HarnessDescriptor } from "./shared.js";
2
+ export declare const codexHarness: HarnessDescriptor;
@@ -0,0 +1,26 @@
1
+ export const codexHarness = {
2
+ name: "codex",
3
+ detectDir: ".codex",
4
+ mcp: {
5
+ path: ".codex/config.toml",
6
+ format: "toml",
7
+ purpose: "Register the Cimux MCP server for Codex.",
8
+ snippet: createCodexMcpSnippet
9
+ },
10
+ // Codex hooks share Claude Code's shape; Codex asks the user to trust
11
+ // a hook on first use and after any change to it.
12
+ hooks: { path: ".codex/hooks.json" },
13
+ norms: {
14
+ path: ".codex/AGENTS.md",
15
+ purpose: "Teach Codex agents to check and send Cimux mail without prompting."
16
+ }
17
+ };
18
+ function createCodexMcpSnippet(packageCommand) {
19
+ return `[mcp_servers.cimux]
20
+ command = "${packageCommand}"
21
+ args = ["mcp"]
22
+ startup_timeout_sec = 10
23
+ tool_timeout_sec = 60
24
+ `;
25
+ }
26
+ //# sourceMappingURL=codex.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"codex.js","sourceRoot":"","sources":["../../../src/install/harnesses/codex.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,YAAY,GAAsB;IAC7C,IAAI,EAAE,OAAO;IACb,SAAS,EAAE,QAAQ;IACnB,GAAG,EAAE;QACH,IAAI,EAAE,oBAAoB;QAC1B,MAAM,EAAE,MAAM;QACd,OAAO,EAAE,0CAA0C;QACnD,OAAO,EAAE,qBAAqB;KAC/B;IACD,sEAAsE;IACtE,kDAAkD;IAClD,KAAK,EAAE,EAAE,IAAI,EAAE,mBAAmB,EAAE;IACpC,KAAK,EAAE;QACL,IAAI,EAAE,kBAAkB;QACxB,OAAO,EAAE,oEAAoE;KAC9E;CACF,CAAC;AAEF,SAAS,qBAAqB,CAAC,cAAsB;IACnD,OAAO;aACI,cAAc;;;;CAI1B,CAAC;AACF,CAAC"}
@@ -0,0 +1,2 @@
1
+ import type { HarnessDescriptor } from "./shared.js";
2
+ export declare const cursorHarness: HarnessDescriptor;
@@ -0,0 +1,46 @@
1
+ // Cursor has no user-level norms file (User Rules live in its settings GUI),
2
+ // so agents learn the mail norms from the session brief instead.
3
+ export const cursorHarness = {
4
+ name: "cursor",
5
+ detectDir: ".cursor",
6
+ mcp: {
7
+ path: ".cursor/mcp.json",
8
+ format: "json",
9
+ purpose: "Register the Cimux MCP server for Cursor.",
10
+ snippet: createCursorMcpSnippet
11
+ },
12
+ hooks: {
13
+ path: ".cursor/hooks.json",
14
+ purpose: "Brief the agent on its mailbox and unread mail at session start.",
15
+ snippet: createCursorHookSnippet
16
+ }
17
+ };
18
+ function createCursorMcpSnippet(packageCommand) {
19
+ return JSON.stringify({
20
+ mcpServers: {
21
+ cimux: {
22
+ type: "stdio",
23
+ command: packageCommand,
24
+ args: ["mcp"]
25
+ }
26
+ }
27
+ }, null, 2);
28
+ }
29
+ // Cursor's hook config differs from Claude/Codex: a version field, camelCase
30
+ // events, and hooks respond with JSON on stdout — sessionStart injects
31
+ // context via {"additional_context": ...}, which `brief --format cursor`
32
+ // emits. There is no context-injecting per-prompt event, so Cursor gets the
33
+ // session brief only.
34
+ function createCursorHookSnippet(packageCommand) {
35
+ return JSON.stringify({
36
+ version: 1,
37
+ hooks: {
38
+ sessionStart: [
39
+ {
40
+ command: `${packageCommand} brief --harness cursor --format cursor`
41
+ }
42
+ ]
43
+ }
44
+ }, null, 2);
45
+ }
46
+ //# sourceMappingURL=cursor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cursor.js","sourceRoot":"","sources":["../../../src/install/harnesses/cursor.ts"],"names":[],"mappings":"AAEA,6EAA6E;AAC7E,iEAAiE;AACjE,MAAM,CAAC,MAAM,aAAa,GAAsB;IAC9C,IAAI,EAAE,QAAQ;IACd,SAAS,EAAE,SAAS;IACpB,GAAG,EAAE;QACH,IAAI,EAAE,kBAAkB;QACxB,MAAM,EAAE,MAAM;QACd,OAAO,EAAE,2CAA2C;QACpD,OAAO,EAAE,sBAAsB;KAChC;IACD,KAAK,EAAE;QACL,IAAI,EAAE,oBAAoB;QAC1B,OAAO,EAAE,kEAAkE;QAC3E,OAAO,EAAE,uBAAuB;KACjC;CACF,CAAC;AAEF,SAAS,sBAAsB,CAAC,cAAsB;IACpD,OAAO,IAAI,CAAC,SAAS,CACnB;QACE,UAAU,EAAE;YACV,KAAK,EAAE;gBACL,IAAI,EAAE,OAAO;gBACb,OAAO,EAAE,cAAc;gBACvB,IAAI,EAAE,CAAC,KAAK,CAAC;aACd;SACF;KACF,EACD,IAAI,EACJ,CAAC,CACF,CAAC;AACJ,CAAC;AAED,6EAA6E;AAC7E,uEAAuE;AACvE,yEAAyE;AACzE,4EAA4E;AAC5E,sBAAsB;AACtB,SAAS,uBAAuB,CAAC,cAAsB;IACrD,OAAO,IAAI,CAAC,SAAS,CACnB;QACE,OAAO,EAAE,CAAC;QACV,KAAK,EAAE;YACL,YAAY,EAAE;gBACZ;oBACE,OAAO,EAAE,GAAG,cAAc,yCAAyC;iBACpE;aACF;SACF;KACF,EACD,IAAI,EACJ,CAAC,CACF,CAAC;AACJ,CAAC"}
@@ -0,0 +1,5 @@
1
+ import type { HarnessDescriptor, HarnessName } from "./shared.js";
2
+ export declare const HARNESS_DESCRIPTORS: HarnessDescriptor[];
3
+ export { AGENT_NORMS_MARKER, createAgentNormsSnippet, createHookSnippet, HOOKS_PURPOSE, SUPPORTED_HARNESSES } from "./shared.js";
4
+ export type { HarnessDescriptor, HarnessName } from "./shared.js";
5
+ export declare function detectInstalledHarnesses(homeDirectory?: string): HarnessName[];
@@ -0,0 +1,16 @@
1
+ import fs from "node:fs";
2
+ import os from "node:os";
3
+ import path from "node:path";
4
+ import { claudeHarness } from "./claude.js";
5
+ import { codexHarness } from "./codex.js";
6
+ import { cursorHarness } from "./cursor.js";
7
+ export const HARNESS_DESCRIPTORS = [
8
+ codexHarness,
9
+ claudeHarness,
10
+ cursorHarness
11
+ ];
12
+ export { AGENT_NORMS_MARKER, createAgentNormsSnippet, createHookSnippet, HOOKS_PURPOSE, SUPPORTED_HARNESSES } from "./shared.js";
13
+ export function detectInstalledHarnesses(homeDirectory = os.homedir()) {
14
+ return HARNESS_DESCRIPTORS.filter((descriptor) => fs.existsSync(path.join(homeDirectory, descriptor.detectDir))).map((descriptor) => descriptor.name);
15
+ }
16
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/install/harnesses/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAG5C,MAAM,CAAC,MAAM,mBAAmB,GAAwB;IACtD,YAAY;IACZ,aAAa;IACb,aAAa;CACd,CAAC;AAEF,OAAO,EACL,kBAAkB,EAClB,uBAAuB,EACvB,iBAAiB,EACjB,aAAa,EACb,mBAAmB,EACpB,MAAM,aAAa,CAAC;AAGrB,MAAM,UAAU,wBAAwB,CAAC,aAAa,GAAG,EAAE,CAAC,OAAO,EAAE;IACnE,OAAO,mBAAmB,CAAC,MAAM,CAAC,CAAC,UAAU,EAAE,EAAE,CAC/C,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,aAAa,EAAE,UAAU,CAAC,SAAS,CAAC,CAAC,CAC9D,CAAC,GAAG,CAAC,CAAC,UAAU,EAAE,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;AACzC,CAAC"}
@@ -0,0 +1,26 @@
1
+ export declare const SUPPORTED_HARNESSES: readonly ["codex", "claude", "cursor"];
2
+ export type HarnessName = (typeof SUPPORTED_HARNESSES)[number];
3
+ export type HarnessDescriptor = {
4
+ name: HarnessName;
5
+ detectDir: string;
6
+ mcp: {
7
+ path: string;
8
+ format: "toml" | "json";
9
+ purpose: string;
10
+ snippet: (packageCommand: string) => string;
11
+ };
12
+ hooks?: {
13
+ path: string;
14
+ purpose?: string;
15
+ snippet?: (packageCommand: string, harness: HarnessName) => string;
16
+ };
17
+ norms?: {
18
+ path: string;
19
+ purpose: string;
20
+ snippet?: () => string;
21
+ };
22
+ };
23
+ export declare const HOOKS_PURPOSE = "Notify on unread mail each prompt; brief the agent on its mailbox at session start.";
24
+ export declare const AGENT_NORMS_MARKER = "<!-- cimux:norms -->";
25
+ export declare function createHookSnippet(packageCommand: string, harness: HarnessName): string;
26
+ export declare function createAgentNormsSnippet(): string;
@@ -0,0 +1,43 @@
1
+ export const SUPPORTED_HARNESSES = ["codex", "claude", "cursor"];
2
+ export const HOOKS_PURPOSE = "Notify on unread mail each prompt; brief the agent on its mailbox at session start.";
3
+ export const AGENT_NORMS_MARKER = "<!-- cimux:norms -->";
4
+ // Codex and Claude Code share the same hooks JSON shape and event names.
5
+ export function createHookSnippet(packageCommand, harness) {
6
+ return JSON.stringify({
7
+ hooks: {
8
+ UserPromptSubmit: [
9
+ {
10
+ hooks: [
11
+ {
12
+ type: "command",
13
+ command: `${packageCommand} notify --harness ${harness}`
14
+ }
15
+ ]
16
+ }
17
+ ],
18
+ SessionStart: [
19
+ {
20
+ hooks: [
21
+ {
22
+ type: "command",
23
+ command: `${packageCommand} brief --harness ${harness}`
24
+ }
25
+ ]
26
+ }
27
+ ]
28
+ }
29
+ }, null, 2);
30
+ }
31
+ export function createAgentNormsSnippet() {
32
+ return `${AGENT_NORMS_MARKER}
33
+ ## Cimux agent mail
34
+
35
+ You have a Cimux mailbox (MCP server \`cimux\`). Follow these norms without being asked:
36
+
37
+ - When notified of unread context packages, call \`check_inbox\`, use \`read_context\` on what is relevant, and \`ack_context\` after loading it.
38
+ - When you finish work whose outcome another agent or a future session may need (root causes, decisions, gotchas, handoffs), send it with \`send_context\`: short title, tight summary, full detail in the body, artifact pointers instead of pasted file contents.
39
+ - Find recipients with \`list_mailboxes\`; only existing mailboxes can receive mail. Register your own with \`register_session\` if unsure.
40
+ <!-- cimux:end -->
41
+ `;
42
+ }
43
+ //# sourceMappingURL=shared.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shared.js","sourceRoot":"","sources":["../../../src/install/harnesses/shared.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,OAAO,EAAE,QAAQ,EAAE,QAAQ,CAAU,CAAC;AA8B1E,MAAM,CAAC,MAAM,aAAa,GACxB,qFAAqF,CAAC;AAExF,MAAM,CAAC,MAAM,kBAAkB,GAAG,sBAAsB,CAAC;AAEzD,yEAAyE;AACzE,MAAM,UAAU,iBAAiB,CAAC,cAAsB,EAAE,OAAoB;IAC5E,OAAO,IAAI,CAAC,SAAS,CACnB;QACE,KAAK,EAAE;YACL,gBAAgB,EAAE;gBAChB;oBACE,KAAK,EAAE;wBACL;4BACE,IAAI,EAAE,SAAS;4BACf,OAAO,EAAE,GAAG,cAAc,qBAAqB,OAAO,EAAE;yBACzD;qBACF;iBACF;aACF;YACD,YAAY,EAAE;gBACZ;oBACE,KAAK,EAAE;wBACL;4BACE,IAAI,EAAE,SAAS;4BACf,OAAO,EAAE,GAAG,cAAc,oBAAoB,OAAO,EAAE;yBACxD;qBACF;iBACF;aACF;SACF;KACF,EACD,IAAI,EACJ,CAAC,CACF,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,uBAAuB;IACrC,OAAO,GAAG,kBAAkB;;;;;;;;;CAS7B,CAAC;AACF,CAAC"}
package/dist/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
1
  export declare const name = "cimux";
2
- export declare const version = "0.2.1";
2
+ export declare const version = "0.2.2";
package/dist/version.js CHANGED
@@ -1,3 +1,3 @@
1
1
  export const name = "cimux";
2
- export const version = "0.2.1";
2
+ export const version = "0.2.2";
3
3
  //# sourceMappingURL=version.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cimux-mcp",
3
- "version": "0.2.1",
3
+ "version": "0.2.2",
4
4
  "description": "Local-first mailbox for intentional AI agent context handoffs.",
5
5
  "keywords": [
6
6
  "mcp",
@@ -25,7 +25,6 @@
25
25
  },
26
26
  "files": [
27
27
  "dist",
28
- "docs",
29
28
  "scripts"
30
29
  ],
31
30
  "scripts": {
@@ -1,85 +0,0 @@
1
- # MVP Readiness
2
-
3
- This checklist defines the local Cimux MVP: agents can send intentional context to another local agent inbox; receivers can preview, read, and ack; empty inbox checks do not emit prompt context.
4
-
5
- ## Automated Checks
6
-
7
- Run before every MVP release candidate:
8
-
9
- ```bash
10
- npm test
11
- npm run typecheck
12
- npm run build
13
- npm run demo:local
14
- npm pack --dry-run
15
- ```
16
-
17
- Expected result:
18
-
19
- - all tests pass
20
- - the demo sends, notifies, previews, reads, and acks one Context Package
21
- - the npm tarball includes `dist`, `README.md`, `package.json`, and `scripts/demo-local-handoff.mjs`
22
-
23
- ## Manual Install Check
24
-
25
- Run this from the repo on a local machine:
26
-
27
- ```bash
28
- npm install
29
- npm run build
30
- npm link
31
- cimux --help
32
- cimux --version
33
- cimux install --dry-run
34
- cimux install
35
- ```
36
-
37
- Expected result:
38
-
39
- - `cimux --help` prints the command list
40
- - `cimux --version` prints the package version
41
- - `cimux install --dry-run` prints Codex and Claude config snippets
42
- - `cimux install` writes config and creates `.cimux.bak` backups before updating existing files
43
- - a new Codex or Claude session sees the Cimux MCP server after restart
44
-
45
- ## Harness Verification
46
-
47
- After installing and restarting the target harness:
48
-
49
- 1. Confirm the Cimux MCP tools are visible:
50
- - `register_session`
51
- - `send_context`
52
- - `check_inbox`
53
- - `read_context`
54
- - `ack_context`
55
- 2. Start or resume a session in a git repo.
56
- 3. Confirm the session can register as `harness/branch-name`.
57
- 4. Send a Context Package to that mailbox.
58
- 5. Submit a new user prompt to the receiving session.
59
- 6. Confirm the hook emits one short notification line.
60
- 7. Confirm `check_inbox` returns previews only.
61
- 8. Confirm `read_context` returns the full body.
62
- 9. Confirm `ack_context` marks the package acknowledged.
63
-
64
- ## Known Limits
65
-
66
- - Local-only SQLite storage.
67
- - No hosted auth, workspaces, or SaaS tenancy.
68
- - No vector database or embeddings.
69
- - No automatic routing.
70
- - No remote mailbox sync.
71
- - No read-only inspector UI yet.
72
- - Hook notification depends on harness hook support and fires on the next user prompt, not as a real-time interrupt.
73
- - The installer targets the first supported Codex and Claude config paths and may need more harness-specific hardening before a public release.
74
-
75
- ## MVP Complete Bar
76
-
77
- Call the local MVP complete when:
78
-
79
- - automated checks pass
80
- - local demo passes
81
- - manual install check passes on one machine
82
- - at least one harness can see the MCP tools after install/restart
83
- - hook notification is verified in that harness
84
- - README and this checklist match the observed behavior
85
-