t3code-cli 0.6.0 → 0.8.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 (50) hide show
  1. package/dist/auth.js +2 -2
  2. package/dist/bin.js +56 -5
  3. package/dist/connection.js +3 -3
  4. package/dist/{error-B2t1bAP9.js → error-ChTsLQTu.js} +2 -2
  5. package/dist/{error-jwMt3VoW.js → error-CjADNVm8.js} +1 -1
  6. package/dist/index.js +1 -1
  7. package/dist/{layer-DvHnKBYj.js → layer-CMo36MrX.js} +3 -3
  8. package/dist/{layer-CfC5qZol.js → layer-Do8wK1t6.js} +3 -3
  9. package/dist/{layer-DIg0RxSO.js → layer-DwI3Skkh.js} +69 -63
  10. package/dist/orchestration.js +1 -1
  11. package/dist/rpc.js +1 -1
  12. package/dist/runtime.js +1 -1
  13. package/dist/src/application/layer.d.ts +61 -0
  14. package/dist/src/application/models.d.ts +1 -0
  15. package/dist/src/application/projects.d.ts +9 -0
  16. package/dist/src/application/service.d.ts +9 -0
  17. package/dist/src/application/shell-sequence.d.ts +9 -0
  18. package/dist/src/application/thread-wait.d.ts +9 -0
  19. package/dist/src/application/threads.d.ts +52 -1
  20. package/dist/src/cli-path/layer.d.ts +3 -0
  21. package/dist/src/cli-path/service.d.ts +8 -0
  22. package/dist/src/domain/helpers.d.ts +11 -3
  23. package/dist/src/domain/model-config.d.ts +3 -0
  24. package/dist/src/domain/thread-lifecycle.d.ts +9 -0
  25. package/dist/src/orchestration/layer.d.ts +215 -0
  26. package/dist/src/rpc/layer.d.ts +466 -0
  27. package/dist/src/rpc/ws-group.d.ts +142 -0
  28. package/dist/src/runtime/layer.d.ts +1 -1
  29. package/dist/{src-KdbHqrex.js → src-aiFPmAG7.js} +169 -13
  30. package/dist/t3tools.js +2 -2
  31. package/dist/{transport-D3zBdZ1h.js → transport-MI0Z3d2T.js} +2 -2
  32. package/dist/upstream-t3code/packages/contracts/src/environmentHttp.d.ts +33 -10
  33. package/dist/upstream-t3code/packages/contracts/src/ipc.d.ts +6 -0
  34. package/dist/upstream-t3code/packages/contracts/src/orchestration.d.ts +657 -1
  35. package/dist/upstream-t3code/packages/contracts/src/provider.d.ts +14 -0
  36. package/dist/upstream-t3code/packages/contracts/src/providerRuntime.d.ts +175 -1
  37. package/dist/upstream-t3code/packages/contracts/src/rpc.d.ts +492 -0
  38. package/dist/upstream-t3code/packages/contracts/src/server.d.ts +45 -0
  39. package/dist/upstream-t3code/packages/contracts/src/settings.d.ts +21 -0
  40. package/dist/upstream-t3code/packages/contracts/src/terminal.d.ts +6 -3
  41. package/package.json +6 -3
  42. package/src/application/service.ts +13 -0
  43. package/src/application/threads.ts +15 -3
  44. package/src/cli/thread.ts +2 -0
  45. package/src/cli/threads/callback.ts +92 -0
  46. package/src/cli-path/layer.ts +10 -0
  47. package/src/cli-path/service.ts +7 -0
  48. package/src/domain/helpers.test.ts +103 -0
  49. package/src/domain/helpers.ts +61 -85
  50. package/src/runtime/layer.ts +2 -0
@@ -5,7 +5,7 @@ import { Environment } from "../environment/service.ts";
5
5
  import { T3Orchestration } from "../orchestration/service.ts";
6
6
  import { ProjectLookupError, ThreadSessionError } from "../domain/error.ts";
7
7
  import { type StartThreadInput } from "./service.ts";
