@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,11 +1,15 @@
|
|
|
1
1
|
export * as schema from "./lib/schema.js";
|
|
2
2
|
export * as actionValues from "./action-values.js";
|
|
3
|
+
export * as actionDefinitions from "./action-definitions.js";
|
|
3
4
|
export * as routes from "./routes.js";
|
|
4
5
|
export * as client from "./client.js";
|
|
5
6
|
export * as runtime from "./runtime.js";
|
|
6
7
|
export * as server from "./server.js";
|
|
7
|
-
export { CompileRunCreateRequestSchema, CompileRunResourceSchema, CompileRunSummarySchema, LocalServiceDiscoverySchema, PortableContextMappingSchema,
|
|
8
|
-
export { LOCAL_SERVICE_DEFAULT_HOST, LOCAL_SERVICE_DEFAULT_PORT,
|
|
9
|
-
export {
|
|
8
|
+
export { CompileRunCreateRequestSchema, CompileRunResourceSchema, CompileRunSummarySchema, LocalServiceDiscoverySchema, PortableContextMappingSchema, PreparationRunLinkageSchema, PreparationResourceSchema, MethodResourceSchema, LocalJobAgentSchema, LocalJobEventAppendRequestSchema, LocalJobEventSchema, LocalJobEventTypeSchema, LocalJobRunCreateRequestSchema, LocalJobRunResourceSchema, LocalJobStatusSchema, LocalRunHandlerResultSchema, LocalJobStepSchema, LocalJobTypeSchema, LocalServiceConfigSchema, LocalServiceErrorSchema, LocalServiceHealthSchema, PortableContextResourceSchema, ReadinessResourceSchema, SourceFileResourceSchema, ReadinessCheckDraftCreateRequestSchema, ReadinessCheckDraftResultSchema, TestRunCreateRequestSchema, TestRunResourceSchema, TestRunStatusSchema, RunObservabilityResourceSchema, RunObservabilityListResponseSchema, LocalExecutorStatusSchema, ActionClientOriginSchema, ActionProposalApprovalRequestSchema, ActionProposalApprovalSchema, ActionProposalCreateRequestSchema, ActionProposalListResponseSchema, ActionProposalPlanSchema, ActionProposalPlanActionTypeSchema, ActionProposalResourceSchema, ActionProposalStatusSchema, ActionProposalTypeSchema, ResetRequestSchema, ResetResultSchema, MethodAuthoringCreateRequestSchema, MethodAuthoringResultSchema, PreparationListResponseSchema, MethodListResponseSchema, PortableContextListResponseSchema, SourceFileListResponseSchema, OpenPathRequestSchema, OpenPathResponseSchema, } from "./lib/schema.js";
|
|
9
|
+
export { LOCAL_SERVICE_DEFAULT_HOST, LOCAL_SERVICE_DEFAULT_PORT, LOCAL_SERVICE_ROUTES, buildLocalServiceUrl, } from "./routes.js";
|
|
10
|
+
export { ServiceRegistrySchema, ServiceRegistryEntrySchema, ServiceRegistryWorkspaceSchema, } from "./lib/schema.js";
|
|
11
|
+
export { readServiceRegistry, registerServiceLocally, unregisterService, writeServiceRegistry, serviceRegistryPath, } from "./service-registry.js";
|
|
12
|
+
export { approveActionProposalInLocalService, cancelLocalCompileRun, configuredLocalServiceUrl, resolveLocalServiceAuthToken, createActionProposalInLocalService, decideActionProposalInLocalService, findLocalService, getLocalJobRun, getLocalCompileRun, getLocalServiceHealth, getLocalTestRun, submitCompileRunToLocalService, submitReadinessCheckDraftToLocalService, submitResetToLocalService, submitTestRunToLocalService, submitMethodAuthoringRunToLocalService, waitForLocalJobRun, waitForLocalCompileRun, waitForLocalTestRun, } from "./client.js";
|
|
10
13
|
export { LocalServiceRuntime, createLocalServiceRuntime, } from "./runtime.js";
|
|
11
|
-
export { createLocalServiceServer, startLocalService, } from "./server.js";
|
|
14
|
+
export { createLocalServiceServer, createLocalServiceAuthToken, startLocalService, } from "./server.js";
|
|
15
|
+
export { createNativeLocalServiceRunHandlers, } from "./native-run-handlers.js";
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Source of truth for every Interf path on disk in 0.13.
|
|
3
|
+
*
|
|
4
|
+
* The instance is a black box that owns its preparation state. Storage lives
|
|
5
|
+
* under `~/.interf/`. The CLI never opens these files directly — it asks the
|
|
6
|
+
* API where things are and reads from the locator the API returns.
|
|
7
|
+
*
|
|
8
|
+
* Layout:
|
|
9
|
+
* ~/.interf/
|
|
10
|
+
* connection.json ← single CLI connection record
|
|
11
|
+
* services.json ← internal stop-lookup registry
|
|
12
|
+
* methods/<id>/ ← user-installed methods (cross-preparation)
|
|
13
|
+
* preparations/<prep-id>/ ← per-preparation state owned by the engine
|
|
14
|
+
* config.json ← preparation config (id, source, method, …)
|
|
15
|
+
* portable-context/ ← compiled portable context output
|
|
16
|
+
* .interf/ ← per-preparation runtime/method/tests state
|
|
17
|
+
* runs/ ← persisted run records
|
|
18
|
+
* jobs/ ← service job runs
|
|
19
|
+
* proposals/ ← chat/wizard action proposals
|
|
20
|
+
* tests/ ← saved readiness check specs
|
|
21
|
+
*/
|
|
22
|
+
export type InterfHomeRoot = string & {
|
|
23
|
+
readonly __brand: "InterfHomeRoot";
|
|
24
|
+
};
|
|
25
|
+
export type PreparationDataDir = string & {
|
|
26
|
+
readonly __brand: "PreparationDataDir";
|
|
27
|
+
};
|
|
28
|
+
export type PortableContextPath = string & {
|
|
29
|
+
readonly __brand: "PortableContextPath";
|
|
30
|
+
};
|
|
31
|
+
export type SourceFolderPath = string & {
|
|
32
|
+
readonly __brand: "SourceFolderPath";
|
|
33
|
+
};
|
|
34
|
+
export declare const INTERF_USER_HOME_ENV = "INTERF_USER_HOME";
|
|
35
|
+
export declare const INTERF_HOME_DIR = ".interf";
|
|
36
|
+
export declare const PREPARATIONS_DIR = "preparations";
|
|
37
|
+
export declare const METHODS_DIR = "methods";
|
|
38
|
+
export declare const SERVICE_REGISTRY_FILENAME = "services.json";
|
|
39
|
+
export declare const CONNECTION_CONFIG_FILENAME = "connection.json";
|
|
40
|
+
export declare const PREPARATION_CONFIG_FILENAME = "config.json";
|
|
41
|
+
export declare const PREPARATION_PORTABLE_CONTEXT_DIR = "portable-context";
|
|
42
|
+
export declare const PREPARATION_RUNS_DIR = "runs";
|
|
43
|
+
export declare const PREPARATION_JOBS_DIR = "jobs";
|
|
44
|
+
export declare const PREPARATION_PROPOSALS_DIR = "proposals";
|
|
45
|
+
export declare const PREPARATION_TESTS_DIR = "tests";
|
|
46
|
+
export declare const PREPARATION_METHOD_DIR = "method";
|
|
47
|
+
export declare const PORTABLE_CONTEXT_STATE_DIR = ".interf";
|
|
48
|
+
export declare const PORTABLE_CONTEXT_RUNTIME_DIR = "runtime";
|
|
49
|
+
export declare const PORTABLE_CONTEXT_METHOD_DIR = "method";
|
|
50
|
+
export declare const PORTABLE_CONTEXT_TESTS_DIR = "tests";
|
|
51
|
+
export declare function asPreparationDataDir(path: string): PreparationDataDir;
|
|
52
|
+
export declare function asPortableContextPath(path: string): PortableContextPath;
|
|
53
|
+
export declare function asSourceFolderPath(path: string): SourceFolderPath;
|
|
54
|
+
/** `~/.interf/` — overridable via INTERF_USER_HOME for tests. */
|
|
55
|
+
export declare function interfHomeRoot(): InterfHomeRoot;
|
|
56
|
+
/** `~/.interf/connection.json` — single CLI connection record. */
|
|
57
|
+
export declare function connectionConfigPath(): string;
|
|
58
|
+
/** `~/.interf/services.json` — internal `interf web stop` lookup registry. */
|
|
59
|
+
export declare function serviceRegistryPath(): string;
|
|
60
|
+
/** `~/.interf/methods/` — user-installed methods (cross-preparation). */
|
|
61
|
+
export declare function userMethodsRoot(): string;
|
|
62
|
+
/** `~/.interf/methods/<id>/` — a specific user-library method package. */
|
|
63
|
+
export declare function userMethodPackagePath(methodId: string): string;
|
|
64
|
+
/** `~/.interf/preparations/` — root for all preparation state. */
|
|
65
|
+
export declare function preparationsRoot(): string;
|
|
66
|
+
/** `~/.interf/preparations/<prep-id>/` — one preparation's state dir. */
|
|
67
|
+
export declare function preparationDataDir(prepId: string): PreparationDataDir;
|
|
68
|
+
/** `<prep-data>/config.json` — preparation config source of truth. */
|
|
69
|
+
export declare function preparationConfigPath(prepId: string): string;
|
|
70
|
+
/** `<prep-data>/portable-context/` — compiled portable context output. */
|
|
71
|
+
export declare function preparationPortableContextDir(prepId: string): PortableContextPath;
|
|
72
|
+
/** `<prep-data>/runs/` — compile/test run records. */
|
|
73
|
+
export declare function preparationRunsRoot(prepId: string): string;
|
|
74
|
+
/** `<prep-data>/jobs/` — service job runs (drafts, improvements, etc). */
|
|
75
|
+
export declare function preparationJobsRoot(prepId: string): string;
|
|
76
|
+
/** `<prep-data>/proposals/` — action proposals scoped to this preparation. */
|
|
77
|
+
export declare function preparationProposalsRoot(prepId: string): string;
|
|
78
|
+
/** `<prep-data>/tests/` — saved readiness check specs. */
|
|
79
|
+
export declare function preparationTestsRoot(prepId: string): string;
|
|
80
|
+
/** `<prep-data>/method/` — preparation-draft method package (if any). */
|
|
81
|
+
export declare function preparationMethodDraftPath(prepId: string): string;
|
|
82
|
+
/** `<portable-context>/.interf/`. */
|
|
83
|
+
export declare function portableContextStateRoot(portableContext: PortableContextPath): string;
|
|
84
|
+
/** `<portable-context>/.interf/method/`. */
|
|
85
|
+
export declare function portableContextMethodPath(portableContext: PortableContextPath): string;
|
|
86
|
+
/** `<portable-context>/.interf/runtime/`. */
|
|
87
|
+
export declare function portableContextRuntimeRoot(portableContext: PortableContextPath): string;
|
|
88
|
+
/** `<portable-context>/.interf/tests/`. */
|
|
89
|
+
export declare function portableContextTestsRoot(portableContext: PortableContextPath): string;
|
|
90
|
+
export type PreparationTestTargetLabel = "source-files" | "compiled";
|
|
91
|
+
/** `<prep-data>/portable-context/.interf/tests/<target>/runs/`. */
|
|
92
|
+
export declare function preparationTestRunsRoot(prepId: string, target: PreparationTestTargetLabel): string;
|
|
93
|
+
/** `<prep-data>/portable-context/.interf/tests/latest.json`. */
|
|
94
|
+
export declare function preparationLatestReadinessRunPath(prepId: string): string;
|
|
95
|
+
/** `<prep-data>/portable-context/.interf/tests/latest.md`. */
|
|
96
|
+
export declare function preparationLatestReadinessSummaryPath(prepId: string): string;
|
|
97
|
+
/** Normalize a free-form string into a stable kebab-cased id (≤80 chars). */
|
|
98
|
+
export declare function normalizePreparationTestRunId(input: string): string;
|
|
99
|
+
/** `<prep-data>/portable-context/.interf/tests/<target>/runs/<timestamp>-<run-id>[-<suffix>].json`. */
|
|
100
|
+
export declare function preparationTestRunPath(prepId: string, target: PreparationTestTargetLabel, generatedAt: string, runId: string, runSuffix?: string | null): string;
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Source of truth for every Interf path on disk in 0.13.
|
|
3
|
+
*
|
|
4
|
+
* The instance is a black box that owns its preparation state. Storage lives
|
|
5
|
+
* under `~/.interf/`. The CLI never opens these files directly — it asks the
|
|
6
|
+
* API where things are and reads from the locator the API returns.
|
|
7
|
+
*
|
|
8
|
+
* Layout:
|
|
9
|
+
* ~/.interf/
|
|
10
|
+
* connection.json ← single CLI connection record
|
|
11
|
+
* services.json ← internal stop-lookup registry
|
|
12
|
+
* methods/<id>/ ← user-installed methods (cross-preparation)
|
|
13
|
+
* preparations/<prep-id>/ ← per-preparation state owned by the engine
|
|
14
|
+
* config.json ← preparation config (id, source, method, …)
|
|
15
|
+
* portable-context/ ← compiled portable context output
|
|
16
|
+
* .interf/ ← per-preparation runtime/method/tests state
|
|
17
|
+
* runs/ ← persisted run records
|
|
18
|
+
* jobs/ ← service job runs
|
|
19
|
+
* proposals/ ← chat/wizard action proposals
|
|
20
|
+
* tests/ ← saved readiness check specs
|
|
21
|
+
*/
|
|
22
|
+
import { homedir } from "node:os";
|
|
23
|
+
import { join } from "node:path";
|
|
24
|
+
// ───────────────────────────────────────────────────────────────────────────
|
|
25
|
+
// Constants
|
|
26
|
+
// ───────────────────────────────────────────────────────────────────────────
|
|
27
|
+
export const INTERF_USER_HOME_ENV = "INTERF_USER_HOME";
|
|
28
|
+
export const INTERF_HOME_DIR = ".interf";
|
|
29
|
+
export const PREPARATIONS_DIR = "preparations";
|
|
30
|
+
export const METHODS_DIR = "methods";
|
|
31
|
+
export const SERVICE_REGISTRY_FILENAME = "services.json";
|
|
32
|
+
export const CONNECTION_CONFIG_FILENAME = "connection.json";
|
|
33
|
+
export const PREPARATION_CONFIG_FILENAME = "config.json";
|
|
34
|
+
export const PREPARATION_PORTABLE_CONTEXT_DIR = "portable-context";
|
|
35
|
+
export const PREPARATION_RUNS_DIR = "runs";
|
|
36
|
+
export const PREPARATION_JOBS_DIR = "jobs";
|
|
37
|
+
export const PREPARATION_PROPOSALS_DIR = "proposals";
|
|
38
|
+
export const PREPARATION_TESTS_DIR = "tests";
|
|
39
|
+
export const PREPARATION_METHOD_DIR = "method";
|
|
40
|
+
export const PORTABLE_CONTEXT_STATE_DIR = ".interf";
|
|
41
|
+
export const PORTABLE_CONTEXT_RUNTIME_DIR = "runtime";
|
|
42
|
+
export const PORTABLE_CONTEXT_METHOD_DIR = "method";
|
|
43
|
+
export const PORTABLE_CONTEXT_TESTS_DIR = "tests";
|
|
44
|
+
// ───────────────────────────────────────────────────────────────────────────
|
|
45
|
+
// Brand constructors
|
|
46
|
+
// ───────────────────────────────────────────────────────────────────────────
|
|
47
|
+
export function asPreparationDataDir(path) {
|
|
48
|
+
return path;
|
|
49
|
+
}
|
|
50
|
+
export function asPortableContextPath(path) {
|
|
51
|
+
return path;
|
|
52
|
+
}
|
|
53
|
+
export function asSourceFolderPath(path) {
|
|
54
|
+
return path;
|
|
55
|
+
}
|
|
56
|
+
// ───────────────────────────────────────────────────────────────────────────
|
|
57
|
+
// Interf Home (~/.interf/)
|
|
58
|
+
// ───────────────────────────────────────────────────────────────────────────
|
|
59
|
+
/** `~/.interf/` — overridable via INTERF_USER_HOME for tests. */
|
|
60
|
+
export function interfHomeRoot() {
|
|
61
|
+
const override = process.env[INTERF_USER_HOME_ENV]?.trim();
|
|
62
|
+
if (override && override.length > 0)
|
|
63
|
+
return override;
|
|
64
|
+
return join(homedir(), INTERF_HOME_DIR);
|
|
65
|
+
}
|
|
66
|
+
/** `~/.interf/connection.json` — single CLI connection record. */
|
|
67
|
+
export function connectionConfigPath() {
|
|
68
|
+
return join(interfHomeRoot(), CONNECTION_CONFIG_FILENAME);
|
|
69
|
+
}
|
|
70
|
+
/** `~/.interf/services.json` — internal `interf web stop` lookup registry. */
|
|
71
|
+
export function serviceRegistryPath() {
|
|
72
|
+
return join(interfHomeRoot(), SERVICE_REGISTRY_FILENAME);
|
|
73
|
+
}
|
|
74
|
+
/** `~/.interf/methods/` — user-installed methods (cross-preparation). */
|
|
75
|
+
export function userMethodsRoot() {
|
|
76
|
+
return join(interfHomeRoot(), METHODS_DIR);
|
|
77
|
+
}
|
|
78
|
+
/** `~/.interf/methods/<id>/` — a specific user-library method package. */
|
|
79
|
+
export function userMethodPackagePath(methodId) {
|
|
80
|
+
return join(userMethodsRoot(), methodId);
|
|
81
|
+
}
|
|
82
|
+
// ───────────────────────────────────────────────────────────────────────────
|
|
83
|
+
// Preparation data dirs
|
|
84
|
+
// ───────────────────────────────────────────────────────────────────────────
|
|
85
|
+
/** `~/.interf/preparations/` — root for all preparation state. */
|
|
86
|
+
export function preparationsRoot() {
|
|
87
|
+
return join(interfHomeRoot(), PREPARATIONS_DIR);
|
|
88
|
+
}
|
|
89
|
+
/** `~/.interf/preparations/<prep-id>/` — one preparation's state dir. */
|
|
90
|
+
export function preparationDataDir(prepId) {
|
|
91
|
+
return asPreparationDataDir(join(preparationsRoot(), prepId));
|
|
92
|
+
}
|
|
93
|
+
/** `<prep-data>/config.json` — preparation config source of truth. */
|
|
94
|
+
export function preparationConfigPath(prepId) {
|
|
95
|
+
return join(preparationDataDir(prepId), PREPARATION_CONFIG_FILENAME);
|
|
96
|
+
}
|
|
97
|
+
/** `<prep-data>/portable-context/` — compiled portable context output. */
|
|
98
|
+
export function preparationPortableContextDir(prepId) {
|
|
99
|
+
return asPortableContextPath(join(preparationDataDir(prepId), PREPARATION_PORTABLE_CONTEXT_DIR));
|
|
100
|
+
}
|
|
101
|
+
/** `<prep-data>/runs/` — compile/test run records. */
|
|
102
|
+
export function preparationRunsRoot(prepId) {
|
|
103
|
+
return join(preparationDataDir(prepId), PREPARATION_RUNS_DIR);
|
|
104
|
+
}
|
|
105
|
+
/** `<prep-data>/jobs/` — service job runs (drafts, improvements, etc). */
|
|
106
|
+
export function preparationJobsRoot(prepId) {
|
|
107
|
+
return join(preparationDataDir(prepId), PREPARATION_JOBS_DIR);
|
|
108
|
+
}
|
|
109
|
+
/** `<prep-data>/proposals/` — action proposals scoped to this preparation. */
|
|
110
|
+
export function preparationProposalsRoot(prepId) {
|
|
111
|
+
return join(preparationDataDir(prepId), PREPARATION_PROPOSALS_DIR);
|
|
112
|
+
}
|
|
113
|
+
/** `<prep-data>/tests/` — saved readiness check specs. */
|
|
114
|
+
export function preparationTestsRoot(prepId) {
|
|
115
|
+
return join(preparationDataDir(prepId), PREPARATION_TESTS_DIR);
|
|
116
|
+
}
|
|
117
|
+
/** `<prep-data>/method/` — preparation-draft method package (if any). */
|
|
118
|
+
export function preparationMethodDraftPath(prepId) {
|
|
119
|
+
return join(preparationDataDir(prepId), PREPARATION_METHOD_DIR);
|
|
120
|
+
}
|
|
121
|
+
// ───────────────────────────────────────────────────────────────────────────
|
|
122
|
+
// Portable context state (per-preparation, lives under preparation data dir)
|
|
123
|
+
// ───────────────────────────────────────────────────────────────────────────
|
|
124
|
+
/** `<portable-context>/.interf/`. */
|
|
125
|
+
export function portableContextStateRoot(portableContext) {
|
|
126
|
+
return join(portableContext, PORTABLE_CONTEXT_STATE_DIR);
|
|
127
|
+
}
|
|
128
|
+
/** `<portable-context>/.interf/method/`. */
|
|
129
|
+
export function portableContextMethodPath(portableContext) {
|
|
130
|
+
return join(portableContextStateRoot(portableContext), PORTABLE_CONTEXT_METHOD_DIR);
|
|
131
|
+
}
|
|
132
|
+
/** `<portable-context>/.interf/runtime/`. */
|
|
133
|
+
export function portableContextRuntimeRoot(portableContext) {
|
|
134
|
+
return join(portableContextStateRoot(portableContext), PORTABLE_CONTEXT_RUNTIME_DIR);
|
|
135
|
+
}
|
|
136
|
+
/** `<portable-context>/.interf/tests/`. */
|
|
137
|
+
export function portableContextTestsRoot(portableContext) {
|
|
138
|
+
return join(portableContextStateRoot(portableContext), PORTABLE_CONTEXT_TESTS_DIR);
|
|
139
|
+
}
|
|
140
|
+
/** `<prep-data>/portable-context/.interf/tests/<target>/runs/`. */
|
|
141
|
+
export function preparationTestRunsRoot(prepId, target) {
|
|
142
|
+
return join(portableContextTestsRoot(preparationPortableContextDir(prepId)), target, "runs");
|
|
143
|
+
}
|
|
144
|
+
/** `<prep-data>/portable-context/.interf/tests/latest.json`. */
|
|
145
|
+
export function preparationLatestReadinessRunPath(prepId) {
|
|
146
|
+
return join(portableContextTestsRoot(preparationPortableContextDir(prepId)), "latest.json");
|
|
147
|
+
}
|
|
148
|
+
/** `<prep-data>/portable-context/.interf/tests/latest.md`. */
|
|
149
|
+
export function preparationLatestReadinessSummaryPath(prepId) {
|
|
150
|
+
return join(portableContextTestsRoot(preparationPortableContextDir(prepId)), "latest.md");
|
|
151
|
+
}
|
|
152
|
+
/** Normalize a free-form string into a stable kebab-cased id (≤80 chars). */
|
|
153
|
+
export function normalizePreparationTestRunId(input) {
|
|
154
|
+
return input
|
|
155
|
+
.toLowerCase()
|
|
156
|
+
.trim()
|
|
157
|
+
.replace(/[^a-z0-9]+/g, "-")
|
|
158
|
+
.replace(/^-+|-+$/g, "")
|
|
159
|
+
.slice(0, 80);
|
|
160
|
+
}
|
|
161
|
+
/** `<prep-data>/portable-context/.interf/tests/<target>/runs/<timestamp>-<run-id>[-<suffix>].json`. */
|
|
162
|
+
export function preparationTestRunPath(prepId, target, generatedAt, runId, runSuffix) {
|
|
163
|
+
const suffix = runSuffix ? `-${normalizePreparationTestRunId(runSuffix)}` : "";
|
|
164
|
+
return join(preparationTestRunsRoot(prepId, target), `${generatedAt.replace(/[:.]/g, "-")}-${runId}${suffix}.json`);
|
|
165
|
+
}
|