import type { Release } from "@cloudhal/core-contracts"; import type { SiteGraphStore } from "@cloudhal/core-ts"; import { type ReleaseRightsSource } from "@cloudhal/mcp-server/schedules"; import { type ToolContext, ToolError } from "@cloudhal/mcp-server/tools"; import type { ApprovalVerdict } from "@cloudhal/schedules"; import type { SqlDriver } from "@cloudhal/storage"; import type { Context } from "hono"; import type { AgentKeyService, StaffService } from "./auth.js"; import type { Env } from "./context.js"; /** The deployment's schedules, or 404 when it has none. */ export declare function schedulesOf(c: Context): import("@cloudhal/mcp-server/schedules").SchedulesDeps; /** A tool error as the REST answer (`error` is the code; `state_changed` and the like keep theirs). */ export declare function toolErrorResponse(e: ToolError): never; /** * Runs a schedule tool's handler for the signed-in person (§13: people use REST, agents MCP): * the policy decides the own limit as for MCP, the person counts as having confirmed (they act in * their own Studio), and the call is audited under `event`. */ export declare function runAsPerson(c: Context, name: string, args: Record, event: string, extra?: Partial): Promise>; /** Audits a person's schedule action that does not run a tool (settings, automations, publish now). */ export declare function auditPerson(c: Context, event: string, input: Record, ids?: { siteId?: string; releaseId?: string; automationId?: string; runId?: string; }, reason?: string): Promise; /** * The rights source for `createReleaseApprovalCheck` (§10.6) over the deployment's members and * agent keys: a person's role now (undefined once they left), an `auto` approval's key (undefined * once revoked or its creator left). Wire it into the scheduler with the graph store, the schedule * store and `staff.ownership`. */ export declare function releaseRights(staff: StaffService, agentKeys?: AgentKeyService): ReleaseRightsSource; /** * The scheduler's `checkApproval` (RFC-0008 §10.6) over the deployment's database, for a tick that * runs outside any request (the admin Worker's cron and alarm, the Node ticker): members and agent * keys are read as they are now. A deployment without members (auth-less local use) has nobody * whose rights could lapse, so every approval holds there. */ export declare function releaseApprovalCheck(o: { sql: SqlDriver; graph: SiteGraphStore; }): (release: Release, now: Date) => Promise;