agent-trajectories 0.5.3 → 0.5.5

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.
@@ -10,28 +10,34 @@ import { z } from 'zod';
10
10
  /**
11
11
  * Supported task source systems
12
12
  */
13
- type TaskSourceSystem = "beads" | "github" | "linear" | "jira" | "plain" | string;
13
+ type TaskSourceSystem =
14
+ | "beads"
15
+ | "github"
16
+ | "linear"
17
+ | "jira"
18
+ | "plain"
19
+ | string;
14
20
  /**
15
21
  * Reference to an external task/issue
16
22
  */
17
23
  interface TaskSource {
18
- /** The task management system (e.g., 'github', 'linear') */
19
- system: TaskSourceSystem;
20
- /** The external ID (e.g., 'GH#123', 'ENG-456') */
21
- id: string;
22
- /** Optional URL to the external task */
23
- url?: string;
24
+ /** The task management system (e.g., 'github', 'linear') */
25
+ system: TaskSourceSystem;
26
+ /** The external ID (e.g., 'GH#123', 'ENG-456') */
27
+ id: string;
28
+ /** Optional URL to the external task */
29
+ url?: string;
24
30
  }
25
31
  /**
26
32
  * Task reference - either standalone or linked to external system
27
33
  */
28
34
  interface TaskReference {
29
- /** Human-readable task title */
30
- title: string;
31
- /** Optional description */
32
- description?: string;
33
- /** Optional link to external task system */
34
- source?: TaskSource;
35
+ /** Human-readable task title */
36
+ title: string;
37
+ /** Optional description */
38
+ description?: string;
39
+ /** Optional link to external task system */
40
+ source?: TaskSource;
35
41
  }
36
42
  /**
37
43
  * Trajectory status
@@ -40,7 +46,18 @@ type TrajectoryStatus = "active" | "completed" | "abandoned";
40
46
  /**
41
47
  * Event types that can be recorded in a trajectory
42
48
  */
43
- type TrajectoryEventType = "prompt" | "thinking" | "tool_call" | "tool_result" | "message_sent" | "message_received" | "decision" | "finding" | "reflection" | "note" | "error";
49
+ type TrajectoryEventType =
50
+ | "prompt"
51
+ | "thinking"
52
+ | "tool_call"
53
+ | "tool_result"
54
+ | "message_sent"
55
+ | "message_received"
56
+ | "decision"
57
+ | "finding"
58
+ | "reflection"
59
+ | "note"
60
+ | "error";
44
61
  /**
45
62
  * Significance level for events
46
63
  */
@@ -49,246 +66,249 @@ type EventSignificance = "low" | "medium" | "high" | "critical";
49
66
  * A single event in the trajectory timeline
50
67
  */
51
68
  interface TrajectoryEvent {
52
- /** Unix timestamp in milliseconds */
53
- ts: number;
54
- /** Type of event */
55
- type: TrajectoryEventType;
56
- /** Human-readable summary of the event */
57
- content: string;
58
- /** Full raw data (optional, for debugging) */
59
- raw?: unknown;
60
- /** Importance level */
61
- significance?: EventSignificance;
62
- /** Confidence level for this event (0-1) */
63
- confidence?: number;
64
- /** User-defined tags */
65
- tags?: string[];
69
+ /** Unix timestamp in milliseconds */
70
+ ts: number;
71
+ /** Type of event */
72
+ type: TrajectoryEventType;
73
+ /** Human-readable summary of the event */
74
+ content: string;
75
+ /** Full raw data (optional, for debugging) */
76
+ raw?: unknown;
77
+ /** Importance level */
78
+ significance?: EventSignificance;
79
+ /** Confidence level for this event (0-1) */
80
+ confidence?: number;
81
+ /** User-defined tags */
82
+ tags?: string[];
66
83
  }
67
84
  /**
68
85
  * An alternative option that was considered
69
86
  */
70
87
  interface Alternative {
71
- /** The alternative option */
72
- option: string;
73
- /** Why this alternative was not chosen */
74
- reason?: string;
88
+ /** The alternative option */
89
+ option: string;
90
+ /** Why this alternative was not chosen */
91
+ reason?: string;
75
92
  }
76
93
  /**
77
94
  * A structured decision record
78
95
  */
