t3code-cli 0.2.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 (101) hide show
  1. package/README.md +1 -1
  2. package/dist/bin.js +412 -87
  3. package/dist/index.js +1 -1
  4. package/dist/{runtime-CMPZpQaG.js → runtime-Cq64iuZr.js} +4768 -2040
  5. package/dist/src/application/error.d.ts +3 -0
  6. package/dist/src/application/layer.d.ts +776 -0
  7. package/dist/src/application/model-selection.d.ts +19 -0
  8. package/dist/src/application/models.d.ts +93 -0
  9. package/dist/src/application/project-commands.d.ts +15 -0
  10. package/dist/src/application/projects.d.ts +136 -0
  11. package/dist/src/application/service.d.ts +72 -0
  12. package/dist/src/application/shell-sequence.d.ts +91 -0
  13. package/dist/src/application/thread-commands.d.ts +84 -0
  14. package/dist/src/application/thread-wait.d.ts +104 -0
  15. package/dist/src/application/threads.d.ts +563 -0
  16. package/dist/src/auth/error.d.ts +50 -0
  17. package/dist/src/auth/layer.d.ts +23 -0
  18. package/dist/src/auth/local.d.ts +27 -0
  19. package/dist/src/auth/pairing.d.ts +22 -0
  20. package/dist/src/auth/schema.d.ts +58 -0
  21. package/dist/src/auth/service.d.ts +14 -0
  22. package/dist/src/auth/transport.d.ts +19 -0
  23. package/dist/src/auth/type.d.ts +25 -0
  24. package/dist/src/config/error.d.ts +18 -0
  25. package/dist/src/config/layer.d.ts +20 -0
  26. package/dist/src/config/service.d.ts +20 -0
  27. package/dist/src/config/url.d.ts +6 -0
  28. package/dist/src/domain/error.d.ts +31 -0
  29. package/dist/src/domain/helpers.d.ts +38 -0
  30. package/dist/src/domain/model-config.d.ts +293 -0
  31. package/dist/src/domain/thread-lifecycle.d.ts +114 -0
  32. package/dist/src/environment/layer.d.ts +3 -0
  33. package/dist/src/environment/service.d.ts +12 -0
  34. package/dist/src/index.d.ts +6 -0
  35. package/dist/src/orchestration/layer.d.ts +2128 -0
  36. package/dist/src/orchestration/service.d.ts +27 -0
  37. package/dist/src/rpc/error.d.ts +15 -0
  38. package/dist/src/rpc/layer.d.ts +4678 -0
  39. package/dist/src/rpc/service.d.ts +15 -0
  40. package/dist/src/rpc/ws-group.d.ts +2238 -0
  41. package/dist/src/runtime.d.ts +3 -0
  42. package/dist/src/sql/node-sqlite-client.d.ts +10 -0
  43. package/dist/src/sql/service.d.ts +17 -0
  44. package/dist/upstream-t3code/packages/contracts/src/auth.d.ts +441 -0
  45. package/dist/upstream-t3code/packages/contracts/src/baseSchemas.d.ts +38 -0
  46. package/dist/upstream-t3code/packages/contracts/src/desktopBootstrap.d.ts +14 -0
  47. package/dist/upstream-t3code/packages/contracts/src/editor.d.ts +124 -0
  48. package/dist/upstream-t3code/packages/contracts/src/environment.d.ts +64 -0
  49. package/dist/upstream-t3code/packages/contracts/src/environmentHttp.d.ts +762 -0
  50. package/dist/upstream-t3code/packages/contracts/src/filesystem.d.ts +26 -0
  51. package/dist/upstream-t3code/packages/contracts/src/git.d.ts +500 -0
  52. package/dist/upstream-t3code/packages/contracts/src/index.d.ts +25 -0
  53. package/dist/upstream-t3code/packages/contracts/src/ipc.d.ts +490 -0
  54. package/dist/upstream-t3code/packages/contracts/src/keybindings.d.ts +133 -0
  55. package/dist/upstream-t3code/packages/contracts/src/model.d.ts +112 -0
  56. package/dist/upstream-t3code/packages/contracts/src/orchestration.d.ts +6682 -0
  57. package/dist/upstream-t3code/packages/contracts/src/project.d.ts +45 -0
  58. package/dist/upstream-t3code/packages/contracts/src/provider.d.ts +116 -0
  59. package/dist/upstream-t3code/packages/contracts/src/providerInstance.d.ts +99 -0
  60. package/dist/upstream-t3code/packages/contracts/src/providerRuntime.d.ts +4276 -0
  61. package/dist/upstream-t3code/packages/contracts/src/relay.d.ts +1262 -0
  62. package/dist/upstream-t3code/packages/contracts/src/relayClient.d.ts +48 -0
  63. package/dist/upstream-t3code/packages/contracts/src/remoteAccess.d.ts +45 -0
  64. package/dist/upstream-t3code/packages/contracts/src/review.d.ts +37 -0
  65. package/dist/upstream-t3code/packages/contracts/src/rpc.d.ts +8218 -0
  66. package/dist/upstream-t3code/packages/contracts/src/server.d.ts +2291 -0
  67. package/dist/upstream-t3code/packages/contracts/src/settings.d.ts +271 -0
  68. package/dist/upstream-t3code/packages/contracts/src/sourceControl.d.ts +177 -0
  69. package/dist/upstream-t3code/packages/contracts/src/terminal.d.ts +330 -0
  70. package/dist/upstream-t3code/packages/contracts/src/vcs.d.ts +148 -0
  71. package/package.json +15 -7
  72. package/src/application/model-selection.ts +2 -2
  73. package/src/application/project-commands.ts +1 -1
  74. package/src/application/service.ts +1 -1
  75. package/src/application/shell-sequence.ts +1 -1
  76. package/src/application/thread-commands.ts +1 -1
  77. package/src/application/thread-wait.ts +1 -1
  78. package/src/auth/error.ts +33 -1
  79. package/src/auth/layer.ts +11 -76
  80. package/src/auth/local.ts +342 -208
  81. package/src/auth/pairing.ts +44 -2
  82. package/src/auth/schema.ts +21 -28
  83. package/src/auth/service.ts +2 -2
  84. package/src/auth/transport.ts +59 -22
  85. package/src/auth/type.ts +0 -1
  86. package/src/cli/auth.ts +1 -3
  87. package/src/cli/model-format.ts +1 -1
  88. package/src/cli/project-format.ts +1 -1
  89. package/src/cli/thread-format.ts +1 -1
  90. package/src/domain/helpers.ts +1 -1
  91. package/src/domain/model-config.ts +1 -1
  92. package/src/domain/thread-lifecycle.ts +1 -1
  93. package/src/index.ts +3 -3
  94. package/src/orchestration/layer.ts +1 -1
  95. package/src/orchestration/service.ts +1 -1
  96. package/src/rpc/error.ts +1 -1
  97. package/src/rpc/layer.ts +2 -2
  98. package/src/rpc/ws-group.ts +1 -1
  99. package/src/runtime.ts +14 -1
  100. package/src/sql/node-sqlite-client.ts +141 -0
  101. package/src/sql/service.ts +21 -0
