forgeos 0.1.0-alpha.2 → 0.1.0-alpha.21
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 +4 -0
- package/AGENTS.md +168 -81
- package/CHANGELOG.md +211 -0
- package/README.md +88 -14
- package/adapters/go/README.md +23 -0
- package/adapters/go/go.mod +3 -0
- package/adapters/go/http.go +149 -0
- package/adapters/go/registry.go +234 -0
- package/adapters/go/types.go +136 -0
- package/adapters/java/README.md +68 -0
- package/adapters/java/pom.xml +34 -0
- package/adapters/java/src/main/java/dev/forgeos/adapter/Auth.java +20 -0
- package/adapters/java/src/main/java/dev/forgeos/adapter/Diagnostic.java +16 -0
- package/adapters/java/src/main/java/dev/forgeos/adapter/Entry.java +38 -0
- package/adapters/java/src/main/java/dev/forgeos/adapter/EntryKind.java +16 -0
- package/adapters/java/src/main/java/dev/forgeos/adapter/ErrorInfo.java +4 -0
- package/adapters/java/src/main/java/dev/forgeos/adapter/Forge.java +94 -0
- package/adapters/java/src/main/java/dev/forgeos/adapter/ForgeCall.java +12 -0
- package/adapters/java/src/main/java/dev/forgeos/adapter/ForgeContext.java +11 -0
- package/adapters/java/src/main/java/dev/forgeos/adapter/ForgeHandler.java +8 -0
- package/adapters/java/src/main/java/dev/forgeos/adapter/ForgeHttpHandler.java +179 -0
- package/adapters/java/src/main/java/dev/forgeos/adapter/ForgeRegistry.java +121 -0
- package/adapters/java/src/main/java/dev/forgeos/adapter/Json.java +14 -0
- package/adapters/java/src/main/java/dev/forgeos/adapter/Manifest.java +14 -0
- package/adapters/java/src/main/java/dev/forgeos/adapter/RequestEnvelope.java +6 -0
- package/adapters/java/src/main/java/dev/forgeos/adapter/ResponseEnvelope.java +25 -0
- package/adapters/java/src/main/java/dev/forgeos/adapter/Risk.java +18 -0
- package/adapters/java/src/main/java/dev/forgeos/adapter/Schemas.java +36 -0
- package/adapters/java/src/main/java/dev/forgeos/adapter/Service.java +65 -0
- package/adapters/java/src/main/java/dev/forgeos/adapter/TransactionMode.java +18 -0
- package/adapters/java/src/main/java/dev/forgeos/adapter/TypedForgeHandler.java +6 -0
- package/adapters/java/target/classes/dev/forgeos/adapter/Auth.class +0 -0
- package/adapters/java/target/classes/dev/forgeos/adapter/Diagnostic.class +0 -0
- package/adapters/java/target/classes/dev/forgeos/adapter/Entry.class +0 -0
- package/adapters/java/target/classes/dev/forgeos/adapter/EntryKind.class +0 -0
- package/adapters/java/target/classes/dev/forgeos/adapter/ErrorInfo.class +0 -0
- package/adapters/java/target/classes/dev/forgeos/adapter/Forge.class +0 -0
- package/adapters/java/target/classes/dev/forgeos/adapter/ForgeCall.class +0 -0
- package/adapters/java/target/classes/dev/forgeos/adapter/ForgeContext.class +0 -0
- package/adapters/java/target/classes/dev/forgeos/adapter/ForgeHandler.class +0 -0
- package/adapters/java/target/classes/dev/forgeos/adapter/ForgeHttpHandler.class +0 -0
- package/adapters/java/target/classes/dev/forgeos/adapter/ForgeRegistry$EntryOption.class +0 -0
- package/adapters/java/target/classes/dev/forgeos/adapter/ForgeRegistry$RegisteredEntry.class +0 -0
- package/adapters/java/target/classes/dev/forgeos/adapter/ForgeRegistry$RegistryOption.class +0 -0
- package/adapters/java/target/classes/dev/forgeos/adapter/ForgeRegistry.class +0 -0
- package/adapters/java/target/classes/dev/forgeos/adapter/Json.class +0 -0
- package/adapters/java/target/classes/dev/forgeos/adapter/Manifest.class +0 -0
- package/adapters/java/target/classes/dev/forgeos/adapter/RequestEnvelope.class +0 -0
- package/adapters/java/target/classes/dev/forgeos/adapter/ResponseEnvelope.class +0 -0
- package/adapters/java/target/classes/dev/forgeos/adapter/Risk.class +0 -0
- package/adapters/java/target/classes/dev/forgeos/adapter/Schemas.class +0 -0
- package/adapters/java/target/classes/dev/forgeos/adapter/Service.class +0 -0
- package/adapters/java/target/classes/dev/forgeos/adapter/TransactionMode.class +0 -0
- package/adapters/java/target/classes/dev/forgeos/adapter/TypedForgeHandler.class +0 -0
- package/adapters/java/target/forge-java-adapter-0.1.0-alpha.11.jar +0 -0
- package/adapters/java/target/maven-archiver/pom.properties +3 -0
- package/adapters/java/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst +23 -0
- package/adapters/java/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst +20 -0
- package/adapters/java-spring-boot-starter/README.md +32 -0
- package/adapters/java-spring-boot-starter/pom.xml +36 -0
- package/adapters/java-spring-boot-starter/src/main/java/dev/forgeos/adapter/spring/ForgeCommand.java +22 -0
- package/adapters/java-spring-boot-starter/src/main/java/dev/forgeos/adapter/spring/ForgeExternalService.java +15 -0
- package/adapters/java-spring-boot-starter/src/main/java/dev/forgeos/adapter/spring/ForgeQuery.java +16 -0
- package/adapters/java-spring-boot-starter/src/main/java/dev/forgeos/adapter/spring/ForgeServiceBeanCondition.java +18 -0
- package/adapters/java-spring-boot-starter/src/main/java/dev/forgeos/adapter/spring/ForgeSpringAutoConfiguration.java +16 -0
- package/adapters/java-spring-boot-starter/src/main/java/dev/forgeos/adapter/spring/ForgeSpringRuntime.java +104 -0
- package/adapters/java-spring-boot-starter/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports +1 -0
- package/adapters/java-spring-boot-starter/target/classes/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports +1 -0
- package/adapters/java-spring-boot-starter/target/classes/dev/forgeos/adapter/spring/ForgeCommand.class +0 -0
- package/adapters/java-spring-boot-starter/target/classes/dev/forgeos/adapter/spring/ForgeExternalService.class +0 -0
- package/adapters/java-spring-boot-starter/target/classes/dev/forgeos/adapter/spring/ForgeQuery.class +0 -0
- package/adapters/java-spring-boot-starter/target/classes/dev/forgeos/adapter/spring/ForgeServiceBeanCondition.class +0 -0
- package/adapters/java-spring-boot-starter/target/classes/dev/forgeos/adapter/spring/ForgeSpringAutoConfiguration.class +0 -0
- package/adapters/java-spring-boot-starter/target/classes/dev/forgeos/adapter/spring/ForgeSpringRuntime.class +0 -0
- package/adapters/java-spring-boot-starter/target/forge-java-spring-boot-starter-0.1.0-alpha.11.jar +0 -0
- package/adapters/java-spring-boot-starter/target/maven-archiver/pom.properties +3 -0
- package/adapters/java-spring-boot-starter/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst +6 -0
- package/adapters/java-spring-boot-starter/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst +6 -0
- package/bin/forge.mjs +18 -0
- package/docs/changelog.md +242 -0
- package/docs/forge-protocol.md +189 -0
- package/examples/go-billing/go.mod +7 -0
- package/examples/go-billing/main.go +120 -0
- package/examples/java-billing/pom.xml +52 -0
- package/examples/java-billing/src/main/java/dev/forgeos/examples/billing/CreateInvoiceInput.java +4 -0
- package/examples/java-billing/src/main/java/dev/forgeos/examples/billing/Invoice.java +11 -0
- package/examples/java-billing/src/main/java/dev/forgeos/examples/billing/Main.java +127 -0
- package/examples/java-billing/target/classes/dev/forgeos/examples/billing/CreateInvoiceInput.class +0 -0
- package/examples/java-billing/target/classes/dev/forgeos/examples/billing/Invoice.class +0 -0
- package/examples/java-billing/target/classes/dev/forgeos/examples/billing/Main$EmptyInput.class +0 -0
- package/examples/java-billing/target/classes/dev/forgeos/examples/billing/Main$Options.class +0 -0
- package/examples/java-billing/target/classes/dev/forgeos/examples/billing/Main.class +0 -0
- package/examples/java-billing/target/java-billing-0.1.0-alpha.11-all.jar +0 -0
- package/examples/java-billing/target/java-billing-0.1.0-alpha.11.jar +0 -0
- package/examples/java-billing/target/maven-archiver/pom.properties +3 -0
- package/examples/java-billing/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst +5 -0
- package/examples/java-billing/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst +3 -0
- package/package.json +29 -7
- package/schemas/forge-manifest.schema.json +57 -0
- package/src/forge/_generated/releaseManifest.json +1 -2
- package/src/forge/_generated/releaseManifest.ts +3 -3
- package/src/forge/agent-adapters/index.ts +1511 -123
- package/src/forge/agent-adapters/types.ts +216 -1
- package/src/forge/agent-memory/bridge.ts +1245 -0
- package/src/forge/agent-memory/context-pack.ts +151 -0
- package/src/forge/agent-memory/hook-runner.ts +312 -0
- package/src/forge/agent-memory/mcp.ts +224 -0
- package/src/forge/agent-memory/normalize.ts +498 -0
- package/src/forge/agent-memory/redaction.ts +103 -0
- package/src/forge/agent-memory/sources/claude-code.ts +51 -0
- package/src/forge/agent-memory/sources/codex-hook-runner.mjs +273 -0
- package/src/forge/agent-memory/sources/codex.ts +119 -0
- package/src/forge/agent-memory/sources/cursor.ts +35 -0
- package/src/forge/agent-memory/types.ts +191 -0
- package/src/forge/bench.ts +248 -0
- package/src/forge/brownfield-import/index.ts +801 -0
- package/src/forge/brownfield-import/types.ts +127 -0
- package/src/forge/cair/action-journal.ts +61 -0
- package/src/forge/cair/action-parser.ts +314 -0
- package/src/forge/cair/action-validator.ts +40 -0
- package/src/forge/cair/actions.ts +1818 -0
- package/src/forge/cair/format.ts +77 -0
- package/src/forge/cair/index.ts +106 -0
- package/src/forge/cair/query.ts +478 -0
- package/src/forge/cair/snapshot.ts +315 -0
- package/src/forge/cair/types.ts +248 -0
- package/src/forge/cli/ai.ts +671 -3
- package/src/forge/cli/auth.ts +36 -1
- package/src/forge/cli/build.ts +20 -4
- package/src/forge/cli/changed.ts +300 -0
- package/src/forge/cli/codex-app-server.ts +877 -0
- package/src/forge/cli/commands.ts +1285 -7
- package/src/forge/cli/db.ts +121 -2
- package/src/forge/cli/deps.ts +79 -12
- package/src/forge/cli/dev.ts +502 -38
- package/src/forge/cli/docs.ts +265 -0
- package/src/forge/cli/handoff.ts +250 -0
- package/src/forge/cli/index.ts +1 -0
- package/src/forge/cli/main.ts +49 -3
- package/src/forge/cli/new.ts +3 -1
- package/src/forge/cli/next-actions.ts +23 -0
- package/src/forge/cli/output.ts +290 -1
- package/src/forge/cli/parse.ts +770 -36
- package/src/forge/cli/query.ts +32 -0
- package/src/forge/cli/release.ts +35 -11
- package/src/forge/cli/rls.ts +568 -17
- package/src/forge/cli/run.ts +41 -0
- package/src/forge/cli/secrets.ts +46 -1
- package/src/forge/cli/security.ts +381 -0
- package/src/forge/cli/self-host.ts +56 -14
- package/src/forge/cli/studio.ts +2163 -0
- package/src/forge/cli/verify.ts +1422 -32
- package/src/forge/compiler/agent-contract/build.ts +725 -41
- package/src/forge/compiler/agent-contract/types.ts +85 -0
- package/src/forge/compiler/ai-registry/build.ts +62 -1
- package/src/forge/compiler/ai-registry/constants.ts +1 -1
- package/src/forge/compiler/ai-registry/parse.ts +168 -5
- package/src/forge/compiler/api-surface/build.ts +47 -0
- package/src/forge/compiler/app-graph/build.ts +68 -8
- package/src/forge/compiler/app-graph/extract.ts +107 -0
- package/src/forge/compiler/app-graph/forge-apis.ts +1 -0
- package/src/forge/compiler/app-graph/module-graph.ts +73 -78
- package/src/forge/compiler/app-graph/parser.ts +24 -24
- package/src/forge/compiler/app-graph/profile.ts +26 -0
- package/src/forge/compiler/app-graph/versions.ts +1 -1
- package/src/forge/compiler/classifier/capabilities.ts +3 -2
- package/src/forge/compiler/classifier/classify.ts +32 -8
- package/src/forge/compiler/classifier/secrets.ts +3 -2
- package/src/forge/compiler/classifier/signals.ts +91 -1
- package/src/forge/compiler/client-sdk/build-manifest.ts +59 -0
- package/src/forge/compiler/client-sdk/render-client.ts +188 -13
- package/src/forge/compiler/data-graph/parse.ts +3 -3
- package/src/forge/compiler/data-graph/sql/ddl.ts +60 -2
- package/src/forge/compiler/data-graph/sql/serialize.ts +4 -0
- package/src/forge/compiler/data-graph/sql/types.ts +1 -0
- package/src/forge/compiler/dev-manifest/build.ts +3 -0
- package/src/forge/compiler/diagnostics/codes.ts +35 -0
- package/src/forge/compiler/diagnostics/create.ts +8 -3
- package/src/forge/compiler/diagnostics/index.ts +2 -0
- package/src/forge/compiler/emitter/barrel.ts +3 -0
- package/src/forge/compiler/emitter/render.ts +5 -0
- package/src/forge/compiler/external-manifest/registry.ts +205 -0
- package/src/forge/compiler/external-manifest/types.ts +91 -0
- package/src/forge/compiler/external-manifest/validate.ts +373 -0
- package/src/forge/compiler/frontend-graph/build.ts +85 -13
- package/src/forge/compiler/integration/add.ts +498 -22
- package/src/forge/compiler/integration/snapshot.ts +2 -0
- package/src/forge/compiler/make-registry/build.ts +19 -7
- package/src/forge/compiler/orchestrator/plan-profile.ts +23 -0
- package/src/forge/compiler/orchestrator/plan.ts +78 -7
- package/src/forge/compiler/orchestrator/profile.ts +65 -0
- package/src/forge/compiler/orchestrator/run.ts +97 -31
- package/src/forge/compiler/orchestrator/serialize.ts +101 -8
- package/src/forge/compiler/package-graph/compiler.ts +13 -3
- package/src/forge/compiler/package-manager/adapter.ts +4 -1
- package/src/forge/compiler/package-manager/commands.ts +4 -0
- package/src/forge/compiler/package-manager/executor.ts +30 -1
- package/src/forge/compiler/policy-registry/build.ts +44 -1
- package/src/forge/compiler/test-graph/build.ts +11 -3
- package/src/forge/compiler/types/ai-registry.ts +25 -1
- package/src/forge/compiler/types/app-graph.ts +9 -2
- package/src/forge/compiler/types/cli.ts +76 -1
- package/src/forge/compiler/types/dev-manifest.ts +3 -0
- package/src/forge/compiler/types/frontend-graph.ts +2 -2
- package/src/forge/delta/classifier.ts +52 -0
- package/src/forge/delta/explain.ts +126 -0
- package/src/forge/delta/git-observer.ts +43 -0
- package/src/forge/delta/ids.ts +44 -0
- package/src/forge/delta/index.ts +13 -0
- package/src/forge/delta/recorder.ts +402 -0
- package/src/forge/delta/redaction.ts +50 -0
- package/src/forge/delta/schema.ts +240 -0
- package/src/forge/delta/session.ts +142 -0
- package/src/forge/delta/status.ts +489 -0
- package/src/forge/delta/store.ts +2975 -0
- package/src/forge/delta/timeline.ts +104 -0
- package/src/forge/dev/server.ts +768 -15
- package/src/forge/dev/types.ts +15 -1
- package/src/forge/dev/watch.ts +17 -7
- package/src/forge/dev-console/cycle.ts +233 -21
- package/src/forge/dev-console/types.ts +46 -1
- package/src/forge/impact/index.ts +46 -8
- package/src/forge/impact/types.ts +6 -0
- package/src/forge/intent/index.ts +35 -16
- package/src/forge/make/index.ts +149 -6
- package/src/forge/make/templates.ts +343 -2
- package/src/forge/make/types.ts +3 -1
- package/src/forge/refactor/index.ts +1 -0
- package/src/forge/repair/rules/index.ts +2 -2
- package/src/forge/review/index.ts +158 -12
- package/src/forge/review/types.ts +15 -0
- package/src/forge/runtime/ai/context.ts +210 -5
- package/src/forge/runtime/ai/types.ts +70 -0
- package/src/forge/runtime/auth/claims.ts +32 -0
- package/src/forge/runtime/auth/errors.ts +2 -0
- package/src/forge/runtime/context/create-context.ts +30 -6
- package/src/forge/runtime/db/generated-client.ts +13 -2
- package/src/forge/runtime/db/memory-adapter.ts +2 -2
- package/src/forge/runtime/db/pglite-adapter.ts +77 -2
- package/src/forge/runtime/db/postgres-adapter.ts +6 -3
- package/src/forge/runtime/executor.ts +112 -2
- package/src/forge/runtime/external/bridge.ts +649 -0
- package/src/forge/runtime/runner/run-entry.ts +16 -7
- package/src/forge/runtime/telemetry/scrubber.ts +91 -10
- package/src/forge/runtime/webhooks/security.ts +184 -0
- package/src/forge/server.ts +100 -2
- package/src/forge/version.ts +1 -1
- package/src/forge/vue/index.ts +407 -0
- package/src/forge/workspace/change-summary.ts +209 -0
- package/src/forge/workspace/forge-cli.ts +14 -0
- package/src/forge/workspace/git-summary.ts +279 -0
- package/templates/agent-workroom/AGENTS.md +29 -0
- package/templates/agent-workroom/README.md +34 -0
- package/templates/agent-workroom/forge.config.ts +3 -0
- package/templates/agent-workroom/package.json +33 -0
- package/templates/agent-workroom/src/actions/indexAgentSignal.ts +10 -0
- package/templates/agent-workroom/src/commands/openWorkroom.ts +61 -0
- package/templates/agent-workroom/src/commands/recordAgentSignal.ts +119 -0
- package/templates/agent-workroom/src/commands/recordCheckRun.ts +52 -0
- package/templates/agent-workroom/src/forge/schema.ts +54 -0
- package/templates/agent-workroom/src/policies.ts +6 -0
- package/templates/agent-workroom/src/queries/listWorkrooms.ts +11 -0
- package/templates/agent-workroom/src/queries/liveWorkroom.ts +63 -0
- package/templates/agent-workroom/tsconfig.json +16 -0
- package/templates/agent-workroom/web/index.html +12 -0
- package/templates/agent-workroom/web/package.json +21 -0
- package/templates/agent-workroom/web/src/App.tsx +345 -0
- package/templates/agent-workroom/web/src/lib/forge.ts +13 -0
- package/templates/agent-workroom/web/src/main.tsx +13 -0
- package/templates/agent-workroom/web/src/styles.css +545 -0
- package/templates/agent-workroom/web/tsconfig.json +27 -0
- package/templates/b2b-support-web/package.json +2 -0
- package/templates/b2b-support-web/tsconfig.json +4 -1
- package/templates/b2b-support-web/web/package.json +1 -1
- package/templates/minimal-web/package.json +2 -1
- package/templates/minimal-web/tsconfig.json +3 -1
- package/templates/minimal-web/web/package.json +2 -2
- package/src/forge/_generated/actionSubscriptions.json +0 -2
- package/src/forge/_generated/actionSubscriptions.ts +0 -10
- package/src/forge/_generated/agentAdapterManifest.json +0 -2
- package/src/forge/_generated/agentAdapterManifest.ts +0 -73
- package/src/forge/_generated/agentContract.json +0 -2
- package/src/forge/_generated/agentContract.ts +0 -7696
- package/src/forge/_generated/agentQuickstart.md +0 -32
- package/src/forge/_generated/aiContext.ts +0 -59
- package/src/forge/_generated/aiModels.json +0 -2
- package/src/forge/_generated/aiModels.ts +0 -35
- package/src/forge/_generated/aiProviders.json +0 -2
- package/src/forge/_generated/aiProviders.ts +0 -23
- package/src/forge/_generated/aiRegistry.json +0 -2
- package/src/forge/_generated/aiRegistry.ts +0 -29
- package/src/forge/_generated/api.json +0 -2
- package/src/forge/_generated/api.ts +0 -8
- package/src/forge/_generated/appGraph.json +0 -2
- package/src/forge/_generated/appGraph.ts +0 -14667
- package/src/forge/_generated/appMap.md +0 -35
- package/src/forge/_generated/artifactManifest.json +0 -2
- package/src/forge/_generated/artifactManifest.ts +0 -7
- package/src/forge/_generated/authClaims.json +0 -2
- package/src/forge/_generated/authClaims.ts +0 -13
- package/src/forge/_generated/authConfig.json +0 -2
- package/src/forge/_generated/authConfig.ts +0 -17
- package/src/forge/_generated/authContext.ts +0 -23
- package/src/forge/_generated/authRegistry.json +0 -2
- package/src/forge/_generated/authRegistry.ts +0 -25
- package/src/forge/_generated/buildInfo.json +0 -2
- package/src/forge/_generated/buildInfo.ts +0 -9
- package/src/forge/_generated/capabilityMap.json +0 -2
- package/src/forge/_generated/capabilityMap.md +0 -15
- package/src/forge/_generated/capabilityMap.ts +0 -17
- package/src/forge/_generated/client.ts +0 -282
- package/src/forge/_generated/clientApi.ts +0 -9
- package/src/forge/_generated/clientManifest.json +0 -2
- package/src/forge/_generated/clientManifest.ts +0 -39
- package/src/forge/_generated/clientTypes.ts +0 -78
- package/src/forge/_generated/configRegistry.json +0 -2
- package/src/forge/_generated/configRegistry.ts +0 -4
- package/src/forge/_generated/dataGraph.json +0 -2
- package/src/forge/_generated/dataGraph.ts +0 -8
- package/src/forge/_generated/db.json +0 -2
- package/src/forge/_generated/db.ts +0 -2
- package/src/forge/_generated/dbSecurityManifest.json +0 -2
- package/src/forge/_generated/dbSecurityManifest.ts +0 -15
- package/src/forge/_generated/dbSessionContext.json +0 -2
- package/src/forge/_generated/dbSessionContext.ts +0 -39
- package/src/forge/_generated/deployManifest.json +0 -2
- package/src/forge/_generated/deployManifest.ts +0 -14
- package/src/forge/_generated/devManifest.json +0 -2
- package/src/forge/_generated/devManifest.ts +0 -47
- package/src/forge/_generated/envSchema.json +0 -2
- package/src/forge/_generated/envSchema.ts +0 -59
- package/src/forge/_generated/frontendGraph.json +0 -2
- package/src/forge/_generated/frontendGraph.ts +0 -27
- package/src/forge/_generated/importGuards.json +0 -2
- package/src/forge/_generated/importGuards.ts +0 -686
- package/src/forge/_generated/index.ts +0 -67
- package/src/forge/_generated/liveProductionManifest.json +0 -2
- package/src/forge/_generated/liveProductionManifest.ts +0 -23
- package/src/forge/_generated/liveProtocol.json +0 -2
- package/src/forge/_generated/liveProtocol.ts +0 -21
- package/src/forge/_generated/liveQueryRegistry.json +0 -2
- package/src/forge/_generated/liveQueryRegistry.ts +0 -9
- package/src/forge/_generated/liveTransportConfig.json +0 -2
- package/src/forge/_generated/liveTransportConfig.ts +0 -19
- package/src/forge/_generated/makeRegistry.json +0 -2
- package/src/forge/_generated/makeRegistry.ts +0 -163
- package/src/forge/_generated/makeTemplates.json +0 -2
- package/src/forge/_generated/makeTemplates.ts +0 -61
- package/src/forge/_generated/mockMap.json +0 -2
- package/src/forge/_generated/mockMap.ts +0 -7
- package/src/forge/_generated/operationPlaybooks.md +0 -147
- package/src/forge/_generated/packageGraph.json +0 -2
- package/src/forge/_generated/packageGraph.ts +0 -245249
- package/src/forge/_generated/packageUpgradeRegistry.json +0 -2
- package/src/forge/_generated/packageUpgradeRegistry.ts +0 -15
- package/src/forge/_generated/permissionMatrix.json +0 -2
- package/src/forge/_generated/permissionMatrix.ts +0 -7
- package/src/forge/_generated/policyRegistry.json +0 -2
- package/src/forge/_generated/policyRegistry.ts +0 -11
- package/src/forge/_generated/queryRegistry.json +0 -2
- package/src/forge/_generated/queryRegistry.ts +0 -9
- package/src/forge/_generated/react.d.ts +0 -22
- package/src/forge/_generated/react.ts +0 -29
- package/src/forge/_generated/reactManifest.json +0 -2
- package/src/forge/_generated/reactManifest.ts +0 -19
- package/src/forge/_generated/rlsPolicies.json +0 -2
- package/src/forge/_generated/rlsPolicies.sql +0 -34
- package/src/forge/_generated/rlsPolicies.ts +0 -6
- package/src/forge/_generated/runtimeGraph.json +0 -2
- package/src/forge/_generated/runtimeGraph.ts +0 -8
- package/src/forge/_generated/runtimeMatrix.json +0 -2
- package/src/forge/_generated/runtimeMatrix.ts +0 -327385
- package/src/forge/_generated/runtimeRegistry.ts +0 -2
- package/src/forge/_generated/runtimeRules.md +0 -79
- package/src/forge/_generated/secretRegistry.json +0 -2
- package/src/forge/_generated/secretRegistry.ts +0 -50
- package/src/forge/_generated/secretsContext.ts +0 -11
- package/src/forge/_generated/serverApi.ts +0 -10
- package/src/forge/_generated/sourceMapManifest.json +0 -2
- package/src/forge/_generated/sourceMapManifest.ts +0 -7
- package/src/forge/_generated/sqlPlan.json +0 -2
- package/src/forge/_generated/sqlPlan.ts +0 -88
- package/src/forge/_generated/subscriptionManifest.json +0 -2
- package/src/forge/_generated/subscriptionManifest.ts +0 -7
- package/src/forge/_generated/symbolicationManifest.json +0 -2
- package/src/forge/_generated/symbolicationManifest.ts +0 -17
- package/src/forge/_generated/telemetryRegistry.json +0 -2
- package/src/forge/_generated/telemetryRegistry.ts +0 -9
- package/src/forge/_generated/telemetrySinks.json +0 -2
- package/src/forge/_generated/telemetrySinks.ts +0 -11
- package/src/forge/_generated/tenantScope.json +0 -2
- package/src/forge/_generated/tenantScope.ts +0 -8
- package/src/forge/_generated/testGraph.json +0 -2
- package/src/forge/_generated/testGraph.ts +0 -3108
- package/src/forge/_generated/testPlanRegistry.json +0 -2
- package/src/forge/_generated/testPlanRegistry.ts +0 -33
- package/src/forge/_generated/uiRoutes.json +0 -2
- package/src/forge/_generated/uiRoutes.ts +0 -16
- package/src/forge/_generated/uiScenarios.json +0 -2
- package/src/forge/_generated/uiScenarios.ts +0 -30
- package/src/forge/_generated/uiTestManifest.json +0 -2
- package/src/forge/_generated/uiTestManifest.ts +0 -27
- package/src/forge/_generated/workflowRegistry.json +0 -2
- package/src/forge/_generated/workflowRegistry.ts +0 -9
- package/src/forge/_generated/workflowSubscriptions.json +0 -2
- package/src/forge/_generated/workflowSubscriptions.ts +0 -10
|
@@ -86,6 +86,14 @@ function moduleGraphForAppGraphSnapshot(graph: AppGraph): AppGraph["moduleGraph"
|
|
|
86
86
|
};
|
|
87
87
|
}
|
|
88
88
|
|
|
89
|
+
export function serializeConstFromJson(
|
|
90
|
+
exportName: string,
|
|
91
|
+
serializedJson: string,
|
|
92
|
+
): string {
|
|
93
|
+
const parsed: unknown = JSON.parse(serializedJson.trimEnd());
|
|
94
|
+
return `export const ${exportName} = ${JSON.stringify(parsed, null, 2)} as const;\n`;
|
|
95
|
+
}
|
|
96
|
+
|
|
89
97
|
export function serializeAppGraphJson(graph: AppGraph): string {
|
|
90
98
|
const payload = {
|
|
91
99
|
schemaVersion: graph.schemaVersion,
|
|
@@ -100,26 +108,35 @@ export function serializeAppGraphJson(graph: AppGraph): string {
|
|
|
100
108
|
}
|
|
101
109
|
|
|
102
110
|
export function serializeAppGraphTs(graph: AppGraph): string {
|
|
103
|
-
|
|
104
|
-
return `export const appGraph = ${JSON.stringify(parsed, null, 2)} as const;\n`;
|
|
111
|
+
return serializeConstFromJson("appGraph", serializeAppGraphJson(graph));
|
|
105
112
|
}
|
|
106
113
|
|
|
107
114
|
export function serializePackageGraphJson(graph: PackageGraph): string {
|
|
108
115
|
return serializeCanonical(graph);
|
|
109
116
|
}
|
|
110
117
|
|
|
111
|
-
export function serializePackageGraphTs(
|
|
112
|
-
|
|
113
|
-
|
|
118
|
+
export function serializePackageGraphTs(_graph: PackageGraph): string {
|
|
119
|
+
return [
|
|
120
|
+
"import packageGraphJson from \"./packageGraph.json\" with { type: \"json\" };",
|
|
121
|
+
"",
|
|
122
|
+
"export type PackageGraph = typeof packageGraphJson;",
|
|
123
|
+
"export const packageGraph = packageGraphJson;",
|
|
124
|
+
"",
|
|
125
|
+
].join("\n");
|
|
114
126
|
}
|
|
115
127
|
|
|
116
128
|
export function serializeRuntimeMatrixJson(matrix: RuntimeMatrix): string {
|
|
117
129
|
return serializeCanonical(matrix);
|
|
118
130
|
}
|
|
119
131
|
|
|
120
|
-
export function serializeRuntimeMatrixTs(
|
|
121
|
-
|
|
122
|
-
|
|
132
|
+
export function serializeRuntimeMatrixTs(_matrix: RuntimeMatrix): string {
|
|
133
|
+
return [
|
|
134
|
+
"import runtimeMatrixJson from \"./runtimeMatrix.json\" with { type: \"json\" };",
|
|
135
|
+
"",
|
|
136
|
+
"export type RuntimeMatrix = typeof runtimeMatrixJson;",
|
|
137
|
+
"export const runtimeMatrix = runtimeMatrixJson;",
|
|
138
|
+
"",
|
|
139
|
+
].join("\n");
|
|
123
140
|
}
|
|
124
141
|
|
|
125
142
|
export function serializeImportGuardsJson(
|
|
@@ -680,6 +697,8 @@ export function serializeAiRegistryJson(registry: import("../types/ai-registry.t
|
|
|
680
697
|
inputHash: registry.inputHash,
|
|
681
698
|
providers: registry.providers,
|
|
682
699
|
generations: registry.generations,
|
|
700
|
+
tools: registry.tools,
|
|
701
|
+
agents: registry.agents,
|
|
683
702
|
diagnostics: registry.diagnostics,
|
|
684
703
|
};
|
|
685
704
|
return serializeCanonical(payload);
|
|
@@ -762,10 +781,76 @@ export interface ForgeGenerateStructuredInput<T> {
|
|
|
762
781
|
schema: ForgeFlexibleSchema<T>;
|
|
763
782
|
}
|
|
764
783
|
|
|
784
|
+
export type ForgeAiToolRisk = "read" | "write" | "external" | "destructive";
|
|
785
|
+
|
|
786
|
+
export interface ForgeAiToolRuntimeContext {
|
|
787
|
+
secrets: {
|
|
788
|
+
get(name: string): string;
|
|
789
|
+
optional(name: string): string | undefined;
|
|
790
|
+
has(name: string): boolean;
|
|
791
|
+
};
|
|
792
|
+
env: Record<string, string | undefined>;
|
|
793
|
+
telemetry?: {
|
|
794
|
+
traceId?: string;
|
|
795
|
+
capture(name: string, properties?: Record<string, unknown>): Promise<void>;
|
|
796
|
+
};
|
|
797
|
+
auth?: unknown;
|
|
798
|
+
}
|
|
799
|
+
|
|
800
|
+
export interface ForgeAiToolDefinition<TArgs = unknown, TResult = unknown> {
|
|
801
|
+
description: string;
|
|
802
|
+
inputSchema: unknown;
|
|
803
|
+
outputSchema?: unknown;
|
|
804
|
+
strict?: boolean;
|
|
805
|
+
needsApproval?: boolean | ((args: TArgs) => boolean | Promise<boolean>);
|
|
806
|
+
risk?: ForgeAiToolRisk;
|
|
807
|
+
handler: (
|
|
808
|
+
ctx: ForgeAiToolRuntimeContext,
|
|
809
|
+
args: TArgs,
|
|
810
|
+
) => TResult | Promise<TResult>;
|
|
811
|
+
}
|
|
812
|
+
|
|
813
|
+
export type ForgeAgentStopWhen =
|
|
814
|
+
| { kind: "stepCount"; maxSteps: number }
|
|
815
|
+
| { kind: "toolCall"; toolName: string };
|
|
816
|
+
|
|
817
|
+
export interface ForgeRunAgentInput {
|
|
818
|
+
provider?: ForgeAiProvider;
|
|
819
|
+
model: string;
|
|
820
|
+
prompt: string;
|
|
821
|
+
instructions: string;
|
|
822
|
+
purpose?: string;
|
|
823
|
+
tools?: Record<string, ForgeAiToolDefinition>;
|
|
824
|
+
stopWhen?: ForgeAgentStopWhen;
|
|
825
|
+
maxSteps?: number;
|
|
826
|
+
temperature?: number;
|
|
827
|
+
maxTokens?: number;
|
|
828
|
+
}
|
|
829
|
+
|
|
830
|
+
export interface ForgeRunAgentResult {
|
|
831
|
+
text: string;
|
|
832
|
+
provider: ForgeAiProvider;
|
|
833
|
+
model: string;
|
|
834
|
+
purpose?: string;
|
|
835
|
+
usage: ForgeAiUsage;
|
|
836
|
+
latencyMs: number;
|
|
837
|
+
toolCalls: Array<{
|
|
838
|
+
toolName: string;
|
|
839
|
+
input: unknown;
|
|
840
|
+
}>;
|
|
841
|
+
toolResults: Array<{
|
|
842
|
+
toolName: string;
|
|
843
|
+
output: unknown;
|
|
844
|
+
}>;
|
|
845
|
+
steps: number;
|
|
846
|
+
estimatedCostUsd?: number;
|
|
847
|
+
}
|
|
848
|
+
|
|
765
849
|
export interface AiContext {
|
|
766
850
|
generateText(input: ForgeGenerateTextInput): Promise<ForgeGenerateTextResult>;
|
|
767
851
|
streamText(input: ForgeStreamTextInput): Promise<ForgeStreamTextResult>;
|
|
768
852
|
generateStructured<T>(input: ForgeGenerateStructuredInput<T>): Promise<T>;
|
|
853
|
+
runAgent(input: ForgeRunAgentInput): Promise<ForgeRunAgentResult>;
|
|
769
854
|
}
|
|
770
855
|
`;
|
|
771
856
|
}
|
|
@@ -822,6 +907,7 @@ export function serializeSubscriptionManifestTs(
|
|
|
822
907
|
}
|
|
823
908
|
|
|
824
909
|
export function serializeApiJson(surface: ApiSurface): string {
|
|
910
|
+
const external = surface.external ?? { services: {}, commands: {}, queries: {} };
|
|
825
911
|
return serializeCanonical({
|
|
826
912
|
schemaVersion: surface.schemaVersion,
|
|
827
913
|
generatorVersion: surface.generatorVersion,
|
|
@@ -831,6 +917,7 @@ export function serializeApiJson(surface: ApiSurface): string {
|
|
|
831
917
|
liveQueries: surface.liveQueries,
|
|
832
918
|
actions: surface.actions,
|
|
833
919
|
workflows: surface.workflows,
|
|
920
|
+
external,
|
|
834
921
|
});
|
|
835
922
|
}
|
|
836
923
|
|
|
@@ -865,6 +952,12 @@ export function serializeReactManifestJson(
|
|
|
865
952
|
return serializeCanonical(manifest);
|
|
866
953
|
}
|
|
867
954
|
|
|
955
|
+
export function serializeVueManifestJson(
|
|
956
|
+
manifest: import("../client-sdk/build-manifest.ts").VueManifest,
|
|
957
|
+
): string {
|
|
958
|
+
return serializeCanonical(manifest);
|
|
959
|
+
}
|
|
960
|
+
|
|
868
961
|
export function serializeTestGraphJson(graph: TestGraph): string {
|
|
869
962
|
return serializeCanonical(graph);
|
|
870
963
|
}
|
|
@@ -73,6 +73,10 @@ export interface BuildResult {
|
|
|
73
73
|
diagnostics: Diagnostic[];
|
|
74
74
|
}
|
|
75
75
|
|
|
76
|
+
function shouldWarnNoTypes(packageName: string): boolean {
|
|
77
|
+
return !packageName.startsWith("@types/");
|
|
78
|
+
}
|
|
79
|
+
|
|
76
80
|
export class PackageGraphCompiler {
|
|
77
81
|
async build(
|
|
78
82
|
deps: Dependency[],
|
|
@@ -363,7 +367,9 @@ export class PackageGraphCompiler {
|
|
|
363
367
|
}
|
|
364
368
|
|
|
365
369
|
if (resolved.dtsPath == null) {
|
|
366
|
-
|
|
370
|
+
if (shouldWarnNoTypes(dep.name)) {
|
|
371
|
+
diagnostics.push(forgePkgNoTypes(dep.name, subpath));
|
|
372
|
+
}
|
|
367
373
|
return {
|
|
368
374
|
subpath,
|
|
369
375
|
conditions: resolved.conditions,
|
|
@@ -382,7 +388,9 @@ export class PackageGraphCompiler {
|
|
|
382
388
|
subpath,
|
|
383
389
|
);
|
|
384
390
|
} catch {
|
|
385
|
-
|
|
391
|
+
if (shouldWarnNoTypes(dep.name)) {
|
|
392
|
+
diagnostics.push(forgePkgNoTypes(dep.name, subpath));
|
|
393
|
+
}
|
|
386
394
|
return {
|
|
387
395
|
subpath,
|
|
388
396
|
conditions: resolved.conditions,
|
|
@@ -401,7 +409,9 @@ export class PackageGraphCompiler {
|
|
|
401
409
|
}
|
|
402
410
|
|
|
403
411
|
if (exports.length === 0) {
|
|
404
|
-
|
|
412
|
+
if (shouldWarnNoTypes(dep.name)) {
|
|
413
|
+
diagnostics.push(forgePkgNoTypes(dep.name, subpath));
|
|
414
|
+
}
|
|
405
415
|
}
|
|
406
416
|
|
|
407
417
|
return {
|
|
@@ -83,7 +83,10 @@ async function runInstall(
|
|
|
83
83
|
executor: CommandExecutor,
|
|
84
84
|
): Promise<PmAddResult> {
|
|
85
85
|
const ignoreScripts = opts.ignoreScripts ?? true;
|
|
86
|
-
const argv = buildAddCommand(pm, spec, {
|
|
86
|
+
const argv = buildAddCommand(pm, spec, {
|
|
87
|
+
ignoreScripts,
|
|
88
|
+
workspace: opts.workspace,
|
|
89
|
+
});
|
|
87
90
|
const lockBefore = hashLockfiles(opts.cwd, pm);
|
|
88
91
|
|
|
89
92
|
const result = await executor.run(argv, { cwd: opts.cwd });
|
|
@@ -2,6 +2,7 @@ import type { PackageManager } from "../types/runtime.ts";
|
|
|
2
2
|
|
|
3
3
|
export interface BuildAddCommandOptions {
|
|
4
4
|
ignoreScripts: boolean;
|
|
5
|
+
workspace?: string;
|
|
5
6
|
}
|
|
6
7
|
|
|
7
8
|
/**
|
|
@@ -27,6 +28,9 @@ export function buildAddCommand(
|
|
|
27
28
|
if (ignoreScripts) {
|
|
28
29
|
args.push("--ignore-scripts");
|
|
29
30
|
}
|
|
31
|
+
if (options.workspace) {
|
|
32
|
+
args.push("--workspace", options.workspace);
|
|
33
|
+
}
|
|
30
34
|
return args;
|
|
31
35
|
}
|
|
32
36
|
case "pnpm": {
|
|
@@ -88,11 +88,40 @@ export class PackageManagerCommandError extends Error {
|
|
|
88
88
|
}
|
|
89
89
|
}
|
|
90
90
|
|
|
91
|
+
function quoteWindowsShellArg(arg: string): string {
|
|
92
|
+
if (/^[a-zA-Z0-9@._/:=-]+$/.test(arg)) {
|
|
93
|
+
return arg;
|
|
94
|
+
}
|
|
95
|
+
return `"${arg.replace(/(["^&|<>])/g, "^$1")}"`;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
function spawnArgvForWindowsScript(originalArgv: string[], resolvedArgv: string[]): string[] {
|
|
99
|
+
const originalCommand = originalArgv[0] ?? resolvedArgv[0]!;
|
|
100
|
+
const command =
|
|
101
|
+
originalCommand.includes("\\") ||
|
|
102
|
+
originalCommand.includes("/") ||
|
|
103
|
+
isAbsolute(originalCommand)
|
|
104
|
+
? resolvedArgv[0]!
|
|
105
|
+
: originalCommand;
|
|
106
|
+
const commandPart = command === originalCommand ? command : quoteWindowsShellArg(command);
|
|
107
|
+
const args = originalArgv.slice(1).map(quoteWindowsShellArg).join(" ");
|
|
108
|
+
return [
|
|
109
|
+
process.env.ComSpec ?? "cmd.exe",
|
|
110
|
+
"/d",
|
|
111
|
+
"/c",
|
|
112
|
+
`${commandPart}${args ? ` ${args}` : ""}`,
|
|
113
|
+
];
|
|
114
|
+
}
|
|
115
|
+
|
|
91
116
|
export const defaultCommandExecutor: CommandExecutor = {
|
|
92
117
|
async run(argv, options) {
|
|
93
118
|
const resolvedArgv = resolvePackageManagerArgv(argv);
|
|
119
|
+
const spawnArgv =
|
|
120
|
+
process.platform === "win32" && /\.(?:cmd|bat)$/i.test(resolvedArgv[0] ?? "")
|
|
121
|
+
? spawnArgvForWindowsScript(argv, resolvedArgv)
|
|
122
|
+
: resolvedArgv;
|
|
94
123
|
return new Promise<CommandRunResult>((resolve, reject) => {
|
|
95
|
-
const child = spawn(
|
|
124
|
+
const child = spawn(spawnArgv[0]!, spawnArgv.slice(1), {
|
|
96
125
|
cwd: options.cwd,
|
|
97
126
|
env: options.env ?? process.env,
|
|
98
127
|
windowsHide: true,
|
|
@@ -11,6 +11,7 @@ import { hashStable } from "../primitives/hash.ts";
|
|
|
11
11
|
import { canonicalJson } from "../primitives/serialize.ts";
|
|
12
12
|
import type { AppGraph } from "../types/app-graph.ts";
|
|
13
13
|
import type { DataGraph } from "../types/data-graph.ts";
|
|
14
|
+
import type { ForgeExternalServiceGraph } from "../external-manifest/types.ts";
|
|
14
15
|
import type {
|
|
15
16
|
CommandAuthBinding,
|
|
16
17
|
PermissionMatrix,
|
|
@@ -64,7 +65,20 @@ function buildPermissionMatrix(policies: PolicyRule[]): PermissionMatrixEntry[]
|
|
|
64
65
|
.sort((a, b) => (a.policy < b.policy ? -1 : a.policy > b.policy ? 1 : 0));
|
|
65
66
|
}
|
|
66
67
|
|
|
67
|
-
|
|
68
|
+
function authFromExternalPolicy(policy: string | undefined): CommandAuthBinding["auth"] {
|
|
69
|
+
if (!policy) {
|
|
70
|
+
return { kind: "public" };
|
|
71
|
+
}
|
|
72
|
+
if (policy === "public" || policy === "system" || policy === "user") {
|
|
73
|
+
return { kind: policy };
|
|
74
|
+
}
|
|
75
|
+
return { kind: "policy", policy };
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
export function buildPolicyRegistry(
|
|
79
|
+
appGraph: AppGraph,
|
|
80
|
+
externalServices?: ForgeExternalServiceGraph,
|
|
81
|
+
): PolicyRegistry {
|
|
68
82
|
const policies: PolicyRule[] = [];
|
|
69
83
|
const commandAuth: CommandAuthBinding[] = [];
|
|
70
84
|
const queryAuth: QueryAuthBinding[] = [];
|
|
@@ -152,6 +166,28 @@ export function buildPolicyRegistry(appGraph: AppGraph): PolicyRegistry {
|
|
|
152
166
|
}
|
|
153
167
|
}
|
|
154
168
|
|
|
169
|
+
for (const service of externalServices?.services ?? []) {
|
|
170
|
+
for (const entry of service.entries) {
|
|
171
|
+
const qualifiedName = `${service.name}.${entry.name}`;
|
|
172
|
+
const binding = {
|
|
173
|
+
file: `external:${service.name}`,
|
|
174
|
+
symbolId: `external:${service.name}:${entry.kind}:${entry.name}`,
|
|
175
|
+
auth: authFromExternalPolicy(entry.policy),
|
|
176
|
+
};
|
|
177
|
+
if (entry.kind === "command") {
|
|
178
|
+
commandAuth.push({
|
|
179
|
+
commandName: qualifiedName,
|
|
180
|
+
...binding,
|
|
181
|
+
});
|
|
182
|
+
} else {
|
|
183
|
+
queryAuth.push({
|
|
184
|
+
queryName: qualifiedName,
|
|
185
|
+
...binding,
|
|
186
|
+
});
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
|
|
155
191
|
const sortedPolicies = stableSortPolicies(policies);
|
|
156
192
|
const sortedCommandAuth = stableSortCommandAuth(commandAuth);
|
|
157
193
|
const sortedQueryAuth = stableSortQueryAuth(queryAuth);
|
|
@@ -167,6 +203,9 @@ export function buildPolicyRegistry(appGraph: AppGraph): PolicyRegistry {
|
|
|
167
203
|
code: FORGE_POLICY_UNKNOWN,
|
|
168
204
|
message: `command '${binding.commandName}' references unknown policy '${binding.auth.policy}'`,
|
|
169
205
|
file: binding.file,
|
|
206
|
+
fixHint: binding.file.startsWith("external:")
|
|
207
|
+
? "Define this policy in the Forge app or change the external manifest policy to public, user, or system."
|
|
208
|
+
: undefined,
|
|
170
209
|
}),
|
|
171
210
|
);
|
|
172
211
|
}
|
|
@@ -183,6 +222,9 @@ export function buildPolicyRegistry(appGraph: AppGraph): PolicyRegistry {
|
|
|
183
222
|
code: FORGE_POLICY_UNKNOWN,
|
|
184
223
|
message: `query '${binding.queryName}' references unknown policy '${binding.auth.policy}'`,
|
|
185
224
|
file: binding.file,
|
|
225
|
+
fixHint: binding.file.startsWith("external:")
|
|
226
|
+
? "Define this policy in the Forge app or change the external manifest policy to public, user, or system."
|
|
227
|
+
: undefined,
|
|
186
228
|
}),
|
|
187
229
|
);
|
|
188
230
|
}
|
|
@@ -195,6 +237,7 @@ export function buildPolicyRegistry(appGraph: AppGraph): PolicyRegistry {
|
|
|
195
237
|
inputHash: hashStable(
|
|
196
238
|
canonicalJson({
|
|
197
239
|
appInputHash: appGraph.inputHash,
|
|
240
|
+
externalInputHash: externalServices?.inputHash ?? "",
|
|
198
241
|
analyzerVersion: POLICY_REGISTRY_ANALYZER_VERSION,
|
|
199
242
|
}),
|
|
200
243
|
),
|
|
@@ -16,6 +16,14 @@ import type {
|
|
|
16
16
|
|
|
17
17
|
const TEST_RE = /\.(test|spec)\.(ts|tsx)$/;
|
|
18
18
|
|
|
19
|
+
function isTemporaryTestPath(path: string): boolean {
|
|
20
|
+
return path.split("/").some((segment) => segment === ".tmp" || segment === "__tmp__");
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
function isTestGraphCandidate(path: string): boolean {
|
|
24
|
+
return TEST_RE.test(path) && !isTemporaryTestPath(path);
|
|
25
|
+
}
|
|
26
|
+
|
|
19
27
|
function emptyCoverage(): TestCoverage {
|
|
20
28
|
return {
|
|
21
29
|
commands: [],
|
|
@@ -40,7 +48,7 @@ function collectTestsFromDisk(workspaceRoot: string): SourceFile[] {
|
|
|
40
48
|
const { sources } = walkWorkspaceSources({
|
|
41
49
|
workspaceRoot,
|
|
42
50
|
roots: ["tests", "web"],
|
|
43
|
-
excludeRelativePath: (path) => !
|
|
51
|
+
excludeRelativePath: (path) => !isTestGraphCandidate(path),
|
|
44
52
|
});
|
|
45
53
|
return sources.sort((a, b) => a.path.localeCompare(b.path));
|
|
46
54
|
}
|
|
@@ -208,7 +216,7 @@ export function buildTestGraph(input: {
|
|
|
208
216
|
const diskTests = collectTestsFromDisk(input.workspaceRoot);
|
|
209
217
|
const byPath = new Map<string, SourceFile>();
|
|
210
218
|
for (const source of input.sources) {
|
|
211
|
-
if (
|
|
219
|
+
if (isTestGraphCandidate(source.path)) {
|
|
212
220
|
byPath.set(source.path, source);
|
|
213
221
|
}
|
|
214
222
|
}
|
|
@@ -216,7 +224,7 @@ export function buildTestGraph(input: {
|
|
|
216
224
|
byPath.set(source.path, source);
|
|
217
225
|
}
|
|
218
226
|
|
|
219
|
-
const allSources = [...input.sources.filter((s) =>
|
|
227
|
+
const allSources = [...input.sources.filter((s) => isTestGraphCandidate(s.path)), ...diskTests];
|
|
220
228
|
const tests: TestGraphEntry[] = [...byPath.values()]
|
|
221
229
|
.sort((a, b) => a.path.localeCompare(b.path))
|
|
222
230
|
.map((source) => {
|
|
@@ -18,10 +18,32 @@ export interface AiGenerationCall {
|
|
|
18
18
|
provider: ForgeAiProvider;
|
|
19
19
|
model: string;
|
|
20
20
|
purpose?: string;
|
|
21
|
-
method: "generateText" | "streamText" | "generateStructured";
|
|
21
|
+
method: "generateText" | "streamText" | "generateStructured" | "runAgent";
|
|
22
22
|
file: string;
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
+
export interface AiToolDefinition {
|
|
26
|
+
name: string;
|
|
27
|
+
file: string;
|
|
28
|
+
description?: string;
|
|
29
|
+
risk: "read" | "write" | "external" | "destructive" | "unknown";
|
|
30
|
+
strict: boolean;
|
|
31
|
+
needsApproval: boolean | "dynamic";
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export interface AiAgentDefinition {
|
|
35
|
+
name: string;
|
|
36
|
+
file: string;
|
|
37
|
+
provider: ForgeAiProvider;
|
|
38
|
+
model: string;
|
|
39
|
+
instructions?: string;
|
|
40
|
+
tools: string[];
|
|
41
|
+
stopWhen:
|
|
42
|
+
| { kind: "stepCount"; maxSteps: number }
|
|
43
|
+
| { kind: "toolCall"; toolName: string }
|
|
44
|
+
| { kind: "default" };
|
|
45
|
+
}
|
|
46
|
+
|
|
25
47
|
export interface AiRegistry {
|
|
26
48
|
schemaVersion: string;
|
|
27
49
|
generatorVersion: string;
|
|
@@ -29,5 +51,7 @@ export interface AiRegistry {
|
|
|
29
51
|
inputHash: string;
|
|
30
52
|
providers: AiProviderDefinition[];
|
|
31
53
|
generations: AiGenerationCall[];
|
|
54
|
+
tools: AiToolDefinition[];
|
|
55
|
+
agents: AiAgentDefinition[];
|
|
32
56
|
diagnostics: unknown[];
|
|
33
57
|
}
|
|
@@ -12,7 +12,14 @@ export type ForgeKind =
|
|
|
12
12
|
| "policy"
|
|
13
13
|
| "workflow"
|
|
14
14
|
| "agent"
|
|
15
|
-
| "
|
|
15
|
+
| "aiTool"
|
|
16
|
+
| "telemetryEvent"
|
|
17
|
+
| "code.function"
|
|
18
|
+
| "code.class"
|
|
19
|
+
| "code.interface"
|
|
20
|
+
| "code.type"
|
|
21
|
+
| "code.const"
|
|
22
|
+
| "code.enum";
|
|
16
23
|
|
|
17
24
|
export interface ForgeSymbol {
|
|
18
25
|
id: string;
|
|
@@ -25,7 +32,7 @@ export interface ForgeSymbol {
|
|
|
25
32
|
meta: Record<string, JsonValue>;
|
|
26
33
|
}
|
|
27
34
|
|
|
28
|
-
export type ForgeEdgeKind = "references" | "registers" | "guards" | "emits";
|
|
35
|
+
export type ForgeEdgeKind = "references" | "registers" | "guards" | "emits" | "imports";
|
|
29
36
|
|
|
30
37
|
export interface ForgeEdge {
|
|
31
38
|
from: string;
|
|
@@ -25,6 +25,24 @@ export interface GenerateResult {
|
|
|
25
25
|
|
|
26
26
|
export interface ForgeAddResult extends GenerateResult {
|
|
27
27
|
alias?: string;
|
|
28
|
+
mode?: "integration" | "package";
|
|
29
|
+
targetKind?: "forge-integration" | "npm-package";
|
|
30
|
+
target?: string;
|
|
31
|
+
packageTarget?: "root" | "frontend" | "backend" | "workspace";
|
|
32
|
+
packageTargetReason?: string;
|
|
33
|
+
explanation?: string;
|
|
34
|
+
recipeVersion?: string;
|
|
35
|
+
recipePackages?: string[];
|
|
36
|
+
requiredSecrets?: string[];
|
|
37
|
+
optionalSecrets?: string[];
|
|
38
|
+
packageSpec?: string;
|
|
39
|
+
packageName?: string;
|
|
40
|
+
packageManager?: string;
|
|
41
|
+
installCommand?: string[];
|
|
42
|
+
nativeInstallCommand?: string[];
|
|
43
|
+
avoidedManualCommand?: string;
|
|
44
|
+
installCwd?: string;
|
|
45
|
+
installWorkspace?: string;
|
|
28
46
|
}
|
|
29
47
|
|
|
30
48
|
export interface InspectResult {
|
|
@@ -45,6 +63,9 @@ export interface AddOptions extends CliCommonOptions {
|
|
|
45
63
|
runtimeInspect: boolean;
|
|
46
64
|
sandboxBackend: SandboxBackend;
|
|
47
65
|
allowScripts: boolean;
|
|
66
|
+
mode?: "auto" | "integration" | "package";
|
|
67
|
+
installWorkspace?: string;
|
|
68
|
+
packageTarget?: "frontend" | "backend";
|
|
48
69
|
}
|
|
49
70
|
|
|
50
71
|
export type InspectTarget =
|
|
@@ -64,6 +85,7 @@ export type InspectTarget =
|
|
|
64
85
|
| "ai"
|
|
65
86
|
| "queries"
|
|
66
87
|
| "api"
|
|
88
|
+
| "external"
|
|
67
89
|
| "client"
|
|
68
90
|
| "frontend"
|
|
69
91
|
| "auth"
|
|
@@ -79,9 +101,15 @@ export type InspectTarget =
|
|
|
79
101
|
| "test-graph"
|
|
80
102
|
| "test-plans"
|
|
81
103
|
| "agent-contract"
|
|
104
|
+
| "agent-tools"
|
|
82
105
|
| "agent-adapters"
|
|
83
106
|
| "capability-map"
|
|
107
|
+
| "summary"
|
|
108
|
+
| "schema"
|
|
109
|
+
| "drift"
|
|
110
|
+
| "handoff"
|
|
84
111
|
| "framework"
|
|
112
|
+
| "imported"
|
|
85
113
|
| "ui"
|
|
86
114
|
| "ui-scenarios"
|
|
87
115
|
| "ui-routes"
|
|
@@ -104,6 +132,7 @@ export interface RunResult {
|
|
|
104
132
|
export interface PmAddOptions {
|
|
105
133
|
ignoreScripts: boolean;
|
|
106
134
|
cwd: string;
|
|
135
|
+
workspace?: string;
|
|
107
136
|
}
|
|
108
137
|
|
|
109
138
|
export interface PmAddResult {
|
|
@@ -145,15 +174,61 @@ export interface VerifyOptions {
|
|
|
145
174
|
smoke?: boolean;
|
|
146
175
|
standard?: boolean;
|
|
147
176
|
scriptTimeoutMs?: number;
|
|
177
|
+
testJobs?: number;
|
|
178
|
+
typechecker?: "tsc" | "native" | "ts7" | "tsgo" | "auto";
|
|
179
|
+
fullTests?: boolean;
|
|
180
|
+
testPlan?: boolean;
|
|
181
|
+
internal?: boolean;
|
|
148
182
|
}
|
|
149
183
|
|
|
150
|
-
export type VerifyProfile = "default" | "smoke" | "standard" | "strict" | "changed";
|
|
184
|
+
export type VerifyProfile = "default" | "smoke" | "standard" | "strict" | "changed" | "internal";
|
|
185
|
+
|
|
186
|
+
export type VerifyTestGraphLane = "parallel" | "isolated" | "serial";
|
|
187
|
+
export type VerifyTestGraphLaneMode = "overlap" | "sequential";
|
|
188
|
+
|
|
189
|
+
export type VerifyTestGraphDurationSource = "profile" | "fallback";
|
|
190
|
+
|
|
191
|
+
export interface VerifyTestGraphPlanChunk {
|
|
192
|
+
index: number;
|
|
193
|
+
lane: VerifyTestGraphLane;
|
|
194
|
+
files: string[];
|
|
195
|
+
estimatedMs: number;
|
|
196
|
+
durationSource: VerifyTestGraphDurationSource;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
export interface VerifyTestGraphPlan {
|
|
200
|
+
schemaVersion: "0.1.0";
|
|
201
|
+
fileCount: number;
|
|
202
|
+
chunkCount: number;
|
|
203
|
+
totalJobs: number;
|
|
204
|
+
laneMode: VerifyTestGraphLaneMode;
|
|
205
|
+
jobs: number;
|
|
206
|
+
isolatedJobs: number;
|
|
207
|
+
lanes: Record<VerifyTestGraphLane, {
|
|
208
|
+
fileCount: number;
|
|
209
|
+
chunkCount: number;
|
|
210
|
+
estimatedMs: number;
|
|
211
|
+
}>;
|
|
212
|
+
chunks: VerifyTestGraphPlanChunk[];
|
|
213
|
+
criticalPathEstimateMs: number;
|
|
214
|
+
profilePath: string;
|
|
215
|
+
profileFound: boolean;
|
|
216
|
+
slowestFiles: Array<{
|
|
217
|
+
file: string;
|
|
218
|
+
lane: VerifyTestGraphLane;
|
|
219
|
+
estimatedMs: number;
|
|
220
|
+
source: VerifyTestGraphDurationSource;
|
|
221
|
+
}>;
|
|
222
|
+
recommendations: string[];
|
|
223
|
+
}
|
|
151
224
|
|
|
152
225
|
export interface VerifyResult {
|
|
153
226
|
ok: boolean;
|
|
154
227
|
profile?: VerifyProfile;
|
|
155
228
|
steps: VerifyStep[];
|
|
156
229
|
diagnostics: Diagnostic[];
|
|
230
|
+
testGraphPlan?: VerifyTestGraphPlan;
|
|
231
|
+
testCoverageReason?: string;
|
|
157
232
|
durationMs?: number;
|
|
158
233
|
exitCode: 0 | 1;
|
|
159
234
|
}
|
|
@@ -31,7 +31,7 @@ export interface FrontendProviderInfo {
|
|
|
31
31
|
|
|
32
32
|
export interface FrontendWebManifest {
|
|
33
33
|
present: boolean;
|
|
34
|
-
framework: "next" | "vite" | "static" | "unknown" | "none";
|
|
34
|
+
framework: "next" | "nuxt" | "vite" | "static" | "unknown" | "none";
|
|
35
35
|
root?: string;
|
|
36
36
|
packageManager?: "bun" | "npm" | "pnpm" | "yarn" | "unknown";
|
|
37
37
|
scripts: {
|
|
@@ -63,7 +63,7 @@ export interface FrontendClientBindingInfo {
|
|
|
63
63
|
export interface FrontendGraph {
|
|
64
64
|
schemaVersion: "0.1.0";
|
|
65
65
|
present: boolean;
|
|
66
|
-
framework: "next" | "vite" | "static" | "unknown" | "none";
|
|
66
|
+
framework: "next" | "nuxt" | "vite" | "static" | "unknown" | "none";
|
|
67
67
|
root?: string;
|
|
68
68
|
dev?: {
|
|
69
69
|
command: string;
|