runlist 0.0.0 → 0.94.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (167) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +1112 -6
  3. package/assets/app/app.css +283 -0
  4. package/assets/app/app.mjs +381 -0
  5. package/assets/app/block-editor.mjs +182 -0
  6. package/assets/app/block-model.mjs +52 -0
  7. package/assets/app/document-create.mjs +86 -0
  8. package/assets/app/document-lifecycle.mjs +36 -0
  9. package/assets/app/document-stages.mjs +22 -0
  10. package/assets/app/document-views.mjs +33 -0
  11. package/assets/app/document-yardstick.mjs +258 -0
  12. package/assets/app/editor-navigation.mjs +51 -0
  13. package/assets/app/filing-navigation.mjs +138 -0
  14. package/assets/app/git-changes.mjs +80 -0
  15. package/assets/app/git-commit.mjs +46 -0
  16. package/assets/app/index.html +70 -0
  17. package/assets/app/library-navigation.mjs +93 -0
  18. package/assets/app/outline.mjs +18 -0
  19. package/assets/app/quick-navigation.mjs +52 -0
  20. package/assets/app/record-navigation.mjs +78 -0
  21. package/assets/app/recovery-center.mjs +53 -0
  22. package/assets/app/semantic-search.mjs +14 -0
  23. package/assets/app/settings.mjs +15 -0
  24. package/assets/app/shared.mjs +104 -0
  25. package/assets/app/stage-source.mjs +75 -0
  26. package/assets/app/template-editor.mjs +47 -0
  27. package/assets/app/theme.mjs +25 -0
  28. package/assets/app/transport.mjs +43 -0
  29. package/assets/contracts/source-editing-v1.md +232 -0
  30. package/assets/opencode/plugin.js +162 -0
  31. package/assets/schemas/runlist-record-v1.schema.json +912 -0
  32. package/bin/dotmd.mjs +5 -0
  33. package/bin/runlist.mjs +2714 -0
  34. package/package.json +53 -6
  35. package/plugins/runlist-codex/.codex-plugin/plugin.json +18 -0
  36. package/plugins/runlist-codex/bin/runlist-hook +86 -0
  37. package/plugins/runlist-codex/hooks/hooks.json +16 -0
  38. package/plugins/runlist-codex/skills/runlist/SKILL.md +25 -0
  39. package/runlist.config.example.mjs +370 -0
  40. package/scripts/postinstall.mjs +56 -0
  41. package/src/agent-context.mjs +201 -0
  42. package/src/ai.mjs +30 -0
  43. package/src/app-create.mjs +169 -0
  44. package/src/app-filing.mjs +139 -0
  45. package/src/app-git-commits.mjs +48 -0
  46. package/src/app-git.mjs +180 -0
  47. package/src/app-library.mjs +152 -0
  48. package/src/app-lifecycle-worker.mjs +12 -0
  49. package/src/app-lifecycle.mjs +79 -0
  50. package/src/app-records.mjs +134 -0
  51. package/src/app-search.mjs +80 -0
  52. package/src/app-semantic-search.mjs +105 -0
  53. package/src/app-service.mjs +208 -0
  54. package/src/app-yardstick.mjs +269 -0
  55. package/src/app.mjs +102 -0
  56. package/src/atomic-mutation.mjs +1736 -0
  57. package/src/baton.mjs +435 -0
  58. package/src/body-link.mjs +48 -0
  59. package/src/bulk-tag.mjs +174 -0
  60. package/src/check-collapse.mjs +75 -0
  61. package/src/claude-commands.mjs +75 -0
  62. package/src/cli-editor.mjs +8 -0
  63. package/src/code-refs.mjs +545 -0
  64. package/src/codex-integration.mjs +81 -0
  65. package/src/color.mjs +14 -0
  66. package/src/commands.mjs +374 -0
  67. package/src/completions.mjs +93 -0
  68. package/src/config-edit.mjs +606 -0
  69. package/src/config.mjs +705 -0
  70. package/src/decision-action.mjs +58 -0
  71. package/src/decision.mjs +220 -0
  72. package/src/decisions.mjs +787 -0
  73. package/src/deps.mjs +317 -0
  74. package/src/desktop-install.mjs +158 -0
  75. package/src/desktop-runtime.mjs +4 -0
  76. package/src/desktop.mjs +25 -0
  77. package/src/diff.mjs +101 -0
  78. package/src/doctor.mjs +591 -0
  79. package/src/durable-rename.mjs +55 -0
  80. package/src/errors-read.mjs +44 -0
  81. package/src/export.mjs +496 -0
  82. package/src/extractors.mjs +101 -0
  83. package/src/filing.mjs +255 -0
  84. package/src/fix-membership.mjs +134 -0
  85. package/src/fix-refs.mjs +174 -0
  86. package/src/flags.mjs +318 -0
  87. package/src/frontmatter-fix.mjs +195 -0
  88. package/src/frontmatter.mjs +252 -0
  89. package/src/git-commit-filters.mjs +32 -0
  90. package/src/git-commit-protocol.mjs +198 -0
  91. package/src/git-commit-signing.mjs +75 -0
  92. package/src/git-commit-store.mjs +26 -0
  93. package/src/git-commit-support.mjs +16 -0
  94. package/src/git-commit-worker.mjs +32 -0
  95. package/src/git.mjs +909 -0
  96. package/src/glossary-check.mjs +35 -0
  97. package/src/glossary.mjs +243 -0
  98. package/src/graph.mjs +298 -0
  99. package/src/guard.mjs +488 -0
  100. package/src/health.mjs +212 -0
  101. package/src/hints.mjs +129 -0
  102. package/src/host-integration.mjs +339 -0
  103. package/src/hub-membership.mjs +284 -0
  104. package/src/hub.mjs +296 -0
  105. package/src/hud.mjs +436 -0
  106. package/src/index-file.mjs +163 -0
  107. package/src/index.mjs +478 -0
  108. package/src/init.mjs +512 -0
  109. package/src/install.mjs +222 -0
  110. package/src/journal-read.mjs +116 -0
  111. package/src/journal.mjs +472 -0
  112. package/src/lifecycle.mjs +1444 -0
  113. package/src/lint.mjs +386 -0
  114. package/src/managed-path.mjs +192 -0
  115. package/src/markdown-code-spans.mjs +58 -0
  116. package/src/migrate-prompts.mjs +171 -0
  117. package/src/migrate-template.mjs +170 -0
  118. package/src/migrate.mjs +90 -0
  119. package/src/misuse-read.mjs +61 -0
  120. package/src/model-request.mjs +33 -0
  121. package/src/model.mjs +523 -0
  122. package/src/modules.mjs +355 -0
  123. package/src/naming.mjs +55 -0
  124. package/src/native-action.mjs +59 -0
  125. package/src/native-record.mjs +244 -0
  126. package/src/new.mjs +1321 -0
  127. package/src/output-identity.mjs +111 -0
  128. package/src/parent-plan.mjs +58 -0
  129. package/src/parse-cache.mjs +99 -0
  130. package/src/path-containment.mjs +15 -0
  131. package/src/pickup-card.mjs +293 -0
  132. package/src/pickup.mjs +671 -0
  133. package/src/prompt.mjs +25 -0
  134. package/src/prompts.mjs +585 -0
  135. package/src/public-inspection.mjs +19 -0
  136. package/src/query.mjs +977 -0
  137. package/src/record-action.mjs +11 -0
  138. package/src/record-create.mjs +82 -0
  139. package/src/reference-planner.mjs +388 -0
  140. package/src/reference-values.mjs +11 -0
  141. package/src/rename.mjs +107 -0
  142. package/src/render.mjs +678 -0
  143. package/src/roadmap.mjs +184 -0
  144. package/src/runlist.mjs +944 -0
  145. package/src/section.mjs +225 -0
  146. package/src/semantic-search-client.mjs +58 -0
  147. package/src/ship.mjs +166 -0
  148. package/src/show.mjs +101 -0
  149. package/src/skill-drift.mjs +98 -0
  150. package/src/source-editor.mjs +491 -0
  151. package/src/stages.mjs +73 -0
  152. package/src/state-migration.mjs +123 -0
  153. package/src/stats.mjs +200 -0
  154. package/src/status-metadata.mjs +87 -0
  155. package/src/statuses.mjs +721 -0
  156. package/src/summary.mjs +74 -0
  157. package/src/surfaces.mjs +28 -0
  158. package/src/sync-status.mjs +316 -0
  159. package/src/template-store.mjs +62 -0
  160. package/src/update.mjs +338 -0
  161. package/src/use.mjs +58 -0
  162. package/src/util.mjs +337 -0
  163. package/src/validate.mjs +795 -0
  164. package/src/watch.mjs +56 -0
  165. package/src/xref.mjs +406 -0
  166. package/src/yardstick-command.mjs +178 -0
  167. package/src/yardstick.mjs +112 -0
