@chanlerdev/scorel 0.0.3 → 0.0.5

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,57 @@
1
+ # S0100: GUI Provider Danger Zone Placement
2
+
3
+ ## Goal
4
+
5
+ Move destructive Provider management actions out of the primary Provider edit form, so normal configuration fields remain the first visual focus and deletion is clearly presented as a secondary dangerous action.
6
+
7
+ S0101 supersedes the final placement: `删除提供商` now lives in the Provider configuration block's lower-right action area instead of a bottom danger row.
8
+
9
+ ## Scope
10
+
11
+ - In GUI Settings -> Provider:
12
+ - this spec recorded the first placement pass;
13
+ - S0101 defines the current placement in the Provider configuration block;
14
+ - keep the existing `removeModelProvider` behavior unchanged.
15
+ - Add rendering coverage that verifies the destructive action is below normal model-management controls.
16
+
17
+ ## Not In Scope
18
+
19
+ - Changing Provider deletion semantics, confirmation behavior, or daemon/client APIs.
20
+ - Redesigning the Provider page layout beyond the destructive-action placement.
21
+ - Changing model catalog, model selection, or provider form fields.
22
+
23
+ ## Acceptance Criteria
24
+
25
+ - Current acceptance is governed by S0101: `删除提供商` appears in the Provider configuration block.
26
+ - Existing Provider add/edit/model actions remain unchanged.
27
+ - GUI rendering tests cover the current placement.
28
+
29
+ ## Test Requirements
30
+
31
+ ```bash
32
+ pnpm --filter @scorel/app-gui test -- src/renderer/gui-shell.test.tsx
33
+ pnpm --filter @scorel/app-gui typecheck
34
+ ```
35
+
36
+ Manual:
37
+
38
+ - Start the GUI with a Project that has a configured Provider.
39
+ - Open Settings -> Provider.
40
+ - Confirm S0101 current behavior: the delete button appears in the Provider configuration block's lower-right action area.
41
+
42
+ ## Impacted Files
43
+
44
+ - `apps/gui/src/renderer/settings/sections/ProviderSection.tsx`
45
+ - `apps/gui/src/renderer/styles.css`
46
+ - `apps/gui/src/renderer/gui-shell.test.tsx`
47
+ - `docs/CHANGELOG.md`
48
+ - `docs/ROADMAP.md`
49
+
50
+ ## Risks And Boundaries
51
+
52
+ - The delete action remains destructive and immediate, matching existing behavior. This spec only changes placement.
53
+ - The danger row should not introduce another card nested inside the Provider card; it stays as an inline separated row.
54
+
55
+ ## Status
56
+
57
+ Done.
@@ -0,0 +1,66 @@
1
+ # S0101 GUI Device Settings Polish
2
+
3
+ ## Goal
4
+
5
+ Fix GUI settings so configuration is device-scoped, not Project-scoped, and polish the settings interactions surfaced by the latest Provider / Token / Connection review.
6
+
7
+ One device has one configuration. The Settings scope selector chooses a device:
8
+
9
+ - `此电脑` configures the local device.
10
+ - A Relay device configures that remote device.
11
+ - Projects remain workspace/session objects and must not appear as the settings configuration scope.
12
+
13
+ ## Scope
14
+
15
+ - Settings left scope selector becomes device-based.
16
+ - GUI settings IPC for model profile, Provider catalog/deletion, memory settings, and runtime settings targets only a device.
17
+ - Daemon/client config requests used by GUI are device-level and write the device user config at `~/.scorel/config.toml` for that daemon.
18
+ - Provider deletion moves into the top Provider configuration form area, aligned to the lower-right of the Provider parameter block.
19
+ - Runtime token statistics use understandable Chinese labels and expose both output token total and saved token estimate.
20
+ - Relay device rows have an explicit expand affordance.
21
+ - Relay device rename is inline: a small edit icon next to the device name turns the name into an input.
22
+
23
+ ## Not In Scope
24
+
25
+ - Changing session/project ownership: sessions still belong to Projects.
26
+ - Redesigning Project registry or remote Project selection.
27
+ - Creating per-Project settings overrides.
28
+ - Reworking IM extension settings beyond existing user-config behavior.
29
+ - Changing RTK savings math.
30
+
31
+ ## Acceptance Criteria
32
+
33
+ - Settings selector labels are device names only, for example `此电脑` and `Remote Device`; it does not render `此电脑 / ProjectName` or `Device / ProjectName`.
34
+ - Settings Provider/Model/Memory/Runtime mutations do not accept a Project in GUI IPC.
35
+ - Daemon writes GUI settings requests to device-level user config.
36
+ - Provider delete is visually close to Provider credentials/configuration, not in a separate bottom danger row.
37
+ - Runtime token stats are Chinese and self-explanatory.
38
+ - Relay device rows visibly indicate expand/collapse and rename through a name-adjacent edit icon.
39
+
40
+ ## Test Requirements
41
+
42
+ - Update renderer tests for device settings scope, Provider delete placement, Runtime labels, and inline Relay device rename affordance.
43
+ - Add or update daemon/local-host tests proving projectless settings write `config.toml` under device user config.
44
+ - Run targeted GUI/protocol/daemon tests covering changed paths.
45
+ - Run `pnpm typecheck && pnpm test` before shipping.
46
+
47
+ ## Impacted Files
48
+
49
+ - `packages/protocol/src/events.ts`
50
+ - `packages/protocol/src/wire.ts`
51
+ - `packages/client/src/index.ts`
52
+ - `packages/daemon/src/index.ts`
53
+ - `apps/gui/src/main.ts`
54
+ - `apps/gui/src/main/local-host.ts`
55
+ - `apps/gui/src/main/relay-service.ts`
56
+ - `apps/gui/src/preload.ts`
57
+ - `apps/gui/src/shared/ipc.ts`
58
+ - `apps/gui/src/renderer/App.tsx`
59
+ - `apps/gui/src/renderer/settings/*`
60
+ - `apps/gui/src/renderer/styles.css`
61
+ - `docs/ROADMAP.md`
62
+ - `docs/CHANGELOG.md`
63
+
64
+ ## Risks And Boundaries
65
+
66
+ - Memory status is a Project activity/status concept; this spec keeps Settings focused on Memory configuration, not Project activity status.
@@ -0,0 +1,58 @@
1
+ # S0102 Device Only Config
2
+
3
+ ## Goal
4
+
5
+ Remove project-level config as a product concept. A Scorel device has exactly one editable config, stored at that device's Scorel home `config.toml`.
6
+
7
+ Projects are workspace/session objects. They do not own Provider, Model, Memory, Runtime, or Extension settings.
8
+
9
+ ## Scope
10
+
11
+ - Core config loading reads only the device/user config file.
12
+ - Remove `.scorel/config.toml` from the public config schema and runtime loading contract.
13
+ - Settings writes always target the device config, even if an older request still includes a `projectId`.
14
+ - CLI daemon, CLI chat, GUI local host, and daemon fallback config reads pass the device `scorelHomeDir` explicitly so custom device roots do not read the process user's real `~/.scorel/config.toml`.
15
+ - Update current config docs/specs that describe project-scoped config.
16
+
17
+ ## Not In Scope
18
+
19
+ - Changing Project/session ownership.
20
+ - Removing Project registry or remote Project selection.
21
+ - Adding migration for old project `.scorel/config.toml` files.
22
+ - Changing project-scoped Memory status or runtime stats, which are activity/status data, not config ownership.
23
+
24
+ ## Acceptance Criteria
25
+
26
+ - `loadScorelConfig` and `loadScorelConfigProfile` ignore project `.scorel/config.toml`.
27
+ - If device config is missing, config loading reports the missing device config path.
28
+ - Provider/model/memory/runtime/extension Settings writes go to device `config.toml`.
29
+ - Requests with `projectId` do not create or mutate project `.scorel/config.toml`.
30
+ - Runtime creation for a Project still uses that device's single config.
31
+ - Docs describe config as device-only.
32
+
33
+ ## Test Requirements
34
+
35
+ - Core config tests load from device/user config and prove project `.scorel/config.toml` is ignored.
36
+ - Daemon embedded tests prove Settings writes with `projectId` still write device config only.
37
+ - CLI daemon idle test continues to prove custom device state roots do not inherit active IM from the real user config.
38
+ - Run `pnpm typecheck && pnpm test`.
39
+
40
+ ## Impacted Files
41
+
42
+ - `packages/core/src/config/index.ts`
43
+ - `packages/core/src/config/config.test.ts`
44
+ - `packages/daemon/src/index.ts`
45
+ - `packages/daemon/src/embedded/embedded.test.ts`
46
+ - `apps/cli/src/index.ts`
47
+ - `apps/cli/src/daemon-cli.ts`
48
+ - `apps/gui/src/main/local-host.ts`
49
+ - `docs/spec/extensions.md`
50
+ - `docs/spec/ship/S0097-rtk-token-saving-settings.md`
51
+ - `docs/spec/ship/S0086-auto-compact-and-session-memory.md`
52
+ - `docs/ROADMAP.md`
53
+ - `docs/CHANGELOG.md`
54
+
55
+ ## Risks And Boundaries
56
+
57
+ - Pre-1.0 development rules allow removing this stale config surface rather than preserving compatibility.
58
+ - Old project `.scorel/config.toml` files may remain on disk, but runtime no longer treats them as config.
@@ -0,0 +1,61 @@
1
+ # S0103: Daemon Lifecycle And Settings Resilience
2
+
3
+ ## Goal
4
+
5
+ Clarify daemon lifetime by entrypoint and make GUI Settings resilient when switching devices and sections, especially after selecting a Relay device.
6
+
7
+ Business value: a VPS demo host should stay online when the user explicitly starts it, while GUI/CUI convenience daemons still clean themselves up after local use. Settings failures must surface as recoverable errors, not a black renderer.
8
+
9
+ ## Scope
10
+
11
+ - `scorel host start` launches a background host that stays alive until explicit stop, process signal, crash, or machine shutdown.
12
+ - `scorel host serve` is foreground: it stays alive until Ctrl+C / SIGTERM unless the user explicitly provides `--idle-timeout-ms`.
13
+ - GUI auto-start and `scorel up` auto-start keep the existing 15 minute idle shutdown policy.
14
+ - GUI auto-start binds an ephemeral local port so a user-owned daemon on the default port cannot make GUI startup fail.
15
+ - `--idle-timeout-ms 0` remains the explicit "no idle shutdown" value.
16
+ - GUI Settings must ignore stale settings responses from a previously selected device.
17
+ - GUI Settings must render a local error fallback instead of blacking out the whole app when a Settings section throws.
18
+ - CDP verification covers Settings remote-device switching without renderer errors.
19
+
20
+ ## Not In Scope
21
+
22
+ - Changing active IM keepalive semantics. Active IM still prevents idle shutdown.
23
+ - Adding a new public `--keep-alive` flag; this spec keeps the existing `--idle-timeout-ms 0` primitive and fixes defaults.
24
+ - Remote SSH device installation or management.
25
+
26
+ ## Acceptance Criteria
27
+
28
+ - Direct `scorel host start` spawns `host serve` with idle shutdown disabled by default.
29
+ - Direct `scorel host serve` does not idle-exit by default; Ctrl+C/SIGTERM still stops it.
30
+ - `scorel up` spawns the daemon with a 15 minute idle timeout.
31
+ - GUI auto-start spawns the daemon with a 15 minute idle timeout.
32
+ - GUI auto-start uses the persisted `daemon.json` actual port instead of assuming the default daemon port is free.
33
+ - Settings device changes reset device-scoped settings state and ignore stale async responses.
34
+ - Settings section render errors show an in-app fallback and do not remove the app shell.
35
+ - CDP GUI verification seeds a device config, switches to a remote device in Settings, flips across Settings sections, and fails on renderer errors.
36
+
37
+ ## Tests
38
+
39
+ - CLI daemon tests cover background start idle disable, foreground serve default no-idle, explicit idle timeout, and active IM keepalive.
40
+ - `scorel up` tests assert the internal daemon spawn passes the 15 minute idle timeout.
41
+ - GUI renderer tests cover stale local settings data not overwriting remote settings data.
42
+ - CDP GUI verification covers remote Settings section switching and device-level config persistence.
43
+
44
+ ## Files
45
+
46
+ - `apps/cli/src/daemon-cli.ts`
47
+ - `apps/cli/src/up-cli.ts`
48
+ - `apps/gui/src/main.ts`
49
+ - `apps/gui/src/renderer/App.tsx`
50
+ - `apps/gui/src/renderer/settings/SettingsShell.tsx`
51
+ - `apps/gui/src/renderer/settings/sections/ModelSection.tsx`
52
+ - `apps/gui/src/renderer/settings/sections/ProviderSection.tsx`
53
+ - `scripts/verify-m9-gui-cdp-e2e.ts`
54
+ - `docs/SHIP.md`
55
+ - `docs/ROADMAP.md`
56
+ - `docs/CHANGELOG.md`
57
+
58
+ ## Risks
59
+
60
+ - A foreground host without idle shutdown can run forever. That is intended because terminal ownership and Ctrl+C are visible to the user.
61
+ - GUI/CUI auto-start must remain explicit about its 15 minute idle timeout; otherwise changing host defaults would make local helper daemons permanent.
@@ -0,0 +1,64 @@
1
+ # S0104: Tool Result Artifacts
2
+
3
+ ## Goal
4
+
5
+ Keep long tool results useful without letting them dominate model context.
6
+
7
+ When a tool result is too large, Scorel should preserve the full result as a session-owned artifact and put only a compact, actionable projection in the model-facing tool result.
8
+
9
+ ## Scope
10
+
11
+ - Add a session-owned artifact path for oversized tool results:
12
+
13
+ ```text
14
+ ~/.scorel/sessions/{sessionId}.artifacts/{toolCallId}/result.txt
15
+ ```
16
+
17
+ - Start with `Bash` stdout/stderr because it is the highest-risk long-output source.
18
+ - Preserve the full command result in `result.txt`, including exit code, cwd, stdout, and stderr.
19
+ - Return a compact tool result containing:
20
+ - exit code;
21
+ - cwd;
22
+ - full artifact path;
23
+ - complete result byte count;
24
+ - stdout/stderr byte counts;
25
+ - a budgeted head/tail projection of the oversized streams.
26
+ - Treat `maxOutputBytes` as the total projection snippet budget across stdout/stderr, not as a per-stream head/tail allowance. For example, a 16,000-byte projection budget should not turn into 16,000 bytes of stdout head plus 16,000 bytes of stdout tail plus the same again for stderr.
27
+ - Keep session JSONL append-only. Do not rewrite or delete old tool result events.
28
+ - Keep diagnostics free of full prompt text and full tool results.
29
+ - Keep Relay and attach-cache out of this storage path.
30
+
31
+ ## Not In Scope
32
+
33
+ - Background Bash, task id, poll, stop, or monitor semantics.
34
+ - Artifact retention policy, compression, upload, or remote retrieval.
35
+ - Rewriting existing session JSONL files.
36
+ - Applying artifact projection to `Read`, `Grep`, `Glob`, or MCP tools.
37
+ - Provider-specific token accounting.
38
+
39
+ ## Acceptance Criteria
40
+
41
+ - `Bash` output at or below the existing output limit behaves as before.
42
+ - `Bash` output above the limit writes the complete result to `result.txt`.
43
+ - Oversized `Bash` model-facing content includes the artifact path, `resultBytes`, and budgeted head/tail snippets instead of only the leading bytes.
44
+ - The artifact file contains the complete stdout/stderr text, not only the projected snippets.
45
+ - The tool result details expose artifact metadata for UI/diagnostics without requiring it to enter rebuilt model context.
46
+ - Existing `buildContext()` behavior still strips tool execution details from replayed model context.
47
+ - `pnpm --filter @scorel/core test -- src/tools/coding-tools.test.ts`
48
+ - `pnpm --filter @scorel/daemon test -- src/embedded/embedded.test.ts`
49
+ - `pnpm typecheck && pnpm test`
50
+
51
+ ## Impacted Files
52
+
53
+ - `packages/core/src/tools/coding-tools.ts`
54
+ - `packages/core/src/tools/coding-tools.test.ts`
55
+ - `packages/core/src/session/index.ts`
56
+ - `packages/daemon/src/index.ts`
57
+ - CLI / GUI runtime creation paths that call `createRealRuntime`
58
+ - `docs/ROADMAP.md`
59
+
60
+ ## Risks And Boundaries
61
+
62
+ - Full command output can contain secrets. The artifact path is local session data and must not be copied into diagnostics, attach-cache, or Relay.
63
+ - Head/tail snippets can still expose sensitive text. This is no worse than the current truncated result, but future permission policy should handle sensitive commands explicitly.
64
+ - Artifact paths are local to the daemon-owning machine. Remote clients can see the path as evidence, but remote file retrieval is a separate future protocol.
@@ -0,0 +1,128 @@
1
+ # S0105: CLI Update And GUI Release
2
+
3
+ ## Goal
4
+
5
+ Make Scorel's user-facing command surface complete enough for release users, and make CLI / GUI updates part of the same release story.
6
+
7
+ ## Scope
8
+
9
+ - Add top-level `scorel version` / `scorel --version`.
10
+ - Add manual `scorel update` and `scorel upgrade` commands for the public npm package.
11
+ - Add Host-side automatic npm update checks:
12
+ - check npm latest once per hour
13
+ - install only when no active work is running, or active work has been stale for at least three hours
14
+ - after a successful background update, stop the Host with an `auto-update` reason so the next entry start uses the new binary
15
+ - Keep `scorel` as the default interactive project command, and keep lifecycle/diagnostic commands grouped under product nouns: `host`, `pair`, `relay`, `webui`, `up`, `project`, `logs`.
16
+ - Add GUI release packaging to the same GitHub Release:
17
+ - Electron macOS dmg + zip targets
18
+ - `latest-mac.yml`
19
+ - `.blockmap` metadata for incremental updates
20
+ - `electron-updater` bootstrap in packaged GUI builds
21
+ - Add normal desktop update affordances:
22
+ - application menu `Check for Updates...`
23
+ - macOS status bar menu with show, settings, check updates, Host status, and quit
24
+ - Document unsigned macOS build handling for users without an Apple Developer account.
25
+
26
+ ## Non-Goals
27
+
28
+ - Do not add auth/account commands before Scorel has a real account system.
29
+ - Do not add deprecated aliases for old command shapes.
30
+ - Do not publish GUI through npm.
31
+ - Do not claim notarization or Gatekeeper trust without Apple Developer signing credentials.
32
+ - Do not make Relay or hosted WebUI own update state.
33
+
34
+ ## Contract
35
+
36
+ ### CLI Surface
37
+
38
+ The stable user command groups are:
39
+
40
+ ```text
41
+ scorel [--session <id>] [--cwd <dir>]
42
+ scorel chat [--session <id>] [--cwd <dir>]
43
+ scorel attach --session <id> --remote <ws-url> --token <token>
44
+ scorel host start|serve|status|stop|reset
45
+ scorel pair <pair-code>
46
+ scorel relay serve
47
+ scorel webui
48
+ scorel up
49
+ scorel project list|add|remove
50
+ scorel logs
51
+ scorel version
52
+ scorel update
53
+ scorel upgrade
54
+ ```
55
+
56
+ This mirrors the broad shape used by mature agent CLIs: one default interactive command, explicit session/control commands, and a direct update command.
57
+
58
+ ### CLI Update
59
+
60
+ `scorel update` and `scorel upgrade` both:
61
+
62
+ - query `npm view @chanlerdev/scorel version`
63
+ - compare against the installed package version with semver ordering
64
+ - run `npm install -g @chanlerdev/scorel@<latest>` only when latest is newer
65
+ - print a clear no-op message when already current
66
+
67
+ Host auto-update uses the same updater helper. The active-work gate is generic: it reads Host runtime/queue activity, not filenames, paths, screenshots, or one failure sample.
68
+
69
+ ### GUI Release
70
+
71
+ `apps/gui` remains private and separate from the npm CLI package. Release packaging uses Electron Builder with GitHub provider metadata so `electron-updater` can check the same GitHub Release.
72
+
73
+ The release asset set is:
74
+
75
+ ```text
76
+ <npm pack tarball>
77
+ apps/gui/release/latest-mac.yml
78
+ apps/gui/release/*.dmg
79
+ apps/gui/release/*.dmg.blockmap
80
+ apps/gui/release/*.zip
81
+ apps/gui/release/*.zip.blockmap
82
+ ```
83
+
84
+ The macOS Action runs with `CSC_IDENTITY_AUTO_DISCOVERY=false` until signing/notarization credentials exist.
85
+
86
+ ## Acceptance Criteria
87
+
88
+ - `scorel --help` lists update/version commands.
89
+ - `scorel --version` and `scorel version` print the installed version.
90
+ - `scorel update` / `scorel upgrade` have tested npm check/install behavior.
91
+ - Host auto-update gate is covered by tests.
92
+ - GUI packaged app initializes `electron-updater` only when packaged.
93
+ - GUI exposes manual update checks from both the application menu and the macOS status bar menu.
94
+ - GUI registers a macOS status bar menu with Host status and common app actions.
95
+ - Release script version lockstep includes `apps/gui/package.json`.
96
+ - Release script uploads GUI installer/update metadata assets to GitHub Release.
97
+ - README documents manual update, automatic update, GUI packaging, and unsigned macOS `xattr` workaround.
98
+
99
+ ## Test Requirements
100
+
101
+ ```bash
102
+ pnpm --filter @scorel/app-cli test -- update-cli.test.ts
103
+ pnpm --filter @scorel/app-gui test -- main-menu.test.ts
104
+ node --test scripts/release-gui.test.mjs
105
+ pnpm typecheck
106
+ pnpm test
107
+ git diff --check
108
+ ```
109
+
110
+ ## Affected Paths
111
+
112
+ - `apps/cli/src/index.ts`
113
+ - `apps/cli/src/update-cli.ts`
114
+ - `apps/cli/src/daemon-cli.ts`
115
+ - `packages/daemon/src/index.ts`
116
+ - `apps/gui/package.json`
117
+ - `apps/gui/src/main.ts`
118
+ - `scripts/release.mjs`
119
+ - `.github/workflows/release.yml`
120
+ - `README.md`
121
+ - `docs/SHIP.md`
122
+ - `docs/ROADMAP.md`
123
+
124
+ ## Risks
125
+
126
+ - `npm install -g` can fail on machines where the user lacks permission for the global prefix. The command reports the npm error instead of silently mutating local state.
127
+ - Auto-updating a running Host cannot replace the current Node process in-place. The short-stop mechanism exits after successful installation; GUI/WebUI/CLI entrypoints can then start the new binary.
128
+ - Unsigned macOS apps are viable for local distribution but not trustworthy public distribution. Notarization should be added once an Apple Developer account is available.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@chanlerdev/scorel",
3
- "version": "0.0.3",
3
+ "version": "0.0.5",
4
4
  "description": "Replayable, recoverable, remotely controllable AI Agent workspace.",
5
5
  "type": "module",
6
6
  "packageManager": "pnpm@11.1.2",
@@ -36,7 +36,9 @@
36
36
  "typecheck": "pnpm -r typecheck",
37
37
  "test": "pnpm -r test",
38
38
  "verify:m8-relay": "node --import tsx scripts/verify-m8-relay-e2e.ts",
39
- "verify:m9-gui": "node --import tsx scripts/verify-m9-gui-e2e.ts",
39
+ "verify:m9-gui": "pnpm verify:m9-gui:service && pnpm verify:m9-gui:cdp",
40
+ "verify:m9-gui:service": "node --import tsx scripts/verify-m9-gui-e2e.ts",
41
+ "verify:m9-gui:cdp": "node --import tsx scripts/verify-m9-gui-cdp-e2e.ts",
40
42
  "scorel": "node --import tsx apps/cli/src/index.ts",
41
43
  "dev": "node --import tsx apps/cli/src/index.ts up",
42
44
  "gui": "pnpm --filter @scorel/app-gui dev"