79
96
  interface Decision {
80
- /** What was the choice/question? */
81
- question: string;
82
- /** What was chosen */
83
- chosen: string;
84
- /** What alternatives were considered */
85
- alternatives: Alternative[];
86
- /** Why this choice was made */
87
- reasoning: string;
88
- /** Confidence in this decision (0-1) */
89
- confidence?: number;
97
+ /** What was the choice/question? */
98
+ question: string;
99
+ /** What was chosen */
100
+ chosen: string;
101
+ /** What alternatives were considered */
102
+ alternatives: Alternative[];
103
+ /** Why this choice was made */
104
+ reasoning: string;
105
+ /** Confidence in this decision (0-1) */
106
+ confidence?: number;
90
107
  }
91
108
  /**
92
109
  * Finding category types
93
110
  */
94
- type FindingCategory = "bug" | "pattern" | "optimization" | "security" | "documentation" | "dependency" | "other";
111
+ type FindingCategory =
112
+ | "bug"
113
+ | "pattern"
114
+ | "optimization"
115
+ | "security"
116
+ | "documentation"
117
+ | "dependency"
118
+ | "other";
95
119
  /**
96
120
  * A structured finding record - captures discoveries made during exploration
97
121
  */
98
122
  interface Finding {
99
- /** What was found */
100
- what: string;
101
- /** Where it was found (file path, component, etc.) */
102
- where: string;
103
- /** Why this finding is significant */
104
- significance: string;
105
- /** Category of the finding */
106
- category: FindingCategory;
107
- /** Suggested action or follow-up */
108
- suggestedAction?: string;
109
- /** Confidence in this finding (0-1) */
110
- confidence?: number;
123
+ /** What was found */
124
+ what: string;
125
+ /** Where it was found (file path, component, etc.) */
126
+ where: string;
127
+ /** Why this finding is significant */
128
+ significance: string;
129
+ /** Category of the finding */
130
+ category: FindingCategory;
131
+ /** Suggested action or follow-up */
132
+ suggestedAction?: string;
133
+ /** Confidence in this finding (0-1) */
134
+ confidence?: number;
111
135
  }
112
136
  /**
113
137
  * Agent participation record
114
138
  */
115
139
  interface AgentParticipation {
116
- /** Agent identifier */
117
- name: string;
118
- /** Role in the trajectory */
119
- role: "lead" | "contributor" | "reviewer";
120
- /** When the agent joined */
121
- joinedAt: string;
122
- /** When the agent left (if applicable) */
123
- leftAt?: string;
140
+ /** Agent identifier */
141
+ name: string;
142
+ /** Role in the trajectory */
143
+ role: "lead" | "contributor" | "reviewer";
144
+ /** When the agent joined */
145
+ joinedAt: string;
146
+ /** When the agent left (if applicable) */
147
+ leftAt?: string;
124
148
  }
125
149
  /**
126
150
  * A chapter represents a logical phase of work
127
151
  */
128
152
  interface Chapter {
129
- /** Unique chapter ID */
130
- id: string;
131
- /** Chapter title (e.g., "Initial exploration", "Implementation") */
132
- title: string;
133
- /** Which agent is working in this chapter */
134
- agentName: string;
135
- /** When the chapter started (ISO timestamp) */
136
- startedAt: string;
137
- /** When the chapter ended (ISO timestamp, undefined if current) */
138
- endedAt?: string;
139
- /** Events that occurred in this chapter */
140
- events: TrajectoryEvent[];
153
+ /** Unique chapter ID */
154
+ id: string;
155
+ /** Chapter title (e.g., "Initial exploration", "Implementation") */
156
+ title: string;
157
+ /** Which agent is working in this chapter */
158
+ agentName: string;
159
+ /** When the chapter started (ISO timestamp) */
160
+ startedAt: string;
161
+ /** When the chapter ended (ISO timestamp, undefined if current) */
162
+ endedAt?: string;
163
+ /** Events that occurred in this chapter */
164
+ events: TrajectoryEvent[];
141
165
  }
142
166
  /**
143
167
  * Retrospective reflection on the completed work
144
168
  */
