@sudosandwich/limps 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +190 -0
- package/dist/agent-parser.d.ts +146 -0
- package/dist/agent-parser.d.ts.map +1 -0
- package/dist/agent-parser.js +448 -0
- package/dist/agent-parser.js.map +1 -0
- package/dist/config.d.ts +54 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +146 -0
- package/dist/config.js.map +1 -0
- package/dist/coordination.d.ts +102 -0
- package/dist/coordination.d.ts.map +1 -0
- package/dist/coordination.js +157 -0
- package/dist/coordination.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +256 -0
- package/dist/index.js.map +1 -0
- package/dist/indexer.d.ts +83 -0
- package/dist/indexer.d.ts.map +1 -0
- package/dist/indexer.js +467 -0
- package/dist/indexer.js.map +1 -0
- package/dist/resources/agents-status.d.ts +32 -0
- package/dist/resources/agents-status.d.ts.map +1 -0
- package/dist/resources/agents-status.js +73 -0
- package/dist/resources/agents-status.js.map +1 -0
- package/dist/resources/decisions-log.d.ts +21 -0
- package/dist/resources/decisions-log.d.ts.map +1 -0
- package/dist/resources/decisions-log.js +146 -0
- package/dist/resources/decisions-log.js.map +1 -0
- package/dist/resources/index.d.ts +10 -0
- package/dist/resources/index.d.ts.map +1 -0
- package/dist/resources/index.js +74 -0
- package/dist/resources/index.js.map +1 -0
- package/dist/resources/plans-full.d.ts +11 -0
- package/dist/resources/plans-full.d.ts.map +1 -0
- package/dist/resources/plans-full.js +71 -0
- package/dist/resources/plans-full.js.map +1 -0
- package/dist/resources/plans-index.d.ts +30 -0
- package/dist/resources/plans-index.d.ts.map +1 -0
- package/dist/resources/plans-index.js +177 -0
- package/dist/resources/plans-index.js.map +1 -0
- package/dist/resources/plans-summary.d.ts +33 -0
- package/dist/resources/plans-summary.d.ts.map +1 -0
- package/dist/resources/plans-summary.js +238 -0
- package/dist/resources/plans-summary.js.map +1 -0
- package/dist/rlm/extractors.d.ts +39 -0
- package/dist/rlm/extractors.d.ts.map +1 -0
- package/dist/rlm/extractors.js +291 -0
- package/dist/rlm/extractors.js.map +1 -0
- package/dist/rlm/helpers-inject.d.ts +13 -0
- package/dist/rlm/helpers-inject.d.ts.map +1 -0
- package/dist/rlm/helpers-inject.js +586 -0
- package/dist/rlm/helpers-inject.js.map +1 -0
- package/dist/rlm/helpers.d.ts +124 -0
- package/dist/rlm/helpers.d.ts.map +1 -0
- package/dist/rlm/helpers.js +381 -0
- package/dist/rlm/helpers.js.map +1 -0
- package/dist/rlm/index.d.ts +12 -0
- package/dist/rlm/index.d.ts.map +1 -0
- package/dist/rlm/index.js +19 -0
- package/dist/rlm/index.js.map +1 -0
- package/dist/rlm/parallel.d.ts +45 -0
- package/dist/rlm/parallel.d.ts.map +1 -0
- package/dist/rlm/parallel.js +76 -0
- package/dist/rlm/parallel.js.map +1 -0
- package/dist/rlm/recursion.d.ts +96 -0
- package/dist/rlm/recursion.d.ts.map +1 -0
- package/dist/rlm/recursion.js +113 -0
- package/dist/rlm/recursion.js.map +1 -0
- package/dist/rlm/sampling.d.ts +100 -0
- package/dist/rlm/sampling.d.ts.map +1 -0
- package/dist/rlm/sampling.js +96 -0
- package/dist/rlm/sampling.js.map +1 -0
- package/dist/rlm/sandbox.d.ts +73 -0
- package/dist/rlm/sandbox.d.ts.map +1 -0
- package/dist/rlm/sandbox.js +160 -0
- package/dist/rlm/sandbox.js.map +1 -0
- package/dist/rlm/security.d.ts +28 -0
- package/dist/rlm/security.d.ts.map +1 -0
- package/dist/rlm/security.js +154 -0
- package/dist/rlm/security.js.map +1 -0
- package/dist/server.d.ts +21 -0
- package/dist/server.d.ts.map +1 -0
- package/dist/server.js +107 -0
- package/dist/server.js.map +1 -0
- package/dist/task-parser.d.ts +47 -0
- package/dist/task-parser.d.ts.map +1 -0
- package/dist/task-parser.js +112 -0
- package/dist/task-parser.js.map +1 -0
- package/dist/test-setup.d.ts +6 -0
- package/dist/test-setup.d.ts.map +1 -0
- package/dist/test-setup.js +37 -0
- package/dist/test-setup.js.map +1 -0
- package/dist/tools/claim-task.d.ts +28 -0
- package/dist/tools/claim-task.d.ts.map +1 -0
- package/dist/tools/claim-task.js +288 -0
- package/dist/tools/claim-task.js.map +1 -0
- package/dist/tools/create-doc.d.ts +47 -0
- package/dist/tools/create-doc.d.ts.map +1 -0
- package/dist/tools/create-doc.js +137 -0
- package/dist/tools/create-doc.js.map +1 -0
- package/dist/tools/create-plan.d.ts +25 -0
- package/dist/tools/create-plan.d.ts.map +1 -0
- package/dist/tools/create-plan.js +179 -0
- package/dist/tools/create-plan.js.map +1 -0
- package/dist/tools/delete-doc.d.ts +51 -0
- package/dist/tools/delete-doc.d.ts.map +1 -0
- package/dist/tools/delete-doc.js +194 -0
- package/dist/tools/delete-doc.js.map +1 -0
- package/dist/tools/get-next-task.d.ts +49 -0
- package/dist/tools/get-next-task.d.ts.map +1 -0
- package/dist/tools/get-next-task.js +204 -0
- package/dist/tools/get-next-task.js.map +1 -0
- package/dist/tools/index.d.ts +10 -0
- package/dist/tools/index.d.ts.map +1 -0
- package/dist/tools/index.js +122 -0
- package/dist/tools/index.js.map +1 -0
- package/dist/tools/list-docs.d.ts +53 -0
- package/dist/tools/list-docs.d.ts.map +1 -0
- package/dist/tools/list-docs.js +236 -0
- package/dist/tools/list-docs.js.map +1 -0
- package/dist/tools/open-document-in-cursor.d.ts +62 -0
- package/dist/tools/open-document-in-cursor.d.ts.map +1 -0
- package/dist/tools/open-document-in-cursor.js +211 -0
- package/dist/tools/open-document-in-cursor.js.map +1 -0
- package/dist/tools/read-doc.d.ts +44 -0
- package/dist/tools/read-doc.d.ts.map +1 -0
- package/dist/tools/read-doc.js +174 -0
- package/dist/tools/read-doc.js.map +1 -0
- package/dist/tools/release-task.d.ts +28 -0
- package/dist/tools/release-task.d.ts.map +1 -0
- package/dist/tools/release-task.js +154 -0
- package/dist/tools/release-task.js.map +1 -0
- package/dist/tools/rlm-multi-query.d.ts +110 -0
- package/dist/tools/rlm-multi-query.d.ts.map +1 -0
- package/dist/tools/rlm-multi-query.js +348 -0
- package/dist/tools/rlm-multi-query.js.map +1 -0
- package/dist/tools/rlm-query.d.ts +56 -0
- package/dist/tools/rlm-query.d.ts.map +1 -0
- package/dist/tools/rlm-query.js +228 -0
- package/dist/tools/rlm-query.js.map +1 -0
- package/dist/tools/search-docs.d.ts +34 -0
- package/dist/tools/search-docs.d.ts.map +1 -0
- package/dist/tools/search-docs.js +292 -0
- package/dist/tools/search-docs.js.map +1 -0
- package/dist/tools/update-doc.d.ts +149 -0
- package/dist/tools/update-doc.d.ts.map +1 -0
- package/dist/tools/update-doc.js +195 -0
- package/dist/tools/update-doc.js.map +1 -0
- package/dist/tools/update-task-status.d.ts +31 -0
- package/dist/tools/update-task-status.d.ts.map +1 -0
- package/dist/tools/update-task-status.js +303 -0
- package/dist/tools/update-task-status.js.map +1 -0
- package/dist/types.d.ts +50 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +2 -0
- package/dist/types.js.map +1 -0
- package/dist/utils/backup.d.ts +76 -0
- package/dist/utils/backup.d.ts.map +1 -0
- package/dist/utils/backup.js +172 -0
- package/dist/utils/backup.js.map +1 -0
- package/dist/utils/errors.d.ts +93 -0
- package/dist/utils/errors.d.ts.map +1 -0
- package/dist/utils/errors.js +125 -0
- package/dist/utils/errors.js.map +1 -0
- package/dist/utils/index.d.ts +8 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/index.js +9 -0
- package/dist/utils/index.js.map +1 -0
- package/dist/utils/os-paths.d.ts +45 -0
- package/dist/utils/os-paths.d.ts.map +1 -0
- package/dist/utils/os-paths.js +81 -0
- package/dist/utils/os-paths.js.map +1 -0
- package/dist/utils/paths.d.ts +71 -0
- package/dist/utils/paths.d.ts.map +1 -0
- package/dist/utils/paths.js +165 -0
- package/dist/utils/paths.js.map +1 -0
- package/dist/watcher.d.ts +19 -0
- package/dist/watcher.d.ts.map +1 -0
- package/dist/watcher.js +109 -0
- package/dist/watcher.js.map +1 -0
- package/package.json +85 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Paul Breuler
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
# MCP Planning Server
|
|
2
|
+
|
|
3
|
+
MCP server for managing planning documents, agent coordination, and task tracking.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
### Global Install (Recommended)
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm install -g mcp-planning-server
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
The server automatically finds configuration at OS-specific locations:
|
|
14
|
+
|
|
15
|
+
| OS | Config Location |
|
|
16
|
+
|----|-----------------|
|
|
17
|
+
| macOS | `~/Library/Application Support/mcp-planning-server/config.json` |
|
|
18
|
+
| Linux | `~/.config/mcp-planning-server/config.json` |
|
|
19
|
+
| Windows | `%APPDATA%\mcp-planning-server\config.json` |
|
|
20
|
+
|
|
21
|
+
### From Source
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
git clone https://github.com/yourusername/mcp-planning-server.git
|
|
25
|
+
cd mcp-planning-server
|
|
26
|
+
npm install
|
|
27
|
+
npm run build
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## Configuration
|
|
31
|
+
|
|
32
|
+
Create a `config.json` at the OS-specific location or specify a path:
|
|
33
|
+
|
|
34
|
+
```json
|
|
35
|
+
{
|
|
36
|
+
"plansPath": "~/Documents/my-plans",
|
|
37
|
+
"docsPaths": ["~/Documents/my-plans"],
|
|
38
|
+
"fileExtensions": [".md"],
|
|
39
|
+
"dataPath": "~/Library/Application Support/mcp-planning-server/data",
|
|
40
|
+
"coordinationPath": "~/Library/Application Support/mcp-planning-server/coordination.json",
|
|
41
|
+
"heartbeatTimeout": 300000,
|
|
42
|
+
"debounceDelay": 200,
|
|
43
|
+
"maxHandoffIterations": 3
|
|
44
|
+
}
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
**Config priority:**
|
|
48
|
+
1. CLI: `mcp-planning-server --config /path/to/config.json`
|
|
49
|
+
2. Environment: `MCP_PLANNING_CONFIG=/path/to/config.json`
|
|
50
|
+
3. OS-specific default location
|
|
51
|
+
|
|
52
|
+
**Path options:**
|
|
53
|
+
- Tilde expansion: `~/Documents/plans`
|
|
54
|
+
- Absolute: `/Users/john/Documents/plans`
|
|
55
|
+
- Relative (to config file): `./plans`
|
|
56
|
+
|
|
57
|
+
## Cursor Setup
|
|
58
|
+
|
|
59
|
+
Add to Cursor settings (`Cmd+Shift+P` → "Preferences: Open User Settings (JSON)"):
|
|
60
|
+
|
|
61
|
+
```json
|
|
62
|
+
{
|
|
63
|
+
"mcp.servers": {
|
|
64
|
+
"mcp-planning-server": {
|
|
65
|
+
"command": "mcp-planning-server"
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
With explicit config:
|
|
72
|
+
```json
|
|
73
|
+
{
|
|
74
|
+
"mcp.servers": {
|
|
75
|
+
"mcp-planning-server": {
|
|
76
|
+
"command": "mcp-planning-server",
|
|
77
|
+
"args": ["--config", "/path/to/config.json"]
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
From source:
|
|
84
|
+
```json
|
|
85
|
+
{
|
|
86
|
+
"mcp.servers": {
|
|
87
|
+
"mcp-planning-server": {
|
|
88
|
+
"command": "node",
|
|
89
|
+
"args": ["/path/to/mcp-planning-server/dist/index.js"],
|
|
90
|
+
"cwd": "/path/to/mcp-planning-server"
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
## Features
|
|
97
|
+
|
|
98
|
+
### Document Management (14 Tools)
|
|
99
|
+
|
|
100
|
+
| Tool | Description |
|
|
101
|
+
|------|-------------|
|
|
102
|
+
| `read_doc` | Read full document content |
|
|
103
|
+
| `create_doc` | Create new documents |
|
|
104
|
+
| `update_doc` | Update with optimistic concurrency |
|
|
105
|
+
| `delete_doc` | Delete documents |
|
|
106
|
+
| `list_docs` | List files and directories |
|
|
107
|
+
| `search_docs` | Full-text search (SQLite FTS5) |
|
|
108
|
+
| `rlm_query` | JavaScript filter/transform on documents |
|
|
109
|
+
| `rlm_multi_query` | Cross-document analysis with globs |
|
|
110
|
+
| `create_plan` | Create feature plans with structure |
|
|
111
|
+
| `update_task_status` | Update task status (GAP → WIP → PASS) |
|
|
112
|
+
| `claim_task` | Claim tasks with file locks |
|
|
113
|
+
| `release_task` | Release tasks and locks |
|
|
114
|
+
| `get_next_task` | Get highest-priority available task |
|
|
115
|
+
| `open_document_in_cursor` | Open files in Cursor editor |
|
|
116
|
+
|
|
117
|
+
### Resources (Progressive Disclosure)
|
|
118
|
+
|
|
119
|
+
- `plans://index` — List of all plans (minimal)
|
|
120
|
+
- `plans://summary` — Plan summaries (key info)
|
|
121
|
+
- `plans://full` — Full plan documents
|
|
122
|
+
- `decisions://log` — Decision log entries
|
|
123
|
+
- `agents://status` — Agent status and tasks
|
|
124
|
+
|
|
125
|
+
## Development
|
|
126
|
+
|
|
127
|
+
```bash
|
|
128
|
+
npm install # Install dependencies
|
|
129
|
+
npm test # Run tests
|
|
130
|
+
npm run build # Build TypeScript
|
|
131
|
+
npm run dev # Watch mode
|
|
132
|
+
npm run lint # ESLint check
|
|
133
|
+
npm run format # Prettier format
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
Pre-commit hooks run lint-staged, build, and tests automatically.
|
|
137
|
+
|
|
138
|
+
## Releasing
|
|
139
|
+
|
|
140
|
+
```bash
|
|
141
|
+
# Update version in package.json, then:
|
|
142
|
+
git tag v0.2.1
|
|
143
|
+
git push origin v0.2.1
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
GitHub Actions automatically builds, tests, and creates releases with changelogs.
|
|
147
|
+
|
|
148
|
+
## Architecture
|
|
149
|
+
|
|
150
|
+
- **SQLite + FTS5** — Full-text search with auto-updates
|
|
151
|
+
- **File Watching** — Real-time indexing (Chokidar)
|
|
152
|
+
- **Multi-Agent Coordination** — File-based with heartbeats
|
|
153
|
+
- **RLM Sandbox** — Secure JavaScript execution (QuickJS)
|
|
154
|
+
|
|
155
|
+
### Principles
|
|
156
|
+
|
|
157
|
+
1. Simplicity over complexity
|
|
158
|
+
2. Local-first, no external dependencies
|
|
159
|
+
3. Progressive disclosure (index → summary → full)
|
|
160
|
+
4. Optimistic concurrency
|
|
161
|
+
5. Scoring-based task selection
|
|
162
|
+
|
|
163
|
+
## Adapting for Other Uses
|
|
164
|
+
|
|
165
|
+
The server is designed for planning documents but the core is generic:
|
|
166
|
+
|
|
167
|
+
**Configuration-only:**
|
|
168
|
+
```json
|
|
169
|
+
{
|
|
170
|
+
"plansPath": "./your-docs",
|
|
171
|
+
"docsPaths": ["./content", "./docs"],
|
|
172
|
+
"fileExtensions": [".md", ".txt", ".rst"]
|
|
173
|
+
}
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
**For different domains** (wikis, knowledge bases):
|
|
177
|
+
- Replace/remove planning-specific tools
|
|
178
|
+
- Customize document extractors in `src/rlm/extractors.ts`
|
|
179
|
+
- Modify coordination patterns or remove if single-agent
|
|
180
|
+
|
|
181
|
+
## What is MCP?
|
|
182
|
+
|
|
183
|
+
**MCP (Model Context Protocol)** is a standardized protocol for AI applications to connect to external systems. Launched by Anthropic (Nov 2024), now part of the Linux Foundation's Agentic AI Foundation.
|
|
184
|
+
|
|
185
|
+
- [MCP Specification](https://modelcontextprotocol.io/)
|
|
186
|
+
- [MCP Documentation](https://modelcontextprotocol.io/docs)
|
|
187
|
+
|
|
188
|
+
## License
|
|
189
|
+
|
|
190
|
+
MIT
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Agent file parser for MCP planning tools.
|
|
3
|
+
*
|
|
4
|
+
* Agent files use YAML frontmatter as the single source of truth for task state.
|
|
5
|
+
* This module provides functions to parse, update, and query agent files.
|
|
6
|
+
*
|
|
7
|
+
* Task ID Format: `<plan-folder>#<agent-number>` (e.g., "0022-datagrid-stories#000")
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* Agent file frontmatter interface.
|
|
11
|
+
* This is the authoritative source of truth for agent/task state.
|
|
12
|
+
*/
|
|
13
|
+
export interface AgentFrontmatter {
|
|
14
|
+
status: 'GAP' | 'WIP' | 'PASS' | 'BLOCKED';
|
|
15
|
+
persona: 'coder' | 'reviewer' | 'pm' | 'customer';
|
|
16
|
+
claimedBy: string | null;
|
|
17
|
+
dependencies: string[];
|
|
18
|
+
blocks: string[];
|
|
19
|
+
files: string[];
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Parsed agent file with frontmatter and metadata.
|
|
23
|
+
*/
|
|
24
|
+
export interface ParsedAgentFile {
|
|
25
|
+
/** Task ID: planFolder#agentNumber */
|
|
26
|
+
taskId: string;
|
|
27
|
+
/** Plan folder name (e.g., "0022-datagrid-stories") */
|
|
28
|
+
planFolder: string;
|
|
29
|
+
/** Agent number (e.g., "000") */
|
|
30
|
+
agentNumber: string;
|
|
31
|
+
/** Full path to the agent file */
|
|
32
|
+
path: string;
|
|
33
|
+
/** Parsed frontmatter */
|
|
34
|
+
frontmatter: AgentFrontmatter;
|
|
35
|
+
/** Content after frontmatter */
|
|
36
|
+
content: string;
|
|
37
|
+
/** File modification time (for stale detection) */
|
|
38
|
+
mtime: Date;
|
|
39
|
+
/** Title extracted from first # heading */
|
|
40
|
+
title: string;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Extract agent number from filename.
|
|
44
|
+
*
|
|
45
|
+
* @example
|
|
46
|
+
* extractAgentNumber("000_agent_sticky_header.agent.md") // "000"
|
|
47
|
+
* extractAgentNumber("001_agent_navigation.agent.md") // "001"
|
|
48
|
+
* extractAgentNumber("signalbadge.agent.md") // null (no number prefix)
|
|
49
|
+
*
|
|
50
|
+
* @param filename - Agent filename (not full path)
|
|
51
|
+
* @returns Agent number or null if not found
|
|
52
|
+
*/
|
|
53
|
+
export declare function extractAgentNumber(filename: string): string | null;
|
|
54
|
+
/**
|
|
55
|
+
* Extract plan folder from agent file path.
|
|
56
|
+
*
|
|
57
|
+
* @example
|
|
58
|
+
* extractPlanFolder("/path/to/plans/0022-datagrid-stories/agents/000_agent.agent.md")
|
|
59
|
+
* // "0022-datagrid-stories"
|
|
60
|
+
*
|
|
61
|
+
* @param path - Full path to agent file
|
|
62
|
+
* @returns Plan folder name or null if not found
|
|
63
|
+
*/
|
|
64
|
+
export declare function extractPlanFolder(path: string): string | null;
|
|
65
|
+
/**
|
|
66
|
+
* Build task ID from plan folder and agent number.
|
|
67
|
+
*
|
|
68
|
+
* @example
|
|
69
|
+
* buildTaskId("0022-datagrid-stories", "000") // "0022-datagrid-stories#000"
|
|
70
|
+
*
|
|
71
|
+
* @param planFolder - Plan folder name
|
|
72
|
+
* @param agentNumber - Agent number
|
|
73
|
+
* @returns Task ID in format planFolder#agentNumber
|
|
74
|
+
*/
|
|
75
|
+
export declare function buildTaskId(planFolder: string, agentNumber: string): string;
|
|
76
|
+
/**
|
|
77
|
+
* Parse task ID to extract plan folder and agent number.
|
|
78
|
+
*
|
|
79
|
+
* @example
|
|
80
|
+
* parseTaskId("0022-datagrid-stories#000")
|
|
81
|
+
* // { planFolder: "0022-datagrid-stories", agentNumber: "000" }
|
|
82
|
+
*
|
|
83
|
+
* @param taskId - Task ID
|
|
84
|
+
* @returns Parsed components or null if invalid format
|
|
85
|
+
*/
|
|
86
|
+
export declare function parseTaskId(taskId: string): {
|
|
87
|
+
planFolder: string;
|
|
88
|
+
agentNumber: string;
|
|
89
|
+
} | null;
|
|
90
|
+
/**
|
|
91
|
+
* Parse an agent file and extract frontmatter and metadata.
|
|
92
|
+
*
|
|
93
|
+
* @param path - Full path to agent file
|
|
94
|
+
* @param content - File content
|
|
95
|
+
* @returns Parsed agent file or null if not a valid agent file
|
|
96
|
+
*/
|
|
97
|
+
export declare function parseAgentFile(path: string, content: string): ParsedAgentFile | null;
|
|
98
|
+
/**
|
|
99
|
+
* Read and parse an agent file from disk.
|
|
100
|
+
*
|
|
101
|
+
* @param path - Full path to agent file
|
|
102
|
+
* @returns Parsed agent file or null if not found or invalid
|
|
103
|
+
*/
|
|
104
|
+
export declare function readAgentFile(path: string): ParsedAgentFile | null;
|
|
105
|
+
/**
|
|
106
|
+
* Update agent file frontmatter on disk.
|
|
107
|
+
*
|
|
108
|
+
* @param path - Full path to agent file
|
|
109
|
+
* @param updates - Partial frontmatter updates
|
|
110
|
+
* @returns Updated parsed agent file or null on error
|
|
111
|
+
*/
|
|
112
|
+
export declare function updateAgentFrontmatter(path: string, updates: Partial<AgentFrontmatter>): ParsedAgentFile | null;
|
|
113
|
+
/**
|
|
114
|
+
* Add frontmatter to a legacy agent file (migration helper).
|
|
115
|
+
* Extracts state from content and adds proper YAML frontmatter.
|
|
116
|
+
*
|
|
117
|
+
* @param path - Full path to agent file
|
|
118
|
+
* @returns Updated parsed agent file or null on error
|
|
119
|
+
*/
|
|
120
|
+
export declare function migrateAgentFile(path: string): ParsedAgentFile | null;
|
|
121
|
+
/**
|
|
122
|
+
* Check if an agent is stale (WIP status but mtime > threshold).
|
|
123
|
+
*
|
|
124
|
+
* @param agent - Parsed agent file
|
|
125
|
+
* @param thresholdMinutes - Stale threshold in minutes (default 10)
|
|
126
|
+
* @returns true if agent is stale
|
|
127
|
+
*/
|
|
128
|
+
export declare function isAgentStale(agent: ParsedAgentFile, thresholdMinutes?: number): boolean;
|
|
129
|
+
/**
|
|
130
|
+
* Find agent file path by task ID.
|
|
131
|
+
*
|
|
132
|
+
* @param plansPath - Base path to plans directory
|
|
133
|
+
* @param taskId - Task ID in format planFolder#agentNumber
|
|
134
|
+
* @returns Full path to agent file or null if not found
|
|
135
|
+
*/
|
|
136
|
+
export declare function findAgentFilePath(plansPath: string, taskId: string): string | null;
|
|
137
|
+
/**
|
|
138
|
+
* Resolve a dependency reference to a full task ID.
|
|
139
|
+
* Handles both agent numbers ("000") and full task IDs ("0022-plan#000").
|
|
140
|
+
*
|
|
141
|
+
* @param dep - Dependency reference
|
|
142
|
+
* @param currentPlanFolder - Current plan folder for relative references
|
|
143
|
+
* @returns Full task ID or null if invalid
|
|
144
|
+
*/
|
|
145
|
+
export declare function resolveDependency(dep: string, currentPlanFolder: string): string | null;
|
|
146
|
+
//# sourceMappingURL=agent-parser.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|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