@axiom-lattice/protocols 4.1.0 → 4.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -1478,6 +1478,34 @@ interface Skill {
1478
1478
  * Creates a hierarchical tree structure for organizing skills
1479
1479
  */
1480
1480
  subSkills?: string[];
1481
+ /**
1482
+ * Source of the skill (optional)
1483
+ * e.g. "builtin-plugin" for read-only plugin-provided skills
1484
+ */
1485
+ source?: string;
1486
+ /**
1487
+ * Owning plugin type (optional)
1488
+ * Set for skills contributed by a registered plugin
1489
+ */
1490
+ pluginType?: string;
1491
+ /**
1492
+ * Plugin skill bundle version (optional)
1493
+ * Set for skills contributed by a registered plugin
1494
+ */
1495
+ version?: string;
1496
+ /**
1497
+ * Resource catalog (optional)
1498
+ * Safe relative paths of a plugin skill's bundled resources with their MIME types
1499
+ */
1500
+ resourcePaths?: Array<{
1501
+ path: string;
1502
+ mimeType?: string;
1503
+ }>;
1504
+ /**
1505
+ * Read-only flag (optional)
1506
+ * True for immutable sources (e.g. plugin-provided skills) that cannot be created/updated/deleted
1507
+ */
1508
+ readOnly?: boolean;
1481
1509
  /**
1482
1510
  * Skill creation timestamp
1483
1511
  */
@@ -2028,12 +2056,34 @@ interface UpdateProjectRequest {
2028
2056
  /** Project classification */
2029
2057
  kind?: ProjectKind;
2030
2058
  }
2059
+ /** Error raised when generic project writes attempt to change capability Bundle references. */
2060
+ declare class InvalidProjectCapabilityBundleConfigError extends Error {
2061
+ /** Stable machine-readable error code. */
2062
+ readonly code: "INVALID_BUNDLE_CONFIG";
2063
+ /** Creates the reserved-config error returned by generic Project writes. */
2064
+ constructor();
2065
+ }
2066
+ /** Rejects capability Bundle references supplied through generic Project config writes. */
2067
+ declare function assertGenericProjectConfig(config: Record<string, unknown> | undefined): void;
2031
2068
  /**
2032
2069
  * Filter options for listing projects within a workspace
2033
2070
  */
2034
2071
  interface ProjectFilter {
2035
2072
  kind?: ProjectKind;
2036
2073
  }
2074
+ /** Atomic result of replacing a Project's capability Bundle IDs. */
2075
+ type UpdateProjectCapabilityBundlesResult = {
2076
+ status: "updated";
2077
+ project: Project;
2078
+ } | {
2079
+ status: "project_not_found";
2080
+ } | {
2081
+ status: "bundle_not_found";
2082
+ } | {
2083
+ status: "bundle_conflict";
2084
+ };
2085
+ /** Revision preconditions for the bundles reviewed before project assignment. */
2086
+ type ExpectedCapabilityBundleRevisions = Record<string, string>;
2037
2087
  /**
2038
2088
  * ProjectStore interface
2039
2089
  * Provides CRUD operations for project data
@@ -2043,7 +2093,11 @@ interface ProjectStore {
2043
2093
  getProjectById(tenantId: string, id: string): Promise<Project | null>;
2044
2094
  createProject(tenantId: string, workspaceId: string, id: string, data: CreateProjectRequest): Promise<Project>;
2045
2095
  updateProject(tenantId: string, id: string, updates: UpdateProjectRequest): Promise<Project | null>;
2096
+ /** Omitted expectedRevisions is reserved for internal maintenance callers. */
2097
+ updateCapabilityBundleIds(tenantId: string, projectId: string, bundleIds: string[], expectedRevisions?: ExpectedCapabilityBundleRevisions): Promise<UpdateProjectCapabilityBundlesResult>;
2046
2098
  deleteProject(tenantId: string, id: string): Promise<boolean>;
2099
+ /** Returns whether a tenant project references the given capability bundle. */
2100
+ isCapabilityBundleReferenced(tenantId: string, bundleId: string): Promise<boolean>;
2047
2101
  }
2048
2102
 
