maxsimcli 2.5.6 → 3.0.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.
Files changed (137) hide show
  1. package/README.md +4 -0
  2. package/dist/.tsbuildinfo +1 -1
  3. package/dist/adapters/base.d.ts +34 -0
  4. package/dist/adapters/base.d.ts.map +1 -0
  5. package/dist/adapters/base.js +116 -0
  6. package/dist/adapters/base.js.map +1 -0
  7. package/dist/adapters/claude.d.ts +21 -0
  8. package/dist/adapters/claude.d.ts.map +1 -0
  9. package/dist/adapters/claude.js +104 -0
  10. package/dist/adapters/claude.js.map +1 -0
  11. package/dist/adapters/codex.d.ts +19 -0
  12. package/dist/adapters/codex.d.ts.map +1 -0
  13. package/dist/adapters/codex.js +94 -0
  14. package/dist/adapters/codex.js.map +1 -0
  15. package/dist/adapters/gemini.d.ts +19 -0
  16. package/dist/adapters/gemini.d.ts.map +1 -0
  17. package/dist/adapters/gemini.js +96 -0
  18. package/dist/adapters/gemini.js.map +1 -0
  19. package/dist/adapters/index.d.ts +20 -0
  20. package/dist/adapters/index.d.ts.map +1 -0
  21. package/dist/adapters/index.js +56 -0
  22. package/dist/adapters/index.js.map +1 -0
  23. package/dist/adapters/opencode.d.ts +17 -0
  24. package/dist/adapters/opencode.d.ts.map +1 -0
  25. package/dist/adapters/opencode.js +111 -0
  26. package/dist/adapters/opencode.js.map +1 -0
  27. package/dist/adapters/transforms/content.d.ts +39 -0
  28. package/dist/adapters/transforms/content.d.ts.map +1 -0
  29. package/dist/adapters/transforms/content.js +125 -0
  30. package/dist/adapters/transforms/content.js.map +1 -0
  31. package/dist/adapters/transforms/frontmatter.d.ts +42 -0
  32. package/dist/adapters/transforms/frontmatter.d.ts.map +1 -0
  33. package/dist/adapters/transforms/frontmatter.js +204 -0
  34. package/dist/adapters/transforms/frontmatter.js.map +1 -0
  35. package/dist/adapters/transforms/tool-maps.d.ts +20 -0
  36. package/dist/adapters/transforms/tool-maps.d.ts.map +1 -0
  37. package/dist/adapters/transforms/tool-maps.js +64 -0
  38. package/dist/adapters/transforms/tool-maps.js.map +1 -0
  39. package/dist/adapters/types.d.ts +10 -0
  40. package/dist/adapters/types.d.ts.map +1 -0
  41. package/dist/adapters/types.js +6 -0
  42. package/dist/adapters/types.js.map +1 -0
  43. package/dist/assets/CHANGELOG.md +19 -0
  44. package/dist/assets/dashboard/server.js +27728 -12013
  45. package/dist/assets/hooks/maxsim-check-update.cjs +2 -2
  46. package/dist/assets/hooks/maxsim-check-update.cjs.map +1 -0
  47. package/dist/assets/hooks/maxsim-context-monitor.cjs +2 -2
  48. package/dist/assets/hooks/maxsim-context-monitor.cjs.map +1 -0
  49. package/dist/assets/hooks/maxsim-statusline.cjs +2 -2
  50. package/dist/assets/hooks/maxsim-statusline.cjs.map +1 -0
  51. package/dist/cli.cjs +15316 -5348
  52. package/dist/cli.cjs.map +1 -1
  53. package/dist/cli.d.ts +0 -6
  54. package/dist/cli.d.ts.map +1 -1
  55. package/dist/cli.js +282 -443
  56. package/dist/cli.js.map +1 -1
  57. package/dist/core/commands.d.ts +19 -0
  58. package/dist/core/commands.d.ts.map +1 -0
  59. package/dist/core/commands.js +560 -0
  60. package/dist/core/commands.js.map +1 -0
  61. package/dist/core/config.d.ts +9 -0
  62. package/dist/core/config.d.ts.map +1 -0
  63. package/dist/core/config.js +147 -0
  64. package/dist/core/config.js.map +1 -0
  65. package/dist/core/core.d.ts +39 -0
  66. package/dist/core/core.d.ts.map +1 -0
  67. package/dist/core/core.js +411 -0
  68. package/dist/core/core.js.map +1 -0
  69. package/dist/core/frontmatter.d.ts +33 -0
  70. package/dist/core/frontmatter.d.ts.map +1 -0
  71. package/dist/core/frontmatter.js +192 -0
  72. package/dist/core/frontmatter.js.map +1 -0
  73. package/dist/core/index.d.ts +20 -0
  74. package/dist/core/index.d.ts.map +1 -0
  75. package/dist/core/index.js +126 -0
  76. package/dist/core/index.js.map +1 -0
  77. package/dist/core/init.d.ts +252 -0
  78. package/dist/core/init.d.ts.map +1 -0
  79. package/dist/core/init.js +578 -0
  80. package/dist/core/init.js.map +1 -0
  81. package/dist/core/milestone.d.ts +9 -0
  82. package/dist/core/milestone.d.ts.map +1 -0
  83. package/dist/core/milestone.js +191 -0
  84. package/dist/core/milestone.js.map +1 -0
  85. package/dist/core/phase.d.ts +17 -0
  86. package/dist/core/phase.d.ts.map +1 -0
  87. package/dist/core/phase.js +610 -0
  88. package/dist/core/phase.js.map +1 -0
  89. package/dist/core/roadmap.d.ts +9 -0
  90. package/dist/core/roadmap.d.ts.map +1 -0
  91. package/dist/core/roadmap.js +228 -0
  92. package/dist/core/roadmap.js.map +1 -0
  93. package/dist/core/state.d.ts +21 -0
  94. package/dist/core/state.d.ts.map +1 -0
  95. package/dist/core/state.js +507 -0
  96. package/dist/core/state.js.map +1 -0
  97. package/dist/core/template.d.ts +30 -0
  98. package/dist/core/template.d.ts.map +1 -0
  99. package/dist/core/template.js +225 -0
  100. package/dist/core/template.js.map +1 -0
  101. package/dist/core/types.d.ts +374 -0
  102. package/dist/core/types.d.ts.map +1 -0
  103. package/dist/core/types.js +53 -0
  104. package/dist/core/types.js.map +1 -0
  105. package/dist/core/verify.d.ts +127 -0
  106. package/dist/core/verify.d.ts.map +1 -0
  107. package/dist/core/verify.js +783 -0
  108. package/dist/core/verify.js.map +1 -0
  109. package/dist/hooks/index.d.ts +11 -0
  110. package/dist/hooks/index.d.ts.map +1 -0
  111. package/dist/hooks/index.js +18 -0
  112. package/dist/hooks/index.js.map +1 -0
  113. package/dist/hooks/maxsim-check-update.d.ts +17 -0
  114. package/dist/hooks/maxsim-check-update.d.ts.map +1 -0
  115. package/dist/hooks/maxsim-check-update.js +101 -0
  116. package/dist/hooks/maxsim-check-update.js.map +1 -0
  117. package/dist/hooks/maxsim-context-monitor.d.ts +21 -0
  118. package/dist/hooks/maxsim-context-monitor.d.ts.map +1 -0
  119. package/dist/hooks/maxsim-context-monitor.js +131 -0
  120. package/dist/hooks/maxsim-context-monitor.js.map +1 -0
  121. package/dist/hooks/maxsim-statusline.d.ts +19 -0
  122. package/dist/hooks/maxsim-statusline.d.ts.map +1 -0
  123. package/dist/hooks/maxsim-statusline.js +146 -0
  124. package/dist/hooks/maxsim-statusline.js.map +1 -0
  125. package/dist/hooks/shared.d.ts +11 -0
  126. package/dist/hooks/shared.d.ts.map +1 -0
  127. package/dist/hooks/shared.js +29 -0
  128. package/dist/hooks/shared.js.map +1 -0
  129. package/dist/install.cjs +2807 -1211
  130. package/dist/install.cjs.map +1 -1
  131. package/dist/install.js +34 -85
  132. package/dist/install.js.map +1 -1
  133. package/package.json +10 -7
  134. package/dist/assets/hooks/index.cjs +0 -239
  135. package/dist/assets/templates/CLAUDE.md +0 -22
  136. package/dist/assets/templates/package.json +0 -5
  137. package/dist/assets/templates/project.json +0 -5
