t3code-cli 0.14.2 → 0.15.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 (165) hide show
  1. package/README.md +36 -1
  2. package/dist/application.d.ts +2 -2
  3. package/dist/application.js +1 -1
  4. package/dist/auth.d.ts +1 -1
  5. package/dist/auth.js +1 -1
  6. package/dist/bin.js +935 -336
  7. package/dist/cli.d.ts +1 -1
  8. package/dist/cli.js +1 -1
  9. package/dist/client-runtime/authorization.d.ts +1 -1
  10. package/dist/client-runtime/authorization.js +1 -1
  11. package/dist/client-runtime/connection.d.ts +1 -1
  12. package/dist/client-runtime/connection.js +1 -1
  13. package/dist/client-runtime/environment.d.ts +3 -1
  14. package/dist/client-runtime/environment.js +1 -1
  15. package/dist/client-runtime/errors.js +1 -1
  16. package/dist/client-runtime/operations/projects.d.ts +1 -1
  17. package/dist/client-runtime/operations.d.ts +1 -1
  18. package/dist/client-runtime/platform.d.ts +1 -1
  19. package/dist/client-runtime/platform.js +1 -1
  20. package/dist/client-runtime/relay.d.ts +9 -2
  21. package/dist/client-runtime/relay.js +12 -2
  22. package/dist/client-runtime/rpc.d.ts +2 -2
  23. package/dist/client-runtime/rpc.js +2 -2
  24. package/dist/client-runtime/state/assets.d.ts +1 -1
  25. package/dist/client-runtime/state/assets.js +1 -1
  26. package/dist/client-runtime/state/auth.d.ts +1 -1
  27. package/dist/client-runtime/state/auth.js +1 -1
  28. package/dist/client-runtime/state/connections.js +1 -1
  29. package/dist/client-runtime/state/entities.d.ts +1 -1
  30. package/dist/client-runtime/state/filesystem.d.ts +1 -1
  31. package/dist/client-runtime/state/filesystem.js +1 -1
  32. package/dist/client-runtime/state/git.d.ts +2 -1
  33. package/dist/client-runtime/state/git.js +1 -1
  34. package/dist/client-runtime/state/models.d.ts +1 -1
  35. package/dist/client-runtime/state/models.js +1 -1
  36. package/dist/client-runtime/state/orchestration.d.ts +1 -1
  37. package/dist/client-runtime/state/orchestration.js +1 -1
  38. package/dist/client-runtime/state/presentation.d.ts +7 -1
  39. package/dist/client-runtime/state/presentation.js +1 -1
  40. package/dist/client-runtime/state/preview.d.ts +5 -2
  41. package/dist/client-runtime/state/preview.js +3 -2
  42. package/dist/client-runtime/state/project-grouping.d.ts +1 -1
  43. package/dist/client-runtime/state/project-grouping.js +1 -1
  44. package/dist/client-runtime/state/projects.d.ts +1 -1
  45. package/dist/client-runtime/state/pull-requests.d.ts +478 -0
  46. package/dist/client-runtime/state/pull-requests.js +172 -0
  47. package/dist/client-runtime/state/relay.d.ts +1 -1
  48. package/dist/client-runtime/state/relay.js +1 -1
  49. package/dist/client-runtime/state/review.d.ts +1 -1
  50. package/dist/client-runtime/state/review.js +1 -1
  51. package/dist/client-runtime/state/runtime.d.ts +2 -2
  52. package/dist/client-runtime/state/runtime.js +2 -2
  53. package/dist/client-runtime/state/server.d.ts +13 -1
  54. package/dist/client-runtime/state/server.js +1 -1
  55. package/dist/client-runtime/state/session.d.ts +13 -1
  56. package/dist/client-runtime/state/session.js +1 -1
  57. package/dist/client-runtime/state/shell.d.ts +7 -1
  58. package/dist/client-runtime/state/shell.js +1 -1
  59. package/dist/client-runtime/state/source-control.d.ts +1 -1
  60. package/dist/client-runtime/state/source-control.js +1 -1
  61. package/dist/client-runtime/state/subagentRuntime.d.ts +1 -1
  62. package/dist/client-runtime/state/terminal.d.ts +1 -1
  63. package/dist/client-runtime/state/terminal.js +1 -1
  64. package/dist/client-runtime/state/thread-search.d.ts +1 -1
  65. package/dist/client-runtime/state/thread-search.js +1 -1
  66. package/dist/client-runtime/state/thread-settled.d.ts +11 -8
  67. package/dist/client-runtime/state/thread-settled.js +2 -229
  68. package/dist/client-runtime/state/thread-sort.d.ts +1 -1
  69. package/dist/client-runtime/state/thread-sort.js +1 -1
  70. package/dist/client-runtime/state/threads.d.ts +1 -1
  71. package/dist/client-runtime/state/threads.js +1 -1
  72. package/dist/client-runtime/state/vcs.d.ts +1 -1
  73. package/dist/client-runtime/state/vcs.js +1 -1
  74. package/dist/config.d.ts +1 -1
  75. package/dist/config.js +1 -1
  76. package/dist/connection.d.ts +1 -1
  77. package/dist/connection.js +1 -1
  78. package/dist/contracts.d.ts +1 -1
  79. package/dist/contracts.js +1 -1
  80. package/dist/index.d.ts +1 -1
  81. package/dist/index.js +1 -1
  82. package/dist/node.d.ts +1 -1
  83. package/dist/node.js +1 -1
  84. package/dist/orchestration.d.ts +12 -6
  85. package/dist/orchestration.js +2 -2
  86. package/dist/preview.d.ts +1 -1
  87. package/dist/rpc.d.ts +4 -9
  88. package/dist/rpc.js +1 -1
  89. package/dist/runtime.d.ts +1 -1
  90. package/dist/shared/DrainableWorker.js +1 -1
  91. package/dist/shared/KeyedCoalescingWorker.js +1 -1
  92. package/dist/shared/Net.d.ts +6 -0
  93. package/dist/shared/Net.js +2 -1
  94. package/dist/shared/advertisedEndpoint.d.ts +1 -1
  95. package/dist/shared/advertisedEndpoint.js +1 -1
  96. package/dist/shared/agentAwareness.d.ts +1 -1
  97. package/dist/shared/backgroundActivitySettings.d.ts +1 -1
  98. package/dist/shared/connectAuth.d.ts +23 -4
  99. package/dist/shared/connectAuth.js +40 -7
  100. package/dist/shared/devHome.js +1 -1
  101. package/dist/shared/dpop.js +1 -1
  102. package/dist/shared/git.d.ts +1 -1
  103. package/dist/shared/httpObservability.js +1 -1
  104. package/dist/shared/httpReadiness.js +1 -1
  105. package/dist/shared/keybindings.d.ts +1 -1
  106. package/dist/shared/model.d.ts +1 -1
  107. package/dist/shared/oauthScope.js +1 -1
  108. package/dist/shared/observability.js +1 -1
  109. package/dist/shared/preview.js +1 -1
  110. package/dist/shared/previewViewport.d.ts +1 -1
  111. package/dist/shared/previewViewport.js +1 -1
  112. package/dist/shared/projectScripts.d.ts +1 -1
  113. package/dist/shared/relayAuth.js +1 -1
  114. package/dist/shared/relayClient.d.ts +1 -1
  115. package/dist/shared/relayClient.js +1 -1
  116. package/dist/shared/relayJwt.js +1 -1
  117. package/dist/shared/relayTracing.js +1 -1
  118. package/dist/shared/relayUrl.js +1 -1
  119. package/dist/shared/remote.js +1 -1
  120. package/dist/shared/schemaYaml.js +1 -1
  121. package/dist/shared/serverSettings.d.ts +1 -1
  122. package/dist/shared/serverSettings.js +1 -1
  123. package/dist/shared/shell.js +1 -1
  124. package/dist/shared/sourceControl.d.ts +1 -1
  125. package/dist/shared/t3ProjectFile.d.ts +1 -1
  126. package/dist/shared/t3ProjectFile.js +1 -1
  127. package/dist/shared/terminalLabels.d.ts +1 -1
  128. package/dist/shared/threadEnvMode.d.ts +1 -1
  129. package/dist/shared/toolActivity.d.ts +1 -1
  130. package/dist/shared/usageFormat.d.ts +16 -3
  131. package/dist/shared/usageFormat.js +92 -6
  132. package/dist/shared/usageMerge.d.ts +13 -2
  133. package/dist/shared/usageMerge.js +23 -0
  134. package/dist/shared.d.ts +3470 -378
  135. package/dist/shared.js +2434 -617
  136. package/dist/t3tools.d.ts +2 -2
  137. package/dist/t3tools.js +2 -2
  138. package/package.json +2 -2
  139. package/src/application/error.ts +2 -2
  140. package/src/application/index.ts +1 -0
  141. package/src/application/service.ts +38 -4
  142. package/src/application/thread-commands.ts +78 -0
  143. package/src/application/threads.ts +113 -16
  144. package/src/cli/app.ts +2 -0
  145. package/src/cli/ask-lifecycle.ts +331 -0
  146. package/src/cli/ask.ts +390 -0
  147. package/src/cli/error.ts +70 -0
  148. package/src/cli/format/thread.ts +26 -6
  149. package/src/cli/thread.ts +12 -0
  150. package/src/cli/threads/messages.ts +33 -3
  151. package/src/cli/threads/pin.ts +46 -0
  152. package/src/cli/threads/send.ts +5 -1
  153. package/src/cli/threads/settle.ts +46 -0
  154. package/src/cli/threads/snooze.ts +117 -0
  155. package/src/cli/threads/start.ts +6 -1
  156. package/src/cli/threads/unpin.ts +48 -0
  157. package/src/cli/threads/unsettle.ts +48 -0
  158. package/src/cli/threads/unsnooze.ts +48 -0
  159. package/src/connection/prepared.ts +12 -2
  160. package/src/orchestration/error.ts +10 -0
  161. package/src/orchestration/index.ts +1 -0
  162. package/src/orchestration/layer.ts +72 -0
  163. package/src/orchestration/service.ts +11 -3
  164. package/src/rpc/ws-group.ts +1 -0
  165. package/src/runtime/layer.ts +9 -4
