connore 0.1.0 → 0.2.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 (280) hide show
  1. package/README.md +58 -46
  2. package/package.json +36 -33
  3. package/packs/CONTRIBUTING.md +32 -0
  4. package/packs/base/catalog/README.md +24 -0
  5. package/packs/base/catalog/api.md +46 -0
  6. package/packs/base/catalog/auth.md +46 -0
  7. package/packs/base/catalog/backend.md +46 -0
  8. package/packs/base/catalog/blueprints.md +46 -0
  9. package/packs/base/catalog/components.md +46 -0
  10. package/packs/base/catalog/database.md +46 -0
  11. package/packs/base/catalog/docs.md +46 -0
  12. package/packs/base/catalog/github.md +46 -0
  13. package/packs/base/catalog/golden.md +46 -0
  14. package/packs/base/catalog/motion.md +46 -0
  15. package/packs/base/catalog/plan.md +46 -0
  16. package/packs/base/catalog/screenshots.md +46 -0
  17. package/packs/base/catalog/skills.md +46 -0
  18. package/packs/base/catalog/tokens.md +47 -0
  19. package/packs/base/planning/START.md +29 -0
  20. package/packs/base/planning/blueprint-template.md +46 -0
  21. package/packs/base/planning/plan-template.md +46 -0
  22. package/packs/base/rules/anti-patterns.md +46 -0
  23. package/packs/base/rules/code-style.md +46 -0
  24. package/packs/base/rules/definition-of-done.md +47 -0
  25. package/packs/base/rules/dependency-policy.md +46 -0
  26. package/packs/base/rules/error-handling.md +46 -0
  27. package/packs/base/rules/security-audit.md +47 -0
  28. package/packs/base/rules/security-baseline.md +46 -0
  29. package/packs/base/templates/bug-report.md +46 -0
  30. package/packs/base/templates/feature-spec.md +46 -0
  31. package/packs/base/templates/handoff.md +46 -0
  32. package/packs/base/templates/project-brief.md +46 -0
  33. package/packs/base/workflow/build-loop.md +48 -0
  34. package/packs/base/workflow/code-review.md +46 -0
  35. package/packs/base/workflow/debugging.md +47 -0
  36. package/packs/base/workflow/git-and-commits.md +46 -0
  37. package/packs/base/workflow/idea-to-spec.md +46 -0
  38. package/packs/base/workflow/session-handoff.md +46 -0
  39. package/packs/base/workflow/spec-to-plan.md +46 -0
  40. package/packs/knowledge/backend/api/conventions.md +21 -0
  41. package/packs/knowledge/backend/architecture/local-sqlite.md +20 -0
  42. package/packs/knowledge/backend/authentication/session-and-engine.md +24 -0
  43. package/packs/knowledge/backend/database/schema.md +21 -0
  44. package/packs/knowledge/components/custom/ambient-background.md +26 -0
  45. package/packs/knowledge/components/custom/ambient-background.tsx +12 -0
  46. package/packs/knowledge/components/custom/corner-frame.md +26 -0
  47. package/packs/knowledge/components/custom/corner-frame.tsx +48 -0
  48. package/packs/knowledge/components/custom/cta-button.md +26 -0
  49. package/packs/knowledge/components/custom/cta-button.tsx +10 -0
  50. package/packs/knowledge/components/custom/page-transition.md +26 -0
  51. package/packs/knowledge/components/custom/page-transition.tsx +10 -0
  52. package/packs/knowledge/components/custom/smooth-scroll.md +26 -0
  53. package/packs/knowledge/components/custom/smooth-scroll.tsx +32 -0
  54. package/packs/knowledge/components/motion-effects/README.md +30 -0
  55. package/packs/knowledge/components/ui-primitives/LICENSE +21 -0
  56. package/packs/knowledge/components/ui-primitives/README.md +22 -0
  57. package/packs/knowledge/components/ui-primitives/badge.md +26 -0
  58. package/packs/knowledge/components/ui-primitives/badge.tsx +48 -0
  59. package/packs/knowledge/components/ui-primitives/button.md +27 -0
  60. package/packs/knowledge/components/ui-primitives/button.tsx +66 -0
  61. package/packs/knowledge/components/ui-primitives/card.md +26 -0
  62. package/packs/knowledge/components/ui-primitives/card.tsx +102 -0
  63. package/packs/knowledge/components/ui-primitives/checkbox.md +26 -0
  64. package/packs/knowledge/components/ui-primitives/checkbox.tsx +32 -0
  65. package/packs/knowledge/components/ui-primitives/dialog.md +26 -0
  66. package/packs/knowledge/components/ui-primitives/dialog.tsx +168 -0
  67. package/packs/knowledge/components/ui-primitives/dropdown-menu.md +26 -0
  68. package/packs/knowledge/components/ui-primitives/dropdown-menu.tsx +268 -0
  69. package/packs/knowledge/components/ui-primitives/input.md +27 -0
  70. package/packs/knowledge/components/ui-primitives/input.tsx +18 -0
  71. package/packs/knowledge/components/ui-primitives/label.md +26 -0
  72. package/packs/knowledge/components/ui-primitives/label.tsx +23 -0
  73. package/packs/knowledge/components/ui-primitives/progress.md +26 -0
  74. package/packs/knowledge/components/ui-primitives/progress.tsx +30 -0
  75. package/packs/knowledge/components/ui-primitives/scroll-area.md +26 -0
  76. package/packs/knowledge/components/ui-primitives/scroll-area.tsx +54 -0
  77. package/packs/knowledge/components/ui-primitives/select.md +26 -0
  78. package/packs/knowledge/components/ui-primitives/select.tsx +191 -0
  79. package/packs/knowledge/components/ui-primitives/separator.md +26 -0
  80. package/packs/knowledge/components/ui-primitives/separator.tsx +27 -0
  81. package/packs/knowledge/components/ui-primitives/sonner.md +26 -0
  82. package/packs/knowledge/components/ui-primitives/sonner.tsx +49 -0
  83. package/packs/knowledge/components/ui-primitives/switch.md +26 -0
  84. package/packs/knowledge/components/ui-primitives/switch.tsx +32 -0
  85. package/packs/knowledge/components/ui-primitives/tabs.md +26 -0
  86. package/packs/knowledge/components/ui-primitives/tabs.tsx +89 -0
  87. package/packs/knowledge/components/ui-primitives/textarea.md +26 -0
  88. package/packs/knowledge/components/ui-primitives/textarea.tsx +17 -0
  89. package/packs/knowledge/components/ui-primitives/tooltip.md +26 -0
  90. package/packs/knowledge/components/ui-primitives/tooltip.tsx +56 -0
  91. package/packs/knowledge/design/aesthetics/app-shell.md +41 -0
  92. package/packs/knowledge/design/aesthetics/code-neutral.md +40 -0
  93. package/packs/knowledge/design/aesthetics/match.md +46 -0
  94. package/packs/knowledge/design/aesthetics/ruled-outline.md +40 -0
  95. package/packs/knowledge/design/aesthetics/solid-accent.md +43 -0
  96. package/packs/knowledge/design/animations/motion.md +40 -0
  97. package/packs/knowledge/design/project-style.md +50 -0
  98. package/packs/knowledge/design/references/benefit-card-grid.md +27 -0
  99. package/packs/knowledge/design/references/benefit-card-grid.png +0 -0
  100. package/packs/knowledge/design/references/cta-centered.md +27 -0
  101. package/packs/knowledge/design/references/cta-centered.png +0 -0
  102. package/packs/knowledge/design/references/cta-split-media.md +27 -0
  103. package/packs/knowledge/design/references/cta-split-media.png +0 -0
  104. package/packs/knowledge/design/references/dashboard-overview.md +31 -0
  105. package/packs/knowledge/design/references/dashboard-overview.png +0 -0
  106. package/packs/knowledge/design/references/faq-split-accordion.md +27 -0
  107. package/packs/knowledge/design/references/faq-split-accordion.png +0 -0
  108. package/packs/knowledge/design/references/feature-split-checklist.md +27 -0
  109. package/packs/knowledge/design/references/feature-split-checklist.png +0 -0
  110. package/packs/knowledge/design/references/footer-four-column.md +27 -0
  111. package/packs/knowledge/design/references/footer-four-column.png +0 -0
  112. package/packs/knowledge/design/references/footer-two-column.md +27 -0
  113. package/packs/knowledge/design/references/footer-two-column.png +0 -0
  114. package/packs/knowledge/design/references/hero-accent-curtain.md +27 -0
  115. package/packs/knowledge/design/references/hero-accent-curtain.png +0 -0
  116. package/packs/knowledge/design/references/hero-split-media.md +27 -0
  117. package/packs/knowledge/design/references/hero-split-media.png +0 -0
  118. package/packs/knowledge/design/references/logo-cloud-grid.md +27 -0
  119. package/packs/knowledge/design/references/logo-cloud-grid.png +0 -0
  120. package/packs/knowledge/design/references/logo-row-ruled.md +27 -0
  121. package/packs/knowledge/design/references/logo-row-ruled.png +0 -0
  122. package/packs/knowledge/design/references/pricing-three-card.md +27 -0
  123. package/packs/knowledge/design/references/pricing-three-card.png +0 -0
  124. package/packs/knowledge/design/references/steps-ruled-grid.md +27 -0
  125. package/packs/knowledge/design/references/steps-ruled-grid.png +0 -0
  126. package/packs/knowledge/design/rules.md +35 -0
  127. package/packs/knowledge/design/token-structure.md +46 -0
  128. package/packs/knowledge/design/tokens.md +55 -0
  129. package/packs/knowledge/frontend/README.md +50 -0
  130. package/packs/knowledge/frontend/SOURCES.md +40 -0
  131. package/packs/knowledge/frontend/accessibility/focus-and-dialogs.md +47 -0
  132. package/packs/knowledge/frontend/accessibility/semantics-and-keyboard.md +45 -0
  133. package/packs/knowledge/frontend/accessibility/wcag-targets.md +43 -0
  134. package/packs/knowledge/frontend/architecture/agent-context-files.md +43 -0
  135. package/packs/knowledge/frontend/architecture/app-foundations.md +43 -0
  136. package/packs/knowledge/frontend/architecture/error-handling.md +47 -0
  137. package/packs/knowledge/frontend/architecture/feature-modules.md +49 -0
  138. package/packs/knowledge/frontend/architecture/import-boundaries.md +44 -0
  139. package/packs/knowledge/frontend/architecture/naming.md +43 -0
  140. package/packs/knowledge/frontend/architecture/project-structure.md +48 -0
  141. package/packs/knowledge/frontend/architecture/routing.md +45 -0
  142. package/packs/knowledge/frontend/architecture/security.md +44 -0
  143. package/packs/knowledge/frontend/architecture/typescript.md +44 -0
  144. package/packs/knowledge/frontend/components/composition.md +45 -0
  145. package/packs/knowledge/frontend/components/data-display.md +47 -0
  146. package/packs/knowledge/frontend/components/library-choice.md +45 -0
  147. package/packs/knowledge/frontend/components/variants.md +44 -0
  148. package/packs/knowledge/frontend/forms/form-architecture.md +49 -0
  149. package/packs/knowledge/frontend/forms/multi-step.md +43 -0
  150. package/packs/knowledge/frontend/forms/validation.md +47 -0
  151. package/packs/knowledge/frontend/layout/responsive.md +41 -0
  152. package/packs/knowledge/frontend/page-blueprints/app-shell.md +16 -0
  153. package/packs/knowledge/frontend/page-blueprints/faq-footer.md +22 -0
  154. package/packs/knowledge/frontend/page-blueprints/feature-grid.md +22 -0
  155. package/packs/knowledge/frontend/page-blueprints/pricing.md +16 -0
  156. package/packs/knowledge/frontend/page-blueprints/saas-hero.md +24 -0
  157. package/packs/knowledge/frontend/patterns/dark-marketing.md +18 -0
  158. package/packs/knowledge/frontend/patterns/status-pill.md +19 -0
  159. package/packs/knowledge/frontend/performance/code-splitting.md +47 -0
  160. package/packs/knowledge/frontend/performance/images-and-vitals.md +44 -0
  161. package/packs/knowledge/frontend/performance/rendering.md +40 -0
  162. package/packs/knowledge/frontend/rendering/server-and-client.md +50 -0
  163. package/packs/knowledge/frontend/state/api-layer.md +49 -0
  164. package/packs/knowledge/frontend/state/async-ui-states.md +43 -0
  165. package/packs/knowledge/frontend/state/client-store.md +46 -0
  166. package/packs/knowledge/frontend/state/server-cache.md +42 -0
  167. package/packs/knowledge/frontend/state/state-categories.md +50 -0
  168. package/packs/knowledge/frontend/testing/component-tests.md +44 -0
  169. package/packs/knowledge/frontend/testing/strategy.md +46 -0
  170. package/packs/knowledge/inbox/README.md +14 -0
  171. package/packs/knowledge/workflows/authentication.md +18 -0
  172. package/packs/knowledge/workflows/crud.md +20 -0
  173. package/packs/knowledge/workflows/dashboard.md +22 -0
  174. package/packs/nextjs-fullstack/backend/api-conventions.md +48 -0
  175. package/packs/nextjs-fullstack/backend/auth-and-roles.md +46 -0
  176. package/packs/nextjs-fullstack/backend/background-jobs.md +46 -0
  177. package/packs/nextjs-fullstack/backend/caching.md +46 -0
  178. package/packs/nextjs-fullstack/backend/database.md +46 -0
  179. package/packs/nextjs-fullstack/backend/file-uploads.md +46 -0
  180. package/packs/nextjs-fullstack/backend/logging.md +46 -0
  181. package/packs/nextjs-fullstack/backend/migrations.md +46 -0
  182. package/packs/nextjs-fullstack/backend/rate-limiting.md +46 -0
  183. package/packs/nextjs-fullstack/backend/secrets-and-env.md +46 -0
  184. package/packs/nextjs-fullstack/backend/validation.md +46 -0
  185. package/packs/nextjs-fullstack/blueprints/ai-app.md +84 -0
  186. package/packs/nextjs-fullstack/blueprints/internal-tool.md +83 -0
  187. package/packs/nextjs-fullstack/blueprints/saas-app.md +83 -0
  188. package/packs/nextjs-fullstack/build-deploy/ci.md +45 -0
  189. package/packs/nextjs-fullstack/build-deploy/deploy.md +46 -0
  190. package/packs/nextjs-fullstack/build-deploy/monitoring.md +45 -0
  191. package/packs/nextjs-fullstack/build-deploy/performance.md +46 -0
  192. package/packs/nextjs-fullstack/build-deploy/project-structure.md +45 -0
  193. package/packs/nextjs-fullstack/build-deploy/release-checklist.md +47 -0
  194. package/packs/nextjs-fullstack/build-deploy/testing.md +46 -0
  195. package/packs/nextjs-fullstack/evals/README.md +46 -0
  196. package/packs/nextjs-fullstack/examples/golden-app/README.md +45 -0
  197. package/packs/nextjs-fullstack/frontend/accessibility.md +46 -0
  198. package/packs/nextjs-fullstack/frontend/components.md +46 -0
  199. package/packs/nextjs-fullstack/frontend/copy.md +46 -0
  200. package/packs/nextjs-fullstack/frontend/data-fetching.md +46 -0
  201. package/packs/nextjs-fullstack/frontend/forms.md +46 -0
  202. package/packs/nextjs-fullstack/frontend/layout.md +46 -0
  203. package/packs/nextjs-fullstack/frontend/loading-empty-error.md +46 -0
  204. package/packs/nextjs-fullstack/frontend/motion.md +46 -0
  205. package/packs/nextjs-fullstack/frontend/responsive.md +46 -0
  206. package/packs/nextjs-fullstack/frontend/seo.md +47 -0
  207. package/packs/nextjs-fullstack/frontend/tables.md +46 -0
  208. package/packs/nextjs-fullstack/frontend/tokens.md +45 -0
  209. package/packs/nextjs-fullstack/integrations/analytics.md +46 -0
  210. package/packs/nextjs-fullstack/integrations/email.md +46 -0
  211. package/packs/nextjs-fullstack/integrations/llm-apis.md +46 -0
  212. package/packs/nextjs-fullstack/integrations/oauth.md +46 -0
  213. package/packs/nextjs-fullstack/integrations/object-storage.md +46 -0
  214. package/packs/nextjs-fullstack/integrations/payments.md +46 -0
  215. package/packs/nextjs-fullstack/integrations/queues.md +46 -0
  216. package/packs/nextjs-fullstack/integrations/search.md +46 -0
  217. package/packs/nextjs-fullstack/integrations/webhooks.md +46 -0
  218. package/packs/nextjs-fullstack/playbooks/add-ai-feature.md +46 -0
  219. package/packs/nextjs-fullstack/playbooks/add-auth.md +46 -0
  220. package/packs/nextjs-fullstack/playbooks/add-billing.md +50 -0
  221. package/packs/nextjs-fullstack/playbooks/add-crud.md +46 -0
  222. package/packs/nextjs-fullstack/playbooks/add-email.md +46 -0
  223. package/packs/nextjs-fullstack/playbooks/add-file-upload.md +46 -0
  224. package/packs/nextjs-fullstack/playbooks/add-webhook.md +46 -0
  225. package/packs/nextjs-fullstack/playbooks/ship-to-prod.md +47 -0
  226. package/plugins/connore/.claude-plugin/plugin.json +10 -0
  227. package/plugins/connore/hooks/hooks.json +16 -0
  228. package/plugins/connore/skills/connore-backend/SKILL.md +32 -0
  229. package/plugins/connore/skills/connore-handoff/SKILL.md +15 -0
  230. package/plugins/connore/skills/connore-routes/SKILL.md +16 -0
  231. package/plugins/connore/skills/connore-validate/SKILL.md +15 -0
  232. package/src/cli.js +377 -90
  233. package/src/commands/add.js +61 -57
  234. package/src/commands/catalog.js +21 -0
  235. package/src/commands/doctor.js +44 -0
  236. package/src/commands/edit.js +88 -0
  237. package/src/commands/graph.js +20 -0
  238. package/src/commands/handoff.js +45 -0
  239. package/src/commands/hook.js +67 -50
  240. package/src/commands/init.js +74 -55
  241. package/src/commands/learn.js +39 -0
  242. package/src/commands/lint.js +13 -0
  243. package/src/commands/list.js +10 -10
  244. package/src/commands/log.js +49 -0
  245. package/src/commands/memory.js +14 -0
  246. package/src/commands/packs.js +21 -0
  247. package/src/commands/plan.js +41 -0
  248. package/src/commands/reindex.js +8 -8
  249. package/src/commands/review.js +31 -0
  250. package/src/commands/routes.js +13 -0
  251. package/src/commands/search.js +26 -0
  252. package/src/commands/stats.js +35 -0
  253. package/src/commands/undo.js +7 -0
  254. package/src/commands/update.js +20 -14
  255. package/src/lib/catalog.js +32 -0
  256. package/src/lib/config.js +67 -0
  257. package/src/lib/fs-safe.js +36 -11
  258. package/src/lib/gitlog.js +75 -0
  259. package/src/lib/graph.js +96 -0
  260. package/src/lib/ignore.js +47 -0
  261. package/src/lib/index.js +88 -57
  262. package/src/lib/lessons.js +173 -0
  263. package/src/lib/lint.js +185 -0
  264. package/src/lib/lock.js +47 -0
  265. package/src/lib/memory.js +49 -0
  266. package/src/lib/mutate.js +26 -0
  267. package/src/lib/packs.js +25 -0
  268. package/src/lib/paths.js +6 -2
  269. package/src/lib/plan.js +156 -0
  270. package/src/lib/pointers.js +3 -3
  271. package/src/lib/prompts.js +66 -0
  272. package/src/lib/provider.js +27 -0
  273. package/src/lib/report.js +41 -17
  274. package/src/lib/routes.js +59 -0
  275. package/src/lib/run.js +116 -0
  276. package/src/lib/search.js +64 -0
  277. package/src/lib/secrets.js +25 -0
  278. package/src/lib/signals.js +55 -0
  279. package/src/lib/sync.js +20 -12
  280. package/src/lib/tokens.js +8 -0
