@axiom-lattice/protocols 4.0.0 → 4.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
1
 
2
- > @axiom-lattice/protocols@4.0.0 build /home/runner/work/agentic/agentic/packages/protocols
2
+ > @axiom-lattice/protocols@4.0.1 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
- ESM dist/index.mjs 12.80 KB
12
- ESM dist/index.mjs.map 57.44 KB
13
- ESM ⚡️ Build success in 182ms
14
- CJS dist/index.js 14.69 KB
15
- CJS dist/index.js.map 59.96 KB
16
- CJS ⚡️ Build success in 186ms
11
+ ESM dist/index.mjs 15.02 KB
12
+ ESM dist/index.mjs.map 65.29 KB
13
+ ESM ⚡️ Build success in 160ms
14
+ CJS dist/index.js 16.98 KB
15
+ CJS dist/index.js.map 67.90 KB
16
+ CJS ⚡️ Build success in 161ms
17
17
  DTS Build start
18
- DTS ⚡️ Build success in 11445ms
19
- DTS dist/index.d.ts 148.90 KB
20
- DTS dist/index.d.mts 148.90 KB
18
+ DTS ⚡️ Build success in 13938ms
19
+ DTS dist/index.d.ts 156.11 KB
20
+ DTS dist/index.d.mts 156.11 KB
package/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # @axiom-lattice/protocols
2
2
 
3
+ ## 4.0.1
4
+
5
+ ### Patch Changes
6
+
7
+ - b44b480: Add managed Agent Web App publications, an isolated public runtime with project, model, thread, attachment and HITL boundaries, management SDK methods, and a dedicated React SDK Web App entry with composable hooks and widget components. Share authorized Agent execution, close-aware SSE transport, neutral file-reference formatting, and review decision state without merging Console and external authentication contexts.
8
+ - 3401a97: fix web
9
+
3
10
  ## 4.0.0
4
11
 
5
12
  ### Major Changes
package/dist/index.d.mts CHANGED
@@ -4446,6 +4446,213 @@ interface IConversationStore {
4446
4446
  deleteConversation(conversationId: string): Promise<void>;
4447
4447
  }
4448
4448
 
