Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 19 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,23 @@
import { startServer, stopServer, getServer } from "./server/index.js";
import { verifyClaude, verifyAuth } from "./subprocess/manager.js";

interface PluginApi {
registerProvider: (config: any) => void;
on: (event: string, callback: () => void) => void;
registerCli?: (callback: (cli: any) => void) => void;
}

interface AuthContext {
prompter: {
progress: (msg: string) => {
message: (m: string) => void;
stop: (m: string) => void
};
note: (msg: string, title?: string) => Promise<void>;
text: (options: any) => Promise<string>;
};
}

// Provider constants
const PROVIDER_ID = "claude-code-cli";
const PROVIDER_LABEL = "Claude Code CLI";
Expand Down Expand Up @@ -73,7 +90,7 @@ const claudeCodeCliPlugin = {
"Use Claude Max subscription via Claude Code CLI (bypasses OAuth restrictions)",
configSchema: emptyPluginConfigSchema(),

register(api: any) {
register(api: PluginApi) {
let serverPort = DEFAULT_PORT;

// Register the provider
Expand All @@ -91,7 +108,7 @@ const claudeCodeCliPlugin = {
hint: "Uses your existing Claude Code CLI authentication (from Claude Max)",
kind: "custom",

run: async (ctx: any) => {
run: async (ctx: AuthContext) => {
const spin = ctx.prompter.progress("Checking Claude CLI...");

try {
Expand Down