ctxr-cli 0.5.0 → 0.7.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 (289) hide show
  1. package/dist/adapter.d.ts +0 -1
  2. package/dist/adapter.d.ts.map +1 -1
  3. package/dist/adapter.js.map +1 -1
  4. package/dist/adapters/builtin/index.d.ts.map +1 -1
  5. package/dist/adapters/builtin/index.js +2 -2
  6. package/dist/adapters/builtin/index.js.map +1 -1
  7. package/dist/adapters/harness/claude-code.d.ts.map +1 -1
  8. package/dist/adapters/harness/claude-code.js +30 -14
  9. package/dist/adapters/harness/claude-code.js.map +1 -1
  10. package/dist/adapters/harness/hermes-agent.d.ts +9 -0
  11. package/dist/adapters/harness/hermes-agent.d.ts.map +1 -0
  12. package/dist/adapters/harness/hermes-agent.js +13 -0
  13. package/dist/adapters/harness/hermes-agent.js.map +1 -0
  14. package/dist/adapters/types.d.ts +38 -18
  15. package/dist/adapters/types.d.ts.map +1 -1
  16. package/dist/adapters/types.js +3 -3
  17. package/dist/adapters/types.js.map +1 -1
  18. package/dist/commands/adapters-generate.d.ts +4 -2
  19. package/dist/commands/adapters-generate.d.ts.map +1 -1
  20. package/dist/commands/adapters-generate.js +14 -6
  21. package/dist/commands/adapters-generate.js.map +1 -1
  22. package/dist/commands/archive.d.ts +6 -4
  23. package/dist/commands/archive.d.ts.map +1 -1
  24. package/dist/commands/archive.js +7 -5
  25. package/dist/commands/archive.js.map +1 -1
  26. package/dist/commands/catalog-show.d.ts +0 -1
  27. package/dist/commands/catalog-show.d.ts.map +1 -1
  28. package/dist/commands/catalog-show.js +1 -1
  29. package/dist/commands/catalog-show.js.map +1 -1
  30. package/dist/commands/graph-query.d.ts +2 -11
  31. package/dist/commands/graph-query.d.ts.map +1 -1
  32. package/dist/commands/graph-query.js +11 -14
  33. package/dist/commands/graph-query.js.map +1 -1
  34. package/dist/commands/init.d.ts +2 -0
  35. package/dist/commands/init.d.ts.map +1 -1
  36. package/dist/commands/init.js +82 -21
  37. package/dist/commands/init.js.map +1 -1
  38. package/dist/commands/publish-check.d.ts +23 -0
  39. package/dist/commands/publish-check.d.ts.map +1 -0
  40. package/dist/commands/publish-check.js +112 -0
  41. package/dist/commands/publish-check.js.map +1 -0
  42. package/dist/commands/publish-gather.d.ts +27 -0
  43. package/dist/commands/publish-gather.d.ts.map +1 -0
  44. package/dist/commands/publish-gather.js +73 -0
  45. package/dist/commands/publish-gather.js.map +1 -0
  46. package/dist/commands/publish-new.d.ts +19 -0
  47. package/dist/commands/publish-new.d.ts.map +1 -0
  48. package/dist/commands/publish-new.js +108 -0
  49. package/dist/commands/publish-new.js.map +1 -0
  50. package/dist/commands/serve.d.ts +32 -0
  51. package/dist/commands/serve.d.ts.map +1 -0
  52. package/dist/commands/serve.js +151 -0
  53. package/dist/commands/serve.js.map +1 -0
  54. package/dist/commands/session-capture.d.ts.map +1 -1
  55. package/dist/commands/session-capture.js +0 -2
  56. package/dist/commands/session-capture.js.map +1 -1
  57. package/dist/commands/update.js +3 -3
  58. package/dist/commands/update.js.map +1 -1
  59. package/dist/config/defaults.d.ts +49 -44
  60. package/dist/config/defaults.d.ts.map +1 -1
  61. package/dist/config/defaults.js +49 -47
  62. package/dist/config/defaults.js.map +1 -1
  63. package/dist/config/schema.d.ts +53 -52
  64. package/dist/config/schema.d.ts.map +1 -1
  65. package/dist/config/schema.js +84 -62
  66. package/dist/config/schema.js.map +1 -1
  67. package/dist/core/agents-doc.d.ts +9 -0
  68. package/dist/core/agents-doc.d.ts.map +1 -1
  69. package/dist/core/agents-doc.js +31 -16
  70. package/dist/core/agents-doc.js.map +1 -1
  71. package/dist/core/browse/link-resolver.d.ts +12 -0
  72. package/dist/core/browse/link-resolver.d.ts.map +1 -0
  73. package/dist/core/browse/link-resolver.js +12 -0
  74. package/dist/core/browse/link-resolver.js.map +1 -0
  75. package/dist/core/browse/nav.d.ts +10 -0
  76. package/dist/core/browse/nav.d.ts.map +1 -0
  77. package/dist/core/browse/nav.js +101 -0
  78. package/dist/core/browse/nav.js.map +1 -0
  79. package/dist/core/browse/render.d.ts +5 -0
  80. package/dist/core/browse/render.d.ts.map +1 -0
  81. package/dist/core/browse/render.js +66 -0
  82. package/dist/core/browse/render.js.map +1 -0
  83. package/dist/core/browse/routes.d.ts +40 -0
  84. package/dist/core/browse/routes.d.ts.map +1 -0
  85. package/dist/core/browse/routes.js +68 -0
  86. package/dist/core/browse/routes.js.map +1 -0
  87. package/dist/core/browse/templates.d.ts +13 -0
  88. package/dist/core/browse/templates.d.ts.map +1 -0
  89. package/dist/core/browse/templates.js +39 -0
  90. package/dist/core/browse/templates.js.map +1 -0
  91. package/dist/core/browse/tree.d.ts +33 -0
  92. package/dist/core/browse/tree.d.ts.map +1 -0
  93. package/dist/core/browse/tree.js +53 -0
  94. package/dist/core/browse/tree.js.map +1 -0
  95. package/dist/core/catalog/build.d.ts +1 -1
  96. package/dist/core/catalog/build.d.ts.map +1 -1
  97. package/dist/core/catalog/build.js +1 -2
  98. package/dist/core/catalog/build.js.map +1 -1
  99. package/dist/core/catalog/model.d.ts +2 -0
  100. package/dist/core/catalog/model.d.ts.map +1 -1
  101. package/dist/core/catalog/model.js +2 -1
  102. package/dist/core/catalog/model.js.map +1 -1
  103. package/dist/core/checks/integrity-checks.d.ts +18 -2
  104. package/dist/core/checks/integrity-checks.d.ts.map +1 -1
  105. package/dist/core/checks/integrity-checks.js +55 -10
  106. package/dist/core/checks/integrity-checks.js.map +1 -1
  107. package/dist/core/checks/manifest.d.ts.map +1 -1
  108. package/dist/core/checks/manifest.js +0 -5
  109. package/dist/core/checks/manifest.js.map +1 -1
  110. package/dist/core/checks/organize-checks.d.ts +10 -3
  111. package/dist/core/checks/organize-checks.d.ts.map +1 -1
  112. package/dist/core/checks/organize-checks.js +14 -5
  113. package/dist/core/checks/organize-checks.js.map +1 -1
  114. package/dist/core/checks/types.d.ts +1 -1
  115. package/dist/core/convention-doc.d.ts +21 -19
  116. package/dist/core/convention-doc.d.ts.map +1 -1
  117. package/dist/core/convention-doc.js +48 -62
  118. package/dist/core/convention-doc.js.map +1 -1
  119. package/dist/core/conventions.d.ts +2 -2
  120. package/dist/core/conventions.js +2 -2
  121. package/dist/core/errors.d.ts +31 -44
  122. package/dist/core/errors.d.ts.map +1 -1
  123. package/dist/core/errors.js +81 -128
  124. package/dist/core/errors.js.map +1 -1
  125. package/dist/core/exit-codes.d.ts +7 -5
  126. package/dist/core/exit-codes.d.ts.map +1 -1
  127. package/dist/core/exit-codes.js +7 -5
  128. package/dist/core/exit-codes.js.map +1 -1
  129. package/dist/core/git/repo.d.ts +0 -6
  130. package/dist/core/git/repo.d.ts.map +1 -1
  131. package/dist/core/git/repo.js +0 -13
  132. package/dist/core/git/repo.js.map +1 -1
  133. package/dist/core/git/worktree.d.ts +4 -7
  134. package/dist/core/git/worktree.d.ts.map +1 -1
  135. package/dist/core/git/worktree.js +4 -10
  136. package/dist/core/git/worktree.js.map +1 -1
  137. package/dist/core/graph/model.d.ts +14 -0
  138. package/dist/core/graph/model.d.ts.map +1 -1
  139. package/dist/core/graph/model.js +30 -14
  140. package/dist/core/graph/model.js.map +1 -1
  141. package/dist/core/harness/bridge.d.ts +30 -0
  142. package/dist/core/harness/bridge.d.ts.map +1 -0
  143. package/dist/core/harness/bridge.js +178 -0
  144. package/dist/core/harness/bridge.js.map +1 -0
  145. package/dist/core/ingest/identity.d.ts +4 -4
  146. package/dist/core/ingest/identity.js +4 -4
  147. package/dist/core/json-config-merge.d.ts.map +1 -1
  148. package/dist/core/json-config-merge.js +30 -7
  149. package/dist/core/json-config-merge.js.map +1 -1
  150. package/dist/core/migrations/add-explanation-craft-skill.d.ts +26 -0
  151. package/dist/core/migrations/add-explanation-craft-skill.d.ts.map +1 -0
  152. package/dist/core/migrations/add-explanation-craft-skill.js +94 -0
  153. package/dist/core/migrations/add-explanation-craft-skill.js.map +1 -0
  154. package/dist/core/migrations/archive-destination-from-taxonomy.d.ts +35 -0
  155. package/dist/core/migrations/archive-destination-from-taxonomy.d.ts.map +1 -0
  156. package/dist/core/migrations/archive-destination-from-taxonomy.js +109 -0
  157. package/dist/core/migrations/archive-destination-from-taxonomy.js.map +1 -0
  158. package/dist/core/migrations/drop-access-axes.d.ts +24 -0
  159. package/dist/core/migrations/drop-access-axes.d.ts.map +1 -0
  160. package/dist/core/migrations/drop-access-axes.js +54 -0
  161. package/dist/core/migrations/drop-access-axes.js.map +1 -0
  162. package/dist/core/migrations/drop-forge-and-workspaces-external.d.ts +19 -0
  163. package/dist/core/migrations/drop-forge-and-workspaces-external.d.ts.map +1 -0
  164. package/dist/core/migrations/drop-forge-and-workspaces-external.js +49 -0
  165. package/dist/core/migrations/drop-forge-and-workspaces-external.js.map +1 -0
  166. package/dist/core/migrations/registry.d.ts +11 -1
  167. package/dist/core/migrations/registry.d.ts.map +1 -1
  168. package/dist/core/migrations/registry.js +19 -3
  169. package/dist/core/migrations/registry.js.map +1 -1
  170. package/dist/core/notes/list.d.ts +1 -12
  171. package/dist/core/notes/list.d.ts.map +1 -1
  172. package/dist/core/notes/list.js +5 -1
  173. package/dist/core/notes/list.js.map +1 -1
  174. package/dist/core/publish/script-check.d.ts +12 -0
  175. package/dist/core/publish/script-check.d.ts.map +1 -0
  176. package/dist/core/publish/script-check.js +39 -0
  177. package/dist/core/publish/script-check.js.map +1 -0
  178. package/dist/core/reconcile.d.ts +3 -0
  179. package/dist/core/reconcile.d.ts.map +1 -1
  180. package/dist/core/reconcile.js +15 -5
  181. package/dist/core/reconcile.js.map +1 -1
  182. package/dist/core/records.d.ts +4 -5
  183. package/dist/core/records.d.ts.map +1 -1
  184. package/dist/core/records.js +0 -2
  185. package/dist/core/records.js.map +1 -1
  186. package/dist/core/session.d.ts +9 -9
  187. package/dist/core/session.js +9 -9
  188. package/dist/core/skills.d.ts +42 -0
  189. package/dist/core/skills.d.ts.map +1 -1
  190. package/dist/core/skills.js +159 -31
  191. package/dist/core/skills.js.map +1 -1
  192. package/dist/core/write-lifecycle/path-gate.d.ts.map +1 -1
  193. package/dist/core/write-lifecycle/path-gate.js +4 -2
  194. package/dist/core/write-lifecycle/path-gate.js.map +1 -1
  195. package/dist/prompt/inquirer-prompter.d.ts.map +1 -1
  196. package/dist/prompt/inquirer-prompter.js +11 -1
  197. package/dist/prompt/inquirer-prompter.js.map +1 -1
  198. package/dist/prompt/prompter.d.ts +16 -0
  199. package/dist/prompt/prompter.d.ts.map +1 -1
  200. package/dist/run.d.ts.map +1 -1
  201. package/dist/run.js +69 -101
  202. package/dist/run.js.map +1 -1
  203. package/dist/taxonomy/profiles.d.ts +11 -0
  204. package/dist/taxonomy/profiles.d.ts.map +1 -1
  205. package/dist/taxonomy/profiles.js +1 -0
  206. package/dist/taxonomy/profiles.js.map +1 -1
  207. package/dist/version.d.ts +1 -1
  208. package/dist/version.js +1 -1
  209. package/package.json +3 -1
  210. package/templates/agents/canonical.md +1 -3
  211. package/templates/conventions/baseline-conventions.md +27 -0
  212. package/templates/conventions/{custom-convention-seed.md → house-conventions-seed.md} +15 -2
  213. package/templates/hooks/pre-push.sh +1 -1
  214. package/templates/serve/shell.html +18 -0
  215. package/templates/serve/style.css +163 -0
  216. package/templates/skills/ctxr-land.md +32 -18
  217. package/templates/skills/ctxr-organize-audit.md +2 -10
  218. package/templates/skills/ctxr-placement.md +6 -24
  219. package/templates/skills/ctxr-publish.md +84 -0
  220. package/templates/skills/ctxr-session-capture.md +43 -3
  221. package/templates/skills/ctxr-session-lifecycle.md +20 -1
  222. package/templates/skills/ctxr-submit.md +15 -11
  223. package/templates/vendor/eli5/LICENSE.txt +21 -0
  224. package/templates/vendor/eli5/SKILL.md +116 -0
  225. package/templates/vendor/eli5/provenance.json +8 -0
  226. package/templates/vendor/frontend-design/LICENSE.txt +177 -0
  227. package/templates/vendor/frontend-design/SKILL.md +55 -0
  228. package/templates/vendor/frontend-design/provenance.json +7 -0
  229. package/dist/adapters/forge/github.d.ts +0 -12
  230. package/dist/adapters/forge/github.d.ts.map +0 -1
  231. package/dist/adapters/forge/github.js +0 -76
  232. package/dist/adapters/forge/github.js.map +0 -1
  233. package/dist/adapters/forge/types.d.ts +0 -46
  234. package/dist/adapters/forge/types.d.ts.map +0 -1
  235. package/dist/adapters/forge/types.js +0 -2
  236. package/dist/adapters/forge/types.js.map +0 -1
  237. package/dist/commands/check.d.ts +0 -30
  238. package/dist/commands/check.d.ts.map +0 -1
  239. package/dist/commands/check.js +0 -70
  240. package/dist/commands/check.js.map +0 -1
  241. package/dist/commands/note-resolve.d.ts +0 -14
  242. package/dist/commands/note-resolve.d.ts.map +0 -1
  243. package/dist/commands/note-resolve.js +0 -24
  244. package/dist/commands/note-resolve.js.map +0 -1
  245. package/dist/commands/session-abandon.d.ts +0 -13
  246. package/dist/commands/session-abandon.d.ts.map +0 -1
  247. package/dist/commands/session-abandon.js +0 -22
  248. package/dist/commands/session-abandon.js.map +0 -1
  249. package/dist/commands/session-land.d.ts +0 -45
  250. package/dist/commands/session-land.d.ts.map +0 -1
  251. package/dist/commands/session-land.js +0 -171
  252. package/dist/commands/session-land.js.map +0 -1
  253. package/dist/commands/session-reap.d.ts +0 -22
  254. package/dist/commands/session-reap.d.ts.map +0 -1
  255. package/dist/commands/session-reap.js +0 -52
  256. package/dist/commands/session-reap.js.map +0 -1
  257. package/dist/commands/session-submit.d.ts +0 -29
  258. package/dist/commands/session-submit.d.ts.map +0 -1
  259. package/dist/commands/session-submit.js +0 -72
  260. package/dist/commands/session-submit.js.map +0 -1
  261. package/dist/core/checks/disclosure-checks.d.ts +0 -4
  262. package/dist/core/checks/disclosure-checks.d.ts.map +0 -1
  263. package/dist/core/checks/disclosure-checks.js +0 -24
  264. package/dist/core/checks/disclosure-checks.js.map +0 -1
  265. package/dist/core/disclosure/leak-scan.d.ts +0 -19
  266. package/dist/core/disclosure/leak-scan.d.ts.map +0 -1
  267. package/dist/core/disclosure/leak-scan.js +0 -31
  268. package/dist/core/disclosure/leak-scan.js.map +0 -1
  269. package/dist/core/disclosure/model.d.ts +0 -18
  270. package/dist/core/disclosure/model.d.ts.map +0 -1
  271. package/dist/core/disclosure/model.js +0 -45
  272. package/dist/core/disclosure/model.js.map +0 -1
  273. package/dist/core/graph/visibility-filter.d.ts +0 -13
  274. package/dist/core/graph/visibility-filter.d.ts.map +0 -1
  275. package/dist/core/graph/visibility-filter.js +0 -26
  276. package/dist/core/graph/visibility-filter.js.map +0 -1
  277. package/dist/core/migrations/rename-visibility-field.d.ts +0 -3
  278. package/dist/core/migrations/rename-visibility-field.d.ts.map +0 -1
  279. package/dist/core/migrations/rename-visibility-field.js +0 -62
  280. package/dist/core/migrations/rename-visibility-field.js.map +0 -1
  281. package/dist/core/notes/checks.d.ts +0 -20
  282. package/dist/core/notes/checks.d.ts.map +0 -1
  283. package/dist/core/notes/checks.js +0 -58
  284. package/dist/core/notes/checks.js.map +0 -1
  285. package/dist/core/notes/visibility.d.ts +0 -26
  286. package/dist/core/notes/visibility.d.ts.map +0 -1
  287. package/dist/core/notes/visibility.js +0 -41
  288. package/dist/core/notes/visibility.js.map +0 -1
  289. package/templates/conventions/baseline-convention.md +0 -60
