@gpustack/loopwright 0.0.0-stage → 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +191 -0
- package/README.md +356 -2
- package/bin/loopwright.js +3 -0
- package/node_modules/@loopwright/agent-pi/dist/adapter-v2.d.ts +9 -0
- package/node_modules/@loopwright/agent-pi/dist/adapter-v2.js +122 -0
- package/node_modules/@loopwright/agent-pi/dist/adapter.d.ts +30 -0
- package/node_modules/@loopwright/agent-pi/dist/adapter.js +340 -0
- package/node_modules/@loopwright/agent-pi/dist/admission.d.ts +25 -0
- package/node_modules/@loopwright/agent-pi/dist/admission.js +65 -0
- package/node_modules/@loopwright/agent-pi/dist/artifacts.d.ts +15 -0
- package/node_modules/@loopwright/agent-pi/dist/artifacts.js +76 -0
- package/node_modules/@loopwright/agent-pi/dist/boundary.d.ts +18 -0
- package/node_modules/@loopwright/agent-pi/dist/boundary.js +113 -0
- package/node_modules/@loopwright/agent-pi/dist/broker-channel.d.ts +4 -0
- package/node_modules/@loopwright/agent-pi/dist/broker-channel.js +121 -0
- package/node_modules/@loopwright/agent-pi/dist/candidate.d.ts +96 -0
- package/node_modules/@loopwright/agent-pi/dist/candidate.js +1712 -0
- package/node_modules/@loopwright/agent-pi/dist/capture.d.ts +39 -0
- package/node_modules/@loopwright/agent-pi/dist/capture.js +146 -0
- package/node_modules/@loopwright/agent-pi/dist/cas.d.ts +51 -0
- package/node_modules/@loopwright/agent-pi/dist/cas.js +836 -0
- package/node_modules/@loopwright/agent-pi/dist/catalog-api.d.ts +3 -0
- package/node_modules/@loopwright/agent-pi/dist/catalog-api.js +2 -0
- package/node_modules/@loopwright/agent-pi/dist/catalog.d.ts +39 -0
- package/node_modules/@loopwright/agent-pi/dist/catalog.js +280 -0
- package/node_modules/@loopwright/agent-pi/dist/circuit-breaker-limits.d.ts +9 -0
- package/node_modules/@loopwright/agent-pi/dist/circuit-breaker-limits.js +12 -0
- package/node_modules/@loopwright/agent-pi/dist/containers.d.ts +29 -0
- package/node_modules/@loopwright/agent-pi/dist/containers.js +160 -0
- package/node_modules/@loopwright/agent-pi/dist/context.d.ts +56 -0
- package/node_modules/@loopwright/agent-pi/dist/context.js +351 -0
- package/node_modules/@loopwright/agent-pi/dist/daemon.d.ts +8 -0
- package/node_modules/@loopwright/agent-pi/dist/daemon.js +52 -0
- package/node_modules/@loopwright/agent-pi/dist/deadline.d.ts +6 -0
- package/node_modules/@loopwright/agent-pi/dist/deadline.js +18 -0
- package/node_modules/@loopwright/agent-pi/dist/decode-capture.d.ts +39 -0
- package/node_modules/@loopwright/agent-pi/dist/decode-capture.js +287 -0
- package/node_modules/@loopwright/agent-pi/dist/descriptor.d.ts +12 -0
- package/node_modules/@loopwright/agent-pi/dist/descriptor.js +17 -0
- package/node_modules/@loopwright/agent-pi/dist/docker-absence.d.ts +2 -0
- package/node_modules/@loopwright/agent-pi/dist/docker-absence.js +9 -0
- package/node_modules/@loopwright/agent-pi/dist/errors.d.ts +7 -0
- package/node_modules/@loopwright/agent-pi/dist/errors.js +19 -0
- package/node_modules/@loopwright/agent-pi/dist/event-sequence.d.ts +6 -0
- package/node_modules/@loopwright/agent-pi/dist/event-sequence.js +64 -0
- package/node_modules/@loopwright/agent-pi/dist/events.d.ts +19 -0
- package/node_modules/@loopwright/agent-pi/dist/events.js +132 -0
- package/node_modules/@loopwright/agent-pi/dist/execution-guard.d.ts +9 -0
- package/node_modules/@loopwright/agent-pi/dist/execution-guard.js +25 -0
- package/node_modules/@loopwright/agent-pi/dist/execution-lease.d.ts +24 -0
- package/node_modules/@loopwright/agent-pi/dist/execution-lease.js +316 -0
- package/node_modules/@loopwright/agent-pi/dist/execution.d.ts +32 -0
- package/node_modules/@loopwright/agent-pi/dist/execution.js +476 -0
- package/node_modules/@loopwright/agent-pi/dist/external-mcp.d.ts +87 -0
- package/node_modules/@loopwright/agent-pi/dist/external-mcp.js +526 -0
- package/node_modules/@loopwright/agent-pi/dist/factory-bootstrap.d.ts +15 -0
- package/node_modules/@loopwright/agent-pi/dist/factory-bootstrap.js +74 -0
- package/node_modules/@loopwright/agent-pi/dist/host-session.d.ts +51 -0
- package/node_modules/@loopwright/agent-pi/dist/host-session.js +2083 -0
- package/node_modules/@loopwright/agent-pi/dist/http-mcp.d.ts +32 -0
- package/node_modules/@loopwright/agent-pi/dist/http-mcp.js +353 -0
- package/node_modules/@loopwright/agent-pi/dist/index.d.ts +7 -0
- package/node_modules/@loopwright/agent-pi/dist/index.js +4 -0
- package/node_modules/@loopwright/agent-pi/dist/lifecycle.d.ts +13 -0
- package/node_modules/@loopwright/agent-pi/dist/lifecycle.js +11 -0
- package/node_modules/@loopwright/agent-pi/dist/mcp-process.d.ts +35 -0
- package/node_modules/@loopwright/agent-pi/dist/mcp-process.js +92 -0
- package/node_modules/@loopwright/agent-pi/dist/mcp-transport.d.ts +25 -0
- package/node_modules/@loopwright/agent-pi/dist/mcp-transport.js +63 -0
- package/node_modules/@loopwright/agent-pi/dist/mcp.d.ts +23 -0
- package/node_modules/@loopwright/agent-pi/dist/mcp.js +212 -0
- package/node_modules/@loopwright/agent-pi/dist/operation.d.ts +5 -0
- package/node_modules/@loopwright/agent-pi/dist/operation.js +28 -0
- package/node_modules/@loopwright/agent-pi/dist/policy-v2.d.ts +10 -0
- package/node_modules/@loopwright/agent-pi/dist/policy-v2.js +64 -0
- package/node_modules/@loopwright/agent-pi/dist/policy.d.ts +13 -0
- package/node_modules/@loopwright/agent-pi/dist/policy.js +260 -0
- package/node_modules/@loopwright/agent-pi/dist/preflight.d.ts +60 -0
- package/node_modules/@loopwright/agent-pi/dist/preflight.js +700 -0
- package/node_modules/@loopwright/agent-pi/dist/progress-summary.d.ts +1 -0
- package/node_modules/@loopwright/agent-pi/dist/progress-summary.js +119 -0
- package/node_modules/@loopwright/agent-pi/dist/protocol.d.ts +17 -0
- package/node_modules/@loopwright/agent-pi/dist/protocol.js +131 -0
- package/node_modules/@loopwright/agent-pi/dist/provider.d.ts +62 -0
- package/node_modules/@loopwright/agent-pi/dist/provider.js +217 -0
- package/node_modules/@loopwright/agent-pi/dist/receipt.d.ts +3 -0
- package/node_modules/@loopwright/agent-pi/dist/receipt.js +64 -0
- package/node_modules/@loopwright/agent-pi/dist/recovery.d.ts +6 -0
- package/node_modules/@loopwright/agent-pi/dist/recovery.js +188 -0
- package/node_modules/@loopwright/agent-pi/dist/resources.d.ts +13 -0
- package/node_modules/@loopwright/agent-pi/dist/resources.js +81 -0
- package/node_modules/@loopwright/agent-pi/dist/response.d.ts +20 -0
- package/node_modules/@loopwright/agent-pi/dist/response.js +259 -0
- package/node_modules/@loopwright/agent-pi/dist/runtime-profile.d.ts +6 -0
- package/node_modules/@loopwright/agent-pi/dist/runtime-profile.js +37 -0
- package/node_modules/@loopwright/agent-pi/dist/sdk-worker.d.ts +14 -0
- package/node_modules/@loopwright/agent-pi/dist/sdk-worker.js +633 -0
- package/node_modules/@loopwright/agent-pi/dist/sender.d.ts +46 -0
- package/node_modules/@loopwright/agent-pi/dist/sender.js +553 -0
- package/node_modules/@loopwright/agent-pi/dist/session-host.d.ts +21 -0
- package/node_modules/@loopwright/agent-pi/dist/session-host.js +315 -0
- package/node_modules/@loopwright/agent-pi/dist/snapshot-transfer.d.ts +14 -0
- package/node_modules/@loopwright/agent-pi/dist/snapshot-transfer.js +102 -0
- package/node_modules/@loopwright/agent-pi/dist/snapshot.d.ts +19 -0
- package/node_modules/@loopwright/agent-pi/dist/snapshot.js +121 -0
- package/node_modules/@loopwright/agent-pi/dist/tool-process.d.ts +32 -0
- package/node_modules/@loopwright/agent-pi/dist/tool-process.js +85 -0
- package/node_modules/@loopwright/agent-pi/dist/tool-worker.d.ts +2 -0
- package/node_modules/@loopwright/agent-pi/dist/tool-worker.js +105 -0
- package/node_modules/@loopwright/agent-pi/dist/tools.d.ts +36 -0
- package/node_modules/@loopwright/agent-pi/dist/tools.js +128 -0
- package/node_modules/@loopwright/agent-pi/dist/types-v2.d.ts +71 -0
- package/node_modules/@loopwright/agent-pi/dist/types-v2.js +1 -0
- package/node_modules/@loopwright/agent-pi/dist/types.d.ts +314 -0
- package/node_modules/@loopwright/agent-pi/dist/types.js +1 -0
- package/node_modules/@loopwright/agent-pi/dist/usage.d.ts +18 -0
- package/node_modules/@loopwright/agent-pi/dist/usage.js +314 -0
- package/node_modules/@loopwright/agent-pi/dist/workspace-mcp.d.ts +27 -0
- package/node_modules/@loopwright/agent-pi/dist/workspace-mcp.js +142 -0
- package/node_modules/@loopwright/agent-pi/package.json +24 -0
- package/node_modules/@loopwright/agent-pi/runtime/Dockerfile +8 -0
- package/node_modules/@loopwright/agent-pi/runtime/seccomp.json +1 -0
- package/node_modules/@loopwright/cli/dist/arguments.d.ts +19 -0
- package/node_modules/@loopwright/cli/dist/arguments.js +358 -0
- package/node_modules/@loopwright/cli/dist/closure.d.ts +93 -0
- package/node_modules/@loopwright/cli/dist/closure.js +230 -0
- package/node_modules/@loopwright/cli/dist/draft.d.ts +9 -0
- package/node_modules/@loopwright/cli/dist/draft.js +106 -0
- package/node_modules/@loopwright/cli/dist/failure-matrix.d.ts +9 -0
- package/node_modules/@loopwright/cli/dist/failure-matrix.js +701 -0
- package/node_modules/@loopwright/cli/dist/index.d.ts +6 -0
- package/node_modules/@loopwright/cli/dist/index.js +5 -0
- package/node_modules/@loopwright/cli/dist/main.d.ts +22 -0
- package/node_modules/@loopwright/cli/dist/main.js +1855 -0
- package/node_modules/@loopwright/cli/package.json +16 -0
- package/node_modules/@loopwright/controller/dist/acceptance.d.ts +43 -0
- package/node_modules/@loopwright/controller/dist/acceptance.js +446 -0
- package/node_modules/@loopwright/controller/dist/benchmark-gate.d.ts +273 -0
- package/node_modules/@loopwright/controller/dist/benchmark-gate.js +3147 -0
- package/node_modules/@loopwright/controller/dist/budget-observations.d.ts +25 -0
- package/node_modules/@loopwright/controller/dist/budget-observations.js +139 -0
- package/node_modules/@loopwright/controller/dist/bundle.d.ts +26 -0
- package/node_modules/@loopwright/controller/dist/bundle.js +64 -0
- package/node_modules/@loopwright/controller/dist/capture.d.ts +89 -0
- package/node_modules/@loopwright/controller/dist/capture.js +587 -0
- package/node_modules/@loopwright/controller/dist/compile.d.ts +3 -0
- package/node_modules/@loopwright/controller/dist/compile.js +402 -0
- package/node_modules/@loopwright/controller/dist/config.d.ts +22 -0
- package/node_modules/@loopwright/controller/dist/config.js +255 -0
- package/node_modules/@loopwright/controller/dist/controller.d.ts +177 -0
- package/node_modules/@loopwright/controller/dist/controller.js +2135 -0
- package/node_modules/@loopwright/controller/dist/credentials.d.ts +29 -0
- package/node_modules/@loopwright/controller/dist/credentials.js +189 -0
- package/node_modules/@loopwright/controller/dist/deadlines.d.ts +18 -0
- package/node_modules/@loopwright/controller/dist/deadlines.js +71 -0
- package/node_modules/@loopwright/controller/dist/errors.d.ts +27 -0
- package/node_modules/@loopwright/controller/dist/errors.js +41 -0
- package/node_modules/@loopwright/controller/dist/events.d.ts +52 -0
- package/node_modules/@loopwright/controller/dist/events.js +228 -0
- package/node_modules/@loopwright/controller/dist/files.d.ts +51 -0
- package/node_modules/@loopwright/controller/dist/files.js +386 -0
- package/node_modules/@loopwright/controller/dist/finalize.d.ts +25 -0
- package/node_modules/@loopwright/controller/dist/finalize.js +32 -0
- package/node_modules/@loopwright/controller/dist/gate.d.ts +84 -0
- package/node_modules/@loopwright/controller/dist/gate.js +640 -0
- package/node_modules/@loopwright/controller/dist/git-objects.d.ts +11 -0
- package/node_modules/@loopwright/controller/dist/git-objects.js +59 -0
- package/node_modules/@loopwright/controller/dist/git-reader.d.ts +17 -0
- package/node_modules/@loopwright/controller/dist/git-reader.js +40 -0
- package/node_modules/@loopwright/controller/dist/handlers.d.ts +6 -0
- package/node_modules/@loopwright/controller/dist/handlers.js +45 -0
- package/node_modules/@loopwright/controller/dist/handoff.d.ts +71 -0
- package/node_modules/@loopwright/controller/dist/handoff.js +554 -0
- package/node_modules/@loopwright/controller/dist/index.d.ts +41 -0
- package/node_modules/@loopwright/controller/dist/index.js +21 -0
- package/node_modules/@loopwright/controller/dist/inspect.d.ts +30 -0
- package/node_modules/@loopwright/controller/dist/inspect.js +372 -0
- package/node_modules/@loopwright/controller/dist/interpolation.d.ts +9 -0
- package/node_modules/@loopwright/controller/dist/interpolation.js +79 -0
- package/node_modules/@loopwright/controller/dist/ownership.d.ts +41 -0
- package/node_modules/@loopwright/controller/dist/ownership.js +666 -0
- package/node_modules/@loopwright/controller/dist/parser.d.ts +5 -0
- package/node_modules/@loopwright/controller/dist/parser.js +200 -0
- package/node_modules/@loopwright/controller/dist/progress.d.ts +41 -0
- package/node_modules/@loopwright/controller/dist/progress.js +904 -0
- package/node_modules/@loopwright/controller/dist/publication.d.ts +60 -0
- package/node_modules/@loopwright/controller/dist/publication.js +329 -0
- package/node_modules/@loopwright/controller/dist/reconcile.d.ts +26 -0
- package/node_modules/@loopwright/controller/dist/reconcile.js +1378 -0
- package/node_modules/@loopwright/controller/dist/recovery.d.ts +10 -0
- package/node_modules/@loopwright/controller/dist/recovery.js +315 -0
- package/node_modules/@loopwright/controller/dist/refusal-record.d.ts +43 -0
- package/node_modules/@loopwright/controller/dist/refusal-record.js +150 -0
- package/node_modules/@loopwright/controller/dist/registry.d.ts +6 -0
- package/node_modules/@loopwright/controller/dist/registry.js +374 -0
- package/node_modules/@loopwright/controller/dist/repair.d.ts +31 -0
- package/node_modules/@loopwright/controller/dist/repair.js +102 -0
- package/node_modules/@loopwright/controller/dist/report.d.ts +64 -0
- package/node_modules/@loopwright/controller/dist/report.js +596 -0
- package/node_modules/@loopwright/controller/dist/retained.d.ts +284 -0
- package/node_modules/@loopwright/controller/dist/retained.js +193 -0
- package/node_modules/@loopwright/controller/dist/rules.d.ts +31 -0
- package/node_modules/@loopwright/controller/dist/rules.js +110 -0
- package/node_modules/@loopwright/controller/dist/run-eval.d.ts +115 -0
- package/node_modules/@loopwright/controller/dist/run-eval.js +959 -0
- package/node_modules/@loopwright/controller/dist/scheduler.d.ts +10 -0
- package/node_modules/@loopwright/controller/dist/scheduler.js +41 -0
- package/node_modules/@loopwright/controller/dist/schema.d.ts +17 -0
- package/node_modules/@loopwright/controller/dist/schema.js +78 -0
- package/node_modules/@loopwright/controller/dist/source.d.ts +69 -0
- package/node_modules/@loopwright/controller/dist/source.js +872 -0
- package/node_modules/@loopwright/controller/dist/step.d.ts +38 -0
- package/node_modules/@loopwright/controller/dist/step.js +1776 -0
- package/node_modules/@loopwright/controller/dist/storage.d.ts +90 -0
- package/node_modules/@loopwright/controller/dist/storage.js +1345 -0
- package/node_modules/@loopwright/controller/dist/submission.d.ts +51 -0
- package/node_modules/@loopwright/controller/dist/submission.js +292 -0
- package/node_modules/@loopwright/controller/dist/types.d.ts +585 -0
- package/node_modules/@loopwright/controller/dist/types.js +9 -0
- package/node_modules/@loopwright/controller/dist/verification.d.ts +124 -0
- package/node_modules/@loopwright/controller/dist/verification.js +1308 -0
- package/node_modules/@loopwright/controller/dist/verifier-protocol.d.ts +105 -0
- package/node_modules/@loopwright/controller/dist/verifier-protocol.js +1312 -0
- package/node_modules/@loopwright/controller/dist/verifier-worker.d.ts +1 -0
- package/node_modules/@loopwright/controller/dist/verifier-worker.js +33 -0
- package/node_modules/@loopwright/controller/package.json +12 -0
- package/node_modules/@loopwright/core/dist/acceptance.d.ts +108 -0
- package/node_modules/@loopwright/core/dist/acceptance.js +327 -0
- package/node_modules/@loopwright/core/dist/artifacts.d.ts +63 -0
- package/node_modules/@loopwright/core/dist/artifacts.js +356 -0
- package/node_modules/@loopwright/core/dist/boundary.d.ts +21 -0
- package/node_modules/@loopwright/core/dist/boundary.js +484 -0
- package/node_modules/@loopwright/core/dist/contracts.d.ts +287 -0
- package/node_modules/@loopwright/core/dist/contracts.js +694 -0
- package/node_modules/@loopwright/core/dist/diagnostics.d.ts +21 -0
- package/node_modules/@loopwright/core/dist/diagnostics.js +51 -0
- package/node_modules/@loopwright/core/dist/evidence.d.ts +92 -0
- package/node_modules/@loopwright/core/dist/evidence.js +85 -0
- package/node_modules/@loopwright/core/dist/graph.d.ts +8 -0
- package/node_modules/@loopwright/core/dist/graph.js +44 -0
- package/node_modules/@loopwright/core/dist/identity.d.ts +162 -0
- package/node_modules/@loopwright/core/dist/identity.js +80 -0
- package/node_modules/@loopwright/core/dist/index.d.ts +30 -0
- package/node_modules/@loopwright/core/dist/index.js +39 -0
- package/node_modules/@loopwright/core/dist/limits.d.ts +99 -0
- package/node_modules/@loopwright/core/dist/limits.js +59 -0
- package/node_modules/@loopwright/core/dist/results.d.ts +161 -0
- package/node_modules/@loopwright/core/dist/results.js +98 -0
- package/node_modules/@loopwright/core/dist/scope.d.ts +13 -0
- package/node_modules/@loopwright/core/dist/scope.js +154 -0
- package/node_modules/@loopwright/core/dist/scrubber.d.ts +13 -0
- package/node_modules/@loopwright/core/dist/scrubber.js +63 -0
- package/node_modules/@loopwright/core/dist/usage.d.ts +68 -0
- package/node_modules/@loopwright/core/dist/usage.js +56 -0
- package/node_modules/@loopwright/core/package.json +12 -0
- package/node_modules/@loopwright/decisions/dist/benchmark.d.ts +23 -0
- package/node_modules/@loopwright/decisions/dist/benchmark.js +337 -0
- package/node_modules/@loopwright/decisions/dist/client.d.ts +74 -0
- package/node_modules/@loopwright/decisions/dist/client.js +292 -0
- package/node_modules/@loopwright/decisions/dist/index.d.ts +15 -0
- package/node_modules/@loopwright/decisions/dist/index.js +8 -0
- package/node_modules/@loopwright/decisions/dist/nodes.d.ts +63 -0
- package/node_modules/@loopwright/decisions/dist/nodes.js +282 -0
- package/node_modules/@loopwright/decisions/dist/primitives.d.ts +36 -0
- package/node_modules/@loopwright/decisions/dist/primitives.js +300 -0
- package/node_modules/@loopwright/decisions/dist/redaction.d.ts +23 -0
- package/node_modules/@loopwright/decisions/dist/redaction.js +146 -0
- package/node_modules/@loopwright/decisions/dist/router.d.ts +55 -0
- package/node_modules/@loopwright/decisions/dist/router.js +248 -0
- package/node_modules/@loopwright/decisions/dist/schema.d.ts +25 -0
- package/node_modules/@loopwright/decisions/dist/schema.js +536 -0
- package/node_modules/@loopwright/decisions/dist/types.d.ts +394 -0
- package/node_modules/@loopwright/decisions/dist/types.js +80 -0
- package/node_modules/@loopwright/decisions/package.json +12 -0
- package/node_modules/@loopwright/github-app/dist/action.d.ts +90 -0
- package/node_modules/@loopwright/github-app/dist/action.js +2429 -0
- package/node_modules/@loopwright/github-app/dist/config.d.ts +23 -0
- package/node_modules/@loopwright/github-app/dist/config.js +297 -0
- package/node_modules/@loopwright/github-app/dist/digests.d.ts +1 -0
- package/node_modules/@loopwright/github-app/dist/digests.js +1 -0
- package/node_modules/@loopwright/github-app/dist/index.d.ts +14 -0
- package/node_modules/@loopwright/github-app/dist/index.js +13 -0
- package/node_modules/@loopwright/github-app/dist/models-config.d.ts +1 -0
- package/node_modules/@loopwright/github-app/dist/models-config.js +1 -0
- package/node_modules/@loopwright/github-app/dist/output-format.d.ts +1 -0
- package/node_modules/@loopwright/github-app/dist/output-format.js +1 -0
- package/node_modules/@loopwright/github-app/dist/preflight.d.ts +1 -0
- package/node_modules/@loopwright/github-app/dist/preflight.js +1 -0
- package/node_modules/@loopwright/github-app/dist/publisher.d.ts +58 -0
- package/node_modules/@loopwright/github-app/dist/publisher.js +1368 -0
- package/node_modules/@loopwright/github-app/dist/qualification.d.ts +1 -0
- package/node_modules/@loopwright/github-app/dist/qualification.js +1 -0
- package/node_modules/@loopwright/github-app/dist/sandbox.d.ts +1 -0
- package/node_modules/@loopwright/github-app/dist/sandbox.js +1 -0
- package/node_modules/@loopwright/github-app/dist/schema.d.ts +1 -0
- package/node_modules/@loopwright/github-app/dist/schema.js +1 -0
- package/node_modules/@loopwright/github-app/dist/service.d.ts +52 -0
- package/node_modules/@loopwright/github-app/dist/service.js +1658 -0
- package/node_modules/@loopwright/github-app/dist/suite-pr-lookup.d.ts +90 -0
- package/node_modules/@loopwright/github-app/dist/suite-pr-lookup.js +392 -0
- package/node_modules/@loopwright/github-app/dist/taskpack.d.ts +1 -0
- package/node_modules/@loopwright/github-app/dist/taskpack.js +1 -0
- package/node_modules/@loopwright/github-app/dist/tenant-queue.d.ts +44 -0
- package/node_modules/@loopwright/github-app/dist/tenant-queue.js +423 -0
- package/node_modules/@loopwright/github-app/dist/token-broker.d.ts +50 -0
- package/node_modules/@loopwright/github-app/dist/token-broker.js +262 -0
- package/node_modules/@loopwright/github-app/dist/turnkey-memory.d.ts +35 -0
- package/node_modules/@loopwright/github-app/dist/turnkey-memory.js +1654 -0
- package/node_modules/@loopwright/github-app/dist/turnkey.d.ts +16 -0
- package/node_modules/@loopwright/github-app/dist/turnkey.js +34 -0
- package/node_modules/@loopwright/github-app/dist/types.d.ts +220 -0
- package/node_modules/@loopwright/github-app/dist/types.js +14 -0
- package/node_modules/@loopwright/github-app/dist/upstreams.d.ts +13 -0
- package/node_modules/@loopwright/github-app/dist/upstreams.js +65 -0
- package/node_modules/@loopwright/github-app/dist/webhook.d.ts +34 -0
- package/node_modules/@loopwright/github-app/dist/webhook.js +241 -0
- package/node_modules/@loopwright/github-app/dist/yaml.d.ts +1 -0
- package/node_modules/@loopwright/github-app/dist/yaml.js +1 -0
- package/node_modules/@loopwright/github-app/package.json +12 -0
- package/node_modules/@loopwright/hardware-runner/dist/config.d.ts +48 -0
- package/node_modules/@loopwright/hardware-runner/dist/config.js +719 -0
- package/node_modules/@loopwright/hardware-runner/dist/evaluator.d.ts +230 -0
- package/node_modules/@loopwright/hardware-runner/dist/evaluator.js +3178 -0
- package/node_modules/@loopwright/hardware-runner/dist/index.d.ts +13 -0
- package/node_modules/@loopwright/hardware-runner/dist/index.js +9 -0
- package/node_modules/@loopwright/hardware-runner/dist/provenance.d.ts +128 -0
- package/node_modules/@loopwright/hardware-runner/dist/provenance.js +1500 -0
- package/node_modules/@loopwright/hardware-runner/dist/queue.d.ts +81 -0
- package/node_modules/@loopwright/hardware-runner/dist/queue.js +1081 -0
- package/node_modules/@loopwright/hardware-runner/dist/relay-server.d.ts +13 -0
- package/node_modules/@loopwright/hardware-runner/dist/relay-server.js +2997 -0
- package/node_modules/@loopwright/hardware-runner/dist/types.d.ts +239 -0
- package/node_modules/@loopwright/hardware-runner/dist/types.js +12 -0
- package/node_modules/@loopwright/hardware-runner/dist/worker.d.ts +49 -0
- package/node_modules/@loopwright/hardware-runner/dist/worker.js +1646 -0
- package/node_modules/@loopwright/hardware-runner/package.json +12 -0
- package/node_modules/@loopwright/memory/dist/cas.d.ts +21 -0
- package/node_modules/@loopwright/memory/dist/cas.js +510 -0
- package/node_modules/@loopwright/memory/dist/compaction.d.ts +18 -0
- package/node_modules/@loopwright/memory/dist/compaction.js +110 -0
- package/node_modules/@loopwright/memory/dist/finalizer.d.ts +23 -0
- package/node_modules/@loopwright/memory/dist/finalizer.js +538 -0
- package/node_modules/@loopwright/memory/dist/index.d.ts +9 -0
- package/node_modules/@loopwright/memory/dist/index.js +8 -0
- package/node_modules/@loopwright/memory/dist/schema.d.ts +36 -0
- package/node_modules/@loopwright/memory/dist/schema.js +510 -0
- package/node_modules/@loopwright/memory/dist/selector.d.ts +7 -0
- package/node_modules/@loopwright/memory/dist/selector.js +157 -0
- package/node_modules/@loopwright/memory/dist/store.d.ts +51 -0
- package/node_modules/@loopwright/memory/dist/store.js +554 -0
- package/node_modules/@loopwright/memory/dist/types.d.ts +442 -0
- package/node_modules/@loopwright/memory/dist/types.js +8 -0
- package/node_modules/@loopwright/memory/dist/verifier.d.ts +5 -0
- package/node_modules/@loopwright/memory/dist/verifier.js +328 -0
- package/node_modules/@loopwright/memory/package.json +12 -0
- package/node_modules/@loopwright/state/dist/admission.d.ts +321 -0
- package/node_modules/@loopwright/state/dist/admission.js +199 -0
- package/node_modules/@loopwright/state/dist/boundary.d.ts +53 -0
- package/node_modules/@loopwright/state/dist/boundary.js +194 -0
- package/node_modules/@loopwright/state/dist/checkpoint.d.ts +16 -0
- package/node_modules/@loopwright/state/dist/checkpoint.js +84 -0
- package/node_modules/@loopwright/state/dist/clock.d.ts +8 -0
- package/node_modules/@loopwright/state/dist/clock.js +27 -0
- package/node_modules/@loopwright/state/dist/connection.d.ts +55 -0
- package/node_modules/@loopwright/state/dist/connection.js +391 -0
- package/node_modules/@loopwright/state/dist/errors.d.ts +13 -0
- package/node_modules/@loopwright/state/dist/errors.js +34 -0
- package/node_modules/@loopwright/state/dist/index.d.ts +3 -0
- package/node_modules/@loopwright/state/dist/index.js +1 -0
- package/node_modules/@loopwright/state/dist/journal.d.ts +119 -0
- package/node_modules/@loopwright/state/dist/journal.js +72 -0
- package/node_modules/@loopwright/state/dist/model.d.ts +40 -0
- package/node_modules/@loopwright/state/dist/model.js +58 -0
- package/node_modules/@loopwright/state/dist/ownership.d.ts +14 -0
- package/node_modules/@loopwright/state/dist/ownership.js +45 -0
- package/node_modules/@loopwright/state/dist/pages.d.ts +11 -0
- package/node_modules/@loopwright/state/dist/pages.js +41 -0
- package/node_modules/@loopwright/state/dist/receipts.d.ts +33 -0
- package/node_modules/@loopwright/state/dist/receipts.js +97 -0
- package/node_modules/@loopwright/state/dist/schema.d.ts +28 -0
- package/node_modules/@loopwright/state/dist/schema.js +41 -0
- package/node_modules/@loopwright/state/dist/settlement.d.ts +10 -0
- package/node_modules/@loopwright/state/dist/settlement.js +129 -0
- package/node_modules/@loopwright/state/dist/store.d.ts +52 -0
- package/node_modules/@loopwright/state/dist/store.js +100 -0
- package/node_modules/@loopwright/state/dist/types.d.ts +315 -0
- package/node_modules/@loopwright/state/dist/types.js +1 -0
- package/node_modules/@loopwright/state/package.json +12 -0
- package/node_modules/@loopwright/taskpack/dist/baseline-align.d.ts +195 -0
- package/node_modules/@loopwright/taskpack/dist/baseline-align.js +1847 -0
- package/node_modules/@loopwright/taskpack/dist/digests.d.ts +61 -0
- package/node_modules/@loopwright/taskpack/dist/digests.js +715 -0
- package/node_modules/@loopwright/taskpack/dist/index.d.ts +18 -0
- package/node_modules/@loopwright/taskpack/dist/index.js +17 -0
- package/node_modules/@loopwright/taskpack/dist/models-config.d.ts +112 -0
- package/node_modules/@loopwright/taskpack/dist/models-config.js +1026 -0
- package/node_modules/@loopwright/taskpack/dist/output-format.d.ts +28 -0
- package/node_modules/@loopwright/taskpack/dist/output-format.js +157 -0
- package/node_modules/@loopwright/taskpack/dist/preflight.d.ts +130 -0
- package/node_modules/@loopwright/taskpack/dist/preflight.js +1497 -0
- package/node_modules/@loopwright/taskpack/dist/qualification.d.ts +23 -0
- package/node_modules/@loopwright/taskpack/dist/qualification.js +120 -0
- package/node_modules/@loopwright/taskpack/dist/sandbox.d.ts +121 -0
- package/node_modules/@loopwright/taskpack/dist/sandbox.js +2605 -0
- package/node_modules/@loopwright/taskpack/dist/schema.d.ts +197 -0
- package/node_modules/@loopwright/taskpack/dist/schema.js +4189 -0
- package/node_modules/@loopwright/taskpack/dist/scrubber.d.ts +47 -0
- package/node_modules/@loopwright/taskpack/dist/scrubber.js +283 -0
- package/node_modules/@loopwright/taskpack/dist/suite.d.ts +124 -0
- package/node_modules/@loopwright/taskpack/dist/suite.js +3256 -0
- package/node_modules/@loopwright/taskpack/dist/taskpack.d.ts +154 -0
- package/node_modules/@loopwright/taskpack/dist/taskpack.js +3634 -0
- package/node_modules/@loopwright/taskpack/dist/turnkey-memory.d.ts +122 -0
- package/node_modules/@loopwright/taskpack/dist/turnkey-memory.js +483 -0
- package/node_modules/@loopwright/taskpack/dist/turnkey.d.ts +437 -0
- package/node_modules/@loopwright/taskpack/dist/turnkey.js +7313 -0
- package/node_modules/@loopwright/taskpack/dist/types.d.ts +1274 -0
- package/node_modules/@loopwright/taskpack/dist/types.js +99 -0
- package/node_modules/@loopwright/taskpack/dist/upstreams.d.ts +261 -0
- package/node_modules/@loopwright/taskpack/dist/upstreams.js +2242 -0
- package/node_modules/@loopwright/taskpack/dist/yaml.d.ts +18 -0
- package/node_modules/@loopwright/taskpack/dist/yaml.js +167 -0
- package/node_modules/@loopwright/taskpack/package.json +12 -0
- package/node_modules/@loopwright/taskpack-runner/dist/compile-taskpack.d.ts +137 -0
- package/node_modules/@loopwright/taskpack-runner/dist/compile-taskpack.js +474 -0
- package/node_modules/@loopwright/taskpack-runner/dist/corpus.d.ts +8 -0
- package/node_modules/@loopwright/taskpack-runner/dist/corpus.js +129 -0
- package/node_modules/@loopwright/taskpack-runner/dist/index.d.ts +13 -0
- package/node_modules/@loopwright/taskpack-runner/dist/index.js +7 -0
- package/node_modules/@loopwright/taskpack-runner/dist/intake.d.ts +149 -0
- package/node_modules/@loopwright/taskpack-runner/dist/intake.js +135 -0
- package/node_modules/@loopwright/taskpack-runner/dist/parity.d.ts +130 -0
- package/node_modules/@loopwright/taskpack-runner/dist/parity.js +927 -0
- package/node_modules/@loopwright/taskpack-runner/dist/python-bridge.d.ts +68 -0
- package/node_modules/@loopwright/taskpack-runner/dist/python-bridge.js +517 -0
- package/node_modules/@loopwright/taskpack-runner/dist/service.d.ts +149 -0
- package/node_modules/@loopwright/taskpack-runner/dist/service.js +1796 -0
- package/node_modules/@loopwright/taskpack-runner/dist/types.d.ts +29 -0
- package/node_modules/@loopwright/taskpack-runner/dist/types.js +11 -0
- package/node_modules/@loopwright/taskpack-runner/package.json +12 -0
- package/node_modules/@loopwright/taskpack-runner/vendor/runner-auto-sync/README.md +77 -0
- package/node_modules/@loopwright/taskpack-runner/vendor/runner-auto-sync/docs/support-records.md +57 -0
- package/node_modules/@loopwright/taskpack-runner/vendor/runner-auto-sync/docs/supported-runners.md +98 -0
- package/node_modules/@loopwright/taskpack-runner/vendor/runner-auto-sync/manifest.json +205 -0
- package/node_modules/@loopwright/taskpack-runner/vendor/runner-auto-sync/pack/expand_matrix.sh +273 -0
- package/node_modules/@loopwright/taskpack-runner/vendor/runner-auto-sync/pack/matrix.yaml +280 -0
- package/node_modules/@loopwright/taskpack-runner/vendor/runner-auto-sync/pack/resolve_dockerfile.sh +24 -0
- package/node_modules/@loopwright/taskpack-runner/vendor/runner-auto-sync/pyproject.toml +46 -0
- package/node_modules/@loopwright/taskpack-runner/vendor/runner-auto-sync/runtime_runner/runner.py.json +5270 -0
- package/node_modules/@loopwright/taskpack-runner/vendor/runner-auto-sync/tests/auto_sync/fixtures/discovery/legacy-support.md +86 -0
- package/node_modules/@loopwright/taskpack-runner/vendor/runner-auto-sync/tests/auto_sync/fixtures/github/service.py +401 -0
- package/node_modules/@loopwright/taskpack-runner/vendor/runner-auto-sync/tests/auto_sync/fixtures/proposals/analysis.json +95 -0
- package/node_modules/@loopwright/taskpack-runner/vendor/runner-auto-sync/tests/auto_sync/fixtures/proposals/ready.json +109 -0
- package/node_modules/@loopwright/taskpack-runner/vendor/runner-auto-sync/tests/auto_sync/test_assemble.py +263 -0
- package/node_modules/@loopwright/taskpack-runner/vendor/runner-auto-sync/tests/auto_sync/test_check_draft.py +333 -0
- package/node_modules/@loopwright/taskpack-runner/vendor/runner-auto-sync/tests/auto_sync/test_checks.py +1099 -0
- package/node_modules/@loopwright/taskpack-runner/vendor/runner-auto-sync/tests/auto_sync/test_discovery.py +817 -0
- package/node_modules/@loopwright/taskpack-runner/vendor/runner-auto-sync/tests/auto_sync/test_proposal.py +658 -0
- package/node_modules/@loopwright/taskpack-runner/vendor/runner-auto-sync/tests/auto_sync/test_publish.py +987 -0
- package/node_modules/@loopwright/taskpack-runner/vendor/runner-auto-sync/tests/auto_sync/test_summary.py +107 -0
- package/node_modules/@loopwright/taskpack-runner/vendor/runner-auto-sync/tools/auto_sync/agent.py +610 -0
- package/node_modules/@loopwright/taskpack-runner/vendor/runner-auto-sync/tools/auto_sync/assemble.py +84 -0
- package/node_modules/@loopwright/taskpack-runner/vendor/runner-auto-sync/tools/auto_sync/check_draft.py +94 -0
- package/node_modules/@loopwright/taskpack-runner/vendor/runner-auto-sync/tools/auto_sync/checks.py +1002 -0
- package/node_modules/@loopwright/taskpack-runner/vendor/runner-auto-sync/tools/auto_sync/discovery.py +789 -0
- package/node_modules/@loopwright/taskpack-runner/vendor/runner-auto-sync/tools/auto_sync/model.py +557 -0
- package/node_modules/@loopwright/taskpack-runner/vendor/runner-auto-sync/tools/auto_sync/progress.py +174 -0
- package/node_modules/@loopwright/taskpack-runner/vendor/runner-auto-sync/tools/auto_sync/prompts/analysis.md +40 -0
- package/node_modules/@loopwright/taskpack-runner/vendor/runner-auto-sync/tools/auto_sync/prompts/proposal.md +65 -0
- package/node_modules/@loopwright/taskpack-runner/vendor/runner-auto-sync/tools/auto_sync/prompts/repair.md +17 -0
- package/node_modules/@loopwright/taskpack-runner/vendor/runner-auto-sync/tools/auto_sync/proposal.py +903 -0
- package/node_modules/@loopwright/taskpack-runner/vendor/runner-auto-sync/tools/auto_sync/publish.py +997 -0
- package/node_modules/@loopwright/taskpack-runner/vendor/runner-auto-sync/tools/auto_sync/summary.py +131 -0
- package/node_modules/@loopwright/taskpack-runner/vendor/runner-auto-sync/tools/auto_sync/tool-versions.json +133 -0
- package/node_modules/package-lock.json +3021 -0
- package/package-lock.json +3021 -0
- package/package.json +52 -4
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
import { constants } from 'node:fs';
|
|
2
|
+
import { open, lstat, realpath } from 'node:fs/promises';
|
|
3
|
+
import { join, resolve } from 'node:path';
|
|
4
|
+
import { pathToFileURL } from 'node:url';
|
|
5
|
+
import { digestArtifact } from '@loopwright/core';
|
|
6
|
+
import { parseJsonRpcMessage } from '@earendil-works/pi-mcp';
|
|
7
|
+
import { parseBoundedJson } from './context.js';
|
|
8
|
+
import { object, canonical } from './boundary.js';
|
|
9
|
+
import { PiFailure, refuse } from './errors.js';
|
|
10
|
+
export const WORKSPACE_TOOL = Object.freeze({ name: 'read_file', description: 'Read one bounded regular UTF-8 candidate file. No symlinks or host paths.', inputSchema: { type: 'object', properties: { path: { type: 'string' } }, required: ['path'], additionalProperties: false }, annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false } });
|
|
11
|
+
export async function readWorkspace(root, path, maxBytes) {
|
|
12
|
+
if (typeof path !== 'string' || !digestArtifact(path, new Uint8Array()).ok || path.split('/').some(segment => segment.length > 255) || !Number.isSafeInteger(maxBytes) || maxBytes < 1 || maxBytes > 65536)
|
|
13
|
+
refuse('TOOL_DENIED', '', { phase: 'tool' });
|
|
14
|
+
const checkDirectory = async (directory) => { const info = await lstat(directory); if (!info.isDirectory() || info.isSymbolicLink() || await realpath(directory) !== resolve(directory))
|
|
15
|
+
refuse('TOOL_DENIED', '', { phase: 'tool' }); };
|
|
16
|
+
await checkDirectory(root);
|
|
17
|
+
let parent = root;
|
|
18
|
+
for (const part of path.split('/').slice(0, -1)) {
|
|
19
|
+
parent = join(parent, part);
|
|
20
|
+
await checkDirectory(parent);
|
|
21
|
+
}
|
|
22
|
+
const file = join(root, path), before = await lstat(file);
|
|
23
|
+
if (!before.isFile() || before.isSymbolicLink() || before.nlink !== 1)
|
|
24
|
+
refuse('TOOL_DENIED', '', { phase: 'tool' });
|
|
25
|
+
if (before.size > maxBytes)
|
|
26
|
+
refuse('OUTPUT_LIMIT', '', { phase: 'tool' });
|
|
27
|
+
const fd = await open(file, constants.O_RDONLY | constants.O_NOFOLLOW);
|
|
28
|
+
try {
|
|
29
|
+
const info = await fd.stat();
|
|
30
|
+
if (!info.isFile() || info.nlink !== 1 || info.dev !== before.dev || info.ino !== before.ino)
|
|
31
|
+
refuse('TOOL_DENIED', '', { phase: 'tool' });
|
|
32
|
+
if (info.size > maxBytes)
|
|
33
|
+
refuse('OUTPUT_LIMIT', '', { phase: 'tool' });
|
|
34
|
+
const bytes = Buffer.alloc(info.size + 1);
|
|
35
|
+
let offset = 0;
|
|
36
|
+
while (offset < bytes.length) {
|
|
37
|
+
const next = await fd.read(bytes, offset, bytes.length - offset, offset);
|
|
38
|
+
if (!next.bytesRead)
|
|
39
|
+
break;
|
|
40
|
+
offset += next.bytesRead;
|
|
41
|
+
}
|
|
42
|
+
if (offset !== info.size)
|
|
43
|
+
refuse('RECOVERY_REQUIRED', '', { phase: 'tool' });
|
|
44
|
+
return new TextDecoder('utf-8', { fatal: true }).decode(bytes.subarray(0, offset));
|
|
45
|
+
}
|
|
46
|
+
finally {
|
|
47
|
+
await fd.close();
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
export function runWorkspaceServer(ports = {}) {
|
|
51
|
+
let buffer = Buffer.alloc(0), pending = 0, initialized = false, ready = false, ended = false;
|
|
52
|
+
let tail = Promise.resolve();
|
|
53
|
+
const fail = () => { ended = true; process.exitCode = 1; process.stdin.destroy(); process.stdout.end(); };
|
|
54
|
+
const send = async (value) => {
|
|
55
|
+
const line = canonical(value) + '\n';
|
|
56
|
+
if (Buffer.byteLength(line) > 65536 || process.stdout.writableLength + Buffer.byteLength(line) > 262144)
|
|
57
|
+
throw new Error('Owned MCP output bound');
|
|
58
|
+
await new Promise((resolve, reject) => process.stdout.write(line, error => error ? reject(error) : resolve()));
|
|
59
|
+
};
|
|
60
|
+
async function request(value) {
|
|
61
|
+
if (!('method' in value))
|
|
62
|
+
throw new Error('Owned MCP request only');
|
|
63
|
+
if (!('id' in value)) {
|
|
64
|
+
if (value.method === 'notifications/initialized' && initialized)
|
|
65
|
+
ready = true;
|
|
66
|
+
else if (value.method !== 'notifications/cancelled')
|
|
67
|
+
throw new Error('Owned MCP notification');
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
const reply = (result) => send({ jsonrpc: '2.0', id: value.id, result });
|
|
71
|
+
if (value.method === 'initialize' && !initialized) {
|
|
72
|
+
initialized = true;
|
|
73
|
+
await reply({ protocolVersion: '2025-06-18', capabilities: { tools: {} }, serverInfo: { name: 'loopwright-workspace', version: '1' } });
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
76
|
+
if (!ready)
|
|
77
|
+
throw new Error('Owned MCP initialization required');
|
|
78
|
+
if (value.method === 'tools/list') {
|
|
79
|
+
await reply({ tools: ports.tools ?? [WORKSPACE_TOOL] });
|
|
80
|
+
return;
|
|
81
|
+
}
|
|
82
|
+
if (value.method !== 'tools/call') {
|
|
83
|
+
await send({ jsonrpc: '2.0', id: value.id, error: { code: -32601, message: 'MCP_FAILED' } });
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
86
|
+
let result;
|
|
87
|
+
try {
|
|
88
|
+
const keys = Object.keys(value.params ?? {}), params = object(value.params, keys);
|
|
89
|
+
if (keys.some(key => !['name', 'arguments', '_meta'].includes(key)) || typeof params.name !== 'string')
|
|
90
|
+
refuse('TOOL_DENIED', '', { phase: 'tool' });
|
|
91
|
+
const args = object(params.arguments, ['path']);
|
|
92
|
+
if (typeof args.path !== 'string')
|
|
93
|
+
refuse('TOOL_DENIED', '', { phase: 'tool' });
|
|
94
|
+
const token = params._meta?.progressToken;
|
|
95
|
+
const progress = (data) => send({ jsonrpc: '2.0', method: 'notifications/progress', params: { progressToken: token, ...data } });
|
|
96
|
+
if (ports.call)
|
|
97
|
+
result = await ports.call(params.name, args, progress);
|
|
98
|
+
else {
|
|
99
|
+
if (params.name !== 'read_file')
|
|
100
|
+
refuse('TOOL_DENIED', '', { phase: 'tool' });
|
|
101
|
+
result = { content: [{ type: 'text', text: await readWorkspace('/workspace/candidate', args.path, 65536) }] };
|
|
102
|
+
}
|
|
103
|
+
if (Buffer.byteLength(canonical({ jsonrpc: '2.0', id: value.id, result })) + 1 > 65536)
|
|
104
|
+
refuse('OUTPUT_LIMIT', '', { phase: 'tool' });
|
|
105
|
+
}
|
|
106
|
+
catch (error) {
|
|
107
|
+
const code = error instanceof PiFailure ? error.detail.code : 'MCP_FAILED';
|
|
108
|
+
result = { isError: true, content: [{ type: 'text', text: code }] };
|
|
109
|
+
}
|
|
110
|
+
await reply(result);
|
|
111
|
+
}
|
|
112
|
+
process.stdin.on('data', (chunk) => {
|
|
113
|
+
if (ended)
|
|
114
|
+
return;
|
|
115
|
+
try {
|
|
116
|
+
let offset = 0;
|
|
117
|
+
while (offset < chunk.length) {
|
|
118
|
+
const end = chunk.indexOf(10, offset), bytes = chunk.subarray(offset, end < 0 ? chunk.length : end);
|
|
119
|
+
if (buffer.length + bytes.length > 65536)
|
|
120
|
+
throw new Error('Owned MCP input bound');
|
|
121
|
+
buffer = Buffer.concat([buffer, bytes]);
|
|
122
|
+
offset += bytes.length + (end < 0 ? 0 : 1);
|
|
123
|
+
if (end < 0)
|
|
124
|
+
break;
|
|
125
|
+
const message = parseJsonRpcMessage(parseBoundedJson(new TextDecoder('utf-8', { fatal: true }).decode(buffer)));
|
|
126
|
+
buffer = Buffer.alloc(0);
|
|
127
|
+
if (++pending > 32)
|
|
128
|
+
throw new Error('Owned MCP request queue');
|
|
129
|
+
tail = tail.then(() => request(message)).finally(() => { pending--; });
|
|
130
|
+
void tail.catch(fail);
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
catch {
|
|
134
|
+
fail();
|
|
135
|
+
}
|
|
136
|
+
});
|
|
137
|
+
process.stdin.once('end', () => { ended = true; void tail.finally(() => { process.stdout.end(); process.stdin.destroy(); }); });
|
|
138
|
+
process.stdin.once('error', fail);
|
|
139
|
+
process.stdout.once('error', fail);
|
|
140
|
+
}
|
|
141
|
+
if (process.argv[1] && import.meta.url === pathToFileURL(process.argv[1]).href)
|
|
142
|
+
runWorkspaceServer();
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@loopwright/agent-pi",
|
|
3
|
+
"version": "0.0.2",
|
|
4
|
+
"private": true,
|
|
5
|
+
"type": "module",
|
|
6
|
+
"exports": {
|
|
7
|
+
".": {
|
|
8
|
+
"types": "./dist/index.d.ts",
|
|
9
|
+
"import": "./dist/index.js"
|
|
10
|
+
},
|
|
11
|
+
"./catalog": {
|
|
12
|
+
"types": "./dist/catalog-api.d.ts",
|
|
13
|
+
"import": "./dist/catalog-api.js"
|
|
14
|
+
},
|
|
15
|
+
"./host-session": {
|
|
16
|
+
"types": "./dist/host-session.d.ts",
|
|
17
|
+
"import": "./dist/host-session.js"
|
|
18
|
+
},
|
|
19
|
+
"./mcp": {
|
|
20
|
+
"types": "./dist/external-mcp.d.ts",
|
|
21
|
+
"import": "./dist/external-mcp.js"
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
FROM node:26.13.0-bookworm-slim@sha256:067b2d425f1204b5a898ae3d3145f7524c1425a4096a62b0f67dd4344a494440
|
|
2
|
+
WORKDIR /opt/loopwright
|
|
3
|
+
COPY node_modules ./node_modules
|
|
4
|
+
COPY packages ./packages
|
|
5
|
+
COPY package.json package-lock.json ./
|
|
6
|
+
ENV HOME=/tmp/home PI_OFFLINE=1
|
|
7
|
+
USER 1000:1000
|
|
8
|
+
ENTRYPOINT ["node"]
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"defaultAction":"SCMP_ACT_ALLOW","syscalls":[{"names":["mount","umount2","ptrace","unshare","setns","bpf","keyctl","reboot","kexec_load","init_module","finit_module","delete_module","open_by_handle_at"],"action":"SCMP_ACT_ERRNO","errnoRet":1}]}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { type RoleModelOverride } from '@loopwright/controller';
|
|
2
|
+
export declare class UsageError extends Error {
|
|
3
|
+
constructor();
|
|
4
|
+
}
|
|
5
|
+
export type StepAction = 'next' | 'submit' | 'cancel';
|
|
6
|
+
export type DigestAction = 'sync';
|
|
7
|
+
export type SuiteAction = 'check' | 'resolve';
|
|
8
|
+
export type RunnerAction = 'relay' | 'worker';
|
|
9
|
+
export interface Arguments {
|
|
10
|
+
readonly command: 'init' | 'check' | 'run' | 'resume' | 'reconcile' | 'status' | 'inspect' | 'closure' | 'app-serve' | 'step' | 'digest' | 'suite' | 'runner';
|
|
11
|
+
readonly stepAction?: StepAction;
|
|
12
|
+
readonly digestAction?: DigestAction;
|
|
13
|
+
readonly suiteAction?: SuiteAction;
|
|
14
|
+
readonly runnerAction?: RunnerAction;
|
|
15
|
+
readonly roleModelOverrides?: readonly RoleModelOverride[];
|
|
16
|
+
readonly values: ReadonlyMap<string, string>;
|
|
17
|
+
readonly flags: ReadonlySet<string>;
|
|
18
|
+
}
|
|
19
|
+
export declare function parseArguments(argv: readonly string[]): Arguments;
|
|
@@ -0,0 +1,358 @@
|
|
|
1
|
+
import { parseReportOutputFormats } from '@loopwright/controller';
|
|
2
|
+
export class UsageError extends Error {
|
|
3
|
+
constructor() { super('CLI_USAGE'); }
|
|
4
|
+
}
|
|
5
|
+
const commands = {
|
|
6
|
+
init: { required: ['directory'], values: ['directory'], flags: ['force', 'json'] },
|
|
7
|
+
check: { required: ['config', 'registry', 'registry-sha256'], values: ['config', 'registry', 'registry-sha256', 'output'], flags: ['json'], allowRoleModel: true },
|
|
8
|
+
run: { required: [], values: ['config', 'registry', 'registry-sha256', 'taskpack', 'mode', 'baseline-alignment', 'source-revision', 'repo', 'run-root', 'run-id', 'output', 'output-format', 'step-summary-file', 'allow-host-mounts'], flags: ['json', 'dry-run', 'allow-privileged', 'allow-workflow-writes'], allowRoleModel: true },
|
|
9
|
+
resume: { required: ['config', 'registry', 'registry-sha256', 'repo', 'run-root', 'run-id'], values: ['config', 'registry', 'registry-sha256', 'repo', 'run-root', 'run-id', 'output-format', 'step-summary-file'], flags: ['json', 'allow-privileged', 'allow-workflow-writes'], allowRoleModel: true },
|
|
10
|
+
reconcile: { required: ['config', 'registry', 'registry-sha256', 'repo', 'run-root', 'run-id', 'receipt'], values: ['config', 'registry', 'registry-sha256', 'repo', 'run-root', 'run-id', 'receipt', 'output', 'output-format', 'step-summary-file'], flags: ['json', 'allow-workflow-writes'] },
|
|
11
|
+
status: { required: ['run-root', 'run-id'], values: ['run-root', 'run-id'], flags: ['json'] },
|
|
12
|
+
inspect: { required: ['run-root', 'run-id'], values: ['run-root', 'run-id', 'output'], flags: ['json'] },
|
|
13
|
+
closure: { required: [], values: ['repo', 'output'], flags: ['json', 'verify-failures'] },
|
|
14
|
+
'app-serve': { required: ['config'], values: ['config', 'repo'], flags: ['json'] },
|
|
15
|
+
};
|
|
16
|
+
const digestRules = {
|
|
17
|
+
sync: {
|
|
18
|
+
required: ['taskpack'],
|
|
19
|
+
values: ['taskpack', 'repo'],
|
|
20
|
+
flags: ['check', 'json'],
|
|
21
|
+
},
|
|
22
|
+
};
|
|
23
|
+
const suiteRules = {
|
|
24
|
+
check: {
|
|
25
|
+
required: ['suite'],
|
|
26
|
+
values: ['suite', 'repo'],
|
|
27
|
+
flags: ['verify-digests', 'json'],
|
|
28
|
+
},
|
|
29
|
+
resolve: {
|
|
30
|
+
required: ['suite'],
|
|
31
|
+
values: ['suite', 'repo', 'event', 'schedule', 'comment-body', 'pr-head-ref', 'pr-base-ref', 'domain'],
|
|
32
|
+
flags: ['json'],
|
|
33
|
+
},
|
|
34
|
+
};
|
|
35
|
+
const runnerRules = {
|
|
36
|
+
relay: {
|
|
37
|
+
required: ['config'],
|
|
38
|
+
values: ['config'],
|
|
39
|
+
flags: ['json'],
|
|
40
|
+
},
|
|
41
|
+
worker: {
|
|
42
|
+
required: ['config'],
|
|
43
|
+
values: ['config'],
|
|
44
|
+
flags: ['once', 'json'],
|
|
45
|
+
},
|
|
46
|
+
};
|
|
47
|
+
const stepRules = {
|
|
48
|
+
next: {
|
|
49
|
+
required: ['run-root', 'run-id'],
|
|
50
|
+
values: ['run-root', 'run-id', 'config', 'registry', 'registry-sha256', 'taskpack', 'repo', 'mode', 'baseline-alignment', 'source-revision', 'output-format', 'step-summary-file', 'allow-host-mounts'],
|
|
51
|
+
flags: ['reissue-lease', 'json', 'allow-privileged', 'allow-workflow-writes'],
|
|
52
|
+
allowRoleModel: true,
|
|
53
|
+
},
|
|
54
|
+
submit: {
|
|
55
|
+
required: ['run-root', 'run-id', 'lease'],
|
|
56
|
+
values: ['run-root', 'run-id', 'lease', 'submission-file', 'status', 'reason', 'output-format', 'step-summary-file', 'allow-host-mounts'],
|
|
57
|
+
flags: ['json', 'allow-privileged', 'allow-workflow-writes'],
|
|
58
|
+
},
|
|
59
|
+
cancel: {
|
|
60
|
+
required: ['run-root', 'run-id'],
|
|
61
|
+
values: ['run-root', 'run-id', 'output-format', 'step-summary-file'],
|
|
62
|
+
flags: ['json'],
|
|
63
|
+
},
|
|
64
|
+
};
|
|
65
|
+
const STEP_VALUE_KEYS = new Set(['action', ...stepRules.next.values, ...stepRules.submit.values, ...stepRules.cancel.values]);
|
|
66
|
+
const STEP_FLAG_KEYS = new Set([...stepRules.next.flags, ...stepRules.submit.flags, ...stepRules.cancel.flags]);
|
|
67
|
+
const IDENTIFIER_PATTERN = /^[a-z][a-z0-9]*(?:[._-][a-z0-9]+)*$/;
|
|
68
|
+
const MAX_ROLE_MODELS = 8;
|
|
69
|
+
function isValidLabel(value) {
|
|
70
|
+
return value.length >= 1 && value.length <= 128 && !/[\s\p{C}]/u.test(value);
|
|
71
|
+
}
|
|
72
|
+
function parseRoleModelSpec(spec) {
|
|
73
|
+
const eqIdx = spec.indexOf('=');
|
|
74
|
+
if (eqIdx <= 0 || eqIdx === spec.length - 1)
|
|
75
|
+
throw new UsageError();
|
|
76
|
+
const roleId = spec.slice(0, eqIdx);
|
|
77
|
+
const rhs = spec.slice(eqIdx + 1);
|
|
78
|
+
if (roleId.length < 1 || roleId.length > 64 || !IDENTIFIER_PATTERN.test(roleId))
|
|
79
|
+
throw new UsageError();
|
|
80
|
+
const slashIdx = rhs.indexOf('/');
|
|
81
|
+
if (slashIdx <= 0 || slashIdx === rhs.length - 1)
|
|
82
|
+
throw new UsageError();
|
|
83
|
+
const provider = rhs.slice(0, slashIdx);
|
|
84
|
+
const rest = rhs.slice(slashIdx + 1);
|
|
85
|
+
if (!isValidLabel(provider))
|
|
86
|
+
throw new UsageError();
|
|
87
|
+
const colonIdx = rest.indexOf(':');
|
|
88
|
+
let model;
|
|
89
|
+
let thinking;
|
|
90
|
+
if (colonIdx !== -1) {
|
|
91
|
+
if (rest.indexOf(':', colonIdx + 1) !== -1)
|
|
92
|
+
throw new UsageError();
|
|
93
|
+
model = rest.slice(0, colonIdx);
|
|
94
|
+
thinking = rest.slice(colonIdx + 1);
|
|
95
|
+
if (!isValidLabel(thinking))
|
|
96
|
+
throw new UsageError();
|
|
97
|
+
}
|
|
98
|
+
else {
|
|
99
|
+
model = rest;
|
|
100
|
+
}
|
|
101
|
+
if (!isValidLabel(model))
|
|
102
|
+
throw new UsageError();
|
|
103
|
+
return thinking !== undefined ? { roleId, provider, model, thinking } : { roleId, provider, model };
|
|
104
|
+
}
|
|
105
|
+
function validateCommonValues(values) {
|
|
106
|
+
if (values.has('output-format')) {
|
|
107
|
+
try {
|
|
108
|
+
parseReportOutputFormats(values.get('output-format'));
|
|
109
|
+
}
|
|
110
|
+
catch {
|
|
111
|
+
throw new UsageError();
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
if (values.has('step-summary-file') && values.get('step-summary-file').trim().length === 0)
|
|
115
|
+
throw new UsageError();
|
|
116
|
+
if (values.has('run-id') && (values.get('run-id').length > 64 || !IDENTIFIER_PATTERN.test(values.get('run-id'))))
|
|
117
|
+
throw new UsageError();
|
|
118
|
+
}
|
|
119
|
+
function validateTaskpackAlignmentValues(values, hasTaskpack) {
|
|
120
|
+
if (!hasTaskpack && (values.has('baseline-alignment') || values.has('source-revision')))
|
|
121
|
+
throw new UsageError();
|
|
122
|
+
if (values.has('baseline-alignment')) {
|
|
123
|
+
const policy = values.get('baseline-alignment');
|
|
124
|
+
if (policy !== 'off' && policy !== 'fail-fast' && policy !== 'extract-context')
|
|
125
|
+
throw new UsageError();
|
|
126
|
+
}
|
|
127
|
+
if (values.has('source-revision')) {
|
|
128
|
+
const rev = values.get('source-revision');
|
|
129
|
+
if (rev.length === 0 || rev.length > 256 || /[\s\p{C}]/u.test(rev) || rev.startsWith('-'))
|
|
130
|
+
throw new UsageError();
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
function validateStepArguments(stepAction, values, flags, overrides) {
|
|
134
|
+
const rule = stepRules[stepAction];
|
|
135
|
+
if (overrides.length > 0 && !rule.allowRoleModel)
|
|
136
|
+
throw new UsageError();
|
|
137
|
+
for (const key of values.keys()) {
|
|
138
|
+
if (key !== 'action' && !rule.values.includes(key))
|
|
139
|
+
throw new UsageError();
|
|
140
|
+
}
|
|
141
|
+
for (const flag of flags) {
|
|
142
|
+
if (!rule.flags.includes(flag))
|
|
143
|
+
throw new UsageError();
|
|
144
|
+
}
|
|
145
|
+
if (stepAction === 'next') {
|
|
146
|
+
const hasTaskpack = values.has('taskpack');
|
|
147
|
+
const hasAnyConfig = values.has('config') || values.has('registry') || values.has('registry-sha256');
|
|
148
|
+
const hasAllConfig = values.has('config') && values.has('registry') && values.has('registry-sha256');
|
|
149
|
+
if (hasTaskpack && hasAnyConfig)
|
|
150
|
+
throw new UsageError();
|
|
151
|
+
if (hasAnyConfig && (!hasAllConfig || !values.has('repo')))
|
|
152
|
+
throw new UsageError();
|
|
153
|
+
if (hasTaskpack && !values.has('repo'))
|
|
154
|
+
throw new UsageError();
|
|
155
|
+
if (overrides.length > 0 && !hasTaskpack && !values.has('config'))
|
|
156
|
+
throw new UsageError();
|
|
157
|
+
if (values.has('mode')) {
|
|
158
|
+
const mode = values.get('mode');
|
|
159
|
+
if (mode !== 'candidate' && mode !== 'no-change')
|
|
160
|
+
throw new UsageError();
|
|
161
|
+
}
|
|
162
|
+
validateTaskpackAlignmentValues(values, hasTaskpack);
|
|
163
|
+
}
|
|
164
|
+
else if (stepAction === 'submit') {
|
|
165
|
+
if (values.has('lease') && values.get('lease').trim().length === 0)
|
|
166
|
+
throw new UsageError();
|
|
167
|
+
if (values.has('status')) {
|
|
168
|
+
const status = values.get('status');
|
|
169
|
+
if (!['completed', 'no_change', 'failed', 'blocked'].includes(status))
|
|
170
|
+
throw new UsageError();
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
validateCommonValues(values);
|
|
174
|
+
if (rule.required.some(key => !values.has(key)))
|
|
175
|
+
throw new UsageError();
|
|
176
|
+
}
|
|
177
|
+
export function parseArguments(argv) {
|
|
178
|
+
if (argv.length > 64 || argv.some(arg => arg.length > 4096 || /[\0\r\n]/.test(arg)))
|
|
179
|
+
throw new UsageError();
|
|
180
|
+
const rawCommand = argv[0];
|
|
181
|
+
if (!rawCommand)
|
|
182
|
+
throw new UsageError();
|
|
183
|
+
const values = new Map(), flags = new Set();
|
|
184
|
+
const overrides = [];
|
|
185
|
+
const seenRoleIds = new Set();
|
|
186
|
+
const parseOptions = (startIndex, isAllowedFlag, isAllowedValue, allowRoleModel) => {
|
|
187
|
+
for (let index = startIndex; index < argv.length; index++) {
|
|
188
|
+
const raw = argv[index];
|
|
189
|
+
if (!raw.startsWith('--'))
|
|
190
|
+
throw new UsageError();
|
|
191
|
+
const key = raw.slice(2);
|
|
192
|
+
if (key === 'role-model') {
|
|
193
|
+
if (!allowRoleModel || overrides.length >= MAX_ROLE_MODELS)
|
|
194
|
+
throw new UsageError();
|
|
195
|
+
const spec = argv[++index];
|
|
196
|
+
if (!spec || spec.startsWith('--'))
|
|
197
|
+
throw new UsageError();
|
|
198
|
+
const parsed = parseRoleModelSpec(spec);
|
|
199
|
+
if (seenRoleIds.has(parsed.roleId))
|
|
200
|
+
throw new UsageError();
|
|
201
|
+
seenRoleIds.add(parsed.roleId);
|
|
202
|
+
overrides.push(parsed);
|
|
203
|
+
continue;
|
|
204
|
+
}
|
|
205
|
+
if (values.has(key) || flags.has(key))
|
|
206
|
+
throw new UsageError();
|
|
207
|
+
if (isAllowedFlag(key))
|
|
208
|
+
flags.add(key);
|
|
209
|
+
else if (isAllowedValue(key)) {
|
|
210
|
+
const value = argv[++index];
|
|
211
|
+
if (!value || value.startsWith('--'))
|
|
212
|
+
throw new UsageError();
|
|
213
|
+
values.set(key, value);
|
|
214
|
+
}
|
|
215
|
+
else
|
|
216
|
+
throw new UsageError();
|
|
217
|
+
}
|
|
218
|
+
};
|
|
219
|
+
if (rawCommand === 'step') {
|
|
220
|
+
let positionalAction;
|
|
221
|
+
let startIndex = 1;
|
|
222
|
+
if (argv.length > 1 && !argv[1].startsWith('--')) {
|
|
223
|
+
const rawAction = argv[1];
|
|
224
|
+
if (rawAction !== 'next' && rawAction !== 'submit' && rawAction !== 'cancel')
|
|
225
|
+
throw new UsageError();
|
|
226
|
+
positionalAction = rawAction;
|
|
227
|
+
startIndex = 2;
|
|
228
|
+
}
|
|
229
|
+
parseOptions(startIndex, key => STEP_FLAG_KEYS.has(key), key => STEP_VALUE_KEYS.has(key), true);
|
|
230
|
+
if (positionalAction !== undefined && values.has('action'))
|
|
231
|
+
throw new UsageError();
|
|
232
|
+
const resolvedAction = positionalAction ?? values.get('action');
|
|
233
|
+
if (resolvedAction !== 'next' && resolvedAction !== 'submit' && resolvedAction !== 'cancel')
|
|
234
|
+
throw new UsageError();
|
|
235
|
+
validateStepArguments(resolvedAction, values, flags, overrides);
|
|
236
|
+
return {
|
|
237
|
+
command: 'step',
|
|
238
|
+
stepAction: resolvedAction,
|
|
239
|
+
...(overrides.length > 0 ? { roleModelOverrides: overrides } : {}),
|
|
240
|
+
values,
|
|
241
|
+
flags,
|
|
242
|
+
};
|
|
243
|
+
}
|
|
244
|
+
if (rawCommand === 'digest') {
|
|
245
|
+
const rawAction = argv[1];
|
|
246
|
+
if (rawAction !== 'sync')
|
|
247
|
+
throw new UsageError();
|
|
248
|
+
const rule = digestRules[rawAction];
|
|
249
|
+
parseOptions(2, key => rule.flags.includes(key), key => rule.values.includes(key), false);
|
|
250
|
+
if (rule.required.some(key => !values.has(key)))
|
|
251
|
+
throw new UsageError();
|
|
252
|
+
if (values.get('taskpack').trim().length === 0)
|
|
253
|
+
throw new UsageError();
|
|
254
|
+
if (values.has('repo') && values.get('repo').trim().length === 0)
|
|
255
|
+
throw new UsageError();
|
|
256
|
+
return {
|
|
257
|
+
command: 'digest',
|
|
258
|
+
digestAction: rawAction,
|
|
259
|
+
values,
|
|
260
|
+
flags,
|
|
261
|
+
};
|
|
262
|
+
}
|
|
263
|
+
if (rawCommand === 'suite') {
|
|
264
|
+
const rawAction = argv[1];
|
|
265
|
+
if (rawAction !== 'check' && rawAction !== 'resolve')
|
|
266
|
+
throw new UsageError();
|
|
267
|
+
const rule = suiteRules[rawAction];
|
|
268
|
+
parseOptions(2, key => rule.flags.includes(key), key => rule.values.includes(key), false);
|
|
269
|
+
if (rule.required.some(key => !values.has(key)))
|
|
270
|
+
throw new UsageError();
|
|
271
|
+
if (values.get('suite').trim().length === 0)
|
|
272
|
+
throw new UsageError();
|
|
273
|
+
for (const nonEmptyKey of ['repo', 'event', 'schedule', 'pr-head-ref', 'pr-base-ref', 'domain']) {
|
|
274
|
+
if (values.has(nonEmptyKey) && values.get(nonEmptyKey).trim().length === 0)
|
|
275
|
+
throw new UsageError();
|
|
276
|
+
}
|
|
277
|
+
return {
|
|
278
|
+
command: 'suite',
|
|
279
|
+
suiteAction: rawAction,
|
|
280
|
+
values,
|
|
281
|
+
flags,
|
|
282
|
+
};
|
|
283
|
+
}
|
|
284
|
+
if (rawCommand === 'runner') {
|
|
285
|
+
const rawAction = argv[1];
|
|
286
|
+
if (rawAction !== 'relay' && rawAction !== 'worker')
|
|
287
|
+
throw new UsageError();
|
|
288
|
+
const rule = runnerRules[rawAction];
|
|
289
|
+
parseOptions(2, key => rule.flags.includes(key), key => rule.values.includes(key), false);
|
|
290
|
+
if (rule.required.some(key => !values.has(key)))
|
|
291
|
+
throw new UsageError();
|
|
292
|
+
if (values.get('config').trim().length === 0)
|
|
293
|
+
throw new UsageError();
|
|
294
|
+
return {
|
|
295
|
+
command: 'runner',
|
|
296
|
+
runnerAction: rawAction,
|
|
297
|
+
values,
|
|
298
|
+
flags,
|
|
299
|
+
};
|
|
300
|
+
}
|
|
301
|
+
const command = rawCommand;
|
|
302
|
+
if (!Object.hasOwn(commands, command))
|
|
303
|
+
throw new UsageError();
|
|
304
|
+
const rule = commands[command];
|
|
305
|
+
parseOptions(1, key => rule.flags.includes(key), key => rule.values.includes(key), rule.allowRoleModel === true);
|
|
306
|
+
const required = [...rule.required];
|
|
307
|
+
if (command === 'run') {
|
|
308
|
+
const hasTaskpack = values.has('taskpack');
|
|
309
|
+
const hasAnyConfig = values.has('config') || values.has('registry') || values.has('registry-sha256');
|
|
310
|
+
if (hasTaskpack && hasAnyConfig)
|
|
311
|
+
throw new UsageError();
|
|
312
|
+
if (!hasTaskpack && !hasAnyConfig)
|
|
313
|
+
throw new UsageError();
|
|
314
|
+
if (!hasTaskpack && values.has('mode'))
|
|
315
|
+
throw new UsageError();
|
|
316
|
+
validateTaskpackAlignmentValues(values, hasTaskpack);
|
|
317
|
+
if (hasTaskpack) {
|
|
318
|
+
if (values.get('taskpack').trim().length === 0)
|
|
319
|
+
throw new UsageError();
|
|
320
|
+
if (values.has('mode')) {
|
|
321
|
+
const mode = values.get('mode');
|
|
322
|
+
if (mode !== 'candidate' && mode !== 'no-change' && mode !== 'auto')
|
|
323
|
+
throw new UsageError();
|
|
324
|
+
}
|
|
325
|
+
if (flags.has('dry-run')) {
|
|
326
|
+
required.push('repo');
|
|
327
|
+
if (['run-root', 'run-id', 'output-format', 'step-summary-file'].some(key => values.has(key)))
|
|
328
|
+
throw new UsageError();
|
|
329
|
+
}
|
|
330
|
+
else {
|
|
331
|
+
required.push('repo', 'run-root', 'run-id');
|
|
332
|
+
if (values.has('output'))
|
|
333
|
+
throw new UsageError();
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
else {
|
|
337
|
+
required.push('config', 'registry', 'registry-sha256');
|
|
338
|
+
if (!flags.has('dry-run')) {
|
|
339
|
+
required.push('repo', 'run-root', 'run-id');
|
|
340
|
+
if (values.has('output'))
|
|
341
|
+
throw new UsageError();
|
|
342
|
+
}
|
|
343
|
+
if (flags.has('dry-run') && (['repo', 'run-root', 'run-id', 'output-format', 'step-summary-file', 'allow-host-mounts'].some(key => values.has(key))
|
|
344
|
+
|| flags.has('allow-privileged')
|
|
345
|
+
|| flags.has('allow-workflow-writes')))
|
|
346
|
+
throw new UsageError();
|
|
347
|
+
}
|
|
348
|
+
}
|
|
349
|
+
validateCommonValues(values);
|
|
350
|
+
if (required.some(key => !values.has(key)))
|
|
351
|
+
throw new UsageError();
|
|
352
|
+
return {
|
|
353
|
+
command,
|
|
354
|
+
...(overrides.length > 0 ? { roleModelOverrides: overrides } : {}),
|
|
355
|
+
values,
|
|
356
|
+
flags,
|
|
357
|
+
};
|
|
358
|
+
}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
/** Diagnostic codes carried by closure matrix refusals; exit mapping in main.ts stays deterministic. */
|
|
2
|
+
export declare const CLOSURE_FALSIFICATION_FORBIDDEN = "CLOSURE_FALSIFICATION_FORBIDDEN";
|
|
3
|
+
export declare const CLOSURE_EVIDENCE_MISSING = "CLOSURE_EVIDENCE_MISSING";
|
|
4
|
+
export declare const CLOSURE_EVIDENCE_UNTRUSTED = "CLOSURE_EVIDENCE_UNTRUSTED";
|
|
5
|
+
export type ClosureDiagnosticCode = typeof CLOSURE_FALSIFICATION_FORBIDDEN | typeof CLOSURE_EVIDENCE_MISSING | typeof CLOSURE_EVIDENCE_UNTRUSTED | 'CAPABILITY_UNSUPPORTED';
|
|
6
|
+
export type ClosureCapabilityId = 'exclusive-owner-and-unknown-usage' | 'frozen-runner-parity-corpus' | 'frozen-sdk-and-resource-inventory' | 'external-name-and-repair-cap-controls' | 'contract-adversarial-review-coverage' | 'duplicate-json-pointer-rejection' | 'immutable-elapsed-clock-basis' | 'qualified-host-clock-and-storage-profile' | 'state-interface-and-sqlite-limits' | 'admission-error-precedence' | 'pre-send-context-bound-and-estimated-guard' | 'digest-pinned-runtime-image-availability' | 'trusted-config-interpolation-and-mcp-token' | 'mcp-nested-deadline-and-limits-accounting' | 'retained-store-clock-drift-and-reopen-guard' | 'controller-recovery-cancellation-and-cli-surface' | 'external-build-and-accelerator-matrix' | 'remote-host-loss-and-durable-wake' | 'interactive-mcp-oauth-browser-flow' | 'deployed-github-app-and-webhook-ingress' | 'live-provider-billing-and-effort-attestation' | 'reviewed-memory-and-cas-compaction' | 'system-one-decision-routing-and-benchmark';
|
|
7
|
+
export type ClosureDisposition = 'closed_local' | 'deferred_owned' | 'blocked_external';
|
|
8
|
+
export type ClosureEvidenceLevel = 'unit_and_integration' | 'controlled_local_qualification' | 'frozen_offline_parity' | 'unprovisioned_external';
|
|
9
|
+
export type ClosureOwnerPackage = '@loopwright/core' | '@loopwright/state' | '@loopwright/agent-pi' | '@loopwright/controller' | '@loopwright/cli' | '@loopwright/taskpack-runner' | '@loopwright/memory' | '@loopwright/taskpack' | '@loopwright/github-app' | '@loopwright/decisions' | '@loopwright/hardware-runner';
|
|
10
|
+
export type ClosureSubsystem = string;
|
|
11
|
+
export interface ClosureCapabilityEntry {
|
|
12
|
+
readonly id: ClosureCapabilityId;
|
|
13
|
+
readonly title: string;
|
|
14
|
+
readonly subsystem: ClosureSubsystem;
|
|
15
|
+
readonly ownerPackage: ClosureOwnerPackage;
|
|
16
|
+
readonly disposition: ClosureDisposition;
|
|
17
|
+
readonly verificationStatus: 'passed' | 'failed' | 'blocked' | 'not_run';
|
|
18
|
+
readonly evidenceLevel: ClosureEvidenceLevel;
|
|
19
|
+
readonly closureCriterion: string;
|
|
20
|
+
readonly residualBoundary: string;
|
|
21
|
+
readonly unlockPrerequisite: string | null;
|
|
22
|
+
readonly evidencePaths: readonly string[];
|
|
23
|
+
}
|
|
24
|
+
/** Hash-bound operator proof that an unprovisioned external gate was qualified in its target environment. */
|
|
25
|
+
export interface ExternalQualificationReceipt {
|
|
26
|
+
readonly capabilityId: ClosureCapabilityId;
|
|
27
|
+
readonly targetEnvironment: string;
|
|
28
|
+
readonly artifactSha256: string;
|
|
29
|
+
readonly verifierSignature: string;
|
|
30
|
+
readonly issuedAtMs: number;
|
|
31
|
+
}
|
|
32
|
+
export type IntegratedFailureScenarioId = 'malformed_or_conflicting_json_submission' | 'forged_test_pass_without_verifier_evidence' | 'missing_provider_usage_retained_reservation' | 'nested_tool_double_debit_prevention' | 'provider_and_decision_deadline_timeout' | 'concurrent_owner_and_budget_exhaustion' | 'signal_interruption_and_workspace_loss' | 'unknown_external_effect_reconcile_gate' | 'expired_or_stale_gate_token_rejection' | 'mutated_pr_head_publication_abort' | 'stale_memory_source_exclusion' | 'compaction_pending_operation_preservation' | 'untrusted_taskpack_and_oauth_boundary_refusal' | 'decision_authority_escalation_refusal';
|
|
33
|
+
export interface IntegratedFailureScenarioResult {
|
|
34
|
+
readonly scenarioId: IntegratedFailureScenarioId;
|
|
35
|
+
readonly passed: boolean;
|
|
36
|
+
readonly diagnosticCode: string | null;
|
|
37
|
+
readonly assertions: readonly string[];
|
|
38
|
+
readonly elapsedMs: number;
|
|
39
|
+
}
|
|
40
|
+
export interface IntegratedFailureMatrixReport {
|
|
41
|
+
readonly version: 1;
|
|
42
|
+
readonly total: number;
|
|
43
|
+
readonly passed: number;
|
|
44
|
+
readonly failed: number;
|
|
45
|
+
readonly allPassed: boolean;
|
|
46
|
+
readonly scenarios: readonly IntegratedFailureScenarioResult[];
|
|
47
|
+
}
|
|
48
|
+
export interface ClosureEvidenceFailure {
|
|
49
|
+
readonly capabilityId: ClosureCapabilityId | null;
|
|
50
|
+
readonly path: string;
|
|
51
|
+
readonly code: typeof CLOSURE_EVIDENCE_MISSING | typeof CLOSURE_EVIDENCE_UNTRUSTED;
|
|
52
|
+
readonly detail: string;
|
|
53
|
+
}
|
|
54
|
+
export interface ClosureIntegrityReport {
|
|
55
|
+
readonly ok: boolean;
|
|
56
|
+
readonly checkedFiles: number;
|
|
57
|
+
readonly failures: readonly ClosureEvidenceFailure[];
|
|
58
|
+
}
|
|
59
|
+
export interface ClosureDiagnostic {
|
|
60
|
+
readonly code: ClosureDiagnosticCode;
|
|
61
|
+
readonly capabilityId: ClosureCapabilityId | null;
|
|
62
|
+
readonly path: string;
|
|
63
|
+
readonly detail: string;
|
|
64
|
+
}
|
|
65
|
+
export interface ClosureEvaluationOptions {
|
|
66
|
+
readonly repoRoot?: string;
|
|
67
|
+
readonly verifyFailures?: boolean;
|
|
68
|
+
readonly entries?: readonly ClosureCapabilityEntry[];
|
|
69
|
+
readonly receipts?: readonly ExternalQualificationReceipt[];
|
|
70
|
+
/** Injected by callers that can run the cross-package harness; absent leaves `failureMatrix` null. */
|
|
71
|
+
readonly runFailureMatrix?: () => IntegratedFailureMatrixReport | Promise<IntegratedFailureMatrixReport>;
|
|
72
|
+
}
|
|
73
|
+
export interface ClosureMatrixReport {
|
|
74
|
+
readonly version: 1;
|
|
75
|
+
readonly integrity: ClosureIntegrityReport;
|
|
76
|
+
readonly falsificationDetected: boolean;
|
|
77
|
+
readonly diagnostics: readonly ClosureDiagnostic[];
|
|
78
|
+
readonly summary: {
|
|
79
|
+
readonly total: number;
|
|
80
|
+
readonly closedLocal: number;
|
|
81
|
+
readonly deferredOwned: number;
|
|
82
|
+
readonly blockedExternal: number;
|
|
83
|
+
readonly unprovisionedExternal: number;
|
|
84
|
+
readonly passed: number;
|
|
85
|
+
};
|
|
86
|
+
readonly failureMatrix: IntegratedFailureMatrixReport | null;
|
|
87
|
+
}
|
|
88
|
+
/** The frozen 23-row Capability Closure Ledger; every evidence path is a committed repository file. */
|
|
89
|
+
export declare const CLOSURE_CAPABILITY_LEDGER: readonly ClosureCapabilityEntry[];
|
|
90
|
+
/** Verify every ledger evidence path resolves to a committed regular file inside the repository root. */
|
|
91
|
+
export declare function verifyClosureLedgerIntegrity(repoRoot: string, entries?: readonly ClosureCapabilityEntry[]): Promise<ClosureIntegrityReport>;
|
|
92
|
+
/** Evaluate the closure matrix: shape invariants, the non-falsification guard, optional repository evidence integrity, and the optional failure matrix. */
|
|
93
|
+
export declare function evaluateClosureMatrix(options?: ClosureEvaluationOptions): Promise<ClosureMatrixReport>;
|