@litfamily/litcodex 1.0.26 → 1.0.28
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 +27 -26
- package/README.md +31 -28
- package/dist/cli.d.ts +3 -2
- package/dist/cli.js +72 -3
- package/dist/install/generated-skill-payload-hashes.d.ts +2 -2
- package/dist/install/generated-skill-payload-hashes.js +2 -2
- package/dist/postinstall.js +12 -1
- package/dist/pty-helper.d.ts +7 -0
- package/dist/pty-helper.js +45 -0
- package/dist/run.d.ts +57 -0
- package/dist/run.js +354 -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/dist/card-status.d.ts +8 -3
- package/marketplace/plugins/litcodex/components/lit-loop/dist/card-status.js +11 -6
- package/marketplace/plugins/litcodex/components/lit-loop/dist/hook-cli.js +28 -10
- package/marketplace/plugins/litcodex/components/lit-loop/dist/hud-cli.d.ts +38 -0
- package/marketplace/plugins/litcodex/components/lit-loop/dist/hud-cli.js +155 -0
- package/marketplace/plugins/litcodex/components/lit-loop/dist/hud.d.ts +42 -0
- package/marketplace/plugins/litcodex/components/lit-loop/dist/hud.js +297 -0
- package/marketplace/plugins/litcodex/components/lit-loop/dist/run-filter.d.ts +23 -0
- package/marketplace/plugins/litcodex/components/lit-loop/dist/run-filter.js +142 -0
- package/marketplace/plugins/litcodex/components/lit-loop/dist/run-panel.d.ts +29 -0
- package/marketplace/plugins/litcodex/components/lit-loop/dist/run-panel.js +102 -0
- package/marketplace/plugins/litcodex/components/lit-loop/dist/screen-card.d.ts +24 -0
- package/marketplace/plugins/litcodex/components/lit-loop/dist/screen-card.js +104 -0
- package/marketplace/plugins/litcodex/components/lit-loop/dist/screen-status.d.ts +24 -0
- package/marketplace/plugins/litcodex/components/lit-loop/dist/screen-status.js +110 -0
- package/marketplace/plugins/litcodex/components/lit-loop/dist/statusline.d.ts +17 -0
- package/marketplace/plugins/litcodex/components/lit-loop/dist/statusline.js +113 -0
- package/marketplace/plugins/litcodex/components/lit-loop/dist/workflow-map.d.ts +7 -0
- package/marketplace/plugins/litcodex/components/lit-loop/dist/workflow-map.js +58 -10
- 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/bundled-rules/lit-humanizer.md +2 -0
- package/marketplace/plugins/litcodex/components/rules/dist/deliverable-hedge-guard.d.ts +8 -0
- package/marketplace/plugins/litcodex/components/rules/dist/deliverable-hedge-guard.js +381 -39
- 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-humanizer/SKILL.md +4 -0
- package/marketplace/plugins/litcodex/skills/lit-humanizer/scripts/core.mjs +5 -1
- package/marketplace/plugins/litcodex/skills/lit-loop/SKILL.md +2 -1
- package/node_modules/@litcodex/lit-loop/dist/card-status.d.ts +8 -3
- package/node_modules/@litcodex/lit-loop/dist/card-status.js +11 -6
- package/node_modules/@litcodex/lit-loop/dist/hook-cli.js +28 -10
- package/node_modules/@litcodex/lit-loop/dist/hud-cli.d.ts +38 -0
- package/node_modules/@litcodex/lit-loop/dist/hud-cli.js +155 -0
- package/node_modules/@litcodex/lit-loop/dist/hud.d.ts +42 -0
- package/node_modules/@litcodex/lit-loop/dist/hud.js +297 -0
- package/node_modules/@litcodex/lit-loop/dist/run-filter.d.ts +23 -0
- package/node_modules/@litcodex/lit-loop/dist/run-filter.js +142 -0
- package/node_modules/@litcodex/lit-loop/dist/run-panel.d.ts +29 -0
- package/node_modules/@litcodex/lit-loop/dist/run-panel.js +102 -0
- package/node_modules/@litcodex/lit-loop/dist/screen-card.d.ts +24 -0
- package/node_modules/@litcodex/lit-loop/dist/screen-card.js +104 -0
- package/node_modules/@litcodex/lit-loop/dist/screen-status.d.ts +24 -0
- package/node_modules/@litcodex/lit-loop/dist/screen-status.js +110 -0
- package/node_modules/@litcodex/lit-loop/dist/statusline.d.ts +17 -0
- package/node_modules/@litcodex/lit-loop/dist/statusline.js +113 -0
- package/node_modules/@litcodex/lit-loop/dist/workflow-map.d.ts +7 -0
- package/node_modules/@litcodex/lit-loop/dist/workflow-map.js +58 -10
- package/node_modules/@litcodex/lit-loop/package.json +1 -1
- package/node_modules/@litcodex/lit-loop/skills/lit-humanizer/SKILL.md +4 -0
- package/node_modules/@litcodex/lit-loop/skills/lit-humanizer/scripts/core.mjs +5 -1
- package/node_modules/@litcodex/lit-loop/skills/lit-loop/SKILL.md +2 -1
- package/package.json +5 -2
- package/readme-assets/badge-version.svg +1 -1
package/README-Ko-KR.md
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
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.28/readme-assets/cover-motion-still.webp" /><img src="https://cdn.jsdelivr.net/npm/@litfamily/litcodex@1.0.28/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.28/readme-assets/badge-version.svg" alt="1.0.28" /></a>
|
|
5
|
+
<a href="https://github.com/wjgoarxiv/litcodex/blob/main/LICENSE"><img src="https://cdn.jsdelivr.net/npm/@litfamily/litcodex@1.0.28/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.28/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.28/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.28/readme-assets/lucide-shield-check.svg" width="16" alt="" /> MIT</a>
|
|
10
10
|
</p>
|
|
11
11
|
|
|
12
12
|
# LitCodex
|
|
13
13
|
|
|
14
14
|
**Keep the work lit.**
|
|
15
15
|
|
|
16
|
-
|
|
17
|
-
|
|
16
|
+
요청 앞에 `lit`을 붙이면 Codex CLI가 통과·실패를 가릴 수 있는 기준을 세우고, 기준마다 증거가 남아야 일을 끝냅니다.
|
|
17
|
+
증거는 프로젝트 안에 남기 때문에 내일 세션은 오늘 멈춘 자리에서 시작합니다.
|
|
18
18
|
|
|
19
19
|
**[GitHub에서 전체 안내 보기](https://github.com/wjgoarxiv/litcodex/blob/main/README-Ko-KR.md)** · [English](https://github.com/wjgoarxiv/litcodex#readme)
|
|
20
20
|
|
|
@@ -23,12 +23,12 @@ Codex CLI 플러그인입니다.
|
|
|
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.28 -- 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.28 -- 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.28 -- litcodex <command>` 형식을 사용하세요.
|
|
43
43
|
|
|
44
44
|
## 첫 작업
|
|
45
45
|
|
|
@@ -49,10 +49,10 @@ litcodex install
|
|
|
49
49
|
lit 회원가입 폼에 입력 검증을 추가해줘
|
|
50
50
|
```
|
|
51
51
|
|
|
52
|
-
답변이 `🔥 **LIT IGNITED · <discipline>** 🔥` 한 줄로
|
|
53
|
-
기록은 프로젝트의 `.litcodex/lit-loop/` 아래에
|
|
54
|
-
`handoff`만 따로 보내면 다음 세션이 시작할 인수인계 문서가 생깁니다.
|
|
55
|
-
어댑터를
|
|
52
|
+
답변이 `🔥 **LIT IGNITED · <discipline>** 🔥` 한 줄로 시작하고, 그때부터 요청은 확인 기준이 붙은 목표가 됩니다.
|
|
53
|
+
모든 기준에 통과 증거가 있어야 완료되고, 기록은 프로젝트의 `.litcodex/lit-loop/` 아래에 남아 `lit recap`으로 다시
|
|
54
|
+
읽을 수 있습니다. 세션을 마치기 전에 `handoff`만 따로 보내면 다음 세션이 시작할 인수인계 문서가 생깁니다. 출판용
|
|
55
|
+
그래프가 필요할 때 `lit-scientific-visualization`만 보내면 시각화 어댑터를 불러오고, Python 패키지는 설치하지 않습니다.
|
|
56
56
|
|
|
57
57
|
## 스킬
|
|
58
58
|
|
|
@@ -60,15 +60,15 @@ lit 회원가입 폼에 입력 검증을 추가해줘
|
|
|
60
60
|
`$litcodex:lit-handoff`, `$litcodex:lit-scientific-visualization`처럼 이름으로 부를 수 있습니다. 스킬마다 그림은
|
|
61
61
|
[스킬 안내](https://github.com/wjgoarxiv/litcodex/blob/main/docs/skills-Ko-KR.md)에 있습니다.
|
|
62
62
|
|
|
63
|
-
-
|
|
63
|
+
- 루프와 계획: `lit-loop`(`lit`), `litwork`, `lit-plan`, Start Work(`lit start work <승인된 계획>`), `litgoal`,
|
|
64
64
|
`deep-interview`, `lit-crucible`, `lit-team`, `lit-recap`, `lit-handoff`.
|
|
65
|
-
-
|
|
65
|
+
- 검토와 조사: `review-work`, `litresearch`, `autoresearch`, `autoconference`, `lit-fetch`, `wikify`,
|
|
66
66
|
`coding-session-audit`, `lit-comprehend`.
|
|
67
|
-
-
|
|
67
|
+
- 문서, 그림, 화면: `lit-docx`, `lit-pptx`, `lit-diagram-drawer`, `lit-scientific-visualization`,
|
|
68
68
|
`lit-typographic-motion`, `lit-humanizer`, `readme-studio`, `frontend-ui-ux`, `visual-qa`, `browser-drive`.
|
|
69
|
-
-
|
|
69
|
+
- 코드: `debugging`, `refactor`, `lit-code`, `lit-commit`, `lit-burnoff`, `lit-burnoff-file`,
|
|
70
70
|
`structural-search`, `lsp-setup`, `lit-init`.
|
|
71
|
-
-
|
|
71
|
+
- 관리: `litcodex-doctor`, `litcodex-report-bug`, `litcodex-contribute-bug-fix`. `rules`, `lsp`,
|
|
72
72
|
`comment-checker`는 알아서 돌아갑니다.
|
|
73
73
|
|
|
74
74
|
## 설치하면 달라지는 것
|
|
@@ -76,21 +76,22 @@ lit 회원가입 폼에 입력 검증을 추가해줘
|
|
|
76
76
|
- Codex에 플러그인·훅·에이전트가 등록되고 `~/.codex/config.toml`의 관리 항목이 갱신됩니다. 관련 없는 Codex
|
|
77
77
|
설정은 그대로 둡니다.
|
|
78
78
|
- 프로젝트마다 `.litcodex/lit-loop/` 아래에 로컬 기록이 생기며, Git과 패키지에서는 제외됩니다.
|
|
79
|
-
- doctor 진단은 Codex 설정, 설치 상태, 플러그인 상태를 바꾸지 않고 살펴보기만 합니다. 조건에 맞는 대화형 doctor
|
|
80
|
-
실행 뒤에는 캐시해 둔 새 버전 안내가 뜰 수 있고, 백그라운드 작업이 정해진 레지스트리만 조회해
|
|
81
|
-
`~/.litcodex/update-check.json`에 적어 둡니다. 이 작업은 아무것도 설치하지 않습니다. 이와 별개로, 조건에 맞는
|
|
82
|
-
대화형 관리 명령 뒤에는 업데이트 실행기가 새 전역 패키지를 설치할 수 있습니다. `LITCODEX_NO_UPDATE_CHECK=1`을
|
|
83
|
-
설정하면 둘 다 꺼집니다. 실패했거나 `--json`·`--dry-run`으로 돌렸거나, 비TTY·CI 환경이거나 이 설정으로 끈
|
|
84
|
-
doctor 실행은 부수 효과가 없습니다.
|
|
85
79
|
- [자동 핸드오프](https://github.com/wjgoarxiv/litcodex/blob/main/docs/auto-handoff-Ko-KR.md)는 선택 기능이며
|
|
86
80
|
기본값은 꺼짐입니다.
|
|
87
81
|
- 테스트, 픽스처, 테스트 헬퍼, Vitest 설정은 저장소에만 있습니다. npm 패키지와 설치된 마켓플레이스 플러그인에는
|
|
88
82
|
들어가지 않습니다.
|
|
89
83
|
|
|
84
|
+
업데이트 확인은 이렇게 동작합니다. doctor 진단은 Codex 설정, 설치 상태, 플러그인 상태를 살펴보기만 하고 바꾸지 않습니다.
|
|
85
|
+
조건에 맞는 대화형 doctor 실행 뒤에는 캐시해 둔 새 버전 안내가 뜰 수 있습니다. 이 안내는 백그라운드 작업이 정해진
|
|
86
|
+
레지스트리만 조회해 `~/.litcodex/update-check.json`에 적어 둔 내용이며, 이 작업은 아무것도 설치하지 않습니다. 이와
|
|
87
|
+
별개로 조건에 맞는 대화형 관리 명령 뒤에는 업데이트 실행기가 새 전역 패키지를 설치할 수 있습니다. 둘 다 끄려면
|
|
88
|
+
`LITCODEX_NO_UPDATE_CHECK=1`을 설정하세요. 실패했거나 `--json`·`--dry-run`으로 돌렸거나, 비TTY·CI 환경이거나
|
|
89
|
+
이 설정으로 끈 doctor 실행은 아무것도 바꾸지 않습니다.
|
|
90
|
+
|
|
90
91
|
## 확인, 문제 해결, 제거
|
|
91
92
|
|
|
92
93
|
```sh
|
|
93
|
-
npm exec --yes --package @litfamily/litcodex@1.0.
|
|
94
|
+
npm exec --yes --package @litfamily/litcodex@1.0.28 -- litcodex doctor
|
|
94
95
|
```
|
|
95
96
|
|
|
96
97
|
`litcodex doctor`는 등록·훅·설정·호스트 기능을, `litcodex loop doctor`는 현재 프로젝트의 루프 상태를 확인합니다.
|
|
@@ -98,7 +99,7 @@ npm exec --yes --package @litfamily/litcodex@1.0.26 -- litcodex doctor
|
|
|
98
99
|
[문제 해결](https://github.com/wjgoarxiv/litcodex/blob/main/README-Ko-KR.md#문제-해결)에 있습니다.
|
|
99
100
|
|
|
100
101
|
```sh
|
|
101
|
-
npm exec --yes --package @litfamily/litcodex@1.0.
|
|
102
|
+
npm exec --yes --package @litfamily/litcodex@1.0.28 -- litcodex uninstall
|
|
102
103
|
```
|
|
103
104
|
|
|
104
105
|
플러그인과 LitCodex가 관리하는 설정을 지우고, 관련 없는 설정은 그대로 둡니다.
|
package/README.md
CHANGED
|
@@ -1,20 +1,21 @@
|
|
|
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.28/readme-assets/cover-motion-still.webp" /><img src="https://cdn.jsdelivr.net/npm/@litfamily/litcodex@1.0.28/readme-assets/cover-motion.webp" width="100%" alt="LitFamily motion cover: five armored robots power on one by one, the LitCodex robot wakes with glowing eyes 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.28/readme-assets/badge-version.svg" alt="1.0.28" /></a>
|
|
5
|
+
<a href="https://github.com/wjgoarxiv/litcodex/blob/main/LICENSE"><img src="https://cdn.jsdelivr.net/npm/@litfamily/litcodex@1.0.28/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.28/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.28/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.28/readme-assets/lucide-shield-check.svg" width="16" alt="" /> MIT</a>
|
|
10
10
|
</p>
|
|
11
11
|
|
|
12
12
|
# LitCodex
|
|
13
13
|
|
|
14
14
|
**Keep the work lit.**
|
|
15
15
|
|
|
16
|
-
|
|
17
|
-
|
|
16
|
+
Put `lit` in front of a request and Codex CLI works toward checks that can pass or fail, calling the job
|
|
17
|
+
done only when each one has proof. The proof stays in your project, so tomorrow's session starts where
|
|
18
|
+
today's stopped.
|
|
18
19
|
|
|
19
20
|
**[Full guide on GitHub](https://github.com/wjgoarxiv/litcodex#readme)** · [한국어](https://github.com/wjgoarxiv/litcodex/blob/main/packages/litcodex-ai/README-Ko-KR.md)
|
|
20
21
|
|
|
@@ -23,12 +24,12 @@ and hands unfinished work to the next session.
|
|
|
23
24
|
You need Node.js 22 or later and Codex CLI.
|
|
24
25
|
|
|
25
26
|
```sh
|
|
26
|
-
npm exec --yes --package @litfamily/litcodex@1.0.
|
|
27
|
+
npm exec --yes --package @litfamily/litcodex@1.0.28 -- litcodex install
|
|
27
28
|
```
|
|
28
29
|
|
|
29
30
|
The installer asks which model leads, which model helps and which output style you like, shows what it is
|
|
30
31
|
about to write, and changes only the keys it manages in `~/.codex/config.toml`. To see the plan first, run
|
|
31
|
-
`npm exec --yes --package @litfamily/litcodex@1.0.
|
|
32
|
+
`npm exec --yes --package @litfamily/litcodex@1.0.28 -- litcodex --dry-run install`. To skip the
|
|
32
33
|
questions, add `--yes` after `install`.
|
|
33
34
|
|
|
34
35
|
```sh
|
|
@@ -40,7 +41,7 @@ A global install also gets the video skill's tools ready with a few pinned downl
|
|
|
40
41
|
[install guide](https://github.com/wjgoarxiv/litcodex/blob/main/docs/install.md#a-global-command) lists them
|
|
41
42
|
and shows how to skip them.
|
|
42
43
|
|
|
43
|
-
> 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.28 -- litcodex <command>`.
|
|
44
45
|
|
|
45
46
|
## First task
|
|
46
47
|
|
|
@@ -50,11 +51,12 @@ Open Codex in your project, approve the LitCodex hooks in the startup review, an
|
|
|
50
51
|
lit add input validation to the signup form
|
|
51
52
|
```
|
|
52
53
|
|
|
53
|
-
The reply opens with `🔥 **LIT IGNITED · <discipline>**
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
54
|
+
The reply opens with `🔥 **LIT IGNITED · <discipline>** 🔥`, and from there the request is a goal with
|
|
55
|
+
checks. It counts as done once every check has passing evidence. The records live under
|
|
56
|
+
`.litcodex/lit-loop/` in your project, and `lit recap` reads them back. Before you leave, send
|
|
57
|
+
exact bare `handoff` and the next session gets a continuation packet to start from. When you need
|
|
58
|
+
publication plots, send the exact bare `lit-scientific-visualization` hook route; it loads the plotting
|
|
59
|
+
adapter and does not install Python dependencies.
|
|
58
60
|
|
|
59
61
|
## Skills
|
|
60
62
|
|
|
@@ -62,16 +64,16 @@ Pick any skill in the Codex skill picker or mention it by scoped name, such as `
|
|
|
62
64
|
`$litcodex:lit-fetch`, `$litcodex:lit-handoff` or `$litcodex:lit-scientific-visualization`. The
|
|
63
65
|
[skills page](https://github.com/wjgoarxiv/litcodex/blob/main/docs/skills.md) has a picture of each one.
|
|
64
66
|
|
|
65
|
-
-
|
|
67
|
+
- Loop and planning: `lit-loop` (`lit`), `litwork`, `lit-plan`, Start Work (`lit start work <approved-plan>`),
|
|
66
68
|
`litgoal`, `deep-interview`, `lit-crucible`, `lit-team`, `lit-recap` and `lit-handoff`.
|
|
67
|
-
-
|
|
69
|
+
- Review and research: `review-work`, `litresearch`, `autoresearch`, `autoconference`, `lit-fetch`,
|
|
68
70
|
`wikify`, `coding-session-audit` and `lit-comprehend`.
|
|
69
|
-
-
|
|
71
|
+
- Documents, figures and screens: `lit-docx`, `lit-pptx`, `lit-diagram-drawer`,
|
|
70
72
|
`lit-scientific-visualization`, `lit-typographic-motion`, `lit-humanizer`, `readme-studio`,
|
|
71
73
|
`frontend-ui-ux`, `visual-qa` and `browser-drive`.
|
|
72
|
-
-
|
|
74
|
+
- Code: `debugging`, `refactor`, `lit-code`, `lit-commit`, `lit-burnoff`, `lit-burnoff-file`,
|
|
73
75
|
`structural-search`, `lsp-setup` and `lit-init`.
|
|
74
|
-
-
|
|
76
|
+
- Upkeep: `litcodex-doctor`, `litcodex-report-bug` and `litcodex-contribute-bug-fix`. `rules`, `lsp`
|
|
75
77
|
and `comment-checker` run on their own.
|
|
76
78
|
|
|
77
79
|
## What it changes
|
|
@@ -79,22 +81,23 @@ Pick any skill in the Codex skill picker or mention it by scoped name, such as `
|
|
|
79
81
|
- Codex gets the plugin, hooks and agents, plus the managed keys in `~/.codex/config.toml`. Your unrelated
|
|
80
82
|
Codex settings stay as they are.
|
|
81
83
|
- Each project gets local records under `.litcodex/lit-loop/`, kept out of Git and packages.
|
|
82
|
-
- The doctor diagnostic core never modifies Codex config, install state or plugin state. An eligible
|
|
83
|
-
interactive doctor run (a successful one you start by hand) may show a cached advisory notice about a
|
|
84
|
-
newer version; a detached worker keeps it fresh with a fixed registry refresh saved at
|
|
85
|
-
`~/.litcodex/update-check.json`, and installs nothing. A separate foreground updater can install a newer
|
|
86
|
-
global package after an eligible interactive management command. Set `LITCODEX_NO_UPDATE_CHECK=1` to
|
|
87
|
-
turn off both. A doctor run that failed, or ran with `--json`, `--dry-run`, in a non-TTY or CI shell, or
|
|
88
|
-
with the opt-out set, stays side-effect-free.
|
|
89
84
|
- [Automatic handoff](https://github.com/wjgoarxiv/litcodex/blob/main/docs/auto-handoff.md) is optional and
|
|
90
85
|
off by default.
|
|
91
86
|
- Tests, fixtures, test helpers and the Vitest configuration live only in the repository. Neither the npm
|
|
92
87
|
package nor the installed marketplace plugin includes them.
|
|
93
88
|
|
|
89
|
+
LitCodex also keeps an eye on new releases. The doctor diagnostic core never modifies Codex config, install
|
|
90
|
+
state or plugin state. After an eligible interactive doctor run (a successful one you start by hand) it may
|
|
91
|
+
show a cached advisory notice about a newer version; a detached worker keeps that notice fresh with a fixed
|
|
92
|
+
registry refresh saved at `~/.litcodex/update-check.json`, and installs nothing. A separate foreground
|
|
93
|
+
updater can install a newer global package after an eligible interactive management command. If you would
|
|
94
|
+
rather have neither, set `LITCODEX_NO_UPDATE_CHECK=1`. A doctor run that failed, or ran with `--json`,
|
|
95
|
+
`--dry-run`, in a non-TTY or CI shell, or with the opt-out set, stays side-effect-free.
|
|
96
|
+
|
|
94
97
|
## Check, fix, remove
|
|
95
98
|
|
|
96
99
|
```sh
|
|
97
|
-
npm exec --yes --package @litfamily/litcodex@1.0.
|
|
100
|
+
npm exec --yes --package @litfamily/litcodex@1.0.28 -- litcodex doctor
|
|
98
101
|
```
|
|
99
102
|
|
|
100
103
|
`litcodex doctor` checks registration, hooks, config and host capabilities; `litcodex loop doctor` checks
|
|
@@ -102,7 +105,7 @@ the current project's loop state. If `lit` does nothing, run doctor and check th
|
|
|
102
105
|
in Codex. More fixes are under [troubleshooting](https://github.com/wjgoarxiv/litcodex#troubleshooting).
|
|
103
106
|
|
|
104
107
|
```sh
|
|
105
|
-
npm exec --yes --package @litfamily/litcodex@1.0.
|
|
108
|
+
npm exec --yes --package @litfamily/litcodex@1.0.28 -- litcodex uninstall
|
|
106
109
|
```
|
|
107
110
|
|
|
108
111
|
This removes the plugin and the config LitCodex manages, and leaves your other settings alone.
|
package/dist/cli.d.ts
CHANGED
|
@@ -17,7 +17,8 @@ export declare function dispatch(argv: readonly string[]): DispatchResult;
|
|
|
17
17
|
/**
|
|
18
18
|
* Async process entry used by `bin/litcodex.js`. It owns the side-effecting routes: install/doctor/
|
|
19
19
|
* uninstall (install/* modules, which are the ONLY code that ever spawns `codex`), `config migrate`
|
|
20
|
-
* (M13, in-process), and the bundled `@litcodex/lit-loop` runtime routes `loop`/`hook`.
|
|
21
|
-
*
|
|
20
|
+
* (M13, in-process), and the bundled `@litcodex/lit-loop` runtime routes `loop`/`hook`. `run` starts
|
|
21
|
+
* Codex itself from its own module (run.ts), only when the user asks for it. Returns the integer exit
|
|
22
|
+
* code; the bin owns `process.exit`. No forwarding, no harness.
|
|
22
23
|
*/
|
|
23
24
|
export declare function runCli(rawArgv: readonly string[]): Promise<number>;
|
package/dist/cli.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// Self-contained LitCodex CLI dispatcher. Side-effecting child processes remain
|
|
2
2
|
// behind dedicated modules; unknown routes return a plain usage error.
|
|
3
|
-
// `dispatch` is pure; `runCli` owns install/config/loop/hook process routes.
|
|
3
|
+
// `dispatch` is pure; `runCli` owns install/config/loop/hud/hook process routes.
|
|
4
4
|
import { createRequire } from "node:module";
|
|
5
5
|
import { runForegroundAutoUpdate } from "./auto-update.js";
|
|
6
6
|
import { readEffortChoice, readLeadModelChoice, readModelChoice, readSubagentEffortChoice, readSubagentModelChoice, } from "./cli-model-route.js";
|
|
@@ -68,6 +68,12 @@ const ROUTES = {
|
|
|
68
68
|
},
|
|
69
69
|
config: configRouteHandler,
|
|
70
70
|
loop: () => ok("litcodex loop\n"),
|
|
71
|
+
hud: () => ok("litcodex hud\n"),
|
|
72
|
+
statusline: () => ok(""),
|
|
73
|
+
run: () => ok("litcodex run\n"),
|
|
74
|
+
"screen-status": (rest) => rest.length === 1 && (rest[0] === "on" || rest[0] === "off" || rest[0] === "status")
|
|
75
|
+
? ok(`litcodex screen-status ${rest[0]}\n`)
|
|
76
|
+
: { stdout: "", stderr: "Usage: litcodex screen-status on|off|status\n", exitCode: 64 },
|
|
71
77
|
hook: () => ok("litcodex hook\n"),
|
|
72
78
|
};
|
|
73
79
|
/**
|
|
@@ -101,6 +107,10 @@ function renderHelp() {
|
|
|
101
107
|
" litcodex uninstall Remove LitCodex from Codex",
|
|
102
108
|
" litcodex config migrate Migrate Codex config for LitCodex",
|
|
103
109
|
" litcodex loop <sub> Run a Lit-Loop subcommand",
|
|
110
|
+
" litcodex hud [--session <id>] [--once] Watch the LIT card live from a second terminal window",
|
|
111
|
+
" litcodex screen-status on|off|status Colour the LIT card; terminal `codex` only (off by default)",
|
|
112
|
+
" litcodex statusline Print the newest LIT status as one line for a status line command",
|
|
113
|
+
" litcodex run [-- <codex args>] Run Codex with a live LIT panel in the bottom rows of this terminal",
|
|
104
114
|
" litcodex hook user-prompt-submit Run the UserPromptSubmit hook",
|
|
105
115
|
" litcodex --dry-run <command> Resolve a command without applying it",
|
|
106
116
|
" litcodex --help Show this help",
|
|
@@ -171,10 +181,17 @@ export function dispatch(argv) {
|
|
|
171
181
|
/**
|
|
172
182
|
* Async process entry used by `bin/litcodex.js`. It owns the side-effecting routes: install/doctor/
|
|
173
183
|
* uninstall (install/* modules, which are the ONLY code that ever spawns `codex`), `config migrate`
|
|
174
|
-
* (M13, in-process), and the bundled `@litcodex/lit-loop` runtime routes `loop`/`hook`.
|
|
175
|
-
*
|
|
184
|
+
* (M13, in-process), and the bundled `@litcodex/lit-loop` runtime routes `loop`/`hook`. `run` starts
|
|
185
|
+
* Codex itself from its own module (run.ts), only when the user asks for it. Returns the integer exit
|
|
186
|
+
* code; the bin owns `process.exit`. No forwarding, no harness.
|
|
176
187
|
*/
|
|
177
188
|
export async function runCli(rawArgv) {
|
|
189
|
+
// `run` passes everything after `--` to Codex untouched, so it is routed before any flag is read.
|
|
190
|
+
const split = rawArgv.indexOf("--");
|
|
191
|
+
const own = split < 0 ? rawArgv : rawArgv.slice(0, split);
|
|
192
|
+
if (own.find((token) => !token.startsWith("--dry-run")) === "run") {
|
|
193
|
+
return runRoute(own, split < 0 ? [] : rawArgv.slice(split + 1));
|
|
194
|
+
}
|
|
178
195
|
const normalized = normalizeDryRunValue(rawArgv);
|
|
179
196
|
if (typeof normalized === "string") {
|
|
180
197
|
process.stderr.write(`litcodex: ${normalized} is not a valid --dry-run; use --dry-run, --dry-run=true or --dry-run=false. Nothing was changed.\n`);
|
|
@@ -186,6 +203,26 @@ export async function runCli(rawArgv) {
|
|
|
186
203
|
const head = rest[0];
|
|
187
204
|
const isHelp = rest.includes("--help") || rest.includes("-h");
|
|
188
205
|
const isVersion = rest.includes("--version") || rest.includes("-v");
|
|
206
|
+
if (head === "hud") {
|
|
207
|
+
// Read-only, so a dry run is the real run; `hud --help` prints the command's own usage.
|
|
208
|
+
const { hudCommand } = await import("@litcodex/lit-loop/dist/hud-cli.js");
|
|
209
|
+
return hudCommand(rest.slice(1), { stdout: process.stdout, stderr: process.stderr, env: process.env });
|
|
210
|
+
}
|
|
211
|
+
if (head === "statusline" && !isHelp) {
|
|
212
|
+
// Read-only and always exit 0, so a dry run is the real run.
|
|
213
|
+
const { statuslineCommand } = await import("@litcodex/lit-loop/dist/statusline.js");
|
|
214
|
+
return statuslineCommand(rest.slice(1), { stdin: process.stdin, stdout: process.stdout, env: process.env });
|
|
215
|
+
}
|
|
216
|
+
if (head === "screen-status") {
|
|
217
|
+
const { screenStatusCommand } = await import("@litcodex/lit-loop/dist/screen-status.js");
|
|
218
|
+
const verb = rest[1];
|
|
219
|
+
if (dryRun && (verb === "on" || verb === "off") && rest.length === 2) {
|
|
220
|
+
return writeDryRun(`litcodex screen-status ${verb}`, [
|
|
221
|
+
`Write ${resolveCodexHome(process.env)}/litcodex/screen-status.json with the card colour ${verb}`,
|
|
222
|
+
]);
|
|
223
|
+
}
|
|
224
|
+
return screenStatusCommand(rest.slice(1), { stdout: process.stdout, stderr: process.stderr, env: process.env });
|
|
225
|
+
}
|
|
189
226
|
if (!isHelp && !isVersion) {
|
|
190
227
|
if (head === "config" && rest[1] === "migrate") {
|
|
191
228
|
const passthrough = dryRun ? [...rest.slice(2), "--dry-run"] : rest.slice(2);
|
|
@@ -296,6 +333,38 @@ export async function runCli(rawArgv) {
|
|
|
296
333
|
}
|
|
297
334
|
return exitCode;
|
|
298
335
|
}
|
|
336
|
+
/** `litcodex run [--dry-run] [--help] [-- <codex args>]`; Codex's own arguments go only after `--`. */
|
|
337
|
+
async function runRoute(own, codexArgs) {
|
|
338
|
+
const { findCodex, RUN_HELP_TEXT, runCommand } = await import("./run.js");
|
|
339
|
+
const normalized = normalizeDryRunValue(own);
|
|
340
|
+
if (typeof normalized === "string") {
|
|
341
|
+
process.stderr.write(`litcodex: ${normalized} is not a valid --dry-run; use --dry-run, --dry-run=true or --dry-run=false. Nothing was changed.\n`);
|
|
342
|
+
return USAGE_EXIT_CODE;
|
|
343
|
+
}
|
|
344
|
+
const dryRun = normalized.includes("--dry-run");
|
|
345
|
+
const flags = normalized.filter((token) => token !== "--dry-run").slice(1);
|
|
346
|
+
if (flags.includes("--help") || flags.includes("-h")) {
|
|
347
|
+
process.stdout.write(RUN_HELP_TEXT);
|
|
348
|
+
return 0;
|
|
349
|
+
}
|
|
350
|
+
if (flags.length > 0) {
|
|
351
|
+
process.stderr.write(`litcodex run: unknown option "${flags[0]}". Put Codex's own arguments after \`--\`.\n\n${RUN_HELP_TEXT}`);
|
|
352
|
+
return USAGE_EXIT_CODE;
|
|
353
|
+
}
|
|
354
|
+
if (dryRun) {
|
|
355
|
+
const command = [findCodex(process.env) ?? "codex", ...codexArgs].join(" ");
|
|
356
|
+
return writeDryRun("litcodex run", [
|
|
357
|
+
`Start ${command} in a pseudo-terminal four rows shorter and draw the LIT panel below it (writes no file)`,
|
|
358
|
+
]);
|
|
359
|
+
}
|
|
360
|
+
return runCommand(codexArgs, {
|
|
361
|
+
stdin: process.stdin,
|
|
362
|
+
stdout: process.stdout,
|
|
363
|
+
stderr: process.stderr,
|
|
364
|
+
env: process.env,
|
|
365
|
+
cwd: process.cwd(),
|
|
366
|
+
});
|
|
367
|
+
}
|
|
299
368
|
/** Loop subcommands that write project state; a `--dry-run` of these prints the step instead. */
|
|
300
369
|
const LOOP_WRITE_STEPS = {
|
|
301
370
|
create: "Derive goals and criteria from the brief and write the project's lit-loop plan and ledger",
|
|
@@ -224,7 +224,7 @@ export declare const FRONTEND_UIUX_PAYLOAD_HASHES: {
|
|
|
224
224
|
};
|
|
225
225
|
export declare const HUMANIZER_PAYLOAD_HASHES: {
|
|
226
226
|
readonly NOTICE: "f1587efda830c594a727d651da82265c565e178a4665eb7327c0c07f516673f0";
|
|
227
|
-
readonly "SKILL.md": "
|
|
227
|
+
readonly "SKILL.md": "f0d4f43efc9c9600586c16fc958f918e3f14e3ec34cd00cbe187cad1a3fcccc1";
|
|
228
228
|
readonly "always-on-rule.md": "1c0e1d9724f012f05142c69d06e8a8cc89596556cba2c8ff1438e99c7848a5cf";
|
|
229
229
|
readonly "assets/always-on-rule.md": "1c0e1d9724f012f05142c69d06e8a8cc89596556cba2c8ff1438e99c7848a5cf";
|
|
230
230
|
readonly "assets/report-skeleton.md": "c5a45b1b096babe24328ec18362e6909de911299a62ed1e1e4efe11c37293cb1";
|
|
@@ -285,7 +285,7 @@ export declare const HUMANIZER_PAYLOAD_HASHES: {
|
|
|
285
285
|
readonly "references/rewrite-playbook.md": "3b0bae2e24e9aada73ea527402e80c25a9bf471b65871248858496f1a2fe8ffb";
|
|
286
286
|
readonly "references/taxonomy.md": "f29d9543f32178764eb07c49461785c6d1bd346b9c3419ec271b6062a74f92f9";
|
|
287
287
|
readonly "rules.json": "ea2cc0aabafbdd9a94a60a29614cce8fba3ed9b813de0e4b5229f49b7356aaec";
|
|
288
|
-
readonly "scripts/core.mjs": "
|
|
288
|
+
readonly "scripts/core.mjs": "cd700c49bf00799bedc3563da0ee555018ea8c6eec92e3ef15b277041bf4f867";
|
|
289
289
|
readonly "scripts/detect.mjs": "183446709f861299d088af4587fafb808adf2094e08b82c2279c0b50cc39e872";
|
|
290
290
|
readonly "scripts/extract_office_text.py": "2badb7a32335d28c0dd029617ffe866c27053ef54b8951a40a14475b56633265";
|
|
291
291
|
readonly "scripts/ko-metrics.mjs": "5e53d6dfb212241fbcbddaa5d89cacfda61fa739616b4d1a3dd4d76268b0d871";
|
|
@@ -225,7 +225,7 @@ export const FRONTEND_UIUX_PAYLOAD_HASHES = {
|
|
|
225
225
|
};
|
|
226
226
|
export const HUMANIZER_PAYLOAD_HASHES = {
|
|
227
227
|
NOTICE: "f1587efda830c594a727d651da82265c565e178a4665eb7327c0c07f516673f0",
|
|
228
|
-
"SKILL.md": "
|
|
228
|
+
"SKILL.md": "f0d4f43efc9c9600586c16fc958f918e3f14e3ec34cd00cbe187cad1a3fcccc1",
|
|
229
229
|
"always-on-rule.md": "1c0e1d9724f012f05142c69d06e8a8cc89596556cba2c8ff1438e99c7848a5cf",
|
|
230
230
|
"assets/always-on-rule.md": "1c0e1d9724f012f05142c69d06e8a8cc89596556cba2c8ff1438e99c7848a5cf",
|
|
231
231
|
"assets/report-skeleton.md": "c5a45b1b096babe24328ec18362e6909de911299a62ed1e1e4efe11c37293cb1",
|
|
@@ -286,7 +286,7 @@ export const HUMANIZER_PAYLOAD_HASHES = {
|
|
|
286
286
|
"references/rewrite-playbook.md": "3b0bae2e24e9aada73ea527402e80c25a9bf471b65871248858496f1a2fe8ffb",
|
|
287
287
|
"references/taxonomy.md": "f29d9543f32178764eb07c49461785c6d1bd346b9c3419ec271b6062a74f92f9",
|
|
288
288
|
"rules.json": "ea2cc0aabafbdd9a94a60a29614cce8fba3ed9b813de0e4b5229f49b7356aaec",
|
|
289
|
-
"scripts/core.mjs": "
|
|
289
|
+
"scripts/core.mjs": "cd700c49bf00799bedc3563da0ee555018ea8c6eec92e3ef15b277041bf4f867",
|
|
290
290
|
"scripts/detect.mjs": "183446709f861299d088af4587fafb808adf2094e08b82c2279c0b50cc39e872",
|
|
291
291
|
"scripts/extract_office_text.py": "2badb7a32335d28c0dd029617ffe866c27053ef54b8951a40a14475b56633265",
|
|
292
292
|
"scripts/ko-metrics.mjs": "5e53d6dfb212241fbcbddaa5d89cacfda61fa739616b4d1a3dd4d76268b0d871",
|
package/dist/postinstall.js
CHANGED
|
@@ -2,11 +2,14 @@
|
|
|
2
2
|
//
|
|
3
3
|
// Prints a fire/ember-branded welcome + next-steps box ONLY on a real `npm install -g` (not CI,
|
|
4
4
|
// not workspace installs, not dev). A motion pre-warm is attempted from the installed marketplace;
|
|
5
|
-
// failure leaves the base package installed and names the explicit retry command.
|
|
5
|
+
// failure leaves the base package installed and names the explicit retry command. On every install,
|
|
6
|
+
// the macOS helper of the optional node-pty package gets its execute bit back (see below).
|
|
6
7
|
import { spawnSync } from "node:child_process";
|
|
7
8
|
import { existsSync } from "node:fs";
|
|
8
9
|
import { createRequire } from "node:module";
|
|
9
10
|
import { join } from "node:path";
|
|
11
|
+
import { fileURLToPath } from "node:url";
|
|
12
|
+
import { ensurePtyHelperExecutable } from "./pty-helper.js";
|
|
10
13
|
import { renderBanner, shouldDecorate } from "./ui.js";
|
|
11
14
|
function main() {
|
|
12
15
|
// Gate: only show on a real global install, not CI/workspace/dev.
|
|
@@ -39,6 +42,14 @@ function main() {
|
|
|
39
42
|
process.stdout.write(`${result.status === 0 && receipt ? receipt : "[litcodex] Motion runtime pre-warm unavailable; run `litcodex motion-runtime install` outside the sandbox."}\n`);
|
|
40
43
|
}
|
|
41
44
|
}
|
|
45
|
+
try {
|
|
46
|
+
// Only the node-pty under this package's own node_modules: one found further up belongs to someone else.
|
|
47
|
+
const installedAt = fileURLToPath(new URL("..", import.meta.url));
|
|
48
|
+
ensurePtyHelperExecutable(join(installedAt, "node_modules", "node-pty"), process.platform, installedAt);
|
|
49
|
+
}
|
|
50
|
+
catch {
|
|
51
|
+
// Never fail npm install; without the helper `litcodex run` names it in its note.
|
|
52
|
+
}
|
|
42
53
|
try {
|
|
43
54
|
main();
|
|
44
55
|
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Makes `<root>/prebuilds/<platform>-<arch>/spawn-helper` executable when it is not. With `within`, only a
|
|
3
|
+
* `root` under `<within>/node_modules/` is touched; a node-pty found anywhere else belongs to someone else.
|
|
4
|
+
* Returns null when the helper is fine, absent, not needed or not ours, else the path of a helper that
|
|
5
|
+
* stays not executable.
|
|
6
|
+
*/
|
|
7
|
+
export declare function ensurePtyHelperExecutable(root: string, platform?: NodeJS.Platform, within?: string): string | null;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
// node-pty 1.1.0 ships its macOS `spawn-helper` prebuild without the execute bit, so every pseudo-terminal
|
|
2
|
+
// then fails with `posix_spawnp failed`. `litcodex run` needs it, so the postinstall step (for the copy
|
|
3
|
+
// under this package's own node_modules) and the command itself (for the copy it loads, again only under this
|
|
4
|
+
// package's own node_modules) set it.
|
|
5
|
+
// A helper built from source, another platform, or a missing package is left alone.
|
|
6
|
+
import { accessSync, chmodSync, constants, statSync } from "node:fs";
|
|
7
|
+
import { join, resolve, sep } from "node:path";
|
|
8
|
+
/**
|
|
9
|
+
* Makes `<root>/prebuilds/<platform>-<arch>/spawn-helper` executable when it is not. With `within`, only a
|
|
10
|
+
* `root` under `<within>/node_modules/` is touched; a node-pty found anywhere else belongs to someone else.
|
|
11
|
+
* Returns null when the helper is fine, absent, not needed or not ours, else the path of a helper that
|
|
12
|
+
* stays not executable.
|
|
13
|
+
*/
|
|
14
|
+
export function ensurePtyHelperExecutable(root, platform = process.platform, within) {
|
|
15
|
+
if (platform !== "darwin")
|
|
16
|
+
return null;
|
|
17
|
+
if (within !== undefined && !resolve(root).startsWith(`${join(resolve(within), "node_modules")}${sep}`))
|
|
18
|
+
return null;
|
|
19
|
+
const helper = join(root, "prebuilds", `${platform}-${process.arch}`, "spawn-helper");
|
|
20
|
+
let mode;
|
|
21
|
+
try {
|
|
22
|
+
const stat = statSync(helper);
|
|
23
|
+
if (!stat.isFile())
|
|
24
|
+
return null;
|
|
25
|
+
mode = stat.mode;
|
|
26
|
+
}
|
|
27
|
+
catch {
|
|
28
|
+
return null;
|
|
29
|
+
}
|
|
30
|
+
try {
|
|
31
|
+
accessSync(helper, constants.X_OK);
|
|
32
|
+
return null;
|
|
33
|
+
}
|
|
34
|
+
catch {
|
|
35
|
+
// Not executable yet.
|
|
36
|
+
}
|
|
37
|
+
try {
|
|
38
|
+
chmodSync(helper, mode | 0o755);
|
|
39
|
+
accessSync(helper, constants.X_OK);
|
|
40
|
+
return null;
|
|
41
|
+
}
|
|
42
|
+
catch {
|
|
43
|
+
return helper;
|
|
44
|
+
}
|
|
45
|
+
}
|
package/dist/run.d.ts
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
export declare const RUN_HELP_TEXT = "litcodex run [-- <codex args>...]\n\nStart Codex with a live LIT panel in the bottom 4 rows of this terminal. Codex runs in a\npseudo-terminal 4 rows shorter, in this folder; the panel follows the newest LIT turn started\nhere: the route and its clock, the stage map, the running step and the open checklist row.\nEverything after `--` goes to Codex unchanged, and Codex's exit code is the command's.\n\nWithout the optional node-pty package, outside a terminal, or in a terminal smaller than\n40\u00D712, Codex runs as usual after a one-line note. The command writes no file.\n\nOptions:\n --help Show this help.\n";
|
|
2
|
+
/** The part of a node-pty child this command uses. */
|
|
3
|
+
export interface PtyProcess {
|
|
4
|
+
onData(listener: (data: Buffer | string) => void): unknown;
|
|
5
|
+
onExit(listener: (event: {
|
|
6
|
+
exitCode: number;
|
|
7
|
+
signal?: number;
|
|
8
|
+
}) => void): unknown;
|
|
9
|
+
write(data: string | Buffer): void;
|
|
10
|
+
resize(columns: number, rows: number): void;
|
|
11
|
+
kill(signal?: string): void;
|
|
12
|
+
}
|
|
13
|
+
export interface PtyModule {
|
|
14
|
+
spawn(file: string, args: string[], options: {
|
|
15
|
+
name: string;
|
|
16
|
+
cols: number;
|
|
17
|
+
rows: number;
|
|
18
|
+
cwd: string;
|
|
19
|
+
env: NodeJS.ProcessEnv;
|
|
20
|
+
encoding: null;
|
|
21
|
+
}): PtyProcess;
|
|
22
|
+
}
|
|
23
|
+
interface Events {
|
|
24
|
+
on(event: string, listener: (...args: unknown[]) => void): unknown;
|
|
25
|
+
removeListener(event: string, listener: (...args: unknown[]) => void): unknown;
|
|
26
|
+
}
|
|
27
|
+
export interface RunIo {
|
|
28
|
+
readonly stdin: Events & {
|
|
29
|
+
readonly isTTY?: boolean;
|
|
30
|
+
setRawMode?(mode: boolean): unknown;
|
|
31
|
+
resume(): unknown;
|
|
32
|
+
pause(): unknown;
|
|
33
|
+
};
|
|
34
|
+
readonly stdout: Events & {
|
|
35
|
+
readonly isTTY?: boolean;
|
|
36
|
+
readonly rows?: number;
|
|
37
|
+
readonly columns?: number;
|
|
38
|
+
write(data: string | Uint8Array): unknown;
|
|
39
|
+
};
|
|
40
|
+
readonly stderr: {
|
|
41
|
+
readonly isTTY?: boolean;
|
|
42
|
+
write(text: string): unknown;
|
|
43
|
+
};
|
|
44
|
+
readonly env: NodeJS.ProcessEnv;
|
|
45
|
+
readonly cwd: string;
|
|
46
|
+
/** Process signals and uncaught errors; a test passes its own emitter. */
|
|
47
|
+
readonly signals?: Events;
|
|
48
|
+
readonly now?: () => number;
|
|
49
|
+
/** node-pty; null when it is not installed or cannot load; a string saying why it cannot be used. */
|
|
50
|
+
readonly loadPty?: () => Promise<PtyModule | string | null>;
|
|
51
|
+
/** Runs Codex with this terminal and resolves its exit code. */
|
|
52
|
+
readonly runPlain?: (file: string, args: readonly string[], io: RunIo) => Promise<number>;
|
|
53
|
+
}
|
|
54
|
+
/** The `codex` executable on PATH, or null. */
|
|
55
|
+
export declare function findCodex(env: NodeJS.ProcessEnv): string | null;
|
|
56
|
+
export declare function runCommand(args: readonly string[], io: RunIo): Promise<number>;
|
|
57
|
+
export {};
|