Skip to content

Commit 092956d

Browse files
committed
style: fix prettier formatting across all changed files
1 parent 6395a9a commit 092956d

7 files changed

Lines changed: 64 additions & 27 deletions

File tree

packages/core/src/core/state-manager.ts

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,8 @@ export class StateManager {
8181
// detect the "seen RUN_FINISHED, then RUN_STARTED again" pattern and
8282
// generate a fresh runId for the second logical run.
8383
let revoked = false;
84-
let subRunId: string | undefined; // runId assigned to the current logical run
85-
let runFinished = false; // true after RUN_FINISHED, reset on next RUN_STARTED
84+
let subRunId: string | undefined; // runId assigned to the current logical run
85+
let runFinished = false; // true after RUN_FINISHED, reset on next RUN_STARTED
8686

8787
const effectiveInput = (input: RunAgentInput): RunAgentInput => ({
8888
...input,
@@ -121,11 +121,20 @@ export class StateManager {
121121
},
122122
onMessagesSnapshotEvent: ({ event, input, messages }) => {
123123
if (revoked) return;
124-
this.handleMessagesSnapshot(agent, event, effectiveInput(input), messages);
124+
this.handleMessagesSnapshot(
125+
agent,
126+
event,
127+
effectiveInput(input),
128+
messages,
129+
);
125130
},
126131
onNewMessage: ({ message, input }) => {
127132
if (revoked) return;
128-
this.handleNewMessage(agent, message, input ? effectiveInput(input) : undefined);
133+
this.handleNewMessage(
134+
agent,
135+
message,
136+
input ? effectiveInput(input) : undefined,
137+
);
129138
},
130139
});
131140

packages/core/src/core/suggestion-engine.ts

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -59,14 +59,17 @@ export class SuggestionEngine {
5959
* clone holds the conversation messages; passing it here ensures dynamic suggestions fire
6060
* after the first message even though the registry agent has an empty message list.
6161
*/
62-
public reloadSuggestions(agentId: string, consumerAgent?: AbstractAgent): void {
62+
public reloadSuggestions(
63+
agentId: string,
64+
consumerAgent?: AbstractAgent,
65+
): void {
6366
this.clearSuggestions(agentId);
6467

6568
// Use the provided agent instance when available; fall back to the registry agent.
6669
// Per-thread clones hold the actual conversation messages; the registry agent does not.
67-
const agent = consumerAgent ?? (
68-
this.core as unknown as CopilotKitCoreFriendsAccess
69-
).getAgent(agentId);
70+
const agent =
71+
consumerAgent ??
72+
(this.core as unknown as CopilotKitCoreFriendsAccess).getAgent(agentId);
7073
if (!agent) {
7174
return;
7275
}
@@ -149,9 +152,11 @@ export class SuggestionEngine {
149152
}
150153
// Use the provided consumer agent when available (per-thread clone with actual messages);
151154
// fall back to the registry agent for non-threaded use.
152-
const suggestionsConsumerAgent = consumerAgent ?? (
153-
this.core as unknown as CopilotKitCoreFriendsAccess
154-
).getAgent(consumerAgentId);
155+
const suggestionsConsumerAgent =
156+
consumerAgent ??
157+
(this.core as unknown as CopilotKitCoreFriendsAccess).getAgent(
158+
consumerAgentId,
159+
);
155160
if (!suggestionsConsumerAgent) {
156161
throw new Error(
157162
`Suggestions consumer agent not found: ${consumerAgentId}`,

packages/react-core/src/v2/__tests__/utils/test-helpers.tsx

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,11 @@ export class MockStepwiseAgent extends AbstractAgent {
5757
// clone() contract (must return a distinct object).
5858
// Use the concrete constructor so subclasses (e.g. FailingConnectAgent)
5959
// preserve their overridden methods.
60-
const cloned = new (this.constructor as new () => MockStepwiseAgent)() as this;
60+
const cloned = new (this
61+
.constructor as new () => MockStepwiseAgent)() as this;
6162
cloned.agentId = this.agentId;
62-
(cloned as unknown as { subject: Subject<BaseEvent> }).subject = this.subject;
63+
(cloned as unknown as { subject: Subject<BaseEvent> }).subject =
64+
this.subject;
6365
return cloned;
6466
}
6567

@@ -119,10 +121,18 @@ export class MockReconnectableAgent extends AbstractAgent {
119121
clone(): MockReconnectableAgent {
120122
const cloned = new MockReconnectableAgent();
121123
cloned.agentId = this.agentId;
122-
(cloned as unknown as { subject: Subject<BaseEvent>; storedEvents: BaseEvent[] }).subject =
123-
this.subject;
124-
(cloned as unknown as { subject: Subject<BaseEvent>; storedEvents: BaseEvent[] }).storedEvents =
125-
this.storedEvents;
124+
(
125+
cloned as unknown as {
126+
subject: Subject<BaseEvent>;
127+
storedEvents: BaseEvent[];
128+
}
129+
).subject = this.subject;
130+
(
131+
cloned as unknown as {
132+
subject: Subject<BaseEvent>;
133+
storedEvents: BaseEvent[];
134+
}
135+
).storedEvents = this.storedEvents;
126136
return cloned;
127137
}
128138

@@ -464,9 +474,8 @@ export class SuggestionsProviderAgent extends MockStepwiseAgent {
464474

465475
clone(): this {
466476
const cloned = super.clone();
467-
(
468-
cloned as unknown as { _shared: typeof this._shared }
469-
)._shared = this._shared;
477+
(cloned as unknown as { _shared: typeof this._shared })._shared =
478+
this._shared;
470479
return cloned;
471480
}
472481

packages/react-core/src/v2/components/chat/__tests__/CopilotChatToolRendering.e2e.test.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,8 @@ class MockStepwiseAgent extends AbstractAgent {
252252
clone(): MockStepwiseAgent {
253253
const cloned = new MockStepwiseAgent();
254254
cloned.agentId = this.agentId;
255-
(cloned as unknown as { subject: Subject<BaseEvent> }).subject = this.subject;
255+
(cloned as unknown as { subject: Subject<BaseEvent> }).subject =
256+
this.subject;
256257
return cloned;
257258
}
258259

packages/react-core/src/v2/components/chat/__tests__/CopilotChatToolRerenders.e2e.test.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,8 @@ class MockStepwiseAgent extends AbstractAgent {
5454
clone(): MockStepwiseAgent {
5555
const cloned = new MockStepwiseAgent();
5656
cloned.agentId = this.agentId;
57-
(cloned as unknown as { subject: Subject<BaseEvent> }).subject = this.subject;
57+
(cloned as unknown as { subject: Subject<BaseEvent> }).subject =
58+
this.subject;
5859
return cloned;
5960
}
6061

packages/react-core/src/v2/components/chat/__tests__/MCPAppsActivityRenderer.e2e.test.tsx

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,10 +80,20 @@ class MockMCPProxyAgent extends AbstractAgent {
8080
clone(): MockMCPProxyAgent {
8181
const cloned = new MockMCPProxyAgent();
8282
cloned.agentId = this.agentId;
83-
type Internal = { subject: Subject<BaseEvent>; runAgentCalls: Array<{ input: Partial<RunAgentInput> }>; runAgentResponses: Map<string, unknown> };
84-
(cloned as unknown as Internal).subject = (this as unknown as Internal).subject;
85-
(cloned as unknown as Internal).runAgentCalls = (this as unknown as Internal).runAgentCalls;
86-
(cloned as unknown as Internal).runAgentResponses = (this as unknown as Internal).runAgentResponses;
83+
type Internal = {
84+
subject: Subject<BaseEvent>;
85+
runAgentCalls: Array<{ input: Partial<RunAgentInput> }>;
86+
runAgentResponses: Map<string, unknown>;
87+
};
88+
(cloned as unknown as Internal).subject = (
89+
this as unknown as Internal
90+
).subject;
91+
(cloned as unknown as Internal).runAgentCalls = (
92+
this as unknown as Internal
93+
).runAgentCalls;
94+
(cloned as unknown as Internal).runAgentResponses = (
95+
this as unknown as Internal
96+
).runAgentResponses;
8797
return cloned;
8898
}
8999

packages/react-core/src/v2/hooks/__tests__/use-frontend-tool.e2e.test.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -584,7 +584,9 @@ describe("useFrontendTool E2E - Dynamic Registration", () => {
584584
// Share runCount via reference so the second run emits different args
585585
Object.defineProperty(cloned, "runCount", {
586586
get: () => this.runCount,
587-
set: (v: number) => { this.runCount = v; },
587+
set: (v: number) => {
588+
this.runCount = v;
589+
},
588590
});
589591
return cloned;
590592
}

0 commit comments

Comments
 (0)