@axiom-lattice/core 6.3.3 → 6.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/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.
@@ -11828,6 +11968,80 @@ type GetSandboxFromConfig = (config: RunSandboxConfig) => Promise<SandboxInstanc
11828
11968
  */
11829
11969
  declare function createSandboxResolver(getSandboxFromConfig: GetSandboxFromConfig): SandboxResolver;
11830
11970
 
11971
+ /**
11972
+ * A deployment record consulted for resident routing.
11973
+ *
11974
+ * Structurally satisfied by `PluginDeployment` from `@axiom-lattice/protocols`;
11975
+ * kept minimal so the executor does not depend on the full store contract.
11976
+ */
11977
+ interface ResidentDeployment {
11978
+ /**
11979
+ * Lifecycle status. `"running"` routes directly; a non-running `onDemand`
11980
+ * deployment is resumed once before routing (spec §7.1).
11981
+ */
11982
+ status: string;
11983
+ /** Relative proxy path composed with {@link ResidentRoutingDeps.baseUrl}. */
11984
+ endpoint?: string;
11985
+ /**
11986
+ * Lifecycle strategy. `"onDemand"` enables resume-on-call for a non-running
11987
+ * deployment (and a resume plus a single retry after a failed running call);
11988
+ * `"alwaysOn"` never wakes on call.
11989
+ */
11990
+ mode: string;
11991
+ }
11992
+ /**
11993
+ * Optional dependencies enabling resident-service routing for published plugins.
11994
+ *
11995
+ * When configured, {@link SandboxPluginExecutor.invoke} looks up a deployment
11996
+ * for the invocation's `(tenantId, pluginType)`. A `running` deployment with an
11997
+ * endpoint is invoked over HTTP; a paused/stopped `onDemand` deployment is
11998
+ * resumed via {@link ResidentRoutingDeps.ensureRunning} then invoked (spec
11999
+ * §7.1). Any resident failure degrades to the short-process path by default, so
12000
+ * routing never introduces a new failure mode.
12001
+ *
12002
+ * @remarks
12003
+ * - No host token is used. The optional `serviceKey` is sent to the
12004
+ * sandbox-service proxy as `Authorization: Bearer <serviceKey>`.
12005
+ * - The resident payload forwards `input`, `context`, `connection`,
12006
+ * `connections`, and `timeoutMs`. `timeoutMs` is carried to the host in the
12007
+ * `/invoke` body **and** used as the client-side `AbortController` timeout, so
12008
+ * the host handler timeout and the client abort stay in parity; the
12009
+ * `maxResultBytes` cap is still applied client-side.
12010
+ * - The short-process-only sandbox open-credential env is not injected on the
12011
+ * resident path: the resident host process owns that environment, not the
12012
+ * per-call executor.
12013
+ */
12014
+ interface ResidentRoutingDeps {
12015
+ /**
12016
+ * Resolve the deployment record for a plugin.
12017
+ *
12018
+ * @param tenantId - Tenant owning the plugin.
12019
+ * @param pluginType - Plugin type addressed by the invocation.
12020
+ * @returns The deployment, or undefined when the plugin is not published.
12021
+ */
12022
+ getDeployment(tenantId: string, pluginType: string): Promise<ResidentDeployment | undefined>;
12023
+ /**
12024
+ * Optional single-flight resume/cold-start hook, attempted once after an
12025
+ * `onDemand` resident invocation fails.
12026
+ *
12027
+ * @param tenantId - Tenant owning the plugin.
12028
+ * @param pluginType - Plugin type addressed by the invocation.
12029
+ */
12030
+ ensureRunning?(tenantId: string, pluginType: string): Promise<void>;
12031
+ /** Sandbox-service base URL (`MICROSANDBOX_SERVICE_URL`). */
12032
+ baseUrl: string;
12033
+ /** Sandbox-service API key, sent as `Authorization: Bearer` when present. */
12034
+ serviceKey?: string;
12035
+ /** Injectable fetch implementation (defaults to the global `fetch`). */
12036
+ fetchImpl?: typeof fetch;
12037
+ /**
12038
+ * Fall back to the short-process path when the resident call fails.
12039
+ *
12040
+ * Defaults to `true`. When `false`, a resident failure is returned as a
12041
+ * non-ok {@link SandboxPluginResult} instead.
12042
+ */
12043
+ degradeToShortProcess?: boolean;
12044
+ }
11831
12045
  /** Dependencies required to resolve a tenant sandbox for plugin execution. */
