contextecf-codeledger 0.10.9 → 0.10.10
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/codeledger.js +37 -14
- package/package.json +1 -1
- package/scripts/postinstall.js +27 -11
package/bin/codeledger.js
CHANGED
|
@@ -38,21 +38,44 @@ function die(msg, code = 1) {
|
|
|
38
38
|
}
|
|
39
39
|
|
|
40
40
|
if (!existsSync(BINARY_PATH)) {
|
|
41
|
+
const { arch } = require('node:os');
|
|
42
|
+
const platformKey = `${platform()}-${arch()}`;
|
|
41
43
|
const installerPath = join(__dirname, '..', 'scripts', 'postinstall.js');
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
44
|
+
|
|
45
|
+
if (platformKey === 'darwin-x64') {
|
|
46
|
+
die(
|
|
47
|
+
[
|
|
48
|
+
`hardened binary for v${version} not found at ${BINARY_PATH}.`,
|
|
49
|
+
'',
|
|
50
|
+
'You are on an Intel Mac (darwin-x64). Pre-built binaries are',
|
|
51
|
+
'available for Apple Silicon (darwin-arm64) only.',
|
|
52
|
+
'',
|
|
53
|
+
'Options:',
|
|
54
|
+
' 1. Use Rosetta 2 (recommended):',
|
|
55
|
+
' arch -arm64 npm install -g contextecf-codeledger',
|
|
56
|
+
' 2. Use the vendored standalone CLI:',
|
|
57
|
+
' codeledger init # in your repo, sets up vendored Node.js-based CLI',
|
|
58
|
+
' ./.codeledger/bin/codeledger --version',
|
|
59
|
+
' 3. Download a binary manually from:',
|
|
60
|
+
` https://github.com/codeledgerECF/codeledger/releases/tag/v${version}`,
|
|
61
|
+
].join('\n'),
|
|
62
|
+
);
|
|
63
|
+
} else {
|
|
64
|
+
die(
|
|
65
|
+
[
|
|
66
|
+
`hardened binary for v${version} not found at ${BINARY_PATH}.`,
|
|
67
|
+
'',
|
|
68
|
+
'The postinstall step may have been skipped (e.g. --ignore-scripts).',
|
|
69
|
+
'Recover with one of:',
|
|
70
|
+
` 1. npm rebuild contextecf-codeledger`,
|
|
71
|
+
` 2. node "${installerPath}"`,
|
|
72
|
+
` 3. Re-run the install without --ignore-scripts`,
|
|
73
|
+
'',
|
|
74
|
+
'Or download the binary manually from:',
|
|
75
|
+
` https://github.com/codeledgerECF/codeledger/releases/tag/v${version}`,
|
|
76
|
+
].join('\n'),
|
|
77
|
+
);
|
|
78
|
+
}
|
|
56
79
|
}
|
|
57
80
|
|
|
58
81
|
const result = spawnSync(BINARY_PATH, process.argv.slice(2), {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "contextecf-codeledger",
|
|
3
|
-
"version": "0.10.
|
|
3
|
+
"version": "0.10.10",
|
|
4
4
|
"mcpName": "io.github.codeledgerECF/codeledger",
|
|
5
5
|
"description": "CodeLedger by ContextECF — deterministic context selection for AI coding agents. This is the unscoped mirror of @codeledger/cli; both install the same binary.",
|
|
6
6
|
"type": "commonjs",
|
package/scripts/postinstall.js
CHANGED
|
@@ -80,17 +80,33 @@ const platformKey = `${platform()}-${arch()}`;
|
|
|
80
80
|
const platformSuffix = PLATFORM_MAP[platformKey];
|
|
81
81
|
|
|
82
82
|
if (!platformSuffix) {
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
'
|
|
93
|
-
|
|
83
|
+
if (platformKey === 'darwin-x64') {
|
|
84
|
+
console.log('');
|
|
85
|
+
console.log('codeledger: Intel Mac (darwin-x64) detected.');
|
|
86
|
+
console.log('codeledger: Pre-built binaries are available for Apple Silicon (darwin-arm64) only.');
|
|
87
|
+
console.log('');
|
|
88
|
+
console.log('Options:');
|
|
89
|
+
console.log(' 1. Use Rosetta 2 (recommended):');
|
|
90
|
+
console.log(' arch -arm64 npm install -g contextecf-codeledger');
|
|
91
|
+
console.log(' 2. Use the vendored standalone CLI after init:');
|
|
92
|
+
console.log(' CODELEDGER_SKIP_POSTINSTALL=1 npm install -g contextecf-codeledger');
|
|
93
|
+
console.log(' codeledger init # sets up vendored Node.js-based CLI');
|
|
94
|
+
console.log(' 3. Download a binary manually from:');
|
|
95
|
+
console.log(` https://github.com/codeledgerECF/codeledger/releases/tag/v${version}`);
|
|
96
|
+
console.log('');
|
|
97
|
+
} else {
|
|
98
|
+
console.error(
|
|
99
|
+
`codeledger: unsupported platform ${platformKey}. Supported: ${Object.keys(
|
|
100
|
+
PLATFORM_MAP,
|
|
101
|
+
).join(', ')}`,
|
|
102
|
+
);
|
|
103
|
+
console.error(
|
|
104
|
+
`codeledger: v${version} does not provide a hardened binary for ${platformKey}.`,
|
|
105
|
+
);
|
|
106
|
+
console.error(
|
|
107
|
+
'codeledger: you can still run from source by cloning the blackbox repo.',
|
|
108
|
+
);
|
|
109
|
+
}
|
|
94
110
|
// Fail softly: don't block `npm install` for unsupported platforms. The
|
|
95
111
|
// bin shim will tell the user what happened when they first run `codeledger`.
|
|
96
112
|
process.exit(0);
|