@agent-plan/core 0.1.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.
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../src/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,eAAO,MAAM,eAAe,aAAwB,CAAC;AACrD,eAAO,MAAM,UAAU,aAAiD,CAAC;AAEzE,eAAO,MAAM,kBAAkB;;;;;;;;;EAG7B,CAAC;AAEH,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;EAK7B,CAAC;AAEH,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAmBhC,CAAC;AAEH,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;EAS5B,CAAC;AAEH,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;EAM9B,CAAC;AAEH,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAE5B,CAAC;AAEH,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;EAMzB,CAAC;AAEH,eAAO,MAAM,mBAAmB;;;;;;;;;;;;EAI9B,CAAC;AAEH,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;EAOjC,CAAC;AAEH,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAmBxB,CAAC;AAEH,eAAO,MAAM,mBAAmB,yGAAuG,CAAC;AACxI,eAAO,MAAM,gBAAgB,yGAAuG,CAAC;AACrI,eAAO,MA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CAAC,CAAC;AACtE,MAAM,MAAM,OAAO,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC;AACpD,MAAM,MAAM,OAAO,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC;AACpD,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAChE,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAClE,MAAM,MAAM,IAAI,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,UAAU,CAAC,CAAC;AAC9C,MAAM,MAAM,KAAK,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,WAAW,CAAC,CAAC;AAChD,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AACxD,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAC5D,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAC9E,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC"}
package/dist/schema.js ADDED
@@ -0,0 +1,244 @@
1
+ import { z } from "zod";
2
+ import { createChecklistItemId } from "./naming.js";
3
+ export const TimestampSchema = z.string().datetime();
4
+ export const SlugSchema = z.string().regex(/^[a-z0-9]+(?:-[a-z0-9]+)*$/);
5
+ export const CodebaseFileSchema = z.object({
6
+ path: z.string().min(1),
7
+ kind: z.string().default("file"),
8
+ });
9
+ export const AmbientFactsSchema = z.object({
10
+ nodeVersion: z.string().default(""),
11
+ packageManager: z.string().default(""),
12
+ lockfile: z.string().default(""),
13
+ scripts: z.record(z.string()).default({}),
14
+ });
15
+ export const CodebaseProfileSchema = z.object({
16
+ scannedAt: TimestampSchema,
17
+ rootPath: z.string().default(""),
18
+ rootFiles: z.array(CodebaseFileSchema).default([]),
19
+ directories: z.array(z.string().min(1)).default([]),
20
+ packageJson: z
21
+ .object({
22
+ name: z.string().optional(),
23
+ packageManager: z.string().optional(),
24
+ scripts: z.record(z.string()).default({}),
25
+ dependencies: z.record(z.string()).default({}),
26
+ devDependencies: z.record(z.string()).default({}),
27
+ })
28
+ .nullable()
29
+ .default(null),
30
+ agentsMd: z.string().default(""),
31
+ readme: z.string().default(""),
32
+ tree: z.array(z.string().min(1)).default([]),
33
+ ambient: AmbientFactsSchema.default({ nodeVersion: "", packageManager: "", lockfile: "", scripts: {} }),
34
+ });
35
+ export const ResumeFocusSchema = z.object({
36
+ updatedAt: TimestampSchema,
37
+ currentPhaseId: z.string().default(""),
38
+ inProgressTaskIds: z.array(z.string().min(1)).default([]),
39
+ nextSteps: z.array(z.string().min(1)).default([]),
40
+ blockers: z.array(z.string().min(1)).default([]),
41
+ notes: z.string().default(""),
42
+ lastSessionSummary: z.string().default(""),
43
+ guardBypassUntil: z.string().default(""),
44
+ });
45
+ export const ActivityEntrySchema = z.object({
46
+ id: z.string().min(1),
47
+ at: TimestampSchema,
48
+ type: z.string().min(1),
49
+ ref: z.string().default(""),
50
+ summary: z.string().default(""),
51
+ });
52
+ export const ActivityLogSchema = z.object({
53
+ entries: z.array(ActivityEntrySchema).default([]),
54
+ });
55
+ export const ManifestSchema = z.object({
56
+ schemaVersion: z.literal(1),
57
+ projectId: z.string().min(1),
58
+ projectName: z.string().min(1),
59
+ createdAt: TimestampSchema,
60
+ updatedAt: TimestampSchema,
61
+ });
62
+ export const WorkflowRulesSchema = z.object({
63
+ beforePhaseStart: z.array(z.string().min(1)).default([]),
64
+ beforeTaskStart: z.array(z.string().min(1)).default([]),
65
+ afterPhaseComplete: z.array(z.string().min(1)).default([]),
66
+ });
67
+ export const AcceptedDecisionSchema = z.object({
68
+ id: z.string().min(1),
69
+ title: z.string().min(1),
70
+ decision: z.string().default(""),
71
+ rationale: z.string().default(""),
72
+ implementationNotes: z.string().default(""),
73
+ acceptedAt: TimestampSchema,
74
+ });
75
+ export const ProjectSchema = z.object({
76
+ name: z.string().min(1),
77
+ goal: z.string().default(""),
78
+ description: z.string().default(""),
79
+ webPort: z.number().int().min(0).max(65535).default(0),
80
+ scope: z.array(z.string().min(1)).default([]),
81
+ outOfScope: z.array(z.string().min(1)).default([]),
82
+ decisions: z.array(z.string().min(1)).default([]),
83
+ globalRules: z.array(z.string().min(1)).default([]),
84
+ technologies: z.array(z.string().min(1)).default([]),
85
+ tools: z.array(z.string().min(1)).default([]),
86
+ contentLanguage: z.string().default(""),
87
+ chatLanguage: z.string().default(""),
88
+ plannerAutoEnable: z.boolean().default(false),
89
+ plannerNeverAsk: z.boolean().default(false),
90
+ plannerAutoStartWeb: z.boolean().default(false),
91
+ plannerNeverStartWeb: z.boolean().default(false),
92
+ workflowRules: WorkflowRulesSchema,
93
+ acceptedDecisions: z.array(AcceptedDecisionSchema).default([]),
94
+ });
95
+ export const SubtaskStatusSchema = z.enum(["planned", "in-progress", "done", "blocked", "canceled", "rejected", "deferred", "waiting"]);
96
+ export const TaskStatusSchema = z.enum(["planned", "in-progress", "done", "blocked", "canceled", "rejected", "deferred", "waiting"]);
97
+ export const PhaseStatusSchema = z.enum(["draft", "discovery", "planned", "in-progress", "done", "blocked", "canceled", "rejected", "deferred", "waiting"]);
98
+ export const RequirementStatusSchema = z.enum(["planned", "in-progress", "done", "blocked", "canceled", "rejected", "deferred", "waiting"]);
99
+ export const FeatureStatusSchema = z.enum(["planned", "in-progress", "done", "blocked", "canceled", "rejected", "deferred", "waiting"]);
100
+ export const SubtaskSchema = z.object({
101
+ id: z.string().min(1),
102
+ title: z.string().min(1),
103
+ status: SubtaskStatusSchema,
104
+ description: z.string().default(""),
105
+ createdAt: TimestampSchema,
106
+ updatedAt: TimestampSchema,
107
+ });
108
+ export const ChecklistItemSchema = z.object({
109
+ id: z.string().min(1),
110
+ title: z.string().min(1),
111
+ checked: z.boolean().default(false),
112
+ });
113
+ const ChecklistInputSchema = z.union([z.string().min(1), ChecklistItemSchema]);
114
+ /** Status transitions that require a motivation note from the agent. */
115
+ export const STATUS_LOG_MOTIVATION_REQUIRED = new Set([
116
+ "blocked", "canceled", "deferred", "rejected", "waiting",
117
+ ]);
118
+ /**
119
+ * Returns true when a status transition requires a written motivation.
120
+ * - → DONE never requires motivation.
121
+ * - → BLOCKED / CANCELED / DEFERRED / REJECTED / WAITING always require it.
122
+ * - → PLANNED from a non-PLANNED status requires it.
123
+ */
124
+ export function needsMotivation(fromStatus, toStatus) {
125
+ if (toStatus === "done")
126
+ return false;
127
+ if (STATUS_LOG_MOTIVATION_REQUIRED.has(toStatus))
128
+ return true;
129
+ if (toStatus === "planned" && fromStatus !== "planned")
130
+ return true;
131
+ return false;
132
+ }
133
+ export const StatusLogEntrySchema = z.object({
134
+ id: z.string().min(1),
135
+ date: TimestampSchema,
136
+ fromStatus: TaskStatusSchema,
137
+ toStatus: TaskStatusSchema,
138
+ title: z.string().min(1),
139
+ description: z.string().default(""),
140
+ });
141
+ export const TaskSchema = z.object({
142
+ id: z.string(),
143
+ phaseId: z.string(),
144
+ number: z.number().int().nonnegative().default(0),
145
+ shortName: SlugSchema,
146
+ title: z.string().min(1),
147
+ status: TaskStatusSchema,
148
+ description: z.string().default(""),
149
+ notes: z.string().default(""),
150
+ statusLog: z.array(StatusLogEntrySchema).default([]),
151
+ decisions: z.array(z.string().min(1)).default([]),
152
+ acceptedDecisions: z.array(AcceptedDecisionSchema).default([]),
153
+ checklist: z.array(ChecklistInputSchema).default([]),
154
+ subtasks: z.array(SubtaskSchema).default([]),
155
+ dependsOn: z.array(z.string().min(1)).default([]),
156
+ startedAt: z.string().default(""),
157
+ completedAt: z.string().default(""),
158
+ createdAt: TimestampSchema,
159
+ updatedAt: TimestampSchema,
160
+ }).transform((task) => ({
161
+ ...task,
162
+ checklist: task.checklist
163
+ .map((item, index) => typeof item === "string"
164
+ ? { id: createChecklistItemId(task.id, index + 1, item), title: item.trim(), checked: false }
165
+ : { ...item, id: item.id || createChecklistItemId(task.id, index + 1, item.title), title: item.title.trim(), checked: item.checked ?? false })
166
+ .filter((item) => item.title.length > 0),
167
+ }));
168
+ export const PhaseSchema = z.object({
169
+ id: z.string(),
170
+ featureId: z.string().optional(),
171
+ number: z.number().int().positive(),
172
+ slug: SlugSchema,
173
+ title: z.string().min(1),
174
+ status: PhaseStatusSchema,
175
+ discussedAt: z.string().default(""),
176
+ contextReady: z.boolean().default(false),
177
+ contextReadyReason: z.string().default(""),
178
+ summary: z.string().default(""),
179
+ description: z.string().default(""),
180
+ notes: z.string().default(""),
181
+ goals: z.array(z.string().min(1)).default([]),
182
+ nonGoals: z.array(z.string().min(1)).default([]),
183
+ dependencies: z.array(z.string().min(1)).default([]),
184
+ dependsOn: z.array(z.string().min(1)).default([]),
185
+ risks: z.array(z.string().min(1)).default([]),
186
+ openQuestions: z.array(z.string().min(1)).default([]),
187
+ decisions: z.array(z.string().min(1)).default([]),
188
+ acceptedDecisions: z.array(AcceptedDecisionSchema).default([]),
189
+ completionCriteria: z.array(z.string().min(1)).default([]),
190
+ taskIds: z.array(z.string().min(1)).default([]),
191
+ tasks: z.array(TaskSchema).default([]),
192
+ createdAt: TimestampSchema,
193
+ updatedAt: TimestampSchema,
194
+ });
195
+ export const FeatureSchema = z.object({
196
+ id: z.string(),
197
+ number: z.number().int().nonnegative().default(0),
198
+ name: z.string().min(1),
199
+ description: z.string().default(""),
200
+ status: FeatureStatusSchema,
201
+ discussedAt: z.string().default(""),
202
+ contextReady: z.boolean().default(false),
203
+ contextReadyReason: z.string().default(""),
204
+ startDate: z.string().default(""),
205
+ endDate: z.string().default(""),
206
+ workDone: z.string().default(""),
207
+ workRemaining: z.string().default(""),
208
+ acceptedDecisions: z.array(AcceptedDecisionSchema).default([]),
209
+ phaseIds: z.array(z.string().min(1)).default([]),
210
+ dependsOn: z.array(z.string().min(1)).default([]),
211
+ createdAt: TimestampSchema,
212
+ updatedAt: TimestampSchema,
213
+ });
214
+ export const FeaturesDocumentSchema = z.object({
215
+ features: z.array(FeatureSchema),
216
+ });
217
+ export const MacroTaskSchema = z.object({
218
+ id: z.string().regex(/^MT-\d{3}$/),
219
+ title: z.string().min(1),
220
+ description: z.string().default(""),
221
+ status: RequirementStatusSchema,
222
+ createdAt: TimestampSchema,
223
+ updatedAt: TimestampSchema,
224
+ });
225
+ export const RequirementSchema = z.object({
226
+ id: z.string(),
227
+ title: z.string().min(1),
228
+ description: z.string().default(""),
229
+ status: RequirementStatusSchema,
230
+ macroTasks: z.array(MacroTaskSchema).default([]),
231
+ linkedPhaseIds: z.array(z.string().min(1)).default([]),
232
+ createdAt: TimestampSchema,
233
+ updatedAt: TimestampSchema,
234
+ });
235
+ export const RequirementsDocumentSchema = z.object({
236
+ requirements: z.array(RequirementSchema),
237
+ });
238
+ export const PlanWorkspaceSchema = z.object({
239
+ manifest: ManifestSchema,
240
+ project: ProjectSchema,
241
+ features: FeaturesDocumentSchema,
242
+ requirements: RequirementsDocumentSchema,
243
+ phases: z.array(PhaseSchema),
244
+ });
package/package.json ADDED
@@ -0,0 +1,47 @@
1
+ {
2
+ "name": "@agent-plan/core",
3
+ "version": "0.1.0",
4
+ "private": false,
5
+ "description": "Harness-agnostic core for Agent Plan: schemas, persistence, ordering, status rollups, and markdown rendering.",
6
+ "license": "MIT",
7
+ "type": "module",
8
+ "main": "./dist/index.js",
9
+ "types": "./dist/index.d.ts",
10
+ "exports": {
11
+ ".": "./dist/index.js",
12
+ "./schema": "./dist/schema.js",
13
+ "./naming": "./dist/naming.js"
14
+ },
15
+ "files": [
16
+ "dist/**/*.js",
17
+ "dist/**/*.d.ts",
18
+ "dist/**/*.d.ts.map",
19
+ "README.md",
20
+ "LICENSE"
21
+ ],
22
+ "publishConfig": {
23
+ "access": "public"
24
+ },
25
+ "repository": {
26
+ "type": "git",
27
+ "url": "https://github.com/ovidius72/agent-planner.git"
28
+ },
29
+ "homepage": "https://github.com/ovidius72/agent-planner#readme",
30
+ "bugs": {
31
+ "url": "https://github.com/ovidius72/agent-planner/issues"
32
+ },
33
+ "keywords": [
34
+ "planner",
35
+ "project-planning",
36
+ "schema",
37
+ "typescript",
38
+ "ai-agent"
39
+ ],
40
+ "dependencies": {
41
+ "zod": "^3.24.0"
42
+ },
43
+ "scripts": {
44
+ "build": "tsc -p tsconfig.json",
45
+ "check": "tsc -p tsconfig.json --noEmit"
46
+ }
47
+ }