@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 { z } from "zod";
|
|
2
|
-
import { ReadinessCheckSchema, ReadinessGateSchema, ReadinessStateSchema, ReadinessStatusSchema, ReadinessTargetResultSchema, RuntimeContractTypeSchema, RuntimeExecutorInfoSchema, RuntimeStageSchema, RuntimeTargetTypeSchema, TestCaseExpectSchema, TestTargetTypeSchema, MethodIdSchema } from "../../contracts/lib/schema.js";
|
|
3
|
-
export { ReadinessCheckSchema, ReadinessGateSchema, ReadinessStateSchema, ReadinessStatusSchema, ReadinessTargetResultSchema, RuntimeContractTypeSchema, RuntimeExecutorInfoSchema, RuntimeStageSchema, RuntimeTargetTypeSchema, SourceCompiledMaxAttemptsSchema, SourceCompiledMaxLoopsSchema, TestCaseExpectSchema, TestTargetTypeSchema, InterfIdPattern, MethodIdSchema, } from "../../contracts/lib/schema.js";
|
|
2
|
+
import { ReadinessCheckSchema, ReadinessGateSchema, ReadinessStateSchema, ReadinessStatusSchema, ReadinessTargetResultSchema, RuntimeContractTypeSchema, RuntimeExecutorInfoSchema, RuntimeStageSchema, RuntimeTargetTypeSchema, SourceFilesSchema, SourceFileSchema, SourceKindSchema, SourceSchema, SourceSnapshotSchema, StageInputSchema, StageInputsSchema, TestCaseExpectSchema, TestTargetTypeSchema, MethodIdSchema } from "../../contracts/lib/schema.js";
|
|
3
|
+
export { ReadinessCheckSchema, ReadinessGateSchema, ReadinessStateSchema, ReadinessStatusSchema, ReadinessTargetResultSchema, RuntimeContractTypeSchema, RuntimeExecutorInfoSchema, RuntimeStageSchema, RuntimeTargetTypeSchema, SourceFilesSchema, SourceFileSchema, SourceKindSchema, SourceSchema, SourceSnapshotSchema, StageInputSchema, StageInputsSchema, SourceCompiledMaxAttemptsSchema, SourceCompiledMaxLoopsSchema, TestCaseExpectSchema, TestTargetTypeSchema, InterfIdPattern, MethodIdSchema, } from "../../contracts/lib/schema.js";
|
|
4
4
|
export type RuntimeStatus = "idle" | "running" | "compiled" | "stale" | "failed";
|
|
5
5
|
export type CompiledStage = "idle" | "compiled" | "failed" | string;
|
|
6
6
|
export declare const MethodZoneIdSchema: z.ZodString;
|
|
@@ -10,24 +10,24 @@ export declare const MethodCompiledZoneKindSchema: z.ZodEnum<{
|
|
|
10
10
|
directory: "directory";
|
|
11
11
|
}>;
|
|
12
12
|
export declare const MethodZoneRoleSchema: z.ZodEnum<{
|
|
13
|
-
output: "output";
|
|
14
13
|
runtime: "runtime";
|
|
14
|
+
output: "output";
|
|
15
15
|
input: "input";
|
|
16
16
|
working: "working";
|
|
17
17
|
}>;
|
|
18
18
|
export declare const CompiledStageStatusSchema: z.ZodEnum<{
|
|
19
|
+
succeeded: "succeeded";
|
|
19
20
|
failed: "failed";
|
|
20
|
-
idle: "idle";
|
|
21
21
|
running: "running";
|
|
22
|
-
|
|
22
|
+
idle: "idle";
|
|
23
23
|
}>;
|
|
24
24
|
export declare const CompiledStageStateSchema: z.ZodObject<{
|
|
25
25
|
contract_type: z.ZodOptional<z.ZodString>;
|
|
26
26
|
status: z.ZodOptional<z.ZodEnum<{
|
|
27
|
+
succeeded: "succeeded";
|
|
27
28
|
failed: "failed";
|
|
28
|
-
idle: "idle";
|
|
29
29
|
running: "running";
|
|
30
|
-
|
|
30
|
+
idle: "idle";
|
|
31
31
|
}>>;
|
|
32
32
|
started_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
33
33
|
finished_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
@@ -43,10 +43,10 @@ export declare const CompiledStateSchema: z.ZodObject<{
|
|
|
43
43
|
stages: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
44
44
|
contract_type: z.ZodOptional<z.ZodString>;
|
|
45
45
|
status: z.ZodOptional<z.ZodEnum<{
|
|
46
|
+
succeeded: "succeeded";
|
|
46
47
|
failed: "failed";
|
|
47
|
-
idle: "idle";
|
|
48
48
|
running: "running";
|
|
49
|
-
|
|
49
|
+
idle: "idle";
|
|
50
50
|
}>>;
|
|
51
51
|
started_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
52
52
|
finished_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
@@ -94,8 +94,8 @@ export declare const CompiledHealthSchema: z.ZodObject<{
|
|
|
94
94
|
compiled: "compiled";
|
|
95
95
|
stale: "stale";
|
|
96
96
|
failed: "failed";
|
|
97
|
-
idle: "idle";
|
|
98
97
|
running: "running";
|
|
98
|
+
idle: "idle";
|
|
99
99
|
}>;
|
|
100
100
|
stage: z.ZodUnion<readonly [z.ZodEnum<{
|
|
101
101
|
compiled: "compiled";
|
|
@@ -140,16 +140,6 @@ export declare const CompiledViewSpecSchema: z.ZodObject<{
|
|
|
140
140
|
paths: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
141
141
|
}, z.core.$strip>>;
|
|
142
142
|
}, z.core.$strip>;
|
|
143
|
-
export declare const CompiledRawSnapshotSchema: z.ZodObject<{
|
|
144
|
-
kind: z.ZodLiteral<"compiled-raw-snapshot">;
|
|
145
|
-
version: z.ZodLiteral<1>;
|
|
146
|
-
generated_at: z.ZodString;
|
|
147
|
-
target_name: z.ZodString;
|
|
148
|
-
source_root: z.ZodString;
|
|
149
|
-
raw_root: z.ZodString;
|
|
150
|
-
source_total: z.ZodNumber;
|
|
151
|
-
sample_files: z.ZodArray<z.ZodString>;
|
|
152
|
-
}, z.core.$strip>;
|
|
153
143
|
export declare const MethodPurposeSchema: z.ZodObject<{
|
|
154
144
|
label: z.ZodString;
|
|
155
145
|
task_hint: z.ZodString;
|
|
@@ -157,8 +147,8 @@ export declare const MethodPurposeSchema: z.ZodObject<{
|
|
|
157
147
|
export declare const MethodZoneSchema: z.ZodObject<{
|
|
158
148
|
id: z.ZodString;
|
|
159
149
|
role: z.ZodEnum<{
|
|
160
|
-
output: "output";
|
|
161
150
|
runtime: "runtime";
|
|
151
|
+
output: "output";
|
|
162
152
|
input: "input";
|
|
163
153
|
working: "working";
|
|
164
154
|
}>;
|
|
@@ -175,8 +165,8 @@ export declare const MethodZoneSchema: z.ZodObject<{
|
|
|
175
165
|
export declare const MethodCompiledZoneSchema: z.ZodObject<{
|
|
176
166
|
id: z.ZodString;
|
|
177
167
|
role: z.ZodEnum<{
|
|
178
|
-
output: "output";
|
|
179
168
|
runtime: "runtime";
|
|
169
|
+
output: "output";
|
|
180
170
|
input: "input";
|
|
181
171
|
working: "working";
|
|
182
172
|
}>;
|
|
@@ -198,8 +188,8 @@ export declare const MethodSchemaSchema: z.ZodObject<{
|
|
|
198
188
|
zones: z.ZodArray<z.ZodObject<{
|
|
199
189
|
id: z.ZodString;
|
|
200
190
|
role: z.ZodEnum<{
|
|
201
|
-
output: "output";
|
|
202
191
|
runtime: "runtime";
|
|
192
|
+
output: "output";
|
|
203
193
|
input: "input";
|
|
204
194
|
working: "working";
|
|
205
195
|
}>;
|
|
@@ -222,8 +212,8 @@ export declare const MethodCompiledSchemaSchema: z.ZodObject<{
|
|
|
222
212
|
zones: z.ZodArray<z.ZodObject<{
|
|
223
213
|
id: z.ZodString;
|
|
224
214
|
role: z.ZodEnum<{
|
|
225
|
-
output: "output";
|
|
226
215
|
runtime: "runtime";
|
|
216
|
+
output: "output";
|
|
227
217
|
input: "input";
|
|
228
218
|
working: "working";
|
|
229
219
|
}>;
|
|
@@ -274,13 +264,13 @@ export declare const ExecutionShellPathsSchema: z.ZodObject<{
|
|
|
274
264
|
export declare const RuntimeStageInstructionsSchema: z.ZodObject<{
|
|
275
265
|
stage_skill_dir: z.ZodString;
|
|
276
266
|
effective_mode: z.ZodEnum<{
|
|
267
|
+
override: "override";
|
|
277
268
|
builtin: "builtin";
|
|
278
269
|
extend: "extend";
|
|
279
|
-
override: "override";
|
|
280
270
|
}>;
|
|
281
271
|
local_mode: z.ZodNullable<z.ZodEnum<{
|
|
282
|
-
extend: "extend";
|
|
283
272
|
override: "override";
|
|
273
|
+
extend: "extend";
|
|
284
274
|
}>>;
|
|
285
275
|
local_docs: z.ZodArray<z.ZodString>;
|
|
286
276
|
mode_sources: z.ZodArray<z.ZodString>;
|
|
@@ -334,13 +324,13 @@ export declare const RuntimeStageContractSchema: z.ZodObject<{
|
|
|
334
324
|
instructions: z.ZodObject<{
|
|
335
325
|
stage_skill_dir: z.ZodString;
|
|
336
326
|
effective_mode: z.ZodEnum<{
|
|
327
|
+
override: "override";
|
|
337
328
|
builtin: "builtin";
|
|
338
329
|
extend: "extend";
|
|
339
|
-
override: "override";
|
|
340
330
|
}>;
|
|
341
331
|
local_mode: z.ZodNullable<z.ZodEnum<{
|
|
342
|
-
extend: "extend";
|
|
343
332
|
override: "override";
|
|
333
|
+
extend: "extend";
|
|
344
334
|
}>>;
|
|
345
335
|
local_docs: z.ZodArray<z.ZodString>;
|
|
346
336
|
mode_sources: z.ZodArray<z.ZodString>;
|
|
@@ -363,7 +353,6 @@ export declare const RuntimeStageContractSchema: z.ZodObject<{
|
|
|
363
353
|
artifacts: z.ZodObject<{
|
|
364
354
|
reads: z.ZodArray<z.ZodString>;
|
|
365
355
|
writes: z.ZodArray<z.ZodString>;
|
|
366
|
-
verifies: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
367
356
|
}, z.core.$strip>;
|
|
368
357
|
policies: z.ZodObject<{
|
|
369
358
|
execution_mode: z.ZodLiteral<"deterministic">;
|
|
@@ -392,9 +381,9 @@ export declare const RuntimeRunSchema: z.ZodObject<{
|
|
|
392
381
|
stage_label: z.ZodString;
|
|
393
382
|
contract_type: z.ZodString;
|
|
394
383
|
status: z.ZodEnum<{
|
|
384
|
+
succeeded: "succeeded";
|
|
395
385
|
failed: "failed";
|
|
396
386
|
running: "running";
|
|
397
|
-
succeeded: "succeeded";
|
|
398
387
|
}>;
|
|
399
388
|
executor: z.ZodObject<{
|
|
400
389
|
kind: z.ZodEnum<{
|
|
@@ -475,7 +464,7 @@ export declare const MethodImprovementContextSchema: z.ZodObject<{
|
|
|
475
464
|
review_paths: z.ZodObject<{
|
|
476
465
|
method_root: z.ZodString;
|
|
477
466
|
compiled_runtime: z.ZodNullable<z.ZodString>;
|
|
478
|
-
|
|
467
|
+
readiness_runs: z.ZodNullable<z.ZodString>;
|
|
479
468
|
execution_shells: z.ZodNullable<z.ZodString>;
|
|
480
469
|
test_runs: z.ZodNullable<z.ZodString>;
|
|
481
470
|
test_sandboxes: z.ZodNullable<z.ZodString>;
|
|
@@ -635,7 +624,13 @@ export type ViewSection = z.infer<typeof ViewSectionSchema>;
|
|
|
635
624
|
export type ViewCard = z.infer<typeof ViewCardSchema>;
|
|
636
625
|
export type CompiledHealth = z.infer<typeof CompiledHealthSchema>;
|
|
637
626
|
export type CompiledViewSpec = z.infer<typeof CompiledViewSpecSchema>;
|
|
638
|
-
export type
|
|
627
|
+
export type SourceKind = z.infer<typeof SourceKindSchema>;
|
|
628
|
+
export type Source = z.infer<typeof SourceSchema>;
|
|
629
|
+
export type SourceFile = z.infer<typeof SourceFileSchema>;
|
|
630
|
+
export type SourceFiles = z.infer<typeof SourceFilesSchema>;
|
|
631
|
+
export type SourceSnapshot = z.infer<typeof SourceSnapshotSchema>;
|
|
632
|
+
export type StageInput = z.infer<typeof StageInputSchema>;
|
|
633
|
+
export type StageInputs = z.infer<typeof StageInputsSchema>;
|
|
639
634
|
export type MethodCompiledZone = z.infer<typeof MethodCompiledZoneSchema>;
|
|
640
635
|
export type MethodCompiledSchema = z.infer<typeof MethodCompiledSchemaSchema>;
|
|
641
636
|
export type MethodCompiledZoneKind = z.infer<typeof MethodCompiledZoneKindSchema>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import { COMPILED_ZONE_KINDS, } from "../method-primitives.js";
|
|
3
3
|
import { RuntimeContractTypeSchema, RuntimeExecutorInfoSchema, RuntimeStageSchema, RuntimeTargetTypeSchema, SourceCompiledMaxAttemptsSchema, SourceCompiledMaxLoopsSchema, InterfIdPattern, MethodIdSchema, } from "../../contracts/lib/schema.js";
|
|
4
|
-
export { ReadinessCheckSchema, ReadinessGateSchema, ReadinessStateSchema, ReadinessStatusSchema, ReadinessTargetResultSchema, RuntimeContractTypeSchema, RuntimeExecutorInfoSchema, RuntimeStageSchema, RuntimeTargetTypeSchema, SourceCompiledMaxAttemptsSchema, SourceCompiledMaxLoopsSchema, TestCaseExpectSchema, TestTargetTypeSchema, InterfIdPattern, MethodIdSchema, } from "../../contracts/lib/schema.js";
|
|
4
|
+
export { ReadinessCheckSchema, ReadinessGateSchema, ReadinessStateSchema, ReadinessStatusSchema, ReadinessTargetResultSchema, RuntimeContractTypeSchema, RuntimeExecutorInfoSchema, RuntimeStageSchema, RuntimeTargetTypeSchema, SourceFilesSchema, SourceFileSchema, SourceKindSchema, SourceSchema, SourceSnapshotSchema, StageInputSchema, StageInputsSchema, SourceCompiledMaxAttemptsSchema, SourceCompiledMaxLoopsSchema, TestCaseExpectSchema, TestTargetTypeSchema, InterfIdPattern, MethodIdSchema, } from "../../contracts/lib/schema.js";
|
|
5
5
|
const JsonRecordSchema = z.record(z.string(), z.unknown());
|
|
6
6
|
const COMPILED_RELATIVE_PATH_SEGMENT = /^(?!\.{1,2}$)[^/\\]+$/;
|
|
7
7
|
function isCompiledRelativePath(value) {
|
|
@@ -77,16 +77,6 @@ export const CompiledViewSpecSchema = z.object({
|
|
|
77
77
|
cards: z.array(ViewCardSchema),
|
|
78
78
|
sections: z.array(ViewSectionSchema),
|
|
79
79
|
});
|
|
80
|
-
export const CompiledRawSnapshotSchema = z.object({
|
|
81
|
-
kind: z.literal("compiled-raw-snapshot"),
|
|
82
|
-
version: z.literal(1),
|
|
83
|
-
generated_at: z.string(),
|
|
84
|
-
target_name: z.string(),
|
|
85
|
-
source_root: z.string(),
|
|
86
|
-
raw_root: z.string(),
|
|
87
|
-
source_total: z.number(),
|
|
88
|
-
sample_files: z.array(z.string()),
|
|
89
|
-
});
|
|
90
80
|
export const MethodPurposeSchema = z.object({
|
|
91
81
|
label: z.string().min(1),
|
|
92
82
|
task_hint: z.string().min(1),
|
|
@@ -177,7 +167,6 @@ export const RuntimeStageContractSchema = z.object({
|
|
|
177
167
|
artifacts: z.object({
|
|
178
168
|
reads: z.array(z.string()),
|
|
179
169
|
writes: z.array(z.string()),
|
|
180
|
-
verifies: z.array(z.string()).optional(),
|
|
181
170
|
}),
|
|
182
171
|
policies: z.object({
|
|
183
172
|
execution_mode: z.literal("deterministic"),
|
|
@@ -260,7 +249,7 @@ export const MethodImprovementContextSchema = z.object({
|
|
|
260
249
|
review_paths: z.object({
|
|
261
250
|
method_root: z.string(),
|
|
262
251
|
compiled_runtime: z.string().nullable(),
|
|
263
|
-
|
|
252
|
+
readiness_runs: z.string().nullable(),
|
|
264
253
|
execution_shells: z.string().nullable(),
|
|
265
254
|
test_runs: z.string().nullable(),
|
|
266
255
|
test_sandboxes: z.string().nullable(),
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { type InterfConfig } from "../project-model/interf-detect.js";
|
|
2
|
-
export type { MethodReporter
|
|
3
|
-
export { methodQueryDirectory, methodImproveDirectory, methodCompileStageDirectory, emptyLocalSkillContractExtension, buildLocalSkillContractExtension, buildLocalSkillContractExtensionRelativeTo, mergeLocalSkillContractExtensions, buildStageInstructions, reportLine, reportBlankLine, reportValidationFailure, resolveStageAcceptance, validateStageOutcome, } from "../method-package/method-helpers.js";
|
|
2
|
+
export type { MethodReporter } from "../method-package/method-helpers.js";
|
|
4
3
|
export type CompiledCheck = "compiled" | "stage";
|
|
5
4
|
export interface DetectedInterfTarget {
|
|
6
5
|
path: string;
|
|
@@ -9,7 +8,7 @@ export interface DetectedInterfTarget {
|
|
|
9
8
|
config: InterfConfig;
|
|
10
9
|
}
|
|
11
10
|
export declare function detectCompiled(cwd: string): DetectedInterfTarget | null;
|
|
12
|
-
export declare function createCompiled(name: string, sourcePath: string, methodId
|
|
11
|
+
export declare function createCompiled(name: string, sourcePath: string, methodId: string | undefined, about: string | undefined, sourceFolderPath: string): string;
|
|
13
12
|
export declare function verifyCompiledCheck(check: CompiledCheck, compiledPath: string): import("./validate-compiled.js").CompiledMethodValidation;
|
|
14
13
|
export { runCompiledSummarize, runCompiledCompile, compileCompiled, resolveCompiledContext, compiledExecutionStages, } from "./compiled-compile.js";
|
|
15
14
|
export type { CompiledSummarizeResult, CompiledCompileResult, CompiledStageExecutionDefinition, StageShellRetentionMode, } from "./compiled-compile.js";
|
|
@@ -2,7 +2,6 @@ import { createCompiled as createCompiledScaffold, } from "../project-model/inte
|
|
|
2
2
|
import { detectInterf } from "../project-model/interf-detect.js";
|
|
3
3
|
import { validateCompiledCompile, } from "./validate.js";
|
|
4
4
|
import { DEFAULT_METHOD_ID } from "../methods/method-resolution.js";
|
|
5
|
-
export { methodQueryDirectory, methodImproveDirectory, methodCompileStageDirectory, emptyLocalSkillContractExtension, buildLocalSkillContractExtension, buildLocalSkillContractExtensionRelativeTo, mergeLocalSkillContractExtensions, buildStageInstructions, reportLine, reportBlankLine, reportValidationFailure, resolveStageAcceptance, validateStageOutcome, } from "../method-package/method-helpers.js";
|
|
6
5
|
export function detectCompiled(cwd) {
|
|
7
6
|
const detected = detectInterf(cwd);
|
|
8
7
|
if (!detected)
|
|
@@ -14,8 +13,8 @@ export function detectCompiled(cwd) {
|
|
|
14
13
|
config: detected.config,
|
|
15
14
|
};
|
|
16
15
|
}
|
|
17
|
-
export function createCompiled(name, sourcePath, methodId
|
|
18
|
-
return createCompiledScaffold(name, sourcePath, methodId, about, sourceFolderPath);
|
|
16
|
+
export function createCompiled(name, sourcePath, methodId, about, sourceFolderPath) {
|
|
17
|
+
return createCompiledScaffold(name, sourcePath, methodId ?? DEFAULT_METHOD_ID, about, sourceFolderPath);
|
|
19
18
|
}
|
|
20
19
|
export function verifyCompiledCheck(check, compiledPath) {
|
|
21
20
|
switch (check) {
|
|
@@ -14,8 +14,10 @@ const COMPILE_RUNTIME_RESET_ENTRIES = [
|
|
|
14
14
|
"view-spec.json",
|
|
15
15
|
"inventory.json",
|
|
16
16
|
"run.json",
|
|
17
|
-
"
|
|
17
|
+
"source-files.json",
|
|
18
|
+
"source-snapshot.json",
|
|
18
19
|
"stage-contract.json",
|
|
20
|
+
"stages",
|
|
19
21
|
];
|
|
20
22
|
const PRESERVED_COMPILED_ROOTS = new Set([
|
|
21
23
|
".agents",
|
|
@@ -39,7 +39,7 @@ export function buildStagePrompt(instructions, contractPath, statusLines) {
|
|
|
39
39
|
"Do not narrate intentions, plans, or reasoning to the user.",
|
|
40
40
|
"Only emit user-visible updates that begin with STATUS:, DONE:, BLOCKED:, or ERROR:.",
|
|
41
41
|
"Those status lines are progress hints for the operator. The CLI decides stage completion from artifacts, validation, and reconcile checks rather than trusting status text alone.",
|
|
42
|
-
"Before any long-running
|
|
42
|
+
"Before any long-running source inspection or shell-based helper step, emit a STATUS: line that names the current subtask.",
|
|
43
43
|
"If work stays in progress, do not remain silent for more than about one minute. Emit another STATUS: line when you switch files, page groups, targets, or extraction methods.",
|
|
44
44
|
"If you respond conversationally instead of executing the stage, the run will be treated as failed.",
|
|
45
45
|
"As soon as the required proof artifacts are complete, stop. Do not keep browsing or auditing after the contract is satisfied.",
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { type SourceFiles, type SourceSnapshot, type StageInputs } from "../contracts/lib/schema.js";
|
|
2
|
+
export declare function buildCompiledSourceFiles(compiledPath: string, sourcePath?: string, generatedAt?: string): SourceFiles;
|
|
3
|
+
export declare function writeCompiledSourceFiles(compiledPath: string, sourcePath?: string, generatedAt?: string): SourceFiles;
|
|
4
|
+
export declare function buildCompiledSourceSnapshot(options: {
|
|
5
|
+
compiledPath: string;
|
|
6
|
+
sourceFiles?: SourceFiles;
|
|
7
|
+
sourcePath?: string;
|
|
8
|
+
runId?: string | null;
|
|
9
|
+
generatedAt?: string;
|
|
10
|
+
}): SourceSnapshot;
|
|
11
|
+
export declare function writeCompiledSourceSnapshot(options: {
|
|
12
|
+
compiledPath: string;
|
|
13
|
+
sourceFiles?: SourceFiles;
|
|
14
|
+
sourcePath?: string;
|
|
15
|
+
runId?: string | null;
|
|
16
|
+
generatedAt?: string;
|
|
17
|
+
}): SourceSnapshot;
|
|
18
|
+
export declare function buildCompiledStageInputs(options: {
|
|
19
|
+
methodId: string;
|
|
20
|
+
stageId: string;
|
|
21
|
+
snapshot: SourceSnapshot;
|
|
22
|
+
runId?: string | null;
|
|
23
|
+
generatedAt?: string;
|
|
24
|
+
}): StageInputs;
|
|
25
|
+
export declare function writeCompiledStageInputs(options: {
|
|
26
|
+
compiledPath: string;
|
|
27
|
+
methodId: string;
|
|
28
|
+
stageId: string;
|
|
29
|
+
snapshot: SourceSnapshot;
|
|
30
|
+
runId?: string | null;
|
|
31
|
+
generatedAt?: string;
|
|
32
|
+
}): StageInputs;
|
|
33
|
+
export declare function writeCompiledSourceRuntime(options: {
|
|
34
|
+
compiledPath: string;
|
|
35
|
+
methodId: string;
|
|
36
|
+
stageIds: string[];
|
|
37
|
+
sourcePath?: string;
|
|
38
|
+
runId?: string | null;
|
|
39
|
+
}): {
|
|
40
|
+
sourceFiles: SourceFiles;
|
|
41
|
+
snapshot: SourceSnapshot;
|
|
42
|
+
stageInputs: StageInputs[];
|
|
43
|
+
};
|
|
44
|
+
export declare function loadCompiledSourceFiles(compiledPath: string): SourceFiles | null;
|
|
45
|
+
export declare function loadCompiledSourceSnapshot(compiledPath: string): SourceSnapshot | null;
|
|
46
|
+
export declare function loadCompiledStageInputs(compiledPath: string, stageId: string): StageInputs | null;
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
import { createHash } from "node:crypto";
|
|
2
|
+
import { existsSync, mkdirSync, writeFileSync } from "node:fs";
|
|
3
|
+
import { dirname, resolve } from "node:path";
|
|
4
|
+
import { SourceFilesSchema, SourceSnapshotSchema, StageInputsSchema, } from "../contracts/lib/schema.js";
|
|
5
|
+
import { readJsonFileWithSchema } from "../shared/parse.js";
|
|
6
|
+
import { discoverSourceFiles } from "./discovery.js";
|
|
7
|
+
import { compiledRuntimeSourceFilesPath, compiledRuntimeSourceSnapshotPath, compiledRuntimeStageInputsPath, } from "./compiled-paths.js";
|
|
8
|
+
import { resolveSourceInputPath } from "../project-model/interf-detect.js";
|
|
9
|
+
function shortHash(value, length = 16) {
|
|
10
|
+
return createHash("sha256")
|
|
11
|
+
.update(value)
|
|
12
|
+
.digest("hex")
|
|
13
|
+
.slice(0, length);
|
|
14
|
+
}
|
|
15
|
+
function normalizeRelativePath(path) {
|
|
16
|
+
return path.replaceAll("\\", "/");
|
|
17
|
+
}
|
|
18
|
+
function buildSource(sourcePath) {
|
|
19
|
+
const locator = resolve(sourcePath);
|
|
20
|
+
return {
|
|
21
|
+
id: `src-${shortHash(locator, 12)}`,
|
|
22
|
+
kind: "local-folder",
|
|
23
|
+
locator,
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
function buildSourceFile(source, sourcePath, relativePath) {
|
|
27
|
+
const normalizedPath = normalizeRelativePath(relativePath);
|
|
28
|
+
return {
|
|
29
|
+
id: `file-${shortHash(`${source.id}\0${normalizedPath}`)}`,
|
|
30
|
+
path: normalizedPath,
|
|
31
|
+
locator: resolve(sourcePath, relativePath),
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
function buildSnapshotId(options) {
|
|
35
|
+
const fingerprint = {
|
|
36
|
+
source: options.sourceFiles.source,
|
|
37
|
+
files: options.sourceFiles.files.map((file) => [file.id, file.path, file.locator]),
|
|
38
|
+
generated_at: options.generatedAt,
|
|
39
|
+
run_id: options.runId ?? null,
|
|
40
|
+
};
|
|
41
|
+
return `snap-${shortHash(JSON.stringify(fingerprint))}`;
|
|
42
|
+
}
|
|
43
|
+
function writeJson(filePath, value) {
|
|
44
|
+
mkdirSync(dirname(filePath), { recursive: true });
|
|
45
|
+
writeFileSync(filePath, `${JSON.stringify(value, null, 2)}\n`);
|
|
46
|
+
}
|
|
47
|
+
export function buildCompiledSourceFiles(compiledPath, sourcePath = resolveSourceInputPath(compiledPath), generatedAt = new Date().toISOString()) {
|
|
48
|
+
const discovery = discoverSourceFiles(sourcePath, compiledPath);
|
|
49
|
+
const source = buildSource(sourcePath);
|
|
50
|
+
const files = discovery.sourceFiles.map((relativePath) => buildSourceFile(source, sourcePath, relativePath));
|
|
51
|
+
return {
|
|
52
|
+
kind: "interf-source-files",
|
|
53
|
+
version: 1,
|
|
54
|
+
generated_at: generatedAt,
|
|
55
|
+
source,
|
|
56
|
+
source_total: files.length,
|
|
57
|
+
files,
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
export function writeCompiledSourceFiles(compiledPath, sourcePath = resolveSourceInputPath(compiledPath), generatedAt = new Date().toISOString()) {
|
|
61
|
+
const sourceFiles = buildCompiledSourceFiles(compiledPath, sourcePath, generatedAt);
|
|
62
|
+
const parsed = SourceFilesSchema.parse(sourceFiles);
|
|
63
|
+
writeJson(compiledRuntimeSourceFilesPath(compiledPath), parsed);
|
|
64
|
+
return parsed;
|
|
65
|
+
}
|
|
66
|
+
export function buildCompiledSourceSnapshot(options) {
|
|
67
|
+
const generatedAt = options.generatedAt ?? new Date().toISOString();
|
|
68
|
+
const sourceFiles = options.sourceFiles
|
|
69
|
+
?? buildCompiledSourceFiles(options.compiledPath, options.sourcePath ?? resolveSourceInputPath(options.compiledPath), generatedAt);
|
|
70
|
+
return {
|
|
71
|
+
kind: "interf-source-snapshot",
|
|
72
|
+
version: 1,
|
|
73
|
+
snapshot_id: buildSnapshotId({
|
|
74
|
+
sourceFiles,
|
|
75
|
+
generatedAt,
|
|
76
|
+
runId: options.runId ?? null,
|
|
77
|
+
}),
|
|
78
|
+
generated_at: generatedAt,
|
|
79
|
+
run_id: options.runId ?? null,
|
|
80
|
+
source: sourceFiles.source,
|
|
81
|
+
source_total: sourceFiles.source_total,
|
|
82
|
+
files: sourceFiles.files,
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
export function writeCompiledSourceSnapshot(options) {
|
|
86
|
+
const snapshot = SourceSnapshotSchema.parse(buildCompiledSourceSnapshot(options));
|
|
87
|
+
writeJson(compiledRuntimeSourceSnapshotPath(options.compiledPath), snapshot);
|
|
88
|
+
return snapshot;
|
|
89
|
+
}
|
|
90
|
+
export function buildCompiledStageInputs(options) {
|
|
91
|
+
const generatedAt = options.generatedAt ?? new Date().toISOString();
|
|
92
|
+
return {
|
|
93
|
+
kind: "interf-stage-inputs",
|
|
94
|
+
version: 1,
|
|
95
|
+
generated_at: generatedAt,
|
|
96
|
+
run_id: options.runId ?? options.snapshot.run_id ?? null,
|
|
97
|
+
method: options.methodId,
|
|
98
|
+
stage: options.stageId,
|
|
99
|
+
source_snapshot_id: options.snapshot.snapshot_id,
|
|
100
|
+
input_total: options.snapshot.files.length,
|
|
101
|
+
inputs: options.snapshot.files.map((file) => ({
|
|
102
|
+
source_file_id: file.id,
|
|
103
|
+
path: file.path,
|
|
104
|
+
locator: file.locator,
|
|
105
|
+
})),
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
export function writeCompiledStageInputs(options) {
|
|
109
|
+
const stageInputs = StageInputsSchema.parse(buildCompiledStageInputs(options));
|
|
110
|
+
writeJson(compiledRuntimeStageInputsPath(options.compiledPath, options.stageId), stageInputs);
|
|
111
|
+
return stageInputs;
|
|
112
|
+
}
|
|
113
|
+
export function writeCompiledSourceRuntime(options) {
|
|
114
|
+
const generatedAt = new Date().toISOString();
|
|
115
|
+
const sourceFiles = writeCompiledSourceFiles(options.compiledPath, options.sourcePath ?? resolveSourceInputPath(options.compiledPath), generatedAt);
|
|
116
|
+
const snapshot = writeCompiledSourceSnapshot({
|
|
117
|
+
compiledPath: options.compiledPath,
|
|
118
|
+
sourceFiles,
|
|
119
|
+
runId: options.runId ?? null,
|
|
120
|
+
generatedAt,
|
|
121
|
+
});
|
|
122
|
+
const stageInputs = options.stageIds.map((stageId) => writeCompiledStageInputs({
|
|
123
|
+
compiledPath: options.compiledPath,
|
|
124
|
+
methodId: options.methodId,
|
|
125
|
+
stageId,
|
|
126
|
+
snapshot,
|
|
127
|
+
runId: options.runId ?? null,
|
|
128
|
+
generatedAt,
|
|
129
|
+
}));
|
|
130
|
+
return { sourceFiles, snapshot, stageInputs };
|
|
131
|
+
}
|
|
132
|
+
export function loadCompiledSourceFiles(compiledPath) {
|
|
133
|
+
const filePath = compiledRuntimeSourceFilesPath(compiledPath);
|
|
134
|
+
if (!existsSync(filePath))
|
|
135
|
+
return null;
|
|
136
|
+
return readJsonFileWithSchema(filePath, "compiled source files", SourceFilesSchema);
|
|
137
|
+
}
|
|
138
|
+
export function loadCompiledSourceSnapshot(compiledPath) {
|
|
139
|
+
const filePath = compiledRuntimeSourceSnapshotPath(compiledPath);
|
|
140
|
+
if (!existsSync(filePath))
|
|
141
|
+
return null;
|
|
142
|
+
return readJsonFileWithSchema(filePath, "compiled source snapshot", SourceSnapshotSchema);
|
|
143
|
+
}
|
|
144
|
+
export function loadCompiledStageInputs(compiledPath, stageId) {
|
|
145
|
+
const filePath = compiledRuntimeStageInputsPath(compiledPath, stageId);
|
|
146
|
+
if (!existsSync(filePath))
|
|
147
|
+
return null;
|
|
148
|
+
return readJsonFileWithSchema(filePath, "compiled stage inputs", StageInputsSchema);
|
|
149
|
+
}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { type CompiledHealth, type
|
|
1
|
+
import { type CompiledHealth, type CompiledViewSpec, type SourceFiles, type SourceSnapshot } from "./lib/schema.js";
|
|
2
2
|
export declare function refreshCompiledArtifacts(dirPath: string, options?: {
|
|
3
3
|
ensureViewSpec?: boolean;
|
|
4
4
|
}): {
|
|
5
5
|
health: CompiledHealth;
|
|
6
6
|
viewSpec?: CompiledViewSpec;
|
|
7
|
-
|
|
7
|
+
sourceFiles: SourceFiles;
|
|
8
|
+
sourceSnapshot: SourceSnapshot;
|
|
8
9
|
};
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import { saveCompiledHealth, } from "./state-io.js";
|
|
2
2
|
import { computeCompiledHealth, } from "./state-health.js";
|
|
3
|
-
import {
|
|
3
|
+
import { ensureCompiledSourceFiles, ensureCompiledSourceSnapshot, ensureCompiledViewSpec, } from "./state-view.js";
|
|
4
4
|
export function refreshCompiledArtifacts(dirPath, options) {
|
|
5
5
|
const health = computeCompiledHealth(dirPath);
|
|
6
6
|
saveCompiledHealth(dirPath, health);
|
|
7
|
-
const
|
|
7
|
+
const sourceFiles = ensureCompiledSourceFiles(dirPath);
|
|
8
|
+
const sourceSnapshot = ensureCompiledSourceSnapshot(dirPath, sourceFiles);
|
|
8
9
|
let viewSpec;
|
|
9
10
|
if (options?.ensureViewSpec) {
|
|
10
11
|
viewSpec = ensureCompiledViewSpec(dirPath);
|
|
11
12
|
}
|
|
12
|
-
return { health, viewSpec,
|
|
13
|
+
return { health, viewSpec, sourceFiles, sourceSnapshot };
|
|
13
14
|
}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { type CompiledHealth, type
|
|
1
|
+
import { type CompiledHealth, type CompiledState, type CompiledViewSpec, type SourceFiles, type SourceSnapshot } from "./lib/schema.js";
|
|
2
2
|
export declare function loadState<T>(dirPath: string): T | null;
|
|
3
3
|
export declare function saveState<T>(dirPath: string, state: T): void;
|
|
4
4
|
export declare function loadCompiledHealth(dirPath: string): CompiledHealth | null;
|
|
5
5
|
export declare function saveCompiledHealth(dirPath: string, health: CompiledHealth): void;
|
|
6
6
|
export declare function loadCompiledViewSpec(dirPath: string): CompiledViewSpec | null;
|
|
7
7
|
export declare function saveCompiledViewSpec(dirPath: string, viewSpec: CompiledViewSpec): void;
|
|
8
|
-
export declare function
|
|
8
|
+
export declare function loadCompiledSourceFiles(dirPath: string): SourceFiles | null;
|
|
9
|
+
export declare function loadCompiledSourceSnapshot(dirPath: string): SourceSnapshot | null;
|
|
9
10
|
export declare function saveEmptyCompiledInventory(dirPath: string): void;
|
|
10
11
|
export declare function initCompiledState(): CompiledState;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { existsSync, mkdirSync, readFileSync, writeFileSync, } from "node:fs";
|
|
2
2
|
import { warnInterf } from "../shared/logger.js";
|
|
3
3
|
import { readJsonFileUnchecked, readJsonFileWithSchema } from "../shared/parse.js";
|
|
4
|
-
import { CompiledHealthSchema,
|
|
4
|
+
import { CompiledHealthSchema, CompiledStateSchema, CompiledViewSpecSchema, SourceFilesSchema, SourceSnapshotSchema, } from "./lib/schema.js";
|
|
5
5
|
import { emptyCompiledInventory, } from "./runtime-inventory.js";
|
|
6
|
-
import { healthPath,
|
|
6
|
+
import { healthPath, sourceFilesPath, sourceSnapshotPath, statePath, viewSpecPath, } from "./state-paths.js";
|
|
7
7
|
import { compiledRuntimeInventoryPath, compiledRuntimeRoot, } from "./compiled-paths.js";
|
|
8
8
|
export function loadState(dirPath) {
|
|
9
9
|
const path = statePath(dirPath);
|
|
@@ -43,11 +43,17 @@ export function saveCompiledViewSpec(dirPath, viewSpec) {
|
|
|
43
43
|
mkdirSync(compiledRuntimeRoot(dirPath), { recursive: true });
|
|
44
44
|
writeFileSync(viewSpecPath(dirPath), JSON.stringify(viewSpec, null, 2) + "\n");
|
|
45
45
|
}
|
|
46
|
-
export function
|
|
47
|
-
const path =
|
|
46
|
+
export function loadCompiledSourceFiles(dirPath) {
|
|
47
|
+
const path = sourceFilesPath(dirPath);
|
|
48
48
|
if (!existsSync(path))
|
|
49
49
|
return null;
|
|
50
|
-
return readJsonFileWithSchema(path, "compiled
|
|
50
|
+
return readJsonFileWithSchema(path, "compiled source files", SourceFilesSchema);
|
|
51
|
+
}
|
|
52
|
+
export function loadCompiledSourceSnapshot(dirPath) {
|
|
53
|
+
const path = sourceSnapshotPath(dirPath);
|
|
54
|
+
if (!existsSync(path))
|
|
55
|
+
return null;
|
|
56
|
+
return readJsonFileWithSchema(path, "compiled source snapshot", SourceSnapshotSchema);
|
|
51
57
|
}
|
|
52
58
|
export function saveEmptyCompiledInventory(dirPath) {
|
|
53
59
|
mkdirSync(compiledRuntimeRoot(dirPath), { recursive: true });
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export declare function statePath(dirPath: string): string;
|
|
2
2
|
export declare function healthPath(dirPath: string): string;
|
|
3
3
|
export declare function viewSpecPath(dirPath: string): string;
|
|
4
|
-
export declare function
|
|
4
|
+
export declare function sourceFilesPath(dirPath: string): string;
|
|
5
|
+
export declare function sourceSnapshotPath(dirPath: string): string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { compiledRuntimeHealthPath, compiledRuntimeSourceFilesPath, compiledRuntimeSourceSnapshotPath, compiledRuntimeStatePath, compiledRuntimeViewSpecPath, } from "./compiled-paths.js";
|
|
2
2
|
export function statePath(dirPath) {
|
|
3
3
|
return compiledRuntimeStatePath(dirPath);
|
|
4
4
|
}
|
|
@@ -8,6 +8,9 @@ export function healthPath(dirPath) {
|
|
|
8
8
|
export function viewSpecPath(dirPath) {
|
|
9
9
|
return compiledRuntimeViewSpecPath(dirPath);
|
|
10
10
|
}
|
|
11
|
-
export function
|
|
12
|
-
return
|
|
11
|
+
export function sourceFilesPath(dirPath) {
|
|
12
|
+
return compiledRuntimeSourceFilesPath(dirPath);
|
|
13
|
+
}
|
|
14
|
+
export function sourceSnapshotPath(dirPath) {
|
|
15
|
+
return compiledRuntimeSourceSnapshotPath(dirPath);
|
|
13
16
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type CompiledViewSpec, type SourceFiles, type SourceSnapshot } from "./lib/schema.js";
|
|
2
2
|
export declare function ensureCompiledViewSpec(dirPath: string): CompiledViewSpec;
|
|
3
|
-
export declare function
|
|
3
|
+
export declare function ensureCompiledSourceFiles(dirPath: string): SourceFiles;
|
|
4
|
+
export declare function ensureCompiledSourceSnapshot(dirPath: string, sourceFiles?: SourceFiles): SourceSnapshot;
|
|
4
5
|
export declare function normalizeCompiledViewSpec(existing: CompiledViewSpec, defaults?: CompiledViewSpec): CompiledViewSpec;
|