t3code-cli 0.9.1 → 0.11.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 (126) hide show
  1. package/README.md +52 -14
  2. package/dist/application.js +2 -2
  3. package/dist/auth.js +1 -1
  4. package/dist/bin.js +1556 -341
  5. package/dist/cli.js +1 -1
  6. package/dist/config.js +1 -1
  7. package/dist/connection.js +1 -11
  8. package/dist/index.js +1 -1
  9. package/dist/layout.js +1 -1
  10. package/dist/node.js +2 -0
  11. package/dist/orchestration.js +2 -2
  12. package/dist/rpc.js +2 -2
  13. package/dist/runtime.js +1 -1
  14. package/dist/scope.js +1 -1
  15. package/dist/shared.js +1734 -756
  16. package/dist/src/application/index.d.ts +3 -2
  17. package/dist/src/application/layer.d.ts +82 -841
  18. package/dist/src/application/model-selection.d.ts +15 -0
  19. package/dist/src/application/models.d.ts +1 -87
  20. package/dist/src/application/project-commands.d.ts +9 -0
  21. package/dist/src/application/projects.d.ts +13 -135
  22. package/dist/src/application/service.d.ts +84 -5
  23. package/dist/src/application/shell-sequence.d.ts +2 -12
  24. package/dist/src/application/terminals.d.ts +66 -0
  25. package/dist/src/application/thread-commands.d.ts +47 -0
  26. package/dist/src/application/thread-update.d.ts +8 -0
  27. package/dist/src/application/thread-wait.d.ts +3 -14
  28. package/dist/src/application/threads.d.ts +21 -50
  29. package/dist/src/cli/flags.d.ts +3 -0
  30. package/dist/src/cli/output-format.d.ts +2 -0
  31. package/dist/src/domain/error.d.ts +14 -1
  32. package/dist/src/domain/helpers.d.ts +0 -9
  33. package/dist/src/domain/model-config.d.ts +29 -3
  34. package/dist/src/domain/thread-lifecycle.d.ts +2 -10
  35. package/dist/src/node/index.d.ts +2 -0
  36. package/dist/src/orchestration/index.d.ts +1 -0
  37. package/dist/src/orchestration/layer.d.ts +177 -1032
  38. package/dist/src/orchestration/service.d.ts +1 -0
  39. package/dist/src/rpc/error.d.ts +4 -2
  40. package/dist/src/rpc/index.d.ts +5 -0
  41. package/dist/src/rpc/layer.d.ts +1097 -499
  42. package/dist/src/rpc/operation.d.ts +5752 -0
  43. package/dist/src/rpc/ws-group.d.ts +327 -147
  44. package/dist/src/runtime/layer.d.ts +1 -1
  45. package/dist/t3tools.js +2 -2
  46. package/dist/upstream-t3code/packages/contracts/src/environmentHttp.d.ts +10 -33
  47. package/dist/upstream-t3code/packages/contracts/src/ipc.d.ts +0 -6
  48. package/dist/upstream-t3code/packages/contracts/src/orchestration.d.ts +1 -657
  49. package/dist/upstream-t3code/packages/contracts/src/provider.d.ts +0 -14
  50. package/dist/upstream-t3code/packages/contracts/src/providerRuntime.d.ts +1 -175
  51. package/dist/upstream-t3code/packages/contracts/src/rpc.d.ts +0 -492
  52. package/dist/upstream-t3code/packages/contracts/src/server.d.ts +0 -45
  53. package/dist/upstream-t3code/packages/contracts/src/settings.d.ts +0 -21
  54. package/dist/upstream-t3code/packages/contracts/src/terminal.d.ts +3 -6
  55. package/package.json +6 -2
  56. package/src/application/index.ts +28 -2
  57. package/src/application/layer.ts +34 -5
  58. package/src/application/model-selection.ts +68 -2
  59. package/src/application/models.ts +14 -14
  60. package/src/application/project-commands.ts +15 -0
  61. package/src/application/projects.ts +43 -13
  62. package/src/application/service.ts +196 -77
  63. package/src/application/shell-sequence.ts +5 -7
  64. package/src/application/terminals.ts +207 -0
  65. package/src/application/thread-commands.test.ts +43 -0
  66. package/src/application/thread-commands.ts +81 -0
  67. package/src/application/thread-update.ts +72 -0
  68. package/src/application/thread-wait.ts +46 -47
  69. package/src/application/threads.test.ts +166 -0
  70. package/src/application/threads.ts +123 -40
  71. package/src/bin.ts +2 -0
  72. package/src/cli/app.ts +14 -0
  73. package/src/cli/confirm.ts +31 -0
  74. package/src/cli/error.ts +26 -3
  75. package/src/cli/flags.ts +15 -0
  76. package/src/cli/input/layer.ts +20 -0
  77. package/src/cli/input/service.ts +1 -0
  78. package/src/cli/output-format.ts +6 -2
  79. package/src/cli/project-format.ts +7 -0
  80. package/src/cli/project.ts +2 -1
  81. package/src/cli/projects/delete.ts +50 -0
  82. package/src/cli/self-action.ts +34 -0
  83. package/src/cli/terminal/attach.ts +32 -0
  84. package/src/cli/terminal/commands.test.ts +101 -0
  85. package/src/cli/terminal/create.ts +54 -0
  86. package/src/cli/terminal/destroy.ts +60 -0
  87. package/src/cli/terminal/encoding.test.ts +63 -0
  88. package/src/cli/terminal/encoding.ts +23 -0
  89. package/src/cli/terminal/error.ts +14 -0
  90. package/src/cli/terminal/io-node-layer.ts +82 -0
  91. package/src/cli/terminal/io-service.ts +25 -0
  92. package/src/cli/terminal/list.ts +35 -0
  93. package/src/cli/terminal/read.ts +102 -0
  94. package/src/cli/terminal/scope.ts +30 -0
  95. package/src/cli/terminal/shared.ts +250 -0
  96. package/src/cli/terminal/stream.ts +64 -0
  97. package/src/cli/terminal/wait.test.ts +146 -0
  98. package/src/cli/terminal/wait.ts +222 -0
  99. package/src/cli/terminal/write.ts +132 -0
  100. package/src/cli/terminal-format.ts +167 -0
  101. package/src/cli/terminal.ts +26 -0
  102. package/src/cli/thread-format.test.ts +32 -0
  103. package/src/cli/thread-format.ts +8 -1
  104. package/src/cli/thread.ts +9 -13
  105. package/src/cli/threads/archive.ts +11 -18
  106. package/src/cli/threads/delete.ts +61 -0
  107. package/src/cli/threads/interrupt.ts +52 -0
  108. package/src/cli/threads/list.test.ts +69 -0
  109. package/src/cli/threads/list.ts +15 -3
  110. package/src/cli/threads/messages.ts +3 -3
  111. package/src/cli/threads/send.ts +22 -2
  112. package/src/cli/threads/unarchive.ts +44 -0
  113. package/src/cli/threads/update.ts +150 -0
  114. package/src/domain/error.ts +20 -1
  115. package/src/domain/model-config.ts +4 -0
  116. package/src/domain/thread-lifecycle.test.ts +35 -0
  117. package/src/domain/thread-lifecycle.ts +29 -6
  118. package/src/node/index.ts +2 -0
  119. package/src/orchestration/index.ts +1 -0
  120. package/src/orchestration/layer.ts +33 -85
  121. package/src/orchestration/service.ts +4 -0
  122. package/src/rpc/error.ts +10 -0
  123. package/src/rpc/index.ts +5 -0
  124. package/src/rpc/operation.ts +83 -0
  125. package/src/rpc/ws-group.ts +24 -0
  126. package/src/runtime/layer.ts +7 -2
