import { A as AgentSummary } from '../types-5pX8AZBM.cjs'; /** * `@ai-matrx/agents/quick` — QUICK AGENTS (CONFIDENTIAL-PARITY §2.2/§2.3). * * A quick agent is a named bundle of exactly: name, system prompt, model and three settings * (temperature, top-p, max output tokens). It is an ordinary `agent.definition` row — one agent * table, one permission model, no second prompt store — marked `kind: quick` so the big catalog * can hide or group it. This entry owns the shape and the pure builders/selectors; the WRITES go * through chat's one agent-definition write path (`agents/redux/agent-definition/definition-writes`), * never a second one here. * * The marker is the `kind:quick` tag: it rides every catalog row, so a list can filter without a * second read — exactly how `chat-agent` marks presets. (Rows saved before the shared write path also * carry `metadata.kind = "quick"`; both read as quick.) */ declare const QUICK_AGENT_KIND: "quick"; /** The tag every quick agent carries; the catalog row's way to say `kind: quick`. */ declare const QUICK_AGENT_TAG: "kind:quick"; /** The three minor settings — nothing else is ever part of a quick agent. */ interface QuickAgentSettings { temperature: number; topP: number; maxOutputTokens: number; } /** The whole definition: name + system prompt + model + the three settings. */ interface QuickAgentDefinition { name: string; systemPrompt: string; /** `ai.model_definition.id` (the agent's `model_id` column). */ modelId: string; settings: QuickAgentSettings; } interface QuickAgent extends QuickAgentDefinition { id: string; } /** One setting's slider: where it starts, where it stops, where a new agent rests. */ interface QuickAgentSettingLimit { min: number; max: number; step: number; default: number; } interface QuickAgentLimits { temperature: QuickAgentSettingLimit; topP: QuickAgentSettingLimit; maxOutputTokens: QuickAgentSettingLimit; } /** A model's own settings row for one control (`ai.model` controls: min / max / default), when it states one. */ interface ModelSettingRow { min?: number | null | undefined; max?: number | null | undefined; default?: unknown; } /** The chosen model's settings rows for the three controls; a control it does not state is absent. */ interface ModelSettingRows { temperature?: ModelSettingRow | null | undefined; top_p?: ModelSettingRow | null | undefined; max_output_tokens?: ModelSettingRow | null | undefined; } /** * The `agents.quick` knob values (organization and person can set them). `undefined` = the register * has not answered yet. A probability lives in 0..1 and a temperature starts at 0 by definition; * every other bound and every default is a knob. */ interface QuickAgentKnobValues { temperatureMax?: unknown; temperatureDefault?: unknown; topPDefault?: unknown; maxOutputMin?: unknown; maxOutputMax?: unknown; maxOutputDefault?: unknown; } declare const QUICK_AGENT_KNOBS: { readonly temperatureMax: { readonly feature: "agents.quick"; readonly key: "temperature_max"; }; readonly temperatureDefault: { readonly feature: "agents.quick"; readonly key: "temperature_default"; }; readonly topPDefault: { readonly feature: "agents.quick"; readonly key: "top_p_default"; }; readonly maxOutputMin: { readonly feature: "agents.quick"; readonly key: "max_output_min"; }; readonly maxOutputMax: { readonly feature: "agents.quick"; readonly key: "max_output_max"; }; readonly maxOutputDefault: { readonly feature: "agents.quick"; readonly key: "max_output_default"; }; }; /** A slider step that gives ~100 positions over the range, on a 1 / 2 / 5 grid (0.02 -> 0.05 style). */ declare function sliderStep(min: number, max: number): number; /** * THE ONE SOURCE of the three sliders' bounds and resting values: the chosen model's own settings * rows where it states them, else the `agents.quick` knobs. `null` until every number is known (the * panel shows no slider for a number nobody has answered — there is no code default). */ declare function resolveQuickAgentLimits(model: ModelSettingRows | null | undefined, knobs: QuickAgentKnobValues): QuickAgentLimits | null; /** A new agent's settings: every slider at its resting value. */ declare function defaultQuickAgentSettings(limits: QuickAgentLimits): QuickAgentSettings; /** Settings pulled inside their limits (a slider can never save a value the model refuses). */ declare function clampQuickAgentSettings(settings: QuickAgentSettings, limits?: QuickAgentLimits): QuickAgentSettings; /** What stops a save, in words — empty when the definition is saveable. */ declare function quickAgentProblems(def: Pick): string[]; interface QuickAgentSystemMessage { role: "system"; content: Array<{ type: "text"; text: string; }>; } /** The persisted `settings` JSON: the three params plus the stream flag every agent row carries. */ declare function quickAgentSettingsJson(settings: QuickAgentSettings): Record; declare function quickAgentMessages(systemPrompt: string): QuickAgentSystemMessage[]; /** * The agent fields a quick agent sets, in the shape of the ONE agent-definition write path * (chat `definition-writes`): name + system message + model + the three settings, marked quick, no * tools. Nothing else is ever part of a quick agent. */ declare function quickAgentFields(def: QuickAgentDefinition): { name: string; tags: string[]; isActive: true; isArchived: false; modelId: string; messages: QuickAgentSystemMessage[]; settings: Record; tools: never[]; }; /** * A stored row read back as a quick agent; `null` when the row is not one. A setting the row does * not carry rests at `defaults` (the resolved limits' resting values). */ declare function quickAgentFromRow(row: Record | null | undefined, defaults: QuickAgentSettings): QuickAgent | null; declare function isQuickAgentSummary(row: Pick): boolean; /** * THE QUICK-AGENT LIST in the platform's visibility lanes: mine, then my organization's, then the * system's (the catalog's own user-type / builtin split; "mine" is what the person created). */ declare function listQuickAgents(rows: readonly AgentSummary[], userId: string | null): { mine: AgentSummary[]; organization: AgentSummary[]; system: AgentSummary[]; }; /** The pill's list: mine, then organization, then system. */ declare function listMyQuickAgents(rows: readonly AgentSummary[], userId: string | null): AgentSummary[]; /** The big catalogue's view: quick agents leave the general list (a filter, never a delete). */ declare function withoutQuickAgents>(rows: readonly T[]): T[]; interface QuickAgentClient { schema(name: "agent"): { from(table: "definition"): any; }; } /** One quick agent's full definition; settings the row lacks rest at `defaults`. */ declare function readQuickAgent(client: QuickAgentClient, id: string, defaults?: QuickAgentSettings): Promise; /** * Leaf constants of the legacy compatibility surface (no imports of its own, so nothing can cycle * through it). Removed together with legacy.ts. */ declare const QUICK_AGENT_BOUNDS: { readonly temperature: { readonly min: 0; readonly max: 2; readonly step: 0.1; }; readonly topP: { readonly min: 0; readonly max: 1; readonly step: 0.05; }; readonly maxOutputTokens: { readonly min: 256; readonly max: 32768; readonly step: 256; }; }; declare const QUICK_AGENT_DEFAULT_SETTINGS: QuickAgentSettings; declare const LEGACY_LIMITS: QuickAgentLimits; /** * TEMPORARY COMPATIBILITY for published `@ai-matrx/chat` <= 0.8.328, which still imports these from * `@ai-matrx/agents/quick` (createQuickAgent, updateQuickAgent, deleteQuickAgent, QUICK_AGENT_BOUNDS, * QUICK_AGENT_DEFAULT_SETTINGS, the one-argument clamp, a two-argument readQuickAgent). Current chat * saves through its own `definition-writes` (the ONE write path; agents cannot import chat), so these * exist only so the old chat on npm keeps working. REMOVE this file, its guard allowlist entry and * `quick/__tests__/published-consumers.json` once a chat release that no longer imports them is on npm. */ declare function createQuickAgent(client: QuickAgentClient, def: QuickAgentDefinition, owner: { organizationId: string; userId: string; }): Promise; declare function updateQuickAgent(client: QuickAgentClient, id: string, def: QuickAgentDefinition): Promise; declare function deleteQuickAgent(client: QuickAgentClient, id: string): Promise; export { LEGACY_LIMITS, QUICK_AGENT_BOUNDS, QUICK_AGENT_DEFAULT_SETTINGS, QUICK_AGENT_KIND, QUICK_AGENT_KNOBS, QUICK_AGENT_TAG, clampQuickAgentSettings, createQuickAgent, defaultQuickAgentSettings, deleteQuickAgent, isQuickAgentSummary, listMyQuickAgents, listQuickAgents, quickAgentFields, quickAgentFromRow, quickAgentMessages, quickAgentProblems, quickAgentSettingsJson, readQuickAgent, resolveQuickAgentLimits, sliderStep, updateQuickAgent, withoutQuickAgents }; export type { ModelSettingRow, ModelSettingRows, QuickAgent, QuickAgentClient, QuickAgentDefinition, QuickAgentKnobValues, QuickAgentLimits, QuickAgentSettingLimit, QuickAgentSettings, QuickAgentSystemMessage };