codex-copilot-dx 1.1.1 → 1.2.1

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.
Files changed (46) hide show
  1. package/README.md +10 -11
  2. package/bin/cli.mjs +23 -23
  3. package/docs/ARCHITECTURE.md +40 -6
  4. package/docs/REFERENCE.md +128 -94
  5. package/package.json +6 -4
  6. package/src/auth-device-flow.mjs +1 -1
  7. package/src/auth-status.mjs +1 -1
  8. package/src/auto-review-model.mjs +2 -2
  9. package/src/claude-client-lifecycle.mjs +33 -0
  10. package/src/claude-gateway.mjs +15 -6
  11. package/src/cli-auth.mjs +6 -6
  12. package/src/cli-cache.mjs +5 -5
  13. package/src/cli-image.mjs +1 -1
  14. package/src/cli-m365.mjs +5 -5
  15. package/src/cli-models.mjs +2 -2
  16. package/src/cli-options.mjs +26 -26
  17. package/src/cli-status.mjs +6 -1
  18. package/src/dashboard/console.js +112 -38
  19. package/src/dashboard/index.html +122 -90
  20. package/src/dashboard/language.js +791 -362
  21. package/src/dashboard/status.js +53 -41
  22. package/src/dashboard/ui.css +13 -0
  23. package/src/dashboard/ui.js +31 -28
  24. package/src/dashboard/usage.js +16 -16
  25. package/src/dashboard-api.mjs +2 -0
  26. package/src/doctor.mjs +4 -4
  27. package/src/http-transport.mjs +3 -2
  28. package/src/launcher.mjs +8 -8
  29. package/src/native-prediction.mjs +3 -3
  30. package/src/operation-error.mjs +12 -7
  31. package/src/package-update.mjs +43 -11
  32. package/src/prediction-retirement.mjs +2 -7
  33. package/src/provider-metadata.mjs +2 -1
  34. package/src/provider-registry.mjs +19 -0
  35. package/src/provider-runtime.mjs +42 -33
  36. package/src/provider-settings.mjs +2 -1
  37. package/src/release-install.mjs +192 -0
  38. package/src/response-failures.mjs +2 -1
  39. package/src/service-control.mjs +7 -8
  40. package/src/startup-ui.mjs +17 -9
  41. package/src/stream-performance.mjs +29 -1
  42. package/src/terminal-console.mjs +43 -15
  43. package/src/usage-store.mjs +10 -5
  44. package/src/user-settings.mjs +16 -3
  45. package/src/version.mjs +2 -6
  46. package/src/windows-command.mjs +13 -1
package/src/version.mjs CHANGED
@@ -1,4 +1,5 @@
1
1
  import fs from "node:fs";
2
+ import { stableVersion as githubReleaseVersion } from "./release-install.mjs";
2
3
  import path from "node:path";
3
4
  import { fileURLToPath } from "node:url";
4
5
  import { operationError } from "./operation-error.mjs";
@@ -30,12 +31,7 @@ export function isVersionGreater(a, b) {
30
31
  return false;
31
32
  }
32
33
 
33
- export function githubReleaseVersion(tag) {
34
- if (typeof tag !== "string" || tag.length > 64) return null;
35
- const match = /^v?(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)$/.exec(tag);
36
- if (!match || !match.slice(1).every((part) => Number.isSafeInteger(Number(part)))) return null;
37
- return match.slice(1).join(".");
38
- }
34
+ export { stableVersion as githubReleaseVersion } from "./release-install.mjs";
39
35
 
40
36
  export async function lookupLatestRelease({ fetchImpl = fetch, timeoutMs = 2000 } = {}) {
41
37
  const controller = new AbortController();
@@ -37,6 +37,16 @@ exit $ret
37
37
  `;
38
38
  }
39
39
 
40
+ export function privateWindowsCommand({ node, cli, prefix }) {
41
+ const relativeNode = path.relative(prefix, node), relativeCli = path.relative(prefix, cli);
42
+ const privateNode = !path.isAbsolute(relativeNode) && !relativeNode.startsWith(`..${path.sep}`);
43
+ // Expand the native batch directory at run time. Embedding a UTF-8 absolute
44
+ // path in a .cmd file breaks Unicode profiles under legacy console code pages.
45
+ const binary = privateNode ? `%~dp0${relativeNode}` : "node.exe";
46
+ const nodePath = privateNode ? `set "PATH=%~dp0${path.dirname(relativeNode)};%PATH%"\r\n` : "";
47
+ return `@echo off\r\nsetlocal DisableDelayedExpansion\r\nset "CCDX_PRIVATE_INSTALL_PREFIX=%~dp0"\r\n${nodePath}if not defined npm_config_prefix set "npm_config_prefix=%~dp0"\r\n"${binary}" "%~dp0${relativeCli}" %*\r\nexit /b %errorlevel%\r\n`;
48
+ }
49
+
40
50
  export function inspectWindowsCommand({ platform = process.platform,
41
51
  packageRoot = fileURLToPath(new URL("../", import.meta.url)), repair = false, locked = false } = {}) {
42
52
  if (platform !== "win32") return { status: "not_applicable", changed: false };
@@ -58,7 +68,9 @@ export function inspectWindowsCommand({ platform = process.platform,
58
68
  try {
59
69
  if (!fs.lstatSync(cmd).isFile() || fs.statSync(cmd).size > 8192) throw new Error();
60
70
  const batch = fs.readFileSync(cmd, "utf8");
61
- if (!batch.startsWith("@ECHO off") || !batch.includes(`"%dp0%\\${target.replaceAll("/", "\\")}" %*`)) throw new Error();
71
+ const ownedNpm = batch.startsWith("@ECHO off") && batch.includes(`"%dp0%\\${target.replaceAll("/", "\\")}" %*`);
72
+ const ownedPrivate = batch === privateWindowsCommand({ node: process.execPath, cli: path.join(root, "bin", script), prefix });
73
+ if (!ownedNpm && !ownedPrivate) throw new Error();
62
74
  let stat;
63
75
  try { stat = fs.lstatSync(ps1); } catch (error) { if (error.code !== "ENOENT") throw error; }
64
76
  if (!stat) { results.push({ name, status: "ready", changed: false });continue; }