4449
+ /** Lifecycle state of an Agent Web App publication. */
4450
+ type AgentWebAppStatus = "draft" | "active" | "disabled";
4451
+ /** Project and model boundaries exposed by an Agent Web App. */
4452
+ interface AgentWebAppScope {
4453
+ defaultProjectId: string;
4454
+ allowedProjectIds: string[];
4455
+ defaultModelKey?: string;
4456
+ allowedModelKeys?: string[];
4457
+ }
4458
+ /** Runtime capabilities enabled for an Agent Web App. */
4459
+ interface AgentWebAppFeatures {
4460
+ projectSelector: boolean;
4461
+ modelSelector: boolean;
4462
+ threadManagement: boolean;
4463
+ attachments: boolean;
4464
+ hitl: boolean;
4465
+ genUI: boolean;
4466
+ }
4467
+ /** Optional display customization for an Agent Web App. */
4468
+ interface AgentWebAppAppearance {
4469
+ title?: string;
4470
+ welcomeMessage?: string;
4471
+ primaryColor?: string;
4472
+ }
4473
+ /** Persisted React SDK publication of an assistant. */
4474
+ interface AgentWebApp {
4475
+ id: string;
4476
+ tenantId: string;
4477
+ assistantId: string;
4478
+ name: string;
4479
+ description?: string;
4480
+ status: AgentWebAppStatus;
4481
+ integration: {
4482
+ type: "react_sdk";
4483
+ };
4484
+ scope: AgentWebAppScope;
4485
+ features: AgentWebAppFeatures;
4486
+ appearance: AgentWebAppAppearance;
4487
+ createdAt: Date;
4488
+ updatedAt: Date;
4489
+ }
4490
+ /** Client-provided fields used to create an Agent Web App. */
4491
+ interface CreateAgentWebAppInput {
4492
+ assistantId: string;
4493
+ name: string;
4494
+ description?: string;
4495
+ integration: {
4496
+ type: "react_sdk";
4497
+ };
4498
+ scope: AgentWebAppScope;
4499
+ features: AgentWebAppFeatures;
4500
+ appearance: AgentWebAppAppearance;
4501
+ }
4502
+ /** Editable fields accepted when updating an Agent Web App. Nested objects use merge semantics. */
4503
+ interface UpdateAgentWebAppInput {
4504
+ name?: string;
4505
+ description?: string;
4506
+ scope?: Partial<AgentWebAppScope>;
4507
+ features?: Partial<AgentWebAppFeatures>;
4508
+ appearance?: Partial<AgentWebAppAppearance>;
4509
+ }
4510
+ /** Internal persistence patch. Nested objects are complete replacements when provided. */
4511
+ interface AgentWebAppStorePatch {
4512
+ name?: string;
4513
+ description?: string;
4514
+ scope?: AgentWebAppScope;
4515
+ features?: AgentWebAppFeatures;
4516
+ appearance?: AgentWebAppAppearance;
4517
+ status?: AgentWebAppStatus;
4518
+ }
4519
+ /** Optional optimistic concurrency guard for an Agent Web App update. */
4520
+ interface AgentWebAppUpdateOptions {
4521
+ /** Update only when the persisted timestamp exactly matches this snapshot. */
4522
+ expectedUpdatedAt?: Date;
4523
+ }
4524
+ /** Tenant-scoped persistence operations for Agent Web Apps. */
4525
+ interface AgentWebAppStore {
4526
+ list(tenantId: string, assistantId?: string): Promise<AgentWebApp[]>;
4527
+ getById(tenantId: string, webAppId: string): Promise<AgentWebApp | null>;
4528
+ /**
4529
+ * Resolve a globally identifiable publication for an external runtime request.
4530
+ *
4531
+ * The returned record still carries its owning tenant; callers must derive all
4532
+ * tenant scope from that record and must not accept a tenant from the browser.
4533
+ */
4534
+ findById(webAppId: string): Promise<AgentWebApp | null>;
4535
+ create(tenantId: string, input: CreateAgentWebAppInput): Promise<AgentWebApp>;
4536
+ update(tenantId: string, webAppId: string, patch: AgentWebAppStorePatch, options?: AgentWebAppUpdateOptions): Promise<AgentWebApp | null>;
4537
+ delete(tenantId: string, webAppId: string): Promise<boolean>;
4538
+ }
4539
+
4540
+ /** Server-owned metadata that isolates an external user's Web App thread. */
4541
+ interface AgentWebAppThreadMetadata {
4542
+ source: "web_app";
4543
+ webAppId: string;
4544
+ userId: string;
4545
+ projectId: string;
4546
+ label?: string;
4547
+ }
4548
+ /** Public, redacted projection of a thread owned by an Agent Web App identity. */
4549
+ interface AgentWebAppRuntimeThread {
4550
+ id: string;
4551
+ projectId: string;
4552
+ label?: string;
4553
+ createdAt: Date;
4554
+ updatedAt: Date;
4555
+ }
4556
+ /** Reviewed public message projection. Structured internal content is not exposed. */
4557
+ interface AgentWebAppRuntimeMessage {
4558
+ id: string;
4559
+ role: "human" | "ai";
4560
+ content?: string | AgentWebAppGenUIBlock[];
4561
+ }
4562
+ interface AgentWebAppCalloutWidget {
4563
+ kind: "callout";
4564
+ text: string;
4565
+ title?: string;
4566
+ tone?: "info" | "success" | "warning";
4567
+ }
4568
+ interface AgentWebAppTableWidget {
4569
+ kind: "table";
4570
+ columns: string[];
4571
+ rows: string[][];
4572
+ caption?: string;
4573
+ }
4574
+ /** V1 declarative GenUI block. It deliberately has no HTML, URL, or executable fields. */
4575
+ interface AgentWebAppGenUIBlock {
4576
+ type: "widget";
4577
+ widget: AgentWebAppCalloutWidget | AgentWebAppTableWidget;
4578
+ }
4579
+ /** Public initialization data available to an external Agent Web App. */
4580
+ interface AgentWebAppBootstrap {
4581
+ webApp: {
4582
+ id: string;
4583
+ name: string;
4584
+ description?: string;
4585
+ assistant: {
4586
+ id: string;
4587
+ name: string;
4588
+ description?: string;
4589
+ };
4590
+ defaultProjectId: string;
4591
+ defaultModelKey?: string;
4592
+ features: AgentWebAppFeatures;
4593
+ appearance: AgentWebAppAppearance;
4594
+ identityAssurance: "unverified";
4595
+ };
4596
+ projects: Array<{
4597
+ id: string;
4598
+ name: string;
4599
+ }>;
4600
+ models: Array<{
4601
+ key: string;
4602
+ label: string;
4603
+ }>;
4604
+ /** Latest owned thread, created implicitly only when thread management is disabled. */
4605
+ thread?: AgentWebAppRuntimeThread;
4606
+ }
4607
+ /** Human-in-the-loop interruption exposed through the Web App runtime. */
4608
+ interface AgentWebAppInterrupt {
4609
+ id: string;
4610
+ type: string;
4611
+ prompt: string;
4612
+ data?: Record<string, unknown>;
4613
+ }
4614
+ /**
4615
+ * Stable machine-readable error codes returned by the Web App runtime.
4616
+ *
4617
+ * `INVALID_REQUEST` covers redacted request-validation failures and
4618
+ * `INTERNAL_ERROR` covers redacted unexpected server failures.
4619
+ */
4620
+ type AgentWebAppErrorCode = "WEB_APP_NOT_FOUND" | "WEB_APP_DISABLED" | "USER_ID_REQUIRED" | "INVALID_USER_ID" | "PROJECT_NOT_ALLOWED" | "PROJECT_SELECTOR_DISABLED" | "MODEL_NOT_ALLOWED" | "FEATURE_DISABLED" | "THREAD_NOT_FOUND" | "STREAM_CONFLICT" | "STREAM_FAILED" | "INVALID_REQUEST" | "INTERNAL_ERROR";
4621
+ /** Public error payload returned by the Web App runtime. */
4622
+ interface AgentWebAppError {
4623
+ code: AgentWebAppErrorCode;
4624
+ message: string;
4625
+ retryable: boolean;
4626
+ }
4627
+ /** Stable stream events projected from internal agent execution output. */
4628
+ type AgentWebAppStreamEvent = {
4629
+ type: "message.delta";
4630
+ text: string;
4631
+ } | {
4632
+ type: "message.completed";
4633
+ messageId: string;
4634
+ } | {
4635
+ type: "tool.started";
4636
+ id: string;
4637
+ name: string;
4638
+ } | {
4639
+ type: "tool.completed";
4640
+ id: string;
4641
+ } | {
4642
+ type: "interrupt.created";
4643
+ interrupt: AgentWebAppInterrupt;
4644
+ } | {
4645
+ type: "genui.render";
4646
+ block: AgentWebAppGenUIBlock;
4647
+ } | {
4648
+ type: "error";
4649
+ error: AgentWebAppError;
4650
+ } | {
4651
+ type: "stream.completed";
4652
+ };
4653
+ /** Validate and copy one strict public GenUI block at a trust boundary. */
4654
+ declare function parseAgentWebAppGenUIBlock(value: unknown): AgentWebAppGenUIBlock | undefined;
4655
+
4449
4656
  /**
4450
4657
  * YAML Workflow DSL — linear model with parallel blocks
4451
4658
  *
@@ -4922,4 +5129,4 @@ type Timestamp = number;
4922
5129
  */
