t3code-cli 0.11.0 → 0.12.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 (317) hide show
  1. package/README.md +42 -10
  2. package/dist/application.js +2 -2
  3. package/dist/auth.js +1 -1
  4. package/dist/bin.js +85526 -2662
  5. package/dist/cli.js +15 -2
  6. package/dist/config.js +120 -2
  7. package/dist/connection.js +2 -2
  8. package/dist/index.js +1 -1
  9. package/dist/node.js +6 -2
  10. package/dist/orchestration.js +2 -2
  11. package/dist/rpc.js +1 -1
  12. package/dist/runtime.js +2 -2
  13. package/dist/shared.js +42956 -38119
  14. package/dist/src/application/actions.d.ts +25 -0
  15. package/dist/src/application/index.d.ts +3 -3
  16. package/dist/src/application/layer.d.ts +51 -35
  17. package/dist/src/application/model-selection.d.ts +2 -2
  18. package/dist/src/application/models.d.ts +1 -1
  19. package/dist/src/application/project-commands.d.ts +22 -2
  20. package/dist/src/application/projects.d.ts +7 -7
  21. package/dist/src/application/service.d.ts +65 -2
  22. package/dist/src/application/shell-sequence.d.ts +11 -0
  23. package/dist/src/application/terminals.d.ts +2 -2
  24. package/dist/src/application/thread-commands.d.ts +1 -1
  25. package/dist/src/application/thread-wait.d.ts +9 -0
  26. package/dist/src/application/threads.d.ts +56 -5
  27. package/dist/src/auth/error.d.ts +2 -1
  28. package/dist/src/auth/index.d.ts +1 -1
  29. package/dist/src/auth/layer.d.ts +34 -6
  30. package/dist/src/auth/local-base-dir.d.ts +5 -2
  31. package/dist/src/auth/local-origin.d.ts +3 -3
  32. package/dist/src/auth/local-token.d.ts +3 -3
  33. package/dist/src/auth/service.d.ts +15 -3
  34. package/dist/src/auth/type.d.ts +40 -1
  35. package/dist/src/cli/env/flag.d.ts +2 -0
  36. package/dist/src/cli/env/index.d.ts +2 -0
  37. package/dist/src/cli/env/selection-layer.d.ts +3 -0
  38. package/dist/src/cli/flags.d.ts +2 -0
  39. package/dist/src/cli/format/index.d.ts +1 -0
  40. package/dist/src/cli/format/output.d.ts +12 -0
  41. package/dist/src/cli/index.d.ts +4 -0
  42. package/dist/src/cli/runtime/index.d.ts +1 -0
  43. package/dist/src/cli/runtime/service.d.ts +16 -0
  44. package/dist/src/{scope → cli/scope}/resolve.d.ts +5 -4
  45. package/dist/src/config/config.d.ts +49 -0
  46. package/dist/src/config/credential/cipher-node.d.ts +3 -0
  47. package/dist/src/config/credential/cipher-web.d.ts +3 -0
  48. package/dist/src/config/credential/cipher.d.ts +29 -0
  49. package/dist/src/config/credential/env.d.ts +3 -0
  50. package/dist/src/config/credential/error.d.ts +8 -0
  51. package/dist/src/config/credential/index.d.ts +6 -0
  52. package/dist/src/config/credential/service.d.ts +34 -0
  53. package/dist/src/config/env/env.d.ts +55 -0
  54. package/dist/src/config/env/index.d.ts +2 -0
  55. package/dist/src/{layout/base-dir.d.ts → config/env/layout.d.ts} +0 -1
  56. package/dist/src/config/environment-name/index.d.ts +1 -0
  57. package/dist/src/config/environment-name/name.d.ts +10 -0
  58. package/dist/src/config/error.d.ts +4 -11
  59. package/dist/src/config/index.d.ts +10 -5
  60. package/dist/src/config/keystore/error.d.ts +8 -0
  61. package/dist/src/config/keystore/file.d.ts +9 -0
  62. package/dist/src/config/keystore/index.d.ts +4 -0
  63. package/dist/src/config/keystore/keyring-node.d.ts +4 -0
  64. package/dist/src/config/keystore/service.d.ts +33 -0
  65. package/dist/src/config/paths/index.d.ts +1 -0
  66. package/dist/src/config/paths/paths.d.ts +6 -0
  67. package/dist/src/config/persist/file-mode.d.ts +4 -0
  68. package/dist/src/config/persist/migration.d.ts +68 -0
  69. package/dist/src/config/persist/persist.d.ts +40 -0
  70. package/dist/src/config/persist/schema.d.ts +68 -0
  71. package/dist/src/config/resolve/resolve.d.ts +40 -0
  72. package/dist/src/config/selection/index.d.ts +1 -0
  73. package/dist/src/config/selection/resolve.d.ts +4 -0
  74. package/dist/src/config/selection/service.d.ts +10 -0
  75. package/dist/src/config/types.d.ts +36 -0
  76. package/dist/src/config/url/error.d.ts +10 -0
  77. package/dist/src/config/url/index.d.ts +2 -0
  78. package/dist/src/connection/index.d.ts +0 -1
  79. package/dist/src/contracts/index.d.ts +1 -1
  80. package/dist/src/domain/error.d.ts +14 -1
  81. package/dist/src/domain/helpers.d.ts +16 -1
  82. package/dist/src/domain/model-config.d.ts +4 -1
  83. package/dist/src/domain/thread-activities.d.ts +1 -1
  84. package/dist/src/domain/thread-lifecycle.d.ts +10 -1
  85. package/dist/src/index.d.ts +1 -2
  86. package/dist/src/{connection/node.d.ts → node/connection.d.ts} +1 -1
  87. package/dist/src/node/index.d.ts +1 -2
  88. package/dist/src/orchestration/index.d.ts +0 -1
  89. package/dist/src/orchestration/layer.d.ts +153 -7
  90. package/dist/src/orchestration/service.d.ts +1 -1
  91. package/dist/src/rpc/error.d.ts +2 -2
  92. package/dist/src/rpc/index.d.ts +2 -3
  93. package/dist/src/rpc/layer.d.ts +574 -46
  94. package/dist/src/rpc/operation.d.ts +574 -46
  95. package/dist/src/rpc/ws-group.d.ts +184 -19
  96. package/dist/src/runtime/index.d.ts +1 -2
  97. package/dist/src/runtime/layer.d.ts +12 -8
  98. package/dist/src/t3tools/index.d.ts +1 -1
  99. package/dist/t3tools.js +2 -2
  100. package/package.json +25 -21
  101. package/src/application/actions.test.ts +328 -0
  102. package/src/application/actions.ts +475 -0
  103. package/src/application/index.ts +9 -5
  104. package/src/application/layer.ts +9 -0
  105. package/src/application/model-selection.ts +2 -2
  106. package/src/application/project-commands.ts +23 -5
  107. package/src/application/projects.ts +6 -7
  108. package/src/application/service.ts +79 -1
  109. package/src/application/shell-sequence.ts +1 -1
  110. package/src/application/terminals.ts +2 -1
  111. package/src/application/thread-commands.ts +1 -1
  112. package/src/application/thread-update.ts +1 -1
  113. package/src/application/thread-wait.ts +1 -1
  114. package/src/application/threads.test.ts +9 -3
  115. package/src/application/threads.ts +6 -6
  116. package/src/auth/error.ts +2 -1
  117. package/src/auth/index.ts +7 -0
  118. package/src/auth/layer.test-utils.ts +34 -0
  119. package/src/auth/layer.ts +116 -34
  120. package/src/auth/local-base-dir.ts +13 -6
  121. package/src/auth/local-origin.ts +10 -7
  122. package/src/auth/local-token.ts +28 -23
  123. package/src/auth/service.test.ts +200 -0
  124. package/src/auth/service.ts +27 -3
  125. package/src/auth/transport.ts +2 -2
  126. package/src/auth/type.ts +47 -1
  127. package/src/bin.ts +24 -6
  128. package/src/cli/action-format.ts +110 -0
  129. package/src/cli/action.ts +398 -0
  130. package/src/cli/app.ts +6 -0
  131. package/src/cli/auth.ts +76 -23
  132. package/src/cli/env/flag.ts +8 -0
  133. package/src/cli/env/index.ts +2 -0
  134. package/src/cli/env/selection-layer.test.ts +49 -0
  135. package/src/cli/env/selection-layer.ts +27 -0
  136. package/src/cli/env.ts +107 -0
  137. package/src/cli/extra-args.test.ts +32 -0
  138. package/src/cli/extra-args.ts +22 -0
  139. package/src/cli/flags.ts +11 -1
  140. package/src/cli/format/auth.ts +92 -0
  141. package/src/cli/format/human.ts +131 -0
  142. package/src/cli/format/index.ts +12 -0
  143. package/src/cli/format/model.ts +29 -0
  144. package/src/cli/format/output.ts +51 -0
  145. package/src/cli/format/project.ts +32 -0
  146. package/src/cli/format/terminal.ts +87 -0
  147. package/src/cli/{thread-format.test.ts → format/thread.test.ts} +6 -4
  148. package/src/cli/format/thread.ts +185 -0
  149. package/src/cli/index.ts +20 -0
  150. package/src/cli/interaction/confirm.ts +64 -0
  151. package/src/cli/{self-action.ts → interaction/self-action.ts} +8 -6
  152. package/src/cli/message-input.ts +1 -1
  153. package/src/cli/model.ts +9 -5
  154. package/src/cli/project.ts +13 -7
  155. package/src/cli/projects/delete.ts +13 -12
  156. package/src/cli/require.ts +9 -7
  157. package/src/cli/runtime/index.ts +1 -0
  158. package/src/cli/runtime/service.ts +28 -0
  159. package/src/{scope → cli/scope}/resolve.ts +11 -9
  160. package/src/cli/terminal/attach.ts +3 -6
  161. package/src/cli/terminal/create.ts +10 -9
  162. package/src/cli/terminal/destroy.ts +13 -11
  163. package/src/cli/terminal/list.ts +10 -9
  164. package/src/cli/terminal/read.test-utils.ts +48 -0
  165. package/src/cli/terminal/read.test.ts +35 -0
  166. package/src/cli/terminal/read.ts +3 -6
  167. package/src/cli/terminal/scope.ts +10 -5
  168. package/src/cli/terminal/shared.ts +1 -1
  169. package/src/cli/terminal/stream.ts +3 -6
  170. package/src/cli/terminal/wait.test.ts +5 -3
  171. package/src/cli/terminal/wait.ts +10 -9
  172. package/src/cli/terminal/write.test.ts +34 -0
  173. package/src/cli/terminal/write.ts +10 -9
  174. package/src/cli/threads/approve.ts +11 -7
  175. package/src/cli/threads/archive.ts +14 -9
  176. package/src/cli/threads/callback.ts +6 -4
  177. package/src/cli/threads/delete.ts +17 -11
  178. package/src/cli/threads/interrupt.ts +14 -9
  179. package/src/cli/threads/list.test.ts +5 -3
  180. package/src/cli/threads/list.ts +10 -10
  181. package/src/cli/threads/messages.ts +11 -7
  182. package/src/cli/threads/respond.ts +11 -7
  183. package/src/cli/threads/send.ts +19 -9
  184. package/src/cli/threads/show.ts +11 -7
  185. package/src/cli/threads/start.ts +18 -13
  186. package/src/cli/threads/unarchive.ts +11 -7
  187. package/src/cli/threads/update.ts +14 -9
  188. package/src/cli/threads/wait.ts +11 -7
  189. package/src/cli/wait-events.ts +1 -1
  190. package/src/config/config.ts +260 -0
  191. package/src/config/credential/cipher-node.ts +40 -0
  192. package/src/config/credential/cipher-web.ts +82 -0
  193. package/src/config/credential/cipher.ts +39 -0
  194. package/src/config/credential/env.ts +13 -0
  195. package/src/config/credential/error.ts +9 -0
  196. package/src/config/credential/index.ts +6 -0
  197. package/src/config/credential/service.test-utils.ts +25 -0
  198. package/src/config/credential/service.test.ts +116 -0
  199. package/src/config/credential/service.ts +205 -0
  200. package/src/config/env/env.test-utils.ts +14 -0
  201. package/src/config/env/env.ts +81 -0
  202. package/src/config/env/index.ts +2 -0
  203. package/src/{layout/base-dir.ts → config/env/layout.ts} +0 -9
  204. package/src/config/environment-name/index.ts +7 -0
  205. package/src/config/environment-name/name.test.ts +66 -0
  206. package/src/config/environment-name/name.ts +49 -0
  207. package/src/config/error.ts +6 -8
  208. package/src/config/index.ts +16 -5
  209. package/src/config/keystore/error.ts +9 -0
  210. package/src/config/keystore/file.ts +96 -0
  211. package/src/config/keystore/index.ts +4 -0
  212. package/src/config/keystore/keyring-node.test.ts +12 -0
  213. package/src/config/keystore/keyring-node.ts +100 -0
  214. package/src/config/keystore/service.test-utils.ts +15 -0
  215. package/src/config/keystore/service.test.ts +18 -0
  216. package/src/config/keystore/service.ts +29 -0
  217. package/src/config/layer.test-utils.ts +45 -0
  218. package/src/config/layer.test.ts +209 -0
  219. package/src/config/paths/index.ts +1 -0
  220. package/src/config/paths/paths.ts +36 -0
  221. package/src/config/persist/file-mode.ts +21 -0
  222. package/src/config/persist/migration.test.ts +71 -0
  223. package/src/config/persist/migration.ts +82 -0
  224. package/src/config/persist/persist.test.ts +113 -0
  225. package/src/config/persist/persist.ts +65 -0
  226. package/src/config/persist/schema.ts +37 -0
  227. package/src/config/platform.test-utils.ts +20 -0
  228. package/src/config/resolve/resolve.test-utils.ts +20 -0
  229. package/src/config/resolve/resolve.test.ts +137 -0
  230. package/src/config/resolve/resolve.ts +104 -0
  231. package/src/config/selection/index.ts +1 -0
  232. package/src/config/selection/resolve.ts +14 -0
  233. package/src/config/selection/service.ts +29 -0
  234. package/src/config/temp-home.test-utils.ts +7 -0
  235. package/src/config/types.ts +49 -0
  236. package/src/config/url/error.ts +8 -0
  237. package/src/config/url/index.ts +7 -0
  238. package/src/config/url/url.test.ts +31 -0
  239. package/src/connection/index.ts +0 -1
  240. package/src/contracts/index.ts +1 -1
  241. package/src/domain/error.ts +20 -1
  242. package/src/domain/helpers.test.ts +1 -1
  243. package/src/domain/helpers.ts +1 -1
  244. package/src/domain/model-config.ts +1 -1
  245. package/src/domain/thread-activities.test.ts +1 -1
  246. package/src/domain/thread-activities.ts +1 -1
  247. package/src/domain/thread-lifecycle.test.ts +1 -1
  248. package/src/domain/thread-lifecycle.ts +1 -1
  249. package/src/effect.test-utils.ts +25 -0
  250. package/src/index.ts +1 -1
  251. package/src/{connection/node.ts → node/connection.ts} +1 -1
  252. package/src/node/index.ts +1 -2
  253. package/src/orchestration/index.ts +0 -1
  254. package/src/orchestration/layer.ts +1 -1
  255. package/src/orchestration/service.ts +1 -1
  256. package/src/rpc/error.ts +2 -2
  257. package/src/rpc/index.ts +2 -3
  258. package/src/rpc/layer.ts +1 -1
  259. package/src/rpc/ws-group.ts +1 -1
  260. package/src/runtime/index.ts +2 -1
  261. package/src/runtime/layer.test-utils.ts +32 -0
  262. package/src/runtime/layer.test.ts +66 -0
  263. package/src/runtime/layer.ts +15 -9
  264. package/src/t3tools/index.ts +1 -1
  265. package/src/types/marked-terminal.d.ts +11 -0
  266. package/dist/layout.js +0 -2
  267. package/dist/scope.js +0 -2
  268. package/dist/src/cli/output-format.d.ts +0 -11
  269. package/dist/src/config/layer.d.ts +0 -22
  270. package/dist/src/config/service.d.ts +0 -22
  271. package/dist/src/environment/layer.d.ts +0 -3
  272. package/dist/src/environment/service.d.ts +0 -12
  273. package/dist/src/layout/index.d.ts +0 -1
  274. package/dist/upstream-t3code/packages/contracts/src/auth.d.ts +0 -441
  275. package/dist/upstream-t3code/packages/contracts/src/baseSchemas.d.ts +0 -38
  276. package/dist/upstream-t3code/packages/contracts/src/desktopBootstrap.d.ts +0 -14
  277. package/dist/upstream-t3code/packages/contracts/src/editor.d.ts +0 -124
  278. package/dist/upstream-t3code/packages/contracts/src/environment.d.ts +0 -64
  279. package/dist/upstream-t3code/packages/contracts/src/environmentHttp.d.ts +0 -762
  280. package/dist/upstream-t3code/packages/contracts/src/filesystem.d.ts +0 -26
  281. package/dist/upstream-t3code/packages/contracts/src/git.d.ts +0 -500
  282. package/dist/upstream-t3code/packages/contracts/src/index.d.ts +0 -25
  283. package/dist/upstream-t3code/packages/contracts/src/ipc.d.ts +0 -490
  284. package/dist/upstream-t3code/packages/contracts/src/keybindings.d.ts +0 -133
  285. package/dist/upstream-t3code/packages/contracts/src/model.d.ts +0 -112
  286. package/dist/upstream-t3code/packages/contracts/src/orchestration.d.ts +0 -6682
  287. package/dist/upstream-t3code/packages/contracts/src/project.d.ts +0 -45
  288. package/dist/upstream-t3code/packages/contracts/src/provider.d.ts +0 -116
  289. package/dist/upstream-t3code/packages/contracts/src/providerInstance.d.ts +0 -99
  290. package/dist/upstream-t3code/packages/contracts/src/providerRuntime.d.ts +0 -4276
  291. package/dist/upstream-t3code/packages/contracts/src/relay.d.ts +0 -1262
  292. package/dist/upstream-t3code/packages/contracts/src/relayClient.d.ts +0 -48
  293. package/dist/upstream-t3code/packages/contracts/src/remoteAccess.d.ts +0 -45
  294. package/dist/upstream-t3code/packages/contracts/src/review.d.ts +0 -37
  295. package/dist/upstream-t3code/packages/contracts/src/rpc.d.ts +0 -8218
  296. package/dist/upstream-t3code/packages/contracts/src/server.d.ts +0 -2291
  297. package/dist/upstream-t3code/packages/contracts/src/settings.d.ts +0 -271
  298. package/dist/upstream-t3code/packages/contracts/src/sourceControl.d.ts +0 -177
  299. package/dist/upstream-t3code/packages/contracts/src/terminal.d.ts +0 -330
  300. package/dist/upstream-t3code/packages/contracts/src/vcs.d.ts +0 -148
  301. package/src/cli/auth-format.ts +0 -45
  302. package/src/cli/confirm.ts +0 -31
  303. package/src/cli/model-format.ts +0 -18
  304. package/src/cli/output-format.ts +0 -45
  305. package/src/cli/project-format.ts +0 -18
  306. package/src/cli/terminal/commands.test.ts +0 -101
  307. package/src/cli/terminal-format.ts +0 -167
  308. package/src/cli/thread-format.ts +0 -128
  309. package/src/config/layer.ts +0 -105
  310. package/src/config/service.ts +0 -26
  311. package/src/environment/layer.ts +0 -12
  312. package/src/environment/service.ts +0 -13
  313. package/src/layout/index.ts +0 -1
  314. /package/dist/src/{scope → cli/scope}/index.d.ts +0 -0
  315. /package/dist/src/config/{url.d.ts → url/url.d.ts} +0 -0
  316. /package/src/{scope → cli/scope}/index.ts +0 -0
  317. /package/src/config/{url.ts → url/url.ts} +0 -0
