@chanlerdev/scorel 0.0.7 → 0.0.8

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.
package/docs/CHANGELOG.md CHANGED
@@ -2,6 +2,32 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ ## 0.0.8 - 2026-06-26
6
+
7
+ ### Highlights
8
+
9
+ - New `scorel run` command for headless, non-interactive task execution
10
+ - GUI now correctly loads memory status for the selected project on session preload
11
+ - Sessions can be attached even when provider credentials are missing
12
+
13
+ ### Changes
14
+
15
+ - Added `scorel run` command with multiple prompt sources, execution options, provider overrides, and machine-readable summary output
16
+ - GUI now fetches and displays memory status for the selected project during app initialization
17
+ - Provider settings UI no longer autosaves on credential mode change, preventing incomplete data saves
18
+ - Daemon session loading no longer requires a runtime; sessions can be attached without provider API keys configured
19
+
20
+ ### Fixes
21
+
22
+ - Fixed GUI not loading memory status for the selected project on session preload
23
+ - Fixed provider attach failure when provider config is incomplete (e.g., missing API key)
24
+
25
+ ### Verification
26
+
27
+ - Tests cover `scorel run` prompt sources, output formats, summary, timeout exit code, and provider overrides
28
+ - Unit test confirms memory status is fetched for correct project on app mount
29
+ - Tests verify sessions can be loaded and messages sent even when provider credentials are missing
30
+
5
31
  ## 0.0.7 - 2026-06-24
6
32
 
7
33
  ### Highlights
package/docs/ROADMAP.md CHANGED
@@ -785,6 +785,7 @@ HTTP adapter 必须映射已有 Host use cases,不复制领域逻辑。
785
785
  | [`S0106`](spec/ship/S0106-snip-context-control.md) | Snip context control | Done |
786
786
  | [`S0107`](spec/ship/S0107-system-reminder-unification.md) | System reminder unification | Done |
787
787
  | [`S0108`](spec/ship/S0108-gui-bundled-cli-runtime.md) | GUI bundled CLI runtime | Done |
788
+ | [`S0109`](spec/ship/S0109-scorel-run-headless-task-runner.md) | `scorel run` headless task runner | Active |
788
789
 
789
790
  ---
790
791
 
