@axiom-lattice/protocols 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.
@@ -1,5 +1,5 @@
1
1
 
2
- > @axiom-lattice/protocols@4.2.1 build /home/runner/work/agentic/agentic/packages/protocols
2
+ > @axiom-lattice/protocols@4.2.3 build /home/runner/work/agentic/agentic/packages/protocols
3
3
  > tsup src/index.ts --format cjs,esm --dts --sourcemap
4
4
 
5
5
  CLI Building entry: src/index.ts
@@ -8,13 +8,13 @@
8
8
  CLI Target: es2020
9
9
  CJS Build start
10
10
  ESM Build start
11
- CJS dist/index.js 41.52 KB
12
- CJS dist/index.js.map 136.65 KB
13
- CJS ⚡️ Build success in 349ms
14
- ESM dist/index.mjs 37.37 KB
15
- ESM dist/index.mjs.map 133.14 KB
16
- ESM ⚡️ Build success in 349ms
11
+ CJS dist/index.js 42.59 KB
12
+ CJS dist/index.js.map 142.74 KB
13
+ CJS ⚡️ Build success in 345ms
14
+ ESM dist/index.mjs 38.28 KB
15
+ ESM dist/index.mjs.map 139.16 KB
16
+ ESM ⚡️ Build success in 353ms
17
17
  DTS Build start
18
- DTS ⚡️ Build success in 14821ms
19
- DTS dist/index.d.ts 210.87 KB
20
- DTS dist/index.d.mts 210.87 KB
18
+ DTS ⚡️ Build success in 11587ms
19
+ DTS dist/index.d.ts 213.23 KB
20
+ DTS dist/index.d.mts 213.23 KB
package/CHANGELOG.md CHANGED
@@ -1,5 +1,25 @@
1
1
  # @axiom-lattice/protocols
2
2
 
3
+ ## 4.2.3
4
+
5
+ ### Patch Changes
6
+
7
+ - b11b823: fix version
8
+
9
+ ## 4.2.2
10
+
11
+ ### Patch Changes
12
+
13
+ - 0d39471: Surface real stream errors and neutral stops instead of rendering a bogus "Thread aborted" assistant bubble.
14
+
15
+ - core: `abortThread` carries a reason + end code (`aborted` / `superseded` / `stream_error`); `Agent` preserves the real error and tags user aborts and STEER interruptions, including during checkpoint resume.
16
+ - protocols: add `MessageChunkTypes.ERROR` and `data.code`; project real error reasons onto the Web App stream.
17
+ - gateway: include the end code and real message in SSE error frames.
18
+ - client-sdk: `ChunkMessageMerger` ignores error frames so they never become assistant messages.
19
+ - react-sdk: `AgentThreadContext` / `useChat` surface error frames (neutral stop notice vs. red error alert), clear the notice on the next run, and guard idle aborts.
20
+
21
+ - a467ced: publish new room
22
+
3
23
  ## 4.2.1
4
24
 
5
25
  ### Patch Changes