145
169
  interface Retrospective {
146
- /** Brief summary of what was accomplished */
147
- summary: string;
148
- /** How the work was approached */
149
- approach: string;
150
- /** Key decisions made during the work */
151
- decisions?: Decision[];
152
- /** What was unexpectedly difficult */
153
- challenges?: string[];
154
- /** What was learned */
155
- learnings?: string[];
156
- /** Suggestions for improvement */
157
- suggestions?: string[];
158
- /** Agent's confidence in the solution (0-1) */
159
- confidence: number;
160
- /** Total time spent (human-readable) */
161
- timeSpent?: string;
170
+ /** Brief summary of what was accomplished */
171
+ summary: string;
172
+ /** How the work was approached */
173
+ approach: string;
174
+ /** Key decisions made during the work */
175
+ decisions?: Decision[];
176
+ /** What was unexpectedly difficult */
177
+ challenges?: string[];
178
+ /** What was learned */
179
+ learnings?: string[];
180
+ /** Suggestions for improvement */
181
+ suggestions?: string[];
182
+ /** Agent's confidence in the solution (0-1) */
183
+ confidence: number;
184
+ /** Total time spent (human-readable) */
185
+ timeSpent?: string;
162
186
  }
163
187
  /**
164
188
  * The main Trajectory type - represents the complete record of work on a task
165
189
  */
166
190
  interface Trajectory {
167
- /** Unique trajectory ID (format: traj_xxxxxxxxxxxx) */
168
- id: string;
169
- /** Schema version for forward compatibility */
170
- version: 1;
171
- /** The task being worked on */
172
- task: TaskReference;
173
- /** Current status */
174
- status: TrajectoryStatus;
175
- /** When work started (ISO timestamp) */
176
- startedAt: string;
177
- /** When work completed (ISO timestamp) */
178
- completedAt?: string;
179
- /** Agents who participated */
180
- agents: AgentParticipation[];
181
- /** Logical phases of work */
182
- chapters: Chapter[];
183
- /** Final reflection (only on completion) */
184
- retrospective?: Retrospective;
185
- /** Git commits produced */
186
- commits: string[];
187
- /** Files that were modified */
188
- filesChanged: string[];
189
- /** Project identifier */
190
- projectId: string;
191
- /** Opaque id set by the workflow runner via TRAJECTORIES_WORKFLOW_ID env var. Lets trail compact --workflow <id> collate all trajectories from a single workflow run. */
192
- workflowId?: string;
193
- /** User-defined tags */
194
- tags: string[];
195
- /** Trace information for code attribution */
196
- _trace?: TrajectoryTraceRef;
191
+ /** Unique trajectory ID (format: traj_xxxxxxxxxxxx) */
192
+ id: string;
193
+ /** Schema version for forward compatibility */
194
+ version: 1;
195
+ /** The task being worked on */
196
+ task: TaskReference;
197
+ /** Current status */
198
+ status: TrajectoryStatus;
199
+ /** When work started (ISO timestamp) */
200
+ startedAt: string;
201
+ /** When work completed (ISO timestamp) */
202
+ completedAt?: string;
203
+ /** Agents who participated */
204
+ agents: AgentParticipation[];
205
+ /** Logical phases of work */
206
+ chapters: Chapter[];
207
+ /** Final reflection (only on completion) */
208
+ retrospective?: Retrospective;
209
+ /** Git commits produced */
210
+ commits: string[];
211
+ /** Files that were modified */
212
+ filesChanged: string[];
213
+ /** Project identifier */
214
+ projectId: string;
215
+ /** User-defined tags */
216
+ tags: string[];
217
+ /** Trace information for code attribution */
218
+ _trace?: TrajectoryTraceRef;
197
219
  }
198
220
  /**
199
221
  * Summary of a trajectory for listing/indexing
200
222
  */
201
223
  interface TrajectorySummary {
202
- id: string;
203
- title: string;
204
- status: TrajectoryStatus;
205
- startedAt: string;
206
- completedAt?: string;
207
- confidence?: number;
208
- chapterCount: number;
209
- decisionCount: number;
224
+ id: string;
225
+ title: string;
226
+ status: TrajectoryStatus;
227
+ startedAt: string;
228
+ completedAt?: string;
229
+ confidence?: number;
230
+ chapterCount: number;
231
+ decisionCount: number;
210
232
  }
211
233
  /**
212
234
  * Input for creating a new trajectory
213
235
  */