@@ -0,0 +1 @@
1
+ export { resolveConfigFilePath, resolveKeyFilePath, resolveT3cliConfigDir } from "./paths.ts";
@@ -0,0 +1,6 @@
1
+ import * as Effect from "effect/Effect";
2
+ import * as Path from "effect/Path";
3
+ import { ConfigError } from "../error.ts";
4
+ export declare const resolveT3cliConfigDir: () => Effect.Effect<string, ConfigError, Path.Path>;
5
+ export declare const resolveConfigFilePath: () => Effect.Effect<string, ConfigError, Path.Path>;
6
+ export declare const resolveKeyFilePath: () => Effect.Effect<string, ConfigError, Path.Path>;
@@ -0,0 +1,4 @@
1
+ import * as Effect from "effect/Effect";
2
+ import * as FileSystem from "effect/FileSystem";
3
+ import { ConfigError } from "../error.ts";
4
+ export declare const hardenPrivateFileMode: (filePath: string, label: "config" | "credential key") => Effect.Effect<void, ConfigError, FileSystem.FileSystem>;
@@ -0,0 +1,68 @@
1
+ import * as Effect from "effect/Effect";
2
+ import { T3CredentialCrypto } from "../credential/service.ts";
3
+ import { ConfigError } from "../error.ts";
4
+ import type { EncryptedConfig } from "../types.ts";
5
+ export declare const emptyEncryptedConfig: () => EncryptedConfig;
6
+ export declare const readEncryptedConfigFromValue: (value: unknown) => Effect.Effect<{
7
+ config: {
8
+ readonly version: 2;
9
+ readonly environments: {
10
+ readonly [x: string]: {
11
+ readonly url: string;
12
+ readonly local: boolean;
13
+ readonly token: {
14
+ readonly kind: "encrypted";
15
+ readonly alg: "aes-256-gcm";
16
+ readonly key: "default";
17
+ readonly nonce: string;
18
+ readonly ciphertext: string;
19
+ readonly tag: string;
20
+ };
21
+ };
22
+ };
23
+ readonly default?: string;
24
+ };
25
+ migratedFromV1: false;
26
+ } | {
27
+ config: {
28
+ readonly version: 2;
29
+ readonly environments: {
30
+ readonly [x: string]: {
31
+ readonly url: string;
32
+ readonly local: boolean;
33
+ readonly token: {
34
+ readonly kind: "encrypted";
35
+ readonly alg: "aes-256-gcm";
36
+ readonly key: "default";
37
+ readonly nonce: string;
38
+ readonly ciphertext: string;
39
+ readonly tag: string;
40
+ };
41
+ };
42
+ };
43
+ readonly default?: string;
44
+ };
45
+ migratedFromV1: true;
46
+ }, ConfigError, T3CredentialCrypto>;
47
+ export declare const migrateV1FileToEncrypted: (config: {
48
+ readonly url?: string;
49
+ readonly token?: string;
50
+ readonly local?: boolean;
51
+ }) => Effect.Effect<{
52
+ readonly version: 2;
53
+ readonly environments: {
54
+ readonly [x: string]: {
55
+ readonly url: string;
56
+ readonly local: boolean;
57
+ readonly token: {
58
+ readonly kind: "encrypted";
59
+ readonly alg: "aes-256-gcm";
60
+ readonly key: "default";
61
+ readonly nonce: string;
62
+ readonly ciphertext: string;
63
+ readonly tag: string;
64
+ };
65
+ };
66
+ };
67
+ readonly default?: string;
68
+ }, ConfigError, T3CredentialCrypto>;
@@ -0,0 +1,40 @@
1
+ import * as Effect from "effect/Effect";
2
+ import * as FileSystem from "effect/FileSystem";
3
+ import * as Path from "effect/Path";
4
+ import { ConfigError } from "../error.ts";
5
+ export declare const readEncryptedConfigFile: () => Effect.Effect<{
6
+ readonly version: 2;
7
+ readonly environments: {
8
+ readonly [x: string]: {
9
+ readonly url: string;
10
+ readonly local: boolean;
11
+ readonly token: {
12
+ readonly kind: "encrypted";
13
+ readonly alg: "aes-256-gcm";
14
+ readonly key: "default";
15
+ readonly nonce: string;
16
+ readonly ciphertext: string;
17
+ readonly tag: string;
18
+ };
19
+ };
20
+ };
21
+ readonly default?: string;
22
+ }, ConfigError, Path.Path | FileSystem.FileSystem | import("../credential/service.ts").T3CredentialCrypto>;
23
+ export declare const writeEncryptedConfigFile: (config: {
24
+ readonly version: 2;
25
+ readonly environments: {
26
+ readonly [x: string]: {
27
+ readonly url: string;
28
+ readonly local: boolean;
29
+ readonly token: {
30
+ readonly kind: "encrypted";
31
+ readonly alg: "aes-256-gcm";
32
+ readonly key: "default";
33
+ readonly nonce: string;
34
+ readonly ciphertext: string;
35
+ readonly tag: string;
36
+ };
37
+ };
38
+ };
39
+ readonly default?: string;
40
+ }) => Effect.Effect<void, ConfigError, Path.Path | FileSystem.FileSystem>;
@@ -0,0 +1,68 @@
1
+ import * as Schema from "effect/Schema";
2
+ export declare const EncryptedTokenSchema: Schema.Struct<{
3
+ readonly kind: Schema.Literal<"encrypted">;
4
+ readonly alg: Schema.Literal<"aes-256-gcm">;
5
+ readonly key: Schema.Literal<"default">;
6
+ readonly nonce: Schema.String;
7
+ readonly ciphertext: Schema.String;
8
+ readonly tag: Schema.String;
9
+ }>;
10
+ export declare const StoredEnvironmentFileSchema: Schema.Struct<{
11
+ readonly url: Schema.String;
12
+ readonly local: Schema.Boolean;
13
+ readonly token: Schema.Struct<{
14
+ readonly kind: Schema.Literal<"encrypted">;
15
+ readonly alg: Schema.Literal<"aes-256-gcm">;
16
+ readonly key: Schema.Literal<"default">;
17
+ readonly nonce: Schema.String;
18
+ readonly ciphertext: Schema.String;
19
+ readonly tag: Schema.String;
20
+ }>;
21
+ }>;
22
+ export declare const StoredConfigV2FileSchema: Schema.Struct<{
23
+ readonly version: Schema.Literal<2>;
24
+ readonly default: Schema.optionalKey<Schema.String>;
25
+ readonly environments: Schema.$Record<Schema.String, Schema.Struct<{
26
+ readonly url: Schema.String;
27
+ readonly local: Schema.Boolean;
28
+ readonly token: Schema.Struct<{
29
+ readonly kind: Schema.Literal<"encrypted">;
30
+ readonly alg: Schema.Literal<"aes-256-gcm">;
31
+ readonly key: Schema.Literal<"default">;
32
+ readonly nonce: Schema.String;
33
+ readonly ciphertext: Schema.String;
34
+ readonly tag: Schema.String;
35
+ }>;
36
+ }>>;
37
+ }>;
38
+ export declare const StoredConfigV1FileSchema: Schema.Struct<{
39
+ readonly url: Schema.optionalKey<Schema.String>;
40
+ readonly token: Schema.optionalKey<Schema.String>;
41
+ readonly local: Schema.optionalKey<Schema.Boolean>;
42
+ }>;
43
+ export type EncryptedToken = Schema.Schema.Type<typeof EncryptedTokenSchema>;
44
+ export type StoredEnvironmentFile = Schema.Schema.Type<typeof StoredEnvironmentFileSchema>;
45
+ export type StoredConfigV2File = Schema.Schema.Type<typeof StoredConfigV2FileSchema>;
46
+ export type StoredConfigV1File = Schema.Schema.Type<typeof StoredConfigV1FileSchema>;
47
+ export declare const StoredConfigV1FileJson: Schema.fromJsonString<Schema.Struct<{
48
+ readonly url: Schema.optionalKey<Schema.String>;
49
+ readonly token: Schema.optionalKey<Schema.String>;
50
+ readonly local: Schema.optionalKey<Schema.Boolean>;
51
+ }>>;
52
+ export declare const StoredConfigV2FileJson: Schema.fromJsonString<Schema.Struct<{
53
+ readonly version: Schema.Literal<2>;
54
+ readonly default: Schema.optionalKey<Schema.String>;
55
+ readonly environments: Schema.$Record<Schema.String, Schema.Struct<{
56
+ readonly url: Schema.String;
57
+ readonly local: Schema.Boolean;
58
+ readonly token: Schema.Struct<{
59
+ readonly kind: Schema.Literal<"encrypted">;
60
+ readonly alg: Schema.Literal<"aes-256-gcm">;
61
+ readonly key: Schema.Literal<"default">;
62
+ readonly nonce: Schema.String;
63
+ readonly ciphertext: Schema.String;
64
+ readonly tag: Schema.String;
65
+ }>;
66
+ }>>;
67
+ }>>;
68
+ export declare const UnknownConfigFileJson: Schema.UnknownFromJsonString;
@@ -0,0 +1,40 @@
1
+ import * as Effect from "effect/Effect";
2
+ import { ConfigError } from "../error.ts";
3
+ import type { EncryptedConfig } from "../types.ts";
4
+ export type ResolveSelectionInput = {
5
+ readonly selectedEnvironment?: string | undefined;
6
+ readonly defaultEnvironment?: string | undefined;
7
+ };
8
+ export declare function selectEnvironmentName(input: ResolveSelectionInput): string | undefined;
9
+ export type ResolveCredentialInput = {
10
+ readonly envUrl?: string | undefined;
11
+ readonly envToken?: string | undefined;
12
+ };
13
+ export declare function validateCredentialEnvVars(input: ResolveCredentialInput): Effect.Effect<void, never, never> | Effect.Effect<never, ConfigError, never>;
14
+ export declare function resolveDefaultForUpsert(encrypted: EncryptedConfig, environmentName: string, makeDefault?: boolean): string | undefined;
15
+ export declare function summarizeEnvironments(encrypted: EncryptedConfig): {
16
+ name: string;
17
+ url: string;
18
+ local: boolean;
19
+ default: boolean;
20
+ }[];
21
+ export declare function buildResolvedConfigFromEnv(input: {
22
+ readonly envUrl: string;
23
+ readonly envToken: string;
24
+ }): Effect.Effect<{
25
+ url: string;
26
+ token: string;
27
+ source: "env";
28
+ local: false;
29
+ }, ConfigError, never>;
30
+ export declare function buildResolvedConfigFromStored(input: {
31
+ readonly selectedName: string;
32
+ readonly token: string;
33
+ readonly encrypted: EncryptedConfig;
34
+ }): Effect.Effect<{
35
+ url: string;
36
+ token: string;
37
+ source: "config";
38
+ local: boolean;
39
+ environment: string;
40
+ }, ConfigError, never>;
@@ -0,0 +1 @@
1
+ export * as Service from "./service.ts";
@@ -0,0 +1,4 @@
1
+ export declare function resolveConfiguredEnvironment(input: {
2
+ readonly cliFlag?: string | undefined;
3
+ readonly t3cliEnv?: string | undefined;
4
+ }): string | undefined;
@@ -0,0 +1,10 @@
1
+ import * as Context from "effect/Context";
2
+ import * as Effect from "effect/Effect";
3
+ import * as Layer from "effect/Layer";
4
+ declare const T3ConfigSelection_base: Context.ServiceClass<T3ConfigSelection, "t3cli/T3ConfigSelection", {
5
+ readonly getSelectedEnvironment: () => Effect.Effect<string | undefined>;
6
+ }>;
7
+ export declare class T3ConfigSelection extends T3ConfigSelection_base {
8
+ }
9
+ export declare const layer: Layer.Layer<T3ConfigSelection, import("effect/Config").ConfigError, never>;
10
+ export {};
@@ -0,0 +1,36 @@
1
+ import type { EncryptedToken, StoredConfigV2File, StoredEnvironmentFile } from "./persist/schema.ts";
2
+ export type EncryptedEnvironment = StoredEnvironmentFile;
3
+ export type EncryptedConfig = StoredConfigV2File;
4
+ export type DecryptedEnvironment = {
5
+ readonly url: string;
6
+ readonly local: boolean;
7
+ readonly token: string;
8
+ };
9
+ export type DecryptedConfig = {
10
+ readonly version: 2;
11
+ readonly default?: string;
12
+ readonly environments: Readonly<Record<string, DecryptedEnvironment>>;
13
+ };
14
+ export type EnvironmentSummary = {
15
+ readonly name: string;
16
+ readonly url: string;
17
+ readonly local: boolean;
18
+ readonly default: boolean;
19
+ };
20
+ export type ResolvedConfig = {
21
+ readonly url: string;
22
+ readonly token: string;
23
+ readonly source: "env" | "config";
24
+ readonly local: boolean;
25
+ readonly environment?: string;
26
+ };
27
+ export type UpsertEnvironmentInput = {
28
+ readonly name: string;
29
+ readonly url: string;
30
+ readonly token: string;
31
+ readonly local: boolean;
32
+ readonly makeDefault?: boolean;
33
+ };
34
+ export type StoredConfig = DecryptedConfig;
35
+ export type StoredEnvironment = DecryptedEnvironment;
36
+ export type { EncryptedToken };
@@ -0,0 +1,10 @@
1
+ import * as Cause from "effect/Cause";
2
+ import * as Schema from "effect/Schema";
3
+ declare const UrlError_base: Schema.Class<UrlError, Schema.TaggedStruct<"UrlError", {
4
+ readonly message: Schema.String;
5
+ readonly protocol: Schema.optionalKey<Schema.String>;
6
+ readonly cause: Schema.optionalKey<Schema.instanceOf<Cause.IllegalArgumentError, Cause.IllegalArgumentError>>;
7
+ }>, Cause.YieldableError>;
8
+ export declare class UrlError extends UrlError_base {
9
+ }
10
+ export {};
@@ -0,0 +1,2 @@
1
+ export { normalizeHttpBaseUrl, toWebSocketBaseUrl, toHttpEndpointUrl, toWebSocketEndpointUrl, } from "./url.ts";
2
+ export { UrlError } from "./error.ts";
@@ -1,5 +1,4 @@
1
1
  export { T3CodeConnectionError } from "./error.ts";
