specrails-desktop 2.9.0 → 2.10.0

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 (44) hide show
  1. package/client/dist/assets/{ActivityFeedPage-DNqnf1fZ.js → ActivityFeedPage-qPnIozX9.js} +1 -1
  2. package/client/dist/assets/{AgentsPage-vmNIEbGM.js → AgentsPage-B_8WZUUI.js} +1 -1
  3. package/client/dist/assets/{AnalyticsPage-CdfN0ofZ.js → AnalyticsPage-DCnFtl8E.js} +1 -1
  4. package/client/dist/assets/{BarChart-CIkopHjl.js → BarChart-Cr7__BAU.js} +1 -1
  5. package/client/dist/assets/{CodePage-DDRNU5FN.js → CodePage-C7uJgpF8.js} +1 -1
  6. package/client/dist/assets/{DesktopAnalyticsPage-Cl3sKKSG.js → DesktopAnalyticsPage-DqCEHy0T.js} +1 -1
  7. package/client/dist/assets/{DocsDialog-BGrBOfUr.js → DocsDialog-C_jIYef_.js} +1 -1
  8. package/client/dist/assets/{DocsPage-CY-2SSzw.js → DocsPage-CTifuwaa.js} +1 -1
  9. package/client/dist/assets/{ExportDropdown-BRHcvP0r.js → ExportDropdown-BcmU6I16.js} +1 -1
  10. package/client/dist/assets/{IntegrationsPage-nKdLB4Ub.js → IntegrationsPage-DZntBwnd.js} +1 -1
  11. package/client/dist/assets/{JobDetailPage-Bf0A6WWQ.js → JobDetailPage-4ncqbKxF.js} +1 -1
  12. package/client/dist/assets/{JobsPage-Vg4nXPdL.js → JobsPage-CapLnvIs.js} +1 -1
  13. package/client/dist/assets/{dist-js-CUs5GjwA.js → dist-js-DKGy2gD-.js} +1 -1
  14. package/client/dist/assets/{dist-js-0i_klubI.js → dist-js-DvPNad3t.js} +1 -1
  15. package/client/dist/assets/index-Cc3LCzBq.css +2 -0
  16. package/client/dist/assets/{index-BXoHFtfG.js → index-IgMtikGD.js} +45 -45
  17. package/client/dist/assets/{lib-D6M_MvoC.js → lib-BouqFmKc.js} +1 -1
  18. package/client/dist/assets/{settings-BRaLLSVi.js → settings-BwMQ1lx5.js} +1 -1
  19. package/client/dist/assets/{settings-BI_cVCqN.js → settings-CewqtD9V.js} +1 -1
  20. package/client/dist/assets/{settings-BcqH0oea.js → settings-CqCY8gZq.js} +1 -1
  21. package/client/dist/assets/settings-Cx97tHs5.js +1 -0
  22. package/client/dist/assets/{settings-pT3MzfRu.js → settings-CyixAx0X.js} +1 -1
  23. package/client/dist/assets/{settings-GOBKOTGl.js → settings-DkB9Wh-f.js} +1 -1
  24. package/client/dist/assets/{settings-D6QMBlGQ.js → settings-EMaKBwE0.js} +1 -1
  25. package/client/dist/assets/{settings-u-16ISHt.js → settings-Puea5c8v.js} +1 -1
  26. package/client/dist/assets/{tickets-9kdPXInd.js → tickets-CG_mo-Bg.js} +1 -1
  27. package/client/dist/assets/{tickets-n23kDqJT.js → tickets-CVJQ-vRm.js} +1 -1
  28. package/client/dist/assets/{tickets-tGx5AR5b.js → tickets-D5MSAPe_.js} +1 -1
  29. package/client/dist/assets/{tickets-1UIGf_oA.js → tickets-DBV3wgQZ.js} +1 -1
  30. package/client/dist/assets/{tickets-DNmXcAwu.js → tickets-Q0_pONEh.js} +1 -1
  31. package/client/dist/assets/{tickets-C6pwZwt4.js → tickets-RZ0LyeQe.js} +1 -1
  32. package/client/dist/assets/{tickets-DAjtxAVb.js → tickets-d1A6EOHa.js} +1 -1
  33. package/client/dist/assets/{tickets-0rM0lIXd.js → tickets-r4-oNV0R.js} +1 -1
  34. package/client/dist/assets/{useProjectCache-BeyBSNpD.js → useProjectCache-vvFIixVa.js} +1 -1
  35. package/client/dist/index.html +4 -4
  36. package/package.json +1 -1
  37. package/server/dist/core-update-manager.js +219 -0
  38. package/server/dist/desktop-router.js +43 -0
  39. package/server/dist/framework-manager.js +48 -10
  40. package/server/dist/path-resolver.js +21 -0
  41. package/server/dist/semver-lite.js +92 -0
  42. package/server/dist/setup-manager.js +8 -1
  43. package/client/dist/assets/index-D6BaYRRU.css +0 -2
  44. package/client/dist/assets/settings-C0-7Fpxg.js +0 -1
