contextecf-codeledger 0.10.18 → 0.10.20
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 +13 -4
- package/bin/codeledger.js +9 -7
- package/package.json +3 -3
- package/scripts/postinstall.js +23 -37
package/README.md
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
# contextecf-codeledger — CodeLedger
|
|
1
|
+
# contextecf-codeledger — CodeLedger
|
|
2
2
|
|
|
3
3
|
**Deterministic, bounded context selection for AI coding agents.**
|
|
4
|
-
Published by [
|
|
4
|
+
Published by [Intelligent Context AI, Inc.](https://codeledger.dev).
|
|
5
5
|
|
|
6
6
|
This is the **unscoped mirror** of [`@codeledger/cli`](https://www.npmjs.com/package/@codeledger/cli). Both packages install the exact same binary. Use whichever you prefer:
|
|
7
7
|
|
|
8
8
|
```bash
|
|
9
|
-
npm install -g contextecf-codeledger # this package
|
|
10
|
-
npm install -g @codeledger/cli # scoped original
|
|
9
|
+
npm install -g contextecf-codeledger@latest # this package
|
|
10
|
+
npm install -g @codeledger/cli@latest # scoped original
|
|
11
11
|
```
|
|
12
12
|
|
|
13
13
|
## Why two packages?
|
|
@@ -22,6 +22,15 @@ codeledger activate --task "describe your task"
|
|
|
22
22
|
codeledger mcp start # for Claude Desktop / Cursor MCP integration
|
|
23
23
|
```
|
|
24
24
|
|
|
25
|
+
If you installed an earlier CodeLedger version and `codeledger vendor`
|
|
26
|
+
cannot find the standalone runtime, upgrade first and rerun the command:
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
npm install -g contextecf-codeledger@latest
|
|
30
|
+
codeledger init
|
|
31
|
+
codeledger vendor
|
|
32
|
+
```
|
|
33
|
+
|
|
25
34
|
## Links
|
|
26
35
|
|
|
27
36
|
- Website: https://codeledger.dev
|
package/bin/codeledger.js
CHANGED
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
* This is the unscoped mirror of @codeledger/cli. Both packages install
|
|
6
6
|
* the exact same hardened binary. You can install either:
|
|
7
7
|
*
|
|
8
|
-
* npm install -g contextecf-codeledger (this package)
|
|
9
|
-
* npm install -g @codeledger/cli (scoped original)
|
|
8
|
+
* npm install -g contextecf-codeledger@latest (this package)
|
|
9
|
+
* npm install -g @codeledger/cli@latest (scoped original)
|
|
10
10
|
*
|
|
11
11
|
* This file contains no engine code. All CodeLedger functionality lives
|
|
12
12
|
* inside the hardened binary downloaded during postinstall.
|
|
@@ -52,8 +52,9 @@ if (!existsSync(BINARY_PATH)) {
|
|
|
52
52
|
'',
|
|
53
53
|
'Options:',
|
|
54
54
|
' 1. Use Rosetta 2 (recommended):',
|
|
55
|
-
' arch -arm64 npm install -g contextecf-codeledger',
|
|
56
|
-
' 2.
|
|
55
|
+
' arch -arm64 npm install -g contextecf-codeledger@latest',
|
|
56
|
+
' 2. Update CodeLedger, then use the vendored standalone CLI:',
|
|
57
|
+
' npm install -g contextecf-codeledger@latest',
|
|
57
58
|
' codeledger init # in your repo, sets up vendored Node.js-based CLI',
|
|
58
59
|
' ./.codeledger/bin/codeledger --version',
|
|
59
60
|
' 3. Download a binary manually from:',
|
|
@@ -67,9 +68,10 @@ if (!existsSync(BINARY_PATH)) {
|
|
|
67
68
|
'',
|
|
68
69
|
'The postinstall step may have been skipped (e.g. --ignore-scripts).',
|
|
69
70
|
'Recover with one of:',
|
|
70
|
-
` 1. npm
|
|
71
|
-
` 2.
|
|
72
|
-
` 3.
|
|
71
|
+
` 1. Upgrade: npm install -g contextecf-codeledger@latest`,
|
|
72
|
+
` 2. Retry this install: npm rebuild contextecf-codeledger`,
|
|
73
|
+
` 3. node "${installerPath}"`,
|
|
74
|
+
` 4. Re-run the install without --ignore-scripts`,
|
|
73
75
|
'',
|
|
74
76
|
'Or download the binary manually from:',
|
|
75
77
|
` https://github.com/codeledgerECF/codeledger/releases/tag/v${version}`,
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "contextecf-codeledger",
|
|
3
|
-
"version": "0.10.
|
|
3
|
+
"version": "0.10.20",
|
|
4
4
|
"mcpName": "io.github.codeledgerECF/codeledger",
|
|
5
|
-
"description": "CodeLedger
|
|
5
|
+
"description": "CodeLedger — deterministic context selection for AI coding agents. This is the unscoped mirror of @codeledger/cli; both install the same binary.",
|
|
6
6
|
"type": "commonjs",
|
|
7
7
|
"bin": {
|
|
8
8
|
"codeledger": "./bin/codeledger.js"
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
},
|
|
23
23
|
"repository": {
|
|
24
24
|
"type": "git",
|
|
25
|
-
"url": "github:codeledgerECF/codeledger
|
|
25
|
+
"url": "github:codeledgerECF/codeledger"
|
|
26
26
|
},
|
|
27
27
|
"license": "SEE LICENSE IN LICENSE",
|
|
28
28
|
"keywords": [
|
package/scripts/postinstall.js
CHANGED
|
@@ -46,11 +46,10 @@ if (process.env.CODELEDGER_SKIP_POSTINSTALL === '1') {
|
|
|
46
46
|
process.exit(0);
|
|
47
47
|
}
|
|
48
48
|
|
|
49
|
-
// Skip when running inside
|
|
50
|
-
//
|
|
51
|
-
//
|
|
52
|
-
//
|
|
53
|
-
// version may not even exist yet.
|
|
49
|
+
// Skip when running inside this source workspace (dev mode). The presence of
|
|
50
|
+
// pnpm-workspace.yaml two directories up is a reliable signal that this is not
|
|
51
|
+
// a real end-user install, and the release binary for this version may not
|
|
52
|
+
// exist yet.
|
|
54
53
|
try {
|
|
55
54
|
const path = require('node:path');
|
|
56
55
|
const fs = require('node:fs');
|
|
@@ -69,8 +68,7 @@ try {
|
|
|
69
68
|
// Mac runner on the release CI plan as of 2026-04-09. Intel Mac
|
|
70
69
|
// users hit the "unsupported platform" soft-fail below, which tells
|
|
71
70
|
// them to download manually from the GitHub Release. Re-add when a
|
|
72
|
-
// working Intel Mac
|
|
73
|
-
// matrix comment).
|
|
71
|
+
// working Intel Mac binary is available.
|
|
74
72
|
const PLATFORM_MAP = {
|
|
75
73
|
'darwin-arm64': 'darwin-arm64',
|
|
76
74
|
'linux-x64': 'linux-x64',
|
|
@@ -87,9 +85,9 @@ if (!platformSuffix) {
|
|
|
87
85
|
console.log('');
|
|
88
86
|
console.log('Options:');
|
|
89
87
|
console.log(' 1. Use Rosetta 2 (recommended):');
|
|
90
|
-
console.log(' arch -arm64 npm install -g contextecf-codeledger');
|
|
88
|
+
console.log(' arch -arm64 npm install -g contextecf-codeledger@latest');
|
|
91
89
|
console.log(' 2. Use the vendored standalone CLI after init:');
|
|
92
|
-
console.log(' CODELEDGER_SKIP_POSTINSTALL=1 npm install -g contextecf-codeledger');
|
|
90
|
+
console.log(' CODELEDGER_SKIP_POSTINSTALL=1 npm install -g contextecf-codeledger@latest');
|
|
93
91
|
console.log(' codeledger init # sets up vendored Node.js-based CLI');
|
|
94
92
|
console.log(' 3. Download a binary manually from:');
|
|
95
93
|
console.log(` https://github.com/codeledgerECF/codeledger/releases/tag/v${version}`);
|
|
@@ -104,7 +102,7 @@ if (!platformSuffix) {
|
|
|
104
102
|
`codeledger: v${version} does not provide a hardened binary for ${platformKey}.`,
|
|
105
103
|
);
|
|
106
104
|
console.error(
|
|
107
|
-
'codeledger: you can still
|
|
105
|
+
'codeledger: you can still use the published source package or a supported release asset.',
|
|
108
106
|
);
|
|
109
107
|
}
|
|
110
108
|
// Fail softly: don't block `npm install` for unsupported platforms. The
|
|
@@ -112,13 +110,8 @@ if (!platformSuffix) {
|
|
|
112
110
|
process.exit(0);
|
|
113
111
|
}
|
|
114
112
|
|
|
115
|
-
// Binaries are hosted on the
|
|
116
|
-
//
|
|
117
|
-
// assets are not anonymously downloadable). The release pipeline in
|
|
118
|
-
// codeledger-blackbox builds the binaries, then a promote_binaries
|
|
119
|
-
// job uploads them cross-repo to the public release using a PAT.
|
|
120
|
-
// Users' `npm install -g @codeledger/cli` fetches from the public
|
|
121
|
-
// URL with no auth required.
|
|
113
|
+
// Binaries are hosted on the public CodeLedger GitHub Releases page so
|
|
114
|
+
// `npm install -g @codeledger/cli` can fetch them without authentication.
|
|
122
115
|
const RELEASE_BASE =
|
|
123
116
|
process.env.CODELEDGER_BINARY_URL ||
|
|
124
117
|
`https://github.com/codeledgerECF/codeledger/releases/download/v${version}`;
|
|
@@ -181,18 +174,9 @@ function fetchBufferOnce(url, redirectDepth = 0) {
|
|
|
181
174
|
});
|
|
182
175
|
}
|
|
183
176
|
|
|
184
|
-
// Retry wrapper that tolerates the
|
|
185
|
-
//
|
|
186
|
-
//
|
|
187
|
-
// binaries land on the public GitHub release (see the Phase 1d comment
|
|
188
|
-
// in release-dispatch.yml). For up to ~10 minutes after a user first
|
|
189
|
-
// sees @codeledger/cli@<version> on npm, the hardened binary URL may
|
|
190
|
-
// 404. This wrapper retries 404s with exponential backoff (10s, 20s,
|
|
191
|
-
// 40s, 60s, 60s, 60s, 60s, 60s, 60s, 60s → 450s total) so installs
|
|
192
|
-
// during the race window eventually succeed instead of hard-failing.
|
|
193
|
-
//
|
|
194
|
-
// Non-404 errors (DNS, network, timeouts) fail fast — retrying a DNS
|
|
195
|
-
// failure won't help.
|
|
177
|
+
// Retry wrapper that tolerates the short propagation window where a freshly
|
|
178
|
+
// published package may be visible before all release assets are available.
|
|
179
|
+
// A 404 is retried with exponential backoff; non-404 errors fail fast.
|
|
196
180
|
async function fetchBuffer(url) {
|
|
197
181
|
const backoffs = [10, 20, 40, 60, 60, 60, 60, 60, 60, 60]; // seconds
|
|
198
182
|
let lastErr;
|
|
@@ -206,8 +190,9 @@ async function fetchBuffer(url) {
|
|
|
206
190
|
if (i === backoffs.length) break;
|
|
207
191
|
const wait = backoffs[i];
|
|
208
192
|
console.log(
|
|
209
|
-
`codeledger:
|
|
210
|
-
`(attempt ${i + 1}/${backoffs.length + 1}
|
|
193
|
+
`codeledger: Binary pending — new release detected, retrying in ${wait}s ` +
|
|
194
|
+
`(attempt ${i + 1}/${backoffs.length + 1}). ` +
|
|
195
|
+
`This is normal for the first ~10 minutes after a release.`,
|
|
211
196
|
);
|
|
212
197
|
await new Promise((r) => setTimeout(r, wait * 1000));
|
|
213
198
|
}
|
|
@@ -283,16 +268,17 @@ if (require.main === module) {
|
|
|
283
268
|
console.error(`codeledger: postinstall failed — ${err.message}`);
|
|
284
269
|
console.error('');
|
|
285
270
|
console.error('Recovery options:');
|
|
286
|
-
console.error(' 1.
|
|
287
|
-
console.error(' 2.
|
|
288
|
-
console.error('
|
|
271
|
+
console.error(' 1. Upgrade: npm install -g contextecf-codeledger@latest');
|
|
272
|
+
console.error(' 2. Retry this install: npm rebuild contextecf-codeledger');
|
|
273
|
+
console.error(' 3. Air-gapped install:');
|
|
274
|
+
console.error(' CODELEDGER_SKIP_POSTINSTALL=1 npm install -g contextecf-codeledger@latest');
|
|
289
275
|
console.error(' then manually place the binary at:');
|
|
290
276
|
console.error(` ${BINARY_LOCAL_PATH}`);
|
|
291
|
-
console.error('
|
|
292
|
-
console.error(' CODELEDGER_BINARY_URL=https://your-mirror/path npm install -g @
|
|
277
|
+
console.error(' 4. Use a mirror:');
|
|
278
|
+
console.error(' CODELEDGER_BINARY_URL=https://your-mirror/path npm install -g contextecf-codeledger@latest');
|
|
293
279
|
console.error('');
|
|
294
280
|
console.error(
|
|
295
|
-
`Manual download: https://github.com/codeledgerECF/codeledger
|
|
281
|
+
`Manual download: https://github.com/codeledgerECF/codeledger/releases/tag/v${version}`,
|
|
296
282
|
);
|
|
297
283
|
process.exit(1);
|
|
298
284
|
});
|