ctxr-cli 0.20.0 → 0.21.0

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.
Files changed (110) hide show
  1. package/README.md +55 -16
  2. package/dist/adapters/builtin/index.d.ts.map +1 -1
  3. package/dist/adapters/builtin/index.js +8 -1
  4. package/dist/adapters/builtin/index.js.map +1 -1
  5. package/dist/adapters/harness/antigravity.d.ts +18 -0
  6. package/dist/adapters/harness/antigravity.d.ts.map +1 -0
  7. package/dist/adapters/harness/antigravity.js +24 -0
  8. package/dist/adapters/harness/antigravity.js.map +1 -0
  9. package/dist/adapters/harness/codex.d.ts +22 -0
  10. package/dist/adapters/harness/codex.d.ts.map +1 -0
  11. package/dist/adapters/harness/codex.js +28 -0
  12. package/dist/adapters/harness/codex.js.map +1 -0
  13. package/dist/adapters/types.d.ts +9 -0
  14. package/dist/adapters/types.d.ts.map +1 -1
  15. package/dist/commands/adapters-generate.d.ts +2 -14
  16. package/dist/commands/adapters-generate.d.ts.map +1 -1
  17. package/dist/commands/adapters-generate.js +2 -50
  18. package/dist/commands/adapters-generate.js.map +1 -1
  19. package/dist/commands/ingest.d.ts.map +1 -1
  20. package/dist/commands/ingest.js +13 -1
  21. package/dist/commands/ingest.js.map +1 -1
  22. package/dist/commands/init.d.ts +2 -0
  23. package/dist/commands/init.d.ts.map +1 -1
  24. package/dist/commands/init.js +32 -3
  25. package/dist/commands/init.js.map +1 -1
  26. package/dist/commands/publish-urls.d.ts +32 -0
  27. package/dist/commands/publish-urls.d.ts.map +1 -0
  28. package/dist/commands/publish-urls.js +125 -0
  29. package/dist/commands/publish-urls.js.map +1 -0
  30. package/dist/commands/update.d.ts.map +1 -1
  31. package/dist/commands/update.js +0 -3
  32. package/dist/commands/update.js.map +1 -1
  33. package/dist/config/defaults.d.ts +26 -0
  34. package/dist/config/defaults.d.ts.map +1 -1
  35. package/dist/config/defaults.js +25 -1
  36. package/dist/config/defaults.js.map +1 -1
  37. package/dist/config/schema.d.ts +19 -0
  38. package/dist/config/schema.d.ts.map +1 -1
  39. package/dist/config/schema.js +31 -0
  40. package/dist/config/schema.js.map +1 -1
  41. package/dist/core/adapter-outputs.d.ts +19 -0
  42. package/dist/core/adapter-outputs.d.ts.map +1 -0
  43. package/dist/core/adapter-outputs.js +54 -0
  44. package/dist/core/adapter-outputs.js.map +1 -0
  45. package/dist/core/agents-doc.d.ts +26 -0
  46. package/dist/core/agents-doc.d.ts.map +1 -1
  47. package/dist/core/agents-doc.js +95 -39
  48. package/dist/core/agents-doc.js.map +1 -1
  49. package/dist/core/checks/harness-portability-checks.d.ts +32 -0
  50. package/dist/core/checks/harness-portability-checks.d.ts.map +1 -1
  51. package/dist/core/checks/harness-portability-checks.js +177 -2
  52. package/dist/core/checks/harness-portability-checks.js.map +1 -1
  53. package/dist/core/checks/integrity-checks.d.ts.map +1 -1
  54. package/dist/core/checks/integrity-checks.js +34 -14
  55. package/dist/core/checks/integrity-checks.js.map +1 -1
  56. package/dist/core/checks/organize-checks.d.ts +5 -0
  57. package/dist/core/checks/organize-checks.d.ts.map +1 -1
  58. package/dist/core/checks/organize-checks.js +57 -4
  59. package/dist/core/checks/organize-checks.js.map +1 -1
  60. package/dist/core/convention-doc.d.ts.map +1 -1
  61. package/dist/core/convention-doc.js +5 -2
  62. package/dist/core/convention-doc.js.map +1 -1
  63. package/dist/core/conventions.d.ts +7 -0
  64. package/dist/core/conventions.d.ts.map +1 -1
  65. package/dist/core/conventions.js +3 -0
  66. package/dist/core/conventions.js.map +1 -1
  67. package/dist/core/errors.d.ts +16 -0
  68. package/dist/core/errors.d.ts.map +1 -1
  69. package/dist/core/errors.js +32 -0
  70. package/dist/core/errors.js.map +1 -1
  71. package/dist/core/ingest/required-sections.d.ts +3 -3
  72. package/dist/core/ingest/required-sections.d.ts.map +1 -1
  73. package/dist/core/ingest/required-sections.js +79 -16
  74. package/dist/core/ingest/required-sections.js.map +1 -1
  75. package/dist/core/notes/list.d.ts.map +1 -1
  76. package/dist/core/notes/list.js +3 -0
  77. package/dist/core/notes/list.js.map +1 -1
  78. package/dist/core/reconcile.d.ts +2 -1
  79. package/dist/core/reconcile.d.ts.map +1 -1
  80. package/dist/core/reconcile.js +10 -2
  81. package/dist/core/reconcile.js.map +1 -1
  82. package/dist/core/skills.d.ts.map +1 -1
  83. package/dist/core/skills.js +16 -5
  84. package/dist/core/skills.js.map +1 -1
  85. package/dist/run.d.ts.map +1 -1
  86. package/dist/run.js +14 -1
  87. package/dist/run.js.map +1 -1
  88. package/dist/version.d.ts +1 -1
  89. package/dist/version.js +1 -1
  90. package/package.json +3 -3
  91. package/templates/agents/canonical.md +3 -6
  92. package/templates/agents/capture-and-ingest.md +1 -36
  93. package/templates/agents/conventions.md +3 -1
  94. package/templates/agents/guidance-index.md +5 -0
  95. package/templates/agents/mission.md +2 -0
  96. package/templates/agents/retrieval-leg-routing.md +7 -36
  97. package/templates/conventions/baseline-conventions.md +20 -9
  98. package/templates/conventions/house-conventions-seed.md +10 -0
  99. package/templates/notes/Concept.md +2 -1
  100. package/templates/skills/ctxr-capture.md +30 -4
  101. package/templates/skills/ctxr-derived-artifacts.md +6 -0
  102. package/templates/skills/ctxr-ingest-orchestration.md +5 -1
  103. package/templates/skills/ctxr-mission.md +40 -31
  104. package/templates/skills/ctxr-organize-audit.md +6 -0
  105. package/templates/skills/ctxr-placement.md +5 -0
  106. package/templates/skills/ctxr-publish.md +18 -4
  107. package/templates/skills/ctxr-second-opinion/lenses.md +3 -1
  108. package/templates/skills/ctxr-second-opinion/run.mjs +39 -12
  109. package/templates/skills/ctxr-second-opinion.md +19 -6
  110. package/templates/skills/ctxr-submit.md +28 -4
