Skip to content

Commit 099d649

Browse files
committed
Merge branch 'main' into permissions
2 parents 7e347e6 + 989fc18 commit 099d649

206 files changed

Lines changed: 4852 additions & 587 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

package-lock.json

Lines changed: 149 additions & 173 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"publishConfig": {
44
"access": "public"
55
},
6-
"version": "0.0.45",
6+
"version": "0.0.46",
77
"description": "",
88
"main": "dist/index.js",
99
"bin": {
@@ -54,15 +54,15 @@
5454
"type": "module",
5555
"devDependencies": {
5656
"@types/node": "^24.10.1",
57-
"esbuild": "^0.25.0",
57+
"esbuild": "^0.28.1",
5858
"mcp-hello-world": "^1.1.2",
5959
"tsx": "^4.20.6",
6060
"typescript": "^5.9.3",
6161
"vitest": "^4.0.10"
6262
},
6363
"dependencies": {
64-
"@agentclientprotocol/sdk": "^0.22.1",
65-
"@openai/codex": "^0.128.0",
64+
"@agentclientprotocol/sdk": "^0.25.1",
65+
"@openai/codex": "^0.140.0",
6666
"diff": "^8.0.3",
6767
"open": "^11.0.0",
6868
"vscode-jsonrpc": "^8.2.1"

src/AcpExtensions.ts

Lines changed: 60 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,68 @@
1-
export type ExtMethodRequest = AuthenticationStatusRequest | AuthenticationLogoutRequest
1+
import type {
2+
ClientSideConnection,
3+
LoadSessionResponse,
4+
NewSessionResponse,
5+
ResumeSessionResponse,
6+
SessionId,
7+
} from "@agentclientprotocol/sdk";
8+
9+
export const LEGACY_SET_SESSION_MODEL_METHOD = "session/set_model";
10+
11+
export type LegacySessionModel = {
12+
modelId: string;
13+
name: string;
14+
description?: string | null;
15+
}
16+
17+
export type LegacySessionModelState = {
18+
availableModels: Array<LegacySessionModel>;
19+
currentModelId: string;
20+
}
21+
22+
export type LegacySetSessionModelRequest = {
23+
sessionId: SessionId;
24+
modelId: string;
25+
}
26+
27+
export type LegacySetSessionModelResponse = {}
28+
29+
export type LegacyNewSessionResponse = NewSessionResponse & {
30+
models?: LegacySessionModelState | null;
31+
}
32+
33+
export type LegacyLoadSessionResponse = LoadSessionResponse & {
34+
models?: LegacySessionModelState | null;
35+
}
36+
37+
export type LegacyResumeSessionResponse = ResumeSessionResponse & {
38+
models?: LegacySessionModelState | null;
39+
}
40+
41+
export type ExtMethodRequest =
42+
AuthenticationStatusRequest
43+
| AuthenticationLogoutRequest
44+
| LegacySetSessionModelExtRequest
245

346
export function isExtMethodRequest(request: { method: string, params: Record<string, unknown> }): request is ExtMethodRequest {
4-
return request.method === "authentication/status" || request.method === "authentication/logout";
47+
return request.method === "authentication/status"
48+
|| request.method === "authentication/logout"
49+
|| request.method === LEGACY_SET_SESSION_MODEL_METHOD;
550
}
651

752
export type AuthenticationStatusRequest = { method: "authentication/status", params: {} }
853
export type AuthenticationStatusResponse = { type: "api-key" } | { type: "chat-gpt", email: string } | { type: "gateway", name: string } | { type: "unauthenticated" }
954

1055
export type AuthenticationLogoutRequest = { method: "authentication/logout", params: {} }
11-
export type AuthenticationLogoutResponse = {}
56+
export type AuthenticationLogoutResponse = {}
57+
58+
export type LegacySetSessionModelExtRequest = {
59+
method: typeof LEGACY_SET_SESSION_MODEL_METHOD;
60+
params: LegacySetSessionModelRequest;
61+
}
62+
63+
export async function legacySetSessionModel(
64+
connection: Pick<ClientSideConnection, "extMethod">,
65+
params: LegacySetSessionModelRequest,
66+
): Promise<LegacySetSessionModelResponse> {
67+
return await connection.extMethod(LEGACY_SET_SESSION_MODEL_METHOD, params) as LegacySetSessionModelResponse;
68+
}

0 commit comments

Comments
 (0)