4923
5130
  type Callback<T = any, R = void> = (data: T) => R | Promise<R>;
4924
5131
 
4925
- export { type A2AApiKeyEntry, type A2AApiKeyRecord, type A2AApiKeyStore, type A2AAuthContext, type A2AExposure, type A2ARemoteAgentConfig, type AgentClient, type AgentConfig, type AgentConfigWithTools, type AgentLatticeProtocol, type AgentMenuConfig, type AgentMiddlewareConfig, type AgentRunConfig, AgentType, type Assistant, type AssistantMessage, type AssistantStore, type Attachment, type AvailableModule, type BaseLatticeProtocol, type BaseMessage, type Binding, type BindingRegistry, type BootstrapFilesConfig, type BrowserMiddlewareConfig, type Callback, type ChannelAdapter, 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 CreateAssistantRequest, type CreateBindingInput, 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 DeveloperMessage, type DispatchResult, type EmbeddingsConfig, type EmbeddingsLatticeProtocol, type EvalCase, type EvalProject, type EvalProjectReport, type EvalRun, type EvalRunResult, type EvalStore, type EvalSuite, type ExecuteSqlQueryRequest, type ExecuteSqlQueryResponse, type FilterCondition, type GraphBuildOptions, type HtmlMenuConfig, type IConversationStore, type ID, type InboundMessage, type InternalAgentNode, type InternalBaseNode, type InternalDSL, type InternalEdge, type InternalInput, type InternalInputNode, type InternalMapNode, type InternalNode, type InternalNodeConfig, type InternalOutput, type InternalState, type InternalStateField, type InternalTerminalNode, type InterruptMessage, type InterruptPolicy, 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, 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 OutboundMessage, 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 PluginToolMeta, type ProcessingAgentConfig, type Project, type ProjectFilter, type ProjectKind, type ProjectStore, type QueryParams, type QueryResultFormat, type QueryWorkflowRunsOptions, type QueryWorkflowRunsResult, type QueueClient, type QueueConfig, type QueueLatticeProtocol, type QueueResult, QueueType, type ReactAgentConfig, type ReplyTarget, type ResourceAddress, type ResourceResolver, type Result, type RunStep, type STTClient, type STTConfig, type STTModelLatticeProtocol, type SandboxMiddlewareConfig, 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 TaskFileRef, type TaskHandler, type TaskItem, type TaskListFilter, 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 UIComponent, UIComponentType, type UIConfig, type UILatticeProtocol, type UpdateChannelInstallationRequest, type UpdateCollectionRequest, type UpdateDatabaseConfigRequest, type UpdateMcpServerConfigRequest, type UpdateMenuItemInput, type UpdateMetricsServerConfigRequest, 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, getSubAgentsFromConfig, getToolsFromConfig, hasTools, isA2ARemoteAgentConfig, isDeepAgentConfig, isProcessingAgentConfig, isTeamAgentConfig, isWorkflowAgentConfig, parseTaskBeliefState, replaceTaskBeliefState, taskBeliefStatesEqual };
5132
+ export { type A2AApiKeyEntry, type A2AApiKeyRecord, type A2AApiKeyStore, type A2AAuthContext, type A2AExposure, 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 AgentWebAppInterrupt, type AgentWebAppRuntimeMessage, type AgentWebAppRuntimeThread, type AgentWebAppScope, type AgentWebAppStatus, type AgentWebAppStore, type AgentWebAppStorePatch, type AgentWebAppStreamEvent, type AgentWebAppTableWidget, type AgentWebAppThreadMetadata, type AgentWebAppUpdateOptions, type Assistant, type AssistantMessage, type AssistantStore, type Attachment, type AvailableModule, type BaseLatticeProtocol, type BaseMessage, type Binding, type BindingRegistry, type BootstrapFilesConfig, type BrowserMiddlewareConfig, type Callback, type ChannelAdapter, 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 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 DeveloperMessage, type DispatchResult, type EmbeddingsConfig, type EmbeddingsLatticeProtocol, type EvalCase, type EvalProject, type EvalProjectReport, type EvalRun, type EvalRunResult, type EvalStore, type EvalSuite, type ExecuteSqlQueryRequest, type ExecuteSqlQueryResponse, type FilterCondition, type GraphBuildOptions, type HtmlMenuConfig, type IConversationStore, type ID, type InboundMessage, type InternalAgentNode, type InternalBaseNode, type InternalDSL, type InternalEdge, type InternalInput, type InternalInputNode, type InternalMapNode, type InternalNode, type InternalNodeConfig, type InternalOutput, type InternalState, type InternalStateField, type InternalTerminalNode, type InterruptMessage, type InterruptPolicy, 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, 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 OutboundMessage, 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 PluginToolMeta, type ProcessingAgentConfig, type Project, type ProjectFilter, type ProjectKind, type ProjectStore, type QueryParams, type QueryResultFormat, type QueryWorkflowRunsOptions, type QueryWorkflowRunsResult, type QueueClient, type QueueConfig, type QueueLatticeProtocol, type QueueResult, QueueType, type ReactAgentConfig, type ReplyTarget, type ResourceAddress, type ResourceResolver, type Result, type RunStep, type STTClient, type STTConfig, type STTModelLatticeProtocol, type SandboxMiddlewareConfig, 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 TaskFileRef, type TaskHandler, type TaskItem, type TaskListFilter, 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 UIComponent, UIComponentType, type UIConfig, type UILatticeProtocol, type UpdateAgentWebAppInput, type UpdateChannelInstallationRequest, type UpdateCollectionRequest, type UpdateDatabaseConfigRequest, type UpdateMcpServerConfigRequest, type UpdateMenuItemInput, type UpdateMetricsServerConfigRequest, 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, getSubAgentsFromConfig, getToolsFromConfig, hasTools, isA2ARemoteAgentConfig, isDeepAgentConfig, isProcessingAgentConfig, isTeamAgentConfig, isWorkflowAgentConfig, parseAgentWebAppGenUIBlock, parseTaskBeliefState, replaceTaskBeliefState, taskBeliefStatesEqual };
package/dist/index.d.ts CHANGED
@@ -4446,6 +4446,213 @@ interface IConversationStore {
4446
4446
  deleteConversation(conversationId: string): Promise<void>;
4447
4447
  }
