t3code-cli 0.14.1 → 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 (185) hide show
  1. package/README.md +37 -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 +1305 -424
  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 +7 -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 +2 -2
  17. package/dist/client-runtime/operations/projects.js +2 -2
  18. package/dist/client-runtime/operations.d.ts +2 -2
  19. package/dist/client-runtime/operations.js +2 -2
  20. package/dist/client-runtime/platform.d.ts +1 -1
  21. package/dist/client-runtime/platform.js +1 -1
  22. package/dist/client-runtime/relay.d.ts +13 -2
  23. package/dist/client-runtime/relay.js +12 -2
  24. package/dist/client-runtime/rpc.d.ts +2 -2
  25. package/dist/client-runtime/rpc.js +2 -2
  26. package/dist/client-runtime/state/assets.d.ts +17 -11
  27. package/dist/client-runtime/state/assets.js +1 -1
  28. package/dist/client-runtime/state/auth.d.ts +1 -1
  29. package/dist/client-runtime/state/auth.js +1 -1
  30. package/dist/client-runtime/state/connections.js +1 -1
  31. package/dist/client-runtime/state/entities.d.ts +1 -1
  32. package/dist/client-runtime/state/entities.js +1 -1
  33. package/dist/client-runtime/state/filesystem.d.ts +1 -1
  34. package/dist/client-runtime/state/filesystem.js +1 -1
  35. package/dist/client-runtime/state/git.d.ts +6 -5
  36. package/dist/client-runtime/state/git.js +1 -1
  37. package/dist/client-runtime/state/models.d.ts +1 -1
  38. package/dist/client-runtime/state/models.js +1 -1
  39. package/dist/client-runtime/state/orchestration.d.ts +42 -2
  40. package/dist/client-runtime/state/orchestration.js +13 -1
  41. package/dist/client-runtime/state/presentation.d.ts +15 -3
  42. package/dist/client-runtime/state/presentation.js +1 -1
  43. package/dist/client-runtime/state/preview.d.ts +58 -48
  44. package/dist/client-runtime/state/preview.js +3 -2
  45. package/dist/client-runtime/state/project-grouping.d.ts +26 -2
  46. package/dist/client-runtime/state/project-grouping.js +83 -3
  47. package/dist/client-runtime/state/projects.d.ts +24 -18
  48. package/dist/client-runtime/state/projects.js +1 -1
  49. package/dist/client-runtime/state/pull-requests.d.ts +478 -0
  50. package/dist/client-runtime/state/pull-requests.js +172 -0
  51. package/dist/client-runtime/state/relay.d.ts +1 -1
  52. package/dist/client-runtime/state/relay.js +1 -1
  53. package/dist/client-runtime/state/review.d.ts +16 -1
  54. package/dist/client-runtime/state/review.js +27 -6
  55. package/dist/client-runtime/state/runtime.d.ts +2 -2
  56. package/dist/client-runtime/state/runtime.js +2 -2
  57. package/dist/client-runtime/state/server.d.ts +311 -172
  58. package/dist/client-runtime/state/server.js +192 -16
  59. package/dist/client-runtime/state/session.d.ts +77 -7
  60. package/dist/client-runtime/state/session.js +32 -3
  61. package/dist/client-runtime/state/shell.d.ts +47 -7
  62. package/dist/client-runtime/state/shell.js +1 -1
  63. package/dist/client-runtime/state/source-control.d.ts +2 -2
  64. package/dist/client-runtime/state/source-control.js +1 -1
  65. package/dist/client-runtime/state/subagentRuntime.d.ts +145 -0
  66. package/dist/client-runtime/state/subagentRuntime.js +521 -0
  67. package/dist/client-runtime/state/terminal.d.ts +17 -17
  68. package/dist/client-runtime/state/terminal.js +1 -1
  69. package/dist/client-runtime/state/thread-search.d.ts +23 -0
  70. package/dist/client-runtime/state/thread-search.js +38 -0
  71. package/dist/client-runtime/state/thread-settled.d.ts +32 -4
  72. package/dist/client-runtime/state/thread-settled.js +2 -157
  73. package/dist/client-runtime/state/thread-sort.d.ts +59 -2
  74. package/dist/client-runtime/state/thread-sort.js +128 -2
  75. package/dist/client-runtime/state/threads.d.ts +115 -3
  76. package/dist/client-runtime/state/threads.js +309 -28
  77. package/dist/client-runtime/state/vcs.d.ts +14 -14
  78. package/dist/client-runtime/state/vcs.js +1 -1
  79. package/dist/config.d.ts +1 -1
  80. package/dist/config.js +1 -1
  81. package/dist/connection.d.ts +1 -1
  82. package/dist/connection.js +1 -1
  83. package/dist/contracts.d.ts +1 -1
  84. package/dist/contracts.js +1 -1
  85. package/dist/index.d.ts +1 -1
  86. package/dist/index.js +1 -1
  87. package/dist/node.d.ts +1 -1
  88. package/dist/node.js +1 -1
  89. package/dist/orchestration.d.ts +155 -6
  90. package/dist/orchestration.js +2 -2
  91. package/dist/preview.d.ts +1 -1
  92. package/dist/preview.js +1 -1
  93. package/dist/rpc.d.ts +887 -360
  94. package/dist/rpc.js +1 -1
  95. package/dist/runtime.d.ts +1 -1
  96. package/dist/runtime.js +1 -1
  97. package/dist/shared/DrainableWorker.js +1 -1
  98. package/dist/shared/KeyedCoalescingWorker.js +1 -1
  99. package/dist/shared/Net.d.ts +6 -0
  100. package/dist/shared/Net.js +2 -1
  101. package/dist/shared/advertisedEndpoint.d.ts +1 -1
  102. package/dist/shared/advertisedEndpoint.js +1 -1
  103. package/dist/shared/agentAwareness.d.ts +1 -1
  104. package/dist/shared/backgroundActivitySettings.d.ts +1 -1
  105. package/dist/shared/composerInlineTokens.js +1 -1
  106. package/dist/shared/connectAuth.d.ts +23 -4
  107. package/dist/shared/connectAuth.js +40 -7
  108. package/dist/shared/devHome.js +1 -1
  109. package/dist/shared/dpop.js +1 -1
  110. package/dist/shared/git.d.ts +1 -1
  111. package/dist/shared/httpObservability.js +1 -1
  112. package/dist/shared/httpReadiness.js +1 -1
  113. package/dist/shared/keybindings.d.ts +2 -2
  114. package/dist/shared/keybindings.js +15 -1
  115. package/dist/shared/model.d.ts +1 -1
  116. package/dist/shared/oauthScope.js +1 -1
  117. package/dist/shared/observability.d.ts +8 -1
  118. package/dist/shared/observability.js +49 -5
  119. package/dist/shared/path.js +1 -1
  120. package/dist/shared/preview.js +1 -1
  121. package/dist/shared/previewViewport.d.ts +1 -1
  122. package/dist/shared/previewViewport.js +1 -1
  123. package/dist/shared/projectFavicon.d.ts +2 -1
  124. package/dist/shared/projectFavicon.js +13 -1
  125. package/dist/shared/projectScripts.d.ts +1 -1
  126. package/dist/shared/relayAuth.js +1 -1
  127. package/dist/shared/relayClient.d.ts +1 -1
  128. package/dist/shared/relayClient.js +1 -1
  129. package/dist/shared/relayJwt.js +1 -1
  130. package/dist/shared/relayTracing.js +1 -1
  131. package/dist/shared/relayUrl.js +1 -1
  132. package/dist/shared/remote.js +1 -1
  133. package/dist/shared/schemaYaml.js +3 -3
  134. package/dist/shared/semver.js +1 -1
  135. package/dist/shared/serverSettings.d.ts +1 -1
  136. package/dist/shared/serverSettings.js +1 -1
  137. package/dist/shared/shell.d.ts +6 -1
  138. package/dist/shared/shell.js +42 -4
  139. package/dist/shared/sourceControl.d.ts +1 -1
  140. package/dist/shared/t3ProjectFile.d.ts +9 -1
  141. package/dist/shared/t3ProjectFile.js +12 -2
  142. package/dist/shared/terminalLabels.d.ts +1 -1
  143. package/dist/shared/threadEnvMode.d.ts +29 -0
  144. package/dist/shared/threadEnvMode.js +24 -0
  145. package/dist/shared/toolActivity.d.ts +1 -1
  146. package/dist/shared/usageFormat.d.ts +34 -0
  147. package/dist/shared/usageFormat.js +176 -0
  148. package/dist/shared/usageMerge.d.ts +78 -0
  149. package/dist/shared/usageMerge.js +241 -0
  150. package/dist/shared.d.ts +8268 -1372
  151. package/dist/shared.js +22185 -19774
  152. package/dist/t3tools.d.ts +2 -2
  153. package/dist/t3tools.js +2 -2
  154. package/package.json +5 -5
  155. package/src/application/error.ts +2 -2
  156. package/src/application/index.ts +2 -0
  157. package/src/application/service.ts +43 -5
  158. package/src/application/thread-commands.ts +78 -0
  159. package/src/application/threads.ts +156 -17
  160. package/src/cli/app.ts +4 -0
  161. package/src/cli/ask-lifecycle.ts +331 -0
  162. package/src/cli/ask.ts +390 -0
  163. package/src/cli/error.ts +70 -0
  164. package/src/cli/format/thread.ts +49 -7
  165. package/src/cli/search.ts +48 -0
  166. package/src/cli/thread.ts +12 -0
  167. package/src/cli/threads/messages.ts +33 -3
  168. package/src/cli/threads/pin.ts +46 -0
  169. package/src/cli/threads/send.ts +5 -1
  170. package/src/cli/threads/settle.ts +46 -0
  171. package/src/cli/threads/snooze.ts +117 -0
  172. package/src/cli/threads/start.ts +6 -1
  173. package/src/cli/threads/unpin.ts +48 -0
  174. package/src/cli/threads/unsettle.ts +48 -0
  175. package/src/cli/threads/unsnooze.ts +48 -0
  176. package/src/config/persist/schema.ts +1 -1
  177. package/src/connection/prepared.ts +12 -2
  178. package/src/orchestration/error.ts +10 -0
  179. package/src/orchestration/index.ts +1 -0
  180. package/src/orchestration/layer.ts +78 -0
  181. package/src/orchestration/service.ts +16 -3
  182. package/src/rpc/error.ts +2 -0
  183. package/src/rpc/operation.ts +2 -0
  184. package/src/rpc/ws-group.ts +3 -0
  185. package/src/runtime/layer.ts +9 -4
