@axiom-lattice/protocols 3.0.2 → 3.0.4

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.4 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 315ms
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 316ms
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 13450ms
19
+ DTS dist/index.d.ts 142.64 KB
20
+ DTS dist/index.d.mts 142.64 KB
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @axiom-lattice/protocols
2
2
 
3
+ ## 3.0.4
4
+
5
+ ### Patch Changes
6
+
7
+ - 1c51099: fix default model key
8
+
9
+ ## 3.0.3
10
+
11
+ ### Patch Changes
12
+
13
+ - ecc456c: add agent workstation
14
+
3
15
  ## 3.0.2
4
16
 
5
17
  ### Patch Changes
package/dist/index.d.mts CHANGED
@@ -3444,7 +3444,8 @@ interface CreateEvalProjectRequest {
3444
3444
  name: string;
3445
3445
  description?: string;
3446
3446
  version?: string;
3447
- judgeModelConfig: Record<string, unknown>;
3447
+ /** Judge model config; omit to let the runner resolve its default model. */
3448
+ judgeModelConfig?: Record<string, unknown>;
3448
3449
  targetServerConfig: Record<string, unknown>;
3449
3450
  concurrency?: number;
3450
3451
  reportConfig?: Record<string, unknown>;
@@ -3458,6 +3459,22 @@ interface EvalSuite {
3458
3459
  updatedAt: Date;
3459
3460
  caseCount?: number;
3460
3461
  }
3462
+ /**
3463
+ * How an eval case handles a HITL interrupt (agent pausing for human input).
3464
+ *
3465
+ * - `stop` (default): leave the case interrupted at the pause — the judge
3466
+ * evaluates the pause itself as business behavior.
3467
+ * - `auto-approve`: resume the agent with an approval so the flow AFTER the
3468
+ * pause can be tested (e.g. payment execution).
3469
+ * - `auto-reject`: resume with a rejection so the rejection path is tested.
3470
+ * - `canned-response`: resume with the exact `value` (simulates a specific
3471
+ * human reply). `value` is also the override for auto-approve/auto-reject
3472
+ * (defaults: "同意" / "拒绝").
3473
+ */
3474
+ interface InterruptPolicy {
3475
+ mode: "stop" | "auto-approve" | "auto-reject" | "canned-response";
3476
+ value?: string;
3477
+ }
3461
3478
  interface CreateEvalSuiteRequest {
3462
3479
  name: string;
3463
3480
  }
@@ -3469,6 +3486,8 @@ interface CreateEvalRunRequest {
3469
3486
  /** Workspace-project environment the run executed in (caller's runConfig) */
3470
3487
  envProjectId?: string;
3471
3488
  envWorkspaceId?: string;
3489
+ /** Task this run belongs to (training round association) */
3490
+ taskId?: string;
3472
3491
  }
3473
3492
  interface EvalCase {
3474
3493
  id: string;
@@ -3487,6 +3506,7 @@ interface EvalCase {
3487
3506
  weight: number;
3488
3507
  description: string;
3489
3508
  }>;
3509
+ interruptPolicy?: InterruptPolicy;
3490
3510
  createdAt: Date;
3491
3511
  updatedAt: Date;
3492
3512
  }
@@ -3504,6 +3524,7 @@ interface CreateEvalCaseRequest {
3504
3524
  weight: number;
3505
3525
  description: string;
3506
3526
  }>;
3527
+ interruptPolicy?: InterruptPolicy;
3507
3528
  }
