feat(adapter): detect claude-login-required errors and expose errorCode/errorMeta

Add detectClaudeLoginRequired and extractClaudeLoginUrl to parse module.
Extract buildClaudeRuntimeConfig for reuse by both execute and the new
runClaudeLogin helper. Include errorCode: "claude_auth_required" and
errorMeta: { loginUrl } in execution results when login is needed.
Export runClaudeLogin from the package index.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Forgotten
2026-02-23 14:40:44 -06:00
parent e1f2be7ecf
commit 2ddf6213fd
4 changed files with 171 additions and 16 deletions

View File

@@ -35,6 +35,8 @@ export interface AdapterExecutionResult {
signal: string | null;
timedOut: boolean;
errorMessage?: string | null;
errorCode?: string | null;
errorMeta?: Record<string, unknown>;
usage?: UsageSummary;
/**
* Legacy single session id output. Prefer `sessionParams` + `sessionDisplayId`.