t3code-cli 0.12.0 → 0.13.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 (64) hide show
  1. package/dist/application.js +1 -1
  2. package/dist/auth.js +1 -1
  3. package/dist/bin.js +48 -31
  4. package/dist/cli.js +1 -1
  5. package/dist/config.js +1 -1
  6. package/dist/connection.js +1 -1
  7. package/dist/index.js +1 -1
  8. package/dist/node.js +1 -1
  9. package/dist/rolldown-runtime.js +1 -1
  10. package/dist/rpc.js +1 -1
  11. package/dist/shared.js +11971 -1517
  12. package/dist/src/application/actions.d.ts +1 -1
  13. package/dist/src/application/layer.d.ts +42 -42
  14. package/dist/src/application/project-commands.d.ts +3 -3
  15. package/dist/src/application/projects.d.ts +1 -1
  16. package/dist/src/application/shell-sequence.d.ts +23 -28
  17. package/dist/src/application/terminals.d.ts +6 -6
  18. package/dist/src/application/thread-commands.d.ts +18 -18
  19. package/dist/src/application/thread-update.d.ts +1 -1
  20. package/dist/src/application/thread-wait.d.ts +19 -24
  21. package/dist/src/application/threads.d.ts +124 -149
  22. package/dist/src/auth/error.d.ts +1 -2
  23. package/dist/src/auth/layer.d.ts +2 -2
  24. package/dist/src/auth/local-origin.d.ts +2 -2
  25. package/dist/src/auth/local-token.d.ts +2 -2
  26. package/dist/src/auth/remote-error.d.ts +3 -0
  27. package/dist/src/config/config.d.ts +2 -2
  28. package/dist/src/config/credential/service.d.ts +2 -2
  29. package/dist/src/config/keystore/file.d.ts +1 -1
  30. package/dist/src/config/persist/migration.d.ts +3 -3
  31. package/dist/src/config/persist/persist.d.ts +4 -4
  32. package/dist/src/connection/error.d.ts +3 -1
  33. package/dist/src/connection/prepared.d.ts +14 -0
  34. package/dist/src/domain/helpers.d.ts +46 -51
  35. package/dist/src/domain/model-config.d.ts +91 -86
  36. package/dist/src/domain/thread-lifecycle.d.ts +23 -28
  37. package/dist/src/orchestration/layer.d.ts +308 -523
  38. package/dist/src/rpc/error.d.ts +4 -6
  39. package/dist/src/rpc/index.d.ts +3 -2
  40. package/dist/src/rpc/layer.d.ts +1890 -2299
  41. package/dist/src/rpc/operation.d.ts +4 -6260
  42. package/dist/src/rpc/service.d.ts +1 -1
  43. package/dist/src/rpc/session.d.ts +22 -0
  44. package/dist/src/rpc/ws-group.d.ts +439 -1180
  45. package/dist/src/runtime/layer.d.ts +10 -10
  46. package/dist/src/sql/node-sqlite-client.d.ts +1 -1
  47. package/dist/t3tools.js +2 -2
  48. package/package.json +8 -7
  49. package/src/application/thread-wait.ts +4 -0
  50. package/src/auth/error.ts +2 -8
  51. package/src/auth/remote-error.ts +17 -0
  52. package/src/auth/transport.ts +45 -114
  53. package/src/connection/error.ts +4 -1
  54. package/src/connection/layer.ts +5 -2
  55. package/src/connection/prepared.ts +83 -0
  56. package/src/orchestration/layer.ts +2 -1
  57. package/src/rpc/error.ts +9 -16
  58. package/src/rpc/index.ts +3 -2
  59. package/src/rpc/layer.ts +17 -51
  60. package/src/rpc/operation.ts +16 -2
  61. package/src/rpc/service.ts +2 -1
  62. package/src/rpc/session.ts +168 -0
  63. package/src/rpc/ws-group.ts +12 -26
  64. package/src/runtime/layer.ts +6 -3