214
236
  interface CreateTrajectoryInput {
215
- /** Task title */
216
- title: string;
217
- /** Optional task description */
218
- description?: string;
219
- /** Optional external task reference */
220
- source?: TaskSource;
221
- /** Optional project ID (defaults to cwd) */
222
- projectId?: string;
223
- /** Opaque id set by the workflow runner via TRAJECTORIES_WORKFLOW_ID env var. Lets trail compact --workflow <id> collate all trajectories from a single workflow run. */
224
- workflowId?: string;
225
- /** Optional initial tags */
226
- tags?: string[];
237
+ /** Task title */
238
+ title: string;
239
+ /** Optional task description */
240
+ description?: string;
241
+ /** Optional external task reference */
242
+ source?: TaskSource;
243
+ /** Optional project ID (defaults to cwd) */
244
+ projectId?: string;
245
+ /** Optional initial tags */
246
+ tags?: string[];
227
247
  }
228
248
  /**
229
249
  * Input for adding a chapter
230
250
  */
231
251
  interface AddChapterInput {
232
- /** Chapter title */
233
- title: string;
234
- /** Agent name */
235
- agentName: string;
252
+ /** Chapter title */
253
+ title: string;
254
+ /** Agent name */
255
+ agentName: string;
236
256
  }
237
257
  /**
238
258
  * Input for adding an event
239
259
  */
240
260
  interface AddEventInput {
241
- /** Event type */
242
- type: TrajectoryEventType;
243
- /** Human-readable content */
244
- content: string;
245
- /** Optional raw data */
246
- raw?: unknown;
247
- /** Optional significance */
248
- significance?: EventSignificance;
249
- /** Optional tags */
250
- tags?: string[];
261
+ /** Event type */
262
+ type: TrajectoryEventType;
263
+ /** Human-readable content */
264
+ content: string;
265
+ /** Optional raw data */
266
+ raw?: unknown;
267
+ /** Optional significance */
268
+ significance?: EventSignificance;
269
+ /** Optional tags */
270
+ tags?: string[];
251
271
  }
252
272
  /**
253
273
  * Input for completing a trajectory
254
274
  */
255
275
  interface CompleteTrajectoryInput {
256
- summary: string;
257
- approach: string;
258
- decisions?: Decision[];
259
- challenges?: string[];
260
- learnings?: string[];
261
- suggestions?: string[];
262
- confidence: number;
276
+ summary: string;
277
+ approach: string;
278
+ decisions?: Decision[];
279
+ challenges?: string[];
280
+ learnings?: string[];
281
+ suggestions?: string[];
282
+ confidence: number;
263
283
  }
264
284
  /**
265
285
  * Query options for listing trajectories
266
286
  */
267
287
  interface TrajectoryQuery {
268
- /** Filter by status */
269
- status?: TrajectoryStatus;
270
- /** Filter by date range */
271
- since?: string;
272
- until?: string;
273
- /** Maximum results */
274
- limit?: number;
275
- /** Offset for pagination */
276
- offset?: number;
277
- /** Sort field */
278
- sortBy?: "startedAt" | "completedAt" | "title";
279
- /** Sort direction */
280
- sortOrder?: "asc" | "desc";
288
+ /** Filter by status */
289
+ status?: TrajectoryStatus;
290
+ /** Filter by date range */
291
+ since?: string;
292
+ until?: string;
293
+ /** Maximum results */
294
+ limit?: number;
295
+ /** Offset for pagination */
296
+ offset?: number;
297
+ /** Sort field */
298
+ sortBy?: "startedAt" | "completedAt" | "title";
299
+ /** Sort direction */
300
+ sortOrder?: "asc" | "desc";
281
301
  }
282
302
  /**
283
303
  * Reference to trace information within a trajectory
284
304
  */
285
305
  interface TrajectoryTraceRef {
286
- /** Git ref (commit hash) when trace started */
287
- startRef: string;
288
- /** Git ref (commit hash) when trace ended */
289
- endRef?: string;
290
- /** ID of the associated trace record */
291
- traceId?: string;
306
+ /** Git ref (commit hash) when trace started */
307
+ startRef: string;
308
+ /** Git ref (commit hash) when trace ended */
309
+ endRef?: string;
310
+ /** ID of the associated trace record */
311
+ traceId?: string;
292
312
  }
293
313
 
294
314
  /**
@@ -889,6 +909,19 @@ declare function abandonTrajectory(trajectory: Trajectory, reason?: string): Tra
889
909
  * Active trajectories go in active/, completed in completed/YYYY-MM/.
890
910
  */
