@mutmutco/cli 2.35.0 → 2.37.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/README.md +2 -0
- package/dist/main.cjs +2173 -790
- package/dist/saga.cjs +22 -14
- package/package.json +1 -1
package/dist/saga.cjs
CHANGED
|
@@ -3443,6 +3443,13 @@ var import_node_crypto3 = require("node:crypto");
|
|
|
3443
3443
|
var import_promises2 = require("node:fs/promises");
|
|
3444
3444
|
|
|
3445
3445
|
// src/issue-body.ts
|
|
3446
|
+
var import_node_os = require("node:os");
|
|
3447
|
+
function emptyStdinMessage(fileFlag) {
|
|
3448
|
+
if ((0, import_node_os.platform)() === "win32") {
|
|
3449
|
+
return `${fileFlag} - read empty stdin (on Windows, ${fileFlag} - is unreliable through the npm .cmd shim \u2014 use ${fileFlag} <path>, or pipe to \`node cli/dist/index.cjs\` directly)`;
|
|
3450
|
+
}
|
|
3451
|
+
return `${fileFlag} - read empty stdin (nothing piped \u2014 pass a heredoc/pipe, or ${fileFlag} <path>)`;
|
|
3452
|
+
}
|
|
3446
3453
|
async function resolveTextArg(input, deps, labels) {
|
|
3447
3454
|
const hasValue = input.value !== void 0;
|
|
3448
3455
|
const hasFile = input.file !== void 0;
|
|
@@ -3457,7 +3464,7 @@ async function resolveTextArg(input, deps, labels) {
|
|
|
3457
3464
|
const text = source === "-" ? await deps.readStdin() : await deps.readFile(source, "utf8");
|
|
3458
3465
|
if (text.trim().length === 0) {
|
|
3459
3466
|
throw new Error(
|
|
3460
|
-
source === "-" ?
|
|
3467
|
+
source === "-" ? emptyStdinMessage(labels.file) : `${labels.file} produced an empty ${labels.noun}`
|
|
3461
3468
|
);
|
|
3462
3469
|
}
|
|
3463
3470
|
return text;
|
|
@@ -3481,9 +3488,9 @@ var HEAD_MIN_INTERVAL_MS = 5 * 60 * 1e3;
|
|
|
3481
3488
|
var HEAD_ENGINE_TIMEOUT_MS = 15e3;
|
|
3482
3489
|
var HEAD_PROMPT_ACTION_LIMIT = 50;
|
|
3483
3490
|
var HEAD_PROMPT_DECISION_LIMIT = 80;
|
|
3484
|
-
function resolveEngine(
|
|
3491
|
+
function resolveEngine(platform2, custom) {
|
|
3485
3492
|
if (custom) return { cmd: custom, args: [], shell: true };
|
|
3486
|
-
return { cmd: "claude", args: ["-p", "--no-session-persistence"], shell:
|
|
3493
|
+
return { cmd: "claude", args: ["-p", "--no-session-persistence"], shell: platform2 === "win32" };
|
|
3487
3494
|
}
|
|
3488
3495
|
function headTsPath(key) {
|
|
3489
3496
|
const safe = (s) => s.replace(/[^A-Za-z0-9._-]/g, "_");
|
|
@@ -3888,6 +3895,7 @@ function buildNoteCapture(summary, o, id, evidence) {
|
|
|
3888
3895
|
next: o.next,
|
|
3889
3896
|
decision: o.decision,
|
|
3890
3897
|
queueOp,
|
|
3898
|
+
handoffClose: o.handoffClose,
|
|
3891
3899
|
state,
|
|
3892
3900
|
source,
|
|
3893
3901
|
evidence: Object.keys(ev).length ? ev : void 0,
|
|
@@ -4209,7 +4217,7 @@ function formatSnapshotHuman(snapshot) {
|
|
|
4209
4217
|
var import_node_crypto = require("node:crypto");
|
|
4210
4218
|
var import_node_fs5 = require("node:fs");
|
|
4211
4219
|
var import_node_path5 = require("node:path");
|
|
4212
|
-
var
|
|
4220
|
+
var import_node_os2 = require("node:os");
|
|
4213
4221
|
var REFRESH_WINDOW_MS = 10 * 60 * 1e3;
|
|
4214
4222
|
var EXCHANGE_TIMEOUT_MS = 8e3;
|
|
4215
4223
|
var EXCHANGE_ATTEMPTS = 2;
|
|
@@ -4222,10 +4230,10 @@ function tokenFingerprint(token) {
|
|
|
4222
4230
|
function defaultHubSessionCachePath(env = process.env) {
|
|
4223
4231
|
if (env.MMI_HUB_SESSION_CACHE) return env.MMI_HUB_SESSION_CACHE;
|
|
4224
4232
|
if (process.platform === "win32") {
|
|
4225
|
-
const base2 = env.LOCALAPPDATA || (0, import_node_path5.join)((0,
|
|
4233
|
+
const base2 = env.LOCALAPPDATA || (0, import_node_path5.join)((0, import_node_os2.homedir)(), "AppData", "Local");
|
|
4226
4234
|
return (0, import_node_path5.join)(base2, "MMI Future", "mmi-cli", "hub-session.json");
|
|
4227
4235
|
}
|
|
4228
|
-
const base = env.XDG_STATE_HOME || (0, import_node_path5.join)((0,
|
|
4236
|
+
const base = env.XDG_STATE_HOME || (0, import_node_path5.join)((0, import_node_os2.homedir)(), ".mmi");
|
|
4229
4237
|
return (0, import_node_path5.join)(base, "mmi-cli", "hub-session.json");
|
|
4230
4238
|
}
|
|
4231
4239
|
function readCache(path2, apiUrl, now, githubTokenFingerprint) {
|
|
@@ -4833,7 +4841,7 @@ function runSagaCli(injectedStdin2) {
|
|
|
4833
4841
|
var import_node_net = require("node:net");
|
|
4834
4842
|
var import_node_crypto5 = require("node:crypto");
|
|
4835
4843
|
var import_node_fs10 = require("node:fs");
|
|
4836
|
-
var
|
|
4844
|
+
var import_node_os4 = require("node:os");
|
|
4837
4845
|
|
|
4838
4846
|
// src/daemon-client.ts
|
|
4839
4847
|
var import_node_fs9 = require("node:fs");
|
|
@@ -4842,7 +4850,7 @@ var import_node_path7 = require("node:path");
|
|
|
4842
4850
|
// src/daemon-protocol.ts
|
|
4843
4851
|
var import_node_crypto4 = require("node:crypto");
|
|
4844
4852
|
var import_node_fs8 = require("node:fs");
|
|
4845
|
-
var
|
|
4853
|
+
var import_node_os3 = require("node:os");
|
|
4846
4854
|
var import_node_path6 = require("node:path");
|
|
4847
4855
|
var DEFAULT_IDLE_EXIT_MS = 30 * 6e4;
|
|
4848
4856
|
function idleExitMs(env = process.env) {
|
|
@@ -4850,7 +4858,7 @@ function idleExitMs(env = process.env) {
|
|
|
4850
4858
|
return Number.isFinite(n) && n > 0 ? n : DEFAULT_IDLE_EXIT_MS;
|
|
4851
4859
|
}
|
|
4852
4860
|
function daemonDir(env = process.env) {
|
|
4853
|
-
return env.MMI_CLI_DAEMON_DIR || (0, import_node_path6.join)((0,
|
|
4861
|
+
return env.MMI_CLI_DAEMON_DIR || (0, import_node_path6.join)((0, import_node_os3.homedir)(), ".mmi");
|
|
4854
4862
|
}
|
|
4855
4863
|
function tokenPath(env = process.env) {
|
|
4856
4864
|
return (0, import_node_path6.join)(daemonDir(env), "daemon-token");
|
|
@@ -4871,18 +4879,18 @@ function tokensEqual(a, b) {
|
|
|
4871
4879
|
const hb = (0, import_node_crypto4.createHash)("sha256").update(b).digest();
|
|
4872
4880
|
return (0, import_node_crypto4.timingSafeEqual)(ha, hb);
|
|
4873
4881
|
}
|
|
4874
|
-
function socketPath(env = process.env,
|
|
4882
|
+
function socketPath(env = process.env, platform2 = process.platform, user) {
|
|
4875
4883
|
if (env.MMI_CLI_DAEMON_SOCKET) return env.MMI_CLI_DAEMON_SOCKET;
|
|
4876
4884
|
let name = user;
|
|
4877
4885
|
if (!name) {
|
|
4878
4886
|
try {
|
|
4879
|
-
name = (0,
|
|
4887
|
+
name = (0, import_node_os3.userInfo)().username;
|
|
4880
4888
|
} catch {
|
|
4881
4889
|
name = env.USERNAME || env.USER || "default";
|
|
4882
4890
|
}
|
|
4883
4891
|
}
|
|
4884
4892
|
const hash = (0, import_node_crypto4.createHash)("sha256").update(name).digest("hex").slice(0, 12);
|
|
4885
|
-
return
|
|
4893
|
+
return platform2 === "win32" ? `\\\\.\\pipe\\mmi-cli-${hash}` : (0, import_node_path6.join)(daemonDir(env), `mmi-cli-${hash}.sock`);
|
|
4886
4894
|
}
|
|
4887
4895
|
var HOT_VERBS = /* @__PURE__ */ new Set(["note", "probe", "capture", "session", "head-update"]);
|
|
4888
4896
|
function argvReadsStdin(args) {
|
|
@@ -4973,7 +4981,7 @@ async function handleRequest(req, stamp) {
|
|
|
4973
4981
|
console.error = orig.error;
|
|
4974
4982
|
setInjectedStdin(void 0);
|
|
4975
4983
|
try {
|
|
4976
|
-
process.chdir((0,
|
|
4984
|
+
process.chdir((0, import_node_os4.tmpdir)());
|
|
4977
4985
|
} catch {
|
|
4978
4986
|
}
|
|
4979
4987
|
}
|
|
@@ -5095,7 +5103,7 @@ function startDaemon(deps = {}) {
|
|
|
5095
5103
|
}
|
|
5096
5104
|
function runDaemon() {
|
|
5097
5105
|
try {
|
|
5098
|
-
process.chdir((0,
|
|
5106
|
+
process.chdir((0, import_node_os4.tmpdir)());
|
|
5099
5107
|
} catch {
|
|
5100
5108
|
}
|
|
5101
5109
|
process.on("uncaughtException", () => process.exit(1));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mutmutco/cli",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.37.0",
|
|
4
4
|
"description": "MMI Future CLI — delivers the org rules (whole-file), plus saga and KB access. The cross-IDE engine the plugin's SessionStart hook drives.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "UNLICENSED",
|