2
2
  export { T3CodeRpcLayer, makeT3CodeRpcLayer } from "./layer.ts";
3
- export { T3CodeNodeRpcLayer } from "./node.ts";
4
3
  export { T3CodeConnectionProvider, T3CodeConnectionProviderLive, makeT3CodeConnectionProvider, } from "./service.ts";
5
4
  export type { T3CodeAuth, T3CodeConnection, T3CodeOrigin } from "./type.ts";
@@ -1 +1 @@
1
- export type { OrchestrationMessage, OrchestrationProjectShell, OrchestrationShellSnapshot, OrchestrationThread, OrchestrationThreadShell, ServerProvider, } from "#t3tools/contracts";
1
+ export type { OrchestrationMessage, OrchestrationProjectShell, OrchestrationShellSnapshot, OrchestrationThread, OrchestrationThreadShell, ServerProvider, } from "@t3tools/contracts";
@@ -40,5 +40,18 @@ declare const TerminalLookupError_base: Schema.Class<TerminalLookupError, Schema
40
40
  }>, import("effect/Cause").YieldableError>;
41
41
  export declare class TerminalLookupError extends TerminalLookupError_base {
42
42
  }
43
- export type DomainError = ProjectLookupError | ModelSelectionError | ThreadEventError | ThreadSessionError | ThreadLookupError | ProjectCreateVisibilityError | TerminalLookupError;
43
+ declare const ProjectActionLookupError_base: Schema.Class<ProjectActionLookupError, Schema.TaggedStruct<"ProjectActionLookupError", {
44
+ readonly message: Schema.String;
45
+ readonly projectId: Schema.String;
46
+ readonly selector: Schema.String;
47
+ }>, import("effect/Cause").YieldableError>;
48
+ export declare class ProjectActionLookupError extends ProjectActionLookupError_base {
49
+ }
50
+ declare const ProjectActionValidationError_base: Schema.Class<ProjectActionValidationError, Schema.TaggedStruct<"ProjectActionValidationError", {
51
+ readonly message: Schema.String;
52
+ readonly projectId: Schema.String;
53
+ }>, import("effect/Cause").YieldableError>;
54
+ export declare class ProjectActionValidationError extends ProjectActionValidationError_base {
55
+ }
56
+ export type DomainError = ProjectLookupError | ModelSelectionError | ThreadEventError | ThreadSessionError | ThreadLookupError | ProjectCreateVisibilityError | TerminalLookupError | ProjectActionLookupError | ProjectActionValidationError;
44
57
  export {};
