Skip to content

Commit 21611ad

Browse files
Julius Marmingeclaude
andcommitted
chore: reformat for oxfmt 0.64
The toolchain bump moves oxfmt from 0.57 to 0.64, which hugs a sole trailing arrow-function argument instead of breaking it. Whitespace only. Co-Authored-By: Claude Fable 5 <[email protected]>
1 parent 095da29 commit 21611ad

29 files changed

Lines changed: 519 additions & 603 deletions

‎apps/desktop/src/backend/DesktopBackendManager.ts‎

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -663,15 +663,13 @@ export const makeBackendInstance = Effect.fn("makeBackendInstance")(function* (
663663
Ref.update(state, withActiveRun(runId, f));
664664

665665
const snapshot = Ref.get(state).pipe(
666-
Effect.map(
667-
(current): DesktopBackendSnapshot => ({
668-
desiredRunning: current.desiredRunning,
669-
ready: current.ready,
670-
activePid: activePid(current.active),
671-
restartAttempt: current.restartAttempt,
672-
restartScheduled: Option.isSome(current.restartFiber),
673-
}),
674-
),
666+
Effect.map((current): DesktopBackendSnapshot => ({
667+
desiredRunning: current.desiredRunning,
668+
ready: current.ready,
669+
activePid: activePid(current.active),
670+
restartAttempt: current.restartAttempt,
671+
restartScheduled: Option.isSome(current.restartFiber),
672+
})),
675673
);
676674
const currentConfig = Ref.get(state).pipe(Effect.map((current) => current.config));
677675

‎apps/mobile/src/features/shortcuts/appShortcuts.ts‎

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -122,16 +122,14 @@ export function buildShortcutActions(recents: ReadonlyArray<RecentThreadShortcut
122122
icon: SHORTCUT_ICON,
123123
params: { href: NEW_TASK_SHORTCUT_HREF },
124124
},
125-
...recents.slice(0, MAX_RECENT_THREAD_SHORTCUTS).map(
126-
(thread): Action => ({
127-
// The encoded href doubles as the launcher id: URI-encoding makes the
128-
// env/thread join unambiguous (a plain `-` join lets different pairs
129-
// collide and overwrite each other's launcher slots).
130-
id: `thread:${threadShortcutHref(thread)}`,
131-
title: threadShortcutLabel(thread),
132-
icon: SHORTCUT_ICON,
133-
params: { href: threadShortcutHref(thread) },
134-
}),
135-
),
125+
...recents.slice(0, MAX_RECENT_THREAD_SHORTCUTS).map((thread): Action => ({
126+
// The encoded href doubles as the launcher id: URI-encoding makes the
127+
// env/thread join unambiguous (a plain `-` join lets different pairs
128+
// collide and overwrite each other's launcher slots).
129+
id: `thread:${threadShortcutHref(thread)}`,
130+
title: threadShortcutLabel(thread),
131+
icon: SHORTCUT_ICON,
132+
params: { href: threadShortcutHref(thread) },
133+
})),
136134
];
137135
}

