maxsimcli 4.8.0 → 4.10.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 +180 -202
- package/dist/assets/CHANGELOG.md +61 -0
- package/dist/assets/hooks/maxsim-check-update.cjs +38 -0
- package/dist/assets/hooks/maxsim-check-update.cjs.map +1 -1
- package/dist/assets/hooks/maxsim-statusline.cjs +116 -48
- package/dist/assets/hooks/maxsim-statusline.cjs.map +1 -1
- package/dist/assets/hooks/maxsim-sync-reminder.cjs +117 -0
- package/dist/assets/hooks/maxsim-sync-reminder.cjs.map +1 -0
- package/dist/assets/templates/agents/AGENTS.md +78 -106
- package/dist/assets/templates/agents/executor.md +101 -0
- package/dist/assets/templates/agents/planner.md +86 -0
- package/dist/assets/templates/agents/researcher.md +71 -0
- package/dist/assets/templates/agents/verifier.md +88 -0
- package/dist/assets/templates/commands/maxsim/debug.md +7 -7
- package/dist/assets/templates/commands/maxsim/execute.md +45 -0
- package/dist/assets/templates/commands/maxsim/go.md +29 -0
- package/dist/assets/templates/commands/maxsim/help.md +2 -2
- package/dist/assets/templates/commands/maxsim/init.md +52 -0
- package/dist/assets/templates/commands/maxsim/plan.md +50 -0
- package/dist/assets/templates/commands/maxsim/progress.md +4 -3
- package/dist/assets/templates/commands/maxsim/quick.md +6 -4
- package/dist/assets/templates/commands/maxsim/settings.md +4 -3
- package/dist/assets/templates/references/continuation-format.md +16 -16
- package/dist/assets/templates/references/model-profile-resolution.md +1 -1
- package/dist/assets/templates/references/model-profiles.md +12 -19
- package/dist/assets/templates/rules/conventions.md +51 -0
- package/dist/assets/templates/rules/verification-protocol.md +57 -0
- package/dist/assets/templates/skills/agent-system-map/SKILL.md +92 -0
- package/dist/assets/templates/skills/brainstorming/SKILL.md +48 -36
- package/dist/assets/templates/skills/code-review/SKILL.md +40 -61
- package/dist/assets/templates/skills/commit-conventions/SKILL.md +75 -0
- package/dist/assets/templates/skills/evidence-collection/SKILL.md +87 -0
- package/dist/assets/templates/skills/handoff-contract/SKILL.md +70 -0
- package/dist/assets/templates/skills/input-validation/SKILL.md +51 -0
- package/dist/assets/templates/skills/maxsim-batch/SKILL.md +41 -45
- package/dist/assets/templates/skills/maxsim-simplify/SKILL.md +37 -90
- package/dist/assets/templates/skills/memory-management/SKILL.md +32 -67
- package/dist/assets/templates/skills/research-methodology/SKILL.md +137 -0
- package/dist/assets/templates/skills/roadmap-writing/SKILL.md +40 -58
- package/dist/assets/templates/skills/sdd/SKILL.md +34 -69
- package/dist/assets/templates/skills/systematic-debugging/SKILL.md +20 -26
- package/dist/assets/templates/skills/tdd/SKILL.md +25 -33
- package/dist/assets/templates/skills/tool-priority-guide/SKILL.md +80 -0
- package/dist/assets/templates/skills/using-maxsim/SKILL.md +42 -73
- package/dist/assets/templates/skills/verification-before-completion/SKILL.md +12 -24
- package/dist/assets/templates/skills/verification-gates/SKILL.md +169 -0
- package/dist/assets/templates/templates/UAT.md +3 -3
- package/dist/assets/templates/templates/VALIDATION.md +1 -1
- package/dist/assets/templates/templates/context.md +4 -4
- package/dist/assets/templates/templates/debug-subagent-prompt.md +3 -3
- package/dist/assets/templates/templates/discovery.md +2 -2
- package/dist/assets/templates/templates/phase-prompt.md +2 -2
- package/dist/assets/templates/templates/planner-subagent-prompt.md +7 -7
- package/dist/assets/templates/templates/project.md +1 -1
- package/dist/assets/templates/templates/research.md +1 -1
- package/dist/assets/templates/templates/state.md +2 -2
- package/dist/assets/templates/templates/summary.md +41 -0
- package/dist/assets/templates/workflows/batch.md +5 -5
- package/dist/assets/templates/workflows/diagnose-issues.md +2 -2
- package/dist/assets/templates/workflows/discovery-phase.md +3 -3
- package/dist/assets/templates/workflows/discuss-phase.md +11 -11
- package/dist/assets/templates/workflows/execute-phase.md +205 -11
- package/dist/assets/templates/workflows/execute-plan.md +299 -34
- package/dist/assets/templates/workflows/execute.md +421 -0
- package/dist/assets/templates/workflows/go.md +250 -0
- package/dist/assets/templates/workflows/health.md +5 -5
- package/dist/assets/templates/workflows/help.md +165 -435
- package/dist/assets/templates/workflows/init-existing.md +23 -23
- package/dist/assets/templates/workflows/init.md +205 -0
- package/dist/assets/templates/workflows/new-milestone.md +9 -9
- package/dist/assets/templates/workflows/new-project.md +26 -26
- package/dist/assets/templates/workflows/plan-create.md +298 -0
- package/dist/assets/templates/workflows/plan-discuss.md +347 -0
- package/dist/assets/templates/workflows/plan-phase.md +29 -29
- package/dist/assets/templates/workflows/plan-research.md +177 -0
- package/dist/assets/templates/workflows/plan.md +231 -0
- package/dist/assets/templates/workflows/progress.md +46 -42
- package/dist/assets/templates/workflows/quick.md +195 -14
- package/dist/assets/templates/workflows/research-phase.md +5 -5
- package/dist/assets/templates/workflows/sdd.md +20 -12
- package/dist/assets/templates/workflows/settings.md +18 -14
- package/dist/assets/templates/workflows/verify-phase.md +1 -1
- package/dist/assets/templates/workflows/verify-work.md +16 -16
- package/dist/cli.cjs +4589 -229
- package/dist/cli.cjs.map +1 -1
- package/dist/core-D5zUr9cb.cjs.map +1 -1
- package/dist/install.cjs +234 -17
- package/dist/install.cjs.map +1 -1
- package/dist/mcp-server.cjs +298 -20
- package/dist/mcp-server.cjs.map +1 -1
- package/dist/skills-CjFWZIGM.cjs.map +1 -1
- package/package.json +1 -1
- package/dist/assets/hooks/maxsim-context-monitor.cjs +0 -121
- package/dist/assets/hooks/maxsim-context-monitor.cjs.map +0 -1
- package/dist/assets/templates/agents/maxsim-code-reviewer.md +0 -239
- package/dist/assets/templates/agents/maxsim-codebase-mapper.md +0 -214
- package/dist/assets/templates/agents/maxsim-debugger.md +0 -572
- package/dist/assets/templates/agents/maxsim-drift-checker.md +0 -522
- package/dist/assets/templates/agents/maxsim-executor.md +0 -504
- package/dist/assets/templates/agents/maxsim-integration-checker.md +0 -273
- package/dist/assets/templates/agents/maxsim-phase-researcher.md +0 -305
- package/dist/assets/templates/agents/maxsim-plan-checker.md +0 -343
- package/dist/assets/templates/agents/maxsim-planner.md +0 -610
- package/dist/assets/templates/agents/maxsim-project-researcher.md +0 -359
- package/dist/assets/templates/agents/maxsim-research-synthesizer.md +0 -263
- package/dist/assets/templates/agents/maxsim-roadmapper.md +0 -324
- package/dist/assets/templates/agents/maxsim-spec-reviewer.md +0 -245
- package/dist/assets/templates/agents/maxsim-verifier.md +0 -393
- package/dist/assets/templates/commands/maxsim/add-phase.md +0 -43
- package/dist/assets/templates/commands/maxsim/add-tests.md +0 -41
- package/dist/assets/templates/commands/maxsim/add-todo.md +0 -57
- package/dist/assets/templates/commands/maxsim/artefakte.md +0 -122
- package/dist/assets/templates/commands/maxsim/audit-milestone.md +0 -36
- package/dist/assets/templates/commands/maxsim/batch.md +0 -42
- package/dist/assets/templates/commands/maxsim/check-drift.md +0 -56
- package/dist/assets/templates/commands/maxsim/check-todos.md +0 -46
- package/dist/assets/templates/commands/maxsim/cleanup.md +0 -18
- package/dist/assets/templates/commands/maxsim/complete-milestone.md +0 -136
- package/dist/assets/templates/commands/maxsim/discuss-phase.md +0 -87
- package/dist/assets/templates/commands/maxsim/discuss.md +0 -70
- package/dist/assets/templates/commands/maxsim/execute-phase.md +0 -41
- package/dist/assets/templates/commands/maxsim/health.md +0 -22
- package/dist/assets/templates/commands/maxsim/init-existing.md +0 -46
- package/dist/assets/templates/commands/maxsim/insert-phase.md +0 -32
- package/dist/assets/templates/commands/maxsim/list-phase-assumptions.md +0 -46
- package/dist/assets/templates/commands/maxsim/map-codebase.md +0 -71
- package/dist/assets/templates/commands/maxsim/new-milestone.md +0 -44
- package/dist/assets/templates/commands/maxsim/new-project.md +0 -46
- package/dist/assets/templates/commands/maxsim/pause-work.md +0 -38
- package/dist/assets/templates/commands/maxsim/plan-milestone-gaps.md +0 -34
- package/dist/assets/templates/commands/maxsim/plan-phase.md +0 -44
- package/dist/assets/templates/commands/maxsim/realign.md +0 -39
- package/dist/assets/templates/commands/maxsim/reapply-patches.md +0 -110
- package/dist/assets/templates/commands/maxsim/remove-phase.md +0 -31
- package/dist/assets/templates/commands/maxsim/research-phase.md +0 -189
- package/dist/assets/templates/commands/maxsim/resume-work.md +0 -40
- package/dist/assets/templates/commands/maxsim/roadmap.md +0 -19
- package/dist/assets/templates/commands/maxsim/sdd.md +0 -39
- package/dist/assets/templates/commands/maxsim/set-profile.md +0 -34
- package/dist/assets/templates/commands/maxsim/update.md +0 -37
- package/dist/assets/templates/commands/maxsim/verify-work.md +0 -38
- package/dist/assets/templates/workflows/add-phase.md +0 -111
- package/dist/assets/templates/workflows/add-tests.md +0 -351
- package/dist/assets/templates/workflows/add-todo.md +0 -247
- package/dist/assets/templates/workflows/audit-milestone.md +0 -297
- package/dist/assets/templates/workflows/check-drift.md +0 -248
- package/dist/assets/templates/workflows/check-todos.md +0 -261
- package/dist/assets/templates/workflows/cleanup.md +0 -153
- package/dist/assets/templates/workflows/complete-milestone.md +0 -701
- package/dist/assets/templates/workflows/discuss.md +0 -343
- package/dist/assets/templates/workflows/insert-phase.md +0 -129
- package/dist/assets/templates/workflows/list-phase-assumptions.md +0 -178
- package/dist/assets/templates/workflows/map-codebase.md +0 -315
- package/dist/assets/templates/workflows/pause-work.md +0 -122
- package/dist/assets/templates/workflows/plan-milestone-gaps.md +0 -274
- package/dist/assets/templates/workflows/realign.md +0 -288
- package/dist/assets/templates/workflows/remove-phase.md +0 -154
- package/dist/assets/templates/workflows/resume-project.md +0 -306
- package/dist/assets/templates/workflows/roadmap.md +0 -130
- package/dist/assets/templates/workflows/set-profile.md +0 -81
- package/dist/assets/templates/workflows/transition.md +0 -544
- package/dist/assets/templates/workflows/update.md +0 -220
package/dist/install.cjs
CHANGED
|
@@ -46,6 +46,7 @@ let node_readline = require("node:readline");
|
|
|
46
46
|
node_readline = __toESM(node_readline);
|
|
47
47
|
let node_crypto = require("node:crypto");
|
|
48
48
|
node_crypto = __toESM(node_crypto);
|
|
49
|
+
let node_child_process = require("node:child_process");
|
|
49
50
|
|
|
50
51
|
//#region ../../node_modules/universalify/index.js
|
|
51
52
|
var require_universalify = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
@@ -7290,7 +7291,15 @@ const builtInSkills = [
|
|
|
7290
7291
|
"brainstorming",
|
|
7291
7292
|
"roadmap-writing",
|
|
7292
7293
|
"sdd",
|
|
7293
|
-
"maxsim-batch"
|
|
7294
|
+
"maxsim-batch",
|
|
7295
|
+
"agent-system-map",
|
|
7296
|
+
"commit-conventions",
|
|
7297
|
+
"evidence-collection",
|
|
7298
|
+
"handoff-contract",
|
|
7299
|
+
"input-validation",
|
|
7300
|
+
"research-methodology",
|
|
7301
|
+
"tool-priority-guide",
|
|
7302
|
+
"verification-gates"
|
|
7294
7303
|
];
|
|
7295
7304
|
/**
|
|
7296
7305
|
* Get the global config directory for Claude Code.
|
|
@@ -7429,7 +7438,79 @@ function getCommitAttribution(explicitConfigDir) {
|
|
|
7429
7438
|
* Clean up orphaned files from previous MAXSIM versions
|
|
7430
7439
|
*/
|
|
7431
7440
|
function cleanupOrphanedFiles(configDir) {
|
|
7432
|
-
for (const relPath of [
|
|
7441
|
+
for (const relPath of [
|
|
7442
|
+
"hooks/maxsim-notify.sh",
|
|
7443
|
+
"hooks/statusline.js",
|
|
7444
|
+
"commands/maxsim/add-phase.md",
|
|
7445
|
+
"commands/maxsim/add-tests.md",
|
|
7446
|
+
"commands/maxsim/add-todo.md",
|
|
7447
|
+
"commands/maxsim/artefakte.md",
|
|
7448
|
+
"commands/maxsim/audit-milestone.md",
|
|
7449
|
+
"commands/maxsim/batch.md",
|
|
7450
|
+
"commands/maxsim/check-drift.md",
|
|
7451
|
+
"commands/maxsim/check-todos.md",
|
|
7452
|
+
"commands/maxsim/cleanup.md",
|
|
7453
|
+
"commands/maxsim/complete-milestone.md",
|
|
7454
|
+
"commands/maxsim/discuss-phase.md",
|
|
7455
|
+
"commands/maxsim/discuss.md",
|
|
7456
|
+
"commands/maxsim/execute-phase.md",
|
|
7457
|
+
"commands/maxsim/health.md",
|
|
7458
|
+
"commands/maxsim/init-existing.md",
|
|
7459
|
+
"commands/maxsim/insert-phase.md",
|
|
7460
|
+
"commands/maxsim/list-phase-assumptions.md",
|
|
7461
|
+
"commands/maxsim/map-codebase.md",
|
|
7462
|
+
"commands/maxsim/new-milestone.md",
|
|
7463
|
+
"commands/maxsim/new-project.md",
|
|
7464
|
+
"commands/maxsim/pause-work.md",
|
|
7465
|
+
"commands/maxsim/plan-milestone-gaps.md",
|
|
7466
|
+
"commands/maxsim/plan-phase.md",
|
|
7467
|
+
"commands/maxsim/realign.md",
|
|
7468
|
+
"commands/maxsim/reapply-patches.md",
|
|
7469
|
+
"commands/maxsim/remove-phase.md",
|
|
7470
|
+
"commands/maxsim/research-phase.md",
|
|
7471
|
+
"commands/maxsim/resume-work.md",
|
|
7472
|
+
"commands/maxsim/roadmap.md",
|
|
7473
|
+
"commands/maxsim/sdd.md",
|
|
7474
|
+
"commands/maxsim/set-profile.md",
|
|
7475
|
+
"commands/maxsim/update.md",
|
|
7476
|
+
"commands/maxsim/verify-work.md",
|
|
7477
|
+
"agents/maxsim-code-reviewer.md",
|
|
7478
|
+
"agents/maxsim-codebase-mapper.md",
|
|
7479
|
+
"agents/maxsim-debugger.md",
|
|
7480
|
+
"agents/maxsim-drift-checker.md",
|
|
7481
|
+
"agents/maxsim-executor.md",
|
|
7482
|
+
"agents/maxsim-integration-checker.md",
|
|
7483
|
+
"agents/maxsim-phase-researcher.md",
|
|
7484
|
+
"agents/maxsim-plan-checker.md",
|
|
7485
|
+
"agents/maxsim-planner.md",
|
|
7486
|
+
"agents/maxsim-project-researcher.md",
|
|
7487
|
+
"agents/maxsim-research-synthesizer.md",
|
|
7488
|
+
"agents/maxsim-roadmapper.md",
|
|
7489
|
+
"agents/maxsim-spec-reviewer.md",
|
|
7490
|
+
"agents/maxsim-verifier.md",
|
|
7491
|
+
"hooks/maxsim-context-monitor.js",
|
|
7492
|
+
"maxsim/workflows/add-phase.md",
|
|
7493
|
+
"maxsim/workflows/add-tests.md",
|
|
7494
|
+
"maxsim/workflows/add-todo.md",
|
|
7495
|
+
"maxsim/workflows/audit-milestone.md",
|
|
7496
|
+
"maxsim/workflows/check-drift.md",
|
|
7497
|
+
"maxsim/workflows/check-todos.md",
|
|
7498
|
+
"maxsim/workflows/cleanup.md",
|
|
7499
|
+
"maxsim/workflows/complete-milestone.md",
|
|
7500
|
+
"maxsim/workflows/discuss.md",
|
|
7501
|
+
"maxsim/workflows/insert-phase.md",
|
|
7502
|
+
"maxsim/workflows/list-phase-assumptions.md",
|
|
7503
|
+
"maxsim/workflows/map-codebase.md",
|
|
7504
|
+
"maxsim/workflows/pause-work.md",
|
|
7505
|
+
"maxsim/workflows/plan-milestone-gaps.md",
|
|
7506
|
+
"maxsim/workflows/realign.md",
|
|
7507
|
+
"maxsim/workflows/remove-phase.md",
|
|
7508
|
+
"maxsim/workflows/resume-project.md",
|
|
7509
|
+
"maxsim/workflows/roadmap.md",
|
|
7510
|
+
"maxsim/workflows/set-profile.md",
|
|
7511
|
+
"maxsim/workflows/transition.md",
|
|
7512
|
+
"maxsim/workflows/update.md"
|
|
7513
|
+
]) {
|
|
7433
7514
|
const fullPath = node_path.join(configDir, relPath);
|
|
7434
7515
|
if (node_fs.existsSync(fullPath)) {
|
|
7435
7516
|
node_fs.unlinkSync(fullPath);
|
|
@@ -7446,7 +7527,8 @@ function cleanupOrphanedHooks(settings) {
|
|
|
7446
7527
|
"hooks/statusline.js",
|
|
7447
7528
|
"maxsim-intel-index.js",
|
|
7448
7529
|
"maxsim-intel-session.js",
|
|
7449
|
-
"maxsim-intel-prune.js"
|
|
7530
|
+
"maxsim-intel-prune.js",
|
|
7531
|
+
"maxsim-context-monitor"
|
|
7450
7532
|
];
|
|
7451
7533
|
let cleanedHooks = false;
|
|
7452
7534
|
const hooks = settings.hooks;
|
|
@@ -7513,7 +7595,7 @@ function configureSettingsHooks(targetDir, isGlobal) {
|
|
|
7513
7595
|
const settings = cleanupOrphanedHooks(readSettings(settingsPath));
|
|
7514
7596
|
const statuslineCommand = isGlobal ? buildHookCommand(targetDir, "maxsim-statusline.js") : "node " + dirName + "/hooks/maxsim-statusline.js";
|
|
7515
7597
|
const updateCheckCommand = isGlobal ? buildHookCommand(targetDir, "maxsim-check-update.js") : "node " + dirName + "/hooks/maxsim-check-update.js";
|
|
7516
|
-
const
|
|
7598
|
+
const syncReminderCommand = isGlobal ? buildHookCommand(targetDir, "maxsim-sync-reminder.js") : "node " + dirName + "/hooks/maxsim-sync-reminder.js";
|
|
7517
7599
|
if (!settings.hooks) settings.hooks = {};
|
|
7518
7600
|
const installHooks = settings.hooks;
|
|
7519
7601
|
if (!installHooks.SessionStart) installHooks.SessionStart = [];
|
|
@@ -7525,19 +7607,22 @@ function configureSettingsHooks(targetDir, isGlobal) {
|
|
|
7525
7607
|
console.log(` ${chalk.green("✓")} Configured update check hook`);
|
|
7526
7608
|
}
|
|
7527
7609
|
if (!installHooks.PostToolUse) installHooks.PostToolUse = [];
|
|
7528
|
-
if (!installHooks.PostToolUse.some((entry) => entry.hooks && entry.hooks.some((h) => h.command && h.command.includes("maxsim-
|
|
7529
|
-
installHooks.PostToolUse.push({
|
|
7530
|
-
|
|
7531
|
-
|
|
7532
|
-
|
|
7533
|
-
|
|
7610
|
+
if (!installHooks.PostToolUse.some((entry) => entry.hooks && entry.hooks.some((h) => h.command && h.command.includes("maxsim-sync-reminder")))) {
|
|
7611
|
+
installHooks.PostToolUse.push({
|
|
7612
|
+
matcher: "Write|Edit",
|
|
7613
|
+
hooks: [{
|
|
7614
|
+
type: "command",
|
|
7615
|
+
command: syncReminderCommand
|
|
7616
|
+
}]
|
|
7617
|
+
});
|
|
7618
|
+
console.log(` ${chalk.green("✓")} Configured sync reminder hook`);
|
|
7534
7619
|
}
|
|
7535
7620
|
return {
|
|
7536
7621
|
settingsPath,
|
|
7537
7622
|
settings,
|
|
7538
7623
|
statuslineCommand,
|
|
7539
7624
|
updateCheckCommand,
|
|
7540
|
-
|
|
7625
|
+
syncReminderCommand
|
|
7541
7626
|
};
|
|
7542
7627
|
}
|
|
7543
7628
|
/**
|
|
@@ -7561,8 +7646,8 @@ async function handleStatusline(settings, isInteractive, forceStatusline) {
|
|
|
7561
7646
|
console.log();
|
|
7562
7647
|
console.log(" MAXSIM includes a statusline showing:");
|
|
7563
7648
|
console.log(" • Model name");
|
|
7564
|
-
console.log(" • Current
|
|
7565
|
-
console.log(" •
|
|
7649
|
+
console.log(" • Current phase number");
|
|
7650
|
+
console.log(" • Milestone progress percentage");
|
|
7566
7651
|
console.log();
|
|
7567
7652
|
return await dist_default({
|
|
7568
7653
|
message: "Replace with MAXSIM statusline?",
|
|
@@ -7588,6 +7673,103 @@ function finishInstall(settingsPath, settings, statuslineCommand, shouldInstallS
|
|
|
7588
7673
|
`);
|
|
7589
7674
|
}
|
|
7590
7675
|
|
|
7676
|
+
//#endregion
|
|
7677
|
+
//#region src/hooks/shared.ts
|
|
7678
|
+
/** The '.claude' path segment -- template marker replaced during install. */
|
|
7679
|
+
const CLAUDE_DIR = ".claude";
|
|
7680
|
+
|
|
7681
|
+
//#endregion
|
|
7682
|
+
//#region src/hooks/maxsim-check-update.ts
|
|
7683
|
+
/**
|
|
7684
|
+
* Check for MAXSIM updates in background, write result to cache.
|
|
7685
|
+
* Called by SessionStart hook - runs once per session.
|
|
7686
|
+
*/
|
|
7687
|
+
function checkForUpdate(options) {
|
|
7688
|
+
const { homeDir, cwd } = options;
|
|
7689
|
+
const cacheDir = node_path.join(homeDir, CLAUDE_DIR, "cache");
|
|
7690
|
+
const cacheFile = node_path.join(cacheDir, "maxsim-update-check.json");
|
|
7691
|
+
const projectVersionFile = node_path.join(cwd, CLAUDE_DIR, "maxsim", "VERSION");
|
|
7692
|
+
const globalVersionFile = node_path.join(homeDir, CLAUDE_DIR, "maxsim", "VERSION");
|
|
7693
|
+
if (!node_fs.existsSync(cacheDir)) node_fs.mkdirSync(cacheDir, { recursive: true });
|
|
7694
|
+
(0, node_child_process.spawn)(process.execPath, ["-e", `
|
|
7695
|
+
const fs = require('fs');
|
|
7696
|
+
const { execSync } = require('child_process');
|
|
7697
|
+
|
|
7698
|
+
const cacheFile = ${JSON.stringify(cacheFile)};
|
|
7699
|
+
const projectVersionFile = ${JSON.stringify(projectVersionFile)};
|
|
7700
|
+
const globalVersionFile = ${JSON.stringify(globalVersionFile)};
|
|
7701
|
+
|
|
7702
|
+
// Check project directory first (local install), then global
|
|
7703
|
+
let installed = '0.0.0';
|
|
7704
|
+
try {
|
|
7705
|
+
if (fs.existsSync(projectVersionFile)) {
|
|
7706
|
+
installed = fs.readFileSync(projectVersionFile, 'utf8').trim();
|
|
7707
|
+
} else if (fs.existsSync(globalVersionFile)) {
|
|
7708
|
+
installed = fs.readFileSync(globalVersionFile, 'utf8').trim();
|
|
7709
|
+
}
|
|
7710
|
+
} catch (e) {}
|
|
7711
|
+
|
|
7712
|
+
let latest = null;
|
|
7713
|
+
try {
|
|
7714
|
+
latest = execSync('npm view maxsimcli version', { encoding: 'utf8', timeout: 10000, windowsHide: true }).trim();
|
|
7715
|
+
} catch (e) {}
|
|
7716
|
+
|
|
7717
|
+
const result = {
|
|
7718
|
+
update_available: latest && installed !== latest,
|
|
7719
|
+
installed,
|
|
7720
|
+
latest: latest || 'unknown',
|
|
7721
|
+
checked: Math.floor(Date.now() / 1000)
|
|
7722
|
+
};
|
|
7723
|
+
|
|
7724
|
+
fs.writeFileSync(cacheFile, JSON.stringify(result));
|
|
7725
|
+
`], {
|
|
7726
|
+
stdio: "ignore",
|
|
7727
|
+
windowsHide: true,
|
|
7728
|
+
detached: true
|
|
7729
|
+
}).unref();
|
|
7730
|
+
}
|
|
7731
|
+
/**
|
|
7732
|
+
* Create a backup of the current MAXSIM installation before an update.
|
|
7733
|
+
* Called by the installer (not by the SessionStart hook).
|
|
7734
|
+
*
|
|
7735
|
+
* @param cwd - The project working directory containing .claude/
|
|
7736
|
+
* @returns The backup directory path on success, null on failure.
|
|
7737
|
+
*/
|
|
7738
|
+
function createBackupBeforeUpdate(cwd) {
|
|
7739
|
+
try {
|
|
7740
|
+
const sourceDir = node_path.join(cwd, CLAUDE_DIR);
|
|
7741
|
+
const backupDir = node_path.join(sourceDir, "maxsim-backup");
|
|
7742
|
+
node_fs.mkdirSync(backupDir, { recursive: true });
|
|
7743
|
+
for (const relDir of [
|
|
7744
|
+
"commands/maxsim",
|
|
7745
|
+
"maxsim",
|
|
7746
|
+
"hooks",
|
|
7747
|
+
"agents",
|
|
7748
|
+
"skills"
|
|
7749
|
+
]) {
|
|
7750
|
+
const src = node_path.join(sourceDir, relDir);
|
|
7751
|
+
if (!node_fs.existsSync(src)) continue;
|
|
7752
|
+
const dest = node_path.join(backupDir, relDir);
|
|
7753
|
+
node_fs.mkdirSync(node_path.dirname(dest), { recursive: true });
|
|
7754
|
+
node_fs.cpSync(src, dest, { recursive: true });
|
|
7755
|
+
}
|
|
7756
|
+
let version = "unknown";
|
|
7757
|
+
const versionFile = node_path.join(sourceDir, "maxsim", "VERSION");
|
|
7758
|
+
if (node_fs.existsSync(versionFile)) version = node_fs.readFileSync(versionFile, "utf8").trim();
|
|
7759
|
+
node_fs.writeFileSync(node_path.join(backupDir, "backup-meta.json"), JSON.stringify({
|
|
7760
|
+
created: (/* @__PURE__ */ new Date()).toISOString(),
|
|
7761
|
+
version
|
|
7762
|
+
}, null, 2));
|
|
7763
|
+
return backupDir;
|
|
7764
|
+
} catch {
|
|
7765
|
+
return null;
|
|
7766
|
+
}
|
|
7767
|
+
}
|
|
7768
|
+
if (require.main === module) checkForUpdate({
|
|
7769
|
+
homeDir: node_os.homedir(),
|
|
7770
|
+
cwd: process.cwd()
|
|
7771
|
+
});
|
|
7772
|
+
|
|
7591
7773
|
//#endregion
|
|
7592
7774
|
//#region src/install/manifest.ts
|
|
7593
7775
|
const MANIFEST_NAME = "maxsim-file-manifest.json";
|
|
@@ -7811,7 +7993,8 @@ function uninstall(isGlobal, explicitConfigDir = null) {
|
|
|
7811
7993
|
"maxsim-statusline.js",
|
|
7812
7994
|
"maxsim-check-update.js",
|
|
7813
7995
|
"maxsim-check-update.sh",
|
|
7814
|
-
"maxsim-context-monitor.js"
|
|
7996
|
+
"maxsim-context-monitor.js",
|
|
7997
|
+
"maxsim-sync-reminder.js"
|
|
7815
7998
|
];
|
|
7816
7999
|
let hookCount = 0;
|
|
7817
8000
|
for (const hook of maxsimHooks) {
|
|
@@ -7860,7 +8043,7 @@ function uninstall(isGlobal, explicitConfigDir = null) {
|
|
|
7860
8043
|
if (settingsHooks && settingsHooks.PostToolUse) {
|
|
7861
8044
|
const before = settingsHooks.PostToolUse.length;
|
|
7862
8045
|
settingsHooks.PostToolUse = settingsHooks.PostToolUse.filter((entry) => {
|
|
7863
|
-
if (entry.hooks && Array.isArray(entry.hooks)) return !entry.hooks.some((h) => h.command && h.command.includes("maxsim-context-monitor"));
|
|
8046
|
+
if (entry.hooks && Array.isArray(entry.hooks)) return !entry.hooks.some((h) => h.command && (h.command.includes("maxsim-context-monitor") || h.command.includes("maxsim-sync-reminder")));
|
|
7864
8047
|
return true;
|
|
7865
8048
|
});
|
|
7866
8049
|
if (settingsHooks.PostToolUse.length < before) {
|
|
@@ -7950,6 +8133,7 @@ async function install() {
|
|
|
7950
8133
|
if (!complete) console.log(` ${chalk.yellow("!")} Previous install (v${existingManifest.version}) is incomplete -- ${missing.length} missing file(s). Re-installing.`);
|
|
7951
8134
|
else if (isAlreadyCurrent) console.log(` ${chalk.dim(`Version ${pkg.version} already installed -- upgrading in place`)}`);
|
|
7952
8135
|
}
|
|
8136
|
+
if (existingManifest !== null) createBackupBeforeUpdate(process.cwd());
|
|
7953
8137
|
saveLocalPatches(targetDir);
|
|
7954
8138
|
cleanupOrphanedFiles(targetDir);
|
|
7955
8139
|
let spinner = ora({
|
|
@@ -8045,6 +8229,27 @@ async function install() {
|
|
|
8045
8229
|
failures.push("skills");
|
|
8046
8230
|
}
|
|
8047
8231
|
}
|
|
8232
|
+
const rulesSrc = node_path.join(src, "rules");
|
|
8233
|
+
if (node_fs.existsSync(rulesSrc)) {
|
|
8234
|
+
spinner = ora({
|
|
8235
|
+
text: "Installing rules...",
|
|
8236
|
+
color: "cyan"
|
|
8237
|
+
}).start();
|
|
8238
|
+
const rulesDest = node_path.join(targetDir, "rules");
|
|
8239
|
+
node_fs.mkdirSync(rulesDest, { recursive: true });
|
|
8240
|
+
const ruleEntries = node_fs.readdirSync(rulesSrc, { withFileTypes: true });
|
|
8241
|
+
for (const entry of ruleEntries) if (entry.isFile() && entry.name.endsWith(".md")) {
|
|
8242
|
+
let content = node_fs.readFileSync(node_path.join(rulesSrc, entry.name), "utf8");
|
|
8243
|
+
content = content.replace(/~\/\.claude\//g, pathPrefix);
|
|
8244
|
+
node_fs.writeFileSync(node_path.join(rulesDest, entry.name), content);
|
|
8245
|
+
}
|
|
8246
|
+
const installedRuleFiles = node_fs.readdirSync(rulesDest).filter((f) => f.endsWith(".md")).length;
|
|
8247
|
+
if (installedRuleFiles > 0) spinner.succeed(chalk.green("✓") + ` Installed ${installedRuleFiles} rules to rules/`);
|
|
8248
|
+
else {
|
|
8249
|
+
spinner.fail("Failed to install rules");
|
|
8250
|
+
failures.push("rules");
|
|
8251
|
+
}
|
|
8252
|
+
}
|
|
8048
8253
|
const changelogSrc = node_path.join(src, "..", "CHANGELOG.md");
|
|
8049
8254
|
const changelogDest = node_path.join(targetDir, "maxsim", "CHANGELOG.md");
|
|
8050
8255
|
if (node_fs.existsSync(changelogSrc)) {
|
|
@@ -8167,9 +8372,21 @@ async function installForClaude(isInteractive) {
|
|
|
8167
8372
|
const result = await install();
|
|
8168
8373
|
let shouldInstallStatusline = false;
|
|
8169
8374
|
if (result.settings) shouldInstallStatusline = await handleStatusline(result.settings, isInteractive, forceStatusline);
|
|
8375
|
+
const agentTeamsAlreadyEnabled = process.env.CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS === "1";
|
|
8170
8376
|
let enableAgentTeams = false;
|
|
8171
|
-
if (
|
|
8172
|
-
if (enableAgentTeams
|
|
8377
|
+
if (agentTeamsAlreadyEnabled) console.log(` ${chalk.green("✓")} Agent Teams: enabled`);
|
|
8378
|
+
else if (isInteractive) enableAgentTeams = await promptAgentTeams();
|
|
8379
|
+
else {
|
|
8380
|
+
console.log();
|
|
8381
|
+
console.log(chalk.cyan(" Agent Teams") + chalk.dim(" (Recommended for Parallel Execution)"));
|
|
8382
|
+
console.log(chalk.dim(" MAXSIM's parallel execution uses Agent Teams for coordinating multiple agents."));
|
|
8383
|
+
console.log(chalk.dim(" To enable, add to your environment:"));
|
|
8384
|
+
console.log();
|
|
8385
|
+
console.log(chalk.yellow(" export CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1"));
|
|
8386
|
+
console.log();
|
|
8387
|
+
console.log(chalk.dim(" Or add to your shell profile (~/.bashrc, ~/.zshrc, etc.)"));
|
|
8388
|
+
}
|
|
8389
|
+
if ((enableAgentTeams || agentTeamsAlreadyEnabled) && result.settings) {
|
|
8173
8390
|
const env = result.settings.env ?? {};
|
|
8174
8391
|
env["CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS"] = "1";
|
|
8175
8392
|
result.settings.env = env;
|