@hasna/switcher 0.2.17 → 0.2.19
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/Dockerfile +6 -1
- package/README.md +1 -1
- package/dist/claude-desktop.js +19180 -3734
- package/dist/cli/index.js +707 -330
- package/dist/codex-state-bridge.js +4 -4
- package/dist/credentials.d.ts +36 -184
- package/dist/domain.d.ts +271 -737
- package/dist/gateway-service.d.ts +3 -1
- package/dist/index.js +19121 -3675
- package/dist/inference-gateway.d.ts +2 -0
- package/dist/mcp/index.js +19608 -4116
- package/dist/model-policy-schema.d.ts +93 -112
- package/dist/native-state.d.ts +24 -0
- package/dist/opencode2-config.d.ts +8 -12
- package/dist/presets.d.ts +2 -2
- package/dist/process-table.d.ts +7 -0
- package/dist/reasoning.d.ts +11 -2
- package/dist/sdk.js +19121 -3675
- package/dist/serve/index.js +269 -223
- package/docs/GATEWAY-SERVICE.md +66 -30
- package/hasna.contract.json +1 -1
- package/openapi.json +264 -218
- package/package.json +9 -6
|
@@ -7,19 +7,19 @@ import { once } from "events";
|
|
|
7
7
|
// src/kilo-config.ts
|
|
8
8
|
import { parse, parseTree } from "jsonc-parser";
|
|
9
9
|
import { parseDocument } from "yaml";
|
|
10
|
-
import { z } from "zod";
|
|
10
|
+
import { z } from "zod-v4";
|
|
11
11
|
var maxFileBytes = 1024 * 1024;
|
|
12
12
|
var maxTotalBytes = 8 * 1024 * 1024;
|
|
13
13
|
|
|
14
14
|
// src/domain.ts
|
|
15
|
-
import { z as z4 } from "zod";
|
|
15
|
+
import { z as z4 } from "zod-v4";
|
|
16
16
|
|
|
17
17
|
// src/reasoning.ts
|
|
18
|
-
import { z as z2 } from "zod";
|
|
18
|
+
import { z as z2 } from "zod-v4";
|
|
19
19
|
var reasoningEffortSchema = z2.enum(["none", "minimal", "low", "medium", "high", "xhigh", "max", "ultra"]);
|
|
20
20
|
|
|
21
21
|
// src/model-policy-schema.ts
|
|
22
|
-
import { z as z3 } from "zod";
|
|
22
|
+
import { z as z3 } from "zod-v4";
|
|
23
23
|
var policyModelIdSchema = z3.string().min(1).max(300).regex(/^[^\u0000-\u001f\u007f]+$/);
|
|
24
24
|
var modelPolicyRoleSchema = z3.enum(["subagent", "fast", "planning", "review", "summary", "compaction", "weak", "editor"]);
|
|
25
25
|
var boundedModelList = z3.array(policyModelIdSchema).max(500);
|
package/dist/credentials.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
1
|
+
import { z } from "zod-v4";
|
|
2
2
|
import { type CredentialChainOptions } from "@hasna/contracts/client";
|
|
3
3
|
import { CommandInterrupted, type ProviderInput } from "./domain";
|
|
4
4
|
export declare const vaultKeySchema: z.ZodString;
|
|
@@ -6,198 +6,50 @@ declare const keychain: z.ZodObject<{
|
|
|
6
6
|
kind: z.ZodLiteral<"keychain">;
|
|
7
7
|
service: z.ZodString;
|
|
8
8
|
account: z.ZodString;
|
|
9
|
-
},
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
9
|
+
}, z.core.$strict>;
|
|
10
|
+
declare const credentialTier: z.ZodEnum<{
|
|
11
|
+
override: "override";
|
|
12
|
+
profile: "profile";
|
|
13
|
+
argument: "argument";
|
|
14
|
+
pointer: "pointer";
|
|
15
|
+
keychain: "keychain";
|
|
16
|
+
disk: "disk";
|
|
17
|
+
env: "env";
|
|
17
18
|
}>;
|
|
18
|
-
declare const
|
|
19
|
-
export declare const credentialBindingSchema: z.ZodEffects<z.ZodObject<{
|
|
19
|
+
export declare const credentialBindingSchema: z.ZodObject<{
|
|
20
20
|
schema: z.ZodLiteral<1>;
|
|
21
21
|
credentialEnv: z.ZodString;
|
|
22
|
-
origins: z.ZodArray<z.
|
|
22
|
+
origins: z.ZodArray<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
|
|
23
23
|
requireProviderAuthentication: z.ZodOptional<z.ZodLiteral<true>>;
|
|
24
|
-
source: z.ZodDiscriminatedUnion<
|
|
24
|
+
source: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
25
25
|
kind: z.ZodLiteral<"keychain">;
|
|
26
26
|
service: z.ZodString;
|
|
27
27
|
account: z.ZodString;
|
|
28
|
-
},
|
|
29
|
-
kind: "keychain";
|
|
30
|
-
service: string;
|
|
31
|
-
account: string;
|
|
32
|
-
}, {
|
|
33
|
-
kind: "keychain";
|
|
34
|
-
service: string;
|
|
35
|
-
account: string;
|
|
36
|
-
}>, z.ZodObject<{
|
|
28
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
37
29
|
kind: z.ZodLiteral<"vault">;
|
|
38
30
|
key: z.ZodString;
|
|
39
|
-
url: z.ZodOptional<z.
|
|
40
|
-
executable: z.
|
|
41
|
-
operator: z.ZodDiscriminatedUnion<
|
|
31
|
+
url: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
|
|
32
|
+
executable: z.ZodString;
|
|
33
|
+
operator: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
42
34
|
kind: z.ZodLiteral<"contracts">;
|
|
43
35
|
expectedSource: z.ZodOptional<z.ZodString>;
|
|
44
|
-
expectedTier: z.ZodOptional<z.ZodEnum<
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
}>, z.ZodObject<{
|
|
36
|
+
expectedTier: z.ZodOptional<z.ZodEnum<{
|
|
37
|
+
override: "override";
|
|
38
|
+
profile: "profile";
|
|
39
|
+
argument: "argument";
|
|
40
|
+
pointer: "pointer";
|
|
41
|
+
keychain: "keychain";
|
|
42
|
+
disk: "disk";
|
|
43
|
+
env: "env";
|
|
44
|
+
}>>;
|
|
45
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
54
46
|
kind: z.ZodLiteral<"env">;
|
|
55
|
-
},
|
|
56
|
-
kind: "env";
|
|
57
|
-
}, {
|
|
58
|
-
kind: "env";
|
|
59
|
-
}>, z.ZodObject<{
|
|
47
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
60
48
|
kind: z.ZodLiteral<"keychain">;
|
|
61
|
-
account: z.
|
|
62
|
-
},
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
}, {
|
|
66
|
-
kind: "keychain";
|
|
67
|
-
account: string;
|
|
68
|
-
}>]>;
|
|
69
|
-
}, "strict", z.ZodTypeAny, {
|
|
70
|
-
key: string;
|
|
71
|
-
executable: string;
|
|
72
|
-
kind: "vault";
|
|
73
|
-
operator: {
|
|
74
|
-
kind: "contracts";
|
|
75
|
-
expectedSource?: string | undefined;
|
|
76
|
-
expectedTier?: "profile" | "argument" | "override" | "pointer" | "keychain" | "disk" | "env" | undefined;
|
|
77
|
-
} | {
|
|
78
|
-
kind: "env";
|
|
79
|
-
} | {
|
|
80
|
-
kind: "keychain";
|
|
81
|
-
account: string;
|
|
82
|
-
};
|
|
83
|
-
url?: string | undefined;
|
|
84
|
-
}, {
|
|
85
|
-
key: string;
|
|
86
|
-
executable: string;
|
|
87
|
-
kind: "vault";
|
|
88
|
-
operator: {
|
|
89
|
-
kind: "contracts";
|
|
90
|
-
expectedSource?: string | undefined;
|
|
91
|
-
expectedTier?: "profile" | "argument" | "override" | "pointer" | "keychain" | "disk" | "env" | undefined;
|
|
92
|
-
} | {
|
|
93
|
-
kind: "env";
|
|
94
|
-
} | {
|
|
95
|
-
kind: "keychain";
|
|
96
|
-
account: string;
|
|
97
|
-
};
|
|
98
|
-
url?: string | undefined;
|
|
99
|
-
}>]>;
|
|
100
|
-
}, "strict", z.ZodTypeAny, {
|
|
101
|
-
credentialEnv: string;
|
|
102
|
-
source: {
|
|
103
|
-
kind: "keychain";
|
|
104
|
-
service: string;
|
|
105
|
-
account: string;
|
|
106
|
-
} | {
|
|
107
|
-
key: string;
|
|
108
|
-
executable: string;
|
|
109
|
-
kind: "vault";
|
|
110
|
-
operator: {
|
|
111
|
-
kind: "contracts";
|
|
112
|
-
expectedSource?: string | undefined;
|
|
113
|
-
expectedTier?: "profile" | "argument" | "override" | "pointer" | "keychain" | "disk" | "env" | undefined;
|
|
114
|
-
} | {
|
|
115
|
-
kind: "env";
|
|
116
|
-
} | {
|
|
117
|
-
kind: "keychain";
|
|
118
|
-
account: string;
|
|
119
|
-
};
|
|
120
|
-
url?: string | undefined;
|
|
121
|
-
};
|
|
122
|
-
schema: 1;
|
|
123
|
-
origins: string[];
|
|
124
|
-
requireProviderAuthentication?: true | undefined;
|
|
125
|
-
}, {
|
|
126
|
-
credentialEnv: string;
|
|
127
|
-
source: {
|
|
128
|
-
kind: "keychain";
|
|
129
|
-
service: string;
|
|
130
|
-
account: string;
|
|
131
|
-
} | {
|
|
132
|
-
key: string;
|
|
133
|
-
executable: string;
|
|
134
|
-
kind: "vault";
|
|
135
|
-
operator: {
|
|
136
|
-
kind: "contracts";
|
|
137
|
-
expectedSource?: string | undefined;
|
|
138
|
-
expectedTier?: "profile" | "argument" | "override" | "pointer" | "keychain" | "disk" | "env" | undefined;
|
|
139
|
-
} | {
|
|
140
|
-
kind: "env";
|
|
141
|
-
} | {
|
|
142
|
-
kind: "keychain";
|
|
143
|
-
account: string;
|
|
144
|
-
};
|
|
145
|
-
url?: string | undefined;
|
|
146
|
-
};
|
|
147
|
-
schema: 1;
|
|
148
|
-
origins: string[];
|
|
149
|
-
requireProviderAuthentication?: true | undefined;
|
|
150
|
-
}>, {
|
|
151
|
-
credentialEnv: string;
|
|
152
|
-
source: {
|
|
153
|
-
kind: "keychain";
|
|
154
|
-
service: string;
|
|
155
|
-
account: string;
|
|
156
|
-
} | {
|
|
157
|
-
key: string;
|
|
158
|
-
executable: string;
|
|
159
|
-
kind: "vault";
|
|
160
|
-
operator: {
|
|
161
|
-
kind: "contracts";
|
|
162
|
-
expectedSource?: string | undefined;
|
|
163
|
-
expectedTier?: "profile" | "argument" | "override" | "pointer" | "keychain" | "disk" | "env" | undefined;
|
|
164
|
-
} | {
|
|
165
|
-
kind: "env";
|
|
166
|
-
} | {
|
|
167
|
-
kind: "keychain";
|
|
168
|
-
account: string;
|
|
169
|
-
};
|
|
170
|
-
url?: string | undefined;
|
|
171
|
-
};
|
|
172
|
-
schema: 1;
|
|
173
|
-
origins: string[];
|
|
174
|
-
requireProviderAuthentication?: true | undefined;
|
|
175
|
-
}, {
|
|
176
|
-
credentialEnv: string;
|
|
177
|
-
source: {
|
|
178
|
-
kind: "keychain";
|
|
179
|
-
service: string;
|
|
180
|
-
account: string;
|
|
181
|
-
} | {
|
|
182
|
-
key: string;
|
|
183
|
-
executable: string;
|
|
184
|
-
kind: "vault";
|
|
185
|
-
operator: {
|
|
186
|
-
kind: "contracts";
|
|
187
|
-
expectedSource?: string | undefined;
|
|
188
|
-
expectedTier?: "profile" | "argument" | "override" | "pointer" | "keychain" | "disk" | "env" | undefined;
|
|
189
|
-
} | {
|
|
190
|
-
kind: "env";
|
|
191
|
-
} | {
|
|
192
|
-
kind: "keychain";
|
|
193
|
-
account: string;
|
|
194
|
-
};
|
|
195
|
-
url?: string | undefined;
|
|
196
|
-
};
|
|
197
|
-
schema: 1;
|
|
198
|
-
origins: string[];
|
|
199
|
-
requireProviderAuthentication?: true | undefined;
|
|
200
|
-
}>;
|
|
49
|
+
account: z.ZodString;
|
|
50
|
+
}, z.core.$strict>], "kind">;
|
|
51
|
+
}, z.core.$strict>], "kind">;
|
|
52
|
+
}, z.core.$strict>;
|
|
201
53
|
export type CredentialBinding = z.infer<typeof credentialBindingSchema>;
|
|
202
54
|
export declare class CredentialBindings {
|
|
203
55
|
readonly env: NodeJS.ProcessEnv;
|
|
@@ -208,19 +60,21 @@ export declare class CredentialBindings {
|
|
|
208
60
|
get(name: string): Promise<CredentialBinding | undefined>;
|
|
209
61
|
list(): Promise<CredentialBinding[]>;
|
|
210
62
|
bind(input: CredentialBinding): Promise<{
|
|
63
|
+
schema: 1;
|
|
211
64
|
credentialEnv: string;
|
|
65
|
+
origins: string[];
|
|
212
66
|
source: {
|
|
213
67
|
kind: "keychain";
|
|
214
68
|
service: string;
|
|
215
69
|
account: string;
|
|
216
70
|
} | {
|
|
71
|
+
kind: "vault";
|
|
217
72
|
key: string;
|
|
218
73
|
executable: string;
|
|
219
|
-
kind: "vault";
|
|
220
74
|
operator: {
|
|
221
75
|
kind: "contracts";
|
|
222
76
|
expectedSource?: string | undefined;
|
|
223
|
-
expectedTier?: "
|
|
77
|
+
expectedTier?: "override" | "profile" | "argument" | "pointer" | "keychain" | "disk" | "env" | undefined;
|
|
224
78
|
} | {
|
|
225
79
|
kind: "env";
|
|
226
80
|
} | {
|
|
@@ -229,8 +83,6 @@ export declare class CredentialBindings {
|
|
|
229
83
|
};
|
|
230
84
|
url?: string | undefined;
|
|
231
85
|
};
|
|
232
|
-
schema: 1;
|
|
233
|
-
origins: string[];
|
|
234
86
|
requireProviderAuthentication?: true | undefined;
|
|
235
87
|
}>;
|
|
236
88
|
remove(name: string): Promise<{
|