maxsimcli 3.12.0 → 4.0.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 +43 -17
- package/dist/.tsbuildinfo +1 -1
- package/dist/adapters/index.d.ts +0 -11
- package/dist/adapters/index.d.ts.map +1 -1
- package/dist/adapters/index.js +4 -40
- package/dist/adapters/index.js.map +1 -1
- package/dist/assets/CHANGELOG.md +70 -0
- package/dist/assets/dashboard/client/assets/{index-wtQDvXzr.js → index-C_eAetZJ.js} +60 -60
- package/dist/assets/dashboard/client/assets/index-CmiJKqOU.css +32 -0
- package/dist/assets/dashboard/client/index.html +2 -2
- package/dist/assets/dashboard/server.js +467 -271
- package/dist/assets/templates/agents/AGENTS.md +13 -1
- package/dist/assets/templates/agents/maxsim-debugger.md +2 -2
- package/dist/assets/templates/agents/maxsim-executor.md +5 -5
- package/dist/assets/templates/agents/maxsim-phase-researcher.md +2 -2
- package/dist/assets/templates/agents/maxsim-plan-checker.md +2 -2
- package/dist/assets/templates/agents/maxsim-planner.md +3 -3
- package/dist/assets/templates/commands/maxsim/add-todo.md +15 -5
- package/dist/assets/templates/commands/maxsim/discuss-phase.md +1 -0
- package/dist/assets/templates/commands/maxsim/init-existing.md +4 -0
- package/dist/assets/templates/commands/maxsim/new-project.md +4 -0
- package/dist/assets/templates/references/thinking-partner.md +41 -0
- package/dist/assets/templates/skills/batch-worktree/SKILL.md +137 -0
- package/dist/assets/templates/skills/brainstorming/SKILL.md +159 -0
- package/dist/assets/templates/skills/roadmap-writing/SKILL.md +198 -0
- package/dist/assets/templates/skills/sdd/SKILL.md +175 -0
- package/dist/assets/templates/skills/simplify/SKILL.md +48 -0
- package/dist/assets/templates/skills/using-maxsim/SKILL.md +6 -1
- package/dist/assets/templates/templates/acceptance-criteria.md +10 -0
- package/dist/assets/templates/templates/decisions.md +10 -0
- package/dist/assets/templates/templates/no-gos.md +9 -0
- package/dist/assets/templates/workflows/add-todo.md +89 -0
- package/dist/assets/templates/workflows/discuss-phase.md +85 -1
- package/dist/assets/templates/workflows/execute-phase.md +22 -2
- package/dist/assets/templates/workflows/execute-plan.md +166 -0
- package/dist/assets/templates/workflows/init-existing.md +116 -0
- package/dist/assets/templates/workflows/new-project.md +105 -1
- package/dist/assets/templates/workflows/plan-phase.md +3 -3
- package/dist/assets/templates/workflows/quick.md +2 -2
- package/dist/cli.cjs +1264 -882
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.js +97 -74
- package/dist/cli.js.map +1 -1
- package/dist/core/artefakte.d.ts +12 -0
- package/dist/core/artefakte.d.ts.map +1 -0
- package/dist/core/artefakte.js +136 -0
- package/dist/core/artefakte.js.map +1 -0
- package/dist/core/commands.d.ts +13 -13
- package/dist/core/commands.d.ts.map +1 -1
- package/dist/core/commands.js +44 -57
- package/dist/core/commands.js.map +1 -1
- package/dist/core/config.d.ts +4 -3
- package/dist/core/config.d.ts.map +1 -1
- package/dist/core/config.js +14 -18
- package/dist/core/config.js.map +1 -1
- package/dist/core/context-loader.d.ts +20 -0
- package/dist/core/context-loader.d.ts.map +1 -0
- package/dist/core/context-loader.js +154 -0
- package/dist/core/context-loader.js.map +1 -0
- package/dist/core/core.d.ts +8 -2
- package/dist/core/core.d.ts.map +1 -1
- package/dist/core/core.js +47 -11
- package/dist/core/core.js.map +1 -1
- package/dist/core/dashboard-launcher.d.ts +1 -1
- package/dist/core/dashboard-launcher.d.ts.map +1 -1
- package/dist/core/dashboard-launcher.js +18 -15
- package/dist/core/dashboard-launcher.js.map +1 -1
- package/dist/core/frontmatter.d.ts +5 -5
- package/dist/core/frontmatter.d.ts.map +1 -1
- package/dist/core/frontmatter.js +21 -26
- package/dist/core/frontmatter.js.map +1 -1
- package/dist/core/index.d.ts +8 -3
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js +23 -3
- package/dist/core/index.js.map +1 -1
- package/dist/core/init.d.ts +14 -14
- package/dist/core/init.d.ts.map +1 -1
- package/dist/core/init.js +93 -154
- package/dist/core/init.js.map +1 -1
- package/dist/core/milestone.d.ts +3 -3
- package/dist/core/milestone.d.ts.map +1 -1
- package/dist/core/milestone.js +9 -9
- package/dist/core/milestone.js.map +1 -1
- package/dist/core/phase.d.ts +9 -9
- package/dist/core/phase.d.ts.map +1 -1
- package/dist/core/phase.js +64 -68
- package/dist/core/phase.js.map +1 -1
- package/dist/core/roadmap.d.ts +4 -3
- package/dist/core/roadmap.d.ts.map +1 -1
- package/dist/core/roadmap.js +46 -109
- package/dist/core/roadmap.js.map +1 -1
- package/dist/core/skills.d.ts +19 -0
- package/dist/core/skills.d.ts.map +1 -0
- package/dist/core/skills.js +145 -0
- package/dist/core/skills.js.map +1 -0
- package/dist/core/start.d.ts +15 -0
- package/dist/core/start.d.ts.map +1 -0
- package/dist/core/start.js +80 -0
- package/dist/core/start.js.map +1 -0
- package/dist/core/state.d.ts +13 -13
- package/dist/core/state.d.ts.map +1 -1
- package/dist/core/state.js +119 -126
- package/dist/core/state.js.map +1 -1
- package/dist/core/template.d.ts +3 -3
- package/dist/core/template.d.ts.map +1 -1
- package/dist/core/template.js +12 -14
- package/dist/core/template.js.map +1 -1
- package/dist/core/types.d.ts +14 -2
- package/dist/core/types.d.ts.map +1 -1
- package/dist/core/types.js +8 -0
- package/dist/core/types.js.map +1 -1
- package/dist/core/verify.d.ts +10 -9
- package/dist/core/verify.d.ts.map +1 -1
- package/dist/core/verify.js +38 -48
- package/dist/core/verify.js.map +1 -1
- package/dist/core-TFSlUjV1.cjs +4312 -0
- package/dist/core-TFSlUjV1.cjs.map +1 -0
- package/dist/install/adapters.d.ts +2 -11
- package/dist/install/adapters.d.ts.map +1 -1
- package/dist/install/adapters.js +16 -154
- package/dist/install/adapters.js.map +1 -1
- package/dist/install/copy.d.ts +1 -10
- package/dist/install/copy.d.ts.map +1 -1
- package/dist/install/copy.js +5 -125
- package/dist/install/copy.js.map +1 -1
- package/dist/install/hooks.d.ts +4 -5
- package/dist/install/hooks.d.ts.map +1 -1
- package/dist/install/hooks.js +46 -71
- package/dist/install/hooks.js.map +1 -1
- package/dist/install/index.js +163 -226
- package/dist/install/index.js.map +1 -1
- package/dist/install/manifest.d.ts +5 -2
- package/dist/install/manifest.d.ts.map +1 -1
- package/dist/install/manifest.js +20 -26
- package/dist/install/manifest.js.map +1 -1
- package/dist/install/patches.d.ts +1 -2
- package/dist/install/patches.d.ts.map +1 -1
- package/dist/install/patches.js +4 -16
- package/dist/install/patches.js.map +1 -1
- package/dist/install/shared.d.ts +24 -18
- package/dist/install/shared.d.ts.map +1 -1
- package/dist/install/shared.js +65 -35
- package/dist/install/shared.js.map +1 -1
- package/dist/install/uninstall.d.ts +2 -3
- package/dist/install/uninstall.d.ts.map +1 -1
- package/dist/install/uninstall.js +24 -82
- package/dist/install/uninstall.js.map +1 -1
- package/dist/install.cjs +321 -1230
- package/dist/install.cjs.map +1 -1
- package/dist/mcp-server.cjs +22527 -46
- package/dist/mcp-server.cjs.map +1 -1
- package/dist/skills-BOSxYUzf.cjs +6812 -0
- package/dist/skills-BOSxYUzf.cjs.map +1 -0
- package/package.json +1 -1
- package/dist/adapters/codex.d.ts +0 -19
- package/dist/adapters/codex.d.ts.map +0 -1
- package/dist/adapters/codex.js +0 -94
- package/dist/adapters/codex.js.map +0 -1
- package/dist/adapters/gemini.d.ts +0 -19
- package/dist/adapters/gemini.d.ts.map +0 -1
- package/dist/adapters/gemini.js +0 -96
- package/dist/adapters/gemini.js.map +0 -1
- package/dist/adapters/opencode.d.ts +0 -17
- package/dist/adapters/opencode.d.ts.map +0 -1
- package/dist/adapters/opencode.js +0 -111
- package/dist/adapters/opencode.js.map +0 -1
- package/dist/adapters/transforms/content.d.ts +0 -39
- package/dist/adapters/transforms/content.d.ts.map +0 -1
- package/dist/adapters/transforms/content.js +0 -125
- package/dist/adapters/transforms/content.js.map +0 -1
- package/dist/adapters/transforms/frontmatter.d.ts +0 -42
- package/dist/adapters/transforms/frontmatter.d.ts.map +0 -1
- package/dist/adapters/transforms/frontmatter.js +0 -204
- package/dist/adapters/transforms/frontmatter.js.map +0 -1
- package/dist/adapters/transforms/tool-maps.d.ts +0 -20
- package/dist/adapters/transforms/tool-maps.d.ts.map +0 -1
- package/dist/adapters/transforms/tool-maps.js +0 -64
- package/dist/adapters/transforms/tool-maps.js.map +0 -1
- package/dist/assets/dashboard/client/assets/index-CxFKStBk.css +0 -32
|
@@ -1,15 +1,6 @@
|
|
|
1
|
-
import type { RuntimeName } from '../adapters/index.js';
|
|
2
1
|
/**
|
|
3
|
-
* Get commit attribution setting for
|
|
2
|
+
* Get commit attribution setting for Claude Code
|
|
4
3
|
* @returns null = remove, undefined = keep default, string = custom
|
|
5
4
|
*/
|
|
6
|
-
export declare function getCommitAttribution(
|
|
7
|
-
/**
|
|
8
|
-
* Parse JSONC (JSON with Comments) by stripping comments and trailing commas.
|
|
9
|
-
*/
|
|
10
|
-
export declare function parseJsonc(content: string): Record<string, unknown>;
|
|
11
|
-
/**
|
|
12
|
-
* Configure OpenCode permissions to allow reading MAXSIM reference docs
|
|
13
|
-
*/
|
|
14
|
-
export declare function configureOpencodePermissions(isGlobal?: boolean): void;
|
|
5
|
+
export declare function getCommitAttribution(explicitConfigDir: string | null): null | undefined | string;
|
|
15
6
|
//# sourceMappingURL=adapters.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"adapters.d.ts","sourceRoot":"","sources":["../../src/install/adapters.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"adapters.d.ts","sourceRoot":"","sources":["../../src/install/adapters.ts"],"names":[],"mappings":"AAWA;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,iBAAiB,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI,GAAG,SAAS,GAAG,MAAM,CAmBhG"}
|
package/dist/install/adapters.js
CHANGED
|
@@ -32,172 +32,34 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
32
32
|
return result;
|
|
33
33
|
};
|
|
34
34
|
})();
|
|
35
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
36
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
37
|
-
};
|
|
38
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
36
|
exports.getCommitAttribution = getCommitAttribution;
|
|
40
|
-
exports.parseJsonc = parseJsonc;
|
|
41
|
-
exports.configureOpencodePermissions = configureOpencodePermissions;
|
|
42
|
-
const fs = __importStar(require("node:fs"));
|
|
43
|
-
const os = __importStar(require("node:os"));
|
|
44
37
|
const path = __importStar(require("node:path"));
|
|
45
|
-
const chalk_1 = __importDefault(require("chalk"));
|
|
46
38
|
const index_js_1 = require("../adapters/index.js");
|
|
47
39
|
const shared_js_1 = require("./shared.js");
|
|
48
|
-
// Cache for attribution settings (populated once
|
|
49
|
-
|
|
40
|
+
// Cache for attribution settings (populated once during install)
|
|
41
|
+
let attributionCached = false;
|
|
42
|
+
let attributionValue;
|
|
50
43
|
/**
|
|
51
|
-
* Get commit attribution setting for
|
|
44
|
+
* Get commit attribution setting for Claude Code
|
|
52
45
|
* @returns null = remove, undefined = keep default, string = custom
|
|
53
46
|
*/
|
|
54
|
-
function getCommitAttribution(
|
|
55
|
-
if (
|
|
56
|
-
return
|
|
47
|
+
function getCommitAttribution(explicitConfigDir) {
|
|
48
|
+
if (attributionCached) {
|
|
49
|
+
return attributionValue;
|
|
57
50
|
}
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
config.disable_ai_attribution === true
|
|
63
|
-
? null
|
|
64
|
-
: undefined;
|
|
51
|
+
const settings = (0, index_js_1.readSettings)(path.join((0, shared_js_1.getGlobalDir)(explicitConfigDir), 'settings.json'));
|
|
52
|
+
const attr = settings.attribution;
|
|
53
|
+
if (!attr || attr.commit === undefined) {
|
|
54
|
+
attributionValue = undefined;
|
|
65
55
|
}
|
|
66
|
-
else if (
|
|
67
|
-
|
|
68
|
-
const attr = settings.attribution;
|
|
69
|
-
if (!attr || attr.commit === undefined) {
|
|
70
|
-
result = undefined;
|
|
71
|
-
}
|
|
72
|
-
else if (attr.commit === '') {
|
|
73
|
-
result = null;
|
|
74
|
-
}
|
|
75
|
-
else {
|
|
76
|
-
result = attr.commit;
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
else if (runtime === 'claude') {
|
|
80
|
-
const settings = (0, index_js_1.readSettings)(path.join((0, shared_js_1.getGlobalDir)('claude', explicitConfigDir), 'settings.json'));
|
|
81
|
-
const attr = settings.attribution;
|
|
82
|
-
if (!attr || attr.commit === undefined) {
|
|
83
|
-
result = undefined;
|
|
84
|
-
}
|
|
85
|
-
else if (attr.commit === '') {
|
|
86
|
-
result = null;
|
|
87
|
-
}
|
|
88
|
-
else {
|
|
89
|
-
result = attr.commit;
|
|
90
|
-
}
|
|
56
|
+
else if (attr.commit === '') {
|
|
57
|
+
attributionValue = null;
|
|
91
58
|
}
|
|
92
59
|
else {
|
|
93
|
-
|
|
94
|
-
}
|
|
95
|
-
attributionCache.set(runtime, result);
|
|
96
|
-
return result;
|
|
97
|
-
}
|
|
98
|
-
/**
|
|
99
|
-
* Parse JSONC (JSON with Comments) by stripping comments and trailing commas.
|
|
100
|
-
*/
|
|
101
|
-
function parseJsonc(content) {
|
|
102
|
-
if (content.charCodeAt(0) === 0xfeff) {
|
|
103
|
-
content = content.slice(1);
|
|
104
|
-
}
|
|
105
|
-
let result = '';
|
|
106
|
-
let inString = false;
|
|
107
|
-
let i = 0;
|
|
108
|
-
while (i < content.length) {
|
|
109
|
-
const char = content[i];
|
|
110
|
-
const next = content[i + 1];
|
|
111
|
-
if (inString) {
|
|
112
|
-
result += char;
|
|
113
|
-
if (char === '\\' && i + 1 < content.length) {
|
|
114
|
-
result += next;
|
|
115
|
-
i += 2;
|
|
116
|
-
continue;
|
|
117
|
-
}
|
|
118
|
-
if (char === '"') {
|
|
119
|
-
inString = false;
|
|
120
|
-
}
|
|
121
|
-
i++;
|
|
122
|
-
}
|
|
123
|
-
else {
|
|
124
|
-
if (char === '"') {
|
|
125
|
-
inString = true;
|
|
126
|
-
result += char;
|
|
127
|
-
i++;
|
|
128
|
-
}
|
|
129
|
-
else if (char === '/' && next === '/') {
|
|
130
|
-
while (i < content.length && content[i] !== '\n') {
|
|
131
|
-
i++;
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
else if (char === '/' && next === '*') {
|
|
135
|
-
i += 2;
|
|
136
|
-
while (i < content.length - 1 &&
|
|
137
|
-
!(content[i] === '*' && content[i + 1] === '/')) {
|
|
138
|
-
i++;
|
|
139
|
-
}
|
|
140
|
-
i += 2;
|
|
141
|
-
}
|
|
142
|
-
else {
|
|
143
|
-
result += char;
|
|
144
|
-
i++;
|
|
145
|
-
}
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
result = result.replace(/,(\s*[}\]])/g, '$1');
|
|
149
|
-
return JSON.parse(result);
|
|
150
|
-
}
|
|
151
|
-
/**
|
|
152
|
-
* Configure OpenCode permissions to allow reading MAXSIM reference docs
|
|
153
|
-
*/
|
|
154
|
-
function configureOpencodePermissions(isGlobal = true) {
|
|
155
|
-
const opencodeConfigDir = isGlobal
|
|
156
|
-
? (0, shared_js_1.getOpencodeGlobalDir)()
|
|
157
|
-
: path.join(process.cwd(), '.opencode');
|
|
158
|
-
const configPath = path.join(opencodeConfigDir, 'opencode.json');
|
|
159
|
-
fs.mkdirSync(opencodeConfigDir, { recursive: true });
|
|
160
|
-
let config = {};
|
|
161
|
-
if (fs.existsSync(configPath)) {
|
|
162
|
-
try {
|
|
163
|
-
const content = fs.readFileSync(configPath, 'utf8');
|
|
164
|
-
config = parseJsonc(content);
|
|
165
|
-
}
|
|
166
|
-
catch (e) {
|
|
167
|
-
console.log(` ${chalk_1.default.yellow('\u26a0')} Could not parse opencode.json - skipping permission config`);
|
|
168
|
-
console.log(` ${chalk_1.default.dim(`Reason: ${e.message}`)}`);
|
|
169
|
-
console.log(` ${chalk_1.default.dim('Your config was NOT modified. Fix the syntax manually if needed.')}`);
|
|
170
|
-
return;
|
|
171
|
-
}
|
|
172
|
-
}
|
|
173
|
-
if (!config.permission) {
|
|
174
|
-
config.permission = {};
|
|
175
|
-
}
|
|
176
|
-
const permission = config.permission;
|
|
177
|
-
const defaultConfigDir = path.join(os.homedir(), '.config', 'opencode');
|
|
178
|
-
const maxsimPath = opencodeConfigDir === defaultConfigDir
|
|
179
|
-
? '~/.config/opencode/maxsim/*'
|
|
180
|
-
: `${opencodeConfigDir.replace(/\\/g, '/')}/maxsim/*`;
|
|
181
|
-
let modified = false;
|
|
182
|
-
if (!permission.read || typeof permission.read !== 'object') {
|
|
183
|
-
permission.read = {};
|
|
184
|
-
}
|
|
185
|
-
if (permission.read[maxsimPath] !== 'allow') {
|
|
186
|
-
permission.read[maxsimPath] = 'allow';
|
|
187
|
-
modified = true;
|
|
188
|
-
}
|
|
189
|
-
if (!permission.external_directory ||
|
|
190
|
-
typeof permission.external_directory !== 'object') {
|
|
191
|
-
permission.external_directory = {};
|
|
192
|
-
}
|
|
193
|
-
if (permission.external_directory[maxsimPath] !== 'allow') {
|
|
194
|
-
permission.external_directory[maxsimPath] = 'allow';
|
|
195
|
-
modified = true;
|
|
196
|
-
}
|
|
197
|
-
if (!modified) {
|
|
198
|
-
return;
|
|
60
|
+
attributionValue = attr.commit;
|
|
199
61
|
}
|
|
200
|
-
|
|
201
|
-
|
|
62
|
+
attributionCached = true;
|
|
63
|
+
return attributionValue;
|
|
202
64
|
}
|
|
203
65
|
//# sourceMappingURL=adapters.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"adapters.js","sourceRoot":"","sources":["../../src/install/adapters.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"adapters.js","sourceRoot":"","sources":["../../src/install/adapters.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAeA,oDAmBC;AAlCD,gDAAkC;AAElC,mDAE8B;AAC9B,2CAA2C;AAE3C,iEAAiE;AACjE,IAAI,iBAAiB,GAAG,KAAK,CAAC;AAC9B,IAAI,gBAA2C,CAAC;AAEhD;;;GAGG;AACH,SAAgB,oBAAoB,CAAC,iBAAgC;IACnE,IAAI,iBAAiB,EAAE,CAAC;QACtB,OAAO,gBAAgB,CAAC;IAC1B,CAAC;IAED,MAAM,QAAQ,GAAG,IAAA,uBAAY,EAC3B,IAAI,CAAC,IAAI,CAAC,IAAA,wBAAY,EAAC,iBAAiB,CAAC,EAAE,eAAe,CAAC,CACjC,CAAC;IAC7B,MAAM,IAAI,GAAG,QAAQ,CAAC,WAA8C,CAAC;IACrE,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,MAAM,KAAK,SAAS,EAAE,CAAC;QACvC,gBAAgB,GAAG,SAAS,CAAC;IAC/B,CAAC;SAAM,IAAI,IAAI,CAAC,MAAM,KAAK,EAAE,EAAE,CAAC;QAC9B,gBAAgB,GAAG,IAAI,CAAC;IAC1B,CAAC;SAAM,CAAC;QACN,gBAAgB,GAAG,IAAI,CAAC,MAAM,CAAC;IACjC,CAAC;IAED,iBAAiB,GAAG,IAAI,CAAC;IACzB,OAAO,gBAAgB,CAAC;AAC1B,CAAC"}
|
package/dist/install/copy.d.ts
CHANGED
|
@@ -1,15 +1,6 @@
|
|
|
1
|
-
import type { RuntimeName } from '../adapters/index.js';
|
|
2
|
-
/**
|
|
3
|
-
* Copy commands to a flat structure for OpenCode
|
|
4
|
-
* OpenCode expects: command/maxsim-help.md (invoked as /maxsim-help)
|
|
5
|
-
* Source structure: commands/maxsim/help.md
|
|
6
|
-
*/
|
|
7
|
-
export declare function copyFlattenedCommands(srcDir: string, destDir: string, prefix: string, pathPrefix: string, runtime: RuntimeName, explicitConfigDir: string | null): void;
|
|
8
|
-
export declare function listCodexSkillNames(skillsDir: string, prefix?: string): string[];
|
|
9
|
-
export declare function copyCommandsAsCodexSkills(srcDir: string, skillsDir: string, prefix: string, pathPrefix: string, runtime: RuntimeName, explicitConfigDir: string | null): void;
|
|
10
1
|
/**
|
|
11
2
|
* Recursively copy directory, replacing paths in .md files
|
|
12
3
|
* Deletes existing destDir first to remove orphaned files from previous versions
|
|
13
4
|
*/
|
|
14
|
-
export declare function copyWithPathReplacement(srcDir: string, destDir: string, pathPrefix: string,
|
|
5
|
+
export declare function copyWithPathReplacement(srcDir: string, destDir: string, pathPrefix: string, explicitConfigDir: string | null, isCommand?: boolean): void;
|
|
15
6
|
//# sourceMappingURL=copy.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"copy.d.ts","sourceRoot":"","sources":["../../src/install/copy.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"copy.d.ts","sourceRoot":"","sources":["../../src/install/copy.ts"],"names":[],"mappings":"AAQA;;;GAGG;AACH,wBAAgB,uBAAuB,CACrC,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,MAAM,EACf,UAAU,EAAE,MAAM,EAClB,iBAAiB,EAAE,MAAM,GAAG,IAAI,EAChC,SAAS,GAAE,OAAe,GACzB,IAAI,CA0BN"}
|
package/dist/install/copy.js
CHANGED
|
@@ -33,115 +33,16 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
33
33
|
};
|
|
34
34
|
})();
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
exports.copyFlattenedCommands = copyFlattenedCommands;
|
|
37
|
-
exports.listCodexSkillNames = listCodexSkillNames;
|
|
38
|
-
exports.copyCommandsAsCodexSkills = copyCommandsAsCodexSkills;
|
|
39
36
|
exports.copyWithPathReplacement = copyWithPathReplacement;
|
|
40
37
|
const fs = __importStar(require("node:fs"));
|
|
41
38
|
const path = __importStar(require("node:path"));
|
|
42
39
|
const index_js_1 = require("../adapters/index.js");
|
|
43
|
-
const shared_js_1 = require("./shared.js");
|
|
44
40
|
const adapters_js_1 = require("./adapters.js");
|
|
45
|
-
/**
|
|
46
|
-
* Copy commands to a flat structure for OpenCode
|
|
47
|
-
* OpenCode expects: command/maxsim-help.md (invoked as /maxsim-help)
|
|
48
|
-
* Source structure: commands/maxsim/help.md
|
|
49
|
-
*/
|
|
50
|
-
function copyFlattenedCommands(srcDir, destDir, prefix, pathPrefix, runtime, explicitConfigDir) {
|
|
51
|
-
if (!fs.existsSync(srcDir)) {
|
|
52
|
-
return;
|
|
53
|
-
}
|
|
54
|
-
if (fs.existsSync(destDir)) {
|
|
55
|
-
for (const file of fs.readdirSync(destDir)) {
|
|
56
|
-
if (file.startsWith(`${prefix}-`) && file.endsWith('.md')) {
|
|
57
|
-
fs.unlinkSync(path.join(destDir, file));
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
else {
|
|
62
|
-
fs.mkdirSync(destDir, { recursive: true });
|
|
63
|
-
}
|
|
64
|
-
const entries = fs.readdirSync(srcDir, { withFileTypes: true });
|
|
65
|
-
for (const entry of entries) {
|
|
66
|
-
const srcPath = path.join(srcDir, entry.name);
|
|
67
|
-
if (entry.isDirectory()) {
|
|
68
|
-
copyFlattenedCommands(srcPath, destDir, `${prefix}-${entry.name}`, pathPrefix, runtime, explicitConfigDir);
|
|
69
|
-
}
|
|
70
|
-
else if (entry.name.endsWith('.md')) {
|
|
71
|
-
const baseName = entry.name.replace('.md', '');
|
|
72
|
-
const destName = `${prefix}-${baseName}.md`;
|
|
73
|
-
const destPath = path.join(destDir, destName);
|
|
74
|
-
let content = fs.readFileSync(srcPath, 'utf8');
|
|
75
|
-
const globalClaudeRegex = /~\/\.claude\//g;
|
|
76
|
-
const localClaudeRegex = /\.\/\.claude\//g;
|
|
77
|
-
const opencodeDirRegex = /~\/\.opencode\//g;
|
|
78
|
-
content = content.replace(globalClaudeRegex, pathPrefix);
|
|
79
|
-
content = content.replace(localClaudeRegex, `./${(0, shared_js_1.getDirName)(runtime)}/`);
|
|
80
|
-
content = content.replace(opencodeDirRegex, pathPrefix);
|
|
81
|
-
content = (0, index_js_1.processAttribution)(content, (0, adapters_js_1.getCommitAttribution)(runtime, explicitConfigDir));
|
|
82
|
-
content = (0, index_js_1.convertClaudeToOpencodeFrontmatter)(content);
|
|
83
|
-
fs.writeFileSync(destPath, content);
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
function listCodexSkillNames(skillsDir, prefix = 'maxsim-') {
|
|
88
|
-
if (!fs.existsSync(skillsDir))
|
|
89
|
-
return [];
|
|
90
|
-
const entries = fs.readdirSync(skillsDir, { withFileTypes: true });
|
|
91
|
-
return entries
|
|
92
|
-
.filter((entry) => entry.isDirectory() && entry.name.startsWith(prefix))
|
|
93
|
-
.filter((entry) => fs.existsSync(path.join(skillsDir, entry.name, 'SKILL.md')))
|
|
94
|
-
.map((entry) => entry.name)
|
|
95
|
-
.sort();
|
|
96
|
-
}
|
|
97
|
-
function copyCommandsAsCodexSkills(srcDir, skillsDir, prefix, pathPrefix, runtime, explicitConfigDir) {
|
|
98
|
-
if (!fs.existsSync(srcDir)) {
|
|
99
|
-
return;
|
|
100
|
-
}
|
|
101
|
-
fs.mkdirSync(skillsDir, { recursive: true });
|
|
102
|
-
const existing = fs.readdirSync(skillsDir, { withFileTypes: true });
|
|
103
|
-
for (const entry of existing) {
|
|
104
|
-
if (entry.isDirectory() && entry.name.startsWith(`${prefix}-`)) {
|
|
105
|
-
fs.rmSync(path.join(skillsDir, entry.name), { recursive: true });
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
function recurse(currentSrcDir, currentPrefix) {
|
|
109
|
-
const entries = fs.readdirSync(currentSrcDir, { withFileTypes: true });
|
|
110
|
-
for (const entry of entries) {
|
|
111
|
-
const srcPath = path.join(currentSrcDir, entry.name);
|
|
112
|
-
if (entry.isDirectory()) {
|
|
113
|
-
recurse(srcPath, `${currentPrefix}-${entry.name}`);
|
|
114
|
-
continue;
|
|
115
|
-
}
|
|
116
|
-
if (!entry.name.endsWith('.md')) {
|
|
117
|
-
continue;
|
|
118
|
-
}
|
|
119
|
-
const baseName = entry.name.replace('.md', '');
|
|
120
|
-
const skillName = `${currentPrefix}-${baseName}`;
|
|
121
|
-
const skillDir = path.join(skillsDir, skillName);
|
|
122
|
-
fs.mkdirSync(skillDir, { recursive: true });
|
|
123
|
-
let content = fs.readFileSync(srcPath, 'utf8');
|
|
124
|
-
const globalClaudeRegex = /~\/\.claude\//g;
|
|
125
|
-
const localClaudeRegex = /\.\/\.claude\//g;
|
|
126
|
-
const codexDirRegex = /~\/\.codex\//g;
|
|
127
|
-
content = content.replace(globalClaudeRegex, pathPrefix);
|
|
128
|
-
content = content.replace(localClaudeRegex, `./${(0, shared_js_1.getDirName)(runtime)}/`);
|
|
129
|
-
content = content.replace(codexDirRegex, pathPrefix);
|
|
130
|
-
content = (0, index_js_1.processAttribution)(content, (0, adapters_js_1.getCommitAttribution)(runtime, explicitConfigDir));
|
|
131
|
-
content = (0, index_js_1.convertClaudeCommandToCodexSkill)(content, skillName);
|
|
132
|
-
fs.writeFileSync(path.join(skillDir, 'SKILL.md'), content);
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
recurse(srcDir, prefix);
|
|
136
|
-
}
|
|
137
41
|
/**
|
|
138
42
|
* Recursively copy directory, replacing paths in .md files
|
|
139
43
|
* Deletes existing destDir first to remove orphaned files from previous versions
|
|
140
44
|
*/
|
|
141
|
-
function copyWithPathReplacement(srcDir, destDir, pathPrefix,
|
|
142
|
-
const isOpencode = runtime === 'opencode';
|
|
143
|
-
const isCodex = runtime === 'codex';
|
|
144
|
-
const dirName = (0, shared_js_1.getDirName)(runtime);
|
|
45
|
+
function copyWithPathReplacement(srcDir, destDir, pathPrefix, explicitConfigDir, isCommand = false) {
|
|
145
46
|
if (fs.existsSync(destDir)) {
|
|
146
47
|
fs.rmSync(destDir, { recursive: true });
|
|
147
48
|
}
|
|
@@ -151,37 +52,16 @@ function copyWithPathReplacement(srcDir, destDir, pathPrefix, runtime, explicitC
|
|
|
151
52
|
const srcPath = path.join(srcDir, entry.name);
|
|
152
53
|
const destPath = path.join(destDir, entry.name);
|
|
153
54
|
if (entry.isDirectory()) {
|
|
154
|
-
copyWithPathReplacement(srcPath, destPath, pathPrefix,
|
|
55
|
+
copyWithPathReplacement(srcPath, destPath, pathPrefix, explicitConfigDir, isCommand);
|
|
155
56
|
}
|
|
156
57
|
else if (entry.name.endsWith('.md')) {
|
|
157
58
|
let content = fs.readFileSync(srcPath, 'utf8');
|
|
158
59
|
const globalClaudeRegex = /~\/\.claude\//g;
|
|
159
60
|
const localClaudeRegex = /\.\/\.claude\//g;
|
|
160
61
|
content = content.replace(globalClaudeRegex, pathPrefix);
|
|
161
|
-
content = content.replace(localClaudeRegex,
|
|
162
|
-
content = (0, index_js_1.processAttribution)(content, (0, adapters_js_1.getCommitAttribution)(
|
|
163
|
-
|
|
164
|
-
content = (0, index_js_1.convertClaudeToOpencodeFrontmatter)(content);
|
|
165
|
-
fs.writeFileSync(destPath, content);
|
|
166
|
-
}
|
|
167
|
-
else if (runtime === 'gemini') {
|
|
168
|
-
if (isCommand) {
|
|
169
|
-
content = (0, index_js_1.stripSubTags)(content);
|
|
170
|
-
const tomlContent = (0, index_js_1.convertClaudeToGeminiToml)(content);
|
|
171
|
-
const tomlPath = destPath.replace(/\.md$/, '.toml');
|
|
172
|
-
fs.writeFileSync(tomlPath, tomlContent);
|
|
173
|
-
}
|
|
174
|
-
else {
|
|
175
|
-
fs.writeFileSync(destPath, content);
|
|
176
|
-
}
|
|
177
|
-
}
|
|
178
|
-
else if (isCodex) {
|
|
179
|
-
content = (0, index_js_1.convertClaudeToCodexMarkdown)(content);
|
|
180
|
-
fs.writeFileSync(destPath, content);
|
|
181
|
-
}
|
|
182
|
-
else {
|
|
183
|
-
fs.writeFileSync(destPath, content);
|
|
184
|
-
}
|
|
62
|
+
content = content.replace(localClaudeRegex, './.claude/');
|
|
63
|
+
content = (0, index_js_1.processAttribution)(content, (0, adapters_js_1.getCommitAttribution)(explicitConfigDir));
|
|
64
|
+
fs.writeFileSync(destPath, content);
|
|
185
65
|
}
|
|
186
66
|
else {
|
|
187
67
|
fs.copyFileSync(srcPath, destPath);
|
package/dist/install/copy.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"copy.js","sourceRoot":"","sources":["../../src/install/copy.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"copy.js","sourceRoot":"","sources":["../../src/install/copy.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAYA,0DAgCC;AA5CD,4CAA8B;AAC9B,gDAAkC;AAElC,mDAE8B;AAC9B,+CAAqD;AAErD;;;GAGG;AACH,SAAgB,uBAAuB,CACrC,MAAc,EACd,OAAe,EACf,UAAkB,EAClB,iBAAgC,EAChC,YAAqB,KAAK;IAE1B,IAAI,EAAE,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE,CAAC;QAC3B,EAAE,CAAC,MAAM,CAAC,OAAO,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IAC1C,CAAC;IACD,EAAE,CAAC,SAAS,CAAC,OAAO,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IAE3C,MAAM,OAAO,GAAG,EAAE,CAAC,WAAW,CAAC,MAAM,EAAE,EAAE,aAAa,EAAE,IAAI,EAAE,CAAC,CAAC;IAEhE,KAAK,MAAM,KAAK,IAAI,OAAO,EAAE,CAAC;QAC5B,MAAM,OAAO,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC;QAC9C,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC;QAEhD,IAAI,KAAK,CAAC,WAAW,EAAE,EAAE,CAAC;YACxB,uBAAuB,CAAC,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,iBAAiB,EAAE,SAAS,CAAC,CAAC;QACvF,CAAC;aAAM,IAAI,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC;YACtC,IAAI,OAAO,GAAG,EAAE,CAAC,YAAY,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;YAC/C,MAAM,iBAAiB,GAAG,gBAAgB,CAAC;YAC3C,MAAM,gBAAgB,GAAG,iBAAiB,CAAC;YAC3C,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,iBAAiB,EAAE,UAAU,CAAC,CAAC;YACzD,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,gBAAgB,EAAE,YAAY,CAAC,CAAC;YAC1D,OAAO,GAAG,IAAA,6BAAkB,EAAC,OAAO,EAAE,IAAA,kCAAoB,EAAC,iBAAiB,CAAC,CAAC,CAAC;YAC/E,EAAE,CAAC,aAAa,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;QACtC,CAAC;aAAM,CAAC;YACN,EAAE,CAAC,YAAY,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;QACrC,CAAC;IACH,CAAC;AACH,CAAC"}
|
package/dist/install/hooks.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import type { RuntimeName } from '../adapters/index.js';
|
|
2
1
|
/**
|
|
3
2
|
* Clean up orphaned files from previous MAXSIM versions
|
|
4
3
|
*/
|
|
@@ -8,13 +7,13 @@ export declare function cleanupOrphanedFiles(configDir: string): void;
|
|
|
8
7
|
*/
|
|
9
8
|
export declare function cleanupOrphanedHooks(settings: Record<string, unknown>): Record<string, unknown>;
|
|
10
9
|
/**
|
|
11
|
-
* Install hook files and configure settings.json
|
|
10
|
+
* Install hook files and configure settings.json
|
|
12
11
|
*/
|
|
13
|
-
export declare function installHookFiles(targetDir: string,
|
|
12
|
+
export declare function installHookFiles(targetDir: string, isGlobal: boolean, failures: string[]): void;
|
|
14
13
|
/**
|
|
15
14
|
* Configure hooks and statusline in settings.json
|
|
16
15
|
*/
|
|
17
|
-
export declare function configureSettingsHooks(targetDir: string,
|
|
16
|
+
export declare function configureSettingsHooks(targetDir: string, isGlobal: boolean): {
|
|
18
17
|
settingsPath: string;
|
|
19
18
|
settings: Record<string, unknown>;
|
|
20
19
|
statuslineCommand: string;
|
|
@@ -28,5 +27,5 @@ export declare function handleStatusline(settings: Record<string, unknown>, isIn
|
|
|
28
27
|
/**
|
|
29
28
|
* Apply statusline config, then print completion message
|
|
30
29
|
*/
|
|
31
|
-
export declare function finishInstall(settingsPath: string | null, settings: Record<string, unknown> | null, statuslineCommand: string | null, shouldInstallStatusline: boolean,
|
|
30
|
+
export declare function finishInstall(settingsPath: string | null, settings: Record<string, unknown> | null, statuslineCommand: string | null, shouldInstallStatusline: boolean, isGlobal?: boolean): void;
|
|
32
31
|
//# sourceMappingURL=hooks.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hooks.d.ts","sourceRoot":"","sources":["../../src/install/hooks.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"hooks.d.ts","sourceRoot":"","sources":["../../src/install/hooks.ts"],"names":[],"mappings":"AAcA;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAa5D;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAClC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAChC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAgEzB;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAC9B,SAAS,EAAE,MAAM,EACjB,QAAQ,EAAE,OAAO,EACjB,QAAQ,EAAE,MAAM,EAAE,GACjB,IAAI,CAiCN;AAED;;GAEG;AACH,wBAAgB,sBAAsB,CACpC,SAAS,EAAE,MAAM,EACjB,QAAQ,EAAE,OAAO,GAChB;IAAE,YAAY,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAAC,iBAAiB,EAAE,MAAM,CAAC;IAAC,kBAAkB,EAAE,MAAM,CAAC;IAAC,qBAAqB,EAAE,MAAM,CAAA;CAAE,CA8EnJ;AAED;;GAEG;AACH,wBAAsB,gBAAgB,CACpC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACjC,aAAa,EAAE,OAAO,EACtB,eAAe,EAAE,OAAO,GACvB,OAAO,CAAC,OAAO,CAAC,CAqClB;AAED;;GAEG;AACH,wBAAgB,aAAa,CAC3B,YAAY,EAAE,MAAM,GAAG,IAAI,EAC3B,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,EACxC,iBAAiB,EAAE,MAAM,GAAG,IAAI,EAChC,uBAAuB,EAAE,OAAO,EAChC,QAAQ,GAAE,OAAc,GACvB,IAAI,CAkBN"}
|
package/dist/install/hooks.js
CHANGED
|
@@ -46,7 +46,6 @@ const fs = __importStar(require("node:fs"));
|
|
|
46
46
|
const chalk_1 = __importDefault(require("chalk"));
|
|
47
47
|
const prompts_1 = require("@inquirer/prompts");
|
|
48
48
|
const index_js_1 = require("../adapters/index.js");
|
|
49
|
-
const adapters_js_1 = require("./adapters.js");
|
|
50
49
|
const shared_js_1 = require("./shared.js");
|
|
51
50
|
const path = __importStar(require("node:path"));
|
|
52
51
|
const ora_1 = __importDefault(require("ora"));
|
|
@@ -112,13 +111,9 @@ function cleanupOrphanedHooks(settings) {
|
|
|
112
111
|
return settings;
|
|
113
112
|
}
|
|
114
113
|
/**
|
|
115
|
-
* Install hook files and configure settings.json
|
|
114
|
+
* Install hook files and configure settings.json
|
|
116
115
|
*/
|
|
117
|
-
function installHookFiles(targetDir,
|
|
118
|
-
const dirName = (0, shared_js_1.getDirName)(runtime);
|
|
119
|
-
const isCodex = runtime === 'codex';
|
|
120
|
-
if (isCodex)
|
|
121
|
-
return;
|
|
116
|
+
function installHookFiles(targetDir, isGlobal, failures) {
|
|
122
117
|
// Copy hooks from bundled assets directory
|
|
123
118
|
let hooksSrc = null;
|
|
124
119
|
const bundledHooksDir = path.resolve(__dirname, 'assets', 'hooks');
|
|
@@ -133,7 +128,7 @@ function installHookFiles(targetDir, runtime, isGlobal, failures) {
|
|
|
133
128
|
const hooksDest = path.join(targetDir, 'hooks');
|
|
134
129
|
fs.mkdirSync(hooksDest, { recursive: true });
|
|
135
130
|
const hookEntries = fs.readdirSync(hooksSrc);
|
|
136
|
-
const configDirReplacement = (0, shared_js_1.getConfigDirFromHome)(
|
|
131
|
+
const configDirReplacement = (0, shared_js_1.getConfigDirFromHome)(isGlobal);
|
|
137
132
|
for (const entry of hookEntries) {
|
|
138
133
|
const srcFile = path.join(hooksSrc, entry);
|
|
139
134
|
if (fs.statSync(srcFile).isFile() && entry.endsWith('.cjs') && !entry.includes('.d.')) {
|
|
@@ -156,9 +151,8 @@ function installHookFiles(targetDir, runtime, isGlobal, failures) {
|
|
|
156
151
|
/**
|
|
157
152
|
* Configure hooks and statusline in settings.json
|
|
158
153
|
*/
|
|
159
|
-
function configureSettingsHooks(targetDir,
|
|
160
|
-
const dirName = (0, shared_js_1.getDirName)(
|
|
161
|
-
const isOpencode = runtime === 'opencode';
|
|
154
|
+
function configureSettingsHooks(targetDir, isGlobal) {
|
|
155
|
+
const dirName = (0, shared_js_1.getDirName)();
|
|
162
156
|
const settingsPath = path.join(targetDir, 'settings.json');
|
|
163
157
|
const settings = cleanupOrphanedHooks((0, index_js_1.readSettings)(settingsPath));
|
|
164
158
|
const statuslineCommand = isGlobal
|
|
@@ -170,45 +164,43 @@ function configureSettingsHooks(targetDir, runtime, isGlobal) {
|
|
|
170
164
|
const contextMonitorCommand = isGlobal
|
|
171
165
|
? (0, index_js_1.buildHookCommand)(targetDir, 'maxsim-context-monitor.js')
|
|
172
166
|
: 'node ' + dirName + '/hooks/maxsim-context-monitor.js';
|
|
173
|
-
// Configure SessionStart hook for update checking
|
|
174
|
-
if (!
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
console.log(` ${chalk_1.default.green('\u2713')} Configured context window monitor hook`);
|
|
211
|
-
}
|
|
167
|
+
// Configure SessionStart hook for update checking
|
|
168
|
+
if (!settings.hooks) {
|
|
169
|
+
settings.hooks = {};
|
|
170
|
+
}
|
|
171
|
+
const installHooks = settings.hooks;
|
|
172
|
+
if (!installHooks.SessionStart) {
|
|
173
|
+
installHooks.SessionStart = [];
|
|
174
|
+
}
|
|
175
|
+
const hasMaxsimUpdateHook = installHooks.SessionStart.some((entry) => entry.hooks &&
|
|
176
|
+
entry.hooks.some((h) => h.command && h.command.includes('maxsim-check-update')));
|
|
177
|
+
if (!hasMaxsimUpdateHook) {
|
|
178
|
+
installHooks.SessionStart.push({
|
|
179
|
+
hooks: [
|
|
180
|
+
{
|
|
181
|
+
type: 'command',
|
|
182
|
+
command: updateCheckCommand,
|
|
183
|
+
},
|
|
184
|
+
],
|
|
185
|
+
});
|
|
186
|
+
console.log(` ${chalk_1.default.green('\u2713')} Configured update check hook`);
|
|
187
|
+
}
|
|
188
|
+
// Configure PostToolUse hook for context window monitoring
|
|
189
|
+
if (!installHooks.PostToolUse) {
|
|
190
|
+
installHooks.PostToolUse = [];
|
|
191
|
+
}
|
|
192
|
+
const hasContextMonitorHook = installHooks.PostToolUse.some((entry) => entry.hooks &&
|
|
193
|
+
entry.hooks.some((h) => h.command && h.command.includes('maxsim-context-monitor')));
|
|
194
|
+
if (!hasContextMonitorHook) {
|
|
195
|
+
installHooks.PostToolUse.push({
|
|
196
|
+
hooks: [
|
|
197
|
+
{
|
|
198
|
+
type: 'command',
|
|
199
|
+
command: contextMonitorCommand,
|
|
200
|
+
},
|
|
201
|
+
],
|
|
202
|
+
});
|
|
203
|
+
console.log(` ${chalk_1.default.green('\u2713')} Configured context window monitor hook`);
|
|
212
204
|
}
|
|
213
205
|
return { settingsPath, settings, statuslineCommand, updateCheckCommand, contextMonitorCommand };
|
|
214
206
|
}
|
|
@@ -248,36 +240,19 @@ async function handleStatusline(settings, isInteractive, forceStatusline) {
|
|
|
248
240
|
/**
|
|
249
241
|
* Apply statusline config, then print completion message
|
|
250
242
|
*/
|
|
251
|
-
function finishInstall(settingsPath, settings, statuslineCommand, shouldInstallStatusline,
|
|
252
|
-
|
|
253
|
-
const isCodex = runtime === 'codex';
|
|
254
|
-
if (shouldInstallStatusline && !isOpencode && !isCodex) {
|
|
243
|
+
function finishInstall(settingsPath, settings, statuslineCommand, shouldInstallStatusline, isGlobal = true) {
|
|
244
|
+
if (shouldInstallStatusline) {
|
|
255
245
|
settings.statusLine = {
|
|
256
246
|
type: 'command',
|
|
257
247
|
command: statuslineCommand,
|
|
258
248
|
};
|
|
259
249
|
console.log(` ${chalk_1.default.green('\u2713')} Configured statusline`);
|
|
260
250
|
}
|
|
261
|
-
if (
|
|
251
|
+
if (settingsPath && settings) {
|
|
262
252
|
(0, index_js_1.writeSettings)(settingsPath, settings);
|
|
263
253
|
}
|
|
264
|
-
if (isOpencode) {
|
|
265
|
-
(0, adapters_js_1.configureOpencodePermissions)(isGlobal);
|
|
266
|
-
}
|
|
267
|
-
let program = 'Claude Code';
|
|
268
|
-
if (runtime === 'opencode')
|
|
269
|
-
program = 'OpenCode';
|
|
270
|
-
if (runtime === 'gemini')
|
|
271
|
-
program = 'Gemini';
|
|
272
|
-
if (runtime === 'codex')
|
|
273
|
-
program = 'Codex';
|
|
274
|
-
let command = '/maxsim:help';
|
|
275
|
-
if (runtime === 'opencode')
|
|
276
|
-
command = '/maxsim-help';
|
|
277
|
-
if (runtime === 'codex')
|
|
278
|
-
command = '$maxsim-help';
|
|
279
254
|
console.log(`
|
|
280
|
-
${chalk_1.default.green('Done!')} Launch
|
|
255
|
+
${chalk_1.default.green('Done!')} Launch Claude Code and run ${chalk_1.default.cyan('/maxsim:help')}.
|
|
281
256
|
|
|
282
257
|
${chalk_1.default.cyan('Join the community:')} https://discord.gg/5JJgD5svVS
|
|
283
258
|
`);
|