@@ -1,4 +1,4 @@
1
- import { $k as orElseSucceed, $r as make, AO as fromQueue, Aj as none, An as unsettleThread, Bk as gen, Bo as makeEnvironmentHttpApiClient, Br as buildEnvironmentAuthHeaders, Cj as getOrNull, Ck as catchCause, Cn as setThreadRuntimeMode, Cw as EnvironmentId, Dj as isSome, Dk as catch_, Dn as stopThreadSession, EO as filter$1, Ej as isNone, Ek as catchTags, En as startThreadTurn, FA as squash, Fy as get$1, Gk as map, HO as runHead, IA as effect, IO as never, Ia as EnvironmentSupervisor, Ij as combine, Iy as make$1, La as ConnectionWakeups, Lj as combineAll, Ly as set$1, MO as map$3, Nj as Number$1, Nk as flatMap$1, Nn as updateThreadMetadata, Oj as map$2, On as unarchiveThread, Os as connectionProjectionPhase, PA as pretty, Pj as String, Pk as fn, Py as changes, Qt as parseThreadKey, Ra as shouldResubscribeAfterWakeup, Ry as update, SO as debounce, Sj as getOrElse, Sn as setThreadInteractionMode, Tn as snoozeThread, Tr as followStreamInEnvironment, Uk as logDebug, Uo as environmentEndpointUrl, VO as runForEach, Vb as ORCHESTRATION_WS_METHODS, Vr as withEnvironmentCredentials, Wa as EnvironmentCacheStore, Wk as logWarning, Xr as subscribeDynamic, YO as unwrap, Yj as pipe, Yt as arrayElementsEqual, Zr as family, Zt as parseProjectRefCollectionKey, _k as all, _n as pinThread, ak as offerUnsafe, bA as void_, bT as set, bk as as, bn as respondToThreadUserInput, cA as succeed, ck as sliding, dT as HttpClient, dn as archiveThread, dr as scopeThreadShell, ei as setIdleTTL, ej as append, ek as make$3, en as projectRefCollectionKey, gk as addFinalizer, gn as interruptThreadTurn, hj as Service, hn as deleteThread, ik as offer, jj as some, jn as unsnoozeThread, kj as match, kn as unpinThread, mj as Reference, mr as createEnvironmentCommand, nA as provideService, ni as withLabel, nj as map$1, nn as threadKey, oA as serviceOption, pn as createThread, pr as createAtomCommandScheduler, rj as sort, rn as threadRefsEqual, si as value, tj as filter, to as ManagedRelayDpopSigner, uA as sync, ur as scopeThread, vT as get, vj as flatMap, vk as andThen, vn as reorderPinnedThread, wj as getOrThrow, wn as settleThread, xT as update$1, xn as revertThreadCheckpoint, yT as make$2, yk as annotateLogs, yn as respondToThreadApproval, zj as mapInput, zk as forkScoped, zo as executeEnvironmentHttpRequest } from "../../shared.js";
1
+ import { $A as runHead, AN as Service, Aj as andThen, An as unsettleThread, Ba as shouldResubscribeAfterWakeup, By as changes, CM as sync, Cn as setThreadRuntimeMode, DD as set, Dn as stopThreadSession, Dr as followStreamInEnvironment, ED as make$2, En as startThreadTurn, Fj as catchCause, GN as none, Gj as flatMap$1, HN as isSome, Ho as makeEnvironmentHttpApiClient, Hr as buildEnvironmentAuthHeaders, Hy as make$1, JM as squash, JN as Number$1, KN as some, Ka as EnvironmentCacheStore, Kj as fn, Ko as environmentEndpointUrl, Kr as make, LA as filter$1, LN as getOrElse, ME as EnvironmentId, Mj as as, NA as debounce, NM as void_, NN as flatMap, Nn as updateThreadMetadata, OD as update$1, Oj as addFinalizer, On as unarchiveThread, QA as runForEach, QN as combineAll, Qj as gen, Qt as parseThreadKey, RN as getOrNull, Ra as EnvironmentSupervisor, Rj as catchTags, Sn as setThreadInteractionMode, TD as get, Tn as snoozeThread, UA as map$3, UN as map$2, Ur as withEnvironmentCredentials, Uy as set$1, VA as fromQueue, VN as isNone, Vo as executeEnvironmentHttpRequest, Vy as get$1, WN as match, Wr as family, Wy as update, XS as ORCHESTRATION_WS_METHODS, YM as effect, YN as String, Yr as withLabel, Yt as arrayElementsEqual, ZN as combine, Zj as forkScoped, Zt as parseProjectRefCollectionKey, _j as offerUnsafe, _n as pinThread, bj as sliding, bn as respondToThreadUserInput, dn as archiveThread, dr as scopeThread, eP as mapInput, ei as value, en as projectRefCollectionKey, fM as orElseSucceed, fj as make$3, fr as scopeThreadShell, gN as sort, gj as offer, gn as interruptThreadTurn, hM as provideService, hN as map$1, hn as deleteThread, hr as createEnvironmentCommand, jj as annotateLogs, jn as unsnoozeThread, js as connectionProjectionPhase, kN as Reference, kj as all, kn as unpinThread, li as subscribeDynamic, mN as filter, mr as createAtomCommandScheduler, nM as logWarning, nn as threadKey, pN as append, pn as createThread, qA as never, qM as pretty, qr as setIdleTTL, rM as map, rn as threadRefsEqual, ro as ManagedRelayDpopSigner, sj as unwrap, tM as logDebug, uP as pipe, vD as HttpClient, vn as reorderPinnedThread, wn as settleThread, xM as succeed, xn as revertThreadCheckpoint, yM as serviceOption, yn as respondToThreadApproval, zN as getOrThrow, za as ConnectionWakeups, zj as catch_ } from "../../shared.js";
2
2
  //#region upstream-t3code/packages/client-runtime/src/state/threadSnapshotHttp.ts
3
3
  const DEFAULT_THREAD_SNAPSHOT_TIMEOUT_MS = 6e3;
