t3code-cli 0.7.0 → 0.9.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 (82) hide show
  1. package/README.md +90 -35
  2. package/dist/application.js +1 -1
  3. package/dist/auth.js +1 -2
  4. package/dist/bin.js +241 -45
  5. package/dist/cli.js +1 -1
  6. package/dist/config.js +1 -3
  7. package/dist/connection.js +1 -4
  8. package/dist/index.js +1 -4
  9. package/dist/layout.js +1 -1
  10. package/dist/orchestration.js +1 -1
  11. package/dist/rpc.js +1 -1
  12. package/dist/runtime.js +1 -2
  13. package/dist/scope.js +1 -1
  14. package/dist/shared.js +85492 -0
  15. package/dist/src/application/layer.d.ts +86 -2
  16. package/dist/src/application/models.d.ts +1 -0
  17. package/dist/src/application/projects.d.ts +10 -1
  18. package/dist/src/application/service.d.ts +30 -1
  19. package/dist/src/application/shell-sequence.d.ts +9 -0
  20. package/dist/src/application/thread-commands.d.ts +27 -1
  21. package/dist/src/application/thread-wait.d.ts +9 -0
  22. package/dist/src/application/threads.d.ts +102 -2
  23. package/dist/src/cli-path/layer.d.ts +3 -0
  24. package/dist/src/cli-path/service.d.ts +8 -0
  25. package/dist/src/domain/helpers.d.ts +9 -0
  26. package/dist/src/domain/model-config.d.ts +3 -0
  27. package/dist/src/domain/thread-activities.d.ts +14 -0
  28. package/dist/src/domain/thread-lifecycle.d.ts +10 -0
  29. package/dist/src/orchestration/layer.d.ts +215 -0
  30. package/dist/src/rpc/layer.d.ts +466 -0
  31. package/dist/src/rpc/ws-group.d.ts +142 -0
  32. package/dist/src/runtime/layer.d.ts +1 -1
  33. package/dist/t3tools.js +2 -2
  34. package/dist/upstream-t3code/packages/contracts/src/environmentHttp.d.ts +33 -10
  35. package/dist/upstream-t3code/packages/contracts/src/ipc.d.ts +6 -0
  36. package/dist/upstream-t3code/packages/contracts/src/orchestration.d.ts +657 -1
  37. package/dist/upstream-t3code/packages/contracts/src/provider.d.ts +14 -0
  38. package/dist/upstream-t3code/packages/contracts/src/providerRuntime.d.ts +175 -1
  39. package/dist/upstream-t3code/packages/contracts/src/rpc.d.ts +492 -0
  40. package/dist/upstream-t3code/packages/contracts/src/server.d.ts +45 -0
  41. package/dist/upstream-t3code/packages/contracts/src/settings.d.ts +21 -0
  42. package/dist/upstream-t3code/packages/contracts/src/terminal.d.ts +6 -3
  43. package/package.json +2 -2
  44. package/src/application/service.ts +32 -0
  45. package/src/application/thread-commands.ts +45 -0
  46. package/src/application/threads.ts +100 -1
  47. package/src/cli/error.ts +15 -0
  48. package/src/cli/message-input.ts +30 -0
  49. package/src/cli/thread-format.ts +47 -0
  50. package/src/cli/thread.ts +8 -0
  51. package/src/cli/threads/approve.ts +61 -0
  52. package/src/cli/threads/archive.ts +18 -3
  53. package/src/cli/threads/callback.ts +92 -0
  54. package/src/cli/threads/respond.ts +70 -0
  55. package/src/cli/threads/show.ts +43 -0
  56. package/src/cli-path/layer.ts +10 -0
  57. package/src/cli-path/service.ts +7 -0
  58. package/src/domain/thread-activities.test.ts +321 -0
  59. package/src/domain/thread-activities.ts +244 -0
  60. package/src/domain/thread-lifecycle.ts +2 -0
  61. package/src/runtime/layer.ts +2 -0
  62. package/dist/Context-DueQ9iMH.js +0 -4916
  63. package/dist/Path-D8WPdPwR.js +0 -11406
  64. package/dist/Schema-DsQxYh6_.js +0 -13581
  65. package/dist/UrlParams-BA6gBvaY.js +0 -205
  66. package/dist/base-dir-R12OMDso.js +0 -20
  67. package/dist/error-B2t1bAP9.js +0 -169
  68. package/dist/error-BHRnjLux.js +0 -15
  69. package/dist/error-jwMt3VoW.js +0 -54
  70. package/dist/flags-CM7_iGdA.js +0 -13371
  71. package/dist/layer-CfC5qZol.js +0 -1508
  72. package/dist/layer-DHhKS5jd.js +0 -13
  73. package/dist/layer-DUv99vsS.js +0 -72
  74. package/dist/layer-DvHnKBYj.js +0 -29466
  75. package/dist/layer-MqCKkIGD.js +0 -1206
  76. package/dist/scope-GycYiJ54.js +0 -29
  77. package/dist/service-CLmRO2Dp.js +0 -8
  78. package/dist/service-ybOWV9pL.js +0 -5
  79. package/dist/src-KdbHqrex.js +0 -8874
  80. package/dist/transport-D3zBdZ1h.js +0 -539
  81. package/dist/url-SlsaG8nY.js +0 -165
  82. /package/dist/{chunk-B5meny8j.js → rolldown-runtime.js} +0 -0