@@ -0,0 +1,563 @@
1
+ import * as Crypto from "effect/Crypto";
2
+ import * as Effect from "effect/Effect";
3
+ import * as Path from "effect/Path";
4
+ import { Environment } from "../environment/service.ts";
5
+ import { T3Orchestration } from "../orchestration/service.ts";
6
+ import { ThreadSessionError } from "../domain/error.ts";
7
+ import { type StartThreadInput } from "./service.ts";
8
+ import type { SendThreadInput } from "./service.ts";
9
+ export declare const makeThreadApplication: () => Effect.Effect<{
10
+ archiveThread: (threadId: string) => Effect.Effect<{
11
+ readonly sequence: number;
12
+ }, import("../rpc/error.ts").RpcError, never>;
13
+ listThreads: (projectRef: string) => Effect.Effect<{
14
+ project: {
15
+ readonly id: string & import("effect/Brand").Brand<"ProjectId">;
16
+ readonly title: string;
17
+ readonly workspaceRoot: string;
18
+ readonly defaultModelSelection: {
19
+ readonly instanceId: string & import("effect/Brand").Brand<"ProviderInstanceId">;
20
+ readonly model: string;
21
+ readonly options?: readonly {
22
+ readonly id: string;
23
+ readonly value: string | boolean;
24
+ }[];
25
+ } | null;
26
+ readonly scripts: readonly {
27
+ readonly id: string;
28
+ readonly name: string;
29
+ readonly command: string;
30
+ readonly icon: "play" | "test" | "lint" | "configure" | "build" | "debug";
31
+ readonly runOnWorktreeCreate: boolean;
32
+ }[];
33
+ readonly createdAt: string;
34
+ readonly updatedAt: string;
35
+ readonly repositoryIdentity?: {
36
+ readonly canonicalKey: string;
37
+ readonly locator: {
38
+ readonly source: "git-remote";
39
+ readonly remoteName: string;
40
+ readonly remoteUrl: string;
41
+ };
42
+ readonly rootPath?: string;
43
+ readonly displayName?: string;
44
+ readonly provider?: string;
45
+ readonly owner?: string;
46
+ readonly name?: string;
47
+ } | null | undefined;
48
+ };
49
+ threads: {
50
+ readonly id: string & import("effect/Brand").Brand<"ThreadId">;
51
+ readonly projectId: string & import("effect/Brand").Brand<"ProjectId">;
52
+ readonly title: string;
53
+ readonly modelSelection: {
54
+ readonly instanceId: string & import("effect/Brand").Brand<"ProviderInstanceId">;
55
+ readonly model: string;
56
+ readonly options?: readonly {
57
+ readonly id: string;
58
+ readonly value: string | boolean;
59
+ }[];
60
+ };
61
+ readonly runtimeMode: "approval-required" | "auto-accept-edits" | "full-access";
62
+ readonly interactionMode: "default" | "plan";
63
+ readonly branch: string | null;
64
+ readonly worktreePath: string | null;
65
+ readonly latestTurn: {
66
+ readonly turnId: string & import("effect/Brand").Brand<"TurnId">;
67
+ readonly state: "error" | "running" | "interrupted" | "completed";
68
+ readonly requestedAt: string;
69
+ readonly startedAt: string | null;
70
+ readonly completedAt: string | null;
71
+ readonly assistantMessageId: (string & import("effect/Brand").Brand<"MessageId">) | null;
72
+ readonly sourceProposedPlan?: {
73
+ readonly threadId: string & import("effect/Brand").Brand<"ThreadId">;
74
+ readonly planId: string;
75
+ } | undefined;
76
+ } | null;
77
+ readonly createdAt: string;
78
+ readonly updatedAt: string;
79
+ readonly archivedAt: string | null;
80
+ readonly session: {
81
+ readonly threadId: string & import("effect/Brand").Brand<"ThreadId">;
82
+ readonly status: "error" | "idle" | "starting" | "running" | "ready" | "interrupted" | "stopped";
83
+ readonly providerName: string | null;
84
+ readonly runtimeMode: "approval-required" | "auto-accept-edits" | "full-access";
85
+ readonly activeTurnId: (string & import("effect/Brand").Brand<"TurnId">) | null;
86
+ readonly lastError: string | null;
87
+ readonly updatedAt: string;
88
+ readonly providerInstanceId?: (string & import("effect/Brand").Brand<"ProviderInstanceId">) | undefined;
89
+ } | null;
90
+ readonly latestUserMessageAt: string | null;
91
+ readonly hasPendingApprovals: boolean;
92
+ readonly hasPendingUserInput: boolean;
93
+ readonly hasActionableProposedPlan: boolean;
94
+ }[];
95
+ }, import("../rpc/error.ts").RpcError, never>;
96
+ getThreadMessages: (threadId: string) => Effect.Effect<{
97
+ readonly id: string & import("effect/Brand").Brand<"ThreadId">;
98
+ readonly projectId: string & import("effect/Brand").Brand<"ProjectId">;
99
+ readonly title: string;
100
+ readonly modelSelection: {
101
+ readonly instanceId: string & import("effect/Brand").Brand<"ProviderInstanceId">;
102
+ readonly model: string;
103
+ readonly options?: readonly {
104
+ readonly id: string;
105
+ readonly value: string | boolean;
106
+ }[];
107
+ };
108
+ readonly runtimeMode: "approval-required" | "auto-accept-edits" | "full-access";
109
+ readonly interactionMode: "default" | "plan";
110
+ readonly branch: string | null;
111
+ readonly worktreePath: string | null;
112
+ readonly latestTurn: {
113
+ readonly turnId: string & import("effect/Brand").Brand<"TurnId">;
114
+ readonly state: "error" | "running" | "interrupted" | "completed";
115
+ readonly requestedAt: string;
116
+ readonly startedAt: string | null;
117
+ readonly completedAt: string | null;
118
+ readonly assistantMessageId: (string & import("effect/Brand").Brand<"MessageId">) | null;
119
+ readonly sourceProposedPlan?: {
120
+ readonly threadId: string & import("effect/Brand").Brand<"ThreadId">;
121
+ readonly planId: string;
122
+ } | undefined;
123
+ } | null;
124
+ readonly createdAt: string;
125
+ readonly updatedAt: string;
126
+ readonly archivedAt: string | null;
127
+ readonly deletedAt: string | null;
128
+ readonly messages: readonly {
129
+ readonly id: string & import("effect/Brand").Brand<"MessageId">;
130
+ readonly role: "user" | "assistant" | "system";
131
+ readonly text: string;
132
+ readonly turnId: (string & import("effect/Brand").Brand<"TurnId">) | null;
133
+ readonly streaming: boolean;
134
+ readonly createdAt: string;
135
+ readonly updatedAt: string;
136
+ readonly attachments?: readonly {
137
+ readonly type: "image";
138
+ readonly id: string;
139
+ readonly name: string;
140
+ readonly mimeType: string;
141
+ readonly sizeBytes: number;
142
+ }[] | undefined;
143
+ }[];
144
+ readonly proposedPlans: readonly {
145
+ readonly id: string;
146
+ readonly turnId: (string & import("effect/Brand").Brand<"TurnId">) | null;
147
+ readonly planMarkdown: string;
148
+ readonly implementedAt: string | null;
149
+ readonly implementationThreadId: (string & import("effect/Brand").Brand<"ThreadId">) | null;
150
+ readonly createdAt: string;
151
+ readonly updatedAt: string;
152
+ }[];
153
+ readonly activities: readonly {
154
+ readonly id: string & import("effect/Brand").Brand<"EventId">;
155
+ readonly tone: "error" | "info" | "tool" | "approval";
156
+ readonly kind: string;
157
+ readonly summary: string;
158
+ readonly payload: unknown;
159
+ readonly turnId: (string & import("effect/Brand").Brand<"TurnId">) | null;
160
+ readonly createdAt: string;
161
+ readonly sequence?: number | undefined;
162
+ }[];
163
+ readonly checkpoints: readonly {
164
+ readonly turnId: string & import("effect/Brand").Brand<"TurnId">;
165
+ readonly checkpointTurnCount: number;
166
+ readonly checkpointRef: string & import("effect/Brand").Brand<"CheckpointRef">;
167
+ readonly status: "error" | "ready" | "missing";
168
+ readonly files: readonly {
169
+ readonly path: string;
170
+ readonly kind: string;
171
+ readonly additions: number;
172
+ readonly deletions: number;
173
+ }[];
174
+ readonly assistantMessageId: (string & import("effect/Brand").Brand<"MessageId">) | null;
175
+ readonly completedAt: string;
176
+ }[];
177
+ readonly session: {
178
+ readonly threadId: string & import("effect/Brand").Brand<"ThreadId">;
179
+ readonly status: "error" | "idle" | "starting" | "running" | "ready" | "interrupted" | "stopped";
180
+ readonly providerName: string | null;
181
+ readonly runtimeMode: "approval-required" | "auto-accept-edits" | "full-access";
182
+ readonly activeTurnId: (string & import("effect/Brand").Brand<"TurnId">) | null;
183
+ readonly lastError: string | null;
184
+ readonly updatedAt: string;
185
+ readonly providerInstanceId?: (string & import("effect/Brand").Brand<"ProviderInstanceId">) | undefined;
186
+ } | null;
187
+ }, import("../rpc/error.ts").RpcError, never>;
188
+ sendThread: (input: SendThreadInput, policy?: {
189
+ readonly until: "dispatch" | "visible" | "complete";
190
+ } | undefined) => Effect.Effect<{
191
+ dispatch: {
192
+ readonly sequence: number;
193
+ };
194
+ threadId: string;
195
+ thread?: never;
196
+ } | {
197
+ dispatch: {
198
+ readonly sequence: number;
199
+ };
200
+ threadId: string;
201
+ thread: {
202
+ readonly id: string & import("effect/Brand").Brand<"ThreadId">;
203
+ readonly projectId: string & import("effect/Brand").Brand<"ProjectId">;
204
+ readonly title: string;
205
+ readonly modelSelection: {
206
+ readonly instanceId: string & import("effect/Brand").Brand<"ProviderInstanceId">;
207
+ readonly model: string;
208
+ readonly options?: readonly {
209
+ readonly id: string;
210
+ readonly value: string | boolean;
211
+ }[];
212
+ };
213
+ readonly runtimeMode: "approval-required" | "auto-accept-edits" | "full-access";
214
+ readonly interactionMode: "default" | "plan";
215
+ readonly branch: string | null;
216
+ readonly worktreePath: string | null;
217
+ readonly latestTurn: {
218
+ readonly turnId: string & import("effect/Brand").Brand<"TurnId">;
219
+ readonly state: "error" | "running" | "interrupted" | "completed";
220
+ readonly requestedAt: string;
221
+ readonly startedAt: string | null;
222
+ readonly completedAt: string | null;
223
+ readonly assistantMessageId: (string & import("effect/Brand").Brand<"MessageId">) | null;
224
+ readonly sourceProposedPlan?: {
225
+ readonly threadId: string & import("effect/Brand").Brand<"ThreadId">;
226
+ readonly planId: string;
227
+ } | undefined;
228
+ } | null;
229
+ readonly createdAt: string;
230
+ readonly updatedAt: string;
231
+ readonly archivedAt: string | null;
232
+ readonly deletedAt: string | null;
233
+ readonly messages: readonly {
234
+ readonly id: string & import("effect/Brand").Brand<"MessageId">;
235
+ readonly role: "user" | "assistant" | "system";
236
+ readonly text: string;
237
+ readonly turnId: (string & import("effect/Brand").Brand<"TurnId">) | null;
238
+ readonly streaming: boolean;
239
+ readonly createdAt: string;
240
+ readonly updatedAt: string;
241
+ readonly attachments?: readonly {
242
+ readonly type: "image";
243
+ readonly id: string;
244
+ readonly name: string;
245
+ readonly mimeType: string;
246
+ readonly sizeBytes: number;
247
+ }[] | undefined;
248
+ }[];
249
+ readonly proposedPlans: readonly {
250
+ readonly id: string;
251
+ readonly turnId: (string & import("effect/Brand").Brand<"TurnId">) | null;
252
+ readonly planMarkdown: string;
253
+ readonly implementedAt: string | null;
254
+ readonly implementationThreadId: (string & import("effect/Brand").Brand<"ThreadId">) | null;
255
+ readonly createdAt: string;
256
+ readonly updatedAt: string;
257
+ }[];
258
+ readonly activities: readonly {
259
+ readonly id: string & import("effect/Brand").Brand<"EventId">;
260
+ readonly tone: "error" | "info" | "tool" | "approval";
261
+ readonly kind: string;
262
+ readonly summary: string;
263
+ readonly payload: unknown;
264
+ readonly turnId: (string & import("effect/Brand").Brand<"TurnId">) | null;
265
+ readonly createdAt: string;
266
+ readonly sequence?: number | undefined;
267
+ }[];
268
+ readonly checkpoints: readonly {
269
+ readonly turnId: string & import("effect/Brand").Brand<"TurnId">;
270
+ readonly checkpointTurnCount: number;
271
+ readonly checkpointRef: string & import("effect/Brand").Brand<"CheckpointRef">;
272
+ readonly status: "error" | "ready" | "missing";
273
+ readonly files: readonly {
274
+ readonly path: string;
275
+ readonly kind: string;
276
+ readonly additions: number;
277
+ readonly deletions: number;
278
+ }[];
279
+ readonly assistantMessageId: (string & import("effect/Brand").Brand<"MessageId">) | null;
280
+ readonly completedAt: string;
281
+ }[];
282
+ readonly session: {
283
+ readonly threadId: string & import("effect/Brand").Brand<"ThreadId">;
284
+ readonly status: "error" | "idle" | "starting" | "running" | "ready" | "interrupted" | "stopped";
285
+ readonly providerName: string | null;
286
+ readonly runtimeMode: "approval-required" | "auto-accept-edits" | "full-access";
287
+ readonly activeTurnId: (string & import("effect/Brand").Brand<"TurnId">) | null;
288
+ readonly lastError: string | null;
289
+ readonly updatedAt: string;
290
+ readonly providerInstanceId?: (string & import("effect/Brand").Brand<"ProviderInstanceId">) | undefined;
291
+ } | null;
292
+ };
293
+ }, ThreadSessionError | import("../rpc/error.ts").RpcError, never>;
294
+ startThread: (startInput: StartThreadInput, policy?: {
295
+ readonly until: "dispatch" | "visible" | "complete";
296
+ } | undefined) => Effect.Effect<{
297
+ dispatch: {
298
+ readonly sequence: number;
299
+ };
300
+ project: {
301
+ readonly id: string & import("effect/Brand").Brand<"ProjectId">;
302
+ readonly title: string;
303
+ readonly workspaceRoot: string;
304
+ readonly defaultModelSelection: {
305
+ readonly instanceId: string & import("effect/Brand").Brand<"ProviderInstanceId">;
306
+ readonly model: string;
307
+ readonly options?: readonly {
308
+ readonly id: string;
309
+ readonly value: string | boolean;
310
+ }[];
311
+ } | null;
312
+ readonly scripts: readonly {
313
+ readonly id: string;
314
+ readonly name: string;
315
+ readonly command: string;
316
+ readonly icon: "play" | "test" | "lint" | "configure" | "build" | "debug";
317
+ readonly runOnWorktreeCreate: boolean;
318
+ }[];
319
+ readonly createdAt: string;
320
+ readonly updatedAt: string;
321
+ readonly repositoryIdentity?: {
322
+ readonly canonicalKey: string;
323
+ readonly locator: {
324
+ readonly source: "git-remote";
325
+ readonly remoteName: string;
326
+ readonly remoteUrl: string;
327
+ };
328
+ readonly rootPath?: string;
329
+ readonly displayName?: string;
330
+ readonly provider?: string;
331
+ readonly owner?: string;
332
+ readonly name?: string;
333
+ } | null | undefined;
334
+ };
335
+ threadId: string & import("effect/Brand").Brand<"ThreadId">;
336
+ thread?: never;
337
+ } | {
338
+ dispatch: {
339
+ readonly sequence: number;
340
+ };
341
+ project: {
342
+ readonly id: string & import("effect/Brand").Brand<"ProjectId">;
343
+ readonly title: string;
344
+ readonly workspaceRoot: string;
345
+ readonly defaultModelSelection: {
346
+ readonly instanceId: string & import("effect/Brand").Brand<"ProviderInstanceId">;
347
+ readonly model: string;
348
+ readonly options?: readonly {
349
+ readonly id: string;
350
+ readonly value: string | boolean;
351
+ }[];
352
+ } | null;
353
+ readonly scripts: readonly {
354
+ readonly id: string;
355
+ readonly name: string;
356
+ readonly command: string;
357
+ readonly icon: "play" | "test" | "lint" | "configure" | "build" | "debug";
358
+ readonly runOnWorktreeCreate: boolean;
359
+ }[];
360
+ readonly createdAt: string;
361
+ readonly updatedAt: string;
362
+ readonly repositoryIdentity?: {
363
+ readonly canonicalKey: string;
364
+ readonly locator: {
365
+ readonly source: "git-remote";
366
+ readonly remoteName: string;
367
+ readonly remoteUrl: string;
368
+ };
369
+ readonly rootPath?: string;
370
+ readonly displayName?: string;
371
+ readonly provider?: string;
372
+ readonly owner?: string;
373
+ readonly name?: string;
374
+ } | null | undefined;
375
+ };
376
+ threadId: string & import("effect/Brand").Brand<"ThreadId">;
377
+ thread: {
378
+ readonly id: string & import("effect/Brand").Brand<"ThreadId">;
379
+ readonly projectId: string & import("effect/Brand").Brand<"ProjectId">;
380
+ readonly title: string;
381
+ readonly modelSelection: {
382
+ readonly instanceId: string & import("effect/Brand").Brand<"ProviderInstanceId">;
383
+ readonly model: string;
384
+ readonly options?: readonly {
385
+ readonly id: string;
386
+ readonly value: string | boolean;
387
+ }[];
388
+ };
389
+ readonly runtimeMode: "approval-required" | "auto-accept-edits" | "full-access";
390
+ readonly interactionMode: "default" | "plan";
391
+ readonly branch: string | null;
392
+ readonly worktreePath: string | null;
393
+ readonly latestTurn: {
394
+ readonly turnId: string & import("effect/Brand").Brand<"TurnId">;
395
+ readonly state: "error" | "running" | "interrupted" | "completed";
396
+ readonly requestedAt: string;
397
+ readonly startedAt: string | null;
398
+ readonly completedAt: string | null;
399
+ readonly assistantMessageId: (string & import("effect/Brand").Brand<"MessageId">) | null;
400
+ readonly sourceProposedPlan?: {
401
+ readonly threadId: string & import("effect/Brand").Brand<"ThreadId">;
402
+ readonly planId: string;
403
+ } | undefined;
404
+ } | null;
405
+ readonly createdAt: string;
406
+ readonly updatedAt: string;
407
+ readonly archivedAt: string | null;
408
+ readonly deletedAt: string | null;
409
+ readonly messages: readonly {
410
+ readonly id: string & import("effect/Brand").Brand<"MessageId">;
411
+ readonly role: "user" | "assistant" | "system";
412
+ readonly text: string;
413
+ readonly turnId: (string & import("effect/Brand").Brand<"TurnId">) | null;
414
+ readonly streaming: boolean;
415
+ readonly createdAt: string;
416
+ readonly updatedAt: string;
417
+ readonly attachments?: readonly {
418
+ readonly type: "image";
419
+ readonly id: string;
420
+ readonly name: string;
421
+ readonly mimeType: string;
422
+ readonly sizeBytes: number;
423
+ }[] | undefined;
424
+ }[];
425
+ readonly proposedPlans: readonly {
426
+ readonly id: string;
427
+ readonly turnId: (string & import("effect/Brand").Brand<"TurnId">) | null;
428
+ readonly planMarkdown: string;
429
+ readonly implementedAt: string | null;
430
+ readonly implementationThreadId: (string & import("effect/Brand").Brand<"ThreadId">) | null;
431
+ readonly createdAt: string;
432
+ readonly updatedAt: string;
433
+ }[];
434
+ readonly activities: readonly {
435
+ readonly id: string & import("effect/Brand").Brand<"EventId">;
436
+ readonly tone: "error" | "info" | "tool" | "approval";
437
+ readonly kind: string;
438
+ readonly summary: string;
439
+ readonly payload: unknown;
440
+ readonly turnId: (string & import("effect/Brand").Brand<"TurnId">) | null;
441
+ readonly createdAt: string;
442
+ readonly sequence?: number | undefined;
443
+ }[];
444
+ readonly checkpoints: readonly {
445
+ readonly turnId: string & import("effect/Brand").Brand<"TurnId">;
446
+ readonly checkpointTurnCount: number;
447
+ readonly checkpointRef: string & import("effect/Brand").Brand<"CheckpointRef">;
448
+ readonly status: "error" | "ready" | "missing";
449
+ readonly files: readonly {
450
+ readonly path: string;
451
+ readonly kind: string;
452
+ readonly additions: number;
453
+ readonly deletions: number;
454
+ }[];
455
+ readonly assistantMessageId: (string & import("effect/Brand").Brand<"MessageId">) | null;
456
+ readonly completedAt: string;
457
+ }[];
458
+ readonly session: {
459
+ readonly threadId: string & import("effect/Brand").Brand<"ThreadId">;
460
+ readonly status: "error" | "idle" | "starting" | "running" | "ready" | "interrupted" | "stopped";
461
+ readonly providerName: string | null;
462
+ readonly runtimeMode: "approval-required" | "auto-accept-edits" | "full-access";
463
+ readonly activeTurnId: (string & import("effect/Brand").Brand<"TurnId">) | null;
464
+ readonly lastError: string | null;
465
+ readonly updatedAt: string;
466
+ readonly providerInstanceId?: (string & import("effect/Brand").Brand<"ProviderInstanceId">) | undefined;
467
+ } | null;
468
+ };
469
+ }, import("../domain/error.ts").ModelSelectionError | ThreadSessionError | import("../rpc/error.ts").RpcError, never>;
470
+ watchThread: (threadId: string) => import("effect/Stream").Stream<import("./service.ts").WaitEvent, ThreadSessionError | import("../rpc/error.ts").RpcError, never>;
471
+ waitForThread: (threadId: string) => Effect.Effect<{
472
+ readonly id: string & import("effect/Brand").Brand<"ThreadId">;
473
+ readonly projectId: string & import("effect/Brand").Brand<"ProjectId">;
474
+ readonly title: string;
475
+ readonly modelSelection: {
476
+ readonly instanceId: string & import("effect/Brand").Brand<"ProviderInstanceId">;
477
+ readonly model: string;
478
+ readonly options?: readonly {
479
+ readonly id: string;
480
+ readonly value: string | boolean;
481
+ }[];
482
+ };
483
+ readonly runtimeMode: "approval-required" | "auto-accept-edits" | "full-access";
484
+ readonly interactionMode: "default" | "plan";
485
+ readonly branch: string | null;
486
+ readonly worktreePath: string | null;
487
+ readonly latestTurn: {
488
+ readonly turnId: string & import("effect/Brand").Brand<"TurnId">;
489
+ readonly state: "error" | "running" | "interrupted" | "completed";
490
+ readonly requestedAt: string;
491
+ readonly startedAt: string | null;
492
+ readonly completedAt: string | null;
493
+ readonly assistantMessageId: (string & import("effect/Brand").Brand<"MessageId">) | null;
494
+ readonly sourceProposedPlan?: {
495
+ readonly threadId: string & import("effect/Brand").Brand<"ThreadId">;
496
+ readonly planId: string;
497
+ } | undefined;
498
+ } | null;
499
+ readonly createdAt: string;
500
+ readonly updatedAt: string;
501
+ readonly archivedAt: string | null;
502
+ readonly deletedAt: string | null;
503
+ readonly messages: readonly {
504
+ readonly id: string & import("effect/Brand").Brand<"MessageId">;
505
+ readonly role: "user" | "assistant" | "system";
506
+ readonly text: string;
507
+ readonly turnId: (string & import("effect/Brand").Brand<"TurnId">) | null;
508
+ readonly streaming: boolean;
509
+ readonly createdAt: string;
510
+ readonly updatedAt: string;
511
+ readonly attachments?: readonly {
512
+ readonly type: "image";
513
+ readonly id: string;
514
+ readonly name: string;
515
+ readonly mimeType: string;
516
+ readonly sizeBytes: number;
517
+ }[] | undefined;
518
+ }[];
519
+ readonly proposedPlans: readonly {
520
+ readonly id: string;
521
+ readonly turnId: (string & import("effect/Brand").Brand<"TurnId">) | null;
522
+ readonly planMarkdown: string;
523
+ readonly implementedAt: string | null;
524
+ readonly implementationThreadId: (string & import("effect/Brand").Brand<"ThreadId">) | null;
525
+ readonly createdAt: string;
526
+ readonly updatedAt: string;
527
+ }[];
528
+ readonly activities: readonly {
529
+ readonly id: string & import("effect/Brand").Brand<"EventId">;
530
+ readonly tone: "error" | "info" | "tool" | "approval";
531
+ readonly kind: string;
532
+ readonly summary: string;
533
+ readonly payload: unknown;
534
+ readonly turnId: (string & import("effect/Brand").Brand<"TurnId">) | null;
535
+ readonly createdAt: string;
536
+ readonly sequence?: number | undefined;
537
+ }[];
538
+ readonly checkpoints: readonly {
539
+ readonly turnId: string & import("effect/Brand").Brand<"TurnId">;
540
+ readonly checkpointTurnCount: number;
541
+ readonly checkpointRef: string & import("effect/Brand").Brand<"CheckpointRef">;
542
+ readonly status: "error" | "ready" | "missing";
543
+ readonly files: readonly {
544
+ readonly path: string;
545
+ readonly kind: string;
546
+ readonly additions: number;
547
+ readonly deletions: number;
548
+ }[];
549
+ readonly assistantMessageId: (string & import("effect/Brand").Brand<"MessageId">) | null;
550
+ readonly completedAt: string;
551
+ }[];
552
+ readonly session: {
553
+ readonly threadId: string & import("effect/Brand").Brand<"ThreadId">;
554
+ readonly status: "error" | "idle" | "starting" | "running" | "ready" | "interrupted" | "stopped";
555
+ readonly providerName: string | null;
556
+ readonly runtimeMode: "approval-required" | "auto-accept-edits" | "full-access";
557
+ readonly activeTurnId: (string & import("effect/Brand").Brand<"TurnId">) | null;
558
+ readonly lastError: string | null;
559
+ readonly updatedAt: string;
560
+ readonly providerInstanceId?: (string & import("effect/Brand").Brand<"ProviderInstanceId">) | undefined;
561
+ } | null;
562
+ }, ThreadSessionError | import("../rpc/error.ts").RpcError, never>;
563
+ }, never, Environment | Path.Path | Crypto.Crypto | T3Orchestration>;
@@ -0,0 +1,50 @@
1
+ import * as Cause from "effect/Cause";
2
+ import * as Schema from "effect/Schema";
3
+ import { PlatformError } from "effect/PlatformError";
4
+ import { HttpClientError } from "effect/unstable/http";
5
+ import { ConfigError, UrlError } from "../config/error.ts";
6
+ declare const AuthPairingUrlError_base: Schema.Class<AuthPairingUrlError, Schema.TaggedStruct<"AuthPairingUrlError", {
7
+ readonly message: Schema.String;
8
+ readonly cause: Schema.optionalKey<Schema.instanceOf<Cause.IllegalArgumentError, Cause.IllegalArgumentError>>;
9
+ }>, Cause.YieldableError>;
10
+ export declare class AuthPairingUrlError extends AuthPairingUrlError_base {
11
+ }
12
+ declare const AuthConfigError_base: Schema.Class<AuthConfigError, Schema.TaggedStruct<"AuthConfigError", {
13
+ readonly message: Schema.String;
14
+ readonly cause: Schema.optionalKey<Schema.Union<readonly [typeof ConfigError, typeof UrlError]>>;
15
+ }>, Cause.YieldableError>;
16
+ export declare class AuthConfigError extends AuthConfigError_base {
17
+ }
18
+ declare const AuthTransportError_base: Schema.Class<AuthTransportError, Schema.TaggedStruct<"AuthTransportError", {
19
+ readonly message: Schema.String;
20
+ readonly cause: Schema.optionalKey<Schema.Union<readonly [typeof HttpClientError.HttpClientErrorSchema, Schema.instanceOf<Schema.SchemaError, unknown>, typeof UrlError]>>;
21
+ }>, Cause.YieldableError>;
22
+ export declare class AuthTransportError extends AuthTransportError_base {
23
+ }
24
+ declare const AuthLocalSecretError_base: Schema.Class<AuthLocalSecretError, Schema.TaggedStruct<"AuthLocalSecretError", {
25
+ readonly message: Schema.String;
26
+ readonly cause: Schema.optionalKey<Schema.instanceOf<PlatformError, PlatformError>>;
27
+ }>, Cause.YieldableError>;
28
+ export declare class AuthLocalSecretError extends AuthLocalSecretError_base {
29
+ }
30
+ declare const AuthLocalDatabaseError_base: Schema.Class<AuthLocalDatabaseError, Schema.TaggedStruct<"AuthLocalDatabaseError", {
31
+ readonly operation: Schema.Literals<readonly ["connect", "query", "schema"]>;
32
+ readonly message: Schema.String;
33
+ }>, Cause.YieldableError>;
34
+ export declare class AuthLocalDatabaseError extends AuthLocalDatabaseError_base {
35
+ }
36
+ declare const AuthLocalSigningError_base: Schema.Class<AuthLocalSigningError, Schema.TaggedStruct<"AuthLocalSigningError", {
37
+ readonly operation: Schema.Literals<readonly ["sign"]>;
38
+ readonly message: Schema.String;
39
+ readonly cause: Schema.optionalKey<Schema.instanceOf<PlatformError, PlatformError>>;
40
+ }>, Cause.YieldableError>;
41
+ export declare class AuthLocalSigningError extends AuthLocalSigningError_base {
42
+ }
43
+ declare const AuthLocalError_base: Schema.Class<AuthLocalError, Schema.TaggedStruct<"AuthLocalError", {
44
+ readonly message: Schema.String;
45
+ readonly cause: Schema.optionalKey<Schema.Union<readonly [Schema.Union<readonly [Schema.instanceOf<PlatformError, unknown>, Schema.instanceOf<Schema.SchemaError, unknown>, typeof UrlError]>, typeof AuthLocalSecretError, typeof AuthLocalDatabaseError, typeof AuthLocalSigningError]>>;
46
+ }>, Cause.YieldableError>;
47
+ export declare class AuthLocalError extends AuthLocalError_base {
48
+ }
49
+ export type AuthError = AuthPairingUrlError | AuthConfigError | AuthTransportError | AuthLocalError;
50
+ export {};
@@ -0,0 +1,23 @@
1
+ import * as Effect from "effect/Effect";
2
+ import * as Layer from "effect/Layer";
3
+ import { T3Config } from "../config/service.ts";
4
+ import { AuthConfigError } from "./error.ts";
5
+ import { T3LocalAuth } from "./local.ts";
6
+ import { T3AuthPairing } from "./pairing.ts";
7
+ import { T3Auth } from "./service.ts";
8
+ import { T3AuthTransport } from "./transport.ts";
9
+ export declare const makeT3Auth: () => Effect.Effect<{
10
+ pair: (pairingUrl: string) => Effect.Effect<import("./type.ts").PairResult, AuthConfigError | import("./error.ts").AuthPairingUrlError | import("./error.ts").AuthTransportError>;
11
+ local: (input: import("./type.ts").LocalAuthInput) => Effect.Effect<import("./type.ts").LocalAuthResult, AuthConfigError | import("./error.ts").AuthLocalError>;
12
+ status: () => Effect.Effect<{
13
+ readonly authenticated: boolean;
14
+ readonly role?: "client" | "owner";
15
+ readonly sessionMethod?: string;
16
+ readonly expiresAt?: string;
17
+ }, AuthConfigError | import("./error.ts").AuthTransportError, never>;
18
+ issueWebSocketTicket: () => Effect.Effect<{
19
+ readonly ticket: string;
20
+ readonly expiresAt: string;
21
+ }, AuthConfigError | import("./error.ts").AuthTransportError, never>;
22
+ }, never, T3Config | T3LocalAuth | T3AuthTransport | T3AuthPairing>;
23
+ export declare const T3AuthLive: Layer.Layer<T3Auth, never, T3Config | T3LocalAuth | T3AuthTransport | T3AuthPairing>;
@@ -0,0 +1,27 @@
1
+ import * as Context from "effect/Context";
2
+ import * as Crypto from "effect/Crypto";
3
+ import * as Effect from "effect/Effect";
4
+ import * as FileSystem from "effect/FileSystem";
5
+ import * as Layer from "effect/Layer";
6
+ import * as Path from "effect/Path";
7
+ import { T3Config } from "../config/service.ts";
8
+ import { Environment } from "../environment/service.ts";
9
+ import { SqlClientFactory } from "../sql/service.ts";
10
+ import { AuthConfigError, AuthLocalError } from "./error.ts";
11
+ import type { LocalAuthInput, LocalAuthResult } from "./type.ts";
12
+ declare const T3LocalAuth_base: Context.ServiceClass<T3LocalAuth, "t3cli/T3LocalAuth", {
13
+ readonly local: (input: LocalAuthInput) => Effect.Effect<LocalAuthResult, AuthConfigError | AuthLocalError>;
14
+ }>;
15
+ export declare class T3LocalAuth extends T3LocalAuth_base {
16
+ }
17
+ export declare const makeT3LocalAuth: () => Effect.Effect<{
18
+ local: (input: LocalAuthInput) => Effect.Effect<{
19
+ url: string;
20
+ role: "client" | "owner";
21
+ expiresAt: string;
22
+ source: "local";
23
+ baseDir: string;
24
+ }, AuthConfigError | AuthLocalError, never>;
25
+ }, never, Environment | T3Config | SqlClientFactory | Path.Path | FileSystem.FileSystem | Crypto.Crypto>;
26
+ export declare const T3LocalAuthLive: Layer.Layer<T3LocalAuth, never, Environment | T3Config | SqlClientFactory | Path.Path | FileSystem.FileSystem | Crypto.Crypto>;
27
+ export {};