@axiom-lattice/core 4.2.1 → 4.2.3

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,9 +8,9 @@ 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, MessageChunk, MessageChunkType, QueueLatticeProtocol, QueueConfig, QueueClient, QueueResult, ScheduleLatticeProtocol, ScheduleConfig, ScheduleClient, ScheduleStorage, TaskHandler, ScheduleOnceOptions, ScheduleCronOptions, ScheduledTaskDefinition, ScheduledTaskStatus, ScheduleExecutionType, ThreadStore, AssistantStore, SkillStore, CollectionStore, WorkspaceStore, ProjectStore, DatabaseConfigStore, MetricsServerConfigStore, McpServerConfigStore, UserStore, TenantStore, UserTenantLinkStore, WorkflowTrackingStore, EvalStore, ChannelInstallationStore, BindingRegistry, MenuRegistry, A2AApiKeyStore, TaskStore, SharedResourceStore, ConnectionStore, TaskWorkItemStore, AgentWebAppStore, CapabilityBundleStore, VectorStoreProvider, Thread, CreateThreadRequest, Assistant, CreateAssistantRequest, AgentWebApp, CreateAgentWebAppInput, AgentWebAppStorePatch, AgentWebAppUpdateOptions, Project, CreateProjectRequest, UpdateProjectRequest, UpdateProjectCapabilityBundlesResult, CapabilityBundle, InternalCreateCapabilityBundleInput, InternalUpdateCapabilityBundleInput, CapabilityBundleDeleteResult, Skill, CreateSkillRequest, SkillStoreContext, DatabaseConfigEntry, CreateDatabaseConfigRequest, UpdateDatabaseConfigRequest, User, CreateUserRequest, UpdateUserRequest, Tenant, CreateTenantRequest, UpdateTenantRequest, UserTenantLink, CreateUserTenantLinkRequest, UpdateUserTenantLinkRequest, ChannelInstallation, ChannelInstallationType, CreateChannelInstallationRequest, UpdateChannelInstallationRequest, Binding, CreateBindingInput, A2AApiKeyRecord, CreateA2AApiKeyInput, A2AApiKeyEntry, CreateTaskRequest, TaskItem, TaskListFilter, UpdateTaskRequest, Collection, CreateCollectionRequest, UpdateCollectionRequest, MenuItem, CreateMenuItemInput, UpdateMenuItemInput, STTModelLatticeProtocol, STTConfig, STTClient, TranscriptionResult, LoggerLatticeProtocol, LoggerConfig, LoggerClient, LoggerContext, SkillConfig, SkillClient, PluginSkillDefinition, McpTool, ResourceResolver, ResourceAddress, ShareVisibility, CreateShareRequest, ChannelAdapter, InterruptPolicy, TaskBeliefState, PluginMeta, Plugin, PluginMetaOutput, 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, 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, UserStore, TenantStore, UserTenantLinkStore, WorkflowTrackingStore, EvalStore, ChannelInstallationStore, BindingRegistry, MenuRegistry, A2AApiKeyStore, TaskStore, SharedResourceStore, ConnectionStore, TaskWorkItemStore, AgentWebAppStore, CapabilityBundleStore, ProjectRoomStore, ProjectMembershipStore, ProjectBotMembershipStore, ProjectRoomMessageStore, VectorStoreProvider, Thread, CreateThreadRequest, Assistant, CreateAssistantRequest, AgentWebApp, CreateAgentWebAppInput, AgentWebAppStorePatch, AgentWebAppUpdateOptions, Project, CreateProjectRequest, UpdateProjectRequest, UpdateProjectCapabilityBundlesResult, CapabilityBundle, InternalCreateCapabilityBundleInput, InternalUpdateCapabilityBundleInput, CapabilityBundleDeleteResult, Skill, CreateSkillRequest, SkillStoreContext, DatabaseConfigEntry, CreateDatabaseConfigRequest, UpdateDatabaseConfigRequest, User, CreateUserRequest, UpdateUserRequest, Tenant, CreateTenantRequest, UpdateTenantRequest, UserTenantLink, CreateUserTenantLinkRequest, UpdateUserTenantLinkRequest, ChannelInstallation, ChannelInstallationType, CreateChannelInstallationInput, UpdateChannelInstallationRequest, Binding, CreateBindingInput, BindingMutablePatch, BindingListParams, A2AApiKeyRecord, CreateA2AApiKeyInput, A2AApiKeyEntry, TaskMutationSnapshot, CreateTaskRequest, TaskItem, TaskListFilter, TaskDependentListQuery, UpdateTaskRequest, Collection, CreateCollectionRequest, UpdateCollectionRequest, MenuItem, CreateMenuItemInput, UpdateMenuItemInput, ProjectRoom, ProjectMembership, ProjectBotMembership, ProjectRoomMessage, ProjectHumanRole, ProjectMembershipMutationResult, STTModelLatticeProtocol, STTConfig, STTClient, TranscriptionResult, LoggerLatticeProtocol, LoggerConfig, LoggerClient, LoggerContext, SkillConfig, SkillClient, PluginSkillDefinition, McpTool, ResourceResolver, ResourceAddress, ShareVisibility, CreateShareRequest, ChannelAdapter, InterruptPolicy, ProjectTaskLifecycleAction, TaskBeliefState, PluginMeta, Plugin, PluginMetaOutput, CapabilityPreview, CreateCapabilityBundleInput, UpdateCapabilityBundleInput, InternalStateField, InternalInput, InternalNode, InternalAgentNode, InternalMapNode, InternalDSL, ConnectionEntry } from '@axiom-lattice/protocols';
12
12
  export { _axiom_lattice_protocols as Protocols };
13
- export { AgentConfig, AgentType, GraphBuildOptions, MemoryType } from '@axiom-lattice/protocols';
13
+ export { AgentConfig, AgentType, GraphBuildOptions, MemoryType, ProjectRoomTrustedRunContext, QueuedExecutionMode, TrustedRunContext, parseQueuedExecutionMode, parseTrustedRunContext } from '@axiom-lattice/protocols';
14
14
  import * as langchain from 'langchain';
15
15
  import { ReactAgent, AgentMiddleware } from 'langchain';
16
16
  import z, { z as z$1 } from 'zod';
@@ -2646,6 +2646,17 @@ declare enum QueueMode {
2646
2646
  FOLLOWUP = "followup",
2647
2647
  STEER = "steer"
2648
2648
  }
