cimux-mcp 0.1.2 → 0.2.1
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 +3 -2
- package/dist/bin.d.ts +2 -0
- package/dist/bin.js +13 -0
- package/dist/bin.js.map +1 -0
- package/dist/cli/cimux-cli.d.ts +2 -9
- package/dist/cli/cimux-cli.js +62 -179
- package/dist/cli/cimux-cli.js.map +1 -1
- package/dist/cli/commands/ack.d.ts +2 -0
- package/dist/cli/commands/ack.js +24 -0
- package/dist/cli/commands/ack.js.map +1 -0
- package/dist/cli/commands/brief.d.ts +2 -0
- package/dist/cli/commands/brief.js +22 -0
- package/dist/cli/commands/brief.js.map +1 -0
- package/dist/cli/commands/check.d.ts +2 -0
- package/dist/cli/commands/check.js +24 -0
- package/dist/cli/commands/check.js.map +1 -0
- package/dist/cli/commands/install.d.ts +2 -0
- package/dist/cli/commands/install.js +27 -0
- package/dist/cli/commands/install.js.map +1 -0
- package/dist/cli/commands/mailboxes.d.ts +2 -0
- package/dist/cli/commands/mailboxes.js +14 -0
- package/dist/cli/commands/mailboxes.js.map +1 -0
- package/dist/cli/commands/mcp.d.ts +2 -0
- package/dist/cli/commands/mcp.js +11 -0
- package/dist/cli/commands/mcp.js.map +1 -0
- package/dist/cli/commands/notify.d.ts +2 -0
- package/dist/cli/commands/notify.js +24 -0
- package/dist/cli/commands/notify.js.map +1 -0
- package/dist/cli/commands/read.d.ts +2 -0
- package/dist/cli/commands/read.js +21 -0
- package/dist/cli/commands/read.js.map +1 -0
- package/dist/cli/commands/register.d.ts +2 -0
- package/dist/cli/commands/register.js +27 -0
- package/dist/cli/commands/register.js.map +1 -0
- package/dist/cli/commands/send.d.ts +2 -0
- package/dist/cli/commands/send.js +37 -0
- package/dist/cli/commands/send.js.map +1 -0
- package/dist/cli/shared.d.ts +34 -0
- package/dist/cli/shared.js +68 -0
- package/dist/cli/shared.js.map +1 -0
- package/dist/index.d.ts +3 -6
- package/dist/index.js +2 -24
- package/dist/index.js.map +1 -1
- package/dist/install/cimux-install-plan.d.ts +1 -1
- package/dist/install/cimux-install-plan.js +60 -2
- package/dist/install/cimux-install-plan.js.map +1 -1
- package/dist/mcp/cimux-mcp-server.js +13 -2
- package/dist/mcp/cimux-mcp-server.js.map +1 -1
- package/dist/{registration/mailbox-registration.d.ts → naming/mailbox-naming.d.ts} +21 -0
- package/dist/naming/mailbox-naming.js +96 -0
- package/dist/naming/mailbox-naming.js.map +1 -0
- package/dist/service/cimux-mailbox-service.d.ts +18 -2
- package/dist/service/cimux-mailbox-service.js +29 -3
- package/dist/service/cimux-mailbox-service.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +2 -2
- package/dist/registration/mailbox-registration.js +0 -48
- package/dist/registration/mailbox-registration.js.map +0 -1
- package/dist/runtime/mailbox-runtime.d.ts +0 -22
- package/dist/runtime/mailbox-runtime.js +0 -50
- package/dist/runtime/mailbox-runtime.js.map +0 -1
package/README.md
CHANGED
|
@@ -104,10 +104,11 @@ cimux send \
|
|
|
104
104
|
--title "Auth handoff" \
|
|
105
105
|
--summary "Frontend should handle the new auth error." \
|
|
106
106
|
--body "validateSession now throws ExpiredSessionError." \
|
|
107
|
-
--tags auth,frontend
|
|
107
|
+
--tags auth,frontend \
|
|
108
|
+
--artifacts-json '{"files":[{"path":"src/auth/session.ts"}]}'
|
|
108
109
|
|
|
109
110
|
cimux notify --mailbox claude/frontend-login
|
|
110
|
-
cimux check --mailbox claude/frontend-login
|
|
111
|
+
cimux check --mailbox claude/frontend-login --limit 5
|
|
111
112
|
cimux read --mailbox claude/frontend-login --id <context-id>
|
|
112
113
|
cimux ack --mailbox claude/frontend-login --id <context-id> --note "Loaded."
|
|
113
114
|
```
|
package/dist/bin.d.ts
ADDED
package/dist/bin.js
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// Check the runtime before importing anything: node:sqlite (used by the
|
|
3
|
+
// storage layer) is only available unflagged from Node 22.13, and importing
|
|
4
|
+
// it on older versions crashes with an unhelpful builtin-module error.
|
|
5
|
+
const [major = 0, minor = 0] = process.versions.node.split(".").map(Number);
|
|
6
|
+
if (major < 22 || (major === 22 && minor < 13)) {
|
|
7
|
+
console.error(`cimux requires Node >= 22.13 (for node:sqlite). You are running ${process.versions.node}.`);
|
|
8
|
+
process.exit(1);
|
|
9
|
+
}
|
|
10
|
+
const { runCimuxCli } = await import("./cli/cimux-cli.js");
|
|
11
|
+
process.exitCode = await runCimuxCli(process.argv.slice(2));
|
|
12
|
+
export {};
|
|
13
|
+
//# sourceMappingURL=bin.js.map
|
package/dist/bin.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bin.js","sourceRoot":"","sources":["../src/bin.ts"],"names":[],"mappings":";AAEA,wEAAwE;AACxE,4EAA4E;AAC5E,uEAAuE;AACvE,MAAM,CAAC,KAAK,GAAG,CAAC,EAAE,KAAK,GAAG,CAAC,CAAC,GAAG,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;AAC5E,IAAI,KAAK,GAAG,EAAE,IAAI,CAAC,KAAK,KAAK,EAAE,IAAI,KAAK,GAAG,EAAE,CAAC,EAAE,CAAC;IAC/C,OAAO,CAAC,KAAK,CACX,mEAAmE,OAAO,CAAC,QAAQ,CAAC,IAAI,GAAG,CAC5F,CAAC;IACF,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC;AAED,MAAM,EAAE,WAAW,EAAE,GAAG,MAAM,MAAM,CAAC,oBAAoB,CAAC,CAAC;AAC3D,OAAO,CAAC,QAAQ,GAAG,MAAM,WAAW,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC"}
|
package/dist/cli/cimux-cli.d.ts
CHANGED
|
@@ -1,10 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
error(message: string): void;
|
|
4
|
-
};
|
|
5
|
-
export type CimuxCliEnv = {
|
|
6
|
-
CIMUX_DB_PATH?: string;
|
|
7
|
-
CIMUX_MAILBOX?: string;
|
|
8
|
-
CIMUX_HARNESS?: string;
|
|
9
|
-
};
|
|
1
|
+
import type { CimuxCliEnv, CimuxCliIo } from "./shared.js";
|
|
2
|
+
export type { CimuxCliEnv, CimuxCliIo } from "./shared.js";
|
|
10
3
|
export declare function runCimuxCli(argv: string[], env?: CimuxCliEnv, cwd?: string, io?: CimuxCliIo): Promise<number>;
|
package/dist/cli/cimux-cli.js
CHANGED
|
@@ -1,187 +1,77 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import { defaultDatabasePath, runCimuxMcpServer } from "../mcp/cimux-mcp-server.js";
|
|
4
|
-
import { resolveRuntimeMailbox } from "../runtime/mailbox-runtime.js";
|
|
5
|
-
import { ackContext, checkInbox, createInboxNotification, readContext, registerSession, sendContext } from "../service/cimux-mailbox-service.js";
|
|
6
|
-
import { SQLiteCimuxStore } from "../storage/sqlite-cimux-store.js";
|
|
1
|
+
import { parseArgs } from "node:util";
|
|
2
|
+
import { ZodError } from "zod";
|
|
7
3
|
import { name, version } from "../version.js";
|
|
4
|
+
import { ackCommand } from "./commands/ack.js";
|
|
5
|
+
import { briefCommand } from "./commands/brief.js";
|
|
6
|
+
import { checkCommand } from "./commands/check.js";
|
|
7
|
+
import { installCommand } from "./commands/install.js";
|
|
8
|
+
import { mailboxesCommand } from "./commands/mailboxes.js";
|
|
9
|
+
import { mcpCommand } from "./commands/mcp.js";
|
|
10
|
+
import { notifyCommand } from "./commands/notify.js";
|
|
11
|
+
import { readCommand } from "./commands/read.js";
|
|
12
|
+
import { registerCommand } from "./commands/register.js";
|
|
13
|
+
import { sendCommand } from "./commands/send.js";
|
|
14
|
+
const commands = [
|
|
15
|
+
mcpCommand,
|
|
16
|
+
installCommand,
|
|
17
|
+
notifyCommand,
|
|
18
|
+
briefCommand,
|
|
19
|
+
registerCommand,
|
|
20
|
+
mailboxesCommand,
|
|
21
|
+
sendCommand,
|
|
22
|
+
checkCommand,
|
|
23
|
+
readCommand,
|
|
24
|
+
ackCommand
|
|
25
|
+
];
|
|
8
26
|
export async function runCimuxCli(argv, env = process.env, cwd = process.cwd(), io = console) {
|
|
9
27
|
const command = argv[0];
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
}
|
|
23
|
-
if (command === "notify") {
|
|
24
|
-
return await runNotifyCommand(argv, env, cwd, io);
|
|
25
|
-
}
|
|
26
|
-
if (command === "install") {
|
|
27
|
-
return runInstallCommand(argv, io);
|
|
28
|
-
}
|
|
29
|
-
if (command === "register") {
|
|
30
|
-
return await withStore(env, async (store) => {
|
|
31
|
-
const mailbox = resolveRuntimeMailboxFromArgs(argv, env, cwd);
|
|
32
|
-
const result = await registerSession(store, {
|
|
33
|
-
harness: readArg(argv, "--harness") ?? env.CIMUX_HARNESS ?? "codex",
|
|
34
|
-
...(mailbox.inferredFrom === "explicit"
|
|
35
|
-
? { explicitMailbox: mailbox.mailbox }
|
|
36
|
-
: {
|
|
37
|
-
branchName: mailbox.branchName ?? undefined,
|
|
38
|
-
folderName: mailbox.folderName
|
|
39
|
-
})
|
|
40
|
-
});
|
|
41
|
-
writeJson(io, result);
|
|
42
|
-
return 0;
|
|
43
|
-
});
|
|
44
|
-
}
|
|
45
|
-
if (command === "send") {
|
|
46
|
-
return await withStore(env, async (store) => {
|
|
47
|
-
const result = await sendContext(store, {
|
|
48
|
-
fromMailbox: requireArg(argv, "--from"),
|
|
49
|
-
toMailbox: requireArg(argv, "--to"),
|
|
50
|
-
title: requireArg(argv, "--title"),
|
|
51
|
-
summary: requireArg(argv, "--summary"),
|
|
52
|
-
body: requireArg(argv, "--body"),
|
|
53
|
-
tags: readCsvArg(argv, "--tags"),
|
|
54
|
-
artifacts: {},
|
|
55
|
-
payload: {}
|
|
56
|
-
});
|
|
57
|
-
writeJson(io, result);
|
|
58
|
-
return 0;
|
|
59
|
-
});
|
|
60
|
-
}
|
|
61
|
-
if (command === "check") {
|
|
62
|
-
return await withStore(env, async (store) => {
|
|
63
|
-
const result = await checkInbox(store, {
|
|
64
|
-
mailbox: requireArg(argv, "--mailbox"),
|
|
65
|
-
unreadOnly: !argv.includes("--all")
|
|
66
|
-
});
|
|
67
|
-
writeJson(io, result);
|
|
68
|
-
return 0;
|
|
69
|
-
});
|
|
70
|
-
}
|
|
71
|
-
if (command === "read") {
|
|
72
|
-
return await withStore(env, async (store) => {
|
|
73
|
-
const result = await readContext(store, {
|
|
74
|
-
mailbox: requireArg(argv, "--mailbox"),
|
|
75
|
-
id: requireArg(argv, "--id")
|
|
76
|
-
});
|
|
77
|
-
writeJson(io, result);
|
|
78
|
-
return 0;
|
|
79
|
-
});
|
|
80
|
-
}
|
|
81
|
-
if (command === "ack") {
|
|
82
|
-
return await withStore(env, async (store) => {
|
|
83
|
-
const note = readArg(argv, "--note");
|
|
84
|
-
const result = await ackContext(store, {
|
|
85
|
-
mailbox: requireArg(argv, "--mailbox"),
|
|
86
|
-
id: requireArg(argv, "--id"),
|
|
87
|
-
...(note === undefined ? {} : { note })
|
|
88
|
-
});
|
|
89
|
-
writeJson(io, result);
|
|
90
|
-
return 0;
|
|
91
|
-
});
|
|
92
|
-
}
|
|
28
|
+
if (!command || command === "help" || command === "--help" || command === "-h") {
|
|
29
|
+
io.log(usage());
|
|
30
|
+
return 0;
|
|
31
|
+
}
|
|
32
|
+
if (command === "version" || command === "--version" || command === "-v") {
|
|
33
|
+
io.log(`${name} ${version}`);
|
|
34
|
+
return 0;
|
|
35
|
+
}
|
|
36
|
+
const spec = commands.find((candidate) => candidate.name === command);
|
|
37
|
+
if (!spec) {
|
|
38
|
+
io.error(`Unknown command: ${command}`);
|
|
39
|
+
io.error("");
|
|
93
40
|
io.error(usage());
|
|
94
41
|
return 1;
|
|
95
42
|
}
|
|
43
|
+
let values;
|
|
44
|
+
try {
|
|
45
|
+
// strict mode rejects unknown flags and flags missing their value, so
|
|
46
|
+
// typos fail loudly instead of being silently swallowed.
|
|
47
|
+
values = parseArgs({
|
|
48
|
+
args: argv.slice(1),
|
|
49
|
+
options: spec.options,
|
|
50
|
+
strict: true,
|
|
51
|
+
allowPositionals: false
|
|
52
|
+
}).values;
|
|
53
|
+
}
|
|
96
54
|
catch (error) {
|
|
97
55
|
io.error(error instanceof Error ? error.message : String(error));
|
|
56
|
+
io.error(`Usage: ${spec.usage}`);
|
|
98
57
|
return 1;
|
|
99
58
|
}
|
|
100
|
-
}
|
|
101
|
-
async function runNotifyCommand(argv, env, cwd, io) {
|
|
102
|
-
return withStore(env, async (store) => {
|
|
103
|
-
const { mailbox } = resolveRuntimeMailboxFromArgs(argv, env, cwd);
|
|
104
|
-
// Hook checks also act as a heartbeat for the current local session name.
|
|
105
|
-
// Creation is idempotent, so this does not reset existing mailbox state.
|
|
106
|
-
await store.createMailbox(mailbox);
|
|
107
|
-
const result = await createInboxNotification(store, { mailbox });
|
|
108
|
-
if (result.message) {
|
|
109
|
-
io.log(result.message);
|
|
110
|
-
}
|
|
111
|
-
return 0;
|
|
112
|
-
});
|
|
113
|
-
}
|
|
114
|
-
function runInstallCommand(argv, io) {
|
|
115
|
-
const plan = createInstallPlan({ packageCommand: resolvePackageCommand() });
|
|
116
|
-
if (!argv.includes("--dry-run")) {
|
|
117
|
-
const results = applyInstallPlan(plan);
|
|
118
|
-
for (const result of results) {
|
|
119
|
-
const backup = result.backupPath ? ` backup: ${result.backupPath}` : "";
|
|
120
|
-
io.log(`${result.status}: ${result.path}${backup}`);
|
|
121
|
-
}
|
|
122
|
-
return 0;
|
|
123
|
-
}
|
|
124
|
-
for (const target of plan.targets) {
|
|
125
|
-
io.log(`# ${target.harness}: ${target.path}`);
|
|
126
|
-
io.log(`# ${target.purpose}`);
|
|
127
|
-
io.log(target.snippet);
|
|
128
|
-
}
|
|
129
|
-
return 0;
|
|
130
|
-
}
|
|
131
|
-
function resolvePackageCommand() {
|
|
132
|
-
// GUI-launched harnesses (e.g. the Codex desktop app) do not inherit the
|
|
133
|
-
// shell PATH, so write the absolute path of the running bin into config.
|
|
134
|
-
const binPath = process.argv[1];
|
|
135
|
-
return binPath && path.isAbsolute(binPath) ? binPath : "cimux";
|
|
136
|
-
}
|
|
137
|
-
async function withStore(env, callback) {
|
|
138
|
-
const store = new SQLiteCimuxStore(env.CIMUX_DB_PATH ?? defaultDatabasePath());
|
|
139
59
|
try {
|
|
140
|
-
return await
|
|
141
|
-
}
|
|
142
|
-
finally {
|
|
143
|
-
store.close();
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
function resolveRuntimeMailboxFromArgs(argv, env, cwd) {
|
|
147
|
-
const explicitMailbox = readArg(argv, "--mailbox") ?? env.CIMUX_MAILBOX;
|
|
148
|
-
const harness = readArg(argv, "--harness") ?? env.CIMUX_HARNESS;
|
|
149
|
-
if (!explicitMailbox && !harness) {
|
|
150
|
-
throw new Error("Expected --mailbox <harness/name> or --harness <name>");
|
|
60
|
+
return await spec.run({ values, env, cwd, io });
|
|
151
61
|
}
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
return prefixed?.slice(name.length + 1);
|
|
165
|
-
}
|
|
166
|
-
function requireArg(argv, name) {
|
|
167
|
-
const value = readArg(argv, name);
|
|
168
|
-
if (!value) {
|
|
169
|
-
throw new Error(`Expected ${name}`);
|
|
170
|
-
}
|
|
171
|
-
return value;
|
|
172
|
-
}
|
|
173
|
-
function readCsvArg(argv, name) {
|
|
174
|
-
const value = readArg(argv, name);
|
|
175
|
-
if (!value) {
|
|
176
|
-
return [];
|
|
62
|
+
catch (error) {
|
|
63
|
+
if (error instanceof ZodError) {
|
|
64
|
+
io.error("Invalid input:");
|
|
65
|
+
for (const issue of error.issues) {
|
|
66
|
+
const flag = issue.path.length > 0 ? `--${issue.path.join(".")}` : "input";
|
|
67
|
+
io.error(` ${flag}: ${issue.message}`);
|
|
68
|
+
}
|
|
69
|
+
io.error(`Usage: ${spec.usage}`);
|
|
70
|
+
return 1;
|
|
71
|
+
}
|
|
72
|
+
io.error(error instanceof Error ? error.message : String(error));
|
|
73
|
+
return 1;
|
|
177
74
|
}
|
|
178
|
-
return value
|
|
179
|
-
.split(",")
|
|
180
|
-
.map((item) => item.trim())
|
|
181
|
-
.filter(Boolean);
|
|
182
|
-
}
|
|
183
|
-
function writeJson(io, value) {
|
|
184
|
-
io.log(JSON.stringify(value, null, 2));
|
|
185
75
|
}
|
|
186
76
|
function usage() {
|
|
187
77
|
return [
|
|
@@ -190,14 +80,7 @@ function usage() {
|
|
|
190
80
|
"Local-first mailboxes for intentional AI agent context handoffs.",
|
|
191
81
|
"",
|
|
192
82
|
"Usage:",
|
|
193
|
-
|
|
194
|
-
" cimux install [--dry-run]",
|
|
195
|
-
" cimux notify [--mailbox <harness/name> | --harness <name>]",
|
|
196
|
-
" cimux register [--mailbox <harness/name> | --harness <name>]",
|
|
197
|
-
" cimux send --from <mailbox> --to <mailbox> --title <title> --summary <summary> --body <body> [--tags a,b]",
|
|
198
|
-
" cimux check --mailbox <harness/name> [--all]",
|
|
199
|
-
" cimux read --mailbox <harness/name> --id <context-id>",
|
|
200
|
-
" cimux ack --mailbox <harness/name> --id <context-id> [--note <note>]",
|
|
83
|
+
...commands.map((spec) => ` ${spec.usage}`),
|
|
201
84
|
"",
|
|
202
85
|
"Examples:",
|
|
203
86
|
" cimux install --dry-run",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cimux-cli.js","sourceRoot":"","sources":["../../src/cli/cimux-cli.ts"],"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|
1
|
+
import { ackContext } from "../../service/cimux-mailbox-service.js";
|
|
2
|
+
import { readString, requireString, withStore, writeJson } from "../shared.js";
|
|
3
|
+
export const ackCommand = {
|
|
4
|
+
name: "ack",
|
|
5
|
+
usage: "cimux ack --mailbox <harness/name> --id <context-id> [--note <note>]",
|
|
6
|
+
options: {
|
|
7
|
+
mailbox: { type: "string" },
|
|
8
|
+
id: { type: "string" },
|
|
9
|
+
note: { type: "string" }
|
|
10
|
+
},
|
|
11
|
+
run(context) {
|
|
12
|
+
return withStore(context.env, async (store) => {
|
|
13
|
+
const note = readString(context.values, "note");
|
|
14
|
+
const result = await ackContext(store, {
|
|
15
|
+
mailbox: requireString(context.values, "mailbox"),
|
|
16
|
+
id: requireString(context.values, "id"),
|
|
17
|
+
...(note === undefined ? {} : { note })
|
|
18
|
+
});
|
|
19
|
+
writeJson(context.io, result);
|
|
20
|
+
return 0;
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
//# sourceMappingURL=ack.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ack.js","sourceRoot":"","sources":["../../../src/cli/commands/ack.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,wCAAwC,CAAC;AACpE,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAG/E,MAAM,CAAC,MAAM,UAAU,GAAgB;IACrC,IAAI,EAAE,KAAK;IACX,KAAK,EAAE,sEAAsE;IAC7E,OAAO,EAAE;QACP,OAAO,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;QAC3B,EAAE,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;QACtB,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;KACzB;IACD,GAAG,CAAC,OAAO;QACT,OAAO,SAAS,CAAC,OAAO,CAAC,GAAG,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE;YAC5C,MAAM,IAAI,GAAG,UAAU,CAAC,OAAO,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;YAChD,MAAM,MAAM,GAAG,MAAM,UAAU,CAAC,KAAK,EAAE;gBACrC,OAAO,EAAE,aAAa,CAAC,OAAO,CAAC,MAAM,EAAE,SAAS,CAAC;gBACjD,EAAE,EAAE,aAAa,CAAC,OAAO,CAAC,MAAM,EAAE,IAAI,CAAC;gBACvC,GAAG,CAAC,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC;aACxC,CAAC,CAAC;YACH,SAAS,CAAC,OAAO,CAAC,EAAE,EAAE,MAAM,CAAC,CAAC;YAC9B,OAAO,CAAC,CAAC;QACX,CAAC,CAAC,CAAC;IACL,CAAC;CACF,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { createSessionBrief } from "../../service/cimux-mailbox-service.js";
|
|
2
|
+
import { resolveRuntimeMailboxFromArgs, withStore } from "../shared.js";
|
|
3
|
+
export const briefCommand = {
|
|
4
|
+
name: "brief",
|
|
5
|
+
usage: "cimux brief [--mailbox <harness/name> | --harness <name>]",
|
|
6
|
+
options: {
|
|
7
|
+
mailbox: { type: "string" },
|
|
8
|
+
harness: { type: "string" }
|
|
9
|
+
},
|
|
10
|
+
run(context) {
|
|
11
|
+
return withStore(context.env, async (store) => {
|
|
12
|
+
const { mailbox } = resolveRuntimeMailboxFromArgs(context);
|
|
13
|
+
// Runs from a SessionStart hook: register the session's mailbox, then
|
|
14
|
+
// print the norms so agents use Cimux without being prompted.
|
|
15
|
+
await store.createMailbox(mailbox);
|
|
16
|
+
const result = await createSessionBrief(store, { mailbox });
|
|
17
|
+
context.io.log(result.message);
|
|
18
|
+
return 0;
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
//# sourceMappingURL=brief.js.map
|
|
@@ -0,0 +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,OAAO,EAAE,CAAC,CAAC;YAC5D,OAAO,CAAC,EAAE,CAAC,GAAG,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;YAC/B,OAAO,CAAC,CAAC;QACX,CAAC,CAAC,CAAC;IACL,CAAC;CACF,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { checkInbox } from "../../service/cimux-mailbox-service.js";
|
|
2
|
+
import { readString, requireString, withStore, writeJson } from "../shared.js";
|
|
3
|
+
export const checkCommand = {
|
|
4
|
+
name: "check",
|
|
5
|
+
usage: "cimux check --mailbox <harness/name> [--all] [--limit <n>]",
|
|
6
|
+
options: {
|
|
7
|
+
mailbox: { type: "string" },
|
|
8
|
+
all: { type: "boolean" },
|
|
9
|
+
limit: { type: "string" }
|
|
10
|
+
},
|
|
11
|
+
run(context) {
|
|
12
|
+
return withStore(context.env, async (store) => {
|
|
13
|
+
const limit = readString(context.values, "limit");
|
|
14
|
+
const result = await checkInbox(store, {
|
|
15
|
+
mailbox: requireString(context.values, "mailbox"),
|
|
16
|
+
unreadOnly: context.values.all !== true,
|
|
17
|
+
...(limit === undefined ? {} : { limit: Number(limit) })
|
|
18
|
+
});
|
|
19
|
+
writeJson(context.io, result);
|
|
20
|
+
return 0;
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
//# sourceMappingURL=check.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"check.js","sourceRoot":"","sources":["../../../src/cli/commands/check.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,wCAAwC,CAAC;AACpE,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAG/E,MAAM,CAAC,MAAM,YAAY,GAAgB;IACvC,IAAI,EAAE,OAAO;IACb,KAAK,EAAE,4DAA4D;IACnE,OAAO,EAAE;QACP,OAAO,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;QAC3B,GAAG,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE;QACxB,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;KAC1B;IACD,GAAG,CAAC,OAAO;QACT,OAAO,SAAS,CAAC,OAAO,CAAC,GAAG,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE;YAC5C,MAAM,KAAK,GAAG,UAAU,CAAC,OAAO,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;YAClD,MAAM,MAAM,GAAG,MAAM,UAAU,CAAC,KAAK,EAAE;gBACrC,OAAO,EAAE,aAAa,CAAC,OAAO,CAAC,MAAM,EAAE,SAAS,CAAC;gBACjD,UAAU,EAAE,OAAO,CAAC,MAAM,CAAC,GAAG,KAAK,IAAI;gBACvC,GAAG,CAAC,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC;aACzD,CAAC,CAAC;YACH,SAAS,CAAC,OAAO,CAAC,EAAE,EAAE,MAAM,CAAC,CAAC;YAC9B,OAAO,CAAC,CAAC;QACX,CAAC,CAAC,CAAC;IACL,CAAC;CACF,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { applyInstallPlan, createInstallPlan } from "../../install/cimux-install-plan.js";
|
|
2
|
+
import { resolvePackageCommand } from "../shared.js";
|
|
3
|
+
export const installCommand = {
|
|
4
|
+
name: "install",
|
|
5
|
+
usage: "cimux install [--dry-run]",
|
|
6
|
+
options: {
|
|
7
|
+
"dry-run": { type: "boolean" }
|
|
8
|
+
},
|
|
9
|
+
run(context) {
|
|
10
|
+
const plan = createInstallPlan({ packageCommand: resolvePackageCommand() });
|
|
11
|
+
if (context.values["dry-run"] !== true) {
|
|
12
|
+
const results = applyInstallPlan(plan);
|
|
13
|
+
for (const result of results) {
|
|
14
|
+
const backup = result.backupPath ? ` backup: ${result.backupPath}` : "";
|
|
15
|
+
context.io.log(`${result.status}: ${result.path}${backup}`);
|
|
16
|
+
}
|
|
17
|
+
return 0;
|
|
18
|
+
}
|
|
19
|
+
for (const target of plan.targets) {
|
|
20
|
+
context.io.log(`# ${target.harness}: ${target.path}`);
|
|
21
|
+
context.io.log(`# ${target.purpose}`);
|
|
22
|
+
context.io.log(target.snippet);
|
|
23
|
+
}
|
|
24
|
+
return 0;
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
//# sourceMappingURL=install.js.map
|
|
@@ -0,0 +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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shared.js";
|
|
3
|
+
export const mailboxesCommand = {
|
|
4
|
+
name: "mailboxes",
|
|
5
|
+
usage: "cimux mailboxes",
|
|
6
|
+
options: {},
|
|
7
|
+
run(context) {
|
|
8
|
+
return withStore(context.env, async (store) => {
|
|
9
|
+
writeJson(context.io, await listMailboxes(store));
|
|
10
|
+
return 0;
|
|
11
|
+
});
|
|
12
|
+
}
|
|
13
|
+
};
|
|
14
|
+
//# sourceMappingURL=mailboxes.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mailboxes.js","sourceRoot":"","sources":["../../../src/cli/commands/mailboxes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,wCAAwC,CAAC;AACvE,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAGpD,MAAM,CAAC,MAAM,gBAAgB,GAAgB;IAC3C,IAAI,EAAE,WAAW;IACjB,KAAK,EAAE,iBAAiB;IACxB,OAAO,EAAE,EAAE;IACX,GAAG,CAAC,OAAO;QACT,OAAO,SAAS,CAAC,OAAO,CAAC,GAAG,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE;YAC5C,SAAS,CAAC,OAAO,CAAC,EAAE,EAAE,MAAM,aAAa,CAAC,KAAK,CAAC,CAAC,CAAC;YAClD,OAAO,CAAC,CAAC;QACX,CAAC,CAAC,CAAC;IACL,CAAC;CACF,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { runCimuxMcpServer } from "../../mcp/cimux-mcp-server.js";
|
|
2
|
+
export const mcpCommand = {
|
|
3
|
+
name: "mcp",
|
|
4
|
+
usage: "cimux mcp",
|
|
5
|
+
options: {},
|
|
6
|
+
async run(context) {
|
|
7
|
+
await runCimuxMcpServer(context.env.CIMUX_DB_PATH);
|
|
8
|
+
return 0;
|
|
9
|
+
}
|
|
10
|
+
};
|
|
11
|
+
//# sourceMappingURL=mcp.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mcp.js","sourceRoot":"","sources":["../../../src/cli/commands/mcp.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAGlE,MAAM,CAAC,MAAM,UAAU,GAAgB;IACrC,IAAI,EAAE,KAAK;IACX,KAAK,EAAE,WAAW;IAClB,OAAO,EAAE,EAAE;IACX,KAAK,CAAC,GAAG,CAAC,OAAO;QACf,MAAM,iBAAiB,CAAC,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;QACnD,OAAO,CAAC,CAAC;IACX,CAAC;CACF,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { createInboxNotification } from "../../service/cimux-mailbox-service.js";
|
|
2
|
+
import { resolveRuntimeMailboxFromArgs, withStore } from "../shared.js";
|
|
3
|
+
export const notifyCommand = {
|
|
4
|
+
name: "notify",
|
|
5
|
+
usage: "cimux notify [--mailbox <harness/name> | --harness <name>]",
|
|
6
|
+
options: {
|
|
7
|
+
mailbox: { type: "string" },
|
|
8
|
+
harness: { type: "string" }
|
|
9
|
+
},
|
|
10
|
+
run(context) {
|
|
11
|
+
return withStore(context.env, async (store) => {
|
|
12
|
+
const { mailbox } = resolveRuntimeMailboxFromArgs(context);
|
|
13
|
+
// Hook checks also act as a heartbeat for the current local session name.
|
|
14
|
+
// Creation is idempotent, so this does not reset existing mailbox state.
|
|
15
|
+
await store.createMailbox(mailbox);
|
|
16
|
+
const result = await createInboxNotification(store, { mailbox });
|
|
17
|
+
if (result.message) {
|
|
18
|
+
context.io.log(result.message);
|
|
19
|
+
}
|
|
20
|
+
return 0;
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
//# sourceMappingURL=notify.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"notify.js","sourceRoot":"","sources":["../../../src/cli/commands/notify.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,wCAAwC,CAAC;AACjF,OAAO,EAAE,6BAA6B,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAGxE,MAAM,CAAC,MAAM,aAAa,GAAgB;IACxC,IAAI,EAAE,QAAQ;IACd,KAAK,EAAE,4DAA4D;IACnE,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,0EAA0E;YAC1E,yEAAyE;YACzE,MAAM,KAAK,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;YACnC,MAAM,MAAM,GAAG,MAAM,uBAAuB,CAAC,KAAK,EAAE,EAAE,OAAO,EAAE,CAAC,CAAC;YACjE,IAAI,MAAM,CAAC,OAAO,EAAE,CAAC;gBACnB,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"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { readContext } from "../../service/cimux-mailbox-service.js";
|
|
2
|
+
import { requireString, withStore, writeJson } from "../shared.js";
|
|
3
|
+
export const readCommand = {
|
|
4
|
+
name: "read",
|
|
5
|
+
usage: "cimux read --mailbox <harness/name> --id <context-id>",
|
|
6
|
+
options: {
|
|
7
|
+
mailbox: { type: "string" },
|
|
8
|
+
id: { type: "string" }
|
|
9
|
+
},
|
|
10
|
+
run(context) {
|
|
11
|
+
return withStore(context.env, async (store) => {
|
|
12
|
+
const result = await readContext(store, {
|
|
13
|
+
mailbox: requireString(context.values, "mailbox"),
|
|
14
|
+
id: requireString(context.values, "id")
|
|
15
|
+
});
|
|
16
|
+
writeJson(context.io, result);
|
|
17
|
+
return 0;
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
//# sourceMappingURL=read.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"read.js","sourceRoot":"","sources":["../../../src/cli/commands/read.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,wCAAwC,CAAC;AACrE,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAGnE,MAAM,CAAC,MAAM,WAAW,GAAgB;IACtC,IAAI,EAAE,MAAM;IACZ,KAAK,EAAE,uDAAuD;IAC9D,OAAO,EAAE;QACP,OAAO,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;QAC3B,EAAE,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;KACvB;IACD,GAAG,CAAC,OAAO;QACT,OAAO,SAAS,CAAC,OAAO,CAAC,GAAG,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE;YAC5C,MAAM,MAAM,GAAG,MAAM,WAAW,CAAC,KAAK,EAAE;gBACtC,OAAO,EAAE,aAAa,CAAC,OAAO,CAAC,MAAM,EAAE,SAAS,CAAC;gBACjD,EAAE,EAAE,aAAa,CAAC,OAAO,CAAC,MAAM,EAAE,IAAI,CAAC;aACxC,CAAC,CAAC;YACH,SAAS,CAAC,OAAO,CAAC,EAAE,EAAE,MAAM,CAAC,CAAC;YAC9B,OAAO,CAAC,CAAC;QACX,CAAC,CAAC,CAAC;IACL,CAAC;CACF,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { registerSession } from "../../service/cimux-mailbox-service.js";
|
|
2
|
+
import { readString, resolveRuntimeMailboxFromArgs, withStore, writeJson } from "../shared.js";
|
|
3
|
+
export const registerCommand = {
|
|
4
|
+
name: "register",
|
|
5
|
+
usage: "cimux register [--mailbox <harness/name> | --harness <name>]",
|
|
6
|
+
options: {
|
|
7
|
+
mailbox: { type: "string" },
|
|
8
|
+
harness: { type: "string" }
|
|
9
|
+
},
|
|
10
|
+
run(context) {
|
|
11
|
+
return withStore(context.env, async (store) => {
|
|
12
|
+
const mailbox = resolveRuntimeMailboxFromArgs(context);
|
|
13
|
+
const result = await registerSession(store, {
|
|
14
|
+
harness: readString(context.values, "harness") ?? context.env.CIMUX_HARNESS ?? "codex",
|
|
15
|
+
...(mailbox.inferredFrom === "explicit"
|
|
16
|
+
? { explicitMailbox: mailbox.mailbox }
|
|
17
|
+
: {
|
|
18
|
+
branchName: mailbox.branchName ?? undefined,
|
|
19
|
+
folderName: mailbox.folderName
|
|
20
|
+
})
|
|
21
|
+
});
|
|
22
|
+
writeJson(context.io, result);
|
|
23
|
+
return 0;
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
//# sourceMappingURL=register.js.map
|