@axiom-lattice/protocols 3.0.2 → 3.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
1
 
2
- > @axiom-lattice/protocols@3.0.2 build /home/runner/work/agentic/agentic/packages/protocols
2
+ > @axiom-lattice/protocols@3.0.3 build /home/runner/work/agentic/agentic/packages/protocols
3
3
  > tsup src/index.ts --format cjs,esm --dts --sourcemap
4
4
 
5
5
  CLI Building entry: src/index.ts
@@ -10,11 +10,11 @@
10
10
  ESM Build start
11
11
  CJS dist/index.js 6.69 KB
12
12
  CJS dist/index.js.map 47.36 KB
13
- CJS ⚡️ Build success in 258ms
13
+ CJS ⚡️ Build success in 301ms
14
14
  ESM dist/index.mjs 4.78 KB
15
15
  ESM dist/index.mjs.map 44.88 KB
16
- ESM ⚡️ Build success in 265ms
16
+ ESM ⚡️ Build success in 309ms
17
17
  DTS Build start
18
- DTS ⚡️ Build success in 13153ms
19
- DTS dist/index.d.ts 140.26 KB
20
- DTS dist/index.d.mts 140.26 KB
18
+ DTS ⚡️ Build success in 14233ms
19
+ DTS dist/index.d.ts 142.56 KB
20
+ DTS dist/index.d.mts 142.56 KB
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @axiom-lattice/protocols
2
2
 
3
+ ## 3.0.3
4
+
5
+ ### Patch Changes
6
+
7
+ - ecc456c: add agent workstation
8
+
3
9
  ## 3.0.2
4
10
 
5
11
  ### Patch Changes
package/dist/index.d.mts CHANGED
@@ -3458,6 +3458,22 @@ interface EvalSuite {
3458
3458
  updatedAt: Date;
3459
3459
  caseCount?: number;
3460
3460
  }
3461
+ /**
3462
+ * How an eval case handles a HITL interrupt (agent pausing for human input).
3463
+ *
3464
+ * - `stop` (default): leave the case interrupted at the pause — the judge
3465
+ * evaluates the pause itself as business behavior.
3466
+ * - `auto-approve`: resume the agent with an approval so the flow AFTER the
3467
+ * pause can be tested (e.g. payment execution).
3468
+ * - `auto-reject`: resume with a rejection so the rejection path is tested.
3469
+ * - `canned-response`: resume with the exact `value` (simulates a specific
3470
+ * human reply). `value` is also the override for auto-approve/auto-reject
3471
+ * (defaults: "同意" / "拒绝").
3472
+ */
3473
+ interface InterruptPolicy {
3474
+ mode: "stop" | "auto-approve" | "auto-reject" | "canned-response";
3475
+ value?: string;
3476
+ }
3461
3477
  interface CreateEvalSuiteRequest {
3462
3478
  name: string;
3463
3479
  }
@@ -3469,6 +3485,8 @@ interface CreateEvalRunRequest {
3469
3485
  /** Workspace-project environment the run executed in (caller's runConfig) */
3470
3486
  envProjectId?: string;
3471
3487
  envWorkspaceId?: string;
3488
+ /** Task this run belongs to (training round association) */
3489
+ taskId?: string;
3472
3490
  }
3473
3491
  interface EvalCase {
3474
3492
  id: string;
@@ -3487,6 +3505,7 @@ interface EvalCase {
3487
3505
  weight: number;
3488
3506
  description: string;
3489
3507
  }>;
3508
+ interruptPolicy?: InterruptPolicy;
3490
3509
  createdAt: Date;
3491
3510
  updatedAt: Date;
3492
3511
  }
@@ -3504,6 +3523,7 @@ interface CreateEvalCaseRequest {
3504
3523
  weight: number;
3505
3524
  description: string;
3506
3525
  }>;
3526
+ interruptPolicy?: InterruptPolicy;
3507
3527
  }
