Unified · Split
| @@ -3,8 +3,6 @@ import type { ElementType } from "react"; · 2 unmodified lines | ||
| 3 | 3 | import type { SourceControlProviderInfo, SourceControlProviderKind } from "@t3tools/contracts"; |
| 4 | 4 | export { |
| 5 | 5 | DEFAULT_CHANGE_REQUEST_TERMINOLOGY, |
| 6 | − formatChangeRequestAction, | |
| 7 | − formatCreateChangeRequestPhrase, | |
| 8 | 6 | getChangeRequestTerminology, |
| 9 | 7 | resolveChangeRequestPresentation, |
| 10 | 8 | type ChangeRequestPresentation, |
| @@ -63,6 +63,7 @@ export class NetService extends Context.Service<NetService, NetServiceShape>()( · 62 unmodified lines | ||
| 63 | 63 | "@t3tools/shared/Net/NetService", |
| 64 | 64 | ) {} |
| 65 | 65 | |
| 66 | +/** @public Service construction is part of the canonical Effect module API. */ | |
| 66 | 67 | export const make = () => { |
| 67 | 68 | /** |
| 68 | 69 | * Returns true when a TCP server can bind to {host, port}. |
| @@ -43,7 +43,7 @@ export interface ProjectThreadAwarenessInput { · 42 unmodified lines | ||
| 43 | 43 | >; |
| 44 | 44 | } |
| 45 | 45 | |
| 46 | −export function buildAgentAwarenessDeepLink(input: { | |
| 46 | +function buildAgentAwarenessDeepLink(input: { | |
| 47 | 47 | readonly environmentId: EnvironmentId; |
| 48 | 48 | readonly threadId: ThreadId; |
| 49 | 49 | }): string { |
| @@ -115,18 +115,6 @@ export function detectComposerTrigger( · 114 unmodified lines | ||
| 115 | 115 | }; |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | −export function parseStandaloneComposerSlashCommand( | |
| 119 | − text: string, | |
| 120 | −): Exclude<ComposerSlashCommand, "model"> | null { | |
| 121 | − const match = /^\/(plan|default)\s*$/i.exec(text.trim()); | |
| 122 | − if (!match) { | |
| 123 | − return null; | |
| 124 | − } | |
| 125 | − const command = match[1]?.toLowerCase(); | |
| 126 | − if (command === "plan") return "plan"; | |
| 127 | − return "default"; | |
| 128 | −} | |
| 129 | − | |
| 130 | 118 | export function replaceTextRange( |
| 131 | 119 | text: string, |
| 132 | 120 | rangeStart: number, |
| @@ -5,7 +5,7 @@ import * as Ref from "effect/Ref"; · 4 unmodified lines | ||
| 5 | 5 | import * as Schedule from "effect/Schedule"; |
| 6 | 6 | import { HttpClient, HttpClientRequest } from "effect/unstable/http"; |
| 7 | 7 | |
| 8 | −export const DEFAULT_HTTP_READY_PROBE_TIMEOUT_MS = 1_000; | |
| 8 | +const DEFAULT_HTTP_READY_PROBE_TIMEOUT_MS = 1_000; | |
| 9 | 9 | |
| 10 | 10 | /** |
| 11 | 11 | * Normalizes an arbitrary readiness probe failure into a plain, structured value |
| @@ -35,7 +35,7 @@ function getRawSelectionValueById( · 34 unmodified lines | ||
| 35 | 35 | return selection?.value; |
| 36 | 36 | } |
| 37 | 37 | |
| 38 | −export function getProviderOptionSelectionValue( | |
| 38 | +function getProviderOptionSelectionValue( | |
| 39 | 39 | selections: ReadonlyArray<ProviderOptionSelection> | null | undefined, |
| 40 | 40 | id: string, |
| 41 | 41 | ): string | boolean | undefined { |
| @@ -298,11 +298,6 @@ export function readCustomModelEntries(value: unknown): CustomModelDefinition[] · 256 unmodified lines | ||
| 298 | 298 | return entries; |
| 299 | 299 | } |
| 300 | 300 | |
| 301 | −/** Slugs of a `customModels` setting, in stored order. */ | |
| 302 | −export function readCustomModelSlugs(value: unknown): string[] { | |
| 303 | − return readCustomModelEntries(value).map((entry) => entry.slug); | |
| 304 | −} | |
| 305 | − | |
| 306 | 301 | /** |
| 307 | 302 | * Write a definition back to the compact stored shape: a bare slug when it |
| 308 | 303 | * carries nothing custom, otherwise an entry with only the set fields. |
| @@ -361,7 +356,7 @@ export function resolveSelectableModel( · 52 unmodified lines | ||
| 361 | 356 | } |
| 362 | 357 | |
| 363 | 358 | /** Trim a string, returning null for empty/missing values. */ |
| 364 | −export function trimOrNull<T extends string>(value: T | null | undefined): T | null { | |
| 359 | +function trimOrNull<T extends string>(value: T | null | undefined): T | null { | |
| 365 | 360 | if (typeof value !== "string") return null; |
| 366 | 361 | const trimmed = value.trim() as T; |
| 367 | 362 | return trimmed || null; |
| @@ -303,7 +303,7 @@ export function truncateTraceAttributes(attributes: TraceAttributes): TraceAttri · 302 unmodified lines | ||
| 303 | 303 | return truncated ?? attributes; |
| 304 | 304 | } |
| 305 | 305 | |
| 306 | −export function spanToTraceRecord(span: SerializableSpan): EffectTraceRecord { | |
| 306 | +function spanToTraceRecord(span: SerializableSpan): EffectTraceRecord { | |
| 307 | 307 | const status = span.status as Extract<Tracer.SpanStatus, { _tag: "Ended" }>; |
| 308 | 308 | const parentSpanId = Option.getOrUndefined(span.parent)?.spanId; |
| 309 | 309 | |
| @@ -28,7 +28,7 @@ export function formatDuration(durationMs: number): string { · 27 unmodified lines | ||
| 28 | 28 | return parts.join(" "); |
| 29 | 29 | } |
| 30 | 30 | |
| 31 | −export function isLatestTurnSettled( | |
| 31 | +function isLatestTurnSettled( | |
| 32 | 32 | latestTurn: LatestTurnTiming | null, |
| 33 | 33 | session: SessionActivityState | null, |
| 34 | 34 | ): boolean { |
| @@ -20,7 +20,7 @@ import { ChildProcess, ChildProcessSpawner } from "effect/unstable/process"; · 19 unmodified lines | ||
| 20 | 20 | import { HostProcessArchitecture, HostProcessPlatform } from "./hostProcess.ts"; |
| 21 | 21 | |
| 22 | 22 | export const CLOUDFLARED_VERSION = "2026.5.2"; |
| 23 | −export const CLOUDFLARED_PATH_ENV_NAME = "T3CODE_CLOUDFLARED_PATH"; | |
| 23 | +const CLOUDFLARED_PATH_ENV_NAME = "T3CODE_CLOUDFLARED_PATH"; | |
| 24 | 24 | |
| 25 | 25 | export type RelayClientExecutableSource = "override" | "managed" | "path"; |
| 26 | 26 | |
| @@ -199,12 +199,12 @@ const parseLenientJsonGetter = SchemaGetter.onSome((input: string) => { · 198 unmodified lines | ||
| 199 | 199 | * strips trailing commas and JS-style comments before parsing. |
| 200 | 200 | * Encoding produces strict JSON via `JSON.stringify`. |
| 201 | 201 | */ |
| 202 | −export const fromLenientJsonString = new SchemaTransformation.Transformation( | |
| 202 | +const fromLenientJsonString = new SchemaTransformation.Transformation( | |
| 203 | 203 | parseLenientJsonGetter, |
| 204 | 204 | SchemaGetter.stringifyJson(), |
| 205 | 205 | ); |
| 206 | 206 | |
| 207 | −export const prettyJsonString = SchemaGetter.parseJson<string>().compose( | |
| 207 | +const prettyJsonString = SchemaGetter.parseJson<string>().compose( | |
| 208 | 208 | SchemaGetter.stringifyJson({ space: 2 }), |
| 209 | 209 | ); |
| 210 | 210 | |
| @@ -32,32 +32,8 @@ function formatYamlParseError(error: unknown): string { · 31 unmodified lines | ||
| 32 | 32 | return `Invalid YAML (code=${error.code}${location}).`; |
| 33 | 33 | } |
| 34 | 34 | |
| 35 | −/** | |
| 36 | − * Parses a YAML string into a value. | |
| 37 | − * | |
| 38 | − * **When to use** | |
| 39 | − * | |
| 40 | − * Use when you need a schema getter to parse a present encoded YAML string | |
| 41 | − * during decoding. | |
| 42 | − * | |
| 43 | − * **Details** | |
| 44 | − * | |
| 45 | − * Parse failures become `SchemaIssue.InvalidValue` values. | |
| 46 | − * | |
| 47 | − * **Example** (Parse YAML) | |
| 48 | − * | |
| 49 | − * ```ts | |
| 50 | − * import { parseYaml } from "@t3tools/shared/schemaYaml" | |
| 51 | − * | |
| 52 | − * const parse = parseYaml<string>() | |
| 53 | − * // Getter<unknown, string> | |
| 54 | − * ``` | |
| 55 | − * | |
| 56 | − * @see {@link stringifyYaml} for the inverse operation | |
| 57 | − */ | |
| 58 | −export function parseYaml<E extends string>( | |
| 59 | − options?: YamlParseOptions, | |
| 60 | −): SchemaGetter.Getter<unknown, E> { | |
| 35 | +/** Parses YAML during decoding, reporting parse failures as InvalidValue issues. */ | |
| 36 | +function parseYaml<E extends string>(options?: YamlParseOptions): SchemaGetter.Getter<unknown, E> { | |
| 61 | 37 | return SchemaGetter.transformOrFail((input: E) => |
| 62 | 38 | Effect.try({ |
| 63 | 39 | try: () => parseYamlString(input, options) as unknown, |
| @@ -66,32 +42,8 @@ export function parseYaml<E extends string>( · 2 unmodified lines | ||
| 66 | 42 | ); |
| 67 | 43 | } |
| 68 | 44 | |
| 69 | −/** | |
| 70 | − * Stringifies a present value as YAML. | |
| 71 | − * | |
| 72 | − * **When to use** | |
| 73 | − * | |
| 74 | − * Use when you need a schema getter to serialize a present decoded value to | |
| 75 | − * YAML text during encoding. | |
| 76 | − * | |
| 77 | − * **Details** | |
| 78 | − * | |
| 79 | − * Stringify failures become `SchemaIssue.InvalidValue` values. | |
| 80 | − * | |
| 81 | − * **Example** (Stringify YAML) | |
| 82 | − * | |
| 83 | − * ```ts | |
| 84 | − * import { stringifyYaml } from "@t3tools/shared/schemaYaml" | |
| 85 | − * | |
| 86 | − * const stringify = stringifyYaml() | |
| 87 | − * // Getter<string, unknown> | |
| 88 | − * ``` | |
| 89 | − * | |
| 90 | − * @see {@link parseYaml} for the inverse operation | |
| 91 | − */ | |
| 92 | −export function stringifyYaml( | |
| 93 | − options?: YamlStringifyOptions, | |
| 94 | −): SchemaGetter.Getter<string, unknown> { | |
| 45 | +/** Serializes YAML during encoding, reporting stringify failures as InvalidValue issues. */ | |
| 46 | +function stringifyYaml(options?: YamlStringifyOptions): SchemaGetter.Getter<string, unknown> { | |
| 95 | 47 | return SchemaGetter.transformOrFail((input: unknown) => |
| 96 | 48 | Effect.try({ |
| 97 | 49 | try: () => stringifyYamlValue(input, options), |
| @@ -92,23 +92,12 @@ export function resolveChangeRequestPresentation( · 91 unmodified lines | ||
| 92 | 92 | } |
| 93 | 93 | } |
| 94 | 94 | |
| 95 | −export function resolveChangeRequestPresentationForKind( | |
| 95 | +function resolveChangeRequestPresentationForKind( | |
| 96 | 96 | kind: SourceControlProviderKind, |
| 97 | 97 | ): ChangeRequestPresentation { |
| 98 | 98 | return resolveChangeRequestPresentation({ kind, name: "", baseUrl: "" }); |
| 99 | 99 | } |
| 100 | 100 | |
| 101 | −export function formatChangeRequestAction( | |
| 102 | − verb: "View" | "Create", | |
| 103 | − presentation: ChangeRequestPresentation, | |
| 104 | −): string { | |
| 105 | − return `${verb} ${presentation.shortName}`; | |
| 106 | −} | |
| 107 | − | |
| 108 | −export function formatCreateChangeRequestPhrase(presentation: ChangeRequestPresentation): string { | |
| 109 | − return `create ${presentation.shortName}`; | |
| 110 | −} | |
| 111 | − | |
| 112 | 101 | export function getChangeRequestTerminology( |
| 113 | 102 | provider: SourceControlProviderInfo | null | undefined, |
| 114 | 103 | ): ChangeRequestTerminology { |
| @@ -161,7 +161,7 @@ export function limitsNotice(limits: ServerProviderUsageLimits): string | null { · 160 unmodified lines | ||
| 161 | 161 | return limits.windows.length === 0 ? "No limits reported." : null; |
| 162 | 162 | } |
| 163 | 163 | |
| 164 | −export function resetMillis(window: ServerProviderUsageWindow): number | null { | |
| 164 | +function resetMillis(window: ServerProviderUsageWindow): number | null { | |
| 165 | 165 | if (window.resetsAt === undefined) return null; |
| 166 | 166 | const at = Date.parse(window.resetsAt); |
| 167 | 167 | return Number.isFinite(at) ? at : null; |