@gpustack/loopwright 0.0.0-stage → 0.0.3
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 +2094 -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 +1648 -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 +2642 -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 +7335 -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 +3025 -0
- package/package-lock.json +3025 -0
- package/package.json +52 -4
|
@@ -0,0 +1,596 @@
|
|
|
1
|
+
export const REPORT_OUTPUT_FORMATS = Object.freeze(['json', 'github-step-summary', 'markdown', 'text']);
|
|
2
|
+
/** Parse a single format, comma-separated list, or array of output format names, preserving order without duplicates. */
|
|
3
|
+
export function parseReportOutputFormats(raw, defaultFormats = []) {
|
|
4
|
+
if (raw === undefined)
|
|
5
|
+
return Object.freeze([...defaultFormats]);
|
|
6
|
+
const tokens = [];
|
|
7
|
+
if (typeof raw === 'string') {
|
|
8
|
+
if (raw.trim().length === 0) {
|
|
9
|
+
throw new Error(`Output format must not be empty; expected one or more of: ${REPORT_OUTPUT_FORMATS.join(', ')}`);
|
|
10
|
+
}
|
|
11
|
+
for (const part of raw.split(','))
|
|
12
|
+
tokens.push(part.trim());
|
|
13
|
+
}
|
|
14
|
+
else if (Array.isArray(raw)) {
|
|
15
|
+
if (raw.length === 0) {
|
|
16
|
+
throw new Error(`Output format must not be empty; expected one or more of: ${REPORT_OUTPUT_FORMATS.join(', ')}`);
|
|
17
|
+
}
|
|
18
|
+
for (const item of raw) {
|
|
19
|
+
if (typeof item !== 'string' || item.trim().length === 0) {
|
|
20
|
+
throw new Error(`Output format must not contain empty values; expected one or more of: ${REPORT_OUTPUT_FORMATS.join(', ')}`);
|
|
21
|
+
}
|
|
22
|
+
for (const part of item.split(','))
|
|
23
|
+
tokens.push(part.trim());
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
else {
|
|
27
|
+
throw new Error(`Invalid output format specification; expected string or string array`);
|
|
28
|
+
}
|
|
29
|
+
const seen = new Set();
|
|
30
|
+
const result = [];
|
|
31
|
+
for (const token of tokens) {
|
|
32
|
+
if (token.length === 0) {
|
|
33
|
+
throw new Error(`Output format must not contain empty tokens; expected one or more of: ${REPORT_OUTPUT_FORMATS.join(', ')}`);
|
|
34
|
+
}
|
|
35
|
+
if (!REPORT_OUTPUT_FORMATS.includes(token)) {
|
|
36
|
+
throw new Error(`Unsupported output format "${token}"; expected one of: ${REPORT_OUTPUT_FORMATS.join(', ')}`);
|
|
37
|
+
}
|
|
38
|
+
const format = token;
|
|
39
|
+
if (!seen.has(format)) {
|
|
40
|
+
seen.add(format);
|
|
41
|
+
result.push(format);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
return Object.freeze(result);
|
|
45
|
+
}
|
|
46
|
+
/** Format non-negative integer micro-USD (10^-6 USD) as a deterministic 6-decimal USD string. */
|
|
47
|
+
export function formatCostUsd(costMicrousd) {
|
|
48
|
+
if (!Number.isSafeInteger(costMicrousd) || costMicrousd < 0) {
|
|
49
|
+
throw new RangeError(`costMicrousd must be a non-negative safe integer, got ${String(costMicrousd)}`);
|
|
50
|
+
}
|
|
51
|
+
const whole = Math.floor(costMicrousd / 1_000_000);
|
|
52
|
+
const frac = String(costMicrousd % 1_000_000).padStart(6, '0');
|
|
53
|
+
return `${whole}.${frac}`;
|
|
54
|
+
}
|
|
55
|
+
function trimFixed(value, decimals) {
|
|
56
|
+
const fixed = value.toFixed(decimals);
|
|
57
|
+
if (!fixed.includes('.'))
|
|
58
|
+
return fixed;
|
|
59
|
+
return fixed.replace(/\.?0+$/, '');
|
|
60
|
+
}
|
|
61
|
+
/** Format a non-negative token count using K / M / B units (e.g. 850, 1.25K, 14.2K, 1.28M, 2.1B). */
|
|
62
|
+
export function formatTokenCount(count) {
|
|
63
|
+
if (!Number.isSafeInteger(count) || count < 0) {
|
|
64
|
+
throw new RangeError(`count must be a non-negative safe integer, got ${String(count)}`);
|
|
65
|
+
}
|
|
66
|
+
if (count < 1_000)
|
|
67
|
+
return String(count);
|
|
68
|
+
if (count < 1_000_000) {
|
|
69
|
+
const scaled = Math.round((count / 1_000) * 100) / 100;
|
|
70
|
+
if (scaled >= 1_000)
|
|
71
|
+
return '1M';
|
|
72
|
+
return `${trimFixed(scaled, 2)}K`;
|
|
73
|
+
}
|
|
74
|
+
if (count < 1_000_000_000) {
|
|
75
|
+
const scaled = Math.round((count / 1_000_000) * 100) / 100;
|
|
76
|
+
if (scaled >= 1_000)
|
|
77
|
+
return '1B';
|
|
78
|
+
return `${trimFixed(scaled, 2)}M`;
|
|
79
|
+
}
|
|
80
|
+
return `${trimFixed(count / 1_000_000_000, 2)}B`;
|
|
81
|
+
}
|
|
82
|
+
/** Format a non-negative duration in milliseconds using ms / s / m / h units (e.g. 420ms, 8.4s, 2m 28s, 1h 12m). */
|
|
83
|
+
export function formatDurationMs(ms) {
|
|
84
|
+
if (!Number.isFinite(ms) || ms < 0) {
|
|
85
|
+
throw new RangeError(`ms must be a non-negative finite number, got ${String(ms)}`);
|
|
86
|
+
}
|
|
87
|
+
if (ms < 1_000) {
|
|
88
|
+
const rounded = Math.round(ms);
|
|
89
|
+
return rounded >= 1_000 ? '1s' : `${rounded}ms`;
|
|
90
|
+
}
|
|
91
|
+
if (ms < 60_000) {
|
|
92
|
+
const tenths = Math.round(ms / 100);
|
|
93
|
+
if (tenths >= 600)
|
|
94
|
+
return '1m';
|
|
95
|
+
return `${trimFixed(tenths / 10, 1)}s`;
|
|
96
|
+
}
|
|
97
|
+
const totalSeconds = Math.round(ms / 1_000);
|
|
98
|
+
if (totalSeconds < 3_600) {
|
|
99
|
+
const minutes = Math.floor(totalSeconds / 60);
|
|
100
|
+
const seconds = totalSeconds % 60;
|
|
101
|
+
return seconds === 0 ? `${minutes}m` : `${minutes}m ${seconds}s`;
|
|
102
|
+
}
|
|
103
|
+
const totalMinutes = Math.floor(totalSeconds / 60);
|
|
104
|
+
const hours = Math.floor(totalMinutes / 60);
|
|
105
|
+
const minutes = totalMinutes % 60;
|
|
106
|
+
return minutes === 0 ? `${hours}h` : `${hours}h ${minutes}m`;
|
|
107
|
+
}
|
|
108
|
+
/** Format a non-negative byte count using B / KB / MB / GB units (e.g. 512 B, 64 KB, 1.5 MB, 2 GB). */
|
|
109
|
+
export function formatByteCount(bytes) {
|
|
110
|
+
if (!Number.isSafeInteger(bytes) || bytes < 0) {
|
|
111
|
+
throw new RangeError(`bytes must be a non-negative safe integer, got ${String(bytes)}`);
|
|
112
|
+
}
|
|
113
|
+
if (bytes < 1_024)
|
|
114
|
+
return `${bytes} B`;
|
|
115
|
+
if (bytes < 1_048_576) {
|
|
116
|
+
const kb = Math.round((bytes / 1_024) * 10) / 10;
|
|
117
|
+
if (kb >= 1_024)
|
|
118
|
+
return '1 MB';
|
|
119
|
+
return `${trimFixed(kb, 1)} KB`;
|
|
120
|
+
}
|
|
121
|
+
if (bytes < 1_073_741_824) {
|
|
122
|
+
const mb = Math.round((bytes / 1_048_576) * 10) / 10;
|
|
123
|
+
if (mb >= 1_024)
|
|
124
|
+
return '1 GB';
|
|
125
|
+
return `${trimFixed(mb, 1)} MB`;
|
|
126
|
+
}
|
|
127
|
+
return `${trimFixed(bytes / 1_073_741_824, 2)} GB`;
|
|
128
|
+
}
|
|
129
|
+
function stripAnsiAndControl(input) {
|
|
130
|
+
const normalized = input.replace(/\r\n?/g, '\n');
|
|
131
|
+
let result = '';
|
|
132
|
+
let index = 0;
|
|
133
|
+
while (index < normalized.length) {
|
|
134
|
+
const code = normalized.charCodeAt(index);
|
|
135
|
+
if (code === 0x1b) {
|
|
136
|
+
const next = normalized.charCodeAt(index + 1);
|
|
137
|
+
if (next === 0x5b) {
|
|
138
|
+
let cursor = index + 2;
|
|
139
|
+
while (cursor < normalized.length && normalized.charCodeAt(cursor) >= 0x30 && normalized.charCodeAt(cursor) <= 0x3f)
|
|
140
|
+
cursor++;
|
|
141
|
+
while (cursor < normalized.length && normalized.charCodeAt(cursor) >= 0x20 && normalized.charCodeAt(cursor) <= 0x2f)
|
|
142
|
+
cursor++;
|
|
143
|
+
if (cursor < normalized.length && normalized.charCodeAt(cursor) >= 0x40 && normalized.charCodeAt(cursor) <= 0x7e) {
|
|
144
|
+
index = cursor + 1;
|
|
145
|
+
continue;
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
else if (next === 0x5d) {
|
|
149
|
+
let cursor = index + 2;
|
|
150
|
+
let terminated = false;
|
|
151
|
+
while (cursor < normalized.length) {
|
|
152
|
+
const current = normalized.charCodeAt(cursor);
|
|
153
|
+
if (current === 0x07) {
|
|
154
|
+
index = cursor + 1;
|
|
155
|
+
terminated = true;
|
|
156
|
+
break;
|
|
157
|
+
}
|
|
158
|
+
if (current === 0x1b && normalized.charCodeAt(cursor + 1) === 0x5c) {
|
|
159
|
+
index = cursor + 2;
|
|
160
|
+
terminated = true;
|
|
161
|
+
break;
|
|
162
|
+
}
|
|
163
|
+
cursor++;
|
|
164
|
+
}
|
|
165
|
+
if (terminated)
|
|
166
|
+
continue;
|
|
167
|
+
}
|
|
168
|
+
else if ((next >= 0x40 && next <= 0x5a) || (next >= 0x5c && next <= 0x5f)) {
|
|
169
|
+
index += 2;
|
|
170
|
+
continue;
|
|
171
|
+
}
|
|
172
|
+
index++;
|
|
173
|
+
continue;
|
|
174
|
+
}
|
|
175
|
+
if (code <= 0x08 ||
|
|
176
|
+
code === 0x0b ||
|
|
177
|
+
code === 0x0c ||
|
|
178
|
+
(code >= 0x0e && code <= 0x1f) ||
|
|
179
|
+
(code >= 0x7f && code <= 0x9f)) {
|
|
180
|
+
index++;
|
|
181
|
+
continue;
|
|
182
|
+
}
|
|
183
|
+
result += normalized[index];
|
|
184
|
+
index++;
|
|
185
|
+
}
|
|
186
|
+
return result;
|
|
187
|
+
}
|
|
188
|
+
/** Scrub secrets, strip ANSI/control bytes, and neutralize GitHub workflow commands in untrusted report text. */
|
|
189
|
+
export function sanitizeReportText(value, options) {
|
|
190
|
+
const scrub = options?.scrub;
|
|
191
|
+
const preScrubbed = scrub ? scrub(value) : value;
|
|
192
|
+
const stripped = stripAnsiAndControl(preScrubbed);
|
|
193
|
+
const postScrubbed = scrub ? scrub(stripped) : stripped;
|
|
194
|
+
const neutralized = postScrubbed.replace(/:(?=:)/g, ': ').replace(/##\[/g, '# #[');
|
|
195
|
+
if (options?.singleLine) {
|
|
196
|
+
return neutralized.replace(/[\t\n]+/g, ' ').replace(/ {2,}/g, ' ').trim();
|
|
197
|
+
}
|
|
198
|
+
return neutralized;
|
|
199
|
+
}
|
|
200
|
+
function formatDiscoverySummary(discovery, clean) {
|
|
201
|
+
const parts = [clean(discovery.disposition)];
|
|
202
|
+
if (discovery.updatesCount !== undefined)
|
|
203
|
+
parts.push(`(${discovery.updatesCount} updates)`);
|
|
204
|
+
if (discovery.summary != null && discovery.summary.length > 0)
|
|
205
|
+
parts.push(`- ${clean(discovery.summary)}`);
|
|
206
|
+
return parts.join(' ');
|
|
207
|
+
}
|
|
208
|
+
function formatModelSummary(model, clean) {
|
|
209
|
+
let summary = `${clean(model.provider)}/${clean(model.model)}`;
|
|
210
|
+
const attrs = [];
|
|
211
|
+
if (model.thinking != null && model.thinking.length > 0)
|
|
212
|
+
attrs.push(`thinking: ${clean(model.thinking)}`);
|
|
213
|
+
if (model.contextWindow !== undefined && Number.isSafeInteger(model.contextWindow) && model.contextWindow >= 0) {
|
|
214
|
+
attrs.push(`contextWindow=${formatTokenCount(model.contextWindow)}`);
|
|
215
|
+
}
|
|
216
|
+
if (attrs.length > 0)
|
|
217
|
+
summary += ` (${attrs.join(', ')})`;
|
|
218
|
+
if (model.tokenRotations !== undefined)
|
|
219
|
+
summary += ` [rotations: ${model.tokenRotations}]`;
|
|
220
|
+
return summary;
|
|
221
|
+
}
|
|
222
|
+
function formatMcpServersSummary(servers, clean) {
|
|
223
|
+
return servers
|
|
224
|
+
.map(server => {
|
|
225
|
+
if (server.status === 'connected') {
|
|
226
|
+
return `${clean(server.id)} (${clean(server.transport)}, ${server.toolCount} tools)`;
|
|
227
|
+
}
|
|
228
|
+
const errSuffix = server.error != null && server.error.length > 0 ? `: ${clean(server.error)}` : '';
|
|
229
|
+
return `${clean(server.id)} (${clean(server.transport)}, failed${errSuffix})`;
|
|
230
|
+
})
|
|
231
|
+
.join('; ');
|
|
232
|
+
}
|
|
233
|
+
function sanitizeRunEvalPayload(runEval, clean) {
|
|
234
|
+
return {
|
|
235
|
+
schemaVersion: runEval.schemaVersion,
|
|
236
|
+
runId: clean(runEval.runId),
|
|
237
|
+
status: runEval.status !== null ? clean(runEval.status) : null,
|
|
238
|
+
journalRevision: runEval.journalRevision,
|
|
239
|
+
toolTelemetry: runEval.toolTelemetry,
|
|
240
|
+
toolRepeats: {
|
|
241
|
+
items: runEval.toolRepeats.items.map(item => ({
|
|
242
|
+
roleId: clean(item.roleId),
|
|
243
|
+
stepId: clean(item.stepId),
|
|
244
|
+
tool: clean(item.tool),
|
|
245
|
+
target: clean(item.target),
|
|
246
|
+
count: item.count,
|
|
247
|
+
})),
|
|
248
|
+
totalFailingCalls: runEval.toolRepeats.totalFailingCalls,
|
|
249
|
+
circuitBreaker: runEval.toolRepeats.circuitBreaker,
|
|
250
|
+
},
|
|
251
|
+
pingPong: { ...runEval.pingPong },
|
|
252
|
+
repairConvergence: {
|
|
253
|
+
attempts: { ...runEval.repairConvergence.attempts },
|
|
254
|
+
unchangedDigestRepairs: runEval.repairConvergence.unchangedDigestRepairs,
|
|
255
|
+
initialFailingChecks: runEval.repairConvergence.initialFailingChecks,
|
|
256
|
+
finalFailingChecks: runEval.repairConvergence.finalFailingChecks,
|
|
257
|
+
failingCheckDelta: runEval.repairConvergence.failingCheckDelta,
|
|
258
|
+
converged: runEval.repairConvergence.converged,
|
|
259
|
+
},
|
|
260
|
+
breakdown: {
|
|
261
|
+
byStep: runEval.breakdown.byStep.map(row => ({
|
|
262
|
+
stepId: clean(row.stepId),
|
|
263
|
+
roleId: row.roleId !== null ? clean(row.roleId) : null,
|
|
264
|
+
tokens: { ...row.tokens },
|
|
265
|
+
costMicrousd: row.costMicrousd,
|
|
266
|
+
costCompleteness: row.costCompleteness,
|
|
267
|
+
modelCalls: row.modelCalls,
|
|
268
|
+
toolCalls: row.toolCalls,
|
|
269
|
+
elapsedMs: row.elapsedMs,
|
|
270
|
+
})),
|
|
271
|
+
byRole: runEval.breakdown.byRole.map(row => ({
|
|
272
|
+
roleId: clean(row.roleId),
|
|
273
|
+
tokens: { ...row.tokens },
|
|
274
|
+
costMicrousd: row.costMicrousd,
|
|
275
|
+
costCompleteness: row.costCompleteness,
|
|
276
|
+
modelCalls: row.modelCalls,
|
|
277
|
+
toolCalls: row.toolCalls,
|
|
278
|
+
elapsedMs: row.elapsedMs,
|
|
279
|
+
})),
|
|
280
|
+
totals: {
|
|
281
|
+
tokens: { ...runEval.breakdown.totals.tokens },
|
|
282
|
+
costMicrousd: runEval.breakdown.totals.costMicrousd,
|
|
283
|
+
costCompleteness: runEval.breakdown.totals.costCompleteness,
|
|
284
|
+
modelCalls: runEval.breakdown.totals.modelCalls,
|
|
285
|
+
toolCalls: runEval.breakdown.totals.toolCalls,
|
|
286
|
+
elapsedMs: runEval.breakdown.totals.elapsedMs,
|
|
287
|
+
},
|
|
288
|
+
},
|
|
289
|
+
suggestions: runEval.suggestions.map(item => ({
|
|
290
|
+
autoApplied: false,
|
|
291
|
+
code: clean(item.code),
|
|
292
|
+
severity: item.severity,
|
|
293
|
+
summary: clean(item.summary),
|
|
294
|
+
evidence: clean(item.evidence),
|
|
295
|
+
})),
|
|
296
|
+
};
|
|
297
|
+
}
|
|
298
|
+
function formatEvalCost(costMicrousd, completeness) {
|
|
299
|
+
if (costMicrousd === null || completeness === 'unavailable')
|
|
300
|
+
return 'unavailable';
|
|
301
|
+
const formatted = `$${formatCostUsd(costMicrousd)}`;
|
|
302
|
+
return completeness === 'partial' ? `>= ${formatted} (partial)` : formatted;
|
|
303
|
+
}
|
|
304
|
+
function formatEvalTokens(tokens) {
|
|
305
|
+
return `${formatTokenCount(tokens.total)} (${formatTokenCount(tokens.input)} in / ${formatTokenCount(tokens.output)} out)`;
|
|
306
|
+
}
|
|
307
|
+
function formatEvalElapsed(elapsedMs) {
|
|
308
|
+
return elapsedMs !== null ? formatDurationMs(elapsedMs) : 'unavailable';
|
|
309
|
+
}
|
|
310
|
+
function formatToolRepeatsSummary(runEval, clean) {
|
|
311
|
+
if (runEval.toolRepeats.items.length === 0) {
|
|
312
|
+
return `none (failingCalls=${runEval.toolRepeats.totalFailingCalls})`;
|
|
313
|
+
}
|
|
314
|
+
const preview = runEval.toolRepeats.items
|
|
315
|
+
.slice(0, 3)
|
|
316
|
+
.map(item => `${clean(item.roleId)}/${clean(item.stepId)} ${clean(item.tool)} ${clean(item.target)} x${item.count}`)
|
|
317
|
+
.join('; ');
|
|
318
|
+
return `${runEval.toolRepeats.items.length} repeated (${preview})`;
|
|
319
|
+
}
|
|
320
|
+
function formatPingPongSummary(runEval) {
|
|
321
|
+
const pp = runEval.pingPong;
|
|
322
|
+
if (!pp.detected)
|
|
323
|
+
return 'none';
|
|
324
|
+
return `detected (oscillations=${pp.checkOscillations}, identicalRepeats=${pp.repeatedFailureSignatures}, digestCycles=${pp.digestCycles}, repeatedReworks=${pp.repeatedReworks})`;
|
|
325
|
+
}
|
|
326
|
+
function formatRepairConvergenceSummary(runEval) {
|
|
327
|
+
const rc = runEval.repairConvergence;
|
|
328
|
+
const convergedLabel = rc.converged === null ? 'in_progress' : String(rc.converged);
|
|
329
|
+
const deltaLabel = rc.failingCheckDelta === null ? 'n/a' : rc.failingCheckDelta > 0 ? `+${rc.failingCheckDelta}` : String(rc.failingCheckDelta);
|
|
330
|
+
return `converged=${convergedLabel}, attempts(ordinary=${rc.attempts.ordinary}, format=${rc.attempts.format}, implementation=${rc.attempts.implementation}, rework=${rc.attempts.rework}), unchangedDigestRepairs=${rc.unchangedDigestRepairs}, failingCheckDelta=${deltaLabel}`;
|
|
331
|
+
}
|
|
332
|
+
/** Render a sanitized, deterministic run report in JSON, Markdown/Step Summary, or plain text format. */
|
|
333
|
+
export function formatRunReport(input, format) {
|
|
334
|
+
const usage = input.usage ?? null;
|
|
335
|
+
const hasKnownCost = usage != null && (usage.costMicrousd.provenance === 'reported' || usage.costMicrousd.provenance === 'estimated');
|
|
336
|
+
const costUsd = hasKnownCost ? formatCostUsd(usage.costMicrousd.knownSubtotal) : null;
|
|
337
|
+
if (format === 'json') {
|
|
338
|
+
const clean = (text) => sanitizeReportText(text, { scrub: input.scrub });
|
|
339
|
+
const payload = {
|
|
340
|
+
runId: clean(input.runId),
|
|
341
|
+
status: clean(input.status),
|
|
342
|
+
reasonCode: input.reasonCode != null ? clean(input.reasonCode) : null,
|
|
343
|
+
phase: input.phase != null ? clean(input.phase) : null,
|
|
344
|
+
...(input.detail !== undefined ? { detail: input.detail != null ? clean(input.detail) : null } : {}),
|
|
345
|
+
discovery: input.discovery
|
|
346
|
+
? {
|
|
347
|
+
disposition: clean(input.discovery.disposition),
|
|
348
|
+
...(input.discovery.updatesCount !== undefined ? { updatesCount: input.discovery.updatesCount } : {}),
|
|
349
|
+
summary: input.discovery.summary != null ? clean(input.discovery.summary) : null,
|
|
350
|
+
}
|
|
351
|
+
: null,
|
|
352
|
+
checks: (input.checks ?? []).map(check => ({
|
|
353
|
+
checkId: clean(check.checkId),
|
|
354
|
+
status: clean(check.status),
|
|
355
|
+
code: check.code != null ? clean(check.code) : null,
|
|
356
|
+
detail: check.detail != null ? clean(check.detail) : null,
|
|
357
|
+
})),
|
|
358
|
+
...(input.findings !== undefined
|
|
359
|
+
? {
|
|
360
|
+
findings: input.findings.map(finding => ({
|
|
361
|
+
title: clean(finding.title),
|
|
362
|
+
severity: clean(finding.severity),
|
|
363
|
+
...(finding.path !== undefined ? { path: finding.path !== null ? clean(finding.path) : null } : {}),
|
|
364
|
+
...(finding.line !== undefined ? { line: finding.line } : {}),
|
|
365
|
+
evidence: clean(finding.evidence),
|
|
366
|
+
})),
|
|
367
|
+
}
|
|
368
|
+
: {}),
|
|
369
|
+
model: input.model
|
|
370
|
+
? {
|
|
371
|
+
provider: clean(input.model.provider),
|
|
372
|
+
model: clean(input.model.model),
|
|
373
|
+
thinking: input.model.thinking != null ? clean(input.model.thinking) : null,
|
|
374
|
+
...(input.model.contextWindow !== undefined && Number.isSafeInteger(input.model.contextWindow) && input.model.contextWindow >= 0
|
|
375
|
+
? {
|
|
376
|
+
contextWindow: input.model.contextWindow,
|
|
377
|
+
formattedContextWindow: formatTokenCount(input.model.contextWindow),
|
|
378
|
+
}
|
|
379
|
+
: {}),
|
|
380
|
+
...(input.model.tokenRotations !== undefined ? { tokenRotations: input.model.tokenRotations } : {}),
|
|
381
|
+
}
|
|
382
|
+
: null,
|
|
383
|
+
...(input.mcpServers !== undefined
|
|
384
|
+
? {
|
|
385
|
+
mcpServers: input.mcpServers.map(server => ({
|
|
386
|
+
id: clean(server.id),
|
|
387
|
+
transport: clean(server.transport),
|
|
388
|
+
status: clean(server.status),
|
|
389
|
+
toolCount: server.toolCount,
|
|
390
|
+
error: server.error != null ? clean(server.error) : null,
|
|
391
|
+
})),
|
|
392
|
+
}
|
|
393
|
+
: {}),
|
|
394
|
+
usage: usage
|
|
395
|
+
? {
|
|
396
|
+
requestCount: usage.requests.length,
|
|
397
|
+
inputTokens: usage.inputTokens.knownSubtotal,
|
|
398
|
+
outputTokens: usage.outputTokens.knownSubtotal,
|
|
399
|
+
totalTokens: usage.totalTokens.knownSubtotal,
|
|
400
|
+
formattedInputTokens: formatTokenCount(usage.inputTokens.knownSubtotal),
|
|
401
|
+
formattedOutputTokens: formatTokenCount(usage.outputTokens.knownSubtotal),
|
|
402
|
+
formattedTotalTokens: formatTokenCount(usage.totalTokens.knownSubtotal),
|
|
403
|
+
tokenProvenance: usage.totalTokens.provenance,
|
|
404
|
+
tokenCompleteness: usage.totalTokens.completeness,
|
|
405
|
+
tokenUnknownCount: usage.totalTokens.unknownCount,
|
|
406
|
+
costMicrousd: hasKnownCost ? usage.costMicrousd.knownSubtotal : null,
|
|
407
|
+
costUsd,
|
|
408
|
+
costProvenance: usage.costMicrousd.provenance,
|
|
409
|
+
costCompleteness: usage.costMicrousd.completeness,
|
|
410
|
+
costUnknownCount: usage.costMicrousd.unknownCount,
|
|
411
|
+
}
|
|
412
|
+
: null,
|
|
413
|
+
elapsedMs: input.elapsedMs ?? null,
|
|
414
|
+
formattedElapsed: input.elapsedMs != null ? formatDurationMs(input.elapsedMs) : null,
|
|
415
|
+
externalUrl: input.externalUrl != null ? clean(input.externalUrl) : null,
|
|
416
|
+
...(input.runEval !== undefined
|
|
417
|
+
? { runEval: input.runEval !== null ? sanitizeRunEvalPayload(input.runEval, clean) : null }
|
|
418
|
+
: {}),
|
|
419
|
+
};
|
|
420
|
+
return JSON.stringify(payload);
|
|
421
|
+
}
|
|
422
|
+
const cleanLine = (text) => sanitizeReportText(text, { scrub: input.scrub, singleLine: true });
|
|
423
|
+
if (format === 'github-step-summary' || format === 'markdown') {
|
|
424
|
+
const cell = (text) => cleanLine(text)
|
|
425
|
+
.replace(/\|/g, '\\|')
|
|
426
|
+
.replace(/</g, '<')
|
|
427
|
+
.replace(/>/g, '>')
|
|
428
|
+
.replace(/\[/g, '\\[');
|
|
429
|
+
const lines = [
|
|
430
|
+
'## Loopwright Run Report',
|
|
431
|
+
'',
|
|
432
|
+
'| Field | Value |',
|
|
433
|
+
'| --- | --- |',
|
|
434
|
+
`| Run ID | ${cell(input.runId)} |`,
|
|
435
|
+
`| Status | ${cell(input.status)} |`,
|
|
436
|
+
];
|
|
437
|
+
if (input.reasonCode != null && input.reasonCode.length > 0)
|
|
438
|
+
lines.push(`| Reason | ${cell(input.reasonCode)} |`);
|
|
439
|
+
if (input.phase != null && input.phase.length > 0)
|
|
440
|
+
lines.push(`| Phase | ${cell(input.phase)} |`);
|
|
441
|
+
if (input.detail != null && input.detail.length > 0)
|
|
442
|
+
lines.push(`| Detail | ${cell(input.detail)} |`);
|
|
443
|
+
if (input.discovery)
|
|
444
|
+
lines.push(`| Discovery | ${formatDiscoverySummary(input.discovery, cell)} |`);
|
|
445
|
+
if (input.model)
|
|
446
|
+
lines.push(`| Model | ${formatModelSummary(input.model, cell)} |`);
|
|
447
|
+
if (input.mcpServers && input.mcpServers.length > 0) {
|
|
448
|
+
lines.push(`| MCP Servers | ${formatMcpServersSummary(input.mcpServers, cell)} |`);
|
|
449
|
+
}
|
|
450
|
+
if (usage != null) {
|
|
451
|
+
const tokenPrefix = usage.totalTokens.completeness === 'partial' ? '>= ' : '';
|
|
452
|
+
const tokenSuffix = usage.totalTokens.completeness === 'partial' ? `, partial: ${usage.totalTokens.unknownCount} unknown` : '';
|
|
453
|
+
lines.push(`| Tokens | ${tokenPrefix}${formatTokenCount(usage.totalTokens.knownSubtotal)} total (${formatTokenCount(usage.inputTokens.knownSubtotal)} in / ${formatTokenCount(usage.outputTokens.knownSubtotal)} out, ${usage.totalTokens.provenance}${tokenSuffix}) |`);
|
|
454
|
+
}
|
|
455
|
+
else {
|
|
456
|
+
lines.push('| Tokens | unavailable |');
|
|
457
|
+
}
|
|
458
|
+
if (hasKnownCost && costUsd !== null) {
|
|
459
|
+
const costPrefix = usage.costMicrousd.completeness === 'partial' ? '>= ' : '';
|
|
460
|
+
const costSuffix = usage.costMicrousd.completeness === 'partial' ? `, partial: ${usage.costMicrousd.unknownCount} unknown` : '';
|
|
461
|
+
lines.push(`| Cost (USD) | ${costPrefix}$${costUsd} (${usage.costMicrousd.provenance}${costSuffix}) |`);
|
|
462
|
+
}
|
|
463
|
+
if (input.elapsedMs != null)
|
|
464
|
+
lines.push(`| Elapsed | ${formatDurationMs(input.elapsedMs)} |`);
|
|
465
|
+
if (input.externalUrl != null && input.externalUrl.length > 0)
|
|
466
|
+
lines.push(`| External URL | ${cell(input.externalUrl)} |`);
|
|
467
|
+
if (input.checks && input.checks.length > 0) {
|
|
468
|
+
lines.push('', '### Verification Checks', '', '| Check ID | Status | Code | Detail |', '| --- | --- | --- | --- |');
|
|
469
|
+
for (const check of input.checks) {
|
|
470
|
+
const codeCell = check.code != null && check.code.length > 0 ? cell(check.code) : '-';
|
|
471
|
+
const detailCell = check.detail != null && check.detail.length > 0 ? cell(check.detail) : '-';
|
|
472
|
+
lines.push(`| ${cell(check.checkId)} | ${cell(check.status)} | ${codeCell} | ${detailCell} |`);
|
|
473
|
+
}
|
|
474
|
+
}
|
|
475
|
+
if (input.findings && input.findings.length > 0) {
|
|
476
|
+
lines.push('', '### Findings', '', '| Severity | Location | Title | Evidence |', '| --- | --- | --- | --- |');
|
|
477
|
+
for (const finding of input.findings) {
|
|
478
|
+
const loc = finding.path != null && finding.path.length > 0
|
|
479
|
+
? finding.line != null
|
|
480
|
+
? `${finding.path}:${finding.line}`
|
|
481
|
+
: finding.path
|
|
482
|
+
: '-';
|
|
483
|
+
lines.push(`| ${cell(finding.severity)} | ${loc === '-' ? '-' : cell(loc)} | ${cell(finding.title)} | ${cell(finding.evidence)} |`);
|
|
484
|
+
}
|
|
485
|
+
}
|
|
486
|
+
if (input.runEval != null) {
|
|
487
|
+
const ev = input.runEval;
|
|
488
|
+
lines.push('', '### Run Health', '', '| Metric | Value |', '| --- | --- |', `| Tool Telemetry | ${cell(ev.toolTelemetry)} |`, `| Circuit Breaker | ${cell(ev.toolRepeats.circuitBreaker)} |`, `| Repeated Failing Tools | ${formatToolRepeatsSummary(ev, cell)} |`, `| Ping-Pong | ${cell(formatPingPongSummary(ev))} |`, `| Repair Convergence | ${cell(formatRepairConvergenceSummary(ev))} |`);
|
|
489
|
+
if (ev.breakdown.byRole.length > 0) {
|
|
490
|
+
lines.push('', '#### Breakdown by Role', '', '| Role | Tokens | Cost (USD) | Model Calls | Tool Calls | Elapsed |', '| --- | --- | --- | --- | --- | --- |');
|
|
491
|
+
for (const row of ev.breakdown.byRole) {
|
|
492
|
+
lines.push(`| ${cell(row.roleId)} | ${cell(formatEvalTokens(row.tokens))} | ${cell(formatEvalCost(row.costMicrousd, row.costCompleteness))} | ${row.modelCalls} | ${row.toolCalls} | ${cell(formatEvalElapsed(row.elapsedMs))} |`);
|
|
493
|
+
}
|
|
494
|
+
}
|
|
495
|
+
if (ev.breakdown.byStep.length > 0) {
|
|
496
|
+
lines.push('', '#### Breakdown by Step', '', '| Step | Role | Tokens | Cost (USD) | Model Calls | Tool Calls | Elapsed |', '| --- | --- | --- | --- | --- | --- | --- |');
|
|
497
|
+
for (const row of ev.breakdown.byStep) {
|
|
498
|
+
lines.push(`| ${cell(row.stepId)} | ${row.roleId !== null ? cell(row.roleId) : '-'} | ${cell(formatEvalTokens(row.tokens))} | ${cell(formatEvalCost(row.costMicrousd, row.costCompleteness))} | ${row.modelCalls} | ${row.toolCalls} | ${cell(formatEvalElapsed(row.elapsedMs))} |`);
|
|
499
|
+
}
|
|
500
|
+
}
|
|
501
|
+
if (ev.suggestions.length > 0) {
|
|
502
|
+
lines.push('', '#### Tuning Suggestions (advisory, autoApplied: false)', '');
|
|
503
|
+
for (const suggestion of ev.suggestions) {
|
|
504
|
+
lines.push(`- [${cell(suggestion.severity)}] \`${cell(suggestion.code)}\`: ${cell(suggestion.summary)} (${cell(suggestion.evidence)}) [autoApplied: false]`);
|
|
505
|
+
}
|
|
506
|
+
}
|
|
507
|
+
}
|
|
508
|
+
return lines.join('\n');
|
|
509
|
+
}
|
|
510
|
+
if (format === 'text') {
|
|
511
|
+
const lines = [`Run ID: ${cleanLine(input.runId)}`];
|
|
512
|
+
const statusAnnotations = [];
|
|
513
|
+
if (input.reasonCode != null && input.reasonCode.length > 0)
|
|
514
|
+
statusAnnotations.push(`reason=${cleanLine(input.reasonCode)}`);
|
|
515
|
+
if (input.phase != null && input.phase.length > 0)
|
|
516
|
+
statusAnnotations.push(`phase=${cleanLine(input.phase)}`);
|
|
517
|
+
lines.push(statusAnnotations.length > 0 ? `Status: ${cleanLine(input.status)} (${statusAnnotations.join(', ')})` : `Status: ${cleanLine(input.status)}`);
|
|
518
|
+
if (input.detail != null && input.detail.length > 0)
|
|
519
|
+
lines.push(`Detail: ${cleanLine(input.detail)}`);
|
|
520
|
+
if (input.discovery)
|
|
521
|
+
lines.push(`Discovery: ${formatDiscoverySummary(input.discovery, cleanLine)}`);
|
|
522
|
+
if (input.model)
|
|
523
|
+
lines.push(`Model: ${formatModelSummary(input.model, cleanLine)}`);
|
|
524
|
+
if (input.mcpServers && input.mcpServers.length > 0) {
|
|
525
|
+
lines.push(`MCP Servers: ${formatMcpServersSummary(input.mcpServers, cleanLine)}`);
|
|
526
|
+
}
|
|
527
|
+
if (usage != null) {
|
|
528
|
+
const tokenPrefix = usage.totalTokens.completeness === 'partial' ? '>= ' : '';
|
|
529
|
+
const tokenSuffix = usage.totalTokens.completeness === 'partial' ? `, partial: ${usage.totalTokens.unknownCount} unknown` : '';
|
|
530
|
+
lines.push(`Tokens: ${tokenPrefix}${formatTokenCount(usage.totalTokens.knownSubtotal)} total (${formatTokenCount(usage.inputTokens.knownSubtotal)} in / ${formatTokenCount(usage.outputTokens.knownSubtotal)} out${tokenSuffix})`);
|
|
531
|
+
}
|
|
532
|
+
else {
|
|
533
|
+
lines.push('Tokens: unavailable');
|
|
534
|
+
}
|
|
535
|
+
if (hasKnownCost && costUsd !== null) {
|
|
536
|
+
const costPrefix = usage.costMicrousd.completeness === 'partial' ? '>= ' : '';
|
|
537
|
+
const costSuffix = usage.costMicrousd.completeness === 'partial' ? `, partial: ${usage.costMicrousd.unknownCount} unknown` : '';
|
|
538
|
+
lines.push(`Cost: ${costPrefix}$${costUsd} USD (${usage.costMicrousd.provenance}${costSuffix})`);
|
|
539
|
+
}
|
|
540
|
+
if (input.checks && input.checks.length > 0) {
|
|
541
|
+
lines.push('Checks:');
|
|
542
|
+
for (const check of input.checks) {
|
|
543
|
+
let checkLine = `- ${cleanLine(check.checkId)}: ${cleanLine(check.status)}`;
|
|
544
|
+
if (check.code != null && check.code.length > 0)
|
|
545
|
+
checkLine += ` (${cleanLine(check.code)})`;
|
|
546
|
+
if (check.detail != null && check.detail.length > 0)
|
|
547
|
+
checkLine += ` - ${cleanLine(check.detail)}`;
|
|
548
|
+
lines.push(checkLine);
|
|
549
|
+
}
|
|
550
|
+
}
|
|
551
|
+
if (input.findings && input.findings.length > 0) {
|
|
552
|
+
lines.push('Findings:');
|
|
553
|
+
for (const finding of input.findings) {
|
|
554
|
+
const loc = finding.path != null && finding.path.length > 0
|
|
555
|
+
? finding.line != null
|
|
556
|
+
? `${cleanLine(finding.path)}:${finding.line} `
|
|
557
|
+
: `${cleanLine(finding.path)} `
|
|
558
|
+
: '';
|
|
559
|
+
lines.push(`- [${cleanLine(finding.severity)}] ${loc}${cleanLine(finding.title)} - ${cleanLine(finding.evidence)}`);
|
|
560
|
+
}
|
|
561
|
+
}
|
|
562
|
+
if (input.externalUrl != null && input.externalUrl.length > 0)
|
|
563
|
+
lines.push(`External URL: ${cleanLine(input.externalUrl)}`);
|
|
564
|
+
if (input.elapsedMs != null)
|
|
565
|
+
lines.push(`Elapsed: ${formatDurationMs(input.elapsedMs)}`);
|
|
566
|
+
if (input.runEval != null) {
|
|
567
|
+
const ev = input.runEval;
|
|
568
|
+
lines.push('Run Health:');
|
|
569
|
+
lines.push(`- Tool telemetry: ${cleanLine(ev.toolTelemetry)} (circuitBreaker=${cleanLine(ev.toolRepeats.circuitBreaker)})`);
|
|
570
|
+
lines.push(`- Repeated failing tools: ${formatToolRepeatsSummary(ev, cleanLine)}`);
|
|
571
|
+
lines.push(`- Ping-pong: ${cleanLine(formatPingPongSummary(ev))}`);
|
|
572
|
+
lines.push(`- Repair convergence: ${cleanLine(formatRepairConvergenceSummary(ev))}`);
|
|
573
|
+
if (ev.breakdown.byRole.length > 0) {
|
|
574
|
+
const roleSummaries = ev.breakdown.byRole
|
|
575
|
+
.map(row => `${cleanLine(row.roleId)} [tokens=${formatEvalTokens(row.tokens)}, cost=${formatEvalCost(row.costMicrousd, row.costCompleteness)}, modelCalls=${row.modelCalls}, toolCalls=${row.toolCalls}, elapsed=${formatEvalElapsed(row.elapsedMs)}]`)
|
|
576
|
+
.join('; ');
|
|
577
|
+
lines.push(`- By role: ${roleSummaries}`);
|
|
578
|
+
}
|
|
579
|
+
if (ev.breakdown.byStep.length > 0) {
|
|
580
|
+
const stepSummaries = ev.breakdown.byStep
|
|
581
|
+
.map(row => `${cleanLine(row.stepId)}${row.roleId !== null ? `(${cleanLine(row.roleId)})` : ''} [tokens=${formatEvalTokens(row.tokens)}, cost=${formatEvalCost(row.costMicrousd, row.costCompleteness)}, modelCalls=${row.modelCalls}, toolCalls=${row.toolCalls}, elapsed=${formatEvalElapsed(row.elapsedMs)}]`)
|
|
582
|
+
.join('; ');
|
|
583
|
+
lines.push(`- By step: ${stepSummaries}`);
|
|
584
|
+
}
|
|
585
|
+
if (ev.suggestions.length > 0) {
|
|
586
|
+
lines.push('- Suggestions (autoApplied=false):');
|
|
587
|
+
for (const suggestion of ev.suggestions) {
|
|
588
|
+
lines.push(` - [${cleanLine(suggestion.severity)}] ${cleanLine(suggestion.code)}: ${cleanLine(suggestion.summary)} (${cleanLine(suggestion.evidence)}) [autoApplied=false]`);
|
|
589
|
+
}
|
|
590
|
+
}
|
|
591
|
+
}
|
|
592
|
+
return lines.join('\n');
|
|
593
|
+
}
|
|
594
|
+
const exhaustive = format;
|
|
595
|
+
throw new Error(`Unsupported report output format: ${String(exhaustive)}`);
|
|
596
|
+
}
|