runlist 0.0.0 → 0.94.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +1114 -6
- package/assets/app/app.css +283 -0
- package/assets/app/app.mjs +381 -0
- package/assets/app/block-editor.mjs +182 -0
- package/assets/app/block-model.mjs +52 -0
- package/assets/app/document-create.mjs +86 -0
- package/assets/app/document-lifecycle.mjs +36 -0
- package/assets/app/document-stages.mjs +22 -0
- package/assets/app/document-views.mjs +33 -0
- package/assets/app/document-yardstick.mjs +258 -0
- package/assets/app/editor-navigation.mjs +51 -0
- package/assets/app/filing-navigation.mjs +138 -0
- package/assets/app/git-changes.mjs +80 -0
- package/assets/app/git-commit.mjs +46 -0
- package/assets/app/index.html +70 -0
- package/assets/app/library-navigation.mjs +93 -0
- package/assets/app/outline.mjs +18 -0
- package/assets/app/quick-navigation.mjs +52 -0
- package/assets/app/record-navigation.mjs +78 -0
- package/assets/app/recovery-center.mjs +53 -0
- package/assets/app/semantic-search.mjs +14 -0
- package/assets/app/settings.mjs +15 -0
- package/assets/app/shared.mjs +104 -0
- package/assets/app/stage-source.mjs +75 -0
- package/assets/app/template-editor.mjs +47 -0
- package/assets/app/theme.mjs +25 -0
- package/assets/app/transport.mjs +43 -0
- package/assets/contracts/source-editing-v1.md +232 -0
- package/assets/opencode/plugin.js +162 -0
- package/assets/schemas/runlist-record-v1.schema.json +912 -0
- package/bin/dotmd.mjs +5 -0
- package/bin/runlist.mjs +2714 -0
- package/package.json +53 -6
- package/plugins/runlist-codex/.codex-plugin/plugin.json +18 -0
- package/plugins/runlist-codex/bin/runlist-hook +86 -0
- package/plugins/runlist-codex/hooks/hooks.json +16 -0
- package/plugins/runlist-codex/skills/runlist/SKILL.md +25 -0
- package/runlist.config.example.mjs +370 -0
- package/scripts/postinstall.mjs +56 -0
- package/src/agent-context.mjs +201 -0
- package/src/ai.mjs +30 -0
- package/src/app-create.mjs +169 -0
- package/src/app-filing.mjs +139 -0
- package/src/app-git-commits.mjs +48 -0
- package/src/app-git.mjs +180 -0
- package/src/app-library.mjs +152 -0
- package/src/app-lifecycle-worker.mjs +12 -0
- package/src/app-lifecycle.mjs +79 -0
- package/src/app-records.mjs +134 -0
- package/src/app-search.mjs +80 -0
- package/src/app-semantic-search.mjs +105 -0
- package/src/app-service.mjs +208 -0
- package/src/app-yardstick.mjs +269 -0
- package/src/app.mjs +102 -0
- package/src/atomic-mutation.mjs +1736 -0
- package/src/baton.mjs +435 -0
- package/src/body-link.mjs +48 -0
- package/src/bulk-tag.mjs +174 -0
- package/src/check-collapse.mjs +75 -0
- package/src/claude-commands.mjs +75 -0
- package/src/cli-editor.mjs +8 -0
- package/src/code-refs.mjs +545 -0
- package/src/codex-integration.mjs +81 -0
- package/src/color.mjs +14 -0
- package/src/commands.mjs +374 -0
- package/src/completions.mjs +93 -0
- package/src/config-edit.mjs +606 -0
- package/src/config.mjs +705 -0
- package/src/decision-action.mjs +58 -0
- package/src/decision.mjs +220 -0
- package/src/decisions.mjs +787 -0
- package/src/deps.mjs +317 -0
- package/src/desktop-install.mjs +158 -0
- package/src/desktop-runtime.mjs +4 -0
- package/src/desktop.mjs +25 -0
- package/src/diff.mjs +101 -0
- package/src/doctor.mjs +591 -0
- package/src/durable-rename.mjs +55 -0
- package/src/errors-read.mjs +44 -0
- package/src/export.mjs +496 -0
- package/src/extractors.mjs +101 -0
- package/src/filing.mjs +255 -0
- package/src/fix-membership.mjs +134 -0
- package/src/fix-refs.mjs +174 -0
- package/src/flags.mjs +318 -0
- package/src/frontmatter-fix.mjs +195 -0
- package/src/frontmatter.mjs +252 -0
- package/src/git-commit-filters.mjs +32 -0
- package/src/git-commit-protocol.mjs +198 -0
- package/src/git-commit-signing.mjs +75 -0
- package/src/git-commit-store.mjs +26 -0
- package/src/git-commit-support.mjs +16 -0
- package/src/git-commit-worker.mjs +32 -0
- package/src/git.mjs +909 -0
- package/src/glossary-check.mjs +35 -0
- package/src/glossary.mjs +243 -0
- package/src/graph.mjs +298 -0
- package/src/guard.mjs +488 -0
- package/src/health.mjs +212 -0
- package/src/hints.mjs +129 -0
- package/src/host-integration.mjs +339 -0
- package/src/hub-membership.mjs +284 -0
- package/src/hub.mjs +292 -0
- package/src/hud.mjs +436 -0
- package/src/index-file.mjs +163 -0
- package/src/index.mjs +478 -0
- package/src/init.mjs +512 -0
- package/src/install.mjs +222 -0
- package/src/journal-read.mjs +116 -0
- package/src/journal.mjs +472 -0
- package/src/lifecycle.mjs +1444 -0
- package/src/lint.mjs +386 -0
- package/src/managed-path.mjs +192 -0
- package/src/markdown-code-spans.mjs +58 -0
- package/src/migrate-prompts.mjs +171 -0
- package/src/migrate-template.mjs +170 -0
- package/src/migrate.mjs +90 -0
- package/src/misuse-read.mjs +61 -0
- package/src/model-request.mjs +33 -0
- package/src/model.mjs +523 -0
- package/src/modules.mjs +355 -0
- package/src/naming.mjs +55 -0
- package/src/native-action.mjs +59 -0
- package/src/native-record.mjs +244 -0
- package/src/new.mjs +1321 -0
- package/src/output-identity.mjs +111 -0
- package/src/parent-plan.mjs +58 -0
- package/src/parse-cache.mjs +99 -0
- package/src/path-containment.mjs +15 -0
- package/src/pickup-card.mjs +293 -0
- package/src/pickup.mjs +671 -0
- package/src/prompt.mjs +25 -0
- package/src/prompts.mjs +585 -0
- package/src/query.mjs +977 -0
- package/src/record-action.mjs +11 -0
- package/src/record-create.mjs +82 -0
- package/src/reference-planner.mjs +388 -0
- package/src/reference-values.mjs +11 -0
- package/src/rename.mjs +107 -0
- package/src/render.mjs +678 -0
- package/src/roadmap.mjs +184 -0
- package/src/runlist.mjs +944 -0
- package/src/section.mjs +225 -0
- package/src/semantic-search-client.mjs +58 -0
- package/src/ship.mjs +166 -0
- package/src/show.mjs +101 -0
- package/src/skill-drift.mjs +98 -0
- package/src/source-editor.mjs +491 -0
- package/src/stages.mjs +73 -0
- package/src/state-migration.mjs +123 -0
- package/src/stats.mjs +200 -0
- package/src/status-metadata.mjs +87 -0
- package/src/statuses.mjs +721 -0
- package/src/summary.mjs +74 -0
- package/src/surfaces.mjs +28 -0
- package/src/sync-status.mjs +316 -0
- package/src/template-store.mjs +62 -0
- package/src/update.mjs +338 -0
- package/src/use.mjs +58 -0
- package/src/util.mjs +337 -0
- package/src/validate.mjs +794 -0
- package/src/watch.mjs +56 -0
- package/src/xref.mjs +406 -0
- package/src/yardstick-command.mjs +178 -0
- 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
|
+
}
|