package/README.md CHANGED
@@ -27,15 +27,15 @@ Running an agent harness in a container? [contexture-images](https://github.com/
27
27
  ```sh
28
28
  mkdir my-store && cd my-store
29
29
  ctxr init
30
- ctxr adapters generate # writes the harness entry file (CLAUDE.md) and its permission config
31
30
  ```
32
31
 
33
32
  `ctxr init` asks two questions, then creates the git repository (if there isn't one), scaffolds the store, and commits it:
34
33
 
35
34
  - **Which taxonomy profile?** `para` (Projects / Areas / Resources / Archives — the default), `zettelkasten` (no layers at all; structure emerges from links), or `diataxis` (Tutorials / How-to / Reference / Explanation). Or bring your own layer list with `--taxonomy <file.yaml>`.
36
- - **Which agent harnesses?** `claude-code` (default — its adapter generates `CLAUDE.md` plus a `.claude/settings.json` wiring up the write-gate hook) and/or `hermes-agent` (reads `AGENTS.md` directly, so it needs no entry file at all). `--harness none` opts out.
37
-
38
- Harness adapter output is the one part `init` doesn't write itself, which is why `ctxr adapters generate` is a separate line above; `ctxr update` regenerates it from then on.
35
+ - **Which agent harnesses?** Any of:
36
+ - `claude-code` (the default). Its adapter generates `CLAUDE.md`, a one-line import of `AGENTS.md`.
37
+ - `hermes-agent`, `codex`, and `antigravity`. These read `AGENTS.md` directly, so they need no entry file at all. Codex and Antigravity also read `.agents/skills/` natively. See [Codex and Antigravity](#codex-and-antigravity).
38
+ - `--harness none` opts out.
39
39
 
40
40
  Non-interactively, pass them as flags — nothing ever blocks on a prompt:
41
41
 
@@ -47,21 +47,20 @@ ctxr init --profile para --harness claude-code
47
47
 
48
48
  ## What a store looks like on disk
49
49
 
50
- After `ctxr init --profile para`, plus `ctxr adapters generate`:
50
+ After `ctxr init --profile para`:
51
51
 
52
52
  ```
53
53
  contexture.yaml single source of truth — what this store chose; the rest takes shipped defaults
54
- AGENTS.md generated entry document — six managed sections
54
+ AGENTS.md generated entry document — managed sections, held to a size budget
55
55
  CLAUDE.md harness entry file; a one-line managed import of AGENTS.md
56
56
  .claude/
57
- settings.json PreToolUse hook wiring for the write gate
58
- hooks/ the write-gate shim
59
57
  skills/ -> ../.agents/skills a bridge, so Claude Code auto-discovers the canonical skills
60
58
  .agents/skills/ THE canonical skills location, read natively by most harnesses
61
59
  ctxr-*/SKILL.md 16 contexture-owned skills (refreshed by `ctxr update`)
62
60
  frontend-design/, eli5/ vendored third-party skills, with licenses and provenance
63
61
  .contexture/guidance/
64
62
  house-conventions.md your store's own rules — inlined into AGENTS.md verbatim
63
+ <topic>.md rules for one task — declare `read_when`, and AGENTS.md routes to them
65
64
  mission.md the standing "what's active right now" document
66
65
  .contexture/templates/
67
66
  Note.md the base every note shares — copy it to cut your own kind
@@ -95,7 +94,16 @@ Two distinctions make the rest of this readable:
95
94
 
96
95
  `ctxr init` writes two things an agent reads, both generated from your store's own config — never from a hardcoded layout:
97
96
 
98
- **`AGENTS.md`**, with six managed sections: *Store fundamentals* (root resolution, the frontmatter schema, the write path), *Mission*, *Retrieval: which leg to use*, *Capturing and ingesting*, *Placing a new note* (rendered from your actual taxonomy layers), and *Store conventions*.
97
+ **`AGENTS.md`**, with these managed sections:
98
+ - *Store fundamentals*: root resolution, the frontmatter schema, the write path.
99
+ - *Mission*.
100
+ - *Retrieval*.
101
+ - *Capturing and ingesting*.
102
+ - *Placing a new note*, rendered from your actual taxonomy layers.
103
+ - *Store conventions*.
104
+ - *Read when*, when any guidance loads on demand.
105
+
106
+ Every harness loads this file on every turn, so it is kept short. contexture's own share is held under a ceiling by a test, and procedure a skill already carries lives in that skill.
99
107
 
100
108
  **The skills**, installed as full copies at `.agents/skills/ctxr-<name>/SKILL.md`. That path is the cross-harness canonical location; a harness that reads its own branded directory instead gets that directory bridged to it (`.claude/skills/` is a symlink), so skill auto-discovery works with no wrapper and no second copy. A harness without auto-discovery reaches the same file by path from `AGENTS.md`. They're contexture-owned — refreshed by `ctxr update`, never hand-edited — and they're written against *your* store's configured taxonomy, so no shipped profile's layer names leak into them. Your own skills live alongside, untouched by sync. An owned skill may carry files beside its `SKILL.md` — `ctxr-second-opinion` ships the script that runs its reviewers — and update keeps that whole directory matching the package.
101
109
 
@@ -118,7 +126,40 @@ Two distinctions make the rest of this readable:
118
126
  | `ctxr-upgrade` | Whether to upgrade the installed CLI now, and asking before it does |
119
127
  | `ctxr-second-opinion` | Whether a plan or a taste call needs three different model families, and how to weigh what they say |
120
128
 
121
- Your house rules go in `.contexture/guidance/house-conventions.md`. It's inlined into `AGENTS.md`'s *Store conventions* section in full, so it loads for every harness at the start of every session — there's no separate file an agent has to remember to open.
129
+ Your house rules go in `.contexture/guidance/`.
130
+
131
+ **A file there is inlined into `AGENTS.md`'s *Store conventions* section in full**, so it loads for every harness at the start of every session. That's right for the rules that hold on every turn.
132
+
133
+ **A rule that matters only for one task belongs in its own file, with a trigger in its frontmatter:**
134
+
135
+ ```markdown
136
+ ---
137
+ title: Research style
138
+ read_when: Before a research pass or recording evidence
139
+ ---
140
+ ```
141
+
142
+ That file is not inlined. `AGENTS.md`'s *Read when* section lists it as one line: its trigger and its path.
143
+
144
+ **Size limits:**
145
+ - `ctxr lint` reports when `AGENTS.md` grows past `harness.entry_document_target_bytes`, which is 20 KiB by default.
146
+ - `ctxr doctor` fails when it grows past `harness.entry_document_max_bytes`. The default is 24,000 bytes, the smallest limit any supported harness reads in full, so a store works in Claude Code, Codex, and Antigravity whichever it declares.
147
+
148
+ ## Codex and Antigravity
149
+
150
+ Both read `AGENTS.md` at the store root and discover skills under `.agents/skills/` natively. A store targeting them needs no entry file and no bridged directory. Two things differ from Claude Code.
151
+
152
+ **They stop reading `AGENTS.md` at a fixed size, silently.**
153
+
154
+ | Harness | Stops reading at | Measured on | Can it be raised? |
155
+ |---|---:|---|---|
156
+ | Codex | 32,768 bytes | codex-cli 0.154.0 | Yes: set `project_doc_max_bytes` in your own `~/.codex/config.toml`. A repo-level `.codex/config.toml` is not honored for it. |
157
+ | Antigravity | about 24,000 bytes | agy 1.3.2 | No. |
158
+
159
+ - **Codex's limit covers every `AGENTS.md` it loads, combined**, from the repo root down to your working directory, so nested ones spend the same budget.
160
+ - **Every store is held to the smaller of the two, 24,000 bytes, by default**, whether or not it declares these harnesses. `ctxr doctor` fails past it, naming each harness that would cut the file off and the section where it stops. The remedy is to move task-specific guidance behind `read_when`, or trim the mission. A store that really runs only where nothing is cut off can raise `harness.entry_document_max_bytes`, which records that choice in its configuration.
161
+
162
+ **Codex's sandbox keeps `.git` read-only.** Interactive Codex asks you to approve each git step of `ctxr-submit` outside its sandbox: `git add`, `git commit`, `git push`, `gh`. That includes session worktrees, whose git data lives in the main repository's `.git/worktrees/`.
122
163
 
123
164
  ## A session, end to end
124
165
 
@@ -136,13 +177,11 @@ flowchart LR
136
177
 
137
178
  S --> C --> K --> P --> U --> R --> L
138
179
 
139
- G1["write-gate hook"]
140
180
  G2["pre-commit · pre-push"]
141
- C -.- G1
142
181
  U -.- G2
143
182
 
144
183
  classDef gate fill:#fbfbfb,stroke:#bbb,stroke-dasharray:4 3,color:#666
145
- class G1,G2 gate
184
+ class G2 gate
146
185
  ```
147
186
 
148
187
 
@@ -188,7 +227,7 @@ Each item is validated and applied independently, so one bad path refuses that i
188
227
 
189
228
  They're ordinary `git` and `gh`. The CLI owns only what git cannot do — creating the worktree, applying validated note writes, running the health gates — and the sequencing, the confirmation gates, and the judgment live in the skills, where you can read and change them. That's why `ctxr session` has exactly three subcommands: `start`, `capture`, and `list`.
190
229
 
191
- Three mechanical backstops hold the line underneath all of it: the **pre-commit** hook runs `doctor --staged`; the **pre-push** hook refuses a push to the default branch (`CONTEXTURE_ALLOW_DEFAULT_BRANCH_PUSH=1` is the emergency override, for emergencies); and for Claude Code the **write-gate** PreToolUse hook denies any edit under the store root made outside the active session worktree.
230
+ Two mechanical backstops hold the line underneath all of it: the **pre-commit** hook runs `doctor --staged`, and the **pre-push** hook refuses a push to the default branch (`CONTEXTURE_ALLOW_DEFAULT_BRANCH_PUSH=1` is the emergency override, for emergencies). Both are version-controlled git hooks, so they hold whichever harness, or human, does the writing.
192
231
 
193
232
  ## The knowledge loop
194
233
 
@@ -286,7 +325,7 @@ Renders notes, catalog sections, the graph document, and published pages as cros
286
325
 
287
326
  A published page's navigation label follows its own declared `<title>`, falling back to its folder name when it declares none. A folder group is labelled with the declared name of the taxonomy layer whose path it matches — so a store's own words for its top-level folders reach the sidebar — and with the bare directory name otherwise; either way a group sits where its directory name sorts, not where its label does. The header's light/dark/system links choose a display theme, and the ☰ control shows and hides the navigation — both persist across pages via cookies, and neither requires client-side script. A published page itself is still served byte-verbatim, so neither the theme nor the navigation reaches into it; `ctxr publish new`'s scaffold instead follows the viewer's own system preference on its own.
288
327
 
289
- The **Preview** area, directly below the published pages, holds the pages your open session worktrees are carrying. A page is previewable from the moment its files exist on disk — before any commit, before any push, before a PR is opened or merged — because `serve` reads the worktree rather than asking git or a forge anything. Pages group by the worktree holding them at `/preview/<worktree>/<page>/index.html`, and a preview is byte-identical to what `/publish/<page>/index.html` will serve once the page lands, so what you read is what ships. Both routes address files rather than directories, so a page's address always names its index file — which is the address `ctxr publish new` and `ctxr publish check` report, so you never have to work out which of the two applies. A session worktree carrying no page appears nowhere, and nothing else inside one — notes, catalog, graph, config — becomes reachable.
328
+ The **Preview** area, directly below the published pages, holds the pages your open session worktrees are carrying. A page is previewable from the moment its files exist on disk — before any commit, before any push, before a PR is opened or merged — because `serve` reads the worktree rather than asking git or a forge anything. Pages group by the worktree holding them at `/preview/<worktree>/<page>/index.html`, and a preview is byte-identical to what `/publish/<page>/index.html` will serve once the page lands, so what you read is what ships. Both routes address files rather than directories, so a page's address always names its index file — which is the address `ctxr publish new` and `ctxr publish check` report, so you never have to work out which of the two applies. For a whole change set, `ctxr publish urls --staged` (or `--since <ref>`) reports every page added, modified, moved or removed with both addresses, which is what `ctxr-submit` puts in a pull request's **Pages** section; set `serve.previews: none` in `contexture.yaml` if previews never resolve for your reviewers. A session worktree carrying no page appears nowhere, and nothing else inside one — notes, catalog, graph, config — becomes reachable.
290
329
 
291
330
  ## Keeping a store current
292
331
 
@@ -345,7 +384,7 @@ To pin a value against a future default change, declare it. Nothing rewrites wha
345
384
  | `rollup gather \| write \| stale` | Entity synthesis: enumerate, write, find what's out of date |
346
385
  | `publish gather \| new \| check` | Resolve a subject, scaffold a page, run the structural gates |
347
386
  | `session start \| capture \| list` | Session worktrees, and applying an approved capture proposal |
348
- | `adapters generate \| write-gate` | Regenerate harness outputs; the write-gate hook target |
387
+ | `adapters generate` | Regenerate harness outputs (`ctxr update` does this too) |
349
388
  | `serve` | Read the store in a browser |
350
389
  | `update` | Bring contexture-owned files up to the installed version |
351
390
  | `version [--check]` | Report the installed version; `--check` compares it against the latest published release |
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/adapters/builtin/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAE3C;;;GAGG;AACH,eAAO,MAAM,gBAAgB,EAAE,SAAS,OAAO,EAA0D,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/adapters/builtin/index.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAE3C;;;GAGG;AACH,eAAO,MAAM,gBAAgB,EAAE,SAAS,OAAO,EAK9C,CAAC"}
@@ -1,8 +1,15 @@
1
+ import { antigravityHarnessAdapter } from '../harness/antigravity.js';
1
2
  import { claudeCodeHarnessAdapter } from '../harness/claude-code.js';
3
+ import { codexHarnessAdapter } from '../harness/codex.js';
2
4
  import { hermesAgentHarnessAdapter } from '../harness/hermes-agent.js';
3
5
  /**
4
6
  * Every adapter shipped with contexture itself, resolved by (kind, id)
5
7
  * against contexture.yaml's declared list.
6
8
  */
7
- export const BUILTIN_ADAPTERS = [claudeCodeHarnessAdapter, hermesAgentHarnessAdapter];
9
+ export const BUILTIN_ADAPTERS = [
10
+ claudeCodeHarnessAdapter,
11
+ hermesAgentHarnessAdapter,
12
+ codexHarnessAdapter,
13
+ antigravityHarnessAdapter,
14
+ ];
8
15
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/adapters/builtin/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,2BAA2B,CAAC;AACrE,OAAO,EAAE,yBAAyB,EAAE,MAAM,4BAA4B,CAAC;AAGvE;;;GAGG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAuB,CAAC,wBAAwB,EAAE,yBAAyB,CAAC,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/adapters/builtin/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,MAAM,2BAA2B,CAAC;AACtE,OAAO,EAAE,wBAAwB,EAAE,MAAM,2BAA2B,CAAC;AACrE,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,EAAE,yBAAyB,EAAE,MAAM,4BAA4B,CAAC;AAGvE;;;GAGG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAuB;IAClD,wBAAwB;IACxB,yBAAyB;IACzB,mBAAmB;IACnB,yBAAyB;CAC1B,CAAC"}
@@ -0,0 +1,18 @@
1
+ import type { HarnessGenerationAdapter } from '../types.js';
2
+ /**
3
+ * A skills-only harness-generation adapter
4
+ * (support-codex-and-antigravity-harnesses): Antigravity loads `AGENTS.md` as
5
+ * an always-on rule and discovers workspace skills under `.agents/skills/`,
6
+ * so this adapter declares no entry file and needs no bridge on a store using
7
+ * the default skills path.
8
+ *
9
+ * No `GEMINI.md` wrapper: Antigravity loads `AGENTS.md` and `GEMINI.md` side
10
+ * by side, so a file importing the former would load the store's
11
+ * fundamentals twice.
12
+ *
13
+ * `entryDocumentMaxBytes` is the per-file rule cap Antigravity documents and
14
+ * agy 1.3.2 was measured against: content past about 24,000 bytes is never
15
+ * seen, and there is no setting that raises it.
16
+ */
17
+ export declare const antigravityHarnessAdapter: HarnessGenerationAdapter;
18
+ //# sourceMappingURL=antigravity.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"antigravity.d.ts","sourceRoot":"","sources":["../../../src/adapters/harness/antigravity.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,aAAa,CAAC;AAE5D;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,yBAAyB,EAAE,wBAMvC,CAAC"}
@@ -0,0 +1,24 @@
1
+ import { DEFAULT_SKILLS_PATH } from '../../config/defaults.js';
2
+ /**
3
+ * A skills-only harness-generation adapter
4
+ * (support-codex-and-antigravity-harnesses): Antigravity loads `AGENTS.md` as
5
+ * an always-on rule and discovers workspace skills under `.agents/skills/`,
6
+ * so this adapter declares no entry file and needs no bridge on a store using
7
+ * the default skills path.
8
+ *
9
+ * No `GEMINI.md` wrapper: Antigravity loads `AGENTS.md` and `GEMINI.md` side
10
+ * by side, so a file importing the former would load the store's
11
+ * fundamentals twice.
12
+ *
13
+ * `entryDocumentMaxBytes` is the per-file rule cap Antigravity documents and
14
+ * agy 1.3.2 was measured against: content past about 24,000 bytes is never
15
+ * seen, and there is no setting that raises it.
16
+ */
17
+ export const antigravityHarnessAdapter = {
18
+ id: 'antigravity',
19
+ kind: 'harness-generation',
20
+ interfaceVersion: 2,
21
+ skillsDir: DEFAULT_SKILLS_PATH,
22
+ entryDocumentMaxBytes: 24_000,
23
+ };
24
+ //# sourceMappingURL=antigravity.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"antigravity.js","sourceRoot":"","sources":["../../../src/adapters/harness/antigravity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAG/D;;;;;;;;;;;;;;GAcG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAA6B;IACjE,EAAE,EAAE,aAAa;IACjB,IAAI,EAAE,oBAAoB;IAC1B,gBAAgB,EAAE,CAAC;IACnB,SAAS,EAAE,mBAAmB;IAC9B,qBAAqB,EAAE,MAAM;CAC9B,CAAC"}
@@ -0,0 +1,22 @@
1
+ import type { HarnessGenerationAdapter } from '../types.js';
2
+ /**
3
+ * A skills-only harness-generation adapter
4
+ * (support-codex-and-antigravity-harnesses): Codex reads `AGENTS.md` at the
5
+ * store root and discovers skills under `.agents/skills/` natively, so this
6
+ * adapter declares no entry file and its skills directory is the canonical
7
+ * one — no bridge is created on a store using the default skills path.
8
+ *
9
+ * `entryDocumentMaxBytes` is Codex's `project_doc_max_bytes` default:
10
+ * measured on codex-cli 0.154.0, it stops reading project docs at exactly
11
+ * 32,768 bytes, combined across every `AGENTS.md` from the repo root down to
12
+ * the working directory. Only the operator's own `~/.codex/config.toml` (or
13
+ * `-c`) raises it — a repo-level `.codex/config.toml` is not honored for it,
14
+ * even with the project trusted. Antigravity's smaller limit sets the
15
+ * store-wide default regardless (lean-composed-entry-document D3).
16
+ *
17
+ * No permission config (design.md D4): Codex ignores a repo-level config for
18
+ * the settings that matter, and interactive Codex already asks the operator
19
+ * to approve each git step its sandbox refuses.
20
+ */
21
+ export declare const codexHarnessAdapter: HarnessGenerationAdapter;
22
+ //# sourceMappingURL=codex.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"codex.d.ts","sourceRoot":"","sources":["../../../src/adapters/harness/codex.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,aAAa,CAAC;AAE5D;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,mBAAmB,EAAE,wBAMjC,CAAC"}
@@ -0,0 +1,28 @@
1
+ import { DEFAULT_SKILLS_PATH } from '../../config/defaults.js';
2
+ /**
3
+ * A skills-only harness-generation adapter
4
+ * (support-codex-and-antigravity-harnesses): Codex reads `AGENTS.md` at the
5
+ * store root and discovers skills under `.agents/skills/` natively, so this
6
+ * adapter declares no entry file and its skills directory is the canonical
7
+ * one — no bridge is created on a store using the default skills path.
8
+ *
9
+ * `entryDocumentMaxBytes` is Codex's `project_doc_max_bytes` default:
10
+ * measured on codex-cli 0.154.0, it stops reading project docs at exactly
11
+ * 32,768 bytes, combined across every `AGENTS.md` from the repo root down to
12
+ * the working directory. Only the operator's own `~/.codex/config.toml` (or
13
+ * `-c`) raises it — a repo-level `.codex/config.toml` is not honored for it,
14
+ * even with the project trusted. Antigravity's smaller limit sets the
15
+ * store-wide default regardless (lean-composed-entry-document D3).
16
+ *
17
+ * No permission config (design.md D4): Codex ignores a repo-level config for
18
+ * the settings that matter, and interactive Codex already asks the operator
19
+ * to approve each git step its sandbox refuses.
20
+ */
21
+ export const codexHarnessAdapter = {
22
+ id: 'codex',
23
+ kind: 'harness-generation',
24
+ interfaceVersion: 2,
25
+ skillsDir: DEFAULT_SKILLS_PATH,
26
+ entryDocumentMaxBytes: 32_768,
27
+ };
28
+ //# sourceMappingURL=codex.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"codex.js","sourceRoot":"","sources":["../../../src/adapters/harness/codex.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAG/D;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAA6B;IAC3D,EAAE,EAAE,OAAO;IACX,IAAI,EAAE,oBAAoB;IAC1B,gBAAgB,EAAE,CAAC;IACnB,SAAS,EAAE,mBAAmB;IAC9B,qBAAqB,EAAE,MAAM;CAC9B,CAAC"}
@@ -59,6 +59,15 @@ export interface HarnessGenerationAdapter extends Adapter<'harness-generation'>
59
59
  * AdapterDeclarationSchema.skills_dir).
60
60
  */
61
61
  skillsDir: string;
62
+ /**
63
+ * support-codex-and-antigravity-harnesses: the largest AGENTS.md, in bytes,
64
+ * this harness loads in full — content past it is silently never seen.
65
+ * Absent means the harness reads the whole document. Optional and additive,
66
+ * so `SUPPORTED_ADAPTER_INTERFACE_VERSION` stays at 2 (design.md D3). The
67
+ * smallest of these across the built-ins is every store's default
68
+ * `harness.entry_document_max_bytes` (lean-composed-entry-document D3).
69
+ */
70
+ entryDocumentMaxBytes?: number;
62
71
  /** The harness-specific file this adapter writes, relative to the store root (e.g. "CLAUDE.md"). Omit for a harness that reads AGENTS.md directly — no entry file is generated for it. */
63
72
  entryFileName?: string;
64
73
  render?(agentsMdPath: string): string[];
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/adapters/types.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,MAAM,MAAM,WAAW,GAAG,oBAAoB,CAAC;AAE/C,MAAM,WAAW,OAAO,CAAC,CAAC,SAAS,WAAW,GAAG,WAAW;IAC1D,IAAI,EAAE,CAAC,CAAC;IACR,EAAE,EAAE,MAAM,CAAC;IACX,gBAAgB,EAAE,MAAM,CAAC;CAC1B;AAED;;;;;GAKG;AACH,eAAO,MAAM,mCAAmC,EAAE,MAAM,CAAC,WAAW,EAAE,MAAM,CAI3E,CAAC;AAEF;;;;;;;;;GASG;AACH;;;;;;;;;;;;;;;GAeG;AACH,MAAM,WAAW,qBAAqB;IACpC,IAAI,EAAE,MAAM,CAAC;IACb,aAAa,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,wBAAyB,SAAQ,OAAO,CAAC,oBAAoB,CAAC;IAC7E;;;;;;;OAOG;IACH,SAAS,EAAE,MAAM,CAAC;IAClB,0LAA0L;IAC1L,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,MAAM,CAAC,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IACxC,kFAAkF;IAClF,gBAAgB,CAAC,EAAE;QACjB,iEAAiE;QACjE,IAAI,EAAE,MAAM,CAAC;QACb,MAAM,CAAC,KAAK,EAAE,qBAAqB,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;QAC9D;;;;;;WAMG;QACH,YAAY,CAAC,KAAK,EAAE,qBAAqB,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;QACpE;;;;;WAKG;QACH,gBAAgB,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;KACtC,CAAC;CACH;AAED;;;;GAIG;AACH,MAAM,WAAW,cAAc;IAC7B,oBAAoB,EAAE,wBAAwB,CAAC;CAChD"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/adapters/types.ts"],"names":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from '../core/command.js';
2
+ import { type AdaptersGenerateFileResult } from '../core/adapter-outputs.js';
2
3
  import type { RunEnv } from '../core/env.js';
3
- import type { GitRunner } from '../core/git/exec.js';
4
4
  import type { Store } from '../core/store.js';
5
+ export type { AdaptersGenerateFileResult } from '../core/adapter-outputs.js';
5
6
  export declare const requires: CommandRequires;
6
- export interface AdaptersGenerateFileResult {
7
- path: string;
8
- changed: boolean;
9
- }
10
7
  export interface AdaptersGenerateData {
11
8
  files: AdaptersGenerateFileResult[];
12
9
  }
13
- /**
14
- * adapters spec / task 8.3-8.4: every configured harness-generation adapter
15
- * gets its entry file's fenced region (re)written from `render()`, and,
16
- * for a harness that supports it, its permission config merged in. Two
17
- * adapters targeting the same physical file (the common case: one harness's
18
- * own entry file) never collide, because each owns a distinctly-named fence.
19
- */
20
- /** The generation itself, shared with `ctxr update`. */
21
- export declare function generateAdapterOutputs(git: GitRunner, store: Store): Promise<AdaptersGenerateFileResult[]>;
22
10
  export declare function execute(env: RunEnv, store: Store): Promise<CommandOutcome<AdaptersGenerateData>>;
23
11
  //# sourceMappingURL=adapters-generate.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"adapters-generate.d.ts","sourceRoot":"","sources":["../../src/commands/adapters-generate.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAG1E,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAG7C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAIrD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAE9C,eAAO,MAAM,QAAQ,EAAE,eAAuC,CAAC;AAE/D,MAAM,WAAW,0BAA0B;IACzC,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,OAAO,CAAC;CAClB;AAED,MAAM,WAAW,oBAAoB;IACnC,KAAK,EAAE,0BAA0B,EAAE,CAAC;CACrC;AAED;;;;;;GAMG;AACH,wDAAwD;AACxD,wBAAsB,sBAAsB,CAAC,GAAG,EAAE,SAAS,EAAE,KAAK,EAAE,KAAK,GAAG,OAAO,CAAC,0BAA0B,EAAE,CAAC,CA2ChH;AAED,wBAAsB,OAAO,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,GAAG,OAAO,CAAC,cAAc,CAAC,oBAAoB,CAAC,CAAC,CAWtG"}
1
+ {"version":3,"file":"adapters-generate.d.ts","sourceRoot":"","sources":["../../src/commands/adapters-generate.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAC1E,OAAO,EAAE,KAAK,0BAA0B,EAA0B,MAAM,4BAA4B,CAAC;AACrG,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAE7C,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAE9C,YAAY,EAAE,0BAA0B,EAAE,MAAM,4BAA4B,CAAC;AAE7E,eAAO,MAAM,QAAQ,EAAE,eAAuC,CAAC;AAE/D,MAAM,WAAW,oBAAoB;IACnC,KAAK,EAAE,0BAA0B,EAAE,CAAC;CACrC;AAED,wBAAsB,OAAO,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,GAAG,OAAO,CAAC,cAAc,CAAC,oBAAoB,CAAC,CAAC,CAWtG"}
@@ -1,56 +1,8 @@
1
- import path from 'node:path';
2
- import { configuredAdapters } from '../adapters/registry.js';
3
- import { agentsMdPath } from '../core/agents-doc.js';
1
+ import { generateAdapterOutputs } from '../core/adapter-outputs.js';
4
2
  import { ExitCode } from '../core/exit-codes.js';
5
- import { upsertFencedRegionInFile } from '../core/fs/fenced-region.js';
6
- import { retireInstalledHookScript } from '../core/hooks.js';
7
- import { mergeJsonArrayLists } from '../core/json-config-merge.js';
8
- import { harnessEntryFence } from '../core/markers.js';
9
3
  export const requires = { store: 'required' };
10
- /**
11
- * adapters spec / task 8.3-8.4: every configured harness-generation adapter
12
- * gets its entry file's fenced region (re)written from `render()`, and,
13
- * for a harness that supports it, its permission config merged in. Two
14
- * adapters targeting the same physical file (the common case: one harness's
15
- * own entry file) never collide, because each owns a distinctly-named fence.
16
- */
17
- /** The generation itself, shared with `ctxr update`. */
18
- export async function generateAdapterOutputs(git, store) {
19
- const files = [];
20
- for (const adapter of configuredAdapters(store.config, 'harness-generation')) {
21
- if (adapter.entryFileName !== undefined && adapter.render !== undefined) {
22
- const entryPath = path.join(store.root, adapter.entryFileName);
23
- const { changed } = await upsertFencedRegionInFile(entryPath, harnessEntryFence(adapter.id), adapter.render(agentsMdPath(store.root)));
24
- files.push({ path: adapter.entryFileName, changed });
25
- }
26
- if (adapter.permissionConfig) {
27
- const input = {
28
- root: store.root,
29
- worktreesPath: store.config.session.worktrees_path,
30
- };
31
- let permChanged = false;
32
- // retire-the-write-gate: the script this adapter used to install is
33
- // removed rather than left orphaned. contexture delivered it, so
34
- // contexture takes it away; it is version-controlled, so an operator
35
- // who wants it back has it in history.
36
- for (const targetPath of adapter.permissionConfig.retiredHookFiles ?? []) {
37
- const { changed: retired } = await retireInstalledHookScript(store.root, targetPath);
38
- permChanged = permChanged || retired;
39
- }
40
- const permPath = path.join(store.root, adapter.permissionConfig.path);
41
- const rules = adapter.permissionConfig.render(input);
42
- const retired = adapter.permissionConfig.retiredRules(input);
43
- const { changed: rulesChanged } = await mergeJsonArrayLists(permPath, rules, {
44
- remove: retired,
45
- });
46
- permChanged = permChanged || rulesChanged;
47
- files.push({ path: adapter.permissionConfig.path, changed: permChanged });
48
- }
49
- }
50
- return files;
51
- }
52
4
  export async function execute(env, store) {
53
- const files = await generateAdapterOutputs(env.git, store);
5
+ const files = await generateAdapterOutputs(store);
54
6
  const changedCount = files.filter((f) => f.changed).length;
55
7
  return {
56
8
  exitCode: ExitCode.Ok,
@@ -1 +1 @@
1
- {"version":3,"file":"adapters-generate.js","source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S,EAAE,KAAK,CAAC,IAAI;QACrB,aAAa,EAAE,KAAK,CAAC,MAAM,CAAC,cAAc;KAC3C,CAAC;AACJ,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"ingest.d.ts","sourceRoot":"","sources":["../../src/commands/ingest.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAE1E,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAkB7C,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAE9C,eAAO,MAAM,QAAQ,EAAE,eAAuC,CAAC;AAE/D,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,UAAU;IACzB,iFAAiF;IACjF,OAAO,EAAE,MAAM,CAAC;IAChB,kCAAkC;IAClC,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAuCD;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAsB,OAAO,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,WAAW,GAAG,OAAO,CAAC,cAAc,CAAC,UAAU,CAAC,CAAC,CAqDhH"}
1
+ {"version":3,"file":"ingest.d.ts","sourceRoot":"","sources":["../../src/commands/ingest.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAE1E,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAwB7C,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAE9C,eAAO,MAAM,QAAQ,EAAE,eAAuC,CAAC;AAE/D,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,UAAU;IACzB,iFAAiF;IACjF,OAAO,EAAE,MAAM,CAAC;IAChB,kCAAkC;IAClC,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAuCD;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAsB,OAAO,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,WAAW,GAAG,OAAO,CAAC,cAAc,CAAC,UAAU,CAAC,CAAC,CAiEhH"}
@@ -2,7 +2,7 @@ import { existsSync } from 'node:fs';
2
2
  import { mkdir, rename, unlink } from 'node:fs/promises';
3
3
  import path from 'node:path';
4
4
  import { buildCatalog } from '../core/catalog/build.js';
5
- import { AlreadyIngestedError, CaptureDestinationExistsError, MissingRequiredCaptureSectionError, NoteNotFoundError } from '../core/errors.js';
5
+ import { AlreadyIngestedError, CaptureDestinationExistsError, CaptureSourceTypeMismatchError, MissingRequiredCaptureSectionError, NoteNotFoundError, } from '../core/errors.js';
6
6
  import { ExitCode } from '../core/exit-codes.js';
7
7
  import { isUnderPrefix } from '../core/fs/prefix.js';
8
8
  import { writeFileAtomic } from '../core/fs/atomic.js';
@@ -73,6 +73,18 @@ export async function execute(env, store, flags) {
73
73
  if (hasAssignedIdentity(capture)) {
74
74
  throw new AlreadyIngestedError(capturePath);
75
75
  }
76
+ /**
77
+ * The type a store's declaration is looked up under must be the type the
78
+ * capture is recorded under (harden-the-required-capture-section D2). A
79
+ * capture that already names its source and is ingested as a different one
80
+ * is refused rather than having one silently replace the other, before
81
+ * anything is read further, stamped, or moved. A capture that names none
82
+ * takes the invocation's; one that agrees is unremarkable.
83
+ */
84
+ const capturesOwnType = capture.frontmatter?.[SOURCE_TYPE_FIELD];
85
+ if (typeof capturesOwnType === 'string' && capturesOwnType.trim() !== '' && capturesOwnType !== flags.sourceType) {
86
+ throw new CaptureSourceTypeMismatchError(capturePath, capturesOwnType, flags.sourceType);
87
+ }
76
88
  /**
77
89
  * Before anything is written. A capture missing the section its store
78
90
  * requires is refused whole — not stamped, not moved, not cited — so a
@@ -1 +1 @@
1
- {"version":3,"file":"ingest.js","sourceRoot":"","sources":["../../src/commands/ingest.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AACzD,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAExD,OAAO,EAAE,oBAAoB,EAAE,6BAA6B,EAAE,kCAAkC,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAC/I,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjD,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAC/D,OAAO,EACL,kBAAkB,EAClB,mBAAmB,EACnB,cAAc,EACd,iBAAiB,EACjB,eAAe,EACf,iBAAiB,EACjB,aAAa,GACd,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,sBAAsB,EAAE,MAAM,qCAAqC,CAAC;AAC7E,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAE,cA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ACzB,CAAC"}
@@ -26,5 +26,7 @@ export interface InitData {
26
26
  };
27
27
  schema_version: number;
28
28
  }
29
+ /** The ids `--harness` accepts, in prompt order — `src/run.ts` builds the option's help from this, so the two cannot list different harnesses. */
30
+ export declare const SELECTABLE_HARNESS_IDS: readonly string[];
29
31
  export declare function execute(env: RunEnv, flags: InitFlags): Promise<CommandOutcome<InitData>>;
30
32
  //# sourceMappingURL=init.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../src/commands/init.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AA+B1E,OAAO,EAKL,KAAK,mBAAmB,EACzB,MAAM,qBAAqB,CAAC;AAgB7B,OAAO,EAAiB,KAAK,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAkB5D,eAAO,MAAM,QAAQ,EAAE,eAAqC,CAAC;AAE7D,MAAM,WAAW,SAAS;IACxB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,2HAA2H;IAC3H,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,QAAQ;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,mBAAmB,EAAE,OAAO,CAAC;IAC7B,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,GAAG,EAAE;QAAE,kBAAkB,EAAE,OAAO,CAAC;QAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;QAAC,cAAc,EAAE,MAAM,GAAG,IAAI,CAAA;KAAE,CAAC;IAC3F,wFAAwF;IACxF,QAAQ,EAAE;QAAE,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;QAAC,MAAM,EAAE,mBAAmB,EAAE,CAAA;KAAE,CAAC;IACpE,cAAc,EAAE,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AAM,EAAE,KAAK,EAAE,SAAS,GAAG,OAAO,CAAC,cAAc,CAAC,QAAQ,CAAC,CAAC,CAY9F"}
@@ -3,7 +3,7 @@ import { mkdir, readFile } from 'node:fs/promises';
3
3
  import path from 'node:path';
4
4
  import { parse as parseYaml } from 'yaml';
5
5
  import { z } from 'zod';
6
- import { DEFAULT_ADAPTERS, DEFAULT_ARCHIVE_DESTINATION, DEFAULT_CAPTURE_ROOT, DEFAULT_CATALOG_PATH, DEFAULT_CATALOG_SECTION_MAX_BYTES, DEFAULT_CONVENTION_MAX_BYTES, DEFAULT_DERIVED_PATHS, DEFAULT_DIFF_SIZE_CEILING_LINES, DEFAULT_EXCLUDE_PATHS, DEFAULT_GATHER_MAX_NOTES, DEFAULT_GRAPH_SETTINGS, DEFAULT_GUIDANCE_PATH, DEFAULT_HOUSE_CONVENTIONS_FILE_NAME, DEFAULT_INBOX_PATH, DEFAULT_MISSION_PATH, DEFAULT_PUBLISH_PATH, DEFAULT_TEMPLATES_PATH, DEFAULT_INSTALLED_TEMPLATES, DEFAULT_ROLLUP_STALE_DAYS, DEFAULT_SESSION_BRANCH_PREFIX, DEFAULT_SKILLS_PATH, DEFAULT_TRACKING_PARAMS, DEFAULT_VENDORED_SKILLS, DEFAULT_WORKTREES_PATH, SHIPPED_DEFAULTS, } from '../config/defaults.js';
6
+ import { DEFAULT_ADAPTERS, DEFAULT_ARCHIVE_DESTINATION, DEFAULT_CAPTURE_ROOT, DEFAULT_CATALOG_PATH, DEFAULT_CATALOG_SECTION_MAX_BYTES, DEFAULT_CONVENTION_MAX_BYTES, DEFAULT_ENTRY_DOCUMENT_MAX_BYTES, DEFAULT_LOG_PATH, DEFAULT_MISSION_MAX_BYTES, DEFAULT_SCRATCH_PATH, DEFAULT_ENTRY_DOCUMENT_TARGET_BYTES, DEFAULT_DERIVED_PATHS, DEFAULT_DIFF_SIZE_CEILING_LINES, DEFAULT_EXCLUDE_PATHS, DEFAULT_GATHER_MAX_NOTES, DEFAULT_GRAPH_SETTINGS, DEFAULT_GUIDANCE_PATH, DEFAULT_HOUSE_CONVENTIONS_FILE_NAME, DEFAULT_INBOX_PATH, DEFAULT_MISSION_PATH, DEFAULT_PUBLISH_PATH, DEFAULT_TEMPLATES_PATH, DEFAULT_INSTALLED_TEMPLATES, DEFAULT_ROLLUP_STALE_DAYS, DEFAULT_SESSION_BRANCH_PREFIX, DEFAULT_SKILLS_PATH, DEFAULT_TRACKING_PARAMS, DEFAULT_VENDORED_SKILLS, DEFAULT_WORKTREES_PATH, SHIPPED_DEFAULTS, } from '../config/defaults.js';
7
7
  import { configPathFor, readConfig } from '../config/load.js';
8
8
  import { MIGRATION_STEPS } from '../config/migrations.js';
9
9
  import { renderStoreConfig } from '../config/render.js';
@@ -13,6 +13,7 @@ import { seedHouseConventionsFile } from '../core/convention-doc.js';
13
13
  import { syncNoteTemplates } from '../core/note-templates.js';
14
14
  import { syncShippedSkills, syncVendoredSkills } from '../core/skills.js';
15
15
  import { bridgeHarnessSkills } from '../core/harness/bridge.js';
16
+ import { generateAdapterOutputs } from '../core/adapter-outputs.js';
16
17
  import { reconcileStore, WORKTREES_GITIGNORE_FENCE } from '../core/reconcile.js';
17
18
  import { isInteractive } from '../core/env.js';
18
19
  import { CLI_VERSION } from '../version.js';
@@ -83,7 +84,11 @@ async function resolveTaxonomy(env, flags) {
83
84
  const SELECTABLE_HARNESSES = [
84
85
  { id: 'claude-code', name: 'Claude Code', description: 'Generates CLAUDE.md importing AGENTS.md.' },
85
86
  { id: 'hermes-agent', name: 'Hermes', description: 'Reads AGENTS.md directly — no entry file generated.' },
87
+ { id: 'codex', name: 'Codex', description: 'Reads AGENTS.md and .agents/skills/ directly; stops reading AGENTS.md at 32,768 bytes.' },
88
+ { id: 'antigravity', name: 'Antigravity', description: 'Reads AGENTS.md and .agents/skills/ directly; stops reading AGENTS.md at 24,000 bytes.' },
86
89
  ];
90
+ /** The ids `--harness` accepts, in prompt order — `src/run.ts` builds the option's help from this, so the two cannot list different harnesses. */
91
+ export const SELECTABLE_HARNESS_IDS = SELECTABLE_HARNESSES.map((h) => h.id);
87
92
  const DEFAULT_HARNESS_IDS = ['claude-code'];
88
93
  async function resolveHarnesses(env, flags) {
89
94
  if (flags.harness !== undefined) {
@@ -214,8 +219,21 @@ async function runInitCore(env, flags) {
214
219
  skills: { vendored: [...DEFAULT_VENDORED_SKILLS] },
215
220
  update_check: SHIPPED_DEFAULTS.update_check,
216
221
  ingest: { inbox_path: DEFAULT_INBOX_PATH, capture_root: DEFAULT_CAPTURE_ROOT, tracking_params: [...DEFAULT_TRACKING_PARAMS] },
217
- organize: { archive_destination: archiveDestination, rollup_stale_days: DEFAULT_ROLLUP_STALE_DAYS, mission_path: DEFAULT_MISSION_PATH },
218
- harness: { skills_path: DEFAULT_SKILLS_PATH, guidance_path: DEFAULT_GUIDANCE_PATH, convention_max_bytes: DEFAULT_CONVENTION_MAX_BYTES },
222
+ organize: {
223
+ archive_destination: archiveDestination,
224
+ rollup_stale_days: DEFAULT_ROLLUP_STALE_DAYS,
225
+ mission_path: DEFAULT_MISSION_PATH,
226
+ log_path: DEFAULT_LOG_PATH,
227
+ mission_max_bytes: DEFAULT_MISSION_MAX_BYTES,
228
+ },
229
+ harness: {
230
+ skills_path: DEFAULT_SKILLS_PATH,
231
+ guidance_path: DEFAULT_GUIDANCE_PATH,
232
+ convention_max_bytes: DEFAULT_CONVENTION_MAX_BYTES,
233
+ scratch_path: DEFAULT_SCRATCH_PATH,
234
+ entry_document_max_bytes: DEFAULT_ENTRY_DOCUMENT_MAX_BYTES,
235
+ entry_document_target_bytes: DEFAULT_ENTRY_DOCUMENT_TARGET_BYTES,
236
+ },
219
237
  adapters: resolvedAdapters,
220
238
  };
221
239
  // Round-trips through the schema internally; throws before any byte is written if it doesn't.
@@ -246,6 +264,15 @@ async function runInitCore(env, flags) {
246
264
  const { changed: templateFilesCreated, findings: templateFindings } = await syncNoteTemplates(root, config, CLI_VERSION);
247
265
  findings.push(...templateFindings);
248
266
  await buildAgentsConventionsSection(root, config);
267
+ // init-generates-harness-adapter-output: the harnesses just selected get
268
+ // their entry files now, in the bootstrap commit, rather than waiting for a
269
+ // first `ctxr update`. After the last AGENTS.md writer, as in the reconcile.
270
+ // Only what the generator wrote is staged: an adapter that contributes
271
+ // nothing (claude-code's permission config) reports unchanged, so no empty
272
+ // file is created and `git add` is never handed a path that doesn't exist.
273
+ const adapterFilesCreated = (await generateAdapterOutputs({ root, config }))
274
+ .filter((f) => f.changed)
275
+ .map((f) => f.path);
249
276
  const guidanceFilesCreated = [
250
277
  ...(houseConventionsSeeded.created ? [path.join(config.harness.guidance_path, DEFAULT_HOUSE_CONVENTIONS_FILE_NAME)] : []),
251
278
  ...(missionSeeded ? [missionSeeded] : []),
@@ -288,6 +315,7 @@ async function runInitCore(env, flags) {
288
315
  ...templateFilesCreated,
289
316
  ...bridgedPaths,
290
317
  ...guidanceFilesCreated,
318
+ ...adapterFilesCreated,
291
319
  ...hookFiles,
292
320
  ]);
293
321
  const commitSha = await commitIfStaged(env.git, root, { kind: 'bootstrap' }, 'chore: initialize contexture store');
@@ -304,6 +332,7 @@ async function runInitCore(env, flags) {
304
332
  ...vendoredSkillFilesCreated,
305
333
  ...bridgedPaths,
306
334
  ...guidanceFilesCreated,
335
+ ...adapterFilesCreated,
307
336
  ...hookFiles,
308
337
  ],
309
338
  unchanged: [],