Skip to content

Commit 2e4bdd4

Browse files
committed
fix: use SDK SessionEvent type for forward compat with copilot-sdk 0.3.0
The auditor's session.on() handler used an inline type annotation that is incompatible with the SessionEvent discriminated union in @github/copilot-sdk 0.3.0. Import and use the SDK's SessionEvent type instead — works with both 0.2.x and 0.3.x. Signed-off-by: Simon Davies <simongdavies@users.noreply.github.com>
1 parent 7deaef6 commit 2e4bdd4

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

src/plugin-system/auditor.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,11 @@ import { createWriteStream, mkdirSync, type WriteStream } from "node:fs";
1515
import { createRequire } from "node:module";
1616
import { join } from "node:path";
1717
import { tmpdir } from "node:os";
18-
import { approveAll, type CopilotClient } from "@github/copilot-sdk";
18+
import {
19+
approveAll,
20+
type CopilotClient,
21+
type SessionEvent,
22+
} from "@github/copilot-sdk";
1923
import type {
2024
PluginManifest,
2125
AuditResult,
@@ -656,7 +660,7 @@ export async function deepAudit(
656660
signal?.addEventListener("abort", onAbort, { once: true });
657661

658662
const unsubscribe = auditSession.on(
659-
(event: { type: string; data?: Record<string, unknown> }) => {
663+
(event: SessionEvent) => {
660664
// Trace every event type so we can see what's happening
661665
trace(
662666
`event: ${event.type} ${JSON.stringify(event.data ?? {}).slice(0, 300)}`,

0 commit comments

Comments
 (0)