3508
3528
  interface EvalRun {
3509
3529
  id: string;
@@ -3514,6 +3534,8 @@ interface EvalRun {
3514
3534
  totalCases: number;
3515
3535
  passedCases: number;
3516
3536
  failedCases: number;
3537
+ /** Cases that hit a HITL interrupt (agent requested human input) — not judged. */
3538
+ interruptedCases?: number;
3517
3539
  avgScore: number;
3518
3540
  error?: string;
3519
3541
  /**
@@ -3530,6 +3552,8 @@ interface EvalRun {
3530
3552
  */
3531
3553
  envProjectId?: string;
3532
3554
  envWorkspaceId?: string;
3555
+ /** Training task this run belongs to (round association, 1 task : N runs) */
3556
+ taskId?: string;
3533
3557
  createdAt: Date;
3534
3558
  startedAt?: Date;
3535
3559
  completedAt?: Date;
@@ -3560,6 +3584,12 @@ interface EvalRunResult {
3560
3584
  data?: unknown;
3561
3585
  }>;
3562
3586
  error?: string;
3587
+ /**
3588
+ * True when the case hit a HITL interrupt: the agent requested human input
3589
+ * before producing an answer, so the case was NOT judged (neither pass nor
3590
+ * fail). `pass` is false and `score` is 0 for such rows.
3591
+ */
3592
+ interrupted?: boolean;
3563
3593
  createdAt: Date;
3564
3594
  }
3565
3595
  interface EvalProjectReport {
@@ -3596,6 +3626,7 @@ interface EvalStore {
3596
3626
  status?: EvalRun['status'];
3597
3627
  passedCases?: number;
3598
3628
  failedCases?: number;
3629
+ interruptedCases?: number;
3599
3630
  avgScore?: number;
3600
3631
  error?: string;
3601
3632
  completedAt?: Date;
@@ -3702,6 +3733,8 @@ interface TaskItem {
3702
3733
  * Reason for task failure (when status is 'failed')
3703
3734
  */
3704
3735
  failureReason?: string;
3736
+ /** File references attached to this task */
3737
+ files?: TaskFileRef[];
3705
3738
  }
3706
3739
  /**
3707
3740
  * Create task request type
@@ -3775,6 +3808,26 @@ interface CreateTaskRequest {
3775
3808
  * Reason for task failure (when status is 'failed')
3776
3809
  */
3777
3810
  failureReason?: string;
3811
+ /** File references attached to this task */
3812
+ files?: TaskFileRef[];
3813
+ }
3814
+ /**
3815
+ * A file reference attached to a task — a URI association, not file management.
3816
+ * The file body is managed by the workspace/sandbox systems; tasks only record
3817
+ * the reference so they can display and hand files to agents.
3818
+ */
3819
+ interface TaskFileRef {
3820
+ /**
3821
+ * Uniquely locates the resource:
3822
+ * - http(s)://... → external URL
3823
+ * - /s/:token → shared resource
3824
+ * - anything else → sandbox path (e.g. /project/uploads/foo.pdf)
3825
+ */
3826
+ uri: string;
3827
+ /** Display name (useful when uri is a uuid or bare path) */
3828
+ name?: string;
3829
+ /** Who attached the file: the user (reference material) or an agent (artifact) */
3830
+ addedBy?: "user" | "agent";
3778
3831
  }
3779
3832
  /**
3780
3833
  * Update task request type
@@ -3848,6 +3901,8 @@ interface UpdateTaskRequest {
3848
3901
  * Reason for task failure (when status is 'failed')
3849
3902
  */
3850
3903
  failureReason?: string;
3904
+ /** File references attached to this task */
3905
+ files?: TaskFileRef[];
3851
3906
  }
3852
3907
  /**
3853
3908
  * Task list filter criteria
@@ -4799,4 +4854,4 @@ type Timestamp = number;
4799
4854
  */
4800
4855
  type Callback<T = any, R = void> = (data: T) => R | Promise<R>;
4801
4856
 
4802
- export { type A2AApiKeyEntry, type A2AApiKeyRecord, type A2AApiKeyStore, type A2AArtifact, type A2AAuthContext, type A2ACapabilities, type A2AConfig, type A2ADataPart, type A2AFilePart, type A2AMessage, type A2APart, type A2AProvider, type A2APushNotification, type A2ARemoteAgentConfig, type A2ASSEEvent, type A2ASkill, type A2ATask, type A2ATaskArtifactUpdatePayload, type A2ATaskSendRequest, type A2ATaskState, type A2ATaskStatus, type A2ATaskUpdatePayload, type A2ATextPart, A2A_DEFAULT_CAPABILITIES, A2A_DEFAULT_INPUT_MODES, A2A_DEFAULT_OUTPUT_MODES, type AgentCard, 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 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 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 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 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 };
4857
+ export { type A2AApiKeyEntry, type A2AApiKeyRecord, type A2AApiKeyStore, type A2AArtifact, type A2AAuthContext, type A2ACapabilities, type A2AConfig, type A2ADataPart, type A2AFilePart, type A2AMessage, type A2APart, type A2AProvider, type A2APushNotification, type A2ARemoteAgentConfig, type A2ASSEEvent, type A2ASkill, type A2ATask, type A2ATaskArtifactUpdatePayload, type A2ATaskSendRequest, type A2ATaskState, type A2ATaskStatus, type A2ATaskUpdatePayload, type A2ATextPart, A2A_DEFAULT_CAPABILITIES, A2A_DEFAULT_INPUT_MODES, A2A_DEFAULT_OUTPUT_MODES, type AgentCard, 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 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 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 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 };
package/dist/index.d.ts CHANGED
@@ -3458,6 +3458,22 @@ interface EvalSuite {
3458
3458
  updatedAt: Date;
3459
3459
  caseCount?: number;
3460
3460
  }
3461
+ /**
3462
+ * How an eval case handles a HITL interrupt (agent pausing for human input).
3463
+ *
3464
+ * - `stop` (default): leave the case interrupted at the pause — the judge
3465
+ * evaluates the pause itself as business behavior.
3466
+ * - `auto-approve`: resume the agent with an approval so the flow AFTER the
3467
+ * pause can be tested (e.g. payment execution).
3468
+ * - `auto-reject`: resume with a rejection so the rejection path is tested.
3469
+ * - `canned-response`: resume with the exact `value` (simulates a specific
3470
+ * human reply). `value` is also the override for auto-approve/auto-reject
3471
+ * (defaults: "同意" / "拒绝").
3472
+ */
3473
+ interface InterruptPolicy {
3474
+ mode: "stop" | "auto-approve" | "auto-reject" | "canned-response";
3475
+ value?: string;
3476
+ }
3461
3477
  interface CreateEvalSuiteRequest {
3462
3478
  name: string;
3463
3479
  }
@@ -3469,6 +3485,8 @@ interface CreateEvalRunRequest {
3469
3485
  /** Workspace-project environment the run executed in (caller's runConfig) */
3470
3486
  envProjectId?: string;
3471
3487
  envWorkspaceId?: string;
3488
+ /** Task this run belongs to (training round association) */
3489
+ taskId?: string;
3472
3490
  }
3473
3491
  interface EvalCase {
3474
3492
  id: string;
@@ -3487,6 +3505,7 @@ interface EvalCase {
3487
3505
  weight: number;
3488
3506
  description: string;
3489
3507
  }>;
3508
+ interruptPolicy?: InterruptPolicy;
3490
3509
  createdAt: Date;
3491
3510
  updatedAt: Date;
3492
3511
  }
@@ -3504,6 +3523,7 @@ interface CreateEvalCaseRequest {
3504
3523
  weight: number;
3505
3524
  description: string;
3506
3525
  }>;
3526
+ interruptPolicy?: InterruptPolicy;
3507
3527
  }
