@crewx/sdk 0.8.3-rc.2 → 0.8.3-rc.4
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 +46 -35
- package/dist/index.d.ts +4 -1
- package/dist/index.js +46 -35
- package/dist/provider/adapter.types.d.ts +19 -0
- package/dist/provider/adapters/claude.d.ts +2 -0
- package/dist/provider/adapters/codex.d.ts +2 -0
- package/dist/provider/adapters/copilot.d.ts +2 -0
- package/dist/provider/adapters/gemini.d.ts +2 -0
- package/dist/provider/adapters/index.d.ts +7 -0
- package/dist/provider/adapters/opencode.d.ts +2 -0
- package/dist/provider/bridge.d.ts +2 -1
- package/package.json +1 -1
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { ProviderQueryOptions, ProviderUsage } from './bridge.js';
|
|
2
|
+
export interface CliProviderAdapter {
|
|
3
|
+
readonly command: string;
|
|
4
|
+
buildArgs(message: string, options: ProviderQueryOptions, isExecute: boolean): {
|
|
5
|
+
args: string[];
|
|
6
|
+
stdinMessage?: string;
|
|
7
|
+
};
|
|
8
|
+
extractText(stdout: string): string;
|
|
9
|
+
extractFailure?(line: string): Error | null;
|
|
10
|
+
interpretExit?(code: number, stderr: string): Error | null;
|
|
11
|
+
parseResultMeta?(stdout: string): {
|
|
12
|
+
usage?: ProviderUsage | null;
|
|
13
|
+
model?: string | null;
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
export declare class RateLimitError extends Error {
|
|
17
|
+
readonly name = "RateLimitError";
|
|
18
|
+
constructor(message: string);
|
|
19
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { CliProviderAdapter } from '../adapter.types.js';
|
|
2
|
+
export { claudeAdapter } from './claude.js';
|
|
3
|
+
export { geminiAdapter } from './gemini.js';
|
|
4
|
+
export { copilotAdapter } from './copilot.js';
|
|
5
|
+
export { codexAdapter } from './codex.js';
|
|
6
|
+
export { opencodeAdapter } from './opencode.js';
|
|
7
|
+
export declare const BUILTIN_ADAPTERS: Record<string, CliProviderAdapter>;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { CliProviderAdapter } from './adapter.types.js';
|
|
1
2
|
export declare function parseStreamJsonOutput(raw: string): string;
|
|
2
3
|
export declare function parseResultEventUsage(raw: string): ProviderUsage | null;
|
|
3
4
|
export declare class ProviderError extends Error {
|
|
@@ -20,7 +21,7 @@ export interface RunCliProcessOptions {
|
|
|
20
21
|
onUsage?: (usage: ProviderUsage) => void;
|
|
21
22
|
onModel?: (model: string) => void;
|
|
22
23
|
}
|
|
23
|
-
export declare function runCliProcess(command: string, args: string[], providerStr: string, _providerId: string, options?: RunCliProcessOptions, stdinMessage?: string): Promise<{
|
|
24
|
+
export declare function runCliProcess(command: string, args: string[], providerStr: string, _providerId: string, options?: RunCliProcessOptions, stdinMessage?: string, adapter?: CliProviderAdapter): Promise<{
|
|
24
25
|
stdout: string;
|
|
25
26
|
parsed: string;
|
|
26
27
|
}>;
|