codex-copilot-dx 0.9.37 → 0.9.38
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/cli.mjs +1 -1
- package/docs/ARCHITECTURE.md +11 -0
- package/docs/REFERENCE.md +46 -0
- package/package.json +1 -1
- package/src/cli-options.mjs +8 -4
- package/src/package-update.mjs +45 -4
package/README.md
CHANGED
|
@@ -86,11 +86,11 @@ Auto refresh runs every 30 minutes while visible and can be switched off. Hidden
|
|
|
86
86
|
for the API. Inference rejects browser Origin headers; native clients remain supported. Diagnostic errors may contain sensitive upstream text.
|
|
87
87
|
|
|
88
88
|
Startup checks GitHub's latest-release web redirect, not npm or the anonymous REST quota, and suggests `ccdx update github`.
|
|
89
|
-
Updates install the exact stable tag; dependencies still use npm's configured registry. Lookup errors identify HTTP refusal, timeout, network failure or invalid redirects.
|
|
89
|
+
Updates install the exact stable tag; dependencies still use npm's configured registry. Lookup errors identify HTTP refusal, timeout, network failure or invalid redirects. For npm `EALLOWREMOTE`, only if policy permits and the update is trusted, use `ccdx update github --allow-remote`: explicit URL-download permission for that installation's whole dependency tree, not a hostname allowlist. Persistent npm settings stay unchanged.
|
|
90
90
|
Updates warn about mismatched npm targets without changing PATH/prefix and verify the installed target version (exact tag for GitHub). Restart the adapter separately. Full `ccdx doctor` reports this target and readonly credential permissions; it never changes ACLs.
|
|
91
91
|
Recent errors separate HTTP and model failures. HTTP metadata retains status, source and IDs, not error bodies or prompts; original errors still reach Codex unchanged.
|
|
92
92
|
|
|
93
|
-
The dashboard and CLI separate prediction preference, bridge state and observed config traffic; candidate visibility stays unknown.
|
|
93
|
+
The dashboard and CLI separate prediction preference, bridge state and observed config traffic; candidate visibility stays unknown. See [architecture boundaries](docs/ARCHITECTURE.md) for separate inference, integration, image and management ownership.
|
|
94
94
|
|
|
95
95
|
See the [complete reference](https://github.com/DaleXiao/codex-copilot-dx/blob/main/docs/REFERENCE.md) for authentication, configuration, limits, logging, images and compatibility. It is also included as `docs/REFERENCE.md` in the npm package.
|
|
96
96
|
|
package/bin/cli.mjs
CHANGED
|
@@ -228,7 +228,7 @@ if (CLI.command === "auto-review-model") {
|
|
|
228
228
|
if (CLI.command === "update") {
|
|
229
229
|
try {
|
|
230
230
|
const { runPackageUpdateCommand } = await import("../src/package-update.mjs");
|
|
231
|
-
await runPackageUpdateCommand({ commandName: CLI_NAME, source: CLI.updateSource });
|
|
231
|
+
await runPackageUpdateCommand({ commandName: CLI_NAME, source: CLI.updateSource, allowRemote: CLI.allowRemote });
|
|
232
232
|
process.exit(0);
|
|
233
233
|
} catch (e) {
|
|
234
234
|
console.error(status("err", e.message));
|
package/docs/ARCHITECTURE.md
CHANGED
|
@@ -26,6 +26,17 @@ command interpreter only for the fixed `npm.cmd` installer command; stable-tag
|
|
|
26
26
|
validation remains upstream of launch. macOS/Linux use direct npm argv. There
|
|
27
27
|
is no generic shell runner or package-manager framework, and npm's configured
|
|
28
28
|
registry/proxy environment remains owned by the user.
|
|
29
|
+
Readonly npm policy discovery is update-only and uses the same global context as
|
|
30
|
+
the installer, not an unrelated working project's `.npmrc`. It queries version,
|
|
31
|
+
`allow-remote` and registry only, never the complete credential-bearing config.
|
|
32
|
+
Default installer argv preserves the saved download policy. The boolean
|
|
33
|
+
`--allow-remote` opt-in adds one fixed permission argument only when supported;
|
|
34
|
+
it applies to that installation's entire dependency tree, not selected hosts.
|
|
35
|
+
Unknown support fails before an explicitly requested override. Installation
|
|
36
|
+
streams remain inherited; conditional failure guidance is not an assertion that
|
|
37
|
+
every nonzero exit is a policy error. There is no automatic retry or policy write.
|
|
38
|
+
The source lock retains exact versions/integrities without binding smol-toml to a
|
|
39
|
+
developer's corporate feed; omitted registry resolution is delegated to npm.
|
|
29
40
|
Readonly update preflight reports Node/npm, the running package and npm's selected
|
|
30
41
|
global target. A different target warns, but never changes PATH or prefix. Its
|
|
31
42
|
bounded npm probe is limited to explicit update and full doctor commands.
|
package/docs/REFERENCE.md
CHANGED
|
@@ -678,6 +678,52 @@ displayed before waiting for any remaining check budget.
|
|
|
678
678
|
|
|
679
679
|
GitHub is the package source, not a replacement for the npm installer. Dependencies such as `sharp` may still need the configured npm registry during an explicit update; use a company-approved mirror/cache where required. GitHub updates do not promise an entirely registry-free installation.
|
|
680
680
|
|
|
681
|
+
Since `0.9.38`, update reads the npm version and named global `allow-remote` and
|
|
682
|
+
registry settings using bounded probes. It never reads the full configuration or
|
|
683
|
+
prints registry credentials. The global context matches `npm install --global`;
|
|
684
|
+
an unrelated project's `.npmrc` cannot silently grant update permission. Old npm
|
|
685
|
+
versions without this restriction do not receive an unsupported option. Failed
|
|
686
|
+
policy discovery does not block an ordinary installation; explicitly requesting
|
|
687
|
+
an override with unknown support fails before installation.
|
|
688
|
+
|
|
689
|
+
npm 12 normally sets `allow-remote=none`. A company registry may return a tarball
|
|
690
|
+
URL on a different origin/path, which can trigger `EALLOWREMOTE` even for a named
|
|
691
|
+
dependency such as sharp. The default update does not weaken this policy. When
|
|
692
|
+
the installation fails under a restrictive policy, CCDX gives conditional guidance
|
|
693
|
+
to check npm's actual error; it does not label every failure a remote-policy error.
|
|
694
|
+
|
|
695
|
+
Only if permitted by company policy and you trust the package/dependency tree,
|
|
696
|
+
grant URL downloads for one explicit update:
|
|
697
|
+
|
|
698
|
+
```sh
|
|
699
|
+
ccdx update github --allow-remote
|
|
700
|
+
# Or, for the configured npm registry:
|
|
701
|
+
ccdx update npm --allow-remote
|
|
702
|
+
```
|
|
703
|
+
|
|
704
|
+
The option permits URL dependencies throughout that one installation, including
|
|
705
|
+
transitive dependencies. It is **not** an allowlist for one registry or tarball
|
|
706
|
+
host. It neither changes `.npmrc`/registry/proxy/prefix nor automatically retries
|
|
707
|
+
the failed install. npm still enforces package integrity and its other policies;
|
|
708
|
+
this is not permission to run every package script. Windows uses the same fixed
|
|
709
|
+
system `cmd.exe` launch; use `ccdx.cmd` if PowerShell blocks `.ps1` shims.
|
|
710
|
+
|
|
711
|
+
An older CCDX executable cannot gain this option before it is upgraded. To
|
|
712
|
+
bootstrap `0.9.38` from a version that fails with `EALLOWREMOTE`, the equivalent
|
|
713
|
+
explicit per-install command is, only with the same policy/trust approval:
|
|
714
|
+
|
|
715
|
+
```sh
|
|
716
|
+
npm install -g --allow-git=all --allow-remote=all 'github:DaleXiao/codex-copilot-dx#v0.9.38'
|
|
717
|
+
# Windows PowerShell: use npm.cmd instead of npm.
|
|
718
|
+
```
|
|
719
|
+
|
|
720
|
+
Check `ccdx version`, then restart CCDX. This does not guarantee access through
|
|
721
|
+
every company mirror: authentication, offline/cache-only rules, unsynchronized
|
|
722
|
+
packages and administrator-enforced policies still apply. If URL permission
|
|
723
|
+
cannot be granted, the registry must expose compatible allowed tarball URLs;
|
|
724
|
+
CCDX does not bypass that boundary. The source lock pins versions and integrity
|
|
725
|
+
without a developer-specific corporate smol-toml URL.
|
|
726
|
+
|
|
681
727
|
If a configured npm mirror has not synchronized the current release yet, use the GitHub source. A running adapter keeps its loaded version until it is stopped and restarted.
|
|
682
728
|
|
|
683
729
|
## Diagnostics
|
package/package.json
CHANGED
package/src/cli-options.mjs
CHANGED
|
@@ -277,14 +277,18 @@ export function parseCliArgs(args = []) {
|
|
|
277
277
|
return baseCommand("auto-review-model");
|
|
278
278
|
}
|
|
279
279
|
if (command === "update") {
|
|
280
|
-
|
|
281
|
-
|
|
280
|
+
const permission = rest.filter(value => value === "--allow-remote");
|
|
281
|
+
if (permission.length > 1) throw new Error("--allow-remote may be specified only once");
|
|
282
|
+
const sources = rest.filter(value => value !== "--allow-remote");
|
|
283
|
+
if (sources.length > 1) unexpectedArgs(sources.slice(1));
|
|
284
|
+
const source = sources[0];
|
|
282
285
|
if (source && !new Set(["npm", "github", "gh"]).has(source)) {
|
|
283
286
|
throw new Error(`Update source must be npm or github: ${source}`);
|
|
284
287
|
}
|
|
285
288
|
return {
|
|
286
289
|
...baseCommand("update"),
|
|
287
290
|
updateSource: source === "gh" ? "github" : source,
|
|
291
|
+
allowRemote: permission.length === 1,
|
|
288
292
|
};
|
|
289
293
|
}
|
|
290
294
|
if (command === "doctor" || command === "--doctor") {
|
|
@@ -373,7 +377,7 @@ function topicHelp(name, topic) {
|
|
|
373
377
|
"auto-review-model": `Usage:\n ${name} auto-review-model\n\nSelect a Responses model, then an advertised reasoning effort. Enter keeps the default/current choice; q cancels both steps without saving. Effort 0 follows the client (low when omitted). Settings apply only to Auto-review on the next request; no client patch or restart is required for adapters running 0.9.13 or newer.`,
|
|
374
378
|
"suggestion": `The CCDX prediction panel has been retired. Run ${name} suggestion off to safely remove unchanged CCDX registrations. This cleanup does not change native predictions; see ${name} prediction --help for that separate opt-in feature.`,
|
|
375
379
|
prediction: `Usage:\n ${name} prediction [status|on|off|fix]\n\nOptional native next-message predictions; off by default. macOS and Windows. Windows requires the registered official MSIX App, an initialized profile, Windows PowerShell and .NET Framework 4.7.2+; Git/OpenSSL is not required for prediction setup. Quit Codex before on/off, then restart ccdx. On adds private App-profile certificate trust and an App-only route for chatgpt.com and ab.chatgpt.com. HTTPS on those hosts is decrypted locally; only prediction configuration is changed. No client program files, OS trust, account permissions, MCP or Hooks are changed. Static HTTP/HTTPS/SOCKS5 proxies and bypass rules are preserved. Windows supports company PAC/WPAD; macOS dynamic PAC/WPAD remains unsupported. Static IPv4/IPv6 CIDRs match URL IP literals without DNS. The bridge port persists across restarts/updates; a busy saved port disables only predictions. Launch/reuse checks the App's actual route; an older random or missing route may require one full App quit. Official prediction configuration is preserved; the conversation's model is used. App updates require another compatibility check. Status distinguishes saved preference and observed config traffic from unverified candidate visibility.\n\nFix asks a compatible running CCDX adapter to repair the enabled bridge once on its saved port. It never enables predictions, renews certificates or force-restarts Codex. Healthy unchanged bridges are retained. Fix rechecks system proxy settings. Changed routes may need a normal App relaunch to reload cached PAC; failed rechecks preserve the previous bridge with a nonzero exit. Process environment variables and Node trust are not hot-reloaded; changed trust inputs need a CCDX service restart. Startup, status and doctor share sanitized environment diagnostics. Missing App routes require a normal full quit and ccdx launch; partial repair exits 1. An older adapter must first be upgraded and restarted once to gain this repair endpoint.`,
|
|
376
|
-
update: `Usage:\n ${name} update [npm|github]\n\nUpdates the global package from the configured npm registry or the latest stable GitHub release. With no source, an interactive terminal prompts for one. Windows uses system cmd.exe to run npm.cmd without changing PowerShell policy; use the .cmd entrypoint if scripts are blocked. GitHub installs require Git on PATH and dependencies may still use the configured npm registry. Restart the running adapter after installation.`,
|
|
380
|
+
update: `Usage:\n ${name} update [npm|github] [--allow-remote]\n\nUpdates the global package from the configured npm registry or the latest stable GitHub release. With no source, an interactive terminal prompts for one. Windows uses system cmd.exe to run npm.cmd without changing PowerShell policy; use the .cmd entrypoint if scripts are blocked. GitHub installs require Git on PATH and dependencies may still use the configured npm registry. By default npm's remote-download policy is preserved. If npm reports EALLOWREMOTE for a trusted mirror tarball, --allow-remote explicitly permits URL dependencies for this one installation's entire dependency tree; it is not a hostname allowlist. No .npmrc, registry or persistent policy is changed, and failed installations are not retried automatically. Use this only if company policy permits it. Restart the running adapter after installation.`,
|
|
377
381
|
version: `Usage:\n ${name} --version`,
|
|
378
382
|
};
|
|
379
383
|
return sections[topic];
|
|
@@ -399,7 +403,7 @@ export function cliHelp(commandName = "ccdx", topic = "") {
|
|
|
399
403
|
${name} image-status
|
|
400
404
|
${name} auto-review-model
|
|
401
405
|
${name} prediction [status|on|off|fix]
|
|
402
|
-
${name} update [npm|github]
|
|
406
|
+
${name} update [npm|github] [--allow-remote]
|
|
403
407
|
${name} --version
|
|
404
408
|
${name} --help
|
|
405
409
|
|
package/src/package-update.mjs
CHANGED
|
@@ -51,10 +51,36 @@ export function normalizeUpdateSource(value) {
|
|
|
51
51
|
return Object.hasOwn(UPDATE_SPECS, source) ? source : "";
|
|
52
52
|
}
|
|
53
53
|
|
|
54
|
-
|
|
54
|
+
// Read only named, non-secret fields. Never inspect the complete npm config,
|
|
55
|
+
// rewrite .npmrc, or probe this policy on the adapter's startup/request path.
|
|
56
|
+
export function inspectNpmDownloadPolicy({ env = process.env, platform = process.platform, exec = execFileSync } = {}) {
|
|
57
|
+
const result = { version: null, allowRemote: null, registryOrigin: null, supported: null };
|
|
58
|
+
const query = args => {
|
|
59
|
+
const launch = npmLaunch(args, { platform, env });
|
|
60
|
+
return exec(launch.command, launch.args, { env, shell: false, stdio: ["ignore", "pipe", "pipe"],
|
|
61
|
+
encoding: "utf8", timeout: 3000, maxBuffer: 64 * 1024, ...launch.options }).trim();
|
|
62
|
+
};
|
|
63
|
+
try {
|
|
64
|
+
const version = query(["--version"]);
|
|
65
|
+
if (!/^\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?$/.test(version)) return result;
|
|
66
|
+
result.version = version;
|
|
67
|
+
if (Number(version.split(".")[0]) < 11) { result.supported = false;return result; }
|
|
68
|
+
const values = Object.fromEntries(query(["config", "get", "--global", "allow-remote", "registry"]).split(/\r?\n/)
|
|
69
|
+
.map(line => /^(allow-remote|registry)=(.*)$/.exec(line)).filter(Boolean).map(match => [match[1], match[2]]));
|
|
70
|
+
if (["all", "none", "root"].includes(values["allow-remote"])) {
|
|
71
|
+
result.allowRemote = values["allow-remote"];result.supported = true;
|
|
72
|
+
} else if (values["allow-remote"] === "undefined") result.supported = false;
|
|
73
|
+
try { const url = new URL(values.registry);if (["https:", "http:"].includes(url.protocol)) result.registryOrigin = url.origin; } catch {}
|
|
74
|
+
} catch { /* A failed readonly probe must not replace npm's own error handling. */ }
|
|
75
|
+
return result;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
export function globalUpdateCommand(source, { platform = process.platform, releaseTag, allowRemote = false } = {}) {
|
|
79
|
+
if (typeof allowRemote !== "boolean") throw new Error("Remote download permission must be a boolean");
|
|
55
80
|
const normalized = normalizeUpdateSource(source);
|
|
56
81
|
if (!normalized) throw new Error(`Update source must be npm or github: ${source}`);
|
|
57
82
|
const args = ["install", "--global"];
|
|
83
|
+
if (allowRemote) args.push("--allow-remote=all");
|
|
58
84
|
if (normalized === "github") {
|
|
59
85
|
if (!githubReleaseVersion(releaseTag)) throw new Error("A valid stable GitHub release tag is required");
|
|
60
86
|
args.push("--allow-git=all", `${UPDATE_SPECS.github}#${releaseTag}`);
|
|
@@ -79,7 +105,7 @@ function waitForExit(child) {
|
|
|
79
105
|
child.once("error", (error) => finish(reject, error));
|
|
80
106
|
child.once("exit", (code, signal) => {
|
|
81
107
|
if (signal) finish(reject, new Error(`npm update was interrupted by ${signal}`));
|
|
82
|
-
else if (code !== 0) finish(reject, new Error(`npm update exited with status ${code}`));
|
|
108
|
+
else if (code !== 0) finish(reject, Object.assign(new Error(`npm update exited with status ${code}`), { npmExitCode: code }));
|
|
83
109
|
else finish(resolve);
|
|
84
110
|
});
|
|
85
111
|
});
|
|
@@ -104,11 +130,14 @@ export async function runPackageUpdateCommand({
|
|
|
104
130
|
platform = process.platform,
|
|
105
131
|
prompt,
|
|
106
132
|
source,
|
|
133
|
+
allowRemote = false,
|
|
107
134
|
spawnImpl = spawn,
|
|
108
135
|
fetchImpl = fetch,
|
|
109
136
|
inspectEnvironmentFn = inspectPackageUpdateEnvironment,
|
|
137
|
+
inspectPolicyFn = inspectNpmDownloadPolicy,
|
|
110
138
|
verifyInstalledFn = verifyInstalledPackage,
|
|
111
139
|
} = {}) {
|
|
140
|
+
if (typeof allowRemote !== "boolean") throw new Error("Remote download permission must be a boolean");
|
|
112
141
|
let selectedSource = normalizeUpdateSource(source);
|
|
113
142
|
if (source && !selectedSource) throw new Error(`Update source must be npm or github: ${source}`);
|
|
114
143
|
|
|
@@ -147,9 +176,15 @@ export async function runPackageUpdateCommand({
|
|
|
147
176
|
output.write("Checking the latest stable GitHub release...\n");
|
|
148
177
|
release = await lookupLatestRelease({ fetchImpl, timeoutMs: 10000 });
|
|
149
178
|
}
|
|
150
|
-
const
|
|
179
|
+
const policy = inspectPolicyFn({ env, platform });
|
|
180
|
+
if (allowRemote && policy.supported === null) throw new Error("Could not verify npm's remote-download option; no installation was started. Check npm --version and npm config get allow-remote.");
|
|
181
|
+
const permitRemote = allowRemote && policy.supported === true;
|
|
182
|
+
const update = globalUpdateCommand(selectedSource, { platform, releaseTag: release?.tagName, allowRemote: permitRemote });
|
|
151
183
|
const sourceLabel = selectedSource === "npm" ? "npm registry" : `GitHub release ${release.tagName}`;
|
|
152
184
|
output.write(`Updating ${PACKAGE_NAME} from ${sourceLabel}...\n`);
|
|
185
|
+
if (policy.allowRemote) output.write(`npm ${terminalCell(policy.version)}: saved allow-remote=${policy.allowRemote}${policy.registryOrigin ? `; registry ${terminalCell(policy.registryOrigin)}` : ""}.\n`);
|
|
186
|
+
if (permitRemote) output.write("Explicit permission for this update only: npm may download URL dependencies throughout the selected package's dependency tree. Registry and persistent npm settings are unchanged.\n");
|
|
187
|
+
else if (allowRemote) output.write("This npm does not expose the remote-download restriction; no unsupported permission flag was added.\n");
|
|
153
188
|
const environment = inspectEnvironmentFn({ env, platform });
|
|
154
189
|
if (environment?.state === "different") {
|
|
155
190
|
output.write(`Warning: npm targets ${terminalCell(environment.target)}, not the running package at ${terminalCell(environment.package_root)}. Existing PATH and prefix choices were preserved.\n`);
|
|
@@ -163,7 +198,13 @@ export async function runPackageUpdateCommand({
|
|
|
163
198
|
stdio: "inherit",
|
|
164
199
|
...launch.options,
|
|
165
200
|
});
|
|
166
|
-
await waitForExit(child);
|
|
201
|
+
try { await waitForExit(child); }
|
|
202
|
+
catch (error) {
|
|
203
|
+
if (Number.isInteger(error.npmExitCode) && !allowRemote && ["none", "root"].includes(policy.allowRemote)) {
|
|
204
|
+
error.message += `. npm allow-remote=${policy.allowRemote} was preserved. If npm reported EALLOWREMOTE, its registry/mirror tarball URL was refused; only if you trust this update and policy permits it, retry explicitly with ${terminalCell(commandName)} update ${selectedSource} --allow-remote. This grants URL downloads to this installation's dependency tree, not just one hostname. No automatic retry or config change was made.`;
|
|
205
|
+
}
|
|
206
|
+
throw error;
|
|
207
|
+
}
|
|
167
208
|
const installedVersion = verifyInstalledFn(environment?.target, { expectedVersion: release?.version });
|
|
168
209
|
if (installedVersion) {
|
|
169
210
|
output.write(`Updated ${PACKAGE_NAME}: installed v${terminalCell(installedVersion)} at ${terminalCell(environment.target)}.\n`);
|