forgeos 0.1.0-alpha.0 → 0.1.0-alpha.2
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/.npmignore +9 -1
- package/AGENTS.md +6 -1
- package/CHANGELOG.md +30 -0
- package/CONTRIBUTING.md +22 -1
- package/README.md +30 -3
- package/bin/forge.mjs +4 -3
- package/package.json +3 -1
- package/packages/eslint-plugin-forge/index.ts +15 -15
- package/packages/eslint-plugin-forge/package.json +10 -10
- package/packages/eslint-plugin-forge/src/check-source.ts +95 -95
- package/packages/eslint-plugin-forge/src/load-artifacts.ts +24 -24
- package/packages/eslint-plugin-forge/src/rule-no-forge-guard-violation.ts +93 -93
- package/src/forge/_generated/actionSubscriptions.json +2 -2
- package/src/forge/_generated/actionSubscriptions.ts +3 -3
- package/src/forge/_generated/agentAdapterManifest.json +2 -2
- package/src/forge/_generated/agentAdapterManifest.ts +3 -3
- package/src/forge/_generated/agentContract.json +2 -2
- package/src/forge/_generated/agentContract.ts +6786 -2
- package/src/forge/_generated/agentQuickstart.md +1 -1
- package/src/forge/_generated/aiContext.ts +1 -1
- package/src/forge/_generated/aiModels.json +1 -1
- package/src/forge/_generated/aiModels.ts +1 -1
- package/src/forge/_generated/aiProviders.json +1 -1
- package/src/forge/_generated/aiProviders.ts +1 -1
- package/src/forge/_generated/aiRegistry.json +2 -2
- package/src/forge/_generated/aiRegistry.ts +3 -3
- package/src/forge/_generated/api.json +2 -2
- package/src/forge/_generated/api.ts +1 -1
- package/src/forge/_generated/appGraph.json +2 -2
- package/src/forge/_generated/appGraph.ts +1297 -1141
- package/src/forge/_generated/appMap.md +1 -1
- package/src/forge/_generated/artifactManifest.json +2 -2
- package/src/forge/_generated/artifactManifest.ts +2 -2
- package/src/forge/_generated/authClaims.json +1 -1
- package/src/forge/_generated/authClaims.ts +1 -1
- package/src/forge/_generated/authConfig.json +1 -1
- package/src/forge/_generated/authConfig.ts +1 -1
- package/src/forge/_generated/authContext.ts +1 -1
- package/src/forge/_generated/authRegistry.json +1 -1
- package/src/forge/_generated/authRegistry.ts +1 -1
- package/src/forge/_generated/buildInfo.json +2 -2
- package/src/forge/_generated/buildInfo.ts +4 -4
- package/src/forge/_generated/capabilityMap.json +2 -2
- package/src/forge/_generated/capabilityMap.md +1 -1
- package/src/forge/_generated/capabilityMap.ts +2 -2
- package/src/forge/_generated/client.ts +1 -1
- package/src/forge/_generated/clientApi.ts +1 -1
- package/src/forge/_generated/clientManifest.json +2 -2
- package/src/forge/_generated/clientManifest.ts +3 -3
- package/src/forge/_generated/clientTypes.ts +1 -1
- package/src/forge/_generated/configRegistry.json +1 -1
- package/src/forge/_generated/configRegistry.ts +1 -1
- package/src/forge/_generated/dataGraph.json +2 -2
- package/src/forge/_generated/dataGraph.ts +3 -3
- package/src/forge/_generated/db.json +1 -1
- package/src/forge/_generated/db.ts +1 -1
- package/src/forge/_generated/dbSecurityManifest.json +1 -1
- package/src/forge/_generated/dbSecurityManifest.ts +1 -1
- package/src/forge/_generated/dbSessionContext.json +1 -1
- package/src/forge/_generated/dbSessionContext.ts +1 -1
- package/src/forge/_generated/deployManifest.json +2 -2
- package/src/forge/_generated/deployManifest.ts +7 -7
- package/src/forge/_generated/devManifest.json +2 -2
- package/src/forge/_generated/devManifest.ts +3 -3
- package/src/forge/_generated/envSchema.json +1 -1
- package/src/forge/_generated/envSchema.ts +1 -1
- package/src/forge/_generated/frontendGraph.json +1 -1
- package/src/forge/_generated/frontendGraph.ts +1 -1
- package/src/forge/_generated/importGuards.json +2 -2
- package/src/forge/_generated/importGuards.ts +35 -1
- package/src/forge/_generated/index.ts +1 -1
- package/src/forge/_generated/liveProductionManifest.json +1 -1
- package/src/forge/_generated/liveProductionManifest.ts +1 -1
- package/src/forge/_generated/liveProtocol.json +1 -1
- package/src/forge/_generated/liveProtocol.ts +1 -1
- package/src/forge/_generated/liveQueryRegistry.json +2 -2
- package/src/forge/_generated/liveQueryRegistry.ts +3 -3
- package/src/forge/_generated/liveTransportConfig.json +1 -1
- package/src/forge/_generated/liveTransportConfig.ts +1 -1
- package/src/forge/_generated/makeRegistry.json +2 -2
- package/src/forge/_generated/makeRegistry.ts +2 -2
- package/src/forge/_generated/makeTemplates.json +1 -1
- package/src/forge/_generated/makeTemplates.ts +1 -1
- package/src/forge/_generated/mockMap.json +1 -1
- package/src/forge/_generated/mockMap.ts +1 -1
- package/src/forge/_generated/operationPlaybooks.md +7 -5
- package/src/forge/_generated/packageGraph.json +2 -2
- package/src/forge/_generated/packageGraph.ts +90964 -14284
- package/src/forge/_generated/packageUpgradeRegistry.json +2 -2
- package/src/forge/_generated/packageUpgradeRegistry.ts +2 -2
- package/src/forge/_generated/permissionMatrix.json +2 -2
- package/src/forge/_generated/permissionMatrix.ts +3 -3
- package/src/forge/_generated/policyRegistry.json +2 -2
- package/src/forge/_generated/policyRegistry.ts +3 -3
- package/src/forge/_generated/queryRegistry.json +2 -2
- package/src/forge/_generated/queryRegistry.ts +3 -3
- package/src/forge/_generated/react.d.ts +1 -1
- package/src/forge/_generated/react.ts +1 -1
- package/src/forge/_generated/reactManifest.json +2 -2
- package/src/forge/_generated/reactManifest.ts +3 -3
- package/src/forge/_generated/releaseManifest.json +2 -2
- package/src/forge/_generated/releaseManifest.ts +3 -3
- package/src/forge/_generated/rlsPolicies.json +1 -1
- package/src/forge/_generated/rlsPolicies.sql +1 -1
- package/src/forge/_generated/rlsPolicies.ts +1 -1
- package/src/forge/_generated/runtimeGraph.json +2 -2
- package/src/forge/_generated/runtimeGraph.ts +3 -3
- package/src/forge/_generated/runtimeMatrix.json +2 -2
- package/src/forge/_generated/runtimeMatrix.ts +106177 -7917
- package/src/forge/_generated/runtimeRegistry.ts +1 -1
- package/src/forge/_generated/runtimeRules.md +1 -1
- package/src/forge/_generated/secretRegistry.json +1 -1
- package/src/forge/_generated/secretRegistry.ts +1 -1
- package/src/forge/_generated/secretsContext.ts +1 -1
- package/src/forge/_generated/serverApi.ts +1 -1
- package/src/forge/_generated/sourceMapManifest.json +2 -2
- package/src/forge/_generated/sourceMapManifest.ts +2 -2
- package/src/forge/_generated/sqlPlan.json +1 -1
- package/src/forge/_generated/sqlPlan.ts +1 -1
- package/src/forge/_generated/subscriptionManifest.json +2 -2
- package/src/forge/_generated/subscriptionManifest.ts +3 -3
- package/src/forge/_generated/symbolicationManifest.json +2 -2
- package/src/forge/_generated/symbolicationManifest.ts +2 -2
- package/src/forge/_generated/telemetryRegistry.json +2 -2
- package/src/forge/_generated/telemetryRegistry.ts +3 -3
- package/src/forge/_generated/telemetrySinks.json +2 -2
- package/src/forge/_generated/telemetrySinks.ts +2 -2
- package/src/forge/_generated/tenantScope.json +2 -2
- package/src/forge/_generated/tenantScope.ts +3 -3
- package/src/forge/_generated/testGraph.json +2 -2
- package/src/forge/_generated/testGraph.ts +129 -75
- package/src/forge/_generated/testPlanRegistry.json +2 -2
- package/src/forge/_generated/testPlanRegistry.ts +2 -2
- package/src/forge/_generated/uiRoutes.json +1 -1
- package/src/forge/_generated/uiRoutes.ts +1 -1
- package/src/forge/_generated/uiScenarios.json +1 -1
- package/src/forge/_generated/uiScenarios.ts +1 -1
- package/src/forge/_generated/uiTestManifest.json +2 -2
- package/src/forge/_generated/uiTestManifest.ts +2 -2
- package/src/forge/_generated/workflowRegistry.json +2 -2
- package/src/forge/_generated/workflowRegistry.ts +3 -3
- package/src/forge/_generated/workflowSubscriptions.json +2 -2
- package/src/forge/_generated/workflowSubscriptions.ts +3 -3
- package/src/forge/cli/commands.ts +861 -861
- package/src/forge/cli/deps.ts +178 -11
- package/src/forge/cli/dev.ts +32 -5
- package/src/forge/cli/index.ts +7 -7
- package/src/forge/cli/main.ts +54 -54
- package/src/forge/cli/new.ts +29 -1
- package/src/forge/cli/output.ts +97 -97
- package/src/forge/cli/parse.ts +679 -673
- package/src/forge/cli/version.ts +1 -1
- package/src/forge/compiler/agent-contract/build.ts +28 -0
- package/src/forge/compiler/agent-contract/types.ts +16 -0
- package/src/forge/compiler/app-graph/build.ts +112 -112
- package/src/forge/compiler/app-graph/classify.ts +10 -10
- package/src/forge/compiler/app-graph/dup-symbol.ts +29 -29
- package/src/forge/compiler/app-graph/extract.ts +123 -123
- package/src/forge/compiler/app-graph/forge-apis.ts +29 -29
- package/src/forge/compiler/app-graph/index.ts +11 -11
- package/src/forge/compiler/app-graph/module-graph.ts +316 -316
- package/src/forge/compiler/app-graph/parser.ts +119 -119
- package/src/forge/compiler/app-graph/symbols.ts +48 -48
- package/src/forge/compiler/app-graph/tsconfig-hash.ts +62 -62
- package/src/forge/compiler/app-graph/types.ts +43 -43
- package/src/forge/compiler/app-graph/versions.ts +14 -14
- package/src/forge/compiler/cache/index.ts +17 -17
- package/src/forge/compiler/cache/key.ts +46 -46
- package/src/forge/compiler/cache/scheduler.ts +72 -72
- package/src/forge/compiler/cache/store.ts +78 -78
- package/src/forge/compiler/classifier/capabilities.ts +78 -78
- package/src/forge/compiler/classifier/classify.ts +113 -113
- package/src/forge/compiler/classifier/contexts.ts +188 -188
- package/src/forge/compiler/classifier/index.ts +18 -18
- package/src/forge/compiler/classifier/runtime-matrix.ts +45 -45
- package/src/forge/compiler/classifier/secrets.ts +41 -41
- package/src/forge/compiler/classifier/signals.ts +129 -129
- package/src/forge/compiler/diagnostics/codes.ts +125 -120
- package/src/forge/compiler/diagnostics/create.ts +87 -87
- package/src/forge/compiler/diagnostics/index.ts +41 -41
- package/src/forge/compiler/emitter/artifact-kind.ts +14 -14
- package/src/forge/compiler/emitter/barrel.ts +38 -38
- package/src/forge/compiler/emitter/constants.ts +7 -7
- package/src/forge/compiler/emitter/emit.ts +234 -237
- package/src/forge/compiler/emitter/index.ts +24 -24
- package/src/forge/compiler/emitter/lock.ts +61 -61
- package/src/forge/compiler/emitter/render.ts +73 -73
- package/src/forge/compiler/guards/artifacts.ts +96 -96
- package/src/forge/compiler/guards/check-import-guards.ts +106 -106
- package/src/forge/compiler/guards/index.ts +11 -11
- package/src/forge/compiler/guards/propagate-contexts.ts +57 -57
- package/src/forge/compiler/index.ts +17 -17
- package/src/forge/compiler/integration/add.ts +493 -493
- package/src/forge/compiler/integration/index.ts +17 -17
- package/src/forge/compiler/integration/plan.ts +279 -279
- package/src/forge/compiler/integration/render.ts +189 -189
- package/src/forge/compiler/integration/snapshot.ts +52 -52
- package/src/forge/compiler/orchestrator/discover.ts +214 -214
- package/src/forge/compiler/orchestrator/guards.ts +5 -5
- package/src/forge/compiler/orchestrator/index.ts +27 -27
- package/src/forge/compiler/orchestrator/manifest.ts +69 -69
- package/src/forge/compiler/orchestrator/orphans.ts +51 -51
- package/src/forge/compiler/orchestrator/plan.ts +804 -804
- package/src/forge/compiler/orchestrator/run.ts +178 -178
- package/src/forge/compiler/orchestrator/serialize.ts +859 -859
- package/src/forge/compiler/orchestrator/types.ts +23 -23
- package/src/forge/compiler/orchestrator/verify.ts +35 -35
- package/src/forge/compiler/package-graph/capabilities-stub.ts +33 -33
- package/src/forge/compiler/package-graph/checksum.ts +107 -97
- package/src/forge/compiler/package-graph/compiler.ts +444 -363
- package/src/forge/compiler/package-graph/constants.ts +4 -4
- package/src/forge/compiler/package-graph/exports-discovery.ts +91 -84
- package/src/forge/compiler/package-graph/extract-dts.ts +32 -32
- package/src/forge/compiler/package-graph/index.ts +24 -24
- package/src/forge/compiler/package-graph/jsdoc.ts +50 -50
- package/src/forge/compiler/package-graph/oracle.ts +326 -0
- package/src/forge/compiler/package-graph/read-file.ts +21 -21
- package/src/forge/compiler/package-graph/resolve.ts +131 -127
- package/src/forge/compiler/package-manager/adapter.ts +232 -232
- package/src/forge/compiler/package-manager/commands.ts +47 -47
- package/src/forge/compiler/package-manager/detect.ts +65 -65
- package/src/forge/compiler/package-manager/executor.ts +29 -29
- package/src/forge/compiler/package-manager/index.ts +22 -22
- package/src/forge/compiler/package-manager/parse-spec.ts +16 -16
- package/src/forge/compiler/package-manager/version.ts +20 -20
- package/src/forge/compiler/primitives/compare.ts +26 -26
- package/src/forge/compiler/primitives/hash.ts +42 -33
- package/src/forge/compiler/primitives/header.ts +43 -43
- package/src/forge/compiler/primitives/index.ts +45 -45
- package/src/forge/compiler/primitives/paths.ts +24 -24
- package/src/forge/compiler/primitives/serialize.ts +66 -66
- package/src/forge/compiler/primitives/sort.ts +87 -87
- package/src/forge/compiler/recipes/definitions.ts +269 -269
- package/src/forge/compiler/recipes/helpers.ts +37 -37
- package/src/forge/compiler/recipes/index.ts +21 -21
- package/src/forge/compiler/recipes/registry.ts +87 -87
- package/src/forge/compiler/sandbox/artifact-sanitize.ts +26 -26
- package/src/forge/compiler/sandbox/backends/child.ts +123 -123
- package/src/forge/compiler/sandbox/backends/docker.ts +173 -173
- package/src/forge/compiler/sandbox/index.ts +51 -51
- package/src/forge/compiler/sandbox/inspect.ts +143 -143
- package/src/forge/compiler/sandbox/inspector-entry.ts +115 -115
- package/src/forge/compiler/sandbox/limits.ts +31 -31
- package/src/forge/compiler/sandbox/scrub-env.ts +60 -60
- package/src/forge/compiler/sandbox/secret-scan.ts +54 -54
- package/src/forge/compiler/sandbox/serialize.ts +106 -106
- package/src/forge/compiler/sandbox/types.ts +7 -7
- package/src/forge/compiler/types/app-graph.ts +71 -71
- package/src/forge/compiler/types/capability.ts +29 -29
- package/src/forge/compiler/types/classification.ts +9 -9
- package/src/forge/compiler/types/cli.ts +85 -85
- package/src/forge/compiler/types/diagnostic.ts +2 -2
- package/src/forge/compiler/types/emit.ts +25 -25
- package/src/forge/compiler/types/import-guards.ts +19 -19
- package/src/forge/compiler/types/index.ts +98 -98
- package/src/forge/compiler/types/integration.ts +25 -25
- package/src/forge/compiler/types/json.ts +3 -3
- package/src/forge/compiler/types/lock.ts +37 -37
- package/src/forge/compiler/types/package-graph.ts +122 -77
- package/src/forge/compiler/types/runtime-matrix.ts +16 -16
- package/src/forge/compiler/types/runtime.ts +30 -30
- package/src/forge/compiler/types/sandbox.ts +24 -24
- package/src/forge/dev/server.ts +16 -2
- package/src/forge/refactor/index.ts +10 -2
- package/src/forge/refactor/runtime-rename.ts +598 -0
- package/src/forge/runtime/executor.ts +3 -2
- package/src/forge/runtime/live/live-query-runner.ts +2 -1
- package/src/forge/runtime/outbox/process.ts +2 -1
- package/src/forge/runtime/query/run-query.ts +2 -1
- package/src/forge/runtime/runner/run-entry.ts +2 -1
- package/src/forge/runtime/telemetry/sinks/posthog.ts +4 -5
- package/src/forge/runtime/telemetry/sinks/sentry.ts +4 -5
- package/src/forge/runtime/workflows/resolve-step.ts +2 -1
- package/src/forge/version.ts +3 -0
- package/templates/b2b-support-web/src/actions/captureTicketCreated.ts +7 -2
- package/templates/b2b-support-web/src/commands/closeTicket.ts +6 -1
- package/templates/b2b-support-web/src/commands/createTicket.ts +8 -2
- package/templates/b2b-support-web/src/queries/getTicket.ts +8 -1
- package/templates/b2b-support-web/web/components/CreateTicketForm.tsx +1 -2
- package/templates/b2b-support-web/web/components/PolicyDeniedDemo.tsx +1 -2
- package/templates/b2b-support-web/web/components/TicketList.tsx +1 -2
- package/templates/b2b-support-web/web/components/TraceDetails.tsx +1 -1
- package/templates/b2b-support-web/web/lib/forge.ts +1 -0
|
@@ -1,32 +1,32 @@
|
|
|
1
1
|
import { buildDataGraph } from "../data-graph/build.ts";
|
|
2
2
|
import { createDiagnostic } from "../diagnostics/create.ts";
|
|
3
|
-
import { buildActionSubscriptions } from "../action-subscriptions/build.ts";
|
|
4
|
-
import {
|
|
5
|
-
buildWorkflowRegistry,
|
|
6
|
-
buildWorkflowSubscriptions,
|
|
7
|
-
} from "../workflow-registry/build.ts";
|
|
8
|
-
import {
|
|
9
|
-
buildTelemetryRegistry,
|
|
10
|
-
buildTelemetrySinks,
|
|
11
|
-
} from "../telemetry-registry/build.ts";
|
|
12
|
-
import {
|
|
13
|
-
buildPermissionMatrixFromRegistry,
|
|
14
|
-
buildPolicyRegistry,
|
|
15
|
-
buildTenantScope,
|
|
16
|
-
} from "../policy-registry/build.ts";
|
|
17
|
-
import {
|
|
18
|
-
augmentEnvSchemaWithPublicVars,
|
|
19
|
-
buildConfigRegistry,
|
|
20
|
-
buildEnvSchema,
|
|
21
|
-
buildSecretRegistry,
|
|
22
|
-
} from "../secret-registry/build.ts";
|
|
23
|
-
import { buildAiModels, buildAiRegistry } from "../ai-registry/build.ts";
|
|
24
|
-
import { buildQueryRegistry } from "../query-registry/build.ts";
|
|
25
|
-
import {
|
|
26
|
-
buildLiveQueryRegistry,
|
|
27
|
-
buildSubscriptionManifest,
|
|
28
|
-
} from "../live-query-registry/build.ts";
|
|
29
|
-
import { buildApiSurface } from "../api-surface/build.ts";
|
|
3
|
+
import { buildActionSubscriptions } from "../action-subscriptions/build.ts";
|
|
4
|
+
import {
|
|
5
|
+
buildWorkflowRegistry,
|
|
6
|
+
buildWorkflowSubscriptions,
|
|
7
|
+
} from "../workflow-registry/build.ts";
|
|
8
|
+
import {
|
|
9
|
+
buildTelemetryRegistry,
|
|
10
|
+
buildTelemetrySinks,
|
|
11
|
+
} from "../telemetry-registry/build.ts";
|
|
12
|
+
import {
|
|
13
|
+
buildPermissionMatrixFromRegistry,
|
|
14
|
+
buildPolicyRegistry,
|
|
15
|
+
buildTenantScope,
|
|
16
|
+
} from "../policy-registry/build.ts";
|
|
17
|
+
import {
|
|
18
|
+
augmentEnvSchemaWithPublicVars,
|
|
19
|
+
buildConfigRegistry,
|
|
20
|
+
buildEnvSchema,
|
|
21
|
+
buildSecretRegistry,
|
|
22
|
+
} from "../secret-registry/build.ts";
|
|
23
|
+
import { buildAiModels, buildAiRegistry } from "../ai-registry/build.ts";
|
|
24
|
+
import { buildQueryRegistry } from "../query-registry/build.ts";
|
|
25
|
+
import {
|
|
26
|
+
buildLiveQueryRegistry,
|
|
27
|
+
buildSubscriptionManifest,
|
|
28
|
+
} from "../live-query-registry/build.ts";
|
|
29
|
+
import { buildApiSurface } from "../api-surface/build.ts";
|
|
30
30
|
import {
|
|
31
31
|
buildClientManifest,
|
|
32
32
|
buildReactManifest,
|
|
@@ -36,22 +36,22 @@ import {
|
|
|
36
36
|
serializeFrontendGraphJson,
|
|
37
37
|
serializeFrontendGraphTs,
|
|
38
38
|
} from "../frontend-graph/build.ts";
|
|
39
|
-
import {
|
|
40
|
-
renderClientManifestTs,
|
|
41
|
-
renderClientTs,
|
|
42
|
-
renderClientTypesTs,
|
|
43
|
-
renderReactDts,
|
|
44
|
-
renderReactManifestTs,
|
|
45
|
-
renderReactTs,
|
|
46
|
-
} from "../client-sdk/render-client.ts";
|
|
47
|
-
import { buildSqlPlan } from "../data-graph/sql/ddl.ts";
|
|
48
|
-
import { buildRlsArtifacts } from "../data-graph/rls/build.ts";
|
|
49
|
-
import { buildGeneratedReleaseArtifacts } from "../release/build.ts";
|
|
50
|
-
import { buildLiveProductionArtifacts } from "../live-production/types.ts";
|
|
51
|
-
import { buildMakeRegistry, buildMakeTemplates } from "../make-registry/build.ts";
|
|
52
|
-
import { buildTestGraph, buildTestPlanRegistry } from "../test-graph/build.ts";
|
|
53
|
-
import { buildDevManifest } from "../dev-manifest/build.ts";
|
|
54
|
-
import { buildRuntimeGraph } from "../runtime-graph/build.ts";
|
|
39
|
+
import {
|
|
40
|
+
renderClientManifestTs,
|
|
41
|
+
renderClientTs,
|
|
42
|
+
renderClientTypesTs,
|
|
43
|
+
renderReactDts,
|
|
44
|
+
renderReactManifestTs,
|
|
45
|
+
renderReactTs,
|
|
46
|
+
} from "../client-sdk/render-client.ts";
|
|
47
|
+
import { buildSqlPlan } from "../data-graph/sql/ddl.ts";
|
|
48
|
+
import { buildRlsArtifacts } from "../data-graph/rls/build.ts";
|
|
49
|
+
import { buildGeneratedReleaseArtifacts } from "../release/build.ts";
|
|
50
|
+
import { buildLiveProductionArtifacts } from "../live-production/types.ts";
|
|
51
|
+
import { buildMakeRegistry, buildMakeTemplates } from "../make-registry/build.ts";
|
|
52
|
+
import { buildTestGraph, buildTestPlanRegistry } from "../test-graph/build.ts";
|
|
53
|
+
import { buildDevManifest } from "../dev-manifest/build.ts";
|
|
54
|
+
import { buildRuntimeGraph } from "../runtime-graph/build.ts";
|
|
55
55
|
import {
|
|
56
56
|
buildAgentContractArtifacts,
|
|
57
57
|
serializeCapabilityMapJson,
|
|
@@ -59,269 +59,269 @@ import {
|
|
|
59
59
|
serializeAgentContractJson,
|
|
60
60
|
serializeAgentContractTs,
|
|
61
61
|
} from "../agent-contract/build.ts";
|
|
62
|
-
import {
|
|
63
|
-
buildAgentAdapterManifest,
|
|
64
|
-
serializeAgentAdapterManifestJson,
|
|
65
|
-
serializeAgentAdapterManifestTs,
|
|
66
|
-
} from "../../agent-adapters/index.ts";
|
|
67
|
-
import {
|
|
68
|
-
buildUiGeneratedArtifacts,
|
|
69
|
-
serializeUiRoutesJson,
|
|
70
|
-
serializeUiRoutesTs,
|
|
71
|
-
serializeUiScenariosJson,
|
|
72
|
-
serializeUiScenariosTs,
|
|
73
|
-
serializeUiTestManifestJson,
|
|
74
|
-
serializeUiTestManifestTs,
|
|
75
|
-
} from "../../ui/index.ts";
|
|
76
|
-
import type { AppGraph } from "../types/app-graph.ts";
|
|
77
|
-
import type { PackageGraph } from "../types/package-graph.ts";
|
|
78
|
-
import type { EmitFile, EmitPlan } from "../types/emit.ts";
|
|
79
|
-
import type { ForgeLock, ForgeLockEntry } from "../types/lock.ts";
|
|
80
|
-
import type { ClassifiedPackage } from "../classifier/runtime-matrix.ts";
|
|
81
|
-
import { buildRuntimeMatrix } from "../classifier/runtime-matrix.ts";
|
|
82
|
-
import { detectCapabilities } from "../classifier/capabilities.ts";
|
|
83
|
-
import { detectSecrets } from "../classifier/secrets.ts";
|
|
84
|
-
import { resolveByPackageName } from "../recipes/registry.ts";
|
|
85
|
-
import { RECIPE_SCHEMA_VERSION } from "../recipes/definitions.ts";
|
|
86
|
-
import {
|
|
87
|
-
FORGE_LOCK_SCHEMA_VERSION,
|
|
88
|
-
GENERATED_DIR,
|
|
89
|
-
GENERATOR_VERSION,
|
|
90
|
-
} from "../emitter/constants.ts";
|
|
91
|
-
import { PACKAGE_ANALYZER_VERSION } from "../package-graph/constants.ts";
|
|
92
|
-
import { hashStable } from "../primitives/hash.ts";
|
|
93
|
-
import { stableSortEmitFiles } from "../primitives/sort.ts";
|
|
94
|
-
import { detectOrphanedGeneratedFiles } from "./orphans.ts";
|
|
95
|
-
import type { DiscoverContext } from "./types.ts";
|
|
96
|
-
import {
|
|
97
|
-
serializeAppGraphJson,
|
|
98
|
-
serializeAppGraphTs,
|
|
99
|
-
serializeDataGraphJson,
|
|
100
|
-
serializeDataGraphTs,
|
|
101
|
-
serializeImportGuardsJson,
|
|
102
|
-
serializeImportGuardsTs,
|
|
103
|
-
serializeMockMapJson,
|
|
104
|
-
serializeMockMapTs,
|
|
105
|
-
serializePackageGraphJson,
|
|
106
|
-
serializePackageGraphTs,
|
|
107
|
-
serializeRuntimeGraphJson,
|
|
108
|
-
serializeRuntimeGraphTs,
|
|
109
|
-
serializeRuntimeMatrixJson,
|
|
110
|
-
serializeRuntimeMatrixTs,
|
|
111
|
-
serializeRuntimeRegistryTs,
|
|
112
|
-
serializeDevManifestJson,
|
|
113
|
-
serializeDevManifestTs,
|
|
114
|
-
serializeSqlPlanJsonExport,
|
|
115
|
-
serializeSqlPlanTsExport,
|
|
116
|
-
serializeDbJsonExport,
|
|
117
|
-
serializeDbTsExport,
|
|
118
|
-
serializeRlsPoliciesSql,
|
|
119
|
-
serializeRlsPoliciesJson,
|
|
120
|
-
serializeRlsPoliciesTs,
|
|
121
|
-
serializeDbSecurityManifestJson,
|
|
122
|
-
serializeDbSecurityManifestTs,
|
|
123
|
-
serializeDbSessionContextJson,
|
|
124
|
-
serializeDbSessionContextTs,
|
|
125
|
-
serializePackageUpgradeRegistryJson,
|
|
126
|
-
serializePackageUpgradeRegistryTs,
|
|
127
|
-
serializeReleaseManifestJson,
|
|
128
|
-
serializeReleaseManifestTs,
|
|
129
|
-
serializeDeployManifestJson,
|
|
130
|
-
serializeDeployManifestTs,
|
|
131
|
-
serializeArtifactManifestJson,
|
|
132
|
-
serializeArtifactManifestTs,
|
|
133
|
-
serializeSourceMapManifestJson,
|
|
134
|
-
serializeSourceMapManifestTs,
|
|
135
|
-
serializeSymbolicationManifestJson,
|
|
136
|
-
serializeSymbolicationManifestTs,
|
|
137
|
-
serializeBuildInfoJson,
|
|
138
|
-
serializeBuildInfoTs,
|
|
139
|
-
serializeLiveProductionManifestJson,
|
|
140
|
-
serializeLiveProductionManifestTs,
|
|
141
|
-
serializeLiveProtocolJson,
|
|
142
|
-
serializeLiveProtocolTs,
|
|
143
|
-
serializeLiveTransportConfigJson,
|
|
144
|
-
serializeLiveTransportConfigTs,
|
|
145
|
-
serializeMakeRegistryJson,
|
|
146
|
-
serializeMakeRegistryTs,
|
|
147
|
-
serializeMakeTemplatesJson,
|
|
148
|
-
serializeMakeTemplatesTs,
|
|
149
|
-
serializeTestGraphJson,
|
|
150
|
-
serializeTestGraphTs,
|
|
151
|
-
serializeTestPlanRegistryJson,
|
|
152
|
-
serializeTestPlanRegistryTs,
|
|
153
|
-
serializeActionSubscriptionsJson,
|
|
154
|
-
serializeActionSubscriptionsTs,
|
|
155
|
-
serializeWorkflowRegistryJson,
|
|
156
|
-
serializeWorkflowRegistryTs,
|
|
157
|
-
serializeWorkflowSubscriptionsJson,
|
|
158
|
-
serializeWorkflowSubscriptionsTs,
|
|
159
|
-
serializeTelemetryRegistryJson,
|
|
160
|
-
serializeTelemetryRegistryTs,
|
|
161
|
-
serializeTelemetrySinksJson,
|
|
162
|
-
serializeTelemetrySinksTs,
|
|
163
|
-
serializePolicyRegistryJson,
|
|
164
|
-
serializePolicyRegistryTs,
|
|
165
|
-
serializePermissionMatrixJson,
|
|
166
|
-
serializePermissionMatrixTs,
|
|
167
|
-
serializeTenantScopeJson,
|
|
168
|
-
serializeTenantScopeTs,
|
|
169
|
-
serializeAuthClaimsJson,
|
|
170
|
-
serializeAuthClaimsTs,
|
|
171
|
-
serializeAuthConfigJson,
|
|
172
|
-
serializeAuthConfigTs,
|
|
173
|
-
serializeAuthContextTs,
|
|
174
|
-
serializeAuthRegistryJson,
|
|
175
|
-
serializeAuthRegistryTs,
|
|
176
|
-
serializeSecretsContextTs,
|
|
177
|
-
serializeSecretRegistryJson,
|
|
178
|
-
serializeSecretRegistryTs,
|
|
179
|
-
serializeEnvSchemaJson,
|
|
180
|
-
serializeEnvSchemaTs,
|
|
181
|
-
serializeConfigRegistryJson,
|
|
182
|
-
serializeConfigRegistryTs,
|
|
183
|
-
serializeAiRegistryJson,
|
|
184
|
-
serializeAiRegistryTs,
|
|
185
|
-
serializeAiProvidersJson,
|
|
186
|
-
serializeAiProvidersTs,
|
|
187
|
-
serializeAiModelsJson,
|
|
188
|
-
serializeAiModelsTs,
|
|
189
|
-
serializeAiContextTs,
|
|
190
|
-
serializeQueryRegistryJson,
|
|
191
|
-
serializeQueryRegistryTs,
|
|
192
|
-
serializeLiveQueryRegistryJson,
|
|
193
|
-
serializeLiveQueryRegistryTs,
|
|
194
|
-
serializeSubscriptionManifestJson,
|
|
195
|
-
serializeSubscriptionManifestTs,
|
|
196
|
-
serializeApiJson,
|
|
197
|
-
serializeApiTsExport,
|
|
198
|
-
serializeServerApiTsExport,
|
|
199
|
-
serializeClientApiTsExport,
|
|
200
|
-
serializeClientManifestJson,
|
|
201
|
-
serializeReactManifestJson,
|
|
202
|
-
buildMockMapEntries,
|
|
203
|
-
} from "./serialize.ts";
|
|
204
|
-
import { buildDefaultAuthRegistry, AUTH_ENV } from "../../runtime/auth/config.ts";
|
|
205
|
-
import type { EnvSchema } from "../types/secret-registry.ts";
|
|
206
|
-
|
|
207
|
-
export interface PlanInput {
|
|
208
|
-
appGraph: AppGraph;
|
|
209
|
-
packageGraph: PackageGraph;
|
|
210
|
-
classified: ClassifiedPackage[];
|
|
211
|
-
ctx: DiscoverContext;
|
|
212
|
-
}
|
|
213
|
-
|
|
214
|
-
function makeEmitFile(path: string, content: string): EmitFile {
|
|
215
|
-
return {
|
|
216
|
-
path,
|
|
217
|
-
content,
|
|
218
|
-
contentHash: hashStable(content),
|
|
219
|
-
canonical: path.endsWith(".json"),
|
|
220
|
-
};
|
|
221
|
-
}
|
|
222
|
-
|
|
223
|
-
function buildLockEntry(pkg: ClassifiedPackage): ForgeLockEntry {
|
|
224
|
-
const recipe = pkg.recipe ?? resolveByPackageName(pkg.api.name);
|
|
225
|
-
const secrets = detectSecrets(pkg.api, recipe ?? undefined);
|
|
226
|
-
const capabilities = detectCapabilities(pkg.api, recipe ?? undefined);
|
|
227
|
-
|
|
228
|
-
return {
|
|
229
|
-
name: pkg.api.name,
|
|
230
|
-
version: pkg.api.version,
|
|
231
|
-
...(recipe?.recipeVersion !== undefined
|
|
232
|
-
? { recipeVersion: recipe.recipeVersion }
|
|
233
|
-
: {}),
|
|
234
|
-
runtimeContexts: [...pkg.classification.compatible],
|
|
235
|
-
capabilities: {
|
|
236
|
-
...capabilities,
|
|
237
|
-
secrets,
|
|
238
|
-
},
|
|
239
|
-
secrets,
|
|
240
|
-
generatedFiles: [],
|
|
241
|
-
contentChecksum: pkg.api.contentChecksum,
|
|
242
|
-
};
|
|
243
|
-
}
|
|
244
|
-
|
|
245
|
-
function buildForgeLock(input: PlanInput): ForgeLock {
|
|
246
|
-
const recipeVersions = input.classified
|
|
247
|
-
.map((pkg) => pkg.recipe?.recipeVersion)
|
|
248
|
-
.filter((version): version is string => version !== undefined);
|
|
249
|
-
|
|
250
|
-
const recipeVersion =
|
|
251
|
-
recipeVersions.length > 0
|
|
252
|
-
? recipeVersions.sort()[0]
|
|
253
|
-
: RECIPE_SCHEMA_VERSION;
|
|
254
|
-
|
|
255
|
-
return {
|
|
256
|
-
schemaVersion: FORGE_LOCK_SCHEMA_VERSION,
|
|
257
|
-
generatorVersion: GENERATOR_VERSION,
|
|
258
|
-
analyzerVersion: PACKAGE_ANALYZER_VERSION,
|
|
259
|
-
inputHash: input.ctx.inputFingerprint,
|
|
260
|
-
lockfileHash: input.ctx.lockfileHash,
|
|
261
|
-
packageManager: input.ctx.packageManager,
|
|
262
|
-
recipeVersion,
|
|
263
|
-
packages: input.classified
|
|
264
|
-
.filter((pkg) => resolveByPackageName(pkg.api.name) !== null)
|
|
265
|
-
.map(buildLockEntry),
|
|
266
|
-
};
|
|
267
|
-
}
|
|
268
|
-
|
|
269
|
-
function augmentEnvSchemaWithAuthVars(schema: EnvSchema): EnvSchema {
|
|
270
|
-
const byName = new Map(schema.variables.map((variable) => [variable.name, variable]));
|
|
271
|
-
for (const name of [
|
|
272
|
-
AUTH_ENV.mode,
|
|
273
|
-
AUTH_ENV.issuer,
|
|
274
|
-
AUTH_ENV.audience,
|
|
275
|
-
AUTH_ENV.jwksUri,
|
|
276
|
-
AUTH_ENV.algorithms,
|
|
277
|
-
]) {
|
|
278
|
-
if (!byName.has(name)) {
|
|
279
|
-
byName.set(name, {
|
|
280
|
-
name,
|
|
281
|
-
kind: "config",
|
|
282
|
-
required: false,
|
|
283
|
-
source: "auth",
|
|
284
|
-
});
|
|
285
|
-
}
|
|
286
|
-
}
|
|
287
|
-
return {
|
|
288
|
-
variables: [...byName.values()].sort((a, b) => a.name.localeCompare(b.name)),
|
|
289
|
-
};
|
|
290
|
-
}
|
|
291
|
-
|
|
292
|
-
export function plan(input: PlanInput): EmitPlan {
|
|
293
|
-
const matrix = buildRuntimeMatrix(input.classified);
|
|
294
|
-
const dataGraph = buildDataGraph(input.appGraph);
|
|
295
|
-
const sqlPlan = buildSqlPlan(dataGraph);
|
|
296
|
-
const actionSubscriptions = buildActionSubscriptions(input.appGraph);
|
|
297
|
-
const workflowRegistry = buildWorkflowRegistry(input.appGraph);
|
|
298
|
-
const workflowSubscriptions = buildWorkflowSubscriptions(workflowRegistry);
|
|
299
|
-
const telemetryRegistry = buildTelemetryRegistry(input.appGraph);
|
|
300
|
-
const telemetrySinks = buildTelemetrySinks(input.classified);
|
|
301
|
-
const policyRegistry = buildPolicyRegistry(input.appGraph);
|
|
302
|
-
const permissionMatrix = buildPermissionMatrixFromRegistry(policyRegistry);
|
|
303
|
-
const tenantScope = buildTenantScope(dataGraph);
|
|
304
|
-
const secretRegistry = buildSecretRegistry(input.classified);
|
|
305
|
-
const envSchema = augmentEnvSchemaWithAuthVars(
|
|
306
|
-
augmentEnvSchemaWithPublicVars(
|
|
307
|
-
buildEnvSchema(secretRegistry),
|
|
308
|
-
input.classified,
|
|
309
|
-
),
|
|
310
|
-
);
|
|
311
|
-
const configRegistry = buildConfigRegistry(secretRegistry);
|
|
312
|
-
const authRegistry = buildDefaultAuthRegistry(tenantScope.tables.length > 0);
|
|
313
|
-
const aiRegistry = buildAiRegistry(input.appGraph, input.classified);
|
|
314
|
-
const aiModels = buildAiModels();
|
|
315
|
-
const queryRegistry = buildQueryRegistry(input.appGraph);
|
|
316
|
-
const liveQueryRegistry = buildLiveQueryRegistry(input.appGraph);
|
|
317
|
-
const subscriptionManifest = buildSubscriptionManifest(liveQueryRegistry);
|
|
318
|
-
const runtimeGraph = buildRuntimeGraph(input.appGraph);
|
|
319
|
-
const apiSurface = buildApiSurface(
|
|
320
|
-
runtimeGraph,
|
|
321
|
-
queryRegistry,
|
|
322
|
-
liveQueryRegistry,
|
|
323
|
-
workflowRegistry,
|
|
324
|
-
);
|
|
62
|
+
import {
|
|
63
|
+
buildAgentAdapterManifest,
|
|
64
|
+
serializeAgentAdapterManifestJson,
|
|
65
|
+
serializeAgentAdapterManifestTs,
|
|
66
|
+
} from "../../agent-adapters/index.ts";
|
|
67
|
+
import {
|
|
68
|
+
buildUiGeneratedArtifacts,
|
|
69
|
+
serializeUiRoutesJson,
|
|
70
|
+
serializeUiRoutesTs,
|
|
71
|
+
serializeUiScenariosJson,
|
|
72
|
+
serializeUiScenariosTs,
|
|
73
|
+
serializeUiTestManifestJson,
|
|
74
|
+
serializeUiTestManifestTs,
|
|
75
|
+
} from "../../ui/index.ts";
|
|
76
|
+
import type { AppGraph } from "../types/app-graph.ts";
|
|
77
|
+
import type { PackageGraph } from "../types/package-graph.ts";
|
|
78
|
+
import type { EmitFile, EmitPlan } from "../types/emit.ts";
|
|
79
|
+
import type { ForgeLock, ForgeLockEntry } from "../types/lock.ts";
|
|
80
|
+
import type { ClassifiedPackage } from "../classifier/runtime-matrix.ts";
|
|
81
|
+
import { buildRuntimeMatrix } from "../classifier/runtime-matrix.ts";
|
|
82
|
+
import { detectCapabilities } from "../classifier/capabilities.ts";
|
|
83
|
+
import { detectSecrets } from "../classifier/secrets.ts";
|
|
84
|
+
import { resolveByPackageName } from "../recipes/registry.ts";
|
|
85
|
+
import { RECIPE_SCHEMA_VERSION } from "../recipes/definitions.ts";
|
|
86
|
+
import {
|
|
87
|
+
FORGE_LOCK_SCHEMA_VERSION,
|
|
88
|
+
GENERATED_DIR,
|
|
89
|
+
GENERATOR_VERSION,
|
|
90
|
+
} from "../emitter/constants.ts";
|
|
91
|
+
import { PACKAGE_ANALYZER_VERSION } from "../package-graph/constants.ts";
|
|
92
|
+
import { hashStable } from "../primitives/hash.ts";
|
|
93
|
+
import { stableSortEmitFiles } from "../primitives/sort.ts";
|
|
94
|
+
import { detectOrphanedGeneratedFiles } from "./orphans.ts";
|
|
95
|
+
import type { DiscoverContext } from "./types.ts";
|
|
96
|
+
import {
|
|
97
|
+
serializeAppGraphJson,
|
|
98
|
+
serializeAppGraphTs,
|
|
99
|
+
serializeDataGraphJson,
|
|
100
|
+
serializeDataGraphTs,
|
|
101
|
+
serializeImportGuardsJson,
|
|
102
|
+
serializeImportGuardsTs,
|
|
103
|
+
serializeMockMapJson,
|
|
104
|
+
serializeMockMapTs,
|
|
105
|
+
serializePackageGraphJson,
|
|
106
|
+
serializePackageGraphTs,
|
|
107
|
+
serializeRuntimeGraphJson,
|
|
108
|
+
serializeRuntimeGraphTs,
|
|
109
|
+
serializeRuntimeMatrixJson,
|
|
110
|
+
serializeRuntimeMatrixTs,
|
|
111
|
+
serializeRuntimeRegistryTs,
|
|
112
|
+
serializeDevManifestJson,
|
|
113
|
+
serializeDevManifestTs,
|
|
114
|
+
serializeSqlPlanJsonExport,
|
|
115
|
+
serializeSqlPlanTsExport,
|
|
116
|
+
serializeDbJsonExport,
|
|
117
|
+
serializeDbTsExport,
|
|
118
|
+
serializeRlsPoliciesSql,
|
|
119
|
+
serializeRlsPoliciesJson,
|
|
120
|
+
serializeRlsPoliciesTs,
|
|
121
|
+
serializeDbSecurityManifestJson,
|
|
122
|
+
serializeDbSecurityManifestTs,
|
|
123
|
+
serializeDbSessionContextJson,
|
|
124
|
+
serializeDbSessionContextTs,
|
|
125
|
+
serializePackageUpgradeRegistryJson,
|
|
126
|
+
serializePackageUpgradeRegistryTs,
|
|
127
|
+
serializeReleaseManifestJson,
|
|
128
|
+
serializeReleaseManifestTs,
|
|
129
|
+
serializeDeployManifestJson,
|
|
130
|
+
serializeDeployManifestTs,
|
|
131
|
+
serializeArtifactManifestJson,
|
|
132
|
+
serializeArtifactManifestTs,
|
|
133
|
+
serializeSourceMapManifestJson,
|
|
134
|
+
serializeSourceMapManifestTs,
|
|
135
|
+
serializeSymbolicationManifestJson,
|
|
136
|
+
serializeSymbolicationManifestTs,
|
|
137
|
+
serializeBuildInfoJson,
|
|
138
|
+
serializeBuildInfoTs,
|
|
139
|
+
serializeLiveProductionManifestJson,
|
|
140
|
+
serializeLiveProductionManifestTs,
|
|
141
|
+
serializeLiveProtocolJson,
|
|
142
|
+
serializeLiveProtocolTs,
|
|
143
|
+
serializeLiveTransportConfigJson,
|
|
144
|
+
serializeLiveTransportConfigTs,
|
|
145
|
+
serializeMakeRegistryJson,
|
|
146
|
+
serializeMakeRegistryTs,
|
|
147
|
+
serializeMakeTemplatesJson,
|
|
148
|
+
serializeMakeTemplatesTs,
|
|
149
|
+
serializeTestGraphJson,
|
|
150
|
+
serializeTestGraphTs,
|
|
151
|
+
serializeTestPlanRegistryJson,
|
|
152
|
+
serializeTestPlanRegistryTs,
|
|
153
|
+
serializeActionSubscriptionsJson,
|
|
154
|
+
serializeActionSubscriptionsTs,
|
|
155
|
+
serializeWorkflowRegistryJson,
|
|
156
|
+
serializeWorkflowRegistryTs,
|
|
157
|
+
serializeWorkflowSubscriptionsJson,
|
|
158
|
+
serializeWorkflowSubscriptionsTs,
|
|
159
|
+
serializeTelemetryRegistryJson,
|
|
160
|
+
serializeTelemetryRegistryTs,
|
|
161
|
+
serializeTelemetrySinksJson,
|
|
162
|
+
serializeTelemetrySinksTs,
|
|
163
|
+
serializePolicyRegistryJson,
|
|
164
|
+
serializePolicyRegistryTs,
|
|
165
|
+
serializePermissionMatrixJson,
|
|
166
|
+
serializePermissionMatrixTs,
|
|
167
|
+
serializeTenantScopeJson,
|
|
168
|
+
serializeTenantScopeTs,
|
|
169
|
+
serializeAuthClaimsJson,
|
|
170
|
+
serializeAuthClaimsTs,
|
|
171
|
+
serializeAuthConfigJson,
|
|
172
|
+
serializeAuthConfigTs,
|
|
173
|
+
serializeAuthContextTs,
|
|
174
|
+
serializeAuthRegistryJson,
|
|
175
|
+
serializeAuthRegistryTs,
|
|
176
|
+
serializeSecretsContextTs,
|
|
177
|
+
serializeSecretRegistryJson,
|
|
178
|
+
serializeSecretRegistryTs,
|
|
179
|
+
serializeEnvSchemaJson,
|
|
180
|
+
serializeEnvSchemaTs,
|
|
181
|
+
serializeConfigRegistryJson,
|
|
182
|
+
serializeConfigRegistryTs,
|
|
183
|
+
serializeAiRegistryJson,
|
|
184
|
+
serializeAiRegistryTs,
|
|
185
|
+
serializeAiProvidersJson,
|
|
186
|
+
serializeAiProvidersTs,
|
|
187
|
+
serializeAiModelsJson,
|
|
188
|
+
serializeAiModelsTs,
|
|
189
|
+
serializeAiContextTs,
|
|
190
|
+
serializeQueryRegistryJson,
|
|
191
|
+
serializeQueryRegistryTs,
|
|
192
|
+
serializeLiveQueryRegistryJson,
|
|
193
|
+
serializeLiveQueryRegistryTs,
|
|
194
|
+
serializeSubscriptionManifestJson,
|
|
195
|
+
serializeSubscriptionManifestTs,
|
|
196
|
+
serializeApiJson,
|
|
197
|
+
serializeApiTsExport,
|
|
198
|
+
serializeServerApiTsExport,
|
|
199
|
+
serializeClientApiTsExport,
|
|
200
|
+
serializeClientManifestJson,
|
|
201
|
+
serializeReactManifestJson,
|
|
202
|
+
buildMockMapEntries,
|
|
203
|
+
} from "./serialize.ts";
|
|
204
|
+
import { buildDefaultAuthRegistry, AUTH_ENV } from "../../runtime/auth/config.ts";
|
|
205
|
+
import type { EnvSchema } from "../types/secret-registry.ts";
|
|
206
|
+
|
|
207
|
+
export interface PlanInput {
|
|
208
|
+
appGraph: AppGraph;
|
|
209
|
+
packageGraph: PackageGraph;
|
|
210
|
+
classified: ClassifiedPackage[];
|
|
211
|
+
ctx: DiscoverContext;
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
function makeEmitFile(path: string, content: string): EmitFile {
|
|
215
|
+
return {
|
|
216
|
+
path,
|
|
217
|
+
content,
|
|
218
|
+
contentHash: hashStable(content),
|
|
219
|
+
canonical: path.endsWith(".json"),
|
|
220
|
+
};
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
function buildLockEntry(pkg: ClassifiedPackage): ForgeLockEntry {
|
|
224
|
+
const recipe = pkg.recipe ?? resolveByPackageName(pkg.api.name);
|
|
225
|
+
const secrets = detectSecrets(pkg.api, recipe ?? undefined);
|
|
226
|
+
const capabilities = detectCapabilities(pkg.api, recipe ?? undefined);
|
|
227
|
+
|
|
228
|
+
return {
|
|
229
|
+
name: pkg.api.name,
|
|
230
|
+
version: pkg.api.version,
|
|
231
|
+
...(recipe?.recipeVersion !== undefined
|
|
232
|
+
? { recipeVersion: recipe.recipeVersion }
|
|
233
|
+
: {}),
|
|
234
|
+
runtimeContexts: [...pkg.classification.compatible],
|
|
235
|
+
capabilities: {
|
|
236
|
+
...capabilities,
|
|
237
|
+
secrets,
|
|
238
|
+
},
|
|
239
|
+
secrets,
|
|
240
|
+
generatedFiles: [],
|
|
241
|
+
contentChecksum: pkg.api.contentChecksum,
|
|
242
|
+
};
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
function buildForgeLock(input: PlanInput): ForgeLock {
|
|
246
|
+
const recipeVersions = input.classified
|
|
247
|
+
.map((pkg) => pkg.recipe?.recipeVersion)
|
|
248
|
+
.filter((version): version is string => version !== undefined);
|
|
249
|
+
|
|
250
|
+
const recipeVersion =
|
|
251
|
+
recipeVersions.length > 0
|
|
252
|
+
? recipeVersions.sort()[0]
|
|
253
|
+
: RECIPE_SCHEMA_VERSION;
|
|
254
|
+
|
|
255
|
+
return {
|
|
256
|
+
schemaVersion: FORGE_LOCK_SCHEMA_VERSION,
|
|
257
|
+
generatorVersion: GENERATOR_VERSION,
|
|
258
|
+
analyzerVersion: PACKAGE_ANALYZER_VERSION,
|
|
259
|
+
inputHash: input.ctx.inputFingerprint,
|
|
260
|
+
lockfileHash: input.ctx.lockfileHash,
|
|
261
|
+
packageManager: input.ctx.packageManager,
|
|
262
|
+
recipeVersion,
|
|
263
|
+
packages: input.classified
|
|
264
|
+
.filter((pkg) => resolveByPackageName(pkg.api.name) !== null)
|
|
265
|
+
.map(buildLockEntry),
|
|
266
|
+
};
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
function augmentEnvSchemaWithAuthVars(schema: EnvSchema): EnvSchema {
|
|
270
|
+
const byName = new Map(schema.variables.map((variable) => [variable.name, variable]));
|
|
271
|
+
for (const name of [
|
|
272
|
+
AUTH_ENV.mode,
|
|
273
|
+
AUTH_ENV.issuer,
|
|
274
|
+
AUTH_ENV.audience,
|
|
275
|
+
AUTH_ENV.jwksUri,
|
|
276
|
+
AUTH_ENV.algorithms,
|
|
277
|
+
]) {
|
|
278
|
+
if (!byName.has(name)) {
|
|
279
|
+
byName.set(name, {
|
|
280
|
+
name,
|
|
281
|
+
kind: "config",
|
|
282
|
+
required: false,
|
|
283
|
+
source: "auth",
|
|
284
|
+
});
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
return {
|
|
288
|
+
variables: [...byName.values()].sort((a, b) => a.name.localeCompare(b.name)),
|
|
289
|
+
};
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
export function plan(input: PlanInput): EmitPlan {
|
|
293
|
+
const matrix = buildRuntimeMatrix(input.classified);
|
|
294
|
+
const dataGraph = buildDataGraph(input.appGraph);
|
|
295
|
+
const sqlPlan = buildSqlPlan(dataGraph);
|
|
296
|
+
const actionSubscriptions = buildActionSubscriptions(input.appGraph);
|
|
297
|
+
const workflowRegistry = buildWorkflowRegistry(input.appGraph);
|
|
298
|
+
const workflowSubscriptions = buildWorkflowSubscriptions(workflowRegistry);
|
|
299
|
+
const telemetryRegistry = buildTelemetryRegistry(input.appGraph);
|
|
300
|
+
const telemetrySinks = buildTelemetrySinks(input.classified);
|
|
301
|
+
const policyRegistry = buildPolicyRegistry(input.appGraph);
|
|
302
|
+
const permissionMatrix = buildPermissionMatrixFromRegistry(policyRegistry);
|
|
303
|
+
const tenantScope = buildTenantScope(dataGraph);
|
|
304
|
+
const secretRegistry = buildSecretRegistry(input.classified);
|
|
305
|
+
const envSchema = augmentEnvSchemaWithAuthVars(
|
|
306
|
+
augmentEnvSchemaWithPublicVars(
|
|
307
|
+
buildEnvSchema(secretRegistry),
|
|
308
|
+
input.classified,
|
|
309
|
+
),
|
|
310
|
+
);
|
|
311
|
+
const configRegistry = buildConfigRegistry(secretRegistry);
|
|
312
|
+
const authRegistry = buildDefaultAuthRegistry(tenantScope.tables.length > 0);
|
|
313
|
+
const aiRegistry = buildAiRegistry(input.appGraph, input.classified);
|
|
314
|
+
const aiModels = buildAiModels();
|
|
315
|
+
const queryRegistry = buildQueryRegistry(input.appGraph);
|
|
316
|
+
const liveQueryRegistry = buildLiveQueryRegistry(input.appGraph);
|
|
317
|
+
const subscriptionManifest = buildSubscriptionManifest(liveQueryRegistry);
|
|
318
|
+
const runtimeGraph = buildRuntimeGraph(input.appGraph);
|
|
319
|
+
const apiSurface = buildApiSurface(
|
|
320
|
+
runtimeGraph,
|
|
321
|
+
queryRegistry,
|
|
322
|
+
liveQueryRegistry,
|
|
323
|
+
workflowRegistry,
|
|
324
|
+
);
|
|
325
325
|
const clientManifest = buildClientManifest(apiSurface, input.classified);
|
|
326
326
|
const reactManifest = buildReactManifest(clientManifest);
|
|
327
327
|
const frontendGraph = buildFrontendGraph({
|
|
@@ -329,75 +329,75 @@ export function plan(input: PlanInput): EmitPlan {
|
|
|
329
329
|
clientManifest,
|
|
330
330
|
});
|
|
331
331
|
const devManifest = buildDevManifest(runtimeGraph, queryRegistry, input.appGraph);
|
|
332
|
-
const mockMapEntries = buildMockMapEntries(input.classified);
|
|
333
|
-
const agentArtifacts = buildAgentContractArtifacts({
|
|
334
|
-
workspaceRoot: input.ctx.workspaceRoot,
|
|
335
|
-
appGraph: input.appGraph,
|
|
336
|
-
packageGraph: input.packageGraph,
|
|
337
|
-
classified: input.classified,
|
|
338
|
-
runtimeGraph,
|
|
339
|
-
dataGraph,
|
|
340
|
-
policyRegistry,
|
|
341
|
-
permissionMatrix,
|
|
342
|
-
tenantScope,
|
|
343
|
-
secretRegistry,
|
|
344
|
-
telemetryRegistry,
|
|
345
|
-
telemetrySinks,
|
|
346
|
-
aiRegistry,
|
|
347
|
-
queryRegistry,
|
|
348
|
-
liveQueryRegistry,
|
|
349
|
-
workflowRegistry,
|
|
332
|
+
const mockMapEntries = buildMockMapEntries(input.classified);
|
|
333
|
+
const agentArtifacts = buildAgentContractArtifacts({
|
|
334
|
+
workspaceRoot: input.ctx.workspaceRoot,
|
|
335
|
+
appGraph: input.appGraph,
|
|
336
|
+
packageGraph: input.packageGraph,
|
|
337
|
+
classified: input.classified,
|
|
338
|
+
runtimeGraph,
|
|
339
|
+
dataGraph,
|
|
340
|
+
policyRegistry,
|
|
341
|
+
permissionMatrix,
|
|
342
|
+
tenantScope,
|
|
343
|
+
secretRegistry,
|
|
344
|
+
telemetryRegistry,
|
|
345
|
+
telemetrySinks,
|
|
346
|
+
aiRegistry,
|
|
347
|
+
queryRegistry,
|
|
348
|
+
liveQueryRegistry,
|
|
349
|
+
workflowRegistry,
|
|
350
350
|
apiSurface,
|
|
351
351
|
clientManifest,
|
|
352
352
|
frontendGraph,
|
|
353
353
|
});
|
|
354
|
-
const agentAdapterManifest = buildAgentAdapterManifest(agentArtifacts.contract);
|
|
355
|
-
const rlsArtifacts = buildRlsArtifacts(sqlPlan, tenantScope);
|
|
356
|
-
const packageUpgradeRegistry = {
|
|
357
|
-
schemaVersion: "0.1.0" as const,
|
|
358
|
-
plannerVersion: GENERATOR_VERSION,
|
|
359
|
-
commands: [
|
|
360
|
-
"forge deps outdated --json",
|
|
361
|
-
"forge deps inspect <package> --json",
|
|
362
|
-
"forge deps diff <package> --to latest --json",
|
|
363
|
-
"forge deps upgrade-plan <package> --to latest",
|
|
364
|
-
"forge deps upgrade-apply <plan>",
|
|
365
|
-
"forge deps upgrade-check --json",
|
|
366
|
-
"forge deps upgrade-rollback <planId>",
|
|
367
|
-
],
|
|
368
|
-
planDirectory: ".forge/upgrades" as const,
|
|
369
|
-
};
|
|
370
|
-
const releaseArtifacts = buildGeneratedReleaseArtifacts({
|
|
371
|
-
workspaceRoot: input.ctx.workspaceRoot,
|
|
372
|
-
generatedHash: input.ctx.inputFingerprint,
|
|
373
|
-
});
|
|
374
|
-
const liveProductionArtifacts = buildLiveProductionArtifacts(liveQueryRegistry);
|
|
375
|
-
const makeRegistry = buildMakeRegistry(GENERATOR_VERSION);
|
|
376
|
-
const makeTemplates = buildMakeTemplates();
|
|
377
|
-
const testGraph = buildTestGraph({
|
|
378
|
-
workspaceRoot: input.ctx.workspaceRoot,
|
|
379
|
-
inputHash: input.ctx.inputFingerprint,
|
|
380
|
-
appGraph: input.appGraph,
|
|
381
|
-
packageGraph: input.packageGraph,
|
|
382
|
-
sources: input.ctx.sources,
|
|
383
|
-
});
|
|
384
|
-
const testPlanRegistry = buildTestPlanRegistry();
|
|
385
|
-
const uiArtifacts = buildUiGeneratedArtifacts({
|
|
386
|
-
appGraph: input.appGraph,
|
|
387
|
-
apiSurface,
|
|
388
|
-
sources: input.ctx.sources,
|
|
389
|
-
});
|
|
390
|
-
|
|
391
|
-
const files: EmitFile[] = [
|
|
392
|
-
makeEmitFile("AGENTS.md", agentArtifacts.agentsMd),
|
|
393
|
-
makeEmitFile(
|
|
394
|
-
`${GENERATED_DIR}/agentContract.ts`,
|
|
395
|
-
serializeAgentContractTs(agentArtifacts.contract),
|
|
396
|
-
),
|
|
397
|
-
makeEmitFile(
|
|
398
|
-
`${GENERATED_DIR}/agentContract.json`,
|
|
399
|
-
serializeAgentContractJson(agentArtifacts.contract),
|
|
400
|
-
),
|
|
354
|
+
const agentAdapterManifest = buildAgentAdapterManifest(agentArtifacts.contract);
|
|
355
|
+
const rlsArtifacts = buildRlsArtifacts(sqlPlan, tenantScope);
|
|
356
|
+
const packageUpgradeRegistry = {
|
|
357
|
+
schemaVersion: "0.1.0" as const,
|
|
358
|
+
plannerVersion: GENERATOR_VERSION,
|
|
359
|
+
commands: [
|
|
360
|
+
"forge deps outdated --json",
|
|
361
|
+
"forge deps inspect <package> --json",
|
|
362
|
+
"forge deps diff <package> --to latest --json",
|
|
363
|
+
"forge deps upgrade-plan <package> --to latest",
|
|
364
|
+
"forge deps upgrade-apply <plan>",
|
|
365
|
+
"forge deps upgrade-check --json",
|
|
366
|
+
"forge deps upgrade-rollback <planId>",
|
|
367
|
+
],
|
|
368
|
+
planDirectory: ".forge/upgrades" as const,
|
|
369
|
+
};
|
|
370
|
+
const releaseArtifacts = buildGeneratedReleaseArtifacts({
|
|
371
|
+
workspaceRoot: input.ctx.workspaceRoot,
|
|
372
|
+
generatedHash: input.ctx.inputFingerprint,
|
|
373
|
+
});
|
|
374
|
+
const liveProductionArtifacts = buildLiveProductionArtifacts(liveQueryRegistry);
|
|
375
|
+
const makeRegistry = buildMakeRegistry(GENERATOR_VERSION);
|
|
376
|
+
const makeTemplates = buildMakeTemplates();
|
|
377
|
+
const testGraph = buildTestGraph({
|
|
378
|
+
workspaceRoot: input.ctx.workspaceRoot,
|
|
379
|
+
inputHash: input.ctx.inputFingerprint,
|
|
380
|
+
appGraph: input.appGraph,
|
|
381
|
+
packageGraph: input.packageGraph,
|
|
382
|
+
sources: input.ctx.sources,
|
|
383
|
+
});
|
|
384
|
+
const testPlanRegistry = buildTestPlanRegistry();
|
|
385
|
+
const uiArtifacts = buildUiGeneratedArtifacts({
|
|
386
|
+
appGraph: input.appGraph,
|
|
387
|
+
apiSurface,
|
|
388
|
+
sources: input.ctx.sources,
|
|
389
|
+
});
|
|
390
|
+
|
|
391
|
+
const files: EmitFile[] = [
|
|
392
|
+
makeEmitFile("AGENTS.md", agentArtifacts.agentsMd),
|
|
393
|
+
makeEmitFile(
|
|
394
|
+
`${GENERATED_DIR}/agentContract.ts`,
|
|
395
|
+
serializeAgentContractTs(agentArtifacts.contract),
|
|
396
|
+
),
|
|
397
|
+
makeEmitFile(
|
|
398
|
+
`${GENERATED_DIR}/agentContract.json`,
|
|
399
|
+
serializeAgentContractJson(agentArtifacts.contract),
|
|
400
|
+
),
|
|
401
401
|
makeEmitFile(`${GENERATED_DIR}/appMap.md`, agentArtifacts.appMapMd),
|
|
402
402
|
makeEmitFile(
|
|
403
403
|
`${GENERATED_DIR}/capabilityMap.ts`,
|
|
@@ -409,18 +409,18 @@ export function plan(input: PlanInput): EmitPlan {
|
|
|
409
409
|
),
|
|
410
410
|
makeEmitFile(`${GENERATED_DIR}/capabilityMap.md`, agentArtifacts.capabilityMapMd),
|
|
411
411
|
makeEmitFile(`${GENERATED_DIR}/runtimeRules.md`, agentArtifacts.runtimeRulesMd),
|
|
412
|
-
makeEmitFile(
|
|
413
|
-
`${GENERATED_DIR}/operationPlaybooks.md`,
|
|
414
|
-
agentArtifacts.operationPlaybooksMd,
|
|
415
|
-
),
|
|
416
|
-
makeEmitFile(
|
|
417
|
-
`${GENERATED_DIR}/agentQuickstart.md`,
|
|
418
|
-
agentArtifacts.agentQuickstartMd,
|
|
419
|
-
),
|
|
420
|
-
makeEmitFile(
|
|
421
|
-
`${GENERATED_DIR}/agentAdapterManifest.ts`,
|
|
422
|
-
serializeAgentAdapterManifestTs(agentAdapterManifest),
|
|
423
|
-
),
|
|
412
|
+
makeEmitFile(
|
|
413
|
+
`${GENERATED_DIR}/operationPlaybooks.md`,
|
|
414
|
+
agentArtifacts.operationPlaybooksMd,
|
|
415
|
+
),
|
|
416
|
+
makeEmitFile(
|
|
417
|
+
`${GENERATED_DIR}/agentQuickstart.md`,
|
|
418
|
+
agentArtifacts.agentQuickstartMd,
|
|
419
|
+
),
|
|
420
|
+
makeEmitFile(
|
|
421
|
+
`${GENERATED_DIR}/agentAdapterManifest.ts`,
|
|
422
|
+
serializeAgentAdapterManifestTs(agentAdapterManifest),
|
|
423
|
+
),
|
|
424
424
|
makeEmitFile(
|
|
425
425
|
`${GENERATED_DIR}/agentAdapterManifest.json`,
|
|
426
426
|
serializeAgentAdapterManifestJson(agentAdapterManifest),
|
|
@@ -435,427 +435,427 @@ export function plan(input: PlanInput): EmitPlan {
|
|
|
435
435
|
),
|
|
436
436
|
makeEmitFile(
|
|
437
437
|
`${GENERATED_DIR}/appGraph.ts`,
|
|
438
|
-
serializeAppGraphTs(input.appGraph),
|
|
439
|
-
),
|
|
440
|
-
makeEmitFile(
|
|
441
|
-
`${GENERATED_DIR}/appGraph.json`,
|
|
442
|
-
serializeAppGraphJson(input.appGraph),
|
|
443
|
-
),
|
|
444
|
-
makeEmitFile(
|
|
445
|
-
`${GENERATED_DIR}/packageGraph.ts`,
|
|
446
|
-
serializePackageGraphTs(input.packageGraph),
|
|
447
|
-
),
|
|
448
|
-
makeEmitFile(
|
|
449
|
-
`${GENERATED_DIR}/packageGraph.json`,
|
|
450
|
-
serializePackageGraphJson(input.packageGraph),
|
|
451
|
-
),
|
|
452
|
-
makeEmitFile(
|
|
453
|
-
`${GENERATED_DIR}/runtimeMatrix.ts`,
|
|
454
|
-
serializeRuntimeMatrixTs(matrix),
|
|
455
|
-
),
|
|
456
|
-
makeEmitFile(
|
|
457
|
-
`${GENERATED_DIR}/runtimeMatrix.json`,
|
|
458
|
-
serializeRuntimeMatrixJson(matrix),
|
|
459
|
-
),
|
|
460
|
-
makeEmitFile(
|
|
461
|
-
`${GENERATED_DIR}/importGuards.ts`,
|
|
462
|
-
serializeImportGuardsTs(matrix, input.appGraph.moduleGraph),
|
|
463
|
-
),
|
|
464
|
-
makeEmitFile(
|
|
465
|
-
`${GENERATED_DIR}/importGuards.json`,
|
|
466
|
-
serializeImportGuardsJson(matrix, input.appGraph.moduleGraph),
|
|
467
|
-
),
|
|
468
|
-
makeEmitFile(
|
|
469
|
-
`${GENERATED_DIR}/dataGraph.ts`,
|
|
470
|
-
serializeDataGraphTs(dataGraph),
|
|
471
|
-
),
|
|
472
|
-
makeEmitFile(
|
|
473
|
-
`${GENERATED_DIR}/dataGraph.json`,
|
|
474
|
-
serializeDataGraphJson(dataGraph),
|
|
475
|
-
),
|
|
476
|
-
makeEmitFile(
|
|
477
|
-
`${GENERATED_DIR}/runtimeGraph.ts`,
|
|
478
|
-
serializeRuntimeGraphTs(runtimeGraph),
|
|
479
|
-
),
|
|
480
|
-
makeEmitFile(
|
|
481
|
-
`${GENERATED_DIR}/runtimeGraph.json`,
|
|
482
|
-
serializeRuntimeGraphJson(runtimeGraph),
|
|
483
|
-
),
|
|
484
|
-
makeEmitFile(
|
|
485
|
-
`${GENERATED_DIR}/runtimeRegistry.ts`,
|
|
486
|
-
serializeRuntimeRegistryTs(runtimeGraph),
|
|
487
|
-
),
|
|
488
|
-
makeEmitFile(
|
|
489
|
-
`${GENERATED_DIR}/mockMap.ts`,
|
|
490
|
-
serializeMockMapTs(mockMapEntries),
|
|
491
|
-
),
|
|
492
|
-
makeEmitFile(
|
|
493
|
-
`${GENERATED_DIR}/mockMap.json`,
|
|
494
|
-
serializeMockMapJson(mockMapEntries),
|
|
495
|
-
),
|
|
496
|
-
makeEmitFile(
|
|
497
|
-
`${GENERATED_DIR}/devManifest.ts`,
|
|
498
|
-
serializeDevManifestTs(devManifest),
|
|
499
|
-
),
|
|
500
|
-
makeEmitFile(
|
|
501
|
-
`${GENERATED_DIR}/devManifest.json`,
|
|
502
|
-
serializeDevManifestJson(devManifest),
|
|
503
|
-
),
|
|
504
|
-
makeEmitFile(
|
|
505
|
-
`${GENERATED_DIR}/sqlPlan.ts`,
|
|
506
|
-
serializeSqlPlanTsExport(sqlPlan),
|
|
507
|
-
),
|
|
508
|
-
makeEmitFile(
|
|
509
|
-
`${GENERATED_DIR}/sqlPlan.json`,
|
|
510
|
-
serializeSqlPlanJsonExport(sqlPlan),
|
|
511
|
-
),
|
|
512
|
-
makeEmitFile(`${GENERATED_DIR}/db.ts`, serializeDbTsExport(sqlPlan, tenantScope)),
|
|
513
|
-
makeEmitFile(`${GENERATED_DIR}/db.json`, serializeDbJsonExport(sqlPlan, tenantScope)),
|
|
514
|
-
makeEmitFile(
|
|
515
|
-
`${GENERATED_DIR}/rlsPolicies.sql`,
|
|
516
|
-
serializeRlsPoliciesSql(rlsArtifacts.policies),
|
|
517
|
-
),
|
|
518
|
-
makeEmitFile(
|
|
519
|
-
`${GENERATED_DIR}/rlsPolicies.ts`,
|
|
520
|
-
serializeRlsPoliciesTs(rlsArtifacts.policies),
|
|
521
|
-
),
|
|
522
|
-
makeEmitFile(
|
|
523
|
-
`${GENERATED_DIR}/rlsPolicies.json`,
|
|
524
|
-
serializeRlsPoliciesJson(rlsArtifacts.policies),
|
|
525
|
-
),
|
|
526
|
-
makeEmitFile(
|
|
527
|
-
`${GENERATED_DIR}/dbSecurityManifest.ts`,
|
|
528
|
-
serializeDbSecurityManifestTs(rlsArtifacts.dbSecurityManifest),
|
|
529
|
-
),
|
|
530
|
-
makeEmitFile(
|
|
531
|
-
`${GENERATED_DIR}/dbSecurityManifest.json`,
|
|
532
|
-
serializeDbSecurityManifestJson(rlsArtifacts.dbSecurityManifest),
|
|
533
|
-
),
|
|
534
|
-
makeEmitFile(
|
|
535
|
-
`${GENERATED_DIR}/dbSessionContext.ts`,
|
|
536
|
-
serializeDbSessionContextTs(rlsArtifacts.dbSessionContext),
|
|
537
|
-
),
|
|
538
|
-
makeEmitFile(
|
|
539
|
-
`${GENERATED_DIR}/dbSessionContext.json`,
|
|
540
|
-
serializeDbSessionContextJson(rlsArtifacts.dbSessionContext),
|
|
541
|
-
),
|
|
542
|
-
makeEmitFile(
|
|
543
|
-
`${GENERATED_DIR}/packageUpgradeRegistry.ts`,
|
|
544
|
-
serializePackageUpgradeRegistryTs(packageUpgradeRegistry),
|
|
545
|
-
),
|
|
546
|
-
makeEmitFile(
|
|
547
|
-
`${GENERATED_DIR}/packageUpgradeRegistry.json`,
|
|
548
|
-
serializePackageUpgradeRegistryJson(packageUpgradeRegistry),
|
|
549
|
-
),
|
|
550
|
-
makeEmitFile(
|
|
551
|
-
`${GENERATED_DIR}/releaseManifest.ts`,
|
|
552
|
-
serializeReleaseManifestTs(releaseArtifacts.releaseManifest),
|
|
553
|
-
),
|
|
554
|
-
makeEmitFile(
|
|
555
|
-
`${GENERATED_DIR}/releaseManifest.json`,
|
|
556
|
-
serializeReleaseManifestJson(releaseArtifacts.releaseManifest),
|
|
557
|
-
),
|
|
558
|
-
makeEmitFile(
|
|
559
|
-
`${GENERATED_DIR}/deployManifest.ts`,
|
|
560
|
-
serializeDeployManifestTs(releaseArtifacts.deployManifest),
|
|
561
|
-
),
|
|
562
|
-
makeEmitFile(
|
|
563
|
-
`${GENERATED_DIR}/deployManifest.json`,
|
|
564
|
-
serializeDeployManifestJson(releaseArtifacts.deployManifest),
|
|
565
|
-
),
|
|
566
|
-
makeEmitFile(
|
|
567
|
-
`${GENERATED_DIR}/artifactManifest.ts`,
|
|
568
|
-
serializeArtifactManifestTs(releaseArtifacts.artifactManifest),
|
|
569
|
-
),
|
|
570
|
-
makeEmitFile(
|
|
571
|
-
`${GENERATED_DIR}/artifactManifest.json`,
|
|
572
|
-
serializeArtifactManifestJson(releaseArtifacts.artifactManifest),
|
|
573
|
-
),
|
|
574
|
-
makeEmitFile(
|
|
575
|
-
`${GENERATED_DIR}/sourceMapManifest.ts`,
|
|
576
|
-
serializeSourceMapManifestTs(releaseArtifacts.sourceMapManifest),
|
|
577
|
-
),
|
|
578
|
-
makeEmitFile(
|
|
579
|
-
`${GENERATED_DIR}/sourceMapManifest.json`,
|
|
580
|
-
serializeSourceMapManifestJson(releaseArtifacts.sourceMapManifest),
|
|
581
|
-
),
|
|
582
|
-
makeEmitFile(
|
|
583
|
-
`${GENERATED_DIR}/symbolicationManifest.ts`,
|
|
584
|
-
serializeSymbolicationManifestTs(releaseArtifacts.symbolicationManifest),
|
|
585
|
-
),
|
|
586
|
-
makeEmitFile(
|
|
587
|
-
`${GENERATED_DIR}/symbolicationManifest.json`,
|
|
588
|
-
serializeSymbolicationManifestJson(releaseArtifacts.symbolicationManifest),
|
|
589
|
-
),
|
|
590
|
-
makeEmitFile(
|
|
591
|
-
`${GENERATED_DIR}/buildInfo.ts`,
|
|
592
|
-
serializeBuildInfoTs(releaseArtifacts.buildInfo),
|
|
593
|
-
),
|
|
594
|
-
makeEmitFile(
|
|
595
|
-
`${GENERATED_DIR}/buildInfo.json`,
|
|
596
|
-
serializeBuildInfoJson(releaseArtifacts.buildInfo),
|
|
597
|
-
),
|
|
598
|
-
makeEmitFile(
|
|
599
|
-
`${GENERATED_DIR}/liveProductionManifest.ts`,
|
|
600
|
-
serializeLiveProductionManifestTs(liveProductionArtifacts.liveProductionManifest),
|
|
601
|
-
),
|
|
602
|
-
makeEmitFile(
|
|
603
|
-
`${GENERATED_DIR}/liveProductionManifest.json`,
|
|
604
|
-
serializeLiveProductionManifestJson(liveProductionArtifacts.liveProductionManifest),
|
|
605
|
-
),
|
|
606
|
-
makeEmitFile(
|
|
607
|
-
`${GENERATED_DIR}/liveProtocol.ts`,
|
|
608
|
-
serializeLiveProtocolTs(liveProductionArtifacts.liveProtocol),
|
|
609
|
-
),
|
|
610
|
-
makeEmitFile(
|
|
611
|
-
`${GENERATED_DIR}/liveProtocol.json`,
|
|
612
|
-
serializeLiveProtocolJson(liveProductionArtifacts.liveProtocol),
|
|
613
|
-
),
|
|
614
|
-
makeEmitFile(
|
|
615
|
-
`${GENERATED_DIR}/liveTransportConfig.ts`,
|
|
616
|
-
serializeLiveTransportConfigTs(liveProductionArtifacts.liveTransportConfig),
|
|
617
|
-
),
|
|
618
|
-
makeEmitFile(
|
|
619
|
-
`${GENERATED_DIR}/liveTransportConfig.json`,
|
|
620
|
-
serializeLiveTransportConfigJson(liveProductionArtifacts.liveTransportConfig),
|
|
621
|
-
),
|
|
622
|
-
makeEmitFile(
|
|
623
|
-
`${GENERATED_DIR}/makeRegistry.ts`,
|
|
624
|
-
serializeMakeRegistryTs(makeRegistry),
|
|
625
|
-
),
|
|
626
|
-
makeEmitFile(
|
|
627
|
-
`${GENERATED_DIR}/makeRegistry.json`,
|
|
628
|
-
serializeMakeRegistryJson(makeRegistry),
|
|
629
|
-
),
|
|
630
|
-
makeEmitFile(
|
|
631
|
-
`${GENERATED_DIR}/makeTemplates.ts`,
|
|
632
|
-
serializeMakeTemplatesTs(makeTemplates),
|
|
633
|
-
),
|
|
634
|
-
makeEmitFile(
|
|
635
|
-
`${GENERATED_DIR}/makeTemplates.json`,
|
|
636
|
-
serializeMakeTemplatesJson(makeTemplates),
|
|
637
|
-
),
|
|
638
|
-
makeEmitFile(
|
|
639
|
-
`${GENERATED_DIR}/testGraph.ts`,
|
|
640
|
-
serializeTestGraphTs(testGraph),
|
|
641
|
-
),
|
|
642
|
-
makeEmitFile(
|
|
643
|
-
`${GENERATED_DIR}/testGraph.json`,
|
|
644
|
-
serializeTestGraphJson(testGraph),
|
|
645
|
-
),
|
|
646
|
-
makeEmitFile(
|
|
647
|
-
`${GENERATED_DIR}/testPlanRegistry.ts`,
|
|
648
|
-
serializeTestPlanRegistryTs(testPlanRegistry),
|
|
649
|
-
),
|
|
650
|
-
makeEmitFile(
|
|
651
|
-
`${GENERATED_DIR}/testPlanRegistry.json`,
|
|
652
|
-
serializeTestPlanRegistryJson(testPlanRegistry),
|
|
653
|
-
),
|
|
654
|
-
makeEmitFile(
|
|
655
|
-
`${GENERATED_DIR}/uiTestManifest.ts`,
|
|
656
|
-
serializeUiTestManifestTs(uiArtifacts.manifest),
|
|
657
|
-
),
|
|
658
|
-
makeEmitFile(
|
|
659
|
-
`${GENERATED_DIR}/uiTestManifest.json`,
|
|
660
|
-
serializeUiTestManifestJson(uiArtifacts.manifest),
|
|
661
|
-
),
|
|
662
|
-
makeEmitFile(
|
|
663
|
-
`${GENERATED_DIR}/uiScenarios.ts`,
|
|
664
|
-
serializeUiScenariosTs(uiArtifacts.scenarios),
|
|
665
|
-
),
|
|
666
|
-
makeEmitFile(
|
|
667
|
-
`${GENERATED_DIR}/uiScenarios.json`,
|
|
668
|
-
serializeUiScenariosJson(uiArtifacts.scenarios),
|
|
669
|
-
),
|
|
670
|
-
makeEmitFile(
|
|
671
|
-
`${GENERATED_DIR}/uiRoutes.ts`,
|
|
672
|
-
serializeUiRoutesTs(uiArtifacts.routes),
|
|
673
|
-
),
|
|
674
|
-
makeEmitFile(
|
|
675
|
-
`${GENERATED_DIR}/uiRoutes.json`,
|
|
676
|
-
serializeUiRoutesJson(uiArtifacts.routes),
|
|
677
|
-
),
|
|
678
|
-
makeEmitFile(
|
|
679
|
-
`${GENERATED_DIR}/actionSubscriptions.ts`,
|
|
680
|
-
serializeActionSubscriptionsTs(actionSubscriptions),
|
|
681
|
-
),
|
|
682
|
-
makeEmitFile(
|
|
683
|
-
`${GENERATED_DIR}/actionSubscriptions.json`,
|
|
684
|
-
serializeActionSubscriptionsJson(actionSubscriptions),
|
|
685
|
-
),
|
|
686
|
-
makeEmitFile(
|
|
687
|
-
`${GENERATED_DIR}/workflowRegistry.ts`,
|
|
688
|
-
serializeWorkflowRegistryTs(workflowRegistry),
|
|
689
|
-
),
|
|
690
|
-
makeEmitFile(
|
|
691
|
-
`${GENERATED_DIR}/workflowRegistry.json`,
|
|
692
|
-
serializeWorkflowRegistryJson(workflowRegistry),
|
|
693
|
-
),
|
|
694
|
-
makeEmitFile(
|
|
695
|
-
`${GENERATED_DIR}/workflowSubscriptions.ts`,
|
|
696
|
-
serializeWorkflowSubscriptionsTs(workflowSubscriptions),
|
|
697
|
-
),
|
|
698
|
-
makeEmitFile(
|
|
699
|
-
`${GENERATED_DIR}/workflowSubscriptions.json`,
|
|
700
|
-
serializeWorkflowSubscriptionsJson(workflowSubscriptions),
|
|
701
|
-
),
|
|
702
|
-
makeEmitFile(
|
|
703
|
-
`${GENERATED_DIR}/telemetryRegistry.ts`,
|
|
704
|
-
serializeTelemetryRegistryTs(telemetryRegistry),
|
|
705
|
-
),
|
|
706
|
-
makeEmitFile(
|
|
707
|
-
`${GENERATED_DIR}/telemetryRegistry.json`,
|
|
708
|
-
serializeTelemetryRegistryJson(telemetryRegistry),
|
|
709
|
-
),
|
|
710
|
-
makeEmitFile(
|
|
711
|
-
`${GENERATED_DIR}/telemetrySinks.ts`,
|
|
712
|
-
serializeTelemetrySinksTs(telemetrySinks),
|
|
713
|
-
),
|
|
714
|
-
makeEmitFile(
|
|
715
|
-
`${GENERATED_DIR}/telemetrySinks.json`,
|
|
716
|
-
serializeTelemetrySinksJson(telemetrySinks),
|
|
717
|
-
),
|
|
718
|
-
makeEmitFile(
|
|
719
|
-
`${GENERATED_DIR}/policyRegistry.ts`,
|
|
720
|
-
serializePolicyRegistryTs(policyRegistry),
|
|
721
|
-
),
|
|
722
|
-
makeEmitFile(
|
|
723
|
-
`${GENERATED_DIR}/policyRegistry.json`,
|
|
724
|
-
serializePolicyRegistryJson(policyRegistry),
|
|
725
|
-
),
|
|
726
|
-
makeEmitFile(
|
|
727
|
-
`${GENERATED_DIR}/permissionMatrix.ts`,
|
|
728
|
-
serializePermissionMatrixTs(permissionMatrix),
|
|
729
|
-
),
|
|
730
|
-
makeEmitFile(
|
|
731
|
-
`${GENERATED_DIR}/permissionMatrix.json`,
|
|
732
|
-
serializePermissionMatrixJson(permissionMatrix),
|
|
733
|
-
),
|
|
734
|
-
makeEmitFile(
|
|
735
|
-
`${GENERATED_DIR}/tenantScope.ts`,
|
|
736
|
-
serializeTenantScopeTs(tenantScope),
|
|
737
|
-
),
|
|
738
|
-
makeEmitFile(
|
|
739
|
-
`${GENERATED_DIR}/tenantScope.json`,
|
|
740
|
-
serializeTenantScopeJson(tenantScope),
|
|
741
|
-
),
|
|
742
|
-
makeEmitFile(
|
|
743
|
-
`${GENERATED_DIR}/authRegistry.ts`,
|
|
744
|
-
serializeAuthRegistryTs(authRegistry),
|
|
745
|
-
),
|
|
746
|
-
makeEmitFile(
|
|
747
|
-
`${GENERATED_DIR}/authRegistry.json`,
|
|
748
|
-
serializeAuthRegistryJson(authRegistry),
|
|
749
|
-
),
|
|
750
|
-
makeEmitFile(
|
|
751
|
-
`${GENERATED_DIR}/authConfig.ts`,
|
|
752
|
-
serializeAuthConfigTs(authRegistry),
|
|
753
|
-
),
|
|
754
|
-
makeEmitFile(
|
|
755
|
-
`${GENERATED_DIR}/authConfig.json`,
|
|
756
|
-
serializeAuthConfigJson(authRegistry),
|
|
757
|
-
),
|
|
758
|
-
makeEmitFile(
|
|
759
|
-
`${GENERATED_DIR}/authClaims.ts`,
|
|
760
|
-
serializeAuthClaimsTs(authRegistry),
|
|
761
|
-
),
|
|
762
|
-
makeEmitFile(
|
|
763
|
-
`${GENERATED_DIR}/authClaims.json`,
|
|
764
|
-
serializeAuthClaimsJson(authRegistry),
|
|
765
|
-
),
|
|
766
|
-
makeEmitFile(`${GENERATED_DIR}/authContext.ts`, serializeAuthContextTs()),
|
|
767
|
-
makeEmitFile(`${GENERATED_DIR}/secretsContext.ts`, serializeSecretsContextTs()),
|
|
768
|
-
makeEmitFile(
|
|
769
|
-
`${GENERATED_DIR}/secretRegistry.ts`,
|
|
770
|
-
serializeSecretRegistryTs(secretRegistry),
|
|
771
|
-
),
|
|
772
|
-
makeEmitFile(
|
|
773
|
-
`${GENERATED_DIR}/secretRegistry.json`,
|
|
774
|
-
serializeSecretRegistryJson(secretRegistry),
|
|
775
|
-
),
|
|
776
|
-
makeEmitFile(`${GENERATED_DIR}/envSchema.ts`, serializeEnvSchemaTs(envSchema)),
|
|
777
|
-
makeEmitFile(`${GENERATED_DIR}/envSchema.json`, serializeEnvSchemaJson(envSchema)),
|
|
778
|
-
makeEmitFile(
|
|
779
|
-
`${GENERATED_DIR}/configRegistry.ts`,
|
|
780
|
-
serializeConfigRegistryTs(configRegistry),
|
|
781
|
-
),
|
|
782
|
-
makeEmitFile(
|
|
783
|
-
`${GENERATED_DIR}/configRegistry.json`,
|
|
784
|
-
serializeConfigRegistryJson(configRegistry),
|
|
785
|
-
),
|
|
786
|
-
makeEmitFile(
|
|
787
|
-
`${GENERATED_DIR}/aiRegistry.ts`,
|
|
788
|
-
serializeAiRegistryTs(aiRegistry),
|
|
789
|
-
),
|
|
790
|
-
makeEmitFile(
|
|
791
|
-
`${GENERATED_DIR}/aiRegistry.json`,
|
|
792
|
-
serializeAiRegistryJson(aiRegistry),
|
|
793
|
-
),
|
|
794
|
-
makeEmitFile(
|
|
795
|
-
`${GENERATED_DIR}/aiProviders.ts`,
|
|
796
|
-
serializeAiProvidersTs(aiRegistry),
|
|
797
|
-
),
|
|
798
|
-
makeEmitFile(
|
|
799
|
-
`${GENERATED_DIR}/aiProviders.json`,
|
|
800
|
-
serializeAiProvidersJson(aiRegistry),
|
|
801
|
-
),
|
|
802
|
-
makeEmitFile(`${GENERATED_DIR}/aiModels.ts`, serializeAiModelsTs(aiModels)),
|
|
803
|
-
makeEmitFile(`${GENERATED_DIR}/aiModels.json`, serializeAiModelsJson(aiModels)),
|
|
804
|
-
makeEmitFile(`${GENERATED_DIR}/aiContext.ts`, serializeAiContextTs()),
|
|
805
|
-
makeEmitFile(
|
|
806
|
-
`${GENERATED_DIR}/queryRegistry.ts`,
|
|
807
|
-
serializeQueryRegistryTs(queryRegistry),
|
|
808
|
-
),
|
|
809
|
-
makeEmitFile(
|
|
810
|
-
`${GENERATED_DIR}/queryRegistry.json`,
|
|
811
|
-
serializeQueryRegistryJson(queryRegistry),
|
|
812
|
-
),
|
|
813
|
-
makeEmitFile(
|
|
814
|
-
`${GENERATED_DIR}/liveQueryRegistry.ts`,
|
|
815
|
-
serializeLiveQueryRegistryTs(liveQueryRegistry),
|
|
816
|
-
),
|
|
817
|
-
makeEmitFile(
|
|
818
|
-
`${GENERATED_DIR}/liveQueryRegistry.json`,
|
|
819
|
-
serializeLiveQueryRegistryJson(liveQueryRegistry),
|
|
820
|
-
),
|
|
821
|
-
makeEmitFile(
|
|
822
|
-
`${GENERATED_DIR}/subscriptionManifest.ts`,
|
|
823
|
-
serializeSubscriptionManifestTs(subscriptionManifest),
|
|
824
|
-
),
|
|
825
|
-
makeEmitFile(
|
|
826
|
-
`${GENERATED_DIR}/subscriptionManifest.json`,
|
|
827
|
-
serializeSubscriptionManifestJson(subscriptionManifest),
|
|
828
|
-
),
|
|
829
|
-
makeEmitFile(`${GENERATED_DIR}/api.ts`, serializeApiTsExport(apiSurface)),
|
|
830
|
-
makeEmitFile(`${GENERATED_DIR}/api.json`, serializeApiJson(apiSurface)),
|
|
831
|
-
makeEmitFile(`${GENERATED_DIR}/serverApi.ts`, serializeServerApiTsExport(apiSurface)),
|
|
832
|
-
makeEmitFile(`${GENERATED_DIR}/clientApi.ts`, serializeClientApiTsExport(apiSurface)),
|
|
833
|
-
makeEmitFile(`${GENERATED_DIR}/clientTypes.ts`, renderClientTypesTs()),
|
|
834
|
-
makeEmitFile(`${GENERATED_DIR}/client.ts`, renderClientTs()),
|
|
835
|
-
makeEmitFile(`${GENERATED_DIR}/clientManifest.ts`, renderClientManifestTs(clientManifest)),
|
|
836
|
-
makeEmitFile(
|
|
837
|
-
`${GENERATED_DIR}/clientManifest.json`,
|
|
838
|
-
serializeClientManifestJson(clientManifest),
|
|
839
|
-
),
|
|
840
|
-
makeEmitFile(`${GENERATED_DIR}/react.ts`, renderReactTs()),
|
|
841
|
-
makeEmitFile(`${GENERATED_DIR}/react.d.ts`, renderReactDts()),
|
|
842
|
-
makeEmitFile(`${GENERATED_DIR}/reactManifest.ts`, renderReactManifestTs(reactManifest)),
|
|
843
|
-
makeEmitFile(
|
|
844
|
-
`${GENERATED_DIR}/reactManifest.json`,
|
|
845
|
-
serializeReactManifestJson(reactManifest),
|
|
846
|
-
),
|
|
847
|
-
];
|
|
848
|
-
|
|
849
|
-
const sortedFiles = stableSortEmitFiles(files);
|
|
850
|
-
const plannedPathSet = new Set(sortedFiles.map((file) => file.path));
|
|
851
|
-
const orphanedFiles = detectOrphanedGeneratedFiles(
|
|
852
|
-
input.ctx.workspaceRoot,
|
|
853
|
-
input.ctx.generatedDir,
|
|
854
|
-
plannedPathSet,
|
|
855
|
-
);
|
|
856
|
-
|
|
857
|
-
const lock = buildForgeLock(input);
|
|
858
|
-
|
|
438
|
+
serializeAppGraphTs(input.appGraph),
|
|
439
|
+
),
|
|
440
|
+
makeEmitFile(
|
|
441
|
+
`${GENERATED_DIR}/appGraph.json`,
|
|
442
|
+
serializeAppGraphJson(input.appGraph),
|
|
443
|
+
),
|
|
444
|
+
makeEmitFile(
|
|
445
|
+
`${GENERATED_DIR}/packageGraph.ts`,
|
|
446
|
+
serializePackageGraphTs(input.packageGraph),
|
|
447
|
+
),
|
|
448
|
+
makeEmitFile(
|
|
449
|
+
`${GENERATED_DIR}/packageGraph.json`,
|
|
450
|
+
serializePackageGraphJson(input.packageGraph),
|
|
451
|
+
),
|
|
452
|
+
makeEmitFile(
|
|
453
|
+
`${GENERATED_DIR}/runtimeMatrix.ts`,
|
|
454
|
+
serializeRuntimeMatrixTs(matrix),
|
|
455
|
+
),
|
|
456
|
+
makeEmitFile(
|
|
457
|
+
`${GENERATED_DIR}/runtimeMatrix.json`,
|
|
458
|
+
serializeRuntimeMatrixJson(matrix),
|
|
459
|
+
),
|
|
460
|
+
makeEmitFile(
|
|
461
|
+
`${GENERATED_DIR}/importGuards.ts`,
|
|
462
|
+
serializeImportGuardsTs(matrix, input.appGraph.moduleGraph),
|
|
463
|
+
),
|
|
464
|
+
makeEmitFile(
|
|
465
|
+
`${GENERATED_DIR}/importGuards.json`,
|
|
466
|
+
serializeImportGuardsJson(matrix, input.appGraph.moduleGraph),
|
|
467
|
+
),
|
|
468
|
+
makeEmitFile(
|
|
469
|
+
`${GENERATED_DIR}/dataGraph.ts`,
|
|
470
|
+
serializeDataGraphTs(dataGraph),
|
|
471
|
+
),
|
|
472
|
+
makeEmitFile(
|
|
473
|
+
`${GENERATED_DIR}/dataGraph.json`,
|
|
474
|
+
serializeDataGraphJson(dataGraph),
|
|
475
|
+
),
|
|
476
|
+
makeEmitFile(
|
|
477
|
+
`${GENERATED_DIR}/runtimeGraph.ts`,
|
|
478
|
+
serializeRuntimeGraphTs(runtimeGraph),
|
|
479
|
+
),
|
|
480
|
+
makeEmitFile(
|
|
481
|
+
`${GENERATED_DIR}/runtimeGraph.json`,
|
|
482
|
+
serializeRuntimeGraphJson(runtimeGraph),
|
|
483
|
+
),
|
|
484
|
+
makeEmitFile(
|
|
485
|
+
`${GENERATED_DIR}/runtimeRegistry.ts`,
|
|
486
|
+
serializeRuntimeRegistryTs(runtimeGraph),
|
|
487
|
+
),
|
|
488
|
+
makeEmitFile(
|
|
489
|
+
`${GENERATED_DIR}/mockMap.ts`,
|
|
490
|
+
serializeMockMapTs(mockMapEntries),
|
|
491
|
+
),
|
|
492
|
+
makeEmitFile(
|
|
493
|
+
`${GENERATED_DIR}/mockMap.json`,
|
|
494
|
+
serializeMockMapJson(mockMapEntries),
|
|
495
|
+
),
|
|
496
|
+
makeEmitFile(
|
|
497
|
+
`${GENERATED_DIR}/devManifest.ts`,
|
|
498
|
+
serializeDevManifestTs(devManifest),
|
|
499
|
+
),
|
|
500
|
+
makeEmitFile(
|
|
501
|
+
`${GENERATED_DIR}/devManifest.json`,
|
|
502
|
+
serializeDevManifestJson(devManifest),
|
|
503
|
+
),
|
|
504
|
+
makeEmitFile(
|
|
505
|
+
`${GENERATED_DIR}/sqlPlan.ts`,
|
|
506
|
+
serializeSqlPlanTsExport(sqlPlan),
|
|
507
|
+
),
|
|
508
|
+
makeEmitFile(
|
|
509
|
+
`${GENERATED_DIR}/sqlPlan.json`,
|
|
510
|
+
serializeSqlPlanJsonExport(sqlPlan),
|
|
511
|
+
),
|
|
512
|
+
makeEmitFile(`${GENERATED_DIR}/db.ts`, serializeDbTsExport(sqlPlan, tenantScope)),
|
|
513
|
+
makeEmitFile(`${GENERATED_DIR}/db.json`, serializeDbJsonExport(sqlPlan, tenantScope)),
|
|
514
|
+
makeEmitFile(
|
|
515
|
+
`${GENERATED_DIR}/rlsPolicies.sql`,
|
|
516
|
+
serializeRlsPoliciesSql(rlsArtifacts.policies),
|
|
517
|
+
),
|
|
518
|
+
makeEmitFile(
|
|
519
|
+
`${GENERATED_DIR}/rlsPolicies.ts`,
|
|
520
|
+
serializeRlsPoliciesTs(rlsArtifacts.policies),
|
|
521
|
+
),
|
|
522
|
+
makeEmitFile(
|
|
523
|
+
`${GENERATED_DIR}/rlsPolicies.json`,
|
|
524
|
+
serializeRlsPoliciesJson(rlsArtifacts.policies),
|
|
525
|
+
),
|
|
526
|
+
makeEmitFile(
|
|
527
|
+
`${GENERATED_DIR}/dbSecurityManifest.ts`,
|
|
528
|
+
serializeDbSecurityManifestTs(rlsArtifacts.dbSecurityManifest),
|
|
529
|
+
),
|
|
530
|
+
makeEmitFile(
|
|
531
|
+
`${GENERATED_DIR}/dbSecurityManifest.json`,
|
|
532
|
+
serializeDbSecurityManifestJson(rlsArtifacts.dbSecurityManifest),
|
|
533
|
+
),
|
|
534
|
+
makeEmitFile(
|
|
535
|
+
`${GENERATED_DIR}/dbSessionContext.ts`,
|
|
536
|
+
serializeDbSessionContextTs(rlsArtifacts.dbSessionContext),
|
|
537
|
+
),
|
|
538
|
+
makeEmitFile(
|
|
539
|
+
`${GENERATED_DIR}/dbSessionContext.json`,
|
|
540
|
+
serializeDbSessionContextJson(rlsArtifacts.dbSessionContext),
|
|
541
|
+
),
|
|
542
|
+
makeEmitFile(
|
|
543
|
+
`${GENERATED_DIR}/packageUpgradeRegistry.ts`,
|
|
544
|
+
serializePackageUpgradeRegistryTs(packageUpgradeRegistry),
|
|
545
|
+
),
|
|
546
|
+
makeEmitFile(
|
|
547
|
+
`${GENERATED_DIR}/packageUpgradeRegistry.json`,
|
|
548
|
+
serializePackageUpgradeRegistryJson(packageUpgradeRegistry),
|
|
549
|
+
),
|
|
550
|
+
makeEmitFile(
|
|
551
|
+
`${GENERATED_DIR}/releaseManifest.ts`,
|
|
552
|
+
serializeReleaseManifestTs(releaseArtifacts.releaseManifest),
|
|
553
|
+
),
|
|
554
|
+
makeEmitFile(
|
|
555
|
+
`${GENERATED_DIR}/releaseManifest.json`,
|
|
556
|
+
serializeReleaseManifestJson(releaseArtifacts.releaseManifest),
|
|
557
|
+
),
|
|
558
|
+
makeEmitFile(
|
|
559
|
+
`${GENERATED_DIR}/deployManifest.ts`,
|
|
560
|
+
serializeDeployManifestTs(releaseArtifacts.deployManifest),
|
|
561
|
+
),
|
|
562
|
+
makeEmitFile(
|
|
563
|
+
`${GENERATED_DIR}/deployManifest.json`,
|
|
564
|
+
serializeDeployManifestJson(releaseArtifacts.deployManifest),
|
|
565
|
+
),
|
|
566
|
+
makeEmitFile(
|
|
567
|
+
`${GENERATED_DIR}/artifactManifest.ts`,
|
|
568
|
+
serializeArtifactManifestTs(releaseArtifacts.artifactManifest),
|
|
569
|
+
),
|
|
570
|
+
makeEmitFile(
|
|
571
|
+
`${GENERATED_DIR}/artifactManifest.json`,
|
|
572
|
+
serializeArtifactManifestJson(releaseArtifacts.artifactManifest),
|
|
573
|
+
),
|
|
574
|
+
makeEmitFile(
|
|
575
|
+
`${GENERATED_DIR}/sourceMapManifest.ts`,
|
|
576
|
+
serializeSourceMapManifestTs(releaseArtifacts.sourceMapManifest),
|
|
577
|
+
),
|
|
578
|
+
makeEmitFile(
|
|
579
|
+
`${GENERATED_DIR}/sourceMapManifest.json`,
|
|
580
|
+
serializeSourceMapManifestJson(releaseArtifacts.sourceMapManifest),
|
|
581
|
+
),
|
|
582
|
+
makeEmitFile(
|
|
583
|
+
`${GENERATED_DIR}/symbolicationManifest.ts`,
|
|
584
|
+
serializeSymbolicationManifestTs(releaseArtifacts.symbolicationManifest),
|
|
585
|
+
),
|
|
586
|
+
makeEmitFile(
|
|
587
|
+
`${GENERATED_DIR}/symbolicationManifest.json`,
|
|
588
|
+
serializeSymbolicationManifestJson(releaseArtifacts.symbolicationManifest),
|
|
589
|
+
),
|
|
590
|
+
makeEmitFile(
|
|
591
|
+
`${GENERATED_DIR}/buildInfo.ts`,
|
|
592
|
+
serializeBuildInfoTs(releaseArtifacts.buildInfo),
|
|
593
|
+
),
|
|
594
|
+
makeEmitFile(
|
|
595
|
+
`${GENERATED_DIR}/buildInfo.json`,
|
|
596
|
+
serializeBuildInfoJson(releaseArtifacts.buildInfo),
|
|
597
|
+
),
|
|
598
|
+
makeEmitFile(
|
|
599
|
+
`${GENERATED_DIR}/liveProductionManifest.ts`,
|
|
600
|
+
serializeLiveProductionManifestTs(liveProductionArtifacts.liveProductionManifest),
|
|
601
|
+
),
|
|
602
|
+
makeEmitFile(
|
|
603
|
+
`${GENERATED_DIR}/liveProductionManifest.json`,
|
|
604
|
+
serializeLiveProductionManifestJson(liveProductionArtifacts.liveProductionManifest),
|
|
605
|
+
),
|
|
606
|
+
makeEmitFile(
|
|
607
|
+
`${GENERATED_DIR}/liveProtocol.ts`,
|
|
608
|
+
serializeLiveProtocolTs(liveProductionArtifacts.liveProtocol),
|
|
609
|
+
),
|
|
610
|
+
makeEmitFile(
|
|
611
|
+
`${GENERATED_DIR}/liveProtocol.json`,
|
|
612
|
+
serializeLiveProtocolJson(liveProductionArtifacts.liveProtocol),
|
|
613
|
+
),
|
|
614
|
+
makeEmitFile(
|
|
615
|
+
`${GENERATED_DIR}/liveTransportConfig.ts`,
|
|
616
|
+
serializeLiveTransportConfigTs(liveProductionArtifacts.liveTransportConfig),
|
|
617
|
+
),
|
|
618
|
+
makeEmitFile(
|
|
619
|
+
`${GENERATED_DIR}/liveTransportConfig.json`,
|
|
620
|
+
serializeLiveTransportConfigJson(liveProductionArtifacts.liveTransportConfig),
|
|
621
|
+
),
|
|
622
|
+
makeEmitFile(
|
|
623
|
+
`${GENERATED_DIR}/makeRegistry.ts`,
|
|
624
|
+
serializeMakeRegistryTs(makeRegistry),
|
|
625
|
+
),
|
|
626
|
+
makeEmitFile(
|
|
627
|
+
`${GENERATED_DIR}/makeRegistry.json`,
|
|
628
|
+
serializeMakeRegistryJson(makeRegistry),
|
|
629
|
+
),
|
|
630
|
+
makeEmitFile(
|
|
631
|
+
`${GENERATED_DIR}/makeTemplates.ts`,
|
|
632
|
+
serializeMakeTemplatesTs(makeTemplates),
|
|
633
|
+
),
|
|
634
|
+
makeEmitFile(
|
|
635
|
+
`${GENERATED_DIR}/makeTemplates.json`,
|
|
636
|
+
serializeMakeTemplatesJson(makeTemplates),
|
|
637
|
+
),
|
|
638
|
+
makeEmitFile(
|
|
639
|
+
`${GENERATED_DIR}/testGraph.ts`,
|
|
640
|
+
serializeTestGraphTs(testGraph),
|
|
641
|
+
),
|
|
642
|
+
makeEmitFile(
|
|
643
|
+
`${GENERATED_DIR}/testGraph.json`,
|
|
644
|
+
serializeTestGraphJson(testGraph),
|
|
645
|
+
),
|
|
646
|
+
makeEmitFile(
|
|
647
|
+
`${GENERATED_DIR}/testPlanRegistry.ts`,
|
|
648
|
+
serializeTestPlanRegistryTs(testPlanRegistry),
|
|
649
|
+
),
|
|
650
|
+
makeEmitFile(
|
|
651
|
+
`${GENERATED_DIR}/testPlanRegistry.json`,
|
|
652
|
+
serializeTestPlanRegistryJson(testPlanRegistry),
|
|
653
|
+
),
|
|
654
|
+
makeEmitFile(
|
|
655
|
+
`${GENERATED_DIR}/uiTestManifest.ts`,
|
|
656
|
+
serializeUiTestManifestTs(uiArtifacts.manifest),
|
|
657
|
+
),
|
|
658
|
+
makeEmitFile(
|
|
659
|
+
`${GENERATED_DIR}/uiTestManifest.json`,
|
|
660
|
+
serializeUiTestManifestJson(uiArtifacts.manifest),
|
|
661
|
+
),
|
|
662
|
+
makeEmitFile(
|
|
663
|
+
`${GENERATED_DIR}/uiScenarios.ts`,
|
|
664
|
+
serializeUiScenariosTs(uiArtifacts.scenarios),
|
|
665
|
+
),
|
|
666
|
+
makeEmitFile(
|
|
667
|
+
`${GENERATED_DIR}/uiScenarios.json`,
|
|
668
|
+
serializeUiScenariosJson(uiArtifacts.scenarios),
|
|
669
|
+
),
|
|
670
|
+
makeEmitFile(
|
|
671
|
+
`${GENERATED_DIR}/uiRoutes.ts`,
|
|
672
|
+
serializeUiRoutesTs(uiArtifacts.routes),
|
|
673
|
+
),
|
|
674
|
+
makeEmitFile(
|
|
675
|
+
`${GENERATED_DIR}/uiRoutes.json`,
|
|
676
|
+
serializeUiRoutesJson(uiArtifacts.routes),
|
|
677
|
+
),
|
|
678
|
+
makeEmitFile(
|
|
679
|
+
`${GENERATED_DIR}/actionSubscriptions.ts`,
|
|
680
|
+
serializeActionSubscriptionsTs(actionSubscriptions),
|
|
681
|
+
),
|
|
682
|
+
makeEmitFile(
|
|
683
|
+
`${GENERATED_DIR}/actionSubscriptions.json`,
|
|
684
|
+
serializeActionSubscriptionsJson(actionSubscriptions),
|
|
685
|
+
),
|
|
686
|
+
makeEmitFile(
|
|
687
|
+
`${GENERATED_DIR}/workflowRegistry.ts`,
|
|
688
|
+
serializeWorkflowRegistryTs(workflowRegistry),
|
|
689
|
+
),
|
|
690
|
+
makeEmitFile(
|
|
691
|
+
`${GENERATED_DIR}/workflowRegistry.json`,
|
|
692
|
+
serializeWorkflowRegistryJson(workflowRegistry),
|
|
693
|
+
),
|
|
694
|
+
makeEmitFile(
|
|
695
|
+
`${GENERATED_DIR}/workflowSubscriptions.ts`,
|
|
696
|
+
serializeWorkflowSubscriptionsTs(workflowSubscriptions),
|
|
697
|
+
),
|
|
698
|
+
makeEmitFile(
|
|
699
|
+
`${GENERATED_DIR}/workflowSubscriptions.json`,
|
|
700
|
+
serializeWorkflowSubscriptionsJson(workflowSubscriptions),
|
|
701
|
+
),
|
|
702
|
+
makeEmitFile(
|
|
703
|
+
`${GENERATED_DIR}/telemetryRegistry.ts`,
|
|
704
|
+
serializeTelemetryRegistryTs(telemetryRegistry),
|
|
705
|
+
),
|
|
706
|
+
makeEmitFile(
|
|
707
|
+
`${GENERATED_DIR}/telemetryRegistry.json`,
|
|
708
|
+
serializeTelemetryRegistryJson(telemetryRegistry),
|
|
709
|
+
),
|
|
710
|
+
makeEmitFile(
|
|
711
|
+
`${GENERATED_DIR}/telemetrySinks.ts`,
|
|
712
|
+
serializeTelemetrySinksTs(telemetrySinks),
|
|
713
|
+
),
|
|
714
|
+
makeEmitFile(
|
|
715
|
+
`${GENERATED_DIR}/telemetrySinks.json`,
|
|
716
|
+
serializeTelemetrySinksJson(telemetrySinks),
|
|
717
|
+
),
|
|
718
|
+
makeEmitFile(
|
|
719
|
+
`${GENERATED_DIR}/policyRegistry.ts`,
|
|
720
|
+
serializePolicyRegistryTs(policyRegistry),
|
|
721
|
+
),
|
|
722
|
+
makeEmitFile(
|
|
723
|
+
`${GENERATED_DIR}/policyRegistry.json`,
|
|
724
|
+
serializePolicyRegistryJson(policyRegistry),
|
|
725
|
+
),
|
|
726
|
+
makeEmitFile(
|
|
727
|
+
`${GENERATED_DIR}/permissionMatrix.ts`,
|
|
728
|
+
serializePermissionMatrixTs(permissionMatrix),
|
|
729
|
+
),
|
|
730
|
+
makeEmitFile(
|
|
731
|
+
`${GENERATED_DIR}/permissionMatrix.json`,
|
|
732
|
+
serializePermissionMatrixJson(permissionMatrix),
|
|
733
|
+
),
|
|
734
|
+
makeEmitFile(
|
|
735
|
+
`${GENERATED_DIR}/tenantScope.ts`,
|
|
736
|
+
serializeTenantScopeTs(tenantScope),
|
|
737
|
+
),
|
|
738
|
+
makeEmitFile(
|
|
739
|
+
`${GENERATED_DIR}/tenantScope.json`,
|
|
740
|
+
serializeTenantScopeJson(tenantScope),
|
|
741
|
+
),
|
|
742
|
+
makeEmitFile(
|
|
743
|
+
`${GENERATED_DIR}/authRegistry.ts`,
|
|
744
|
+
serializeAuthRegistryTs(authRegistry),
|
|
745
|
+
),
|
|
746
|
+
makeEmitFile(
|
|
747
|
+
`${GENERATED_DIR}/authRegistry.json`,
|
|
748
|
+
serializeAuthRegistryJson(authRegistry),
|
|
749
|
+
),
|
|
750
|
+
makeEmitFile(
|
|
751
|
+
`${GENERATED_DIR}/authConfig.ts`,
|
|
752
|
+
serializeAuthConfigTs(authRegistry),
|
|
753
|
+
),
|
|
754
|
+
makeEmitFile(
|
|
755
|
+
`${GENERATED_DIR}/authConfig.json`,
|
|
756
|
+
serializeAuthConfigJson(authRegistry),
|
|
757
|
+
),
|
|
758
|
+
makeEmitFile(
|
|
759
|
+
`${GENERATED_DIR}/authClaims.ts`,
|
|
760
|
+
serializeAuthClaimsTs(authRegistry),
|
|
761
|
+
),
|
|
762
|
+
makeEmitFile(
|
|
763
|
+
`${GENERATED_DIR}/authClaims.json`,
|
|
764
|
+
serializeAuthClaimsJson(authRegistry),
|
|
765
|
+
),
|
|
766
|
+
makeEmitFile(`${GENERATED_DIR}/authContext.ts`, serializeAuthContextTs()),
|
|
767
|
+
makeEmitFile(`${GENERATED_DIR}/secretsContext.ts`, serializeSecretsContextTs()),
|
|
768
|
+
makeEmitFile(
|
|
769
|
+
`${GENERATED_DIR}/secretRegistry.ts`,
|
|
770
|
+
serializeSecretRegistryTs(secretRegistry),
|
|
771
|
+
),
|
|
772
|
+
makeEmitFile(
|
|
773
|
+
`${GENERATED_DIR}/secretRegistry.json`,
|
|
774
|
+
serializeSecretRegistryJson(secretRegistry),
|
|
775
|
+
),
|
|
776
|
+
makeEmitFile(`${GENERATED_DIR}/envSchema.ts`, serializeEnvSchemaTs(envSchema)),
|
|
777
|
+
makeEmitFile(`${GENERATED_DIR}/envSchema.json`, serializeEnvSchemaJson(envSchema)),
|
|
778
|
+
makeEmitFile(
|
|
779
|
+
`${GENERATED_DIR}/configRegistry.ts`,
|
|
780
|
+
serializeConfigRegistryTs(configRegistry),
|
|
781
|
+
),
|
|
782
|
+
makeEmitFile(
|
|
783
|
+
`${GENERATED_DIR}/configRegistry.json`,
|
|
784
|
+
serializeConfigRegistryJson(configRegistry),
|
|
785
|
+
),
|
|
786
|
+
makeEmitFile(
|
|
787
|
+
`${GENERATED_DIR}/aiRegistry.ts`,
|
|
788
|
+
serializeAiRegistryTs(aiRegistry),
|
|
789
|
+
),
|
|
790
|
+
makeEmitFile(
|
|
791
|
+
`${GENERATED_DIR}/aiRegistry.json`,
|
|
792
|
+
serializeAiRegistryJson(aiRegistry),
|
|
793
|
+
),
|
|
794
|
+
makeEmitFile(
|
|
795
|
+
`${GENERATED_DIR}/aiProviders.ts`,
|
|
796
|
+
serializeAiProvidersTs(aiRegistry),
|
|
797
|
+
),
|
|
798
|
+
makeEmitFile(
|
|
799
|
+
`${GENERATED_DIR}/aiProviders.json`,
|
|
800
|
+
serializeAiProvidersJson(aiRegistry),
|
|
801
|
+
),
|
|
802
|
+
makeEmitFile(`${GENERATED_DIR}/aiModels.ts`, serializeAiModelsTs(aiModels)),
|
|
803
|
+
makeEmitFile(`${GENERATED_DIR}/aiModels.json`, serializeAiModelsJson(aiModels)),
|
|
804
|
+
makeEmitFile(`${GENERATED_DIR}/aiContext.ts`, serializeAiContextTs()),
|
|
805
|
+
makeEmitFile(
|
|
806
|
+
`${GENERATED_DIR}/queryRegistry.ts`,
|
|
807
|
+
serializeQueryRegistryTs(queryRegistry),
|
|
808
|
+
),
|
|
809
|
+
makeEmitFile(
|
|
810
|
+
`${GENERATED_DIR}/queryRegistry.json`,
|
|
811
|
+
serializeQueryRegistryJson(queryRegistry),
|
|
812
|
+
),
|
|
813
|
+
makeEmitFile(
|
|
814
|
+
`${GENERATED_DIR}/liveQueryRegistry.ts`,
|
|
815
|
+
serializeLiveQueryRegistryTs(liveQueryRegistry),
|
|
816
|
+
),
|
|
817
|
+
makeEmitFile(
|
|
818
|
+
`${GENERATED_DIR}/liveQueryRegistry.json`,
|
|
819
|
+
serializeLiveQueryRegistryJson(liveQueryRegistry),
|
|
820
|
+
),
|
|
821
|
+
makeEmitFile(
|
|
822
|
+
`${GENERATED_DIR}/subscriptionManifest.ts`,
|
|
823
|
+
serializeSubscriptionManifestTs(subscriptionManifest),
|
|
824
|
+
),
|
|
825
|
+
makeEmitFile(
|
|
826
|
+
`${GENERATED_DIR}/subscriptionManifest.json`,
|
|
827
|
+
serializeSubscriptionManifestJson(subscriptionManifest),
|
|
828
|
+
),
|
|
829
|
+
makeEmitFile(`${GENERATED_DIR}/api.ts`, serializeApiTsExport(apiSurface)),
|
|
830
|
+
makeEmitFile(`${GENERATED_DIR}/api.json`, serializeApiJson(apiSurface)),
|
|
831
|
+
makeEmitFile(`${GENERATED_DIR}/serverApi.ts`, serializeServerApiTsExport(apiSurface)),
|
|
832
|
+
makeEmitFile(`${GENERATED_DIR}/clientApi.ts`, serializeClientApiTsExport(apiSurface)),
|
|
833
|
+
makeEmitFile(`${GENERATED_DIR}/clientTypes.ts`, renderClientTypesTs()),
|
|
834
|
+
makeEmitFile(`${GENERATED_DIR}/client.ts`, renderClientTs()),
|
|
835
|
+
makeEmitFile(`${GENERATED_DIR}/clientManifest.ts`, renderClientManifestTs(clientManifest)),
|
|
836
|
+
makeEmitFile(
|
|
837
|
+
`${GENERATED_DIR}/clientManifest.json`,
|
|
838
|
+
serializeClientManifestJson(clientManifest),
|
|
839
|
+
),
|
|
840
|
+
makeEmitFile(`${GENERATED_DIR}/react.ts`, renderReactTs()),
|
|
841
|
+
makeEmitFile(`${GENERATED_DIR}/react.d.ts`, renderReactDts()),
|
|
842
|
+
makeEmitFile(`${GENERATED_DIR}/reactManifest.ts`, renderReactManifestTs(reactManifest)),
|
|
843
|
+
makeEmitFile(
|
|
844
|
+
`${GENERATED_DIR}/reactManifest.json`,
|
|
845
|
+
serializeReactManifestJson(reactManifest),
|
|
846
|
+
),
|
|
847
|
+
];
|
|
848
|
+
|
|
849
|
+
const sortedFiles = stableSortEmitFiles(files);
|
|
850
|
+
const plannedPathSet = new Set(sortedFiles.map((file) => file.path));
|
|
851
|
+
const orphanedFiles = detectOrphanedGeneratedFiles(
|
|
852
|
+
input.ctx.workspaceRoot,
|
|
853
|
+
input.ctx.generatedDir,
|
|
854
|
+
plannedPathSet,
|
|
855
|
+
);
|
|
856
|
+
|
|
857
|
+
const lock = buildForgeLock(input);
|
|
858
|
+
|
|
859
859
|
return {
|
|
860
860
|
files: sortedFiles,
|
|
861
861
|
orphanedFiles,
|