@cotal-ai/manager 0.190.0 → 0.192.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/README.md +9 -5
- package/dist/boot.d.ts.map +1 -1
- package/dist/boot.js +3 -0
- package/dist/boot.js.map +1 -1
- package/dist/command-dispatch.d.ts +2 -0
- package/dist/command-dispatch.d.ts.map +1 -1
- package/dist/command-dispatch.js +8 -0
- package/dist/command-dispatch.js.map +1 -1
- package/dist/commands.d.ts +4 -0
- package/dist/commands.d.ts.map +1 -1
- package/dist/commands.js +57 -20
- package/dist/commands.js.map +1 -1
- package/dist/connector-inventory.d.ts +20 -3
- package/dist/connector-inventory.d.ts.map +1 -1
- package/dist/connector-inventory.js +65 -13
- package/dist/connector-inventory.js.map +1 -1
- package/dist/harness-resolution.d.ts +14 -2
- package/dist/harness-resolution.d.ts.map +1 -1
- package/dist/harness-resolution.js +16 -2
- package/dist/harness-resolution.js.map +1 -1
- package/dist/harness-sessions-contract.d.ts +115 -0
- package/dist/harness-sessions-contract.d.ts.map +1 -0
- package/dist/harness-sessions-contract.js +53 -0
- package/dist/harness-sessions-contract.js.map +1 -0
- package/dist/harness-sessions.d.ts +116 -0
- package/dist/harness-sessions.d.ts.map +1 -0
- package/dist/harness-sessions.js +335 -0
- package/dist/harness-sessions.js.map +1 -0
- package/dist/hosted-connector-observation.d.ts +7 -0
- package/dist/hosted-connector-observation.d.ts.map +1 -0
- package/dist/hosted-connector-observation.js +13 -0
- package/dist/hosted-connector-observation.js.map +1 -0
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/interrupted-run-recovery.d.ts +30 -0
- package/dist/interrupted-run-recovery.d.ts.map +1 -0
- package/dist/interrupted-run-recovery.js +156 -0
- package/dist/interrupted-run-recovery.js.map +1 -0
- package/dist/interrupted-run-retry.d.ts +11 -0
- package/dist/interrupted-run-retry.d.ts.map +1 -0
- package/dist/interrupted-run-retry.js +44 -0
- package/dist/interrupted-run-retry.js.map +1 -0
- package/dist/launch.d.ts.map +1 -1
- package/dist/launch.js +5 -20
- package/dist/launch.js.map +1 -1
- package/dist/maintenance-contract.d.ts +57 -0
- package/dist/maintenance-contract.d.ts.map +1 -0
- package/dist/maintenance-contract.js +19 -0
- package/dist/maintenance-contract.js.map +1 -0
- package/dist/manager-config.d.ts +6 -3
- package/dist/manager-config.d.ts.map +1 -1
- package/dist/manager-config.js +6 -1
- package/dist/manager-config.js.map +1 -1
- package/dist/manager-service-contract.d.ts +15 -1
- package/dist/manager-service-contract.d.ts.map +1 -1
- package/dist/manager-service-contract.js +17 -19
- package/dist/manager-service-contract.js.map +1 -1
- package/dist/manager.d.ts +15 -12
- package/dist/manager.d.ts.map +1 -1
- package/dist/manager.js +8 -1
- package/dist/manager.js.map +1 -1
- package/dist/names-capacity.d.ts +1 -0
- package/dist/names-capacity.d.ts.map +1 -1
- package/dist/names-capacity.js +5 -3
- package/dist/names-capacity.js.map +1 -1
- package/dist/preservation.d.ts +2 -2
- package/dist/preservation.d.ts.map +1 -1
- package/dist/preservation.js +16 -5
- package/dist/preservation.js.map +1 -1
- package/dist/preserved-resume.d.ts +3 -4
- package/dist/preserved-resume.d.ts.map +1 -1
- package/dist/preserved-resume.js +21 -18
- package/dist/preserved-resume.js.map +1 -1
- package/dist/readiness-wait.d.ts.map +1 -1
- package/dist/readiness-wait.js +5 -1
- package/dist/readiness-wait.js.map +1 -1
- package/dist/resume.d.ts +2 -5
- package/dist/resume.d.ts.map +1 -1
- package/dist/resume.js +20 -8
- package/dist/resume.js.map +1 -1
- package/dist/run-hosting.d.ts +18 -0
- package/dist/run-hosting.d.ts.map +1 -1
- package/dist/run-hosting.js +115 -17
- package/dist/run-hosting.js.map +1 -1
- package/dist/runtime/custodial-pty.d.ts.map +1 -1
- package/dist/runtime/custodial-pty.js +2 -0
- package/dist/runtime/custodial-pty.js.map +1 -1
- package/dist/runtime/headless.d.ts +4 -0
- package/dist/runtime/headless.d.ts.map +1 -0
- package/dist/runtime/headless.js +62 -0
- package/dist/runtime/headless.js.map +1 -0
- package/dist/runtime/pty.d.ts.map +1 -1
- package/dist/runtime/pty.js +3 -0
- package/dist/runtime/pty.js.map +1 -1
- package/dist/seat-launch.d.ts +12 -0
- package/dist/seat-launch.d.ts.map +1 -1
- package/dist/seat-launch.js +36 -0
- package/dist/seat-launch.js.map +1 -1
- package/dist/seat-start.d.ts +1 -0
- package/dist/seat-start.d.ts.map +1 -1
- package/dist/seat-start.js +13 -7
- package/dist/seat-start.js.map +1 -1
- package/dist/seat-types.d.ts +9 -1
- package/dist/seat-types.d.ts.map +1 -1
- package/dist/service-adapter.d.ts.map +1 -1
- package/dist/service-adapter.js +2 -0
- package/dist/service-adapter.js.map +1 -1
- package/dist/status-and-models.d.ts +2 -0
- package/dist/status-and-models.d.ts.map +1 -1
- package/dist/status-and-models.js +14 -3
- package/dist/status-and-models.js.map +1 -1
- package/dist/terminal-input.d.ts.map +1 -1
- package/dist/terminal-input.js +8 -0
- package/dist/terminal-input.js.map +1 -1
- package/package.json +12 -12
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { CommandInput, Connector, CotalConfig, LaunchChoice, LaunchModes, LaunchOpts, ModelCatalog } from "@cotal-ai/core";
|
|
1
|
+
import type { CommandInput, Connector, CotalConfig, FixedOptions, LaunchChoice, LaunchModes, LaunchOpts, ModelCatalog } from "@cotal-ai/core";
|
|
2
2
|
import type { Manager } from "./manager.js";
|
|
3
3
|
import type { ManagerParts } from "./manager-parts.js";
|
|
4
4
|
import type { ManagerConfig } from "./manager-config.js";
|
|
@@ -6,13 +6,24 @@ import type { ManagerConfig } from "./manager-config.js";
|
|
|
6
6
|
export declare class ConnectorNotInstalled extends Error {
|
|
7
7
|
}
|
|
8
8
|
/** The opt-in launch fields a seat keeps, each present only when asked, so a launch without them is
|
|
9
|
-
* built and recorded as before and every relaunch of the seat asks as its spawn did.
|
|
9
|
+
* built and recorded as before and every relaunch of the seat asks as its spawn did. Fixed options
|
|
10
|
+
* are kept as named, and absent when none were named. */
|
|
10
11
|
export declare function optInLaunchFields(launch: {
|
|
11
12
|
askPermissions?: boolean;
|
|
12
13
|
reasoningEvents?: boolean;
|
|
14
|
+
fixedOptions?: FixedOptions;
|
|
13
15
|
}): {
|
|
14
16
|
askPermissions?: true;
|
|
15
17
|
reasoningEvents?: true;
|
|
18
|
+
fixedOptions?: FixedOptions;
|
|
19
|
+
};
|
|
20
|
+
/** The fixed options a launch this Manager builds hands its seat, from the Manager's own launch record
|
|
21
|
+
* (SPEC 13.22 Settings). Absent when none were named, and the seat then keeps every widening setting
|
|
22
|
+
* as launched. */
|
|
23
|
+
export declare function launchFixedOptions(launch: {
|
|
24
|
+
fixedOptions?: FixedOptions;
|
|
25
|
+
}): {
|
|
26
|
+
fixedOptions?: FixedOptions;
|
|
16
27
|
};
|
|
17
28
|
/** One connector's declared harness binaries resolved on PATH now, keeping any pinned paths while
|
|
18
29
|
* they still exist and resolve on PATH, and refusing rather than silently switching executables if a
|
|
@@ -80,6 +91,7 @@ export declare class HarnessResolution {
|
|
|
80
91
|
exact: boolean;
|
|
81
92
|
askPermissions?: boolean;
|
|
82
93
|
reasoningEvents?: boolean;
|
|
94
|
+
fixedOptions?: FixedOptions;
|
|
83
95
|
events: boolean;
|
|
84
96
|
}): string | undefined;
|
|
85
97
|
/** Read the connector's catalog from its harness now and keep it for spawn checks. A read that fails,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"harness-resolution.d.ts","sourceRoot":"","sources":["../src/harness-resolution.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,WAAW,EAAE,YAAY,EAAE,WAAW,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"harness-resolution.d.ts","sourceRoot":"","sources":["../src/harness-resolution.ts"],"names":[],"mappings":"A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C;IAqBxK;gFAC4E;IAC5E,iBAAiB,CACf,SAAS,EAAE,SAAS,EACpB,MAAM,EAAE;QAAE,OAAO,CAAC,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,WAAW,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAC;QAAC,YAAY,CAAC,EAAE,YAAY,CAAC;QAAC,KAAK,EAAE,OAAO,CAAC;QAAC,cAAc,CAAC,EAAE,OAAO,CAAC;QAAC,eAAe,CAAC,EAAE,OAAO,CAAC;QAAC,YAAY,CAAC,EAAE,YAAY,CAAC;QAAC,MAAM,EAAE,OAAO,CAAA;KAAE,GACjN,MAAM,GAAG,SAAS;IAuBrB;;kGAE8F;IAC9F,WAAW,CAAC,SAAS,EAAE,SAAS,EAAE,QAAQ,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,GAAG,SAAS,EAAE,QAAQ,EAAE,SAAS,MAAM,EAAE,GAAG,SAAS,EAAE,OAAO,UAAQ,GAAG,OAAO,CAAC,YAAY,CAAC;IAQ1K;uGACmG;IACnG,cAAc,CAAC,SAAS,EAAE,SAAS,EAAE,QAAQ,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,GAAG,SAAS,EAAE,QAAQ,EAAE,SAAS,MAAM,EAAE,GAAG,SAAS,EAAE,MAAM,EAAE,YAAY,GAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC;IAOxL;;0GAEsG;IACtG,aAAa,CAAC,SAAS,EAAE,SAAS,EAAE,MAAM,EAAE,OAAO,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS;CASrF"}
|
|
@@ -5,9 +5,20 @@ import { connectorInstallHint, manifestExtensionNames, materializeFromManifest,
|
|
|
5
5
|
export class ConnectorNotInstalled extends Error {
|
|
6
6
|
}
|
|
7
7
|
/** The opt-in launch fields a seat keeps, each present only when asked, so a launch without them is
|
|
8
|
-
* built and recorded as before and every relaunch of the seat asks as its spawn did.
|
|
8
|
+
* built and recorded as before and every relaunch of the seat asks as its spawn did. Fixed options
|
|
9
|
+
* are kept as named, and absent when none were named. */
|
|
9
10
|
export function optInLaunchFields(launch) {
|
|
10
|
-
return {
|
|
11
|
+
return {
|
|
12
|
+
...(launch.askPermissions ? { askPermissions: true } : {}),
|
|
13
|
+
...(launch.reasoningEvents ? { reasoningEvents: true } : {}),
|
|
14
|
+
...(launch.fixedOptions && Object.keys(launch.fixedOptions).length ? { fixedOptions: launch.fixedOptions } : {}),
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
/** The fixed options a launch this Manager builds hands its seat, from the Manager's own launch record
|
|
18
|
+
* (SPEC 13.22 Settings). Absent when none were named, and the seat then keeps every widening setting
|
|
19
|
+
* as launched. */
|
|
20
|
+
export function launchFixedOptions(launch) {
|
|
21
|
+
return launch.fixedOptions && Object.keys(launch.fixedOptions).length ? { fixedOptions: launch.fixedOptions } : {};
|
|
11
22
|
}
|
|
12
23
|
/** The harness files and spawn.env names a catalog was read with, so a kept catalog serves only a
|
|
13
24
|
* launch that would read the same one. */
|
|
@@ -155,6 +166,9 @@ export class HarnessResolution {
|
|
|
155
166
|
return `${connector.name} connector does not support reasoning events (reasoningEvents)`;
|
|
156
167
|
if (launch.reasoningEvents && !launch.events)
|
|
157
168
|
return "reasoningEvents needs the event plane, and this launch has none (events: false)";
|
|
169
|
+
const unenforced = Object.keys(launch.fixedOptions ?? {}).filter((id) => !connector.fixedOptions?.includes(id));
|
|
170
|
+
if (unenforced.length)
|
|
171
|
+
return `${connector.name} seats do not enforce fixed values for ${unenforced.join(", ")} (fixedOptions)${connector.fixedOptions?.length ? `; they enforce ${connector.fixedOptions.join(", ")}` : ""}`;
|
|
158
172
|
if (launch.firstCommand && !connector.commands?.targets.includes(launch.firstCommand.target))
|
|
159
173
|
return `${connector.name} seats run no ${launch.firstCommand.target}s, so a spawn cannot name one as their first command (firstCommand)`;
|
|
160
174
|
if (launch.exact && (!connector.supportsSessionReopen || !connector.supportsSessionContinuation))
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"harness-resolution.js","sourceRoot":"","sources":["../src/harness-resolution.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC/C,OAAO,EAAE,oBAAoB,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAEnH,OAAO,EAAE,oBAAoB,EAAE,sBAAsB,EAAE,uBAAuB,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAK3H,0FAA0F;AAC1F,MAAM,OAAO,qBAAsB,SAAQ,KAAK;CAAG;AAEnD;
|
|
1
|
+
{"version":3,"file":"harness-resolution.js","sourceRoot":"","sources":["../src/harness-resolution.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC/C,OAAO,EAAE,oBAAoB,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAEnH,OAAO,EAAE,oBAAoB,EAAE,sBAAsB,EAAE,uBAAuB,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAK3H,0FAA0F;AAC1F,MAAM,OAAO,qBAAsB,SAAQ,KAAK;CAAG;AAEnD;;0DAE0D;AAC1D,MAAM,UAAU,iBAAiB,CAAC,MAA4F;IAC5H,OAAO;QACL,GAAG,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC,CAAC,EAAE,cAAc,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QAC1D,GAAG,CAAC,MAAM,CAAC,eAAe,CAAC,CAAC,CAAC,EAAE,eAAe,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QAC5D,GAAG,CAAC,MAAM,CAAC,YAAY,IAAI,MAAM,CAAC,IAAI,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AC,WAAW,CAAC,SAAS,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC;QACxH,CAAC,CAAC,CAAC;IACL,CAAC;IAED;;0GAEsG;IACtG,aAAa,CAAC,SAAoB,EAAE,MAA2B;QAC7D,IAAI,IAAI,CAAC,MAAM,CAAC,cAAc,IAAI,MAAM,KAAK,KAAK;YAChD,OAAO,UAAU,IAAI,CAAC,MAAM,CAAC,KAAK,+GAA+G,CAAC;QACpJ,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,cAAc,IAAI,MAAM,KAAK,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,YAAY;YAC5E,OAAO,IAAI,CAAC,MAAM,CAAC,cAAc;gBAC/B,CAAC,CAAC,UAAU,IAAI,CAAC,MAAM,CAAC,KAAK,qEAAqE,SAAS,CAAC,IAAI,wBAAwB;gBACxI,CAAC,CAAC,cAAc,SAAS,CAAC,IAAI,iFAAiF,CAAC;QACpH,OAAO,SAAS,CAAC;IACnB,CAAC;CACF"}
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
/** `harness-sessions` (Manager revision 59): the saved sessions a harness keeps for `cwd` on this
|
|
2
|
+
* manager's host, each named by an opaque `ncs1_` handle that only a `spawn`'s `resume` on this
|
|
3
|
+
* instance resolves, and the seat modes the connector's launch catalog offers. Owner-only: minted
|
|
4
|
+
* only into a person's interactive manager view. */
|
|
5
|
+
export declare const HARNESS_SESSIONS_INPUT_SCHEMA: {
|
|
6
|
+
readonly type: "object";
|
|
7
|
+
readonly additionalProperties: false;
|
|
8
|
+
readonly required: readonly ["agent", "cwd"];
|
|
9
|
+
readonly properties: {
|
|
10
|
+
readonly agent: {
|
|
11
|
+
readonly type: "string";
|
|
12
|
+
readonly minLength: 1;
|
|
13
|
+
readonly maxLength: 64;
|
|
14
|
+
};
|
|
15
|
+
readonly cwd: {
|
|
16
|
+
readonly type: "string";
|
|
17
|
+
readonly minLength: 1;
|
|
18
|
+
readonly maxLength: 1024;
|
|
19
|
+
};
|
|
20
|
+
readonly cursor: {
|
|
21
|
+
readonly type: "string";
|
|
22
|
+
readonly pattern: "^[A-Za-z0-9_-]{24,96}$";
|
|
23
|
+
};
|
|
24
|
+
readonly limit: {
|
|
25
|
+
readonly type: "integer";
|
|
26
|
+
readonly minimum: 1;
|
|
27
|
+
readonly maximum: 32;
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
export declare const HARNESS_SESSIONS_OUTPUT_SCHEMA: {
|
|
32
|
+
readonly type: "object";
|
|
33
|
+
readonly additionalProperties: false;
|
|
34
|
+
readonly required: readonly ["sessions"];
|
|
35
|
+
readonly properties: {
|
|
36
|
+
readonly modes: {
|
|
37
|
+
readonly type: "array";
|
|
38
|
+
readonly minItems: 1;
|
|
39
|
+
readonly maxItems: 8;
|
|
40
|
+
readonly items: {
|
|
41
|
+
readonly type: "object";
|
|
42
|
+
readonly additionalProperties: false;
|
|
43
|
+
readonly required: readonly ["id", "label"];
|
|
44
|
+
readonly properties: {
|
|
45
|
+
readonly id: {
|
|
46
|
+
readonly type: "string";
|
|
47
|
+
readonly pattern: "^[a-z0-9-]{1,32}$";
|
|
48
|
+
};
|
|
49
|
+
readonly label: {
|
|
50
|
+
readonly type: "string";
|
|
51
|
+
readonly minLength: 1;
|
|
52
|
+
readonly maxLength: 80;
|
|
53
|
+
};
|
|
54
|
+
};
|
|
55
|
+
};
|
|
56
|
+
};
|
|
57
|
+
readonly sessions: {
|
|
58
|
+
readonly oneOf: readonly [{
|
|
59
|
+
readonly type: "object";
|
|
60
|
+
readonly additionalProperties: false;
|
|
61
|
+
readonly required: readonly ["supported", "items"];
|
|
62
|
+
readonly properties: {
|
|
63
|
+
readonly supported: {
|
|
64
|
+
readonly const: true;
|
|
65
|
+
};
|
|
66
|
+
readonly items: {
|
|
67
|
+
readonly type: "array";
|
|
68
|
+
readonly maxItems: 32;
|
|
69
|
+
readonly items: {
|
|
70
|
+
readonly type: "object";
|
|
71
|
+
readonly additionalProperties: false;
|
|
72
|
+
readonly required: readonly ["handle", "title", "state"];
|
|
73
|
+
readonly properties: {
|
|
74
|
+
readonly handle: {
|
|
75
|
+
readonly type: "string";
|
|
76
|
+
readonly pattern: "^ncs1_[A-Za-z0-9_-]{24,96}$";
|
|
77
|
+
};
|
|
78
|
+
readonly title: {
|
|
79
|
+
readonly type: "string";
|
|
80
|
+
readonly minLength: 1;
|
|
81
|
+
readonly maxLength: 120;
|
|
82
|
+
};
|
|
83
|
+
readonly updatedAt: {
|
|
84
|
+
readonly type: "string";
|
|
85
|
+
readonly pattern: "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$";
|
|
86
|
+
};
|
|
87
|
+
readonly state: {
|
|
88
|
+
readonly enum: readonly ["saved", "active", "archived", "unknown"];
|
|
89
|
+
};
|
|
90
|
+
};
|
|
91
|
+
};
|
|
92
|
+
};
|
|
93
|
+
};
|
|
94
|
+
}, {
|
|
95
|
+
readonly type: "object";
|
|
96
|
+
readonly additionalProperties: false;
|
|
97
|
+
readonly required: readonly ["supported", "reason"];
|
|
98
|
+
readonly properties: {
|
|
99
|
+
readonly supported: {
|
|
100
|
+
readonly const: false;
|
|
101
|
+
};
|
|
102
|
+
readonly reason: {
|
|
103
|
+
readonly type: "string";
|
|
104
|
+
readonly minLength: 1;
|
|
105
|
+
};
|
|
106
|
+
};
|
|
107
|
+
}];
|
|
108
|
+
};
|
|
109
|
+
readonly nextCursor: {
|
|
110
|
+
readonly type: "string";
|
|
111
|
+
readonly pattern: "^[A-Za-z0-9_-]{24,96}$";
|
|
112
|
+
};
|
|
113
|
+
};
|
|
114
|
+
};
|
|
115
|
+
//# sourceMappingURL=harness-sessions-contract.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"harness-sessions-contract.d.ts","sourceRoot":"","sources":["../src/harness-sessions-contract.ts"],"names":[],"mappings":"AAAA;;;qDAGqD;AACrD,eAAO,MAAM,6BAA6B;;;;;;;;;;;;;;;;;;;;;;;;;CAQhC,CAAC;AACX,eAAO,MAAM,8BAA8B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsCjC,CAAC"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/** `harness-sessions` (Manager revision 59): the saved sessions a harness keeps for `cwd` on this
|
|
2
|
+
* manager's host, each named by an opaque `ncs1_` handle that only a `spawn`'s `resume` on this
|
|
3
|
+
* instance resolves, and the seat modes the connector's launch catalog offers. Owner-only: minted
|
|
4
|
+
* only into a person's interactive manager view. */
|
|
5
|
+
export const HARNESS_SESSIONS_INPUT_SCHEMA = {
|
|
6
|
+
type: "object", additionalProperties: false, required: ["agent", "cwd"],
|
|
7
|
+
properties: {
|
|
8
|
+
agent: { type: "string", minLength: 1, maxLength: 64 },
|
|
9
|
+
cwd: { type: "string", minLength: 1, maxLength: 1024 },
|
|
10
|
+
cursor: { type: "string", pattern: "^[A-Za-z0-9_-]{24,96}$" },
|
|
11
|
+
limit: { type: "integer", minimum: 1, maximum: 32 },
|
|
12
|
+
},
|
|
13
|
+
};
|
|
14
|
+
export const HARNESS_SESSIONS_OUTPUT_SCHEMA = {
|
|
15
|
+
type: "object", additionalProperties: false, required: ["sessions"],
|
|
16
|
+
properties: {
|
|
17
|
+
modes: {
|
|
18
|
+
type: "array", minItems: 1, maxItems: 8,
|
|
19
|
+
items: {
|
|
20
|
+
type: "object", additionalProperties: false, required: ["id", "label"],
|
|
21
|
+
properties: { id: { type: "string", pattern: "^[a-z0-9-]{1,32}$" }, label: { type: "string", minLength: 1, maxLength: 80 } },
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
sessions: {
|
|
25
|
+
oneOf: [
|
|
26
|
+
{
|
|
27
|
+
type: "object", additionalProperties: false, required: ["supported", "items"],
|
|
28
|
+
properties: {
|
|
29
|
+
supported: { const: true },
|
|
30
|
+
items: {
|
|
31
|
+
type: "array", maxItems: 32,
|
|
32
|
+
items: {
|
|
33
|
+
type: "object", additionalProperties: false, required: ["handle", "title", "state"],
|
|
34
|
+
properties: {
|
|
35
|
+
handle: { type: "string", pattern: "^ncs1_[A-Za-z0-9_-]{24,96}$" },
|
|
36
|
+
title: { type: "string", minLength: 1, maxLength: 120 },
|
|
37
|
+
updatedAt: { type: "string", pattern: "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$" },
|
|
38
|
+
state: { enum: ["saved", "active", "archived", "unknown"] },
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
type: "object", additionalProperties: false, required: ["supported", "reason"],
|
|
46
|
+
properties: { supported: { const: false }, reason: { type: "string", minLength: 1 } },
|
|
47
|
+
},
|
|
48
|
+
],
|
|
49
|
+
},
|
|
50
|
+
nextCursor: { type: "string", pattern: "^[A-Za-z0-9_-]{24,96}$" },
|
|
51
|
+
},
|
|
52
|
+
};
|
|
53
|
+
//# sourceMappingURL=harness-sessions-contract.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"harness-sessions-contract.js","sourceRoot":"","sources":["../src/harness-sessions-contract.ts"],"names":[],"mappings":"AAAA;;;qDAGqD;AACrD,MAAM,CAAC,MAAM,6BAA6B,GAAG;IAC3C,IAAI,EAAE,QAAQ,EAAE,oBAAoB,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC,OAAO,EAAE,KAAK,CAAC;IACvE,UAAU,EAAE;QACV,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,CAAC,EAAE,SAAS,EAAE,EAAE,EAAE;QACtD,GAAG,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE;QACtD,MAAM,EAAE,EAAE,IAAI,EAAE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CAClE,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,CAAC,EAAE,SAAS,EAAE,GAAG,EAAE;oCACvD,SAAS,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,uDAAuD,EAAE;oCAC/F,KAAK,EAAE,EAAE,IAAI,EAAE,CAAC,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,SAAS,CAAC,EAAE;iCAC5D;6BACF;yBACF;qBACF;iBACF;gBACD;oBACE,IAAI,EAAE,QAAQ,EAAE,oBAAoB,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC,WAAW,EAAE,QAAQ,CAAC;oBAC9E,UAAU,EAAE,EAAE,SAAS,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,CAAC,EAAE,EAAE;iBACtF;aACF;SACF;QACD,UAAU,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,wBAAwB,EAAE;KAClE;CACO,CAAC"}
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import { type Connector, type EpCaller, type SavedSessionInfo, type SeatModeInfo } from "@cotal-ai/core";
|
|
2
|
+
import type { ManagerParts } from "./manager-parts.js";
|
|
3
|
+
import type { Runtime } from "./runtime/index.js";
|
|
4
|
+
/** The prefix every handle starts with. A legacy plain `resume` value never takes it. */
|
|
5
|
+
export declare const SESSION_HANDLE_PREFIX = "ncs1_";
|
|
6
|
+
/** How long a listed handle resolves. */
|
|
7
|
+
export declare const SESSION_HANDLE_TTL_MS = 120000;
|
|
8
|
+
/** The most rows one reply carries, and the default page. */
|
|
9
|
+
export declare const SESSION_LIST_MAX = 32;
|
|
10
|
+
export declare const SESSION_LIST_DEFAULT = 20;
|
|
11
|
+
/** The most live handles, and the most live cursors, this Manager keeps at once. A listing is
|
|
12
|
+
* admitted only when a handle for every row it may hand out, on this page and on the pages its cursor
|
|
13
|
+
* serves later, fits beside those already held; one that does not is refused `resource-exhausted` and
|
|
14
|
+
* issues nothing. So a live handle or cursor is never dropped before its 120 seconds end, and a
|
|
15
|
+
* cursor's next page always fits. */
|
|
16
|
+
export declare const HANDLE_TABLE_MAX = 4096;
|
|
17
|
+
type SessionRow = {
|
|
18
|
+
handle: string;
|
|
19
|
+
title: string;
|
|
20
|
+
updatedAt?: string;
|
|
21
|
+
state: SavedSessionInfo["state"];
|
|
22
|
+
};
|
|
23
|
+
export type HarnessSessionsOutput = {
|
|
24
|
+
modes?: {
|
|
25
|
+
id: string;
|
|
26
|
+
label: string;
|
|
27
|
+
}[];
|
|
28
|
+
sessions: {
|
|
29
|
+
supported: true;
|
|
30
|
+
items: SessionRow[];
|
|
31
|
+
} | {
|
|
32
|
+
supported: false;
|
|
33
|
+
reason: string;
|
|
34
|
+
};
|
|
35
|
+
nextCursor?: string;
|
|
36
|
+
};
|
|
37
|
+
/** The handle a `resume` names, or undefined for a legacy session id. */
|
|
38
|
+
export declare function isSessionHandle(resume: string | undefined): resume is string;
|
|
39
|
+
/** The connector's seat modes as the reply carries them: one to eight unique rows, or absent when the
|
|
40
|
+
* connector offers no selector. A malformed list is the connector's fault and refuses the read. */
|
|
41
|
+
export declare function connectorSeatModes(connector: Connector, resolvedBinaries?: Readonly<Record<string, string>>): SeatModeInfo[] | undefined;
|
|
42
|
+
/** Why a launch cannot run its `launchOptions["seat-mode"]`, or undefined when it can. A launch that
|
|
43
|
+
* does not name one keeps the connector's default. A value the connector does not list is refused,
|
|
44
|
+
* and so is any value but the default on a runtime that does not run the seat as a local child. */
|
|
45
|
+
export declare function seatModeRefusal(connector: Connector, runtime: Pick<Runtime, "kind" | "spawnDelegated">, launchOptions: Record<string, unknown> | undefined, resolvedBinaries?: Readonly<Record<string, string>>): string | undefined;
|
|
46
|
+
/** The saved-session listings and the handles they issued, held in memory for this Manager process
|
|
47
|
+
* only: a restarted Manager knows none, so every handle it issued refuses as expired. */
|
|
48
|
+
export declare class HarnessSessions {
|
|
49
|
+
private readonly parts;
|
|
50
|
+
private readonly host;
|
|
51
|
+
private readonly handles;
|
|
52
|
+
private readonly pages;
|
|
53
|
+
/** The handle slots the kept cursors hold for the rows they have still to hand out. */
|
|
54
|
+
private reserved;
|
|
55
|
+
constructor(parts: Pick<ManagerParts, "connectorInventory" | "harnessResolution">, host: {
|
|
56
|
+
workspaceRoot: () => string;
|
|
57
|
+
/** The owner this Manager runs for, or undefined when it cannot name one (a static or open
|
|
58
|
+
* mesh, or a local user-auth Manager that launches for several owners). */
|
|
59
|
+
owner: () => string | undefined;
|
|
60
|
+
runtime: () => Pick<Runtime, "kind" | "spawnDelegated">;
|
|
61
|
+
resolveSpawnCwd: (value: unknown) => {
|
|
62
|
+
cwd: string;
|
|
63
|
+
};
|
|
64
|
+
now?: () => number;
|
|
65
|
+
});
|
|
66
|
+
private now;
|
|
67
|
+
private sweep;
|
|
68
|
+
/** The listing's directory, resolved as `resolve-cwd` does. A refusal names only the value the
|
|
69
|
+
* caller sent; the filesystem's own diagnostic stays in this host's log. */
|
|
70
|
+
private cwdOf;
|
|
71
|
+
/** The owner check: the caller must be the person this Manager runs for, on a runtime that runs
|
|
72
|
+
* seats on this host. An installation that cannot name that person or that host serves no saved
|
|
73
|
+
* sessions. */
|
|
74
|
+
private admit;
|
|
75
|
+
/** Serve one `harness-sessions` request. */
|
|
76
|
+
list(args: Record<string, unknown>, caller: EpCaller): Promise<HarnessSessionsOutput>;
|
|
77
|
+
/** The seat modes this launch catalog offers, or nothing for a connector without a selector. A
|
|
78
|
+
* runtime that does not run seats as local children offers only the default. */
|
|
79
|
+
private launchModes;
|
|
80
|
+
/** The connector's rows, checked: a row with no usable id, title, revision or state is the
|
|
81
|
+
* connector's fault. A title is cut to 120 characters, and one that shows the session's id, the
|
|
82
|
+
* directory, the store or this host's home directory is replaced with a neutral title. A time that
|
|
83
|
+
* is not RFC 3339 UTC is left out. */
|
|
84
|
+
private fit;
|
|
85
|
+
/** One page of `listing`, issuing a handle per row, and the cursor to the rest when any is left.
|
|
86
|
+
* `spent` is the cursor this page continues: its reserved slots pay for this page and the next. */
|
|
87
|
+
private page;
|
|
88
|
+
/** The next page of a kept listing. The cursor, its caller and its agent are checked before any
|
|
89
|
+
* directory work, and a `cwd` that does not resolve, or resolves elsewhere, is `not-found` like
|
|
90
|
+
* any other use the cursor was not issued for. */
|
|
91
|
+
private nextPage;
|
|
92
|
+
/** Resolve a spawn's handle to the session id it stands for, before anything is provisioned. The
|
|
93
|
+
* handle must have been issued by this Manager process to this exact caller for this connector and
|
|
94
|
+
* directory, within the last 120 seconds, and the session must still be listed unchanged from the
|
|
95
|
+
* same native store. The request id binds it: a retry of the same request resolves it again, and
|
|
96
|
+
* any other request is refused. The request claims the handle before the native record is read
|
|
97
|
+
* again, and the claim, the handle and its expiry are checked once more after that read, so two
|
|
98
|
+
* requests at once never both take it and a read that ends after the 120 seconds refuses. A read
|
|
99
|
+
* that failed releases a claim this request made, so a later request may try again; a record that
|
|
100
|
+
* changed, left or moved store revokes the handle. A refusal never falls back to reading the value
|
|
101
|
+
* as a session id. */
|
|
102
|
+
resolve(handle: string, opts: {
|
|
103
|
+
caller: EpCaller | undefined;
|
|
104
|
+
connector: Connector;
|
|
105
|
+
cwd: string;
|
|
106
|
+
requestId: string | undefined;
|
|
107
|
+
resolvedBinaries?: Readonly<Record<string, string>>;
|
|
108
|
+
envAllow?: readonly string[];
|
|
109
|
+
}): Promise<{
|
|
110
|
+
sessionId: string;
|
|
111
|
+
} | {
|
|
112
|
+
refusal: string;
|
|
113
|
+
}>;
|
|
114
|
+
}
|
|
115
|
+
export {};
|
|
116
|
+
//# sourceMappingURL=harness-sessions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"harness-sessions.d.ts","sourceRoot":"","sources":["../src/harness-sessions.ts"],"names":[],"mappings":"AAYA,OAAO,EAA6G,KAAK,SAAS,EAAE,KAAK,QAAQ,EAAE,KAAK,gBAAgB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