project-librarian 0.4.0 → 0.4.2
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.md +49 -9
- package/README.md +44 -4
- package/dist/agent-surfaces.js +67 -0
- package/dist/args.js +94 -89
- package/dist/code-index/evidence.js +79 -0
- package/dist/code-index/extractors/config.js +58 -0
- package/dist/code-index/extractors/light-languages.js +52 -0
- package/dist/code-index/extractors/registry.js +137 -0
- package/dist/code-index/extractors/shared.js +36 -0
- package/dist/code-index/extractors/tree-sitter.js +319 -0
- package/dist/code-index/extractors/types.js +2 -0
- package/dist/code-index/extractors/typescript.js +211 -0
- package/dist/code-index/incremental.js +16 -0
- package/dist/code-index/index-health.js +164 -0
- package/dist/code-index/modes.js +309 -0
- package/dist/code-index/ownership.js +183 -0
- package/dist/code-index/reports.js +322 -0
- package/dist/code-index/schema.js +196 -0
- package/dist/code-index/search.js +153 -0
- package/dist/code-index-file-policy.js +21 -27
- package/dist/code-index.js +167 -1850
- package/dist/init-project-wiki.js +105 -66
- package/dist/install-skill.js +3 -3
- package/dist/mcp-server.js +60 -6
- package/dist/migration.js +10 -6
- package/dist/modes.js +121 -63
- package/dist/path-ignore-policy.js +30 -0
- package/dist/wiki-corpus.js +25 -0
- package/dist/wiki-diagnostics.js +19 -0
- package/dist/wiki-files.js +2 -1
- package/dist/wiki-graph.js +1 -2
- package/package.json +15 -3
package/README.ko.md
CHANGED
|
@@ -75,17 +75,19 @@ npm run benchmark:release:preview
|
|
|
75
75
|
npm run benchmark:release -- --allow-codex-run
|
|
76
76
|
```
|
|
77
77
|
|
|
78
|
+
실측 릴리스 실행은 stderr에 `[benchmark:progress]` 줄을 스트리밍하여 시나리오 수, 예상 Codex 실행 총량, 현재 실행 순번, 단계, 프롬프트 ID, 종료 상태, 경과 시간, 원시 JSONL 경로를 보여줍니다. stdout은 최종 JSON 결과 전용으로 유지됩니다.
|
|
79
|
+
|
|
78
80
|
### 위키 트랙 (계획 문서 라우팅)
|
|
79
81
|
|
|
80
82
|
비용 가중 토큰, Project Librarian 대 대조군:
|
|
81
83
|
|
|
82
84
|
| 규모 | decision_lookup | aggregation | multi_session (2번째 세션) |
|
|
83
85
|
| --- | --- | --- | --- |
|
|
84
|
-
| 소형 |
|
|
85
|
-
| 중형 |
|
|
86
|
-
| 대형 | 71.
|
|
86
|
+
| 소형 | 14.4% 적음 | 81.0% 많음 | 22.0% 적음 |
|
|
87
|
+
| 중형 | 52.0% 적음 | 19.0% 적음 | 54.1% 적음 |
|
|
88
|
+
| 대형 | 71.1% 적음 | 29.0% 적음 | 71.8% 적음 |
|
|
87
89
|
|
|
88
|
-
최신 합성 위키 트랙 릴리스 후보는 2026-06-
|
|
90
|
+
최신 합성 위키 트랙 릴리스 후보는 2026-06-19에 `gpt-5.5`로 측정했으며, 42개 시나리오를 각 3회 측정하고 1회 예열했습니다. 전체 주장 게이트는 **통과**했습니다. 42/42개 시나리오가 정확성 검사를 통과했고, 42개 시나리오가 모두 claimable이었으며, 모든 corpus 게이트가 3회 실행 최소 조건을 충족했습니다. 이 릴리스 주장은 여전히 합성 위키 라우팅 트랙과 표기된 작업 유형에 한정됩니다. 코드 그래프 동작, 실제 저장소, 모든 에이전트 표면, 모든 질문 형태에 대한 주장이 아닙니다. 숨기지 않는 한계도 그대로 남습니다. 소형 `aggregation`은 위키를 켰을 때 여전히 81.0% 비싸고, 전체 보고서의 소형 `release_policy`도 9.4% 비싸며, `aggregation`은 토큰 비용이 줄어드는 규모에서도 실행 시간은 매번 더 느립니다.
|
|
89
91
|
|
|
90
92
|
### 코드 그래프 트랙 (코드 근거 인덱스, 실제 저장소)
|
|
91
93
|
|
|
@@ -143,6 +145,8 @@ npx project-librarian install-skill --scope project --agents all
|
|
|
143
145
|
|
|
144
146
|
`--agents`는 `codex,claude,cursor,gemini`처럼 쉼표로 구분한 값도 받습니다. `all`은 지원하는 모든 에이전트를 대상으로 합니다. `--scope`는 `user` 또는 `project`를 받습니다.
|
|
145
147
|
|
|
148
|
+
프로젝트 설정/갱신 실행기도 `--agents`를 받습니다. 새로 설정할 때는 프로젝트 범위 Project Librarian 스킬 설치가 없을 때만 지원하는 모든 에이전트 표면을 기본으로 만듭니다. 저장소에 이미 `.codex/skills/project-librarian/`, `.claude/skills/project-librarian/` 같은 프로젝트 범위 스킬이 있으면 첫 설정도 그 설치된 에이전트 집합을 기본값으로 사용합니다. 마이그레이션 없는 기존 설정 갱신은 저장소에 이미 있는 에이전트 표면만 보존해서 갱신합니다. 따라서 Codex와 Claude 파일만 있던 저장소는 일반 갱신만으로 Cursor나 Gemini 파일이 새로 생기지 않습니다. 새 표면을 의도적으로 추가하려면 `project-librarian update --agents cursor` 또는 `project-librarian update --agents all`처럼 명시합니다. 목록에 없는 표면을 삭제하지는 않습니다.
|
|
149
|
+
|
|
146
150
|
## 실행 경로
|
|
147
151
|
|
|
148
152
|
이 경로들은 주로 에이전트와 자동화를 위한 참조입니다. 설치 후 에이전트는 `npx`가 아니라 설치된 로컬 복사본을 `node`로 실행해야 합니다. 이렇게 하면 제한된 에이전트 환경에서 네트워크 접근과 버전이 고정되지 않은 패키지 실행을 피할 수 있습니다.
|
|
@@ -168,6 +172,7 @@ npx project-librarian install-skill --scope project --agents all
|
|
|
168
172
|
| --- | --- | --- |
|
|
169
173
|
| 위키 생성 또는 갱신 | "Project Librarian으로 이 저장소의 계획 위키를 설정하거나 갱신해줘." | `[init]` |
|
|
170
174
|
| 마이그레이션 없이 기존 설정 갱신 | "위키를 마이그레이션하지 말고 이 저장소의 Project Librarian 설정을 갱신해줘." | `update` |
|
|
175
|
+
| 기존 설정에 특정 에이전트 표면 추가 | "위키 마이그레이션 없이 Cursor Project Librarian 표면을 추가해줘." | `update --agents cursor` |
|
|
171
176
|
| 기존 문서/위키 마이그레이션 | "Project Librarian으로 기존 docs/wiki 내용을 마이그레이션해줘." | `--migrate` |
|
|
172
177
|
| 생성된 설정 검증 | "Project Librarian 검증을 실행해줘." | `--lint` |
|
|
173
178
|
| 링크와 문서 품질 점검 | "Project Librarian 진단을 실행해줘." | `--doctor` |
|
|
@@ -188,6 +193,7 @@ npx project-librarian install-skill --scope project --agents all
|
|
|
188
193
|
| 증분 갱신 요구 | "Project Librarian 코드 근거 인덱스를 증분 갱신해줘." | `--code-index --incremental` |
|
|
189
194
|
| 전체 재생성 강제 | "Project Librarian 코드 근거 인덱스를 전체 재생성해줘." | `--code-index --code-index-full` |
|
|
190
195
|
| 선택적 Tree-sitter 백엔드 사용 | "Tree-sitter 파서로 Project Librarian 코드 근거를 만들어줘." | `--code-index --code-parser tree-sitter` |
|
|
196
|
+
| 캐시 호환성 진단 | "Project Librarian 코드 근거 캐시 상태와 호환성을 진단해줘." | `--code-index-health` |
|
|
191
197
|
| 캐시 상태 보기 | "Project Librarian 코드 근거 상태를 보여줘." | `--code-status` |
|
|
192
198
|
| 인덱싱된 파일 목록 | "Project Librarian 코드 근거에 인덱싱된 파일을 보여줘." | `--code-files` |
|
|
193
199
|
| 아키텍처/소유권 보고서 출력 | "Project Librarian 코드 보고서를 보여줘." | `--code-report` |
|
|
@@ -201,6 +207,8 @@ npx project-librarian install-skill --scope project --agents all
|
|
|
201
207
|
|
|
202
208
|
## 설치되는 파일
|
|
203
209
|
|
|
210
|
+
새로 설정할 때는 `--agents`로 좁히지 않았고 프로젝트 범위 Project Librarian 스킬 설치도 없을 때 아래 지원 에이전트 표면을 설치합니다. 마이그레이션 없는 기존 설정 갱신은 기본적으로 감지된 표면만 보존해서 갱신하고, 공통 위키/git 훅 파일은 계속 갱신합니다.
|
|
211
|
+
|
|
204
212
|
프로젝트 지침 파일:
|
|
205
213
|
|
|
206
214
|
- `AGENTS.md`
|
|
@@ -240,7 +248,7 @@ Git 훅 파일:
|
|
|
240
248
|
- `wiki/index.md`
|
|
241
249
|
- `wiki/meta/document-taxonomy.md`
|
|
242
250
|
|
|
243
|
-
`canonical/project-brief.md`, `canonical/open-questions.md`, `canonical/assumptions.md`, `canonical/risks.md`, ADR 템플릿처럼 실제 내용이 없는 빈 프로젝트 문서는 기본 생성하지 않습니다. 나중에 실제 내용이 생기면 문서를 만들고 `--refresh-index`로 라우팅할 수 있습니다. 마이그레이션 중 발견한 양식 전용
|
|
251
|
+
`canonical/project-brief.md`, `canonical/open-questions.md`, `canonical/assumptions.md`, `canonical/risks.md`, ADR 템플릿처럼 실제 내용이 없는 빈 프로젝트 문서는 기본 생성하지 않습니다. 나중에 실제 내용이 생기면 문서를 만들고 `--refresh-index`로 라우팅할 수 있습니다. 마이그레이션 중 발견한 양식 전용 기존 템플릿은 새 위키 페이지나 검토 행으로 만들지 않고 `wiki/migration/inventory.md`에 스킵 사유만 남깁니다.
|
|
244
252
|
|
|
245
253
|
MCP 서버 등록 (`mcpServers`에 기존 항목 보존하며 병합):
|
|
246
254
|
|
|
@@ -276,12 +284,12 @@ codex mcp add project-librarian -- node .codex/skills/project-librarian/dist/ini
|
|
|
276
284
|
6. `--refresh-index`는 새로 발견한 위키 페이지를 라우팅하며, route가 많으면 `wiki/indexes/auto-*.md` 범위별 라우터로 분리합니다.
|
|
277
285
|
7. `--code-index`는 `.project-wiki/` 아래 폐기 가능한 SQLite 근거 캐시를 만듭니다.
|
|
278
286
|
8. `--code-report`, `--code-impact`, `--code-context-pack`, `--code-search-symbol`, `--code-query`가 계획 갱신용 코드 근거를 제공합니다.
|
|
279
|
-
9. 읽기 전용 위키 소비자는 공통
|
|
280
|
-
10. 위키 생산자는 기존
|
|
281
|
-
11. `--wiki-visualize`는 데이터베이스나 서버를 추가하지 않고 기존 위키 그래프와
|
|
287
|
+
9. 읽기 전용 위키 소비자는 공통 개념 읽기 모델을 사용해 정본 위키 스키마를 다시 쓰지 않고 경로와 frontmatter에서 사용자용 페이지 유형을 파생합니다.
|
|
288
|
+
10. 위키 생산자는 기존 Markdown/YAML 정본 스키마를 계속 작성하고, 진단·MCP·시각화 같은 읽기 전용 소비자는 원본 문서를 바꾸지 않는 파생 보기를 사용합니다.
|
|
289
|
+
11. `--wiki-visualize`는 데이터베이스나 서버를 추가하지 않고 기존 위키 그래프와 개념 읽기 모델을 재사용해 `.project-wiki/` 아래 정적 그래프 산출물을 작성합니다.
|
|
282
290
|
12. 진단은 깨진 링크, 중복 route, 고아 페이지, 오래된 페이지, 누락된 TL;DR, 근거 누락, 마이그레이션 정책 위반을 보고합니다.
|
|
283
291
|
|
|
284
|
-
마이그레이션은 검토를 우선합니다. `--migrate`는 기존 `wiki/`를 `wiki_legacy*`로 보존하고, 양식 전용
|
|
292
|
+
마이그레이션은 검토를 우선합니다. `--migrate`는 기존 `wiki/`를 `wiki_legacy*`로 보존하고, 양식 전용 기존 파일은 제외한 뒤, 여러 성격의 내용이 섞인 기존 페이지를 의미 단위로 나눕니다. 이후 각 단위를 문서 분류 체계에 따라 분류해 `wiki/migration/` 아래 검토 파일을 작성합니다.
|
|
285
293
|
|
|
286
294
|
- `inventory.md`는 기존 마크다운 파일 목록과 파일 단위 분류를 기록합니다.
|
|
287
295
|
- `unit-map.md`는 각 제목, 문단, 목록 항목, 표 행, 코드 블록의 권장 분류 영역과 대상 페이지를 기록합니다.
|
|
@@ -351,6 +359,7 @@ node .codex/skills/project-librarian/dist/init-project-wiki.js install-skill [--
|
|
|
351
359
|
| `--review-migration`, `--semantic-migrate` | 마이그레이션 coverage와 수신함 상태를 마이그레이션 검토 파일에 동기화합니다. |
|
|
352
360
|
| `--no-git-config` | `git core.hooksPath`를 바꾸지 않고 훅 파일을 설치합니다. |
|
|
353
361
|
| `--code-index` | 폐기 가능한 코드 근거 인덱스를 빌드합니다. |
|
|
362
|
+
| `--code-index-health` | 코드 근거 캐시 호환성을 검사하고 쓰기 없이 재빌드 안내를 출력합니다. |
|
|
354
363
|
| `--code-report` | 근거 인덱스에서 아키텍처/소유권 요약을 출력합니다. |
|
|
355
364
|
| `--code-report-section <section>` | 한 섹션만 출력: `coverage`, `ownership`, `languages`, `parsers`, `workspaces`, `workspace-graph`, `routes`, `hotspots`, `configs`, `edges`. |
|
|
356
365
|
| `--code-impact <term>` | 파일, 심볼, route, import, edge, 소유자 영향 근거를 보여줍니다. |
|
|
@@ -367,13 +376,44 @@ npm install
|
|
|
367
376
|
npm run typecheck
|
|
368
377
|
npm run build
|
|
369
378
|
npm test
|
|
379
|
+
npm run test:coverage
|
|
380
|
+
npm run benchmark:llm:raw-audit
|
|
381
|
+
npm run benchmark:llm:delta-analysis
|
|
382
|
+
npm run benchmark:claim-ledger
|
|
383
|
+
npm run release:check
|
|
370
384
|
npm pack --dry-run
|
|
371
385
|
```
|
|
372
386
|
|
|
373
387
|
`src/` 아래 TypeScript를 수정할 때는 커밋 전에 빌드해 `dist/`를 최신 상태로 유지하세요.
|
|
374
388
|
|
|
389
|
+
`npm run test:coverage`는 Node 내장 test coverage에 보수적인 line, branch, function threshold를 적용하므로 coverage를 단순 보고서가 아니라 회귀 게이트로 사용합니다.
|
|
390
|
+
|
|
391
|
+
`npm run release:check`는 로컬 전용 관리자 게이트입니다. 테스트, Node 내장 coverage, 벤치마크 파서 smoke, real-corpus 오프라인 데모, 벤치마크 release preview, 벤치마크 claim ledger 분류, raw 보관 상태 감사, package dry-run 검사, dist 실행 가능 여부, README 벤치마크 claim 경계 문구를 확인합니다. publish하지 않고 raw 벤치마크 산출물을 삭제하지 않으며 measured Codex 벤치마크도 실행하지 않습니다.
|
|
392
|
+
|
|
393
|
+
`release:check` 통과는 런타임 보증이 아니라 재현 가능한 릴리스 준비 근거로 봐야 합니다. 현재 checkout에서 위 로컬 게이트를 통과했음을 증명하며, package dry run이 예상 publish 경계(`agents/`, `dist/`, `LICENSE`, `README.md`, `README.ko.md`, `SKILL.md`) 안에 머물고 소스 파일, 테스트, 저장소 로컬 위키/워크플로 상태, raw 벤치마크 출력, 로컬 캐시를 제외하는지도 확인합니다.
|
|
394
|
+
|
|
395
|
+
배포는 GitHub Release가 published 상태가 된 뒤 `.github/workflows/publish.yml`에서 처리합니다. 이 워크플로는 GitHub OIDC 기반 npm trusted publishing(`id-token: write`)과 `npm publish --access public`을 사용하므로 npm provenance가 자동 생성됩니다. `NODE_AUTH_TOKEN`이나 npm token secret을 쓰면 안 되며, 릴리스 핵심 GitHub 공식 Actions는 전체 commit SHA로 고정합니다. `release:check`는 이 워크플로 계약도 로컬에서 검사합니다.
|
|
396
|
+
|
|
397
|
+
trusted publishing과 npm provenance는 패키지가 이 GitHub OIDC 워크플로를 통해 게시되었음을 증명합니다. 벤치마크 정확성, 최종 사용자 저장소의 코드 근거 freshness, 보안 감사를 증명하지는 않으며, 그런 항목은 별도의 근거 트랙으로 다룹니다.
|
|
398
|
+
|
|
375
399
|
관리자 벤치마크 명령은 [benchmarks/README.md](benchmarks/README.md)에 있습니다. 이 명령은 릴리스 근거와 공개 주장 검증을 위한 것이며, 일반 사용자 설정 절차가 아닙니다.
|
|
376
400
|
|
|
401
|
+
코드 근거 런타임/스토리지 점검에는 `npm run perf:code-efficiency`를 사용합니다. 이 명령은 3k/10k/50k 픽스처를 생성하고 `benchmarks/reports/code-performance-efficiency/current.json`과 `.md`를 작성합니다. 명령 시간에는 CLI 시작과 freshness 확인이 포함되며, `query_groups` 섹션은 대표 file/symbol/route/import/edge 쿼리의 직접 DB 시간을 따로 보고합니다. 보고서는 `mixed-monorepo`, `web-service`, `python-cli`, `docs-heavy` 체크인 corpus도 합성 scale fixture와 분리해 측정합니다.
|
|
402
|
+
|
|
403
|
+
측정형 LLM 벤치마크 실행은 1일보다 오래된 이전 raw run 디렉터리와 격리 Codex home을 자동 삭제하고, claimable 실행 실패 시에도 현재 실행의 home을 삭제한 뒤 종료합니다. raw JSONL, stderr, 보고서, manifest는 보존 기간 안의 실행에 대해서만 감사용으로 유지됩니다. 무시된 오래된 raw 출력은 격리 Codex home을 삭제하기 전에 dry-run-first 헬퍼로 여전히 먼저 감사할 수 있습니다.
|
|
404
|
+
|
|
405
|
+
```bash
|
|
406
|
+
npm run benchmark:llm:raw-audit -- --older-than-days 14
|
|
407
|
+
npm run benchmark:llm:prune-raw -- --older-than-days 14
|
|
408
|
+
npm run benchmark:llm:prune-raw -- --older-than-days 14 --execute
|
|
409
|
+
```
|
|
410
|
+
|
|
411
|
+
`npm run benchmark:llm:delta-analysis`는 체크인된 measured LLM 보고서를 읽고 Codex를 실행하지 않은 채 cost-weighted regression을 순위화합니다. 대표 raw JSONL command trace와 broad-search/router-read driver 분류까지 보려면 `-- --include-traces`를 붙입니다. 작은 scale aggregation처럼 약한 셀을 새 공개 claim보다 먼저 진단하는 첫 경로입니다.
|
|
412
|
+
|
|
413
|
+
측정형 LLM 실행은 기본적으로 `--scenario-order run-major-balanced`를 사용합니다. 각 measured run index마다 선택된 모든 scenario를 실행하고 반복마다 순서를 뒤집어, 반복 실행에서 with/without 조건이 한쪽으로 몰리지 않게 합니다. 이전의 scenario별 묶음 실행 진단을 재현할 때만 `--scenario-order scenario-major`를 사용하세요.
|
|
414
|
+
|
|
415
|
+
`npm run typecheck:ts7`은 opt-in TypeScript 7 RC 호환성 probe입니다. `npx`를 사용하며, compiler API와 이 프로젝트 TypeScript extractor의 parity 기록이 생기기 전까지 `test`, `release:check`, CI 게이트 밖에 둡니다.
|
|
416
|
+
|
|
377
417
|
## 영감
|
|
378
418
|
|
|
379
419
|
이 프로젝트는 Andrej Karpathy의 [LLM Wiki](https://gist.github.com/karpathy/442a6bf555914893e9891c11519de94f) 패턴에서 영감을 받았습니다. 긴 대화 기록에서 프로젝트 상태를 재구성하는 대신, 지속되는 markdown 컨텍스트를 작업 가까이에 둡니다.
|
package/README.md
CHANGED
|
@@ -75,17 +75,19 @@ npm run benchmark:release:preview
|
|
|
75
75
|
npm run benchmark:release -- --allow-codex-run
|
|
76
76
|
```
|
|
77
77
|
|
|
78
|
+
Measured release runs stream `[benchmark:progress]` lines to stderr for the scenario count, expected Codex exec total, current exec ordinal, phase, prompt id, exit status, elapsed time, and raw JSONL path. stdout stays reserved for the final JSON result.
|
|
79
|
+
|
|
78
80
|
### Wiki track (planning-doc routing)
|
|
79
81
|
|
|
80
82
|
Cost-weighted tokens, Project Librarian vs control:
|
|
81
83
|
|
|
82
84
|
| Scale | decision_lookup | aggregation | multi_session (2nd session) |
|
|
83
85
|
| --- | --- | --- | --- |
|
|
84
|
-
| Small |
|
|
85
|
-
| Medium |
|
|
86
|
-
| Large | 71.
|
|
86
|
+
| Small | 14.4% less | 81.0% more | 22.0% less |
|
|
87
|
+
| Medium | 52.0% less | 19.0% less | 54.1% less |
|
|
88
|
+
| Large | 71.1% less | 29.0% less | 71.8% less |
|
|
87
89
|
|
|
88
|
-
Latest synthetic wiki-track release candidate: 2026-06-
|
|
90
|
+
Latest synthetic wiki-track release candidate: 2026-06-19, `gpt-5.5`, 42 scenarios, 3 measured runs plus 1 warmup each. The overall claim gate **passed**: 42/42 scenarios passed correctness, all 42 scenarios were claimable, and every corpus gate met the 3-run minimum. The release claim is still bounded to the synthetic wiki-routing track and the listed task families; it is not a claim about code-graph behavior, real repositories, every agent surface, or every question shape. Published boundaries remain visible: small `aggregation` still costs 81.0% more with the wiki, small `release_policy` costs 9.4% more in the full report, and `aggregation` stays slower at every scale even when token cost drops.
|
|
89
91
|
|
|
90
92
|
### Code-graph track (code evidence index, real repositories)
|
|
91
93
|
|
|
@@ -143,6 +145,8 @@ npx project-librarian install-skill --scope project --agents all
|
|
|
143
145
|
|
|
144
146
|
`--agents` also accepts comma-separated values such as `codex,claude,cursor,gemini`. `all` targets every supported agent. `--scope` accepts `user` or `project`.
|
|
145
147
|
|
|
148
|
+
The project setup/update runner also accepts `--agents`. Fresh setup defaults to all supported agent surfaces only when no project-scoped Project Librarian skill install is present. If the repository already has project-scoped skills such as `.codex/skills/project-librarian/` and `.claude/skills/project-librarian/`, the first setup uses that installed agent set by default. Existing non-migration updates preserve the agent surfaces already present in the repository, so a repo that has only Codex and Claude files will not gain Cursor or Gemini files on a plain update. Use `project-librarian update --agents cursor` or `project-librarian update --agents all` when you intentionally want to add newly supported surfaces; unlisted surfaces are not deleted.
|
|
149
|
+
|
|
146
150
|
## Runner Paths
|
|
147
151
|
|
|
148
152
|
These paths are mainly for agents and automation. After installation, agents should run the installed local copy with `node`, not `npx`. This avoids network access and unpinned package execution in restricted agent environments.
|
|
@@ -168,6 +172,7 @@ Wiki setup and maintenance:
|
|
|
168
172
|
| --- | --- | --- |
|
|
169
173
|
| Create or update the wiki | "Use Project Librarian to set up or update this repository's planning wiki." | `[init]` |
|
|
170
174
|
| Update existing setup without migration | "Update this repository's Project Librarian setup without migrating the wiki." | `update` |
|
|
175
|
+
| Add a specific agent surface to an existing setup | "Add the Cursor Project Librarian surface without migrating the wiki." | `update --agents cursor` |
|
|
171
176
|
| Migrate existing docs/wiki content | "Use Project Librarian to migrate the existing docs/wiki content." | `--migrate` |
|
|
172
177
|
| Validate generated setup | "Run Project Librarian validation." | `--lint` |
|
|
173
178
|
| Check links and document quality | "Run Project Librarian diagnostics." | `--doctor` |
|
|
@@ -188,6 +193,7 @@ Code evidence:
|
|
|
188
193
|
| Require incremental update | "Update the Project Librarian code evidence index incrementally." | `--code-index --incremental` |
|
|
189
194
|
| Force a full rebuild | "Fully rebuild the Project Librarian code evidence index." | `--code-index --code-index-full` |
|
|
190
195
|
| Use optional Tree-sitter backend | "Build Project Librarian code evidence with the Tree-sitter parser." | `--code-index --code-parser tree-sitter` |
|
|
196
|
+
| Inspect cache compatibility | "Inspect Project Librarian code evidence cache health." | `--code-index-health` |
|
|
191
197
|
| Show cache status | "Show Project Librarian code evidence status." | `--code-status` |
|
|
192
198
|
| List indexed files | "List files in the Project Librarian code evidence index." | `--code-files` |
|
|
193
199
|
| Print architecture and ownership report | "Show the Project Librarian code report." | `--code-report` |
|
|
@@ -201,6 +207,8 @@ Only one code evidence mode can run at a time. `--incremental`, `--code-index-fu
|
|
|
201
207
|
|
|
202
208
|
## What Gets Installed
|
|
203
209
|
|
|
210
|
+
Fresh setup installs the supported agent surfaces below unless you pass `--agents` or the repository already has project-scoped Project Librarian skills for a narrower agent set. Existing non-migration updates preserve the detected surface set by default and update only those selected surfaces plus the common wiki/git-hook files.
|
|
211
|
+
|
|
204
212
|
Project instruction files:
|
|
205
213
|
|
|
206
214
|
- `AGENTS.md`
|
|
@@ -351,6 +359,7 @@ Important options:
|
|
|
351
359
|
| `--review-migration`, `--semantic-migrate` | Sync migration coverage and inbox statuses into migration review files. |
|
|
352
360
|
| `--no-git-config` | Install hook files without changing `git core.hooksPath`. |
|
|
353
361
|
| `--code-index` | Build the disposable code evidence index. |
|
|
362
|
+
| `--code-index-health` | Inspect code evidence cache compatibility and print rebuild guidance without writing. |
|
|
354
363
|
| `--code-report` | Print architecture and ownership summaries from the evidence index. |
|
|
355
364
|
| `--code-report-section <section>` | Print one section: `coverage`, `ownership`, `languages`, `parsers`, `workspaces`, `workspace-graph`, `routes`, `hotspots`, `configs`, or `edges`. |
|
|
356
365
|
| `--code-impact <term>` | Show file, symbol, route, import, edge, and owner impact evidence. |
|
|
@@ -367,13 +376,44 @@ npm install
|
|
|
367
376
|
npm run typecheck
|
|
368
377
|
npm run build
|
|
369
378
|
npm test
|
|
379
|
+
npm run test:coverage
|
|
380
|
+
npm run benchmark:llm:raw-audit
|
|
381
|
+
npm run benchmark:llm:delta-analysis
|
|
382
|
+
npm run benchmark:claim-ledger
|
|
383
|
+
npm run release:check
|
|
370
384
|
npm pack --dry-run
|
|
371
385
|
```
|
|
372
386
|
|
|
373
387
|
When editing TypeScript under `src/`, rebuild before committing so `dist/` stays current.
|
|
374
388
|
|
|
389
|
+
`npm run test:coverage` uses Node's native test coverage with conservative line, branch, and function thresholds so coverage is a regression gate, not only a report.
|
|
390
|
+
|
|
391
|
+
`npm run release:check` is a local-only maintainer gate: it runs tests, native Node coverage, benchmark parser smoke, the real-corpus offline demo, benchmark release preview, benchmark claim-ledger classification, raw hygiene audit, package dry-run inspection, dist executable checks, and README benchmark-claim boundary checks. It never publishes, never deletes raw benchmark artifacts, and never launches a measured Codex benchmark.
|
|
392
|
+
|
|
393
|
+
Treat a green `release:check` as a reproducible release-readiness bundle, not a runtime guarantee: it proves those local gates on the current checkout, including that the package dry run stays inside the expected publish boundary (`agents/`, `dist/`, `LICENSE`, `README.md`, `README.ko.md`, and `SKILL.md`) and excludes source files, tests, repo-local wiki/workflow state, raw benchmark output, and local caches.
|
|
394
|
+
|
|
395
|
+
Publishing is handled by `.github/workflows/publish.yml` after a GitHub Release is published. The workflow uses npm trusted publishing through GitHub OIDC (`id-token: write`) and `npm publish --access public`, which generates npm provenance automatically; it must not use `NODE_AUTH_TOKEN` or npm token secrets, and release-critical first-party GitHub Actions are pinned to full commit SHAs. `release:check` verifies this workflow contract locally.
|
|
396
|
+
|
|
397
|
+
Trusted publishing and npm provenance prove the package was published through that GitHub OIDC workflow. They do not prove benchmark correctness, code-evidence freshness in an end-user repository, or a security audit; those remain separate evidence tracks.
|
|
398
|
+
|
|
375
399
|
Maintainer benchmark commands live in [benchmarks/README.md](benchmarks/README.md). They are for release evidence and public claim validation, not normal end-user setup.
|
|
376
400
|
|
|
401
|
+
For code-evidence runtime/storage checks, `npm run perf:code-efficiency` generates 3k/10k/50k fixtures and writes `benchmarks/reports/code-performance-efficiency/current.json` plus `.md`. Command timings include CLI startup and freshness checks; the `query_groups` section reports direct DB timings for representative file/symbol/route/import/edge queries. The report also measures checked-in `mixed-monorepo`, `web-service`, `python-cli`, and `docs-heavy` corpora separately from synthetic scale fixtures.
|
|
402
|
+
|
|
403
|
+
Measured LLM benchmark runs automatically prune stale prior raw run directories and isolated Codex homes older than 1 day, then prune the current run's homes even on claimable-run failure; raw JSONL, stderr, reports, and manifests remain for runs inside the retention window. Old ignored raw output can still be audited with the dry-run-first helper before deleting retained isolated Codex homes:
|
|
404
|
+
|
|
405
|
+
```bash
|
|
406
|
+
npm run benchmark:llm:raw-audit -- --older-than-days 14
|
|
407
|
+
npm run benchmark:llm:prune-raw -- --older-than-days 14
|
|
408
|
+
npm run benchmark:llm:prune-raw -- --older-than-days 14 --execute
|
|
409
|
+
```
|
|
410
|
+
|
|
411
|
+
`npm run benchmark:llm:delta-analysis` reads the checked-in measured LLM report and ranks cost-weighted regressions without launching Codex. Add `-- --include-traces` to include representative raw JSONL command traces and classify broad-search/router-read drivers. It is the first diagnostic stop for weak cells such as small-scale aggregation before adding new benchmark claims.
|
|
412
|
+
|
|
413
|
+
Measured LLM runs default to `--scenario-order run-major-balanced`: each measured run index executes all selected scenarios, reversing the order on alternating repetitions so with/without pairs are not grouped by condition across repeated runs. Use `--scenario-order scenario-major` only when reproducing older scenario-grouped diagnostics.
|
|
414
|
+
|
|
415
|
+
`npm run typecheck:ts7` is an opt-in TypeScript 7 RC compatibility probe. It uses `npx` and is intentionally outside `test`, `release:check`, and CI gates until the compiler API and this project's TypeScript extractor have a measured parity record.
|
|
416
|
+
|
|
377
417
|
## Inspiration
|
|
378
418
|
|
|
379
419
|
This project is inspired by Andrej Karpathy's [LLM Wiki](https://gist.github.com/karpathy/442a6bf555914893e9891c11519de94f) pattern: keep persistent markdown context close to the work instead of reconstructing project state from long chat history.
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.agentSurfaceRequiredFiles = exports.allAgentSurfaces = void 0;
|
|
4
|
+
exports.parseAgentSurfaceValues = parseAgentSurfaceValues;
|
|
5
|
+
exports.hasProjectLibrarianInstall = hasProjectLibrarianInstall;
|
|
6
|
+
exports.activeAgentSurfaces = activeAgentSurfaces;
|
|
7
|
+
exports.resolveBootstrapAgentSurfaces = resolveBootstrapAgentSurfaces;
|
|
8
|
+
exports.includesAgentSurface = includesAgentSurface;
|
|
9
|
+
exports.allAgentSurfaces = ["codex", "claude", "cursor", "gemini"];
|
|
10
|
+
exports.agentSurfaceRequiredFiles = {
|
|
11
|
+
codex: [".codex/hooks/wiki-session-start.js", ".codex/hooks.json"],
|
|
12
|
+
claude: ["CLAUDE.md", ".claude/hooks/wiki-session-start.js", ".claude/settings.json"],
|
|
13
|
+
cursor: [".cursor/rules/project-librarian.mdc", ".cursor/hooks/wiki-session-start.js", ".cursor/hooks.json"],
|
|
14
|
+
gemini: ["GEMINI.md", ".gemini/hooks/wiki-session-start.js", ".gemini/settings.json"],
|
|
15
|
+
};
|
|
16
|
+
const agentSurfaceProjectSkillFiles = {
|
|
17
|
+
codex: [".codex/skills/project-librarian/SKILL.md"],
|
|
18
|
+
claude: [".claude/skills/project-librarian/SKILL.md"],
|
|
19
|
+
cursor: [".cursor/skills/project-librarian/SKILL.md"],
|
|
20
|
+
gemini: [".gemini/skills/project-librarian/SKILL.md"],
|
|
21
|
+
};
|
|
22
|
+
const projectLibrarianCommonInstallFiles = [
|
|
23
|
+
"wiki/startup.md",
|
|
24
|
+
"wiki/index.md",
|
|
25
|
+
"wiki/AGENTS.md",
|
|
26
|
+
];
|
|
27
|
+
function parseAgentSurfaceValues(values) {
|
|
28
|
+
const surfaces = new Set();
|
|
29
|
+
const invalid = [];
|
|
30
|
+
for (const value of values) {
|
|
31
|
+
if (value === "all") {
|
|
32
|
+
for (const surface of exports.allAgentSurfaces)
|
|
33
|
+
surfaces.add(surface);
|
|
34
|
+
}
|
|
35
|
+
else if (exports.allAgentSurfaces.includes(value)) {
|
|
36
|
+
surfaces.add(value);
|
|
37
|
+
}
|
|
38
|
+
else {
|
|
39
|
+
invalid.push(value);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
return { surfaces: Array.from(surfaces), invalid };
|
|
43
|
+
}
|
|
44
|
+
function hasProjectLibrarianInstall(fileExists, readFile) {
|
|
45
|
+
if (projectLibrarianCommonInstallFiles.some((file) => fileExists(file)))
|
|
46
|
+
return true;
|
|
47
|
+
if (exports.allAgentSurfaces.some((surface) => agentSurfaceProjectSkillFiles[surface].some((file) => fileExists(file))))
|
|
48
|
+
return true;
|
|
49
|
+
if (fileExists("AGENTS.md") && readFile) {
|
|
50
|
+
return readFile("AGENTS.md").includes("PROJECT-WIKI-FIRST:START");
|
|
51
|
+
}
|
|
52
|
+
return false;
|
|
53
|
+
}
|
|
54
|
+
function activeAgentSurfaces(fileExists) {
|
|
55
|
+
return exports.allAgentSurfaces.filter((surface) => (exports.agentSurfaceRequiredFiles[surface].some((file) => fileExists(file))
|
|
56
|
+
|| agentSurfaceProjectSkillFiles[surface].some((file) => fileExists(file))));
|
|
57
|
+
}
|
|
58
|
+
function resolveBootstrapAgentSurfaces(explicitSurfaces, fileExists, readFile) {
|
|
59
|
+
if (explicitSurfaces.length > 0)
|
|
60
|
+
return Array.from(explicitSurfaces);
|
|
61
|
+
if (hasProjectLibrarianInstall(fileExists, readFile))
|
|
62
|
+
return activeAgentSurfaces(fileExists);
|
|
63
|
+
return Array.from(exports.allAgentSurfaces);
|
|
64
|
+
}
|
|
65
|
+
function includesAgentSurface(surfaces, surface) {
|
|
66
|
+
return surfaces.includes(surface);
|
|
67
|
+
}
|
package/dist/args.js
CHANGED
|
@@ -1,79 +1,74 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
exports.issueDraftTitle = exports.issueBodyFile = exports.captureCategory = exports.captureContent = exports.captureTitle = exports.codeIndexScopes = exports.codeParser = void 0;
|
|
3
|
+
exports.codeQuerySql = exports.codeImpactTarget = exports.codeContextPackTarget = exports.wikiVisualizeOutput = exports.wikiVisualizeMode = exports.wikiImpactTarget = exports.wikiImpactMode = exports.queryTerm = exports.codeSearchSymbolMode = exports.codeQueryMode = exports.codeImpactMode = exports.codeParserMode = exports.codeContextPackMode = exports.codeFilesMode = exports.codeStatusMode = exports.codeReportMode = exports.codeIndexHealthMode = exports.codeIndexFullMode = exports.codeIndexIncrementalMode = exports.codeIndexMode = exports.acknowledgeSmallRepoMode = exports.noGitConfigMode = exports.reviewMigrationMode = exports.pruneCheckMode = exports.captureInboxMode = exports.refreshIndexMode = exports.issueDraftMode = exports.issueCreateMode = exports.glossaryMode = exports.fixMode = exports.doctorMode = exports.qualityCheckMode = exports.linkCheckMode = exports.migrationQualityCheckMode = exports.migrationLintMode = exports.migrationDoctorMode = exports.lintMode = exports.migrateMode = exports.invalidAgentTargets = exports.missingValueOptions = exports.unexpectedValueOptions = exports.unknownOptions = exports.args = exports.commandArgs = exports.command = exports.unknownCommand = exports.helpMode = exports.agentTargets = exports.parsedArgs = exports.rawArgs = void 0;
|
|
4
|
+
exports.issueDraftTitle = exports.issueBodyFile = exports.captureCategory = exports.captureContent = exports.captureTitle = exports.codeIndexScopes = exports.codeParser = exports.codeIndexOutput = exports.codeSearchSymbol = exports.codeReportSection = void 0;
|
|
5
5
|
exports.parseArgs = parseArgs;
|
|
6
6
|
exports.argValue = argValue;
|
|
7
7
|
exports.argValues = argValues;
|
|
8
|
+
const agent_surfaces_1 = require("./agent-surfaces");
|
|
8
9
|
exports.rawArgs = process.argv.slice(2);
|
|
9
10
|
const knownCommands = new Set(["init", "update", "install-skill", "mcp"]);
|
|
10
|
-
const
|
|
11
|
-
"--acknowledge-small-repo",
|
|
12
|
-
"--adopt-existing",
|
|
13
|
-
"--
|
|
14
|
-
"--
|
|
15
|
-
"--
|
|
16
|
-
"--code-evidence-
|
|
17
|
-
"--code-files",
|
|
18
|
-
"--code-
|
|
19
|
-
"--code-index",
|
|
20
|
-
"--code-index-full",
|
|
21
|
-
"--code-index-
|
|
22
|
-
"--code-evidence-index-
|
|
23
|
-
"--code-
|
|
24
|
-
"--code-
|
|
25
|
-
"--code-
|
|
26
|
-
"--code-evidence-report",
|
|
27
|
-
"--
|
|
28
|
-
"--
|
|
29
|
-
"--
|
|
30
|
-
"--
|
|
31
|
-
"--
|
|
32
|
-
"--
|
|
33
|
-
"--
|
|
34
|
-
"--
|
|
35
|
-
"--
|
|
36
|
-
"--
|
|
37
|
-
"--
|
|
38
|
-
"--
|
|
39
|
-
"--
|
|
40
|
-
"--
|
|
41
|
-
"--
|
|
42
|
-
"--
|
|
43
|
-
"--
|
|
44
|
-
"--
|
|
45
|
-
"--
|
|
46
|
-
"--
|
|
47
|
-
"--
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
"--
|
|
51
|
-
"--
|
|
52
|
-
"--
|
|
53
|
-
"--
|
|
54
|
-
"--
|
|
55
|
-
"--
|
|
56
|
-
"--
|
|
57
|
-
"--
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
"--query",
|
|
72
|
-
"--scope",
|
|
73
|
-
"--title",
|
|
74
|
-
"--wiki-impact",
|
|
75
|
-
"--wiki-visualize-out",
|
|
76
|
-
]);
|
|
11
|
+
const flagDefinitions = [
|
|
12
|
+
{ name: "--acknowledge-small-repo", value: "none" },
|
|
13
|
+
{ name: "--adopt-existing", value: "none" },
|
|
14
|
+
{ name: "--agents", value: "value" },
|
|
15
|
+
{ name: "--capture-inbox", value: "none" },
|
|
16
|
+
{ name: "--category", value: "value" },
|
|
17
|
+
{ name: "--code-context-pack", value: "value", aliases: ["--code-evidence-context-pack"] },
|
|
18
|
+
{ name: "--code-files", value: "none", aliases: ["--code-evidence-files"] },
|
|
19
|
+
{ name: "--code-impact", value: "value", aliases: ["--code-evidence-impact"] },
|
|
20
|
+
{ name: "--code-index", value: "none", aliases: ["--code-evidence-index"] },
|
|
21
|
+
{ name: "--code-index-full", value: "none", aliases: ["--code-evidence-index-full"] },
|
|
22
|
+
{ name: "--code-index-health", value: "none" },
|
|
23
|
+
{ name: "--code-index-incremental", value: "none", aliases: ["--incremental", "--code-incremental", "--code-evidence-index-incremental"] },
|
|
24
|
+
{ name: "--code-index-out", value: "value", aliases: ["--code-evidence-out"] },
|
|
25
|
+
{ name: "--code-parser", value: "value", aliases: ["--code-evidence-parser"] },
|
|
26
|
+
{ name: "--code-query", value: "value", aliases: ["--code-evidence-query"] },
|
|
27
|
+
{ name: "--code-report", value: "none", aliases: ["--code-evidence-report"] },
|
|
28
|
+
{ name: "--code-report-section", value: "value", aliases: ["--code-evidence-report-section"] },
|
|
29
|
+
{ name: "--code-scope", value: "value", aliases: ["--code-evidence-scope"] },
|
|
30
|
+
{ name: "--code-search-symbol", value: "value", aliases: ["--code-evidence-symbol"] },
|
|
31
|
+
{ name: "--code-status", value: "none", aliases: ["--code-evidence-status"] },
|
|
32
|
+
{ name: "--content", value: "value" },
|
|
33
|
+
{ name: "--doctor", value: "none" },
|
|
34
|
+
{ name: "--dry-run", value: "none" },
|
|
35
|
+
{ name: "--fix", value: "none" },
|
|
36
|
+
{ name: "--glossary-init", value: "none" },
|
|
37
|
+
{ name: "--issue-body-file", value: "value" },
|
|
38
|
+
{ name: "--issue-create", value: "none" },
|
|
39
|
+
{ name: "--issue-draft", value: "none" },
|
|
40
|
+
{ name: "--issue-title", value: "value" },
|
|
41
|
+
{ name: "--link-check", value: "none" },
|
|
42
|
+
{ name: "--lint", value: "none" },
|
|
43
|
+
{ name: "--migrate", value: "none" },
|
|
44
|
+
{ name: "--migration-doctor", value: "none" },
|
|
45
|
+
{ name: "--migration-lint", value: "none" },
|
|
46
|
+
{ name: "--migration-quality-check", value: "none" },
|
|
47
|
+
{ name: "--no-git-config", value: "none" },
|
|
48
|
+
{ name: "--prune-check", value: "none" },
|
|
49
|
+
{ name: "--quality-check", value: "none" },
|
|
50
|
+
{ name: "--query", value: "value" },
|
|
51
|
+
{ name: "--refresh-index", value: "none" },
|
|
52
|
+
{ name: "--review-migration", value: "none", aliases: ["--semantic-migrate"] },
|
|
53
|
+
{ name: "--scope", value: "value" },
|
|
54
|
+
{ name: "--title", value: "value" },
|
|
55
|
+
{ name: "--wiki-graph-html", value: "none" },
|
|
56
|
+
{ name: "--wiki-impact", value: "value" },
|
|
57
|
+
{ name: "--wiki-visualize", value: "none" },
|
|
58
|
+
{ name: "--wiki-visualize-out", value: "value" },
|
|
59
|
+
];
|
|
60
|
+
function definitionNames(definition) {
|
|
61
|
+
return [definition.name, ...(definition.aliases ?? [])];
|
|
62
|
+
}
|
|
63
|
+
function flagNamesByPolicy(value) {
|
|
64
|
+
return flagDefinitions.filter((definition) => definition.value === value).flatMap(definitionNames);
|
|
65
|
+
}
|
|
66
|
+
function namesForFlag(name) {
|
|
67
|
+
const definition = flagDefinitions.find((candidate) => definitionNames(candidate).includes(name));
|
|
68
|
+
return definition ? definitionNames(definition) : [name];
|
|
69
|
+
}
|
|
70
|
+
const flagsWithoutValues = new Set(flagNamesByPolicy("none"));
|
|
71
|
+
const flagsWithValues = new Set(flagNamesByPolicy("value"));
|
|
77
72
|
const knownFlags = new Set([...flagsWithoutValues, ...flagsWithValues, "--help", "-h"]);
|
|
78
73
|
function flagName(arg) {
|
|
79
74
|
return arg.startsWith("--") ? arg.split("=", 1)[0] ?? arg : arg;
|
|
@@ -134,36 +129,42 @@ function parseArgs(argv) {
|
|
|
134
129
|
const hasFlag = (name) => hasFlagIn(commandArgs, name);
|
|
135
130
|
const argValue = (name) => argValueFrom(commandArgs, name);
|
|
136
131
|
const argValues = (name) => argValuesFrom(commandArgs, name);
|
|
137
|
-
const
|
|
138
|
-
const
|
|
139
|
-
const
|
|
140
|
-
const
|
|
132
|
+
const hasAnyFlag = (name) => namesForFlag(name).some(hasFlag);
|
|
133
|
+
const argValueFromAny = (name) => namesForFlag(name).map(argValue).find(Boolean) ?? "";
|
|
134
|
+
const argValuesFromAny = (name) => namesForFlag(name).flatMap(argValues);
|
|
135
|
+
const codeImpactTarget = argValueFromAny("--code-impact");
|
|
136
|
+
const codeContextPackTarget = argValueFromAny("--code-context-pack");
|
|
137
|
+
const codeQuerySql = argValueFromAny("--code-query");
|
|
138
|
+
const codeSearchSymbol = argValueFromAny("--code-search-symbol");
|
|
139
|
+
const parsedAgentTargets = (0, agent_surfaces_1.parseAgentSurfaceValues)(argValues("--agents"));
|
|
141
140
|
return {
|
|
142
141
|
acknowledgeSmallRepoMode: args.has("--acknowledge-small-repo"),
|
|
142
|
+
agentTargets: parsedAgentTargets.surfaces,
|
|
143
143
|
args,
|
|
144
144
|
captureCategory: argValue("--category") || "project-candidate",
|
|
145
145
|
captureContent: argValue("--content"),
|
|
146
146
|
captureInboxMode: args.has("--capture-inbox"),
|
|
147
147
|
captureTitle: argValue("--title"),
|
|
148
|
-
codeContextPackMode:
|
|
148
|
+
codeContextPackMode: hasAnyFlag("--code-context-pack"),
|
|
149
149
|
codeContextPackTarget,
|
|
150
|
-
codeFilesMode:
|
|
151
|
-
codeImpactMode:
|
|
150
|
+
codeFilesMode: hasAnyFlag("--code-files"),
|
|
151
|
+
codeImpactMode: hasAnyFlag("--code-impact"),
|
|
152
152
|
codeImpactTarget,
|
|
153
|
-
codeIndexFullMode:
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
153
|
+
codeIndexFullMode: hasAnyFlag("--code-index-full"),
|
|
154
|
+
codeIndexHealthMode: args.has("--code-index-health"),
|
|
155
|
+
codeIndexIncrementalMode: hasAnyFlag("--code-index-incremental"),
|
|
156
|
+
codeIndexMode: hasAnyFlag("--code-index"),
|
|
157
|
+
codeIndexOutput: argValueFromAny("--code-index-out") || ".project-wiki/code-evidence.sqlite",
|
|
158
|
+
codeIndexScopes: argValuesFromAny("--code-scope"),
|
|
159
|
+
codeParser: argValueFromAny("--code-parser") || "default",
|
|
160
|
+
codeParserMode: hasAnyFlag("--code-parser"),
|
|
161
|
+
codeQueryMode: hasAnyFlag("--code-query"),
|
|
161
162
|
codeQuerySql,
|
|
162
|
-
codeReportMode:
|
|
163
|
-
codeReportSection:
|
|
163
|
+
codeReportMode: hasAnyFlag("--code-report"),
|
|
164
|
+
codeReportSection: argValueFromAny("--code-report-section"),
|
|
164
165
|
codeSearchSymbol,
|
|
165
|
-
codeSearchSymbolMode:
|
|
166
|
-
codeStatusMode:
|
|
166
|
+
codeSearchSymbolMode: hasAnyFlag("--code-search-symbol"),
|
|
167
|
+
codeStatusMode: hasAnyFlag("--code-status"),
|
|
167
168
|
command,
|
|
168
169
|
commandArgs,
|
|
169
170
|
doctorMode: args.has("--doctor"),
|
|
@@ -174,6 +175,7 @@ function parseArgs(argv) {
|
|
|
174
175
|
issueCreateMode: args.has("--issue-create"),
|
|
175
176
|
issueDraftMode: args.has("--issue-draft"),
|
|
176
177
|
issueDraftTitle: argValue("--issue-title"),
|
|
178
|
+
invalidAgentTargets: parsedAgentTargets.invalid,
|
|
177
179
|
linkCheckMode: args.has("--link-check"),
|
|
178
180
|
lintMode: args.has("--lint"),
|
|
179
181
|
migrationDoctorMode: args.has("--migration-doctor"),
|
|
@@ -187,7 +189,7 @@ function parseArgs(argv) {
|
|
|
187
189
|
queryTerm: argValue("--query"),
|
|
188
190
|
rawArgs: argv,
|
|
189
191
|
refreshIndexMode: args.has("--refresh-index"),
|
|
190
|
-
reviewMigrationMode:
|
|
192
|
+
reviewMigrationMode: hasAnyFlag("--review-migration"),
|
|
191
193
|
unexpectedValueOptions: Array.from(new Set(commandArgs
|
|
192
194
|
.filter((arg) => arg.startsWith("--") && arg.includes("="))
|
|
193
195
|
.map(flagName)
|
|
@@ -204,6 +206,7 @@ function parseArgs(argv) {
|
|
|
204
206
|
};
|
|
205
207
|
}
|
|
206
208
|
exports.parsedArgs = parseArgs(exports.rawArgs);
|
|
209
|
+
exports.agentTargets = exports.parsedArgs.agentTargets;
|
|
207
210
|
exports.helpMode = exports.parsedArgs.helpMode;
|
|
208
211
|
exports.unknownCommand = exports.parsedArgs.unknownCommand;
|
|
209
212
|
exports.command = exports.parsedArgs.command;
|
|
@@ -212,6 +215,7 @@ exports.args = exports.parsedArgs.args;
|
|
|
212
215
|
exports.unknownOptions = exports.parsedArgs.unknownOptions;
|
|
213
216
|
exports.unexpectedValueOptions = exports.parsedArgs.unexpectedValueOptions;
|
|
214
217
|
exports.missingValueOptions = exports.parsedArgs.missingValueOptions;
|
|
218
|
+
exports.invalidAgentTargets = exports.parsedArgs.invalidAgentTargets;
|
|
215
219
|
exports.migrateMode = exports.parsedArgs.migrateMode;
|
|
216
220
|
exports.lintMode = exports.parsedArgs.lintMode;
|
|
217
221
|
exports.migrationDoctorMode = exports.parsedArgs.migrationDoctorMode;
|
|
@@ -233,6 +237,7 @@ exports.acknowledgeSmallRepoMode = exports.parsedArgs.acknowledgeSmallRepoMode;
|
|
|
233
237
|
exports.codeIndexMode = exports.parsedArgs.codeIndexMode;
|
|
234
238
|
exports.codeIndexIncrementalMode = exports.parsedArgs.codeIndexIncrementalMode;
|
|
235
239
|
exports.codeIndexFullMode = exports.parsedArgs.codeIndexFullMode;
|
|
240
|
+
exports.codeIndexHealthMode = exports.parsedArgs.codeIndexHealthMode;
|
|
236
241
|
exports.codeReportMode = exports.parsedArgs.codeReportMode;
|
|
237
242
|
exports.codeStatusMode = exports.parsedArgs.codeStatusMode;
|
|
238
243
|
exports.codeFilesMode = exports.parsedArgs.codeFilesMode;
|