@interf/compiler 0.9.4 → 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 -91
- package/TRADEMARKS.md +2 -13
- package/agent-skills/interf-actions/SKILL.md +97 -32
- package/agent-skills/interf-actions/references/cli.md +124 -71
- 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 +9 -31
- package/dist/cli/commands/compile.js +75 -388
- 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 -15
- 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 +61 -220
- package/dist/cli/commands/test.d.ts +6 -15
- package/dist/cli/commands/test.js +63 -342
- package/dist/cli/commands/web.d.ts +0 -9
- package/dist/cli/commands/web.js +140 -367
- 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/045gole2ojo3g.css +3 -0
- package/dist/compiler-ui/_next/static/chunks/17t-lulmyawg5.js +89 -0
- 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/index.d.ts +0 -23
- package/dist/index.js +0 -16
- package/dist/packages/agents/lib/shells.d.ts +1 -1
- package/dist/packages/agents/lib/shells.js +113 -54
- 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 +27 -32
- package/dist/packages/compiler/lib/schema.js +2 -13
- 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 -6
- package/dist/packages/contracts/lib/schema.js +46 -2
- package/dist/packages/execution/lib/schema.d.ts +50 -57
- package/dist/packages/execution/lib/schema.js +1 -2
- package/dist/packages/local-service/action-definitions.d.ts +246 -0
- package/dist/packages/local-service/action-definitions.js +1147 -0
- package/dist/packages/local-service/action-planner.d.ts +9 -0
- package/dist/packages/local-service/action-planner.js +135 -0
- package/dist/packages/local-service/action-values.d.ts +1 -23
- package/dist/packages/local-service/action-values.js +1 -31
- package/dist/packages/local-service/client.d.ts +76 -46
- package/dist/packages/local-service/client.js +184 -149
- 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 +14 -7
- package/dist/packages/local-service/index.js +8 -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 +689 -2575
- package/dist/packages/local-service/lib/schema.js +260 -101
- package/dist/packages/local-service/native-run-handlers.d.ts +23 -0
- package/dist/{cli/commands/compile-controller.js → packages/local-service/native-run-handlers.js} +204 -20
- package/dist/packages/local-service/preparation-store.d.ts +92 -0
- package/dist/packages/local-service/preparation-store.js +171 -0
- package/dist/{cli/commands/check-draft.d.ts → packages/local-service/readiness-check-draft.d.ts} +2 -2
- package/dist/packages/local-service/routes.d.ts +33 -11
- package/dist/packages/local-service/routes.js +44 -15
- package/dist/packages/local-service/run-observability.js +25 -27
- 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 +201 -44
- package/dist/packages/local-service/runtime.js +1062 -1106
- package/dist/packages/local-service/server.d.ts +15 -0
- package/dist/packages/local-service/server.js +651 -233
- 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-review-paths.d.ts +1 -1
- package/dist/packages/method-package/method-review-paths.js +5 -5
- 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 +1 -1
- package/dist/packages/project-model/index.js +1 -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 +11 -0
- package/dist/packages/project-model/preparation-entries.js +49 -0
- package/dist/packages/project-model/source-config.d.ts +11 -10
- package/dist/packages/project-model/source-config.js +83 -44
- 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 +12 -13
- package/dist/packages/testing/lib/schema.js +4 -5
- package/dist/packages/testing/readiness-check-run.d.ts +7 -7
- package/dist/packages/testing/readiness-check-run.js +46 -51
- 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 +6 -26
- package/LICENSE +0 -183
- package/dist/cli/commands/compile-controller.d.ts +0 -17
- package/dist/cli/commands/compiled-flow.d.ts +0 -25
- package/dist/cli/commands/compiled-flow.js +0 -112
- 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 -76
- package/dist/cli/commands/create-method-wizard.js +0 -465
- package/dist/cli/commands/create.d.ts +0 -8
- package/dist/cli/commands/create.js +0 -189
- 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 -11
- package/dist/cli/commands/init.js +0 -784
- package/dist/cli/commands/list.d.ts +0 -2
- package/dist/cli/commands/list.js +0 -30
- package/dist/cli/commands/preparation-selection.d.ts +0 -6
- package/dist/cli/commands/preparation-selection.js +0 -11
- package/dist/cli/commands/source-config-wizard.d.ts +0 -52
- package/dist/cli/commands/source-config-wizard.js +0 -680
- package/dist/cli/commands/test-flow.d.ts +0 -58
- package/dist/cli/commands/test-flow.js +0 -231
- package/dist/cli/commands/verify.d.ts +0 -2
- package/dist/cli/commands/verify.js +0 -94
- package/dist/compiler-ui/_next/static/chunks/0d~8t0zm6545p.js +0 -118
- package/dist/compiler-ui/_next/static/chunks/0xnel.ax9a.2c.css +0 -3
- 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/{j7pdoqWrl4YJrJUVnksbl → C6vVfy3aeYuIO3d2AoNvC}/_buildManifest.js +0 -0
- /package/dist/compiler-ui/_next/static/{j7pdoqWrl4YJrJUVnksbl → C6vVfy3aeYuIO3d2AoNvC}/_clientMiddlewareManifest.js +0 -0
- /package/dist/compiler-ui/_next/static/{j7pdoqWrl4YJrJUVnksbl → C6vVfy3aeYuIO3d2AoNvC}/_ssgManifest.js +0 -0
- /package/dist/{cli/commands/check-draft.js → packages/local-service/readiness-check-draft.js} +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createHash } from "node:crypto";
|
|
2
2
|
import { existsSync, mkdirSync, writeFileSync } from "node:fs";
|
|
3
|
-
import { isAbsolute,
|
|
3
|
+
import { isAbsolute, relative, resolve, sep } from "node:path";
|
|
4
4
|
import { refreshCompiledBootstrapGuidance } from "../agents/lib/compiled-bootstrap.js";
|
|
5
5
|
import { readInterfConfig, } from "./interf.js";
|
|
6
6
|
import { seedCompiledMethodPackage } from "../method-package/interf-method-package.js";
|
|
@@ -11,14 +11,14 @@ import { SourceFolderConfigSchema, } from "./lib/schema.js";
|
|
|
11
11
|
import { slugify } from "../shared/naming.js";
|
|
12
12
|
import { assertPathWithinRoot, isPathWithinRoot } from "../shared/path-guards.js";
|
|
13
13
|
import { defaultControlPathForCompiled, resolveSourceControlPathForCompiled, compiledInterfConfigPath, compiledInterfRoot, } from "../compiler/compiled-paths.js";
|
|
14
|
-
import {
|
|
15
|
-
export const SOURCE_FOLDER_CONFIG_FILE =
|
|
16
|
-
export const SOURCE_FOLDER_CONFIG_PATH =
|
|
17
|
-
export function sourceFolderConfigPath(
|
|
18
|
-
return
|
|
14
|
+
import { asPreparationDataDir, preparationConfigPath, PREPARATION_CONFIG_FILENAME, } from "../contracts/lib/preparation-paths.js";
|
|
15
|
+
export const SOURCE_FOLDER_CONFIG_FILE = PREPARATION_CONFIG_FILENAME;
|
|
16
|
+
export const SOURCE_FOLDER_CONFIG_PATH = SOURCE_FOLDER_CONFIG_FILE;
|
|
17
|
+
export function sourceFolderConfigPath(prepDataDir) {
|
|
18
|
+
return preparationConfigPath(asPreparationDataDir(prepDataDir));
|
|
19
19
|
}
|
|
20
|
-
export function resolveSourceFolderConfigPath(
|
|
21
|
-
return sourceFolderConfigPath(
|
|
20
|
+
export function resolveSourceFolderConfigPath(prepDataDir) {
|
|
21
|
+
return sourceFolderConfigPath(prepDataDir);
|
|
22
22
|
}
|
|
23
23
|
function readSourceFolderConfigFile(filePath) {
|
|
24
24
|
return readJsonFileWithSchema(filePath, "Interf project config", SourceFolderConfigSchema);
|
|
@@ -55,8 +55,8 @@ export function fingerprintReadinessChecks(checks) {
|
|
|
55
55
|
.digest("hex")
|
|
56
56
|
.slice(0, 16);
|
|
57
57
|
}
|
|
58
|
-
export function loadSourceFolderConfig(
|
|
59
|
-
const filePath = resolveSourceFolderConfigPath(
|
|
58
|
+
export function loadSourceFolderConfig(prepDataDir) {
|
|
59
|
+
const filePath = resolveSourceFolderConfigPath(prepDataDir);
|
|
60
60
|
if (!existsSync(filePath))
|
|
61
61
|
return null;
|
|
62
62
|
return readSourceFolderConfigFile(filePath);
|
|
@@ -100,9 +100,9 @@ export function findSourcePreparationConfig(config, preparationName) {
|
|
|
100
100
|
export function configuredSourceFolderPath(config) {
|
|
101
101
|
return config?.source_folder?.path ?? null;
|
|
102
102
|
}
|
|
103
|
-
export function resolveConfiguredSourceFolderPath(
|
|
103
|
+
export function resolveConfiguredSourceFolderPath(prepDataDir, config = loadSourceFolderConfig(prepDataDir)) {
|
|
104
104
|
const configuredPath = configuredSourceFolderPath(config);
|
|
105
|
-
return configuredPath ? resolve(
|
|
105
|
+
return configuredPath ? resolve(prepDataDir, configuredPath) : null;
|
|
106
106
|
}
|
|
107
107
|
function toWritableSourceProjectConfig(config) {
|
|
108
108
|
const preparations = config?.preparations ?? [];
|
|
@@ -124,23 +124,23 @@ function toWritableSourcePreparationConfig(preparation) {
|
|
|
124
124
|
name: preparation.name,
|
|
125
125
|
path: preparation.path,
|
|
126
126
|
...(preparation.about ? { about: preparation.about } : {}),
|
|
127
|
-
method
|
|
127
|
+
...(method ? { method } : {}),
|
|
128
128
|
...(typeof preparation.max_attempts === "number" ? { max_attempts: preparation.max_attempts } : {}),
|
|
129
129
|
...(typeof preparation.max_loops === "number" ? { max_loops: preparation.max_loops } : {}),
|
|
130
130
|
checks: preparation.checks,
|
|
131
131
|
};
|
|
132
132
|
}
|
|
133
|
-
export function saveSourceFolderConfig(
|
|
134
|
-
const existing = loadSourceFolderConfig(
|
|
133
|
+
export function saveSourceFolderConfig(prepDataDir, config) {
|
|
134
|
+
const existing = loadSourceFolderConfig(prepDataDir);
|
|
135
135
|
const mergedConfig = {
|
|
136
136
|
...(existing?.source_folder && !config.source_folder ? { source_folder: existing.source_folder } : {}),
|
|
137
137
|
...config,
|
|
138
138
|
};
|
|
139
|
-
mkdirSync(
|
|
140
|
-
writeFileSync(sourceFolderConfigPath(
|
|
139
|
+
mkdirSync(prepDataDir, { recursive: true });
|
|
140
|
+
writeFileSync(sourceFolderConfigPath(prepDataDir), JSON.stringify(toWritableSourceProjectConfig(mergedConfig), null, 2) + "\n");
|
|
141
141
|
}
|
|
142
|
-
export function appendSourcePreparationChecks(
|
|
143
|
-
const existing = loadSourceFolderConfig(
|
|
142
|
+
export function appendSourcePreparationChecks(prepDataDir, preparationName, checks) {
|
|
143
|
+
const existing = loadSourceFolderConfig(prepDataDir);
|
|
144
144
|
const currentPreparation = findSourcePreparationConfig(existing, preparationName);
|
|
145
145
|
const otherPreparations = listSourcePreparationConfigs(existing).filter((preparation) => preparation.name !== preparationName);
|
|
146
146
|
const currentChecks = currentPreparation?.checks ?? [];
|
|
@@ -152,15 +152,15 @@ export function appendSourcePreparationChecks(sourcePath, preparationName, check
|
|
|
152
152
|
}),
|
|
153
153
|
checks: [...currentChecks, ...checks],
|
|
154
154
|
};
|
|
155
|
-
saveSourceFolderConfig(
|
|
155
|
+
saveSourceFolderConfig(prepDataDir, {
|
|
156
156
|
preparations: [
|
|
157
157
|
nextPreparation,
|
|
158
158
|
...otherPreparations,
|
|
159
159
|
],
|
|
160
160
|
});
|
|
161
161
|
}
|
|
162
|
-
export function upsertSourcePreparationConfig(
|
|
163
|
-
const existing = loadSourceFolderConfig(
|
|
162
|
+
export function upsertSourcePreparationConfig(prepDataDir, preparationConfig, options = {}) {
|
|
163
|
+
const existing = loadSourceFolderConfig(prepDataDir);
|
|
164
164
|
const preparations = listSourcePreparationConfigs(existing);
|
|
165
165
|
const candidateNames = Array.from(new Set([preparationConfig.name, options.matchName].filter((value) => Boolean(value))));
|
|
166
166
|
const existingIndex = preparations.findIndex((entry) => candidateNames.includes(entry.name));
|
|
@@ -170,10 +170,21 @@ export function upsertSourcePreparationConfig(sourcePath, preparationConfig, opt
|
|
|
170
170
|
else {
|
|
171
171
|
preparations.push(normalizeSourcePreparationConfig(preparationConfig));
|
|
172
172
|
}
|
|
173
|
-
saveSourceFolderConfig(
|
|
173
|
+
saveSourceFolderConfig(prepDataDir, {
|
|
174
174
|
preparations,
|
|
175
175
|
});
|
|
176
176
|
}
|
|
177
|
+
export function removeSourcePreparationConfig(prepDataDir, preparationName) {
|
|
178
|
+
const existing = loadSourceFolderConfig(prepDataDir);
|
|
179
|
+
const preparations = listSourcePreparationConfigs(existing);
|
|
180
|
+
const nextPreparations = preparations.filter((entry) => entry.name !== preparationName);
|
|
181
|
+
if (nextPreparations.length === preparations.length)
|
|
182
|
+
return false;
|
|
183
|
+
saveSourceFolderConfig(prepDataDir, {
|
|
184
|
+
preparations: nextPreparations,
|
|
185
|
+
});
|
|
186
|
+
return true;
|
|
187
|
+
}
|
|
177
188
|
export function compiledMaxAttempts(maxAttempts) {
|
|
178
189
|
if (maxAttempts == null)
|
|
179
190
|
return undefined;
|
|
@@ -203,8 +214,8 @@ export function loadCompiledPreparationConfig(compiledPath) {
|
|
|
203
214
|
const config = readInterfConfig(compiledPath);
|
|
204
215
|
if (!config)
|
|
205
216
|
return null;
|
|
206
|
-
const
|
|
207
|
-
const configuredPreparations = listSourcePreparationConfigs(loadSourceFolderConfig(
|
|
217
|
+
const prepDataDir = resolveSourceControlPathForCompiled(compiledPath);
|
|
218
|
+
const configuredPreparations = listSourcePreparationConfigs(loadSourceFolderConfig(prepDataDir));
|
|
208
219
|
const defaultPreparationPath = configuredPreparations.length === 1
|
|
209
220
|
? configuredPreparations[0].path
|
|
210
221
|
: `./${config.name}`;
|
|
@@ -214,10 +225,10 @@ export function loadCompiledPreparationConfig(compiledPath) {
|
|
|
214
225
|
const preparationPath = sourceBinding
|
|
215
226
|
? (() => {
|
|
216
227
|
const sourceAbsolutePath = resolve(compiledPath, sourceBinding);
|
|
217
|
-
if (!isPathWithinRoot(
|
|
228
|
+
if (!isPathWithinRoot(prepDataDir, sourceAbsolutePath)) {
|
|
218
229
|
return sourceAbsolutePath;
|
|
219
230
|
}
|
|
220
|
-
return relative(
|
|
231
|
+
return relative(prepDataDir, sourceAbsolutePath).split(sep).join("/") || defaultPreparationPath;
|
|
221
232
|
})()
|
|
222
233
|
: defaultPreparationPath;
|
|
223
234
|
return sourcePreparationConfigFromInterfConfig(config, preparationPath);
|
|
@@ -229,8 +240,8 @@ export function saveCompiledInterfConfig(compiledPath, config) {
|
|
|
229
240
|
}
|
|
230
241
|
export function syncCompiledInterfConfigFromSourcePreparationConfig(compiledPath, preparationConfig) {
|
|
231
242
|
const current = readInterfConfig(compiledPath);
|
|
232
|
-
const
|
|
233
|
-
const preparationAbsolutePath = resolveSourcePreparationPath(
|
|
243
|
+
const prepDataDir = resolveSourceControlPathForCompiled(compiledPath);
|
|
244
|
+
const preparationAbsolutePath = resolveSourcePreparationPath(prepDataDir, preparationConfig);
|
|
234
245
|
const preparationRelativePath = relative(compiledPath, preparationAbsolutePath).split(sep).join("/") || ".";
|
|
235
246
|
const methodId = methodIdForSourcePreparationConfig(preparationConfig)
|
|
236
247
|
?? methodIdForSourcePreparationConfig(current)
|
|
@@ -248,7 +259,7 @@ export function syncCompiledInterfConfigFromSourcePreparationConfig(compiledPath
|
|
|
248
259
|
...(!current ? {
|
|
249
260
|
type: "compiled",
|
|
250
261
|
source: {
|
|
251
|
-
path:
|
|
262
|
+
path: preparationRelativePath,
|
|
252
263
|
},
|
|
253
264
|
} : {}),
|
|
254
265
|
type: "compiled",
|
|
@@ -264,18 +275,17 @@ export function syncCompiledInterfConfigFromSourcePreparationConfig(compiledPath
|
|
|
264
275
|
checks: preparationConfig.checks,
|
|
265
276
|
method_origin: methodOrigin,
|
|
266
277
|
source: {
|
|
267
|
-
path:
|
|
278
|
+
path: preparationRelativePath,
|
|
268
279
|
control_path: defaultControlPathForCompiled(compiledPath),
|
|
269
280
|
preparation_path: preparationRelativePath,
|
|
270
281
|
},
|
|
271
282
|
};
|
|
272
283
|
const saved = saveCompiledInterfConfig(compiledPath, nextConfig);
|
|
273
284
|
if (methodChanged) {
|
|
274
|
-
const
|
|
275
|
-
const selectedMethod = getCompiledMethod(methodId, { sourcePath });
|
|
285
|
+
const selectedMethod = getCompiledMethod(methodId, { prepDataDir });
|
|
276
286
|
seedCompiledMethodPackage({
|
|
277
287
|
compiledPath,
|
|
278
|
-
|
|
288
|
+
prepDataDir,
|
|
279
289
|
methodId: selectedMethod.id,
|
|
280
290
|
});
|
|
281
291
|
}
|
|
@@ -287,7 +297,7 @@ function buildLoadedTestSpec(options) {
|
|
|
287
297
|
return null;
|
|
288
298
|
const testId = options.id ?? slugify(options.name);
|
|
289
299
|
return {
|
|
290
|
-
id: options.targetType === "
|
|
300
|
+
id: options.targetType === "source-files" ? `${testId}-source-files` : testId,
|
|
291
301
|
filePath: options.filePath,
|
|
292
302
|
type: options.targetType,
|
|
293
303
|
name: options.name,
|
|
@@ -296,8 +306,8 @@ function buildLoadedTestSpec(options) {
|
|
|
296
306
|
};
|
|
297
307
|
}
|
|
298
308
|
export function buildTestSpecFromSourceFolderConfig(options) {
|
|
299
|
-
const {
|
|
300
|
-
const config = loadSourceFolderConfig(
|
|
309
|
+
const { prepDataDir, targetName, targetType = "compiled" } = options;
|
|
310
|
+
const config = loadSourceFolderConfig(prepDataDir);
|
|
301
311
|
if (!config)
|
|
302
312
|
return null;
|
|
303
313
|
const preparations = listSourcePreparationConfigs(config);
|
|
@@ -310,14 +320,14 @@ export function buildTestSpecFromSourceFolderConfig(options) {
|
|
|
310
320
|
: getDefaultSourcePreparationConfig(config);
|
|
311
321
|
if (!match)
|
|
312
322
|
return null;
|
|
313
|
-
const configPath = resolveSourceFolderConfigPath(
|
|
323
|
+
const configPath = resolveSourceFolderConfigPath(prepDataDir);
|
|
314
324
|
return buildLoadedTestSpec({
|
|
315
325
|
id: match.id,
|
|
316
326
|
name: match.name,
|
|
317
327
|
about: match.about,
|
|
318
328
|
checks: match.checks,
|
|
319
329
|
targetType,
|
|
320
|
-
filePath: targetType === "
|
|
330
|
+
filePath: targetType === "source-files"
|
|
321
331
|
? `${configPath}#preparations/${match.name}:source-files`
|
|
322
332
|
: `${configPath}#preparations/${match.name}:portable-context`,
|
|
323
333
|
defaultDescription: `Derived from saved Preparation checks in ${SOURCE_FOLDER_CONFIG_PATH}`,
|
|
@@ -334,17 +344,46 @@ export function buildTestSpecFromCompiledPreparationConfig(options) {
|
|
|
334
344
|
about: config.about,
|
|
335
345
|
checks: config.checks ?? [],
|
|
336
346
|
targetType,
|
|
337
|
-
filePath: targetType === "
|
|
338
|
-
? `${configPath}#checks:
|
|
347
|
+
filePath: targetType === "source-files"
|
|
348
|
+
? `${configPath}#checks:source-files`
|
|
339
349
|
: `${configPath}#checks:compiled`,
|
|
340
350
|
defaultDescription: "Derived from checks in the portable context config.",
|
|
341
351
|
});
|
|
342
352
|
}
|
|
343
|
-
|
|
353
|
+
/**
|
|
354
|
+
* System path prefixes the runtime must never operate on, even when an
|
|
355
|
+
* absolute `preparation.path` was authored by hand. The schema-level
|
|
356
|
+
* refinement in `SourcePreparationConfigSchema` is the primary line of
|
|
357
|
+
* defense; this is the in-process backstop for callers that hand-craft a
|
|
358
|
+
* SourcePreparationConfig at runtime (e.g. method authoring helpers that
|
|
359
|
+
* construct a config from an InterfConfig).
|
|
360
|
+
*/
|
|
361
|
+
const FORBIDDEN_PREPARATION_PATH_PREFIXES = [
|
|
362
|
+
"/etc",
|
|
363
|
+
"/sys",
|
|
364
|
+
"/proc",
|
|
365
|
+
"/dev",
|
|
366
|
+
"/var/run",
|
|
367
|
+
"/var/lib",
|
|
368
|
+
"/usr",
|
|
369
|
+
"/bin",
|
|
370
|
+
"/sbin",
|
|
371
|
+
"/boot",
|
|
372
|
+
];
|
|
373
|
+
function rejectForbiddenPreparationPath(absolutePath) {
|
|
374
|
+
for (const prefix of FORBIDDEN_PREPARATION_PATH_PREFIXES) {
|
|
375
|
+
if (absolutePath === prefix || absolutePath.startsWith(`${prefix}/`)) {
|
|
376
|
+
throw new Error(`Preparation path may not target system directory ${prefix}: ${absolutePath}`);
|
|
377
|
+
}
|
|
378
|
+
}
|
|
379
|
+
}
|
|
380
|
+
export function resolveSourcePreparationPath(prepDataDir, preparationConfig) {
|
|
344
381
|
const configuredPath = preparationConfig.path.trim();
|
|
345
|
-
const resolvedPath = resolve(
|
|
382
|
+
const resolvedPath = resolve(prepDataDir, configuredPath);
|
|
346
383
|
if (isAbsolute(configuredPath)) {
|
|
384
|
+
rejectForbiddenPreparationPath(resolvedPath);
|
|
347
385
|
return resolvedPath;
|
|
348
386
|
}
|
|
349
|
-
|
|
387
|
+
rejectForbiddenPreparationPath(resolvedPath);
|
|
388
|
+
return assertPathWithinRoot(prepDataDir, resolvedPath, "Source folder path");
|
|
350
389
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
export declare function listVisibleSourceFolders(
|
|
1
|
+
export declare function listVisibleSourceFolders(prepDataDir: string): string[];
|
|
2
2
|
export declare function isReservedSourcePreparationPath(relativePath: string): boolean;
|
|
3
|
-
export declare function normalizeSourcePreparationPathForConfig(
|
|
3
|
+
export declare function normalizeSourcePreparationPathForConfig(prepDataDir: string, value: string): string;
|
|
4
4
|
export declare function defaultPreparationNameForPath(sourceFolderPath: string): string;
|
|
5
|
-
export declare function findSingleSourceFolderCandidate(
|
|
6
|
-
export declare function listSourceFolderChoices(
|
|
5
|
+
export declare function findSingleSourceFolderCandidate(prepDataDir: string): string | null;
|
|
6
|
+
export declare function listSourceFolderChoices(prepDataDir?: string): Array<{
|
|
7
7
|
value: string;
|
|
8
8
|
label: string;
|
|
9
9
|
hint: string;
|
|
10
10
|
}>;
|
|
11
|
-
export declare function defaultSourcePreparationPathForPrompt(name: string, introStyle: "first" | "additional" | "edit",
|
|
11
|
+
export declare function defaultSourcePreparationPathForPrompt(name: string, introStyle: "first" | "additional" | "edit", prepDataDir?: string): string;
|
|
@@ -12,10 +12,10 @@ const IGNORED_SOURCE_FOLDER_ENTRIES = new Set([
|
|
|
12
12
|
"interf.json",
|
|
13
13
|
"node_modules",
|
|
14
14
|
]);
|
|
15
|
-
export function listVisibleSourceFolders(
|
|
15
|
+
export function listVisibleSourceFolders(prepDataDir) {
|
|
16
16
|
let rootEntries = [];
|
|
17
17
|
try {
|
|
18
|
-
rootEntries = readdirSync(
|
|
18
|
+
rootEntries = readdirSync(prepDataDir);
|
|
19
19
|
}
|
|
20
20
|
catch {
|
|
21
21
|
return [];
|
|
@@ -24,7 +24,7 @@ export function listVisibleSourceFolders(projectPath) {
|
|
|
24
24
|
const visibleDirectories = [];
|
|
25
25
|
for (const entry of visibleEntries) {
|
|
26
26
|
try {
|
|
27
|
-
const entryPath = join(
|
|
27
|
+
const entryPath = join(prepDataDir, entry);
|
|
28
28
|
if (statSync(entryPath).isDirectory()) {
|
|
29
29
|
visibleDirectories.push(entry);
|
|
30
30
|
}
|
|
@@ -42,14 +42,14 @@ export function isReservedSourcePreparationPath(relativePath) {
|
|
|
42
42
|
normalized === ".interf" ||
|
|
43
43
|
normalized.startsWith(".interf/");
|
|
44
44
|
}
|
|
45
|
-
export function normalizeSourcePreparationPathForConfig(
|
|
45
|
+
export function normalizeSourcePreparationPathForConfig(prepDataDir, value) {
|
|
46
46
|
const trimmedValue = value.trim();
|
|
47
|
-
const resolvedPath = resolveSourcePreparationPath(
|
|
48
|
-
const relativePath = relative(
|
|
47
|
+
const resolvedPath = resolveSourcePreparationPath(prepDataDir, { path: trimmedValue });
|
|
48
|
+
const relativePath = relative(prepDataDir, resolvedPath).split(sep).join("/") || ".";
|
|
49
49
|
if (relativePath === ".") {
|
|
50
50
|
throw new Error("Pick a Source Folder, not the Interf Workspace itself.");
|
|
51
51
|
}
|
|
52
|
-
if (isAbsolute(trimmedValue) && !isPathWithinRoot(
|
|
52
|
+
if (isAbsolute(trimmedValue) && !isPathWithinRoot(prepDataDir, resolvedPath)) {
|
|
53
53
|
if (!existsSync(resolvedPath)) {
|
|
54
54
|
throw new Error("Pick an existing source folder.");
|
|
55
55
|
}
|
|
@@ -77,22 +77,22 @@ export function defaultPreparationNameForPath(sourceFolderPath) {
|
|
|
77
77
|
.filter((segment) => segment.length > 0 && segment !== ".");
|
|
78
78
|
return slugify(segments[segments.length - 1] ?? "") || DEFAULT_PREPARATION_NAME;
|
|
79
79
|
}
|
|
80
|
-
export function findSingleSourceFolderCandidate(
|
|
81
|
-
const visibleDirectories = listVisibleSourceFolders(
|
|
80
|
+
export function findSingleSourceFolderCandidate(prepDataDir) {
|
|
81
|
+
const visibleDirectories = listVisibleSourceFolders(prepDataDir);
|
|
82
82
|
if (visibleDirectories.length !== 1) {
|
|
83
83
|
return null;
|
|
84
84
|
}
|
|
85
85
|
return `./${visibleDirectories[0]}`;
|
|
86
86
|
}
|
|
87
|
-
export function listSourceFolderChoices(
|
|
88
|
-
return listVisibleSourceFolders(
|
|
87
|
+
export function listSourceFolderChoices(prepDataDir = process.cwd()) {
|
|
88
|
+
return listVisibleSourceFolders(prepDataDir).map((entry) => ({
|
|
89
89
|
value: `./${entry}`,
|
|
90
90
|
label: entry,
|
|
91
91
|
hint: `Use ./${entry} as the source folder`,
|
|
92
92
|
}));
|
|
93
93
|
}
|
|
94
|
-
export function defaultSourcePreparationPathForPrompt(name, introStyle,
|
|
95
|
-
const namedFolderPath = join(
|
|
94
|
+
export function defaultSourcePreparationPathForPrompt(name, introStyle, prepDataDir = process.cwd()) {
|
|
95
|
+
const namedFolderPath = join(prepDataDir, name);
|
|
96
96
|
if (existsSync(namedFolderPath)) {
|
|
97
97
|
try {
|
|
98
98
|
if (statSync(namedFolderPath).isDirectory()) {
|
|
@@ -104,7 +104,7 @@ export function defaultSourcePreparationPathForPrompt(name, introStyle, projectP
|
|
|
104
104
|
}
|
|
105
105
|
}
|
|
106
106
|
if (introStyle === "first") {
|
|
107
|
-
return findSingleSourceFolderCandidate(
|
|
107
|
+
return findSingleSourceFolderCandidate(prepDataDir) ?? `./${name}`;
|
|
108
108
|
}
|
|
109
109
|
return `./${name}`;
|
|
110
110
|
}
|
|
@@ -1,2 +1,9 @@
|
|
|
1
1
|
export declare function countFilesRecursive(dirPath: string): number;
|
|
2
2
|
export declare function listFilesRecursive(dirPath: string, predicate?: (filePath: string) => boolean): string[];
|
|
3
|
+
/**
|
|
4
|
+
* Async variant of {@link listFilesRecursive}. Uses promise-based
|
|
5
|
+
* `readdir` + `realpath` so directory walks on large source folders do
|
|
6
|
+
* not block the event loop. Symlink cycles are skipped via a
|
|
7
|
+
* canonical-path visited set, matching the sync variant.
|
|
8
|
+
*/
|
|
9
|
+
export declare function listFilesRecursiveAsync(dirPath: string, predicate?: (filePath: string) => boolean): Promise<string[]>;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { existsSync, readdirSync, realpathSync
|
|
1
|
+
import { existsSync, readdirSync, realpathSync } from "node:fs";
|
|
2
|
+
import { readdir, realpath } from "node:fs/promises";
|
|
2
3
|
import { join } from "node:path";
|
|
3
4
|
export function countFilesRecursive(dirPath) {
|
|
4
5
|
if (!existsSync(dirPath))
|
|
@@ -20,6 +21,23 @@ export function listFilesRecursive(dirPath, predicate) {
|
|
|
20
21
|
});
|
|
21
22
|
return files;
|
|
22
23
|
}
|
|
24
|
+
/**
|
|
25
|
+
* Async variant of {@link listFilesRecursive}. Uses promise-based
|
|
26
|
+
* `readdir` + `realpath` so directory walks on large source folders do
|
|
27
|
+
* not block the event loop. Symlink cycles are skipped via a
|
|
28
|
+
* canonical-path visited set, matching the sync variant.
|
|
29
|
+
*/
|
|
30
|
+
export async function listFilesRecursiveAsync(dirPath, predicate) {
|
|
31
|
+
const files = [];
|
|
32
|
+
if (!existsSync(dirPath))
|
|
33
|
+
return files;
|
|
34
|
+
await walkFilesRecursiveAsync(dirPath, (filePath) => {
|
|
35
|
+
if (!predicate || predicate(filePath)) {
|
|
36
|
+
files.push(filePath);
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
return files;
|
|
40
|
+
}
|
|
23
41
|
function walkFilesRecursive(dirPath, onFile, visitedDirs = new Set()) {
|
|
24
42
|
if (!existsSync(dirPath))
|
|
25
43
|
return;
|
|
@@ -36,19 +54,88 @@ function walkFilesRecursiveInternal(dirPath, onFile, visitedDirs) {
|
|
|
36
54
|
if (visitedDirs.has(resolvedDir))
|
|
37
55
|
return;
|
|
38
56
|
visitedDirs.add(resolvedDir);
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
}
|
|
45
|
-
|
|
57
|
+
// `withFileTypes` returns Dirent entries that already encode whether
|
|
58
|
+
// each name is a file/dir/symlink; using them avoids the per-entry
|
|
59
|
+
// statSync that previously dominated the walk on large source folders.
|
|
60
|
+
let entries;
|
|
61
|
+
try {
|
|
62
|
+
entries = readdirSync(dirPath, { withFileTypes: true });
|
|
63
|
+
}
|
|
64
|
+
catch {
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
for (const entry of entries) {
|
|
68
|
+
const fullPath = join(dirPath, entry.name);
|
|
69
|
+
if (entry.isSymbolicLink()) {
|
|
70
|
+
// Symlinks need realpath to detect cycles; if the target reads as
|
|
71
|
+
// a directory we recurse, otherwise treat the link as a file.
|
|
72
|
+
try {
|
|
73
|
+
const target = realpathSync(fullPath);
|
|
74
|
+
if (visitedDirs.has(target))
|
|
75
|
+
continue;
|
|
76
|
+
try {
|
|
77
|
+
readdirSync(target);
|
|
78
|
+
walkFilesRecursiveInternal(fullPath, onFile, visitedDirs);
|
|
79
|
+
}
|
|
80
|
+
catch {
|
|
81
|
+
onFile(fullPath);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
catch {
|
|
85
|
+
// Broken or inaccessible link.
|
|
86
|
+
}
|
|
46
87
|
continue;
|
|
47
88
|
}
|
|
48
|
-
if (
|
|
89
|
+
if (entry.isDirectory()) {
|
|
49
90
|
walkFilesRecursiveInternal(fullPath, onFile, visitedDirs);
|
|
50
91
|
}
|
|
51
|
-
else if (
|
|
92
|
+
else if (entry.isFile()) {
|
|
93
|
+
onFile(fullPath);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
async function walkFilesRecursiveAsync(dirPath, onFile, visitedDirs = new Set()) {
|
|
98
|
+
let resolvedDir;
|
|
99
|
+
try {
|
|
100
|
+
resolvedDir = await realpath(dirPath);
|
|
101
|
+
}
|
|
102
|
+
catch {
|
|
103
|
+
return;
|
|
104
|
+
}
|
|
105
|
+
if (visitedDirs.has(resolvedDir))
|
|
106
|
+
return;
|
|
107
|
+
visitedDirs.add(resolvedDir);
|
|
108
|
+
let entries;
|
|
109
|
+
try {
|
|
110
|
+
entries = await readdir(dirPath, { withFileTypes: true });
|
|
111
|
+
}
|
|
112
|
+
catch {
|
|
113
|
+
return;
|
|
114
|
+
}
|
|
115
|
+
for (const entry of entries) {
|
|
116
|
+
const fullPath = join(dirPath, entry.name);
|
|
117
|
+
if (entry.isSymbolicLink()) {
|
|
118
|
+
try {
|
|
119
|
+
const target = await realpath(fullPath);
|
|
120
|
+
if (visitedDirs.has(target))
|
|
121
|
+
continue;
|
|
122
|
+
try {
|
|
123
|
+
await readdir(target);
|
|
124
|
+
await walkFilesRecursiveAsync(fullPath, onFile, visitedDirs);
|
|
125
|
+
}
|
|
126
|
+
catch {
|
|
127
|
+
onFile(fullPath);
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
catch {
|
|
131
|
+
// Broken or inaccessible link.
|
|
132
|
+
}
|
|
133
|
+
continue;
|
|
134
|
+
}
|
|
135
|
+
if (entry.isDirectory()) {
|
|
136
|
+
await walkFilesRecursiveAsync(fullPath, onFile, visitedDirs);
|
|
137
|
+
}
|
|
138
|
+
else if (entry.isFile()) {
|
|
52
139
|
onFile(fullPath);
|
|
53
140
|
}
|
|
54
141
|
}
|
|
@@ -16,8 +16,8 @@ export declare const TestCaseSchema: z.ZodObject<{
|
|
|
16
16
|
}, z.core.$strip>;
|
|
17
17
|
export declare const TestSpecSchema: z.ZodObject<{
|
|
18
18
|
type: z.ZodEnum<{
|
|
19
|
+
"source-files": "source-files";
|
|
19
20
|
compiled: "compiled";
|
|
20
|
-
raw: "raw";
|
|
21
21
|
}>;
|
|
22
22
|
name: z.ZodString;
|
|
23
23
|
description: z.ZodOptional<z.ZodString>;
|
|
@@ -60,8 +60,8 @@ export declare const TestCaseResultSchema: z.ZodObject<{
|
|
|
60
60
|
export declare const TestTargetResultSchema: z.ZodObject<{
|
|
61
61
|
target: z.ZodObject<{
|
|
62
62
|
type: z.ZodEnum<{
|
|
63
|
+
"source-files": "source-files";
|
|
63
64
|
compiled: "compiled";
|
|
64
|
-
raw: "raw";
|
|
65
65
|
}>;
|
|
66
66
|
name: z.ZodString;
|
|
67
67
|
path: z.ZodString;
|
|
@@ -98,8 +98,8 @@ export declare const TestTargetRunSchema: z.ZodObject<{
|
|
|
98
98
|
id: z.ZodString;
|
|
99
99
|
name: z.ZodString;
|
|
100
100
|
type: z.ZodEnum<{
|
|
101
|
+
"source-files": "source-files";
|
|
101
102
|
compiled: "compiled";
|
|
102
|
-
raw: "raw";
|
|
103
103
|
}>;
|
|
104
104
|
file: z.ZodString;
|
|
105
105
|
description: z.ZodOptional<z.ZodString>;
|
|
@@ -138,8 +138,8 @@ export declare const TestTargetRunSchema: z.ZodObject<{
|
|
|
138
138
|
results: z.ZodArray<z.ZodObject<{
|
|
139
139
|
target: z.ZodObject<{
|
|
140
140
|
type: z.ZodEnum<{
|
|
141
|
+
"source-files": "source-files";
|
|
141
142
|
compiled: "compiled";
|
|
142
|
-
raw: "raw";
|
|
143
143
|
}>;
|
|
144
144
|
name: z.ZodString;
|
|
145
145
|
path: z.ZodString;
|
|
@@ -170,8 +170,8 @@ export declare const TestTargetRunSchema: z.ZodObject<{
|
|
|
170
170
|
}, z.core.$strip>>;
|
|
171
171
|
}, z.core.$strip>;
|
|
172
172
|
export declare const TestRunModeSchema: z.ZodEnum<{
|
|
173
|
+
"source-files": "source-files";
|
|
173
174
|
compiled: "compiled";
|
|
174
|
-
raw: "raw";
|
|
175
175
|
both: "both";
|
|
176
176
|
}>;
|
|
177
177
|
export declare const TestRunTargetSummarySchema: z.ZodObject<{
|
|
@@ -184,8 +184,8 @@ export declare const TestRunTargetSummarySchema: z.ZodObject<{
|
|
|
184
184
|
total_checks: z.ZodNumber;
|
|
185
185
|
target: z.ZodObject<{
|
|
186
186
|
type: z.ZodEnum<{
|
|
187
|
+
"source-files": "source-files";
|
|
187
188
|
compiled: "compiled";
|
|
188
|
-
raw: "raw";
|
|
189
189
|
}>;
|
|
190
190
|
name: z.ZodString;
|
|
191
191
|
path: z.ZodString;
|
|
@@ -197,8 +197,8 @@ export declare const ReadinessCheckRunSchema: z.ZodObject<{
|
|
|
197
197
|
version: z.ZodLiteral<1>;
|
|
198
198
|
generated_at: z.ZodString;
|
|
199
199
|
mode: z.ZodEnum<{
|
|
200
|
+
"source-files": "source-files";
|
|
200
201
|
compiled: "compiled";
|
|
201
|
-
raw: "raw";
|
|
202
202
|
both: "both";
|
|
203
203
|
}>;
|
|
204
204
|
source_path: z.ZodString;
|
|
@@ -207,7 +207,7 @@ export declare const ReadinessCheckRunSchema: z.ZodObject<{
|
|
|
207
207
|
name: z.ZodString;
|
|
208
208
|
portable_context_path: z.ZodNullable<z.ZodString>;
|
|
209
209
|
}, z.core.$strip>;
|
|
210
|
-
|
|
210
|
+
source_files: z.ZodNullable<z.ZodObject<{
|
|
211
211
|
label: z.ZodString;
|
|
212
212
|
run_path: z.ZodString;
|
|
213
213
|
ok: z.ZodBoolean;
|
|
@@ -217,8 +217,8 @@ export declare const ReadinessCheckRunSchema: z.ZodObject<{
|
|
|
217
217
|
total_checks: z.ZodNumber;
|
|
218
218
|
target: z.ZodObject<{
|
|
219
219
|
type: z.ZodEnum<{
|
|
220
|
+
"source-files": "source-files";
|
|
220
221
|
compiled: "compiled";
|
|
221
|
-
raw: "raw";
|
|
222
222
|
}>;
|
|
223
223
|
name: z.ZodString;
|
|
224
224
|
path: z.ZodString;
|
|
@@ -235,8 +235,8 @@ export declare const ReadinessCheckRunSchema: z.ZodObject<{
|
|
|
235
235
|
total_checks: z.ZodNumber;
|
|
236
236
|
target: z.ZodObject<{
|
|
237
237
|
type: z.ZodEnum<{
|
|
238
|
+
"source-files": "source-files";
|
|
238
239
|
compiled: "compiled";
|
|
239
|
-
raw: "raw";
|
|
240
240
|
}>;
|
|
241
241
|
name: z.ZodString;
|
|
242
242
|
path: z.ZodString;
|
|
@@ -244,9 +244,8 @@ export declare const ReadinessCheckRunSchema: z.ZodObject<{
|
|
|
244
244
|
}, z.core.$strip>;
|
|
245
245
|
}, z.core.$strip>>;
|
|
246
246
|
summary: z.ZodObject<{
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
pass_rate_delta: z.ZodNullable<z.ZodNumber>;
|
|
247
|
+
source_files_pass_rate: z.ZodNullable<z.ZodNumber>;
|
|
248
|
+
portable_context_pass_rate: z.ZodNullable<z.ZodNumber>;
|
|
250
249
|
}, z.core.$strip>;
|
|
251
250
|
}, z.core.$strip>;
|
|
252
251
|
export type { TestCaseExpect, TestTargetType };
|
|
@@ -81,7 +81,7 @@ export const TestTargetRunSchema = z.object({
|
|
|
81
81
|
target_count: z.number(),
|
|
82
82
|
results: z.array(TestTargetResultSchema),
|
|
83
83
|
});
|
|
84
|
-
export const TestRunModeSchema = z.enum(["
|
|
84
|
+
export const TestRunModeSchema = z.enum(["source-files", "compiled", "both"]);
|
|
85
85
|
export const TestRunTargetSummarySchema = z.object({
|
|
86
86
|
label: z.string(),
|
|
87
87
|
run_path: z.string(),
|
|
@@ -108,11 +108,10 @@ export const ReadinessCheckRunSchema = z.object({
|
|
|
108
108
|
name: PreparationNameSchema,
|
|
109
109
|
portable_context_path: z.string().nullable(),
|
|
110
110
|
}),
|
|
111
|
-
|
|
111
|
+
source_files: TestRunTargetSummarySchema.nullable(),
|
|
112
112
|
compiled: TestRunTargetSummarySchema.nullable(),
|
|
113
113
|
summary: z.object({
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
pass_rate_delta: z.number().nullable(),
|
|
114
|
+
source_files_pass_rate: z.number().nullable(),
|
|
115
|
+
portable_context_pass_rate: z.number().nullable(),
|
|
117
116
|
}),
|
|
118
117
|
});
|