4
4
  const fetchEnvironmentThreadSnapshot = fn("clientRuntime.state.fetchEnvironmentThreadSnapshot")(function* (input) {
@@ -1,4 +1,4 @@
1
- import { Aa as ConnectionPersistenceError, Aw as VcsListRefsResult, CD as EnvironmentId, Cw as TextGenerationError, Da as EnvironmentSupervisor, JC as VcsProcessOutputReadError, KC as VcsProcessMissingExitCodeError, Ly as OrchestrationThreadDetailSnapshot, Na as EnvironmentCacheStore, Nw as VcsRef$1, Oy as OrchestrationShellSnapshot, QC as VcsProcessTimeoutError, Qw as SourceControlProviderError, RD as ThreadId, Rw as VcsStatusResult, Sw as GitStackedAction, Ta as EnvironmentRegistry, UC as VcsProcessExitError, YC as VcsProcessSpawnError, ZC as VcsProcessStdinWriteError, _ as AtomCommandResult, _w as GitRunStackedActionInput, cw as GitCommandError, du as ServerConfig, f as AtomCommand, iD as EnvironmentAuthorizationError, iw as GitActionProgressEvent, kw as VcsListRefsInput, lw as GitManagerError, mn as EnvironmentRpcUnavailableError, pw as GitPullRequestMaterializationError, qC as VcsProcessOutputLimitError, rw as VcsUnsupportedOperationError, tw as VcsRepositoryDetectionError, vw as GitRunStackedActionResult, wa as EnvironmentNotRegisteredError } from "../../shared.js";
1
+ import { $O as EnvironmentAuthorizationError, Aa as EnvironmentSupervisor, Cw as VcsProcessExitError, Da as EnvironmentNotRegisteredError, Dw as VcsProcessOutputLimitError, Ew as VcsProcessMissingExitCodeError, Fw as VcsRepositoryDetectionError, Hw as GitCommandError, Ia as EnvironmentCacheStore, Lw as VcsUnsupportedOperationError, Mw as VcsProcessTimeoutError, Na as ConnectionPersistenceError, Nk as ThreadId, Oa as EnvironmentRegistry, Ow as VcsProcessOutputReadError, Qw as GitRunStackedActionResult, Rw as GitActionProgressEvent, Su as ServerConfig, UD as SourceControlProviderError, Uw as GitManagerError, Zw as GitRunStackedActionInput, _ as AtomCommandResult, ab as OrchestrationShellSnapshot, f as AtomCommand, hn as EnvironmentRpcUnavailableError, jw as VcsProcessStdinWriteError, kw as VcsProcessSpawnError, lT as VcsListRefsInput, mb as OrchestrationThreadDetailSnapshot, nT as GitStackedAction, pT as VcsRef$1, qw as GitPullRequestMaterializationError, rT as TextGenerationError, uT as VcsListRefsResult, vT as VcsStatusResult, vk as EnvironmentId } from "../../shared.js";
2
2
  import * as Effect from "effect/Effect";
3
3
  import * as Stream from "effect/Stream";
4
4
  import * as Schema from "effect/Schema";
@@ -1,4 +1,4 @@
1
- import { $r as make, AA as fail$1, AD as TaggedErrorClass, Aj as none, Ba as safeErrorLogAttributes, Bk as gen, CA as exponential, Cw as EnvironmentId, DD as Number, DO as filterMap, Dk as catch_, ED as NullOr, FA as squash, Fy as get, Ia as EnvironmentSupervisor, Jr as runStream, KO as switchMap, LD as decodeUnknownSync, LO as retry, Ld as GitStackedAction, MA as hasInterruptsOnly, MD as Union, MO as map, NO as mapAccum, Nk as flatMap, OD as String, OO as fromEffect, Pk as fn, Py as changes, Q as applyGitStatusStreamEvent, Qr as keepAlive, St as vcsCommandScheduler, TO as empty, Tr as followStreamInEnvironment, Us as WS_METHODS, VO as runForEach, Wa as EnvironmentCacheStore, Wk as logWarning, YO as unwrap, Yr as subscribe, Zr as family, ai as failure, aj as failVoid, bA as void_, bO as changes$1, bk as as, br as createRuntimeCommand, bt as withVcsRefsPersistenceLock, cA as succeed, dj as min, ei as setIdleTTL, fA as tapError, hr as createEnvironmentRpcCommand, jD as Tuple, jj as some, jk as fail, jr as runStreamInEnvironment, kj as match, kk as ensuring, lA as suspend, lO as nowUnsafe, lj as succeed$1, nA as provideService, ni as withLabel, oi as isSuccess, pj as seconds, qr as request, ri as AtomRegistry, rt as isTemporaryWorktreeBranch, uA as sync, uO as toEpochMillis, vt as invalidateCachedVcsRefs, wA as modifyDelay, wD as Literals, wd as GitActionProgressPhase, xD as Defect, xO as concat, xt as vcsCommandConcurrency, yk as annotateLogs, yr as createEnvironmentSubscriptionAtomFamily, yt as vcsRefsCacheStateAtom } from "../../shared.js";
1
+ import { $r as isSuccess, Bk as Tuple, By as changes, CM as sync, DN as seconds, Dr as followStreamInEnvironment, Fk as NullOr, GM as hasInterruptsOnly, GN as none, Gj as flatMap, Gr as keepAlive, Ha as safeErrorLogAttributes, IA as empty, IM as exponential, Ik as Number, JA as retry, JM as squash, KN as some, Ka as EnvironmentCacheStore, Kj as fn, Kk as decodeUnknownSync, Kr as make, LM as modifyDelay, Lk as String, MA as concat, ME as EnvironmentId, Mj as as, NM as void_, Nk as Literals, Nr as runStreamInEnvironment, Q as applyGitStatusStreamEvent, QA as runForEach, Qj as gen, Qr as failure, RA as filterMap, Ra as EnvironmentSupervisor, SM as suspend, SN as succeed$1, Sr as createRuntimeCommand, St as vcsCommandScheduler, TM as tapError, TN as min, UA as map, UM as fail$1, Uj as fail, Vj as ensuring, Vk as Union, Vy as get, WA as mapAccum, WN as match, Wr as family, Xr as AtomRegistry, Yr as withLabel, _r as createEnvironmentRpcCommand, bA as nowUnsafe, bf as GitStackedAction, bt as withVcsRefsPersistenceLock, ci as subscribe, hM as provideService, jA as changes$1, jj as annotateLogs, kk as Defect, lc as WS_METHODS, nM as logWarning, oi as request, qr as setIdleTTL, rj as switchMap, rt as isTemporaryWorktreeBranch, sf as GitActionProgressPhase, si as runStream, sj as unwrap, vN as failVoid, vt as invalidateCachedVcsRefs, xA as toEpochMillis, xM as succeed, xr as createEnvironmentSubscriptionAtomFamily, xt as vcsCommandConcurrency, yt as vcsRefsCacheStateAtom, zA as fromEffect, zj as catch_, zk as TaggedErrorClass } from "../../shared.js";
2
2
  //#region upstream-t3code/packages/client-runtime/src/state/gitActions.ts
3
3
  function buildGitActionProgressStages(input) {
4
4
  const branchStages = input.featureBranch ? ["Preparing feature branch..."] : [];
package/dist/config.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { $i as ConfigServiceError, $n as T3CliEnvShape, Ar as cipher_d_exports, Cr as service_d_exports, Dr as KeystoreUnavailableError, Er as service_d_exports$1, Or as EncryptedToken, Qi as ConfigError, Qn as T3CliEnvScope, Sr as service_d_exports$2, Tr as T3MasterKeyKeystoreFactory, Zi as UrlError, Zn as T3CliEnvConfig, _r as EncryptedConfig, br as UpsertEnvironmentInput, er as loadT3CliEnv, gr as config_d_exports, jr as CredentialCipherError, kr as T3CredentialCipher, vr as EnvironmentSummary, wr as MasterKeyReadResult, yr as ResolvedConfig } from "./shared.js";
1
+ import { $n as T3CliEnvConfig, Ar as EncryptedToken, Dr as T3MasterKeyKeystoreFactory, Er as MasterKeyReadResult, Mr as cipher_d_exports, Nr as CredentialCipherError, Or as service_d_exports$1, Sr as UpsertEnvironmentInput, Tr as service_d_exports, br as EnvironmentSummary, ea as UrlError, er as T3CliEnvScope, jr as T3CredentialCipher, kr as KeystoreUnavailableError, na as ConfigServiceError, nr as loadT3CliEnv, ta as ConfigError, tr as T3CliEnvShape, vr as config_d_exports, wr as service_d_exports$2, xr as ResolvedConfig, yr as EncryptedConfig } from "./shared.js";
2
2
  import * as Effect from "effect/Effect";
3
3
  import * as Option from "effect/Option";
4
4
  import * as Layer from "effect/Layer";
package/dist/config.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { n as __exportAll } from "./rolldown-runtime.js";
2
- import { $T as loadT3CliEnv, $w as config_exports, AT as cipher_exports, BA as succeed, Bk as gen, CT as file_exports, DT as service_exports$1, ET as resolveT3cliConfigDir, Fi as resolveT3BaseDir, Fs as cipher_node_exports, Ls as CredentialCipherError, Ms as keyring_node_exports, OT as ConfigError, Ps as KeystoreUnavailableError, QT as T3CliEnvConfig, ST as service_exports, TT as resolveKeyFilePath, aT as validateEnvironmentName, cT as toWebSocketBaseUrl, eT as service_exports$2, hA as tryPromise, iT as slugifyEnvironmentName, jT as credentialTokenFromEnv, jk as fail, kT as T3CredentialCipher, lT as toWebSocketEndpointUrl, nT as defaultEnvironmentNameFromUrl, oT as normalizeHttpBaseUrl, rT as migrateV1EnvironmentName, sT as toHttpEndpointUrl, tT as defaultEnvironmentNameForLocal, uT as UrlError, wT as resolveConfigFilePath } from "./shared.js";
2
+ import { $M as succeed, AD as file_exports, Bs as CredentialCipherError, FD as ConfigError, Fs as keyring_node_exports, ID as T3CredentialCipher, LD as cipher_exports, Li as resolveT3BaseDir, Ls as KeystoreUnavailableError, MD as resolveKeyFilePath, ND as resolveT3cliConfigDir, OM as tryPromise, PD as service_exports$1, Qj as gen, RD as credentialTokenFromEnv, Rs as cipher_node_exports, Uj as fail, _D as UrlError, aO as T3CliEnvConfig, cD as defaultEnvironmentNameForLocal, dD as slugifyEnvironmentName, fD as validateEnvironmentName, gD as toWebSocketEndpointUrl, hD as toWebSocketBaseUrl, jD as resolveConfigFilePath, kD as service_exports, lD as defaultEnvironmentNameFromUrl, mD as toHttpEndpointUrl, oD as config_exports, oO as loadT3CliEnv, pD as normalizeHttpBaseUrl, sD as service_exports$2, uD as migrateV1EnvironmentName } from "./shared.js";
3
3
  //#region src/config/credential/cipher-web.ts
4
4
  var cipher_web_exports = /* @__PURE__ */ __exportAll({ layerWeb: () => layerWeb });
5
5
  const aesGcmAlgorithm = "AES-GCM";
@@ -1,4 +1,4 @@
1
- import { Gn as T3CodeConnectionProvider, Jn as T3CodeAuth, Kn as T3CodeConnectionProviderLive, Xi as T3CodeConnectionError, Xn as T3CodeOrigin, Yn as T3CodeConnection, qn as makeT3CodeConnectionProvider, vi as T3Rpc } from "./shared.js";
1
+ import { $i as T3CodeConnectionError, Jn as T3CodeConnectionProviderLive, Qn as T3CodeOrigin, Xn as T3CodeAuth, Yn as makeT3CodeConnectionProvider, Zn as T3CodeConnection, bi as T3Rpc, qn as T3CodeConnectionProvider } from "./shared.js";
2
2
  import * as Layer from "effect/Layer";
3
3
  //#region src/connection/layer.d.ts
4
4
  declare function makeT3CodeRpcLayer(): Layer.Layer<T3Rpc, never, import("effect/unstable/http/HttpClient").HttpClient | T3CodeConnectionProvider | import("effect/unstable/socket/Socket").WebSocketConstructor>;
@@ -1,2 +1,2 @@
1
- import { Fn as T3CodeRpcLayer, In as makeT3CodeRpcLayer, ci as T3CodeConnectionProvider, li as T3CodeConnectionProviderLive, na as T3CodeConnectionError, ui as makeT3CodeConnectionProvider } from "./shared.js";
1
+ import { Fn as T3CodeRpcLayer, In as makeT3CodeRpcLayer, di as T3CodeConnectionProviderLive, fi as makeT3CodeConnectionProvider, ia as T3CodeConnectionError, ui as T3CodeConnectionProvider } from "./shared.js";
2
2
  export { T3CodeConnectionError, T3CodeConnectionProvider, T3CodeConnectionProviderLive, T3CodeRpcLayer, makeT3CodeConnectionProvider, makeT3CodeRpcLayer };
@@ -1,2 +1,2 @@
1
- import { Gx as PREVIEW_VIEWPORT_PRESET_IDS, Iu as ServerProvider, LE as AuthClientPresentationMetadata, Ny as OrchestrationThread, Oy as OrchestrationShellSnapshot, Sx as PreviewAutomationResponse, Vy as OrchestrationThreadShell, ax as PreviewAutomationHostFocus, bx as PreviewAutomationResizeInput, cS as PreviewViewportPresetId, hy as OrchestrationMessage, ix as PreviewAutomationHost, kx as PreviewAutomationStreamEvent, lS as PreviewViewportSetting, vy as OrchestrationProjectShell } from "./shared.js";
1
+ import { $x as PreviewAutomationResponse, Fx as PreviewAutomationHost, HS as PreviewViewportPresetId, Ix as PreviewAutomationHostFocus, Ky as OrchestrationMessage, MO as AuthClientPresentationMetadata, TS as PREVIEW_VIEWPORT_PRESET_IDS, US as PreviewViewportSetting, Yy as OrchestrationProjectShell, Zx as PreviewAutomationResizeInput, ab as OrchestrationShellSnapshot, oS as PreviewAutomationStreamEvent, qu as ServerProvider, ub as OrchestrationThread, vb as OrchestrationThreadShell } from "./shared.js";
2
2
  export { type AuthClientPresentationMetadata, type OrchestrationMessage, type OrchestrationProjectShell, type OrchestrationShellSnapshot, type OrchestrationThread, type OrchestrationThreadShell, PREVIEW_VIEWPORT_PRESET_IDS, type PreviewAutomationHost, type PreviewAutomationHostFocus, type PreviewAutomationResizeInput, type PreviewAutomationResponse, type PreviewAutomationStreamEvent, type PreviewViewportPresetId, PreviewViewportSetting, type ServerProvider };
package/dist/contracts.js CHANGED
@@ -1,2 +1,2 @@
1
- import { oy as PREVIEW_VIEWPORT_PRESET_IDS, wy as PreviewViewportSetting } from "./shared.js";
1
+ import { Ay as PreviewViewportSetting, fy as PREVIEW_VIEWPORT_PRESET_IDS } from "./shared.js";
2
2
  export { PREVIEW_VIEWPORT_PRESET_IDS, PreviewViewportSetting };
package/dist/index.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- import { An as AppLayer, Di as SendThreadInput, Mi as T3Application, Oi as StartThreadInput, jn as AuthAppLayer, ki as StartThreadPolicy, qi as ApplicationError, zi as WaitEvent } from "./shared.js";
1
+ import { Fi as T3Application, Hi as WaitEvent, Ki as ApplicationError, Mi as StartThreadPolicy, Mn as AppLayer, Nn as AuthAppLayer, ji as StartThreadInput, ki as SendThreadInput } from "./shared.js";
2
2
  export { AppLayer, type ApplicationError, AuthAppLayer, type SendThreadInput, type StartThreadInput, type StartThreadPolicy, T3Application, type WaitEvent };
package/dist/index.js CHANGED
@@ -1,2 +1,2 @@
1
- import { Ln as AppLayer, Rn as AuthAppLayer, tE as T3Application } from "./shared.js";
1
+ import { Ln as AppLayer, Rn as AuthAppLayer, cO as T3Application } from "./shared.js";
2
2
  export { AppLayer, AuthAppLayer, T3Application };
package/dist/node.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { Gn as T3CodeConnectionProvider, vi as T3Rpc } from "./shared.js";
1
+ import { bi as T3Rpc, qn as T3CodeConnectionProvider } from "./shared.js";
2
2
  import * as Layer from "effect/Layer";
3
3
  //#region src/node/connection.d.ts
4
4
  declare const T3CodeNodeRpcLayer: Layer.Layer<T3Rpc, never, T3CodeConnectionProvider>;
package/dist/node.js CHANGED
@@ -1,4 +1,4 @@
1
- import { As as layerWebSocketConstructor, Fn as T3CodeRpcLayer, LA as mergeAll, RA as provide, js as layerUndici } from "./shared.js";
1
+ import { Fn as T3CodeRpcLayer, Ns as layerWebSocketConstructor, Ps as layerUndici, XM as mergeAll, ZM as provide } from "./shared.js";
2
2
  //#region src/node/connection.ts
3
3
  const NodeConnectionPlatformLayer = mergeAll(layerUndici, layerWebSocketConstructor);
4
4
  const T3CodeNodeRpcLayer = T3CodeRpcLayer.pipe(provide(NodeConnectionPlatformLayer));
@@ -1,7 +1,8 @@
1
- import { Hi as Orchestration, Hy as OrchestrationThreadStreamItem, Oy as OrchestrationShellSnapshot, Ui as OrchestrationError, Vi as OpenThread, Wi as T3Orchestration, Yi as RpcError, mi as T3RpcOperations } from "./shared.js";
1
+ import { Ji as Orchestration, Qi as RpcError, Ss as ThreadSnapshotRequestError, Xi as T3Orchestration, Yi as OrchestrationError, ab as OrchestrationShellSnapshot, gi as T3RpcOperations, hb as OrchestrationThreadDetailWindow, jn as T3PreparedConnectionProvider, mb as OrchestrationThreadDetailSnapshot, qi as OpenThread, yb as OrchestrationThreadStreamItem } from "./shared.js";
2
2
  import * as Effect from "effect/Effect";
3
3
  import * as Stream from "effect/Stream";
4
4
  import * as Layer from "effect/Layer";
5
+ import { HttpClient } from "effect/unstable/http";
5
6
  //#region src/orchestration/layer.d.ts
6
7
  declare const makeT3Orchestration: () => Effect.Effect<{
7
8
  dispatch: (command: {
@@ -333,6 +334,7 @@ declare const makeT3Orchestration: () => Effect.Effect<{
333
334
  readonly output: string | null;
334
335
  };
335
336
  }[];
337
+ readonly threadSnapshotPagination?: boolean;
336
338
  }, RpcError, never>;
337
339
  getShellSnapshot: () => Effect.Effect<{
338
340
  readonly snapshotSequence: number;
@@ -655,6 +657,10 @@ declare const makeT3Orchestration: () => Effect.Effect<{
655
657
  readonly updatedAt: string;
656
658
  } | null;
657
659
  }, RpcError, never>;
660
+ getThreadDetailSnapshot: (input: {
661
+ readonly threadId: string;
662
+ readonly window?: OrchestrationThreadDetailWindow;
663
+ }) => Effect.Effect<OrchestrationThreadDetailSnapshot, OrchestrationError>;
658
664
  watchShellSnapshots: () => Stream.Stream<OrchestrationShellSnapshot, OrchestrationError, import("effect/Scope").Scope>;
659
665
  watchShellSequence: () => Stream.Stream<number, OrchestrationError, import("effect/Scope").Scope>;
660
666
  watchThreadItems: (threadId: string) => Stream.Stream<OrchestrationThreadStreamItem, OrchestrationError, import("effect/Scope").Scope>;
@@ -1555,9 +1561,9 @@ declare const makeT3Orchestration: () => Effect.Effect<{
1555
1561
  readonly createdAt: string;
1556
1562
  };
1557
1563
  };
1558
- }, RpcError, never>;
1559
- }, RpcError, import("effect/Scope").Scope>;
1560
- }, never, T3RpcOperations>;
1561
- declare const T3OrchestrationLive: Layer.Layer<T3Orchestration, never, T3RpcOperations>;
1564
+ }, OrchestrationError, never>;
1565
+ }, OrchestrationError, import("effect/Scope").Scope>;
1566
+ }, never, HttpClient.HttpClient | T3PreparedConnectionProvider | T3RpcOperations>;
1567
+ declare const T3OrchestrationLive: Layer.Layer<T3Orchestration, never, HttpClient.HttpClient | T3PreparedConnectionProvider | T3RpcOperations>;
1562
1568
  //#endregion
