refactor: use SDK-exported SDKAssistantMessageError instead of local type definition
This commit is contained in:
@@ -19,9 +19,9 @@ import {
|
|||||||
} from './output-formatters.js';
|
} from './output-formatters.js';
|
||||||
import type { AuditLogger } from './audit-logger.js';
|
import type { AuditLogger } from './audit-logger.js';
|
||||||
import type { ProgressManager } from './progress-manager.js';
|
import type { ProgressManager } from './progress-manager.js';
|
||||||
|
import type { SDKAssistantMessageError } from '@anthropic-ai/claude-agent-sdk';
|
||||||
import type {
|
import type {
|
||||||
AssistantMessage,
|
AssistantMessage,
|
||||||
SDKAssistantMessageError,
|
|
||||||
ResultMessage,
|
ResultMessage,
|
||||||
ToolUseMessage,
|
ToolUseMessage,
|
||||||
ToolResultMessage,
|
ToolResultMessage,
|
||||||
|
|||||||
+2
-8
@@ -6,6 +6,8 @@
|
|||||||
|
|
||||||
// Type definitions for Claude executor message processing pipeline
|
// Type definitions for Claude executor message processing pipeline
|
||||||
|
|
||||||
|
import type { SDKAssistantMessageError } from '@anthropic-ai/claude-agent-sdk';
|
||||||
|
|
||||||
export interface ExecutionContext {
|
export interface ExecutionContext {
|
||||||
isParallelExecution: boolean;
|
isParallelExecution: boolean;
|
||||||
useCleanOutput: boolean;
|
useCleanOutput: boolean;
|
||||||
@@ -51,14 +53,6 @@ export interface ContentBlock {
|
|||||||
text?: string;
|
text?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export type SDKAssistantMessageError =
|
|
||||||
| 'authentication_failed'
|
|
||||||
| 'billing_error'
|
|
||||||
| 'rate_limit'
|
|
||||||
| 'invalid_request'
|
|
||||||
| 'server_error'
|
|
||||||
| 'max_output_tokens'
|
|
||||||
| 'unknown';
|
|
||||||
|
|
||||||
export interface AssistantMessage {
|
export interface AssistantMessage {
|
||||||
type: 'assistant';
|
type: 'assistant';
|
||||||
|
|||||||
@@ -18,7 +18,8 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import fs from 'fs/promises';
|
import fs from 'fs/promises';
|
||||||
import { query, type SDKAssistantMessageError } from '@anthropic-ai/claude-agent-sdk';
|
import { query } from '@anthropic-ai/claude-agent-sdk';
|
||||||
|
import type { SDKAssistantMessageError } from '@anthropic-ai/claude-agent-sdk';
|
||||||
import { PentestError, isRetryableError } from './error-handling.js';
|
import { PentestError, isRetryableError } from './error-handling.js';
|
||||||
import { ErrorCode } from '../types/errors.js';
|
import { ErrorCode } from '../types/errors.js';
|
||||||
import { type Result, ok, err } from '../types/result.js';
|
import { type Result, ok, err } from '../types/result.js';
|
||||||
|
|||||||
Reference in New Issue
Block a user