litclaude-ai 0.3.15 → 0.3.17
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/CHANGELOG.md +11 -0
- package/README.md +21 -7
- package/README_ko-KR.md +20 -6
- package/RELEASE_CHECKLIST.md +14 -13
- package/docs/hooks.md +5 -0
- package/package.json +1 -1
- package/plugins/litclaude/.claude-plugin/plugin.json +1 -1
- package/plugins/litclaude/bin/litclaude-mcp.js +1 -1
- package/plugins/litclaude/lib/hud-accent-palette.mjs +3 -0
- package/plugins/litclaude/lib/litgoal/cli.mjs +6 -1
- package/plugins/litclaude/lib/litgoal/native-worker.mjs +102 -0
- package/plugins/litclaude/skills/litgoal/SKILL.md +14 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.3.17 - 2026-07-01 — native `/goal` worker launcher
|
|
4
|
+
|
|
5
|
+
- Add `litgoal native-worker` as a dry-run-first launcher for a separate Claude Code print/background worker whose first prompt is `/goal <condition>`.
|
|
6
|
+
- Require explicit `--execute` before spawning `claude`, reject malformed or secret-like conditions, avoid shell interpolation, and propagate child worker failures.
|
|
7
|
+
- Document the capability boundary clearly: this does not arm an already-open TUI, does not inject tmux keystrokes, and does not mutate private transcript metadata.
|
|
8
|
+
|
|
9
|
+
## 0.3.16 - 2026-06-27 — WSL2 HUD gradient hotfix
|
|
10
|
+
|
|
11
|
+
- Restore truecolor neon gradient rendering for WSL2/Windows Terminal status lines when Claude Code drops `WT_SESSION` before invoking the HUD command.
|
|
12
|
+
- Keep the 256-color bright-magenta fallback for terminals without truecolor signals.
|
|
13
|
+
|
|
3
14
|
## 0.3.15 - 2026-06-26 — Korean AI-slop remover workflow
|
|
4
15
|
|
|
5
16
|
- Add `/korean-ai-slop-remover` as a Claude Code-native Korean prose polishing command with strict multi-agent routing from day one.
|
package/README.md
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
</p>
|
|
10
10
|
<p align="center">
|
|
11
11
|
<img src="https://img.shields.io/badge/npm-litclaude--ai-cb3837" />
|
|
12
|
-
<img src="https://img.shields.io/badge/version-0.3.
|
|
12
|
+
<img src="https://img.shields.io/badge/version-0.3.17-2ea44f" />
|
|
13
13
|
<img src="https://img.shields.io/badge/Claude%20Code-plugin-blueviolet" />
|
|
14
14
|
<img src="https://img.shields.io/badge/license-MIT-blue" />
|
|
15
15
|
</p>
|
|
@@ -22,12 +22,14 @@
|
|
|
22
22
|
> `litclaude@litclaude-ai`, so normal `claude` launches can load the
|
|
23
23
|
> LitClaude skills and hooks without a long `--plugin-dir` command.
|
|
24
24
|
|
|
25
|
-
This checkout is prepared as `litclaude-ai@0.3.
|
|
25
|
+
This checkout is prepared as `litclaude-ai@0.3.17` for personal install
|
|
26
26
|
convenience. The repo can remain quiet; preparing npm package metadata here does
|
|
27
27
|
not imply public repo promotion, marketplace publication, or advertisement.
|
|
28
|
-
Future package releases still require explicit user approval. The v0.3.
|
|
29
|
-
release materials
|
|
30
|
-
|
|
28
|
+
Future package releases still require explicit user approval. The v0.3.17
|
|
29
|
+
release materials add the separate-worker native `/goal` launcher while
|
|
30
|
+
preserving the v0.3.15 Korean AI slop remover workflow, the v0.3.16
|
|
31
|
+
WSL2/Windows Terminal truecolor HUD gradient fix, the v0.3.13 public-source
|
|
32
|
+
reader runtime, litresearch activation/read-only polish, and installer
|
|
31
33
|
permission-preference discipline.
|
|
32
34
|
|
|
33
35
|
## Features
|
|
@@ -110,7 +112,7 @@ directory, the normal install command works:
|
|
|
110
112
|
|
|
111
113
|
```bash
|
|
112
114
|
cd /tmp
|
|
113
|
-
npx --yes litclaude-ai@0.3.
|
|
115
|
+
npx --yes litclaude-ai@0.3.17 install
|
|
114
116
|
```
|
|
115
117
|
|
|
116
118
|
Validate the installed plugin:
|
|
@@ -123,7 +125,7 @@ The installer also sets Claude Code's `statusLine` command to the packaged
|
|
|
123
125
|
LitClaude HUD. A typical no-color render starts like:
|
|
124
126
|
|
|
125
127
|
```text
|
|
126
|
-
[🔥LITCLAUDE v0.3.
|
|
128
|
+
[🔥LITCLAUDE v0.3.17] | O4.8 │ ctx [▎░░] 9%/1000k │ 5h [▏░] 4% ↻2h15m │ 1w [▊░] 35% ↻3d6h │ git main +3 ✓
|
|
127
129
|
```
|
|
128
130
|
|
|
129
131
|
The `↻` suffix is a compact rate-limit reset countdown. It is separated from
|
|
@@ -256,6 +258,17 @@ explicit `BLOCKED:` degraded-mode note instead of claiming success. In degraded
|
|
|
256
258
|
mode, LitClaude keeps the durable `litgoal` ledger authoritative and may suggest
|
|
257
259
|
one exact `/goal <completion condition>` or `claude -p "/goal <completion
|
|
258
260
|
condition>"` for the native user surface.
|
|
261
|
+
When you explicitly want a separate native `/goal` worker instead of binding the
|
|
262
|
+
current TUI session, use the dry-run-first launcher:
|
|
263
|
+
|
|
264
|
+
```bash
|
|
265
|
+
litclaude litgoal native-worker --condition "<completion condition>" --json
|
|
266
|
+
litclaude litgoal native-worker --condition "<completion condition>" --mode bg --name litgoal-worker --execute --json
|
|
267
|
+
```
|
|
268
|
+
|
|
269
|
+
`native-worker` starts a separate print/background Claude Code worker whose first
|
|
270
|
+
prompt begins with `/goal`; it does not arm the already-open TUI, does not use
|
|
271
|
+
tmux keystroke injection, and does not mutate private transcript metadata.
|
|
259
272
|
For large independent work, LitClaude applies the same principle to Claude
|
|
260
273
|
Code's available orchestration surfaces: `lit workflow`, `lit dynamic workflow`,
|
|
261
274
|
and `lit ultracode` prefer current `ultracode` or explicit “run a workflow” /
|
|
@@ -344,6 +357,7 @@ litclaude litgoal create-goals --brief "<brief>" --json
|
|
|
344
357
|
litclaude litgoal record-evidence --criterion <id> --status pass --json '{"artifact":"...","cleanup":"..."}'
|
|
345
358
|
litclaude litgoal checkpoint --status active --note "<progress>" --json
|
|
346
359
|
litclaude litgoal steer --kind scope --note "<what changed and why>" --json
|
|
360
|
+
litclaude litgoal native-worker --condition "<native worker goal>" --json
|
|
347
361
|
```
|
|
348
362
|
|
|
349
363
|
`record-review-blockers` captures unresolved review findings. Malformed JSON,
|
package/README_ko-KR.md
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
</p>
|
|
10
10
|
<p align="center">
|
|
11
11
|
<img src="https://img.shields.io/badge/npm-litclaude--ai-cb3837" />
|
|
12
|
-
<img src="https://img.shields.io/badge/version-0.3.
|
|
12
|
+
<img src="https://img.shields.io/badge/version-0.3.17-2ea44f" />
|
|
13
13
|
<img src="https://img.shields.io/badge/Claude%20Code-plugin-blueviolet" />
|
|
14
14
|
<img src="https://img.shields.io/badge/license-MIT-blue" />
|
|
15
15
|
</p>
|
|
@@ -26,12 +26,14 @@
|
|
|
26
26
|
> 설치되므로, 매번 긴 `--plugin-dir` 없이 일반 `claude` 실행에서
|
|
27
27
|
> LitClaude skill과 hook을 불러올 수 있습니다.
|
|
28
28
|
|
|
29
|
-
현재 checkout은 `litclaude-ai@0.3.
|
|
29
|
+
현재 checkout은 `litclaude-ai@0.3.17` 배포 준비용으로 정리되어 있습니다. 목적은
|
|
30
30
|
다른 PC에서도 빠르게 설치하기 위한 개인용 package metadata를 갖추는 것입니다.
|
|
31
31
|
npm package metadata를 준비했다고 해서 홍보, 공개 저장소 운영, Claude
|
|
32
32
|
marketplace 등록을 의미하지는 않습니다. 새 버전 배포는 항상 별도의 명시적
|
|
33
|
-
승인 후에 진행합니다. v0.3.
|
|
34
|
-
|
|
33
|
+
승인 후에 진행합니다. v0.3.17 release material은 별도 worker 기반 native
|
|
34
|
+
`/goal` launcher를 추가하면서, v0.3.15 Korean AI slop remover workflow와
|
|
35
|
+
v0.3.16 WSL2/Windows Terminal truecolor HUD gradient fix, v0.3.13
|
|
36
|
+
public-source reader runtime, litresearch activation/read-only polish를 유지합니다.
|
|
35
37
|
|
|
36
38
|
## 기능
|
|
37
39
|
|
|
@@ -112,7 +114,7 @@ checkout을 먼저 해석해서 `sh: litclaude-ai: command not found`로 실패
|
|
|
112
114
|
|
|
113
115
|
```bash
|
|
114
116
|
cd /tmp
|
|
115
|
-
npx --yes litclaude-ai@0.3.
|
|
117
|
+
npx --yes litclaude-ai@0.3.17 install
|
|
116
118
|
```
|
|
117
119
|
|
|
118
120
|
설치 상태를 확인합니다.
|
|
@@ -125,7 +127,7 @@ installer는 Claude Code의 `statusLine` command도 packaged LitClaude HUD로
|
|
|
125
127
|
설정합니다. 색상을 제거한 예시는 다음처럼 시작합니다.
|
|
126
128
|
|
|
127
129
|
```text
|
|
128
|
-
[🔥LITCLAUDE v0.3.
|
|
130
|
+
[🔥LITCLAUDE v0.3.17] | O4.8 │ ctx [▎░░] 9%/1000k │ 5h [▏░] 4% ↻2h15m │ 1w [▊░] 35% ↻3d6h │ git main +3 ✓
|
|
129
131
|
```
|
|
130
132
|
|
|
131
133
|
`↻` 표시는 rate-limit reset까지 남은 시간을 짧게 보여주는 countdown입니다.
|
|
@@ -249,6 +251,17 @@ goal이 없을 때만 `create_goal`을 호출하며, `update_goal`은 검증 완
|
|
|
249
251
|
로컬 evidence ledger를 기준으로 계속 진행하고, 긴 실행 전에 필요한 경우에만
|
|
250
252
|
정확한 `/goal <completion condition>`를 제안합니다. 큰 독립 작업에서는
|
|
251
253
|
같은 원칙을 Claude Code가 노출한 orchestration surface에 적용합니다.
|
|
254
|
+
현재 TUI session을 바인딩하는 대신 별도 native `/goal` worker를 명시적으로
|
|
255
|
+
실행하고 싶다면 dry-run-first launcher를 사용합니다.
|
|
256
|
+
|
|
257
|
+
```bash
|
|
258
|
+
litclaude litgoal native-worker --condition "<completion condition>" --json
|
|
259
|
+
litclaude litgoal native-worker --condition "<completion condition>" --mode bg --name litgoal-worker --execute --json
|
|
260
|
+
```
|
|
261
|
+
|
|
262
|
+
`native-worker`는 첫 prompt가 `/goal`로 시작하는 별도 print/background Claude
|
|
263
|
+
Code worker를 시작합니다. 이미 열린 TUI를 arm하지 않고, tmux keystroke
|
|
264
|
+
injection이나 private transcript metadata 변경도 사용하지 않습니다.
|
|
252
265
|
`Workflow`가 노출되면 먼저 제안하고 사용자 opt-in 또는 이미 허용된 orchestration
|
|
253
266
|
상태에서만 `Workflow` tool을 호출합니다. isolated edit lane이 model-facing
|
|
254
267
|
worktree를 필요로 하면 `EnterWorktree`를 사용합니다. CLI surface만 가능한 새 격리
|
|
@@ -321,6 +334,7 @@ litclaude litgoal create-goals --brief "<brief>" --json
|
|
|
321
334
|
litclaude litgoal record-evidence --criterion <id> --status pass --json '{"artifact":"...","cleanup":"..."}'
|
|
322
335
|
litclaude litgoal checkpoint --status active --note "<progress>" --json
|
|
323
336
|
litclaude litgoal steer --kind scope --note "<what changed and why>" --json
|
|
337
|
+
litclaude litgoal native-worker --condition "<native worker goal>" --json
|
|
324
338
|
```
|
|
325
339
|
|
|
326
340
|
`record-review-blockers`는 해결되지 않은 review finding을 기록합니다.
|
package/RELEASE_CHECKLIST.md
CHANGED
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
# LitClaude Release Checklist
|
|
2
2
|
|
|
3
|
-
Status: `litclaude-ai@0.3.
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
public-source
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
`
|
|
12
|
-
plugin
|
|
3
|
+
Status: `litclaude-ai@0.3.17` is the current release candidate — a dry-run-first
|
|
4
|
+
native `/goal` worker launcher on top of the WSL2 HUD gradient hotfix, Korean
|
|
5
|
+
AI-slop removal workflow release, litresearch activation and usability polish
|
|
6
|
+
track, JS-only public-source reader runtime, resilient public-source research
|
|
7
|
+
pass, and Claude-native goal/workflow/team route hardening. It starts only a
|
|
8
|
+
separate Claude Code print/background worker, while preserving the Korean
|
|
9
|
+
polishing command, strict multi-agent review pipeline, fidelity guardrails,
|
|
10
|
+
package hygiene checks, native route gates, and safe start-work handoff behavior.
|
|
11
|
+
`package.json` is aligned to `0.3.17`,
|
|
12
|
+
`plugins/litclaude/.claude-plugin/plugin.json` is aligned to `0.3.17`, and the
|
|
13
|
+
plugin-local MCP server reports `0.3.17`.
|
|
13
14
|
|
|
14
15
|
This release carries the v0.2.2 Dynamic workflow hardening surfaces:
|
|
15
16
|
`/dynamic-workflow`, `workflow-check --json`, native `/goal` fallback guidance,
|
|
@@ -58,9 +59,9 @@ No npm publication is required for this track.
|
|
|
58
59
|
Before requesting publication approval, confirm these artifacts from the current
|
|
59
60
|
checkout:
|
|
60
61
|
|
|
61
|
-
- `package.json` version is `0.3.
|
|
62
|
-
- `plugins/litclaude/.claude-plugin/plugin.json` version is `0.3.
|
|
63
|
-
- `plugins/litclaude/bin/litclaude-mcp.js` reports server version `0.3.
|
|
62
|
+
- `package.json` version is `0.3.17`.
|
|
63
|
+
- `plugins/litclaude/.claude-plugin/plugin.json` version is `0.3.17`.
|
|
64
|
+
- `plugins/litclaude/bin/litclaude-mcp.js` reports server version `0.3.17`.
|
|
64
65
|
- `lit search` and `lit query` route to `/litclaude:litresearch` without activating on slash mentions, code spans, or non-lit prompts.
|
|
65
66
|
- Litresearch web lanes require public API/feed preference, validator-first checks, route traces, prompt-injection quarantine, and honest auth/paywall/private-data stop reasons.
|
|
66
67
|
- `node bin/litclaude-ai.js public-read <public-url> --json` exposes the guarded JS runtime reader.
|
package/docs/hooks.md
CHANGED
|
@@ -66,6 +66,11 @@ Claude Code session, the hook returns explicit `BLOCKED:` / degraded-mode
|
|
|
66
66
|
guidance, does not claim native goal success, keeps the local `litgoal` evidence
|
|
67
67
|
ledger authoritative, and may suggest `/goal <completion condition>` or
|
|
68
68
|
`claude -p "/goal <completion condition>"` for the native user surface.
|
|
69
|
+
For a separate worker session, `litclaude-ai litgoal native-worker --condition
|
|
70
|
+
"<completion condition>"` builds a dry-run native `/goal` worker command; adding
|
|
71
|
+
`--execute` starts a print/background Claude Code worker whose first prompt begins
|
|
72
|
+
with `/goal`. This worker launcher is not current-TUI auto-arm and must not be
|
|
73
|
+
described as hook-driven slash-command dispatch.
|
|
69
74
|
|
|
70
75
|
For broad work, the same context ports the LitClaude model-facing principle to
|
|
71
76
|
Claude Code's exposed orchestration surfaces: `lit workflow`, `lit dynamic
|
package/package.json
CHANGED
|
@@ -41,6 +41,9 @@ export const supportsTruecolor = (env = process.env) => {
|
|
|
41
41
|
// COLORTERM into the shell — it advertises itself via WT_SESSION instead.
|
|
42
42
|
// Without this, WSL2 users get the 256-color magenta fallback by mistake.
|
|
43
43
|
if (env.WT_SESSION) return true;
|
|
44
|
+
// Claude Code may sanitize WT_SESSION before invoking statusLine commands,
|
|
45
|
+
// while keeping WSL markers. Preserve the Windows Terminal/WSL2 gradient path.
|
|
46
|
+
if (env.WSL_DISTRO_NAME || env.WSL_INTEROP) return true;
|
|
44
47
|
// 24-bit terminal emulators that may not set COLORTERM in every shell.
|
|
45
48
|
if (/\b(?:vscode|hyper|wezterm|ghostty|iterm\.app)\b/iu.test(String(env.TERM_PROGRAM || ""))) return true;
|
|
46
49
|
// terminfo direct-color / truecolor entries (e.g. xterm-direct, *-truecolor).
|
|
@@ -9,6 +9,7 @@ import {
|
|
|
9
9
|
} from "./paths.mjs";
|
|
10
10
|
import { readLitgoalState, LitgoalStateError, withLitgoalLock, writeLitgoalState } from "./state.mjs";
|
|
11
11
|
import { resetAutoloopState } from "./autoloop.mjs";
|
|
12
|
+
import { NativeWorkerError, runNativeWorker } from "./native-worker.mjs";
|
|
12
13
|
|
|
13
14
|
const subcommands = [
|
|
14
15
|
["create-goals", "Create durable goal records from a brief."],
|
|
@@ -18,6 +19,7 @@ const subcommands = [
|
|
|
18
19
|
["checkpoint", "Write a continuation checkpoint."],
|
|
19
20
|
["steer", "Record a steering decision."],
|
|
20
21
|
["record-review-blockers", "Record review blockers."],
|
|
22
|
+
["native-worker", "Launch a separate native /goal worker (dry-run by default)."],
|
|
21
23
|
];
|
|
22
24
|
|
|
23
25
|
const helpText = `Usage: litclaude-ai litgoal <command> [...args]
|
|
@@ -240,6 +242,8 @@ const runCommand = (cwd, command, args) => {
|
|
|
240
242
|
return steer(cwd, args);
|
|
241
243
|
case "record-review-blockers":
|
|
242
244
|
return recordReviewBlockers(cwd, args);
|
|
245
|
+
case "native-worker":
|
|
246
|
+
return runNativeWorker(args, { cwd });
|
|
243
247
|
default:
|
|
244
248
|
throw new LitgoalCliError(`Unknown litgoal command: ${command}`);
|
|
245
249
|
}
|
|
@@ -262,9 +266,10 @@ export const runLitgoalCli = (argv, io = { stdout: process.stdout, stderr: proce
|
|
|
262
266
|
const outputJson = hasFlag(rest, "--json");
|
|
263
267
|
const result = runCommand(cwd, command, rest);
|
|
264
268
|
emit(io, result, outputJson);
|
|
269
|
+
if (result?.status === "failed") return result.exitCode || 1;
|
|
265
270
|
return 0;
|
|
266
271
|
} catch (error) {
|
|
267
|
-
if (error instanceof LitgoalCliError || error instanceof LitgoalStateError) {
|
|
272
|
+
if (error instanceof LitgoalCliError || error instanceof LitgoalStateError || error instanceof NativeWorkerError) {
|
|
268
273
|
io.stderr.write(`${error.message}\n`);
|
|
269
274
|
return error.status;
|
|
270
275
|
}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { spawnSync } from "node:child_process";
|
|
2
|
+
|
|
3
|
+
const secretPatterns = [
|
|
4
|
+
/sk-[A-Za-z0-9_-]{20,}/u,
|
|
5
|
+
/(?:api[_-]?key|token|secret|password)\s*=\s*\S+/iu,
|
|
6
|
+
];
|
|
7
|
+
|
|
8
|
+
const allowedModes = new Set(["print", "bg"]);
|
|
9
|
+
|
|
10
|
+
export class NativeWorkerError extends Error {
|
|
11
|
+
constructor(message, status = 64) {
|
|
12
|
+
super(message);
|
|
13
|
+
this.name = "NativeWorkerError";
|
|
14
|
+
this.status = status;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
const hasFlag = (args, flag) => args.includes(flag);
|
|
19
|
+
|
|
20
|
+
const optionValue = (args, flag) => {
|
|
21
|
+
const index = args.indexOf(flag);
|
|
22
|
+
if (index === -1) return undefined;
|
|
23
|
+
const value = args[index + 1];
|
|
24
|
+
if (!value || value.startsWith("--")) return "";
|
|
25
|
+
return value;
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
const normalizeSpaces = (value) => value.replace(/\s+/gu, " ").trim();
|
|
29
|
+
|
|
30
|
+
export const normalizeNativeWorkerCondition = (value) => {
|
|
31
|
+
if (typeof value !== "string") return "";
|
|
32
|
+
return normalizeSpaces(value);
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
export const validateNativeWorkerCondition = (condition) => {
|
|
36
|
+
if (typeof condition !== "string" || condition.trim() === "") {
|
|
37
|
+
throw new NativeWorkerError("missing condition");
|
|
38
|
+
}
|
|
39
|
+
if (/[\r\n]/u.test(condition)) {
|
|
40
|
+
throw new NativeWorkerError("condition must be a single line");
|
|
41
|
+
}
|
|
42
|
+
const normalized = normalizeNativeWorkerCondition(condition);
|
|
43
|
+
if (!normalized) throw new NativeWorkerError("missing condition");
|
|
44
|
+
if (normalized.startsWith("/")) {
|
|
45
|
+
throw new NativeWorkerError("condition must not start with a slash command");
|
|
46
|
+
}
|
|
47
|
+
if (secretPatterns.some((pattern) => pattern.test(normalized))) {
|
|
48
|
+
throw new NativeWorkerError("condition contains secret-like material");
|
|
49
|
+
}
|
|
50
|
+
return normalized;
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
export const buildNativeWorkerCommand = (args) => {
|
|
54
|
+
const condition = validateNativeWorkerCondition(optionValue(args, "--condition") ?? "");
|
|
55
|
+
const mode = optionValue(args, "--mode") || "print";
|
|
56
|
+
if (!allowedModes.has(mode)) {
|
|
57
|
+
throw new NativeWorkerError("--mode must be one of print, bg");
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
const goalPrompt = `/goal ${condition}`;
|
|
61
|
+
const commandArgs = mode === "bg"
|
|
62
|
+
? ["--bg", "--name", optionValue(args, "--name") || "", goalPrompt]
|
|
63
|
+
: ["-p", goalPrompt];
|
|
64
|
+
|
|
65
|
+
if (mode === "bg" && !commandArgs[2]) {
|
|
66
|
+
throw new NativeWorkerError("--name is required for --mode bg");
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
return {
|
|
70
|
+
status: hasFlag(args, "--execute") ? "ready" : "dry-run",
|
|
71
|
+
mode,
|
|
72
|
+
command: "claude",
|
|
73
|
+
args: commandArgs,
|
|
74
|
+
prompt: goalPrompt,
|
|
75
|
+
message: hasFlag(args, "--execute")
|
|
76
|
+
? `Native /goal worker ready (${mode}).`
|
|
77
|
+
: `DRY_RUN: would launch native /goal worker (${mode}).`,
|
|
78
|
+
};
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
export const runNativeWorker = (args, { cwd = process.cwd(), env = process.env } = {}) => {
|
|
82
|
+
const plan = buildNativeWorkerCommand(args);
|
|
83
|
+
if (!hasFlag(args, "--execute")) return plan;
|
|
84
|
+
|
|
85
|
+
const child = spawnSync(plan.command, plan.args, {
|
|
86
|
+
cwd,
|
|
87
|
+
env,
|
|
88
|
+
encoding: "utf8",
|
|
89
|
+
});
|
|
90
|
+
|
|
91
|
+
return {
|
|
92
|
+
...plan,
|
|
93
|
+
status: child.status === 0 ? "executed" : "failed",
|
|
94
|
+
exitCode: child.status,
|
|
95
|
+
signal: child.signal,
|
|
96
|
+
stdout: child.stdout ?? "",
|
|
97
|
+
stderr: child.stderr ?? (child.error ? String(child.error) : ""),
|
|
98
|
+
message: child.status === 0
|
|
99
|
+
? `Native /goal worker launched (${plan.mode}).`
|
|
100
|
+
: `Native /goal worker failed (${plan.mode}).`,
|
|
101
|
+
};
|
|
102
|
+
};
|
|
@@ -71,6 +71,20 @@ record in the local litgoal ledger. Never auto-type `/goal`, never claim
|
|
|
71
71
|
slash-command activation without evidence, and never mark a goal complete until
|
|
72
72
|
the local litgoal criteria have passed.
|
|
73
73
|
|
|
74
|
+
When the user explicitly wants a separate native `/goal` worker rather than the
|
|
75
|
+
current TUI session, use the package CLI launcher. It is dry-run by default:
|
|
76
|
+
|
|
77
|
+
```sh
|
|
78
|
+
litclaude-ai litgoal native-worker --condition "<completion condition>" --json
|
|
79
|
+
litclaude-ai litgoal native-worker --condition "<completion condition>" --mode bg --name litgoal-worker --execute --json
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
This starts a separate print/background Claude Code worker whose first prompt
|
|
83
|
+
begins with `/goal`. It does not arm the already-open TUI, does not rely on hook
|
|
84
|
+
slash-command dispatch, does not use tmux keystroke injection, and does not edit
|
|
85
|
+
private transcript metadata. Use worker stdout, `claude agents`, or worker logs as
|
|
86
|
+
the evidence surface for that separate run.
|
|
87
|
+
|
|
74
88
|
Forward-compat rule: if a future Claude Code build exposes model-facing goal
|
|
75
89
|
tools, use them according to the no-clobber sequence above. Otherwise, the
|
|
76
90
|
degraded-mode `/goal` proposal plus durable ledger is the honest mechanism.
|