Skip to content

Commit 658713b

Browse files
fix: apply prettier formatting for bumped prettier version
The prettier bump in this PR (^3.8.1) changed how union types are line-wrapped (leading pipe style), causing 'npm run format:check' to fail in CI. Ran 'prettier --write' to bring these files in line with the new formatting rules; no semantic changes. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 7579201 commit 658713b

6 files changed

Lines changed: 32 additions & 11 deletions

File tree

nodejs/src/factory.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,12 @@ declare const factoryHandleBrand: unique symbol;
5454

5555
/** A value that can be represented losslessly on the SDK JSON wire. */
5656
export type JsonValue =
57-
null | boolean | number | string | JsonValue[] | { [key: string]: JsonValue };
57+
| null
58+
| boolean
59+
| number
60+
| string
61+
| JsonValue[]
62+
| { [key: string]: JsonValue };
5863

5964
/**
6065
* Conservative JSON shape language accepted by the Agent Factories surface, for

nodejs/src/types.ts

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@ export type {
4040
ModelBillingTokenPricesLongContext,
4141
} from "./generated/rpc.js";
4242
export type SessionEvent =
43-
Exclude<GeneratedSessionEvent, { type: "permission.requested" }> | PermissionRequestedEvent;
43+
| Exclude<GeneratedSessionEvent, { type: "permission.requested" }>
44+
| PermissionRequestedEvent;
4445
export type { ReasoningSummary } from "./generated/session-events.js";
4546
export type { SessionFsProvider } from "./sessionFsProvider.js";
4647
export { createSessionFsAdapter } from "./sessionFsProvider.js";
@@ -526,7 +527,9 @@ type McpCallToolResultResourceContent = {
526527
};
527528

528529
type McpCallToolResultContent =
529-
McpCallToolResultTextContent | McpCallToolResultImageContent | McpCallToolResultResourceContent;
530+
| McpCallToolResultTextContent
531+
| McpCallToolResultImageContent
532+
| McpCallToolResultResourceContent;
530533

531534
/**
532535
* MCP-compatible CallToolResult type. Can be passed to
@@ -1039,7 +1042,12 @@ export type SectionTransformFn = (currentContent: string) => string | Promise<st
10391042
* - `function`: Transform callback — receives current section content, returns new content
10401043
*/
10411044
export type SectionOverrideAction =
1042-
"replace" | "remove" | "append" | "prepend" | "preserve" | SectionTransformFn;
1045+
| "replace"
1046+
| "remove"
1047+
| "append"
1048+
| "prepend"
1049+
| "preserve"
1050+
| SectionTransformFn;
10431051

10441052
/**
10451053
* Override operation for a single system message section.
@@ -1114,7 +1122,9 @@ export interface SystemMessageCustomizeConfig {
11141122
* - Customize mode: Section-level overrides with graceful fallback
11151123
*/
11161124
export type SystemMessageConfig =
1117-
SystemMessageAppendConfig | SystemMessageReplaceConfig | SystemMessageCustomizeConfig;
1125+
| SystemMessageAppendConfig
1126+
| SystemMessageReplaceConfig
1127+
| SystemMessageCustomizeConfig;
11181128

11191129
import type { PermissionDecisionRequest, PermissionDecisionContext } from "./generated/rpc.js";
11201130

nodejs/test/e2e/rpc_shell_user_requested.e2e.test.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,8 @@ describe("User-requested shell RPC", async () => {
9292
const session = await client.createSession({ onPermissionRequest: approveAll });
9393
const markerPath = join(homeDir, `shell-cancel-${compactUuid()}.txt`);
9494
let executeTask:
95-
Promise<Awaited<ReturnType<typeof session.rpc.shell.executeUserRequested>>> | undefined;
95+
| Promise<Awaited<ReturnType<typeof session.rpc.shell.executeUserRequested>>>
96+
| undefined;
9697
let executeSettled = false;
9798
try {
9899
const missing = await session.rpc.shell.cancelUserRequested({

nodejs/test/e2e/session.e2e.test.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -862,7 +862,8 @@ describe("Sessions", () => {
862862

863863
const messages = await session.getEvents();
864864
const userMessage = messages.filter((m) => m.type === "user.message").at(-1) as
865-
{ data: { content: string; agentMode?: string | null } } | undefined;
865+
| { data: { content: string; agentMode?: string | null } }
866+
| undefined;
866867
expect(userMessage).toBeDefined();
867868
expect(userMessage!.data.content).toBe("Say mode ok.");
868869
expect(userMessage!.data.agentMode).toBe("plan");
@@ -893,7 +894,8 @@ describe("Sessions", () => {
893894

894895
function getSystemMessage(exchange: ParsedHttpExchange): string | undefined {
895896
const systemMessage = exchange.request.messages.find((m) => m.role === "system") as
896-
{ role: "system"; content: string } | undefined;
897+
| { role: "system"; content: string }
898+
| undefined;
897899
return systemMessage?.content;
898900
}
899901

nodejs/test/e2e/session_config.e2e.test.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,8 @@ describe("Session Configuration", async () => {
211211
request: { messages?: Array<{ role: string; content: unknown }> };
212212
}): string | undefined {
213213
const sys = (exchange.request.messages ?? []).find((m) => m.role === "system") as
214-
{ content: string } | undefined;
214+
| { content: string }
215+
| undefined;
215216
return sys?.content;
216217
}
217218

@@ -276,7 +277,8 @@ describe("Session Configuration", async () => {
276277
);
277278
expect(taskTool).toBeDefined();
278279
const parameters = taskTool?.function.parameters as
279-
{ properties?: { agent_type?: { enum?: string[] } } } | undefined;
280+
| { properties?: { agent_type?: { enum?: string[] } } }
281+
| undefined;
280282
const values = parameters?.properties?.agent_type?.enum;
281283
expect(values).toBeDefined();
282284
return values ?? [];

nodejs/test/e2e/system_message_transform.e2e.test.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@ describe("System message transform", async () => {
119119

120120
function getSystemMessage(exchange: ParsedHttpExchange): string | undefined {
121121
const systemMessage = exchange.request.messages.find((m) => m.role === "system") as
122-
{ role: "system"; content: string } | undefined;
122+
| { role: "system"; content: string }
123+
| undefined;
123124
return systemMessage?.content;
124125
}

0 commit comments

Comments
 (0)