@axiom-lattice/core 6.3.3 → 6.4.1

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/index.d.mts CHANGED
@@ -8,7 +8,7 @@ import { BaseLanguageModelInput, LanguageModelLike } from '@langchain/core/langu
8
8
  import { CallbackManagerForLLMRun } from '@langchain/core/callbacks/manager';
9
9
  import { ChatResult } from '@langchain/core/outputs';
10
10
  import * as _axiom_lattice_protocols from '@axiom-lattice/protocols';
11
- import { LLMConfig, SemanticMetricsServerConfig, MetricMeta, MetricQueryResult, DataSource, SemanticMetricsQueryRequest, SemanticMetricsQueryResponse, TableQueryRequest, TableQueryResponse, ExecuteSqlQueryRequest, ExecuteSqlQueryResponse, MetricsServerType, MetricsServerConfig, ToolConfig, ToolExecutor, AgentConfig, MiddlewareType, GraphBuildOptions, DeepAgentConfig, MessageChunk, MessageChunkType, QueueLatticeProtocol, QueueConfig, QueueClient, QueueResult, ScheduleLatticeProtocol, ScheduleConfig, ScheduleClient, ScheduleStorage, TaskHandler, ScheduleOnceOptions, ScheduleCronOptions, ScheduledTaskDefinition, ScheduledTaskStatus, ScheduleExecutionType, TrustedRunContext, QueuedExecutionMode, ThreadStore, AssistantStore, SkillStore, CollectionStore, WorkspaceStore, ProjectStore, DatabaseConfigStore, MetricsServerConfigStore, McpServerConfigStore, ModelProviderStore, UserStore, TenantStore, UserTenantLinkStore, WorkflowTrackingStore, EvalStore, ChannelInstallationStore, BindingRegistry, MenuRegistry, A2AApiKeyStore, OpenAuditStore, TaskStore, SharedResourceStore, ConnectionStore, TaskWorkItemStore, AgentWebAppStore, CapabilityBundleStore, ProjectRoomStore, ProjectMembershipStore, ProjectBotMembershipStore, ProjectRoomMessageStore, ProjectRoomReadStateStore, UserPushSubscriptionStore, LeaseStore, OutboxStore, VectorStoreProvider, Thread, CreateThreadRequest, Assistant, CreateAssistantRequest, AgentWebApp, CreateAgentWebAppInput, AgentWebAppStorePatch, AgentWebAppUpdateOptions, Project, CreateProjectRequest, UpdateProjectRequest, UpdateProjectCapabilityBundlesResult, CapabilityBundle, InternalCreateCapabilityBundleInput, InternalUpdateCapabilityBundleInput, CapabilityBundleDeleteResult, Skill, CreateSkillRequest, SkillStoreContext, DatabaseConfigEntry, CreateDatabaseConfigRequest, UpdateDatabaseConfigRequest, ModelProviderEntry, CreateModelProviderRequest, UpdateModelProviderRequest, ModelProviderStatus, ModelProviderModelEntry, ProviderModelInput, User, CreateUserRequest, UpdateUserRequest, Tenant, CreateTenantRequest, UpdateTenantRequest, UserTenantLink, CreateUserTenantLinkRequest, UpdateUserTenantLinkRequest, ChannelInstallation, ChannelInstallationType, CreateChannelInstallationInput, UpdateChannelInstallationRequest, Binding, CreateBindingInput, BindingMutablePatch, BindingListParams, A2AApiKeyRecord, CreateA2AApiKeyInput, UpdateA2AApiKeyInput, A2AApiKeyEntry, OpenAuditAppendInput, OpenAuditQuery, OpenAuditRecord, TaskMutationSnapshot, CreateTaskRequest, TaskItem, TaskListFilter, TaskDependentListQuery, UpdateTaskRequest, CreateWorkItemRequest, TaskWorkItem, CreateWorkItemIfAbsentRequest, TaskWorkItemListFilter, ProjectLifecycleEventQuery, Collection, CreateCollectionRequest, UpdateCollectionRequest, MenuItem, CreateMenuItemInput, UpdateMenuItemInput, ProjectRoom, ProjectMembership, ProjectBotMembership, ProjectRoomMessage, ProjectHumanRole, ProjectMembershipMutationResult, ProjectRoomReadState, UserPushSubscription, LeaseRecord, OutboxEvent, STTModelLatticeProtocol, STTConfig, STTClient, TranscriptionResult, LoggerLatticeProtocol, LoggerConfig, LoggerClient, LoggerContext, SkillConfig, SkillClient, PluginSkillDefinition, McpTool, McpUiResourcePayload, McpServerConfig, McpUiRef, ResourceResolver, ResourceAddress, ShareVisibility, OpenGrant, CreateShareRequest, ChannelAdapter, InterruptPolicy, ProjectTaskLifecycleAction, TaskBeliefState, PluginMeta, Plugin, PluginMetaOutput, SandboxPluginManifest, SandboxPluginToolDef, SandboxPluginDiagnostic, CapabilityPreview, CreateCapabilityBundleInput, UpdateCapabilityBundleInput, InternalStateField, InternalInput, InternalNode, InternalAgentNode, InternalMapNode, InternalDSL, ConnectionEntry } from '@axiom-lattice/protocols';
11
+ import { LLMConfig, SemanticMetricsServerConfig, MetricMeta, MetricQueryResult, DataSource, SemanticMetricsQueryRequest, SemanticMetricsQueryResponse, TableQueryRequest, TableQueryResponse, ExecuteSqlQueryRequest, ExecuteSqlQueryResponse, MetricsServerType, MetricsServerConfig, ToolConfig, ToolExecutor, AgentConfig, MiddlewareType, GraphBuildOptions, DeepAgentConfig, MessageChunk, MessageChunkType, QueueLatticeProtocol, QueueConfig, QueueClient, QueueResult, ScheduleLatticeProtocol, ScheduleConfig, ScheduleClient, ScheduleStorage, TaskHandler, ScheduleOnceOptions, ScheduleCronOptions, ScheduledTaskDefinition, ScheduledTaskStatus, ScheduleExecutionType, TrustedRunContext, QueuedExecutionMode, ThreadStore, AssistantStore, SkillStore, CollectionStore, WorkspaceStore, ProjectStore, DatabaseConfigStore, MetricsServerConfigStore, McpServerConfigStore, ModelProviderStore, UserStore, TenantStore, UserTenantLinkStore, WorkflowTrackingStore, EvalStore, ChannelInstallationStore, BindingRegistry, MenuRegistry, A2AApiKeyStore, OpenAuditStore, TaskStore, SharedResourceStore, ConnectionStore, TaskWorkItemStore, AgentWebAppStore, CapabilityBundleStore, ProjectRoomStore, ProjectMembershipStore, ProjectBotMembershipStore, ProjectRoomMessageStore, ProjectRoomReadStateStore, UserPushSubscriptionStore, LeaseStore, OutboxStore, PluginDeploymentStore, VectorStoreProvider, Thread, CreateThreadRequest, Assistant, CreateAssistantRequest, AgentWebApp, CreateAgentWebAppInput, AgentWebAppStorePatch, AgentWebAppUpdateOptions, Project, CreateProjectRequest, UpdateProjectRequest, UpdateProjectCapabilityBundlesResult, CapabilityBundle, InternalCreateCapabilityBundleInput, InternalUpdateCapabilityBundleInput, CapabilityBundleDeleteResult, Skill, CreateSkillRequest, SkillStoreContext, DatabaseConfigEntry, CreateDatabaseConfigRequest, UpdateDatabaseConfigRequest, ModelProviderEntry, CreateModelProviderRequest, UpdateModelProviderRequest, ModelProviderStatus, ModelProviderModelEntry, ProviderModelInput, User, CreateUserRequest, UpdateUserRequest, Tenant, CreateTenantRequest, UpdateTenantRequest, UserTenantLink, CreateUserTenantLinkRequest, UpdateUserTenantLinkRequest, ChannelInstallation, ChannelInstallationType, CreateChannelInstallationInput, UpdateChannelInstallationRequest, Binding, CreateBindingInput, BindingMutablePatch, BindingListParams, A2AApiKeyRecord, CreateA2AApiKeyInput, UpdateA2AApiKeyInput, A2AApiKeyEntry, OpenAuditAppendInput, OpenAuditQuery, OpenAuditRecord, TaskMutationSnapshot, CreateTaskRequest, TaskItem, TaskListFilter, TaskDependentListQuery, UpdateTaskRequest, CreateWorkItemRequest, TaskWorkItem, CreateWorkItemIfAbsentRequest, TaskWorkItemListFilter, ProjectLifecycleEventQuery, Collection, CreateCollectionRequest, UpdateCollectionRequest, MenuItem, CreateMenuItemInput, UpdateMenuItemInput, ProjectRoom, ProjectMembership, ProjectBotMembership, ProjectRoomMessage, ProjectHumanRole, ProjectMembershipMutationResult, ProjectRoomReadState, UserPushSubscription, LeaseRecord, OutboxEvent, STTModelLatticeProtocol, STTConfig, STTClient, TranscriptionResult, LoggerLatticeProtocol, LoggerConfig, LoggerClient, LoggerContext, SkillConfig, SkillClient, PluginSkillDefinition, McpTool, McpUiResourcePayload, McpServerConfig, McpUiRef, ResourceResolver, ResourceAddress, ShareVisibility, OpenGrant, CreateShareRequest, ChannelAdapter, InterruptPolicy, ProjectTaskLifecycleAction, TaskBeliefState, PluginMeta, Plugin, PluginMetaOutput, SandboxPluginManifest, SandboxPluginToolDef, SandboxPluginDiagnostic, CapabilityPreview, CreateCapabilityBundleInput, UpdateCapabilityBundleInput, InternalStateField, InternalInput, InternalNode, InternalAgentNode, InternalMapNode, InternalDSL, ConnectionEntry } from '@axiom-lattice/protocols';
12
12
  export { _axiom_lattice_protocols as Protocols };
13
13
  export { AgentConfig, AgentType, GraphBuildOptions, MemoryType, ProjectRoomTrustedRunContext, QueuedExecutionMode, TrustedRunContext, parseQueuedExecutionMode, parseTrustedRunContext } from '@axiom-lattice/protocols';
14
14
  import * as langchain from 'langchain';
@@ -1665,6 +1665,24 @@ interface SandboxInstance {
1665
1665
  stop(): Promise<void>;
1666
1666
  kill(): Promise<void>;
1667
1667
  getStatus(): Promise<"running" | "stopped" | "unknown">;
1668
+ /**
1669
+ * Resolve a routable endpoint for a guest port published at create time.
1670
+ *
1671
+ * Implementations may omit this capability; callers treat a missing
1672
+ * implementation as "this backend does not support resident services".
1673
+ *
1674
+ * The returned `endpoint` is a scheme-less route the caller composes with
1675
+ * its configured sandbox-service base URL. Backends with a proxy return a
1676
+ * relative proxy path (e.g. `/api/sandboxes/<name>/proxy/<port>`); others
1677
+ * may return a scheme-less `host:port`. See spec §9.4.
1678
+ *
1679
+ * @param port - Guest port that was published via `RunSandboxConfig.exposePorts`
1680
+ * @returns The endpoint route and any headers required to reach it
1681
+ */
1682
+ getEndpoint?(port: number): Promise<{
1683
+ endpoint: string;
1684
+ headers?: Record<string, string>;
1685
+ }>;
1668
1686
  readonly file: SandboxFileService;
1669
1687
  readonly shell: SandboxShellService;
1670
1688
  /**
@@ -1706,6 +1724,14 @@ interface RunSandboxConfig {
1706
1724
  projectId?: string;
1707
1725
  vmIsolation?: SandboxIsolationLevel;
1708
1726
  volumes?: Record<string, SandboxVolumeDefinition>;
1727
+ /** Main process command replacing the runtime default; used for resident services. */
1728
+ entrypoint?: string[];
1729
+ /** Absolute sandbox lifetime in seconds; `null` means no expiry. */
1730
+ timeoutSeconds?: number | null;
1731
+ /** Guest ports to publish so they can be resolved via `SandboxInstance.getEndpoint`. */
1732
+ exposePorts?: number[];
1733
+ /** Optional per-sandbox image override (defaults to the provider config). */
1734
+ image?: string;
1709
1735
  }
