@hoplogic/hopjit 0.1.0

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.
Files changed (56) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +99 -0
  3. package/dist/act-body-interpreter.d.ts +24 -0
  4. package/dist/act-body-interpreter.js +159 -0
  5. package/dist/act-body-parser.d.ts +10 -0
  6. package/dist/act-body-parser.js +577 -0
  7. package/dist/act-builtins.d.ts +12 -0
  8. package/dist/act-builtins.js +104 -0
  9. package/dist/ast-helpers.d.ts +26 -0
  10. package/dist/ast-helpers.js +58 -0
  11. package/dist/ast-runtime.d.ts +49 -0
  12. package/dist/ast-runtime.js +224 -0
  13. package/dist/ast-types.d.ts +260 -0
  14. package/dist/ast-types.js +4 -0
  15. package/dist/cli-types.d.ts +190 -0
  16. package/dist/cli-types.js +4 -0
  17. package/dist/cli.d.ts +26 -0
  18. package/dist/cli.js +623 -0
  19. package/dist/dispatcher.d.ts +92 -0
  20. package/dist/dispatcher.js +692 -0
  21. package/dist/doc-ref.d.ts +41 -0
  22. package/dist/doc-ref.js +214 -0
  23. package/dist/engine-traverse.d.ts +37 -0
  24. package/dist/engine-traverse.js +385 -0
  25. package/dist/engine.d.ts +141 -0
  26. package/dist/engine.js +1792 -0
  27. package/dist/errors.d.ts +47 -0
  28. package/dist/errors.js +34 -0
  29. package/dist/hoplog.d.ts +120 -0
  30. package/dist/hoplog.js +501 -0
  31. package/dist/parser.d.ts +7 -0
  32. package/dist/parser.js +802 -0
  33. package/dist/persistence.d.ts +60 -0
  34. package/dist/persistence.js +208 -0
  35. package/dist/prompt.d.ts +130 -0
  36. package/dist/prompt.js +1014 -0
  37. package/dist/provider-types.d.ts +134 -0
  38. package/dist/provider-types.js +3 -0
  39. package/dist/runtime-types.d.ts +84 -0
  40. package/dist/runtime-types.js +4 -0
  41. package/dist/tools.d.ts +16 -0
  42. package/dist/tools.js +141 -0
  43. package/dist/validator.d.ts +23 -0
  44. package/dist/validator.js +959 -0
  45. package/driver/codex/AGENTS.md +54 -0
  46. package/driver/hopskill-build/SKILL.md +137 -0
  47. package/driver/hopskill-build/references/spec-skeleton.md +132 -0
  48. package/driver/hopskill-build/references/step-type-cheatsheet.md +56 -0
  49. package/driver/hopskill-build/references/three-focus-rules.md +148 -0
  50. package/driver/hopspec-skill.md +187 -0
  51. package/driver/references/cli-discovery.md +36 -0
  52. package/driver/references/discovery.md +45 -0
  53. package/driver/references/driver-subagent.md +50 -0
  54. package/driver/references/parallel-worker.md +50 -0
  55. package/driver/references/step-execution-rules.md +47 -0
  56. package/package.json +52 -0
