@refrakt-md/plan 0.9.6 → 0.9.8
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/dist/cards.d.ts +23 -0
- package/dist/cards.d.ts.map +1 -0
- package/dist/cards.js +150 -0
- package/dist/cards.js.map +1 -0
- package/dist/cli-plugin.d.ts.map +1 -1
- package/dist/cli-plugin.js +14 -5
- package/dist/cli-plugin.js.map +1 -1
- package/dist/commands/create.js +3 -3
- package/dist/commands/create.js.map +1 -1
- package/dist/commands/init.d.ts +7 -2
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +149 -26
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/templates.js +9 -9
- package/dist/commands/templates.js.map +1 -1
- package/dist/diff.d.ts +35 -0
- package/dist/diff.d.ts.map +1 -0
- package/dist/diff.js +88 -0
- package/dist/diff.js.map +1 -0
- package/dist/history.d.ts +3 -35
- package/dist/history.d.ts.map +1 -1
- package/dist/history.js +3 -84
- package/dist/history.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/pipeline.d.ts +2 -11
- package/dist/pipeline.d.ts.map +1 -1
- package/dist/pipeline.js +5 -255
- package/dist/pipeline.js.map +1 -1
- package/dist/relationships.d.ts +36 -0
- package/dist/relationships.d.ts.map +1 -0
- package/dist/relationships.js +128 -0
- package/dist/relationships.js.map +1 -0
- package/dist/render.d.ts +31 -0
- package/dist/render.d.ts.map +1 -0
- package/dist/render.js +57 -0
- package/dist/render.js.map +1 -0
- package/dist/scanner-core.d.ts +10 -0
- package/dist/scanner-core.d.ts.map +1 -0
- package/dist/scanner-core.js +230 -0
- package/dist/scanner-core.js.map +1 -0
- package/dist/scanner.d.ts +2 -9
- package/dist/scanner.d.ts.map +1 -1
- package/dist/scanner.js +5 -230
- package/dist/scanner.js.map +1 -1
- package/package.json +28 -8
package/dist/commands/init.js
CHANGED
|
@@ -1,32 +1,135 @@
|
|
|
1
1
|
import { existsSync, mkdirSync, writeFileSync, readFileSync, appendFileSync } from 'fs';
|
|
2
|
-
import { join } from 'path';
|
|
2
|
+
import { join, dirname } from 'path';
|
|
3
3
|
import { runCreate } from './create.js';
|
|
4
4
|
import { STATUS_PAGES, renderStatusPage, renderTypeIndexPage } from './templates.js';
|
|
5
5
|
export const EXIT_SUCCESS = 0;
|
|
6
6
|
export const EXIT_ALREADY_EXISTS = 1;
|
|
7
|
-
|
|
7
|
+
/** Map of agent tool names to their instruction file paths (relative to project root). */
|
|
8
|
+
export const AGENT_FILES = {
|
|
9
|
+
claude: 'CLAUDE.md',
|
|
10
|
+
cursor: '.cursorrules',
|
|
11
|
+
copilot: '.github/copilot-instructions.md',
|
|
12
|
+
windsurf: '.windsurfrules',
|
|
13
|
+
cline: '.clinerules',
|
|
14
|
+
};
|
|
15
|
+
/** Short pointer appended to agent instruction files. */
|
|
16
|
+
const POINTER_SECTION = `
|
|
8
17
|
## Plan
|
|
9
18
|
|
|
10
|
-
Project planning content lives in \`plan/\`
|
|
19
|
+
Project planning content lives in \`plan/\` using \`@refrakt-md/plan\`. See \`plan/INSTRUCTIONS.md\` for the full workflow guide.
|
|
11
20
|
|
|
12
|
-
|
|
21
|
+
Quick start: \`refrakt plan next\` | \`refrakt plan status\` | \`refrakt plan create work --title "..."\`
|
|
22
|
+
`;
|
|
23
|
+
/** Full tool-agnostic workflow guide written to plan/INSTRUCTIONS.md. */
|
|
24
|
+
const INSTRUCTIONS_CONTENT = `# Plan — Workflow Guide
|
|
25
|
+
|
|
26
|
+
This directory contains project planning content using the \`@refrakt-md/plan\` runes package. All files are Markdoc (\`.md\` with \`{% %}\` tags).
|
|
27
|
+
|
|
28
|
+
## Directory Layout
|
|
29
|
+
|
|
30
|
+
\`\`\`
|
|
31
|
+
plan/
|
|
32
|
+
specs/ — Specifications (what to build)
|
|
33
|
+
work/ — Work items and bugs (how to build it)
|
|
34
|
+
decisions/ — Architecture decision records (why it's built this way)
|
|
35
|
+
milestones/ — Named release targets with scope and goals
|
|
36
|
+
\`\`\`
|
|
37
|
+
|
|
38
|
+
## Workflow
|
|
13
39
|
|
|
14
40
|
1. Find next work item: \`refrakt plan next\`
|
|
15
41
|
2. Start working: \`refrakt plan update <id> --status in-progress\`
|
|
16
|
-
3.
|
|
17
|
-
4.
|
|
18
|
-
5.
|
|
42
|
+
3. Read referenced specs and decisions before implementing
|
|
43
|
+
4. Check off criteria: \`refrakt plan update <id> --check "criterion text"\`
|
|
44
|
+
5. Mark complete with resolution: \`refrakt plan update <id> --status done --resolve "summary of what was done"\`
|
|
45
|
+
6. Check project status: \`refrakt plan status\`
|
|
19
46
|
|
|
20
47
|
When marking a work item done, always provide a \`--resolve\` summary unless the change is trivial. This captures implementation context (files changed, decisions made, branch/PR) for future reference.
|
|
48
|
+
|
|
49
|
+
## ID Conventions
|
|
50
|
+
|
|
51
|
+
| Type | Prefix | Example |
|
|
52
|
+
|------|--------|---------|
|
|
53
|
+
| Spec | \`SPEC-\` | \`SPEC-023\` |
|
|
54
|
+
| Work | \`WORK-\` | \`WORK-051\` |
|
|
55
|
+
| Decision | \`ADR-\` | \`ADR-005\` |
|
|
56
|
+
| Bug | \`BUG-\` | \`BUG-001\` |
|
|
57
|
+
| Milestone | \`v\`+semver | \`v1.0.0\` |
|
|
58
|
+
|
|
59
|
+
IDs are auto-assigned when you omit \`--id\` from \`refrakt plan create\`.
|
|
60
|
+
|
|
61
|
+
## Valid Statuses
|
|
62
|
+
|
|
63
|
+
- **spec**: \`draft\` → \`review\` → \`accepted\` → \`superseded\` | \`deprecated\`
|
|
64
|
+
- **work**: \`draft\` → \`ready\` → \`in-progress\` → \`review\` → \`done\` (also: \`blocked\`)
|
|
65
|
+
- **bug**: \`reported\` → \`confirmed\` → \`in-progress\` → \`fixed\` (also: \`wontfix\`, \`duplicate\`)
|
|
66
|
+
- **decision**: \`proposed\` → \`accepted\` → \`superseded\` | \`deprecated\`
|
|
67
|
+
- **milestone**: \`planning\` → \`active\` → \`complete\`
|
|
68
|
+
|
|
69
|
+
## Creating Items
|
|
70
|
+
|
|
71
|
+
\`\`\`bash
|
|
72
|
+
refrakt plan create work --title "Description"
|
|
73
|
+
refrakt plan create bug --title "Description"
|
|
74
|
+
refrakt plan create spec --title "Description"
|
|
75
|
+
refrakt plan create decision --title "Description"
|
|
76
|
+
refrakt plan create milestone --id v1.0 --title "Description"
|
|
77
|
+
\`\`\`
|
|
78
|
+
|
|
79
|
+
## When to Create Each Type
|
|
80
|
+
|
|
81
|
+
- **Spec**: A new feature idea, design proposal, or system description. Source of truth for *what* to build.
|
|
82
|
+
- **Work item**: A discrete, implementable piece of work with acceptance criteria.
|
|
83
|
+
- **Bug**: A defect report. Use instead of a work item when something is broken rather than missing.
|
|
84
|
+
- **Decision**: An architectural choice that needs to be recorded for future reference.
|
|
85
|
+
|
|
86
|
+
## JSON Output
|
|
87
|
+
|
|
88
|
+
All commands support \`--format json\` for machine-readable output. This is useful for scripting, CI pipelines, and programmatic integration.
|
|
21
89
|
`;
|
|
90
|
+
/**
|
|
91
|
+
* Detect which agent instruction files already exist in the project root.
|
|
92
|
+
* Returns the relative file paths of existing files.
|
|
93
|
+
*/
|
|
94
|
+
function detectAgentFiles(projectRoot) {
|
|
95
|
+
const found = [];
|
|
96
|
+
for (const relPath of Object.values(AGENT_FILES)) {
|
|
97
|
+
if (existsSync(join(projectRoot, relPath))) {
|
|
98
|
+
found.push(relPath);
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
return found;
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Append the plan pointer section to an agent instruction file.
|
|
105
|
+
* Creates the file (and parent directories) if it doesn't exist.
|
|
106
|
+
* Returns true if the file was updated.
|
|
107
|
+
*/
|
|
108
|
+
function appendPointer(projectRoot, relPath) {
|
|
109
|
+
const filePath = join(projectRoot, relPath);
|
|
110
|
+
if (existsSync(filePath)) {
|
|
111
|
+
const content = readFileSync(filePath, 'utf-8');
|
|
112
|
+
if (content.includes('plan/INSTRUCTIONS.md') || content.includes('refrakt plan next')) {
|
|
113
|
+
return false;
|
|
114
|
+
}
|
|
115
|
+
appendFileSync(filePath, POINTER_SECTION);
|
|
116
|
+
return true;
|
|
117
|
+
}
|
|
118
|
+
const dir = dirname(filePath);
|
|
119
|
+
if (!existsSync(dir)) {
|
|
120
|
+
mkdirSync(dir, { recursive: true });
|
|
121
|
+
}
|
|
122
|
+
writeFileSync(filePath, POINTER_SECTION.trimStart());
|
|
123
|
+
return true;
|
|
124
|
+
}
|
|
22
125
|
/**
|
|
23
126
|
* Initialize a plan directory structure with example files.
|
|
24
127
|
*/
|
|
25
128
|
export function runInit(options) {
|
|
26
|
-
const { dir, projectRoot = '.' } = options;
|
|
129
|
+
const { dir, projectRoot = '.', agent } = options;
|
|
27
130
|
const created = [];
|
|
28
131
|
// Create directories
|
|
29
|
-
const dirs = ['work', '
|
|
132
|
+
const dirs = ['work', 'specs', 'decisions', 'milestones'];
|
|
30
133
|
for (const sub of dirs) {
|
|
31
134
|
const path = join(dir, sub);
|
|
32
135
|
if (!existsSync(path)) {
|
|
@@ -36,10 +139,10 @@ export function runInit(options) {
|
|
|
36
139
|
}
|
|
37
140
|
// Create example files — use runCreate which generates slug-based filenames
|
|
38
141
|
const examples = [
|
|
39
|
-
{ type: 'spec', id: 'SPEC-001', title: 'Example Spec', subDir: '
|
|
142
|
+
{ type: 'spec', id: 'SPEC-001', title: 'Example Spec', subDir: 'specs', slug: 'example-spec.md' },
|
|
40
143
|
{ type: 'work', id: 'WORK-001', title: 'Example Work Item', subDir: 'work', slug: 'example-work-item.md', attrs: { priority: 'medium', complexity: 'simple', tags: '' } },
|
|
41
|
-
{ type: 'decision', id: 'ADR-001', title: 'Example Decision', subDir: '
|
|
42
|
-
{ type: 'milestone', id: 'v0.1.0', title: 'First Release', subDir: '
|
|
144
|
+
{ type: 'decision', id: 'ADR-001', title: 'Example Decision', subDir: 'decisions', slug: 'example-decision.md' },
|
|
145
|
+
{ type: 'milestone', id: 'v0.1.0', title: 'First Release', subDir: 'milestones', slug: 'first-release.md' },
|
|
43
146
|
];
|
|
44
147
|
for (const ex of examples) {
|
|
45
148
|
const filePath = join(dir, ex.subDir, ex.slug);
|
|
@@ -75,10 +178,10 @@ This directory contains project planning content.
|
|
|
75
178
|
|
|
76
179
|
## Structure
|
|
77
180
|
|
|
78
|
-
- [Specifications](
|
|
181
|
+
- [Specifications](specs/) — What to build
|
|
79
182
|
- [Work Items](work/) — How to build it
|
|
80
|
-
- [Decisions](
|
|
81
|
-
- [Milestones](
|
|
183
|
+
- [Decisions](decisions/) — Why it's built this way
|
|
184
|
+
- [Milestones](milestones/) — Named release targets
|
|
82
185
|
|
|
83
186
|
## Quick Start
|
|
84
187
|
|
|
@@ -90,20 +193,40 @@ refrakt plan create work --id WORK-002 --title "My task"
|
|
|
90
193
|
`);
|
|
91
194
|
created.push(indexFile);
|
|
92
195
|
}
|
|
93
|
-
//
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
196
|
+
// Create INSTRUCTIONS.md
|
|
197
|
+
const instructionsFile = join(dir, 'INSTRUCTIONS.md');
|
|
198
|
+
if (!existsSync(instructionsFile)) {
|
|
199
|
+
writeFileSync(instructionsFile, INSTRUCTIONS_CONTENT);
|
|
200
|
+
created.push(instructionsFile);
|
|
201
|
+
}
|
|
202
|
+
// Update agent instruction files
|
|
203
|
+
const agentFilesUpdated = [];
|
|
204
|
+
if (agent === 'none') {
|
|
205
|
+
// Skip — user explicitly opted out
|
|
206
|
+
}
|
|
207
|
+
else if (agent) {
|
|
208
|
+
// Specific agent requested
|
|
209
|
+
const relPath = AGENT_FILES[agent];
|
|
210
|
+
if (relPath && appendPointer(projectRoot, relPath)) {
|
|
211
|
+
agentFilesUpdated.push(relPath);
|
|
101
212
|
}
|
|
102
213
|
}
|
|
103
214
|
else {
|
|
104
|
-
|
|
105
|
-
|
|
215
|
+
// Auto-detect: append to all existing agent files, fallback to CLAUDE.md
|
|
216
|
+
const existing = detectAgentFiles(projectRoot);
|
|
217
|
+
if (existing.length > 0) {
|
|
218
|
+
for (const relPath of existing) {
|
|
219
|
+
if (appendPointer(projectRoot, relPath)) {
|
|
220
|
+
agentFilesUpdated.push(relPath);
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
else {
|
|
225
|
+
if (appendPointer(projectRoot, AGENT_FILES.claude)) {
|
|
226
|
+
agentFilesUpdated.push(AGENT_FILES.claude);
|
|
227
|
+
}
|
|
228
|
+
}
|
|
106
229
|
}
|
|
107
|
-
return { dir, created,
|
|
230
|
+
return { dir, created, agentFilesUpdated };
|
|
108
231
|
}
|
|
109
232
|
//# sourceMappingURL=init.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init.js","sourceRoot":"","sources":["../../src/commands/init.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,aAAa,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,IAAI,CAAC;AACxF,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"init.js","sourceRoot":"","sources":["../../src/commands/init.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,aAAa,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,IAAI,CAAC;AACxF,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AACrC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAErF,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,CAAC;AAC9B,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,CAAC;AAIrC,0FAA0F;AAC1F,MAAM,CAAC,MAAM,WAAW,GAA2B;IAClD,MAAM,EAAE,WAAW;IACn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C,IAAI,CAAC,OAAO,CAAC,CAAC;QACjC,CAAC;IACF,CAAC;SAAM,CAAC;QACP,yEAAyE;QACzE,MAAM,QAAQ,GAAG,gBAAgB,CAAC,WAAW,CAAC,CAAC;QAC/C,IAAI,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACzB,KAAK,MAAM,OAAO,IAAI,QAAQ,EAAE,CAAC;gBAChC,IAAI,aAAa,CAAC,WAAW,EAAE,OAAO,CAAC,EAAE,CAAC;oBACzC,iBAAiB,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;gBACjC,CAAC;YACF,CAAC;QACF,CAAC;aAAM,CAAC;YACP,IAAI,aAAa,CAAC,WAAW,EAAE,WAAW,CAAC,MAAM,CAAC,EAAE,CAAC;gBACpD,iBAAiB,CAAC,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;YAC5C,CAAC;QACF,CAAC;IACF,CAAC;IAED,OAAO,EAAE,GAAG,EAAE,OAAO,EAAE,iBAAiB,EAAE,CAAC;AAC5C,CAAC"}
|
|
@@ -119,21 +119,21 @@ export const STATUS_PAGES = [
|
|
|
119
119
|
{ typeDir: 'work', status: 'blocked', title: 'Blocked', sort: 'priority', show: 'all' },
|
|
120
120
|
{ typeDir: 'work', status: 'done', title: 'Done', sort: 'priority', show: 'all' },
|
|
121
121
|
// Specs
|
|
122
|
-
{ typeDir: '
|
|
123
|
-
{ typeDir: '
|
|
122
|
+
{ typeDir: 'specs', status: 'accepted', title: 'Accepted', sort: 'id', show: 'spec' },
|
|
123
|
+
{ typeDir: 'specs', status: 'draft', title: 'Draft', sort: 'id', show: 'spec' },
|
|
124
124
|
// Decisions
|
|
125
|
-
{ typeDir: '
|
|
126
|
-
{ typeDir: '
|
|
125
|
+
{ typeDir: 'decisions', status: 'accepted', title: 'Accepted', sort: 'id', show: 'decision' },
|
|
126
|
+
{ typeDir: 'decisions', status: 'proposed', title: 'Proposed', sort: 'id', show: 'decision' },
|
|
127
127
|
// Milestones
|
|
128
|
-
{ typeDir: '
|
|
129
|
-
{ typeDir: '
|
|
128
|
+
{ typeDir: 'milestones', status: 'active', title: 'Active', sort: 'id', show: 'milestone' },
|
|
129
|
+
{ typeDir: 'milestones', status: 'complete', title: 'Complete', sort: 'id', show: 'milestone' },
|
|
130
130
|
];
|
|
131
131
|
/** Human-readable labels for type directories. */
|
|
132
132
|
const TYPE_TITLES = {
|
|
133
133
|
work: 'Work Items',
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
134
|
+
specs: 'Specifications',
|
|
135
|
+
decisions: 'Decisions',
|
|
136
|
+
milestones: 'Milestones',
|
|
137
137
|
};
|
|
138
138
|
/**
|
|
139
139
|
* Render a status filter page containing a backlog rune that filters by status.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"templates.js","sourceRoot":"","sources":["../../src/commands/templates.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,MAAM,CAAC,MAAM,WAAW,GAAmB,CAAC,MAAM,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,EAAE,WAAW,CAAC,CAAC;AAS5F,MAAM,UAAU,cAAc,CAAC,IAAkB,EAAE,IAAqB;IACvE,QAAQ,IAAI,EAAE,CAAC;QACd,KAAK,MAAM,CAAC,CAAC,OAAO,YAAY,CAAC,IAAI,CAAC,CAAC;QACvC,KAAK,KAAK,CAAC,CAAC,OAAO,WAAW,CAAC,IAAI,CAAC,CAAC;QACrC,KAAK,UAAU,CAAC,CAAC,OAAO,gBAAgB,CAAC,IAAI,CAAC,CAAC;QAC/C,KAAK,MAAM,CAAC,CAAC,OAAO,YAAY,CAAC,IAAI,CAAC,CAAC;QACvC,KAAK,WAAW,CAAC,CAAC,OAAO,iBAAiB,CAAC,IAAI,CAAC,CAAC;IAClD,CAAC;AACF,CAAC;AAED,SAAS,UAAU,CAAC,IAA4B,EAAE,KAA8B;IAC/E,MAAM,MAAM,GAAG,EAAE,GAAG,IAAI,EAAE,GAAG,KAAK,EAAE,C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AO,KAAK,KAAK;;EAEhB,KAAK;CACN,CAAC;AACF,CAAC"}
|
package/dist/diff.d.ts
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
export interface AttributeChange {
|
|
2
|
+
field: string;
|
|
3
|
+
from: string | null;
|
|
4
|
+
to: string | null;
|
|
5
|
+
}
|
|
6
|
+
export interface CriteriaChange {
|
|
7
|
+
text: string;
|
|
8
|
+
action: 'checked' | 'unchecked' | 'added' | 'removed';
|
|
9
|
+
}
|
|
10
|
+
export interface ParsedCheckbox {
|
|
11
|
+
text: string;
|
|
12
|
+
checked: boolean;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Parse attributes from a Markdoc opening tag line.
|
|
16
|
+
* Expects the line to look like: {% type key="value" key2="value2" ... %}
|
|
17
|
+
*/
|
|
18
|
+
export declare function parseTagAttributes(line: string): Record<string, string>;
|
|
19
|
+
/**
|
|
20
|
+
* Extract all checkbox lines from file content.
|
|
21
|
+
*/
|
|
22
|
+
export declare function parseCheckboxes(content: string): ParsedCheckbox[];
|
|
23
|
+
/**
|
|
24
|
+
* Detect whether a ## Resolution section exists in the content.
|
|
25
|
+
*/
|
|
26
|
+
export declare function hasResolutionSection(content: string): boolean;
|
|
27
|
+
/**
|
|
28
|
+
* Diff two attribute maps and return the changes.
|
|
29
|
+
*/
|
|
30
|
+
export declare function diffAttributes(prev: Record<string, string>, curr: Record<string, string>): AttributeChange[];
|
|
31
|
+
/**
|
|
32
|
+
* Diff two checkbox lists by text matching.
|
|
33
|
+
*/
|
|
34
|
+
export declare function diffCriteria(prev: ParsedCheckbox[], curr: ParsedCheckbox[]): CriteriaChange[];
|
|
35
|
+
//# sourceMappingURL=diff.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"diff.d.ts","sourceRoot":"","sources":["../src/diff.ts"],"names":[],"mappings":"AAMA,MAAM,WAAW,eAAe;IAC/B,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,EAAE,EAAE,MAAM,GAAG,IAAI,CAAC;CAClB;AAED,MAAM,WAAW,cAAc;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,SAAS,GAAG,WAAW,GAAG,OAAO,GAAG,SAAS,CAAC;CACtD;AAED,MAAM,WAAW,cAAc;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,OAAO,CAAC;CACjB;AAOD;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAQvE;AAKD;;GAEG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,MAAM,GAAG,cAAc,EAAE,CAYjE;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAE7D;AAID;;GAEG;AACH,wBAAgB,cAAc,CAC7B,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAC5B,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAC1B,eAAe,EAAE,CAYnB;AAED;;GAEG;AACH,wBAAgB,YAAY,CAC3B,IAAI,EAAE,cAAc,EAAE,EACtB,IAAI,EAAE,cAAc,EAAE,GACpB,cAAc,EAAE,CAyBlB"}
|
package/dist/diff.js
ADDED
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
// ─── Pure Diffing Utilities ───
|
|
2
|
+
// Parsing and diffing functions for plan entity attributes and criteria.
|
|
3
|
+
// No Node.js API dependencies — safe for edge runtimes.
|
|
4
|
+
// ─── Parsing ───
|
|
5
|
+
/** Regex to parse the opening Markdoc tag on line 1: {% type key="value" ... %} */
|
|
6
|
+
const TAG_ATTR_RE = /(\w+)="([^"]*)"/g;
|
|
7
|
+
/**
|
|
8
|
+
* Parse attributes from a Markdoc opening tag line.
|
|
9
|
+
* Expects the line to look like: {% type key="value" key2="value2" ... %}
|
|
10
|
+
*/
|
|
11
|
+
export function parseTagAttributes(line) {
|
|
12
|
+
const attrs = {};
|
|
13
|
+
let match;
|
|
14
|
+
TAG_ATTR_RE.lastIndex = 0;
|
|
15
|
+
while ((match = TAG_ATTR_RE.exec(line)) !== null) {
|
|
16
|
+
attrs[match[1]] = match[2];
|
|
17
|
+
}
|
|
18
|
+
return attrs;
|
|
19
|
+
}
|
|
20
|
+
/** Checkbox line pattern: - [ ] text or - [x] text (case-insensitive x) */
|
|
21
|
+
const CHECKBOX_RE = /^[\s]*-\s+\[([ xX])\]\s+(.+)/;
|
|
22
|
+
/**
|
|
23
|
+
* Extract all checkbox lines from file content.
|
|
24
|
+
*/
|
|
25
|
+
export function parseCheckboxes(content) {
|
|
26
|
+
const results = [];
|
|
27
|
+
for (const line of content.split('\n')) {
|
|
28
|
+
const match = CHECKBOX_RE.exec(line);
|
|
29
|
+
if (match) {
|
|
30
|
+
results.push({
|
|
31
|
+
text: match[2].trim(),
|
|
32
|
+
checked: match[1] !== ' ',
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
return results;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Detect whether a ## Resolution section exists in the content.
|
|
40
|
+
*/
|
|
41
|
+
export function hasResolutionSection(content) {
|
|
42
|
+
return /^##\s+Resolution\s*$/m.test(content);
|
|
43
|
+
}
|
|
44
|
+
// ─── Diffing ───
|
|
45
|
+
/**
|
|
46
|
+
* Diff two attribute maps and return the changes.
|
|
47
|
+
*/
|
|
48
|
+
export function diffAttributes(prev, curr) {
|
|
49
|
+
const changes = [];
|
|
50
|
+
const allKeys = new Set([...Object.keys(prev), ...Object.keys(curr)]);
|
|
51
|
+
for (const key of allKeys) {
|
|
52
|
+
const oldVal = prev[key] ?? null;
|
|
53
|
+
const newVal = curr[key] ?? null;
|
|
54
|
+
if (oldVal !== newVal) {
|
|
55
|
+
changes.push({ field: key, from: oldVal, to: newVal });
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
return changes;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Diff two checkbox lists by text matching.
|
|
62
|
+
*/
|
|
63
|
+
export function diffCriteria(prev, curr) {
|
|
64
|
+
const changes = [];
|
|
65
|
+
const prevByText = new Map(prev.map(c => [c.text, c.checked]));
|
|
66
|
+
const currByText = new Map(curr.map(c => [c.text, c.checked]));
|
|
67
|
+
// Check for removed or changed criteria
|
|
68
|
+
for (const [text, wasChecked] of prevByText) {
|
|
69
|
+
const isChecked = currByText.get(text);
|
|
70
|
+
if (isChecked === undefined) {
|
|
71
|
+
changes.push({ text, action: 'removed' });
|
|
72
|
+
}
|
|
73
|
+
else if (wasChecked && !isChecked) {
|
|
74
|
+
changes.push({ text, action: 'unchecked' });
|
|
75
|
+
}
|
|
76
|
+
else if (!wasChecked && isChecked) {
|
|
77
|
+
changes.push({ text, action: 'checked' });
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
// Check for added criteria
|
|
81
|
+
for (const [text] of currByText) {
|
|
82
|
+
if (!prevByText.has(text)) {
|
|
83
|
+
changes.push({ text, action: 'added' });
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
return changes;
|
|
87
|
+
}
|
|
88
|
+
//# sourceMappingURL=diff.js.map
|
package/dist/diff.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"diff.js","sourceRoot":"","sources":["../src/diff.ts"],"names":[],"mappings":"AAAA,iCAAiC;AACjC,yEAAyE;AACzE,wDAAwD;AAoBxD,kBAAkB;AAElB,mFAAmF;AACnF,MAAM,WAAW,GAAG,kBAAkB,CAAC;AAEvC;;;GAGG;AACH,MAAM,UAAU,kBAAkB,CAAC,IAAY;IAC9C,MAAM,KAAK,GAA2B,EAAE,CAAC;IACzC,IAAI,KAA6B,CAAC;IAClC,WAAW,CAAC,SAAS,GAAG,CAAC,CAAC;IAC1B,OAAO,CAAC,KAAK,GAAG,WAAW,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CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,CAAC,CAAC;QAC3C,CAAC;IACF,CAAC;IAED,2BAA2B;IAC3B,KAAK,MAAM,CAAC,IAAI,CAAC,IAAI,UAAU,EAAE,CAAC;QACjC,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC;YAC3B,OAAO,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,CAAC;QACzC,CAAC;IACF,CAAC;IAED,OAAO,OAAO,CAAC;AAChB,CAAC"}
|
package/dist/history.d.ts
CHANGED
|
@@ -1,12 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
to: string | null;
|
|
5
|
-
}
|
|
6
|
-
export interface CriteriaChange {
|
|
7
|
-
text: string;
|
|
8
|
-
action: 'checked' | 'unchecked' | 'added' | 'removed';
|
|
9
|
-
}
|
|
1
|
+
import { type AttributeChange, type CriteriaChange } from './diff.js';
|
|
2
|
+
export { diffAttributes, diffCriteria, parseTagAttributes, parseCheckboxes, hasResolutionSection, } from './diff.js';
|
|
3
|
+
export type { AttributeChange, CriteriaChange, ParsedCheckbox } from './diff.js';
|
|
10
4
|
export interface HistoryEvent {
|
|
11
5
|
kind: 'created' | 'attributes' | 'criteria' | 'resolution' | 'content';
|
|
12
6
|
hash: string;
|
|
@@ -21,31 +15,6 @@ export interface HistoryEvent {
|
|
|
21
15
|
/** Present when kind === 'created' — initial attribute snapshot */
|
|
22
16
|
initialAttributes?: Record<string, string>;
|
|
23
17
|
}
|
|
24
|
-
/**
|
|
25
|
-
* Parse attributes from a Markdoc opening tag line.
|
|
26
|
-
* Expects the line to look like: {% type key="value" key2="value2" ... %}
|
|
27
|
-
*/
|
|
28
|
-
export declare function parseTagAttributes(line: string): Record<string, string>;
|
|
29
|
-
export interface ParsedCheckbox {
|
|
30
|
-
text: string;
|
|
31
|
-
checked: boolean;
|
|
32
|
-
}
|
|
33
|
-
/**
|
|
34
|
-
* Extract all checkbox lines from file content.
|
|
35
|
-
*/
|
|
36
|
-
export declare function parseCheckboxes(content: string): ParsedCheckbox[];
|
|
37
|
-
/**
|
|
38
|
-
* Detect whether a ## Resolution section exists in the content.
|
|
39
|
-
*/
|
|
40
|
-
export declare function hasResolutionSection(content: string): boolean;
|
|
41
|
-
/**
|
|
42
|
-
* Diff two attribute maps and return the changes.
|
|
43
|
-
*/
|
|
44
|
-
export declare function diffAttributes(prev: Record<string, string>, curr: Record<string, string>): AttributeChange[];
|
|
45
|
-
/**
|
|
46
|
-
* Diff two checkbox lists by text matching.
|
|
47
|
-
*/
|
|
48
|
-
export declare function diffCriteria(prev: ParsedCheckbox[], curr: ParsedCheckbox[]): CriteriaChange[];
|
|
49
18
|
interface CommitInfo {
|
|
50
19
|
hash: string;
|
|
51
20
|
date: string;
|
|
@@ -117,5 +86,4 @@ export declare function writeHistoryCache(planDir: string, cache: HistoryCache):
|
|
|
117
86
|
* Returns events sorted by date descending (newest first), with commit hash grouping info.
|
|
118
87
|
*/
|
|
119
88
|
export declare function buildGlobalTimeline(batchHistory: Map<string, HistoryEvent[]>): HistoryEvent[];
|
|
120
|
-
export {};
|
|
121
89
|
//# sourceMappingURL=history.d.ts.map
|
package/dist/history.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"history.d.ts","sourceRoot":"","sources":["../src/history.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"history.d.ts","sourceRoot":"","sources":["../src/history.ts"],"names":[],"mappings":"AAMA,OAAO,EAMN,KAAK,eAAe,EACpB,KAAK,cAAc,EAEnB,MAAM,WAAW,CAAC;AAGnB,OAAO,EACN,cAAc,EACd,YAAY,EACZ,kBAAkB,EAClB,eAAe,EACf,oBAAoB,GACpB,MAAM,WAAW,CAAC;AACnB,YAAY,EAAE,eAAe,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAEjF,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,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,eAAe,EAAE,CA2C/F;AAED;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CAClC,OAAO,EAAE,MAAM,EACf,GAAG,EAAE,MAAM,EACX,OAAO,GAAE;IAAE,KAAK,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,YAAY,CAAA;CAAO,GACpD,GAAG,CAAC,MAAM,EAAE,YAAY,EAAE,CAAC,CA2D7B;AAID,MAAM,WAAW,iBAAiB;IACjC,YAAY,EAAE,MAAM,CAAC;IACrB,MAAM,EAAE,YAAY,EAAE,CAAC;CACvB;AAED,MAAM,WAAW,YAAY;IAC5B,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,iBAAiB,CAAC,CAAC;CAC3C;AAID;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,MAAM,GAAG,YAAY,CAQ9D;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,YAAY,GAAG,IAAI,CAM5E;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CAClC,YAAY,EAAE,GAAG,CAAC,MAAM,EAAE,YAAY,EAAE,CAAC,GACvC,YAAY,EAAE,CAQhB"}
|
package/dist/history.js
CHANGED
|
@@ -3,90 +3,9 @@
|
|
|
3
3
|
import { execSync } from 'node:child_process';
|
|
4
4
|
import { readFileSync, writeFileSync, existsSync } from 'node:fs';
|
|
5
5
|
import { join } from 'node:path';
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* Parse attributes from a Markdoc opening tag line.
|
|
11
|
-
* Expects the line to look like: {% type key="value" key2="value2" ... %}
|
|
12
|
-
*/
|
|
13
|
-
export function parseTagAttributes(line) {
|
|
14
|
-
const attrs = {};
|
|
15
|
-
let match;
|
|
16
|
-
TAG_ATTR_RE.lastIndex = 0;
|
|
17
|
-
while ((match = TAG_ATTR_RE.exec(line)) !== null) {
|
|
18
|
-
attrs[match[1]] = match[2];
|
|
19
|
-
}
|
|
20
|
-
return attrs;
|
|
21
|
-
}
|
|
22
|
-
/** Checkbox line pattern: - [ ] text or - [x] text (case-insensitive x) */
|
|
23
|
-
const CHECKBOX_RE = /^[\s]*-\s+\[([ xX])\]\s+(.+)/;
|
|
24
|
-
/**
|
|
25
|
-
* Extract all checkbox lines from file content.
|
|
26
|
-
*/
|
|
27
|
-
export function parseCheckboxes(content) {
|
|
28
|
-
const results = [];
|
|
29
|
-
for (const line of content.split('\n')) {
|
|
30
|
-
const match = CHECKBOX_RE.exec(line);
|
|
31
|
-
if (match) {
|
|
32
|
-
results.push({
|
|
33
|
-
text: match[2].trim(),
|
|
34
|
-
checked: match[1] !== ' ',
|
|
35
|
-
});
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
return results;
|
|
39
|
-
}
|
|
40
|
-
/**
|
|
41
|
-
* Detect whether a ## Resolution section exists in the content.
|
|
42
|
-
*/
|
|
43
|
-
export function hasResolutionSection(content) {
|
|
44
|
-
return /^##\s+Resolution\s*$/m.test(content);
|
|
45
|
-
}
|
|
46
|
-
// ─── Diffing ───
|
|
47
|
-
/**
|
|
48
|
-
* Diff two attribute maps and return the changes.
|
|
49
|
-
*/
|
|
50
|
-
export function diffAttributes(prev, curr) {
|
|
51
|
-
const changes = [];
|
|
52
|
-
const allKeys = new Set([...Object.keys(prev), ...Object.keys(curr)]);
|
|
53
|
-
for (const key of allKeys) {
|
|
54
|
-
const oldVal = prev[key] ?? null;
|
|
55
|
-
const newVal = curr[key] ?? null;
|
|
56
|
-
if (oldVal !== newVal) {
|
|
57
|
-
changes.push({ field: key, from: oldVal, to: newVal });
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
return changes;
|
|
61
|
-
}
|
|
62
|
-
/**
|
|
63
|
-
* Diff two checkbox lists by text matching.
|
|
64
|
-
*/
|
|
65
|
-
export function diffCriteria(prev, curr) {
|
|
66
|
-
const changes = [];
|
|
67
|
-
const prevByText = new Map(prev.map(c => [c.text, c.checked]));
|
|
68
|
-
const currByText = new Map(curr.map(c => [c.text, c.checked]));
|
|
69
|
-
// Check for removed or changed criteria
|
|
70
|
-
for (const [text, wasChecked] of prevByText) {
|
|
71
|
-
const isChecked = currByText.get(text);
|
|
72
|
-
if (isChecked === undefined) {
|
|
73
|
-
changes.push({ text, action: 'removed' });
|
|
74
|
-
}
|
|
75
|
-
else if (wasChecked && !isChecked) {
|
|
76
|
-
changes.push({ text, action: 'unchecked' });
|
|
77
|
-
}
|
|
78
|
-
else if (!wasChecked && isChecked) {
|
|
79
|
-
changes.push({ text, action: 'checked' });
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
// Check for added criteria
|
|
83
|
-
for (const [text] of currByText) {
|
|
84
|
-
if (!prevByText.has(text)) {
|
|
85
|
-
changes.push({ text, action: 'added' });
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
return changes;
|
|
89
|
-
}
|
|
6
|
+
import { diffAttributes, diffCriteria, parseTagAttributes, parseCheckboxes, hasResolutionSection, } from './diff.js';
|
|
7
|
+
// Re-export pure diffing functions and types for backwards compatibility
|
|
8
|
+
export { diffAttributes, diffCriteria, parseTagAttributes, parseCheckboxes, hasResolutionSection, } from './diff.js';
|
|
90
9
|
/**
|
|
91
10
|
* Get the ordered list of commits that touched a file (oldest first).
|
|
92
11
|
* Uses --follow to track renames.
|