package/dist/rpc.js CHANGED
@@ -1,2 +1,2 @@
1
- import { Gi as T3RpcOperations, Gn as T3RpcLive, Ji as T3Rpc, Ki as T3RpcOperationsLive, Kn as makeT3RpcLayer, Yi as RpcError, qi as makeT3RpcOperations } 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 T3LocalAuthTokenLayer, Cn as BaseAppLayer, Dn as T3AuthTransportLayer, En as T3AuthPairingLayer, Mn as T3PreviewAutomationLayer, On as T3LocalAuthLayer, Sn as AuthAppLayer, Tn as T3AuthLayer, jn as T3OrchestrationLayer, kn as T3LocalAuthOriginLayer, wn as BaseAuthAppLayer, xn as AppLayer } 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 };
package/dist/runtime.js CHANGED
@@ -1,2 +1,2 @@
1
- import { Bn as T3LocalAuthLayer, Fn as BaseAppLayer, Hn as T3LocalAuthTokenLayer, In as BaseAuthAppLayer, Ln as T3AuthLayer, Nn as AppLayer, Pn as AuthAppLayer, Rn as T3AuthPairingLayer, Un as T3OrchestrationLayer, Vn as T3LocalAuthOriginLayer, Wn as T3PreviewAutomationLayer, zn as T3AuthTransportLayer } from "./shared.js";
1
+ import { Bn as BaseAuthAppLayer, Gn as T3LocalAuthOriginLayer, Hn as T3AuthPairingLayer, Jn as T3PreviewAutomationLayer, Kn as T3LocalAuthTokenLayer, Ln as AppLayer, Rn as AuthAppLayer, Un as T3AuthTransportLayer, Vn as T3AuthLayer, Wn as T3LocalAuthLayer, qn as T3OrchestrationLayer, zn as BaseAppLayer } from "./shared.js";
2
2
  export { AppLayer, AuthAppLayer, BaseAppLayer, BaseAuthAppLayer, T3AuthLayer, T3AuthPairingLayer, T3AuthTransportLayer, T3LocalAuthLayer, T3LocalAuthOriginLayer, T3LocalAuthTokenLayer, T3OrchestrationLayer, T3PreviewAutomationLayer };
