gramatr 0.3.44 → 0.3.45
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/bin/install.ts +14 -18
- package/codex/install.ts +6 -2
- package/core/version.ts +1 -1
- package/gemini/install.ts +6 -2
- package/package.json +1 -1
package/bin/install.ts
CHANGED
|
@@ -577,7 +577,7 @@ function registerMcpServer(url: string, token: string): void {
|
|
|
577
577
|
|
|
578
578
|
// ── Step 4c: Additional CLIs ──
|
|
579
579
|
|
|
580
|
-
function installAdditionalClis(
|
|
580
|
+
async function installAdditionalClis(): Promise<void> {
|
|
581
581
|
log('━━━ Step 4c: Additional CLI platforms ━━━');
|
|
582
582
|
log('');
|
|
583
583
|
|
|
@@ -585,14 +585,12 @@ function installAdditionalClis(tsRunner: string): void {
|
|
|
585
585
|
const codexDir = join(HOME, '.codex');
|
|
586
586
|
if (existsSync(codexDir) || which('codex')) {
|
|
587
587
|
log(' Codex CLI detected — installing gramatr hooks...');
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
log(' X Codex install failed (non-fatal)');
|
|
595
|
-
}
|
|
588
|
+
try {
|
|
589
|
+
const { main: installCodex } = await import('../codex/install.ts');
|
|
590
|
+
installCodex();
|
|
591
|
+
log(' OK Codex hooks installed');
|
|
592
|
+
} catch (err: any) {
|
|
593
|
+
log(` X Codex install failed (non-fatal): ${err.message}`);
|
|
596
594
|
}
|
|
597
595
|
log('');
|
|
598
596
|
} else {
|
|
@@ -603,14 +601,12 @@ function installAdditionalClis(tsRunner: string): void {
|
|
|
603
601
|
const geminiDir = join(HOME, '.gemini');
|
|
604
602
|
if (existsSync(geminiDir) || which('gemini')) {
|
|
605
603
|
log(' Gemini CLI detected — installing gramatr extension...');
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
log(' X Gemini install failed (non-fatal)');
|
|
613
|
-
}
|
|
604
|
+
try {
|
|
605
|
+
const { main: installGemini } = await import('../gemini/install.ts');
|
|
606
|
+
await installGemini();
|
|
607
|
+
log(' OK Gemini extension installed');
|
|
608
|
+
} catch (err: any) {
|
|
609
|
+
log(` X Gemini install failed (non-fatal): ${err.message}`);
|
|
614
610
|
}
|
|
615
611
|
log('');
|
|
616
612
|
} else {
|
|
@@ -721,7 +717,7 @@ async function main(): Promise<void> {
|
|
|
721
717
|
await configureIdentity();
|
|
722
718
|
updateClaudeSettings(tsRunner, url, token);
|
|
723
719
|
registerMcpServer(url, token);
|
|
724
|
-
installAdditionalClis(
|
|
720
|
+
await installAdditionalClis();
|
|
725
721
|
|
|
726
722
|
const allOk = verify(url, token);
|
|
727
723
|
|
package/codex/install.ts
CHANGED
|
@@ -41,7 +41,7 @@ function readJsonFile<T>(path: string, fallback: T): T {
|
|
|
41
41
|
return JSON.parse(readFileSync(path, 'utf8')) as T;
|
|
42
42
|
}
|
|
43
43
|
|
|
44
|
-
function main(): void {
|
|
44
|
+
export function main(): void {
|
|
45
45
|
const home = process.env.HOME || process.env.USERPROFILE;
|
|
46
46
|
if (!home) {
|
|
47
47
|
throw new Error('HOME is not set');
|
|
@@ -109,4 +109,8 @@ function main(): void {
|
|
|
109
109
|
log('Restart Codex or start a new session to load the updated hook configuration.');
|
|
110
110
|
}
|
|
111
111
|
|
|
112
|
-
|
|
112
|
+
// Run directly when executed as a script
|
|
113
|
+
const isDirectRun = typeof require !== 'undefined'
|
|
114
|
+
? require.main === module
|
|
115
|
+
: !import.meta.url.includes('node_modules/gramatr/bin/');
|
|
116
|
+
if (isDirectRun) main();
|
package/core/version.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/** Auto-generated by version-sync.ts — do not edit */
|
|
2
|
-
export const VERSION = '0.3.
|
|
2
|
+
export const VERSION = '0.3.45';
|
package/gemini/install.ts
CHANGED
|
@@ -163,7 +163,7 @@ async function resolveApiKey(home: string): Promise<string | null> {
|
|
|
163
163
|
return null;
|
|
164
164
|
}
|
|
165
165
|
|
|
166
|
-
async function main(): Promise<void> {
|
|
166
|
+
export async function main(): Promise<void> {
|
|
167
167
|
const home = process.env.HOME || process.env.USERPROFILE;
|
|
168
168
|
if (!home) {
|
|
169
169
|
throw new Error('HOME is not set');
|
|
@@ -269,4 +269,8 @@ async function main(): Promise<void> {
|
|
|
269
269
|
log('');
|
|
270
270
|
}
|
|
271
271
|
|
|
272
|
-
|
|
272
|
+
// Run directly when executed as a script
|
|
273
|
+
const isDirectRun = typeof require !== 'undefined'
|
|
274
|
+
? require.main === module
|
|
275
|
+
: !import.meta.url.includes('node_modules/gramatr/bin/');
|
|
276
|
+
if (isDirectRun) main();
|