import { type Plugin } from "@opencode/plugin/effect"; import { Tool } from "@opencode/schema/tool"; import { Effect, Schema } from "effect"; import { type DispatchEffort } from "./effort.js"; export declare const DispatchInput: Schema.Struct<{ readonly task: Schema.String; readonly title: Schema.optionalKey; readonly threadID: Schema.optionalKey; readonly agent: Schema.optionalKey; readonly effort: Schema.optionalKey>; readonly directory: Schema.optionalKey; readonly ticketID: Schema.String; }>; export declare const StatusInput: Schema.Struct<{ readonly includeFinished: Schema.optionalKey; }>; interface DispatchInput { readonly task: string; readonly title?: string; readonly threadID?: string; readonly agent?: string; readonly effort?: DispatchEffort; readonly directory?: string; readonly ticketID: string; } export interface StatusOptions { /** Also list finished workers (max 20, newest first, reports shortened). */ readonly includeFinished?: boolean; /** * 调用方 Router 的分区:只统计/列出该目录的 worker 与工单。 * `undefined`=进程级视图(TUI/测试),输出与阶段 2a 逐字节一致。 */ readonly dirKey?: string; } /** Configured cap for one directory; non-positive/absent means unlimited. */ export declare function maxWorkersPerDirectory(ctx: Plugin.Context): number; /** Test hook: slots currently reserved per partition. */ export declare function reservedSlotCount(dirKey: string): number; /** * Compact status text for the `status` tool and its diagnostics readers. * Starts with the plugin version so a stale gateway (code upgraded but not * restarted) is visible from the first line instead of guessed from behavior. * * Only live workers are listed by default: finished records keep their * `lastReport`, and emitting all of them used to produce >12k characters that * stayed in the Router history forever. `includeFinished` opts into a bounded * tail of finished workers with shortened reports. */ export declare function statusText(options?: StatusOptions): string; /** * The one dispatch implementation, shared by the `dispatch` tool and the * `dispatch` RPC. Both paths pass the same ticket gate: `ticketID` is required * by the schema and re-checked here, so a direct RPC call cannot skip the * work order either. * * There is deliberately no `internal` bypass: no watchdog/resume path calls * dispatch today (the watchdog reports to the Router and resume prompts an * existing worker session), so every caller of this function is a real task * dispatch and must be backed by a ticket. */ export declare const runDispatch: (ctx: Plugin.Context, input: DispatchInput, caller: string) => Effect.Effect<{ output: { sessionID: string & import("effect/Brand").Brand<"SessionID">; }; content: string; }, Tool.Error, never>; export declare const registerTools: (ctx: Plugin.Context) => Effect.Effect; export {};