@@ -21,6 +21,6 @@ export declare const makeT3LocalAuthToken: () => Effect.Effect<{
21
21
  source: "local";
22
22
  baseDir: string;
23
23
  }, AuthLocalError, never>;
24
- }, import("effect/Config").ConfigError, CliRuntime | Path.Path | Crypto.Crypto | FileSystem.FileSystem | SqlClientFactory>;
25
- export declare const T3LocalAuthTokenLive: Layer.Layer<T3LocalAuthToken, import("effect/Config").ConfigError, CliRuntime | Path.Path | Crypto.Crypto | FileSystem.FileSystem | SqlClientFactory>;
24
+ }, import("effect/Config").ConfigError, CliRuntime | Crypto.Crypto | FileSystem.FileSystem | Path.Path | SqlClientFactory>;
25
+ export declare const T3LocalAuthTokenLive: Layer.Layer<T3LocalAuthToken, import("effect/Config").ConfigError, CliRuntime | Crypto.Crypto | FileSystem.FileSystem | Path.Path | SqlClientFactory>;
26
26
  export {};
@@ -0,0 +1,3 @@
1
+ import { RemoteEnvironmentAuthFetchError, RemoteEnvironmentAuthInvalidJsonError, RemoteEnvironmentAuthTimeoutError, RemoteEnvironmentAuthUndeclaredStatusError } from "@t3tools/client-runtime/authorization";
2
+ import * as Schema from "effect/Schema";
3
+ export declare const RemoteEnvironmentAuthErrorSchema: Schema.Union<readonly [Schema.Union<readonly [typeof import("@t3tools/contracts").EnvironmentRequestInvalidError, typeof import("@t3tools/contracts").EnvironmentAuthInvalidError, typeof import("@t3tools/contracts").EnvironmentScopeRequiredError, typeof import("@t3tools/contracts").EnvironmentOperationForbiddenError, typeof import("@t3tools/contracts").EnvironmentResourceNotFoundError, typeof import("@t3tools/contracts").EnvironmentInternalError]>, Schema.instanceOf<RemoteEnvironmentAuthFetchError, unknown>, Schema.instanceOf<RemoteEnvironmentAuthInvalidJsonError, unknown>, Schema.instanceOf<RemoteEnvironmentAuthTimeoutError, unknown>, Schema.instanceOf<RemoteEnvironmentAuthUndeclaredStatusError, unknown>]>;
@@ -44,6 +44,6 @@ export declare const make: () => Effect.Effect<{
44
44
  readonly removeEnvironment: (name: string) => Effect.Effect<void, ConfigError, never>;
45
45
  readonly hasEnvironment: (name: string) => Effect.Effect<boolean, ConfigError, never>;
46
46
  readonly getDefaultEnvironmentName: () => Effect.Effect<string | undefined, ConfigError, never>;
47
- }, import("effect/Config").ConfigError, Path.Path | FileSystem.FileSystem | T3CredentialCrypto | T3ConfigSelection>;
48
- export declare const layer: Layer.Layer<T3Config, import("effect/Config").ConfigError, Path.Path | FileSystem.FileSystem | T3CredentialCrypto | T3ConfigSelection>;
47
+ }, import("effect/Config").ConfigError, FileSystem.FileSystem | Path.Path | T3ConfigSelection | T3CredentialCrypto>;
48
+ export declare const layer: Layer.Layer<T3Config, import("effect/Config").ConfigError, FileSystem.FileSystem | Path.Path | T3ConfigSelection | T3CredentialCrypto>;
49
49
  export {};
