ccdeck 3.80.0 → 3.81.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 (48) hide show
  1. package/README.md +23 -4
  2. package/bin/cli/tui.js +433 -11
  3. package/dist/web/assets/{BrowserWatchModal-Bfvo_8H6.js → BrowserWatchModal-BcvsD8Np.js} +1 -1
  4. package/dist/web/assets/{IntegrationModal-GS5jIQ_J.js → IntegrationModal-BMtv2XWR.js} +1 -1
  5. package/dist/web/assets/{RadioPanel-Bxd2ElWb.js → RadioPanel-k65VVqTb.js} +1 -1
  6. package/dist/web/assets/{TrafficRadar-FgHBI2Oh.js → TrafficRadar-BNw0skS3.js} +1 -1
  7. package/dist/web/assets/{UsageHistoryModal-APwKtE2J.js → UsageHistoryModal-CYxrrwCl.js} +1 -1
  8. package/dist/web/assets/{app-xTrs4aEH.css → app-BIrh5Q0W.css} +1 -1
  9. package/dist/web/assets/{app-BzHVsgB2.js → app-DCoamBD4.js} +93 -93
  10. package/dist/web/assets/{index-7whwMaPX.js → index-BMX8nr4f.js} +1 -1
  11. package/dist/web/index.html +3 -3
  12. package/package.json +1 -1
  13. package/release-notes.json +62 -0
  14. package/src/server/account-notify.mjs +81 -16
  15. package/src/server/account-routes.mjs +20 -2
  16. package/src/server/account-watch.mjs +21 -0
  17. package/src/server/codex-auto.mjs +157 -37
  18. package/src/server/codex-lan-identity.mjs +61 -0
  19. package/src/server/codex-live-engine.mjs +28 -2
  20. package/src/server/codex-live-rpc.mjs +4 -1
  21. package/src/server/codex-profiles.mjs +34 -4
  22. package/src/server/codex-projects.mjs +308 -0
  23. package/src/server/codex-selection.mjs +17 -2
  24. package/src/server/codex-share.mjs +74 -12
  25. package/src/server/codex-terminal.mjs +1 -1
  26. package/src/server/codex-usage.mjs +69 -0
  27. package/src/server/codex-windows-private.mjs +2 -0
  28. package/src/server/codex-windows-private.ps1 +48 -1
  29. package/src/server/index.mjs +6 -4
  30. package/src/server/lan-codex-store.mjs +173 -0
  31. package/src/server/lan-codex.mjs +103 -0
  32. package/src/server/lan-copies.mjs +1 -1
  33. package/src/server/lan-deck.mjs +5 -0
  34. package/src/server/lan-engine.mjs +34 -6
  35. package/src/server/lan-manifest.mjs +16 -2
  36. package/src/server/lan-serve.mjs +21 -6
  37. package/src/server/lifecycle.mjs +2 -2
  38. package/src/server/npm-upgrade.mjs +17 -6
  39. package/src/server/pinned-build.mjs +3 -0
  40. package/src/server/request-gates.mjs +3 -0
  41. package/src/server/self-update.mjs +2 -72
  42. package/src/server/terminal-cli.mjs +8 -2
  43. package/src/server/tui-codex.mjs +229 -0
  44. package/src/server/tui-lan.mjs +684 -0
  45. package/src/server/tui-machine.mjs +492 -0
  46. package/src/server/tui-network.mjs +730 -0
  47. package/src/server/tui-view.mjs +735 -60
  48. package/src/server/version-order.mjs +74 -0