4448
4448
 
4449
+ /** Lifecycle state of an Agent Web App publication. */
4450
+ type AgentWebAppStatus = "draft" | "active" | "disabled";
4451
+ /** Project and model boundaries exposed by an Agent Web App. */
4452
+ interface AgentWebAppScope {
4453
+ defaultProjectId: string;
4454
+ allowedProjectIds: string[];
4455
+ defaultModelKey?: string;
4456
+ allowedModelKeys?: string[];
4457
+ }
4458
+ /** Runtime capabilities enabled for an Agent Web App. */
4459
+ interface AgentWebAppFeatures {
4460
+ projectSelector: boolean;
4461
+ modelSelector: boolean;
4462
+ threadManagement: boolean;
4463
+ attachments: boolean;
4464
+ hitl: boolean;
4465
+ genUI: boolean;
4466
+ }
4467
+ /** Optional display customization for an Agent Web App. */
4468
+ interface AgentWebAppAppearance {
4469
+ title?: string;
4470
+ welcomeMessage?: string;
4471
+ primaryColor?: string;
4472
+ }
4473
+ /** Persisted React SDK publication of an assistant. */
4474
+ interface AgentWebApp {
4475
+ id: string;
4476
+ tenantId: string;
4477
+ assistantId: string;
4478
+ name: string;
4479
+ description?: string;
4480
+ status: AgentWebAppStatus;
4481
+ integration: {
4482
+ type: "react_sdk";
4483
+ };
4484
+ scope: AgentWebAppScope;
4485
+ features: AgentWebAppFeatures;
4486
+ appearance: AgentWebAppAppearance;
4487
+ createdAt: Date;
4488
+ updatedAt: Date;
4489
+ }
4490
+ /** Client-provided fields used to create an Agent Web App. */
4491
+ interface CreateAgentWebAppInput {
4492
+ assistantId: string;
4493
+ name: string;
4494
+ description?: string;
4495
+ integration: {
4496
+ type: "react_sdk";
4497
+ };
4498
+ scope: AgentWebAppScope;
4499
+ features: AgentWebAppFeatures;
4500
+ appearance: AgentWebAppAppearance;
4501
+ }
4502
+ /** Editable fields accepted when updating an Agent Web App. Nested objects use merge semantics. */
4503
+ interface UpdateAgentWebAppInput {
4504
+ name?: string;
4505
+ description?: string;
4506
+ scope?: Partial<AgentWebAppScope>;
4507
+ features?: Partial<AgentWebAppFeatures>;
4508
+ appearance?: Partial<AgentWebAppAppearance>;
4509
+ }
4510
+ /** Internal persistence patch. Nested objects are complete replacements when provided. */
4511
+ interface AgentWebAppStorePatch {
4512
+ name?: string;
4513
+ description?: string;
4514
+ scope?: AgentWebAppScope;
4515
+ features?: AgentWebAppFeatures;
4516
+ appearance?: AgentWebAppAppearance;
4517
+ status?: AgentWebAppStatus;
4518
+ }
4519
+ /** Optional optimistic concurrency guard for an Agent Web App update. */
4520
+ interface AgentWebAppUpdateOptions {
4521
+ /** Update only when the persisted timestamp exactly matches this snapshot. */
4522
+ expectedUpdatedAt?: Date;
4523
+ }
4524
+ /** Tenant-scoped persistence operations for Agent Web Apps. */
4525
+ interface AgentWebAppStore {
4526
+ list(tenantId: string, assistantId?: string): Promise<AgentWebApp[]>;
4527
+ getById(tenantId: string, webAppId: string): Promise<AgentWebApp | null>;
4528
+ /**
4529
+ * Resolve a globally identifiable publication for an external runtime request.
4530
+ *
4531
+ * The returned record still carries its owning tenant; callers must derive all
4532
+ * tenant scope from that record and must not accept a tenant from the browser.
4533
+ */
4534
+ findById(webAppId: string): Promise<AgentWebApp | null>;
4535
+ create(tenantId: string, input: CreateAgentWebAppInput): Promise<AgentWebApp>;
4536
+ update(tenantId: string, webAppId: string, patch: AgentWebAppStorePatch, options?: AgentWebAppUpdateOptions): Promise<AgentWebApp | null>;
4537
+ delete(tenantId: string, webAppId: string): Promise<boolean>;
4538
+ }
4539
+
4540
+ /** Server-owned metadata that isolates an external user's Web App thread. */
4541
+ interface AgentWebAppThreadMetadata {
4542
+ source: "web_app";
4543
+ webAppId: string;
4544
+ userId: string;
4545
+ projectId: string;
4546
+ label?: string;
4547
+ }
4548
+ /** Public, redacted projection of a thread owned by an Agent Web App identity. */
4549
+ interface AgentWebAppRuntimeThread {
4550
+ id: string;
4551
+ projectId: string;
4552
+ label?: string;
4553
+ createdAt: Date;
4554
+ updatedAt: Date;
4555
+ }
4556
+ /** Reviewed public message projection. Structured internal content is not exposed. */
4557
+ interface AgentWebAppRuntimeMessage {
4558
+ id: string;
4559
+ role: "human" | "ai";
4560
+ content?: string | AgentWebAppGenUIBlock[];
4561
+ }
4562
+ interface AgentWebAppCalloutWidget {
4563
+ kind: "callout";
4564
+ text: string;
4565
+ title?: string;
4566
+ tone?: "info" | "success" | "warning";
4567
+ }
4568
+ interface AgentWebAppTableWidget {
4569
+ kind: "table";
4570
+ columns: string[];
4571
+ rows: string[][];
4572
+ caption?: string;
4573
+ }
4574
+ /** V1 declarative GenUI block. It deliberately has no HTML, URL, or executable fields. */
4575
+ interface AgentWebAppGenUIBlock {
4576
+ type: "widget";
4577
+ widget: AgentWebAppCalloutWidget | AgentWebAppTableWidget;
4578
+ }
4579
+ /** Public initialization data available to an external Agent Web App. */
4580
+ interface AgentWebAppBootstrap {
4581
+ webApp: {
4582
+ id: string;
4583
+ name: string;
4584
+ description?: string;
4585
+ assistant: {
4586
+ id: string;
4587
+ name: string;
4588
+ description?: string;
4589
+ };
4590
+ defaultProjectId: string;
4591
+ defaultModelKey?: string;
4592
+ features: AgentWebAppFeatures;
4593
+ appearance: AgentWebAppAppearance;
4594
+ identityAssurance: "unverified";
4595
+ };
4596
+ projects: Array<{
4597
+ id: string;
4598
+ name: string;
4599
+ }>;
4600
+ models: Array<{
4601
+ key: string;
4602
+ label: string;
4603
+ }>;
4604
+ /** Latest owned thread, created implicitly only when thread management is disabled. */
4605
+ thread?: AgentWebAppRuntimeThread;
4606
+ }
4607
+ /** Human-in-the-loop interruption exposed through the Web App runtime. */
4608
+ interface AgentWebAppInterrupt {
4609
+ id: string;
4610
+ type: string;
4611
+ prompt: string;
4612
+ data?: Record<string, unknown>;
4613
+ }
4614
+ /**
4615
+ * Stable machine-readable error codes returned by the Web App runtime.
4616
+ *
4617
+ * `INVALID_REQUEST` covers redacted request-validation failures and
4618
+ * `INTERNAL_ERROR` covers redacted unexpected server failures.
4619
+ */
4620
+ type AgentWebAppErrorCode = "WEB_APP_NOT_FOUND" | "WEB_APP_DISABLED" | "USER_ID_REQUIRED" | "INVALID_USER_ID" | "PROJECT_NOT_ALLOWED" | "PROJECT_SELECTOR_DISABLED" | "MODEL_NOT_ALLOWED" | "FEATURE_DISABLED" | "THREAD_NOT_FOUND" | "STREAM_CONFLICT" | "STREAM_FAILED" | "INVALID_REQUEST" | "INTERNAL_ERROR";
4621
+ /** Public error payload returned by the Web App runtime. */
4622
+ interface AgentWebAppError {
4623
+ code: AgentWebAppErrorCode;
4624
+ message: string;
4625
+ retryable: boolean;
4626
+ }
4627
+ /** Stable stream events projected from internal agent execution output. */
4628
+ type AgentWebAppStreamEvent = {
4629
+ type: "message.delta";
4630
+ text: string;
4631
+ } | {
4632
+ type: "message.completed";
4633
+ messageId: string;
4634
+ } | {
4635
+ type: "tool.started";
4636
+ id: string;
4637
+ name: string;
4638
+ } | {
4639
+ type: "tool.completed";
4640
+ id: string;
4641
+ } | {
4642
+ type: "interrupt.created";
4643
+ interrupt: AgentWebAppInterrupt;
4644
+ } | {
4645
+ type: "genui.render";
4646
+ block: AgentWebAppGenUIBlock;
4647
+ } | {
4648
+ type: "error";
4649
+ error: AgentWebAppError;
4650
+ } | {
4651
+ type: "stream.completed";
4652
+ };
4653
+ /** Validate and copy one strict public GenUI block at a trust boundary. */
4654
+ declare function parseAgentWebAppGenUIBlock(value: unknown): AgentWebAppGenUIBlock | undefined;
4655
+
4449
4656
  /**
4450
4657
  * YAML Workflow DSL — linear model with parallel blocks
4451
4658
  *
@@ -4922,4 +5129,4 @@ type Timestamp = number;
4922
5129
  */
