/** * The interactive terminal runner. * * A resident, multi-turn version of the one-shot direct driver: wait for the * Loader to settle, attach an Agent, then drive it with `followup` while idle and * `steer` while running, projecting its session log into the terminal. * * This file is the plugin and the loop, and nothing else. Two lifetimes carry the * work: `./window.ts` owns the terminal, key routing, the model route, and the * reader's preferences for as long as the plugin lives, and `./attachment.ts` * owns one Agent and everything projected from its log. `/sessions` retires an * attachment and asks for the next one, which is the whole reason the second * lifetime had to become explicit — and the reason the loop below is a loop. * * The model-facing tool rows this bundle's own `cordis.patch.yml` disables * on `dsh-base`'s layer live on the agent-preset plane instead: `attachOptions` * (`window.ts`) composes every agent this loop attaches from its resolved * preset — the session's own recorded choice on resume (falling back to * `standard` for a session produced before this bundle adopted presets, so * old history is never silently rebuilt under today's default, and to the * deployment's own default WITH the substitution reported where no usable * `standard` exists), the roster's default on a fresh one — inside the one * supported `setup(agentCtx, agent)` window, which is where Harness hands the * unpublished Agent over explicitly. A profile that mounts no `agentPresets` * seam at all leaves that step a no-op; it does NOT by itself restore the old flat * `dsh-base` tool set, since the disables in `cordis.patch.yml` apply * unconditionally. Removing the seam from an otherwise-stock composition * leaves an agent with no tools at all — the no-op only matters for a * deployment that never applied this bundle's own disable list to begin * with. * @module dshline */ import type { Context, Volatile } from '@deepseek-ai/cordis'; import z from '@deepseek-ai/schemastery'; import type { BusyEnter } from './delivery.ts'; import type { ModelRates } from './usage.ts'; import type { Window } from './window.ts'; /** Cordis plugin name used by Loader diagnostics. */ export declare const name = "dshline"; /** * The runner needs the invocation, the agent registry, the interaction seams, * and the model registry. `tuiStartup` is published only on an interactive * launch, so a piped run leaves this row unmounted. */ export declare const inject: string[]; /** Experimental pre-1.0 slot vocabulary; no stable dshline plugin SDK exists yet. */ export type { TuiOverlay, TuiSlotName, TuiSlotView } from './slots.ts'; /** Experimental pre-1.0 live-region registry; see {@link TuiOverlay}. */ export { TuiSlots } from './slots.ts'; /** * What a deployment can configure about this frontend. * * Prices are configuration rather than a shipped table because no rate is true * for long, and one baked into a release would keep reporting the number it was * built with. A route with no entry shows tokens and no money, which is the * honest reading — see {@link parsePricing}. */ export interface Config { /** * Dollars per million tokens, keyed `provider/model` — e.g. * `deepseek-official/deepseek-v4-flash` — or by model id alone to cover every * route serving it. An entry replaces the shipped rates for that key outright; * replacing the NUMBERS does not change what the route is, so a route this * interface already prices keeps its shipped label (`cost`, or the * `API-equivalent cost` of a signed-in route such as `openai-codex/`), * while a route it does not ship reads as its own billing. */ pricing?: Readonly>; /** * UTC windows charged at the standard rate, as `HH:MM` pairs. Every other hour * is off-peak. Omitted, the provider's published schedule applies. */ peakHoursUtc?: readonly { from: string; to: string; }[]; /** * The palette new windows open with, by id. * * This is the `base` layer of the `dshline` settings namespace: a deployment * composes a default here, and a reader's own stored value overrides it. * `/theme` writes the user layer, never this one. An id no shipped palette * has is refused by this row's own schema, not parsed around here. * * A `Volatile` reference, and that is the whole reason this row can be * reconfigured while a terminal is open: Harness mutates the reference in * place, so `/theme` takes effect without the row remounting and the live * region redrawing itself underneath the reader. */ theme?: Volatile; /** * What plain `enter` does while a turn is running: `queue` places the line on * the agent's next-turn list as a follow-up of its own, `steer` hands it to * the running turn at its nearest step boundary. * * The same `base` layer as {@link Config.theme}, and `/enter` writes the user * layer over it. Omitted, new windows open on `queue`, matching the adopted * Harness generation's own Web default. Volatile for the same reason. */ busyEnter?: Volatile; /** * Whether this frontend emits terminal BEL when it presents a live human * interaction. This is the `base` layer of the same `dshline` settings * namespace as the other reader preferences; omitted, it is enabled. Volatile * for the same reason. */ attentionBell?: Volatile; } /** * This row's own configuration schema. * * The adopted generation deleted the consumer-side settings registration: a * namespace used to be a name a plugin handed the settings service at mount, and * it is now the profile ENTRY ID of a plugin whose own `Config` declares its * fields, of which only `.volatile()` ones are writable. So the schema that * registers `dshline` as configurable lives here, on the row, and nowhere else. * * The split is load-bearing and not a convenience. A volatile field is mutated * IN PLACE on a live reference, so a `/theme` write changes the running value * without the row remounting. An ordinary field is an ordinary config change: * committing one patches the fiber's config and remounts the whole row, which * for a frontend that owns the terminal means the live region goes down. So * `theme`, `busyEnter` and `attentionBell` are the reader's live preferences and * are volatile; `pricing` and `peakHoursUtc` are composition-time facts nobody * edits from inside a running session, they are read once at mount, and * declaring them volatile would advertise an editing path whose only correct * implementation is a remount. Marking a field volatile is therefore a claim * about when it may change, not a way to make a test pass. */ export declare const Config: z; peakHoursUtc: z; theme: z; busyEnter: z<"queue" | "steer", "queue" | "steer", "volatile-defined">; attentionBell: z; }>>, Schemastery.ObjectT; peakHoursUtc: z; theme: z; busyEnter: z<"queue" | "steer", "queue" | "steer", "volatile-defined">; attentionBell: z; }>>, "plain">; /** * Mount the terminal frontend. * @param ctx - plugin context carrying the harness services and the invocation. * @param config - this row's configuration, when a bundle or patch supplied one. */ export declare function apply(ctx: Context, config?: Config): void; /** * Drive session choices in an established window without turning cancellation into creation. * @param w - the window whose setup has completed. * @returns when an unattached reader cancels; Harness owns process shutdown. */ export declare function runWindowSessions(w: Window): Promise; //# sourceMappingURL=index.d.ts.map