3508
3528
  interface EvalRun {
3509
3529
  id: string;
@@ -3514,6 +3534,8 @@ interface EvalRun {
3514
3534
  totalCases: number;
3515
3535
  passedCases: number;
3516
3536
  failedCases: number;
3537
+ /** Cases that hit a HITL interrupt (agent requested human input) — not judged. */
3538
+ interruptedCases?: number;
3517
3539
  avgScore: number;
3518
3540
  error?: string;
3519
3541
  /**
@@ -3530,6 +3552,8 @@ interface EvalRun {
3530
3552
  */
3531
3553
  envProjectId?: string;
3532
3554
  envWorkspaceId?: string;
3555
+ /** Training task this run belongs to (round association, 1 task : N runs) */
3556
+ taskId?: string;
3533
3557
  createdAt: Date;
3534
3558
  startedAt?: Date;
3535
3559
  completedAt?: Date;
@@ -3560,6 +3584,12 @@ interface EvalRunResult {
3560
3584
  data?: unknown;
3561
3585
  }>;
3562
3586
  error?: string;
3587
+ /**
3588
+ * True when the case hit a HITL interrupt: the agent requested human input
3589
+ * before producing an answer, so the case was NOT judged (neither pass nor
3590
+ * fail). `pass` is false and `score` is 0 for such rows.
3591
+ */
3592
+ interrupted?: boolean;
3563
3593
  createdAt: Date;
3564
3594
  }
3565
3595
  interface EvalProjectReport {
@@ -3596,6 +3626,7 @@ interface EvalStore {
3596
3626
  status?: EvalRun['status'];
3597
3627
  passedCases?: number;
3598
3628
  failedCases?: number;
3629
+ interruptedCases?: number;
3599
3630
  avgScore?: number;
3600
3631
  error?: string;
3601
3632
  completedAt?: Date;
@@ -3702,6 +3733,8 @@ interface TaskItem {
3702
3733
  * Reason for task failure (when status is 'failed')
3703
3734
  */
3704
3735
  failureReason?: string;
3736
+ /** File references attached to this task */
3737
+ files?: TaskFileRef[];
3705
3738
  }
3706
3739
  /**
3707
3740
  * Create task request type
@@ -3775,6 +3808,26 @@ interface CreateTaskRequest {
3775
3808
  * Reason for task failure (when status is 'failed')
3776
3809
  */
3777
3810
  failureReason?: string;
3811
+ /** File references attached to this task */
3812
+ files?: TaskFileRef[];
3813
+ }
3814
+ /**
3815
+ * A file reference attached to a task — a URI association, not file management.
3816
+ * The file body is managed by the workspace/sandbox systems; tasks only record
3817
+ * the reference so they can display and hand files to agents.
3818
+ */
3819
+ interface TaskFileRef {
3820
+ /**
3821
+ * Uniquely locates the resource:
3822
+ * - http(s)://... → external URL
3823
+ * - /s/:token → shared resource
3824
+ * - anything else → sandbox path (e.g. /project/uploads/foo.pdf)
3825
+ */
3826
+ uri: string;
3827
+ /** Display name (useful when uri is a uuid or bare path) */
3828
+ name?: string;
3829
+ /** Who attached the file: the user (reference material) or an agent (artifact) */
3830
+ addedBy?: "user" | "agent";
3778
3831
  }
3779
3832
  /**
3780
3833
  * Update task request type
@@ -3848,6 +3901,8 @@ interface UpdateTaskRequest {
3848
3901
  * Reason for task failure (when status is 'failed')
3849
3902
  */
3850
3903
  failureReason?: string;
3904
+ /** File references attached to this task */
3905
+ files?: TaskFileRef[];
3851
3906
  }
3852
3907
  /**
3853
3908
  * Task list filter criteria
@@ -4799,4 +4854,4 @@ type Timestamp = number;
4799
4854
  */
4800
4855
  type Callback<T = any, R = void> = (data: T) => R | Promise<R>;
4801
4856
 
4802
- export { type A2AApiKeyEntry, type A2AApiKeyRecord, type A2AApiKeyStore, type A2AArtifact, type A2AAuthContext, type A2ACapabilities, type A2AConfig, type A2ADataPart, type A2AFilePart, type A2AMessage, type A2APart, type A2AProvider, type A2APushNotification, type A2ARemoteAgentConfig, type A2ASSEEvent, type A2ASkill, type A2ATask, type A2ATaskArtifactUpdatePayload, type A2ATaskSendRequest, type A2ATaskState, type A2ATaskStatus, type A2ATaskUpdatePayload, type A2ATextPart, A2A_DEFAULT_CAPABILITIES, A2A_DEFAULT_INPUT_MODES, A2A_DEFAULT_OUTPUT_MODES, type AgentCard, 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 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 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 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 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 };
4857
+ export { type A2AApiKeyEntry, type A2AApiKeyRecord, type A2AApiKeyStore, type A2AArtifact, type A2AAuthContext, type A2ACapabilities, type A2AConfig, type A2ADataPart, type A2AFilePart, type A2AMessage, type A2APart, type A2AProvider, type A2APushNotification, type A2ARemoteAgentConfig, type A2ASSEEvent, type A2ASkill, type A2ATask, type A2ATaskArtifactUpdatePayload, type A2ATaskSendRequest, type A2ATaskState, type A2ATaskStatus, type A2ATaskUpdatePayload, type A2ATextPart, A2A_DEFAULT_CAPABILITIES, A2A_DEFAULT_INPUT_MODES, A2A_DEFAULT_OUTPUT_MODES, type AgentCard, 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 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 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 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 };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@axiom-lattice/protocols",
3
- "version": "3.0.2",
3
+ "version": "3.0.3",
4
4
  "description": "Unified protocol type definitions for Axiom Lattice framework",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -28,7 +28,9 @@
28
28
  "devDependencies": {
29
29
  "@types/jest": "^29.5.12",
30
30
  "@types/node": "^20.11.24",
31
- "eslint": "^8",
31
+ "@typescript-eslint/eslint-plugin": "^7.2.0",
32
+ "@typescript-eslint/parser": "^7.2.0",
33
+ "eslint": "^8.57.0",
32
34
  "rimraf": "^5.0.5",
33
35
  "tsup": "^8.0.1",
34
36
  "typescript": "^5.4.2"
@@ -32,6 +32,23 @@ export interface EvalSuite {
32
32
  caseCount?: number;
33
33
  }
34
34
 
35
+ /**
36
+ * How an eval case handles a HITL interrupt (agent pausing for human input).
37
+ *
38
+ * - `stop` (default): leave the case interrupted at the pause — the judge
39
+ * evaluates the pause itself as business behavior.
40
+ * - `auto-approve`: resume the agent with an approval so the flow AFTER the
41
+ * pause can be tested (e.g. payment execution).
42
+ * - `auto-reject`: resume with a rejection so the rejection path is tested.
43
+ * - `canned-response`: resume with the exact `value` (simulates a specific
44
+ * human reply). `value` is also the override for auto-approve/auto-reject
45
+ * (defaults: "同意" / "拒绝").
46
+ */
47
+ export interface InterruptPolicy {
48
+ mode: "stop" | "auto-approve" | "auto-reject" | "canned-response";
49
+ value?: string;
50
+ }
51
+
35
52
  export interface CreateEvalSuiteRequest {
36
53
  name: string;
37
54
  }
@@ -44,6 +61,8 @@ export interface CreateEvalRunRequest {
44
61
  /** Workspace-project environment the run executed in (caller's runConfig) */
45
62
  envProjectId?: string;
46
63
  envWorkspaceId?: string;
64
+ /** Task this run belongs to (training round association) */
65
+ taskId?: string;
47
66
  }
48
67
 
49
68
  export interface EvalCase {
@@ -56,6 +75,7 @@ export interface EvalCase {
56
75
  outputType: 'file_content' | 'message_content';
57
76
  contentAssertion: string;
58
77
  rubrics?: Array<{ name: string; weight: number; description: string }>;
78
+ interruptPolicy?: InterruptPolicy;
59
79
  createdAt: Date;
60
80
  updatedAt: Date;
61
81
  }
@@ -67,6 +87,7 @@ export interface CreateEvalCaseRequest {
67
87
  outputType: 'file_content' | 'message_content';
68
88
  contentAssertion: string;
69
89
  rubrics?: Array<{ name: string; weight: number; description: string }>;
90
+ interruptPolicy?: InterruptPolicy;
70
91
  }
71
92
 
72
93
  export interface EvalRun {
@@ -78,6 +99,8 @@ export interface EvalRun {
78
99
  totalCases: number;
79
100
  passedCases: number;
80
101
  failedCases: number;
102
+ /** Cases that hit a HITL interrupt (agent requested human input) — not judged. */
103
+ interruptedCases?: number;
81
104
  avgScore: number;
82
105
  error?: string;
83
106
  /**
@@ -94,6 +117,8 @@ export interface EvalRun {
94
117
  */
95
118
  envProjectId?: string;
96
119
  envWorkspaceId?: string;
120
+ /** Training task this run belongs to (round association, 1 task : N runs) */
121
+ taskId?: string;
97
122
  createdAt: Date;
98
123
  startedAt?: Date;
99
124
  completedAt?: Date;
@@ -112,6 +137,12 @@ export interface EvalRunResult {
112
137
  messages?: Array<{ role: string; content: string; id?: string }>;
113
138
  logs?: Array<{ timestamp: string; level: string; message: string; data?: unknown }>;
114
139
  error?: string;
140
+ /**
141
+ * True when the case hit a HITL interrupt: the agent requested human input
142
+ * before producing an answer, so the case was NOT judged (neither pass nor
143
+ * fail). `pass` is false and `score` is 0 for such rows.
144
+ */
145
+ interrupted?: boolean;
115
146
  createdAt: Date;
116
147
  }
117
148
 
@@ -146,7 +177,7 @@ export interface EvalStore {
146
177
  getRunsByTenant(tenantId: string, opts?: { projectId?: string; status?: string }): Promise<EvalRun[]>;
147
178
  getRunById(tenantId: string, id: string): Promise<EvalRun | null>;
148
179
  createRun(tenantId: string, projectId: string, id: string, data: CreateEvalRunRequest): Promise<EvalRun>;
149
- updateRunStatus(tenantId: string, id: string, updates: { status?: EvalRun['status']; passedCases?: number; failedCases?: number; avgScore?: number; error?: string; completedAt?: Date }): Promise<EvalRun | null>;
180
+ updateRunStatus(tenantId: string, id: string, updates: { status?: EvalRun['status']; passedCases?: number; failedCases?: number; interruptedCases?: number; avgScore?: number; error?: string; completedAt?: Date }): Promise<EvalRun | null>;
150
181
  deleteRun(tenantId: string, id: string): Promise<boolean>;
151
182
 
152
183
  getResultsByRun(tenantId: string, runId: string): Promise<EvalRunResult[]>;
@@ -113,6 +113,9 @@ export interface TaskItem {
113
113
  * Reason for task failure (when status is 'failed')
114
114
  */
115
115
  failureReason?: string;
116
+
117
+ /** File references attached to this task */
118
+ files?: TaskFileRef[];
116
119
  }
117
120
 
118
121
  /**
@@ -203,6 +206,28 @@ export interface CreateTaskRequest {
203
206
  * Reason for task failure (when status is 'failed')
204
207
  */
205
208
  failureReason?: string;
209
+
210
+ /** File references attached to this task */
211
+ files?: TaskFileRef[];
212
+ }
213
+
214
+ /**
215
+ * A file reference attached to a task — a URI association, not file management.
216
+ * The file body is managed by the workspace/sandbox systems; tasks only record
217
+ * the reference so they can display and hand files to agents.
218
+ */
219
+ export interface TaskFileRef {
220
+ /**
221
+ * Uniquely locates the resource:
222
+ * - http(s)://... → external URL
223
+ * - /s/:token → shared resource
224
+ * - anything else → sandbox path (e.g. /project/uploads/foo.pdf)
225
+ */
226
+ uri: string;
227
+ /** Display name (useful when uri is a uuid or bare path) */
228
+ name?: string;
229
+ /** Who attached the file: the user (reference material) or an agent (artifact) */
230
+ addedBy?: "user" | "agent";
206
231
  }
207
232
 
208
233
  /**
@@ -293,6 +318,9 @@ export interface UpdateTaskRequest {
293
318
  * Reason for task failure (when status is 'failed')
294
319
  */
295
320
  failureReason?: string;
321
+
322
+ /** File references attached to this task */
323
+ files?: TaskFileRef[];
296
324
  }
297
325
 
298
326
  /**