@snappedly-tools/shipyard 0.7.0-staging.36082887921 → 0.7.0
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 +41 -34
- package/dist/MountConfig-bZoCs4Dd.d.ts +26 -0
- package/dist/SandboxProvider-XJQqEdSf.d.ts +261 -0
- package/dist/{chunk-JI3HDDMS.js → chunk-56TDSWFU.js} +3 -3
- package/dist/{chunk-JI3HDDMS.js.map → chunk-56TDSWFU.js.map} +1 -1
- package/dist/chunk-ACD46ZM4.js +136 -0
- package/dist/chunk-ACD46ZM4.js.map +1 -0
- package/dist/{chunk-L6PX5QTU.js → chunk-FDYOTN55.js} +887 -262
- package/dist/chunk-FDYOTN55.js.map +1 -0
- package/dist/chunk-KMGNFXKN.js +38 -0
- package/dist/chunk-KMGNFXKN.js.map +1 -0
- package/dist/chunk-SOJTAJTF.js +78 -0
- package/dist/chunk-SOJTAJTF.js.map +1 -0
- package/dist/{chunk-44I2BL6E.js → chunk-WAXEMZUV.js} +33 -225
- package/dist/chunk-WAXEMZUV.js.map +1 -0
- package/dist/index.d.ts +97 -117
- package/dist/index.js +344 -322
- package/dist/index.js.map +1 -1
- package/dist/main.js +139 -235
- package/dist/main.js.map +1 -1
- package/dist/sandboxes/docker.d.ts +3 -1
- package/dist/sandboxes/docker.js +4 -2
- package/dist/sandboxes/no-sandbox.d.ts +37 -0
- package/dist/sandboxes/no-sandbox.js +4 -0
- package/dist/sandboxes/no-sandbox.js.map +1 -0
- package/dist/sandboxes/vercel.d.ts +104 -0
- package/dist/sandboxes/vercel.js +166 -0
- package/dist/sandboxes/vercel.js.map +1 -0
- package/dist/templates/blank/main.mts +13 -0
- package/dist/templates/blank/prompt.md +12 -0
- package/dist/templates/blank/template.json +4 -0
- package/dist/templates/parallel-planner/main.mts +9 -67
- package/dist/templates/parallel-planner-with-review/main.mts +12 -70
- package/dist/templates/sequential-reviewer/main.mts +3 -52
- package/dist/templates/simple-loop/main.mts +2 -51
- package/package.json +17 -1
- package/dist/MountConfig-BHnKnA4h.d.ts +0 -145
- package/dist/chunk-44I2BL6E.js.map +0 -1
- package/dist/chunk-L6PX5QTU.js.map +0 -1
- package/dist/templates/parallel-planner/planner-branch.mts +0 -151
- package/dist/templates/parallel-planner-with-review/planner-branch.mts +0 -151
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/sandboxes/copyIntoContainer.ts","../src/DockerLifecycle.ts","../src/RepositoryRunnerLifecycle.ts","../src/sandboxes/docker.ts"],"names":["execFile","promisify","resolve","Effect"],"mappings":";;;;;;;;;;;AAIA,IAAM,IAAA,GAAO,UAAU,QAAQ,CAAA;AAGxB,IAAM,oBAAoB,OAC/B,MAAA,EACA,SAAA,EACA,KAAA,EACA,UACA,WAAA,KACkB;AAClB,EAAA,IAAI;AACF,IAAA,MAAM,KAAK,MAAA,EAAQ;AAAA,MACjB,MAAA;AAAA,MACA,SAAA;AAAA,MACA,OAAA;AAAA,MACA,IAAA;AAAA,MACA,IAAA;AAAA,MACA,KAAA,CAAM,QAAQ,WAAW;AAAA,KAC1B,CAAA;AACD,IAAA,MAAM,IAAA,CAAK,MAAA,EAAQ,CAAC,IAAA,EAAM,QAAA,EAAU,GAAG,SAAS,CAAA,CAAA,EAAI,WAAW,CAAA,CAAE,CAAC,CAAA;AAClE,IAAA,MAAM,KAAK,MAAA,EAAQ;AAAA,MACjB,MAAA;AAAA,MACA,QAAA;AAAA,MACA,KAAA;AAAA,MACA,SAAA;AAAA,MACA,OAAA;AAAA,MACA,KAAA;AAAA,MACA,IAAA;AAAA,MACA,KAAA;AAAA,MACA;AAAA,KACD,CAAA;AAAA,EACH,SAAS,KAAA,EAAO;AACd,IAAA,MAAM,IAAI,KAAA;AAAA,MACR,CAAA,EAAG,MAAM,CAAA,iBAAA,EAAoB,KAAA,YAAiB,QAAQ,KAAA,CAAM,OAAA,GAAU,MAAA,CAAO,KAAK,CAAC,CAAA;AAAA,KACrF;AAAA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A,IACF;AAAA,GACF;AACF,CAAC,CAAA","file":"chunk-WAXEMZUV.js","sourcesContent":["import { execFile } from \"node:child_process\";\nimport { posix } from \"node:path\";\nimport { promisify } from \"node:util\";\n\nconst exec = promisify(execFile);\n\n/** Container cp creates root-owned files; session files may have mode 0600. */\nexport const copyIntoContainer = async (\n engine: \"docker\",\n container: string,\n owner: string,\n hostPath: string,\n sandboxPath: string,\n): Promise<void> => {\n try {\n await exec(engine, [\n \"exec\",\n container,\n \"mkdir\",\n \"-p\",\n \"--\",\n posix.dirname(sandboxPath),\n ]);\n await exec(engine, [\"cp\", hostPath, `${container}:${sandboxPath}`]);\n await exec(engine, [\n \"exec\",\n \"--user\",\n \"0:0\",\n container,\n \"chown\",\n \"-hR\",\n \"--\",\n owner,\n sandboxPath,\n ]);\n } catch (error) {\n throw new Error(\n `${engine} cp (in) failed: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n};\n","import { Effect } from \"effect\";\nimport { execFile } from \"node:child_process\";\nimport { resolve } from \"node:path\";\nimport { DockerError } from \"./errors.js\";\nimport { formatVolumeMount, type SelinuxLabel } from \"./mountUtils.js\";\n\nconst dockerExec = (args: string[]): Effect.Effect<string, DockerError> =>\n Effect.async((resume) => {\n execFile(\n \"docker\",\n args,\n { maxBuffer: 10 * 1024 * 1024 },\n (error, stdout, stderr) => {\n if (error) {\n resume(\n Effect.fail(\n new DockerError({\n message: `docker ${args[0]} failed: ${stderr?.toString() || error.message}`,\n }),\n ),\n );\n } else {\n resume(Effect.succeed(stdout.toString()));\n }\n },\n );\n });\n\n/**\n * Build the shipyard Docker image.\n *\n * When `dockerfile` is provided, uses `docker build -f <dockerfile> <cwd>`\n * so COPY instructions resolve relative to the current working directory.\n * Otherwise, uses `docker build <dockerfileDir>` (the default .shipyard/ directory).\n */\nexport const buildImage = (\n imageName: string,\n dockerfileDir: string,\n options?: {\n readonly dockerfile?: string;\n readonly buildArgs?: Record<string, string>;\n },\n): Effect.Effect<void, DockerError> =>\n Effect.gen(function* () {\n const buildArgFlags = Object.entries(options?.buildArgs ?? {}).flatMap(\n ([k, v]) => [\"--build-arg\", `${k}=${v}`],\n );\n if (options?.dockerfile) {\n yield* dockerExec([\n \"build\",\n \"-t\",\n imageName,\n ...buildArgFlags,\n \"-f\",\n resolve(options.dockerfile),\n process.cwd(),\n ]);\n } else {\n yield* dockerExec([\n \"build\",\n \"-t\",\n imageName,\n ...buildArgFlags,\n resolve(dockerfileDir),\n ]);\n }\n });\n\nexport interface VolumeMount {\n readonly hostPath: string;\n readonly sandboxPath: string;\n readonly readonly?: boolean;\n}\n\nexport interface StartContainerOptions {\n readonly volumeMounts?: readonly VolumeMount[];\n readonly workdir?: string;\n /** Run the container as this uid:gid instead of the Dockerfile's USER. */\n readonly user?: string;\n /** Docker network(s) to attach the container to. Passed as `--network` flags. */\n readonly network?: string | readonly string[];\n /** Supplementary groups to add the container user to. Passed as `--group-add` flags. */\n readonly groups?: readonly (string | number)[];\n /** Host devices to expose to the container. Passed as `--device` flags. */\n readonly devices?: readonly string[];\n /** Limit CPU resources via `--cpus` (e.g. `1.5`). Fractional values allowed. */\n readonly cpus?: number;\n /** Docker labels used to scope repository-runner crash recovery. */\n readonly labels?: Readonly<Record<string, string>>;\n /**\n * SELinux volume label suffix applied to bind mounts (default `\"z\"`).\n *\n * - `\"z\"` — shared label. No-op on non-SELinux systems.\n * - `\"Z\"` — private label; only this container can access the mount.\n * - `false` — disable labeling entirely.\n */\n readonly selinuxLabel?: SelinuxLabel;\n}\n\n/**\n * Start a new container with environment variables injected.\n */\nexport const startContainer = (\n containerName: string,\n imageName: string,\n env: Record<string, string>,\n options?: StartContainerOptions,\n): Effect.Effect<void, DockerError> =>\n Effect.gen(function* () {\n // Check if container already exists\n const existing = yield* dockerExec([\n \"ps\",\n \"-a\",\n \"--filter\",\n `name=^${containerName}$`,\n \"--format\",\n \"{{.Names}}\",\n ]);\n\n if (existing.trim() === containerName) {\n yield* Effect.fail(\n new DockerError({\n message: `Container '${containerName}' already exists. Run cleanup first.`,\n }),\n );\n }\n\n const envFlags = Object.entries(env).flatMap(([k, v]) => [\n \"-e\",\n `${k}=${v}`,\n ]);\n\n const selinuxLabel = options?.selinuxLabel ?? \"z\";\n const volumeFlags = (options?.volumeMounts ?? []).flatMap((mount) => [\n \"-v\",\n formatVolumeMount(mount, selinuxLabel),\n ]);\n\n const workdirFlags = options?.workdir ? [\"-w\", options.workdir] : [];\n const userFlags = options?.user ? [\"--user\", options.user] : [];\n const networks = options?.network\n ? Array.isArray(options.network)\n ? options.network\n : [options.network]\n : [];\n const networkFlags = networks.flatMap((n) => [\"--network\", n]);\n const groupAddFlags = (options?.groups ?? []).flatMap((g) => [\n \"--group-add\",\n String(g),\n ]);\n const deviceFlags = (options?.devices ?? []).flatMap((d) => [\n \"--device\",\n d,\n ]);\n const cpusFlags =\n options?.cpus !== undefined ? [\"--cpus\", String(options.cpus)] : [];\n const labelFlags = Object.entries(options?.labels ?? {}).flatMap(\n ([key, value]) => [\"--label\", `${key}=${value}`],\n );\n\n yield* dockerExec([\n \"run\",\n \"-d\",\n \"--init\",\n \"--name\",\n containerName,\n ...labelFlags,\n ...envFlags,\n ...volumeFlags,\n ...workdirFlags,\n ...userFlags,\n ...networkFlags,\n ...groupAddFlags,\n ...deviceFlags,\n ...cpusFlags,\n imageName,\n ]);\n });\n\n/**\n * Stop and remove a container without removing the image.\n */\nexport const removeContainer = (\n containerName: string,\n): Effect.Effect<void, DockerError> =>\n Effect.gen(function* () {\n // Stop container (ignore errors if already stopped)\n yield* Effect.ignore(dockerExec([\"stop\", containerName]));\n // Remove container (ignore errors if not found)\n yield* Effect.ignore(dockerExec([\"rm\", containerName]));\n });\n\n/**\n * Remove a Docker image.\n */\nexport const removeImage = (\n imageName: string,\n): Effect.Effect<void, DockerError> =>\n Effect.gen(function* () {\n yield* dockerExec([\"rmi\", imageName]);\n });\n","import { execFile } from \"node:child_process\";\nimport { constants } from \"node:fs\";\nimport { access, lstat, mkdir, readFile, realpath, rm } from \"node:fs/promises\";\nimport { join } from \"node:path\";\nimport { promisify } from \"node:util\";\nimport {\n ACTIVATION_LABEL,\n CONFIG_DIR,\n RUNNER_DIR,\n RUNNER_SANDBOX_MASK_DIR,\n} from \"./runtimeNames.js\";\nimport {\n assertProtectedDirectoryIdentities,\n repositoryRunnerEnvironment,\n type ProtectedDirectoryIdentity,\n} from \"./runnerSecurity.js\";\n\nconst execFileAsync = promisify(execFile);\n\nexport const RUNNER_INSTALL_METADATA = \".shipyard-install.json\";\nexport const RUNNER_CONTROLLER_LOCK = \".shipyard-controller.lock\";\nexport const RUNNER_WORK_DIR = \"_work\";\nexport const REPOSITORY_RUNNER_OWNER_LABEL =\n \"com.snappedly.shipyard.repository-runner-owner\";\nexport const REPOSITORY_RUNNER_OWNER_ENV = \"SHIPYARD_RUNNER_OWNER\";\nconst REGISTRATION_FILES = [\n \".credentials\",\n \".credentials_rsaparams\",\n \".runner\",\n] as const;\n\ninterface CommandResult {\n readonly stdout: string;\n readonly stderr: string;\n}\n\ninterface CommandOptions {\n readonly cwd: string;\n readonly env: NodeJS.ProcessEnv;\n}\n\nexport interface RunnerInstallMetadata {\n readonly schemaVersion: 1;\n readonly repository: string;\n readonly repositoryUrl: string;\n readonly name: string;\n readonly label: string;\n readonly version: string;\n}\n\ninterface RunnerControllerLock {\n readonly schemaVersion: 1;\n readonly pid: number;\n readonly repository: string;\n readonly processStartedAt: string;\n}\n\nexport class RunnerLifecycleError extends Error {\n readonly name = \"RunnerLifecycleError\";\n}\n\n/** Internal seams for validating an existing runner installation. */\nexport interface RunnerInstallValidationAdapters {\n readonly environment: () => NodeJS.ProcessEnv;\n readonly exists: (path: string) => Promise<boolean>;\n readonly readText: (path: string) => Promise<string>;\n readonly makeDirectory: (path: string) => Promise<void>;\n readonly inspectDirectory?: (\n path: string,\n ) => Promise<ProtectedDirectoryIdentity>;\n readonly run: (\n command: string,\n args: readonly string[],\n options: CommandOptions,\n ) => Promise<CommandResult>;\n}\n\n/** Internal seams for runner registration, filesystem cleanup, and process control. */\nexport interface RunnerLifecycleAdapters extends RunnerInstallValidationAdapters {\n readonly remove: (path: string) => Promise<void>;\n readonly isProcessRunning: (pid: number) => boolean;\n readonly signalProcess: (pid: number, signal: NodeJS.Signals) => void;\n readonly pause: (milliseconds: number) => Promise<void>;\n readonly processIdentity: (pid: number) => Promise<string | undefined>;\n}\n\nconst defaultAdapters: RunnerLifecycleAdapters = {\n environment: () => process.env,\n exists: async (path) => {\n try {\n await access(path, constants.F_OK);\n return true;\n } catch {\n return false;\n }\n },\n readText: (path) => readFile(path, \"utf8\"),\n makeDirectory: async (path) => {\n await mkdir(path, { recursive: true, mode: 0o700 });\n },\n inspectDirectory: async (path) => {\n const [stat, resolved] = await Promise.all([lstat(path), realpath(path)]);\n return {\n realPath: resolved,\n directory: stat.isDirectory(),\n symbolicLink: stat.isSymbolicLink(),\n };\n },\n remove: (path) => rm(path, { recursive: true, force: true }),\n run: async (command, args, options) => {\n const result = await execFileAsync(command, [...args], {\n cwd: options.cwd,\n env: options.env,\n maxBuffer: 10 * 1024 * 1024,\n });\n return { stdout: result.stdout, stderr: result.stderr };\n },\n processIdentity: async (pid) => {\n try {\n const result = await execFileAsync(\"ps\", [\n \"-p\",\n String(pid),\n \"-o\",\n \"lstart=\",\n ]);\n const identity = result.stdout.trim().replace(/\\s+/g, \" \");\n return identity.length > 0 ? identity : undefined;\n } catch {\n return undefined;\n }\n },\n isProcessRunning: (pid) => {\n try {\n process.kill(pid, 0);\n return true;\n } catch {\n return false;\n }\n },\n signalProcess: (pid, signal) => process.kill(pid, signal),\n pause: (milliseconds) =>\n new Promise((resolve) => setTimeout(resolve, milliseconds)),\n};\n\nconst lockOwnsProcess = async (\n lock: RunnerControllerLock | undefined,\n adapters: Pick<\n RunnerLifecycleAdapters,\n \"isProcessRunning\" | \"processIdentity\"\n >,\n): Promise<boolean> =>\n lock !== undefined &&\n Number.isInteger(lock.pid) &&\n typeof lock.processStartedAt === \"string\" &&\n lock.processStartedAt.length > 0 &&\n adapters.isProcessRunning(lock.pid) &&\n (await adapters.processIdentity(lock.pid)) === lock.processStartedAt;\n\nconst lifecycleFailure = (\n purpose: string,\n error: unknown,\n): RunnerLifecycleError =>\n error instanceof RunnerLifecycleError\n ? error\n : new RunnerLifecycleError(\n `${purpose} failed: ${error instanceof Error ? error.message : String(error)}`,\n );\n\nconst runCommand = async (\n adapters: Pick<RunnerInstallValidationAdapters, \"run\">,\n purpose: string,\n command: string,\n args: readonly string[],\n options: CommandOptions,\n): Promise<CommandResult> => {\n try {\n return await adapters.run(command, args, options);\n } catch (error) {\n throw lifecycleFailure(purpose, error);\n }\n};\n\nconst readJson = async <T>(\n path: string,\n adapters: Pick<RunnerInstallValidationAdapters, \"exists\" | \"readText\">,\n): Promise<T | undefined> => {\n if (!(await adapters.exists(path))) return undefined;\n try {\n return JSON.parse(await adapters.readText(path)) as T;\n } catch (error) {\n throw lifecycleFailure(`Reading repository runner state at ${path}`, error);\n }\n};\n\nconst requireInstallMetadata = async (\n runnerDir: string,\n adapters: Pick<RunnerInstallValidationAdapters, \"exists\" | \"readText\">,\n): Promise<RunnerInstallMetadata> => {\n const metadata = await readJson<RunnerInstallMetadata>(\n join(runnerDir, RUNNER_INSTALL_METADATA),\n adapters,\n );\n if (\n metadata?.schemaVersion !== 1 ||\n typeof metadata.repository !== \"string\" ||\n typeof metadata.repositoryUrl !== \"string\" ||\n typeof metadata.name !== \"string\" ||\n metadata.label !== ACTIVATION_LABEL ||\n typeof metadata.version !== \"string\"\n ) {\n throw new RunnerLifecycleError(\n `The existing directory at ${runnerDir} is not a valid Shipyard repository runner installation. Refusing to replace it.`,\n );\n }\n return metadata;\n};\n\ninterface RemoteRunner {\n readonly name: string;\n readonly status: string;\n readonly labels: ReadonlySet<string>;\n}\n\nconst parseRemoteRunners = (stdout: string): readonly RemoteRunner[] =>\n stdout\n .split(/\\r?\\n/)\n .filter((line) => line.length > 0)\n .map((line) => {\n const [name = \"\", status = \"\", labels = \"\"] = line.split(\"\\t\");\n return {\n name,\n status,\n labels: new Set(labels.split(\",\").filter(Boolean)),\n };\n });\n\nconst listRemoteRunners = async (\n repository: string,\n repoDir: string,\n environment: NodeJS.ProcessEnv,\n adapters: RunnerInstallValidationAdapters,\n): Promise<readonly RemoteRunner[]> => {\n const response = await runCommand(\n adapters,\n \"Checking registered GitHub repository runners\",\n \"gh\",\n [\n \"api\",\n \"--paginate\",\n `repos/${repository}/actions/runners`,\n \"--jq\",\n '.runners[] | [.name, .status, ([.labels[].name] | join(\",\"))] | @tsv',\n ],\n { cwd: repoDir, env: environment },\n );\n return parseRemoteRunners(response.stdout);\n};\n\nexport const validateExistingRepositoryRunner = async (\n options: {\n readonly repoDir: string;\n readonly runnerDir: string;\n readonly maskDir: string;\n readonly repository: string;\n readonly runnerName: string;\n },\n adapters: RunnerInstallValidationAdapters = defaultAdapters,\n): Promise<RunnerInstallMetadata> => {\n if (!(await adapters.exists(options.maskDir))) {\n await adapters.makeDirectory(options.maskDir);\n }\n await assertProtectedDirectoryIdentities(\n options.runnerDir,\n options.maskDir,\n adapters.inspectDirectory,\n ).catch((error) => {\n throw lifecycleFailure(\"Validating protected runner directories\", error);\n });\n const metadata = await requireInstallMetadata(options.runnerDir, adapters);\n if (metadata.repository !== options.repository) {\n throw new RunnerLifecycleError(\n `The existing repository runner belongs to ${metadata.repository}, not ${options.repository}. Refusing to replace it.`,\n );\n }\n if (metadata.name !== options.runnerName) {\n throw new RunnerLifecycleError(\n `The existing installation belongs to runner ${metadata.name}, not ${options.runnerName}. A Mac rename does not rename a registered runner; remove and reinstall it explicitly.`,\n );\n }\n for (const required of [\".credentials\", \"run.sh\"] as const) {\n if (!(await adapters.exists(join(options.runnerDir, required)))) {\n throw new RunnerLifecycleError(\n `The existing repository runner is missing ${required}. Refusing to replace its registration; remove it explicitly first.`,\n );\n }\n }\n\n const remoteRunners = await listRemoteRunners(\n options.repository,\n options.repoDir,\n adapters.environment(),\n adapters,\n );\n const labelled = remoteRunners.filter(({ labels }) =>\n labels.has(ACTIVATION_LABEL),\n );\n if (labelled.length > 1) {\n throw new RunnerLifecycleError(\n `Multiple repository runners carry the ${ACTIVATION_LABEL} label (${labelled.map(({ name }) => name).join(\", \")}). Remove duplicates before continuing.`,\n );\n }\n const matching = remoteRunners.find(({ name }) => name === metadata.name);\n if (!matching) {\n throw new RunnerLifecycleError(\n `Runner ${metadata.name} is installed locally but is no longer registered with GitHub. Run \\`shipyard runner start\\` to repair it, or remove it explicitly.`,\n );\n }\n if (!matching.labels.has(ACTIVATION_LABEL)) {\n throw new RunnerLifecycleError(\n `Registered runner ${metadata.name} does not carry the ${ACTIVATION_LABEL} label. Refusing to replace a customized registration.`,\n );\n }\n\n return metadata;\n};\n\nconst removeRegistrationFiles = async (\n runnerDir: string,\n adapters: RunnerLifecycleAdapters,\n): Promise<void> => {\n for (const name of REGISTRATION_FILES) {\n const path = join(runnerDir, name);\n if (await adapters.exists(path)) await adapters.remove(path);\n }\n};\n\nconst readOneTimeToken = (stdout: string, purpose: string): string => {\n try {\n const parsed = JSON.parse(stdout) as { token?: unknown };\n if (typeof parsed.token !== \"string\" || parsed.token.length === 0) {\n throw new Error(\"response did not contain a token\");\n }\n return parsed.token;\n } catch (error) {\n throw lifecycleFailure(purpose, error);\n }\n};\n\nconst requestRegistrationToken = async (\n repository: string,\n repoDir: string,\n environment: NodeJS.ProcessEnv,\n adapters: RunnerLifecycleAdapters,\n): Promise<string> => {\n await runCommand(\n adapters,\n \"Checking current administrative GitHub authorization\",\n \"gh\",\n [\"auth\", \"status\", \"--hostname\", \"github.com\"],\n { cwd: repoDir, env: environment },\n );\n const response = await runCommand(\n adapters,\n \"Requesting a one-time repository runner registration token\",\n \"gh\",\n [\n \"api\",\n \"--method\",\n \"POST\",\n `repos/${repository}/actions/runners/registration-token`,\n ],\n { cwd: repoDir, env: environment },\n );\n return readOneTimeToken(response.stdout, \"Reading the registration token\");\n};\n\nexport const recoverRepositoryRunner = async (\n options: {\n readonly repoDir: string;\n readonly runnerDir: string;\n readonly maskDir: string;\n readonly metadata: RunnerInstallMetadata;\n readonly runnerEnvironment: NodeJS.ProcessEnv;\n readonly dockerEnvironment?: NodeJS.ProcessEnv;\n },\n adapters: RunnerLifecycleAdapters = defaultAdapters,\n): Promise<{ readonly reRegistered: boolean }> => {\n const lockPath = join(options.runnerDir, RUNNER_CONTROLLER_LOCK);\n const lock = await readJson<RunnerControllerLock>(lockPath, adapters);\n if (await lockOwnsProcess(lock, adapters)) {\n throw new RunnerLifecycleError(\n `The repository runner is already running with process ${lock!.pid}.`,\n );\n }\n if (lock) await adapters.remove(lockPath);\n\n const workDir = join(options.runnerDir, RUNNER_WORK_DIR);\n if (await adapters.exists(workDir)) await adapters.remove(workDir);\n if (await adapters.exists(options.maskDir))\n await adapters.remove(options.maskDir);\n await adapters.makeDirectory(options.maskDir);\n await assertProtectedDirectoryIdentities(\n options.runnerDir,\n options.maskDir,\n adapters.inspectDirectory,\n ).catch((error) => {\n throw lifecycleFailure(\"Validating protected runner directories\", error);\n });\n\n await removeOwnedRepositoryRunnerContainers(\n {\n repoDir: options.repoDir,\n repository: options.metadata.repository,\n environment: options.dockerEnvironment ?? options.runnerEnvironment,\n },\n adapters,\n );\n\n const adminEnvironment = adapters.environment();\n const remoteRunners = await listRemoteRunners(\n options.metadata.repository,\n options.repoDir,\n adminEnvironment,\n adapters,\n );\n const labelled = remoteRunners.filter(({ labels }) =>\n labels.has(ACTIVATION_LABEL),\n );\n if (labelled.length > 1) {\n throw new RunnerLifecycleError(\n `Multiple repository runners carry the ${ACTIVATION_LABEL} label (${labelled.map(({ name }) => name).join(\", \")}). Remove duplicates before continuing.`,\n );\n }\n const matching = remoteRunners.find(\n ({ name }) => name === options.metadata.name,\n );\n if (matching) {\n if (!matching.labels.has(ACTIVATION_LABEL)) {\n throw new RunnerLifecycleError(\n `Registered runner ${matching.name} does not carry the ${ACTIVATION_LABEL} label. Refusing to replace a customized registration.`,\n );\n }\n if (!(await adapters.exists(join(options.runnerDir, \".credentials\")))) {\n throw new RunnerLifecycleError(\n `Registered runner ${matching.name} is missing local credentials. Remove and reinstall it explicitly.`,\n );\n }\n return { reRegistered: false };\n }\n\n const collision = labelled[0];\n if (collision) {\n throw new RunnerLifecycleError(\n `Repository runner ${collision.name} already carries the ${ACTIVATION_LABEL} label. Refusing to create a conflicting registration.`,\n );\n }\n\n const registrationToken = await requestRegistrationToken(\n options.metadata.repository,\n options.repoDir,\n adminEnvironment,\n adapters,\n );\n await removeRegistrationFiles(options.runnerDir, adapters);\n try {\n await adapters.run(\n \"./config.sh\",\n [\n \"--url\",\n options.metadata.repositoryUrl,\n \"--token\",\n registrationToken,\n \"--name\",\n options.metadata.name,\n \"--labels\",\n ACTIVATION_LABEL,\n \"--work\",\n RUNNER_WORK_DIR,\n \"--unattended\",\n ],\n { cwd: options.runnerDir, env: options.runnerEnvironment },\n );\n } catch {\n await removeRegistrationFiles(options.runnerDir, adapters);\n throw new RunnerLifecycleError(\n `Re-registering ${options.metadata.name} failed. Partial local registration files were removed; check GitHub Settings > Actions > Runners for an orphan registration, then retry \\`shipyard runner start\\`. The one-time token was not stored.`,\n );\n }\n return { reRegistered: true };\n};\n\nexport const removeOwnedRepositoryRunnerContainers = async (\n options: {\n readonly repoDir: string;\n readonly repository: string;\n readonly environment: NodeJS.ProcessEnv;\n },\n adapters: Pick<RunnerLifecycleAdapters, \"run\"> = defaultAdapters,\n): Promise<void> => {\n const ownedContainers = await runCommand(\n adapters,\n \"Finding stale repository-runner containers\",\n \"docker\",\n [\n \"ps\",\n \"-aq\",\n \"--filter\",\n `label=${REPOSITORY_RUNNER_OWNER_LABEL}=${options.repository}`,\n ],\n { cwd: options.repoDir, env: options.environment },\n );\n const containerIds = ownedContainers.stdout.split(/\\s+/).filter(Boolean);\n if (containerIds.length === 0) return;\n await runCommand(\n adapters,\n \"Removing stale repository-runner containers\",\n \"docker\",\n [\"rm\", \"-f\", ...containerIds],\n { cwd: options.repoDir, env: options.environment },\n );\n};\n\nconst waitForProcessToStop = async (\n pid: number,\n adapters: RunnerLifecycleAdapters,\n): Promise<void> => {\n adapters.signalProcess(pid, \"SIGTERM\");\n for (let attempt = 0; attempt < 50; attempt += 1) {\n if (!adapters.isProcessRunning(pid)) return;\n await adapters.pause(100);\n }\n throw new RunnerLifecycleError(\n `Repository runner process ${pid} did not stop within 5 seconds. Local runner files were preserved.`,\n );\n};\n\nconst unregisterRepositoryRunner = async (\n metadata: RunnerInstallMetadata,\n repoDir: string,\n runnerDir: string,\n environment: NodeJS.ProcessEnv,\n adapters: RunnerLifecycleAdapters,\n): Promise<void> => {\n await runCommand(\n adapters,\n \"Checking current administrative GitHub authorization\",\n \"gh\",\n [\"auth\", \"status\", \"--hostname\", \"github.com\"],\n { cwd: repoDir, env: environment },\n );\n const response = await runCommand(\n adapters,\n \"Requesting a one-time repository runner removal token\",\n \"gh\",\n [\n \"api\",\n \"--method\",\n \"POST\",\n `repos/${metadata.repository}/actions/runners/remove-token`,\n ],\n { cwd: repoDir, env: environment },\n );\n const token = readOneTimeToken(response.stdout, \"Reading the removal token\");\n try {\n await adapters.run(\n \"./config.sh\",\n [\"remove\", \"--token\", token, \"--unattended\"],\n { cwd: runnerDir, env: repositoryRunnerEnvironment(environment) },\n );\n } catch {\n throw new RunnerLifecycleError(\n `Unregistering ${metadata.name} from GitHub failed. Local runner files were preserved; retry after restoring repository administration access.`,\n );\n }\n};\n\nexport interface RepositoryRunnerRemoveResult {\n readonly removed: true;\n readonly forced: boolean;\n readonly manualCleanup?: string;\n}\n\nexport const removeRepositoryRunner = async (\n options: { readonly repoDir: string; readonly force?: boolean },\n adapters: RunnerLifecycleAdapters = defaultAdapters,\n): Promise<RepositoryRunnerRemoveResult> => {\n const configDir = join(options.repoDir, CONFIG_DIR);\n const runnerDir = join(configDir, RUNNER_DIR);\n const maskDir = join(configDir, RUNNER_SANDBOX_MASK_DIR);\n if (!(await adapters.exists(runnerDir))) {\n throw new RunnerLifecycleError(\n `No repository runner is installed at ${runnerDir}.`,\n );\n }\n let metadata: RunnerInstallMetadata;\n try {\n metadata = await requireInstallMetadata(runnerDir, adapters);\n } catch (error) {\n if (!options.force) throw error;\n await adapters.remove(runnerDir);\n if (await adapters.exists(maskDir)) await adapters.remove(maskDir);\n return {\n removed: true,\n forced: true,\n manualCleanup:\n \"Check GitHub Settings > Actions > Runners and manually remove any orphan repository runner registration.\",\n };\n }\n const lock = await readJson<RunnerControllerLock>(\n join(runnerDir, RUNNER_CONTROLLER_LOCK),\n adapters,\n );\n if (await lockOwnsProcess(lock, adapters)) {\n await waitForProcessToStop(lock!.pid, adapters);\n }\n\n try {\n await unregisterRepositoryRunner(\n metadata,\n options.repoDir,\n runnerDir,\n adapters.environment(),\n adapters,\n );\n } catch (error) {\n if (!options.force) {\n const failure = lifecycleFailure(\"Removing the repository runner\", error);\n throw new RunnerLifecycleError(\n `${failure.message} Local runner files were preserved.`,\n );\n }\n await adapters.remove(runnerDir);\n if (await adapters.exists(maskDir)) await adapters.remove(maskDir);\n return {\n removed: true,\n forced: true,\n manualCleanup: `Remove runner ${metadata.name} from ${metadata.repository} in GitHub Settings > Actions > Runners.`,\n };\n }\n\n if (await adapters.exists(maskDir)) await adapters.remove(maskDir);\n await adapters.remove(runnerDir);\n return { removed: true, forced: false };\n};\n","import { copyIntoContainer } from \"./copyIntoContainer.js\";\n/**\n * Docker sandbox provider — wraps DockerLifecycle into a SandboxProvider.\n *\n * Usage:\n * import { docker } from \"@snappedly-tools/shipyard/sandboxes/docker\";\n * await run({ agent: codex(CODEX_MODELS.routine), sandbox: docker() });\n */\n\nimport {\n execFile,\n execFileSync,\n spawn,\n type StdioOptions,\n} from \"node:child_process\";\nimport { randomUUID } from \"node:crypto\";\nimport { Effect } from \"effect\";\nimport { startContainer, removeContainer } from \"../DockerLifecycle.js\";\nimport {\n createIsolatedSandboxProvider,\n type IsolatedSandboxProvider,\n type IsolatedCreateOptions,\n type IsolatedSandboxHandle,\n type ExecResult,\n type InteractiveExecOptions,\n} from \"../SandboxProvider.js\";\nimport type { MountConfig } from \"../MountConfig.js\";\nimport type { SelinuxLabel } from \"../mountUtils.js\";\nimport {\n defaultImageName,\n resolveUserMounts,\n assertIsolatedWorkspaceMounts,\n processFileMountParents,\n} from \"../mountUtils.js\";\nimport { MAX_TAIL_CHARS } from \"../boundedTail.js\";\nimport { collectProcessOutput } from \"../processOutput.js\";\nimport { registerShutdown } from \"../shutdownRegistry.js\";\nimport {\n REPOSITORY_RUNNER_OWNER_ENV,\n REPOSITORY_RUNNER_OWNER_LABEL,\n} from \"../RepositoryRunnerLifecycle.js\";\n\nexport interface DockerOptions {\n /** Docker image name (default: derived from repo directory name). */\n readonly imageName?: string;\n /**\n * The UID of the `agent` user inside the container image (default: host UID via `process.getuid()`, or 1000).\n *\n * Must match the UID baked into the image at build time. Used as the `--user` flag value\n * and checked against the image's configured UID in the pre-flight diagnostic.\n */\n readonly containerUid?: number;\n /**\n * The GID of the `agent` user inside the container image (default: host GID via `process.getgid()`, or 1000).\n *\n * Must match the GID baked into the image at build time. Used as the `--user` flag value.\n */\n readonly containerGid?: number;\n /**\n * SELinux volume label suffix applied to bind mounts.\n *\n * - `\"z\"` — shared label (default). No-op on non-SELinux systems.\n * - `\"Z\"` — private label; only this container can access the mount.\n * - `false` — disable labeling entirely.\n */\n readonly selinuxLabel?: SelinuxLabel;\n /**\n * Additional host directories to bind-mount into the sandbox.\n *\n * Each entry specifies a `hostPath` (tilde-expanded) and `sandboxPath`.\n * If `hostPath` does not exist, sandbox creation fails with a clear error.\n */\n readonly mounts?: readonly MountConfig[];\n /** Environment variables injected by this provider. Merged at launch time with env resolver and agent provider env. */\n readonly env?: Record<string, string>;\n /**\n * Docker network(s) to attach the container to.\n *\n * - `\"my-network\"` → `--network my-network`\n * - `[\"net1\", \"net2\"]` → `--network net1 --network net2`\n *\n * When omitted, Docker's default bridge network is used.\n */\n readonly network?: string | readonly string[];\n /**\n * Supplementary groups to add the container user to, via `--group-add`.\n *\n * Accepts group names or numeric GIDs:\n *\n * - `[\"docker\"]` → `--group-add docker`\n * - `[999]` → `--group-add 999`\n * - `[\"docker\", 999]` → `--group-add docker --group-add 999`\n *\n * Useful for granting access to a bind-mounted Docker socket (Docker-outside-of-Docker).\n * When omitted, no `--group-add` flags are added.\n */\n readonly groups?: readonly (string | number)[];\n /**\n * Host devices to expose to the container, via `--device`.\n *\n * Each entry is a full device spec in `host[:container[:permissions]]` form:\n *\n * - `[\"/dev/kvm\"]` → `--device /dev/kvm`\n * - `[\"/dev/sda:/dev/xvda:rwm\"]` → `--device /dev/sda:/dev/xvda:rwm`\n * - `[\"/dev/kvm\", \"/dev/fuse\"]` → `--device /dev/kvm --device /dev/fuse`\n *\n * When omitted, no `--device` flags are added.\n */\n readonly devices?: readonly string[];\n /**\n * Maximum number of characters of streamed `exec` output retained per stream\n * (stdout and stderr) when an `onLine` callback is supplied (default: 64KiB).\n *\n * Output is delivered live to `onLine` regardless; this only bounds the tail\n * returned in `ExecResult`, preventing a long-running agent's output from\n * overflowing V8's max string length and crashing the run.\n */\n readonly maxOutputTailChars?: number;\n /**\n * Limit the CPU resources available to the container, via `--cpus`.\n *\n * Maps directly to `docker run --cpus`. Accepts fractional values:\n *\n * - `2` → `--cpus 2` (at most 2 CPUs)\n * - `1.5` → `--cpus 1.5` (at most 1.5 CPUs)\n *\n * When omitted, no `--cpus` flag is added and the container is unconstrained.\n */\n readonly cpus?: number;\n}\n\n/**\n * Create a Docker sandbox provider.\n *\n * The returned provider creates Docker containers with isolated repository and Git storage.\n * Changes are transferred through git bundle and validated sync-out.\n */\nexport const docker = (options?: DockerOptions): IsolatedSandboxProvider => {\n const configuredImageName = options?.imageName;\n const selinuxLabel = options?.selinuxLabel ?? \"z\";\n const maxOutputTailChars = options?.maxOutputTailChars ?? MAX_TAIL_CHARS;\n const sandboxHomedir = \"/home/agent\";\n const userMounts = options?.mounts\n ? resolveUserMounts(options.mounts, sandboxHomedir)\n : [];\n assertIsolatedWorkspaceMounts(userMounts);\n // Validate file mounts and collect parent dirs to create at container start.\n // Throws at construction time if any file mount parent is outside sandboxHomedir.\n const parentDirsToCreate = processFileMountParents(\n userMounts,\n sandboxHomedir,\n );\n\n return createIsolatedSandboxProvider({\n name: \"docker\",\n env: options?.env,\n create: async (\n createOptions: IsolatedCreateOptions,\n ): Promise<IsolatedSandboxHandle> => {\n const containerName = `shipyard-${randomUUID()}`;\n\n const worktreePath = \"/home/agent/workspace\";\n\n // Repository and Git storage are container-owned. Only explicitly\n // configured mounts cross the host boundary.\n const allMounts = userMounts;\n const volumeMounts = allMounts.map((m) => ({\n hostPath: m.hostPath,\n sandboxPath: m.sandboxPath,\n readonly: m.readonly,\n }));\n\n // Resolve image name\n const imageName =\n configuredImageName ??\n defaultImageName(createOptions.hostRepoPath ?? process.cwd());\n\n const containerUid = options?.containerUid ?? process.getuid?.() ?? 1000;\n const containerGid = options?.containerGid ?? process.getgid?.() ?? 1000;\n\n // Pre-flight: verify image exists and UID matches\n await checkImageUid(imageName, containerUid);\n\n // Start container\n await Effect.runPromise(\n startContainer(\n containerName,\n imageName,\n {\n ...createOptions.env,\n HOME: \"/home/agent\",\n },\n {\n volumeMounts,\n workdir: worktreePath,\n user: `${containerUid}:${containerGid}`,\n network: options?.network,\n groups: options?.groups,\n devices: options?.devices,\n cpus: options?.cpus,\n selinuxLabel,\n labels: process.env[REPOSITORY_RUNNER_OWNER_ENV]\n ? {\n [REPOSITORY_RUNNER_OWNER_LABEL]:\n process.env[REPOSITORY_RUNNER_OWNER_ENV],\n }\n : undefined,\n },\n ),\n );\n\n // Create parent directories for file mounts and chown to the container user\n for (const dir of parentDirsToCreate) {\n await new Promise<void>((resolve, reject) => {\n execFile(\n \"docker\",\n [\n \"exec\",\n \"--user\",\n \"0:0\",\n containerName,\n \"sh\",\n \"-c\",\n `mkdir -p \"$1\" && chown \"$2\" \"$1\"`,\n \"sh\",\n dir,\n `${containerUid}:${containerGid}`,\n ],\n (error) => {\n if (error) {\n reject(\n new Error(\n `Failed to create parent directory '${dir}' in container: ${error.message}`,\n ),\n );\n } else {\n resolve();\n }\n },\n );\n });\n }\n\n // Register synchronous container cleanup via the shared shutdown registry\n // so concurrent sandboxes share a single exit/SIGINT/SIGTERM listener\n // instead of tripping Node's MaxListenersExceededWarning.\n const removeContainerSync = () => {\n try {\n execFileSync(\"docker\", [\"rm\", \"-f\", containerName], {\n stdio: \"ignore\",\n });\n } catch {\n /* best-effort */\n }\n };\n const unregisterShutdown = registerShutdown(removeContainerSync);\n\n const handle: IsolatedSandboxHandle = {\n worktreePath,\n\n exec: (\n command: string,\n opts?: {\n onLine?: (line: string) => void;\n cwd?: string;\n sudo?: boolean;\n stdin?: string;\n signal?: AbortSignal;\n maxOutputBytes?: number;\n },\n ): Promise<ExecResult> => {\n const effectiveCommand = opts?.sudo ? `sudo ${command}` : command;\n const args = [\"exec\"];\n if (opts?.stdin !== undefined) args.push(\"-i\");\n if (opts?.cwd) args.push(\"-w\", opts.cwd);\n args.push(containerName, \"sh\", \"-c\", effectiveCommand);\n\n return new Promise((resolve, reject) => {\n const proc = spawn(\"docker\", args, {\n signal: opts?.signal,\n stdio: [\n opts?.stdin !== undefined ? \"pipe\" : \"ignore\",\n \"pipe\",\n \"pipe\",\n ],\n });\n\n if (opts?.stdin !== undefined) {\n proc.stdin!.write(opts.stdin);\n proc.stdin!.end();\n }\n\n proc.on(\"error\", (error) => {\n reject(new Error(`docker exec failed: ${error.message}`));\n });\n\n collectProcessOutput(\n {\n stdout: proc.stdout!,\n stderr: proc.stderr!,\n kill: () => proc.kill(\"SIGKILL\"),\n onClose: (listener) => proc.on(\"close\", listener),\n },\n { ...opts, maxOutputTailChars },\n resolve,\n reject,\n );\n });\n },\n\n interactiveExec: (\n args: string[],\n opts: InteractiveExecOptions,\n ): Promise<{ exitCode: number }> => {\n return new Promise((resolve, reject) => {\n opts.signal?.throwIfAborted();\n const executionId = randomUUID();\n const pidFile = `/tmp/shipyard-interactive-${executionId}.pid`;\n const cancelFile = `/tmp/shipyard-interactive-${executionId}.cancel`;\n const dockerArgs = [\"exec\"];\n // Allocate a pseudo-terminal when stdin looks like a TTY\n if (\n \"isTTY\" in opts.stdin &&\n (opts.stdin as { isTTY?: boolean }).isTTY\n ) {\n dockerArgs.push(\"-it\");\n } else {\n dockerArgs.push(\"-i\");\n }\n if (opts.cwd) dockerArgs.push(\"-w\", opts.cwd);\n dockerArgs.push(\n containerName,\n \"sh\",\n \"-c\",\n 'pid_file=$1; cancel_file=$2; shift 2; command -v setsid >/dev/null 2>&1 && command -v ps >/dev/null 2>&1 && command -v awk >/dev/null 2>&1 || { printf \"%s\\\\n\" \"setsid, ps, and awk are required for cancellable interactive execution\" >&2; exit 127; }; if [ -e \"$cancel_file\" ]; then rm -f \"$pid_file\" \"$cancel_file\"; exit 130; fi; setsid \"$@\" & child=$!; printf \"%s\\\\n\" \"$child\" > \"$pid_file\"; wait \"$child\"; status=$?; rm -f \"$pid_file\" \"$cancel_file\"; exit \"$status\"',\n \"shipyard-interactive\",\n pidFile,\n cancelFile,\n ...args,\n );\n\n const proc = spawn(\"docker\", dockerArgs, {\n stdio: [opts.stdin, opts.stdout, opts.stderr] as StdioOptions,\n });\n\n let settled = false;\n let cancelling = false;\n const finish = (\n result:\n | { readonly exitCode: number }\n | { readonly error: unknown },\n ): void => {\n if (settled) return;\n settled = true;\n opts.signal?.removeEventListener(\"abort\", onAbort);\n if (\"error\" in result) reject(result.error);\n else resolve(result);\n };\n\n const onAbort = (): void => {\n if (cancelling || settled) return;\n cancelling = true;\n const cancellationScript =\n 'touch \"$1\"; attempts=0; while [ ! -s \"$2\" ] && [ \"$attempts\" -lt 50 ]; do sleep 0.1; attempts=$((attempts + 1)); done; if [ -s \"$2\" ]; then pid=$(cat \"$2\"); group_running() { ps -eo pgid=,stat= | awk -v pg=\"$pid\" \\'$1 == pg && $2 !~ /^Z/ { found=1 } END { exit found ? 0 : 1 }\\'; }; kill -TERM \"-$pid\" 2>/dev/null || true; attempts=0; while group_running && [ \"$attempts\" -lt 20 ]; do sleep 0.1; attempts=$((attempts + 1)); done; kill -KILL \"-$pid\" 2>/dev/null || true; attempts=0; while group_running && [ \"$attempts\" -lt 20 ]; do sleep 0.1; attempts=$((attempts + 1)); done; if group_running; then exit 1; fi; rm -f \"$1\" \"$2\"; fi';\n execFile(\n \"docker\",\n [\n \"exec\",\n containerName,\n \"sh\",\n \"-c\",\n cancellationScript,\n \"shipyard-cancel\",\n cancelFile,\n pidFile,\n ],\n { timeout: 7_000 },\n (error) => {\n proc.kill(\"SIGKILL\");\n if (error) {\n finish({\n error: new Error(\n `Failed to terminate interactive process in Docker sandbox: ${error.message}`,\n ),\n });\n return;\n }\n finish({\n error:\n opts.signal?.reason ??\n new Error(\"Interactive execution aborted\"),\n });\n },\n );\n };\n\n opts.signal?.addEventListener(\"abort\", onAbort, { once: true });\n if (opts.signal?.aborted) onAbort();\n\n proc.on(\"error\", (error: Error) => {\n if (!cancelling) {\n finish({\n error: new Error(`docker exec failed: ${error.message}`),\n });\n }\n });\n\n proc.on(\"close\", (code: number | null) => {\n if (cancelling) return;\n execFile(\n \"docker\",\n [\"exec\", containerName, \"rm\", \"-f\", pidFile, cancelFile],\n () => {},\n );\n finish({ exitCode: code ?? 0 });\n });\n });\n },\n\n copyIn: (hostPath, sandboxPath) =>\n copyIntoContainer(\n \"docker\",\n containerName,\n `${containerUid}:${containerGid}`,\n hostPath,\n sandboxPath,\n ),\n\n copyFileOut: (sandboxPath: string, hostPath: string): Promise<void> =>\n new Promise((resolve, reject) => {\n execFile(\n \"docker\",\n [\"cp\", `${containerName}:${sandboxPath}`, hostPath],\n (error) => {\n if (error) {\n reject(new Error(`docker cp (out) failed: ${error.message}`));\n } else {\n resolve();\n }\n },\n );\n }),\n\n close: async (): Promise<void> => {\n unregisterShutdown();\n await Effect.runPromise(removeContainer(containerName));\n },\n };\n\n return handle;\n },\n });\n};\n\n// Re-export for backwards compatibility\nexport { defaultImageName };\n\nconst checkImageUid = (imageName: string, expectedUid: number): Promise<void> =>\n new Promise<void>((resolve, reject) => {\n execFile(\n \"docker\",\n [\"image\", \"inspect\", imageName, \"--format\", \"{{.Config.User}}\"],\n (error, stdout) => {\n if (error) {\n reject(\n new Error(\n `Image '${imageName}' not found locally. Build it first with 'shipyard docker build-image'.`,\n ),\n );\n return;\n }\n const imageUser = (stdout ?? \"\").toString().trim();\n if (!imageUser) {\n // No USER directive in image — skip check\n resolve();\n return;\n }\n const uidPart = imageUser.split(\":\")[0]!;\n const imageUid = parseInt(uidPart, 10);\n if (isNaN(imageUid)) {\n // Non-numeric user (e.g. \"agent\") — can't compare, skip check\n resolve();\n return;\n }\n if (imageUid !== expectedUid) {\n reject(\n new Error(\n `UID mismatch: image '${imageName}' was built with UID ${imageUid}, ` +\n `but the expected UID is ${expectedUid}. ` +\n `Rebuild the image with 'shipyard docker build-image', ` +\n `or pass containerUid: ${imageUid} to docker() to match the image.`,\n ),\n );\n } else {\n resolve();\n }\n },\n );\n });\n"]}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,61 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export { c as
|
|
1
|
+
import { B as BindMountSandboxHandle, S as SandboxProvider, a as BranchStrategy, A as AnySandboxProvider, E as ExecResult, M as MergeToHeadBranchStrategy, b as NamedBranchStrategy } from './SandboxProvider-XJQqEdSf.js';
|
|
2
|
+
export { c as BindMountBranchStrategy, d as BindMountCreateOptions, e as BindMountSandboxProvider, f as BindMountSandboxProviderConfig, H as HeadBranchStrategy, g as InteractiveExecOptions, h as IsolatedBranchStrategy, i as IsolatedCreateOptions, j as IsolatedSandboxHandle, I as IsolatedSandboxProvider, k as IsolatedSandboxProviderConfig, l as NoSandboxBranchStrategy, m as NoSandboxHandle, N as NoSandboxProvider, n as createBindMountSandboxProvider, o as createIsolatedSandboxProvider } from './SandboxProvider-XJQqEdSf.js';
|
|
3
3
|
import { StandardSchemaV1 } from '@standard-schema/spec';
|
|
4
|
+
export { M as MountConfig } from './MountConfig-bZoCs4Dd.js';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Session JSONL transfer primitives.
|
|
8
|
+
*
|
|
9
|
+
* The transfer functions are pure: they take a JSONL string and the source/
|
|
10
|
+
* target cwds, and return the rewritten JSONL string. Call sites do their own
|
|
11
|
+
* file I/O (reading the source, writing the destination). Per ADR 0012, the
|
|
12
|
+
* cwd rewrite is specific to each agent's JSONL format, so each agent owns
|
|
13
|
+
* its own transfer function.
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Result of locating a session on the host by its unique id, independent of any
|
|
18
|
+
* cwd-derived path encoding.
|
|
19
|
+
*/
|
|
20
|
+
interface HostSessionLookup {
|
|
21
|
+
/** Absolute path to the located session file, or `undefined` when no session
|
|
22
|
+
* with this id exists anywhere under the searched root. */
|
|
23
|
+
readonly path: string | undefined;
|
|
24
|
+
/** The host directory that was scanned — surfaced in not-found errors so the
|
|
25
|
+
* user knows where Shipyard looked. */
|
|
26
|
+
readonly searchedRoot: string;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Encode a cwd into the Claude Code `~/.claude/projects/<encoded>/` layout.
|
|
30
|
+
* Replaces path separators with hyphens, matching Claude Code's convention.
|
|
31
|
+
*/
|
|
32
|
+
declare const encodeProjectPath: (cwd: string) => string;
|
|
33
|
+
/** Absolute host path to a Claude session JSONL file. */
|
|
34
|
+
declare const claudeHostSessionPath: (cwd: string, id: string, projectsDir?: string) => string;
|
|
35
|
+
/** Sandbox-side path to a Claude session JSONL file (always POSIX separators). */
|
|
36
|
+
declare const claudeSandboxSessionPath: (cwd: string, id: string, projectsDir: string) => string;
|
|
37
|
+
/**
|
|
38
|
+
* Locate a Claude Code session JSONL on the host by its unique id, scanning each
|
|
39
|
+
* `~/.claude/projects/<encoded-cwd>/` directory rather than reconstructing the
|
|
40
|
+
* cwd encoding. The session id is globally unique, so the first match wins.
|
|
41
|
+
*/
|
|
42
|
+
declare const findClaudeSessionOnHost: (id: string, projectsDir?: string) => Promise<HostSessionLookup>;
|
|
43
|
+
/**
|
|
44
|
+
* Rewrite a Claude Code session JSONL string, replacing `cwd` fields that
|
|
45
|
+
* match `fromCwd` with `toCwd`. Pure function — no file I/O.
|
|
46
|
+
*/
|
|
47
|
+
declare const transferClaudeSession: (jsonl: string, fromCwd: string, toCwd: string) => string;
|
|
48
|
+
/**
|
|
49
|
+
* Locate a Codex session rollout file on the host by its id, reusing the
|
|
50
|
+
* date-nested scan.
|
|
51
|
+
*/
|
|
52
|
+
declare const findCodexSessionOnHost: (id: string, sessionsDir?: string) => Promise<HostSessionLookup>;
|
|
53
|
+
/**
|
|
54
|
+
* Rewrite a Codex session JSONL string, replacing `cwd` fields (both top-level
|
|
55
|
+
* and `session_meta.payload.cwd`) that match `fromCwd` with `toCwd`. Pure
|
|
56
|
+
* function — no file I/O.
|
|
57
|
+
*/
|
|
58
|
+
declare const transferCodexSession: (jsonl: string, fromCwd: string, toCwd: string) => string;
|
|
4
59
|
|
|
5
60
|
/** Reasoning efforts accepted by the Codex CLI. */
|
|
6
61
|
declare const CODEX_REASONING_EFFORTS: readonly ["low", "medium", "high", "xhigh", "max"];
|
|
@@ -74,14 +129,14 @@ interface AgentSessionStorage {
|
|
|
74
129
|
hostCwd: string;
|
|
75
130
|
sandboxCwd: string;
|
|
76
131
|
sessionId: string;
|
|
77
|
-
handle:
|
|
132
|
+
handle: BindMountSandboxHandle;
|
|
78
133
|
}): Promise<void>;
|
|
79
134
|
/** Transfer a session JSONL from the host store into the sandbox. */
|
|
80
135
|
resumeIntoSandbox(args: {
|
|
81
136
|
hostCwd: string;
|
|
82
137
|
sandboxCwd: string;
|
|
83
138
|
sessionId: string;
|
|
84
|
-
handle:
|
|
139
|
+
handle: BindMountSandboxHandle;
|
|
85
140
|
}): Promise<void>;
|
|
86
141
|
/** Read a captured session JSONL from the host store. Returns undefined when absent. */
|
|
87
142
|
readHostSession(cwd: string, sessionId: string): Promise<string | undefined>;
|
|
@@ -89,6 +144,14 @@ interface AgentSessionStorage {
|
|
|
89
144
|
existsOnHost(cwd: string, sessionId: string): Promise<boolean>;
|
|
90
145
|
/** Absolute host path where a session would be stored (for not-found error messages). */
|
|
91
146
|
hostSessionFilePath(cwd: string, sessionId: string): string | undefined;
|
|
147
|
+
/**
|
|
148
|
+
* Locate a session on the host by its unique id, independent of cwd encoding.
|
|
149
|
+
* Used by the no-sandbox resume precheck, where the agent runs on the host and
|
|
150
|
+
* writes the session in place under a cwd-derived directory Shipyard cannot
|
|
151
|
+
* reliably reconstruct. Returns the located path (or `undefined`) plus the
|
|
152
|
+
* directory that was searched (for not-found errors).
|
|
153
|
+
*/
|
|
154
|
+
findByIdOnHost(sessionId: string): Promise<HostSessionLookup>;
|
|
92
155
|
}
|
|
93
156
|
interface AgentProvider {
|
|
94
157
|
readonly name: string;
|
|
@@ -108,8 +171,7 @@ interface AgentProvider {
|
|
|
108
171
|
}
|
|
109
172
|
/** Options for the codex agent provider. */
|
|
110
173
|
interface CodexOptions {
|
|
111
|
-
|
|
112
|
-
readonly effort?: CodexReasoningEffort | null;
|
|
174
|
+
readonly effort?: CodexReasoningEffort;
|
|
113
175
|
/** Environment variables injected by this agent provider. */
|
|
114
176
|
readonly env?: Record<string, string>;
|
|
115
177
|
/** When false, session capture is disabled. Default: true. */
|
|
@@ -134,8 +196,7 @@ declare const codex: (model: string | CodexModelConfig, options?: CodexOptions)
|
|
|
134
196
|
readonly sessionStorage: AgentSessionStorage;
|
|
135
197
|
};
|
|
136
198
|
interface ClaudeCodeOptions {
|
|
137
|
-
|
|
138
|
-
readonly effort?: "low" | "medium" | "high" | "xhigh" | "max" | null;
|
|
199
|
+
readonly effort?: "low" | "medium" | "high" | "xhigh" | "max";
|
|
139
200
|
/** Environment variables injected by this agent provider. */
|
|
140
201
|
readonly env?: Record<string, string>;
|
|
141
202
|
/** When false, session capture is disabled. Default: true. */
|
|
@@ -407,7 +468,7 @@ type LoggingOption =
|
|
|
407
468
|
};
|
|
408
469
|
/** Override default timeouts for built-in lifecycle steps. Unset keys keep their defaults. */
|
|
409
470
|
interface Timeouts {
|
|
410
|
-
/** Timeout (ms) for
|
|
471
|
+
/** Timeout (ms) for the host-side copy of `copyToWorktree` paths into the worktree. Default: 60_000. */
|
|
411
472
|
readonly copyToWorktreeMs?: number;
|
|
412
473
|
/** Timeout (ms) for each in-sandbox git setup command (safe.directory, user.name/email, branch discovery). Default: 10_000. */
|
|
413
474
|
readonly gitSetupMs?: number;
|
|
@@ -466,11 +527,12 @@ interface RunOptions<A extends AgentProvider = AgentProvider> {
|
|
|
466
527
|
readonly completionTimeoutSeconds?: number;
|
|
467
528
|
/** Optional name for the run, shown as a prefix in log output */
|
|
468
529
|
readonly name?: string;
|
|
469
|
-
/** Paths relative to the host repo root to copy into
|
|
530
|
+
/** Paths relative to the host repo root to copy into the worktree before sandbox start. */
|
|
470
531
|
readonly copyToWorktree?: string[];
|
|
471
532
|
/** Tools the provider must enforce for this controlled phase. */
|
|
472
533
|
readonly toolAllowlist?: readonly string[];
|
|
473
|
-
/** Branch strategy
|
|
534
|
+
/** Branch strategy — controls how the agent's changes relate to branches.
|
|
535
|
+
* Defaults to { type: "head" } for bind-mount providers and { type: "merge-to-head" } for isolated providers. */
|
|
474
536
|
readonly branchStrategy?: BranchStrategy;
|
|
475
537
|
/** Resume a prior agent session by ID. The session record must exist on the host. Incompatible with maxIterations > 1. */
|
|
476
538
|
readonly resumeSession?: string;
|
|
@@ -558,19 +620,20 @@ declare function run<A extends AgentProvider>(options: RunOptions<A>): Promise<R
|
|
|
558
620
|
interface InteractiveOptions {
|
|
559
621
|
/** Agent provider to use (e.g. codex(CODEX_MODELS.routine)) */
|
|
560
622
|
readonly agent: AgentProvider;
|
|
561
|
-
/**
|
|
562
|
-
readonly sandbox
|
|
623
|
+
/** Sandbox provider (e.g. docker(), noSandbox()). */
|
|
624
|
+
readonly sandbox?: AnySandboxProvider;
|
|
563
625
|
/** Inline prompt string (mutually exclusive with promptFile). */
|
|
564
626
|
readonly prompt?: string;
|
|
565
627
|
/** Path to a prompt file (mutually exclusive with prompt). */
|
|
566
628
|
readonly promptFile?: string;
|
|
567
629
|
/** Optional name for the interactive session. */
|
|
568
630
|
readonly name?: string;
|
|
569
|
-
/** Branch strategy
|
|
631
|
+
/** Branch strategy — controls how the agent's changes relate to branches.
|
|
632
|
+
* Defaults to { type: "head" } for bind-mount providers and { type: "merge-to-head" } for isolated providers. */
|
|
570
633
|
readonly branchStrategy?: BranchStrategy;
|
|
571
634
|
/** Hooks to run during sandbox lifecycle */
|
|
572
635
|
readonly hooks?: SandboxHooks;
|
|
573
|
-
/** Paths relative to the host repo root to copy into
|
|
636
|
+
/** Paths relative to the host repo root to copy into the worktree before sandbox start. */
|
|
574
637
|
readonly copyToWorktree?: string[];
|
|
575
638
|
/** Key-value map for {{KEY}} placeholder substitution in prompts */
|
|
576
639
|
readonly promptArgs?: PromptArgs;
|
|
@@ -644,7 +707,7 @@ interface CreateSandboxOptions {
|
|
|
644
707
|
readonly cwd?: string;
|
|
645
708
|
/** Lifecycle hooks grouped by execution location (host or sandbox). */
|
|
646
709
|
readonly hooks?: SandboxHooks;
|
|
647
|
-
/** Paths relative to the host repo root to copy into
|
|
710
|
+
/** Paths relative to the host repo root to copy into the worktree at creation time. */
|
|
648
711
|
readonly copyToWorktree?: string[];
|
|
649
712
|
/** Override default timeouts for built-in lifecycle steps. Unset keys keep their defaults. */
|
|
650
713
|
readonly timeouts?: Timeouts;
|
|
@@ -775,7 +838,7 @@ interface Sandbox {
|
|
|
775
838
|
*
|
|
776
839
|
* Returns the full `ExecResult` — non-zero `exitCode` is surfaced, not
|
|
777
840
|
* thrown. Callers that want strict semantics should check `result.exitCode`
|
|
778
|
-
* themselves (matching the contract of `
|
|
841
|
+
* themselves (matching the contract of `BindMountSandboxHandle.exec`).
|
|
779
842
|
*/
|
|
780
843
|
exec(command: string, options?: SandboxExecOptions): Promise<ExecResult>;
|
|
781
844
|
/** Tear down the sandbox and worktree. */
|
|
@@ -800,7 +863,7 @@ interface SandboxExecOptions {
|
|
|
800
863
|
}
|
|
801
864
|
/**
|
|
802
865
|
* Eagerly creates a git worktree on the provided explicit branch and starts
|
|
803
|
-
* a
|
|
866
|
+
* a sandbox with the worktree bind-mounted. Returns a Sandbox handle that
|
|
804
867
|
* can be reused across multiple `run()` calls.
|
|
805
868
|
*/
|
|
806
869
|
declare const createSandbox: (options: CreateSandboxOptions) => Promise<Sandbox>;
|
|
@@ -831,8 +894,8 @@ interface CreateWorktreeOptions {
|
|
|
831
894
|
interface WorktreeInteractiveOptions {
|
|
832
895
|
/** Agent provider to use (e.g. codex(CODEX_MODELS.routine)) */
|
|
833
896
|
readonly agent: AgentProvider;
|
|
834
|
-
/**
|
|
835
|
-
readonly sandbox
|
|
897
|
+
/** Sandbox provider (e.g. docker(), noSandbox()). Defaults to noSandbox(). */
|
|
898
|
+
readonly sandbox?: AnySandboxProvider;
|
|
836
899
|
/** Inline prompt string (mutually exclusive with promptFile). */
|
|
837
900
|
readonly prompt?: string;
|
|
838
901
|
/** Path to a prompt file (mutually exclusive with prompt). */
|
|
@@ -948,60 +1011,6 @@ interface Worktree {
|
|
|
948
1011
|
*/
|
|
949
1012
|
declare const createWorktree: (options: CreateWorktreeOptions) => Promise<Worktree>;
|
|
950
1013
|
|
|
951
|
-
/**
|
|
952
|
-
* Session JSONL transfer primitives.
|
|
953
|
-
*
|
|
954
|
-
* The transfer functions are pure: they take a JSONL string and the source/
|
|
955
|
-
* target cwds, and return the rewritten JSONL string. Call sites do their own
|
|
956
|
-
* file I/O (reading the source, writing the destination). Per ADR 0012, the
|
|
957
|
-
* cwd rewrite is specific to each agent's JSONL format, so each agent owns
|
|
958
|
-
* its own transfer function.
|
|
959
|
-
*/
|
|
960
|
-
|
|
961
|
-
/**
|
|
962
|
-
* Result of locating a session on the host by its unique id, independent of any
|
|
963
|
-
* cwd-derived path encoding.
|
|
964
|
-
*/
|
|
965
|
-
interface HostSessionLookup {
|
|
966
|
-
/** Absolute path to the located session file, or `undefined` when no session
|
|
967
|
-
* with this id exists anywhere under the searched root. */
|
|
968
|
-
readonly path: string | undefined;
|
|
969
|
-
/** The host directory that was scanned — surfaced in not-found errors so the
|
|
970
|
-
* user knows where Shipyard looked. */
|
|
971
|
-
readonly searchedRoot: string;
|
|
972
|
-
}
|
|
973
|
-
/**
|
|
974
|
-
* Encode a cwd into the Claude Code `~/.claude/projects/<encoded>/` layout.
|
|
975
|
-
* Replaces path separators with hyphens, matching Claude Code's convention.
|
|
976
|
-
*/
|
|
977
|
-
declare const encodeProjectPath: (cwd: string) => string;
|
|
978
|
-
/** Absolute host path to a Claude session JSONL file. */
|
|
979
|
-
declare const claudeHostSessionPath: (cwd: string, id: string, projectsDir?: string) => string;
|
|
980
|
-
/** Sandbox-side path to a Claude session JSONL file (always POSIX separators). */
|
|
981
|
-
declare const claudeSandboxSessionPath: (cwd: string, id: string, projectsDir: string) => string;
|
|
982
|
-
/**
|
|
983
|
-
* Locate a Claude Code session JSONL on the host by its unique id, scanning each
|
|
984
|
-
* `~/.claude/projects/<encoded-cwd>/` directory rather than reconstructing the
|
|
985
|
-
* cwd encoding. The session id is globally unique, so the first match wins.
|
|
986
|
-
*/
|
|
987
|
-
declare const findClaudeSessionOnHost: (id: string, projectsDir?: string) => Promise<HostSessionLookup>;
|
|
988
|
-
/**
|
|
989
|
-
* Rewrite a Claude Code session JSONL string, replacing `cwd` fields that
|
|
990
|
-
* match `fromCwd` with `toCwd`. Pure function — no file I/O.
|
|
991
|
-
*/
|
|
992
|
-
declare const transferClaudeSession: (jsonl: string, fromCwd: string, toCwd: string) => string;
|
|
993
|
-
/**
|
|
994
|
-
* Locate a Codex session rollout file on the host by its id, reusing the
|
|
995
|
-
* date-nested scan.
|
|
996
|
-
*/
|
|
997
|
-
declare const findCodexSessionOnHost: (id: string, sessionsDir?: string) => Promise<HostSessionLookup>;
|
|
998
|
-
/**
|
|
999
|
-
* Rewrite a Codex session JSONL string, replacing `cwd` fields (both top-level
|
|
1000
|
-
* and `session_meta.payload.cwd`) that match `fromCwd` with `toCwd`. Pure
|
|
1001
|
-
* function — no file I/O.
|
|
1002
|
-
*/
|
|
1003
|
-
declare const transferCodexSession: (jsonl: string, fromCwd: string, toCwd: string) => string;
|
|
1004
|
-
|
|
1005
1014
|
interface CwdErrorConstructor {
|
|
1006
1015
|
new (args: {
|
|
1007
1016
|
readonly message: string;
|
|
@@ -1028,8 +1037,6 @@ declare const CwdError: CwdErrorConstructor;
|
|
|
1028
1037
|
declare const WORKFLOW_CONTRACT_VERSION: 1;
|
|
1029
1038
|
type WorkItemKind = "planning-spec" | "executable-issue" | "pr-repair";
|
|
1030
1039
|
type RiskLevel = "low" | "medium" | "high" | "critical";
|
|
1031
|
-
type WorkRisk = RiskLevel | "unknown";
|
|
1032
|
-
type WorkScope = "small" | "substantial" | "unknown";
|
|
1033
1040
|
type WorkflowPhase = "triage" | "implementation" | "checking" | "review" | "repair" | "handoff" | "merge" | "release-verification";
|
|
1034
1041
|
type LifecycleState = "queued" | "waiting-info" | "authorized" | "implementing" | "checking" | "reviewing" | "repairing" | "human-review" | "merged" | "release-verifying" | "completed" | "failed" | "blocked" | "cancelled";
|
|
1035
1042
|
type PhaseOutcome = "completed" | "needs-info" | "blocked" | "failed" | "cancelled";
|
|
@@ -1076,8 +1083,7 @@ interface WorkBrief {
|
|
|
1076
1083
|
readonly evidence: readonly string[];
|
|
1077
1084
|
readonly acceptanceCriteria: readonly string[];
|
|
1078
1085
|
readonly exclusions: readonly string[];
|
|
1079
|
-
readonly risk:
|
|
1080
|
-
readonly scope?: WorkScope;
|
|
1086
|
+
readonly risk: RiskLevel;
|
|
1081
1087
|
readonly verification: VerificationPlan;
|
|
1082
1088
|
readonly unresolvedQuestions: readonly string[];
|
|
1083
1089
|
readonly authorization: Authorization;
|
|
@@ -1095,27 +1101,6 @@ interface PhaseBudget {
|
|
|
1095
1101
|
readonly maxAttempts: number;
|
|
1096
1102
|
readonly timeoutSeconds: number;
|
|
1097
1103
|
}
|
|
1098
|
-
type AgentRole = "routine" | "strong";
|
|
1099
|
-
interface AgentModelRoles {
|
|
1100
|
-
readonly routine: string;
|
|
1101
|
-
readonly strong: string;
|
|
1102
|
-
}
|
|
1103
|
-
type WorkerPolicy = {
|
|
1104
|
-
readonly provider: string;
|
|
1105
|
-
readonly sandbox: string;
|
|
1106
|
-
readonly skillRevision: string;
|
|
1107
|
-
} & ({
|
|
1108
|
-
readonly model: string;
|
|
1109
|
-
readonly models?: never;
|
|
1110
|
-
} | {
|
|
1111
|
-
readonly model?: never;
|
|
1112
|
-
readonly models: AgentModelRoles;
|
|
1113
|
-
});
|
|
1114
|
-
interface AgentSelection {
|
|
1115
|
-
readonly provider: string;
|
|
1116
|
-
readonly model: string;
|
|
1117
|
-
readonly role: AgentRole;
|
|
1118
|
-
}
|
|
1119
1104
|
interface RepositoryPolicy {
|
|
1120
1105
|
readonly contractVersion: typeof WORKFLOW_CONTRACT_VERSION;
|
|
1121
1106
|
readonly repository: string;
|
|
@@ -1127,7 +1112,12 @@ interface RepositoryPolicy {
|
|
|
1127
1112
|
readonly allowedActors: readonly ("maintainer" | "owner" | "policy")[];
|
|
1128
1113
|
readonly autoStartRisk: readonly RiskLevel[];
|
|
1129
1114
|
};
|
|
1130
|
-
readonly worker:
|
|
1115
|
+
readonly worker: {
|
|
1116
|
+
readonly provider: string;
|
|
1117
|
+
readonly model: string;
|
|
1118
|
+
readonly sandbox: string;
|
|
1119
|
+
readonly skillRevision: string;
|
|
1120
|
+
};
|
|
1131
1121
|
readonly checks: readonly CheckCommand[];
|
|
1132
1122
|
readonly phaseBudgets: Readonly<Record<WorkflowPhase, PhaseBudget>>;
|
|
1133
1123
|
readonly repairBudget: {
|
|
@@ -1202,8 +1192,6 @@ interface Assignment {
|
|
|
1202
1192
|
readonly briefHash: string;
|
|
1203
1193
|
readonly policyRevision: string;
|
|
1204
1194
|
readonly skillRevision: string;
|
|
1205
|
-
/** Missing only on assignments persisted before role model selection shipped. */
|
|
1206
|
-
readonly agentSelection?: AgentSelection;
|
|
1207
1195
|
readonly base: RevisionReference;
|
|
1208
1196
|
readonly head?: RevisionReference;
|
|
1209
1197
|
readonly createdAt: string;
|
|
@@ -1240,7 +1228,6 @@ declare const parseWorkBrief: (value: unknown) => WorkBrief;
|
|
|
1240
1228
|
type CreateRepositoryPolicyInput = Omit<RepositoryPolicy, "contractVersion">;
|
|
1241
1229
|
declare const parseRepositoryPolicy: (value: unknown) => RepositoryPolicy;
|
|
1242
1230
|
declare const createRepositoryPolicy: (input: CreateRepositoryPolicyInput) => RepositoryPolicy;
|
|
1243
|
-
declare const resolveAgentSelection: (policy: Pick<RepositoryPolicy, "worker">, phase: WorkflowPhase, risk?: WorkRisk, scope?: WorkScope) => AgentSelection;
|
|
1244
1231
|
declare const parseCheckEvidence: (value: unknown) => CheckEvidence;
|
|
1245
1232
|
declare const requireTransition: (from: LifecycleState, to: LifecycleState, context: TransitionContext) => void;
|
|
1246
1233
|
interface CreateAssignmentInput {
|
|
@@ -1633,7 +1620,6 @@ interface PhaseCheckout {
|
|
|
1633
1620
|
}
|
|
1634
1621
|
interface PhaseEngineRequest {
|
|
1635
1622
|
readonly assignment: Assignment;
|
|
1636
|
-
readonly agentSelection: AgentSelection;
|
|
1637
1623
|
readonly trusted: TrustedPhaseInputs;
|
|
1638
1624
|
readonly untrusted: UntrustedPhaseInputs;
|
|
1639
1625
|
readonly controls: PhaseControls;
|
|
@@ -1717,28 +1703,21 @@ interface ExecutePhaseOptions {
|
|
|
1717
1703
|
readonly signal?: AbortSignal;
|
|
1718
1704
|
}
|
|
1719
1705
|
declare const executePhase: (options: ExecutePhaseOptions) => Promise<PhaseExecutionResult>;
|
|
1720
|
-
|
|
1721
|
-
/** Pre-resolved provider for legacy single-model policies. */
|
|
1706
|
+
interface RunPhaseEngineAdapterOptions {
|
|
1722
1707
|
readonly agent: AgentProvider;
|
|
1723
|
-
readonly resolveAgent?: never;
|
|
1724
|
-
} | {
|
|
1725
|
-
readonly agent?: never;
|
|
1726
|
-
/** Creates the provider selected by the assignment's trusted policy. */
|
|
1727
|
-
readonly resolveAgent: (selection: AgentSelection) => AgentProvider;
|
|
1728
|
-
};
|
|
1729
|
-
type RunPhaseEngineAdapterOptions = PhaseAgentResolver & {
|
|
1730
1708
|
readonly sandbox: SandboxProvider;
|
|
1731
1709
|
readonly cwd?: string;
|
|
1732
1710
|
readonly run: (options: RunOptions) => Promise<RunResult & {
|
|
1733
1711
|
output?: unknown;
|
|
1734
1712
|
}>;
|
|
1735
|
-
}
|
|
1713
|
+
}
|
|
1736
1714
|
declare const createRunPhaseEngineAdapter: (options: RunPhaseEngineAdapterOptions) => PhaseEngineAdapter;
|
|
1737
|
-
|
|
1715
|
+
interface CreateSandboxPhaseEngineAdapterOptions {
|
|
1716
|
+
readonly agent: AgentProvider;
|
|
1738
1717
|
readonly sandbox: SandboxProvider;
|
|
1739
1718
|
readonly cwd?: string;
|
|
1740
1719
|
readonly createSandbox: (options: CreateSandboxOptions) => Promise<Sandbox>;
|
|
1741
|
-
}
|
|
1720
|
+
}
|
|
1742
1721
|
declare const createCreateSandboxPhaseEngineAdapter: (options: CreateSandboxPhaseEngineAdapterOptions) => PhaseEngineAdapter;
|
|
1743
1722
|
|
|
1744
1723
|
interface HandoffCandidate {
|
|
@@ -2384,6 +2363,7 @@ declare class GitHubIntegration {
|
|
|
2384
2363
|
normalize(envelope: GitHubWebhookEnvelope): Promise<GitHubNormalizationResult>;
|
|
2385
2364
|
reconcile(input: GitHubReconciliationInput): Promise<GitHubReconciliationResult>;
|
|
2386
2365
|
private processEnvelope;
|
|
2366
|
+
private recordRejected;
|
|
2387
2367
|
private rejectStored;
|
|
2388
2368
|
private ignoreStored;
|
|
2389
2369
|
private briefForIssue;
|
|
@@ -2820,4 +2800,4 @@ declare class ReleaseIntegration {
|
|
|
2820
2800
|
}
|
|
2821
2801
|
declare const candidateMatchesApproval: (candidate: ReleaseCandidate, approval: ProductionApproval) => boolean;
|
|
2822
2802
|
|
|
2823
|
-
export { type AcquireBranchLeaseInput, type AgentCommandOptions, type
|
|
2803
|
+
export { type AcquireBranchLeaseInput, type AgentCommandOptions, type AgentProvider, type AgentStreamEvent, AnySandboxProvider, type ArtifactStore, type Assignment, type Authorization, type AuthorizedImplementationOptions, type AuthorizedImplementationResult, BindMountSandboxHandle, type BoundedRepairExecutionResult, type BranchLease, type BranchProtectionState, BranchStrategy, CODEX_MODELS, CODEX_REASONING_EFFORTS, type CheckCommand, type CheckEvidence, type CheckStatus, type ClarificationReply, type ClaudeCodeOptions, type CloseResult, type CloseSourceIssueOptions, type CodexModelConfig, type CodexOptions, type CodexReasoningEffort, type CompletionInput, type CompletionResult, ContractValidationError, type CoordinatorClock, type CoordinatorStorage, type CoordinatorStorageTransaction, type CostMeasurement, type CreateAssignmentInput, type CreateRepositoryPolicyInput, type CreateSandboxOptions, type CreateSandboxPhaseEngineAdapterOptions, type CreateWorkBriefInput, type CreateWorktreeOptions, CredentialNotAllowedError, type CredentialResolver, CredentialUnavailableError, type CurrentCandidate, type CurrentImplementationCandidate, type CurrentRepairCandidate, CwdError, type DispatchBlockReason, type DispatchIntent, type DispatchRequest, type DispatchResult, type DispatchStatus, type EffectExecution, type EffectIntent, type EffectOperationContext, type EffectStatus, type EventIgnoreReason, type EventStatus, ExecResult, type ExecutePhaseOptions, type FakePhaseEngineAdapterOptions, type Finding, type FindingDisposition, type FindingSeverity, type GitHubActor, type GitHubActorType, type GitHubAuthorizationPolicy, type GitHubBranchPublicationInput, type GitHubBranchSnapshot, type GitHubBriefDefaults, type GitHubBriefFactory, type GitHubBriefFactoryInput, type GitHubBriefPublicationInput, type GitHubCheckPublicationInput, type GitHubCheckSnapshot, type GitHubCommentPublicationInput, type GitHubCommentSnapshot, type GitHubDeliveryRecord, type GitHubDeliveryStatus, type GitHubDeliveryStore, type GitHubEventIgnoreReason, type GitHubEventName, type GitHubIgnoredEvent, GitHubIntegration, type GitHubIntegrationOptions, type GitHubIssueEventKind, type GitHubIssueSnapshot, type GitHubNormalizationResult, type GitHubNormalizedEvent, type GitHubNormalizedEventKind, GitHubPublication, type GitHubPublicationOptions, type GitHubPublicationResult, type GitHubPullRequestPublicationInput, type GitHubPullRequestReviewHandler, type GitHubPullRequestReviewSnapshot, type GitHubPullRequestReviewState, type GitHubPullRequestSnapshot, type GitHubReadTransport, type GitHubReconciliationInput, type GitHubReconciliationResult, type GitHubRepairIssuePublicationInput, type GitHubRepairLinkPublicationInput, type GitHubTrackedPullRequest, type GitHubTrackedPullRequestEventKind, type GitHubTrackingStore, type GitHubWebhookEnvelope, type GitHubWebhookReceipt, type GitHubWebhookRequest, type GitHubWebhookSignatureInput, type GitHubWriteTransport, type HandoffCandidate, type HandoffOutcome, type HandoffPacket, type HandoffReadinessInput, type HandoffReadinessResult, type HostSessionLookup, type HumanApproval, type HumanHandoffPublisher, type HumanReviewDecision, type HumanReviewDecisionInput, type HumanReviewRoundTripOptions, type HumanReviewRoundTripResult, type ImplementationExecutionTemplate, type ImplementationOutcome, type ImplementationPublication, type InMemoryArtifactStore, InMemoryCoordinatorStorage, InMemoryGitHubStore, InMemoryReleaseStore, InMemoryRepairBatchStore, InMemoryTriageStore, type IndependentReviewOptions, type IndependentReviewResult, type InfrastructureFailureInput, type InfrastructureRetryResult, type IngestResult, type InteractiveOptions, type InteractiveResult, type IterationResult, type IterationUsage, type JobControl, LeaseBusyError, LeaseLostError, type LifecycleState, type LoggingOption, type MergeCandidateOptions, type MergeResult, MergeToHeadBranchStrategy, type MergeTransport, NamedBranchStrategy, type OperatorCheckStatus, type OperatorIntervention, type OperatorStatus, type OperatorStatusOptions, Output, type OutputDefinition, type OutputObjectDefinition, type OutputStringDefinition, type PhaseArtifact, type PhaseBudget, type PhaseCheckout, type PhaseControls, type PhaseCredentials, type PhaseEngineAdapter, type PhaseEngineRequest, type PhaseEngineResponse, type PhaseExecutionResult, type PhaseExecutionStatus, type PhaseFailure, type PhaseOutcome, type PhaseReport, type PhaseResult, type PhaseResultSubmission, type PostgresConnection, PostgresCoordinatorStorage, type PostgresCoordinatorStorageOptions, type PostgresQueryClient, type PostgresQueryResult, type PrepareHandoffOptions, type PrintCommand, type ProductionApproval, type PromptArgs, type PublishEffectInput, type RecoveryRecord, type ReleaseActor, type ReleaseCandidate, type ReleaseCheck, type ReleaseCheckStatus, type ReleaseEnvironment, ReleaseIntegration, type ReleaseIntegrationOptions, type ReleaseOperationResult, type ReleasePolicy, type ReleaseState, type ReleaseStateStatus, type ReleaseStore, type ReleaseTransport, type ReleaseVerification, type RepairBatch, type RepairBatchResult, type RepairBatchStore, type RepairBudgetUsage, type RepairCandidate, type RepairExecutionTemplate, type RepairRequestResult, type RepairScheduleOutcome, type RepositoryControl, type RepositoryPolicy, type ResumeSandboxRunResultOptions, type ReviewAxis, type ReviewCandidate, type ReviewCheckout, type ReviewEvidence, type ReviewFailure, type ReviewFindingInput, type ReviewProvider, type ReviewRequest, type ReviewResponse, type ReviewRunOutcome, type ReviewSchedulingInput, type ReviewSchedulingResult, type RevisionReference, type RiskLevel, type RunBoundedRepairOptions, type RunOptions, type RunPhaseEngineAdapterOptions, type RunResult, type RunTriageOptions, type Sandbox, type SandboxExecOptions, type SandboxHooks, type SandboxInteractiveOptions, type SandboxInteractiveResult, SandboxProvider, type SandboxRunOptions, type SandboxRunResult, type SchedulePhaseInput, type SchedulePhaseResult, type ScheduleRepairInput, type ScheduleRepairOptions, type SourceIssueCloser, type SourceIssueClosureResult, type SourceReference, type StoredEvent, StructuredOutputError, type SubmitPhaseResultInput, type Timeouts, type TransitionContext, type TriageAssessment, type TriageCategory, type TriageInvestigationRequest, type TriageInvestigator, type TriageOutcome, type TriageRecord, type TriageResult, type TriageSource, type TriageStore, type TrustedPhaseInputs, type UntrustedPhaseInputs, type VerificationPlan, WORKFLOW_CONTRACT_VERSION, type WorkBrief, type WorkIdentity, type WorkItemKind, type WorkKey, WorkflowCoordinator, type WorkflowCoordinatorOptions, type WorkflowEventInput, type WorkflowJob, WorkflowOperator, type WorkflowOperatorOptions, type WorkflowPhase, type Worktree, type WorktreeBranchStrategy, type WorktreeCreateSandboxOptions, type WorktreeInteractiveOptions, type WorktreeRunOptions, type WorktreeRunResult, candidateMatchesApproval, claudeCode, claudeHostSessionPath, claudeSandboxSessionPath, closeSourceIssue, codex, completeSourceIssue, createAssignment, createCreateSandboxPhaseEngineAdapter, createFakePhaseEngineAdapter, createGitHubIssueBrief, createInMemoryArtifactStore, createRepositoryPolicy, createRunPhaseEngineAdapter, createSandbox, createWorkBrief, createWorktree, defaultInvestigator as defaultTriageInvestigator, encodeProjectPath, evaluateHandoffReadiness, executePhase, findClaudeSessionOnHost, findCodexSessionOnHost, interactive, isAuthorizationAllowed, mergeProtectedCandidate, parseCheckEvidence, parsePhaseResult, parseRepositoryPolicy, parseWorkBrief, prepareHumanHandoff, prepareIndependentReview, processHumanReviewDecision, redact as redactOperatorText, releaseCandidateKey, requireTransition, resolveHumanReviewDecision, reviewDecisionFor, run, runAuthorizedImplementation, runBoundedRepair, runIndependentReview, runTriage, scheduleBoundedRepair, transferClaudeSession, transferCodexSession, verifyGitHubWebhookSignature };
|