@interf/compiler 0.3.4 → 0.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +128 -149
- package/builtin-workflows/interf/README.md +19 -0
- package/builtin-workflows/interf/compile/stages/shape/SKILL.md +28 -0
- package/builtin-workflows/interf/compile/stages/structure/SKILL.md +18 -0
- package/builtin-workflows/interf/compile/stages/summarize/SKILL.md +18 -0
- package/builtin-workflows/interf/improve/SKILL.md +18 -0
- package/builtin-workflows/interf/use/query/SKILL.md +28 -0
- package/builtin-workflows/interf/workflow.json +120 -0
- package/builtin-workflows/interf/workspace.schema.json +75 -0
- package/dist/bin.d.ts +0 -1
- package/dist/bin.js +0 -1
- package/dist/commands/compile-controller.d.ts +14 -0
- package/dist/commands/compile-controller.js +409 -0
- package/dist/commands/compile.d.ts +8 -9
- package/dist/commands/compile.js +151 -153
- package/dist/commands/create-workflow-wizard.d.ts +4 -2
- package/dist/commands/create-workflow-wizard.js +33 -31
- package/dist/commands/create.d.ts +0 -1
- package/dist/commands/create.js +15 -11
- package/dist/commands/default.d.ts +0 -1
- package/dist/commands/default.js +0 -1
- package/dist/commands/doctor.d.ts +0 -1
- package/dist/commands/doctor.js +1 -16
- package/dist/commands/executor-flow.d.ts +0 -1
- package/dist/commands/executor-flow.js +0 -1
- package/dist/commands/init.d.ts +0 -1
- package/dist/commands/init.js +71 -14
- package/dist/commands/list.d.ts +0 -1
- package/dist/commands/list.js +0 -1
- package/dist/commands/reset.d.ts +0 -1
- package/dist/commands/reset.js +0 -1
- package/dist/commands/source-config-wizard.d.ts +28 -7
- package/dist/commands/source-config-wizard.js +159 -63
- package/dist/commands/status.d.ts +0 -1
- package/dist/commands/status.js +0 -1
- package/dist/commands/test-flow.d.ts +20 -10
- package/dist/commands/test-flow.js +89 -23
- package/dist/commands/test.d.ts +0 -1
- package/dist/commands/test.js +36 -72
- package/dist/commands/verify.d.ts +0 -1
- package/dist/commands/verify.js +0 -1
- package/dist/commands/workspace-flow.d.ts +3 -3
- package/dist/commands/workspace-flow.js +30 -12
- package/dist/index.d.ts +5 -6
- package/dist/index.js +3 -4
- package/dist/lib/agent-args.d.ts +0 -1
- package/dist/lib/agent-args.js +0 -1
- package/dist/lib/agent-constants.d.ts +0 -1
- package/dist/lib/agent-constants.js +0 -1
- package/dist/lib/agent-detection.d.ts +0 -1
- package/dist/lib/agent-detection.js +0 -1
- package/dist/lib/agent-execution.d.ts +0 -1
- package/dist/lib/agent-execution.js +47 -12
- package/dist/lib/agent-logs.d.ts +0 -1
- package/dist/lib/agent-logs.js +0 -1
- package/dist/lib/agent-preflight.d.ts +0 -1
- package/dist/lib/agent-preflight.js +1 -2
- package/dist/lib/agent-render.d.ts +0 -1
- package/dist/lib/agent-render.js +0 -1
- package/dist/lib/agent-shells.d.ts +30 -3
- package/dist/lib/agent-shells.js +517 -54
- package/dist/lib/agent-status.d.ts +0 -1
- package/dist/lib/agent-status.js +0 -1
- package/dist/lib/agent-types.d.ts +0 -1
- package/dist/lib/agent-types.js +0 -1
- package/dist/lib/agents.d.ts +0 -9
- package/dist/lib/agents.js +0 -9
- package/dist/lib/chart-guidance.d.ts +1 -0
- package/dist/lib/chart-guidance.js +8 -0
- package/dist/lib/config.d.ts +0 -3
- package/dist/lib/config.js +0 -5
- package/dist/lib/discovery.d.ts +0 -1
- package/dist/lib/discovery.js +0 -1
- package/dist/lib/execution-profile.d.ts +0 -1
- package/dist/lib/execution-profile.js +0 -1
- package/dist/lib/executors.d.ts +0 -1
- package/dist/lib/executors.js +0 -1
- package/dist/lib/filesystem.d.ts +0 -1
- package/dist/lib/filesystem.js +0 -1
- package/dist/lib/interf-bootstrap.d.ts +0 -1
- package/dist/lib/interf-bootstrap.js +6 -2
- package/dist/lib/interf-detect.d.ts +2 -2
- package/dist/lib/interf-detect.js +25 -8
- package/dist/lib/interf-scaffold.d.ts +0 -1
- package/dist/lib/interf-scaffold.js +54 -21
- package/dist/lib/interf-workflow-package.d.ts +18 -1
- package/dist/lib/interf-workflow-package.js +164 -23
- package/dist/lib/interf.d.ts +1 -2
- package/dist/lib/interf.js +1 -2
- package/dist/lib/local-workflows.d.ts +10 -5
- package/dist/lib/local-workflows.js +208 -97
- package/dist/lib/logger.d.ts +0 -1
- package/dist/lib/logger.js +0 -1
- package/dist/lib/obsidian.d.ts +0 -1
- package/dist/lib/obsidian.js +0 -1
- package/dist/lib/parse.d.ts +0 -1
- package/dist/lib/parse.js +0 -1
- package/dist/lib/registry.d.ts +0 -1
- package/dist/lib/registry.js +0 -1
- package/dist/lib/runtime-acceptance.d.ts +0 -1
- package/dist/lib/runtime-acceptance.js +1 -2
- package/dist/lib/runtime-contracts.d.ts +0 -1
- package/dist/lib/runtime-contracts.js +14 -8
- package/dist/lib/runtime-paths.d.ts +0 -1
- package/dist/lib/runtime-paths.js +5 -10
- package/dist/lib/runtime-prompt.d.ts +0 -1
- package/dist/lib/runtime-prompt.js +8 -23
- package/dist/lib/runtime-reconcile.d.ts +0 -1
- package/dist/lib/runtime-reconcile.js +7 -3
- package/dist/lib/runtime-runs.d.ts +0 -1
- package/dist/lib/runtime-runs.js +4 -5
- package/dist/lib/runtime-types.d.ts +0 -1
- package/dist/lib/runtime-types.js +0 -1
- package/dist/lib/runtime.d.ts +0 -1
- package/dist/lib/runtime.js +0 -1
- package/dist/lib/schema.d.ts +356 -51
- package/dist/lib/schema.js +189 -54
- package/dist/lib/source-config.d.ts +17 -8
- package/dist/lib/source-config.js +125 -11
- package/dist/lib/state-artifacts.d.ts +0 -1
- package/dist/lib/state-artifacts.js +0 -1
- package/dist/lib/state-health.d.ts +0 -1
- package/dist/lib/state-health.js +2 -3
- package/dist/lib/state-io.d.ts +1 -1
- package/dist/lib/state-io.js +9 -10
- package/dist/lib/state-paths.d.ts +0 -1
- package/dist/lib/state-paths.js +5 -11
- package/dist/lib/state-view.d.ts +0 -1
- package/dist/lib/state-view.js +7 -8
- package/dist/lib/state.d.ts +0 -1
- package/dist/lib/state.js +0 -1
- package/dist/lib/summarize-plan.d.ts +0 -1
- package/dist/lib/summarize-plan.js +3 -3
- package/dist/lib/test-execution.d.ts +14 -0
- package/dist/lib/{benchmark-execution.js → test-execution.js} +122 -120
- package/dist/lib/test-matrices.d.ts +90 -0
- package/dist/lib/test-matrices.js +96 -0
- package/dist/lib/test-paths.d.ts +12 -0
- package/dist/lib/test-paths.js +44 -0
- package/dist/lib/test-profile-presets.d.ts +57 -0
- package/dist/lib/test-profile-presets.js +50 -0
- package/dist/lib/test-sandbox.d.ts +11 -0
- package/dist/lib/{benchmark-sandbox.js → test-sandbox.js} +18 -13
- package/dist/lib/test-specs.d.ts +7 -0
- package/dist/lib/test-specs.js +114 -0
- package/dist/lib/test-targets.d.ts +5 -0
- package/dist/lib/test-targets.js +38 -0
- package/dist/lib/test-types.d.ts +17 -0
- package/dist/lib/test-types.js +1 -0
- package/dist/lib/test.d.ts +4 -0
- package/dist/lib/test.js +3 -0
- package/dist/lib/user-config.d.ts +0 -1
- package/dist/lib/user-config.js +0 -1
- package/dist/lib/util.d.ts +0 -2
- package/dist/lib/util.js +0 -2
- package/dist/lib/validate-helpers.d.ts +0 -1
- package/dist/lib/validate-helpers.js +0 -1
- package/dist/lib/validate-workspace.d.ts +0 -1
- package/dist/lib/validate-workspace.js +34 -25
- package/dist/lib/validate.d.ts +0 -1
- package/dist/lib/validate.js +55 -9
- package/dist/lib/workflow-abi.d.ts +138 -0
- package/dist/lib/workflow-abi.js +181 -0
- package/dist/lib/workflow-definitions.d.ts +26 -5
- package/dist/lib/workflow-definitions.js +105 -168
- package/dist/lib/workflow-helpers.d.ts +1 -2
- package/dist/lib/workflow-helpers.js +32 -21
- package/dist/lib/workflow-improvement.d.ts +22 -0
- package/dist/lib/workflow-improvement.js +396 -0
- package/dist/lib/workflow-review-paths.d.ts +10 -0
- package/dist/lib/workflow-review-paths.js +27 -0
- package/dist/lib/workflow-stage-runner.d.ts +1 -1
- package/dist/lib/workflow-stage-runner.js +4 -1
- package/dist/lib/workflows.d.ts +1 -2
- package/dist/lib/workflows.js +1 -2
- package/dist/lib/workspace-compile.d.ts +0 -1
- package/dist/lib/workspace-compile.js +146 -109
- package/dist/lib/workspace-home.d.ts +5 -0
- package/dist/lib/workspace-home.js +32 -0
- package/dist/lib/workspace-layout.d.ts +2 -0
- package/dist/lib/workspace-layout.js +60 -0
- package/dist/lib/workspace-paths.d.ts +41 -0
- package/dist/lib/workspace-paths.js +107 -0
- package/dist/lib/workspace-raw.d.ts +20 -2
- package/dist/lib/workspace-raw.js +6 -8
- package/dist/lib/workspace-reset.d.ts +0 -1
- package/dist/lib/workspace-reset.js +27 -5
- package/dist/lib/workspace-schema.d.ts +1 -10
- package/dist/lib/workspace-schema.js +16 -74
- package/package.json +16 -15
- package/dist/bin.d.ts.map +0 -1
- package/dist/bin.js.map +0 -1
- package/dist/commands/compile.d.ts.map +0 -1
- package/dist/commands/compile.js.map +0 -1
- package/dist/commands/create-workflow-wizard.d.ts.map +0 -1
- package/dist/commands/create-workflow-wizard.js.map +0 -1
- package/dist/commands/create.d.ts.map +0 -1
- package/dist/commands/create.js.map +0 -1
- package/dist/commands/default.d.ts.map +0 -1
- package/dist/commands/default.js.map +0 -1
- package/dist/commands/doctor.d.ts.map +0 -1
- package/dist/commands/doctor.js.map +0 -1
- package/dist/commands/executor-flow.d.ts.map +0 -1
- package/dist/commands/executor-flow.js.map +0 -1
- package/dist/commands/init.d.ts.map +0 -1
- package/dist/commands/init.js.map +0 -1
- package/dist/commands/list.d.ts.map +0 -1
- package/dist/commands/list.js.map +0 -1
- package/dist/commands/reset.d.ts.map +0 -1
- package/dist/commands/reset.js.map +0 -1
- package/dist/commands/source-config-wizard.d.ts.map +0 -1
- package/dist/commands/source-config-wizard.js.map +0 -1
- package/dist/commands/status.d.ts.map +0 -1
- package/dist/commands/status.js.map +0 -1
- package/dist/commands/test-flow.d.ts.map +0 -1
- package/dist/commands/test-flow.js.map +0 -1
- package/dist/commands/test.d.ts.map +0 -1
- package/dist/commands/test.js.map +0 -1
- package/dist/commands/verify.d.ts.map +0 -1
- package/dist/commands/verify.js.map +0 -1
- package/dist/commands/workspace-flow.d.ts.map +0 -1
- package/dist/commands/workspace-flow.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/lib/agent-args.d.ts.map +0 -1
- package/dist/lib/agent-args.js.map +0 -1
- package/dist/lib/agent-constants.d.ts.map +0 -1
- package/dist/lib/agent-constants.js.map +0 -1
- package/dist/lib/agent-detection.d.ts.map +0 -1
- package/dist/lib/agent-detection.js.map +0 -1
- package/dist/lib/agent-execution.d.ts.map +0 -1
- package/dist/lib/agent-execution.js.map +0 -1
- package/dist/lib/agent-logs.d.ts.map +0 -1
- package/dist/lib/agent-logs.js.map +0 -1
- package/dist/lib/agent-preflight.d.ts.map +0 -1
- package/dist/lib/agent-preflight.js.map +0 -1
- package/dist/lib/agent-render.d.ts.map +0 -1
- package/dist/lib/agent-render.js.map +0 -1
- package/dist/lib/agent-shells.d.ts.map +0 -1
- package/dist/lib/agent-shells.js.map +0 -1
- package/dist/lib/agent-skills.d.ts +0 -21
- package/dist/lib/agent-skills.d.ts.map +0 -1
- package/dist/lib/agent-skills.js +0 -215
- package/dist/lib/agent-skills.js.map +0 -1
- package/dist/lib/agent-status.d.ts.map +0 -1
- package/dist/lib/agent-status.js.map +0 -1
- package/dist/lib/agent-types.d.ts.map +0 -1
- package/dist/lib/agent-types.js.map +0 -1
- package/dist/lib/agents.d.ts.map +0 -1
- package/dist/lib/agents.js.map +0 -1
- package/dist/lib/benchmark-execution.d.ts +0 -13
- package/dist/lib/benchmark-execution.d.ts.map +0 -1
- package/dist/lib/benchmark-execution.js.map +0 -1
- package/dist/lib/benchmark-paths.d.ts +0 -13
- package/dist/lib/benchmark-paths.d.ts.map +0 -1
- package/dist/lib/benchmark-paths.js +0 -44
- package/dist/lib/benchmark-paths.js.map +0 -1
- package/dist/lib/benchmark-sandbox.d.ts +0 -12
- package/dist/lib/benchmark-sandbox.d.ts.map +0 -1
- package/dist/lib/benchmark-sandbox.js.map +0 -1
- package/dist/lib/benchmark-specs.d.ts +0 -8
- package/dist/lib/benchmark-specs.d.ts.map +0 -1
- package/dist/lib/benchmark-specs.js +0 -115
- package/dist/lib/benchmark-specs.js.map +0 -1
- package/dist/lib/benchmark-targets.d.ts +0 -5
- package/dist/lib/benchmark-targets.d.ts.map +0 -1
- package/dist/lib/benchmark-targets.js +0 -38
- package/dist/lib/benchmark-targets.js.map +0 -1
- package/dist/lib/benchmark-types.d.ts +0 -18
- package/dist/lib/benchmark-types.d.ts.map +0 -1
- package/dist/lib/benchmark-types.js +0 -2
- package/dist/lib/benchmark-types.js.map +0 -1
- package/dist/lib/benchmark.d.ts +0 -5
- package/dist/lib/benchmark.d.ts.map +0 -1
- package/dist/lib/benchmark.js +0 -4
- package/dist/lib/benchmark.js.map +0 -1
- package/dist/lib/config.d.ts.map +0 -1
- package/dist/lib/config.js.map +0 -1
- package/dist/lib/discovery.d.ts.map +0 -1
- package/dist/lib/discovery.js.map +0 -1
- package/dist/lib/eval-packs.d.ts +0 -158
- package/dist/lib/eval-packs.d.ts.map +0 -1
- package/dist/lib/eval-packs.js +0 -149
- package/dist/lib/eval-packs.js.map +0 -1
- package/dist/lib/execution-profile.d.ts.map +0 -1
- package/dist/lib/execution-profile.js.map +0 -1
- package/dist/lib/executors.d.ts.map +0 -1
- package/dist/lib/executors.js.map +0 -1
- package/dist/lib/filesystem.d.ts.map +0 -1
- package/dist/lib/filesystem.js.map +0 -1
- package/dist/lib/interf-bootstrap.d.ts.map +0 -1
- package/dist/lib/interf-bootstrap.js.map +0 -1
- package/dist/lib/interf-detect.d.ts.map +0 -1
- package/dist/lib/interf-detect.js.map +0 -1
- package/dist/lib/interf-scaffold.d.ts.map +0 -1
- package/dist/lib/interf-scaffold.js.map +0 -1
- package/dist/lib/interf-workflow-package.d.ts.map +0 -1
- package/dist/lib/interf-workflow-package.js.map +0 -1
- package/dist/lib/interf.d.ts.map +0 -1
- package/dist/lib/interf.js.map +0 -1
- package/dist/lib/local-workflows.d.ts.map +0 -1
- package/dist/lib/local-workflows.js.map +0 -1
- package/dist/lib/logger.d.ts.map +0 -1
- package/dist/lib/logger.js.map +0 -1
- package/dist/lib/obsidian.d.ts.map +0 -1
- package/dist/lib/obsidian.js.map +0 -1
- package/dist/lib/parse.d.ts.map +0 -1
- package/dist/lib/parse.js.map +0 -1
- package/dist/lib/registry.d.ts.map +0 -1
- package/dist/lib/registry.js.map +0 -1
- package/dist/lib/runtime-acceptance.d.ts.map +0 -1
- package/dist/lib/runtime-acceptance.js.map +0 -1
- package/dist/lib/runtime-contracts.d.ts.map +0 -1
- package/dist/lib/runtime-contracts.js.map +0 -1
- package/dist/lib/runtime-paths.d.ts.map +0 -1
- package/dist/lib/runtime-paths.js.map +0 -1
- package/dist/lib/runtime-prompt.d.ts.map +0 -1
- package/dist/lib/runtime-prompt.js.map +0 -1
- package/dist/lib/runtime-reconcile.d.ts.map +0 -1
- package/dist/lib/runtime-reconcile.js.map +0 -1
- package/dist/lib/runtime-runs.d.ts.map +0 -1
- package/dist/lib/runtime-runs.js.map +0 -1
- package/dist/lib/runtime-types.d.ts.map +0 -1
- package/dist/lib/runtime-types.js.map +0 -1
- package/dist/lib/runtime.d.ts.map +0 -1
- package/dist/lib/runtime.js.map +0 -1
- package/dist/lib/schema.d.ts.map +0 -1
- package/dist/lib/schema.js.map +0 -1
- package/dist/lib/source-config.d.ts.map +0 -1
- package/dist/lib/source-config.js.map +0 -1
- package/dist/lib/state-artifacts.d.ts.map +0 -1
- package/dist/lib/state-artifacts.js.map +0 -1
- package/dist/lib/state-health.d.ts.map +0 -1
- package/dist/lib/state-health.js.map +0 -1
- package/dist/lib/state-io.d.ts.map +0 -1
- package/dist/lib/state-io.js.map +0 -1
- package/dist/lib/state-paths.d.ts.map +0 -1
- package/dist/lib/state-paths.js.map +0 -1
- package/dist/lib/state-view.d.ts.map +0 -1
- package/dist/lib/state-view.js.map +0 -1
- package/dist/lib/state.d.ts.map +0 -1
- package/dist/lib/state.js.map +0 -1
- package/dist/lib/summarize-plan.d.ts.map +0 -1
- package/dist/lib/summarize-plan.js.map +0 -1
- package/dist/lib/user-config.d.ts.map +0 -1
- package/dist/lib/user-config.js.map +0 -1
- package/dist/lib/util.d.ts.map +0 -1
- package/dist/lib/util.js.map +0 -1
- package/dist/lib/validate-helpers.d.ts.map +0 -1
- package/dist/lib/validate-helpers.js.map +0 -1
- package/dist/lib/validate-workspace.d.ts.map +0 -1
- package/dist/lib/validate-workspace.js.map +0 -1
- package/dist/lib/validate.d.ts.map +0 -1
- package/dist/lib/validate.js.map +0 -1
- package/dist/lib/workflow-definitions.d.ts.map +0 -1
- package/dist/lib/workflow-definitions.js.map +0 -1
- package/dist/lib/workflow-helpers.d.ts.map +0 -1
- package/dist/lib/workflow-helpers.js.map +0 -1
- package/dist/lib/workflow-stage-runner.d.ts.map +0 -1
- package/dist/lib/workflow-stage-runner.js.map +0 -1
- package/dist/lib/workflow-starter-docs.d.ts +0 -7
- package/dist/lib/workflow-starter-docs.d.ts.map +0 -1
- package/dist/lib/workflow-starter-docs.js +0 -3
- package/dist/lib/workflow-starter-docs.js.map +0 -1
- package/dist/lib/workflows.d.ts.map +0 -1
- package/dist/lib/workflows.js.map +0 -1
- package/dist/lib/workspace-compile.d.ts.map +0 -1
- package/dist/lib/workspace-compile.js.map +0 -1
- package/dist/lib/workspace-docs.d.ts +0 -3
- package/dist/lib/workspace-docs.d.ts.map +0 -1
- package/dist/lib/workspace-docs.js +0 -82
- package/dist/lib/workspace-docs.js.map +0 -1
- package/dist/lib/workspace-raw.d.ts.map +0 -1
- package/dist/lib/workspace-raw.js.map +0 -1
- package/dist/lib/workspace-reset.d.ts.map +0 -1
- package/dist/lib/workspace-reset.js.map +0 -1
- package/dist/lib/workspace-schema.d.ts.map +0 -1
- package/dist/lib/workspace-schema.js.map +0 -1
- package/skills/benchmark/SKILL.md +0 -122
- package/skills/workflow/create/SKILL.md +0 -141
- package/skills/workspace/shape/SKILL.md +0 -15
- package/skills/workspace/structure/SKILL.md +0 -15
- package/skills/workspace/summarize/SKILL.md +0 -15
- package/templates/workspace/README.md +0 -24
- package/templates/workspace/interfignore +0 -2
package/dist/commands/init.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import chalk from "chalk";
|
|
2
2
|
import * as p from "@clack/prompts";
|
|
3
|
-
import { detectInterf, resolveSourceControlPath, } from "../lib/interf.js";
|
|
4
|
-
import { SOURCE_FOLDER_CONFIG_FILE,
|
|
5
|
-
import { DEFAULT_WORKSPACE_NAME, promptSingleWorkspaceConfig, } from "./source-config-wizard.js";
|
|
6
|
-
import { createWorkflowWizard } from "./create-workflow-wizard.js";
|
|
3
|
+
import { detectInterf, readInterfConfig, resolveSourceControlPath, } from "../lib/interf.js";
|
|
4
|
+
import { SOURCE_FOLDER_CONFIG_FILE, resolveWorkspaceCompileMaxAttempts, resolveWorkspaceCompileMaxLoops, syncWorkspaceInterfConfigFromSourceWorkspaceConfig, upsertSourceWorkspaceConfig, } from "../lib/source-config.js";
|
|
5
|
+
import { DEFAULT_WORKSPACE_NAME, describeCompileLoopSelection, promptSingleWorkspaceConfig, } from "./source-config-wizard.js";
|
|
6
|
+
import { buildWorkspaceWorkflowOptions, chooseWorkspaceWorkflow, createWorkflowWizard, } from "./create-workflow-wizard.js";
|
|
7
7
|
import { findBuiltWorkspacePath, findSavedWorkspaceConfig, listSavedWorkspaceEntries, ensureWorkspaceFromConfig, } from "./workspace-flow.js";
|
|
8
8
|
import { printSavedTestOutcome, printSavedTestComparison, questionPassRate, runSavedRawTest, runSavedWorkspaceTest, } from "./test-flow.js";
|
|
9
9
|
import { resolveOrConfigureLocalExecutor } from "./executor-flow.js";
|
|
@@ -14,11 +14,26 @@ function describeSavedQuestions(workspace) {
|
|
|
14
14
|
return "No saved truth checks yet";
|
|
15
15
|
return `${count} saved truth check${count === 1 ? "" : "s"}`;
|
|
16
16
|
}
|
|
17
|
+
function compileModeAlreadyRanSavedTests(workspace) {
|
|
18
|
+
if (workspace.checks.length === 0)
|
|
19
|
+
return false;
|
|
20
|
+
return (resolveWorkspaceCompileMaxAttempts(workspace) != null ||
|
|
21
|
+
resolveWorkspaceCompileMaxLoops(workspace) != null);
|
|
22
|
+
}
|
|
17
23
|
function printWorkspaceSummary(options) {
|
|
24
|
+
const workspaceConfig = options.builtWorkspacePath
|
|
25
|
+
? readInterfConfig(options.builtWorkspacePath)
|
|
26
|
+
: null;
|
|
27
|
+
const workflowLabel = `${options.workspace.workflow ?? "interf"}${workspaceConfig?.workflow_origin?.local_draft === true ? " (local draft)" : ""}`;
|
|
18
28
|
p.log.info(`Workspace: ${options.workspace.name}`);
|
|
19
29
|
if (options.workspace.about) {
|
|
20
30
|
p.log.info(`Focus: ${options.workspace.about}`);
|
|
21
31
|
}
|
|
32
|
+
p.log.info(`Workflow: ${workflowLabel}`);
|
|
33
|
+
p.log.info(describeCompileLoopSelection({
|
|
34
|
+
maxAttempts: options.workspace.max_attempts,
|
|
35
|
+
maxLoops: options.workspace.max_loops,
|
|
36
|
+
}));
|
|
22
37
|
p.log.info(describeSavedQuestions(options.workspace));
|
|
23
38
|
p.log.info(options.built ? "Compiled workspace is available." : "Compiled workspace has not been built yet.");
|
|
24
39
|
if (options.sourcePath !== process.cwd()) {
|
|
@@ -29,7 +44,7 @@ async function promptWorkspaceAction(workspace, built) {
|
|
|
29
44
|
const options = [
|
|
30
45
|
{
|
|
31
46
|
value: "edit",
|
|
32
|
-
label: "Edit truth checks and
|
|
47
|
+
label: "Edit workflow, truth checks, and compile mode",
|
|
33
48
|
hint: "Update this workspace setup",
|
|
34
49
|
},
|
|
35
50
|
];
|
|
@@ -90,6 +105,7 @@ async function chooseWorkspaceForWizard(options) {
|
|
|
90
105
|
label: entry.config.name,
|
|
91
106
|
hint: [
|
|
92
107
|
entry.config.about ?? describeSavedQuestions(entry.config),
|
|
108
|
+
`workflow ${entry.config.workflow ?? "interf"}${entry.localDraft ? " (local draft)" : ""}`,
|
|
93
109
|
entry.path ? "built" : "not built yet",
|
|
94
110
|
].join(" · "),
|
|
95
111
|
})),
|
|
@@ -107,22 +123,47 @@ async function chooseWorkspaceForWizard(options) {
|
|
|
107
123
|
return findSavedWorkspaceConfig(options.sourcePath, String(selected));
|
|
108
124
|
}
|
|
109
125
|
async function promptWorkspaceSetup(options) {
|
|
126
|
+
const workflowChoice = await chooseWorkspaceWorkflow(options.sourcePath, {
|
|
127
|
+
currentWorkflowId: options.initial?.workflow ?? "interf",
|
|
128
|
+
message: options.introStyle === "edit"
|
|
129
|
+
? "Which workflow should this workspace use?"
|
|
130
|
+
: "Which workflow should this workspace start from?",
|
|
131
|
+
});
|
|
132
|
+
if (p.isCancel(workflowChoice))
|
|
133
|
+
return null;
|
|
134
|
+
const workflowId = workflowChoice;
|
|
135
|
+
const workflowLabel = buildWorkspaceWorkflowOptions(options.sourcePath)
|
|
136
|
+
.find((option) => option.value === workflowId)?.label ?? workflowId;
|
|
110
137
|
const workspaceConfig = await promptSingleWorkspaceConfig({
|
|
111
138
|
initial: options.initial,
|
|
112
139
|
...(options.fixedName ? { fixedName: options.fixedName } : {}),
|
|
113
140
|
skipNamePrompt: !options.fixedName && options.introStyle === "first",
|
|
114
141
|
introStyle: options.introStyle,
|
|
142
|
+
selectedWorkflowLabel: workflowLabel,
|
|
115
143
|
});
|
|
116
144
|
if (!workspaceConfig)
|
|
117
145
|
return null;
|
|
118
|
-
|
|
146
|
+
const workspaceConfigWithWorkflow = {
|
|
147
|
+
...workspaceConfig,
|
|
148
|
+
workflow: workflowId,
|
|
149
|
+
};
|
|
150
|
+
upsertSourceWorkspaceConfig(options.sourcePath, workspaceConfigWithWorkflow, {
|
|
119
151
|
...(options.fixedName ? { matchName: options.fixedName } : {}),
|
|
120
152
|
});
|
|
153
|
+
const builtWorkspacePath = findBuiltWorkspacePath(options.sourcePath, workspaceConfigWithWorkflow.name);
|
|
154
|
+
if (builtWorkspacePath) {
|
|
155
|
+
syncWorkspaceInterfConfigFromSourceWorkspaceConfig(builtWorkspacePath, workspaceConfigWithWorkflow);
|
|
156
|
+
}
|
|
121
157
|
console.log();
|
|
122
158
|
console.log(chalk.green(` ✓ Saved workspace setup in ${SOURCE_FOLDER_CONFIG_FILE}`));
|
|
123
159
|
console.log(chalk.dim(` Source folder: ${options.sourcePath}`));
|
|
124
|
-
console.log(chalk.dim(` Workspace: ${
|
|
125
|
-
|
|
160
|
+
console.log(chalk.dim(` Workspace: ${workspaceConfigWithWorkflow.name}`));
|
|
161
|
+
console.log(chalk.dim(` Workflow: ${workflowLabel}`));
|
|
162
|
+
console.log(chalk.dim(` Compile mode: ${describeCompileLoopSelection({
|
|
163
|
+
maxAttempts: workspaceConfigWithWorkflow.max_attempts,
|
|
164
|
+
maxLoops: workspaceConfigWithWorkflow.max_loops,
|
|
165
|
+
})}`));
|
|
166
|
+
return workspaceConfigWithWorkflow;
|
|
126
167
|
}
|
|
127
168
|
async function compileSelectedWorkspace(sourcePath, workspaceConfig) {
|
|
128
169
|
const { executor, error } = await resolveOrConfigureLocalExecutor({
|
|
@@ -143,6 +184,7 @@ async function compileSelectedWorkspace(sourcePath, workspaceConfig) {
|
|
|
143
184
|
sourcePath,
|
|
144
185
|
workspaceConfig,
|
|
145
186
|
maxAttemptsOverride: null,
|
|
187
|
+
maxLoopsOverride: null,
|
|
146
188
|
});
|
|
147
189
|
if (!compiled) {
|
|
148
190
|
return null;
|
|
@@ -177,11 +219,11 @@ async function runFirstWorkspaceFlow(sourcePath, workspaceConfig) {
|
|
|
177
219
|
}
|
|
178
220
|
const compileAndTest = workspaceConfig.checks.length > 0 && rawOutcome
|
|
179
221
|
? await p.confirm({
|
|
180
|
-
message: "Compile the workspace and run the same test now? (Recommended)",
|
|
222
|
+
message: "Compile the workspace with this workflow and run the same test now? (Recommended)",
|
|
181
223
|
initialValue: true,
|
|
182
224
|
})
|
|
183
225
|
: await p.confirm({
|
|
184
|
-
message: "Compile the workspace now? (Recommended)",
|
|
226
|
+
message: "Compile the workspace with this workflow now? (Recommended)",
|
|
185
227
|
initialValue: true,
|
|
186
228
|
});
|
|
187
229
|
if (p.isCancel(compileAndTest) || !compileAndTest) {
|
|
@@ -206,6 +248,10 @@ async function runFirstWorkspaceFlow(sourcePath, workspaceConfig) {
|
|
|
206
248
|
if (workspaceConfig.checks.length === 0) {
|
|
207
249
|
return;
|
|
208
250
|
}
|
|
251
|
+
if (compileModeAlreadyRanSavedTests(workspaceConfig)) {
|
|
252
|
+
p.log.info("Saved compile mode already ran the workspace test.");
|
|
253
|
+
return;
|
|
254
|
+
}
|
|
209
255
|
if (!rawOutcome) {
|
|
210
256
|
const runWorkspaceTest = await p.confirm({
|
|
211
257
|
message: "Run the saved test on the compiled workspace now? (Recommended)",
|
|
@@ -254,8 +300,8 @@ export async function runInitCommand() {
|
|
|
254
300
|
if (detected) {
|
|
255
301
|
p.log.info(`Working from the dataset control plane: ${sourcePath}`);
|
|
256
302
|
}
|
|
257
|
-
const
|
|
258
|
-
if (
|
|
303
|
+
const savedEntries = listSavedWorkspaceEntries(sourcePath);
|
|
304
|
+
if (savedEntries.length === 0) {
|
|
259
305
|
const workspaceConfig = await promptWorkspaceSetup({
|
|
260
306
|
sourcePath,
|
|
261
307
|
initial: { name: DEFAULT_WORKSPACE_NAME },
|
|
@@ -288,6 +334,7 @@ export async function runInitCommand() {
|
|
|
288
334
|
sourcePath,
|
|
289
335
|
workspace: selectedWorkspace,
|
|
290
336
|
built: Boolean(builtWorkspacePath),
|
|
337
|
+
builtWorkspacePath,
|
|
291
338
|
});
|
|
292
339
|
const action = await promptWorkspaceAction(selectedWorkspace, Boolean(builtWorkspacePath));
|
|
293
340
|
if (!action)
|
|
@@ -320,7 +367,14 @@ export async function runInitCommand() {
|
|
|
320
367
|
});
|
|
321
368
|
if (!workspaceConfig)
|
|
322
369
|
return;
|
|
323
|
-
|
|
370
|
+
const refreshedBuiltWorkspacePath = findBuiltWorkspacePath(sourcePath, workspaceConfig.name);
|
|
371
|
+
printWorkspaceSummary({
|
|
372
|
+
sourcePath,
|
|
373
|
+
workspace: workspaceConfig,
|
|
374
|
+
built: Boolean(refreshedBuiltWorkspacePath),
|
|
375
|
+
builtWorkspacePath: refreshedBuiltWorkspacePath,
|
|
376
|
+
});
|
|
377
|
+
p.log.info("Saved workspace setup updated.");
|
|
324
378
|
return;
|
|
325
379
|
}
|
|
326
380
|
if (action === "raw") {
|
|
@@ -363,6 +417,10 @@ export async function runInitCommand() {
|
|
|
363
417
|
return;
|
|
364
418
|
if (selectedWorkspace.checks.length === 0)
|
|
365
419
|
return;
|
|
420
|
+
if (compileModeAlreadyRanSavedTests(selectedWorkspace)) {
|
|
421
|
+
p.log.info("Saved compile mode already ran the workspace test.");
|
|
422
|
+
return;
|
|
423
|
+
}
|
|
366
424
|
const runWorkspaceTest = await p.confirm({
|
|
367
425
|
message: "Run the saved test on the compiled workspace now?",
|
|
368
426
|
initialValue: true,
|
|
@@ -390,4 +448,3 @@ export async function runInitCommand() {
|
|
|
390
448
|
});
|
|
391
449
|
printSavedTestComparison(null, workspaceOutcome);
|
|
392
450
|
}
|
|
393
|
-
//# sourceMappingURL=init.js.map
|
package/dist/commands/list.d.ts
CHANGED
package/dist/commands/list.js
CHANGED
package/dist/commands/reset.d.ts
CHANGED
package/dist/commands/reset.js
CHANGED
|
@@ -1,8 +1,20 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { SourceTruthCheck, SourceWorkspaceConfig } from "../lib/schema.js";
|
|
2
2
|
export declare const DEFAULT_WORKSPACE_NAME = "my-workspace";
|
|
3
|
-
export declare const DEFAULT_WORKSPACE_CHECK_QUESTION_PLACEHOLDER = "
|
|
4
|
-
export declare const DEFAULT_WORKSPACE_CHECK_ANSWER_PLACEHOLDER = "
|
|
5
|
-
export declare const DEFAULT_WORKSPACE_ABOUT_PLACEHOLDER = "
|
|
3
|
+
export declare const DEFAULT_WORKSPACE_CHECK_QUESTION_PLACEHOLDER = "A question you can already verify from this dataset";
|
|
4
|
+
export declare const DEFAULT_WORKSPACE_CHECK_ANSWER_PLACEHOLDER = "The expected answer in plain English";
|
|
5
|
+
export declare const DEFAULT_WORKSPACE_ABOUT_PLACEHOLDER = "Focused workspace for the dataset questions that matter most here.";
|
|
6
|
+
export declare const DEFAULT_COMPILE_RETRY_ATTEMPTS = 1;
|
|
7
|
+
export declare const DEFAULT_SELF_IMPROVING_LOOPS = 3;
|
|
8
|
+
export type CompileLoopMode = "once" | "retry" | "self-improving";
|
|
9
|
+
export interface CompileLoopSelection {
|
|
10
|
+
max_attempts?: number;
|
|
11
|
+
max_loops?: number;
|
|
12
|
+
}
|
|
13
|
+
export declare function resolveCompileLoopMode(maxAttempts?: number | null, maxLoops?: number | null): CompileLoopMode;
|
|
14
|
+
export declare function describeCompileLoopSelection(options: {
|
|
15
|
+
maxAttempts?: number | null;
|
|
16
|
+
maxLoops?: number | null;
|
|
17
|
+
}): string;
|
|
6
18
|
export declare function promptCheckCases(options: {
|
|
7
19
|
heading: string;
|
|
8
20
|
questionMessage: string;
|
|
@@ -11,12 +23,21 @@ export declare function promptCheckCases(options: {
|
|
|
11
23
|
answerPlaceholder: string;
|
|
12
24
|
addAnotherMessage: string;
|
|
13
25
|
startIndex?: number;
|
|
14
|
-
}): Promise<
|
|
26
|
+
}): Promise<SourceTruthCheck[] | null>;
|
|
27
|
+
export declare function promptCompileLoopSelection(options: {
|
|
28
|
+
hasChecks: boolean;
|
|
29
|
+
initialMaxAttempts?: number;
|
|
30
|
+
initialMaxLoops?: number;
|
|
31
|
+
message?: string;
|
|
32
|
+
intro?: string[];
|
|
33
|
+
includeCompileOnce?: boolean;
|
|
34
|
+
recommendedMode?: CompileLoopMode;
|
|
35
|
+
}): Promise<CompileLoopSelection | null>;
|
|
15
36
|
export declare function promptSingleWorkspaceConfig(options?: {
|
|
16
|
-
initial?: Partial<Pick<SourceWorkspaceConfig, "name" | "about" | "checks" | "max_attempts">>;
|
|
37
|
+
initial?: Partial<Pick<SourceWorkspaceConfig, "name" | "about" | "checks" | "max_attempts" | "max_loops">>;
|
|
17
38
|
fixedName?: string;
|
|
18
39
|
skipAboutPrompt?: boolean;
|
|
19
40
|
skipNamePrompt?: boolean;
|
|
20
41
|
introStyle?: "first" | "additional" | "edit";
|
|
42
|
+
selectedWorkflowLabel?: string;
|
|
21
43
|
}): Promise<SourceWorkspaceConfig | null>;
|
|
22
|
-
//# sourceMappingURL=source-config-wizard.d.ts.map
|
|
@@ -1,10 +1,34 @@
|
|
|
1
1
|
import * as p from "@clack/prompts";
|
|
2
|
-
import { workspaceMaxAttempts } from "../lib/source-config.js";
|
|
2
|
+
import { workspaceMaxAttempts, workspaceMaxLoops } from "../lib/source-config.js";
|
|
3
3
|
import { slugify } from "../lib/util.js";
|
|
4
4
|
export const DEFAULT_WORKSPACE_NAME = "my-workspace";
|
|
5
|
-
export const DEFAULT_WORKSPACE_CHECK_QUESTION_PLACEHOLDER = "
|
|
6
|
-
export const DEFAULT_WORKSPACE_CHECK_ANSWER_PLACEHOLDER = "
|
|
7
|
-
export const DEFAULT_WORKSPACE_ABOUT_PLACEHOLDER = "
|
|
5
|
+
export const DEFAULT_WORKSPACE_CHECK_QUESTION_PLACEHOLDER = "A question you can already verify from this dataset";
|
|
6
|
+
export const DEFAULT_WORKSPACE_CHECK_ANSWER_PLACEHOLDER = "The expected answer in plain English";
|
|
7
|
+
export const DEFAULT_WORKSPACE_ABOUT_PLACEHOLDER = "Focused workspace for the dataset questions that matter most here.";
|
|
8
|
+
export const DEFAULT_COMPILE_RETRY_ATTEMPTS = 1;
|
|
9
|
+
export const DEFAULT_SELF_IMPROVING_LOOPS = 3;
|
|
10
|
+
function formatAttemptLabel(count, noun) {
|
|
11
|
+
return `${count} ${noun}${count === 1 ? "" : "s"}`;
|
|
12
|
+
}
|
|
13
|
+
export function resolveCompileLoopMode(maxAttempts, maxLoops) {
|
|
14
|
+
if ((maxLoops ?? 0) > 0)
|
|
15
|
+
return "self-improving";
|
|
16
|
+
if ((maxAttempts ?? 0) > 1)
|
|
17
|
+
return "retry";
|
|
18
|
+
return "once";
|
|
19
|
+
}
|
|
20
|
+
export function describeCompileLoopSelection(options) {
|
|
21
|
+
const mode = resolveCompileLoopMode(options.maxAttempts, options.maxLoops);
|
|
22
|
+
if (mode === "once") {
|
|
23
|
+
return "Run a single compile attempt without workflow edits.";
|
|
24
|
+
}
|
|
25
|
+
if (mode === "retry") {
|
|
26
|
+
return `Retry the same workflow up to ${formatAttemptLabel(options.maxAttempts ?? DEFAULT_COMPILE_RETRY_ATTEMPTS, "attempt")}.`;
|
|
27
|
+
}
|
|
28
|
+
const attempts = options.maxAttempts ?? DEFAULT_COMPILE_RETRY_ATTEMPTS;
|
|
29
|
+
const loops = options.maxLoops ?? DEFAULT_SELF_IMPROVING_LOOPS;
|
|
30
|
+
return `Run ${formatAttemptLabel(attempts, "attempt")} per workflow variation and allow up to ${formatAttemptLabel(loops, "self-improving workflow loop")}.`;
|
|
31
|
+
}
|
|
8
32
|
export async function promptCheckCases(options) {
|
|
9
33
|
p.log.info(options.heading);
|
|
10
34
|
const cases = [];
|
|
@@ -47,11 +71,11 @@ async function promptWorkspaceChecks(options) {
|
|
|
47
71
|
if (options.initialAbout) {
|
|
48
72
|
p.log.info(`Focus: ${options.initialAbout}`);
|
|
49
73
|
}
|
|
50
|
-
p.log.info("Truth checks");
|
|
51
|
-
p.log.info("
|
|
74
|
+
p.log.info("Truth checks define what should hold for this dataset.");
|
|
75
|
+
p.log.info("Each truth check is a question plus the expected correct answer.");
|
|
52
76
|
p.log.info("Start with simple facts, comparisons, or conclusions you can verify in the source material.");
|
|
53
77
|
const addNow = await p.confirm({
|
|
54
|
-
message: "Add a few truth checks
|
|
78
|
+
message: "Add a few truth checks for this dataset now? (Recommended)",
|
|
55
79
|
initialValue: true,
|
|
56
80
|
});
|
|
57
81
|
if (p.isCancel(addNow))
|
|
@@ -121,65 +145,122 @@ async function promptWorkspaceChecks(options) {
|
|
|
121
145
|
return null;
|
|
122
146
|
return mode === "add" ? [...options.initialChecks, ...nextChecks] : nextChecks;
|
|
123
147
|
}
|
|
124
|
-
async function
|
|
125
|
-
|
|
126
|
-
return undefined;
|
|
127
|
-
}
|
|
128
|
-
const currentMaxAttempts = options.initialMaxAttempts ?? null;
|
|
129
|
-
if (currentMaxAttempts) {
|
|
130
|
-
p.log.info(`Self-improving workflow loop: up to ${currentMaxAttempts} attempts.`);
|
|
131
|
-
const mode = await p.select({
|
|
132
|
-
message: "What do you want to do with the compile loop?",
|
|
133
|
-
options: [
|
|
134
|
-
{
|
|
135
|
-
value: "keep",
|
|
136
|
-
label: "Keep it",
|
|
137
|
-
hint: "Reuse the current attempt budget",
|
|
138
|
-
},
|
|
139
|
-
{
|
|
140
|
-
value: "change",
|
|
141
|
-
label: "Change it",
|
|
142
|
-
hint: "Use a different attempt budget",
|
|
143
|
-
},
|
|
144
|
-
{
|
|
145
|
-
value: "disable",
|
|
146
|
-
label: "Turn it off",
|
|
147
|
-
hint: "Compile once without the retry loop",
|
|
148
|
-
},
|
|
149
|
-
],
|
|
150
|
-
});
|
|
151
|
-
if (p.isCancel(mode))
|
|
152
|
-
return null;
|
|
153
|
-
if (mode === "keep")
|
|
154
|
-
return currentMaxAttempts;
|
|
155
|
-
if (mode === "disable")
|
|
156
|
-
return undefined;
|
|
157
|
-
}
|
|
158
|
-
else {
|
|
159
|
-
const enable = await p.confirm({
|
|
160
|
-
message: "Keep rerunning the workflow and test until this workspace passes or reaches the attempt limit? (optional)",
|
|
161
|
-
initialValue: false,
|
|
162
|
-
});
|
|
163
|
-
if (p.isCancel(enable))
|
|
164
|
-
return null;
|
|
165
|
-
if (!enable)
|
|
166
|
-
return undefined;
|
|
167
|
-
}
|
|
148
|
+
async function promptRetryAttempts(options) {
|
|
149
|
+
const minimum = options.minimum ?? 1;
|
|
168
150
|
const maxAttempts = await p.text({
|
|
169
|
-
message:
|
|
170
|
-
placeholder:
|
|
171
|
-
initialValue: String(
|
|
151
|
+
message: options.message,
|
|
152
|
+
placeholder: String(Math.max(minimum, DEFAULT_COMPILE_RETRY_ATTEMPTS)),
|
|
153
|
+
initialValue: String(Math.max(options.initialMaxAttempts ?? DEFAULT_COMPILE_RETRY_ATTEMPTS, minimum)),
|
|
172
154
|
validate: (value) => {
|
|
173
155
|
const parsed = Number.parseInt(value.trim(), 10);
|
|
174
|
-
if (!Number.isInteger(parsed) || parsed <
|
|
175
|
-
return
|
|
156
|
+
if (!Number.isInteger(parsed) || parsed < minimum || parsed > 5) {
|
|
157
|
+
return `Enter a whole number from ${minimum} to 5`;
|
|
176
158
|
}
|
|
177
159
|
return undefined;
|
|
178
160
|
},
|
|
179
161
|
});
|
|
180
162
|
if (p.isCancel(maxAttempts))
|
|
181
163
|
return null;
|
|
182
|
-
return workspaceMaxAttempts(Number.parseInt(String(maxAttempts).trim(), 10));
|
|
164
|
+
return workspaceMaxAttempts(Number.parseInt(String(maxAttempts).trim(), 10)) ?? DEFAULT_COMPILE_RETRY_ATTEMPTS;
|
|
165
|
+
}
|
|
166
|
+
async function promptSelfImprovingLoops(options) {
|
|
167
|
+
const maxLoops = await p.text({
|
|
168
|
+
message: options.message,
|
|
169
|
+
placeholder: String(DEFAULT_SELF_IMPROVING_LOOPS),
|
|
170
|
+
initialValue: String(options.initialMaxLoops ?? DEFAULT_SELF_IMPROVING_LOOPS),
|
|
171
|
+
validate: (value) => {
|
|
172
|
+
const parsed = Number.parseInt(value.trim(), 10);
|
|
173
|
+
if (!Number.isInteger(parsed) || parsed < 1 || parsed > 3) {
|
|
174
|
+
return "Enter a whole number from 1 to 3";
|
|
175
|
+
}
|
|
176
|
+
return undefined;
|
|
177
|
+
},
|
|
178
|
+
});
|
|
179
|
+
if (p.isCancel(maxLoops))
|
|
180
|
+
return null;
|
|
181
|
+
return workspaceMaxLoops(Number.parseInt(String(maxLoops).trim(), 10)) ?? DEFAULT_SELF_IMPROVING_LOOPS;
|
|
182
|
+
}
|
|
183
|
+
export async function promptCompileLoopSelection(options) {
|
|
184
|
+
if (!options.hasChecks) {
|
|
185
|
+
return {};
|
|
186
|
+
}
|
|
187
|
+
const currentMode = resolveCompileLoopMode(options.initialMaxAttempts, options.initialMaxLoops);
|
|
188
|
+
const recommendedMode = options.recommendedMode ?? "self-improving";
|
|
189
|
+
const includeCompileOnce = options.includeCompileOnce !== false;
|
|
190
|
+
const hasSavedPolicy = typeof options.initialMaxAttempts === "number" ||
|
|
191
|
+
typeof options.initialMaxLoops === "number";
|
|
192
|
+
for (const line of options.intro ?? []) {
|
|
193
|
+
p.log.info(line);
|
|
194
|
+
}
|
|
195
|
+
p.log.info(`Current mode: ${describeCompileLoopSelection({
|
|
196
|
+
maxAttempts: options.initialMaxAttempts,
|
|
197
|
+
maxLoops: options.initialMaxLoops,
|
|
198
|
+
})}`);
|
|
199
|
+
const optionsByMode = {
|
|
200
|
+
once: {
|
|
201
|
+
value: "once",
|
|
202
|
+
label: "Single attempt",
|
|
203
|
+
hint: "No retries or workflow edits",
|
|
204
|
+
},
|
|
205
|
+
retry: {
|
|
206
|
+
value: "retry",
|
|
207
|
+
label: "Retry the same workflow",
|
|
208
|
+
hint: `Run compile + test up to ${formatAttemptLabel(Math.max(options.initialMaxAttempts ?? 2, 2), "attempt")}`,
|
|
209
|
+
},
|
|
210
|
+
"self-improving": {
|
|
211
|
+
value: "self-improving",
|
|
212
|
+
label: recommendedMode === "self-improving"
|
|
213
|
+
? "Self-improving loops (Recommended)"
|
|
214
|
+
: "Self-improving loops",
|
|
215
|
+
hint: `Retry each variation, then edit the workflow and retest up to ${options.initialMaxLoops ?? DEFAULT_SELF_IMPROVING_LOOPS} loop${(options.initialMaxLoops ?? DEFAULT_SELF_IMPROVING_LOOPS) === 1 ? "" : "s"}`,
|
|
216
|
+
},
|
|
217
|
+
};
|
|
218
|
+
const orderedModes = (hasSavedPolicy
|
|
219
|
+
? [
|
|
220
|
+
currentMode,
|
|
221
|
+
...(recommendedMode !== currentMode ? [recommendedMode] : []),
|
|
222
|
+
"retry",
|
|
223
|
+
"once",
|
|
224
|
+
]
|
|
225
|
+
: [
|
|
226
|
+
recommendedMode,
|
|
227
|
+
"retry",
|
|
228
|
+
"once",
|
|
229
|
+
]).filter((mode, index, list) => list.indexOf(mode) === index)
|
|
230
|
+
.filter((mode) => includeCompileOnce || mode !== "once");
|
|
231
|
+
const selectedMode = await p.select({
|
|
232
|
+
message: options.message ?? "How should this workspace compile?",
|
|
233
|
+
options: orderedModes.map((mode) => optionsByMode[mode]),
|
|
234
|
+
});
|
|
235
|
+
if (p.isCancel(selectedMode))
|
|
236
|
+
return null;
|
|
237
|
+
if (selectedMode === "once") {
|
|
238
|
+
return {};
|
|
239
|
+
}
|
|
240
|
+
const maxAttempts = await promptRetryAttempts({
|
|
241
|
+
initialMaxAttempts: options.initialMaxAttempts ?? DEFAULT_COMPILE_RETRY_ATTEMPTS,
|
|
242
|
+
minimum: selectedMode === "retry" ? 2 : 1,
|
|
243
|
+
message: selectedMode === "retry"
|
|
244
|
+
? "Maximum compile attempts for the same workflow?"
|
|
245
|
+
: "Attempts per workflow variation?",
|
|
246
|
+
});
|
|
247
|
+
if (maxAttempts === null)
|
|
248
|
+
return null;
|
|
249
|
+
if (selectedMode === "retry") {
|
|
250
|
+
return {
|
|
251
|
+
max_attempts: maxAttempts,
|
|
252
|
+
};
|
|
253
|
+
}
|
|
254
|
+
const maxLoops = await promptSelfImprovingLoops({
|
|
255
|
+
initialMaxLoops: options.initialMaxLoops ?? DEFAULT_SELF_IMPROVING_LOOPS,
|
|
256
|
+
message: "Maximum self-improving workflow loops?",
|
|
257
|
+
});
|
|
258
|
+
if (maxLoops === null)
|
|
259
|
+
return null;
|
|
260
|
+
return {
|
|
261
|
+
max_attempts: maxAttempts,
|
|
262
|
+
max_loops: maxLoops,
|
|
263
|
+
};
|
|
183
264
|
}
|
|
184
265
|
export async function promptSingleWorkspaceConfig(options = {}) {
|
|
185
266
|
const initial = options.initial;
|
|
@@ -224,7 +305,10 @@ export async function promptSingleWorkspaceConfig(options = {}) {
|
|
|
224
305
|
}
|
|
225
306
|
let about = initial?.about ?? "";
|
|
226
307
|
let checks = null;
|
|
227
|
-
let
|
|
308
|
+
let compileLoopSelection = {
|
|
309
|
+
...(typeof initial?.max_attempts === "number" ? { max_attempts: initial.max_attempts } : {}),
|
|
310
|
+
...(typeof initial?.max_loops === "number" ? { max_loops: initial.max_loops } : {}),
|
|
311
|
+
};
|
|
228
312
|
if (collectChecksFirst) {
|
|
229
313
|
checks = await promptWorkspaceChecks({
|
|
230
314
|
initialChecks: initial?.checks,
|
|
@@ -234,7 +318,7 @@ export async function promptSingleWorkspaceConfig(options = {}) {
|
|
|
234
318
|
}
|
|
235
319
|
if (!(options.skipAboutPrompt && initial?.about)) {
|
|
236
320
|
about = await p.text({
|
|
237
|
-
message: "
|
|
321
|
+
message: "Optional focus for this workspace?",
|
|
238
322
|
placeholder: DEFAULT_WORKSPACE_ABOUT_PLACEHOLDER,
|
|
239
323
|
initialValue: initial?.about,
|
|
240
324
|
});
|
|
@@ -249,17 +333,29 @@ export async function promptSingleWorkspaceConfig(options = {}) {
|
|
|
249
333
|
if (checks === null)
|
|
250
334
|
return null;
|
|
251
335
|
}
|
|
252
|
-
|
|
336
|
+
compileLoopSelection = await promptCompileLoopSelection({
|
|
253
337
|
initialMaxAttempts: initial?.max_attempts,
|
|
338
|
+
initialMaxLoops: initial?.max_loops,
|
|
254
339
|
hasChecks: checks.length > 0,
|
|
340
|
+
intro: [
|
|
341
|
+
...(options.selectedWorkflowLabel
|
|
342
|
+
? [`Workflow: ${options.selectedWorkflowLabel}`]
|
|
343
|
+
: []),
|
|
344
|
+
"Compile mode",
|
|
345
|
+
"Choose whether this workspace should compile once, retry the same workflow, or run self-improving loops that edit the workflow and retest it on the same truth checks.",
|
|
346
|
+
],
|
|
255
347
|
});
|
|
256
|
-
if (
|
|
348
|
+
if (compileLoopSelection === null)
|
|
257
349
|
return null;
|
|
258
350
|
return {
|
|
259
351
|
name,
|
|
260
352
|
...(String(about).trim().length > 0 ? { about: String(about).trim() } : {}),
|
|
261
|
-
...(typeof
|
|
353
|
+
...(typeof compileLoopSelection.max_attempts === "number"
|
|
354
|
+
? { max_attempts: compileLoopSelection.max_attempts }
|
|
355
|
+
: {}),
|
|
356
|
+
...(typeof compileLoopSelection.max_loops === "number"
|
|
357
|
+
? { max_loops: compileLoopSelection.max_loops }
|
|
358
|
+
: {}),
|
|
262
359
|
checks,
|
|
263
360
|
};
|
|
264
361
|
}
|
|
265
|
-
//# sourceMappingURL=source-config-wizard.js.map
|
package/dist/commands/status.js
CHANGED
|
@@ -1,26 +1,36 @@
|
|
|
1
|
-
import { type
|
|
2
|
-
import type { WorkflowExecutionProfile } from "../lib/executors.js";
|
|
3
|
-
import type {
|
|
4
|
-
import type { SourceWorkspaceConfig } from "../lib/schema.js";
|
|
1
|
+
import { type TestTargetCandidate, type TestTargetResult } from "../lib/test.js";
|
|
2
|
+
import type { WorkflowExecutionProfile, WorkflowExecutor } from "../lib/executors.js";
|
|
3
|
+
import type { TestSandboxRetentionMode } from "../lib/test-sandbox.js";
|
|
4
|
+
import type { SourceWorkspaceConfig, TestRunMode } from "../lib/schema.js";
|
|
5
5
|
export interface SavedTestOutcome {
|
|
6
6
|
runPath: string;
|
|
7
|
-
target:
|
|
8
|
-
result:
|
|
7
|
+
target: TestTargetCandidate;
|
|
8
|
+
result: TestTargetResult;
|
|
9
9
|
}
|
|
10
10
|
export declare function questionPassRate(outcome: SavedTestOutcome): number;
|
|
11
11
|
export declare function printSavedTestOutcome(prefix: string, outcome: SavedTestOutcome): void;
|
|
12
|
-
export declare function printSavedTestComparison(rawOutcome: SavedTestOutcome | null, workspaceOutcome: SavedTestOutcome | null): void;
|
|
12
|
+
export declare function printSavedTestComparison(rawOutcome: SavedTestOutcome | null, workspaceOutcome: SavedTestOutcome | null, comparisonRunPath?: string | null): void;
|
|
13
|
+
export declare function saveTestComparisonRun(options: {
|
|
14
|
+
sourcePath: string;
|
|
15
|
+
workspacePath: string;
|
|
16
|
+
workspaceName: string;
|
|
17
|
+
mode: TestRunMode;
|
|
18
|
+
rawOutcome: SavedTestOutcome | null;
|
|
19
|
+
workspaceOutcome: SavedTestOutcome | null;
|
|
20
|
+
}): string;
|
|
13
21
|
export declare function runSavedRawTest(options: {
|
|
14
22
|
sourcePath: string;
|
|
15
23
|
workspaceConfig: SourceWorkspaceConfig;
|
|
24
|
+
workspacePath?: string | null;
|
|
25
|
+
executor?: WorkflowExecutor | null;
|
|
16
26
|
executionProfile?: WorkflowExecutionProfile;
|
|
17
|
-
preserveSandboxes?:
|
|
27
|
+
preserveSandboxes?: TestSandboxRetentionMode;
|
|
18
28
|
}): Promise<SavedTestOutcome | null>;
|
|
19
29
|
export declare function runSavedWorkspaceTest(options: {
|
|
20
30
|
sourcePath: string;
|
|
21
31
|
workspaceConfig: SourceWorkspaceConfig;
|
|
32
|
+
executor?: WorkflowExecutor | null;
|
|
22
33
|
executionProfile?: WorkflowExecutionProfile;
|
|
23
34
|
workspacePath?: string | null;
|
|
24
|
-
preserveSandboxes?:
|
|
35
|
+
preserveSandboxes?: TestSandboxRetentionMode;
|
|
25
36
|
}): Promise<SavedTestOutcome | null>;
|
|
26
|
-
//# sourceMappingURL=test-flow.d.ts.map
|