Skip to content

Commit 8802888

Browse files
authored
Renable _meta.terminal-auth support (#265)
1 parent e4cebec commit 8802888

File tree

1 file changed

+12
-11
lines changed

1 file changed

+12
-11
lines changed

src/acp-agent.ts

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ import { ContentBlockParam } from "@anthropic-ai/sdk/resources";
6060
import { BetaContentBlock, BetaRawContentBlockDelta } from "@anthropic-ai/sdk/resources/beta.mjs";
6161
import packageJson from "../package.json" with { type: "json" };
6262
import { randomUUID } from "node:crypto";
63+
import { fileURLToPath } from "node:url";
6364

6465
export const CLAUDE_CONFIG_DIR = process.env.CLAUDE ?? path.join(os.homedir(), ".claude");
6566

@@ -165,17 +166,17 @@ export class ClaudeAcpAgent implements Agent {
165166
};
166167

167168
// If client supports terminal-auth capability, use that instead.
168-
// if (request.clientCapabilities?._meta?.["terminal-auth"] === true) {
169-
// const cliPath = fileURLToPath(import.meta.resolve("@anthropic-ai/claude-agent-sdk/cli.js"));
170-
171-
// authMethod._meta = {
172-
// "terminal-auth": {
173-
// command: "node",
174-
// args: [cliPath, "/login"],
175-
// label: "Claude Code Login",
176-
// },
177-
// };
178-
// }
169+
if (request.clientCapabilities?._meta?.["terminal-auth"] === true) {
170+
const cliPath = fileURLToPath(import.meta.resolve("@anthropic-ai/claude-agent-sdk/cli.js"));
171+
172+
authMethod._meta = {
173+
"terminal-auth": {
174+
command: "node",
175+
args: [cliPath, "/login"],
176+
label: "Claude Code Login",
177+
},
178+
};
179+
}
179180

180181
return {
181182
protocolVersion: 1,

0 commit comments

Comments
 (0)