@litfamily/litcodex 1.0.31 → 1.0.32
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/README-Ko-KR.md +11 -10
- package/README.md +11 -10
- package/TRADEMARK.md +12 -0
- package/marketplace/plugins/litcodex/.codex-plugin/plugin.json +1 -1
- package/marketplace/plugins/litcodex/components/auto-update/package.json +1 -1
- package/marketplace/plugins/litcodex/components/comment-checker/package.json +1 -1
- package/marketplace/plugins/litcodex/components/git-bash/package.json +1 -1
- package/marketplace/plugins/litcodex/components/lit-loop/directives/lit-adhd.md +12 -9
- package/marketplace/plugins/litcodex/components/lit-loop/directives/lit-plan.md +2 -1
- package/marketplace/plugins/litcodex/components/lit-loop/dist/card-status.d.ts +3 -0
- package/marketplace/plugins/litcodex/components/lit-loop/dist/card-status.js +4 -1
- package/marketplace/plugins/litcodex/components/lit-loop/dist/hook-cli.js +8 -2
- package/marketplace/plugins/litcodex/components/lit-loop/dist/plan-persistence.d.ts +1 -1
- package/marketplace/plugins/litcodex/components/lit-loop/dist/plan-persistence.js +28 -2
- package/marketplace/plugins/litcodex/components/lit-loop/dist/plan-scope-roots.d.ts +7 -0
- package/marketplace/plugins/litcodex/components/lit-loop/dist/plan-scope-roots.js +76 -0
- package/marketplace/plugins/litcodex/components/lit-loop/dist/restart-chip.d.ts +6 -0
- package/marketplace/plugins/litcodex/components/lit-loop/dist/restart-chip.js +59 -0
- package/marketplace/plugins/litcodex/components/lit-loop/dist/rewind-go.js +11 -1
- package/marketplace/plugins/litcodex/components/lit-loop/dist/rewind.d.ts +13 -7
- package/marketplace/plugins/litcodex/components/lit-loop/dist/rewind.js +143 -49
- package/marketplace/plugins/litcodex/components/lit-loop/dist/route-heads.js +1 -1
- package/marketplace/plugins/litcodex/components/lit-loop/dist/session-liveness.d.ts +16 -0
- package/marketplace/plugins/litcodex/components/lit-loop/dist/session-liveness.js +90 -0
- package/marketplace/plugins/litcodex/components/lit-loop/dist/threads.js +7 -2
- package/marketplace/plugins/litcodex/components/lit-loop/dist/workflow-stack.d.ts +9 -2
- package/marketplace/plugins/litcodex/components/lit-loop/dist/workflow-stack.js +35 -5
- package/marketplace/plugins/litcodex/components/lit-loop/package.json +1 -1
- package/marketplace/plugins/litcodex/components/lsp/package.json +1 -1
- package/marketplace/plugins/litcodex/components/rules/package.json +1 -1
- package/marketplace/plugins/litcodex/components/start-work-continuation/package.json +1 -1
- package/marketplace/plugins/litcodex/components/telemetry/package.json +1 -1
- package/marketplace/plugins/litcodex/components/wikify-knowledge/package.json +1 -1
- package/marketplace/plugins/litcodex/skills/lit-adhd/SKILL.md +15 -11
- package/marketplace/plugins/litcodex/skills/lit-adhd/references/card-examples.md +23 -7
- package/marketplace/plugins/litcodex/skills/lit-adhd/references/status-taxonomy.md +12 -4
- package/marketplace/plugins/litcodex/skills/lit-plan/SKILL.md +3 -2
- package/marketplace/plugins/litcodex/skills/lit-plan/references/full-workflow.md +2 -1
- package/marketplace/plugins/litcodex/skills/start-work/SKILL.md +1 -1
- package/node_modules/@litcodex/lit-loop/directives/lit-adhd.md +12 -9
- package/node_modules/@litcodex/lit-loop/directives/lit-plan.md +2 -1
- package/node_modules/@litcodex/lit-loop/dist/card-status.d.ts +3 -0
- package/node_modules/@litcodex/lit-loop/dist/card-status.js +4 -1
- package/node_modules/@litcodex/lit-loop/dist/hook-cli.js +8 -2
- package/node_modules/@litcodex/lit-loop/dist/plan-persistence.d.ts +1 -1
- package/node_modules/@litcodex/lit-loop/dist/plan-persistence.js +28 -2
- package/node_modules/@litcodex/lit-loop/dist/plan-scope-roots.d.ts +7 -0
- package/node_modules/@litcodex/lit-loop/dist/plan-scope-roots.js +76 -0
- package/node_modules/@litcodex/lit-loop/dist/restart-chip.d.ts +6 -0
- package/node_modules/@litcodex/lit-loop/dist/restart-chip.js +59 -0
- package/node_modules/@litcodex/lit-loop/dist/rewind-go.js +11 -1
- package/node_modules/@litcodex/lit-loop/dist/rewind.d.ts +13 -7
- package/node_modules/@litcodex/lit-loop/dist/rewind.js +143 -49
- package/node_modules/@litcodex/lit-loop/dist/route-heads.js +1 -1
- package/node_modules/@litcodex/lit-loop/dist/session-liveness.d.ts +16 -0
- package/node_modules/@litcodex/lit-loop/dist/session-liveness.js +90 -0
- package/node_modules/@litcodex/lit-loop/dist/threads.js +7 -2
- package/node_modules/@litcodex/lit-loop/dist/workflow-stack.d.ts +9 -2
- package/node_modules/@litcodex/lit-loop/dist/workflow-stack.js +35 -5
- package/node_modules/@litcodex/lit-loop/package.json +1 -1
- package/node_modules/@litcodex/lit-loop/skills/lit-adhd/SKILL.md +15 -11
- package/node_modules/@litcodex/lit-loop/skills/lit-plan/SKILL.md +3 -2
- package/node_modules/@litcodex/lit-loop/skills/start-work/SKILL.md +1 -1
- package/package.json +3 -2
- package/readme-assets/badge-version.svg +1 -1
package/README-Ko-KR.md
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
<p align="center"><picture><source media="(prefers-reduced-motion: reduce)" srcset="https://cdn.jsdelivr.net/npm/@litfamily/litcodex@1.0.
|
|
1
|
+
<p align="center"><picture><source media="(prefers-reduced-motion: reduce)" srcset="https://cdn.jsdelivr.net/npm/@litfamily/litcodex@1.0.32/readme-assets/cover-motion-still.webp" /><img src="https://cdn.jsdelivr.net/npm/@litfamily/litcodex@1.0.32/readme-assets/cover-motion.webp" width="100%" alt="LitFamily 모션 커버: 일곱 머신의 칸이 차례로 켜지고, 셋째 칸의 LitCodex 머신이 주황 바이저와 테두리를 밝힌 뒤 LITFAMILY와 KEEP THE WORK LIT. 문구가 밝아지는 영상" /></picture></p>
|
|
2
2
|
|
|
3
3
|
<p align="center">
|
|
4
|
-
<a href="#설치"><img src="https://cdn.jsdelivr.net/npm/@litfamily/litcodex@1.0.
|
|
5
|
-
<a href="https://github.com/wjgoarxiv/litcodex/blob/main/LICENSE"><img src="https://cdn.jsdelivr.net/npm/@litfamily/litcodex@1.0.
|
|
4
|
+
<a href="#설치"><img src="https://cdn.jsdelivr.net/npm/@litfamily/litcodex@1.0.32/readme-assets/badge-version.svg" alt="1.0.32" /></a>
|
|
5
|
+
<a href="https://github.com/wjgoarxiv/litcodex/blob/main/LICENSE"><img src="https://cdn.jsdelivr.net/npm/@litfamily/litcodex@1.0.32/readme-assets/badge-license.svg" alt="MIT license" /></a>
|
|
6
6
|
</p>
|
|
7
7
|
|
|
8
8
|
<p align="center">
|
|
9
|
-
<a href="https://github.com/wjgoarxiv/litcodex/blob/main/docs/usage-Ko-KR.md"><img src="https://cdn.jsdelivr.net/npm/@litfamily/litcodex@1.0.
|
|
9
|
+
<a href="https://github.com/wjgoarxiv/litcodex/blob/main/docs/usage-Ko-KR.md"><img src="https://cdn.jsdelivr.net/npm/@litfamily/litcodex@1.0.32/readme-assets/lucide-book-open.svg" width="16" alt="" /> 문서</a> <a href="#설치">설치</a> <a href="https://github.com/wjgoarxiv/litcodex/blob/main/docs/assets/readme/ignition-film.mp4"><img src="https://cdn.jsdelivr.net/npm/@litfamily/litcodex@1.0.32/readme-assets/lucide-play.svg" width="16" alt="" /> Ignition</a> <a href="https://github.com/wjgoarxiv/litcodex/blob/main/LICENSE"><img src="https://cdn.jsdelivr.net/npm/@litfamily/litcodex@1.0.32/readme-assets/lucide-shield-check.svg" width="16" alt="" /> MIT</a>
|
|
10
10
|
</p>
|
|
11
11
|
|
|
12
12
|
# LitCodex
|
|
@@ -23,12 +23,12 @@
|
|
|
23
23
|
Node.js 22 이상과 Codex CLI가 필요합니다.
|
|
24
24
|
|
|
25
25
|
```sh
|
|
26
|
-
npm exec --yes --package @litfamily/litcodex@1.0.
|
|
26
|
+
npm exec --yes --package @litfamily/litcodex@1.0.32 -- litcodex install
|
|
27
27
|
```
|
|
28
28
|
|
|
29
29
|
설치기는 어떤 모델이 이끌지, 어떤 모델이 거들지, 답변 스타일은 무엇으로 할지 묻고, 쓰려는 내용을 먼저 보여 준 뒤
|
|
30
30
|
`~/.codex/config.toml`에서 자기가 관리하는 항목만 고칩니다. 계획만 먼저 보려면
|
|
31
|
-
`npm exec --yes --package @litfamily/litcodex@1.0.
|
|
31
|
+
`npm exec --yes --package @litfamily/litcodex@1.0.32 -- litcodex --dry-run install`을 실행하고, 묻는 단계 없이
|
|
32
32
|
설치하려면 `install` 뒤에 `--yes`를 붙이세요.
|
|
33
33
|
|
|
34
34
|
```sh
|
|
@@ -39,7 +39,7 @@ litcodex install
|
|
|
39
39
|
전역으로 설치하면 영상 스킬이 쓸 도구를 미리 준비하느라 버전이 고정된 파일 몇 개를 내려받습니다. 무엇을 받는지와
|
|
40
40
|
건너뛰는 방법은 [설치 안내](https://github.com/wjgoarxiv/litcodex/blob/main/docs/install-Ko-KR.md#전역-명령으로-쓰기)에 있습니다.
|
|
41
41
|
|
|
42
|
-
> 전역 설치가 없다면 `npm exec --yes --package @litfamily/litcodex@1.0.
|
|
42
|
+
> 전역 설치가 없다면 `npm exec --yes --package @litfamily/litcodex@1.0.32 -- litcodex <command>` 형식을 사용하세요.
|
|
43
43
|
|
|
44
44
|
## 첫 작업
|
|
45
45
|
|
|
@@ -91,7 +91,7 @@ lit 회원가입 폼에 입력 검증을 추가해줘
|
|
|
91
91
|
## 확인, 문제 해결, 제거
|
|
92
92
|
|
|
93
93
|
```sh
|
|
94
|
-
npm exec --yes --package @litfamily/litcodex@1.0.
|
|
94
|
+
npm exec --yes --package @litfamily/litcodex@1.0.32 -- litcodex doctor
|
|
95
95
|
```
|
|
96
96
|
|
|
97
97
|
`litcodex doctor`는 등록·훅·설정·호스트 기능을, `litcodex loop doctor`는 현재 프로젝트의 루프 상태를 확인합니다.
|
|
@@ -99,7 +99,7 @@ npm exec --yes --package @litfamily/litcodex@1.0.31 -- litcodex doctor
|
|
|
99
99
|
[문제 해결](https://github.com/wjgoarxiv/litcodex/blob/main/README-Ko-KR.md#문제-해결)에 있습니다.
|
|
100
100
|
|
|
101
101
|
```sh
|
|
102
|
-
npm exec --yes --package @litfamily/litcodex@1.0.
|
|
102
|
+
npm exec --yes --package @litfamily/litcodex@1.0.32 -- litcodex uninstall
|
|
103
103
|
```
|
|
104
104
|
|
|
105
105
|
플러그인과 LitCodex가 관리하는 설정을 지우고, 관련 없는 설정은 그대로 둡니다.
|
|
@@ -110,4 +110,5 @@ npm exec --yes --package @litfamily/litcodex@1.0.31 -- litcodex uninstall
|
|
|
110
110
|
[기존 설치 이전](https://github.com/wjgoarxiv/litcodex/blob/main/docs/npm-migration.md) ·
|
|
111
111
|
[CHANGELOG.md](https://github.com/wjgoarxiv/litcodex/blob/main/CHANGELOG.md) ·
|
|
112
112
|
[개인정보](https://github.com/wjgoarxiv/litcodex/blob/main/docs/privacy.md) ·
|
|
113
|
-
[이슈](https://github.com/wjgoarxiv/litcodex/issues) · MIT 라이선스
|
|
113
|
+
[이슈](https://github.com/wjgoarxiv/litcodex/issues) · MIT 라이선스 ·
|
|
114
|
+
[상표 정책](https://github.com/wjgoarxiv/litcodex/blob/main/TRADEMARK.md)
|
package/README.md
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
<p align="center"><picture><source media="(prefers-reduced-motion: reduce)" srcset="https://cdn.jsdelivr.net/npm/@litfamily/litcodex@1.0.
|
|
1
|
+
<p align="center"><picture><source media="(prefers-reduced-motion: reduce)" srcset="https://cdn.jsdelivr.net/npm/@litfamily/litcodex@1.0.32/readme-assets/cover-motion-still.webp" /><img src="https://cdn.jsdelivr.net/npm/@litfamily/litcodex@1.0.32/readme-assets/cover-motion.webp" width="100%" alt="LitFamily motion cover: seven armored machines power on bay by bay, the LitCodex machine in the third bay wakes with a glowing orange visor and a lit frame, then LITFAMILY and KEEP THE WORK LIT. light up." /></picture></p>
|
|
2
2
|
|
|
3
3
|
<p align="center">
|
|
4
|
-
<a href="#install"><img src="https://cdn.jsdelivr.net/npm/@litfamily/litcodex@1.0.
|
|
5
|
-
<a href="https://github.com/wjgoarxiv/litcodex/blob/main/LICENSE"><img src="https://cdn.jsdelivr.net/npm/@litfamily/litcodex@1.0.
|
|
4
|
+
<a href="#install"><img src="https://cdn.jsdelivr.net/npm/@litfamily/litcodex@1.0.32/readme-assets/badge-version.svg" alt="1.0.32" /></a>
|
|
5
|
+
<a href="https://github.com/wjgoarxiv/litcodex/blob/main/LICENSE"><img src="https://cdn.jsdelivr.net/npm/@litfamily/litcodex@1.0.32/readme-assets/badge-license.svg" alt="MIT license" /></a>
|
|
6
6
|
</p>
|
|
7
7
|
|
|
8
8
|
<p align="center">
|
|
9
|
-
<a href="https://github.com/wjgoarxiv/litcodex/blob/main/docs/usage.md"><img src="https://cdn.jsdelivr.net/npm/@litfamily/litcodex@1.0.
|
|
9
|
+
<a href="https://github.com/wjgoarxiv/litcodex/blob/main/docs/usage.md"><img src="https://cdn.jsdelivr.net/npm/@litfamily/litcodex@1.0.32/readme-assets/lucide-book-open.svg" width="16" alt="" /> Docs</a> <a href="#install">Install</a> <a href="https://github.com/wjgoarxiv/litcodex/blob/main/docs/assets/readme/ignition-film.mp4"><img src="https://cdn.jsdelivr.net/npm/@litfamily/litcodex@1.0.32/readme-assets/lucide-play.svg" width="16" alt="" /> Ignition</a> <a href="https://github.com/wjgoarxiv/litcodex/blob/main/LICENSE"><img src="https://cdn.jsdelivr.net/npm/@litfamily/litcodex@1.0.32/readme-assets/lucide-shield-check.svg" width="16" alt="" /> MIT</a>
|
|
10
10
|
</p>
|
|
11
11
|
|
|
12
12
|
# LitCodex
|
|
@@ -24,12 +24,12 @@ today's stopped.
|
|
|
24
24
|
You need Node.js 22 or later and Codex CLI.
|
|
25
25
|
|
|
26
26
|
```sh
|
|
27
|
-
npm exec --yes --package @litfamily/litcodex@1.0.
|
|
27
|
+
npm exec --yes --package @litfamily/litcodex@1.0.32 -- litcodex install
|
|
28
28
|
```
|
|
29
29
|
|
|
30
30
|
The installer asks which model leads, which model helps and which output style you like, shows what it is
|
|
31
31
|
about to write, and changes only the keys it manages in `~/.codex/config.toml`. To see the plan first, run
|
|
32
|
-
`npm exec --yes --package @litfamily/litcodex@1.0.
|
|
32
|
+
`npm exec --yes --package @litfamily/litcodex@1.0.32 -- litcodex --dry-run install`. To skip the
|
|
33
33
|
questions, add `--yes` after `install`.
|
|
34
34
|
|
|
35
35
|
```sh
|
|
@@ -41,7 +41,7 @@ A global install also gets the video skill's tools ready with a few pinned downl
|
|
|
41
41
|
[install guide](https://github.com/wjgoarxiv/litcodex/blob/main/docs/install.md#a-global-command) lists them
|
|
42
42
|
and shows how to skip them.
|
|
43
43
|
|
|
44
|
-
> Without a global install, use `npm exec --yes --package @litfamily/litcodex@1.0.
|
|
44
|
+
> Without a global install, use `npm exec --yes --package @litfamily/litcodex@1.0.32 -- litcodex <command>`.
|
|
45
45
|
|
|
46
46
|
## First task
|
|
47
47
|
|
|
@@ -97,7 +97,7 @@ rather have neither, set `LITCODEX_NO_UPDATE_CHECK=1`. A doctor run that failed,
|
|
|
97
97
|
## Check, fix, remove
|
|
98
98
|
|
|
99
99
|
```sh
|
|
100
|
-
npm exec --yes --package @litfamily/litcodex@1.0.
|
|
100
|
+
npm exec --yes --package @litfamily/litcodex@1.0.32 -- litcodex doctor
|
|
101
101
|
```
|
|
102
102
|
|
|
103
103
|
`litcodex doctor` checks registration, hooks, config and host capabilities; `litcodex loop doctor` checks
|
|
@@ -105,7 +105,7 @@ the current project's loop state. If `lit` does nothing, run doctor and check th
|
|
|
105
105
|
in Codex. More fixes are under [troubleshooting](https://github.com/wjgoarxiv/litcodex#troubleshooting).
|
|
106
106
|
|
|
107
107
|
```sh
|
|
108
|
-
npm exec --yes --package @litfamily/litcodex@1.0.
|
|
108
|
+
npm exec --yes --package @litfamily/litcodex@1.0.32 -- litcodex uninstall
|
|
109
109
|
```
|
|
110
110
|
|
|
111
111
|
This removes the plugin and the config LitCodex manages, and leaves your other settings alone.
|
|
@@ -116,4 +116,5 @@ This removes the plugin and the config LitCodex manages, and leaves your other s
|
|
|
116
116
|
[Migration from the old package](https://github.com/wjgoarxiv/litcodex/blob/main/docs/npm-migration.md) ·
|
|
117
117
|
[CHANGELOG.md](https://github.com/wjgoarxiv/litcodex/blob/main/CHANGELOG.md) ·
|
|
118
118
|
[Privacy](https://github.com/wjgoarxiv/litcodex/blob/main/docs/privacy.md) ·
|
|
119
|
-
[Issues](https://github.com/wjgoarxiv/litcodex/issues) · MIT license
|
|
119
|
+
[Issues](https://github.com/wjgoarxiv/litcodex/issues) · MIT license ·
|
|
120
|
+
[Trademark policy](https://github.com/wjgoarxiv/litcodex/blob/main/TRADEMARK.md)
|
package/TRADEMARK.md
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
# Trademark policy
|
|
2
|
+
|
|
3
|
+
The code in this repository is free to use under the MIT License (see `LICENSE`). The names **LitCodex**
|
|
4
|
+
and **LitFamily**, and the logos and mascot art, are not part of that license.
|
|
5
|
+
|
|
6
|
+
- You can fork, change and share the code under MIT.
|
|
7
|
+
- If you publish a changed version, give it a different name and logo, and do not suggest that the
|
|
8
|
+
LitCodex maintainers made or endorse it.
|
|
9
|
+
- You can say in plain text that your project is "based on LitCodex" or "a fork of LitCodex".
|
|
10
|
+
- Unchanged copies, such as mirrors and package caches, may keep the name.
|
|
11
|
+
|
|
12
|
+
Questions: open an issue at https://github.com/wjgoarxiv/litcodex/issues.
|
|
@@ -156,19 +156,21 @@ the Codex home yourself.
|
|
|
156
156
|
Use the user's language. Start from the JSON's `brief` field, a finished Markdown draft; keep its structure,
|
|
157
157
|
translate it, and add no `#` heading or `>` quote mark (the Codex terminal prints them literally), and copy ids, gauges, titles, dates and names from the JSON verbatim.
|
|
158
158
|
|
|
159
|
-
1.
|
|
160
|
-
and the next step, then a dim line with the window.
|
|
161
|
-
2. One list-item card (`- ` first line, indented continuation lines) per
|
|
162
|
-
(`🟡 WAITS ON YOU`, `🟢 RUNNING`), then the goal in bold (`title`), ⏳ progress, ✅ done (`done`) and ▶ next (`needs`;
|
|
159
|
+
1. Opener, three bold lines: `✅ Done so far:` (finished plans, done sessions), `▶ Doing now:` (running, idle,
|
|
160
|
+
paused, what waits on the user) and `⏭ Next:` (the one next step), then a dim line with the window and session count.
|
|
161
|
+
2. One list-item card (`- ` first line, indented continuation lines) per session that is not ended, grouped by worktree and branch: a coloured badge
|
|
162
|
+
(`🟡 WAITS ON YOU`, `🟢 RUNNING`, `💤 IDLE`, `✅ DONE`), then the goal in bold (`title`), ⏳ progress, ✅ done (`done`) and ▶ next (`needs`;
|
|
163
163
|
for a running session what it is doing now, `now: shell “npm”`). Sessions with status `ended` get no card.
|
|
164
164
|
3. Roadmap under each worktree: `worktrees[].milestones` as `✓` done with its date, `▶` now, `○` later; open plans and
|
|
165
|
-
goals with their gauges; paused frames from `worktrees[].paused` as a `now` line with the way back (`lit continue`).
|
|
165
|
+
goals with their gauges, finished plans (`finishedPlans`) as finished; paused frames from `worktrees[].paused` as a `now` line with the way back (`lit continue`).
|
|
166
166
|
4. One table under a `⚪ **Ended · N**` line: id, where, goal, ago, done, one row per ended session, eight at most, then the count
|
|
167
167
|
of the rest. Keep each row on one line.
|
|
168
168
|
5. One recommended next step in a box: `next` when its kind is not `none`, else `suggestion`, a real step from the
|
|
169
169
|
records. Say `go` for a resume-frame, continue-work or start-plan step, `lit approve` or `lit deny` for an
|
|
170
|
-
approve-boundary step (shown only; never answer it for the user). A `
|
|
171
|
-
|
|
170
|
+
approve-boundary step (shown only; never answer it for the user). A `handoff` step comes from this worktree's
|
|
171
|
+
HANDOFF note and `go` does not run it. A `suggestion` says nothing runs on its own here: open that session, or say
|
|
172
|
+
what to do; a done session is offered for review, never picked up again. Never write "no next step". The box
|
|
173
|
+
sits in a plain fence with no language tag.
|
|
172
174
|
|
|
173
175
|
A gauge `[▉▉▉░░] 3/5` is drawn only when both numbers are real, copied as given. An unknown total gets no gauge and no
|
|
174
176
|
placeholder: write the known facts in words (`12 steps · 4m · last: apply_patch`). Never show a run of question marks
|
|
@@ -176,10 +178,11 @@ where a number would go, and never estimate a total.
|
|
|
176
178
|
|
|
177
179
|
Finish with one `unknown:` line naming each source whose status is not `ok`
|
|
178
180
|
(`sources.sessions`, `sources.git`, `sources.state`) and whether the byte budget
|
|
179
|
-
ran out. Never fill an unknown from memory.
|
|
181
|
+
ran out, and say once how many plan files were too large to read (`skippedPlans`). Never fill an unknown from memory.
|
|
180
182
|
|
|
181
183
|
# Status words
|
|
182
|
-
`waiting-on-user`, `
|
|
184
|
+
`done` (its work or plan finished), `waiting-on-user`, `idle` (its turn closed, per its liveness record), `active` (a
|
|
185
|
+
record in the last 15 minutes), `ended`, `unknown`.
|
|
183
186
|
The skill's `references/status-taxonomy.md` has the English and Korean words;
|
|
184
187
|
`references/card-examples.md` shows a finished brief.
|
|
185
188
|
|
|
@@ -458,7 +458,8 @@ approval, until independently verified.
|
|
|
458
458
|
approach), then stop and wait.
|
|
459
459
|
- After approval: announce the plan path `.litcodex/plans/<slug>.md`, a
|
|
460
460
|
one-paragraph summary of scope, waves, and verification, and the collision-safe next action
|
|
461
|
-
`lit start work <plan-name>`.
|
|
461
|
+
`lit start work <plan-name>`. Close by telling the user to type `go` within 30 minutes to start it:
|
|
462
|
+
saving the plan arms a one-word `go` for this session only.
|
|
462
463
|
|
|
463
464
|
# Stop rules
|
|
464
465
|
- Plan file exists, template filled, every todo has action + output + verification +
|
|
@@ -37,6 +37,8 @@ export interface CardStatus {
|
|
|
37
37
|
readonly workspace: string | null;
|
|
38
38
|
/** When the newest card of this thread opened; an older card that sees a later time folds itself. */
|
|
39
39
|
readonly cardOpenedAt: number | null;
|
|
40
|
+
/** `restart to <v>` while a newer LitCodex is installed than the one this process loaded, else null. */
|
|
41
|
+
readonly restart?: string | null;
|
|
40
42
|
readonly now: number;
|
|
41
43
|
}
|
|
42
44
|
/**
|
|
@@ -70,6 +72,7 @@ export declare function toolDisplayName(tool: string): string;
|
|
|
70
72
|
/** The card for one thread. `rollout: false` keeps every Codex rollout file unread; the usage row then stays empty. */
|
|
71
73
|
export declare function readCardStatus(threadId: string | null, env: NodeJS.ProcessEnv, now?: number, options?: {
|
|
72
74
|
readonly rollout?: boolean;
|
|
75
|
+
readonly loadedVersion?: string | null;
|
|
73
76
|
}): CardStatus;
|
|
74
77
|
/** Minutes and seconds, `m:ss`. */
|
|
75
78
|
export declare function clock(ms: number): string;
|
|
@@ -12,6 +12,7 @@ import { basename, isAbsolute, join } from "node:path";
|
|
|
12
12
|
import { lookOf, REVIEW_LANE_IDS } from "./card-looks.js";
|
|
13
13
|
import { cleanDeep, cleanLines } from "./control-chars.js";
|
|
14
14
|
import { codexHomeFrom, openRegularFile, plainDirs, readLiveStep, readThreadPointer, } from "./live-step.js";
|
|
15
|
+
import { installedPluginVersion, loadedPluginVersion, restartChip } from "./restart-chip.js";
|
|
15
16
|
import { normalizeSessionId } from "./state-paths.js";
|
|
16
17
|
import { readThreads, threadLines } from "./threads.js";
|
|
17
18
|
import { readWorkflowSignals, workflowMapCells, workflowMapText, workflowTurn, } from "./workflow-map.js";
|
|
@@ -422,6 +423,7 @@ export function readCardStatus(threadId, env, now = Date.now(), options = {}) {
|
|
|
422
423
|
branch: readBranch(cwd),
|
|
423
424
|
workspace,
|
|
424
425
|
cardOpenedAt,
|
|
426
|
+
restart: restartChip(options.loadedVersion === undefined ? loadedPluginVersion() : options.loadedVersion, installedPluginVersion(env)),
|
|
425
427
|
now,
|
|
426
428
|
});
|
|
427
429
|
}
|
|
@@ -441,8 +443,9 @@ export function cardStatusText(status) {
|
|
|
441
443
|
: status.look === "review"
|
|
442
444
|
? " REVIEW"
|
|
443
445
|
: "";
|
|
446
|
+
const chip = status.restart ? ` ↻ ${status.restart}` : "";
|
|
444
447
|
const lines = [
|
|
445
|
-
`🔥 LIT ${status.state === "complete" ? "COMPLETE ✓" : "IGNITED"} · ${status.mode ?? "lit"}${lookLabel}`,
|
|
448
|
+
`🔥 LIT ${status.state === "complete" ? "COMPLETE ✓" : "IGNITED"} · ${status.mode ?? "lit"}${lookLabel}${chip}`,
|
|
446
449
|
];
|
|
447
450
|
if (status.map !== null) {
|
|
448
451
|
lines.push(workflowMapText(status.map));
|
|
@@ -21,6 +21,7 @@ import { clearActiveRoute, isBareLit, isLitContinue, readActiveRoute, readResume
|
|
|
21
21
|
import { isBoundaryAnswer, isGoPrompt, takeGo } from "./rewind-go.js";
|
|
22
22
|
import { workflowCard } from "./screen-card.js";
|
|
23
23
|
import { screenColor } from "./screen-status.js";
|
|
24
|
+
import { recordLiveness } from "./session-liveness.js";
|
|
24
25
|
import { applyPromptToStack, frameToResume } from "./stack-hook.js";
|
|
25
26
|
import { recordWorkflowTurn, workflowStopLine, workflowTurn } from "./workflow-map.js";
|
|
26
27
|
/** Hard cap on stdin to bound memory / ReDoS exposure inside the 5 s Codex hook budget. 8 MB. */
|
|
@@ -362,7 +363,7 @@ export async function runStopPlanPersistenceHookCli(stdin, stdout, stderr, repoR
|
|
|
362
363
|
// No tool runs once Stop fires: one whose PostToolUse never came (interrupted, or denied by another hook) is over.
|
|
363
364
|
// The turn itself closes only below, after the guards that can send the model back to work.
|
|
364
365
|
endLiveStep(scope.cwd, scope.sessionId, auto.now, false);
|
|
365
|
-
const persistence = evaluatePlanPersistence(scope.cwd, scope.sessionId);
|
|
366
|
+
const persistence = evaluatePlanPersistence(scope.cwd, scope.sessionId, auto.now);
|
|
366
367
|
if (persistence.decision === "block") {
|
|
367
368
|
stdout.write(formatStopBlockOutput(persistence.reason));
|
|
368
369
|
return 0;
|
|
@@ -396,6 +397,8 @@ export async function runStopPlanPersistenceHookCli(stdin, stdout, stderr, repoR
|
|
|
396
397
|
const lastMsg = typeof record["last_assistant_message"] === "string" ? record["last_assistant_message"] : null;
|
|
397
398
|
endLiveStep(scope.cwd, scope.sessionId, auto.now, true, detectWaitReason(lastMsg));
|
|
398
399
|
const env = auto.env ?? process.env;
|
|
400
|
+
if (workflowTurn(scope.cwd, scope.sessionId) !== null)
|
|
401
|
+
recordLiveness(scope.cwd, scope.sessionId, "idle", env, auto.now);
|
|
399
402
|
const line = typeof record["turn_id"] === "string"
|
|
400
403
|
? workflowStopLine(scope.cwd, scope.sessionId, record["turn_id"], {
|
|
401
404
|
stopHookActive: record["stop_hook_active"] === true,
|
|
@@ -538,8 +541,11 @@ export async function runPostToolUseLiveHookCli(stdin, _stdout, _stderr, options
|
|
|
538
541
|
return 0;
|
|
539
542
|
const scope = toolEventScope(event.parsed);
|
|
540
543
|
const now = options.now ?? Date.now();
|
|
541
|
-
if (scope !== null && !OWN_CARD_TOOL.test(scope.tool))
|
|
544
|
+
if (scope !== null && !OWN_CARD_TOOL.test(scope.tool)) {
|
|
542
545
|
recordLiveStepEnd(scope.cwd, scope.sessionId, scope, now);
|
|
546
|
+
if (workflowTurn(scope.cwd, scope.sessionId) !== null)
|
|
547
|
+
recordLiveness(scope.cwd, scope.sessionId, "alive", options.env ?? process.env, now);
|
|
548
|
+
}
|
|
543
549
|
recordLanes(event.parsed, toolLaneEvents, now);
|
|
544
550
|
// A shell call that ran the film renderer is noted for the completion gate (motion-gate.ts).
|
|
545
551
|
recordMotionTool(event.parsed, now);
|
|
@@ -17,6 +17,6 @@ export declare function rearmLitPlanIfSatisfied(repoRoot: string, sessionId: str
|
|
|
17
17
|
* already satisfied, or when the block cap is spent; otherwise block until a checkbox plan newer than
|
|
18
18
|
* the activation exists. Fail-open on any fs error.
|
|
19
19
|
*/
|
|
20
|
-
export declare function evaluatePlanPersistence(repoRoot: string, sessionId: string): PlanPersistenceDecision;
|
|
20
|
+
export declare function evaluatePlanPersistence(repoRoot: string, sessionId: string, now?: number): PlanPersistenceDecision;
|
|
21
21
|
/** Codex Stop hook output for a block decision (single line + newline). */
|
|
22
22
|
export declare function formatStopBlockOutput(reason: string): string;
|
|
@@ -8,7 +8,10 @@
|
|
|
8
8
|
// PLAN_PERSISTENCE_MAX_BLOCKS blocks are issued per session so a model that keeps interviewing (or a
|
|
9
9
|
// user who abandons the plan) can never be trapped in a Stop loop. Every fs failure is FAIL-OPEN.
|
|
10
10
|
import { mkdirSync, readdirSync, readFileSync, renameSync, statSync, writeFileSync } from "node:fs";
|
|
11
|
+
import { homedir } from "node:os";
|
|
11
12
|
import { isAbsolute, join } from "node:path";
|
|
13
|
+
import { scopeRootGaps, scopeRootLine } from "./plan-scope-roots.js";
|
|
14
|
+
import { writeNext } from "./rewind.js";
|
|
12
15
|
import { normalizeSessionId } from "./state-paths.js";
|
|
13
16
|
import { recordStackEvent } from "./workflow-stack.js";
|
|
14
17
|
export const PLAN_PERSISTENCE_DIR = ".litcodex/lit-plan";
|
|
@@ -38,12 +41,14 @@ function readState(path) {
|
|
|
38
41
|
typeof record["satisfied"] !== "boolean") {
|
|
39
42
|
return null;
|
|
40
43
|
}
|
|
44
|
+
const warned = record["scopeWarned"];
|
|
41
45
|
return {
|
|
42
46
|
version: STATE_VERSION,
|
|
43
47
|
sessionId: record["sessionId"],
|
|
44
48
|
activatedAt: record["activatedAt"],
|
|
45
49
|
blocks: record["blocks"],
|
|
46
50
|
satisfied: record["satisfied"],
|
|
51
|
+
...(Array.isArray(warned) ? { scopeWarned: warned.filter((name) => typeof name === "string") } : {}),
|
|
47
52
|
};
|
|
48
53
|
}
|
|
49
54
|
catch {
|
|
@@ -103,7 +108,7 @@ function newestPlanSince(repoRoot, since) {
|
|
|
103
108
|
return null;
|
|
104
109
|
try {
|
|
105
110
|
const body = readFileSync(join(dir, newest.file), "utf8");
|
|
106
|
-
return { file: newest.file, taskRows: body.split(/\r?\n/).filter((line) => TASK_ROW.test(line)).length };
|
|
111
|
+
return { file: newest.file, taskRows: body.split(/\r?\n/).filter((line) => TASK_ROW.test(line)).length, body };
|
|
107
112
|
}
|
|
108
113
|
catch {
|
|
109
114
|
return null;
|
|
@@ -115,12 +120,18 @@ function blockReason(detail) {
|
|
|
115
120
|
"(plan Markdown on stdin; `## Todos` rows as `- [ ] N. <title>` at column zero). " +
|
|
116
121
|
`If approval is still pending, ask for it explicitly and end the turn; this guard blocks at most ${PLAN_PERSISTENCE_MAX_BLOCKS} turns per session.`);
|
|
117
122
|
}
|
|
123
|
+
function scopeReason(file, gaps) {
|
|
124
|
+
return (`The saved plan ${PLAN_PERSISTENCE_PLANS_DIR}/${file} names paths outside this project that no \`Scope roots:\` line covers, ` +
|
|
125
|
+
"so start-work would pause at the first touch of each. Add these lines at column zero near the top of the plan " +
|
|
126
|
+
`(widen \`read\` to the actions each todo needs), then end the turn:\n${gaps.map(scopeRootLine).join("\n")}\n` +
|
|
127
|
+
"This is advisory and shown once for this plan; leave the plan as it is if the run should ask instead.");
|
|
128
|
+
}
|
|
118
129
|
/**
|
|
119
130
|
* Decide whether the Stop for `sessionId` may end. Pass when no activation exists, when the guard is
|
|
120
131
|
* already satisfied, or when the block cap is spent; otherwise block until a checkbox plan newer than
|
|
121
132
|
* the activation exists. Fail-open on any fs error.
|
|
122
133
|
*/
|
|
123
|
-
export function evaluatePlanPersistence(repoRoot, sessionId) {
|
|
134
|
+
export function evaluatePlanPersistence(repoRoot, sessionId, now = Date.now()) {
|
|
124
135
|
const path = statePath(repoRoot, sessionId);
|
|
125
136
|
if (path === null)
|
|
126
137
|
return PASS;
|
|
@@ -129,6 +140,19 @@ export function evaluatePlanPersistence(repoRoot, sessionId) {
|
|
|
129
140
|
return PASS;
|
|
130
141
|
const newest = newestPlanSince(repoRoot, state.activatedAt);
|
|
131
142
|
if (newest !== null && newest.taskRows > 0) {
|
|
143
|
+
const warned = state.scopeWarned ?? [];
|
|
144
|
+
const gaps = warned.includes(newest.file)
|
|
145
|
+
? []
|
|
146
|
+
: scopeRootGaps(newest.body, repoRoot, process.env["HOME"] ?? homedir());
|
|
147
|
+
if (gaps.length > 0) {
|
|
148
|
+
try {
|
|
149
|
+
writeState(path, { ...state, scopeWarned: [...warned, newest.file] });
|
|
150
|
+
}
|
|
151
|
+
catch {
|
|
152
|
+
return PASS;
|
|
153
|
+
}
|
|
154
|
+
return { decision: "block", reason: scopeReason(newest.file, gaps) };
|
|
155
|
+
}
|
|
132
156
|
try {
|
|
133
157
|
writeState(path, { ...state, satisfied: true });
|
|
134
158
|
}
|
|
@@ -144,6 +168,8 @@ export function evaluatePlanPersistence(repoRoot, sessionId) {
|
|
|
144
168
|
done: true,
|
|
145
169
|
ref: { plan: `${PLAN_PERSISTENCE_PLANS_DIR}/${newest.file}` },
|
|
146
170
|
}, new Date());
|
|
171
|
+
// One `go` in this session within the go window starts the plan just saved.
|
|
172
|
+
writeNext(repoRoot, sessionId, { kind: "start-plan", text: `start work on ${newest.file}`, plan: newest.file }, now);
|
|
147
173
|
return PASS;
|
|
148
174
|
}
|
|
149
175
|
if (state.blocks >= PLAN_PERSISTENCE_MAX_BLOCKS)
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Absolute paths the plan's todos name outside `projectRoot` that no `Scope roots:` line covers, in order of
|
|
3
|
+
* first mention. Empty when the plan is covered.
|
|
4
|
+
*/
|
|
5
|
+
export declare function scopeRootGaps(text: string, projectRoot: string, home: string): string[];
|
|
6
|
+
/** The line a planner pastes to declare `path`; read access is the default to widen deliberately. */
|
|
7
|
+
export declare function scopeRootLine(path: string): string;
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
// src/plan-scope-roots.ts — the advisory `Scope roots:` check for a saved lit-plan.
|
|
2
|
+
//
|
|
3
|
+
// start-work later grants only the project and the roots a plan declares on its own column-zero lines,
|
|
4
|
+
// `Scope roots: <path> (<actions>)`. A todo that names an absolute path outside the project without such a
|
|
5
|
+
// line pauses the run at its first touch of that path, so the Stop gate points it out once while the planner
|
|
6
|
+
// can still add the line. Only todo rows and their indented continuation count; fenced code and inline code
|
|
7
|
+
// that holds a command are examples, not targets. `/` and the bare home folder never cover anything.
|
|
8
|
+
import { posix } from "node:path";
|
|
9
|
+
const FENCE = /^\s*(?:```|~~~)/u;
|
|
10
|
+
const TODO_ROW = /^- \[[ xX]\] /u;
|
|
11
|
+
const SCOPE_LINE = /^Scope roots:\s+(\S+)\s+\([^)]*\)\s*$/u;
|
|
12
|
+
const PATH = /(?<![\w:/.~-])(~?\/[A-Za-z0-9._~@%+/-]+)/gu;
|
|
13
|
+
const TRAILING = /[.,;:]+$/u;
|
|
14
|
+
function expand(path, home) {
|
|
15
|
+
return posix.normalize(path.startsWith("~/") ? `${home}${path.slice(1)}` : path).replace(/(.)\/$/u, "$1");
|
|
16
|
+
}
|
|
17
|
+
/** Plan text names POSIX paths whatever the host, so the comparison stays POSIX too. */
|
|
18
|
+
function inside(path, dir) {
|
|
19
|
+
const rel = posix.relative(dir, path);
|
|
20
|
+
return rel === "" || (!rel.startsWith("..") && !posix.isAbsolute(rel));
|
|
21
|
+
}
|
|
22
|
+
/** Inline code that is a bare path stays as the path; one that holds a command is dropped. */
|
|
23
|
+
function withoutCommands(line) {
|
|
24
|
+
return line.replace(/`([^`]*)`/gu, (_whole, body) => (/\s/u.test(body.trim()) ? " " : ` ${body} `));
|
|
25
|
+
}
|
|
26
|
+
/** Lines outside fenced code, each tagged with whether it belongs to a todo row. */
|
|
27
|
+
function proseLines(text) {
|
|
28
|
+
const out = [];
|
|
29
|
+
let fenced = false;
|
|
30
|
+
let todo = false;
|
|
31
|
+
for (const line of text.split(/\r?\n/u)) {
|
|
32
|
+
if (FENCE.test(line)) {
|
|
33
|
+
fenced = !fenced;
|
|
34
|
+
continue;
|
|
35
|
+
}
|
|
36
|
+
if (fenced)
|
|
37
|
+
continue;
|
|
38
|
+
if (TODO_ROW.test(line))
|
|
39
|
+
todo = true;
|
|
40
|
+
else if (line.trim() !== "" && !/^\s/u.test(line))
|
|
41
|
+
todo = false;
|
|
42
|
+
out.push({ line, todo });
|
|
43
|
+
}
|
|
44
|
+
return out;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Absolute paths the plan's todos name outside `projectRoot` that no `Scope roots:` line covers, in order of
|
|
48
|
+
* first mention. Empty when the plan is covered.
|
|
49
|
+
*/
|
|
50
|
+
export function scopeRootGaps(text, projectRoot, home) {
|
|
51
|
+
const lines = proseLines(text);
|
|
52
|
+
const homeDir = expand(home, home);
|
|
53
|
+
const roots = lines
|
|
54
|
+
.map(({ line }) => SCOPE_LINE.exec(line)?.[1])
|
|
55
|
+
.filter((root) => root !== undefined)
|
|
56
|
+
.map((root) => expand(root, home))
|
|
57
|
+
.filter((root) => root !== "/" && root !== homeDir);
|
|
58
|
+
const gaps = [];
|
|
59
|
+
for (const { line, todo } of lines) {
|
|
60
|
+
if (!todo)
|
|
61
|
+
continue;
|
|
62
|
+
for (const match of withoutCommands(line).matchAll(PATH)) {
|
|
63
|
+
const path = expand((match[1] ?? "").replace(TRAILING, ""), home);
|
|
64
|
+
if (path.length < 2 || inside(path, projectRoot))
|
|
65
|
+
continue;
|
|
66
|
+
if (roots.some((root) => inside(path, root)) || gaps.includes(path))
|
|
67
|
+
continue;
|
|
68
|
+
gaps.push(path);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
return gaps;
|
|
72
|
+
}
|
|
73
|
+
/** The line a planner pastes to declare `path`; read access is the default to widen deliberately. */
|
|
74
|
+
export function scopeRootLine(path) {
|
|
75
|
+
return `Scope roots: ${path} (read)`;
|
|
76
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/** The version this process loaded, or null when its manifest cannot be read. */
|
|
2
|
+
export declare function loadedPluginVersion(): string | null;
|
|
3
|
+
/** The version the installer last put in place for the Codex home in `env`, or null. */
|
|
4
|
+
export declare function installedPluginVersion(env: NodeJS.ProcessEnv): string | null;
|
|
5
|
+
/** `restart to <installed>` when `installed` is a newer plain version than `loaded`; null otherwise. */
|
|
6
|
+
export declare function restartChip(loaded: string | null, installed: string | null): string | null;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
// src/restart-chip.ts — `restart to <v>` when a newer LitCodex is installed than the one running.
|
|
2
|
+
//
|
|
3
|
+
// The running version is this plugin's own `.codex-plugin/plugin.json`, read once when the module loads, so a
|
|
4
|
+
// long-lived card server keeps the version it started with. The installed version is the managed marketplace
|
|
5
|
+
// payload the installer and the auto-updater rewrite (`<CODEX_HOME>/marketplaces/litcodex/...`), the same
|
|
6
|
+
// file `litcodex doctor` reads; the plugin cache is not used because it keeps every past version as history.
|
|
7
|
+
// Versions compare as plain `x.y.z` the way the auto-updater compares them; anything else shows no chip.
|
|
8
|
+
import { readFileSync } from "node:fs";
|
|
9
|
+
import { join } from "node:path";
|
|
10
|
+
import { codexHomeFrom, readSmallJson } from "./live-step.js";
|
|
11
|
+
const MAX_MANIFEST_BYTES = 64 * 1024;
|
|
12
|
+
const STABLE = /^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)$/u;
|
|
13
|
+
const MANAGED_MANIFEST = "marketplaces/litcodex/plugins/litcodex/.codex-plugin/plugin.json";
|
|
14
|
+
function versionOf(manifest) {
|
|
15
|
+
if (typeof manifest !== "object" || manifest === null || Array.isArray(manifest))
|
|
16
|
+
return null;
|
|
17
|
+
const { name, version } = manifest;
|
|
18
|
+
return name === "litcodex" && typeof version === "string" ? version : null;
|
|
19
|
+
}
|
|
20
|
+
const LOADED = (() => {
|
|
21
|
+
try {
|
|
22
|
+
const text = readFileSync(new URL("../../../.codex-plugin/plugin.json", import.meta.url), "utf8");
|
|
23
|
+
return text.length > MAX_MANIFEST_BYTES ? null : versionOf(JSON.parse(text));
|
|
24
|
+
}
|
|
25
|
+
catch {
|
|
26
|
+
return null;
|
|
27
|
+
}
|
|
28
|
+
})();
|
|
29
|
+
/** The version this process loaded, or null when its manifest cannot be read. */
|
|
30
|
+
export function loadedPluginVersion() {
|
|
31
|
+
return LOADED;
|
|
32
|
+
}
|
|
33
|
+
/** The version the installer last put in place for the Codex home in `env`, or null. */
|
|
34
|
+
export function installedPluginVersion(env) {
|
|
35
|
+
const home = codexHomeFrom(env);
|
|
36
|
+
return home === null ? null : versionOf(readSmallJson(join(home, MANAGED_MANIFEST), MAX_MANIFEST_BYTES));
|
|
37
|
+
}
|
|
38
|
+
function parts(version) {
|
|
39
|
+
const match = version === null ? null : STABLE.exec(version);
|
|
40
|
+
if (match?.[1] === undefined || match[2] === undefined || match[3] === undefined)
|
|
41
|
+
return null;
|
|
42
|
+
return [BigInt(match[1]), BigInt(match[2]), BigInt(match[3])];
|
|
43
|
+
}
|
|
44
|
+
/** `restart to <installed>` when `installed` is a newer plain version than `loaded`; null otherwise. */
|
|
45
|
+
export function restartChip(loaded, installed) {
|
|
46
|
+
const a = parts(loaded);
|
|
47
|
+
const b = parts(installed);
|
|
48
|
+
if (a === null || b === null)
|
|
49
|
+
return null;
|
|
50
|
+
for (let index = 0; index < 3; index += 1) {
|
|
51
|
+
const left = a[index];
|
|
52
|
+
const right = b[index];
|
|
53
|
+
if (right > left)
|
|
54
|
+
return `restart to ${installed}`;
|
|
55
|
+
if (right < left)
|
|
56
|
+
return null;
|
|
57
|
+
}
|
|
58
|
+
return null;
|
|
59
|
+
}
|
|
@@ -10,7 +10,7 @@ import { rmSync } from "node:fs";
|
|
|
10
10
|
import { isAbsolute, join } from "node:path";
|
|
11
11
|
import { clean } from "./control-chars.js";
|
|
12
12
|
import { plainDirsOrMissing, readSmallJson } from "./live-step.js";
|
|
13
|
-
import { ADHD_DIR, chooseNext, GO_WINDOW_MS } from "./rewind.js";
|
|
13
|
+
import { ADHD_DIR, chooseNext, GO_WINDOW_MS, openPlanNamed } from "./rewind.js";
|
|
14
14
|
import { normalizeSessionId } from "./state-paths.js";
|
|
15
15
|
const GO_PROMPT = /^\s*(?:(?:lit\s+)?go|ㄱㄱ|고|진행)[\s.!?]*$/iu;
|
|
16
16
|
const MAX_NOTE_BYTES = 8 * 1024;
|
|
@@ -66,6 +66,16 @@ export function takeGo(cwd, sessionId, now) {
|
|
|
66
66
|
if (note.kind === "approve-boundary")
|
|
67
67
|
return { kind: "hint", text: BOUNDARY };
|
|
68
68
|
const fresh = chooseNext(cwd, sessionId);
|
|
69
|
+
// A note naming its plan (a saved lit-plan, or a brief) holds while that plan is open and nothing outranks it,
|
|
70
|
+
// even when a second open plan means the brief alone would name none.
|
|
71
|
+
const named = note.kind === "start-plan" && note.plan !== null ? openPlanNamed(cwd, note.plan) : null;
|
|
72
|
+
if (named !== null && (fresh.kind === "none" || fresh.kind === "handoff" || fresh.kind === "start-plan")) {
|
|
73
|
+
return {
|
|
74
|
+
kind: "run",
|
|
75
|
+
prompt: `start-work ${named.name.replace(/\.md$/u, "")}`,
|
|
76
|
+
note: `go: start work on ${named.name}, ${named.done} of ${named.total} tasks done`,
|
|
77
|
+
};
|
|
78
|
+
}
|
|
69
79
|
if (fresh.kind !== note.kind || (note.kind === "start-plan" && fresh.plan !== note.plan)) {
|
|
70
80
|
return { kind: "hint", text: STALE };
|
|
71
81
|
}
|