@cotal-ai/workspace 0.109.25 → 0.110.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/build/Release/darwin-arm64/build.json +1 -1
- package/build/Release/darwin-x64/build.json +1 -1
- package/build/Release/win32-arm64/build.json +1 -1
- package/build/Release/win32-x64/build.json +1 -1
- package/dist/deprecated-daemon-entries.d.ts +3 -0
- package/dist/deprecated-daemon-entries.d.ts.map +1 -1
- package/dist/deprecated-daemon-entries.js +16 -4
- package/dist/deprecated-daemon-entries.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/space-host.d.ts +50 -0
- package/dist/space-host.d.ts.map +1 -0
- package/dist/space-host.js +230 -0
- package/dist/space-host.js.map +1 -0
- package/package.json +2 -2
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"platform": "darwin",
|
|
4
4
|
"arch": "arm64",
|
|
5
5
|
"nodeApi": 8,
|
|
6
|
-
"source": "
|
|
6
|
+
"source": "81c3d61635a9daec8ddec901f67736d37cdf3231",
|
|
7
7
|
"sourceHashes": {
|
|
8
8
|
"native/win32-process.c": "889b215135b60dd3a45096737a3219ce114bc424e4b6cce42624f0913f8447dc",
|
|
9
9
|
"native/win32-system-id.cpp": "2dd51f24425e8239aeac1aae01e67f43264f04f09cd9097a12d288be7a84e074",
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"platform": "darwin",
|
|
4
4
|
"arch": "x64",
|
|
5
5
|
"nodeApi": 8,
|
|
6
|
-
"source": "
|
|
6
|
+
"source": "81c3d61635a9daec8ddec901f67736d37cdf3231",
|
|
7
7
|
"sourceHashes": {
|
|
8
8
|
"native/win32-process.c": "889b215135b60dd3a45096737a3219ce114bc424e4b6cce42624f0913f8447dc",
|
|
9
9
|
"native/win32-system-id.cpp": "2dd51f24425e8239aeac1aae01e67f43264f04f09cd9097a12d288be7a84e074",
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"platform": "win32",
|
|
4
4
|
"arch": "arm64",
|
|
5
5
|
"nodeApi": 8,
|
|
6
|
-
"source": "
|
|
6
|
+
"source": "81c3d61635a9daec8ddec901f67736d37cdf3231",
|
|
7
7
|
"sourceHashes": {
|
|
8
8
|
"native/win32-process.c": "889b215135b60dd3a45096737a3219ce114bc424e4b6cce42624f0913f8447dc",
|
|
9
9
|
"native/win32-system-id.cpp": "2dd51f24425e8239aeac1aae01e67f43264f04f09cd9097a12d288be7a84e074",
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"platform": "win32",
|
|
4
4
|
"arch": "x64",
|
|
5
5
|
"nodeApi": 8,
|
|
6
|
-
"source": "
|
|
6
|
+
"source": "81c3d61635a9daec8ddec901f67736d37cdf3231",
|
|
7
7
|
"sourceHashes": {
|
|
8
8
|
"native/win32-process.c": "889b215135b60dd3a45096737a3219ce114bc424e4b6cce42624f0913f8447dc",
|
|
9
9
|
"native/win32-system-id.cpp": "2dd51f24425e8239aeac1aae01e67f43264f04f09cd9097a12d288be7a84e074",
|
|
@@ -14,6 +14,9 @@ export declare const DEPRECATED_MANAGER_ENTRY = "supervise";
|
|
|
14
14
|
/** The `supervise` flags `cotal manager start` has no form for yet. A run that names one is told
|
|
15
15
|
* to keep `supervise` for it, not pointed at a replacement that would drop the flag. */
|
|
16
16
|
export declare const SUPERVISE_ONLY_FLAGS: readonly ["execution", "spawn", "seat-cap", "resume-attempt", "resume-commit-token", "resume-commit-file", "resume-commit-sha256"];
|
|
17
|
+
/** The `deliver` flags the `delivery` service preset has no form for yet: the preset starts one
|
|
18
|
+
* space's daemon, and `--spaces` serves several from one process. */
|
|
19
|
+
export declare const DELIVER_ONLY_FLAGS: readonly ["spaces"];
|
|
17
20
|
/** The hidden twin `up` launches for each deprecated entry it still starts, and the manager's daemon
|
|
18
21
|
* entry. A twin is the entry's own declaration and runner without the warning, so only a persisted
|
|
19
22
|
* caller sees the warning. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deprecated-daemon-entries.d.ts","sourceRoot":"","sources":["../src/deprecated-daemon-entries.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAI1D;wDACwD;AACxD,eAAO,MAAM,4BAA4B,UAAU,CAAC;AAEpD,4EAA4E;AAC5E,eAAO,MAAM,yBAAyB;;;;CAI5B,CAAC;AAEX;iCACiC;AACjC,eAAO,MAAM,wBAAwB,cAAc,CAAC;AAEpD;yFACyF;AACzF,eAAO,MAAM,oBAAoB,oIAAqI,CAAC;AAEvK;;+BAE+B;AAC/B,eAAO,MAAM,kBAAkB;;;;CAIrB,CAAC;AAEX,iGAAiG;AACjG,MAAM,MAAM,qBAAqB,GAAG,MAAM,OAAO,yBAAyB,GAAG,OAAO,wBAAwB,GAAG,iBAAiB,CAAC;AAEjI;;wFAEwF;AACxF,wBAAgB,4BAA4B,CAAC,KAAK,EAAE,qBAAqB,EAAE,IAAI,GAAE,SAAS,MAAM,EAAO,GAAG,MAAM,
|
|
1
|
+
{"version":3,"file":"deprecated-daemon-entries.d.ts","sourceRoot":"","sources":["../src/deprecated-daemon-entries.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAI1D;wDACwD;AACxD,eAAO,MAAM,4BAA4B,UAAU,CAAC;AAEpD,4EAA4E;AAC5E,eAAO,MAAM,yBAAyB;;;;CAI5B,CAAC;AAEX;iCACiC;AACjC,eAAO,MAAM,wBAAwB,cAAc,CAAC;AAEpD;yFACyF;AACzF,eAAO,MAAM,oBAAoB,oIAAqI,CAAC;AAEvK;sEACsE;AACtE,eAAO,MAAM,kBAAkB,qBAAsB,CAAC;AAQtD;;+BAE+B;AAC/B,eAAO,MAAM,kBAAkB;;;;CAIrB,CAAC;AAEX,iGAAiG;AACjG,MAAM,MAAM,qBAAqB,GAAG,MAAM,OAAO,yBAAyB,GAAG,OAAO,wBAAwB,GAAG,iBAAiB,CAAC;AAEjI;;wFAEwF;AACxF,wBAAgB,4BAA4B,CAAC,KAAK,EAAE,qBAAqB,EAAE,IAAI,GAAE,SAAS,MAAM,EAAO,GAAG,MAAM,CAW/G;AAED;uCACuC;AACvC,wBAAgB,4BAA4B,CAAC,KAAK,EAAE,MAAM,OAAO,yBAAyB,GAAG,OAAO,wBAAwB,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CAGrJ;AAED;uFACuF;AACvF,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,qBAAqB,EAAE,IAAI,GAAE,SAAS,MAAM,EAAO,GAAG,IAAI,CAG1G;AAED;;iEAEiE;AACjE,wBAAgB,qBAAqB,CACnC,KAAK,EAAE,MAAM,OAAO,kBAAkB,EACtC,IAAI,EAAE,OAAO,EACb,OAAO,GAAE,CAAC,IAAI,EAAE,UAAU,KAAK,qBAAmC,GACjE,OAAO,CAQT"}
|
|
@@ -15,6 +15,14 @@ export const DEPRECATED_MANAGER_ENTRY = "supervise";
|
|
|
15
15
|
/** The `supervise` flags `cotal manager start` has no form for yet. A run that names one is told
|
|
16
16
|
* to keep `supervise` for it, not pointed at a replacement that would drop the flag. */
|
|
17
17
|
export const SUPERVISE_ONLY_FLAGS = ["execution", "spawn", "seat-cap", "resume-attempt", "resume-commit-token", "resume-commit-file", "resume-commit-sha256"];
|
|
18
|
+
/** The `deliver` flags the `delivery` service preset has no form for yet: the preset starts one
|
|
19
|
+
* space's daemon, and `--spaces` serves several from one process. */
|
|
20
|
+
export const DELIVER_ONLY_FLAGS = ["spaces"];
|
|
21
|
+
/** Per entry, the flags its replacement has no form for. */
|
|
22
|
+
const ENTRY_ONLY_FLAGS = {
|
|
23
|
+
[DEPRECATED_MANAGER_ENTRY]: SUPERVISE_ONLY_FLAGS,
|
|
24
|
+
deliver: DELIVER_ONLY_FLAGS,
|
|
25
|
+
};
|
|
18
26
|
/** The hidden twin `up` launches for each deprecated entry it still starts, and the manager's daemon
|
|
19
27
|
* entry. A twin is the entry's own declaration and runner without the warning, so only a persisted
|
|
20
28
|
* caller sees the warning. */
|
|
@@ -27,8 +35,10 @@ export const DAEMON_ENTRY_TWINS = {
|
|
|
27
35
|
* release; the entry keeps its argv, behavior and exit code. `kept` names the flags of this run the
|
|
28
36
|
* replacement has no form for, so the line says to keep the entry for them instead. */
|
|
29
37
|
export function deprecatedDaemonEntryWarning(entry, kept = []) {
|
|
30
|
-
if (kept.length)
|
|
31
|
-
|
|
38
|
+
if (kept.length) {
|
|
39
|
+
const lacking = entry === DEPRECATED_MANAGER_ENTRY ? "cotal manager start" : entry === "deliver pending" ? "cotal pending" : `cotal service start ${DEPRECATED_DAEMON_PRESETS[entry]}`;
|
|
40
|
+
return `! \`cotal ${entry}\` is deprecated and will be removed in ${DAEMON_ENTRY_REMOVAL_RELEASE}. \`${lacking}\` has no ${kept.map((flag) => `--${flag}`).join(", ")} yet, so keep \`cotal ${entry}\` for this run until it does.`;
|
|
41
|
+
}
|
|
32
42
|
const replacement = entry === "deliver pending"
|
|
33
43
|
? "`cotal pending <agent>`"
|
|
34
44
|
: entry === DEPRECATED_MANAGER_ENTRY
|
|
@@ -53,8 +63,10 @@ export function warnDeprecatedDaemonEntry(entry, kept = []) {
|
|
|
53
63
|
* that names its own replacement, such as `deliver pending`. */
|
|
54
64
|
export function deprecatedDaemonEntry(entry, twin, warning = () => entry) {
|
|
55
65
|
return { ...twin, name: entry, summary: deprecatedDaemonEntrySummary(entry, twin.summary), run: (args) => {
|
|
56
|
-
const
|
|
57
|
-
|
|
66
|
+
const shown = warning(args);
|
|
67
|
+
// A mode with its own replacement, such as `deliver pending`, keeps nothing of the entry's.
|
|
68
|
+
const kept = shown === entry ? (ENTRY_ONLY_FLAGS[entry] ?? []).filter((flag) => args.values[flag] !== undefined) : [];
|
|
69
|
+
warnDeprecatedDaemonEntry(shown, kept);
|
|
58
70
|
return twin.run(args);
|
|
59
71
|
} };
|
|
60
72
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deprecated-daemon-entries.js","sourceRoot":"","sources":["../src/deprecated-daemon-entries.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,aAAa,CAAC;AAChC,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAE1D;wDACwD;AACxD,MAAM,CAAC,MAAM,4BAA4B,GAAG,OAAO,CAAC;AAEpD,4EAA4E;AAC5E,MAAM,CAAC,MAAM,yBAAyB,GAAG;IACvC,OAAO,EAAE,UAAU;IACnB,cAAc,EAAE,cAAc;IAC9B,iBAAiB,EAAE,iBAAiB;CAC5B,CAAC;AAEX;iCACiC;AACjC,MAAM,CAAC,MAAM,wBAAwB,GAAG,WAAW,CAAC;AAEpD;yFACyF;AACzF,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,WAAW,EAAE,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,oBAAoB,EAAE,sBAAsB,CAAU,CAAC;AAEvK;;+BAE+B;AAC/B,MAAM,CAAC,MAAM,kBAAkB,GAAG;IAChC,OAAO,EAAE,kBAAkB;IAC3B,cAAc,EAAE,uBAAuB;IACvC,CAAC,wBAAwB,CAAC,EAAE,kBAAkB;CACtC,CAAC;AAKX;;wFAEwF;AACxF,MAAM,UAAU,4BAA4B,CAAC,KAA4B,EAAE,OAA0B,EAAE;IACrG,IAAI,IAAI,CAAC,MAAM;
|
|
1
|
+
{"version":3,"file":"deprecated-daemon-entries.js","sourceRoot":"","sources":["../src/deprecated-daemon-entries.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,aAAa,CAAC;AAChC,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAE1D;wDACwD;AACxD,MAAM,CAAC,MAAM,4BAA4B,GAAG,OAAO,CAAC;AAEpD,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,4BAA4B,CAAC,KAAK,EAAE,IAAI,CAAC,OAAO,CAAC,EAAE,GAAG,EAAE,CAAC,IAAI,EAAE,EAAE;YACvG,MAAM,KAAK,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;YAC5B,4FAA4F;YAC5F,MAAM,IAAI,GAAG,KAAK,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC,gBAAgB,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,SAAS,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;YACtH,yBAAyB,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;YACvC,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QACxB,CAAC,EAAE,CAAC;AACN,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -44,6 +44,7 @@ export * from "./secret-store-fs.js";
|
|
|
44
44
|
export * from "./hosted-runtime.js";
|
|
45
45
|
export * from "./seat-checkpoint.js";
|
|
46
46
|
export * from "./space.js";
|
|
47
|
+
export * from "./space-host.js";
|
|
47
48
|
export * from "./space-segmentation.js";
|
|
48
49
|
export * from "./system-rotation.js";
|
|
49
50
|
export * from "./telemetry.js";
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,yBAAyB,CAAC;AACxC,cAAc,iBAAiB,CAAC;AAChC,cAAc,oBAAoB,CAAC;AACnC,cAAc,mBAAmB,CAAC;AAClC,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cA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,KAAK,aAAa,EAAE,KAAK,YAAY,EAAE,MAAM,oBAAoB,CAAC;AACnK,cAAc,eAAe,CAAC;AAC9B,cAAc,yBAAyB,CAAC;AACxC,cAAc,sBAAsB,CAAC;AACrC,cAAc,qBAAqB,CAAC;AACpC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,sBAAsB,CAAC;AACrC,cAAc,sBAAsB,CAAC;AACrC,cAAc,uBAAuB,CAAC;AACtC,cAAc,mBAAmB,CAAC;AAClC,cAAc,0BAA0B,CAAC;AACzC,cAAc,qBAAqB,CAAC;AACpC,cAAc,iCAAiC,CAAC;AAChD,cAAc,wBAAwB,CAAC;AACvC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,qBAAqB,CAAC;AAEpC,cAAc,wBAAwB,CAAC;AACvC,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,yBAAyB,CAAC;AACxC,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC;AACrC,cAAc,0BAA0B,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -46,6 +46,7 @@ export * from "./secret-store-fs.js";
|
|
|
46
46
|
export * from "./hosted-runtime.js";
|
|
47
47
|
export * from "./seat-checkpoint.js";
|
|
48
48
|
export * from "./space.js";
|
|
49
|
+
export * from "./space-host.js";
|
|
49
50
|
export * from "./space-segmentation.js";
|
|
50
51
|
export * from "./system-rotation.js";
|
|
51
52
|
export * from "./telemetry.js";
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,yBAAyB,CAAC;AACxC,cAAc,iBAAiB,CAAC;AAChC,cAAc,oBAAoB,CAAC;AACnC,cAAc,mBAAmB,CAAC;AAClC,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7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AC;AAC9B,cAAc,yBAAyB,CAAC;AACxC,cAAc,sBAAsB,CAAC;AACrC,cAAc,qBAAqB,CAAC;AACpC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,sBAAsB,CAAC;AACrC,cAAc,sBAAsB,CAAC;AACrC,cAAc,uBAAuB,CAAC;AACtC,cAAc,mBAAmB,CAAC;AAClC,cAAc,0BAA0B,CAAC;AACzC,cAAc,qBAAqB,CAAC;AACpC,cAAc,iCAAiC,CAAC;AAChD,cAAc,wBAAwB,CAAC;AACvC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,qBAAqB,CAAC;AAEpC,cAAc,wBAAwB,CAAC;AACvC,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,yBAAyB,CAAC;AACxC,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC;AACrC,cAAc,0BAA0B,CAAC"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/** The manifest naming the spaces one host serves. Entries are space names: every lane of a host
|
|
2
|
+
* dials the one `--server`, so a deployment whose spaces live on different brokers runs one host
|
|
3
|
+
* process per broker. */
|
|
4
|
+
export interface SpaceManifest {
|
|
5
|
+
version: 1;
|
|
6
|
+
spaces: string[];
|
|
7
|
+
}
|
|
8
|
+
/** One space's lane, as a host holds it. */
|
|
9
|
+
export interface SpaceLane {
|
|
10
|
+
readonly space: string;
|
|
11
|
+
/** Settles with what this lane lost once it stops serving, by {@link close} or by a loss. It never
|
|
12
|
+
* rejects: a holder distinguishes the two by whether it asked for the close. */
|
|
13
|
+
readonly lost: Promise<string>;
|
|
14
|
+
/** Stop serving and release everything the lane holds. Safe to call more than once. */
|
|
15
|
+
close(): Promise<void>;
|
|
16
|
+
}
|
|
17
|
+
/** What a multi-space daemon supplies to {@link runSpaceHost}. */
|
|
18
|
+
export interface SpaceHostOptions {
|
|
19
|
+
/** Path of the manifest file. */
|
|
20
|
+
manifest: string;
|
|
21
|
+
/** Open one space's lane, or throw naming why the space cannot be served. */
|
|
22
|
+
open(space: string): Promise<SpaceLane>;
|
|
23
|
+
/** Names the host in its log lines, such as `auth callout host`. */
|
|
24
|
+
label: string;
|
|
25
|
+
/** Names the command in a startup refusal, such as `auth-service --callout-only --spaces`. */
|
|
26
|
+
entry: string;
|
|
27
|
+
/** What a lane does while it is up, for the loss line: `answering`, `serving`. */
|
|
28
|
+
serving: string;
|
|
29
|
+
/** Called once when SIGINT or SIGTERM starts the stop, before any lane closes. */
|
|
30
|
+
onStop?: (signal: NodeJS.Signals) => void;
|
|
31
|
+
/** Diagnostics sink. Default `console.error`. */
|
|
32
|
+
log?: (line: string) => void;
|
|
33
|
+
}
|
|
34
|
+
/** A started host. `ended` resolves with the exit code once a signal has closed every lane. */
|
|
35
|
+
export interface SpaceHost {
|
|
36
|
+
readonly lanes: ReadonlyMap<string, SpaceLane>;
|
|
37
|
+
readonly ended: Promise<number>;
|
|
38
|
+
}
|
|
39
|
+
/** Parse a space manifest. Throws with what is wrong: the caller keeps its live lanes rather than
|
|
40
|
+
* acting on a file it could not read whole. */
|
|
41
|
+
export declare function parseSpaceManifest(text: string): SpaceManifest;
|
|
42
|
+
/** Read and parse the manifest at `path`. The error names the path, so a host log line is legible
|
|
43
|
+
* without the operator correlating it. */
|
|
44
|
+
export declare function readSpaceManifest(path: string): SpaceManifest;
|
|
45
|
+
/** Open a lane for every space in the manifest, then keep the live lanes equal to the manifest until
|
|
46
|
+
* a signal stops the host. Every space must open at startup: one that cannot is a configuration
|
|
47
|
+
* error naming the space, and no lane is left running. Returns once startup has succeeded; the
|
|
48
|
+
* caller prints its ready line and exits with `ended`. */
|
|
49
|
+
export declare function runSpaceHost(options: SpaceHostOptions): Promise<SpaceHost>;
|
|
50
|
+
//# sourceMappingURL=space-host.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"space-host.d.ts","sourceRoot":"","sources":["../src/space-host.ts"],"names":[],"mappings":"AAyBA;;0BAE0B;A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,SAAS,CAAC,CAwIhF"}
|
|
@@ -0,0 +1,230 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* One process holding one lane per space named in a manifest file. The auth callout host
|
|
3
|
+
* (`cotal auth-service --callout-only --spaces <manifest>`) and the delivery host
|
|
4
|
+
* (`cotal deliver --spaces <manifest>`) both run on this, so the manifest grammar and the lane
|
|
5
|
+
* lifecycle are one piece of code for every multi-space daemon.
|
|
6
|
+
*
|
|
7
|
+
* A lane is whatever the caller opens for one space. The host shares nothing between lanes but the
|
|
8
|
+
* process: a lane that ends leaves the map and the others keep serving.
|
|
9
|
+
*
|
|
10
|
+
* One reconcile function is the whole lifecycle: it diffs the manifest against the live lanes and
|
|
11
|
+
* opens or closes the difference. It runs when the manifest changes on disk, on `SIGHUP`, when a
|
|
12
|
+
* lane is lost, after a short fixed wait when a lane failed to open, and on a slow backstop
|
|
13
|
+
* interval. A manifest that does not read or parse whole leaves the live lanes alone.
|
|
14
|
+
*/
|
|
15
|
+
import { readFileSync, watch } from "node:fs";
|
|
16
|
+
import { basename, dirname, resolve } from "node:path";
|
|
17
|
+
/** How long after a lane fails to open the host tries it again. One fixed wait, never a growing
|
|
18
|
+
* backoff, and the log line that reports the failure names it. */
|
|
19
|
+
const REOPEN_WAIT_SECONDS = 5;
|
|
20
|
+
/** The backstop reconcile. A lost lane and a changed manifest each reconcile at once, so this only
|
|
21
|
+
* catches a change no watch reported. */
|
|
22
|
+
const BACKSTOP_INTERVAL_SECONDS = 60;
|
|
23
|
+
/** Parse a space manifest. Throws with what is wrong: the caller keeps its live lanes rather than
|
|
24
|
+
* acting on a file it could not read whole. */
|
|
25
|
+
export function parseSpaceManifest(text) {
|
|
26
|
+
let doc;
|
|
27
|
+
try {
|
|
28
|
+
doc = JSON.parse(text);
|
|
29
|
+
}
|
|
30
|
+
catch (e) {
|
|
31
|
+
throw new Error(`not whole or not JSON (${e instanceof Error ? e.message : String(e)})`);
|
|
32
|
+
}
|
|
33
|
+
if (typeof doc !== "object" || doc === null || Array.isArray(doc))
|
|
34
|
+
throw new Error("the manifest must be a JSON object");
|
|
35
|
+
const keys = Object.keys(doc);
|
|
36
|
+
const unknown = keys.filter((k) => k !== "version" && k !== "spaces");
|
|
37
|
+
if (unknown.length)
|
|
38
|
+
throw new Error(`unknown field(s) ${unknown.join(", ")}; the manifest takes version and spaces`);
|
|
39
|
+
const { version, spaces } = doc;
|
|
40
|
+
if (version !== 1)
|
|
41
|
+
throw new Error(`version must be 1, got ${JSON.stringify(version)}`);
|
|
42
|
+
if (!Array.isArray(spaces))
|
|
43
|
+
throw new Error("spaces must be an array of space names");
|
|
44
|
+
if (spaces.length === 0)
|
|
45
|
+
throw new Error("spaces is empty; a host serves at least one space");
|
|
46
|
+
for (const entry of spaces) {
|
|
47
|
+
if (typeof entry !== "string")
|
|
48
|
+
throw new Error(`every entry of spaces must be a space name string, got ${JSON.stringify(entry)}; one host serves one broker, so run one host per broker rather than naming a server per space`);
|
|
49
|
+
if (entry.trim() === "")
|
|
50
|
+
throw new Error("a space name is empty");
|
|
51
|
+
}
|
|
52
|
+
const seen = new Set();
|
|
53
|
+
for (const entry of spaces) {
|
|
54
|
+
if (seen.has(entry))
|
|
55
|
+
throw new Error(`space ${JSON.stringify(entry)} is named more than once`);
|
|
56
|
+
seen.add(entry);
|
|
57
|
+
}
|
|
58
|
+
return { version: 1, spaces: spaces };
|
|
59
|
+
}
|
|
60
|
+
/** Read and parse the manifest at `path`. The error names the path, so a host log line is legible
|
|
61
|
+
* without the operator correlating it. */
|
|
62
|
+
export function readSpaceManifest(path) {
|
|
63
|
+
let text;
|
|
64
|
+
try {
|
|
65
|
+
text = readFileSync(path, "utf8");
|
|
66
|
+
}
|
|
67
|
+
catch (e) {
|
|
68
|
+
throw new Error(`${path} could not be read (${e instanceof Error ? e.message : String(e)})`);
|
|
69
|
+
}
|
|
70
|
+
try {
|
|
71
|
+
return parseSpaceManifest(text);
|
|
72
|
+
}
|
|
73
|
+
catch (e) {
|
|
74
|
+
throw new Error(`${path} is invalid: ${e instanceof Error ? e.message : String(e)}`);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
/** Open a lane for every space in the manifest, then keep the live lanes equal to the manifest until
|
|
78
|
+
* a signal stops the host. Every space must open at startup: one that cannot is a configuration
|
|
79
|
+
* error naming the space, and no lane is left running. Returns once startup has succeeded; the
|
|
80
|
+
* caller prints its ready line and exits with `ended`. */
|
|
81
|
+
export async function runSpaceHost(options) {
|
|
82
|
+
const { label } = options;
|
|
83
|
+
const manifestPath = resolve(options.manifest);
|
|
84
|
+
const log = options.log ?? ((l) => console.error(l));
|
|
85
|
+
const lanes = new Map();
|
|
86
|
+
let stopping = false;
|
|
87
|
+
/** Watch one lane for a loss. A lane the host deliberately removed is no longer the map's lane for
|
|
88
|
+
* its space, so its settled `lost` is ignored rather than read as a failure to recover from. */
|
|
89
|
+
const watchLane = (lane) => {
|
|
90
|
+
void lane.lost.then((what) => {
|
|
91
|
+
if (stopping || lanes.get(lane.space) !== lane)
|
|
92
|
+
return;
|
|
93
|
+
lanes.delete(lane.space);
|
|
94
|
+
log(`✗ ${label}: space "${lane.space}" lost ${what} - that lane stopped ${options.serving}; ${lanes.size} lane(s) still up`);
|
|
95
|
+
schedule(0);
|
|
96
|
+
});
|
|
97
|
+
};
|
|
98
|
+
const open = async (space) => {
|
|
99
|
+
const lane = await options.open(space);
|
|
100
|
+
lanes.set(space, lane);
|
|
101
|
+
watchLane(lane);
|
|
102
|
+
return lane;
|
|
103
|
+
};
|
|
104
|
+
// ---- reconcile: the one path that adds and removes a lane -------------------------------------
|
|
105
|
+
let reconciling = false;
|
|
106
|
+
let pending = false;
|
|
107
|
+
let retry;
|
|
108
|
+
const schedule = (seconds) => {
|
|
109
|
+
if (stopping)
|
|
110
|
+
return;
|
|
111
|
+
if (seconds === 0) {
|
|
112
|
+
void reconcile();
|
|
113
|
+
return;
|
|
114
|
+
}
|
|
115
|
+
if (retry !== undefined)
|
|
116
|
+
return;
|
|
117
|
+
retry = setTimeout(() => { retry = undefined; void reconcile(); }, seconds * 1000);
|
|
118
|
+
retry.unref();
|
|
119
|
+
};
|
|
120
|
+
const reconcile = async () => {
|
|
121
|
+
if (stopping)
|
|
122
|
+
return;
|
|
123
|
+
// One reconcile at a time: a second trigger during a slow open coalesces into one more pass.
|
|
124
|
+
if (reconciling) {
|
|
125
|
+
pending = true;
|
|
126
|
+
return;
|
|
127
|
+
}
|
|
128
|
+
reconciling = true;
|
|
129
|
+
try {
|
|
130
|
+
do {
|
|
131
|
+
pending = false;
|
|
132
|
+
let wanted;
|
|
133
|
+
try {
|
|
134
|
+
wanted = readSpaceManifest(manifestPath);
|
|
135
|
+
}
|
|
136
|
+
catch (e) {
|
|
137
|
+
log(`✗ ${label}: ${e instanceof Error ? e.message : String(e)} - keeping the ${lanes.size} lane(s) already open`);
|
|
138
|
+
return;
|
|
139
|
+
}
|
|
140
|
+
const want = new Set(wanted.spaces);
|
|
141
|
+
for (const [space, lane] of [...lanes]) {
|
|
142
|
+
if (want.has(space) || stopping)
|
|
143
|
+
continue;
|
|
144
|
+
// Out of the map before the close, so this lane's `lost` reads as the removal it is.
|
|
145
|
+
lanes.delete(space);
|
|
146
|
+
await lane.close().catch(() => { });
|
|
147
|
+
log(`${label}: space "${space}" left the manifest - closed its lane; ${lanes.size} lane(s) up`);
|
|
148
|
+
}
|
|
149
|
+
let failed = false;
|
|
150
|
+
for (const space of wanted.spaces) {
|
|
151
|
+
if (lanes.has(space) || stopping)
|
|
152
|
+
continue;
|
|
153
|
+
try {
|
|
154
|
+
await open(space);
|
|
155
|
+
log(`${label}: space "${space}" opened - ${lanes.size} lane(s) up`);
|
|
156
|
+
}
|
|
157
|
+
catch (e) {
|
|
158
|
+
failed = true;
|
|
159
|
+
log(`✗ ${label}: space "${space}" could not be served (${e instanceof Error ? e.message : String(e)}) - retrying in ${REOPEN_WAIT_SECONDS}s`);
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
if (failed)
|
|
163
|
+
schedule(REOPEN_WAIT_SECONDS);
|
|
164
|
+
} while (pending && !stopping);
|
|
165
|
+
}
|
|
166
|
+
finally {
|
|
167
|
+
reconciling = false;
|
|
168
|
+
}
|
|
169
|
+
};
|
|
170
|
+
// ---- startup: every space or none -------------------------------------------------------------
|
|
171
|
+
const initial = readSpaceManifest(manifestPath);
|
|
172
|
+
for (const space of initial.spaces) {
|
|
173
|
+
try {
|
|
174
|
+
await open(space);
|
|
175
|
+
}
|
|
176
|
+
catch (e) {
|
|
177
|
+
await Promise.all([...lanes.values()].map((lane) => lane.close().catch(() => { })));
|
|
178
|
+
lanes.clear();
|
|
179
|
+
throw new Error(`${options.entry}: space "${space}" could not be served (${e instanceof Error ? e.message : String(e)}) - no lane was left running`);
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
// ---- triggers ---------------------------------------------------------------------------------
|
|
183
|
+
// The manifest's DIRECTORY is watched, not the file: a provisioning backend that writes a new
|
|
184
|
+
// manifest and renames it into place replaces the inode, which a watch on the file alone stops
|
|
185
|
+
// reporting after the first change.
|
|
186
|
+
let watcher;
|
|
187
|
+
let debounce;
|
|
188
|
+
const name = basename(manifestPath);
|
|
189
|
+
try {
|
|
190
|
+
watcher = watch(dirname(manifestPath), (_event, changed) => {
|
|
191
|
+
if (changed !== null && changed !== name)
|
|
192
|
+
return;
|
|
193
|
+
if (debounce !== undefined)
|
|
194
|
+
clearTimeout(debounce);
|
|
195
|
+
debounce = setTimeout(() => { debounce = undefined; schedule(0); }, 100);
|
|
196
|
+
debounce.unref();
|
|
197
|
+
});
|
|
198
|
+
}
|
|
199
|
+
catch (e) {
|
|
200
|
+
await Promise.all([...lanes.values()].map((lane) => lane.close().catch(() => { })));
|
|
201
|
+
lanes.clear();
|
|
202
|
+
throw new Error(`${options.entry}: cannot watch ${dirname(manifestPath)} for manifest changes (${e instanceof Error ? e.message : String(e)})`);
|
|
203
|
+
}
|
|
204
|
+
const backstop = setInterval(() => schedule(0), BACKSTOP_INTERVAL_SECONDS * 1000);
|
|
205
|
+
backstop.unref();
|
|
206
|
+
const ended = new Promise((resolve_) => {
|
|
207
|
+
const stop = (signal) => () => {
|
|
208
|
+
if (stopping)
|
|
209
|
+
return;
|
|
210
|
+
stopping = true;
|
|
211
|
+
options.onStop?.(signal);
|
|
212
|
+
if (retry !== undefined)
|
|
213
|
+
clearTimeout(retry);
|
|
214
|
+
if (debounce !== undefined)
|
|
215
|
+
clearTimeout(debounce);
|
|
216
|
+
clearInterval(backstop);
|
|
217
|
+
watcher?.close();
|
|
218
|
+
// Every lane closes at once: one lane waiting on a slow broker must not hold the others open.
|
|
219
|
+
void Promise.all([...lanes.values()].map((lane) => lane.close().catch(() => { }))).then(() => {
|
|
220
|
+
lanes.clear();
|
|
221
|
+
resolve_(0);
|
|
222
|
+
});
|
|
223
|
+
};
|
|
224
|
+
process.on("SIGINT", stop("SIGINT"));
|
|
225
|
+
process.on("SIGTERM", stop("SIGTERM"));
|
|
226
|
+
process.on("SIGHUP", () => schedule(0));
|
|
227
|
+
});
|
|
228
|
+
return { lanes, ended };
|
|
229
|
+
}
|
|
230
|
+
//# sourceMappingURL=space-host.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"space-host.js","sourceRoot":"","sources":["../src/space-host.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,OAAO,EAAE,YAAY,EAAE,KAAK,EAAkB,MAAM,SAAS,CAAC;AAC9D,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEvD;mEACmE;AACnE,MAAM,mBAAmB,GAAG,CAAC,CAAC;AAE9B;0CAC0C;AAC1C,MAAM,yBAAyB,GAAG,EAAE,CAAC;AA4CrC;gDACgD;AAChD,MAAM,UAAU,kBAAkB,CAAC,IAAY;IAC7C,IAAI,GAAY,CAAC;IACjB,IAAI,CAAC;QACH,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAY,CAAC;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,EAAE,EAAE,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC,KAAK,CAAC,GAAG,EAAE,GAAE,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE;gBAC1F,KAAK,CAAC,KAAK,EAAE,CAAC;gBACd,QAAQ,CAAC,CAAC,CAAC,CAAC;YACd,CAAC,CAAC,CAAC;QACL,CAAC,CAAC;QACF,OAAO,CAAC,EAAE,CAAC,QAAQ,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC;QACrC,OAAO,CAAC,EAAE,CAAC,SAAS,EAAE,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC;QACvC,OAAO,CAAC,EAAE,CAAC,QAAQ,EAAE,GAAG,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC;IAC1C,CAAC,CAAC,CAAC;IACH,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC;AAC1B,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cotal-ai/workspace",
|
|
3
3
|
"description": "Cotal machine-local workstation layer: the ~/.cotal mesh registry, target resolution, preflight, on-disk auth-path I/O, and the command-copy renderer — operator concerns over a local checkout, kept separate from the wire protocol in @cotal-ai/core.",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.110.0",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
}
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@cotal-ai/core": "0.
|
|
25
|
+
"@cotal-ai/core": "0.110.0",
|
|
26
26
|
"ajv": "^8.20.0",
|
|
27
27
|
"string-width": "^8.2.1",
|
|
28
28
|
"yaml": "^2.9.0",
|