@@ -4,6 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.resolveBundledRuntimePath = resolveBundledRuntimePath;
7
+ exports.resolveBundledNodeExe = resolveBundledNodeExe;
7
8
  exports.resolveStartupPath = resolveStartupPath;
8
9
  exports.parseLoginShellOutput = parseLoginShellOutput;
9
10
  exports.augmentPathFromLoginShell = augmentPathFromLoginShell;
@@ -94,6 +95,26 @@ function resolveBundledRuntimePath() {
94
95
  }
95
96
  return p;
96
97
  }
98
+ /**
99
+ * Absolute path to the bundled REAL Node executable (`runtimes/node/bin/node` on
100
+ * POSIX, `runtimes/node/node.exe` on Windows), or `null` when no bundled runtimes
101
+ * are present (non-desktop mode, a runtimes-less build, or a partial extraction).
102
+ *
103
+ * This is the node that must run bundled node CLIs (e.g. the openspec ESM CLI).
104
+ * It is deliberately NOT `process.execPath`: in the packaged app `process.execPath`
105
+ * is the `specrails-server` pkg binary, which cannot run an external ESM CLI —
106
+ * passing it as `SPECRAILS_OPENSPEC_NODE` made `openspec init` exit with code -1.
107
+ * Existence-gated so a stale/partial bundle degrades to the PATH `node` instead.
108
+ */
109
+ function resolveBundledNodeExe() {
110
+ const runtimesPath = process.env.SPECRAILS_BUNDLED_RUNTIMES_PATH;
111
+ if (!runtimesPath || runtimesPath.length === 0)
112
+ return null;
113
+ const exe = process.platform === 'win32'
114
+ ? path_1.default.join(runtimesPath, 'node', 'node.exe')
115
+ : path_1.default.join(runtimesPath, 'node', 'bin', 'node');
116
+ return fileExists(exe) ? exe : null;
117
+ }
97
118
  /**
98
119
  * Synchronously prepend well-known package-manager bin directories to
99
120
  * `process.env.PATH` if they are missing. No-op on Windows.
@@ -0,0 +1,92 @@
1
+ "use strict";
2
+ /**
3
+ * Minimal semver comparison — the repo has no `semver` dependency and the core
4
+ * update channel only needs "is A strictly newer than B" plus a total order.
5
+ *
6
+ * Supports `MAJOR.MINOR.PATCH` with an optional `-prerelease` suffix. A version
7
+ * WITH a prerelease tag sorts BELOW the same version without one (`4.9.0-rc.1` <
8
+ * `4.9.0`), matching semver §11. Prerelease identifiers are compared
9
+ * left-to-right: numeric identifiers numerically, others lexically, numeric <
10
+ * non-numeric, and a shorter prerelease set sorts lower when all prior
11
+ * identifiers are equal. Build metadata (`+…`) is ignored. Leading `v`/`=` and
12
+ * surrounding whitespace are tolerated. Unparseable input sorts as `0.0.0`.
13
+ */
14
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ exports.compareVersions = compareVersions;
16
+ exports.isNewer = isNewer;
17
+ exports.isValidVersion = isValidVersion;
18
+ function parse(raw) {
19
+ const cleaned = String(raw ?? '')
20
+ .trim()
21
+ .replace(/^[v=]+/, '')
22
+ .split('+', 1)[0]; // drop build metadata
23
+ const [core, pre] = cleaned.split('-', 2);
24
+ const parts = core.split('.');
25
+ const num = (s) => {
26
+ const n = Number.parseInt(s ?? '', 10);
27
+ return Number.isFinite(n) && n >= 0 ? n : 0;
28
+ };
29
+ return {
30
+ major: num(parts[0]),
31
+ minor: num(parts[1]),
32
+ patch: num(parts[2]),
33
+ prerelease: pre && pre.length > 0 ? pre.split('.') : [],
34
+ };
35
+ }
36
+ function comparePrerelease(a, b) {
37
+ // No prerelease outranks any prerelease (1.0.0 > 1.0.0-rc).
38
+ if (a.length === 0 && b.length === 0)
39
+ return 0;
40
+ if (a.length === 0)
41
+ return 1;
42
+ if (b.length === 0)
43
+ return -1;
44
+ const len = Math.max(a.length, b.length);
45
+ for (let i = 0; i < len; i++) {
46
+ const ai = a[i];
47
+ const bi = b[i];
48
+ if (ai === undefined)
49
+ return -1; // shorter set sorts lower
50
+ if (bi === undefined)
51
+ return 1;
52
+ if (ai === bi)
53
+ continue;
54
+ const an = /^\d+$/.test(ai);
55
+ const bn = /^\d+$/.test(bi);
56
+ if (an && bn) {
57
+ const d = Number.parseInt(ai, 10) - Number.parseInt(bi, 10);
58
+ if (d !== 0)
59
+ return d < 0 ? -1 : 1;
60
+ }
61
+ else if (an) {
62
+ return -1; // numeric identifiers have lower precedence than non-numeric
63
+ }
64
+ else if (bn) {
65
+ return 1;
66
+ }
67
+ else {
68
+ return ai < bi ? -1 : 1;
69
+ }
70
+ }
71
+ return 0;
72
+ }
73
+ /** -1 if a < b, 0 if equal, 1 if a > b. */
74
+ function compareVersions(a, b) {
75
+ const pa = parse(a);
76
+ const pb = parse(b);
77
+ if (pa.major !== pb.major)
78
+ return pa.major < pb.major ? -1 : 1;
79
+ if (pa.minor !== pb.minor)
80
+ return pa.minor < pb.minor ? -1 : 1;
81
+ if (pa.patch !== pb.patch)
82
+ return pa.patch < pb.patch ? -1 : 1;
83
+ return comparePrerelease(pa.prerelease, pb.prerelease);
84
+ }
85
+ /** True when `candidate` is strictly newer than `base`. */
86
+ function isNewer(candidate, base) {
87
+ return compareVersions(candidate, base) > 0;
88
+ }
89
+ /** True when `raw` looks like a parseable `MAJOR.MINOR.PATCH[-pre]` version. */
90
+ function isValidVersion(raw) {
91
+ return /^[v=]?\d+\.\d+\.\d+(?:[-+].*)?$/.test(String(raw ?? '').trim());
92
+ }
@@ -24,6 +24,7 @@ const artifact_registry_1 = require("./artifact-registry");
24
24
  const install_config_path_1 = require("./install-config-path");
