@interf/compiler 0.5.1 → 0.6.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.
- package/README.md +160 -201
- package/builtin-workflows/interf/README.md +22 -10
- package/builtin-workflows/interf/compile/stages/shape/SKILL.md +8 -5
- package/builtin-workflows/interf/compile/stages/structure/SKILL.md +3 -0
- package/builtin-workflows/interf/compile/stages/summarize/SKILL.md +18 -2
- package/builtin-workflows/interf/improve/SKILL.md +4 -4
- package/builtin-workflows/interf/use/query/SKILL.md +1 -1
- package/builtin-workflows/interf/workflow.json +19 -5
- package/builtin-workflows/interf/{compiled.schema.json → workflow.schema.json} +10 -3
- package/dist/bin.js +2 -28
- package/dist/{commands → cli/commands}/check-draft.d.ts +2 -2
- package/dist/{commands → cli/commands}/check-draft.js +13 -13
- package/dist/{commands → cli/commands}/compile-controller.d.ts +3 -3
- package/dist/{commands → cli/commands}/compile-controller.js +39 -44
- package/dist/cli/commands/compile.d.ts +33 -0
- package/dist/{commands → cli/commands}/compile.js +107 -33
- package/dist/{commands → cli/commands}/compiled-flow.d.ts +3 -4
- package/dist/{commands → cli/commands}/compiled-flow.js +9 -14
- package/dist/{commands → cli/commands}/create-workflow-wizard.d.ts +20 -2
- package/dist/cli/commands/create-workflow-wizard.js +288 -0
- package/dist/{commands → cli/commands}/create.d.ts +2 -2
- package/dist/cli/commands/create.js +166 -0
- package/dist/cli/commands/dataset-selection.d.ts +6 -0
- package/dist/cli/commands/dataset-selection.js +11 -0
- package/dist/{commands → cli/commands}/default.js +5 -5
- package/dist/{commands → cli/commands}/doctor.js +12 -13
- package/dist/{commands → cli/commands}/executor-flow.d.ts +2 -2
- package/dist/{commands → cli/commands}/executor-flow.js +17 -17
- package/dist/cli/commands/init.d.ts +11 -0
- package/dist/{commands → cli/commands}/init.js +202 -109
- package/dist/{commands → cli/commands}/list.js +9 -6
- package/dist/{commands → cli/commands}/reset.js +5 -5
- package/dist/{commands → cli/commands}/source-config-wizard.d.ts +10 -5
- package/dist/{commands → cli/commands}/source-config-wizard.js +202 -95
- package/dist/{commands → cli/commands}/status.js +20 -11
- package/dist/{commands → cli/commands}/test-flow.d.ts +13 -4
- package/dist/{commands → cli/commands}/test-flow.js +30 -26
- package/dist/cli/commands/test.d.ts +14 -0
- package/dist/{commands → cli/commands}/test.js +48 -40
- package/dist/{commands → cli/commands}/verify.js +4 -4
- package/dist/cli/index.d.ts +21 -0
- package/dist/cli/index.js +33 -0
- package/dist/index.d.ts +22 -11
- package/dist/index.js +15 -6
- package/dist/lib/agent-args.d.ts +1 -3
- package/dist/lib/agent-args.js +1 -42
- package/dist/lib/agent-constants.d.ts +1 -5
- package/dist/lib/agent-constants.js +1 -28
- package/dist/lib/agent-detection.d.ts +1 -7
- package/dist/lib/agent-detection.js +1 -65
- package/dist/lib/agent-execution.d.ts +1 -2
- package/dist/lib/agent-execution.js +1 -242
- package/dist/lib/agent-logs.d.ts +1 -2
- package/dist/lib/agent-logs.js +1 -17
- package/dist/lib/agent-preflight.d.ts +1 -7
- package/dist/lib/agent-preflight.js +1 -76
- package/dist/lib/agent-render.d.ts +1 -8
- package/dist/lib/agent-render.js +1 -218
- package/dist/lib/agent-shells.d.ts +1 -44
- package/dist/lib/agent-shells.js +1 -847
- package/dist/lib/agent-status.d.ts +1 -3
- package/dist/lib/agent-status.js +1 -58
- package/dist/lib/agent-types.d.ts +1 -30
- package/dist/lib/agent-types.js +1 -1
- package/dist/lib/agents.d.ts +1 -6
- package/dist/lib/agents.js +1 -5
- package/dist/lib/builtin-compiled-workflow.d.ts +1 -129
- package/dist/lib/builtin-compiled-workflow.js +1 -153
- package/dist/lib/compiled-compile.d.ts +1 -52
- package/dist/lib/compiled-compile.js +1 -274
- package/dist/lib/compiled-paths.d.ts +1 -39
- package/dist/lib/compiled-paths.js +3 -103
- package/dist/lib/compiled-raw.d.ts +1 -49
- package/dist/lib/compiled-raw.js +3 -102
- package/dist/lib/compiled-reset.d.ts +1 -1
- package/dist/lib/compiled-reset.js +3 -44
- package/dist/lib/compiled-schema.d.ts +1 -27
- package/dist/lib/compiled-schema.js +1 -110
- package/dist/lib/discovery.d.ts +1 -1
- package/dist/lib/discovery.js +2 -2
- package/dist/lib/execution-profile.d.ts +1 -17
- package/dist/lib/execution-profile.js +1 -84
- package/dist/lib/executors.d.ts +1 -32
- package/dist/lib/executors.js +1 -43
- package/dist/lib/interf-bootstrap.d.ts +1 -3
- package/dist/lib/interf-bootstrap.js +3 -18
- package/dist/lib/interf-detect.d.ts +1 -33
- package/dist/lib/interf-detect.js +3 -176
- package/dist/lib/interf-scaffold.d.ts +1 -2
- package/dist/lib/interf-scaffold.js +3 -121
- package/dist/lib/interf-workflow-package.d.ts +1 -20
- package/dist/lib/interf-workflow-package.js +1 -276
- package/dist/lib/interf.d.ts +1 -5
- package/dist/lib/interf.js +3 -4
- package/dist/lib/local-workflows.d.ts +1 -53
- package/dist/lib/local-workflows.js +1 -399
- package/dist/lib/package-root.d.ts +1 -0
- package/dist/lib/package-root.js +1 -0
- package/dist/lib/project-paths.d.ts +1 -11
- package/dist/lib/project-paths.js +3 -32
- package/dist/lib/runtime-acceptance.d.ts +1 -9
- package/dist/lib/runtime-acceptance.js +1 -257
- package/dist/lib/runtime-contracts.d.ts +1 -2
- package/dist/lib/runtime-contracts.js +1 -47
- package/dist/lib/runtime-inventory.d.ts +1 -7
- package/dist/lib/runtime-inventory.js +1 -29
- package/dist/lib/runtime-paths.d.ts +1 -7
- package/dist/lib/runtime-paths.js +1 -23
- package/dist/lib/runtime-prompt.d.ts +1 -2
- package/dist/lib/runtime-prompt.js +1 -46
- package/dist/lib/runtime-reconcile.d.ts +1 -2
- package/dist/lib/runtime-reconcile.js +1 -156
- package/dist/lib/runtime-runs.d.ts +1 -11
- package/dist/lib/runtime-runs.js +1 -250
- package/dist/lib/runtime-types.d.ts +1 -43
- package/dist/lib/runtime-types.js +1 -1
- package/dist/lib/runtime.d.ts +1 -6
- package/dist/lib/runtime.js +1 -5
- package/dist/lib/schema.d.ts +4 -1016
- package/dist/lib/schema.js +6 -539
- package/dist/lib/source-config.d.ts +1 -39
- package/dist/lib/source-config.js +3 -293
- package/dist/lib/state-artifacts.d.ts +1 -8
- package/dist/lib/state-artifacts.js +1 -13
- package/dist/lib/state-health.d.ts +1 -4
- package/dist/lib/state-health.js +1 -132
- package/dist/lib/state-io.d.ts +1 -10
- package/dist/lib/state-io.js +1 -76
- package/dist/lib/state-paths.d.ts +1 -4
- package/dist/lib/state-paths.js +1 -13
- package/dist/lib/state-view.d.ts +1 -4
- package/dist/lib/state-view.js +1 -103
- package/dist/lib/state.d.ts +1 -6
- package/dist/lib/state.js +1 -5
- package/dist/lib/test-execution.d.ts +1 -14
- package/dist/lib/test-execution.js +3 -525
- package/dist/lib/test-matrices.d.ts +1 -90
- package/dist/lib/test-matrices.js +3 -96
- package/dist/lib/test-paths.d.ts +1 -12
- package/dist/lib/test-paths.js +3 -59
- package/dist/lib/test-profile-presets.d.ts +1 -57
- package/dist/lib/test-profile-presets.js +3 -50
- package/dist/lib/test-sandbox.d.ts +1 -11
- package/dist/lib/test-sandbox.js +3 -105
- package/dist/lib/test-specs.d.ts +1 -7
- package/dist/lib/test-specs.js +3 -114
- package/dist/lib/test-targets.d.ts +1 -5
- package/dist/lib/test-targets.js +3 -38
- package/dist/lib/test-types.d.ts +1 -17
- package/dist/lib/test-types.js +3 -1
- package/dist/lib/test.d.ts +1 -4
- package/dist/lib/test.js +3 -3
- package/dist/lib/validate-compiled.d.ts +1 -27
- package/dist/lib/validate-compiled.js +1 -238
- package/dist/lib/validate-helpers.d.ts +1 -12
- package/dist/lib/validate-helpers.js +1 -41
- package/dist/lib/validate.d.ts +1 -19
- package/dist/lib/validate.js +1 -256
- package/dist/lib/workflow-authoring.d.ts +1 -0
- package/dist/lib/workflow-authoring.js +1 -0
- package/dist/lib/workflow-definitions.d.ts +1 -68
- package/dist/lib/workflow-definitions.js +1 -206
- package/dist/lib/workflow-edit-session.d.ts +1 -0
- package/dist/lib/workflow-edit-session.js +1 -0
- package/dist/lib/workflow-edit-utils.d.ts +1 -0
- package/dist/lib/workflow-edit-utils.js +1 -0
- package/dist/lib/workflow-helpers.d.ts +1 -38
- package/dist/lib/workflow-helpers.js +1 -167
- package/dist/lib/workflow-improvement.d.ts +1 -22
- package/dist/lib/workflow-improvement.js +1 -396
- package/dist/lib/workflow-primitives.d.ts +1 -2
- package/dist/lib/workflow-primitives.js +1 -5
- package/dist/lib/workflow-review-paths.d.ts +1 -10
- package/dist/lib/workflow-review-paths.js +1 -27
- package/dist/lib/workflow-stage-policy.d.ts +1 -0
- package/dist/lib/workflow-stage-policy.js +1 -0
- package/dist/lib/workflow-stage-runner.d.ts +1 -41
- package/dist/lib/workflow-stage-runner.js +1 -109
- package/dist/lib/workflows.d.ts +1 -15
- package/dist/lib/workflows.js +1 -31
- package/dist/packages/agents/index.d.ts +17 -0
- package/dist/packages/agents/index.js +15 -0
- package/dist/packages/agents/lib/agents.d.ts +6 -0
- package/dist/packages/agents/lib/agents.js +5 -0
- package/dist/packages/agents/lib/args.d.ts +4 -0
- package/dist/packages/agents/lib/args.js +52 -0
- package/dist/packages/agents/lib/constants.d.ts +5 -0
- package/dist/packages/agents/lib/constants.js +28 -0
- package/dist/packages/agents/lib/detection.d.ts +7 -0
- package/dist/packages/agents/lib/detection.js +65 -0
- package/dist/packages/agents/lib/execution-profile.d.ts +17 -0
- package/dist/packages/agents/lib/execution-profile.js +84 -0
- package/dist/packages/agents/lib/execution.d.ts +2 -0
- package/dist/packages/agents/lib/execution.js +243 -0
- package/dist/packages/agents/lib/executors.d.ts +32 -0
- package/dist/packages/agents/lib/executors.js +45 -0
- package/dist/packages/agents/lib/logs.d.ts +2 -0
- package/dist/packages/agents/lib/logs.js +17 -0
- package/dist/packages/agents/lib/preflight.d.ts +7 -0
- package/dist/packages/agents/lib/preflight.js +77 -0
- package/dist/packages/agents/lib/render.d.ts +8 -0
- package/dist/packages/agents/lib/render.js +218 -0
- package/dist/packages/agents/lib/schema.d.ts +8 -0
- package/dist/packages/agents/lib/schema.js +7 -0
- package/dist/packages/agents/lib/shells.d.ts +69 -0
- package/dist/packages/agents/lib/shells.js +1021 -0
- package/dist/packages/agents/lib/status.d.ts +3 -0
- package/dist/packages/agents/lib/status.js +58 -0
- package/dist/packages/agents/lib/types.d.ts +30 -0
- package/dist/packages/agents/lib/types.js +1 -0
- package/dist/{lib → packages/agents/lib}/user-config.d.ts +1 -0
- package/dist/{lib → packages/agents/lib}/user-config.js +3 -2
- package/dist/packages/compiler/compiled-compile.d.ts +48 -0
- package/dist/packages/compiler/compiled-compile.js +256 -0
- package/dist/packages/compiler/compiled-schema.d.ts +31 -0
- package/dist/packages/compiler/compiled-schema.js +141 -0
- package/dist/packages/compiler/index.d.ts +24 -0
- package/dist/packages/compiler/index.js +23 -0
- package/dist/packages/compiler/lib/schema.d.ts +684 -0
- package/dist/packages/compiler/lib/schema.js +361 -0
- package/dist/packages/compiler/runtime-acceptance.d.ts +9 -0
- package/dist/packages/compiler/runtime-acceptance.js +269 -0
- package/dist/packages/compiler/runtime-contracts.d.ts +2 -0
- package/dist/packages/compiler/runtime-contracts.js +48 -0
- package/dist/packages/compiler/runtime-inventory.d.ts +7 -0
- package/dist/packages/compiler/runtime-inventory.js +29 -0
- package/dist/packages/compiler/runtime-paths.d.ts +8 -0
- package/dist/packages/compiler/runtime-paths.js +26 -0
- package/dist/packages/compiler/runtime-prompt.d.ts +2 -0
- package/dist/packages/compiler/runtime-prompt.js +48 -0
- package/dist/packages/compiler/runtime-reconcile.d.ts +2 -0
- package/dist/packages/compiler/runtime-reconcile.js +193 -0
- package/dist/packages/compiler/runtime-runs.d.ts +11 -0
- package/dist/packages/compiler/runtime-runs.js +262 -0
- package/dist/packages/compiler/runtime-types.d.ts +43 -0
- package/dist/packages/compiler/runtime-types.js +1 -0
- package/dist/packages/compiler/runtime.d.ts +6 -0
- package/dist/packages/compiler/runtime.js +5 -0
- package/dist/packages/compiler/state-artifacts.d.ts +8 -0
- package/dist/packages/compiler/state-artifacts.js +13 -0
- package/dist/packages/compiler/state-health.d.ts +4 -0
- package/dist/packages/compiler/state-health.js +132 -0
- package/dist/packages/compiler/state-io.d.ts +10 -0
- package/dist/packages/compiler/state-io.js +76 -0
- package/dist/packages/compiler/state-paths.d.ts +4 -0
- package/dist/packages/compiler/state-paths.js +13 -0
- package/dist/packages/compiler/state-view.d.ts +4 -0
- package/dist/packages/compiler/state-view.js +103 -0
- package/dist/packages/compiler/state.d.ts +7 -0
- package/dist/packages/compiler/state.js +12 -0
- package/dist/packages/compiler/validate-compiled.d.ts +27 -0
- package/dist/packages/compiler/validate-compiled.js +241 -0
- package/dist/packages/compiler/validate-helpers.d.ts +12 -0
- package/dist/packages/compiler/validate-helpers.js +41 -0
- package/dist/packages/compiler/validate.d.ts +21 -0
- package/dist/packages/compiler/validate.js +249 -0
- package/dist/packages/compiler/workflow-primitives.d.ts +2 -0
- package/dist/packages/compiler/workflow-primitives.js +5 -0
- package/dist/packages/compiler/workflows.d.ts +15 -0
- package/dist/packages/compiler/workflows.js +31 -0
- package/dist/packages/project-model/compiled-paths.d.ts +40 -0
- package/dist/packages/project-model/compiled-paths.js +106 -0
- package/dist/packages/project-model/compiled-raw.d.ts +49 -0
- package/dist/packages/project-model/compiled-raw.js +102 -0
- package/dist/packages/project-model/compiled-reset.d.ts +2 -0
- package/dist/packages/project-model/compiled-reset.js +72 -0
- package/dist/packages/project-model/index.d.ts +11 -0
- package/dist/packages/project-model/index.js +10 -0
- package/dist/packages/project-model/interf-bootstrap.d.ts +3 -0
- package/dist/packages/project-model/interf-bootstrap.js +18 -0
- package/dist/packages/project-model/interf-detect.d.ts +33 -0
- package/dist/packages/project-model/interf-detect.js +176 -0
- package/dist/packages/project-model/interf-scaffold.d.ts +2 -0
- package/dist/packages/project-model/interf-scaffold.js +124 -0
- package/dist/packages/project-model/interf.d.ts +5 -0
- package/dist/packages/project-model/interf.js +4 -0
- package/dist/packages/project-model/lib/schema.d.ts +125 -0
- package/dist/packages/project-model/lib/schema.js +62 -0
- package/dist/packages/project-model/project-paths.d.ts +11 -0
- package/dist/packages/project-model/project-paths.js +32 -0
- package/dist/packages/project-model/source-config.d.ts +38 -0
- package/dist/packages/project-model/source-config.js +297 -0
- package/dist/packages/testing/index.d.ts +13 -0
- package/dist/packages/testing/index.js +10 -0
- package/dist/packages/testing/lib/schema.d.ts +261 -0
- package/dist/packages/testing/lib/schema.js +119 -0
- package/dist/packages/testing/test-execution.d.ts +14 -0
- package/dist/packages/testing/test-execution.js +525 -0
- package/dist/packages/testing/test-matrices.d.ts +90 -0
- package/dist/packages/testing/test-matrices.js +96 -0
- package/dist/packages/testing/test-paths.d.ts +12 -0
- package/dist/packages/testing/test-paths.js +59 -0
- package/dist/packages/testing/test-profile-presets.d.ts +57 -0
- package/dist/packages/testing/test-profile-presets.js +50 -0
- package/dist/packages/testing/test-sandbox.d.ts +11 -0
- package/dist/packages/testing/test-sandbox.js +105 -0
- package/dist/packages/testing/test-specs.d.ts +7 -0
- package/dist/packages/testing/test-specs.js +114 -0
- package/dist/packages/testing/test-targets.d.ts +5 -0
- package/dist/packages/testing/test-targets.js +38 -0
- package/dist/packages/testing/test-types.d.ts +16 -0
- package/dist/packages/testing/test-types.js +1 -0
- package/dist/packages/testing/test.d.ts +4 -0
- package/dist/packages/testing/test.js +3 -0
- package/dist/packages/workflow-authoring/index.d.ts +4 -0
- package/dist/packages/workflow-authoring/index.js +4 -0
- package/dist/packages/workflow-authoring/lib/workflow-edit-utils.d.ts +10 -0
- package/dist/packages/workflow-authoring/lib/workflow-edit-utils.js +39 -0
- package/dist/packages/workflow-authoring/workflow-authoring.d.ts +26 -0
- package/dist/packages/workflow-authoring/workflow-authoring.js +120 -0
- package/dist/packages/workflow-authoring/workflow-edit-session.d.ts +16 -0
- package/dist/packages/workflow-authoring/workflow-edit-session.js +57 -0
- package/dist/packages/workflow-authoring/workflow-improvement.d.ts +23 -0
- package/dist/packages/workflow-authoring/workflow-improvement.js +209 -0
- package/dist/packages/workflow-package/builtin-compiled-workflow.d.ts +38 -0
- package/dist/packages/workflow-package/builtin-compiled-workflow.js +94 -0
- package/dist/packages/workflow-package/index.d.ts +9 -0
- package/dist/packages/workflow-package/index.js +9 -0
- package/dist/packages/workflow-package/interf-workflow-package.d.ts +25 -0
- package/dist/packages/workflow-package/interf-workflow-package.js +342 -0
- package/dist/{lib/config.d.ts → packages/workflow-package/lib/package-root.d.ts} +0 -1
- package/dist/packages/workflow-package/lib/package-root.js +6 -0
- package/dist/packages/workflow-package/local-workflows.d.ts +54 -0
- package/dist/packages/workflow-package/local-workflows.js +422 -0
- package/dist/packages/workflow-package/workflow-definitions.d.ts +78 -0
- package/dist/packages/workflow-package/workflow-definitions.js +203 -0
- package/dist/packages/workflow-package/workflow-helpers.d.ts +38 -0
- package/dist/packages/workflow-package/workflow-helpers.js +167 -0
- package/dist/packages/workflow-package/workflow-review-paths.d.ts +10 -0
- package/dist/packages/workflow-package/workflow-review-paths.js +27 -0
- package/dist/packages/workflow-package/workflow-stage-policy.d.ts +5 -0
- package/dist/packages/workflow-package/workflow-stage-policy.js +31 -0
- package/dist/packages/workflow-package/workflow-stage-runner.d.ts +41 -0
- package/dist/packages/workflow-package/workflow-stage-runner.js +109 -0
- package/package.json +44 -21
- package/dist/commands/compile.d.ts +0 -15
- package/dist/commands/create-workflow-wizard.js +0 -125
- package/dist/commands/create.js +0 -162
- package/dist/commands/init.d.ts +0 -3
- package/dist/commands/test.d.ts +0 -9
- package/dist/lib/compiled-home.d.ts +0 -5
- package/dist/lib/compiled-home.js +0 -32
- package/dist/lib/config.js +0 -9
- package/dist/lib/obsidian.d.ts +0 -1
- package/dist/lib/obsidian.js +0 -15
- package/dist/lib/summarize-plan.d.ts +0 -17
- package/dist/lib/summarize-plan.js +0 -120
- /package/dist/{commands → cli/commands}/default.d.ts +0 -0
- /package/dist/{commands → cli/commands}/doctor.d.ts +0 -0
- /package/dist/{commands → cli/commands}/list.d.ts +0 -0
- /package/dist/{commands → cli/commands}/reset.d.ts +0 -0
- /package/dist/{commands → cli/commands}/status.d.ts +0 -0
- /package/dist/{commands → cli/commands}/verify.d.ts +0 -0
|
@@ -0,0 +1,297 @@
|
|
|
1
|
+
import { createHash } from "node:crypto";
|
|
2
|
+
import { existsSync, mkdirSync, writeFileSync } from "node:fs";
|
|
3
|
+
import { join, relative, resolve, sep } from "node:path";
|
|
4
|
+
import { readInterfConfig, refreshCompiledBootstrapGuidance, } from "./interf.js";
|
|
5
|
+
import { seedCompiledWorkflowPackage } from "../workflow-package/interf-workflow-package.js";
|
|
6
|
+
import { readJsonFileWithSchema } from "../../lib/parse.js";
|
|
7
|
+
import { getCompiledWorkflow } from "../workflow-package/workflow-definitions.js";
|
|
8
|
+
import { SourceFolderConfigSchema, } from "./lib/schema.js";
|
|
9
|
+
import { slugify } from "../../lib/util.js";
|
|
10
|
+
import { assertPathWithinRoot } from "../../lib/util.js";
|
|
11
|
+
import { defaultControlPathForCompiled, resolveSourceControlPathForCompiled, compiledInterfConfigPath, compiledInterfRoot, } from "./compiled-paths.js";
|
|
12
|
+
export const SOURCE_FOLDER_CONFIG_FILE = "interf.json";
|
|
13
|
+
function sourceConfigPath(sourcePath) {
|
|
14
|
+
return join(sourcePath, SOURCE_FOLDER_CONFIG_FILE);
|
|
15
|
+
}
|
|
16
|
+
function normalizeTruthChecks(cases) {
|
|
17
|
+
const seen = new Set();
|
|
18
|
+
return cases.map((caseSpec, index) => {
|
|
19
|
+
const baseId = slugify(caseSpec.id ?? caseSpec.question) || `check-${index + 1}`;
|
|
20
|
+
let id = baseId;
|
|
21
|
+
let suffix = 2;
|
|
22
|
+
while (seen.has(id)) {
|
|
23
|
+
id = `${baseId}-${suffix}`;
|
|
24
|
+
suffix += 1;
|
|
25
|
+
}
|
|
26
|
+
seen.add(id);
|
|
27
|
+
return {
|
|
28
|
+
id,
|
|
29
|
+
question: caseSpec.question.trim(),
|
|
30
|
+
...(caseSpec.answer ? { answer: caseSpec.answer.trim() } : {}),
|
|
31
|
+
...(caseSpec.strictness ? { strictness: caseSpec.strictness.trim() } : {}),
|
|
32
|
+
...(caseSpec.expect ? { expect: caseSpec.expect } : {}),
|
|
33
|
+
};
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
export function fingerprintTruthChecks(checks) {
|
|
37
|
+
const normalized = checks.map((check) => ({
|
|
38
|
+
question: check.question.trim(),
|
|
39
|
+
...(check.answer ? { answer: check.answer.trim() } : {}),
|
|
40
|
+
...(check.strictness ? { strictness: check.strictness.trim() } : {}),
|
|
41
|
+
...(check.expect ? { expect: check.expect } : {}),
|
|
42
|
+
}));
|
|
43
|
+
return createHash("sha256")
|
|
44
|
+
.update(JSON.stringify(normalized))
|
|
45
|
+
.digest("hex")
|
|
46
|
+
.slice(0, 16);
|
|
47
|
+
}
|
|
48
|
+
export function loadSourceFolderConfig(sourcePath) {
|
|
49
|
+
const filePath = sourceConfigPath(sourcePath);
|
|
50
|
+
if (!existsSync(filePath))
|
|
51
|
+
return null;
|
|
52
|
+
return readJsonFileWithSchema(filePath, "Interf project config", SourceFolderConfigSchema);
|
|
53
|
+
}
|
|
54
|
+
export function listSourceDatasetConfigs(config) {
|
|
55
|
+
return config?.datasets ?? [];
|
|
56
|
+
}
|
|
57
|
+
export function resolveDatasetCompileMaxAttempts(datasetConfig, override = null) {
|
|
58
|
+
const configured = override ?? datasetConfig.max_attempts ?? null;
|
|
59
|
+
if (configured == null)
|
|
60
|
+
return null;
|
|
61
|
+
const normalized = Math.trunc(configured);
|
|
62
|
+
if (!Number.isFinite(normalized) || normalized < 1)
|
|
63
|
+
return 1;
|
|
64
|
+
return Math.min(5, normalized);
|
|
65
|
+
}
|
|
66
|
+
export function resolveDatasetCompileMaxLoops(datasetConfig, override = null) {
|
|
67
|
+
const configured = override ?? datasetConfig.max_loops ?? null;
|
|
68
|
+
if (configured == null)
|
|
69
|
+
return null;
|
|
70
|
+
const normalized = Math.trunc(configured);
|
|
71
|
+
if (!Number.isFinite(normalized) || normalized < 1)
|
|
72
|
+
return 1;
|
|
73
|
+
return Math.min(3, normalized);
|
|
74
|
+
}
|
|
75
|
+
export function getDefaultSourceDatasetConfig(config) {
|
|
76
|
+
const datasets = listSourceDatasetConfigs(config);
|
|
77
|
+
return datasets[0] ?? null;
|
|
78
|
+
}
|
|
79
|
+
export function findSourceDatasetConfig(config, datasetName) {
|
|
80
|
+
return listSourceDatasetConfigs(config).find((dataset) => dataset.name === datasetName) ?? null;
|
|
81
|
+
}
|
|
82
|
+
function toWritableSourceProjectConfig(config) {
|
|
83
|
+
const datasets = config?.datasets ?? [];
|
|
84
|
+
if (datasets.length > 0) {
|
|
85
|
+
return {
|
|
86
|
+
datasets: datasets.map((dataset) => toWritableSourceDatasetConfig(dataset)),
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
return {};
|
|
90
|
+
}
|
|
91
|
+
function toWritableSourceDatasetConfig(dataset) {
|
|
92
|
+
return {
|
|
93
|
+
name: dataset.name,
|
|
94
|
+
path: dataset.path,
|
|
95
|
+
...(dataset.about ? { about: dataset.about } : {}),
|
|
96
|
+
...(dataset.workflow && dataset.workflow !== "interf" ? { workflow: dataset.workflow } : {}),
|
|
97
|
+
...(typeof dataset.max_attempts === "number" ? { max_attempts: dataset.max_attempts } : {}),
|
|
98
|
+
...(typeof dataset.max_loops === "number" ? { max_loops: dataset.max_loops } : {}),
|
|
99
|
+
checks: dataset.checks,
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
export function saveSourceFolderConfig(sourcePath, config) {
|
|
103
|
+
writeFileSync(sourceConfigPath(sourcePath), JSON.stringify(toWritableSourceProjectConfig(config), null, 2) + "\n");
|
|
104
|
+
}
|
|
105
|
+
export function appendSourceDatasetChecks(sourcePath, datasetName, checks) {
|
|
106
|
+
const existing = loadSourceFolderConfig(sourcePath);
|
|
107
|
+
const currentDataset = findSourceDatasetConfig(existing, datasetName);
|
|
108
|
+
const otherDatasets = listSourceDatasetConfigs(existing).filter((dataset) => dataset.name !== datasetName);
|
|
109
|
+
const currentChecks = currentDataset?.checks ?? [];
|
|
110
|
+
const nextDataset = {
|
|
111
|
+
...toWritableSourceDatasetConfig(currentDataset ?? {
|
|
112
|
+
name: datasetName,
|
|
113
|
+
path: `./${datasetName}`,
|
|
114
|
+
checks: [],
|
|
115
|
+
}),
|
|
116
|
+
checks: [...currentChecks, ...checks],
|
|
117
|
+
};
|
|
118
|
+
saveSourceFolderConfig(sourcePath, {
|
|
119
|
+
datasets: [
|
|
120
|
+
nextDataset,
|
|
121
|
+
...otherDatasets,
|
|
122
|
+
],
|
|
123
|
+
});
|
|
124
|
+
}
|
|
125
|
+
export function upsertSourceDatasetConfig(sourcePath, datasetConfig, options = {}) {
|
|
126
|
+
const existing = loadSourceFolderConfig(sourcePath);
|
|
127
|
+
const datasets = listSourceDatasetConfigs(existing);
|
|
128
|
+
const candidateNames = Array.from(new Set([datasetConfig.name, options.matchName].filter((value) => Boolean(value))));
|
|
129
|
+
const existingIndex = datasets.findIndex((entry) => candidateNames.includes(entry.name));
|
|
130
|
+
if (existingIndex >= 0) {
|
|
131
|
+
datasets[existingIndex] = datasetConfig;
|
|
132
|
+
}
|
|
133
|
+
else {
|
|
134
|
+
datasets.push(datasetConfig);
|
|
135
|
+
}
|
|
136
|
+
saveSourceFolderConfig(sourcePath, {
|
|
137
|
+
datasets,
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
export function compiledMaxAttempts(maxAttempts) {
|
|
141
|
+
if (maxAttempts == null)
|
|
142
|
+
return undefined;
|
|
143
|
+
return resolveDatasetCompileMaxAttempts({ max_attempts: maxAttempts }, null) ?? 1;
|
|
144
|
+
}
|
|
145
|
+
export function compiledMaxLoops(maxLoops) {
|
|
146
|
+
if (maxLoops == null)
|
|
147
|
+
return undefined;
|
|
148
|
+
return resolveDatasetCompileMaxLoops({ max_loops: maxLoops }, null) ?? 1;
|
|
149
|
+
}
|
|
150
|
+
export function sourceDatasetConfigFromInterfConfig(config, datasetPath = `./${config.name}`) {
|
|
151
|
+
return {
|
|
152
|
+
name: config.name,
|
|
153
|
+
path: datasetPath,
|
|
154
|
+
...(config.about ? { about: config.about } : {}),
|
|
155
|
+
...(config.workflow ? { workflow: config.workflow } : {}),
|
|
156
|
+
...(typeof config.max_attempts === "number"
|
|
157
|
+
? { max_attempts: config.max_attempts }
|
|
158
|
+
: {}),
|
|
159
|
+
...(typeof config.max_loops === "number"
|
|
160
|
+
? { max_loops: config.max_loops }
|
|
161
|
+
: {}),
|
|
162
|
+
checks: config.checks ?? [],
|
|
163
|
+
};
|
|
164
|
+
}
|
|
165
|
+
export function loadCompiledDatasetConfig(compiledPath) {
|
|
166
|
+
const config = readInterfConfig(compiledPath);
|
|
167
|
+
if (!config)
|
|
168
|
+
return null;
|
|
169
|
+
const projectPath = resolveSourceControlPathForCompiled(compiledPath);
|
|
170
|
+
const configuredDatasets = listSourceDatasetConfigs(loadSourceFolderConfig(projectPath));
|
|
171
|
+
const fallbackDatasetPath = configuredDatasets.length === 1
|
|
172
|
+
? configuredDatasets[0].path
|
|
173
|
+
: `./${config.name}`;
|
|
174
|
+
const datasetPath = typeof config.source?.dataset_path === "string" && config.source.dataset_path.length > 0
|
|
175
|
+
? relative(projectPath, assertPathWithinRoot(projectPath, resolve(compiledPath, config.source.dataset_path), "Compiled context source path")).split(sep).join("/") || fallbackDatasetPath
|
|
176
|
+
: fallbackDatasetPath;
|
|
177
|
+
return sourceDatasetConfigFromInterfConfig(config, datasetPath);
|
|
178
|
+
}
|
|
179
|
+
export function saveCompiledInterfConfig(compiledPath, config) {
|
|
180
|
+
mkdirSync(compiledInterfRoot(compiledPath), { recursive: true });
|
|
181
|
+
writeFileSync(compiledInterfConfigPath(compiledPath), JSON.stringify(config, null, 2) + "\n");
|
|
182
|
+
return config;
|
|
183
|
+
}
|
|
184
|
+
export function syncCompiledInterfConfigFromSourceDatasetConfig(compiledPath, datasetConfig) {
|
|
185
|
+
const current = readInterfConfig(compiledPath);
|
|
186
|
+
const projectPath = resolveSourceControlPathForCompiled(compiledPath);
|
|
187
|
+
const datasetAbsolutePath = resolve(projectPath, datasetConfig.path);
|
|
188
|
+
const datasetRelativePath = relative(compiledPath, datasetAbsolutePath).split(sep).join("/") || ".";
|
|
189
|
+
const workflowId = datasetConfig.workflow ?? current?.workflow ?? "interf";
|
|
190
|
+
const workflowChanged = current?.workflow !== undefined && current.workflow !== workflowId;
|
|
191
|
+
const workflowOrigin = workflowChanged || !current?.workflow_origin
|
|
192
|
+
? {
|
|
193
|
+
selected: workflowId,
|
|
194
|
+
local_draft: false,
|
|
195
|
+
}
|
|
196
|
+
: current.workflow_origin;
|
|
197
|
+
const { type: _ignoredType, name: _ignoredName, about: _ignoredAbout, workflow: _ignoredWorkflow, max_attempts: _ignoredMaxAttempts, max_loops: _ignoredMaxLoops, checks: _ignoredChecks, workflow_origin: _ignoredWorkflowOrigin, source: _ignoredSource, ...passthrough } = current ?? {};
|
|
198
|
+
const nextConfig = {
|
|
199
|
+
...passthrough,
|
|
200
|
+
...(!current ? {
|
|
201
|
+
type: "compiled",
|
|
202
|
+
source: {
|
|
203
|
+
path: "./raw",
|
|
204
|
+
},
|
|
205
|
+
} : {}),
|
|
206
|
+
type: "compiled",
|
|
207
|
+
name: datasetConfig.name,
|
|
208
|
+
...(datasetConfig.about ? { about: datasetConfig.about } : {}),
|
|
209
|
+
workflow: workflowId,
|
|
210
|
+
...(typeof datasetConfig.max_attempts === "number"
|
|
211
|
+
? { max_attempts: datasetConfig.max_attempts }
|
|
212
|
+
: {}),
|
|
213
|
+
...(typeof datasetConfig.max_loops === "number"
|
|
214
|
+
? { max_loops: datasetConfig.max_loops }
|
|
215
|
+
: {}),
|
|
216
|
+
checks: datasetConfig.checks,
|
|
217
|
+
workflow_origin: workflowOrigin,
|
|
218
|
+
source: {
|
|
219
|
+
path: current?.source?.path ?? "./raw",
|
|
220
|
+
control_path: defaultControlPathForCompiled(compiledPath),
|
|
221
|
+
dataset_path: datasetRelativePath,
|
|
222
|
+
},
|
|
223
|
+
};
|
|
224
|
+
const saved = saveCompiledInterfConfig(compiledPath, nextConfig);
|
|
225
|
+
if (workflowChanged) {
|
|
226
|
+
const sourcePath = projectPath;
|
|
227
|
+
const selectedWorkflow = getCompiledWorkflow(workflowId, { sourcePath });
|
|
228
|
+
seedCompiledWorkflowPackage({
|
|
229
|
+
compiledPath,
|
|
230
|
+
sourcePath,
|
|
231
|
+
workflowId: selectedWorkflow.id,
|
|
232
|
+
});
|
|
233
|
+
}
|
|
234
|
+
refreshCompiledBootstrapGuidance(compiledPath);
|
|
235
|
+
return saved;
|
|
236
|
+
}
|
|
237
|
+
function buildLoadedTestSpec(options) {
|
|
238
|
+
if (options.checks.length === 0)
|
|
239
|
+
return null;
|
|
240
|
+
const testId = options.id ?? slugify(options.name);
|
|
241
|
+
return {
|
|
242
|
+
id: options.targetType === "raw" ? `${testId}-raw` : testId,
|
|
243
|
+
filePath: options.filePath,
|
|
244
|
+
type: options.targetType,
|
|
245
|
+
name: options.name,
|
|
246
|
+
description: options.about ?? options.fallbackDescription,
|
|
247
|
+
cases: normalizeTruthChecks(options.checks),
|
|
248
|
+
};
|
|
249
|
+
}
|
|
250
|
+
export function buildTestSpecFromSourceFolderConfig(options) {
|
|
251
|
+
const { sourcePath, targetName, targetType = "compiled" } = options;
|
|
252
|
+
const config = loadSourceFolderConfig(sourcePath);
|
|
253
|
+
if (!config)
|
|
254
|
+
return null;
|
|
255
|
+
const datasets = listSourceDatasetConfigs(config);
|
|
256
|
+
if (datasets.length === 0)
|
|
257
|
+
return null;
|
|
258
|
+
const match = targetName
|
|
259
|
+
? datasets.find((entry) => entry.name === targetName)
|
|
260
|
+
: datasets.length === 1
|
|
261
|
+
? datasets[0]
|
|
262
|
+
: getDefaultSourceDatasetConfig(config);
|
|
263
|
+
if (!match)
|
|
264
|
+
return null;
|
|
265
|
+
const configPath = sourceConfigPath(sourcePath);
|
|
266
|
+
return buildLoadedTestSpec({
|
|
267
|
+
id: match.id,
|
|
268
|
+
name: match.name,
|
|
269
|
+
about: match.about,
|
|
270
|
+
checks: match.checks,
|
|
271
|
+
targetType,
|
|
272
|
+
filePath: targetType === "raw"
|
|
273
|
+
? `${configPath}#datasets/${match.name}:file-as-is`
|
|
274
|
+
: `${configPath}#datasets/${match.name}:compiled`,
|
|
275
|
+
fallbackDescription: `Derived from saved dataset checks in ${SOURCE_FOLDER_CONFIG_FILE}`,
|
|
276
|
+
});
|
|
277
|
+
}
|
|
278
|
+
export function buildTestSpecFromCompiledDatasetConfig(options) {
|
|
279
|
+
const { compiledPath, targetType = "compiled" } = options;
|
|
280
|
+
const config = readInterfConfig(compiledPath);
|
|
281
|
+
const configPath = compiledInterfConfigPath(compiledPath);
|
|
282
|
+
if (!config)
|
|
283
|
+
return null;
|
|
284
|
+
return buildLoadedTestSpec({
|
|
285
|
+
name: config.name,
|
|
286
|
+
about: config.about,
|
|
287
|
+
checks: config.checks ?? [],
|
|
288
|
+
targetType,
|
|
289
|
+
filePath: targetType === "raw"
|
|
290
|
+
? `${configPath}#checks:file-as-is`
|
|
291
|
+
: `${configPath}#checks:compiled`,
|
|
292
|
+
fallbackDescription: "Derived from checks in the compiled context config.",
|
|
293
|
+
});
|
|
294
|
+
}
|
|
295
|
+
export function resolveSourceDatasetPath(projectPath, datasetConfig) {
|
|
296
|
+
return assertPathWithinRoot(projectPath, resolve(projectPath, datasetConfig.path), "Dataset path");
|
|
297
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export * as schema from "./lib/schema.js";
|
|
2
|
+
export * as test from "./test.js";
|
|
3
|
+
export * as execution from "./test-execution.js";
|
|
4
|
+
export * as matrices from "./test-matrices.js";
|
|
5
|
+
export * as paths from "./test-paths.js";
|
|
6
|
+
export * as profilePresets from "./test-profile-presets.js";
|
|
7
|
+
export * as sandbox from "./test-sandbox.js";
|
|
8
|
+
export * as specs from "./test-specs.js";
|
|
9
|
+
export * as targets from "./test-targets.js";
|
|
10
|
+
export * as types from "./test-types.js";
|
|
11
|
+
export type { TestCase, TestCaseExpect, TestCheckResult, TestCaseResult, TestSpec, TestTargetResult, TestTargetRun, TestRunComparison, TestTargetType, } from "./lib/schema.js";
|
|
12
|
+
export type { LoadedTestSpec, TestTargetCandidate, } from "./test-types.js";
|
|
13
|
+
export type { TestSandboxRetentionMode, } from "./test-sandbox.js";
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export * as schema from "./lib/schema.js";
|
|
2
|
+
export * as test from "./test.js";
|
|
3
|
+
export * as execution from "./test-execution.js";
|
|
4
|
+
export * as matrices from "./test-matrices.js";
|
|
5
|
+
export * as paths from "./test-paths.js";
|
|
6
|
+
export * as profilePresets from "./test-profile-presets.js";
|
|
7
|
+
export * as sandbox from "./test-sandbox.js";
|
|
8
|
+
export * as specs from "./test-specs.js";
|
|
9
|
+
export * as targets from "./test-targets.js";
|
|
10
|
+
export * as types from "./test-types.js";
|
|
@@ -0,0 +1,261 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { type TestCaseExpect, type TestTargetType } from "../../compiler/lib/schema.js";
|
|
3
|
+
export declare const TestCaseSchema: z.ZodObject<{
|
|
4
|
+
id: z.ZodString;
|
|
5
|
+
question: z.ZodString;
|
|
6
|
+
file: z.ZodOptional<z.ZodString>;
|
|
7
|
+
answer: z.ZodOptional<z.ZodString>;
|
|
8
|
+
expect: z.ZodOptional<z.ZodObject<{
|
|
9
|
+
must_include: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
10
|
+
must_include_one_of: z.ZodOptional<z.ZodArray<z.ZodArray<z.ZodString>>>;
|
|
11
|
+
must_not_include: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
12
|
+
min_words: z.ZodOptional<z.ZodNumber>;
|
|
13
|
+
max_words: z.ZodOptional<z.ZodNumber>;
|
|
14
|
+
}, z.core.$strip>>;
|
|
15
|
+
strictness: z.ZodOptional<z.ZodString>;
|
|
16
|
+
}, z.core.$strip>;
|
|
17
|
+
export declare const TestSpecSchema: z.ZodObject<{
|
|
18
|
+
type: z.ZodEnum<{
|
|
19
|
+
compiled: "compiled";
|
|
20
|
+
raw: "raw";
|
|
21
|
+
}>;
|
|
22
|
+
name: z.ZodString;
|
|
23
|
+
description: z.ZodOptional<z.ZodString>;
|
|
24
|
+
cases: z.ZodArray<z.ZodObject<{
|
|
25
|
+
id: z.ZodString;
|
|
26
|
+
question: z.ZodString;
|
|
27
|
+
file: z.ZodOptional<z.ZodString>;
|
|
28
|
+
answer: z.ZodOptional<z.ZodString>;
|
|
29
|
+
expect: z.ZodOptional<z.ZodObject<{
|
|
30
|
+
must_include: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
31
|
+
must_include_one_of: z.ZodOptional<z.ZodArray<z.ZodArray<z.ZodString>>>;
|
|
32
|
+
must_not_include: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
33
|
+
min_words: z.ZodOptional<z.ZodNumber>;
|
|
34
|
+
max_words: z.ZodOptional<z.ZodNumber>;
|
|
35
|
+
}, z.core.$strip>>;
|
|
36
|
+
strictness: z.ZodOptional<z.ZodString>;
|
|
37
|
+
}, z.core.$strip>>;
|
|
38
|
+
}, z.core.$strip>;
|
|
39
|
+
export declare const TestCheckResultSchema: z.ZodObject<{
|
|
40
|
+
label: z.ZodString;
|
|
41
|
+
ok: z.ZodBoolean;
|
|
42
|
+
detail: z.ZodString;
|
|
43
|
+
}, z.core.$strip>;
|
|
44
|
+
export declare const TestCaseResultSchema: z.ZodObject<{
|
|
45
|
+
caseId: z.ZodString;
|
|
46
|
+
question: z.ZodString;
|
|
47
|
+
file: z.ZodOptional<z.ZodString>;
|
|
48
|
+
ok: z.ZodBoolean;
|
|
49
|
+
wordCount: z.ZodNumber;
|
|
50
|
+
passedChecks: z.ZodNumber;
|
|
51
|
+
totalChecks: z.ZodNumber;
|
|
52
|
+
checks: z.ZodArray<z.ZodObject<{
|
|
53
|
+
label: z.ZodString;
|
|
54
|
+
ok: z.ZodBoolean;
|
|
55
|
+
detail: z.ZodString;
|
|
56
|
+
}, z.core.$strip>>;
|
|
57
|
+
answer: z.ZodOptional<z.ZodString>;
|
|
58
|
+
trace: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
59
|
+
}, z.core.$strip>;
|
|
60
|
+
export declare const TestTargetResultSchema: z.ZodObject<{
|
|
61
|
+
target: z.ZodObject<{
|
|
62
|
+
type: z.ZodEnum<{
|
|
63
|
+
compiled: "compiled";
|
|
64
|
+
raw: "raw";
|
|
65
|
+
}>;
|
|
66
|
+
name: z.ZodString;
|
|
67
|
+
path: z.ZodString;
|
|
68
|
+
workflow: z.ZodString;
|
|
69
|
+
}, z.core.$strip>;
|
|
70
|
+
sandbox_path: z.ZodOptional<z.ZodString>;
|
|
71
|
+
ok: z.ZodBoolean;
|
|
72
|
+
passedCases: z.ZodNumber;
|
|
73
|
+
totalCases: z.ZodNumber;
|
|
74
|
+
passedChecks: z.ZodNumber;
|
|
75
|
+
totalChecks: z.ZodNumber;
|
|
76
|
+
caseResults: z.ZodArray<z.ZodObject<{
|
|
77
|
+
caseId: z.ZodString;
|
|
78
|
+
question: z.ZodString;
|
|
79
|
+
file: z.ZodOptional<z.ZodString>;
|
|
80
|
+
ok: z.ZodBoolean;
|
|
81
|
+
wordCount: z.ZodNumber;
|
|
82
|
+
passedChecks: z.ZodNumber;
|
|
83
|
+
totalChecks: z.ZodNumber;
|
|
84
|
+
checks: z.ZodArray<z.ZodObject<{
|
|
85
|
+
label: z.ZodString;
|
|
86
|
+
ok: z.ZodBoolean;
|
|
87
|
+
detail: z.ZodString;
|
|
88
|
+
}, z.core.$strip>>;
|
|
89
|
+
answer: z.ZodOptional<z.ZodString>;
|
|
90
|
+
trace: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
91
|
+
}, z.core.$strip>>;
|
|
92
|
+
}, z.core.$strip>;
|
|
93
|
+
export declare const TestTargetRunSchema: z.ZodObject<{
|
|
94
|
+
kind: z.ZodLiteral<"interf-test-target-run">;
|
|
95
|
+
version: z.ZodLiteral<1>;
|
|
96
|
+
generated_at: z.ZodString;
|
|
97
|
+
spec: z.ZodObject<{
|
|
98
|
+
id: z.ZodString;
|
|
99
|
+
name: z.ZodString;
|
|
100
|
+
type: z.ZodEnum<{
|
|
101
|
+
compiled: "compiled";
|
|
102
|
+
raw: "raw";
|
|
103
|
+
}>;
|
|
104
|
+
file: z.ZodString;
|
|
105
|
+
description: z.ZodOptional<z.ZodString>;
|
|
106
|
+
case_count: z.ZodNumber;
|
|
107
|
+
cases: z.ZodArray<z.ZodObject<{
|
|
108
|
+
id: z.ZodString;
|
|
109
|
+
question: z.ZodString;
|
|
110
|
+
file: z.ZodOptional<z.ZodString>;
|
|
111
|
+
answer: z.ZodOptional<z.ZodString>;
|
|
112
|
+
strictness: z.ZodOptional<z.ZodString>;
|
|
113
|
+
expect: z.ZodOptional<z.ZodObject<{
|
|
114
|
+
must_include: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
115
|
+
must_include_one_of: z.ZodOptional<z.ZodArray<z.ZodArray<z.ZodString>>>;
|
|
116
|
+
must_not_include: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
117
|
+
min_words: z.ZodOptional<z.ZodNumber>;
|
|
118
|
+
max_words: z.ZodOptional<z.ZodNumber>;
|
|
119
|
+
}, z.core.$strip>>;
|
|
120
|
+
}, z.core.$strip>>;
|
|
121
|
+
}, z.core.$strip>;
|
|
122
|
+
source_path: z.ZodString;
|
|
123
|
+
executor: z.ZodOptional<z.ZodObject<{
|
|
124
|
+
kind: z.ZodEnum<{
|
|
125
|
+
"local-agent": "local-agent";
|
|
126
|
+
"connected-provider": "connected-provider";
|
|
127
|
+
managed: "managed";
|
|
128
|
+
}>;
|
|
129
|
+
name: z.ZodString;
|
|
130
|
+
display_name: z.ZodString;
|
|
131
|
+
command: z.ZodNullable<z.ZodString>;
|
|
132
|
+
model: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
133
|
+
effort: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
134
|
+
profile: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
135
|
+
timeout_ms: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
136
|
+
}, z.core.$strip>>;
|
|
137
|
+
target_count: z.ZodNumber;
|
|
138
|
+
results: z.ZodArray<z.ZodObject<{
|
|
139
|
+
target: z.ZodObject<{
|
|
140
|
+
type: z.ZodEnum<{
|
|
141
|
+
compiled: "compiled";
|
|
142
|
+
raw: "raw";
|
|
143
|
+
}>;
|
|
144
|
+
name: z.ZodString;
|
|
145
|
+
path: z.ZodString;
|
|
146
|
+
workflow: z.ZodString;
|
|
147
|
+
}, z.core.$strip>;
|
|
148
|
+
sandbox_path: z.ZodOptional<z.ZodString>;
|
|
149
|
+
ok: z.ZodBoolean;
|
|
150
|
+
passedCases: z.ZodNumber;
|
|
151
|
+
totalCases: z.ZodNumber;
|
|
152
|
+
passedChecks: z.ZodNumber;
|
|
153
|
+
totalChecks: z.ZodNumber;
|
|
154
|
+
caseResults: z.ZodArray<z.ZodObject<{
|
|
155
|
+
caseId: z.ZodString;
|
|
156
|
+
question: z.ZodString;
|
|
157
|
+
file: z.ZodOptional<z.ZodString>;
|
|
158
|
+
ok: z.ZodBoolean;
|
|
159
|
+
wordCount: z.ZodNumber;
|
|
160
|
+
passedChecks: z.ZodNumber;
|
|
161
|
+
totalChecks: z.ZodNumber;
|
|
162
|
+
checks: z.ZodArray<z.ZodObject<{
|
|
163
|
+
label: z.ZodString;
|
|
164
|
+
ok: z.ZodBoolean;
|
|
165
|
+
detail: z.ZodString;
|
|
166
|
+
}, z.core.$strip>>;
|
|
167
|
+
answer: z.ZodOptional<z.ZodString>;
|
|
168
|
+
trace: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
169
|
+
}, z.core.$strip>>;
|
|
170
|
+
}, z.core.$strip>>;
|
|
171
|
+
}, z.core.$strip>;
|
|
172
|
+
export declare const TestRunModeSchema: z.ZodEnum<{
|
|
173
|
+
compiled: "compiled";
|
|
174
|
+
raw: "raw";
|
|
175
|
+
both: "both";
|
|
176
|
+
}>;
|
|
177
|
+
export declare const TestRunTargetSummarySchema: z.ZodObject<{
|
|
178
|
+
label: z.ZodString;
|
|
179
|
+
run_path: z.ZodString;
|
|
180
|
+
ok: z.ZodBoolean;
|
|
181
|
+
passed_cases: z.ZodNumber;
|
|
182
|
+
total_cases: z.ZodNumber;
|
|
183
|
+
passed_checks: z.ZodNumber;
|
|
184
|
+
total_checks: z.ZodNumber;
|
|
185
|
+
target: z.ZodObject<{
|
|
186
|
+
type: z.ZodEnum<{
|
|
187
|
+
compiled: "compiled";
|
|
188
|
+
raw: "raw";
|
|
189
|
+
}>;
|
|
190
|
+
name: z.ZodString;
|
|
191
|
+
path: z.ZodString;
|
|
192
|
+
workflow: z.ZodString;
|
|
193
|
+
}, z.core.$strip>;
|
|
194
|
+
}, z.core.$strip>;
|
|
195
|
+
export declare const TestRunComparisonSchema: z.ZodObject<{
|
|
196
|
+
kind: z.ZodLiteral<"interf-test-run">;
|
|
197
|
+
version: z.ZodLiteral<1>;
|
|
198
|
+
generated_at: z.ZodString;
|
|
199
|
+
mode: z.ZodEnum<{
|
|
200
|
+
compiled: "compiled";
|
|
201
|
+
raw: "raw";
|
|
202
|
+
both: "both";
|
|
203
|
+
}>;
|
|
204
|
+
source_path: z.ZodString;
|
|
205
|
+
checks_fingerprint: z.ZodOptional<z.ZodString>;
|
|
206
|
+
dataset: z.ZodObject<{
|
|
207
|
+
name: z.ZodString;
|
|
208
|
+
compiled_path: z.ZodNullable<z.ZodString>;
|
|
209
|
+
}, z.core.$strip>;
|
|
210
|
+
raw: z.ZodNullable<z.ZodObject<{
|
|
211
|
+
label: z.ZodString;
|
|
212
|
+
run_path: z.ZodString;
|
|
213
|
+
ok: z.ZodBoolean;
|
|
214
|
+
passed_cases: z.ZodNumber;
|
|
215
|
+
total_cases: z.ZodNumber;
|
|
216
|
+
passed_checks: z.ZodNumber;
|
|
217
|
+
total_checks: z.ZodNumber;
|
|
218
|
+
target: z.ZodObject<{
|
|
219
|
+
type: z.ZodEnum<{
|
|
220
|
+
compiled: "compiled";
|
|
221
|
+
raw: "raw";
|
|
222
|
+
}>;
|
|
223
|
+
name: z.ZodString;
|
|
224
|
+
path: z.ZodString;
|
|
225
|
+
workflow: z.ZodString;
|
|
226
|
+
}, z.core.$strip>;
|
|
227
|
+
}, z.core.$strip>>;
|
|
228
|
+
compiled: z.ZodNullable<z.ZodObject<{
|
|
229
|
+
label: z.ZodString;
|
|
230
|
+
run_path: z.ZodString;
|
|
231
|
+
ok: z.ZodBoolean;
|
|
232
|
+
passed_cases: z.ZodNumber;
|
|
233
|
+
total_cases: z.ZodNumber;
|
|
234
|
+
passed_checks: z.ZodNumber;
|
|
235
|
+
total_checks: z.ZodNumber;
|
|
236
|
+
target: z.ZodObject<{
|
|
237
|
+
type: z.ZodEnum<{
|
|
238
|
+
compiled: "compiled";
|
|
239
|
+
raw: "raw";
|
|
240
|
+
}>;
|
|
241
|
+
name: z.ZodString;
|
|
242
|
+
path: z.ZodString;
|
|
243
|
+
workflow: z.ZodString;
|
|
244
|
+
}, z.core.$strip>;
|
|
245
|
+
}, z.core.$strip>>;
|
|
246
|
+
summary: z.ZodObject<{
|
|
247
|
+
raw_pass_rate: z.ZodNullable<z.ZodNumber>;
|
|
248
|
+
compiled_pass_rate: z.ZodNullable<z.ZodNumber>;
|
|
249
|
+
pass_rate_delta: z.ZodNullable<z.ZodNumber>;
|
|
250
|
+
}, z.core.$strip>;
|
|
251
|
+
}, z.core.$strip>;
|
|
252
|
+
export type { TestCaseExpect, TestTargetType };
|
|
253
|
+
export type TestCase = z.infer<typeof TestCaseSchema>;
|
|
254
|
+
export type TestSpec = z.infer<typeof TestSpecSchema>;
|
|
255
|
+
export type TestCheckResult = z.infer<typeof TestCheckResultSchema>;
|
|
256
|
+
export type TestCaseResult = z.infer<typeof TestCaseResultSchema>;
|
|
257
|
+
export type TestTargetResult = z.infer<typeof TestTargetResultSchema>;
|
|
258
|
+
export type TestTargetRun = z.infer<typeof TestTargetRunSchema>;
|
|
259
|
+
export type TestRunMode = z.infer<typeof TestRunModeSchema>;
|
|
260
|
+
export type TestRunTargetSummary = z.infer<typeof TestRunTargetSummarySchema>;
|
|
261
|
+
export type TestRunComparison = z.infer<typeof TestRunComparisonSchema>;
|