2049
2103
  /**
@@ -4155,9 +4209,51 @@ interface TaskWorkItemListFilter {
4155
4209
  limit?: number;
4156
4210
  offset?: number;
4157
4211
  }
4212
+ /** Canonical prefix for public task execution-result event identities. */
4213
+ declare const EXECUTION_RESULT_EVENT_KEY_PREFIX = "execution-result:";
4214
+ /**
4215
+ * Portable regular-expression source for canonical execution-result event keys.
4216
+ *
4217
+ * The entire key is the literal `execution-result:` prefix followed by a nonempty
4218
+ * suffix containing only ASCII letters, digits, period, underscore, colon, or hyphen.
4219
+ * Colon is intentionally allowed so callers can compose structured suffixes.
4220
+ */
4221
+ declare const EXECUTION_RESULT_EVENT_KEY_PATTERN_SOURCE = "^execution-result:[A-Za-z0-9._:-]+$";
4222
+ /** Compiled runtime expression for canonical execution-result event keys. */
4223
+ declare const EXECUTION_RESULT_EVENT_KEY_PATTERN: RegExp;
4224
+ /** Maximum pending execution-result rows accepted by one store query. */
4225
+ declare const MAX_PENDING_EXECUTION_RESULTS_LIMIT = 1000;
4226
+ /**
4227
+ * Determines whether a runtime value is a canonical execution-result event key.
4228
+ *
4229
+ * @param value Runtime value to validate.
4230
+ * @returns True only for the portable canonical ASCII grammar.
4231
+ */
4232
+ declare function isExecutionResultEventKey(value: unknown): value is string;
4158
4233
  interface TaskWorkItemStore {
4159
4234
  create(params: CreateWorkItemRequest): Promise<TaskWorkItem>;
4160
4235
  list(filter: TaskWorkItemListFilter): Promise<TaskWorkItem[]>;
4236
+ /**
4237
+ * List the newest bounded set of execution results awaiting reconciliation.
4238
+ *
4239
+ * Only `execution_result` items with a canonical ASCII
4240
+ * `execution-result:[A-Za-z0-9._:-]+` event key are returned. An item is excluded when
4241
+ * a task-scoped `execution_reconciled` item has a
4242
+ * `detail.executionResultId` equal to that event key. Results are ordered by
4243
+ * `createdAt` descending and then `id` descending for deterministic ties.
4244
+ *
4245
+ * @param params Tenant/task scope and required maximum number of rows.
4246
+ * @returns At most `limit` pending execution-result work items, newest first.
4247
+ * @throws RangeError with code `INVALID_LIMIT` unless limit is a safe integer from zero through
4248
+ * {@link MAX_PENDING_EXECUTION_RESULTS_LIMIT}.
4249
+ * @remarks Optional optimization. Stores that omit it remain compatible; callers may use a
4250
+ * bounded, non-authoritative fallback through the pre-existing list and event-key methods.
4251
+ */
4252
+ listPendingExecutionResults?(params: {
4253
+ tenantId: string;
4254
+ taskId: string;
4255
+ limit: number;
4256
+ }): Promise<TaskWorkItem[]>;
4161
4257
  /**
4162
4258
  * Find an event by deterministic identity without list pagination.
4163
4259
  *
@@ -4177,7 +4273,12 @@ interface TaskWorkItemStore {
4177
4273
  createIfAbsentByEventKey(params: CreateWorkItemIfAbsentRequest): Promise<TaskWorkItem>;
4178
4274
  }
4179
4275
 
4180
- /** A single canonical belief recorded in a task description. */
4276
+ /**
4277
+ * A single canonical belief recorded in a task description.
4278
+ *
4279
+ * `probability` is retained as the persisted field name, but task guidance uses
4280
+ * it as an evidence-support percentage rather than a calibrated probability.
4281
+ */
4181
4282
  interface TaskBeliefEntry {
4182
4283
  key: string;
4183
4284
  probability: number;
@@ -4653,6 +4754,152 @@ type AgentWebAppStreamEvent = {
4653
4754
  /** Validate and copy one strict public GenUI block at a trust boundary. */
4654
4755
  declare function parseAgentWebAppGenUIBlock(value: unknown): AgentWebAppGenUIBlock | undefined;
4655
4756
 
4757
+ /**
4758
+ * Capability bundle persistence protocol.
4759
+ *
4760
+ * A capability bundle is a tenant-scoped, flat collection of middleware
4761
+ * configurations that can be selected by a project.
4762
+ */
4763
+
4764
+ /** A tenant-scoped collection of middleware configurations. */
4765
+ interface CapabilityBundle {
4766
+ /** Stable bundle identifier. */
4767
+ readonly id: string;
4768
+ /** Tenant that owns the bundle. */
4769
+ tenantId: string;
4770
+ /** Tenant-local unique key. */
4771
+ key: string;
4772
+ /** Human-readable bundle name. */
4773
+ name: string;
4774
+ /** Optional bundle description. */
4775
+ description?: string;
4776
+ /** Middleware configurations contained in the bundle. */
4777
+ capabilities: AgentMiddlewareConfig[];
4778
+ /** Creation timestamp in ISO string format. */
4779
+ createdAt: string;
4780
+ /** Last update timestamp in ISO string format. */
4781
+ updatedAt: string;
4782
+ }
4783
+ /** Public input used to create a capability bundle; the tenant-local key is generated internally. */
4784
+ interface CreateCapabilityBundleInput {
4785
+ /** Human-readable bundle name. */
4786
+ name: string;
4787
+ /** Optional bundle description. */
4788
+ description?: string;
4789
+ /** Middleware configurations contained in the bundle. */
4790
+ capabilities: AgentMiddlewareConfig[];
4791
+ }
4792
+ /** Input with a generated key used by persistence implementations. */
4793
+ interface InternalCreateCapabilityBundleInput extends Omit<CreateCapabilityBundleInput, "key"> {
4794
+ key: string;
4795
+ }
4796
+ /** Public partial bundle update; the stable key is immutable and the revision is mandatory for gateway updates. */
4797
+ interface UpdateCapabilityBundleInput extends Partial<CreateCapabilityBundleInput> {
4798
+ expectedUpdatedAt: string;
4799
+ }
4800
+ /** Store input retained for internal maintenance callers that may omit CAS. */
4801
+ interface InternalUpdateCapabilityBundleInput extends Partial<CreateCapabilityBundleInput> {
4802
+ expectedUpdatedAt?: string;
4803
+ }
4804
+ /** Result returned when an update's expected revision no longer matches. */
4805
+ interface CapabilityBundleUpdateConflict {
4806
+ status: "conflict";
4807
+ }
4808
+ /** Result of deleting a bundle only when no tenant project references it. */
4809
+ type CapabilityBundleDeleteResult = "deleted" | "not_found" | "in_use";
4810
+ /** Persistence operations for tenant-scoped capability bundles. */
4811
+ interface CapabilityBundleStore {
4812
+ /** Lists all bundles owned by a tenant. */
4813
+ listByTenant(tenantId: string): Promise<CapabilityBundle[]>;
4814
+ /** Gets one bundle by tenant and identifier. */
4815
+ getById(tenantId: string, id: string): Promise<CapabilityBundle | null>;
4816
+ /** Gets bundles by tenant and identifiers. */
4817
+ getManyByIds(tenantId: string, ids: string[]): Promise<CapabilityBundle[]>;
4818
+ /** Creates a bundle for a tenant. */
4819
+ create(tenantId: string, input: InternalCreateCapabilityBundleInput): Promise<CapabilityBundle>;
4820
+ /** Updates a bundle, or returns null when it does not exist. */
4821
+ /** Omitted expectedUpdatedAt is reserved for internal maintenance callers. */
4822
+ update(tenantId: string, id: string, input: InternalUpdateCapabilityBundleInput): Promise<CapabilityBundle | CapabilityBundleUpdateConflict | null>;
4823
+ /** Atomically deletes a bundle unless a tenant project references it. */
4824
+ deleteIfUnreferenced(tenantId: string, id: string): Promise<CapabilityBundleDeleteResult>;
4825
+ }
4826
+
4827
+ /**
4828
+ * Capability runtime and preview protocol definitions.
4829
+ *
4830
+ * These contracts describe the resolved middleware runtime and the
4831
+ * provenance data exposed while composing project bundles.
4832
+ */
4833
+
4834
+ /** Project configuration selecting ordered capability bundles. */
4835
+ interface ProjectCapabilityConfig {
4836
+ /** Bundle identifiers in composition order. */
4837
+ capabilityBundleIds: string[];
4838
+ }
4839
+ /** Resolved middleware available to an agent execution. */
4840
+ interface CapabilityRuntime {
4841
+ /** Revision identifying the resolved capability set. */
4842
+ revision: string;
4843
+ /** Middleware indexed by middleware identifier. */
4844
+ middleware: Record<string, AgentMiddlewareConfig>;
4845
+ }
4846
+ /** Provenance for a resolved capability field. */
4847
+ interface CapabilityFieldSource {
4848
+ /** Middleware type owning the field. */
4849
+ capabilityType: string;
4850
+ /** RFC 6901 escaped JSON Pointer path of the field within the middleware configuration. */
4851
+ fieldPath: string;
4852
+ /** Bundle that supplied the field value. */
4853
+ sourceBundleId: string;
4854
+ /** Supplied field value. */
4855
+ value: unknown;
4856
+ }
4857
+ /** A later bundle value replacing an earlier field value. */
4858
+ interface CapabilityOverride {
4859
+ /** Middleware type owning the field. */
4860
+ capabilityType: string;
4861
+ /** RFC 6901 escaped JSON Pointer path of the overridden field. */
4862
+ fieldPath: string;
4863
+ /** Value supplied by the earlier bundle. */
4864
+ previousValue: unknown;
4865
+ /** Value supplied by the later bundle. */
4866
+ nextValue: unknown;
4867
+ /** Bundle that supplied the later value. */
4868
+ sourceBundleId: string;
4869
+ }
4870
+ /** A warning or error produced while previewing bundle composition. */
4871
+ interface CapabilityPreviewIssue {
4872
+ /** Stable issue code. */
4873
+ code: string;
4874
+ /** Human-readable issue description. */
4875
+ message: string;
4876
+ /** Related bundle, when applicable. */
4877
+ bundleId?: string;
4878
+ /** Related middleware type, when applicable. */
4879
+ capabilityType?: string;
4880
+ /** Related middleware field path, when applicable. */
4881
+ fieldPath?: string;
4882
+ }
4883
+ /** Result of composing capability bundles for a project. */
4884
+ interface CapabilityPreview {
4885
+ /** Bundle identifiers in composition order. */
4886
+ bundleIds: string[];
4887
+ /** Composed middleware configurations. */
4888
+ capabilities: AgentMiddlewareConfig[];
4889
+ /** Field replacements detected during composition. */
4890
+ overrides: CapabilityOverride[];
4891
+ /** Field-level provenance for composed values. */
4892
+ sources: CapabilityFieldSource[];
4893
+ /** Non-blocking composition issues. */
4894
+ warnings: CapabilityPreviewIssue[];
4895
+ /** Blocking composition issues. */
4896
+ errors: CapabilityPreviewIssue[];
4897
+ /** Revision identifying this preview. */
4898
+ revision: string;
4899
+ /** Bundle content revisions captured by this preview. */
4900
+ bundleRevisions?: Record<string, string>;
4901
+ }
4902
+
4656
4903
  /**
4657
4904
  * YAML Workflow DSL — linear model with parallel blocks
4658
4905
  *
@@ -4927,18 +5174,59 @@ interface PluginConnection {
4927
5174
  }
4928
5175
  /**
4929
5176
  * 工具元信息(用于前端 allowedTools 筛选)
5177
+ *
5178
+ * New connection-backed plugin tools that select one connection must accept
5179
+ * the selected key as `args.connectionKey`. Existing legacy tools retain their
5180
+ * established resource argument names.
4930
5181
  */
4931
5182
  interface PluginToolMeta {
4932
5183
  name: string;
4933
5184
  description: string;
4934
5185
  }
5186
+ /**
5187
+ * A text file included in a plugin skill bundle.
5188
+ *
5189
+ * @property content - Text content written to the skill resource file.
5190
+ * @property mimeType - Optional MIME type for consumers that need it.
5191
+ */
5192
+ interface PluginSkillResource {
5193
+ content: string;
5194
+ mimeType?: string;
5195
+ }
5196
+ /**
5197
+ * Versioned definition of a plugin-provided skill.
5198
+ *
5199
+ * @property version - Bundle version used to detect resource updates.
5200
+ * @property content - Complete SKILL.md markdown content.
5201
+ * @property resources - Optional text resources keyed by safe relative paths.
5202
+ */
5203
+ interface PluginSkillDefinition {
5204
+ version: string;
5205
+ content: string;
5206
+ resources?: Record<string, PluginSkillResource>;
5207
+ }
5208
+ /**
5209
+ * Standard configuration for a new connection-backed plugin.
5210
+ *
5211
+ * `PluginMeta.type` is also the Connection Store type. `connections` selects
5212
+ * connection keys of that type; `connectAll` opts into using all available
5213
+ * connections of that type. Do not add a separate connection or resource type
5214
+ * or selector field to this configuration.
5215
+ */
5216
+ type PluginStandardConnectionConfig = {
5217
+ connections: string[];
5218
+ connectAll?: boolean;
5219
+ };
4935
5220
  /**
4936
5221
  * 插件元数据(开发者声明)
4937
5222
  *
4938
5223
  * connectionSchema 不在此类型中——由 serializePluginMeta 自动推导后注入 PluginMetaOutput。
4939
5224
  */
4940
5225
  interface PluginMeta {
4941
- /** 插件唯一标识,如 "erp" */
5226
+ /**
5227
+ * 插件唯一标识,如 "erp"; for connection-backed plugins this is also the
5228
+ * Connection Store type.
5229
+ */
4942
5230
  type: string;
4943
5231
  /** 显示名称 */
4944
5232
  name: string;
@@ -4952,9 +5240,13 @@ interface PluginMeta {
4952
5240
  icon?: string;
4953
5241
  /** 工具清单(可选,middleware 能自动提取时不需要写) */
4954
5242
  tools?: PluginToolMeta[];
4955
- /** 中间件配置 schema(用于 agent 配置面板) */
5243
+ /**
5244
+ * 中间件配置 schema(用于 agent 配置面板)。新的 connection-backed
5245
+ * plugins use `connections: string[]` and optional `connectAll?: boolean`.
5246
+ * Do not introduce connectionType, resourceType, or resourceSelector fields.
5247
+ */
4956
5248
  configSchema?: Record<string, unknown>;
4957
- /** 默认配置 */
5249
+ /** 默认配置;connection-backed plugins use PluginStandardConnectionConfig. */
4958
5250
  defaultConfig?: Record<string, unknown>;
4959
5251
  /** 推荐配置的 companion 插件 */
4960
5252
  recommends?: string[];
@@ -4964,6 +5256,8 @@ interface PluginMeta {
4964
5256
  * 第三方插件可自定义分类名,前端会原样显示;未提供时归入 "Other"。
4965
5257
  */
4966
5258
  category?: string;
5259
+ /** Whether this plugin's middleware may be included in capability bundles. */
5260
+ capabilityBundleEligible?: boolean;
4967
5261
  }
4968
5262
  /**
4969
5263
  * 插件元数据输出(API 返回格式)
@@ -4992,7 +5286,7 @@ interface PluginMetaOutput extends PluginMeta {
4992
5286
  * const myPlugin: Plugin = {
4993
5287
  * meta: { ... },
4994
5288
  * middleware: (config, context) => {
4995
- * const skills = context?.pluginSkillContents ?? {};
5289
+ * const skills = context?.pluginSkills ?? {};
4996
5290
  * return createMyMiddleware({ ...config, pluginSkills: skills });
4997
5291
  * },
4998
5292
  * };
@@ -5000,12 +5294,14 @@ interface PluginMetaOutput extends PluginMeta {
5000
5294
  */
5001
5295
  interface PluginContext {
5002
5296
  /**
5003
- * Cross-plugin aggregated skill contents (SKILL.md, keyed by skill name).
5297
+ * Cross-plugin aggregated skill bundles, keyed by skill name.
5004
5298
  * Collected from all enabled plugins before the main middleware loop.
5005
5299
  * Most plugins should ignore this; only cross-plugin coordination
5006
5300
  * middleware (e.g. skillMiddleware) consumes it.
5007
5301
  */
5008
- pluginSkillContents?: Record<string, string>;
5302
+ pluginSkills?: Record<string, PluginSkillDefinition>;
5303
+ /** Owning plugin type for each enabled plugin skill bundle. */
5304
+ pluginSkillOwners?: Record<string, string>;
5009
5305
  }
5010
5306
  /**
5011
5307
  * Factory function that creates middleware from plugin config.
@@ -5051,7 +5347,7 @@ interface Plugin {
5051
5347
  * 名称必须以 "{pluginType}-" 为前缀,注册时校验。
5052
5348
  * Builder 在构建中间件之前从所有启用的插件中收集。
5053
5349
  */
5054
- skills?: Record<string, string>;
5350
+ skills?: Record<string, PluginSkillDefinition>;
5055
5351
  /**
5056
5352
  * 插件贡献的 Agent 定义(以 agent key 为键)。
5057
5353
  * 在租户首次访问时通过 ensurePluginAgentsForTenant 按租户注册到
@@ -5129,4 +5425,4 @@ type Timestamp = number;
5129
5425
  */
5130
5426
  type Callback<T = any, R = void> = (data: T) => R | Promise<R>;
5131
5427
 
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 };
5428
+ 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 CapabilityBundle, type CapabilityBundleDeleteResult, type CapabilityBundleStore, type CapabilityBundleUpdateConflict, type CapabilityFieldSource, type CapabilityOverride, type CapabilityPreview, type CapabilityPreviewIssue, type CapabilityRuntime, 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 CreateCapabilityBundleInput, 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, 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 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 PluginSkillDefinition, type PluginSkillResource, type PluginStandardConnectionConfig, type PluginToolMeta, type ProcessingAgentConfig, type Project, type ProjectCapabilityConfig, 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 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, getSubAgentsFromConfig, getToolsFromConfig, hasTools, isA2ARemoteAgentConfig, isDeepAgentConfig, isExecutionResultEventKey, isProcessingAgentConfig, isTeamAgentConfig, isWorkflowAgentConfig, parseAgentWebAppGenUIBlock, parseTaskBeliefState, replaceTaskBeliefState, taskBeliefStatesEqual };
package/dist/index.js CHANGED
@@ -21,7 +21,12 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
21
21
  var index_exports = {};
22
22
  __export(index_exports, {
23
23
  AgentType: () => AgentType,
24
+ EXECUTION_RESULT_EVENT_KEY_PATTERN: () => EXECUTION_RESULT_EVENT_KEY_PATTERN,
25
+ EXECUTION_RESULT_EVENT_KEY_PATTERN_SOURCE: () => EXECUTION_RESULT_EVENT_KEY_PATTERN_SOURCE,
26
+ EXECUTION_RESULT_EVENT_KEY_PREFIX: () => EXECUTION_RESULT_EVENT_KEY_PREFIX,
27
+ InvalidProjectCapabilityBundleConfigError: () => InvalidProjectCapabilityBundleConfigError,
24
28
  LoggerType: () => LoggerType,
29
+ MAX_PENDING_EXECUTION_RESULTS_LIMIT: () => MAX_PENDING_EXECUTION_RESULTS_LIMIT,
25
30
  McpMessageType: () => McpMessageType,
26
31
  MemoryType: () => MemoryType,
27
32
  MessageChunkTypes: () => MessageChunkTypes,
@@ -30,11 +35,13 @@ __export(index_exports, {
30
35
  ScheduleType: () => ScheduleType,
31
36
  ScheduledTaskStatus: () => ScheduledTaskStatus,
32
37
  UIComponentType: () => UIComponentType,
38
+ assertGenericProjectConfig: () => assertGenericProjectConfig,
33
39
  getSubAgentsFromConfig: () => getSubAgentsFromConfig,
34
40
  getToolsFromConfig: () => getToolsFromConfig,
35
41
  hasTools: () => hasTools,
36
42
  isA2ARemoteAgentConfig: () => isA2ARemoteAgentConfig,
37
43
  isDeepAgentConfig: () => isDeepAgentConfig,
44
+ isExecutionResultEventKey: () => isExecutionResultEventKey,
38
45
  isProcessingAgentConfig: () => isProcessingAgentConfig,
39
46
  isTeamAgentConfig: () => isTeamAgentConfig,
40
47
  isWorkflowAgentConfig: () => isWorkflowAgentConfig,
@@ -172,6 +179,31 @@ var McpMessageType = /* @__PURE__ */ ((McpMessageType2) => {
172
179
  return McpMessageType2;
173
180
  })(McpMessageType || {});
174
181
 
182
+ // src/WorkspaceStoreProtocol.ts
183
+ var InvalidProjectCapabilityBundleConfigError = class extends Error {
184
+ /** Creates the reserved-config error returned by generic Project writes. */
185
+ constructor() {
186
+ super("Use the project capability-bundles endpoint to update capability bundle IDs");
187
+ /** Stable machine-readable error code. */
188
+ this.code = "INVALID_BUNDLE_CONFIG";
189
+ this.name = "InvalidProjectCapabilityBundleConfigError";
190
+ }
191
+ };
192
+ function assertGenericProjectConfig(config) {
193
+ if (config !== void 0 && Object.prototype.hasOwnProperty.call(config, "capabilityBundleIds")) {
194
+ throw new InvalidProjectCapabilityBundleConfigError();
195
+ }
196
+ }
197
+
198
+ // src/TaskWorkItemProtocol.ts
199
+ var EXECUTION_RESULT_EVENT_KEY_PREFIX = "execution-result:";
200
+ var EXECUTION_RESULT_EVENT_KEY_PATTERN_SOURCE = "^execution-result:[A-Za-z0-9._:-]+$";
201
+ var EXECUTION_RESULT_EVENT_KEY_PATTERN = new RegExp(EXECUTION_RESULT_EVENT_KEY_PATTERN_SOURCE);
202
+ var MAX_PENDING_EXECUTION_RESULTS_LIMIT = 1e3;
203
+ function isExecutionResultEventKey(value) {
204
+ return typeof value === "string" && EXECUTION_RESULT_EVENT_KEY_PATTERN.test(value);
205
+ }
206
+
175
207
  // src/TaskBeliefProtocol.ts
176
208
  var BELIEF_HEADING = "## Belief State";
177
209
  var ACCEPTANCE_HEADING = "## Acceptance Criteria";
@@ -431,7 +463,12 @@ function hasOnlyKeys(value, required, optional) {
431
463
  // Annotate the CommonJS export names for ESM import in node:
432
464
  0 && (module.exports = {
433
465
  AgentType,
466
+ EXECUTION_RESULT_EVENT_KEY_PATTERN,
467
+ EXECUTION_RESULT_EVENT_KEY_PATTERN_SOURCE,
468
+ EXECUTION_RESULT_EVENT_KEY_PREFIX,
469
+ InvalidProjectCapabilityBundleConfigError,
434
470
  LoggerType,
471
+ MAX_PENDING_EXECUTION_RESULTS_LIMIT,
435
472
  McpMessageType,
436
473
  MemoryType,
437
474
  MessageChunkTypes,
@@ -440,11 +477,13 @@ function hasOnlyKeys(value, required, optional) {
440
477
  ScheduleType,
441
478
  ScheduledTaskStatus,
442
479
  UIComponentType,
480
+ assertGenericProjectConfig,
443
481
  getSubAgentsFromConfig,
444
482
  getToolsFromConfig,
445
483
  hasTools,
446
484
  isA2ARemoteAgentConfig,
447
485
  isDeepAgentConfig,
486
+ isExecutionResultEventKey,
448
487
  isProcessingAgentConfig,
449
488
  isTeamAgentConfig,
450
489
  isWorkflowAgentConfig,