@riotprompt/riotplan 0.0.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.
@@ -0,0 +1,6 @@
1
+ {
2
+ "/Users/tobrien/gitw/kjerneverk/riotplan": {
3
+ "lastTestRun": 1768074377328,
4
+ "lastCommitHash": "42a1f26de39443084ae4f737e587726ded966f7e"
5
+ }
6
+ }
package/LICENSE ADDED
@@ -0,0 +1,190 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ Copyright 2025 Tim O'Brien
179
+
180
+ Licensed under the Apache License, Version 2.0 (the "License");
181
+ you may not use this file except in compliance with the License.
182
+ You may obtain a copy of the License at
183
+
184
+ http://www.apache.org/licenses/LICENSE-2.0
185
+
186
+ Unless required by applicable law or agreed to in writing, software
187
+ distributed under the License is distributed on an "AS IS" BASIS,
188
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
189
+ See the License for the specific language governing permissions and
190
+ limitations under the License.
package/README.md ADDED
@@ -0,0 +1,170 @@
1
+ # riotplan
2
+
3
+ Framework for long-lived, stateful AI workflows (plans).
4
+
5
+ ## What is a Plan?
6
+
7
+ A **plan** is a structured way to manage multi-step AI-assisted tasks that:
8
+
9
+ - **Span multiple sessions** - Work on a task over days or weeks
10
+ - **Have persistent state** - Track progress in STATUS.md
11
+ - **Are organized into steps** - Numbered files (01-STEP.md, 02-STEP.md)
12
+ - **Can be interrupted and resumed** - Pick up where you left off
13
+ - **Support collaboration** - Human reviews, feedback loops
14
+
15
+ ## Plan Structure
16
+
17
+ ```
18
+ my-plan/
19
+ β”œβ”€β”€ my-plan-prompt.md # Meta-prompt (prompt-of-prompts)
20
+ β”œβ”€β”€ SUMMARY.md # Overview of the approach
21
+ β”œβ”€β”€ EXECUTION_PLAN.md # Step-by-step strategy
22
+ β”œβ”€β”€ STATUS.md # Current state (auto-updated)
23
+ β”œβ”€β”€ plan/ # Step files
24
+ β”‚ β”œβ”€β”€ 01-first-step.md
25
+ β”‚ β”œβ”€β”€ 02-second-step.md
26
+ β”‚ └── ...
27
+ └── analysis/ # Analysis output (optional)
28
+ ```
29
+
30
+ ### Key Files
31
+
32
+ | File | Purpose |
33
+ |------|---------|
34
+ | `{code}-prompt.md` | Initial meta-prompt that creates the plan |
35
+ | `SUMMARY.md` | High-level overview of the approach |
36
+ | `EXECUTION_PLAN.md` | Detailed execution strategy |
37
+ | `STATUS.md` | Current state, progress tracking |
38
+ | `01-*.md`, `02-*.md` | Individual step prompts |
39
+
40
+ ## Real-World Examples
41
+
42
+ Plans in the wild:
43
+
44
+ ```
45
+ grunnverk/prompts/
46
+ β”œβ”€β”€ big-splitup/ # Codebase restructuring
47
+ β”œβ”€β”€ commit-splitting/ # Feature implementation
48
+ β”œβ”€β”€ parallel-execution/ # Complex feature with phases
49
+ β”œβ”€β”€ shared-utils/ # Package extraction
50
+ └── ai-service/ # Service extraction
51
+ ```
52
+
53
+ ## Installation
54
+
55
+ ```bash
56
+ npm install riotplan
57
+ ```
58
+
59
+ ## Usage (Coming Soon)
60
+
61
+ ```typescript
62
+ import { loadPlan, resumePlan } from 'riotplan';
63
+
64
+ // Load an existing plan
65
+ const plan = await loadPlan('./prompts/my-feature');
66
+
67
+ console.log(plan.metadata.code); // 'my-feature'
68
+ console.log(plan.state.status); // 'in_progress'
69
+ console.log(plan.state.currentStep); // 3
70
+
71
+ // Resume execution
72
+ const result = await resumePlan(plan);
73
+ ```
74
+
75
+ ## Creating a Plan
76
+
77
+ ```typescript
78
+ import { createPlan } from 'riotplan';
79
+
80
+ const plan = await createPlan({
81
+ code: 'my-feature',
82
+ name: 'My Feature Implementation',
83
+ path: './prompts/my-feature',
84
+ description: 'Implement the new feature with proper testing',
85
+ steps: [
86
+ { title: 'Analysis', description: 'Analyze requirements' },
87
+ { title: 'Design', description: 'Design the solution' },
88
+ { title: 'Implementation', description: 'Build it' },
89
+ { title: 'Testing', description: 'Verify it works' },
90
+ { title: 'Documentation', description: 'Document it' },
91
+ ]
92
+ });
93
+ ```
94
+
95
+ ## STATUS.md Format
96
+
97
+ ```markdown
98
+ # My Feature - Execution Status
99
+
100
+ ## Current State
101
+
102
+ | Field | Value |
103
+ |-------|-------|
104
+ | **Status** | `in_progress` |
105
+ | **Current Step** | 03-implementation |
106
+ | **Last Completed** | 02-design |
107
+ | **Started At** | 2026-01-08 |
108
+ | **Last Updated** | 2026-01-10 |
109
+
110
+ ## Step Progress
111
+
112
+ | Step | Name | Status | Started | Completed | Notes |
113
+ |------|------|--------|---------|-----------|-------|
114
+ | 01 | Analysis | βœ… Completed | 2026-01-08 | 2026-01-08 | - |
115
+ | 02 | Design | βœ… Completed | 2026-01-08 | 2026-01-09 | - |
116
+ | 03 | Implementation | πŸ”„ In Progress | 2026-01-09 | - | 50% done |
117
+ | 04 | Testing | ⬜ Pending | - | - | - |
118
+ | 05 | Documentation | ⬜ Pending | - | - | - |
119
+
120
+ ## Blockers
121
+
122
+ _No blockers currently._
123
+
124
+ ## Issues
125
+
126
+ _No issues encountered._
127
+ ```
128
+
129
+ ## Roadmap
130
+
131
+ ### v0.1.0 - Core Functionality
132
+ - [ ] Load plans from directories
133
+ - [ ] Parse STATUS.md
134
+ - [ ] Generate STATUS.md
135
+ - [ ] Step file discovery
136
+
137
+ ### v0.2.0 - Execution
138
+ - [ ] Execute individual steps
139
+ - [ ] Resume from checkpoint
140
+ - [ ] Update state automatically
141
+
142
+ ### v0.3.0 - Integration
143
+ - [ ] CLI (riotplan-cli)
144
+ - [ ] Agentic execution
145
+ - [ ] Riotprompt integration
146
+
147
+ ## Related Packages
148
+
149
+ - `riotprompt` - Prompt modeling for single interactions
150
+ - `agentic` - Multi-turn conversation framework
151
+ - `execution` - LLM provider interfaces
152
+ - `riotplan-cli` - Command-line interface (coming soon)
153
+
154
+ ## Philosophy
155
+
156
+ Plans bridge the gap between:
157
+ - **Prompts** (single interactions)
158
+ - **Agentic conversations** (multi-turn sessions)
159
+ - **Long-running workflows** (days/weeks of work)
160
+
161
+ A plan provides structure for complex, iterative AI-assisted work where:
162
+ - The work can't be done in one session
163
+ - Progress needs to be tracked
164
+ - Humans need to review and provide feedback
165
+ - The approach may evolve based on findings
166
+
167
+ ## License
168
+
169
+ Apache-2.0
170
+
package/dist/index.cjs ADDED
@@ -0,0 +1,82 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const PLAN_CONVENTIONS = {
4
+ /** Meta-prompt file patterns */
5
+ metaPromptPatterns: [
6
+ "{code}-prompt.md",
7
+ "prompt-of-prompts.md",
8
+ "{code}.md"
9
+ ],
10
+ /** Step file pattern */
11
+ stepPattern: /^(\d{2})-(.+)\.md$/,
12
+ /** Standard files */
13
+ standardFiles: {
14
+ summary: "SUMMARY.md",
15
+ status: "STATUS.md",
16
+ executionPlan: "EXECUTION_PLAN.md",
17
+ readme: "README.md"
18
+ },
19
+ /** Standard directories */
20
+ standardDirs: {
21
+ plan: "plan",
22
+ analysis: "analysis",
23
+ architecture: "architecture",
24
+ implementation: "implementation",
25
+ testing: "testing"
26
+ },
27
+ /** Status emoji mapping */
28
+ statusEmoji: {
29
+ pending: "⬜",
30
+ in_progress: "πŸ”„",
31
+ completed: "βœ…",
32
+ failed: "❌",
33
+ blocked: "⏸️",
34
+ skipped: "⏭️"
35
+ }
36
+ };
37
+ const VERSION = "0.0.1";
38
+ async function loadPlan(_path) {
39
+ throw new Error(
40
+ "riotplan.loadPlan is not yet implemented. Coming in v0.1.0!"
41
+ );
42
+ }
43
+ async function createPlan(_config) {
44
+ throw new Error(
45
+ "riotplan.createPlan is not yet implemented. Coming in v0.1.0!"
46
+ );
47
+ }
48
+ function parseStatus(_content) {
49
+ throw new Error(
50
+ "riotplan.parseStatus is not yet implemented. Coming in v0.1.0!"
51
+ );
52
+ }
53
+ function generateStatus(_plan) {
54
+ throw new Error(
55
+ "riotplan.generateStatus is not yet implemented. Coming in v0.1.0!"
56
+ );
57
+ }
58
+ async function executeStep(_plan, _stepNumber, _context) {
59
+ throw new Error(
60
+ "riotplan.executeStep is not yet implemented. Coming in v0.1.0!"
61
+ );
62
+ }
63
+ async function resumePlan(_plan, _context) {
64
+ throw new Error(
65
+ "riotplan.resumePlan is not yet implemented. Coming in v0.1.0!"
66
+ );
67
+ }
68
+ function updatePlanState(_plan, _stepNumber, _result) {
69
+ throw new Error(
70
+ "riotplan.updatePlanState is not yet implemented. Coming in v0.1.0!"
71
+ );
72
+ }
73
+ exports.PLAN_CONVENTIONS = PLAN_CONVENTIONS;
74
+ exports.VERSION = VERSION;
75
+ exports.createPlan = createPlan;
76
+ exports.executeStep = executeStep;
77
+ exports.generateStatus = generateStatus;
78
+ exports.loadPlan = loadPlan;
79
+ exports.parseStatus = parseStatus;
80
+ exports.resumePlan = resumePlan;
81
+ exports.updatePlanState = updatePlanState;
82
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.cjs","sources":["../src/types.ts","../src/index.ts"],"sourcesContent":["/**\n * RiotPlan Type Definitions\n *\n * Types for long-lived, stateful AI workflows (plans).\n *\n * A plan consists of:\n * - A directory (the plan code/name)\n * - A meta-prompt (prompt-of-prompts)\n * - Numbered step files (01-STEP.md, 02-STEP.md, etc.)\n * - Status tracking (STATUS.md)\n * - Execution strategy (EXECUTION_PLAN.md)\n * - Summary (SUMMARY.md)\n * - Optional analysis directory\n */\n\n// ===== TASK STATUS =====\n\n/**\n * Status of a task, phase, or step\n */\nexport type TaskStatus =\n | \"pending\" // Not started (⬜)\n | \"in_progress\" // Currently active (πŸ”„)\n | \"completed\" // Done (βœ…)\n | \"failed\" // Failed with error (❌)\n | \"blocked\" // Waiting on dependency (⏸️)\n | \"skipped\"; // Intentionally skipped (⏭️)\n\n/**\n * Priority level\n */\nexport type Priority = \"high\" | \"medium\" | \"low\";\n\n// ===== PLAN STRUCTURE =====\n\n/**\n * A single step in a plan (corresponds to a numbered file like 01-STEP.md)\n */\nexport interface PlanStep {\n /** Step number (1, 2, 3...) */\n number: number;\n\n /** Step code/slug (extracted from filename, e.g., \"execution-interfaces\") */\n code: string;\n\n /** Full filename (e.g., \"01-execution-interfaces.md\") */\n filename: string;\n\n /** Human-readable title */\n title: string;\n\n /** Step description */\n description?: string;\n\n /** Current status */\n status: TaskStatus;\n\n /** Dependencies on other steps (by number) */\n dependencies?: number[];\n\n /** When this step was started */\n startedAt?: Date;\n\n /** When this step was completed */\n completedAt?: Date;\n\n /** Duration in milliseconds */\n duration?: number;\n\n /** Notes or issues encountered */\n notes?: string;\n\n /** Path to the step file */\n filePath: string;\n}\n\n/**\n * A phase grouping multiple steps\n */\nexport interface PlanPhase {\n /** Phase number */\n number: number;\n\n /** Phase name */\n name: string;\n\n /** Description */\n description?: string;\n\n /** Steps in this phase */\n steps: number[]; // Step numbers\n\n /** Phase status (derived from step statuses) */\n status: TaskStatus;\n\n /** Estimated duration */\n estimatedDuration?: string;\n\n /** Actual duration */\n actualDuration?: string;\n}\n\n/**\n * Blocker preventing progress\n */\nexport interface Blocker {\n /** Unique identifier */\n id: string;\n\n /** Description of the blocker */\n description: string;\n\n /** Severity */\n severity: Priority;\n\n /** Affected steps */\n affectedSteps: number[];\n\n /** When created */\n createdAt: Date;\n\n /** When resolved */\n resolvedAt?: Date;\n\n /** Resolution notes */\n resolution?: string;\n}\n\n/**\n * Issue encountered during execution\n */\nexport interface Issue {\n /** Unique identifier */\n id: string;\n\n /** Issue title */\n title: string;\n\n /** Description */\n description: string;\n\n /** Severity */\n severity: Priority;\n\n /** Related step */\n step?: number;\n\n /** When encountered */\n createdAt: Date;\n\n /** When resolved */\n resolvedAt?: Date;\n\n /** How it was resolved */\n resolution?: string;\n}\n\n// ===== PLAN METADATA =====\n\n/**\n * Plan metadata from the directory and files\n */\nexport interface PlanMetadata {\n /** Plan code (directory name, e.g., \"big-splitup\") */\n code: string;\n\n /** Human-readable name */\n name: string;\n\n /** Description from SUMMARY.md or meta-prompt */\n description?: string;\n\n /** Version (for tracking changes to the plan itself) */\n version?: string;\n\n /** Author */\n author?: string;\n\n /** Tags for categorization */\n tags?: string[];\n\n /** When the plan was created */\n createdAt?: Date;\n\n /** Path to the plan directory */\n path: string;\n}\n\n// ===== PLAN FILES =====\n\n/**\n * Standard plan files\n */\nexport interface PlanFiles {\n /** Meta-prompt file (e.g., \"big-splitup-prompt.md\" or \"prompt-of-prompts.md\") */\n metaPrompt?: string;\n\n /** Summary file */\n summary?: string;\n\n /** Status file */\n status?: string;\n\n /** Execution plan file */\n executionPlan?: string;\n\n /** README file */\n readme?: string;\n\n /** Step files in order */\n steps: string[];\n\n /** Analysis directory */\n analysisDir?: string;\n\n /** Other directories (architecture/, implementation/, testing/) */\n subdirectories: string[];\n}\n\n// ===== PLAN STATE =====\n\n/**\n * Current state of plan execution\n */\nexport interface PlanState {\n /** Overall plan status */\n status: TaskStatus;\n\n /** Current step being executed */\n currentStep?: number;\n\n /** Last completed step */\n lastCompletedStep?: number;\n\n /** When execution started */\n startedAt?: Date;\n\n /** When last updated */\n lastUpdatedAt: Date;\n\n /** When completed */\n completedAt?: Date;\n\n /** Active blockers */\n blockers: Blocker[];\n\n /** Issues encountered */\n issues: Issue[];\n\n /** Progress percentage (0-100) */\n progress: number;\n}\n\n// ===== COMPLETE PLAN =====\n\n/**\n * Complete plan definition\n */\nexport interface Plan {\n /** Plan metadata */\n metadata: PlanMetadata;\n\n /** Plan files */\n files: PlanFiles;\n\n /** Plan steps */\n steps: PlanStep[];\n\n /** Plan phases (optional grouping) */\n phases?: PlanPhase[];\n\n /** Current state */\n state: PlanState;\n}\n\n// ===== EXECUTION =====\n\n/**\n * Context for plan execution\n */\nexport interface PlanContext {\n /** Working directory */\n workingDirectory: string;\n\n /** The plan being executed */\n plan: Plan;\n\n /** Logger instance */\n logger?: any;\n\n /** Storage for artifacts */\n storage?: any;\n\n /** Environment variables */\n env?: Record<string, string>;\n}\n\n/**\n * Result of executing a step\n */\nexport interface StepResult {\n /** Whether the step succeeded */\n success: boolean;\n\n /** Step number */\n step: number;\n\n /** Output from execution */\n output?: string;\n\n /** Error if failed */\n error?: Error;\n\n /** Duration in milliseconds */\n duration: number;\n\n /** Artifacts produced */\n artifacts?: string[];\n}\n\n/**\n * Result of executing a plan\n */\nexport interface PlanResult {\n /** Whether the plan completed successfully */\n success: boolean;\n\n /** Steps that were executed */\n executedSteps: number[];\n\n /** Steps that succeeded */\n completedSteps: number[];\n\n /** Steps that failed */\n failedSteps: number[];\n\n /** Steps that were skipped */\n skippedSteps: number[];\n\n /** Total duration */\n duration: number;\n\n /** Final plan state */\n finalState: PlanState;\n}\n\n// ===== SERIALIZATION =====\n\n/**\n * STATUS.md schema for parsing/generating\n */\nexport interface StatusDocument {\n /** Document title */\n title: string;\n\n /** Current state summary */\n currentState: {\n status: TaskStatus;\n currentStep?: string;\n lastCompleted?: string;\n startedAt?: string;\n lastUpdated?: string;\n };\n\n /** Step progress table */\n stepProgress: Array<{\n step: string;\n name: string;\n status: TaskStatus;\n started?: string;\n completed?: string;\n notes?: string;\n }>;\n\n /** Blockers section */\n blockers: string[];\n\n /** Issues section */\n issues: string[];\n\n /** Notes section */\n notes?: string;\n}\n\n/**\n * EXECUTION_PLAN.md schema\n */\nexport interface ExecutionPlanDocument {\n /** Strategy description */\n strategy: string;\n\n /** Prerequisites */\n prerequisites: string[];\n\n /** Phases with their steps */\n phases: Array<{\n name: string;\n description: string;\n steps: string[];\n }>;\n\n /** Quality gates */\n qualityGates?: string[];\n\n /** Rollback instructions */\n rollback?: string;\n}\n\n// ===== PLAN CONVENTIONS =====\n\n/**\n * File naming conventions\n */\nexport const PLAN_CONVENTIONS = {\n /** Meta-prompt file patterns */\n metaPromptPatterns: [\n \"{code}-prompt.md\",\n \"prompt-of-prompts.md\",\n \"{code}.md\",\n ],\n\n /** Step file pattern */\n stepPattern: /^(\\d{2})-(.+)\\.md$/,\n\n /** Standard files */\n standardFiles: {\n summary: \"SUMMARY.md\",\n status: \"STATUS.md\",\n executionPlan: \"EXECUTION_PLAN.md\",\n readme: \"README.md\",\n },\n\n /** Standard directories */\n standardDirs: {\n plan: \"plan\",\n analysis: \"analysis\",\n architecture: \"architecture\",\n implementation: \"implementation\",\n testing: \"testing\",\n },\n\n /** Status emoji mapping */\n statusEmoji: {\n pending: \"⬜\",\n in_progress: \"πŸ”„\",\n completed: \"βœ…\",\n failed: \"❌\",\n blocked: \"⏸️\",\n skipped: \"⏭️\",\n } as Record<TaskStatus, string>,\n} as const;\n\n","/**\n * RiotPlan - Framework for long-lived, stateful AI workflows\n *\n * A plan is a structured way to manage multi-step AI-assisted tasks that:\n * - Span multiple sessions/days\n * - Have persistent state (STATUS.md)\n * - Are organized into numbered steps\n * - Can be interrupted and resumed\n * - Track progress with checkboxes and statuses\n *\n * @example Plan directory structure:\n * ```\n * my-plan/\n * β”œβ”€β”€ my-plan-prompt.md # Meta-prompt (prompt-of-prompts)\n * β”œβ”€β”€ SUMMARY.md # Overview of the approach\n * β”œβ”€β”€ EXECUTION_PLAN.md # Step-by-step strategy\n * β”œβ”€β”€ STATUS.md # Current state (auto-updated)\n * β”œβ”€β”€ plan/ # Step files (optional subdirectory)\n * β”‚ β”œβ”€β”€ 01-first-step.md\n * β”‚ β”œβ”€β”€ 02-second-step.md\n * β”‚ └── ...\n * └── analysis/ # Analysis output (optional)\n * ```\n */\n\n// ===== EXPORTS =====\n\n// Types\nexport type {\n TaskStatus,\n Priority,\n PlanStep,\n PlanPhase,\n Blocker,\n Issue,\n PlanMetadata,\n PlanFiles,\n PlanState,\n Plan,\n PlanContext,\n StepResult,\n PlanResult,\n StatusDocument,\n ExecutionPlanDocument,\n} from \"./types.js\";\n\n// Constants\nexport { PLAN_CONVENTIONS } from \"./types.js\";\n\n// Version\nexport const VERSION = \"0.0.1\";\n\n// ===== STUB IMPLEMENTATIONS =====\n// These will be implemented as the project develops\n\n/**\n * Load a plan from a directory\n *\n * @param path - Path to the plan directory\n * @returns The loaded plan\n *\n * @example\n * ```typescript\n * const plan = await loadPlan('./prompts/big-splitup');\n * console.log(plan.metadata.code); // 'big-splitup'\n * console.log(plan.steps.length); // 11\n * ```\n *\n * @stub Not yet implemented\n */\nexport async function loadPlan(_path: string): Promise<never> {\n throw new Error(\n \"riotplan.loadPlan is not yet implemented. Coming in v0.1.0!\"\n );\n}\n\n/**\n * Create a new plan\n *\n * @param config - Plan configuration\n * @returns The created plan\n *\n * @example\n * ```typescript\n * const plan = await createPlan({\n * code: 'my-feature',\n * name: 'My Feature Implementation',\n * path: './prompts/my-feature',\n * steps: [\n * { title: 'Setup', description: 'Initial setup' },\n * { title: 'Implementation', description: 'Core work' },\n * { title: 'Testing', description: 'Verify it works' },\n * ]\n * });\n * ```\n *\n * @stub Not yet implemented\n */\nexport async function createPlan(_config: {\n code: string;\n name: string;\n path: string;\n description?: string;\n steps?: Array<{ title: string; description?: string }>;\n}): Promise<never> {\n throw new Error(\n \"riotplan.createPlan is not yet implemented. Coming in v0.1.0!\"\n );\n}\n\n/**\n * Parse a STATUS.md file\n *\n * @param content - The STATUS.md content\n * @returns Parsed status document\n *\n * @stub Not yet implemented\n */\nexport function parseStatus(_content: string): never {\n throw new Error(\n \"riotplan.parseStatus is not yet implemented. Coming in v0.1.0!\"\n );\n}\n\n/**\n * Generate a STATUS.md file\n *\n * @param plan - The plan to generate status for\n * @returns STATUS.md content\n *\n * @stub Not yet implemented\n */\nexport function generateStatus(_plan: unknown): never {\n throw new Error(\n \"riotplan.generateStatus is not yet implemented. Coming in v0.1.0!\"\n );\n}\n\n/**\n * Execute a plan step\n *\n * @param plan - The plan\n * @param stepNumber - Step to execute\n * @param context - Execution context\n * @returns Step result\n *\n * @stub Not yet implemented\n */\nexport async function executeStep(\n _plan: unknown,\n _stepNumber: number,\n _context?: unknown\n): Promise<never> {\n throw new Error(\n \"riotplan.executeStep is not yet implemented. Coming in v0.1.0!\"\n );\n}\n\n/**\n * Resume a plan from its current state\n *\n * @param plan - The plan to resume\n * @param context - Execution context\n * @returns Plan result\n *\n * @stub Not yet implemented\n */\nexport async function resumePlan(\n _plan: unknown,\n _context?: unknown\n): Promise<never> {\n throw new Error(\n \"riotplan.resumePlan is not yet implemented. Coming in v0.1.0!\"\n );\n}\n\n/**\n * Update plan state after step completion\n *\n * @param plan - The plan\n * @param stepNumber - Completed step\n * @param result - Step result\n * @returns Updated plan\n *\n * @stub Not yet implemented\n */\nexport function updatePlanState(\n _plan: unknown,\n _stepNumber: number,\n _result: unknown\n): never {\n throw new Error(\n \"riotplan.updatePlanState is not yet implemented. Coming in v0.1.0!\"\n );\n}\n\n"],"names":[],"mappings":";;AA6ZO,MAAM,mBAAmB;AAAA;AAAA,EAE5B,oBAAoB;AAAA,IAChB;AAAA,IACA;AAAA,IACA;AAAA,EAAA;AAAA;AAAA,EAIJ,aAAa;AAAA;AAAA,EAGb,eAAe;AAAA,IACX,SAAS;AAAA,IACT,QAAQ;AAAA,IACR,eAAe;AAAA,IACf,QAAQ;AAAA,EAAA;AAAA;AAAA,EAIZ,cAAc;AAAA,IACV,MAAM;AAAA,IACN,UAAU;AAAA,IACV,cAAc;AAAA,IACd,gBAAgB;AAAA,IAChB,SAAS;AAAA,EAAA;AAAA;AAAA,EAIb,aAAa;AAAA,IACT,SAAS;AAAA,IACT,aAAa;AAAA,IACb,WAAW;AAAA,IACX,QAAQ;AAAA,IACR,SAAS;AAAA,IACT,SAAS;AAAA,EAAA;AAEjB;AChZO,MAAM,UAAU;AAoBvB,eAAsB,SAAS,OAA+B;AAC1D,QAAM,IAAI;AAAA,IACN;AAAA,EAAA;AAER;AAwBA,eAAsB,WAAW,SAMd;AACf,QAAM,IAAI;AAAA,IACN;AAAA,EAAA;AAER;AAUO,SAAS,YAAY,UAAyB;AACjD,QAAM,IAAI;AAAA,IACN;AAAA,EAAA;AAER;AAUO,SAAS,eAAe,OAAuB;AAClD,QAAM,IAAI;AAAA,IACN;AAAA,EAAA;AAER;AAYA,eAAsB,YAClB,OACA,aACA,UACc;AACd,QAAM,IAAI;AAAA,IACN;AAAA,EAAA;AAER;AAWA,eAAsB,WAClB,OACA,UACc;AACd,QAAM,IAAI;AAAA,IACN;AAAA,EAAA;AAER;AAYO,SAAS,gBACZ,OACA,aACA,SACK;AACL,QAAM,IAAI;AAAA,IACN;AAAA,EAAA;AAER;;;;;;;;;;"}
@@ -0,0 +1,440 @@
1
+ /**
2
+ * Blocker preventing progress
3
+ */
4
+ export declare interface Blocker {
5
+ /** Unique identifier */
6
+ id: string;
7
+ /** Description of the blocker */
8
+ description: string;
9
+ /** Severity */
10
+ severity: Priority;
11
+ /** Affected steps */
12
+ affectedSteps: number[];
13
+ /** When created */
14
+ createdAt: Date;
15
+ /** When resolved */
16
+ resolvedAt?: Date;
17
+ /** Resolution notes */
18
+ resolution?: string;
19
+ }
20
+
21
+ /**
22
+ * Create a new plan
23
+ *
24
+ * @param config - Plan configuration
25
+ * @returns The created plan
26
+ *
27
+ * @example
28
+ * ```typescript
29
+ * const plan = await createPlan({
30
+ * code: 'my-feature',
31
+ * name: 'My Feature Implementation',
32
+ * path: './prompts/my-feature',
33
+ * steps: [
34
+ * { title: 'Setup', description: 'Initial setup' },
35
+ * { title: 'Implementation', description: 'Core work' },
36
+ * { title: 'Testing', description: 'Verify it works' },
37
+ * ]
38
+ * });
39
+ * ```
40
+ *
41
+ * @stub Not yet implemented
42
+ */
43
+ export declare function createPlan(_config: {
44
+ code: string;
45
+ name: string;
46
+ path: string;
47
+ description?: string;
48
+ steps?: Array<{
49
+ title: string;
50
+ description?: string;
51
+ }>;
52
+ }): Promise<never>;
53
+
54
+ /**
55
+ * Execute a plan step
56
+ *
57
+ * @param plan - The plan
58
+ * @param stepNumber - Step to execute
59
+ * @param context - Execution context
60
+ * @returns Step result
61
+ *
62
+ * @stub Not yet implemented
63
+ */
64
+ export declare function executeStep(_plan: unknown, _stepNumber: number, _context?: unknown): Promise<never>;
65
+
66
+ /**
67
+ * EXECUTION_PLAN.md schema
68
+ */
69
+ export declare interface ExecutionPlanDocument {
70
+ /** Strategy description */
71
+ strategy: string;
72
+ /** Prerequisites */
73
+ prerequisites: string[];
74
+ /** Phases with their steps */
75
+ phases: Array<{
76
+ name: string;
77
+ description: string;
78
+ steps: string[];
79
+ }>;
80
+ /** Quality gates */
81
+ qualityGates?: string[];
82
+ /** Rollback instructions */
83
+ rollback?: string;
84
+ }
85
+
86
+ /**
87
+ * Generate a STATUS.md file
88
+ *
89
+ * @param plan - The plan to generate status for
90
+ * @returns STATUS.md content
91
+ *
92
+ * @stub Not yet implemented
93
+ */
94
+ export declare function generateStatus(_plan: unknown): never;
95
+
96
+ /**
97
+ * Issue encountered during execution
98
+ */
99
+ export declare interface Issue {
100
+ /** Unique identifier */
101
+ id: string;
102
+ /** Issue title */
103
+ title: string;
104
+ /** Description */
105
+ description: string;
106
+ /** Severity */
107
+ severity: Priority;
108
+ /** Related step */
109
+ step?: number;
110
+ /** When encountered */
111
+ createdAt: Date;
112
+ /** When resolved */
113
+ resolvedAt?: Date;
114
+ /** How it was resolved */
115
+ resolution?: string;
116
+ }
117
+
118
+ /**
119
+ * Load a plan from a directory
120
+ *
121
+ * @param path - Path to the plan directory
122
+ * @returns The loaded plan
123
+ *
124
+ * @example
125
+ * ```typescript
126
+ * const plan = await loadPlan('./prompts/big-splitup');
127
+ * console.log(plan.metadata.code); // 'big-splitup'
128
+ * console.log(plan.steps.length); // 11
129
+ * ```
130
+ *
131
+ * @stub Not yet implemented
132
+ */
133
+ export declare function loadPlan(_path: string): Promise<never>;
134
+
135
+ /**
136
+ * Parse a STATUS.md file
137
+ *
138
+ * @param content - The STATUS.md content
139
+ * @returns Parsed status document
140
+ *
141
+ * @stub Not yet implemented
142
+ */
143
+ export declare function parseStatus(_content: string): never;
144
+
145
+ /**
146
+ * Complete plan definition
147
+ */
148
+ export declare interface Plan {
149
+ /** Plan metadata */
150
+ metadata: PlanMetadata;
151
+ /** Plan files */
152
+ files: PlanFiles;
153
+ /** Plan steps */
154
+ steps: PlanStep[];
155
+ /** Plan phases (optional grouping) */
156
+ phases?: PlanPhase[];
157
+ /** Current state */
158
+ state: PlanState;
159
+ }
160
+
161
+ /**
162
+ * File naming conventions
163
+ */
164
+ export declare const PLAN_CONVENTIONS: {
165
+ /** Meta-prompt file patterns */
166
+ readonly metaPromptPatterns: readonly ["{code}-prompt.md", "prompt-of-prompts.md", "{code}.md"];
167
+ /** Step file pattern */
168
+ readonly stepPattern: RegExp;
169
+ /** Standard files */
170
+ readonly standardFiles: {
171
+ readonly summary: "SUMMARY.md";
172
+ readonly status: "STATUS.md";
173
+ readonly executionPlan: "EXECUTION_PLAN.md";
174
+ readonly readme: "README.md";
175
+ };
176
+ /** Standard directories */
177
+ readonly standardDirs: {
178
+ readonly plan: "plan";
179
+ readonly analysis: "analysis";
180
+ readonly architecture: "architecture";
181
+ readonly implementation: "implementation";
182
+ readonly testing: "testing";
183
+ };
184
+ /** Status emoji mapping */
185
+ readonly statusEmoji: Record<TaskStatus, string>;
186
+ };
187
+
188
+ /**
189
+ * Context for plan execution
190
+ */
191
+ export declare interface PlanContext {
192
+ /** Working directory */
193
+ workingDirectory: string;
194
+ /** The plan being executed */
195
+ plan: Plan;
196
+ /** Logger instance */
197
+ logger?: any;
198
+ /** Storage for artifacts */
199
+ storage?: any;
200
+ /** Environment variables */
201
+ env?: Record<string, string>;
202
+ }
203
+
204
+ /**
205
+ * Standard plan files
206
+ */
207
+ export declare interface PlanFiles {
208
+ /** Meta-prompt file (e.g., "big-splitup-prompt.md" or "prompt-of-prompts.md") */
209
+ metaPrompt?: string;
210
+ /** Summary file */
211
+ summary?: string;
212
+ /** Status file */
213
+ status?: string;
214
+ /** Execution plan file */
215
+ executionPlan?: string;
216
+ /** README file */
217
+ readme?: string;
218
+ /** Step files in order */
219
+ steps: string[];
220
+ /** Analysis directory */
221
+ analysisDir?: string;
222
+ /** Other directories (architecture/, implementation/, testing/) */
223
+ subdirectories: string[];
224
+ }
225
+
226
+ /**
227
+ * Plan metadata from the directory and files
228
+ */
229
+ export declare interface PlanMetadata {
230
+ /** Plan code (directory name, e.g., "big-splitup") */
231
+ code: string;
232
+ /** Human-readable name */
233
+ name: string;
234
+ /** Description from SUMMARY.md or meta-prompt */
235
+ description?: string;
236
+ /** Version (for tracking changes to the plan itself) */
237
+ version?: string;
238
+ /** Author */
239
+ author?: string;
240
+ /** Tags for categorization */
241
+ tags?: string[];
242
+ /** When the plan was created */
243
+ createdAt?: Date;
244
+ /** Path to the plan directory */
245
+ path: string;
246
+ }
247
+
248
+ /**
249
+ * A phase grouping multiple steps
250
+ */
251
+ export declare interface PlanPhase {
252
+ /** Phase number */
253
+ number: number;
254
+ /** Phase name */
255
+ name: string;
256
+ /** Description */
257
+ description?: string;
258
+ /** Steps in this phase */
259
+ steps: number[];
260
+ /** Phase status (derived from step statuses) */
261
+ status: TaskStatus;
262
+ /** Estimated duration */
263
+ estimatedDuration?: string;
264
+ /** Actual duration */
265
+ actualDuration?: string;
266
+ }
267
+
268
+ /**
269
+ * Result of executing a plan
270
+ */
271
+ export declare interface PlanResult {
272
+ /** Whether the plan completed successfully */
273
+ success: boolean;
274
+ /** Steps that were executed */
275
+ executedSteps: number[];
276
+ /** Steps that succeeded */
277
+ completedSteps: number[];
278
+ /** Steps that failed */
279
+ failedSteps: number[];
280
+ /** Steps that were skipped */
281
+ skippedSteps: number[];
282
+ /** Total duration */
283
+ duration: number;
284
+ /** Final plan state */
285
+ finalState: PlanState;
286
+ }
287
+
288
+ /**
289
+ * Current state of plan execution
290
+ */
291
+ export declare interface PlanState {
292
+ /** Overall plan status */
293
+ status: TaskStatus;
294
+ /** Current step being executed */
295
+ currentStep?: number;
296
+ /** Last completed step */
297
+ lastCompletedStep?: number;
298
+ /** When execution started */
299
+ startedAt?: Date;
300
+ /** When last updated */
301
+ lastUpdatedAt: Date;
302
+ /** When completed */
303
+ completedAt?: Date;
304
+ /** Active blockers */
305
+ blockers: Blocker[];
306
+ /** Issues encountered */
307
+ issues: Issue[];
308
+ /** Progress percentage (0-100) */
309
+ progress: number;
310
+ }
311
+
312
+ /**
313
+ * A single step in a plan (corresponds to a numbered file like 01-STEP.md)
314
+ */
315
+ export declare interface PlanStep {
316
+ /** Step number (1, 2, 3...) */
317
+ number: number;
318
+ /** Step code/slug (extracted from filename, e.g., "execution-interfaces") */
319
+ code: string;
320
+ /** Full filename (e.g., "01-execution-interfaces.md") */
321
+ filename: string;
322
+ /** Human-readable title */
323
+ title: string;
324
+ /** Step description */
325
+ description?: string;
326
+ /** Current status */
327
+ status: TaskStatus;
328
+ /** Dependencies on other steps (by number) */
329
+ dependencies?: number[];
330
+ /** When this step was started */
331
+ startedAt?: Date;
332
+ /** When this step was completed */
333
+ completedAt?: Date;
334
+ /** Duration in milliseconds */
335
+ duration?: number;
336
+ /** Notes or issues encountered */
337
+ notes?: string;
338
+ /** Path to the step file */
339
+ filePath: string;
340
+ }
341
+
342
+ /**
343
+ * Priority level
344
+ */
345
+ export declare type Priority = "high" | "medium" | "low";
346
+
347
+ /**
348
+ * Resume a plan from its current state
349
+ *
350
+ * @param plan - The plan to resume
351
+ * @param context - Execution context
352
+ * @returns Plan result
353
+ *
354
+ * @stub Not yet implemented
355
+ */
356
+ export declare function resumePlan(_plan: unknown, _context?: unknown): Promise<never>;
357
+
358
+ /**
359
+ * STATUS.md schema for parsing/generating
360
+ */
361
+ export declare interface StatusDocument {
362
+ /** Document title */
363
+ title: string;
364
+ /** Current state summary */
365
+ currentState: {
366
+ status: TaskStatus;
367
+ currentStep?: string;
368
+ lastCompleted?: string;
369
+ startedAt?: string;
370
+ lastUpdated?: string;
371
+ };
372
+ /** Step progress table */
373
+ stepProgress: Array<{
374
+ step: string;
375
+ name: string;
376
+ status: TaskStatus;
377
+ started?: string;
378
+ completed?: string;
379
+ notes?: string;
380
+ }>;
381
+ /** Blockers section */
382
+ blockers: string[];
383
+ /** Issues section */
384
+ issues: string[];
385
+ /** Notes section */
386
+ notes?: string;
387
+ }
388
+
389
+ /**
390
+ * Result of executing a step
391
+ */
392
+ export declare interface StepResult {
393
+ /** Whether the step succeeded */
394
+ success: boolean;
395
+ /** Step number */
396
+ step: number;
397
+ /** Output from execution */
398
+ output?: string;
399
+ /** Error if failed */
400
+ error?: Error;
401
+ /** Duration in milliseconds */
402
+ duration: number;
403
+ /** Artifacts produced */
404
+ artifacts?: string[];
405
+ }
406
+
407
+ /**
408
+ * RiotPlan Type Definitions
409
+ *
410
+ * Types for long-lived, stateful AI workflows (plans).
411
+ *
412
+ * A plan consists of:
413
+ * - A directory (the plan code/name)
414
+ * - A meta-prompt (prompt-of-prompts)
415
+ * - Numbered step files (01-STEP.md, 02-STEP.md, etc.)
416
+ * - Status tracking (STATUS.md)
417
+ * - Execution strategy (EXECUTION_PLAN.md)
418
+ * - Summary (SUMMARY.md)
419
+ * - Optional analysis directory
420
+ */
421
+ /**
422
+ * Status of a task, phase, or step
423
+ */
424
+ export declare type TaskStatus = "pending" | "in_progress" | "completed" | "failed" | "blocked" | "skipped";
425
+
426
+ /**
427
+ * Update plan state after step completion
428
+ *
429
+ * @param plan - The plan
430
+ * @param stepNumber - Completed step
431
+ * @param result - Step result
432
+ * @returns Updated plan
433
+ *
434
+ * @stub Not yet implemented
435
+ */
436
+ export declare function updatePlanState(_plan: unknown, _stepNumber: number, _result: unknown): never;
437
+
438
+ export declare const VERSION = "0.0.1";
439
+
440
+ export { }
package/dist/index.js ADDED
@@ -0,0 +1,82 @@
1
+ const PLAN_CONVENTIONS = {
2
+ /** Meta-prompt file patterns */
3
+ metaPromptPatterns: [
4
+ "{code}-prompt.md",
5
+ "prompt-of-prompts.md",
6
+ "{code}.md"
7
+ ],
8
+ /** Step file pattern */
9
+ stepPattern: /^(\d{2})-(.+)\.md$/,
10
+ /** Standard files */
11
+ standardFiles: {
12
+ summary: "SUMMARY.md",
13
+ status: "STATUS.md",
14
+ executionPlan: "EXECUTION_PLAN.md",
15
+ readme: "README.md"
16
+ },
17
+ /** Standard directories */
18
+ standardDirs: {
19
+ plan: "plan",
20
+ analysis: "analysis",
21
+ architecture: "architecture",
22
+ implementation: "implementation",
23
+ testing: "testing"
24
+ },
25
+ /** Status emoji mapping */
26
+ statusEmoji: {
27
+ pending: "⬜",
28
+ in_progress: "πŸ”„",
29
+ completed: "βœ…",
30
+ failed: "❌",
31
+ blocked: "⏸️",
32
+ skipped: "⏭️"
33
+ }
34
+ };
35
+ const VERSION = "0.0.1";
36
+ async function loadPlan(_path) {
37
+ throw new Error(
38
+ "riotplan.loadPlan is not yet implemented. Coming in v0.1.0!"
39
+ );
40
+ }
41
+ async function createPlan(_config) {
42
+ throw new Error(
43
+ "riotplan.createPlan is not yet implemented. Coming in v0.1.0!"
44
+ );
45
+ }
46
+ function parseStatus(_content) {
47
+ throw new Error(
48
+ "riotplan.parseStatus is not yet implemented. Coming in v0.1.0!"
49
+ );
50
+ }
51
+ function generateStatus(_plan) {
52
+ throw new Error(
53
+ "riotplan.generateStatus is not yet implemented. Coming in v0.1.0!"
54
+ );
55
+ }
56
+ async function executeStep(_plan, _stepNumber, _context) {
57
+ throw new Error(
58
+ "riotplan.executeStep is not yet implemented. Coming in v0.1.0!"
59
+ );
60
+ }
61
+ async function resumePlan(_plan, _context) {
62
+ throw new Error(
63
+ "riotplan.resumePlan is not yet implemented. Coming in v0.1.0!"
64
+ );
65
+ }
66
+ function updatePlanState(_plan, _stepNumber, _result) {
67
+ throw new Error(
68
+ "riotplan.updatePlanState is not yet implemented. Coming in v0.1.0!"
69
+ );
70
+ }
71
+ export {
72
+ PLAN_CONVENTIONS,
73
+ VERSION,
74
+ createPlan,
75
+ executeStep,
76
+ generateStatus,
77
+ loadPlan,
78
+ parseStatus,
79
+ resumePlan,
80
+ updatePlanState
81
+ };
82
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../src/types.ts","../src/index.ts"],"sourcesContent":["/**\n * RiotPlan Type Definitions\n *\n * Types for long-lived, stateful AI workflows (plans).\n *\n * A plan consists of:\n * - A directory (the plan code/name)\n * - A meta-prompt (prompt-of-prompts)\n * - Numbered step files (01-STEP.md, 02-STEP.md, etc.)\n * - Status tracking (STATUS.md)\n * - Execution strategy (EXECUTION_PLAN.md)\n * - Summary (SUMMARY.md)\n * - Optional analysis directory\n */\n\n// ===== TASK STATUS =====\n\n/**\n * Status of a task, phase, or step\n */\nexport type TaskStatus =\n | \"pending\" // Not started (⬜)\n | \"in_progress\" // Currently active (πŸ”„)\n | \"completed\" // Done (βœ…)\n | \"failed\" // Failed with error (❌)\n | \"blocked\" // Waiting on dependency (⏸️)\n | \"skipped\"; // Intentionally skipped (⏭️)\n\n/**\n * Priority level\n */\nexport type Priority = \"high\" | \"medium\" | \"low\";\n\n// ===== PLAN STRUCTURE =====\n\n/**\n * A single step in a plan (corresponds to a numbered file like 01-STEP.md)\n */\nexport interface PlanStep {\n /** Step number (1, 2, 3...) */\n number: number;\n\n /** Step code/slug (extracted from filename, e.g., \"execution-interfaces\") */\n code: string;\n\n /** Full filename (e.g., \"01-execution-interfaces.md\") */\n filename: string;\n\n /** Human-readable title */\n title: string;\n\n /** Step description */\n description?: string;\n\n /** Current status */\n status: TaskStatus;\n\n /** Dependencies on other steps (by number) */\n dependencies?: number[];\n\n /** When this step was started */\n startedAt?: Date;\n\n /** When this step was completed */\n completedAt?: Date;\n\n /** Duration in milliseconds */\n duration?: number;\n\n /** Notes or issues encountered */\n notes?: string;\n\n /** Path to the step file */\n filePath: string;\n}\n\n/**\n * A phase grouping multiple steps\n */\nexport interface PlanPhase {\n /** Phase number */\n number: number;\n\n /** Phase name */\n name: string;\n\n /** Description */\n description?: string;\n\n /** Steps in this phase */\n steps: number[]; // Step numbers\n\n /** Phase status (derived from step statuses) */\n status: TaskStatus;\n\n /** Estimated duration */\n estimatedDuration?: string;\n\n /** Actual duration */\n actualDuration?: string;\n}\n\n/**\n * Blocker preventing progress\n */\nexport interface Blocker {\n /** Unique identifier */\n id: string;\n\n /** Description of the blocker */\n description: string;\n\n /** Severity */\n severity: Priority;\n\n /** Affected steps */\n affectedSteps: number[];\n\n /** When created */\n createdAt: Date;\n\n /** When resolved */\n resolvedAt?: Date;\n\n /** Resolution notes */\n resolution?: string;\n}\n\n/**\n * Issue encountered during execution\n */\nexport interface Issue {\n /** Unique identifier */\n id: string;\n\n /** Issue title */\n title: string;\n\n /** Description */\n description: string;\n\n /** Severity */\n severity: Priority;\n\n /** Related step */\n step?: number;\n\n /** When encountered */\n createdAt: Date;\n\n /** When resolved */\n resolvedAt?: Date;\n\n /** How it was resolved */\n resolution?: string;\n}\n\n// ===== PLAN METADATA =====\n\n/**\n * Plan metadata from the directory and files\n */\nexport interface PlanMetadata {\n /** Plan code (directory name, e.g., \"big-splitup\") */\n code: string;\n\n /** Human-readable name */\n name: string;\n\n /** Description from SUMMARY.md or meta-prompt */\n description?: string;\n\n /** Version (for tracking changes to the plan itself) */\n version?: string;\n\n /** Author */\n author?: string;\n\n /** Tags for categorization */\n tags?: string[];\n\n /** When the plan was created */\n createdAt?: Date;\n\n /** Path to the plan directory */\n path: string;\n}\n\n// ===== PLAN FILES =====\n\n/**\n * Standard plan files\n */\nexport interface PlanFiles {\n /** Meta-prompt file (e.g., \"big-splitup-prompt.md\" or \"prompt-of-prompts.md\") */\n metaPrompt?: string;\n\n /** Summary file */\n summary?: string;\n\n /** Status file */\n status?: string;\n\n /** Execution plan file */\n executionPlan?: string;\n\n /** README file */\n readme?: string;\n\n /** Step files in order */\n steps: string[];\n\n /** Analysis directory */\n analysisDir?: string;\n\n /** Other directories (architecture/, implementation/, testing/) */\n subdirectories: string[];\n}\n\n// ===== PLAN STATE =====\n\n/**\n * Current state of plan execution\n */\nexport interface PlanState {\n /** Overall plan status */\n status: TaskStatus;\n\n /** Current step being executed */\n currentStep?: number;\n\n /** Last completed step */\n lastCompletedStep?: number;\n\n /** When execution started */\n startedAt?: Date;\n\n /** When last updated */\n lastUpdatedAt: Date;\n\n /** When completed */\n completedAt?: Date;\n\n /** Active blockers */\n blockers: Blocker[];\n\n /** Issues encountered */\n issues: Issue[];\n\n /** Progress percentage (0-100) */\n progress: number;\n}\n\n// ===== COMPLETE PLAN =====\n\n/**\n * Complete plan definition\n */\nexport interface Plan {\n /** Plan metadata */\n metadata: PlanMetadata;\n\n /** Plan files */\n files: PlanFiles;\n\n /** Plan steps */\n steps: PlanStep[];\n\n /** Plan phases (optional grouping) */\n phases?: PlanPhase[];\n\n /** Current state */\n state: PlanState;\n}\n\n// ===== EXECUTION =====\n\n/**\n * Context for plan execution\n */\nexport interface PlanContext {\n /** Working directory */\n workingDirectory: string;\n\n /** The plan being executed */\n plan: Plan;\n\n /** Logger instance */\n logger?: any;\n\n /** Storage for artifacts */\n storage?: any;\n\n /** Environment variables */\n env?: Record<string, string>;\n}\n\n/**\n * Result of executing a step\n */\nexport interface StepResult {\n /** Whether the step succeeded */\n success: boolean;\n\n /** Step number */\n step: number;\n\n /** Output from execution */\n output?: string;\n\n /** Error if failed */\n error?: Error;\n\n /** Duration in milliseconds */\n duration: number;\n\n /** Artifacts produced */\n artifacts?: string[];\n}\n\n/**\n * Result of executing a plan\n */\nexport interface PlanResult {\n /** Whether the plan completed successfully */\n success: boolean;\n\n /** Steps that were executed */\n executedSteps: number[];\n\n /** Steps that succeeded */\n completedSteps: number[];\n\n /** Steps that failed */\n failedSteps: number[];\n\n /** Steps that were skipped */\n skippedSteps: number[];\n\n /** Total duration */\n duration: number;\n\n /** Final plan state */\n finalState: PlanState;\n}\n\n// ===== SERIALIZATION =====\n\n/**\n * STATUS.md schema for parsing/generating\n */\nexport interface StatusDocument {\n /** Document title */\n title: string;\n\n /** Current state summary */\n currentState: {\n status: TaskStatus;\n currentStep?: string;\n lastCompleted?: string;\n startedAt?: string;\n lastUpdated?: string;\n };\n\n /** Step progress table */\n stepProgress: Array<{\n step: string;\n name: string;\n status: TaskStatus;\n started?: string;\n completed?: string;\n notes?: string;\n }>;\n\n /** Blockers section */\n blockers: string[];\n\n /** Issues section */\n issues: string[];\n\n /** Notes section */\n notes?: string;\n}\n\n/**\n * EXECUTION_PLAN.md schema\n */\nexport interface ExecutionPlanDocument {\n /** Strategy description */\n strategy: string;\n\n /** Prerequisites */\n prerequisites: string[];\n\n /** Phases with their steps */\n phases: Array<{\n name: string;\n description: string;\n steps: string[];\n }>;\n\n /** Quality gates */\n qualityGates?: string[];\n\n /** Rollback instructions */\n rollback?: string;\n}\n\n// ===== PLAN CONVENTIONS =====\n\n/**\n * File naming conventions\n */\nexport const PLAN_CONVENTIONS = {\n /** Meta-prompt file patterns */\n metaPromptPatterns: [\n \"{code}-prompt.md\",\n \"prompt-of-prompts.md\",\n \"{code}.md\",\n ],\n\n /** Step file pattern */\n stepPattern: /^(\\d{2})-(.+)\\.md$/,\n\n /** Standard files */\n standardFiles: {\n summary: \"SUMMARY.md\",\n status: \"STATUS.md\",\n executionPlan: \"EXECUTION_PLAN.md\",\n readme: \"README.md\",\n },\n\n /** Standard directories */\n standardDirs: {\n plan: \"plan\",\n analysis: \"analysis\",\n architecture: \"architecture\",\n implementation: \"implementation\",\n testing: \"testing\",\n },\n\n /** Status emoji mapping */\n statusEmoji: {\n pending: \"⬜\",\n in_progress: \"πŸ”„\",\n completed: \"βœ…\",\n failed: \"❌\",\n blocked: \"⏸️\",\n skipped: \"⏭️\",\n } as Record<TaskStatus, string>,\n} as const;\n\n","/**\n * RiotPlan - Framework for long-lived, stateful AI workflows\n *\n * A plan is a structured way to manage multi-step AI-assisted tasks that:\n * - Span multiple sessions/days\n * - Have persistent state (STATUS.md)\n * - Are organized into numbered steps\n * - Can be interrupted and resumed\n * - Track progress with checkboxes and statuses\n *\n * @example Plan directory structure:\n * ```\n * my-plan/\n * β”œβ”€β”€ my-plan-prompt.md # Meta-prompt (prompt-of-prompts)\n * β”œβ”€β”€ SUMMARY.md # Overview of the approach\n * β”œβ”€β”€ EXECUTION_PLAN.md # Step-by-step strategy\n * β”œβ”€β”€ STATUS.md # Current state (auto-updated)\n * β”œβ”€β”€ plan/ # Step files (optional subdirectory)\n * β”‚ β”œβ”€β”€ 01-first-step.md\n * β”‚ β”œβ”€β”€ 02-second-step.md\n * β”‚ └── ...\n * └── analysis/ # Analysis output (optional)\n * ```\n */\n\n// ===== EXPORTS =====\n\n// Types\nexport type {\n TaskStatus,\n Priority,\n PlanStep,\n PlanPhase,\n Blocker,\n Issue,\n PlanMetadata,\n PlanFiles,\n PlanState,\n Plan,\n PlanContext,\n StepResult,\n PlanResult,\n StatusDocument,\n ExecutionPlanDocument,\n} from \"./types.js\";\n\n// Constants\nexport { PLAN_CONVENTIONS } from \"./types.js\";\n\n// Version\nexport const VERSION = \"0.0.1\";\n\n// ===== STUB IMPLEMENTATIONS =====\n// These will be implemented as the project develops\n\n/**\n * Load a plan from a directory\n *\n * @param path - Path to the plan directory\n * @returns The loaded plan\n *\n * @example\n * ```typescript\n * const plan = await loadPlan('./prompts/big-splitup');\n * console.log(plan.metadata.code); // 'big-splitup'\n * console.log(plan.steps.length); // 11\n * ```\n *\n * @stub Not yet implemented\n */\nexport async function loadPlan(_path: string): Promise<never> {\n throw new Error(\n \"riotplan.loadPlan is not yet implemented. Coming in v0.1.0!\"\n );\n}\n\n/**\n * Create a new plan\n *\n * @param config - Plan configuration\n * @returns The created plan\n *\n * @example\n * ```typescript\n * const plan = await createPlan({\n * code: 'my-feature',\n * name: 'My Feature Implementation',\n * path: './prompts/my-feature',\n * steps: [\n * { title: 'Setup', description: 'Initial setup' },\n * { title: 'Implementation', description: 'Core work' },\n * { title: 'Testing', description: 'Verify it works' },\n * ]\n * });\n * ```\n *\n * @stub Not yet implemented\n */\nexport async function createPlan(_config: {\n code: string;\n name: string;\n path: string;\n description?: string;\n steps?: Array<{ title: string; description?: string }>;\n}): Promise<never> {\n throw new Error(\n \"riotplan.createPlan is not yet implemented. Coming in v0.1.0!\"\n );\n}\n\n/**\n * Parse a STATUS.md file\n *\n * @param content - The STATUS.md content\n * @returns Parsed status document\n *\n * @stub Not yet implemented\n */\nexport function parseStatus(_content: string): never {\n throw new Error(\n \"riotplan.parseStatus is not yet implemented. Coming in v0.1.0!\"\n );\n}\n\n/**\n * Generate a STATUS.md file\n *\n * @param plan - The plan to generate status for\n * @returns STATUS.md content\n *\n * @stub Not yet implemented\n */\nexport function generateStatus(_plan: unknown): never {\n throw new Error(\n \"riotplan.generateStatus is not yet implemented. Coming in v0.1.0!\"\n );\n}\n\n/**\n * Execute a plan step\n *\n * @param plan - The plan\n * @param stepNumber - Step to execute\n * @param context - Execution context\n * @returns Step result\n *\n * @stub Not yet implemented\n */\nexport async function executeStep(\n _plan: unknown,\n _stepNumber: number,\n _context?: unknown\n): Promise<never> {\n throw new Error(\n \"riotplan.executeStep is not yet implemented. Coming in v0.1.0!\"\n );\n}\n\n/**\n * Resume a plan from its current state\n *\n * @param plan - The plan to resume\n * @param context - Execution context\n * @returns Plan result\n *\n * @stub Not yet implemented\n */\nexport async function resumePlan(\n _plan: unknown,\n _context?: unknown\n): Promise<never> {\n throw new Error(\n \"riotplan.resumePlan is not yet implemented. Coming in v0.1.0!\"\n );\n}\n\n/**\n * Update plan state after step completion\n *\n * @param plan - The plan\n * @param stepNumber - Completed step\n * @param result - Step result\n * @returns Updated plan\n *\n * @stub Not yet implemented\n */\nexport function updatePlanState(\n _plan: unknown,\n _stepNumber: number,\n _result: unknown\n): never {\n throw new Error(\n \"riotplan.updatePlanState is not yet implemented. Coming in v0.1.0!\"\n );\n}\n\n"],"names":[],"mappings":"AA6ZO,MAAM,mBAAmB;AAAA;AAAA,EAE5B,oBAAoB;AAAA,IAChB;AAAA,IACA;AAAA,IACA;AAAA,EAAA;AAAA;AAAA,EAIJ,aAAa;AAAA;AAAA,EAGb,eAAe;AAAA,IACX,SAAS;AAAA,IACT,QAAQ;AAAA,IACR,eAAe;AAAA,IACf,QAAQ;AAAA,EAAA;AAAA;AAAA,EAIZ,cAAc;AAAA,IACV,MAAM;AAAA,IACN,UAAU;AAAA,IACV,cAAc;AAAA,IACd,gBAAgB;AAAA,IAChB,SAAS;AAAA,EAAA;AAAA;AAAA,EAIb,aAAa;AAAA,IACT,SAAS;AAAA,IACT,aAAa;AAAA,IACb,WAAW;AAAA,IACX,QAAQ;AAAA,IACR,SAAS;AAAA,IACT,SAAS;AAAA,EAAA;AAEjB;AChZO,MAAM,UAAU;AAoBvB,eAAsB,SAAS,OAA+B;AAC1D,QAAM,IAAI;AAAA,IACN;AAAA,EAAA;AAER;AAwBA,eAAsB,WAAW,SAMd;AACf,QAAM,IAAI;AAAA,IACN;AAAA,EAAA;AAER;AAUO,SAAS,YAAY,UAAyB;AACjD,QAAM,IAAI;AAAA,IACN;AAAA,EAAA;AAER;AAUO,SAAS,eAAe,OAAuB;AAClD,QAAM,IAAI;AAAA,IACN;AAAA,EAAA;AAER;AAYA,eAAsB,YAClB,OACA,aACA,UACc;AACd,QAAM,IAAI;AAAA,IACN;AAAA,EAAA;AAER;AAWA,eAAsB,WAClB,OACA,UACc;AACd,QAAM,IAAI;AAAA,IACN;AAAA,EAAA;AAER;AAYO,SAAS,gBACZ,OACA,aACA,SACK;AACL,QAAM,IAAI;AAAA,IACN;AAAA,EAAA;AAER;"}
package/package.json ADDED
@@ -0,0 +1,74 @@
1
+ {
2
+ "name": "@riotprompt/riotplan",
3
+ "version": "0.0.2",
4
+ "description": "Framework for long-lived, stateful AI workflows (plans)",
5
+ "type": "module",
6
+ "main": "./dist/index.cjs",
7
+ "module": "./dist/index.js",
8
+ "types": "./dist/index.d.ts",
9
+ "exports": {
10
+ ".": {
11
+ "types": "./dist/index.d.ts",
12
+ "import": "./dist/index.js",
13
+ "require": "./dist/index.cjs"
14
+ }
15
+ },
16
+ "scripts": {
17
+ "clean": "rm -rf dist",
18
+ "build": "vite build",
19
+ "test": "vitest run",
20
+ "lint": "eslint src",
21
+ "prepublishOnly": "npm run clean && npm run build"
22
+ },
23
+ "keywords": [
24
+ "plan",
25
+ "workflow",
26
+ "ai",
27
+ "stateful",
28
+ "llm",
29
+ "prompts",
30
+ "execution"
31
+ ],
32
+ "author": "Tim O'Brien <tobrien@discursive.com>",
33
+ "license": "Apache-2.0",
34
+ "repository": {
35
+ "type": "git",
36
+ "url": "git+https://github.com/kjerneverk/riotplan"
37
+ },
38
+ "dependencies": {
39
+ "glob": "^11.0.3",
40
+ "js-yaml": "^4.1.1",
41
+ "marked": "^16.0.0"
42
+ },
43
+ "peerDependencies": {
44
+ "@riotprompt/agentic": "^0.0.1",
45
+ "@riotprompt/execution": "^0.0.1",
46
+ "@riotprompt/riotprompt": "^1.0.0"
47
+ },
48
+ "peerDependenciesMeta": {
49
+ "@riotprompt/agentic": {
50
+ "optional": true
51
+ },
52
+ "@riotprompt/execution": {
53
+ "optional": true
54
+ },
55
+ "@riotprompt/riotprompt": {
56
+ "optional": true
57
+ }
58
+ },
59
+ "devDependencies": {
60
+ "@eslint/eslintrc": "^3.3.1",
61
+ "@eslint/js": "^9.28.0",
62
+ "@types/js-yaml": "^4.0.9",
63
+ "@types/node": "^22.15.30",
64
+ "@typescript-eslint/eslint-plugin": "^8.34.0",
65
+ "@typescript-eslint/parser": "^8.34.0",
66
+ "eslint": "^9.28.0",
67
+ "eslint-plugin-import": "^2.31.0",
68
+ "globals": "^16.2.0",
69
+ "typescript": "^5.8.3",
70
+ "vite": "^7.0.4",
71
+ "vite-plugin-dts": "^4.5.4",
72
+ "vitest": "^3.2.4"
73
+ }
74
+ }