@koed-labs/server 0.10.3 → 0.11.1
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 +3 -3
- package/package.json +1 -1
- package/vendor/{chunk-A6WMU2GG.js → chunk-2XKSVKQA.js} +5 -4
- package/vendor/{chunk-VPC5NLZG.js → chunk-4OO6VAU3.js} +1 -1
- package/vendor/{chunk-HK2H3MVE.js → chunk-53ZFCDHP.js} +4 -0
- package/vendor/chunk-6KS67EQE.js +75 -0
- package/vendor/chunk-7EGSY3E4.js +8 -0
- package/vendor/{chunk-JKOG52PE.js → chunk-7FSHVVTZ.js} +1 -1
- package/vendor/chunk-ALJUSOF7.js +175 -0
- package/vendor/{chunk-KUIWH33N.js → chunk-AVQCUFYQ.js} +1 -1
- package/vendor/chunk-BGENSONI.js +18 -0
- package/vendor/{chunk-ZXX4ZNJY.js → chunk-BUIM2M4R.js} +3 -2
- package/vendor/{chunk-YK4F4VY2.js → chunk-C4V72GXC.js} +51 -30
- package/vendor/{chunk-JJNLH5GA.js → chunk-C5SNDPAP.js} +21 -19
- package/vendor/{chunk-J2L726BC.js → chunk-CHMH4LH5.js} +3 -3
- package/vendor/{chunk-2S3OGPUC.js → chunk-EA4QDDQA.js} +2 -2
- package/vendor/{chunk-HZJK5RWC.js → chunk-EDPNYIX5.js} +575 -215
- package/vendor/{chunk-NM5NXCVM.js → chunk-FN3HUUO2.js} +558 -988
- package/vendor/{chunk-473OA62O.js → chunk-FSNLU46W.js} +218 -12497
- package/vendor/{chunk-GELDEJJ2.js → chunk-FYYRFX4U.js} +133 -47
- package/vendor/{chunk-YOFI4PCH.js → chunk-GFASBPV2.js} +7 -1
- package/vendor/chunk-HC76426R.js +48 -0
- package/vendor/{chunk-QIIKMG3M.js → chunk-IY2HRXOZ.js} +1 -5
- package/vendor/{chunk-ZUGNCQZE.js → chunk-JYK6UL6D.js} +22 -8
- package/vendor/{chunk-2BWTLF7A.js → chunk-LRP66XEY.js} +45 -21
- package/vendor/{chunk-DXTAWHY3.js → chunk-NOU7RHYZ.js} +8 -7
- package/vendor/{chunk-C3N4N5HR.js → chunk-NVTMIAAF.js} +26 -21
- package/vendor/chunk-O7DW2VAV.js +14 -0
- package/vendor/{chunk-YJ6XUZT6.js → chunk-OCILJ737.js} +23 -16
- package/vendor/{chunk-TSRPHKAC.js → chunk-PL3LWC5C.js} +16 -42
- package/vendor/chunk-QRKHHWJJ.js +104 -0
- package/vendor/{chunk-YJWREXN6.js → chunk-RCR4XPE3.js} +1 -1
- package/vendor/{chunk-AFLKCQHF.js → chunk-SHLRINKO.js} +2 -2
- package/vendor/{chunk-NEWIOOM6.js → chunk-SNKWETM5.js} +3 -2
- package/vendor/{chunk-XNFVSVBS.js → chunk-SRKIBFOE.js} +1 -1
- package/vendor/{chunk-G4IIVVJO.js → chunk-T6UB5PNX.js} +70 -2
- package/vendor/{chunk-RVYJKKWA.js → chunk-TG26CZGQ.js} +5 -4
- package/vendor/{chunk-HFM6ROJL.js → chunk-TISYUUEJ.js} +1 -1
- package/vendor/{chunk-K2EIFEQF.js → chunk-TSAYTRX3.js} +1 -1
- package/vendor/chunk-TVYEB2GN.js +343 -0
- package/vendor/{chunk-PT3AUPGE.js → chunk-UB6JCVQ3.js} +3 -1
- package/vendor/chunk-VGIYSDNU.js +522 -0
- package/vendor/{chunk-X6M525ZJ.js → chunk-W2OJZZ6X.js} +5 -5
- package/vendor/{chunk-YCDEMYY6.js → chunk-WDFERJG3.js} +231 -99
- package/vendor/{chunk-SKVYP7NY.js → chunk-WPIEF4LY.js} +8 -8
- package/vendor/{chunk-UI5RLBKQ.js → chunk-YZLQZU5E.js} +17 -1
- package/vendor/{chunk-PY5LYLV7.js → chunk-Z5WCAUA6.js} +26 -21
- package/vendor/chunk-ZIOKV2X6.js +1589 -0
- package/vendor/chunk-ZOHNXUDY.js +12501 -0
- package/vendor/chunk-ZUDSZGVO.js +11 -0
- package/vendor/component-manifest-catalog.js +2 -1
- package/vendor/control-plane.js +11 -6
- package/vendor/chunk-2DA7EFZV.js +0 -924
- /package/vendor/{chunk-A4NKL2PK.js → chunk-V67IQB7H.js} +0 -0
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { createRequire as createKoedRequire } from "node:module"; const require = createKoedRequire(import.meta.url);
|
|
2
|
-
import {
|
|
3
|
-
resolveKoedControlPlaneVersion
|
|
4
|
-
} from "./chunk-A4NKL2PK.js";
|
|
5
2
|
import {
|
|
6
3
|
resolveKoedServerPaths
|
|
7
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-TSAYTRX3.js";
|
|
5
|
+
import {
|
|
6
|
+
resolveKoedControlPlaneVersion
|
|
7
|
+
} from "./chunk-V67IQB7H.js";
|
|
8
8
|
|
|
9
9
|
// packages/koed-server/dist/cli.js
|
|
10
10
|
import { realpathSync } from "node:fs";
|
|
@@ -3547,7 +3547,7 @@ var registerPersonalSyncCommands = (program2, dependencies, complete, advanced)
|
|
|
3547
3547
|
const pair = program2.command("pair").description("Connect this device through Koed Desktop").option("--device-label <name>", "Device display name").option("--detach", "Return after creating the request").option("--json", "Emit JSON progress records");
|
|
3548
3548
|
const pairAction = async (operation, options) => {
|
|
3549
3549
|
const input = { ...pair.opts(), ...options };
|
|
3550
|
-
complete(await withCliService(() => import("./chunk-
|
|
3550
|
+
complete(await withCliService(() => import("./chunk-NVTMIAAF.js"), (service) => service.runPairCommand(operation, input, dependencies), dependencies, input.json));
|
|
3551
3551
|
};
|
|
3552
3552
|
pair.action(async (options) => pairAction(void 0, options));
|
|
3553
3553
|
for (const operation of ["status", "cancel"])
|
|
@@ -3569,7 +3569,7 @@ var registerPersonalSyncCommands = (program2, dependencies, complete, advanced)
|
|
|
3569
3569
|
const stdout = dependencies.stdout ?? process.stdout;
|
|
3570
3570
|
const stderr = dependencies.stderr ?? process.stderr;
|
|
3571
3571
|
try {
|
|
3572
|
-
const operation = dependencies.runPersonalSync ?? (await import("./chunk-
|
|
3572
|
+
const operation = dependencies.runPersonalSync ?? (await import("./chunk-NOU7RHYZ.js")).runPersonalSyncCommand;
|
|
3573
3573
|
const result = await operation(args, (dependencies.resolvePaths ?? resolveKoedServerPaths)(), process.env);
|
|
3574
3574
|
stdout.write(options.json ? `${JSON.stringify(result, null, 2)}
|
|
3575
3575
|
` : `${result.message}
|
|
@@ -3650,7 +3650,7 @@ var registerRemoteCommands = (program2, dependencies, complete) => {
|
|
|
3650
3650
|
}));
|
|
3651
3651
|
return;
|
|
3652
3652
|
}
|
|
3653
|
-
complete(await withCliService(() => import("./chunk-
|
|
3653
|
+
complete(await withCliService(() => import("./chunk-LRP66XEY.js"), (service) => service.runRemoteMcpOperation(operation, input, {
|
|
3654
3654
|
environment: dependencies.remoteEnvironment,
|
|
3655
3655
|
stdout: dependencies.stdout ?? process.stdout,
|
|
3656
3656
|
stderr: dependencies.stderr ?? process.stderr
|
|
@@ -3686,12 +3686,12 @@ var registerInternalCommands = (program2, dependencies, complete) => {
|
|
|
3686
3686
|
complete(1);
|
|
3687
3687
|
return;
|
|
3688
3688
|
}
|
|
3689
|
-
complete(await withCliService(() => import("./chunk-
|
|
3689
|
+
complete(await withCliService(() => import("./chunk-2XKSVKQA.js"), (service) => service.runSecretProviderCommand(operation, reference, dependencies), dependencies, false));
|
|
3690
3690
|
});
|
|
3691
3691
|
const desktop = program2.command("desktop", { hidden: true }).description("Internal Desktop commands");
|
|
3692
3692
|
desktop.action(() => desktop.outputHelp());
|
|
3693
3693
|
desktop.command("collaboration-broker").action(async () => {
|
|
3694
|
-
complete(await withCliService(() => import("./chunk-
|
|
3694
|
+
complete(await withCliService(() => import("./chunk-C5SNDPAP.js"), async (service) => {
|
|
3695
3695
|
try {
|
|
3696
3696
|
await service.runDesktopCollaborationBrokerProcess();
|
|
3697
3697
|
return 0;
|
|
@@ -3743,7 +3743,7 @@ var registerComponentCommands = (program2, dependencies, complete) => {
|
|
|
3743
3743
|
command.action(async (options) => {
|
|
3744
3744
|
let service;
|
|
3745
3745
|
try {
|
|
3746
|
-
service = await import("./chunk-
|
|
3746
|
+
service = await import("./chunk-OCILJ737.js");
|
|
3747
3747
|
} catch {
|
|
3748
3748
|
complete(reportMissingCliService(dependencies, options.json));
|
|
3749
3749
|
return;
|
|
@@ -3774,7 +3774,7 @@ var registerIntegrationCommands = (program2, dependencies, complete) => {
|
|
|
3774
3774
|
if (operation === "check")
|
|
3775
3775
|
command.option("--capabilities-refreshed-since <value>", "Minimum capability refresh timestamp").option("--include-status", "Include complete service status in the result");
|
|
3776
3776
|
command.action(async (options) => {
|
|
3777
|
-
complete(await withCliService(() => import("./chunk-
|
|
3777
|
+
complete(await withCliService(() => import("./chunk-C4V72GXC.js"), (service) => service.runIntegrationCommand(operation, { ...options, client }, dependencies), dependencies, options.json));
|
|
3778
3778
|
});
|
|
3779
3779
|
}
|
|
3780
3780
|
}
|
|
@@ -3791,7 +3791,7 @@ var registerLifecycleCommands = (program2, dependencies, complete) => {
|
|
|
3791
3791
|
};
|
|
3792
3792
|
const bind = (command, operation, identityAction) => {
|
|
3793
3793
|
command.option("--json", "Emit JSON output").action(async (options) => {
|
|
3794
|
-
complete(await withCliService(() => import("./chunk-
|
|
3794
|
+
complete(await withCliService(() => import("./chunk-Z5WCAUA6.js"), (service) => service.runLifecycleCommand(operation, { ...options, identityAction }, dependencies), dependencies, options.json));
|
|
3795
3795
|
});
|
|
3796
3796
|
};
|
|
3797
3797
|
for (const operation of Object.keys(descriptions)) {
|
|
@@ -3871,10 +3871,10 @@ var registerUpstreamCommands = (program2, dependencies, complete) => {
|
|
|
3871
3871
|
const paths = (dependencies.resolvePaths ?? resolveKoedServerPaths)();
|
|
3872
3872
|
let result;
|
|
3873
3873
|
if (command === list) {
|
|
3874
|
-
const execute = dependencies.listUpstreams ?? (await import("./chunk-
|
|
3874
|
+
const execute = dependencies.listUpstreams ?? (await import("./chunk-SNKWETM5.js")).listUpstreamBackends;
|
|
3875
3875
|
result = execute(paths);
|
|
3876
3876
|
} else if (command === register) {
|
|
3877
|
-
const execute = dependencies.registerUpstream ?? (await import("./chunk-
|
|
3877
|
+
const execute = dependencies.registerUpstream ?? (await import("./chunk-SNKWETM5.js")).registerUpstreamBackend;
|
|
3878
3878
|
result = execute(paths, {
|
|
3879
3879
|
url: required(options.url, "--url"),
|
|
3880
3880
|
id: options.id,
|
|
@@ -3884,7 +3884,7 @@ var registerUpstreamCommands = (program2, dependencies, complete) => {
|
|
|
3884
3884
|
} else {
|
|
3885
3885
|
const id = required(options.id, "--id");
|
|
3886
3886
|
if (command === refresh) {
|
|
3887
|
-
const execute = dependencies.refreshUpstream ?? (await import("./chunk-
|
|
3887
|
+
const execute = dependencies.refreshUpstream ?? (await import("./chunk-SNKWETM5.js")).refreshUpstreamBackendCapabilities;
|
|
3888
3888
|
result = await execute(paths, id);
|
|
3889
3889
|
} else if (command === policy) {
|
|
3890
3890
|
const update = {};
|
|
@@ -3896,28 +3896,28 @@ var registerUpstreamCommands = (program2, dependencies, complete) => {
|
|
|
3896
3896
|
throw new Error(`--${flag} must be enabled or disabled.`);
|
|
3897
3897
|
update[key] = value;
|
|
3898
3898
|
}
|
|
3899
|
-
const execute = dependencies.updateUpstreamPolicy ?? (await import("./chunk-
|
|
3899
|
+
const execute = dependencies.updateUpstreamPolicy ?? (await import("./chunk-SNKWETM5.js")).updateUpstreamBackendRoutePolicy;
|
|
3900
3900
|
result = execute(paths, id, update);
|
|
3901
3901
|
} else if (command === activate) {
|
|
3902
|
-
const execute = dependencies.activateUpstream ?? (await import("./chunk-
|
|
3902
|
+
const execute = dependencies.activateUpstream ?? (await import("./chunk-SNKWETM5.js")).setActiveUpstreamBackend;
|
|
3903
3903
|
result = execute(paths, id);
|
|
3904
3904
|
} else if (command === remove) {
|
|
3905
|
-
const execute = dependencies.removeUpstream ?? (await import("./chunk-
|
|
3905
|
+
const execute = dependencies.removeUpstream ?? (await import("./chunk-SNKWETM5.js")).removeUpstreamBackend;
|
|
3906
3906
|
result = execute(paths, id);
|
|
3907
3907
|
} else if (command === disconnect) {
|
|
3908
|
-
const execute = dependencies.disconnectUpstream ?? (await import("./chunk-
|
|
3908
|
+
const execute = dependencies.disconnectUpstream ?? (await import("./chunk-TG26CZGQ.js")).disconnectUpstreamBackendEnrollment;
|
|
3909
3909
|
result = await execute(paths, id);
|
|
3910
3910
|
} else if (command === start) {
|
|
3911
|
-
const execute = dependencies.startUpstreamEnroll ?? (await import("./chunk-
|
|
3911
|
+
const execute = dependencies.startUpstreamEnroll ?? (await import("./chunk-TG26CZGQ.js")).startUpstreamEnrollment;
|
|
3912
3912
|
result = await execute(paths, id, {
|
|
3913
3913
|
memoryAnswers: Boolean(options.memoryAnswers || options.enableMemoryAnswers),
|
|
3914
3914
|
sourceOwnerPrincipalId: required(options.sourceOwnerPrincipalId, "--source-owner-principal-id")
|
|
3915
3915
|
});
|
|
3916
3916
|
} else if (command === status) {
|
|
3917
|
-
const execute = dependencies.getUpstreamEnrollStatus ?? (await import("./chunk-
|
|
3917
|
+
const execute = dependencies.getUpstreamEnrollStatus ?? (await import("./chunk-TG26CZGQ.js")).getUpstreamEnrollmentStatus;
|
|
3918
3918
|
result = await execute(paths, id);
|
|
3919
3919
|
} else {
|
|
3920
|
-
const execute = dependencies.cancelUpstreamEnroll ?? (await import("./chunk-
|
|
3920
|
+
const execute = dependencies.cancelUpstreamEnroll ?? (await import("./chunk-TG26CZGQ.js")).cancelUpstreamEnrollment;
|
|
3921
3921
|
result = await execute(paths, id);
|
|
3922
3922
|
}
|
|
3923
3923
|
}
|
|
@@ -3978,22 +3978,22 @@ var registerProjectCommands = (program2, dependencies, complete) => {
|
|
|
3978
3978
|
const paths = (dependencies.resolvePaths ?? resolveKoedServerPaths)();
|
|
3979
3979
|
let result;
|
|
3980
3980
|
if (command === discover) {
|
|
3981
|
-
const execute = dependencies.discoverProjectMetadata ?? (await import("./chunk-
|
|
3981
|
+
const execute = dependencies.discoverProjectMetadata ?? (await import("./chunk-PL3LWC5C.js")).discoverProjectMetadata;
|
|
3982
3982
|
result = await execute(paths, {
|
|
3983
3983
|
cwd: options.cwd ?? process.cwd(),
|
|
3984
3984
|
aiClientSource: options.codex ? "codex" : void 0
|
|
3985
3985
|
});
|
|
3986
3986
|
} else if (command === list) {
|
|
3987
|
-
const execute = dependencies.listProjectMetadata ?? (await import("./chunk-
|
|
3987
|
+
const execute = dependencies.listProjectMetadata ?? (await import("./chunk-PL3LWC5C.js")).listProjectMetadata;
|
|
3988
3988
|
result = execute(paths);
|
|
3989
3989
|
} else if (command === show) {
|
|
3990
|
-
const execute = dependencies.getProjectMetadataForCwd ?? (await import("./chunk-
|
|
3990
|
+
const execute = dependencies.getProjectMetadataForCwd ?? (await import("./chunk-PL3LWC5C.js")).getProjectMetadataForCwd;
|
|
3991
3991
|
result = execute(paths, options.cwd ?? process.cwd());
|
|
3992
3992
|
} else if (command === forget) {
|
|
3993
|
-
const execute = dependencies.forgetProjectMetadata ?? (await import("./chunk-
|
|
3993
|
+
const execute = dependencies.forgetProjectMetadata ?? (await import("./chunk-PL3LWC5C.js")).forgetProjectMetadata;
|
|
3994
3994
|
result = execute(paths, required2(options.localProjectId, "--local-project-id"));
|
|
3995
3995
|
} else if (command === anchor) {
|
|
3996
|
-
const { setProjectRepositoryAnchor } = await import("./chunk-
|
|
3996
|
+
const { setProjectRepositoryAnchor } = await import("./chunk-PL3LWC5C.js");
|
|
3997
3997
|
result = await setProjectRepositoryAnchor(paths, {
|
|
3998
3998
|
localProjectId: required2(options.localProjectId, "--local-project-id"),
|
|
3999
3999
|
expectedCheckoutId: required2(options.checkoutId, "--checkout-id"),
|
|
@@ -4057,7 +4057,7 @@ var registerPackageCommands = (program2, dependencies, complete) => {
|
|
|
4057
4057
|
let result;
|
|
4058
4058
|
switch (command.name()) {
|
|
4059
4059
|
case "status": {
|
|
4060
|
-
const execute = dependencies.collectPackageStatus ?? (await import("./chunk-
|
|
4060
|
+
const execute = dependencies.collectPackageStatus ?? (await import("./chunk-GFASBPV2.js")).collectServerPackageStatus;
|
|
4061
4061
|
result = execute(paths);
|
|
4062
4062
|
break;
|
|
4063
4063
|
}
|
|
@@ -4084,20 +4084,20 @@ var registerPackageCommands = (program2, dependencies, complete) => {
|
|
|
4084
4084
|
input.trustPolicy = policy;
|
|
4085
4085
|
if (options.allowDowngrade)
|
|
4086
4086
|
input.allowDowngrade = true;
|
|
4087
|
-
const execute = dependencies.installPackage ?? (await import("./chunk-
|
|
4087
|
+
const execute = dependencies.installPackage ?? (await import("./chunk-GFASBPV2.js")).installServerPackage;
|
|
4088
4088
|
result = await execute(paths, input);
|
|
4089
4089
|
break;
|
|
4090
4090
|
}
|
|
4091
4091
|
case "activate": {
|
|
4092
4092
|
const version = required3(options.version, "--version");
|
|
4093
|
-
const execute = dependencies.activatePackage ?? (await import("./chunk-
|
|
4093
|
+
const execute = dependencies.activatePackage ?? (await import("./chunk-GFASBPV2.js")).activateServerPackage;
|
|
4094
4094
|
result = execute(paths, version, {
|
|
4095
4095
|
allowDowngrade: Boolean(options.allowDowngrade)
|
|
4096
4096
|
});
|
|
4097
4097
|
break;
|
|
4098
4098
|
}
|
|
4099
4099
|
default: {
|
|
4100
|
-
const execute = dependencies.cleanupPackages ?? (await import("./chunk-
|
|
4100
|
+
const execute = dependencies.cleanupPackages ?? (await import("./chunk-GFASBPV2.js")).cleanupServerPackages;
|
|
4101
4101
|
result = execute(paths, Number.parseInt(options.keep ?? "1", 10));
|
|
4102
4102
|
}
|
|
4103
4103
|
}
|
|
@@ -4122,6 +4122,19 @@ var registerPackageCommands = (program2, dependencies, complete) => {
|
|
|
4122
4122
|
var runModelCommand = async (operation, options, dependencies) => {
|
|
4123
4123
|
const stdout = dependencies.stdout ?? process.stdout;
|
|
4124
4124
|
const stderr = dependencies.stderr ?? process.stderr;
|
|
4125
|
+
let lastProgressAt = 0;
|
|
4126
|
+
let lastPhase = "";
|
|
4127
|
+
const progress = (event) => {
|
|
4128
|
+
if (!options.progressJson)
|
|
4129
|
+
return;
|
|
4130
|
+
const now = Date.now();
|
|
4131
|
+
if (event.phase === lastPhase && now - lastProgressAt < 250 && event.completedBytes !== event.totalBytes)
|
|
4132
|
+
return;
|
|
4133
|
+
lastProgressAt = now;
|
|
4134
|
+
lastPhase = event.phase;
|
|
4135
|
+
stderr.write(`KOED_MODEL_PROGRESS ${JSON.stringify(event)}
|
|
4136
|
+
`);
|
|
4137
|
+
};
|
|
4125
4138
|
try {
|
|
4126
4139
|
if (options.kind !== "embedding" && options.kind !== "privacy")
|
|
4127
4140
|
throw new Error("--kind must be embedding or privacy.");
|
|
@@ -4134,15 +4147,31 @@ var runModelCommand = async (operation, options, dependencies) => {
|
|
|
4134
4147
|
let result;
|
|
4135
4148
|
if (options.kind === "privacy") {
|
|
4136
4149
|
if (operation === "status") {
|
|
4137
|
-
const execute = dependencies.collectPrivacyModelStatus ?? (await import("./chunk-
|
|
4150
|
+
const execute = dependencies.collectPrivacyModelStatus ?? (await import("./chunk-BUIM2M4R.js")).collectPrivacyModelStatus;
|
|
4138
4151
|
result = await execute(paths);
|
|
4139
4152
|
} else {
|
|
4140
|
-
const execute = dependencies.installPrivacyModel ?? (await import("./chunk-
|
|
4141
|
-
|
|
4153
|
+
const execute = dependencies.installPrivacyModel ?? (await import("./chunk-BUIM2M4R.js")).installPrivacyModel;
|
|
4154
|
+
const files = /* @__PURE__ */ new Map();
|
|
4155
|
+
result = options.progressJson ? await execute(paths, environment, void 0, {
|
|
4156
|
+
progress: (event) => {
|
|
4157
|
+
files.set(event.file ?? "current", event.transferredBytes);
|
|
4158
|
+
progress({
|
|
4159
|
+
completedBytes: [...files.values()].reduce((sum, bytes) => sum + bytes, 0),
|
|
4160
|
+
// Remaining Privacy Filter assets may not have known lengths yet.
|
|
4161
|
+
totalBytes: null,
|
|
4162
|
+
phase: event.phase === "model-verify" ? "verifying" : "downloading"
|
|
4163
|
+
});
|
|
4164
|
+
}
|
|
4165
|
+
}) : await execute(paths, environment);
|
|
4142
4166
|
}
|
|
4143
|
-
} else {
|
|
4144
|
-
const execute =
|
|
4167
|
+
} else if (operation === "status") {
|
|
4168
|
+
const execute = dependencies.collectModelStatus ?? (await import("./chunk-AVQCUFYQ.js")).collectLocalModelStatus;
|
|
4145
4169
|
result = await execute(paths, options.kind, environment);
|
|
4170
|
+
} else {
|
|
4171
|
+
const execute = dependencies.installModel ?? (await import("./chunk-AVQCUFYQ.js")).installLocalModel;
|
|
4172
|
+
result = options.progressJson ? await execute(paths, options.kind, environment, {
|
|
4173
|
+
onProgress: progress
|
|
4174
|
+
}) : await execute(paths, options.kind, environment);
|
|
4146
4175
|
}
|
|
4147
4176
|
stdout.write(options.json ? `${JSON.stringify(result, null, 2)}
|
|
4148
4177
|
` : `${result.message}
|
|
@@ -4163,42 +4192,96 @@ var registerModelCommands = (program2, dependencies, complete) => {
|
|
|
4163
4192
|
const models = program2.command("models").description("Manage embedding and privacy models");
|
|
4164
4193
|
models.action(() => models.outputHelp());
|
|
4165
4194
|
for (const operation of ["status", "install"])
|
|
4166
|
-
models.command(operation).description(operation === "status" ? "Show model installation status" : "Download and verify a local model").option("--kind <kind>", "Model kind: embedding or privacy", "embedding").option("--json", "Emit JSON output").action(async (options) => {
|
|
4195
|
+
models.command(operation).description(operation === "status" ? "Show model installation status" : "Download and verify a local model").option("--kind <kind>", "Model kind: embedding or privacy", "embedding").option("--json", "Emit JSON output").option("--progress-json", "Stream model download progress to stderr").action(async (options) => {
|
|
4167
4196
|
complete(await runModelCommand(operation, options, dependencies));
|
|
4168
4197
|
});
|
|
4169
4198
|
};
|
|
4170
4199
|
|
|
4171
4200
|
// packages/koed-server/dist/cli-runtime.js
|
|
4201
|
+
async function withRuntimeCancellation(action) {
|
|
4202
|
+
const controller = new AbortController();
|
|
4203
|
+
const cancel = () => controller.abort(new Error("Native runtime operation cancelled."));
|
|
4204
|
+
process.on("SIGINT", cancel);
|
|
4205
|
+
process.on("SIGTERM", cancel);
|
|
4206
|
+
try {
|
|
4207
|
+
return await action(controller.signal);
|
|
4208
|
+
} finally {
|
|
4209
|
+
process.off("SIGINT", cancel);
|
|
4210
|
+
process.off("SIGTERM", cancel);
|
|
4211
|
+
}
|
|
4212
|
+
}
|
|
4172
4213
|
var runRuntimeCommand = async (operation, options, dependencies) => {
|
|
4173
4214
|
const stdout = dependencies.stdout ?? process.stdout;
|
|
4174
4215
|
const stderr = dependencies.stderr ?? process.stderr;
|
|
4175
4216
|
try {
|
|
4176
|
-
if (options.
|
|
4177
|
-
throw new Error("--
|
|
4217
|
+
if (options.withCuda && options.withoutCuda)
|
|
4218
|
+
throw new Error("--with-cuda and --without-cuda are mutually exclusive.");
|
|
4219
|
+
if ((options.withCuda || options.withoutCuda) && (operation !== "install" || options.provider !== "release"))
|
|
4220
|
+
throw new Error("CUDA asset flags require runtime install --provider release --dependency-mode bundled-local.");
|
|
4221
|
+
if (options.provider !== "homebrew" && options.provider !== "packaged" && options.provider !== "release")
|
|
4222
|
+
throw new Error("--provider must be homebrew, packaged, or release.");
|
|
4178
4223
|
if (operation === "install" && options.dependencyMode !== "bundled-local")
|
|
4179
4224
|
throw new Error("runtime install requires --dependency-mode bundled-local.");
|
|
4180
4225
|
const paths = (dependencies.resolvePaths ?? resolveKoedServerPaths)();
|
|
4181
4226
|
const loadEnvironment = dependencies.loadEnvironment ?? (await import("./chunk-7NOQSX4T.js")).loadRepoEnv;
|
|
4182
4227
|
const environment = {
|
|
4183
4228
|
...loadEnvironment(paths.repoRoot),
|
|
4184
|
-
...Object.fromEntries(
|
|
4229
|
+
...Object.fromEntries(
|
|
4230
|
+
// An explicitly empty CUDA mask hides all GPUs.
|
|
4231
|
+
Object.entries(process.env).filter(([key, value]) => key === "CUDA_VISIBLE_DEVICES" || value?.trim())
|
|
4232
|
+
)
|
|
4185
4233
|
};
|
|
4186
4234
|
let result;
|
|
4187
|
-
if (options.provider === "
|
|
4188
|
-
|
|
4235
|
+
if (options.provider === "release") {
|
|
4236
|
+
if (dependencies.desktopRuntimeCapability)
|
|
4237
|
+
throw new Error("Use Koed Desktop to manage its runtime.");
|
|
4238
|
+
const release = await import("./chunk-VGIYSDNU.js");
|
|
4239
|
+
if (operation === "validate") {
|
|
4240
|
+
if (!options.runtimeRoot?.trim())
|
|
4241
|
+
throw new Error("Provide a trusted staged runtime directory.");
|
|
4242
|
+
const root = options.runtimeRoot;
|
|
4243
|
+
release.assertReleaseHost();
|
|
4244
|
+
const { withStoppedRuntime } = await import("./chunk-HC76426R.js");
|
|
4245
|
+
const { resolveKoedRuntimeOwner } = await import("./chunk-BGENSONI.js");
|
|
4246
|
+
const { validateStagedCuda } = await import("./chunk-O7DW2VAV.js");
|
|
4247
|
+
result = await withRuntimeCancellation((signal) => withStoppedRuntime(paths, resolveKoedRuntimeOwner(), () => validateStagedCuda(paths, root, environment, {
|
|
4248
|
+
signal,
|
|
4249
|
+
requireModel: options.requireModel === true
|
|
4250
|
+
})));
|
|
4251
|
+
} else if (operation === "status")
|
|
4252
|
+
result = release.collectReleaseRuntimeStatus(paths, environment);
|
|
4253
|
+
else {
|
|
4254
|
+
let last = 0;
|
|
4255
|
+
result = await withRuntimeCancellation((signal) => release.installReleaseRuntime(paths, {
|
|
4256
|
+
signal,
|
|
4257
|
+
cuda: options.withCuda ? "with" : options.withoutCuda ? "without" : "preserve",
|
|
4258
|
+
environment,
|
|
4259
|
+
progress(event) {
|
|
4260
|
+
if (Date.now() - last < 1e3 && event.transferredBytes !== event.totalBytes)
|
|
4261
|
+
return;
|
|
4262
|
+
last = Date.now();
|
|
4263
|
+
stderr.write(`Downloading native runtime asset: ${event.transferredBytes} of ${event.totalBytes ?? "unknown"} bytes
|
|
4264
|
+
`);
|
|
4265
|
+
}
|
|
4266
|
+
}));
|
|
4267
|
+
}
|
|
4268
|
+
} else if (options.provider === "packaged") {
|
|
4269
|
+
const execute = operation === "status" ? dependencies.collectPackagedRuntimeStatus ?? (await import("./chunk-UB6JCVQ3.js")).collectPackagedRuntimeStatus : dependencies.installPackagedRuntime ?? (await import("./chunk-UB6JCVQ3.js")).installPackagedRuntime;
|
|
4189
4270
|
result = execute(paths, environment);
|
|
4190
4271
|
} else {
|
|
4191
|
-
const execute = operation === "status" ? dependencies.collectRuntimeStatus ?? (await import("./chunk-
|
|
4272
|
+
const execute = operation === "status" ? dependencies.collectRuntimeStatus ?? (await import("./chunk-53ZFCDHP.js")).collectHomebrewRuntimeStatus : dependencies.installRuntime ?? (await import("./chunk-53ZFCDHP.js")).installHomebrewRuntime;
|
|
4192
4273
|
result = execute(paths, environment);
|
|
4193
4274
|
}
|
|
4194
4275
|
stdout.write(options.json ? `${JSON.stringify(result, null, 2)}
|
|
4195
4276
|
` : `${result.message}
|
|
4196
|
-
`)
|
|
4277
|
+
${"executionPolicy" in result ? `Embedding execution policy: ${String(result.executionPolicy)}.
|
|
4278
|
+
` : ""}`);
|
|
4197
4279
|
return result.ok ? 0 : 1;
|
|
4198
4280
|
} catch (error) {
|
|
4199
4281
|
const message = error instanceof Error ? error.message : String(error);
|
|
4282
|
+
const reason = error instanceof Error && "reason" in error ? error.reason : void 0;
|
|
4200
4283
|
if (options.json)
|
|
4201
|
-
stdout.write(`${JSON.stringify({ ok: false, error: message }, null, 2)}
|
|
4284
|
+
stdout.write(`${JSON.stringify({ ok: false, error: message, reason }, null, 2)}
|
|
4202
4285
|
`);
|
|
4203
4286
|
else
|
|
4204
4287
|
stderr.write(`${message}
|
|
@@ -4209,12 +4292,15 @@ var runRuntimeCommand = async (operation, options, dependencies) => {
|
|
|
4209
4292
|
var registerRuntimeCommands = (program2, dependencies, complete) => {
|
|
4210
4293
|
const runtime = program2.command("runtime").description("Manage local runtime dependencies");
|
|
4211
4294
|
runtime.action(() => runtime.outputHelp());
|
|
4295
|
+
runtime.command("validate").description("Run stopped-runtime CPU/CUDA checks on a trusted, staged Linux runtime").requiredOption("--runtime-root <directory>", "Trusted directory containing llama.cpp/cpu and llama.cpp/cuda; its binaries will execute").option("--require-model", "Require CPU/GPU inference with the already installed embedding model").option("--json", "Emit JSON output").action(async (options) => {
|
|
4296
|
+
complete(await runRuntimeCommand("validate", { ...options, provider: "release" }, dependencies));
|
|
4297
|
+
});
|
|
4212
4298
|
for (const operation of ["status", "install"]) {
|
|
4213
|
-
const command = runtime.command(operation).description(operation === "status" ? "Show runtime installation status" : "Install local runtime dependencies explicitly").option("--provider <provider>", "Runtime provider: homebrew or
|
|
4299
|
+
const command = runtime.command(operation).description(operation === "status" ? "Show runtime installation status" : "Install local runtime dependencies explicitly").option("--provider <provider>", "Runtime provider: homebrew, packaged, or release", "homebrew").option("--dependency-mode <mode>", "Dependency mode; installation requires bundled-local").option("--json", "Emit JSON output").action(async (options) => {
|
|
4214
4300
|
complete(await runRuntimeCommand(operation, options, dependencies));
|
|
4215
4301
|
});
|
|
4216
4302
|
if (operation === "install")
|
|
4217
|
-
command.addHelpText("after", "\nExample:\n koed runtime install --provider homebrew --dependency-mode bundled-local --json");
|
|
4303
|
+
command.option("--with-cuda", "Install the pinned CUDA add-on with its compatible CPU core").option("--without-cuda", "Select CPU only and retain the previous payloads").addHelpText("after", "\nExample:\n koed runtime install --provider homebrew --dependency-mode bundled-local --json");
|
|
4218
4304
|
}
|
|
4219
4305
|
};
|
|
4220
4306
|
|
|
@@ -4,6 +4,7 @@ import {
|
|
|
4
4
|
assertPackageMigrationCompatible,
|
|
5
5
|
cleanupServerPackages,
|
|
6
6
|
collectServerPackageStatus,
|
|
7
|
+
extractNativeArchive,
|
|
7
8
|
extractVerifiedPackageArchive,
|
|
8
9
|
installServerPackage,
|
|
9
10
|
isVersionDowngrade,
|
|
@@ -15,13 +16,18 @@ import {
|
|
|
15
16
|
standalonePackageKind,
|
|
16
17
|
standalonePackageSchemaVersion,
|
|
17
18
|
validateServerPackageRoot
|
|
18
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-ZIOKV2X6.js";
|
|
20
|
+
import "./chunk-QRKHHWJJ.js";
|
|
21
|
+
import "./chunk-7EGSY3E4.js";
|
|
22
|
+
import "./chunk-IY2HRXOZ.js";
|
|
23
|
+
import "./chunk-FSNLU46W.js";
|
|
19
24
|
import "./chunk-BTS4ZTF3.js";
|
|
20
25
|
export {
|
|
21
26
|
activateServerPackage,
|
|
22
27
|
assertPackageMigrationCompatible,
|
|
23
28
|
cleanupServerPackages,
|
|
24
29
|
collectServerPackageStatus,
|
|
30
|
+
extractNativeArchive,
|
|
25
31
|
extractVerifiedPackageArchive,
|
|
26
32
|
installServerPackage,
|
|
27
33
|
isVersionDowngrade,
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { createRequire as createKoedRequire } from "node:module"; const require = createKoedRequire(import.meta.url);
|
|
2
|
+
import {
|
|
3
|
+
activateGeneration,
|
|
4
|
+
assertDirectoryChain,
|
|
5
|
+
cleanupGenerations,
|
|
6
|
+
pinDesktopBundleGenerationForStart,
|
|
7
|
+
pinGenerationForStart,
|
|
8
|
+
readCurrentDesktopGeneration,
|
|
9
|
+
readCurrentDesktopGenerationOrderingEvidence,
|
|
10
|
+
readCurrentGeneration,
|
|
11
|
+
readCurrentGenerationForOwner,
|
|
12
|
+
readCurrentGenerationOrderingEvidence,
|
|
13
|
+
readCurrentRuntimeOwner,
|
|
14
|
+
readDesktopBundleGeneration,
|
|
15
|
+
readDesktopGenerationForCapability,
|
|
16
|
+
stageDesktopBundleForRecovery,
|
|
17
|
+
withLifecycleLock,
|
|
18
|
+
withSourceNativeStartLock,
|
|
19
|
+
withStoppedRuntime
|
|
20
|
+
} from "./chunk-FN3HUUO2.js";
|
|
21
|
+
import "./chunk-T6UB5PNX.js";
|
|
22
|
+
import "./chunk-7NXKPDF3.js";
|
|
23
|
+
import "./chunk-ZUDSZGVO.js";
|
|
24
|
+
import "./chunk-ZIOKV2X6.js";
|
|
25
|
+
import "./chunk-QRKHHWJJ.js";
|
|
26
|
+
import "./chunk-7EGSY3E4.js";
|
|
27
|
+
import "./chunk-IY2HRXOZ.js";
|
|
28
|
+
import "./chunk-FSNLU46W.js";
|
|
29
|
+
import "./chunk-BTS4ZTF3.js";
|
|
30
|
+
export {
|
|
31
|
+
activateGeneration,
|
|
32
|
+
assertDirectoryChain,
|
|
33
|
+
cleanupGenerations,
|
|
34
|
+
pinDesktopBundleGenerationForStart,
|
|
35
|
+
pinGenerationForStart,
|
|
36
|
+
readCurrentDesktopGeneration,
|
|
37
|
+
readCurrentDesktopGenerationOrderingEvidence,
|
|
38
|
+
readCurrentGeneration,
|
|
39
|
+
readCurrentGenerationForOwner,
|
|
40
|
+
readCurrentGenerationOrderingEvidence,
|
|
41
|
+
readCurrentRuntimeOwner,
|
|
42
|
+
readDesktopBundleGeneration,
|
|
43
|
+
readDesktopGenerationForCapability,
|
|
44
|
+
stageDesktopBundleForRecovery,
|
|
45
|
+
withLifecycleLock,
|
|
46
|
+
withSourceNativeStartLock,
|
|
47
|
+
withStoppedRuntime
|
|
48
|
+
};
|
|
@@ -93,11 +93,7 @@ function lookupManifestPin(catalog, identity) {
|
|
|
93
93
|
return entry.manifestSha256;
|
|
94
94
|
}
|
|
95
95
|
|
|
96
|
-
// packages/koed-server/dist/component-manifest-catalog-data.js
|
|
97
|
-
var productionComponentManifestCatalog = validateManifestCatalog({ "schemaVersion": 2, "productVersion": "0.10.3", "entries": [{ "component": "base", "manifestSha256": "cfa106faf481eb5a62e5dbe9c90a7447037adbee1996ddca7cd614b142364000", "target": { "platform": "linux", "architecture": "x64", "libc": { "family": "glibc", "minimumVersion": "2.35" } } }, { "component": "base", "manifestSha256": "c4c9052f81cbcd51285c0e35afedffa7e4db976f9e6a2fb45c9658004e84214c", "target": { "platform": "macos", "architecture": "arm64" } }, { "component": "privacy", "variant": "cpu", "manifestSha256": "ae4188f582c5bc6018f76f8e4c830b3cf2ea8baccaa2fb9bc850efc4fd0bd328", "target": { "platform": "linux", "architecture": "x64", "libc": { "family": "glibc", "minimumVersion": "2.35" } } }, { "component": "privacy", "variant": "cuda", "manifestSha256": "6d93a1e8d30643b5afa365a2cd48e3b6554e930b2ca0e71caa9b2fcc1a6f1819", "target": { "platform": "linux", "architecture": "x64", "libc": { "family": "glibc", "minimumVersion": "2.35" } } }, { "component": "privacy", "manifestSha256": "cf6f8fd24cfc42519fcbcd8ff072fc89aa1166aa37acd54add46fdce1f460857", "target": { "platform": "macos", "architecture": "arm64" } }] });
|
|
98
|
-
|
|
99
96
|
export {
|
|
100
97
|
validateManifestCatalog,
|
|
101
|
-
lookupManifestPin
|
|
102
|
-
productionComponentManifestCatalog
|
|
98
|
+
lookupManifestPin
|
|
103
99
|
};
|
|
@@ -2,7 +2,8 @@ import { createRequire as createKoedRequire } from "node:module"; const require
|
|
|
2
2
|
|
|
3
3
|
// packages/koed-server/dist/local-models-runtime.js
|
|
4
4
|
import { createHash } from "node:crypto";
|
|
5
|
-
import {
|
|
5
|
+
import { constants, lstatSync, createWriteStream, mkdirSync, renameSync, rmSync, statSync } from "node:fs";
|
|
6
|
+
import { open } from "node:fs/promises";
|
|
6
7
|
import { Readable, Transform } from "node:stream";
|
|
7
8
|
import { pipeline } from "node:stream/promises";
|
|
8
9
|
import { basename, dirname, resolve } from "node:path";
|
|
@@ -57,24 +58,37 @@ var resolveLocalModelManifest = (paths, kind = "embedding", environment = proces
|
|
|
57
58
|
defaultSha256: definition.defaultSha256
|
|
58
59
|
};
|
|
59
60
|
};
|
|
60
|
-
var sha256File = async (path) => {
|
|
61
|
+
var sha256File = async (path, signal) => {
|
|
61
62
|
const hash = createHash("sha256");
|
|
62
|
-
await
|
|
63
|
+
const file = await open(path, constants.O_RDONLY | constants.O_NONBLOCK);
|
|
64
|
+
try {
|
|
65
|
+
if (!(await file.stat()).isFile())
|
|
66
|
+
throw new Error("The model must be a regular file.");
|
|
67
|
+
await pipeline(file.createReadStream(), hash, { signal });
|
|
68
|
+
} finally {
|
|
69
|
+
await file.close();
|
|
70
|
+
}
|
|
63
71
|
return hash.digest("hex");
|
|
64
72
|
};
|
|
65
|
-
var collectLocalModelStatus = async (paths, kind = "embedding", environment = process.env) => {
|
|
73
|
+
var collectLocalModelStatus = async (paths, kind = "embedding", environment = process.env, signal) => {
|
|
66
74
|
const manifest = resolveLocalModelManifest(paths, kind, environment);
|
|
67
75
|
const mode = dependencyMode(environment);
|
|
68
|
-
|
|
76
|
+
const file = statSync(manifest.modelPath, { throwIfNoEntry: false });
|
|
77
|
+
if (!file) {
|
|
78
|
+
const dangling = lstatSync(manifest.modelPath, {
|
|
79
|
+
throwIfNoEntry: false
|
|
80
|
+
})?.isSymbolicLink();
|
|
69
81
|
return {
|
|
70
82
|
state: "missing",
|
|
71
|
-
message: `${manifest.key} model is not installed at ${manifest.modelPath}.`,
|
|
83
|
+
message: dangling ? `${manifest.key} model link at ${manifest.modelPath} points to a missing file.` : `${manifest.key} model is not installed at ${manifest.modelPath}.`,
|
|
72
84
|
action: mode === "external" ? modelDownloadBlockedAction(manifest) : `Run koed models install --kind ${kind}. Override ${manifest.urlEnv} and ${manifest.sha256Env} only when using a custom model artifact.`,
|
|
73
85
|
modelPath: manifest.modelPath,
|
|
74
86
|
manifest
|
|
75
87
|
};
|
|
76
88
|
}
|
|
77
|
-
|
|
89
|
+
if (!file.isFile())
|
|
90
|
+
throw new Error("The installed model must be a regular file.");
|
|
91
|
+
const sizeBytes = file.size;
|
|
78
92
|
if (!manifest.sha256) {
|
|
79
93
|
return {
|
|
80
94
|
state: "not_configured",
|
|
@@ -85,7 +99,7 @@ var collectLocalModelStatus = async (paths, kind = "embedding", environment = pr
|
|
|
85
99
|
manifest
|
|
86
100
|
};
|
|
87
101
|
}
|
|
88
|
-
const actual = await sha256File(manifest.modelPath);
|
|
102
|
+
const actual = await sha256File(manifest.modelPath, signal);
|
|
89
103
|
if (actual !== manifest.sha256) {
|
|
90
104
|
return {
|
|
91
105
|
state: "checksum_mismatch",
|