891
911
 
912
+ /**
913
+ * Aggregated counts emitted by reconcileIndex for observability. Exposed
914
+ * on the return value so tests and callers can assert on counts without
915
+ * parsing log output.
916
+ */
917
+ interface ReconcileSummary {
918
+ scanned: number;
919
+ added: number;
920
+ alreadyIndexed: number;
921
+ skippedMalformedJson: number;
922
+ skippedSchemaViolation: number;
923
+ skippedIoError: number;
924
+ }
892
925
  /**
893
926
  * File system storage adapter
894
927
  */
@@ -904,9 +937,34 @@ declare class FileStorage implements StorageAdapter {
904
937
  */
905
938
  initialize(): Promise<void>;
906
939
  /**
907
- * Save a trajectory
940
+ * Scan active/ and completed/ recursively and add any trajectory files
941
+ * missing from the index. Existing entries are preserved — reconcile
942
+ * only adds, never removes.
943
+ *
944
+ * Handles three on-disk layouts in completed/:
945
+ * - flat: completed/{id}.json (legacy workforce data)
946
+ * - monthly: completed/YYYY-MM/{id}.json (current save() writes)
947
+ * - nested: completed/.../{id}.json (defensive — any depth)
948
+ *
949
+ * Returns a ReconcileSummary so tests and CLI wrappers can observe
950
+ * outcomes without parsing logs. Only writes the index if anything was
951
+ * added.
908
952
  */
909
- save(trajectory: Trajectory): Promise<void>;
953
+ reconcileIndex(): Promise<ReconcileSummary>;
954
+ /**
955
+ * Recursively collect all .json file paths under `dir` into `out`.
956
+ * Silently treats a missing directory as empty.
957
+ */
958
+ private walkJsonFilesInto;
959
+ /**
960
+ * Save a trajectory.
961
+ *
962
+ * Validates the input against the trajectory schema before touching
963
+ * disk. Closes the historical read/write asymmetry where save() would
964
+ * happily write data that the reader then rejected, producing files
965
+ * that could never be loaded back.
966
+ */
967
+ save(input: Trajectory): Promise<void>;
910
968
  /**
911
969
  * Get a trajectory by ID
912
970
  */
@@ -933,7 +991,19 @@ declare class FileStorage implements StorageAdapter {
933
991
  * Close storage (no-op for file storage)
934
992
  */
935
993
  close(): Promise<void>;
994
+ /**
995
+ * Read a trajectory file and return a tagged result so callers can
996
+ * distinguish missing files, malformed JSON, and schema violations.
997
+ *
998
+ * Does NOT log. Callers choose whether to warn, swallow, or throw.
999
+ */
936
1000
  private readTrajectoryFile;
1001
+ /**
1002
+ * Convenience wrapper for callers that only care whether they got a
1003
+ * trajectory. Returns null for any failure and writes nothing to the
1004
+ * console — so nothing leaks into test output or the CLI spinner.
1005
+ */
1006
+ private readTrajectoryOrNull;
937
1007
  private loadIndex;
938
1008
  private saveIndex;
939
1009
  private updateIndex;
@@ -1028,17 +1098,17 @@ declare const TrajectorySchema: z.ZodObject<{
1028
1098
  completedAt: z.ZodOptional<z.ZodString>;
1029
1099
  agents: z.ZodArray<z.ZodObject<{
1030
1100
  name: z.ZodString;
1031
- role: z.ZodEnum<["lead", "contributor", "reviewer"]>;
1101
+ role: z.ZodString;
1032
1102
  joinedAt: z.ZodString;
1033
1103
  leftAt: z.ZodOptional<z.ZodString>;
1034
1104
  }, "strip", z.ZodTypeAny, {
1035
1105
  name: string;
1036
- role: "lead" | "contributor" | "reviewer";
1106
+ role: string;
1037
1107
  joinedAt: string;
1038
1108
  leftAt?: string | undefined;
1039
1109
  }, {
1040
1110
  name: string;
1041
- role: "lead" | "contributor" | "reviewer";
1111
+ role: string;
1042
1112
  joinedAt: string;
1043
1113
  leftAt?: string | undefined;
1044
1114
  }>, "many">;
@@ -1050,7 +1120,7 @@ declare const TrajectorySchema: z.ZodObject<{
1050
1120
  endedAt: z.ZodOptional<z.ZodString>;
1051
1121
  events: z.ZodArray<z.ZodObject<{
1052
1122
  ts: z.ZodNumber;
1053
- type: z.ZodUnion<[z.ZodLiteral<"prompt">, z.ZodLiteral<"thinking">, z.ZodLiteral<"tool_call">, z.ZodLiteral<"tool_result">, z.ZodLiteral<"message_sent">, z.ZodLiteral<"message_received">, z.ZodLiteral<"decision">, z.ZodLiteral<"finding">, z.ZodLiteral<"reflection">, z.ZodLiteral<"note">, z.ZodLiteral<"error">, z.ZodString]>;
1123
+ type: z.ZodUnion<[z.ZodLiteral<"prompt">, z.ZodLiteral<"thinking">, z.ZodLiteral<"tool_call">, z.ZodLiteral<"tool_result">, z.ZodLiteral<"message_sent">, z.ZodLiteral<"message_received">, z.ZodLiteral<"decision">, z.ZodLiteral<"finding">, z.ZodLiteral<"reflection">, z.ZodLiteral<"note">, z.ZodLiteral<"error">, z.ZodLiteral<"completion-evidence">, z.ZodLiteral<"completion-marker">, z.ZodString]>;
1054
1124
  content: z.ZodString;
1055
1125
  raw: z.ZodOptional<z.ZodUnknown>;
1056
1126
  significance: z.ZodOptional<z.ZodEnum<["low", "medium", "high", "critical"]>>;
@@ -1183,11 +1253,11 @@ declare const TrajectorySchema: z.ZodObject<{
1183
1253
  suggestions?: string[] | undefined;
1184
1254
  timeSpent?: string | undefined;
1185
1255
  }>>;
1186
- commits: z.ZodArray<z.ZodString, "many">;
1187
- filesChanged: z.ZodArray<z.ZodString, "many">;
1188
- projectId: z.ZodString;
1256
+ commits: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
1257
+ filesChanged: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
1258
+ projectId: z.ZodOptional<z.ZodString>;
1189
1259
  workflowId: z.ZodOptional<z.ZodString>;
1190
- tags: z.ZodArray<z.ZodString, "many">;
1260
+ tags: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
1191
1261
  _trace: z.ZodOptional<z.ZodObject<{
1192
1262
  startRef: z.ZodString;
1193
1263
  endRef: z.ZodOptional<z.ZodString>;
@@ -1218,7 +1288,7 @@ declare const TrajectorySchema: z.ZodObject<{
1218
1288
  };
1219
1289
  agents: {
1220
1290
  name: string;
1221
- role: "lead" | "contributor" | "reviewer";
1291
+ role: string;
1222
1292
  joinedAt: string;
1223
1293
  leftAt?: string | undefined;
1224
1294
  }[];
@@ -1240,7 +1310,6 @@ declare const TrajectorySchema: z.ZodObject<{
1240
1310
  }[];
1241
1311
  commits: string[];
1242
1312
  filesChanged: string[];
1243
- projectId: string;
1244
1313
  completedAt?: string | undefined;
1245
1314
  retrospective?: {
1246
1315
  confidence: number;
@@ -1261,6 +1330,7 @@ declare const TrajectorySchema: z.ZodObject<{
1261
1330
  suggestions?: string[] | undefined;
1262
1331
  timeSpent?: string | undefined;
1263
1332
  } | undefined;
1333
+ projectId?: string | undefined;
1264
1334
  workflowId?: string | undefined;
1265
1335
  _trace?: {
1266
1336
  startRef: string;
@@ -1270,7 +1340,6 @@ declare const TrajectorySchema: z.ZodObject<{
1270
1340
  }, {
1271
1341
  status: "active" | "completed" | "abandoned";
1272
1342
  id: string;
1273
- tags: string[];
1274
1343
  startedAt: string;
1275
1344
  version: 1;
1276
1345
  task: {
@@ -1284,7 +1353,7 @@ declare const TrajectorySchema: z.ZodObject<{
1284
1353
  };
1285
1354
  agents: {
1286
1355
  name: string;
1287
- role: "lead" | "contributor" | "reviewer";
1356
+ role: string;
1288
1357
  joinedAt: string;
1289
1358
  leftAt?: string | undefined;
1290
1359
  }[];
@@ -1304,9 +1373,7 @@ declare const TrajectorySchema: z.ZodObject<{
1304
1373
  }[];
1305
1374
  endedAt?: string | undefined;
1306
1375
  }[];
1307
- commits: string[];
1308
- filesChanged: string[];
1309
- projectId: string;
1376
+ tags?: string[] | undefined;
1310
1377
  completedAt?: string | undefined;
1311
1378
  retrospective?: {
1312
1379
  confidence: number;
@@ -1327,6 +1394,9 @@ declare const TrajectorySchema: z.ZodObject<{
1327
1394
  suggestions?: string[] | undefined;
1328
1395
  timeSpent?: string | undefined;
1329
1396
  } | undefined;
1397
+ commits?: string[] | undefined;
1398
+ filesChanged?: string[] | undefined;
1399
+ projectId?: string | undefined;
1330
1400
  workflowId?: string | undefined;
1331
1401
  _trace?: {
1332
1402
  startRef: string;
@@ -1486,7 +1556,7 @@ declare function validateCompleteInput(data: unknown): {
1486
1556
  */
1487
1557
  declare const TrajectoryEventSchema: z.ZodObject<{
1488
1558
  ts: z.ZodNumber;
1489
- type: z.ZodUnion<[z.ZodLiteral<"prompt">, z.ZodLiteral<"thinking">, z.ZodLiteral<"tool_call">, z.ZodLiteral<"tool_result">, z.ZodLiteral<"message_sent">, z.ZodLiteral<"message_received">, z.ZodLiteral<"decision">, z.ZodLiteral<"finding">, z.ZodLiteral<"reflection">, z.ZodLiteral<"note">, z.ZodLiteral<"error">, z.ZodString]>;
1559
+ type: z.ZodUnion<[z.ZodLiteral<"prompt">, z.ZodLiteral<"thinking">, z.ZodLiteral<"tool_call">, z.ZodLiteral<"tool_result">, z.ZodLiteral<"message_sent">, z.ZodLiteral<"message_received">, z.ZodLiteral<"decision">, z.ZodLiteral<"finding">, z.ZodLiteral<"reflection">, z.ZodLiteral<"note">, z.ZodLiteral<"error">, z.ZodLiteral<"completion-evidence">, z.ZodLiteral<"completion-marker">, z.ZodString]>;
1490
1560
  content: z.ZodString;
1491
1561
  raw: z.ZodOptional<z.ZodUnknown>;
1492
1562
  significance: z.ZodOptional<z.ZodEnum<["low", "medium", "high", "critical"]>>;
@@ -1521,7 +1591,7 @@ declare const ChapterSchema: z.ZodObject<{
1521
1591
  endedAt: z.ZodOptional<z.ZodString>;
1522
1592
  events: z.ZodArray<z.ZodObject<{
1523
1593
  ts: z.ZodNumber;
1524
- type: z.ZodUnion<[z.ZodLiteral<"prompt">, z.ZodLiteral<"thinking">, z.ZodLiteral<"tool_call">, z.ZodLiteral<"tool_result">, z.ZodLiteral<"message_sent">, z.ZodLiteral<"message_received">, z.ZodLiteral<"decision">, z.ZodLiteral<"finding">, z.ZodLiteral<"reflection">, z.ZodLiteral<"note">, z.ZodLiteral<"error">, z.ZodString]>;
1594
+ type: z.ZodUnion<[z.ZodLiteral<"prompt">, z.ZodLiteral<"thinking">, z.ZodLiteral<"tool_call">, z.ZodLiteral<"tool_result">, z.ZodLiteral<"message_sent">, z.ZodLiteral<"message_received">, z.ZodLiteral<"decision">, z.ZodLiteral<"finding">, z.ZodLiteral<"reflection">, z.ZodLiteral<"note">, z.ZodLiteral<"error">, z.ZodLiteral<"completion-evidence">, z.ZodLiteral<"completion-marker">, z.ZodString]>;
1525
1595
  content: z.ZodString;
1526
1596
  raw: z.ZodOptional<z.ZodUnknown>;
1527
1597
  significance: z.ZodOptional<z.ZodEnum<["low", "medium", "high", "critical"]>>;