package/dist/index.d.mts CHANGED
@@ -1169,6 +1169,7 @@ declare const MessageChunkTypes: {
1169
1169
  readonly AI: "ai";
1170
1170
  readonly TOOL: "tool";
1171
1171
  readonly INTERRUPT: "interrupt";
1172
+ readonly ERROR: "error";
1172
1173
  readonly MESSAGE_COMPLETED: "message_completed";
1173
1174
  readonly MESSAGE_FAILED: "message_failed";
1174
1175
  readonly THREAD_IDLE: "thread_idle";
@@ -1179,6 +1180,11 @@ interface MessageChunk {
1179
1180
  data: {
1180
1181
  id: string;
1181
1182
  content?: string;
1183
+ /**
1184
+ * Machine-readable end reason for {@link MessageChunkTypes.ERROR} chunks.
1185
+ * Known values: `aborted`, `superseded`, `stream_error`.
1186
+ */
1187
+ code?: string;
1182
1188
  tool_call_chunks?: Array<{
1183
1189
  name?: string;
1184
1190
  args?: string;
@@ -4587,6 +4593,14 @@ interface ChannelAdapter<TConfig = unknown> {
4587
4593
  readonly configSchema: z.ZodSchema<TConfig>;
4588
4594
  receive(rawPayload: unknown, installation: ChannelInstallation): Promise<InboundMessage | null>;
4589
4595
  sendReply(replyTarget: ReplyTarget, message: OutboundMessage, installation: ChannelInstallation): Promise<void>;
4596
+ /**
4597
+ * 可选:把 Agent 暂停等待人工输入时的问题/提示投影到会话中。
4598
+ *
4599
+ * 与 `sendReply` 不同,这不是对某条入站消息的最终回复,而是运行中途
4600
+ * 产生的一条独立 bot 消息(例如 Project Room 的 clarify 卡片)。
4601
+ * `message.metadata.inputMessageId` 关联触发该运行的入站队列消息。
4602
+ */
4603
+ sendInterrupt?(replyTarget: ReplyTarget, message: OutboundMessage, installation: ChannelInstallation): Promise<void>;
4590
4604
  /**
4591
4605
  * 可选:Channel 自定义 thread ID 生成策略。
4592
4606
  * 如果提供,MessageRouter 会优先使用此方法决定 thread ID,
@@ -5251,6 +5265,15 @@ type ProjectBotRole = "coordinator" | "specialist";
5251
5265
  type ProjectBotMembershipStatus = "active" | "paused" | "removed";
5252
5266
  /** Origins supported by project room messages. */
5253
5267
  type ProjectRoomMessageSource = "user" | "agent" | "task" | "routine" | "system";
5268
+ /**
5269
+ * Canonical label prefix for the one-time room event that announces agent-to-agent task delegation.
5270
+ *
5271
+ * The projection text is `${PROJECT_ROOM_TASK_DELEGATED_LABEL} · <creator> → <owner>`; the UI maps
5272
+ * the exact label or this prefix to the "delegated" task-event kind and never parses arbitrary prose.
5273
+ */
5274
+ declare const PROJECT_ROOM_TASK_DELEGATED_LABEL = "Task delegated";
5275
+ /** Separator between the delegation label and its resolved actor labels. */
5276
+ declare const PROJECT_ROOM_TASK_DELEGATED_SEPARATOR = " \u00B7 ";
5254
5277
  /** The main room associated with a project. */
5255
5278
  interface ProjectRoom {
5256
5279
  id: string;
@@ -5525,6 +5548,34 @@ interface ProjectRoomReadStateStore {
5525
5548
  }): Promise<ProjectRoomReadState>;
5526
5549
  }
5527
5550
 
5551
+ /** A browser Web Push subscription belonging to one user. */
5552
+ interface UserPushSubscription {
5553
+ id: string;
5554
+ tenantId: string;
5555
+ userId: string;
5556
+ /** Push service endpoint URL from the browser's PushSubscription. */
5557
+ endpoint: string;
5558
+ /** Client public keys used to encrypt the payload. */
5559
+ keys: {
5560
+ p256dh: string;
5561
+ auth: string;
5562
+ };
5563
+ userAgent?: string;
5564
+ createdAt: string;
5565
+ }
5566
+ /** Persistence operations for per-user Web Push subscriptions. */
5567
+ interface UserPushSubscriptionStore {
5568
+ /** Lists every subscription for a user (a user may have several devices). */
5569
+ list(tenantId: string, userId: string): Promise<UserPushSubscription[]>;
5570
+ /**
5571
+ * Saves a subscription. Re-saving the same endpoint replaces its keys/agent
5572
+ * (idempotent per tenant+user+endpoint).
5573
+ */
5574
+ save(input: Omit<UserPushSubscription, "id" | "createdAt">): Promise<UserPushSubscription>;
5575
+ /** Deletes one subscription by endpoint. Returns whether a row was removed. */
5576
+ delete(tenantId: string, userId: string, endpoint: string): Promise<boolean>;
5577
+ }
5578
+
5528
5579
  /** A safely extracted value from an own enumerable data-property descriptor. */
5529
5580
  interface DescriptorDataValue {
5530
5581
  ok: true;
@@ -5577,6 +5628,8 @@ interface ProjectRoomPublicMessage {
5577
5628
  mentions: ProjectRoomMention[];
5578
5629
  replyToMessageId?: string;
5579
5630
  source: ProjectRoomMessageSource;
5631
+ /** Canonical source identity (e.g. the Task id for source "task"). */
5632
+ sourceId?: string;
5580
5633
  createdAt: string;
5581
5634
  }
5582
5635
  /** A human membership shape safe to expose to Project Room clients. */
@@ -6415,4 +6468,4 @@ declare function parseTrustedRunContext(value: unknown): TrustedRunContext;
6415
6468
  */
6416
6469
  declare function parseQueuedExecutionMode(value: unknown): QueuedExecutionMode;
6417
6470
 
6418
- export { type A2AApiKeyEntry, type A2AApiKeyRecord, type A2AApiKeyStore, type A2AAuthContext, type A2ARemoteAgentConfig, type AgentClient, type AgentConfig, type AgentConfigWithTools, type AgentLatticeProtocol, type AgentMenuConfig, type AgentMiddlewareConfig, type AgentRunConfig, AgentType, type AgentWebApp, type AgentWebAppAppearance, type AgentWebAppBootstrap, type AgentWebAppCalloutWidget, type AgentWebAppError, type AgentWebAppErrorCode, type AgentWebAppFeatures, type AgentWebAppGenUIBlock, type AgentWebAppIdentityAssurance, type AgentWebAppIdentityConfig, type AgentWebAppIdentityPolicy, type AgentWebAppInterrupt, type AgentWebAppIssuerConfig, type AgentWebAppRuntimeMessage, type AgentWebAppRuntimeThread, type AgentWebAppScope, type AgentWebAppStatus, type AgentWebAppStore, type AgentWebAppStorePatch, type AgentWebAppStreamEvent, type AgentWebAppStreamProjectionContext, type AgentWebAppTableWidget, type AgentWebAppThreadMetadata, type AgentWebAppUpdateOptions, type Assistant, type AssistantMessage, type AssistantStore, type Attachment, type AvailableModule, type BaseLatticeProtocol, type BaseMessage, type Binding, type BindingListParams, type BindingMutablePatch, type BindingRegistry, type BootstrapFilesConfig, type BrowserMiddlewareConfig, type Callback, type CapabilityBundle, type CapabilityBundleDeleteResult, type CapabilityBundleStore, type CapabilityBundleUpdateConflict, type CapabilityFieldSource, type CapabilityOverride, type CapabilityPreview, type CapabilityPreviewIssue, type CapabilityRuntime, type ChannelAdapter, type ChannelBindingMigrationConflict, ChannelBindingMigrationConflictError, type ChannelInstallation, type ChannelInstallationStore, type ChannelInstallationType, type ClawMiddlewareConfig, type CodeEvalMiddlewareConfig, type Collection, type CollectionField, type CollectionFieldType, type CollectionMiddlewareConfig, type CollectionSchema, type CollectionStore, type ConnectionEntry, type ConnectionStore, type ConversationRecord, type CreateA2AApiKeyInput, type CreateAgentWebAppInput, type CreateAssistantRequest, type CreateBindingInput, type CreateCapabilityBundleInput, type CreateChannelInstallationInput, type CreateChannelInstallationRequest, type CreateCollectionRequest, type CreateConversationInput, type CreateDatabaseConfigRequest, type CreateEvalCaseRequest, type CreateEvalProjectRequest, type CreateEvalRunRequest, type CreateEvalSuiteRequest, type CreateMcpServerConfigRequest, type CreateMenuItemInput, type CreateMetricsServerConfigRequest, type CreateProjectRequest, type CreateRunStepRequest, type CreateShareRequest, type CreateSkillRequest, type CreateTaskRequest, type CreateTenantRequest, type CreateThreadRequest, type CreateUserRequest, type CreateUserTenantLinkRequest, type CreateWorkItemIfAbsentRequest, type CreateWorkItemRequest, type CreateWorkflowRunRequest, type CreateWorkspaceRequest, type CustomMenuConfig, type DataSource, type DatabaseConfig, type DatabaseConfigEntry, type DatabaseConfigStore, type DatabaseType, type DeepAgentConfig, type DescriptorDataValue, type DeveloperMessage, type DispatchResult, DuplicateChannelBindingSubjectError, EXECUTION_RESULT_EVENT_KEY_PATTERN, EXECUTION_RESULT_EVENT_KEY_PATTERN_SOURCE, EXECUTION_RESULT_EVENT_KEY_PREFIX, type EmbeddingsConfig, type EmbeddingsLatticeProtocol, type EvalCase, type EvalProject, type EvalProjectReport, type EvalRun, type EvalRunResult, type EvalStore, type EvalSuite, type ExecuteSqlQueryRequest, type ExecuteSqlQueryResponse, type ExpectedCapabilityBundleRevisions, type FilterCondition, type GraphBuildOptions, type HtmlMenuConfig, type IConversationStore, type ID, type InboundMessage, type InternalAgentNode, type InternalBaseNode, type InternalCreateCapabilityBundleInput, type InternalDSL, type InternalEdge, type InternalInput, type InternalInputNode, type InternalMapNode, type InternalNode, type InternalNodeConfig, type InternalOutput, type InternalState, type InternalStateField, type InternalTerminalNode, type InternalUpdateCapabilityBundleInput, type InterruptMessage, type InterruptPolicy, InvalidProjectCapabilityBundleConfigError, type LLMConfig, type LarkChannelInstallationConfig, type LatticeError, type LatticeEventBus, type LatticeMessage, type LocalA2AProviderId, type LocalA2AProviderState, type LocalA2AProviderStatus, type LocalA2ATemplateDefinition, type LocalRuntimeConfig, type LoggerClient, type LoggerConfig, type LoggerContext, type LoggerLatticeProtocol, LoggerType, MAX_PENDING_EXECUTION_RESULTS_LIMIT, type McpClient, type McpClientOptions, type McpConnectionStatus, type McpLatticeMessage, type McpLatticeProtocol, McpMessageType, type McpServerConfig, type McpServerConfigEntry, type McpServerConfigStore, type McpStats, type McpTool, type McpToolResult, type McpTransportType, type MemoryClient, type MemoryConfig, type MemoryLatticeProtocol, MemoryType, type MenuContentConfig, type MenuContentType, type MenuItem, type MenuRegistry, type MenuTarget, type Message, type MessageChunk, type MessageChunkType, MessageChunkTypes, type MessageContext, type MessageMiddleware, type MetricColumn, type MetricDataPoint, type MetricMeta, type MetricQueryResult, type MetricsMiddlewareConfig, type MetricsServerConfig, type MetricsServerConfigEntry, type MetricsServerConfigStore, type MetricsServerType, type MiddlewareType, type ModelLatticeProtocol, type OpenAuditAppendInput, type OpenAuditQuery, type OpenAuditRecord, type OpenAuditStore, type OpenCapabilitySource, type OpenCatalog, type OpenCatalogDomain, type OpenCatalogItem, type OpenCredentialKind, type OpenExecutionContext, type OpenExecutionResult, type OpenGrant, type OutboundMessage, PROJECT_ROOM_USER_CHANNEL_PROJECT, PROJECT_TASK_LIFECYCLE_ACTIONS, type PaginatedResult, type PaginationParams, type PinoFileOptions, type Plugin, type PluginConnection, type PluginConnectionFieldSchema, type PluginConnectionTestResult, type PluginContext, type PluginDiscoveredResource, type PluginMeta, type PluginMetaOutput, type PluginMiddlewareFactory, type PluginSkillDefinition, type PluginSkillResource, type PluginStandardConnectionConfig, type PluginToolMeta, type ProcessingAgentConfig, type Project, type ProjectBotMembership, type ProjectBotMembershipStatus, type ProjectBotMembershipStore, type ProjectBotRole, type ProjectCapabilityConfig, type ProjectFilter, type ProjectHumanRole, type ProjectKind, type ProjectLifecycleEventCursor, type ProjectLifecycleEventQuery, type ProjectMembership, type ProjectMembershipMutationResult, type ProjectMembershipStatus, type ProjectMembershipStore, type ProjectRoom, ProjectRoomBrokerCapacityError, type ProjectRoomBusinessEvent, type ProjectRoomBusinessEventDraft, type ProjectRoomControlEvent, ProjectRoomCursorError, type ProjectRoomEventBrokerProtocol, type ProjectRoomEventId, type ProjectRoomEventOf, type ProjectRoomEventScope, type ProjectRoomEventSubscription, type ProjectRoomMembershipAffectedEvent, type ProjectRoomMembershipChangedEvent, type ProjectRoomMention, type ProjectRoomMessage, type ProjectRoomMessageAuthor, type ProjectRoomMessageCreatedEvent, type ProjectRoomMessageCursor, type ProjectRoomMessageSource, type ProjectRoomMessageStore, type ProjectRoomPublicBotMembership, type ProjectRoomPublicMembership, type ProjectRoomPublicMessage, type ProjectRoomReadChangedEvent, type ProjectRoomReadState, type ProjectRoomReadStateStore, type ProjectRoomRealtimeActor, type ProjectRoomRosterChangedEvent, type ProjectRoomScopedBusinessEvent, type ProjectRoomSseWritable, type ProjectRoomStore, type ProjectRoomTaskChangedEvent, type ProjectRoomThreadMetadata, type ProjectRoomTrustedRunContext, type ProjectStore, type ProjectTaskLifecycleAction, ProjectTaskStoreUnsupportedError, type ProjectTaskThreadMetadata, type ProjectTaskTrustedRunContext, type ProjectTaskWorkItemStore, type PublicChannelInstallationType, type QueryParams, type QueryResultFormat, type QueryWorkflowRunsOptions, type QueryWorkflowRunsResult, type QueueClient, type QueueConfig, type QueueLatticeProtocol, type QueueResult, QueueType, type QueuedExecutionMode, type ReactAgentConfig, type ReplyTarget, type ResourceAddress, type ResourceResolver, type Result, type RunStep, type STTClient, type STTConfig, type STTModelLatticeProtocol, type SandboxMiddlewareConfig, type SandboxPluginConnectionDef, type SandboxPluginDiagnostic, type SandboxPluginManifest, type SandboxPluginToolDef, type ScheduleClient, type ScheduleConfig, type ScheduleCronOptions, ScheduleExecutionType, type ScheduleLatticeProtocol, type ScheduleOnceOptions, type ScheduleStorage, ScheduleType, type ScheduledTaskDefinition, ScheduledTaskStatus, type SchedulerMiddlewareConfig, type SemanticMetricsFilter, type SemanticMetricsQueryRequest, type SemanticMetricsQueryResponse, type SemanticMetricsServerConfig, type ShareRecord, type ShareResult, type ShareVisibility, type SharedResourceStore, type Skill, type SkillClient, type SkillClientType, type SkillConfig, type SkillLatticeProtocol, type SkillStore, type SkillStoreContext, type SqlMiddlewareConfig, type StepStatus, type StepType, type StorageType, type SystemMessage, type TableQueryRequest, type TableQueryResponse, type TaskBeliefDiagnosticCode, type TaskBeliefEntry, type TaskBeliefParseFailure, type TaskBeliefParseResult, type TaskBeliefParseSuccess, type TaskBeliefState, type TaskDependentListQuery, type TaskFileRef, type TaskHandler, type TaskItem, type TaskListFilter, type TaskMutationSnapshot, type TaskStore, type TaskWorkItem, type TaskWorkItemListFilter, type TaskWorkItemStore, type TeamAgentConfig, type TeamTeammateConfig, type Tenant, type TenantStatus, type TenantStore, type TestMcpServerToolsResponse, type Thread, type ThreadStore, type Timestamp, type ToolCall, type ToolConfig, type ToolExecutor, type ToolLatticeProtocol, type ToolMessage, type TopologyEdge, type TranscriptionResult, type TrustedRunContext, type UIComponent, UIComponentType, type UIConfig, type UILatticeProtocol, type UpdateA2AApiKeyInput, type UpdateAgentWebAppInput, type UpdateCapabilityBundleInput, type UpdateChannelInstallationRequest, type UpdateCollectionRequest, type UpdateDatabaseConfigRequest, type UpdateMcpServerConfigRequest, type UpdateMenuItemInput, type UpdateMetricsServerConfigRequest, type UpdateProjectCapabilityBundlesResult, type UpdateProjectRequest, type UpdateRunStepRequest, type UpdateTaskRequest, type UpdateTenantRequest, type UpdateUserRequest, type UpdateUserTenantLinkRequest, type UpdateWorkflowRunRequest, type UpdateWorkspaceRequest, type User, type UserMessage, type UserStatus, type UserStore, type UserTenantLink, type UserTenantLinkStore, type UserTenantRole, type VectorStoreConfig, type VectorStoreCreateParams, type VectorStoreLatticeProtocol, type VectorStoreProvider, type WechatChannelInstallationConfig, type WorkflowAgentConfig, type WorkflowRun, type WorkflowRunStatus, type WorkflowTrackingStore, type Workspace, type WorkspaceStore, type YamlAgentStep, type YamlMapStep, type YamlParallelBlock, type YamlTopLevelStep, type YamlWorkflow, assertGenericProjectConfig, createAgentWebAppStreamProjectionContext, descriptorDataValue, effectiveGrants, getSubAgentsFromConfig, getToolsFromConfig, hasTools, isA2ARemoteAgentConfig, isDeepAgentConfig, isExecutionResultEventKey, isProcessingAgentConfig, isProjectRoomEventId, isTeamAgentConfig, isWorkflowAgentConfig, parseAgentWebAppGenUIBlock, parseProjectRoomEventId, parseQueuedExecutionMode, parseTaskBeliefState, parseTrustedRunContext, projectAgentWebAppChunk, projectRoomUserEventScope, replaceTaskBeliefState, requireProjectTaskWorkItemStore, snapshotExactArray, snapshotExactRecord, snapshotProjectRoomBotMembershipRealtime, snapshotProjectRoomMembershipRealtime, snapshotProjectRoomMessageRealtime, taskBeliefStatesEqual, toProjectRoomPublicBotMembership, toProjectRoomPublicMembership, toProjectRoomPublicMessage };
6471
+ export { type A2AApiKeyEntry, type A2AApiKeyRecord, type A2AApiKeyStore, type A2AAuthContext, type A2ARemoteAgentConfig, type AgentClient, type AgentConfig, type AgentConfigWithTools, type AgentLatticeProtocol, type AgentMenuConfig, type AgentMiddlewareConfig, type AgentRunConfig, AgentType, type AgentWebApp, type AgentWebAppAppearance, type AgentWebAppBootstrap, type AgentWebAppCalloutWidget, type AgentWebAppError, type AgentWebAppErrorCode, type AgentWebAppFeatures, type AgentWebAppGenUIBlock, type AgentWebAppIdentityAssurance, type AgentWebAppIdentityConfig, type AgentWebAppIdentityPolicy, type AgentWebAppInterrupt, type AgentWebAppIssuerConfig, type AgentWebAppRuntimeMessage, type AgentWebAppRuntimeThread, type AgentWebAppScope, type AgentWebAppStatus, type AgentWebAppStore, type AgentWebAppStorePatch, type AgentWebAppStreamEvent, type AgentWebAppStreamProjectionContext, type AgentWebAppTableWidget, type AgentWebAppThreadMetadata, type AgentWebAppUpdateOptions, type Assistant, type AssistantMessage, type AssistantStore, type Attachment, type AvailableModule, type BaseLatticeProtocol, type BaseMessage, type Binding, type BindingListParams, type BindingMutablePatch, type BindingRegistry, type BootstrapFilesConfig, type BrowserMiddlewareConfig, type Callback, type CapabilityBundle, type CapabilityBundleDeleteResult, type CapabilityBundleStore, type CapabilityBundleUpdateConflict, type CapabilityFieldSource, type CapabilityOverride, type CapabilityPreview, type CapabilityPreviewIssue, type CapabilityRuntime, type ChannelAdapter, type ChannelBindingMigrationConflict, ChannelBindingMigrationConflictError, type ChannelInstallation, type ChannelInstallationStore, type ChannelInstallationType, type ClawMiddlewareConfig, type CodeEvalMiddlewareConfig, type Collection, type CollectionField, type CollectionFieldType, type CollectionMiddlewareConfig, type CollectionSchema, type CollectionStore, type ConnectionEntry, type ConnectionStore, type ConversationRecord, type CreateA2AApiKeyInput, type CreateAgentWebAppInput, type CreateAssistantRequest, type CreateBindingInput, type CreateCapabilityBundleInput, type CreateChannelInstallationInput, type CreateChannelInstallationRequest, type CreateCollectionRequest, type CreateConversationInput, type CreateDatabaseConfigRequest, type CreateEvalCaseRequest, type CreateEvalProjectRequest, type CreateEvalRunRequest, type CreateEvalSuiteRequest, type CreateMcpServerConfigRequest, type CreateMenuItemInput, type CreateMetricsServerConfigRequest, type CreateProjectRequest, type CreateRunStepRequest, type CreateShareRequest, type CreateSkillRequest, type CreateTaskRequest, type CreateTenantRequest, type CreateThreadRequest, type CreateUserRequest, type CreateUserTenantLinkRequest, type CreateWorkItemIfAbsentRequest, type CreateWorkItemRequest, type CreateWorkflowRunRequest, type CreateWorkspaceRequest, type CustomMenuConfig, type DataSource, type DatabaseConfig, type DatabaseConfigEntry, type DatabaseConfigStore, type DatabaseType, type DeepAgentConfig, type DescriptorDataValue, type DeveloperMessage, type DispatchResult, DuplicateChannelBindingSubjectError, EXECUTION_RESULT_EVENT_KEY_PATTERN, EXECUTION_RESULT_EVENT_KEY_PATTERN_SOURCE, EXECUTION_RESULT_EVENT_KEY_PREFIX, type EmbeddingsConfig, type EmbeddingsLatticeProtocol, type EvalCase, type EvalProject, type EvalProjectReport, type EvalRun, type EvalRunResult, type EvalStore, type EvalSuite, type ExecuteSqlQueryRequest, type ExecuteSqlQueryResponse, type ExpectedCapabilityBundleRevisions, type FilterCondition, type GraphBuildOptions, type HtmlMenuConfig, type IConversationStore, type ID, type InboundMessage, type InternalAgentNode, type InternalBaseNode, type InternalCreateCapabilityBundleInput, type InternalDSL, type InternalEdge, type InternalInput, type InternalInputNode, type InternalMapNode, type InternalNode, type InternalNodeConfig, type InternalOutput, type InternalState, type InternalStateField, type InternalTerminalNode, type InternalUpdateCapabilityBundleInput, type InterruptMessage, type InterruptPolicy, InvalidProjectCapabilityBundleConfigError, type LLMConfig, type LarkChannelInstallationConfig, type LatticeError, type LatticeEventBus, type LatticeMessage, type LocalA2AProviderId, type LocalA2AProviderState, type LocalA2AProviderStatus, type LocalA2ATemplateDefinition, type LocalRuntimeConfig, type LoggerClient, type LoggerConfig, type LoggerContext, type LoggerLatticeProtocol, LoggerType, MAX_PENDING_EXECUTION_RESULTS_LIMIT, type McpClient, type McpClientOptions, type McpConnectionStatus, type McpLatticeMessage, type McpLatticeProtocol, McpMessageType, type McpServerConfig, type McpServerConfigEntry, type McpServerConfigStore, type McpStats, type McpTool, type McpToolResult, type McpTransportType, type MemoryClient, type MemoryConfig, type MemoryLatticeProtocol, MemoryType, type MenuContentConfig, type MenuContentType, type MenuItem, type MenuRegistry, type MenuTarget, type Message, type MessageChunk, type MessageChunkType, MessageChunkTypes, type MessageContext, type MessageMiddleware, type MetricColumn, type MetricDataPoint, type MetricMeta, type MetricQueryResult, type MetricsMiddlewareConfig, type MetricsServerConfig, type MetricsServerConfigEntry, type MetricsServerConfigStore, type MetricsServerType, type MiddlewareType, type ModelLatticeProtocol, type OpenAuditAppendInput, type OpenAuditQuery, type OpenAuditRecord, type OpenAuditStore, type OpenCapabilitySource, type OpenCatalog, type OpenCatalogDomain, type OpenCatalogItem, type OpenCredentialKind, type OpenExecutionContext, type OpenExecutionResult, type OpenGrant, type OutboundMessage, PROJECT_ROOM_TASK_DELEGATED_LABEL, PROJECT_ROOM_TASK_DELEGATED_SEPARATOR, PROJECT_ROOM_USER_CHANNEL_PROJECT, PROJECT_TASK_LIFECYCLE_ACTIONS, type PaginatedResult, type PaginationParams, type PinoFileOptions, type Plugin, type PluginConnection, type PluginConnectionFieldSchema, type PluginConnectionTestResult, type PluginContext, type PluginDiscoveredResource, type PluginMeta, type PluginMetaOutput, type PluginMiddlewareFactory, type PluginSkillDefinition, type PluginSkillResource, type PluginStandardConnectionConfig, type PluginToolMeta, type ProcessingAgentConfig, type Project, type ProjectBotMembership, type ProjectBotMembershipStatus, type ProjectBotMembershipStore, type ProjectBotRole, type ProjectCapabilityConfig, type ProjectFilter, type ProjectHumanRole, type ProjectKind, type ProjectLifecycleEventCursor, type ProjectLifecycleEventQuery, type ProjectMembership, type ProjectMembershipMutationResult, type ProjectMembershipStatus, type ProjectMembershipStore, type ProjectRoom, ProjectRoomBrokerCapacityError, type ProjectRoomBusinessEvent, type ProjectRoomBusinessEventDraft, type ProjectRoomControlEvent, ProjectRoomCursorError, type ProjectRoomEventBrokerProtocol, type ProjectRoomEventId, type ProjectRoomEventOf, type ProjectRoomEventScope, type ProjectRoomEventSubscription, type ProjectRoomMembershipAffectedEvent, type ProjectRoomMembershipChangedEvent, type ProjectRoomMention, type ProjectRoomMessage, type ProjectRoomMessageAuthor, type ProjectRoomMessageCreatedEvent, type ProjectRoomMessageCursor, type ProjectRoomMessageSource, type ProjectRoomMessageStore, type ProjectRoomPublicBotMembership, type ProjectRoomPublicMembership, type ProjectRoomPublicMessage, type ProjectRoomReadChangedEvent, type ProjectRoomReadState, type ProjectRoomReadStateStore, type ProjectRoomRealtimeActor, type ProjectRoomRosterChangedEvent, type ProjectRoomScopedBusinessEvent, type ProjectRoomSseWritable, type ProjectRoomStore, type ProjectRoomTaskChangedEvent, type ProjectRoomThreadMetadata, type ProjectRoomTrustedRunContext, type ProjectStore, type ProjectTaskLifecycleAction, ProjectTaskStoreUnsupportedError, type ProjectTaskThreadMetadata, type ProjectTaskTrustedRunContext, type ProjectTaskWorkItemStore, type PublicChannelInstallationType, type QueryParams, type QueryResultFormat, type QueryWorkflowRunsOptions, type QueryWorkflowRunsResult, type QueueClient, type QueueConfig, type QueueLatticeProtocol, type QueueResult, QueueType, type QueuedExecutionMode, type ReactAgentConfig, type ReplyTarget, type ResourceAddress, type ResourceResolver, type Result, type RunStep, type STTClient, type STTConfig, type STTModelLatticeProtocol, type SandboxMiddlewareConfig, type SandboxPluginConnectionDef, type SandboxPluginDiagnostic, type SandboxPluginManifest, type SandboxPluginToolDef, type ScheduleClient, type ScheduleConfig, type ScheduleCronOptions, ScheduleExecutionType, type ScheduleLatticeProtocol, type ScheduleOnceOptions, type ScheduleStorage, ScheduleType, type ScheduledTaskDefinition, ScheduledTaskStatus, type SchedulerMiddlewareConfig, type SemanticMetricsFilter, type SemanticMetricsQueryRequest, type SemanticMetricsQueryResponse, type SemanticMetricsServerConfig, type ShareRecord, type ShareResult, type ShareVisibility, type SharedResourceStore, type Skill, type SkillClient, type SkillClientType, type SkillConfig, type SkillLatticeProtocol, type SkillStore, type SkillStoreContext, type SqlMiddlewareConfig, type StepStatus, type StepType, type StorageType, type SystemMessage, type TableQueryRequest, type TableQueryResponse, type TaskBeliefDiagnosticCode, type TaskBeliefEntry, type TaskBeliefParseFailure, type TaskBeliefParseResult, type TaskBeliefParseSuccess, type TaskBeliefState, type TaskDependentListQuery, type TaskFileRef, type TaskHandler, type TaskItem, type TaskListFilter, type TaskMutationSnapshot, type TaskStore, type TaskWorkItem, type TaskWorkItemListFilter, type TaskWorkItemStore, type TeamAgentConfig, type TeamTeammateConfig, type Tenant, type TenantStatus, type TenantStore, type TestMcpServerToolsResponse, type Thread, type ThreadStore, type Timestamp, type ToolCall, type ToolConfig, type ToolExecutor, type ToolLatticeProtocol, type ToolMessage, type TopologyEdge, type TranscriptionResult, type TrustedRunContext, type UIComponent, UIComponentType, type UIConfig, type UILatticeProtocol, type UpdateA2AApiKeyInput, type UpdateAgentWebAppInput, type UpdateCapabilityBundleInput, type UpdateChannelInstallationRequest, type UpdateCollectionRequest, type UpdateDatabaseConfigRequest, type UpdateMcpServerConfigRequest, type UpdateMenuItemInput, type UpdateMetricsServerConfigRequest, type UpdateProjectCapabilityBundlesResult, type UpdateProjectRequest, type UpdateRunStepRequest, type UpdateTaskRequest, type UpdateTenantRequest, type UpdateUserRequest, type UpdateUserTenantLinkRequest, type UpdateWorkflowRunRequest, type UpdateWorkspaceRequest, type User, type UserMessage, type UserPushSubscription, type UserPushSubscriptionStore, type UserStatus, type UserStore, type UserTenantLink, type UserTenantLinkStore, type UserTenantRole, type VectorStoreConfig, type VectorStoreCreateParams, type VectorStoreLatticeProtocol, type VectorStoreProvider, type WechatChannelInstallationConfig, type WorkflowAgentConfig, type WorkflowRun, type WorkflowRunStatus, type WorkflowTrackingStore, type Workspace, type WorkspaceStore, type YamlAgentStep, type YamlMapStep, type YamlParallelBlock, type YamlTopLevelStep, type YamlWorkflow, assertGenericProjectConfig, createAgentWebAppStreamProjectionContext, descriptorDataValue, effectiveGrants, getSubAgentsFromConfig, getToolsFromConfig, hasTools, isA2ARemoteAgentConfig, isDeepAgentConfig, isExecutionResultEventKey, isProcessingAgentConfig, isProjectRoomEventId, isTeamAgentConfig, isWorkflowAgentConfig, parseAgentWebAppGenUIBlock, parseProjectRoomEventId, parseQueuedExecutionMode, parseTaskBeliefState, parseTrustedRunContext, projectAgentWebAppChunk, projectRoomUserEventScope, replaceTaskBeliefState, requireProjectTaskWorkItemStore, snapshotExactArray, snapshotExactRecord, snapshotProjectRoomBotMembershipRealtime, snapshotProjectRoomMembershipRealtime, snapshotProjectRoomMessageRealtime, taskBeliefStatesEqual, toProjectRoomPublicBotMembership, toProjectRoomPublicMembership, toProjectRoomPublicMessage };
package/dist/index.d.ts CHANGED
@@ -1169,6 +1169,7 @@ declare const MessageChunkTypes: {
1169
1169
  readonly AI: "ai";
1170
1170
  readonly TOOL: "tool";
1171
1171
  readonly INTERRUPT: "interrupt";
1172
+ readonly ERROR: "error";
1172
1173
  readonly MESSAGE_COMPLETED: "message_completed";
1173
1174
  readonly MESSAGE_FAILED: "message_failed";
1174
1175
  readonly THREAD_IDLE: "thread_idle";
@@ -1179,6 +1180,11 @@ interface MessageChunk {
1179
1180
  data: {
1180
1181
  id: string;
1181
1182
  content?: string;
1183
+ /**
1184
+ * Machine-readable end reason for {@link MessageChunkTypes.ERROR} chunks.
1185
+ * Known values: `aborted`, `superseded`, `stream_error`.
1186
+ */
1187
+ code?: string;
1182
1188
  tool_call_chunks?: Array<{
1183
1189
  name?: string;
1184
1190
  args?: string;
@@ -4587,6 +4593,14 @@ interface ChannelAdapter<TConfig = unknown> {
4587
4593
  readonly configSchema: z.ZodSchema<TConfig>;
4588
4594
  receive(rawPayload: unknown, installation: ChannelInstallation): Promise<InboundMessage | null>;
4589
4595
  sendReply(replyTarget: ReplyTarget, message: OutboundMessage, installation: ChannelInstallation): Promise<void>;
4596
+ /**
4597
+ * 可选:把 Agent 暂停等待人工输入时的问题/提示投影到会话中。
4598
+ *
4599
+ * 与 `sendReply` 不同,这不是对某条入站消息的最终回复,而是运行中途
4600
+ * 产生的一条独立 bot 消息(例如 Project Room 的 clarify 卡片)。
4601
+ * `message.metadata.inputMessageId` 关联触发该运行的入站队列消息。
4602
+ */
4603
+ sendInterrupt?(replyTarget: ReplyTarget, message: OutboundMessage, installation: ChannelInstallation): Promise<void>;
4590
4604
  /**
4591
4605
  * 可选:Channel 自定义 thread ID 生成策略。
4592
4606
  * 如果提供,MessageRouter 会优先使用此方法决定 thread ID,
@@ -5251,6 +5265,15 @@ type ProjectBotRole = "coordinator" | "specialist";
5251
5265
  type ProjectBotMembershipStatus = "active" | "paused" | "removed";
5252
5266
  /** Origins supported by project room messages. */
5253
5267
  type ProjectRoomMessageSource = "user" | "agent" | "task" | "routine" | "system";
5268
+ /**
5269
+ * Canonical label prefix for the one-time room event that announces agent-to-agent task delegation.
5270
+ *
5271
+ * The projection text is `${PROJECT_ROOM_TASK_DELEGATED_LABEL} · <creator> → <owner>`; the UI maps
5272
+ * the exact label or this prefix to the "delegated" task-event kind and never parses arbitrary prose.
5273
+ */
5274
+ declare const PROJECT_ROOM_TASK_DELEGATED_LABEL = "Task delegated";
5275
+ /** Separator between the delegation label and its resolved actor labels. */
5276
+ declare const PROJECT_ROOM_TASK_DELEGATED_SEPARATOR = " \u00B7 ";
5254
5277
  /** The main room associated with a project. */
5255
5278
  interface ProjectRoom {
5256
5279
  id: string;
@@ -5525,6 +5548,34 @@ interface ProjectRoomReadStateStore {
5525
5548
  }): Promise<ProjectRoomReadState>;
5526
5549
  }
5527
5550
 
5551
+ /** A browser Web Push subscription belonging to one user. */
5552
+ interface UserPushSubscription {
5553
+ id: string;
5554
+ tenantId: string;
5555
+ userId: string;
5556
+ /** Push service endpoint URL from the browser's PushSubscription. */
5557
+ endpoint: string;
5558
+ /** Client public keys used to encrypt the payload. */
5559
+ keys: {
5560
+ p256dh: string;
5561
+ auth: string;
5562
+ };
5563
+ userAgent?: string;
5564
+ createdAt: string;
5565
+ }
5566
+ /** Persistence operations for per-user Web Push subscriptions. */
5567
+ interface UserPushSubscriptionStore {
5568
+ /** Lists every subscription for a user (a user may have several devices). */
5569
+ list(tenantId: string, userId: string): Promise<UserPushSubscription[]>;
5570
+ /**
5571
+ * Saves a subscription. Re-saving the same endpoint replaces its keys/agent
5572
+ * (idempotent per tenant+user+endpoint).
5573
+ */
5574
+ save(input: Omit<UserPushSubscription, "id" | "createdAt">): Promise<UserPushSubscription>;
5575
+ /** Deletes one subscription by endpoint. Returns whether a row was removed. */
5576
+ delete(tenantId: string, userId: string, endpoint: string): Promise<boolean>;
5577
+ }
5578
+
5528
5579
  /** A safely extracted value from an own enumerable data-property descriptor. */
5529
5580
  interface DescriptorDataValue {
5530
5581
  ok: true;
@@ -5577,6 +5628,8 @@ interface ProjectRoomPublicMessage {
5577
5628
  mentions: ProjectRoomMention[];
5578
5629
  replyToMessageId?: string;
5579
5630
  source: ProjectRoomMessageSource;
5631
+ /** Canonical source identity (e.g. the Task id for source "task"). */
5632
+ sourceId?: string;
5580
5633
  createdAt: string;
5581
5634
  }
5582
5635
  /** A human membership shape safe to expose to Project Room clients. */
@@ -6415,4 +6468,4 @@ declare function parseTrustedRunContext(value: unknown): TrustedRunContext;
6415
6468
  */
6416
6469
  declare function parseQueuedExecutionMode(value: unknown): QueuedExecutionMode;
6417
6470
 
6418
- export { type A2AApiKeyEntry, type A2AApiKeyRecord, type A2AApiKeyStore, type A2AAuthContext, type A2ARemoteAgentConfig, type AgentClient, type AgentConfig, type AgentConfigWithTools, type AgentLatticeProtocol, type AgentMenuConfig, type AgentMiddlewareConfig, type AgentRunConfig, AgentType, type AgentWebApp, type AgentWebAppAppearance, type AgentWebAppBootstrap, type AgentWebAppCalloutWidget, type AgentWebAppError, type AgentWebAppErrorCode, type AgentWebAppFeatures, type AgentWebAppGenUIBlock, type AgentWebAppIdentityAssurance, type AgentWebAppIdentityConfig, type AgentWebAppIdentityPolicy, type AgentWebAppInterrupt, type AgentWebAppIssuerConfig, type AgentWebAppRuntimeMessage, type AgentWebAppRuntimeThread, type AgentWebAppScope, type AgentWebAppStatus, type AgentWebAppStore, type AgentWebAppStorePatch, type AgentWebAppStreamEvent, type AgentWebAppStreamProjectionContext, type AgentWebAppTableWidget, type AgentWebAppThreadMetadata, type AgentWebAppUpdateOptions, type Assistant, type AssistantMessage, type AssistantStore, type Attachment, type AvailableModule, type BaseLatticeProtocol, type BaseMessage, type Binding, type BindingListParams, type BindingMutablePatch, type BindingRegistry, type BootstrapFilesConfig, type BrowserMiddlewareConfig, type Callback, type CapabilityBundle, type CapabilityBundleDeleteResult, type CapabilityBundleStore, type CapabilityBundleUpdateConflict, type CapabilityFieldSource, type CapabilityOverride, type CapabilityPreview, type CapabilityPreviewIssue, type CapabilityRuntime, type ChannelAdapter, type ChannelBindingMigrationConflict, ChannelBindingMigrationConflictError, type ChannelInstallation, type ChannelInstallationStore, type ChannelInstallationType, type ClawMiddlewareConfig, type CodeEvalMiddlewareConfig, type Collection, type CollectionField, type CollectionFieldType, type CollectionMiddlewareConfig, type CollectionSchema, type CollectionStore, type ConnectionEntry, type ConnectionStore, type ConversationRecord, type CreateA2AApiKeyInput, type CreateAgentWebAppInput, type CreateAssistantRequest, type CreateBindingInput, type CreateCapabilityBundleInput, type CreateChannelInstallationInput, type CreateChannelInstallationRequest, type CreateCollectionRequest, type CreateConversationInput, type CreateDatabaseConfigRequest, type CreateEvalCaseRequest, type CreateEvalProjectRequest, type CreateEvalRunRequest, type CreateEvalSuiteRequest, type CreateMcpServerConfigRequest, type CreateMenuItemInput, type CreateMetricsServerConfigRequest, type CreateProjectRequest, type CreateRunStepRequest, type CreateShareRequest, type CreateSkillRequest, type CreateTaskRequest, type CreateTenantRequest, type CreateThreadRequest, type CreateUserRequest, type CreateUserTenantLinkRequest, type CreateWorkItemIfAbsentRequest, type CreateWorkItemRequest, type CreateWorkflowRunRequest, type CreateWorkspaceRequest, type CustomMenuConfig, type DataSource, type DatabaseConfig, type DatabaseConfigEntry, type DatabaseConfigStore, type DatabaseType, type DeepAgentConfig, type DescriptorDataValue, type DeveloperMessage, type DispatchResult, DuplicateChannelBindingSubjectError, EXECUTION_RESULT_EVENT_KEY_PATTERN, EXECUTION_RESULT_EVENT_KEY_PATTERN_SOURCE, EXECUTION_RESULT_EVENT_KEY_PREFIX, type EmbeddingsConfig, type EmbeddingsLatticeProtocol, type EvalCase, type EvalProject, type EvalProjectReport, type EvalRun, type EvalRunResult, type EvalStore, type EvalSuite, type ExecuteSqlQueryRequest, type ExecuteSqlQueryResponse, type ExpectedCapabilityBundleRevisions, type FilterCondition, type GraphBuildOptions, type HtmlMenuConfig, type IConversationStore, type ID, type InboundMessage, type InternalAgentNode, type InternalBaseNode, type InternalCreateCapabilityBundleInput, type InternalDSL, type InternalEdge, type InternalInput, type InternalInputNode, type InternalMapNode, type InternalNode, type InternalNodeConfig, type InternalOutput, type InternalState, type InternalStateField, type InternalTerminalNode, type InternalUpdateCapabilityBundleInput, type InterruptMessage, type InterruptPolicy, InvalidProjectCapabilityBundleConfigError, type LLMConfig, type LarkChannelInstallationConfig, type LatticeError, type LatticeEventBus, type LatticeMessage, type LocalA2AProviderId, type LocalA2AProviderState, type LocalA2AProviderStatus, type LocalA2ATemplateDefinition, type LocalRuntimeConfig, type LoggerClient, type LoggerConfig, type LoggerContext, type LoggerLatticeProtocol, LoggerType, MAX_PENDING_EXECUTION_RESULTS_LIMIT, type McpClient, type McpClientOptions, type McpConnectionStatus, type McpLatticeMessage, type McpLatticeProtocol, McpMessageType, type McpServerConfig, type McpServerConfigEntry, type McpServerConfigStore, type McpStats, type McpTool, type McpToolResult, type McpTransportType, type MemoryClient, type MemoryConfig, type MemoryLatticeProtocol, MemoryType, type MenuContentConfig, type MenuContentType, type MenuItem, type MenuRegistry, type MenuTarget, type Message, type MessageChunk, type MessageChunkType, MessageChunkTypes, type MessageContext, type MessageMiddleware, type MetricColumn, type MetricDataPoint, type MetricMeta, type MetricQueryResult, type MetricsMiddlewareConfig, type MetricsServerConfig, type MetricsServerConfigEntry, type MetricsServerConfigStore, type MetricsServerType, type MiddlewareType, type ModelLatticeProtocol, type OpenAuditAppendInput, type OpenAuditQuery, type OpenAuditRecord, type OpenAuditStore, type OpenCapabilitySource, type OpenCatalog, type OpenCatalogDomain, type OpenCatalogItem, type OpenCredentialKind, type OpenExecutionContext, type OpenExecutionResult, type OpenGrant, type OutboundMessage, PROJECT_ROOM_USER_CHANNEL_PROJECT, PROJECT_TASK_LIFECYCLE_ACTIONS, type PaginatedResult, type PaginationParams, type PinoFileOptions, type Plugin, type PluginConnection, type PluginConnectionFieldSchema, type PluginConnectionTestResult, type PluginContext, type PluginDiscoveredResource, type PluginMeta, type PluginMetaOutput, type PluginMiddlewareFactory, type PluginSkillDefinition, type PluginSkillResource, type PluginStandardConnectionConfig, type PluginToolMeta, type ProcessingAgentConfig, type Project, type ProjectBotMembership, type ProjectBotMembershipStatus, type ProjectBotMembershipStore, type ProjectBotRole, type ProjectCapabilityConfig, type ProjectFilter, type ProjectHumanRole, type ProjectKind, type ProjectLifecycleEventCursor, type ProjectLifecycleEventQuery, type ProjectMembership, type ProjectMembershipMutationResult, type ProjectMembershipStatus, type ProjectMembershipStore, type ProjectRoom, ProjectRoomBrokerCapacityError, type ProjectRoomBusinessEvent, type ProjectRoomBusinessEventDraft, type ProjectRoomControlEvent, ProjectRoomCursorError, type ProjectRoomEventBrokerProtocol, type ProjectRoomEventId, type ProjectRoomEventOf, type ProjectRoomEventScope, type ProjectRoomEventSubscription, type ProjectRoomMembershipAffectedEvent, type ProjectRoomMembershipChangedEvent, type ProjectRoomMention, type ProjectRoomMessage, type ProjectRoomMessageAuthor, type ProjectRoomMessageCreatedEvent, type ProjectRoomMessageCursor, type ProjectRoomMessageSource, type ProjectRoomMessageStore, type ProjectRoomPublicBotMembership, type ProjectRoomPublicMembership, type ProjectRoomPublicMessage, type ProjectRoomReadChangedEvent, type ProjectRoomReadState, type ProjectRoomReadStateStore, type ProjectRoomRealtimeActor, type ProjectRoomRosterChangedEvent, type ProjectRoomScopedBusinessEvent, type ProjectRoomSseWritable, type ProjectRoomStore, type ProjectRoomTaskChangedEvent, type ProjectRoomThreadMetadata, type ProjectRoomTrustedRunContext, type ProjectStore, type ProjectTaskLifecycleAction, ProjectTaskStoreUnsupportedError, type ProjectTaskThreadMetadata, type ProjectTaskTrustedRunContext, type ProjectTaskWorkItemStore, type PublicChannelInstallationType, type QueryParams, type QueryResultFormat, type QueryWorkflowRunsOptions, type QueryWorkflowRunsResult, type QueueClient, type QueueConfig, type QueueLatticeProtocol, type QueueResult, QueueType, type QueuedExecutionMode, type ReactAgentConfig, type ReplyTarget, type ResourceAddress, type ResourceResolver, type Result, type RunStep, type STTClient, type STTConfig, type STTModelLatticeProtocol, type SandboxMiddlewareConfig, type SandboxPluginConnectionDef, type SandboxPluginDiagnostic, type SandboxPluginManifest, type SandboxPluginToolDef, type ScheduleClient, type ScheduleConfig, type ScheduleCronOptions, ScheduleExecutionType, type ScheduleLatticeProtocol, type ScheduleOnceOptions, type ScheduleStorage, ScheduleType, type ScheduledTaskDefinition, ScheduledTaskStatus, type SchedulerMiddlewareConfig, type SemanticMetricsFilter, type SemanticMetricsQueryRequest, type SemanticMetricsQueryResponse, type SemanticMetricsServerConfig, type ShareRecord, type ShareResult, type ShareVisibility, type SharedResourceStore, type Skill, type SkillClient, type SkillClientType, type SkillConfig, type SkillLatticeProtocol, type SkillStore, type SkillStoreContext, type SqlMiddlewareConfig, type StepStatus, type StepType, type StorageType, type SystemMessage, type TableQueryRequest, type TableQueryResponse, type TaskBeliefDiagnosticCode, type TaskBeliefEntry, type TaskBeliefParseFailure, type TaskBeliefParseResult, type TaskBeliefParseSuccess, type TaskBeliefState, type TaskDependentListQuery, type TaskFileRef, type TaskHandler, type TaskItem, type TaskListFilter, type TaskMutationSnapshot, type TaskStore, type TaskWorkItem, type TaskWorkItemListFilter, type TaskWorkItemStore, type TeamAgentConfig, type TeamTeammateConfig, type Tenant, type TenantStatus, type TenantStore, type TestMcpServerToolsResponse, type Thread, type ThreadStore, type Timestamp, type ToolCall, type ToolConfig, type ToolExecutor, type ToolLatticeProtocol, type ToolMessage, type TopologyEdge, type TranscriptionResult, type TrustedRunContext, type UIComponent, UIComponentType, type UIConfig, type UILatticeProtocol, type UpdateA2AApiKeyInput, type UpdateAgentWebAppInput, type UpdateCapabilityBundleInput, type UpdateChannelInstallationRequest, type UpdateCollectionRequest, type UpdateDatabaseConfigRequest, type UpdateMcpServerConfigRequest, type UpdateMenuItemInput, type UpdateMetricsServerConfigRequest, type UpdateProjectCapabilityBundlesResult, type UpdateProjectRequest, type UpdateRunStepRequest, type UpdateTaskRequest, type UpdateTenantRequest, type UpdateUserRequest, type UpdateUserTenantLinkRequest, type UpdateWorkflowRunRequest, type UpdateWorkspaceRequest, type User, type UserMessage, type UserStatus, type UserStore, type UserTenantLink, type UserTenantLinkStore, type UserTenantRole, type VectorStoreConfig, type VectorStoreCreateParams, type VectorStoreLatticeProtocol, type VectorStoreProvider, type WechatChannelInstallationConfig, type WorkflowAgentConfig, type WorkflowRun, type WorkflowRunStatus, type WorkflowTrackingStore, type Workspace, type WorkspaceStore, type YamlAgentStep, type YamlMapStep, type YamlParallelBlock, type YamlTopLevelStep, type YamlWorkflow, assertGenericProjectConfig, createAgentWebAppStreamProjectionContext, descriptorDataValue, effectiveGrants, getSubAgentsFromConfig, getToolsFromConfig, hasTools, isA2ARemoteAgentConfig, isDeepAgentConfig, isExecutionResultEventKey, isProcessingAgentConfig, isProjectRoomEventId, isTeamAgentConfig, isWorkflowAgentConfig, parseAgentWebAppGenUIBlock, parseProjectRoomEventId, parseQueuedExecutionMode, parseTaskBeliefState, parseTrustedRunContext, projectAgentWebAppChunk, projectRoomUserEventScope, replaceTaskBeliefState, requireProjectTaskWorkItemStore, snapshotExactArray, snapshotExactRecord, snapshotProjectRoomBotMembershipRealtime, snapshotProjectRoomMembershipRealtime, snapshotProjectRoomMessageRealtime, taskBeliefStatesEqual, toProjectRoomPublicBotMembership, toProjectRoomPublicMembership, toProjectRoomPublicMessage };
6471
+ export { type A2AApiKeyEntry, type A2AApiKeyRecord, type A2AApiKeyStore, type A2AAuthContext, type A2ARemoteAgentConfig, type AgentClient, type AgentConfig, type AgentConfigWithTools, type AgentLatticeProtocol, type AgentMenuConfig, type AgentMiddlewareConfig, type AgentRunConfig, AgentType, type AgentWebApp, type AgentWebAppAppearance, type AgentWebAppBootstrap, type AgentWebAppCalloutWidget, type AgentWebAppError, type AgentWebAppErrorCode, type AgentWebAppFeatures, type AgentWebAppGenUIBlock, type AgentWebAppIdentityAssurance, type AgentWebAppIdentityConfig, type AgentWebAppIdentityPolicy, type AgentWebAppInterrupt, type AgentWebAppIssuerConfig, type AgentWebAppRuntimeMessage, type AgentWebAppRuntimeThread, type AgentWebAppScope, type AgentWebAppStatus, type AgentWebAppStore, type AgentWebAppStorePatch, type AgentWebAppStreamEvent, type AgentWebAppStreamProjectionContext, type AgentWebAppTableWidget, type AgentWebAppThreadMetadata, type AgentWebAppUpdateOptions, type Assistant, type AssistantMessage, type AssistantStore, type Attachment, type AvailableModule, type BaseLatticeProtocol, type BaseMessage, type Binding, type BindingListParams, type BindingMutablePatch, type BindingRegistry, type BootstrapFilesConfig, type BrowserMiddlewareConfig, type Callback, type CapabilityBundle, type CapabilityBundleDeleteResult, type CapabilityBundleStore, type CapabilityBundleUpdateConflict, type CapabilityFieldSource, type CapabilityOverride, type CapabilityPreview, type CapabilityPreviewIssue, type CapabilityRuntime, type ChannelAdapter, type ChannelBindingMigrationConflict, ChannelBindingMigrationConflictError, type ChannelInstallation, type ChannelInstallationStore, type ChannelInstallationType, type ClawMiddlewareConfig, type CodeEvalMiddlewareConfig, type Collection, type CollectionField, type CollectionFieldType, type CollectionMiddlewareConfig, type CollectionSchema, type CollectionStore, type ConnectionEntry, type ConnectionStore, type ConversationRecord, type CreateA2AApiKeyInput, type CreateAgentWebAppInput, type CreateAssistantRequest, type CreateBindingInput, type CreateCapabilityBundleInput, type CreateChannelInstallationInput, type CreateChannelInstallationRequest, type CreateCollectionRequest, type CreateConversationInput, type CreateDatabaseConfigRequest, type CreateEvalCaseRequest, type CreateEvalProjectRequest, type CreateEvalRunRequest, type CreateEvalSuiteRequest, type CreateMcpServerConfigRequest, type CreateMenuItemInput, type CreateMetricsServerConfigRequest, type CreateProjectRequest, type CreateRunStepRequest, type CreateShareRequest, type CreateSkillRequest, type CreateTaskRequest, type CreateTenantRequest, type CreateThreadRequest, type CreateUserRequest, type CreateUserTenantLinkRequest, type CreateWorkItemIfAbsentRequest, type CreateWorkItemRequest, type CreateWorkflowRunRequest, type CreateWorkspaceRequest, type CustomMenuConfig, type DataSource, type DatabaseConfig, type DatabaseConfigEntry, type DatabaseConfigStore, type DatabaseType, type DeepAgentConfig, type DescriptorDataValue, type DeveloperMessage, type DispatchResult, DuplicateChannelBindingSubjectError, EXECUTION_RESULT_EVENT_KEY_PATTERN, EXECUTION_RESULT_EVENT_KEY_PATTERN_SOURCE, EXECUTION_RESULT_EVENT_KEY_PREFIX, type EmbeddingsConfig, type EmbeddingsLatticeProtocol, type EvalCase, type EvalProject, type EvalProjectReport, type EvalRun, type EvalRunResult, type EvalStore, type EvalSuite, type ExecuteSqlQueryRequest, type ExecuteSqlQueryResponse, type ExpectedCapabilityBundleRevisions, type FilterCondition, type GraphBuildOptions, type HtmlMenuConfig, type IConversationStore, type ID, type InboundMessage, type InternalAgentNode, type InternalBaseNode, type InternalCreateCapabilityBundleInput, type InternalDSL, type InternalEdge, type InternalInput, type InternalInputNode, type InternalMapNode, type InternalNode, type InternalNodeConfig, type InternalOutput, type InternalState, type InternalStateField, type InternalTerminalNode, type InternalUpdateCapabilityBundleInput, type InterruptMessage, type InterruptPolicy, InvalidProjectCapabilityBundleConfigError, type LLMConfig, type LarkChannelInstallationConfig, type LatticeError, type LatticeEventBus, type LatticeMessage, type LocalA2AProviderId, type LocalA2AProviderState, type LocalA2AProviderStatus, type LocalA2ATemplateDefinition, type LocalRuntimeConfig, type LoggerClient, type LoggerConfig, type LoggerContext, type LoggerLatticeProtocol, LoggerType, MAX_PENDING_EXECUTION_RESULTS_LIMIT, type McpClient, type McpClientOptions, type McpConnectionStatus, type McpLatticeMessage, type McpLatticeProtocol, McpMessageType, type McpServerConfig, type McpServerConfigEntry, type McpServerConfigStore, type McpStats, type McpTool, type McpToolResult, type McpTransportType, type MemoryClient, type MemoryConfig, type MemoryLatticeProtocol, MemoryType, type MenuContentConfig, type MenuContentType, type MenuItem, type MenuRegistry, type MenuTarget, type Message, type MessageChunk, type MessageChunkType, MessageChunkTypes, type MessageContext, type MessageMiddleware, type MetricColumn, type MetricDataPoint, type MetricMeta, type MetricQueryResult, type MetricsMiddlewareConfig, type MetricsServerConfig, type MetricsServerConfigEntry, type MetricsServerConfigStore, type MetricsServerType, type MiddlewareType, type ModelLatticeProtocol, type OpenAuditAppendInput, type OpenAuditQuery, type OpenAuditRecord, type OpenAuditStore, type OpenCapabilitySource, type OpenCatalog, type OpenCatalogDomain, type OpenCatalogItem, type OpenCredentialKind, type OpenExecutionContext, type OpenExecutionResult, type OpenGrant, type OutboundMessage, PROJECT_ROOM_TASK_DELEGATED_LABEL, PROJECT_ROOM_TASK_DELEGATED_SEPARATOR, PROJECT_ROOM_USER_CHANNEL_PROJECT, PROJECT_TASK_LIFECYCLE_ACTIONS, type PaginatedResult, type PaginationParams, type PinoFileOptions, type Plugin, type PluginConnection, type PluginConnectionFieldSchema, type PluginConnectionTestResult, type PluginContext, type PluginDiscoveredResource, type PluginMeta, type PluginMetaOutput, type PluginMiddlewareFactory, type PluginSkillDefinition, type PluginSkillResource, type PluginStandardConnectionConfig, type PluginToolMeta, type ProcessingAgentConfig, type Project, type ProjectBotMembership, type ProjectBotMembershipStatus, type ProjectBotMembershipStore, type ProjectBotRole, type ProjectCapabilityConfig, type ProjectFilter, type ProjectHumanRole, type ProjectKind, type ProjectLifecycleEventCursor, type ProjectLifecycleEventQuery, type ProjectMembership, type ProjectMembershipMutationResult, type ProjectMembershipStatus, type ProjectMembershipStore, type ProjectRoom, ProjectRoomBrokerCapacityError, type ProjectRoomBusinessEvent, type ProjectRoomBusinessEventDraft, type ProjectRoomControlEvent, ProjectRoomCursorError, type ProjectRoomEventBrokerProtocol, type ProjectRoomEventId, type ProjectRoomEventOf, type ProjectRoomEventScope, type ProjectRoomEventSubscription, type ProjectRoomMembershipAffectedEvent, type ProjectRoomMembershipChangedEvent, type ProjectRoomMention, type ProjectRoomMessage, type ProjectRoomMessageAuthor, type ProjectRoomMessageCreatedEvent, type ProjectRoomMessageCursor, type ProjectRoomMessageSource, type ProjectRoomMessageStore, type ProjectRoomPublicBotMembership, type ProjectRoomPublicMembership, type ProjectRoomPublicMessage, type ProjectRoomReadChangedEvent, type ProjectRoomReadState, type ProjectRoomReadStateStore, type ProjectRoomRealtimeActor, type ProjectRoomRosterChangedEvent, type ProjectRoomScopedBusinessEvent, type ProjectRoomSseWritable, type ProjectRoomStore, type ProjectRoomTaskChangedEvent, type ProjectRoomThreadMetadata, type ProjectRoomTrustedRunContext, type ProjectStore, type ProjectTaskLifecycleAction, ProjectTaskStoreUnsupportedError, type ProjectTaskThreadMetadata, type ProjectTaskTrustedRunContext, type ProjectTaskWorkItemStore, type PublicChannelInstallationType, type QueryParams, type QueryResultFormat, type QueryWorkflowRunsOptions, type QueryWorkflowRunsResult, type QueueClient, type QueueConfig, type QueueLatticeProtocol, type QueueResult, QueueType, type QueuedExecutionMode, type ReactAgentConfig, type ReplyTarget, type ResourceAddress, type ResourceResolver, type Result, type RunStep, type STTClient, type STTConfig, type STTModelLatticeProtocol, type SandboxMiddlewareConfig, type SandboxPluginConnectionDef, type SandboxPluginDiagnostic, type SandboxPluginManifest, type SandboxPluginToolDef, type ScheduleClient, type ScheduleConfig, type ScheduleCronOptions, ScheduleExecutionType, type ScheduleLatticeProtocol, type ScheduleOnceOptions, type ScheduleStorage, ScheduleType, type ScheduledTaskDefinition, ScheduledTaskStatus, type SchedulerMiddlewareConfig, type SemanticMetricsFilter, type SemanticMetricsQueryRequest, type SemanticMetricsQueryResponse, type SemanticMetricsServerConfig, type ShareRecord, type ShareResult, type ShareVisibility, type SharedResourceStore, type Skill, type SkillClient, type SkillClientType, type SkillConfig, type SkillLatticeProtocol, type SkillStore, type SkillStoreContext, type SqlMiddlewareConfig, type StepStatus, type StepType, type StorageType, type SystemMessage, type TableQueryRequest, type TableQueryResponse, type TaskBeliefDiagnosticCode, type TaskBeliefEntry, type TaskBeliefParseFailure, type TaskBeliefParseResult, type TaskBeliefParseSuccess, type TaskBeliefState, type TaskDependentListQuery, type TaskFileRef, type TaskHandler, type TaskItem, type TaskListFilter, type TaskMutationSnapshot, type TaskStore, type TaskWorkItem, type TaskWorkItemListFilter, type TaskWorkItemStore, type TeamAgentConfig, type TeamTeammateConfig, type Tenant, type TenantStatus, type TenantStore, type TestMcpServerToolsResponse, type Thread, type ThreadStore, type Timestamp, type ToolCall, type ToolConfig, type ToolExecutor, type ToolLatticeProtocol, type ToolMessage, type TopologyEdge, type TranscriptionResult, type TrustedRunContext, type UIComponent, UIComponentType, type UIConfig, type UILatticeProtocol, type UpdateA2AApiKeyInput, type UpdateAgentWebAppInput, type UpdateCapabilityBundleInput, type UpdateChannelInstallationRequest, type UpdateCollectionRequest, type UpdateDatabaseConfigRequest, type UpdateMcpServerConfigRequest, type UpdateMenuItemInput, type UpdateMetricsServerConfigRequest, type UpdateProjectCapabilityBundlesResult, type UpdateProjectRequest, type UpdateRunStepRequest, type UpdateTaskRequest, type UpdateTenantRequest, type UpdateUserRequest, type UpdateUserTenantLinkRequest, type UpdateWorkflowRunRequest, type UpdateWorkspaceRequest, type User, type UserMessage, type UserPushSubscription, type UserPushSubscriptionStore, type UserStatus, type UserStore, type UserTenantLink, type UserTenantLinkStore, type UserTenantRole, type VectorStoreConfig, type VectorStoreCreateParams, type VectorStoreLatticeProtocol, type VectorStoreProvider, type WechatChannelInstallationConfig, type WorkflowAgentConfig, type WorkflowRun, type WorkflowRunStatus, type WorkflowTrackingStore, type Workspace, type WorkspaceStore, type YamlAgentStep, type YamlMapStep, type YamlParallelBlock, type YamlTopLevelStep, type YamlWorkflow, assertGenericProjectConfig, createAgentWebAppStreamProjectionContext, descriptorDataValue, effectiveGrants, getSubAgentsFromConfig, getToolsFromConfig, hasTools, isA2ARemoteAgentConfig, isDeepAgentConfig, isExecutionResultEventKey, isProcessingAgentConfig, isProjectRoomEventId, isTeamAgentConfig, isWorkflowAgentConfig, parseAgentWebAppGenUIBlock, parseProjectRoomEventId, parseQueuedExecutionMode, parseTaskBeliefState, parseTrustedRunContext, projectAgentWebAppChunk, projectRoomUserEventScope, replaceTaskBeliefState, requireProjectTaskWorkItemStore, snapshotExactArray, snapshotExactRecord, snapshotProjectRoomBotMembershipRealtime, snapshotProjectRoomMembershipRealtime, snapshotProjectRoomMessageRealtime, taskBeliefStatesEqual, toProjectRoomPublicBotMembership, toProjectRoomPublicMembership, toProjectRoomPublicMessage };
package/dist/index.js CHANGED
@@ -32,6 +32,8 @@ __export(index_exports, {
32
32
  McpMessageType: () => McpMessageType,
33
33
  MemoryType: () => MemoryType,
34
34
  MessageChunkTypes: () => MessageChunkTypes,
35
+ PROJECT_ROOM_TASK_DELEGATED_LABEL: () => PROJECT_ROOM_TASK_DELEGATED_LABEL,
36
+ PROJECT_ROOM_TASK_DELEGATED_SEPARATOR: () => PROJECT_ROOM_TASK_DELEGATED_SEPARATOR,
35
37
  PROJECT_ROOM_USER_CHANNEL_PROJECT: () => PROJECT_ROOM_USER_CHANNEL_PROJECT,
36
38
  PROJECT_TASK_LIFECYCLE_ACTIONS: () => PROJECT_TASK_LIFECYCLE_ACTIONS,
37
39
  ProjectRoomBrokerCapacityError: () => ProjectRoomBrokerCapacityError,
@@ -186,6 +188,7 @@ var MessageChunkTypes = {
186
188
  AI: "ai",
187
189
  TOOL: "tool",
188
190
  INTERRUPT: "interrupt",
191
+ ERROR: "error",
189
192
  MESSAGE_COMPLETED: "message_completed",
190
193
  MESSAGE_FAILED: "message_failed",
191
194
  THREAD_IDLE: "thread_idle"
@@ -573,6 +576,23 @@ function projectAgentWebAppChunk(chunk, context) {
573
576
  { type: "stream.completed" }
574
577
  ];
575
578
  }
579
+ if (chunk.type === MessageChunkTypes.ERROR) {
580
+ const code = typeof chunk.data.code === "string" ? chunk.data.code : "stream_error";
581
+ if (code === "aborted" || code === "superseded") {
582
+ return [{ type: "stream.completed" }];
583
+ }
584
+ return [
585
+ {
586
+ type: "error",
587
+ error: {
588
+ code: "STREAM_FAILED",
589
+ message: typeof chunk.data.content === "string" && chunk.data.content ? chunk.data.content : "Stream failed",
590
+ retryable: false
591
+ }
592
+ },
593
+ { type: "stream.completed" }
594
+ ];
595
+ }
576
596
  if (chunk.type === MessageChunkTypes.MESSAGE_FAILED) {
577
597
  return [
578
598
  { type: "error", error: { code: "STREAM_FAILED", message: "Stream failed", retryable: true } },
@@ -609,6 +629,10 @@ function isRecord2(value) {
609
629
  return typeof value === "object" && value !== null && !Array.isArray(value);
610
630
  }
611
631
 
632
+ // src/ProjectRoomProtocol.ts
633
+ var PROJECT_ROOM_TASK_DELEGATED_LABEL = "Task delegated";
634
+ var PROJECT_ROOM_TASK_DELEGATED_SEPARATOR = " \xB7 ";
635
+
612
636
  // src/ExactDataSnapshot.ts
613
637
  function ownDescriptorField(descriptor, key) {
614
638
  const field = Object.getOwnPropertyDescriptor(descriptor, key);
@@ -749,6 +773,10 @@ function mapPublicMessageRecord(record) {
749
773
  if (typeof record.replyToMessageId !== "string") return void 0;
750
774
  result.replyToMessageId = record.replyToMessageId;
751
775
  }
776
+ if (record.sourceId !== void 0) {
777
+ if (typeof record.sourceId !== "string") return void 0;
778
+ result.sourceId = record.sourceId;
779
+ }
752
780
  return result;
753
781
  }
754
782
  function snapshotPublicMentions(value) {
@@ -959,6 +987,8 @@ function effectiveGrants(record) {
959
987
  McpMessageType,
960
988
  MemoryType,
961
989
  MessageChunkTypes,
990
+ PROJECT_ROOM_TASK_DELEGATED_LABEL,
991
+ PROJECT_ROOM_TASK_DELEGATED_SEPARATOR,
962
992
  PROJECT_ROOM_USER_CHANNEL_PROJECT,
963
993
  PROJECT_TASK_LIFECYCLE_ACTIONS,
964
994
  ProjectRoomBrokerCapacityError,