@interf/compiler 0.3.4 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +131 -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/compile.js
CHANGED
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
import { cpSync, mkdtempSync, rmSync } from "node:fs";
|
|
2
|
-
import { tmpdir } from "node:os";
|
|
3
|
-
import { join } from "node:path";
|
|
4
1
|
import chalk from "chalk";
|
|
5
2
|
import * as p from "@clack/prompts";
|
|
6
3
|
import { detectInterf, readInterfConfig, resolveSourceControlPath, } from "../lib/interf.js";
|
|
7
|
-
import {
|
|
8
|
-
import { resetWorkspaceGeneratedState } from "../lib/workspace-reset.js";
|
|
9
|
-
import { formatWorkspaceWorkflowStageStep, resolveWorkspaceWorkflowFromConfig, } from "../lib/workflow-definitions.js";
|
|
4
|
+
import { sourceWorkspaceConfigFromInterfConfig, } from "../lib/source-config.js";
|
|
10
5
|
import { addExecutionProfileOptions, executionProfileFromArgv, } from "../lib/execution-profile.js";
|
|
11
|
-
import { chooseWorkspaceConfigToBuild,
|
|
6
|
+
import { chooseWorkspaceConfigToBuild, ensureWorkspaceFromConfig, } from "./workspace-flow.js";
|
|
7
|
+
import { promptCompileLoopSelection, } from "./source-config-wizard.js";
|
|
12
8
|
import { resolveOrConfigureLocalExecutor } from "./executor-flow.js";
|
|
13
|
-
import {
|
|
9
|
+
import { runConfiguredWorkspaceCompile } from "./compile-controller.js";
|
|
10
|
+
export { runConfiguredWorkspaceCompile } from "./compile-controller.js";
|
|
14
11
|
export const compileCommand = {
|
|
15
12
|
command: "compile",
|
|
16
13
|
describe: "Build a workspace for this dataset",
|
|
17
14
|
builder: (yargs) => addExecutionProfileOptions(yargs).option("max-attempts", {
|
|
18
15
|
alias: "max-retries",
|
|
19
16
|
type: "number",
|
|
20
|
-
describe: "
|
|
17
|
+
describe: "Retry compile + test for the same workflow until the workspace passes or reaches this total attempt limit",
|
|
18
|
+
}).option("max-loops", {
|
|
19
|
+
type: "number",
|
|
20
|
+
describe: "After retries fail, let Interf edit the workflow and test new workflow variations up to this loop limit",
|
|
21
21
|
}).option("keep-stage-shells", {
|
|
22
22
|
type: "boolean",
|
|
23
23
|
default: false,
|
|
24
|
-
describe: "Keep every executed stage shell under .interf/execution-shells for review instead of pruning successful shells",
|
|
24
|
+
describe: "Keep every executed stage shell under .interf/runtime/execution-shells for review instead of pruning successful shells",
|
|
25
25
|
}),
|
|
26
26
|
handler: async (argv) => {
|
|
27
27
|
await runCompileCommand(argv);
|
|
@@ -35,12 +35,7 @@ export async function runCompileCommand(argv = {}) {
|
|
|
35
35
|
if (detected) {
|
|
36
36
|
workspacePath = detected.path;
|
|
37
37
|
sourcePath = resolveSourceControlPath(detected.path);
|
|
38
|
-
workspaceConfig =
|
|
39
|
-
name: detected.config.name,
|
|
40
|
-
...(detected.config.about ? { about: detected.config.about } : {}),
|
|
41
|
-
...(detected.config.workflow ? { workflow: detected.config.workflow } : {}),
|
|
42
|
-
checks: [],
|
|
43
|
-
};
|
|
38
|
+
workspaceConfig = sourceWorkspaceConfigFromInterfConfig(detected.config);
|
|
44
39
|
if (process.stdin.isTTY && process.stdout.isTTY) {
|
|
45
40
|
const confirmed = await p.confirm({
|
|
46
41
|
message: `Compile workspace "${detected.config.name}" now?`,
|
|
@@ -76,14 +71,27 @@ export async function runCompileCommand(argv = {}) {
|
|
|
76
71
|
console.log(chalk.dim(` Workspace: ${selectedWorkspace.name}`));
|
|
77
72
|
}
|
|
78
73
|
let maxAttemptsOverride = null;
|
|
74
|
+
let maxLoopsOverride = null;
|
|
79
75
|
try {
|
|
80
76
|
maxAttemptsOverride = readCompileMaxAttemptsOverride(argv);
|
|
77
|
+
maxLoopsOverride = readCompileMaxLoopsOverride(argv);
|
|
81
78
|
}
|
|
82
79
|
catch (error) {
|
|
83
80
|
process.exitCode = 1;
|
|
84
81
|
console.log(chalk.red(error instanceof Error ? error.message : String(error)));
|
|
85
82
|
return;
|
|
86
83
|
}
|
|
84
|
+
const interactiveOverrides = await resolveInteractiveCompileLoopOverrides({
|
|
85
|
+
workspacePath,
|
|
86
|
+
workspaceConfig,
|
|
87
|
+
maxAttemptsOverride,
|
|
88
|
+
maxLoopsOverride,
|
|
89
|
+
});
|
|
90
|
+
if (!interactiveOverrides)
|
|
91
|
+
return;
|
|
92
|
+
workspaceConfig = interactiveOverrides.workspaceConfig;
|
|
93
|
+
maxAttemptsOverride = interactiveOverrides.maxAttemptsOverride;
|
|
94
|
+
maxLoopsOverride = interactiveOverrides.maxLoopsOverride;
|
|
87
95
|
const executionProfile = executionProfileFromArgv(argv);
|
|
88
96
|
const { executor, error } = await resolveOrConfigureLocalExecutor({
|
|
89
97
|
executionProfile,
|
|
@@ -103,9 +111,127 @@ export async function runCompileCommand(argv = {}) {
|
|
|
103
111
|
workspaceConfig,
|
|
104
112
|
executionProfile,
|
|
105
113
|
maxAttemptsOverride,
|
|
114
|
+
maxLoopsOverride,
|
|
106
115
|
preserveStageShells: readStageShellRetentionMode(argv),
|
|
107
116
|
});
|
|
108
117
|
}
|
|
118
|
+
export async function resolveInteractiveCompileLoopOverrides(options) {
|
|
119
|
+
if (!process.stdin.isTTY || !process.stdout.isTTY) {
|
|
120
|
+
return {
|
|
121
|
+
workspaceConfig: options.workspaceConfig,
|
|
122
|
+
maxAttemptsOverride: options.maxAttemptsOverride,
|
|
123
|
+
maxLoopsOverride: options.maxLoopsOverride,
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
if (options.maxAttemptsOverride != null || options.maxLoopsOverride != null) {
|
|
127
|
+
return {
|
|
128
|
+
workspaceConfig: options.workspaceConfig,
|
|
129
|
+
maxAttemptsOverride: options.maxAttemptsOverride,
|
|
130
|
+
maxLoopsOverride: options.maxLoopsOverride,
|
|
131
|
+
};
|
|
132
|
+
}
|
|
133
|
+
const currentConfig = readInterfConfig(options.workspacePath);
|
|
134
|
+
const checks = options.workspaceConfig?.checks.length
|
|
135
|
+
? options.workspaceConfig.checks
|
|
136
|
+
: (currentConfig?.checks ?? []);
|
|
137
|
+
if (checks.length === 0) {
|
|
138
|
+
return {
|
|
139
|
+
workspaceConfig: options.workspaceConfig,
|
|
140
|
+
maxAttemptsOverride: options.maxAttemptsOverride,
|
|
141
|
+
maxLoopsOverride: options.maxLoopsOverride,
|
|
142
|
+
};
|
|
143
|
+
}
|
|
144
|
+
const savedWorkspaceConfig = options.workspaceConfig
|
|
145
|
+
?? (currentConfig ? sourceWorkspaceConfigFromInterfConfig(currentConfig) : null);
|
|
146
|
+
if (!savedWorkspaceConfig) {
|
|
147
|
+
return {
|
|
148
|
+
workspaceConfig: options.workspaceConfig,
|
|
149
|
+
maxAttemptsOverride: options.maxAttemptsOverride,
|
|
150
|
+
maxLoopsOverride: options.maxLoopsOverride,
|
|
151
|
+
};
|
|
152
|
+
}
|
|
153
|
+
const hasSavedPolicy = typeof savedWorkspaceConfig.max_attempts === "number" ||
|
|
154
|
+
typeof savedWorkspaceConfig.max_loops === "number";
|
|
155
|
+
if (!hasSavedPolicy) {
|
|
156
|
+
const overrideSelection = await promptCompileLoopSelection({
|
|
157
|
+
hasChecks: true,
|
|
158
|
+
initialMaxAttempts: savedWorkspaceConfig.max_attempts,
|
|
159
|
+
initialMaxLoops: savedWorkspaceConfig.max_loops,
|
|
160
|
+
intro: [
|
|
161
|
+
`Workflow: ${savedWorkspaceConfig.workflow ?? currentConfig?.workflow ?? "interf"}`,
|
|
162
|
+
"This selection applies to this compile run only. It does not change the saved workspace setup.",
|
|
163
|
+
],
|
|
164
|
+
message: "How should this compile run?",
|
|
165
|
+
});
|
|
166
|
+
if (overrideSelection === null)
|
|
167
|
+
return null;
|
|
168
|
+
return {
|
|
169
|
+
workspaceConfig: {
|
|
170
|
+
...savedWorkspaceConfig,
|
|
171
|
+
max_attempts: undefined,
|
|
172
|
+
max_loops: undefined,
|
|
173
|
+
},
|
|
174
|
+
maxAttemptsOverride: overrideSelection.max_attempts ?? null,
|
|
175
|
+
maxLoopsOverride: overrideSelection.max_loops ?? null,
|
|
176
|
+
};
|
|
177
|
+
}
|
|
178
|
+
const savedMode = await p.select({
|
|
179
|
+
message: "Which compile mode should this run use?",
|
|
180
|
+
options: [
|
|
181
|
+
{
|
|
182
|
+
value: "saved",
|
|
183
|
+
label: "Use saved compile mode (Recommended)",
|
|
184
|
+
hint: `${savedWorkspaceConfig.max_loops ? "Self-improving" : savedWorkspaceConfig.max_attempts && savedWorkspaceConfig.max_attempts > 1 ? "Retry" : "Single attempt"} · ${formatCompileModeHint(savedWorkspaceConfig)}`,
|
|
185
|
+
},
|
|
186
|
+
{
|
|
187
|
+
value: "override",
|
|
188
|
+
label: "Change it for this run only",
|
|
189
|
+
hint: "Keep the saved workspace setup unchanged",
|
|
190
|
+
},
|
|
191
|
+
],
|
|
192
|
+
});
|
|
193
|
+
if (p.isCancel(savedMode))
|
|
194
|
+
return null;
|
|
195
|
+
if (savedMode === "saved") {
|
|
196
|
+
return {
|
|
197
|
+
workspaceConfig: savedWorkspaceConfig,
|
|
198
|
+
maxAttemptsOverride: null,
|
|
199
|
+
maxLoopsOverride: null,
|
|
200
|
+
};
|
|
201
|
+
}
|
|
202
|
+
const selection = await promptCompileLoopSelection({
|
|
203
|
+
hasChecks: true,
|
|
204
|
+
initialMaxAttempts: savedWorkspaceConfig.max_attempts,
|
|
205
|
+
initialMaxLoops: savedWorkspaceConfig.max_loops,
|
|
206
|
+
intro: [
|
|
207
|
+
`Workflow: ${savedWorkspaceConfig.workflow ?? currentConfig?.workflow ?? "interf"}`,
|
|
208
|
+
"This applies to this compile run only. It does not change the saved workspace setup.",
|
|
209
|
+
],
|
|
210
|
+
message: "Override the compile mode for this run",
|
|
211
|
+
});
|
|
212
|
+
if (selection === null)
|
|
213
|
+
return null;
|
|
214
|
+
return {
|
|
215
|
+
...savedWorkspaceConfig,
|
|
216
|
+
workspaceConfig: {
|
|
217
|
+
...savedWorkspaceConfig,
|
|
218
|
+
max_attempts: undefined,
|
|
219
|
+
max_loops: undefined,
|
|
220
|
+
},
|
|
221
|
+
maxAttemptsOverride: selection.max_attempts ?? null,
|
|
222
|
+
maxLoopsOverride: selection.max_loops ?? null,
|
|
223
|
+
};
|
|
224
|
+
}
|
|
225
|
+
function formatCompileModeHint(workspaceConfig) {
|
|
226
|
+
if (typeof workspaceConfig.max_loops === "number" && workspaceConfig.max_loops > 0) {
|
|
227
|
+
const attempts = workspaceConfig.max_attempts ?? 1;
|
|
228
|
+
return `${attempts} attempt${attempts === 1 ? "" : "s"} per variation, ${workspaceConfig.max_loops} loop${workspaceConfig.max_loops === 1 ? "" : "s"}`;
|
|
229
|
+
}
|
|
230
|
+
if (typeof workspaceConfig.max_attempts === "number" && workspaceConfig.max_attempts > 1) {
|
|
231
|
+
return `${workspaceConfig.max_attempts} attempts`;
|
|
232
|
+
}
|
|
233
|
+
return "1 attempt";
|
|
234
|
+
}
|
|
109
235
|
function readCompileMaxAttemptsOverride(argv) {
|
|
110
236
|
const raw = argv["max-attempts"] ??
|
|
111
237
|
argv.maxAttempts ??
|
|
@@ -125,142 +251,14 @@ function readStageShellRetentionMode(argv) {
|
|
|
125
251
|
false;
|
|
126
252
|
return enabled ? "always" : "on-failure";
|
|
127
253
|
}
|
|
128
|
-
function
|
|
129
|
-
const
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
return (outcome.result.passedCases * 1000) + outcome.result.passedChecks;
|
|
137
|
-
}
|
|
138
|
-
function snapshotWorkspace(workspacePath) {
|
|
139
|
-
const snapshotRoot = mkdtempSync(join(tmpdir(), "interf-compile-attempt-"));
|
|
140
|
-
const snapshotPath = join(snapshotRoot, "workspace");
|
|
141
|
-
cpSync(workspacePath, snapshotPath, { recursive: true });
|
|
142
|
-
return snapshotPath;
|
|
143
|
-
}
|
|
144
|
-
function restoreWorkspaceSnapshot(snapshotPath, workspacePath) {
|
|
145
|
-
rmSync(workspacePath, { recursive: true, force: true });
|
|
146
|
-
cpSync(snapshotPath, workspacePath, { recursive: true });
|
|
147
|
-
}
|
|
148
|
-
export async function runConfiguredWorkspaceCompile(options) {
|
|
149
|
-
const preserveStageShells = options.preserveStageShells ?? "on-failure";
|
|
150
|
-
const maxAttempts = resolveWorkspaceCompileMaxAttempts(options.workspaceConfig ?? { max_attempts: undefined }, options.maxAttemptsOverride);
|
|
151
|
-
const loopEnabled = maxAttempts != null;
|
|
152
|
-
const checks = options.workspaceConfig?.checks ?? [];
|
|
153
|
-
if (loopEnabled && checks.length === 0) {
|
|
154
|
-
console.log(chalk.yellow(" Self-improving mode needs saved truth checks. Building once without the retry loop."));
|
|
155
|
-
}
|
|
156
|
-
else if (loopEnabled) {
|
|
157
|
-
console.log(chalk.dim(` Self-improving mode: up to ${maxAttempts} compile attempts.`));
|
|
158
|
-
console.log(chalk.dim(" Interf Compiler will run the workflow, test the workspace, and retry until it passes or reaches the limit."));
|
|
159
|
-
}
|
|
160
|
-
if (!loopEnabled || checks.length === 0) {
|
|
161
|
-
const result = await compileWorkspaceWithReporter(options.executor, options.workspacePath, {
|
|
162
|
-
preserveStageShells,
|
|
163
|
-
});
|
|
164
|
-
if (!result.ok) {
|
|
165
|
-
process.exitCode = 1;
|
|
166
|
-
printCompileFailure(options.workspacePath, result.failedStage);
|
|
167
|
-
printStageShellReviewHint(options.workspacePath, preserveStageShells);
|
|
168
|
-
return false;
|
|
169
|
-
}
|
|
170
|
-
printStageShellReviewHint(options.workspacePath, preserveStageShells);
|
|
171
|
-
return true;
|
|
172
|
-
}
|
|
173
|
-
let bestOutcome = null;
|
|
174
|
-
let bestSnapshotPath = null;
|
|
175
|
-
let bestAttempt = 0;
|
|
176
|
-
try {
|
|
177
|
-
for (let attempt = 1; attempt <= maxAttempts; attempt += 1) {
|
|
178
|
-
if (attempt > 1) {
|
|
179
|
-
console.log();
|
|
180
|
-
console.log(chalk.dim(` Resetting generated workspace state before attempt ${attempt}/${maxAttempts}...`));
|
|
181
|
-
resetWorkspaceGeneratedState(options.workspacePath, "compile");
|
|
182
|
-
}
|
|
183
|
-
const result = await compileWorkspaceWithReporter(options.executor, options.workspacePath, {
|
|
184
|
-
heading: maxAttempts > 1
|
|
185
|
-
? `Building compiled workspace (attempt ${attempt}/${maxAttempts})...`
|
|
186
|
-
: "Building compiled workspace...",
|
|
187
|
-
successMessage: maxAttempts > 1
|
|
188
|
-
? `Compiled workspace ready for attempt ${attempt}.`
|
|
189
|
-
: "Compiled workspace ready.",
|
|
190
|
-
preserveStageShells,
|
|
191
|
-
});
|
|
192
|
-
if (!result.ok) {
|
|
193
|
-
printCompileFailure(options.workspacePath, result.failedStage);
|
|
194
|
-
printStageShellReviewHint(options.workspacePath, preserveStageShells);
|
|
195
|
-
if (attempt < maxAttempts) {
|
|
196
|
-
console.log(chalk.yellow(` Attempt ${attempt}/${maxAttempts} failed. Retrying with a fresh compile.`));
|
|
197
|
-
continue;
|
|
198
|
-
}
|
|
199
|
-
process.exitCode = 1;
|
|
200
|
-
return false;
|
|
201
|
-
}
|
|
202
|
-
const outcome = await runSavedWorkspaceTest({
|
|
203
|
-
sourcePath: options.sourcePath,
|
|
204
|
-
workspaceConfig: options.workspaceConfig ?? {
|
|
205
|
-
name: readInterfConfig(options.workspacePath)?.name ?? "workspace",
|
|
206
|
-
checks: [],
|
|
207
|
-
},
|
|
208
|
-
executionProfile: options.executionProfile,
|
|
209
|
-
workspacePath: options.workspacePath,
|
|
210
|
-
preserveSandboxes: preserveStageShells === "always" ? "always" : "on-failure",
|
|
211
|
-
});
|
|
212
|
-
if (!outcome) {
|
|
213
|
-
process.exitCode = 1;
|
|
214
|
-
console.log(chalk.red(" Could not run the saved workspace test after compile."));
|
|
215
|
-
return false;
|
|
216
|
-
}
|
|
217
|
-
console.log();
|
|
218
|
-
printSavedTestOutcome(`Compiled workspace · attempt ${attempt}/${maxAttempts}`, outcome);
|
|
219
|
-
if (!bestOutcome || testScore(outcome) > testScore(bestOutcome)) {
|
|
220
|
-
if (bestSnapshotPath) {
|
|
221
|
-
rmSync(bestSnapshotPath, { recursive: true, force: true });
|
|
222
|
-
}
|
|
223
|
-
bestOutcome = outcome;
|
|
224
|
-
bestSnapshotPath = snapshotWorkspace(options.workspacePath);
|
|
225
|
-
bestAttempt = attempt;
|
|
226
|
-
}
|
|
227
|
-
if (outcome.result.ok) {
|
|
228
|
-
console.log();
|
|
229
|
-
console.log(chalk.green(` Workspace passed on attempt ${attempt}/${maxAttempts}.`));
|
|
230
|
-
printStageShellReviewHint(options.workspacePath, preserveStageShells);
|
|
231
|
-
return true;
|
|
232
|
-
}
|
|
233
|
-
if (attempt < maxAttempts) {
|
|
234
|
-
console.log();
|
|
235
|
-
console.log(chalk.yellow(` Attempt ${attempt}/${maxAttempts} did not pass. Retrying with a fresh compile.`));
|
|
236
|
-
}
|
|
237
|
-
}
|
|
238
|
-
if (bestSnapshotPath && bestAttempt > 0 && bestAttempt !== maxAttempts) {
|
|
239
|
-
restoreWorkspaceSnapshot(bestSnapshotPath, options.workspacePath);
|
|
240
|
-
console.log();
|
|
241
|
-
console.log(chalk.dim(` Restored the best-performing compiled workspace from attempt ${bestAttempt}/${maxAttempts}.`));
|
|
242
|
-
}
|
|
243
|
-
process.exitCode = 1;
|
|
244
|
-
console.log();
|
|
245
|
-
console.log(chalk.red(` Workspace did not pass within ${maxAttempts} attempts.`));
|
|
246
|
-
if (bestOutcome) {
|
|
247
|
-
console.log(chalk.dim(` Best attempt truth-check pass rate: ${questionPassRate(bestOutcome)}%.`));
|
|
248
|
-
}
|
|
249
|
-
printStageShellReviewHint(options.workspacePath, preserveStageShells);
|
|
250
|
-
return false;
|
|
251
|
-
}
|
|
252
|
-
finally {
|
|
253
|
-
if (bestSnapshotPath) {
|
|
254
|
-
rmSync(bestSnapshotPath, { recursive: true, force: true });
|
|
255
|
-
}
|
|
256
|
-
}
|
|
257
|
-
}
|
|
258
|
-
function printStageShellReviewHint(workspacePath, preserveStageShells) {
|
|
259
|
-
const reviewRoot = join(workspacePath, ".interf", "execution-shells");
|
|
260
|
-
if (preserveStageShells === "always") {
|
|
261
|
-
console.log(chalk.dim(` Preserved stage shells: ${reviewRoot}`));
|
|
262
|
-
return;
|
|
254
|
+
function readCompileMaxLoopsOverride(argv) {
|
|
255
|
+
const raw = argv["max-loops"] ??
|
|
256
|
+
argv.maxLoops;
|
|
257
|
+
if (raw == null)
|
|
258
|
+
return null;
|
|
259
|
+
const parsed = Number.parseInt(String(raw), 10);
|
|
260
|
+
if (!Number.isInteger(parsed) || parsed < 1 || parsed > 3) {
|
|
261
|
+
throw new Error("`--max-loops` must be a whole number from 1 to 3.");
|
|
263
262
|
}
|
|
264
|
-
|
|
263
|
+
return parsed;
|
|
265
264
|
}
|
|
266
|
-
//# sourceMappingURL=compile.js.map
|
|
@@ -35,10 +35,12 @@ export declare function buildWorkspaceWorkflowOptions(sourcePath: string): {
|
|
|
35
35
|
label: string;
|
|
36
36
|
hint: string;
|
|
37
37
|
}[];
|
|
38
|
-
export declare function chooseWorkspaceWorkflow(sourcePath: string
|
|
38
|
+
export declare function chooseWorkspaceWorkflow(sourcePath: string, options?: {
|
|
39
|
+
currentWorkflowId?: string;
|
|
40
|
+
message?: string;
|
|
41
|
+
}): Promise<string | symbol>;
|
|
39
42
|
export declare function createWorkflowWizard(options?: {
|
|
40
43
|
intro?: boolean;
|
|
41
44
|
sourcePath?: string;
|
|
42
45
|
}, prompts?: WorkflowWizardPrompts): Promise<string | symbol>;
|
|
43
46
|
export declare function createWorkspaceWorkflowWizard(sourcePath: string, prompts?: WorkflowWizardPrompts): Promise<string | symbol>;
|
|
44
|
-
//# sourceMappingURL=create-workflow-wizard.d.ts.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import chalk from "chalk";
|
|
2
2
|
import * as p from "@clack/prompts";
|
|
3
3
|
import { listWorkspaceWorkflowChoices, } from "../lib/workflow-definitions.js";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
4
|
+
import { createLocalWorkflowPackageFromTemplate } from "../lib/interf-workflow-package.js";
|
|
5
|
+
import { isWorkflowId, } from "../lib/local-workflows.js";
|
|
6
6
|
import { slugify } from "../lib/util.js";
|
|
7
7
|
export const clackWorkflowPrompts = {
|
|
8
8
|
intro: p.intro,
|
|
@@ -23,10 +23,30 @@ export function formatWorkflowLabel(workflow) {
|
|
|
23
23
|
export function buildWorkspaceWorkflowOptions(sourcePath) {
|
|
24
24
|
return listWorkspaceWorkflowChoices(sourcePath).map(formatWorkflowLabel);
|
|
25
25
|
}
|
|
26
|
-
export async function chooseWorkspaceWorkflow(sourcePath) {
|
|
26
|
+
export async function chooseWorkspaceWorkflow(sourcePath, options = {}) {
|
|
27
|
+
const currentWorkflowId = options.currentWorkflowId;
|
|
28
|
+
const workflowOptions = buildWorkspaceWorkflowOptions(sourcePath);
|
|
29
|
+
const orderedOptions = workflowOptions
|
|
30
|
+
.map((option) => option.value === currentWorkflowId
|
|
31
|
+
? {
|
|
32
|
+
...option,
|
|
33
|
+
label: `${option.label} (Current)`,
|
|
34
|
+
hint: option.hint,
|
|
35
|
+
}
|
|
36
|
+
: option)
|
|
37
|
+
.sort((left, right) => {
|
|
38
|
+
if (left.value === currentWorkflowId)
|
|
39
|
+
return -1;
|
|
40
|
+
if (right.value === currentWorkflowId)
|
|
41
|
+
return 1;
|
|
42
|
+
return 0;
|
|
43
|
+
});
|
|
44
|
+
if (orderedOptions.length === 1) {
|
|
45
|
+
return orderedOptions[0]?.value ?? "interf";
|
|
46
|
+
}
|
|
27
47
|
return p.select({
|
|
28
|
-
message: "Workspace workflow?",
|
|
29
|
-
options:
|
|
48
|
+
message: options.message ?? "Workspace workflow?",
|
|
49
|
+
options: orderedOptions,
|
|
30
50
|
});
|
|
31
51
|
}
|
|
32
52
|
export async function createWorkflowWizard(options = {}, prompts = clackWorkflowPrompts) {
|
|
@@ -90,34 +110,16 @@ export async function createWorkspaceWorkflowWizard(sourcePath, prompts = clackW
|
|
|
90
110
|
});
|
|
91
111
|
if (prompts.isCancel(shapeBias))
|
|
92
112
|
return shapeBias;
|
|
93
|
-
const workflowPath =
|
|
94
|
-
|
|
95
|
-
|
|
113
|
+
const workflowPath = createLocalWorkflowPackageFromTemplate({
|
|
114
|
+
sourcePath,
|
|
115
|
+
baseWorkflowId: baseWorkflow,
|
|
116
|
+
workflowId,
|
|
96
117
|
label,
|
|
97
118
|
hint: hint.trim(),
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
shape: [shapeBias.trim()],
|
|
103
|
-
},
|
|
104
|
-
}, [
|
|
105
|
-
{
|
|
106
|
-
relativePath: "README.md",
|
|
107
|
-
content: [
|
|
108
|
-
renderJsonFrontmatter({ mode: "extend" }),
|
|
109
|
-
`# ${label}`,
|
|
110
|
-
"",
|
|
111
|
-
`This local workspace workflow extends \`${baseWorkflow}\`.`,
|
|
112
|
-
"",
|
|
113
|
-
`- summarize bias: ${summarizeBias.trim()}`,
|
|
114
|
-
`- structure bias: ${structureBias.trim()}`,
|
|
115
|
-
`- shape bias: ${shapeBias.trim()}`,
|
|
116
|
-
"",
|
|
117
|
-
].join("\n"),
|
|
118
|
-
},
|
|
119
|
-
]);
|
|
119
|
+
summarizeBias: summarizeBias.trim(),
|
|
120
|
+
structureBias: structureBias.trim(),
|
|
121
|
+
shapeBias: shapeBias.trim(),
|
|
122
|
+
});
|
|
120
123
|
prompts.log.info(`Saved local workflow: ${workflowPath}`);
|
|
121
124
|
return workflowId;
|
|
122
125
|
}
|
|
123
|
-
//# sourceMappingURL=create-workflow-wizard.js.map
|
|
@@ -6,4 +6,3 @@ export declare function createWorkspaceWizard(options?: {
|
|
|
6
6
|
executionProfile?: WorkflowExecutionProfile;
|
|
7
7
|
}): Promise<void>;
|
|
8
8
|
export { type WorkflowWizardPrompts, formatWorkflowLabel, chooseWorkspaceWorkflow, createWorkflowWizard, createWorkspaceWorkflowWizard, } from "./create-workflow-wizard.js";
|
|
9
|
-
//# sourceMappingURL=create.d.ts.map
|
package/dist/commands/create.js
CHANGED
|
@@ -5,7 +5,7 @@ import { detectInterf, defaultWorkspaceNameForSource, listWorkspacesForSourceFol
|
|
|
5
5
|
import { slugify } from "../lib/util.js";
|
|
6
6
|
import { addExecutionProfileOptions, executionProfileFromArgv, } from "../lib/execution-profile.js";
|
|
7
7
|
import { loadSourceFolderConfig, upsertSourceWorkspaceConfig } from "../lib/source-config.js";
|
|
8
|
-
import { chooseWorkspaceWorkflow, createWorkflowWizard, } from "./create-workflow-wizard.js";
|
|
8
|
+
import { buildWorkspaceWorkflowOptions, chooseWorkspaceWorkflow, createWorkflowWizard, } from "./create-workflow-wizard.js";
|
|
9
9
|
import { ensureWorkspaceFromConfig, } from "./workspace-flow.js";
|
|
10
10
|
import { DEFAULT_WORKSPACE_NAME, promptSingleWorkspaceConfig, } from "./source-config-wizard.js";
|
|
11
11
|
import { resolveOrConfigureLocalExecutor } from "./executor-flow.js";
|
|
@@ -36,7 +36,7 @@ async function selectCreateTarget() {
|
|
|
36
36
|
{
|
|
37
37
|
value: "workflow",
|
|
38
38
|
label: "Workflow",
|
|
39
|
-
hint: "Create a reusable local workflow
|
|
39
|
+
hint: "Create a reusable local workflow",
|
|
40
40
|
},
|
|
41
41
|
],
|
|
42
42
|
});
|
|
@@ -89,16 +89,21 @@ export async function createWorkspaceWizard(options = {}) {
|
|
|
89
89
|
p.log.info("Interf Compiler builds a compiled workspace on top of the dataset. The source files stay where they are and stay the source of truth.");
|
|
90
90
|
const existingConfig = loadSourceFolderConfig(cwd);
|
|
91
91
|
const suggestedName = slugify(defaultWorkspaceNameForSource(cwd) || basename(cwd)) || DEFAULT_WORKSPACE_NAME;
|
|
92
|
+
const workflowChoice = await chooseWorkspaceWorkflow(cwd, {
|
|
93
|
+
message: "Which workflow should this workspace start from?",
|
|
94
|
+
});
|
|
95
|
+
if (p.isCancel(workflowChoice))
|
|
96
|
+
return;
|
|
97
|
+
const workflowId = workflowChoice;
|
|
98
|
+
const workflowLabel = buildWorkspaceWorkflowOptions(cwd)
|
|
99
|
+
.find((option) => option.value === workflowId)?.label ?? workflowId;
|
|
92
100
|
const draft = await promptSingleWorkspaceConfig({
|
|
93
101
|
initial: { name: suggestedName },
|
|
94
102
|
introStyle: existingConfig ? "additional" : "first",
|
|
103
|
+
selectedWorkflowLabel: workflowLabel,
|
|
95
104
|
});
|
|
96
105
|
if (!draft)
|
|
97
106
|
return;
|
|
98
|
-
const workflowChoice = await chooseWorkspaceWorkflow(cwd);
|
|
99
|
-
if (p.isCancel(workflowChoice))
|
|
100
|
-
return;
|
|
101
|
-
const workflowId = workflowChoice;
|
|
102
107
|
const configToSave = {
|
|
103
108
|
...draft,
|
|
104
109
|
workflow: workflowId,
|
|
@@ -124,7 +129,7 @@ export async function createWorkspaceWizard(options = {}) {
|
|
|
124
129
|
return;
|
|
125
130
|
}
|
|
126
131
|
const compileNow = await p.confirm({
|
|
127
|
-
message: "Build it now? (Recommended)",
|
|
132
|
+
message: "Build it now with this workflow and compile mode? (Recommended)",
|
|
128
133
|
initialValue: true,
|
|
129
134
|
});
|
|
130
135
|
if (p.isCancel(compileNow) || !compileNow) {
|
|
@@ -155,11 +160,10 @@ async function compileWorkspaceAfterCreate(executor, sourcePath, workspaceConfig
|
|
|
155
160
|
workspaceConfig,
|
|
156
161
|
executionProfile,
|
|
157
162
|
maxAttemptsOverride: null,
|
|
163
|
+
maxLoopsOverride: null,
|
|
158
164
|
});
|
|
159
|
-
if (!compiled)
|
|
165
|
+
if (!compiled)
|
|
160
166
|
process.exitCode = 1;
|
|
161
|
-
|
|
162
|
-
}
|
|
167
|
+
return compiled;
|
|
163
168
|
}
|
|
164
169
|
export { formatWorkflowLabel, chooseWorkspaceWorkflow, createWorkflowWizard, createWorkspaceWorkflowWizard, } from "./create-workflow-wizard.js";
|
|
165
|
-
//# sourceMappingURL=create.js.map
|
package/dist/commands/default.js
CHANGED
package/dist/commands/doctor.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import chalk from "chalk";
|
|
2
|
-
import {
|
|
2
|
+
import { resolveAgent, runAgentPreflight } from "../lib/agents.js";
|
|
3
3
|
import { loadUserConfig } from "../lib/user-config.js";
|
|
4
4
|
function iconFor(status) {
|
|
5
5
|
if (status === "pass")
|
|
@@ -72,20 +72,6 @@ export const doctorCommand = {
|
|
|
72
72
|
status: "pass",
|
|
73
73
|
message: `${agent.displayName} is configured and available as \`${agent.command}\``,
|
|
74
74
|
});
|
|
75
|
-
const skillHealth = inspectInterfSkills(agent);
|
|
76
|
-
const skillProblems = [
|
|
77
|
-
...skillHealth.missing.map((name) => `missing ${name}`),
|
|
78
|
-
...skillHealth.stale.map((name) => `stale ${name}`),
|
|
79
|
-
...skillHealth.wrongAgent.map((name) => `wrong-agent ${name}`),
|
|
80
|
-
];
|
|
81
|
-
checks.push({
|
|
82
|
-
id: "skills",
|
|
83
|
-
label: "Optional global Interf Compiler skills",
|
|
84
|
-
status: skillProblems.length === 0 ? "pass" : "warn",
|
|
85
|
-
message: skillProblems.length === 0
|
|
86
|
-
? "Installed and current"
|
|
87
|
-
: `Optional only; refresh with \`interf\` or \`interf init\`. Problems: ${skillProblems.join(", ")}`,
|
|
88
|
-
});
|
|
89
75
|
if (argv.live) {
|
|
90
76
|
const preflight = runAgentPreflight(agent);
|
|
91
77
|
checks.push({
|
|
@@ -143,4 +129,3 @@ export const doctorCommand = {
|
|
|
143
129
|
process.exitCode = ok ? 0 : 1;
|
|
144
130
|
},
|
|
145
131
|
};
|
|
146
|
-
//# sourceMappingURL=doctor.js.map
|
package/dist/commands/init.d.ts
CHANGED