@klhapp/skillmux 1.1.0 → 1.3.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 +22 -0
- package/README.md +155 -516
- package/config.example.toml +5 -4
- package/config.remote.example.toml +8 -3
- package/docs/README.md +52 -0
- package/docs/assets/architecture.svg +156 -0
- package/docs/assets/logo.png +0 -0
- package/docs/calibration.md +111 -0
- package/docs/cli.md +350 -0
- package/docs/concepts.md +165 -0
- package/docs/configuration.md +41 -8
- package/docs/deployment.md +250 -0
- package/docs/getting-started.md +239 -0
- package/docs/mcp-routing.md +172 -0
- package/docs/releasing.md +4 -3
- package/docs/skill-management.md +209 -0
- package/docs/troubleshooting.md +199 -0
- package/package.json +3 -5
- package/src/adapters.ts +33 -40
- package/src/calibrate.ts +165 -9
- package/src/cli.ts +51 -6
- package/src/config-watcher.ts +5 -1
- package/src/dataset-generator.ts +75 -96
- package/src/server.ts +10 -70
package/src/server.ts
CHANGED
|
@@ -4,7 +4,7 @@ import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
|
4
4
|
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
5
5
|
import { z } from "zod";
|
|
6
6
|
import { createClients } from "./clients";
|
|
7
|
-
import {
|
|
7
|
+
import { loadConfig, resolveConfigPath } from "./config";
|
|
8
8
|
import { ConfigWatcher, type ReloadStatus } from "./config-watcher";
|
|
9
9
|
import { RuntimeSnapshotManager } from "./snapshot";
|
|
10
10
|
import {
|
|
@@ -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,70 +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 active = snapshots.acquire();
|
|
517
|
-
const currentRerankerFingerprint = rerankerFingerprint(
|
|
518
|
-
active.snapshot.config,
|
|
519
|
-
);
|
|
520
|
-
active.release();
|
|
521
|
-
await applyCalibrationRun(
|
|
522
|
-
db,
|
|
523
|
-
runId,
|
|
524
|
-
expandHome(configPath),
|
|
525
|
-
{ currentRerankerFingerprint },
|
|
526
|
-
);
|
|
527
|
-
return new Response(JSON.stringify({ ok: true, run_id: runId }), {
|
|
528
|
-
status: 200,
|
|
529
|
-
headers,
|
|
530
|
-
});
|
|
531
|
-
}
|
|
532
472
|
}
|
|
533
473
|
|
|
534
474
|
return new Response("Not Found", { status: 404, headers });
|