authorgravatar for julius0216@outlook.comJulius Marminge <julius0216@outlook.com> 2026-09-05 15:54:59-07:00
committergravatar for noreply@github.comGitHub <noreply@github.com> 2026-09-05 15:54:59-07:00
logdbfd5173131deb1a7ad2a9438b8941ade43f9a89
treee501586ffcb81d3859d13c8c07b586e7947baa26
parent0671e34279d42faf69fccfd46ceae305ccfa7c6d
signature Signed by PGP key B5690EEEBB952194

refactor(client-runtime): remove unused runtime exports and helpers (#10167)


40 files changed, 42 insertions(+), 208 deletions(-)

apps/web/src/components/Sidebar.logic.ts+1-5
......@@ -600,11 +600,7 @@ export function sortThreadsForSidebar<
600600
601601// Pinned-reorder key math and the keyed sort live in client-runtime
602602// (state/thread-sort) so web and mobile compute identical pinned orders.
603export {
604 generateSpreadPinOrderKeys,
605 pinOrderKeyBetween,
606 planPinnedReorder,
607} from "@t3tools/client-runtime/state/thread-sort";
603export { pinOrderKeyBetween, planPinnedReorder } from "@t3tools/client-runtime/state/thread-sort";
608604export { sortPinnedThreadsByOrderKey as sortPinnedThreadsForSidebar } from "@t3tools/client-runtime/state/thread-sort";
609605
610606/**
apps/web/src/components/chat/MessagesTimeline.logic.ts-1
......@@ -16,7 +16,6 @@ export {
1616 normalizeCompactToolLabel,
1717 summarizeToolGroup,
1818 toolGroupAction,
19 workLogEntryIsLocalCodeSearch,
2019} from "@t3tools/client-runtime/work-log/presentation";
2120import {
2221 formatDuration,
apps/web/src/logicalProject.ts-1
......@@ -1,7 +1,6 @@
11export {
22 buildProjectGroups,
33 deriveLogicalProjectKey,
4 deriveLogicalProjectKeyFromRef,
54 deriveLogicalProjectKeyFromSettings,
65 derivePhysicalProjectKey,
76 derivePhysicalProjectKeyFromPath,
packages/client-runtime/src/authorization/index.ts-1
......@@ -2,6 +2,5 @@ export * from "./remote.ts";
22export {
33 type AuthorizedRemoteEnvironment,
44 type AuthorizedRemoteHttpEnvironment,
5 RemoteEnvironmentAuthorization,
65} from "./service.ts";
76export * as TokenStore from "./tokenStore.ts";
packages/client-runtime/src/authorization/remote.ts-1
......@@ -16,7 +16,6 @@ import {
1616} from "../rpc/http.ts";
1717
1818export {
19 RemoteEnvironmentAuthFetchError,
2019 RemoteEnvironmentAuthInvalidJsonError,
2120 RemoteEnvironmentAuthTimeoutError,
2221 RemoteEnvironmentAuthUndeclaredStatusError,
packages/client-runtime/src/codexArtifactTemplates.ts+3-3
......@@ -1,4 +1,4 @@
1export const CODEX_ARTIFACT_TEMPLATE_KINDS = [
1const CODEX_ARTIFACT_TEMPLATE_KINDS = [
22 "document",
33 "presentation",
44 "spreadsheet",
......@@ -13,7 +13,7 @@ export const CODEX_ARTIFACT_TEMPLATE_KINDS = [
1313
1414export type CodexArtifactTemplateKind = (typeof CODEX_ARTIFACT_TEMPLATE_KINDS)[number];
1515
16export const CODEX_ARTIFACT_TEMPLATE_GALLERY_KINDS = ["imagegen", "product-design"] as const;
16const CODEX_ARTIFACT_TEMPLATE_GALLERY_KINDS = ["imagegen", "product-design"] as const;
1717
1818export type CodexArtifactTemplateGalleryKind =
1919 (typeof CODEX_ARTIFACT_TEMPLATE_GALLERY_KINDS)[number];
......@@ -26,7 +26,7 @@ export interface CodexArtifactTemplate {
2626 readonly skillName: string;
2727}
2828
29export const CODEX_ARTIFACT_TEMPLATE_LABEL_BY_KIND = {
29const CODEX_ARTIFACT_TEMPLATE_LABEL_BY_KIND = {
3030 document: "Document template",
3131 presentation: "Presentation template",
3232 spreadsheet: "Spreadsheet template",
packages/client-runtime/src/connection/connectivity.ts+1-1
......@@ -13,7 +13,7 @@ export class Connectivity extends Context.Service<
1313 }
1414>()("@t3tools/client-runtime/connection/connectivity") {}
1515
16export const make = (service: Connectivity["Service"]) => Connectivity.of(service);
16const make = (service: Connectivity["Service"]) => Connectivity.of(service);
1717
1818export const layer = (service: Connectivity["Service"]) =>
1919 Layer.succeed(Connectivity, make(service));
packages/client-runtime/src/connection/credentialStore.ts-4
......@@ -1,6 +1,5 @@
11import * as Context from "effect/Context";
22import type * as Effect from "effect/Effect";
3import * as Layer from "effect/Layer";
43import type * as Option from "effect/Option";
54
65import type { ConnectionCredential } from "./catalog.ts";
......@@ -22,6 +21,3 @@ export class ConnectionCredentialStore extends Context.Service<
2221
2322export const make = (service: ConnectionCredentialStore["Service"]) =>
2423 ConnectionCredentialStore.of(service);
25
26export const layer = (service: ConnectionCredentialStore["Service"]) =>
27 Layer.succeed(ConnectionCredentialStore, make(service));
packages/client-runtime/src/connection/driver.ts+1
......@@ -36,6 +36,7 @@ export class ConnectionDriver extends Context.Service<
3636 }
3737>()("@t3tools/client-runtime/connection/driver/ConnectionDriver") {}
3838
39/** @public Service construction is part of the canonical Effect module API. */
3940export const make = Effect.gen(function* () {
4041 const resolver = yield* ConnectionResolver.ConnectionResolver;
4142 const sessions = yield* RpcSession.RpcSessionFactory;
packages/client-runtime/src/connection/index.ts+1-12
......@@ -1,11 +1,7 @@
11export * from "./catalog.ts";
22export * as Connectivity from "./connectivity.ts";
33export * as CredentialStore from "./credentialStore.ts";
4export {
5 ConnectionDriver,
6 type ConnectionDriverProgress,
7 type EnvironmentConnectionLease,
8} from "./driver.ts";
4export { type ConnectionDriverProgress, type EnvironmentConnectionLease } from "./driver.ts";
95export * from "./errors.ts";
106export * as Connection from "./layer.ts";
117export * from "./model.ts";
......@@ -14,12 +10,6 @@ export {
1410 ConnectionOnboarding,
1511 type PairingConnectionInput,
1612 type SshConnectionInput,
17 prepareBearerConnectionUpdate,
18 preparePairingRegistration,
19 prepareSshRegistration,
20 registerPairingConnection,
21 registerSshConnection,
22 updateBearerConnection,
2313} from "./onboarding.ts";
2414export * from "./presentation.ts";
2515export * as ProfileStore from "./profileStore.ts";
......@@ -28,6 +18,5 @@ export {
2818 EnvironmentRegistry,
2919 PlatformEnvironmentRemovalError,
3020} from "./registry.ts";
31export { ConnectionResolver } from "./resolver.ts";
3221export { EnvironmentSupervisor, type EnvironmentSupervisorOptions } from "./supervisor.ts";
3322export * as Wakeups from "./wakeups.ts";
packages/client-runtime/src/connection/onboarding.ts+4-3
......@@ -118,7 +118,7 @@ export const preparePairingRegistration = Effect.fn(
118118 });
119119});
120120
121export const registerPairingConnection = Effect.fn(
121const registerPairingConnection = Effect.fn(
122122 "clientRuntime.connection.onboarding.registerPairingConnection",
123123)(function* (input: PairingConnectionInput) {
124124 const registration = yield* preparePairingRegistration(input);
......@@ -130,7 +130,7 @@ export const registerPairingConnection = Effect.fn(
130130const isBearerCredential = Schema.is(BearerConnectionCredential);
131131const isBearerProfile = Schema.is(BearerConnectionProfile);
132132
133export const updateBearerConnection = Effect.fn(
133const updateBearerConnection = Effect.fn(
134134 "clientRuntime.connection.onboarding.updateBearerConnection",
135135)(function* (input: BearerConnectionUpdateInput) {
136136 const registry = yield* EnvironmentRegistry.EnvironmentRegistry;
......@@ -233,7 +233,7 @@ export const prepareSshRegistration = Effect.fn(
233233 });
234234});
235235
236export const registerSshConnection = Effect.fn(
236const registerSshConnection = Effect.fn(
237237 "clientRuntime.connection.onboarding.registerSshConnection",
238238)(function* (input: SshConnectionInput) {
239239 const registration = yield* prepareSshRegistration(input);
......@@ -242,6 +242,7 @@ export const registerSshConnection = Effect.fn(
242242 return registration.target.environmentId;
243243});
244244
245/** @public Service construction is part of the canonical Effect module API. */
245246export const make = Effect.gen(function* () {
246247 const registry = yield* EnvironmentRegistry.EnvironmentRegistry;
247248 const presentation = yield* ClientCapabilities.ClientPresentation;
packages/client-runtime/src/connection/profileStore.ts-4
......@@ -1,6 +1,5 @@
11import * as Context from "effect/Context";
22import type * as Effect from "effect/Effect";
3import * as Layer from "effect/Layer";
43import type * as Option from "effect/Option";
54
65import type { ConnectionProfile } from "./catalog.ts";
......@@ -19,6 +18,3 @@ export class ConnectionProfileStore extends Context.Service<
1918
2019export const make = (service: ConnectionProfileStore["Service"]) =>
2120 ConnectionProfileStore.of(service);
22
23export const layer = (service: ConnectionProfileStore["Service"]) =>
24 Layer.succeed(ConnectionProfileStore, make(service));
packages/client-runtime/src/connection/registry.ts+1
......@@ -125,6 +125,7 @@ interface EnvironmentServiceScope {
125125 readonly scope: Scope.Closeable;
126126}
127127
128/** @public Service construction is part of the canonical Effect module API. */
128129export const make = Effect.gen(function* () {
129130 const registryScope = yield* Scope.Scope;
130131 const storage = yield* Persistence.ConnectionTargetStore;
packages/client-runtime/src/connection/resolver.ts+1
......@@ -218,6 +218,7 @@ const makeSshBroker = Effect.fn("clientRuntime.connection.broker.makeSsh")(funct
218218 });
219219});
220220
221/** @public Service construction is part of the canonical Effect module API. */
221222export const make = Effect.gen(function* () {
222223 const primary = yield* makePrimaryBroker();
223224 const bearer = yield* makeBearerBroker();
packages/client-runtime/src/connection/supervisor.ts-12
......@@ -5,7 +5,6 @@ import * as Context from "effect/Context";
55import * as Effect from "effect/Effect";
66import * as Exit from "effect/Exit";
77import * as Fiber from "effect/Fiber";
8import * as Layer from "effect/Layer";
98import * as Option from "effect/Option";
109import * as Queue from "effect/Queue";
1110import * as Ref from "effect/Ref";
......@@ -798,14 +797,3 @@ export const make = Effect.fn("EnvironmentSupervisor.make")(function* (
798797 retryNow,
799798 });
800799});
801
802export const layer = (
803 entry: ConnectionCatalogEntry,
804 options?: EnvironmentSupervisorOptions,
805): Layer.Layer<
806 EnvironmentSupervisor,
807 never,
808 | Connectivity.Connectivity
809 | ConnectionDriver.ConnectionDriver
810 | ConnectionWakeups.ConnectionWakeups
811> => Layer.effect(EnvironmentSupervisor, make(entry, options));
packages/client-runtime/src/connection/wakeups.ts+1-1
......@@ -27,7 +27,7 @@ export class ConnectionWakeups extends Context.Service<
2727 }
2828>()("@t3tools/client-runtime/connection/wakeups/ConnectionWakeups") {}
2929
30export const make = (service: ConnectionWakeups["Service"]) => ConnectionWakeups.of(service);
30const make = (service: ConnectionWakeups["Service"]) => ConnectionWakeups.of(service);
3131
3232export const layer = (service: ConnectionWakeups["Service"]) =>
3333 Layer.succeed(ConnectionWakeups, make(service));
packages/client-runtime/src/relay/discovery.ts+1
......@@ -102,6 +102,7 @@ function relayAccountId(clerkToken: string): Option.Option<string> {
102102 }
103103}
104104
105/** @public Service construction is part of the canonical Effect module API. */
105106export const make = Effect.fn("RelayEnvironmentDiscovery.make")(function* () {
106107 const relay = yield* ManagedRelay.ManagedRelayClient;
107108 const session = yield* ClientCapabilities.CloudSession;
packages/client-runtime/src/relay/errorPresentation.ts+1-1
......@@ -11,7 +11,7 @@ export const DPOP_UNKNOWN_HINT =
1111
1212export const DPOP_RETRY_HINT = "Hint: Try again. If the problem continues, copy the trace ID.";
1313
14export function dpopFailureHint(reason: DpopFailureReason | undefined): string {
14function dpopFailureHint(reason: DpopFailureReason | undefined): string {
1515 if (reason === "time_window") return DPOP_CLOCK_HINT;
1616 if (reason === undefined) return DPOP_UNKNOWN_HINT;
1717 return DPOP_RETRY_HINT;
packages/client-runtime/src/relay/managedRelay.ts+1
......@@ -429,6 +429,7 @@ function disabledManagedRelayClient(relayUrl: string): ManagedRelayClient["Servi
429429 });
430430}
431431
432/** @public Service construction is part of the canonical Effect module API. */
432433export const make = Effect.fn("ManagedRelayClient.make")(function* (
433434 options: ManagedRelayClientLayerOptions,
434435) {
packages/client-runtime/src/rpc/client.ts-5
......@@ -325,8 +325,3 @@ export function subscribe<TTag extends EnvironmentSubscriptionRpcTag>(
325325> {
326326 return subscribeDynamic(tag, () => Effect.succeed(input), options);
327327}
328
329export const config = Effect.gen(function* () {
330 const session = yield* currentSession();
331 return yield* session.initialConfig;
332}).pipe(Effect.withSpan("EnvironmentRpc.config"));
packages/client-runtime/src/rpc/index.ts+1-1
......@@ -1,4 +1,4 @@
11export * from "./client.ts";
22export * from "./http.ts";
33export * from "./protocol.ts";
4export { type RpcSession, RpcSessionFactory } from "./session.ts";
4export { type RpcSession } from "./session.ts";
packages/client-runtime/src/rpc/session.ts+1-2
......@@ -145,6 +145,7 @@ function mapSessionRpcError(
145145 }
146146}
147147
148/** @public Service construction is part of the canonical Effect module API. */
148149export const make = Effect.fn("RpcSessionFactory.make")(function* (
149150 options: RpcSessionOptions = {},
150151) {
......@@ -369,5 +370,3 @@ export const make = Effect.fn("RpcSessionFactory.make")(function* (
369370
370371export const layerWithOptions = (options: RpcSessionOptions) =>
371372 Layer.effect(RpcSessionFactory, make(options));
372
373export const layer = layerWithOptions({});
packages/client-runtime/src/state/auth.ts+1-1
......@@ -61,7 +61,7 @@ export function applyAuthAccessStreamEvent(
6161 }
6262}
6363
64export function projectAuthAccessSnapshot(
64function projectAuthAccessSnapshot(
6565 current: AuthAccessSnapshot,
6666 event: AuthAccessStreamEvent,
6767): readonly [AuthAccessSnapshot, ReadonlyArray<AuthAccessStreamEvent>] {
packages/client-runtime/src/state/connections.ts+1-1
......@@ -20,7 +20,7 @@ export interface EnvironmentCatalogState {
2020 readonly entries: ReadonlyMap<EnvironmentIdType, ConnectionCatalogEntry>;
2121}
2222
23export const EMPTY_ENVIRONMENT_CATALOG_STATE: EnvironmentCatalogState = Object.freeze({
23const EMPTY_ENVIRONMENT_CATALOG_STATE: EnvironmentCatalogState = Object.freeze({
2424 isReady: false,
2525 entries: new Map(),
2626});
packages/client-runtime/src/state/environmentHttpAuth.ts+2-2
......@@ -27,7 +27,7 @@ export interface EnvironmentHttpAuthHeaders {
2727 * per-request via `FetchHttpClient.RequestInit`, which the fetch client reads
2828 * from the fiber context at request time.
2929 */
30export const withEnvironmentCredentials = <A, E, R>(
30const withEnvironmentCredentials = <A, E, R>(
3131 authorization: PreparedHttpAuthorization | null,
3232 request: Effect.Effect<A, E, R>,
3333): Effect.Effect<A, E, R> =>
......@@ -46,7 +46,7 @@ export const withEnvironmentCredentials = <A, E, R>(
4646 * for relay/DPoP connections, so bearer/primary connections work even when no
4747 * signer is available.
4848 */
49export const buildEnvironmentAuthHeaders = (
49const buildEnvironmentAuthHeaders = (
5050 authorization: PreparedHttpAuthorization | null,
5151 method: HttpMethod.HttpMethod,
5252 url: string,
packages/client-runtime/src/state/gitActions.ts-82
......@@ -1,10 +1,8 @@
11import type {
22 GitRunStackedActionInput,
3 GitRunStackedActionResult,
43 GitStackedAction,
54 VcsStatusResult,
65} from "@t3tools/contracts";
7import { isTemporaryWorktreeBranch } from "@t3tools/shared/git";
86
97export type GitActionIconName = "commit" | "push" | "pr";
108
......@@ -44,44 +42,6 @@ export type GitActionRequestInput = Pick<
4442 "action" | "commitMessage" | "featureBranch" | "filePaths"
4543>;
4644
47export function buildGitActionProgressStages(input: {
48 action: GitStackedAction;
49 hasCustomCommitMessage: boolean;
50 hasWorkingTreeChanges: boolean;
51 pushTarget?: string;
52 featureBranch?: boolean;
53 shouldPushBeforePr?: boolean;
54}): string[] {
55 const branchStages = input.featureBranch ? ["Preparing feature branch..."] : [];
56 const pushStage = input.pushTarget ? `Pushing to ${input.pushTarget}...` : "Pushing...";
57 const prStages = [
58 "Preparing PR...",
59 "Generating PR content...",
60 "Creating GitHub pull request...",
61 ];
62
63 if (input.action === "push") {
64 return [pushStage];
65 }
66 if (input.action === "create_pr") {
67 return input.shouldPushBeforePr ? [pushStage, ...prStages] : prStages;
68 }
69
70 const shouldIncludeCommitStages = input.action === "commit" || input.hasWorkingTreeChanges;
71 const commitStages = !shouldIncludeCommitStages
72 ? []
73 : input.hasCustomCommitMessage
74 ? ["Committing..."]
75 : ["Generating commit message...", "Committing..."];
76 if (input.action === "commit") {
77 return [...branchStages, ...commitStages];
78 }
79 if (input.action === "commit_push") {
80 return [...branchStages, ...commitStages, pushStage];
81 }
82 return [...branchStages, ...commitStages, pushStage, ...prStages];
83}
84
8545export function buildMenuItems(
8646 gitStatus: VcsStatusResult | null,
8747 isBusy: boolean,
......@@ -396,45 +356,3 @@ export function resolveDefaultBranchActionDialogCopy(input: {
396356 continueLabel: "Push & create PR",
397357 };
398358}
399
400export function resolveThreadBranchUpdate(
401 result: GitRunStackedActionResult,
402): { branch: string } | null {
403 if (result.branch.status !== "created" || !result.branch.name) {
404 return null;
405 }
406
407 return {
408 branch: result.branch.name,
409 };
410}
411
412export function resolveLiveThreadBranchUpdate(input: {
413 threadBranch: string | null;
414 gitStatus: VcsStatusResult | null;
415}): { branch: string | null } | null {
416 if (!input.gitStatus) {
417 return null;
418 }
419
420 if (input.gitStatus.refName === null && input.threadBranch !== null) {
421 return null;
422 }
423
424 if (input.threadBranch === input.gitStatus.refName) {
425 return null;
426 }
427
428 if (
429 input.threadBranch !== null &&
430 input.gitStatus.refName !== null &&
431 !isTemporaryWorktreeBranch(input.threadBranch) &&
432 isTemporaryWorktreeBranch(input.gitStatus.refName)
433 ) {
434 return null;
435 }
436
437 return {
438 branch: input.gitStatus.refName,
439 };
440}
packages/client-runtime/src/state/projectGrouping.ts-13
......@@ -152,19 +152,6 @@ export function deriveLogicalProjectKeyFromSettings(
152152 });
153153}
154154
155export function deriveLogicalProjectKeyFromRef(
156 projectRef: ScopedProjectRef,
157 project:
158 | Pick<EnvironmentProject, "environmentId" | "id" | "workspaceRoot" | "repositoryIdentity">
159 | null
160 | undefined,
161 options?: {
162 readonly groupingMode?: SidebarProjectGroupingMode;
163 },
164): string {
165 return project ? deriveLogicalProjectKey(project, options) : scopedProjectKey(projectRef);
166}
167
168155export function deriveProjectGroupLabel(input: {
169156 readonly representative: Pick<EnvironmentProject, "title" | "repositoryIdentity">;
170157 readonly members: ReadonlyArray<Pick<EnvironmentProject, "title" | "repositoryIdentity">>;
packages/client-runtime/src/state/pullRequests.ts+2-1
......@@ -29,11 +29,12 @@ export {
2929 pullRequestDiffLoaderLayer,
3030} from "./pullRequestDiffHttp.ts";
3131
32/** @public Required to name the error in consumers' inferred pull request results. */
3233export class EnvironmentHttpConnectionNotReadyError extends Data.TaggedError(
3334 "EnvironmentHttpConnectionNotReadyError",
3435)<{ readonly message: string }> {}
3536
36export const LINKED_PULL_REQUEST_IDLE_TTL_MS = 5_000;
37const LINKED_PULL_REQUEST_IDLE_TTL_MS = 5_000;
3738
3839function createPullRequestRefreshAtomFamily<R, E>(
3940 runtime: Atom.AtomRuntime<EnvironmentRegistry | R, E>,
packages/client-runtime/src/state/runtime.ts+1-26
......@@ -390,31 +390,6 @@ export function createRuntimeCommand<R, ER, W, A, E>(
390390 };
391391}
392392
393export function createRuntimeStreamCommand<R, ER, W, A, E>(
394 runtime: Atom.AtomRuntime<R, ER>,
395 options: {
396 readonly label: string;
397 readonly execute: (input: W, registry: AtomRegistry.AtomRegistry) => Stream.Stream<A, E, R>;
398 readonly scheduler?: AtomCommandScheduler;
399 readonly concurrency?: AtomCommandConcurrency<W>;
400 },
401): AtomCommand<W, A, E | ER | Cause.NoSuchElementError> {
402 const scheduler = options.scheduler ?? createAtomCommandScheduler();
403 const concurrency = options.concurrency ?? { mode: "parallel" as const };
404 return {
405 label: options.label,
406 run: (registry, input) =>
407 settleAtomCommandResult(() =>
408 scheduler.schedule(registry, concurrency, input, () => {
409 const atom = runtime
410 .atom(options.execute(input, registry))
411 .pipe(Atom.withLabel(options.label));
412 return executeAtomQuery(registry, atom, { reportDefect: false, reportFailure: false });
413 }),
414 ),
415 };
416}
417
418393export function reportAtomCommandResult(
419394 result: AtomCommandResult<unknown, unknown>,
420395 options: AtomCommandOptions = {},
......@@ -462,7 +437,7 @@ function parseEnvironmentRpcKey<Input>(key: string): {
462437 };
463438}
464439
465export function runInEnvironment<A, E, R>(
440function runInEnvironment<A, E, R>(
466441 environmentId: EnvironmentIdType,
467442 effect: Effect.Effect<A, E, R>,
468443): Effect.Effect<
packages/client-runtime/src/state/server.ts+2-2
......@@ -455,7 +455,7 @@ export const makeEnvironmentServerConfigState = Effect.fn("EnvironmentServerConf
455455 },
456456);
457457
458export function serverConfigStateChanges(
458function serverConfigStateChanges(
459459 environmentId: EnvironmentId,
460460 subscription: ServerConfigSubscriptionOptions,
461461) {
......@@ -580,7 +580,7 @@ export const makeEnvironmentServerWelcomeState = Effect.fn("EnvironmentServerWel
580580 },
581581);
582582
583export function serverWelcomeStateChanges(environmentId: EnvironmentId) {
583function serverWelcomeStateChanges(environmentId: EnvironmentId) {
584584 return followStreamInEnvironment(
585585 environmentId,
586586 Stream.unwrap(
packages/client-runtime/src/state/sharedSettings.ts+1-1
......@@ -20,7 +20,7 @@ import * as Struct from "effect/Struct";
2020import type { EnvironmentConnectionPhase } from "../connection/presentation.ts";
2121
2222/** Server keys that hold a user preference rather than machine config. */
23export const SHARED_SERVER_SETTING_KEYS = [
23const SHARED_SERVER_SETTING_KEYS = [
2424 "continueThreadsAfterServerUpdate",
2525 "sidebarAutoSettleAfterDays",
2626 "sidebarAutoSettleOnMerge",
packages/client-runtime/src/state/shell.ts+1-1
......@@ -269,7 +269,7 @@ export const makeEnvironmentShellState = Effect.fn("EnvironmentShellState.make")
269269 return state;
270270});
271271
272export function shellStateChanges(environmentId: EnvironmentId) {
272function shellStateChanges(environmentId: EnvironmentId) {
273273 return followStreamInEnvironment(
274274 environmentId,
275275 Stream.unwrap(makeEnvironmentShellState().pipe(Effect.map(SubscriptionRef.changes))),
packages/client-runtime/src/state/terminalSession.ts+1-1
......@@ -96,7 +96,7 @@ export function nextTerminalAttachSeedState(): TerminalBufferState {
9696 };
9797}
9898
99export function terminalBufferStateFromSnapshot(
99function terminalBufferStateFromSnapshot(
100100 snapshot: TerminalSessionSnapshot,
101101 maxBufferBytes: number,
102102 current: TerminalBufferState = EMPTY_TERMINAL_BUFFER_STATE,
packages/client-runtime/src/state/threadSort.ts+1-1
......@@ -209,7 +209,7 @@ export function pinOrderKeyBetween(before: string | null, after: string | null):
209209 drop lands next to keyless threads, so single-key insertion has nothing
210210 to anchor on). Two base-26 digits give 675 slots — far beyond any real
211211 pinned section — with monotonicity enforced as a belt-and-braces. */
212export function generateSpreadPinOrderKeys(count: number): string[] {
212function generateSpreadPinOrderKeys(count: number): string[] {
213213 const space = PIN_ORDER_DIGITS.length * PIN_ORDER_DIGITS.length;
214214 const step = space / (count + 1);
215215 const keys: string[] = [];
packages/client-runtime/src/state/threads.ts+3-3
......@@ -47,7 +47,7 @@ function statusWithoutLiveData(data: Option.Option<OrchestrationThread>): Enviro
4747 * observed threads stays around 100K gzipped while median threads load fully.
4848 */
4949export const INITIAL_THREAD_USER_TURN_LIMIT = 10;
50export const OLDER_THREAD_PAGE_USER_TURN_LIMIT = 20;
50const OLDER_THREAD_PAGE_USER_TURN_LIMIT = 20;
5151
5252function pageStateFromSnapshot(
5353 page: OrchestrationThreadDetailPage | undefined,
......@@ -101,7 +101,7 @@ const defaultOlderTurnRequestRegistry = makeThreadOlderTurnRequestRegistry();
101101 * instance is shared with the sync `requestOlderThreadTurns` entry point so
102102 * the apps get working wiring without providing anything.
103103 */
104export class ThreadOlderTurnRequests extends Context.Reference<ThreadOlderTurnRequestRegistry>(
104class ThreadOlderTurnRequests extends Context.Reference<ThreadOlderTurnRequestRegistry>(
105105 "@t3tools/client-runtime/state/threads/ThreadOlderTurnRequests",
106106 { defaultValue: () => defaultOlderTurnRequestRegistry },
107107) {}
......@@ -812,7 +812,7 @@ export const makeEnvironmentThreadState = Effect.fn("EnvironmentThreadState.make
812812 return state;
813813});
814814
815export function threadStateChanges(
815function threadStateChanges(
816816 environmentId: EnvironmentIdType,
817817 threadId: ThreadIdType,
818818 resumeCache?: ThreadResumeCache,
packages/client-runtime/src/state/vcs.ts+2-3
......@@ -33,7 +33,7 @@ const OFFLINE_BRANCH_LIST_LIMIT = 100;
3333const VCS_REFS_IDLE_TTL_MS = 30_000;
3434// Rows keep the last status they rendered, so the live stream only needs a
3535// short grace period when virtualization or scrolling releases its consumer.
36export const VCS_STATUS_IDLE_TTL_MS = 10_000;
36const VCS_STATUS_IDLE_TTL_MS = 10_000;
3737const VCS_REFS_RETRY_SCHEDULE = Schedule.exponential("1 second").pipe(
3838 Schedule.modifyDelay(({ duration }) =>
3939 Effect.succeed(Duration.min(duration, Duration.seconds(30))),
......@@ -214,7 +214,7 @@ export const makeCachedVcsRefsChanges = Effect.fn("CachedVcsRefsState.makeChange
214214 return Stream.concat(cachedRefs, refreshedRefs);
215215});
216216
217export function cachedVcsRefsChanges(
217function cachedVcsRefsChanges(
218218 environmentId: EnvironmentId,
219219 input: VcsListRefsInput,
220220 expectedRevision: number,
......@@ -345,4 +345,3 @@ export function createVcsEnvironmentAtoms<R, E>(
345345export * from "./gitActions.ts";
346346export * from "./vcsAction.ts";
347347export * from "./vcsRef.ts";
348export * from "./vcsStatus.ts";
packages/client-runtime/src/state/vcsAction.ts+4-4
......@@ -163,14 +163,14 @@ const decodeVcsActionTargetKey = Schema.decodeUnknownSync(
163163 Schema.Tuple([EnvironmentId, Schema.String]),
164164);
165165
166export const vcsActionStateAtom = Atom.family((key: string) => {
166const vcsActionStateAtom = Atom.family((key: string) => {
167167 return Atom.make(EMPTY_VCS_ACTION_STATE).pipe(
168168 Atom.keepAlive,
169169 Atom.withLabel(`vcs-action:${key}`),
170170 );
171171});
172172
173export const EMPTY_VCS_ACTION_ATOM = Atom.make(EMPTY_VCS_ACTION_STATE).pipe(
173const EMPTY_VCS_ACTION_ATOM = Atom.make(EMPTY_VCS_ACTION_STATE).pipe(
174174 Atom.keepAlive,
175175 Atom.withLabel("vcs-action:null"),
176176);
......@@ -191,7 +191,7 @@ export function parseVcsActionTargetKey(key: string): ResolvedVcsActionTarget {
191191 }
192192}
193193
194export function getVcsActionStateAtom(target: VcsActionTarget) {
194function getVcsActionStateAtom(target: VcsActionTarget) {
195195 const key = getVcsActionTargetKey(target);
196196 return key === null ? EMPTY_VCS_ACTION_ATOM : vcsActionStateAtom(key);
197197}
......@@ -217,7 +217,7 @@ export function beginVcsActionState(
217217 };
218218}
219219
220export function failVcsActionState(
220function failVcsActionState(
221221 operation: VcsActionOperation,
222222 actionId: string,
223223 error: unknown,
packages/client-runtime/src/state/vcsStatus.ts deleted-6
......@@ -1,6 +0,0 @@
1import type { EnvironmentId } from "@t3tools/contracts";
2
3export interface VcsStatusTarget {
4 readonly environmentId: EnvironmentId | null;
5 readonly cwd: string | null;
6}
packages/client-runtime/src/voice-input/index.ts-1
......@@ -1,7 +1,6 @@
11export {
22 VoiceInputController,
33 VOICE_RECORDING_LIMIT_SECONDS,
4 resolveTranscriptCommit,
54 voiceInputBlocksSubmission,
65 voiceInputFreezesEditor,
76 type VoiceDraftSnapshot,
packages/client-runtime/src/work-log/presentation.ts+1-1
......@@ -305,7 +305,7 @@ function workLogEntryIsToolLike(entry: WorkLogPresentationEntry): boolean {
305305 return entry.itemType !== undefined && isToolLifecycleItemType(entry.itemType);
306306}
307307
308export function workLogEntryIsLocalCodeSearch(entry: WorkLogPresentationEntry): boolean {
308function workLogEntryIsLocalCodeSearch(entry: WorkLogPresentationEntry): boolean {
309309 return (
310310 entry.itemType === "web_search" &&
311311 /\bgrep\b/i.test(normalizeCompactToolLabel(entry.toolTitle ?? entry.label))