@loucompanion/forge-bridge 0.1.3-dev.fbe15023cdfe → 0.1.4-dev.03584818ede5
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 +146 -5
- package/dist/bridge/bridge-chat-provider-command.d.ts +16 -0
- package/dist/bridge/bridge-chat-provider-command.js +137 -0
- package/dist/bridge/bridge-chat.types.d.ts +121 -0
- package/dist/bridge/bridge-chat.types.js +416 -0
- package/dist/bridge/bridge.base.d.ts +13 -1
- package/dist/bridge/bridge.service.d.ts +155 -4
- package/dist/bridge/bridge.service.js +1805 -155
- package/dist/bridge/bridge.types.d.ts +68 -1
- 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/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 +21 -0
- package/dist/bridge/readiness-result-outbox.js +54 -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/test-postgres-capability.d.ts +14 -0
- package/dist/bridge/test-postgres-capability.js +120 -0
- package/dist/cleanup/cleanup.service.d.ts +10 -0
- package/dist/cleanup/cleanup.service.js +128 -104
- package/dist/cleanup/cleanup.types.d.ts +4 -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 +5 -0
- package/dist/cleanup/host-runtime-ledger.js +109 -0
- package/dist/cleanup/managed-branch-sweep.d.ts +27 -0
- package/dist/cleanup/managed-branch-sweep.js +111 -0
- package/dist/cli/cli.help.js +22 -4
- package/dist/cli/cli.service.d.ts +30 -6
- package/dist/cli/cli.service.js +216 -31
- package/dist/cli/local-config.d.ts +5 -0
- package/dist/cli/local-config.js +30 -4
- package/dist/runtime/aspnet-runtime-prebuild.d.ts +36 -0
- package/dist/runtime/aspnet-runtime-prebuild.js +429 -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 +2 -1
- package/dist/runtime/attempt-node-runtime-launcher.js +57 -18
- 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.d.ts +35 -0
- package/dist/runtime/attempt-process-supervisor.js +144 -23
- 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 +90 -0
- package/dist/runtime/docker-engine-probe.js +333 -0
- package/dist/runtime/generated-output-reset.d.ts +10 -0
- package/dist/runtime/generated-output-reset.js +62 -8
- 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 +8 -1
- package/dist/runtime/host-listener-inspector.js +121 -60
- 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 +184 -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 +185 -0
- package/dist/runtime/host-load-runtime-settings.d.ts +25 -0
- package/dist/runtime/host-load-runtime-settings.js +78 -0
- package/dist/runtime/host-load-sampler.d.ts +149 -0
- package/dist/runtime/host-load-sampler.js +291 -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-pressure-stall.d.ts +61 -0
- package/dist/runtime/host-pressure-stall.js +168 -0
- package/dist/runtime/host-runtime-contract.d.ts +16 -1
- package/dist/runtime/host-runtime-contract.js +174 -56
- package/dist/runtime/host-runtime-lease.d.ts +163 -9
- package/dist/runtime/host-runtime-lease.js +1464 -121
- package/dist/runtime/host-runtime-promotion.d.ts +35 -3
- package/dist/runtime/host-runtime-promotion.js +107 -12
- 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 +607 -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 +25 -0
- package/dist/runtime/native-test-postgres-fallback.js +91 -0
- package/dist/runtime/node-host-runtime-adapter.d.ts +3 -0
- package/dist/runtime/node-host-runtime-adapter.js +29 -11
- 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 +19 -0
- package/dist/runtime/playwright-host-runtime-adapter.js +113 -59
- 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 +100 -0
- package/dist/runtime/runner-settings.js +214 -0
- package/dist/runtime/runtime-isolation-lease.js +4 -1
- package/dist/runtime/workspace-resource-estimator.d.ts +17 -0
- package/dist/runtime/workspace-resource-estimator.js +174 -0
- package/dist/sandbox/host-capacity-broker.d.ts +113 -0
- package/dist/sandbox/host-capacity-broker.js +334 -0
- package/dist/sandbox/preflight.d.ts +31 -1
- package/dist/sandbox/preflight.js +237 -51
- package/dist/sandbox/repository-lock.d.ts +2 -1
- package/dist/sandbox/repository-lock.js +19 -9
- package/dist/sandbox/runtime.d.ts +16 -2
- package/dist/sandbox/runtime.js +182 -109
- package/dist/sandbox/sandbox-cgroups.d.ts +14 -0
- package/dist/sandbox/sandbox-cgroups.js +42 -0
- package/dist/sandbox/sandbox.types.d.ts +7 -0
- package/dist/sandbox/workspace.service.js +2 -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 +44 -1
- package/dist/session/managed-attempt-tools.js +816 -46
- 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 +21 -0
- package/dist/session/managed-build-receipt.js +337 -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 +24 -0
- package/dist/session/phase-completion.artifacts.js +319 -44
- 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 +15 -1
- package/dist/session/phase-completion.helpers.d.ts +5 -0
- package/dist/session/phase-completion.helpers.js +43 -19
- package/dist/session/phase-completion.js +18 -3
- package/dist/session/phase-completion.prompts.js +22 -18
- package/dist/session/phase-completion.runtime.d.ts +6 -2
- package/dist/session/phase-completion.runtime.js +191 -47
- 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 -3
- package/dist/session/phase-completion.schemas.js +250 -226
- package/dist/session/phase-completion.validation.d.ts +3 -3
- package/dist/session/phase-completion.validation.js +135 -89
- 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-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 +11 -0
- package/dist/session/pre-publication-step-execution.js +49 -0
- package/dist/session/pre-publication-validation.d.ts +87 -0
- package/dist/session/pre-publication-validation.js +668 -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 +8 -0
- package/dist/session/provider-cli/ci-repair-readiness.js +23 -3
- package/dist/session/provider-cli/claude-background-work.d.ts +66 -0
- package/dist/session/provider-cli/claude-background-work.js +180 -0
- package/dist/session/provider-cli/pre-publication-repair.d.ts +40 -0
- package/dist/session/provider-cli/pre-publication-repair.js +243 -0
- package/dist/session/provider-cli/provider-cli.artifacts.d.ts +6 -3
- package/dist/session/provider-cli/provider-cli.artifacts.js +62 -22
- package/dist/session/provider-cli/provider-cli.child-environment.d.ts +7 -0
- package/dist/session/provider-cli/provider-cli.child-environment.js +73 -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.js +34 -2
- 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 +92 -14
- package/dist/session/provider-cli/provider-cli.process.js +583 -210
- package/dist/session/provider-cli/provider-cli.prompts.d.ts +12 -0
- package/dist/session/provider-cli/provider-cli.prompts.js +200 -25
- 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 +14 -1
- package/dist/session/provider-cli/provider-cli.runtime.js +61 -3
- package/dist/session/provider-cli/provider-cli.service.d.ts +33 -5
- package/dist/session/provider-cli/provider-cli.service.js +819 -84
- package/dist/session/provider-cli/provider-cli.types.d.ts +32 -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-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 +18 -0
- package/dist/session/provider-cli/provider-output-state.js +376 -17
- package/dist/session/provider-cli/provider-usage.d.ts +9 -1
- package/dist/session/provider-cli/provider-usage.js +28 -5
- package/dist/session/publishable-worktree-changes.d.ts +54 -0
- package/dist/session/publishable-worktree-changes.js +193 -0
- package/dist/session/sandbox-host-capacity-gate.d.ts +30 -0
- package/dist/session/sandbox-host-capacity-gate.js +238 -0
- package/dist/session/session-redaction.js +434 -9
- package/dist/session/session.base.d.ts +9 -1
- package/dist/session/session.service.d.ts +9 -2
- package/dist/session/session.service.js +264 -27
- package/dist/session/session.types.d.ts +150 -2
- package/dist/session/session.types.js +599 -7
- 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/git/git.js +2 -1
- package/dist/shared/path/path.d.ts +1 -0
- package/dist/shared/path/path.js +18 -0
- 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.js +3 -2
- package/dist/shared/process/host-process-supervisor.d.ts +3 -0
- package/dist/shared/process/host-process-supervisor.js +61 -12
- 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 +69 -0
- package/dist/shared/process/process.js +223 -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 +18 -0
- package/dist/shared/process/windows-launch.js +68 -0
- package/dist/shared/provider-capabilities.d.ts +3 -0
- package/dist/shared/provider-capabilities.js +84 -0
- package/dist/shared/redaction/redaction.d.ts +1 -0
- package/dist/shared/redaction/redaction.js +39 -3
- 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/dependency-warmer.d.ts +66 -9
- package/dist/worktree/dependency-warmer.js +609 -24
- package/dist/worktree/index.d.ts +1 -1
- package/dist/worktree/story-qa-reference-hydrator.d.ts +4 -0
- package/dist/worktree/story-qa-reference-hydrator.js +253 -0
- package/dist/worktree/worktree.service.d.ts +17 -1
- package/dist/worktree/worktree.service.js +293 -21
- package/dist/worktree/worktree.types.d.ts +14 -1
- package/package.json +8 -6
- package/runtime/windows-job-supervisor.ps1 +380 -14
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
// Cleanup may delete a worktree folder only when Forge itself created it for one of its own
|
|
2
|
+
// attempts. Forge places every such worktree at an exact path under the repository's managed root
|
|
3
|
+
// (`<repo parent>/.forge-worktrees/<repo name>`), built from the lease's worktree key:
|
|
4
|
+
// <kind>/<12 hex> a work item (story, task, bug, feature, work_order) or
|
|
5
|
+
// its Architect phase (architect)
|
|
6
|
+
// decompose/<feature|work_order>/<12 hex> a decompose session
|
|
7
|
+
// runtime-readiness-<UUID> a runtime readiness probe (session.service.ts)
|
|
8
|
+
// draft-<32 hex> a drafting session (DraftingService on the server)
|
|
9
|
+
// A release that couldn't finish deleting can leave `<one of those>.forge-release-<UUID>` beside it.
|
|
10
|
+
// Anything else under the root, such as a folder a person or another tool made there, is never
|
|
11
|
+
// removed, even if it is a Git worktree of the same repository.
|
|
12
|
+
import path from "node:path";
|
|
13
|
+
const hex12 = "[0-9a-f]{12}";
|
|
14
|
+
const uuid = "[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}";
|
|
15
|
+
const releaseSuffix = `(?:\\.forge-release-${uuid})?`;
|
|
16
|
+
const forgeOwnedWorktreePathPattern = new RegExp("^(?:"
|
|
17
|
+
+ `(?:story|task|bug|feature|work_order|architect)/${hex12}`
|
|
18
|
+
+ `|decompose/(?:feature|work_order)/${hex12}`
|
|
19
|
+
+ `|runtime-readiness-${uuid}`
|
|
20
|
+
+ "|draft-[0-9a-f]{32}"
|
|
21
|
+
+ `)${releaseSuffix}$`);
|
|
22
|
+
const runtimeReadinessNamePattern = new RegExp(`^runtime-readiness-${uuid}$`);
|
|
23
|
+
// Folders that only group Forge's worktrees; cleanup may look inside them but never removes them.
|
|
24
|
+
const forgeWorktreeContainers = new Set([
|
|
25
|
+
"story",
|
|
26
|
+
"task",
|
|
27
|
+
"bug",
|
|
28
|
+
"feature",
|
|
29
|
+
"work_order",
|
|
30
|
+
"architect",
|
|
31
|
+
"decompose",
|
|
32
|
+
"decompose/feature",
|
|
33
|
+
"decompose/work_order",
|
|
34
|
+
]);
|
|
35
|
+
// Split only on the separators the filesystem itself uses. On POSIX a backslash is an ordinary
|
|
36
|
+
// filename character, so a folder a person named `story\0123456789ab` must not read as Forge's
|
|
37
|
+
// `story/0123456789ab`. Windows accepts both `\` and `/`.
|
|
38
|
+
function normalizeRelativePath(relativePath, separator) {
|
|
39
|
+
const separators = separator === path.win32.sep ? /[\\/]+/u : /\/+/u;
|
|
40
|
+
return relativePath.split(separators).filter(segment => segment.length > 0).join("/");
|
|
41
|
+
}
|
|
42
|
+
/** True when `relativePath` (relative to the managed root) is a worktree path Forge creates. */
|
|
43
|
+
export function isForgeOwnedWorktreePath(relativePath, separator = path.sep) {
|
|
44
|
+
return forgeOwnedWorktreePathPattern.test(normalizeRelativePath(relativePath, separator));
|
|
45
|
+
}
|
|
46
|
+
/** True when `relativePath` is one of the folders Forge groups its worktrees in. */
|
|
47
|
+
export function isForgeWorktreeContainer(relativePath, separator = path.sep) {
|
|
48
|
+
return forgeWorktreeContainers.has(normalizeRelativePath(relativePath, separator));
|
|
49
|
+
}
|
|
50
|
+
/** True for a readiness probe's exact folder or branch name: runtime-readiness-<UUID>. */
|
|
51
|
+
export function isRuntimeReadinessName(name) {
|
|
52
|
+
return runtimeReadinessNamePattern.test(name);
|
|
53
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { type RuntimeIsolationLease } from "../runtime/runtime-isolation-lease.js";
|
|
2
|
+
/** Reads every host runtime lease, or throws if any ledger file can't be trusted. */
|
|
3
|
+
export declare function readHostRuntimeLeases(stateRoot: string): Promise<readonly RuntimeIsolationLease[]>;
|
|
4
|
+
/** Branches that a lease which isn't released yet may still use. */
|
|
5
|
+
export declare function liveLeaseBranches(leases: readonly RuntimeIsolationLease[]): ReadonlySet<string>;
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import { constants as fsConstants } from "node:fs";
|
|
2
|
+
import fs from "node:fs/promises";
|
|
3
|
+
import path from "node:path";
|
|
4
|
+
import { validRuntimeIsolationLease } from "../runtime/runtime-isolation-lease.js";
|
|
5
|
+
// The host runtime ledger (<state root>/runtime-ledger/host/*.json) records every runtime lease this
|
|
6
|
+
// bridge holds. Cleanup reads it to keep live leases' worktrees and branches; any ledger it can't
|
|
7
|
+
// trust stops the cleanup rather than guessing.
|
|
8
|
+
/** Reads every host runtime lease, or throws if any ledger file can't be trusted. */
|
|
9
|
+
export async function readHostRuntimeLeases(stateRoot) {
|
|
10
|
+
const ledgerRoot = path.join(stateRoot, "runtime-ledger", "host");
|
|
11
|
+
const entries = await fs.readdir(ledgerRoot, { withFileTypes: true }).catch(error => {
|
|
12
|
+
if (isEnoent(error))
|
|
13
|
+
return [];
|
|
14
|
+
throw error;
|
|
15
|
+
});
|
|
16
|
+
const leases = [];
|
|
17
|
+
for (const entry of entries) {
|
|
18
|
+
if (!entry.name.endsWith(".json"))
|
|
19
|
+
continue;
|
|
20
|
+
if (!entry.isFile() || entry.isSymbolicLink()) {
|
|
21
|
+
throw new Error(`Refusing managed worktree cleanup because runtime ledger ${entry.name} is not a regular file.`);
|
|
22
|
+
}
|
|
23
|
+
const target = path.join(ledgerRoot, entry.name);
|
|
24
|
+
const value = await readRuntimeLedger(target, entry.name);
|
|
25
|
+
const runtimeLease = isRecord(value) ? value.runtimeLease : null;
|
|
26
|
+
if (!validRuntimeIsolationLease(runtimeLease) || runtimeLease.mode !== "host") {
|
|
27
|
+
throw new Error(`Refusing managed worktree cleanup because runtime ledger ${entry.name} has no trustworthy host lease.`);
|
|
28
|
+
}
|
|
29
|
+
leases.push(runtimeLease);
|
|
30
|
+
}
|
|
31
|
+
return leases;
|
|
32
|
+
}
|
|
33
|
+
async function readRuntimeLedger(target, entryName) {
|
|
34
|
+
const pathStat = await fs.lstat(target).catch(error => {
|
|
35
|
+
if (isEnoent(error))
|
|
36
|
+
return null;
|
|
37
|
+
throw error;
|
|
38
|
+
});
|
|
39
|
+
if (!pathStat) {
|
|
40
|
+
throw new Error(`Refusing managed worktree cleanup because runtime ledger ${entryName} disappeared.`);
|
|
41
|
+
}
|
|
42
|
+
validateRuntimeLedgerStat(entryName, pathStat);
|
|
43
|
+
let handle;
|
|
44
|
+
try {
|
|
45
|
+
handle = await fs.open(target, fsConstants.O_RDONLY | fsConstants.O_NOFOLLOW);
|
|
46
|
+
}
|
|
47
|
+
catch (error) {
|
|
48
|
+
if (isEnoent(error) || errorCode(error) === "ELOOP") {
|
|
49
|
+
throw new Error(`Refusing managed worktree cleanup because runtime ledger ${entryName} is not a regular file.`, { cause: error });
|
|
50
|
+
}
|
|
51
|
+
throw new Error(`Refusing managed worktree cleanup because runtime ledger ${entryName} could not be opened safely.`, { cause: error });
|
|
52
|
+
}
|
|
53
|
+
try {
|
|
54
|
+
const openedStat = await handle.stat();
|
|
55
|
+
const reopenedPathStat = await fs.lstat(target);
|
|
56
|
+
validateRuntimeLedgerStat(entryName, openedStat);
|
|
57
|
+
validateRuntimeLedgerStat(entryName, reopenedPathStat);
|
|
58
|
+
validateSameRuntimeLedgerFile(entryName, pathStat, openedStat);
|
|
59
|
+
validateSameRuntimeLedgerFile(entryName, openedStat, reopenedPathStat);
|
|
60
|
+
const content = await handle.readFile("utf8");
|
|
61
|
+
const afterStat = await handle.stat();
|
|
62
|
+
const afterPathStat = await fs.lstat(target);
|
|
63
|
+
validateRuntimeLedgerStat(entryName, afterStat);
|
|
64
|
+
validateRuntimeLedgerStat(entryName, afterPathStat);
|
|
65
|
+
validateSameRuntimeLedgerFile(entryName, openedStat, afterStat);
|
|
66
|
+
validateSameRuntimeLedgerFile(entryName, afterStat, afterPathStat);
|
|
67
|
+
if (openedStat.size !== afterStat.size || Buffer.byteLength(content, "utf8") !== afterStat.size) {
|
|
68
|
+
throw new Error(`Refusing managed worktree cleanup because runtime ledger ${entryName} changed while being read.`);
|
|
69
|
+
}
|
|
70
|
+
try {
|
|
71
|
+
return JSON.parse(content);
|
|
72
|
+
}
|
|
73
|
+
catch (error) {
|
|
74
|
+
throw new Error(`Refusing managed worktree cleanup because runtime ledger ${entryName} is invalid.`, { cause: error });
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
finally {
|
|
78
|
+
await handle.close();
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
function validateRuntimeLedgerStat(entryName, stat) {
|
|
82
|
+
if (stat.isSymbolicLink() || !stat.isFile()) {
|
|
83
|
+
throw new Error(`Refusing managed worktree cleanup because runtime ledger ${entryName} is not a regular file.`);
|
|
84
|
+
}
|
|
85
|
+
if (stat.size > 256 * 1024) {
|
|
86
|
+
throw new Error(`Refusing managed worktree cleanup because runtime ledger ${entryName} is oversized.`);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
function validateSameRuntimeLedgerFile(entryName, before, after) {
|
|
90
|
+
if (before.dev !== 0 && before.ino !== 0 && after.dev !== 0 && after.ino !== 0
|
|
91
|
+
&& (before.dev !== after.dev || before.ino !== after.ino)) {
|
|
92
|
+
throw new Error(`Refusing managed worktree cleanup because runtime ledger ${entryName} changed while being read.`);
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
function errorCode(error) {
|
|
96
|
+
return typeof error === "object" && error !== null && "code" in error
|
|
97
|
+
? String(error.code)
|
|
98
|
+
: undefined;
|
|
99
|
+
}
|
|
100
|
+
/** Branches that a lease which isn't released yet may still use. */
|
|
101
|
+
export function liveLeaseBranches(leases) {
|
|
102
|
+
return new Set(leases.filter(lease => lease.state !== "released").map(lease => lease.worktreeKey));
|
|
103
|
+
}
|
|
104
|
+
function isEnoent(error) {
|
|
105
|
+
return error?.code === "ENOENT";
|
|
106
|
+
}
|
|
107
|
+
function isRecord(value) {
|
|
108
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
109
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { GitClient } from "../shared/git/git.js";
|
|
2
|
+
/** A readiness probe's branch: scratch that nothing reads once its worktree is gone. */
|
|
3
|
+
export declare function isRuntimeReadinessBranch(branchName: string): boolean;
|
|
4
|
+
/** A branch Forge named for a work item, Feature or Work Order. */
|
|
5
|
+
export declare function isForgeManagedWorkBranch(branchName: string): boolean;
|
|
6
|
+
export interface ManagedBranchSweepOptions {
|
|
7
|
+
/** Branch whose remote-tracking ref (origin/<base>) decides what counts as merged. */
|
|
8
|
+
readonly baseBranch?: string;
|
|
9
|
+
/** Also delete managed work branches whose changes are already on the base. */
|
|
10
|
+
readonly includeMergedWorkBranches: boolean;
|
|
11
|
+
/** Branches to keep whatever their state, e.g. ones a live lease is about to use. */
|
|
12
|
+
readonly protectedBranches?: ReadonlySet<string>;
|
|
13
|
+
/** Upper bound on branches deleted in one sweep, to keep the repository lock short. */
|
|
14
|
+
readonly limit?: number;
|
|
15
|
+
}
|
|
16
|
+
export interface ManagedBranchSweepResult {
|
|
17
|
+
readonly deletedBranches: readonly string[];
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Deletes branches Forge created that no worktree has checked out: every readiness branch, and,
|
|
21
|
+
* when asked, every managed work branch whose changes are already on origin/<base> (as an ancestor,
|
|
22
|
+
* or because merging it into the base would change nothing, as after a squash merge). Branches with work that is not on the base
|
|
23
|
+
* are kept. Must run under the repository coordinator lock, like worktree creation.
|
|
24
|
+
*/
|
|
25
|
+
export declare function sweepManagedBranches(git: GitClient, repoPath: string, options: ManagedBranchSweepOptions): Promise<ManagedBranchSweepResult>;
|
|
26
|
+
/** Deletes one branch unless a worktree still has it checked out. Never throws. */
|
|
27
|
+
export declare function deleteBranchIfUnused(git: GitClient, repoPath: string, branchName: string): Promise<boolean>;
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
// Every environment Forge spawns an agent in gets its own local branch: runtime-readiness-<request
|
|
2
|
+
// UUID> for a readiness probe (session.service.ts), <kind>/<12 hex> for a work item (story/, task/,
|
|
3
|
+
// bug/, and architect/ for its Architect phase), and decompose/<feature|work_order>/<12 hex> for a
|
|
4
|
+
// decompose session (ManagedWorkItemBranchNames on the server). Only those exact shapes count, so a
|
|
5
|
+
// person's branch such as fix/0123456789ab or runtime-readiness-hotfix is never touched. The server
|
|
6
|
+
// removes the ones in its own checkout when a pull request merges; this sweep lets every device
|
|
7
|
+
// remove its own, so nothing piles up wherever a bridge runs.
|
|
8
|
+
const runtimeReadinessBranchPattern = /^runtime-readiness-[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
|
|
9
|
+
const managedWorkBranchPattern = /^(?:(?:story|task|bug|architect)|decompose\/(?:feature|work_order))\/[0-9a-f]{12}$/;
|
|
10
|
+
/** A readiness probe's branch: scratch that nothing reads once its worktree is gone. */
|
|
11
|
+
export function isRuntimeReadinessBranch(branchName) {
|
|
12
|
+
return runtimeReadinessBranchPattern.test(branchName);
|
|
13
|
+
}
|
|
14
|
+
/** A branch Forge named for a work item, Feature or Work Order. */
|
|
15
|
+
export function isForgeManagedWorkBranch(branchName) {
|
|
16
|
+
return managedWorkBranchPattern.test(branchName);
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Deletes branches Forge created that no worktree has checked out: every readiness branch, and,
|
|
20
|
+
* when asked, every managed work branch whose changes are already on origin/<base> (as an ancestor,
|
|
21
|
+
* or because merging it into the base would change nothing, as after a squash merge). Branches with work that is not on the base
|
|
22
|
+
* are kept. Must run under the repository coordinator lock, like worktree creation.
|
|
23
|
+
*/
|
|
24
|
+
export async function sweepManagedBranches(git, repoPath, options) {
|
|
25
|
+
const limit = options.limit ?? Number.POSITIVE_INFINITY;
|
|
26
|
+
const checkedOut = await checkedOutBranches(git, repoPath);
|
|
27
|
+
const baseRef = options.includeMergedWorkBranches && options.baseBranch
|
|
28
|
+
? await existingRef(git, repoPath, `refs/remotes/origin/${options.baseBranch}`)
|
|
29
|
+
: null;
|
|
30
|
+
const branches = (await git.run(repoPath, ["for-each-ref", "--format=%(refname:short)", "refs/heads"]))
|
|
31
|
+
.split("\n")
|
|
32
|
+
.map(line => line.trim())
|
|
33
|
+
.filter(Boolean);
|
|
34
|
+
const deletedBranches = [];
|
|
35
|
+
for (const branch of branches) {
|
|
36
|
+
if (deletedBranches.length >= limit)
|
|
37
|
+
break;
|
|
38
|
+
if (checkedOut.has(branch) || options.protectedBranches?.has(branch))
|
|
39
|
+
continue;
|
|
40
|
+
const readiness = isRuntimeReadinessBranch(branch);
|
|
41
|
+
if (!readiness) {
|
|
42
|
+
if (!baseRef || !isForgeManagedWorkBranch(branch))
|
|
43
|
+
continue;
|
|
44
|
+
if (!(await changesAreOnBase(git, repoPath, branch, baseRef)))
|
|
45
|
+
continue;
|
|
46
|
+
}
|
|
47
|
+
try {
|
|
48
|
+
await git.run(repoPath, ["branch", "-D", "--", branch]);
|
|
49
|
+
deletedBranches.push(branch);
|
|
50
|
+
}
|
|
51
|
+
catch {
|
|
52
|
+
// A branch another process just checked out or removed is not ours to fight over.
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
return { deletedBranches };
|
|
56
|
+
}
|
|
57
|
+
/** Deletes one branch unless a worktree still has it checked out. Never throws. */
|
|
58
|
+
export async function deleteBranchIfUnused(git, repoPath, branchName) {
|
|
59
|
+
try {
|
|
60
|
+
if ((await checkedOutBranches(git, repoPath)).has(branchName))
|
|
61
|
+
return false;
|
|
62
|
+
if (!(await existingRef(git, repoPath, `refs/heads/${branchName}`)))
|
|
63
|
+
return false;
|
|
64
|
+
await git.run(repoPath, ["branch", "-D", "--", branchName]);
|
|
65
|
+
return true;
|
|
66
|
+
}
|
|
67
|
+
catch {
|
|
68
|
+
return false;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
async function checkedOutBranches(git, repoPath) {
|
|
72
|
+
const output = await git.run(repoPath, ["worktree", "list", "--porcelain", "-z"]);
|
|
73
|
+
const branches = new Set();
|
|
74
|
+
for (const field of output.split("\0")) {
|
|
75
|
+
if (field.startsWith("branch refs/heads/"))
|
|
76
|
+
branches.add(field.slice("branch refs/heads/".length).trim());
|
|
77
|
+
}
|
|
78
|
+
return branches;
|
|
79
|
+
}
|
|
80
|
+
async function existingRef(git, repoPath, ref) {
|
|
81
|
+
try {
|
|
82
|
+
await git.run(repoPath, ["rev-parse", "--verify", "--quiet", `${ref}^{commit}`]);
|
|
83
|
+
return ref;
|
|
84
|
+
}
|
|
85
|
+
catch {
|
|
86
|
+
return null;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
// A branch's changes are on the base when it is an ancestor of the base, or when merging it into the
|
|
90
|
+
// base would change nothing: the merge result's tree is the base's own tree. That covers squash
|
|
91
|
+
// merges, and merges followed by unrelated work on the base, without making commits: merge-tree
|
|
92
|
+
// writes only content-addressed trees, so repeated sweeps reuse the same objects. A conflict, an
|
|
93
|
+
// unreadable ref or a git without `merge-tree --write-tree` (before 2.38) keeps the branch.
|
|
94
|
+
async function changesAreOnBase(git, repoPath, branch, baseRef) {
|
|
95
|
+
try {
|
|
96
|
+
await git.run(repoPath, ["merge-base", "--is-ancestor", branch, baseRef]);
|
|
97
|
+
return true;
|
|
98
|
+
}
|
|
99
|
+
catch {
|
|
100
|
+
// Not an ancestor; it may have been squash-merged.
|
|
101
|
+
}
|
|
102
|
+
try {
|
|
103
|
+
const merged = (await git.run(repoPath, ["merge-tree", "--write-tree", "--no-messages", baseRef, branch]))
|
|
104
|
+
.split("\n")[0].trim();
|
|
105
|
+
const baseTree = (await git.run(repoPath, ["rev-parse", `${baseRef}^{tree}`])).trim();
|
|
106
|
+
return merged.length > 0 && merged === baseTree;
|
|
107
|
+
}
|
|
108
|
+
catch {
|
|
109
|
+
return false;
|
|
110
|
+
}
|
|
111
|
+
}
|
package/dist/cli/cli.help.js
CHANGED
|
@@ -21,6 +21,7 @@ export function helpText() {
|
|
|
21
21
|
" remove-repo * Remove a saved repo mapping",
|
|
22
22
|
" cleanup * Prune managed bridge worktrees",
|
|
23
23
|
" sandbox * Initialize, diagnose, smoke-test, or reap Docker sandboxes",
|
|
24
|
+
" yield * Yield this machine to foreground work: no new attempts",
|
|
24
25
|
" version * Print the installed bridge package version",
|
|
25
26
|
" help * Display help for command",
|
|
26
27
|
" run-once * Internal: run one dispatch packet from JSON",
|
|
@@ -28,7 +29,7 @@ export function helpText() {
|
|
|
28
29
|
"",
|
|
29
30
|
"Examples:",
|
|
30
31
|
" npm install -g @loucompanion/forge-bridge@next",
|
|
31
|
-
" forge-bridge pair 1234-5678 --server https://
|
|
32
|
+
" forge-bridge pair 1234-5678 --server https://forge.example.ts.net:8443 --repo-root \"%USERPROFILE%\\ForgeRepos\"",
|
|
32
33
|
" forge-bridge connect",
|
|
33
34
|
" forge-bridge status --check-updates",
|
|
34
35
|
" forge-bridge server set http://localhost:5208",
|
|
@@ -60,7 +61,7 @@ export function commandHelpText(command) {
|
|
|
60
61
|
" --repo-root <path> Folder where bridge-managed repos/worktrees live.",
|
|
61
62
|
" --name <name> Display name for this runner.",
|
|
62
63
|
" --fingerprint <value> Stable device fingerprint override.",
|
|
63
|
-
" --cli-provider <list> Comma-separated providers, e.g. codex,cursor.",
|
|
64
|
+
" --cli-provider <list> Comma-separated providers, e.g. codex,cursor,claude.",
|
|
64
65
|
" --cleanup-worktrees Enable managed worktree cleanup.",
|
|
65
66
|
" --no-cleanup-worktrees Disable managed worktree cleanup.",
|
|
66
67
|
"",
|
|
@@ -81,7 +82,7 @@ export function commandHelpText(command) {
|
|
|
81
82
|
" --runner-id <id> Runner id; saved config is used when omitted.",
|
|
82
83
|
" --device-token <token> Device token; saved config is used when omitted.",
|
|
83
84
|
" --repo-root <path> Override repo/worktree folder for this run.",
|
|
84
|
-
" --cli-provider <list> Comma-separated providers, e.g. codex,cursor.",
|
|
85
|
+
" --cli-provider <list> Comma-separated providers, e.g. codex,cursor,claude.",
|
|
85
86
|
" --heartbeat-interval-ms <n> Heartbeat interval in milliseconds.",
|
|
86
87
|
" --cleanup-worktrees Enable managed worktree cleanup for this run.",
|
|
87
88
|
" --no-cleanup-worktrees Disable managed worktree cleanup for this run.",
|
|
@@ -116,7 +117,7 @@ export function commandHelpText(command) {
|
|
|
116
117
|
"",
|
|
117
118
|
"Examples:",
|
|
118
119
|
" forge-bridge server set http://localhost:5208",
|
|
119
|
-
" forge-bridge server set https://
|
|
120
|
+
" forge-bridge server set https://forge.example.ts.net:8443",
|
|
120
121
|
"",
|
|
121
122
|
].join("\n");
|
|
122
123
|
case "add-repo":
|
|
@@ -179,6 +180,23 @@ export function commandHelpText(command) {
|
|
|
179
180
|
"Stop the connected bridge first so the Docker ownership lock can be acquired.",
|
|
180
181
|
"",
|
|
181
182
|
].join("\n");
|
|
183
|
+
case "yield":
|
|
184
|
+
return [
|
|
185
|
+
"Forge Bridge — yield",
|
|
186
|
+
"Yield this machine to foreground work (for example while you are gaming).",
|
|
187
|
+
"",
|
|
188
|
+
"Usage:",
|
|
189
|
+
" forge-bridge yield on",
|
|
190
|
+
" forge-bridge yield off",
|
|
191
|
+
" forge-bridge yield status",
|
|
192
|
+
"",
|
|
193
|
+
"While yielding, the bridge takes no new attempts; running attempts finish, and",
|
|
194
|
+
"their heavy steps run under the yield CPU budget. A running bridge notices the",
|
|
195
|
+
"change within one heartbeat, without a restart, and reports it to Forge.",
|
|
196
|
+
"The flag is saved in its own file next to bridge.json. Yield is also on when the",
|
|
197
|
+
"runner's Yield toggle in Forge is on: either side turns it on.",
|
|
198
|
+
"",
|
|
199
|
+
].join("\n");
|
|
182
200
|
case "run-once":
|
|
183
201
|
return [
|
|
184
202
|
"Forge Bridge — run-once",
|
|
@@ -1,17 +1,23 @@
|
|
|
1
|
+
import { type DotNetToolchainSelection } from "../shared/process/dotnet-toolchain.js";
|
|
1
2
|
import type { BridgeService } from "../bridge/bridge.base.js";
|
|
2
3
|
import type { BridgeServiceConfig } from "../bridge/bridge.types.js";
|
|
3
4
|
import type { CleanupMode } from "../cleanup/cleanup.types.js";
|
|
4
5
|
import type { CleanupService } from "../cleanup/cleanup.base.js";
|
|
5
6
|
import type { SessionService } from "../session/session.base.js";
|
|
6
7
|
import type { CliIo, CliService } from "./cli.base.js";
|
|
8
|
+
type DotNetToolchainConfigurator = (repoRoots: readonly string[], options?: {
|
|
9
|
+
readonly cloneFolders?: readonly string[];
|
|
10
|
+
}) => Promise<DotNetToolchainSelection | null>;
|
|
7
11
|
export declare class ForgeBridgeCliService implements CliService {
|
|
8
12
|
private readonly sessions;
|
|
9
13
|
private readonly bridgeFactory;
|
|
10
14
|
private readonly pairRunner;
|
|
11
15
|
private readonly cleanupFactory;
|
|
12
|
-
|
|
16
|
+
private readonly dotNetToolchainConfigurator;
|
|
17
|
+
constructor(sessions?: SessionService, bridgeFactory?: (config: BridgeServiceConfig) => BridgeService, pairRunner?: PairRunnerClient, cleanupFactory?: CleanupServiceFactory, dotNetToolchainConfigurator?: DotNetToolchainConfigurator);
|
|
13
18
|
run(argv: readonly string[], io?: CliIo): Promise<number>;
|
|
14
19
|
}
|
|
20
|
+
type YieldAction = "on" | "off" | "status";
|
|
15
21
|
export declare function parseArgs(argv: readonly string[]): {
|
|
16
22
|
readonly ok: true;
|
|
17
23
|
readonly command: "run-once";
|
|
@@ -21,11 +27,7 @@ export declare function parseArgs(argv: readonly string[]): {
|
|
|
21
27
|
readonly ok: true;
|
|
22
28
|
readonly command: "mcp";
|
|
23
29
|
readonly argv: readonly string[];
|
|
24
|
-
} | {
|
|
25
|
-
readonly ok: true;
|
|
26
|
-
readonly command: "connect";
|
|
27
|
-
readonly config: BridgeServiceConfig;
|
|
28
|
-
} | ({
|
|
30
|
+
} | ConnectArgs | ({
|
|
29
31
|
readonly ok: true;
|
|
30
32
|
readonly command: "pair";
|
|
31
33
|
} & PairArgs) | {
|
|
@@ -85,10 +87,20 @@ export declare function parseArgs(argv: readonly string[]): {
|
|
|
85
87
|
} | {
|
|
86
88
|
readonly ok: true;
|
|
87
89
|
readonly command: "sandbox-status";
|
|
90
|
+
} | {
|
|
91
|
+
readonly ok: true;
|
|
92
|
+
readonly command: "yield";
|
|
93
|
+
readonly action: YieldAction;
|
|
88
94
|
} | {
|
|
89
95
|
readonly ok: false;
|
|
90
96
|
readonly error: string;
|
|
91
97
|
};
|
|
98
|
+
interface ConnectArgs {
|
|
99
|
+
readonly ok: true;
|
|
100
|
+
readonly command: "connect";
|
|
101
|
+
readonly config: BridgeServiceConfig;
|
|
102
|
+
readonly implicitCloneDestination: boolean;
|
|
103
|
+
}
|
|
92
104
|
interface PairArgs {
|
|
93
105
|
readonly serverUrl: string;
|
|
94
106
|
readonly code?: string;
|
|
@@ -97,13 +109,25 @@ interface PairArgs {
|
|
|
97
109
|
readonly repoRoot?: string;
|
|
98
110
|
readonly cleanupWorktrees: boolean;
|
|
99
111
|
readonly cliProviders: readonly string[];
|
|
112
|
+
/** True when `--cli-provider` named the providers, which then win over the Connect dialog's choice. */
|
|
113
|
+
readonly cliProvidersFromFlag?: boolean;
|
|
100
114
|
readonly projectLabels: readonly string[];
|
|
101
115
|
}
|
|
116
|
+
/** Decision 0014 §5: what the Connect dialog's pairing intent set for this host, echoed by the claim. */
|
|
117
|
+
export interface PairRunnerHost {
|
|
118
|
+
readonly name?: string;
|
|
119
|
+
readonly repoRoot?: string;
|
|
120
|
+
readonly cliProviders?: readonly string[];
|
|
121
|
+
}
|
|
102
122
|
interface PairRunnerClaim {
|
|
103
123
|
readonly runnerId: string;
|
|
104
124
|
readonly deviceToken: string;
|
|
125
|
+
readonly host?: PairRunnerHost;
|
|
105
126
|
}
|
|
106
127
|
type PairRunnerClient = (args: PairArgs) => Promise<PairRunnerClaim>;
|
|
128
|
+
/** Expands `~` in a repo folder chosen in Forge and rejects one shaped for another OS. */
|
|
129
|
+
export declare function resolveHostRepoRoot(value: string, platform?: NodeJS.Platform, home?: string): string | undefined;
|
|
130
|
+
export declare const claudeDefaultModels: readonly string[];
|
|
107
131
|
export declare function parseCodexModelCatalog(raw: string): string[];
|
|
108
132
|
export declare function parseCursorModelList(raw: string): string[];
|
|
109
133
|
type CleanupServiceFactory = (stateRoot: string) => CleanupService;
|