/** * Gateway wiring for `senpi update`. * * `senpi.update` is **internal transport** between the CLI verb and the plugin, deliberately absent * from the cheatsheet, the README's agent-facing sections and the skills — the same treatment * `senpi.deploy.*` gets, and for the same reason: one teaching surface wins routing, and naming the * RPC too would invite raw calls that bypass the CLI-side validation. * * Named `senpi.update` rather than `senpi.update.start`: `.start` belongs to a verb with a matching * `.status`, because deploy has to detach around multi-minute wallet funding. An update moves no * money and has nothing to wait on, so it answers in one call. * * The module owns no logic beyond adapting a gateway context into the handler's dependencies, so * everything worth testing lives in `update-handler.ts` and tests never drive a gateway. */ import type { RuntimeConfig } from "./runtime-schema.js"; import { type RecipeSource, type UpdateHandlerDeps } from "./update-handler.js"; /** * The plugin surface this needs. Explicit, so the module never reaches into the boot closure. * * Extends {@link UpdateHandlerDeps} rather than restating it. Restating it is what let the two * drift: a gateway context that still declared the old one-argument `verifyProof` type-checked * against a handler that had grown a second parameter, so the stricter check silently went unused * on the only path a user can actually reach. */ export interface UpdateGatewayContext extends UpdateHandlerDeps { /** * Swap a running runtime onto the new recipe, and record it. * * Optional: a gateway with no live runtimes to mutate (or a deployment that has not enabled the * apply) simply omits them, and `dryRun: false` is refused as unsupported rather than silently * planning. Present together or not at all — recording without swapping, or the reverse, is not a * coherent half-state to offer. */ applyToRuntime?(runtimeId: string, next: RuntimeConfig, recipe: RecipeSource): Promise; writeRegistry?(runtimeId: string, recipe: RecipeSource): Promise; /** * Called once an apply has FULLY succeeded — swapped and recorded. * * Deliberately not called for a swap whose registry write failed: that outcome is reported as a * failure, and an audit trail saying a strategy was updated when a restart would revert it is * worse than no entry at all. Telemetry only; it must never fail the apply, so the implementation * is expected to guard itself. */ onApplied?(info: { runtimeId: string; address?: string; recipe: RecipeSource; previousRecipe: RecipeSource; exitPresetChanged: boolean; openPositions: number; slots?: number; }): void; } interface GatewayApi { registerGatewayMethod(name: string, handler: (ctx: { params?: Record; respond: (ok: boolean, payload?: unknown, error?: unknown) => void; }) => Promise, opts?: { scope?: string; }): void; } export declare function registerUpdateGatewayMethod(api: GatewayApi, ctxDeps: UpdateGatewayContext): void; export {}; //# sourceMappingURL=update-register.d.ts.map