1563
- export { type OpenThread, type Orchestration, type OrchestrationError, T3Orchestration, T3OrchestrationLive, makeT3Orchestration };
1569
+ export { type OpenThread, type Orchestration, type OrchestrationError, T3Orchestration, T3OrchestrationLive, ThreadSnapshotRequestError, makeT3Orchestration };
@@ -1,2 +1,2 @@
1
- import { er as T3OrchestrationLive, ks as T3Orchestration, tr as makeT3Orchestration } from "./shared.js";
2
- export { T3Orchestration, T3OrchestrationLive, makeT3Orchestration };
1
+ import { Ms as T3Orchestration, er as T3OrchestrationLive, nr as ThreadSnapshotRequestError, tr as makeT3Orchestration } from "./shared.js";
2
+ export { T3Orchestration, T3OrchestrationLive, ThreadSnapshotRequestError, makeT3Orchestration };
package/dist/preview.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- import { Hn as T3PreviewAutomation, Sx as PreviewAutomationResponse, Un as T3PreviewAutomationLive, Wn as makeT3PreviewAutomation, ax as PreviewAutomationHostFocus, ix as PreviewAutomationHost, kx as PreviewAutomationStreamEvent } from "./shared.js";
1
+ import { $x as PreviewAutomationResponse, Fx as PreviewAutomationHost, Gn as T3PreviewAutomationLive, Ix as PreviewAutomationHostFocus, Kn as makeT3PreviewAutomation, Wn as T3PreviewAutomation, oS as PreviewAutomationStreamEvent } from "./shared.js";
2
2
  export { type PreviewAutomationHost, type PreviewAutomationHostFocus, type PreviewAutomationResponse, type PreviewAutomationStreamEvent, T3PreviewAutomation, T3PreviewAutomationLive, makeT3PreviewAutomation };