@@ -29,6 +29,6 @@ export declare class T3CredentialCrypto extends T3CredentialCrypto_base {
29
29
  export declare const make: () => Effect.Effect<{
30
30
  encrypt: (input: CredentialEncryptInput) => Effect.Effect<EncryptedToken, ConfigError>;
31
31
  decrypt: (input: CredentialDecryptInput) => Effect.Effect<string, ConfigError>;
32
- }, ConfigError, Path.Path | Crypto.Crypto | T3CredentialCipher | T3MasterKeyKeystoreFactory | FileSystem.FileSystem>;
33
- export declare const layer: Layer.Layer<T3CredentialCrypto, ConfigError, Path.Path | Crypto.Crypto | T3CredentialCipher | T3MasterKeyKeystoreFactory | FileSystem.FileSystem>;
32
+ }, ConfigError, Crypto.Crypto | FileSystem.FileSystem | Path.Path | T3CredentialCipher | T3MasterKeyKeystoreFactory>;
33
+ export declare const layer: Layer.Layer<T3CredentialCrypto, ConfigError, Crypto.Crypto | FileSystem.FileSystem | Path.Path | T3CredentialCipher | T3MasterKeyKeystoreFactory>;
34
34
  export {};
@@ -6,4 +6,4 @@ import { type MasterKeyReadResult } from "./service.ts";
6
6
  export declare const makeFileKeystore: () => Effect.Effect<{
7
7
  read: () => Effect.Effect<MasterKeyReadResult, ConfigError>;
8
8
  write: (key: Uint8Array) => Effect.Effect<void, ConfigError>;
9
- }, ConfigError, Path.Path | FileSystem.FileSystem>;
9
+ }, ConfigError, FileSystem.FileSystem | Path.Path>;
@@ -6,6 +6,7 @@ export declare const emptyEncryptedConfig: () => EncryptedConfig;
6
6
  export declare const readEncryptedConfigFromValue: (value: unknown) => Effect.Effect<{
7
7
  config: {
8
8
  readonly version: 2;
9
+ readonly default?: string;
9
10
  readonly environments: {
10
11
  readonly [x: string]: {
11
12
  readonly url: string;
@@ -20,12 +21,12 @@ export declare const readEncryptedConfigFromValue: (value: unknown) => Effect.Ef
20
21
  };
21
22
  };
22
23
  };
23
- readonly default?: string;
24
24
  };
25
25
  migratedFromV1: false;
26
26
  } | {
27
27
  config: {
28
28
  readonly version: 2;
29
+ readonly default?: string;
29
30
  readonly environments: {
30
31
  readonly [x: string]: {
31
32
  readonly url: string;
@@ -40,7 +41,6 @@ export declare const readEncryptedConfigFromValue: (value: unknown) => Effect.Ef
40
41
  };
41
42
  };
42
43
  };
43
- readonly default?: string;
44
44
  };
45
45
  migratedFromV1: true;
46
46
  }, ConfigError, T3CredentialCrypto>;
@@ -50,6 +50,7 @@ export declare const migrateV1FileToEncrypted: (config: {
50
50
  readonly local?: boolean;
51
51
  }) => Effect.Effect<{
52
52
  readonly version: 2;
53
+ readonly default?: string;
53
54
  readonly environments: {
54
55
  readonly [x: string]: {
55
56
  readonly url: string;
@@ -64,5 +65,4 @@ export declare const migrateV1FileToEncrypted: (config: {
64
65
  };
65
66
  };
66
67
  };
67
- readonly default?: string;
68
68
  }, ConfigError, T3CredentialCrypto>;
@@ -4,6 +4,7 @@ import * as Path from "effect/Path";
4
4
  import { ConfigError } from "../error.ts";
5
5
  export declare const readEncryptedConfigFile: () => Effect.Effect<{
6
6
  readonly version: 2;
7
+ readonly default?: string;
7
8
  readonly environments: {
8
9
  readonly [x: string]: {
9
10
  readonly url: string;
@@ -18,10 +19,10 @@ export declare const readEncryptedConfigFile: () => Effect.Effect<{
18
19
  };
19
20
  };
20
21
  };
21
- readonly default?: string;
22
- }, ConfigError, Path.Path | FileSystem.FileSystem | import("../credential/service.ts").T3CredentialCrypto>;
22
+ }, ConfigError, FileSystem.FileSystem | Path.Path | import("../credential/service.ts").T3CredentialCrypto>;
23
23
  export declare const writeEncryptedConfigFile: (config: {
24
24
  readonly version: 2;
25
+ readonly default?: string;
25
26
  readonly environments: {
26
27
  readonly [x: string]: {
27
28
  readonly url: string;
@@ -36,5 +37,4 @@ export declare const writeEncryptedConfigFile: (config: {
36
37
  };
37
38
  };
38
39
  };
39
- readonly default?: string;
40
- }) => Effect.Effect<void, ConfigError, Path.Path | FileSystem.FileSystem>;
40
+ }) => Effect.Effect<void, ConfigError, FileSystem.FileSystem | Path.Path>;
@@ -1,7 +1,9 @@
1
1
  import * as Schema from "effect/Schema";
