import { type Context } from '@deepseek-ai/cordis'; import type { ExecutionSessionRef } from '@mstar-harness/engine'; import type { CommandEnvelope } from '@mstar-harness/commands'; /** The tool name for one command id — the same mapping the MCP route uses. */ export declare function nativeCommandToolName(commandId: string): string; /** * The stage of the POST-COMMIT adoption that refused. Both run only after the * shared `plan.bind` returned `ok`, so the engine seat is bound either way — * but the two failures have DIFFERENT recoveries and must never be conflated: * a refused resume rejects the very reference the resume re-bind would carry, * while a refused slot write leaves a resumable seat behind. */ export type AdoptionFailureStage = 'resume' | 'durable-slot'; /** * The recovery of a POST-COMMIT adoption refusal, selected by the stage that * failed. Pure and exported for the stage regression: the two arms must not * advertise the same route. * * - `resume`: the engine refused its own minted reference (or the resumed * reference did not match the caller). Re-running the same resume re-bind * presents exactly that refused value, so it loops — the engine's own * coordinator recovery (`mstar session recover`, which replaces a recorded * stopped/stale holder after operator attestation) is the way out. * - `durable-slot`: the engine resume succeeded and only the dsh slot write * failed, so the resume re-bind re-adopts. When the store reported * `cwd-mismatch`, the recovery names the RECORDED workspace (the durable key * is the session id AND the workspace), as carried in `data.recordedCwd`. */ export declare function adoptionRecoveryText(stage: AdoptionFailureStage, causeCode: string, recordedCwd?: string): string; /** * The facts a PRE-SLOT post-commit refusal answers with: each arm is reached * only after the engine bind committed and before the durable slot write, so * every arm leaves the seat BOUND and must carry the facts its own recovery * names. */ export type PostCommitAdoptionFailure = { kind: 'receipt-unrecognizable'; sessionId: string; workflowId?: string; } | { kind: 'no-harness'; ref: ExecutionSessionRef; } | { kind: 'foreign-reference'; ref: ExecutionSessionRef; sessionId: string; }; /** * The three refusals of a committed bind that never reached the durable slot * write. Pure and exported for the refusal regression: a real engine mints a * readable reference naming the carrying session, so no fixture can produce * these arms — the selection itself is what the contract is pinned on. */ export declare function postCommitAdoptionRefusal(failure: PostCommitAdoptionFailure): CommandEnvelope; /** * Register the native tool surface. The registrations are deferred with * `ctx.inject(['tools'], …)` (the optional-unit pattern, as in every tool * module) and each registration's disposer is returned as the inject teardown, * so an HMR reload of the plugin fiber unregisters the tools cleanly (a * post-dispose lookup finds none). * * The surface is exactly three tools (see the module header for the rule): * `mstar_plan_bind` (the durable-slot producer), `mstar_audit_validate` (no MCP * twin) and `mstar_execution_clear` (no shared command). * @param ctx - registrant context carrying the tool registry. * @param resolver - the per-workspace `{HARNESS_DIR}` resolver (the control * root resolves per the calling session's workspace — never the process cwd). */ export declare function registerNativeCommandTools(ctx: Context, resolver: { forAgent(agent: unknown): string | null; }): void;