package/README.md CHANGED
@@ -26,7 +26,7 @@ t3cli auth status
26
26
  t3cli project list
27
27
 
28
28
  # Start a thread
29
- t3cli thread start "Implement a new feature" --wait
29
+ t3cli start "Implement a new feature" --wait
30
30
  ```
31
31
 
32
32
  ## Agent Skill
@@ -56,6 +56,7 @@ t3cli auth status # Check current auth
56
56
  ```sh
57
57
  t3cli project list # List known projects
58
58
  t3cli project add [--path <path>] [--title <title>]
59
+ t3cli project delete [--project <ref>] [--force] [--yes]
59
60
  ```
60
61
 
61
62
  The `--path` defaults to the current directory.
@@ -68,12 +69,12 @@ t3cli model list [--all] [--provider <provider>]
68
69
 
69
70
  Lists available provider models. Use `--all` to include hidden or unavailable entries.
70
71
 
71
- ## Thread Management
72
+ ## Thread Workflow
72
73
 
73
74
  ### Starting Threads
74
75
 
75
76
  ```sh
76
- t3cli thread start [message]
77
+ t3cli start [message]
77
78
  [--project <ref>]
78
79
  [--stdin]
79
80
  [--title <title>]
@@ -88,19 +89,56 @@ t3cli thread start [message]
88
89
  [--wait]
