@cotal-ai/manager 0.171.4 → 0.171.5
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/dist/boot.d.ts +162 -0
- package/dist/boot.d.ts.map +1 -0
- package/dist/boot.js +627 -0
- package/dist/boot.js.map +1 -0
- package/dist/broker-transport.d.ts +6 -0
- package/dist/broker-transport.d.ts.map +1 -1
- package/dist/broker-transport.js +25 -6
- package/dist/broker-transport.js.map +1 -1
- package/dist/command-dispatch.d.ts +3 -0
- package/dist/command-dispatch.d.ts.map +1 -1
- package/dist/command-dispatch.js +67 -0
- package/dist/command-dispatch.js.map +1 -1
- package/dist/connector-inventory.d.ts +3 -0
- package/dist/connector-inventory.d.ts.map +1 -1
- package/dist/connector-inventory.js +17 -0
- package/dist/connector-inventory.js.map +1 -1
- package/dist/credential-renewal.d.ts +5 -1
- package/dist/credential-renewal.d.ts.map +1 -1
- package/dist/credential-renewal.js +65 -3
- package/dist/credential-renewal.js.map +1 -1
- package/dist/goal-writer.d.ts +3 -0
- package/dist/goal-writer.d.ts.map +1 -1
- package/dist/goal-writer.js +30 -0
- package/dist/goal-writer.js.map +1 -1
- package/dist/harness-resolution.d.ts +3 -0
- package/dist/harness-resolution.d.ts.map +1 -1
- package/dist/harness-resolution.js +14 -0
- package/dist/harness-resolution.js.map +1 -1
- package/dist/lease-keeper.d.ts +4 -0
- package/dist/lease-keeper.d.ts.map +1 -1
- package/dist/lease-keeper.js +10 -0
- package/dist/lease-keeper.js.map +1 -1
- package/dist/managed-static-lifecycle.d.ts +3 -0
- package/dist/managed-static-lifecycle.d.ts.map +1 -1
- package/dist/managed-static-lifecycle.js +42 -0
- package/dist/managed-static-lifecycle.js.map +1 -1
- package/dist/manager.d.ts +549 -354
- package/dist/manager.d.ts.map +1 -1
- package/dist/manager.js +86 -2222
- package/dist/manager.js.map +1 -1
- package/dist/names-capacity.d.ts +4 -0
- package/dist/names-capacity.d.ts.map +1 -1
- package/dist/names-capacity.js +29 -0
- package/dist/names-capacity.js.map +1 -1
- package/dist/persona-catalog.d.ts +3 -0
- package/dist/persona-catalog.d.ts.map +1 -1
- package/dist/persona-catalog.js +19 -0
- package/dist/persona-catalog.js.map +1 -1
- package/dist/preservation.d.ts +3 -0
- package/dist/preservation.d.ts.map +1 -1
- package/dist/preservation.js +48 -0
- package/dist/preservation.js.map +1 -1
- package/dist/preserved-resume.d.ts +220 -0
- package/dist/preserved-resume.d.ts.map +1 -0
- package/dist/preserved-resume.js +1222 -0
- package/dist/preserved-resume.js.map +1 -0
- package/dist/readiness-wait.d.ts +3 -0
- package/dist/readiness-wait.d.ts.map +1 -1
- package/dist/readiness-wait.js +11 -0
- package/dist/readiness-wait.js.map +1 -1
- package/dist/retirement.d.ts +4 -0
- package/dist/retirement.d.ts.map +1 -1
- package/dist/retirement.js +29 -0
- package/dist/retirement.js.map +1 -1
- package/dist/seat-custody.d.ts +4 -0
- package/dist/seat-custody.d.ts.map +1 -1
- package/dist/seat-custody.js +25 -0
- package/dist/seat-custody.js.map +1 -1
- package/dist/seat-launch.d.ts +3 -0
- package/dist/seat-launch.d.ts.map +1 -1
- package/dist/seat-launch.js +69 -0
- package/dist/seat-launch.js.map +1 -1
- package/dist/seat-stop.d.ts +3 -0
- package/dist/seat-stop.d.ts.map +1 -1
- package/dist/seat-stop.js +40 -0
- package/dist/seat-stop.js.map +1 -1
- package/dist/seat-types.d.ts +6 -6
- package/dist/seat-types.d.ts.map +1 -1
- package/dist/serve-plane.d.ts +4 -0
- package/dist/serve-plane.d.ts.map +1 -1
- package/dist/serve-plane.js +76 -0
- package/dist/serve-plane.js.map +1 -1
- package/dist/session-recovery.d.ts +4 -0
- package/dist/session-recovery.d.ts.map +1 -1
- package/dist/session-recovery.js +31 -0
- package/dist/session-recovery.js.map +1 -1
- package/dist/spawn-goal.d.ts +3 -0
- package/dist/spawn-goal.d.ts.map +1 -1
- package/dist/spawn-goal.js +23 -0
- package/dist/spawn-goal.js.map +1 -1
- package/dist/start-doors.d.ts +3 -0
- package/dist/start-doors.d.ts.map +1 -1
- package/dist/start-doors.js +14 -0
- package/dist/start-doors.js.map +1 -1
- package/dist/status-and-models.d.ts +3 -0
- package/dist/status-and-models.d.ts.map +1 -1
- package/dist/status-and-models.js +40 -0
- package/dist/status-and-models.js.map +1 -1
- package/dist/terminal-input.d.ts +3 -0
- package/dist/terminal-input.d.ts.map +1 -1
- package/dist/terminal-input.js +12 -0
- package/dist/terminal-input.js.map +1 -1
- package/dist/user-provision.d.ts +4 -0
- package/dist/user-provision.d.ts.map +1 -1
- package/dist/user-provision.js +17 -0
- package/dist/user-provision.js.map +1 -1
- package/package.json +12 -12
package/dist/manager.d.ts
CHANGED
|
@@ -1,19 +1,49 @@
|
|
|
1
|
-
import { type
|
|
2
|
-
import { type
|
|
3
|
-
import
|
|
1
|
+
import { UserProvision, type ProvisionUserAgentOpts, type ProvisionedUserAgent, type UserAgentRefusal } from "./user-provision.js";
|
|
2
|
+
import { TurnRelay, type OnceRetire, type TurnAcceptance } from "./turn-relay.js";
|
|
3
|
+
import { CotalEndpoint, type DeprovisionResourceAccounting, type IssuedBinding, type IssuedStore } from "@cotal-ai/core";
|
|
4
|
+
import { retainConnectorSeat } from "@cotal-ai/workspace";
|
|
5
|
+
import { type ManagerInstanceIdentity, type SeatCap } from "@cotal-ai/workspace";
|
|
6
|
+
import type { ActionContext, EpCapability, PersonaEndpoint, RunAdmission, Connector, ControlReply, DelegatedGrant, EpCaller, LaunchSpec, ManagerLeaseInfo, Presence, RuntimeReference, SecretStore, SecretStoreIdentity, SpaceAuth, StartupOutcome } from "@cotal-ai/core";
|
|
4
7
|
import { type AgentHandle, type Runtime, type RuntimeMode } from "./runtime/index.js";
|
|
5
|
-
import
|
|
8
|
+
import { Retirement, type TeardownTarget } from "./retirement.js";
|
|
9
|
+
import type { ManagedAgent, SpawnAcceptance, SpawnHooks, StartAgentOpts } from "./seat-types.js";
|
|
6
10
|
export type { ManagedAgent, SpawnAcceptance, SpawnHooks, StartAgentOpts } from "./seat-types.js";
|
|
11
|
+
import { NamesCapacity, type Occupancy } from "./names-capacity.js";
|
|
12
|
+
import { AttachEndpoint } from "./attach-endpoint.js";
|
|
13
|
+
import { ManagedStaticLifecycle } from "./managed-static-lifecycle.js";
|
|
7
14
|
export { STATIC_RECONCILE_RETRY_DELAYS_MS } from "./managed-static-lifecycle.js";
|
|
8
15
|
export { credRenewIntervalMs } from "./credential-renewal.js";
|
|
9
16
|
export { ManagerInstanceLeaseHeld } from "./lease-keeper.js";
|
|
17
|
+
import { SessionRecovery } from "./session-recovery.js";
|
|
18
|
+
import { SeatCustody } from "./seat-custody.js";
|
|
19
|
+
import { GoalWriter } from "./goal-writer.js";
|
|
20
|
+
import { SeatStop } from "./seat-stop.js";
|
|
10
21
|
import { CommandDispatch } from "./command-dispatch.js";
|
|
22
|
+
import { SpawnGoal } from "./spawn-goal.js";
|
|
23
|
+
import { PersonaCatalog } from "./persona-catalog.js";
|
|
24
|
+
import { TerminalInput } from "./terminal-input.js";
|
|
11
25
|
import { StatusAndModels } from "./status-and-models.js";
|
|
26
|
+
import { ReadinessWait } from "./readiness-wait.js";
|
|
27
|
+
import { BrokerTransport } from "./broker-transport.js";
|
|
28
|
+
import { StartDoors } from "./start-doors.js";
|
|
29
|
+
import { HarnessResolution } from "./harness-resolution.js";
|
|
30
|
+
import { ConnectorInventory } from "./connector-inventory.js";
|
|
12
31
|
import { Preservation } from "./preservation.js";
|
|
32
|
+
import { PreservedResume } from "./preserved-resume.js";
|
|
13
33
|
export { PASTE_END, PASTE_START, RUNTIME_NO_TERMINAL_DETAIL } from "./terminal-input.js";
|
|
14
34
|
import { CredentialRenewal } from "./credential-renewal.js";
|
|
15
|
-
import { type
|
|
16
|
-
import {
|
|
35
|
+
import { SeatLaunch, type SpawnRun, type StaticSpawnBound } from "./seat-launch.js";
|
|
36
|
+
import { ManagerBoot } from "./boot.js";
|
|
37
|
+
import { RunHosting } from "./run-hosting.js";
|
|
38
|
+
import { type CleanupFailure } from "@cotal-ai/core";
|
|
39
|
+
import { type SeatRecord } from "./resume.js";
|
|
40
|
+
import { TranscriptReceiver } from "./transcript-receive.js";
|
|
41
|
+
import { type LifecycleStateTransport, type StaticManagedSlotRow } from "@cotal-ai/core";
|
|
42
|
+
import { ManagerSessionPlane } from "./session/index.js";
|
|
43
|
+
import { type EpIssuanceGate, type GoalIndexEntry, EpEnvelopeError, type EpServeContext, type EpServeGrant, type EpServeHandle, type GoalRef, type Identity } from "@cotal-ai/core";
|
|
44
|
+
import { type ManagerConnectorStatus, type ManagerStaticReconciliationStatus, type ManagerStopImpact } from "./manager-service-contract.js";
|
|
45
|
+
import type { NatsConnection } from "@nats-io/transport-node";
|
|
46
|
+
import type { KV } from "@nats-io/kv";
|
|
17
47
|
/** Backstop for the detached-launch readiness race (#159 B1). `startAgent` waits on two REAL outcomes —
|
|
18
48
|
* the assigned id joining the mesh (presence) = started, the child process exiting = failed — NOT a
|
|
19
49
|
* liveness-inferring timer. This is only the last-resort bound for "neither happened in time": the launch
|
|
@@ -451,6 +481,15 @@ export interface ManagerResumeResult {
|
|
|
451
481
|
}>;
|
|
452
482
|
error?: string;
|
|
453
483
|
}
|
|
484
|
+
/** One native personal lifecycle that may receive workflow turns through this manager. */
|
|
485
|
+
interface PersonalTurnParticipant {
|
|
486
|
+
name: string;
|
|
487
|
+
owner: string;
|
|
488
|
+
actor: string;
|
|
489
|
+
uid: string;
|
|
490
|
+
generation?: string;
|
|
491
|
+
expiresAt: number;
|
|
492
|
+
}
|
|
454
493
|
/**
|
|
455
494
|
* The agent supervisor: a long-lived mesh node that owns agent process lifecycle.
|
|
456
495
|
* It serves control requests on the "manager" service and spawns/kills agents
|
|
@@ -458,29 +497,29 @@ export interface ManagerResumeResult {
|
|
|
458
497
|
* mesh traffic — terminal I/O streams over its own attach endpoint instead.
|
|
459
498
|
*/
|
|
460
499
|
export declare class Manager {
|
|
461
|
-
|
|
462
|
-
|
|
500
|
+
protected readonly space: string;
|
|
501
|
+
protected readonly servers: string | undefined;
|
|
463
502
|
/** The broker ws listener port (loopback) `cotal up` allocated, for the console session
|
|
464
503
|
* client's wsUrl. Undefined ⇒ no console session client (POST /session 503s). */
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
504
|
+
protected readonly wsPort?: number;
|
|
505
|
+
protected readonly name: string;
|
|
506
|
+
protected readonly workspaceRoot: string;
|
|
507
|
+
protected readonly eventsRequired: boolean;
|
|
508
|
+
protected readonly eventPayloadsWithheld: boolean;
|
|
470
509
|
/** The operator-set global live-session ceiling (see {@link ManagerOptions.maxSessions}). */
|
|
471
|
-
|
|
510
|
+
protected readonly maxSessions?: number;
|
|
472
511
|
/** The operator-set per-owner seat ceiling (see {@link ManagerOptions.seatCap}). */
|
|
473
|
-
|
|
512
|
+
protected readonly seatCap: SeatCap;
|
|
474
513
|
/** The ONE secret store for every kind this manager touches (daemon-cred remint + agent kinds).
|
|
475
514
|
* See {@link ManagerOptions.secretStore}. */
|
|
476
|
-
|
|
515
|
+
protected readonly secrets: SecretStore;
|
|
477
516
|
/** Named identity of {@link secrets}: the same coordinate the delivery daemon must reload from.
|
|
478
517
|
* Set at construction for an injected store; the workspace store is named on first challenge. */
|
|
479
|
-
|
|
518
|
+
protected secretStoreIdentity?: SecretStoreIdentity;
|
|
480
519
|
/** See {@link ManagerOptions.installedExtensions}. */
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
520
|
+
protected readonly installedExtensions: boolean;
|
|
521
|
+
protected readonly expectedConnectorGeneration: string;
|
|
522
|
+
protected readonly machineSetupCommand?: string;
|
|
484
523
|
private readonly executionState;
|
|
485
524
|
private readonly runtime;
|
|
486
525
|
/** One backend per kind a seat has asked for, beside {@link runtime}. The manager's own runtime
|
|
@@ -490,45 +529,51 @@ export declare class Manager {
|
|
|
490
529
|
* already refused for the manager's own. */
|
|
491
530
|
private readonly pooled;
|
|
492
531
|
/** Internal test seam. Production leaves this undefined and uses the scoped delivery-admin evictor. */
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
532
|
+
protected staticLifecycleEvict?: (principal: string) => Promise<import("@cotal-ai/core").EvictionResult>;
|
|
533
|
+
protected readonly preserveStopTimeoutMs: number;
|
|
534
|
+
protected readonly endpointServeExecutorExpiresInSeconds?: number;
|
|
535
|
+
protected readonly agents: Map<string, ManagedAgent>;
|
|
497
536
|
/** Lifecycle UIDs already handed to `Runtime.spawnDelegated`: a lifecycle is handed off at most
|
|
498
537
|
* once, so a lost create acknowledgement can never become a second create. */
|
|
499
|
-
|
|
538
|
+
protected readonly delegatedLaunched: Set<string>;
|
|
500
539
|
/** This manager process's own incarnation uid (SPEC 13.1; minted once per supervisor process,
|
|
501
540
|
* never reused across restarts) — the endpoint's presence key AND the `managerInstance` audit
|
|
502
541
|
* coordinate every static activation records. */
|
|
503
|
-
|
|
542
|
+
protected readonly managerLifecycleUid: string;
|
|
504
543
|
/** The persisted LOGICAL instance id (SPEC 13.6 item 7): STABLE across restart, so a
|
|
505
544
|
* restart re-registers the SAME id with an ADVANCED epoch through the §13.1 gate (the successor
|
|
506
545
|
* fences the predecessor's epoch — the (i) fence bites on a real restart). It is the registration
|
|
507
546
|
* instanceId, the served-status id, the goal spec's executor.instanceId, the epe route, and the
|
|
508
547
|
* resolveExecutorEpoch key — DISTINCT from {@link managerLifecycleUid} (per-process: the presence
|
|
509
548
|
* node uid + the managerInstance audit coordinate every static activation records). Set in start(). */
|
|
510
|
-
|
|
549
|
+
protected managerInstanceId: string;
|
|
511
550
|
/** The persisted serve nkey identity: reusing the SAME principal across restart keeps
|
|
512
551
|
* {@link provisionEndpointGateOpen} idempotent (no core barrier change) and gives verified
|
|
513
552
|
* eviction a stable target (the predecessor's connections under this principal). Set in start(). */
|
|
514
|
-
|
|
553
|
+
protected managerServeIdentity: Identity;
|
|
515
554
|
/** The local instance identity {@link admitExecutionState} already resolved. The ordinary start
|
|
516
555
|
* adopts it instead of reading the same record again. */
|
|
517
|
-
|
|
518
|
-
|
|
556
|
+
protected admittedLocalIdentity?: ManagerInstanceIdentity;
|
|
557
|
+
protected readonly onServiceIdentity?: ManagerOptions["onServiceIdentity"];
|
|
519
558
|
/** The manager's v0.4 service-endpoint serve state — the serve handle +
|
|
520
559
|
* its dedicated connection, the STABLE serve identity (renewals re-mint the same nkey), the
|
|
521
560
|
* branded serve grant, and the CURRENT credential (the connection's authenticator reads it on
|
|
522
561
|
* every (re)connect, so a renewal is adopted without re-registration). Absent on open meshes,
|
|
523
562
|
* in user mode, and before registration completes. */
|
|
524
|
-
|
|
563
|
+
protected serviceServe?: {
|
|
564
|
+
handle: EpServeHandle;
|
|
565
|
+
nc: NatsConnection;
|
|
566
|
+
identity: Identity;
|
|
567
|
+
grant: EpServeGrant;
|
|
568
|
+
creds?: string;
|
|
569
|
+
};
|
|
525
570
|
/** #1577: dedicated connections (serve, goal-writer, session-ledger) whose transport is down while
|
|
526
571
|
* the client reconnects them, tracked by {@link trackTransport}. Such a connection is open
|
|
527
572
|
* (`isClosed()` is false under unbounded reconnects) yet the broker holds none of its rails, so
|
|
528
573
|
* the liveness responder must not grade the serve connection `bound`, and a stop closes rather
|
|
529
574
|
* than drains it ({@link retireConnection}). Keyed by the connection, so a re-dial that swaps in a
|
|
530
575
|
* fresh one starts from its own state. */
|
|
531
|
-
|
|
576
|
+
protected readonly transportDown: WeakSet<NatsConnection>;
|
|
532
577
|
/** The spawn-as-action SELF-MEDIATED goal-writer connection + ActionContext — a
|
|
533
578
|
* standing connection DISJOINT from the serve credential, scoped to exactly this endpoint's
|
|
534
579
|
* goal bind/terminal facts + goal-record writes ({@link goalWriterGrants}). Auth mode mints the
|
|
@@ -536,166 +581,186 @@ export declare class Manager {
|
|
|
536
581
|
* `gate` (auth mode) is the own-issuance-gate READER for the own-gate currency belt — the
|
|
537
582
|
* manager reads its OWN `epgate.<e>.<iid>` epoch over this connection before a terminal commit
|
|
538
583
|
* and skips a superseded commit (the fast-fail belt paired with the (b) barrier-revoke fence). */
|
|
539
|
-
|
|
584
|
+
protected goalWriter?: {
|
|
585
|
+
nc: NatsConnection;
|
|
586
|
+
ctx: ActionContext;
|
|
587
|
+
creds?: string;
|
|
588
|
+
identity: Identity;
|
|
589
|
+
gate?: EpIssuanceGate;
|
|
590
|
+
};
|
|
540
591
|
/** The workflow-run host (SPEC 14.3): the drives this incarnation holds, each on its own
|
|
541
592
|
* per-run credential and connection. Absent under a remote authority, which mints no driver
|
|
542
593
|
* credentials, so the `run-*` family refuses there rather than connecting on a weaker identity. */
|
|
543
|
-
|
|
594
|
+
protected runHosting?: RunHosting;
|
|
544
595
|
/** The STABLE goal-writer identity (auth mode) — minted once at
|
|
545
596
|
* registration alongside the serve identity; a renewal re-mints the SAME nkey with a fresh
|
|
546
597
|
* bounded exp and re-stages its distinct credId into the §13.1 revocation family. The current
|
|
547
598
|
* goal-writer credential is minted INSIDE {@link registerManagerService}'s run block (fence
|
|
548
599
|
* live) and stashed here for {@link startGoalWriter} to build the standing connection from. */
|
|
549
|
-
|
|
550
|
-
|
|
600
|
+
protected goalWriterIdentity?: Identity;
|
|
601
|
+
protected goalWriterCreds?: string;
|
|
551
602
|
/** The manager's ONE §13.6 session plane — offer mint + one-use redeem + PTY-bridge
|
|
552
603
|
* standup for `attach`. The face's establisher and the CLI attach handler both call THIS one
|
|
553
604
|
* plane; the manager never constructs a second. Undefined until {@link startSessionPlane}. */
|
|
554
|
-
|
|
605
|
+
protected sessionPlane?: ManagerSessionPlane;
|
|
555
606
|
/** The standing session-LEDGER connection + its mutable creds holder (the authenticator
|
|
556
607
|
* presents the refreshed cred on the next reconnect after a half-TTL renewal — the goal-writer
|
|
557
608
|
* precedent). Auth mode only; an open mesh runs the plane over a bare connection. */
|
|
558
|
-
|
|
609
|
+
protected sessionLedgerConn?: {
|
|
610
|
+
nc: NatsConnection;
|
|
611
|
+
creds?: string;
|
|
612
|
+
};
|
|
559
613
|
/** Renews the session signing key long before its window closes. A key that expires unattended
|
|
560
614
|
* takes the whole session plane down until the manager is restarted, which kills live sessions. */
|
|
561
|
-
|
|
615
|
+
protected sessionKeyRenewTimer?: ReturnType<typeof setInterval>;
|
|
562
616
|
/** The STABLE session-LEDGER identity (auth mode) — minted once at registration
|
|
563
617
|
* alongside the serve + goal-writer identities; a renewal re-mints the SAME nkey with a fresh
|
|
564
618
|
* bounded exp and re-stages its distinct credId into the §13.1 revocation family. The current
|
|
565
619
|
* credential is minted INSIDE {@link registerManagerService}'s run block and stashed here. */
|
|
566
|
-
|
|
567
|
-
|
|
620
|
+
protected sessionLedgerIdentity?: Identity;
|
|
621
|
+
protected sessionLedgerCreds?: string;
|
|
568
622
|
/** The acceptance replied for each goal this incarnation accepted, by {@link goalKey}, so an
|
|
569
623
|
* idempotent same-goalId retry serves the IDENTICAL acceptance (same allocated name/triple)
|
|
570
624
|
* without a second spawn. An entry lives while its goal is in flight and for
|
|
571
625
|
* {@link goalAcceptanceRetentionMs} after its terminal commits; a later retry, or one at another
|
|
572
626
|
* incarnation, is answered from the goal index while the goal runs and from its committed
|
|
573
627
|
* result fact once it has ended. */
|
|
574
|
-
|
|
628
|
+
protected goalAcceptances: Map<string, SpawnAcceptance>;
|
|
575
629
|
/** How long a terminal goal's acceptance stays in {@link goalAcceptances}: the retry window its
|
|
576
630
|
* turn twin keeps a settled answer for. An instance field so a test can shorten it. */
|
|
577
|
-
|
|
631
|
+
protected goalAcceptanceRetentionMs: number;
|
|
578
632
|
/** The boot reconcile of the durable goal index runs ONCE at start (a
|
|
579
633
|
* fresh incarnation inherits the endpoint's accepted-but-unterminal goals from any predecessor).
|
|
580
634
|
* Spawn-as-action REFUSES to accept until it completes, so the sweep never races a live goal's
|
|
581
635
|
* acceptance (settling one mid-flight would steal its real terminal). */
|
|
582
|
-
|
|
636
|
+
protected goalReconcileDone: boolean;
|
|
583
637
|
/** The live spawn goal ref for each managed agent name, so a despawn MID-GOAL
|
|
584
638
|
* drives the cancel path (transition -> cancel terminal). Cleared when the goal terminalizes. */
|
|
585
|
-
|
|
639
|
+
protected agentGoals: Map<string, GoalRef>;
|
|
586
640
|
private turnRelayInstance?;
|
|
587
|
-
|
|
588
|
-
|
|
641
|
+
protected get turnRelay(): TurnRelay;
|
|
642
|
+
protected readonly participants: Map<string, PersonalTurnParticipant>;
|
|
589
643
|
/** Once tasks whose seat's exit is watched: that exit, not the spawn's outcome, settles the debt. */
|
|
590
|
-
|
|
644
|
+
protected readonly onceWatched: Set<string>;
|
|
591
645
|
/** Process start, for the served `status` uptime. */
|
|
592
|
-
|
|
646
|
+
protected readonly startedAtMs: number;
|
|
593
647
|
/** Connector harness inventory. Available paths stay pinned; unavailable rows are retried when
|
|
594
648
|
* launch, model lookup or status asks, without stopping unrelated Manager work. */
|
|
595
|
-
|
|
596
|
-
|
|
649
|
+
protected connectorStatuses: ManagerConnectorStatus[];
|
|
650
|
+
protected connectorRequirements: Map<string, {
|
|
651
|
+
requires: readonly string[];
|
|
652
|
+
needsClaudeWake: boolean;
|
|
653
|
+
}>;
|
|
597
654
|
private claudeWakeRecheck?;
|
|
598
655
|
/** The boot inventory's warnings, printed once start completes, so a refused start prints none. */
|
|
599
|
-
|
|
656
|
+
protected bootNotes: string[];
|
|
600
657
|
/** The complete boot task. stop() joins it after fencing static reconciliation, so a registration
|
|
601
658
|
* already past an earlier shutdown check cannot finish after stop() returns. */
|
|
602
659
|
private startTask?;
|
|
603
660
|
/** This instance's side of a carried resume transcript (#1499); absent where it has no transfer reader. */
|
|
604
|
-
|
|
661
|
+
protected transcripts?: TranscriptReceiver;
|
|
605
662
|
/** The one stop this manager runs, with the agent policy it was asked for. A stop takes seats out
|
|
606
663
|
* of `agents` before they have exited, so a second teardown would find none and report success
|
|
607
664
|
* while the first still waits on a live seat. */
|
|
608
665
|
private stopTask?;
|
|
609
666
|
/** Held as an instance field so broker-owning smokes can compress the schedule without changing
|
|
610
667
|
* production semantics. It is never a fence expiry: the durable non-retired row stays authoritative. */
|
|
611
|
-
|
|
668
|
+
protected staticReconcileRetryDelaysMs: readonly number[];
|
|
612
669
|
/** Retirements holding one of the {@link RETIREMENT_CONCURRENCY} slots. */
|
|
613
670
|
private retirementsRunning;
|
|
614
671
|
/** Retirements waiting for a slot, oldest first. */
|
|
615
672
|
private readonly retirementQueue;
|
|
616
|
-
|
|
617
|
-
|
|
673
|
+
protected readonly attach: AttachEndpoint;
|
|
674
|
+
protected ep: CotalEndpoint;
|
|
618
675
|
/** Space trust material when the mesh runs in auth mode (`.cotal/auth` present);
|
|
619
676
|
* the manager mints per-agent creds from it at spawn. Undefined when the mesh is open. */
|
|
620
|
-
|
|
677
|
+
protected auth?: SpaceAuth;
|
|
621
678
|
/** Readiness-race backstop (#159 B1) — the {@link READINESS_TIMEOUT_MS} constant, held as an instance
|
|
622
679
|
* field so a test can shorten it (the join/exit signals are event-driven; only the backstop is timed).
|
|
623
680
|
* Production leaves it at the constant. */
|
|
624
|
-
|
|
681
|
+
protected readinessTimeoutMs: number;
|
|
625
682
|
/** True on a USER-AUTH space (the on-disk marker; cross-checked against the registry at start).
|
|
626
683
|
* Gates the whole spawn path: user mode grants ledger actors + bearer plumbing, never static mints. */
|
|
627
|
-
|
|
628
|
-
|
|
684
|
+
protected userMode: boolean;
|
|
685
|
+
protected readonly namesCapacity: NamesCapacity;
|
|
629
686
|
private readonly servePlane;
|
|
630
|
-
|
|
631
|
-
|
|
687
|
+
protected resolveServeTarget(t: {
|
|
688
|
+
owner: string;
|
|
689
|
+
actor: string;
|
|
690
|
+
}): {
|
|
691
|
+
lifecycleUid: string;
|
|
692
|
+
mappingRevision: number;
|
|
693
|
+
} | undefined;
|
|
694
|
+
protected readonly retirement: Retirement;
|
|
632
695
|
private readonly lease;
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
696
|
+
protected get leaseInfo(): Omit<ManagerLeaseInfo, "since"> | undefined;
|
|
697
|
+
protected set leaseInfo(info: Omit<ManagerLeaseInfo, "since"> | undefined);
|
|
698
|
+
protected get leaseRevision(): number | undefined;
|
|
699
|
+
protected set leaseRevision(revision: number | undefined);
|
|
700
|
+
protected get leaseTimer(): ReturnType<typeof setInterval> | undefined;
|
|
701
|
+
protected set leaseTimer(timer: ReturnType<typeof setInterval> | undefined);
|
|
639
702
|
private get leaseRenewTask();
|
|
640
|
-
|
|
641
|
-
|
|
703
|
+
protected acquireInstanceLease(info: Omit<ManagerLeaseInfo, "since">): Promise<number>;
|
|
704
|
+
protected renewLease(): Promise<void>;
|
|
642
705
|
private releaseOwnManagerLease;
|
|
643
706
|
/** Set at the top of `stop()`. `renewLease` returns at once once this is set, and its `gone` arm
|
|
644
707
|
* does not re-acquire: a manager that is stopping never puts its own key back. It also closes the
|
|
645
708
|
* lifecycle fence ({@link beginLifecycle}), so no spawn can launch a seat the stop never sees. */
|
|
646
|
-
|
|
647
|
-
|
|
709
|
+
protected leaseStopping: boolean;
|
|
710
|
+
protected readonly shutdownReadiness: AbortController;
|
|
648
711
|
/** The class-2 renewal owner's half-TTL schedule; armed only on auth meshes. */
|
|
649
|
-
|
|
650
|
-
|
|
712
|
+
protected credRenewTimer?: ReturnType<typeof setInterval>;
|
|
713
|
+
protected resumeCredRenewal?: () => void;
|
|
651
714
|
/** #2073: the `endpoint-serve` credential's OWN renewal, armed from its `[renewAt, exp)` window
|
|
652
715
|
* (`credsRenewalDelayMs`) rather than left to `credRenewTimer`'s boot-phased TTL/4 tick, which can
|
|
653
716
|
* miss the window by ordering. Re-armed at registration and after every successful re-mint;
|
|
654
717
|
* cleared in `stop()` beside `credRenewTimer`. */
|
|
655
|
-
|
|
718
|
+
protected endpointServeRenewalTimer?: ReturnType<typeof setTimeout>;
|
|
656
719
|
/** #1634: does THIS manager own the delivery daemon's credential renewal? True only while the
|
|
657
720
|
* daemon reloads from this manager's store AND this manager holds the per-space renewal lease.
|
|
658
721
|
* Starts false: a manager that has not proved both must not remint. */
|
|
659
|
-
|
|
722
|
+
protected daemonRenewalOwner: boolean;
|
|
660
723
|
/** #2561: may the lease heartbeat contend at all? Set by every claim, false while the daemon names
|
|
661
724
|
* another store or the challenge refused. Without it the heartbeat re-takes the lease the claim
|
|
662
725
|
* just released and holds it against every manager and `doctor auth --fix` that can remint. */
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
726
|
+
protected daemonRenewalEligible: boolean;
|
|
727
|
+
protected daemonRenewalLeaseTimer?: ReturnType<typeof setInterval>;
|
|
728
|
+
protected maintenanceState: ManagerMaintenanceState;
|
|
729
|
+
protected lifecycleInFlight: number;
|
|
667
730
|
private lifecycleDrainWaiters;
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
private remoteBundleRenewal?;
|
|
688
|
-
private remoteBundleAdoption?;
|
|
689
|
-
private finishRemoteBundleAdoption?;
|
|
731
|
+
protected preservationGeneration: number;
|
|
732
|
+
protected preservationAttemptId?: string;
|
|
733
|
+
protected unverifiedStops: Array<{
|
|
734
|
+
name: string;
|
|
735
|
+
id: string;
|
|
736
|
+
handle: AgentHandle;
|
|
737
|
+
authoritative?: boolean;
|
|
738
|
+
error?: string;
|
|
739
|
+
}>;
|
|
740
|
+
protected preservationInventory?: ManagerResumeInventory;
|
|
741
|
+
protected resumeAttemptId?: string;
|
|
742
|
+
protected resumeRequired: boolean;
|
|
743
|
+
protected resumeDurableCommitToken?: string;
|
|
744
|
+
protected readonly remoteAuthority?: NonNullable<ManagerOptions["remoteAuthority"]>;
|
|
745
|
+
protected remoteExecutorCreds?: string;
|
|
746
|
+
protected remoteSupervisorCreds?: string;
|
|
747
|
+
protected remoteBundleRenewal?: Promise<void>;
|
|
748
|
+
protected remoteBundleAdoption?: Promise<void>;
|
|
749
|
+
protected finishRemoteBundleAdoption?: () => void;
|
|
690
750
|
/** A refused or failed standing candidate is cleanup debt, never a silent loss: the last-good
|
|
691
751
|
* family stays live and this records what the host may have signed but the manager never adopted. */
|
|
692
|
-
|
|
752
|
+
protected remoteRenewalDebt?: {
|
|
753
|
+
at: number;
|
|
754
|
+
processEpoch: number;
|
|
755
|
+
reason: string;
|
|
756
|
+
unadoptedSubjects: string[];
|
|
757
|
+
};
|
|
693
758
|
/** {@link BrokerTransport.dial}. */
|
|
694
|
-
|
|
759
|
+
protected dial(...args: Parameters<BrokerTransport["dial"]>): ReturnType<BrokerTransport["dial"]>;
|
|
695
760
|
/** {@link BrokerTransport.dialRemoteStanding}. */
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
761
|
+
protected dialRemoteStanding(...args: Parameters<BrokerTransport["dialRemoteStanding"]>): ReturnType<BrokerTransport["dialRemoteStanding"]>;
|
|
762
|
+
protected readonly seatCustody: SeatCustody;
|
|
763
|
+
protected readonly sessionRecovery: SessionRecovery;
|
|
699
764
|
get staticReconcileLastSweepResources(): {
|
|
700
765
|
slots: {
|
|
701
766
|
examined: number;
|
|
@@ -720,9 +785,9 @@ export declare class Manager {
|
|
|
720
785
|
};
|
|
721
786
|
deprovision?: DeprovisionResourceAccounting;
|
|
722
787
|
} | undefined);
|
|
723
|
-
|
|
788
|
+
protected readonly staticLifecycle: ManagedStaticLifecycle;
|
|
724
789
|
/** User-mode provisioning owns no manager state: each dependency reads through at its use. */
|
|
725
|
-
|
|
790
|
+
protected readonly userProvision: UserProvision;
|
|
726
791
|
/** Seat stop, exit, recursive reap and named despawn. Every dependency reads through at its use. */
|
|
727
792
|
private readonly seatStopComponent;
|
|
728
793
|
/** The typed command table and its admission. Every dependency reads through at its use. */
|
|
@@ -747,12 +812,16 @@ export declare class Manager {
|
|
|
747
812
|
private readonly connectorInventoryComponent;
|
|
748
813
|
/** Manager preservation and released-seat adoption. Every dependency reads through at its use. */
|
|
749
814
|
private readonly preservationComponent;
|
|
815
|
+
/** Preserved-manager resume and its control doors. Every dependency reads through at its use. */
|
|
816
|
+
private readonly preservedResumeComponent;
|
|
750
817
|
/** The goal-writer connection and the goal index it reconciles. Every dependency reads through at its use. */
|
|
751
818
|
private readonly goalWriterComponent;
|
|
752
819
|
/** Renewal of the manager's standing credentials. Every dependency reads through at its use. */
|
|
753
820
|
private readonly credentialRenewal;
|
|
754
821
|
/** The launch pipeline's leaf steps. Every dependency reads through at its use. */
|
|
755
822
|
private readonly seatLaunch;
|
|
823
|
+
/** Manager boot: execution admission, connect, registration and lease. Every dependency reads through at its use. */
|
|
824
|
+
private readonly bootComponent;
|
|
756
825
|
constructor(opts: ManagerOptions);
|
|
757
826
|
get runtimeKind(): string;
|
|
758
827
|
/** Whether this manager's runtime opens a terminal stream on the seats it spawns, so a caller
|
|
@@ -760,9 +829,9 @@ export declare class Manager {
|
|
|
760
829
|
* spawns no seat, so it streams no terminal either. */
|
|
761
830
|
get streamsTerminal(): boolean;
|
|
762
831
|
get execution(): "runtime" | "none";
|
|
763
|
-
|
|
832
|
+
protected executionRefusal(): string;
|
|
764
833
|
/** A defensive last barrier, not a substitute Runtime. Entry admission runs before effects. */
|
|
765
|
-
|
|
834
|
+
protected get requiredRuntime(): Runtime;
|
|
766
835
|
/** Import the installed extension that provides a seat's runtime before {@link runtimeFor}
|
|
767
836
|
* resolves it, as {@link resolveConnector} does for a connector. On the published binary the
|
|
768
837
|
* manager process imports only its own runtime, so a seat that names another installed runtime
|
|
@@ -770,13 +839,13 @@ export declare class Manager {
|
|
|
770
839
|
* live `cotal ext remove` refuses the next launch even while an earlier import keeps the provider
|
|
771
840
|
* registered; seats already on that runtime keep their cached backend. A library composition
|
|
772
841
|
* resolves only what its root imported. The refusal names an official runtime's package. */
|
|
773
|
-
|
|
842
|
+
protected loadSeatRuntime(kind: string | undefined): Promise<void>;
|
|
774
843
|
/** The backend one seat launches, restarts, and is reaped through. An omitted or blank choice is
|
|
775
844
|
* this manager's own runtime. A named one is created once, cached by its resolved kind, and reused
|
|
776
845
|
* for every later seat of that kind. The manager's own runtime is never replaced. An unknown or
|
|
777
846
|
* unreachable runtime throws, and pooled control refuses a custodial one by the same rule the
|
|
778
847
|
* constructor applied to the manager's own. */
|
|
779
|
-
|
|
848
|
+
protected runtimeFor(kind: string | undefined): Runtime;
|
|
780
849
|
/** What a default process stop does with this manager's seats. `release` drops manager-local
|
|
781
850
|
* custody and leaves every seat running. `stop` means this runtime keeps its PTYs inside the
|
|
782
851
|
* manager process, so those seats close with it: the stop stops and deprovisions them, and still
|
|
@@ -794,7 +863,7 @@ export declare class Manager {
|
|
|
794
863
|
attemptId: string;
|
|
795
864
|
inventorySha256: string;
|
|
796
865
|
} | undefined;
|
|
797
|
-
|
|
866
|
+
protected serviceIdentityObservation(): ManagerServiceIdentity;
|
|
798
867
|
/** The console page URL (manager-hosted, loopback). */
|
|
799
868
|
get consoleUrl(): string;
|
|
800
869
|
/**
|
|
@@ -833,12 +902,13 @@ export declare class Manager {
|
|
|
833
902
|
* "two arms" into "three arms". Switching on `meshMode` gives a fourth mesh mode nowhere to fall
|
|
834
903
|
* silently, since `switch` has no default arm to catch it.
|
|
835
904
|
*/
|
|
836
|
-
|
|
837
|
-
|
|
905
|
+
protected get meshMode(): "open" | "static" | "user";
|
|
906
|
+
protected readerRemedy(owner: string, channel: string): string;
|
|
838
907
|
start(): Promise<void>;
|
|
839
|
-
|
|
908
|
+
protected executionRecordPath(instanceId: string): string;
|
|
909
|
+
/** {@link ManagerBoot.claimExecutionRecord}. */
|
|
840
910
|
private claimExecutionRecord;
|
|
841
|
-
|
|
911
|
+
/** {@link ManagerBoot.runStart}. */
|
|
842
912
|
private runStart;
|
|
843
913
|
/** The delivery shard whose lease names the process that reloads the standing credentials.
|
|
844
914
|
* Delivery is single-shard today and the endpoint's own responder reads row 0; naming it here
|
|
@@ -847,33 +917,33 @@ export declare class Manager {
|
|
|
847
917
|
/** {@link CredentialRenewal.absentByLeaseRow}. */
|
|
848
918
|
absentByLeaseRow(...args: Parameters<CredentialRenewal["absentByLeaseRow"]>): ReturnType<CredentialRenewal["absentByLeaseRow"]>;
|
|
849
919
|
/** {@link CredentialRenewal.keepDaemonRenewalLease}. */
|
|
850
|
-
|
|
920
|
+
protected keepDaemonRenewalLease(...args: Parameters<CredentialRenewal["keepDaemonRenewalLease"]>): ReturnType<CredentialRenewal["keepDaemonRenewalLease"]>;
|
|
851
921
|
/** {@link CredentialRenewal.claimDaemonRenewalOwnership}. */
|
|
852
|
-
|
|
922
|
+
protected claimDaemonRenewalOwnership(...args: Parameters<CredentialRenewal["claimDaemonRenewalOwnership"]>): ReturnType<CredentialRenewal["claimDaemonRenewalOwnership"]>;
|
|
853
923
|
/** {@link CredentialRenewal.scheduleServeRenewal}. */
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
924
|
+
protected scheduleServeRenewal(...args: Parameters<CredentialRenewal["scheduleServeRenewal"]>): ReturnType<CredentialRenewal["scheduleServeRenewal"]>;
|
|
925
|
+
protected credentialPushRetry?: ReturnType<typeof setTimeout>;
|
|
926
|
+
protected readonly credentialPushes: Map<NatsConnection, Promise<void>>;
|
|
927
|
+
protected supervisorCredentialPush?: Promise<void>;
|
|
928
|
+
protected readonly pendingCredentialPushes: Set<NatsConnection>;
|
|
929
|
+
protected supervisorCredentialPushPending: boolean;
|
|
860
930
|
/** {@link CredentialRenewal.boundedReconnect}. */
|
|
861
|
-
|
|
931
|
+
protected boundedReconnect(...args: Parameters<CredentialRenewal["boundedReconnect"]>): ReturnType<CredentialRenewal["boundedReconnect"]>;
|
|
862
932
|
/** {@link CredentialRenewal.renewDaemonCreds}. */
|
|
863
|
-
|
|
933
|
+
protected renewDaemonCreds(...args: Parameters<CredentialRenewal["renewDaemonCreds"]>): ReturnType<CredentialRenewal["renewDaemonCreds"]>;
|
|
864
934
|
/** {@link CredentialRenewal.renewRemoteExecutor}. */
|
|
865
|
-
|
|
935
|
+
protected renewRemoteExecutor(...args: Parameters<CredentialRenewal["renewRemoteExecutor"]>): ReturnType<CredentialRenewal["renewRemoteExecutor"]>;
|
|
866
936
|
/** {@link CredentialRenewal.renewRemoteStandingBundle}. */
|
|
867
|
-
|
|
937
|
+
protected renewRemoteStandingBundle(...args: Parameters<CredentialRenewal["renewRemoteStandingBundle"]>): ReturnType<CredentialRenewal["renewRemoteStandingBundle"]>;
|
|
868
938
|
/** {@link CredentialRenewal.renewRemoteBeforeRedial}. */
|
|
869
|
-
|
|
939
|
+
protected renewRemoteBeforeRedial(...args: Parameters<CredentialRenewal["renewRemoteBeforeRedial"]>): ReturnType<CredentialRenewal["renewRemoteBeforeRedial"]>;
|
|
870
940
|
/** Admit one lifecycle/control operation while active. The synchronous increment is the fence:
|
|
871
941
|
* preserveState and stop close it before their first await, so work is either counted or rejected. */
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
942
|
+
protected beginLifecycle(resumeOperation?: boolean): (() => void) | undefined;
|
|
943
|
+
protected releaseLifecycle(): void;
|
|
944
|
+
protected trackDeprovision(a: TeardownTarget, context?: string): void;
|
|
945
|
+
protected awaitLifecycleDrain(): Promise<void>;
|
|
946
|
+
protected maintenanceError(): string;
|
|
877
947
|
/** {@link Preservation.preparePreservation}. */
|
|
878
948
|
preparePreservation(...args: Parameters<Preservation["preparePreservation"]>): ReturnType<Preservation["preparePreservation"]>;
|
|
879
949
|
/** {@link Preservation.runPreparation}. */
|
|
@@ -885,25 +955,24 @@ export declare class Manager {
|
|
|
885
955
|
/** {@link Preservation.preserveState}. */
|
|
886
956
|
preserveState(...args: Parameters<Preservation["preserveState"]>): ReturnType<Preservation["preserveState"]>;
|
|
887
957
|
/** {@link Preservation.awaitHandleExit}. */
|
|
888
|
-
|
|
958
|
+
protected awaitHandleExit(...args: Parameters<Preservation["awaitHandleExit"]>): ReturnType<Preservation["awaitHandleExit"]>;
|
|
889
959
|
/** {@link Preservation.inventoryReferenceError}. */
|
|
890
|
-
|
|
891
|
-
|
|
960
|
+
protected inventoryReferenceError(...args: Parameters<Preservation["inventoryReferenceError"]>): ReturnType<Preservation["inventoryReferenceError"]>;
|
|
961
|
+
protected fileDigest(path: string): string;
|
|
892
962
|
/** {@link Preservation.fileDigestOrEmpty}. */
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
private resumeEntryOf;
|
|
963
|
+
protected fileDigestOrEmpty(...args: Parameters<Preservation["fileDigestOrEmpty"]>): ReturnType<Preservation["fileDigestOrEmpty"]>;
|
|
964
|
+
/** {@link PreservedResume.resumeEntry}. */
|
|
965
|
+
protected resumeEntry(...args: Parameters<PreservedResume["resumeEntry"]>): ReturnType<PreservedResume["resumeEntry"]>;
|
|
966
|
+
/** {@link PreservedResume.resumeEntryOf}. */
|
|
967
|
+
protected resumeEntryOf(...args: Parameters<PreservedResume["resumeEntryOf"]>): ReturnType<PreservedResume["resumeEntryOf"]>;
|
|
899
968
|
/** {@link Preservation.teardownManagedAgents}. */
|
|
900
969
|
private teardownManagedAgents;
|
|
901
970
|
/** {@link Preservation.isProcessBoundSeat}. */
|
|
902
|
-
|
|
971
|
+
protected isProcessBoundSeat(...args: Parameters<Preservation["isProcessBoundSeat"]>): ReturnType<Preservation["isProcessBoundSeat"]>;
|
|
903
972
|
/** {@link Preservation.releaseManagedAgents}. */
|
|
904
973
|
private releaseManagedAgents;
|
|
905
974
|
/** {@link Preservation.adoptReleasedSeats}. */
|
|
906
|
-
|
|
975
|
+
protected adoptReleasedSeats(...args: Parameters<Preservation["adoptReleasedSeats"]>): ReturnType<Preservation["adoptReleasedSeats"]>;
|
|
907
976
|
private stopRetainedAgentsOnExit;
|
|
908
977
|
/** Every call joins the first stop and settles with it. A call that asks for a different
|
|
909
978
|
* `withAgents` is refused, since the running stop has already applied its own policy. */
|
|
@@ -933,22 +1002,26 @@ export declare class Manager {
|
|
|
933
1002
|
* Best-effort so a graceful stop completes its remaining teardown even when the broker is gone. */
|
|
934
1003
|
private stopServiceServe;
|
|
935
1004
|
/** {@link BrokerTransport.retireConnection}. */
|
|
936
|
-
|
|
1005
|
+
protected retireConnection(...args: Parameters<BrokerTransport["retireConnection"]>): ReturnType<BrokerTransport["retireConnection"]>;
|
|
937
1006
|
/** {@link BrokerTransport.discardServeCandidate}. */
|
|
938
|
-
|
|
1007
|
+
protected discardServeCandidate(...args: Parameters<BrokerTransport["discardServeCandidate"]>): ReturnType<BrokerTransport["discardServeCandidate"]>;
|
|
939
1008
|
/** {@link BrokerTransport.trackTransport}. */
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
1009
|
+
protected trackTransport(...args: Parameters<BrokerTransport["trackTransport"]>): ReturnType<BrokerTransport["trackTransport"]>;
|
|
1010
|
+
/** {@link PreservedResume.opFinalizeResume}. */
|
|
1011
|
+
protected opFinalizeResume(...args: Parameters<PreservedResume["opFinalizeResume"]>): ReturnType<PreservedResume["opFinalizeResume"]>;
|
|
1012
|
+
/** {@link PreservedResume.opCommitResume}. */
|
|
1013
|
+
protected opCommitResume(...args: Parameters<PreservedResume["opCommitResume"]>): ReturnType<PreservedResume["opCommitResume"]>;
|
|
1014
|
+
/** {@link PreservedResume.opResumePreserved}. */
|
|
1015
|
+
protected opResumePreserved(...args: Parameters<PreservedResume["opResumePreserved"]>): ReturnType<PreservedResume["opResumePreserved"]>;
|
|
1016
|
+
/** {@link PreservedResume.opPreservationCtl}. */
|
|
1017
|
+
protected opPreservationCtl(...args: Parameters<PreservedResume["opPreservationCtl"]>): ReturnType<PreservedResume["opPreservationCtl"]>;
|
|
945
1018
|
/** {@link CommandDispatch.admitControl}. */
|
|
946
1019
|
private admitControl;
|
|
947
1020
|
/** Run one v0.4 service-command handler through the SHARED admission chokepoint
|
|
948
1021
|
* ({@link admitControl}) on the broker-authenticated caller principal, mapping the two fences
|
|
949
1022
|
* onto the §13.3 catalog: maintenance/resume → `unavailable`, membership →
|
|
950
1023
|
* `permission-denied`. The serve boundary publishes the structured error reply. */
|
|
951
|
-
|
|
1024
|
+
protected serveGated<T>(ctx: EpServeContext, fn: () => T | Promise<T>): Promise<T>;
|
|
952
1025
|
/** `status` only: {@link serveGated}, except that a fully preserved manager, and an active one
|
|
953
1026
|
* launched for a resume that has not committed it yet, still answer it. A preserved-exit stop's
|
|
954
1027
|
* caller-attributed preview needs the preserved manager's stop impact, and a resumed service's
|
|
@@ -956,9 +1029,9 @@ export declare class Manager {
|
|
|
956
1029
|
* states. The read is counted in `lifecycleInFlight` like any admitted operation and released in
|
|
957
1030
|
* `finally`, so a drain waits at most for one status snapshot; the membership gate still
|
|
958
1031
|
* applies. `preserving` and a stopping manager stay fenced. */
|
|
959
|
-
|
|
1032
|
+
protected serveObservation<T>(ctx: EpServeContext, fn: () => T | Promise<T>): Promise<T>;
|
|
960
1033
|
/** {@link CommandDispatch.epAdminReach}. */
|
|
961
|
-
|
|
1034
|
+
protected epAdminReach(...args: Parameters<CommandDispatch["epAdminReach"]>): ReturnType<CommandDispatch["epAdminReach"]>;
|
|
962
1035
|
/** The run host, or one of three refusals. A remote-authority manager holds no space signer, so
|
|
963
1036
|
* it cannot mint the per-run driver credential SPEC 14.6 requires without all four closed
|
|
964
1037
|
* host callbacks. A local user-auth mesh is `unimplemented`: a hosted run's seats
|
|
@@ -968,16 +1041,21 @@ export declare class Manager {
|
|
|
968
1041
|
* either. An ordinary manager whose host is not standing yet is still booting (the serve
|
|
969
1042
|
* surface comes up before the host): `unavailable`, retry. The three are told apart, since
|
|
970
1043
|
* the first sentence steers a caller to `--local` and the others must not. */
|
|
971
|
-
|
|
1044
|
+
protected runHost(): RunHosting;
|
|
972
1045
|
/** The answerer a `run-answer` records (SPEC 14.5): the caller as this manager knows them. A
|
|
973
1046
|
* managed seat is named by its persona name; any other authenticated caller (an operator
|
|
974
1047
|
* instrument, a logged-in user) by its principal. Never the request body's word. */
|
|
975
|
-
|
|
1048
|
+
protected runAnswerer(ctx: EpServeContext): string;
|
|
976
1049
|
/** A baseline seat may answer only the pause whose relay is pending on that exact incarnation.
|
|
977
1050
|
* Explicit `run` holders and unmanaged operator instruments keep the run capability's existing
|
|
978
1051
|
* answer reach. The relay payload is manager-held state written by the runtime, never request
|
|
979
1052
|
* input, and its token is checked against the open checkpoint before any answer is filed. */
|
|
980
|
-
|
|
1053
|
+
protected authorizeRunAnswer(ctx: EpServeContext, args: {
|
|
1054
|
+
runId: string;
|
|
1055
|
+
stepKey: string;
|
|
1056
|
+
}, open: {
|
|
1057
|
+
token: string;
|
|
1058
|
+
}): void;
|
|
981
1059
|
/** Find one exact live presence row. Presence is not authority, but a participation lease with no
|
|
982
1060
|
* live addressee would authorize a durable turn nobody can receive. Duplicate exact rows are
|
|
983
1061
|
* refused rather than selected by order. */
|
|
@@ -985,19 +1063,35 @@ export declare class Manager {
|
|
|
985
1063
|
/** Authorize and renew one personal native participant. Local user-auth authority reads the exact
|
|
986
1064
|
* managed foreground row fresh; a signerless manager asks its registered host. The lease is held
|
|
987
1065
|
* only in memory and is therefore renewed after reconnect or manager restart. */
|
|
988
|
-
|
|
1066
|
+
protected serveTurnParticipation(caller: EpCaller): Promise<{
|
|
1067
|
+
owner: string;
|
|
1068
|
+
actor: string;
|
|
1069
|
+
lifecycleUid: string;
|
|
1070
|
+
name: string;
|
|
1071
|
+
managerInstanceId: string;
|
|
1072
|
+
expiresAt: number;
|
|
1073
|
+
}>;
|
|
989
1074
|
private currentParticipant;
|
|
990
1075
|
/** A managed seat or a finite authorized personal participant. Only the first carries custody. */
|
|
991
|
-
|
|
1076
|
+
protected turnTarget(ctx: EpServeContext): {
|
|
1077
|
+
kind: "managed";
|
|
1078
|
+
agent: ManagedAgent;
|
|
1079
|
+
name: string;
|
|
1080
|
+
} | {
|
|
1081
|
+
kind: "personal";
|
|
1082
|
+
participant: PersonalTurnParticipant;
|
|
1083
|
+
name: string;
|
|
1084
|
+
};
|
|
992
1085
|
/** Resolve whether an exact turn executor lifecycle is current. */
|
|
993
1086
|
private turnExecutorEpoch;
|
|
994
1087
|
/** A baseline seat may amend only an answer recorded under its own name: it changes its own
|
|
995
1088
|
* position, never another answerer's. Explicit `run` holders and unmanaged operator instruments
|
|
996
1089
|
* keep the reach they have to answer, as {@link authorizeRunAnswer} does. */
|
|
997
|
-
|
|
1090
|
+
protected authorizeRunAmend(ctx: EpServeContext, accepted: {
|
|
1091
|
+
by: string;
|
|
1092
|
+
}): void;
|
|
998
1093
|
/** {@link CommandDispatch.managerServiceDefs}. */
|
|
999
|
-
|
|
1000
|
-
private commitResumeActivation;
|
|
1094
|
+
protected managerServiceDefs(...args: Parameters<CommandDispatch["managerServiceDefs"]>): ReturnType<CommandDispatch["managerServiceDefs"]>;
|
|
1001
1095
|
/** Collapsed despawn/attach authorization (P4b). The caller already reached the command's ep
|
|
1002
1096
|
* row (cred-gated: owner-mode rows via the spawn capability, any-mode rows only in admin
|
|
1003
1097
|
* instruments). With admin=true (any-mode) any named target is allowed (operator). Otherwise
|
|
@@ -1008,62 +1102,87 @@ export declare class Manager {
|
|
|
1008
1102
|
* decisions locally, then send only the residual cross-owner admin question through the registered
|
|
1009
1103
|
* host callback with the full endpoint caller tuple. Error string when denied, `undefined` when
|
|
1010
1104
|
* allowed; remote host-state faults throw rather than being collapsed into a denial. */
|
|
1011
|
-
|
|
1105
|
+
protected authorizeNamed(target: ManagedAgent, caller: string, admin: boolean, epCaller?: EpCaller): Promise<string | undefined>;
|
|
1012
1106
|
/** The wire principal of a managed agent: {@link managedPrincipal}. */
|
|
1013
|
-
|
|
1014
|
-
|
|
1107
|
+
protected managedPrincipal(a: {
|
|
1108
|
+
id: string;
|
|
1109
|
+
userOwner?: string;
|
|
1110
|
+
}): string;
|
|
1015
1111
|
/** {@link CommandDispatch.opStopSelf}. */
|
|
1016
1112
|
opStopSelf(...args: Parameters<CommandDispatch["opStopSelf"]>): ReturnType<CommandDispatch["opStopSelf"]>;
|
|
1017
1113
|
/** {@link SeatStop.stopHandle}. */
|
|
1018
|
-
|
|
1114
|
+
protected stopHandle(...args: Parameters<SeatStop["stopHandle"]>): ReturnType<SeatStop["stopHandle"]>;
|
|
1019
1115
|
/** {@link SeatStop.stopWindowsSeat}. */
|
|
1020
|
-
|
|
1116
|
+
protected stopWindowsSeat(...args: Parameters<SeatStop["stopWindowsSeat"]>): ReturnType<SeatStop["stopWindowsSeat"]>;
|
|
1021
1117
|
/** {@link SeatStop.trackStoppedHandle}. */
|
|
1022
|
-
|
|
1023
|
-
|
|
1118
|
+
protected trackStoppedHandle(...args: Parameters<SeatStop["trackStoppedHandle"]>): ReturnType<SeatStop["trackStoppedHandle"]>;
|
|
1119
|
+
protected provisionUserAgent(name: string, opts: ProvisionUserAgentOpts): Promise<ProvisionedUserAgent | UserAgentRefusal>;
|
|
1024
1120
|
/** Shred a user agent's secret family from the store and from disk. Every removal is attempted,
|
|
1025
1121
|
* and each failure joins `unshredded`, so one fault cannot leave the rest of the family behind. */
|
|
1026
|
-
|
|
1122
|
+
protected shredUserSecrets(unshredded: CleanupFailure[], family: {
|
|
1123
|
+
actorToken?: string;
|
|
1124
|
+
sentinelCreds?: string;
|
|
1125
|
+
health?: string;
|
|
1126
|
+
}): Promise<void>;
|
|
1027
1127
|
/** {@link SeatStop.logSeatReaped}. */
|
|
1028
|
-
|
|
1128
|
+
protected logSeatReaped(...args: Parameters<SeatStop["logSeatReaped"]>): ReturnType<SeatStop["logSeatReaped"]>;
|
|
1029
1129
|
/** {@link SeatStop.logSeatMeshTransitions}. */
|
|
1030
|
-
|
|
1130
|
+
protected logSeatMeshTransitions(...args: Parameters<SeatStop["logSeatMeshTransitions"]>): ReturnType<SeatStop["logSeatMeshTransitions"]>;
|
|
1031
1131
|
/** {@link SeatStop.isOwnPresence}. */
|
|
1032
|
-
|
|
1033
|
-
|
|
1132
|
+
protected isOwnPresence(a: ManagedAgent, p: Presence | undefined): p is Presence;
|
|
1133
|
+
protected freeSlot(a: ManagedAgent, floor: boolean, cause: FreeSlotCause, acceptedBeforeFence?: boolean): void;
|
|
1034
1134
|
/** {@link SeatStop.dropInlineSnapshot}. */
|
|
1035
|
-
|
|
1135
|
+
protected dropInlineSnapshot(...args: Parameters<SeatStop["dropInlineSnapshot"]>): ReturnType<SeatStop["dropInlineSnapshot"]>;
|
|
1036
1136
|
/** {@link SeatStop.teardownTarget}. */
|
|
1037
|
-
|
|
1038
|
-
|
|
1137
|
+
protected teardownTarget(...args: Parameters<SeatStop["teardownTarget"]>): ReturnType<SeatStop["teardownTarget"]>;
|
|
1138
|
+
protected deprovision(a: TeardownTarget): Promise<void>;
|
|
1039
1139
|
/** Run one retirement in a {@link RETIREMENT_CONCURRENCY} slot, oldest first: a seat's deprovision, a
|
|
1040
1140
|
* chat session's terminal and a static reconcile's terminal all take one. No retirement awaits
|
|
1041
1141
|
* another, so the bounded pool cannot deadlock. */
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1142
|
+
protected withRetirementSlot<T>(run: () => Promise<T>): Promise<T>;
|
|
1143
|
+
protected confirmRetirement(a: {
|
|
1144
|
+
id: string;
|
|
1145
|
+
name: string;
|
|
1146
|
+
lifecycleUid: string;
|
|
1147
|
+
}): void;
|
|
1148
|
+
protected deprovisionBroker(a: {
|
|
1149
|
+
id: string;
|
|
1150
|
+
name: string;
|
|
1151
|
+
lifecycleUid: string;
|
|
1152
|
+
launch?: {
|
|
1153
|
+
allowSubscribe: readonly string[];
|
|
1154
|
+
};
|
|
1155
|
+
}): Promise<DeprovisionResourceAccounting>;
|
|
1045
1156
|
/** {@link SeatStop.fenceRetiringAcl}. */
|
|
1046
|
-
|
|
1157
|
+
protected fenceRetiringAcl(...args: Parameters<SeatStop["fenceRetiringAcl"]>): ReturnType<SeatStop["fenceRetiringAcl"]>;
|
|
1047
1158
|
/** {@link SeatStop.lifecycleMembershipInventory}. */
|
|
1048
|
-
|
|
1159
|
+
protected lifecycleMembershipInventory(...args: Parameters<SeatStop["lifecycleMembershipInventory"]>): ReturnType<SeatStop["lifecycleMembershipInventory"]>;
|
|
1049
1160
|
/** {@link SeatStop.reapChildrenOf}. */
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1161
|
+
protected reapChildrenOf(...args: Parameters<SeatStop["reapChildrenOf"]>): ReturnType<SeatStop["reapChildrenOf"]>;
|
|
1162
|
+
protected readManagedSessionState(a: ManagedAgent): {
|
|
1163
|
+
sessionId: string;
|
|
1164
|
+
status: "running" | "quit";
|
|
1165
|
+
} | {
|
|
1166
|
+
connector: string;
|
|
1167
|
+
status: "prompt";
|
|
1168
|
+
prompt: string;
|
|
1169
|
+
cwd: string;
|
|
1170
|
+
};
|
|
1171
|
+
protected retainedSessionId(entry: ManagerResumeAgent, connector: Connector): string | undefined;
|
|
1172
|
+
protected forkProvenance(a: ManagedAgent): ForkProvenance | undefined;
|
|
1173
|
+
protected readManagedSession(a: ManagedAgent): string;
|
|
1174
|
+
protected recordContinuity(a: ManagedAgent, sessionId: string): void;
|
|
1175
|
+
protected recordContinuityAtStop(a: ManagedAgent, boundary: string): void;
|
|
1176
|
+
protected armSessionRecovery(a: ManagedAgent): Promise<void>;
|
|
1058
1177
|
/** Why an inline seat's snapshot no longer matches its launch, or `undefined` when it does or the
|
|
1059
1178
|
* seat is not inline. The recorded path and the relaunch's path must both be this lifecycle's
|
|
1060
1179
|
* snapshot path, as the resume cut requires, and the file there must still be a private regular
|
|
1061
1180
|
* file with the recorded digest. */
|
|
1062
|
-
|
|
1063
|
-
|
|
1181
|
+
protected inlineSnapshotChange(a: ManagedAgent): string | undefined;
|
|
1182
|
+
protected recoverManagedSession(a: ManagedAgent): void;
|
|
1064
1183
|
/** {@link SeatStop.onAgentExit}. */
|
|
1065
|
-
|
|
1066
|
-
|
|
1184
|
+
protected onAgentExit(...args: Parameters<SeatStop["onAgentExit"]>): ReturnType<SeatStop["onAgentExit"]>;
|
|
1185
|
+
protected nameError(name: string): string | undefined;
|
|
1067
1186
|
/** Spawn a teammate by persona ref (`name` loads `.cotal/agents/<name>.md`; the peer presents
|
|
1068
1187
|
* under that file's own `name:`), as if a peer asked via the control plane. Used to pre-spawn the
|
|
1069
1188
|
* demo's experts at startup so the manager owns them. */
|
|
@@ -1075,40 +1194,43 @@ export declare class Manager {
|
|
|
1075
1194
|
* acceptable for cold-start staggering; it never routes anything. */
|
|
1076
1195
|
waitForPresence(name: string, timeoutMs?: number): Promise<boolean>;
|
|
1077
1196
|
/** {@link StartDoors.opStart}. */
|
|
1078
|
-
|
|
1079
|
-
|
|
1197
|
+
protected opStart(...args: Parameters<StartDoors["opStart"]>): ReturnType<StartDoors["opStart"]>;
|
|
1198
|
+
protected listSpawnDirectory(args: Record<string, unknown>): ReturnType<SeatLaunch["listSpawnDirectory"]>;
|
|
1080
1199
|
/** {@link SeatLaunch.resolveSpawnCwd}. */
|
|
1081
|
-
|
|
1200
|
+
protected resolveSpawnCwd(value: unknown): {
|
|
1201
|
+
cwd: string;
|
|
1202
|
+
host: string;
|
|
1203
|
+
};
|
|
1082
1204
|
/** {@link HarnessResolution.resolveConnector}. */
|
|
1083
|
-
|
|
1205
|
+
protected resolveConnector(...args: Parameters<HarnessResolution["resolveConnector"]>): ReturnType<HarnessResolution["resolveConnector"]>;
|
|
1084
1206
|
/** {@link SeatLaunch.connectorNames}. */
|
|
1085
|
-
|
|
1207
|
+
protected connectorNames(): string[];
|
|
1086
1208
|
/** {@link ConnectorInventory.inspectConnectorsAtBoot}. */
|
|
1087
|
-
|
|
1209
|
+
protected inspectConnectorsAtBoot(...args: Parameters<ConnectorInventory["inspectConnectorsAtBoot"]>): ReturnType<ConnectorInventory["inspectConnectorsAtBoot"]>;
|
|
1088
1210
|
/** Install and verify the hosted Claude wake channel, or report the cause and remedy. */
|
|
1089
|
-
|
|
1211
|
+
protected prepareClaudeWake(): Promise<string | undefined>;
|
|
1090
1212
|
/** Retry unavailable applications without changing resolved available rows. Claude launches
|
|
1091
1213
|
* join the status or launch that started wake setup, before any name or capacity is reserved. */
|
|
1092
|
-
|
|
1214
|
+
protected refreshUnavailableConnectors(name?: string, setupClaude?: boolean): Promise<void> | undefined;
|
|
1093
1215
|
/** {@link SeatLaunch.classSpawnEnabled}. */
|
|
1094
|
-
|
|
1095
|
-
|
|
1216
|
+
protected classSpawnEnabled(): boolean;
|
|
1217
|
+
protected omitClassCommands(): readonly string[] | undefined;
|
|
1096
1218
|
/** {@link HarnessResolution.launchHarness}. */
|
|
1097
|
-
|
|
1219
|
+
protected launchHarness(...args: Parameters<HarnessResolution["launchHarness"]>): ReturnType<HarnessResolution["launchHarness"]>;
|
|
1098
1220
|
/** {@link HarnessResolution.hostLaunchFields}. */
|
|
1099
|
-
|
|
1221
|
+
protected hostLaunchFields(...args: Parameters<HarnessResolution["hostLaunchFields"]>): ReturnType<HarnessResolution["hostLaunchFields"]>;
|
|
1100
1222
|
/** {@link HarnessResolution.capabilityRefusal}. */
|
|
1101
|
-
|
|
1223
|
+
protected capabilityRefusal(...args: Parameters<HarnessResolution["capabilityRefusal"]>): ReturnType<HarnessResolution["capabilityRefusal"]>;
|
|
1102
1224
|
/** {@link SeatLaunch.onceRefusal}. */
|
|
1103
1225
|
onceRefusal(connector: Connector, runtime: Runtime, launch: Pick<StartAgentOpts, "once" | "supervise" | "launchOptions" | "prompt">, spawner: string | undefined, hooks: SpawnHooks | undefined): string | undefined;
|
|
1104
1226
|
/** {@link HarnessResolution.eventsRefusal}. */
|
|
1105
|
-
|
|
1227
|
+
protected eventsRefusal(...args: Parameters<HarnessResolution["eventsRefusal"]>): ReturnType<HarnessResolution["eventsRefusal"]>;
|
|
1106
1228
|
/** {@link StatusAndModels.opModels}. */
|
|
1107
|
-
|
|
1229
|
+
protected opModels(...args: Parameters<StatusAndModels["opModels"]>): ReturnType<StatusAndModels["opModels"]>;
|
|
1108
1230
|
/** {@link StatusAndModels.psOwnerFilter}. */
|
|
1109
|
-
|
|
1231
|
+
protected psOwnerFilter(...args: Parameters<StatusAndModels["psOwnerFilter"]>): ReturnType<StatusAndModels["psOwnerFilter"]>;
|
|
1110
1232
|
/** {@link StartDoors.opLaunch}. */
|
|
1111
|
-
|
|
1233
|
+
protected opLaunch(...args: Parameters<StartDoors["opLaunch"]>): ReturnType<StartDoors["opLaunch"]>;
|
|
1112
1234
|
/** Spawn and supervise one agent. The single spawn path: both the control-plane
|
|
1113
1235
|
* `start` op and declarative roster boot call this. Mints scoped creds in auth mode,
|
|
1114
1236
|
* resolves the agent file, launches via the connector + runtime, and records the handle.
|
|
@@ -1117,158 +1239,177 @@ export declare class Manager {
|
|
|
1117
1239
|
* ledger (own-children despawn + reap-on-parent-exit). */
|
|
1118
1240
|
startAgent(opts: StartAgentOpts, spawner?: string, hooks?: SpawnHooks, authenticatedCaller?: EpCaller): Promise<ControlReply>;
|
|
1119
1241
|
/** {@link SeatLaunch.spawnPersona}. */
|
|
1120
|
-
|
|
1242
|
+
protected spawnPersona(...args: Parameters<SeatLaunch["spawnPersona"]>): ReturnType<SeatLaunch["spawnPersona"]>;
|
|
1121
1243
|
/** {@link SeatLaunch.spawnRun}. */
|
|
1122
|
-
|
|
1244
|
+
protected spawnRun(caller: EpCaller | undefined, runId: string | undefined): Promise<SpawnRun | undefined>;
|
|
1123
1245
|
/** {@link SeatLaunch.staticSpawnBound}. */
|
|
1124
|
-
|
|
1246
|
+
protected staticSpawnBound(caller: EpCaller | undefined, run: Extract<SpawnRun, {
|
|
1247
|
+
admission: RunAdmission;
|
|
1248
|
+
}> | undefined): Promise<StaticSpawnBound>;
|
|
1125
1249
|
/** {@link SeatLaunch.spawnBoundRefusal}. */
|
|
1126
|
-
|
|
1250
|
+
protected spawnBoundRefusal(bound: StaticSpawnBound, grant: DelegatedGrant, armsEvents: boolean, door?: "spawn" | "define-persona"): string | undefined;
|
|
1127
1251
|
/** {@link SeatLaunch.managedStaticInstanceReads}. */
|
|
1128
|
-
|
|
1129
|
-
/**
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
/**
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
/** The seat reference behind a live retained principal, when that seat is provably one a lost
|
|
1137
|
-
* manager of this logical instance launched for this exact incarnation. The resume binds the
|
|
1138
|
-
* launched handle's reference to the incarnation's active slot before it waits for readiness, and
|
|
1139
|
-
* the coordinator journals `resume-active` only after that wait, so a coordinator crash between the
|
|
1140
|
-
* two leaves `resume-intent` behind a live seat. Undefined for everything else, which stays refused:
|
|
1141
|
-
* another incarnation's presence, a slot another instance owns, a runtime that cannot reap the
|
|
1142
|
-
* reference, and user or open meshes, which keep no slot. */
|
|
1143
|
-
private orphanedResumeSeat;
|
|
1144
|
-
/** Reap a seat {@link orphanedResumeSeat} found, then wait for its principal to leave presence so
|
|
1145
|
-
* the relaunch's readiness cannot match the dead seat's row. Returns the refusal when the reap
|
|
1146
|
-
* proves nothing or the principal stays live, which means another process holds it. */
|
|
1147
|
-
private reapOrphanedResumeSeat;
|
|
1148
|
-
/** Validate/relaunch one retained inventory entry. Called through resumePreserved so all records
|
|
1149
|
-
* pass the same preflight before the first child is exposed, and through restartSupervisedSeat
|
|
1150
|
-
* with the one record a crashed manager left (`supervised`). */
|
|
1151
|
-
private resumePreservedAgent;
|
|
1152
|
-
private launchPreparedResume;
|
|
1153
|
-
/** Arm a resumed seat's restart once it is ready, whether it joined inside the readiness window or
|
|
1154
|
-
* after it (#4144). A supervised restart arms the way its spawn did: a connector with no session
|
|
1155
|
-
* continuation is armed at readiness, one with it once its session is proved. Returns why the
|
|
1156
|
-
* session could not be rebound, and the caller stops the seat. */
|
|
1157
|
-
private armResumedSeat;
|
|
1158
|
-
/** A resumed seat whose readiness was uncertain gets what a ready one gets once it joins: its
|
|
1159
|
-
* restart is armed and its record rewritten. Without this, a supervised seat restarted after a
|
|
1160
|
-
* manager crash that joined late was retired on its next exit instead of restarted. */
|
|
1161
|
-
private armLateResume;
|
|
1162
|
-
/** A resumed seat keeps its retained credentials, so freeing it runs no deprovision and nothing
|
|
1163
|
-
* would reap it: it is freed only once its exit is proved, and otherwise stays managed until it
|
|
1164
|
-
* exits or the manager stops it. */
|
|
1165
|
-
private stopFailedResume;
|
|
1166
|
-
private probeStaticCredential;
|
|
1167
|
-
/** An uncertain resume remains non-destructive until exact-principal AND exact-incarnation presence
|
|
1168
|
-
* arrives later, and then `adopted` runs. Same predicate as the readiness fence: a principal-only
|
|
1169
|
-
* match would let a wrong/absent-uid presence under the reused alias clear cleanup suppression on
|
|
1170
|
-
* another incarnation. A supervised restart keeps its principal and uid, so it also carries the
|
|
1171
|
-
* fence's `joinedAfter` bound: the row the dead seat left must not stand in for the new process.
|
|
1172
|
-
* A heartbeat on that row moves only its time and emits no presence event, so the bound is polled. */
|
|
1173
|
-
private watchResumeAdoption;
|
|
1252
|
+
protected managedStaticInstanceReads(capabilities: readonly string[] | undefined): EpCapability[];
|
|
1253
|
+
/** {@link PreservedResume.resumePreserved}. */
|
|
1254
|
+
resumePreserved(...args: Parameters<PreservedResume["resumePreserved"]>): ReturnType<PreservedResume["resumePreserved"]>;
|
|
1255
|
+
/** {@link PreservedResume.validateRetainedAuthority}. */
|
|
1256
|
+
protected validateRetainedAuthority(...args: Parameters<PreservedResume["validateRetainedAuthority"]>): ReturnType<PreservedResume["validateRetainedAuthority"]>;
|
|
1257
|
+
/** {@link PreservedResume.resumePreservedAgent}. */
|
|
1258
|
+
protected resumePreservedAgent(...args: Parameters<PreservedResume["resumePreservedAgent"]>): ReturnType<PreservedResume["resumePreservedAgent"]>;
|
|
1259
|
+
protected probeStaticCredential(creds: string): Promise<import("@cotal-ai/core").ProbeResult>;
|
|
1174
1260
|
/** {@link ReadinessWait.awaitReadiness}. */
|
|
1175
|
-
|
|
1261
|
+
protected awaitReadiness(...args: Parameters<ReadinessWait["awaitReadiness"]>): ReturnType<ReadinessWait["awaitReadiness"]>;
|
|
1176
1262
|
/** {@link ReadinessWait.tail}. */
|
|
1177
|
-
|
|
1263
|
+
protected tail(...args: Parameters<ReadinessWait["tail"]>): ReturnType<ReadinessWait["tail"]>;
|
|
1178
1264
|
/** {@link ReadinessWait.watchExit}. */
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1265
|
+
protected watchExit(...args: Parameters<ReadinessWait["watchExit"]>): ReturnType<ReadinessWait["watchExit"]>;
|
|
1266
|
+
protected occupancy(): Occupancy;
|
|
1267
|
+
protected occupancyText(o: Occupancy): string;
|
|
1268
|
+
protected capacityRefusal(o: Occupancy): string;
|
|
1183
1269
|
/** The owner a launch belongs to: {@link NamesCapacity.launchOwner}. */
|
|
1184
|
-
|
|
1270
|
+
protected launchOwner(opts: Pick<StartAgentOpts, "owner">, spawner?: string): string;
|
|
1185
1271
|
/** Live seats this manager holds for one owner: {@link NamesCapacity.ownerSeats}. */
|
|
1186
1272
|
private ownerSeats;
|
|
1187
1273
|
/** The per-owner ceiling at accept: {@link NamesCapacity.seatCapRefusal}. */
|
|
1188
|
-
|
|
1274
|
+
protected seatCapRefusal(owner: string): EpEnvelopeError | undefined;
|
|
1189
1275
|
/** {@link SeatStop.opStop}. */
|
|
1190
1276
|
private opStop;
|
|
1191
1277
|
/** {@link SeatStop.despawnAuthorized}. */
|
|
1192
|
-
|
|
1278
|
+
protected despawnAuthorized(...args: Parameters<SeatStop["despawnAuthorized"]>): ReturnType<SeatStop["despawnAuthorized"]>;
|
|
1193
1279
|
/** {@link SeatStop.retireDelegatedAgent}. */
|
|
1194
1280
|
retireDelegatedAgent(name: string, intentId: string): Promise<ControlReply>;
|
|
1195
1281
|
/** {@link SeatStop.findManagedByTarget}. */
|
|
1196
|
-
|
|
1282
|
+
protected findManagedByTarget(...args: Parameters<SeatStop["findManagedByTarget"]>): ReturnType<SeatStop["findManagedByTarget"]>;
|
|
1197
1283
|
/** {@link BrokerTransport.withLifecycleExecutor}. */
|
|
1198
|
-
|
|
1284
|
+
protected withLifecycleExecutor<T>(pin: {
|
|
1285
|
+
owner: string;
|
|
1286
|
+
actor: string;
|
|
1287
|
+
lifecycleUid: string;
|
|
1288
|
+
alias: string;
|
|
1289
|
+
}, fn: (t: LifecycleStateTransport) => Promise<T>): Promise<T>;
|
|
1199
1290
|
/** {@link BrokerTransport.withIssuer}. */
|
|
1200
|
-
|
|
1291
|
+
protected withIssuer<T>(fn: (i: {
|
|
1292
|
+
store: IssuedStore;
|
|
1293
|
+
accepted: KV;
|
|
1294
|
+
}) => Promise<T>): Promise<T>;
|
|
1201
1295
|
/** {@link BrokerTransport.issuanceSeam}. */
|
|
1202
|
-
|
|
1296
|
+
protected issuanceSeam(...args: Parameters<BrokerTransport["issuanceSeam"]>): ReturnType<BrokerTransport["issuanceSeam"]>;
|
|
1203
1297
|
/** {@link BrokerTransport.withEndpointServeExecutor}. */
|
|
1204
|
-
|
|
1298
|
+
protected withEndpointServeExecutor<T>(fn: (kvs: {
|
|
1299
|
+
recordsKv: KV;
|
|
1300
|
+
authKv: KV;
|
|
1301
|
+
nc: NatsConnection;
|
|
1302
|
+
}) => Promise<T>): Promise<T>;
|
|
1205
1303
|
/** {@link BrokerTransport.withOpenServeConnection}. */
|
|
1206
|
-
|
|
1304
|
+
protected withOpenServeConnection<T>(fn: (kvs: {
|
|
1305
|
+
recordsKv: KV;
|
|
1306
|
+
authKv: KV;
|
|
1307
|
+
nc: NatsConnection;
|
|
1308
|
+
}) => Promise<T>): Promise<T>;
|
|
1207
1309
|
/** {@link StatusAndModels.hostedSeatCount}. */
|
|
1208
1310
|
hostedSeatCount(...args: Parameters<StatusAndModels["hostedSeatCount"]>): ReturnType<StatusAndModels["hostedSeatCount"]>;
|
|
1209
1311
|
/** {@link StatusAndModels.hostedAgents}. */
|
|
1210
1312
|
hostedAgents(...args: Parameters<StatusAndModels["hostedAgents"]>): ReturnType<StatusAndModels["hostedAgents"]>;
|
|
1211
1313
|
/** {@link StatusAndModels.managerStatusData}. */
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
/**
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
private dialServeConnection;
|
|
1227
|
-
private registerManagerService;
|
|
1314
|
+
protected managerStatusData(...args: Parameters<StatusAndModels["managerStatusData"]>): ReturnType<StatusAndModels["managerStatusData"]>;
|
|
1315
|
+
protected staticReconciliationStatus(): ManagerStaticReconciliationStatus;
|
|
1316
|
+
/** {@link ManagerBoot.healFrozenRegistrationGate}. */
|
|
1317
|
+
protected healFrozenRegistrationGate(...args: Parameters<ManagerBoot["healFrozenRegistrationGate"]>): ReturnType<ManagerBoot["healFrozenRegistrationGate"]>;
|
|
1318
|
+
protected dialServeConnection(state: {
|
|
1319
|
+
nc: NatsConnection;
|
|
1320
|
+
identity: Identity;
|
|
1321
|
+
grant: EpServeGrant;
|
|
1322
|
+
creds?: string;
|
|
1323
|
+
}, readCreds?: () => string, deadline?: number): Promise<{
|
|
1324
|
+
nc: NatsConnection;
|
|
1325
|
+
handle: EpServeHandle;
|
|
1326
|
+
}>;
|
|
1327
|
+
protected registerManagerService(): Promise<void>;
|
|
1228
1328
|
/** {@link GoalWriter.mintAndStageGoalWriter}. */
|
|
1229
|
-
|
|
1329
|
+
protected mintAndStageGoalWriter(...args: Parameters<GoalWriter["mintAndStageGoalWriter"]>): ReturnType<GoalWriter["mintAndStageGoalWriter"]>;
|
|
1230
1330
|
/** {@link GoalWriter.startGoalWriter}. */
|
|
1231
|
-
|
|
1331
|
+
protected startGoalWriter(...args: Parameters<GoalWriter["startGoalWriter"]>): ReturnType<GoalWriter["startGoalWriter"]>;
|
|
1232
1332
|
/** {@link GoalWriter.stopGoalWriter}. */
|
|
1233
1333
|
private stopGoalWriter;
|
|
1234
|
-
|
|
1235
|
-
|
|
1334
|
+
protected mintAndStageSessionLedger(authKv: KV): Promise<string>;
|
|
1335
|
+
protected startSessionPlane(): Promise<void>;
|
|
1236
1336
|
private stopSessionPlane;
|
|
1237
1337
|
/** {@link GoalWriter.reconcileGoalIndex}. */
|
|
1238
|
-
|
|
1338
|
+
protected reconcileGoalIndex(...args: Parameters<GoalWriter["reconcileGoalIndex"]>): ReturnType<GoalWriter["reconcileGoalIndex"]>;
|
|
1239
1339
|
/** {@link GoalWriter.emitGoalProgress}. */
|
|
1240
|
-
|
|
1340
|
+
protected emitGoalProgress(...args: Parameters<GoalWriter["emitGoalProgress"]>): ReturnType<GoalWriter["emitGoalProgress"]>;
|
|
1241
1341
|
/** {@link GoalWriter.assertGoalWriterEpochCurrent}. */
|
|
1242
|
-
|
|
1342
|
+
protected assertGoalWriterEpochCurrent(...args: Parameters<GoalWriter["assertGoalWriterEpochCurrent"]>): ReturnType<GoalWriter["assertGoalWriterEpochCurrent"]>;
|
|
1243
1343
|
/** {@link SpawnGoal.loggedSpawnRefusal}. */
|
|
1244
|
-
|
|
1344
|
+
protected loggedSpawnRefusal<T>(ctx: EpServeContext, serve: () => Promise<T>): Promise<T>;
|
|
1245
1345
|
/** {@link SpawnGoal.serveSpawnGoal}. */
|
|
1246
|
-
|
|
1346
|
+
protected serveSpawnGoal(...args: Parameters<SpawnGoal["serveSpawnGoal"]>): ReturnType<SpawnGoal["serveSpawnGoal"]>;
|
|
1247
1347
|
/** {@link SpawnGoal.expireGoalAcceptance}. */
|
|
1248
|
-
|
|
1348
|
+
protected expireGoalAcceptance(...args: Parameters<SpawnGoal["expireGoalAcceptance"]>): ReturnType<SpawnGoal["expireGoalAcceptance"]>;
|
|
1249
1349
|
/** Accept one `turn` goal against a live managed seat. Mirrors {@link serveSpawnGoal}'s accept
|
|
1250
1350
|
* path (idempotent retry map, index-CAS-before-bind, create-only bindGoal) but runs it INLINE:
|
|
1251
1351
|
* there is no launch to hand off, so the accept either completes durably or unwinds its own
|
|
1252
1352
|
* bound goal with a `failed` terminal before refusing. */
|
|
1253
|
-
|
|
1353
|
+
protected serveTurnGoal(ctx: EpServeContext, target: {
|
|
1354
|
+
kind: "managed";
|
|
1355
|
+
agent: ManagedAgent;
|
|
1356
|
+
name: string;
|
|
1357
|
+
} | {
|
|
1358
|
+
kind: "personal";
|
|
1359
|
+
participant: PersonalTurnParticipant;
|
|
1360
|
+
name: string;
|
|
1361
|
+
}): Promise<TurnAcceptance>;
|
|
1254
1362
|
/** The seat's pull: every pending turn addressed to the CALLER's incarnation, oldest first.
|
|
1255
1363
|
* The uid is part of the address — a successor seat never receives a predecessor's turn. */
|
|
1256
|
-
|
|
1364
|
+
protected turnPendingFor(c: {
|
|
1365
|
+
owner: string;
|
|
1366
|
+
actor: string;
|
|
1367
|
+
uid: string;
|
|
1368
|
+
}): {
|
|
1369
|
+
turns: {
|
|
1370
|
+
goalId: string;
|
|
1371
|
+
payload: string;
|
|
1372
|
+
acceptedAt: number;
|
|
1373
|
+
deadlineAt?: number;
|
|
1374
|
+
once?: true;
|
|
1375
|
+
}[];
|
|
1376
|
+
notices: true;
|
|
1377
|
+
stop?: true;
|
|
1378
|
+
};
|
|
1257
1379
|
/** Tell a seat that its `turn-pending` answer changed (SPEC 14.3 turn notice), over the serve
|
|
1258
1380
|
* connection that holds this instance's reply rows. The notice carries no turn and the seat
|
|
1259
1381
|
* pulls on it, so a lost notice delays that seat until its next pull, and nothing else. */
|
|
1260
|
-
|
|
1382
|
+
protected noticeSeatTurns(seat: {
|
|
1383
|
+
name: string;
|
|
1384
|
+
owner: string;
|
|
1385
|
+
actor: string;
|
|
1386
|
+
uid: string;
|
|
1387
|
+
}): void;
|
|
1261
1388
|
/** The seat's yield: claim the hold (one-use; expiry fails closed), then commit the goal
|
|
1262
1389
|
* `succeeded` carrying the TurnResult. A yield AFTER the deadline drives the deadline terminal
|
|
1263
1390
|
* instead and refuses — the expiry outcome stands, never a late success over it. */
|
|
1264
|
-
|
|
1391
|
+
protected serveTurnYield(c: {
|
|
1392
|
+
owner: string;
|
|
1393
|
+
actor: string;
|
|
1394
|
+
uid: string;
|
|
1395
|
+
}, raw: Record<string, unknown>): Promise<{
|
|
1396
|
+
goalId: string;
|
|
1397
|
+
state: string;
|
|
1398
|
+
}>;
|
|
1265
1399
|
/** A once seat's report that its task's handoff to its harness was not confirmed. The seat sealed
|
|
1266
1400
|
* the task before it reported, so nothing hands it over again; the task fails
|
|
1267
1401
|
* `delivery-unconfirmed` and the seat is stopped. The commit proves the seat's live currency, as
|
|
1268
1402
|
* a yield's does: a seat already gone commits nothing here, and its exit cancels the task. Only
|
|
1269
1403
|
* the addressed seat may report, only for its once task; a repeat after the terminal is answered
|
|
1270
1404
|
* with it. */
|
|
1271
|
-
|
|
1405
|
+
protected serveTurnUnconfirmed(c: {
|
|
1406
|
+
owner: string;
|
|
1407
|
+
actor: string;
|
|
1408
|
+
uid: string;
|
|
1409
|
+
}, raw: Record<string, unknown>): Promise<{
|
|
1410
|
+
goalId: string;
|
|
1411
|
+
state: string;
|
|
1412
|
+
}>;
|
|
1272
1413
|
/** The caller withdraws a turn it submitted (the reserved `cancel`, SPEC 13.6 item 4), so the
|
|
1273
1414
|
* seat is not shown it again and a late yield is answered from the cancelled terminal. Only a
|
|
1274
1415
|
* relay this incarnation holds is moved to `cancelling`, because only its holder can commit the
|
|
@@ -1279,30 +1420,61 @@ export declare class Manager {
|
|
|
1279
1420
|
* held: a yield that read the entry first, or this commit with only its reply lost. An entry
|
|
1280
1421
|
* whose outcome cannot be read back stays out and converges through the goal index at the
|
|
1281
1422
|
* next boot, as a failed deadline commit does. */
|
|
1282
|
-
|
|
1423
|
+
protected serveTurnCancel(ctx: EpServeContext): Promise<{
|
|
1424
|
+
goalId: string;
|
|
1425
|
+
state: string;
|
|
1426
|
+
}>;
|
|
1283
1427
|
/** The reap hook: a pending turn addressed to the reaped INCARNATION is MARKED dead, never
|
|
1284
1428
|
* settled early — no honest terminal exists for it (a completion must prove the executor's
|
|
1285
1429
|
* live currency, and the hold is only expirable once due), so the entry rides to its deadline
|
|
1286
1430
|
* and the deny then records both facts. The addressee's own client observes the death from
|
|
1287
1431
|
* presence long before that, which is the run's L4002. */
|
|
1288
|
-
|
|
1432
|
+
protected failSeatTurns(name: string, uid: string): void;
|
|
1289
1433
|
/** Adopt one inherited TURN goal at boot (the reconcile sweep's turn branch): a non-terminal
|
|
1290
1434
|
* entry carrying a parseable note rebuilds its pending relay — never an `uncertain` settle,
|
|
1291
1435
|
* because the deadline hold IS this goal's bounded ending and it survived the restart. No
|
|
1292
1436
|
* liveness verdict is made here (the agents map is empty during reconcile, so absence means
|
|
1293
1437
|
* "not yet re-registered", never "dead"); a garbled note or a floor that does not name the
|
|
1294
1438
|
* seat's owner is logged and left, the dead-pointer honesty rule. */
|
|
1295
|
-
|
|
1439
|
+
protected adoptTurnGoal(entry: {
|
|
1440
|
+
ref: GoalRef;
|
|
1441
|
+
iid: string;
|
|
1442
|
+
allocated?: GoalIndexEntry["allocated"];
|
|
1443
|
+
note?: string;
|
|
1444
|
+
}): Promise<void>;
|
|
1296
1445
|
/** Accept a once spawn's task, inline in the spawn's accept seam: nothing has launched yet, so a
|
|
1297
1446
|
* refusal here fails the spawn and leaves no seat. Mirrors {@link serveTurnGoal}'s accept, with
|
|
1298
1447
|
* the goal ref and the seat given rather than read off a request. A task with no deadline mints
|
|
1299
1448
|
* no hold; its goal still records the spawn's readiness budget, which a successor needs to settle
|
|
1300
1449
|
* it. */
|
|
1301
|
-
|
|
1450
|
+
protected acceptOnceTurn(o: {
|
|
1451
|
+
spawnRef: GoalRef;
|
|
1452
|
+
fingerprint: string;
|
|
1453
|
+
command: string;
|
|
1454
|
+
executor: {
|
|
1455
|
+
lifecycleUid: string;
|
|
1456
|
+
epoch: number;
|
|
1457
|
+
};
|
|
1458
|
+
acceptedAt: number;
|
|
1459
|
+
seat: {
|
|
1460
|
+
name: string;
|
|
1461
|
+
owner: string;
|
|
1462
|
+
actor: string;
|
|
1463
|
+
uid: string;
|
|
1464
|
+
};
|
|
1465
|
+
prompt: string;
|
|
1466
|
+
spawner: string;
|
|
1467
|
+
deadlineMs: number | undefined;
|
|
1468
|
+
readinessDeadlineMs: number;
|
|
1469
|
+
retire?: string;
|
|
1470
|
+
}): Promise<{
|
|
1471
|
+
ref: GoalRef;
|
|
1472
|
+
deadlineAt?: number;
|
|
1473
|
+
}>;
|
|
1302
1474
|
/** How a once seat's startup watch ended: {@link awaitStartupOutcome}. */
|
|
1303
|
-
|
|
1475
|
+
protected awaitStartupOutcome(a: ManagedAgent, launchedAt: number, readinessTimeoutMs: number): Promise<StartupOutcome>;
|
|
1304
1476
|
/** Serve a once task from now on: its spawn's succeeded terminal is written. */
|
|
1305
|
-
|
|
1477
|
+
protected openOnceDelivery(ref: GoalRef): void;
|
|
1306
1478
|
/** Stop the seat of a once task that just ended, found by its incarnation and never by its name.
|
|
1307
1479
|
* After the readiness verdict the spawn goal's outcome belongs to that verdict, so the stop lets
|
|
1308
1480
|
* go of the spawn goal first and never cancels it. Before the verdict it is a deliberate stop,
|
|
@@ -1313,83 +1485,106 @@ export declare class Manager {
|
|
|
1313
1485
|
private stopOnceSeat;
|
|
1314
1486
|
/** Stop a seat this spawn just placed and track its exit: the stop first, so the terminalizing
|
|
1315
1487
|
* latch is set before anything awaits, then the exit tracking. Both are synchronous. */
|
|
1316
|
-
|
|
1488
|
+
protected stopAndTrack(a: ManagedAgent, cause: FreeSlotCause): void;
|
|
1317
1489
|
/** End a once seat before its task is served: let go of the spawn goal, record why it stopped if
|
|
1318
1490
|
* `stopReason` is given and none is recorded yet, then stop the seat. Synchronous, in that order. */
|
|
1319
|
-
|
|
1491
|
+
protected endOnceBeforeServe(a: ManagedAgent, reason: string, stopReason?: string): void;
|
|
1320
1492
|
/** Put a launched seat in the agent table, then mark its reserved name placed. */
|
|
1321
|
-
|
|
1493
|
+
protected place(name: string, a: ManagedAgent): void;
|
|
1322
1494
|
/** The once task's exit hook, on the handle the seat was launched with: whichever path ends the
|
|
1323
1495
|
* seat, its proved exit cancels a task that has no terminal yet and discharges the seat's debt. An
|
|
1324
1496
|
* exit that cannot be proved leaves both. */
|
|
1325
|
-
|
|
1497
|
+
protected watchOnceExit(a: ManagedAgent): void;
|
|
1326
1498
|
/** End a once task that can no longer run: once its connector, when it has a `retire` hook, proves
|
|
1327
1499
|
* the seat's launched processes gone, cancel the task with `reason` if it has no terminal yet,
|
|
1328
1500
|
* then drop its index entry. One flight per task; a failure keeps it in {@link onceSettles} and
|
|
1329
1501
|
* the turn sweep retries it. */
|
|
1330
|
-
|
|
1502
|
+
protected settleOnceTurn(ref: GoalRef, reason: string, retire?: OnceRetire): Promise<void>;
|
|
1331
1503
|
/** Cancel a once task with `reason` unless it already has a terminal. */
|
|
1332
|
-
|
|
1504
|
+
protected commitOnceCancel(ref: GoalRef, reason: string): Promise<void>;
|
|
1333
1505
|
/** Ask the seat's connector to prove its launched processes gone, within {@link ONCE_RETIRE_MS}.
|
|
1334
1506
|
* Throws without that proof. */
|
|
1335
1507
|
private retireOnceSeat;
|
|
1336
1508
|
/** Make an adopted seat a once seat again: its exit settles its task, and the task is served to
|
|
1337
1509
|
* it. A task that ended before the restart owes the stop the predecessor may not have made. */
|
|
1338
|
-
|
|
1510
|
+
protected bindOnceSeat(a: ManagedAgent): Promise<void>;
|
|
1339
1511
|
/** {@link SeatStop.cancelAgentGoal}. */
|
|
1340
1512
|
private cancelAgentGoal;
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1513
|
+
protected recordSlotRuntime(a: ManagedAgent): Promise<void>;
|
|
1514
|
+
protected recordSlotCustody(a: {
|
|
1515
|
+
name: string;
|
|
1516
|
+
id: string;
|
|
1517
|
+
lifecycleUid: string;
|
|
1518
|
+
}, runtime: RuntimeReference): Promise<void>;
|
|
1519
|
+
protected reserveCustody(runtime: Runtime): RuntimeReference | undefined;
|
|
1520
|
+
protected spawnCustodied(runtime: Runtime, name: string, spec: LaunchSpec, cwd: string, reserved: RuntimeReference | undefined): Promise<AgentHandle>;
|
|
1345
1521
|
/** Keep launch provenance independent of status and runtime wire contracts: {@link watchConnectorHolder}. */
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1522
|
+
protected watchConnectorHolder(handle: AgentHandle, holder: ReturnType<typeof retainConnectorSeat>): void;
|
|
1523
|
+
protected refreshSeatRecord(a: ManagedAgent): void;
|
|
1524
|
+
protected dropSeatRecord(a: {
|
|
1525
|
+
name: string;
|
|
1526
|
+
lifecycleUid: string;
|
|
1527
|
+
}): void;
|
|
1349
1528
|
/** True when a default stop wrote a runtime reference for this exact lifecycle and it is still
|
|
1350
1529
|
* there. That file is what a later manager adopts, so a slot free must not remove it before the
|
|
1351
1530
|
* retirement that confirms the lifecycle is gone. */
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1531
|
+
protected releasedSeatPending(a: {
|
|
1532
|
+
name: string;
|
|
1533
|
+
lifecycleUid: string;
|
|
1534
|
+
}): boolean;
|
|
1535
|
+
protected seatRecordFor(row: StaticManagedSlotRow): SeatRecord | undefined;
|
|
1536
|
+
protected adoptSeat(row: StaticManagedSlotRow, record: SeatRecord): Promise<string | undefined>;
|
|
1537
|
+
protected restartSupervisedSeat(row: StaticManagedSlotRow, record: SeatRecord): Promise<string | undefined>;
|
|
1538
|
+
protected reapOrphanSeat(a: {
|
|
1539
|
+
name: string;
|
|
1540
|
+
runtime?: RuntimeReference;
|
|
1541
|
+
}): Promise<void>;
|
|
1542
|
+
protected driveStaticRetirement(a: TeardownTarget, surfaceFailure?: boolean, onDeprovision?: (accounting: DeprovisionResourceAccounting) => void): Promise<void>;
|
|
1543
|
+
protected openStaticChatSession(raw: unknown): Promise<{
|
|
1544
|
+
alias: string;
|
|
1545
|
+
actor: string;
|
|
1546
|
+
lifecycleUid: string;
|
|
1547
|
+
expiresAt: number;
|
|
1548
|
+
sealer: string;
|
|
1549
|
+
sealed: string;
|
|
1550
|
+
}>;
|
|
1551
|
+
protected retireStaticChatSession(raw: unknown): Promise<{
|
|
1552
|
+
outcome: "retired" | "alreadyRetired" | "failed";
|
|
1553
|
+
reason?: string;
|
|
1554
|
+
}>;
|
|
1360
1555
|
private retireChatSessionsOnStop;
|
|
1361
1556
|
private reportChatSessionsLeftAtStop;
|
|
1362
|
-
|
|
1363
|
-
|
|
1557
|
+
protected renewManagedStaticCred(a: ManagedAgent): Promise<void>;
|
|
1558
|
+
protected readStaticReconcileSlot(alias: string): Promise<StaticManagedSlotRow | undefined>;
|
|
1364
1559
|
private awaitStaticReconcileDrain;
|
|
1365
|
-
|
|
1560
|
+
protected reconcileStaticLifecycles(postAdoption?: boolean): Promise<void>;
|
|
1366
1561
|
/** {@link SeatStop.lifecycleMembershipRefusal}. */
|
|
1367
|
-
|
|
1562
|
+
protected lifecycleMembershipRefusal(...args: Parameters<SeatStop["lifecycleMembershipRefusal"]>): ReturnType<SeatStop["lifecycleMembershipRefusal"]>;
|
|
1368
1563
|
/** {@link BrokerTransport.withProvisioner}. */
|
|
1369
|
-
|
|
1564
|
+
protected withProvisioner<T>(fn: (prov: CotalEndpoint) => Promise<T>): Promise<T>;
|
|
1370
1565
|
/** {@link BrokerTransport.withTransferReader}. */
|
|
1371
|
-
|
|
1566
|
+
protected withTransferReader<T>(fn: (nc: NatsConnection) => Promise<T>): Promise<T>;
|
|
1372
1567
|
/** {@link SeatStop.opPurge}. */
|
|
1373
|
-
|
|
1568
|
+
protected opPurge(...args: Parameters<SeatStop["opPurge"]>): ReturnType<SeatStop["opPurge"]>;
|
|
1374
1569
|
/** {@link PersonaCatalog.opDefinePersona}. */
|
|
1375
|
-
|
|
1570
|
+
protected opDefinePersona(...args: Parameters<PersonaCatalog["opDefinePersona"]>): ReturnType<PersonaCatalog["opDefinePersona"]>;
|
|
1376
1571
|
/** {@link PersonaCatalog.opRemovePersona}. */
|
|
1377
|
-
|
|
1572
|
+
protected opRemovePersona(...args: Parameters<PersonaCatalog["opRemovePersona"]>): ReturnType<PersonaCatalog["opRemovePersona"]>;
|
|
1378
1573
|
/** {@link PersonaCatalog.personaOwner}. */
|
|
1379
|
-
|
|
1574
|
+
protected personaOwner(...args: Parameters<PersonaCatalog["personaOwner"]>): ReturnType<PersonaCatalog["personaOwner"]>;
|
|
1380
1575
|
/** {@link PersonaCatalog.canReadPersona}. */
|
|
1381
|
-
|
|
1576
|
+
protected canReadPersona(...args: Parameters<PersonaCatalog["canReadPersona"]>): ReturnType<PersonaCatalog["canReadPersona"]>;
|
|
1382
1577
|
/** {@link PersonaCatalog.opListPersonas}. */
|
|
1383
|
-
|
|
1578
|
+
protected opListPersonas(...args: Parameters<PersonaCatalog["opListPersonas"]>): ReturnType<PersonaCatalog["opListPersonas"]>;
|
|
1384
1579
|
/** {@link PersonaCatalog.opShowPersona}. */
|
|
1385
|
-
|
|
1580
|
+
protected opShowPersona(...args: Parameters<PersonaCatalog["opShowPersona"]>): ReturnType<PersonaCatalog["opShowPersona"]>;
|
|
1386
1581
|
/** {@link TerminalInput.inputAuthorized}. */
|
|
1387
|
-
|
|
1582
|
+
protected inputAuthorized(...args: Parameters<TerminalInput["inputAuthorized"]>): ReturnType<TerminalInput["inputAuthorized"]>;
|
|
1388
1583
|
/** {@link TerminalInput.attachAuthorized}. */
|
|
1389
|
-
|
|
1584
|
+
protected attachAuthorized(...args: Parameters<TerminalInput["attachAuthorized"]>): ReturnType<TerminalInput["attachAuthorized"]>;
|
|
1390
1585
|
/** {@link TerminalInput.establishConsoleSession}. */
|
|
1391
1586
|
private establishConsoleSession;
|
|
1392
1587
|
/** {@link StatusAndModels.list}. */
|
|
1393
|
-
|
|
1588
|
+
protected list(...args: Parameters<StatusAndModels["list"]>): ReturnType<StatusAndModels["list"]>;
|
|
1394
1589
|
}
|
|
1395
1590
|
//# sourceMappingURL=manager.d.ts.map
|