@@ -0,0 +1,172 @@
1
+ # S0109: Scorel Run Headless Task Runner
2
+
3
+ ## Goal
4
+
5
+ Add a non-interactive `scorel run` command for one-shot agent tasks, matching the headless shape of tools such as `claude -p` and `codex exec`.
6
+
7
+ The command must run through Scorel's existing embedded Host, daemon/client, runtime, tool, project registry, and JSONL session path. It must be usable by external harnesses such as Harbor / Terminal-Bench without entering the interactive `scorel chat` REPL.
8
+
9
+ ## Scope
10
+
11
+ - Add `scorel run [prompt]`.
12
+ - Add prompt input forms:
13
+ - positional prompt
14
+ - `--prompt <text>`
15
+ - `--prompt-file <path>`
16
+ - `--stdin`
17
+ - Add execution options:
18
+ - `--cwd <dir>`
19
+ - `--state-dir <dir>`
20
+ - `--sessions-dir <dir>`
21
+ - `--session <id>`
22
+ - `--timeout-ms <ms>`
23
+ - `--output-format text|json|stream-json|none`
24
+ - `--summary <path>`
25
+ - `--quiet`
26
+ - `--model <role-or-id>`
27
+ - `--provider <name>`
28
+ - `--api <openai-completions|openai-responses|google-generative-ai|anthropic-messages>` / `--protocol <...>`
29
+ - `--base-url <url>` / `--baseurl <url>`
30
+ - `--api-key <key>` / `--apikey <key>`
31
+ - Reuse the same product path as `scorel chat`: embedded `ScorelHost`, `DaemonClient`, project registration, real runtime, and append-only session JSONL.
32
+ - Return only after the submitted user turn finishes, errors, or times out.
33
+ - Write an optional summary JSON containing status, session id, project id, cwd, state/sessions paths, session JSONL path, elapsed time, output format, and error details.
34
+
35
+ ## Product Boundary
36
+
37
+ This spec targets the minimum complete command contract needed for Terminal-Bench / Harbor installed-agent integration. The command must be stable enough for an external harness to:
38
+
39
+ 1. provide one task instruction;
40
+ 2. run Scorel in a specific task workspace;
41
+ 3. isolate state and session artifacts per trial;
42
+ 4. pin provider protocol, base URL, API key, and model from the harness;
43
+ 5. wait for one agent turn to finish or time out;
44
+ 6. read deterministic summary/session artifacts without parsing human-oriented stdout.
45
+
46
+ This is intentionally narrower than the full non-interactive command surface exposed by mature coding agents such as Claude Code `-p` or Codex `exec`.
47
+
48
+ Current required parity:
49
+
50
+ - one-shot prompt execution;
51
+ - workspace selection;
52
+ - model/provider selection;
53
+ - output format selection;
54
+ - timeout;
55
+ - stable exit codes;
56
+ - session artifact persistence;
57
+ - machine-readable summary file.
58
+
59
+ Known gaps versus Claude Code / Codex that are not required for this first Terminal-Bench integration:
60
+
61
+ - explicit permission modes and tool allow/deny lists;
62
+ - sandbox / approval policy flags;
63
+ - system prompt and append-system-prompt overrides;
64
+ - structured input protocol beyond plain prompt/stdin;
65
+ - budget and cost limits;
66
+ - MCP config injection;
67
+ - debug file / verbose diagnostic switches;
68
+ - partial-message streaming controls;
69
+ - tool-set selection;
70
+ - no-persistence mode;
71
+ - full resume/continue UX beyond explicit `--session` load-or-create behavior.
72
+
73
+ These gaps should be prioritized from real Terminal-Bench failure evidence, not copied wholesale from other CLIs.
74
+
75
+ ## Command Contract
76
+
77
+ Examples:
78
+
79
+ ```bash
80
+ scorel run "Fix the failing test and run the relevant verification command."
81
+ scorel run --prompt "Summarize this project" --output-format json
82
+ scorel run --prompt-file /tmp/instruction.txt --cwd /workspace --state-dir /tmp/scorel-state --summary /logs/agent/scorel-summary.json --output-format none
83
+ scorel run --prompt-file /tmp/instruction.txt --api openai-completions --base-url https://api.example.test/v1 --api-key "$API_KEY" --model gpt-5.4-mini
84
+ cat instruction.txt | scorel run --stdin --output-format stream-json
85
+ ```
86
+
87
+ Prompt precedence is strict:
88
+
89
+ 1. positional prompt
90
+ 2. `--prompt`
91
+ 3. `--prompt-file`
92
+ 4. `--stdin`
93
+
94
+ Exactly one prompt source is allowed.
95
+
96
+ Exit codes:
97
+
98
+ - `0`: run completed.
99
+ - `1`: runtime / provider / agent error.
100
+ - `2`: command usage or configuration error.
101
+ - `124`: timeout.
102
+
103
+ Output formats:
104
+
105
+ - `text`: stream assistant text deltas and tool summaries, like a compact non-interactive `scorel chat`.
106
+ - `json`: print one final JSON object.
107
+ - `stream-json`: print newline-delimited JSON events for live deltas and final status.
108
+ - `none`: print no stdout except unexpected lower-level output; intended for benchmark harnesses that use files and container state.
109
+
110
+ ## Not In Scope
111
+
112
+ - Harbor agent adapter.
113
+ - Terminal-Bench dataset or leaderboard submission.
114
+ - ATIF trajectory export.
115
+ - Background Bash / long-running command lifecycle.
116
+ - Permission sandbox policy.
117
+ - Resuming previous headless runs beyond explicit `--session` load-or-create behavior.
118
+ - Replacing `scorel chat`.
119
+
120
+ ## Acceptance Criteria
121
+
122
+ - `scorel run --prompt ...` creates or resumes a session and submits exactly one user message.
123
+ - `scorel run --base-url ... --api-key ... --api ... --model ...` uses a run-local provider config without writing Scorel config files.
124
+ - The command exits after `DaemonClient.sendMessage()` resolves.
125
+ - `--cwd` controls the registered project workdir and runtime tool cwd.
126
+ - `--state-dir` isolates project registry and Scorel home.
127
+ - `--sessions-dir` controls where `{sessionId}.jsonl` is written.
128
+ - `--summary` writes deterministic JSON on success, runtime error, and timeout.
129
+ - `--output-format none` produces no normal stdout on success.
130
+ - `--output-format json` produces parseable final JSON.
131
+ - `--output-format stream-json` emits parseable JSONL progress/final events.
132
+ - Timeout returns exit code `124` and best-effort cancels the active session.
133
+ - Usage errors return exit code `2` and print a concise error.
134
+
135
+ ## Testing
136
+
137
+ - Extend `apps/cli/src/index.test.ts`.
138
+ - Add focused tests for:
139
+ - prompt via `--prompt`.
140
+ - prompt file.
141
+ - stdin prompt.
142
+ - output format `none`.
143
+ - output format `json`.
144
+ - summary file content and session JSONL path.
145
+ - prompt source conflict.
146
+ - timeout exit code and summary.
147
+
148
+ Run:
149
+
150
+ ```bash
151
+ pnpm --filter @scorel/app-cli test -- index
152
+ pnpm --filter @scorel/app-cli typecheck
153
+ ```
154
+
155
+ Before completion, run the repository check:
156
+
157
+ ```bash
158
+ pnpm typecheck && pnpm test
159
+ ```
160
+
161
+ ## Affected Paths
162
+
163
+ - `apps/cli/src/index.ts`
164
+ - `apps/cli/src/index.test.ts`
165
+ - `docs/ROADMAP.md`
166
+ - `docs/spec/ship/S0109-scorel-run-headless-task-runner.md`
167
+
168
+ ## Risks
169
+
170
+ - Treating `scorel run` as a wrapper around REPL stdin would make completion unreliable. It must call the daemon/client request path directly.
171
+ - Parsing stdout in external harnesses would be fragile. Summary JSON and session JSONL are the durable artifacts.
172
+ - `--state-dir` and `--sessions-dir` must remain explicit to support one-task-per-container benchmark isolation.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@chanlerdev/scorel",
3
- "version": "0.0.7",
3
+ "version": "0.0.8",
4
4
  "description": "Replayable, recoverable, remotely controllable AI Agent workspace.",
5
5
  "type": "module",
6
6
  "packageManager": "pnpm@11.1.2",