@koed-labs/server 0.0.0-stage → 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/LICENSE +201 -0
- package/README.md +64 -2
- package/bin/koed.js +7 -0
- package/package.json +26 -4
- package/third-party-notices.json +92 -0
- package/vendor/chunk-2XKSVKQA.js +49 -0
- package/vendor/chunk-4OO6VAU3.js +259 -0
- package/vendor/chunk-53ZFCDHP.js +332 -0
- package/vendor/chunk-6JRWGOQG.js +236 -0
- package/vendor/chunk-6KS67EQE.js +75 -0
- package/vendor/chunk-7EGSY3E4.js +8 -0
- package/vendor/chunk-7FSHVVTZ.js +128 -0
- package/vendor/chunk-7NOQSX4T.js +14 -0
- package/vendor/chunk-7NXKPDF3.js +1586 -0
- package/vendor/chunk-ALJUSOF7.js +175 -0
- package/vendor/chunk-AVQCUFYQ.js +16 -0
- package/vendor/chunk-BGENSONI.js +18 -0
- package/vendor/chunk-BTS4ZTF3.js +43 -0
- package/vendor/chunk-BUIM2M4R.js +22 -0
- package/vendor/chunk-C4V72GXC.js +194 -0
- package/vendor/chunk-C5SNDPAP.js +2472 -0
- package/vendor/chunk-CHMH4LH5.js +2497 -0
- package/vendor/chunk-EA4QDDQA.js +58 -0
- package/vendor/chunk-EDPNYIX5.js +5448 -0
- package/vendor/chunk-FN3HUUO2.js +1974 -0
- package/vendor/chunk-FSNLU46W.js +14548 -0
- package/vendor/chunk-FYYRFX4U.js +4423 -0
- package/vendor/chunk-GFASBPV2.js +42 -0
- package/vendor/chunk-HC76426R.js +48 -0
- package/vendor/chunk-IY2HRXOZ.js +99 -0
- package/vendor/chunk-JBGD4JLR.js +3779 -0
- package/vendor/chunk-JYK6UL6D.js +261 -0
- package/vendor/chunk-LRP66XEY.js +13907 -0
- package/vendor/chunk-NOU7RHYZ.js +26 -0
- package/vendor/chunk-NVTMIAAF.js +113 -0
- package/vendor/chunk-O7DW2VAV.js +14 -0
- package/vendor/chunk-OCILJ737.js +299 -0
- package/vendor/chunk-PL3LWC5C.js +754 -0
- package/vendor/chunk-QRKHHWJJ.js +104 -0
- package/vendor/chunk-QT24SAW6.js +110 -0
- package/vendor/chunk-RCR4XPE3.js +26020 -0
- package/vendor/chunk-SHLRINKO.js +73 -0
- package/vendor/chunk-SNKWETM5.js +35 -0
- package/vendor/chunk-SRKIBFOE.js +242 -0
- package/vendor/chunk-T6UB5PNX.js +124 -0
- package/vendor/chunk-TG26CZGQ.js +23 -0
- package/vendor/chunk-TISYUUEJ.js +188 -0
- package/vendor/chunk-TSAYTRX3.js +89 -0
- package/vendor/chunk-TVYEB2GN.js +343 -0
- package/vendor/chunk-UB6JCVQ3.js +461 -0
- package/vendor/chunk-V67IQB7H.js +153 -0
- package/vendor/chunk-VGIYSDNU.js +522 -0
- package/vendor/chunk-W2HNI6AA.js +75 -0
- package/vendor/chunk-W2OJZZ6X.js +20 -0
- package/vendor/chunk-WDFERJG3.js +2208 -0
- package/vendor/chunk-WPIEF4LY.js +1647 -0
- package/vendor/chunk-XIZVLPHZ.js +18 -0
- package/vendor/chunk-YZLQZU5E.js +46 -0
- package/vendor/chunk-Z5WCAUA6.js +148 -0
- package/vendor/chunk-ZIOKV2X6.js +1589 -0
- package/vendor/chunk-ZOHNXUDY.js +12501 -0
- package/vendor/chunk-ZUDSZGVO.js +11 -0
- package/vendor/cli.js +7 -0
- package/vendor/component-manifest-catalog.js +9 -0
- package/vendor/control-plane.js +28 -0
- package/vendor/package.json +1 -0
- package/vendor/privacy-service-bootstrap.js +6 -0
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { createRequire as createKoedRequire } from "node:module"; const require = createKoedRequire(import.meta.url);
|
|
2
|
+
import {
|
|
3
|
+
getProjectTeamWorkspaceLink,
|
|
4
|
+
linkProjectTeamWorkspace,
|
|
5
|
+
listProjectTeamWorkspaceLinks,
|
|
6
|
+
removeProjectTeamWorkspaceLink,
|
|
7
|
+
removeProjectTeamWorkspaceLinksForBackend,
|
|
8
|
+
removeProjectTeamWorkspaceLinksForMismatchedBinding
|
|
9
|
+
} from "./chunk-6JRWGOQG.js";
|
|
10
|
+
import "./chunk-BTS4ZTF3.js";
|
|
11
|
+
export {
|
|
12
|
+
getProjectTeamWorkspaceLink,
|
|
13
|
+
linkProjectTeamWorkspace,
|
|
14
|
+
listProjectTeamWorkspaceLinks,
|
|
15
|
+
removeProjectTeamWorkspaceLink,
|
|
16
|
+
removeProjectTeamWorkspaceLinksForBackend,
|
|
17
|
+
removeProjectTeamWorkspaceLinksForMismatchedBinding
|
|
18
|
+
};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { createRequire as createKoedRequire } from "node:module"; const require = createKoedRequire(import.meta.url);
|
|
2
|
+
|
|
3
|
+
// packages/koed-server/dist/runtime-artifact-source.js
|
|
4
|
+
import { lstatSync, readlinkSync } from "node:fs";
|
|
5
|
+
import { resolve } from "node:path";
|
|
6
|
+
var runtimeProcess = process;
|
|
7
|
+
var trimRuntimeValue = (value) => {
|
|
8
|
+
const trimmed = value?.trim();
|
|
9
|
+
return trimmed ? trimmed : void 0;
|
|
10
|
+
};
|
|
11
|
+
var isPackagedRuntimeMode = (environment = process.env) => environment.KOED_PACKAGED_DESKTOP === "1";
|
|
12
|
+
var allowsPackagedSourceFallback = (environment = process.env) => environment.KOED_ALLOW_PACKAGED_SOURCE_FALLBACK === "1";
|
|
13
|
+
var canUseSourceCheckoutFallback = (environment = process.env) => !isPackagedRuntimeMode(environment) || allowsPackagedSourceFallback(environment);
|
|
14
|
+
var resolvePackagedResourcesPath = (environment = process.env) => {
|
|
15
|
+
const explicit = trimRuntimeValue(environment.KOED_PACKAGED_RESOURCES_PATH);
|
|
16
|
+
if (explicit) {
|
|
17
|
+
return resolve(explicit);
|
|
18
|
+
}
|
|
19
|
+
return runtimeProcess.resourcesPath ? resolve(runtimeProcess.resourcesPath) : void 0;
|
|
20
|
+
};
|
|
21
|
+
var resolvePackagedKoedRuntimeRoot = (environment = process.env) => {
|
|
22
|
+
const resourcesPath = resolvePackagedResourcesPath(environment);
|
|
23
|
+
return resourcesPath ? resolve(resourcesPath, "koed-runtime") : void 0;
|
|
24
|
+
};
|
|
25
|
+
function hasReleaseRuntime(paths) {
|
|
26
|
+
const runtime = resolve(paths.koedHome, "runtime");
|
|
27
|
+
if (lstatSync(resolve(runtime, "native"), { throwIfNoEntry: false }))
|
|
28
|
+
return true;
|
|
29
|
+
return ["postgres", "llama.cpp"].some((name) => {
|
|
30
|
+
const path = resolve(runtime, name);
|
|
31
|
+
return lstatSync(path, { throwIfNoEntry: false })?.isSymbolicLink() && readlinkSync(path) === `native/current/${name}`;
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
function assertNoReleaseRuntime(paths) {
|
|
35
|
+
if (hasReleaseRuntime(paths))
|
|
36
|
+
throw new Error("The release provider owns this runtime. Use koed runtime install --provider release --dependency-mode bundled-local or a fresh KOED_HOME.");
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export {
|
|
40
|
+
isPackagedRuntimeMode,
|
|
41
|
+
canUseSourceCheckoutFallback,
|
|
42
|
+
resolvePackagedResourcesPath,
|
|
43
|
+
resolvePackagedKoedRuntimeRoot,
|
|
44
|
+
hasReleaseRuntime,
|
|
45
|
+
assertNoReleaseRuntime
|
|
46
|
+
};
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
import { createRequire as createKoedRequire } from "node:module"; const require = createKoedRequire(import.meta.url);
|
|
2
|
+
import {
|
|
3
|
+
checkCoreSetupNeeded,
|
|
4
|
+
createCliServiceContext,
|
|
5
|
+
getNoAgentsWarning,
|
|
6
|
+
persistDoctorVerification,
|
|
7
|
+
printJson,
|
|
8
|
+
safeLifecycle
|
|
9
|
+
} from "./chunk-WDFERJG3.js";
|
|
10
|
+
import "./chunk-SHLRINKO.js";
|
|
11
|
+
import "./chunk-CHMH4LH5.js";
|
|
12
|
+
import "./chunk-EA4QDDQA.js";
|
|
13
|
+
import "./chunk-JYK6UL6D.js";
|
|
14
|
+
import "./chunk-WPIEF4LY.js";
|
|
15
|
+
import "./chunk-EDPNYIX5.js";
|
|
16
|
+
import "./chunk-QT24SAW6.js";
|
|
17
|
+
import "./chunk-TISYUUEJ.js";
|
|
18
|
+
import "./chunk-ALJUSOF7.js";
|
|
19
|
+
import "./chunk-SRKIBFOE.js";
|
|
20
|
+
import "./chunk-7FSHVVTZ.js";
|
|
21
|
+
import "./chunk-TSAYTRX3.js";
|
|
22
|
+
import "./chunk-YZLQZU5E.js";
|
|
23
|
+
import "./chunk-W2HNI6AA.js";
|
|
24
|
+
import "./chunk-V67IQB7H.js";
|
|
25
|
+
import "./chunk-FN3HUUO2.js";
|
|
26
|
+
import "./chunk-T6UB5PNX.js";
|
|
27
|
+
import "./chunk-7NXKPDF3.js";
|
|
28
|
+
import "./chunk-ZUDSZGVO.js";
|
|
29
|
+
import "./chunk-ZIOKV2X6.js";
|
|
30
|
+
import "./chunk-QRKHHWJJ.js";
|
|
31
|
+
import "./chunk-7EGSY3E4.js";
|
|
32
|
+
import "./chunk-IY2HRXOZ.js";
|
|
33
|
+
import "./chunk-4OO6VAU3.js";
|
|
34
|
+
import "./chunk-RCR4XPE3.js";
|
|
35
|
+
import "./chunk-ZOHNXUDY.js";
|
|
36
|
+
import "./chunk-FSNLU46W.js";
|
|
37
|
+
import "./chunk-BTS4ZTF3.js";
|
|
38
|
+
|
|
39
|
+
// packages/koed-server/dist/cli-lifecycle-operations.js
|
|
40
|
+
var runLifecycleCommand = async (command, options, dependencies) => {
|
|
41
|
+
const { collectStatus, collectStartupStatus, collectDoctor, inspectDeviceIdentity, rotateIdentity, invalidateEnrollmentReferences, start, startDaemon, stop, restart, resolvePaths, stdout, stderr } = createCliServiceContext(dependencies);
|
|
42
|
+
const wantsJson = options.json;
|
|
43
|
+
const subcommand = options.identityAction;
|
|
44
|
+
try {
|
|
45
|
+
if (command === "status") {
|
|
46
|
+
const paths = resolvePaths();
|
|
47
|
+
const setupNeeded = checkCoreSetupNeeded(paths);
|
|
48
|
+
if (setupNeeded) {
|
|
49
|
+
stderr.write(`${setupNeeded}
|
|
50
|
+
`);
|
|
51
|
+
return 1;
|
|
52
|
+
}
|
|
53
|
+
const isStartup = Boolean(options.startup);
|
|
54
|
+
const status = isStartup ? await collectStartupStatus() : await collectStatus();
|
|
55
|
+
if (wantsJson) {
|
|
56
|
+
printJson(stdout, isStartup ? status : { ...status, lifecycle: safeLifecycle(paths) });
|
|
57
|
+
} else {
|
|
58
|
+
stdout.write(`${status.state}
|
|
59
|
+
`);
|
|
60
|
+
if (!isStartup && "codex" in status) {
|
|
61
|
+
const warning = getNoAgentsWarning(status);
|
|
62
|
+
if (warning)
|
|
63
|
+
stdout.write(`Warning: ${warning}
|
|
64
|
+
`);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
return 0;
|
|
68
|
+
}
|
|
69
|
+
if (command === "doctor") {
|
|
70
|
+
const doctor = await collectDoctor();
|
|
71
|
+
persistDoctorVerification(resolvePaths(), doctor);
|
|
72
|
+
if (wantsJson) {
|
|
73
|
+
printJson(stdout, doctor);
|
|
74
|
+
} else {
|
|
75
|
+
stdout.write(`${doctor.summary}
|
|
76
|
+
`);
|
|
77
|
+
const status = await collectStatus();
|
|
78
|
+
const warning = getNoAgentsWarning(status);
|
|
79
|
+
if (warning)
|
|
80
|
+
stdout.write(`Warning: ${warning}
|
|
81
|
+
`);
|
|
82
|
+
}
|
|
83
|
+
return doctor.ok ? 0 : 1;
|
|
84
|
+
}
|
|
85
|
+
if (command === "identity") {
|
|
86
|
+
const paths = resolvePaths();
|
|
87
|
+
const identity = subcommand === "status" ? await inspectDeviceIdentity(paths) : subcommand === "rotate" ? await rotateIdentity(paths, {
|
|
88
|
+
invalidateRemoteReferences: () => invalidateEnrollmentReferences(paths)
|
|
89
|
+
}) : null;
|
|
90
|
+
if (!identity) {
|
|
91
|
+
throw new Error("identity command must be status or rotate.");
|
|
92
|
+
}
|
|
93
|
+
if (wantsJson) {
|
|
94
|
+
printJson(stdout, identity);
|
|
95
|
+
} else {
|
|
96
|
+
stdout.write(`${identity.health}
|
|
97
|
+
`);
|
|
98
|
+
}
|
|
99
|
+
return identity.remoteOperationsAllowed ? 0 : 1;
|
|
100
|
+
}
|
|
101
|
+
if (command === "start") {
|
|
102
|
+
if (options.daemon) {
|
|
103
|
+
const result = startDaemon();
|
|
104
|
+
if (wantsJson) {
|
|
105
|
+
printJson(stdout, result);
|
|
106
|
+
} else {
|
|
107
|
+
stdout.write(`${result.message}
|
|
108
|
+
`);
|
|
109
|
+
}
|
|
110
|
+
return result.ok ? 0 : 1;
|
|
111
|
+
}
|
|
112
|
+
await start();
|
|
113
|
+
return 0;
|
|
114
|
+
}
|
|
115
|
+
if (command === "stop") {
|
|
116
|
+
const result = stop();
|
|
117
|
+
if (wantsJson) {
|
|
118
|
+
printJson(stdout, result);
|
|
119
|
+
} else {
|
|
120
|
+
stdout.write(`${result.message}
|
|
121
|
+
`);
|
|
122
|
+
}
|
|
123
|
+
return result.ok ? 0 : 1;
|
|
124
|
+
}
|
|
125
|
+
if (command === "restart") {
|
|
126
|
+
const result = await restart();
|
|
127
|
+
if (wantsJson) {
|
|
128
|
+
printJson(stdout, result);
|
|
129
|
+
} else {
|
|
130
|
+
stdout.write(`${result.message}
|
|
131
|
+
`);
|
|
132
|
+
}
|
|
133
|
+
return result.ok ? 0 : 1;
|
|
134
|
+
}
|
|
135
|
+
throw new Error("Unknown lifecycle operation.");
|
|
136
|
+
} catch (error) {
|
|
137
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
138
|
+
if (wantsJson)
|
|
139
|
+
printJson(stdout, { ok: false, error: message });
|
|
140
|
+
else
|
|
141
|
+
stderr.write(`${message}
|
|
142
|
+
`);
|
|
143
|
+
return 1;
|
|
144
|
+
}
|
|
145
|
+
};
|
|
146
|
+
export {
|
|
147
|
+
runLifecycleCommand
|
|
148
|
+
};
|