@imricci/zaker 0.1.2 → 0.1.3
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/commands/app-server.d.ts +67 -0
- package/dist/commands/app-server.js +601 -0
- package/dist/commands/app-server.js.map +1 -0
- package/dist/commands/audit.js +2 -1
- package/dist/commands/audit.js.map +1 -1
- package/dist/commands/build.d.ts +3 -0
- package/dist/commands/build.js +22 -0
- package/dist/commands/build.js.map +1 -0
- package/dist/commands/confirm.d.ts +0 -2
- package/dist/commands/confirm.js +2 -16
- package/dist/commands/confirm.js.map +1 -1
- package/dist/commands/dialog-handlers/auth.d.ts +3 -0
- package/dist/commands/dialog-handlers/auth.js +174 -0
- package/dist/commands/dialog-handlers/auth.js.map +1 -0
- package/dist/commands/dialog-handlers/basic.d.ts +2 -2
- package/dist/commands/dialog-handlers/basic.js +8 -9
- package/dist/commands/dialog-handlers/basic.js.map +1 -1
- package/dist/commands/dialog-handlers/bootstrap.js +2 -2
- package/dist/commands/dialog-handlers/bootstrap.js.map +1 -1
- package/dist/commands/dialog-handlers/index.d.ts +1 -1
- package/dist/commands/dialog-handlers/message.js +94 -3
- package/dist/commands/dialog-handlers/message.js.map +1 -1
- package/dist/commands/dialog-handlers/model.d.ts +2 -0
- package/dist/commands/dialog-handlers/model.js +168 -0
- package/dist/commands/dialog-handlers/model.js.map +1 -0
- package/dist/commands/dialog-handlers/new.d.ts +2 -0
- package/dist/commands/dialog-handlers/new.js +53 -0
- package/dist/commands/dialog-handlers/new.js.map +1 -0
- package/dist/commands/dialog-handlers/router.js +39 -3
- package/dist/commands/dialog-handlers/router.js.map +1 -1
- package/dist/commands/dialog-handlers/run.js +44 -8
- package/dist/commands/dialog-handlers/run.js.map +1 -1
- package/dist/commands/dialog-handlers/types.d.ts +16 -17
- package/dist/commands/dialog.d.ts +92 -0
- package/dist/commands/dialog.js +1542 -422
- package/dist/commands/dialog.js.map +1 -1
- package/dist/commands/init.d.ts +3 -1
- package/dist/commands/init.js +6 -4
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/plan.js +10 -6
- package/dist/commands/plan.js.map +1 -1
- package/dist/commands/run.js +8 -10
- package/dist/commands/run.js.map +1 -1
- package/dist/commands/status.js +6 -12
- package/dist/commands/status.js.map +1 -1
- package/dist/commands/tui-launcher.d.ts +1 -0
- package/dist/commands/tui-launcher.js +8 -0
- package/dist/commands/tui-launcher.js.map +1 -0
- package/dist/core/alignment-reply.d.ts +1 -0
- package/dist/core/alignment-reply.js +44 -0
- package/dist/core/alignment-reply.js.map +1 -0
- package/dist/core/checkpoint.js +3 -1
- package/dist/core/checkpoint.js.map +1 -1
- package/dist/core/planner.d.ts +16 -16
- package/dist/core/planner.js +3 -1
- package/dist/core/planner.js.map +1 -1
- package/dist/core/planning-prep.d.ts +12 -0
- package/dist/core/planning-prep.js +26 -0
- package/dist/core/planning-prep.js.map +1 -0
- package/dist/core/preflight.js +1 -2
- package/dist/core/preflight.js.map +1 -1
- package/dist/core/provider-onboarding.js +6 -11
- package/dist/core/provider-onboarding.js.map +1 -1
- package/dist/core/readonly-checkpoint.d.ts +2 -0
- package/dist/core/readonly-checkpoint.js +35 -0
- package/dist/core/readonly-checkpoint.js.map +1 -0
- package/dist/core/run-loop.js +3 -1
- package/dist/core/run-loop.js.map +1 -1
- package/dist/core/types.d.ts +20 -1
- package/dist/index.js +6 -5
- package/dist/index.js.map +1 -1
- package/dist/infra/artifact-schema.d.ts +25 -0
- package/dist/infra/artifact-schema.js +353 -0
- package/dist/infra/artifact-schema.js.map +1 -0
- package/dist/infra/config.d.ts +14 -1
- package/dist/infra/config.js +542 -22
- package/dist/infra/config.js.map +1 -1
- package/dist/infra/dependency-report.d.ts +5 -0
- package/dist/infra/dependency-report.js +22 -0
- package/dist/infra/dependency-report.js.map +1 -0
- package/dist/infra/dialog-session.d.ts +29 -0
- package/dist/infra/dialog-session.js +244 -0
- package/dist/infra/dialog-session.js.map +1 -0
- package/dist/infra/intent.d.ts +0 -1
- package/dist/infra/intent.js +62 -25
- package/dist/infra/intent.js.map +1 -1
- package/dist/infra/model-accounts.d.ts +22 -0
- package/dist/infra/model-accounts.js +172 -0
- package/dist/infra/model-accounts.js.map +1 -0
- package/dist/infra/model-catalog.d.ts +4 -1
- package/dist/infra/model-catalog.js +102 -27
- package/dist/infra/model-catalog.js.map +1 -1
- package/dist/infra/openai-codex-oauth.d.ts +18 -0
- package/dist/infra/openai-codex-oauth.js +267 -0
- package/dist/infra/openai-codex-oauth.js.map +1 -0
- package/dist/infra/provider-registry.d.ts +36 -0
- package/dist/infra/provider-registry.js +403 -0
- package/dist/infra/provider-registry.js.map +1 -0
- package/dist/infra/session-status.d.ts +6 -0
- package/dist/infra/session-status.js +34 -0
- package/dist/infra/session-status.js.map +1 -0
- package/dist/infra/tui-utils.d.ts +6 -0
- package/dist/infra/tui-utils.js +163 -0
- package/dist/infra/tui-utils.js.map +1 -0
- package/dist/infra/tui-view.d.ts +44 -0
- package/dist/infra/tui-view.js +314 -0
- package/dist/infra/tui-view.js.map +1 -0
- package/package.json +4 -1
|
@@ -0,0 +1,353 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.DEPENDENCY_REPORT_SCHEMA_VERSION = void 0;
|
|
7
|
+
exports.assertArtifactSchema = assertArtifactSchema;
|
|
8
|
+
exports.assertSOPArtifactSchema = assertSOPArtifactSchema;
|
|
9
|
+
exports.assertCheckpointArtifactSchema = assertCheckpointArtifactSchema;
|
|
10
|
+
exports.assertDependencyReportArtifactSchema = assertDependencyReportArtifactSchema;
|
|
11
|
+
const ajv_1 = __importDefault(require("ajv"));
|
|
12
|
+
const types_1 = require("../core/types");
|
|
13
|
+
exports.DEPENDENCY_REPORT_SCHEMA_VERSION = "zaker.dependency-report.v1";
|
|
14
|
+
const ajv = new ajv_1.default({
|
|
15
|
+
allErrors: true,
|
|
16
|
+
strict: false,
|
|
17
|
+
allowUnionTypes: true
|
|
18
|
+
});
|
|
19
|
+
const sopArtifactSchema = {
|
|
20
|
+
$id: "zaker.sop.schema",
|
|
21
|
+
type: "object",
|
|
22
|
+
additionalProperties: false,
|
|
23
|
+
required: [
|
|
24
|
+
"schema_version",
|
|
25
|
+
"sop_id",
|
|
26
|
+
"goal",
|
|
27
|
+
"scope",
|
|
28
|
+
"verification",
|
|
29
|
+
"limits",
|
|
30
|
+
"skills",
|
|
31
|
+
"tasks",
|
|
32
|
+
"patches"
|
|
33
|
+
],
|
|
34
|
+
properties: {
|
|
35
|
+
schema_version: { const: types_1.SOP_SCHEMA_VERSION },
|
|
36
|
+
sop_id: { type: "string", minLength: 1 },
|
|
37
|
+
goal: { type: "string", minLength: 1 },
|
|
38
|
+
scope: {
|
|
39
|
+
type: "object",
|
|
40
|
+
additionalProperties: false,
|
|
41
|
+
required: ["allowed_paths", "forbidden_paths"],
|
|
42
|
+
properties: {
|
|
43
|
+
allowed_paths: {
|
|
44
|
+
type: "array",
|
|
45
|
+
minItems: 1,
|
|
46
|
+
items: { type: "string", minLength: 1 }
|
|
47
|
+
},
|
|
48
|
+
forbidden_paths: {
|
|
49
|
+
type: "array",
|
|
50
|
+
items: { type: "string", minLength: 1 }
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
verification: {
|
|
55
|
+
type: "object",
|
|
56
|
+
additionalProperties: false,
|
|
57
|
+
required: ["commands"],
|
|
58
|
+
properties: {
|
|
59
|
+
commands: {
|
|
60
|
+
type: "array",
|
|
61
|
+
minItems: 1,
|
|
62
|
+
items: {
|
|
63
|
+
type: "object",
|
|
64
|
+
additionalProperties: false,
|
|
65
|
+
required: ["id", "command", "timeout_sec", "required"],
|
|
66
|
+
properties: {
|
|
67
|
+
id: { type: "string", minLength: 1 },
|
|
68
|
+
command: { type: "string", minLength: 1 },
|
|
69
|
+
timeout_sec: { type: "integer", minimum: 1 },
|
|
70
|
+
required: { type: "boolean" }
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
},
|
|
76
|
+
limits: {
|
|
77
|
+
type: "object",
|
|
78
|
+
additionalProperties: false,
|
|
79
|
+
required: ["max_runtime_minutes", "max_challenges"],
|
|
80
|
+
properties: {
|
|
81
|
+
max_runtime_minutes: { type: "integer", minimum: 1 },
|
|
82
|
+
max_challenges: { type: "integer", minimum: 0, maximum: 2 }
|
|
83
|
+
}
|
|
84
|
+
},
|
|
85
|
+
skills: {
|
|
86
|
+
type: "array",
|
|
87
|
+
items: {
|
|
88
|
+
type: "object",
|
|
89
|
+
additionalProperties: false,
|
|
90
|
+
required: ["type"],
|
|
91
|
+
properties: {
|
|
92
|
+
type: { type: "string", minLength: 1 }
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
},
|
|
96
|
+
tasks: {
|
|
97
|
+
type: "array",
|
|
98
|
+
items: {
|
|
99
|
+
type: "object",
|
|
100
|
+
additionalProperties: false,
|
|
101
|
+
required: ["id", "title", "acceptance"],
|
|
102
|
+
properties: {
|
|
103
|
+
id: { type: "string", minLength: 1 },
|
|
104
|
+
title: { type: "string", minLength: 1 },
|
|
105
|
+
acceptance: {
|
|
106
|
+
type: "array",
|
|
107
|
+
items: { type: "string", minLength: 1 }
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
},
|
|
112
|
+
patches: {
|
|
113
|
+
type: "array",
|
|
114
|
+
items: { type: "string" }
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
};
|
|
118
|
+
const checkpointArtifactSchema = {
|
|
119
|
+
$id: "zaker.checkpoint.schema",
|
|
120
|
+
type: "object",
|
|
121
|
+
additionalProperties: false,
|
|
122
|
+
required: [
|
|
123
|
+
"schema_version",
|
|
124
|
+
"checkpoint_id",
|
|
125
|
+
"base_commit",
|
|
126
|
+
"head_commit",
|
|
127
|
+
"diffstat",
|
|
128
|
+
"diff_excerpt",
|
|
129
|
+
"changed_files",
|
|
130
|
+
"verification",
|
|
131
|
+
"memory_summary",
|
|
132
|
+
"self_critique",
|
|
133
|
+
"c3_fi_report",
|
|
134
|
+
"challenge_history",
|
|
135
|
+
"budget"
|
|
136
|
+
],
|
|
137
|
+
properties: {
|
|
138
|
+
schema_version: { const: types_1.CHECKPOINT_SCHEMA_VERSION },
|
|
139
|
+
checkpoint_id: { type: "string", minLength: 1 },
|
|
140
|
+
sop_id: { type: "string" },
|
|
141
|
+
intent_id: { type: "string", minLength: 1 },
|
|
142
|
+
intent_sha256: { type: "string", minLength: 1 },
|
|
143
|
+
intent_confirmed_at: { type: "string", minLength: 1 },
|
|
144
|
+
base_commit: { type: "string", minLength: 1 },
|
|
145
|
+
head_commit: { type: "string", minLength: 1 },
|
|
146
|
+
diffstat: { type: "string" },
|
|
147
|
+
diff_excerpt: { type: "string" },
|
|
148
|
+
changed_files: {
|
|
149
|
+
type: "array",
|
|
150
|
+
items: { type: "string", minLength: 1 }
|
|
151
|
+
},
|
|
152
|
+
verification: {
|
|
153
|
+
type: "object",
|
|
154
|
+
additionalProperties: false,
|
|
155
|
+
required: ["commands", "all_passed"],
|
|
156
|
+
properties: {
|
|
157
|
+
commands: {
|
|
158
|
+
type: "array",
|
|
159
|
+
items: {
|
|
160
|
+
type: "object",
|
|
161
|
+
additionalProperties: false,
|
|
162
|
+
required: [
|
|
163
|
+
"id",
|
|
164
|
+
"command",
|
|
165
|
+
"exit_code",
|
|
166
|
+
"stdout_excerpt",
|
|
167
|
+
"stderr_excerpt",
|
|
168
|
+
"stdout_sha256",
|
|
169
|
+
"success"
|
|
170
|
+
],
|
|
171
|
+
properties: {
|
|
172
|
+
id: { type: "string", minLength: 1 },
|
|
173
|
+
command: { type: "string", minLength: 1 },
|
|
174
|
+
exit_code: { type: "integer" },
|
|
175
|
+
stdout_excerpt: { type: "string" },
|
|
176
|
+
stderr_excerpt: { type: "string" },
|
|
177
|
+
stdout_sha256: { type: "string", minLength: 1 },
|
|
178
|
+
success: { type: "boolean" }
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
},
|
|
182
|
+
all_passed: { type: "boolean" }
|
|
183
|
+
}
|
|
184
|
+
},
|
|
185
|
+
memory_summary: {
|
|
186
|
+
type: "object",
|
|
187
|
+
additionalProperties: false,
|
|
188
|
+
required: [
|
|
189
|
+
"status",
|
|
190
|
+
"source",
|
|
191
|
+
"hydrated_at",
|
|
192
|
+
"facts_count",
|
|
193
|
+
"decisions_count",
|
|
194
|
+
"constraints_count",
|
|
195
|
+
"execution_failure_count",
|
|
196
|
+
"used_ids"
|
|
197
|
+
],
|
|
198
|
+
properties: {
|
|
199
|
+
status: { enum: ["HYDRATED", "DEGRADED"] },
|
|
200
|
+
source: { type: "string", minLength: 1 },
|
|
201
|
+
hydrated_at: { type: "string", minLength: 1 },
|
|
202
|
+
facts_count: { type: "integer", minimum: 0 },
|
|
203
|
+
decisions_count: { type: "integer", minimum: 0 },
|
|
204
|
+
constraints_count: { type: "integer", minimum: 0 },
|
|
205
|
+
execution_failure_count: { type: "integer", minimum: 0 },
|
|
206
|
+
used_ids: {
|
|
207
|
+
type: "array",
|
|
208
|
+
items: { type: "string", minLength: 1 }
|
|
209
|
+
},
|
|
210
|
+
warning: { type: "string" }
|
|
211
|
+
}
|
|
212
|
+
},
|
|
213
|
+
runner_attestation: {
|
|
214
|
+
type: "object",
|
|
215
|
+
additionalProperties: false,
|
|
216
|
+
required: [
|
|
217
|
+
"runner_id",
|
|
218
|
+
"runner_version",
|
|
219
|
+
"generated_at",
|
|
220
|
+
"attestation_sha256",
|
|
221
|
+
"metadata"
|
|
222
|
+
],
|
|
223
|
+
properties: {
|
|
224
|
+
runner_id: { type: "string", minLength: 1 },
|
|
225
|
+
runner_version: { type: "string", minLength: 1 },
|
|
226
|
+
generated_at: { type: "string", minLength: 1 },
|
|
227
|
+
attestation_sha256: { type: "string", minLength: 1 },
|
|
228
|
+
metadata: { type: "object" }
|
|
229
|
+
}
|
|
230
|
+
},
|
|
231
|
+
self_critique: { type: "array" },
|
|
232
|
+
c3_fi_report: {
|
|
233
|
+
type: "object",
|
|
234
|
+
additionalProperties: false,
|
|
235
|
+
required: [
|
|
236
|
+
"status",
|
|
237
|
+
"required",
|
|
238
|
+
"trigger_reason",
|
|
239
|
+
"injection_verification",
|
|
240
|
+
"post_rollback_verification",
|
|
241
|
+
"rollback",
|
|
242
|
+
"message",
|
|
243
|
+
"recorded_at"
|
|
244
|
+
],
|
|
245
|
+
properties: {
|
|
246
|
+
status: { enum: ["SKIPPED", "PASSED", "FAILED"] },
|
|
247
|
+
required: { type: "boolean" },
|
|
248
|
+
trigger_reason: { type: "string", minLength: 1 },
|
|
249
|
+
risk_level: { enum: ["HIGH", "CRITICAL"] },
|
|
250
|
+
target_file: { type: "string" },
|
|
251
|
+
target_function: { type: "string" },
|
|
252
|
+
injected_line: { type: "integer", minimum: 1 },
|
|
253
|
+
injection_verification: { type: "object" },
|
|
254
|
+
post_rollback_verification: { type: "object" },
|
|
255
|
+
rollback: { type: "object" },
|
|
256
|
+
message: { type: "string", minLength: 1 },
|
|
257
|
+
recorded_at: { type: "string", minLength: 1 }
|
|
258
|
+
}
|
|
259
|
+
},
|
|
260
|
+
challenge_history: { type: "array" },
|
|
261
|
+
budget: {
|
|
262
|
+
type: "object",
|
|
263
|
+
additionalProperties: false,
|
|
264
|
+
required: ["cloud_plan_calls", "cloud_audit_calls", "challenge_used"],
|
|
265
|
+
properties: {
|
|
266
|
+
cloud_plan_calls: { type: "integer", minimum: 0 },
|
|
267
|
+
cloud_audit_calls: { type: "integer", minimum: 0 },
|
|
268
|
+
challenge_used: { type: "integer", minimum: 0 }
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
};
|
|
273
|
+
const dependencyReportSchema = {
|
|
274
|
+
$id: "zaker.dependency-report.schema",
|
|
275
|
+
type: "object",
|
|
276
|
+
additionalProperties: false,
|
|
277
|
+
required: [
|
|
278
|
+
"schema_version",
|
|
279
|
+
"generated_at",
|
|
280
|
+
"source",
|
|
281
|
+
"files",
|
|
282
|
+
"dependency_changes",
|
|
283
|
+
"summary"
|
|
284
|
+
],
|
|
285
|
+
properties: {
|
|
286
|
+
schema_version: { const: exports.DEPENDENCY_REPORT_SCHEMA_VERSION },
|
|
287
|
+
generated_at: { type: "string", minLength: 1 },
|
|
288
|
+
source: { type: "string", minLength: 1 },
|
|
289
|
+
files: {
|
|
290
|
+
type: "array",
|
|
291
|
+
items: { type: "string", minLength: 1 }
|
|
292
|
+
},
|
|
293
|
+
dependency_changes: {
|
|
294
|
+
type: "array",
|
|
295
|
+
items: {
|
|
296
|
+
type: "object",
|
|
297
|
+
additionalProperties: false,
|
|
298
|
+
required: ["name", "from", "to", "impact"],
|
|
299
|
+
properties: {
|
|
300
|
+
name: { type: "string", minLength: 1 },
|
|
301
|
+
from: { type: "string", minLength: 1 },
|
|
302
|
+
to: { type: "string", minLength: 1 },
|
|
303
|
+
impact: { enum: ["LOW", "MEDIUM", "HIGH"] }
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
},
|
|
307
|
+
summary: {
|
|
308
|
+
type: "object",
|
|
309
|
+
additionalProperties: false,
|
|
310
|
+
required: ["total", "high"],
|
|
311
|
+
properties: {
|
|
312
|
+
total: { type: "integer", minimum: 0 },
|
|
313
|
+
high: { type: "integer", minimum: 0 }
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
};
|
|
318
|
+
const validators = {
|
|
319
|
+
sop: ajv.compile(sopArtifactSchema),
|
|
320
|
+
checkpoint: ajv.compile(checkpointArtifactSchema),
|
|
321
|
+
dependency_report: ajv.compile(dependencyReportSchema)
|
|
322
|
+
};
|
|
323
|
+
function formatErrors(errors) {
|
|
324
|
+
if (!errors || errors.length === 0) {
|
|
325
|
+
return "unknown schema validation error";
|
|
326
|
+
}
|
|
327
|
+
return errors
|
|
328
|
+
.map((error) => {
|
|
329
|
+
const path = error.instancePath || "/";
|
|
330
|
+
return `${path} ${error.message || "invalid"}`;
|
|
331
|
+
})
|
|
332
|
+
.join("; ");
|
|
333
|
+
}
|
|
334
|
+
function assertArtifactSchema(kind, value) {
|
|
335
|
+
const validator = validators[kind];
|
|
336
|
+
const valid = validator(value);
|
|
337
|
+
if (!valid) {
|
|
338
|
+
throw new Error(`Invalid ${kind} artifact schema: ${formatErrors(validator.errors)}`);
|
|
339
|
+
}
|
|
340
|
+
}
|
|
341
|
+
function assertSOPArtifactSchema(value) {
|
|
342
|
+
assertArtifactSchema("sop", value);
|
|
343
|
+
return value;
|
|
344
|
+
}
|
|
345
|
+
function assertCheckpointArtifactSchema(value) {
|
|
346
|
+
assertArtifactSchema("checkpoint", value);
|
|
347
|
+
return value;
|
|
348
|
+
}
|
|
349
|
+
function assertDependencyReportArtifactSchema(value) {
|
|
350
|
+
assertArtifactSchema("dependency_report", value);
|
|
351
|
+
return value;
|
|
352
|
+
}
|
|
353
|
+
//# sourceMappingURL=artifact-schema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"artifact-schema.js","sourceRoot":"","sources":["../../src/infra/artifact-schema.ts"],"names":[],"mappings":";;;;;;AAqWA,oDAMC;AAED,0DAGC;AAED,wEAGC;AAED,oFAGC;AA1XD,8CAAyD;AACzD,yCAKuB;AAEV,QAAA,gCAAgC,GAAG,4BAA4B,CAAC;AAuB7E,MAAM,GAAG,GAAG,IAAI,aAAG,CAAC;IAClB,SAAS,EAAE,IAAI;IACf,MAAM,EAAE,KAAK;IACb,eAAe,EAAE,IAAI;CACtB,CAAC,CAAC;AAEH,MAAM,iBAAiB,GAAG;IACxB,GAAG,EAAE,kBAAkB;IACvB,IAAI,EAAE,QAAQ;IACd,oBAAoB,EAAE,KAAK;IAC3B,QAAQ,EAAE;QACR,gBAAgB;QAChB,QAAQ;QACR,MAAM;QACN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AAC,CAAC;IACnC,OAAO,KAAY,CAAC;AACtB,CAAC;AAED,SAAgB,8BAA8B,CAAC,KAAc;IAC3D,oBAAoB,CAAC,YAAY,EAAE,KAAK,CAAC,CAAC;IAC1C,OAAO,KAAmB,CAAC;AAC7B,CAAC;AAED,SAAgB,oCAAoC,CAAC,KAAc;IACjE,oBAAoB,CAAC,mBAAmB,EAAE,KAAK,CAAC,CAAC;IACjD,OAAO,KAAyB,CAAC;AACnC,CAAC"}
|
package/dist/infra/config.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ExecutionSettings, LLMProvider } from "../core/types";
|
|
2
|
+
import { ModelProviderId } from "./provider-registry";
|
|
2
3
|
export declare const CONFIG_SCHEMA_VERSION = "zaker.config.v1";
|
|
3
4
|
export interface ZakerConfig {
|
|
4
5
|
schema_version: string;
|
|
@@ -7,13 +8,25 @@ export interface ZakerConfig {
|
|
|
7
8
|
forbidden_paths: string[];
|
|
8
9
|
};
|
|
9
10
|
model: {
|
|
10
|
-
provider:
|
|
11
|
+
provider: ModelProviderId;
|
|
12
|
+
auth_mode?: "api_key" | "oauth";
|
|
11
13
|
endpoint?: string;
|
|
12
14
|
api_key_env?: string;
|
|
13
15
|
api_key?: string;
|
|
14
16
|
models_path?: string;
|
|
17
|
+
selection_policy?: "strict" | "provider_default" | "first_available";
|
|
18
|
+
fallback_model?: string;
|
|
15
19
|
planner_model: string;
|
|
16
20
|
auditor_model: string;
|
|
21
|
+
accounts: Record<string, {
|
|
22
|
+
auth_mode?: "api_key" | "oauth";
|
|
23
|
+
endpoint?: string;
|
|
24
|
+
api_key_env?: string;
|
|
25
|
+
api_key?: string;
|
|
26
|
+
default_model?: string;
|
|
27
|
+
models?: string[];
|
|
28
|
+
updated_at?: string;
|
|
29
|
+
}>;
|
|
17
30
|
timeout_ms?: number;
|
|
18
31
|
};
|
|
19
32
|
risk: {
|