11832
12046
  interface SandboxPluginExecutorDeps {
11833
12047
  /** Resolves the sandbox instance that hosts the tenant plugin. */
@@ -11836,6 +12050,11 @@ interface SandboxPluginExecutorDeps {
11836
12050
  logger?: {
11837
12051
  info: (fields: Record<string, unknown>, message?: string) => void;
11838
12052
  };
12053
+ /**
12054
+ * Optional resident-service routing. When absent, every invocation uses the
12055
+ * short-process `node <handler>` path (unchanged legacy behavior).
12056
+ */
12057
+ resident?: ResidentRoutingDeps;
11839
12058
  }
11840
12059
  /** Arguments for a single sandbox plugin handler invocation. */
11841
12060
  interface SandboxPluginInvokeArgs {
@@ -11872,8 +12091,18 @@ interface SandboxPluginResult {
11872
12091
  result?: unknown;
11873
12092
  /** Error message when `ok` is false. */
11874
12093
  error?: string;
11875
- /** Process exit code returned by the sandbox shell. */
12094
+ /**
12095
+ * Normalized process-like exit code: `0` on success, `1` on failure.
12096
+ *
12097
+ * On the resident path this is normalized from the handler outcome rather
12098
+ * than carrying the upstream HTTP status (see {@link httpStatus}).
12099
+ */
11876
12100
  exitCode: number;
12101
+ /**
12102
+ * Upstream HTTP status from the resident host, present only when the resident
12103
+ * path produced a response. The short-process path leaves this undefined.
12104
+ */
12105
+ httpStatus?: number;
11877
12106
  /** Wall-clock duration of the invocation in milliseconds. */
11878
12107
  durationMs: number;
11879
12108
  /** Raw stdout captured from the handler. */
@@ -11889,15 +12118,105 @@ interface SandboxPluginResult {
11889
12118
  * written to `connection.json` under a per-call temp dir as an
11890
12119
  * `{ connection?, connections? }` envelope. The handler writes its result to
11891
12120
  * stdout as `{ ok, result }` or plain text. Node never evaluates handler code.
12121
+ *
12122
+ * When {@link SandboxPluginExecutorDeps.resident} is configured, a `running`
12123
+ * deployment with an endpoint for the invocation's `(tenantId, pluginType)`
12124
+ * runs the handler inside the plugin's resident service over HTTP; a paused or
12125
+ * stopped `onDemand` deployment is resumed first (spec §7.1).
11892
12126
  */
11893
12127
  declare class SandboxPluginExecutor {
11894
12128
  private readonly deps;
11895
12129
  /**
11896
- * @param deps - Sandbox resolver and optional logger
12130
+ * @param deps - Sandbox resolver, optional logger, and optional resident routing
11897
12131
  */
11898
12132
  constructor(deps: SandboxPluginExecutorDeps);
11899
12133
  /**
11900
- * Invoke a plugin handler inside the tenant sandbox shell.
12134
+ * Invoke a plugin handler.
12135
+ *
12136
+ * Routes to the published plugin's resident service when {@link
12137
+ * SandboxPluginExecutorDeps.resident} is configured and a deployment is
12138
+ * routable (`running` with an endpoint, or a resumed `onDemand` deployment).
12139
+ * Otherwise, or when the resident call fails and degradation is enabled, runs
12140
+ * the handler as a short `node <handler>` process inside the tenant sandbox.
12141
+ *
12142
+ * @param args - Invocation arguments including manifest, handler, and input
12143
+ * @returns The normalized handler result, exit code, timing, and raw stdout
12144
+ * @throws When `args.handler` is not a safe relative path
12145
+ */
12146
+ invoke(args: SandboxPluginInvokeArgs): Promise<SandboxPluginResult>;
12147
+ /**
12148
+ * Attempt to route an invocation to a published plugin's resident service.
12149
+ *
12150
+ * @param args - Invocation arguments
12151
+ * @param resident - Resident routing dependencies
12152
+ * @param started - Invocation start timestamp used for `durationMs`
12153
+ * @returns A terminal result (success, or failure with degradation disabled),
12154
+ * or `undefined` when the caller should fall back to the short-process path
12155
+ */
12156
+ private tryResident;
12157
+ /**
12158
+ * Normalize a resident invocation outcome into the caller-facing result.
12159
+ *
12160
+ * @param outcome - Normalized resident transport result
12161
+ * @param args - Invocation arguments (for the result-size cap)
12162
+ * @param resident - Resident routing dependencies (degradation policy)
12163
+ * @param pluginType - Plugin type, for diagnostics
12164
+ * @param tenantId - Tenant owning the plugin, for diagnostics
12165
+ * @param started - Invocation start timestamp used for `durationMs`
12166
+ * @returns The normalized result, or `undefined` when the caller should fall
12167
+ * back to the short-process path
12168
+ */
12169
+ private finalizeResident;
12170
+ /**
12171
+ * Look up a deployment, degrading to `undefined` when the lookup throws.
12172
+ *
12173
+ * @param resident - Resident routing dependencies
12174
+ * @param tenantId - Tenant owning the plugin
12175
+ * @param pluginType - Plugin type addressed by the invocation
12176
+ * @returns The deployment, or `undefined` when absent or lookup failed
12177
+ */
12178
+ private lookupDeployment;
12179
+ /**
12180
+ * Resume a non-running `onDemand` deployment once, then invoke it.
12181
+ *
12182
+ * Re-reads the deployment after the resume so a cold-started endpoint is
12183
+ * picked up. Never throws: a failed resume or a deployment that is still not
12184
+ * `running` with an endpoint resolves to `undefined`, letting the caller use
12185
+ * the short-process path.
12186
+ *
12187
+ * @param resident - Resident routing dependencies
12188
+ * @param tenantId - Tenant owning the plugin
12189
+ * @param pluginType - Plugin type addressed by the invocation
12190
+ * @param payload - Invocation payload
12191
+ * @param timeoutMs - Clamped per-call timeout
12192
+ * @returns The resident outcome when routed, or `undefined` to short-process
12193
+ */
12194
+ private wakeOnDemand;
12195
+ /**
12196
+ * Resume an `onDemand` deployment once and retry the resident call once.
12197
+ *
12198
+ * @param resident - Resident routing dependencies
12199
+ * @param tenantId - Tenant owning the plugin
12200
+ * @param pluginType - Plugin type addressed by the invocation
12201
+ * @param endpoint - Endpoint used by the first attempt
12202
+ * @param payload - Invocation payload
12203
+ * @param timeoutMs - Clamped per-call timeout
12204
+ * @param firstOutcome - Failed first attempt, returned when resume fails
12205
+ * @returns The retry outcome, or `firstOutcome` when resume itself failed
12206
+ */
12207
+ private ensureRunningAndRetry;
12208
+ /**
12209
+ * Invoke the resident host over the sandbox-service proxy path.
12210
+ *
12211
+ * @param resident - Resident routing dependencies
12212
+ * @param endpointPath - Relative proxy path
12213
+ * @param payload - Invocation payload matching the host contract
12214
+ * @param timeoutMs - Clamped per-call timeout
12215
+ * @returns The normalized resident invocation result
12216
+ */
12217
+ private callResident;
12218
+ /**
12219
+ * Invoke a plugin handler as a short `node <handler>` process.
11901
12220
  *
11902
12221
  * Resolves the sandbox, injects small input as a base64 env var (or writes a
11903
12222
  * temp `input.json` for large input), writes connection credentials to a temp
@@ -11907,10 +12226,10 @@ declare class SandboxPluginExecutor {
11907
12226
  * in all cases, including setup failures.
11908
12227
  *
11909
12228
  * @param args - Invocation arguments including manifest, handler, and input
12229
+ * @param started - Invocation start timestamp used for `durationMs`
11910
12230
  * @returns The normalized handler result, exit code, timing, and raw stdout
11911
- * @throws When `args.handler` is not a safe relative path
11912
12231
  */
11913
- invoke(args: SandboxPluginInvokeArgs): Promise<SandboxPluginResult>;
12232
+ private invokeShortProcess;
11914
12233
  }
11915
12234
 
11916
12235
  /** Arguments accepted by {@link compileSandboxPlugin}. */
@@ -12223,6 +12542,168 @@ declare function getSandboxPluginCatalog(): TenantPluginCatalog;
12223
12542
  */
12224
12543
  declare function setSandboxPluginCatalog(instance: TenantPluginCatalog | null): void;
12225
12544
 
12545
+ /**
12546
+ * Process-wide accessor for the host-injected plugin deployment service.
12547
+ *
12548
+ * The resident-service orchestration (`PluginDeploymentService`) lives in the
12549
+ * gateway, but the `manage_plugin` middleware runs in core. To keep core free
12550
+ * of any gateway import, the gateway registers its service here at startup and
12551
+ * core reaches it through this structural seam — mirroring how
12552
+ * {@link getSandboxPluginCatalog} is a process-wide accessor.
12553
+ *
12554
+ * The interface stays minimal: the three lifecycle operations the
12555
+ * `manage_plugin` tool needs (`deploy`/`undeploy`/`status`) plus the two
12556
+ * read/resume primitives the catalog executor needs to route a tool call to a
12557
+ * resident service (`getDeployment`/`ensureRunning`). Core never depends on the
12558
+ * concrete service.
12559
+ *
12560
+ * @remarks
12561
+ * When no service is registered the accessor returns `null`; the `manage_plugin`
12562
+ * actions degrade to a diagnostic instead of throwing (ADR-097 invariant), and
12563
+ * the catalog executor takes the short-process path unchanged.
12564
+ */
12565
+ /** Lifecycle strategy for a resident plugin deployment. */
12566
+ type PluginDeploymentServiceMode = "onDemand" | "alwaysOn";
12567
+ /** Options accepted when deploying a resident plugin service. */
12568
+ interface PluginDeploymentServiceDeployOptions {
12569
+ /** Lifecycle strategy; defaults to the deployment service's own default. */
12570
+ mode?: PluginDeploymentServiceMode;
12571
+ /** On-demand idle timeout override, in milliseconds. */
12572
+ idleTimeoutMs?: number;
12573
+ }
12574
+ /** Minimal deploy outcome surfaced through `manage_plugin deploy`. */
12575
+ interface PluginDeploymentServiceDeployResult {
12576
+ /** Durable deployment status (e.g. `"running"`). */
12577
+ status: string;
12578
+ /** Resolved endpoint route, when known. */
12579
+ endpoint?: string;
12580
+ /** Lifecycle strategy, when known. */
12581
+ mode?: string;
12582
+ }
12583
+ /** Minimal undeploy outcome surfaced through `manage_plugin undeploy`. */
12584
+ interface PluginDeploymentServiceUndeployResult {
12585
+ /** Whether a deployment record was removed. */
12586
+ undeployed: boolean;
12587
+ }
12588
+ /** One row in the tenant-wide deployment list surfaced through `manage_plugin deployments`. */
12589
+ interface PluginDeploymentServiceListEntry {
12590
+ /** Plugin type (directory key). */
12591
+ pluginType: string;
12592
+ /** Durable deployment status. */
12593
+ status: string;
12594
+ /** Lifecycle strategy. */
12595
+ mode: string;
12596
+ /** Resolved endpoint route, when known. */
12597
+ endpoint?: string;
12598
+ /** ISO timestamp of the last health observation. */
12599
+ lastHealthAt?: string;
12600
+ /** Most recent health error, when unhealthy. */
12601
+ lastError?: string;
12602
+ }
12603
+ /** Minimal status view surfaced through `manage_plugin status`. */
12604
+ interface PluginDeploymentServiceStatus {
12605
+ /** Durable status, or `"absent"` when no deployment exists. */
12606
+ status: string;
12607
+ /** Resolved endpoint route, when known. */
12608
+ endpoint?: string;
12609
+ /** Lifecycle strategy, when known. */
12610
+ mode?: string;
12611
+ /** ISO timestamp of the last health observation. */
12612
+ lastHealthAt?: string;
12613
+ /** Most recent health error, when unhealthy. */
12614
+ lastError?: string;
12615
+ }
12616
+ /**
12617
+ * Structural contract the gateway's `PluginDeploymentService` satisfies.
12618
+ *
12619
+ * Core depends only on this shape, so the concrete gateway class can be
12620
+ * installed without a cross-package import.
12621
+ */
12622
+ interface PluginDeploymentServiceLike {
12623
+ /**
12624
+ * Provision (or idempotently reuse) a resident service for a plugin.
12625
+ *
12626
+ * @param tenantId - Tenant that owns the plugin.
12627
+ * @param pluginType - Plugin type (directory key).
12628
+ * @param options - Lifecycle mode and overrides.
12629
+ */
12630
+ deploy(tenantId: string, pluginType: string, options?: PluginDeploymentServiceDeployOptions): Promise<PluginDeploymentServiceDeployResult>;
12631
+ /**
12632
+ * Tear down a resident service and its deployment record.
12633
+ *
12634
+ * @param tenantId - Tenant that owns the plugin.
12635
+ * @param pluginType - Plugin type.
12636
+ */
12637
+ undeploy(tenantId: string, pluginType: string): Promise<PluginDeploymentServiceUndeployResult>;
12638
+ /**
12639
+ * Read a deployment's durable status, refreshing it with a live health probe.
12640
+ *
12641
+ * @param tenantId - Tenant that owns the plugin.
12642
+ * @param pluginType - Plugin type.
12643
+ */
12644
+ status(tenantId: string, pluginType: string): Promise<PluginDeploymentServiceStatus>;
12645
+ /**
12646
+ * List every resident deployment for a tenant.
12647
+ *
12648
+ * Backs the read-only `manage_plugin deployments` view. Reads the durable
12649
+ * store directly and never probes the resident host.
12650
+ *
12651
+ * @param tenantId - Tenant whose deployments are listed.
12652
+ * @returns One entry per deployment, newest semantics defined by the store.
12653
+ */
12654
+ list(tenantId: string): Promise<PluginDeploymentServiceListEntry[]>;
12655
+ /**
12656
+ * Read a deployment's stored record without probing the resident host.
12657
+ *
12658
+ * The catalog executor uses this to decide whether a tool call should be
12659
+ * routed to the resident service. Unlike {@link status} this never issues a
12660
+ * `/health` probe and resolves `undefined` when no record exists.
12661
+ *
12662
+ * @param tenantId - Tenant that owns the plugin.
12663
+ * @param pluginType - Plugin type.
12664
+ * @returns The minimal `{ status, endpoint, mode }` view, or `undefined`.
12665
+ */
12666
+ getDeployment(tenantId: string, pluginType: string): Promise<{
12667
+ status: string;
12668
+ endpoint?: string;
12669
+ mode: string;
12670
+ } | undefined>;
12671
+ /**
12672
+ * Ensure an existing on-demand deployment is running and healthy.
12673
+ *
12674
+ * The catalog executor calls this to resume a paused/stopped `onDemand`
12675
+ * deployment before a resident invocation. It resolves once the deployment is
12676
+ * running; it is a no-op when the deployment is already running.
12677
+ *
12678
+ * @param tenantId - Tenant that owns the plugin.
12679
+ * @param pluginType - Plugin type.
12680
+ */
12681
+ ensureRunning(tenantId: string, pluginType: string): Promise<void>;
12682
+ }
12683
+ /**
12684
+ * Install (or clear) the process-wide plugin deployment service.
12685
+ *
12686
+ * The gateway calls this at startup with its real service; tests inject a fake.
12687
+ *
12688
+ * @param instance - Service to install, or `undefined`/`null` to reset.
12689
+ * @returns Nothing
12690
+ *
12691
+ * @example
12692
+ * ```ts
12693
+ * setPluginDeploymentService(new PluginDeploymentService({ ...deps }));
12694
+ * // later, at shutdown or in tests:
12695
+ * setPluginDeploymentService(undefined);
12696
+ * ```
12697
+ */
12698
+ declare function setPluginDeploymentService(instance: PluginDeploymentServiceLike | null | undefined): void;
12699
+ /**
12700
+ * Read the installed plugin deployment service.
12701
+ *
12702
+ * @returns The registered service, or `null` when none is installed (the
12703
+ * `manage_plugin` deploy/undeploy/status actions then return a diagnostic).
12704
+ */
12705
+ declare function getPluginDeploymentService(): PluginDeploymentServiceLike | null;
12706
+
12226
12707
  /**
12227
12708
  * Plugin skill definition resolved together with its owning plugin type.
12228
12709
  *
@@ -12348,6 +12829,362 @@ declare function provisionSandboxOpenClient(sandbox: {
12348
12829
  */
12349
12830
  declare function buildBundleFromDist(distDir: string, version: string): SandboxOpenClientBundle;
12350
12831
 
12832
+ /**
12833
+ * Process-local runtime cache for published plugin deployments.
12834
+ *
12835
+ * The authoritative deployment state lives in the `PluginDeployment` store
12836
+ * (Plan 3). This registry only caches the resolved proxy endpoint and the last
12837
+ * observed health for the lifetime of a single Gateway process, and coalesces
12838
+ * concurrent {@link PluginDeploymentRuntimeRegistry.ensureRunning} calls so a
12839
+ * cold start (or resume) is performed at most once per key at a time.
12840
+ *
12841
+ * Keys are `${tenantId}:${pluginType}`. Every method receives that composed
12842
+ * key as its `id` argument.
12843
+ */
12844
+ /** Last observed health for one cached deployment. */
12845
+ interface PluginDeploymentRuntimeHealth {
12846
+ /** Epoch milliseconds of the most recent health observation. */
12847
+ lastHealthAt?: number;
12848
+ /** Most recent health error, cleared by a subsequent healthy mark. */
12849
+ lastError?: string;
12850
+ }
12851
+ /** Constructor options for {@link PluginDeploymentRuntimeRegistry}. */
12852
+ interface PluginDeploymentRuntimeRegistryOptions {
12853
+ /** Injectable clock (defaults to `Date.now`) used for health timestamps. */
12854
+ now?: () => number;
12855
+ }
12856
+ /**
12857
+ * In-process cache of plugin deployment endpoints and health, with single-flight
12858
+ * cold start.
12859
+ *
12860
+ * @remarks
12861
+ * - Not shared across processes. Multi-Gateway correctness relies on the store
12862
+ * being the authority and on callers re-resolving the endpoint when needed.
12863
+ * - `ensureRunning` is single-flight per `id`: concurrent callers share one
12864
+ * factory execution, and the in-flight entry is cleared once it settles
12865
+ * (success or failure) so a later call may retry.
12866
+ *
12867
+ * @example
12868
+ * ```ts
12869
+ * const registry = new PluginDeploymentRuntimeRegistry();
12870
+ * registry.setEndpoint("t1:weather", "/api/sandboxes/plugin-abc/proxy/8080");
12871
+ * await registry.ensureRunning("t1:weather", () => service.startSandbox());
12872
+ * ```
12873
+ */
12874
+ declare class PluginDeploymentRuntimeRegistry {
12875
+ private readonly entries;
12876
+ private readonly inFlight;
12877
+ private readonly now;
12878
+ /**
12879
+ * @param options - Optional injectable clock for deterministic health timestamps.
12880
+ */
12881
+ constructor(options?: PluginDeploymentRuntimeRegistryOptions);
12882
+ /**
12883
+ * Cache the resolved proxy endpoint for a deployment.
12884
+ *
12885
+ * @param id - Composed key `${tenantId}:${pluginType}`.
12886
+ * @param endpoint - Relative proxy path, e.g. `/api/sandboxes/plugin-abc/proxy/8080`.
12887
+ */
12888
+ setEndpoint(id: string, endpoint: string): void;
12889
+ /**
12890
+ * Read the cached endpoint for a deployment.
12891
+ *
12892
+ * @param id - Composed key `${tenantId}:${pluginType}`.
12893
+ * @returns The cached endpoint, or `undefined` when none is known.
12894
+ */
12895
+ getEndpoint(id: string): string | undefined;
12896
+ /**
12897
+ * Record a successful health observation and clear any prior error.
12898
+ *
12899
+ * @param id - Composed key `${tenantId}:${pluginType}`.
12900
+ */
12901
+ markHealthy(id: string): void;
12902
+ /**
12903
+ * Record a failed health observation.
12904
+ *
12905
+ * @param id - Composed key `${tenantId}:${pluginType}`.
12906
+ * @param error - Human-readable failure description.
12907
+ */
12908
+ markUnhealthy(id: string, error: string): void;
12909
+ /**
12910
+ * Read the last observed health for a deployment.
12911
+ *
12912
+ * @param id - Composed key `${tenantId}:${pluginType}`.
12913
+ * @returns The cached health, or `undefined` when the id is unknown.
12914
+ */
12915
+ getHealth(id: string): PluginDeploymentRuntimeHealth | undefined;
12916
+ /**
12917
+ * Run a cold start/resume factory at most once per id at a time.
12918
+ *
12919
+ * Concurrent calls for the same id return the same in-flight promise and run
12920
+ * `factory` exactly once. The in-flight entry is cleared when the factory
12921
+ * settles, so a later call runs it again (retry after failure is allowed).
12922
+ *
12923
+ * @param id - Composed key `${tenantId}:${pluginType}`.
12924
+ * @param factory - Idempotent start/resume operation for the resident service.
12925
+ * @returns A promise that settles with the factory outcome.
12926
+ */
12927
+ ensureRunning(id: string, factory: () => Promise<void>): Promise<void>;
12928
+ /**
12929
+ * Drop cached endpoint and health for one deployment.
12930
+ *
12931
+ * @param id - Composed key `${tenantId}:${pluginType}`.
12932
+ */
12933
+ clear(id: string): void;
12934
+ /** Drop all cached endpoints, health, and in-flight coordination entries. */
12935
+ reset(): void;
12936
+ private entry;
12937
+ }
12938
+
12939
+ /**
12940
+ * HTTP transport for invoking a published plugin's resident service.
12941
+ *
12942
+ * The resident host server (installed into the plugin sandbox) exposes
12943
+ * `POST /invoke` on a published guest port. In production the request travels
12944
+ * through `microsandbox-service`, whose scoped `/api/sandboxes/:name/proxy/:port/*`
12945
+ * proxy is gated by the service API key (`Authorization: Bearer <serviceKey>`)
12946
+ * and strips that key before forwarding. The host itself requires no auth: the
12947
+ * authenticated proxy route plus the loopback-bound published port are the
12948
+ * security boundary.
12949
+ */
12950
+ /** Default per-invocation timeout for a resident plugin call. */
12951
+ declare const DEFAULT_RESIDENT_INVOKE_TIMEOUT_MS = 60000;
12952
+ /** Normalized result of a resident plugin invocation. */
12953
+ interface ResidentInvokeResult {
12954
+ /** Whether the host reported success. */
12955
+ ok: boolean;
12956
+ /** Handler result payload when `ok` is true. */
12957
+ result?: unknown;
12958
+ /** Human-readable error when `ok` is false. */
12959
+ error?: string;
12960
+ /** Upstream HTTP status when a response was received. */
12961
+ status?: number;
12962
+ }
12963
+ /** One named connection config passed to a resident plugin handler. */
12964
+ interface ResidentConnectionConfig {
12965
+ /** Connection key the plugin references. */
12966
+ key: string;
12967
+ /** Decrypted connection config. */
12968
+ config: Record<string, unknown>;
12969
+ }
12970
+ /** Request body accepted by the resident host server's `/invoke` endpoint. */
12971
+ interface ResidentInvokePayload {
12972
+ /** Plugin-directory-relative handler path from the manifest. */
12973
+ handler: string;
12974
+ /** Tool input. */
12975
+ input: unknown;
12976
+ /** Single resolved connection config (when the caller resolved one). */
12977
+ connection?: Record<string, unknown>;
12978
+ /** Full multi-connection list keyed by connection key. */
12979
+ connections?: ResidentConnectionConfig[];
12980
+ /** Trusted execution context strings (tenant, plugin type, ...). */
12981
+ context: Record<string, string>;
12982
+ /**
12983
+ * Per-call handler timeout, forwarded to the host as its child-process
12984
+ * timeout so the resident path honors the caller's value (not just the
12985
+ * client-side abort). Falls back to {@link ResidentInvokeArgs.timeoutMs}.
12986
+ */
12987
+ timeoutMs?: number;
12988
+ }
12989
+ /** Arguments for {@link invokeResident}. */
12990
+ interface ResidentInvokeArgs {
12991
+ /** Configured sandbox-service base URL, e.g. `http://service:4002`. */
12992
+ baseUrl: string;
12993
+ /** Relative proxy path, e.g. `/api/sandboxes/plugin-abc/proxy/8080`. */
12994
+ endpointPath: string;
12995
+ /** Sandbox-service API key (sent as `Authorization: Bearer` when present). */
12996
+ serviceKey?: string;
12997
+ /** Invocation payload matching the host `/invoke` contract. */
12998
+ payload: ResidentInvokePayload;
12999
+ /** Override the per-invocation timeout. */
13000
+ timeoutMs?: number;
13001
+ /** Injectable fetch implementation (defaults to the global `fetch`). */
13002
+ fetchImpl?: typeof fetch;
13003
+ }
13004
+ /**
13005
+ * Invoke a resident plugin handler over the sandbox-service proxy path.
13006
+ *
13007
+ * Builds `POST ${baseUrl}${endpointPath}/invoke`, sends the sandbox-service
13008
+ * key in `Authorization: Bearer <serviceKey>` (when supplied), and normalizes
13009
+ * the host envelope. It never throws: non-2xx responses, malformed bodies,
13010
+ * network failures, and timeouts all resolve to `{ ok: false, error }`.
13011
+ *
13012
+ * @param args - Invocation arguments (see {@link ResidentInvokeArgs}).
13013
+ * @returns The normalized invocation result.
13014
+ *
13015
+ * @example
13016
+ * ```ts
13017
+ * const result = await invokeResident({
13018
+ * baseUrl: process.env.MICROSANDBOX_SERVICE_URL ?? "",
13019
+ * endpointPath: deployment.endpoint,
13020
+ * serviceKey: process.env.MICROSANDBOX_API_KEY,
13021
+ * payload: { handler: "handlers/weather.js", input: { city: "SF" }, context: { tenantId } },
13022
+ * });
13023
+ * ```
13024
+ */
13025
+ declare function invokeResident(args: ResidentInvokeArgs): Promise<ResidentInvokeResult>;
13026
+
13027
+ /**
13028
+ * Pure protocol helpers shared by the in-sandbox plugin host server.
13029
+ *
13030
+ * These functions are intentionally dependency-free (no imports from other core
13031
+ * modules) so they can be embedded verbatim inside the self-contained
13032
+ * `PLUGIN_HOST_SERVER_SOURCE` script that runs in the bare sandbox image. Keep
13033
+ * any change to this file mirrored in `pluginHostSource.ts`.
13034
+ */
13035
+ /** Maximum serialized input size that travels inline as a base64 env var. */
13036
+ declare const INLINE_INPUT_LIMIT_BYTES: number;
13037
+ /** Default child-process handler timeout for `/invoke` (60s). */
13038
+ declare const DEFAULT_HANDLER_TIMEOUT_MS = 60000;
13039
+ /** Lower bound for a caller-supplied `/invoke` handler timeout (1s). */
13040
+ declare const MIN_HANDLER_TIMEOUT_MS = 1000;
13041
+ /** Upper bound for a caller-supplied `/invoke` handler timeout (5min). */
13042
+ declare const MAX_HANDLER_TIMEOUT_MS = 300000;
13043
+ /** Parsed `--type`/`--port` arguments for the host server process. */
13044
+ interface HostArgs {
13045
+ /** Plugin type the host server is serving (e.g. `"weather"`). */
13046
+ type: string;
13047
+ /** TCP port the HTTP server binds. */
13048
+ port: number;
13049
+ }
13050
+ /** Normalized `{ ok, result?, error? }` envelope returned to the caller. */
13051
+ interface HandlerEnvelope {
13052
+ /** Whether the handler reported success. */
13053
+ ok: boolean;
13054
+ /** Handler result payload when `ok` is true. */
13055
+ result?: unknown;
13056
+ /** Human-readable error when `ok` is false. */
13057
+ error?: string;
13058
+ }
13059
+ /** Connection selection passed to {@link buildConnectionPayload}. */
13060
+ interface ConnectionPayloadInput {
13061
+ /** Single connection config (used when no `connections` list is given). */
13062
+ connection?: Record<string, unknown>;
13063
+ /** Multiple connection configs keyed by connection key. */
13064
+ connections?: Array<{
13065
+ key: string;
13066
+ config: Record<string, unknown>;
13067
+ }>;
13068
+ }
13069
+ /**
13070
+ * Parse the host server's `--type` and `--port` argv values.
13071
+ *
13072
+ * Accepts both the spaced (`--type weather`) and joined (`--type=weather`)
13073
+ * forms. Scans all tokens, so the leading `node`/`server.js` entries are safe.
13074
+ *
13075
+ * @param argv - Process argv array (typically `process.argv`)
13076
+ * @returns The parsed plugin type and port
13077
+ * @throws When `--type` is missing/empty or `--port` is not an integer in 1..65535
13078
+ */
13079
+ declare function parseHostArgs(argv: readonly string[]): HostArgs;
13080
+ /**
13081
+ * Resolve the child-process handler timeout for a `/invoke` request.
13082
+ *
13083
+ * Keeps the resident host's handler timeout at parity with the caller's
13084
+ * `SandboxPluginExecutor` timeout: the caller forwards its clamped timeout in
13085
+ * the request body so a custom value (e.g. 5s) is honored end-to-end instead of
13086
+ * the client aborting while the host keeps running the handler.
13087
+ *
13088
+ * @param value - Raw `body.timeoutMs`; absent/non-finite falls back to the default
13089
+ * @returns The timeout in milliseconds, clamped to 1s..5min
13090
+ */
13091
+ declare function resolveHandlerTimeoutMs(value: unknown): number;
13092
+ /**
13093
+ * Extract a normalized envelope from handler output that may contain stderr
13094
+ * noise (Node warnings, logs) merged into stdout.
13095
+ *
13096
+ * Whole-output JSON is tried first, then lines are scanned bottom-up for the
13097
+ * last object with a boolean `ok`. Empty output yields an explicit failure;
13098
+ * any other non-envelope output is treated as plain-text success. Mirrors
13099
+ * `SandboxPluginExecutor`'s envelope semantics.
13100
+ *
13101
+ * @param stdout - Combined handler output
13102
+ * @returns The normalized envelope
13103
+ */
13104
+ declare function parseHandlerEnvelope(stdout: string): HandlerEnvelope;
13105
+ /**
13106
+ * Build the shell command that runs a plugin handler with `node`.
13107
+ *
13108
+ * The handler path is single-quote escaped as a literal POSIX shell argument.
13109
+ *
13110
+ * @param handlerPath - Absolute handler path
13111
+ * @returns A `node '<handlerPath>'` command string
13112
+ */
13113
+ declare function buildHandlerCommand(handlerPath: string): string;
13114
+ /**
13115
+ * Base64-encode a value as UTF-8 JSON for transport through a shell env var.
13116
+ *
13117
+ * @param input - Value to serialize; `null`/`undefined` become JSON `null`
13118
+ * @returns Base64-encoded JSON string
13119
+ */
13120
+ declare function encodeInput(input: unknown): string;
13121
+ /**
13122
+ * Build the `connection.json` envelope from an invocation's connection fields.
13123
+ *
13124
+ * The envelope is always an object so a handler can read a single connection
13125
+ * (`connection`) and/or the full multi-connection list (`connections`)
13126
+ * regardless of how many connections the caller selected. Mirrors
13127
+ * `SandboxPluginExecutor.buildConnectionPayload`.
13128
+ *
13129
+ * @param args - Connection selection
13130
+ * @returns The envelope, or `null` when no connection payload was supplied
13131
+ */
13132
+ declare function buildConnectionPayload(args: ConnectionPayloadInput): Record<string, unknown> | null;
13133
+
13134
+ /** Content version of the in-sandbox host server. Bump on any behavior change. */
13135
+ declare const PLUGIN_HOST_VERSION = "1.1.0";
13136
+ /**
13137
+ * Self-contained Node HTTP server installed at `/root/.agents/.plugin-host/server.js`.
13138
+ *
13139
+ * Serves `GET /health`, `GET /meta`, and `POST /invoke` (no in-host auth; the
13140
+ * service-key-authenticated proxy + loopback binding are the boundary). On
13141
+ * invoke it writes input/connection temp files, runs `node <handler>` as a
13142
+ * short child process (mirroring the existing `SandboxPluginExecutor` env/file
13143
+ * contract), and returns the parsed stdout envelope. It reads `--type`/`--port`
13144
+ * from argv.
13145
+ *
13146
+ * @remarks
13147
+ * This string carries **no monorepo imports** — it executes in the bare sandbox
13148
+ * image with only Node available. The pure helpers in `pluginHostProtocol.ts`
13149
+ * are inlined here because the script cannot import them; keep the two in sync.
13150
+ */
13151
+ declare const PLUGIN_HOST_SERVER_SOURCE: string;
13152
+ /**
13153
+ * Content hash of the host server source (cache/versioning key).
13154
+ *
13155
+ * @returns A stable 16-character hex digest of `version:source`
13156
+ */
13157
+ declare function pluginHostContentHash(): string;
13158
+
13159
+ /** Reserved directory for the tenant plugin host runtime. */
13160
+ declare const PLUGIN_HOST_DIR = "/root/.agents/.plugin-host";
13161
+ /** Result of installing the in-sandbox plugin host server. */
13162
+ interface InstallPluginHostResult {
13163
+ /** Sandbox-visible path of the installed host server script. */
13164
+ path: string;
13165
+ /** Content version of the installed host server. */
13166
+ version: string;
13167
+ /** Content hash of the installed host server. */
13168
+ hash: string;
13169
+ /** Whether files were written (`false` when already current). */
13170
+ changed: boolean;
13171
+ }
13172
+ /**
13173
+ * Ensure the in-sandbox plugin host server is present and current.
13174
+ *
13175
+ * Reads `version.json` and skips all writes when its hash already matches
13176
+ * {@link pluginHostContentHash}; otherwise creates the reserved directory and
13177
+ * writes both `server.js` and `version.json`.
13178
+ *
13179
+ * @param sandbox - Resolved tenant sandbox (caller resolves via SandboxLatticeManager)
13180
+ * @returns Install result with the written path, version, hash, and whether it changed
13181
+ * @example
13182
+ * ```ts
13183
+ * const { changed } = await installPluginHost(sandbox);
13184
+ * ```
13185
+ */
13186
+ declare function installPluginHost(sandbox: SandboxInstance): Promise<InstallPluginHostResult>;
13187
+
12351
13188
  /** Stable failure codes emitted when capability bundles cannot be composed. */
12352
13189
  type CapabilityBundleMergeErrorCode = "CAPABILITY_BUNDLE_DUPLICATE_ID" | "CAPABILITY_BUNDLE_EMPTY_ALLOWED_TOOLS" | "CAPABILITY_BUNDLE_INVALID_CONFIG" | "CAPABILITY_BUNDLE_NULL_VALUE" | "CAPABILITY_BUNDLE_UNSAFE_KEY";
12353
13190
  /** Describes invalid capability bundle input rejected by the pure merger. */
@@ -13506,4 +14343,4 @@ declare function parseDirectRoomType(projectId: string): "human" | "bot" | null;
13506
14343
  */
13507
14344
  declare function isDirectRoom(projectId: string): boolean;
13508
14345
 
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 };
14346
+ 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 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, 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 };