@weavelogic/knowledge-graph-agent 0.3.0 → 0.4.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.
Files changed (149) hide show
  1. package/README.md +290 -3
  2. package/dist/_virtual/index10.js +2 -2
  3. package/dist/_virtual/index6.js +2 -2
  4. package/dist/_virtual/index7.js +2 -2
  5. package/dist/_virtual/index8.js +2 -2
  6. package/dist/_virtual/index9.js +2 -2
  7. package/dist/audit/config.d.ts +150 -0
  8. package/dist/audit/config.d.ts.map +1 -0
  9. package/dist/audit/config.js +111 -0
  10. package/dist/audit/config.js.map +1 -0
  11. package/dist/audit/index.d.ts +38 -0
  12. package/dist/audit/index.d.ts.map +1 -0
  13. package/dist/audit/services/audit-chain.d.ts +276 -0
  14. package/dist/audit/services/audit-chain.d.ts.map +1 -0
  15. package/dist/audit/services/audit-chain.js +502 -0
  16. package/dist/audit/services/audit-chain.js.map +1 -0
  17. package/dist/audit/services/index.d.ts +11 -0
  18. package/dist/audit/services/index.d.ts.map +1 -0
  19. package/dist/audit/services/syndication.d.ts +334 -0
  20. package/dist/audit/services/syndication.d.ts.map +1 -0
  21. package/dist/audit/services/syndication.js +589 -0
  22. package/dist/audit/services/syndication.js.map +1 -0
  23. package/dist/audit/types.d.ts +453 -0
  24. package/dist/audit/types.d.ts.map +1 -0
  25. package/dist/cli/commands/audit.d.ts +21 -0
  26. package/dist/cli/commands/audit.d.ts.map +1 -0
  27. package/dist/cli/commands/audit.js +621 -0
  28. package/dist/cli/commands/audit.js.map +1 -0
  29. package/dist/cli/commands/vector.d.ts +14 -0
  30. package/dist/cli/commands/vector.d.ts.map +1 -0
  31. package/dist/cli/commands/vector.js +429 -0
  32. package/dist/cli/commands/vector.js.map +1 -0
  33. package/dist/cli/commands/workflow.d.ts +12 -0
  34. package/dist/cli/commands/workflow.d.ts.map +1 -0
  35. package/dist/cli/commands/workflow.js +471 -0
  36. package/dist/cli/commands/workflow.js.map +1 -0
  37. package/dist/cli/index.d.ts.map +1 -1
  38. package/dist/cli/index.js +26 -0
  39. package/dist/cli/index.js.map +1 -1
  40. package/dist/database/schemas/index.d.ts +85 -0
  41. package/dist/database/schemas/index.d.ts.map +1 -0
  42. package/dist/index.d.ts +2 -0
  43. package/dist/index.d.ts.map +1 -1
  44. package/dist/index.js +9 -0
  45. package/dist/index.js.map +1 -1
  46. package/dist/mcp-server/tools/audit/checkpoint.d.ts +58 -0
  47. package/dist/mcp-server/tools/audit/checkpoint.d.ts.map +1 -0
  48. package/dist/mcp-server/tools/audit/checkpoint.js +73 -0
  49. package/dist/mcp-server/tools/audit/checkpoint.js.map +1 -0
  50. package/dist/mcp-server/tools/audit/index.d.ts +53 -0
  51. package/dist/mcp-server/tools/audit/index.d.ts.map +1 -0
  52. package/dist/mcp-server/tools/audit/index.js +12 -0
  53. package/dist/mcp-server/tools/audit/index.js.map +1 -0
  54. package/dist/mcp-server/tools/audit/query.d.ts +58 -0
  55. package/dist/mcp-server/tools/audit/query.d.ts.map +1 -0
  56. package/dist/mcp-server/tools/audit/query.js +125 -0
  57. package/dist/mcp-server/tools/audit/query.js.map +1 -0
  58. package/dist/mcp-server/tools/audit/sync.d.ts +58 -0
  59. package/dist/mcp-server/tools/audit/sync.d.ts.map +1 -0
  60. package/dist/mcp-server/tools/audit/sync.js +126 -0
  61. package/dist/mcp-server/tools/audit/sync.js.map +1 -0
  62. package/dist/mcp-server/tools/index.d.ts +3 -0
  63. package/dist/mcp-server/tools/index.d.ts.map +1 -1
  64. package/dist/mcp-server/tools/registry.js +90 -0
  65. package/dist/mcp-server/tools/registry.js.map +1 -1
  66. package/dist/mcp-server/tools/vector/index.d.ts +12 -0
  67. package/dist/mcp-server/tools/vector/index.d.ts.map +1 -0
  68. package/dist/mcp-server/tools/vector/index.js +12 -0
  69. package/dist/mcp-server/tools/vector/index.js.map +1 -0
  70. package/dist/mcp-server/tools/vector/search.d.ts +41 -0
  71. package/dist/mcp-server/tools/vector/search.d.ts.map +1 -0
  72. package/dist/mcp-server/tools/vector/search.js +224 -0
  73. package/dist/mcp-server/tools/vector/search.js.map +1 -0
  74. package/dist/mcp-server/tools/vector/trajectory.d.ts +39 -0
  75. package/dist/mcp-server/tools/vector/trajectory.d.ts.map +1 -0
  76. package/dist/mcp-server/tools/vector/trajectory.js +170 -0
  77. package/dist/mcp-server/tools/vector/trajectory.js.map +1 -0
  78. package/dist/mcp-server/tools/vector/upsert.d.ts +44 -0
  79. package/dist/mcp-server/tools/vector/upsert.d.ts.map +1 -0
  80. package/dist/mcp-server/tools/vector/upsert.js +175 -0
  81. package/dist/mcp-server/tools/vector/upsert.js.map +1 -0
  82. package/dist/mcp-server/tools/workflow/index.d.ts +29 -0
  83. package/dist/mcp-server/tools/workflow/index.d.ts.map +1 -0
  84. package/dist/mcp-server/tools/workflow/index.js +12 -0
  85. package/dist/mcp-server/tools/workflow/index.js.map +1 -0
  86. package/dist/mcp-server/tools/workflow/list.d.ts +41 -0
  87. package/dist/mcp-server/tools/workflow/list.d.ts.map +1 -0
  88. package/dist/mcp-server/tools/workflow/list.js +195 -0
  89. package/dist/mcp-server/tools/workflow/list.js.map +1 -0
  90. package/dist/mcp-server/tools/workflow/start.d.ts +40 -0
  91. package/dist/mcp-server/tools/workflow/start.d.ts.map +1 -0
  92. package/dist/mcp-server/tools/workflow/start.js +165 -0
  93. package/dist/mcp-server/tools/workflow/start.js.map +1 -0
  94. package/dist/mcp-server/tools/workflow/status.d.ts +38 -0
  95. package/dist/mcp-server/tools/workflow/status.d.ts.map +1 -0
  96. package/dist/mcp-server/tools/workflow/status.js +97 -0
  97. package/dist/mcp-server/tools/workflow/status.js.map +1 -0
  98. package/dist/node_modules/ajv/dist/compile/index.js +1 -1
  99. package/dist/node_modules/ajv/dist/vocabularies/applicator/index.js +1 -1
  100. package/dist/node_modules/ajv/dist/vocabularies/core/index.js +1 -1
  101. package/dist/node_modules/ajv/dist/vocabularies/format/index.js +1 -1
  102. package/dist/node_modules/ajv/dist/vocabularies/validation/index.js +1 -1
  103. package/dist/vector/config.d.ts +300 -0
  104. package/dist/vector/config.d.ts.map +1 -0
  105. package/dist/vector/config.js +124 -0
  106. package/dist/vector/config.js.map +1 -0
  107. package/dist/vector/index.d.ts +50 -0
  108. package/dist/vector/index.d.ts.map +1 -0
  109. package/dist/vector/services/index.d.ts +13 -0
  110. package/dist/vector/services/index.d.ts.map +1 -0
  111. package/dist/vector/services/trajectory-tracker.d.ts +405 -0
  112. package/dist/vector/services/trajectory-tracker.d.ts.map +1 -0
  113. package/dist/vector/services/trajectory-tracker.js +445 -0
  114. package/dist/vector/services/trajectory-tracker.js.map +1 -0
  115. package/dist/vector/services/vector-store.d.ts +339 -0
  116. package/dist/vector/services/vector-store.d.ts.map +1 -0
  117. package/dist/vector/services/vector-store.js +748 -0
  118. package/dist/vector/services/vector-store.js.map +1 -0
  119. package/dist/vector/types.d.ts +677 -0
  120. package/dist/vector/types.d.ts.map +1 -0
  121. package/dist/workflow/adapters/goap-adapter.d.ts +196 -0
  122. package/dist/workflow/adapters/goap-adapter.d.ts.map +1 -0
  123. package/dist/workflow/adapters/goap-adapter.js +706 -0
  124. package/dist/workflow/adapters/goap-adapter.js.map +1 -0
  125. package/dist/workflow/adapters/index.d.ts +10 -0
  126. package/dist/workflow/adapters/index.d.ts.map +1 -0
  127. package/dist/workflow/config.d.ts +135 -0
  128. package/dist/workflow/config.d.ts.map +1 -0
  129. package/dist/workflow/config.js +92 -0
  130. package/dist/workflow/config.js.map +1 -0
  131. package/dist/workflow/handlers/index.d.ts +9 -0
  132. package/dist/workflow/handlers/index.d.ts.map +1 -0
  133. package/dist/workflow/handlers/webhook-handlers.d.ts +397 -0
  134. package/dist/workflow/handlers/webhook-handlers.d.ts.map +1 -0
  135. package/dist/workflow/handlers/webhook-handlers.js +454 -0
  136. package/dist/workflow/handlers/webhook-handlers.js.map +1 -0
  137. package/dist/workflow/index.d.ts +42 -0
  138. package/dist/workflow/index.d.ts.map +1 -0
  139. package/dist/workflow/services/index.d.ts +9 -0
  140. package/dist/workflow/services/index.d.ts.map +1 -0
  141. package/dist/workflow/services/workflow-service.d.ts +318 -0
  142. package/dist/workflow/services/workflow-service.d.ts.map +1 -0
  143. package/dist/workflow/services/workflow-service.js +577 -0
  144. package/dist/workflow/services/workflow-service.js.map +1 -0
  145. package/dist/workflow/types.d.ts +470 -0
  146. package/dist/workflow/types.d.ts.map +1 -0
  147. package/dist/workflow/workflows/realtime-collab.d.ts +245 -0
  148. package/dist/workflow/workflows/realtime-collab.d.ts.map +1 -0
  149. package/package.json +1 -1
