@interf/compiler 0.9.1 → 0.9.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -9
- package/agent-skills/interf-actions/SKILL.md +3 -0
- package/agent-skills/interf-actions/references/cli.md +13 -13
- package/{builtin-workflows/interf → builtin-methods/interf-default}/README.md +2 -2
- package/builtin-methods/interf-default/improve/SKILL.md +18 -0
- package/{builtin-workflows/interf/workflow.json → builtin-methods/interf-default/method.json} +4 -4
- package/{builtin-workflows/interf/workflow.schema.json → builtin-methods/interf-default/method.schema.json} +2 -2
- package/dist/cli/commands/check-draft.d.ts +6 -6
- package/dist/cli/commands/check-draft.js +5 -5
- package/dist/cli/commands/compile-controller.d.ts +7 -7
- package/dist/cli/commands/compile-controller.js +35 -38
- package/dist/cli/commands/compile.d.ts +3 -3
- package/dist/cli/commands/compile.js +23 -21
- package/dist/cli/commands/compiled-flow.d.ts +11 -11
- package/dist/cli/commands/compiled-flow.js +33 -30
- package/dist/cli/commands/create-method-wizard.d.ts +76 -0
- package/dist/cli/commands/{create-workflow-wizard.js → create-method-wizard.js} +153 -163
- package/dist/cli/commands/create.d.ts +3 -3
- package/dist/cli/commands/create.js +44 -45
- package/dist/cli/commands/default.js +1 -1
- package/dist/cli/commands/executor-flow.d.ts +6 -6
- package/dist/cli/commands/executor-flow.js +1 -1
- package/dist/cli/commands/init.d.ts +2 -2
- package/dist/cli/commands/init.js +139 -118
- package/dist/cli/commands/list.js +11 -10
- package/dist/cli/commands/preparation-selection.d.ts +3 -3
- package/dist/cli/commands/source-config-wizard.d.ts +9 -9
- package/dist/cli/commands/source-config-wizard.js +43 -43
- package/dist/cli/commands/status.js +36 -9
- package/dist/cli/commands/test-flow.d.ts +15 -15
- package/dist/cli/commands/test-flow.js +29 -219
- package/dist/cli/commands/test.d.ts +2 -2
- package/dist/cli/commands/test.js +50 -51
- package/dist/cli/commands/verify.js +7 -7
- package/dist/cli/commands/web.js +41 -28
- package/dist/compiler-ui/404.html +1 -0
- package/dist/compiler-ui/__next.__PAGE__.txt +10 -0
- package/dist/compiler-ui/__next._full.txt +20 -0
- package/dist/compiler-ui/__next._head.txt +5 -0
- package/dist/compiler-ui/__next._index.txt +5 -0
- package/dist/compiler-ui/__next._tree.txt +5 -0
- package/dist/compiler-ui/_next/static/chunks/06yhdspx~ca5-.js +5 -0
- package/{apps/compiler-ui/.next/static/chunks/0fgt_8knmicoz.js → dist/compiler-ui/_next/static/chunks/0d~8t0zm6545p.js} +15 -21
- package/dist/compiler-ui/_next/static/chunks/0xnel.ax9a.2c.css +3 -0
- package/{apps/compiler-ui/.next/static/chunks/turbopack-109rtik40vwh5.js → dist/compiler-ui/_next/static/chunks/turbopack-0.uq1k8c0j4s..js} +1 -1
- package/dist/compiler-ui/_not-found/__next._full.txt +15 -0
- package/dist/compiler-ui/_not-found/__next._head.txt +5 -0
- package/dist/compiler-ui/_not-found/__next._index.txt +5 -0
- package/dist/compiler-ui/_not-found/__next._not-found.__PAGE__.txt +5 -0
- package/dist/compiler-ui/_not-found/__next._not-found.txt +5 -0
- package/dist/compiler-ui/_not-found/__next._tree.txt +2 -0
- package/dist/compiler-ui/_not-found.html +1 -0
- package/dist/compiler-ui/_not-found.txt +15 -0
- package/{apps/compiler-ui/.next/server/app → dist/compiler-ui}/index.html +1 -1
- package/dist/compiler-ui/index.txt +20 -0
- package/dist/index.d.ts +8 -6
- package/dist/index.js +5 -3
- package/dist/packages/agents/index.d.ts +1 -1
- package/dist/packages/agents/lib/args.d.ts +2 -2
- package/dist/packages/agents/lib/compiled-bootstrap.js +7 -6
- package/dist/packages/agents/lib/execution-profile.d.ts +5 -5
- package/dist/packages/agents/lib/execution-profile.js +7 -6
- package/dist/packages/agents/lib/executors.d.ts +13 -13
- package/dist/packages/agents/lib/preflight.d.ts +1 -0
- package/dist/packages/agents/lib/preflight.js +32 -9
- package/dist/packages/agents/lib/shells.d.ts +25 -24
- package/dist/packages/agents/lib/shells.js +161 -154
- package/dist/packages/agents/lib/types.d.ts +2 -2
- package/dist/packages/compiler/artifact-counts.d.ts +1 -0
- package/dist/packages/compiler/artifact-counts.js +30 -0
- package/dist/packages/compiler/compiled-paths.d.ts +4 -7
- package/dist/packages/compiler/compiled-paths.js +9 -15
- package/dist/packages/compiler/compiled-pipeline.d.ts +11 -12
- package/dist/packages/compiler/compiled-pipeline.js +22 -22
- package/dist/packages/compiler/compiled-schema.d.ts +20 -20
- package/dist/packages/compiler/compiled-schema.js +29 -29
- package/dist/packages/compiler/compiled-stage-plan.d.ts +4 -4
- package/dist/packages/compiler/compiled-stage-plan.js +8 -8
- package/dist/packages/compiler/compiled-stage-runner.d.ts +5 -5
- package/dist/packages/compiler/compiled-stage-runner.js +7 -7
- package/dist/packages/compiler/compiled-target.d.ts +5 -5
- package/dist/packages/compiler/compiled-target.js +5 -5
- package/dist/packages/compiler/index.d.ts +3 -3
- package/dist/packages/compiler/index.js +2 -2
- package/dist/packages/compiler/lib/schema.d.ts +62 -247
- package/dist/packages/compiler/lib/schema.js +56 -174
- package/dist/packages/compiler/{workflows.d.ts → method-runs.d.ts} +4 -4
- package/dist/packages/compiler/{workflows.js → method-runs.js} +4 -3
- package/dist/packages/compiler/raw-snapshot.d.ts +0 -7
- package/dist/packages/compiler/raw-snapshot.js +0 -1
- package/dist/packages/compiler/reset.js +3 -3
- package/dist/packages/compiler/runtime-acceptance.js +9 -16
- package/dist/packages/compiler/runtime-contracts.js +9 -9
- package/dist/packages/compiler/runtime-prompt.js +4 -4
- package/dist/packages/compiler/runtime-reconcile.d.ts +2 -2
- package/dist/packages/compiler/runtime-reconcile.js +3 -3
- package/dist/packages/compiler/runtime-runs.js +9 -9
- package/dist/packages/compiler/runtime-types.d.ts +8 -7
- package/dist/packages/compiler/state-health.js +26 -35
- package/dist/packages/compiler/state-view.js +6 -6
- package/dist/packages/compiler/validate-compiled.d.ts +5 -5
- package/dist/packages/compiler/validate-compiled.js +56 -64
- package/dist/packages/compiler/validate.d.ts +2 -2
- package/dist/packages/compiler/validate.js +22 -14
- package/dist/packages/contracts/index.d.ts +2 -0
- package/dist/packages/contracts/index.js +1 -0
- package/dist/packages/contracts/lib/schema.d.ts +205 -0
- package/dist/packages/contracts/lib/schema.js +101 -0
- package/dist/packages/execution/index.d.ts +2 -2
- package/dist/packages/execution/index.js +1 -1
- package/dist/packages/execution/lib/schema.d.ts +80 -83
- package/dist/packages/execution/lib/schema.js +25 -48
- package/dist/packages/local-service/action-values.d.ts +1 -1
- package/dist/packages/local-service/action-values.js +1 -1
- package/dist/packages/local-service/client.d.ts +4 -4
- package/dist/packages/local-service/client.js +4 -4
- package/dist/packages/local-service/index.d.ts +3 -3
- package/dist/packages/local-service/index.js +2 -2
- package/dist/packages/local-service/lib/schema.d.ts +540 -974
- package/dist/packages/local-service/lib/schema.js +44 -160
- package/dist/packages/local-service/run-observability.d.ts +6 -0
- package/dist/packages/local-service/run-observability.js +592 -0
- package/dist/packages/local-service/runtime.d.ts +19 -23
- package/dist/packages/local-service/runtime.js +349 -913
- package/dist/packages/local-service/server.d.ts +1 -0
- package/dist/packages/local-service/server.js +25 -20
- package/dist/packages/method-authoring/index.d.ts +4 -0
- package/dist/packages/method-authoring/index.js +4 -0
- package/dist/packages/{workflow-authoring/lib/workflow-edit-utils.d.ts → method-authoring/lib/method-edit-utils.d.ts} +3 -3
- package/dist/packages/method-authoring/method-authoring.d.ts +24 -0
- package/dist/packages/method-authoring/method-authoring.js +116 -0
- package/dist/packages/method-authoring/method-edit-session.d.ts +18 -0
- package/dist/packages/method-authoring/method-edit-session.js +125 -0
- package/dist/packages/method-authoring/method-improvement.d.ts +23 -0
- package/dist/packages/{workflow-authoring/workflow-improvement.js → method-authoring/method-improvement.js} +63 -63
- package/dist/packages/{workflow-package/builtin-compiled-workflow.d.ts → method-package/builtin-compiled-method.d.ts} +1 -1
- package/dist/packages/{workflow-package/builtin-compiled-workflow.js → method-package/builtin-compiled-method.js} +17 -17
- package/dist/packages/{workflow-package → method-package}/context-interface.d.ts +12 -12
- package/dist/packages/{workflow-package → method-package}/context-interface.js +19 -19
- package/dist/packages/method-package/index.d.ts +11 -0
- package/dist/packages/method-package/index.js +11 -0
- package/dist/packages/method-package/interf-method-package.d.ts +31 -0
- package/dist/packages/{workflow-package/interf-workflow-package.js → method-package/interf-method-package.js} +145 -145
- package/dist/packages/{workflow-package → method-package}/lib/package-root.js +1 -1
- package/dist/packages/method-package/local-methods.d.ts +64 -0
- package/dist/packages/method-package/local-methods.js +466 -0
- package/dist/packages/method-package/method-definitions.d.ts +83 -0
- package/dist/packages/method-package/method-definitions.js +205 -0
- package/dist/packages/{workflow-package/workflow-helpers.d.ts → method-package/method-helpers.d.ts} +10 -10
- package/dist/packages/{workflow-package/workflow-helpers.js → method-package/method-helpers.js} +22 -26
- package/dist/packages/method-package/method-review-paths.d.ts +10 -0
- package/dist/packages/{workflow-package/workflow-review-paths.js → method-package/method-review-paths.js} +4 -4
- package/dist/packages/{workflow-package/workflow-stage-runner.d.ts → method-package/method-stage-runner.d.ts} +12 -11
- package/dist/packages/{workflow-package/workflow-stage-runner.js → method-package/method-stage-runner.js} +6 -6
- package/dist/packages/methods/index.d.ts +2 -0
- package/dist/packages/methods/index.js +2 -0
- package/dist/packages/methods/method-resolution.d.ts +6 -0
- package/dist/packages/methods/method-resolution.js +7 -0
- package/dist/packages/project-model/index.d.ts +1 -4
- package/dist/packages/project-model/index.js +0 -3
- package/dist/packages/project-model/interf-detect.d.ts +1 -5
- package/dist/packages/project-model/interf-detect.js +7 -18
- package/dist/packages/project-model/interf-scaffold.d.ts +2 -2
- package/dist/packages/project-model/interf-scaffold.js +38 -39
- package/dist/packages/project-model/interf.d.ts +1 -2
- package/dist/packages/project-model/interf.js +1 -2
- package/dist/packages/project-model/lib/schema.d.ts +2 -66
- package/dist/packages/project-model/lib/schema.js +5 -23
- package/dist/packages/project-model/project-paths.d.ts +9 -10
- package/dist/packages/project-model/project-paths.js +14 -17
- package/dist/packages/project-model/source-config.d.ts +11 -18
- package/dist/packages/project-model/source-config.js +42 -60
- package/dist/packages/project-model/source-folders.d.ts +4 -4
- package/dist/packages/project-model/source-folders.js +10 -10
- package/dist/packages/testing/index.d.ts +2 -2
- package/dist/packages/testing/index.js +1 -1
- package/dist/packages/testing/lib/schema.d.ts +11 -11
- package/dist/packages/testing/lib/schema.js +8 -9
- package/dist/packages/testing/readiness-check-run.d.ts +67 -0
- package/dist/packages/testing/readiness-check-run.js +258 -0
- package/dist/packages/testing/test-execution.d.ts +3 -3
- package/dist/packages/testing/test-execution.js +5 -5
- package/dist/packages/testing/test-paths.js +6 -6
- package/dist/packages/testing/test-profile-presets.js +2 -2
- package/dist/packages/testing/test-sandbox.js +10 -11
- package/dist/packages/testing/test-targets.d.ts +1 -1
- package/dist/packages/testing/test-targets.js +8 -7
- package/dist/packages/testing/test-types.d.ts +1 -1
- package/package.json +16 -33
- package/apps/compiler-ui/.next/static/chunks/0ti_66mx7~w2-.js +0 -5
- package/apps/compiler-ui/.next/static/chunks/13g~4mamjft.c.css +0 -3
- package/builtin-workflows/interf/improve/SKILL.md +0 -18
- package/dist/cli/commands/create-workflow-wizard.d.ts +0 -76
- package/dist/packages/project-model/compiled-paths.d.ts +0 -1
- package/dist/packages/project-model/compiled-paths.js +0 -1
- package/dist/packages/project-model/compiled-raw.d.ts +0 -1
- package/dist/packages/project-model/compiled-raw.js +0 -1
- package/dist/packages/project-model/compiled-reset.d.ts +0 -1
- package/dist/packages/project-model/compiled-reset.js +0 -1
- package/dist/packages/shared/index.d.ts +0 -7
- package/dist/packages/shared/index.js +0 -7
- package/dist/packages/shared/util.d.ts +0 -3
- package/dist/packages/shared/util.js +0 -3
- package/dist/packages/testing/test-matrices.d.ts +0 -90
- package/dist/packages/testing/test-matrices.js +0 -96
- package/dist/packages/workflow-authoring/index.d.ts +0 -4
- package/dist/packages/workflow-authoring/index.js +0 -4
- package/dist/packages/workflow-authoring/workflow-authoring.d.ts +0 -24
- package/dist/packages/workflow-authoring/workflow-authoring.js +0 -82
- package/dist/packages/workflow-authoring/workflow-edit-session.d.ts +0 -18
- package/dist/packages/workflow-authoring/workflow-edit-session.js +0 -91
- package/dist/packages/workflow-authoring/workflow-improvement.d.ts +0 -23
- package/dist/packages/workflow-package/index.d.ts +0 -11
- package/dist/packages/workflow-package/index.js +0 -11
- package/dist/packages/workflow-package/interf-workflow-package.d.ts +0 -31
- package/dist/packages/workflow-package/local-workflows.d.ts +0 -64
- package/dist/packages/workflow-package/local-workflows.js +0 -457
- package/dist/packages/workflow-package/workflow-definitions.d.ts +0 -82
- package/dist/packages/workflow-package/workflow-definitions.js +0 -211
- package/dist/packages/workflow-package/workflow-review-paths.d.ts +0 -10
- /package/{builtin-workflows/interf → builtin-methods/interf-default}/compile/stages/shape/SKILL.md +0 -0
- /package/{builtin-workflows/interf → builtin-methods/interf-default}/compile/stages/structure/SKILL.md +0 -0
- /package/{builtin-workflows/interf → builtin-methods/interf-default}/compile/stages/summarize/SKILL.md +0 -0
- /package/{builtin-workflows/interf → builtin-methods/interf-default}/use/query/SKILL.md +0 -0
- /package/{apps/compiler-ui/.next → dist/compiler-ui/_next}/static/chunks/03~yq9q893hmn.js +0 -0
- /package/{apps/compiler-ui/.next → dist/compiler-ui/_next}/static/chunks/06z~l3kwb891e.js +0 -0
- /package/{apps/compiler-ui/.next → dist/compiler-ui/_next}/static/chunks/08g7lvje.te.u.js +0 -0
- /package/{apps/compiler-ui/.next → dist/compiler-ui/_next}/static/chunks/08m7vf5asqlsm.js +0 -0
- /package/{apps/compiler-ui/.next → dist/compiler-ui/_next}/static/chunks/0_i-3_5l9t2qe.js +0 -0
- /package/{apps/compiler-ui/.next → dist/compiler-ui/_next}/static/chunks/0b-ywny_j0g~0.js +0 -0
- /package/{apps/compiler-ui/.next → dist/compiler-ui/_next}/static/chunks/0b52v41o1gixx.js +0 -0
- /package/{apps/compiler-ui/.next → dist/compiler-ui/_next}/static/chunks/0gpzgsv0w.q~m.js +0 -0
- /package/{apps/compiler-ui/.next → dist/compiler-ui/_next}/static/chunks/0ilwfezfvu6~-.js +0 -0
- /package/{apps/compiler-ui/.next → dist/compiler-ui/_next}/static/chunks/0n51hrfoufc7g.js +0 -0
- /package/{apps/compiler-ui/.next → dist/compiler-ui/_next}/static/chunks/0xxmf45eskdt~.css +0 -0
- /package/{apps/compiler-ui/.next → dist/compiler-ui/_next}/static/chunks/0y5z3t-z1c8ks.js.map +0 -0
- /package/{apps/compiler-ui/.next → dist/compiler-ui/_next}/static/chunks/14wtz~vq25~qq.js +0 -0
- /package/{apps/compiler-ui/.next → dist/compiler-ui/_next}/static/chunks/turbopack-10e~t1yzi4svj.js +0 -0
- /package/{apps/compiler-ui/.next → dist/compiler-ui/_next}/static/chunks/turbopack-worker-0sjn--fhq~1cg.js +0 -0
- /package/{apps/compiler-ui/.next/static/XWKL548yXD_UOG4ID9G3J → dist/compiler-ui/_next/static/j7pdoqWrl4YJrJUVnksbl}/_buildManifest.js +0 -0
- /package/{apps/compiler-ui/.next/static/XWKL548yXD_UOG4ID9G3J → dist/compiler-ui/_next/static/j7pdoqWrl4YJrJUVnksbl}/_clientMiddlewareManifest.js +0 -0
- /package/{apps/compiler-ui/.next/static/XWKL548yXD_UOG4ID9G3J → dist/compiler-ui/_next/static/j7pdoqWrl4YJrJUVnksbl}/_ssgManifest.js +0 -0
- /package/{apps/compiler-ui/.next → dist/compiler-ui/_next}/static/media/GeistMono_Variable.p.17jn9btb_52pq.woff2 +0 -0
- /package/{apps/compiler-ui/.next → dist/compiler-ui/_next}/static/media/Geist_Variable-s.p.0-te~ja_gpvcf.woff2 +0 -0
- /package/{apps/compiler-ui/.next → dist/compiler-ui/_next}/static/media/worker.102zas1s52_pf.js +0 -0
- /package/dist/packages/compiler/{workflow-primitives.d.ts → method-primitives.d.ts} +0 -0
- /package/dist/packages/compiler/{workflow-primitives.js → method-primitives.js} +0 -0
- /package/dist/packages/{workflow-authoring/lib/workflow-edit-utils.js → method-authoring/lib/method-edit-utils.js} +0 -0
- /package/dist/packages/{workflow-package → method-package}/lib/package-root.d.ts +0 -0
- /package/dist/packages/{workflow-package/workflow-stage-policy.d.ts → method-package/method-stage-policy.d.ts} +0 -0
- /package/dist/packages/{workflow-package/workflow-stage-policy.js → method-package/method-stage-policy.js} +0 -0
|
@@ -1,19 +1,34 @@
|
|
|
1
1
|
import chalk from "chalk";
|
|
2
2
|
import * as p from "@clack/prompts";
|
|
3
3
|
import { existsSync, statSync } from "node:fs";
|
|
4
|
+
import { homedir } from "node:os";
|
|
4
5
|
import { basename, isAbsolute, relative, resolve } from "node:path";
|
|
5
6
|
import { assertCompiledContainer, detectInterf, ensurePortableContextScaffold, readInterfConfig, resolveSourceControlPath, } from "../../packages/project-model/interf.js";
|
|
6
|
-
import { SOURCE_FOLDER_CONFIG_PATH, configuredSourceFolderPath, loadSourceFolderConfig, resolveConfiguredSourceFolderPath, saveSourceFolderConfig,
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import { findBuiltCompiledPath, findSavedCompiledConfig,
|
|
7
|
+
import { SOURCE_FOLDER_CONFIG_PATH, configuredSourceFolderPath, loadSourceFolderConfig, resolveConfiguredSourceFolderPath, saveSourceFolderConfig, syncCompiledInterfConfigFromSourcePreparationConfig, upsertSourcePreparationConfig, } from "../../packages/project-model/source-config.js";
|
|
8
|
+
import { defaultPreparationNameForPath, } from "../../packages/project-model/source-folders.js";
|
|
9
|
+
import { DEFAULT_PREPARATION_NAME, describeCompileLoopSelection, listSourceFolderChoices, promptSingleCompiledConfig, } from "./source-config-wizard.js";
|
|
10
|
+
import { chooseOrCreateCompiledMethodForPreparation, createMethodWizard, } from "./create-method-wizard.js";
|
|
11
|
+
import { seedLocalDefaultMethod } from "../../packages/method-package/local-methods.js";
|
|
12
|
+
import { findBuiltCompiledPath, findSavedCompiledConfig, listSavedPreparationEntries, } from "./compiled-flow.js";
|
|
12
13
|
import { readCurrentSavedTestComparison, } from "./test-flow.js";
|
|
13
14
|
import { runCompileCommand } from "./compile.js";
|
|
14
15
|
import { runTestCommand } from "./test.js";
|
|
15
16
|
import { defaultInterfInstanceRoot, relativeSourceFolderPath, resolveInterfInstanceContext, } from "./control-path.js";
|
|
16
17
|
import { runWebCommand } from "./web.js";
|
|
18
|
+
function displayPath(path) {
|
|
19
|
+
const resolvedPath = resolve(path);
|
|
20
|
+
const cwd = process.cwd();
|
|
21
|
+
if (resolvedPath === cwd)
|
|
22
|
+
return ".";
|
|
23
|
+
if (isPathInside(cwd, resolvedPath))
|
|
24
|
+
return `./${relative(cwd, resolvedPath)}`;
|
|
25
|
+
const home = homedir();
|
|
26
|
+
if (resolvedPath === home)
|
|
27
|
+
return "~";
|
|
28
|
+
if (isPathInside(home, resolvedPath))
|
|
29
|
+
return `~/${relative(home, resolvedPath)}`;
|
|
30
|
+
return resolvedPath;
|
|
31
|
+
}
|
|
17
32
|
function isPathInside(parentPath, childPath) {
|
|
18
33
|
const relativePath = relative(parentPath, childPath);
|
|
19
34
|
return relativePath === "" || (!relativePath.startsWith("..") && !isAbsolute(relativePath));
|
|
@@ -45,7 +60,7 @@ function normalizeInterfInstanceFolderInput(cwd, sourceFolderPath, input) {
|
|
|
45
60
|
return controlPath;
|
|
46
61
|
}
|
|
47
62
|
async function promptSourceFolderForInstance(cwd) {
|
|
48
|
-
const folderChoices =
|
|
63
|
+
const folderChoices = listSourceFolderChoices(cwd);
|
|
49
64
|
const selected = await p.select({
|
|
50
65
|
message: "Which Source Folder should Interf prepare?",
|
|
51
66
|
options: [
|
|
@@ -119,13 +134,11 @@ async function setupInterfInstance(cwd) {
|
|
|
119
134
|
source_folder: { path: sourceFolderConfigPath },
|
|
120
135
|
preparations: [],
|
|
121
136
|
});
|
|
122
|
-
const seeded =
|
|
123
|
-
p.log.info(`Source Folder: ${sourceFolderPath}`);
|
|
124
|
-
p.log.info(`Interf Workspace: ${controlPath}`);
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
p.log.info(`Copied built-in Method package to interf/methods/${seeded.workflowId}/. Inspect or fork it anytime.`);
|
|
128
|
-
}
|
|
137
|
+
const seeded = seedLocalDefaultMethod({ sourcePath: controlPath });
|
|
138
|
+
p.log.info(`Source Folder: ${displayPath(sourceFolderPath)}`);
|
|
139
|
+
p.log.info(`Interf Workspace: ${displayPath(controlPath)}`);
|
|
140
|
+
if (!seeded.alreadyExisted)
|
|
141
|
+
p.log.info(`Method: ${seeded.methodId}`);
|
|
129
142
|
return {
|
|
130
143
|
sourceFolderPath,
|
|
131
144
|
controlPath,
|
|
@@ -134,7 +147,7 @@ async function setupInterfInstance(cwd) {
|
|
|
134
147
|
}
|
|
135
148
|
async function promptEmptyInstanceAction() {
|
|
136
149
|
const selected = await p.select({
|
|
137
|
-
message: "What
|
|
150
|
+
message: "What next?",
|
|
138
151
|
options: [
|
|
139
152
|
{
|
|
140
153
|
value: "web",
|
|
@@ -175,29 +188,30 @@ export function currentRunTargetStatus(rows, target) {
|
|
|
175
188
|
return "mixed";
|
|
176
189
|
return "fail";
|
|
177
190
|
}
|
|
178
|
-
function describeSavedReadinessChecks(
|
|
179
|
-
const count =
|
|
191
|
+
function describeSavedReadinessChecks(preparation) {
|
|
192
|
+
const count = preparation.checks.length;
|
|
180
193
|
if (count === 0)
|
|
181
|
-
return "
|
|
194
|
+
return "no checks";
|
|
182
195
|
return `${count} readiness check${count === 1 ? "" : "s"}`;
|
|
183
196
|
}
|
|
184
|
-
function
|
|
197
|
+
function printPreparationSummary(options) {
|
|
185
198
|
const compiledConfig = options.builtCompiledPath
|
|
186
199
|
? readInterfConfig(options.builtCompiledPath)
|
|
187
200
|
: null;
|
|
188
|
-
const
|
|
189
|
-
|
|
190
|
-
p.log.info(`
|
|
191
|
-
if (options.
|
|
192
|
-
p.log.info(`
|
|
193
|
-
}
|
|
194
|
-
p.log.info(`
|
|
195
|
-
p.log.info(
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
+
const methodLabel = `${options.preparation.method ?? "interf-default"}${compiledConfig?.method_origin?.local_draft === true ? " (local draft)" : ""}`;
|
|
202
|
+
const sourceFolderPath = resolve(options.sourcePath, options.preparation.path);
|
|
203
|
+
p.log.info(`Preparation: ${options.preparation.name} · Method: ${methodLabel}`);
|
|
204
|
+
if (options.preparation.about) {
|
|
205
|
+
p.log.info(`Agent work: ${options.preparation.about}`);
|
|
206
|
+
}
|
|
207
|
+
p.log.info(`Source Folder: ${displayPath(sourceFolderPath)}`);
|
|
208
|
+
p.log.info(`Portable Context: ${options.built ? "built" : "not built"} · Readiness: ${describeSavedReadinessChecks(options.preparation)}`);
|
|
209
|
+
const prepareMode = describeCompileLoopSelection({
|
|
210
|
+
maxAttempts: options.preparation.max_attempts,
|
|
211
|
+
maxLoops: options.preparation.max_loops,
|
|
212
|
+
});
|
|
213
|
+
if (prepareMode !== "Prepare once.")
|
|
214
|
+
p.log.info(`Prepare mode: ${prepareMode}`);
|
|
201
215
|
if (options.latestComparison?.raw && options.latestComparison?.compiled) {
|
|
202
216
|
p.log.info(`Latest saved comparison: source files ${options.latestComparison.raw.passed_cases}/${options.latestComparison.raw.total_cases}, Portable Context ${options.latestComparison.compiled.passed_cases}/${options.latestComparison.compiled.total_cases}.`);
|
|
203
217
|
}
|
|
@@ -211,37 +225,45 @@ function printDatasetSummary(options) {
|
|
|
211
225
|
p.log.info("Saved readiness results are stale for the current checks.");
|
|
212
226
|
}
|
|
213
227
|
if (options.sourcePath !== process.cwd()) {
|
|
214
|
-
p.log.info(`Interf Workspace: ${options.sourcePath}`);
|
|
228
|
+
p.log.info(`Interf Workspace: ${displayPath(options.sourcePath)}`);
|
|
215
229
|
}
|
|
216
230
|
}
|
|
217
|
-
async function
|
|
231
|
+
async function promptPreparationAction(preparation, built, latestComparison) {
|
|
218
232
|
const options = [];
|
|
219
233
|
const hasSavedRawBaseline = Boolean(latestComparison?.raw);
|
|
220
234
|
const latestRawPasses = latestComparison?.raw &&
|
|
221
235
|
latestComparison.raw.passed_cases === latestComparison.raw.total_cases;
|
|
222
236
|
const compileOption = {
|
|
223
237
|
value: "compile",
|
|
224
|
-
label: built ? "Prepare again
|
|
238
|
+
label: built ? "Prepare again" : "Prepare files",
|
|
225
239
|
hint: built
|
|
226
|
-
? "Refresh
|
|
227
|
-
:
|
|
240
|
+
? "Refresh Portable Context"
|
|
241
|
+
: preparation.checks.length > 0
|
|
228
242
|
? latestRawPasses
|
|
229
|
-
? "
|
|
243
|
+
? "Use the latest source-files baseline"
|
|
230
244
|
: hasSavedRawBaseline
|
|
231
|
-
? "
|
|
232
|
-
: "
|
|
233
|
-
: "
|
|
245
|
+
? "Run the same readiness checks after prepare"
|
|
246
|
+
: "Write Portable Context"
|
|
247
|
+
: "Write Portable Context",
|
|
234
248
|
};
|
|
235
|
-
|
|
249
|
+
const webOption = {
|
|
250
|
+
value: "web",
|
|
251
|
+
label: "Open Interf UI",
|
|
252
|
+
hint: "Start the local UI and API for this Interf Workspace",
|
|
253
|
+
};
|
|
254
|
+
if (built) {
|
|
255
|
+
options.push(webOption);
|
|
256
|
+
}
|
|
257
|
+
if (preparation.checks.length > 0) {
|
|
236
258
|
const testOption = {
|
|
237
259
|
value: "test",
|
|
238
260
|
label: built
|
|
239
|
-
? "Run readiness checks
|
|
261
|
+
? "Run readiness checks"
|
|
240
262
|
: hasSavedRawBaseline
|
|
241
263
|
? "Rerun the source-files baseline"
|
|
242
264
|
: "Measure the source-files baseline",
|
|
243
265
|
hint: built
|
|
244
|
-
? "
|
|
266
|
+
? "Check source files and Portable Context"
|
|
245
267
|
: hasSavedRawBaseline
|
|
246
268
|
? "Refresh the saved source-files baseline on the current readiness checks"
|
|
247
269
|
: "Optional source-files readiness baseline before Interf builds Portable Context",
|
|
@@ -257,33 +279,32 @@ async function promptDatasetAction(dataset, built, latestComparison) {
|
|
|
257
279
|
options.push(compileOption);
|
|
258
280
|
}
|
|
259
281
|
options.push({
|
|
260
|
-
value: "
|
|
282
|
+
value: "preparation",
|
|
261
283
|
label: "Add another Preparation",
|
|
262
|
-
hint: "
|
|
284
|
+
hint: "Separate source, focus, or checks",
|
|
263
285
|
}, {
|
|
264
286
|
value: "edit",
|
|
265
|
-
label: "
|
|
266
|
-
hint: "
|
|
287
|
+
label: preparation.checks.length === 0 ? "Add readiness checks" : "Edit checks and settings",
|
|
288
|
+
hint: "Checks, focus, Method, or mode",
|
|
267
289
|
}, {
|
|
268
|
-
value: "
|
|
290
|
+
value: "method",
|
|
269
291
|
label: "Create Method",
|
|
270
|
-
hint: "
|
|
292
|
+
hint: "Custom file processing",
|
|
271
293
|
}, {
|
|
272
294
|
value: "done",
|
|
273
295
|
label: "Done",
|
|
274
296
|
hint: "Exit the wizard",
|
|
275
297
|
});
|
|
276
298
|
const selected = await p.select({
|
|
277
|
-
message: "What
|
|
299
|
+
message: "What next?",
|
|
278
300
|
options,
|
|
279
301
|
});
|
|
280
302
|
if (p.isCancel(selected))
|
|
281
303
|
return null;
|
|
282
304
|
return selected;
|
|
283
305
|
}
|
|
284
|
-
function
|
|
285
|
-
if (
|
|
286
|
-
p.log.info("No readiness checks yet. You can prepare files first, then add checks when you know what evidence matters.");
|
|
306
|
+
function printPreparationRecommendation(preparation, built, latestComparison) {
|
|
307
|
+
if (preparation.checks.length === 0) {
|
|
287
308
|
return;
|
|
288
309
|
}
|
|
289
310
|
if (!built) {
|
|
@@ -312,7 +333,7 @@ async function promptPostBaselineAction(rows) {
|
|
|
312
333
|
}
|
|
313
334
|
const compileRecommended = status !== "pass";
|
|
314
335
|
const selected = await p.select({
|
|
315
|
-
message: "What
|
|
336
|
+
message: "What next?",
|
|
316
337
|
options: [
|
|
317
338
|
{
|
|
318
339
|
value: "compile",
|
|
@@ -350,7 +371,7 @@ async function chooseCompiledForWizard(options) {
|
|
|
350
371
|
if (options.fixedCompiledName) {
|
|
351
372
|
return findSavedCompiledConfig(options.sourcePath, options.fixedCompiledName);
|
|
352
373
|
}
|
|
353
|
-
const savedEntries =
|
|
374
|
+
const savedEntries = listSavedPreparationEntries(options.sourcePath);
|
|
354
375
|
if (savedEntries.length === 0)
|
|
355
376
|
return null;
|
|
356
377
|
if (savedEntries.length === 1)
|
|
@@ -364,7 +385,7 @@ async function chooseCompiledForWizard(options) {
|
|
|
364
385
|
hint: [
|
|
365
386
|
`path ${entry.config.path}`,
|
|
366
387
|
entry.config.about ?? describeSavedReadinessChecks(entry.config),
|
|
367
|
-
`Method ${entry.config.method ??
|
|
388
|
+
`Method ${entry.config.method ?? "interf-default"}${entry.localDraft ? " (local draft)" : ""}`,
|
|
368
389
|
entry.path ? "Portable Context available" : "Portable Context not built yet",
|
|
369
390
|
].join(" · "),
|
|
370
391
|
})),
|
|
@@ -394,105 +415,107 @@ async function promptCompiledSetup(options) {
|
|
|
394
415
|
});
|
|
395
416
|
if (!compiledConfig)
|
|
396
417
|
return null;
|
|
397
|
-
const
|
|
398
|
-
|
|
418
|
+
const methodChoice = await chooseOrCreateCompiledMethodForPreparation(options.sourcePath, compiledConfig, {
|
|
419
|
+
currentMethodId: options.initial?.method ?? "interf-default",
|
|
399
420
|
executionProfile: options.executionProfile,
|
|
400
421
|
});
|
|
401
|
-
if (!
|
|
422
|
+
if (!methodChoice || p.isCancel(methodChoice))
|
|
402
423
|
return null;
|
|
403
|
-
const
|
|
404
|
-
const
|
|
424
|
+
const methodId = String(methodChoice);
|
|
425
|
+
const compiledConfigWithMethod = {
|
|
405
426
|
...compiledConfig,
|
|
406
|
-
method:
|
|
407
|
-
workflow: workflowId,
|
|
427
|
+
method: methodId,
|
|
408
428
|
};
|
|
409
|
-
|
|
429
|
+
upsertSourcePreparationConfig(options.sourcePath, compiledConfigWithMethod, {
|
|
410
430
|
...(options.fixedName ? { matchName: options.fixedName } : {}),
|
|
411
431
|
});
|
|
412
|
-
const builtCompiledPath = findBuiltCompiledPath(options.sourcePath,
|
|
432
|
+
const builtCompiledPath = findBuiltCompiledPath(options.sourcePath, compiledConfigWithMethod.name);
|
|
413
433
|
if (builtCompiledPath) {
|
|
414
|
-
|
|
434
|
+
syncCompiledInterfConfigFromSourcePreparationConfig(builtCompiledPath, compiledConfigWithMethod);
|
|
415
435
|
}
|
|
416
436
|
else {
|
|
417
|
-
ensurePortableContextScaffold(options.sourcePath,
|
|
437
|
+
ensurePortableContextScaffold(options.sourcePath, compiledConfigWithMethod.name, compiledConfigWithMethod.method ?? "interf-default");
|
|
418
438
|
}
|
|
419
439
|
console.log();
|
|
420
440
|
console.log(chalk.green(` ✓ Saved Preparation in ${SOURCE_FOLDER_CONFIG_PATH}`));
|
|
421
441
|
console.log(chalk.dim(` Interf Workspace: ${options.sourcePath}`));
|
|
422
|
-
console.log(chalk.dim(` Preparation: ${
|
|
423
|
-
console.log(chalk.dim(` Source folder: ${
|
|
424
|
-
console.log(chalk.dim(` Method: ${
|
|
442
|
+
console.log(chalk.dim(` Preparation: ${compiledConfigWithMethod.name}`));
|
|
443
|
+
console.log(chalk.dim(` Source folder: ${compiledConfigWithMethod.path}`));
|
|
444
|
+
console.log(chalk.dim(` Method: ${methodId} · interf/methods/${methodId}/`));
|
|
425
445
|
console.log(chalk.dim(` Prepare mode: ${describeCompileLoopSelection({
|
|
426
|
-
maxAttempts:
|
|
427
|
-
maxLoops:
|
|
446
|
+
maxAttempts: compiledConfigWithMethod.max_attempts,
|
|
447
|
+
maxLoops: compiledConfigWithMethod.max_loops,
|
|
428
448
|
})}`));
|
|
429
|
-
return
|
|
449
|
+
return compiledConfigWithMethod;
|
|
430
450
|
}
|
|
431
451
|
export async function compileSelectedCompiled(sourcePath, compiledConfig, deps = {}) {
|
|
432
452
|
return (deps.runCompileCommand ?? runCompileCommand)({
|
|
433
453
|
sourcePath,
|
|
434
|
-
|
|
435
|
-
|
|
454
|
+
preparation: compiledConfig.name,
|
|
455
|
+
preparationConfig: compiledConfig,
|
|
436
456
|
skipConfirm: true,
|
|
437
|
-
|
|
457
|
+
skipPreparationBanner: true,
|
|
438
458
|
});
|
|
439
459
|
}
|
|
440
460
|
async function runCompiledActionMenu(sourcePath, compiledConfig, options = {}) {
|
|
441
461
|
const builtCompiledPath = findBuiltCompiledPath(sourcePath, compiledConfig.name);
|
|
442
462
|
const { comparison: latestComparison, stale: latestComparisonStale, } = readCurrentSavedTestComparison({
|
|
443
463
|
projectPath: sourcePath,
|
|
444
|
-
|
|
464
|
+
preparationName: compiledConfig.name,
|
|
445
465
|
checks: compiledConfig.checks,
|
|
446
466
|
});
|
|
447
|
-
|
|
467
|
+
printPreparationSummary({
|
|
448
468
|
sourcePath,
|
|
449
|
-
|
|
469
|
+
preparation: compiledConfig,
|
|
450
470
|
built: Boolean(builtCompiledPath),
|
|
451
471
|
builtCompiledPath,
|
|
452
472
|
latestComparison,
|
|
453
473
|
latestComparisonStale,
|
|
454
474
|
});
|
|
455
|
-
|
|
456
|
-
const action = await
|
|
475
|
+
printPreparationRecommendation(compiledConfig, Boolean(builtCompiledPath), latestComparison);
|
|
476
|
+
const action = await promptPreparationAction(compiledConfig, Boolean(builtCompiledPath), latestComparison);
|
|
457
477
|
if (!action)
|
|
458
478
|
return;
|
|
459
479
|
if (action === "done") {
|
|
460
480
|
p.outro(options.justConfigured ? "Saved Preparation." : "Nothing changed.");
|
|
461
481
|
return;
|
|
462
482
|
}
|
|
463
|
-
if (action === "
|
|
464
|
-
const
|
|
483
|
+
if (action === "method") {
|
|
484
|
+
const methodId = await createMethodWizard({
|
|
465
485
|
sourcePath,
|
|
466
|
-
|
|
486
|
+
preparationContext: {
|
|
467
487
|
config: compiledConfig,
|
|
468
|
-
|
|
488
|
+
sourceFolderPath: resolve(sourcePath, compiledConfig.path),
|
|
469
489
|
},
|
|
470
490
|
});
|
|
471
|
-
if (typeof
|
|
491
|
+
if (typeof methodId === "string") {
|
|
472
492
|
const nextConfig = {
|
|
473
493
|
...compiledConfig,
|
|
474
|
-
method:
|
|
475
|
-
workflow: workflowId,
|
|
494
|
+
method: methodId,
|
|
476
495
|
};
|
|
477
|
-
|
|
496
|
+
upsertSourcePreparationConfig(sourcePath, nextConfig, {
|
|
478
497
|
matchName: compiledConfig.name,
|
|
479
498
|
});
|
|
480
499
|
const builtCompiledPath = findBuiltCompiledPath(sourcePath, compiledConfig.name);
|
|
481
500
|
if (builtCompiledPath) {
|
|
482
|
-
|
|
501
|
+
syncCompiledInterfConfigFromSourcePreparationConfig(builtCompiledPath, nextConfig);
|
|
483
502
|
}
|
|
484
503
|
else {
|
|
485
|
-
ensurePortableContextScaffold(sourcePath, nextConfig.name, nextConfig.
|
|
504
|
+
ensurePortableContextScaffold(sourcePath, nextConfig.name, nextConfig.method ?? "interf-default");
|
|
486
505
|
}
|
|
487
|
-
p.log.info(`Assigned Method "${
|
|
506
|
+
p.log.info(`Assigned Method "${methodId}" to Preparation "${compiledConfig.name}".`);
|
|
488
507
|
p.log.info("Next: run `interf compile`, then `interf test`.");
|
|
489
508
|
}
|
|
490
509
|
return;
|
|
491
510
|
}
|
|
492
|
-
if (action === "
|
|
511
|
+
if (action === "web") {
|
|
512
|
+
await runWebCommand({ "control-path": sourcePath });
|
|
513
|
+
return;
|
|
514
|
+
}
|
|
515
|
+
if (action === "preparation") {
|
|
493
516
|
const nextCompiled = await promptCompiledSetup({
|
|
494
517
|
sourcePath,
|
|
495
|
-
initial: { name:
|
|
518
|
+
initial: { name: DEFAULT_PREPARATION_NAME },
|
|
496
519
|
introStyle: "additional",
|
|
497
520
|
});
|
|
498
521
|
if (!nextCompiled)
|
|
@@ -523,8 +546,8 @@ async function runCompiledActionMenu(sourcePath, compiledConfig, options = {}) {
|
|
|
523
546
|
if (builtCompiledPath) {
|
|
524
547
|
const baselineRan = await runTestCommand({
|
|
525
548
|
sourcePath,
|
|
526
|
-
|
|
527
|
-
|
|
549
|
+
preparation: compiledConfig.name,
|
|
550
|
+
preparationConfig: compiledConfig,
|
|
528
551
|
target: "both",
|
|
529
552
|
});
|
|
530
553
|
if (!baselineRan) {
|
|
@@ -536,9 +559,9 @@ async function runCompiledActionMenu(sourcePath, compiledConfig, options = {}) {
|
|
|
536
559
|
const baselineCapture = { result: null };
|
|
537
560
|
const baselineRan = await runTestCommand({
|
|
538
561
|
sourcePath,
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
target: "
|
|
562
|
+
preparation: compiledConfig.name,
|
|
563
|
+
preparationConfig: compiledConfig,
|
|
564
|
+
target: "source-files",
|
|
542
565
|
onComplete(result) {
|
|
543
566
|
baselineCapture.result = result;
|
|
544
567
|
},
|
|
@@ -580,8 +603,8 @@ async function runCompiledActionMenu(sourcePath, compiledConfig, options = {}) {
|
|
|
580
603
|
}
|
|
581
604
|
await runTestCommand({
|
|
582
605
|
sourcePath,
|
|
583
|
-
|
|
584
|
-
|
|
606
|
+
preparation: compiledConfig.name,
|
|
607
|
+
preparationConfig: compiledConfig,
|
|
585
608
|
target: "both",
|
|
586
609
|
});
|
|
587
610
|
return;
|
|
@@ -607,8 +630,8 @@ async function runCompiledActionMenu(sourcePath, compiledConfig, options = {}) {
|
|
|
607
630
|
return;
|
|
608
631
|
await runTestCommand({
|
|
609
632
|
sourcePath,
|
|
610
|
-
|
|
611
|
-
|
|
633
|
+
preparation: compiledConfig.name,
|
|
634
|
+
preparationConfig: compiledConfig,
|
|
612
635
|
target: "both",
|
|
613
636
|
});
|
|
614
637
|
return;
|
|
@@ -623,8 +646,6 @@ export const initCommand = {
|
|
|
623
646
|
};
|
|
624
647
|
export async function runInitCommand() {
|
|
625
648
|
p.intro(chalk.bold("Interf"));
|
|
626
|
-
p.log.info("Interf prepares data for agent work.");
|
|
627
|
-
p.log.info("It runs locally to process files, show evidence that your data is ready, and write verifiable outputs as Portable Context for agents.");
|
|
628
649
|
const cwd = process.cwd();
|
|
629
650
|
const detected = detectInterf(cwd);
|
|
630
651
|
let initContext = detected
|
|
@@ -636,7 +657,7 @@ export async function runInitCommand() {
|
|
|
636
657
|
: resolveInterfInstanceContext(cwd);
|
|
637
658
|
let sourcePath = initContext.controlPath;
|
|
638
659
|
if (detected) {
|
|
639
|
-
p.log.info(`
|
|
660
|
+
p.log.info(`Interf Workspace: ${displayPath(sourcePath)}`);
|
|
640
661
|
}
|
|
641
662
|
const hasConfig = Boolean(loadSourceFolderConfig(sourcePath));
|
|
642
663
|
let initialSourceFolderPath = initContext.defaultSourceFolderPath;
|
|
@@ -655,14 +676,14 @@ export async function runInitCommand() {
|
|
|
655
676
|
};
|
|
656
677
|
}
|
|
657
678
|
else {
|
|
658
|
-
const seeded =
|
|
679
|
+
const seeded = seedLocalDefaultMethod({ sourcePath });
|
|
659
680
|
if (!seeded.alreadyExisted) {
|
|
660
|
-
p.log.info(`
|
|
681
|
+
p.log.info(`Method: ${seeded.methodId}`);
|
|
661
682
|
}
|
|
662
683
|
}
|
|
663
684
|
let currentConfig = loadSourceFolderConfig(sourcePath);
|
|
664
685
|
if (!currentConfig?.source_folder && !detected) {
|
|
665
|
-
const currentEntries = currentConfig?.preparations ??
|
|
686
|
+
const currentEntries = currentConfig?.preparations ?? [];
|
|
666
687
|
if (initialSourceFolderPath && initialSourceFolderConfigPath) {
|
|
667
688
|
saveSourceFolderConfig(sourcePath, {
|
|
668
689
|
source_folder: { path: initialSourceFolderConfigPath },
|
|
@@ -701,7 +722,7 @@ export async function runInitCommand() {
|
|
|
701
722
|
initialSourceFolderPath = configuredSourcePath;
|
|
702
723
|
initialSourceFolderConfigPath = configuredSourceConfigPath;
|
|
703
724
|
}
|
|
704
|
-
const savedEntries =
|
|
725
|
+
const savedEntries = listSavedPreparationEntries(sourcePath);
|
|
705
726
|
if (savedEntries.length === 0) {
|
|
706
727
|
p.log.info("No Preparations yet. Create one when you are ready to describe the agent work.");
|
|
707
728
|
const action = await promptEmptyInstanceAction();
|
|
@@ -714,9 +735,9 @@ export async function runInitCommand() {
|
|
|
714
735
|
return;
|
|
715
736
|
}
|
|
716
737
|
if (action === "method") {
|
|
717
|
-
const
|
|
718
|
-
if (typeof
|
|
719
|
-
p.outro(`Saved Method "${
|
|
738
|
+
const methodId = await createMethodWizard({ sourcePath });
|
|
739
|
+
if (typeof methodId === "string") {
|
|
740
|
+
p.outro(`Saved Method "${methodId}". Next: create a Preparation and assign this Method.`);
|
|
720
741
|
}
|
|
721
742
|
return;
|
|
722
743
|
}
|
|
@@ -724,10 +745,10 @@ export async function runInitCommand() {
|
|
|
724
745
|
sourcePath,
|
|
725
746
|
initial: initialSourceFolderPath && initialSourceFolderConfigPath
|
|
726
747
|
? {
|
|
727
|
-
name:
|
|
748
|
+
name: defaultPreparationNameForPath(initialSourceFolderPath),
|
|
728
749
|
path: initialSourceFolderConfigPath,
|
|
729
750
|
}
|
|
730
|
-
: { name:
|
|
751
|
+
: { name: DEFAULT_PREPARATION_NAME },
|
|
731
752
|
...(initialSourceFolderConfigPath ? { fixedPath: initialSourceFolderConfigPath } : {}),
|
|
732
753
|
introStyle: "first",
|
|
733
754
|
});
|
|
@@ -747,10 +768,10 @@ export async function runInitCommand() {
|
|
|
747
768
|
sourcePath,
|
|
748
769
|
initial: initialSourceFolderPath && initialSourceFolderConfigPath
|
|
749
770
|
? {
|
|
750
|
-
name:
|
|
771
|
+
name: defaultPreparationNameForPath(initialSourceFolderPath),
|
|
751
772
|
path: initialSourceFolderConfigPath,
|
|
752
773
|
}
|
|
753
|
-
: { name:
|
|
774
|
+
: { name: DEFAULT_PREPARATION_NAME },
|
|
754
775
|
...(initialSourceFolderConfigPath ? { fixedPath: initialSourceFolderConfigPath } : {}),
|
|
755
776
|
introStyle: "additional",
|
|
756
777
|
});
|
|
@@ -1,29 +1,30 @@
|
|
|
1
1
|
import chalk from "chalk";
|
|
2
2
|
import { detectInterf, resolveSourceControlPath, } from "../../packages/project-model/interf.js";
|
|
3
|
-
import {
|
|
3
|
+
import { listSavedPreparationEntries } from "./compiled-flow.js";
|
|
4
4
|
import { resolveCommandControlPath } from "./control-path.js";
|
|
5
|
+
import { resolveMethodId } from "../../packages/methods/method-resolution.js";
|
|
5
6
|
export const listCommand = {
|
|
6
7
|
command: "list",
|
|
7
8
|
describe: "List saved Preparations in this Source Folder",
|
|
8
9
|
handler: async () => {
|
|
9
10
|
const detected = detectInterf(process.cwd());
|
|
10
11
|
const sourcePath = detected ? resolveSourceControlPath(detected.path) : resolveCommandControlPath();
|
|
11
|
-
const
|
|
12
|
-
if (
|
|
12
|
+
const preparations = listSavedPreparationEntries(sourcePath);
|
|
13
|
+
if (preparations.length === 0) {
|
|
13
14
|
console.log(chalk.dim(" Nothing found. Start with `interf` or `interf init` to define a Preparation and save readiness checks."));
|
|
14
15
|
return;
|
|
15
16
|
}
|
|
16
17
|
console.log();
|
|
17
18
|
console.log(chalk.bold(" Saved Preparations"));
|
|
18
19
|
console.log();
|
|
19
|
-
for (const
|
|
20
|
-
console.log(` ${
|
|
21
|
-
if (
|
|
22
|
-
console.log(chalk.dim(` task: ${
|
|
20
|
+
for (const preparation of preparations) {
|
|
21
|
+
console.log(` ${preparation.config.name}`);
|
|
22
|
+
if (preparation.config.about) {
|
|
23
|
+
console.log(chalk.dim(` task: ${preparation.config.about}`));
|
|
23
24
|
}
|
|
24
|
-
console.log(chalk.dim(` ${
|
|
25
|
-
console.log(chalk.dim(` Method: ${
|
|
26
|
-
console.log(chalk.dim(` readiness checks: ${
|
|
25
|
+
console.log(chalk.dim(` ${preparation.path ? "Portable Context available" : "Portable Context not built yet"} · Source Folder: ${preparation.config.path}`));
|
|
26
|
+
console.log(chalk.dim(` Method: ${resolveMethodId(preparation.config)}${preparation.localDraft ? " (local draft)" : ""}`));
|
|
27
|
+
console.log(chalk.dim(` readiness checks: ${preparation.config.checks.length}`));
|
|
27
28
|
}
|
|
28
29
|
},
|
|
29
30
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { SourcePreparationConfig } from "../../packages/project-model/lib/schema.js";
|
|
2
2
|
export declare function resolveConfiguredPreparationSelection(options: {
|
|
3
3
|
sourcePath: string;
|
|
4
4
|
requestedPreparationName?: string | null;
|
|
5
|
-
hintedPreparationConfig?:
|
|
6
|
-
}):
|
|
5
|
+
hintedPreparationConfig?: SourcePreparationConfig | null;
|
|
6
|
+
}): SourcePreparationConfig | null;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { type
|
|
2
|
-
export declare const
|
|
1
|
+
import { type SourcePreparationConfig, type SourceReadinessCheck } from "../../packages/project-model/index.js";
|
|
2
|
+
export declare const DEFAULT_PREPARATION_NAME = "default";
|
|
3
3
|
export declare const DEFAULT_COMPILED_CHECK_QUESTION_PLACEHOLDER = "An agent-work-critical check you can already verify from this Source Folder";
|
|
4
4
|
export declare const DEFAULT_COMPILED_CHECK_ANSWER_PLACEHOLDER = "The expected answer in plain English";
|
|
5
5
|
export declare const DEFAULT_COMPILED_ABOUT_PLACEHOLDER = "Example: board prep from these files, chart reads from this report, or tax review from these exports.";
|
|
6
|
-
export declare const
|
|
6
|
+
export declare const DEFAULT_SOURCE_FOLDER_PATH_PLACEHOLDER = "./source-files";
|
|
7
7
|
export declare const DEFAULT_COMPILE_RETRY_ATTEMPTS = 3;
|
|
8
8
|
export declare const DEFAULT_SELF_IMPROVING_LOOPS = 3;
|
|
9
9
|
export type CompileLoopMode = "once" | "retry" | "self-improving";
|
|
@@ -11,14 +11,14 @@ export interface CompileLoopSelection {
|
|
|
11
11
|
max_attempts?: number;
|
|
12
12
|
max_loops?: number;
|
|
13
13
|
}
|
|
14
|
-
export declare function
|
|
15
|
-
export declare function
|
|
14
|
+
export declare function normalizeSourceFolderPathForConfig(projectPath: string, value: string): string;
|
|
15
|
+
export declare function listSourceFolderChoices(cwd?: string): Array<{
|
|
16
16
|
value: string;
|
|
17
17
|
label: string;
|
|
18
18
|
hint: string;
|
|
19
19
|
}>;
|
|
20
|
-
export declare function
|
|
21
|
-
export declare function
|
|
20
|
+
export declare function defaultSourceFolderPathForPrompt(name: string, introStyle: "first" | "additional" | "edit", cwd?: string): string;
|
|
21
|
+
export declare function preparationAboutPromptMessage(introStyle: "first" | "additional" | "edit"): string;
|
|
22
22
|
export declare function resolveCompileLoopMode(maxAttempts?: number | null, maxLoops?: number | null): CompileLoopMode;
|
|
23
23
|
export declare function describeCompileLoopSelection(options: {
|
|
24
24
|
maxAttempts?: number | null;
|
|
@@ -44,9 +44,9 @@ export declare function promptCompileLoopSelection(options: {
|
|
|
44
44
|
}): Promise<CompileLoopSelection | null>;
|
|
45
45
|
export declare function promptSingleCompiledConfig(options?: {
|
|
46
46
|
projectPath?: string;
|
|
47
|
-
initial?: Partial<Pick<
|
|
47
|
+
initial?: Partial<Pick<SourcePreparationConfig, "name" | "path" | "about" | "checks" | "max_attempts" | "max_loops">>;
|
|
48
48
|
fixedName?: string;
|
|
49
49
|
fixedPath?: string;
|
|
50
50
|
skipAboutPrompt?: boolean;
|
|
51
51
|
introStyle?: "first" | "additional" | "edit";
|
|
52
|
-
}): Promise<
|
|
52
|
+
}): Promise<SourcePreparationConfig | null>;
|