@@ -1,6 +1,6 @@
1
1
  import * as Effect from "effect/Effect";
2
2
  import * as Path from "effect/Path";
3
- import type { OrchestrationProjectShell, OrchestrationShellSnapshot } from "#t3tools/contracts";
3
+ import type { OrchestrationProjectShell, OrchestrationShellSnapshot } from "@t3tools/contracts";
4
4
  export type ResolvedProjectScope = {
5
5
  readonly project: OrchestrationProjectShell;
6
6
  readonly inferredWorktreePath?: string;
@@ -25,6 +25,8 @@ export declare const resolveProjectScope: (snapshot: {
25
25
  readonly command: string;
26
26
  readonly icon: "play" | "test" | "lint" | "configure" | "build" | "debug";
27
27
  readonly runOnWorktreeCreate: boolean;
28
+ readonly previewUrl?: string | undefined;
29
+ readonly autoOpenPreview?: boolean | undefined;
28
30
  }[];
29
31
  readonly createdAt: string;
30
32
  readonly updatedAt: string;
@@ -83,6 +85,15 @@ export declare const resolveProjectScope: (snapshot: {
83
85
  readonly updatedAt: string;
84
86
  readonly providerInstanceId?: (string & import("effect/Brand").Brand<"ProviderInstanceId">) | undefined;
85
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
+ } | null;
86
97
  readonly latestUserMessageAt: string | null;
87
98
  readonly hasPendingApprovals: boolean;
88
99
  readonly hasPendingUserInput: boolean;
@@ -110,6 +121,8 @@ export declare const resolveProjectScope: (snapshot: {
110
121
  readonly command: string;
111
122
  readonly icon: "play" | "test" | "lint" | "configure" | "build" | "debug";
112
123
  readonly runOnWorktreeCreate: boolean;
124
+ readonly previewUrl?: string | undefined;
125
+ readonly autoOpenPreview?: boolean | undefined;
113
126
  }[];
114
127
  readonly createdAt: string;
115
128
  readonly updatedAt: string;
@@ -147,6 +160,8 @@ export declare const resolveProjectScope: (snapshot: {
147
160
  readonly command: string;
148
161
  readonly icon: "play" | "test" | "lint" | "configure" | "build" | "debug";
149
162
  readonly runOnWorktreeCreate: boolean;
163
+ readonly previewUrl?: string | undefined;
164
+ readonly autoOpenPreview?: boolean | undefined;
150
165
  }[];
151
166
  readonly createdAt: string;
152
167
  readonly updatedAt: string;
@@ -1,4 +1,4 @@
1
- import type { ServerProvider } from "#t3tools/contracts";
1
+ import type { ServerProvider } from "@t3tools/contracts";
2
2
  export declare function isSelectableProvider(provider: ServerProvider): boolean;
3
3
  export declare function firstSelectableProvider(providers: ReadonlyArray<ServerProvider>): {
4
4
  readonly instanceId: string & import("effect/Brand").Brand<"ProviderInstanceId">;
@@ -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;
@@ -210,6 +211,7 @@ export declare function findSelectableProvider(providers: ReadonlyArray<ServerPr
210
211
  readonly groupKey: string;
211
212
  } | undefined;
212
213
  readonly showInteractionModeToggle?: boolean | undefined;
214
+ readonly requiresNewThreadForModelChange?: boolean | undefined;
213
215
  readonly message?: string | undefined;
214
216
  readonly availability?: "available" | "unavailable" | undefined;
215
217
  readonly unavailableReason?: string | undefined;
@@ -300,6 +302,7 @@ export declare function filterProvidersForModelListing(input: {
300
302
  readonly groupKey: string;
301
303
  } | undefined;
302
304
  readonly showInteractionModeToggle?: boolean | undefined;
305
+ readonly requiresNewThreadForModelChange?: boolean | undefined;
303
306
  readonly message?: string | undefined;
304
307
  readonly availability?: "available" | "unavailable" | undefined;
305
308
  readonly unavailableReason?: string | undefined;
@@ -1,4 +1,4 @@
1
- import { ApprovalRequestId, type OrchestrationThreadActivity, type UserInputQuestion } from "#t3tools/contracts";
1
+ import { ApprovalRequestId, type OrchestrationThreadActivity, type UserInputQuestion } from "@t3tools/contracts";
2
2
  export type PendingApproval = {
3
3
  readonly requestId: ApprovalRequestId;
4
4
  readonly requestKind: "command" | "file-read" | "file-change";
@@ -1,4 +1,4 @@
1
- import { type OrchestrationEvent, type OrchestrationMessage as OrchestrationMessageType, type OrchestrationSession, type OrchestrationThread, type OrchestrationThreadShell } from "#t3tools/contracts";
1
+ import { type OrchestrationEvent, type OrchestrationMessage as OrchestrationMessageType, type OrchestrationSession, type OrchestrationThread, type OrchestrationThreadShell } from "@t3tools/contracts";
2
2
  export declare function sessionNeedsStopBeforeDelete(session: OrchestrationSession | null): boolean;
3
3
  export declare function isThreadActive(thread: OrchestrationThreadShell | OrchestrationThread): boolean;
4
4
  export type ThreadLifecycleStatus = ReturnType<typeof threadStatus>;
@@ -52,6 +52,15 @@ export declare function applyThreadEvent(current: OrchestrationThread, event: Or
52
52
  readonly updatedAt: string;
53
53
  readonly archivedAt: string | null;
54
54
  readonly deletedAt: string | null;
55
+ readonly goal: {
56
+ readonly objective: string;
57
+ readonly status: "active" | "paused" | "blocked" | "usageLimited" | "budgetLimited" | "complete";
58
+ readonly tokensUsed: number;
59
+ readonly tokenBudget: number | null;
60
+ readonly timeUsedSeconds: number;
61
+ readonly createdAt: string;
62
+ readonly updatedAt: string;
63
+ } | null;
55
64
  readonly messages: readonly {
56
65
  readonly id: string & import("effect/Brand").Brand<"MessageId">;
57
66
  readonly role: "user" | "assistant" | "system";
@@ -1,4 +1,3 @@
1
1
  export { T3Application } from "./application/index.ts";
2
- export type { SendThreadInput, StartThreadInput, StartThreadPolicy, WaitEvent, } from "./application/index.ts";
3
- export type { ApplicationError } from "./application/index.ts";
2
+ export type { SendThreadInput, StartThreadInput, StartThreadPolicy, WaitEvent, ApplicationError, } from "./application/index.ts";
4
3
  export { AppLayer, AuthAppLayer } from "./runtime/index.ts";
@@ -1,2 +1,2 @@
1
1
  import * as Layer from "effect/Layer";
2
- export declare const T3CodeNodeRpcLayer: Layer.Layer<import("../rpc/service.ts").T3Rpc, never, import("./service.ts").T3CodeConnectionProvider>;
2
+ export declare const T3CodeNodeRpcLayer: Layer.Layer<import("../rpc/service.ts").T3Rpc, never, import("../connection/service.ts").T3CodeConnectionProvider>;
@@ -1,2 +1 @@
1
- export { T3CodeNodeRpcLayer } from "../connection/node.ts";
2
- export { NodeEnvironmentLive } from "../environment/layer.ts";
1
+ export { T3CodeNodeRpcLayer } from "./connection.ts";
@@ -1,3 +1,2 @@
1
1
  export { T3Orchestration, type OpenThread, type Orchestration, type OrchestrationError, } from "./service.ts";
2
2
  export { makeT3Orchestration, T3OrchestrationLive } from "./layer.ts";
3
- export { T3OrchestrationLayer } from "../runtime/layer.ts";