‎apps/mobile/src/features/terminal/ThreadTerminalRouteScreen.tsx‎

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -948,16 +948,14 @@ export function ThreadTerminalRouteScreen(props: ThreadTerminalRouteScreenProps)
948948
},
949949
],
950950
},
951-
...terminalMenuSessions.map(
952-
(session): MenuAction => ({
953-
id: `terminal-session:${session.terminalId}`,
954-
title: session.displayLabel,
955-
subtitle: [getTerminalStatusLabel({ status: session.status }), basename(session.cwd)]
956-
.filter(Boolean)
957-
.join(" · "),
958-
state: session.terminalId === terminalId ? ("on" as const) : undefined,
959-
}),
960-
),
951+
...terminalMenuSessions.map((session): MenuAction => ({
952+
id: `terminal-session:${session.terminalId}`,
953+
title: session.displayLabel,
954+
subtitle: [getTerminalStatusLabel({ status: session.status }), basename(session.cwd)]
955+
.filter(Boolean)
956+
.join(" · "),
957+
state: session.terminalId === terminalId ? ("on" as const) : undefined,
958+
})),
961959
{
962960
id: "terminal-new",
963961
title: "Open new terminal",

‎apps/mobile/src/features/threads/threadListV2.ts‎

Lines changed: 15 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -255,25 +255,21 @@ export function buildThreadListV2ListItems(input: {
255255
readonly settledShelfHeaderIndex?: number | null;
256256
readonly snoozeLabelNow?: string;
257257
}): ThreadListV2ListItem[] {
258-
const threadItems = input.items.map(
259-
(item): ThreadListV2ListItem => ({
260-
type: "v2-thread",
261-
key: `v2-thread:${item.thread.environmentId}:${item.thread.id}`,
262-
item,
263-
snoozeWakeLabelText:
264-
item.snoozed && item.thread.snoozedUntil != null && input.snoozeLabelNow !== undefined
265-
? snoozeWakeLabel(item.thread.snoozedUntil, { now: input.snoozeLabelNow })
266-
: undefined,
267-
}),
268-
);
269-
const pendingItems = input.pendingTasks.map(
270-
(pendingTask, index): ThreadListV2ListItem => ({
271-
type: "v2-pending",
272-
key: `v2-pending:${pendingTask.message.messageId}`,
273-
pendingTask,
274-
showPendingDivider: index === 0,
275-
}),
276-
);
258+
const threadItems = input.items.map((item): ThreadListV2ListItem => ({
259+
type: "v2-thread",
260+
key: `v2-thread:${item.thread.environmentId}:${item.thread.id}`,
261+
item,
262+
snoozeWakeLabelText:
263+
item.snoozed && item.thread.snoozedUntil != null && input.snoozeLabelNow !== undefined
264+
? snoozeWakeLabel(item.thread.snoozedUntil, { now: input.snoozeLabelNow })
265+
: undefined,
266+
}));
267+
const pendingItems = input.pendingTasks.map((pendingTask, index): ThreadListV2ListItem => ({
268+
type: "v2-pending",
269+
key: `v2-pending:${pendingTask.message.messageId}`,
270+
pendingTask,
271+
showPendingDivider: index === 0,
272+
}));
277273
const snoozedCount = input.snoozedCount ?? 0;
278274
const snoozedShelfHeaderIndex = input.snoozedShelfHeaderIndex ?? null;
279275
const settledCount = input.settledCount ?? 0;

‎apps/mobile/src/persistence/mobile-database.ts‎

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -365,14 +365,13 @@ const makeAvailable = Effect.gen(function* () {
365365
}).pipe(
366366
Effect.flatMap(Schema.decodeUnknownEffect(ClientCacheSummaryRows)),
367367
Effect.mapError(databaseError("inspect-caches")),
368-
Effect.map(
369-
(rows): ReadonlyArray<ClientCacheSummaryRow> =>
370-
rows.map((row) => ({
371-
environmentId: row.environmentId as EnvironmentId,
372-
kind: row.kind,
373-
recordCount: row.recordCount,
374-
payloadBytes: row.payloadBytes,
375-
})),
368+
Effect.map((rows): ReadonlyArray<ClientCacheSummaryRow> =>
369+
rows.map((row) => ({
370+
environmentId: row.environmentId as EnvironmentId,
371+
kind: row.kind,
372+
recordCount: row.recordCount,
373+
payloadBytes: row.payloadBytes,
374+
})),
376375
),
377376
),
378377
loadPreferencesJson: Effect.tryPromise({

‎apps/server/src/auth/EnvironmentAuth.ts‎

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -923,12 +923,10 @@ export const make = Effect.gen(function* () {
923923
const listClientSessions: EnvironmentAuth["Service"]["listClientSessions"] = (currentSessionId) =>
924924
listSessions().pipe(
925925
Effect.map((clientSessions) =>
926-
clientSessions.map(
927-
(clientSession): AuthClientSession => ({
928-
...clientSession,
929-
current: clientSession.sessionId === currentSessionId,
930-
}),
931-
),
926+
clientSessions.map((clientSession): AuthClientSession => ({
927+
...clientSession,
928+
current: clientSession.sessionId === currentSessionId,
929+
})),
932930
),
933931
Effect.withSpan("EnvironmentAuth.listClientSessions"),
934932
);

‎apps/server/src/cloud/CliTokenManager.ts‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,9 +89,10 @@ export const waitForLoopbackAuthorization = Effect.fn(
8989
while (true) {
9090
const result = yield* Effect.raceFirst(
9191
input.callback.pipe(
92-
Effect.map(
93-
(code): LoopbackAuthorizationResult => ({ _tag: "AuthorizationCode", code }),
94-
),
92+
Effect.map((code): LoopbackAuthorizationResult => ({
93+
_tag: "AuthorizationCode",
94+
code,
95+
})),
9596
),
9697
readLoopbackAuthorizationAction(terminalInput),
9798
);

‎apps/server/src/diagnostics/ProcessDiagnostics.ts‎

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -61,21 +61,19 @@ export const make = Effect.fn("makeProcessDiagnostics")(function* () {
6161
Effect.map((snapshot) => {
6262
const processes = snapshot.processes
6363
.filter((entry) => canSignalCategory(entry.category))
64-
.map(
65-
(entry): ServerProcessDiagnosticsEntry => ({
66-
pid: entry.identity.pid,
67-
startTimeMs: entry.identity.startTimeMs,
68-
ppid: entry.ppid,
69-
pgid: Option.none(),
70-
status: entry.status || "Unknown",
71-
cpuPercent: entry.cpuPercent,
72-
rssBytes: entry.residentBytes,
73-
elapsed: formatElapsed(entry.runTimeMs),
74-
command: entry.command || entry.name || "unknown",
75-
depth: Math.max(0, entry.depth - 1),
76-
childPids: entry.childPids,
77-
}),
78-
);
64+
.map((entry): ServerProcessDiagnosticsEntry => ({
65+
pid: entry.identity.pid,
66+
startTimeMs: entry.identity.startTimeMs,
67+
ppid: entry.ppid,
68+
pgid: Option.none(),
69+
status: entry.status || "Unknown",
70+
cpuPercent: entry.cpuPercent,
71+
rssBytes: entry.residentBytes,
72+
elapsed: formatElapsed(entry.runTimeMs),
73+
command: entry.command || entry.name || "unknown",
74+
depth: Math.max(0, entry.depth - 1),
75+
childPids: entry.childPids,
76+
}));
7977
return {
8078
serverPid: process.pid,
8179
readAt: snapshot.readAt,

‎apps/server/src/mcp/McpHttpServer.ts‎

Lines changed: 23 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -64,30 +64,29 @@ export const normalizeMcpHttpResponse = (
6464
};
6565

6666
const makeMcpAuthMiddleware = McpSessionRegistry.McpSessionRegistry.pipe(
67-
Effect.map(
68-
(registry): McpAuthMiddleware =>
69-
Effect.fn("McpHttpServer.authenticateRequest")(function* (httpEffect) {
70-
const request = yield* HttpServerRequest.HttpServerRequest;
71-
const authorization = request.headers.authorization;
72-
const token =
73-
authorization?.startsWith("Bearer ") === true
74-
? authorization.slice("Bearer ".length).trim()
75-
: "";
76-
const invocation = yield* registry.resolve(token);
77-
if (!invocation) {
78-
// Without this the only symptom of a dead credential is the agent
79-
// quietly losing the whole `t3-code` toolkit for the rest of its
80-
// session, with nothing on the server to explain why.
81-
yield* Effect.logWarning("rejected MCP request with an unusable credential", {
82-
reason: token.length === 0 ? "missing_bearer_token" : "unknown_or_expired_token",
83-
});
84-
return unauthorized;
85-
}
86-
return yield* httpEffect.pipe(
87-
Effect.provideService(McpInvocationContext.McpInvocationContext, invocation),
88-
Effect.map(normalizeMcpHttpResponse),
89-
);
90-
}),
67+
Effect.map((registry): McpAuthMiddleware =>
68+
Effect.fn("McpHttpServer.authenticateRequest")(function* (httpEffect) {
69+
const request = yield* HttpServerRequest.HttpServerRequest;
70+
const authorization = request.headers.authorization;
71+
const token =
72+
authorization?.startsWith("Bearer ") === true
73+
? authorization.slice("Bearer ".length).trim()
74+
: "";
75+
const invocation = yield* registry.resolve(token);
76+
if (!invocation) {
77+
// Without this the only symptom of a dead credential is the agent
78+
// quietly losing the whole `t3-code` toolkit for the rest of its
79+
// session, with nothing on the server to explain why.
80+
yield* Effect.logWarning("rejected MCP request with an unusable credential", {
81+
reason: token.length === 0 ? "missing_bearer_token" : "unknown_or_expired_token",
82+
});
83+
return unauthorized;
84+
}
85+
return yield* httpEffect.pipe(
86+
Effect.provideService(McpInvocationContext.McpInvocationContext, invocation),
87+
Effect.map(normalizeMcpHttpResponse),
88+
);
89+
}),
9190
),
9291
Effect.withSpan("McpHttpServer.makeAuthMiddleware"),
9392
);

‎apps/server/src/orchestration/Layers/ProjectionSnapshotQuery.ts‎

Lines changed: 51 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -2391,42 +2391,40 @@ pending_approval_requests AS (
23912391
)
23922392
: Result.failVoid,
23932393
),
2394-
threads: threadRows.map(
2395-
(row): OrchestrationThreadShell => ({
2396-
id: row.threadId,
2397-
projectId: row.projectId,
2398-
title: row.title,
2399-
modelSelection: row.modelSelection,
2400-
runtimeMode: row.runtimeMode,
2401-
interactionMode: row.interactionMode,
2402-
branch: row.branch,
2403-
worktreePath: row.worktreePath,
2404-
...(row.linkedPullRequest === null
2405-
? {}
2406-
: { linkedPullRequest: row.linkedPullRequest }),
2407-
latestTurn: latestTurnByThread.get(row.threadId) ?? null,
2408-
createdAt: row.createdAt,
2409-
updatedAt: row.updatedAt,
2410-
archivedAt: row.archivedAt,
2411-
settledOverride: row.settledOverride,
2412-
settledAt: row.settledAt,
2413-
unsettledAt: row.unsettledAt,
2414-
snoozedUntil: row.snoozedUntil,
2415-
snoozedAt: row.snoozedAt,
2416-
pinnedAt: row.pinnedAt,
2417-
pinOrderKey: row.pinOrderKey ?? null,
2418-
titleRegeneration: mapTitleRegeneration(row),
2419-
session: sessionByThread.get(row.threadId) ?? null,
2420-
latestUserMessageAt: row.latestUserMessageAt,
2421-
hasPendingApprovals: row.pendingApprovalCount > 0,
2422-
hasPendingUserInput: row.pendingUserInputCount > 0,
2423-
hasActionableProposedPlan: row.hasActionableProposedPlan > 0,
2424-
backgroundLiveness: threadBackgroundLiveness.getThreadBackgroundLiveness(
2425-
row.threadId,
2426-
),
2427-
planProgress: threadPlanProgress.getThreadPlanProgress(row.threadId),
2428-
}),
2429-
),
2394+
threads: threadRows.map((row): OrchestrationThreadShell => ({
2395+
id: row.threadId,
2396+
projectId: row.projectId,
2397+
title: row.title,
2398+
modelSelection: row.modelSelection,
2399+
runtimeMode: row.runtimeMode,
2400+
interactionMode: row.interactionMode,
2401+
branch: row.branch,
2402+
worktreePath: row.worktreePath,
2403+
...(row.linkedPullRequest === null
2404+
? {}
2405+
: { linkedPullRequest: row.linkedPullRequest }),
2406+
latestTurn: latestTurnByThread.get(row.threadId) ?? null,
2407+
createdAt: row.createdAt,
2408+
updatedAt: row.updatedAt,
2409+
archivedAt: row.archivedAt,
2410+
settledOverride: row.settledOverride,
2411+
settledAt: row.settledAt,
2412+
unsettledAt: row.unsettledAt,
2413+
snoozedUntil: row.snoozedUntil,
2414+
snoozedAt: row.snoozedAt,
2415+
pinnedAt: row.pinnedAt,
2416+
pinOrderKey: row.pinOrderKey ?? null,
2417+
titleRegeneration: mapTitleRegeneration(row),
2418+
session: sessionByThread.get(row.threadId) ?? null,
2419+
latestUserMessageAt: row.latestUserMessageAt,
2420+
hasPendingApprovals: row.pendingApprovalCount > 0,
2421+
hasPendingUserInput: row.pendingUserInputCount > 0,
2422+
hasActionableProposedPlan: row.hasActionableProposedPlan > 0,
2423+
backgroundLiveness: threadBackgroundLiveness.getThreadBackgroundLiveness(
2424+
row.threadId,
2425+
),
2426+
planProgress: threadPlanProgress.getThreadPlanProgress(row.threadId),
2427+
})),
24302428
updatedAt: updatedAt ?? "1970-01-01T00:00:00.000Z",
24312429
};
24322430

@@ -2470,12 +2468,10 @@ pending_approval_requests AS (
24702468
"ProjectionSnapshotQuery.getCounts:decodeRow",
24712469
),
24722470
),
2473-
Effect.map(
2474-
(row): ProjectionSnapshotCounts => ({
2475-
projectCount: row.projectCount,
2476-
threadCount: row.threadCount,
2477-
}),
2478-
),
2471+
Effect.map((row): ProjectionSnapshotCounts => ({
2472+
projectCount: row.projectCount,
2473+
threadCount: row.threadCount,
2474+
})),
24792475
);
24802476

24812477
const getEventReplayStats: ProjectionSnapshotQueryShape["getEventReplayStats"] = (input) =>
@@ -2486,12 +2482,10 @@ pending_approval_requests AS (
24862482
"ProjectionSnapshotQuery.getEventReplayStats:decodeRow",
24872483
),
24882484
),
2489-
Effect.map(
2490-
(row): ProjectionEventReplayStats => ({
2491-
eventCount: row.eventCount,
2492-
payloadBytes: row.payloadBytes,
2493-
}),
2494-
),
2485+
Effect.map((row): ProjectionEventReplayStats => ({
2486+
eventCount: row.eventCount,
2487+
payloadBytes: row.payloadBytes,
2488+
})),
24952489
);
24962490

24972491
const searchThreads: ProjectionSnapshotQueryShape["searchThreads"] = Effect.fn(
@@ -2616,17 +2610,15 @@ pending_approval_requests AS (
26162610
projectId: threadRow.value.projectId,
26172611
workspaceRoot: threadRow.value.workspaceRoot,
26182612
worktreePath: threadRow.value.worktreePath,
2619-
checkpoints: checkpointRows.map(
2620-
(row): OrchestrationCheckpointSummary => ({
2621-
turnId: row.turnId,
2622-
checkpointTurnCount: row.checkpointTurnCount,
2623-
checkpointRef: row.checkpointRef,
2624-
status: row.status,
2625-
files: row.files,
2626-
assistantMessageId: row.assistantMessageId,
2627-
completedAt: row.completedAt,
2628-
}),
2629-
),
2613+
checkpoints: checkpointRows.map((row): OrchestrationCheckpointSummary => ({
2614+
turnId: row.turnId,
2615+
checkpointTurnCount: row.checkpointTurnCount,
2616+
checkpointRef: row.checkpointRef,
2617+
status: row.status,
2618+
files: row.files,
2619+
assistantMessageId: row.assistantMessageId,
2620+
completedAt: row.completedAt,
2621+
})),
26302622
});
26312623
});
26322624

0 commit comments

Comments
 (0)