@chanlerdev/scorel 0.0.5 → 0.0.7

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.
@@ -0,0 +1,108 @@
1
+ # S0108: GUI Bundled CLI Runtime
2
+
3
+ ## Goal
4
+
5
+ Make the packaged desktop GUI self-contained for local Host startup.
6
+
7
+ The business value is that installing `Scorel.app` is enough to use the local GUI path. Users must not need a terminal-launched environment, a global `node`, a global `scorel`, or the source repository layout for GUI Settings and local Project workflows to work.
8
+
9
+ ## Scope
10
+
11
+ - Vendor the same-version public `scorel` CLI release artifact into the macOS GUI bundle.
12
+ - Make packaged GUI startup resolve the local Host launcher from the app bundle, not from `PATH`.
13
+ - Keep development startup convenient through the existing source CLI path.
14
+ - Remove the packaged-build requirement for `SCOREL_CLI_ENTRYPOINT`.
15
+ - Add release/package tests proving the GUI bundle contract references `Contents/Resources/scorel`.
16
+ - Add a regression test for Finder/Dock-like startup where `PATH` does not contain Node.
17
+
18
+ ## Not In Scope
19
+
20
+ - Publishing the GUI through npm.
21
+ - Replacing the CLI with a separate `scorel-host` binary.
22
+ - Changing `scorel host start` daemon lifecycle semantics.
23
+ - Changing the public CLI command surface.
24
+ - Adding LaunchAgent/login-item restart supervision.
25
+ - Supporting Windows/Linux GUI packaging in this spec.
26
+
27
+ ## Contract
28
+
29
+ The packaged macOS app contains:
30
+
31
+ ```text
32
+ Scorel.app
33
+ Contents/Resources/
34
+ scorel # launcher script
35
+ scorel.js # bundled CLI artifact
36
+ app.asar
37
+ ```
38
+
39
+ Packaged GUI starts the local singleton Host with the bundle-owned executable:
40
+
41
+ ```text
42
+ Contents/Resources/scorel host start --port 0 --cwd <bootstrap-project> --idle-timeout-ms <ms> --no-relay
43
+ ```
44
+
45
+ Development GUI may continue to use the source entrypoint:
46
+
47
+ ```text
48
+ node --import tsx apps/cli/src/index.ts host start ...
49
+ ```
50
+
51
+ The packaged path must not depend on:
52
+
53
+ - `node` being discoverable in `PATH`;
54
+ - `scorel` being globally installed;
55
+ - `SCOREL_NODE_PATH`;
56
+ - `SCOREL_CLI_ENTRYPOINT`;
57
+ - `apps/cli/src/index.ts` existing inside the app bundle.
58
+
59
+ ## Acceptance Criteria
60
+
61
+ - `apps/gui` Electron Builder config includes a generated `.runtime` directory containing `scorel` and `scorel.js` in `Contents/Resources`.
62
+ - The bundled `scorel` launcher uses the app's own Electron executable with `ELECTRON_RUN_AS_NODE=1` to run the built CLI artifact as `scorel.js`.
63
+ - Packaged GUI resolves the Host launcher to `process.resourcesPath/scorel`.
64
+ - Packaged GUI spawns `scorel` directly and does not prepend `node`, `tsx`, or source entrypoint args.
65
+ - Development GUI still supports `SCOREL_CLI_ENTRYPOINT` and `SCOREL_NODE_PATH` for local debugging.
66
+ - A unit test proves packaged Host startup uses the bundle CLI even with an empty/minimal `PATH`.
67
+ - Release tests prove the GUI package depends on the built CLI artifact and bundle destination.
68
+ - `docs/SHIP.md`, `docs/ROADMAP.md`, and `README.md` describe that GUI release assets include a bundled same-version CLI runtime.
69
+
70
+ ## Test Requirements
71
+
72
+ ```bash
73
+ pnpm --filter @scorel/app-gui test -- src/main/host-launcher.test.ts
74
+ node --test scripts/release-gui.test.mjs
75
+ pnpm --filter @scorel/app-gui build
76
+ pnpm build:package
77
+ git diff --check
78
+ ```
79
+
80
+ Full release readiness still uses:
81
+
82
+ ```bash
83
+ pnpm typecheck && pnpm test
84
+ pnpm release patch --dry-run
85
+ ```
86
+
87
+ ## Impacted Files
88
+
89
+ - `apps/gui/package.json`
90
+ - `apps/gui/src/main.ts`
91
+ - `apps/gui/src/main/host-launcher.ts`
92
+ - `apps/gui/src/main/host-launcher.test.ts`
93
+ - `apps/gui/scripts/build-runtime.mjs`
94
+ - `apps/gui/scripts/build-runtime.node-test.mjs`
95
+ - `scripts/release-gui.test.mjs`
96
+ - `docs/SHIP.md`
97
+ - `docs/ROADMAP.md`
98
+ - `README.md`
99
+
100
+ ## Risks And Boundaries
101
+
102
+ - The vendored CLI must be built before `electron-builder` runs. Release flow already runs `pnpm build:package`; local `dist:mac` must do the same or fail clearly.
103
+ - The bundled CLI runs under Electron's Node mode. A fully native/self-contained CLI binary remains a possible future hardening step, but the packaged GUI no longer depends on user `PATH` for Node.
104
+ - The GUI must never call the user's global `scorel`, because that can drift from the GUI version and mutate the local Host contract.
105
+
106
+ ## Status
107
+
108
+ Done.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@chanlerdev/scorel",
3
- "version": "0.0.5",
3
+ "version": "0.0.7",
4
4
  "description": "Replayable, recoverable, remotely controllable AI Agent workspace.",
5
5
  "type": "module",
6
6
  "packageManager": "pnpm@11.1.2",