@alisio/sdk 0.3.0 → 0.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.d.ts +68 -0
  2. package/package.json +1 -1
package/dist/index.d.ts CHANGED
@@ -1356,6 +1356,73 @@ export declare class ViewParamsError extends Error {
1356
1356
  readonly code = "view_invalid_params";
1357
1357
  constructor(message?: string);
1358
1358
  }
1359
+ export type DashboardPurpose = "executive" | "operational" | "analytical";
1360
+ export type DashboardLayout = "executive-grid" | "operational-grid" | "analytical-grid";
1361
+ export type DashboardAggregation = "sum" | "avg" | "min" | "max" | "count" | "count_distinct";
1362
+ export type DashboardTimeBucket = "day" | "week" | "month" | "quarter" | "year";
1363
+ export type DashboardLocale = "en" | "es";
1364
+ interface DashboardWidgetBase {
1365
+ /** `^[a-z][a-z0-9-]{0,39}$`, unique within the spec. */
1366
+ id: string;
1367
+ /** At most 80 characters; escaped when rendered. */
1368
+ title?: string;
1369
+ }
1370
+ export interface KpiWidget extends DashboardWidgetBase {
1371
+ type: "kpi";
1372
+ /** A dataset column name, or `"*"` (only with aggregation `count`). */
1373
+ metric: string;
1374
+ aggregation: DashboardAggregation;
1375
+ label?: string;
1376
+ }
1377
+ export interface SeriesWidget extends DashboardWidgetBase {
1378
+ type: "line" | "area" | "bar" | "hbar" | "pie" | "donut";
1379
+ /** A dataset column name (catalog), never free text. */
1380
+ dimension: string;
1381
+ /** `"*"` only with aggregation `count`. */
1382
+ metric: string;
1383
+ aggregation: DashboardAggregation;
1384
+ /** Required when the dimension is a time column. */
1385
+ timeBucket?: DashboardTimeBucket;
1386
+ /** 1..20 (top-N; default 10). */
1387
+ limit?: number;
1388
+ /** Fold the rest into "Other" (sum/count only). */
1389
+ other?: boolean;
1390
+ }
1391
+ export interface ScatterWidget extends DashboardWidgetBase {
1392
+ type: "scatter";
1393
+ x: string;
1394
+ y: string;
1395
+ }
1396
+ export interface TableWidget extends DashboardWidgetBase {
1397
+ type: "table";
1398
+ /** 1..8 dataset column names. */
1399
+ columns: string[];
1400
+ /** 1..20. */
1401
+ limit?: number;
1402
+ }
1403
+ export type DashboardWidget = KpiWidget | SeriesWidget | ScatterWidget | TableWidget;
1404
+ export interface DashboardSpec {
1405
+ version: 1;
1406
+ /** At most 120 characters; escaped when rendered. */
1407
+ title: string;
1408
+ purpose: DashboardPurpose;
1409
+ layout: DashboardLayout;
1410
+ locale: DashboardLocale;
1411
+ /** Table name of the sheet (XLSX); absent means `data`. */
1412
+ sheet?: string;
1413
+ /** 1..12 widgets, at most 6 of them `kpi`. */
1414
+ widgets: DashboardWidget[];
1415
+ }
1416
+ /** Public provenance of an artifact made by `dashboard_generate` (artifact `provenance`). */
1417
+ export interface DashboardProvenance {
1418
+ generator: "dashboard_generate";
1419
+ spec: DashboardSpec;
1420
+ planner: "rules" | "rules+decisions";
1421
+ /** Id of the decision provider that answered at least one decision. */
1422
+ decisionProvider?: string;
1423
+ /** Human-readable, metadata only (for example "widget sales-trend dropped: query timeout"). */
1424
+ fallbacks: string[];
1425
+ }
1359
1426
  export interface DecisionsApi {
1360
1427
  /** Registers a provider (does NOT activate it; activation is `decisions.provider` in config). */
1361
1428
  registerProvider(provider: DecisionProvider): () => void;
@@ -2535,3 +2602,4 @@ export declare const textResult: (text: string, isError?: boolean) => ToolResult
2535
2602
  * raw bytes or structured blocks never reach the model prompt.
2536
2603
  */
2537
2604
  export declare function textProjection(result: ToolResult): ToolResult;
2605
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alisio/sdk",
3
- "version": "0.3.0",
3
+ "version": "0.4.1",
4
4
  "description": "Typed plugin SDK for Alisio: the stable contract for tools, commands, context, compaction and session hooks, model completions and storage. Types only plus tiny helpers; zero runtime dependencies.",
5
5
  "author": "Gustavo Gutiérrez",
6
6
  "license": "MIT",