8
- import type { SendThreadInput } from "./service.ts";
8
+ import type { SendThreadInput, CallbackThreadInput } from "./service.ts";
9
9
  export declare const makeThreadApplication: () => Effect.Effect<{
10
10
  archiveThread: (threadId: string) => Effect.Effect<{
11
11
  readonly sequence: number;
@@ -87,6 +87,15 @@ export declare const makeThreadApplication: () => Effect.Effect<{
87
87
  readonly updatedAt: string;
88
88
  readonly providerInstanceId?: (string & import("effect/Brand").Brand<"ProviderInstanceId">) | undefined;
89
89
  } | null;
90
+ readonly goal: {
91
+ readonly objective: string;
92
+ readonly status: "active" | "paused" | "budgetLimited" | "complete";
93
+ readonly tokensUsed: number;
94
+ readonly tokenBudget: number | null;
95
+ readonly timeUsedSeconds: number;
96
+ readonly createdAt: string;
97
+ readonly updatedAt: string;
98
+ } | null;
90
99
  readonly latestUserMessageAt: string | null;
91
100
  readonly hasPendingApprovals: boolean;
92
101
  readonly hasPendingUserInput: boolean;
@@ -125,6 +134,15 @@ export declare const makeThreadApplication: () => Effect.Effect<{
125
134
  readonly updatedAt: string;
126
135
  readonly archivedAt: string | null;
127
136
  readonly deletedAt: string | null;
137
+ readonly goal: {
138
+ readonly objective: string;
139
+ readonly status: "active" | "paused" | "budgetLimited" | "complete";
140
+ readonly tokensUsed: number;
141
+ readonly tokenBudget: number | null;
142
+ readonly timeUsedSeconds: number;
143
+ readonly createdAt: string;
144
+ readonly updatedAt: string;
145
+ } | null;
128
146
  readonly messages: readonly {
129
147
  readonly id: string & import("effect/Brand").Brand<"MessageId">;
130
148
  readonly role: "user" | "assistant" | "system";
@@ -230,6 +248,15 @@ export declare const makeThreadApplication: () => Effect.Effect<{
230
248
  readonly updatedAt: string;
231
249
  readonly archivedAt: string | null;
232
250
  readonly deletedAt: string | null;
251
+ readonly goal: {
252
+ readonly objective: string;
253
+ readonly status: "active" | "paused" | "budgetLimited" | "complete";
254
+ readonly tokensUsed: number;
255
+ readonly tokenBudget: number | null;
256
+ readonly timeUsedSeconds: number;
257
+ readonly createdAt: string;
258
+ readonly updatedAt: string;
259
+ } | null;
233
260
  readonly messages: readonly {
234
261
  readonly id: string & import("effect/Brand").Brand<"MessageId">;
235
262
  readonly role: "user" | "assistant" | "system";
@@ -406,6 +433,15 @@ export declare const makeThreadApplication: () => Effect.Effect<{
406
433
  readonly updatedAt: string;
407
434
  readonly archivedAt: string | null;
408
435
  readonly deletedAt: string | null;
436
+ readonly goal: {
437
+ readonly objective: string;
438
+ readonly status: "active" | "paused" | "budgetLimited" | "complete";
439
+ readonly tokensUsed: number;
440
+ readonly tokenBudget: number | null;
441
+ readonly timeUsedSeconds: number;
442
+ readonly createdAt: string;
443
+ readonly updatedAt: string;
444
+ } | null;
409
445
  readonly messages: readonly {
410
446
  readonly id: string & import("effect/Brand").Brand<"MessageId">;
411
447
  readonly role: "user" | "assistant" | "system";
@@ -500,6 +536,15 @@ export declare const makeThreadApplication: () => Effect.Effect<{
500
536
  readonly updatedAt: string;
501
537
  readonly archivedAt: string | null;
502
538
  readonly deletedAt: string | null;
539
+ readonly goal: {
540
+ readonly objective: string;
541
+ readonly status: "active" | "paused" | "budgetLimited" | "complete";
542
+ readonly tokensUsed: number;
543
+ readonly tokenBudget: number | null;
544
+ readonly timeUsedSeconds: number;
545
+ readonly createdAt: string;
546
+ readonly updatedAt: string;
547
+ } | null;
503
548
  readonly messages: readonly {
504
549
  readonly id: string & import("effect/Brand").Brand<"MessageId">;
505
550
  readonly role: "user" | "assistant" | "system";
@@ -560,4 +605,10 @@ export declare const makeThreadApplication: () => Effect.Effect<{
560
605
  readonly providerInstanceId?: (string & import("effect/Brand").Brand<"ProviderInstanceId">) | undefined;
561
606
  } | null;
562
607
  }, ThreadSessionError | import("../rpc/error.ts").RpcError, never>;
608
+ callbackThread: (input: CallbackThreadInput) => Effect.Effect<{
609
+ dispatch: {
610
+ readonly sequence: number;
611
+ };
612
+ targetThreadId: string;
613
+ }, ThreadSessionError | import("../rpc/error.ts").RpcError, never>;
563
614
  }, never, T3Orchestration | Environment | Path.Path | Crypto.Crypto>;
@@ -0,0 +1,3 @@
1
+ import * as Layer from "effect/Layer";
2
+ import { CliPath } from "./service.ts";
3
+ export declare const NodeCliPathLayer: Layer.Layer<CliPath, never, never>;
@@ -0,0 +1,8 @@
1
+ import * as Context from "effect/Context";
2
+ export type CliPathShape = {
3
+ readonly path: string;
4
+ };
5
+ declare const CliPath_base: Context.ServiceClass<CliPath, "t3cli/CliPath", CliPathShape>;
6
+ export declare class CliPath extends CliPath_base {
7
+ }
8
+ export {};
@@ -83,6 +83,15 @@ export declare const resolveProjectScope: (snapshot: {
83
83
  readonly updatedAt: string;
84
84
  readonly providerInstanceId?: (string & import("effect/Brand").Brand<"ProviderInstanceId">) | undefined;
85
85
  } | null;
86
+ readonly goal: {
87
+ readonly objective: string;
88
+ readonly status: "active" | "paused" | "budgetLimited" | "complete";
89
+ readonly tokensUsed: number;
90
+ readonly tokenBudget: number | null;
91
+ readonly timeUsedSeconds: number;
92
+ readonly createdAt: string;
93
+ readonly updatedAt: string;
94
+ } | null;
86
95
  readonly latestUserMessageAt: string | null;
87
96
  readonly hasPendingApprovals: boolean;
88
97
  readonly hasPendingUserInput: boolean;
@@ -91,7 +100,6 @@ export declare const resolveProjectScope: (snapshot: {
91
100
  readonly updatedAt: string;
92
101
  }, input: {
93
102
  readonly ref: string;
94
- readonly cwd: string;
95
103
  }) => Effect.Effect<{
96
104
  project: {
97
105
  readonly id: string & import("effect/Brand").Brand<"ProjectId">;
@@ -128,7 +136,7 @@ export declare const resolveProjectScope: (snapshot: {
128
136
  readonly name?: string;
129
137
  } | null | undefined;
130
138
  };
131
- inferredWorktreePath?: never;
139
+ inferredWorktreePath: string;
132
140
  } | {
133
141
  project: {
134
142
  readonly id: string & import("effect/Brand").Brand<"ProjectId">;
@@ -165,6 +173,6 @@ export declare const resolveProjectScope: (snapshot: {
165
173
  readonly name?: string;
166
174
  } | null | undefined;
167
175
  };
168
- inferredWorktreePath: string;
176
+ inferredWorktreePath?: never;
169
177
  } | undefined, never, Path.Path>;
170
178
  export declare function findProjectById(snapshot: OrchestrationShellSnapshot, projectId: string): OrchestrationProjectShell | null;
@@ -66,6 +66,7 @@ export declare function firstSelectableProvider(providers: ReadonlyArray<ServerP
66
66
  readonly groupKey: string;
67
67
  } | undefined;
68
68
  readonly showInteractionModeToggle?: boolean | undefined;
69
+ readonly requiresNewThreadForModelChange?: boolean | undefined;
69
70
  readonly message?: string | undefined;
70
71
  readonly availability?: "available" | "unavailable" | undefined;
71
72
  readonly unavailableReason?: string | undefined;
@@ -181,6 +182,7 @@ export declare function findSelectableProvider(providers: ReadonlyArray<ServerPr
181
182
  readonly groupKey: string;
182
183
  } | undefined;
183
184
  readonly showInteractionModeToggle?: boolean | undefined;
185
+ readonly requiresNewThreadForModelChange?: boolean | undefined;
184
186
  readonly message?: string | undefined;
185
187
  readonly availability?: "available" | "unavailable" | undefined;
186
188
  readonly unavailableReason?: string | undefined;
@@ -271,6 +273,7 @@ export declare function filterProvidersForModelListing(input: {
271
273
  readonly groupKey: string;
272
274
  } | undefined;
273
275
  readonly showInteractionModeToggle?: boolean | undefined;
276
+ readonly requiresNewThreadForModelChange?: boolean | undefined;
274
277
  readonly message?: string | undefined;
275
278
  readonly availability?: "available" | "unavailable" | undefined;
276
279
  readonly unavailableReason?: string | undefined;
@@ -50,6 +50,15 @@ export declare function applyThreadEvent(current: OrchestrationThread, event: Or
50
50
  readonly updatedAt: string;
51
51
  readonly archivedAt: string | null;
52
52
  readonly deletedAt: string | null;
53
+ readonly goal: {
54
+ readonly objective: string;
55
+ readonly status: "active" | "paused" | "budgetLimited" | "complete";
56
+ readonly tokensUsed: number;
57
+ readonly tokenBudget: number | null;
58
+ readonly timeUsedSeconds: number;
59
+ readonly createdAt: string;
60
+ readonly updatedAt: string;
61
+ } | null;
53
62
  readonly messages: readonly {
54
63
  readonly id: string & import("effect/Brand").Brand<"MessageId">;
55
64
  readonly role: "user" | "assistant" | "system";
@@ -138,6 +138,20 @@ export declare const makeT3Orchestration: () => Effect.Effect<{
138
138
  readonly commandId: string & import("effect/Brand").Brand<"CommandId">;
139
139
  readonly threadId: string & import("effect/Brand").Brand<"ThreadId">;
140
140
  readonly createdAt: string;
141
+ } | {
142
+ readonly type: "thread.goal.request";
143
+ readonly commandId: string & import("effect/Brand").Brand<"CommandId">;
144
+ readonly threadId: string & import("effect/Brand").Brand<"ThreadId">;
145
+ readonly request: {
146
+ readonly kind: "status";
147
+ } | {
148
+ readonly kind: "control";
149
+ readonly action: "pause" | "resume" | "clear";
150
+ } | {
151
+ readonly kind: "set";
152
+ readonly objective: string;
153
+ };
154
+ readonly createdAt: string;
141
155
  } | {
142
156
  readonly type: "thread.turn.start";
143
157
  readonly commandId: string & import("effect/Brand").Brand<"CommandId">;
@@ -319,6 +333,7 @@ export declare const makeT3Orchestration: () => Effect.Effect<{
319
333
  readonly groupKey: string;
320
334
  } | undefined;
321
335
  readonly showInteractionModeToggle?: boolean | undefined;
336
+ readonly requiresNewThreadForModelChange?: boolean | undefined;
322
337
  readonly message?: string | undefined;
323
338
  readonly availability?: "available" | "unavailable" | undefined;
324
339
  readonly unavailableReason?: string | undefined;
@@ -382,6 +397,11 @@ export declare const makeT3Orchestration: () => Effect.Effect<{
382
397
  readonly apiEndpoint: string;
383
398
  readonly customModels: readonly string[];
384
399
  };
400
+ readonly grok: {
401
+ readonly enabled: boolean;
402
+ readonly binaryPath: string;
403
+ readonly customModels: readonly string[];
404
+ };
385
405
  readonly opencode: {
386
406
  readonly enabled: boolean;
387
407
  readonly binaryPath: string;
@@ -477,6 +497,7 @@ export declare const makeT3Orchestration: () => Effect.Effect<{
477
497
  readonly groupKey: string;
478
498
  } | undefined;
479
499
  readonly showInteractionModeToggle?: boolean | undefined;
500
+ readonly requiresNewThreadForModelChange?: boolean | undefined;
480
501
  readonly message?: string | undefined;
481
502
  readonly availability?: "available" | "unavailable" | undefined;
482
503
  readonly unavailableReason?: string | undefined;
@@ -576,6 +597,15 @@ export declare const makeT3Orchestration: () => Effect.Effect<{
576
597
  readonly updatedAt: string;
577
598
  readonly providerInstanceId?: (string & import("effect/Brand").Brand<"ProviderInstanceId">) | undefined;
578
599
  } | null;
600
+ readonly goal: {
601
+ readonly objective: string;
602
+ readonly status: "active" | "paused" | "budgetLimited" | "complete";
603
+ readonly tokensUsed: number;
604
+ readonly tokenBudget: number | null;
605
+ readonly timeUsedSeconds: number;
606
+ readonly createdAt: string;
607
+ readonly updatedAt: string;
608
+ } | null;
579
609
  readonly latestUserMessageAt: string | null;
580
610
  readonly hasPendingApprovals: boolean;
581
611
  readonly hasPendingUserInput: boolean;
@@ -615,6 +645,15 @@ export declare const makeT3Orchestration: () => Effect.Effect<{
615
645
  readonly updatedAt: string;
616
646
  readonly archivedAt: string | null;
617
647
  readonly deletedAt: string | null;
648
+ readonly goal: {
649
+ readonly objective: string;
650
+ readonly status: "active" | "paused" | "budgetLimited" | "complete";
651
+ readonly tokensUsed: number;
652
+ readonly tokenBudget: number | null;
653
+ readonly timeUsedSeconds: number;
654
+ readonly createdAt: string;
655
+ readonly updatedAt: string;
656
+ } | null;
618
657
  readonly messages: readonly {
619
658
  readonly id: string & import("effect/Brand").Brand<"MessageId">;
620
659
  readonly role: "user" | "assistant" | "system";
@@ -712,6 +751,15 @@ export declare const makeT3Orchestration: () => Effect.Effect<{
712
751
  readonly updatedAt: string;
713
752
  readonly archivedAt: string | null;
714
753
  readonly deletedAt: string | null;
754
+ readonly goal: {
755
+ readonly objective: string;
756
+ readonly status: "active" | "paused" | "budgetLimited" | "complete";
757
+ readonly tokensUsed: number;
758
+ readonly tokenBudget: number | null;
759
+ readonly timeUsedSeconds: number;
760
+ readonly createdAt: string;
761
+ readonly updatedAt: string;
762
+ } | null;
715
763
  readonly messages: readonly {
716
764
  readonly id: string & import("effect/Brand").Brand<"MessageId">;
717
765
  readonly role: "user" | "assistant" | "system";
@@ -1310,6 +1358,85 @@ export declare const makeT3Orchestration: () => Effect.Effect<{
1310
1358
  readonly requestId?: (string & import("effect/Brand").Brand<"ApprovalRequestId">) | undefined;
1311
1359
  readonly ingestedAt?: string | undefined;
1312
1360
  };
1361
+ } | {
1362
+ readonly type: "thread.goal-requested";
1363
+ readonly payload: {
1364
+ readonly threadId: string & import("effect/Brand").Brand<"ThreadId">;
1365
+ readonly request: {
1366
+ readonly kind: "status";
1367
+ } | {
1368
+ readonly kind: "control";
1369
+ readonly action: "pause" | "resume" | "clear";
1370
+ } | {
1371
+ readonly kind: "set";
1372
+ readonly objective: string;
1373
+ };
1374
+ readonly createdAt: string;
1375
+ };
1376
+ readonly sequence: number;
1377
+ readonly eventId: string & import("effect/Brand").Brand<"EventId">;
1378
+ readonly aggregateKind: "project" | "thread";
1379
+ readonly aggregateId: (string & import("effect/Brand").Brand<"ThreadId">) | (string & import("effect/Brand").Brand<"ProjectId">);
1380
+ readonly occurredAt: string;
1381
+ readonly commandId: (string & import("effect/Brand").Brand<"CommandId">) | null;
1382
+ readonly causationEventId: (string & import("effect/Brand").Brand<"EventId">) | null;
1383
+ readonly correlationId: (string & import("effect/Brand").Brand<"CommandId">) | null;
1384
+ readonly metadata: {
1385
+ readonly providerTurnId?: string | undefined;
1386
+ readonly providerItemId?: (string & import("effect/Brand").Brand<"ProviderItemId">) | undefined;
1387
+ readonly adapterKey?: string | undefined;
1388
+ readonly requestId?: (string & import("effect/Brand").Brand<"ApprovalRequestId">) | undefined;
1389
+ readonly ingestedAt?: string | undefined;
1390
+ };
1391
+ } | {
1392
+ readonly type: "thread.goal-updated";
1393
+ readonly payload: {
1394
+ readonly threadId: string & import("effect/Brand").Brand<"ThreadId">;
1395
+ readonly goal: {
1396
+ readonly objective: string;
1397
+ readonly status: "active" | "paused" | "budgetLimited" | "complete";
1398
+ readonly tokensUsed: number;
1399
+ readonly tokenBudget: number | null;
1400
+ readonly timeUsedSeconds: number;
1401
+ readonly createdAt: string;
1402
+ readonly updatedAt: string;
1403
+ };
1404
+ };
1405
+ readonly sequence: number;
1406
+ readonly eventId: string & import("effect/Brand").Brand<"EventId">;
1407
+ readonly aggregateKind: "project" | "thread";
1408
+ readonly aggregateId: (string & import("effect/Brand").Brand<"ThreadId">) | (string & import("effect/Brand").Brand<"ProjectId">);
1409
+ readonly occurredAt: string;
1410
+ readonly commandId: (string & import("effect/Brand").Brand<"CommandId">) | null;
1411
+ readonly causationEventId: (string & import("effect/Brand").Brand<"EventId">) | null;
1412
+ readonly correlationId: (string & import("effect/Brand").Brand<"CommandId">) | null;
1413
+ readonly metadata: {
1414
+ readonly providerTurnId?: string | undefined;
1415
+ readonly providerItemId?: (string & import("effect/Brand").Brand<"ProviderItemId">) | undefined;
1416
+ readonly adapterKey?: string | undefined;
1417
+ readonly requestId?: (string & import("effect/Brand").Brand<"ApprovalRequestId">) | undefined;
1418
+ readonly ingestedAt?: string | undefined;
1419
+ };
1420
+ } | {
1421
+ readonly type: "thread.goal-cleared";
1422
+ readonly payload: {
1423
+ readonly threadId: string & import("effect/Brand").Brand<"ThreadId">;
1424
+ };
1425
+ readonly sequence: number;
1426
+ readonly eventId: string & import("effect/Brand").Brand<"EventId">;
1427
+ readonly aggregateKind: "project" | "thread";
1428
+ readonly aggregateId: (string & import("effect/Brand").Brand<"ThreadId">) | (string & import("effect/Brand").Brand<"ProjectId">);
1429
+ readonly occurredAt: string;
1430
+ readonly commandId: (string & import("effect/Brand").Brand<"CommandId">) | null;
1431
+ readonly causationEventId: (string & import("effect/Brand").Brand<"EventId">) | null;
1432
+ readonly correlationId: (string & import("effect/Brand").Brand<"CommandId">) | null;
1433
+ readonly metadata: {
1434
+ readonly providerTurnId?: string | undefined;
1435
+ readonly providerItemId?: (string & import("effect/Brand").Brand<"ProviderItemId">) | undefined;
1436
+ readonly adapterKey?: string | undefined;
1437
+ readonly requestId?: (string & import("effect/Brand").Brand<"ApprovalRequestId">) | undefined;
1438
+ readonly ingestedAt?: string | undefined;
1439
+ };
1313
1440
  } | {
1314
1441
  readonly type: "thread.proposed-plan-upserted";
1315
1442
  readonly payload: {
@@ -1436,6 +1563,15 @@ export declare const makeT3Orchestration: () => Effect.Effect<{
1436
1563
  readonly updatedAt: string;
1437
1564
  readonly archivedAt: string | null;
1438
1565
  readonly deletedAt: string | null;
1566
+ readonly goal: {
1567
+ readonly objective: string;
1568
+ readonly status: "active" | "paused" | "budgetLimited" | "complete";
1569
+ readonly tokensUsed: number;
1570
+ readonly tokenBudget: number | null;
1571
+ readonly timeUsedSeconds: number;
1572
+ readonly createdAt: string;
1573
+ readonly updatedAt: string;
1574
+ } | null;
1439
1575
  readonly messages: readonly {
1440
1576
  readonly id: string & import("effect/Brand").Brand<"MessageId">;
1441
1577
  readonly role: "user" | "assistant" | "system";
@@ -2031,6 +2167,85 @@ export declare const makeT3Orchestration: () => Effect.Effect<{
2031
2167
  readonly requestId?: (string & import("effect/Brand").Brand<"ApprovalRequestId">) | undefined;
2032
2168
  readonly ingestedAt?: string | undefined;
2033
2169
  };
2170
+ } | {
2171
+ readonly type: "thread.goal-requested";
2172
+ readonly payload: {
2173
+ readonly threadId: string & import("effect/Brand").Brand<"ThreadId">;
2174
+ readonly request: {
2175
+ readonly kind: "status";
2176
+ } | {
2177
+ readonly kind: "control";
2178
+ readonly action: "pause" | "resume" | "clear";
2179
+ } | {
2180
+ readonly kind: "set";
2181
+ readonly objective: string;
2182
+ };
2183
+ readonly createdAt: string;
2184
+ };
2185
+ readonly sequence: number;
2186
+ readonly eventId: string & import("effect/Brand").Brand<"EventId">;
2187
+ readonly aggregateKind: "project" | "thread";
2188
+ readonly aggregateId: (string & import("effect/Brand").Brand<"ThreadId">) | (string & import("effect/Brand").Brand<"ProjectId">);
2189
+ readonly occurredAt: string;
2190
+ readonly commandId: (string & import("effect/Brand").Brand<"CommandId">) | null;
2191
+ readonly causationEventId: (string & import("effect/Brand").Brand<"EventId">) | null;
2192
+ readonly correlationId: (string & import("effect/Brand").Brand<"CommandId">) | null;
2193
+ readonly metadata: {
2194
+ readonly providerTurnId?: string | undefined;
2195
+ readonly providerItemId?: (string & import("effect/Brand").Brand<"ProviderItemId">) | undefined;
2196
+ readonly adapterKey?: string | undefined;
2197
+ readonly requestId?: (string & import("effect/Brand").Brand<"ApprovalRequestId">) | undefined;
2198
+ readonly ingestedAt?: string | undefined;
2199
+ };
2200
+ } | {
2201
+ readonly type: "thread.goal-updated";
2202
+ readonly payload: {
2203
+ readonly threadId: string & import("effect/Brand").Brand<"ThreadId">;
2204
+ readonly goal: {
2205
+ readonly objective: string;
2206
+ readonly status: "active" | "paused" | "budgetLimited" | "complete";
2207
+ readonly tokensUsed: number;
2208
+ readonly tokenBudget: number | null;
2209
+ readonly timeUsedSeconds: number;
2210
+ readonly createdAt: string;
2211
+ readonly updatedAt: string;
2212
+ };
2213
+ };
2214
+ readonly sequence: number;
2215
+ readonly eventId: string & import("effect/Brand").Brand<"EventId">;
2216
+ readonly aggregateKind: "project" | "thread";
2217
+ readonly aggregateId: (string & import("effect/Brand").Brand<"ThreadId">) | (string & import("effect/Brand").Brand<"ProjectId">);
2218
+ readonly occurredAt: string;
2219
+ readonly commandId: (string & import("effect/Brand").Brand<"CommandId">) | null;
2220
+ readonly causationEventId: (string & import("effect/Brand").Brand<"EventId">) | null;
2221
+ readonly correlationId: (string & import("effect/Brand").Brand<"CommandId">) | null;
2222
+ readonly metadata: {
2223
+ readonly providerTurnId?: string | undefined;
2224
+ readonly providerItemId?: (string & import("effect/Brand").Brand<"ProviderItemId">) | undefined;
2225
+ readonly adapterKey?: string | undefined;
2226
+ readonly requestId?: (string & import("effect/Brand").Brand<"ApprovalRequestId">) | undefined;
2227
+ readonly ingestedAt?: string | undefined;
2228
+ };
2229
+ } | {
2230
+ readonly type: "thread.goal-cleared";
2231
+ readonly payload: {
2232
+ readonly threadId: string & import("effect/Brand").Brand<"ThreadId">;
2233
+ };
2234
+ readonly sequence: number;
2235
+ readonly eventId: string & import("effect/Brand").Brand<"EventId">;
2236
+ readonly aggregateKind: "project" | "thread";
2237
+ readonly aggregateId: (string & import("effect/Brand").Brand<"ThreadId">) | (string & import("effect/Brand").Brand<"ProjectId">);
2238
+ readonly occurredAt: string;
2239
+ readonly commandId: (string & import("effect/Brand").Brand<"CommandId">) | null;
2240
+ readonly causationEventId: (string & import("effect/Brand").Brand<"EventId">) | null;
2241
+ readonly correlationId: (string & import("effect/Brand").Brand<"CommandId">) | null;
2242
+ readonly metadata: {
2243
+ readonly providerTurnId?: string | undefined;
2244
+ readonly providerItemId?: (string & import("effect/Brand").Brand<"ProviderItemId">) | undefined;
2245
+ readonly adapterKey?: string | undefined;
2246
+ readonly requestId?: (string & import("effect/Brand").Brand<"ApprovalRequestId">) | undefined;
2247
+ readonly ingestedAt?: string | undefined;
2248
+ };
2034
2249
  } | {
2035
2250
  readonly type: "thread.proposed-plan-upserted";
2036
2251
  readonly payload: {