Cotal TypeScript packages
    Preparing search index...

    Interface ManagerOptions

    interface ManagerOptions {
        attachHost?: string;
        consolePort?: number;
        endpointServeExecutorExpiresInSeconds?: number;
        eventPayloadsWithheld?: boolean;
        eventsRequired?: boolean;
        execution?: "runtime" | "none";
        expectedConnectorGeneration?: string;
        idleExit?: IdleExitOptions;
        installedExtensions?: boolean;
        machineSetupCommand?: string;
        maxSessions?: number;
        name?: string;
        onServiceIdentity?: (
            identity: ManagerServiceIdentity,
        ) => void | Promise<void>;
        pooled?: boolean;
        preserveStopTimeoutMs?: number;
        remoteAuthority?: {
            accountPublicKey?: string;
            actors: RemoteManagerActors;
            agentBearerExchangeUrl: string;
            authorizeAdmin: (
                caller: { actor: string; lifecycleUid: string; owner: string },
            ) => Promise<boolean>;
            authorizeParticipation?: (
                caller: { actor: string; lifecycleUid: string; owner: string },
            ) => Promise<boolean>;
            enrollManagedAgent?: (
                args: {
                    requestId?: string;
                    spawn?: { runId?: string; served: string };
                    target: {
                        actor: string;
                        allowPublish?: string[];
                        allowSubscribe?: string[];
                        capabilities?: string[];
                        label?: string;
                        role?: string;
                        subscribe?: string[];
                        tokenHash: string;
                    };
                },
            ) => Promise<
                {
                    actor: string;
                    agentBearerExchangeUrl: string;
                    allowPublish: string[];
                    allowSubscribe: string[];
                    lifecycleUid: string;
                    owner: string;
                    sentinelCreds: string;
                    subscribe: string[];
                },
            >;
            executeDelegatedUserIntent?: (
                execute: (
                    | {
                        operation: "launch";
                        target: { actor: string; tokenHash: string };
                    }
                    | {
                        operation: "retire";
                        target: { actor: string; lifecycleUid: string; owner: string };
                    }
                ) & { intentId: string },
            ) => Promise<RemoteDelegatedUserIntentExecutionResult>;
            executorCreds: string;
            goalWriterCreds: string;
            identities: {
                executor: Identity;
                goalWriter: Identity;
                serve: Identity;
                sessionLedger: Identity;
                supervisor: Identity;
            };
            instanceId: string;
            lifecycleUid: string;
            mintRetirementRequester: (
                args: {
                    identity: Identity;
                    opId: string;
                    serveEpoch: number;
                    target: { actor: string; lifecycleUid: string; owner: string };
                },
            ) => Promise<string>;
            mintSessionServing: (
                args: {
                    endpoint: string;
                    epoch: number;
                    exp: number;
                    identity: Identity;
                    sessionId: string;
                },
            ) => Promise<string>;
            mintTransferReader?: (identity: Identity) => Promise<string>;
            owner: string;
            prepareAgentRetirement: (
                args: {
                    opId: string;
                    target: { actor: string; lifecycleUid: string; owner: string };
                },
            ) => Promise<void>;
            renewExecutor: () => Promise<string>;
            renewStandingBundle?: (
                processEpoch: number,
            ) => Promise<
                {
                    executor: string;
                    goalWriter: string;
                    serve: string;
                    sessionLedger: string;
                    supervisor: string;
                },
            >;
            runHosting?: Pick<
                RunHostingContext,
                | "admitRun"
                | "issueAttempt"
                | "issueOperator"
                | "renewRun"
                | "submitRun"
                | "revokeRun"
                | "cancelRun",
            >;
            scanGoalIndex: () => Promise<GoalIndexEntry[]>;
            serveCreds: string;
            serveGrant: EpServeGrant;
            sessionLedgerCreds: string;
            supervisorCreds: string;
            validateRetainedAgent: (
                args: {
                    actor: string;
                    actorToken: string;
                    lifecycleUid: string;
                    owner: string;
                    sentinelCreds: string;
                },
            ) => Promise<RetainedAgentAuthority>;
        };
        resumeAttemptId?: string;
        resumeDurableCommitToken?: string;
        runtime?: string;
        seatCap?: SeatCap;
        secretStore?: SecretStore;
        servers?: string;
        space: string;
        workspaceRoot?: string;
        wsPort?: number;
    }
    Index
    attachHost?: string

    Bind address for the console endpoint, and the host it advertises in Manager.consoleUrl. Defaults to loopback, which keeps the console reachable only from this machine. Set it only if you intend to expose the console (see the security note on AttachEndpoint). A wildcard here binds every interface and still advertises loopback, since a wildcard is not an address a client can dial. The TERMINAL is unaffected either way: it rides the mesh session, not this face.

    consolePort?: number

    Port for the console + attach HTTP/WS endpoint. 0 → ephemeral.

    endpointServeExecutorExpiresInSeconds?: number

    Internal/test override for the endpoint registration executor lifetime.

    eventPayloadsWithheld?: boolean

    Trusted registration policy withholds tool payloads for every seat.

    eventsRequired?: boolean

    The selected registration requires every launched connector session to publish events.

    execution?: "runtime" | "none"

    Explicit seat/workflow execution capability. Omitted preserves runtime execution. none accepts genuine hosting user-auth authority or pooled remote authority, never both, and refuses any runtime. Local NONE requires a fresh or previously classified instance.

    expectedConnectorGeneration?: string

    Assert the embedding generation matches this Manager. Installed first-party connectors always use the Manager's captured generation, even when this assertion is omitted.

    idleExit?: IdleExitOptions

    Stop once the manager has been idle for afterMs: it holds no seat, no spawn or control call is in flight, it drives no hosted workflow run, and no preservation or resume is open. The clock starts when start() returns and restarts whenever any of those appears. Off when absent.

    installedExtensions?: boolean

    Resolve connectors from the installed cotal ext manifest (lazy import + live-remove honored), as the published binary does. A library composition leaves this off and resolves only what its composition root imported — a direct new Manager() never implicitly reads the machine manifest.

    machineSetupCommand?: string

    The machine daemon's command for repairing host setup. Absent outside daemon hosting.

    maxSessions?: number

    The global ceiling on concurrently live §13.6 sessions this manager will serve. Defaults to MAX_LIVE_SESSIONS_DEFAULT. Each session mints a credential and opens its own connection, and establishment is caller-triggered, so this is the process-level resource bound; exceeding it refuses resource-exhausted before either happens. Operator-set because the right number is deployment-shaped — the browser console holds one session per open pane, so size for agents × panes, not agent count. Set it with cotal supervise --max-sessions or cotal up --max-sessions (recorded on the mesh so a repair does not silently drop to 64). ManagerSessionPlaneDeps.maxSessions carries the per-caller-scoping residual.

    name?: string
    onServiceIdentity?: (identity: ManagerServiceIdentity) => void | Promise<void>

    Trusted embedding hook after native identity selection, before endpoint construction. It receives no key, credential or readiness claim. A rejection aborts this start.

    pooled?: boolean

    Hosted pooled control requires signerless authority and either an explicit non-custodial runtime or explicit execution: none. It never borrows local signing authority.

    preserveStopTimeoutMs?: number

    Internal/test override for the preservation child-exit deadline.

    remoteAuthority?: {
        accountPublicKey?: string;
        actors: RemoteManagerActors;
        agentBearerExchangeUrl: string;
        authorizeAdmin: (
            caller: { actor: string; lifecycleUid: string; owner: string },
        ) => Promise<boolean>;
        authorizeParticipation?: (
            caller: { actor: string; lifecycleUid: string; owner: string },
        ) => Promise<boolean>;
        enrollManagedAgent?: (
            args: {
                requestId?: string;
                spawn?: { runId?: string; served: string };
                target: {
                    actor: string;
                    allowPublish?: string[];
                    allowSubscribe?: string[];
                    capabilities?: string[];
                    label?: string;
                    role?: string;
                    subscribe?: string[];
                    tokenHash: string;
                };
            },
        ) => Promise<
            {
                actor: string;
                agentBearerExchangeUrl: string;
                allowPublish: string[];
                allowSubscribe: string[];
                lifecycleUid: string;
                owner: string;
                sentinelCreds: string;
                subscribe: string[];
            },
        >;
        executeDelegatedUserIntent?: (
            execute: (
                | {
                    operation: "launch";
                    target: { actor: string; tokenHash: string };
                }
                | {
                    operation: "retire";
                    target: { actor: string; lifecycleUid: string; owner: string };
                }
            ) & { intentId: string },
        ) => Promise<RemoteDelegatedUserIntentExecutionResult>;
        executorCreds: string;
        goalWriterCreds: string;
        identities: {
            executor: Identity;
            goalWriter: Identity;
            serve: Identity;
            sessionLedger: Identity;
            supervisor: Identity;
        };
        instanceId: string;
        lifecycleUid: string;
        mintRetirementRequester: (
            args: {
                identity: Identity;
                opId: string;
                serveEpoch: number;
                target: { actor: string; lifecycleUid: string; owner: string };
            },
        ) => Promise<string>;
        mintSessionServing: (
            args: {
                endpoint: string;
                epoch: number;
                exp: number;
                identity: Identity;
                sessionId: string;
            },
        ) => Promise<string>;
        mintTransferReader?: (identity: Identity) => Promise<string>;
        owner: string;
        prepareAgentRetirement: (
            args: {
                opId: string;
                target: { actor: string; lifecycleUid: string; owner: string };
            },
        ) => Promise<void>;
        renewExecutor: () => Promise<string>;
        renewStandingBundle?: (
            processEpoch: number,
        ) => Promise<
            {
                executor: string;
                goalWriter: string;
                serve: string;
                sessionLedger: string;
                supervisor: string;
            },
        >;
        runHosting?: Pick<
            RunHostingContext,
            | "admitRun"
            | "issueAttempt"
            | "issueOperator"
            | "renewRun"
            | "submitRun"
            | "revokeRun"
            | "cancelRun",
        >;
        scanGoalIndex: () => Promise<GoalIndexEntry[]>;
        serveCreds: string;
        serveGrant: EpServeGrant;
        sessionLedgerCreds: string;
        supervisorCreds: string;
        validateRetainedAgent: (
            args: {
                actor: string;
                actorToken: string;
                lifecycleUid: string;
                owner: string;
                sentinelCreds: string;
            },
        ) => Promise<RetainedAgentAuthority>;
    }

    Remote manager-service prepare material. The participant owns every private seed; the host returned only scoped JWTs. When present, local signer/static trust is forbidden and the manager follows the remote authority path.

    Type Declaration

    • OptionalaccountPublicKey?: string

      Immutable assigned data-account nkey. Pooled control never infers it from a slug.

    • actors: RemoteManagerActors
    • agentBearerExchangeUrl: string

      Pinned public auth-service base used by retained managed children for fresh bearers. The signerless Manager must select agent-bearer --exchange-url, never the local --dir arm.

    • authorizeAdmin: (
          caller: { actor: string; lifecycleUid: string; owner: string },
      ) => Promise<boolean>

      Fresh host-owned serve-time admin decision for a broker-authenticated caller tuple.

    • OptionalauthorizeParticipation?: (
          caller: { actor: string; lifecycleUid: string; owner: string },
      ) => Promise<boolean>

      Fresh host-owned participation decision for one exact personal caller lifecycle. The host verifies the current foreground grant and run scope. The manager still proves live exact presence before it issues its finite local lease.

    • OptionalenrollManagedAgent?: (
          args: {
              requestId?: string;
              spawn?: { runId?: string; served: string };
              target: {
                  actor: string;
                  allowPublish?: string[];
                  allowSubscribe?: string[];
                  capabilities?: string[];
                  label?: string;
                  role?: string;
                  subscribe?: string[];
                  tokenHash: string;
              };
          },
      ) => Promise<
          {
              actor: string;
              agentBearerExchangeUrl: string;
              allowPublish: string[];
              allowSubscribe: string[];
              lifecycleUid: string;
              owner: string;
              sentinelCreds: string;
              subscribe: string[];
          },
      >

      Host-owned enrollment of a FRESH managed agent (#1972). The participant generates the standing actorToken, writes it at 0600, and passes only its digest. The HOST picks the lifecycle UID — it alone can see the retirement tombstones that make a UID unusable — so there is deliberately no lifecycleUid input here, and the returned uid is what the spawn records. Absent on a composition with no hosted storage: a signerless manager then refuses a user-mode spawn rather than authoring a local grant the host knows nothing about.

    • OptionalexecuteDelegatedUserIntent?: (
          execute: (
              | { operation: "launch"; target: { actor: string; tokenHash: string } }
              | {
                  operation: "retire";
                  target: { actor: string; lifecycleUid: string; owner: string };
              }
          ) & { intentId: string },
      ) => Promise<RemoteDelegatedUserIntentExecutionResult>

      Host-owned execution of one admitted delegated user intent (SPEC 13.16). Absent: a delegated spawn and a delegated retirement are refused before any request.

    • executorCreds: string
    • goalWriterCreds: string
    • identities: {
          executor: Identity;
          goalWriter: Identity;
          serve: Identity;
          sessionLedger: Identity;
          supervisor: Identity;
      }
    • instanceId: string
    • lifecycleUid: string
    • mintRetirementRequester: (
          args: {
              identity: Identity;
              opId: string;
              serveEpoch: number;
              target: { actor: string; lifecycleUid: string; owner: string };
          },
      ) => Promise<string>
    • mintSessionServing: (
          args: {
              endpoint: string;
              epoch: number;
              exp: number;
              identity: Identity;
              sessionId: string;
          },
      ) => Promise<string>
    • OptionalmintTransferReader?: (identity: Identity) => Promise<string>

      One host-issued transfer reader over this instance's own transfer bucket, for one transcript-receive or sweep (docs/design/resume-transfer.md section 6). Absent: this manager refuses transcript-receive.

    • owner: string
    • prepareAgentRetirement: (
          args: {
              opId: string;
              target: { actor: string; lifecycleUid: string; owner: string };
          },
      ) => Promise<void>

      Host-owned prerequisite for terminal retirement. It revokes the managed grant and completes the host's resumable release/sweep while preserving this UID. Success means the terminal auth barrier may start; failure keeps the alias held and is retried with the same operation id.

    • renewExecutor: () => Promise<string>
    • OptionalrenewStandingBundle?: (
          processEpoch: number,
      ) => Promise<
          {
              executor: string;
              goalWriter: string;
              serve: string;
              sessionLedger: string;
              supervisor: string;
          },
      >

      Host-issued, fully staged five-identity family. The callback validates response echoes before returning, and the manager preflights all five before adopting any.

    • OptionalrunHosting?: Pick<
          RunHostingContext,
          | "admitRun"
          | "issueAttempt"
          | "issueOperator"
          | "renewRun"
          | "submitRun"
          | "revokeRun"
          | "cancelRun",
      >

      The closed host run callbacks. Workflow runs are hosted only when ALL are supplied; a partial set refuses at construction, and absent means run-start/resume stay unavailable.

    • scanGoalIndex: () => Promise<GoalIndexEntry[]>

      Host-owned boot enumeration. It returns parsed, owner-scoped manager goal-index entries and never hands the participant records-stream consumer authority.

    • serveCreds: string
    • serveGrant: EpServeGrant
    • sessionLedgerCreds: string
    • supervisorCreds: string
    • validateRetainedAgent: (
          args: {
              actor: string;
              actorToken: string;
              lifecycleUid: string;
              owner: string;
              sentinelCreds: string;
          },
      ) => Promise<RetainedAgentAuthority>

      Host-owned continuity check for a retained managed actor. A signerless participant cannot validate the actor token or sentinel from public material alone, and must never receive the provider's issuer/callout private records. Hosted compositions keep those records host-side and return only the non-secret current authority shape.

    resumeAttemptId?: string

    Restore attempt this fresh manager will accept for the admin resumePreserved control op.

    resumeDurableCommitToken?: string

    Fsynced coordinator evidence recovered after commit but before finalize.

    runtime?: string

    Spawn backend. auto (default) → pty; external runtimes are explicit-only.

    seatCap?: SeatCap

    The ceiling on live seats this manager supervises for ONE owner. Defaults to DEFAULT_SEAT_CAP, under which MAX_AGENTS stays the only bound, so a single-owner mesh keeps every slot it had. An operator hosting several owners on one manager sets a number with cotal supervise --seat-cap <n>, so one owner cannot take the whole host; the value is recorded for the root, so a restart keeps it. A launch over the ceiling refuses resource-exhausted before the reserve, carrying the owner's count and the cap.

    It is deliberately NOT the global ceiling in another spelling: MAX_AGENTS bounds the host, this bounds one tenant's share of it, and the two refusals name different remedies.

    secretStore?: SecretStore

    The SecretStore for EVERY secret this manager touches — the daemon-cred renewal write side (remintDaemonCreds) AND the per-agent standing-secret kinds (static creds / actor tokens / sentinel creds). ONE store, so a hosted composition (KMS/Vault) can never end up with the manager re-signing daemon creds into one store while it reads/writes agent creds through another (split authority). Defaults to the workstation FS store over workspaceRoot, so a local cotal up is unchanged. It must be the SAME store the delivery daemon reads (runDelivery(args, store)). start() and every later remint challenge the daemon's reloadStoreIdentity and refuse naming both stores when they diverge. No bound daemon is not a named store, so start proceeds and remint writes this store; a later daemon on a foreign store is refused on the next remint rather than certified by the earlier absence. A hung rail (request timeout) fails closed. An injected store declares its identity, or both processes set COTAL_SECRET_STORE to the same coordinate.

    servers?: string
    space: string
    workspaceRoot?: string
    wsPort?: number

    The broker's WebSocket listener port (loopback), allocated by cotal up. When set, the console page becomes a mesh §13.6 session client — POST /session/<name> returns the grant + a per-session cred + this ws URL. Absent ⇒ no console session client (the route 503s).