89
90
  ```
90
91
 
91
- ### Thread Commands
92
+ ### Common Thread Commands
92
93
 
93
94
  ```sh
94
- t3cli thread list [--project <ref>] # List threads
95
- t3cli thread show [--thread <id>] # Show thread details
96
- t3cli thread send [--thread <id>] [message] # Send message to thread
97
- t3cli thread messages [--thread <id>] [--limit] # View messages
98
- t3cli thread wait [--thread <id>] # Wait for completion
99
- t3cli thread archive [--thread <id>] # Archive thread
100
- t3cli thread approve --request <id> # Approve request
101
- t3cli thread respond --request <id> # Respond to request
95
+ t3cli list [--project <ref>] [--archived | --all]
96
+ t3cli show [--thread <id>] # Show thread details
97
+ t3cli send [--thread <id>] [message] # Send message to thread
98
+ t3cli transcript [--thread <id>] [--limit] # View messages
99
+ t3cli wait [--thread <id>] # Wait for completion
102
100
  ```
103
101
 
102
+ ### Advanced Thread Commands
103
+
104
+ ```sh
105
+ t3cli thread archive [--thread <id>] # Archive thread
106
+ t3cli thread approve --request <id> # Approve request
107
+ t3cli thread interrupt [--thread <id>] # Interrupt running turn
108
+ t3cli thread respond --request <id> # Respond to request
109
+ t3cli thread update [--thread <id>] # Update thread metadata
110
+ t3cli thread unarchive [--thread <id>] # Unarchive thread
111
+ t3cli thread delete [--thread <id>] [--yes] # Delete thread
112
+ t3cli thread callback --from <id> # Notify another thread on completion
113
+ ```
114
+
115
+ ## Terminal Commands
116
+
117
+ ```sh
118
+ t3cli terminal list [--thread <id>] [--format auto|human|json]
119
+ t3cli terminal create [--thread <id>] [command] [--id <id>] [--attach] [--format auto|human|json]
120
+ t3cli terminal attach [--thread <id>] <terminal-id>
121
+ t3cli terminal read [--thread <id>] <terminal-id> [--history] [--format json|ndjson]
122
+ t3cli terminal read [--thread <id>] <terminal-id> --history --follow --format ndjson [--from-sequence <n>]
123
+ t3cli terminal stream [--thread <id>] <terminal-id> [--format ndjson] [--from-sequence <n>]
124
+ t3cli terminal wait [--thread <id>] <terminal-id> [--for exited|closed|ended] [--format auto|human|json]
125
+ t3cli terminal write [--thread <id>] <terminal-id> <data> [--format auto|human|json] [--quiet]
126
+ t3cli terminal write [--thread <id>] <terminal-id> --stdin [--format auto|human|json] [--quiet]
127
+ t3cli terminal write [--thread <id>] <terminal-id> --hex <hex> [--format auto|human|json] [--quiet]
128
+ t3cli terminal write [--thread <id>] <terminal-id> --base64 <base64> [--format auto|human|json] [--quiet]
129
+ t3cli terminal destroy [--thread <id>] <terminal-id> [--yes] [--format auto|human|json] [--quiet]
130
+ ```
131
+
132
+ `terminal list` shows a one-shot snapshot of terminals for a thread. `terminal create` opens a server-owned terminal in the thread workspace, using the active thread worktree when present and the project workspace root otherwise. When `[command]` is provided, the CLI opens the terminal first and then writes `${command}\r`.
133
+
134
+ `terminal attach` replays terminal history and then streams live output while forwarding local input to the remote PTY. Use `Ctrl-]` to detach locally without destroying the remote terminal. `Ctrl-C` is forwarded to the remote terminal. Terminal resize events are forwarded to the server.
135
+
136
+ `terminal read` returns the current terminal snapshot. Add `--history` to include snapshot history. Add `--follow --format ndjson` to continue streaming structured events after the snapshot. `--from-sequence` is inclusive: events with sequence greater than or equal to `<n>` are emitted after the initial snapshot. `terminal stream` is the lower-level attach event stream for agents and always emits ndjson attach events.
137
+
138
+ `terminal wait` blocks until the terminal emits the requested lifecycle event. `exited` waits for the process to end, `closed` waits for the server-owned terminal session to be removed, and `ended` accepts either.
139
+
140
+ `terminal write` accepts exactly one payload source: raw argument text, `--stdin`, `--hex`, or `--base64`. Payloads are treated as raw bytes (latin1), not UTF-8 text. `terminal destroy` performs a destructive close with history deletion and requires `--yes` in non-interactive mode.
141
+
104
142
  ### Environment Variables
105
143
 
106
144
  When flags are omitted, the CLI reads these environment variables (first match wins):
@@ -130,8 +168,8 @@ Most commands support:
130
168
  Thread commands also support `ndjson` for streaming:
131
169
 
132
170
  ```sh