@@ -0,0 +1,134 @@
1
+ import type { SpecAST, ExecutableStepType } from './ast-types.js';
2
+ import type { EngineSnapshot } from './runtime-types.js';
3
+ /** PersistenceProvider:引擎状态快照存取接口——引擎经此持久化/恢复执行状态,支撑复用/独立双模式驱动。见 [[shared-providers#^anc-provider-persistence-iface]] */
4
+ export interface PersistenceProvider {
5
+ init(instanceId: string, spec: SpecAST): void;
6
+ saveSnapshot(snapshot: EngineSnapshot): void;
7
+ loadSnapshot(): EngineSnapshot;
8
+ exists(): boolean;
9
+ getWorkZone(): string;
10
+ }
11
+ /** ToolProvider:工具能力接口——引擎经此调用宿主注入的工具(execute 执行、list 列举)。见 [[shared-providers#^anc-provider-tool]] */
12
+ export interface ToolProvider {
13
+ execute(tool_name: string, tool_args: Record<string, unknown>): Promise<ToolResult>;
14
+ list(): ToolDef[];
15
+ }
16
+ /** ToolResult:工具执行结果——承载返回值、内容类型(text/json)与成功标志。见 [[shared-providers#^anc-provider-tool]] */
17
+ export interface ToolResult {
18
+ result: string | Record<string, unknown>;
19
+ content_type?: 'text' | 'json';
20
+ success: boolean;
21
+ }
22
+ /** ToolDef:工具定义——声明名称、描述、input_schema 及 requires_commit 副作用级别(用于 act 步骤拦截)。见 [[shared-providers#^anc-provider-tool]] */
23
+ export interface ToolDef {
24
+ name: string;
25
+ description: string;
26
+ input_schema: Record<string, unknown>;
27
+ requires_commit: boolean;
28
+ }
29
+ /** KnowledgeProvider:知识检索接口——引擎经此按 query 检索宿主知识片段供 prompt 注入。见 [[shared-providers#^anc-provider-knowledge]] */
30
+ export interface KnowledgeProvider {
31
+ retrieve(query: string, max_results: number): Promise<KnowledgeFragment[]>;
32
+ }
33
+ /** KnowledgeFragment:知识片段——检索返回的单条结果,含来源 id、内容与相关度。见 [[shared-providers#^anc-provider-knowledge]] */
34
+ export interface KnowledgeFragment {
35
+ source_id: string;
36
+ content: string;
37
+ relevance: 'high' | 'medium' | 'low';
38
+ }
39
+ /** IdentityProvider:身份凭证接口——为外部服务调用提供凭证(get_credential/list_services),v1 仅定义形状未实装。见 [[shared-providers#^anc-provider-identity]] */
40
+ export interface IdentityProvider {
41
+ get_credential(service_id: string): Promise<Credential | null>;
42
+ list_services(): ServiceEntry[];
43
+ }
44
+ /** Credential:外部服务凭证——含类型(api_key/ak_sk/bearer_token/oauth)与键值对。见 [[shared-providers#^anc-provider-identity]] */
45
+ export interface Credential {
46
+ type: 'api_key' | 'ak_sk' | 'bearer_token' | 'oauth';
47
+ values: Record<string, string>;
48
+ }
49
+ /** ServiceEntry:可用服务条目——list_services 返回的单项,含 service_id 与描述。见 [[shared-providers#^anc-provider-identity]] */
50
+ export interface ServiceEntry {
51
+ service_id: string;
52
+ description: string;
53
+ }
54
+ export interface SpecProvider {
55
+ resolve(spec_id: string): Promise<SpecSource | null>;
56
+ list?(): SpecEntry[];
57
+ }
58
+ /** SpecSource:被调子 spec 源——resolve 返回的 HopSpec markdown 全文及可选版本(引擎只透传/审计)。见 [[shared-providers#^anc-provider-spec]] */
59
+ export interface SpecSource {
60
+ spec_id: string;
61
+ source: string;
62
+ version?: string;
63
+ }
64
+ /** SpecEntry:可用 spec 条目——可选 list() 返回的单项,含 spec_id 与描述。见 [[shared-providers#^anc-provider-spec]] */
65
+ export interface SpecEntry {
66
+ spec_id: string;
67
+ description: string;
68
+ }
69
+ /** ModelEngine:多模型路由配置——由 IdentityLayer 持有,定义默认服务/模型及按步骤类型的路由规则。见 [[shared-providers#^anc-config-model-engine]] */
70
+ export interface ModelEngine {
71
+ default_service_id: string;
72
+ default_model: string;
73
+ routing_rules?: ModelRoute[];
74
+ }
75
+ /** ModelRoute:单条模型路由规则——按 step_type 匹配到目标 service_id 与 model。见 [[shared-providers#^anc-config-model-engine]] */
76
+ export interface ModelRoute {
77
+ match: {
78
+ step_type?: ExecutableStepType;
79
+ };
80
+ service_id: string;
81
+ model: string;
82
+ }
83
+ /** HostConfig:宿主环境配置——实例化时由宿主注入,贯穿执行生命周期,聚合 workspace/sandbox/三件套 Provider/模型与资源上限。见 [[shared-providers#^anc-config-host]] */
84
+ export interface HostConfig {
85
+ workspace_dir: string;
86
+ sandbox: SandboxConfig;
87
+ tool_provider?: ToolProvider;
88
+ knowledge_provider?: KnowledgeProvider;
89
+ identity_provider?: IdentityProvider;
90
+ spec_provider?: SpecProvider;
91
+ api_key: string;
92
+ base_url?: string;
93
+ model?: string;
94
+ model_engine?: ModelEngine;
95
+ resource_limits?: ResourceLimits;
96
+ }
97
+ /** SandboxConfig:沙箱配置——定义 act 步骤能安全触及的资源边界(文件/网络/运行时/数据库四类)。见 [[shared-providers#^anc-config-sandbox]] */
98
+ export interface SandboxConfig {
99
+ filesystem: FilesystemSandbox;
100
+ network: NetworkSandbox;
101
+ runtime: RuntimeSandbox;
102
+ database?: DatabaseSandbox;
103
+ }
104
+ /** FilesystemSandbox:文件系统沙箱——声明工作区根目录与读取访问控制(allowed/denied/confirm_required)。见 [[shared-providers#^anc-config-sandbox]] */
105
+ export interface FilesystemSandbox {
106
+ workspace_dir: string;
107
+ read_access: {
108
+ allowed: string[];
109
+ denied: string[];
110
+ confirm_required: string[];
111
+ };
112
+ }
113
+ /** NetworkSandbox:网络沙箱——声明可信域名白名单,约束 act 步骤可访问的网络主机。见 [[shared-providers#^anc-config-sandbox]] */
114
+ export interface NetworkSandbox {
115
+ trusted_hosts: string[];
116
+ }
117
+ /** RuntimeSandbox:运行时沙箱——声明可用运行时白名单(如 python/node/uv/pdf/ocr)。见 [[shared-providers#^anc-config-sandbox]] */
118
+ export interface RuntimeSandbox {
119
+ available: string[];
120
+ }
121
+ /** DatabaseSandbox:数据库沙箱——区分临时库(act 可读写、可重建)与只读库(act 只查、写需 commit)。见 [[shared-providers#^anc-config-sandbox]] */
122
+ export interface DatabaseSandbox {
123
+ temp_databases: string[];
124
+ readonly_databases?: string[];
125
+ }
126
+ /** ResourceLimits:资源上限——定义单步执行的 token 预算、工具调用上限、replan/并发/超时等约束。见 [[shared-providers#^anc-config-resource-limits]] */
127
+ export interface ResourceLimits {
128
+ max_tool_iterations: number;
129
+ max_context_tokens: number;
130
+ max_output_tokens: number;
131
+ max_replan_attempts: number;
132
+ max_concurrent_workers?: number;
133
+ timeout_seconds?: number;
134
+ }
@@ -0,0 +1,3 @@
1
+ // @module: shared-providers ^anc-struct-shared-providers — 宿主契约:Provider 三件套 + HostConfig/Sandbox/ResourceLimits/ModelEngine。
2
+ // 拆自原 types.ts(见 design/spec-ast.md ^anc-struct-spec-ast 拆分表)。Provider 接口定位见 shared-types.md。
3
+ export {};
@@ -0,0 +1,84 @@
1
+ import type { SpecAST, OutputDecl, ResponseOption, StepSummary } from './ast-types.js';
2
+ import type { SandboxConfig } from './provider-types.js';
3
+ export interface ExecEvent {
4
+ at: string;
5
+ step_id: string;
6
+ event: string;
7
+ detail?: string;
8
+ }
9
+ /** 步骤失败的结构化分类——`lack_of_info`(缺信息,driver 可补充知识或上传父层)或 `error`(一般错误,走 retry/adaptive)。见 [[exec-engine#^anc-struct-exec-engine-exports]] */
10
+ export type FailKind = 'lack_of_info' | 'error';
11
+ /** 单个步骤的失败记录——人类可读原因加失败分类,按 step_id 存入 state.json 供 get_failure_reason 跨进程直读。见 [[exec-engine#^anc-exec-state-persistence]] */
12
+ export interface StepFailRecord {
13
+ reason: string;
14
+ fail_kind: FailKind;
15
+ }
16
+ /** subtask 一次重试尝试的档案——尝试轮次、失败原因与已试步骤摘要,供 adaptive replan 与 L2c 带反馈重跑消费。见 [[shared-types#^anc-type-auxiliary]] */
17
+ export interface RetryRecord {
18
+ attempt: number;
19
+ failure_reason: string;
20
+ steps_tried: StepSummary[];
21
+ }
22
+ /** PromptAssembler 组装后的六层执行上下文——任务契约、知识注入、进度摘要、输入、指令与输出约束,随 StepReady 交给 driver。见 [[exec-engine#^anc-exec-prompt-assembly]] */
23
+ export interface AssembledContext {
24
+ task_context: string;
25
+ knowledge_context?: string;
26
+ doc_ref_context?: string;
27
+ progress_summary: string;
28
+ iteration_history?: string;
29
+ retry_feedback?: string;
30
+ inputs: Record<string, unknown>;
31
+ instruction: string;
32
+ output_schema: OutputDecl[];
33
+ }
34
+ /** HITL 暂停快照——confirm/commit/waiting_human 触发时打包的执行上下文(呈现数据、回复项、变量快照),写入 checkpoint.json 供 resume 恢复。见 [[exec-engine#^anc-exec-crash-recovery]] */
35
+ export interface Checkpoint {
36
+ step_id: string;
37
+ pause_reason: string;
38
+ presented_data: unknown;
39
+ response_options?: ResponseOption[];
40
+ variables_snapshot: Record<string, unknown>;
41
+ timestamp: string;
42
+ }
43
+ export interface StateFile {
44
+ format_version: 1;
45
+ step_states: Record<string, string>;
46
+ retry_counters: Record<string, number>;
47
+ loop_counters: Record<string, number>;
48
+ retry_history?: Record<string, RetryRecord[]>;
49
+ step_fail_reasons?: Record<string, StepFailRecord>;
50
+ exec_events?: ExecEvent[];
51
+ log_dir?: string;
52
+ hoplog_run_dir?: string;
53
+ adaptive_needed_subtask?: string;
54
+ can_fanout?: boolean;
55
+ context_mode?: 'full' | 'minimal';
56
+ subtree_root?: string;
57
+ dispatched?: Record<string, string[]>;
58
+ spec_path?: string;
59
+ cli_abs_path?: string;
60
+ max_concurrent?: number;
61
+ host_context?: {
62
+ workspace_dir: string;
63
+ sandbox: SandboxConfig;
64
+ };
65
+ }
66
+ /** 单个作用域的持久化数据——父 scope id(root 为 null)+ 本层变量。见 [[exec-engine#^anc-exec-vars-scope-persist]] */
67
+ export interface ScopeData {
68
+ parent: string | null;
69
+ variables: Record<string, unknown>;
70
+ }
71
+ /** vars.json 的持久化结构,先于 state.json 原子写入。见 [[exec-engine#^anc-exec-vars-scope-persist]]
72
+ * - v2(当前):`scopes` 落盘完整 scope 树(scopeId → {parent, variables}),跨进程 scope 隔离保真。
73
+ * - v1(旧):`variables` 扁平字典(无 scope 前缀),读时全塞 root 向后兼容。 */
74
+ export interface VarsFile {
75
+ format_version: 1 | 2;
76
+ variables?: Record<string, unknown>;
77
+ scopes?: Record<string, ScopeData>;
78
+ }
79
+ /** 引擎完整快照——spec AST、状态文件与变量文件三合一,PersistenceProvider save/load 的载荷单元。见 [[shared-providers#^anc-provider-persistence-iface]] */
80
+ export interface EngineSnapshot {
81
+ spec: SpecAST;
82
+ state: StateFile;
83
+ vars: VarsFile;
84
+ }
@@ -0,0 +1,4 @@
1
+ // @module: exec-engine ^anc-struct-exec-engine
2
+ // 引擎内部运行时类型——随实现演进(非对外稳定面):事件流/快照/状态文件/组装上下文。
3
+ // 拆自原 types.ts(见 design/spec-ast.md ^anc-struct-spec-ast 拆分表)。
4
+ export {};
@@ -0,0 +1,16 @@
1
+ import type { ToolProvider, ToolDef, ToolResult, HostConfig, SandboxConfig } from './provider-types.js';
2
+ export declare function resolveWorkspacePath(workspaceDir: string, filePath: string): string;
3
+ export declare function validateReadAccess(sandbox: SandboxConfig, resolvedPath: string): void;
4
+ export declare function readSandboxedFile(workspaceDir: string, sandbox: SandboxConfig, filePath: string): string;
5
+ /** ToolProvider 契约的默认实现:无宿主注入时提供 Read/Write 两个受控工具(均 requires_commit=false,不含 bash),执行受 SandboxConfig 约束。见 [[tools#^anc-struct-tools]] */
6
+ export declare class DefaultToolProvider implements ToolProvider {
7
+ private workspaceDir;
8
+ private sandbox;
9
+ constructor(hostConfig: HostConfig);
10
+ list(): ToolDef[];
11
+ execute(tool_name: string, tool_args: Record<string, unknown>): Promise<ToolResult>;
12
+ private executeRead;
13
+ private executeWrite;
14
+ private resolvePath;
15
+ private validateFileAccess;
16
+ }
package/dist/tools.js ADDED
@@ -0,0 +1,141 @@
1
+ // @module: tools ^anc-struct-tools
2
+ import { readFileSync, writeFileSync, realpathSync } from 'node:fs';
3
+ import { resolve, isAbsolute } from 'node:path';
4
+ function resolveReal(p) {
5
+ try {
6
+ return realpathSync(p);
7
+ }
8
+ catch {
9
+ return p;
10
+ }
11
+ }
12
+ // 解析 workspace 相对路径(禁绝对路径 / `..`)。复用于 DefaultToolProvider 与 doc-ref。
13
+ // @a: anc-exec-tool-permission
14
+ export function resolveWorkspacePath(workspaceDir, filePath) {
15
+ if (isAbsolute(filePath)) {
16
+ throw new Error(`Absolute paths are forbidden: ${filePath}`);
17
+ }
18
+ if (filePath.includes('..')) {
19
+ throw new Error(`Path traversal (..) is forbidden: ${filePath}`);
20
+ }
21
+ return resolve(workspaceDir, filePath);
22
+ }
23
+ // 路径是否匹配某模式(子串命中 或 realpath 前缀命中)。denied/confirm_required 共用同一判据。
24
+ // 注:includes 子串匹配偏宽(会跨路径段命中),属已登记的收紧候选(见 code-quality 报告 tools P2),
25
+ // 此处只抽重复、不改判据(沙箱行为不变)。
26
+ function pathMatches(realPath, pattern) {
27
+ return realPath.includes(pattern) || realPath.startsWith(resolveReal(pattern));
28
+ }
29
+ // 校验读权限(denied / confirm_required / workspace 内 / allowed 链)。
30
+ // 抽自 DefaultToolProvider.validateFileAccess 的 read 分支,供 doc-ref 复用。
31
+ // @a: anc-exec-tool-permission
32
+ export function validateReadAccess(sandbox, resolvedPath) {
33
+ const realPath = resolveReal(resolvedPath);
34
+ const fs = sandbox.filesystem;
35
+ const wsDir = resolveReal(resolve(fs.workspace_dir));
36
+ for (const denied of fs.read_access.denied) {
37
+ if (pathMatches(realPath, denied)) {
38
+ throw new Error(`Read denied: ${realPath} matches denied pattern "${denied}"`);
39
+ }
40
+ }
41
+ for (const confirmReq of fs.read_access.confirm_required) {
42
+ if (pathMatches(realPath, confirmReq)) {
43
+ throw new Error(`Read requires confirm: ${realPath} (act steps cannot confirm)`);
44
+ }
45
+ }
46
+ if (realPath.startsWith(wsDir))
47
+ return;
48
+ for (const allowed of fs.read_access.allowed) {
49
+ const allowedReal = resolveReal(resolve(allowed));
50
+ if (realPath.startsWith(allowedReal))
51
+ return;
52
+ }
53
+ throw new Error(`Read outside allowed paths: ${realPath}`);
54
+ }
55
+ // 读取一个受沙箱约束的 workspace 文件(解析路径 + 校验读权限 + 读取)。
56
+ // doc-ref 解析直接复用此入口,与 act 步骤的 read 工具同一套权限。
57
+ // @a: anc-exec-doc-ref-resolve
58
+ export function readSandboxedFile(workspaceDir, sandbox, filePath) {
59
+ const resolved = resolveWorkspacePath(workspaceDir, filePath);
60
+ validateReadAccess(sandbox, resolved);
61
+ return readFileSync(resolved, 'utf-8');
62
+ }
63
+ const READ_TOOL = {
64
+ name: 'read',
65
+ description: 'Read a file and return its contents.',
66
+ input_schema: {
67
+ type: 'object',
68
+ properties: {
69
+ path: { type: 'string', description: 'Path to the file to read' },
70
+ },
71
+ required: ['path'],
72
+ },
73
+ requires_commit: false,
74
+ };
75
+ const WRITE_TOOL = {
76
+ name: 'write',
77
+ description: 'Write content to a file.',
78
+ input_schema: {
79
+ type: 'object',
80
+ properties: {
81
+ path: { type: 'string', description: 'Path to the file to write' },
82
+ content: { type: 'string', description: 'Content to write' },
83
+ },
84
+ required: ['path', 'content'],
85
+ },
86
+ requires_commit: false,
87
+ };
88
+ /** ToolProvider 契约的默认实现:无宿主注入时提供 Read/Write 两个受控工具(均 requires_commit=false,不含 bash),执行受 SandboxConfig 约束。见 [[tools#^anc-struct-tools]] */
89
+ export class DefaultToolProvider {
90
+ workspaceDir;
91
+ sandbox;
92
+ constructor(hostConfig) {
93
+ this.workspaceDir = resolveReal(hostConfig.workspace_dir);
94
+ this.sandbox = hostConfig.sandbox;
95
+ }
96
+ list() {
97
+ return [READ_TOOL, WRITE_TOOL];
98
+ }
99
+ async execute(tool_name, tool_args) {
100
+ try {
101
+ switch (tool_name) {
102
+ case 'read': return this.executeRead(tool_args.path);
103
+ case 'write': return this.executeWrite(tool_args.path, tool_args.content);
104
+ default: return { result: `Unknown tool: ${tool_name}`, success: false, content_type: 'text' };
105
+ }
106
+ }
107
+ catch (err) {
108
+ const msg = err instanceof Error ? err.message : String(err);
109
+ return { result: msg, success: false, content_type: 'text' };
110
+ }
111
+ }
112
+ executeRead(filePath) {
113
+ const resolved = this.resolvePath(filePath);
114
+ this.validateFileAccess(resolved, 'read');
115
+ const content = readFileSync(resolved, 'utf-8');
116
+ return { result: content, success: true, content_type: 'text' };
117
+ }
118
+ executeWrite(filePath, content) {
119
+ const resolved = this.resolvePath(filePath);
120
+ this.validateFileAccess(resolved, 'write');
121
+ writeFileSync(resolved, content, 'utf-8');
122
+ return { result: `Written ${content.length} bytes to ${filePath}`, success: true, content_type: 'text' };
123
+ }
124
+ resolvePath(filePath) {
125
+ return resolveWorkspacePath(this.workspaceDir, filePath);
126
+ }
127
+ validateFileAccess(resolvedPath, operation) {
128
+ if (operation === 'write') {
129
+ const realPath = resolveReal(resolvedPath);
130
+ const wsDir = resolveReal(resolve(this.sandbox.filesystem.workspace_dir));
131
+ if (!realPath.startsWith(wsDir)) {
132
+ throw new Error(`Write outside workspace sandbox: ${realPath}`);
133
+ }
134
+ if (realPath.includes('.hopstate')) {
135
+ throw new Error('Write to .hopstate/ is forbidden');
136
+ }
137
+ return;
138
+ }
139
+ validateReadAccess(this.sandbox, resolvedPath);
140
+ }
141
+ }
@@ -0,0 +1,23 @@
1
+ import type { SpecAST, OutputDecl } from './ast-types.js';
2
+ import type { ValidationError } from './errors.js';
3
+ import type { SandboxConfig } from './provider-types.js';
4
+ export interface DocRefCheckCtx {
5
+ workspace_dir: string;
6
+ sandbox: SandboxConfig;
7
+ }
8
+ /** Spec 校验入口——对 SpecAST 执行结构/控制流/变量/特殊步骤共 37 条规则,返回违规列表(放行前闸门)。见 [[spec-parser#^anc-rule-all]]。 */
9
+ export declare function validateSpec(ast: SpecAST, docRefCtx?: DocRefCheckCtx): ValidationError[];
10
+ export interface SchemaMismatch {
11
+ field: string;
12
+ declared_type: string;
13
+ actual: string;
14
+ reason: string;
15
+ }
16
+ /**
17
+ * 校验一组输出值是否匹配步骤的 +→ 声明(OutputDecl[])。
18
+ * 返回不匹配项列表(空数组 = 全部通过)。
19
+ * @a: anc-exec-output-schema-check
20
+ */
21
+ export declare function validateOutputValues(decls: OutputDecl[] | undefined, outputs: Record<string, unknown>): SchemaMismatch[];
22
+ /** 把不匹配项格式化为 SCHEMA_MISMATCH 的 message(供算子级重试构造反馈)。 */
23
+ export declare function formatSchemaMismatch(mismatches: SchemaMismatch[]): string;