forgeos 0.1.0-alpha.7 → 0.1.0-alpha.71
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/.agents/skills/forge-agent-fabric/SKILL.md +178 -0
- package/.agents/skills/forge-agent-fabric/references/managed-workflows.md +95 -0
- package/.agents/skills/forge-agent-fabric/references/repository-analysis.md +102 -0
- package/.agents/skills/forge-agent-fabric/scripts/fabric.mjs +46 -0
- package/.agents/skills/forge-agent-fabric/scripts/repository.mjs +44 -0
- package/.npmignore +10 -0
- package/AGENTS.md +142 -90
- package/CHANGELOG.md +870 -9
- package/LICENSE +21 -0
- package/README.md +121 -6
- 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 +47 -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-spring-boot-starter/README.md +32 -0
- package/adapters/java-spring-boot-starter/pom.xml +49 -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/bin/forge.mjs +18 -0
- package/docs/agent-fabric-programs.md +151 -0
- package/docs/agent-fabric.md +582 -0
- package/docs/architecture/agent-fabric/PORTABLE_PROJECTS_PLAN.md +136 -0
- package/docs/architecture/agent-fabric/README.md +180 -0
- package/docs/architecture/agent-fabric/REPOSITORY_MANIFEST_PLAN.md +284 -0
- package/docs/architecture/agent-fabric/WORKFLOW_PROGRAM_V2_ADR.md +81 -0
- package/docs/architecture/agent-fabric/WORKFLOW_PROGRAM_V2_CORRECTIONS.md +39 -0
- package/docs/architecture/agent-fabric/WORKFLOW_PROGRAM_V2_CORRECTIONS_EVIDENCE.md +53 -0
- package/docs/architecture/agent-fabric/WORKFLOW_PROGRAM_V2_EVIDENCE.md +49 -0
- package/docs/architecture/agent-fabric/WORKFLOW_PROGRAM_V2_PLAN.md +590 -0
- package/docs/cair-protocol.md +103 -0
- package/docs/changelog.md +1070 -0
- package/docs/forge-protocol.md +189 -0
- package/docs/repository-agent-benchmark.md +179 -0
- package/docs/repository-analysis.md +139 -0
- package/docs/repository-context-quality.md +179 -0
- package/docs/repository-runtime-observation.md +82 -0
- package/examples/agent-fabric-v2/README.md +70 -0
- package/examples/agent-fabric-v2/item-child.workflow.ts +11 -0
- package/examples/agent-fabric-v2/make-request.mjs +4 -0
- package/examples/agent-fabric-v2/map-child.workflow.ts +10 -0
- package/examples/agent-fabric-v2/migrate.workflow.ts +35 -0
- package/examples/agent-fabric-v2/registry.example.json +256 -0
- package/examples/agent-fabric-v2/run-ui-fixture.ts +48 -0
- package/examples/agent-fabric-v2/ui-audit.workflow.ts +28 -0
- package/examples/agent-fabric-v2/ui-fixture-worker.cjs +36 -0
- package/examples/agent-fabric-v2/visual-population.json +13 -0
- package/examples/agent-fabric-v2/workers/check.mjs +2 -0
- package/examples/agent-fabric-v2/workers/common.mjs +7 -0
- package/examples/agent-fabric-v2/workers/discover.mjs +2 -0
- package/examples/agent-fabric-v2/workers/migrate.mjs +4 -0
- package/examples/agent-fabric-v2/workers/review.mjs +3 -0
- package/examples/go-billing/go.mod +7 -0
- package/examples/go-billing/main.go +120 -0
- package/examples/java-billing/pom.xml +60 -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/package.json +60 -5
- package/schemas/agent-fabric/v0.1/control-event.schema.json +281 -0
- package/schemas/forge-manifest.schema.json +389 -0
- package/scripts/field-test-forgeos.mjs +1021 -0
- package/scripts/install-agent-fabric-skill.mjs +105 -0
- package/src/forge/_generated/releaseManifest.json +1 -2
- package/src/forge/_generated/releaseManifest.ts +3 -3
- package/src/forge/agent-adapters/index.ts +1592 -125
- package/src/forge/agent-adapters/types.ts +225 -1
- package/src/forge/agent-fabric/adapter.ts +131 -0
- package/src/forge/agent-fabric/attached-snapshot.ts +55 -0
- package/src/forge/agent-fabric/attached-task-contract.ts +105 -0
- package/src/forge/agent-fabric/attached-task-service.ts +127 -0
- package/src/forge/agent-fabric/attached-task-store.ts +109 -0
- package/src/forge/agent-fabric/authority.ts +298 -0
- package/src/forge/agent-fabric/canonical.ts +135 -0
- package/src/forge/agent-fabric/codex-adversarial-review.ts +229 -0
- package/src/forge/agent-fabric/codex-sdk-worker.ts +203 -0
- package/src/forge/agent-fabric/conductor.ts +754 -0
- package/src/forge/agent-fabric/dictionary.ts +12 -0
- package/src/forge/agent-fabric/errors.ts +32 -0
- package/src/forge/agent-fabric/hardened-conductor.ts +485 -0
- package/src/forge/agent-fabric/hardened-reducer.ts +211 -0
- package/src/forge/agent-fabric/index.ts +48 -0
- package/src/forge/agent-fabric/journal.ts +116 -0
- package/src/forge/agent-fabric/local-adaptive-digest-worker.mjs +26 -0
- package/src/forge/agent-fabric/local-adaptive-harness.ts +343 -0
- package/src/forge/agent-fabric/local-adaptive-service.ts +398 -0
- package/src/forge/agent-fabric/local-adaptive-worker.ts +146 -0
- package/src/forge/agent-fabric/local-approval-window.ts +211 -0
- package/src/forge/agent-fabric/local-change-review-service.ts +374 -0
- package/src/forge/agent-fabric/local-coding-worker.ts +285 -0
- package/src/forge/agent-fabric/local-control-store.ts +239 -0
- package/src/forge/agent-fabric/local-effect-broker.ts +348 -0
- package/src/forge/agent-fabric/local-evolution-approval.ts +81 -0
- package/src/forge/agent-fabric/local-evolution-profile.ts +87 -0
- package/src/forge/agent-fabric/local-evolution-registry.ts +427 -0
- package/src/forge/agent-fabric/local-evolution-service.ts +200 -0
- package/src/forge/agent-fabric/local-intelligence.ts +281 -0
- package/src/forge/agent-fabric/local-paths.ts +18 -0
- package/src/forge/agent-fabric/local-task-contract.ts +203 -0
- package/src/forge/agent-fabric/local-task-inbox.ts +543 -0
- package/src/forge/agent-fabric/local-task-server.ts +374 -0
- package/src/forge/agent-fabric/local-task-service.ts +982 -0
- package/src/forge/agent-fabric/local-verification.ts +551 -0
- package/src/forge/agent-fabric/managed-environment.ts +205 -0
- package/src/forge/agent-fabric/managed-run-contract.ts +103 -0
- package/src/forge/agent-fabric/managed-run-service.ts +401 -0
- package/src/forge/agent-fabric/managed-run-store.ts +165 -0
- package/src/forge/agent-fabric/managed-workspace.ts +253 -0
- package/src/forge/agent-fabric/p0a.ts +104 -0
- package/src/forge/agent-fabric/p0b-model-adapter.ts +434 -0
- package/src/forge/agent-fabric/planning.ts +155 -0
- package/src/forge/agent-fabric/program-api.ts +37 -0
- package/src/forge/agent-fabric/program-contract.ts +283 -0
- package/src/forge/agent-fabric/program-dsl.ts +126 -0
- package/src/forge/agent-fabric/program-evidence.ts +22 -0
- package/src/forge/agent-fabric/program-image.ts +15 -0
- package/src/forge/agent-fabric/program-lock.ts +50 -0
- package/src/forge/agent-fabric/program-owner.ts +16 -0
- package/src/forge/agent-fabric/program-scheduler.ts +38 -0
- package/src/forge/agent-fabric/program-service.ts +793 -0
- package/src/forge/agent-fabric/program-store.ts +142 -0
- package/src/forge/agent-fabric/program-structure.ts +65 -0
- package/src/forge/agent-fabric/program-types.ts +110 -0
- package/src/forge/agent-fabric/program-view.ts +12 -0
- package/src/forge/agent-fabric/program-worker.ts +108 -0
- package/src/forge/agent-fabric/project-profile.ts +50 -0
- package/src/forge/agent-fabric/project-registry.ts +120 -0
- package/src/forge/agent-fabric/project-runtime.ts +85 -0
- package/src/forge/agent-fabric/readiness.ts +26 -0
- package/src/forge/agent-fabric/reducer.ts +863 -0
- package/src/forge/agent-fabric/repository-context.ts +83 -0
- package/src/forge/agent-fabric/resource-ledger.ts +266 -0
- package/src/forge/agent-fabric/serialized-local-adapter.ts +60 -0
- package/src/forge/agent-fabric/types.ts +424 -0
- package/src/forge/agent-fabric/validation.ts +500 -0
- package/src/forge/agent-fabric/workflow-engine.ts +218 -0
- package/src/forge/agent-fabric/workflow-task-actions.ts +104 -0
- package/src/forge/agent-fabric/workflow-templates.ts +11 -0
- package/src/forge/agent-memory/bridge.ts +1728 -0
- package/src/forge/agent-memory/context-pack.ts +284 -0
- package/src/forge/agent-memory/hook-runner.ts +331 -0
- package/src/forge/agent-memory/mcp.ts +597 -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 +343 -0
- package/src/forge/agent-memory/sources/codex.ts +161 -0
- package/src/forge/agent-memory/sources/cursor.ts +35 -0
- package/src/forge/agent-memory/types.ts +215 -0
- package/src/forge/bench.ts +248 -0
- package/src/forge/brownfield-import/index.ts +896 -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 +118 -0
- package/src/forge/cair/query.ts +478 -0
- package/src/forge/cair/snapshot.ts +315 -0
- package/src/forge/cair/types.ts +255 -0
- package/src/forge/cli/adaptive.ts +51 -0
- package/src/forge/cli/ai.ts +16 -1
- package/src/forge/cli/auth.ts +459 -15
- package/src/forge/cli/authmd.ts +441 -0
- package/src/forge/cli/baseline.ts +112 -0
- package/src/forge/cli/build.ts +20 -4
- package/src/forge/cli/changed.ts +418 -0
- package/src/forge/cli/codex-app-server.ts +877 -0
- package/src/forge/cli/commands.ts +1859 -20
- package/src/forge/cli/db.ts +209 -2
- package/src/forge/cli/deploy.ts +1339 -0
- package/src/forge/cli/deps.ts +150 -23
- package/src/forge/cli/dev.ts +1137 -53
- package/src/forge/cli/docs.ts +265 -0
- package/src/forge/cli/doctor.ts +297 -0
- package/src/forge/cli/env-placeholders.ts +62 -0
- package/src/forge/cli/evolution.ts +40 -0
- package/src/forge/cli/fabric.ts +253 -0
- package/src/forge/cli/field-test.ts +568 -0
- package/src/forge/cli/golden-path.ts +487 -0
- package/src/forge/cli/handoff.ts +336 -0
- package/src/forge/cli/index.ts +1 -0
- package/src/forge/cli/last-run.ts +84 -0
- package/src/forge/cli/main.ts +196 -3
- package/src/forge/cli/new.ts +169 -17
- package/src/forge/cli/next-actions.ts +23 -0
- package/src/forge/cli/output.ts +398 -6
- package/src/forge/cli/parse.ts +1377 -38
- package/src/forge/cli/progress.ts +51 -0
- package/src/forge/cli/query.ts +32 -0
- package/src/forge/cli/release.ts +35 -11
- package/src/forge/cli/repository.ts +151 -0
- package/src/forge/cli/run.ts +42 -0
- package/src/forge/cli/secrets.ts +137 -1
- package/src/forge/cli/seed.ts +581 -0
- package/src/forge/cli/self-host.ts +56 -14
- package/src/forge/cli/studio.ts +2282 -0
- package/src/forge/cli/verify.ts +1458 -32
- package/src/forge/cli/windows.ts +23 -0
- package/src/forge/cli/workos.ts +3509 -0
- package/src/forge/compiler/agent-contract/build.ts +728 -64
- package/src/forge/compiler/agent-contract/types.ts +45 -2
- package/src/forge/compiler/ai-registry/parse.ts +71 -2
- package/src/forge/compiler/api-surface/build.ts +47 -0
- package/src/forge/compiler/app-graph/build.ts +112 -9
- package/src/forge/compiler/app-graph/extract.ts +107 -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/tsconfig-hash.ts +41 -4
- 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 +295 -13
- package/src/forge/compiler/data-graph/build.ts +29 -1
- package/src/forge/compiler/data-graph/parse.ts +20 -4
- package/src/forge/compiler/data-graph/sql/ddl.ts +144 -31
- 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/diagnostics/codes.ts +38 -0
- package/src/forge/compiler/diagnostics/create.ts +28 -2
- 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 +9 -0
- package/src/forge/compiler/external-manifest/registry.ts +217 -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 +142 -14
- package/src/forge/compiler/integration/add.ts +991 -33
- package/src/forge/compiler/integration/plan.ts +43 -12
- package/src/forge/compiler/integration/render.ts +29 -0
- package/src/forge/compiler/integration/snapshot.ts +2 -0
- package/src/forge/compiler/integration/templates/convex.ts +70 -0
- package/src/forge/compiler/integration/templates/index.ts +1 -0
- package/src/forge/compiler/integration/templates/render.ts +38 -0
- package/src/forge/compiler/integration/templates/types.ts +3 -0
- package/src/forge/compiler/integration/templates/workos.ts +1439 -0
- package/src/forge/compiler/make-registry/build.ts +8 -9
- package/src/forge/compiler/orchestrator/fast-check.ts +4 -0
- package/src/forge/compiler/orchestrator/generate-lock.ts +14 -3
- package/src/forge/compiler/orchestrator/manifest.ts +1 -1
- package/src/forge/compiler/orchestrator/plan-profile.ts +23 -0
- package/src/forge/compiler/orchestrator/plan.ts +249 -10
- package/src/forge/compiler/orchestrator/profile.ts +65 -0
- package/src/forge/compiler/orchestrator/run.ts +101 -33
- package/src/forge/compiler/orchestrator/serialize.ts +33 -8
- package/src/forge/compiler/orchestrator/types.ts +1 -1
- package/src/forge/compiler/package-graph/compiler.ts +3 -1
- package/src/forge/compiler/package-graph/constants.ts +1 -1
- package/src/forge/compiler/package-graph/dts-extractor.ts +14 -1
- 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/package-manager/version.ts +36 -12
- package/src/forge/compiler/package-upgrades/planner.ts +155 -18
- package/src/forge/compiler/package-upgrades/types.ts +2 -0
- package/src/forge/compiler/policy-registry/build.ts +47 -2
- package/src/forge/compiler/policy-registry/parse.ts +32 -2
- package/src/forge/compiler/recipes/definitions.ts +63 -0
- package/src/forge/compiler/recipes/index.ts +2 -0
- package/src/forge/compiler/recipes/profiles.ts +81 -0
- package/src/forge/compiler/recipes/registry.ts +6 -0
- package/src/forge/compiler/test-graph/build.ts +11 -3
- package/src/forge/compiler/types/app-graph.ts +8 -2
- package/src/forge/compiler/types/cli.ts +76 -1
- package/src/forge/compiler/types/dev-manifest.ts +4 -0
- package/src/forge/compiler/types/emit.ts +2 -0
- package/src/forge/compiler/types/frontend-graph.ts +2 -2
- package/src/forge/compiler/types/integration.ts +1 -0
- package/src/forge/compiler/types/package-graph.ts +6 -0
- package/src/forge/compiler/types/policy-registry.ts +3 -1
- package/src/forge/delta/broker-runner.mjs +5 -0
- package/src/forge/delta/broker.ts +429 -0
- package/src/forge/delta/classifier.ts +52 -0
- package/src/forge/delta/explain.ts +238 -0
- package/src/forge/delta/git-observer.ts +67 -0
- package/src/forge/delta/ids.ts +44 -0
- package/src/forge/delta/index.ts +25 -0
- package/src/forge/delta/process-identity.ts +37 -0
- package/src/forge/delta/queue-status.ts +190 -0
- package/src/forge/delta/recorder.ts +540 -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 +1139 -0
- package/src/forge/delta/store.ts +3329 -0
- package/src/forge/delta/timeline.ts +178 -0
- package/src/forge/dev/server.ts +1061 -22
- package/src/forge/dev/types.ts +15 -1
- package/src/forge/dev/watch.ts +17 -7
- package/src/forge/dev-console/cycle.ts +285 -33
- package/src/forge/dev-console/types.ts +47 -1
- package/src/forge/impact/index.ts +222 -30
- package/src/forge/impact/types.ts +33 -1
- package/src/forge/intent/index.ts +35 -16
- package/src/forge/make/fields.ts +26 -0
- package/src/forge/make/index.ts +42 -6
- package/src/forge/make/templates.ts +211 -4
- package/src/forge/make/types.ts +2 -1
- package/src/forge/policy.ts +1 -1
- package/src/forge/react/index.ts +160 -2
- package/src/forge/refactor/index.ts +1 -0
- package/src/forge/repair/rules/index.ts +2 -2
- package/src/forge/repository-analysis/adapters/common.ts +72 -0
- package/src/forge/repository-analysis/adapters/docker.ts +185 -0
- package/src/forge/repository-analysis/adapters/java.ts +133 -0
- package/src/forge/repository-analysis/adapters/typescript.ts +350 -0
- package/src/forge/repository-analysis/adapters/vue.ts +71 -0
- package/src/forge/repository-analysis/analyze.ts +434 -0
- package/src/forge/repository-analysis/benchmark.ts +336 -0
- package/src/forge/repository-analysis/cache-gc.ts +154 -0
- package/src/forge/repository-analysis/check-selection.ts +123 -0
- package/src/forge/repository-analysis/context-node.ts +17 -0
- package/src/forge/repository-analysis/context.ts +456 -0
- package/src/forge/repository-analysis/http-resolution.ts +135 -0
- package/src/forge/repository-analysis/identity.ts +45 -0
- package/src/forge/repository-analysis/index.ts +18 -0
- package/src/forge/repository-analysis/nuxt-resolution.ts +188 -0
- package/src/forge/repository-analysis/quality.ts +60 -0
- package/src/forge/repository-analysis/retrieval.ts +309 -0
- package/src/forge/repository-analysis/runtime-artifacts.ts +195 -0
- package/src/forge/repository-analysis/runtime-observation.ts +325 -0
- package/src/forge/repository-analysis/scanner.ts +174 -0
- package/src/forge/repository-analysis/storage.ts +193 -0
- package/src/forge/repository-analysis/test-associations.ts +59 -0
- package/src/forge/repository-analysis/types.ts +99 -0
- package/src/forge/repository-manifest/index.ts +178 -0
- package/src/forge/repository-manifest/types.ts +63 -0
- package/src/forge/review/index.ts +162 -12
- package/src/forge/review/types.ts +15 -0
- package/src/forge/runtime/ai/providers.ts +19 -4
- package/src/forge/runtime/auth/config.ts +17 -0
- package/src/forge/runtime/auth/evaluate.ts +15 -2
- package/src/forge/runtime/auth/resolve.ts +61 -6
- package/src/forge/runtime/auth/types.ts +1 -0
- package/src/forge/runtime/db/factory.ts +1 -3
- package/src/forge/runtime/db/generated-client.ts +13 -2
- package/src/forge/runtime/db/memory-adapter.ts +139 -32
- package/src/forge/runtime/db/pglite-adapter.ts +285 -2
- package/src/forge/runtime/executor.ts +129 -16
- package/src/forge/runtime/external/bridge.ts +663 -0
- package/src/forge/runtime/runner/run-entry.ts +16 -7
- package/src/forge/runtime/telemetry/buffer.ts +4 -1
- package/src/forge/runtime/telemetry/scrubber.ts +35 -5
- package/src/forge/runtime/webhooks/security.ts +12 -7
- package/src/forge/server.ts +71 -7
- package/src/forge/ui/index.ts +831 -19
- package/src/forge/ui/types.ts +3 -1
- package/src/forge/version.ts +1 -1
- package/src/forge/vue/index.ts +422 -0
- package/src/forge/workspace/baseline.ts +112 -0
- package/src/forge/workspace/change-summary.ts +292 -0
- package/src/forge/workspace/forge-cli.ts +42 -0
- package/src/forge/workspace/git-summary.ts +393 -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 +34 -0
- package/templates/agent-workroom/pnpm-workspace.yaml +2 -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 +13 -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 +20 -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/agent-workroom/web/vite.config.ts +36 -0
- package/templates/b2b-support-web/package.json +2 -0
- package/templates/b2b-support-web/pnpm-workspace.yaml +2 -0
- package/templates/b2b-support-web/web/app/page.tsx +2 -2
- package/templates/b2b-support-web/web/lib/forge.ts +9 -2
- package/templates/b2b-support-web/web/next.config.ts +24 -0
- package/templates/b2b-support-web/web/package.json +1 -1
- package/templates/minimal-web/package.json +2 -1
- package/templates/minimal-web/pnpm-workspace.yaml +2 -0
- package/templates/minimal-web/web/index.html +1 -0
- package/templates/minimal-web/web/src/App.tsx +12 -6
- package/templates/minimal-web/web/src/lib/forge.ts +9 -2
- package/templates/minimal-web/web/src/styles.css +34 -0
- package/templates/minimal-web/web/vite.config.ts +36 -0
- package/templates/nuxt-web/.vscode/settings.json +14 -0
- package/templates/nuxt-web/.yarnrc.yml +1 -0
- package/templates/nuxt-web/README.md +30 -0
- package/templates/nuxt-web/forge.config.ts +3 -0
- package/templates/nuxt-web/package.json +37 -0
- package/templates/nuxt-web/pnpm-workspace.yaml +2 -0
- package/templates/nuxt-web/src/actions/logNoteCreated.ts +11 -0
- package/templates/nuxt-web/src/commands/createNote.ts +26 -0
- package/templates/nuxt-web/src/forge/schema.ts +12 -0
- package/templates/nuxt-web/src/policies.ts +6 -0
- package/templates/nuxt-web/src/queries/listNotes.ts +8 -0
- package/templates/nuxt-web/src/queries/liveNotes.ts +8 -0
- package/templates/nuxt-web/tsconfig.json +17 -0
- package/templates/nuxt-web/web/app.vue +67 -0
- package/templates/nuxt-web/web/components/LiveNotes.vue +89 -0
- package/templates/nuxt-web/web/components/NoteComposer.vue +100 -0
- package/templates/nuxt-web/web/composables/forge.ts +13 -0
- package/templates/nuxt-web/web/composables/useNotes.ts +24 -0
- package/templates/nuxt-web/web/nuxt.config.ts +11 -0
- package/templates/nuxt-web/web/package.json +22 -0
- package/templates/nuxt-web/web/plugins/forge.client.ts +10 -0
- package/templates/nuxt-web/web/plugins/forge.server.ts +10 -0
- package/templates/nuxt-web/web/server/api/forge-health.get.ts +7 -0
- package/templates/nuxt-web/web/tsconfig.json +6 -0
- package/templates/vendor-access/.vscode/settings.json +14 -0
- package/templates/vendor-access/README.md +30 -0
- package/templates/vendor-access/forge.config.ts +3 -0
- package/templates/vendor-access/package.json +35 -0
- package/templates/vendor-access/pnpm-workspace.yaml +2 -0
- package/templates/vendor-access/src/commands/addEvidence.ts +42 -0
- package/templates/vendor-access/src/commands/approveAccessRequest.ts +43 -0
- package/templates/vendor-access/src/commands/createAccessRequest.ts +49 -0
- package/templates/vendor-access/src/commands/seedVendorAccessDemo.ts +200 -0
- package/templates/vendor-access/src/forge/schema.ts +74 -0
- package/templates/vendor-access/src/policies.ts +11 -0
- package/templates/vendor-access/src/queries/listVendorAccessDashboard.ts +24 -0
- package/templates/vendor-access/src/queries/liveVendorAccessDashboard.ts +24 -0
- package/templates/vendor-access/tsconfig.json +17 -0
- package/templates/vendor-access/web/index.html +13 -0
- package/templates/vendor-access/web/package.json +21 -0
- package/templates/vendor-access/web/src/App.tsx +573 -0
- package/templates/vendor-access/web/src/lib/forge.ts +20 -0
- package/templates/vendor-access/web/src/main.tsx +205 -0
- package/templates/vendor-access/web/src/styles.css +682 -0
- package/templates/vendor-access/web/tsconfig.json +18 -0
- package/templates/vendor-access/web/vite.config.ts +36 -0
- 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 -7829
- package/src/forge/_generated/agentQuickstart.md +0 -34
- package/src/forge/_generated/agentTools.json +0 -2
- package/src/forge/_generated/agentTools.md +0 -16
- package/src/forge/_generated/agentTools.ts +0 -12
- package/src/forge/_generated/aiContext.ts +0 -125
- package/src/forge/_generated/aiModels.json +0 -2
- package/src/forge/_generated/aiModels.ts +0 -51
- 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 -31
- 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 -14937
- package/src/forge/_generated/appMap.md +0 -55
- 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 -62
- 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 -68
- 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 -177
- package/src/forge/_generated/makeTemplates.json +0 -2
- package/src/forge/_generated/makeTemplates.ts +0 -66
- package/src/forge/_generated/mockMap.json +0 -2
- package/src/forge/_generated/mockMap.ts +0 -7
- package/src/forge/_generated/operationPlaybooks.md +0 -167
- package/src/forge/_generated/packageGraph.json +0 -2
- package/src/forge/_generated/packageGraph.ts +0 -249334
- 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 -334130
- package/src/forge/_generated/runtimeRegistry.ts +0 -2
- package/src/forge/_generated/runtimeRules.md +0 -91
- 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 -3452
- 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
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: forge-agent-fabric
|
|
3
|
+
description: Conduct or resume Forge Agent Fabric tasks and prepare repository manifests, analysis maps and source-bound context in existing projects, including Vue, Java and Docker.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Forge Agent Fabric
|
|
7
|
+
|
|
8
|
+
Keep the user's conversation in Codex. Prepare protocol requests yourself; the user should
|
|
9
|
+
not need to write JSON or operate a second interface. Respect the user's task scope and
|
|
10
|
+
existing authorization. This skill does not authorize publication, deployments or external
|
|
11
|
+
messages. Use subagents for implementation/review when authorized by the user or project.
|
|
12
|
+
|
|
13
|
+
## Locate and connect
|
|
14
|
+
|
|
15
|
+
Resolve the current project's Git root and read its AGENTS.md. Execute with that root
|
|
16
|
+
as cwd, even when the runtime is installed elsewhere. Windows and WSL copies are distinct
|
|
17
|
+
projects. This workflow does not require a Forge application or project dependency.
|
|
18
|
+
|
|
19
|
+
Use the absolute path to this skill's `scripts/fabric.mjs` helper:
|
|
20
|
+
`node <skill-directory>/scripts/fabric.mjs --project <target-git-root> <operation> --json`.
|
|
21
|
+
It reads installer-generated runtime.json or FORGE_FABRIC_CLI and falls back to an installed
|
|
22
|
+
Forge runtime on PATH. Never switch to the runtime's checkout to conduct work.
|
|
23
|
+
|
|
24
|
+
Run `doctor --json` and `ensure-owner --json` through that helper. Register projects with
|
|
25
|
+
`project-register --project-id <stable-id> --json`; inspect registrations with `project-list --json`.
|
|
26
|
+
Registration is needed for multiproject MCP routing, not for ordinary cwd-bound CLI work.
|
|
27
|
+
Optional project preparation, verification and limits live in `.forge/fabric.json`;
|
|
28
|
+
inspect doctor and respect the current project's profile rather than inventing config fields.
|
|
29
|
+
|
|
30
|
+
Forward `capabilities --json` through the helper to distinguish accompanied tasks,
|
|
31
|
+
managed SDK runs and the legacy Ollama pilot. When the user asks Fabric to execute a
|
|
32
|
+
workflow or run Codex workers, select managed execution below. Choose accompanied mode
|
|
33
|
+
when the task is to record work performed by the native session. Both modes need one
|
|
34
|
+
owner; `ensure-owner` reuses or starts it without dispatching workers.
|
|
35
|
+
Do not open the legacy PGlite database independently or kill an unrelated owner.
|
|
36
|
+
|
|
37
|
+
Native MCP tools are `fabric_attached_*`, `fabric_workflow_*` and `fabric_run_*`. If unavailable, the CLI
|
|
38
|
+
offers the same operations. State which transport you actually demonstrated.
|
|
39
|
+
Do not register MCP or change global configuration as a side effect of using this skill.
|
|
40
|
+
|
|
41
|
+
## Analyze an existing repository
|
|
42
|
+
|
|
43
|
+
When asked to prepare a project for Forge maps, read
|
|
44
|
+
[repository analysis](references/repository-analysis.md). Use the shared runtime through
|
|
45
|
+
`scripts/repository.mjs --project <target-directory> manifest|repository|cair <operation>`.
|
|
46
|
+
This helper does not require Git; managed Fabric execution still requires Git with HEAD.
|
|
47
|
+
Discovery returns a proposal. Inspect it against project instructions and code, then prepare
|
|
48
|
+
`forge.manifest.json` only when edits are authorized. Preserve an existing service manifest.
|
|
49
|
+
Validate the repository manifest before analyzing. Maps describe static evidence and
|
|
50
|
+
coverage gaps, not runtime availability or executed test coverage. Checks are suggestions;
|
|
51
|
+
never execute them just because the manifesto contains them. Do not start containers,
|
|
52
|
+
build Java, execute configuration scripts or install hooks/MCP during static analysis.
|
|
53
|
+
Use repository queries to give each task compact context with snapshotId. Refresh analysis
|
|
54
|
+
when sources change, and never reuse source snippets or handles from a stale snapshot.
|
|
55
|
+
For manifests stored outside the project, keep passing the same explicit `--manifest`
|
|
56
|
+
to analysis and CAIR queries; the helper binds their root from `--project`.
|
|
57
|
+
Managed SDK workers receive analysis from their own prepared clone when it contains a
|
|
58
|
+
valid repository manifest. This context supplements acceptance checks and does not
|
|
59
|
+
change publication or review requirements.
|
|
60
|
+
|
|
61
|
+
Read [managed request fields and examples](references/managed-workflows.md) before
|
|
62
|
+
preparing run-start. The references travel with this skill and require no Forge checkout.
|
|
63
|
+
For MCP, inspect tool schemas and select the registered target project explicitly through
|
|
64
|
+
projectId when supported. A fixed-root MCP server is usable only when its root matches
|
|
65
|
+
the target. Never assume a global MCP configuration follows the chat cwd.
|
|
66
|
+
|
|
67
|
+
## Accompanied work
|
|
68
|
+
|
|
69
|
+
1. Create an `attached-propose` with explicit acceptance criteria, relevant file scope and
|
|
70
|
+
checks. Mutations use a complete `--file` JSON request; reads use `--task-id`.
|
|
71
|
+
2. Attach the actual session/agent identity, register an implementation assignment and
|
|
72
|
+
start its attempt. Use actual IDs from the host, not invented claims of verified identity.
|
|
73
|
+
3. For a composed task, record `workflow-plan` and use `workflow-next` packets. Claim a
|
|
74
|
+
step before executing it, then report output digest and evidence. Before checking or
|
|
75
|
+
reviewing source, capture the current snapshot digest from `attached-status`. Successful
|
|
76
|
+
`workflow-result` and `workflow-reconcile` requests must include that actual observed
|
|
77
|
+
digest in the top-level `observedSnapshotDigest` field. Do not fetch a newer digest merely
|
|
78
|
+
to stamp an older result; if source changed, reconcile obsolete work as failed and
|
|
79
|
+
replan or execute a fresh attempt. The scheduler records
|
|
80
|
+
work; it does not invoke the host's subagent tools for you.
|
|
81
|
+
4. Complete implementation and prepare a review with a distinct reviewer attempt.
|
|
82
|
+
Give that Codex subagent requirements, code and the returned exact snapshot/token.
|
|
83
|
+
Submit its report only for that version. Correct findings and obtain a new review
|
|
84
|
+
when files change. Do not mark findings resolved without corrective evidence.
|
|
85
|
+
5. Run the checks relevant to the change and record their outcomes for the current
|
|
86
|
+
snapshot. Record criterion coverage with concrete artifacts or observed checks.
|
|
87
|
+
6. Read `attached-status`. Address the structured unmet reasons before presenting the
|
|
88
|
+
task as ready. Agent-reported records retain that provenance; they are not authenticated
|
|
89
|
+
service executions, human acceptance or proof of production deployment.
|
|
90
|
+
|
|
91
|
+
Reuse a requestId only for the exact same request, including expectedVersion. On a version
|
|
92
|
+
conflict read current state and reconcile; use a new requestId for a new operation. Mutation
|
|
93
|
+
responses are compact acknowledgements; status/context reads return current full state.
|
|
94
|
+
|
|
95
|
+
## Resume and adapt
|
|
96
|
+
|
|
97
|
+
Start with `attached-context` for the known taskId. Do not restart completed work from the
|
|
98
|
+
conversation summary alone. After a host crash use `workflow-recover` for known interrupted
|
|
99
|
+
attempts and reconcile their observed outcomes before dispatching them again. A missing
|
|
100
|
+
result is uncertainty, not success or permission to repeat an effect.
|
|
101
|
+
|
|
102
|
+
Use `workflow-replan` with the expected revision, reason and evidenceRefs. Preserve
|
|
103
|
+
required obligations. Source changes make recorded results stale; the service blocks
|
|
104
|
+
their reuse and replan invalidates affected steps and their dependents. The current
|
|
105
|
+
release binds results conservatively to the task's whole file scope; choose a relevant
|
|
106
|
+
scope and do not promise fine-grained invalidation by individual inputRefs.
|
|
107
|
+
|
|
108
|
+
Keep hooks observational. Missing hook events do not prevent explicit session/tentative
|
|
109
|
+
registration, but do prevent claiming that native hook integration has been demonstrated.
|
|
110
|
+
The accompanied mode recovers work when Codex returns. Managed SDK runs now have a
|
|
111
|
+
separate executor, but still require a live owner; neither mode installs automatic wakeup
|
|
112
|
+
or guarantees execution after the App closes.
|
|
113
|
+
|
|
114
|
+
## Managed execution
|
|
115
|
+
|
|
116
|
+
Choose managed execution when the authorized task calls for owner-dispatched SDK or
|
|
117
|
+
command workers. Keep the native chat as the interface and prepare requests yourself.
|
|
118
|
+
Starting Codex workers can consume configured credits; local publication can change
|
|
119
|
+
files. Use the user's existing scope and authorization, including any cost constraints.
|
|
120
|
+
Do not treat the legacy proposal-only MCP contract as a limit on fabric_run_start.
|
|
121
|
+
|
|
122
|
+
1. Read capabilities and the managed request example in the bundled reference. Prepare
|
|
123
|
+
run-start with requestId, goal, scope, workflow and one executor per node. Codex roles
|
|
124
|
+
are implementer/reviewer/investigator/decision; commands use explicit argv. Choose
|
|
125
|
+
relevant limits, deadlines and scope. inputDigest identifies the declared node contract;
|
|
126
|
+
the owner separately captures actual source inputs. Clones do not copy root node_modules;
|
|
127
|
+
automatic environment preparation installs locked dependencies or copies verified cache
|
|
128
|
+
into the clone, with scripts ignored by default. Optional environment accepts mode
|
|
129
|
+
auto/none, ignoreScripts, HTTPS registry without credentials/query/fragment, and timeoutMs
|
|
130
|
+
100..1800000. Use none for dependency-free steps. Do not assume ignored scripts executed.
|
|
131
|
+
2. Start via `fabric run-start --file run.json --json` or fabric_run_start with
|
|
132
|
+
`{request: BODY}`. Read `run-status --run-id ID`; use run-wait with
|
|
133
|
+
`{runId,cursor,waitMs}` for bounded events, up to 30000 ms. MCP status uses `{runId}`.
|
|
134
|
+
Start and mutations return compact acks; status provides full public state and artifacts.
|
|
135
|
+
3. For publication, use an implementer activity, a required distinct Codex reviewer
|
|
136
|
+
downstream of every writer, and a required command verification downstream of every
|
|
137
|
+
writer. Reviewer approval, command success and workflow completion are required.
|
|
138
|
+
publish false keeps isolated artifacts; publication applies local scoped files and
|
|
139
|
+
does not authorize commit, push or deployment. Do not claim that a model's report is
|
|
140
|
+
executor evidence: state is executor_observed, reports remain agent_reported, and
|
|
141
|
+
outputContract.requiredEvidenceKinds accepts only `executor-observed`.
|
|
142
|
+
4. Steer queues instruction and pauses new dispatch; it does not message the active worker.
|
|
143
|
+
Pause allows active workers to finish. All controls use runId/requestId/expectedVersion.
|
|
144
|
+
Resume optionally adds expectedRevision/nodes/executors/reason/evidenceRefs for replan.
|
|
145
|
+
Read status after version conflicts and issue a new requestId for a changed body.
|
|
146
|
+
5. After cancellation or owner restart, inspect the saved thread, workspace and effects.
|
|
147
|
+
Unknown attempts require run-reconcile with attemptId, resolution failed and reason;
|
|
148
|
+
never manufacture success or retry uncertain effects silently. A new isolated attempt
|
|
149
|
+
may use the saved SDK thread. Publication confirmation uses publication confirm only
|
|
150
|
+
when the owner can observe matching expected files. Resolve uncertainty before resume.
|
|
151
|
+
Publication retry is allowed only after observing the complete original baseline; it
|
|
152
|
+
clears the intent and pauses. Resume explicitly; preserve partial divergent writes.
|
|
153
|
+
|
|
154
|
+
Distinguish implementation, command-fixture tests and actual SDK execution in the delivery
|
|
155
|
+
report. Do not extend a past pilot's acceptance to a new environment or task without
|
|
156
|
+
observed evidence. SDK workers are separate runs, not new chats in the sidebar. Keep the owner session
|
|
157
|
+
visible in task context; do not promise App-closed execution or create a scheduler implicitly.
|
|
158
|
+
|
|
159
|
+
## Program workflows v2
|
|
160
|
+
|
|
161
|
+
For new finite typed workflows use the installed `docs/agent-fabric-programs.md` and
|
|
162
|
+
`examples/agent-fabric-v2/`. The authoring module is `forgeos/agent-fabric/workflows`.
|
|
163
|
+
`program-validate`, `program-start`, `program-status`, `program-wait` and subsequent
|
|
164
|
+
`program-*` mutations use the existing owner; MCP exposes `fabric_program_*`.
|
|
165
|
+
Validate source against the owner registry before dispatch. Every mutation needs a unique
|
|
166
|
+
requestId; subsequent mutations pin expectedVersion. Never treat data-only completed as
|
|
167
|
+
acceptance-ready or infer authority to apply from a worker's report. Preserve uncertain
|
|
168
|
+
outcomes and reconcile observed effects before resume. Fenced replan uses a global barrier;
|
|
169
|
+
Same-run completed output reuse happens before worker preparation; cross-run SDK caching is absent.
|
|
170
|
+
Use operatorVersion 2, explicit Blocks/results, after/sequence and waiting semantics; no legacy migration is required.
|
|
171
|
+
For scoped UI acceptance require item/final owner checks, current evidence and full final obligations.
|
|
172
|
+
Use program-history/program-explain/program-artifact-get/program-diff for inspection.
|
|
173
|
+
When avoiding LLM spending set FORGE_FABRIC_TEST_MODE=1 and use deterministic adapters/SDK stubs.
|
|
174
|
+
Publication still requires the user's task authorization.
|
|
175
|
+
|
|
176
|
+
## Workflow correction contract R2.2
|
|
177
|
+
|
|
178
|
+
Program subworkflows inherit ancestor activity quotas and cancellation; input is explicit. Owner visualCases binds route/viewport/state/dimensions to each population member; do not promise exhaustive UI coverage beyond that catalog. Capture obligations apply by assessment scope. New program runs use program-runs-v3/format 3 with immutable linked journal; no migration of old runs. program-explain includes graph nodes, observed instances and Mermaid. Typed refs/output(operation) improve authoring, while owner schemas remain authoritative. See docs/agent-fabric-programs.md and WORKFLOW_PROGRAM_V2_CORRECTIONS.md in the Forge source. For deterministic validation keep FORGE_FABRIC_TEST_MODE=1; do not launch real providers without explicit user authority.
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
# Managed Codex workflows
|
|
2
|
+
|
|
3
|
+
Commands below are Fabric operation arguments forwarded through `scripts/fabric.mjs`.
|
|
4
|
+
Use the current target Git root, not the directory containing the runtime. The owner
|
|
5
|
+
captures source from that root and creates isolated Git clones. No root node_modules
|
|
6
|
+
directory is shared with clones. A runtime installation is reusable across repositories.
|
|
7
|
+
|
|
8
|
+
## Request shape
|
|
9
|
+
|
|
10
|
+
Prepare `run-start --file <absolute-request.json> --json`; the request file must be inside
|
|
11
|
+
the target Git root. Mutations use a complete JSON
|
|
12
|
+
body; reads use `run-status --run-id ID --json`. The following command-only example
|
|
13
|
+
needs an existing tracked `source.txt` and a working absolute Node executable. Generate
|
|
14
|
+
a fresh requestId for each independent run. Replace example paths with observed paths.
|
|
15
|
+
|
|
16
|
+
```json
|
|
17
|
+
{
|
|
18
|
+
"requestId": "command-smoke-1",
|
|
19
|
+
"goal": "Observe a command in an isolated clone",
|
|
20
|
+
"scope": ["source.txt"],
|
|
21
|
+
"publish": false,
|
|
22
|
+
"environment": {"mode": "none"},
|
|
23
|
+
"workflow": {"workflowId": "command-smoke", "nodes": [{
|
|
24
|
+
"nodeId": "verify", "kind": "verification", "dependsOn": [],
|
|
25
|
+
"inputDigest": "sha256:2689367b205c16ce32ed4200942b8b8b1e262dfc70d9bc9fbc77c49699a4f1df",
|
|
26
|
+
"required": true,
|
|
27
|
+
"outputContract": {"requiredEvidenceKinds": ["executor-observed"]}
|
|
28
|
+
}]},
|
|
29
|
+
"executors": [{"nodeId": "verify", "type": "command",
|
|
30
|
+
"argv": ["/absolute/path/to/node", "-e", "process.stdout.write('ok')"],
|
|
31
|
+
"timeoutMs": 10000}]
|
|
32
|
+
}
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
inputDigest describes the node contract, not the observed source. Calculate SHA-256
|
|
36
|
+
for each actual declared contract. The example digest is SHA-256 of `ok` for this smoke.
|
|
37
|
+
The owner separately captures source inputs. Evidence kind `executor-observed` means
|
|
38
|
+
execution was observed; a model report's content remains `agent_reported`.
|
|
39
|
+
|
|
40
|
+
For code use `implement -> review -> verify` with one executor per node:
|
|
41
|
+
|
|
42
|
+
- implement: `kind: activity`, executor `{nodeId,type:"codex",role:"implementer",prompt,writeScope:[...]}`.
|
|
43
|
+
- review: required activity, Codex `role:"reviewer"`, depending on every writer, prompt requesting independent review and explicit approval/findings.
|
|
44
|
+
- verify: required verification, `type:"command"`, explicit `argv`, depending on every writer; use actual project tests/build checks.
|
|
45
|
+
|
|
46
|
+
Scopes and writeScope are repository-relative. Ensure writeScope stays inside the run
|
|
47
|
+
scope. Set timeoutMs and limits appropriate to the task. Use capabilities/doctor to check
|
|
48
|
+
current constraints. Maximum supported concurrency is four; prefer a small useful fanout.
|
|
49
|
+
Do not prescribe a test command without reading the project's scripts or AGENTS.md.
|
|
50
|
+
|
|
51
|
+
Optional top-level run environment: mode `auto` (default) or `none`, ignoreScripts (default
|
|
52
|
+
true), HTTPS registry without credentials/query/fragment, timeoutMs 100..1800000.
|
|
53
|
+
Auto prepares locked dependencies or copies verified cache content into the clone.
|
|
54
|
+
Ignored scripts have not executed; enable necessary preparation only within authorization.
|
|
55
|
+
An optional `.forge/fabric.json` profile supplies maxConcurrency and environment defaults
|
|
56
|
+
for run-start; explicit request fields win. verificationCommands are suggested argv arrays
|
|
57
|
+
for the agent to select, never commands executed by doctor. Supported profile shape:
|
|
58
|
+
`{schemaVersion:1,maxConcurrency:2,environment:{mode:"auto",ignoreScripts:true},verificationCommands:[["node","--test"]]}`.
|
|
59
|
+
|
|
60
|
+
Publication is local file application, not npm publication. `publish:false` keeps clones
|
|
61
|
+
and artifacts. `publish:true` (the default) requires approval from a distinct required
|
|
62
|
+
Codex reviewer and successful required command verification downstream of all writers.
|
|
63
|
+
Do not claim a model report proves a successful command, production deployment or human
|
|
64
|
+
acceptance. Run with explicit publication intent matching the user's request.
|
|
65
|
+
|
|
66
|
+
## Controls and recovery
|
|
67
|
+
|
|
68
|
+
| Operation | Body |
|
|
69
|
+
| --- | --- |
|
|
70
|
+
| run-wait | `{runId,cursor?,waitMs}`; waitMs 0..30000 |
|
|
71
|
+
| run-pause/run-resume/run-cancel | `{runId,requestId,expectedVersion}` |
|
|
72
|
+
| run-steer | CAS fields plus `instruction`; pauses new dispatch |
|
|
73
|
+
| run-reconcile | CAS fields plus `{attemptId,resolution:"failed",reason}` for uncertain attempts |
|
|
74
|
+
|
|
75
|
+
Mutation acknowledgements are compact. Read run-status for full public state, source
|
|
76
|
+
versions, attempts, artifacts and unmet requirements. Reuse requestId only for an exact
|
|
77
|
+
body replay. After a version conflict read status and create a new requestId for a changed
|
|
78
|
+
operation. Pause allows active workers to finish; steer does not inject messages into the
|
|
79
|
+
active worker. Cancel requests interruption without rolling back external effects.
|
|
80
|
+
|
|
81
|
+
Resume can replan with expectedRevision, nodes, executors, reason and evidenceRefs.
|
|
82
|
+
Preserve required obligations, evidence requirements and limits. Source changes invalidate
|
|
83
|
+
applicable results. Failed or uncertain attempts must not be represented as success.
|
|
84
|
+
|
|
85
|
+
After an owner restart or interruption inspect saved workspace, SDK thread ID and effects.
|
|
86
|
+
Unknown results require reconciliation before retry. New isolated attempts may reuse a
|
|
87
|
+
saved SDK thread. Publication confirmation `{publication:"confirm"}` requires the owner
|
|
88
|
+
to observe matching expected files. Retry `{publication:"retry"}` requires the complete
|
|
89
|
+
original baseline, pauses the run, and needs explicit resume. Preserve divergent partial
|
|
90
|
+
writes instead of overwriting them.
|
|
91
|
+
|
|
92
|
+
MCP run mutations receive `{request: BODY}` plus projectId when routing is enabled;
|
|
93
|
+
status receives `{runId}` plus projectId. Always inspect the available tool schema.
|
|
94
|
+
CLI and MCP must target the same registered root. A configured MCP server being present
|
|
95
|
+
does not prove its tool catalog is loaded or its owner is alive.
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
# Repository manifests and maps
|
|
2
|
+
|
|
3
|
+
Use Forge as analysis tooling in an existing project without adding the Forge application
|
|
4
|
+
runtime. Shared installation is enough. Vue/Nuxt, Java/Spring, TypeScript/JavaScript and
|
|
5
|
+
Docker/Compose adapters report their coverage; partial static knowledge remains partial.
|
|
6
|
+
|
|
7
|
+
Run these with the absolute installed skill helper and an explicit target directory:
|
|
8
|
+
|
|
9
|
+
```text
|
|
10
|
+
node <skill>/scripts/repository.mjs --project <project> manifest discover --json
|
|
11
|
+
node <skill>/scripts/repository.mjs --project <project> manifest validate forge.manifest.json --json
|
|
12
|
+
node <skill>/scripts/repository.mjs --project <project> repository analyze --write --json
|
|
13
|
+
node <skill>/scripts/repository.mjs --project <project> repository context --query routes --json
|
|
14
|
+
node <skill>/scripts/repository.mjs --project <project> repository context --query coverage --json
|
|
15
|
+
node <skill>/scripts/repository.mjs --project <project> repository quality --cases <absolute-reviewed-cases.json> --json
|
|
16
|
+
node <skill>/scripts/repository.mjs --project <project> cair query "Q S name=<symbol>" --snapshot-id <snapshot-id> --json
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
Discovery is read-only by default: it returns a draft for the agent to review and save within the
|
|
20
|
+
user's authorized scope. Confirm component roots and adapters against actual files,
|
|
21
|
+
retain uncertainty, and do not overwrite a service 1.0 manifest. Repository manifests
|
|
22
|
+
use `forgeProtocol: "2.0"` and `kind: "repository"`. Keep paths relative to the project.
|
|
23
|
+
The manifest configures analysis; it is not a hand-maintained symbol inventory.
|
|
24
|
+
|
|
25
|
+
Validate before analyzing. Analysis with `--write` saves explicit output to `.forge/repository/`
|
|
26
|
+
unless a host-local cache destination is requested. Without `--write`, analysis returns
|
|
27
|
+
an ephemeral snapshot and creates no cache. It does not alter
|
|
28
|
+
generated application code, `.gitignore`, application dependencies or global integrations.
|
|
29
|
+
Use `--help` for supported flags and current query grammar. Query results identify the
|
|
30
|
+
snapshot and source evidence; a stale-source diagnostic requires fresh analysis.
|
|
31
|
+
|
|
32
|
+
The helper binds `--project` explicitly for repository operations and CAIR. For a manifest
|
|
33
|
+
kept outside the project, add `--manifest <absolute-file>` consistently to analysis and
|
|
34
|
+
queries. Its location does not redefine the project root. Do not substitute another
|
|
35
|
+
project's snapshot or leave out the external manifest when querying that snapshot.
|
|
36
|
+
|
|
37
|
+
Do not read actual `.env` or secret files to resolve infrastructure. Unknown interpolation,
|
|
38
|
+
dynamic URLs, Java reflection, Vue dynamic components and unresolved imports are gaps,
|
|
39
|
+
not permission to infer certainty. A Compose dependency is declared topology, not observed
|
|
40
|
+
traffic. A statically associated test is not proof that it ran or covered the component.
|
|
41
|
+
|
|
42
|
+
For Fabric, keep analysis configuration in the project before run-start. Each SDK attempt
|
|
43
|
+
analyzes its prepared clone after upstream changes and environment preparation. Clone
|
|
44
|
+
snapshot IDs cannot be substituted with the original checkout's snapshot. Maps do not
|
|
45
|
+
remove required reviews/checks, execute suggested checks, or authorize publication.
|
|
46
|
+
Worker packets prioritize task matches and scoped symbols, include both endpoints of
|
|
47
|
+
every returned edge, and declare truncation when their context budget omits facts.
|
|
48
|
+
Their phase is `prepared-input`, not an assertion about later worker edits. Invalid
|
|
49
|
+
configuration yields unavailable maps without echoing manifest source values in run status.
|
|
50
|
+
|
|
51
|
+
Use optional `component.analysis.aliases` and `component.analysis.nuxt` to declare
|
|
52
|
+
contained local resolution paths that executable config cannot establish statically.
|
|
53
|
+
These paths are relative to the component root. `httpClients` may map a client ID
|
|
54
|
+
(including `$api`) and file scope to a literal base path/API component. Record the
|
|
55
|
+
scenario behind a mapping: a deployment default is declared evidence and never
|
|
56
|
+
observed routing. Keep unknown URLs and ambiguous endpoints unresolved.
|
|
57
|
+
|
|
58
|
+
Task context prioritizes exact/scoped targets, relevant consumers and case-level
|
|
59
|
+
test evidence. A test-file import does not associate all sibling cases with that
|
|
60
|
+
function. Included neighbors outside write scope are read-only. Suggested checks
|
|
61
|
+
retain argv arrays, working directories, selection reasons, cost/category and
|
|
62
|
+
unknown/missing/satisfied symbolic requirements; no check runs during map preparation.
|
|
63
|
+
`ready` means the packet was prepared. Static quality is always partial and does not
|
|
64
|
+
claim runtime observation.
|
|
65
|
+
|
|
66
|
+
For quality review, prepare a JSON task array with `id`, `query`, `expectedFiles`
|
|
67
|
+
and optionally `scope`, `expectedTests`, `forbiddenFiles` and `forbiddenTests`.
|
|
68
|
+
Run `repository quality` against a current explicitly saved snapshot. It returns
|
|
69
|
+
missing/forbidden associations, context size, truncation and recall/precision against
|
|
70
|
+
the supplied expected file set. Require a reviewed set; do not remove failing
|
|
71
|
+
expectations merely to obtain a pass. This read-only benchmark runs no models or
|
|
72
|
+
application tests and cannot establish productivity improvement or executed coverage.
|
|
73
|
+
|
|
74
|
+
Large v2 caches use hash-checked partitions and on-demand hydration, with complete
|
|
75
|
+
integrity validation and a two-partition decoded cache. V1 compatibility is eager;
|
|
76
|
+
wide queries may retain extra results. Analysis with --write maintains orphan caches
|
|
77
|
+
after conservative retention; cache-gc defaults to preview and --write applies it.
|
|
78
|
+
Never reclaim a foreign lock or treat serialized resident bytes as heap usage.
|
|
79
|
+
Use benchmark-plan with reviewed cases and explicit model settings to prepare a paired
|
|
80
|
+
experiment; benchmark-report evaluates supplied evidence without running workers/checks.
|
|
81
|
+
Missing evidence is unknown, and model execution still requires authorized cost/scope.
|
|
82
|
+
Matching parse facts can be reused read-only in a managed clone, but its graph,
|
|
83
|
+
root, manifest/scenario connections and freshness are rebuilt. No per-project
|
|
84
|
+
dependency, native hook or MCP installation is required for this flow. These features
|
|
85
|
+
require a runtime containing the quality implementation; copying a newer skill onto
|
|
86
|
+
an older runtime does not upgrade that runtime.
|
|
87
|
+
|
|
88
|
+
Runtime observations are optional and explicit. Add reviewed `runtime.observations`
|
|
89
|
+
with commands, contained cwd and generated artifact paths, then use `repository
|
|
90
|
+
runtime-plan --environment-id local --json` before `runtime-observe --environment-id
|
|
91
|
+
local --execute --write --json`. The latter executes trusted argv in an independent
|
|
92
|
+
temporary source copy; it is not an OS/network/container security sandbox. Dependencies
|
|
93
|
+
must be prepared by declared commands. Do not copy credentials or assume external
|
|
94
|
+
services are authorized merely because a manifest mentions them. No model runs here.
|
|
95
|
+
`runtime-context` reads sanitized bounded evidence, validates input bindings and expiry,
|
|
96
|
+
and never executes. Nuxt registrations, Spring exports, Docker inspection and HTTP
|
|
97
|
+
traces retain their format-specific limitations; they are not exhaustive runtime coverage.
|
|
98
|
+
Exporters must close external resources they start. No hook or MCP installation is needed
|
|
99
|
+
per project. Fabric can add matching saved observations to a prepared worker packet
|
|
100
|
+
without running an exporter; composed input changes invalidate this reuse. Keep original
|
|
101
|
+
protected repositories read-only and use the dedicated pilot copies for validation.
|
|
102
|
+
See `docs/repository-runtime-observation.md` for the contract and execution examples.
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { readFileSync, realpathSync, existsSync } from 'node:fs';
|
|
3
|
+
import { dirname, resolve, isAbsolute } from 'node:path';
|
|
4
|
+
import { fileURLToPath } from 'node:url';
|
|
5
|
+
import { spawnSync } from 'node:child_process';
|
|
6
|
+
|
|
7
|
+
// Runtime identity is independent of the target project: no cwd from runtime config.
|
|
8
|
+
const skillRoot = resolve(dirname(fileURLToPath(import.meta.url)), '..');
|
|
9
|
+
try {
|
|
10
|
+
const args = process.argv.slice(2);
|
|
11
|
+
let project = process.cwd();
|
|
12
|
+
const index = args.indexOf('--project');
|
|
13
|
+
if (index >= 0) {
|
|
14
|
+
if (!args[index + 1]) throw new Error('--project requires a target directory');
|
|
15
|
+
project = args[index + 1];
|
|
16
|
+
args.splice(index, 2);
|
|
17
|
+
}
|
|
18
|
+
const git = spawnSync('git', ['-C', project, 'rev-parse', '--show-toplevel'], { encoding: 'utf8', windowsHide: true });
|
|
19
|
+
if (git.status !== 0) throw new Error(`Target must be a Git repository: ${project}`);
|
|
20
|
+
const cwd = realpathSync(git.stdout.trim());
|
|
21
|
+
let runtime = {};
|
|
22
|
+
const config = resolve(skillRoot, 'runtime.json');
|
|
23
|
+
if (existsSync(config)) runtime = JSON.parse(readFileSync(config, 'utf8'));
|
|
24
|
+
let cliPath = process.env.FORGE_FABRIC_CLI || runtime.cliPath;
|
|
25
|
+
if (!cliPath) {
|
|
26
|
+
const lookup = spawnSync(process.platform === 'win32' ? 'where.exe' : 'which', ['forge'], { encoding: 'utf8', windowsHide: true });
|
|
27
|
+
const candidates = lookup.stdout?.trim().split(/\r?\n/).filter(Boolean) || [];
|
|
28
|
+
for (const candidate of candidates) {
|
|
29
|
+
const bin = realpathSync(candidate);
|
|
30
|
+
const guesses = [bin, resolve(dirname(bin), 'node_modules/forgeos/bin/forge.mjs')];
|
|
31
|
+
cliPath = guesses.find((path) => path.endsWith('.mjs') && existsSync(path));
|
|
32
|
+
if (cliPath) break;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
if (!cliPath || !isAbsolute(cliPath) || !existsSync(cliPath)) {
|
|
36
|
+
throw new Error('Forge runtime not found. Install this skill with --runtime <absolute forge.mjs>, or set FORGE_FABRIC_CLI to that absolute file.');
|
|
37
|
+
}
|
|
38
|
+
const result = spawnSync(runtime.nodeExecutable || process.execPath, [realpathSync(cliPath), 'fabric', ...args], {
|
|
39
|
+
cwd, stdio: 'inherit', windowsHide: true,
|
|
40
|
+
});
|
|
41
|
+
if (result.error) throw result.error;
|
|
42
|
+
process.exitCode = result.status ?? 1;
|
|
43
|
+
} catch (error) {
|
|
44
|
+
process.stderr.write(`${error.message}\n`);
|
|
45
|
+
process.exitCode = 1;
|
|
46
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { readFileSync, realpathSync, existsSync, statSync } from 'node:fs';
|
|
3
|
+
import { dirname, resolve, isAbsolute } from 'node:path';
|
|
4
|
+
import { fileURLToPath } from 'node:url';
|
|
5
|
+
import { spawnSync } from 'node:child_process';
|
|
6
|
+
|
|
7
|
+
// Analysis can target a directory without Git. Runtime configuration never sets cwd.
|
|
8
|
+
const skillRoot = resolve(dirname(fileURLToPath(import.meta.url)), '..');
|
|
9
|
+
try {
|
|
10
|
+
const args = process.argv.slice(2);
|
|
11
|
+
let project = process.cwd();
|
|
12
|
+
if (args.filter(arg => arg === '--project').length > 1) throw new Error('--project may be supplied only once');
|
|
13
|
+
const index = args.indexOf('--project');
|
|
14
|
+
if (index >= 0) {
|
|
15
|
+
if (!args[index + 1] || args[index + 1].startsWith('--')) throw new Error('--project requires a target directory');
|
|
16
|
+
project = args[index + 1];
|
|
17
|
+
args.splice(index, 2);
|
|
18
|
+
}
|
|
19
|
+
const cwd = realpathSync(project);
|
|
20
|
+
if (!statSync(cwd).isDirectory()) throw new Error('Analysis project must be a directory');
|
|
21
|
+
const surface = args.shift();
|
|
22
|
+
if (!['manifest', 'repository', 'cair'].includes(surface)) throw new Error('Choose manifest, repository or cair before the operation');
|
|
23
|
+
if (index >= 0 && (surface === 'repository' || surface === 'cair' || (surface === 'manifest' && args[0] === 'discover')) && !args.includes('--root')) args.push('--root', cwd);
|
|
24
|
+
let runtime = {};
|
|
25
|
+
const config = resolve(skillRoot, 'runtime.json');
|
|
26
|
+
if (existsSync(config)) runtime = JSON.parse(readFileSync(config, 'utf8'));
|
|
27
|
+
let cliPath = process.env.FORGE_FABRIC_CLI || runtime.cliPath;
|
|
28
|
+
if (!cliPath) {
|
|
29
|
+
const lookup = spawnSync(process.platform === 'win32' ? 'where.exe' : 'which', ['forge'], { encoding: 'utf8', windowsHide: true });
|
|
30
|
+
for (const candidate of lookup.stdout?.trim().split(/\r?\n/).filter(Boolean) || []) {
|
|
31
|
+
const bin = realpathSync(candidate);
|
|
32
|
+
cliPath = [bin, resolve(dirname(bin), 'node_modules/forgeos/bin/forge.mjs')].find(path => path.endsWith('.mjs') && existsSync(path));
|
|
33
|
+
if (cliPath) break;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
if (!cliPath || !isAbsolute(cliPath) || !existsSync(cliPath)) throw new Error('Forge runtime not found. Install this skill with --runtime <absolute forge.mjs>, or set FORGE_FABRIC_CLI.');
|
|
37
|
+
// No recorder Delta side effects for repository reads; artifacts are explicit analyze outputs.
|
|
38
|
+
const result = spawnSync(runtime.nodeExecutable || process.execPath, [realpathSync(cliPath), surface, ...args, '--no-delta'], { cwd, stdio: 'inherit', windowsHide: true });
|
|
39
|
+
if (result.error) throw result.error;
|
|
40
|
+
process.exitCode = result.status ?? 1;
|
|
41
|
+
} catch (error) {
|
|
42
|
+
process.stderr.write(`${error.message}\n`);
|
|
43
|
+
process.exitCode = 1;
|
|
44
|
+
}
|
package/.npmignore
CHANGED
|
@@ -5,5 +5,15 @@ node_modules/
|
|
|
5
5
|
.forge/
|
|
6
6
|
tests/
|
|
7
7
|
examples/
|
|
8
|
+
adapters/**/target/
|
|
9
|
+
examples/**/target/
|
|
10
|
+
*.class
|
|
11
|
+
*.jar
|
|
12
|
+
**/*.class
|
|
13
|
+
**/*.jar
|
|
14
|
+
src/forge/_generated/**
|
|
15
|
+
!src/forge/_generated/
|
|
16
|
+
!src/forge/_generated/releaseManifest.json
|
|
17
|
+
!src/forge/_generated/releaseManifest.ts
|
|
8
18
|
*.tgz
|
|
9
19
|
npm-debug.log*
|