3508
3529
  interface EvalRun {
3509
3530
  id: string;
@@ -3514,6 +3535,8 @@ interface EvalRun {
3514
3535
  totalCases: number;
3515
3536
  passedCases: number;
3516
3537
  failedCases: number;
3538
+ /** Cases that hit a HITL interrupt (agent requested human input) — not judged. */
3539
+ interruptedCases?: number;
3517
3540
  avgScore: number;
3518
3541
  error?: string;
3519
3542
  /**
@@ -3530,6 +3553,8 @@ interface EvalRun {
3530
3553
  */
3531
3554
  envProjectId?: string;
3532
3555
  envWorkspaceId?: string;
3556
+ /** Training task this run belongs to (round association, 1 task : N runs) */
3557
+ taskId?: string;
3533
3558
  createdAt: Date;
3534
3559
  startedAt?: Date;
3535
3560
  completedAt?: Date;
@@ -3560,6 +3585,12 @@ interface EvalRunResult {
3560
3585
  data?: unknown;
3561
3586
  }>;
3562
3587
  error?: string;
3588
+ /**
3589
+ * True when the case hit a HITL interrupt: the agent requested human input
3590
+ * before producing an answer, so the case was NOT judged (neither pass nor
3591
+ * fail). `pass` is false and `score` is 0 for such rows.
3592
+ */
3593
+ interrupted?: boolean;
3563
3594
  createdAt: Date;
3564
3595
  }
3565
3596
  interface EvalProjectReport {
@@ -3596,6 +3627,7 @@ interface EvalStore {
3596
3627
  status?: EvalRun['status'];
3597
3628
  passedCases?: number;
3598
3629
  failedCases?: number;
3630
+ interruptedCases?: number;
3599
3631
  avgScore?: number;
3600
3632
  error?: string;
3601
3633
  completedAt?: Date;
@@ -3702,6 +3734,8 @@ interface TaskItem {
3702
3734
  * Reason for task failure (when status is 'failed')
3703
3735
  */
3704
3736
  failureReason?: string;
3737
+ /** File references attached to this task */
3738
+ files?: TaskFileRef[];
3705
3739
  }
3706
3740
  /**
3707
3741
  * Create task request type
@@ -3775,6 +3809,26 @@ interface CreateTaskRequest {
3775
3809
  * Reason for task failure (when status is 'failed')
3776
3810
  */
3777
3811
  failureReason?: string;
3812
+ /** File references attached to this task */
3813
+ files?: TaskFileRef[];
3814
+ }
3815
+ /**
3816
+ * A file reference attached to a task — a URI association, not file management.
3817
+ * The file body is managed by the workspace/sandbox systems; tasks only record
3818
+ * the reference so they can display and hand files to agents.
3819
+ */
3820
+ interface TaskFileRef {
3821
+ /**
3822
+ * Uniquely locates the resource:
3823
+ * - http(s)://... → external URL
3824
+ * - /s/:token → shared resource
3825
+ * - anything else → sandbox path (e.g. /project/uploads/foo.pdf)
3826
+ */
3827
+ uri: string;
3828
+ /** Display name (useful when uri is a uuid or bare path) */
3829
+ name?: string;
3830
+ /** Who attached the file: the user (reference material) or an agent (artifact) */
3831
+ addedBy?: "user" | "agent";
3778
3832
  }
3779
3833
  /**
3780
3834
  * Update task request type
@@ -3848,6 +3902,8 @@ interface UpdateTaskRequest {
3848
3902
  * Reason for task failure (when status is 'failed')
3849
3903
  */
3850
3904
  failureReason?: string;
3905
+ /** File references attached to this task */
3906
+ files?: TaskFileRef[];
3851
3907
  }
3852
3908
  /**
3853
3909
  * Task list filter criteria
@@ -4799,4 +4855,4 @@ type Timestamp = number;
4799
4855
  */
4800
4856
  type Callback<T = any, R = void> = (data: T) => R | Promise<R>;
4801
4857
 
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 };
4858
+ 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
@@ -3444,7 +3444,8 @@ interface CreateEvalProjectRequest {
3444
3444
  name: string;
3445
3445
  description?: string;
3446
3446
  version?: string;
3447
- judgeModelConfig: Record<string, unknown>;
3447
+ /** Judge model config; omit to let the runner resolve its default model. */
3448
+ judgeModelConfig?: Record<string, unknown>;
3448
3449
  targetServerConfig: Record<string, unknown>;
3449
3450
  concurrency?: number;
3450
3451
  reportConfig?: Record<string, unknown>;
@@ -3458,6 +3459,22 @@ interface EvalSuite {
3458
3459
  updatedAt: Date;
3459
3460
  caseCount?: number;
3460
3461
  }
3462
+ /**
3463
+ * How an eval case handles a HITL interrupt (agent pausing for human input).
3464
+ *
3465
+ * - `stop` (default): leave the case interrupted at the pause — the judge
3466
+ * evaluates the pause itself as business behavior.
3467
+ * - `auto-approve`: resume the agent with an approval so the flow AFTER the
3468
+ * pause can be tested (e.g. payment execution).
3469
+ * - `auto-reject`: resume with a rejection so the rejection path is tested.
3470
+ * - `canned-response`: resume with the exact `value` (simulates a specific
3471
+ * human reply). `value` is also the override for auto-approve/auto-reject
3472
+ * (defaults: "同意" / "拒绝").
3473
+ */
3474
+ interface InterruptPolicy {
3475
+ mode: "stop" | "auto-approve" | "auto-reject" | "canned-response";
3476
+ value?: string;
3477
+ }
3461
3478
  interface CreateEvalSuiteRequest {
3462
3479
  name: string;
3463
3480
  }
@@ -3469,6 +3486,8 @@ interface CreateEvalRunRequest {
3469
3486
  /** Workspace-project environment the run executed in (caller's runConfig) */
3470
3487
  envProjectId?: string;
3471
3488
  envWorkspaceId?: string;
3489
+ /** Task this run belongs to (training round association) */
3490
+ taskId?: string;
3472
3491
  }
3473
3492
  interface EvalCase {
3474
3493
  id: string;
@@ -3487,6 +3506,7 @@ interface EvalCase {
3487
3506
  weight: number;
3488
3507
  description: string;
3489
3508
  }>;
3509
+ interruptPolicy?: InterruptPolicy;
3490
3510
  createdAt: Date;
3491
3511
  updatedAt: Date;
3492
3512
  }
@@ -3504,6 +3524,7 @@ interface CreateEvalCaseRequest {
3504
3524
  weight: number;
3505
3525
  description: string;
3506
3526
  }>;
3527
+ interruptPolicy?: InterruptPolicy;
3507
3528
  }
