Skip to content
TypeScript

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

Julius Marmingedbfd5173131d
diff --git a/apps/web/src/components/Sidebar.logic.ts b/apps/web/src/components/Sidebar.logic.ts
index 92cdf72c51f..d5d7d1f23a4 100644
--- a/apps/web/src/components/Sidebar.logic.ts
+++ b/apps/web/src/components/Sidebar.logic.ts
@@ -600,11 +600,7 @@ export function sortThreadsForSidebar<
// Pinned-reorder key math and the keyed sort live in client-runtime
// (state/thread-sort) so web and mobile compute identical pinned orders.
-export {
- generateSpreadPinOrderKeys,
- pinOrderKeyBetween,
- planPinnedReorder,
-} from "@t3tools/client-runtime/state/thread-sort";
+export { pinOrderKeyBetween, planPinnedReorder } from "@t3tools/client-runtime/state/thread-sort";
export { sortPinnedThreadsByOrderKey as sortPinnedThreadsForSidebar } from "@t3tools/client-runtime/state/thread-sort";
/**
diff --git a/apps/web/src/components/chat/MessagesTimeline.logic.ts b/apps/web/src/components/chat/MessagesTimeline.logic.ts
index 36c90c89563..03d1e46faf3 100644
--- a/apps/web/src/components/chat/MessagesTimeline.logic.ts
+++ b/apps/web/src/components/chat/MessagesTimeline.logic.ts
@@ -16,7 +16,6 @@ export {
normalizeCompactToolLabel,
summarizeToolGroup,
toolGroupAction,
- workLogEntryIsLocalCodeSearch,
} from "@t3tools/client-runtime/work-log/presentation";
import {
formatDuration,
diff --git a/apps/web/src/logicalProject.ts b/apps/web/src/logicalProject.ts
index f696cb46224..41df8c2013c 100644
--- a/apps/web/src/logicalProject.ts
+++ b/apps/web/src/logicalProject.ts
@@ -1,7 +1,6 @@
export {
buildProjectGroups,
deriveLogicalProjectKey,
- deriveLogicalProjectKeyFromRef,
deriveLogicalProjectKeyFromSettings,
derivePhysicalProjectKey,
derivePhysicalProjectKeyFromPath,
diff --git a/packages/client-runtime/src/authorization/index.ts b/packages/client-runtime/src/authorization/index.ts
index d232aea0d30..05acbc1829e 100644
--- a/packages/client-runtime/src/authorization/index.ts
+++ b/packages/client-runtime/src/authorization/index.ts
@@ -2,6 +2,5 @@ export * from "./remote.ts";
export {
type AuthorizedRemoteEnvironment,
type AuthorizedRemoteHttpEnvironment,
- RemoteEnvironmentAuthorization,
} from "./service.ts";
export * as TokenStore from "./tokenStore.ts";
diff --git a/packages/client-runtime/src/authorization/remote.ts b/packages/client-runtime/src/authorization/remote.ts
index 398a592e499..538c0aa114a 100644
--- a/packages/client-runtime/src/authorization/remote.ts
+++ b/packages/client-runtime/src/authorization/remote.ts
@@ -16,7 +16,6 @@ import {
} from "../rpc/http.ts";
export {
- RemoteEnvironmentAuthFetchError,
RemoteEnvironmentAuthInvalidJsonError,
RemoteEnvironmentAuthTimeoutError,
RemoteEnvironmentAuthUndeclaredStatusError,
diff --git a/packages/client-runtime/src/codexArtifactTemplates.ts b/packages/client-runtime/src/codexArtifactTemplates.ts
index ad46a7d6c2b..052a60f11d5 100644
--- a/packages/client-runtime/src/codexArtifactTemplates.ts
+++ b/packages/client-runtime/src/codexArtifactTemplates.ts
@@ -1,4 +1,4 @@
-export const CODEX_ARTIFACT_TEMPLATE_KINDS = [
+const CODEX_ARTIFACT_TEMPLATE_KINDS = [
"document",
"presentation",
"spreadsheet",
@@ -13,7 +13,7 @@ export const CODEX_ARTIFACT_TEMPLATE_KINDS = [
export type CodexArtifactTemplateKind = (typeof CODEX_ARTIFACT_TEMPLATE_KINDS)[number];
-export const CODEX_ARTIFACT_TEMPLATE_GALLERY_KINDS = ["imagegen", "product-design"] as const;
+const CODEX_ARTIFACT_TEMPLATE_GALLERY_KINDS = ["imagegen", "product-design"] as const;
export type CodexArtifactTemplateGalleryKind =
(typeof CODEX_ARTIFACT_TEMPLATE_GALLERY_KINDS)[number];
@@ -26,7 +26,7 @@ export interface CodexArtifactTemplate {
readonly skillName: string;
}
-export const CODEX_ARTIFACT_TEMPLATE_LABEL_BY_KIND = {
+const CODEX_ARTIFACT_TEMPLATE_LABEL_BY_KIND = {
document: "Document template",
presentation: "Presentation template",
spreadsheet: "Spreadsheet template",
diff --git a/packages/client-runtime/src/connection/connectivity.ts b/packages/client-runtime/src/connection/connectivity.ts
index 6b40680ce35..9bf9dbdb240 100644
--- a/packages/client-runtime/src/connection/connectivity.ts
+++ b/packages/client-runtime/src/connection/connectivity.ts
@@ -13,7 +13,7 @@ export class Connectivity extends Context.Service<
}
>()("@t3tools/client-runtime/connection/connectivity") {}
-export const make = (service: Connectivity["Service"]) => Connectivity.of(service);
+const make = (service: Connectivity["Service"]) => Connectivity.of(service);
export const layer = (service: Connectivity["Service"]) =>
Layer.succeed(Connectivity, make(service));
diff --git a/packages/client-runtime/src/connection/credentialStore.ts b/packages/client-runtime/src/connection/credentialStore.ts
index 0107bc91fb1..a25970a15f0 100644
--- a/packages/client-runtime/src/connection/credentialStore.ts
+++ b/packages/client-runtime/src/connection/credentialStore.ts
@@ -1,6 +1,5 @@
import * as Context from "effect/Context";
import type * as Effect from "effect/Effect";
-import * as Layer from "effect/Layer";
import type * as Option from "effect/Option";
import type { ConnectionCredential } from "./catalog.ts";
@@ -22,6 +21,3 @@ export class ConnectionCredentialStore extends Context.Service<
export const make = (service: ConnectionCredentialStore["Service"]) =>
ConnectionCredentialStore.of(service);
-
-export const layer = (service: ConnectionCredentialStore["Service"]) =>
- Layer.succeed(ConnectionCredentialStore, make(service));
diff --git a/packages/client-runtime/src/connection/driver.ts b/packages/client-runtime/src/connection/driver.ts
index f29f913dd54..ceec663c1bb 100644
--- a/packages/client-runtime/src/connection/driver.ts
+++ b/packages/client-runtime/src/connection/driver.ts
@@ -36,6 +36,7 @@ export class ConnectionDriver extends Context.Service<
}
>()("@t3tools/client-runtime/connection/driver/ConnectionDriver") {}
+/** @public Service construction is part of the canonical Effect module API. */
export const make = Effect.gen(function* () {
const resolver = yield* ConnectionResolver.ConnectionResolver;
const sessions = yield* RpcSession.RpcSessionFactory;
diff --git a/packages/client-runtime/src/connection/index.ts b/packages/client-runtime/src/connection/index.ts
index 53a041bbf30..127a6288fa1 100644
--- a/packages/client-runtime/src/connection/index.ts
+++ b/packages/client-runtime/src/connection/index.ts
@@ -1,11 +1,7 @@
export * from "./catalog.ts";
export * as Connectivity from "./connectivity.ts";
export * as CredentialStore from "./credentialStore.ts";
-export {
- ConnectionDriver,
- type ConnectionDriverProgress,
- type EnvironmentConnectionLease,
-} from "./driver.ts";
+export { type ConnectionDriverProgress, type EnvironmentConnectionLease } from "./driver.ts";
export * from "./errors.ts";
export * as Connection from "./layer.ts";
export * from "./model.ts";
@@ -14,12 +10,6 @@ export {
ConnectionOnboarding,
type PairingConnectionInput,
type SshConnectionInput,
- prepareBearerConnectionUpdate,
- preparePairingRegistration,
- prepareSshRegistration,
- registerPairingConnection,
- registerSshConnection,
- updateBearerConnection,
} from "./onboarding.ts";
export * from "./presentation.ts";
export * as ProfileStore from "./profileStore.ts";
@@ -28,6 +18,5 @@ export {
EnvironmentRegistry,
PlatformEnvironmentRemovalError,
} from "./registry.ts";
-export { ConnectionResolver } from "./resolver.ts";
export { EnvironmentSupervisor, type EnvironmentSupervisorOptions } from "./supervisor.ts";
export * as Wakeups from "./wakeups.ts";
diff --git a/packages/client-runtime/src/connection/onboarding.ts b/packages/client-runtime/src/connection/onboarding.ts
index e76bcd50a2c..3bc0e56dca8 100644
--- a/packages/client-runtime/src/connection/onboarding.ts
+++ b/packages/client-runtime/src/connection/onboarding.ts
@@ -118,7 +118,7 @@ export const preparePairingRegistration = Effect.fn(
});
});
-export const registerPairingConnection = Effect.fn(
+const registerPairingConnection = Effect.fn(
"clientRuntime.connection.onboarding.registerPairingConnection",
)(function* (input: PairingConnectionInput) {
const registration = yield* preparePairingRegistration(input);
@@ -130,7 +130,7 @@ export const registerPairingConnection = Effect.fn(
const isBearerCredential = Schema.is(BearerConnectionCredential);
const isBearerProfile = Schema.is(BearerConnectionProfile);
-export const updateBearerConnection = Effect.fn(
+const updateBearerConnection = Effect.fn(
"clientRuntime.connection.onboarding.updateBearerConnection",
)(function* (input: BearerConnectionUpdateInput) {
const registry = yield* EnvironmentRegistry.EnvironmentRegistry;
@@ -233,7 +233,7 @@ export const prepareSshRegistration = Effect.fn(
});
});
-export const registerSshConnection = Effect.fn(
+const registerSshConnection = Effect.fn(
"clientRuntime.connection.onboarding.registerSshConnection",
)(function* (input: SshConnectionInput) {
const registration = yield* prepareSshRegistration(input);
@@ -242,6 +242,7 @@ export const registerSshConnection = Effect.fn(
return registration.target.environmentId;
});
+/** @public Service construction is part of the canonical Effect module API. */
export const make = Effect.gen(function* () {
const registry = yield* EnvironmentRegistry.EnvironmentRegistry;
const presentation = yield* ClientCapabilities.ClientPresentation;
diff --git a/packages/client-runtime/src/connection/profileStore.ts b/packages/client-runtime/src/connection/profileStore.ts
index 3432a7fe16e..bc8d08f25f7 100644
--- a/packages/client-runtime/src/connection/profileStore.ts
+++ b/packages/client-runtime/src/connection/profileStore.ts
@@ -1,6 +1,5 @@
import * as Context from "effect/Context";
import type * as Effect from "effect/Effect";
-import * as Layer from "effect/Layer";
import type * as Option from "effect/Option";
import type { ConnectionProfile } from "./catalog.ts";
@@ -19,6 +18,3 @@ export class ConnectionProfileStore extends Context.Service<
export const make = (service: ConnectionProfileStore["Service"]) =>
ConnectionProfileStore.of(service);
-
-export const layer = (service: ConnectionProfileStore["Service"]) =>
- Layer.succeed(ConnectionProfileStore, make(service));
diff --git a/packages/client-runtime/src/connection/registry.ts b/packages/client-runtime/src/connection/registry.ts
index 6907c43d603..563afe62ce5 100644
--- a/packages/client-runtime/src/connection/registry.ts
+++ b/packages/client-runtime/src/connection/registry.ts
@@ -125,6 +125,7 @@ interface EnvironmentServiceScope {
readonly scope: Scope.Closeable;
}
+/** @public Service construction is part of the canonical Effect module API. */
export const make = Effect.gen(function* () {
const registryScope = yield* Scope.Scope;
const storage = yield* Persistence.ConnectionTargetStore;
diff --git a/packages/client-runtime/src/connection/resolver.ts b/packages/client-runtime/src/connection/resolver.ts
index cbffca7b29e..885529249a6 100644
--- a/packages/client-runtime/src/connection/resolver.ts
+++ b/packages/client-runtime/src/connection/resolver.ts
@@ -218,6 +218,7 @@ const makeSshBroker = Effect.fn("clientRuntime.connection.broker.makeSsh")(funct
});
});
+/** @public Service construction is part of the canonical Effect module API. */
export const make = Effect.gen(function* () {
const primary = yield* makePrimaryBroker();
const bearer = yield* makeBearerBroker();
diff --git a/packages/client-runtime/src/connection/supervisor.ts b/packages/client-runtime/src/connection/supervisor.ts
index 0246a21397f..45ef0229205 100644
--- a/packages/client-runtime/src/connection/supervisor.ts
+++ b/packages/client-runtime/src/connection/supervisor.ts
@@ -5,7 +5,6 @@ import * as Context from "effect/Context";
import * as Effect from "effect/Effect";
import * as Exit from "effect/Exit";
import * as Fiber from "effect/Fiber";
-import * as Layer from "effect/Layer";
import * as Option from "effect/Option";
import * as Queue from "effect/Queue";
import * as Ref from "effect/Ref";
@@ -798,14 +797,3 @@ export const make = Effect.fn("EnvironmentSupervisor.make")(function* (
retryNow,
});
});
-
-export const layer = (
- entry: ConnectionCatalogEntry,
- options?: EnvironmentSupervisorOptions,
-): Layer.Layer<
- EnvironmentSupervisor,
- never,
- | Connectivity.Connectivity
- | ConnectionDriver.ConnectionDriver
- | ConnectionWakeups.ConnectionWakeups
-> => Layer.effect(EnvironmentSupervisor, make(entry, options));
diff --git a/packages/client-runtime/src/connection/wakeups.ts b/packages/client-runtime/src/connection/wakeups.ts
index 8573a49c147..721b941645c 100644
--- a/packages/client-runtime/src/connection/wakeups.ts
+++ b/packages/client-runtime/src/connection/wakeups.ts
@@ -27,7 +27,7 @@ export class ConnectionWakeups extends Context.Service<
}
>()("@t3tools/client-runtime/connection/wakeups/ConnectionWakeups") {}
-export const make = (service: ConnectionWakeups["Service"]) => ConnectionWakeups.of(service);
+const make = (service: ConnectionWakeups["Service"]) => ConnectionWakeups.of(service);
export const layer = (service: ConnectionWakeups["Service"]) =>
Layer.succeed(ConnectionWakeups, make(service));
diff --git a/packages/client-runtime/src/relay/discovery.ts b/packages/client-runtime/src/relay/discovery.ts
index 855bb2654ed..8a8eae1d6cd 100644
--- a/packages/client-runtime/src/relay/discovery.ts
+++ b/packages/client-runtime/src/relay/discovery.ts
@@ -102,6 +102,7 @@ function relayAccountId(clerkToken: string): Option.Option<string> {
}
}
+/** @public Service construction is part of the canonical Effect module API. */
export const make = Effect.fn("RelayEnvironmentDiscovery.make")(function* () {
const relay = yield* ManagedRelay.ManagedRelayClient;
const session = yield* ClientCapabilities.CloudSession;
diff --git a/packages/client-runtime/src/relay/errorPresentation.ts b/packages/client-runtime/src/relay/errorPresentation.ts
index a9364752103..b9a53e5ce8b 100644
--- a/packages/client-runtime/src/relay/errorPresentation.ts
+++ b/packages/client-runtime/src/relay/errorPresentation.ts
@@ -11,7 +11,7 @@ export const DPOP_UNKNOWN_HINT =
export const DPOP_RETRY_HINT = "Hint: Try again. If the problem continues, copy the trace ID.";
-export function dpopFailureHint(reason: DpopFailureReason | undefined): string {
+function dpopFailureHint(reason: DpopFailureReason | undefined): string {
if (reason === "time_window") return DPOP_CLOCK_HINT;
if (reason === undefined) return DPOP_UNKNOWN_HINT;
return DPOP_RETRY_HINT;
diff --git a/packages/client-runtime/src/relay/managedRelay.ts b/packages/client-runtime/src/relay/managedRelay.ts
index d9f81c356e2..70c43631dab 100644
--- a/packages/client-runtime/src/relay/managedRelay.ts
+++ b/packages/client-runtime/src/relay/managedRelay.ts
@@ -429,6 +429,7 @@ function disabledManagedRelayClient(relayUrl: string): ManagedRelayClient["Servi
});
}
+/** @public Service construction is part of the canonical Effect module API. */
export const make = Effect.fn("ManagedRelayClient.make")(function* (
options: ManagedRelayClientLayerOptions,
) {
diff --git a/packages/client-runtime/src/rpc/client.ts b/packages/client-runtime/src/rpc/client.ts
index 175d633e242..e7c5117954c 100644
--- a/packages/client-runtime/src/rpc/client.ts
+++ b/packages/client-runtime/src/rpc/client.ts
@@ -325,8 +325,3 @@ export function subscribe<TTag extends EnvironmentSubscriptionRpcTag>(
> {
return subscribeDynamic(tag, () => Effect.succeed(input), options);
}
-
-export const config = Effect.gen(function* () {
- const session = yield* currentSession();
- return yield* session.initialConfig;
-}).pipe(Effect.withSpan("EnvironmentRpc.config"));
diff --git a/packages/client-runtime/src/rpc/index.ts b/packages/client-runtime/src/rpc/index.ts
index 76608388f0a..d5b1a6858f4 100644
--- a/packages/client-runtime/src/rpc/index.ts
+++ b/packages/client-runtime/src/rpc/index.ts
@@ -1,4 +1,4 @@
export * from "./client.ts";
export * from "./http.ts";
export * from "./protocol.ts";
-export { type RpcSession, RpcSessionFactory } from "./session.ts";
+export { type RpcSession } from "./session.ts";
diff --git a/packages/client-runtime/src/rpc/session.ts b/packages/client-runtime/src/rpc/session.ts
index aeef14968ff..2402c132456 100644
--- a/packages/client-runtime/src/rpc/session.ts
+++ b/packages/client-runtime/src/rpc/session.ts
@@ -145,6 +145,7 @@ function mapSessionRpcError(
}
}
+/** @public Service construction is part of the canonical Effect module API. */
export const make = Effect.fn("RpcSessionFactory.make")(function* (
options: RpcSessionOptions = {},
) {
@@ -369,5 +370,3 @@ export const make = Effect.fn("RpcSessionFactory.make")(function* (
export const layerWithOptions = (options: RpcSessionOptions) =>
Layer.effect(RpcSessionFactory, make(options));
-
-export const layer = layerWithOptions({});
diff --git a/packages/client-runtime/src/state/auth.ts b/packages/client-runtime/src/state/auth.ts
index 074b89627af..504dabb91b3 100644
--- a/packages/client-runtime/src/state/auth.ts
+++ b/packages/client-runtime/src/state/auth.ts
@@ -61,7 +61,7 @@ export function applyAuthAccessStreamEvent(
}
}
-export function projectAuthAccessSnapshot(
+function projectAuthAccessSnapshot(
current: AuthAccessSnapshot,
event: AuthAccessStreamEvent,
): readonly [AuthAccessSnapshot, ReadonlyArray<AuthAccessStreamEvent>] {
diff --git a/packages/client-runtime/src/state/connections.ts b/packages/client-runtime/src/state/connections.ts
index 6dfa5001a48..a81739db1b7 100644
--- a/packages/client-runtime/src/state/connections.ts
+++ b/packages/client-runtime/src/state/connections.ts
@@ -20,7 +20,7 @@ export interface EnvironmentCatalogState {
readonly entries: ReadonlyMap<EnvironmentIdType, ConnectionCatalogEntry>;
}
-export const EMPTY_ENVIRONMENT_CATALOG_STATE: EnvironmentCatalogState = Object.freeze({
+const EMPTY_ENVIRONMENT_CATALOG_STATE: EnvironmentCatalogState = Object.freeze({
isReady: false,
entries: new Map(),
});
diff --git a/packages/client-runtime/src/state/environmentHttpAuth.ts b/packages/client-runtime/src/state/environmentHttpAuth.ts
index cfc42f56071..019b52ddd35 100644
--- a/packages/client-runtime/src/state/environmentHttpAuth.ts
+++ b/packages/client-runtime/src/state/environmentHttpAuth.ts
@@ -27,7 +27,7 @@ export interface EnvironmentHttpAuthHeaders {
* per-request via `FetchHttpClient.RequestInit`, which the fetch client reads
* from the fiber context at request time.
*/
-export const withEnvironmentCredentials = <A, E, R>(
+const withEnvironmentCredentials = <A, E, R>(
authorization: PreparedHttpAuthorization | null,
request: Effect.Effect<A, E, R>,
): Effect.Effect<A, E, R> =>
@@ -46,7 +46,7 @@ export const withEnvironmentCredentials = <A, E, R>(
* for relay/DPoP connections, so bearer/primary connections work even when no
* signer is available.
*/
-export const buildEnvironmentAuthHeaders = (
+const buildEnvironmentAuthHeaders = (
authorization: PreparedHttpAuthorization | null,
method: HttpMethod.HttpMethod,
url: string,
diff --git a/packages/client-runtime/src/state/gitActions.ts b/packages/client-runtime/src/state/gitActions.ts
index 436db17110f..d3571e65d2e 100644
--- a/packages/client-runtime/src/state/gitActions.ts
+++ b/packages/client-runtime/src/state/gitActions.ts
@@ -1,10 +1,8 @@
import type {
GitRunStackedActionInput,
- GitRunStackedActionResult,
GitStackedAction,
VcsStatusResult,
} from "@t3tools/contracts";
-import { isTemporaryWorktreeBranch } from "@t3tools/shared/git";
export type GitActionIconName = "commit" | "push" | "pr";
@@ -44,44 +42,6 @@ export type GitActionRequestInput = Pick<
"action" | "commitMessage" | "featureBranch" | "filePaths"
>;
-export function buildGitActionProgressStages(input: {
- action: GitStackedAction;
- hasCustomCommitMessage: boolean;
- hasWorkingTreeChanges: boolean;
- pushTarget?: string;
- featureBranch?: boolean;
- shouldPushBeforePr?: boolean;
-}): string[] {
- const branchStages = input.featureBranch ? ["Preparing feature branch..."] : [];
- const pushStage = input.pushTarget ? `Pushing to ${input.pushTarget}...` : "Pushing...";
- const prStages = [
- "Preparing PR...",
- "Generating PR content...",
- "Creating GitHub pull request...",
- ];
-
- if (input.action === "push") {
- return [pushStage];
- }
- if (input.action === "create_pr") {
- return input.shouldPushBeforePr ? [pushStage, ...prStages] : prStages;
- }
-
- const shouldIncludeCommitStages = input.action === "commit" || input.hasWorkingTreeChanges;
- const commitStages = !shouldIncludeCommitStages
- ? []
- : input.hasCustomCommitMessage
- ? ["Committing..."]
- : ["Generating commit message...", "Committing..."];
- if (input.action === "commit") {
- return [...branchStages, ...commitStages];
- }
- if (input.action === "commit_push") {
- return [...branchStages, ...commitStages, pushStage];
- }
- return [...branchStages, ...commitStages, pushStage, ...prStages];
-}
-
export function buildMenuItems(
gitStatus: VcsStatusResult | null,
isBusy: boolean,
@@ -396,45 +356,3 @@ export function resolveDefaultBranchActionDialogCopy(input: {
continueLabel: "Push & create PR",
};
}
-
-export function resolveThreadBranchUpdate(
- result: GitRunStackedActionResult,
-): { branch: string } | null {
- if (result.branch.status !== "created" || !result.branch.name) {
- return null;
- }
-
- return {
- branch: result.branch.name,
- };
-}
-
-export function resolveLiveThreadBranchUpdate(input: {
- threadBranch: string | null;
- gitStatus: VcsStatusResult | null;
-}): { branch: string | null } | null {
- if (!input.gitStatus) {
- return null;
- }
-
- if (input.gitStatus.refName === null && input.threadBranch !== null) {
- return null;
- }
-
- if (input.threadBranch === input.gitStatus.refName) {
- return null;
- }
-
- if (
- input.threadBranch !== null &&
- input.gitStatus.refName !== null &&
- !isTemporaryWorktreeBranch(input.threadBranch) &&
- isTemporaryWorktreeBranch(input.gitStatus.refName)
- ) {
- return null;
- }
-
- return {
- branch: input.gitStatus.refName,
- };
-}
diff --git a/packages/client-runtime/src/state/projectGrouping.ts b/packages/client-runtime/src/state/projectGrouping.ts
index 43785d85dbb..ce5c984214f 100644
--- a/packages/client-runtime/src/state/projectGrouping.ts
+++ b/packages/client-runtime/src/state/projectGrouping.ts
@@ -152,19 +152,6 @@ export function deriveLogicalProjectKeyFromSettings(
});
}
-export function deriveLogicalProjectKeyFromRef(
- projectRef: ScopedProjectRef,
- project:
- | Pick<EnvironmentProject, "environmentId" | "id" | "workspaceRoot" | "repositoryIdentity">
- | null
- | undefined,
- options?: {
- readonly groupingMode?: SidebarProjectGroupingMode;
- },
-): string {
- return project ? deriveLogicalProjectKey(project, options) : scopedProjectKey(projectRef);
-}
-
export function deriveProjectGroupLabel(input: {
readonly representative: Pick<EnvironmentProject, "title" | "repositoryIdentity">;
readonly members: ReadonlyArray<Pick<EnvironmentProject, "title" | "repositoryIdentity">>;
diff --git a/packages/client-runtime/src/state/pullRequests.ts b/packages/client-runtime/src/state/pullRequests.ts
index d0da18a7226..bf90faf2188 100644
--- a/packages/client-runtime/src/state/pullRequests.ts
+++ b/packages/client-runtime/src/state/pullRequests.ts
@@ -29,11 +29,12 @@ export {
pullRequestDiffLoaderLayer,
} from "./pullRequestDiffHttp.ts";
+/** @public Required to name the error in consumers' inferred pull request results. */
export class EnvironmentHttpConnectionNotReadyError extends Data.TaggedError(
"EnvironmentHttpConnectionNotReadyError",
)<{ readonly message: string }> {}
-export const LINKED_PULL_REQUEST_IDLE_TTL_MS = 5_000;
+const LINKED_PULL_REQUEST_IDLE_TTL_MS = 5_000;
function createPullRequestRefreshAtomFamily<R, E>(
runtime: Atom.AtomRuntime<EnvironmentRegistry | R, E>,
diff --git a/packages/client-runtime/src/state/runtime.ts b/packages/client-runtime/src/state/runtime.ts
index 56489a4ba66..affd5aa90ec 100644
--- a/packages/client-runtime/src/state/runtime.ts
+++ b/packages/client-runtime/src/state/runtime.ts
@@ -390,31 +390,6 @@ export function createRuntimeCommand<R, ER, W, A, E>(
};
}
-export function createRuntimeStreamCommand<R, ER, W, A, E>(
- runtime: Atom.AtomRuntime<R, ER>,
- options: {
- readonly label: string;
- readonly execute: (input: W, registry: AtomRegistry.AtomRegistry) => Stream.Stream<A, E, R>;
- readonly scheduler?: AtomCommandScheduler;
- readonly concurrency?: AtomCommandConcurrency<W>;
- },
-): AtomCommand<W, A, E | ER | Cause.NoSuchElementError> {
- const scheduler = options.scheduler ?? createAtomCommandScheduler();
- const concurrency = options.concurrency ?? { mode: "parallel" as const };
- return {
- label: options.label,
- run: (registry, input) =>
- settleAtomCommandResult(() =>
- scheduler.schedule(registry, concurrency, input, () => {
- const atom = runtime
- .atom(options.execute(input, registry))
- .pipe(Atom.withLabel(options.label));
- return executeAtomQuery(registry, atom, { reportDefect: false, reportFailure: false });
- }),
- ),
- };
-}
-
export function reportAtomCommandResult(
result: AtomCommandResult<unknown, unknown>,
options: AtomCommandOptions = {},
@@ -462,7 +437,7 @@ function parseEnvironmentRpcKey<Input>(key: string): {
};
}
-export function runInEnvironment<A, E, R>(
+function runInEnvironment<A, E, R>(
environmentId: EnvironmentIdType,
effect: Effect.Effect<A, E, R>,
): Effect.Effect<
diff --git a/packages/client-runtime/src/state/server.ts b/packages/client-runtime/src/state/server.ts
index 9f94663388e..e209acfd1e7 100644
--- a/packages/client-runtime/src/state/server.ts
+++ b/packages/client-runtime/src/state/server.ts
@@ -455,7 +455,7 @@ export const makeEnvironmentServerConfigState = Effect.fn("EnvironmentServerConf
},
);
-export function serverConfigStateChanges(
+function serverConfigStateChanges(
environmentId: EnvironmentId,
subscription: ServerConfigSubscriptionOptions,
) {
@@ -580,7 +580,7 @@ export const makeEnvironmentServerWelcomeState = Effect.fn("EnvironmentServerWel
},
);
-export function serverWelcomeStateChanges(environmentId: EnvironmentId) {
+function serverWelcomeStateChanges(environmentId: EnvironmentId) {
return followStreamInEnvironment(
environmentId,
Stream.unwrap(
diff --git a/packages/client-runtime/src/state/sharedSettings.ts b/packages/client-runtime/src/state/sharedSettings.ts
index c578de9c706..128d5c25464 100644
--- a/packages/client-runtime/src/state/sharedSettings.ts
+++ b/packages/client-runtime/src/state/sharedSettings.ts
@@ -20,7 +20,7 @@ import * as Struct from "effect/Struct";
import type { EnvironmentConnectionPhase } from "../connection/presentation.ts";
/** Server keys that hold a user preference rather than machine config. */
-export const SHARED_SERVER_SETTING_KEYS = [
+const SHARED_SERVER_SETTING_KEYS = [
"continueThreadsAfterServerUpdate",
"sidebarAutoSettleAfterDays",
"sidebarAutoSettleOnMerge",
diff --git a/packages/client-runtime/src/state/shell.ts b/packages/client-runtime/src/state/shell.ts
index c150bbb75b8..69799bbd116 100644
--- a/packages/client-runtime/src/state/shell.ts
+++ b/packages/client-runtime/src/state/shell.ts
@@ -269,7 +269,7 @@ export const makeEnvironmentShellState = Effect.fn("EnvironmentShellState.make")
return state;
});
-export function shellStateChanges(environmentId: EnvironmentId) {
+function shellStateChanges(environmentId: EnvironmentId) {
return followStreamInEnvironment(
environmentId,
Stream.unwrap(makeEnvironmentShellState().pipe(Effect.map(SubscriptionRef.changes))),
diff --git a/packages/client-runtime/src/state/terminalSession.ts b/packages/client-runtime/src/state/terminalSession.ts
index 55cc4eef28f..b1ef6500d41 100644
--- a/packages/client-runtime/src/state/terminalSession.ts
+++ b/packages/client-runtime/src/state/terminalSession.ts
@@ -96,7 +96,7 @@ export function nextTerminalAttachSeedState(): TerminalBufferState {
};
}
-export function terminalBufferStateFromSnapshot(
+function terminalBufferStateFromSnapshot(
snapshot: TerminalSessionSnapshot,
maxBufferBytes: number,
current: TerminalBufferState = EMPTY_TERMINAL_BUFFER_STATE,
diff --git a/packages/client-runtime/src/state/threadSort.ts b/packages/client-runtime/src/state/threadSort.ts
index e54343a4562..cf89d4a21ac 100644
--- a/packages/client-runtime/src/state/threadSort.ts
+++ b/packages/client-runtime/src/state/threadSort.ts
@@ -209,7 +209,7 @@ export function pinOrderKeyBetween(before: string | null, after: string | null):
drop lands next to keyless threads, so single-key insertion has nothing
to anchor on). Two base-26 digits give 675 slots — far beyond any real
pinned section — with monotonicity enforced as a belt-and-braces. */
-export function generateSpreadPinOrderKeys(count: number): string[] {
+function generateSpreadPinOrderKeys(count: number): string[] {
const space = PIN_ORDER_DIGITS.length * PIN_ORDER_DIGITS.length;
const step = space / (count + 1);
const keys: string[] = [];
diff --git a/packages/client-runtime/src/state/threads.ts b/packages/client-runtime/src/state/threads.ts
index cdd07087d06..1311469c0ee 100644
--- a/packages/client-runtime/src/state/threads.ts
+++ b/packages/client-runtime/src/state/threads.ts
@@ -47,7 +47,7 @@ function statusWithoutLiveData(data: Option.Option<OrchestrationThread>): Enviro
* observed threads stays around 100K gzipped while median threads load fully.
*/
export const INITIAL_THREAD_USER_TURN_LIMIT = 10;
-export const OLDER_THREAD_PAGE_USER_TURN_LIMIT = 20;
+const OLDER_THREAD_PAGE_USER_TURN_LIMIT = 20;
function pageStateFromSnapshot(
page: OrchestrationThreadDetailPage | undefined,
@@ -101,7 +101,7 @@ const defaultOlderTurnRequestRegistry = makeThreadOlderTurnRequestRegistry();
* instance is shared with the sync `requestOlderThreadTurns` entry point so
* the apps get working wiring without providing anything.
*/
-export class ThreadOlderTurnRequests extends Context.Reference<ThreadOlderTurnRequestRegistry>(
+class ThreadOlderTurnRequests extends Context.Reference<ThreadOlderTurnRequestRegistry>(
"@t3tools/client-runtime/state/threads/ThreadOlderTurnRequests",
{ defaultValue: () => defaultOlderTurnRequestRegistry },
) {}
@@ -812,7 +812,7 @@ export const makeEnvironmentThreadState = Effect.fn("EnvironmentThreadState.make
return state;
});
-export function threadStateChanges(
+function threadStateChanges(
environmentId: EnvironmentIdType,
threadId: ThreadIdType,
resumeCache?: ThreadResumeCache,
diff --git a/packages/client-runtime/src/state/vcs.ts b/packages/client-runtime/src/state/vcs.ts
index a932e7398d0..6c93e6204dc 100644
--- a/packages/client-runtime/src/state/vcs.ts
+++ b/packages/client-runtime/src/state/vcs.ts
@@ -33,7 +33,7 @@ const OFFLINE_BRANCH_LIST_LIMIT = 100;
const VCS_REFS_IDLE_TTL_MS = 30_000;
// Rows keep the last status they rendered, so the live stream only needs a
// short grace period when virtualization or scrolling releases its consumer.
-export const VCS_STATUS_IDLE_TTL_MS = 10_000;
+const VCS_STATUS_IDLE_TTL_MS = 10_000;
const VCS_REFS_RETRY_SCHEDULE = Schedule.exponential("1 second").pipe(
Schedule.modifyDelay(({ duration }) =>
Effect.succeed(Duration.min(duration, Duration.seconds(30))),
@@ -214,7 +214,7 @@ export const makeCachedVcsRefsChanges = Effect.fn("CachedVcsRefsState.makeChange
return Stream.concat(cachedRefs, refreshedRefs);
});
-export function cachedVcsRefsChanges(
+function cachedVcsRefsChanges(
environmentId: EnvironmentId,
input: VcsListRefsInput,
expectedRevision: number,
@@ -345,4 +345,3 @@ export function createVcsEnvironmentAtoms<R, E>(
export * from "./gitActions.ts";
export * from "./vcsAction.ts";
export * from "./vcsRef.ts";
-export * from "./vcsStatus.ts";
diff --git a/packages/client-runtime/src/state/vcsAction.ts b/packages/client-runtime/src/state/vcsAction.ts
index f0c3791e35b..46dfd74e972 100644
--- a/packages/client-runtime/src/state/vcsAction.ts
+++ b/packages/client-runtime/src/state/vcsAction.ts
@@ -163,14 +163,14 @@ const decodeVcsActionTargetKey = Schema.decodeUnknownSync(
Schema.Tuple([EnvironmentId, Schema.String]),
);
-export const vcsActionStateAtom = Atom.family((key: string) => {
+const vcsActionStateAtom = Atom.family((key: string) => {
return Atom.make(EMPTY_VCS_ACTION_STATE).pipe(
Atom.keepAlive,
Atom.withLabel(`vcs-action:${key}`),
);
});
-export const EMPTY_VCS_ACTION_ATOM = Atom.make(EMPTY_VCS_ACTION_STATE).pipe(
+const EMPTY_VCS_ACTION_ATOM = Atom.make(EMPTY_VCS_ACTION_STATE).pipe(
Atom.keepAlive,
Atom.withLabel("vcs-action:null"),
);
@@ -191,7 +191,7 @@ export function parseVcsActionTargetKey(key: string): ResolvedVcsActionTarget {
}
}
-export function getVcsActionStateAtom(target: VcsActionTarget) {
+function getVcsActionStateAtom(target: VcsActionTarget) {
const key = getVcsActionTargetKey(target);
return key === null ? EMPTY_VCS_ACTION_ATOM : vcsActionStateAtom(key);
}
@@ -217,7 +217,7 @@ export function beginVcsActionState(
};
}
-export function failVcsActionState(
+function failVcsActionState(
operation: VcsActionOperation,
actionId: string,
error: unknown,
diff --git a/packages/client-runtime/src/state/vcsStatus.ts b/packages/client-runtime/src/state/vcsStatus.ts
deleted file mode 100644
index 0a301fa86f3..00000000000
--- a/packages/client-runtime/src/state/vcsStatus.ts
+++ /dev/null
@@ -1,6 +0,0 @@
-import type { EnvironmentId } from "@t3tools/contracts";
-
-export interface VcsStatusTarget {
- readonly environmentId: EnvironmentId | null;
- readonly cwd: string | null;
-}
diff --git a/packages/client-runtime/src/voice-input/index.ts b/packages/client-runtime/src/voice-input/index.ts
index c8c8da455ed..2af9cf3e5ac 100644
--- a/packages/client-runtime/src/voice-input/index.ts
+++ b/packages/client-runtime/src/voice-input/index.ts
@@ -1,7 +1,6 @@
export {
VoiceInputController,
VOICE_RECORDING_LIMIT_SECONDS,
- resolveTranscriptCommit,
voiceInputBlocksSubmission,
voiceInputFreezesEditor,
type VoiceDraftSnapshot,
diff --git a/packages/client-runtime/src/work-log/presentation.ts b/packages/client-runtime/src/work-log/presentation.ts
index d47f4456645..050bb7145d4 100644
--- a/packages/client-runtime/src/work-log/presentation.ts
+++ b/packages/client-runtime/src/work-log/presentation.ts
@@ -305,7 +305,7 @@ function workLogEntryIsToolLike(entry: WorkLogPresentationEntry): boolean {
return entry.itemType !== undefined && isToolLifecycleItemType(entry.itemType);
}
-export function workLogEntryIsLocalCodeSearch(entry: WorkLogPresentationEntry): boolean {
+function workLogEntryIsLocalCodeSearch(entry: WorkLogPresentationEntry): boolean {
return (
entry.itemType === "web_search" &&
/\bgrep\b/i.test(normalizeCompactToolLabel(entry.toolTitle ?? entry.label))