@@ -0,0 +1,470 @@
1
+ /**
2
+ * Workflow Types for Knowledge Graph Agent
3
+ *
4
+ * Type definitions for GOAP (Goal-Oriented Action Planning) workflows,
5
+ * event handling, and task management.
6
+ *
7
+ * @module workflow/types
8
+ */
9
+ /**
10
+ * World state representing the current situation for GOAP planning
11
+ *
12
+ * The planner uses this state to determine which actions are applicable
13
+ * and to track progress toward goals.
14
+ *
15
+ * @example
16
+ * ```typescript
17
+ * const currentState: WorldState = {
18
+ * hasSpecification: true,
19
+ * specCompleteness: 0.8,
20
+ * hasAcceptanceCriteria: true,
21
+ * taskDefined: true,
22
+ * blockersFree: true,
23
+ * developmentStarted: false,
24
+ * timeSinceLastChange: 3600000, // 1 hour
25
+ * lastChangeTimestamp: Date.now() - 3600000,
26
+ * activeCollaborators: ['user-1', 'user-2'],
27
+ * pendingGaps: ['missing-auth-spec'],
28
+ * };
29
+ * ```
30
+ */
31
+ export interface WorldState {
32
+ /** Whether a specification document exists */
33
+ hasSpecification: boolean;
34
+ /** Completeness percentage of the specification (0-1) */
35
+ specCompleteness: number;
36
+ /** Whether acceptance criteria have been defined */
37
+ hasAcceptanceCriteria: boolean;
38
+ /** Whether the task has been formally defined */
39
+ taskDefined: boolean;
40
+ /** Whether all blockers have been resolved */
41
+ blockersFree: boolean;
42
+ /** Whether development work has started */
43
+ developmentStarted: boolean;
44
+ /** Time in milliseconds since the last document change */
45
+ timeSinceLastChange: number;
46
+ /** Timestamp of the last document change */
47
+ lastChangeTimestamp: number;
48
+ /** List of currently active collaborator IDs */
49
+ activeCollaborators: string[];
50
+ /** List of pending documentation gap IDs */
51
+ pendingGaps: string[];
52
+ /** Index signature for dynamic access to state properties */
53
+ [key: string]: boolean | number | string[] | undefined;
54
+ }
55
+ /**
56
+ * Event emitted when a knowledge graph node is updated
57
+ *
58
+ * @example
59
+ * ```typescript
60
+ * const event: NodeUpdateEvent = {
61
+ * nodeId: 'node-123',
62
+ * userId: 'user-456',
63
+ * changes: { status: 'in-progress', priority: 'high' },
64
+ * timestamp: Date.now(),
65
+ * };
66
+ * ```
67
+ */
68
+ export interface NodeUpdateEvent {
69
+ /** ID of the updated node */
70
+ nodeId: string;
71
+ /** ID of the user who made the update */
72
+ userId: string;
73
+ /** Map of changed fields and their new values */
74
+ changes: Record<string, unknown>;
75
+ /** Timestamp when the update occurred */
76
+ timestamp: number;
77
+ }
78
+ /**
79
+ * Event emitted when documentation gaps are detected
80
+ *
81
+ * @example
82
+ * ```typescript
83
+ * const event: GapDetectedEvent = {
84
+ * docPath: 'docs/api/authentication.md',
85
+ * gaps: ['missing-error-codes', 'incomplete-examples'],
86
+ * confidence: 0.92,
87
+ * detectedAt: Date.now(),
88
+ * };
89
+ * ```
90
+ */
91
+ export interface GapDetectedEvent {
92
+ /** Path to the document with detected gaps */
93
+ docPath: string;
94
+ /** List of identified gap types */
95
+ gaps: string[];
96
+ /** Confidence score of the gap detection (0-1) */
97
+ confidence: number;
98
+ /** Timestamp when gaps were detected */
99
+ detectedAt: number;
100
+ }
101
+ /**
102
+ * Event emitted when a workflow completes
103
+ *
104
+ * @example
105
+ * ```typescript
106
+ * const event: WorkflowCompleteEvent = {
107
+ * workflowId: 'wf-789',
108
+ * outcome: 'success',
109
+ * duration: 45000, // 45 seconds
110
+ * artifacts: ['docs/spec.md', 'docs/tasks/task-001.md'],
111
+ * };
112
+ * ```
113
+ */
114
+ export interface WorkflowCompleteEvent {
115
+ /** ID of the completed workflow */
116
+ workflowId: string;
117
+ /** Outcome of the workflow execution */
118
+ outcome: 'success' | 'failure' | 'timeout';
119
+ /** Total duration in milliseconds */
120
+ duration: number;
121
+ /** List of artifact paths produced by the workflow */
122
+ artifacts: string[];
123
+ }
124
+ /**
125
+ * Metadata for a running or completed workflow
126
+ *
127
+ * @example
128
+ * ```typescript
129
+ * const metadata: WorkflowRunMetadata = {
130
+ * id: 'run-abc-123',
131
+ * type: 'spec-generation',
132
+ * startedAt: new Date(),
133
+ * status: 'running',
134
+ * currentStep: 'analyze-requirements',
135
+ * lastEventAt: new Date(),
136
+ * };
137
+ * ```
138
+ */
139
+ export interface WorkflowRunMetadata {
140
+ /** Unique run identifier */
141
+ id: string;
142
+ /** Type of workflow being executed */
143
+ type: string;
144
+ /** Timestamp when the workflow started */
145
+ startedAt: Date;
146
+ /** Current status of the workflow */
147
+ status: 'running' | 'completed' | 'failed' | 'suspended';
148
+ /** ID of the currently executing step */
149
+ currentStep?: string;
150
+ /** Timestamp of the last event in this workflow */
151
+ lastEventAt?: Date;
152
+ }
153
+ /**
154
+ * Generated task specification from documentation analysis
155
+ *
156
+ * @example
157
+ * ```typescript
158
+ * const spec: TaskSpec = {
159
+ * id: 'task-001',
160
+ * version: '1.0.0',
161
+ * title: 'Implement User Authentication',
162
+ * description: 'Add JWT-based authentication to the API',
163
+ * priority: 'high',
164
+ * requirements: [
165
+ * 'Support email/password login',
166
+ * 'Implement token refresh',
167
+ * ],
168
+ * acceptanceCriteria: [
169
+ * 'User can login with valid credentials',
170
+ * 'Invalid credentials return 401',
171
+ * ],
172
+ * estimatedComplexity: 7,
173
+ * sourceDoc: 'docs/features/auth.md',
174
+ * generatedAt: new Date(),
175
+ * confidence: 0.88,
176
+ * };
177
+ * ```
178
+ */
179
+ export interface TaskSpec {
180
+ /** Unique task identifier */
181
+ id: string;
182
+ /** Semantic version of the task specification */
183
+ version: string;
184
+ /** Human-readable task title */
185
+ title: string;
186
+ /** Detailed description of the task */
187
+ description: string;
188
+ /** Task priority level */
189
+ priority: 'low' | 'medium' | 'high' | 'critical';
190
+ /** List of functional requirements */
191
+ requirements: string[];
192
+ /** List of acceptance criteria for completion */
193
+ acceptanceCriteria: string[];
194
+ /** Estimated complexity score (1-10) */
195
+ estimatedComplexity: number;
196
+ /** Path to the source document */
197
+ sourceDoc: string;
198
+ /** Timestamp when the spec was generated */
199
+ generatedAt: Date;
200
+ /** Confidence score of the extraction (0-1) */
201
+ confidence: number;
202
+ }
203
+ /**
204
+ * Individual gap identified in documentation
205
+ */
206
+ export interface DocumentGap {
207
+ /** Type of gap identified */
208
+ type: 'missing_section' | 'incomplete_spec' | 'unclear_requirement' | 'missing_example';
209
+ /** Description of the gap */
210
+ description: string;
211
+ /** Severity level of the gap */
212
+ severity: 'low' | 'medium' | 'high';
213
+ /** Suggested content to fill the gap */
214
+ suggestedContent?: string;
215
+ }
216
+ /**
217
+ * Result of gap analysis on a document
218
+ *
219
+ * @example
220
+ * ```typescript
221
+ * const analysis: GapAnalysis = {
222
+ * docPath: 'docs/api/endpoints.md',
223
+ * completeness: 0.65,
224
+ * gaps: [
225
+ * {
226
+ * type: 'missing_example',
227
+ * description: 'No code examples for POST /users endpoint',
228
+ * severity: 'medium',
229
+ * suggestedContent: '```typescript\nconst response = await fetch...',
230
+ * },
231
+ * ],
232
+ * recommendations: [
233
+ * 'Add request/response examples for all endpoints',
234
+ * 'Include error code documentation',
235
+ * ],
236
+ * analyzedAt: new Date(),
237
+ * };
238
+ * ```
239
+ */
240
+ export interface GapAnalysis {
241
+ /** Path to the analyzed document */
242
+ docPath: string;
243
+ /** Overall completeness score (0-1) */
244
+ completeness: number;
245
+ /** List of identified gaps */
246
+ gaps: DocumentGap[];
247
+ /** Recommendations for improvement */
248
+ recommendations: string[];
249
+ /** Timestamp when analysis was performed */
250
+ analyzedAt: Date;
251
+ }
252
+ /**
253
+ * GOAP (Goal-Oriented Action Planning) action definition
254
+ *
255
+ * Actions represent atomic operations that can transform the world state.
256
+ * The planner uses preconditions and effects to build action sequences.
257
+ *
258
+ * @example
259
+ * ```typescript
260
+ * const analyzeAction: GOAPAction = {
261
+ * id: 'analyze-spec',
262
+ * name: 'Analyze Specification',
263
+ * cost: 2,
264
+ * preconditions: {
265
+ * hasSpecification: true,
266
+ * },
267
+ * effects: {
268
+ * specCompleteness: 1.0, // Will be fully analyzed
269
+ * },
270
+ * execute: async (state) => {
271
+ * // Perform analysis
272
+ * return { ...state, specCompleteness: 1.0 };
273
+ * },
274
+ * };
275
+ * ```
276
+ */
277
+ export interface GOAPAction {
278
+ /** Unique action identifier */
279
+ id: string;
280
+ /** Human-readable action name */
281
+ name: string;
282
+ /** Description of what the action does */
283
+ description?: string;
284
+ /** Cost of executing this action (for planning optimization) */
285
+ cost: number;
286
+ /** World state conditions required before this action can execute */
287
+ preconditions: Partial<WorldState>;
288
+ /** Changes to world state after successful execution */
289
+ effects: Partial<WorldState>;
290
+ /** Async function that executes the action and returns the new state (optional) */
291
+ execute?: (state: WorldState) => Promise<WorldState>;
292
+ }
293
+ /**
294
+ * Step in a GOAP plan
295
+ */
296
+ export interface GOAPPlanStep {
297
+ /** ID of the action to execute */
298
+ action: string;
299
+ /** Cost of this step */
300
+ cost: number;
301
+ /** Expected world state after this step */
302
+ expectedState: Partial<WorldState>;
303
+ }
304
+ /**
305
+ * GOAP plan generated by the planner
306
+ *
307
+ * @example
308
+ * ```typescript
309
+ * const plan: GOAPPlan = {
310
+ * goal: 'Complete specification',
311
+ * achievable: true,
312
+ * steps: [
313
+ * { action: 'create-spec', cost: 3, expectedState: { hasSpecification: true } },
314
+ * { action: 'analyze-spec', cost: 2, expectedState: { specCompleteness: 1.0 } },
315
+ * ],
316
+ * totalCost: 5,
317
+ * confidence: 0.95,
318
+ * };
319
+ * ```
320
+ */
321
+ export interface GOAPPlan {
322
+ /** Goal ID this plan achieves */
323
+ goalId: string;
324
+ /** Description of the goal this plan achieves */
325
+ goal?: string;
326
+ /** Whether the goal is achievable from the current state */
327
+ achievable: boolean;
328
+ /** Ordered list of action IDs to execute */
329
+ actionIds: string[];
330
+ /** Ordered sequence of actions to execute with details */
331
+ steps?: GOAPPlanStep[];
332
+ /** Total cost of executing all steps */
333
+ totalCost: number;
334
+ /** Confidence score that the plan will succeed (0-1) */
335
+ confidence?: number;
336
+ /** Reason if plan is not achievable */
337
+ reason?: string;
338
+ /** Estimated time to complete in milliseconds */
339
+ estimatedTimeMs?: number;
340
+ /** When the plan was created */
341
+ createdAt?: Date;
342
+ }
343
+ /**
344
+ * Options for workflow execution
345
+ */
346
+ export interface WorkflowExecutionOptions {
347
+ /** Whether to run in dry-run mode (no side effects) */
348
+ dryRun?: boolean;
349
+ /** Maximum execution time in milliseconds */
350
+ timeout?: number;
351
+ /** Whether to continue on non-critical errors */
352
+ continueOnError?: boolean;
353
+ /** Callback for progress updates */
354
+ onProgress?: (progress: number, step: string) => void;
355
+ }
356
+ /**
357
+ * Result of workflow execution
358
+ */
359
+ export interface WorkflowExecutionResult {
360
+ /** Whether the workflow completed successfully */
361
+ success: boolean;
362
+ /** Workflow run metadata */
363
+ metadata: WorkflowRunMetadata;
364
+ /** List of produced artifacts */
365
+ artifacts: string[];
366
+ /** Error message if failed */
367
+ error?: string;
368
+ /** Detailed execution logs */
369
+ logs: string[];
370
+ }
371
+ /**
372
+ * Hook handler function type
373
+ */
374
+ export type HookHandler<T> = (event: T) => Promise<void> | void;
375
+ /**
376
+ * Hook registration for workflow events
377
+ */
378
+ export interface HookRegistration<T> {
379
+ /** Unique hook identifier */
380
+ id: string;
381
+ /** Event type to listen for */
382
+ eventType: string;
383
+ /** Handler function */
384
+ handler: HookHandler<T>;
385
+ /** Priority for execution order (higher = earlier) */
386
+ priority?: number;
387
+ /** Whether the hook is currently enabled */
388
+ enabled: boolean;
389
+ }
390
+ /**
391
+ * GOAP Goal definition for the planner
392
+ *
393
+ * Goals define desired end states that the planner will attempt
394
+ * to achieve through a sequence of actions.
395
+ *
396
+ * @example
397
+ * ```typescript
398
+ * const developmentGoal: GOAPGoal = {
399
+ * id: 'start-development',
400
+ * name: 'Start Development',
401
+ * description: 'Get the project ready to begin development',
402
+ * conditions: {
403
+ * taskDefined: true,
404
+ * developmentStarted: true,
405
+ * },
406
+ * priority: 10,
407
+ * };
408
+ * ```
409
+ */
410
+ export interface GOAPGoal {
411
+ /** Unique goal identifier */
412
+ id: string;
413
+ /** Human-readable goal name */
414
+ name: string;
415
+ /** Goal description */
416
+ description?: string;
417
+ /** Desired world state conditions */
418
+ conditions: Partial<WorldState>;
419
+ /** Goal priority (higher = more important) */
420
+ priority: number;
421
+ }
422
+ /**
423
+ * Extended GOAP Plan type for the adapter
424
+ * (Extends the basic GOAPPlan with additional fields)
425
+ */
426
+ export interface GOAPPlanExtended extends GOAPPlan {
427
+ /** Goal ID this plan achieves */
428
+ goalId: string;
429
+ /** Ordered list of action IDs to execute */
430
+ actionIds: string[];
431
+ /** Reason if plan is not achievable */
432
+ reason?: string;
433
+ /** Estimated time to complete in milliseconds */
434
+ estimatedTimeMs?: number;
435
+ /** When the plan was created */
436
+ createdAt: Date;
437
+ }
438
+ /**
439
+ * Result of executing a GOAP plan
440
+ */
441
+ export interface PlanExecutionResult {
442
+ /** Whether the plan executed successfully */
443
+ success: boolean;
444
+ /** Final world state after execution */
445
+ finalState: WorldState;
446
+ /** IDs of completed action steps */
447
+ completedSteps: string[];
448
+ /** ID of the step that failed (if any) */
449
+ failedStep?: string;
450
+ /** Error message if execution failed */
451
+ error?: string;
452
+ /** Total execution time in milliseconds */
453
+ executionTimeMs: number;
454
+ }
455
+ /**
456
+ * Readiness evaluation result
457
+ */
458
+ export interface ReadinessEvaluation {
459
+ /** Readiness score from 0 to 1 */
460
+ score: number;
461
+ /** Whether the project is ready for development */
462
+ ready: boolean;
463
+ /** List of blocking issues */
464
+ blockers: string[];
465
+ /** Recommendations for improving readiness */
466
+ recommendations: string[];
467
+ /** When the evaluation was performed */
468
+ evaluatedAt: Date;
469
+ }
470
+ //# sourceMappingURL=types.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