@hasna/switcher 0.1.0 → 0.1.2
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/README.md +210 -13
- package/dist/aider-args.d.ts +7 -0
- package/dist/aider-config.d.ts +6 -0
- package/dist/auth.d.ts +3 -0
- package/dist/catalog.d.ts +3 -2
- package/dist/cli/index.js +8558 -337
- package/dist/cline-backend.d.ts +7 -0
- package/dist/credentials.d.ts +178 -0
- package/dist/direct-launch.d.ts +6 -0
- package/dist/domain.d.ts +142 -19
- package/dist/dsh-args.d.ts +5 -0
- package/dist/gemini-bridge.d.ts +6 -0
- package/dist/gemini-config.d.ts +12 -0
- package/dist/generated/api.d.ts +163 -11
- package/dist/grok-args.d.ts +1 -0
- package/dist/harness-arguments.d.ts +6 -0
- package/dist/harness-environment.d.ts +1 -0
- package/dist/harness-installation.d.ts +19 -0
- package/dist/harness-process.d.ts +11 -0
- package/dist/harness-types.d.ts +2 -0
- package/dist/harnesses.d.ts +36 -2
- package/dist/hermes-backend.d.ts +19 -0
- package/dist/index.js +209 -6
- package/dist/kilo-config.d.ts +13 -0
- package/dist/kilo.d.ts +5 -0
- package/dist/launcher.d.ts +39 -3
- package/dist/mcp/index.js +159 -7
- package/dist/omp-backend.d.ts +7 -0
- package/dist/opencode2-config.d.ts +60 -0
- package/dist/ori-backend.d.ts +89 -0
- package/dist/presets.d.ts +64 -0
- package/dist/runtime.d.ts +20 -0
- package/dist/sdk.d.ts +95 -19
- package/dist/sdk.js +209 -6
- package/dist/serve/index.js +909 -98
- package/dist/server.d.ts +16 -0
- package/dist/service.d.ts +2 -1
- package/dist/terminal-descriptors.d.ts +5 -0
- package/hasna.contract.json +1 -1
- package/openapi.json +450 -12
- package/package.json +19 -4
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { HarnessLaunchInput, PreparedLaunch } from "./harness-types";
|
|
2
|
+
/**
|
|
3
|
+
* Prepare Cline's native provider and model registries in an isolated data
|
|
4
|
+
* directory. Cline resolves OPENAI_API_KEY/ANTHROPIC_API_KEY from the child
|
|
5
|
+
* environment; no apiKey or auth token is written to either registry.
|
|
6
|
+
*/
|
|
7
|
+
export declare function prepareClineLaunch(input: HarnessLaunchInput): Promise<PreparedLaunch>;
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { CommandInterrupted, type ProviderInput } from "./domain";
|
|
3
|
+
declare const keychain: z.ZodObject<{
|
|
4
|
+
kind: z.ZodLiteral<"keychain">;
|
|
5
|
+
service: z.ZodString;
|
|
6
|
+
account: z.ZodString;
|
|
7
|
+
}, "strict", z.ZodTypeAny, {
|
|
8
|
+
kind: "keychain";
|
|
9
|
+
service: string;
|
|
10
|
+
account: string;
|
|
11
|
+
}, {
|
|
12
|
+
kind: "keychain";
|
|
13
|
+
service: string;
|
|
14
|
+
account: string;
|
|
15
|
+
}>;
|
|
16
|
+
export declare const credentialBindingSchema: z.ZodObject<{
|
|
17
|
+
schema: z.ZodLiteral<1>;
|
|
18
|
+
credentialEnv: z.ZodString;
|
|
19
|
+
origins: z.ZodArray<z.ZodEffects<z.ZodString, string, string>, "many">;
|
|
20
|
+
source: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
|
|
21
|
+
kind: z.ZodLiteral<"keychain">;
|
|
22
|
+
service: z.ZodString;
|
|
23
|
+
account: z.ZodString;
|
|
24
|
+
}, "strict", z.ZodTypeAny, {
|
|
25
|
+
kind: "keychain";
|
|
26
|
+
service: string;
|
|
27
|
+
account: string;
|
|
28
|
+
}, {
|
|
29
|
+
kind: "keychain";
|
|
30
|
+
service: string;
|
|
31
|
+
account: string;
|
|
32
|
+
}>, z.ZodObject<{
|
|
33
|
+
kind: z.ZodLiteral<"vault">;
|
|
34
|
+
key: z.ZodString;
|
|
35
|
+
url: z.ZodEffects<z.ZodString, string, string>;
|
|
36
|
+
executable: z.ZodEffects<z.ZodString, string, string>;
|
|
37
|
+
operator: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
|
|
38
|
+
kind: z.ZodLiteral<"env">;
|
|
39
|
+
}, "strict", z.ZodTypeAny, {
|
|
40
|
+
kind: "env";
|
|
41
|
+
}, {
|
|
42
|
+
kind: "env";
|
|
43
|
+
}>, z.ZodObject<{
|
|
44
|
+
kind: z.ZodLiteral<"keychain">;
|
|
45
|
+
account: z.ZodString;
|
|
46
|
+
}, "strict", z.ZodTypeAny, {
|
|
47
|
+
kind: "keychain";
|
|
48
|
+
account: string;
|
|
49
|
+
}, {
|
|
50
|
+
kind: "keychain";
|
|
51
|
+
account: string;
|
|
52
|
+
}>]>;
|
|
53
|
+
}, "strict", z.ZodTypeAny, {
|
|
54
|
+
url: string;
|
|
55
|
+
key: string;
|
|
56
|
+
executable: string;
|
|
57
|
+
kind: "vault";
|
|
58
|
+
operator: {
|
|
59
|
+
kind: "env";
|
|
60
|
+
} | {
|
|
61
|
+
kind: "keychain";
|
|
62
|
+
account: string;
|
|
63
|
+
};
|
|
64
|
+
}, {
|
|
65
|
+
url: string;
|
|
66
|
+
key: string;
|
|
67
|
+
executable: string;
|
|
68
|
+
kind: "vault";
|
|
69
|
+
operator: {
|
|
70
|
+
kind: "env";
|
|
71
|
+
} | {
|
|
72
|
+
kind: "keychain";
|
|
73
|
+
account: string;
|
|
74
|
+
};
|
|
75
|
+
}>]>;
|
|
76
|
+
}, "strict", z.ZodTypeAny, {
|
|
77
|
+
credentialEnv: string;
|
|
78
|
+
source: {
|
|
79
|
+
kind: "keychain";
|
|
80
|
+
service: string;
|
|
81
|
+
account: string;
|
|
82
|
+
} | {
|
|
83
|
+
url: string;
|
|
84
|
+
key: string;
|
|
85
|
+
executable: string;
|
|
86
|
+
kind: "vault";
|
|
87
|
+
operator: {
|
|
88
|
+
kind: "env";
|
|
89
|
+
} | {
|
|
90
|
+
kind: "keychain";
|
|
91
|
+
account: string;
|
|
92
|
+
};
|
|
93
|
+
};
|
|
94
|
+
schema: 1;
|
|
95
|
+
origins: string[];
|
|
96
|
+
}, {
|
|
97
|
+
credentialEnv: string;
|
|
98
|
+
source: {
|
|
99
|
+
kind: "keychain";
|
|
100
|
+
service: string;
|
|
101
|
+
account: string;
|
|
102
|
+
} | {
|
|
103
|
+
url: string;
|
|
104
|
+
key: string;
|
|
105
|
+
executable: string;
|
|
106
|
+
kind: "vault";
|
|
107
|
+
operator: {
|
|
108
|
+
kind: "env";
|
|
109
|
+
} | {
|
|
110
|
+
kind: "keychain";
|
|
111
|
+
account: string;
|
|
112
|
+
};
|
|
113
|
+
};
|
|
114
|
+
schema: 1;
|
|
115
|
+
origins: string[];
|
|
116
|
+
}>;
|
|
117
|
+
export type CredentialBinding = z.infer<typeof credentialBindingSchema>;
|
|
118
|
+
export declare class CredentialBindings {
|
|
119
|
+
readonly env: NodeJS.ProcessEnv;
|
|
120
|
+
readonly directory: string;
|
|
121
|
+
constructor(env?: NodeJS.ProcessEnv);
|
|
122
|
+
private path;
|
|
123
|
+
private readableDirectory;
|
|
124
|
+
get(name: string): Promise<CredentialBinding | undefined>;
|
|
125
|
+
list(): Promise<CredentialBinding[]>;
|
|
126
|
+
bind(input: CredentialBinding): Promise<{
|
|
127
|
+
credentialEnv: string;
|
|
128
|
+
source: {
|
|
129
|
+
kind: "keychain";
|
|
130
|
+
service: string;
|
|
131
|
+
account: string;
|
|
132
|
+
} | {
|
|
133
|
+
url: string;
|
|
134
|
+
key: string;
|
|
135
|
+
executable: string;
|
|
136
|
+
kind: "vault";
|
|
137
|
+
operator: {
|
|
138
|
+
kind: "env";
|
|
139
|
+
} | {
|
|
140
|
+
kind: "keychain";
|
|
141
|
+
account: string;
|
|
142
|
+
};
|
|
143
|
+
};
|
|
144
|
+
schema: 1;
|
|
145
|
+
origins: string[];
|
|
146
|
+
}>;
|
|
147
|
+
remove(name: string): Promise<{
|
|
148
|
+
removed: string;
|
|
149
|
+
}>;
|
|
150
|
+
}
|
|
151
|
+
export declare function credentialReference(selector: string): string;
|
|
152
|
+
export declare function validateVaultExecutable(path: string): Promise<string>;
|
|
153
|
+
export declare function bindingTarget(selector: string, override?: string, allowedOrigins?: string[]): {
|
|
154
|
+
credentialEnv: string;
|
|
155
|
+
origins: string[];
|
|
156
|
+
};
|
|
157
|
+
declare function readKeychain(source: z.infer<typeof keychain>): Promise<string>;
|
|
158
|
+
export declare class CredentialResolver {
|
|
159
|
+
readonly env: NodeJS.ProcessEnv;
|
|
160
|
+
private readonly keychainRead;
|
|
161
|
+
readonly bindings: CredentialBindings;
|
|
162
|
+
constructor(env?: NodeJS.ProcessEnv, keychainRead?: typeof readKeychain);
|
|
163
|
+
resolve(provider: ProviderInput): Promise<string | undefined>;
|
|
164
|
+
check(name: string): Promise<{
|
|
165
|
+
credentialEnv: string;
|
|
166
|
+
source: string;
|
|
167
|
+
available: boolean;
|
|
168
|
+
length: number;
|
|
169
|
+
sha256: string;
|
|
170
|
+
providerAuthentication: string;
|
|
171
|
+
}>;
|
|
172
|
+
}
|
|
173
|
+
export declare class CredentialInterrupted extends CommandInterrupted {
|
|
174
|
+
constructor(exitCode: number);
|
|
175
|
+
}
|
|
176
|
+
/** Internal child mode: the key travels only through an authenticated loopback request. */
|
|
177
|
+
export declare function deliverVaultCredential(): Promise<void>;
|
|
178
|
+
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { SwitcherClient, type Provider, type Profile } from "./sdk";
|
|
2
|
+
import { type Model } from "./domain";
|
|
3
|
+
import { type PresetOptions } from "./presets";
|
|
4
|
+
export declare function resolveLaunchProvider(client: SwitcherClient, selector: string, options?: PresetOptions): Promise<Provider>;
|
|
5
|
+
export declare function selectModel(models: Model[], query?: string, harness?: Profile["harness"]): Promise<string>;
|
|
6
|
+
export declare function ensureLaunchProfile(client: SwitcherClient, provider: Provider, harness: Profile["harness"], model: string): Promise<Profile>;
|
package/dist/domain.d.ts
CHANGED
|
@@ -1,177 +1,294 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
export
|
|
3
|
-
export declare const
|
|
4
|
-
export declare const
|
|
2
|
+
export type { AuthStyle } from "./auth";
|
|
3
|
+
export declare const VERSION = "0.1.2";
|
|
4
|
+
export declare const harnessSchema: z.ZodEnum<["claude", "codex", "grok", "opencode", "opencode2", "pi", "omp", "dsh", "cline", "hermes", "prime-agent", "gemini", "aider", "kilo"]>;
|
|
5
|
+
export declare const protocolSchema: z.ZodEnum<["anthropic-messages", "openai-responses", "openai-chat", "gemini-generate-content"]>;
|
|
5
6
|
export declare const idSchema: z.ZodString;
|
|
6
7
|
export declare function endpoint(value: string): string;
|
|
7
8
|
export declare const modelSchema: z.ZodObject<{
|
|
8
9
|
id: z.ZodString;
|
|
9
10
|
name: z.ZodString;
|
|
10
11
|
description: z.ZodOptional<z.ZodString>;
|
|
12
|
+
available: z.ZodOptional<z.ZodBoolean>;
|
|
11
13
|
contextWindow: z.ZodOptional<z.ZodNumber>;
|
|
12
14
|
maxOutputTokens: z.ZodOptional<z.ZodNumber>;
|
|
13
15
|
inputModalities: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
14
16
|
outputModalities: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
15
17
|
supportedParameters: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
18
|
+
supportedGenerationMethods: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
16
19
|
}, "strict", z.ZodTypeAny, {
|
|
17
20
|
id: string;
|
|
18
21
|
name: string;
|
|
19
22
|
description?: string | undefined;
|
|
23
|
+
available?: boolean | undefined;
|
|
20
24
|
contextWindow?: number | undefined;
|
|
21
25
|
maxOutputTokens?: number | undefined;
|
|
22
26
|
inputModalities?: string[] | undefined;
|
|
23
27
|
outputModalities?: string[] | undefined;
|
|
24
28
|
supportedParameters?: string[] | undefined;
|
|
29
|
+
supportedGenerationMethods?: string[] | undefined;
|
|
25
30
|
}, {
|
|
26
31
|
id: string;
|
|
27
32
|
name: string;
|
|
28
33
|
description?: string | undefined;
|
|
34
|
+
available?: boolean | undefined;
|
|
29
35
|
contextWindow?: number | undefined;
|
|
30
36
|
maxOutputTokens?: number | undefined;
|
|
31
37
|
inputModalities?: string[] | undefined;
|
|
32
38
|
outputModalities?: string[] | undefined;
|
|
33
39
|
supportedParameters?: string[] | undefined;
|
|
40
|
+
supportedGenerationMethods?: string[] | undefined;
|
|
34
41
|
}>;
|
|
35
42
|
export declare const providerInputSchema: z.ZodEffects<z.ZodObject<{
|
|
36
43
|
id: z.ZodString;
|
|
37
44
|
name: z.ZodString;
|
|
38
45
|
baseUrl: z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
|
|
39
|
-
protocol: z.ZodEnum<["anthropic-messages", "openai-responses", "openai-chat"]>;
|
|
46
|
+
protocol: z.ZodEnum<["anthropic-messages", "openai-responses", "openai-chat", "gemini-generate-content"]>;
|
|
40
47
|
credentialEnv: z.ZodOptional<z.ZodString>;
|
|
41
|
-
authStyle: z.ZodDefault<z.ZodEnum<["bearer", "x-api-key"]>>;
|
|
48
|
+
authStyle: z.ZodDefault<z.ZodEnum<["bearer", "x-api-key", "api-key"]>>;
|
|
49
|
+
catalogBaseUrl: z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>>;
|
|
50
|
+
catalogFormat: z.ZodOptional<z.ZodEnum<["openai", "ollama", "mistral", "together", "fireworks", "dashscope", "gemini", "none"]>>;
|
|
51
|
+
catalogAuthStyle: z.ZodOptional<z.ZodEnum<["bearer", "x-api-key", "api-key", "none"]>>;
|
|
52
|
+
catalogCredentialEnv: z.ZodOptional<z.ZodString>;
|
|
53
|
+
catalogAccountId: z.ZodOptional<z.ZodString>;
|
|
42
54
|
modelsPath: z.ZodDefault<z.ZodString>;
|
|
43
55
|
manualModels: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
44
56
|
id: z.ZodString;
|
|
45
57
|
name: z.ZodString;
|
|
46
58
|
description: z.ZodOptional<z.ZodString>;
|
|
59
|
+
available: z.ZodOptional<z.ZodBoolean>;
|
|
47
60
|
contextWindow: z.ZodOptional<z.ZodNumber>;
|
|
48
61
|
maxOutputTokens: z.ZodOptional<z.ZodNumber>;
|
|
49
62
|
inputModalities: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
50
63
|
outputModalities: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
51
64
|
supportedParameters: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
65
|
+
supportedGenerationMethods: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
52
66
|
}, "strict", z.ZodTypeAny, {
|
|
53
67
|
id: string;
|
|
54
68
|
name: string;
|
|
55
69
|
description?: string | undefined;
|
|
70
|
+
available?: boolean | undefined;
|
|
56
71
|
contextWindow?: number | undefined;
|
|
57
72
|
maxOutputTokens?: number | undefined;
|
|
58
73
|
inputModalities?: string[] | undefined;
|
|
59
74
|
outputModalities?: string[] | undefined;
|
|
60
75
|
supportedParameters?: string[] | undefined;
|
|
76
|
+
supportedGenerationMethods?: string[] | undefined;
|
|
61
77
|
}, {
|
|
62
78
|
id: string;
|
|
63
79
|
name: string;
|
|
64
80
|
description?: string | undefined;
|
|
81
|
+
available?: boolean | undefined;
|
|
65
82
|
contextWindow?: number | undefined;
|
|
66
83
|
maxOutputTokens?: number | undefined;
|
|
67
84
|
inputModalities?: string[] | undefined;
|
|
68
85
|
outputModalities?: string[] | undefined;
|
|
69
86
|
supportedParameters?: string[] | undefined;
|
|
87
|
+
supportedGenerationMethods?: string[] | undefined;
|
|
70
88
|
}>, "many">>;
|
|
71
89
|
}, "strict", z.ZodTypeAny, {
|
|
72
90
|
id: string;
|
|
73
91
|
name: string;
|
|
74
92
|
baseUrl: string;
|
|
75
|
-
protocol: "anthropic-messages" | "openai-responses" | "openai-chat";
|
|
76
|
-
authStyle: "bearer" | "x-api-key";
|
|
93
|
+
protocol: "anthropic-messages" | "openai-responses" | "openai-chat" | "gemini-generate-content";
|
|
94
|
+
authStyle: "bearer" | "x-api-key" | "api-key";
|
|
77
95
|
modelsPath: string;
|
|
78
96
|
manualModels: {
|
|
79
97
|
id: string;
|
|
80
98
|
name: string;
|
|
81
99
|
description?: string | undefined;
|
|
100
|
+
available?: boolean | undefined;
|
|
82
101
|
contextWindow?: number | undefined;
|
|
83
102
|
maxOutputTokens?: number | undefined;
|
|
84
103
|
inputModalities?: string[] | undefined;
|
|
85
104
|
outputModalities?: string[] | undefined;
|
|
86
105
|
supportedParameters?: string[] | undefined;
|
|
106
|
+
supportedGenerationMethods?: string[] | undefined;
|
|
87
107
|
}[];
|
|
88
108
|
credentialEnv?: string | undefined;
|
|
109
|
+
catalogBaseUrl?: string | undefined;
|
|
110
|
+
catalogFormat?: "openai" | "ollama" | "mistral" | "together" | "fireworks" | "dashscope" | "gemini" | "none" | undefined;
|
|
111
|
+
catalogAuthStyle?: "bearer" | "x-api-key" | "api-key" | "none" | undefined;
|
|
112
|
+
catalogCredentialEnv?: string | undefined;
|
|
113
|
+
catalogAccountId?: string | undefined;
|
|
89
114
|
}, {
|
|
90
115
|
id: string;
|
|
91
116
|
name: string;
|
|
92
117
|
baseUrl: string;
|
|
93
|
-
protocol: "anthropic-messages" | "openai-responses" | "openai-chat";
|
|
118
|
+
protocol: "anthropic-messages" | "openai-responses" | "openai-chat" | "gemini-generate-content";
|
|
94
119
|
credentialEnv?: string | undefined;
|
|
95
|
-
authStyle?: "bearer" | "x-api-key" | undefined;
|
|
120
|
+
authStyle?: "bearer" | "x-api-key" | "api-key" | undefined;
|
|
121
|
+
catalogBaseUrl?: string | undefined;
|
|
122
|
+
catalogFormat?: "openai" | "ollama" | "mistral" | "together" | "fireworks" | "dashscope" | "gemini" | "none" | undefined;
|
|
123
|
+
catalogAuthStyle?: "bearer" | "x-api-key" | "api-key" | "none" | undefined;
|
|
124
|
+
catalogCredentialEnv?: string | undefined;
|
|
125
|
+
catalogAccountId?: string | undefined;
|
|
96
126
|
modelsPath?: string | undefined;
|
|
97
127
|
manualModels?: {
|
|
98
128
|
id: string;
|
|
99
129
|
name: string;
|
|
100
130
|
description?: string | undefined;
|
|
131
|
+
available?: boolean | undefined;
|
|
101
132
|
contextWindow?: number | undefined;
|
|
102
133
|
maxOutputTokens?: number | undefined;
|
|
103
134
|
inputModalities?: string[] | undefined;
|
|
104
135
|
outputModalities?: string[] | undefined;
|
|
105
136
|
supportedParameters?: string[] | undefined;
|
|
137
|
+
supportedGenerationMethods?: string[] | undefined;
|
|
106
138
|
}[] | undefined;
|
|
107
139
|
}>, {
|
|
108
140
|
id: string;
|
|
109
141
|
name: string;
|
|
110
142
|
baseUrl: string;
|
|
111
|
-
protocol: "anthropic-messages" | "openai-responses" | "openai-chat";
|
|
112
|
-
authStyle: "bearer" | "x-api-key";
|
|
143
|
+
protocol: "anthropic-messages" | "openai-responses" | "openai-chat" | "gemini-generate-content";
|
|
144
|
+
authStyle: "bearer" | "x-api-key" | "api-key";
|
|
113
145
|
modelsPath: string;
|
|
114
146
|
manualModels: {
|
|
115
147
|
id: string;
|
|
116
148
|
name: string;
|
|
117
149
|
description?: string | undefined;
|
|
150
|
+
available?: boolean | undefined;
|
|
118
151
|
contextWindow?: number | undefined;
|
|
119
152
|
maxOutputTokens?: number | undefined;
|
|
120
153
|
inputModalities?: string[] | undefined;
|
|
121
154
|
outputModalities?: string[] | undefined;
|
|
122
155
|
supportedParameters?: string[] | undefined;
|
|
156
|
+
supportedGenerationMethods?: string[] | undefined;
|
|
123
157
|
}[];
|
|
124
158
|
credentialEnv?: string | undefined;
|
|
159
|
+
catalogBaseUrl?: string | undefined;
|
|
160
|
+
catalogFormat?: "openai" | "ollama" | "mistral" | "together" | "fireworks" | "dashscope" | "gemini" | "none" | undefined;
|
|
161
|
+
catalogAuthStyle?: "bearer" | "x-api-key" | "api-key" | "none" | undefined;
|
|
162
|
+
catalogCredentialEnv?: string | undefined;
|
|
163
|
+
catalogAccountId?: string | undefined;
|
|
125
164
|
}, {
|
|
126
165
|
id: string;
|
|
127
166
|
name: string;
|
|
128
167
|
baseUrl: string;
|
|
129
|
-
protocol: "anthropic-messages" | "openai-responses" | "openai-chat";
|
|
168
|
+
protocol: "anthropic-messages" | "openai-responses" | "openai-chat" | "gemini-generate-content";
|
|
130
169
|
credentialEnv?: string | undefined;
|
|
131
|
-
authStyle?: "bearer" | "x-api-key" | undefined;
|
|
170
|
+
authStyle?: "bearer" | "x-api-key" | "api-key" | undefined;
|
|
171
|
+
catalogBaseUrl?: string | undefined;
|
|
172
|
+
catalogFormat?: "openai" | "ollama" | "mistral" | "together" | "fireworks" | "dashscope" | "gemini" | "none" | undefined;
|
|
173
|
+
catalogAuthStyle?: "bearer" | "x-api-key" | "api-key" | "none" | undefined;
|
|
174
|
+
catalogCredentialEnv?: string | undefined;
|
|
175
|
+
catalogAccountId?: string | undefined;
|
|
132
176
|
modelsPath?: string | undefined;
|
|
133
177
|
manualModels?: {
|
|
134
178
|
id: string;
|
|
135
179
|
name: string;
|
|
136
180
|
description?: string | undefined;
|
|
181
|
+
available?: boolean | undefined;
|
|
137
182
|
contextWindow?: number | undefined;
|
|
138
183
|
maxOutputTokens?: number | undefined;
|
|
139
184
|
inputModalities?: string[] | undefined;
|
|
140
185
|
outputModalities?: string[] | undefined;
|
|
141
186
|
supportedParameters?: string[] | undefined;
|
|
187
|
+
supportedGenerationMethods?: string[] | undefined;
|
|
142
188
|
}[] | undefined;
|
|
143
189
|
}>;
|
|
190
|
+
export declare const providerPresetSchema: z.ZodObject<{
|
|
191
|
+
id: z.ZodString;
|
|
192
|
+
name: z.ZodString;
|
|
193
|
+
credentialEnv: z.ZodOptional<z.ZodString>;
|
|
194
|
+
credentialAliases: z.ZodArray<z.ZodString, "many">;
|
|
195
|
+
protocols: z.ZodArray<z.ZodObject<{
|
|
196
|
+
protocol: z.ZodEnum<["anthropic-messages", "openai-responses", "openai-chat", "gemini-generate-content"]>;
|
|
197
|
+
baseUrl: z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>>;
|
|
198
|
+
authStyle: z.ZodEnum<["bearer", "x-api-key", "api-key"]>;
|
|
199
|
+
catalogBaseUrl: z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>>;
|
|
200
|
+
catalogFormat: z.ZodEnum<["openai", "ollama", "mistral", "together", "fireworks", "dashscope", "gemini", "none"]>;
|
|
201
|
+
catalogAuthStyle: z.ZodOptional<z.ZodEnum<["bearer", "x-api-key", "api-key", "none"]>>;
|
|
202
|
+
modelsPath: z.ZodString;
|
|
203
|
+
notes: z.ZodArray<z.ZodString, "many">;
|
|
204
|
+
}, "strict", z.ZodTypeAny, {
|
|
205
|
+
protocol: "anthropic-messages" | "openai-responses" | "openai-chat" | "gemini-generate-content";
|
|
206
|
+
authStyle: "bearer" | "x-api-key" | "api-key";
|
|
207
|
+
catalogFormat: "openai" | "ollama" | "mistral" | "together" | "fireworks" | "dashscope" | "gemini" | "none";
|
|
208
|
+
modelsPath: string;
|
|
209
|
+
notes: string[];
|
|
210
|
+
baseUrl?: string | undefined;
|
|
211
|
+
catalogBaseUrl?: string | undefined;
|
|
212
|
+
catalogAuthStyle?: "bearer" | "x-api-key" | "api-key" | "none" | undefined;
|
|
213
|
+
}, {
|
|
214
|
+
protocol: "anthropic-messages" | "openai-responses" | "openai-chat" | "gemini-generate-content";
|
|
215
|
+
authStyle: "bearer" | "x-api-key" | "api-key";
|
|
216
|
+
catalogFormat: "openai" | "ollama" | "mistral" | "together" | "fireworks" | "dashscope" | "gemini" | "none";
|
|
217
|
+
modelsPath: string;
|
|
218
|
+
notes: string[];
|
|
219
|
+
baseUrl?: string | undefined;
|
|
220
|
+
catalogBaseUrl?: string | undefined;
|
|
221
|
+
catalogAuthStyle?: "bearer" | "x-api-key" | "api-key" | "none" | undefined;
|
|
222
|
+
}>, "many">;
|
|
223
|
+
sources: z.ZodArray<z.ZodString, "many">;
|
|
224
|
+
verification: z.ZodLiteral<"documented">;
|
|
225
|
+
}, "strict", z.ZodTypeAny, {
|
|
226
|
+
id: string;
|
|
227
|
+
name: string;
|
|
228
|
+
credentialAliases: string[];
|
|
229
|
+
protocols: {
|
|
230
|
+
protocol: "anthropic-messages" | "openai-responses" | "openai-chat" | "gemini-generate-content";
|
|
231
|
+
authStyle: "bearer" | "x-api-key" | "api-key";
|
|
232
|
+
catalogFormat: "openai" | "ollama" | "mistral" | "together" | "fireworks" | "dashscope" | "gemini" | "none";
|
|
233
|
+
modelsPath: string;
|
|
234
|
+
notes: string[];
|
|
235
|
+
baseUrl?: string | undefined;
|
|
236
|
+
catalogBaseUrl?: string | undefined;
|
|
237
|
+
catalogAuthStyle?: "bearer" | "x-api-key" | "api-key" | "none" | undefined;
|
|
238
|
+
}[];
|
|
239
|
+
sources: string[];
|
|
240
|
+
verification: "documented";
|
|
241
|
+
credentialEnv?: string | undefined;
|
|
242
|
+
}, {
|
|
243
|
+
id: string;
|
|
244
|
+
name: string;
|
|
245
|
+
credentialAliases: string[];
|
|
246
|
+
protocols: {
|
|
247
|
+
protocol: "anthropic-messages" | "openai-responses" | "openai-chat" | "gemini-generate-content";
|
|
248
|
+
authStyle: "bearer" | "x-api-key" | "api-key";
|
|
249
|
+
catalogFormat: "openai" | "ollama" | "mistral" | "together" | "fireworks" | "dashscope" | "gemini" | "none";
|
|
250
|
+
modelsPath: string;
|
|
251
|
+
notes: string[];
|
|
252
|
+
baseUrl?: string | undefined;
|
|
253
|
+
catalogBaseUrl?: string | undefined;
|
|
254
|
+
catalogAuthStyle?: "bearer" | "x-api-key" | "api-key" | "none" | undefined;
|
|
255
|
+
}[];
|
|
256
|
+
sources: string[];
|
|
257
|
+
verification: "documented";
|
|
258
|
+
credentialEnv?: string | undefined;
|
|
259
|
+
}>;
|
|
260
|
+
export type ProviderPreset = z.infer<typeof providerPresetSchema>;
|
|
144
261
|
export declare const profileInputSchema: z.ZodObject<{
|
|
145
262
|
id: z.ZodString;
|
|
146
263
|
name: z.ZodString;
|
|
147
264
|
providerId: z.ZodString;
|
|
148
|
-
harness: z.ZodEnum<["claude", "codex", "grok", "opencode2"]>;
|
|
265
|
+
harness: z.ZodEnum<["claude", "codex", "grok", "opencode", "opencode2", "pi", "omp", "dsh", "cline", "hermes", "prime-agent", "gemini", "aider", "kilo"]>;
|
|
149
266
|
model: z.ZodString;
|
|
150
267
|
}, "strict", z.ZodTypeAny, {
|
|
151
268
|
id: string;
|
|
152
269
|
name: string;
|
|
153
270
|
providerId: string;
|
|
154
|
-
harness: "claude" | "codex" | "grok" | "opencode2";
|
|
271
|
+
harness: "gemini" | "claude" | "codex" | "grok" | "opencode" | "opencode2" | "pi" | "omp" | "dsh" | "cline" | "hermes" | "prime-agent" | "aider" | "kilo";
|
|
155
272
|
model: string;
|
|
156
273
|
}, {
|
|
157
274
|
id: string;
|
|
158
275
|
name: string;
|
|
159
276
|
providerId: string;
|
|
160
|
-
harness: "claude" | "codex" | "grok" | "opencode2";
|
|
277
|
+
harness: "gemini" | "claude" | "codex" | "grok" | "opencode" | "opencode2" | "pi" | "omp" | "dsh" | "cline" | "hermes" | "prime-agent" | "aider" | "kilo";
|
|
161
278
|
model: string;
|
|
162
279
|
}>;
|
|
163
280
|
export declare const runInputSchema: z.ZodObject<{
|
|
164
281
|
profileId: z.ZodString;
|
|
165
|
-
harness: z.ZodEnum<["claude", "codex", "grok", "opencode2"]>;
|
|
282
|
+
harness: z.ZodEnum<["claude", "codex", "grok", "opencode", "opencode2", "pi", "omp", "dsh", "cline", "hermes", "prime-agent", "gemini", "aider", "kilo"]>;
|
|
166
283
|
model: z.ZodString;
|
|
167
284
|
planToken: z.ZodString;
|
|
168
285
|
}, "strict", z.ZodTypeAny, {
|
|
169
|
-
harness: "claude" | "codex" | "grok" | "opencode2";
|
|
286
|
+
harness: "gemini" | "claude" | "codex" | "grok" | "opencode" | "opencode2" | "pi" | "omp" | "dsh" | "cline" | "hermes" | "prime-agent" | "aider" | "kilo";
|
|
170
287
|
model: string;
|
|
171
288
|
profileId: string;
|
|
172
289
|
planToken: string;
|
|
173
290
|
}, {
|
|
174
|
-
harness: "claude" | "codex" | "grok" | "opencode2";
|
|
291
|
+
harness: "gemini" | "claude" | "codex" | "grok" | "opencode" | "opencode2" | "pi" | "omp" | "dsh" | "cline" | "hermes" | "prime-agent" | "aider" | "kilo";
|
|
175
292
|
model: string;
|
|
176
293
|
profileId: string;
|
|
177
294
|
planToken: string;
|
|
@@ -226,6 +343,12 @@ export declare class Fault extends Error {
|
|
|
226
343
|
code: string;
|
|
227
344
|
constructor(status: number, code: string, message: string);
|
|
228
345
|
}
|
|
346
|
+
export declare class CommandInterrupted extends Fault {
|
|
347
|
+
readonly exitCode: number;
|
|
348
|
+
constructor(exitCode: number, message: string);
|
|
349
|
+
}
|
|
229
350
|
export declare function parse<T>(schema: z.ZodType<T, any, any>, value: unknown): T;
|
|
230
351
|
export declare function compatible(harness: Profile["harness"], protocol: Provider["protocol"]): boolean;
|
|
352
|
+
export declare function validateHarnessProvider(harness: Profile["harness"], provider: Pick<Provider, "protocol" | "authStyle">): void;
|
|
231
353
|
export declare function codingEligible(model: Model): boolean;
|
|
354
|
+
export declare function harnessEligible(model: Model, harness: Profile["harness"]): boolean;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { HarnessLaunchInput, PreparedLaunch } from "./harness-types";
|
|
2
|
+
type Settings = Record<string, any>;
|
|
3
|
+
export declare function validateGeminiConfiguration(cwd: string, env?: NodeJS.ProcessEnv): Promise<{
|
|
4
|
+
home: string;
|
|
5
|
+
defaults: Settings;
|
|
6
|
+
user: Settings;
|
|
7
|
+
system: Settings;
|
|
8
|
+
contextNames: string[];
|
|
9
|
+
trustPath: string;
|
|
10
|
+
}>;
|
|
11
|
+
export declare function prepareGemini(input: HarnessLaunchInput): Promise<PreparedLaunch>;
|
|
12
|
+
export {};
|