@cotal-ai/workspace 0.90.1 → 0.92.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/win32-arm64/build.json +1 -1
- package/build/Release/win32-x64/build.json +2 -2
- package/build/Release/win32-x64/creation.node +0 -0
- package/dist/agent-secrets.d.ts +2 -2
- package/dist/agent-secrets.d.ts.map +1 -1
- package/dist/agent-secrets.js +2 -2
- package/dist/agent-secrets.js.map +1 -1
- package/dist/auth-paths.d.ts +8 -2
- package/dist/auth-paths.d.ts.map +1 -1
- package/dist/auth-paths.js +12 -5
- package/dist/auth-paths.js.map +1 -1
- package/dist/broker-display.d.ts +4 -0
- package/dist/broker-display.d.ts.map +1 -0
- package/dist/broker-display.js +29 -0
- package/dist/broker-display.js.map +1 -0
- package/dist/colors.d.ts +11 -4
- package/dist/colors.d.ts.map +1 -1
- package/dist/colors.js +36 -9
- package/dist/colors.js.map +1 -1
- package/dist/connect.d.ts +81 -10
- package/dist/connect.d.ts.map +1 -1
- package/dist/connect.js +195 -75
- package/dist/connect.js.map +1 -1
- package/dist/control-target.d.ts +2 -2
- package/dist/control-target.d.ts.map +1 -1
- package/dist/control-target.js +13 -5
- package/dist/control-target.js.map +1 -1
- package/dist/credential-actions.d.ts +91 -0
- package/dist/credential-actions.d.ts.map +1 -0
- package/dist/credential-actions.js +74 -0
- package/dist/credential-actions.js.map +1 -0
- package/dist/deprecated-daemon-entries.d.ts +30 -0
- package/dist/deprecated-daemon-entries.d.ts.map +1 -0
- package/dist/deprecated-daemon-entries.js +37 -0
- package/dist/deprecated-daemon-entries.js.map +1 -0
- package/dist/endpoint-actions.d.ts +31 -0
- package/dist/endpoint-actions.d.ts.map +1 -0
- package/dist/endpoint-actions.js +2 -0
- package/dist/endpoint-actions.js.map +1 -0
- package/dist/endpoint-caller.d.ts +74 -0
- package/dist/endpoint-caller.d.ts.map +1 -0
- package/dist/endpoint-caller.js +118 -0
- package/dist/endpoint-caller.js.map +1 -0
- package/dist/endpoint-contract.d.ts +32 -0
- package/dist/endpoint-contract.d.ts.map +1 -0
- package/dist/endpoint-contract.js +92 -0
- package/dist/endpoint-contract.js.map +1 -0
- package/dist/extension-mutation.d.ts.map +1 -1
- package/dist/extension-mutation.js +4 -1
- package/dist/extension-mutation.js.map +1 -1
- package/dist/extensions.d.ts +28 -8
- package/dist/extensions.d.ts.map +1 -1
- package/dist/extensions.js +20 -8
- package/dist/extensions.js.map +1 -1
- package/dist/flags.d.ts +8 -1
- package/dist/flags.d.ts.map +1 -1
- package/dist/flags.js +9 -7
- package/dist/flags.js.map +1 -1
- package/dist/index.d.ts +25 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +25 -0
- package/dist/index.js.map +1 -1
- package/dist/launch-persona.d.ts +10 -0
- package/dist/launch-persona.d.ts.map +1 -0
- package/dist/launch-persona.js +34 -0
- package/dist/launch-persona.js.map +1 -0
- package/dist/local-process.d.ts +60 -12
- package/dist/local-process.d.ts.map +1 -1
- package/dist/local-process.js +173 -4
- package/dist/local-process.js.map +1 -1
- package/dist/maintenance.d.ts +267 -4
- package/dist/maintenance.d.ts.map +1 -1
- package/dist/maintenance.js +666 -12
- package/dist/maintenance.js.map +1 -1
- package/dist/mesh-manifest-schema.d.ts +118 -0
- package/dist/mesh-manifest-schema.d.ts.map +1 -0
- package/dist/mesh-manifest-schema.js +96 -0
- package/dist/mesh-manifest-schema.js.map +1 -0
- package/dist/mesh-registry.d.ts +30 -0
- package/dist/mesh-registry.d.ts.map +1 -1
- package/dist/mesh-registry.js +74 -13
- package/dist/mesh-registry.js.map +1 -1
- package/dist/mesh-target.d.ts +15 -7
- package/dist/mesh-target.d.ts.map +1 -1
- package/dist/mesh-target.js +77 -26
- package/dist/mesh-target.js.map +1 -1
- package/dist/official-connectors.d.ts +13 -0
- package/dist/official-connectors.d.ts.map +1 -1
- package/dist/official-connectors.js +18 -2
- package/dist/official-connectors.js.map +1 -1
- package/dist/output.d.ts +147 -0
- package/dist/output.d.ts.map +1 -0
- package/dist/output.js +186 -0
- package/dist/output.js.map +1 -0
- package/dist/pid.d.ts +5 -3
- package/dist/pid.d.ts.map +1 -1
- package/dist/pid.js +25 -13
- package/dist/pid.js.map +1 -1
- package/dist/preferences.d.ts +93 -0
- package/dist/preferences.d.ts.map +1 -0
- package/dist/preferences.js +272 -0
- package/dist/preferences.js.map +1 -0
- package/dist/preflight.d.ts +3 -0
- package/dist/preflight.d.ts.map +1 -1
- package/dist/preflight.js +6 -3
- package/dist/preflight.js.map +1 -1
- package/dist/prepared-spaces.d.ts +27 -0
- package/dist/prepared-spaces.d.ts.map +1 -0
- package/dist/prepared-spaces.js +57 -0
- package/dist/prepared-spaces.js.map +1 -0
- package/dist/present.d.ts +108 -0
- package/dist/present.d.ts.map +1 -0
- package/dist/present.js +249 -0
- package/dist/present.js.map +1 -0
- package/dist/prompt-input.d.ts +12 -0
- package/dist/prompt-input.d.ts.map +1 -0
- package/dist/prompt-input.js +35 -0
- package/dist/prompt-input.js.map +1 -0
- package/dist/protected-records.d.ts +102 -0
- package/dist/protected-records.d.ts.map +1 -0
- package/dist/protected-records.js +465 -0
- package/dist/protected-records.js.map +1 -0
- package/dist/registration-policy.d.ts +4 -1
- package/dist/registration-policy.d.ts.map +1 -1
- package/dist/registration-policy.js +4 -3
- package/dist/registration-policy.js.map +1 -1
- package/dist/render.d.ts +8 -0
- package/dist/render.d.ts.map +1 -1
- package/dist/render.js +49 -32
- package/dist/render.js.map +1 -1
- package/dist/renewal-path.d.ts +5 -0
- package/dist/renewal-path.d.ts.map +1 -0
- package/dist/renewal-path.js +9 -0
- package/dist/renewal-path.js.map +1 -0
- package/dist/renewal.d.ts +6 -9
- package/dist/renewal.d.ts.map +1 -1
- package/dist/renewal.js +7 -12
- package/dist/renewal.js.map +1 -1
- package/dist/service-adapter.d.ts +201 -0
- package/dist/service-adapter.d.ts.map +1 -0
- package/dist/service-adapter.js +294 -0
- package/dist/service-adapter.js.map +1 -0
- package/dist/service-custody.d.ts +5 -0
- package/dist/service-custody.d.ts.map +1 -0
- package/dist/service-custody.js +41 -0
- package/dist/service-custody.js.map +1 -0
- package/dist/service-definition.d.ts +52 -0
- package/dist/service-definition.d.ts.map +1 -0
- package/dist/service-definition.js +85 -0
- package/dist/service-definition.js.map +1 -0
- package/dist/service-definition.schema.json +79 -0
- package/dist/service-extension-metadata.d.ts +11 -0
- package/dist/service-extension-metadata.d.ts.map +1 -0
- package/dist/service-extension-metadata.js +66 -0
- package/dist/service-extension-metadata.js.map +1 -0
- package/dist/service-identity.d.ts +51 -0
- package/dist/service-identity.d.ts.map +1 -0
- package/dist/service-identity.js +103 -0
- package/dist/service-identity.js.map +1 -0
- package/dist/service-observation.d.ts +32 -0
- package/dist/service-observation.d.ts.map +1 -0
- package/dist/service-observation.js +134 -0
- package/dist/service-observation.js.map +1 -0
- package/dist/service-preset.d.ts +12 -0
- package/dist/service-preset.d.ts.map +1 -0
- package/dist/service-preset.js +10 -0
- package/dist/service-preset.js.map +1 -0
- package/dist/service-startup.d.ts +23 -0
- package/dist/service-startup.d.ts.map +1 -0
- package/dist/service-startup.js +39 -0
- package/dist/service-startup.js.map +1 -0
- package/dist/service-stop.d.ts +47 -0
- package/dist/service-stop.d.ts.map +1 -0
- package/dist/service-stop.js +152 -0
- package/dist/service-stop.js.map +1 -0
- package/dist/service-target.d.ts +5 -0
- package/dist/service-target.d.ts.map +1 -0
- package/dist/service-target.js +19 -0
- package/dist/service-target.js.map +1 -0
- package/dist/signer-export.d.ts +31 -0
- package/dist/signer-export.d.ts.map +1 -0
- package/dist/signer-export.js +114 -0
- package/dist/signer-export.js.map +1 -0
- package/dist/space-segmentation.d.ts +21 -7
- package/dist/space-segmentation.d.ts.map +1 -1
- package/dist/space-segmentation.js +26 -9
- package/dist/space-segmentation.js.map +1 -1
- package/dist/space.d.ts +5 -5
- package/dist/space.d.ts.map +1 -1
- package/dist/space.js +8 -6
- package/dist/space.js.map +1 -1
- package/dist/system-rotation.d.ts +4 -3
- package/dist/system-rotation.d.ts.map +1 -1
- package/dist/system-rotation.js +16 -6
- package/dist/system-rotation.js.map +1 -1
- package/dist/web-session.d.ts +7 -0
- package/dist/web-session.d.ts.map +1 -1
- package/dist/web-session.js +9 -0
- package/dist/web-session.js.map +1 -1
- package/package.json +6 -2
package/dist/flags.d.ts
CHANGED
|
@@ -8,6 +8,7 @@ import type { FlagSpec } from "@cotal-ai/core";
|
|
|
8
8
|
*/
|
|
9
9
|
export declare const spaceFlag: {
|
|
10
10
|
readonly name: "space";
|
|
11
|
+
readonly short: "s";
|
|
11
12
|
readonly type: "string";
|
|
12
13
|
readonly value: "<s>";
|
|
13
14
|
readonly description: "target space (default: the resolved mesh)";
|
|
@@ -29,6 +30,7 @@ export declare const credsFlag: {
|
|
|
29
30
|
* folder's project > the registry. */
|
|
30
31
|
export declare const targetFlags: readonly [{
|
|
31
32
|
readonly name: "space";
|
|
33
|
+
readonly short: "s";
|
|
32
34
|
readonly type: "string";
|
|
33
35
|
readonly value: "<s>";
|
|
34
36
|
readonly description: "target space (default: the resolved mesh)";
|
|
@@ -55,6 +57,7 @@ export declare function hasMeshTargetFlags(flags: readonly FlagSpec[] | undefine
|
|
|
55
57
|
*/
|
|
56
58
|
export declare const launchFlags: readonly [{
|
|
57
59
|
readonly name: "name";
|
|
60
|
+
readonly short: "n";
|
|
58
61
|
readonly type: "string";
|
|
59
62
|
readonly value: "<n>";
|
|
60
63
|
readonly description: "presence name override; does not choose the persona";
|
|
@@ -75,6 +78,7 @@ export declare const launchFlags: readonly [{
|
|
|
75
78
|
readonly description: "role override (wins over the agent file's role:)";
|
|
76
79
|
}, {
|
|
77
80
|
readonly name: "model";
|
|
81
|
+
readonly short: "m";
|
|
78
82
|
readonly type: "string";
|
|
79
83
|
readonly value: "<m>";
|
|
80
84
|
readonly description: "model override (wins over the agent file's model:)";
|
|
@@ -91,11 +95,13 @@ export declare const launchFlags: readonly [{
|
|
|
91
95
|
readonly description: "connector-specific launch option (repeatable); wins per-key over the agent file's launchOptions:";
|
|
92
96
|
}, {
|
|
93
97
|
readonly name: "cwd";
|
|
98
|
+
readonly short: "C";
|
|
94
99
|
readonly type: "string";
|
|
95
100
|
readonly value: "<dir>";
|
|
96
101
|
readonly description: "working directory to root the agent at";
|
|
97
102
|
}, {
|
|
98
103
|
readonly name: "prompt";
|
|
104
|
+
readonly short: "p";
|
|
99
105
|
readonly type: "string";
|
|
100
106
|
readonly value: "<text>";
|
|
101
107
|
readonly description: "initial prompt auto-submitted at start";
|
|
@@ -145,7 +151,8 @@ export declare function mergeLaunchOptions(base: Record<string, unknown> | undef
|
|
|
145
151
|
/**
|
|
146
152
|
* Parse a positive integer CLI flag. Absent stays undefined (the callee's default); anything else
|
|
147
153
|
* that is not a safe integer ≥ 1 fails loud naming the flag, never silently becoming NaN or the
|
|
148
|
-
* default. Used by `--max-sessions` so a typo cannot drop the live-session ceiling to 64.
|
|
154
|
+
* default. Used by `--max-sessions` so a typo cannot drop the live-session ceiling to 64. The
|
|
155
|
+
* failure is a usage refusal, so a command checks its flag values before any effect.
|
|
149
156
|
*/
|
|
150
157
|
export declare function parsePositiveIntegerFlag(flag: string, raw: string | undefined): number | undefined;
|
|
151
158
|
//# sourceMappingURL=flags.d.ts.map
|
package/dist/flags.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flags.d.ts","sourceRoot":"","sources":["../src/flags.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"flags.d.ts","sourceRoot":"","sources":["../src/flags.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAG/C;;;;;;GAMG;AACH,eAAO,MAAM,SAAS;;;;;;CAAoJ,CAAC;AAC3K,eAAO,MAAM,UAAU;;;;;CAAgJ,CAAC;AACxK,eAAO,MAAM,SAAS;;;;;CAA2I,CAAC;AAElK;;uCAEuC;AACvC,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;EAA4E,CAAC;AAErG;wGACwG;AACxG,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,SAAS,QAAQ,EAAE,GAAG,SAAS,GAAG,OAAO,CAIlF;AAED;;;;;;GAMG;AACH,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAiBgB,CAAC;AAEzC;;;iGAGiG;AACjG,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,SAAS,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,SAAS,CAYlG;AAED;;kGAEkG;AAClG,wBAAgB,kBAAkB,CAChC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,EACzC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,GAC5C,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,CAIrC;AAED;;;;;GAKG;AACH,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,CAMlG"}
|
package/dist/flags.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { CommandFailure } from "./output.js";
|
|
1
2
|
/**
|
|
2
3
|
* The shared flag vocabulary of the workstation layer. Commands spread these specs instead of
|
|
3
4
|
* declaring their own copies, so the vocabulary cannot drift between commands; a command that
|
|
@@ -5,7 +6,7 @@
|
|
|
5
6
|
* Declared `as const` so `FlagValues<typeof …>` derives each command's values type — the cast
|
|
6
7
|
* in `run` is compile-checked against exactly these specs.
|
|
7
8
|
*/
|
|
8
|
-
export const spaceFlag = { name: "space", type: "string", value: "<s>", description: "target space (default: the resolved mesh)" };
|
|
9
|
+
export const spaceFlag = { name: "space", short: "s", type: "string", value: "<s>", description: "target space (default: the resolved mesh)" };
|
|
9
10
|
export const serverFlag = { name: "server", type: "string", value: "<url>", description: "broker URL (overrides the mesh registry entry)" };
|
|
10
11
|
export const credsFlag = { name: "creds", type: "string", value: "<path>", description: "creds file for an off-registry connection" };
|
|
11
12
|
/** The mesh-target bundle: which space, which broker, and (off-registry) which credential.
|
|
@@ -28,15 +29,15 @@ export function hasMeshTargetFlags(flags) {
|
|
|
28
29
|
* keeps it honest.
|
|
29
30
|
*/
|
|
30
31
|
export const launchFlags = [
|
|
31
|
-
{ name: "name", type: "string", value: "<n>", description: "presence name override; does not choose the persona" },
|
|
32
|
+
{ name: "name", short: "n", type: "string", value: "<n>", description: "presence name override; does not choose the persona" },
|
|
32
33
|
{ name: "config", type: "string", value: "<persona-or-path>", description: "persona catalog name or file path; defaults from COTAL_DEFAULT_PERSONA" },
|
|
33
34
|
{ name: "agent", type: "string", value: "<a>", description: "connector type (claude, opencode, hermes …); defaults from COTAL_DEFAULT_AGENT" },
|
|
34
35
|
{ name: "role", type: "string", value: "<r>", description: "role override (wins over the agent file's role:)" },
|
|
35
|
-
{ name: "model", type: "string", value: "<m>", description: "model override (wins over the agent file's model:)" },
|
|
36
|
+
{ name: "model", short: "m", type: "string", value: "<m>", description: "model override (wins over the agent file's model:)" },
|
|
36
37
|
{ name: "variant", type: "string", value: "<v>", description: "model variant override (connector-defined; wins over the agent file's variant:)" },
|
|
37
38
|
{ name: "opt", type: "string", multiple: true, value: "<k=v>", description: "connector-specific launch option (repeatable); wins per-key over the agent file's launchOptions:" },
|
|
38
|
-
{ name: "cwd", type: "string", value: "<dir>", description: "working directory to root the agent at" },
|
|
39
|
-
{ name: "prompt", type: "string", value: "<text>", description: "initial prompt auto-submitted at start" },
|
|
39
|
+
{ name: "cwd", short: "C", type: "string", value: "<dir>", description: "working directory to root the agent at" },
|
|
40
|
+
{ name: "prompt", short: "p", type: "string", value: "<text>", description: "initial prompt auto-submitted at start" },
|
|
40
41
|
{ name: "resume", type: "string", value: "<id>", description: "fork an existing session id into the mesh (only where the connector declares resume support; detached: pair with --cwd)" },
|
|
41
42
|
{ name: "events", type: "boolean", description: "force the session's AG-UI event plane on (already the default where supported)" },
|
|
42
43
|
{ name: "no-events", type: "boolean", description: "opt out of the session's AG-UI event plane" },
|
|
@@ -78,14 +79,15 @@ export function mergeLaunchOptions(base, override) {
|
|
|
78
79
|
/**
|
|
79
80
|
* Parse a positive integer CLI flag. Absent stays undefined (the callee's default); anything else
|
|
80
81
|
* that is not a safe integer ≥ 1 fails loud naming the flag, never silently becoming NaN or the
|
|
81
|
-
* default. Used by `--max-sessions` so a typo cannot drop the live-session ceiling to 64.
|
|
82
|
+
* default. Used by `--max-sessions` so a typo cannot drop the live-session ceiling to 64. The
|
|
83
|
+
* failure is a usage refusal, so a command checks its flag values before any effect.
|
|
82
84
|
*/
|
|
83
85
|
export function parsePositiveIntegerFlag(flag, raw) {
|
|
84
86
|
if (raw === undefined)
|
|
85
87
|
return undefined;
|
|
86
88
|
const n = Number(raw);
|
|
87
89
|
if (!Number.isSafeInteger(n) || n < 1)
|
|
88
|
-
throw new
|
|
90
|
+
throw new CommandFailure("refused", "USAGE_INVALID", `${flag} must be a positive integer (got ${JSON.stringify(raw)})`);
|
|
89
91
|
return n;
|
|
90
92
|
}
|
|
91
93
|
//# sourceMappingURL=flags.js.map
|
package/dist/flags.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flags.js","sourceRoot":"","sources":["../src/flags.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"flags.js","sourceRoot":"","sources":["../src/flags.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAE7C;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,SAAS,GAAG,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,GAAG,EAAE,IAAI,EAAE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AS,CAAC;IACzC,MAAM,MAAM,GAAG,EAAE,GAAG,IAAI,EAAE,GAAG,QAAQ,EAAE,CAAC;IACxC,OAAO,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC;AACzD,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,wBAAwB,CAAC,IAAY,EAAE,GAAuB;IAC5E,IAAI,GAAG,KAAK,SAAS;QAAE,OAAO,SAAS,CAAC;IACxC,MAAM,CAAC,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC;IACtB,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC;QACnC,MAAM,IAAI,cAAc,CAAC,SAAS,EAAE,eAAe,EAAE,GAAG,IAAI,oCAAoC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IAC1H,OAAO,CAAC,CAAC;AACX,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -19,11 +19,17 @@ export * from "./maintenance.js";
|
|
|
19
19
|
export * from "./manager-shutdown.js";
|
|
20
20
|
export * from "./flags.js";
|
|
21
21
|
export { oneLine } from "@cotal-ai/core";
|
|
22
|
+
export * from "./output.js";
|
|
23
|
+
export * from "./preferences.js";
|
|
24
|
+
export * from "./present.js";
|
|
25
|
+
export * from "./prompt-input.js";
|
|
22
26
|
export * from "./provenance.js";
|
|
23
27
|
export * from "./mesh-registry.js";
|
|
28
|
+
export * from "./prepared-spaces.js";
|
|
24
29
|
export * from "./join-target.js";
|
|
25
30
|
export * from "./registration-policy.js";
|
|
26
31
|
export * from "./broker-policy.js";
|
|
32
|
+
export * from "./broker-display.js";
|
|
27
33
|
export * from "./mesh-target.js";
|
|
28
34
|
export * from "./preflight.js";
|
|
29
35
|
export * from "./render.js";
|
|
@@ -37,4 +43,23 @@ export * from "./system-rotation.js";
|
|
|
37
43
|
export * from "./win-cmd.js";
|
|
38
44
|
export * from "./pid.js";
|
|
39
45
|
export * from "./progress.js";
|
|
46
|
+
export * from "./service-definition.js";
|
|
47
|
+
export * from "./service-adapter.js";
|
|
48
|
+
export * from "./service-preset.js";
|
|
49
|
+
export * from "./deprecated-daemon-entries.js";
|
|
50
|
+
export * from "./service-startup.js";
|
|
51
|
+
export * from "./service-custody.js";
|
|
52
|
+
export * from "./service-identity.js";
|
|
53
|
+
export * from "./service-stop.js";
|
|
54
|
+
export * from "./service-observation.js";
|
|
55
|
+
export * from "./service-target.js";
|
|
56
|
+
export * from "./service-extension-metadata.js";
|
|
57
|
+
export * from "./endpoint-contract.js";
|
|
58
|
+
export * from "./mesh-manifest-schema.js";
|
|
59
|
+
export * from "./launch-persona.js";
|
|
60
|
+
export * from "./protected-records.js";
|
|
61
|
+
export * from "./signer-export.js";
|
|
62
|
+
export * from "./credential-actions.js";
|
|
63
|
+
export * from "./endpoint-actions.js";
|
|
64
|
+
export * from "./endpoint-caller.js";
|
|
40
65
|
//# sourceMappingURL=index.d.ts.map
|
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,cAAc,0BAA0B,CAAC;AACzC,cAAc,iBAAiB,CAAC;AAChC,cAAc,kBAAkB,CAAC;AACjC,cAAc,oBAAoB,CAAC;AACnC,cAAc,iBAAiB,CAAC;AAChC,cAAc,kBAAkB,CAAC;AACjC,cAAc,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escapes presence text by the same rule;
|
|
22
22
|
// re-exported here so the package surface is unchanged.
|
|
23
23
|
export { oneLine } from "@cotal-ai/core";
|
|
24
|
+
export * from "./output.js";
|
|
25
|
+
export * from "./preferences.js";
|
|
26
|
+
export * from "./present.js";
|
|
27
|
+
export * from "./prompt-input.js";
|
|
24
28
|
export * from "./provenance.js";
|
|
25
29
|
export * from "./mesh-registry.js";
|
|
30
|
+
export * from "./prepared-spaces.js";
|
|
26
31
|
export * from "./join-target.js";
|
|
27
32
|
export * from "./registration-policy.js";
|
|
28
33
|
export * from "./broker-policy.js";
|
|
34
|
+
export * from "./broker-display.js";
|
|
29
35
|
export * from "./mesh-target.js";
|
|
30
36
|
export * from "./preflight.js";
|
|
31
37
|
export * from "./render.js";
|
|
@@ -39,4 +45,23 @@ export * from "./system-rotation.js";
|
|
|
39
45
|
export * from "./win-cmd.js";
|
|
40
46
|
export * from "./pid.js";
|
|
41
47
|
export * from "./progress.js";
|
|
48
|
+
export * from "./service-definition.js";
|
|
49
|
+
export * from "./service-adapter.js";
|
|
50
|
+
export * from "./service-preset.js";
|
|
51
|
+
export * from "./deprecated-daemon-entries.js";
|
|
52
|
+
export * from "./service-startup.js";
|
|
53
|
+
export * from "./service-custody.js";
|
|
54
|
+
export * from "./service-identity.js";
|
|
55
|
+
export * from "./service-stop.js";
|
|
56
|
+
export * from "./service-observation.js";
|
|
57
|
+
export * from "./service-target.js";
|
|
58
|
+
export * from "./service-extension-metadata.js";
|
|
59
|
+
export * from "./endpoint-contract.js";
|
|
60
|
+
export * from "./mesh-manifest-schema.js";
|
|
61
|
+
export * from "./launch-persona.js";
|
|
62
|
+
export * from "./protected-records.js";
|
|
63
|
+
export * from "./signer-export.js";
|
|
64
|
+
export * from "./credential-actions.js";
|
|
65
|
+
export * from "./endpoint-actions.js";
|
|
66
|
+
export * from "./endpoint-caller.js";
|
|
42
67
|
//# sourceMappingURL=index.js.map
|
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;AAC7B,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,0BAA0B,CAAC;AACzC,cAAc,iBAAiB,CAAC;AAChC,cAAc,kBAAkB,CAAC;AACjC,cAAc,oBAAoB,CAAC;AACnC,cAAc,iBAAiB,CAAC;AAChC,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,uBAAuB,CAAC;AACtC,cAAc,YAAY,CAAC;AAC3B,2FAA2F;AAC3F,wDAAwD;AACxD,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AACzC,cAAc,iBAAiB,CAAC;AAChC,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,0BAA0B,CAAC;AACzC,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,sBAAsB,CAAC;AACrC,cAAc,qBAAqB,CAAC;AACpC,cAAc,sBAAsB,CAAC;AACrC,cAAc,YAAY,CAAC;AAC3B,cAAc,yBAAyB,CAAC;AACxC,cAAc,sBAAsB,CAAC;AACrC,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,cAAc,eAAe,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;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ACxC,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,oBAAoB,CAAC;AACnC,cAAc,yBAAyB,CAAC;AACxC,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type AgentDef } from "@cotal-ai/core";
|
|
2
|
+
/** A workstation-file refusal, mapped onto existing native bad-request/CLI schema-invalid codes. */
|
|
3
|
+
export declare class PersonaSourceError extends Error {
|
|
4
|
+
readonly code = "SCHEMA_INVALID";
|
|
5
|
+
}
|
|
6
|
+
/** Public --file denotes a file even when its basename has no extension. Paths stay host-relative. */
|
|
7
|
+
export declare function personaFileReference(value: string): string;
|
|
8
|
+
/** Read and validate the same bytes on the execution host; never deploy a manifest from this door. */
|
|
9
|
+
export declare function loadLaunchPersonaFile(path: string): AgentDef;
|
|
10
|
+
//# sourceMappingURL=launch-persona.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"launch-persona.d.ts","sourceRoot":"","sources":["../src/launch-persona.ts"],"names":[],"mappings":"AAEA,OAAO,EAAwB,KAAK,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAGrE,oGAAoG;AACpG,qBAAa,kBAAmB,SAAQ,KAAK;IAC3C,QAAQ,CAAC,IAAI,oBAAoB;CAClC;AAED,sGAAsG;AACtG,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAG1D;AAED,sGAAsG;AACtG,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,MAAM,GAAG,QAAQ,CAU5D"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { readFileSync } from "node:fs";
|
|
2
|
+
import { parseDocument } from "yaml";
|
|
3
|
+
import { parseAgentFileSource } from "@cotal-ai/core";
|
|
4
|
+
import { MeshManifestSchema } from "./mesh-manifest-schema.js";
|
|
5
|
+
/** A workstation-file refusal, mapped onto existing native bad-request/CLI schema-invalid codes. */
|
|
6
|
+
export class PersonaSourceError extends Error {
|
|
7
|
+
code = "SCHEMA_INVALID";
|
|
8
|
+
}
|
|
9
|
+
/** Public --file denotes a file even when its basename has no extension. Paths stay host-relative. */
|
|
10
|
+
export function personaFileReference(value) {
|
|
11
|
+
if (!value.trim() || /[\u0000-\u001f\u007f]/u.test(value))
|
|
12
|
+
throw new PersonaSourceError("--file needs one nonempty persona-file path without control characters");
|
|
13
|
+
return /[\\/]/.test(value) || value.endsWith(".md") ? value : `./${value}`;
|
|
14
|
+
}
|
|
15
|
+
/** Read and validate the same bytes on the execution host; never deploy a manifest from this door. */
|
|
16
|
+
export function loadLaunchPersonaFile(path) {
|
|
17
|
+
const source = readFileSync(path, "utf8");
|
|
18
|
+
let manifest = false;
|
|
19
|
+
try {
|
|
20
|
+
const document = parseDocument(source);
|
|
21
|
+
if (!document.errors.length)
|
|
22
|
+
manifest = MeshManifestSchema.safeParse(document.toJS({ maxAliasCount: 100 })).success;
|
|
23
|
+
}
|
|
24
|
+
catch { /* A non-manifest still has to pass the native persona parser below. */ }
|
|
25
|
+
if (manifest)
|
|
26
|
+
throw new PersonaSourceError("--file names a Mesh manifest, not a persona file; use cotal team deploy <file>. No agent was allocated");
|
|
27
|
+
try {
|
|
28
|
+
return parseAgentFileSource(source, path);
|
|
29
|
+
}
|
|
30
|
+
catch {
|
|
31
|
+
throw new PersonaSourceError(`persona file ${path} has invalid native frontmatter; check its name, selectors and access declarations. File contents were not echoed`);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=launch-persona.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"launch-persona.js","sourceRoot":"","sources":["../src/launch-persona.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,aAAa,EAAE,MAAM,MAAM,CAAC;AACrC,OAAO,EAAE,oBAAoB,EAAiB,MAAM,gBAAgB,CAAC;AACrE,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAE/D,oGAAoG;AACpG,MAAM,OAAO,kBAAmB,SAAQ,KAAK;IAClC,IAAI,GAAG,gBAAgB,CAAC;CAClC;AAED,sGAAsG;AACtG,MAAM,UAAU,oBAAoB,CAAC,KAAa;IAChD,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,wBAAwB,CAAC,IAAI,CAAC,KAAK,CAAC;QAAE,MAAM,IAAI,kBAAkB,CAAC,wEAAwE,CAAC,CAAC;IAClK,OAAO,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,KAAK,EAAE,CAAC;AAC7E,CAAC;AAED,sGAAsG;AACtG,MAAM,UAAU,qBAAqB,CAAC,IAAY;IAChD,MAAM,MAAM,GAAG,YAAY,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;IAC1C,IAAI,QAAQ,GAAG,KAAK,CAAC;IACrB,IAAI,CAAC;QACH,MAAM,QAAQ,GAAG,aAAa,CAAC,MAAM,CAAC,CAAC;QACvC,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,MAAM;YAAE,QAAQ,GAAG,kBAAkB,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,aAAa,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC;IACtH,CAAC;IAAC,MAAM,CAAC,CAAC,uEAAuE,CAAC,CAAC;IACnF,IAAI,QAAQ;QAAE,MAAM,IAAI,kBAAkB,CAAC,wGAAwG,CAAC,CAAC;IACrJ,IAAI,CAAC;QAAC,OAAO,oBAAoB,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;IAAC,CAAC;IAClD,MAAM,CAAC;QAAC,MAAM,IAAI,kBAAkB,CAAC,gBAAgB,IAAI,mHAAmH,CAAC,CAAC;IAAC,CAAC;AAClL,CAAC"}
|
package/dist/local-process.d.ts
CHANGED
|
@@ -1,19 +1,24 @@
|
|
|
1
1
|
import type { Extension } from "@cotal-ai/core";
|
|
2
|
+
import type { ServiceAdapterDeclaration, ServiceAdapterHooks } from "./service-adapter.js";
|
|
2
3
|
/** Context supplied to local process providers by workstation commands such as `down` and `status`. */
|
|
3
4
|
export interface LocalProcessContext {
|
|
4
5
|
readonly root: string;
|
|
5
6
|
readonly space: string;
|
|
6
7
|
readonly userAuth?: boolean;
|
|
7
8
|
}
|
|
8
|
-
/** A workstation
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
* extension
|
|
12
|
-
*
|
|
13
|
-
export interface LocalProcess extends Extension {
|
|
9
|
+
/** A workstation process provider. Legacy providers record custody under a mesh root; a
|
|
10
|
+
* controllerOnly service uses the protected service instance store instead. Metadata is cached
|
|
11
|
+
* at install time, without executable hooks. Legacy status/down never import package code. A
|
|
12
|
+
* legacy extension process claims its pidfile with exclusive create; removal reserves that path.
|
|
13
|
+
* Controller-only providers use service launch intents and instance-based removal guards. */
|
|
14
|
+
export interface LocalProcess extends Extension, ServiceAdapterHooks {
|
|
14
15
|
readonly kind: "local-process";
|
|
15
16
|
readonly name: string;
|
|
16
17
|
readonly label: string;
|
|
18
|
+
/** Optional service ABI. Cached declarations contain no executable hooks or native grants. */
|
|
19
|
+
readonly service?: ServiceAdapterDeclaration;
|
|
20
|
+
/** Controller records only. Legacy PID inventory/down must not interpret pidFile as custody. */
|
|
21
|
+
readonly controllerOnly?: true;
|
|
17
22
|
/** Lower orders stop first; the broker should remain last so dependants can shut down cleanly. */
|
|
18
23
|
readonly order?: number;
|
|
19
24
|
/** Path relative to `<root>/.cotal`; `{space}` expands to the injective hex space key
|
|
@@ -29,12 +34,6 @@ export interface LocalProcess extends Extension {
|
|
|
29
34
|
readonly clearsMesh?: boolean;
|
|
30
35
|
/** Hide this process from status unless the selected mesh uses per-user auth. */
|
|
31
36
|
readonly visibleWhen?: "user-auth";
|
|
32
|
-
/** Which mesh root a selective stop resolves this process's pidfile under. Absent: the folder the
|
|
33
|
-
* command runs in (the broker stack `up` started there). `"target"`: the machine mesh-target
|
|
34
|
-
* resolution (registry current mesh first, then the folder) — for a process whose START is
|
|
35
|
-
* target-resolved from any directory and records its pidfile under the TARGET mesh's root; a
|
|
36
|
-
* cwd-only stop would miss the live process. Bare whole-stack sweeps stay folder-scoped. */
|
|
37
|
-
readonly rootedAt?: "target";
|
|
38
37
|
/** Whether a live process's command line is this process's. A stop never signals a live pid this
|
|
39
38
|
* rejects: the record outlived its process and the pid was reused, so the stale record is cleared.
|
|
40
39
|
* A function cannot be cached for an installed extension, so only this CLI's own processes set it. */
|
|
@@ -51,6 +50,8 @@ export interface LocalProcess extends Extension {
|
|
|
51
50
|
* space booting in that root overwrote the first space's record and every reader then answered
|
|
52
51
|
* about the wrong process. `auth-service.{space}.pid` was already templated; these were not. */
|
|
53
52
|
export declare const MANAGER_PIDFILE = "manager.{space}.pid";
|
|
53
|
+
/** The native user-auth daemon custody slot, per space. */
|
|
54
|
+
export declare const AUTH_PIDFILE = "auth-service.{space}.pid";
|
|
54
55
|
/** The stop reservation beside a resolved pidfile: whoever holds it is the one process stopping that
|
|
55
56
|
* record, and a manager reads it to bind a `--with-agents` intent to the exact stop attempt. */
|
|
56
57
|
export declare const stopReservationPath: (pidPath: string) => string;
|
|
@@ -67,6 +68,9 @@ export declare const MANAGER_DELIVERY_AWARE_MARKER = "manager.{space}.delivery-a
|
|
|
67
68
|
/** `.cotal/delivery.<spaceKey>.pid` — the Plane-3 delivery daemon's record. Per-space: the daemon is
|
|
68
69
|
* minted a space-scoped cred and binds that space's durables, so two spaces need two daemons. */
|
|
69
70
|
export declare const DELIVERY_PIDFILE = "delivery.{space}.pid";
|
|
71
|
+
/** Shared legacy custody metadata. The delivery implementation registers its live service adapter
|
|
72
|
+
* over this descriptor; CLI stop clients need no import from that implementation. */
|
|
73
|
+
export declare const DELIVERY_PROCESS: LocalProcess;
|
|
70
74
|
/** `.cotal/delivery.<spaceKey>.log` — the delivery daemon's output. See {@link MANAGER_LOGFILE}. */
|
|
71
75
|
export declare const DELIVERY_LOGFILE = "delivery.{space}.log";
|
|
72
76
|
/**
|
|
@@ -104,6 +108,50 @@ export declare function canonicalLocalProcessPath(template: string, context: Loc
|
|
|
104
108
|
* the ambiguity rule would refuse on exactly the half-upgraded root it exists to tidy.
|
|
105
109
|
*/
|
|
106
110
|
export declare function localProcessPathCandidates(template: string, context: LocalProcessContext): string[];
|
|
111
|
+
/** A record {@link recordedLocalProcessPaths} found, with the space its `{space}` segment decodes to. */
|
|
112
|
+
export interface SpacedRecordPath {
|
|
113
|
+
readonly path: string;
|
|
114
|
+
/** Absent when the segment decodes through neither spelling a writer used. */
|
|
115
|
+
readonly space?: string;
|
|
116
|
+
/** Why nothing at `path` was read: a link, which is never followed, or a directory that could not
|
|
117
|
+
* be listed. Either may hide a record. */
|
|
118
|
+
readonly unread?: string;
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* Every record under `<root>/.cotal` that a `{space}` template names for ANY space: the inverse of
|
|
122
|
+
* {@link localProcessPathCandidates}. It lists the directories the template's parts reach, byte-exact,
|
|
123
|
+
* instead of expanding a space already known, so a record of a space nothing else names is found.
|
|
124
|
+
* A segment decodes through the hex key first, then the pre-hex `encodeURIComponent` spelling; one
|
|
125
|
+
* that decodes through neither is still returned, with no space. The pre-segmentation root-scoped
|
|
126
|
+
* spelling names no space, and the candidates of any space already name it.
|
|
127
|
+
*
|
|
128
|
+
* The template is classified as the writer expands it, after normalization: one whose `{space}`
|
|
129
|
+
* normalizes away (`daemon/{space}/../worker.pid`) names one path for every space, which the
|
|
130
|
+
* candidates already name, so it returns none. It never follows a link: `.cotal` or a matching entry
|
|
131
|
+
* that is a link is returned unread, and nothing behind it is listed. Read only.
|
|
132
|
+
*/
|
|
133
|
+
export declare function recordedLocalProcessPaths(template: string, root: string): SpacedRecordPath[];
|
|
134
|
+
/** What {@link readContainedRecord} found at a record path. `unread` means nothing was read, and `at`
|
|
135
|
+
* (the record, or a part of its path) may hide a record for the reason `why` gives. */
|
|
136
|
+
export type ContainedRecord = {
|
|
137
|
+
readonly state: "absent";
|
|
138
|
+
} | {
|
|
139
|
+
readonly state: "content";
|
|
140
|
+
readonly raw: string;
|
|
141
|
+
} | {
|
|
142
|
+
readonly state: "unread";
|
|
143
|
+
readonly at: string;
|
|
144
|
+
readonly why: string;
|
|
145
|
+
};
|
|
146
|
+
/**
|
|
147
|
+
* A record under `<root>/.cotal`, read without leaving it. Every part of the path, `.cotal` included,
|
|
148
|
+
* is checked with `lstat`: a link anywhere on the way is returned unread at the link, and nothing
|
|
149
|
+
* behind it is read. A part that is missing, or a directory part that is not a directory, means no
|
|
150
|
+
* record. The record must be a regular file of at most {@link RECORD_BYTES}, read to its end. The file
|
|
151
|
+
* opened must be the one checked, and its size and modification time must not change while it is read.
|
|
152
|
+
* Read only. Throws for a path outside `<root>/.cotal`.
|
|
153
|
+
*/
|
|
154
|
+
export declare function readContainedRecord(root: string, path: string): ContainedRecord;
|
|
107
155
|
/**
|
|
108
156
|
* The record to READ: the canonical space-keyed path, or a pre-upgrade one when that is the only
|
|
109
157
|
* spelling present.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"local-process.d.ts","sourceRoot":"","sources":["../src/local-process.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,C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ACwF;AACxF,MAAM,MAAM,eAAe,GACvB;IAAE,QAAQ,CAAC,KAAK,EAAE,QAAQ,CAAA;CAAE,GAC5B;IAAE,QAAQ,CAAC,KAAK,EAAE,SAAS,CAAC;IAAC,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAA;CAAE,GACnD;IAAE,QAAQ,CAAC,KAAK,EAAE,QAAQ,CAAC;IAAC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAA;CAAE,CAAC;AAE5E;;;;;;;GAOG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,eAAe,CAsC/E;AAoCD;;;;;;;;;;GAUG;AACH,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,mBAAmB,GAAG,MAAM,CAavF;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,2BAA2B,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,mBAAmB,GAAG,IAAI,CA0BhG;AAED,8FAA8F;AAC9F,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB;;;;2GAIuG;IACvG,QAAQ,CAAC,YAAY,EAAE,OAAO,CAAC;CAChC;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,MAAM,GAAG,oBAAoB,EAAE,CAiB1E;AAqCD,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,mBAAmB,GAAG,OAAO,CAEhG"}
|
package/dist/local-process.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { readdirSync, rmSync } from "node:fs";
|
|
2
|
-
import { isAbsolute, join, normalize, dirname, basename } from "node:path";
|
|
1
|
+
import { closeSync, fstatSync, lstatSync, openSync, readdirSync, readSync, rmSync } from "node:fs";
|
|
2
|
+
import { isAbsolute, join, normalize, dirname, basename, relative, sep } from "node:path";
|
|
3
3
|
import { spaceFromKey, spaceKey } from "./auth-paths.js";
|
|
4
|
-
import { parsePid, probeLiveness, readPidfile } from "./pid.js";
|
|
4
|
+
import { commandIsCotalDelivery, parsePid, probeLiveness, readPidfile } from "./pid.js";
|
|
5
5
|
// ---- the runtime records, per space -------------------------------------------------------------
|
|
6
6
|
/** `.cotal/manager.<spaceKey>.pid` — the running manager's record, KEYED BY SPACE.
|
|
7
7
|
*
|
|
@@ -14,6 +14,8 @@ import { parsePid, probeLiveness, readPidfile } from "./pid.js";
|
|
|
14
14
|
* space booting in that root overwrote the first space's record and every reader then answered
|
|
15
15
|
* about the wrong process. `auth-service.{space}.pid` was already templated; these were not. */
|
|
16
16
|
export const MANAGER_PIDFILE = "manager.{space}.pid";
|
|
17
|
+
/** The native user-auth daemon custody slot, per space. */
|
|
18
|
+
export const AUTH_PIDFILE = "auth-service.{space}.pid";
|
|
17
19
|
/** The stop reservation beside a resolved pidfile: whoever holds it is the one process stopping that
|
|
18
20
|
* record, and a manager reads it to bind a `--with-agents` intent to the exact stop attempt. */
|
|
19
21
|
export const stopReservationPath = (pidPath) => `${pidPath}.stopping`;
|
|
@@ -30,6 +32,9 @@ export const MANAGER_DELIVERY_AWARE_MARKER = "manager.{space}.delivery-aware";
|
|
|
30
32
|
/** `.cotal/delivery.<spaceKey>.pid` — the Plane-3 delivery daemon's record. Per-space: the daemon is
|
|
31
33
|
* minted a space-scoped cred and binds that space's durables, so two spaces need two daemons. */
|
|
32
34
|
export const DELIVERY_PIDFILE = "delivery.{space}.pid";
|
|
35
|
+
/** Shared legacy custody metadata. The delivery implementation registers its live service adapter
|
|
36
|
+
* over this descriptor; CLI stop clients need no import from that implementation. */
|
|
37
|
+
export const DELIVERY_PROCESS = { kind: "local-process", name: "delivery", label: "delivery daemon", order: 20, pidFile: DELIVERY_PIDFILE, cooperativeStop: true, isOwnCommand: commandIsCotalDelivery };
|
|
33
38
|
/** `.cotal/delivery.<spaceKey>.log` — the delivery daemon's output. See {@link MANAGER_LOGFILE}. */
|
|
34
39
|
export const DELIVERY_LOGFILE = "delivery.{space}.log";
|
|
35
40
|
/**
|
|
@@ -92,6 +97,170 @@ export function localProcessPathCandidates(template, context) {
|
|
|
92
97
|
add(preSegmentation);
|
|
93
98
|
return paths;
|
|
94
99
|
}
|
|
100
|
+
/**
|
|
101
|
+
* Every record under `<root>/.cotal` that a `{space}` template names for ANY space: the inverse of
|
|
102
|
+
* {@link localProcessPathCandidates}. It lists the directories the template's parts reach, byte-exact,
|
|
103
|
+
* instead of expanding a space already known, so a record of a space nothing else names is found.
|
|
104
|
+
* A segment decodes through the hex key first, then the pre-hex `encodeURIComponent` spelling; one
|
|
105
|
+
* that decodes through neither is still returned, with no space. The pre-segmentation root-scoped
|
|
106
|
+
* spelling names no space, and the candidates of any space already name it.
|
|
107
|
+
*
|
|
108
|
+
* The template is classified as the writer expands it, after normalization: one whose `{space}`
|
|
109
|
+
* normalizes away (`daemon/{space}/../worker.pid`) names one path for every space, which the
|
|
110
|
+
* candidates already name, so it returns none. It never follows a link: `.cotal` or a matching entry
|
|
111
|
+
* that is a link is returned unread, and nothing behind it is listed. Read only.
|
|
112
|
+
*/
|
|
113
|
+
export function recordedLocalProcessPaths(template, root) {
|
|
114
|
+
const contained = normalize(template);
|
|
115
|
+
if (isAbsolute(template) || contained === ".." || contained.startsWith(`..${sep}`))
|
|
116
|
+
throw new Error(`local-process path must stay under .cotal: ${JSON.stringify(template)}`);
|
|
117
|
+
if (!contained.includes("{space}"))
|
|
118
|
+
return [];
|
|
119
|
+
const parts = contained.split(sep);
|
|
120
|
+
const found = [];
|
|
121
|
+
const walk = (dir, at, segment) => {
|
|
122
|
+
let entries;
|
|
123
|
+
try {
|
|
124
|
+
entries = readdirSync(dir, { withFileTypes: true });
|
|
125
|
+
}
|
|
126
|
+
catch (e) {
|
|
127
|
+
const code = e.code;
|
|
128
|
+
if (code !== "ENOENT" && code !== "ENOTDIR")
|
|
129
|
+
found.push({ path: dir, unread: "directory could not be listed" });
|
|
130
|
+
return;
|
|
131
|
+
}
|
|
132
|
+
for (const entry of entries) {
|
|
133
|
+
let bound = segment;
|
|
134
|
+
if (!parts[at].includes("{space}")) {
|
|
135
|
+
if (entry.name !== parts[at])
|
|
136
|
+
continue;
|
|
137
|
+
}
|
|
138
|
+
else {
|
|
139
|
+
bound = segmentIn(parts[at], entry.name);
|
|
140
|
+
if (bound === undefined || (segment !== undefined && bound !== segment))
|
|
141
|
+
continue;
|
|
142
|
+
}
|
|
143
|
+
const path = join(dir, entry.name);
|
|
144
|
+
if (entry.isSymbolicLink())
|
|
145
|
+
found.push({ path, unread: "link, not followed" });
|
|
146
|
+
else if (at < parts.length - 1) {
|
|
147
|
+
if (entry.isDirectory())
|
|
148
|
+
walk(path, at + 1, bound);
|
|
149
|
+
}
|
|
150
|
+
else if (bound === undefined)
|
|
151
|
+
throw new Error(`internal error: ${JSON.stringify(template)} matched ${path} without binding {space}`);
|
|
152
|
+
else
|
|
153
|
+
found.push({ path, ...spaceOfSegment(bound) });
|
|
154
|
+
}
|
|
155
|
+
};
|
|
156
|
+
const base = join(root, ".cotal");
|
|
157
|
+
try {
|
|
158
|
+
if (lstatSync(base).isSymbolicLink())
|
|
159
|
+
return [{ path: base, unread: "link, not followed" }];
|
|
160
|
+
}
|
|
161
|
+
catch (e) {
|
|
162
|
+
if (e.code === "ENOENT")
|
|
163
|
+
return [];
|
|
164
|
+
return [{ path: base, unread: "directory could not be listed" }];
|
|
165
|
+
}
|
|
166
|
+
walk(base, 0, undefined);
|
|
167
|
+
return found;
|
|
168
|
+
}
|
|
169
|
+
/** The most bytes a process record holds. A larger file is not one, and its content is not used. */
|
|
170
|
+
const RECORD_BYTES = 4096;
|
|
171
|
+
/**
|
|
172
|
+
* A record under `<root>/.cotal`, read without leaving it. Every part of the path, `.cotal` included,
|
|
173
|
+
* is checked with `lstat`: a link anywhere on the way is returned unread at the link, and nothing
|
|
174
|
+
* behind it is read. A part that is missing, or a directory part that is not a directory, means no
|
|
175
|
+
* record. The record must be a regular file of at most {@link RECORD_BYTES}, read to its end. The file
|
|
176
|
+
* opened must be the one checked, and its size and modification time must not change while it is read.
|
|
177
|
+
* Read only. Throws for a path outside `<root>/.cotal`.
|
|
178
|
+
*/
|
|
179
|
+
export function readContainedRecord(root, path) {
|
|
180
|
+
const parts = relative(root, path).split(sep);
|
|
181
|
+
if (parts.length < 2 || parts[0] !== ".cotal" || parts.includes("..") || isAbsolute(relative(root, path)))
|
|
182
|
+
throw new Error(`internal error: ${path} is not a record path under ${join(root, ".cotal")}`);
|
|
183
|
+
let at = root;
|
|
184
|
+
for (const part of parts.slice(0, -1)) {
|
|
185
|
+
at = join(at, part);
|
|
186
|
+
const stat = lstatRecordPart(at);
|
|
187
|
+
if ("state" in stat)
|
|
188
|
+
return stat;
|
|
189
|
+
if (!stat.isDirectory())
|
|
190
|
+
return { state: "absent" };
|
|
191
|
+
}
|
|
192
|
+
const leaf = lstatRecordPart(path);
|
|
193
|
+
if ("state" in leaf)
|
|
194
|
+
return leaf;
|
|
195
|
+
if (!leaf.isFile())
|
|
196
|
+
return { state: "unread", at: path, why: "not a regular file, not read" };
|
|
197
|
+
let fd;
|
|
198
|
+
try {
|
|
199
|
+
fd = openSync(path, "r");
|
|
200
|
+
}
|
|
201
|
+
catch (e) {
|
|
202
|
+
return e.code === "ENOENT" ? { state: "absent" } : { state: "unread", at: path, why: "unreadable record" };
|
|
203
|
+
}
|
|
204
|
+
try {
|
|
205
|
+
const opened = fstatSync(fd);
|
|
206
|
+
if (opened.dev !== leaf.dev || opened.ino !== leaf.ino)
|
|
207
|
+
return { state: "unread", at: path, why: "changed while it was read" };
|
|
208
|
+
const buffer = Buffer.alloc(RECORD_BYTES + 1);
|
|
209
|
+
let length = 0, chunk;
|
|
210
|
+
do {
|
|
211
|
+
chunk = readSync(fd, buffer, length, buffer.length - length, length);
|
|
212
|
+
length += chunk;
|
|
213
|
+
} while (chunk > 0 && length < buffer.length);
|
|
214
|
+
if (length > RECORD_BYTES)
|
|
215
|
+
return { state: "unread", at: path, why: "larger than a process record" };
|
|
216
|
+
const after = fstatSync(fd);
|
|
217
|
+
if (length !== opened.size || after.size !== opened.size || after.mtimeMs !== opened.mtimeMs)
|
|
218
|
+
return { state: "unread", at: path, why: "changed while it was read" };
|
|
219
|
+
return { state: "content", raw: buffer.toString("utf8", 0, length).trim() };
|
|
220
|
+
}
|
|
221
|
+
catch {
|
|
222
|
+
return { state: "unread", at: path, why: "unreadable record" };
|
|
223
|
+
}
|
|
224
|
+
finally {
|
|
225
|
+
closeSync(fd);
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
/** One part of a record path, never followed: its `lstat`, or what that part means for the record. */
|
|
229
|
+
function lstatRecordPart(at) {
|
|
230
|
+
try {
|
|
231
|
+
const stat = lstatSync(at);
|
|
232
|
+
return stat.isSymbolicLink() ? { state: "unread", at, why: "link, not followed" } : stat;
|
|
233
|
+
}
|
|
234
|
+
catch (e) {
|
|
235
|
+
const code = e.code;
|
|
236
|
+
return code === "ENOENT" || code === "ENOTDIR" ? { state: "absent" } : { state: "unread", at, why: "unreadable record" };
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
/** The segment `name` binds to every `{space}` in one path part, or undefined when it does not fit. */
|
|
240
|
+
function segmentIn(part, name) {
|
|
241
|
+
const fixed = part.split("{space}");
|
|
242
|
+
const length = (name.length - fixed.join("").length) / (fixed.length - 1);
|
|
243
|
+
if (!Number.isInteger(length) || length < 0)
|
|
244
|
+
return undefined;
|
|
245
|
+
const segment = name.slice(fixed[0].length, fixed[0].length + length);
|
|
246
|
+
return fixed.join(segment) === name ? segment : undefined;
|
|
247
|
+
}
|
|
248
|
+
/** The space a writer spelled as `segment`: the hex key, else the pre-hex encoding, else none. */
|
|
249
|
+
function spaceOfSegment(segment) {
|
|
250
|
+
const space = spaceFromKey(segment);
|
|
251
|
+
if (space !== undefined)
|
|
252
|
+
return { space };
|
|
253
|
+
try {
|
|
254
|
+
const decoded = decodeURIComponent(segment);
|
|
255
|
+
if (encodeURIComponent(decoded) !== segment)
|
|
256
|
+
return {};
|
|
257
|
+
spaceKey(decoded); // throws for a name no space can have
|
|
258
|
+
return { space: decoded };
|
|
259
|
+
}
|
|
260
|
+
catch {
|
|
261
|
+
return {}; // not a pre-hex spelling either
|
|
262
|
+
}
|
|
263
|
+
}
|
|
95
264
|
/**
|
|
96
265
|
* The record to READ: the canonical space-keyed path, or a pre-upgrade one when that is the only
|
|
97
266
|
* spelling present.
|
|
@@ -226,6 +395,6 @@ function existsByteExact(p) {
|
|
|
226
395
|
}
|
|
227
396
|
}
|
|
228
397
|
export function localProcessVisible(process, context) {
|
|
229
|
-
return process.visibleWhen !== "user-auth" || context.userAuth === true;
|
|
398
|
+
return process.controllerOnly !== true && (process.visibleWhen !== "user-auth" || context.userAuth === true);
|
|
230
399
|
}
|
|
231
400
|
//# sourceMappingURL=local-process.js.map
|