@klhapp/skillmux 1.0.1 → 1.2.0
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/CHANGELOG.md +53 -0
- package/README.md +83 -29
- package/config.remote.example.toml +6 -4
- package/docs/calibration.md +106 -0
- package/docs/configuration.md +51 -7
- package/docs/schema.json +13 -5
- package/package.json +2 -1
- package/src/adapters.ts +111 -38
- package/src/calibrate.ts +623 -125
- package/src/cli.ts +56 -6
- package/src/clients.ts +264 -48
- package/src/config-service.ts +25 -8
- package/src/config-watcher.ts +7 -0
- package/src/config.ts +106 -25
- package/src/dataset-generator.ts +75 -96
- package/src/decision.ts +4 -1
- package/src/doctor.ts +16 -5
- package/src/eval.ts +2 -1
- package/src/router-core.ts +73 -42
- package/src/server.ts +9 -66
- package/src/types.ts +3 -3
package/src/server.ts
CHANGED
|
@@ -28,11 +28,6 @@ import {
|
|
|
28
28
|
RELOADABLE_KEYS,
|
|
29
29
|
RESTART_REQUIRED_KEYS,
|
|
30
30
|
} from "./config-service";
|
|
31
|
-
import {
|
|
32
|
-
applyCalibrationRun,
|
|
33
|
-
getCalibrationRun,
|
|
34
|
-
listCalibrationRuns,
|
|
35
|
-
} from "./calibrate";
|
|
36
31
|
|
|
37
32
|
export const metricsRegistry = new MetricsRegistry();
|
|
38
33
|
export const readinessState = new ReadinessState();
|
|
@@ -381,7 +376,7 @@ export async function startServer(opts?: {
|
|
|
381
376
|
JSON.stringify({
|
|
382
377
|
config_read: true,
|
|
383
378
|
config_write: !isExternallyManaged,
|
|
384
|
-
calibration:
|
|
379
|
+
calibration: false,
|
|
385
380
|
persistence: isExternallyManaged
|
|
386
381
|
? "externally_managed"
|
|
387
382
|
: "writable",
|
|
@@ -465,67 +460,15 @@ export async function startServer(opts?: {
|
|
|
465
460
|
}
|
|
466
461
|
|
|
467
462
|
if (url.pathname.startsWith("/admin/v1/calibrations")) {
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
headers,
|
|
477
|
-
});
|
|
478
|
-
}
|
|
479
|
-
const runIdMatch = url.pathname.match(
|
|
480
|
-
/^\/admin\/v1\/calibrations\/([^\/]+)$/,
|
|
481
|
-
);
|
|
482
|
-
if (req.method === "GET" && runIdMatch && runIdMatch[1]) {
|
|
483
|
-
const runId = runIdMatch[1];
|
|
484
|
-
const run = getCalibrationRun(db, runId);
|
|
485
|
-
if (!run)
|
|
486
|
-
return new Response(
|
|
487
|
-
JSON.stringify({ error: "Calibration run not found" }),
|
|
488
|
-
{ status: 404, headers },
|
|
489
|
-
);
|
|
490
|
-
return new Response(JSON.stringify(run), {
|
|
491
|
-
status: 200,
|
|
492
|
-
headers,
|
|
493
|
-
});
|
|
494
|
-
}
|
|
495
|
-
if (
|
|
496
|
-
req.method === "POST" &&
|
|
497
|
-
url.pathname === "/admin/v1/calibrations"
|
|
498
|
-
) {
|
|
499
|
-
const runId = "run_" + Math.random().toString(36).slice(2, 10);
|
|
500
|
-
return new Response(
|
|
501
|
-
JSON.stringify({ run_id: runId, status: "running" }),
|
|
502
|
-
{ status: 202, headers },
|
|
503
|
-
);
|
|
504
|
-
}
|
|
505
|
-
const applyMatch = url.pathname.match(
|
|
506
|
-
/^\/admin\/v1\/calibrations\/([^\/]+)\/apply$/,
|
|
463
|
+
return new Response(
|
|
464
|
+
JSON.stringify({
|
|
465
|
+
error: "not_implemented",
|
|
466
|
+
message:
|
|
467
|
+
"Remote calibration is not implemented in this release. " +
|
|
468
|
+
"Run `skillmux calibrate` against a local target.",
|
|
469
|
+
}),
|
|
470
|
+
{ status: 501, headers },
|
|
507
471
|
);
|
|
508
|
-
if (req.method === "POST" && applyMatch && applyMatch[1]) {
|
|
509
|
-
const runId = applyMatch[1];
|
|
510
|
-
const run = getCalibrationRun(db, runId);
|
|
511
|
-
if (!run)
|
|
512
|
-
return new Response(
|
|
513
|
-
JSON.stringify({ error: "Calibration run not found" }),
|
|
514
|
-
{ status: 404, headers },
|
|
515
|
-
);
|
|
516
|
-
const { DEFAULT_CONFIG_PATH, expandHome } =
|
|
517
|
-
await import("./config");
|
|
518
|
-
await applyCalibrationRun(
|
|
519
|
-
db,
|
|
520
|
-
runId,
|
|
521
|
-
expandHome(DEFAULT_CONFIG_PATH),
|
|
522
|
-
{},
|
|
523
|
-
);
|
|
524
|
-
return new Response(JSON.stringify({ ok: true, run_id: runId }), {
|
|
525
|
-
status: 200,
|
|
526
|
-
headers,
|
|
527
|
-
});
|
|
528
|
-
}
|
|
529
472
|
}
|
|
530
473
|
|
|
531
474
|
return new Response("Not Found", { status: 404, headers });
|
package/src/types.ts
CHANGED
|
@@ -54,15 +54,15 @@ export interface LocalInferenceConfig {
|
|
|
54
54
|
|
|
55
55
|
export interface RemoteEmbeddingConfig {
|
|
56
56
|
provider: "openai";
|
|
57
|
-
|
|
57
|
+
endpoint: string;
|
|
58
58
|
model: string;
|
|
59
59
|
dimension: number;
|
|
60
60
|
api_key_env?: string;
|
|
61
61
|
}
|
|
62
62
|
|
|
63
63
|
export interface RemoteRerankerConfig {
|
|
64
|
-
|
|
65
|
-
|
|
64
|
+
adapter: "jina-v1" | "bifrost-v1";
|
|
65
|
+
endpoint: string;
|
|
66
66
|
model: string;
|
|
67
67
|
api_key_env?: string;
|
|
68
68
|
}
|