4923
5130
  type Callback<T = any, R = void> = (data: T) => R | Promise<R>;
4924
5131
 
4925
- export { type A2AApiKeyEntry, type A2AApiKeyRecord, type A2AApiKeyStore, type A2AAuthContext, type A2AExposure, type A2ARemoteAgentConfig, type AgentClient, type AgentConfig, type AgentConfigWithTools, type AgentLatticeProtocol, type AgentMenuConfig, type AgentMiddlewareConfig, type AgentRunConfig, AgentType, type Assistant, type AssistantMessage, type AssistantStore, type Attachment, type AvailableModule, type BaseLatticeProtocol, type BaseMessage, type Binding, type BindingRegistry, type BootstrapFilesConfig, type BrowserMiddlewareConfig, type Callback, type ChannelAdapter, 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 CreateAssistantRequest, type CreateBindingInput, 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 DeveloperMessage, type DispatchResult, type EmbeddingsConfig, type EmbeddingsLatticeProtocol, type EvalCase, type EvalProject, type EvalProjectReport, type EvalRun, type EvalRunResult, type EvalStore, type EvalSuite, type ExecuteSqlQueryRequest, type ExecuteSqlQueryResponse, type FilterCondition, type GraphBuildOptions, type HtmlMenuConfig, type IConversationStore, type ID, type InboundMessage, type InternalAgentNode, type InternalBaseNode, type InternalDSL, type InternalEdge, type InternalInput, type InternalInputNode, type InternalMapNode, type InternalNode, type InternalNodeConfig, type InternalOutput, type InternalState, type InternalStateField, type InternalTerminalNode, type InterruptMessage, type InterruptPolicy, 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, 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 OutboundMessage, 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 PluginToolMeta, type ProcessingAgentConfig, type Project, type ProjectFilter, type ProjectKind, type ProjectStore, type QueryParams, type QueryResultFormat, type QueryWorkflowRunsOptions, type QueryWorkflowRunsResult, type QueueClient, type QueueConfig, type QueueLatticeProtocol, type QueueResult, QueueType, type ReactAgentConfig, type ReplyTarget, type ResourceAddress, type ResourceResolver, type Result, type RunStep, type STTClient, type STTConfig, type STTModelLatticeProtocol, type SandboxMiddlewareConfig, 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 TaskFileRef, type TaskHandler, type TaskItem, type TaskListFilter, 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 UIComponent, UIComponentType, type UIConfig, type UILatticeProtocol, type UpdateChannelInstallationRequest, type UpdateCollectionRequest, type UpdateDatabaseConfigRequest, type UpdateMcpServerConfigRequest, type UpdateMenuItemInput, type UpdateMetricsServerConfigRequest, 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, getSubAgentsFromConfig, getToolsFromConfig, hasTools, isA2ARemoteAgentConfig, isDeepAgentConfig, isProcessingAgentConfig, isTeamAgentConfig, isWorkflowAgentConfig, parseTaskBeliefState, replaceTaskBeliefState, taskBeliefStatesEqual };
5132
+ export { type A2AApiKeyEntry, type A2AApiKeyRecord, type A2AApiKeyStore, type A2AAuthContext, type A2AExposure, 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 AgentWebAppInterrupt, type AgentWebAppRuntimeMessage, type AgentWebAppRuntimeThread, type AgentWebAppScope, type AgentWebAppStatus, type AgentWebAppStore, type AgentWebAppStorePatch, type AgentWebAppStreamEvent, type AgentWebAppTableWidget, type AgentWebAppThreadMetadata, type AgentWebAppUpdateOptions, type Assistant, type AssistantMessage, type AssistantStore, type Attachment, type AvailableModule, type BaseLatticeProtocol, type BaseMessage, type Binding, type BindingRegistry, type BootstrapFilesConfig, type BrowserMiddlewareConfig, type Callback, type ChannelAdapter, 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 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 DeveloperMessage, type DispatchResult, type EmbeddingsConfig, type EmbeddingsLatticeProtocol, type EvalCase, type EvalProject, type EvalProjectReport, type EvalRun, type EvalRunResult, type EvalStore, type EvalSuite, type ExecuteSqlQueryRequest, type ExecuteSqlQueryResponse, type FilterCondition, type GraphBuildOptions, type HtmlMenuConfig, type IConversationStore, type ID, type InboundMessage, type InternalAgentNode, type InternalBaseNode, type InternalDSL, type InternalEdge, type InternalInput, type InternalInputNode, type InternalMapNode, type InternalNode, type InternalNodeConfig, type InternalOutput, type InternalState, type InternalStateField, type InternalTerminalNode, type InterruptMessage, type InterruptPolicy, 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, 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 OutboundMessage, 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 PluginToolMeta, type ProcessingAgentConfig, type Project, type ProjectFilter, type ProjectKind, type ProjectStore, type QueryParams, type QueryResultFormat, type QueryWorkflowRunsOptions, type QueryWorkflowRunsResult, type QueueClient, type QueueConfig, type QueueLatticeProtocol, type QueueResult, QueueType, type ReactAgentConfig, type ReplyTarget, type ResourceAddress, type ResourceResolver, type Result, type RunStep, type STTClient, type STTConfig, type STTModelLatticeProtocol, type SandboxMiddlewareConfig, 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 TaskFileRef, type TaskHandler, type TaskItem, type TaskListFilter, 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 UIComponent, UIComponentType, type UIConfig, type UILatticeProtocol, type UpdateAgentWebAppInput, type UpdateChannelInstallationRequest, type UpdateCollectionRequest, type UpdateDatabaseConfigRequest, type UpdateMcpServerConfigRequest, type UpdateMenuItemInput, type UpdateMetricsServerConfigRequest, 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, getSubAgentsFromConfig, getToolsFromConfig, hasTools, isA2ARemoteAgentConfig, isDeepAgentConfig, isProcessingAgentConfig, isTeamAgentConfig, isWorkflowAgentConfig, parseAgentWebAppGenUIBlock, parseTaskBeliefState, replaceTaskBeliefState, taskBeliefStatesEqual };
package/dist/index.js CHANGED
@@ -38,6 +38,7 @@ __export(index_exports, {
38
38
  isProcessingAgentConfig: () => isProcessingAgentConfig,
39
39
  isTeamAgentConfig: () => isTeamAgentConfig,
40
40
  isWorkflowAgentConfig: () => isWorkflowAgentConfig,
41
+ parseAgentWebAppGenUIBlock: () => parseAgentWebAppGenUIBlock,
41
42
  parseTaskBeliefState: () => parseTaskBeliefState,
42
43
  replaceTaskBeliefState: () => replaceTaskBeliefState,
43
44
  taskBeliefStatesEqual: () => taskBeliefStatesEqual
@@ -389,6 +390,44 @@ function replaceTaskBeliefState(markdown, state) {
389
390
  const trailingBreaks = after.length === 0 ? "" : after.startsWith("\n") ? "\n" : "\n\n";
390
391
  return before + leadingBreaks + replacement + trailingBreaks + after;
391
392
  }
393
+
394
+ // src/AgentWebAppRuntimeProtocol.ts
395
+ var MAX_WIDGET_TEXT = 2e3;
396
+ var MAX_TABLE_COLUMNS = 12;
397
+ var MAX_TABLE_ROWS = 100;
398
+ function parseAgentWebAppGenUIBlock(value) {
399
+ if (!isExactRecord(value, ["type", "widget"]) || value.type !== "widget" || !isRecord(value.widget)) return void 0;
400
+ const widget = value.widget;
401
+ if (widget.kind === "callout") {
402
+ if (!hasOnlyKeys(widget, ["kind", "text"], ["title", "tone"]) || !boundedText(widget.text)) return void 0;
403
+ if (widget.title !== void 0 && !boundedText(widget.title)) return void 0;
404
+ if (widget.tone !== void 0 && widget.tone !== "info" && widget.tone !== "success" && widget.tone !== "warning") return void 0;
405
+ return { type: "widget", widget: { kind: "callout", text: widget.text, ...typeof widget.title === "string" ? { title: widget.title } : {}, ...widget.tone ? { tone: widget.tone } : {} } };
406
+ }
407
+ if (widget.kind === "table") {
408
+ if (!hasOnlyKeys(widget, ["kind", "columns", "rows"], ["caption"]) || !Array.isArray(widget.columns) || !Array.isArray(widget.rows)) return void 0;
409
+ const columns = widget.columns;
410
+ const rows = widget.rows;
411
+ if (columns.length === 0 || columns.length > MAX_TABLE_COLUMNS || !columns.every(boundedText)) return void 0;
412
+ if (rows.length > MAX_TABLE_ROWS || !rows.every((row) => Array.isArray(row) && row.length === columns.length && row.every(boundedText))) return void 0;
413
+ if (widget.caption !== void 0 && !boundedText(widget.caption)) return void 0;
414
+ return { type: "widget", widget: { kind: "table", columns: [...columns], rows: rows.map((row) => [...row]), ...typeof widget.caption === "string" ? { caption: widget.caption } : {} } };
415
+ }
416
+ return void 0;
417
+ }
418
+ function boundedText(value) {
419
+ return typeof value === "string" && value.length <= MAX_WIDGET_TEXT;
420
+ }
421
+ function isRecord(value) {
422
+ return typeof value === "object" && value !== null && !Array.isArray(value);
423
+ }
424
+ function isExactRecord(value, keys) {
425
+ return isRecord(value) && Object.keys(value).length === keys.length && keys.every((key) => key in value);
426
+ }
427
+ function hasOnlyKeys(value, required, optional) {
428
+ const keys = Object.keys(value);
429
+ return required.every((key) => key in value) && keys.every((key) => required.includes(key) || optional.includes(key));
430
+ }
392
431
  // Annotate the CommonJS export names for ESM import in node:
393
432
  0 && (module.exports = {
394
433
  AgentType,
@@ -409,6 +448,7 @@ function replaceTaskBeliefState(markdown, state) {
409
448
  isProcessingAgentConfig,
410
449
  isTeamAgentConfig,
411
450
  isWorkflowAgentConfig,
451
+ parseAgentWebAppGenUIBlock,
412
452
  parseTaskBeliefState,
413
453
  replaceTaskBeliefState,
414
454
  taskBeliefStatesEqual