@@ -1,4 +1,4 @@
1
- import { FO as tx, IO as txRetry, LD as acquireRelease, RO as void_, ZD as ensuring, _v as unbounded, aO as gen, gv as take, hv as shutdown, iO as forkScoped, kO as tap, mv as offer, rO as forever, vv as get, xv as update, yv as make } 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 { $D as flatMap, FO as tx, GD as catchCause, IO as txRetry, LD as acquireRelease, RO as void_, UD as asVoid, _v as unbounded, aO as gen, bv as modify, gv as take, hv as shutdown, iO as forkScoped, kO as tap, mv as offer, rO as forever, vv as get, yv as make } 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 { $k as hasProperty, BO as zipWith, EO as succeed, KO as TaggedError, OO as sync, QD as fail, WD as callback, aO as gen, iA as isString, kk as Service, rA as isObject, rk as sync$1 } 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 { _n as classifyHostedHttpsCompatibility, bn as normalizeHttpBaseUrl, gn as CreateAdvertisedEndpointInput, vn as createAdvertisedEndpoint, yn as deriveWsBaseUrl } 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 { Bo as normalizeHttpBaseUrl, Lo as classifyHostedHttpsCompatibility, Ro as createAdvertisedEndpoint, zo as deriveWsBaseUrl } 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 { $T as ThreadId, _v as OrchestrationThreadShell, tv as OrchestrationProjectShell, zT as EnvironmentId } 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 { Sg as BackgroundActivitySettings, bg as BackgroundActivityProfile, i_ 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 {
@@ -1,7 +1,7 @@
1
1
  //#region upstream-t3code/packages/shared/src/composerInlineTokens.ts
2
2
  const SKILL_TOKEN_REGEX = /(^|\s)\$([a-zA-Z][a-zA-Z0-9:_-]*)(?=\s)/g;
3
3
  const MENTION_TOKEN_REGEX = /(^|\s)@(?:"((?:\\.|[^"\\])*)"|([^\s@"]+))(?=\s)/g;
4
- const FILE_LINK_TOKEN_REGEX = /(^|\s)\[((?:\\.|[^\]\\])*)\]\(([^)\s]+)\)(?=\s)/g;
4
+ const FILE_LINK_TOKEN_REGEX = new RegExp(`(^|\\s)\\[((?:\\\\.|[^\\]\\\\]){0,512})\\]\\(([^)\\s]+)\\)(?=\\s)`, "g");
5
5
  const URI_SCHEME_REGEX = /^[A-Za-z][A-Za-z0-9+.-]*:/;
