@loucompanion/forge-bridge 0.1.3-dev.f66395c3ac21 → 0.1.4-dev.0098fdb4e213
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/README.md +306 -1
- package/dist/bridge/bridge-chat-provider-command.d.ts +19 -0
- package/dist/bridge/bridge-chat-provider-command.js +132 -0
- package/dist/bridge/bridge-chat.types.d.ts +121 -0
- package/dist/bridge/bridge-chat.types.js +416 -0
- package/dist/bridge/bridge-state-file.d.ts +161 -0
- package/dist/bridge/bridge-state-file.js +376 -0
- package/dist/bridge/bridge-state-io.d.ts +11 -0
- package/dist/bridge/bridge-state-io.js +50 -0
- package/dist/bridge/bridge-state-lock.d.ts +11 -0
- package/dist/bridge/bridge-state-lock.js +102 -0
- package/dist/bridge/bridge-state-unpublished.d.ts +17 -0
- package/dist/bridge/bridge-state-unpublished.js +111 -0
- package/dist/bridge/bridge.base.d.ts +18 -1
- package/dist/bridge/bridge.service.d.ts +216 -4
- package/dist/bridge/bridge.service.js +2574 -90
- package/dist/bridge/bridge.types.d.ts +245 -2
- package/dist/bridge/dispatch-result-outbox.d.ts +35 -0
- package/dist/bridge/dispatch-result-outbox.js +87 -0
- package/dist/bridge/dispatch-result-worker.d.ts +2 -0
- package/dist/bridge/dispatch-result-worker.js +122 -0
- package/dist/bridge/in-flight-registry.d.ts +62 -0
- package/dist/bridge/in-flight-registry.js +207 -0
- package/dist/bridge/internals.d.ts +2 -0
- package/dist/bridge/internals.js +1 -0
- package/dist/bridge/local-yield-flag.d.ts +6 -0
- package/dist/bridge/local-yield-flag.js +34 -0
- package/dist/bridge/readiness-result-outbox.d.ts +25 -0
- package/dist/bridge/readiness-result-outbox.js +74 -0
- package/dist/bridge/readiness-result-worker.d.ts +2 -0
- package/dist/bridge/readiness-result-worker.js +121 -0
- package/dist/bridge/runner-host-capabilities.d.ts +20 -0
- package/dist/bridge/runner-host-capabilities.js +110 -0
- package/dist/bridge/sandbox-resource-accounting.d.ts +16 -0
- package/dist/bridge/sandbox-resource-accounting.js +150 -0
- package/dist/bridge/test-postgres-capability.d.ts +14 -0
- package/dist/bridge/test-postgres-capability.js +120 -0
- package/dist/cleanup/cleanup-wip.d.ts +12 -0
- package/dist/cleanup/cleanup-wip.js +66 -0
- package/dist/cleanup/cleanup.service.d.ts +33 -2
- package/dist/cleanup/cleanup.service.js +477 -3
- package/dist/cleanup/cleanup.types.d.ts +16 -0
- package/dist/cleanup/forge-owned-paths.d.ts +9 -0
- package/dist/cleanup/forge-owned-paths.js +53 -0
- package/dist/cleanup/host-runtime-ledger.d.ts +7 -0
- package/dist/cleanup/host-runtime-ledger.js +130 -0
- package/dist/cleanup/index.d.ts +1 -1
- package/dist/cleanup/index.js +1 -1
- package/dist/cleanup/internals.d.ts +2 -2
- package/dist/cleanup/internals.js +1 -1
- package/dist/cleanup/managed-branch-sweep.d.ts +27 -0
- package/dist/cleanup/managed-branch-sweep.js +111 -0
- package/dist/cli/cli.help.d.ts +2 -0
- package/dist/cli/cli.help.js +279 -0
- package/dist/cli/cli.service.d.ts +69 -12
- package/dist/cli/cli.service.js +557 -382
- package/dist/cli/idle-status.d.ts +84 -0
- package/dist/cli/idle-status.js +181 -0
- package/dist/cli/local-config.d.ts +13 -0
- package/dist/cli/local-config.js +82 -6
- package/dist/cli/provider-cli-detection.d.ts +10 -0
- package/dist/cli/provider-cli-detection.js +160 -0
- package/dist/runtime/aspnet-runtime-prebuild.d.ts +41 -0
- package/dist/runtime/aspnet-runtime-prebuild.js +474 -0
- package/dist/runtime/attempt-database-broker.d.ts +89 -0
- package/dist/runtime/attempt-database-broker.js +390 -0
- package/dist/runtime/attempt-node-runtime-launcher.d.ts +18 -0
- package/dist/runtime/attempt-node-runtime-launcher.js +140 -0
- package/dist/runtime/attempt-path-operation.d.ts +21 -0
- package/dist/runtime/attempt-path-operation.js +94 -0
- package/dist/runtime/attempt-private-directory.d.ts +6 -0
- package/dist/runtime/attempt-private-directory.js +54 -0
- package/dist/runtime/attempt-process-supervisor-registry.d.ts +20 -0
- package/dist/runtime/attempt-process-supervisor-registry.js +64 -0
- package/dist/runtime/attempt-process-supervisor.d.ts +121 -0
- package/dist/runtime/attempt-process-supervisor.js +471 -0
- package/dist/runtime/canonical-source-file.d.ts +3 -0
- package/dist/runtime/canonical-source-file.js +54 -0
- package/dist/runtime/docker-engine-probe.d.ts +95 -0
- package/dist/runtime/docker-engine-probe.js +340 -0
- package/dist/runtime/ephemeral-test-postgres-grant.d.ts +37 -0
- package/dist/runtime/ephemeral-test-postgres-grant.js +85 -0
- package/dist/runtime/ephemeral-test-postgres.d.ts +57 -0
- package/dist/runtime/ephemeral-test-postgres.js +303 -0
- package/dist/runtime/generated-output-reset.d.ts +20 -0
- package/dist/runtime/generated-output-reset.js +157 -0
- package/dist/runtime/host-database-capability-boundary.d.ts +16 -0
- package/dist/runtime/host-database-capability-boundary.js +63 -0
- package/dist/runtime/host-diagnostics.d.ts +11 -0
- package/dist/runtime/host-diagnostics.js +192 -0
- package/dist/runtime/host-execution-root.d.ts +4 -0
- package/dist/runtime/host-execution-root.js +39 -0
- package/dist/runtime/host-facts.d.ts +36 -0
- package/dist/runtime/host-facts.js +95 -0
- package/dist/runtime/host-listener-inspector.d.ts +51 -0
- package/dist/runtime/host-listener-inspector.js +385 -0
- package/dist/runtime/host-load-admission.d.ts +67 -0
- package/dist/runtime/host-load-admission.js +99 -0
- package/dist/runtime/host-load-child-environment.d.ts +27 -0
- package/dist/runtime/host-load-child-environment.js +76 -0
- package/dist/runtime/host-load-forge-cgroups.d.ts +49 -0
- package/dist/runtime/host-load-forge-cgroups.js +140 -0
- package/dist/runtime/host-load-governor-config.d.ts +52 -0
- package/dist/runtime/host-load-governor-config.js +83 -0
- package/dist/runtime/host-load-governor.d.ts +186 -0
- package/dist/runtime/host-load-governor.js +632 -0
- package/dist/runtime/host-load-ledger-lock.d.ts +69 -0
- package/dist/runtime/host-load-ledger-lock.js +187 -0
- package/dist/runtime/host-load-runtime-settings.d.ts +25 -0
- package/dist/runtime/host-load-runtime-settings.js +80 -0
- package/dist/runtime/host-load-sampler.d.ts +156 -0
- package/dist/runtime/host-load-sampler.js +298 -0
- package/dist/runtime/host-load-step-class.d.ts +70 -0
- package/dist/runtime/host-load-step-class.js +161 -0
- package/dist/runtime/host-load-step-reaper.d.ts +27 -0
- package/dist/runtime/host-load-step-reaper.js +95 -0
- package/dist/runtime/host-load-step-run.d.ts +73 -0
- package/dist/runtime/host-load-step-run.js +102 -0
- package/dist/runtime/host-load-test-slot.d.ts +43 -0
- package/dist/runtime/host-load-test-slot.js +81 -0
- package/dist/runtime/host-load-token-ledger.d.ts +200 -0
- package/dist/runtime/host-load-token-ledger.js +453 -0
- package/dist/runtime/host-load-windows-cpu.d.ts +34 -0
- package/dist/runtime/host-load-windows-cpu.js +85 -0
- package/dist/runtime/host-port-broker.d.ts +76 -0
- package/dist/runtime/host-port-broker.js +333 -0
- package/dist/runtime/host-pressure-stall.d.ts +61 -0
- package/dist/runtime/host-pressure-stall.js +168 -0
- package/dist/runtime/host-runtime-contract.d.ts +74 -0
- package/dist/runtime/host-runtime-contract.js +846 -0
- package/dist/runtime/host-runtime-lease.d.ts +287 -0
- package/dist/runtime/host-runtime-lease.js +2763 -0
- package/dist/runtime/host-runtime-promotion.d.ts +55 -0
- package/dist/runtime/host-runtime-promotion.js +254 -0
- package/dist/runtime/host-runtime-requirements-check.d.ts +17 -0
- package/dist/runtime/host-runtime-requirements-check.js +29 -0
- package/dist/runtime/host-runtime-requirements.d.ts +36 -0
- package/dist/runtime/host-runtime-requirements.js +117 -0
- package/dist/runtime/managed-command-teardown.d.ts +62 -0
- package/dist/runtime/managed-command-teardown.js +596 -0
- package/dist/runtime/memory-capacity.d.ts +70 -0
- package/dist/runtime/memory-capacity.js +123 -0
- package/dist/runtime/native-test-postgres-fallback.d.ts +69 -0
- package/dist/runtime/native-test-postgres-fallback.js +143 -0
- package/dist/runtime/node-host-runtime-adapter.d.ts +54 -0
- package/dist/runtime/node-host-runtime-adapter.js +286 -0
- package/dist/runtime/pinned-directory-process.d.ts +9 -0
- package/dist/runtime/pinned-directory-process.js +61 -0
- package/dist/runtime/pinned-source-directory.d.ts +17 -0
- package/dist/runtime/pinned-source-directory.js +94 -0
- package/dist/runtime/playwright-browser-cache.d.ts +39 -0
- package/dist/runtime/playwright-browser-cache.js +227 -0
- package/dist/runtime/playwright-host-runtime-adapter.d.ts +39 -0
- package/dist/runtime/playwright-host-runtime-adapter.js +274 -0
- package/dist/runtime/prepared-runtime-identity.d.ts +6 -0
- package/dist/runtime/prepared-runtime-identity.js +218 -0
- package/dist/runtime/prepared-runtime-readiness.d.ts +30 -0
- package/dist/runtime/prepared-runtime-readiness.js +285 -0
- package/dist/runtime/runner-settings.d.ts +104 -0
- package/dist/runtime/runner-settings.js +236 -0
- package/dist/runtime/runtime-isolation-lease.d.ts +67 -0
- package/dist/runtime/runtime-isolation-lease.js +161 -0
- package/dist/runtime/workspace-resource-estimator.d.ts +17 -0
- package/dist/runtime/workspace-resource-estimator.js +174 -0
- package/dist/sandbox/command-runner.d.ts +4 -0
- package/dist/sandbox/command-runner.js +47 -0
- package/dist/sandbox/contract.d.ts +5 -0
- package/dist/sandbox/contract.js +276 -0
- package/dist/sandbox/event-budget.d.ts +11 -0
- package/dist/sandbox/event-budget.js +27 -0
- package/dist/sandbox/host-capacity-broker.d.ts +115 -0
- package/dist/sandbox/host-capacity-broker.js +336 -0
- package/dist/sandbox/image-policy.d.ts +35 -0
- package/dist/sandbox/image-policy.js +247 -0
- package/dist/sandbox/index.d.ts +5 -0
- package/dist/sandbox/index.js +5 -0
- package/dist/sandbox/lease-watchdog.d.ts +18 -0
- package/dist/sandbox/lease-watchdog.js +67 -0
- package/dist/sandbox/managed-branch.d.ts +13 -0
- package/dist/sandbox/managed-branch.js +36 -0
- package/dist/sandbox/preflight.d.ts +84 -0
- package/dist/sandbox/preflight.js +521 -0
- package/dist/sandbox/process.d.ts +20 -0
- package/dist/sandbox/process.js +209 -0
- package/dist/sandbox/provider-auth/codex.d.ts +26 -0
- package/dist/sandbox/provider-auth/codex.js +212 -0
- package/dist/sandbox/repository-lock.d.ts +6 -0
- package/dist/sandbox/repository-lock.js +129 -0
- package/dist/sandbox/runtime.d.ts +311 -0
- package/dist/sandbox/runtime.js +2407 -0
- package/dist/sandbox/sandbox-cgroups.d.ts +14 -0
- package/dist/sandbox/sandbox-cgroups.js +42 -0
- package/dist/sandbox/sandbox.types.d.ts +93 -0
- package/dist/sandbox/sandbox.types.js +1 -0
- package/dist/sandbox/smoke.d.ts +76 -0
- package/dist/sandbox/smoke.js +380 -0
- package/dist/sandbox/worker-supervisor.d.ts +13 -0
- package/dist/sandbox/worker-supervisor.js +36 -0
- package/dist/sandbox/worker.d.ts +1 -0
- package/dist/sandbox/worker.js +225 -0
- package/dist/sandbox/workspace.service.d.ts +13 -0
- package/dist/sandbox/workspace.service.js +74 -0
- package/dist/session/architect-waits.d.ts +2 -0
- package/dist/session/architect-waits.js +138 -0
- package/dist/session/managed-attempt-tools.d.ts +48 -0
- package/dist/session/managed-attempt-tools.js +1299 -0
- package/dist/session/managed-build-coordinator.d.ts +5 -0
- package/dist/session/managed-build-coordinator.js +109 -0
- package/dist/session/managed-build-receipt.d.ts +26 -0
- package/dist/session/managed-build-receipt.js +342 -0
- package/dist/session/managed-command-host-load.d.ts +47 -0
- package/dist/session/managed-command-host-load.js +83 -0
- package/dist/session/managed-verification-timeouts.d.ts +8 -0
- package/dist/session/managed-verification-timeouts.js +17 -0
- package/dist/session/mcp-argument-coercion.d.ts +23 -0
- package/dist/session/mcp-argument-coercion.js +121 -0
- package/dist/session/phase-completion.artifacts.d.ts +34 -0
- package/dist/session/phase-completion.artifacts.js +903 -0
- package/dist/session/phase-completion.command-validation.d.ts +7 -0
- package/dist/session/phase-completion.command-validation.js +77 -0
- package/dist/session/phase-completion.d.ts +65 -42
- package/dist/session/phase-completion.helpers.d.ts +117 -0
- package/dist/session/phase-completion.helpers.js +708 -0
- package/dist/session/phase-completion.js +130 -3007
- package/dist/session/phase-completion.mcp-args.d.ts +9 -0
- package/dist/session/phase-completion.mcp-args.js +156 -0
- package/dist/session/phase-completion.prompts.d.ts +14 -0
- package/dist/session/phase-completion.prompts.js +238 -0
- package/dist/session/phase-completion.runtime.d.ts +43 -0
- package/dist/session/phase-completion.runtime.js +721 -0
- package/dist/session/phase-completion.schema-parts.d.ts +19 -0
- package/dist/session/phase-completion.schema-parts.js +188 -0
- package/dist/session/phase-completion.schemas.d.ts +3 -0
- package/dist/session/phase-completion.schemas.js +836 -0
- package/dist/session/phase-completion.validation.d.ts +37 -0
- package/dist/session/phase-completion.validation.js +874 -0
- package/dist/session/pre-publication-host-load.d.ts +27 -0
- package/dist/session/pre-publication-host-load.js +111 -0
- package/dist/session/pre-publication-native-postgres.d.ts +30 -0
- package/dist/session/pre-publication-native-postgres.js +111 -0
- package/dist/session/pre-publication-pass.d.ts +61 -0
- package/dist/session/pre-publication-pass.js +148 -0
- package/dist/session/pre-publication-process.d.ts +23 -0
- package/dist/session/pre-publication-process.js +109 -0
- package/dist/session/pre-publication-skipped-tests.d.ts +21 -0
- package/dist/session/pre-publication-skipped-tests.js +109 -0
- package/dist/session/pre-publication-step-execution.d.ts +12 -0
- package/dist/session/pre-publication-step-execution.js +50 -0
- package/dist/session/pre-publication-validation.d.ts +91 -0
- package/dist/session/pre-publication-validation.js +670 -0
- package/dist/session/provider-cli/bridge-cli.conformance-fixtures.d.ts +72 -0
- package/dist/session/provider-cli/bridge-cli.conformance-fixtures.js +462 -0
- package/dist/session/provider-cli/ci-repair-readiness.d.ts +16 -0
- package/dist/session/provider-cli/ci-repair-readiness.js +110 -0
- package/dist/session/provider-cli/claude-background-work.d.ts +67 -0
- package/dist/session/provider-cli/claude-background-work.js +181 -0
- package/dist/session/provider-cli/host-build-lock.d.ts +18 -0
- package/dist/session/provider-cli/host-build-lock.js +30 -0
- package/dist/session/provider-cli/pre-publication-repair.d.ts +56 -0
- package/dist/session/provider-cli/pre-publication-repair.js +276 -0
- package/dist/session/provider-cli/provider-cli.artifacts.d.ts +96 -0
- package/dist/session/provider-cli/provider-cli.artifacts.js +818 -0
- package/dist/session/provider-cli/provider-cli.base.d.ts +1 -0
- package/dist/session/provider-cli/provider-cli.child-environment.d.ts +7 -0
- package/dist/session/provider-cli/provider-cli.child-environment.js +75 -0
- package/dist/session/provider-cli/provider-cli.codex-models-cache.d.ts +3 -0
- package/dist/session/provider-cli/provider-cli.codex-models-cache.js +37 -0
- package/dist/session/provider-cli/provider-cli.deterministic-payloads.d.ts +12 -0
- package/dist/session/provider-cli/provider-cli.deterministic-payloads.js +279 -0
- package/dist/session/provider-cli/provider-cli.deterministic.d.ts +14 -0
- package/dist/session/provider-cli/provider-cli.deterministic.js +407 -0
- package/dist/session/provider-cli/provider-cli.merge-integrity.d.ts +89 -0
- package/dist/session/provider-cli/provider-cli.merge-integrity.js +310 -0
- package/dist/session/provider-cli/provider-cli.process.d.ts +114 -0
- package/dist/session/provider-cli/provider-cli.process.js +757 -0
- package/dist/session/provider-cli/provider-cli.prompts.d.ts +62 -0
- package/dist/session/provider-cli/provider-cli.prompts.js +770 -0
- package/dist/session/provider-cli/provider-cli.qa-sidecars.d.ts +11 -0
- package/dist/session/provider-cli/provider-cli.qa-sidecars.js +66 -0
- package/dist/session/provider-cli/provider-cli.repair-epoch.d.ts +6 -0
- package/dist/session/provider-cli/provider-cli.repair-epoch.js +11 -0
- package/dist/session/provider-cli/provider-cli.runtime.d.ts +30 -0
- package/dist/session/provider-cli/provider-cli.runtime.js +120 -0
- package/dist/session/provider-cli/provider-cli.service.d.ts +53 -53
- package/dist/session/provider-cli/provider-cli.service.js +1299 -2523
- package/dist/session/provider-cli/provider-cli.types.d.ts +38 -0
- package/dist/session/provider-cli/provider-cli.windows-environment.d.ts +10 -0
- package/dist/session/provider-cli/provider-cli.windows-environment.js +151 -0
- package/dist/session/provider-cli/provider-cli.windows-launch.d.ts +23 -0
- package/dist/session/provider-cli/provider-cli.windows-launch.js +131 -0
- package/dist/session/provider-cli/provider-in-flight-work.d.ts +10 -0
- package/dist/session/provider-cli/provider-in-flight-work.js +92 -0
- package/dist/session/provider-cli/provider-output-pipes.d.ts +30 -0
- package/dist/session/provider-cli/provider-output-pipes.js +67 -0
- package/dist/session/provider-cli/provider-output-state.d.ts +40 -0
- package/dist/session/provider-cli/provider-output-state.js +832 -0
- package/dist/session/provider-cli/provider-usage.d.ts +9 -1
- package/dist/session/provider-cli/provider-usage.js +28 -5
- package/dist/session/provider-cli/provider-user-config-isolation.d.ts +69 -0
- package/dist/session/provider-cli/provider-user-config-isolation.js +164 -0
- package/dist/session/publishable-worktree-changes.d.ts +54 -0
- package/dist/session/publishable-worktree-changes.js +193 -0
- package/dist/session/qa-sidecar-validation.d.ts +6 -0
- package/dist/session/qa-sidecar-validation.js +28 -0
- package/dist/session/sandbox-host-capacity-gate.d.ts +51 -0
- package/dist/session/sandbox-host-capacity-gate.js +257 -0
- package/dist/session/session-redaction.d.ts +3 -0
- package/dist/session/session-redaction.js +298 -0
- package/dist/session/session.base.d.ts +14 -1
- package/dist/session/session.service.d.ts +17 -2
- package/dist/session/session.service.js +708 -60
- package/dist/session/session.types.d.ts +327 -3
- package/dist/session/session.types.js +951 -10
- package/dist/session/sidecar-json-shape.d.ts +31 -0
- package/dist/session/sidecar-json-shape.js +217 -0
- package/dist/session/unreferenced-exports.d.ts +12 -0
- package/dist/session/unreferenced-exports.js +59 -0
- package/dist/session/workspace-runtime-fingerprint.d.ts +32 -0
- package/dist/session/workspace-runtime-fingerprint.js +138 -0
- package/dist/shared/format/format-bytes.d.ts +1 -0
- package/dist/shared/format/format-bytes.js +9 -0
- package/dist/shared/fs/file-identity.d.ts +10 -0
- package/dist/shared/fs/file-identity.js +15 -0
- package/dist/shared/fs/replace-file.d.ts +7 -0
- package/dist/shared/fs/replace-file.js +33 -0
- package/dist/shared/git/git.js +2 -1
- package/dist/shared/path/path.d.ts +1 -0
- package/dist/shared/path/path.js +21 -1
- package/dist/shared/process/dotnet-toolchain.d.ts +17 -0
- package/dist/shared/process/dotnet-toolchain.js +307 -0
- package/dist/shared/process/host-process-recovery.d.ts +23 -0
- package/dist/shared/process/host-process-recovery.js +99 -0
- package/dist/shared/process/host-process-supervisor.d.ts +72 -0
- package/dist/shared/process/host-process-supervisor.js +383 -0
- package/dist/shared/process/process-tree.d.ts +52 -0
- package/dist/shared/process/process-tree.js +144 -0
- package/dist/shared/process/process.d.ts +70 -0
- package/dist/shared/process/process.js +224 -16
- package/dist/shared/process/windows-app-execution-alias.d.ts +19 -0
- package/dist/shared/process/windows-app-execution-alias.js +45 -0
- package/dist/shared/process/windows-launch.d.ts +26 -0
- package/dist/shared/process/windows-launch.js +109 -0
- package/dist/shared/provider-capabilities.d.ts +4 -0
- package/dist/shared/provider-capabilities.js +95 -0
- package/dist/shared/redaction/redaction.d.ts +1 -0
- package/dist/shared/redaction/redaction.js +47 -4
- package/dist/shared/time/monotonic.d.ts +1 -0
- package/dist/shared/time/monotonic.js +8 -0
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/dist/worktree/artifact-injector.d.ts +3 -2
- package/dist/worktree/artifact-injector.js +82 -10
- package/dist/worktree/dependency-warmer.d.ts +78 -1
- package/dist/worktree/dependency-warmer.js +731 -13
- package/dist/worktree/index.d.ts +2 -1
- package/dist/worktree/index.js +1 -0
- package/dist/worktree/prior-phase-artifact-hydrator.d.ts +2 -0
- package/dist/worktree/prior-phase-artifact-hydrator.js +136 -0
- package/dist/worktree/story-qa-reference-hydrator.d.ts +4 -0
- package/dist/worktree/story-qa-reference-hydrator.js +253 -0
- package/dist/worktree/wip-git.d.ts +33 -0
- package/dist/worktree/wip-git.js +122 -0
- package/dist/worktree/wip-refs.d.ts +62 -0
- package/dist/worktree/wip-refs.js +119 -0
- package/dist/worktree/wip-restore.d.ts +38 -0
- package/dist/worktree/wip-restore.js +190 -0
- package/dist/worktree/wip-snapshot.d.ts +50 -0
- package/dist/worktree/wip-snapshot.js +268 -0
- package/dist/worktree/worktree-paths.d.ts +4 -0
- package/dist/worktree/worktree-paths.js +30 -0
- package/dist/worktree/worktree-wip-events.d.ts +18 -0
- package/dist/worktree/worktree-wip-events.js +98 -0
- package/dist/worktree/worktree-wip.d.ts +49 -0
- package/dist/worktree/worktree-wip.js +182 -0
- package/dist/worktree/worktree.base.d.ts +10 -1
- package/dist/worktree/worktree.service.d.ts +30 -4
- package/dist/worktree/worktree.service.js +379 -54
- package/dist/worktree/worktree.types.d.ts +38 -1
- package/package.json +12 -7
- package/runtime/windows-job-supervisor.ps1 +722 -0
- package/runtime/windows-listener-owner.ps1 +33 -0
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import fs from "node:fs/promises";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
import { errorCode, isProcessAlive, withFsRetry, writeJsonFileAtomically } from "./bridge-state-io.js";
|
|
4
|
+
// The id is a single safe path component (the publisher's random UUID). A marker's id is
|
|
5
|
+
// always taken from its own file name in the state directory, never from its contents, and
|
|
6
|
+
// the contents must name the same id: no path is ever built from what a file says.
|
|
7
|
+
const publisherIdPattern = /^[A-Za-z0-9-]{1,64}$/u;
|
|
8
|
+
// Allows for a writer clock slightly ahead of the reader's.
|
|
9
|
+
const futureToleranceMs = 60_000;
|
|
10
|
+
export function unpublishedMarkerPathFor(statePath, publisherId) {
|
|
11
|
+
if (!publisherIdPattern.test(publisherId))
|
|
12
|
+
throw new Error(`Invalid publisher id for an unpublished-state marker: ${JSON.stringify(publisherId)}.`);
|
|
13
|
+
return path.join(path.dirname(statePath), markerFileName(statePath, publisherId));
|
|
14
|
+
}
|
|
15
|
+
export async function writeUnpublishedMarker(statePath, marker) {
|
|
16
|
+
await writeJsonFileAtomically(unpublishedMarkerPathFor(statePath, marker.publisherId), marker);
|
|
17
|
+
}
|
|
18
|
+
export async function removeUnpublishedMarker(statePath, publisherId) {
|
|
19
|
+
await withFsRetry(() => fs.rm(unpublishedMarkerPathFor(statePath, publisherId), { force: true }));
|
|
20
|
+
}
|
|
21
|
+
/** Every marker beside the state file. Throws on one it can't trust: idle can't be confirmed then. */
|
|
22
|
+
export async function readUnpublishedMarkers(statePath, now = Date.now()) {
|
|
23
|
+
const listed = await listUnpublishedMarkers(statePath, now);
|
|
24
|
+
const untrusted = listed.find(entry => entry.marker === null);
|
|
25
|
+
if (untrusted)
|
|
26
|
+
throw new Error(`The unpublished-state marker ${untrusted.fileName} is ${untrusted.problem}.`);
|
|
27
|
+
return listed.map(entry => entry.marker);
|
|
28
|
+
}
|
|
29
|
+
/** Removes valid markers whose process has exited: they can no longer hold anything back. */
|
|
30
|
+
export async function removeExitedUnpublishedMarkers(statePath, pidAlive = isProcessAlive) {
|
|
31
|
+
const directory = path.resolve(path.dirname(statePath));
|
|
32
|
+
const listed = await listUnpublishedMarkers(statePath, Date.now()).catch(() => []);
|
|
33
|
+
for (const { fileName, marker } of listed) {
|
|
34
|
+
if (!marker || pidAlive(marker.pid))
|
|
35
|
+
continue;
|
|
36
|
+
// Only the exact file listed, directly inside the state directory.
|
|
37
|
+
const target = path.resolve(directory, fileName);
|
|
38
|
+
if (path.dirname(target) !== directory || path.basename(target) !== fileName)
|
|
39
|
+
continue;
|
|
40
|
+
await withFsRetry(() => fs.rm(target, { force: true })).catch(() => undefined);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
async function listUnpublishedMarkers(statePath, now) {
|
|
44
|
+
const directory = path.dirname(statePath);
|
|
45
|
+
const prefix = `${path.basename(statePath)}.unpublished.`;
|
|
46
|
+
let names;
|
|
47
|
+
try {
|
|
48
|
+
names = await withFsRetry(() => fs.readdir(directory));
|
|
49
|
+
}
|
|
50
|
+
catch (error) {
|
|
51
|
+
if (errorCode(error) === "ENOENT")
|
|
52
|
+
return [];
|
|
53
|
+
throw error;
|
|
54
|
+
}
|
|
55
|
+
const listed = [];
|
|
56
|
+
// Temp files of an atomic write end in ".tmp" and are not markers yet.
|
|
57
|
+
for (const fileName of names.filter(name => name.startsWith(prefix) && name.endsWith(".json"))) {
|
|
58
|
+
const publisherId = fileName.slice(prefix.length, -".json".length);
|
|
59
|
+
if (!publisherIdPattern.test(publisherId)) {
|
|
60
|
+
listed.push({ fileName, marker: null, problem: "not named for a valid publisher id" });
|
|
61
|
+
continue;
|
|
62
|
+
}
|
|
63
|
+
let text;
|
|
64
|
+
try {
|
|
65
|
+
text = await withFsRetry(() => fs.readFile(path.join(directory, fileName), "utf8"));
|
|
66
|
+
}
|
|
67
|
+
catch (error) {
|
|
68
|
+
// Removed between the listing and the read: its publisher has published again.
|
|
69
|
+
if (errorCode(error) === "ENOENT")
|
|
70
|
+
continue;
|
|
71
|
+
throw error;
|
|
72
|
+
}
|
|
73
|
+
const marker = parseMarker(text, publisherId, now);
|
|
74
|
+
listed.push(marker ? { fileName, marker, problem: null } : { fileName, marker: null, problem: "malformed" });
|
|
75
|
+
}
|
|
76
|
+
return listed;
|
|
77
|
+
}
|
|
78
|
+
function markerFileName(statePath, publisherId) {
|
|
79
|
+
return `${path.basename(statePath)}.unpublished.${publisherId}.json`;
|
|
80
|
+
}
|
|
81
|
+
// Every field the evaluator relies on, with its type and range: a marker it could not use to
|
|
82
|
+
// hold readers back (a NaN timestamp or interval) is malformed, which reads as unknown.
|
|
83
|
+
const markerChecks = [
|
|
84
|
+
marker => marker.schemaVersion === 1,
|
|
85
|
+
marker => Number.isInteger(marker.pid) && marker.pid > 0,
|
|
86
|
+
(marker, publisherId) => marker.publisherId === publisherId,
|
|
87
|
+
marker => typeof marker.runnerInstanceId === "string",
|
|
88
|
+
(marker, _publisherId, now) => isPastTimestamp(marker.since, now),
|
|
89
|
+
(marker, _publisherId, now) => isPastTimestamp(marker.updatedAt, now),
|
|
90
|
+
marker => typeof marker.publishIntervalMs === "number" && Number.isFinite(marker.publishIntervalMs) && marker.publishIntervalMs > 0,
|
|
91
|
+
marker => typeof marker.error === "string",
|
|
92
|
+
];
|
|
93
|
+
function parseMarker(text, publisherId, now) {
|
|
94
|
+
let value;
|
|
95
|
+
try {
|
|
96
|
+
value = JSON.parse(text);
|
|
97
|
+
}
|
|
98
|
+
catch {
|
|
99
|
+
return null;
|
|
100
|
+
}
|
|
101
|
+
if (!value || typeof value !== "object" || Array.isArray(value))
|
|
102
|
+
return null;
|
|
103
|
+
const marker = value;
|
|
104
|
+
return markerChecks.every(check => check(marker, publisherId, now)) ? marker : null;
|
|
105
|
+
}
|
|
106
|
+
function isPastTimestamp(value, now) {
|
|
107
|
+
if (typeof value !== "string")
|
|
108
|
+
return false;
|
|
109
|
+
const at = Date.parse(value);
|
|
110
|
+
return Number.isFinite(at) && at <= now + futureToleranceMs;
|
|
111
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { BridgeCancelHandler, BridgeDispatchHandler, BridgeServiceConfig } from "./bridge.types.js";
|
|
1
|
+
import type { BridgeCancelHandler, BridgeChatTurnHandler, BridgeDispatchHandler, BridgeLeaseUpdateHandler, BridgeOfferHandler, BridgeReadinessProbeHandler, BridgeReapHandler, BridgeServiceConfig, BridgeStartHandler } from "./bridge.types.js";
|
|
2
2
|
export interface BridgeService {
|
|
3
3
|
connectOnce(): Promise<void>;
|
|
4
4
|
run(signal?: AbortSignal): Promise<void>;
|
|
@@ -8,10 +8,27 @@ export interface BridgeConnection {
|
|
|
8
8
|
start(): Promise<void>;
|
|
9
9
|
stop(): Promise<void>;
|
|
10
10
|
onClose(handler: (error?: Error) => void): void;
|
|
11
|
+
onReconnecting?(handler: (error?: Error) => void): void;
|
|
12
|
+
onReconnected?(handler: (connectionId?: string) => void | Promise<void>): void;
|
|
11
13
|
onDispatch(handler: BridgeDispatchHandler): void;
|
|
14
|
+
onChatTurn?(handler: BridgeChatTurnHandler): void;
|
|
15
|
+
onOffer?(handler: BridgeOfferHandler): void;
|
|
16
|
+
onStart?(handler: BridgeStartHandler): void;
|
|
17
|
+
onLeaseUpdate?(handler: BridgeLeaseUpdateHandler): void;
|
|
12
18
|
onCancel(handler: BridgeCancelHandler): void;
|
|
19
|
+
onReap?(handler: BridgeReapHandler): void;
|
|
20
|
+
onReadinessProbe?(handler: BridgeReadinessProbeHandler): void;
|
|
21
|
+
/** Decision 0014: the owner removed this runner from Forge; the bridge must stop, not reconnect. */
|
|
22
|
+
onRevoked?(handler: (notice: BridgeRevokedNotice) => void): void;
|
|
23
|
+
/** Decision 0014: the server pushes the runner settings document (`ApplySettings`, schema 8 bridges only). */
|
|
24
|
+
onApplySettings?(handler: (document: unknown) => void | Promise<void>): void;
|
|
13
25
|
invoke<TResponse>(methodName: string, payload: unknown): Promise<TResponse>;
|
|
14
26
|
}
|
|
27
|
+
/** The `Revoked` hub message: the runner was removed from Forge and must be paired again. */
|
|
28
|
+
export interface BridgeRevokedNotice {
|
|
29
|
+
runnerId?: string;
|
|
30
|
+
reason?: string;
|
|
31
|
+
}
|
|
15
32
|
export interface BridgeConnectionFactory {
|
|
16
33
|
create(config: BridgeServiceConfig): BridgeConnection;
|
|
17
34
|
}
|
|
@@ -1,33 +1,228 @@
|
|
|
1
1
|
import type { SessionService } from "../session/session.base.js";
|
|
2
|
-
import
|
|
3
|
-
import
|
|
2
|
+
import { type ProviderProcessRunner } from "../session/provider-cli/provider-cli.service.js";
|
|
3
|
+
import { type RunnerSettingsReport } from "../runtime/runner-settings.js";
|
|
4
|
+
import { DockerEngineProbe, type DockerEngineCapabilitySnapshot } from "../runtime/docker-engine-probe.js";
|
|
5
|
+
import { type RunOnceDispatchPacket, type RunOnceResultPacket } from "../session/session.types.js";
|
|
6
|
+
import { DockerPreflight } from "../sandbox/preflight.js";
|
|
7
|
+
import { type SandboxRuntime } from "../sandbox/runtime.js";
|
|
8
|
+
import type { BridgeConnection, BridgeConnectionFactory, BridgeRevokedNotice, BridgeService } from "./bridge.base.js";
|
|
9
|
+
import { type RunnerHostCapabilityProbe } from "./runner-host-capabilities.js";
|
|
10
|
+
import { type HostLoadSource } from "../runtime/host-load-sampler.js";
|
|
11
|
+
import type { BridgeCancelHandler, BridgeChatTurnHandler, BridgeDispatchHandler, BridgeLeaseUpdateRequest, BridgeReapRequest, BridgeServiceConfig } from "./bridge.types.js";
|
|
12
|
+
import { type ReadinessResultOutbox } from "./readiness-result-outbox.js";
|
|
13
|
+
import { type DispatchResultOutbox } from "./dispatch-result-outbox.js";
|
|
14
|
+
import { BridgeInFlightRegistry } from "./in-flight-registry.js";
|
|
15
|
+
import { canReserveSandboxResources, resolveDynamicSandboxResources, resolveSandboxResourcesFromRepo, sandboxCapacityFailureMessage, sandboxMemoryCommitmentCapacity, type ResolvedSandboxResourceProfile, type SandboxResourceVector } from "./sandbox-resource-accounting.js";
|
|
16
|
+
export type SandboxResourceResolver = (dispatch: RunOnceDispatchPacket) => Promise<ResolvedSandboxResourceProfile>;
|
|
17
|
+
export { canReserveSandboxResources, resolveDynamicSandboxResources, resolveSandboxResourcesFromRepo, sandboxCapacityFailureMessage, sandboxMemoryCommitmentCapacity, };
|
|
18
|
+
export type { ResolvedSandboxResourceProfile, SandboxResourceVector };
|
|
19
|
+
/**
|
|
20
|
+
* Protocol-v2 events are acknowledged one at a time before runOnce returns.
|
|
21
|
+
* Sending the complete transcript again in DispatchResult made long QA and CI
|
|
22
|
+
* sessions exceed SignalR's receive limit, disconnecting the bridge after the
|
|
23
|
+
* provider had already completed. The API combines its acknowledged streamed
|
|
24
|
+
* events with the terminal result, so the callback only needs the outcome and
|
|
25
|
+
* artifacts. Protocol v1 retains the transcript for legacy servers.
|
|
26
|
+
*/
|
|
27
|
+
export declare function compactTerminalResult(dispatch: RunOnceDispatchPacket, result: RunOnceResultPacket): RunOnceResultPacket;
|
|
4
28
|
export declare class ForgeBridgeService implements BridgeService {
|
|
5
29
|
private readonly config;
|
|
6
|
-
private readonly sessions;
|
|
7
30
|
private readonly connections;
|
|
31
|
+
private readonly hostCapabilityProbe;
|
|
32
|
+
private readonly chatProcessRunner;
|
|
33
|
+
private readonly hostLoad;
|
|
8
34
|
private connection;
|
|
9
35
|
private heartbeatTimer;
|
|
36
|
+
private heartbeatInFlight;
|
|
37
|
+
private consecutiveHeartbeatFailures;
|
|
38
|
+
private reconnectingFromHeartbeatFailure;
|
|
39
|
+
private leaseWatchdogTimer;
|
|
40
|
+
private sandboxMaintenanceTimer;
|
|
41
|
+
private sandboxMaintenanceRunning;
|
|
10
42
|
private closed;
|
|
43
|
+
private transportRecovery;
|
|
44
|
+
private transportRecoveryGeneration;
|
|
11
45
|
private stopped;
|
|
46
|
+
private revokedReason;
|
|
12
47
|
private readonly activeSessions;
|
|
13
|
-
|
|
48
|
+
private readonly reservations;
|
|
49
|
+
private readonly activeReadinessProbes;
|
|
50
|
+
/** Everything a bridge restart would interrupt, published for `forge-bridge status --idle`. */
|
|
51
|
+
readonly inFlight: BridgeInFlightRegistry;
|
|
52
|
+
private readonly readinessResultOutbox;
|
|
53
|
+
private readinessResultFlush;
|
|
54
|
+
private readonly dispatchResultOutbox;
|
|
55
|
+
private dispatchResultFlush;
|
|
56
|
+
private dispatchResultGeneration;
|
|
57
|
+
private dispatchResultFlushedGeneration;
|
|
58
|
+
private readonly dispatchResultHandoffs;
|
|
59
|
+
private readonly preflight;
|
|
60
|
+
private readonly dockerEngineProbe;
|
|
61
|
+
private readonly sandboxRuntime;
|
|
62
|
+
private readonly sandboxResourceResolver;
|
|
63
|
+
private readonly sessions;
|
|
64
|
+
private readonly enforceHostDatabaseCapabilityBoundary;
|
|
65
|
+
private hostCapabilities;
|
|
66
|
+
private dockerAvailable;
|
|
67
|
+
private appliedSettingsDocument;
|
|
68
|
+
private localYield;
|
|
69
|
+
/** The yield Forge last acknowledged in a report (Hello, Heartbeat, SettingsApplied); published as `yielding`. */
|
|
70
|
+
private forgeAckedYield;
|
|
71
|
+
private publishState;
|
|
72
|
+
private effectiveSettings;
|
|
73
|
+
private settingsReport;
|
|
74
|
+
/** Applies run one at a time; offers wait for every apply queued before them. */
|
|
75
|
+
private settingsTail;
|
|
76
|
+
private pendingYieldOn;
|
|
77
|
+
private settingsStarted;
|
|
78
|
+
private hostRequirementFacts;
|
|
79
|
+
private readonly recoveredHostAttempts;
|
|
80
|
+
private hostCapabilitiesDetected;
|
|
81
|
+
constructor(config: BridgeServiceConfig, sessions?: SessionService | undefined, connections?: BridgeConnectionFactory, preflight?: DockerPreflight, sandboxRuntime?: SandboxRuntime, sandboxResourceResolver?: SandboxResourceResolver, dockerEngineProbe?: DockerEngineProbe, hostCapabilityProbe?: RunnerHostCapabilityProbe, readinessResultOutbox?: ReadinessResultOutbox, chatProcessRunner?: ProviderProcessRunner, dispatchResultOutbox?: DispatchResultOutbox, hostLoad?: HostLoadSource);
|
|
14
82
|
connectOnce(): Promise<void>;
|
|
83
|
+
private rememberRecoveredHostAttempts;
|
|
84
|
+
private recoveredHostAttemptsForHello;
|
|
85
|
+
private registerConnection;
|
|
15
86
|
run(signal?: AbortSignal): Promise<void>;
|
|
87
|
+
private startStatePublisher;
|
|
88
|
+
/** The reason Forge gave when it removed this runner, or null while it is paired. */
|
|
89
|
+
get revoked(): string | null;
|
|
90
|
+
/**
|
|
91
|
+
* Decision 0014 §3 "Remove": Forge removed this runner. Stop for good instead of
|
|
92
|
+
* reconnecting; its attempts were already settled on the server, so local work is
|
|
93
|
+
* aborted rather than reported.
|
|
94
|
+
*/
|
|
95
|
+
private handleRevoked;
|
|
96
|
+
/** The effective settings and how they were derived, as last reported (decision 0014). */
|
|
97
|
+
get runnerSettings(): RunnerSettingsReport;
|
|
98
|
+
private runnerHostDefaults;
|
|
99
|
+
/**
|
|
100
|
+
* Once per bridge process: drop governor overrides an earlier process left on
|
|
101
|
+
* the state root, then put today's effective settings (env bounds and the local
|
|
102
|
+
* yield flag, no server document yet) in force.
|
|
103
|
+
*/
|
|
104
|
+
private startSettings;
|
|
105
|
+
/**
|
|
106
|
+
* Decision 0014 `ApplySettings`. Applies only a document newer than the one
|
|
107
|
+
* applied, one at a time, then acknowledges it with `SettingsApplied`. A replay of
|
|
108
|
+
* the applied version is acknowledged again without applying it; an older one is
|
|
109
|
+
* ignored.
|
|
110
|
+
*/
|
|
111
|
+
private handleApplySettings;
|
|
112
|
+
/**
|
|
113
|
+
* Polls the local `forge-bridge yield` flag (every heartbeat and before each
|
|
114
|
+
* offer decision). A change is applied at once and reported again under the
|
|
115
|
+
* same settings version.
|
|
116
|
+
*/
|
|
117
|
+
/** Yielding now, or about to: a received yield-on that is still being applied counts. */
|
|
118
|
+
private yieldingOrQueued;
|
|
119
|
+
private refreshLocalYield;
|
|
120
|
+
/**
|
|
121
|
+
* A setting the host couldn't put in force holds placement on the server, so
|
|
122
|
+
* every heartbeat tries the applied document again until it takes.
|
|
123
|
+
*/
|
|
124
|
+
private retryFailedSettings;
|
|
125
|
+
private readLocalYield;
|
|
126
|
+
private enqueueSettings;
|
|
127
|
+
private applySettings;
|
|
128
|
+
/**
|
|
129
|
+
* Max attempts and the memory reserve go to host attempt admission; the governor
|
|
130
|
+
* budget (the yield budget while yielding) and the heavy-step limit go to the
|
|
131
|
+
* shared settings file every governor on the state root reads at admission.
|
|
132
|
+
* Neither touches admitted work. Returns the keys the host could not put in
|
|
133
|
+
* force (`apply_failed`); their previous values stay in force.
|
|
134
|
+
*/
|
|
135
|
+
private putSettingsInForce;
|
|
136
|
+
private ackYield;
|
|
137
|
+
/** A failed acknowledgement is not retried here: the next heartbeat carries the same report. */
|
|
138
|
+
private sendSettingsApplied;
|
|
16
139
|
stop(): Promise<void>;
|
|
140
|
+
private handleChatTurn;
|
|
141
|
+
private createChatTurnWorkspace;
|
|
142
|
+
private runChatProviderProcess;
|
|
143
|
+
private sendChatProviderEvent;
|
|
144
|
+
private sendChatAbortTerminal;
|
|
145
|
+
private sendStandaloneChatTerminal;
|
|
146
|
+
private sendChatCallback;
|
|
147
|
+
private invokeChatCallbackWithRetry;
|
|
148
|
+
private requiredChatCapabilityFailure;
|
|
149
|
+
private bridgeChatCapability;
|
|
17
150
|
private handleDispatch;
|
|
151
|
+
private registerActiveDispatch;
|
|
152
|
+
private dispatchEventSink;
|
|
153
|
+
/** Runs the dispatch on the host or in its Docker sandbox, logging start and end with its ids. */
|
|
154
|
+
private runDispatchOnce;
|
|
155
|
+
private reservedDispatchHandoffIsCurrent;
|
|
156
|
+
private releaseReservedDispatchHandoff;
|
|
157
|
+
private releaseActiveSessionAndRefreshCapacity;
|
|
158
|
+
private handleOffer;
|
|
159
|
+
private commitOfferReservation;
|
|
160
|
+
private handleStart;
|
|
161
|
+
private redeemSecretGrant;
|
|
162
|
+
private redeemPublishGrant;
|
|
163
|
+
private handleLeaseUpdate;
|
|
164
|
+
private sendOfferDecision;
|
|
18
165
|
private parseDispatchOrReport;
|
|
166
|
+
private parseChatTurnOrReport;
|
|
19
167
|
private handleCancel;
|
|
168
|
+
private chatCancelMatchesActiveTurn;
|
|
169
|
+
private handleReap;
|
|
170
|
+
private handleReadinessProbe;
|
|
171
|
+
private deferActiveReadinessProbes;
|
|
172
|
+
private flushReadinessResults;
|
|
173
|
+
private flushReadinessResultsCore;
|
|
20
174
|
private abortActiveSessions;
|
|
175
|
+
private abortActiveReadinessProbes;
|
|
176
|
+
private normalizeReadinessProbe;
|
|
21
177
|
private normalizeDispatch;
|
|
22
178
|
private sendResult;
|
|
179
|
+
private sendLegacyResult;
|
|
180
|
+
private sendResultPayload;
|
|
181
|
+
private sendResultPayloadDirect;
|
|
182
|
+
private flushDispatchResults;
|
|
183
|
+
private flushDispatchResultsCore;
|
|
184
|
+
/**
|
|
185
|
+
* Forge binds each result to the runner instance that ran the attempt. On an
|
|
186
|
+
* authoritative connection it rejects another instance's result with
|
|
187
|
+
* bridge.stale_result_instance; Forge's own recovery handles that attempt,
|
|
188
|
+
* so the record can never be delivered and must not block the replay queue.
|
|
189
|
+
* bridge.stale_runner_instance means this connection is not authoritative
|
|
190
|
+
* and says nothing about the record, so it never quarantines.
|
|
191
|
+
*/
|
|
192
|
+
private isReplacedRunnerInstanceResult;
|
|
23
193
|
private startHeartbeat;
|
|
194
|
+
private heartbeatTick;
|
|
195
|
+
private startLeaseWatchdog;
|
|
196
|
+
private stopLeaseWatchdog;
|
|
197
|
+
private expireLeases;
|
|
198
|
+
private expireReservations;
|
|
24
199
|
private stopHeartbeat;
|
|
200
|
+
private startSandboxMaintenance;
|
|
201
|
+
private stopSandboxMaintenance;
|
|
202
|
+
private runSandboxMaintenance;
|
|
203
|
+
private readAttemptSnapshot;
|
|
204
|
+
private flushCleanupReports;
|
|
25
205
|
private sendHeartbeat;
|
|
206
|
+
private sendHeartbeatSnapshot;
|
|
26
207
|
private capabilities;
|
|
208
|
+
private requiredCapabilityFailure;
|
|
209
|
+
private usedSandboxResources;
|
|
210
|
+
private activeSandboxResources;
|
|
211
|
+
private sandboxResourceCapacity;
|
|
27
212
|
private invokeAck;
|
|
213
|
+
private beginTransportRecovery;
|
|
214
|
+
private completeTransportRecovery;
|
|
215
|
+
private waitForTransportRecovery;
|
|
28
216
|
private waitForClose;
|
|
29
217
|
private stopConnection;
|
|
30
218
|
}
|
|
219
|
+
/** The `run` command's exit code after Forge removed the runner. */
|
|
220
|
+
export declare const bridgeRevokedExitCode = 3;
|
|
221
|
+
export declare const bridgeRevokedMessage = "This bridge was removed from Forge. Pair it again with forge-bridge pair.";
|
|
222
|
+
/** Thrown by `run` after Forge removed the runner, so the CLI exits instead of reconnecting. */
|
|
223
|
+
export declare class BridgeRevokedError extends Error {
|
|
224
|
+
constructor(message?: string);
|
|
225
|
+
}
|
|
31
226
|
export declare class SignalRBridgeConnectionFactory implements BridgeConnectionFactory {
|
|
32
227
|
create(config: BridgeServiceConfig): BridgeConnection;
|
|
33
228
|
}
|
|
@@ -35,12 +230,29 @@ export declare class SignalRBridgeConnection implements BridgeConnection {
|
|
|
35
230
|
private readonly config;
|
|
36
231
|
private readonly connection;
|
|
37
232
|
constructor(config: BridgeServiceConfig);
|
|
233
|
+
onApplySettings(handler: (document: unknown) => void | Promise<void>): void;
|
|
234
|
+
onRevoked(handler: (notice: BridgeRevokedNotice) => void): void;
|
|
38
235
|
start(): Promise<void>;
|
|
39
236
|
stop(): Promise<void>;
|
|
40
237
|
onClose(handler: (error?: Error) => void): void;
|
|
238
|
+
onReconnecting(handler: (error?: Error) => void): void;
|
|
239
|
+
onReconnected(handler: (connectionId?: string) => void | Promise<void>): void;
|
|
41
240
|
onDispatch(handler: BridgeDispatchHandler): void;
|
|
241
|
+
onChatTurn(handler: BridgeChatTurnHandler): void;
|
|
242
|
+
onOffer(handler: BridgeDispatchHandler): void;
|
|
243
|
+
onStart(handler: BridgeDispatchHandler): void;
|
|
244
|
+
onLeaseUpdate(handler: (request: BridgeLeaseUpdateRequest) => Promise<void>): void;
|
|
42
245
|
onCancel(handler: BridgeCancelHandler): void;
|
|
246
|
+
onReap(handler: (request: BridgeReapRequest) => Promise<void>): void;
|
|
247
|
+
onReadinessProbe(handler: (request: unknown) => Promise<void>): void;
|
|
43
248
|
invoke<TResponse>(methodName: string, payload: unknown): Promise<TResponse>;
|
|
44
249
|
}
|
|
45
250
|
export declare function defaultBridgeServiceConfig(overrides?: Partial<BridgeServiceConfig>): BridgeServiceConfig;
|
|
46
251
|
export declare function resolveBridgeRunnerHubUrl(serverUrl: string): URL;
|
|
252
|
+
export declare function delay(ms: number, signal?: AbortSignal): Promise<void>;
|
|
253
|
+
export declare function waitForPromiseOrAbort(promise: Promise<unknown>, signal?: AbortSignal): Promise<void>;
|
|
254
|
+
export declare function canReapManagedSandboxes(preflight: {
|
|
255
|
+
readonly healthy: boolean;
|
|
256
|
+
readonly unavailableCode?: string | null;
|
|
257
|
+
}): boolean;
|
|
258
|
+
export declare function dockerEngineRequirementFailure(requiredCapabilities: readonly string[], executionMode: string | undefined, capability: DockerEngineCapabilitySnapshot | null): string | null;
|