@interf/compiler 0.9.5 → 0.13.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 +96 -92
- package/TRADEMARKS.md +2 -13
- package/agent-skills/interf-actions/SKILL.md +95 -36
- package/agent-skills/interf-actions/references/cli.md +118 -51
- package/builtin-methods/interf-default/README.md +3 -4
- package/builtin-methods/interf-default/compile/stages/shape/SKILL.md +2 -2
- package/builtin-methods/interf-default/compile/stages/summarize/SKILL.md +2 -1
- package/builtin-methods/interf-default/improve/SKILL.md +1 -1
- package/builtin-methods/interf-default/method.json +10 -4
- package/builtin-methods/interf-default/method.schema.json +0 -9
- package/builtin-methods/interf-default/use/query/SKILL.md +5 -5
- package/dist/cli/commands/compile.d.ts +8 -25
- package/dist/cli/commands/compile.js +75 -360
- package/dist/cli/commands/doctor.js +1 -1
- package/dist/cli/commands/login.d.ts +7 -0
- package/dist/cli/commands/login.js +39 -0
- package/dist/cli/commands/logout.d.ts +2 -0
- package/dist/cli/commands/logout.js +16 -0
- package/dist/cli/commands/method.d.ts +2 -0
- package/dist/cli/commands/method.js +113 -0
- package/dist/cli/commands/prep.d.ts +2 -0
- package/dist/cli/commands/prep.js +134 -0
- package/dist/cli/commands/reset.d.ts +8 -1
- package/dist/cli/commands/reset.js +47 -26
- package/dist/cli/commands/runs.d.ts +2 -0
- package/dist/cli/commands/runs.js +120 -0
- package/dist/cli/commands/status.d.ts +6 -1
- package/dist/cli/commands/status.js +68 -111
- package/dist/cli/commands/test.d.ts +6 -14
- package/dist/cli/commands/test.js +65 -181
- package/dist/cli/commands/web.d.ts +0 -9
- package/dist/cli/commands/web.js +147 -120
- package/dist/cli/commands/wizard.d.ts +9 -0
- package/dist/cli/commands/wizard.js +442 -0
- package/dist/cli/index.d.ts +7 -6
- package/dist/cli/index.js +13 -10
- package/dist/compiler-ui/404.html +1 -1
- package/dist/compiler-ui/__next.__PAGE__.txt +2 -2
- package/dist/compiler-ui/__next._full.txt +3 -3
- package/dist/compiler-ui/__next._head.txt +1 -1
- package/dist/compiler-ui/__next._index.txt +2 -2
- package/dist/compiler-ui/__next._tree.txt +2 -2
- package/dist/compiler-ui/_next/static/chunks/{18a8f2jkv3z.c.css → 045gole2ojo3g.css} +1 -1
- package/dist/compiler-ui/_next/static/chunks/{177mvn4rse235.js → 17t-lulmyawg5.js} +9 -9
- package/dist/compiler-ui/_not-found/__next._full.txt +2 -2
- package/dist/compiler-ui/_not-found/__next._head.txt +1 -1
- package/dist/compiler-ui/_not-found/__next._index.txt +2 -2
- package/dist/compiler-ui/_not-found/__next._not-found.__PAGE__.txt +1 -1
- package/dist/compiler-ui/_not-found/__next._not-found.txt +1 -1
- package/dist/compiler-ui/_not-found/__next._tree.txt +2 -2
- package/dist/compiler-ui/_not-found.html +1 -1
- package/dist/compiler-ui/_not-found.txt +2 -2
- package/dist/compiler-ui/index.html +1 -1
- package/dist/compiler-ui/index.txt +3 -3
- package/dist/packages/agents/lib/shells.d.ts +1 -1
- package/dist/packages/agents/lib/shells.js +111 -52
- package/dist/packages/agents/lib/user-config.d.ts +4 -2
- package/dist/packages/agents/lib/user-config.js +15 -7
- package/dist/packages/compiler/compiled-paths.d.ts +9 -2
- package/dist/packages/compiler/compiled-paths.js +30 -15
- package/dist/packages/compiler/compiled-pipeline.js +23 -3
- package/dist/packages/compiler/compiled-stage-plan.js +4 -0
- package/dist/packages/compiler/compiled-target.d.ts +1 -1
- package/dist/packages/compiler/compiled-target.js +1 -1
- package/dist/packages/compiler/index.d.ts +1 -0
- package/dist/packages/compiler/index.js +1 -0
- package/dist/packages/compiler/lib/schema.d.ts +26 -31
- package/dist/packages/compiler/lib/schema.js +1 -12
- package/dist/packages/compiler/method-runs.d.ts +2 -3
- package/dist/packages/compiler/method-runs.js +2 -3
- package/dist/packages/compiler/reset.js +3 -1
- package/dist/packages/compiler/runtime-contracts.js +0 -3
- package/dist/packages/compiler/runtime-prompt.js +1 -1
- package/dist/packages/compiler/source-files.d.ts +46 -0
- package/dist/packages/compiler/source-files.js +149 -0
- package/dist/packages/compiler/state-artifacts.d.ts +3 -2
- package/dist/packages/compiler/state-artifacts.js +4 -3
- package/dist/packages/compiler/state-io.d.ts +3 -2
- package/dist/packages/compiler/state-io.js +11 -5
- package/dist/packages/compiler/state-paths.d.ts +2 -1
- package/dist/packages/compiler/state-paths.js +6 -3
- package/dist/packages/compiler/state-view.d.ts +3 -2
- package/dist/packages/compiler/state-view.js +18 -28
- package/dist/packages/compiler/state.d.ts +4 -4
- package/dist/packages/compiler/state.js +3 -3
- package/dist/packages/contracts/index.d.ts +1 -1
- package/dist/packages/contracts/lib/preparation-paths.d.ts +117 -0
- package/dist/packages/contracts/lib/preparation-paths.js +177 -0
- package/dist/packages/contracts/lib/schema.d.ts +85 -5
- package/dist/packages/contracts/lib/schema.js +46 -1
- package/dist/packages/execution/lib/schema.d.ts +50 -50
- package/dist/packages/execution/lib/schema.js +1 -1
- package/dist/packages/local-service/action-definitions.d.ts +14 -14
- package/dist/packages/local-service/action-definitions.js +27 -28
- package/dist/packages/local-service/action-planner.js +2 -1
- package/dist/packages/local-service/client.d.ts +51 -52
- package/dist/packages/local-service/client.js +132 -140
- package/dist/packages/local-service/connection-config.d.ts +38 -0
- package/dist/packages/local-service/connection-config.js +75 -0
- package/dist/packages/local-service/index.d.ts +11 -7
- package/dist/packages/local-service/index.js +6 -4
- package/dist/packages/local-service/instance-paths.d.ts +100 -0
- package/dist/packages/local-service/instance-paths.js +165 -0
- package/dist/packages/local-service/lib/schema.d.ts +405 -2297
- package/dist/packages/local-service/lib/schema.js +146 -62
- package/dist/packages/local-service/native-run-handlers.js +3 -3
- package/dist/packages/local-service/preparation-store.d.ts +92 -0
- package/dist/packages/local-service/preparation-store.js +171 -0
- package/dist/packages/local-service/routes.d.ts +33 -16
- package/dist/packages/local-service/routes.js +44 -20
- package/dist/packages/local-service/run-observability.js +11 -11
- package/dist/packages/local-service/runtime-caches.d.ts +76 -0
- package/dist/packages/local-service/runtime-caches.js +191 -0
- package/dist/packages/local-service/runtime-event-applier.d.ts +12 -0
- package/dist/packages/local-service/runtime-event-applier.js +177 -0
- package/dist/packages/local-service/runtime-persistence.d.ts +47 -0
- package/dist/packages/local-service/runtime-persistence.js +137 -0
- package/dist/packages/local-service/runtime-proposal-helpers.d.ts +35 -0
- package/dist/packages/local-service/runtime-proposal-helpers.js +251 -0
- package/dist/packages/local-service/runtime-resource-builders.d.ts +52 -0
- package/dist/packages/local-service/runtime-resource-builders.js +149 -0
- package/dist/packages/local-service/runtime.d.ts +197 -43
- package/dist/packages/local-service/runtime.js +800 -974
- package/dist/packages/local-service/server.d.ts +15 -0
- package/dist/packages/local-service/server.js +641 -273
- package/dist/packages/local-service/service-registry.d.ts +47 -0
- package/dist/packages/local-service/service-registry.js +137 -0
- package/dist/packages/method-authoring/method-authoring.d.ts +1 -1
- package/dist/packages/method-authoring/method-authoring.js +2 -2
- package/dist/packages/method-authoring/method-improvement.js +1 -1
- package/dist/packages/method-package/builtin-compiled-method.d.ts +4 -5
- package/dist/packages/method-package/builtin-compiled-method.js +8 -14
- package/dist/packages/method-package/context-interface.d.ts +4 -40
- package/dist/packages/method-package/context-interface.js +1 -23
- package/dist/packages/method-package/interf-method-package.d.ts +4 -4
- package/dist/packages/method-package/interf-method-package.js +21 -33
- package/dist/packages/method-package/local-methods.d.ts +10 -6
- package/dist/packages/method-package/local-methods.js +57 -39
- package/dist/packages/method-package/method-definitions.d.ts +8 -34
- package/dist/packages/method-package/method-definitions.js +49 -37
- package/dist/packages/method-package/method-helpers.d.ts +1 -13
- package/dist/packages/method-package/method-helpers.js +8 -42
- package/dist/packages/method-package/method-stage-runner.js +2 -2
- package/dist/packages/method-package/user-methods.d.ts +17 -0
- package/dist/packages/method-package/user-methods.js +77 -0
- package/dist/packages/project-model/index.d.ts +0 -1
- package/dist/packages/project-model/index.js +0 -1
- package/dist/packages/project-model/interf-detect.d.ts +8 -3
- package/dist/packages/project-model/interf-detect.js +34 -34
- package/dist/packages/project-model/interf-scaffold.d.ts +3 -3
- package/dist/packages/project-model/interf-scaffold.js +23 -32
- package/dist/packages/project-model/lib/schema.js +38 -1
- package/dist/packages/project-model/preparation-entries.d.ts +5 -5
- package/dist/packages/project-model/preparation-entries.js +14 -14
- package/dist/packages/project-model/source-config.d.ts +11 -11
- package/dist/packages/project-model/source-config.js +74 -46
- package/dist/packages/project-model/source-folders.d.ts +5 -5
- package/dist/packages/project-model/source-folders.js +14 -14
- package/dist/packages/shared/filesystem.d.ts +7 -0
- package/dist/packages/shared/filesystem.js +97 -10
- package/dist/packages/testing/lib/schema.d.ts +10 -10
- package/dist/packages/testing/lib/schema.js +2 -2
- package/dist/packages/testing/readiness-check-run.d.ts +4 -4
- package/dist/packages/testing/readiness-check-run.js +36 -36
- package/dist/packages/testing/test-execution.js +6 -6
- package/dist/packages/testing/test-paths.js +4 -3
- package/dist/packages/testing/test-sandbox.d.ts +0 -1
- package/dist/packages/testing/test-sandbox.js +14 -30
- package/dist/packages/testing/test-targets.d.ts +1 -1
- package/dist/packages/testing/test-targets.js +6 -6
- package/dist/packages/testing/test.d.ts +1 -1
- package/dist/packages/testing/test.js +1 -1
- package/package.json +3 -4
- package/CHANGELOG.md +0 -93
- package/LICENSE +0 -183
- package/dist/cli/commands/action-input-cli.d.ts +0 -25
- package/dist/cli/commands/action-input-cli.js +0 -73
- package/dist/cli/commands/control-path.d.ts +0 -11
- package/dist/cli/commands/control-path.js +0 -72
- package/dist/cli/commands/create-method-wizard.d.ts +0 -64
- package/dist/cli/commands/create-method-wizard.js +0 -434
- package/dist/cli/commands/create.d.ts +0 -6
- package/dist/cli/commands/create.js +0 -183
- package/dist/cli/commands/default.d.ts +0 -2
- package/dist/cli/commands/default.js +0 -39
- package/dist/cli/commands/executor-flow.d.ts +0 -29
- package/dist/cli/commands/executor-flow.js +0 -163
- package/dist/cli/commands/init.d.ts +0 -26
- package/dist/cli/commands/init.js +0 -771
- package/dist/cli/commands/list.d.ts +0 -2
- package/dist/cli/commands/list.js +0 -30
- package/dist/cli/commands/preparation-action.d.ts +0 -8
- package/dist/cli/commands/preparation-action.js +0 -29
- package/dist/cli/commands/preparation-picker.d.ts +0 -5
- package/dist/cli/commands/preparation-picker.js +0 -36
- package/dist/cli/commands/preparation-selection.d.ts +0 -6
- package/dist/cli/commands/preparation-selection.js +0 -11
- package/dist/cli/commands/service-action-flow.d.ts +0 -9
- package/dist/cli/commands/service-action-flow.js +0 -19
- package/dist/cli/commands/source-config-wizard.d.ts +0 -51
- package/dist/cli/commands/source-config-wizard.js +0 -670
- package/dist/cli/commands/verify.d.ts +0 -2
- package/dist/cli/commands/verify.js +0 -94
- package/dist/packages/compiler/raw-snapshot.d.ts +0 -49
- package/dist/packages/compiler/raw-snapshot.js +0 -101
- package/dist/packages/method-package/index.d.ts +0 -11
- package/dist/packages/method-package/index.js +0 -11
- package/dist/packages/method-package/method-stage-policy.d.ts +0 -5
- package/dist/packages/method-package/method-stage-policy.js +0 -31
- package/dist/packages/project-model/project-paths.d.ts +0 -12
- package/dist/packages/project-model/project-paths.js +0 -33
- /package/dist/compiler-ui/_next/static/{84FaeF3EzBF9kKTMjSEVN → C6vVfy3aeYuIO3d2AoNvC}/_buildManifest.js +0 -0
- /package/dist/compiler-ui/_next/static/{84FaeF3EzBF9kKTMjSEVN → C6vVfy3aeYuIO3d2AoNvC}/_clientMiddlewareManifest.js +0 -0
- /package/dist/compiler-ui/_next/static/{84FaeF3EzBF9kKTMjSEVN → C6vVfy3aeYuIO3d2AoNvC}/_ssgManifest.js +0 -0
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
import chalk from "chalk";
|
|
2
|
-
import { detectInterf } from "../../packages/project-model/interf.js";
|
|
3
|
-
import { validateCompiledCompile, validateCompiledStage, } from "../../packages/compiler/validate.js";
|
|
4
|
-
import { validateMethodPackage } from "../../packages/method-package/local-methods.js";
|
|
5
|
-
function normalizeVerifyCheck(value) {
|
|
6
|
-
if (!value)
|
|
7
|
-
return null;
|
|
8
|
-
if (value === "stage")
|
|
9
|
-
return "stage";
|
|
10
|
-
if (value === "portable-context")
|
|
11
|
-
return "portable-context";
|
|
12
|
-
if (value === "method")
|
|
13
|
-
return "method";
|
|
14
|
-
return null;
|
|
15
|
-
}
|
|
16
|
-
export const verifyCommand = {
|
|
17
|
-
command: "verify <check> [stageId]",
|
|
18
|
-
describe: "Run deterministic verification checks",
|
|
19
|
-
builder: (yargs) => yargs
|
|
20
|
-
.positional("check", {
|
|
21
|
-
type: "string",
|
|
22
|
-
describe: "Check to run (`stage`, `portable-context`, or `method`)",
|
|
23
|
-
})
|
|
24
|
-
.positional("stageId", {
|
|
25
|
-
type: "string",
|
|
26
|
-
describe: "Stage id when using `verify stage <stage-id>`",
|
|
27
|
-
})
|
|
28
|
-
.option("path", {
|
|
29
|
-
type: "string",
|
|
30
|
-
describe: "Path to a Method package when using `verify method`",
|
|
31
|
-
})
|
|
32
|
-
.option("json", {
|
|
33
|
-
type: "boolean",
|
|
34
|
-
default: false,
|
|
35
|
-
describe: "Print JSON output",
|
|
36
|
-
}),
|
|
37
|
-
handler: async (argv) => {
|
|
38
|
-
const check = normalizeVerifyCheck(argv.check);
|
|
39
|
-
if (!check) {
|
|
40
|
-
process.exitCode = 1;
|
|
41
|
-
console.log(chalk.red(`Unknown verify check: ${String(argv.check)}`));
|
|
42
|
-
return;
|
|
43
|
-
}
|
|
44
|
-
let result;
|
|
45
|
-
if (check === "method") {
|
|
46
|
-
const path = argv.path;
|
|
47
|
-
if (!path) {
|
|
48
|
-
process.exitCode = 1;
|
|
49
|
-
console.log(chalk.red("`interf verify method` needs --path <method-dir>."));
|
|
50
|
-
return;
|
|
51
|
-
}
|
|
52
|
-
result = validateMethodPackage(path);
|
|
53
|
-
}
|
|
54
|
-
else {
|
|
55
|
-
const detected = detectInterf(process.cwd());
|
|
56
|
-
if (!detected) {
|
|
57
|
-
process.exitCode = 1;
|
|
58
|
-
console.log(chalk.red("Run this from inside Portable Context."));
|
|
59
|
-
return;
|
|
60
|
-
}
|
|
61
|
-
if (check === "portable-context") {
|
|
62
|
-
result = validateCompiledCompile(detected.path);
|
|
63
|
-
}
|
|
64
|
-
else {
|
|
65
|
-
const stageId = argv.stageId;
|
|
66
|
-
if (!stageId) {
|
|
67
|
-
process.exitCode = 1;
|
|
68
|
-
console.log(chalk.red("`interf verify stage` needs <stage-id>."));
|
|
69
|
-
return;
|
|
70
|
-
}
|
|
71
|
-
result = validateCompiledStage(detected.path, stageId);
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
if (argv.json) {
|
|
75
|
-
console.log(JSON.stringify(result, null, 2));
|
|
76
|
-
if (typeof result === "object" && result && "ok" in result && !result.ok) {
|
|
77
|
-
process.exitCode = 1;
|
|
78
|
-
}
|
|
79
|
-
return;
|
|
80
|
-
}
|
|
81
|
-
const typed = result;
|
|
82
|
-
console.log();
|
|
83
|
-
if (typed.ok) {
|
|
84
|
-
console.log(chalk.green(` ${typed.summary ?? "Verification passed."}`));
|
|
85
|
-
}
|
|
86
|
-
else {
|
|
87
|
-
process.exitCode = 1;
|
|
88
|
-
console.log(chalk.red(` ${typed.summary ?? "Verification failed."}`));
|
|
89
|
-
for (const error of typed.errors ?? []) {
|
|
90
|
-
console.log(chalk.dim(` - ${error}`));
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
},
|
|
94
|
-
};
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import type { InterfConfig } from "../project-model/lib/schema.js";
|
|
2
|
-
export interface CompiledRawSyncResult {
|
|
3
|
-
sourceTotal: number;
|
|
4
|
-
copied: number;
|
|
5
|
-
removed: number;
|
|
6
|
-
}
|
|
7
|
-
type RawSnapshotMaterializeMode = "copy" | "link-or-copy";
|
|
8
|
-
export declare function resolveCompiledRawPath(compiledPath: string, config?: {
|
|
9
|
-
[x: string]: unknown;
|
|
10
|
-
type: "compiled";
|
|
11
|
-
name: string;
|
|
12
|
-
method: string;
|
|
13
|
-
checks: {
|
|
14
|
-
question: string;
|
|
15
|
-
id?: string | undefined;
|
|
16
|
-
answer?: string | undefined;
|
|
17
|
-
expect?: {
|
|
18
|
-
must_include?: string[] | undefined;
|
|
19
|
-
must_include_one_of?: string[][] | undefined;
|
|
20
|
-
must_not_include?: string[] | undefined;
|
|
21
|
-
min_words?: number | undefined;
|
|
22
|
-
max_words?: number | undefined;
|
|
23
|
-
} | undefined;
|
|
24
|
-
strictness?: string | undefined;
|
|
25
|
-
}[];
|
|
26
|
-
source: {
|
|
27
|
-
path: string;
|
|
28
|
-
control_path?: string | undefined;
|
|
29
|
-
preparation_path?: string | undefined;
|
|
30
|
-
};
|
|
31
|
-
about?: string | undefined;
|
|
32
|
-
max_attempts?: number | undefined;
|
|
33
|
-
max_loops?: number | undefined;
|
|
34
|
-
method_origin?: {
|
|
35
|
-
selected: string;
|
|
36
|
-
local_draft?: boolean | undefined;
|
|
37
|
-
} | undefined;
|
|
38
|
-
} | null): string;
|
|
39
|
-
export declare function syncCompiledRawSnapshot(compiledPath: string, sourcePath?: string): CompiledRawSyncResult;
|
|
40
|
-
export declare function ensureCompiledRawBinding(compiledPath: string): InterfConfig | null;
|
|
41
|
-
export declare function projectRawSnapshot(options: {
|
|
42
|
-
sourcePath: string;
|
|
43
|
-
destinationPath: string;
|
|
44
|
-
compiledPath: string;
|
|
45
|
-
mode?: RawSnapshotMaterializeMode;
|
|
46
|
-
prune?: boolean;
|
|
47
|
-
preserveTimestamps?: boolean;
|
|
48
|
-
}): CompiledRawSyncResult;
|
|
49
|
-
export {};
|
|
@@ -1,101 +0,0 @@
|
|
|
1
|
-
import { cpSync, existsSync, linkSync, mkdirSync, rmSync, statSync, } from "node:fs";
|
|
2
|
-
import { dirname, join, relative, resolve } from "node:path";
|
|
3
|
-
import { listFilesRecursive } from "../shared/filesystem.js";
|
|
4
|
-
import { assertPathWithinRoot } from "../shared/path-guards.js";
|
|
5
|
-
import { discoverSourceFiles } from "./discovery.js";
|
|
6
|
-
import { defaultControlPathForCompiled } from "./compiled-paths.js";
|
|
7
|
-
import { readInterfConfig, resolveSourceInputPath, } from "../project-model/interf-detect.js";
|
|
8
|
-
import { saveCompiledInterfConfig } from "../project-model/source-config.js";
|
|
9
|
-
export function resolveCompiledRawPath(compiledPath, config = readInterfConfig(compiledPath)) {
|
|
10
|
-
const configuredPath = typeof config?.source?.path === "string" && config.source.path.length > 0
|
|
11
|
-
? config.source.path
|
|
12
|
-
: "raw";
|
|
13
|
-
return assertPathWithinRoot(compiledPath, resolve(compiledPath, configuredPath), "Compiled raw path");
|
|
14
|
-
}
|
|
15
|
-
export function syncCompiledRawSnapshot(compiledPath, sourcePath = resolveSourceInputPath(compiledPath)) {
|
|
16
|
-
ensureCompiledRawBinding(compiledPath);
|
|
17
|
-
const rawPath = resolveCompiledRawPath(compiledPath);
|
|
18
|
-
return projectRawSnapshot({
|
|
19
|
-
sourcePath,
|
|
20
|
-
destinationPath: rawPath,
|
|
21
|
-
compiledPath,
|
|
22
|
-
mode: "copy",
|
|
23
|
-
prune: true,
|
|
24
|
-
preserveTimestamps: true,
|
|
25
|
-
});
|
|
26
|
-
}
|
|
27
|
-
export function ensureCompiledRawBinding(compiledPath) {
|
|
28
|
-
const config = readInterfConfig(compiledPath);
|
|
29
|
-
if (!config)
|
|
30
|
-
return null;
|
|
31
|
-
if (config.source?.path === "./raw")
|
|
32
|
-
return config;
|
|
33
|
-
const nextConfig = {
|
|
34
|
-
...config,
|
|
35
|
-
source: {
|
|
36
|
-
...(config.source ?? {}),
|
|
37
|
-
path: "./raw",
|
|
38
|
-
control_path: config.source?.control_path ?? defaultControlPathForCompiled(compiledPath),
|
|
39
|
-
},
|
|
40
|
-
};
|
|
41
|
-
return saveCompiledInterfConfig(compiledPath, nextConfig);
|
|
42
|
-
}
|
|
43
|
-
function filesMatch(sourcePath, targetPath) {
|
|
44
|
-
if (!existsSync(targetPath))
|
|
45
|
-
return false;
|
|
46
|
-
try {
|
|
47
|
-
const sourceStat = statSync(sourcePath);
|
|
48
|
-
const targetStat = statSync(targetPath);
|
|
49
|
-
return sourceStat.size === targetStat.size && sourceStat.mtimeMs === targetStat.mtimeMs;
|
|
50
|
-
}
|
|
51
|
-
catch {
|
|
52
|
-
return false;
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
function materializeRawSnapshotFile(sourcePath, targetPath, options) {
|
|
56
|
-
mkdirSync(dirname(targetPath), { recursive: true });
|
|
57
|
-
rmSync(targetPath, { force: true });
|
|
58
|
-
if (options.mode === "link-or-copy") {
|
|
59
|
-
try {
|
|
60
|
-
linkSync(sourcePath, targetPath);
|
|
61
|
-
return;
|
|
62
|
-
}
|
|
63
|
-
catch {
|
|
64
|
-
// fall through to copy
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
cpSync(sourcePath, targetPath, { preserveTimestamps: options.preserveTimestamps });
|
|
68
|
-
}
|
|
69
|
-
export function projectRawSnapshot(options) {
|
|
70
|
-
const discovery = discoverSourceFiles(options.sourcePath, options.compiledPath);
|
|
71
|
-
const expectedFiles = new Set(discovery.sourceFiles);
|
|
72
|
-
mkdirSync(options.destinationPath, { recursive: true });
|
|
73
|
-
let removed = 0;
|
|
74
|
-
if (options.prune !== false) {
|
|
75
|
-
for (const existingPath of listFilesRecursive(options.destinationPath)) {
|
|
76
|
-
const relativePath = relative(options.destinationPath, existingPath);
|
|
77
|
-
if (expectedFiles.has(relativePath))
|
|
78
|
-
continue;
|
|
79
|
-
rmSync(existingPath, { force: true });
|
|
80
|
-
removed += 1;
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
let copied = 0;
|
|
84
|
-
for (const relativePath of discovery.sourceFiles) {
|
|
85
|
-
const sourceFilePath = join(options.sourcePath, relativePath);
|
|
86
|
-
const targetFilePath = join(options.destinationPath, relativePath);
|
|
87
|
-
if (filesMatch(sourceFilePath, targetFilePath)) {
|
|
88
|
-
continue;
|
|
89
|
-
}
|
|
90
|
-
materializeRawSnapshotFile(sourceFilePath, targetFilePath, {
|
|
91
|
-
mode: options.mode ?? "copy",
|
|
92
|
-
preserveTimestamps: options.preserveTimestamps ?? true,
|
|
93
|
-
});
|
|
94
|
-
copied += 1;
|
|
95
|
-
}
|
|
96
|
-
return {
|
|
97
|
-
sourceTotal: discovery.totalCount,
|
|
98
|
-
copied,
|
|
99
|
-
removed,
|
|
100
|
-
};
|
|
101
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
export * as builtinMethod from "./builtin-compiled-method.js";
|
|
2
|
-
export * as contextInterface from "./context-interface.js";
|
|
3
|
-
export * as localMethods from "./local-methods.js";
|
|
4
|
-
export * as packageWriters from "./interf-method-package.js";
|
|
5
|
-
export * as methodDefinitions from "./method-definitions.js";
|
|
6
|
-
export * as methodHelpers from "./method-helpers.js";
|
|
7
|
-
export * as methodStagePolicy from "./method-stage-policy.js";
|
|
8
|
-
export * as methodStageRunner from "./method-stage-runner.js";
|
|
9
|
-
export * as methodReviewPaths from "./method-review-paths.js";
|
|
10
|
-
export * as packageRoot from "./lib/package-root.js";
|
|
11
|
-
export { CONTEXT_INTERFACE_FILE, ContextInterfaceSchema, ContextInterfaceZoneSchema, ContextInterfaceZoneIdSchema, ContextInterfaceZoneRoleSchema, MethodInputSpecSchema, MethodInputContractSchema, contextInterfaceFilePath, resolveContextInterfacePath, contextInterfaceExists, contextInterfaceRelativePath, listContextInterfaceZones, findContextInterfaceZone, contextInterfaceZoneAbsolutePath, contextInterfaceArtifactPath, contextInterfaceArtifactPathsForZoneIds, buildContextInterface, writeContextInterfaceFile, writeContextInterface, readContextInterface, type ContextInterface, type ContextInterfaceZone, type ContextInterfaceZoneId, type ContextInterfaceZoneRole, type ContextInterfaceStageLike, type MethodInputSpec, type ContextInterfaceSummary, summarizeContextInterface, deriveMethodInputsFromContextInterface, } from "./context-interface.js";
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
export * as builtinMethod from "./builtin-compiled-method.js";
|
|
2
|
-
export * as contextInterface from "./context-interface.js";
|
|
3
|
-
export * as localMethods from "./local-methods.js";
|
|
4
|
-
export * as packageWriters from "./interf-method-package.js";
|
|
5
|
-
export * as methodDefinitions from "./method-definitions.js";
|
|
6
|
-
export * as methodHelpers from "./method-helpers.js";
|
|
7
|
-
export * as methodStagePolicy from "./method-stage-policy.js";
|
|
8
|
-
export * as methodStageRunner from "./method-stage-runner.js";
|
|
9
|
-
export * as methodReviewPaths from "./method-review-paths.js";
|
|
10
|
-
export * as packageRoot from "./lib/package-root.js";
|
|
11
|
-
export { CONTEXT_INTERFACE_FILE, ContextInterfaceSchema, ContextInterfaceZoneSchema, ContextInterfaceZoneIdSchema, ContextInterfaceZoneRoleSchema, MethodInputSpecSchema, MethodInputContractSchema, contextInterfaceFilePath, resolveContextInterfacePath, contextInterfaceExists, contextInterfaceRelativePath, listContextInterfaceZones, findContextInterfaceZone, contextInterfaceZoneAbsolutePath, contextInterfaceArtifactPath, contextInterfaceArtifactPathsForZoneIds, buildContextInterface, writeContextInterfaceFile, writeContextInterface, readContextInterface, summarizeContextInterface, deriveMethodInputsFromContextInterface, } from "./context-interface.js";
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
export interface StagePolicyStageLike {
|
|
2
|
-
id: string;
|
|
3
|
-
}
|
|
4
|
-
export declare function normalizeStagePolicyNotes(value: unknown): Record<string, string[]> | undefined;
|
|
5
|
-
export declare function mergeStagePolicyNotesForStages(stages: readonly StagePolicyStageLike[], baseNotes: unknown, overrideNotes: Record<string, string[]> | undefined): Record<string, string[]> | undefined;
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
export function normalizeStagePolicyNotes(value) {
|
|
2
|
-
if (!value || typeof value !== "object" || Array.isArray(value))
|
|
3
|
-
return undefined;
|
|
4
|
-
const normalized = {};
|
|
5
|
-
for (const [stageId, notes] of Object.entries(value)) {
|
|
6
|
-
if (!Array.isArray(notes))
|
|
7
|
-
continue;
|
|
8
|
-
const cleaned = Array.from(new Set(notes
|
|
9
|
-
.filter((note) => typeof note === "string")
|
|
10
|
-
.map((note) => note.trim())
|
|
11
|
-
.filter((note) => note.length > 0)));
|
|
12
|
-
if (cleaned.length > 0) {
|
|
13
|
-
normalized[stageId] = cleaned;
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
return Object.keys(normalized).length > 0 ? normalized : undefined;
|
|
17
|
-
}
|
|
18
|
-
export function mergeStagePolicyNotesForStages(stages, baseNotes, overrideNotes) {
|
|
19
|
-
const normalizedBase = normalizeStagePolicyNotes(baseNotes);
|
|
20
|
-
const merged = {};
|
|
21
|
-
for (const stage of stages) {
|
|
22
|
-
const combined = Array.from(new Set([
|
|
23
|
-
...(normalizedBase?.[stage.id] ?? []),
|
|
24
|
-
...((overrideNotes?.[stage.id] ?? []).map((note) => note.trim()).filter((note) => note.length > 0)),
|
|
25
|
-
]));
|
|
26
|
-
if (combined.length > 0) {
|
|
27
|
-
merged[stage.id] = combined;
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
return Object.keys(merged).length > 0 ? merged : undefined;
|
|
31
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
export declare const PROJECT_INTERF_DIR = "interf";
|
|
2
|
-
export declare const PORTABLE_CONTEXT_INTERF_DIR = ".interf";
|
|
3
|
-
export declare const PORTABLE_CONTEXT_TESTS_DIR = "tests";
|
|
4
|
-
export declare function projectInterfRoot(projectPath: string): string;
|
|
5
|
-
export declare function portableContextPath(projectPath: string, preparationName: string): string;
|
|
6
|
-
export declare function preparationTestsRoot(projectPath: string, preparationName: string): string;
|
|
7
|
-
export type PreparationTestTargetLabel = "file-as-is" | "compiled";
|
|
8
|
-
export declare function preparationTestRunsRoot(projectPath: string, preparationName: string, target: PreparationTestTargetLabel): string;
|
|
9
|
-
export declare function preparationLatestReadinessRunPath(projectPath: string, preparationName: string): string;
|
|
10
|
-
export declare function preparationLatestReadinessSummaryPath(projectPath: string, preparationName: string): string;
|
|
11
|
-
export declare function normalizePreparationTestRunId(input: string): string;
|
|
12
|
-
export declare function preparationTestRunPath(projectPath: string, preparationName: string, target: PreparationTestTargetLabel, generatedAt: string, runId: string, runSuffix?: string | null): string;
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { join } from "node:path";
|
|
2
|
-
export const PROJECT_INTERF_DIR = "interf";
|
|
3
|
-
export const PORTABLE_CONTEXT_INTERF_DIR = ".interf";
|
|
4
|
-
export const PORTABLE_CONTEXT_TESTS_DIR = "tests";
|
|
5
|
-
export function projectInterfRoot(projectPath) {
|
|
6
|
-
return join(projectPath, PROJECT_INTERF_DIR);
|
|
7
|
-
}
|
|
8
|
-
export function portableContextPath(projectPath, preparationName) {
|
|
9
|
-
return join(projectInterfRoot(projectPath), preparationName);
|
|
10
|
-
}
|
|
11
|
-
export function preparationTestsRoot(projectPath, preparationName) {
|
|
12
|
-
return join(portableContextPath(projectPath, preparationName), PORTABLE_CONTEXT_INTERF_DIR, PORTABLE_CONTEXT_TESTS_DIR);
|
|
13
|
-
}
|
|
14
|
-
export function preparationTestRunsRoot(projectPath, preparationName, target) {
|
|
15
|
-
return join(preparationTestsRoot(projectPath, preparationName), target, "runs");
|
|
16
|
-
}
|
|
17
|
-
export function preparationLatestReadinessRunPath(projectPath, preparationName) {
|
|
18
|
-
return join(preparationTestsRoot(projectPath, preparationName), "latest.json");
|
|
19
|
-
}
|
|
20
|
-
export function preparationLatestReadinessSummaryPath(projectPath, preparationName) {
|
|
21
|
-
return join(preparationTestsRoot(projectPath, preparationName), "latest.md");
|
|
22
|
-
}
|
|
23
|
-
export function normalizePreparationTestRunId(input) {
|
|
24
|
-
return input
|
|
25
|
-
.toLowerCase()
|
|
26
|
-
.trim()
|
|
27
|
-
.replace(/[^a-z0-9]+/g, "-")
|
|
28
|
-
.replace(/^-+|-+$/g, "")
|
|
29
|
-
.slice(0, 80);
|
|
30
|
-
}
|
|
31
|
-
export function preparationTestRunPath(projectPath, preparationName, target, generatedAt, runId, runSuffix) {
|
|
32
|
-
return join(preparationTestRunsRoot(projectPath, preparationName, target), `${generatedAt.replace(/[:.]/g, "-")}-${runId}${runSuffix ? `-${normalizePreparationTestRunId(runSuffix)}` : ""}.json`);
|
|
33
|
-
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|