133
- t3cli thread start "task" --format ndjson --wait
134
- t3cli thread wait --format ndjson
171
+ t3cli start "task" --format ndjson --wait
172
+ t3cli wait --format ndjson
135
173
  ```
136
174
 
137
175
  ## Global Flags
@@ -1,2 +1,2 @@
1
- import { Nd as T3Application } from "./shared.js";
2
- export { T3Application };
1
+ import { B as T3ApplicationSlicesLive, Bd as T3ThreadApplication, G as makeT3Application, H as T3ProjectApplicationLive, Id as T3Application, Ld as T3ModelApplication, Rd as T3ProjectApplication, U as T3TerminalApplicationLive, V as T3ModelApplicationLive, W as T3ThreadApplicationLive, z as T3ApplicationLive, zd as T3TerminalApplication } from "./shared.js";
2
+ export { T3Application, T3ApplicationLive, T3ApplicationSlicesLive, T3ModelApplication, T3ModelApplicationLive, T3ProjectApplication, T3ProjectApplicationLive, T3TerminalApplication, T3TerminalApplicationLive, T3ThreadApplication, T3ThreadApplicationLive, makeT3Application };
package/dist/auth.js CHANGED
@@ -1,2 +1,2 @@
1
- import { A as T3LocalAuthOriginLive, B as AuthLocalSigningError, C as T3LocalAuth, D as T3LocalAuthTokenLive, E as T3LocalAuthToken, H as AuthTransportError, I as AuthConfigError, Kd as T3Auth, L as AuthLocalDatabaseError, O as makeT3LocalAuthToken, R as AuthLocalError, T as makeT3LocalAuth, V as AuthPairingUrlError, _ as makeT3Auth, b as makeT3AuthPairing, g as T3AuthLive, j as makeT3LocalAuthOrigin, k as T3LocalAuthOrigin, v as T3AuthPairing, w as T3LocalAuthLive, x as parsePairingUrl, y as T3AuthPairingLive, z as AuthLocalSecretError } from "./shared.js";
1
+ import { $ as AuthLocalDatabaseError, A as makeT3LocalAuth, C as makeT3Auth, D as parsePairingUrl, E as makeT3AuthPairing, F as T3LocalAuthOriginLive, I as makeT3LocalAuthOrigin, M as T3LocalAuthTokenLive, N as makeT3LocalAuthToken, O as T3LocalAuth, P as T3LocalAuthOrigin, Q as AuthConfigError, S as T3AuthLive, T as T3AuthPairingLive, et as AuthLocalError, if as T3Auth, it as AuthTransportError, j as T3LocalAuthToken, k as T3LocalAuthLive, nt as AuthLocalSigningError, rt as AuthPairingUrlError, tt as AuthLocalSecretError, w as T3AuthPairing } from "./shared.js";
2
2
  export { AuthConfigError, AuthLocalDatabaseError, AuthLocalError, AuthLocalSecretError, AuthLocalSigningError, AuthPairingUrlError, AuthTransportError, T3Auth, T3AuthLive, T3AuthPairing, T3AuthPairingLive, T3LocalAuth, T3LocalAuthLive, T3LocalAuthOrigin, T3LocalAuthOriginLive, T3LocalAuthToken, T3LocalAuthTokenLive, makeT3Auth, makeT3AuthPairing, makeT3LocalAuth, makeT3LocalAuthOrigin, makeT3LocalAuthToken, parsePairingUrl };