contextecf-codeledger 0.10.22 → 0.10.24
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 +2 -2
- package/bin/codeledger.js +54 -8
- package/package.json +2 -2
- package/scripts/postinstall.js +12 -10
package/README.md
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
# contextecf-codeledger — CodeLedger
|
|
1
|
+
# contextecf-codeledger — ContextECF CodeLedger
|
|
2
2
|
|
|
3
3
|
**Deterministic, bounded context selection for AI coding agents.**
|
|
4
4
|
Published by [Intelligent Context AI, Inc.](https://codeledger.dev).
|
|
5
5
|
|
|
6
|
-
This is the **unscoped
|
|
6
|
+
This is the **safe unscoped alias** of [`@codeledger/cli`](https://www.npmjs.com/package/@codeledger/cli). Both packages install the exact same ContextECF CodeLedger binary. Use whichever you prefer:
|
|
7
7
|
|
|
8
8
|
```bash
|
|
9
9
|
npm install -g contextecf-codeledger@latest # this package
|
package/bin/codeledger.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
/*
|
|
3
|
-
* CodeLedger npm launcher — thin shim (unscoped
|
|
3
|
+
* ContextECF CodeLedger npm launcher — thin shim (safe unscoped alias).
|
|
4
4
|
*
|
|
5
|
-
* This is the unscoped
|
|
5
|
+
* This is the safe unscoped alias of @codeledger/cli. Both packages install
|
|
6
6
|
* the exact same hardened binary. You can install either:
|
|
7
7
|
*
|
|
8
8
|
* npm install -g contextecf-codeledger@latest (this package)
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
|
|
17
17
|
const { spawnSync } = require('node:child_process');
|
|
18
18
|
const { existsSync } = require('node:fs');
|
|
19
|
-
const { join } = require('node:path');
|
|
19
|
+
const { dirname, join, resolve } = require('node:path');
|
|
20
20
|
const { homedir, platform } = require('node:os');
|
|
21
21
|
|
|
22
22
|
const { version } = require('../package.json');
|
|
@@ -37,7 +37,50 @@ function die(msg, code = 1) {
|
|
|
37
37
|
process.exit(code);
|
|
38
38
|
}
|
|
39
39
|
|
|
40
|
+
function findRepoLocalRuntime(startDir) {
|
|
41
|
+
if (process.env.CODELEDGER_GLOBAL_VERSION_PROBE === '1') return null;
|
|
42
|
+
let current = resolve(startDir);
|
|
43
|
+
while (true) {
|
|
44
|
+
const wrapper = join(current, '.codeledger', 'bin', 'codeledger');
|
|
45
|
+
const standalone = join(current, '.codeledger', 'bin', 'codeledger-standalone.cjs');
|
|
46
|
+
if (existsSync(wrapper)) return { kind: 'wrapper', path: wrapper, repoRoot: current };
|
|
47
|
+
if (existsSync(standalone)) return { kind: 'standalone', path: standalone, repoRoot: current };
|
|
48
|
+
const parent = dirname(current);
|
|
49
|
+
if (parent === current) return null;
|
|
50
|
+
current = parent;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
function runRepoLocal(runtime) {
|
|
55
|
+
process.stderr.write(
|
|
56
|
+
[
|
|
57
|
+
`codeledger: ContextECF CodeLedger hardened binary for v${version} is not installed in the global cache.`,
|
|
58
|
+
`codeledger: using repo-local runtime at ${runtime.path}`,
|
|
59
|
+
'',
|
|
60
|
+
].join('\n'),
|
|
61
|
+
);
|
|
62
|
+
const command = runtime.kind === 'standalone' ? process.execPath : runtime.path;
|
|
63
|
+
const args = runtime.kind === 'standalone'
|
|
64
|
+
? [runtime.path, ...process.argv.slice(2)]
|
|
65
|
+
: process.argv.slice(2);
|
|
66
|
+
const result = spawnSync(command, args, {
|
|
67
|
+
stdio: 'inherit',
|
|
68
|
+
cwd: runtime.repoRoot,
|
|
69
|
+
env: { ...process.env, CODELEDGER_DELEGATED: '1' },
|
|
70
|
+
shell: runtime.kind === 'wrapper',
|
|
71
|
+
});
|
|
72
|
+
if (result.error) {
|
|
73
|
+
die(`failed to spawn repo-local runtime: ${result.error.message}`);
|
|
74
|
+
}
|
|
75
|
+
process.exit(result.status ?? 1);
|
|
76
|
+
}
|
|
77
|
+
|
|
40
78
|
if (!existsSync(BINARY_PATH)) {
|
|
79
|
+
const repoLocal = findRepoLocalRuntime(process.cwd());
|
|
80
|
+
if (repoLocal) {
|
|
81
|
+
runRepoLocal(repoLocal);
|
|
82
|
+
}
|
|
83
|
+
|
|
41
84
|
const { arch } = require('node:os');
|
|
42
85
|
const platformKey = `${platform()}-${arch()}`;
|
|
43
86
|
const installerPath = join(__dirname, '..', 'scripts', 'postinstall.js');
|
|
@@ -45,7 +88,7 @@ if (!existsSync(BINARY_PATH)) {
|
|
|
45
88
|
if (platformKey === 'darwin-x64') {
|
|
46
89
|
die(
|
|
47
90
|
[
|
|
48
|
-
`hardened binary for v${version} not found at ${BINARY_PATH}.`,
|
|
91
|
+
`ContextECF CodeLedger hardened binary for v${version} not found at ${BINARY_PATH}.`,
|
|
49
92
|
'',
|
|
50
93
|
'You are on an Intel Mac (darwin-x64). Pre-built binaries are',
|
|
51
94
|
'available for Apple Silicon (darwin-arm64) only.',
|
|
@@ -53,10 +96,10 @@ if (!existsSync(BINARY_PATH)) {
|
|
|
53
96
|
'Options:',
|
|
54
97
|
' 1. Use Rosetta 2 (recommended):',
|
|
55
98
|
' arch -arm64 npm install -g contextecf-codeledger@latest',
|
|
56
|
-
' 2.
|
|
99
|
+
' 2. If this repo was already initialized, use the vendored CLI:',
|
|
57
100
|
' npm install -g contextecf-codeledger@latest',
|
|
58
|
-
' codeledger
|
|
59
|
-
'
|
|
101
|
+
' ./.codeledger/bin/codeledger ready',
|
|
102
|
+
' node .codeledger/bin/codeledger-standalone.cjs ready',
|
|
60
103
|
' 3. Download a binary manually from:',
|
|
61
104
|
` https://github.com/codeledgerECF/codeledger/releases/tag/v${version}`,
|
|
62
105
|
].join('\n'),
|
|
@@ -64,14 +107,17 @@ if (!existsSync(BINARY_PATH)) {
|
|
|
64
107
|
} else {
|
|
65
108
|
die(
|
|
66
109
|
[
|
|
67
|
-
`hardened binary for v${version} not found at ${BINARY_PATH}.`,
|
|
110
|
+
`ContextECF CodeLedger hardened binary for v${version} not found at ${BINARY_PATH}.`,
|
|
68
111
|
'',
|
|
69
112
|
'The postinstall step may have been skipped (e.g. --ignore-scripts).',
|
|
113
|
+
'This safe alias installs ContextECF CodeLedger. Avoid: npm install -g codeledger.',
|
|
114
|
+
'',
|
|
70
115
|
'Recover with one of:',
|
|
71
116
|
` 1. Upgrade: npm install -g contextecf-codeledger@latest`,
|
|
72
117
|
` 2. Retry this install: npm rebuild contextecf-codeledger`,
|
|
73
118
|
` 3. node "${installerPath}"`,
|
|
74
119
|
` 4. Re-run the install without --ignore-scripts`,
|
|
120
|
+
` 5. In an initialized repo, use: ./.codeledger/bin/codeledger ready`,
|
|
75
121
|
'',
|
|
76
122
|
'Or download the binary manually from:',
|
|
77
123
|
` 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.24",
|
|
4
4
|
"mcpName": "io.github.codeledgerECF/codeledger",
|
|
5
|
-
"description": "CodeLedger — deterministic context selection for AI coding agents.
|
|
5
|
+
"description": "ContextECF CodeLedger — deterministic context selection for AI coding agents. Safe unscoped alias for @codeledger/cli; avoid the unrelated codeledger package.",
|
|
6
6
|
"type": "commonjs",
|
|
7
7
|
"bin": {
|
|
8
8
|
"codeledger": "./bin/codeledger.js"
|
package/scripts/postinstall.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
/*
|
|
3
|
-
* CodeLedger postinstall — download + verify the hardened binary.
|
|
3
|
+
* ContextECF CodeLedger postinstall — download + verify the hardened binary.
|
|
4
4
|
*
|
|
5
|
-
* Runs automatically on `npm install -g
|
|
5
|
+
* Runs automatically on `npm install -g contextecf-codeledger`. Downloads the
|
|
6
6
|
* platform-specific hardened binary from the GitHub Release for this
|
|
7
7
|
* exact version, verifies its SHA256 against SHA256SUMS-v<version>.txt
|
|
8
8
|
* (also downloaded from the release), and writes it to the cache dir.
|
|
@@ -41,7 +41,7 @@ const { version } = require('../package.json');
|
|
|
41
41
|
|
|
42
42
|
if (process.env.CODELEDGER_SKIP_POSTINSTALL === '1') {
|
|
43
43
|
console.log(
|
|
44
|
-
'codeledger: CODELEDGER_SKIP_POSTINSTALL=1 set, skipping hardened binary download.',
|
|
44
|
+
'codeledger: CODELEDGER_SKIP_POSTINSTALL=1 set, skipping ContextECF CodeLedger hardened binary download.',
|
|
45
45
|
);
|
|
46
46
|
process.exit(0);
|
|
47
47
|
}
|
|
@@ -56,7 +56,7 @@ try {
|
|
|
56
56
|
const workspaceRoot = path.resolve(__dirname, '..', '..', '..');
|
|
57
57
|
if (fs.existsSync(path.join(workspaceRoot, 'pnpm-workspace.yaml'))) {
|
|
58
58
|
console.log(
|
|
59
|
-
'codeledger: in-workspace dev install detected, skipping hardened binary download.',
|
|
59
|
+
'codeledger: in-workspace dev install detected, skipping ContextECF CodeLedger hardened binary download.',
|
|
60
60
|
);
|
|
61
61
|
process.exit(0);
|
|
62
62
|
}
|
|
@@ -80,16 +80,18 @@ const platformSuffix = PLATFORM_MAP[platformKey];
|
|
|
80
80
|
if (!platformSuffix) {
|
|
81
81
|
if (platformKey === 'darwin-x64') {
|
|
82
82
|
console.log('');
|
|
83
|
-
console.log('codeledger: Intel Mac (darwin-x64) detected.');
|
|
83
|
+
console.log('codeledger: ContextECF CodeLedger Intel Mac (darwin-x64) detected.');
|
|
84
84
|
console.log('codeledger: Pre-built binaries are available for Apple Silicon (darwin-arm64) only.');
|
|
85
85
|
console.log('');
|
|
86
86
|
console.log('Options:');
|
|
87
|
+
console.log(' Safe alias: contextecf-codeledger. Official package: @codeledger/cli. Avoid: codeledger.');
|
|
87
88
|
console.log(' 1. Use Rosetta 2 (recommended):');
|
|
88
89
|
console.log(' arch -arm64 npm install -g contextecf-codeledger@latest');
|
|
89
|
-
console.log(' 2.
|
|
90
|
-
console.log('
|
|
91
|
-
console.log('
|
|
92
|
-
console.log(' 3.
|
|
90
|
+
console.log(' 2. If this repo was already initialized, use the vendored CLI:');
|
|
91
|
+
console.log(' ./.codeledger/bin/codeledger ready');
|
|
92
|
+
console.log(' node .codeledger/bin/codeledger-standalone.cjs ready');
|
|
93
|
+
console.log(' 3. For a new repo without a vendored CLI, use a supported platform or Docker.');
|
|
94
|
+
console.log(' 4. Download a binary manually from:');
|
|
93
95
|
console.log(` https://github.com/codeledgerECF/codeledger/releases/tag/v${version}`);
|
|
94
96
|
console.log('');
|
|
95
97
|
} else {
|
|
@@ -102,7 +104,7 @@ if (!platformSuffix) {
|
|
|
102
104
|
`codeledger: v${version} does not provide a hardened binary for ${platformKey}.`,
|
|
103
105
|
);
|
|
104
106
|
console.error(
|
|
105
|
-
'codeledger: you can still use the published source package or a supported release asset.',
|
|
107
|
+
'codeledger: this installer is for ContextECF CodeLedger; you can still use the published source package or a supported release asset.',
|
|
106
108
|
);
|
|
107
109
|
}
|
|
108
110
|
// Fail softly: don't block `npm install` for unsupported platforms. The
|