refactor(client-runtime): remove unused runtime exports and helpers (#10167)
This commit is contained in:
1 parent
0671e34279
commit
dbfd517313
40 files changed
+42
-208
No files matched your search
@@ -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";
|
||||
|
||||
/**
|
||||
|
||||
@@ -16,7 +16,6 @@ export {
|
||||
normalizeCompactToolLabel,
|
||||
summarizeToolGroup,
|
||||
toolGroupAction,
|
||||
workLogEntryIsLocalCodeSearch,
|
||||
} from "@t3tools/client-runtime/work-log/presentation";
|
||||
import {
|
||||
formatDuration,
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
export {
|
||||
buildProjectGroups,
|
||||
deriveLogicalProjectKey,
|
||||
deriveLogicalProjectKeyFromRef,
|
||||
deriveLogicalProjectKeyFromSettings,
|
||||
derivePhysicalProjectKey,
|
||||
derivePhysicalProjectKeyFromPath,
|
||||
|
||||
@@ -2,6 +2,5 @@ export * from "./remote.ts";
|
||||
export {
|
||||
type AuthorizedRemoteEnvironment,
|
||||
type AuthorizedRemoteHttpEnvironment,
|
||||
RemoteEnvironmentAuthorization,
|
||||
} from "./service.ts";
|
||||
export * as TokenStore from "./tokenStore.ts";
|
||||
@@ -16,7 +16,6 @@ import {
|
||||
} from "../rpc/http.ts";
|
||||
|
||||
export {
|
||||
RemoteEnvironmentAuthFetchError,
|
||||
RemoteEnvironmentAuthInvalidJsonError,
|
||||
RemoteEnvironmentAuthTimeoutError,
|
||||
RemoteEnvironmentAuthUndeclaredStatusError,
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -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));
|
||||
@@ -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));
|
||||
@@ -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;
|
||||
|
||||
@@ -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";
|
||||
@@ -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;
|
||||
|
||||
@@ -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));
|
||||
@@ -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;
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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));
|
||||
@@ -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));
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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,
|
||||
) {
|
||||
|
||||
@@ -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"));
|
||||
@@ -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";
|
||||
@@ -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({});
|
||||
@@ -61,7 +61,7 @@ export function applyAuthAccessStreamEvent(
|
||||
}
|
||||
}
|
||||
|
||||
export function projectAuthAccessSnapshot(
|
||||
function projectAuthAccessSnapshot(
|
||||
current: AuthAccessSnapshot,
|
||||
event: AuthAccessStreamEvent,
|
||||
): readonly [AuthAccessSnapshot, ReadonlyArray<AuthAccessStreamEvent>] {
|
||||
|
||||
@@ -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(),
|
||||
});
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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,
|
||||
};
|
||||
}
|
||||
@@ -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">>;
|
||||
|
||||
@@ -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>,
|
||||
|
||||
@@ -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<
|
||||
|
||||
@@ -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(
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -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))),
|
||||
|
||||
@@ -96,7 +96,7 @@ export function nextTerminalAttachSeedState(): TerminalBufferState {
|
||||
};
|
||||
}
|
||||
|
||||
export function terminalBufferStateFromSnapshot(
|
||||
function terminalBufferStateFromSnapshot(
|
||||
snapshot: TerminalSessionSnapshot,
|
||||
maxBufferBytes: number,
|
||||
current: TerminalBufferState = EMPTY_TERMINAL_BUFFER_STATE,
|
||||
|
||||
@@ -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[] = [];
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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";
|
||||
@@ -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,
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
import type { EnvironmentId } from "@t3tools/contracts";
|
||||
|
||||
export interface VcsStatusTarget {
|
||||
readonly environmentId: EnvironmentId | null;
|
||||
readonly cwd: string | null;
|
||||
}
|
||||
@@ -1,7 +1,6 @@
|
||||
export {
|
||||
VoiceInputController,
|
||||
VOICE_RECORDING_LIMIT_SECONDS,
|
||||
resolveTranscriptCommit,
|
||||
voiceInputBlocksSubmission,
|
||||
voiceInputFreezesEditor,
|
||||
type VoiceDraftSnapshot,
|
||||
|
||||
@@ -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))
|
||||
|
||||
Reference in new issue
Block a user