@@ -0,0 +1,75 @@
1
+ // F13 (0.37.0): collapse high-frequency auto-fixable `runlist check` warnings
2
+ // into one-line remediation hints. Without this, bulk-fixable noise (43
3
+ // `updated behind git history`, N singular-key deprecations) drowns out
4
+ // structural findings in the per-doc list — and forces the reader to
5
+ // reconstruct the fix command per category.
6
+ //
7
+ // Each category names the message regex to match, a short label for the
8
+ // summary line, and the exact `runlist …` command that bulk-fixes it.
9
+
10
+ const COLLAPSE_THRESHOLD = 3;
11
+
12
+ const CATEGORIES = [
13
+ {
14
+ key: 'updated-behind-git',
15
+ match: /^frontmatter `updated:.*` is behind git history/,
16
+ label: 'docs have `updated` behind git history',
17
+ fix: 'runlist touch --git',
18
+ },
19
+ {
20
+ key: 'singular-module',
21
+ match: /^`module:` \(singular\) is deprecated.*Run `runlist lint --fix`/,
22
+ label: 'docs use deprecated singular `module:`',
23
+ fix: 'runlist lint --fix',
24
+ },
25
+ {
26
+ key: 'singular-surface',
27
+ match: /^`surface:` \(singular\) is deprecated.*Run `runlist lint --fix`/,
28
+ label: 'docs use deprecated singular `surface:`',
29
+ fix: 'runlist lint --fix',
30
+ },
31
+ ];
32
+
33
+ function categoryFor(message) {
34
+ for (const cat of CATEGORIES) {
35
+ if (cat.match.test(message)) return cat;
36
+ }
37
+ return null;
38
+ }
39
+
40
+ // Split warnings into per-doc passthrough lines and collapsed summary buckets.
41
+ // A category that hits ≥COLLAPSE_THRESHOLD warnings is summarized; below the
42
+ // threshold each warning falls through as a normal per-doc line (small counts
43
+ // don't gain from collapse and lose path information).
44
+ export function categorizeWarnings(warnings) {
45
+ const buckets = new Map();
46
+ const orphans = [];
47
+
48
+ for (const w of warnings) {
49
+ const cat = categoryFor(w.message);
50
+ if (!cat) {
51
+ orphans.push(w);
52
+ continue;
53
+ }
54
+ if (!buckets.has(cat.key)) buckets.set(cat.key, { cat, items: [] });
55
+ buckets.get(cat.key).items.push(w);
56
+ }
57
+
58
+ const collapsed = [];
59
+ const passthrough = [...orphans];
60
+
61
+ for (const { cat, items } of buckets.values()) {
62
+ if (items.length >= COLLAPSE_THRESHOLD) {
63
+ collapsed.push({ key: cat.key, label: cat.label, fix: cat.fix, count: items.length });
64
+ } else {
65
+ passthrough.push(...items);
66
+ }
67
+ }
68
+
69
+ passthrough.sort((a, b) => a.path.localeCompare(b.path));
70
+ collapsed.sort((a, b) => b.count - a.count || a.key.localeCompare(b.key));
71
+
72
+ return { passthrough, collapsed };
73
+ }
74
+
75
+ export const _internalForTest = { COLLAPSE_THRESHOLD, CATEGORIES };
@@ -0,0 +1,75 @@
1
+ import { existsSync, readdirSync, readFileSync, unlinkSync } from 'node:fs';
2
+ import path from 'node:path';
3
+
4
+ // runlist used to scaffold per-repo `.claude/commands/{plans,docs}.md` slash
5
+ // commands — version-stamped, generated from each repo's status vocab, and
6
+ // self-healed by `runlist hud`. That mechanism is RETIRED. The runlist Claude Code
7
+ // plugin (plugins/runlist/skills/runlist/SKILL.md + bundled hooks) now carries the
8
+ // canonical agent-facing workflow into every repo and every subagent, and
9
+ // `runlist hud` injects the dynamic per-project status vocab at runtime. A static
10
+ // skill + a runtime hook covers the full picture with no per-repo file to drift.
11
+ //
12
+ // The only job left in this module is teardown: delete the stale generated
13
+ // command files runlist left behind so retired scaffolding stops shadowing the
14
+ // plugin skill. Removal is banner-gated — files WITHOUT a generated marker are
15
+ // hand-authored (e.g. a repo's own module-*.md / domain-*.md briefings) and are
16
+ // NEVER touched. Every generated file is fair game, including legacy ones
17
+ // runlist no longer generates (e.g. the old baton.md).
18
+
19
+ // Nothing writes these files any more, so only the legacy banner can exist in
20
+ // the wild; the current spelling is accepted too so a banner-gated teardown
21
+ // never depends on which name stamped the file.
22
+ const GENERATED_MARKERS = ['<!-- runlist-generated:', '<!-- dotmd-generated:'];
23
+
24
+ // The marker sits just below the YAML frontmatter Claude Code surfaces as the
25
+ // command description. That description can be long (the retired plans.md baked
26
+ // the full per-type status vocab into it), pushing the banner well past the
27
+ // first kilobyte — so classify against the whole file, not a head slice. These
28
+ // are tiny command files, so reading them in full is cheap.
29
+ function isGeneratedCommandFile(filePath) {
30
+ try {
31
+ const contents = readFileSync(filePath, 'utf8');
32
+ return GENERATED_MARKERS.some(marker => contents.includes(marker));
33
+ } catch {
34
+ return false;
35
+ }
36
+ }
37
+
38
+ // Remove every banner-stamped slash-command file under .claude/commands.
39
+ // Returns [{ name, action: 'removed' }] for each file cleaned (or that would be
40
+ // cleaned, in dry-run). Never throws — teardown must not break a hook or a
41
+ // command. User-authored command files (no generated banner) survive untouched.
42
+ export function removeGeneratedSlashCommands(cwd, opts = {}) {
43
+ const { dryRun = false } = opts;
44
+ const commandsDir = path.join(cwd, '.claude', 'commands');
45
+ if (!existsSync(commandsDir)) return [];
46
+ let entries;
47
+ try { entries = readdirSync(commandsDir); } catch { return []; }
48
+ const removed = [];
49
+ for (const name of entries) {
50
+ if (!name.endsWith('.md')) continue;
51
+ const filePath = path.join(commandsDir, name);
52
+ if (!isGeneratedCommandFile(filePath)) continue;
53
+ if (!dryRun) {
54
+ try { unlinkSync(filePath); } catch { continue; }
55
+ }
56
+ removed.push({ name, action: 'removed' });
57
+ }
58
+ return removed;
59
+ }
60
+
61
+ // Self-heal entrypoint for `runlist hud` (SessionStart hook). Was: regenerate
62
+ // stale slash commands. Now: delete the retired generated files so the plugin
63
+ // skill is the single source of truth. Returns only the removed entries; an
64
+ // empty array preserves hud's silent-clean contract. Kept under the old name so
65
+ // hud's call site (and its swallow-all-errors wrapper) is unchanged.
66
+ export function refreshStaleSlashCommands(config) {
67
+ return removeGeneratedSlashCommands(config.repoRoot);
68
+ }
69
+
70
+ // Retained as a no-op for API stability. `runlist check` never warned on slash
71
+ // commands (the old auto-heal made it pure noise), and now there is nothing to
72
+ // generate at all. See git history for the retired scaffolder.
73
+ export function checkClaudeCommands(_cwd, _opts = {}) {
74
+ return [];
75
+ }
@@ -0,0 +1,8 @@
1
+ import os from 'node:os';import path from 'node:path';import {createHash} from 'node:crypto';
2
+ import {createSourceEditor,SourceEditError} from './source-editor.mjs';import {hostSessionSource} from './util.mjs';
3
+ export function cliEditor(config,file,{env=process.env,domainPrepare=null}={}) {
4
+ const session=hostSessionSource(env),agent=session?.scope==='session';
5
+ if(session?.scope==='process')throw new SourceEditError('invalid-actor','An agent needs a session-scoped identity before recording an action.');
6
+ const actor=agent?{kind:'agent',id:session.id,session_id:session.id,label:session.host??session.id}:{kind:'human',id:`human:local:${createHash('sha256').update(`${os.userInfo().username}:${os.userInfo().uid}`).digest('hex').slice(0,24)}`,label:os.userInfo().username};
7
+ const editor=createSourceEditor({config,domainPrepare,legacyTypes:[...(config.validTypes??['plan','doc'])].filter(t=>t!=='prompt'),authenticate:()=>actor,authorize:({path:target})=>({allowed:target===file&&!path.relative(config.repoRoot,target).split(path.sep).some(p=>p==='prompts'||p==='.git'||config.excludeDirs?.has(p)),...(agent?{grant_id:`cli:record:${actor.session_id}:${path.relative(config.repoRoot,file)}`}:{})})});return {actor,editor};
8
+ }