@crewx/sdk 0.8.9-rc.29 → 0.8.9-rc.30
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/esm/index.js +50 -50
- package/dist/index.browser.js +2 -2
- package/dist/index.js +52 -52
- package/dist/provider/bridge.browser.d.ts +1 -10
- package/dist/provider/bridge.d.ts +1 -10
- package/dist/provider/cli/adapter.types.d.ts +3 -2
- package/dist/provider/errors.d.ts +20 -0
- package/package.json +1 -1
|
@@ -1,13 +1,4 @@
|
|
|
1
|
-
export
|
|
2
|
-
readonly providerStr: string;
|
|
3
|
-
constructor(message: string, providerStr: string);
|
|
4
|
-
}
|
|
5
|
-
export declare class IdleTimeoutError extends ProviderError {
|
|
6
|
-
constructor(message: string, providerStr: string);
|
|
7
|
-
}
|
|
8
|
-
export declare class TotalTimeoutError extends ProviderError {
|
|
9
|
-
constructor(message: string, providerStr: string);
|
|
10
|
-
}
|
|
1
|
+
export { ProviderError, IdleTimeoutError, TotalTimeoutError } from './errors.js';
|
|
11
2
|
export type ProviderFactory = (id: string, providerStr: string) => ProviderRuntime;
|
|
12
3
|
export interface ProviderUsage {
|
|
13
4
|
inputTokens: number;
|
|
@@ -1,16 +1,7 @@
|
|
|
1
1
|
import type { CliProviderAdapter } from './cli/adapter.types.js';
|
|
2
2
|
export declare function parseStreamJsonOutput(raw: string): string;
|
|
3
3
|
export declare function parseResultEventUsage(raw: string): ProviderUsage | null;
|
|
4
|
-
export
|
|
5
|
-
readonly providerStr: string;
|
|
6
|
-
constructor(message: string, providerStr: string);
|
|
7
|
-
}
|
|
8
|
-
export declare class IdleTimeoutError extends ProviderError {
|
|
9
|
-
constructor(message: string, providerStr: string);
|
|
10
|
-
}
|
|
11
|
-
export declare class TotalTimeoutError extends ProviderError {
|
|
12
|
-
constructor(message: string, providerStr: string);
|
|
13
|
-
}
|
|
4
|
+
export { ProviderError, IdleTimeoutError, TotalTimeoutError, type ProviderErrorCode, type ProviderErrorKind, type ProviderErrorOptions, } from './errors.js';
|
|
14
5
|
export declare function shouldFallbackToGhCopilot(providerId: string, err: unknown, platform?: NodeJS.Platform): boolean;
|
|
15
6
|
export interface RunCliProcessOptions {
|
|
16
7
|
timeoutMs?: number;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { ProviderQueryOptions, ProviderUsage } from '../bridge.js';
|
|
2
2
|
import type { TaskLogEntry } from '../../types/task-log.types.js';
|
|
3
|
+
import { ProviderError } from '../errors.js';
|
|
3
4
|
export interface CliProviderAdapter {
|
|
4
5
|
readonly command: string;
|
|
5
6
|
readonly meta?: {
|
|
@@ -27,7 +28,7 @@ export interface CliProviderAdapter {
|
|
|
27
28
|
parseEvent?(line: string, timestamp?: string): TaskLogEntry[];
|
|
28
29
|
suppressOutputLine?(line: string): boolean;
|
|
29
30
|
}
|
|
30
|
-
export declare class RateLimitError extends
|
|
31
|
+
export declare class RateLimitError extends ProviderError {
|
|
31
32
|
readonly name = "RateLimitError";
|
|
32
|
-
constructor(message: string);
|
|
33
|
+
constructor(message: string, providerStr?: string);
|
|
33
34
|
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export type ProviderErrorKind = 'transient' | 'permanent' | 'config';
|
|
2
|
+
export type ProviderErrorCode = 'QUOTA_EXHAUSTED' | 'RATE_LIMITED' | 'EMPTY_OUTPUT' | 'AUTH_REQUIRED' | 'MODEL_UNAVAILABLE' | 'TIMEOUT_IDLE' | 'TIMEOUT_TOTAL' | 'PROVIDER_NOT_FOUND' | 'INVALID_PROVIDER_FORMAT' | 'PROVIDER_CRASHED' | 'UNKNOWN';
|
|
3
|
+
export interface ProviderErrorOptions {
|
|
4
|
+
code?: ProviderErrorCode;
|
|
5
|
+
kind?: ProviderErrorKind;
|
|
6
|
+
retryAfterMs?: number;
|
|
7
|
+
}
|
|
8
|
+
export declare class ProviderError extends Error {
|
|
9
|
+
readonly providerStr: string;
|
|
10
|
+
readonly code: ProviderErrorCode;
|
|
11
|
+
readonly kind?: ProviderErrorKind;
|
|
12
|
+
readonly retryAfterMs?: number;
|
|
13
|
+
constructor(message: string, providerStr: string, options?: ProviderErrorOptions);
|
|
14
|
+
}
|
|
15
|
+
export declare class IdleTimeoutError extends ProviderError {
|
|
16
|
+
constructor(message: string, providerStr: string);
|
|
17
|
+
}
|
|
18
|
+
export declare class TotalTimeoutError extends ProviderError {
|
|
19
|
+
constructor(message: string, providerStr: string);
|
|
20
|
+
}
|