25
25
  const bundled_core_1 = require("./bundled-core");
26
26
  const bundled_openspec_1 = require("./bundled-openspec");
27
+ const path_resolver_1 = require("./path-resolver");
27
28
  const framework_manager_1 = require("./framework-manager");
28
29
  /**
29
30
  * specrails-core's installer (Node-native from v4.2.0 onward, bash
@@ -109,7 +110,13 @@ function spawnBundledCoreInit(args, cwd) {
109
110
  const openspecCli = (0, bundled_openspec_1.getBundledOpenspecCli)();
110
111
  if (openspecCli) {
111
112
  env.SPECRAILS_OPENSPEC_BIN = openspecCli;
112
- env.SPECRAILS_OPENSPEC_NODE = process.execPath;
113
+ // Core runs openspec as `<node> <cli> init …`. SPECRAILS_OPENSPEC_NODE MUST be
114
+ // a REAL node executable — NOT process.execPath (the packaged `specrails-server`
115
+ // pkg binary), which cannot run openspec's ESM CLI and made `openspec init`
116
+ // exit with code -1 (→ core throws InstallerError code 50, setup fails). Prefer
117
+ // the bundled Node; fall back to `node` on PATH (resolveStartupPath prepends the
118
+ // bundled node bin in desktop mode, so PATH `node` is the bundled node too).
119
+ env.SPECRAILS_OPENSPEC_NODE = (0, path_resolver_1.resolveBundledNodeExe)() ?? 'node';
113
120
  }
114
121
  console.log(`[SetupManager] spawning BUNDLED core: ${process.execPath} ${fullArgs.join(' ')} (cwd=${cwd})` +
115
122
  (openspecCli ? ' [bundled openspec: offline]' : ' [openspec: npx fallback]'));