@@ -0,0 +1,44 @@
1
+ import { join } from "node:path"
2
+ import { readConfig } from "../lib/config.js"
3
+ import { exists, readOptional, walkFiles } from "../lib/fs-safe.js"
4
+ import { lockIsStale } from "../lib/lock.js"
5
+ import { secretHits } from "../lib/secrets.js"
6
+ import { readFile } from "node:fs/promises"
7
+
8
+ export async function doctor(root) {
9
+ const problems = []
10
+ if (!(await readOptional(join(root, ".ctx", "PROCESS.md")))) {
11
+ return ["No .ctx/ folder. Run connore init first."]
12
+ }
13
+ try {
14
+ const { config } = await readConfig(root)
15
+ if (!config) problems.push("missing .ctx/config.json")
16
+ else if (config.schemaVersion !== 1) problems.push(`schemaVersion is ${config.schemaVersion}`)
17
+ } catch (error) {
18
+ problems.push(error.message)
19
+ }
20
+ const lock = await readOptional(join(root, ".ctx", ".lock"))
21
+ if (lock) {
22
+ try {
23
+ const parsed = JSON.parse(lock.toString("utf8"))
24
+ if (!lockIsStale(parsed)) problems.push(`a run holds .ctx/.lock (pid ${parsed.pid})`)
25
+ } catch {
26
+ problems.push(".ctx/.lock is not valid JSON")
27
+ }
28
+ }
29
+ if (!(await exists(join(root, ".ctx", "vault")))) problems.push("missing .ctx/vault")
30
+ if (!(await exists(join(root, ".ctx", "routes.md")))) problems.push("missing .ctx/routes.md. Run connore routes.")
31
+ if (!(await exists(join(root, ".ctx", "prompts", "search.md")))) problems.push("missing .ctx/prompts. Run connore init to add command prompts.")
32
+ const gitignore = await readOptional(join(root, ".gitignore"))
33
+ if (!gitignore || !gitignore.toString("utf8").includes(".ctx/.signals/")) {
34
+ problems.push(".gitignore is missing the connore local-state block")
35
+ }
36
+ for (const dir of ["library", "mine"]) {
37
+ for (const file of await walkFiles(join(root, ".ctx", dir))) {
38
+ if (!file.endsWith(".md")) continue
39
+ const hits = secretHits(await readFile(file, "utf8"))
40
+ if (hits.length) problems.push(`${file} looks like a secret (${hits.join(", ")})`)
41
+ }
42
+ }
43
+ return problems
44
+ }
@@ -0,0 +1,88 @@
1
+ import { join, relative, resolve } from "node:path"
2
+ import { readOptional } from "../lib/fs-safe.js"
3
+ import { today } from "../lib/frontmatter.js"
4
+ import { rebuildIndex } from "../lib/index.js"
5
+ import { commitRemove, commitWrite } from "../lib/mutate.js"
6
+ import { ctxPath } from "../lib/paths.js"
7
+ import { secretHits } from "../lib/secrets.js"
8
+
9
+ function mineFile(root, input) {
10
+ const clean = String(input || "").replace(/\\/g, "/").replace(/^\.ctx\//, "").replace(/^\.\//, "")
11
+ if (!clean.startsWith("mine/") || clean.includes("..") || !clean.endsWith(".md")) {
12
+ throw new Error("Path must be a markdown file under mine/, for example mine/notes.md.")
13
+ }
14
+ const target = resolve(root, ".ctx", ...clean.split("/"))
15
+ const rel = relative(ctxPath(root, "mine"), target)
16
+ if (rel.startsWith("..") || rel.split(/[/\\]/).includes("..")) {
17
+ throw new Error("Path must stay inside .ctx/mine/.")
18
+ }
19
+ return { target, display: `.ctx/${clean}` }
20
+ }
21
+
22
+ function setField(text, key, value) {
23
+ const line = `${key}: ${value}`
24
+ const pattern = new RegExp(`^${key}:.*$`, "m")
25
+ if (pattern.test(text)) return text.replace(pattern, line)
26
+ return text.replace(/\n---/, `\n${line}\n---`)
27
+ }
28
+
29
+ function renderNew({ title, description, tags, text }) {
30
+ return `---
31
+ title: ${title}
32
+ type: doc
33
+ tags: [${tags || "user"}]
34
+ source: user
35
+ updated: ${today()}
36
+ description: ${description}
37
+ ---
38
+
39
+ # ${title}
40
+
41
+ ${text || "User entry."}
42
+ `
43
+ }
44
+
45
+ export async function edit(root, input, flags, report) {
46
+ if (!(await readOptional(join(root, ".ctx", "PROCESS.md")))) throw new Error("No .ctx/ folder. Run connore init first.")
47
+ if (!flags.title && !flags.description && !flags.tags && !flags.text) {
48
+ throw Object.assign(new Error("Pass --title, --description, --tags, or --text."), { exitCode: 2 })
49
+ }
50
+ const { target, display } = mineFile(root, input)
51
+ const current = await readOptional(target)
52
+ let next
53
+ if (!current) {
54
+ const title = flags.title || input.split("/").pop().replace(/\.md$/, "")
55
+ next = renderNew({
56
+ title,
57
+ description: flags.description || "User entry.",
58
+ tags: flags.tags,
59
+ text: flags.text,
60
+ })
61
+ } else {
62
+ next = current.toString("utf8")
63
+ if (flags.title) next = setField(next, "title", flags.title)
64
+ if (flags.description) next = setField(next, "description", flags.description)
65
+ if (flags.tags) next = setField(next, "tags", `[${flags.tags}]`)
66
+ if (flags.text) {
67
+ const end = next.indexOf("\n---", 3)
68
+ if (end === -1) throw new Error("The entry has no frontmatter to keep.")
69
+ const title = flags.title || (next.match(/^title:\s*(.*)$/m)?.[1] ?? "Entry")
70
+ next = `${next.slice(0, end + 4)}\n\n# ${title}\n\n${flags.text.trim()}\n`
71
+ }
72
+ next = setField(next, "updated", today())
73
+ }
74
+ const hits = secretHits(next)
75
+ if (hits.length) throw new Error(`Refusing to write ${display} because it looks like a secret (${hits.join(", ")}).`)
76
+ await commitWrite(target, next, report, display)
77
+ await rebuildIndex(root, report)
78
+ return { path: display }
79
+ }
80
+
81
+ export async function remove(root, input, report) {
82
+ if (!(await readOptional(join(root, ".ctx", "PROCESS.md")))) throw new Error("No .ctx/ folder. Run connore init first.")
83
+ const { target, display } = mineFile(root, input)
84
+ if (!(await readOptional(target))) throw new Error(`No entry at ${display}.`)
85
+ await commitRemove(target, report, display)
86
+ await rebuildIndex(root, report)
87
+ return { path: display }
88
+ }
@@ -0,0 +1,20 @@
1
+ import { buildGraph } from "../lib/graph.js"
2
+
3
+ export async function graph(root, flags, stdout) {
4
+ const { nodes, edges, broken, unconnected } = await buildGraph(root, { includeDrafts: flags.includeDrafts })
5
+ if (flags.json) {
6
+ stdout.write(`${JSON.stringify({ ok: broken.length === 0, entries: nodes.length, edges: edges.length, broken, unconnected })}\n`)
7
+ return broken.length ? 1 : 0
8
+ }
9
+ stdout.write(`${nodes.length} entries, ${edges.length} relationships\n`)
10
+ if (broken.length) {
11
+ stdout.write(`\nBroken references (${broken.length}):\n`)
12
+ for (const problem of broken) stdout.write(` ${problem}\n`)
13
+ }
14
+ if (unconnected.length) {
15
+ stdout.write(`\nNot linked to anything (${unconnected.length}):\n`)
16
+ for (const path of unconnected) stdout.write(` ${path}\n`)
17
+ }
18
+ if (!broken.length && !unconnected.length) stdout.write("Every entry is connected and every reference resolves.\n")
19
+ return broken.length ? 1 : 0
20
+ }
@@ -0,0 +1,45 @@
1
+ import { join } from "node:path"
2
+ import { readOptional } from "../lib/fs-safe.js"
3
+ import { today } from "../lib/frontmatter.js"
4
+ import { commitWrite } from "../lib/mutate.js"
5
+ import { planView } from "../lib/plan.js"
6
+ import { redactSecrets } from "../lib/secrets.js"
7
+
8
+ export async function handoff(root, note, report) {
9
+ if (!(await readOptional(join(root, ".ctx", "PROCESS.md")))) throw new Error("No .ctx/ folder. Run connore init first.")
10
+ const planFile = await readOptional(join(root, ".ctx", "mine", "plan.md"))
11
+ let next = "No plan."
12
+ if (planFile) {
13
+ const view = planView(planFile.toString("utf8"))
14
+ next = view.next || "No open task."
15
+ }
16
+ const journal = await readOptional(join(root, ".ctx", "mine", "journal.md"))
17
+ const recent = journal
18
+ ? journal.toString("utf8").split("\n").filter((line) => line.startsWith("- ")).slice(-5)
19
+ : []
20
+ const safe = redactSecrets(String(note || "").trim())
21
+ const text = `---
22
+ title: Session handoff
23
+ type: log
24
+ tags: [handoff, session]
25
+ source: user
26
+ description: Where the last session stopped. Read this before continuing the work.
27
+ ---
28
+
29
+ # Session handoff
30
+
31
+ Written ${today()}.
32
+
33
+ Next: ${next}
34
+
35
+ ## Recent log
36
+
37
+ ${recent.length ? recent.join("\n") : "None."}
38
+
39
+ ## Note
40
+
41
+ ${safe || "None."}
42
+ `
43
+ await commitWrite(join(root, ".ctx", "mine", "handoff.md"), text, report, ".ctx/mine/handoff.md")
44
+ return { next, note: safe }
45
+ }
@@ -1,50 +1,67 @@
1
- import { join } from "node:path"
2
- import { readOptional, writeAtomic } from "../lib/fs-safe.js"
3
-
4
- export const HOOK_COMMAND = "connore hook"
5
-
6
- export function mergeHookSettings(settings) {
7
- const hooks = settings.hooks && typeof settings.hooks === "object" && !Array.isArray(settings.hooks) ? settings.hooks : {}
8
- const session = Array.isArray(hooks.SessionStart) ? hooks.SessionStart : []
9
- const present = session.some((group) => Array.isArray(group?.hooks) && group.hooks.some((hook) => hook?.command === HOOK_COMMAND))
10
- if (present) return { changed: false, settings }
11
- return {
12
- changed: true,
13
- settings: {
14
- ...settings,
15
- hooks: {
16
- ...hooks,
17
- SessionStart: [...session, { hooks: [{ type: "command", command: HOOK_COMMAND }] }],
18
- },
19
- },
20
- }
21
- }
22
-
23
- export async function installHook(root, report) {
24
- const file = join(root, ".claude", "settings.json")
25
- const current = await readOptional(file)
26
- let json = {}
27
- if (current) {
28
- try {
29
- json = JSON.parse(current.toString("utf8"))
30
- } catch {
31
- throw new Error(".claude/settings.json is not valid JSON, so it was left untouched.")
32
- }
33
- if (!json || typeof json !== "object" || Array.isArray(json)) {
34
- throw new Error(".claude/settings.json must be a JSON object.")
35
- }
36
- }
37
- const merged = mergeHookSettings(json)
38
- const display = ".claude/settings.json"
39
- if (!merged.changed) {
40
- report.add("skipped", display)
41
- return
42
- }
43
- if (!report.dryRun) await writeAtomic(file, `${JSON.stringify(merged.settings, null, 2)}\n`)
44
- report.add(current ? "changed" : "created", display)
45
- }
46
-
47
- export async function printIndex(root, stdout) {
48
- const data = await readOptional(join(root, ".ctx", "INDEX.md"))
49
- if (data) stdout.write(data)
50
- }
1
+ import { join } from "node:path"
2
+ import { readOptional } from "../lib/fs-safe.js"
3
+ import { commitWrite } from "../lib/mutate.js"
4
+
5
+ export const HOOK_COMMAND = "connore hook"
6
+
7
+ export function mergeHookSettings(settings) {
8
+ const hooks = settings.hooks && typeof settings.hooks === "object" && !Array.isArray(settings.hooks) ? settings.hooks : {}
9
+ const session = Array.isArray(hooks.SessionStart) ? hooks.SessionStart : []
10
+ const present = session.some((group) => Array.isArray(group?.hooks) && group.hooks.some((hook) => hook?.command === HOOK_COMMAND))
11
+ if (present) return { changed: false, settings }
12
+ return {
13
+ changed: true,
14
+ settings: {
15
+ ...settings,
16
+ hooks: {
17
+ ...hooks,
18
+ SessionStart: [...session, { hooks: [{ type: "command", command: HOOK_COMMAND }] }],
19
+ },
20
+ },
21
+ }
22
+ }
23
+
24
+ export async function installHook(root, report) {
25
+ const file = join(root, ".claude", "settings.json")
26
+ const current = await readOptional(file)
27
+ let json = {}
28
+ if (current) {
29
+ try {
30
+ json = JSON.parse(current.toString("utf8"))
31
+ } catch {
32
+ throw new Error(".claude/settings.json is not valid JSON, so it was left untouched.")
33
+ }
34
+ if (!json || typeof json !== "object" || Array.isArray(json)) {
35
+ throw new Error(".claude/settings.json must be a JSON object.")
36
+ }
37
+ }
38
+ const merged = mergeHookSettings(json)
39
+ const display = ".claude/settings.json"
40
+ if (!merged.changed) {
41
+ report.add("skipped", display)
42
+ return
43
+ }
44
+ await commitWrite(file, `${JSON.stringify(merged.settings, null, 2)}\n`, report, display)
45
+ }
46
+
47
+ export async function printIndex(root, stdout) {
48
+ const data = await readOptional(join(root, ".ctx", "INDEX.md"))
49
+ let text = data ? data.toString("utf8") : ""
50
+ const { readConfig } = await import("../lib/config.js")
51
+ const config = (await readConfig(root)).config
52
+ if (config) {
53
+ const { changedFiles } = await import("../lib/gitlog.js")
54
+ const { lessonBlock, listAccepted, selectLessons } = await import("../lib/lessons.js")
55
+ const { planHookText } = await import("../lib/plan.js")
56
+ const planFile = await readOptional(join(root, ".ctx", "mine", "plan.md"))
57
+ const planText = planFile ? planHookText(planFile.toString("utf8"), config.lessonBudget) : ""
58
+ const planTokens = Math.ceil(planText.length / 4)
59
+ const chosen = selectLessons(await listAccepted(root), await changedFiles(root), {
60
+ limit: config.lessonLimit,
61
+ budget: Math.max(0, config.lessonBudget - planTokens),
62
+ })
63
+ text += lessonBlock(chosen)
64
+ text += planText
65
+ }
66
+ if (text) stdout.write(text)
67
+ }
@@ -1,55 +1,74 @@
1
- import { join } from "node:path"
2
- import { installHook } from "./hook.js"
3
- import { readOptional, writeAtomic } from "../lib/fs-safe.js"
4
- import { rebuildIndex } from "../lib/index.js"
5
- import { packRoot } from "../lib/paths.js"
6
- import { detectTools, parseTools, patchTools } from "../lib/pointers.js"
7
- import { syncTree } from "../lib/sync.js"
8
-
9
- export const PROCESS_MD = `---
10
- title: Process the inbox
11
- type: doc
12
- tags: [inbox]
13
- source: library
14
- updated: 2026-11-19
15
- description: How an agent turns raw inbox files into entries under mine/.
16
- ---
17
-
18
- # Process the inbox
19
-
20
- When asked to process \`.ctx/inbox\`, write only inside \`.ctx/\`.
21
-
22
- 1. List the inbox files before moving anything.
23
- 2. Copy each finished entry into \`.ctx/mine/\`. Do not edit \`.ctx/library/\`.
24
- 3. Every image or code file needs a same-name \`.md\` twin. Frontmatter: title, type, tags, source: user, updated, description.
25
- 4. Spec the twin in concrete terms: hex colors, font and size, spacing, radius, shadow, animation, and components. Mark anything you cannot see as TODO.
26
- 5. Leave the raw file in \`inbox/\` until the twin exists, then you may remove that inbox file.
27
- 6. Rebuild the index with \`connore index\`.
28
- 7. On later tasks, read \`INDEX.md\` and open only the relevant rows. Prefer the text spec over the image.
29
- `
30
-
31
- async function writeNew(file, contents, display, report) {
32
- if (await readOptional(file)) {
33
- report.add("skipped", display)
34
- return
35
- }
36
- if (!report.dryRun) await writeAtomic(file, contents)
37
- report.add("created", display)
38
- }
39
-
40
- export async function init(root, flags, report) {
41
- const pack = flags.pack || "frontend"
42
- const packDir = join(packRoot, "packs", pack)
43
- if (!(await readOptional(join(packDir, "design", "tokens.md")))) {
44
- throw new Error(`Unknown pack "${pack}".`)
45
- }
46
- const detected = await detectTools(root)
47
- const tools = flags.tools ? parseTools(flags.tools) : detected.length ? detected : ["claude", "codex"]
48
- await syncTree(packDir, join(root, ".ctx", "library"), root, { overwrite: false, report })
49
- await writeNew(join(root, ".ctx", "inbox", ".gitkeep"), "", ".ctx/inbox/.gitkeep", report)
50
- await writeNew(join(root, ".ctx", "mine", ".gitkeep"), "", ".ctx/mine/.gitkeep", report)
51
- await writeNew(join(root, ".ctx", "PROCESS.md"), PROCESS_MD, ".ctx/PROCESS.md", report)
52
- await patchTools(root, tools, report)
53
- if (flags.hooks) await installHook(root, report)
54
- await rebuildIndex(root, report)
55
- }
1
+ import { readFile } from "node:fs/promises"
2
+ import { join } from "node:path"
3
+ import { installHook } from "./hook.js"
4
+ import { ensureConfig } from "../lib/config.js"
5
+ import { ensureLocalIgnores } from "../lib/ignore.js"
6
+ import { readOptional } from "../lib/fs-safe.js"
7
+ import { collectEntries, rebuildIndex } from "../lib/index.js"
8
+ import { ensurePrompts } from "../lib/prompts.js"
9
+ import { renderRoutes } from "../lib/routes.js"
10
+ import { commitWrite } from "../lib/mutate.js"
11
+ import { packRoot } from "../lib/paths.js"
12
+ import { packDir } from "../lib/packs.js"
13
+ import { detectTools, parseTools, patchTools } from "../lib/pointers.js"
14
+ import { syncTree } from "../lib/sync.js"
15
+
16
+ export const PROCESS_MD = `---
17
+ title: Process the inbox
18
+ type: doc
19
+ tags: [inbox]
20
+ source: library
21
+ updated: 2026-11-19
22
+ description: How an agent turns raw inbox files into entries under mine/.
23
+ ---
24
+
25
+ # Process the inbox
26
+
27
+ When asked to process \`.ctx/inbox\`, write only inside \`.ctx/\`.
28
+
29
+ 1. List the inbox files before moving anything.
30
+ 2. Copy each finished entry into \`.ctx/mine/\`. Do not edit \`.ctx/library/\`.
31
+ 3. Every image or code file needs a same-name \`.md\` twin. Frontmatter: title, type, tags, source: user, updated, description.
32
+ 4. Spec the twin in concrete terms: hex colors, font and size, spacing, radius, shadow, animation, and components. Mark anything you cannot see as TODO.
33
+ 5. Leave the raw file in \`inbox/\` until the twin exists, then you may remove that inbox file.
34
+ 6. Rebuild the index with \`connore index\`.
35
+ 7. On later tasks, read \`INDEX.md\` and open only the relevant rows. Prefer the text spec over the image.
36
+ `
37
+
38
+ const VAULT_README = `# Vault
39
+
40
+ Put secrets and local credentials here. connore does not index this folder, copy it into a pack, or send it to a provider.
41
+ `
42
+
43
+ async function writeNew(file, contents, display, report) {
44
+ if (await readOptional(file)) {
45
+ report.add("skipped", display)
46
+ return
47
+ }
48
+ await commitWrite(file, contents, report, display)
49
+ }
50
+
51
+ export async function init(root, flags, report) {
52
+ const pack = flags.pack || "knowledge"
53
+ const source = await packDir(pack)
54
+ const detected = await detectTools(root)
55
+ const tools = flags.tools ? parseTools(flags.tools) : detected.length ? detected : ["claude", "codex"]
56
+ await syncTree(source, join(root, ".ctx", "library"), root, {
57
+ overwrite: false,
58
+ report,
59
+ includeDrafts: flags.includeDrafts,
60
+ })
61
+ await writeNew(join(root, ".ctx", "inbox", ".gitkeep"), "", ".ctx/inbox/.gitkeep", report)
62
+ await writeNew(join(root, ".ctx", "mine", ".gitkeep"), "", ".ctx/mine/.gitkeep", report)
63
+ await writeNew(join(root, ".ctx", "vault", "README.md"), VAULT_README, ".ctx/vault/README.md", report)
64
+ await ensureConfig(root, report, tools, { replaceTools: Boolean(flags.tools), pack })
65
+ await writeNew(join(root, ".ctx", "PROCESS.md"), PROCESS_MD, ".ctx/PROCESS.md", report)
66
+ await writeNew(join(root, ".ctx", "START.md"), await readFile(join(packRoot, "packs", "base", "planning", "START.md")), ".ctx/START.md", report)
67
+ await ensureLocalIgnores(root, report)
68
+ await patchTools(root, tools, report)
69
+ if (flags.hooks) await installHook(root, report)
70
+ await ensurePrompts(root, report)
71
+ await rebuildIndex(root, report, { includeDrafts: flags.includeDrafts })
72
+ const entries = await collectEntries(root, { includeDrafts: flags.includeDrafts })
73
+ await writeNew(join(root, ".ctx", "routes.md"), renderRoutes(entries.map((entry) => entry.path)), ".ctx/routes.md", report)
74
+ }
@@ -0,0 +1,39 @@
1
+ import { readFile } from "node:fs/promises"
2
+ import { readOptional } from "../lib/fs-safe.js"
3
+ import { join } from "node:path"
4
+ import { readGitSignals } from "../lib/gitlog.js"
5
+ import { markLessonHealth, writeProposal } from "../lib/lessons.js"
6
+ import { localLesson, previewCluster } from "../lib/provider.js"
7
+ import { readConfig } from "../lib/config.js"
8
+ import { redactSecrets, secretHits } from "../lib/secrets.js"
9
+ import { clusterSignals, readSignals } from "../lib/signals.js"
10
+
11
+ export async function learn(root, flags, report, io = {}) {
12
+ if (!(await readOptional(join(root, ".ctx", "PROCESS.md")))) throw new Error("No .ctx/ folder. Run connore init first.")
13
+ const { config } = await readConfig(root)
14
+ if ((config?.provider || "local") !== "local" && !io.draft) {
15
+ throw new Error("Refusing to send signals to an unknown provider. Set provider to local.")
16
+ }
17
+ const signals = [...(await readSignals(root)), ...(await readGitSignals(root))]
18
+ if (flags.input) {
19
+ const pasted = redactSecrets(await readFile(flags.input, "utf8"))
20
+ signals.push({ at: new Date().toISOString(), kind: "failure", text: pasted, files: [], source: "input" })
21
+ }
22
+ await markLessonHealth(root, signals, report)
23
+ const clusters = clusterSignals(signals, 3)
24
+ const preview = clusters.map((cluster) => previewCluster(cluster)).join("\n---\n")
25
+ if (!clusters.length || !flags.yes) return { wrote: false, proposals: clusters.length, preview }
26
+ const draft = io.draft || localLesson
27
+ for (const cluster of clusters) {
28
+ const safe = {
29
+ ...cluster,
30
+ rows: cluster.rows.map((row) => ({ ...row, text: redactSecrets(row.text) })),
31
+ }
32
+ const lesson = await draft(safe)
33
+ const rendered = JSON.stringify(lesson)
34
+ const hits = secretHits(rendered)
35
+ if (hits.length) throw new Error(`The drafted lesson still looks like a secret (${hits.join(", ")}).`)
36
+ await writeProposal(root, cluster.id, lesson, report)
37
+ }
38
+ return { wrote: true, proposals: clusters.length, preview }
39
+ }
@@ -0,0 +1,13 @@
1
+ import { join } from "node:path"
2
+ import { readOptional } from "../lib/fs-safe.js"
3
+ import { lintPacks, lintProject } from "../lib/lint.js"
4
+
5
+ // Inside a project, lint the entries on disk. In this repo (no .ctx/), lint the
6
+ // packs that ship with the package.
7
+ export async function lint(root, options = {}) {
8
+ if (!(await readOptional(join(root, ".ctx", "PROCESS.md")))) {
9
+ return { errors: await lintPacks(), warnings: [], scope: "packs" }
10
+ }
11
+ const { errors, warnings } = await lintProject(root, options)
12
+ return { errors, warnings, scope: "project" }
13
+ }
@@ -1,10 +1,10 @@
1
- import { join } from "node:path"
2
- import { readOptional } from "../lib/fs-safe.js"
3
- import { collectEntries } from "../lib/index.js"
4
-
5
- export async function list(root, stdout) {
6
- if (!(await readOptional(join(root, ".ctx", "PROCESS.md")))) throw new Error("No .ctx/ folder. Run connore init first.")
7
- for (const entry of await collectEntries(root)) {
8
- stdout.write(`${entry.type}\t${entry.path}\t${entry.description}\n`)
9
- }
10
- }
1
+ import { join } from "node:path"
2
+ import { readOptional } from "../lib/fs-safe.js"
3
+ import { collectEntries } from "../lib/index.js"
4
+
5
+ export async function list(root, stdout) {
6
+ if (!(await readOptional(join(root, ".ctx", "PROCESS.md")))) throw new Error("No .ctx/ folder. Run connore init first.")
7
+ for (const entry of await collectEntries(root)) {
8
+ stdout.write(`${entry.type}\t${entry.path}\t${entry.description}\n`)
9
+ }
10
+ }
@@ -0,0 +1,49 @@
1
+ import { readOptional } from "../lib/fs-safe.js"
2
+ import { join } from "node:path"
3
+ import { appendSignal } from "../lib/signals.js"
4
+ import { redactSecrets } from "../lib/secrets.js"
5
+ import { today } from "../lib/frontmatter.js"
6
+ import { commitWrite } from "../lib/mutate.js"
7
+
8
+ const KINDS = new Set(["fix", "decision", "failure", "note"])
9
+
10
+ const JOURNAL_HEAD = `---
11
+ title: Journal
12
+ type: log
13
+ tags: [journal]
14
+ source: user
15
+ description: Dated decisions, fixes and failures recorded with connore log.
16
+ ---
17
+
18
+ # Journal
19
+ `
20
+
21
+ export async function appendJournal(root, kind, text, files, report) {
22
+ const file = join(root, ".ctx", "mine", "journal.md")
23
+ const current = await readOptional(file)
24
+ const body = current ? current.toString("utf8").replace(/\s*$/, "\n") : JOURNAL_HEAD
25
+ const suffix = files.length ? ` (${files.join(", ")})` : ""
26
+ const next = `${body}\n- ${today()} ${kind}: ${text}${suffix}\n`
27
+ await commitWrite(file, next, report, ".ctx/mine/journal.md")
28
+ }
29
+
30
+ export async function log(root, kind, text, flags, report) {
31
+ if (!KINDS.has(kind) || !text) {
32
+ throw Object.assign(new Error('Usage: connore log <decision|fix|failure|note> "text".'), { exitCode: 2 })
33
+ }
34
+ if (!(await readOptional(join(root, ".ctx", "PROCESS.md")))) throw new Error("No .ctx/ folder. Run connore init first.")
35
+ const files = flags.files ? flags.files.split(",").map((file) => file.trim()).filter(Boolean) : []
36
+ const safe = redactSecrets(text)
37
+ await appendSignal(
38
+ root,
39
+ {
40
+ at: new Date().toISOString(),
41
+ kind,
42
+ text: safe,
43
+ files,
44
+ source: "log",
45
+ },
46
+ report,
47
+ )
48
+ await appendJournal(root, kind, safe, files, report)
49
+ }
@@ -0,0 +1,14 @@
1
+ import { MEMORIES, appendMemory } from "../lib/memory.js"
2
+ import { rebuildIndex } from "../lib/index.js"
3
+
4
+ export async function memory(root, args, report, stdout, flags) {
5
+ if (!args.length) {
6
+ const lines = MEMORIES.map((item) => `${item.id}\t.ctx/memory/${item.file}\t${item.description}`)
7
+ if (flags.json) stdout.write(`${JSON.stringify({ ok: true, memories: MEMORIES })}\n`)
8
+ else stdout.write(`${lines.join("\n")}\n`)
9
+ return
10
+ }
11
+ const [id, ...rest] = args
12
+ await appendMemory(root, id, rest.join(" "), report)
13
+ await rebuildIndex(root, report, { includeDrafts: flags.includeDrafts })
14
+ }
@@ -0,0 +1,21 @@
1
+ import { readConfig } from "../lib/config.js"
2
+ import { listPacks } from "../lib/packs.js"
3
+
4
+ export async function packs(root, flags, stdout) {
5
+ const available = await listPacks()
6
+ let installed = null
7
+ try {
8
+ const { config } = await readConfig(root)
9
+ installed = config?.pack || null
10
+ } catch {
11
+ installed = null
12
+ }
13
+ if (flags.json) {
14
+ stdout.write(`${JSON.stringify({ ok: true, installed, packs: available })}\n`)
15
+ return
16
+ }
17
+ for (const pack of available) {
18
+ const mark = pack.name === installed ? " (installed)" : ""
19
+ stdout.write(`${pack.name}\t${pack.entries} entries${mark}\n`)
20
+ }
21
+ }