@@ -1,239 +0,0 @@
1
- Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
- //#region \0rolldown/runtime.js
3
- var __create = Object.create;
4
- var __defProp = Object.defineProperty;
5
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
6
- var __getOwnPropNames = Object.getOwnPropertyNames;
7
- var __getProtoOf = Object.getPrototypeOf;
8
- var __hasOwnProp = Object.prototype.hasOwnProperty;
9
- var __copyProps = (to, from, except, desc) => {
10
- if (from && typeof from === "object" || typeof from === "function") {
11
- for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
12
- key = keys[i];
13
- if (!__hasOwnProp.call(to, key) && key !== except) {
14
- __defProp(to, key, {
15
- get: ((k) => from[k]).bind(null, key),
16
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
17
- });
18
- }
19
- }
20
- }
21
- return to;
22
- };
23
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
24
- value: mod,
25
- enumerable: true
26
- }) : target, mod));
27
-
28
- //#endregion
29
- let node_fs = require("node:fs");
30
- node_fs = __toESM(node_fs);
31
- let node_path = require("node:path");
32
- node_path = __toESM(node_path);
33
- let node_os = require("node:os");
34
- node_os = __toESM(node_os);
35
- let node_child_process = require("node:child_process");
36
-
37
- //#region src/shared.ts
38
- /**
39
- * Shared utilities for MAXSIM hooks.
40
- */
41
- /**
42
- * Read all stdin as a string, then invoke callback with parsed JSON.
43
- * Used by context-monitor and statusline hooks.
44
- */
45
- function readStdinJson(callback) {
46
- let input = "";
47
- process.stdin.setEncoding("utf8");
48
- process.stdin.on("data", (chunk) => input += chunk);
49
- process.stdin.on("end", () => {
50
- try {
51
- callback(JSON.parse(input));
52
- } catch {
53
- process.exit(0);
54
- }
55
- });
56
- }
57
- /** The '.claude' path segment -- template marker replaced during install. */
58
- const CLAUDE_DIR = ".claude";
59
-
60
- //#endregion
61
- //#region src/maxsim-check-update.ts
62
- /**
63
- * Check for MAXSIM updates in background, write result to cache.
64
- * Called by SessionStart hook - runs once per session.
65
- */
66
- function checkForUpdate(options) {
67
- const { homeDir, cwd } = options;
68
- const cacheDir = node_path.join(homeDir, CLAUDE_DIR, "cache");
69
- const cacheFile = node_path.join(cacheDir, "maxsim-update-check.json");
70
- const projectVersionFile = node_path.join(cwd, CLAUDE_DIR, "maxsim", "VERSION");
71
- const globalVersionFile = node_path.join(homeDir, CLAUDE_DIR, "maxsim", "VERSION");
72
- if (!node_fs.existsSync(cacheDir)) node_fs.mkdirSync(cacheDir, { recursive: true });
73
- (0, node_child_process.spawn)(process.execPath, ["-e", `
74
- const fs = require('fs');
75
- const { execSync } = require('child_process');
76
-
77
- const cacheFile = ${JSON.stringify(cacheFile)};
78
- const projectVersionFile = ${JSON.stringify(projectVersionFile)};
79
- const globalVersionFile = ${JSON.stringify(globalVersionFile)};
80
-
81
- // Check project directory first (local install), then global
82
- let installed = '0.0.0';
83
- try {
84
- if (fs.existsSync(projectVersionFile)) {
85
- installed = fs.readFileSync(projectVersionFile, 'utf8').trim();
86
- } else if (fs.existsSync(globalVersionFile)) {
87
- installed = fs.readFileSync(globalVersionFile, 'utf8').trim();
88
- }
89
- } catch (e) {}
90
-
91
- let latest = null;
92
- try {
93
- latest = execSync('npm view maxsimcli version', { encoding: 'utf8', timeout: 10000, windowsHide: true }).trim();
94
- } catch (e) {}
95
-
96
- const result = {
97
- update_available: latest && installed !== latest,
98
- installed,
99
- latest: latest || 'unknown',
100
- checked: Math.floor(Date.now() / 1000)
101
- };
102
-
103
- fs.writeFileSync(cacheFile, JSON.stringify(result));
104
- `], {
105
- stdio: "ignore",
106
- windowsHide: true,
107
- detached: true
108
- }).unref();
109
- }
110
- if (require.main === module) checkForUpdate({
111
- homeDir: node_os.homedir(),
112
- cwd: process.cwd()
113
- });
114
-
115
- //#endregion
116
- //#region src/maxsim-context-monitor.ts
117
- /**
118
- * Context Monitor - PostToolUse hook
119
- * Reads context metrics from the statusline bridge file and injects
120
- * warnings when context usage is high.
121
- */
122
- const WARNING_THRESHOLD = 35;
123
- const CRITICAL_THRESHOLD = 25;
124
- const STALE_SECONDS = 60;
125
- const DEBOUNCE_CALLS = 5;
126
- function processContextMonitor(data) {
127
- const sessionId = data.session_id;
128
- if (!sessionId) return null;
129
- const tmpDir = node_os.tmpdir();
130
- const metricsPath = node_path.join(tmpDir, `claude-ctx-${sessionId}.json`);
131
- if (!node_fs.existsSync(metricsPath)) return null;
132
- const metrics = JSON.parse(node_fs.readFileSync(metricsPath, "utf8"));
133
- const now = Math.floor(Date.now() / 1e3);
134
- if (metrics.timestamp && now - metrics.timestamp > STALE_SECONDS) return null;
135
- const remaining = metrics.remaining_percentage;
136
- const usedPct = metrics.used_pct;
137
- if (remaining > WARNING_THRESHOLD) return null;
138
- const warnPath = node_path.join(tmpDir, `claude-ctx-${sessionId}-warned.json`);
139
- let warnData = {
140
- callsSinceWarn: 0,
141
- lastLevel: null
142
- };
143
- let firstWarn = true;
144
- if (node_fs.existsSync(warnPath)) try {
145
- warnData = JSON.parse(node_fs.readFileSync(warnPath, "utf8"));
146
- firstWarn = false;
147
- } catch {}
148
- warnData.callsSinceWarn = (warnData.callsSinceWarn || 0) + 1;
149
- const isCritical = remaining <= CRITICAL_THRESHOLD;
150
- const currentLevel = isCritical ? "critical" : "warning";
151
- const severityEscalated = currentLevel === "critical" && warnData.lastLevel === "warning";
152
- if (!firstWarn && warnData.callsSinceWarn < DEBOUNCE_CALLS && !severityEscalated) {
153
- node_fs.writeFileSync(warnPath, JSON.stringify(warnData));
154
- return null;
155
- }
156
- warnData.callsSinceWarn = 0;
157
- warnData.lastLevel = currentLevel;
158
- node_fs.writeFileSync(warnPath, JSON.stringify(warnData));
159
- let message;
160
- if (isCritical) message = `CONTEXT MONITOR CRITICAL: Usage at ${usedPct}%. Remaining: ${remaining}%. STOP new work immediately. Save state NOW and inform the user that context is nearly exhausted. If using MAXSIM, run /maxsim:pause-work to save execution state.`;
161
- else message = `CONTEXT MONITOR WARNING: Usage at ${usedPct}%. Remaining: ${remaining}%. Begin wrapping up current task. Do not start new complex work. If using MAXSIM, consider /maxsim:pause-work to save state.`;
162
- return { hookSpecificOutput: {
163
- hookEventName: "PostToolUse",
164
- additionalContext: message
165
- } };
166
- }
167
- if (require.main === module) readStdinJson((data) => {
168
- const result = processContextMonitor(data);
169
- if (result) process.stdout.write(JSON.stringify(result));
170
- });
171
-
172
- //#endregion
173
- //#region src/maxsim-statusline.ts
174
- /**
175
- * Claude Code Statusline - MAXSIM Edition
176
- * Shows: model | current task | directory | context usage
177
- */
178
- function formatStatusline(data) {
179
- const model = data.model?.display_name || "Claude";
180
- const dir = data.workspace?.current_dir || process.cwd();
181
- const session = data.session_id || "";
182
- const remaining = data.context_window?.remaining_percentage;
183
- let ctx = "";
184
- if (remaining != null) {
185
- const rem = Math.round(remaining);
186
- const rawUsed = Math.max(0, Math.min(100, 100 - rem));
187
- const used = Math.min(100, Math.round(rawUsed / 80 * 100));
188
- if (session) try {
189
- const bridgePath = node_path.join(node_os.tmpdir(), `claude-ctx-${session}.json`);
190
- const bridgeData = JSON.stringify({
191
- session_id: session,
192
- remaining_percentage: remaining,
193
- used_pct: used,
194
- timestamp: Math.floor(Date.now() / 1e3)
195
- });
196
- node_fs.writeFileSync(bridgePath, bridgeData);
197
- } catch {}
198
- const filled = Math.floor(used / 10);
199
- const bar = "█".repeat(filled) + "░".repeat(10 - filled);
200
- if (used < 63) ctx = ` \x1b[32m${bar} ${used}%\x1b[0m`;
201
- else if (used < 81) ctx = ` \x1b[33m${bar} ${used}%\x1b[0m`;
202
- else if (used < 95) ctx = ` \x1b[38;5;208m${bar} ${used}%\x1b[0m`;
203
- else ctx = ` \x1b[5;31m\uD83D\uDC80 ${bar} ${used}%\x1b[0m`;
204
- }
205
- let task = "";
206
- const homeDir = node_os.homedir();
207
- const todosDir = node_path.join(homeDir, CLAUDE_DIR, "todos");
208
- if (session && node_fs.existsSync(todosDir)) try {
209
- const files = node_fs.readdirSync(todosDir).filter((f) => f.startsWith(session) && f.includes("-agent-") && f.endsWith(".json")).map((f) => ({
210
- name: f,
211
- mtime: node_fs.statSync(node_path.join(todosDir, f)).mtime
212
- })).sort((a, b) => b.mtime.getTime() - a.mtime.getTime());
213
- if (files.length > 0) try {
214
- const inProgress = JSON.parse(node_fs.readFileSync(node_path.join(todosDir, files[0].name), "utf8")).find((t) => t.status === "in_progress");
215
- if (inProgress) task = inProgress.activeForm || "";
216
- } catch {}
217
- } catch {}
218
- let maxsimUpdate = "";
219
- const cacheFile = node_path.join(homeDir, CLAUDE_DIR, "cache", "maxsim-update-check.json");
220
- if (node_fs.existsSync(cacheFile)) try {
221
- if (JSON.parse(node_fs.readFileSync(cacheFile, "utf8")).update_available) maxsimUpdate = "\x1B[33m⬆ /maxsim:update\x1B[0m │ ";
222
- } catch {}
223
- const dirname = node_path.basename(dir);
224
- if (task) return `${maxsimUpdate}\x1b[2m${model}\x1b[0m \u2502 \x1b[1m${task}\x1b[0m \u2502 \x1b[2m${dirname}\x1b[0m${ctx}`;
225
- else return `${maxsimUpdate}\x1b[2m${model}\x1b[0m \u2502 \x1b[2m${dirname}\x1b[0m${ctx}`;
226
- }
227
- if (require.main === module) readStdinJson((data) => {
228
- process.stdout.write(formatStatusline(data));
229
- });
230
-
231
- //#endregion
232
- exports.CRITICAL_THRESHOLD = CRITICAL_THRESHOLD;
233
- exports.DEBOUNCE_CALLS = DEBOUNCE_CALLS;
234
- exports.STALE_SECONDS = STALE_SECONDS;
235
- exports.WARNING_THRESHOLD = WARNING_THRESHOLD;
236
- exports.checkForUpdate = checkForUpdate;
237
- exports.formatStatusline = formatStatusline;
238
- exports.processContextMonitor = processContextMonitor;
239
- //# sourceMappingURL=index.cjs.map
@@ -1,22 +0,0 @@
1
- # MAXSIM Global Instructions
2
-
3
- MAXSIM is installed in this Claude Code environment.
4
-
5
- ## Available Commands
6
-
7
- Use `/maxsim:help` to see all available commands, or type `/maxsim:` and browse the command list.
8
-
9
- ## Key Commands
10
-
11
- - `/maxsim:execute-phase` — Execute a phase plan
12
- - `/maxsim:plan-phase` — Plan a new phase
13
- - `/maxsim:resume-work` — Resume from last checkpoint
14
- - `/maxsim:quick` — Start a quick task
15
-
16
- ## Workflow Reference
17
-
18
- Workflows are at `~/.claude/maxsim/workflows/`. Agents are at `~/.claude/agents/`.
19
-
20
- ## Documentation
21
-
22
- For full documentation: https://github.com/maystudios/maxsim
@@ -1,5 +0,0 @@
1
- {
2
- "name": "@maxsim/templates",
3
- "version": "0.0.1",
4
- "private": true
5
- }
@@ -1,5 +0,0 @@
1
- {
2
- "name": "templates",
3
- "root": "packages/templates",
4
- "$schema": "../../node_modules/nx/schemas/project-schema.json"
5
- }