1710
1736
  interface SandboxManagerProtocol {
1711
1737
  resolvePolicy(config: RunSandboxConfig): {
@@ -3066,6 +3092,7 @@ type StoreTypeMap = {
3066
3092
  userPushSubscription: UserPushSubscriptionStore;
3067
3093
  lease: LeaseStore;
3068
3094
  outbox: OutboxStore;
3095
+ pluginDeployment: PluginDeploymentStore;
3069
3096
  };
3070
3097
  /**
3071
3098
  * Store type keys
@@ -6201,6 +6228,12 @@ interface EnsureMicrosandboxInput {
6201
6228
  memoryMib?: number;
6202
6229
  env?: Record<string, string>;
6203
6230
  volumes?: Record<string, SandboxVolumeDefinition>;
6231
+ /** Main process command; replaces the runtime default. */
6232
+ entrypoint?: string[];
6233
+ /** Absolute lifetime in seconds; `null` means no expiry. */
6234
+ timeoutSeconds?: number | null;
6235
+ /** Guest ports to publish. */
6236
+ exposePorts?: number[];
6204
6237
  }
6205
6238
  interface MicrosandboxShellExecInput {
6206
6239
  sandboxName: string;
@@ -6222,6 +6255,17 @@ declare class MicrosandboxServiceClient {
6222
6255
  killSandbox(name: string): Promise<SandboxLifecycleResponse>;
6223
6256
  deleteSandbox(name: string): Promise<SandboxLifecycleResponse>;
6224
6257
  getStatus(name: string): Promise<SandboxLifecycleResponse>;
6258
+ /**
6259
+ * Resolve the endpoint for a published guest port of a sandbox.
6260
+ *
6261
+ * @param name - Sandbox name
6262
+ * @param port - Guest port published via `ensureSandbox({ exposePorts })`
6263
+ * @returns The scheme-less endpoint string and optional headers
6264
+ */
6265
+ getEndpoint(name: string, port: number): Promise<{
6266
+ endpoint: string;
6267
+ headers?: Record<string, string>;
6268
+ }>;
6225
6269
  readFile(sandboxName: string, path: string): Promise<ReadFileResponse>;
6226
6270
  writeFile(sandboxName: string, path: string, content: string): Promise<WriteFileResponse>;
6227
6271
  deleteFile(sandboxName: string, path: string): Promise<WriteFileResponse>;
@@ -6258,7 +6302,7 @@ declare function createResourceAddress(config: {
6258
6302
  resourcePath: string;
6259
6303
  }): ResourceAddress;
6260
6304
 
6261
- type MicrosandboxRemoteProviderClient = Pick<MicrosandboxServiceClient, "ensureSandbox" | "startSandbox" | "stopSandbox" | "killSandbox" | "deleteSandbox" | "getStatus" | "readFile" | "writeFile" | "deleteFile" | "listPath" | "findFiles" | "searchInFile" | "replaceInFile" | "uploadFile" | "downloadFile" | "execCommand" | "volumeFsRead" | "volumeFsWrite" | "volumeFsDelete" | "volumeFsList" | "volumeFsDownload" | "volumeFsUpload" | "volumeFsCreateDirectory">;
6305
+ type MicrosandboxRemoteProviderClient = Pick<MicrosandboxServiceClient, "ensureSandbox" | "startSandbox" | "stopSandbox" | "killSandbox" | "deleteSandbox" | "getStatus" | "getEndpoint" | "readFile" | "writeFile" | "deleteFile" | "listPath" | "findFiles" | "searchInFile" | "replaceInFile" | "uploadFile" | "downloadFile" | "execCommand" | "volumeFsRead" | "volumeFsWrite" | "volumeFsDelete" | "volumeFsList" | "volumeFsDownload" | "volumeFsUpload" | "volumeFsCreateDirectory">;
6262
6306
  interface MicrosandboxRemoteProviderConfig extends MicrosandboxServiceClientConfig {
6263
6307
  client?: MicrosandboxRemoteProviderClient;
6264
6308
  image?: string;
@@ -6536,6 +6580,10 @@ declare class MicrosandboxRemoteInstance implements SandboxInstance {
6536
6580
  stop(): Promise<void>;
6537
6581
  kill(): Promise<void>;
6538
6582
  getStatus(): Promise<"running" | "stopped" | "unknown">;
6583
+ getEndpoint(port: number): Promise<{
6584
+ endpoint: string;
6585
+ headers?: Record<string, string>;
6586
+ }>;
6539
6587
  /**
6540
6588
  * Pack a sandbox folder into a sibling ZIP through the microsandbox shell.
6541
6589
  *
@@ -7021,6 +7069,98 @@ interface ConnectAllChannelsOptions {
7021
7069
  deps?: unknown;
7022
7070
  }
7023
7071
  declare function connectAllChannels(getAdapter: (channel: string) => ChannelAdapter | undefined, options?: ConnectAllChannelsOptions): Promise<void>;
7072
+ /**
7073
+ * Disconnect every enabled channel installation for all tenants.
7074
+ *
7075
+ * Symmetric with {@link connectAllChannels}: used by the single-owner channel
7076
+ * leader when it loses the connection lease.
7077
+ *
7078
+ * Teardown is best-effort: a failure from one adapter is logged and does not
7079
+ * prevent the remaining installations from being disconnected.
7080
+ *
7081
+ * @param getAdapter Resolves the adapter for a channel name.
7082
+ * @returns Resolves once every enabled installation has been attempted.
7083
+ */
7084
+ declare function disconnectAllChannels(getAdapter: (channel: string) => ChannelAdapter | undefined): Promise<void>;
7085
+
7086
+ /** Dependencies for {@link ChannelConnectionLeader}. */
7087
+ interface ChannelConnectionLeaderDeps {
7088
+ /** Shared lease store (PostgreSQL in multi-replica deployments). */
7089
+ leaseStore: LeaseStore;
7090
+ /** Stable this-replica id (e.g. `getReplicaId()`). */
7091
+ owner: string;
7092
+ /** Establish all enabled channel connections. */
7093
+ connect: () => Promise<void>;
7094
+ /** Tear down all channel connections. */
7095
+ disconnect: () => Promise<void>;
7096
+ /** Lease TTL in ms (default 60_000). */
7097
+ ttlMs?: number;
7098
+ /** Retry/health interval in ms (default max(5_000, floor(ttlMs / 3))). */
7099
+ retryMs?: number;
7100
+ /** Optional structured logger for recoverable failures. */
7101
+ log?: {
7102
+ warn(message: string, context: Record<string, unknown>): void;
7103
+ };
7104
+ }
7105
+ /**
7106
+ * Long-lived single-owner gate for persistent channel connections.
7107
+ *
7108
+ * @remarks
7109
+ * - Holds `leader:channel-connections` for as long as the process can renew it;
7110
+ * only the holder calls `connect()`.
7111
+ * - If the holder crashes, its lease lapses after `ttlMs` and another replica's
7112
+ * next tick acquires it and connects (bounded failover window).
7113
+ * - A holder that loses the lease disconnects on its next tick.
7114
+ * - With an in-memory lease store the single process wins (single-process
7115
+ * behavior is unchanged).
7116
+ *
7117
+ * @example
7118
+ * ```ts
7119
+ * const leader = new ChannelConnectionLeader({ leaseStore, owner, connect, disconnect });
7120
+ * leader.start();
7121
+ * app.addHook("onClose", () => leader.stop());
7122
+ * ```
7123
+ */
7124
+ declare class ChannelConnectionLeader {
7125
+ private readonly deps;
7126
+ private readonly ttlMs;
7127
+ private readonly retryMs;
7128
+ private holder;
7129
+ private connected;
7130
+ private attempted;
7131
+ private inFlight;
7132
+ private timer;
7133
+ private running;
7134
+ private stopped;
7135
+ constructor(deps: ChannelConnectionLeaderDeps);
7136
+ /** Starts the ownership loop (immediate tick, then every `retryMs`). */
7137
+ start(): void;
7138
+ /**
7139
+ * Releases ownership (if held) and disconnects.
7140
+ *
7141
+ * @returns A promise that settles after teardown completes.
7142
+ * @remarks Terminal: a stopped leader does not restart.
7143
+ */
7144
+ stop(): Promise<void>;
7145
+ /**
7146
+ * Runs one ownership/health step. Public for deterministic tests.
7147
+ *
7148
+ * @returns A promise that settles when this step completes.
7149
+ */
7150
+ tickOnce(): Promise<void>;
7151
+ /**
7152
+ * Performs one acquire/renew/step decision.
7153
+ *
7154
+ * @remarks A transient lease-store error while renewing keeps the current
7155
+ * holder and connections intact (retry next tick); only a confirmed
7156
+ * `renewed === false` triggers teardown.
7157
+ */
7158
+ private runTick;
7159
+ private tryAcquire;
7160
+ private loseLeadership;
7161
+ private connectChannels;
7162
+ private disconnectChannels;
7163
+ }
7024
7164
 
7025
7165
  /**
7026
7166
  * Sets the global {@link BindingRegistry} instance used by the channel message router.
@@ -9069,6 +9209,8 @@ interface ProjectMutationScope {
9069
9209
  declare class ProjectMutationMutex {
9070
9210
  private readonly queues;
9071
9211
  private readonly active;
9212
+ /** Project keys already held by the current async context (reentrancy). */
9213
+ private readonly held;
9072
9214
  /** Runs one mutation after all earlier mutations for the same Tenant and Project. */
9073
9215
  runExclusive<T>(scope: ProjectMutationScope, operation: () => Promise<T>, signal?: AbortSignal): Promise<T>;
9074
9216
  /** Returns the number of operations queued behind the current holder. */
@@ -9777,6 +9919,13 @@ interface RoomAgentInterruptInput {
9777
9919
  sourceRoomMessageId: string;
9778
9920
  inputMessageId: string;
9779
9921
  }
9922
+ /** Source-less HITL interrupt input whose scope is derived from the validated durable membership. */
9923
+ interface RoomAgentCorrelatedInterruptInput {
9924
+ tenantId: string;
9925
+ membershipId: string;
9926
+ correlationKey: string;
9927
+ text: string;
9928
+ }
9780
9929
  /**
9781
9930
  * Observes a canonical Agent-authored room message after durable persistence.
9782
9931
  *
@@ -9841,6 +9990,16 @@ declare class RoomAgentMessageService {
9841
9990
  * @returns A deep clone of the canonical idempotent room message.
9842
9991
  */
9843
9992
  postInterrupt(input: RoomAgentInterruptInput): Promise<ProjectRoomMessage>;
9993
+ /**
9994
+ * Persists a correlated HITL interrupt that has no human source message.
9995
+ *
9996
+ * @param input Explicit tenant, active membership, caller-supplied correlation key, and text.
9997
+ * @returns A deep clone of the canonical idempotent room message.
9998
+ * @remarks Business-agnostic: the caller owns the correlation key. Scope is
9999
+ * validated against the durable membership; no source message is required.
10000
+ */
10001
+ postCorrelatedInterrupt(input: RoomAgentCorrelatedInterruptInput): Promise<ProjectRoomMessage>;
10002
+ private persistScoped;
9844
10003
  private persistDerived;
9845
10004
  private persist;
9846
10005
  private notifyCommitted;
@@ -11828,6 +11987,80 @@ type GetSandboxFromConfig = (config: RunSandboxConfig) => Promise<SandboxInstanc
11828
11987
  */
11829
11988
  declare function createSandboxResolver(getSandboxFromConfig: GetSandboxFromConfig): SandboxResolver;
11830
11989
 
11990
+ /**
11991
+ * A deployment record consulted for resident routing.
11992
+ *
11993
+ * Structurally satisfied by `PluginDeployment` from `@axiom-lattice/protocols`;
11994
+ * kept minimal so the executor does not depend on the full store contract.
11995
+ */
11996
+ interface ResidentDeployment {
11997
+ /**
11998
+ * Lifecycle status. `"running"` routes directly; a non-running `onDemand`
11999
+ * deployment is resumed once before routing (spec §7.1).
12000
+ */
12001
+ status: string;
12002
+ /** Relative proxy path composed with {@link ResidentRoutingDeps.baseUrl}. */
12003
+ endpoint?: string;
12004
+ /**
12005
+ * Lifecycle strategy. `"onDemand"` enables resume-on-call for a non-running
12006
+ * deployment (and a resume plus a single retry after a failed running call);
12007
+ * `"alwaysOn"` never wakes on call.
12008
+ */
12009
+ mode: string;
12010
+ }
12011
+ /**
12012
+ * Optional dependencies enabling resident-service routing for published plugins.
12013
+ *
12014
+ * When configured, {@link SandboxPluginExecutor.invoke} looks up a deployment
12015
+ * for the invocation's `(tenantId, pluginType)`. A `running` deployment with an
12016
+ * endpoint is invoked over HTTP; a paused/stopped `onDemand` deployment is
12017
+ * resumed via {@link ResidentRoutingDeps.ensureRunning} then invoked (spec
12018
+ * §7.1). Any resident failure degrades to the short-process path by default, so
12019
+ * routing never introduces a new failure mode.
12020
+ *
12021
+ * @remarks
12022
+ * - No host token is used. The optional `serviceKey` is sent to the
12023
+ * sandbox-service proxy as `Authorization: Bearer <serviceKey>`.
12024
+ * - The resident payload forwards `input`, `context`, `connection`,
12025
+ * `connections`, and `timeoutMs`. `timeoutMs` is carried to the host in the
12026
+ * `/invoke` body **and** used as the client-side `AbortController` timeout, so
12027
+ * the host handler timeout and the client abort stay in parity; the
12028
+ * `maxResultBytes` cap is still applied client-side.
12029
+ * - The short-process-only sandbox open-credential env is not injected on the
12030
+ * resident path: the resident host process owns that environment, not the
12031
+ * per-call executor.
12032
+ */
12033
+ interface ResidentRoutingDeps {
12034
+ /**
12035
+ * Resolve the deployment record for a plugin.
12036
+ *
12037
+ * @param tenantId - Tenant owning the plugin.
12038
+ * @param pluginType - Plugin type addressed by the invocation.
12039
+ * @returns The deployment, or undefined when the plugin is not published.
12040
+ */
12041
+ getDeployment(tenantId: string, pluginType: string): Promise<ResidentDeployment | undefined>;
12042
+ /**
12043
+ * Optional single-flight resume/cold-start hook, attempted once after an
12044
+ * `onDemand` resident invocation fails.
12045
+ *
12046
+ * @param tenantId - Tenant owning the plugin.
12047
+ * @param pluginType - Plugin type addressed by the invocation.
12048
+ */
12049
+ ensureRunning?(tenantId: string, pluginType: string): Promise<void>;
12050
+ /** Sandbox-service base URL (`MICROSANDBOX_SERVICE_BASE_URL`). */
12051
+ baseUrl: string;
12052
+ /** Sandbox-service API key, sent as `Authorization: Bearer` when present. */
12053
+ serviceKey?: string;
12054
+ /** Injectable fetch implementation (defaults to the global `fetch`). */
12055
+ fetchImpl?: typeof fetch;
12056
+ /**
12057
+ * Fall back to the short-process path when the resident call fails.
12058
+ *
12059
+ * Defaults to `true`. When `false`, a resident failure is returned as a
12060
+ * non-ok {@link SandboxPluginResult} instead.
12061
+ */
12062
+ degradeToShortProcess?: boolean;
12063
+ }
11831
12064
  /** Dependencies required to resolve a tenant sandbox for plugin execution. */
11832
12065
  interface SandboxPluginExecutorDeps {
11833
12066
  /** Resolves the sandbox instance that hosts the tenant plugin. */
@@ -11836,6 +12069,11 @@ interface SandboxPluginExecutorDeps {
11836
12069
  logger?: {
11837
12070
  info: (fields: Record<string, unknown>, message?: string) => void;
11838
12071
  };
12072
+ /**
12073
+ * Optional resident-service routing. When absent, every invocation uses the
12074
+ * short-process `node <handler>` path (unchanged legacy behavior).
12075
+ */
12076
+ resident?: ResidentRoutingDeps;
11839
12077
  }
11840
12078
  /** Arguments for a single sandbox plugin handler invocation. */
11841
12079
  interface SandboxPluginInvokeArgs {
@@ -11872,8 +12110,18 @@ interface SandboxPluginResult {
11872
12110
  result?: unknown;
11873
12111
  /** Error message when `ok` is false. */
11874
12112
  error?: string;
11875
- /** Process exit code returned by the sandbox shell. */
12113
+ /**
12114
+ * Normalized process-like exit code: `0` on success, `1` on failure.
12115
+ *
12116
+ * On the resident path this is normalized from the handler outcome rather
12117
+ * than carrying the upstream HTTP status (see {@link httpStatus}).
12118
+ */
11876
12119
  exitCode: number;
12120
+ /**
12121
+ * Upstream HTTP status from the resident host, present only when the resident
12122
+ * path produced a response. The short-process path leaves this undefined.
12123
+ */
12124
+ httpStatus?: number;
11877
12125
  /** Wall-clock duration of the invocation in milliseconds. */
11878
12126
  durationMs: number;
11879
12127
  /** Raw stdout captured from the handler. */
@@ -11881,6 +12129,22 @@ interface SandboxPluginResult {
11881
12129
  /** Raw stderr captured from the handler (currently always empty). */
11882
12130
  stderr: string;
11883
12131
  }
12132
+ /**
12133
+ * Normalize a successful handler outcome into the text surfaced as the tool
12134
+ * result (and the MCP App `ui/notifications/tool-result` payload).
12135
+ *
12136
+ * Handlers must emit `{ ok: true, result: <payload> }`. When a handler reports
12137
+ * success but omits `result` (a contract violation), fall back to the raw
12138
+ * stdout so the data stays visible instead of collapsing to the string
12139
+ * `"null"` (which hides the mistake behind a valid-looking result).
12140
+ *
12141
+ * @param result - Normalized handler outcome.
12142
+ * @returns The text to surface to the caller / MCP App View.
12143
+ */
12144
+ declare function handlerResultText(result: {
12145
+ result?: unknown;
12146
+ stdout?: string;
12147
+ }): string;
11884
12148
  /**
11885
12149
  * Executes tenant sandbox plugin handlers via the tenant sandbox shell.
11886
12150
  *
@@ -11889,15 +12153,105 @@ interface SandboxPluginResult {
11889
12153
  * written to `connection.json` under a per-call temp dir as an
11890
12154
  * `{ connection?, connections? }` envelope. The handler writes its result to
11891
12155
  * stdout as `{ ok, result }` or plain text. Node never evaluates handler code.
12156
+ *
12157
+ * When {@link SandboxPluginExecutorDeps.resident} is configured, a `running`
12158
+ * deployment with an endpoint for the invocation's `(tenantId, pluginType)`
12159
+ * runs the handler inside the plugin's resident service over HTTP; a paused or
12160
+ * stopped `onDemand` deployment is resumed first (spec §7.1).
11892
12161
  */
11893
12162
  declare class SandboxPluginExecutor {
11894
12163
  private readonly deps;
11895
12164
  /**
11896
- * @param deps - Sandbox resolver and optional logger
12165
+ * @param deps - Sandbox resolver, optional logger, and optional resident routing
11897
12166
  */
11898
12167
  constructor(deps: SandboxPluginExecutorDeps);
11899
12168
  /**
11900
- * Invoke a plugin handler inside the tenant sandbox shell.
12169
+ * Invoke a plugin handler.
12170
+ *
12171
+ * Routes to the published plugin's resident service when {@link
12172
+ * SandboxPluginExecutorDeps.resident} is configured and a deployment is
12173
+ * routable (`running` with an endpoint, or a resumed `onDemand` deployment).
12174
+ * Otherwise, or when the resident call fails and degradation is enabled, runs
12175
+ * the handler as a short `node <handler>` process inside the tenant sandbox.
12176
+ *
12177
+ * @param args - Invocation arguments including manifest, handler, and input
12178
+ * @returns The normalized handler result, exit code, timing, and raw stdout
12179
+ * @throws When `args.handler` is not a safe relative path
12180
+ */
12181
+ invoke(args: SandboxPluginInvokeArgs): Promise<SandboxPluginResult>;
12182
+ /**
12183
+ * Attempt to route an invocation to a published plugin's resident service.
12184
+ *
12185
+ * @param args - Invocation arguments
12186
+ * @param resident - Resident routing dependencies
12187
+ * @param started - Invocation start timestamp used for `durationMs`
12188
+ * @returns A terminal result (success, or failure with degradation disabled),
12189
+ * or `undefined` when the caller should fall back to the short-process path
12190
+ */
12191
+ private tryResident;
12192
+ /**
12193
+ * Normalize a resident invocation outcome into the caller-facing result.
12194
+ *
12195
+ * @param outcome - Normalized resident transport result
12196
+ * @param args - Invocation arguments (for the result-size cap)
12197
+ * @param resident - Resident routing dependencies (degradation policy)
12198
+ * @param pluginType - Plugin type, for diagnostics
12199
+ * @param tenantId - Tenant owning the plugin, for diagnostics
12200
+ * @param started - Invocation start timestamp used for `durationMs`
12201
+ * @returns The normalized result, or `undefined` when the caller should fall
12202
+ * back to the short-process path
12203
+ */
12204
+ private finalizeResident;
12205
+ /**
12206
+ * Look up a deployment, degrading to `undefined` when the lookup throws.
12207
+ *
12208
+ * @param resident - Resident routing dependencies
12209
+ * @param tenantId - Tenant owning the plugin
12210
+ * @param pluginType - Plugin type addressed by the invocation
12211
+ * @returns The deployment, or `undefined` when absent or lookup failed
12212
+ */
12213
+ private lookupDeployment;
12214
+ /**
12215
+ * Resume a non-running `onDemand` deployment once, then invoke it.
12216
+ *
12217
+ * Re-reads the deployment after the resume so a cold-started endpoint is
12218
+ * picked up. Never throws: a failed resume or a deployment that is still not
12219
+ * `running` with an endpoint resolves to `undefined`, letting the caller use
12220
+ * the short-process path.
12221
+ *
12222
+ * @param resident - Resident routing dependencies
12223
+ * @param tenantId - Tenant owning the plugin
12224
+ * @param pluginType - Plugin type addressed by the invocation
12225
+ * @param payload - Invocation payload
12226
+ * @param timeoutMs - Clamped per-call timeout
12227
+ * @returns The resident outcome when routed, or `undefined` to short-process
12228
+ */
12229
+ private wakeOnDemand;
12230
+ /**
12231
+ * Resume an `onDemand` deployment once and retry the resident call once.
12232
+ *
12233
+ * @param resident - Resident routing dependencies
12234
+ * @param tenantId - Tenant owning the plugin
12235
+ * @param pluginType - Plugin type addressed by the invocation
12236
+ * @param endpoint - Endpoint used by the first attempt
12237
+ * @param payload - Invocation payload
12238
+ * @param timeoutMs - Clamped per-call timeout
12239
+ * @param firstOutcome - Failed first attempt, returned when resume fails
12240
+ * @returns The retry outcome, or `firstOutcome` when resume itself failed
12241
+ */
12242
+ private ensureRunningAndRetry;
12243
+ /**
12244
+ * Invoke the resident host over the sandbox-service proxy path.
12245
+ *
12246
+ * @param resident - Resident routing dependencies
12247
+ * @param endpointPath - Relative proxy path
12248
+ * @param payload - Invocation payload matching the host contract
12249
+ * @param timeoutMs - Clamped per-call timeout
12250
+ * @returns The normalized resident invocation result
12251
+ */
12252
+ private callResident;
12253
+ /**
12254
+ * Invoke a plugin handler as a short `node <handler>` process.
11901
12255
  *
11902
12256
  * Resolves the sandbox, injects small input as a base64 env var (or writes a
11903
12257
  * temp `input.json` for large input), writes connection credentials to a temp
@@ -11907,10 +12261,10 @@ declare class SandboxPluginExecutor {
11907
12261
  * in all cases, including setup failures.
11908
12262
  *
11909
12263
  * @param args - Invocation arguments including manifest, handler, and input
12264
+ * @param started - Invocation start timestamp used for `durationMs`
11910
12265
  * @returns The normalized handler result, exit code, timing, and raw stdout
11911
- * @throws When `args.handler` is not a safe relative path
11912
12266
  */
11913
- invoke(args: SandboxPluginInvokeArgs): Promise<SandboxPluginResult>;
12267
+ private invokeShortProcess;
11914
12268
  }
11915
12269
 
11916
12270
  /** Arguments accepted by {@link compileSandboxPlugin}. */
@@ -12223,6 +12577,168 @@ declare function getSandboxPluginCatalog(): TenantPluginCatalog;
12223
12577
  */
12224
12578
  declare function setSandboxPluginCatalog(instance: TenantPluginCatalog | null): void;
12225
12579
 
12580
+ /**
12581
+ * Process-wide accessor for the host-injected plugin deployment service.
12582
+ *
12583
+ * The resident-service orchestration (`PluginDeploymentService`) lives in the
12584
+ * gateway, but the `manage_plugin` middleware runs in core. To keep core free
12585
+ * of any gateway import, the gateway registers its service here at startup and
12586
+ * core reaches it through this structural seam — mirroring how
12587
+ * {@link getSandboxPluginCatalog} is a process-wide accessor.
12588
+ *
12589
+ * The interface stays minimal: the three lifecycle operations the
12590
+ * `manage_plugin` tool needs (`deploy`/`undeploy`/`status`) plus the two
12591
+ * read/resume primitives the catalog executor needs to route a tool call to a
12592
+ * resident service (`getDeployment`/`ensureRunning`). Core never depends on the
12593
+ * concrete service.
12594
+ *
12595
+ * @remarks
12596
+ * When no service is registered the accessor returns `null`; the `manage_plugin`
12597
+ * actions degrade to a diagnostic instead of throwing (ADR-097 invariant), and
12598
+ * the catalog executor takes the short-process path unchanged.
12599
+ */
12600
+ /** Lifecycle strategy for a resident plugin deployment. */
12601
+ type PluginDeploymentServiceMode = "onDemand" | "alwaysOn";
12602
+ /** Options accepted when deploying a resident plugin service. */
12603
+ interface PluginDeploymentServiceDeployOptions {
12604
+ /** Lifecycle strategy; defaults to the deployment service's own default. */
12605
+ mode?: PluginDeploymentServiceMode;
12606
+ /** On-demand idle timeout override, in milliseconds. */
12607
+ idleTimeoutMs?: number;
12608
+ }
12609
+ /** Minimal deploy outcome surfaced through `manage_plugin deploy`. */
12610
+ interface PluginDeploymentServiceDeployResult {
12611
+ /** Durable deployment status (e.g. `"running"`). */
12612
+ status: string;
12613
+ /** Resolved endpoint route, when known. */
12614
+ endpoint?: string;
12615
+ /** Lifecycle strategy, when known. */
12616
+ mode?: string;
12617
+ }
12618
+ /** Minimal undeploy outcome surfaced through `manage_plugin undeploy`. */
12619
+ interface PluginDeploymentServiceUndeployResult {
12620
+ /** Whether a deployment record was removed. */
12621
+ undeployed: boolean;
12622
+ }
12623
+ /** One row in the tenant-wide deployment list surfaced through `manage_plugin deployments`. */
12624
+ interface PluginDeploymentServiceListEntry {
12625
+ /** Plugin type (directory key). */
12626
+ pluginType: string;
12627
+ /** Durable deployment status. */
12628
+ status: string;
12629
+ /** Lifecycle strategy. */
12630
+ mode: string;
12631
+ /** Resolved endpoint route, when known. */
12632
+ endpoint?: string;
12633
+ /** ISO timestamp of the last health observation. */
12634
+ lastHealthAt?: string;
12635
+ /** Most recent health error, when unhealthy. */
12636
+ lastError?: string;
12637
+ }
12638
+ /** Minimal status view surfaced through `manage_plugin status`. */
12639
+ interface PluginDeploymentServiceStatus {
12640
+ /** Durable status, or `"absent"` when no deployment exists. */
12641
+ status: string;
12642
+ /** Resolved endpoint route, when known. */
12643
+ endpoint?: string;
12644
+ /** Lifecycle strategy, when known. */
12645
+ mode?: string;
12646
+ /** ISO timestamp of the last health observation. */
12647
+ lastHealthAt?: string;
12648
+ /** Most recent health error, when unhealthy. */
12649
+ lastError?: string;
12650
+ }
12651
+ /**
12652
+ * Structural contract the gateway's `PluginDeploymentService` satisfies.
12653
+ *
12654
+ * Core depends only on this shape, so the concrete gateway class can be
12655
+ * installed without a cross-package import.
12656
+ */
12657
+ interface PluginDeploymentServiceLike {
12658
+ /**
12659
+ * Provision (or idempotently reuse) a resident service for a plugin.
12660
+ *
12661
+ * @param tenantId - Tenant that owns the plugin.
12662
+ * @param pluginType - Plugin type (directory key).
12663
+ * @param options - Lifecycle mode and overrides.
12664
+ */
12665
+ deploy(tenantId: string, pluginType: string, options?: PluginDeploymentServiceDeployOptions): Promise<PluginDeploymentServiceDeployResult>;
12666
+ /**
12667
+ * Tear down a resident service and its deployment record.
12668
+ *
12669
+ * @param tenantId - Tenant that owns the plugin.
12670
+ * @param pluginType - Plugin type.
12671
+ */
12672
+ undeploy(tenantId: string, pluginType: string): Promise<PluginDeploymentServiceUndeployResult>;
12673
+ /**
12674
+ * Read a deployment's durable status, refreshing it with a live health probe.
12675
+ *
12676
+ * @param tenantId - Tenant that owns the plugin.
12677
+ * @param pluginType - Plugin type.
12678
+ */
12679
+ status(tenantId: string, pluginType: string): Promise<PluginDeploymentServiceStatus>;
12680
+ /**
12681
+ * List every resident deployment for a tenant.
12682
+ *
12683
+ * Backs the read-only `manage_plugin deployments` view. Reads the durable
12684
+ * store directly and never probes the resident host.
12685
+ *
12686
+ * @param tenantId - Tenant whose deployments are listed.
12687
+ * @returns One entry per deployment, newest semantics defined by the store.
12688
+ */
12689
+ list(tenantId: string): Promise<PluginDeploymentServiceListEntry[]>;
12690
+ /**
12691
+ * Read a deployment's stored record without probing the resident host.
12692
+ *
12693
+ * The catalog executor uses this to decide whether a tool call should be
12694
+ * routed to the resident service. Unlike {@link status} this never issues a
12695
+ * `/health` probe and resolves `undefined` when no record exists.
12696
+ *
12697
+ * @param tenantId - Tenant that owns the plugin.
12698
+ * @param pluginType - Plugin type.
12699
+ * @returns The minimal `{ status, endpoint, mode }` view, or `undefined`.
12700
+ */
12701
+ getDeployment(tenantId: string, pluginType: string): Promise<{
12702
+ status: string;
12703
+ endpoint?: string;
12704
+ mode: string;
12705
+ } | undefined>;
12706
+ /**
12707
+ * Ensure an existing on-demand deployment is running and healthy.
12708
+ *
12709
+ * The catalog executor calls this to resume a paused/stopped `onDemand`
12710
+ * deployment before a resident invocation. It resolves once the deployment is
12711
+ * running; it is a no-op when the deployment is already running.
12712
+ *
12713
+ * @param tenantId - Tenant that owns the plugin.
12714
+ * @param pluginType - Plugin type.
12715
+ */
12716
+ ensureRunning(tenantId: string, pluginType: string): Promise<void>;
12717
+ }
12718
+ /**
12719
+ * Install (or clear) the process-wide plugin deployment service.
12720
+ *
12721
+ * The gateway calls this at startup with its real service; tests inject a fake.
12722
+ *
12723
+ * @param instance - Service to install, or `undefined`/`null` to reset.
12724
+ * @returns Nothing
12725
+ *
12726
+ * @example
12727
+ * ```ts
12728
+ * setPluginDeploymentService(new PluginDeploymentService({ ...deps }));
12729
+ * // later, at shutdown or in tests:
12730
+ * setPluginDeploymentService(undefined);
12731
+ * ```
12732
+ */
12733
+ declare function setPluginDeploymentService(instance: PluginDeploymentServiceLike | null | undefined): void;
12734
+ /**
12735
+ * Read the installed plugin deployment service.
12736
+ *
12737
+ * @returns The registered service, or `null` when none is installed (the
12738
+ * `manage_plugin` deploy/undeploy/status actions then return a diagnostic).
12739
+ */
12740
+ declare function getPluginDeploymentService(): PluginDeploymentServiceLike | null;
12741
+
12226
12742
  /**
12227
12743
  * Plugin skill definition resolved together with its owning plugin type.
12228
12744
  *
@@ -12348,6 +12864,362 @@ declare function provisionSandboxOpenClient(sandbox: {
12348
12864
  */
12349
12865
  declare function buildBundleFromDist(distDir: string, version: string): SandboxOpenClientBundle;
12350
12866
 
12867
+ /**
12868
+ * Process-local runtime cache for published plugin deployments.
12869
+ *
12870
+ * The authoritative deployment state lives in the `PluginDeployment` store
12871
+ * (Plan 3). This registry only caches the resolved proxy endpoint and the last
12872
+ * observed health for the lifetime of a single Gateway process, and coalesces
12873
+ * concurrent {@link PluginDeploymentRuntimeRegistry.ensureRunning} calls so a
12874
+ * cold start (or resume) is performed at most once per key at a time.
12875
+ *
12876
+ * Keys are `${tenantId}:${pluginType}`. Every method receives that composed
12877
+ * key as its `id` argument.
12878
+ */
12879
+ /** Last observed health for one cached deployment. */
12880
+ interface PluginDeploymentRuntimeHealth {
12881
+ /** Epoch milliseconds of the most recent health observation. */
12882
+ lastHealthAt?: number;
12883
+ /** Most recent health error, cleared by a subsequent healthy mark. */
12884
+ lastError?: string;
12885
+ }
12886
+ /** Constructor options for {@link PluginDeploymentRuntimeRegistry}. */
12887
+ interface PluginDeploymentRuntimeRegistryOptions {
12888
+ /** Injectable clock (defaults to `Date.now`) used for health timestamps. */
12889
+ now?: () => number;
12890
+ }
12891
+ /**
12892
+ * In-process cache of plugin deployment endpoints and health, with single-flight
12893
+ * cold start.
12894
+ *
12895
+ * @remarks
12896
+ * - Not shared across processes. Multi-Gateway correctness relies on the store
12897
+ * being the authority and on callers re-resolving the endpoint when needed.
12898
+ * - `ensureRunning` is single-flight per `id`: concurrent callers share one
12899
+ * factory execution, and the in-flight entry is cleared once it settles
12900
+ * (success or failure) so a later call may retry.
12901
+ *
12902
+ * @example
12903
+ * ```ts
12904
+ * const registry = new PluginDeploymentRuntimeRegistry();
12905
+ * registry.setEndpoint("t1:weather", "/api/sandboxes/plugin-abc/proxy/8080");
12906
+ * await registry.ensureRunning("t1:weather", () => service.startSandbox());
12907
+ * ```
12908
+ */
12909
+ declare class PluginDeploymentRuntimeRegistry {
12910
+ private readonly entries;
12911
+ private readonly inFlight;
12912
+ private readonly now;
12913
+ /**
12914
+ * @param options - Optional injectable clock for deterministic health timestamps.
12915
+ */
12916
+ constructor(options?: PluginDeploymentRuntimeRegistryOptions);
12917
+ /**
12918
+ * Cache the resolved proxy endpoint for a deployment.
12919
+ *
12920
+ * @param id - Composed key `${tenantId}:${pluginType}`.
12921
+ * @param endpoint - Relative proxy path, e.g. `/api/sandboxes/plugin-abc/proxy/8080`.
12922
+ */
12923
+ setEndpoint(id: string, endpoint: string): void;
12924
+ /**
12925
+ * Read the cached endpoint for a deployment.
12926
+ *
12927
+ * @param id - Composed key `${tenantId}:${pluginType}`.
12928
+ * @returns The cached endpoint, or `undefined` when none is known.
12929
+ */
12930
+ getEndpoint(id: string): string | undefined;
12931
+ /**
12932
+ * Record a successful health observation and clear any prior error.
12933
+ *
12934
+ * @param id - Composed key `${tenantId}:${pluginType}`.
12935
+ */
12936
+ markHealthy(id: string): void;
12937
+ /**
12938
+ * Record a failed health observation.
12939
+ *
12940
+ * @param id - Composed key `${tenantId}:${pluginType}`.
12941
+ * @param error - Human-readable failure description.
12942
+ */
12943
+ markUnhealthy(id: string, error: string): void;
12944
+ /**
12945
+ * Read the last observed health for a deployment.
12946
+ *
12947
+ * @param id - Composed key `${tenantId}:${pluginType}`.
12948
+ * @returns The cached health, or `undefined` when the id is unknown.
12949
+ */
12950
+ getHealth(id: string): PluginDeploymentRuntimeHealth | undefined;
12951
+ /**
12952
+ * Run a cold start/resume factory at most once per id at a time.
12953
+ *
12954
+ * Concurrent calls for the same id return the same in-flight promise and run
12955
+ * `factory` exactly once. The in-flight entry is cleared when the factory
12956
+ * settles, so a later call runs it again (retry after failure is allowed).
12957
+ *
12958
+ * @param id - Composed key `${tenantId}:${pluginType}`.
12959
+ * @param factory - Idempotent start/resume operation for the resident service.
12960
+ * @returns A promise that settles with the factory outcome.
12961
+ */
12962
+ ensureRunning(id: string, factory: () => Promise<void>): Promise<void>;
12963
+ /**
12964
+ * Drop cached endpoint and health for one deployment.
12965
+ *
12966
+ * @param id - Composed key `${tenantId}:${pluginType}`.
12967
+ */
12968
+ clear(id: string): void;
12969
+ /** Drop all cached endpoints, health, and in-flight coordination entries. */
12970
+ reset(): void;
12971
+ private entry;
12972
+ }
12973
+
12974
+ /**
12975
+ * HTTP transport for invoking a published plugin's resident service.
12976
+ *
12977
+ * The resident host server (installed into the plugin sandbox) exposes
12978
+ * `POST /invoke` on a published guest port. In production the request travels
12979
+ * through `microsandbox-service`, whose scoped `/api/sandboxes/:name/proxy/:port/*`
12980
+ * proxy is gated by the service API key (`Authorization: Bearer <serviceKey>`)
12981
+ * and strips that key before forwarding. The host itself requires no auth: the
12982
+ * authenticated proxy route plus the loopback-bound published port are the
12983
+ * security boundary.
12984
+ */
12985
+ /** Default per-invocation timeout for a resident plugin call. */
12986
+ declare const DEFAULT_RESIDENT_INVOKE_TIMEOUT_MS = 60000;
12987
+ /** Normalized result of a resident plugin invocation. */
12988
+ interface ResidentInvokeResult {
12989
+ /** Whether the host reported success. */
12990
+ ok: boolean;
12991
+ /** Handler result payload when `ok` is true. */
12992
+ result?: unknown;
12993
+ /** Human-readable error when `ok` is false. */
12994
+ error?: string;
12995
+ /** Upstream HTTP status when a response was received. */
12996
+ status?: number;
12997
+ }
12998
+ /** One named connection config passed to a resident plugin handler. */
12999
+ interface ResidentConnectionConfig {
13000
+ /** Connection key the plugin references. */
13001
+ key: string;
13002
+ /** Decrypted connection config. */
13003
+ config: Record<string, unknown>;
13004
+ }
13005
+ /** Request body accepted by the resident host server's `/invoke` endpoint. */
13006
+ interface ResidentInvokePayload {
13007
+ /** Plugin-directory-relative handler path from the manifest. */
13008
+ handler: string;
13009
+ /** Tool input. */
13010
+ input: unknown;
13011
+ /** Single resolved connection config (when the caller resolved one). */
13012
+ connection?: Record<string, unknown>;
13013
+ /** Full multi-connection list keyed by connection key. */
13014
+ connections?: ResidentConnectionConfig[];
13015
+ /** Trusted execution context strings (tenant, plugin type, ...). */
13016
+ context: Record<string, string>;
13017
+ /**
13018
+ * Per-call handler timeout, forwarded to the host as its child-process
13019
+ * timeout so the resident path honors the caller's value (not just the
13020
+ * client-side abort). Falls back to {@link ResidentInvokeArgs.timeoutMs}.
13021
+ */
13022
+ timeoutMs?: number;
13023
+ }
13024
+ /** Arguments for {@link invokeResident}. */
13025
+ interface ResidentInvokeArgs {
13026
+ /** Configured sandbox-service base URL, e.g. `http://service:4002`. */
13027
+ baseUrl: string;
13028
+ /** Relative proxy path, e.g. `/api/sandboxes/plugin-abc/proxy/8080`. */
13029
+ endpointPath: string;
13030
+ /** Sandbox-service API key (sent as `Authorization: Bearer` when present). */
13031
+ serviceKey?: string;
13032
+ /** Invocation payload matching the host `/invoke` contract. */
13033
+ payload: ResidentInvokePayload;
13034
+ /** Override the per-invocation timeout. */
13035
+ timeoutMs?: number;
13036
+ /** Injectable fetch implementation (defaults to the global `fetch`). */
13037
+ fetchImpl?: typeof fetch;
13038
+ }
13039
+ /**
13040
+ * Invoke a resident plugin handler over the sandbox-service proxy path.
13041
+ *
13042
+ * Builds `POST ${baseUrl}${endpointPath}/invoke`, sends the sandbox-service
13043
+ * key in `Authorization: Bearer <serviceKey>` (when supplied), and normalizes
13044
+ * the host envelope. It never throws: non-2xx responses, malformed bodies,
13045
+ * network failures, and timeouts all resolve to `{ ok: false, error }`.
13046
+ *
13047
+ * @param args - Invocation arguments (see {@link ResidentInvokeArgs}).
13048
+ * @returns The normalized invocation result.
13049
+ *
13050
+ * @example
13051
+ * ```ts
13052
+ * const result = await invokeResident({
13053
+ * baseUrl: process.env.MICROSANDBOX_SERVICE_BASE_URL ?? "",
13054
+ * endpointPath: deployment.endpoint,
13055
+ * serviceKey: process.env.MICROSANDBOX_API_KEY,
13056
+ * payload: { handler: "handlers/weather.js", input: { city: "SF" }, context: { tenantId } },
13057
+ * });
13058
+ * ```
13059
+ */
13060
+ declare function invokeResident(args: ResidentInvokeArgs): Promise<ResidentInvokeResult>;
13061
+
13062
+ /**
13063
+ * Pure protocol helpers shared by the in-sandbox plugin host server.
13064
+ *
13065
+ * These functions are intentionally dependency-free (no imports from other core
13066
+ * modules) so they can be embedded verbatim inside the self-contained
13067
+ * `PLUGIN_HOST_SERVER_SOURCE` script that runs in the bare sandbox image. Keep
13068
+ * any change to this file mirrored in `pluginHostSource.ts`.
13069
+ */
13070
+ /** Maximum serialized input size that travels inline as a base64 env var. */
13071
+ declare const INLINE_INPUT_LIMIT_BYTES: number;
13072
+ /** Default child-process handler timeout for `/invoke` (60s). */
13073
+ declare const DEFAULT_HANDLER_TIMEOUT_MS = 60000;
13074
+ /** Lower bound for a caller-supplied `/invoke` handler timeout (1s). */
13075
+ declare const MIN_HANDLER_TIMEOUT_MS = 1000;
13076
+ /** Upper bound for a caller-supplied `/invoke` handler timeout (5min). */
13077
+ declare const MAX_HANDLER_TIMEOUT_MS = 300000;
13078
+ /** Parsed `--type`/`--port` arguments for the host server process. */
13079
+ interface HostArgs {
13080
+ /** Plugin type the host server is serving (e.g. `"weather"`). */
13081
+ type: string;
13082
+ /** TCP port the HTTP server binds. */
13083
+ port: number;
13084
+ }
13085
+ /** Normalized `{ ok, result?, error? }` envelope returned to the caller. */
13086
+ interface HandlerEnvelope {
13087
+ /** Whether the handler reported success. */
13088
+ ok: boolean;
13089
+ /** Handler result payload when `ok` is true. */
13090
+ result?: unknown;
13091
+ /** Human-readable error when `ok` is false. */
13092
+ error?: string;
13093
+ }
13094
+ /** Connection selection passed to {@link buildConnectionPayload}. */
13095
+ interface ConnectionPayloadInput {
13096
+ /** Single connection config (used when no `connections` list is given). */
13097
+ connection?: Record<string, unknown>;
13098
+ /** Multiple connection configs keyed by connection key. */
13099
+ connections?: Array<{
13100
+ key: string;
13101
+ config: Record<string, unknown>;
13102
+ }>;
13103
+ }
13104
+ /**
13105
+ * Parse the host server's `--type` and `--port` argv values.
13106
+ *
13107
+ * Accepts both the spaced (`--type weather`) and joined (`--type=weather`)
13108
+ * forms. Scans all tokens, so the leading `node`/`server.js` entries are safe.
13109
+ *
13110
+ * @param argv - Process argv array (typically `process.argv`)
13111
+ * @returns The parsed plugin type and port
13112
+ * @throws When `--type` is missing/empty or `--port` is not an integer in 1..65535
13113
+ */
13114
+ declare function parseHostArgs(argv: readonly string[]): HostArgs;
13115
+ /**
13116
+ * Resolve the child-process handler timeout for a `/invoke` request.
13117
+ *
13118
+ * Keeps the resident host's handler timeout at parity with the caller's
13119
+ * `SandboxPluginExecutor` timeout: the caller forwards its clamped timeout in
13120
+ * the request body so a custom value (e.g. 5s) is honored end-to-end instead of
13121
+ * the client aborting while the host keeps running the handler.
13122
+ *
13123
+ * @param value - Raw `body.timeoutMs`; absent/non-finite falls back to the default
13124
+ * @returns The timeout in milliseconds, clamped to 1s..5min
13125
+ */
13126
+ declare function resolveHandlerTimeoutMs(value: unknown): number;
13127
+ /**
13128
+ * Extract a normalized envelope from handler output that may contain stderr
13129
+ * noise (Node warnings, logs) merged into stdout.
13130
+ *
13131
+ * Whole-output JSON is tried first, then lines are scanned bottom-up for the
13132
+ * last object with a boolean `ok`. Empty output yields an explicit failure;
13133
+ * any other non-envelope output is treated as plain-text success. Mirrors
13134
+ * `SandboxPluginExecutor`'s envelope semantics.
13135
+ *
13136
+ * @param stdout - Combined handler output
13137
+ * @returns The normalized envelope
13138
+ */
13139
+ declare function parseHandlerEnvelope(stdout: string): HandlerEnvelope;
13140
+ /**
13141
+ * Build the shell command that runs a plugin handler with `node`.
13142
+ *
13143
+ * The handler path is single-quote escaped as a literal POSIX shell argument.
13144
+ *
13145
+ * @param handlerPath - Absolute handler path
13146
+ * @returns A `node '<handlerPath>'` command string
13147
+ */
13148
+ declare function buildHandlerCommand(handlerPath: string): string;
13149
+ /**
13150
+ * Base64-encode a value as UTF-8 JSON for transport through a shell env var.
13151
+ *
13152
+ * @param input - Value to serialize; `null`/`undefined` become JSON `null`
13153
+ * @returns Base64-encoded JSON string
13154
+ */
13155
+ declare function encodeInput(input: unknown): string;
13156
+ /**
13157
+ * Build the `connection.json` envelope from an invocation's connection fields.
13158
+ *
13159
+ * The envelope is always an object so a handler can read a single connection
13160
+ * (`connection`) and/or the full multi-connection list (`connections`)
13161
+ * regardless of how many connections the caller selected. Mirrors
13162
+ * `SandboxPluginExecutor.buildConnectionPayload`.
13163
+ *
13164
+ * @param args - Connection selection
13165
+ * @returns The envelope, or `null` when no connection payload was supplied
13166
+ */
13167
+ declare function buildConnectionPayload(args: ConnectionPayloadInput): Record<string, unknown> | null;
13168
+
13169
+ /** Content version of the in-sandbox host server. Bump on any behavior change. */
13170
+ declare const PLUGIN_HOST_VERSION = "1.1.0";
13171
+ /**
13172
+ * Self-contained Node HTTP server installed at `/root/.agents/.plugin-host/server.js`.
13173
+ *
13174
+ * Serves `GET /health`, `GET /meta`, and `POST /invoke` (no in-host auth; the
13175
+ * service-key-authenticated proxy + loopback binding are the boundary). On
13176
+ * invoke it writes input/connection temp files, runs `node <handler>` as a
13177
+ * short child process (mirroring the existing `SandboxPluginExecutor` env/file
13178
+ * contract), and returns the parsed stdout envelope. It reads `--type`/`--port`
13179
+ * from argv.
13180
+ *
13181
+ * @remarks
13182
+ * This string carries **no monorepo imports** — it executes in the bare sandbox
13183
+ * image with only Node available. The pure helpers in `pluginHostProtocol.ts`
13184
+ * are inlined here because the script cannot import them; keep the two in sync.
13185
+ */
13186
+ declare const PLUGIN_HOST_SERVER_SOURCE: string;
13187
+ /**
13188
+ * Content hash of the host server source (cache/versioning key).
13189
+ *
13190
+ * @returns A stable 16-character hex digest of `version:source`
13191
+ */
13192
+ declare function pluginHostContentHash(): string;
13193
+
13194
+ /** Reserved directory for the tenant plugin host runtime. */
13195
+ declare const PLUGIN_HOST_DIR = "/root/.agents/.plugin-host";
13196
+ /** Result of installing the in-sandbox plugin host server. */
13197
+ interface InstallPluginHostResult {
13198
+ /** Sandbox-visible path of the installed host server script. */
13199
+ path: string;
13200
+ /** Content version of the installed host server. */
13201
+ version: string;
13202
+ /** Content hash of the installed host server. */
13203
+ hash: string;
13204
+ /** Whether files were written (`false` when already current). */
13205
+ changed: boolean;
13206
+ }
13207
+ /**
13208
+ * Ensure the in-sandbox plugin host server is present and current.
13209
+ *
13210
+ * Reads `version.json` and skips all writes when its hash already matches
13211
+ * {@link pluginHostContentHash}; otherwise creates the reserved directory and
13212
+ * writes both `server.js` and `version.json`.
13213
+ *
13214
+ * @param sandbox - Resolved tenant sandbox (caller resolves via SandboxLatticeManager)
13215
+ * @returns Install result with the written path, version, hash, and whether it changed
13216
+ * @example
13217
+ * ```ts
13218
+ * const { changed } = await installPluginHost(sandbox);
13219
+ * ```
13220
+ */
13221
+ declare function installPluginHost(sandbox: SandboxInstance): Promise<InstallPluginHostResult>;
13222
+
12351
13223
  /** Stable failure codes emitted when capability bundles cannot be composed. */
12352
13224
  type CapabilityBundleMergeErrorCode = "CAPABILITY_BUNDLE_DUPLICATE_ID" | "CAPABILITY_BUNDLE_EMPTY_ALLOWED_TOOLS" | "CAPABILITY_BUNDLE_INVALID_CONFIG" | "CAPABILITY_BUNDLE_NULL_VALUE" | "CAPABILITY_BUNDLE_UNSAFE_KEY";
12353
13225
  /** Describes invalid capability bundle input rejected by the pure merger. */
@@ -13506,4 +14378,4 @@ declare function parseDirectRoomType(projectId: string): "human" | "bot" | null;
13506
14378
  */
13507
14379
  declare function isDirectRoom(projectId: string): boolean;
13508
14380
 
13509
- export { AGENT_TASK_EVENT, type AddMessageParams, type AddMessageResult, Agent, type AgentClient, type AgentExecutor, AgentInstanceManager, type AgentLattice, AgentLatticeManager, type AgentLifecycleEventName, AgentManager, type AgentStreamExecutor, type AgentTaskCompletionInput, type AgentThreadInterface, type ApproveInterruptedTaskInput, type AssignTaskOwnerInput, BUILTIN_PLUGINS, BUILTIN_SKILLS, type BackendFactory, type BackendProtocol, type BeginRunFailure, type BeginRunInput, type BeginRunResult, type BeginRunSuccess, type BufferStats, CAPABILITY_TOOL_NAME_CONFLICT, type CacheEntry, type CalibrationProbe, CapabilityBundleMergeError, type CapabilityBundleMergeErrorCode, CapabilityBundleMerger, CapabilityBundleValidationError, type CapabilityBundleValidationErrorCode, type CapabilityGuardDenialCode, type CapabilityResourceSelector, type CapabilityToolMetadata, CapabilityToolNameConflictError, CapabilityToolRegistry, type CaseRunResult, type Chunk, ChunkBuffer, ChunkBufferLatticeManager, type ClaimMessagesOptions, CollectionLatticeManager, type ColumnInfo, type CompileSandboxPluginArgs, CompositeBackend, type ConflictItem, type ConnectAllChannelsOptions, ConnectionRegistry, ConsoleLoggerClient, type CreateSandboxProviderConfig, type CronFields, CustomMetricsClient, type CustomMiddlewareFactory, CustomMiddlewareRegistry, DEFAULT_CALIBRATION_PROBES, DEFAULT_CONNECT_TIMEOUT_MS, DEFAULT_DELAY_MS, DEFAULT_MAX_ATTEMPTS, type DatabaseConfig, type DatabaseType, DaytonaInstance, DaytonaProvider, type DaytonaProviderConfig, DefaultScheduleClient, DelegatedScopeNotQueueableError, type DeleteResult, DependencyResolver, type DispatchPreparation, DuplicateProjectRoomMessageIdempotencyKeyError, E2BInstance, E2BProvider, type E2BProviderConfig, EMPTY_CONTENT_WARNING, type EditResult, type EmbeddingsInfo, type EmbeddingsLatticeInterface, EmbeddingsLatticeManager, type EnsureMicrosandboxInput, type EvalRunService, type ExecutionAuthority, ExecutionAuthorityRegistry, type ExportBundle, type ExportContext, type ExportJob, type ExportableEntity, type ExportableEntityDefinition, ExportableEntityRegistry, type ExportableFile, type ExportableTypeInfo, type FileData, type FileInfo, FileSystemSkillStore, type FileSystemSkillStoreOptions, FilesystemBackend, type FsEntry, type GetThreadRunOwnerInput, type GrepMatch, HEALTH_CHECK_INTERVAL_MS, HEALTH_CHECK_TIMEOUT_MS, type IMessageQueueStore, type IMetricsServerClient, type ISqlDatabase, IdRemapper, type ImmediateDispatchPlan, type ImportApplyResolution, type ImportApplyResult, type ImportEntityResult, type ImportEntityStatus, type ImportPreviewResult, InMemoryA2AApiKeyStore, InMemoryAgentWebAppStore, InMemoryAssistantStore, InMemoryBindingStore, InMemoryCapabilityBundleStore, InMemoryChannelInstallationStore, InMemoryChunkBuffer, InMemoryCollectionStore, InMemoryDatabaseConfigStore, InMemoryLeaseStore, InMemoryMailboxStore, InMemoryMenuStore, InMemoryModelProviderStore, InMemoryOpenAuditStore, InMemoryOutboxStore, InMemoryProjectBotMembershipStore, InMemoryProjectMembershipStore, InMemoryProjectRoomCoordinator, InMemoryProjectRoomMessageStore, InMemoryProjectRoomReadStateStore, InMemoryProjectRoomStore, InMemoryTaskListStore, InMemoryTaskStore, InMemoryTaskWorkItemStore, InMemoryTenantStore, InMemoryThreadMessageQueueStore, InMemoryThreadStore, InMemoryUserPushSubscriptionStore, InMemoryUserStore, InMemoryUserTenantLinkStore, type InsertionItem, type JudgeVerdict, LINE_NUMBER_WIDTH, type LangGraphStateChecker, type LatticeAgentStepConfig, LatticeEval, type LatticeEvalBatchReport, type LatticeEvalCase, type LatticeEvalCaseType, type LatticeEvalCaseWithTemplate, type LatticeEvalConfig, type LatticeEvalLogEvent, type LatticeEvalLogLevel, LatticeEvalProject, type LatticeEvalProjectType, type LatticeEvalResult, type LatticeEvalRubric, LatticeEvalSuite, type LatticeEvalSuiteType, type LatticeEvalTemplate, LeaseAcquisitionTimeoutError, type LifecycleResult, type LifecycleWarning, LocalSandboxInstance, LocalSandboxProvider, type LocalSandboxProviderConfig, type LoggerLattice, LoggerLatticeManager, type LoopBreakerConfig, MAX_BACKOFF_MS, MAX_LINE_LENGTH, MAX_PACK_ENTRIES, MAX_PACK_FILE_BYTES, MAX_PACK_TOTAL_BYTES, type MailboxMessage, type MailboxStore, ManagedTaskStartError, type ManagedTaskStartOptions, type ManifestValidationResult, type McpClientFactory, type McpClientLike, type McpClientSession, type McpConnectionOptions, McpLatticeManager, type McpRegisterOptions, type McpServerId, type McpServerRuntime, type McpServerState, MemoryBackend, MemoryLatticeManager, MemoryQueueClient, MemoryScheduleStorage, type MergedPluginSkills, type MessageCompletedEvent, type MessageContent, type MessageContentPart, type MessageContentValue, type MessageFailedEvent, type MessageInterruptedEvent, type MessageLike, type MessageStartedEvent, MessageType, MetricsServerManager, MicrosandboxRemoteInstance, MicrosandboxRemoteProvider, type MicrosandboxRemoteProviderClient, type MicrosandboxRemoteProviderConfig, MicrosandboxServiceClient, type MicrosandboxServiceClientConfig, type MicrosandboxShellExecInput, type ModelConfig, type ModelLatticeInterface, ModelLatticeManager, MysqlDatabase, OutboxPoller, type OutboxPollerDeps, type OutputType, PACK_DIRECTORY_TIMEOUT_SECONDS, PLATFORM_SECRET_ENV_VARS, PLUGIN_CATALOG_CHANGED_TOPIC, type PackSourceInfo, type PendingMessage, PersonalAssistantConfig, PinoLoggerClient, type PluginConnectionScope, PluginRegistry, type PluginSources, type PostProcessTaskMutationResponseInput, PostgresDatabase, type PreviewError, ProjectBotMembershipIdConflictError, ProjectMutationMutex, type ProjectMutationScope, ProjectRoomMessageIdConflictError, type ProjectTaskAdmissionListener, type ProjectTaskAdmissionNotification, ProjectTaskAdmissionNotifier, type ProjectTaskAdmissionNotifierOptions, type ProjectTaskAssignmentScope, ProjectTaskOwnerPolicy, type ProjectTaskOwnerPolicyCode, ProjectTaskOwnerPolicyError, type ProjectTaskReassignmentAuthorization, type ProjectTaskReassignmentAuthorizationInput, type ProjectTaskReassignmentAuthorizer, type ProjectTaskReassignmentThreadValidationInput, type ProjectTaskReassignmentThreadValidator, type ProjectTaskRosterScope, PrometheusClient, type ProvisionFileSink, type QueryResult, type QueueLattice, QueueLatticeManager, type QueueMessage, QueueMode, type QueuePendingEvent, type QueueScope, ROOM_COORDINATOR_KEY, type ReassignProjectTaskInput, type ReconcileAllTenantTaskRunsInput, type ReconcileStaleTaskRunsInput, type ReconcileStaleTaskRunsResult, type ReconcileTaskDescriptionInput, type ReconcileTenantTaskRunsInput, type RejectInterruptedTaskInput, RemoteSandboxInstance, RemoteSandboxProvider, type RemoteSandboxProviderConfig, type RepeatedToolCallBreakerOptions, RepeatedToolCallError, type ReplyReadyEvent, type Resolution, type ResolutionAction, type ResolveAgentFn, type ResolvedConfig, type ResolvedPluginConnection, type ResolvedPluginSkill, type ResumeTaskResult, type RoomAgentMessageCallbackFailure, type RoomAgentMessageCommitted, type RoomAgentMessageInput, RoomAgentMessageService, type RoomAgentReplyInput, type RunAsLeaderOptions, type RunAsLeaderResult, type RunSandboxConfig, type RuntimeModelConfig, type RuntimeSkillSelection, SAFE_PATH_COMPONENT, SANDBOX_OPEN_GATEWAY_URL_ENV, SANDBOX_OPEN_TOKEN_ENV, type STTModelInfo, STTModelLattice, type STTModelLatticeInterface, STTModelLatticeManager, type SandboxFileInfo, type SandboxFileService, SandboxFilesystem, type SandboxGrepMatch, type SandboxInstance, type SandboxIsolationLevel, SandboxLatticeManager, type SandboxManagerProtocol, type SandboxOpenClientBundle, type SandboxOpenCredential, type SandboxOpenCredentialContext, type SandboxOpenCredentialProvider, type SandboxOpenCredentialProviderOptions, SandboxPluginExecutor, type SandboxPluginExecutorDeps, type SandboxPluginInvokeArgs, type SandboxPluginResult, type SandboxProvider, type SandboxProviderFactory, type SandboxProviderType, type SandboxResolver, type SandboxRunConfig, type SandboxShellService, SandboxSkillStore, type SandboxSkillStoreOptions, type SandboxVolumeDefinition, type ScheduleLattice, ScheduleLatticeManager, type SchedulerMiddlewareOptions, SemanticMetricsClient, type SettleRunInput, type SettleRunOutcome, type SharePayload, SimpleMemoryVectorStore, type SkillLattice, SkillLatticeManager, type SkillMeta, type SkillResource, SqlDatabaseManager, type StartLifecycleResult, type StartTaskExecutionInput, type StateAndStore, StateBackend, StoreBackend, type StoreLattice, StoreLatticeManager, type StoreType, type StoreTypeMap, type SubmitTaskReviewInput, TASK_RESPONSE_FINAL_WARNING_LIMIT, TASK_RESPONSE_PRIOR_WARNING_LIMIT, TASK_RESPONSE_SCALAR_MAX_BYTES, TOOL_RESULT_TOKEN_LIMIT, TRUNCATION_GUIDANCE, type TableInfo, type TableSchema, type TaskAgentInvocation, type TaskEvent, type TaskExecutionFailure, type TaskExecutionManaged, type TaskExecutionResult, type TaskExecutionServiceDeps, type TaskExecutionSuccess, type TaskLifecycleListener, type TaskLifecycleNotification, TaskLifecycleNotifier, TaskLifecycleService, type TaskLifecycleServiceDeps, type TaskListStore, type TaskResponseParseResult, type TaskRunBridge, type TaskRunBridgeDeps, TaskRunBridgeStoresRequiredError, type TaskRunLeaseHandle, TaskRunRegistry, type TaskSpec, TaskStatus, type TaskUpdatable, TeamAgentGraphBuilder, type TeamConfig, type TeamMiddlewareOptions, type TeamTask, type TeammateSpec, type TeammateToolsOptions, TenantPluginCatalog, type TenantPluginCatalogDeps, type TenantPlugins, type ThreadBuffer, type ThreadBufferConfig, type ThreadBusyEvent, type ThreadEndCode, ThreadEndError, type ThreadIdleEvent, type ThreadInfo, type ThreadQueueConfig, type ThreadRunLeaseHandle, type ThreadState, ThreadStatus, type ThreadStatusChangedEvent, TokenCache, type ToolDefinition, type ToolLattice, ToolLatticeManager, type TransferOwnerInput, type TransferOwnerResult, type TrustedAgentMessageDispatcher, type TrustedMessageOptions, type TryAcquireTaskRunInput, type TryAcquireThreadRunInput, type UnknownToolHandlerConfig, UnsafeUpstreamUrlError, type UnsafeUrlReason, type ValidateManifestArgs, type VectorStoreLatticeInterface, VectorStoreLatticeManager, type VectorStoreProviderLattice, VectorStoreProviderManager, VolumeFilesystem, type VolumeFsClient, type WithLeaseOptions, type WorkflowValidationError, type WriteResult, abortWorkflowRun, agentInstanceManager, agentLatticeManager, appendReconciliationWarning, appendUiFence, assertSafeUpstreamUrl, buildBundleFromDist, buildGrepResultsDict, buildInput, buildNamedVolumeName, buildRemotePackDirectoryCommand, buildSandboxMetadataEnv, buildSandboxOpenEnv, buildSkillFile, buildStateAnnotation, buildTableName, buildTaskMutationFallback, buildTaskNormalizationFallback, checkEmptyContent, clearEncryptionKeyCache, clearEvalRunService, clearSandboxOpenCredentialProviderForTests, collectPluginSources, collectionLatticeManager, compileInternal, compileSandboxPlugin, compileWorkflow, computeSandboxName, configureCoordinationLeaseStore, configurePluginCatalogSync, configureStores, connectAllChannels, connectionSecretFields, convertToConnection, createAgentNode, createAgentTeam, createCapabilityGuardMiddleware, createExecuteSqlQueryTool, createFileData, createInfoSqlTool, createListMetricsDataSourcesTool, createListMetricsServersTool, createListTablesSqlTool, createMapNode, createModelSelectorMiddleware, createNodeHandler, createProjectRoomMiddleware, createProjectTaskOwnerPolicy, createProjectTaskReassignmentAuthorizer, createQueryCheckerSqlTool, createQueryMetricDefinitionTool, createQueryMetricsListTool, createQuerySemanticMetricDataTool, createQuerySqlTool, createQueryTableDefinitionTool, createQueryTablesListTool, createRepeatedToolCallBreakerMiddleware, createResourceAddress, createSandboxProvider, createSandboxResolver, createSchedulerMiddleware, createSharePayload, createShellExecTool, createTaskExecutionService, createTaskLifecycleService, createTaskMiddleware, createTaskRunBridge, createTeamMiddleware, createTeammateTools, createTrustedAgentMessageDispatcher, createUnknownToolHandlerMiddleware, createWidgetMiddleware, decrypt, decryptConfigFields, describeCronExpression, documentLearningPlugin, documentParserPlugin, embeddingsLatticeManager, encrypt, encryptConfigFields, ensureBuiltinAgentsForTenant, ensurePluginSkillInSandbox, evaluateLatticeCaseWithLogs, eventBus, eventBus as eventBusDefault, executionAuthorityRegistry, extractAppsRef, extractFetcherError, extractLegacyRefs, extractOutput, fileDataToString, formatContentWithLineNumbers, formatGrepMatches, formatGrepResults, formatReadResponse, generateDirectBotProjectId, generateDirectHumanProjectId, generateToken, getAgentClient, getAgentClientAsync, getAgentConfig, getAllAgentConfigs, getAllBuiltInSkillMetas, getAllToolDefinitions, getBindingRegistry, getBuiltInSkillContent, getBuiltInSkillMeta, getBuiltInSkillNames, getCheckpointSaver, getChunkBuffer, getCollectionEntryCount, getCoordinationLeaseStore, getEmbeddingsClient, getEmbeddingsLattice, getEncryptionKey, getEvalRunService, getLoggerLattice, getMenuRegistry, getModelLattice, getNextCronTime, getOrCreateCollectionVectorStore, getPluginSkillManifestVersion, getQueueLattice, getReplicaId, getRuntimeCapabilityConfig, getRuntimeSkillSelection, getSTTClient, getSTTClientWithTenant, getSTTModelLattice, getSandBoxManager, getSandboxOpenCredential, getSandboxPluginCatalog, getScheduleLattice, getStoreLattice, getThreadRunOwner, getToolClient, getToolClientWithTenant, getToolDefinition, getToolLattice, getVectorStoreClient, getVectorStoreLattice, getVectorStoreProvider, getWorkflowSignal, globSearchFiles, grepMatchesFromFiles, grepSearchFiles, hasChunkBuffer, hasDelegatedWorkerToken, hasRuntimeCapabilityPolicy, invokeWithRetry, isBuiltInSkill, isDirectRoom, isMcpConnectionError, isPluginSkillAuthorizedInSandbox, isPluginSkillManagedInSandbox, isUsingDefaultKey, isValidCronExpression, isValidSandboxName, isValidSkillName, jsonSchemaToZod, listCollectionEntries, listSandboxProviderTypes, listTenantPlugins, loggerLatticeManager, mcpManager, mergeCapabilityBundles, mergePluginSkills, mergePluginSources, metricsServerManager, modelLatticeManager, nextBackoffDelay, normalizeSandboxName, ownTaskResponseField, parallelLimit, parseCronExpression, parseDirectRoomType, parseJudgeVerdict, parsePackSize, parseSkillFrontmatter, parseTaskResponse, parseYaml, performStringReplacement, postProcessTaskMutationResponse, prepareTaskDispatch, projectMutationMutex, projectRoomPlugin, projectTaskAdmissionNotifier, provisionSandboxOpenClient, publishPluginCatalogChanged, queueLatticeManager, readLoopBreakerConfig, reconcileAllTenantTaskRuns, reconcileStaleTaskRuns, reconcileTenantTaskRuns, registerAgentLattice, registerAgentLatticeWithTenant, registerAgentLattices, registerCheckpointSaver, registerChunkBuffer, registerEmbeddingsLattice, registerExistingTool, registerExistingToolWithTenant, registerLoggerLattice, registerModelLattice, registerModelLatticeForTenant, registerQueueLattice, registerSTTModelLattice, registerSandboxOpenCredentialProvider, registerSandboxProviderType, registerScheduleLattice, registerStoreLattice, registerTeammateAgent, registerToolLattice, registerVectorStoreLattice, registerVectorStoreProvider, registerWorkflowRun, removeCollectionVectorStore, renderTemplate, resetReplicaIdForTests, resolveEnabledPluginSkill, resolveJudgeModelKey, resolvePath, resolvePluginConnections, resolveSandboxPluginConnections, resolveTenantPluginSkill, roomCoordinatorConfig, runAsLeader, runRemotePackDirectory, safeTaskResponseId, sandboxLatticeManager, sanitizeToolCallId, scheduleLatticeManager, serializePluginMeta, serializeTaskMutationSuccess, serializeTaskNormalizationFallback, serializeTaskReadResponse, setBindingRegistry, setEvalRunService, setMenuRegistry, setSandboxPluginCatalog, skillLatticeManager, sqlDatabaseManager, storeLatticeManager, sttModelLatticeManager, taskLifecycleNotifier, taskRunLeaseKey, taskRunRegistry, threadRunLeaseKey, toJsonSchema, toSafeStateExpr, toolLatticeManager, truncateIfTooLong, tryAcquireTaskRun, tryAcquireThreadRun, unregisterTeammateAgent, unregisterWorkflowRun, updateFileData, validateAgentInput, validateCapabilityBundleInput, validateDSL, validateEncryptionKey, validatePackSourcePath, validatePath, validateRelativePath, validateSandboxPluginManifest, validateSkillName, validateToolInput, vectorStoreLatticeManager, vectorStoreProviderManager, withLease, withTimeout, wrapMcpToolWithUi };
14381
+ export { AGENT_TASK_EVENT, type AddMessageParams, type AddMessageResult, Agent, type AgentClient, type AgentExecutor, AgentInstanceManager, type AgentLattice, AgentLatticeManager, type AgentLifecycleEventName, AgentManager, type AgentStreamExecutor, type AgentTaskCompletionInput, type AgentThreadInterface, type ApproveInterruptedTaskInput, type AssignTaskOwnerInput, BUILTIN_PLUGINS, BUILTIN_SKILLS, type BackendFactory, type BackendProtocol, type BeginRunFailure, type BeginRunInput, type BeginRunResult, type BeginRunSuccess, type BufferStats, CAPABILITY_TOOL_NAME_CONFLICT, type CacheEntry, type CalibrationProbe, CapabilityBundleMergeError, type CapabilityBundleMergeErrorCode, CapabilityBundleMerger, CapabilityBundleValidationError, type CapabilityBundleValidationErrorCode, type CapabilityGuardDenialCode, type CapabilityResourceSelector, type CapabilityToolMetadata, CapabilityToolNameConflictError, CapabilityToolRegistry, type CaseRunResult, ChannelConnectionLeader, type ChannelConnectionLeaderDeps, type Chunk, ChunkBuffer, ChunkBufferLatticeManager, type ClaimMessagesOptions, CollectionLatticeManager, type ColumnInfo, type CompileSandboxPluginArgs, CompositeBackend, type ConflictItem, type ConnectAllChannelsOptions, type ConnectionPayloadInput, ConnectionRegistry, ConsoleLoggerClient, type CreateSandboxProviderConfig, type CronFields, CustomMetricsClient, type CustomMiddlewareFactory, CustomMiddlewareRegistry, DEFAULT_CALIBRATION_PROBES, DEFAULT_CONNECT_TIMEOUT_MS, DEFAULT_DELAY_MS, DEFAULT_HANDLER_TIMEOUT_MS, DEFAULT_MAX_ATTEMPTS, DEFAULT_RESIDENT_INVOKE_TIMEOUT_MS, type DatabaseConfig, type DatabaseType, DaytonaInstance, DaytonaProvider, type DaytonaProviderConfig, DefaultScheduleClient, DelegatedScopeNotQueueableError, type DeleteResult, DependencyResolver, type DispatchPreparation, DuplicateProjectRoomMessageIdempotencyKeyError, E2BInstance, E2BProvider, type E2BProviderConfig, EMPTY_CONTENT_WARNING, type EditResult, type EmbeddingsInfo, type EmbeddingsLatticeInterface, EmbeddingsLatticeManager, type EnsureMicrosandboxInput, type EvalRunService, type ExecutionAuthority, ExecutionAuthorityRegistry, type ExportBundle, type ExportContext, type ExportJob, type ExportableEntity, type ExportableEntityDefinition, ExportableEntityRegistry, type ExportableFile, type ExportableTypeInfo, type FileData, type FileInfo, FileSystemSkillStore, type FileSystemSkillStoreOptions, FilesystemBackend, type FsEntry, type GetThreadRunOwnerInput, type GrepMatch, HEALTH_CHECK_INTERVAL_MS, HEALTH_CHECK_TIMEOUT_MS, type HandlerEnvelope, type HostArgs, type IMessageQueueStore, type IMetricsServerClient, INLINE_INPUT_LIMIT_BYTES, type ISqlDatabase, IdRemapper, type ImmediateDispatchPlan, type ImportApplyResolution, type ImportApplyResult, type ImportEntityResult, type ImportEntityStatus, type ImportPreviewResult, InMemoryA2AApiKeyStore, InMemoryAgentWebAppStore, InMemoryAssistantStore, InMemoryBindingStore, InMemoryCapabilityBundleStore, InMemoryChannelInstallationStore, InMemoryChunkBuffer, InMemoryCollectionStore, InMemoryDatabaseConfigStore, InMemoryLeaseStore, InMemoryMailboxStore, InMemoryMenuStore, InMemoryModelProviderStore, InMemoryOpenAuditStore, InMemoryOutboxStore, InMemoryProjectBotMembershipStore, InMemoryProjectMembershipStore, InMemoryProjectRoomCoordinator, InMemoryProjectRoomMessageStore, InMemoryProjectRoomReadStateStore, InMemoryProjectRoomStore, InMemoryTaskListStore, InMemoryTaskStore, InMemoryTaskWorkItemStore, InMemoryTenantStore, InMemoryThreadMessageQueueStore, InMemoryThreadStore, InMemoryUserPushSubscriptionStore, InMemoryUserStore, InMemoryUserTenantLinkStore, type InsertionItem, type InstallPluginHostResult, type JudgeVerdict, LINE_NUMBER_WIDTH, type LangGraphStateChecker, type LatticeAgentStepConfig, LatticeEval, type LatticeEvalBatchReport, type LatticeEvalCase, type LatticeEvalCaseType, type LatticeEvalCaseWithTemplate, type LatticeEvalConfig, type LatticeEvalLogEvent, type LatticeEvalLogLevel, LatticeEvalProject, type LatticeEvalProjectType, type LatticeEvalResult, type LatticeEvalRubric, LatticeEvalSuite, type LatticeEvalSuiteType, type LatticeEvalTemplate, LeaseAcquisitionTimeoutError, type LifecycleResult, type LifecycleWarning, LocalSandboxInstance, LocalSandboxProvider, type LocalSandboxProviderConfig, type LoggerLattice, LoggerLatticeManager, type LoopBreakerConfig, MAX_BACKOFF_MS, MAX_HANDLER_TIMEOUT_MS, MAX_LINE_LENGTH, MAX_PACK_ENTRIES, MAX_PACK_FILE_BYTES, MAX_PACK_TOTAL_BYTES, MIN_HANDLER_TIMEOUT_MS, type MailboxMessage, type MailboxStore, ManagedTaskStartError, type ManagedTaskStartOptions, type ManifestValidationResult, type McpClientFactory, type McpClientLike, type McpClientSession, type McpConnectionOptions, McpLatticeManager, type McpRegisterOptions, type McpServerId, type McpServerRuntime, type McpServerState, MemoryBackend, MemoryLatticeManager, MemoryQueueClient, MemoryScheduleStorage, type MergedPluginSkills, type MessageCompletedEvent, type MessageContent, type MessageContentPart, type MessageContentValue, type MessageFailedEvent, type MessageInterruptedEvent, type MessageLike, type MessageStartedEvent, MessageType, MetricsServerManager, MicrosandboxRemoteInstance, MicrosandboxRemoteProvider, type MicrosandboxRemoteProviderClient, type MicrosandboxRemoteProviderConfig, MicrosandboxServiceClient, type MicrosandboxServiceClientConfig, type MicrosandboxShellExecInput, type ModelConfig, type ModelLatticeInterface, ModelLatticeManager, MysqlDatabase, OutboxPoller, type OutboxPollerDeps, type OutputType, PACK_DIRECTORY_TIMEOUT_SECONDS, PLATFORM_SECRET_ENV_VARS, PLUGIN_CATALOG_CHANGED_TOPIC, PLUGIN_HOST_DIR, PLUGIN_HOST_SERVER_SOURCE, PLUGIN_HOST_VERSION, type PackSourceInfo, type PendingMessage, PersonalAssistantConfig, PinoLoggerClient, type PluginConnectionScope, type PluginDeploymentRuntimeHealth, PluginDeploymentRuntimeRegistry, type PluginDeploymentRuntimeRegistryOptions, type PluginDeploymentServiceDeployOptions, type PluginDeploymentServiceDeployResult, type PluginDeploymentServiceLike, type PluginDeploymentServiceListEntry, type PluginDeploymentServiceMode, type PluginDeploymentServiceStatus, type PluginDeploymentServiceUndeployResult, PluginRegistry, type PluginSources, type PostProcessTaskMutationResponseInput, PostgresDatabase, type PreviewError, ProjectBotMembershipIdConflictError, ProjectMutationMutex, type ProjectMutationScope, ProjectRoomMessageIdConflictError, type ProjectTaskAdmissionListener, type ProjectTaskAdmissionNotification, ProjectTaskAdmissionNotifier, type ProjectTaskAdmissionNotifierOptions, type ProjectTaskAssignmentScope, ProjectTaskOwnerPolicy, type ProjectTaskOwnerPolicyCode, ProjectTaskOwnerPolicyError, type ProjectTaskReassignmentAuthorization, type ProjectTaskReassignmentAuthorizationInput, type ProjectTaskReassignmentAuthorizer, type ProjectTaskReassignmentThreadValidationInput, type ProjectTaskReassignmentThreadValidator, type ProjectTaskRosterScope, PrometheusClient, type ProvisionFileSink, type QueryResult, type QueueLattice, QueueLatticeManager, type QueueMessage, QueueMode, type QueuePendingEvent, type QueueScope, ROOM_COORDINATOR_KEY, type ReassignProjectTaskInput, type ReconcileAllTenantTaskRunsInput, type ReconcileStaleTaskRunsInput, type ReconcileStaleTaskRunsResult, type ReconcileTaskDescriptionInput, type ReconcileTenantTaskRunsInput, type RejectInterruptedTaskInput, RemoteSandboxInstance, RemoteSandboxProvider, type RemoteSandboxProviderConfig, type RepeatedToolCallBreakerOptions, RepeatedToolCallError, type ReplyReadyEvent, type ResidentConnectionConfig, type ResidentDeployment, type ResidentInvokeArgs, type ResidentInvokePayload, type ResidentInvokeResult, type ResidentRoutingDeps, type Resolution, type ResolutionAction, type ResolveAgentFn, type ResolvedConfig, type ResolvedPluginConnection, type ResolvedPluginSkill, type ResumeTaskResult, type RoomAgentCorrelatedInterruptInput, type RoomAgentMessageCallbackFailure, type RoomAgentMessageCommitted, type RoomAgentMessageInput, RoomAgentMessageService, type RoomAgentReplyInput, type RunAsLeaderOptions, type RunAsLeaderResult, type RunSandboxConfig, type RuntimeModelConfig, type RuntimeSkillSelection, SAFE_PATH_COMPONENT, SANDBOX_OPEN_GATEWAY_URL_ENV, SANDBOX_OPEN_TOKEN_ENV, type STTModelInfo, STTModelLattice, type STTModelLatticeInterface, STTModelLatticeManager, type SandboxFileInfo, type SandboxFileService, SandboxFilesystem, type SandboxGrepMatch, type SandboxInstance, type SandboxIsolationLevel, SandboxLatticeManager, type SandboxManagerProtocol, type SandboxOpenClientBundle, type SandboxOpenCredential, type SandboxOpenCredentialContext, type SandboxOpenCredentialProvider, type SandboxOpenCredentialProviderOptions, SandboxPluginExecutor, type SandboxPluginExecutorDeps, type SandboxPluginInvokeArgs, type SandboxPluginResult, type SandboxProvider, type SandboxProviderFactory, type SandboxProviderType, type SandboxResolver, type SandboxRunConfig, type SandboxShellService, SandboxSkillStore, type SandboxSkillStoreOptions, type SandboxVolumeDefinition, type ScheduleLattice, ScheduleLatticeManager, type SchedulerMiddlewareOptions, SemanticMetricsClient, type SettleRunInput, type SettleRunOutcome, type SharePayload, SimpleMemoryVectorStore, type SkillLattice, SkillLatticeManager, type SkillMeta, type SkillResource, SqlDatabaseManager, type StartLifecycleResult, type StartTaskExecutionInput, type StateAndStore, StateBackend, StoreBackend, type StoreLattice, StoreLatticeManager, type StoreType, type StoreTypeMap, type SubmitTaskReviewInput, TASK_RESPONSE_FINAL_WARNING_LIMIT, TASK_RESPONSE_PRIOR_WARNING_LIMIT, TASK_RESPONSE_SCALAR_MAX_BYTES, TOOL_RESULT_TOKEN_LIMIT, TRUNCATION_GUIDANCE, type TableInfo, type TableSchema, type TaskAgentInvocation, type TaskEvent, type TaskExecutionFailure, type TaskExecutionManaged, type TaskExecutionResult, type TaskExecutionServiceDeps, type TaskExecutionSuccess, type TaskLifecycleListener, type TaskLifecycleNotification, TaskLifecycleNotifier, TaskLifecycleService, type TaskLifecycleServiceDeps, type TaskListStore, type TaskResponseParseResult, type TaskRunBridge, type TaskRunBridgeDeps, TaskRunBridgeStoresRequiredError, type TaskRunLeaseHandle, TaskRunRegistry, type TaskSpec, TaskStatus, type TaskUpdatable, TeamAgentGraphBuilder, type TeamConfig, type TeamMiddlewareOptions, type TeamTask, type TeammateSpec, type TeammateToolsOptions, TenantPluginCatalog, type TenantPluginCatalogDeps, type TenantPlugins, type ThreadBuffer, type ThreadBufferConfig, type ThreadBusyEvent, type ThreadEndCode, ThreadEndError, type ThreadIdleEvent, type ThreadInfo, type ThreadQueueConfig, type ThreadRunLeaseHandle, type ThreadState, ThreadStatus, type ThreadStatusChangedEvent, TokenCache, type ToolDefinition, type ToolLattice, ToolLatticeManager, type TransferOwnerInput, type TransferOwnerResult, type TrustedAgentMessageDispatcher, type TrustedMessageOptions, type TryAcquireTaskRunInput, type TryAcquireThreadRunInput, type UnknownToolHandlerConfig, UnsafeUpstreamUrlError, type UnsafeUrlReason, type ValidateManifestArgs, type VectorStoreLatticeInterface, VectorStoreLatticeManager, type VectorStoreProviderLattice, VectorStoreProviderManager, VolumeFilesystem, type VolumeFsClient, type WithLeaseOptions, type WorkflowValidationError, type WriteResult, abortWorkflowRun, agentInstanceManager, agentLatticeManager, appendReconciliationWarning, appendUiFence, assertSafeUpstreamUrl, buildBundleFromDist, buildConnectionPayload, buildGrepResultsDict, buildHandlerCommand, buildInput, buildNamedVolumeName, buildRemotePackDirectoryCommand, buildSandboxMetadataEnv, buildSandboxOpenEnv, buildSkillFile, buildStateAnnotation, buildTableName, buildTaskMutationFallback, buildTaskNormalizationFallback, checkEmptyContent, clearEncryptionKeyCache, clearEvalRunService, clearSandboxOpenCredentialProviderForTests, collectPluginSources, collectionLatticeManager, compileInternal, compileSandboxPlugin, compileWorkflow, computeSandboxName, configureCoordinationLeaseStore, configurePluginCatalogSync, configureStores, connectAllChannels, connectionSecretFields, convertToConnection, createAgentNode, createAgentTeam, createCapabilityGuardMiddleware, createExecuteSqlQueryTool, createFileData, createInfoSqlTool, createListMetricsDataSourcesTool, createListMetricsServersTool, createListTablesSqlTool, createMapNode, createModelSelectorMiddleware, createNodeHandler, createProjectRoomMiddleware, createProjectTaskOwnerPolicy, createProjectTaskReassignmentAuthorizer, createQueryCheckerSqlTool, createQueryMetricDefinitionTool, createQueryMetricsListTool, createQuerySemanticMetricDataTool, createQuerySqlTool, createQueryTableDefinitionTool, createQueryTablesListTool, createRepeatedToolCallBreakerMiddleware, createResourceAddress, createSandboxProvider, createSandboxResolver, createSchedulerMiddleware, createSharePayload, createShellExecTool, createTaskExecutionService, createTaskLifecycleService, createTaskMiddleware, createTaskRunBridge, createTeamMiddleware, createTeammateTools, createTrustedAgentMessageDispatcher, createUnknownToolHandlerMiddleware, createWidgetMiddleware, decrypt, decryptConfigFields, describeCronExpression, disconnectAllChannels, documentLearningPlugin, documentParserPlugin, embeddingsLatticeManager, encodeInput, encrypt, encryptConfigFields, ensureBuiltinAgentsForTenant, ensurePluginSkillInSandbox, evaluateLatticeCaseWithLogs, eventBus, eventBus as eventBusDefault, executionAuthorityRegistry, extractAppsRef, extractFetcherError, extractLegacyRefs, extractOutput, fileDataToString, formatContentWithLineNumbers, formatGrepMatches, formatGrepResults, formatReadResponse, generateDirectBotProjectId, generateDirectHumanProjectId, generateToken, getAgentClient, getAgentClientAsync, getAgentConfig, getAllAgentConfigs, getAllBuiltInSkillMetas, getAllToolDefinitions, getBindingRegistry, getBuiltInSkillContent, getBuiltInSkillMeta, getBuiltInSkillNames, getCheckpointSaver, getChunkBuffer, getCollectionEntryCount, getCoordinationLeaseStore, getEmbeddingsClient, getEmbeddingsLattice, getEncryptionKey, getEvalRunService, getLoggerLattice, getMenuRegistry, getModelLattice, getNextCronTime, getOrCreateCollectionVectorStore, getPluginDeploymentService, getPluginSkillManifestVersion, getQueueLattice, getReplicaId, getRuntimeCapabilityConfig, getRuntimeSkillSelection, getSTTClient, getSTTClientWithTenant, getSTTModelLattice, getSandBoxManager, getSandboxOpenCredential, getSandboxPluginCatalog, getScheduleLattice, getStoreLattice, getThreadRunOwner, getToolClient, getToolClientWithTenant, getToolDefinition, getToolLattice, getVectorStoreClient, getVectorStoreLattice, getVectorStoreProvider, getWorkflowSignal, globSearchFiles, grepMatchesFromFiles, grepSearchFiles, handlerResultText, hasChunkBuffer, hasDelegatedWorkerToken, hasRuntimeCapabilityPolicy, installPluginHost, invokeResident, invokeWithRetry, isBuiltInSkill, isDirectRoom, isMcpConnectionError, isPluginSkillAuthorizedInSandbox, isPluginSkillManagedInSandbox, isUsingDefaultKey, isValidCronExpression, isValidSandboxName, isValidSkillName, jsonSchemaToZod, listCollectionEntries, listSandboxProviderTypes, listTenantPlugins, loggerLatticeManager, mcpManager, mergeCapabilityBundles, mergePluginSkills, mergePluginSources, metricsServerManager, modelLatticeManager, nextBackoffDelay, normalizeSandboxName, ownTaskResponseField, parallelLimit, parseCronExpression, parseDirectRoomType, parseHandlerEnvelope, parseHostArgs, parseJudgeVerdict, parsePackSize, parseSkillFrontmatter, parseTaskResponse, parseYaml, performStringReplacement, pluginHostContentHash, postProcessTaskMutationResponse, prepareTaskDispatch, projectMutationMutex, projectRoomPlugin, projectTaskAdmissionNotifier, provisionSandboxOpenClient, publishPluginCatalogChanged, queueLatticeManager, readLoopBreakerConfig, reconcileAllTenantTaskRuns, reconcileStaleTaskRuns, reconcileTenantTaskRuns, registerAgentLattice, registerAgentLatticeWithTenant, registerAgentLattices, registerCheckpointSaver, registerChunkBuffer, registerEmbeddingsLattice, registerExistingTool, registerExistingToolWithTenant, registerLoggerLattice, registerModelLattice, registerModelLatticeForTenant, registerQueueLattice, registerSTTModelLattice, registerSandboxOpenCredentialProvider, registerSandboxProviderType, registerScheduleLattice, registerStoreLattice, registerTeammateAgent, registerToolLattice, registerVectorStoreLattice, registerVectorStoreProvider, registerWorkflowRun, removeCollectionVectorStore, renderTemplate, resetReplicaIdForTests, resolveEnabledPluginSkill, resolveHandlerTimeoutMs, resolveJudgeModelKey, resolvePath, resolvePluginConnections, resolveSandboxPluginConnections, resolveTenantPluginSkill, roomCoordinatorConfig, runAsLeader, runRemotePackDirectory, safeTaskResponseId, sandboxLatticeManager, sanitizeToolCallId, scheduleLatticeManager, serializePluginMeta, serializeTaskMutationSuccess, serializeTaskNormalizationFallback, serializeTaskReadResponse, setBindingRegistry, setEvalRunService, setMenuRegistry, setPluginDeploymentService, setSandboxPluginCatalog, skillLatticeManager, sqlDatabaseManager, storeLatticeManager, sttModelLatticeManager, taskLifecycleNotifier, taskRunLeaseKey, taskRunRegistry, threadRunLeaseKey, toJsonSchema, toSafeStateExpr, toolLatticeManager, truncateIfTooLong, tryAcquireTaskRun, tryAcquireThreadRun, unregisterTeammateAgent, unregisterWorkflowRun, updateFileData, validateAgentInput, validateCapabilityBundleInput, validateDSL, validateEncryptionKey, validatePackSourcePath, validatePath, validateRelativePath, validateSandboxPluginManifest, validateSkillName, validateToolInput, vectorStoreLatticeManager, vectorStoreProviderManager, withLease, withTimeout, wrapMcpToolWithUi };