@@ -2,6 +2,17 @@ import * as Effect from "effect/Effect";
2
2
  import * as Layer from "effect/Layer";
3
3
  import { T3Application } from "./service.ts";
4
4
  export declare const makeT3Application: () => Effect.Effect<{
5
+ approveThread: (input: {
6
+ readonly threadId: string;
7
+ readonly requestId: string;
8
+ readonly decision: import("#t3tools/contracts").ProviderApprovalDecision;
9
+ }) => Effect.Effect<{
10
+ threadId: string;
11
+ requestId: string;
12
+ dispatch: {
13
+ readonly sequence: number;
14
+ };
15
+ }, import("../rpc/error.ts").RpcError, never>;
5
16
  archiveThread: (threadId: string) => Effect.Effect<{
6
17
  readonly sequence: number;
7
18
  }, import("../rpc/error.ts").RpcError, never>;
@@ -82,6 +93,15 @@ export declare const makeT3Application: () => Effect.Effect<{
82
93
  readonly updatedAt: string;
83
94
  readonly providerInstanceId?: (string & import("effect/Brand").Brand<"ProviderInstanceId">) | undefined;
84
95
  } | null;
96
+ readonly goal: {
97
+ readonly objective: string;
98
+ readonly status: "active" | "paused" | "budgetLimited" | "complete";
99
+ readonly tokensUsed: number;
100
+ readonly tokenBudget: number | null;
101
+ readonly timeUsedSeconds: number;
102
+ readonly createdAt: string;
103
+ readonly updatedAt: string;
104
+ } | null;
85
105
  readonly latestUserMessageAt: string | null;
86
106
  readonly hasPendingApprovals: boolean;
87
107
  readonly hasPendingUserInput: boolean;
@@ -120,6 +140,15 @@ export declare const makeT3Application: () => Effect.Effect<{
120
140
  readonly updatedAt: string;
121
141
  readonly archivedAt: string | null;
122
142
  readonly deletedAt: string | null;
143
+ readonly goal: {
144
+ readonly objective: string;
145
+ readonly status: "active" | "paused" | "budgetLimited" | "complete";
146
+ readonly tokensUsed: number;
147
+ readonly tokenBudget: number | null;
148
+ readonly timeUsedSeconds: number;
149
+ readonly createdAt: string;
150
+ readonly updatedAt: string;
151
+ } | null;
123
152
  readonly messages: readonly {
124
153
  readonly id: string & import("effect/Brand").Brand<"MessageId">;
125
154
  readonly role: "user" | "assistant" | "system";
@@ -180,6 +209,17 @@ export declare const makeT3Application: () => Effect.Effect<{
180
209
  readonly providerInstanceId?: (string & import("effect/Brand").Brand<"ProviderInstanceId">) | undefined;
181
210
  } | null;
182
211
  }, import("../rpc/error.ts").RpcError, never>;
212
+ respondToThread: (input: {
213
+ readonly threadId: string;
214
+ readonly requestId: string;
215
+ readonly answers: import("#t3tools/contracts").ProviderUserInputAnswers;
216
+ }) => Effect.Effect<{
217
+ threadId: string;
218
+ requestId: string;
219
+ dispatch: {
220
+ readonly sequence: number;
221
+ };
222
+ }, import("../rpc/error.ts").RpcError, never>;
183
223
  sendThread: (input: import("./service.ts").SendThreadInput, policy?: {
184
224
  readonly until: "dispatch" | "visible" | "complete";
185
225
  } | undefined) => Effect.Effect<{
@@ -225,6 +265,15 @@ export declare const makeT3Application: () => Effect.Effect<{
225
265
  readonly updatedAt: string;
226
266
  readonly archivedAt: string | null;
227
267
  readonly deletedAt: string | null;
268
+ readonly goal: {
269
+ readonly objective: string;
270
+ readonly status: "active" | "paused" | "budgetLimited" | "complete";
271
+ readonly tokensUsed: number;
272
+ readonly tokenBudget: number | null;
273
+ readonly timeUsedSeconds: number;
274
+ readonly createdAt: string;
275
+ readonly updatedAt: string;
276
+ } | null;
228
277
  readonly messages: readonly {
229
278
  readonly id: string & import("effect/Brand").Brand<"MessageId">;
230
279
  readonly role: "user" | "assistant" | "system";
@@ -286,6 +335,7 @@ export declare const makeT3Application: () => Effect.Effect<{
286
335
  } | null;
287
336
  };
288
337
  }, import("../domain/error.ts").ThreadSessionError | import("../rpc/error.ts").RpcError, never>;
338
+ showThread: (threadId: string) => Effect.Effect<import("./threads.ts").ThreadShow, import("../rpc/error.ts").RpcError, never>;
289
339
  startThread: (startInput: import("./service.ts").StartThreadInput, policy?: {
290
340
  readonly until: "dispatch" | "visible" | "complete";
291
341
  } | undefined) => Effect.Effect<{
@@ -401,6 +451,15 @@ export declare const makeT3Application: () => Effect.Effect<{
401
451
  readonly updatedAt: string;
402
452
  readonly archivedAt: string | null;
403
453
  readonly deletedAt: string | null;
454
+ readonly goal: {
455
+ readonly objective: string;
456
+ readonly status: "active" | "paused" | "budgetLimited" | "complete";
457
+ readonly tokensUsed: number;
458
+ readonly tokenBudget: number | null;
459
+ readonly timeUsedSeconds: number;
460
+ readonly createdAt: string;
461
+ readonly updatedAt: string;
462
+ } | null;
404
463
  readonly messages: readonly {
405
464
  readonly id: string & import("effect/Brand").Brand<"MessageId">;
406
465
  readonly role: "user" | "assistant" | "system";
@@ -495,6 +554,15 @@ export declare const makeT3Application: () => Effect.Effect<{
495
554
  readonly updatedAt: string;
496
555
  readonly archivedAt: string | null;
497
556
  readonly deletedAt: string | null;
557
+ readonly goal: {
558
+ readonly objective: string;
559
+ readonly status: "active" | "paused" | "budgetLimited" | "complete";
560
+ readonly tokensUsed: number;
561
+ readonly tokenBudget: number | null;
562
+ readonly timeUsedSeconds: number;
563
+ readonly createdAt: string;
564
+ readonly updatedAt: string;
565
+ } | null;
498
566
  readonly messages: readonly {
499
567
  readonly id: string & import("effect/Brand").Brand<"MessageId">;
500
568
  readonly role: "user" | "assistant" | "system";
@@ -555,6 +623,12 @@ export declare const makeT3Application: () => Effect.Effect<{
555
623
  readonly providerInstanceId?: (string & import("effect/Brand").Brand<"ProviderInstanceId">) | undefined;
556
624
  } | null;
557
625
  }, import("../domain/error.ts").ThreadSessionError | import("../rpc/error.ts").RpcError, never>;
626
+ callbackThread: (input: import("./service.ts").CallbackThreadInput) => Effect.Effect<{
627
+ dispatch: {
628
+ readonly sequence: number;
629
+ };
630
+ targetThreadId: string;
631
+ }, import("../domain/error.ts").ThreadSessionError | import("../rpc/error.ts").RpcError, never>;
558
632
  loadShell: () => Effect.Effect<{
559
633
  readonly snapshotSequence: number;
560
634
  readonly projects: readonly {
@@ -633,6 +707,15 @@ export declare const makeT3Application: () => Effect.Effect<{
633
707
  readonly updatedAt: string;
634
708
  readonly providerInstanceId?: (string & import("effect/Brand").Brand<"ProviderInstanceId">) | undefined;
635
709
  } | null;
710
+ readonly goal: {
711
+ readonly objective: string;
712
+ readonly status: "active" | "paused" | "budgetLimited" | "complete";
713
+ readonly tokensUsed: number;
714
+ readonly tokenBudget: number | null;
715
+ readonly timeUsedSeconds: number;
716
+ readonly createdAt: string;
717
+ readonly updatedAt: string;
718
+ } | null;
636
719
  readonly latestUserMessageAt: string | null;
637
720
  readonly hasPendingApprovals: boolean;
638
721
  readonly hasPendingUserInput: boolean;
@@ -752,6 +835,7 @@ export declare const makeT3Application: () => Effect.Effect<{
752
835
  readonly groupKey: string;
753
836
  } | undefined;
754
837
  readonly showInteractionModeToggle?: boolean | undefined;
838
+ readonly requiresNewThreadForModelChange?: boolean | undefined;
755
839
  readonly message?: string | undefined;
756
840
  readonly availability?: "available" | "unavailable" | undefined;
757
841
  readonly unavailableReason?: string | undefined;
@@ -772,5 +856,5 @@ export declare const makeT3Application: () => Effect.Effect<{
772
856
  readonly output: string | null;
773
857
  };
774
858
  }[], import("../rpc/error.ts").RpcError, never>;
775
- }, never, import("../orchestration/service.ts").T3Orchestration | import("../environment/service.ts").Environment | import("effect/Path").Path | import("effect/Crypto").Crypto>;
776
- export declare const T3ApplicationLive: Layer.Layer<T3Application, never, import("../orchestration/service.ts").T3Orchestration | import("../environment/service.ts").Environment | import("effect/Path").Path | import("effect/Crypto").Crypto>;
859
+ }, never, import("../environment/service.ts").Environment | import("../orchestration/service.ts").T3Orchestration | import("effect/Path").Path | import("effect/Crypto").Crypto>;
860
+ export declare const T3ApplicationLive: Layer.Layer<T3Application, never, import("../environment/service.ts").Environment | import("../orchestration/service.ts").T3Orchestration | import("effect/Path").Path | import("effect/Crypto").Crypto>;
@@ -70,6 +70,7 @@ export declare const makeModelsApplication: () => Effect.Effect<{
70
70
  readonly groupKey: string;
71
71
  } | undefined;
72
72
  readonly showInteractionModeToggle?: boolean | undefined;
73
+ readonly requiresNewThreadForModelChange?: boolean | undefined;
73
74
  readonly message?: string | undefined;
74
75
  readonly availability?: "available" | "unavailable" | undefined;
75
76
  readonly unavailableReason?: string | undefined;
@@ -83,6 +83,15 @@ export declare const makeProjectApplication: () => Effect.Effect<{
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;
@@ -133,4 +142,4 @@ export declare const makeProjectApplication: () => Effect.Effect<{
133
142
  } | null | undefined;
134
143
  };
135
144
  }, ProjectCreateVisibilityError | import("../rpc/error.ts").RpcError, never>;
136
- }, never, T3Orchestration | Environment | Path.Path | Crypto.Crypto>;
145
+ }, never, Environment | T3Orchestration | Path.Path | Crypto.Crypto>;
@@ -1,8 +1,9 @@
1
1
  import * as Context from "effect/Context";
2
2
  import type * as Effect from "effect/Effect";
3
3
  import type * as Stream from "effect/Stream";
4
- import type { DispatchResult, ModelSelection, OrchestrationMessage, OrchestrationProjectShell, OrchestrationShellSnapshot, OrchestrationThread, OrchestrationThreadShell, ServerProvider } from "#t3tools/contracts";
4
+ import type { DispatchResult, ModelSelection, OrchestrationMessage, OrchestrationProjectShell, OrchestrationShellSnapshot, OrchestrationThread, OrchestrationThreadShell, ProviderUserInputAnswers, ServerProvider } from "#t3tools/contracts";
5
5
  import type { ApplicationError } from "./error.ts";
6
+ import type { ThreadShow } from "./threads.ts";
6
7
  export type StartThreadInput = {
7
8
  readonly projectRef?: string;
8
9
  readonly message: string;
@@ -17,6 +18,11 @@ export type SendThreadInput = {
17
18
  readonly message: string;
18
19
  readonly options?: NonNullable<ModelSelection["options"]>;
19
20
  };
21
+ export type CallbackThreadInput = {
22
+ readonly fromThreadId: string;
23
+ readonly targetThreadId: string;
24
+ readonly prompt: string;
25
+ };
20
26
  export type StartThreadPolicy = {
21
27
  readonly until: "dispatch" | "visible" | "complete";
22
28
  };
@@ -52,6 +58,25 @@ declare const T3Application_base: Context.ServiceClass<T3Application, "t3cli/T3A
52
58
  readonly threads: ReadonlyArray<OrchestrationThreadShell>;
53
59
  }, ApplicationError>;
54
60
  readonly getThreadMessages: (threadId: string) => Effect.Effect<OrchestrationThread, ApplicationError>;
61
+ readonly showThread: (threadId: string) => Effect.Effect<ThreadShow, ApplicationError>;
62
+ readonly approveThread: (input: {
63
+ readonly threadId: string;
64
+ readonly requestId: string;
65
+ readonly decision: "accept" | "decline" | "cancel";
66
+ }) => Effect.Effect<{
67
+ readonly threadId: string;
68
+ readonly requestId: string;
69
+ readonly dispatch: DispatchResult;
70
+ }, ApplicationError>;
71
+ readonly respondToThread: (input: {
72
+ readonly threadId: string;
73
+ readonly requestId: string;
74
+ readonly answers: ProviderUserInputAnswers;
75
+ }) => Effect.Effect<{
76
+ readonly threadId: string;
77
+ readonly requestId: string;
78
+ readonly dispatch: DispatchResult;
79
+ }, ApplicationError>;
55
80
  readonly archiveThread: (threadId: string) => Effect.Effect<DispatchResult, ApplicationError>;
56
81
  readonly startThread: (input: StartThreadInput, policy?: StartThreadPolicy) => Effect.Effect<{
57
82
  readonly dispatch: DispatchResult;
@@ -66,6 +91,10 @@ declare const T3Application_base: Context.ServiceClass<T3Application, "t3cli/T3A
66
91
  }, ApplicationError>;
67
92
  readonly watchThread: (threadId: string) => Stream.Stream<WaitEvent, ApplicationError>;
68
93
  readonly waitForThread: (threadId: string) => Effect.Effect<OrchestrationThread, ApplicationError>;
94
+ readonly callbackThread: (input: CallbackThreadInput) => Effect.Effect<{
95
+ readonly dispatch: DispatchResult;
96
+ readonly targetThreadId: string;
97
+ }, ApplicationError>;
69
98
  }>;
70
99
  export declare class T3Application extends T3Application_base {
71
100
  }
@@ -82,6 +82,15 @@ export declare function waitForShellSequence(input: {
82
82
  readonly updatedAt: string;
83
83
  readonly providerInstanceId?: (string & import("effect/Brand").Brand<"ProviderInstanceId">) | undefined;
84
84
  } | null;
85
+ readonly goal: {
86
+ readonly objective: string;
87
+ readonly status: "active" | "paused" | "budgetLimited" | "complete";
88
+ readonly tokensUsed: number;
89
+ readonly tokenBudget: number | null;
90
+ readonly timeUsedSeconds: number;
91
+ readonly createdAt: string;
92
+ readonly updatedAt: string;
93
+ } | null;
85
94
  readonly latestUserMessageAt: string | null;
86
95
  readonly hasPendingApprovals: boolean;
87
96
  readonly hasPendingUserInput: boolean;
@@ -1,6 +1,6 @@
1
1
  import * as Crypto from "effect/Crypto";
2
2
  import * as Effect from "effect/Effect";
3
- import { type ModelSelection, type OrchestrationProjectShell } from "#t3tools/contracts";
3
+ import { type ModelSelection, type OrchestrationProjectShell, type ProviderApprovalDecision, type ProviderUserInputAnswers } from "#t3tools/contracts";
4
4
  import type { ServerConfigForCli } from "../orchestration/service.ts";
5
5
  import type { SendThreadInput, StartThreadInput } from "./service.ts";
6
6
  export declare const makeThreadStartCommands: (input: {
@@ -82,3 +82,29 @@ export declare const makeThreadArchiveCommand: (threadId: string) => Effect.Effe
82
82
  commandId: string & import("effect/Brand").Brand<"CommandId">;
83
83
  threadId: string & import("effect/Brand").Brand<"ThreadId">;
84
84
  }, never, Crypto.Crypto>;
85
+ export declare const makeThreadApprovalRespondCommand: (input: {
86
+ readonly threadId: string;
87
+ readonly requestId: string;
88
+ readonly decision: ProviderApprovalDecision;
89
+ }) => Effect.Effect<{
90
+ type: "thread.approval.respond";
91
+ commandId: string & import("effect/Brand").Brand<"CommandId">;
92
+ threadId: string & import("effect/Brand").Brand<"ThreadId">;
93
+ requestId: string & import("effect/Brand").Brand<"ApprovalRequestId">;
94
+ decision: "accept" | "acceptForSession" | "decline" | "cancel";
95
+ createdAt: string;
96
+ }, never, Crypto.Crypto>;
97
+ export declare const makeThreadUserInputRespondCommand: (input: {
98
+ readonly threadId: string;
99
+ readonly requestId: string;
100
+ readonly answers: ProviderUserInputAnswers;
101
+ }) => Effect.Effect<{
102
+ type: "thread.user-input.respond";
103
+ commandId: string & import("effect/Brand").Brand<"CommandId">;
104
+ threadId: string & import("effect/Brand").Brand<"ThreadId">;
105
+ requestId: string & import("effect/Brand").Brand<"ApprovalRequestId">;
106
+ answers: {
107
+ readonly [x: string]: unknown;
108
+ };
109
+ createdAt: string;
110
+ }, never, Crypto.Crypto>;
@@ -42,6 +42,15 @@ export declare function waitForThread(input: {
42
42
  readonly updatedAt: string;
43
43
  readonly archivedAt: string | null;
44
44
  readonly deletedAt: string | null;
45
+ readonly goal: {
46
+ readonly objective: string;
47
+ readonly status: "active" | "paused" | "budgetLimited" | "complete";
48
+ readonly tokensUsed: number;
49
+ readonly tokenBudget: number | null;
50
+ readonly timeUsedSeconds: number;
51
+ readonly createdAt: string;
52
+ readonly updatedAt: string;
53
+ } | null;
45
54
  readonly messages: readonly {
46
55
  readonly id: string & import("effect/Brand").Brand<"MessageId">;
47
56
  readonly role: "user" | "assistant" | "system";
@@ -5,8 +5,23 @@ 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
+ import { derivePendingApprovals, derivePendingUserInputs } from "../domain/thread-activities.ts";
10
+ import { type ThreadLifecycleStatus } from "../domain/thread-lifecycle.ts";
11
+ import type { OrchestrationThread } from "#t3tools/contracts";
12
+ import type { ProviderApprovalDecision, ProviderUserInputAnswers } from "#t3tools/contracts";
9
13
  export declare const makeThreadApplication: () => Effect.Effect<{
14
+ approveThread: (input: {
15
+ readonly threadId: string;
16
+ readonly requestId: string;
17
+ readonly decision: ProviderApprovalDecision;
18
+ }) => Effect.Effect<{
19
+ threadId: string;
20
+ requestId: string;
21
+ dispatch: {
22
+ readonly sequence: number;
23
+ };
24
+ }, import("../rpc/error.ts").RpcError, never>;
10
25
  archiveThread: (threadId: string) => Effect.Effect<{
11
26
  readonly sequence: number;
12
27
  }, import("../rpc/error.ts").RpcError, never>;
@@ -87,6 +102,15 @@ export declare const makeThreadApplication: () => Effect.Effect<{
87
102
  readonly updatedAt: string;
88
103
  readonly providerInstanceId?: (string & import("effect/Brand").Brand<"ProviderInstanceId">) | undefined;
89
104
  } | null;
105
+ readonly goal: {
106
+ readonly objective: string;
107
+ readonly status: "active" | "paused" | "budgetLimited" | "complete";
108
+ readonly tokensUsed: number;
109
+ readonly tokenBudget: number | null;
110
+ readonly timeUsedSeconds: number;
111
+ readonly createdAt: string;
112
+ readonly updatedAt: string;
113
+ } | null;
90
114
  readonly latestUserMessageAt: string | null;
91
115
  readonly hasPendingApprovals: boolean;
92
116
  readonly hasPendingUserInput: boolean;
@@ -125,6 +149,15 @@ export declare const makeThreadApplication: () => Effect.Effect<{
125
149
  readonly updatedAt: string;
126
150
  readonly archivedAt: string | null;
127
151
  readonly deletedAt: string | null;
152
+ readonly goal: {
153
+ readonly objective: string;
154
+ readonly status: "active" | "paused" | "budgetLimited" | "complete";
155
+ readonly tokensUsed: number;
156
+ readonly tokenBudget: number | null;
157
+ readonly timeUsedSeconds: number;
158
+ readonly createdAt: string;
159
+ readonly updatedAt: string;
160
+ } | null;
128
161
  readonly messages: readonly {
129
162
  readonly id: string & import("effect/Brand").Brand<"MessageId">;
130
163
  readonly role: "user" | "assistant" | "system";
@@ -185,6 +218,17 @@ export declare const makeThreadApplication: () => Effect.Effect<{
185
218
  readonly providerInstanceId?: (string & import("effect/Brand").Brand<"ProviderInstanceId">) | undefined;
186
219
  } | null;
187
220
  }, import("../rpc/error.ts").RpcError, never>;
221
+ respondToThread: (input: {
222
+ readonly threadId: string;
223
+ readonly requestId: string;
224
+ readonly answers: ProviderUserInputAnswers;
225
+ }) => Effect.Effect<{
226
+ threadId: string;
227
+ requestId: string;
228
+ dispatch: {
229
+ readonly sequence: number;
230
+ };
231
+ }, import("../rpc/error.ts").RpcError, never>;
188
232
  sendThread: (input: SendThreadInput, policy?: {
189
233
  readonly until: "dispatch" | "visible" | "complete";
190
234
  } | undefined) => Effect.Effect<{
@@ -230,6 +274,15 @@ export declare const makeThreadApplication: () => Effect.Effect<{
230
274
  readonly updatedAt: string;
231
275
  readonly archivedAt: string | null;
232
276
  readonly deletedAt: string | null;
277
+ readonly goal: {
278
+ readonly objective: string;
279
+ readonly status: "active" | "paused" | "budgetLimited" | "complete";
280
+ readonly tokensUsed: number;
281
+ readonly tokenBudget: number | null;
282
+ readonly timeUsedSeconds: number;
283
+ readonly createdAt: string;
284
+ readonly updatedAt: string;
285
+ } | null;
233
286
  readonly messages: readonly {
234
287
  readonly id: string & import("effect/Brand").Brand<"MessageId">;
235
288
  readonly role: "user" | "assistant" | "system";
@@ -291,6 +344,7 @@ export declare const makeThreadApplication: () => Effect.Effect<{
291
344
  } | null;
292
345
  };
293
346
  }, ThreadSessionError | import("../rpc/error.ts").RpcError, never>;
347
+ showThread: (threadId: string) => Effect.Effect<ThreadShow, import("../rpc/error.ts").RpcError, never>;
294
348
  startThread: (startInput: StartThreadInput, policy?: {
295
349
  readonly until: "dispatch" | "visible" | "complete";
296
350
  } | undefined) => Effect.Effect<{
@@ -406,6 +460,15 @@ export declare const makeThreadApplication: () => Effect.Effect<{
406
460
  readonly updatedAt: string;
407
461
  readonly archivedAt: string | null;
408
462
  readonly deletedAt: string | null;
463
+ readonly goal: {
464
+ readonly objective: string;
465
+ readonly status: "active" | "paused" | "budgetLimited" | "complete";
466
+ readonly tokensUsed: number;
467
+ readonly tokenBudget: number | null;
468
+ readonly timeUsedSeconds: number;
469
+ readonly createdAt: string;
470
+ readonly updatedAt: string;
471
+ } | null;
409
472
  readonly messages: readonly {
410
473
  readonly id: string & import("effect/Brand").Brand<"MessageId">;
411
474
  readonly role: "user" | "assistant" | "system";
@@ -500,6 +563,15 @@ export declare const makeThreadApplication: () => Effect.Effect<{
500
563
  readonly updatedAt: string;
501
564
  readonly archivedAt: string | null;
502
565
  readonly deletedAt: string | null;
566
+ readonly goal: {
567
+ readonly objective: string;
568
+ readonly status: "active" | "paused" | "budgetLimited" | "complete";
569
+ readonly tokensUsed: number;
570
+ readonly tokenBudget: number | null;
571
+ readonly timeUsedSeconds: number;
572
+ readonly createdAt: string;
573
+ readonly updatedAt: string;
574
+ } | null;
503
575
  readonly messages: readonly {
504
576
  readonly id: string & import("effect/Brand").Brand<"MessageId">;
505
577
  readonly role: "user" | "assistant" | "system";
@@ -560,4 +632,32 @@ export declare const makeThreadApplication: () => Effect.Effect<{
560
632
  readonly providerInstanceId?: (string & import("effect/Brand").Brand<"ProviderInstanceId">) | undefined;
561
633
  } | null;
562
634
  }, ThreadSessionError | import("../rpc/error.ts").RpcError, never>;
563
- }, never, T3Orchestration | Environment | Path.Path | Crypto.Crypto>;
635
+ callbackThread: (input: CallbackThreadInput) => Effect.Effect<{
636
+ dispatch: {
637
+ readonly sequence: number;
638
+ };
639
+ targetThreadId: string;
640
+ }, ThreadSessionError | import("../rpc/error.ts").RpcError, never>;
641
+ }, never, Environment | T3Orchestration | Path.Path | Crypto.Crypto>;
642
+ export type ThreadShow = {
643
+ readonly id: string;
644
+ readonly projectId: string;
645
+ readonly title: string;
646
+ readonly status: ThreadLifecycleStatus;
647
+ readonly session: OrchestrationThread["session"];
648
+ readonly latestTurn: OrchestrationThread["latestTurn"];
649
+ readonly modelSelection: OrchestrationThread["modelSelection"];
650
+ readonly runtimeMode: OrchestrationThread["runtimeMode"];
651
+ readonly interactionMode: OrchestrationThread["interactionMode"];
652
+ readonly branch: OrchestrationThread["branch"];
653
+ readonly worktreePath: OrchestrationThread["worktreePath"];
654
+ readonly archivedAt: OrchestrationThread["archivedAt"];
655
+ readonly createdAt: string;
656
+ readonly updatedAt: string;
657
+ readonly messageCount: number;
658
+ readonly hasPendingApprovals: boolean;
659
+ readonly hasPendingUserInput: boolean;
660
+ readonly hasActionableProposedPlan: boolean;
661
+ readonly pendingApprovals: ReturnType<typeof derivePendingApprovals>;
662
+ readonly pendingUserInputs: ReturnType<typeof derivePendingUserInputs>;
663
+ };
@@ -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;
@@ -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;
@@ -0,0 +1,14 @@
1
+ import { ApprovalRequestId, type OrchestrationThreadActivity, type UserInputQuestion } from "#t3tools/contracts";
2
+ export type PendingApproval = {
3
+ readonly requestId: ApprovalRequestId;
4
+ readonly requestKind: "command" | "file-read" | "file-change";
5
+ readonly createdAt: string;
6
+ readonly detail?: string;
7
+ };
8
+ export type PendingUserInput = {
9
+ readonly requestId: ApprovalRequestId;
10
+ readonly createdAt: string;
11
+ readonly questions: ReadonlyArray<UserInputQuestion>;
12
+ };
13
+ export declare function derivePendingApprovals(activities: ReadonlyArray<OrchestrationThreadActivity>): ReadonlyArray<PendingApproval>;
14
+ export declare function derivePendingUserInputs(activities: ReadonlyArray<OrchestrationThreadActivity>): ReadonlyArray<PendingUserInput>;
@@ -1,5 +1,6 @@
1
1
  import { type OrchestrationEvent, type OrchestrationMessage as OrchestrationMessageType, type OrchestrationThread, type OrchestrationThreadShell } from "#t3tools/contracts";
2
2
  export declare function isThreadActive(thread: OrchestrationThreadShell | OrchestrationThread): boolean;
3
+ export type ThreadLifecycleStatus = ReturnType<typeof threadStatus>;
3
4
  export declare function threadStatus(thread: OrchestrationThreadShell | OrchestrationThread): "unknown" | "error" | "idle" | "starting" | "running" | "ready" | "interrupted" | "stopped" | "completed" | "pending";
4
5
  export declare function latestAssistantMessage(thread: OrchestrationThread): {
5
6
  readonly id: string & import("effect/Brand").Brand<"MessageId">;
@@ -50,6 +51,15 @@ export declare function applyThreadEvent(current: OrchestrationThread, event: Or
50
51
  readonly updatedAt: string;
51
52
  readonly archivedAt: string | null;
52
53
  readonly deletedAt: string | null;
54
+ readonly goal: {
55
+ readonly objective: string;
56
+ readonly status: "active" | "paused" | "budgetLimited" | "complete";
57
+ readonly tokensUsed: number;
58
+ readonly tokenBudget: number | null;
59
+ readonly timeUsedSeconds: number;
60
+ readonly createdAt: string;
61
+ readonly updatedAt: string;
62
+ } | null;
53
63
  readonly messages: readonly {
54
64
  readonly id: string & import("effect/Brand").Brand<"MessageId">;
55
65
  readonly role: "user" | "assistant" | "system";