@fusedashlabs/ui9000-workspace
Version:
UI9000 workspace MCP. One tool, show_workspace, draws a chart from your table. Set TYPESAFE_API_KEY to let Jev choose the chart.
34 lines (33 loc) • 1.69 kB
TypeScript
import type { TraceRisk, TraceRiskBand } from '../trace/trace.js';
/**
* Closed risk table. Bands come from the action name in catalog metadata.
* A workspace spec cannot lower a band: this module never reads `spec.risk`
* or `spec.allowedActions`.
*
* low: hover, resize, pan, zoom
* held: submit, approve, reject, filter, drag
* anything else is held — an unlisted action is not low
*/
export declare const RISK_EFFECTS: readonly ["observe", "commit", "narrow", "move", "unlisted"];
export declare const RISK_REVERSIBILITIES: readonly ["reversible", "irreversible"];
export declare const RISK_SCOPES: readonly ["view", "record", "query", "layout", "unknown"];
export type RiskEffect = (typeof RISK_EFFECTS)[number];
export type RiskReversibility = (typeof RISK_REVERSIBILITIES)[number];
export type RiskScope = (typeof RISK_SCOPES)[number];
export type RiskAssessment = {
effect: RiskEffect;
reversibility: RiskReversibility;
scope: RiskScope;
band: TraceRiskBand;
};
export type ClassifiedAction = TraceRisk & RiskAssessment;
export declare const RISK_TABLE: Readonly<Record<string, RiskAssessment>>;
export declare function classifyAction(action: string): RiskAssessment;
/** `allowedActions` from the catalog entry. Do not pass the spec's list. */
export declare function classifyActions(catalogActions: readonly string[]): ClassifiedAction[];
/**
* Catalog actions win. `spec` is accepted so a caller can pass the hostile
* document and we can prove it is ignored — including `spec.risk` and
* `spec.allowedActions`.
*/
export declare function classifyCatalogActions(catalogActions: readonly string[] | undefined, spec?: unknown): ClassifiedAction[];