2
+ import { ConfigError } from "../config/error.ts";
3
+ import { UrlError } from "../config/url/error.ts";
2
4
  declare const T3CodeConnectionError_base: Schema.Class<T3CodeConnectionError, Schema.TaggedStruct<"T3CodeConnectionError", {
3
5
  readonly message: Schema.String;
4
- readonly cause: Schema.optionalKey<Schema.Unknown>;
6
+ readonly cause: Schema.Union<readonly [typeof ConfigError, typeof UrlError]>;
5
7
  }>, import("effect/Cause").YieldableError>;
6
8
  export declare class T3CodeConnectionError extends T3CodeConnectionError_base {
7
9
  }
@@ -0,0 +1,14 @@
1
+ import { type ConnectionAttemptError, type PreparedConnection } from "@t3tools/client-runtime/connection";
2
+ import * as Context from "effect/Context";
3
+ import * as Effect from "effect/Effect";
4
+ import * as Layer from "effect/Layer";
5
+ import { HttpClient } from "effect/unstable/http";
6
+ import { T3CodeConnectionError } from "./error.ts";
7
+ import { T3CodeConnectionProvider } from "./service.ts";
8
+ declare const T3PreparedConnectionProvider_base: Context.ServiceClass<T3PreparedConnectionProvider, "t3cli/T3PreparedConnectionProvider", {
9
+ readonly get: Effect.Effect<PreparedConnection, ConnectionAttemptError | T3CodeConnectionError>;
10
+ }>;
11
+ export declare class T3PreparedConnectionProvider extends T3PreparedConnectionProvider_base {
12
+ }
13
+ export declare const T3PreparedConnectionProviderLive: Layer.Layer<T3PreparedConnectionProvider, never, HttpClient.HttpClient | T3CodeConnectionProvider>;
14
+ export {};
@@ -11,6 +11,19 @@ export declare const resolveProjectScope: (snapshot: {
11
11
  readonly id: string & import("effect/Brand").Brand<"ProjectId">;
12
12
  readonly title: string;
13
13
  readonly workspaceRoot: string;
14
+ readonly repositoryIdentity?: {
15
+ readonly canonicalKey: string;
16
+ readonly locator: {
17
+ readonly source: "git-remote";
18
+ readonly remoteName: string;
19
+ readonly remoteUrl: string;
20
+ };
21
+ readonly rootPath?: string;
22
+ readonly displayName?: string;
23
+ readonly provider?: string;
24
+ readonly owner?: string;
25
+ readonly name?: string;
26
+ } | null | undefined;
14
27
  readonly defaultModelSelection: {
15
28
  readonly instanceId: string & import("effect/Brand").Brand<"ProviderInstanceId">;
16
29
  readonly model: string;
@@ -23,26 +36,13 @@ export declare const resolveProjectScope: (snapshot: {
23
36
  readonly id: string;
24
37
  readonly name: string;
25
38
  readonly command: string;
26
- readonly icon: "play" | "test" | "lint" | "configure" | "build" | "debug";
39
+ readonly icon: "build" | "configure" | "debug" | "lint" | "play" | "test";
27
40
  readonly runOnWorktreeCreate: boolean;
28
41
  readonly previewUrl?: string | undefined;
29
42
  readonly autoOpenPreview?: boolean | undefined;
30
43
  }[];
31
44
  readonly createdAt: string;
32
45
  readonly updatedAt: string;
33
- readonly repositoryIdentity?: {
34
- readonly canonicalKey: string;
35
- readonly locator: {
36
- readonly source: "git-remote";
37
- readonly remoteName: string;
38
- readonly remoteUrl: string;
39
- };
40
- readonly rootPath?: string;
41
- readonly displayName?: string;
42
- readonly provider?: string;
43
- readonly owner?: string;
44
- readonly name?: string;
45
- } | null | undefined;
46
46
  }[];
47
47
  readonly threads: readonly {
48
48
  readonly id: string & import("effect/Brand").Brand<"ThreadId">;
@@ -56,13 +56,13 @@ export declare const resolveProjectScope: (snapshot: {
56
56
  readonly value: string | boolean;
57
57
  }[];
58
58
  };
59
- readonly runtimeMode: "approval-required" | "auto-accept-edits" | "full-access";
59
+ readonly runtimeMode: "approval-required" | "auto" | "auto-accept-edits" | "full-access";
60
60
  readonly interactionMode: "default" | "plan";
61
61
  readonly branch: string | null;
62
62
  readonly worktreePath: string | null;
63
63
  readonly latestTurn: {
64
64
  readonly turnId: string & import("effect/Brand").Brand<"TurnId">;
65
- readonly state: "error" | "running" | "interrupted" | "completed";
65
+ readonly state: "completed" | "error" | "interrupted" | "running";
66
66
  readonly requestedAt: string;
67
67
  readonly startedAt: string | null;
68
68
  readonly completedAt: string | null;
@@ -75,24 +75,19 @@ export declare const resolveProjectScope: (snapshot: {
75
75
  readonly createdAt: string;
76
76
  readonly updatedAt: string;
77
77
  readonly archivedAt: string | null;
78
+ readonly settledOverride: "active" | "settled" | null;
79
+ readonly settledAt: string | null;
80
+ readonly snoozedUntil?: string | null | undefined;
81
+ readonly snoozedAt?: string | null | undefined;
78
82
  readonly session: {
79
83
  readonly threadId: string & import("effect/Brand").Brand<"ThreadId">;
80
- readonly status: "error" | "idle" | "starting" | "running" | "ready" | "interrupted" | "stopped";
84
+ readonly status: "error" | "idle" | "interrupted" | "ready" | "running" | "starting" | "stopped";
81
85
  readonly providerName: string | null;
82
- readonly runtimeMode: "approval-required" | "auto-accept-edits" | "full-access";
86
+ readonly providerInstanceId?: (string & import("effect/Brand").Brand<"ProviderInstanceId">) | undefined;
87
+ readonly runtimeMode: "approval-required" | "auto" | "auto-accept-edits" | "full-access";
83
88
  readonly activeTurnId: (string & import("effect/Brand").Brand<"TurnId">) | null;
84
89
  readonly lastError: string | null;
85
90
  readonly updatedAt: string;
86
- readonly providerInstanceId?: (string & import("effect/Brand").Brand<"ProviderInstanceId">) | undefined;
87
- } | null;
88
- readonly goal: {
89
- readonly objective: string;
90
- readonly status: "active" | "paused" | "blocked" | "usageLimited" | "budgetLimited" | "complete";
91
- readonly tokensUsed: number;
92
- readonly tokenBudget: number | null;
93
- readonly timeUsedSeconds: number;
94
- readonly createdAt: string;
95
- readonly updatedAt: string;
96
91
  } | null;
97
92
  readonly latestUserMessageAt: string | null;
98
93
  readonly hasPendingApprovals: boolean;
@@ -107,6 +102,19 @@ export declare const resolveProjectScope: (snapshot: {
107
102
  readonly id: string & import("effect/Brand").Brand<"ProjectId">;
108
103
  readonly title: string;
109
104
  readonly workspaceRoot: string;
105
+ readonly repositoryIdentity?: {
106
+ readonly canonicalKey: string;
107
+ readonly locator: {
108
+ readonly source: "git-remote";
109
+ readonly remoteName: string;
110
+ readonly remoteUrl: string;
111
+ };
112
+ readonly rootPath?: string;
113
+ readonly displayName?: string;
114
+ readonly provider?: string;
115
+ readonly owner?: string;
116
+ readonly name?: string;
117
+ } | null | undefined;
110
118
  readonly defaultModelSelection: {
111
119
  readonly instanceId: string & import("effect/Brand").Brand<"ProviderInstanceId">;
112
120
  readonly model: string;
@@ -119,13 +127,21 @@ export declare const resolveProjectScope: (snapshot: {
119
127
  readonly id: string;
120
128
  readonly name: string;
121
129
  readonly command: string;
122
- readonly icon: "play" | "test" | "lint" | "configure" | "build" | "debug";
130
+ readonly icon: "build" | "configure" | "debug" | "lint" | "play" | "test";
123
131
  readonly runOnWorktreeCreate: boolean;
124
132
  readonly previewUrl?: string | undefined;
125
133
  readonly autoOpenPreview?: boolean | undefined;
126
134
  }[];
127
135
  readonly createdAt: string;
128
136
  readonly updatedAt: string;
137
+ };
138
+ inferredWorktreePath: string;
139
+ } | {
140
+ inferredWorktreePath?: never;
141
+ project: {
142
+ readonly id: string & import("effect/Brand").Brand<"ProjectId">;
143
+ readonly title: string;
144
+ readonly workspaceRoot: string;
129
145
  readonly repositoryIdentity?: {
130
146
  readonly canonicalKey: string;
131
147
  readonly locator: {
@@ -139,13 +155,6 @@ export declare const resolveProjectScope: (snapshot: {
139
155
  readonly owner?: string;
140
156
  readonly name?: string;
141
157
  } | null | undefined;
142
- };
143
- inferredWorktreePath: string;
144
- } | {
145
- project: {
146
- readonly id: string & import("effect/Brand").Brand<"ProjectId">;
147
- readonly title: string;
148
- readonly workspaceRoot: string;
149
158
  readonly defaultModelSelection: {
150
159
  readonly instanceId: string & import("effect/Brand").Brand<"ProviderInstanceId">;
151
160
  readonly model: string;
@@ -158,27 +167,13 @@ export declare const resolveProjectScope: (snapshot: {
158
167
  readonly id: string;
159
168
  readonly name: string;
160
169
  readonly command: string;
161
- readonly icon: "play" | "test" | "lint" | "configure" | "build" | "debug";
170
+ readonly icon: "build" | "configure" | "debug" | "lint" | "play" | "test";
162
171
  readonly runOnWorktreeCreate: boolean;
163
172
  readonly previewUrl?: string | undefined;
164
173
  readonly autoOpenPreview?: boolean | undefined;
165
174
  }[];
166
175
  readonly createdAt: string;
167
176
  readonly updatedAt: string;
168
- readonly repositoryIdentity?: {
169
- readonly canonicalKey: string;
170
- readonly locator: {
171
- readonly source: "git-remote";
172
- readonly remoteName: string;
173
- readonly remoteUrl: string;
174
- };
175
- readonly rootPath?: string;
176
- readonly displayName?: string;
177
- readonly provider?: string;
178
- readonly owner?: string;
179
- readonly name?: string;
180
- } | null | undefined;
181
177
  };
182
- inferredWorktreePath?: never;
183
178
  } | undefined, never, Path.Path>;
184
179
  export declare function findProjectById(snapshot: OrchestrationShellSnapshot, projectId: string): OrchestrationProjectShell | null;