3508
3529
  interface EvalRun {
3509
3530
  id: string;
@@ -3514,6 +3535,8 @@ interface EvalRun {
3514
3535
  totalCases: number;
3515
3536
  passedCases: number;
3516
3537
  failedCases: number;
3538
+ /** Cases that hit a HITL interrupt (agent requested human input) — not judged. */
3539
+ interruptedCases?: number;
3517
3540
  avgScore: number;
3518
3541
  error?: string;
3519
3542
  /**
@@ -3530,6 +3553,8 @@ interface EvalRun {
3530
3553
  */
3531
3554
  envProjectId?: string;
3532
3555
  envWorkspaceId?: string;
3556
+ /** Training task this run belongs to (round association, 1 task : N runs) */
3557
+ taskId?: string;
3533
3558
  createdAt: Date;
3534
3559
  startedAt?: Date;
3535
3560
  completedAt?: Date;
@@ -3560,6 +3585,12 @@ interface EvalRunResult {
3560
3585
  data?: unknown;
3561
3586
  }>;
3562
3587
  error?: string;
3588
+ /**
3589
+ * True when the case hit a HITL interrupt: the agent requested human input
3590
+ * before producing an answer, so the case was NOT judged (neither pass nor
3591
+ * fail). `pass` is false and `score` is 0 for such rows.
3592
+ */
3593
+ interrupted?: boolean;
3563
3594
  createdAt: Date;
3564
3595
  }
3565
3596
  interface EvalProjectReport {
@@ -3596,6 +3627,7 @@ interface EvalStore {
3596
3627
  status?: EvalRun['status'];
3597
3628
  passedCases?: number;
3598
3629
  failedCases?: number;
3630
+ interruptedCases?: number;
3599
3631
  avgScore?: number;
3600
3632
  error?: string;
3601
3633
  completedAt?: Date;
@@ -3702,6 +3734,8 @@ interface TaskItem {
3702
3734
  * Reason for task failure (when status is 'failed')
3703
3735
  */
3704
3736
  failureReason?: string;
3737
+ /** File references attached to this task */
3738
+ files?: TaskFileRef[];
3705
3739
  }
3706
3740
  /**
3707
3741
  * Create task request type
@@ -3775,6 +3809,26 @@ interface CreateTaskRequest {
3775
3809
  * Reason for task failure (when status is 'failed')
3776
3810
  */
3777
3811
  failureReason?: string;
3812
+ /** File references attached to this task */
3813
+ files?: TaskFileRef[];
3814
+ }
3815
+ /**
3816
+ * A file reference attached to a task — a URI association, not file management.
3817
+ * The file body is managed by the workspace/sandbox systems; tasks only record
3818
+ * the reference so they can display and hand files to agents.
3819
+ */
3820
+ interface TaskFileRef {
3821
+ /**
3822
+ * Uniquely locates the resource:
3823
+ * - http(s)://... → external URL
3824
+ * - /s/:token → shared resource
3825
+ * - anything else → sandbox path (e.g. /project/uploads/foo.pdf)
3826
+ */
3827
+ uri: string;
3828
+ /** Display name (useful when uri is a uuid or bare path) */
3829
+ name?: string;
3830
+ /** Who attached the file: the user (reference material) or an agent (artifact) */
3831
+ addedBy?: "user" | "agent";
3778
3832
  }
3779
3833
  /**
3780
3834
  * Update task request type
@@ -3848,6 +3902,8 @@ interface UpdateTaskRequest {
3848
3902
  * Reason for task failure (when status is 'failed')
3849
3903
  */
3850
3904
  failureReason?: string;
3905
+ /** File references attached to this task */
3906
+ files?: TaskFileRef[];
3851
3907
  }
3852
3908
  /**
3853
3909
  * Task list filter criteria
@@ -4799,4 +4855,4 @@ type Timestamp = number;
4799
4855
  */
4800
4856
  type Callback<T = any, R = void> = (data: T) => R | Promise<R>;
4801
4857
 
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 };
4858
+ 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.4",
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"
@@ -16,7 +16,8 @@ export interface CreateEvalProjectRequest {
16
16
  name: string;
17
17
  description?: string;
18
18
  version?: string;
19
- judgeModelConfig: Record<string, unknown>;
19
+ /** Judge model config; omit to let the runner resolve its default model. */
20
+ judgeModelConfig?: Record<string, unknown>;
20
21
  targetServerConfig: Record<string, unknown>;
21
22
  concurrency?: number;
22
23
  reportConfig?: Record<string, unknown>;
@@ -32,6 +33,23 @@ export interface EvalSuite {
32
33
  caseCount?: number;
33
34
  }
34
35
 
36
+ /**
37
+ * How an eval case handles a HITL interrupt (agent pausing for human input).
38
+ *
39
+ * - `stop` (default): leave the case interrupted at the pause — the judge
40
+ * evaluates the pause itself as business behavior.
41
+ * - `auto-approve`: resume the agent with an approval so the flow AFTER the
42
+ * pause can be tested (e.g. payment execution).
43
+ * - `auto-reject`: resume with a rejection so the rejection path is tested.
44
+ * - `canned-response`: resume with the exact `value` (simulates a specific
45
+ * human reply). `value` is also the override for auto-approve/auto-reject
46
+ * (defaults: "同意" / "拒绝").
47
+ */
48
+ export interface InterruptPolicy {
49
+ mode: "stop" | "auto-approve" | "auto-reject" | "canned-response";
50
+ value?: string;
51
+ }
52
+
35
53
  export interface CreateEvalSuiteRequest {
36
54
  name: string;
37
55
  }
@@ -44,6 +62,8 @@ export interface CreateEvalRunRequest {
44
62
  /** Workspace-project environment the run executed in (caller's runConfig) */
45
63
  envProjectId?: string;
46
64
  envWorkspaceId?: string;
65
+ /** Task this run belongs to (training round association) */
66
+ taskId?: string;
47
67
  }
48
68
 
49
69
  export interface EvalCase {
@@ -56,6 +76,7 @@ export interface EvalCase {
56
76
  outputType: 'file_content' | 'message_content';
57
77
  contentAssertion: string;
58
78
  rubrics?: Array<{ name: string; weight: number; description: string }>;
79
+ interruptPolicy?: InterruptPolicy;
59
80
  createdAt: Date;
60
81
  updatedAt: Date;
61
82
  }
@@ -67,6 +88,7 @@ export interface CreateEvalCaseRequest {
67
88
  outputType: 'file_content' | 'message_content';
68
89
  contentAssertion: string;
69
90
  rubrics?: Array<{ name: string; weight: number; description: string }>;
91
+ interruptPolicy?: InterruptPolicy;
70
92
  }
71
93
 
72
94
  export interface EvalRun {
@@ -78,6 +100,8 @@ export interface EvalRun {
78
100
  totalCases: number;
79
101
  passedCases: number;
80
102
  failedCases: number;
103
+ /** Cases that hit a HITL interrupt (agent requested human input) — not judged. */
104
+ interruptedCases?: number;
81
105
  avgScore: number;
82
106
  error?: string;
83
107
  /**
@@ -94,6 +118,8 @@ export interface EvalRun {
94
118
  */
95
119
  envProjectId?: string;
96
120
  envWorkspaceId?: string;
121
+ /** Training task this run belongs to (round association, 1 task : N runs) */
122
+ taskId?: string;
97
123
  createdAt: Date;
98
124
  startedAt?: Date;
99
125
  completedAt?: Date;
@@ -112,6 +138,12 @@ export interface EvalRunResult {
112
138
  messages?: Array<{ role: string; content: string; id?: string }>;
113
139
  logs?: Array<{ timestamp: string; level: string; message: string; data?: unknown }>;
114
140
  error?: string;
141
+ /**
142
+ * True when the case hit a HITL interrupt: the agent requested human input
143
+ * before producing an answer, so the case was NOT judged (neither pass nor
144
+ * fail). `pass` is false and `score` is 0 for such rows.
145
+ */
146
+ interrupted?: boolean;
115
147
  createdAt: Date;
116
148
  }
117
149
 
@@ -146,7 +178,7 @@ export interface EvalStore {
146
178
  getRunsByTenant(tenantId: string, opts?: { projectId?: string; status?: string }): Promise<EvalRun[]>;
147
179
  getRunById(tenantId: string, id: string): Promise<EvalRun | null>;
148
180
  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>;
181
+ 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
182
  deleteRun(tenantId: string, id: string): Promise<boolean>;
151
183
 
152
184
  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
  /**