package/dist/rpc.d.ts CHANGED
@@ -1,16 +1,9 @@
1
- import { $b as PreviewAutomationControlInterruptedError, $o as ConnectionAttemptError, $v as OrchestrationDispatchCommandError, AS as TerminalSessionLookupError, Ax as PreviewAutomationTabNotFoundError, Cx as PreviewAutomationResultTooLargeError, Cy as OrchestrationSearchThreadsError, Dd as KeybindingsConfigError, ES as TerminalResizeError, FS as TerminalWriteError, Fx as PreviewAutomationUnavailableError, Ix as PreviewAutomationUnsupportedClientError, Jb as PreviewAutomationClientDisconnectedError, Ji as OrchestrationError, Mx as PreviewAutomationTargetNotEditableError, Nx as PreviewAutomationTimeoutError, SS as TerminalHistoryError, Xi as T3CodeConnectionError, Yi as RpcError, _S as TerminalCwdNotDirectoryError, _i as makeT3RpcOperations, _x as PreviewAutomationRemoteUnavailableError, bi as WsClient, cx as PreviewAutomationMalformedResponseError, dx as PreviewAutomationNoAvailableHostError, gi as T3RpcOperationsService, hi as T3RpcOperationsLive, iD as EnvironmentAuthorizationError, mi as T3RpcOperations, os as ConnectionTransientError, oy as OrchestrationGetSnapshotError, rx as PreviewAutomationExecutionError, sx as PreviewAutomationInvalidSelectorError, us as PreparedConnection, vS as TerminalCwdNotFoundError, vi as T3Rpc, wS as TerminalNotRunningError, xi as CliServerConfig, yS as TerminalCwdStatError, yi as T3RpcService, yv as ServerSettingsError, yx as PreviewAutomationRequestQueueClosedError } from "./shared.js";
1
+ import { $O as EnvironmentAuthorizationError, $S as TerminalCwdStatError, Ax as PreviewAutomationControlInterruptedError, Ay as OrchestrationDispatchCommandError, Ci as CliServerConfig, Hx as PreviewAutomationNoAvailableHostError, Jx as PreviewAutomationRemoteUnavailableError, Ly as OrchestrationGetSnapshotError, Px as PreviewAutomationExecutionError, QS as TerminalCwdNotFoundError, Qi as RpcError, Rd as KeybindingsConfigError, Rx as PreviewAutomationInvalidSelectorError, Si as WsClient, Tx as PreviewAutomationClientDisconnectedError, Xv as ServerSettingsError, Xx as PreviewAutomationRequestQueueClosedError, ZS as TerminalCwdNotDirectoryError, Zi as OrchestrationError, _i as T3RpcOperationsLive, bi as T3Rpc, eS as PreviewAutomationResultTooLargeError, eb as OrchestrationSearchThreadsError, fS as PreviewAutomationUnavailableError, gi as T3RpcOperations, hC as TerminalWriteError, iC as TerminalNotRunningError, jn as T3PreparedConnectionProvider, lS as PreviewAutomationTargetNotEditableError, ms as PreparedConnection, nC as TerminalHistoryError, oC as TerminalResizeError, pS as PreviewAutomationUnsupportedClientError, rs as ConnectionAttemptError, sS as PreviewAutomationTabNotFoundError, uC as TerminalSessionLookupError, uS as PreviewAutomationTimeoutError, us as ConnectionTransientError, vi as T3RpcOperationsService, xi as T3RpcService, yi as makeT3RpcOperations, zx as PreviewAutomationMalformedResponseError } from "./shared.js";
2
2
  import * as Context from "effect/Context";
3
3
  import * as Effect from "effect/Effect";
4
- import * as Layer from "effect/Layer";
5
4
  import * as Scope from "effect/Scope";
5
+ import * as Layer from "effect/Layer";
6
6
  import "effect/unstable/socket/Socket";
7
- import { HttpClient } from "effect/unstable/http";
8
- //#region src/connection/prepared.d.ts
9
- declare const T3PreparedConnectionProvider_base: Context.ServiceClass<T3PreparedConnectionProvider, "t3cli/T3PreparedConnectionProvider", {
10
- readonly get: Effect.Effect<PreparedConnection, ConnectionAttemptError | T3CodeConnectionError>;
11
- }>;
12
- declare class T3PreparedConnectionProvider extends T3PreparedConnectionProvider_base {}
13
- //#endregion
14
7
  //#region src/rpc/session.d.ts
15
8
  interface T3RpcSession {
16
9
  readonly client: WsClient;
@@ -2847,6 +2840,7 @@ declare const makeT3RpcLayer: () => Effect.Effect<{
2847
2840
  readonly output: string | null;
2848
2841
  };
2849
2842
  }[];
2843
+ readonly threadSnapshotPagination?: boolean;
2850
2844
  }, import("effect/unstable/rpc/RpcClientError").RpcClientError | (Discard extends true ? never : EnvironmentAuthorizationError | KeybindingsConfigError | ServerSettingsError), never>;
2851
2845
  readonly "server.probe": <const AsQueue extends boolean = false, const Discard = false>(input: {}, options?: {
2852
2846
  readonly headers?: import("effect/unstable/http/Headers").Input | undefined;
@@ -6119,6 +6113,7 @@ declare const makeT3RpcLayer: () => Effect.Effect<{
6119
6113
  readonly output: string | null;
6120
6114
  };
6121
6115
  }[];
6116
+ readonly threadSnapshotPagination?: boolean;
6122
6117
  }, import("effect/unstable/rpc/RpcClientError").RpcClientError | (Discard extends true ? never : EnvironmentAuthorizationError | KeybindingsConfigError | ServerSettingsError), never>;
