Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions apps/web/src/sourceControlPresentation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ import type { ElementType } from "react";
import type { SourceControlProviderInfo, SourceControlProviderKind } from "@t3tools/contracts";
export {
DEFAULT_CHANGE_REQUEST_TERMINOLOGY,
formatChangeRequestAction,
formatCreateChangeRequestPhrase,
getChangeRequestTerminology,
resolveChangeRequestPresentation,
type ChangeRequestPresentation,
Expand Down
1 change: 1 addition & 0 deletions packages/shared/src/Net.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ export class NetService extends Context.Service<NetService, NetServiceShape>()(
"@t3tools/shared/Net/NetService",
) {}

/** @public Service construction is part of the canonical Effect module API. */
export const make = () => {
/**
* Returns true when a TCP server can bind to {host, port}.
Expand Down
2 changes: 1 addition & 1 deletion packages/shared/src/agentAwareness.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export interface ProjectThreadAwarenessInput {
>;
}

export function buildAgentAwarenessDeepLink(input: {
function buildAgentAwarenessDeepLink(input: {
readonly environmentId: EnvironmentId;
readonly threadId: ThreadId;
}): string {
Expand Down
12 changes: 0 additions & 12 deletions packages/shared/src/composerTrigger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,18 +115,6 @@ export function detectComposerTrigger(
};
}

export function parseStandaloneComposerSlashCommand(
text: string,
): Exclude<ComposerSlashCommand, "model"> | null {
const match = /^\/(plan|default)\s*$/i.exec(text.trim());
if (!match) {
return null;
}
const command = match[1]?.toLowerCase();
if (command === "plan") return "plan";
return "default";
}

export function replaceTextRange(
text: string,
rangeStart: number,
Expand Down
2 changes: 1 addition & 1 deletion packages/shared/src/httpReadiness.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import * as Ref from "effect/Ref";
import * as Schedule from "effect/Schedule";
import { HttpClient, HttpClientRequest } from "effect/unstable/http";

export const DEFAULT_HTTP_READY_PROBE_TIMEOUT_MS = 1_000;
const DEFAULT_HTTP_READY_PROBE_TIMEOUT_MS = 1_000;

/**
* Normalizes an arbitrary readiness probe failure into a plain, structured value
Expand Down
9 changes: 2 additions & 7 deletions packages/shared/src/model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ function getRawSelectionValueById(
return selection?.value;
}

export function getProviderOptionSelectionValue(
function getProviderOptionSelectionValue(
selections: ReadonlyArray<ProviderOptionSelection> | null | undefined,
id: string,
): string | boolean | undefined {
Expand Down Expand Up @@ -298,11 +298,6 @@ export function readCustomModelEntries(value: unknown): CustomModelDefinition[]
return entries;
}

/** Slugs of a `customModels` setting, in stored order. */
export function readCustomModelSlugs(value: unknown): string[] {
return readCustomModelEntries(value).map((entry) => entry.slug);
}

/**
* Write a definition back to the compact stored shape: a bare slug when it
* carries nothing custom, otherwise an entry with only the set fields.
Expand Down Expand Up @@ -361,7 +356,7 @@ export function resolveSelectableModel(
}

/** Trim a string, returning null for empty/missing values. */
export function trimOrNull<T extends string>(value: T | null | undefined): T | null {
function trimOrNull<T extends string>(value: T | null | undefined): T | null {
if (typeof value !== "string") return null;
const trimmed = value.trim() as T;
return trimmed || null;
Expand Down
2 changes: 1 addition & 1 deletion packages/shared/src/observability.ts
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ export function truncateTraceAttributes(attributes: TraceAttributes): TraceAttri
return truncated ?? attributes;
}

export function spanToTraceRecord(span: SerializableSpan): EffectTraceRecord {
function spanToTraceRecord(span: SerializableSpan): EffectTraceRecord {
const status = span.status as Extract<Tracer.SpanStatus, { _tag: "Ended" }>;
const parentSpanId = Option.getOrUndefined(span.parent)?.spanId;

Expand Down
2 changes: 1 addition & 1 deletion packages/shared/src/orchestrationTiming.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export function formatDuration(durationMs: number): string {
return parts.join(" ");
}

export function isLatestTurnSettled(
function isLatestTurnSettled(
latestTurn: LatestTurnTiming | null,
session: SessionActivityState | null,
): boolean {
Expand Down
2 changes: 1 addition & 1 deletion packages/shared/src/relayClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import { ChildProcess, ChildProcessSpawner } from "effect/unstable/process";
import { HostProcessArchitecture, HostProcessPlatform } from "./hostProcess.ts";

export const CLOUDFLARED_VERSION = "2026.5.2";
export const CLOUDFLARED_PATH_ENV_NAME = "T3CODE_CLOUDFLARED_PATH";
const CLOUDFLARED_PATH_ENV_NAME = "T3CODE_CLOUDFLARED_PATH";

export type RelayClientExecutableSource = "override" | "managed" | "path";

Expand Down
4 changes: 2 additions & 2 deletions packages/shared/src/schemaJson.ts
Original file line number Diff line number Diff line change
Expand Up @@ -199,12 +199,12 @@ const parseLenientJsonGetter = SchemaGetter.onSome((input: string) => {
* strips trailing commas and JS-style comments before parsing.
* Encoding produces strict JSON via `JSON.stringify`.
*/
export const fromLenientJsonString = new SchemaTransformation.Transformation(
const fromLenientJsonString = new SchemaTransformation.Transformation(
parseLenientJsonGetter,
SchemaGetter.stringifyJson(),
);

export const prettyJsonString = SchemaGetter.parseJson<string>().compose(
const prettyJsonString = SchemaGetter.parseJson<string>().compose(
SchemaGetter.stringifyJson({ space: 2 }),
);

Expand Down
56 changes: 4 additions & 52 deletions packages/shared/src/schemaYaml.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,32 +32,8 @@ function formatYamlParseError(error: unknown): string {
return `Invalid YAML (code=${error.code}${location}).`;
}

/**
* Parses a YAML string into a value.
*
* **When to use**
*
* Use when you need a schema getter to parse a present encoded YAML string
* during decoding.
*
* **Details**
*
* Parse failures become `SchemaIssue.InvalidValue` values.
*
* **Example** (Parse YAML)
*
* ```ts
* import { parseYaml } from "@t3tools/shared/schemaYaml"
*
* const parse = parseYaml<string>()
* // Getter<unknown, string>
* ```
*
* @see {@link stringifyYaml} for the inverse operation
*/
export function parseYaml<E extends string>(
options?: YamlParseOptions,
): SchemaGetter.Getter<unknown, E> {
/** Parses YAML during decoding, reporting parse failures as InvalidValue issues. */
function parseYaml<E extends string>(options?: YamlParseOptions): SchemaGetter.Getter<unknown, E> {
return SchemaGetter.transformOrFail((input: E) =>
Effect.try({
try: () => parseYamlString(input, options) as unknown,
Expand All @@ -66,32 +42,8 @@ export function parseYaml<E extends string>(
);
}

/**
* Stringifies a present value as YAML.
*
* **When to use**
*
* Use when you need a schema getter to serialize a present decoded value to
* YAML text during encoding.
*
* **Details**
*
* Stringify failures become `SchemaIssue.InvalidValue` values.
*
* **Example** (Stringify YAML)
*
* ```ts
* import { stringifyYaml } from "@t3tools/shared/schemaYaml"
*
* const stringify = stringifyYaml()
* // Getter<string, unknown>
* ```
*
* @see {@link parseYaml} for the inverse operation
*/
export function stringifyYaml(
options?: YamlStringifyOptions,
): SchemaGetter.Getter<string, unknown> {
/** Serializes YAML during encoding, reporting stringify failures as InvalidValue issues. */
function stringifyYaml(options?: YamlStringifyOptions): SchemaGetter.Getter<string, unknown> {
Comment thread
macroscopeapp[bot] marked this conversation as resolved.
return SchemaGetter.transformOrFail((input: unknown) =>
Effect.try({
try: () => stringifyYamlValue(input, options),
Expand Down
13 changes: 1 addition & 12 deletions packages/shared/src/sourceControl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,23 +92,12 @@ export function resolveChangeRequestPresentation(
}
}

export function resolveChangeRequestPresentationForKind(
function resolveChangeRequestPresentationForKind(
kind: SourceControlProviderKind,
): ChangeRequestPresentation {
return resolveChangeRequestPresentation({ kind, name: "", baseUrl: "" });
}

export function formatChangeRequestAction(
verb: "View" | "Create",
presentation: ChangeRequestPresentation,
): string {
return `${verb} ${presentation.shortName}`;
}

export function formatCreateChangeRequestPhrase(presentation: ChangeRequestPresentation): string {
return `create ${presentation.shortName}`;
}

export function getChangeRequestTerminology(
provider: SourceControlProviderInfo | null | undefined,
): ChangeRequestTerminology {
Expand Down
2 changes: 1 addition & 1 deletion packages/shared/src/usageLimits.ts
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ export function limitsNotice(limits: ServerProviderUsageLimits): string | null {
return limits.windows.length === 0 ? "No limits reported." : null;
}

export function resetMillis(window: ServerProviderUsageWindow): number | null {
function resetMillis(window: ServerProviderUsageWindow): number | null {
if (window.resetsAt === undefined) return null;
const at = Date.parse(window.resetsAt);
return Number.isFinite(at) ? at : null;
Expand Down
Loading