| author | |
| committer | |
| log | 6f4cd07b900299629b9f2f9a9336f5c090556a51 |
| tree | 2481fd6b1962b83c27cf209f7a74e1059aa18426 |
| parent | 11601da846e7d82db63a6f4773e3a02421619b60 |
| signature | Signed by PGP key B5690EEEBB952194 |
32 files changed, 40 insertions(+), 28 deletions(-)
apps/server/scripts/t3-sqlite-state.ts+1-1| ... | @@ -245,7 +245,7 @@ export const runSqliteState = Effect.fn("runSqliteState")(function* ( | ... | @@ -245,7 +245,7 @@ export const runSqliteState = Effect.fn("runSqliteState")(function* ( |
| 245 | ); | 245 | ); |
| 246 | }); | 246 | }); |
| 247 | 247 | ||
| 248 | export const t3SqliteStateCommand = Command.make( | 248 | const t3SqliteStateCommand = Command.make( |
| 249 | "t3-sqlite-state", | 249 | "t3-sqlite-state", |
| 250 | { | 250 | { |
| 251 | operation: Argument.choice("operation", SqliteStateOperation.literals).pipe( | 251 | operation: Argument.choice("operation", SqliteStateOperation.literals).pipe( |
apps/server/src/attachmentStore.ts+1-1| ... | @@ -22,7 +22,7 @@ const ATTACHMENT_ID_PATTERN = new RegExp( | ... | @@ -22,7 +22,7 @@ const ATTACHMENT_ID_PATTERN = new RegExp( |
| 22 | ); | 22 | ); |
| 23 | 23 | ||
| 24 | export const PENDING_ATTACHMENT_THREAD_SEGMENT = "pending"; | 24 | export const PENDING_ATTACHMENT_THREAD_SEGMENT = "pending"; |
| 25 | export const PENDING_ATTACHMENT_MAX_AGE_MS = 24 * 60 * 60 * 1000; | 25 | const PENDING_ATTACHMENT_MAX_AGE_MS = 24 * 60 * 60 * 1000; |
| 26 | const PARTIAL_UPLOAD_MAX_AGE_MS = 60 * 60 * 1000; | 26 | const PARTIAL_UPLOAD_MAX_AGE_MS = 60 * 60 * 1000; |
| 27 | 27 | ||
| 28 | export function toSafeThreadAttachmentSegment(threadId: string): string | null { | 28 | export function toSafeThreadAttachmentSegment(threadId: string): string | null { |
apps/server/src/auth/EnvironmentAuth.ts+3-2| ... | @@ -38,7 +38,7 @@ import * as SessionStore from "./SessionStore.ts"; | ... | @@ -38,7 +38,7 @@ import * as SessionStore from "./SessionStore.ts"; |
| 38 | import { verifyRequestDpopProof } from "./dpop.ts"; | 38 | import { verifyRequestDpopProof } from "./dpop.ts"; |
| 39 | import { layerConfig as SqlitePersistenceLayer } from "../persistence/Layers/Sqlite.ts"; | 39 | import { layerConfig as SqlitePersistenceLayer } from "../persistence/Layers/Sqlite.ts"; |
| 40 | 40 | ||
| 41 | export const DEFAULT_SESSION_SUBJECT = "cli-issued-session"; | 41 | const DEFAULT_SESSION_SUBJECT = "cli-issued-session"; |
| 42 | export const INTERNAL_ADMINISTRATIVE_BOOTSTRAP_SUBJECT = "administrative-bootstrap"; | 42 | export const INTERNAL_ADMINISTRATIVE_BOOTSTRAP_SUBJECT = "administrative-bootstrap"; |
| 43 | 43 | ||
| 44 | export interface IssuedPairingLink { | 44 | export interface IssuedPairingLink { |
| ... | @@ -591,6 +591,7 @@ export function selectRequestCredential( | ... | @@ -591,6 +591,7 @@ export function selectRequestCredential( |
| 591 | return undefined; | 591 | return undefined; |
| 592 | } | 592 | } |
| 593 | 593 | ||
| 594 | /** @public Service construction is part of the canonical Effect module API. */ | ||
| 594 | export const make = Effect.gen(function* () { | 595 | export const make = Effect.gen(function* () { |
| 595 | const policy = yield* EnvironmentAuthPolicy.EnvironmentAuthPolicy; | 596 | const policy = yield* EnvironmentAuthPolicy.EnvironmentAuthPolicy; |
| 596 | const bootstrapCredentials = yield* PairingGrantStore.PairingGrantStore; | 597 | const bootstrapCredentials = yield* PairingGrantStore.PairingGrantStore; |
| ... | @@ -1033,7 +1034,7 @@ export const layer = Layer.effect(EnvironmentAuth, make).pipe( | ... | @@ -1033,7 +1034,7 @@ export const layer = Layer.effect(EnvironmentAuth, make).pipe( |
| 1033 | Layer.provideMerge(EnvironmentAuthPolicy.layer), | 1034 | Layer.provideMerge(EnvironmentAuthPolicy.layer), |
| 1034 | ); | 1035 | ); |
| 1035 | 1036 | ||
| 1036 | export const storageLayer = Layer.mergeAll(ServerSecretStore.layer, SqlitePersistenceLayer); | 1037 | const storageLayer = Layer.mergeAll(ServerSecretStore.layer, SqlitePersistenceLayer); |
| 1037 | 1038 | ||
| 1038 | export const runtimeLayer = layer.pipe( | 1039 | export const runtimeLayer = layer.pipe( |
| 1039 | Layer.provideMerge(storageLayer), | 1040 | Layer.provideMerge(storageLayer), |
apps/server/src/auth/EnvironmentAuthPolicy.ts+1| ... | @@ -14,6 +14,7 @@ export class EnvironmentAuthPolicy extends Context.Service< | ... | @@ -14,6 +14,7 @@ export class EnvironmentAuthPolicy extends Context.Service< |
| 14 | } | 14 | } |
| 15 | >()("t3/auth/EnvironmentAuthPolicy") {} | 15 | >()("t3/auth/EnvironmentAuthPolicy") {} |
| 16 | 16 | ||
| 17 | /** @public Service construction is part of the canonical Effect module API. */ | ||
| 17 | export const make = Effect.gen(function* () { | 18 | export const make = Effect.gen(function* () { |
| 18 | const config = yield* ServerConfig.ServerConfig; | 19 | const config = yield* ServerConfig.ServerConfig; |
| 19 | const serverEnvironment = yield* ServerEnvironment.ServerEnvironmentIdentity; | 20 | const serverEnvironment = yield* ServerEnvironment.ServerEnvironmentIdentity; |
apps/server/src/auth/PairingGrantStore.ts-2| ... | @@ -72,7 +72,6 @@ export const BootstrapCredentialInvalidError = Schema.Union([ | ... | @@ -72,7 +72,6 @@ export const BootstrapCredentialInvalidError = Schema.Union([ |
| 72 | UnavailableBootstrapCredentialError, | 72 | UnavailableBootstrapCredentialError, |
| 73 | ]); | 73 | ]); |
| 74 | export type BootstrapCredentialInvalidError = typeof BootstrapCredentialInvalidError.Type; | 74 | export type BootstrapCredentialInvalidError = typeof BootstrapCredentialInvalidError.Type; |
| 75 | export const isBootstrapCredentialInvalidError = Schema.is(BootstrapCredentialInvalidError); | ||
| 76 | 75 | ||
| 77 | export class ActivePairingLinksLoadError extends Schema.TaggedError<ActivePairingLinksLoadError>()( | 76 | export class ActivePairingLinksLoadError extends Schema.TaggedError<ActivePairingLinksLoadError>()( |
| 78 | "ActivePairingLinksLoadError", | 77 | "ActivePairingLinksLoadError", |
| ... | @@ -173,7 +172,6 @@ export const BootstrapCredentialError = Schema.Union([ | ... | @@ -173,7 +172,6 @@ export const BootstrapCredentialError = Schema.Union([ |
| 173 | BootstrapCredentialInternalError, | 172 | BootstrapCredentialInternalError, |
| 174 | ]); | 173 | ]); |
| 175 | export type BootstrapCredentialError = typeof BootstrapCredentialError.Type; | 174 | export type BootstrapCredentialError = typeof BootstrapCredentialError.Type; |
| 176 | export const isBootstrapCredentialError = Schema.is(BootstrapCredentialError); | ||
| 177 | 175 | ||
| 178 | export interface IssuedBootstrapCredential { | 176 | export interface IssuedBootstrapCredential { |
| 179 | readonly id: string; | 177 | readonly id: string; |
apps/server/src/auth/ServerSecretStore.ts+1| ... | @@ -149,6 +149,7 @@ export class ServerSecretStore extends Context.Service< | ... | @@ -149,6 +149,7 @@ export class ServerSecretStore extends Context.Service< |
| 149 | } | 149 | } |
| 150 | >()("t3/auth/ServerSecretStore") {} | 150 | >()("t3/auth/ServerSecretStore") {} |
| 151 | 151 | ||
| 152 | /** @public Service construction is part of the canonical Effect module API. */ | ||
| 152 | export const make = Effect.gen(function* () { | 153 | export const make = Effect.gen(function* () { |
| 153 | const crypto = yield* Crypto.Crypto; | 154 | const crypto = yield* Crypto.Crypto; |
| 154 | const fileSystem = yield* FileSystem.FileSystem; | 155 | const fileSystem = yield* FileSystem.FileSystem; |
apps/server/src/auth/SessionStore.ts-2| ... | @@ -349,14 +349,12 @@ export const SessionCredentialInternalError = Schema.Union([ | ... | @@ -349,14 +349,12 @@ export const SessionCredentialInternalError = Schema.Union([ |
| 349 | OtherSessionsRevocationError, | 349 | OtherSessionsRevocationError, |
| 350 | ]); | 350 | ]); |
| 351 | export type SessionCredentialInternalError = typeof SessionCredentialInternalError.Type; | 351 | export type SessionCredentialInternalError = typeof SessionCredentialInternalError.Type; |
| 352 | export const isSessionCredentialInternalError = Schema.is(SessionCredentialInternalError); | ||
| 353 | 352 | ||
| 354 | export const SessionCredentialError = Schema.Union([ | 353 | export const SessionCredentialError = Schema.Union([ |
| 355 | SessionCredentialInvalidError, | 354 | SessionCredentialInvalidError, |
| 356 | SessionCredentialInternalError, | 355 | SessionCredentialInternalError, |
| 357 | ]); | 356 | ]); |
| 358 | export type SessionCredentialError = typeof SessionCredentialError.Type; | 357 | export type SessionCredentialError = typeof SessionCredentialError.Type; |
| 359 | export const isSessionCredentialError = Schema.is(SessionCredentialError); | ||
| 360 | 358 | ||
| 361 | export class SessionStore extends Context.Service< | 359 | export class SessionStore extends Context.Service< |
| 362 | SessionStore, | 360 | SessionStore, |
apps/server/src/auth/http.ts+1-1| ... | @@ -65,7 +65,7 @@ const appendDpopChallengeOnUnauthorized = (error: EnvironmentAuthInvalidError) = | ... | @@ -65,7 +65,7 @@ const appendDpopChallengeOnUnauthorized = (error: EnvironmentAuthInvalidError) = |
| 65 | return yield* error; | 65 | return yield* error; |
| 66 | }); | 66 | }); |
| 67 | 67 | ||
| 68 | export const currentEnvironmentTraceId = Effect.currentParentSpan.pipe( | 68 | const currentEnvironmentTraceId = Effect.currentParentSpan.pipe( |
| 69 | Effect.map((span) => span.traceId), | 69 | Effect.map((span) => span.traceId), |
| 70 | Effect.orElseSucceed(() => "unavailable"), | 70 | Effect.orElseSucceed(() => "unavailable"), |
| 71 | ); | 71 | ); |
apps/server/src/background/BackgroundPolicy.ts+2-1| ... | @@ -82,7 +82,7 @@ function leaseKey(lease: Pick<ClientActivityLease, "sessionId" | "rpcClientId" | | ... | @@ -82,7 +82,7 @@ function leaseKey(lease: Pick<ClientActivityLease, "sessionId" | "rpcClientId" | |
| 82 | return JSON.stringify([lease.sessionId, lease.rpcClientId, lease.clientId]); | 82 | return JSON.stringify([lease.sessionId, lease.rpcClientId, lease.clientId]); |
| 83 | } | 83 | } |
| 84 | 84 | ||
| 85 | export function upsertClientActivityLease( | 85 | function upsertClientActivityLease( |
| 86 | leases: ReadonlyMap<string, ClientActivityLease>, | 86 | leases: ReadonlyMap<string, ClientActivityLease>, |
| 87 | lease: ClientActivityLease, | 87 | lease: ClientActivityLease, |
| 88 | now: DateTime.Utc, | 88 | now: DateTime.Utc, |
| ... | @@ -208,6 +208,7 @@ function computeSnapshot(input: { | ... | @@ -208,6 +208,7 @@ function computeSnapshot(input: { |
| 208 | }; | 208 | }; |
| 209 | } | 209 | } |
| 210 | 210 | ||
| 211 | /** @public Service construction is part of the canonical Effect module API. */ | ||
| 211 | export const make = Effect.fn("background.policy.make")(function* () { | 212 | export const make = Effect.fn("background.policy.make")(function* () { |
| 212 | const hostPowerMonitor = yield* HostPowerMonitor.HostPowerMonitor; | 213 | const hostPowerMonitor = yield* HostPowerMonitor.HostPowerMonitor; |
| 213 | const serverSettings = yield* ServerSettingsService; | 214 | const serverSettings = yield* ServerSettingsService; |
apps/server/src/background/HostPowerMonitor.ts+1-1| ... | @@ -19,7 +19,7 @@ export class HostPowerMonitor extends Context.Service< | ... | @@ -19,7 +19,7 @@ export class HostPowerMonitor extends Context.Service< |
| 19 | } | 19 | } |
| 20 | >()("t3/background/HostPowerMonitor") {} | 20 | >()("t3/background/HostPowerMonitor") {} |
| 21 | 21 | ||
| 22 | export const makeUnknownSnapshot = ( | 22 | const makeUnknownSnapshot = ( |
| 23 | source: HostPowerSnapshot["source"], | 23 | source: HostPowerSnapshot["source"], |
| 24 | updatedAt: HostPowerSnapshot["updatedAt"], | 24 | updatedAt: HostPowerSnapshot["updatedAt"], |
| 25 | ): HostPowerSnapshot => ({ | 25 | ): HostPowerSnapshot => ({ |
apps/server/src/checkpointing/CheckpointDiffQuery.ts+1| ... | @@ -75,6 +75,7 @@ function buildTurnDiffResult( | ... | @@ -75,6 +75,7 @@ function buildTurnDiffResult( |
| 75 | }; | 75 | }; |
| 76 | } | 76 | } |
| 77 | 77 | ||
| 78 | /** @public Service construction is part of the canonical Effect module API. */ | ||
| 78 | export const make = Effect.gen(function* () { | 79 | export const make = Effect.gen(function* () { |
| 79 | const projectionSnapshotQuery = yield* ProjectionSnapshotQuery.ProjectionSnapshotQuery; | 80 | const projectionSnapshotQuery = yield* ProjectionSnapshotQuery.ProjectionSnapshotQuery; |
| 80 | const checkpointStore = yield* CheckpointStore.CheckpointStore; | 81 | const checkpointStore = yield* CheckpointStore.CheckpointStore; |
apps/server/src/checkpointing/CheckpointStore.ts+1| ... | @@ -98,6 +98,7 @@ export class CheckpointStore extends Context.Service< | ... | @@ -98,6 +98,7 @@ export class CheckpointStore extends Context.Service< |
| 98 | } | 98 | } |
| 99 | >()("t3/checkpointing/CheckpointStore") {} | 99 | >()("t3/checkpointing/CheckpointStore") {} |
| 100 | 100 | ||
| 101 | /** @public Service construction is part of the canonical Effect module API. */ | ||
| 101 | export const make = Effect.gen(function* () { | 102 | export const make = Effect.gen(function* () { |
| 102 | const vcsRegistry = yield* VcsDriverRegistry.VcsDriverRegistry; | 103 | const vcsRegistry = yield* VcsDriverRegistry.VcsDriverRegistry; |
| 103 | 104 |
apps/server/src/checkpointing/Utils.ts+1-1| ... | @@ -1,7 +1,7 @@ | ... | @@ -1,7 +1,7 @@ |
| 1 | import * as Encoding from "effect/Encoding"; | 1 | import * as Encoding from "effect/Encoding"; |
| 2 | import { CheckpointRef, ProjectId, type ThreadId } from "@t3tools/contracts"; | 2 | import { CheckpointRef, ProjectId, type ThreadId } from "@t3tools/contracts"; |
| 3 | 3 | ||
| 4 | export const CHECKPOINT_REFS_PREFIX = "refs/t3/checkpoints"; | 4 | const CHECKPOINT_REFS_PREFIX = "refs/t3/checkpoints"; |
| 5 | 5 | ||
| 6 | export function checkpointRefForThreadTurn(threadId: ThreadId, turnCount: number): CheckpointRef { | 6 | export function checkpointRefForThreadTurn(threadId: ThreadId, turnCount: number): CheckpointRef { |
| 7 | return CheckpointRef.make( | 7 | return CheckpointRef.make( |
apps/server/src/cli/app.ts+1-1| ... | @@ -81,7 +81,7 @@ function isDesktopPlatform(platform: NodeJS.Platform): platform is DesktopAppAct | ... | @@ -81,7 +81,7 @@ function isDesktopPlatform(platform: NodeJS.Platform): platform is DesktopAppAct |
| 81 | return platform === "darwin" || platform === "linux" || platform === "win32"; | 81 | return platform === "darwin" || platform === "linux" || platform === "win32"; |
| 82 | } | 82 | } |
| 83 | 83 | ||
| 84 | export function sendDesktopAppActivationRequest(input: { | 84 | function sendDesktopAppActivationRequest(input: { |
| 85 | readonly address: string; | 85 | readonly address: string; |
| 86 | readonly fallbackAddress?: string; | 86 | readonly fallbackAddress?: string; |
| 87 | readonly request: DesktopAppActivationRequest; | 87 | readonly request: DesktopAppActivationRequest; |
apps/server/src/cli/config.ts+2-2| ... | @@ -17,7 +17,7 @@ import { readBootstrapEnvelope } from "../bootstrap.ts"; | ... | @@ -17,7 +17,7 @@ import { readBootstrapEnvelope } from "../bootstrap.ts"; |
| 17 | import * as ServerConfig from "../config.ts"; | 17 | import * as ServerConfig from "../config.ts"; |
| 18 | import { expandHomePath, resolveBaseDir } from "../os-jank.ts"; | 18 | import { expandHomePath, resolveBaseDir } from "../os-jank.ts"; |
| 19 | 19 | ||
| 20 | export const modeFlag = Flag.choice("mode", ServerConfig.RuntimeMode.literals).pipe( | 20 | const modeFlag = Flag.choice("mode", ServerConfig.RuntimeMode.literals).pipe( |
| 21 | Flag.withDescription("Runtime mode. `desktop` keeps loopback defaults unless overridden."), | 21 | Flag.withDescription("Runtime mode. `desktop` keeps loopback defaults unless overridden."), |
| 22 | Flag.optional, | 22 | Flag.optional, |
| 23 | ); | 23 | ); |
| ... | @@ -69,7 +69,7 @@ const tailscaleServeFlag = Flag.boolean("tailscale-serve").pipe( | ... | @@ -69,7 +69,7 @@ const tailscaleServeFlag = Flag.boolean("tailscale-serve").pipe( |
| 69 | ), | 69 | ), |
| 70 | Flag.optional, | 70 | Flag.optional, |
| 71 | ); | 71 | ); |
| 72 | export const tailscaleServePortFlag = Flag.integer("tailscale-serve-port").pipe( | 72 | const tailscaleServePortFlag = Flag.integer("tailscale-serve-port").pipe( |
| 73 | Flag.withSchema(PortSchema), | 73 | Flag.withSchema(PortSchema), |
| 74 | Flag.withDescription("HTTPS port for Tailscale Serve when --tailscale-serve is enabled."), | 74 | Flag.withDescription("HTTPS port for Tailscale Serve when --tailscale-serve is enabled."), |
| 75 | Flag.optional, | 75 | Flag.optional, |
apps/server/src/cli/pair.ts+1-1| ... | @@ -173,7 +173,7 @@ export const resolveTailscaleLocalTarget = ( | ... | @@ -173,7 +173,7 @@ export const resolveTailscaleLocalTarget = ( |
| 173 | return { localPort: state.port }; | 173 | return { localPort: state.port }; |
| 174 | }; | 174 | }; |
| 175 | 175 | ||
| 176 | export const formatPairOutput = (input: { | 176 | const formatPairOutput = (input: { |
| 177 | readonly serverLabel: string; | 177 | readonly serverLabel: string; |
| 178 | readonly origin: string; | 178 | readonly origin: string; |
| 179 | readonly pairingUrl: string; | 179 | readonly pairingUrl: string; |
apps/server/src/cloud/CliTokenManager.ts+1| ... | @@ -324,6 +324,7 @@ export const outOfBandOAuthLogin = Effect.fn("cloud.cli_token.out_of_band_oauth_ | ... | @@ -324,6 +324,7 @@ export const outOfBandOAuthLogin = Effect.fn("cloud.cli_token.out_of_band_oauth_ |
| 324 | }); | 324 | }); |
| 325 | }); | 325 | }); |
| 326 | 326 | ||
| 327 | /** @public Service construction is part of the canonical Effect module API. */ | ||
| 327 | export const make = Effect.gen(function* () { | 328 | export const make = Effect.gen(function* () { |
| 328 | // Capture exactly the services the login/refresh flows need at build time | 329 | // Capture exactly the services the login/refresh flows need at build time |
| 329 | // (matching the behavior before the out-of-band flow captured the instances), not | 330 | // (matching the behavior before the out-of-band flow captured the instances), not |
apps/server/src/cloud/ManagedEndpointRuntime.ts+1| ... | @@ -111,6 +111,7 @@ const stopConnector = (connector: ActiveConnector | null) => | ... | @@ -111,6 +111,7 @@ const stopConnector = (connector: ActiveConnector | null) => |
| 111 | ) | 111 | ) |
| 112 | : Effect.void; | 112 | : Effect.void; |
| 113 | 113 | ||
| 114 | /** @public Service construction is part of the canonical Effect module API. */ | ||
| 114 | export const make = Effect.gen(function* () { | 115 | export const make = Effect.gen(function* () { |
| 115 | const spawner = yield* ChildProcessSpawner.ChildProcessSpawner; | 116 | const spawner = yield* ChildProcessSpawner.ChildProcessSpawner; |
| 116 | const relayClient = yield* RelayClient.RelayClient; | 117 | const relayClient = yield* RelayClient.RelayClient; |
apps/server/src/cloud/publicConfig.ts+4-4| ... | @@ -49,21 +49,21 @@ function normalizeSecureUrl(value: string): string | null { | ... | @@ -49,21 +49,21 @@ function normalizeSecureUrl(value: string): string | null { |
| 49 | } | 49 | } |
| 50 | } | 50 | } |
| 51 | 51 | ||
| 52 | export const buildTimeRelayUrl = | 52 | const buildTimeRelayUrl = |
| 53 | typeof __T3CODE_BUILD_RELAY_URL__ === "undefined" | 53 | typeof __T3CODE_BUILD_RELAY_URL__ === "undefined" |
| 54 | ? "" | 54 | ? "" |
| 55 | : (normalizeSecureRelayUrl(__T3CODE_BUILD_RELAY_URL__) ?? ""); | 55 | : (normalizeSecureRelayUrl(__T3CODE_BUILD_RELAY_URL__) ?? ""); |
| 56 | export const buildTimeClerkPublishableKey = readBuildTimeValue( | 56 | const buildTimeClerkPublishableKey = readBuildTimeValue( |
| 57 | typeof __T3CODE_BUILD_CLERK_PUBLISHABLE_KEY__ === "undefined" | 57 | typeof __T3CODE_BUILD_CLERK_PUBLISHABLE_KEY__ === "undefined" |
| 58 | ? undefined | 58 | ? undefined |
| 59 | : __T3CODE_BUILD_CLERK_PUBLISHABLE_KEY__, | 59 | : __T3CODE_BUILD_CLERK_PUBLISHABLE_KEY__, |
| 60 | ); | 60 | ); |
| 61 | export const buildTimeClerkCliOAuthClientId = readBuildTimeValue( | 61 | const buildTimeClerkCliOAuthClientId = readBuildTimeValue( |
| 62 | typeof __T3CODE_BUILD_CLERK_CLI_OAUTH_CLIENT_ID__ === "undefined" | 62 | typeof __T3CODE_BUILD_CLERK_CLI_OAUTH_CLIENT_ID__ === "undefined" |
| 63 | ? undefined | 63 | ? undefined |
| 64 | : __T3CODE_BUILD_CLERK_CLI_OAUTH_CLIENT_ID__, | 64 | : __T3CODE_BUILD_CLERK_CLI_OAUTH_CLIENT_ID__, |
| 65 | ); | 65 | ); |
| 66 | export const buildTimeRelayClientTracing = { | 66 | const buildTimeRelayClientTracing = { |
| 67 | tracesUrl: readBuildTimeValue( | 67 | tracesUrl: readBuildTimeValue( |
| 68 | typeof __T3CODE_BUILD_RELAY_CLIENT_OTLP_TRACES_URL__ === "undefined" | 68 | typeof __T3CODE_BUILD_RELAY_CLIENT_OTLP_TRACES_URL__ === "undefined" |
| 69 | ? undefined | 69 | ? undefined |
apps/server/src/cloud/serviceProtocol.ts+1-1| ... | @@ -71,7 +71,7 @@ export const isExactServiceVersion = (version: string): boolean => | ... | @@ -71,7 +71,7 @@ export const isExactServiceVersion = (version: string): boolean => |
| 71 | const isRecord = (value: unknown): value is Record<string, unknown> => | 71 | const isRecord = (value: unknown): value is Record<string, unknown> => |
| 72 | typeof value === "object" && value !== null && !Array.isArray(value); | 72 | typeof value === "object" && value !== null && !Array.isArray(value); |
| 73 | 73 | ||
| 74 | export function decodeServiceUpdate(value: unknown): ServiceUpdateRecord | undefined { | 74 | function decodeServiceUpdate(value: unknown): ServiceUpdateRecord | undefined { |
| 75 | if (!isRecord(value)) return undefined; | 75 | if (!isRecord(value)) return undefined; |
| 76 | const { id, fromVersion, targetVersion, status } = value; | 76 | const { id, fromVersion, targetVersion, status } = value; |
| 77 | if ( | 77 | if ( |
apps/server/src/environment/RemoteOpenTargets.ts+1| ... | @@ -26,6 +26,7 @@ export class RemoteOpenTargets extends Context.Service< | ... | @@ -26,6 +26,7 @@ export class RemoteOpenTargets extends Context.Service< |
| 26 | } | 26 | } |
| 27 | >()("t3/environment/RemoteOpenTargets") {} | 27 | >()("t3/environment/RemoteOpenTargets") {} |
| 28 | 28 | ||
| 29 | /** @public Service construction is part of the canonical Effect module API. */ | ||
| 29 | export const make = Effect.gen(function* () { | 30 | export const make = Effect.gen(function* () { |
| 30 | const spawner = yield* ChildProcessSpawner.ChildProcessSpawner; | 31 | const spawner = yield* ChildProcessSpawner.ChildProcessSpawner; |
| 31 | const net = yield* NetService.NetService; | 32 | const net = yield* NetService.NetService; |
apps/server/src/environment/ServerEnvironment.ts+1| ... | @@ -179,6 +179,7 @@ const makeIdentity = Effect.gen(function* () { | ... | @@ -179,6 +179,7 @@ const makeIdentity = Effect.gen(function* () { |
| 179 | }); | 179 | }); |
| 180 | }); | 180 | }); |
| 181 | 181 | ||
| 182 | /** @public Service construction is part of the canonical Effect module API. */ | ||
| 182 | export const make = Effect.gen(function* () { | 183 | export const make = Effect.gen(function* () { |
| 183 | const path = yield* Path.Path; | 184 | const path = yield* Path.Path; |
| 184 | const serverConfig = yield* ServerConfig.ServerConfig; | 185 | const serverConfig = yield* ServerConfig.ServerConfig; |
apps/server/src/imageMime.ts+1-1| ... | @@ -1,6 +1,6 @@ | ... | @@ -1,6 +1,6 @@ |
| 1 | import Mime from "@effect/platform-node/Mime"; | 1 | import Mime from "@effect/platform-node/Mime"; |
| 2 | 2 | ||
| 3 | export const IMAGE_EXTENSION_BY_MIME_TYPE: Record<string, string> = { | 3 | const IMAGE_EXTENSION_BY_MIME_TYPE: Record<string, string> = { |
| 4 | "image/avif": ".avif", | 4 | "image/avif": ".avif", |
| 5 | "image/bmp": ".bmp", | 5 | "image/bmp": ".bmp", |
| 6 | "image/gif": ".gif", | 6 | "image/gif": ".gif", |
apps/server/src/persistence/AuthPairingLinks.ts+1| ... | @@ -119,6 +119,7 @@ function toPersistenceSqlOrDecodeError( | ... | @@ -119,6 +119,7 @@ function toPersistenceSqlOrDecodeError( |
| 119 | }); | 119 | }); |
| 120 | } | 120 | } |
| 121 | 121 | ||
| 122 | /** @public Service construction is part of the canonical Effect module API. */ | ||
| 122 | export const make = Effect.gen(function* () { | 123 | export const make = Effect.gen(function* () { |
| 123 | const sql = yield* SqlClient.SqlClient; | 124 | const sql = yield* SqlClient.SqlClient; |
| 124 | 125 |
apps/server/src/persistence/AuthSessions.ts+1| ... | @@ -200,6 +200,7 @@ function toPersistenceSqlOrDecodeError( | ... | @@ -200,6 +200,7 @@ function toPersistenceSqlOrDecodeError( |
| 200 | }); | 200 | }); |
| 201 | } | 201 | } |
| 202 | 202 | ||
| 203 | /** @public Service construction is part of the canonical Effect module API. */ | ||
| 203 | export const make = Effect.gen(function* () { | 204 | export const make = Effect.gen(function* () { |
| 204 | const sql = yield* SqlClient.SqlClient; | 205 | const sql = yield* SqlClient.SqlClient; |
| 205 | 206 |
apps/server/src/persistence/Migrations.ts+2-2| ... | @@ -72,7 +72,7 @@ import Migration0049 from "./Migrations/049_ProjectionThreadsActiveOrderKey.ts"; | ... | @@ -72,7 +72,7 @@ import Migration0049 from "./Migrations/049_ProjectionThreadsActiveOrderKey.ts"; |
| 72 | * Uses Migrator.fromRecord which parses the key format and | 72 | * Uses Migrator.fromRecord which parses the key format and |
| 73 | * returns migrations sorted by ID. | 73 | * returns migrations sorted by ID. |
| 74 | */ | 74 | */ |
| 75 | export const migrationEntries = [ | 75 | const migrationEntries = [ |
| 76 | [1, "OrchestrationEvents", Migration0001], | 76 | [1, "OrchestrationEvents", Migration0001], |
| 77 | [2, "OrchestrationCommandReceipts", Migration0002], | 77 | [2, "OrchestrationCommandReceipts", Migration0002], |
| 78 | [3, "CheckpointDiffBlobs", Migration0003], | 78 | [3, "CheckpointDiffBlobs", Migration0003], |
| ... | @@ -126,7 +126,7 @@ export const migrationEntries = [ | ... | @@ -126,7 +126,7 @@ export const migrationEntries = [ |
| 126 | 126 | ||
| 127 | export const migrationManifest = migrationEntries.map(([id, name]) => [id, name] as const); | 127 | export const migrationManifest = migrationEntries.map(([id, name]) => [id, name] as const); |
| 128 | 128 | ||
| 129 | export const makeMigrationLoader = (throughId?: number) => | 129 | const makeMigrationLoader = (throughId?: number) => |
| 130 | Migrator.fromRecord( | 130 | Migrator.fromRecord( |
| 131 | Object.fromEntries( | 131 | Object.fromEntries( |
| 132 | migrationEntries | 132 | migrationEntries |
apps/server/src/persistence/ProviderSessionRuntime.ts+1| ... | @@ -166,6 +166,7 @@ function toPersistenceSqlOrDecodeError( | ... | @@ -166,6 +166,7 @@ function toPersistenceSqlOrDecodeError( |
| 166 | }); | 166 | }); |
| 167 | } | 167 | } |
| 168 | 168 | ||
| 169 | /** @public Service construction is part of the canonical Effect module API. */ | ||
| 169 | export const make = Effect.gen(function* () { | 170 | export const make = Effect.gen(function* () { |
| 170 | const sql = yield* SqlClient.SqlClient; | 171 | const sql = yield* SqlClient.SqlClient; |
| 171 | 172 |
apps/server/src/process/externalLauncher.ts+1| ... | @@ -752,6 +752,7 @@ const launchEditorProcess = Effect.fn("externalLauncher.launchEditorProcess")(fu | ... | @@ -752,6 +752,7 @@ const launchEditorProcess = Effect.fn("externalLauncher.launchEditorProcess")(fu |
| 752 | ); | 752 | ); |
| 753 | }); | 753 | }); |
| 754 | 754 | ||
| 755 | /** @public Service construction is part of the canonical Effect module API. */ | ||
| 755 | export const make = Effect.gen(function* () { | 756 | export const make = Effect.gen(function* () { |
| 756 | const spawner = yield* ChildProcessSpawner.ChildProcessSpawner; | 757 | const spawner = yield* ChildProcessSpawner.ChildProcessSpawner; |
| 757 | const fileSystem = yield* FileSystem.FileSystem; | 758 | const fileSystem = yield* FileSystem.FileSystem; |
apps/server/src/processRunner.ts+1| ... | @@ -399,6 +399,7 @@ const runProcessCore = Effect.fn("processRunner.runProcessCore")(function* ( | ... | @@ -399,6 +399,7 @@ const runProcessCore = Effect.fn("processRunner.runProcessCore")(function* ( |
| 399 | } satisfies ProcessRunOutput; | 399 | } satisfies ProcessRunOutput; |
| 400 | }); | 400 | }); |
| 401 | 401 | ||
| 402 | /** @public Service construction is part of the canonical Effect module API. */ | ||
| 402 | export const make = Effect.fn("ProcessRunner.make")(function* () { | 403 | export const make = Effect.fn("ProcessRunner.make")(function* () { |
| 403 | const spawner = yield* ChildProcessSpawner.ChildProcessSpawner; | 404 | const spawner = yield* ChildProcessSpawner.ChildProcessSpawner; |
| 404 | 405 |
apps/server/src/server.ts+1-1| ... | @@ -564,7 +564,7 @@ export const makeRoutesLayer = Layer.mergeAll( | ... | @@ -564,7 +564,7 @@ export const makeRoutesLayer = Layer.mergeAll( |
| 564 | Layer.provide(httpCompressionLayer), | 564 | Layer.provide(httpCompressionLayer), |
| 565 | ); | 565 | ); |
| 566 | 566 | ||
| 567 | export const makeServerLayer = Layer.unwrap( | 567 | const makeServerLayer = Layer.unwrap( |
| 568 | Effect.gen(function* () { | 568 | Effect.gen(function* () { |
| 569 | const config = yield* ServerConfig.ServerConfig; | 569 | const config = yield* ServerConfig.ServerConfig; |
| 570 | const activation = yield* Deferred.make<void>(); | 570 | const activation = yield* Deferred.make<void>(); |
apps/server/src/serverRuntimeStartup.ts+3-2| ... | @@ -147,7 +147,7 @@ export const makeCommandGate = Effect.gen(function* () { | ... | @@ -147,7 +147,7 @@ export const makeCommandGate = Effect.gen(function* () { |
| 147 | } satisfies CommandGate; | 147 | } satisfies CommandGate; |
| 148 | }); | 148 | }); |
| 149 | 149 | ||
| 150 | export const recordStartupHeartbeat = Effect.gen(function* () { | 150 | const recordStartupHeartbeat = Effect.gen(function* () { |
| 151 | const analytics = yield* AnalyticsService.AnalyticsService; | 151 | const analytics = yield* AnalyticsService.AnalyticsService; |
| 152 | const projectionSnapshotQuery = yield* ProjectionSnapshotQuery.ProjectionSnapshotQuery; | 152 | const projectionSnapshotQuery = yield* ProjectionSnapshotQuery.ProjectionSnapshotQuery; |
| 153 | 153 | ||
| ... | @@ -466,7 +466,7 @@ const clearContinuationMarkers = ( | ... | @@ -466,7 +466,7 @@ const clearContinuationMarkers = ( |
| 466 | { concurrency: "unbounded", discard: true }, | 466 | { concurrency: "unbounded", discard: true }, |
| 467 | ); | 467 | ); |
| 468 | 468 | ||
| 469 | export const clearProviderSessionContinuationMarkers = (threadIds: ReadonlyArray<ThreadId>) => | 469 | const clearProviderSessionContinuationMarkers = (threadIds: ReadonlyArray<ThreadId>) => |
| 470 | Effect.gen(function* () { | 470 | Effect.gen(function* () { |
| 471 | const directory = yield* ProviderSessionDirectory.ProviderSessionDirectory; | 471 | const directory = yield* ProviderSessionDirectory.ProviderSessionDirectory; |
| 472 | yield* clearContinuationMarkers(directory, threadIds); | 472 | yield* clearContinuationMarkers(directory, threadIds); |
| ... | @@ -803,6 +803,7 @@ export const autoPullProjects = Effect.fn("autoPullProjects")(function* ( | ... | @@ -803,6 +803,7 @@ export const autoPullProjects = Effect.fn("autoPullProjects")(function* ( |
| 803 | ); | 803 | ); |
| 804 | }); | 804 | }); |
| 805 | 805 | ||
| 806 | /** @public Service construction is part of the canonical Effect module API. */ | ||
| 806 | export const make = (options?: StartupOptions) => | 807 | export const make = (options?: StartupOptions) => |
| 807 | Effect.gen(function* () { | 808 | Effect.gen(function* () { |
| 808 | const serverConfig = yield* ServerConfig.ServerConfig; | 809 | const serverConfig = yield* ServerConfig.ServerConfig; |
apps/server/src/serverSettings.ts+1-1| ... | @@ -142,7 +142,7 @@ function providerEnvironmentSecretName(input: { | ... | @@ -142,7 +142,7 @@ function providerEnvironmentSecretName(input: { |
| 142 | */ | 142 | */ |
| 143 | const USAGE_LIMIT_SOURCE_KEY_REDACTED = "\u2022\u2022\u2022\u2022\u2022\u2022"; | 143 | const USAGE_LIMIT_SOURCE_KEY_REDACTED = "\u2022\u2022\u2022\u2022\u2022\u2022"; |
| 144 | 144 | ||
| 145 | export function usageLimitSourceSecretName(sourceId: string): string { | 145 | function usageLimitSourceSecretName(sourceId: string): string { |
| 146 | return `usage-limit-source-${Buffer.from(sourceId, "utf8").toString("base64url")}`; | 146 | return `usage-limit-source-${Buffer.from(sourceId, "utf8").toString("base64url")}`; |
| 147 | } | 147 | } |
| 148 | 148 |