6123
6118
  readonly "server.probe": <const AsQueue extends boolean = false, const Discard = false>(input: {}, options?: {
6124
6119
  readonly headers?: import("effect/unstable/http/Headers").Input | undefined;
package/dist/rpc.js CHANGED
@@ -1,2 +1,2 @@
1
- import { $i as makeT3RpcOperations, Qi as T3RpcOperationsLive, Xn as makeT3RpcLayer, Yn as T3RpcLive, Zi as T3RpcOperations, ea as T3Rpc, ta as RpcError } from "./shared.js";
1
+ import { $i as T3RpcOperations, Xn as makeT3RpcLayer, Yn as T3RpcLive, ea as T3RpcOperationsLive, na as T3Rpc, ra as RpcError, ta as makeT3RpcOperations } from "./shared.js";
2
2
  export { RpcError, T3Rpc, T3RpcLive, T3RpcOperations, T3RpcOperationsLive, makeT3RpcLayer, makeT3RpcOperations };
package/dist/runtime.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- import { An as AppLayer, Bn as T3OrchestrationLayer, Fn as T3AuthPairingLayer, In as T3AuthTransportLayer, Ln as T3LocalAuthLayer, Mn as BaseAppLayer, Nn as BaseAuthAppLayer, Pn as T3AuthLayer, Rn as T3LocalAuthOriginLayer, Vn as T3PreviewAutomationLayer, jn as AuthAppLayer, zn as T3LocalAuthTokenLayer } from "./shared.js";
1
+ import { Bn as T3LocalAuthOriginLayer, Fn as BaseAuthAppLayer, Hn as T3OrchestrationLayer, In as T3AuthLayer, Ln as T3AuthPairingLayer, Mn as AppLayer, Nn as AuthAppLayer, Pn as BaseAppLayer, Rn as T3AuthTransportLayer, Un as T3PreviewAutomationLayer, Vn as T3LocalAuthTokenLayer, zn as T3LocalAuthLayer } from "./shared.js";
2
2
  export { AppLayer, AuthAppLayer, BaseAppLayer, BaseAuthAppLayer, T3AuthLayer, T3AuthPairingLayer, T3AuthTransportLayer, T3LocalAuthLayer, T3LocalAuthOriginLayer, T3LocalAuthTokenLayer, T3OrchestrationLayer, T3PreviewAutomationLayer };
@@ -1,4 +1,4 @@
1
- import { Ay as get, Bk as gen, Dy as shutdown, Ey as offer, Lk as forever, Ny as update, Oy as take, _A as tx, bA as void_, dA as tap, hk as acquireRelease, jy as make, kk as ensuring, ky as unbounded, vA as txRetry, zk as forkScoped } from "../shared.js";
1
+ import { AM as tx, Dj as acquireRelease, Fy as unbounded, Iy as get, Ly as make, My as offer, NM as void_, Ny as shutdown, Py as take, Qj as gen, Vj as ensuring, Yj as forever, Zj as forkScoped, jM as txRetry, wM as tap, zy as update } from "../shared.js";
2
2
  //#region upstream-t3code/packages/shared/src/DrainableWorker.ts
3
3
  /**
4
4
  * Create a drainable worker that processes items from an unbounded queue.
@@ -1,4 +1,4 @@
1
- import { Ay as get, Bk as gen, Ck as catchCause, Dy as shutdown, Ey as offer, Lk as forever, My as modify, Nk as flatMap, Oy as take, _A as tx, bA as void_, dA as tap, hk as acquireRelease, jy as make, ky as unbounded, vA as txRetry, xk as asVoid, zk as forkScoped } from "../shared.js";
1
+ import { AM as tx, Dj as acquireRelease, Fj as catchCause, Fy as unbounded, Gj as flatMap, Iy as get, Ly as make, My as offer, NM as void_, Nj as asVoid, Ny as shutdown, Py as take, Qj as gen, Ry as modify, Yj as forever, Zj as forkScoped, jM as txRetry, wM as tap } from "../shared.js";
2
2
  //#region upstream-t3code/packages/shared/src/KeyedCoalescingWorker.ts
3
3
  const makeKeyedCoalescingWorker = (options) => gen(function* () {
4
4
  const queue = yield* acquireRelease(unbounded(), shutdown);
@@ -18,6 +18,11 @@ interface NetServiceShape {
18
18
  * Checks loopback availability on both IPv4 and IPv6 localhost addresses.
19
19
  */
20
20
  readonly isPortAvailableOnLoopback: (port: number) => Effect.Effect<boolean>;
21
+ /**
22
+ * Returns true when something accepts TCP connections on {host, port}.
23
+ * Unlike the bind-side checks this works for privileged ports (<1024).
24
+ */
25
+ readonly hasListenerOnHost: (port: number, host: string) => Effect.Effect<boolean>;
21
26
  /**
22
27
  * Reserve an ephemeral loopback port and release it immediately.
23
28
  */
@@ -35,6 +40,7 @@ declare class NetService extends NetService_base {}
35
40
  declare const make: () => {
36
41
  canListenOnHost: (port: number, host: string) => Effect.Effect<boolean>;
37
42
  isPortAvailableOnLoopback: (port: number) => Effect.Effect<boolean>;
43
+ hasListenerOnHost: (port: number, host: string) => Effect.Effect<boolean>;
38
44
  reserveLoopbackPort: (host?: string) => Effect.Effect<number, NetError>;
39
45
  findAvailablePort: (preferred: number) => Effect.Effect<number, NetError, never>;
40
46
  };
@@ -1,4 +1,4 @@
1
- import { Bj as hasProperty, Bk as gen, Gj as isString, SA as zipWith, Sk as callback, VA as sync$1, Wj as isObject, cA as succeed, hj as Service, jk as fail, kA as TaggedError, uA as sync } from "../shared.js";
1
+ import { AN as Service, CM as sync, FM as zipWith, HM as TaggedError, Pj as callback, Qj as gen, Uj as fail, aP as isObject, eN as sync$1, oP as isString, tP as hasProperty, xM as succeed } from "../shared.js";
2
2
  import * as NodeNet from "node:net";
3
3
  //#region upstream-t3code/packages/shared/src/Net.ts
4
4
  var NetError = class extends TaggedError("NetError") {};
@@ -114,6 +114,7 @@ const make = () => {
114
114
  return {
115
115
  canListenOnHost,
116
116
  isPortAvailableOnLoopback,
117
+ hasListenerOnHost,
117
118
  reserveLoopbackPort,
118
119
  findAvailablePort: (preferred) => gen(function* () {
119
120
  if (preferred > 0 && (yield* isPortAvailableOnLoopback(preferred))) return preferred;
@@ -1,2 +1,2 @@
1
- import { Dn as createAdvertisedEndpoint, En as classifyHostedHttpsCompatibility, On as deriveWsBaseUrl, Tn as CreateAdvertisedEndpointInput, kn as normalizeHttpBaseUrl } from "../shared.js";
1
+ import { An as normalizeHttpBaseUrl, Dn as classifyHostedHttpsCompatibility, En as CreateAdvertisedEndpointInput, On as createAdvertisedEndpoint, kn as deriveWsBaseUrl } from "../shared.js";
2
2
  export { CreateAdvertisedEndpointInput, classifyHostedHttpsCompatibility, createAdvertisedEndpoint, deriveWsBaseUrl, normalizeHttpBaseUrl };
@@ -1,2 +1,2 @@
1
- import { Go as createAdvertisedEndpoint, Ko as deriveWsBaseUrl, Wo as classifyHostedHttpsCompatibility, qo as normalizeHttpBaseUrl } from "../shared.js";
1
+ import { Jo as createAdvertisedEndpoint, Xo as normalizeHttpBaseUrl, Yo as deriveWsBaseUrl, qo as classifyHostedHttpsCompatibility } from "../shared.js";
2
2
  export { classifyHostedHttpsCompatibility, createAdvertisedEndpoint, deriveWsBaseUrl, normalizeHttpBaseUrl };
@@ -1,4 +1,4 @@
1
- import { CD as EnvironmentId, RD as ThreadId, Vy as OrchestrationThreadShell, vy as OrchestrationProjectShell } from "../shared.js";
1
+ import { Nk as ThreadId, Yy as OrchestrationProjectShell, vb as OrchestrationThreadShell, vk as EnvironmentId } from "../shared.js";
2
2
  //#region upstream-t3code/packages/shared/src/agentAwareness.d.ts
3
3
  type AgentAwarenessPhase = "starting" | "running" | "waiting_for_approval" | "waiting_for_input" | "completed" | "failed" | "stale";
4
4
  interface AgentAwarenessState {
@@ -1,4 +1,4 @@
1
- import { b_ as BackgroundActivitySettings, v_ as BackgroundActivityProfile, vv as ServerSettings } from "../shared.js";
1
+ import { Y_ as BackgroundActivityProfile, Yv as ServerSettings, Z_ as BackgroundActivitySettings } from "../shared.js";
2
2
  import * as Duration from "effect/Duration";
3
3
  //#region upstream-t3code/packages/shared/src/backgroundActivitySettings.d.ts
4
4
  interface ResolvedBackgroundActivitySettings {
@@ -13,18 +13,37 @@ declare const CONNECT_OAUTH_SCOPES: readonly ["openid", "profile", "email"];
13
13
  interface ConnectAuthorizeRequest {
14
14
  readonly state: string;
15
15
  readonly challenge: string;
16
+ /**
17
+ * Present when a loopback CLI initiated the request: the hosted /connect
18
+ * page then asks Clerk to redirect the authorization code straight to
19
+ * `http://127.0.0.1:<port>/callback` instead of the hosted callback page.
20
+ */
21
+ readonly loopbackPort?: number;
16
22
  }
17
23
  /**
18
- * The URL a headless CLI prints for the user to open on a machine with a
19
- * browser. `state` and `code_challenge` ride the fragment so they never reach
20
- * the hosted app's server or CDN logs; neither is a secret.
24
+ * The URL the CLI prints for the user to open in a browser. `state` and
25
+ * `code_challenge` ride the fragment so they never reach the hosted app's
26
+ * server or CDN logs; neither is a secret.
27
+ *
28
+ * Both CLI flows route through the hosted /connect page rather than hitting
29
+ * Clerk's /oauth/authorize directly: a signed-out browser sent straight to
30
+ * /oauth/authorize goes through Clerk's sign-in redirect, which does not
31
+ * reliably preserve the authorize query parameters (state, response_type,
32
+ * code_challenge). The hosted page waits for a Clerk session first, then
33
+ * forwards the request with the parameters intact.
21
34
  */
22
35
  declare function buildConnectAuthorizeRequestUrl(input: {
23
36
  readonly hostedAppUrl: string;
24
37
  readonly state: string;
25
38
  readonly challenge: string;
39
+ readonly loopbackPort?: number;
26
40
  }): string;
27
41
  declare function readConnectAuthorizeRequest(url: URL): ConnectAuthorizeRequest | null;
42
+ /**
43
+ * Redirect URI for the CLI's local callback listener. Must stay in sync with
44
+ * the redirect URI registered on the Clerk CLI OAuth application.
45
+ */
46
+ declare function connectLoopbackRedirectUri(port: number): string;
28
47
  declare function connectCallbackUrl(hostedAppUrl: string): string;
29
48
  declare function buildConnectClerkAuthorizeUrl(input: {
30
49
  readonly authorizationEndpoint: string;
@@ -55,4 +74,4 @@ declare function encodeConnectAuthCode(input: ConnectAuthCode): string;
55
74
  declare function checkConnectAuthCode(blob: string, expectedState: string): ConnectAuthCode | string;
56
75
  declare function parseConnectAuthCode(blob: string): ConnectAuthCode | null;
57
76
  //#endregion
58
- export { CONNECT_OAUTH_SCOPES, ConnectAuthCode, ConnectAuthorizeRequest, DEFAULT_HOSTED_APP_URL, buildConnectAuthorizeRequestUrl, buildConnectClerkAuthorizeUrl, checkConnectAuthCode, connectCallbackUrl, encodeConnectAuthCode, parseConnectAuthCode, readConnectAuthorizeRequest };
77
+ export { CONNECT_OAUTH_SCOPES, ConnectAuthCode, ConnectAuthorizeRequest, DEFAULT_HOSTED_APP_URL, buildConnectAuthorizeRequestUrl, buildConnectClerkAuthorizeUrl, checkConnectAuthCode, connectCallbackUrl, connectLoopbackRedirectUri, encodeConnectAuthCode, parseConnectAuthCode, readConnectAuthorizeRequest };
@@ -1,8 +1,10 @@
1
- import { Oa as readHashParams } from "../shared.js";
1
+ import { Aa as readHashParams } from "../shared.js";
2
2
  //#region upstream-t3code/packages/shared/src/connectAuth.ts
3
3
  const CONNECT_AUTH_STATE_PARAM = "state";
4
4
  const CONNECT_AUTH_CHALLENGE_PARAM = "challenge";
5
+ const CONNECT_AUTH_PORT_PARAM = "port";
5
6
  const CONNECT_AUTH_CODE_SEPARATOR = ".";
7
+ const CONNECT_LOOPBACK_CALLBACK_PATH = "/callback";
6
8
  const CONNECT_AUTHORIZE_PATH = "/connect";
7
9
  const CONNECT_CALLBACK_PATH = "/connect/callback";
8
10
  /**
@@ -21,13 +23,24 @@ const CONNECT_OAUTH_SCOPES = [
21
23
  "email"
22
24
  ];
23
25
  /**
24
- * The URL a headless CLI prints for the user to open on a machine with a
25
- * browser. `state` and `code_challenge` ride the fragment so they never reach
26
- * the hosted app's server or CDN logs; neither is a secret.
26
+ * The URL the CLI prints for the user to open in a browser. `state` and
27
+ * `code_challenge` ride the fragment so they never reach the hosted app's
28
+ * server or CDN logs; neither is a secret.
29
+ *
30
+ * Both CLI flows route through the hosted /connect page rather than hitting
31
+ * Clerk's /oauth/authorize directly: a signed-out browser sent straight to
32
+ * /oauth/authorize goes through Clerk's sign-in redirect, which does not
33
+ * reliably preserve the authorize query parameters (state, response_type,
34
+ * code_challenge). The hosted page waits for a Clerk session first, then
35
+ * forwards the request with the parameters intact.
27
36
  */
28
37
  function buildConnectAuthorizeRequestUrl(input) {
29
38
  const url = new URL(CONNECT_AUTHORIZE_PATH, input.hostedAppUrl);
30
- url.hash = new URLSearchParams([[CONNECT_AUTH_STATE_PARAM, input.state], [CONNECT_AUTH_CHALLENGE_PARAM, input.challenge]]).toString();
39
+ url.hash = new URLSearchParams([
40
+ [CONNECT_AUTH_STATE_PARAM, input.state],
41
+ [CONNECT_AUTH_CHALLENGE_PARAM, input.challenge],
42
+ ...input.loopbackPort === void 0 ? [] : [[CONNECT_AUTH_PORT_PARAM, String(input.loopbackPort)]]
43
+ ]).toString();
31
44
  return url.toString();
32
45
  }
33
46
  function readConnectAuthorizeRequest(url) {
@@ -35,10 +48,30 @@ function readConnectAuthorizeRequest(url) {
35
48
  const state = params.get(CONNECT_AUTH_STATE_PARAM)?.trim() ?? "";
36
49
  const challenge = params.get(CONNECT_AUTH_CHALLENGE_PARAM)?.trim() ?? "";
37
50
  if (!state || !challenge) return null;
38
- return {
51
+ const port = params.get(CONNECT_AUTH_PORT_PARAM);
52
+ if (port === null) return {
39
53
  state,
40
54
  challenge
41
55
  };
56
+ const loopbackPort = parseLoopbackPort(port.trim());
57
+ if (loopbackPort === null) return null;
58
+ return {
59
+ state,
60
+ challenge,
61
+ loopbackPort
62
+ };
63
+ }
64
+ function parseLoopbackPort(value) {
65
+ if (!/^\d{1,5}$/.test(value)) return null;
66
+ const port = Number(value);
67
+ return port >= 1 && port <= 65535 ? port : null;
68
+ }
69
+ /**
70
+ * Redirect URI for the CLI's local callback listener. Must stay in sync with
71
+ * the redirect URI registered on the Clerk CLI OAuth application.
72
+ */
73
+ function connectLoopbackRedirectUri(port) {
74
+ return `http://127.0.0.1:${port}${CONNECT_LOOPBACK_CALLBACK_PATH}`;
42
75
  }
43
76
  function connectCallbackUrl(hostedAppUrl) {
44
77
  return new URL(CONNECT_CALLBACK_PATH, hostedAppUrl).toString();
@@ -86,4 +119,4 @@ function parseConnectAuthCode(blob) {
86
119
  };
87
120
  }
88
121
  //#endregion
89
- export { CONNECT_OAUTH_SCOPES, DEFAULT_HOSTED_APP_URL, buildConnectAuthorizeRequestUrl, buildConnectClerkAuthorizeUrl, checkConnectAuthCode, connectCallbackUrl, encodeConnectAuthCode, parseConnectAuthCode, readConnectAuthorizeRequest };
122
+ export { CONNECT_OAUTH_SCOPES, DEFAULT_HOSTED_APP_URL, buildConnectAuthorizeRequestUrl, buildConnectClerkAuthorizeUrl, checkConnectAuthCode, connectCallbackUrl, connectLoopbackRedirectUri, encodeConnectAuthCode, parseConnectAuthCode, readConnectAuthorizeRequest };
@@ -1,4 +1,4 @@
1
- import { $k as orElseSucceed, Bk as gen, Dj as isSome, Zk as option, fO as Path, mO as FileSystem } from "../shared.js";
1
+ import { CA as Path, HN as isSome, Qj as gen, TA as FileSystem, fM as orElseSucceed, uM as option } from "../shared.js";
2
2
  //#region upstream-t3code/packages/shared/src/devHome.ts
3
3
  /**
4
4
  * Where development state lives, and how to keep it away from the shared
@@ -1,4 +1,4 @@
1
- import { BD as isNonEmpty, CD as Literal, Ej as isNone, HD as optionalKey, ID as decodeUnknownOption, OD as String$1, RD as fromJsonString, SD as Int, TD as Never, aO as decodeBase64Url, kD as Struct, n as normalizeDpopHtu, oO as decodeBase64UrlString, oj as getOrThrow, r as stableStringify, sO as encodeBase64Url, t as DpopPublicJwk$1 } from "../shared.js";
1
+ import { Gk as decodeUnknownOption, Lk as String$1, Mk as Literal, Pk as Never, Rk as Struct, VN as isNone, Yk as isNonEmpty, Zk as optionalKey, gA as encodeBase64Url, hA as decodeBase64UrlString, jk as Int, mA as decodeBase64Url, n as normalizeDpopHtu, qk as fromJsonString, r as stableStringify, t as DpopPublicJwk$1, yN as getOrThrow } from "../shared.js";
2
2
  import * as nc from "node:crypto";
3
3
  //#region node_modules/.pnpm/@noble+hashes@1.8.0/node_modules/@noble/hashes/esm/cryptoNode.js
4
4
  /**
@@ -1,4 +1,4 @@
1
- import { $w as SourceControlProviderInfo, Iw as VcsStatusLocalResult, Lw as VcsStatusRemoteResult, Nw as VcsRef, Rw as VcsStatusResult, zw as VcsStatusStreamEvent } from "../shared.js";
1
+ import { WD as SourceControlProviderInfo, _T as VcsStatusRemoteResult, gT as VcsStatusLocalResult, pT as VcsRef, vT as VcsStatusResult, yT as VcsStatusStreamEvent } from "../shared.js";
2
2
  //#region upstream-t3code/packages/shared/src/git.d.ts
3
3
  declare const WORKTREE_BRANCH_PREFIX = "t3code";
4
4
  /**
@@ -1,2 +1,2 @@
1
- import { Ho as httpHeaderRedactionLayer } from "../shared.js";
1
+ import { Go as httpHeaderRedactionLayer } from "../shared.js";
2
2
  export { httpHeaderRedactionLayer };
@@ -1,4 +1,4 @@
1
- import { Bk as gen, EA as upTo, Kk as mapError, Pk as fn, TA as spaced, Uk as logDebug, Vk as ignore, Wk as logWarning, _T as get, bT as set, cA as succeed, dT as HttpClient, fA as tapError, fT as filterStatusOk, hT as transform, jk as fail, kj as match, mT as tap, pA as timeoutOption, pT as retry, uj as millis, vT as get$1, yT as make } from "../shared.js";
1
+ import { $j as ignore, DD as set, ED as make, EM as timeoutOption, Kj as fn, Qj as gen, RM as spaced, SD as transform, TD as get$1, TM as tapError, Uj as fail, WN as match, bD as retry, iM as mapError, nM as logWarning, tM as logDebug, vD as HttpClient, wD as get, wN as millis, xD as tap, xM as succeed, yD as filterStatusOk, zM as upTo } from "../shared.js";
2
2
  //#region upstream-t3code/packages/shared/src/httpReadiness.ts
3
3
  const DEFAULT_HTTP_READY_PROBE_TIMEOUT_MS = 1e3;
4
4
  /**
@@ -1,4 +1,4 @@
1
- import { Ld as ResolvedKeybindingRule, Rd as ResolvedKeybindingsConfig, Sd as KeybindingShortcut, Td as KeybindingWhenNode, xd as KeybindingRule } from "../shared.js";
1
+ import { Id as KeybindingWhenNode, Jd as ResolvedKeybindingRule, Md as KeybindingRule, Nd as KeybindingShortcut, Yd as ResolvedKeybindingsConfig } from "../shared.js";
2
2
  //#region upstream-t3code/packages/shared/src/keybindings.d.ts
3
3
  declare const DEFAULT_KEYBINDINGS: ReadonlyArray<KeybindingRule>;
4
4
  declare function parseKeybindingShortcut(value: string): KeybindingShortcut | null;
@@ -1,4 +1,4 @@
1
- import { Hm as ProviderInstanceId, Im as ProviderDriverKind, Wv as ModelSelection, Zd as ModelCapabilities, rf as ProviderOptionSelection, tf as ProviderOptionDescriptor } from "../shared.js";
1
+ import { $m as ProviderInstanceId, cf as ModelCapabilities, ff as ProviderOptionDescriptor, mf as ProviderOptionSelection, qm as ProviderDriverKind, xy as ModelSelection } from "../shared.js";
2
2
  //#region upstream-t3code/packages/shared/src/model.d.ts
3
3
  interface SelectableModelOption {
4
4
  slug: string;
@@ -1,2 +1,2 @@
1
- import { Jo as OAuthScopeEncodingError, Qo as parseOAuthScope, Xo as oauthScopeSetEquals, Yo as encodeOAuthScope, Zo as parseAllowedOAuthScope } from "../shared.js";
1
+ import { $o as oauthScopeSetEquals, Qo as encodeOAuthScope, Zo as OAuthScopeEncodingError, es as parseAllowedOAuthScope, ts as parseOAuthScope } from "../shared.js";
2
2
  export { OAuthScopeEncodingError, encodeOAuthScope, oauthScopeSetEquals, parseAllowedOAuthScope, parseOAuthScope };
@@ -1,4 +1,4 @@
1
- import { $A as make, D as RotatingFileSink, Dj as isSome, Lk as forever, MA as hasInterruptsOnly, Nk as flatMap, PA as pretty, Pk as fn, QA as NativeSpan, Tj as getOrUndefined, Vk as ignore, XA as isSuccess, bA as void_, gk as addFinalizer, jA as findErrorOption, sA as sleep, uA as sync, vk as andThen, xA as withTracerEnabled, zk as forkScoped } from "../shared.js";
1
+ import { $j as ignore, Aj as andThen, BN as getOrUndefined, CM as sync, D as RotatingFileSink, GM as hasInterruptsOnly, Gj as flatMap, HN as isSome, Kj as fn, NM as void_, Oj as addFinalizer, PM as withTracerEnabled, WM as findErrorOption, Yj as forever, Zj as forkScoped, bM as sleep, dN as NativeSpan, fN as make, lN as isSuccess, qM as pretty } from "../shared.js";
2
2
  //#region upstream-t3code/packages/shared/src/observability.ts
3
3
  const FLUSH_BUFFER_THRESHOLD = 256;
4
4
  const textEncoder = new TextEncoder();
@@ -1,4 +1,4 @@
1
- import { AD as TaggedErrorClass, DD as Number, OD as String, VD as optional, wD as Literals, xD as Defect, zD as is } from "../shared.js";
1
+ import { Ik as Number, Jk as is, Lk as String, Nk as Literals, Xk as optional, kk as Defect, zk as TaggedErrorClass } from "../shared.js";
2
2
  //#region upstream-t3code/packages/shared/src/preview.ts
3
3
  /**
4
4
  * Pure URL helpers shared between the preview server, desktop main process,
@@ -1,4 +1,4 @@
1
- import { bx as PreviewAutomationResizeInput, cS as PreviewViewportPresetId, lS as PreviewViewportSetting } from "../shared.js";
1
+ import { HS as PreviewViewportPresetId, US as PreviewViewportSetting, Zx as PreviewAutomationResizeInput } from "../shared.js";
2
2
  //#region upstream-t3code/packages/shared/src/previewViewport.d.ts
3
3
  interface PreviewViewportPreset {
4
4
  readonly id: PreviewViewportPresetId;
@@ -1,4 +1,4 @@
1
- import { oy as PREVIEW_VIEWPORT_PRESET_IDS } from "../shared.js";
1
+ import { fy as PREVIEW_VIEWPORT_PRESET_IDS } from "../shared.js";
2
2
  //#region upstream-t3code/packages/shared/src/previewViewport.ts
3
3
  const PREVIEW_VIEWPORT_PRESET_DEFINITIONS = {
4
4
  "iphone-se": {
@@ -1,4 +1,4 @@
1
- import { Zy as ProjectScript } from "../shared.js";
1
+ import { Ob as ProjectScript } from "../shared.js";
2
2
  //#region upstream-t3code/packages/shared/src/projectScripts.d.ts
3
3
  interface ProjectScriptRuntimeEnvInput {
4
4
  project: {
@@ -1,4 +1,4 @@
1
- import { AD as TaggedErrorClass, OD as String, VD as optional, wD as Literals, xD as Defect } from "../shared.js";
1
+ import { Lk as String, Nk as Literals, Xk as optional, kk as Defect, zk as TaggedErrorClass } from "../shared.js";
2
2
  //#region upstream-t3code/packages/shared/src/relayAuth.ts
3
3
  const ClerkPublishableKeyPrefix = Literals([
4
4
  "pk_test",
@@ -1,4 +1,4 @@
1
- import { ST as RelayClientInstallProgressEvent } from "../shared.js";
1
+ import { PT as RelayClientInstallProgressEvent } from "../shared.js";
2
2
  import * as Context from "effect/Context";
3
3
  import * as Effect from "effect/Effect";
4
4
  import * as Layer from "effect/Layer";