@dexto/tools-plan 1.5.7
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/.dexto-plugin/plugin.json +7 -0
- package/LICENSE +44 -0
- package/dist/errors.d.ts +56 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +66 -0
- package/dist/index.d.ts +35 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +39 -0
- package/dist/plan-service.d.ts +77 -0
- package/dist/plan-service.d.ts.map +1 -0
- package/dist/plan-service.js +227 -0
- package/dist/plan-service.test.d.ts +7 -0
- package/dist/plan-service.test.d.ts.map +1 -0
- package/dist/plan-service.test.js +220 -0
- package/dist/tool-provider.d.ts +44 -0
- package/dist/tool-provider.d.ts.map +1 -0
- package/dist/tool-provider.js +81 -0
- package/dist/tool-provider.test.d.ts +7 -0
- package/dist/tool-provider.test.d.ts.map +1 -0
- package/dist/tool-provider.test.js +185 -0
- package/dist/tools/plan-create-tool.d.ts +13 -0
- package/dist/tools/plan-create-tool.d.ts.map +1 -0
- package/dist/tools/plan-create-tool.js +72 -0
- package/dist/tools/plan-create-tool.test.d.ts +7 -0
- package/dist/tools/plan-create-tool.test.d.ts.map +1 -0
- package/dist/tools/plan-create-tool.test.js +118 -0
- package/dist/tools/plan-read-tool.d.ts +13 -0
- package/dist/tools/plan-read-tool.d.ts.map +1 -0
- package/dist/tools/plan-read-tool.js +40 -0
- package/dist/tools/plan-read-tool.test.d.ts +7 -0
- package/dist/tools/plan-read-tool.test.d.ts.map +1 -0
- package/dist/tools/plan-read-tool.test.js +83 -0
- package/dist/tools/plan-review-tool.d.ts +22 -0
- package/dist/tools/plan-review-tool.d.ts.map +1 -0
- package/dist/tools/plan-review-tool.js +84 -0
- package/dist/tools/plan-update-tool.d.ts +13 -0
- package/dist/tools/plan-update-tool.d.ts.map +1 -0
- package/dist/tools/plan-update-tool.js +72 -0
- package/dist/tools/plan-update-tool.test.d.ts +7 -0
- package/dist/tools/plan-update-tool.test.d.ts.map +1 -0
- package/dist/tools/plan-update-tool.test.js +151 -0
- package/dist/types.d.ts +57 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +26 -0
- package/package.json +40 -0
- package/skills/plan/SKILL.md +102 -0
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Plan Types and Schemas
|
|
3
|
+
*
|
|
4
|
+
* Defines the structure of plans and their metadata.
|
|
5
|
+
*/
|
|
6
|
+
import { z } from 'zod';
|
|
7
|
+
/**
|
|
8
|
+
* Plan status values
|
|
9
|
+
*/
|
|
10
|
+
export declare const PlanStatusSchema: z.ZodEnum<["draft", "approved", "in_progress", "completed", "abandoned"]>;
|
|
11
|
+
export type PlanStatus = z.infer<typeof PlanStatusSchema>;
|
|
12
|
+
/**
|
|
13
|
+
* Plan metadata stored alongside the plan content
|
|
14
|
+
*/
|
|
15
|
+
export declare const PlanMetaSchema: z.ZodObject<{
|
|
16
|
+
sessionId: z.ZodString;
|
|
17
|
+
status: z.ZodDefault<z.ZodEnum<["draft", "approved", "in_progress", "completed", "abandoned"]>>;
|
|
18
|
+
title: z.ZodOptional<z.ZodString>;
|
|
19
|
+
createdAt: z.ZodNumber;
|
|
20
|
+
updatedAt: z.ZodNumber;
|
|
21
|
+
}, "strip", z.ZodTypeAny, {
|
|
22
|
+
sessionId: string;
|
|
23
|
+
status: "draft" | "approved" | "in_progress" | "completed" | "abandoned";
|
|
24
|
+
createdAt: number;
|
|
25
|
+
updatedAt: number;
|
|
26
|
+
title?: string | undefined;
|
|
27
|
+
}, {
|
|
28
|
+
sessionId: string;
|
|
29
|
+
createdAt: number;
|
|
30
|
+
updatedAt: number;
|
|
31
|
+
status?: "draft" | "approved" | "in_progress" | "completed" | "abandoned" | undefined;
|
|
32
|
+
title?: string | undefined;
|
|
33
|
+
}>;
|
|
34
|
+
export type PlanMeta = z.infer<typeof PlanMetaSchema>;
|
|
35
|
+
/**
|
|
36
|
+
* Complete plan with content and metadata
|
|
37
|
+
*/
|
|
38
|
+
export interface Plan {
|
|
39
|
+
content: string;
|
|
40
|
+
meta: PlanMeta;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Options for the plan service
|
|
44
|
+
*/
|
|
45
|
+
export interface PlanServiceOptions {
|
|
46
|
+
/** Base directory for plan storage */
|
|
47
|
+
basePath: string;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Result of a plan update operation
|
|
51
|
+
*/
|
|
52
|
+
export interface PlanUpdateResult {
|
|
53
|
+
oldContent: string;
|
|
54
|
+
newContent: string;
|
|
55
|
+
meta: PlanMeta;
|
|
56
|
+
}
|
|
57
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;GAEG;AACH,eAAO,MAAM,gBAAgB,2EAM3B,CAAC;AAEH,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAE1D;;GAEG;AACH,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;EAMzB,CAAC;AAEH,MAAM,MAAM,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;AAEtD;;GAEG;AACH,MAAM,WAAW,IAAI;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,QAAQ,CAAC;CAClB;AAED;;GAEG;AACH,MAAM,WAAW,kBAAkB;IAC/B,sCAAsC;IACtC,QAAQ,EAAE,MAAM,CAAC;CACpB;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC7B,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,QAAQ,CAAC;CAClB"}
|
package/dist/types.js
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Plan Types and Schemas
|
|
3
|
+
*
|
|
4
|
+
* Defines the structure of plans and their metadata.
|
|
5
|
+
*/
|
|
6
|
+
import { z } from 'zod';
|
|
7
|
+
/**
|
|
8
|
+
* Plan status values
|
|
9
|
+
*/
|
|
10
|
+
export const PlanStatusSchema = z.enum([
|
|
11
|
+
'draft',
|
|
12
|
+
'approved',
|
|
13
|
+
'in_progress',
|
|
14
|
+
'completed',
|
|
15
|
+
'abandoned',
|
|
16
|
+
]);
|
|
17
|
+
/**
|
|
18
|
+
* Plan metadata stored alongside the plan content
|
|
19
|
+
*/
|
|
20
|
+
export const PlanMetaSchema = z.object({
|
|
21
|
+
sessionId: z.string().describe('Session ID this plan belongs to'),
|
|
22
|
+
status: PlanStatusSchema.default('draft').describe('Current plan status'),
|
|
23
|
+
title: z.string().optional().describe('Plan title'),
|
|
24
|
+
createdAt: z.number().describe('Unix timestamp when plan was created'),
|
|
25
|
+
updatedAt: z.number().describe('Unix timestamp when plan was last updated'),
|
|
26
|
+
});
|
package/package.json
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@dexto/tools-plan",
|
|
3
|
+
"version": "1.5.7",
|
|
4
|
+
"description": "Implementation planning tools with session-linked plans",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./dist/index.js",
|
|
7
|
+
"types": "./dist/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"types": "./dist/index.d.ts",
|
|
11
|
+
"import": "./dist/index.js"
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
"files": [
|
|
15
|
+
"dist",
|
|
16
|
+
".dexto-plugin",
|
|
17
|
+
"skills"
|
|
18
|
+
],
|
|
19
|
+
"dependencies": {
|
|
20
|
+
"diff": "^7.0.0",
|
|
21
|
+
"zod": "^3.24.1",
|
|
22
|
+
"@dexto/core": "1.5.7"
|
|
23
|
+
},
|
|
24
|
+
"devDependencies": {
|
|
25
|
+
"@types/diff": "^7.0.0",
|
|
26
|
+
"@types/node": "^22.10.5",
|
|
27
|
+
"dotenv": "^16.4.7",
|
|
28
|
+
"typescript": "^5.7.2",
|
|
29
|
+
"vitest": "^2.1.8"
|
|
30
|
+
},
|
|
31
|
+
"author": "Dexto",
|
|
32
|
+
"license": "MIT",
|
|
33
|
+
"scripts": {
|
|
34
|
+
"build": "tsc",
|
|
35
|
+
"clean": "rm -rf dist",
|
|
36
|
+
"typecheck": "tsc --noEmit",
|
|
37
|
+
"test": "vitest run",
|
|
38
|
+
"test:watch": "vitest"
|
|
39
|
+
}
|
|
40
|
+
}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: plan
|
|
3
|
+
description: Enter planning mode to create and manage implementation plans
|
|
4
|
+
user-invocable: true
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Planning Mode - PLAN FIRST, THEN IMPLEMENT
|
|
8
|
+
|
|
9
|
+
**CRITICAL**: You are in planning mode. You MUST create and get approval for a plan BEFORE writing any code or making any changes.
|
|
10
|
+
|
|
11
|
+
## MANDATORY WORKFLOW
|
|
12
|
+
|
|
13
|
+
**DO NOT skip these steps. DO NOT start implementing until the plan is approved.**
|
|
14
|
+
|
|
15
|
+
1. **Research first** (if needed): Use the explore agent or read relevant files to understand the codebase
|
|
16
|
+
2. **Check for existing plan**: Use `plan_read` to see if a plan exists
|
|
17
|
+
3. **Create/update plan**: Use `plan_create` or `plan_update` to define your approach
|
|
18
|
+
4. **Request review**: Use `plan_review` to get user approval
|
|
19
|
+
5. **WAIT for approval**: Only proceed to implementation after user approves
|
|
20
|
+
6. **Implement**: Execute the approved plan, updating checkboxes as you go
|
|
21
|
+
|
|
22
|
+
## Research Phase
|
|
23
|
+
|
|
24
|
+
Before creating your plan, you should understand the codebase:
|
|
25
|
+
|
|
26
|
+
- **Use the explore agent** (spawn_agent with subagent_type="Explore") to search for relevant code, patterns, and existing implementations
|
|
27
|
+
- **Read key files** to understand the current architecture
|
|
28
|
+
- **Identify dependencies** and files that will need changes
|
|
29
|
+
|
|
30
|
+
This research informs your plan and prevents wasted effort from incorrect assumptions.
|
|
31
|
+
|
|
32
|
+
## Available Tools
|
|
33
|
+
|
|
34
|
+
- **plan_create**: Create a new plan (REQUIRED before any implementation)
|
|
35
|
+
- **plan_read**: Read the current plan
|
|
36
|
+
- **plan_update**: Update the existing plan (shows diff preview)
|
|
37
|
+
- **plan_review**: Request user review - returns approve/iterate/reject with feedback
|
|
38
|
+
|
|
39
|
+
## WHAT YOU MUST DO NOW
|
|
40
|
+
|
|
41
|
+
1. **Research**: Use the explore agent or read files to understand the relevant parts of the codebase
|
|
42
|
+
2. **Check plan**: Use `plan_read` to check if a plan already exists
|
|
43
|
+
3. **Create plan**: Use `plan_create` to create a comprehensive plan based on your research
|
|
44
|
+
4. **Get approval**: Use `plan_review` to request user approval
|
|
45
|
+
5. **STOP and WAIT** - do not write any code until the user approves via plan_review
|
|
46
|
+
|
|
47
|
+
## Plan Structure
|
|
48
|
+
|
|
49
|
+
```markdown
|
|
50
|
+
# {Title}
|
|
51
|
+
|
|
52
|
+
## Objective
|
|
53
|
+
{Clear statement of what we're building/fixing}
|
|
54
|
+
|
|
55
|
+
## Steps
|
|
56
|
+
|
|
57
|
+
### 1. {Step Name}
|
|
58
|
+
- [ ] {Task description}
|
|
59
|
+
- [ ] {Task description}
|
|
60
|
+
Files: `path/to/file.ts`, `path/to/other.ts`
|
|
61
|
+
|
|
62
|
+
### 2. {Step Name}
|
|
63
|
+
- [ ] {Task description}
|
|
64
|
+
Files: `path/to/file.ts`
|
|
65
|
+
|
|
66
|
+
## Considerations
|
|
67
|
+
- {Edge cases to handle}
|
|
68
|
+
- {Error scenarios}
|
|
69
|
+
|
|
70
|
+
## Success Criteria
|
|
71
|
+
- {How we know we're done}
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
## Guidelines
|
|
75
|
+
|
|
76
|
+
- **Break down complex tasks** into clear, sequential steps
|
|
77
|
+
- **Include specific file paths** that will be created or modified
|
|
78
|
+
- **Note dependencies** between steps
|
|
79
|
+
- **Keep plans concise** but complete
|
|
80
|
+
|
|
81
|
+
## Handling Review Responses
|
|
82
|
+
|
|
83
|
+
After calling `plan_review`, handle the response:
|
|
84
|
+
|
|
85
|
+
- **approve**: User approved - proceed with implementation
|
|
86
|
+
- **iterate**: User wants changes - update the plan based on feedback, then call `plan_review` again
|
|
87
|
+
- **reject**: User rejected - ask what they want instead
|
|
88
|
+
|
|
89
|
+
## DO NOT
|
|
90
|
+
|
|
91
|
+
- ❌ Start writing code before creating a plan
|
|
92
|
+
- ❌ Skip the plan_review step
|
|
93
|
+
- ❌ Assume approval - wait for explicit user response
|
|
94
|
+
- ❌ Make changes outside the approved plan without updating it first
|
|
95
|
+
|
|
96
|
+
---
|
|
97
|
+
|
|
98
|
+
**START NOW**:
|
|
99
|
+
1. Research the codebase using the explore agent if needed
|
|
100
|
+
2. Use `plan_read` to check for an existing plan
|
|
101
|
+
3. Use `plan_create` to create your plan
|
|
102
|
+
4. Use `plan_review` to get approval before any implementation
|