2649
+ /** Result returned after an Agent accepts a message for asynchronous execution. */
2650
+ interface AddMessageResult {
2651
+ queued: boolean;
2652
+ messageId: string;
2653
+ executed: boolean;
2654
+ }
2655
+ /** Options accepted only by the privileged trusted Agent dispatcher. */
2656
+ interface TrustedMessageOptions {
2657
+ trustedRunContext: TrustedRunContext;
2658
+ executionMode: QueuedExecutionMode;
2659
+ }
2649
2660
  interface ThreadQueueConfig {
2650
2661
  mode: QueueMode;
2651
2662
  maxSize: number;
@@ -2659,6 +2670,8 @@ interface PendingMessage {
2659
2670
  priority?: number;
2660
2671
  command?: CommandParams<unknown>;
2661
2672
  custom_run_config?: unknown;
2673
+ trusted_run_context?: TrustedRunContext;
2674
+ execution_mode?: QueuedExecutionMode;
2662
2675
  }
2663
2676
  interface PendingQueueMessageInput {
2664
2677
  message?: string;
@@ -2694,6 +2707,8 @@ interface AddMessageParams {
2694
2707
  command?: CommandParams<unknown>;
2695
2708
  custom_run_config?: unknown;
2696
2709
  id?: string;
2710
+ trusted_run_context?: TrustedRunContext;
2711
+ execution_mode?: QueuedExecutionMode;
2697
2712
  }
2698
2713
  interface ThreadInfo {
2699
2714
  tenantId: string;
@@ -2798,6 +2813,10 @@ type StoreTypeMap = {
2798
2813
  taskWorkItem: TaskWorkItemStore;
2799
2814
  agentWebApp: AgentWebAppStore;
2800
2815
  capabilityBundle: CapabilityBundleStore;
2816
+ projectRoom: ProjectRoomStore;
2817
+ projectMembership: ProjectMembershipStore;
2818
+ projectBotMembership: ProjectBotMembershipStore;
2819
+ projectRoomMessage: ProjectRoomMessageStore;
2801
2820
  };
2802
2821
  /**
2803
2822
  * Store type keys
@@ -3541,10 +3560,10 @@ declare class InMemoryChannelInstallationStore implements ChannelInstallationSto
3541
3560
  *
3542
3561
  * @param tenantId - Tenant identifier
3543
3562
  * @param installationId - Unique installation ID (caller-defined)
3544
- * @param data - {@link CreateChannelInstallationRequest} containing channel type, name, config, and fallback settings
3563
+ * @param data - {@link CreateChannelInstallationInput} containing channel type, name, config, and fallback settings
3545
3564
  * @returns The created {@link ChannelInstallation}
3546
3565
  */
3547
- createInstallation(tenantId: string, installationId: string, data: CreateChannelInstallationRequest): Promise<ChannelInstallation>;
3566
+ createInstallation(tenantId: string, installationId: string, data: CreateChannelInstallationInput): Promise<ChannelInstallation>;
3548
3567
  /**
3549
3568
  * Updates an existing channel installation. Config fields are shallow-merged.
3550
3569
  *
@@ -3605,6 +3624,14 @@ declare class InMemoryChannelInstallationStore implements ChannelInstallationSto
3605
3624
 
3606
3625
  declare class InMemoryBindingStore implements BindingRegistry {
3607
3626
  private bindings;
3627
+ private createTail;
3628
+ findById(tenantId: string, id: string): Promise<Binding | null>;
3629
+ findBySubject(params: {
3630
+ tenantId: string;
3631
+ channel: string;
3632
+ channelInstallationId: string;
3633
+ senderId: string;
3634
+ }): Promise<Binding | null>;
3608
3635
  /**
3609
3636
  * Resolves a binding for the given sender across a specific channel installation.
3610
3637
  *
@@ -3636,34 +3663,27 @@ declare class InMemoryBindingStore implements BindingRegistry {
3636
3663
  * @returns The updated {@link Binding}
3637
3664
  * @throws {Error} If the binding does not exist
3638
3665
  */
3639
- update(id: string, patch: Partial<Binding>): Promise<Binding>;
3666
+ update(tenantId: string, id: string, patch: BindingMutablePatch): Promise<Binding>;
3640
3667
  /**
3641
3668
  * Deletes a binding by ID.
3642
3669
  *
3643
3670
  * @param id - Binding ID
3644
3671
  */
3645
- delete(id: string): Promise<void>;
3672
+ delete(tenantId: string, id: string): Promise<void>;
3646
3673
  /**
3647
3674
  * Lists bindings filtered by tenant and optional channel/agent/installation.
3648
3675
  *
3649
3676
  * @param params - Filter and pagination parameters
3650
3677
  * @returns Array of matching {@link Binding} objects
3651
3678
  */
3652
- list(params: {
3653
- channel?: string;
3654
- agentId?: string;
3655
- tenantId: string;
3656
- channelInstallationId?: string;
3657
- limit?: number;
3658
- offset?: number;
3659
- }): Promise<Binding[]>;
3679
+ list(params: BindingListParams): Promise<Binding[]>;
3660
3680
  /**
3661
3681
  * Bulk-imports bindings.
3662
3682
  *
3663
3683
  * @param bindings - Array of {@link CreateBindingInput}
3664
3684
  * @returns Array of created {@link Binding} objects
3665
3685
  */
3666
- import(bindings: CreateBindingInput[]): Promise<Binding[]>;
3686
+ import(tenantId: string, bindings: CreateBindingInput[]): Promise<Binding[]>;
3667
3687
  /**
3668
3688
  * Exports all bindings for a tenant.
3669
3689
  *
@@ -3739,6 +3759,16 @@ declare class InMemoryTaskStore implements TaskStore {
3739
3759
  private cloneTask;
3740
3760
  private nextUpdatedAt;
3741
3761
  private canAdvanceUpdatedAt;
3762
+ /**
3763
+ * Runs a synchronous operation only while the exact task mutation snapshot matches.
3764
+ *
3765
+ * @param tenantId Tenant identifier.
3766
+ * @param id Task identifier.
3767
+ * @param snapshot Exact task mutation snapshot.
3768
+ * @param operation Synchronous operation run without an await boundary.
3769
+ * @returns Operation result, or `null` when the snapshot differs.
3770
+ */
3771
+ runIfSnapshot<T>(tenantId: string, id: string, snapshot: TaskMutationSnapshot, operation: () => T): T | null;
3742
3772
  private recognizedUpdates;
3743
3773
  private applyUpdates;
3744
3774
  /**
@@ -3758,6 +3788,8 @@ declare class InMemoryTaskStore implements TaskStore {
3758
3788
  * List tasks matching filter criteria
3759
3789
  */
3760
3790
  list(filter: TaskListFilter): Promise<TaskItem[]>;
3791
+ /** Lists dependent tasks in an exact project scope. */
3792
+ listDependents(query: TaskDependentListQuery): Promise<TaskItem[]>;
3761
3793
  /**
3762
3794
  * Update an existing task
3763
3795
  */
@@ -3776,12 +3808,16 @@ declare class InMemoryTaskStore implements TaskStore {
3776
3808
  updateIfStatusNotIn(tenantId: string, id: string, updates: UpdateTaskRequest, blockedStatuses: TaskItem["status"][]): Promise<TaskItem | null>;
3777
3809
  /** Atomically update a task only when status and updatedAt match a read snapshot. */
3778
3810
  updateIfStatusAndUpdatedAt(tenantId: string, id: string, updates: UpdateTaskRequest, expectedStatuses: TaskItem["status"][], expectedUpdatedAt: Date | string): Promise<TaskItem | null>;
3811
+ /** Atomically update only while status, timestamp, owner, and Project scope match. */
3812
+ updateIfSnapshot(tenantId: string, id: string, updates: UpdateTaskRequest, snapshot: TaskMutationSnapshot): Promise<TaskItem | null>;
3779
3813
  /** Atomically update a child only when both child and parent snapshots match. */
3780
3814
  updateIfStatusUpdatedAtAndParentUpdatedAt(tenantId: string, id: string, updates: UpdateTaskRequest, expectedStatuses: TaskItem["status"][], expectedUpdatedAt: Date | string, parentId: string, expectedParentUpdatedAt: Date | string): Promise<TaskItem | null>;
3781
3815
  /**
3782
3816
  * Delete a task by ID
3783
3817
  */
3784
3818
  delete(tenantId: string, id: string): Promise<boolean>;
3819
+ /** Atomically delete only while status, timestamp, owner, and Project scope match. */
3820
+ deleteIfSnapshot(tenantId: string, id: string, snapshot: TaskMutationSnapshot): Promise<boolean>;
3785
3821
  /**
3786
3822
  * Clear all tasks for a tenant (useful for testing)
3787
3823
  */
@@ -3841,6 +3877,357 @@ declare class InMemoryMenuStore implements MenuRegistry {
3841
3877
  clear(): void;
3842
3878
  }
3843
3879
 
3880
+ /** Error raised when a room-scoped idempotency key already identifies another in-memory message. */
3881
+ declare class DuplicateProjectRoomMessageIdempotencyKeyError extends Error {
3882
+ /**
3883
+ * Creates a duplicate room message idempotency key error.
3884
+ *
3885
+ * @param tenantId - Tenant in which the key is already present.
3886
+ * @param roomId - Room in which the key is already present.
3887
+ * @param idempotencyKey - Conflicting room-scoped idempotency key.
3888
+ */
3889
+ constructor(tenantId: string, roomId: string, idempotencyKey: string);
3890
+ }
3891
+ interface InMemoryProjectRoomTransaction {
3892
+ getRoom(tenantId: string, projectId: string): ProjectRoom | undefined;
3893
+ setRoom(room: ProjectRoom): void;
3894
+ getMembership(tenantId: string, id: string): ProjectMembership | undefined;
3895
+ getMemberships(): ProjectMembership[];
3896
+ setMembership(membership: ProjectMembership): void;
3897
+ getBotMembership(tenantId: string, id: string): ProjectBotMembership | undefined;
3898
+ getBotMembershipByAssistant(tenantId: string, projectId: string, assistantId: string): ProjectBotMembership | undefined;
3899
+ getBotMemberships(): ProjectBotMembership[];
3900
+ setBotMembership(membership: ProjectBotMembership): void;
3901
+ getMessage(tenantId: string, id: string): ProjectRoomMessage | undefined;
3902
+ getMessageByIdempotency(tenantId: string, roomId: string, idempotencyKey: string): ProjectRoomMessage | undefined;
3903
+ getMessages(): ProjectRoomMessage[];
3904
+ setMessage(message: ProjectRoomMessage): void;
3905
+ nextTimestamp(previous?: Date): Date;
3906
+ }
3907
+ /**
3908
+ * Coordinates atomic access to in-memory project-room aggregate state.
3909
+ *
3910
+ * Stores sharing this coordinator serialize all reads and writes through a
3911
+ * callback-scoped transaction. Transaction access expires when the callback
3912
+ * settles, preventing callers from retaining unlocked state access. The same
3913
+ * transaction can be extended with bot and message operations as those stores
3914
+ * join the aggregate.
3915
+ *
3916
+ * @example
3917
+ * ```ts
3918
+ * const coordinator = new InMemoryProjectRoomCoordinator();
3919
+ * const rooms = new InMemoryProjectRoomStore(coordinator);
3920
+ * const memberships = new InMemoryProjectMembershipStore(coordinator);
3921
+ * ```
3922
+ */
3923
+ declare class InMemoryProjectRoomCoordinator {
3924
+ private readonly clock;
3925
+ private mutation;
3926
+ private readonly rooms;
3927
+ private readonly memberships;
3928
+ private readonly botMemberships;
3929
+ private readonly botMembershipIdsByAssistant;
3930
+ private readonly messages;
3931
+ private readonly messageIdsByIdempotency;
3932
+ /**
3933
+ * Creates a coordinator.
3934
+ *
3935
+ * @param clock - Clock used to timestamp aggregate entities. It must return a valid finite `Date`.
3936
+ */
3937
+ constructor(clock?: () => Date);
3938
+ /**
3939
+ * Runs one operation under the aggregate's exclusive mutation lock.
3940
+ *
3941
+ * @param operation - Work receiving transaction-scoped, clone-safe state access.
3942
+ * @returns The operation result after releasing the lock.
3943
+ * @remarks The transaction throws if used after the callback settles, including after rejection.
3944
+ */
3945
+ runExclusive<T>(operation: (transaction: InMemoryProjectRoomTransaction) => T | Promise<T>): Promise<T>;
3946
+ }
3947
+
3948
+ /**
3949
+ * Stores canonical, tenant-isolated project main rooms in process memory.
3950
+ *
3951
+ * @example
3952
+ * ```ts
3953
+ * const store = new InMemoryProjectRoomStore();
3954
+ * const room = await store.ensureMainRoom(input);
3955
+ * ```
3956
+ */
3957
+ declare class InMemoryProjectRoomStore implements ProjectRoomStore {
3958
+ private readonly coordinator;
3959
+ /**
3960
+ * Creates a room store backed by an aggregate coordinator.
3961
+ *
3962
+ * @param coordinator - Coordinator shared with related project-room stores.
3963
+ */
3964
+ constructor(coordinator?: InMemoryProjectRoomCoordinator);
3965
+ /**
3966
+ * Creates the main room when absent and returns the canonical room.
3967
+ *
3968
+ * @param input - Candidate identity and presentation for the project's main room.
3969
+ * @returns A defensive copy of the canonical main room.
3970
+ */
3971
+ ensureMainRoom(input: {
3972
+ id: string;
3973
+ tenantId: string;
3974
+ workspaceId: string;
3975
+ projectId: string;
3976
+ name: string;
3977
+ }): Promise<ProjectRoom>;
3978
+ /**
3979
+ * Finds a tenant-scoped project's canonical main room.
3980
+ *
3981
+ * @param tenantId - Tenant owning the project.
3982
+ * @param projectId - Project whose room is requested.
3983
+ * @returns A defensive room copy, or `null` when none exists.
3984
+ */
3985
+ getMainRoom(tenantId: string, projectId: string): Promise<ProjectRoom | null>;
3986
+ }
3987
+
3988
+ /**
3989
+ * Stores tenant-isolated human project memberships in process memory.
3990
+ *
3991
+ * Membership lists are deterministic: records are ordered by `joinedAt` ASC,
3992
+ * then by `id` ASC. Mutations share the project-room coordinator lock.
3993
+ *
3994
+ * @example
3995
+ * ```ts
3996
+ * const coordinator = new InMemoryProjectRoomCoordinator();
3997
+ * const store = new InMemoryProjectMembershipStore(coordinator);
3998
+ * await store.createInitialOwner(input);
3999
+ * ```
4000
+ */
4001
+ declare class InMemoryProjectMembershipStore implements ProjectMembershipStore {
4002
+ private readonly coordinator;
4003
+ /**
4004
+ * Creates a membership store backed by an aggregate coordinator.
4005
+ *
4006
+ * @param coordinator - Coordinator shared with related project-room stores.
4007
+ */
4008
+ constructor(coordinator?: InMemoryProjectRoomCoordinator);
4009
+ /**
4010
+ * Lists all retained memberships for one tenant-scoped project.
4011
+ *
4012
+ * @param tenantId - Tenant owning the project.
4013
+ * @param projectId - Project whose memberships are requested.
4014
+ * @returns Defensive copies ordered by `joinedAt` ASC, then `id` ASC.
4015
+ */
4016
+ list(tenantId: string, projectId: string): Promise<ProjectMembership[]>;
4017
+ /**
4018
+ * Finds one user's retained membership in a tenant-scoped project.
4019
+ *
4020
+ * @param tenantId - Tenant owning the project.
4021
+ * @param projectId - Project to search.
4022
+ * @param userId - User whose membership is requested.
4023
+ * @returns A defensive membership copy, or `null` when absent.
4024
+ */
4025
+ findByUser(tenantId: string, projectId: string, userId: string): Promise<ProjectMembership | null>;
4026
+ /**
4027
+ * Creates a membership while enforcing tenant/project/user and tenant/ID uniqueness.
4028
+ *
4029
+ * @param input - Membership fields excluding coordinator-generated timestamps.
4030
+ * @returns A defensive copy of the created membership.
4031
+ */
4032
+ create(input: Omit<ProjectMembership, "joinedAt" | "updatedAt">): Promise<ProjectMembership>;
4033
+ /**
4034
+ * Atomically creates the first active owner for an empty project.
4035
+ *
4036
+ * @param input - Initial owner identity without generated role, status, or timestamps.
4037
+ * @returns `created`, an idempotent `existing`, or `already_initialized`.
4038
+ */
4039
+ createInitialOwner(input: Omit<ProjectMembership, "role" | "status" | "joinedAt" | "updatedAt">): Promise<{
4040
+ kind: "created" | "existing";
4041
+ membership: ProjectMembership;
4042
+ } | {
4043
+ kind: "already_initialized";
4044
+ }>;
4045
+ /**
4046
+ * Updates a membership role using tenant-scoped optimistic concurrency.
4047
+ *
4048
+ * @param input - Tenant, membership ID, target role, and expected revision.
4049
+ * @returns The update outcome, including conflict and final-owner protection.
4050
+ */
4051
+ updateRole(input: {
4052
+ tenantId: string;
4053
+ id: string;
4054
+ role: ProjectHumanRole;
4055
+ expectedUpdatedAt: Date;
4056
+ }): Promise<ProjectMembershipMutationResult>;
4057
+ /**
4058
+ * Marks a membership removed using tenant-scoped optimistic concurrency.
4059
+ *
4060
+ * @param input - Tenant, membership ID, and expected revision.
4061
+ * @returns The removal outcome, including conflict and final-owner protection.
4062
+ */
4063
+ remove(input: {
4064
+ tenantId: string;
4065
+ id: string;
4066
+ expectedUpdatedAt: Date;
4067
+ }): Promise<ProjectMembershipMutationResult>;
4068
+ private hasOtherActiveOwner;
4069
+ }
4070
+
4071
+ /** Error raised when a new bot membership reuses an existing tenant-scoped ID. */
4072
+ declare class ProjectBotMembershipIdConflictError extends Error {
4073
+ /**
4074
+ * Creates a bot membership ID conflict error.
4075
+ *
4076
+ * @param tenantId - Tenant in which the ID is already present.
4077
+ * @param id - Conflicting membership ID.
4078
+ */
4079
+ constructor(tenantId: string, id: string);
4080
+ }
4081
+ /**
4082
+ * Stores tenant-isolated project bot memberships in process memory.
4083
+ *
4084
+ * Durable assistant identity, coordinator role, and room mention constraints
4085
+ * are checked atomically through the shared project-room coordinator.
4086
+ *
4087
+ * @example
4088
+ * ```ts
4089
+ * const coordinator = new InMemoryProjectRoomCoordinator();
4090
+ * const store = new InMemoryProjectBotMembershipStore(coordinator);
4091
+ * await store.save(input);
4092
+ * ```
4093
+ */
4094
+ declare class InMemoryProjectBotMembershipStore implements ProjectBotMembershipStore {
4095
+ private readonly coordinator;
4096
+ /**
4097
+ * Creates a bot membership store backed by an aggregate coordinator.
4098
+ *
4099
+ * @param coordinator - Coordinator shared with related project-room stores.
4100
+ */
4101
+ constructor(coordinator?: InMemoryProjectRoomCoordinator);
4102
+ /**
4103
+ * Lists retained bot memberships for a tenant-scoped project.
4104
+ *
4105
+ * @param tenantId - Tenant owning the project.
4106
+ * @param projectId - Project whose roster is requested.
4107
+ * @returns Defensive copies ordered by `joinedAt` ASC, then `id` ASC.
4108
+ */
4109
+ list(tenantId: string, projectId: string): Promise<ProjectBotMembership[]>;
4110
+ /**
4111
+ * Finds a bot membership by its tenant-scoped ID.
4112
+ *
4113
+ * @param tenantId - Tenant owning the membership.
4114
+ * @param id - Membership ID.
4115
+ * @returns A defensive membership copy, or `null` when absent.
4116
+ */
4117
+ findById(tenantId: string, id: string): Promise<ProjectBotMembership | null>;
4118
+ /**
4119
+ * Finds the durable membership for an assistant in a tenant-scoped project.
4120
+ *
4121
+ * @param tenantId - Tenant owning the project.
4122
+ * @param projectId - Project to search.
4123
+ * @param assistantId - Assistant identity to find.
4124
+ * @returns A defensive membership copy, or `null` when absent.
4125
+ */
4126
+ findByAssistant(tenantId: string, projectId: string, assistantId: string): Promise<ProjectBotMembership | null>;
4127
+ /**
4128
+ * Saves a new membership or reactivates the assistant's durable membership.
4129
+ *
4130
+ * @param input - Candidate membership without coordinator-generated timestamps.
4131
+ * @returns The saved membership or a coordinator/mention uniqueness conflict.
4132
+ */
4133
+ save(input: Omit<ProjectBotMembership, "joinedAt" | "updatedAt">): Promise<{
4134
+ kind: "created" | "updated" | "reactivated";
4135
+ membership: ProjectBotMembership;
4136
+ } | {
4137
+ kind: "coordinator_conflict" | "mention_conflict";
4138
+ }>;
4139
+ /**
4140
+ * Updates mutable bot membership fields using tenant-scoped optimistic concurrency.
4141
+ *
4142
+ * @param input - Tenant, membership ID, exact field patch, and expected revision.
4143
+ * @returns The updated membership or the applicable lookup, revision, or uniqueness conflict.
4144
+ */
4145
+ update(input: {
4146
+ tenantId: string;
4147
+ id: string;
4148
+ patch: Partial<Pick<ProjectBotMembership, "role" | "title" | "responsibility" | "mentionName" | "status">>;
4149
+ expectedUpdatedAt: Date;
4150
+ }): Promise<{
4151
+ kind: "updated";
4152
+ membership: ProjectBotMembership;
4153
+ } | {
4154
+ kind: "not_found" | "conflict" | "coordinator_conflict" | "mention_conflict";
4155
+ }>;
4156
+ private findConstraintConflict;
4157
+ }
4158
+
4159
+ /** Error raised when a room message reuses an existing tenant-scoped ID. */
4160
+ declare class ProjectRoomMessageIdConflictError extends Error {
4161
+ /**
4162
+ * Creates a room message ID conflict error.
4163
+ *
4164
+ * @param tenantId - Tenant in which the ID is already present.
4165
+ * @param id - Conflicting message ID.
4166
+ */
4167
+ constructor(tenantId: string, id: string);
4168
+ }
4169
+ /**
4170
+ * Stores tenant-isolated project room messages in process memory.
4171
+ *
4172
+ * Message creation and room-scoped idempotency are serialized by the shared
4173
+ * project-room coordinator. Lists use stable newest-first cursor ordering.
4174
+ *
4175
+ * @example
4176
+ * ```ts
4177
+ * const store = new InMemoryProjectRoomMessageStore();
4178
+ * const created = await store.create(input);
4179
+ * ```
4180
+ */
4181
+ declare class InMemoryProjectRoomMessageStore implements ProjectRoomMessageStore {
4182
+ private readonly coordinator;
4183
+ /**
4184
+ * Creates a message store backed by an aggregate coordinator.
4185
+ *
4186
+ * @param coordinator - Coordinator shared with related project-room stores.
4187
+ */
4188
+ constructor(coordinator?: InMemoryProjectRoomCoordinator);
4189
+ /**
4190
+ * Creates a project room message.
4191
+ *
4192
+ * @param input - Message fields excluding the coordinator-generated timestamp.
4193
+ * @returns A defensive copy of the created message.
4194
+ */
4195
+ create(input: Omit<ProjectRoomMessage, "createdAt">): Promise<ProjectRoomMessage>;
4196
+ /**
4197
+ * Creates or returns the canonical message for a tenant/room idempotency key.
4198
+ *
4199
+ * @param input - Message candidate and required room-scoped idempotency key.
4200
+ * @returns A defensive copy of the original or newly created message.
4201
+ */
4202
+ createIdempotent(input: Omit<ProjectRoomMessage, "createdAt"> & {
4203
+ idempotencyKey: string;
4204
+ }): Promise<ProjectRoomMessage>;
4205
+ /**
4206
+ * Lists room messages using stable newest-first pagination.
4207
+ *
4208
+ * @param input - Tenant/room scope, optional exclusive cursor, and requested limit.
4209
+ * @returns Defensive message copies ordered by `createdAt` DESC, then `id` DESC; limit is clamped to 1..100.
4210
+ */
4211
+ list(input: {
4212
+ tenantId: string;
4213
+ roomId: string;
4214
+ before?: {
4215
+ createdAt: Date;
4216
+ id: string;
4217
+ };
4218
+ limit: number;
4219
+ }): Promise<ProjectRoomMessage[]>;
4220
+ /**
4221
+ * Finds a message by its tenant-scoped ID.
4222
+ *
4223
+ * @param tenantId - Tenant owning the message.
4224
+ * @param id - Message ID.
4225
+ * @returns A defensive message copy, or `null` when absent.
4226
+ */
4227
+ findById(tenantId: string, id: string): Promise<ProjectRoomMessage | null>;
4228
+ private createInTransaction;
4229
+ }
4230
+
3844
4231
  /**
3845
4232
  * Embeddings Lattice Interface
3846
4233
  * Defines the structure of an embeddings lattice entry
@@ -7325,6 +7712,280 @@ declare class AgentManager {
7325
7712
  }, return_agent_state?: boolean): Promise<unknown>;
7326
7713
  }
7327
7714
 
7715
+ /** Exact tenant, workspace, Project, and Room coordinates for roster authorization. */
7716
+ interface ProjectTaskRosterScope {
7717
+ tenantId: string;
7718
+ workspaceId: string;
7719
+ projectId: string;
7720
+ roomId: string;
7721
+ }
7722
+ /** Exact caller and target roster identities required for a Project task assignment. */
7723
+ interface ProjectTaskAssignmentScope extends ProjectTaskRosterScope {
7724
+ callerMembershipId: string;
7725
+ callerAssistantId: string;
7726
+ targetMembershipId: string;
7727
+ targetAssistantId: string;
7728
+ }
7729
+ /** Stable authorization denial codes emitted by the Project task owner policy. */
7730
+ type ProjectTaskOwnerPolicyCode = "PROJECT_TASK_CALLER_INACTIVE" | "PROJECT_TASK_OWNER_INACTIVE";
7731
+ /** Stable authorization failure that does not expose membership-store details. */
7732
+ declare class ProjectTaskOwnerPolicyError extends Error {
7733
+ readonly code: ProjectTaskOwnerPolicyCode;
7734
+ /**
7735
+ * Creates a stable Project task roster authorization failure.
7736
+ *
7737
+ * @param code Machine-readable caller or owner denial code.
7738
+ * @param message Generic denial description safe to expose to callers.
7739
+ */
7740
+ constructor(code: ProjectTaskOwnerPolicyCode, message: string);
7741
+ }
7742
+ /**
7743
+ * Requires Project task callers and owners to be active members of one exact durable roster.
7744
+ *
7745
+ * Store values are treated as untrusted boundary data and snapshotted without invoking
7746
+ * accessors before identity or scope checks are performed.
7747
+ *
7748
+ * @example
7749
+ * ```ts
7750
+ * const policy = createProjectTaskOwnerPolicy();
7751
+ * const { caller, target } = await policy.requireAssignment(scope);
7752
+ * ```
7753
+ */
7754
+ declare class ProjectTaskOwnerPolicy {
7755
+ private readonly memberships;
7756
+ /**
7757
+ * Creates a policy backed by the Project bot membership protocol.
7758
+ *
7759
+ * @param memberships Minimal durable roster lookup methods used by the policy.
7760
+ */
7761
+ constructor(memberships: Pick<ProjectBotMembershipStore, "findById" | "findByAssistant">);
7762
+ /**
7763
+ * Requires the current caller to be active under its exact membership, Assistant, and scope.
7764
+ *
7765
+ * @param input Exact roster scope plus caller identity.
7766
+ * @returns A descriptor-safe snapshot of the active caller membership.
7767
+ */
7768
+ requireCaller(input: ProjectTaskRosterScope & {
7769
+ callerMembershipId: string;
7770
+ callerAssistantId: string;
7771
+ }): Promise<ProjectBotMembership>;
7772
+ /**
7773
+ * Requires the target owner to be active under its exact membership, Assistant, and scope.
7774
+ *
7775
+ * @param input Exact roster scope plus target identity.
7776
+ * @returns A descriptor-safe snapshot of the active target membership.
7777
+ */
7778
+ requireOwner(input: ProjectTaskRosterScope & {
7779
+ targetMembershipId: string;
7780
+ targetAssistantId: string;
7781
+ }): Promise<ProjectBotMembership>;
7782
+ /**
7783
+ * Requires both sides of an assignment, validating the caller before accessing the target.
7784
+ *
7785
+ * @param input Exact roster scope and both membership/Assistant identities.
7786
+ * @returns Descriptor-safe active caller and target membership snapshots.
7787
+ */
7788
+ requireAssignment(input: ProjectTaskAssignmentScope): Promise<{
7789
+ caller: ProjectBotMembership;
7790
+ target: ProjectBotMembership;
7791
+ }>;
7792
+ }
7793
+ /**
7794
+ * Creates the default Project task owner policy from Store Lattice.
7795
+ *
7796
+ * @returns A policy using only the `default:projectBotMembership` store.
7797
+ * @remarks Register the default Project bot membership store before calling this factory.
7798
+ */
7799
+ declare function createProjectTaskOwnerPolicy(): ProjectTaskOwnerPolicy;
7800
+
7801
+ declare const reassignmentAuthorizationBrand: unique symbol;
7802
+ /** Opaque host-issued proof that a Project task reassignment boundary was validated. */
7803
+ interface ProjectTaskReassignmentAuthorization {
7804
+ readonly [reassignmentAuthorizationBrand]: true;
7805
+ }
7806
+ /** Exact assignment and Task Thread coordinates validated by a trusted host. */
7807
+ interface ProjectTaskReassignmentAuthorizationInput {
7808
+ tenantId: string;
7809
+ workspaceId: string;
7810
+ projectId: string;
7811
+ roomId: string;
7812
+ taskId: string;
7813
+ callerMembershipId: string;
7814
+ callerAssistantId: string;
7815
+ targetMembershipId: string;
7816
+ targetAssistantId: string;
7817
+ expectedThreadId?: string;
7818
+ newThreadId: string;
7819
+ }
7820
+ /** Input supplied to the host's durable Task Thread validator. */
7821
+ interface ProjectTaskReassignmentThreadValidationInput extends ProjectTaskReassignmentAuthorizationInput {
7822
+ caller: ProjectBotMembership;
7823
+ target: ProjectBotMembership;
7824
+ }
7825
+ /** Host-owned validation function for reassignment Thread identity and scope. */
7826
+ type ProjectTaskReassignmentThreadValidator = (input: ProjectTaskReassignmentThreadValidationInput) => Promise<void>;
7827
+ /** Trusted host API that issues opaque reassignment authorization tokens. */
7828
+ interface ProjectTaskReassignmentAuthorizer {
7829
+ /** Validates current roster and Thread truth, then issues a process-local opaque token. */
7830
+ authorize(input: ProjectTaskReassignmentAuthorizationInput): Promise<ProjectTaskReassignmentAuthorization>;
7831
+ }
7832
+ /**
7833
+ * Creates a trusted host reassignment authorizer.
7834
+ *
7835
+ * @param policy Exact active-roster policy used caller-first.
7836
+ * @param threadValidator Host validator for the proposed Task Thread metadata.
7837
+ * @returns An authorizer that emits process-local opaque tokens after both validations succeed.
7838
+ * @remarks Tokens are process-local capabilities. Distributed deployments must authorize and execute
7839
+ * under their machine/project mutex and accept the residual membership race across processes.
7840
+ */
7841
+ declare function createProjectTaskReassignmentAuthorizer(policy: ProjectTaskOwnerPolicy, threadValidator: ProjectTaskReassignmentThreadValidator): ProjectTaskReassignmentAuthorizer;
7842
+
7843
+ /**
7844
+ * Immutable data identifying one committed canonical Project task lifecycle transition.
7845
+ *
7846
+ * @remarks `eventKey` identifies the persisted WorkItem and `updatedAt` identifies the winning task snapshot.
7847
+ */
7848
+ interface TaskLifecycleNotification {
7849
+ tenantId: string;
7850
+ workspaceId: string;
7851
+ projectId: string;
7852
+ taskId: string;
7853
+ threadId?: string;
7854
+ status: TaskItem["status"];
7855
+ action: ProjectTaskLifecycleAction;
7856
+ eventKey: string;
7857
+ updatedAt: string;
7858
+ }
7859
+ /**
7860
+ * Async observer invoked for a canonical Project task lifecycle transition.
7861
+ *
7862
+ * @param event Isolated own-data snapshot for one committed transition.
7863
+ * @returns A promise settled when listener processing is complete.
7864
+ */
7865
+ type TaskLifecycleListener = (event: TaskLifecycleNotification) => void | Promise<void>;
7866
+ /**
7867
+ * Publishes descriptor-safe lifecycle snapshots to an isolated listener snapshot.
7868
+ *
7869
+ * @example
7870
+ * ```ts
7871
+ * const unsubscribe = taskLifecycleNotifier.subscribe(async (event) => project(event));
7872
+ * unsubscribe();
7873
+ * ```
7874
+ *
7875
+ * @remarks Listener failures are collected so every listener receives the event. A rejected
7876
+ * publish reports failure to the lifecycle caller but cannot undo the committed transition.
7877
+ * Delivery is strict FIFO per tenant/task. Subscribers must bound their own work because publish
7878
+ * intentionally awaits every listener settlement before the next event for that task can start.
7879
+ */
7880
+ declare class TaskLifecycleNotifier {
7881
+ private readonly listeners;
7882
+ private readonly tails;
7883
+ /**
7884
+ * Registers an async lifecycle listener.
7885
+ *
7886
+ * @param listener Observer to invoke for later publications.
7887
+ * @returns An idempotent unsubscribe callback.
7888
+ */
7889
+ subscribe(listener: TaskLifecycleListener): () => void;
7890
+ /**
7891
+ * Awaits all listeners with independent copies of one validated event snapshot.
7892
+ *
7893
+ * @param event Canonical transition identity to publish.
7894
+ * @returns A promise that resolves after every listener succeeds.
7895
+ * @throws Error when the event is malformed or one or more listeners reject.
7896
+ */
7897
+ publish(event: TaskLifecycleNotification): Promise<void>;
7898
+ private deliver;
7899
+ }
7900
+ /** Process-global notifier used by every lifecycle service unless explicitly injected. */
7901
+ declare const taskLifecycleNotifier: TaskLifecycleNotifier;
7902
+
7903
+ /** Exact canonical identity of one newly committed pending Agent Project task. */
7904
+ interface ProjectTaskAdmissionNotification {
7905
+ tenantId: string;
7906
+ workspaceId: string;
7907
+ projectId: string;
7908
+ taskId: string;
7909
+ ownerId: string;
7910
+ updatedAt: string;
7911
+ }
7912
+ /**
7913
+ * Observer invoked with an isolated canonical Project task admission snapshot.
7914
+ *
7915
+ * @param event Exact newly persisted Agent Project task identity.
7916
+ * @returns Nothing or a promise that settles when listener admission is accepted.
7917
+ */
7918
+ type ProjectTaskAdmissionListener = (event: ProjectTaskAdmissionNotification, signal: AbortSignal) => void | Promise<void>;
7919
+ /** Delivery bounds for process-local Project task admission hints. */
7920
+ interface ProjectTaskAdmissionNotifierOptions {
7921
+ listenerTimeoutMs?: number;
7922
+ }
7923
+ /**
7924
+ * Publishes process-local hints that newly persisted Agent Project tasks need reconciliation.
7925
+ *
7926
+ * @remarks Delivery is FIFO per Tenant/Task and awaits every listener settlement. Callers that
7927
+ * persist tasks must invoke `publish` fire-and-forget and contain rejection because this hint is
7928
+ * not durable lifecycle authority.
7929
+ */
7930
+ declare class ProjectTaskAdmissionNotifier {
7931
+ private readonly listeners;
7932
+ private readonly tails;
7933
+ private readonly listenerTimeoutMs;
7934
+ /**
7935
+ * Creates a bounded Project task admission notifier.
7936
+ *
7937
+ * @param options Optional positive listener timeout; defaults to five seconds.
7938
+ */
7939
+ constructor(options?: ProjectTaskAdmissionNotifierOptions);
7940
+ /**
7941
+ * Registers a Project task admission listener.
7942
+ *
7943
+ * @param listener Observer to invoke for later publications.
7944
+ * @returns An idempotent unsubscribe callback.
7945
+ */
7946
+ subscribe(listener: ProjectTaskAdmissionListener): () => void;
7947
+ /**
7948
+ * Publishes one validated Project task admission snapshot.
7949
+ *
7950
+ * @param event Canonical committed task identity to publish.
7951
+ * @returns A promise settled after every snapshotted listener settles.
7952
+ */
7953
+ publish(event: ProjectTaskAdmissionNotification): Promise<void>;
7954
+ private deliver;
7955
+ private deliverTo;
7956
+ }
7957
+ /** Process-global Project task admission notifier used by governed creation paths. */
7958
+ declare const projectTaskAdmissionNotifier: ProjectTaskAdmissionNotifier;
7959
+
7960
+ /** Exact Tenant and Project scope for collaboration mutations. */
7961
+ interface ProjectMutationScope {
7962
+ tenantId: string;
7963
+ projectId: string;
7964
+ }
7965
+ /**
7966
+ * Process-local FIFO mutex shared by every Core and Gateway Project mutation path.
7967
+ *
7968
+ * @remarks
7969
+ * When an operation needs both a Project task machine mutex and this mutex, it
7970
+ * must acquire the machine mutex first. Project-only membership, roster, human,
7971
+ * and ordinary Task mutations acquire only this mutex.
7972
+ */
7973
+ declare class ProjectMutationMutex {
7974
+ private readonly queues;
7975
+ private readonly active;
7976
+ /** Runs one mutation after all earlier mutations for the same Tenant and Project. */
7977
+ runExclusive<T>(scope: ProjectMutationScope, operation: () => Promise<T>, signal?: AbortSignal): Promise<T>;
7978
+ /** Returns the number of operations queued behind the current holder. */
7979
+ pending(scope: ProjectMutationScope): number;
7980
+ private acquire;
7981
+ private release;
7982
+ }
7983
+ /** Process-global Project mutation mutex shared by Core tools and Gateway services. */
7984
+ declare const projectMutationMutex: ProjectMutationMutex;
7985
+
7986
+ /** Package-private capability used by trusted host dispatch infrastructure. */
7987
+ declare const TRUSTED_AGENT_DISPATCH: unique symbol;
7988
+
7328
7989
  /** Execution state of a thread. */
7329
7990
  declare enum ThreadStatus {
7330
7991
  IDLE = "idle",
@@ -7387,8 +8048,8 @@ interface QueueMessage {
7387
8048
  modified_at: string;
7388
8049
  }>;
7389
8050
  };
7390
- command?: CommandParams<any>;
7391
- custom_run_config?: any;
8051
+ command?: CommandParams<unknown>;
8052
+ custom_run_config?: unknown;
7392
8053
  }
7393
8054
  /** Emitted when a thread transitions between {@link ThreadStatus} values. */
7394
8055
  interface ThreadStatusChangedEvent {
@@ -7452,6 +8113,43 @@ interface MessageFailedEvent {
7452
8113
  error: string;
7453
8114
  timestamp: Date;
7454
8115
  }
8116
+ /**
8117
+ * Emitted when a message was interrupted mid-execution (e.g. graph interrupt
8118
+ * waiting for human input or tool approval).
8119
+ *
8120
+ * The `state` snapshot captures the LangGraph state at the point of interruption.
8121
+ */
8122
+ interface MessageInterruptedEvent {
8123
+ type: 'message:interrupted';
8124
+ messageId: string;
8125
+ timestamp: Date;
8126
+ duration?: number;
8127
+ state?: any;
8128
+ }
8129
+ /**
8130
+ * Emitted once after an Agent execution reaches normal idle completion with a fresh text reply.
8131
+ *
8132
+ * `inputMessageId` is the primary delivery correlation ID. `consumedInputMessageIds` lists every
8133
+ * queue input settled by the execution, including all inputs in a COLLECT batch. The stable
8134
+ * `outputMessageId` is always `reply:${inputMessageId}`; provider/model IDs are diagnostic only.
8135
+ *
8136
+ * @remarks
8137
+ * Phase 2 replaces the earlier provider-ID delivery contract. Consumers must deduplicate delivery
8138
+ * with `outputMessageId`, clean correlation state with `consumedInputMessageIds`, and must not infer
8139
+ * reply text from `state`. This is an accepted pre-release breaking contract change.
8140
+ *
8141
+ * @since Phase 2 pre-release
8142
+ */
8143
+ interface ReplyReadyEvent {
8144
+ type: 'reply:ready';
8145
+ timestamp: Date;
8146
+ inputMessageId: string;
8147
+ consumedInputMessageIds: string[];
8148
+ outputMessageId: string;
8149
+ providerOutputMessageId?: string;
8150
+ outputText: string;
8151
+ state: unknown;
8152
+ }
7455
8153
  /** Emitted when the thread has drained its queue and returned to idle. */
7456
8154
  interface ThreadIdleEvent {
7457
8155
  type: 'thread:idle';
@@ -7475,6 +8173,11 @@ interface QueuePendingEvent {
7475
8173
  isHighPriority: boolean;
7476
8174
  }
7477
8175
 
8176
+ /** Raised when immediate delegated worker authority is passed to a persistent queue. */
8177
+ declare class DelegatedScopeNotQueueableError extends Error {
8178
+ readonly code: "DELEGATED_SCOPE_NOT_QUEUEABLE";
8179
+ constructor();
8180
+ }
7478
8181
  /**
7479
8182
  * Parameters that uniquely identify an agent thread instance.
7480
8183
  *
@@ -7542,7 +8245,6 @@ declare class Agent {
7542
8245
  private chunkBuffer;
7543
8246
  private abortController;
7544
8247
  private queueProcessorPromise?;
7545
- private checkpointRecoveryBlocked;
7546
8248
  assistant_id: string;
7547
8249
  thread_id: string;
7548
8250
  tenant_id: string;
@@ -7552,7 +8254,11 @@ declare class Agent {
7552
8254
  private queue_project_id;
7553
8255
  custom_run_config: any;
7554
8256
  queueMode: ThreadQueueConfig;
7555
- private isWaitingForQueueEnd;
8257
+ private queueProcessorRetryTimer?;
8258
+ private queueProcessorRetryAttempt;
8259
+ private queueProcessorGeneration;
8260
+ private queueWakeRequested;
8261
+ private recoveryBlockedKey?;
7556
8262
  asyncTasks: AsyncTaskRecord[];
7557
8263
  /**
7558
8264
  * Constructs an Agent instance.
@@ -7563,6 +8269,23 @@ declare class Agent {
7563
8269
  * @param params - {@link AgentThreadInterface}
7564
8270
  */
7565
8271
  constructor({ assistant_id, thread_id, tenant_id, workspace_id, project_id, custom_run_config, }: AgentThreadInterface);
8272
+ /**
8273
+ * Accepts host-authenticated queue metadata through the package-private symbol capability.
8274
+ *
8275
+ * @param queueMessage - Public message payload to sanitize and enqueue.
8276
+ * @param options - Trusted context and execution mode supplied by privileged host code.
8277
+ * @returns The asynchronous queue acceptance result.
8278
+ */
8279
+ [TRUSTED_AGENT_DISPATCH](queueMessage: QueueMessage, options: TrustedMessageOptions): Promise<AddMessageResult>;
8280
+ private rejectDelegatedQueueAuthority;
8281
+ private validateTrustedRunContext;
8282
+ private processingExecutionContext;
8283
+ private pendingExecutionContext;
8284
+ private processingRowKey;
8285
+ private blockRecovery;
8286
+ private clearRecoveryBlock;
8287
+ private rethrowClaimedExecutionError;
8288
+ private executionRunConfig;
7566
8289
  private getHumanPendingContent;
7567
8290
  private queuedInputMessages;
7568
8291
  /**
@@ -7590,7 +8313,7 @@ declare class Agent {
7590
8313
  [Symbol.asyncIterator]: () => AsyncGenerator<MessageChunk, void, unknown>;
7591
8314
  };
7592
8315
  private buildExecutionRunConfig;
7593
- getLatticeClientAndRuntimeConfig(custom_run_config?: Record<string, unknown>, expectedRevision?: string): Promise<{
8316
+ getLatticeClientAndRuntimeConfig(custom_run_config?: unknown, expectedRevision?: string): Promise<{
7594
8317
  runnable_agent: AgentClient;
7595
8318
  runConfig: Record<string, unknown>;
7596
8319
  }>;
@@ -7621,6 +8344,7 @@ declare class Agent {
7621
8344
  }[];
7622
8345
  }>;
7623
8346
  private agentExecutor;
8347
+ private interruptedCommandExecutionContext;
7624
8348
  private interruptedCommandCapabilityRevision;
7625
8349
  getPendingMessages(): Promise<PendingMessage[]>;
7626
8350
  private queueScope;
@@ -7667,9 +8391,8 @@ declare class Agent {
7667
8391
  * **Format**: Supports both `input.message` (legacy string) and `input.messages[]`
7668
8392
  * (array of `{ role, content }` objects). The array form takes precedence.
7669
8393
  *
7670
- * The `custom_run_config` field is round-tripped through the queue and emitted
7671
- * back in {@link ReplyReadyEvent}, enabling callers to attach routing metadata
7672
- * (e.g. `_replyTarget` for channel reply).
8394
+ * Safe caller `custom_run_config` fields are round-tripped through queue execution only.
8395
+ * They are not exposed by {@link ReplyReadyEvent}; reserved host metadata keys are stripped.
7673
8396
  *
7674
8397
  * @param queueMessage - The message to enqueue
7675
8398
  * @param mode - Optional queue mode override (defaults to thread's current mode)
@@ -7679,15 +8402,12 @@ declare class Agent {
7679
8402
  * ```ts
7680
8403
  * await agent.addMessage({
7681
8404
  * input: { message: "Hello" },
7682
- * custom_run_config: { _replyTarget: { adapterChannel: "lark", rawTarget: { chatId: "xxx" } } },
8405
+ * custom_run_config: { requestId: "request-1" },
7683
8406
  * });
7684
8407
  * ```
7685
8408
  */
7686
- addMessage(queueMessage: QueueMessage, mode?: QueueMode): Promise<{
7687
- queued: boolean;
7688
- messageId: string;
7689
- executed: boolean;
7690
- }>;
8409
+ addMessage(queueMessage: QueueMessage, mode?: QueueMode): Promise<AddMessageResult>;
8410
+ private enqueueMessage;
7691
8411
  /**
7692
8412
  * Start the queue processor if it is not already running.
7693
8413
  *
@@ -7698,6 +8418,10 @@ declare class Agent {
7698
8418
  * loop with a fresh {@link AbortController}.
7699
8419
  */
7700
8420
  startQueueProcessorIfNeeded(): Promise<void>;
8421
+ private startQueueProcessor;
8422
+ private finishQueueProcessor;
8423
+ private scheduleQueueProcessorRetry;
8424
+ private cancelQueueProcessorRetry;
7701
8425
  private runQueueProcessor;
7702
8426
  /**
7703
8427
  * Remove pending message
@@ -7734,9 +8458,10 @@ declare class Agent {
7734
8458
  * Checks LangGraph's `state.tasks` for interrupts and `state.next` for
7735
8459
  * pending steps.
7736
8460
  *
8461
+ * @param state - Optional authoritative snapshot to classify without rereading the graph.
7737
8462
  * @returns {@link ThreadStatus} — `IDLE`, `BUSY`, or `INTERRUPTED`
7738
8463
  */
7739
- getRunStatus(): Promise<ThreadStatus>;
8464
+ getRunStatus(state?: unknown): Promise<ThreadStatus>;
7740
8465
  /**
7741
8466
  * Resume processing after a server restart.
7742
8467
  *
@@ -7746,11 +8471,15 @@ declare class Agent {
7746
8471
  * rather than replayed.
7747
8472
  *
7748
8473
  * Skips threads that are in `INTERRUPTED` state (the interruption was
7749
- * intentional). IDLE threads simply clean up and restart the queue
7750
- * processor for any remaining pending messages.
8474
+ * intentional). IDLE and ERROR threads settle their durable processing rows
8475
+ * before starting the queue processor for any remaining pending messages.
7751
8476
  *
7752
8477
  * Called during gateway startup to recover threads that were mid-execution
7753
8478
  * when the server went down.
8479
+ *
8480
+ * @returns The authoritative graph status after recovery. `BUSY` and
8481
+ * `INTERRUPTED` mean the processing rows remain authoritative and pending
8482
+ * queue work must not start; `IDLE` and `ERROR` mean those rows were settled.
7754
8483
  */
7755
8484
  resumeTask(): Promise<ResumeTaskResult>;
7756
8485
  /**
@@ -7825,6 +8554,118 @@ declare class Agent {
7825
8554
  updateAsyncTaskStatus(taskId: string, status: AsyncTaskRecord['status']): void;
7826
8555
  }
7827
8556
 
8557
+ /**
8558
+ * Privileged in-process boundary for dispatching messages with host-authenticated metadata.
8559
+ *
8560
+ * @remarks
8561
+ * In-process host imports are trusted deployment code. This boundary prevents remote,
8562
+ * model, and tool callers from acquiring trusted metadata authority; it does not defend
8563
+ * against hostile JavaScript installed in the host process.
8564
+ */
8565
+ interface TrustedAgentMessageDispatcher {
8566
+ /**
8567
+ * Dispatches a queue message with validated host metadata.
8568
+ *
8569
+ * @param scope - Agent thread scope resolved by the host.
8570
+ * @param message - Public queue message payload.
8571
+ * @param options - Trusted metadata and execution behavior.
8572
+ * @returns The Agent queue acceptance result.
8573
+ */
8574
+ dispatch(scope: AgentThreadInterface, message: QueueMessage, options: TrustedMessageOptions): Promise<AddMessageResult>;
8575
+ }
8576
+ /**
8577
+ * Creates the privileged dispatcher used by host-owned orchestration services.
8578
+ *
8579
+ * @param resolve - Resolves the Agent instance for an authoritative thread scope.
8580
+ * @returns A dispatcher that invokes Agent's package-private symbol capability.
8581
+ */
8582
+ declare function createTrustedAgentMessageDispatcher(resolve: (scope: AgentThreadInterface) => Agent): TrustedAgentMessageDispatcher;
8583
+
8584
+ /** Fully scoped input for a trusted Agent-authored project room message. */
8585
+ interface RoomAgentMessageInput {
8586
+ tenantId: string;
8587
+ workspaceId: string;
8588
+ projectId: string;
8589
+ roomId: string;
8590
+ membershipId: string;
8591
+ assistantId: string;
8592
+ text: string;
8593
+ sourceRoomMessageId: string;
8594
+ sourceId: string;
8595
+ idempotencyKey: string;
8596
+ }
8597
+ /** Minimal correlated reply input whose scope is derived from validated durable rows. */
8598
+ interface RoomAgentReplyInput {
8599
+ tenantId: string;
8600
+ membershipId: string;
8601
+ text: string;
8602
+ sourceRoomMessageId: string;
8603
+ inputMessageId: string;
8604
+ sourceId: string;
8605
+ idempotencyKey: string;
8606
+ }
8607
+ /**
8608
+ * Observes a canonical Agent-authored room message after durable persistence.
8609
+ *
8610
+ * @param message Detached clone of the canonical persisted message.
8611
+ * @returns Nothing, or a promise whose rejection is contained by the writer.
8612
+ */
8613
+ type RoomAgentMessageCommitted = (message: ProjectRoomMessage) => void | Promise<void>;
8614
+ /**
8615
+ * Reports a contained post-commit observer failure without exposing message content.
8616
+ *
8617
+ * @param event Safe canonical message ID and fixed failure code.
8618
+ * @returns Nothing; reporter exceptions are also contained by the writer.
8619
+ */
8620
+ type RoomAgentMessageCallbackFailure = (event: {
8621
+ messageId: string;
8622
+ code: "ROOM_MESSAGE_COMMIT_CALLBACK_FAILED";
8623
+ }) => void;
8624
+ /**
8625
+ * Persists Agent-authored room messages across strict, untrusted store boundaries.
8626
+ *
8627
+ * Inputs are synchronously snapshotted without invoking accessors. Source messages,
8628
+ * memberships, and canonical create results must be exact plain data records.
8629
+ *
8630
+ * @example
8631
+ * ```ts
8632
+ * const writer = new RoomAgentMessageService({ memberships, messages });
8633
+ * await writer.post(input);
8634
+ * ```
8635
+ */
8636
+ declare class RoomAgentMessageService {
8637
+ private readonly deps;
8638
+ /**
8639
+ * Creates a room writer over the durable membership and message stores.
8640
+ *
8641
+ * @param deps Store methods, optional deterministic ID factory, and detached post-commit hooks.
8642
+ */
8643
+ constructor(deps: {
8644
+ memberships: Pick<ProjectBotMembershipStore, "findById">;
8645
+ messages: Pick<ProjectRoomMessageStore, "findById" | "createIdempotent">;
8646
+ idFactory?: () => string;
8647
+ onMessageCommitted?: RoomAgentMessageCommitted;
8648
+ onCallbackFailure?: RoomAgentMessageCallbackFailure;
8649
+ });
8650
+ /**
8651
+ * Persists a fully scoped Agent response after validating its human source and active membership.
8652
+ *
8653
+ * @param input Exact trusted scope and response payload.
8654
+ * @returns A deep clone of the canonical idempotent room message.
8655
+ */
8656
+ post(input: RoomAgentMessageInput): Promise<ProjectRoomMessage>;
8657
+ /**
8658
+ * Persists a channel reply while deriving all scope from validated durable records.
8659
+ *
8660
+ * @param input Exact correlation IDs, tenant, target membership, and response text.
8661
+ * @returns A deep clone of the canonical idempotent room message.
8662
+ */
8663
+ postReply(input: RoomAgentReplyInput): Promise<ProjectRoomMessage>;
8664
+ private persistDerived;
8665
+ private persist;
8666
+ private notifyCommitted;
8667
+ }
8668
+
7828
8669
  /**
7829
8670
  * Agent Instance Manager
7830
8671
  *
@@ -7914,11 +8755,33 @@ type LifecycleResult = {
7914
8755
  eventKey?: string;
7915
8756
  warnings?: LifecycleWarning[];
7916
8757
  };
8758
+ /**
8759
+ * Exact winner metadata returned only by {@link TaskLifecycleService.startTask}.
8760
+ *
8761
+ * @remarks `transitioned` is true only for the invocation that won the pending snapshot CAS.
8762
+ */
8763
+ type StartLifecycleResult = {
8764
+ success: true;
8765
+ task: TaskItem;
8766
+ mutated: boolean;
8767
+ transitioned: boolean;
8768
+ eventKey?: string;
8769
+ warnings?: LifecycleWarning[];
8770
+ } | {
8771
+ success: false;
8772
+ transitioned: false;
8773
+ code: string;
8774
+ error: string;
8775
+ hint?: string;
8776
+ eventKey?: string;
8777
+ warnings?: LifecycleWarning[];
8778
+ };
7917
8779
  /** Stores and clock used by {@link TaskLifecycleService}. */
7918
8780
  interface TaskLifecycleServiceDeps {
7919
8781
  taskStore: TaskStore;
7920
8782
  workItemStore: TaskWorkItemStore;
7921
8783
  now?: () => Date;
8784
+ notifier?: TaskLifecycleNotifier;
7922
8785
  }
7923
8786
  /** Input shared by direct completion and completion repair. */
7924
8787
  interface AgentTaskCompletionInput {
@@ -8000,6 +8863,22 @@ interface InterruptTaskInput {
8000
8863
  summary: string;
8001
8864
  actor: string;
8002
8865
  threadId?: string;
8866
+ /** Required exact task IDs when the interruption waits on external dependencies. */
8867
+ dependencyTaskIds?: string[];
8868
+ }
8869
+ /** Parsed, canonical external-dependency interruption persisted by the lifecycle service. */
8870
+ interface ExternalDependencyInterruption {
8871
+ type: "external_dependency";
8872
+ summary: string;
8873
+ requestedAt: string;
8874
+ dependencyTaskIds: string[];
8875
+ }
8876
+ /** Exact roster, task, and Thread coordinates for a governed Project task reassignment. */
8877
+ interface ReassignProjectTaskInput {
8878
+ tenantId: string;
8879
+ taskId: string;
8880
+ authorization: ProjectTaskReassignmentAuthorization;
8881
+ actor: string;
8003
8882
  }
8004
8883
  /** Canonical identity and Belief State snapshot bound to completion evidence. */
8005
8884
  interface BeliefOwnerSnapshot {
@@ -8022,6 +8901,23 @@ interface BeliefOwnerSnapshot {
8022
8901
  };
8023
8902
  parentUpdatedAt?: string;
8024
8903
  }
8904
+ /**
8905
+ * Returns whether a task belongs to the trusted, nondefault Project lifecycle.
8906
+ *
8907
+ * @param task Task snapshot whose durable scope and trusted origin are inspected.
8908
+ * @returns True only for nondefault Project Room or Project Task origins.
8909
+ */
8910
+ declare function isProjectLifecycleTask(task: TaskItem): task is TaskItem & {
8911
+ workspaceId: string;
8912
+ projectId: string;
8913
+ };
8914
+ /**
8915
+ * Parses a descriptor-safe canonical external-dependency interruption.
8916
+ *
8917
+ * @param value Untrusted persisted interruption value.
8918
+ * @returns A cloned interruption with trimmed unique IDs, or undefined when malformed.
8919
+ */
8920
+ declare function parseExternalDependency(value: unknown): ExternalDependencyInterruption | undefined;
8025
8921
  /**
8026
8922
  * Owns atomic agent-task completion, review, repair, and belief reconciliation.
8027
8923
  *
@@ -8037,6 +8933,7 @@ interface BeliefOwnerSnapshot {
8037
8933
  declare class TaskLifecycleService {
8038
8934
  private readonly deps;
8039
8935
  private readonly now;
8936
+ private readonly notifier;
8040
8937
  /**
8041
8938
  * Creates a lifecycle service with injected stores and an optional test clock.
8042
8939
  *
@@ -8066,11 +8963,13 @@ declare class TaskLifecycleService {
8066
8963
  /** Atomically fails an active agent task and records an idempotent status event. */
8067
8964
  failTask(input: FailTaskInput): Promise<LifecycleResult>;
8068
8965
  /** Atomically starts a pending agent task and records an idempotent status event. */
8069
- startTask(input: StartTaskInput): Promise<LifecycleResult>;
8966
+ startTask(input: StartTaskInput): Promise<StartLifecycleResult>;
8070
8967
  /** Atomically retries a failed agent task and records an idempotent status event. */
8071
8968
  retryTask(input: StartTaskInput): Promise<LifecycleResult>;
8072
8969
  /** Atomically cancels a nonterminal agent task and records an idempotent status event. */
8073
8970
  cancelTask(input: CancelTaskInput): Promise<LifecycleResult>;
8971
+ /** Atomically transfers a stopped Project task to another active roster owner and Task Thread. */
8972
+ reassignProjectTask(input: ReassignProjectTaskInput): Promise<LifecycleResult>;
8074
8973
  /** Atomically records a governed blocking interruption for an in-progress agent task. */
8075
8974
  interruptTask(input: InterruptTaskInput): Promise<LifecycleResult>;
8076
8975
  /**
@@ -8146,6 +9045,10 @@ declare class TaskLifecycleService {
8146
9045
  private transitionAgentTask;
8147
9046
  private statusEventKey;
8148
9047
  private writeStatusEvent;
9048
+ private notifyWinningTransition;
9049
+ private validateExternalDependencies;
9050
+ private externalDependencyReadiness;
9051
+ private finishExternalDependencyInterruption;
8149
9052
  private clearAuditMarker;
8150
9053
  private writeReviewActivity;
8151
9054
  private createEvent;
@@ -8160,6 +9063,85 @@ declare class TaskLifecycleService {
8160
9063
  */
8161
9064
  declare function createTaskLifecycleService(deps?: TaskLifecycleServiceDeps): TaskLifecycleService;
8162
9065
 
9066
+ /** Describes one isolated Agent invocation for persistent task execution. */
9067
+ interface TaskAgentInvocation {
9068
+ tenantId: string;
9069
+ workspaceId?: string;
9070
+ projectId?: string;
9071
+ taskId: string;
9072
+ agentId: string;
9073
+ threadId: string;
9074
+ message: string;
9075
+ /** Internal authority passed only to the delegated worker runtime. */
9076
+ delegatedTaskId: string;
9077
+ taskExecutionRole: "worker";
9078
+ }
9079
+ /** Injected persistence and Agent runtime dependencies for task execution. */
9080
+ interface TaskExecutionServiceDeps {
9081
+ taskStore: TaskStore;
9082
+ workItemStore: TaskWorkItemStore;
9083
+ invokeAgent: (input: TaskAgentInvocation) => Promise<unknown>;
9084
+ resolveAgent: (tenantId: string, agentId: string) => Promise<boolean>;
9085
+ createThreadId?: () => string;
9086
+ }
9087
+ /** Identifies a persistent task, target Agent, caller, and runtime scope. */
9088
+ interface StartTaskExecutionInput {
9089
+ tenantId: string;
9090
+ workspaceId?: string;
9091
+ projectId?: string;
9092
+ taskId: string;
9093
+ agentId: string;
9094
+ actor: string;
9095
+ callerThreadId?: string;
9096
+ }
9097
+ /** Successful isolated execution observation recorded for later reconciliation. */
9098
+ interface TaskExecutionSuccess {
9099
+ success: true;
9100
+ taskId: string;
9101
+ agentId: string;
9102
+ threadId: string;
9103
+ observation: unknown;
9104
+ executionResultId: string;
9105
+ warnings?: LifecycleWarning[];
9106
+ }
9107
+ /** Typed validation, lifecycle, or Agent invocation failure. */
9108
+ interface TaskExecutionFailure {
9109
+ success: false;
9110
+ code: string;
9111
+ error: string;
9112
+ taskId?: string;
9113
+ agentId?: string;
9114
+ threadId?: string;
9115
+ executionResultId?: string;
9116
+ blockedBy?: string[];
9117
+ invocationError?: string;
9118
+ warnings?: LifecycleWarning[];
9119
+ }
9120
+ /** Result returned by a persistent task execution attempt. */
9121
+ type TaskExecutionResult = TaskExecutionSuccess | TaskExecutionFailure;
9122
+ /**
9123
+ * Creates a synchronous persistent-task execution service from injected stores and Agent adapters.
9124
+ *
9125
+ * @param deps Task stores, target resolution, isolated invocation, and optional thread ID generation.
9126
+ * @returns A service whose `start` method validates, starts, dispatches, and records an observation.
9127
+ *
9128
+ * @example
9129
+ * ```ts
9130
+ * const service = createTaskExecutionService({ taskStore, workItemStore, resolveAgent, invokeAgent });
9131
+ * const result = await service.start({ tenantId, taskId, agentId, actor });
9132
+ * ```
9133
+ *
9134
+ * @remarks A returned observation is execution evidence only. This service never completes or fails the TaskItem.
9135
+ */
9136
+ declare function createTaskExecutionService(deps: TaskExecutionServiceDeps): {
9137
+ start: (input: StartTaskExecutionInput) => Promise<TaskExecutionResult>;
9138
+ };
9139
+
9140
+ /** Internal authority for immediate delegated worker execution. */
9141
+ declare const DELEGATED_WORKER_SCOPE_TOKEN: unique symbol;
9142
+ /** Reports whether a run configuration contains the private delegated token key. */
9143
+ declare function hasDelegatedWorkerToken(runConfig: Record<string, unknown> & Partial<Record<typeof DELEGATED_WORKER_SCOPE_TOKEN, unknown>>): boolean;
9144
+
8163
9145
  declare const AGENT_TASK_EVENT = "agent:execute";
8164
9146
 
8165
9147
  /**
@@ -8469,6 +9451,35 @@ declare const documentLearningPlugin: Plugin;
8469
9451
  /** Built-in Document Parser plugin definition. */
8470
9452
  declare const documentParserPlugin: Plugin;
8471
9453
 
9454
+ /**
9455
+ * Semantic Metrics Middleware & Plugin (connection-backed, /api/v1).
9456
+ *
9457
+ * Exposes datasource exploration, meta publishing, and runtime query tools.
9458
+ * Credentials are resolved via the framework-injected `_resolvedConnections`.
9459
+ */
9460
+
9461
+ /**
9462
+ * Create the Semantic Metrics middleware exposing three action-dispatch tools.
9463
+ *
9464
+ * @param config - Plugin config; reads `config._resolvedConnections` (framework-injected).
9465
+ * @returns Middleware with the datasource/meta/runtime tool set.
9466
+ */
9467
+ declare function createSemanticMetricsMiddleware(config: Record<string, unknown>): AgentMiddleware;
9468
+ /** Built-in Semantic Metrics plugin definition. */
9469
+ declare const semanticMetricsPlugin: Plugin;
9470
+
9471
+ /**
9472
+ * Creates the always-available, fail-closed Project Room tool middleware.
9473
+ *
9474
+ * The tools derive all identity from host-injected trusted run context. They do
9475
+ * not accept tenant, room, membership, Agent, or Thread identifiers from callers.
9476
+ *
9477
+ * @returns Middleware exposing trusted room posting and roster listing tools.
9478
+ */
9479
+ declare function createProjectRoomMiddleware(): AgentMiddleware;
9480
+ /** Built-in Project Room plugin metadata and middleware factory. */
9481
+ declare const projectRoomPlugin: Plugin;
9482
+
8472
9483
  /** Stable reasons for rejecting capability bundle input. */
8473
9484
  type CapabilityBundleValidationErrorCode = "CAPABILITY_BUNDLE_EMPTY_FIELD" | "CAPABILITY_BUNDLE_INELIGIBLE_CAPABILITY" | "CAPABILITY_BUNDLE_INVALID_CAPABILITY" | "CAPABILITY_BUNDLE_DUPLICATE_CAPABILITY" | "CAPABILITY_BUNDLE_EMPTY_ALLOWED_TOOLS" | "CAPABILITY_BUNDLE_UNKNOWN_TOOL" | "CAPABILITY_BUNDLE_TOOLS_UNAVAILABLE" | "CAPABILITY_BUNDLE_NULL_VALUE" | "CAPABILITY_BUNDLE_UNSAFE_KEY" | "CAPABILITY_BUNDLE_NESTED_REFERENCE" | "CAPABILITY_BUNDLE_INVALID_CONFIG" | "CAPABILITY_BUNDLE_CYCLIC_CONFIG" | "CAPABILITY_BUNDLE_CONFIG_TOO_DEEP" | "CAPABILITY_BUNDLE_CONFIG_TOO_LARGE" | "CAPABILITY_BUNDLE_NON_JSON_VALUE" | "CAPABILITY_BUNDLE_CREDENTIALS_FORBIDDEN";
8474
9485
  /** Describes invalid capability bundle input with a stable code and location. */
@@ -8740,6 +9751,119 @@ interface TaskMiddlewareConfig {
8740
9751
  }
8741
9752
  declare function createTaskMiddleware(options?: TaskMiddlewareConfig): AgentMiddleware;
8742
9753
 
9754
+ /** Maximum UTF-8 bytes retained for each scalar string in a task response fallback. */
9755
+ declare const TASK_RESPONSE_SCALAR_MAX_BYTES = 4096;
9756
+ /** Maximum existing warnings copied into a task mutation serialization fallback. */
9757
+ declare const TASK_RESPONSE_PRIOR_WARNING_LIMIT = 100;
9758
+ /** Maximum warnings after mandatory serialization and reconciliation warnings are appended. */
9759
+ declare const TASK_RESPONSE_FINAL_WARNING_LIMIT = 102;
9760
+ type SafeRecord = Record<string, unknown>;
9761
+ /** Result of parsing and bounded normalization for one task response. */
9762
+ type TaskResponseParseResult = {
9763
+ kind: "parse_failure";
9764
+ } | {
9765
+ kind: "parsed_non_object";
9766
+ } | {
9767
+ kind: "parsed_object";
9768
+ success: boolean | undefined;
9769
+ normalization: "succeeded";
9770
+ normalized: SafeRecord;
9771
+ } | {
9772
+ kind: "parsed_object";
9773
+ success: boolean | undefined;
9774
+ normalization: "failed";
9775
+ };
9776
+ /**
9777
+ * Builds a detached, prototype-safe fallback for a successful task mutation.
9778
+ *
9779
+ * @param taskId Persisted task identity to preserve.
9780
+ * @param mutationCommitted Whether the primary mutation actually committed.
9781
+ * @param metadata Lifecycle and warning metadata to copy as bounded scalars.
9782
+ * @returns A null-prototype partial-success record safe for captured JSON serialization.
9783
+ */
9784
+ declare function buildTaskMutationFallback(taskId: string, mutationCommitted: boolean, metadata?: SafeRecord): SafeRecord;
9785
+ /**
9786
+ * Serializes a successful task mutation, falling back without revisiting a hostile task.
9787
+ *
9788
+ * @param taskId Persisted task identity.
9789
+ * @param task Task snapshot included in the normal response.
9790
+ * @param mutationCommitted Whether the primary mutation committed.
9791
+ * @param metadata Lifecycle metadata included in the normal response and detached fallback.
9792
+ * @returns A JSON response preserving normal shape or a scalar-only partial success.
9793
+ */
9794
+ declare function serializeTaskMutationSuccess(taskId: string, task: unknown, mutationCommitted: boolean, metadata?: SafeRecord): string;
9795
+ /**
9796
+ * Serializes a read-only task-bearing response with a stable typed failure fallback.
9797
+ *
9798
+ * @param value Complete get/list response value.
9799
+ * @returns Normal JSON or `TASK_RESPONSE_SERIALIZATION_FAILED` without unsafe task IDs.
9800
+ */
9801
+ declare function serializeTaskReadResponse(value: unknown): string;
9802
+ /**
9803
+ * Parses and normalizes a task response through captured JSON and bounded JSON-safe conversion.
9804
+ *
9805
+ * @param response JSON task response.
9806
+ * @returns A discriminated parse result with top-level success and optional normalized record.
9807
+ */
9808
+ declare function parseTaskResponse(response: string): TaskResponseParseResult;
9809
+ /**
9810
+ * Builds a small factual response when successful response normalization fails.
9811
+ *
9812
+ * @param taskId Task associated with the response.
9813
+ * @param mutationCommitted Actual primary mutation fact.
9814
+ * @returns A null-prototype partial success with a protected normalization warning.
9815
+ */
9816
+ declare function buildTaskNormalizationFallback(taskId: string, mutationCommitted: boolean): SafeRecord;
9817
+ /**
9818
+ * Serializes the small factual response used after successful normalization failure.
9819
+ *
9820
+ * @param taskId Task associated with the response.
9821
+ * @param mutationCommitted Actual primary mutation fact.
9822
+ * @returns Captured-stringify JSON partial success.
9823
+ */
9824
+ declare function serializeTaskNormalizationFallback(taskId: string, mutationCommitted: boolean): string;
9825
+ /**
9826
+ * Reads an own task-response field without trusting inherited properties or accessors.
9827
+ *
9828
+ * @param response Normalized task response record.
9829
+ * @param field Field to read.
9830
+ * @returns The own field value, or undefined when absent/inaccessible.
9831
+ */
9832
+ declare function ownTaskResponseField(response: SafeRecord, field: string): unknown;
9833
+ /**
9834
+ * Extracts a bounded own string ID from a task without propagating hostile access errors.
9835
+ *
9836
+ * @param task Task-like runtime value.
9837
+ * @returns Bounded task ID, or undefined when it cannot be read safely.
9838
+ */
9839
+ declare function safeTaskResponseId(task: unknown): string | undefined;
9840
+ /**
9841
+ * Appends a bounded reconciliation warning to normalized response data.
9842
+ *
9843
+ * @param response Existing JSON response.
9844
+ * @param taskId Task whose reconciliation failed.
9845
+ * @param error Reconciliation error to summarize safely.
9846
+ * @param mutationCommitted Actual primary mutation fact for emergency fallback construction.
9847
+ * @returns Captured-stringify JSON with a protected warning array and bounded cardinality.
9848
+ */
9849
+ declare function appendReconciliationWarning(parsedResponse: TaskResponseParseResult, taskId: string, error: unknown, mutationCommitted: boolean): string;
9850
+ /** Input for factual task mutation response post-processing. */
9851
+ interface PostProcessTaskMutationResponseInput {
9852
+ response: string;
9853
+ taskId: string;
9854
+ executionResultId?: string;
9855
+ mutationCommitted: boolean;
9856
+ validationError?: unknown;
9857
+ reconcile: (normalizedResponse: SafeRecord) => Promise<void>;
9858
+ }
9859
+ /**
9860
+ * Applies one-pass parsing, factual fallback, validation warnings, and exact reconciliation.
9861
+ *
9862
+ * @param input Response plus internally known mutation and reconciliation facts.
9863
+ * @returns Original or bounded JSON response after reconciliation post-processing.
9864
+ */
9865
+ declare function postProcessTaskMutationResponse(input: PostProcessTaskMutationResponseInput): Promise<string>;
9866
+
8743
9867
  type ResolveAgentFn = (ref?: string, responseFormat?: Record<string, unknown>, stepType?: string) => Promise<AgentClient>;
8744
9868
  /**
8745
9869
  * Build a LangGraph Annotation.Root from DSL state.fields.
@@ -9231,4 +10355,70 @@ declare class IdRemapper {
9231
10355
  remapSkillIds(graphDefinition: Record<string, unknown>, skillRemap: Record<string, string>): Record<string, unknown>;
9232
10356
  }
9233
10357
 
9234
- export { AGENT_TASK_EVENT, type AddMessageParams, Agent, type AgentClient, type AgentExecutor, AgentInstanceManager, type AgentLattice, AgentLatticeManager, type AgentLifecycleEventName, AgentManager, type AgentStreamExecutor, type AgentTaskCompletionInput, type AgentThreadInterface, type ApproveInterruptedTaskInput, BUILTIN_PLUGINS, BUILTIN_SKILLS, type BackendFactory, type BackendProtocol, 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, CollectionLatticeManager, type ColumnInfo, CompositeBackend, type ConflictItem, type ConnectAllChannelsOptions, ConnectionRegistry, ConsoleLoggerClient, type CreateSandboxProviderConfig, type CronFields, CustomMetricsClient, type CustomMiddlewareFactory, CustomMiddlewareRegistry, DEFAULT_CALIBRATION_PROBES, type DatabaseConfig, type DatabaseType, DaytonaInstance, DaytonaProvider, type DaytonaProviderConfig, DefaultScheduleClient, type DeleteResult, DependencyResolver, E2BInstance, E2BProvider, type E2BProviderConfig, EMPTY_CONTENT_WARNING, type EditResult, type EmbeddingsInfo, type EmbeddingsLatticeInterface, EmbeddingsLatticeManager, type EnsureMicrosandboxInput, type EvalRunService, 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 GrepMatch, type IMessageQueueStore, type IMetricsServerClient, type ISqlDatabase, IdRemapper, type ImportApplyResolution, type ImportApplyResult, type ImportEntityResult, type ImportEntityStatus, type ImportPreviewResult, InMemoryA2AApiKeyStore, InMemoryAgentWebAppStore, InMemoryAssistantStore, InMemoryBindingStore, InMemoryCapabilityBundleStore, InMemoryChannelInstallationStore, InMemoryChunkBuffer, InMemoryCollectionStore, InMemoryDatabaseConfigStore, InMemoryMailboxStore, InMemoryMenuStore, InMemoryTaskListStore, InMemoryTaskStore, InMemoryTenantStore, InMemoryThreadMessageQueueStore, InMemoryThreadStore, 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, type LifecycleResult, type LifecycleWarning, LocalSandboxInstance, LocalSandboxProvider, type LocalSandboxProviderConfig, type LoggerLattice, LoggerLatticeManager, MAX_LINE_LENGTH, MAX_PACK_ENTRIES, MAX_PACK_FILE_BYTES, MAX_PACK_TOTAL_BYTES, type MailboxMessage, type MailboxStore, type McpLatticeInterface, McpLatticeManager, type McpServerInfo, MemoryBackend, MemoryLatticeManager, MemoryQueueClient, MemoryScheduleStorage, type MessageCompletedEvent, type MessageContent, type MessageContentPart, type MessageContentValue, type MessageFailedEvent, type MessageLike, type MessageStartedEvent, MessageType, MetricsServerManager, MicrosandboxRemoteInstance, MicrosandboxRemoteProvider, type MicrosandboxRemoteProviderClient, type MicrosandboxRemoteProviderConfig, MicrosandboxServiceClient, type MicrosandboxServiceClientConfig, type MicrosandboxShellExecInput, type ModelConfig, type ModelLatticeInterface, ModelLatticeManager, MysqlDatabase, type OutputType, PACK_DIRECTORY_TIMEOUT_SECONDS, type PackSourceInfo, type PendingMessage, PersonalAssistantConfig, PinoLoggerClient, PluginRegistry, PostgresDatabase, type PreviewError, PrometheusClient, type QueryResult, type QueueLattice, QueueLatticeManager, type QueueMessage, QueueMode, type QueuePendingEvent, type QueueScope, type ReconcileTaskDescriptionInput, type RejectInterruptedTaskInput, RemoteSandboxInstance, RemoteSandboxProvider, type RemoteSandboxProviderConfig, type Resolution, type ResolutionAction, type ResolveAgentFn, type ResolvedConfig, type ResumeTaskResult, type RunSandboxConfig, type RuntimeModelConfig, type RuntimeSkillSelection, SAFE_PATH_COMPONENT, type STTModelInfo, STTModelLattice, type STTModelLatticeInterface, STTModelLatticeManager, type SandboxFileInfo, type SandboxFileService, SandboxFilesystem, type SandboxInstance, type SandboxIsolationLevel, SandboxLatticeManager, type SandboxManagerProtocol, type SandboxProvider, type SandboxProviderFactory, type SandboxProviderType, type SandboxShellService, SandboxSkillStore, type SandboxSkillStoreOptions, type SandboxVolumeDefinition, type ScheduleLattice, ScheduleLatticeManager, type SchedulerMiddlewareOptions, SemanticMetricsClient, type SharePayload, SimpleMemoryVectorStore, type SkillLattice, SkillLatticeManager, type SkillMeta, type SkillResource, SqlDatabaseManager, type StateAndStore, StateBackend, StoreBackend, type StoreLattice, StoreLatticeManager, type StoreType, type StoreTypeMap, type SubmitTaskReviewInput, TOOL_RESULT_TOKEN_LIMIT, TRUNCATION_GUIDANCE, type TableInfo, type TableSchema, type TaskEvent, TaskLifecycleService, type TaskLifecycleServiceDeps, type TaskListStore, type TaskSpec, TaskStatus, type TaskUpdatable, TeamAgentGraphBuilder, type TeamConfig, type TeamMiddlewareOptions, type TeamTask, type TeammateSpec, type TeammateToolsOptions, type ThreadBuffer, type ThreadBufferConfig, type ThreadBusyEvent, type ThreadIdleEvent, type ThreadInfo, type ThreadQueueConfig, type ThreadState, ThreadStatus, type ThreadStatusChangedEvent, TokenCache, type ToolDefinition, type ToolLattice, ToolLatticeManager, type UnknownToolHandlerConfig, type VectorStoreLatticeInterface, VectorStoreLatticeManager, type VectorStoreProviderLattice, VectorStoreProviderManager, VolumeFilesystem, type VolumeFsClient, type WorkflowValidationError, type WriteResult, abortWorkflowRun, agentInstanceManager, agentLatticeManager, buildGrepResultsDict, buildInput, buildNamedVolumeName, buildRemotePackDirectoryCommand, buildSandboxMetadataEnv, buildSkillFile, buildStateAnnotation, buildTableName, checkEmptyContent, clearEncryptionKeyCache, clearEvalRunService, collectionLatticeManager, compileInternal, compileWorkflow, computeSandboxName, configureStores, connectAllChannels, createAgentNode, createAgentTeam, createCapabilityGuardMiddleware, createExecuteSqlQueryTool, createFileData, createInfoSqlTool, createListMetricsDataSourcesTool, createListMetricsServersTool, createListTablesSqlTool, createMapNode, createModelSelectorMiddleware, createNodeHandler, createQueryCheckerSqlTool, createQueryMetricDefinitionTool, createQueryMetricsListTool, createQuerySemanticMetricDataTool, createQuerySqlTool, createQueryTableDefinitionTool, createQueryTablesListTool, createResourceAddress, createSandboxProvider, createSchedulerMiddleware, createSharePayload, createTaskLifecycleService, createTaskMiddleware, createTeamMiddleware, createTeammateTools, createUnknownToolHandlerMiddleware, createWidgetMiddleware, decrypt, describeCronExpression, documentLearningPlugin, documentParserPlugin, embeddingsLatticeManager, encrypt, ensureBuiltinAgentsForTenant, ensurePluginSkillInSandbox, evaluateLatticeCaseWithLogs, eventBus, eventBus as eventBusDefault, extractFetcherError, extractOutput, fileDataToString, formatContentWithLineNumbers, formatGrepMatches, formatGrepResults, formatReadResponse, generateToken, getAgentClient, getAgentConfig, getAllAgentConfigs, getAllBuiltInSkillMetas, getAllToolDefinitions, getBindingRegistry, getBuiltInSkillContent, getBuiltInSkillMeta, getBuiltInSkillNames, getCheckpointSaver, getChunkBuffer, getCollectionEntryCount, getEmbeddingsClient, getEmbeddingsLattice, getEncryptionKey, getEvalRunService, getLoggerLattice, getMenuRegistry, getModelLattice, getNextCronTime, getOrCreateCollectionVectorStore, getPluginSkillManifestVersion, getQueueLattice, getRuntimeCapabilityConfig, getRuntimeSkillSelection, getSTTClient, getSTTClientWithTenant, getSTTModelLattice, getSandBoxManager, getScheduleLattice, getStoreLattice, getToolClient, getToolDefinition, getToolLattice, getVectorStoreClient, getVectorStoreLattice, getVectorStoreProvider, getWorkflowSignal, globSearchFiles, grepMatchesFromFiles, grepSearchFiles, hasChunkBuffer, hasRuntimeCapabilityPolicy, invokeWithRetry, isBuiltInSkill, isPluginSkillAuthorizedInSandbox, isPluginSkillManagedInSandbox, isUsingDefaultKey, isValidCronExpression, isValidSandboxName, isValidSkillName, listCollectionEntries, listSandboxProviderTypes, loggerLatticeManager, mcpManager, mergeCapabilityBundles, metricsServerManager, modelLatticeManager, normalizeSandboxName, parallelLimit, parseCronExpression, parseJudgeVerdict, parsePackSize, parseSkillFrontmatter, parseYaml, performStringReplacement, queueLatticeManager, registerAgentLattice, registerAgentLatticeWithTenant, registerAgentLattices, registerCheckpointSaver, registerChunkBuffer, registerEmbeddingsLattice, registerExistingTool, registerLoggerLattice, registerModelLattice, registerQueueLattice, registerSTTModelLattice, registerSandboxProviderType, registerScheduleLattice, registerStoreLattice, registerTeammateAgent, registerToolLattice, registerVectorStoreLattice, registerVectorStoreProvider, registerWorkflowRun, removeCollectionVectorStore, renderTemplate, resolveJudgeModelKey, resolvePath, runRemotePackDirectory, sandboxLatticeManager, sanitizeToolCallId, scheduleLatticeManager, serializePluginMeta, setBindingRegistry, setEvalRunService, setMenuRegistry, skillLatticeManager, sqlDatabaseManager, storeLatticeManager, sttModelLatticeManager, toJsonSchema, toSafeStateExpr, toolLatticeManager, truncateIfTooLong, unregisterTeammateAgent, unregisterWorkflowRun, updateFileData, validateAgentInput, validateCapabilityBundleInput, validateDSL, validateEncryptionKey, validatePackSourcePath, validatePath, validateRelativePath, validateSkillName, validateToolInput, vectorStoreLatticeManager, vectorStoreProviderManager };
10358
+ /**
10359
+ * Generates a deterministic project ID for a direct human room.
10360
+ *
10361
+ * The ID is deterministic because the same pair of users always produces the same ID,
10362
+ * which enables idempotent room creation.
10363
+ *
10364
+ * @param tenantId - The tenant ID
10365
+ * @param workspaceId - The workspace ID
10366
+ * @param userId1 - First user's ID
10367
+ * @param userId2 - Second user's ID
10368
+ * @returns A deterministic project ID with prefix "direct_human_"
10369
+ *
10370
+ * @example
10371
+ * ```ts
10372
+ * const id = generateDirectHumanProjectId("tenant-1", "workspace-1", "user-a", "user-b");
10373
+ * // Always returns the same ID regardless of argument order
10374
+ * ```
10375
+ */
10376
+ declare function generateDirectHumanProjectId(tenantId: string, workspaceId: string, userId1: string, userId2: string): string;
10377
+ /**
10378
+ * Generates a deterministic project ID for a direct bot room.
10379
+ *
10380
+ * The ID is deterministic because the same user + bot pair always produces the same ID,
10381
+ * which enables idempotent room creation.
10382
+ *
10383
+ * @param tenantId - The tenant ID
10384
+ * @param workspaceId - The workspace ID
10385
+ * @param userId - The user's ID
10386
+ * @param assistantId - The bot/assistant's ID
10387
+ * @returns A deterministic project ID with prefix "direct_bot_"
10388
+ *
10389
+ * @example
10390
+ * ```ts
10391
+ * const id = generateDirectBotProjectId("tenant-1", "workspace-1", "user-1", "assistant-1");
10392
+ * ```
10393
+ */
10394
+ declare function generateDirectBotProjectId(tenantId: string, workspaceId: string, userId: string, assistantId: string): string;
10395
+ /**
10396
+ * Parses a direct room project ID to extract its type.
10397
+ *
10398
+ * @param projectId - The project ID to parse
10399
+ * @returns The type of direct room, or null if not a direct room
10400
+ *
10401
+ * @example
10402
+ * ```ts
10403
+ * parseDirectRoomType("direct_human_abc123"); // "human"
10404
+ * parseDirectRoomType("direct_bot_xyz789"); // "bot"
10405
+ * parseDirectRoomType("normal-project-id"); // null
10406
+ * ```
10407
+ */
10408
+ declare function parseDirectRoomType(projectId: string): "human" | "bot" | null;
10409
+ /**
10410
+ * Checks if a project ID represents a direct room.
10411
+ *
10412
+ * @param projectId - The project ID to check
10413
+ * @returns True if this is a direct room project ID
10414
+ *
10415
+ * @example
10416
+ * ```ts
10417
+ * isDirectRoom("direct_human_abc123"); // true
10418
+ * isDirectRoom("direct_bot_xyz789"); // true
10419
+ * isDirectRoom("normal-project-id"); // false
10420
+ * ```
10421
+ */
10422
+ declare function isDirectRoom(projectId: string): boolean;
10423
+
10424
+ 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, BUILTIN_PLUGINS, BUILTIN_SKILLS, type BackendFactory, type BackendProtocol, 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, CollectionLatticeManager, type ColumnInfo, CompositeBackend, type ConflictItem, type ConnectAllChannelsOptions, ConnectionRegistry, ConsoleLoggerClient, type CreateSandboxProviderConfig, type CronFields, CustomMetricsClient, type CustomMiddlewareFactory, CustomMiddlewareRegistry, DEFAULT_CALIBRATION_PROBES, type DatabaseConfig, type DatabaseType, DaytonaInstance, DaytonaProvider, type DaytonaProviderConfig, DefaultScheduleClient, DelegatedScopeNotQueueableError, type DeleteResult, DependencyResolver, DuplicateProjectRoomMessageIdempotencyKeyError, E2BInstance, E2BProvider, type E2BProviderConfig, EMPTY_CONTENT_WARNING, type EditResult, type EmbeddingsInfo, type EmbeddingsLatticeInterface, EmbeddingsLatticeManager, type EnsureMicrosandboxInput, type EvalRunService, type ExportBundle, type ExportContext, type ExportJob, type ExportableEntity, type ExportableEntityDefinition, ExportableEntityRegistry, type ExportableFile, type ExportableTypeInfo, type ExternalDependencyInterruption, type FileData, type FileInfo, FileSystemSkillStore, type FileSystemSkillStoreOptions, FilesystemBackend, type FsEntry, type GrepMatch, type IMessageQueueStore, type IMetricsServerClient, type ISqlDatabase, IdRemapper, type ImportApplyResolution, type ImportApplyResult, type ImportEntityResult, type ImportEntityStatus, type ImportPreviewResult, InMemoryA2AApiKeyStore, InMemoryAgentWebAppStore, InMemoryAssistantStore, InMemoryBindingStore, InMemoryCapabilityBundleStore, InMemoryChannelInstallationStore, InMemoryChunkBuffer, InMemoryCollectionStore, InMemoryDatabaseConfigStore, InMemoryMailboxStore, InMemoryMenuStore, InMemoryProjectBotMembershipStore, InMemoryProjectMembershipStore, InMemoryProjectRoomCoordinator, InMemoryProjectRoomMessageStore, InMemoryProjectRoomStore, InMemoryTaskListStore, InMemoryTaskStore, InMemoryTenantStore, InMemoryThreadMessageQueueStore, InMemoryThreadStore, 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, type LifecycleResult, type LifecycleWarning, LocalSandboxInstance, LocalSandboxProvider, type LocalSandboxProviderConfig, type LoggerLattice, LoggerLatticeManager, MAX_LINE_LENGTH, MAX_PACK_ENTRIES, MAX_PACK_FILE_BYTES, MAX_PACK_TOTAL_BYTES, type MailboxMessage, type MailboxStore, type McpLatticeInterface, McpLatticeManager, type McpServerInfo, MemoryBackend, MemoryLatticeManager, MemoryQueueClient, MemoryScheduleStorage, 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, type OutputType, PACK_DIRECTORY_TIMEOUT_SECONDS, type PackSourceInfo, type PendingMessage, PersonalAssistantConfig, PinoLoggerClient, PluginRegistry, 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 QueryResult, type QueueLattice, QueueLatticeManager, type QueueMessage, QueueMode, type QueuePendingEvent, type QueueScope, type ReassignProjectTaskInput, type ReconcileTaskDescriptionInput, type RejectInterruptedTaskInput, RemoteSandboxInstance, RemoteSandboxProvider, type RemoteSandboxProviderConfig, type ReplyReadyEvent, type Resolution, type ResolutionAction, type ResolveAgentFn, type ResolvedConfig, type ResumeTaskResult, type RoomAgentMessageCallbackFailure, type RoomAgentMessageCommitted, type RoomAgentMessageInput, RoomAgentMessageService, type RoomAgentReplyInput, type RunSandboxConfig, type RuntimeModelConfig, type RuntimeSkillSelection, SAFE_PATH_COMPONENT, type STTModelInfo, STTModelLattice, type STTModelLatticeInterface, STTModelLatticeManager, type SandboxFileInfo, type SandboxFileService, SandboxFilesystem, type SandboxInstance, type SandboxIsolationLevel, SandboxLatticeManager, type SandboxManagerProtocol, type SandboxProvider, type SandboxProviderFactory, type SandboxProviderType, type SandboxShellService, SandboxSkillStore, type SandboxSkillStoreOptions, type SandboxVolumeDefinition, type ScheduleLattice, ScheduleLatticeManager, type SchedulerMiddlewareOptions, SemanticMetricsClient, 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 TaskExecutionResult, type TaskExecutionServiceDeps, type TaskExecutionSuccess, type TaskLifecycleListener, type TaskLifecycleNotification, TaskLifecycleNotifier, TaskLifecycleService, type TaskLifecycleServiceDeps, type TaskListStore, type TaskResponseParseResult, type TaskSpec, TaskStatus, type TaskUpdatable, TeamAgentGraphBuilder, type TeamConfig, type TeamMiddlewareOptions, type TeamTask, type TeammateSpec, type TeammateToolsOptions, type ThreadBuffer, type ThreadBufferConfig, type ThreadBusyEvent, type ThreadIdleEvent, type ThreadInfo, type ThreadQueueConfig, type ThreadState, ThreadStatus, type ThreadStatusChangedEvent, TokenCache, type ToolDefinition, type ToolLattice, ToolLatticeManager, type TrustedAgentMessageDispatcher, type TrustedMessageOptions, type UnknownToolHandlerConfig, type VectorStoreLatticeInterface, VectorStoreLatticeManager, type VectorStoreProviderLattice, VectorStoreProviderManager, VolumeFilesystem, type VolumeFsClient, type WorkflowValidationError, type WriteResult, abortWorkflowRun, agentInstanceManager, agentLatticeManager, appendReconciliationWarning, buildGrepResultsDict, buildInput, buildNamedVolumeName, buildRemotePackDirectoryCommand, buildSandboxMetadataEnv, buildSkillFile, buildStateAnnotation, buildTableName, buildTaskMutationFallback, buildTaskNormalizationFallback, checkEmptyContent, clearEncryptionKeyCache, clearEvalRunService, collectionLatticeManager, compileInternal, compileWorkflow, computeSandboxName, configureStores, connectAllChannels, createAgentNode, createAgentTeam, createCapabilityGuardMiddleware, createExecuteSqlQueryTool, createFileData, createInfoSqlTool, createListMetricsDataSourcesTool, createListMetricsServersTool, createListTablesSqlTool, createMapNode, createModelSelectorMiddleware, createNodeHandler, createProjectRoomMiddleware, createProjectTaskOwnerPolicy, createProjectTaskReassignmentAuthorizer, createQueryCheckerSqlTool, createQueryMetricDefinitionTool, createQueryMetricsListTool, createQuerySemanticMetricDataTool, createQuerySqlTool, createQueryTableDefinitionTool, createQueryTablesListTool, createResourceAddress, createSandboxProvider, createSchedulerMiddleware, createSemanticMetricsMiddleware, createSharePayload, createTaskExecutionService, createTaskLifecycleService, createTaskMiddleware, createTeamMiddleware, createTeammateTools, createTrustedAgentMessageDispatcher, createUnknownToolHandlerMiddleware, createWidgetMiddleware, decrypt, describeCronExpression, documentLearningPlugin, documentParserPlugin, embeddingsLatticeManager, encrypt, ensureBuiltinAgentsForTenant, ensurePluginSkillInSandbox, evaluateLatticeCaseWithLogs, eventBus, eventBus as eventBusDefault, extractFetcherError, extractOutput, fileDataToString, formatContentWithLineNumbers, formatGrepMatches, formatGrepResults, formatReadResponse, generateDirectBotProjectId, generateDirectHumanProjectId, generateToken, getAgentClient, getAgentConfig, getAllAgentConfigs, getAllBuiltInSkillMetas, getAllToolDefinitions, getBindingRegistry, getBuiltInSkillContent, getBuiltInSkillMeta, getBuiltInSkillNames, getCheckpointSaver, getChunkBuffer, getCollectionEntryCount, getEmbeddingsClient, getEmbeddingsLattice, getEncryptionKey, getEvalRunService, getLoggerLattice, getMenuRegistry, getModelLattice, getNextCronTime, getOrCreateCollectionVectorStore, getPluginSkillManifestVersion, getQueueLattice, getRuntimeCapabilityConfig, getRuntimeSkillSelection, getSTTClient, getSTTClientWithTenant, getSTTModelLattice, getSandBoxManager, getScheduleLattice, getStoreLattice, getToolClient, getToolDefinition, getToolLattice, getVectorStoreClient, getVectorStoreLattice, getVectorStoreProvider, getWorkflowSignal, globSearchFiles, grepMatchesFromFiles, grepSearchFiles, hasChunkBuffer, hasDelegatedWorkerToken, hasRuntimeCapabilityPolicy, invokeWithRetry, isBuiltInSkill, isDirectRoom, isPluginSkillAuthorizedInSandbox, isPluginSkillManagedInSandbox, isProjectLifecycleTask, isUsingDefaultKey, isValidCronExpression, isValidSandboxName, isValidSkillName, listCollectionEntries, listSandboxProviderTypes, loggerLatticeManager, mcpManager, mergeCapabilityBundles, metricsServerManager, modelLatticeManager, normalizeSandboxName, ownTaskResponseField, parallelLimit, parseCronExpression, parseDirectRoomType, parseExternalDependency, parseJudgeVerdict, parsePackSize, parseSkillFrontmatter, parseTaskResponse, parseYaml, performStringReplacement, postProcessTaskMutationResponse, projectMutationMutex, projectRoomPlugin, projectTaskAdmissionNotifier, queueLatticeManager, registerAgentLattice, registerAgentLatticeWithTenant, registerAgentLattices, registerCheckpointSaver, registerChunkBuffer, registerEmbeddingsLattice, registerExistingTool, registerLoggerLattice, registerModelLattice, registerQueueLattice, registerSTTModelLattice, registerSandboxProviderType, registerScheduleLattice, registerStoreLattice, registerTeammateAgent, registerToolLattice, registerVectorStoreLattice, registerVectorStoreProvider, registerWorkflowRun, removeCollectionVectorStore, renderTemplate, resolveJudgeModelKey, resolvePath, runRemotePackDirectory, safeTaskResponseId, sandboxLatticeManager, sanitizeToolCallId, scheduleLatticeManager, semanticMetricsPlugin, serializePluginMeta, serializeTaskMutationSuccess, serializeTaskNormalizationFallback, serializeTaskReadResponse, setBindingRegistry, setEvalRunService, setMenuRegistry, skillLatticeManager, sqlDatabaseManager, storeLatticeManager, sttModelLatticeManager, taskLifecycleNotifier, toJsonSchema, toSafeStateExpr, toolLatticeManager, truncateIfTooLong, unregisterTeammateAgent, unregisterWorkflowRun, updateFileData, validateAgentInput, validateCapabilityBundleInput, validateDSL, validateEncryptionKey, validatePackSourcePath, validatePath, validateRelativePath, validateSkillName, validateToolInput, vectorStoreLatticeManager, vectorStoreProviderManager };