@@ -0,0 +1,74 @@
1
+ // Shared by version reporting and post-install verification. No I/O.
2
+ // ── version comparison ───────────────────────────────────────────────────────
3
+
4
+ /** Numeric-segment compare of one version's parts: -1, 0 or 1. Non-numeric
5
+ * segments count as 0 and missing segments pad with 0, so "1.30" sorts before
6
+ * "1.30.1" and "1.9.0" before "1.10.0". */
7
+ function cmpParts(x, y) {
8
+ for (let i = 0; i < Math.max(x.length, y.length); i++) {
9
+ const d = (x[i] ?? 0) - (y[i] ?? 0);
10
+ if (d !== 0) return d < 0 ? -1 : 1;
11
+ }
12
+ return 0;
13
+ }
14
+
15
+ /** A version split at the FIRST `-`: the release on one side, the prerelease
16
+ * identifiers on the other, or null when there is no prerelease at all.
17
+ *
18
+ * `+` stays inside the release half rather than starting a third part, which
19
+ * keeps build metadata reading exactly as it read before — `1.0.0+build.7`
20
+ * segments to [1,0,0,0,7] and therefore sorts above `1.0.0`. That is inherited
21
+ * behaviour rather than a design, this repo has never published one, and a
22
+ * change to it belongs in its own issue. */
23
+ function versionParts(v) {
24
+ const nums = (s) => s.split(/[.+]/).map(n => parseInt(n, 10)).map(n => Number.isNaN(n) ? 0 : n);
25
+ const dash = v.indexOf("-");
26
+ if (dash === -1) return { release: nums(v), pre: null };
27
+ return { release: nums(v.slice(0, dash)), pre: nums(v.slice(dash + 1)) };
28
+ }
29
+
30
+ /** True when `a` sorts before `b`.
31
+ *
32
+ * A PRERELEASE SORTS BELOW THE RELEASE IT PRECEDES (#976), which is semver's
33
+ * rule and was not this function's. Splitting on `[.\-+]` and mapping
34
+ * non-numeric segments to 0 made `3.23.0-rc.1` segment to [3,23,0,0,1] — five
35
+ * numbers against the release's three, so it compared ABOVE `3.23.0` and the
36
+ * release compared below the candidate it was meant to supersede:
37
+ *
38
+ * isOlder("3.23.0-rc.1", "3.23.0") = false ← the release never looked newer
39
+ * isOlder("3.23.0", "3.23.0-rc.1") = true ← and the deck would go backwards
40
+ *
41
+ * What that costs is not a cosmetic ordering. `autoUpdate` defaults on, so a
42
+ * deck that has ended up on a prerelease — installed by hand by a tester, or
43
+ * by the dist-tag accident publish.yml now prevents — produces no upgrade
44
+ * notice when the real release ships, shows nothing in the banner, and has no
45
+ * way to come back off it from inside the product. A bad release can be
46
+ * followed by a good one; a fleet that cannot SEE the good one cannot be
47
+ * rescued by publishing it, which is why this half matters even with the
48
+ * dist-tag half in place.
49
+ *
50
+ * Ordinary numeric ordering is untouched — the release halves are compared
51
+ * exactly as before — and so is build metadata; see versionParts.
52
+ *
53
+ * cswap-install.mjs had this written out a second time, without the type guard
54
+ * below, and imports it from here now (#374). The two bodies were identical:
55
+ * swept over 271,441 version-string pairs they disagreed on none, and the
56
+ * guard was the whole difference — `isOlder(null, "1.0.0")` answers false here
57
+ * and threw a TypeError there. Nothing could reach that call with a non-string
58
+ * (both arguments are behind `typeof v === "string"` checks at the one call
59
+ * site), so this is the copy with a test behind it absorbing the one without,
60
+ * not a bug fix. That sweep is now one-sided on prerelease pairs and
61
+ * duplicated-helpers.test.ts says which, rather than asserting an equality
62
+ * that has deliberately stopped holding. */
63
+ export function isOlder(a, b) {
64
+ if (typeof a !== "string" || typeof b !== "string") return false;
65
+ const x = versionParts(a), y = versionParts(b);
66
+ const release = cmpParts(x.release, y.release);
67
+ if (release !== 0) return release < 0;
68
+ // Same release. A version carrying a prerelease is below the plain one, and
69
+ // never the other way round; two prereleases of one release compare on their
70
+ // own identifiers, so rc.2 is above rc.1.
71
+ if (x.pre && !y.pre) return true;
72
+ if (!x.pre || !y.pre) return false;
73
+ return cmpParts(x.pre, y.pre) < 0;
74
+ }