6
6
  const WINDOWS_DRIVE_PATH_REGEX = /^[A-Za-z]:[\\/]/;
7
7
  const SCOPED_PACKAGE_REFERENCE_REGEX = /^[a-z0-9][a-z0-9._-]*\/[a-z0-9][a-z0-9._-]*(?:\/[^\s@"]+)*$/;
@@ -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 { Sa 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 { Bk as isSome, OE as FileSystem, TE as Path, _O as orElseSucceed, aO as gen, hO as option } 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 { $T as Struct, AD as encodeBase64Url, KT as Int, OD as decodeBase64Url, QT as String$1, YT as Never, aE as decodeUnknownOption, dE as optionalKey, kD as decodeBase64UrlString, lE as isNonEmpty, n as normalizeDpopHtu, qT as Literal, r as stableStringify, sE as fromJsonString, t as DpopPublicJwk$1, xk as getOrThrow, zk as isNone } 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 { $S as VcsStatusLocalResult, XS as VcsRef, eC as VcsStatusRemoteResult, gC as SourceControlProviderInfo, nC as VcsStatusStreamEvent, tC as VcsStatusResult } 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 { Fo as httpHeaderRedactionLayer } from "../shared.js";
1
+ import { Go as httpHeaderRedactionLayer } from "../shared.js";
2
2
  export { httpHeaderRedactionLayer };
@@ -1,4 +1,4 @@
1
- import { AO as tapError, BC as transform, EO as succeed, GC as set, HC as get, Hk as match, IC as HttpClient, LC as filterStatusOk, QD as fail, RC as retry, Tk as millis, UC as get$1, UO as spaced, WC as make, WO as upTo, aO as gen, cO as logDebug, dO as mapError, eO as fn, jO as timeoutOption, lO as logWarning, oO as ignore, zC as tap } 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 { Hu as KeybindingRule, Ku as KeybindingWhenNode, Uu as KeybindingShortcut, ad as ResolvedKeybindingsConfig, id as ResolvedKeybindingRule } 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;
@@ -6,7 +6,7 @@ declare function parseKeybindingWhenExpression(expression: string): KeybindingWh
6
6
  declare function compileResolvedKeybindingRule(rule: KeybindingRule): ResolvedKeybindingRule | null;
7
7
  declare function compileResolvedKeybindingsConfig(config: ReadonlyArray<KeybindingRule>): ResolvedKeybindingsConfig;
8
8
  declare const DEFAULT_RESOLVED_KEYBINDINGS: readonly {
9
- readonly command: "chat.new" | "chat.newLocal" | "commandPalette.toggle" | "composer.stash" | "diff.toggle" | "editor.openFavorite" | "modelPicker.jump.1" | "modelPicker.jump.2" | "modelPicker.jump.3" | "modelPicker.jump.4" | "modelPicker.jump.5" | "modelPicker.jump.6" | "modelPicker.jump.7" | "modelPicker.jump.8" | "modelPicker.jump.9" | "modelPicker.toggle" | "preview.focusUrl" | "preview.refresh" | "preview.resetZoom" | "preview.toggle" | "preview.zoomIn" | "preview.zoomOut" | "rightPanel.toggle" | "sidebar.toggle" | "terminal.close" | "terminal.new" | "terminal.split" | "terminal.splitVertical" | "terminal.toggle" | "thread.jump.1" | "thread.jump.2" | "thread.jump.3" | "thread.jump.4" | "thread.jump.5" | "thread.jump.6" | "thread.jump.7" | "thread.jump.8" | "thread.jump.9" | "thread.next" | "thread.previous" | `script.${string}.run`;
9
+ readonly command: "chat.new" | "chat.newLocal" | "commandPalette.toggle" | "composer.stash" | "diff.toggle" | "editor.openFavorite" | "filePicker.toggle" | "modelPicker.jump.1" | "modelPicker.jump.2" | "modelPicker.jump.3" | "modelPicker.jump.4" | "modelPicker.jump.5" | "modelPicker.jump.6" | "modelPicker.jump.7" | "modelPicker.jump.8" | "modelPicker.jump.9" | "modelPicker.toggle" | "preview.focusUrl" | "preview.refresh" | "preview.resetZoom" | "preview.toggle" | "preview.zoomIn" | "preview.zoomOut" | "projectSearch.toggle" | "rightPanel.toggle" | "sidebar.toggle" | "terminal.close" | "terminal.new" | "terminal.split" | "terminal.splitVertical" | "terminal.toggle" | "themeEditor.toggle" | "thread.jump.1" | "thread.jump.2" | "thread.jump.3" | "thread.jump.4" | "thread.jump.5" | "thread.jump.6" | "thread.jump.7" | "thread.jump.8" | "thread.jump.9" | "thread.next" | "thread.previous" | `script.${string}.run`;
10
10
  readonly shortcut: {
11
11
  readonly key: string;
12
12
  readonly metaKey: boolean;
@@ -1,4 +1,4 @@
1
- import { Nm as MODEL_PICKER_JUMP_KEYBINDING_COMMANDS, Rm as THREAD_JUMP_KEYBINDING_COMMANDS } from "../shared.js";
1
+ import { Ph as MODEL_PICKER_JUMP_KEYBINDING_COMMANDS, zh as THREAD_JUMP_KEYBINDING_COMMANDS } from "../shared.js";
2
2
  //#region upstream-t3code/packages/shared/src/keybindings.ts
3
3
  const DEFAULT_KEYBINDINGS = [
4
4
  {
@@ -77,6 +77,20 @@ const DEFAULT_KEYBINDINGS = [
77
77
  command: "commandPalette.toggle",
78
78
  when: "!terminalFocus"
79
79
  },
80
+ {
81
+ key: "mod+p",
82
+ command: "filePicker.toggle",
83
+ when: "!terminalFocus"
84
+ },
85
+ {
86
+ key: "mod+shift+f",
87
+ command: "projectSearch.toggle",
88
+ when: "!terminalFocus"
89
+ },
90
+ {
91
+ key: "mod+alt+shift+t",
92
+ command: "themeEditor.toggle"
93
+ },
80
94
  {
81
95
  key: "mod+s",
82
96
  command: "composer.stash",
@@ -1,4 +1,4 @@
1
- import { A_ as ModelSelection, Cd as ProviderOptionSelection, Kp as ProviderDriverKind, Qp as ProviderInstanceId, _d as ModelCapabilities, xd 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 { Go as parseOAuthScope, Ho as encodeOAuthScope, Uo as oauthScopeSetEquals, Vo as OAuthScopeEncodingError, Wo 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 };
@@ -92,6 +92,13 @@ interface SerializableSpan {
92
92
  readonly events: ReadonlyArray<readonly [name: string, startTime: bigint, attributes: Record<string, unknown>]>;
93
93
  }
94
94
  declare function compactTraceAttributes(attributes: Readonly<Record<string, unknown>>): TraceAttributes;
95
+ /**
96
+ * Clamps oversized attribute values on the serialized trace record so the file
97
+ * sink stays small, including strings nested inside arrays and objects (e.g.
98
+ * error stacks). Returns a new record when anything was clamped; never
99
+ * mutates the input (the live span's attributes are shared with other tracers).
100
+ */
101
+ declare function truncateTraceAttributes(attributes: TraceAttributes): TraceAttributes;
95
102
  declare function spanToTraceRecord(span: SerializableSpan): EffectTraceRecord;
96
103
  declare const makeTraceSink: (options: TraceSinkOptions) => Effect.Effect<{
97
104
  filePath: string;
@@ -102,4 +109,4 @@ declare const makeTraceSink: (options: TraceSinkOptions) => Effect.Effect<{
102
109
  declare const makeLocalFileTracer: (options: LocalFileTracerOptions) => Effect.Effect<Tracer.Tracer, never, import("effect/Scope").Scope>;
103
110
  declare function decodeOtlpTraceRecords(payload: OtlpTracer.TraceData): ReadonlyArray<OtlpTraceRecord>;
104
111
  //#endregion
105
- export { EffectTraceRecord, LocalFileTracerOptions, OtlpTraceRecord, TraceAttributes, TraceRecord, TraceRecordEvent, TraceRecordLink, TraceSink, TraceSinkFlushStats, TraceSinkOptions, causeErrorTag, compactTraceAttributes, decodeOtlpTraceRecords, errorTag, makeLocalFileTracer, makeTraceSink, spanToTraceRecord };
112
+ export { EffectTraceRecord, LocalFileTracerOptions, OtlpTraceRecord, TraceAttributes, TraceRecord, TraceRecordEvent, TraceRecordLink, TraceSink, TraceSinkFlushStats, TraceSinkOptions, causeErrorTag, compactTraceAttributes, decodeOtlpTraceRecords, errorTag, makeLocalFileTracer, makeTraceSink, spanToTraceRecord, truncateTraceAttributes };
@@ -1,4 +1,4 @@
1
- import { $D as flatMap, BD as andThen, Bk as isSome, D as RotatingFileSink, JO as findErrorOption, OO as sync, RD as addFinalizer, RO as void_, Rk as getOrUndefined, TO as sleep, XO as pretty, YO as hasInterruptsOnly, dk as isSuccess, eO as fn, iO as forkScoped, mk as make, oO as ignore, pk as NativeSpan, rO as forever, zO as withTracerEnabled } 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();
@@ -68,6 +68,50 @@ function formatTraceExit(exit) {
68
68
  cause: pretty(exit.cause)
69
69
  };
70
70
  }
71
+ const TRACE_ATTRIBUTE_MAX_LENGTH = 500;
72
+ const TRACE_ATTRIBUTE_TRUNCATED_LENGTH = 200;
73
+ const TRACE_ATTRIBUTE_TRUNCATION_SUFFIX = "…[truncated]";
74
+ const ALWAYS_TRUNCATED_TRACE_ATTRIBUTES = /* @__PURE__ */ new Set(["db.query.text"]);
75
+ function truncateNestedValue(value) {
76
+ if (typeof value === "string") return value.length <= TRACE_ATTRIBUTE_MAX_LENGTH ? value : `${value.slice(0, TRACE_ATTRIBUTE_MAX_LENGTH)}${TRACE_ATTRIBUTE_TRUNCATION_SUFFIX}`;
77
+ if (Array.isArray(value)) {
78
+ const truncated = value.map(truncateNestedValue);
79
+ return truncated.some((entry, index) => entry !== value[index]) ? truncated : value;
80
+ }
81
+ if (isPlainObject(value)) {
82
+ let truncated;
83
+ for (const [key, entry] of Object.entries(value)) {
84
+ const next = truncateNestedValue(entry);
85
+ if (next === entry) continue;
86
+ truncated ??= { ...value };
87
+ truncated[key] = next;
88
+ }
89
+ return truncated ?? value;
90
+ }
91
+ return value;
92
+ }
93
+ /**
94
+ * Clamps oversized attribute values on the serialized trace record so the file
95
+ * sink stays small, including strings nested inside arrays and objects (e.g.
96
+ * error stacks). Returns a new record when anything was clamped; never
97
+ * mutates the input (the live span's attributes are shared with other tracers).
98
+ */
99
+ function truncateTraceAttributes(attributes) {
100
+ let truncated;
101
+ for (const [key, value] of Object.entries(attributes)) {
102
+ if (typeof value === "string" && ALWAYS_TRUNCATED_TRACE_ATTRIBUTES.has(key)) {
103
+ if (value.length <= TRACE_ATTRIBUTE_TRUNCATED_LENGTH) continue;
104
+ truncated ??= { ...attributes };
105
+ truncated[key] = `${value.slice(0, TRACE_ATTRIBUTE_TRUNCATED_LENGTH)}${TRACE_ATTRIBUTE_TRUNCATION_SUFFIX}`;
106
+ continue;
107
+ }
108
+ const next = truncateNestedValue(value);
109
+ if (next === value) continue;
110
+ truncated ??= { ...attributes };
111
+ truncated[key] = next;
112
+ }
113
+ return truncated ?? attributes;
114
+ }
71
115
  function spanToTraceRecord(span) {
72
116
  const status = span.status;
73
117
  const parentSpanId = getOrUndefined(span.parent)?.spanId;
@@ -82,16 +126,16 @@ function spanToTraceRecord(span) {
82
126
  startTimeUnixNano: String(status.startTime),
83
127
  endTimeUnixNano: String(status.endTime),
84
128
  durationMs: Number(status.endTime - status.startTime) / 1e6,
85
- attributes: compactTraceAttributes(Object.fromEntries(span.attributes)),
129
+ attributes: truncateTraceAttributes(compactTraceAttributes(Object.fromEntries(span.attributes))),
86
130
  events: span.events.map(([name, startTime, attributes]) => ({
87
131
  name,
88
132
  timeUnixNano: String(startTime),
89
- attributes: compactTraceAttributes(attributes)
133
+ attributes: truncateTraceAttributes(compactTraceAttributes(attributes))
90
134
  })),
91
135
  links: span.links.map((link) => ({
92
136
  traceId: link.span.traceId,
93
137
  spanId: link.span.spanId,
94
- attributes: compactTraceAttributes(link.attributes)
138
+ attributes: truncateTraceAttributes(compactTraceAttributes(link.attributes))
95
139
  })),
96
140
  exit: formatTraceExit(status.exit)
97
141
  };
@@ -343,4 +387,4 @@ function parseBigInt(input) {
343
387
  }
344
388
  }
345
389
  //#endregion
346
- export { causeErrorTag, compactTraceAttributes, decodeOtlpTraceRecords, errorTag, makeLocalFileTracer, makeTraceSink, spanToTraceRecord };
390
+ export { causeErrorTag, compactTraceAttributes, decodeOtlpTraceRecords, errorTag, makeLocalFileTracer, makeTraceSink, spanToTraceRecord, truncateTraceAttributes };
@@ -1,2 +1,2 @@
1
- import { an as isUncPath, cn as normalizeProjectPathForComparison, in as isExplicitRelativePath, ln as normalizeProjectPathForDispatch, on as isWindowsAbsolutePath, sn as isWindowsDrivePath } from "../shared.js";
1
+ import { an as isExplicitRelativePath, cn as isWindowsDrivePath, ln as normalizeProjectPathForComparison, on as isUncPath, sn as isWindowsAbsolutePath, un as normalizeProjectPathForDispatch } from "../shared.js";
2
2
  export { isExplicitRelativePath, isUncPath, isWindowsAbsolutePath, isWindowsDrivePath, normalizeProjectPathForComparison, normalizeProjectPathForDispatch };
@@ -1,4 +1,4 @@
1
- import { GT as Defect, JT as Literals, QT as String, ZT as Number, cE as is, eE as TaggedErrorClass, uE as optional } 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 { Gy as PreviewAutomationResizeInput, Nb as PreviewViewportPresetId, Pb 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 { J_ 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,5 +1,6 @@
1
1
  //#region upstream-t3code/packages/shared/src/projectFavicon.d.ts
2
2
  declare const PROJECT_FAVICON_FALLBACK_MARKER = "project-favicon-missing";
3
+ declare function getProjectFaviconCacheKey(environmentId: string, workspaceRoot: string, url: string): string;
3
4
  declare function isProjectFaviconFallbackUrl(url: string | null | undefined): boolean;
4
5
  //#endregion
5
- export { PROJECT_FAVICON_FALLBACK_MARKER, isProjectFaviconFallbackUrl };
6
+ export { PROJECT_FAVICON_FALLBACK_MARKER, getProjectFaviconCacheKey, isProjectFaviconFallbackUrl };
@@ -1,5 +1,17 @@
1
1
  //#region upstream-t3code/packages/shared/src/projectFavicon.ts
2
2
  const PROJECT_FAVICON_FALLBACK_MARKER = "project-favicon-missing";
3
+ function getProjectFaviconCacheKey(environmentId, workspaceRoot, url) {
4
+ let revision = url;
5
+ try {
6
+ const pathname = new URL(url, "https://t3.invalid").pathname;
7
+ revision = pathname.slice(pathname.lastIndexOf("/") + 1);
8
+ } catch {}
9
+ return JSON.stringify([
10
+ environmentId,
11
+ workspaceRoot,
12
+ revision
13
+ ]);
14
+ }
3
15
  function isProjectFaviconFallbackUrl(url) {
4
16
  if (!url) return false;
5
17
  try {
@@ -10,4 +22,4 @@ function isProjectFaviconFallbackUrl(url) {
10
22
  }
11
23
  }
12
24
  //#endregion
13
- export { PROJECT_FAVICON_FALLBACK_MARKER, isProjectFaviconFallbackUrl };
25
+ export { PROJECT_FAVICON_FALLBACK_MARKER, getProjectFaviconCacheKey, isProjectFaviconFallbackUrl };
@@ -1,4 +1,4 @@
1
- import { Ev 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 { GT as Defect, JT as Literals, QT as String, eE as TaggedErrorClass, uE as optional } 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 { zC 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";
@@ -1,4 +1,4 @@
1
- import { $D as flatMap$1, BT as string, Bk as isSome, CO as scoped, DO as suspend, EO as succeed, GO as currentTimeMillis, HC as get, HD as as, IC as HttpClient, KO as TaggedError, LT as all, Mk as flatMap, OE as FileSystem, QD as fail, QO as effect, RO as void_, RT as map, Rk as getOrUndefined, TE as Path, TO as sleep, Uk as none, VC as filterStatusOk, Wk as some, YD as catch_, ZD as ensuring, aO as gen, bE as ChildProcessSpawner, dO as mapError, eO as fn, gO as orDie, hO as option$1, jD as encodeHex, kk as Service, mD as make, oO as ignore, pE as Crypto, qD as catchTag, vE as make$1, w as HostProcessPlatform, y as HostProcessArchitecture, zT as option, zk as isNone } from "../shared.js";
1
+ import { $j as ignore, AN as Service, BM as currentTimeMillis, BN as getOrUndefined, CA as Path, CD as filterStatusOk, GN as none, Gj as flatMap$1, HM as TaggedError, HN as isSome, KN as some, Kj as fn, Lj as catchTag, Mj as as, NM as void_, NN as flatMap, Qj as gen, SM as suspend, Sk as string, TA as FileSystem, Uj as fail, VN as isNone, Vj as ensuring, YM as effect, _A as encodeHex, aA as make$1, bM as sleep, bk as map, dM as orDie, eA as Crypto, fj as make, iM as mapError, sA as ChildProcessSpawner, uM as option$1, vD as HttpClient, vM as scoped, w as HostProcessPlatform, wD as get, xM as succeed, xk as option, y as HostProcessArchitecture, yk as all, zj as catch_ } from "../shared.js";
2
2
  //#region upstream-t3code/packages/shared/src/relayClient.ts
3
3
  const CLOUDFLARED_VERSION = "2026.5.2";
4
4
  const CLOUDFLARED_PATH_ENV_NAME = "T3CODE_CLOUDFLARED_PATH";
@@ -1,2 +1,2 @@
1
- import { $a as RELAY_HEALTH_REQUEST_TYP, Qa as RELAY_ACTIVITY_PUBLISH_TYP, ao as decodeRelayJwt, co as verifyRelayJwt, eo as RELAY_HEALTH_RESPONSE_TYP, io as RelayJwtError, no as RELAY_MINT_REQUEST_TYP, oo as normalizeRelayIssuer, ro as RELAY_MINT_RESPONSE_TYP, so as signRelayJwt, to as RELAY_LINK_PROOF_TYP } from "../shared.js";
1
+ import { _o as verifyRelayJwt, co as RELAY_HEALTH_REQUEST_TYP, do as RELAY_MINT_REQUEST_TYP, fo as RELAY_MINT_RESPONSE_TYP, go as signRelayJwt, ho as normalizeRelayIssuer, lo as RELAY_HEALTH_RESPONSE_TYP, mo as decodeRelayJwt, po as RelayJwtError, so as RELAY_ACTIVITY_PUBLISH_TYP, uo as RELAY_LINK_PROOF_TYP } from "../shared.js";
2
2
  export { RELAY_ACTIVITY_PUBLISH_TYP, RELAY_HEALTH_REQUEST_TYP, RELAY_HEALTH_RESPONSE_TYP, RELAY_LINK_PROOF_TYP, RELAY_MINT_REQUEST_TYP, RELAY_MINT_RESPONSE_TYP, RelayJwtError, decodeRelayJwt, normalizeRelayIssuer, signRelayJwt, verifyRelayJwt };
@@ -1,2 +1,2 @@
1
- import { Jo as withRelayClientTracing, Ko as RelayClientTracer, qo as makeRelayClientTracingLayer } from "../shared.js";
1
+ import { is as withRelayClientTracing, ns as RelayClientTracer, rs as makeRelayClientTracingLayer } from "../shared.js";
2
2
  export { RelayClientTracer, makeRelayClientTracingLayer, withRelayClientTracing };
@@ -1,2 +1,2 @@
1
- import { Xa as isSecureRelayUrl, Za as normalizeSecureRelayUrl } from "../shared.js";
1
+ import { ao as isSecureRelayUrl, oo as normalizeSecureRelayUrl } from "../shared.js";
2
2
  export { isSecureRelayUrl, normalizeSecureRelayUrl };
@@ -1,2 +1,2 @@
1
- import { Ca as readHostedPairingRequest, Ea as stripPairingTokenFromUrl, Sa as readHashParams, Ta as setPairingTokenOnUrl, _a as RemotePairingCodeMissingError, ba as RemotePairingUrlInvalidError, ga as RemoteBackendUrlMissingError, ha as RemoteBackendUrlInvalidError, va as RemotePairingTargetError, wa as resolveRemotePairingTarget, xa as getPairingTokenFromUrl, ya as RemotePairingTokenMissingError } from "../shared.js";
1
+ import { Aa as readHashParams, Ca as RemoteBackendUrlInvalidError, Da as RemotePairingTokenMissingError, Ea as RemotePairingTargetError, Ma as resolveRemotePairingTarget, Na as setPairingTokenOnUrl, Oa as RemotePairingUrlInvalidError, Pa as stripPairingTokenFromUrl, Ta as RemotePairingCodeMissingError, ja as readHostedPairingRequest, ka as getPairingTokenFromUrl, wa as RemoteBackendUrlMissingError } from "../shared.js";
2
2
  export { RemoteBackendUrlInvalidError, RemoteBackendUrlMissingError, RemotePairingCodeMissingError, RemotePairingTargetError, RemotePairingTokenMissingError, RemotePairingUrlInvalidError, getPairingTokenFromUrl, readHashParams, readHostedPairingRequest, resolveRemotePairingTarget, setPairingTokenOnUrl, stripPairingTokenFromUrl };
@@ -1,5 +1,5 @@
1
1
  import { a as __toESM } from "../rolldown-runtime.js";
2
- import { DD as transformOrFail, ED as Transformation, PD as InvalidValue, PO as try_, QT as String, Uk as none, jT as require_dist, rE as decodeTo } from "../shared.js";
2
+ import { Lk as String, SA as InvalidValue, Uk as decodeTo, fA as Transformation, kM as try_, pA as transformOrFail, pk as require_dist } from "../shared.js";
3
3
  //#region upstream-t3code/packages/shared/src/schemaYaml.ts
4
4
  var import_dist = /* @__PURE__ */ __toESM(require_dist(), 1);
5
5
  function formatYamlParseError(error) {
@@ -34,7 +34,7 @@ function formatYamlParseError(error) {
34
34
  function parseYaml(options) {
35
35
  return transformOrFail((input) => try_({
36
36
  try: () => (0, import_dist.parse)(input, options),
37
- catch: (error) => new InvalidValue(none(), { message: formatYamlParseError(error) })
37
+ catch: (error) => new InvalidValue({ message: formatYamlParseError(error) })
38
38
  }));
39
39
  }
40
40
  /**
@@ -63,7 +63,7 @@ function parseYaml(options) {
63
63
  function stringifyYaml(options) {
64
64
  return transformOrFail((input) => try_({
65
65
  try: () => (0, import_dist.stringify)(input, options),
66
- catch: () => new InvalidValue(none(), { message: "Failed to stringify YAML." })
66
+ catch: () => new InvalidValue({ message: "Failed to stringify YAML." })
67
67
  }));
68
68
  }
69
69
  /**
@@ -7,7 +7,7 @@ function normalizeSemverVersion(version) {
7
7
  const trimmed = segment.trim();
8
8
  if (trimmed.length > 0) segments.push(trimmed);
9
9
  }
10
- if (segments.length === 2) segments.push("0");
10
+ while (segments.length > 0 && segments.length < 3) segments.push("0");
11
11
  return prerelease ? `${segments.join(".")}-${prerelease}` : segments.join(".");
12
12
  }
13
13
  function parseSemver(value) {