@@ -0,0 +1,73 @@
1
+ import { existsSync } from 'node:fs';
2
+ import path from 'node:path';
3
+ import { NoteNotFoundError, PublishSelectorConflictError, PublishSelectorRequiredError } from '../core/errors.js';
4
+ import { ExitCode } from '../core/exit-codes.js';
5
+ import { extractLinkTargets } from '../core/graph/model.js';
6
+ import { listNotes } from '../core/notes/list.js';
7
+ import { parseNote } from '../core/notes/parse.js';
8
+ export const requires = { store: 'required' };
9
+ function toStoreRelativePath(env, store, givenPath) {
10
+ const absolute = path.isAbsolute(givenPath) ? givenPath : path.resolve(env.cwd, givenPath);
11
+ return path.relative(store.root, absolute).split(path.sep).join('/');
12
+ }
13
+ /** publish spec: --entity resolves to the same backlink enumeration `ctxr rollup gather` uses. */
14
+ async function resolveEntityNotes(env, store, entity) {
15
+ const relativePath = toStoreRelativePath(env, store, entity);
16
+ if (!existsSync(path.join(store.root, relativePath)))
17
+ throw new NoteNotFoundError(relativePath);
18
+ const stem = path.basename(relativePath, '.md');
19
+ const notes = await listNotes(store.root, store.config);
20
+ return notes.filter((n) => n.path !== relativePath && extractLinkTargets(n.body).includes(stem));
21
+ }
22
+ async function resolveNoteSet(env, store, flags) {
23
+ const given = ['under', 'note', 'entity'].filter((key) => flags[key] !== undefined);
24
+ if (given.length === 0)
25
+ throw new PublishSelectorRequiredError();
26
+ if (given.length > 1)
27
+ throw new PublishSelectorConflictError(given.map((key) => `--${key}`));
28
+ const selector = given[0];
29
+ switch (selector) {
30
+ case 'under': {
31
+ const notes = await listNotes(store.root, store.config, { underPrefix: flags.under });
32
+ return { selector, subject: flags.under, notes };
33
+ }
34
+ case 'note': {
35
+ const relativePath = toStoreRelativePath(env, store, flags.note);
36
+ const absolutePath = path.join(store.root, relativePath);
37
+ let note;
38
+ try {
39
+ note = await parseNote(absolutePath, relativePath);
40
+ }
41
+ catch (err) {
42
+ if (err.code === 'ENOENT')
43
+ throw new NoteNotFoundError(relativePath);
44
+ throw err;
45
+ }
46
+ return { selector, subject: relativePath, notes: [note] };
47
+ }
48
+ case 'entity': {
49
+ const notes = await resolveEntityNotes(env, store, flags.entity);
50
+ return { selector, subject: flags.entity, notes };
51
+ }
52
+ }
53
+ }
54
+ /**
55
+ * publish spec: agent-facing enumeration only, matching rollup gather's
56
+ * shape — resolves a subject to its note set (one of three selectors) and
57
+ * reports it. It gates nothing and renders nothing; judging what belongs in
58
+ * a page is the agent's and its craft skill's work, and the mechanical
59
+ * checks a finished page must pass live in `ctxr publish check`.
60
+ */
61
+ export async function execute(env, store, flags) {
62
+ const { selector, subject, notes } = await resolveNoteSet(env, store, flags);
63
+ const entries = notes.map((note) => ({ path: note.path }));
64
+ return {
65
+ exitCode: ExitCode.Ok,
66
+ data: { selector, subject, count: entries.length, notes: entries },
67
+ findings: [],
68
+ humanSummary: `${entries.length} note(s) resolved for "${subject}".`,
69
+ storeRoot: store.root,
70
+ schemaVersion: store.config.schema_version,
71
+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IAEjF,OAAO;QACL,QAAQ,EAAE,QAAQ,CAAC,EAAE;QACrB,IAAI,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,CAAC,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE;QAClE,QAAQ,EAAE,EAAE;QACZ,YAAY,EAAE,GAAG,OAAO,CAAC,MAAM,0BAA0B,OAAO,IAAI;QACpE,SAAS,EAAE,KAAK,CAAC,IAAI;QACrB,aAAa,EAAE,KAAK,CAAC,MAAM,CAAC,cAAc;KAC3C,CAAC;AACJ,CAAC"}
@@ -0,0 +1,19 @@
1
+ import type { CommandOutcome, CommandRequires } from '../core/command.js';
2
+ import type { Store } from '../core/store.js';
3
+ export declare const requires: CommandRequires;
4
+ export interface PublishNewFlags {
5
+ slug: string;
6
+ }
7
+ export interface PublishNewData {
8
+ slug: string;
9
+ path: string;
10
+ }
11
+ /**
12
+ * publish spec: fixes a page's identity once. Refuses a slug whose page name
13
+ * collides with the reserved dated-snapshot naming pattern or whose segments
14
+ * would resolve outside the publish path, and never overwrites an existing
15
+ * page folder — the caller updates in place by editing the existing files
16
+ * directly, never by re-running this command.
17
+ */
18
+ export declare function execute(store: Store, flags: PublishNewFlags): Promise<CommandOutcome<PublishNewData>>;
19
+ //# sourceMappingURL=publish-new.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"publish-new.d.ts","sourceRoot":"","sources":["../../src/commands/publish-new.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAI1E,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAE9C,eAAO,MAAM,QAAQ,EAAE,eAAuC,CAAC;AAE/D,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CACd;AAuED;;;;;;GAMG;AACH,wBAAsB,OAAO,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,eAAe,GAAG,OAAO,CAAC,cAAc,CAAC,cAAc,CAAC,CAAC,CA4B3G"}
@@ -0,0 +1,108 @@
1
+ import { existsSync } from 'node:fs';
2
+ import { mkdir } from 'node:fs/promises';
3
+ import path from 'node:path';
4
+ import { PublishInvalidSlugError, PublishReservedSlugError, PublishSlugExistsError } from '../core/errors.js';
5
+ import { ExitCode } from '../core/exit-codes.js';
6
+ import { writeFileAtomic } from '../core/fs/atomic.js';
7
+ export const requires = { store: 'required' };
8
+ /** publish spec: reserved for frozen snapshots — a living page's own name must never collide with this shape. */
9
+ const RESERVED_SLUG_PATTERN = /^\d{4}-/;
10
+ /**
11
+ * browse-navigation-by-folder design.md D5: a slug may name a path of
12
+ * folders, so it is validated a segment at a time. Refusing an empty, `.`,
13
+ * `..`, or absolute segment is what keeps a slug from resolving anywhere
14
+ * but under the configured publish path — the command joined the slug on
15
+ * directly before, with no validation at all.
16
+ */
17
+ function pageSegments(slug) {
18
+ if (path.isAbsolute(slug))
19
+ throw new PublishInvalidSlugError(slug);
20
+ const segments = slug.split('/');
21
+ for (const segment of segments) {
22
+ if (segment === '' || segment === '.' || segment === '..')
23
+ throw new PublishInvalidSlugError(slug);
24
+ }
25
+ return segments;
26
+ }
27
+ function pageSkeleton(slug, dateCreated) {
28
+ return [
29
+ '<!doctype html>',
30
+ '<html lang="en">',
31
+ '<head>',
32
+ '<meta charset="utf-8">',
33
+ '<meta name="viewport" content="width=device-width, initial-scale=1">',
34
+ `<title>${slug}</title>`,
35
+ '<style>',
36
+ '@media print {',
37
+ ' .no-print { display: none; }',
38
+ '}',
39
+ '</style>',
40
+ '</head>',
41
+ '<body>',
42
+ `<p class="meta"><span>${dateCreated}</span> &middot; <a href="./README.md">spec</a></p>`,
43
+ '<main>',
44
+ '<!-- Build the bespoke representation here. -->',
45
+ '</main>',
46
+ '</body>',
47
+ '</html>',
48
+ '',
49
+ ].join('\n');
50
+ }
51
+ function readmeSkeleton(slug, dateCreated) {
52
+ return [
53
+ `# ${slug}`,
54
+ '',
55
+ `date-created: ${dateCreated}`,
56
+ '',
57
+ '## Intent',
58
+ '',
59
+ "One sentence: what does this page let the viewer DO that its source notes couldn't?",
60
+ '',
61
+ '## Source notes',
62
+ '',
63
+ 'Wikilinks back into the store. The notes are the source of truth; this page is a representation of them.',
64
+ '',
65
+ '## Audience & use',
66
+ '',
67
+ 'Who is this for, and in what setting will they use it?',
68
+ '',
69
+ '## Spec / prompt',
70
+ '',
71
+ 'The brief that produced index.html. Keep this so the page is regenerable.',
72
+ '',
73
+ ].join('\n');
74
+ }
75
+ /**
76
+ * publish spec: fixes a page's identity once. Refuses a slug whose page name
77
+ * collides with the reserved dated-snapshot naming pattern or whose segments
78
+ * would resolve outside the publish path, and never overwrites an existing
79
+ * page folder — the caller updates in place by editing the existing files
80
+ * directly, never by re-running this command.
81
+ */
82
+ export async function execute(store, flags) {
83
+ const segments = pageSegments(flags.slug);
84
+ // The final segment is the page's own identity; the ones before it are the
85
+ // directories it is filed under, which the reserved naming does not govern.
86
+ const pageName = segments[segments.length - 1];
87
+ if (RESERVED_SLUG_PATTERN.test(pageName)) {
88
+ throw new PublishReservedSlugError(flags.slug, pageName);
89
+ }
90
+ const relativePath = path.join(store.config.publish.path, flags.slug).split(path.sep).join('/');
91
+ const absolutePath = path.join(store.root, relativePath);
92
+ if (existsSync(absolutePath)) {
93
+ throw new PublishSlugExistsError(flags.slug, relativePath);
94
+ }
95
+ const dateCreated = new Date().toISOString().slice(0, 10);
96
+ await mkdir(absolutePath, { recursive: true });
97
+ await writeFileAtomic(path.join(absolutePath, 'index.html'), pageSkeleton(pageName, dateCreated));
98
+ await writeFileAtomic(path.join(absolutePath, 'README.md'), readmeSkeleton(pageName, dateCreated));
99
+ return {
100
+ exitCode: ExitCode.Ok,
101
+ data: { slug: flags.slug, path: relativePath },
102
+ findings: [],
103
+ humanSummary: `Created "${relativePath}".`,
104
+ storeRoot: store.root,
105
+ schemaVersion: store.config.schema_version,
106
+ };
107
+ }
108
+ //# sourceMappingURL=publish-new.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"publish-new.js","sourceRoot":"","sources":["../../src/commands/publish-new.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACzC,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,EAAE,uBAAuB,EAAE,wBAAwB,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAC;AAC9G,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAGvD,MAAM,CAAC,MAAM,QAAQ,GAAoB,EAAE,KAAK,EAAE,UAAU,EAAE,CAAC;AAW/D,iHAAiH;AACjH,MAAM,qBAAqB,GAAG,SAAS,CAAC;AAExC;;;;;;GAMG;AACH,SAAS,YAAY,CAAC,IAAY;IAChC,IAAI,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC;QAAE,MAAM,IAAI,uBAAuB,CAAC,IAAI,CAAC,CAAC;IACnE,MAAM,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IACjC,KAAK,MAAM,OAAO,IAAI,QAAQ,EAAE,CAAC;QAC/B,IAAI,OAAO,KAAK,EAAE,IAAI,OAAO,KAAK,GAAG,IAAI,OAAO,KAAK,IAAI;YAAE,MAAM,IAAI,uBAAuB,CAAC,IAAI,CAAC,CAAC;IACrG,CAAC;IACD,OAAO,QAAQ,CAAC;AAClB,CAAC;AAED,SAAS,YAAY,CAAC,IAAY,EAAE,WAAmB;IACrD,OAAO;QACL,iBAAiB;QACjB,kBAAkB;QAClB,QAAQ;QACR,wBAAwB;QACxB,sEAAsE;QACtE,UAAU,IAAI,UAAU;QAC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,YAAY,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,YAAY,CAAC,CAAC;IACzD,IAAI,UAAU,CAAC,YAAY,CAAC,EAAE,CAAC;QAC7B,MAAM,IAAI,sBAAsB,CAAC,KAAK,CAAC,IAAI,EAAE,YAAY,CAAC,CAAC;IAC7D,CAAC;IAED,MAAM,WAAW,GAAG,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;IAC1D,MAAM,KAAK,CAAC,YAAY,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IAC/C,MAAM,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE,YAAY,CAAC,EAAE,YAAY,CAAC,QAAQ,EAAE,WAAW,CAAC,CAAC,CAAC;IAClG,MAAM,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE,WAAW,CAAC,EAAE,cAAc,CAAC,QAAQ,EAAE,WAAW,CAAC,CAAC,CAAC;IAEnG,OAAO;QACL,QAAQ,EAAE,QAAQ,CAAC,EAAE;QACrB,IAAI,EAAE,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,EAAE,IAAI,EAAE,YAAY,EAAE;QAC9C,QAAQ,EAAE,EAAE;QACZ,YAAY,EAAE,YAAY,YAAY,IAAI;QAC1C,SAAS,EAAE,KAAK,CAAC,IAAI;QACrB,aAAa,EAAE,KAAK,CAAC,MAAM,CAAC,cAAc;KAC3C,CAAC;AACJ,CAAC"}
@@ -0,0 +1,32 @@
1
+ import type { CommandOutcome, CommandRequires } from '../core/command.js';
2
+ import type { RunEnv } from '../core/env.js';
3
+ import type { Store } from '../core/store.js';
4
+ export declare const requires: CommandRequires;
5
+ export interface ServeFlags {
6
+ port: number;
7
+ host: string;
8
+ }
9
+ export interface ServeData {
10
+ url: string;
11
+ port: number;
12
+ host: string;
13
+ root: string;
14
+ }
15
+ /**
16
+ * Defaults to loopback so an invocation with no `--host` keeps today's
17
+ * behavior exactly. `--host` exists for an operator who has deliberately
18
+ * decided to put something else (a reverse proxy, a tunnel sharing this
19
+ * process's network namespace) in front and knows what binding wider than
20
+ * loopback exposes — this command still applies no requester filtering of
21
+ * its own regardless of bind address; that judgment is entirely the
22
+ * caller's.
23
+ */
24
+ export declare const DEFAULT_HOST = "127.0.0.1";
25
+ /**
26
+ * cli-contract spec (local-browsing-surface D5): resolves the moment the
27
+ * listener is ready, so `runCommand()` emits exactly one envelope before
28
+ * any request is served — the listener itself keeps the process alive
29
+ * afterward, with no change to how `run()`/`bin.ts` end.
30
+ */
31
+ export declare function execute(env: RunEnv, store: Store, flags: ServeFlags): Promise<CommandOutcome<ServeData>>;
32
+ //# sourceMappingURL=serve.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"serve.d.ts","sourceRoot":"","sources":["../../src/commands/serve.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAC1E,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAE7C,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAE9C,eAAO,MAAM,QAAQ,EAAE,eAAuC,CAAC;AAE/D,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,SAAS;IACxB,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;;;;;;;GAQG;AACH,eAAO,MAAM,YAAY,cAAc,CAAC;AAgHxC;;;;;GAKG;AACH,wBAAsB,OAAO,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,UAAU,GAAG,OAAO,CAAC,cAAc,CAAC,SAAS,CAAC,CAAC,CA2B9G"}
@@ -0,0 +1,151 @@
1
+ import { readFile } from 'node:fs/promises';
2
+ import { createServer } from 'node:http';
3
+ import path from 'node:path';
4
+ import { buildLinkResolver } from '../core/browse/link-resolver.js';
5
+ import { renderIndexBody, renderNav } from '../core/browse/nav.js';
6
+ import { escapeHtml, renderNoteBody } from '../core/browse/render.js';
7
+ import { buildRouteTable } from '../core/browse/routes.js';
8
+ import { readStylesheet, renderShell } from '../core/browse/templates.js';
9
+ import { ExitCode } from '../core/exit-codes.js';
10
+ export const requires = { store: 'required' };
11
+ /**
12
+ * Defaults to loopback so an invocation with no `--host` keeps today's
13
+ * behavior exactly. `--host` exists for an operator who has deliberately
14
+ * decided to put something else (a reverse proxy, a tunnel sharing this
15
+ * process's network namespace) in front and knows what binding wider than
16
+ * loopback exposes — this command still applies no requester filtering of
17
+ * its own regardless of bind address; that judgment is entirely the
18
+ * caller's.
19
+ */
20
+ export const DEFAULT_HOST = '127.0.0.1';
21
+ const CONTENT_TYPES = {
22
+ '.html': 'text/html; charset=utf-8',
23
+ '.css': 'text/css; charset=utf-8',
24
+ '.js': 'text/javascript; charset=utf-8',
25
+ '.mjs': 'text/javascript; charset=utf-8',
26
+ '.json': 'application/json; charset=utf-8',
27
+ '.svg': 'image/svg+xml',
28
+ '.png': 'image/png',
29
+ '.jpg': 'image/jpeg',
30
+ '.jpeg': 'image/jpeg',
31
+ '.gif': 'image/gif',
32
+ '.webp': 'image/webp',
33
+ '.ico': 'image/x-icon',
34
+ '.txt': 'text/plain; charset=utf-8',
35
+ '.md': 'text/markdown; charset=utf-8',
36
+ '.woff': 'font/woff',
37
+ '.woff2': 'font/woff2',
38
+ };
39
+ function contentTypeFor(filePath) {
40
+ return CONTENT_TYPES[path.extname(filePath).toLowerCase()] ?? 'application/octet-stream';
41
+ }
42
+ /** Requirement: an unbuilt derived artifact reports how to build it, rather than an opaque 404. */
43
+ function buildHint(command) {
44
+ return `<div class="ctxr-build-hint">Not built yet. Run <code>${escapeHtml(command)}</code> and reload.</div>`;
45
+ }
46
+ function send(res, method, status, contentType, body) {
47
+ const buffer = Buffer.isBuffer(body) ? body : Buffer.from(body, 'utf8');
48
+ res.writeHead(status, { 'Content-Type': contentType, 'Content-Length': buffer.length });
49
+ res.end(method === 'HEAD' ? undefined : buffer);
50
+ }
51
+ /** Reads a derived document, rendering `hint` instead of 404ing when it hasn't been built yet. */
52
+ async function readDerivedDocument(absolutePath) {
53
+ try {
54
+ return { text: await readFile(absolutePath, 'utf8') };
55
+ }
56
+ catch (err) {
57
+ if (err.code === 'ENOENT')
58
+ return { hint: true };
59
+ throw err;
60
+ }
61
+ }
62
+ async function handleRequest(store, stderr, req, res) {
63
+ const method = req.method ?? 'GET';
64
+ const pathname = decodeURIComponent(new URL(req.url ?? '/', 'http://localhost').pathname);
65
+ stderr.write(`${method} ${pathname}\n`);
66
+ if (method !== 'GET' && method !== 'HEAD') {
67
+ send(res, method, 405, 'text/plain; charset=utf-8', 'method not allowed\n');
68
+ return;
69
+ }
70
+ const table = await buildRouteTable(store);
71
+ const resolveLink = buildLinkResolver([...table.notes.values()]);
72
+ if (pathname === '/') {
73
+ send(res, method, 200, 'text/html; charset=utf-8', await renderShell('contexture', renderIndexBody(table), renderNav(table)));
74
+ return;
75
+ }
76
+ if (pathname === '/assets/style.css') {
77
+ send(res, method, 200, 'text/css; charset=utf-8', await readStylesheet());
78
+ return;
79
+ }
80
+ if (pathname === '/graph') {
81
+ const doc = await readDerivedDocument(table.graphDocumentPath);
82
+ const body = 'hint' in doc ? buildHint('ctxr graph build') : renderNoteBody(doc.text, resolveLink);
83
+ send(res, method, 200, 'text/html; charset=utf-8', await renderShell('graph', body, renderNav(table)));
84
+ return;
85
+ }
86
+ if (pathname.startsWith('/notes/')) {
87
+ const note = table.notes.get(pathname.slice('/notes/'.length));
88
+ if (!note) {
89
+ send(res, method, 404, 'text/plain; charset=utf-8', 'not found\n');
90
+ return;
91
+ }
92
+ send(res, method, 200, 'text/html; charset=utf-8', await renderShell(note.path, renderNoteBody(note.body, resolveLink), renderNav(table)));
93
+ return;
94
+ }
95
+ if (pathname.startsWith('/catalog/')) {
96
+ const sectionId = pathname.slice('/catalog/'.length);
97
+ const section = table.catalog.get(sectionId);
98
+ if (!section) {
99
+ send(res, method, 404, 'text/plain; charset=utf-8', 'not found\n');
100
+ return;
101
+ }
102
+ const doc = await readDerivedDocument(section.absolutePath);
103
+ const body = 'hint' in doc ? buildHint('ctxr catalog build') : renderNoteBody(doc.text, resolveLink);
104
+ send(res, method, 200, 'text/html; charset=utf-8', await renderShell(sectionId, body, renderNav(table)));
105
+ return;
106
+ }
107
+ if (pathname.startsWith('/publish/')) {
108
+ const file = table.publishFiles.get(pathname.slice('/publish/'.length));
109
+ if (!file) {
110
+ send(res, method, 404, 'text/plain; charset=utf-8', 'not found\n');
111
+ return;
112
+ }
113
+ send(res, method, 200, contentTypeFor(file.absolutePath), await readFile(file.absolutePath));
114
+ return;
115
+ }
116
+ send(res, method, 404, 'text/plain; charset=utf-8', 'not found\n');
117
+ }
118
+ /**
119
+ * cli-contract spec (local-browsing-surface D5): resolves the moment the
120
+ * listener is ready, so `runCommand()` emits exactly one envelope before
121
+ * any request is served — the listener itself keeps the process alive
122
+ * afterward, with no change to how `run()`/`bin.ts` end.
123
+ */
124
+ export async function execute(env, store, flags) {
125
+ const server = createServer((req, res) => {
126
+ handleRequest(store, env.io.stderr, req, res).catch((err) => {
127
+ env.io.stderr.write(`serve: ${err instanceof Error ? err.message : String(err)}\n`);
128
+ if (!res.headersSent)
129
+ send(res, req.method ?? 'GET', 500, 'text/plain; charset=utf-8', 'internal error\n');
130
+ else
131
+ res.end();
132
+ });
133
+ });
134
+ const host = flags.host;
135
+ await new Promise((resolve, reject) => {
136
+ server.once('error', reject);
137
+ server.listen(flags.port, host, resolve);
138
+ });
139
+ const address = server.address();
140
+ const port = typeof address === 'object' && address !== null ? address.port : flags.port;
141
+ const url = `http://${host}:${port}/`;
142
+ return {
143
+ exitCode: ExitCode.Ok,
144
+ data: { url, port, host, root: store.root },
145
+ findings: [],
146
+ humanSummary: `serving ${store.root} at ${url}`,
147
+ storeRoot: store.root,
148
+ schemaVersion: store.config.schema_version,
149
+ };
150
+ }
151
+ //# sourceMappingURL=serve.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"serve.js","sourceRoot":"","sources":["../../src/commands/serve.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,YAAY,EAA6C,MAAM,WAAW,CAAC;AACpF,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AACpE,OAAO,EAAE,eAAe,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AACnE,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AACtE,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAC3D,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAG1E,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAGjD,MAAM,CAAC,MAAM,QAAQ,GAAoB,EAAE,KAAK,EAAE,UAAU,EAAE,CAAC;AAc/D;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,WAAW,CAAC;AAExC,MAAM,aAAa,GAAqC;IACtD,OAAO,EAAE,0BAA0B;IACnC,MAAM,EAAE,yBAAyB;IACjC,KAAK,EAAE,gCAAgC;IACvC,MAAM,EAAE,gCAAgC;IACxC,OAAO,EAAE,iCAAiC;IAC1C,MAAM,EAAE,eAAe;IACvB,MAAM,EAAE,WAAW;IACnB,MAAM,EAAE,YAAY;IACpB,OAAO,EAAE,YAAY;IACrB,MAAM,EAAE,WAAW;IACnB,OAAO,EAAE,YAAY;IACrB,MAAM,EAAE,cAAc;IACtB,MAAM,E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SAAS,EAAE,KAAK,CAAC,IAAI;QACrB,aAAa,EAAE,KAAK,CAAC,MAAM,CAAC,cAAc;KAC3C,CAAC;AACJ,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"session-capture.d.ts","sourceRoot":"","sources":["../../src/commands/session-capture.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAI1E,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAgB9C,eAAO,MAAM,QAAQ,EAAE,eAAuC,CAAC;AAE/D,MAAM,WAAW,mBAAmB;IAClC,QAAQ,EAAE,MAAM,CAAC;CAClB;AAeD,MAAM,MAAM,kBAAkB,GAAG,OAAO,GAAG,UAAU,GAAG,SAAS,CAAC;AAElE,MAAM,WAAW,iBAAiB;IAChC,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,kBAAkB,CAAC;IAC5B,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,kBAAkB;IACjC,KAAK,EAAE,iBAAiB,EAAE,CAAC;CAC5B;AAyCD;;;;;GAKG;AACH,wBAAsB,OAAO,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,mBAAmB,GAAG,OAAO,CAAC,cAAc,CAAC,kBAAkB,CAAC,CAAC,CA8CnH"}
1
+ {"version":3,"file":"session-capture.d.ts","sourceRoot":"","sources":["../../src/commands/session-capture.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAI1E,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAgB9C,eAAO,MAAM,QAAQ,EAAE,eAAuC,CAAC;AAE/D,MAAM,WAAW,mBAAmB;IAClC,QAAQ,EAAE,MAAM,CAAC;CAClB;AAmBD,MAAM,MAAM,kBAAkB,GAAG,OAAO,GAAG,UAAU,GAAG,SAAS,CAAC;AAElE,MAAM,WAAW,iBAAiB;IAChC,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,kBAAkB,CAAC;IAC5B,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,kBAAkB;IACjC,KAAK,EAAE,iBAAiB,EAAE,CAAC;CAC5B;AAwCD;;;;;GAKG;AACH,wBAAsB,OAAO,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,mBAAmB,GAAG,OAAO,CAAC,cAAc,CAAC,kBAAkB,CAAC,CAAC,CA8CnH"}
@@ -46,8 +46,6 @@ async function applyNote(store, id, item) {
46
46
  if (exists)
47
47
  return { id, path: item.path, outcome: 'refused', reason: 'already exists; use mode: append' };
48
48
  const frontmatter = { ...item.frontmatter };
49
- if (item.visibility !== undefined)
50
- frontmatter[store.config.fields.visibility] = item.visibility;
51
49
  await mkdir(path.dirname(absolutePath), { recursive: true });
52
50
  await writeFileAtomic(absolutePath, renderNote(frontmatter, item.body));
53
51
  return { id, path: item.path, outcome: 'wrote' };
@@ -1 +1 @@
1
- {"version":3,"file":"session-capture.js","sourceRoot":"","sources":["../../src/commands/session-capture.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,KAAK,IAAI,SAAS,EAAE,SAAS,IAAI,aAAa,EAAE,MAAM,MAAM,CAAC;AACtE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjD,OAAO,EAAE,2BAA2B,EAAE,MAAM,mBAAmB,CAAC;AAChE,OAAO,EAAE,eAAe,EAAE,MAA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,CAAC;IAED,MAAM,OAAO,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,OAAO,KAAK,SAAS,CAAC,CAAC;IACnE,MAAM,OAAO,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,OAAO,KAAK,OAAO,IAAI,IAAI,CAAC,OAAO,KAAK,UAAU,CAAC,CAAC;IAEhG,OAAO;QACL,QAAQ,EAAE,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE;QACjE,IAAI,EAAE,EAAE,KAAK,EAAE;QACf,QAAQ,EAAE,EAAE;QACZ,YAAY,EACV,GAAG,OAAO,CAAC,MAAM,kBAAkB;YACnC,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,OAAO,CAAC,MAAM,aAAa,OAAO,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,GAAG,IAAI,CAAC,EAAE,KAAK,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC;QAChI,SAAS,EAAE,KAAK,CAAC,IAAI;QACrB,aAAa,EAAE,KAAK,CAAC,MAAM,CAAC,cAAc;KAC3C,CAAC;AACJ,CAAC"}
@@ -10,13 +10,13 @@ export const requires = { store: 'required' };
10
10
  * touched. Idempotent: a current store reports nothing changed.
11
11
  */
12
12
  export async function execute(env, store) {
13
- const { changed } = await reconcileStore(env, store.root, store.config);
14
- const adapterFiles = await generateAdapterOutputs(store);
13
+ const { changed, findings } = await reconcileStore(env, store.root, store.config);
14
+ const adapterFiles = await generateAdapterOutputs(env.git, store);
15
15
  const all = [...new Set([...changed, ...adapterFiles.filter((f) => f.changed).map((f) => f.path)])];
16
16
  return {
17
17
  exitCode: ExitCode.Ok,
18
18
  data: { changed: all },
19
- findings: [],
19
+ findings,
20
20
  humanSummary: all.length === 0 ? 'Store is already up to date.' : `Updated ${all.length} contexture-owned file(s).`,
21
21
  storeRoot: store.root,
22
22
  schemaVersion: store.config.schema_version,
@@ -1 +1 @@
1
- {"version":3,"file":"update.js","sourceRoot":"","sources":["../../src/commands/update.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjD,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAEtD,OAAO,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAEhE,MAAM,CAAC,MAAM,QAAQ,GAAoB,EAAE,KAAK,EAAE,UAAU,EAAE,CAAC;AAO/D;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,OAAO,CAAC,GAAW,EAAE,KAAY;IACrD,MAAM,EAAE,OAAO,EAAE,GAAG,MAAM,cAAc,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IACxE,MAAM,YAAY,GAAG,MAAM,sBAAsB,CAAC,KAAK,CAAC,CAAC;IACzD,MAAM,GAAG,GAAG,CAAC,GAAG,IAAI,GAAG,CAAC,CAAC,GAAG,OAAO,EAAE,GAAG,YAAY,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;IAEpG,OAAO;QACL,QAAQ,EAAE,QAAQ,CAAC,EAAE;QACrB,IAAI,EAAE,EAAE,OAAO,EAAE,GAAG,EAAE;QACtB,QAAQ,EAAE,EAAE;QACZ,YAAY,EAAE,GAAG,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,8BAA8B,CAAC,CAAC,CAAC,WAAW,GAAG,CAAC,MAAM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AAK,CAAC,IAAI;QACrB,aAAa,EAAE,KAAK,CAAC,MAAM,CAAC,cAAc;KAC3C,CAAC;AACJ,CAAC"}
@@ -1,27 +1,4 @@
1
- import type { AdapterDeclaration, HardWallConfig } from './schema.js';
2
- /**
3
- * context-store spec: "The visibility field's frontmatter key is configurable
4
- * with a shipped default... No specification other than this one SHALL
5
- * assert the literal key name." This module is that one place, in code —
6
- * enforced by test/unit/single-source-literals.test.ts. Every other module
7
- * reads the key via StoreConfig.fields.visibility, never this constant
8
- * directly, and never the literal "scope" string.
9
- *
10
- * "scope" is provisional (design.md D7 / openspec/config.yaml): renaming it
11
- * is meant to be a config-default change plus a migration, never a spec or
12
- * code rewrite. Do not let this constant's value leak into any other file.
13
- */
14
- export declare const DEFAULT_VISIBILITY_FIELD_KEY = "lens";
15
- /**
16
- * The visibility field key every store created before schema_version 2
17
- * used. Named here, once, purely as history for the rename migration
18
- * (core/migrations/rename-visibility-field.ts) to read from — this is the
19
- * one sanctioned place a superseded key value is allowed to live once it's
20
- * no longer the shipped default.
21
- */
22
- export declare const SCHEMA_V1_VISIBILITY_FIELD_KEY = "scope";
23
- /** context-visibility spec rung 3: what a note's visibility fails closed to. */
24
- export declare const DEFAULT_VISIBILITY_CONTEXT = "private";
1
+ import type { AdapterDeclaration } from './schema.js';
25
2
  /**
26
3
  * context-store spec (contexture-home-layout): `.contexture/` is the tool's
27
4
  * home directory. Only its cache subpath is derived/gitignored — the
@@ -30,12 +7,26 @@ export declare const DEFAULT_VISIBILITY_CONTEXT = "private";
30
7
  */
31
8
  export declare const DEFAULT_DERIVED_PATHS: readonly ['.contexture/cache/'];
32
9
  /**
33
- * harness-portability spec (entry-doc-generation D5): contexture-owned
34
- * skills are copied here (`<slug>/SKILL.md`), defaulting to the directory
35
- * harnesses with skill auto-discovery read — one file, one hop. A store
36
- * driven by another harness points this at that harness's skills directory.
10
+ * harness-portability spec (vendored-craft-skills): the ecosystem's
11
+ * cross-harness canonical skills location — the directory the majority of
12
+ * agent runtimes read natively, with no bridge required. A harness that
13
+ * reads its own branded directory instead (e.g. Claude Code's
14
+ * `.claude/skills/`) gets that directory bridged to this one; see
15
+ * `core/harness/bridge.ts`. A store driven by no auto-discovering harness
16
+ * can still point this anywhere.
17
+ */
18
+ export declare const DEFAULT_SKILLS_PATH = ".agents/skills/";
19
+ /**
20
+ * harness-portability spec (vendored-craft-skills): the shipped vendored skill
21
+ * set, installed by default and refreshed by update — one skill per craft axis
22
+ * a published page needs and contexture supplies none of (its visual form; the
23
+ * prose that explains its subject to a reader).
24
+ *
25
+ * Appended, never sorted in: the notices order, the paths init stages, and a
26
+ * store's rendered configuration all follow this order, so growing the set is
27
+ * a pure insertion rather than a reshuffle.
37
28
  */
38
- export declare const DEFAULT_SKILLS_PATH = ".claude/skills/";
29
+ export declare const DEFAULT_VENDORED_SKILLS: readonly ['frontend-design', 'eli5'];
39
30
  /**
40
31
  * harness-portability spec: the guidance directory holding contexture's
41
32
  * shipped baseline convention file, the operator's own convention files
@@ -44,10 +35,21 @@ export declare const DEFAULT_SKILLS_PATH = ".claude/skills/";
44
35
  * context-organize) the mission document.
45
36
  */
46
37
  export declare const DEFAULT_GUIDANCE_PATH = ".contexture/guidance/";
47
- /** The shipped, contexture-owned baseline convention — never hand-edited; refreshed by `ctxr update` like a skill copy. */
48
- export declare const DEFAULT_BASELINE_CONVENTION_FILE_NAME = "baseline-convention.md";
49
- /** The operator-authored convention file seeded at init. */
50
- export declare const DEFAULT_CUSTOM_CONVENTION_FILE_NAME = "custom-convention.md";
38
+ /** The shipped, contexture-owned baseline conventions — never hand-edited; refreshed by `ctxr update` like a skill copy. */
39
+ export declare const DEFAULT_BASELINE_CONVENTIONS_FILE_NAME = "baseline-conventions.md";
40
+ /**
41
+ * The baseline file's pre-rename name. `syncBaselineConventions` removes it
42
+ * when it still carries the managed-owner header, so the rename leaves no
43
+ * orphan — the guidance directory is scanned wholesale, so an orphan would
44
+ * be inlined into AGENTS.md a second time rather than merely sitting unused.
45
+ */
46
+ export declare const LEGACY_BASELINE_CONVENTION_FILE_NAME = "baseline-convention.md";
47
+ /**
48
+ * The operator-authored conventions file seeded at init: this store's house
49
+ * rules, layered on the shipped baseline and winning where the two speak to
50
+ * the same thing.
51
+ */
52
+ export declare const DEFAULT_HOUSE_CONVENTIONS_FILE_NAME = "house-conventions.md";
51
53
  /** context-organize spec: the store's standing current-state document's filename, under the guidance directory. */
52
54
  export declare const DEFAULT_MISSION_FILE_NAME = "mission.md";
53
55
  /** context-organize spec: `organize.mission_path`'s shipped default — every store gets a mission document from `init` onward, seeded there. */
@@ -69,30 +71,33 @@ export declare const DEFAULT_GRAPH_SETTINGS: {
69
71
  export declare const DEFAULT_WORKTREES_PATH = ".worktrees/";
70
72
  /** Branch names for session worktrees are prefixed so they're recognizable and sweep-safe. */
71
73
  export declare const DEFAULT_SESSION_BRANCH_PREFIX = "session/";
72
- /** write-lifecycle spec: worktrees are ctxr-owned (not externally provided) unless a store opts in. */
73
- export declare const DEFAULT_WORKSPACES_EXTERNAL = false;
74
74
  /** write-lifecycle spec: pre-commit's diff-size ceiling, in total changed lines. */
75
75
  export declare const DEFAULT_DIFF_SIZE_CEILING_LINES = 2000;
76
76
  /** context-catalog spec: where per-section catalog files live — tracked (never gitignored), since glosses are authored. */
77
77
  export declare const DEFAULT_CATALOG_PATH = ".contexture/catalog/";
78
78
  /** context-catalog spec: a section exceeding this triggers a failing doctor check, not a silent slowdown. */
79
79
  export declare const DEFAULT_CATALOG_SECTION_MAX_BYTES: number;
80
- /** disclosure-policy spec: v1 ships with no audiences pre-declared internal, and no hard walls — an explicit, empty starting point the operator opts into. */
81
- export declare const DEFAULT_INTERNAL_AUDIENCES: readonly string[];
82
- export declare const DEFAULT_HARD_WALLS: readonly HardWallConfig[];
80
+ /** publish spec: where published pages live — tracked, authored-but-tool-owned, excluded from retrieval like the catalog and skill pack. */
81
+ export declare const DEFAULT_PUBLISH_PATH = ".contexture/publish/";
83
82
  /** context-ingest spec: capture's landing zone — a normal, retrievable directory, not an exclusion. */
84
83
  export declare const DEFAULT_INBOX_PATH = "inbox/";
85
84
  /** store-primitives-from-migration-audit spec (D2): the shipped tracking-parameter list source check strips before comparing URL identities. */
86
85
  export declare const DEFAULT_TRACKING_PARAMS: string[];
87
- /** context-organize spec: archive's destination, decoupled from any taxonomy layer name. */
88
- export declare const DEFAULT_ARCHIVE_PATH = "archive/";
86
+ /**
87
+ * context-organize spec: archive's destination, decoupled from any taxonomy
88
+ * layer name. This is the fallback for a taxonomy that declares none of its
89
+ * own — a shipped profile with a retirement layer (PARA's Archives) supplies
90
+ * its `archiveDestination` at init instead, so a PARA store is never born
91
+ * pointing at a directory its own taxonomy doesn't declare.
92
+ */
93
+ export declare const DEFAULT_ARCHIVE_DESTINATION = "archive/";
89
94
  /** store-primitives-from-migration-audit spec (D4): grace period, in days, before a stale rollup is reported. */
90
95
  export declare const DEFAULT_ROLLUP_STALE_DAYS = 7;
91
96
  /**
92
- * adapters spec: init registers both shipped builtins by default, so
93
- * out-of-the-box UX (a PR opened on session submit, a generated CLAUDE.md)
94
- * keeps working without the operator hand-writing config — each is just as
95
- * removable from this list as it was addable.
97
+ * adapters spec: init registers the shipped builtin by default, so
98
+ * out-of-the-box UX (a generated CLAUDE.md) keeps working without the
99
+ * operator hand-writing config — it is just as removable from this list as
100
+ * it was addable.
96
101
  */
97
102
  export declare const DEFAULT_ADAPTERS: readonly AdapterDeclaration[];
98
103
  //# sourceMappingURL=defaults.d.ts.map