@happyvertical/smrt-reports 0.62.3 → 0.62.4
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.
- package/dist/manifest.json +1 -1
- package/dist/smrt-knowledge.json +5 -5
- package/dist/smrt-knowledge.okf.md +2 -2
- package/dist/state.js +1 -1
- package/dist/state.js.map +1 -1
- package/dist/svelte/ReportResult.svelte +5 -0
- package/dist/svelte/ReportResult.svelte.d.ts.map +1 -1
- package/dist/svelte/describe.d.ts +2 -0
- package/dist/svelte/describe.d.ts.map +1 -1
- package/dist/svelte/describe.js +6 -5
- package/package.json +9 -9
package/dist/manifest.json
CHANGED
package/dist/smrt-knowledge.json
CHANGED
|
@@ -3,14 +3,14 @@
|
|
|
3
3
|
"sensitiveFieldsExcluded": true,
|
|
4
4
|
"generatedAt": "1970-01-01T00:00:00.000Z",
|
|
5
5
|
"packageName": "@happyvertical/smrt-reports",
|
|
6
|
-
"packageVersion": "0.62.
|
|
6
|
+
"packageVersion": "0.62.4",
|
|
7
7
|
"sourceManifestPath": "dist/manifest.json",
|
|
8
8
|
"agentDocPath": "AGENTS.md",
|
|
9
9
|
"sourceHashes": {
|
|
10
|
-
"manifest": "
|
|
11
|
-
"packageJson": "
|
|
10
|
+
"manifest": "370490b57be9739f20e0855db459de8ed2f1c7588e903ea3c6bfe447f41a3f51",
|
|
11
|
+
"packageJson": "19332c271b7ebdf4b974430c60d679b3a8707014523f0b6366bedf64624b63fc",
|
|
12
12
|
"agents": "06d19fec39775737f02dd553471e74a9f4442334138ea273ea53a0fb5e45cef4",
|
|
13
|
-
"moduleDoc:agents/runtime-report-browser.md": "
|
|
13
|
+
"moduleDoc:agents/runtime-report-browser.md": "9382c4cc7a3a8edd037e5dc831d28196d08f58a0dbf2ea183728e062661b145c",
|
|
14
14
|
"moduleDoc:agents/runtime-reports.md": "16deaef2fdc35b1484b69477429c234255be991d68675cc9a5e335ff3c9b84e2",
|
|
15
15
|
"moduleDoc:README.md": "7c1382e820af6881b8e9a1de622fa4917d23bd3139cac0b04186c17299da2ff4"
|
|
16
16
|
},
|
|
@@ -1293,7 +1293,7 @@
|
|
|
1293
1293
|
{
|
|
1294
1294
|
"path": "agents/runtime-report-browser.md",
|
|
1295
1295
|
"module": "runtime-report-browser",
|
|
1296
|
-
"content": "# Runtime report browser surfaces (#3895)\n\nThe browser entry is `@happyvertical/smrt-reports/svelte`. It imports visual and\nform primitives from smrt-ui, never smrt-svelte or the reports server barrel.\n`@happyvertical/smrt-ui/charts` owns the five shared renderers; the overview\nchart and report results both consume it.\n\n- `SavedReports`: tenant-shared saved reports as a responsive grid of\n `SavedReportCard`s (title opening the report, a one-line description from\n `describeReport`, a headline figure and sparkline from a run, saved/updated\n time), Everyone's/Mine and Show archived filters (smrt-ui `SegmentedControl`,\n `Switch`), \"New report\", an empty state, and Archive in each card's \"more\"\n menu behind a confirmation. `variant: 'section'` is the Reports section page.\n The host resolves author ids (`authorLabel`), passes source labels\n (`sources`), and supplies an archive capability hint; the server authorizes\n every archive again. Each shown report runs once (three at a time).\n- \"New report\" and Edit call smrt-ui `requestAssistant` (the dock fills its\n composer); with no assistant on the page the screen says where to ask.\n- `ReportDetail`: a summary header (description, source, groupings, period\n with its dates, measures, filters, who saved it, last run), then the result\n run afresh on open and each re-run. Primary action by state: Edit, Try again\n after a failed run, Restore when archived; Export CSV (formatted,\n formula-safe) beside it; Re-run and Archive in the \"more\" menu. The transport is\n principal-scoped; replace it when viewer/tenant changes. Pending old\n responses are discarded, and result rows live only in component state.\n- `ReportResult`: validates the result shape and safe integers. `full` (a\n report's page): a Chart/Table switch, a measure switch, headline figures\n (total for sums and counts, average per bucket, peak) and a tall smrt-ui\n `Chart` with a value axis and keyboard/pointer readout. `compact` (preview\n card): a quiet table toggle. Tables format money and time buckets. Money\n fields use integer minor units and the host's ISO currency (default USD).\n- Hosts can pass `ReportResult.formatCell(value, column, row)` for display labels\n and formatting in tables and chart group labels, and `cellHref(column, row)`\n for same-origin record links in tables. Raw result values are preserved.\n The component-free `./display` entry exports `reportCsv` and result validation.\n `reportCsv` supplies the row to its formatter too, keeping exports consistent.\n- `saved-reports` widget (`SavedReportsWidget`, recipe `sectionDefault`): the\n Reports section page in any host rendering data widgets; it reads through\n the shared browser client unless the host passes `client`.\n- `ReportConfirmation`: shows the source label, groupings, measures,\n filters, and a bounded preview. Approve requires a trusted local click and\n posts the exact displayed `{ spec, specHash }` to the proposal's same-origin\n `confirmPath` once while pending. Decline never calls the server. The server\n recompiles as the confirming principal and idempotently saves the approved\n spec; the hash carries no authority by itself.\n- Answered state (#4100): after Approve or Decline the card shows an outcome\n line (\"Report saved · Open report\", \"Declined — nothing saved\") instead\n of buttons; pass `outcome` from the transcript so a reloaded card does too.\n `fields` (a source descriptor's names, labels, formats) labels groupings,\n buckets (\"Issue date by month\") and money filters; measures use the result's\n column labels. `ReportResult` labels time buckets by granularity\n (smrt-ui `formatTimeBucket`) and keeps the table toggle quiet.\n- `ReportPicker`: labelled fields (smrt-ui `FormGroup`) offering readable\n active reports and their measures and groupings by name, not alias;\n changing the report clears dependent choices.\n\n`createRuntimeReportsHttpClient()` implements the generated same-origin reads,\nthe enveloped `run`/`archive` actions, and the confirmation POST. It has no\ndatabase, tenant, or permission authority. Successful run timestamps live only\nin that browser client's session map; route hosts include an opaque active\ntenant/session scope so hints are discarded when the principal context changes. Omit the client (or set\n`serverAvailable={false}` on a route component) for a static host: the screens\nexplain that reports need a server and make no requests.\n\n`runtimeReportToolResultComponent` is the reports adapter for AssistantDock's\ngeneric component seam. Recipe routes export `RuntimeReportsRoute` and\n`RuntimeReportDetailRoute`; the `runtime-report-chart` surface exports its\nrenderer and dependent report/measure/dimension editor. The server host builds\nthe chart loader context from request-scoped `reportPrincipal`; widget options\nnever carry identity, permissions, tenant, or database authority.\n\nThe `./playground` entry has saved-list, detail, confirmation, picker, empty and\nunavailable previews. They use deterministic sample data, not a production\nbackend. All component copy registers through `smrt-ui/i18n`.\n\nThe smrt planner (#4100) renders `ReportConfirmation`, `SavedReports` and\n`ReportDetail` with its own `RuntimeReportsClient` over sample data and the\nin-memory runner from `./spec`; its `confirm` is a browser save, not this\npackage's confirmation route.\n\nThe template reference application exercises the generic dock selector, a real\ntrusted browser approval click, authenticated confirmation and generated reads,\ndetail execution, and the recipe-registered overview loader/renderer without\nmocking an endpoint.\n"
|
|
1296
|
+
"content": "# Runtime report browser surfaces (#3895)\n\nThe browser entry is `@happyvertical/smrt-reports/svelte`. It imports visual and\nform primitives from smrt-ui, never smrt-svelte or the reports server barrel.\n`@happyvertical/smrt-ui/charts` owns the five shared renderers; the overview\nchart and report results both consume it.\n\n- `SavedReports`: tenant-shared saved reports as a responsive grid of\n `SavedReportCard`s (title opening the report, a one-line description from\n `describeReport`, a headline figure and sparkline from a run, saved/updated\n time), Everyone's/Mine and Show archived filters (smrt-ui `SegmentedControl`,\n `Switch`), \"New report\", an empty state, and Archive in each card's \"more\"\n menu behind a confirmation. `variant: 'section'` is the Reports section page.\n The host resolves author ids (`authorLabel`), passes source labels\n (`sources`), and supplies an archive capability hint; the server authorizes\n every archive again. Each shown report runs once (three at a time).\n- \"New report\" and Edit call smrt-ui `requestAssistant` (the dock fills its\n composer); with no assistant on the page the screen says where to ask.\n- `ReportDetail`: a summary header (description, source, groupings, period\n with its dates, measures, filters, who saved it, last run), then the result\n run afresh on open and each re-run. Primary action by state: Edit, Try again\n after a failed run, Restore when archived; Export CSV (formatted,\n formula-safe) beside it; Re-run and Archive in the \"more\" menu. The transport is\n principal-scoped; replace it when viewer/tenant changes. Pending old\n responses are discarded, and result rows live only in component state.\n- `ReportResult`: validates the result shape and safe integers. `full` (a\n report's page): a Chart/Table switch, a measure switch, headline figures\n (total for sums and counts, average per bucket, peak) and a tall smrt-ui\n `Chart` with a value axis and keyboard/pointer readout. `compact` (preview\n card): a quiet table toggle. Tables format money and time buckets. Money\n fields use integer minor units and the host's ISO currency (default USD).\n- Hosts can pass `ReportResult.formatCell(value, column, row)` for display labels\n and formatting in tables and chart group labels, and `cellHref(column, row)`\n for same-origin record links in tables. Raw result values are preserved.\n The component-free `./display` entry exports `reportCsv` and result validation.\n `reportCsv` supplies the row to its formatter too, keeping exports consistent.\n- `saved-reports` widget (`SavedReportsWidget`, recipe `sectionDefault`): the\n Reports section page in any host rendering data widgets; it reads through\n the shared browser client unless the host passes `client`.\n- `ReportConfirmation`: shows the source label, groupings, measures,\n filters, and a bounded preview. Approve requires a trusted local click and\n posts the exact displayed `{ spec, specHash }` to the proposal's same-origin\n `confirmPath` once while pending. Decline never calls the server. The server\n recompiles as the confirming principal and idempotently saves the approved\n spec; the hash carries no authority by itself.\n- Answered state (#4100): after Approve or Decline the card shows an outcome\n line (\"Report saved · Open report\", \"Declined — nothing saved\") instead\n of buttons; pass `outcome` from the transcript so a reloaded card does too.\n `fields` (a source descriptor's names, labels, formats) labels groupings,\n buckets (\"Issue date by month\") and money filters; measures use the result's\n column labels. `ReportResult` labels time buckets by granularity\n (smrt-ui `formatTimeBucket`) and keeps the table toggle quiet.\n- `ReportPicker`: labelled fields (smrt-ui `FormGroup`) offering readable\n active reports and their measures and groupings by name, not alias;\n changing the report clears dependent choices.\n\n`createRuntimeReportsHttpClient()` implements the generated same-origin reads,\nthe enveloped `run`/`archive` actions, and the confirmation POST. It has no\ndatabase, tenant, or permission authority. Successful run timestamps live only\nin that browser client's session map; route hosts include an opaque active\ntenant/session scope so hints are discarded when the principal context changes. Omit the client (or set\n`serverAvailable={false}` on a route component) for a static host: the screens\nexplain that reports need a server and make no requests.\n\n`runtimeReportToolResultComponent` is the reports adapter for AssistantDock's\ngeneric component seam. Recipe routes export `RuntimeReportsRoute` and\n`RuntimeReportDetailRoute`; the `runtime-report-chart` surface exports its\nrenderer and dependent report/measure/dimension editor. The server host builds\nthe chart loader context from request-scoped `reportPrincipal`; widget options\nnever carry identity, permissions, tenant, or database authority.\n\nThe `./playground` entry has saved-list, detail, confirmation, picker, empty and\nunavailable previews. They use deterministic sample data, not a production\nbackend. All component copy registers through `smrt-ui/i18n`.\n\nThe smrt planner (#4100) renders `ReportConfirmation`, `SavedReports` and\n`ReportDetail` with its own `RuntimeReportsClient` over sample data and the\nin-memory runner from `./spec`; its `confirm` is a browser save, not this\npackage's confirmation route.\n\nThe template reference application exercises the generic dock selector, a real\ntrusted browser approval click, authenticated confirmation and generated reads,\ndetail execution, and the recipe-registered overview loader/renderer without\nmocking an endpoint.\n\n`ReportResult.formatCell` also formats money measures in charts and headline\nfigures, so per-field currency and precision apply to the complete report. Other\nmeasures keep standard grouping, rounded averages and compact axis labels.\n`reportFigures` accepts optional `formatValue(value)` for the same purpose.\n"
|
|
1297
1297
|
},
|
|
1298
1298
|
{
|
|
1299
1299
|
"path": "agents/runtime-reports.md",
|
|
@@ -5,10 +5,10 @@ description: "Materialized aggregate report models for SMRT"
|
|
|
5
5
|
status: "stable"
|
|
6
6
|
generated:
|
|
7
7
|
by: "smrt/scripts/generate-knowledge-okf.ts"
|
|
8
|
-
at: "2026-11-
|
|
8
|
+
at: "2026-11-17T00:04:46Z"
|
|
9
9
|
audience: "internal"
|
|
10
10
|
evidence_level: "source-inspected"
|
|
11
|
-
source_revision: "sha256:
|
|
11
|
+
source_revision: "sha256:9d80d49adb1b2e54482e5d3fe28dd6f0e9203e9520b573de3d17546935b4a11e"
|
|
12
12
|
sources:
|
|
13
13
|
- id: "manifest"
|
|
14
14
|
resource: "https://github.com/happyvertical/smrt/blob/main/packages/reports/package.json"
|
package/dist/state.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ObjectRegistry, SmrtCollection, SmrtObject, field, smrt } from "@happyvertical/smrt-core";
|
|
2
2
|
import { TenantScoped, tenantId } from "@happyvertical/smrt-tenancy";
|
|
3
3
|
//#region src/__smrt-register__.ts
|
|
4
|
-
ObjectRegistry.registerPackageManifest(JSON.parse(`{"version":"1.0.0","timestamp":0,"packageName":"@happyvertical/smrt-reports","packageVersion":"0.62.3","objects":{"@happyvertical/smrt-reports:SmrtReport":{"name":"smrtreport","className":"SmrtReport","qualifiedName":"@happyvertical/smrt-reports:SmrtReport","collection":"smrtreports","filePath":"src/report.ts","packageName":"@happyvertical/smrt-reports","fields":{"refreshedAt":{"type":"datetime","_meta":{"__statedOptions":[]},"required":false}},"methods":{"isStale":{"name":"isStale","async":false,"parameters":[{"name":"ttlMs","type":"number","optional":true}],"returnType":"boolean","isStatic":false,"isPublic":true},"refresh":{"name":"refresh","async":true,"parameters":[{"name":"options","type":"Omit<ReportRefreshOptions, 'db'>","optional":true}],"returnType":"Promise<ReportRefreshResult>","isStatic":false,"isPublic":true}},"decoratorConfig":{},"extends":"SmrtObject","exportName":"SmrtReport","collectionExportName":"SmrtReportCollection","importPath":"@happyvertical/smrt-reports"},"@happyvertical/smrt-reports:SmrtReportCollection":{"name":"smrtreportcollection","className":"SmrtReportCollection","qualifiedName":"@happyvertical/smrt-reports:SmrtReportCollection","collection":"smrtreports","filePath":"src/report.ts","packageName":"@happyvertical/smrt-reports","fields":{},"methods":{"refresh":{"name":"refresh","async":true,"parameters":[{"name":"options","type":"Omit<ReportRefreshOptions, 'db'>","optional":true}],"returnType":"Promise<ReportRefreshResult>","isStatic":false,"isPublic":true},"list":{"name":"list","async":true,"parameters":[{"name":"options","type":"SmrtListOptions<ModelType>","optional":true}],"returnType":"Promise<SmrtObject[] | Record<string, unknown>[]>","isStatic":false,"isPublic":true},"get":{"name":"get","async":true,"parameters":[{"name":"filter","type":"any","optional":false,"typeUnresolved":true},{"name":"options","type":"any","optional":true,"typeUnresolved":true}],"returnType":"Promise<ModelType | null>","isStatic":false,"isPublic":true}},"decoratorConfig":{},"extends":"SmrtCollection","extendsTypeArg":"ModelType","exportName":"SmrtReportCollection","collectionExportName":"SmrtReportCollectionCollection","collectionOf":"@happyvertical/smrt-reports:SmrtReport","importPath":"@happyvertical/smrt-reports"},"@happyvertical/smrt-reports:RuntimeReport":{"name":"runtimereport","className":"RuntimeReport","qualifiedName":"@happyvertical/smrt-reports:RuntimeReport","collection":"runtimereports","filePath":"src/runtime-report.ts","packageName":"@happyvertical/smrt-reports","fields":{"tenantId":{"type":"text","_meta":{"__tenancy":{"isTenantIdField":true,"autoFilter":true,"required":true,"autoPopulate":true,"nullable":false,"mode":"required","field":"tenantId","allowSuperAdminBypass":false},"__statedOptions":["sqlType","requiredFor","__tenancy"],"sqlType":"UUID","requiredFor":"tenant-scope"},"required":true},"title":{"type":"text","_meta":{"__statedOptions":[]},"required":false},"description":{"type":"text","_meta":{"__statedOptions":[]},"required":false},"sourceId":{"type":"text","_meta":{"__statedOptions":[]},"required":false},"spec":{"type":"text","_meta":{"__statedOptions":["required","requiredFor"],"required":true,"requiredFor":"integrity"},"required":true},"specHash":{"type":"text","_meta":{"__statedOptions":[]},"required":false},"status":{"type":"text","_meta":{"__statedOptions":["required","enum"],"required":true},"required":true,"enum":["active","archived"]},"createdByUserId":{"type":"text","_meta":{"__statedOptions":[]},"required":false}},"methods":{"run":{"name":"run","async":true,"parameters":[],"returnType":"Promise<RuntimeReportResult>","isStatic":false,"isPublic":true},"archive":{"name":"archive","async":true,"parameters":[{"name":"options","type":"object","optional":false,"memberTypes":["boolean"]}],"returnType":"Promise<object>","isStatic":false,"isPublic":true},"getSpec":{"name":"getSpec","async":false,"parameters":[],"returnType":"RuntimeReportSpec","isStatic":false,"isPublic":true},"setSpec":{"name":"setSpec","async":false,"parameters":[{"name":"spec","type":"RuntimeReportSpec","optional":false}],"returnType":"void","isStatic":false,"isPublic":true}},"decoratorConfig":{"tableName":"runtime_reports","indexes":[{"name":"idx_runtime_reports_confirm","columns":["tenantId","createdByUserId","specHash","status"]}],"operationPermissions":{"run":{"action":"read"},"archive":{"action":"create","databaseActions":["SELECT","UPDATE"]}},"api":{"include":["list","get","create","run","archive"],"principalContext":true,"routes":{"run":{"method":"POST","scope":"item","effect":"read","idempotent":true,"openWorld":false},"archive":{"method":"POST","scope":"item","effect":"write","idempotent":true,"openWorld":false}}},"mcp":{"include":["list","get","run","archive"]},"cli":{"include":["list","get","run","archive"]},"tenantScoped":{"mode":"required"},"conflictColumns":["tenant_id","slug","context"]},"extends":"SmrtObject","exportName":"RuntimeReport","collectionExportName":"RuntimeReportCollection","displayLabelField":"title","validationRules":[{"field":"spec","rule":"required","fieldType":"text"},{"field":"status","rule":"required","fieldType":"text"}],"schema":{"tableName":"runtime_reports","ddl":"CREATE TABLE IF NOT EXISTS \\"runtime_reports\\" (\\n \\"_sync_origin_device_id\\" TEXT,\\n \\"_sync_revision\\" INTEGER,\\n \\"id\\" UUID PRIMARY KEY NOT NULL,\\n \\"slug\\" TEXT NOT NULL,\\n \\"context\\" TEXT NOT NULL DEFAULT '',\\n \\"created_at\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\"updated_at\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\"tenant_id\\" UUID NOT NULL,\\n \\"title\\" TEXT,\\n \\"description\\" TEXT,\\n \\"source_id\\" TEXT,\\n \\"spec\\" TEXT NOT NULL,\\n \\"spec_hash\\" TEXT,\\n \\"status\\" TEXT NOT NULL,\\n \\"created_by_user_id\\" TEXT\\n);","columns":{"_sync_origin_device_id":{"type":"TEXT"},"_sync_revision":{"type":"INTEGER"},"id":{"type":"UUID","primaryKey":true,"referenceKind":"id","notNull":true},"slug":{"type":"TEXT","notNull":true},"context":{"type":"TEXT","notNull":true,"default":""},"created_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"updated_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"tenant_id":{"type":"UUID","referenceKind":"tenantId","notNull":true,"unique":false},"title":{"type":"TEXT","notNull":false,"unique":false},"description":{"type":"TEXT","notNull":false,"unique":false},"source_id":{"type":"TEXT","notNull":false,"unique":false},"spec":{"type":"TEXT","notNull":true,"unique":false},"spec_hash":{"type":"TEXT","notNull":false,"unique":false},"status":{"type":"TEXT","notNull":true,"unique":false},"created_by_user_id":{"type":"TEXT","notNull":false,"unique":false}},"indexes":[{"name":"runtime_reports_slug_context_idx","columns":["tenant_id","slug","context"],"unique":true},{"name":"idx_runtime_reports_confirm","columns":["tenant_id","created_by_user_id","spec_hash","status"]},{"name":"runtime_reports_tenant_id_created_at_idx","columns":["tenant_id","created_at"]}],"version":"0197b1d5"},"importPath":"@happyvertical/smrt-reports"},"@happyvertical/smrt-reports:RuntimeReportCollection":{"name":"runtimereportcollection","className":"RuntimeReportCollection","qualifiedName":"@happyvertical/smrt-reports:RuntimeReportCollection","collection":"runtimereports","filePath":"src/runtime-report.ts","packageName":"@happyvertical/smrt-reports","fields":{},"methods":{},"decoratorConfig":{"tableName":"runtime_reports","api":{"include":["list","get","create"]},"mcp":{"include":["list","get"]},"cli":{"include":["list","get"]}},"extends":"SmrtCollection","extendsTypeArg":"RuntimeReport","exportName":"RuntimeReportCollection","collectionExportName":"RuntimeReportCollectionCollection","collectionOf":"@happyvertical/smrt-reports:RuntimeReport","inheritedExposure":["api","mcp","cli"],"schema":{"tableName":"runtime_reports","ddl":"CREATE TABLE IF NOT EXISTS \\"runtime_reports\\" (\\n \\"_sync_origin_device_id\\" TEXT,\\n \\"_sync_revision\\" INTEGER,\\n \\"id\\" UUID PRIMARY KEY NOT NULL,\\n \\"slug\\" TEXT NOT NULL,\\n \\"context\\" TEXT NOT NULL DEFAULT '',\\n \\"created_at\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\"updated_at\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\"tenant_id\\" UUID NOT NULL,\\n \\"title\\" TEXT,\\n \\"description\\" TEXT,\\n \\"source_id\\" TEXT,\\n \\"spec\\" TEXT NOT NULL,\\n \\"spec_hash\\" TEXT,\\n \\"status\\" TEXT NOT NULL,\\n \\"created_by_user_id\\" TEXT\\n);","columns":{"_sync_origin_device_id":{"type":"TEXT"},"_sync_revision":{"type":"INTEGER"},"id":{"type":"UUID","primaryKey":true,"referenceKind":"id","notNull":true},"slug":{"type":"TEXT","notNull":true},"context":{"type":"TEXT","notNull":true,"default":""},"created_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"updated_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"tenant_id":{"type":"UUID","referenceKind":"tenantId","notNull":true,"unique":false},"title":{"type":"TEXT","notNull":false,"unique":false},"description":{"type":"TEXT","notNull":false,"unique":false},"source_id":{"type":"TEXT","notNull":false,"unique":false},"spec":{"type":"TEXT","notNull":true,"unique":false},"spec_hash":{"type":"TEXT","notNull":false,"unique":false},"status":{"type":"TEXT","notNull":true,"unique":false},"created_by_user_id":{"type":"TEXT","notNull":false,"unique":false}},"indexes":[{"name":"runtime_reports_slug_context_idx","columns":["tenant_id","slug","context"],"unique":true},{"name":"idx_runtime_reports_confirm","columns":["tenant_id","created_by_user_id","spec_hash","status"]},{"name":"runtime_reports_tenant_id_created_at_idx","columns":["tenant_id","created_at"]}],"version":"0197b1d5"},"importPath":"@happyvertical/smrt-reports"},"@happyvertical/smrt-reports:SmrtReportRefreshTask":{"name":"smrtreportrefreshtask","className":"SmrtReportRefreshTask","qualifiedName":"@happyvertical/smrt-reports:SmrtReportRefreshTask","collection":"smrtreportrefreshtasks","filePath":"src/scheduler.ts","packageName":"@happyvertical/smrt-reports","fields":{"tenantId":{"type":"text","_meta":{"__tenancy":{"isTenantIdField":true,"autoFilter":true,"required":false,"autoPopulate":true,"nullable":true,"mode":"optional","field":"tenantId","allowSuperAdminBypass":false},"__statedOptions":["sqlType","nullable","__tenancy","required"],"sqlType":"UUID","nullable":true,"required":false},"required":false},"reportClass":{"type":"text","_meta":{"__statedOptions":[]},"required":false},"mode":{"type":"text","_meta":{"__statedOptions":["required","backfill","enum"],"required":true,"backfill":"'incremental'"},"required":true,"enum":["rebuild","incremental"]},"trigger":{"type":"text","_meta":{"__statedOptions":["required","enum"],"required":true},"required":true,"enum":["manual","schedule","change","ttl","job"]},"args":{"type":"json","_meta":{"__statedOptions":[]},"required":false}},"methods":{"run":{"name":"run","async":true,"parameters":[{"name":"args","type":"ReportRefreshJobArgs","optional":true},{"name":"context","type":"JobExecutionContext","optional":true}],"returnType":"Promise<unknown>","isStatic":false,"isPublic":true}},"decoratorConfig":{"tableName":"_smrt_report_refresh_tasks","api":false,"cli":{"include":["list","get"],"skipApiCheck":true,"http":false},"mcp":false,"tenantScoped":{"mode":"optional"},"conflictColumns":["tenant_id","slug","context"]},"extends":"SmrtObject","exportName":"SmrtReportRefreshTask","collectionExportName":"SmrtReportRefreshTaskCollection","validationRules":[{"field":"mode","rule":"required","fieldType":"text"},{"field":"trigger","rule":"required","fieldType":"text"}],"schema":{"tableName":"_smrt_report_refresh_tasks","ddl":"CREATE TABLE IF NOT EXISTS \\"_smrt_report_refresh_tasks\\" (\\n \\"_sync_origin_device_id\\" TEXT,\\n \\"_sync_revision\\" INTEGER,\\n \\"id\\" UUID PRIMARY KEY NOT NULL,\\n \\"slug\\" TEXT NOT NULL,\\n \\"context\\" TEXT NOT NULL DEFAULT '',\\n \\"created_at\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\"updated_at\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\"tenant_id\\" UUID,\\n \\"report_class\\" TEXT,\\n \\"mode\\" TEXT NOT NULL,\\n \\"trigger\\" TEXT NOT NULL,\\n \\"args\\" JSON\\n);","columns":{"_sync_origin_device_id":{"type":"TEXT"},"_sync_revision":{"type":"INTEGER"},"id":{"type":"UUID","primaryKey":true,"referenceKind":"id","notNull":true},"slug":{"type":"TEXT","notNull":true},"context":{"type":"TEXT","notNull":true,"default":""},"created_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"updated_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"tenant_id":{"type":"UUID","referenceKind":"tenantId","notNull":false,"unique":false},"report_class":{"type":"TEXT","notNull":false,"unique":false},"mode":{"type":"TEXT","notNull":true,"unique":false},"trigger":{"type":"TEXT","notNull":true,"unique":false},"args":{"type":"JSON","notNull":false,"unique":false}},"indexes":[{"name":"_smrt_report_refresh_tasks_slug_context_idx","columns":["tenant_id","slug","context"],"unique":true,"nullsNotDistinct":true},{"name":"_smrt_report_refresh_tasks_tenant_id_created_at_idx","columns":["tenant_id","created_at"]}],"version":"f53f73ab"},"importPath":"@happyvertical/smrt-reports/scheduler"},"@happyvertical/smrt-reports:SmrtPrincipalReportRefreshTask":{"name":"smrtprincipalreportrefreshtask","className":"SmrtPrincipalReportRefreshTask","qualifiedName":"@happyvertical/smrt-reports:SmrtPrincipalReportRefreshTask","collection":"smrtprincipalreportrefreshtasks","description":"Worker target whose authority requirement cannot be downgraded by job args.","filePath":"src/scheduler.ts","packageName":"@happyvertical/smrt-reports","fields":{"tenantId":{"type":"text","_meta":{"__tenancy":{"isTenantIdField":true,"mode":"optional","field":"tenantId","autoFilter":true,"autoPopulate":true,"allowSuperAdminBypass":false},"__statedOptions":["sqlType","nullable","__tenancy","required","generated","source"],"required":false,"sqlType":"UUID","generated":true,"source":"tenantScoped_decorator"},"required":false},"reportClass":{"type":"text","_meta":{"__statedOptions":[]},"required":false},"mode":{"type":"text","_meta":{"__statedOptions":["required","backfill","enum"],"required":true,"backfill":"'incremental'"},"required":true,"enum":["rebuild","incremental"]},"trigger":{"type":"text","_meta":{"__statedOptions":["required","enum","backfill"],"required":true,"backfill":"'manual'"},"required":true,"enum":["manual","schedule","change","ttl","job"]},"args":{"type":"json","_meta":{"__statedOptions":[]},"required":false}},"methods":{"run":{"name":"run","async":true,"parameters":[{"name":"args","type":"ReportRefreshJobArgs","optional":true},{"name":"context","type":"JobExecutionContext","optional":true}],"returnType":"Promise<unknown>","isStatic":false,"isPublic":true}},"decoratorConfig":{"tableName":"_smrt_principal_report_refresh_tasks","api":false,"cli":{"include":["list","get"],"skipApiCheck":true,"http":false},"mcp":false,"tenantScoped":{"mode":"optional"},"conflictColumns":["tenant_id","slug","context"]},"extends":"SmrtReportRefreshTask","exportName":"SmrtPrincipalReportRefreshTask","collectionExportName":"SmrtPrincipalReportRefreshTaskCollection","validationRules":[{"field":"mode","rule":"required","fieldType":"text"},{"field":"trigger","rule":"required","fieldType":"text"}],"schema":{"tableName":"_smrt_principal_report_refresh_tasks","ddl":"CREATE TABLE IF NOT EXISTS \\"_smrt_principal_report_refresh_tasks\\" (\\n \\"_sync_origin_device_id\\" TEXT,\\n \\"_sync_revision\\" INTEGER,\\n \\"id\\" UUID PRIMARY KEY NOT NULL,\\n \\"slug\\" TEXT NOT NULL,\\n \\"context\\" TEXT NOT NULL DEFAULT '',\\n \\"created_at\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\"updated_at\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\"tenant_id\\" UUID,\\n \\"report_class\\" TEXT,\\n \\"mode\\" TEXT NOT NULL,\\n \\"trigger\\" TEXT NOT NULL,\\n \\"args\\" JSON\\n);","columns":{"_sync_origin_device_id":{"type":"TEXT"},"_sync_revision":{"type":"INTEGER"},"id":{"type":"UUID","primaryKey":true,"referenceKind":"id","notNull":true},"slug":{"type":"TEXT","notNull":true},"context":{"type":"TEXT","notNull":true,"default":""},"created_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"updated_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"tenant_id":{"type":"UUID","referenceKind":"tenantId","notNull":false,"unique":false},"report_class":{"type":"TEXT","notNull":false,"unique":false},"mode":{"type":"TEXT","notNull":true,"unique":false},"trigger":{"type":"TEXT","notNull":true,"unique":false},"args":{"type":"JSON","notNull":false,"unique":false}},"indexes":[{"name":"_smrt_principal_report_refresh_tasks_slug_context_idx","columns":["tenant_id","slug","context"],"unique":true,"nullsNotDistinct":true},{"name":"_smrt_principal_report_refresh_tasks_tenant_id_created_at_idx","columns":["tenant_id","created_at"]}],"version":"d90299c3"},"importPath":"@happyvertical/smrt-reports/scheduler"},"@happyvertical/smrt-reports:SmrtReportRun":{"name":"smrtreportrun","className":"SmrtReportRun","qualifiedName":"@happyvertical/smrt-reports:SmrtReportRun","collection":"smrtreportruns","filePath":"src/state.ts","packageName":"@happyvertical/smrt-reports","fields":{"tenantId":{"type":"text","_meta":{"__tenancy":{"isTenantIdField":true,"autoFilter":true,"required":false,"autoPopulate":true,"nullable":true,"mode":"optional","field":"tenantId","allowSuperAdminBypass":false},"__statedOptions":["sqlType","nullable","__tenancy","required"],"sqlType":"UUID","nullable":true,"required":false},"required":false},"scopeKey":{"type":"text","_meta":{"__statedOptions":["required"],"required":true},"required":true},"reportClass":{"type":"text","_meta":{"__statedOptions":["required","requiredFor"],"required":true,"requiredFor":"system-table"},"required":true},"sourceClass":{"type":"text","_meta":{"__statedOptions":[]},"required":false},"mode":{"type":"text","_meta":{"__statedOptions":["required","enum"],"required":true},"required":true,"enum":["rebuild","incremental"]},"trigger":{"type":"text","_meta":{"__statedOptions":["required","enum"],"required":true},"required":true,"enum":["manual","schedule","change","ttl","job"]},"status":{"type":"text","_meta":{"__statedOptions":["required","description","enum"],"required":true,"description":"Whether the refresh is running, finished, failed or was skipped."},"required":true,"description":"Whether the refresh is running, finished, failed or was skipped.","enum":["running","success","failed","skipped"]},"startedAt":{"type":"datetime","_meta":{"__statedOptions":["required","description"],"required":true,"description":"When the refresh began."},"required":true,"description":"When the refresh began."},"completedAt":{"type":"datetime","_meta":{"__statedOptions":["nullable","description","required"],"description":"When the refresh finished. Empty while it is still running.","nullable":true,"required":false},"required":false,"description":"When the refresh finished. Empty while it is still running."},"rowCount":{"type":"integer","_meta":{"__statedOptions":["required","description"],"required":true,"description":"How many rows the report held after the refresh."},"required":true,"description":"How many rows the report held after the refresh."},"changedGroupCount":{"type":"integer","_meta":{"__statedOptions":["required"],"required":true},"required":true},"watermarkBefore":{"type":"text","_meta":{"__statedOptions":["nullable","required"],"nullable":true,"required":false},"required":false},"watermarkAfter":{"type":"text","_meta":{"__statedOptions":["nullable","required"],"nullable":true,"required":false},"required":false},"error":{"type":"text","_meta":{"__statedOptions":["nullable","description","required"],"description":"Why the refresh failed. Empty when it worked.","nullable":true,"required":false},"required":false,"description":"Why the refresh failed. Empty when it worked."},"metadata":{"type":"json","_meta":{"__statedOptions":[]},"required":false}},"methods":{},"decoratorConfig":{"tableName":"_smrt_report_runs","api":false,"cli":{"include":["list","get"],"skipApiCheck":true,"http":false},"mcp":false,"tenantScoped":{"mode":"optional"},"conflictColumns":["tenant_id","slug","context"]},"extends":"SmrtObject","exportName":"SmrtReportRun","collectionExportName":"SmrtReportRunCollection","validationRules":[{"field":"scopeKey","rule":"required","fieldType":"text"},{"field":"reportClass","rule":"required","fieldType":"text"},{"field":"mode","rule":"required","fieldType":"text"},{"field":"trigger","rule":"required","fieldType":"text"},{"field":"status","rule":"required","fieldType":"text"},{"field":"startedAt","rule":"required","fieldType":"datetime"},{"field":"rowCount","rule":"required","fieldType":"integer"},{"field":"changedGroupCount","rule":"required","fieldType":"integer"}],"schema":{"tableName":"_smrt_report_runs","ddl":"CREATE TABLE IF NOT EXISTS \\"_smrt_report_runs\\" (\\n \\"_sync_origin_device_id\\" TEXT,\\n \\"_sync_revision\\" INTEGER,\\n \\"id\\" UUID PRIMARY KEY NOT NULL,\\n \\"slug\\" TEXT NOT NULL,\\n \\"context\\" TEXT NOT NULL DEFAULT '',\\n \\"created_at\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\"updated_at\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\"tenant_id\\" UUID,\\n \\"scope_key\\" TEXT NOT NULL,\\n \\"report_class\\" TEXT NOT NULL,\\n \\"source_class\\" TEXT,\\n \\"mode\\" TEXT NOT NULL,\\n \\"trigger\\" TEXT NOT NULL,\\n \\"status\\" TEXT NOT NULL,\\n \\"started_at\\" TIMESTAMP NOT NULL,\\n \\"completed_at\\" TIMESTAMP,\\n \\"row_count\\" INTEGER NOT NULL,\\n \\"changed_group_count\\" INTEGER NOT NULL,\\n \\"watermark_before\\" TEXT,\\n \\"watermark_after\\" TEXT,\\n \\"error\\" TEXT,\\n \\"metadata\\" JSON\\n);","columns":{"_sync_origin_device_id":{"type":"TEXT"},"_sync_revision":{"type":"INTEGER"},"id":{"type":"UUID","primaryKey":true,"referenceKind":"id","notNull":true},"slug":{"type":"TEXT","notNull":true},"context":{"type":"TEXT","notNull":true,"default":""},"created_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"updated_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"tenant_id":{"type":"UUID","referenceKind":"tenantId","notNull":false,"unique":false},"scope_key":{"type":"TEXT","notNull":true,"unique":false},"report_class":{"type":"TEXT","notNull":true,"unique":false},"source_class":{"type":"TEXT","notNull":false,"unique":false},"mode":{"type":"TEXT","notNull":true,"unique":false},"trigger":{"type":"TEXT","notNull":true,"unique":false},"status":{"type":"TEXT","notNull":true,"unique":false},"started_at":{"type":"TIMESTAMP","notNull":true,"unique":false},"completed_at":{"type":"TIMESTAMP","notNull":false,"unique":false},"row_count":{"type":"INTEGER","notNull":true,"unique":false},"changed_group_count":{"type":"INTEGER","notNull":true,"unique":false},"watermark_before":{"type":"TEXT","notNull":false,"unique":false},"watermark_after":{"type":"TEXT","notNull":false,"unique":false},"error":{"type":"TEXT","notNull":false,"unique":false},"metadata":{"type":"JSON","notNull":false,"unique":false}},"indexes":[{"name":"_smrt_report_runs_slug_context_idx","columns":["tenant_id","slug","context"],"unique":true,"nullsNotDistinct":true},{"name":"_smrt_report_runs_tenant_id_created_at_idx","columns":["tenant_id","created_at"]}],"version":"220b56ee"},"importPath":"@happyvertical/smrt-reports/state"},"@happyvertical/smrt-reports:SmrtReportRunCollection":{"name":"smrtreportruncollection","className":"SmrtReportRunCollection","qualifiedName":"@happyvertical/smrt-reports:SmrtReportRunCollection","collection":"smrtreportruns","filePath":"src/state.ts","packageName":"@happyvertical/smrt-reports","fields":{},"methods":{},"decoratorConfig":{"tableName":"_smrt_report_runs","api":false,"mcp":false,"cli":{"include":["list","get"],"skipApiCheck":true}},"extends":"SmrtCollection","extendsTypeArg":"SmrtReportRun","exportName":"SmrtReportRunCollection","collectionExportName":"SmrtReportRunCollectionCollection","collectionOf":"@happyvertical/smrt-reports:SmrtReportRun","inheritedExposure":["api","mcp","cli"],"schema":{"tableName":"_smrt_report_runs","ddl":"CREATE TABLE IF NOT EXISTS \\"_smrt_report_runs\\" (\\n \\"_sync_origin_device_id\\" TEXT,\\n \\"_sync_revision\\" INTEGER,\\n \\"id\\" UUID PRIMARY KEY NOT NULL,\\n \\"slug\\" TEXT NOT NULL,\\n \\"context\\" TEXT NOT NULL DEFAULT '',\\n \\"created_at\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\"updated_at\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\"tenant_id\\" UUID,\\n \\"scope_key\\" TEXT NOT NULL,\\n \\"report_class\\" TEXT NOT NULL,\\n \\"source_class\\" TEXT,\\n \\"mode\\" TEXT NOT NULL,\\n \\"trigger\\" TEXT NOT NULL,\\n \\"status\\" TEXT NOT NULL,\\n \\"started_at\\" TIMESTAMP NOT NULL,\\n \\"completed_at\\" TIMESTAMP,\\n \\"row_count\\" INTEGER NOT NULL,\\n \\"changed_group_count\\" INTEGER NOT NULL,\\n \\"watermark_before\\" TEXT,\\n \\"watermark_after\\" TEXT,\\n \\"error\\" TEXT,\\n \\"metadata\\" JSON\\n);","columns":{"_sync_origin_device_id":{"type":"TEXT"},"_sync_revision":{"type":"INTEGER"},"id":{"type":"UUID","primaryKey":true,"referenceKind":"id","notNull":true},"slug":{"type":"TEXT","notNull":true},"context":{"type":"TEXT","notNull":true,"default":""},"created_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"updated_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"tenant_id":{"type":"UUID","referenceKind":"tenantId","notNull":false,"unique":false},"scope_key":{"type":"TEXT","notNull":true,"unique":false},"report_class":{"type":"TEXT","notNull":true,"unique":false},"source_class":{"type":"TEXT","notNull":false,"unique":false},"mode":{"type":"TEXT","notNull":true,"unique":false},"trigger":{"type":"TEXT","notNull":true,"unique":false},"status":{"type":"TEXT","notNull":true,"unique":false},"started_at":{"type":"TIMESTAMP","notNull":true,"unique":false},"completed_at":{"type":"TIMESTAMP","notNull":false,"unique":false},"row_count":{"type":"INTEGER","notNull":true,"unique":false},"changed_group_count":{"type":"INTEGER","notNull":true,"unique":false},"watermark_before":{"type":"TEXT","notNull":false,"unique":false},"watermark_after":{"type":"TEXT","notNull":false,"unique":false},"error":{"type":"TEXT","notNull":false,"unique":false},"metadata":{"type":"JSON","notNull":false,"unique":false}},"indexes":[{"name":"_smrt_report_runs_slug_context_idx","columns":["tenant_id","slug","context"],"unique":true,"nullsNotDistinct":true},{"name":"_smrt_report_runs_tenant_id_created_at_idx","columns":["tenant_id","created_at"]}],"version":"220b56ee"},"importPath":"@happyvertical/smrt-reports/state"},"@happyvertical/smrt-reports:SmrtReportWatermark":{"name":"smrtreportwatermark","className":"SmrtReportWatermark","qualifiedName":"@happyvertical/smrt-reports:SmrtReportWatermark","collection":"smrtreportwatermarks","filePath":"src/state.ts","packageName":"@happyvertical/smrt-reports","fields":{"tenantId":{"type":"text","_meta":{"__tenancy":{"isTenantIdField":true,"autoFilter":true,"required":false,"autoPopulate":true,"nullable":true,"mode":"optional","field":"tenantId","allowSuperAdminBypass":false},"__statedOptions":["sqlType","nullable","__tenancy","required"],"sqlType":"UUID","nullable":true,"required":false},"required":false},"scopeKey":{"type":"text","_meta":{"__statedOptions":["required"],"required":true},"required":true},"reportClass":{"type":"text","_meta":{"__statedOptions":["required","requiredFor"],"required":true,"requiredFor":"system-table"},"required":true},"sourceClass":{"type":"text","_meta":{"__statedOptions":["required","requiredFor"],"required":true,"requiredFor":"system-table"},"required":true},"watermarkColumn":{"type":"text","_meta":{"__statedOptions":["required","requiredFor"],"required":true,"requiredFor":"system-table"},"required":true},"watermarkValue":{"type":"text","_meta":{"__statedOptions":["nullable","required"],"nullable":true,"required":false},"required":false},"lastRunId":{"type":"text","_meta":{"__statedOptions":["nullable","required"],"nullable":true,"required":false},"required":false}},"methods":{},"decoratorConfig":{"tableName":"_smrt_report_watermarks","conflictColumns":["report_class","scope_key","source_class","watermark_column"],"api":false,"cli":{"include":["list","get"],"skipApiCheck":true,"http":false},"mcp":false,"tenantScoped":{"mode":"optional"}},"extends":"SmrtObject","exportName":"SmrtReportWatermark","collectionExportName":"SmrtReportWatermarkCollection","validationRules":[{"field":"scopeKey","rule":"required","fieldType":"text"},{"field":"reportClass","rule":"required","fieldType":"text"},{"field":"sourceClass","rule":"required","fieldType":"text"},{"field":"watermarkColumn","rule":"required","fieldType":"text"}],"schema":{"tableName":"_smrt_report_watermarks","ddl":"CREATE TABLE IF NOT EXISTS \\"_smrt_report_watermarks\\" (\\n \\"_sync_origin_device_id\\" TEXT,\\n \\"_sync_revision\\" INTEGER,\\n \\"id\\" UUID PRIMARY KEY NOT NULL,\\n \\"slug\\" TEXT NOT NULL,\\n \\"context\\" TEXT NOT NULL DEFAULT '',\\n \\"created_at\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\"updated_at\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\"tenant_id\\" UUID,\\n \\"scope_key\\" TEXT NOT NULL,\\n \\"report_class\\" TEXT NOT NULL,\\n \\"source_class\\" TEXT NOT NULL,\\n \\"watermark_column\\" TEXT NOT NULL,\\n \\"watermark_value\\" TEXT,\\n \\"last_run_id\\" TEXT\\n);","columns":{"_sync_origin_device_id":{"type":"TEXT"},"_sync_revision":{"type":"INTEGER"},"id":{"type":"UUID","primaryKey":true,"referenceKind":"id","notNull":true},"slug":{"type":"TEXT","notNull":true},"context":{"type":"TEXT","notNull":true,"default":""},"created_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"updated_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"tenant_id":{"type":"UUID","referenceKind":"tenantId","notNull":false,"unique":false},"scope_key":{"type":"TEXT","notNull":true,"unique":false},"report_class":{"type":"TEXT","notNull":true,"unique":false},"source_class":{"type":"TEXT","notNull":true,"unique":false},"watermark_column":{"type":"TEXT","notNull":true,"unique":false},"watermark_value":{"type":"TEXT","notNull":false,"unique":false},"last_run_id":{"type":"TEXT","notNull":false,"unique":false}},"indexes":[{"name":"_smrt_report_watermarks_report_class_scope_key_idx","columns":["report_class","scope_key","source_class","watermark_column"],"unique":true},{"name":"_smrt_report_watermarks_slug_context_idx","columns":["slug","context"]},{"name":"_smrt_report_watermarks_tenant_id_created_at_idx","columns":["tenant_id","created_at"]}],"version":"a1bd37f4"},"importPath":"@happyvertical/smrt-reports/state"},"@happyvertical/smrt-reports:SmrtReportWatermarkCollection":{"name":"smrtreportwatermarkcollection","className":"SmrtReportWatermarkCollection","qualifiedName":"@happyvertical/smrt-reports:SmrtReportWatermarkCollection","collection":"smrtreportwatermarks","filePath":"src/state.ts","packageName":"@happyvertical/smrt-reports","fields":{},"methods":{},"decoratorConfig":{"tableName":"_smrt_report_watermarks","api":false,"mcp":false,"cli":{"include":["list","get"],"skipApiCheck":true}},"extends":"SmrtCollection","extendsTypeArg":"SmrtReportWatermark","exportName":"SmrtReportWatermarkCollection","collectionExportName":"SmrtReportWatermarkCollectionCollection","collectionOf":"@happyvertical/smrt-reports:SmrtReportWatermark","inheritedExposure":["api","mcp","cli"],"schema":{"tableName":"_smrt_report_watermarks","ddl":"CREATE TABLE IF NOT EXISTS \\"_smrt_report_watermarks\\" (\\n \\"_sync_origin_device_id\\" TEXT,\\n \\"_sync_revision\\" INTEGER,\\n \\"id\\" UUID PRIMARY KEY NOT NULL,\\n \\"slug\\" TEXT NOT NULL,\\n \\"context\\" TEXT NOT NULL DEFAULT '',\\n \\"created_at\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\"updated_at\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\"tenant_id\\" UUID,\\n \\"scope_key\\" TEXT NOT NULL,\\n \\"report_class\\" TEXT NOT NULL,\\n \\"source_class\\" TEXT NOT NULL,\\n \\"watermark_column\\" TEXT NOT NULL,\\n \\"watermark_value\\" TEXT,\\n \\"last_run_id\\" TEXT\\n);","columns":{"_sync_origin_device_id":{"type":"TEXT"},"_sync_revision":{"type":"INTEGER"},"id":{"type":"UUID","primaryKey":true,"referenceKind":"id","notNull":true},"slug":{"type":"TEXT","notNull":true},"context":{"type":"TEXT","notNull":true,"default":""},"created_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"updated_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"tenant_id":{"type":"UUID","referenceKind":"tenantId","notNull":false,"unique":false},"scope_key":{"type":"TEXT","notNull":true,"unique":false},"report_class":{"type":"TEXT","notNull":true,"unique":false},"source_class":{"type":"TEXT","notNull":true,"unique":false},"watermark_column":{"type":"TEXT","notNull":true,"unique":false},"watermark_value":{"type":"TEXT","notNull":false,"unique":false},"last_run_id":{"type":"TEXT","notNull":false,"unique":false}},"indexes":[{"name":"_smrt_report_watermarks_report_class_scope_key_idx","columns":["report_class","scope_key","source_class","watermark_column"],"unique":true},{"name":"_smrt_report_watermarks_slug_context_idx","columns":["slug","context"]},{"name":"_smrt_report_watermarks_tenant_id_created_at_idx","columns":["tenant_id","created_at"]}],"version":"a1bd37f4"},"importPath":"@happyvertical/smrt-reports/state"},"@happyvertical/smrt-reports:SmrtReportLock":{"name":"smrtreportlock","className":"SmrtReportLock","qualifiedName":"@happyvertical/smrt-reports:SmrtReportLock","collection":"smrtreportlocks","filePath":"src/state.ts","packageName":"@happyvertical/smrt-reports","fields":{"tenantId":{"type":"text","_meta":{"__tenancy":{"isTenantIdField":true,"autoFilter":true,"required":false,"autoPopulate":true,"nullable":true,"mode":"optional","field":"tenantId","allowSuperAdminBypass":false},"__statedOptions":["sqlType","nullable","__tenancy","required"],"sqlType":"UUID","nullable":true,"required":false},"required":false},"scopeKey":{"type":"text","_meta":{"__statedOptions":["required"],"required":true},"required":true},"reportClass":{"type":"text","_meta":{"__statedOptions":["required","requiredFor"],"required":true,"requiredFor":"system-table"},"required":true},"ownerId":{"type":"text","_meta":{"__statedOptions":["nullable","required"],"nullable":true,"required":false},"required":false},"acquiredAt":{"type":"datetime","_meta":{"__statedOptions":["nullable","required"],"nullable":true,"required":false},"required":false},"heartbeatAt":{"type":"datetime","_meta":{"__statedOptions":["nullable","required"],"nullable":true,"required":false},"required":false},"expiresAt":{"type":"datetime","_meta":{"__statedOptions":["nullable","required"],"nullable":true,"required":false},"required":false}},"methods":{},"decoratorConfig":{"tableName":"_smrt_report_locks","conflictColumns":["report_class","scope_key"],"api":false,"cli":{"include":["list","get"],"skipApiCheck":true,"http":false},"mcp":false,"tenantScoped":{"mode":"optional"}},"extends":"SmrtObject","exportName":"SmrtReportLock","collectionExportName":"SmrtReportLockCollection","validationRules":[{"field":"scopeKey","rule":"required","fieldType":"text"},{"field":"reportClass","rule":"required","fieldType":"text"}],"schema":{"tableName":"_smrt_report_locks","ddl":"CREATE TABLE IF NOT EXISTS \\"_smrt_report_locks\\" (\\n \\"_sync_origin_device_id\\" TEXT,\\n \\"_sync_revision\\" INTEGER,\\n \\"id\\" UUID PRIMARY KEY NOT NULL,\\n \\"slug\\" TEXT NOT NULL,\\n \\"context\\" TEXT NOT NULL DEFAULT '',\\n \\"created_at\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\"updated_at\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\"tenant_id\\" UUID,\\n \\"scope_key\\" TEXT NOT NULL,\\n \\"report_class\\" TEXT NOT NULL,\\n \\"owner_id\\" TEXT,\\n \\"acquired_at\\" TIMESTAMP,\\n \\"heartbeat_at\\" TIMESTAMP,\\n \\"expires_at\\" TIMESTAMP\\n);","columns":{"_sync_origin_device_id":{"type":"TEXT"},"_sync_revision":{"type":"INTEGER"},"id":{"type":"UUID","primaryKey":true,"referenceKind":"id","notNull":true},"slug":{"type":"TEXT","notNull":true},"context":{"type":"TEXT","notNull":true,"default":""},"created_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"updated_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"tenant_id":{"type":"UUID","referenceKind":"tenantId","notNull":false,"unique":false},"scope_key":{"type":"TEXT","notNull":true,"unique":false},"report_class":{"type":"TEXT","notNull":true,"unique":false},"owner_id":{"type":"TEXT","notNull":false,"unique":false},"acquired_at":{"type":"TIMESTAMP","notNull":false,"unique":false},"heartbeat_at":{"type":"TIMESTAMP","notNull":false,"unique":false},"expires_at":{"type":"TIMESTAMP","notNull":false,"unique":false}},"indexes":[{"name":"_smrt_report_locks_report_class_scope_key_idx","columns":["report_class","scope_key"],"unique":true},{"name":"_smrt_report_locks_slug_context_idx","columns":["slug","context"]},{"name":"_smrt_report_locks_tenant_id_created_at_idx","columns":["tenant_id","created_at"]}],"version":"1df076b7"},"importPath":"@happyvertical/smrt-reports/state"},"@happyvertical/smrt-reports:SmrtReportLockCollection":{"name":"smrtreportlockcollection","className":"SmrtReportLockCollection","qualifiedName":"@happyvertical/smrt-reports:SmrtReportLockCollection","collection":"smrtreportlocks","filePath":"src/state.ts","packageName":"@happyvertical/smrt-reports","fields":{},"methods":{},"decoratorConfig":{"tableName":"_smrt_report_locks","api":false,"mcp":false,"cli":{"include":["list","get"],"skipApiCheck":true}},"extends":"SmrtCollection","extendsTypeArg":"SmrtReportLock","exportName":"SmrtReportLockCollection","collectionExportName":"SmrtReportLockCollectionCollection","collectionOf":"@happyvertical/smrt-reports:SmrtReportLock","inheritedExposure":["api","mcp","cli"],"schema":{"tableName":"_smrt_report_locks","ddl":"CREATE TABLE IF NOT EXISTS \\"_smrt_report_locks\\" (\\n \\"_sync_origin_device_id\\" TEXT,\\n \\"_sync_revision\\" INTEGER,\\n \\"id\\" UUID PRIMARY KEY NOT NULL,\\n \\"slug\\" TEXT NOT NULL,\\n \\"context\\" TEXT NOT NULL DEFAULT '',\\n \\"created_at\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\"updated_at\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\"tenant_id\\" UUID,\\n \\"scope_key\\" TEXT NOT NULL,\\n \\"report_class\\" TEXT NOT NULL,\\n \\"owner_id\\" TEXT,\\n \\"acquired_at\\" TIMESTAMP,\\n \\"heartbeat_at\\" TIMESTAMP,\\n \\"expires_at\\" TIMESTAMP\\n);","columns":{"_sync_origin_device_id":{"type":"TEXT"},"_sync_revision":{"type":"INTEGER"},"id":{"type":"UUID","primaryKey":true,"referenceKind":"id","notNull":true},"slug":{"type":"TEXT","notNull":true},"context":{"type":"TEXT","notNull":true,"default":""},"created_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"updated_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"tenant_id":{"type":"UUID","referenceKind":"tenantId","notNull":false,"unique":false},"scope_key":{"type":"TEXT","notNull":true,"unique":false},"report_class":{"type":"TEXT","notNull":true,"unique":false},"owner_id":{"type":"TEXT","notNull":false,"unique":false},"acquired_at":{"type":"TIMESTAMP","notNull":false,"unique":false},"heartbeat_at":{"type":"TIMESTAMP","notNull":false,"unique":false},"expires_at":{"type":"TIMESTAMP","notNull":false,"unique":false}},"indexes":[{"name":"_smrt_report_locks_report_class_scope_key_idx","columns":["report_class","scope_key"],"unique":true},{"name":"_smrt_report_locks_slug_context_idx","columns":["slug","context"]},{"name":"_smrt_report_locks_tenant_id_created_at_idx","columns":["tenant_id","created_at"]}],"version":"1df076b7"},"importPath":"@happyvertical/smrt-reports/state"},"@happyvertical/smrt-reports:SmrtReportSchedule":{"name":"smrtreportschedule","className":"SmrtReportSchedule","qualifiedName":"@happyvertical/smrt-reports:SmrtReportSchedule","collection":"smrtreportschedules","filePath":"src/state.ts","packageName":"@happyvertical/smrt-reports","fields":{"tenantId":{"type":"text","_meta":{"__tenancy":{"isTenantIdField":true,"autoFilter":true,"required":false,"autoPopulate":true,"nullable":true,"mode":"optional","field":"tenantId","allowSuperAdminBypass":false},"__statedOptions":["sqlType","nullable","__tenancy","required"],"sqlType":"UUID","nullable":true,"required":false},"required":false},"scopeKey":{"type":"text","_meta":{"__statedOptions":["required"],"required":true},"required":true},"reportClass":{"type":"text","_meta":{"__statedOptions":["required","requiredFor"],"required":true,"requiredFor":"system-table"},"required":true},"cron":{"type":"text","_meta":{"__statedOptions":["required","requiredFor","description"],"required":true,"description":"When the report refreshes, as a cron schedule such as 0 6 * * * for 6 am daily.","requiredFor":"system-table"},"required":true,"description":"When the report refreshes, as a cron schedule such as 0 6 * * * for 6 am daily."},"trigger":{"type":"text","_meta":{"__statedOptions":["required","enum"],"required":true},"required":true,"enum":["manual","schedule","change","ttl","job"]},"mode":{"type":"text","_meta":{"__statedOptions":["required","description","enum"],"required":true,"description":"Rebuild recomputes the whole report. Incremental updates only what changed."},"required":true,"description":"Rebuild recomputes the whole report. Incremental updates only what changed.","enum":["rebuild","incremental"]},"enabled":{"type":"boolean","_meta":{"__statedOptions":["required","description"],"required":true,"description":"Turn off to stop refreshing without deleting the schedule."},"required":true,"description":"Turn off to stop refreshing without deleting the schedule."},"status":{"type":"text","_meta":{"__statedOptions":["required","description","enum"],"required":true,"description":"Whether the schedule is active, paused, disabled or in error."},"required":true,"description":"Whether the schedule is active, paused, disabled or in error.","enum":["active","paused","disabled","error"]},"nextRun":{"type":"datetime","_meta":{"__statedOptions":["nullable","description","required"],"description":"When the report is next due to refresh.","nullable":true,"required":false},"required":false,"description":"When the report is next due to refresh."},"lastRun":{"type":"datetime","_meta":{"__statedOptions":["nullable","description","required"],"description":"When the report last started a scheduled refresh.","nullable":true,"required":false},"required":false,"description":"When the report last started a scheduled refresh."},"lastStatus":{"type":"text","_meta":{"__statedOptions":["nullable","description","enum","required"],"description":"Whether the last scheduled refresh worked or failed.","nullable":true,"required":false},"required":false,"description":"Whether the last scheduled refresh worked or failed.","enum":["success","failed"]},"lastError":{"type":"text","_meta":{"__statedOptions":["nullable","description","required"],"description":"Why the last scheduled refresh failed. Empty when it worked.","nullable":true,"required":false},"required":false,"description":"Why the last scheduled refresh failed. Empty when it worked."},"runCount":{"type":"integer","_meta":{"__statedOptions":["required"],"required":true},"required":true},"successCount":{"type":"integer","_meta":{"__statedOptions":["required"],"required":true},"required":true},"failureCount":{"type":"integer","_meta":{"__statedOptions":["required"],"required":true},"required":true},"runningCount":{"type":"integer","_meta":{"__statedOptions":["required"],"required":true},"required":true},"maxConcurrent":{"type":"integer","_meta":{"__statedOptions":["required"],"required":true},"required":true},"queue":{"type":"text","_meta":{"__statedOptions":["required"],"required":true},"required":true},"priority":{"type":"integer","_meta":{"__statedOptions":["required"],"required":true},"required":true},"timeout":{"type":"integer","_meta":{"__statedOptions":["required"],"required":true},"required":true}},"methods":{},"decoratorConfig":{"tableName":"_smrt_report_schedules","conflictColumns":["report_class","scope_key","cron","mode"],"api":false,"cli":{"include":["list","get"],"skipApiCheck":true,"http":false},"mcp":false,"tenantScoped":{"mode":"optional"}},"extends":"SmrtObject","exportName":"SmrtReportSchedule","collectionExportName":"SmrtReportScheduleCollection","validationRules":[{"field":"scopeKey","rule":"required","fieldType":"text"},{"field":"reportClass","rule":"required","fieldType":"text"},{"field":"cron","rule":"required","fieldType":"text"},{"field":"trigger","rule":"required","fieldType":"text"},{"field":"mode","rule":"required","fieldType":"text"},{"field":"enabled","rule":"required","fieldType":"boolean"},{"field":"status","rule":"required","fieldType":"text"},{"field":"runCount","rule":"required","fieldType":"integer"},{"field":"successCount","rule":"required","fieldType":"integer"},{"field":"failureCount","rule":"required","fieldType":"integer"},{"field":"runningCount","rule":"required","fieldType":"integer"},{"field":"maxConcurrent","rule":"required","fieldType":"integer"},{"field":"queue","rule":"required","fieldType":"text"},{"field":"priority","rule":"required","fieldType":"integer"},{"field":"timeout","rule":"required","fieldType":"integer"}],"schema":{"tableName":"_smrt_report_schedules","ddl":"CREATE TABLE IF NOT EXISTS \\"_smrt_report_schedules\\" (\\n \\"_sync_origin_device_id\\" TEXT,\\n \\"_sync_revision\\" INTEGER,\\n \\"id\\" UUID PRIMARY KEY NOT NULL,\\n \\"slug\\" TEXT NOT NULL,\\n \\"context\\" TEXT NOT NULL DEFAULT '',\\n \\"created_at\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\"updated_at\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\"tenant_id\\" UUID,\\n \\"scope_key\\" TEXT NOT NULL,\\n \\"report_class\\" TEXT NOT NULL,\\n \\"cron\\" TEXT NOT NULL,\\n \\"trigger\\" TEXT NOT NULL,\\n \\"mode\\" TEXT NOT NULL,\\n \\"enabled\\" BOOLEAN NOT NULL,\\n \\"status\\" TEXT NOT NULL,\\n \\"next_run\\" TIMESTAMP,\\n \\"last_run\\" TIMESTAMP,\\n \\"last_status\\" TEXT,\\n \\"last_error\\" TEXT,\\n \\"run_count\\" INTEGER NOT NULL,\\n \\"success_count\\" INTEGER NOT NULL,\\n \\"failure_count\\" INTEGER NOT NULL,\\n \\"running_count\\" INTEGER NOT NULL,\\n \\"max_concurrent\\" INTEGER NOT NULL,\\n \\"queue\\" TEXT NOT NULL,\\n \\"priority\\" INTEGER NOT NULL,\\n \\"timeout\\" INTEGER NOT NULL\\n);","columns":{"_sync_origin_device_id":{"type":"TEXT"},"_sync_revision":{"type":"INTEGER"},"id":{"type":"UUID","primaryKey":true,"referenceKind":"id","notNull":true},"slug":{"type":"TEXT","notNull":true},"context":{"type":"TEXT","notNull":true,"default":""},"created_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"updated_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"tenant_id":{"type":"UUID","referenceKind":"tenantId","notNull":false,"unique":false},"scope_key":{"type":"TEXT","notNull":true,"unique":false},"report_class":{"type":"TEXT","notNull":true,"unique":false},"cron":{"type":"TEXT","notNull":true,"unique":false},"trigger":{"type":"TEXT","notNull":true,"unique":false},"mode":{"type":"TEXT","notNull":true,"unique":false},"enabled":{"type":"BOOLEAN","notNull":true,"unique":false},"status":{"type":"TEXT","notNull":true,"unique":false},"next_run":{"type":"TIMESTAMP","notNull":false,"unique":false},"last_run":{"type":"TIMESTAMP","notNull":false,"unique":false},"last_status":{"type":"TEXT","notNull":false,"unique":false},"last_error":{"type":"TEXT","notNull":false,"unique":false},"run_count":{"type":"INTEGER","notNull":true,"unique":false},"success_count":{"type":"INTEGER","notNull":true,"unique":false},"failure_count":{"type":"INTEGER","notNull":true,"unique":false},"running_count":{"type":"INTEGER","notNull":true,"unique":false},"max_concurrent":{"type":"INTEGER","notNull":true,"unique":false},"queue":{"type":"TEXT","notNull":true,"unique":false},"priority":{"type":"INTEGER","notNull":true,"unique":false},"timeout":{"type":"INTEGER","notNull":true,"unique":false}},"indexes":[{"name":"_smrt_report_schedules_report_class_scope_key_idx","columns":["report_class","scope_key","cron","mode"],"unique":true},{"name":"_smrt_report_schedules_slug_context_idx","columns":["slug","context"]},{"name":"_smrt_report_schedules_tenant_id_created_at_idx","columns":["tenant_id","created_at"]}],"version":"372c07ab"},"importPath":"@happyvertical/smrt-reports/state"},"@happyvertical/smrt-reports:SmrtReportScheduleCollection":{"name":"smrtreportschedulecollection","className":"SmrtReportScheduleCollection","qualifiedName":"@happyvertical/smrt-reports:SmrtReportScheduleCollection","collection":"smrtreportschedules","filePath":"src/state.ts","packageName":"@happyvertical/smrt-reports","fields":{},"methods":{},"decoratorConfig":{"tableName":"_smrt_report_schedules","api":false,"mcp":false,"cli":{"include":["list","get"],"skipApiCheck":true}},"extends":"SmrtCollection","extendsTypeArg":"SmrtReportSchedule","exportName":"SmrtReportScheduleCollection","collectionExportName":"SmrtReportScheduleCollectionCollection","collectionOf":"@happyvertical/smrt-reports:SmrtReportSchedule","inheritedExposure":["api","mcp","cli"],"schema":{"tableName":"_smrt_report_schedules","ddl":"CREATE TABLE IF NOT EXISTS \\"_smrt_report_schedules\\" (\\n \\"_sync_origin_device_id\\" TEXT,\\n \\"_sync_revision\\" INTEGER,\\n \\"id\\" UUID PRIMARY KEY NOT NULL,\\n \\"slug\\" TEXT NOT NULL,\\n \\"context\\" TEXT NOT NULL DEFAULT '',\\n \\"created_at\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\"updated_at\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\"tenant_id\\" UUID,\\n \\"scope_key\\" TEXT NOT NULL,\\n \\"report_class\\" TEXT NOT NULL,\\n \\"cron\\" TEXT NOT NULL,\\n \\"trigger\\" TEXT NOT NULL,\\n \\"mode\\" TEXT NOT NULL,\\n \\"enabled\\" BOOLEAN NOT NULL,\\n \\"status\\" TEXT NOT NULL,\\n \\"next_run\\" TIMESTAMP,\\n \\"last_run\\" TIMESTAMP,\\n \\"last_status\\" TEXT,\\n \\"last_error\\" TEXT,\\n \\"run_count\\" INTEGER NOT NULL,\\n \\"success_count\\" INTEGER NOT NULL,\\n \\"failure_count\\" INTEGER NOT NULL,\\n \\"running_count\\" INTEGER NOT NULL,\\n \\"max_concurrent\\" INTEGER NOT NULL,\\n \\"queue\\" TEXT NOT NULL,\\n \\"priority\\" INTEGER NOT NULL,\\n \\"timeout\\" INTEGER NOT NULL\\n);","columns":{"_sync_origin_device_id":{"type":"TEXT"},"_sync_revision":{"type":"INTEGER"},"id":{"type":"UUID","primaryKey":true,"referenceKind":"id","notNull":true},"slug":{"type":"TEXT","notNull":true},"context":{"type":"TEXT","notNull":true,"default":""},"created_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"updated_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"tenant_id":{"type":"UUID","referenceKind":"tenantId","notNull":false,"unique":false},"scope_key":{"type":"TEXT","notNull":true,"unique":false},"report_class":{"type":"TEXT","notNull":true,"unique":false},"cron":{"type":"TEXT","notNull":true,"unique":false},"trigger":{"type":"TEXT","notNull":true,"unique":false},"mode":{"type":"TEXT","notNull":true,"unique":false},"enabled":{"type":"BOOLEAN","notNull":true,"unique":false},"status":{"type":"TEXT","notNull":true,"unique":false},"next_run":{"type":"TIMESTAMP","notNull":false,"unique":false},"last_run":{"type":"TIMESTAMP","notNull":false,"unique":false},"last_status":{"type":"TEXT","notNull":false,"unique":false},"last_error":{"type":"TEXT","notNull":false,"unique":false},"run_count":{"type":"INTEGER","notNull":true,"unique":false},"success_count":{"type":"INTEGER","notNull":true,"unique":false},"failure_count":{"type":"INTEGER","notNull":true,"unique":false},"running_count":{"type":"INTEGER","notNull":true,"unique":false},"max_concurrent":{"type":"INTEGER","notNull":true,"unique":false},"queue":{"type":"TEXT","notNull":true,"unique":false},"priority":{"type":"INTEGER","notNull":true,"unique":false},"timeout":{"type":"INTEGER","notNull":true,"unique":false}},"indexes":[{"name":"_smrt_report_schedules_report_class_scope_key_idx","columns":["report_class","scope_key","cron","mode"],"unique":true},{"name":"_smrt_report_schedules_slug_context_idx","columns":["slug","context"]},{"name":"_smrt_report_schedules_tenant_id_created_at_idx","columns":["tenant_id","created_at"]}],"version":"372c07ab"},"importPath":"@happyvertical/smrt-reports/state"}},"moduleType":"smrt","recipes":[{"id":"reports.materialized","className":"MaterializedReportsRecipe","label":"Scheduled reports","summary":"Keep totals and trends ready to read, refreshed on a schedule and open to the assistant.","synonyms":["rollups","kpis","refresh schedule","materialized"],"models":["@happyvertical/smrt-reports:SmrtReportRun","@happyvertical/smrt-reports:SmrtReportWatermark","@happyvertical/smrt-reports:SmrtReportLock","@happyvertical/smrt-reports:SmrtReportSchedule","@happyvertical/smrt-reports:SmrtReportRefreshTask","@happyvertical/smrt-reports:SmrtPrincipalReportRefreshTask"],"nav":[],"requires":[],"help":{"markdown":"## Overview\\n\\nReports keep totals and trends, such as revenue by month or signups by week,\\nworked out ahead of time so they open instantly. Someone on your team sets up\\neach report once. This feature then records when each report was last\\nrefreshed, how that went, and when it runs next.\\n\\nReports are calculated on your server, never in the browser, so this feature\\nneeds your app's database.\\n\\n## Tasks\\n\\n### Ask the assistant about a report\\n\\n1. Ask in plain words, for example \\"what was revenue last month?\\".\\n2. The assistant looks up the reports your account may see\\n (\`data.discover\`, \`data.inspect\`), then reads rows with \`reports.query\`.\\n It only ever sees the columns and the customer data you are allowed to see.\\n3. If the numbers look old, ask how fresh the report is. The answer says when\\n it was last refreshed.\\n4. Ask the assistant to refresh a stale report. It previews the refresh with\\n \`reports.refresh\` and your app decides who may apply it.\\n\\nThe assistant offers these tools only when your app has switched them on.\\n\\n### Ask a question no report covers\\n\\n1. Describe what you want to see, for example \\"orders by status this quarter\\".\\n2. The assistant checks what it may report on (\`reports.runtime.sources\`) and\\n shows a preview of the report it would save (\`reports.runtime.define\`).\\n3. Nothing is saved until you confirm that exact report.\\n4. Open it again later with \`reports.runtime.list\` and \`reports.runtime.run\`.\\n\\nThese reports are worked out live each time and their rows are never stored.\\nThey are not refreshed in the background. A report that people open every day\\nis worth asking your team to set up as a refreshed report instead.\\n\\n### Keep a report fresh\\n\\n1. Ask your team how the report refreshes: by hand, on a schedule, after the\\n data changes, or when it goes out of date.\\n2. A scheduled report repeats on its **{field:SmrtReportSchedule.cron}**, either\\n rebuilding everything or updating only what changed, per its\\n **{field:SmrtReportSchedule.mode}**.\\n3. Turn **{field:SmrtReportSchedule.enabled}** off to pause a schedule without\\n losing it.\\n4. **{field:SmrtReportSchedule.nextRun}** shows when it is next due.\\n\\n### Check that a refresh worked\\n\\n1. Look at the latest run for the report. **{field:SmrtReportRun.status}**\\n says whether it is running, finished, failed or skipped.\\n2. **{field:SmrtReportRun.completedAt}** and **{field:SmrtReportRun.rowCount}**\\n show when it finished and how many rows it holds.\\n3. If it failed, **{field:SmrtReportRun.error}** says why.\\n","fieldRefs":["SmrtReportRun.completedAt","SmrtReportRun.error","SmrtReportRun.rowCount","SmrtReportRun.status","SmrtReportSchedule.cron","SmrtReportSchedule.enabled","SmrtReportSchedule.mode","SmrtReportSchedule.nextRun"]},"runtime":"server","demo":{"mode":"server","reasons":["The recipe declares runtime \\"server\\".","Needs a server because its package does not build for a browser: node:crypto/events; @happyvertical/sql root: the sync query builders it needs (validateColumnName, buildWhere, buildAggregate, bucketExpr, tableExists) have no browser-safe SDK entry; and its package depends on @happyvertical/smrt-jobs, @happyvertical/smrt-tenancy, which do not build for a browser (#3615, #3624, #3625, #3627)."]}},{"id":"reports.runtime","className":"RuntimeReportsRecipe","label":"Reports","summary":"Ask for a report, approve it, and share its live totals with your team.","synonyms":["report","summary","summaries","totals","trends","dashboards"],"models":["@happyvertical/smrt-reports:RuntimeReport"],"nav":[{"label":"Saved reports","model":"@happyvertical/smrt-reports:RuntimeReport","icon":"fileText","description":"Reports your team approved, kept up to date.","noun":"report"}],"requires":[],"help":{"markdown":"# Reports\\n\\nAsk the assistant for a total, comparison, or trend. Review the proposed report\\nand approve it to save it. Your saved reports are shared with your team; each\\nperson sees results using their own access to the underlying information.\\n\\nReports run fresh when opened. You can archive a report to hide it from the\\nactive list and restore it later. Creating and restoring reports needs report\\nwriting access. Reports need a connected server; the smrt planner previews them over its\\nsample records instead. Scheduling, renaming, and exporting reports are not available yet.\\n","fieldRefs":[]},"surfaces":[{"kind":"widget","type":"saved-reports","export":"@happyvertical/smrt-reports/svelte#SavedReportsWidget","label":"Saved reports","description":"Your team\u2019s saved reports with their latest figures.","icon":"fileText","options":[{"key":"limit","type":"integer","label":"Reports shown","default":6,"min":1,"max":24}],"sectionDefault":true,"defaultSpan":4,"minSpan":2,"maxSpan":4},{"kind":"route","path":"/reports","export":"@happyvertical/smrt-reports/svelte#RuntimeReportsRoute","label":"Reports"},{"kind":"route","path":"/reports/:id","export":"@happyvertical/smrt-reports/svelte#RuntimeReportDetailRoute","label":"Report detail"},{"kind":"widget","type":"runtime-report-chart","export":"@happyvertical/smrt-reports/svelte#RuntimeReportChartWidget","label":"Report chart","description":"Chart a measure from a saved report.","icon":"chart","optionsEditor":"@happyvertical/smrt-reports/svelte#RuntimeReportWidgetOptions","options":[{"key":"reportId","type":"text","label":"Report","required":true},{"key":"measure","type":"identifier","label":"Measure","required":true},{"key":"dimension","type":"identifier","label":"Dimension"}],"data":{"load":"@happyvertical/smrt-reports#loadRuntimeReportChart","models":["@happyvertical/smrt-reports:RuntimeReport"]},"defaultSpan":2,"maxSpan":4}],"runtime":"server","demo":{"mode":"server","reasons":["The recipe declares runtime \\"server\\".","Needs a server because its package does not build for a browser: node:crypto/events; @happyvertical/sql root: the sync query builders it needs (validateColumnName, buildWhere, buildAggregate, bucketExpr, tableExists) have no browser-safe SDK entry; and its package depends on @happyvertical/smrt-jobs, @happyvertical/smrt-tenancy, which do not build for a browser (#3615, #3624, #3625, #3627)."]}}],"smrtDependencies":["@happyvertical/smrt-core","@happyvertical/smrt-jobs","@happyvertical/smrt-tenancy"],"browser":{"status":"server-only","issues":["#3615","#3624","#3625","#3627"],"reason":"node:crypto/events; @happyvertical/sql root: the sync query builders it needs (validateColumnName, buildWhere, buildAggregate, bucketExpr, tableExists) have no browser-safe SDK entry","via":["@happyvertical/smrt-jobs","@happyvertical/smrt-tenancy"]},"stampsConstructors":true}`));
|
|
4
|
+
ObjectRegistry.registerPackageManifest(JSON.parse(`{"version":"1.0.0","timestamp":0,"packageName":"@happyvertical/smrt-reports","packageVersion":"0.62.4","objects":{"@happyvertical/smrt-reports:SmrtReport":{"name":"smrtreport","className":"SmrtReport","qualifiedName":"@happyvertical/smrt-reports:SmrtReport","collection":"smrtreports","filePath":"src/report.ts","packageName":"@happyvertical/smrt-reports","fields":{"refreshedAt":{"type":"datetime","_meta":{"__statedOptions":[]},"required":false}},"methods":{"isStale":{"name":"isStale","async":false,"parameters":[{"name":"ttlMs","type":"number","optional":true}],"returnType":"boolean","isStatic":false,"isPublic":true},"refresh":{"name":"refresh","async":true,"parameters":[{"name":"options","type":"Omit<ReportRefreshOptions, 'db'>","optional":true}],"returnType":"Promise<ReportRefreshResult>","isStatic":false,"isPublic":true}},"decoratorConfig":{},"extends":"SmrtObject","exportName":"SmrtReport","collectionExportName":"SmrtReportCollection","importPath":"@happyvertical/smrt-reports"},"@happyvertical/smrt-reports:SmrtReportCollection":{"name":"smrtreportcollection","className":"SmrtReportCollection","qualifiedName":"@happyvertical/smrt-reports:SmrtReportCollection","collection":"smrtreports","filePath":"src/report.ts","packageName":"@happyvertical/smrt-reports","fields":{},"methods":{"refresh":{"name":"refresh","async":true,"parameters":[{"name":"options","type":"Omit<ReportRefreshOptions, 'db'>","optional":true}],"returnType":"Promise<ReportRefreshResult>","isStatic":false,"isPublic":true},"list":{"name":"list","async":true,"parameters":[{"name":"options","type":"SmrtListOptions<ModelType>","optional":true}],"returnType":"Promise<SmrtObject[] | Record<string, unknown>[]>","isStatic":false,"isPublic":true},"get":{"name":"get","async":true,"parameters":[{"name":"filter","type":"any","optional":false,"typeUnresolved":true},{"name":"options","type":"any","optional":true,"typeUnresolved":true}],"returnType":"Promise<ModelType | null>","isStatic":false,"isPublic":true}},"decoratorConfig":{},"extends":"SmrtCollection","extendsTypeArg":"ModelType","exportName":"SmrtReportCollection","collectionExportName":"SmrtReportCollectionCollection","collectionOf":"@happyvertical/smrt-reports:SmrtReport","importPath":"@happyvertical/smrt-reports"},"@happyvertical/smrt-reports:RuntimeReport":{"name":"runtimereport","className":"RuntimeReport","qualifiedName":"@happyvertical/smrt-reports:RuntimeReport","collection":"runtimereports","filePath":"src/runtime-report.ts","packageName":"@happyvertical/smrt-reports","fields":{"tenantId":{"type":"text","_meta":{"__tenancy":{"isTenantIdField":true,"autoFilter":true,"required":true,"autoPopulate":true,"nullable":false,"mode":"required","field":"tenantId","allowSuperAdminBypass":false},"__statedOptions":["sqlType","requiredFor","__tenancy"],"sqlType":"UUID","requiredFor":"tenant-scope"},"required":true},"title":{"type":"text","_meta":{"__statedOptions":[]},"required":false},"description":{"type":"text","_meta":{"__statedOptions":[]},"required":false},"sourceId":{"type":"text","_meta":{"__statedOptions":[]},"required":false},"spec":{"type":"text","_meta":{"__statedOptions":["required","requiredFor"],"required":true,"requiredFor":"integrity"},"required":true},"specHash":{"type":"text","_meta":{"__statedOptions":[]},"required":false},"status":{"type":"text","_meta":{"__statedOptions":["required","enum"],"required":true},"required":true,"enum":["active","archived"]},"createdByUserId":{"type":"text","_meta":{"__statedOptions":[]},"required":false}},"methods":{"run":{"name":"run","async":true,"parameters":[],"returnType":"Promise<RuntimeReportResult>","isStatic":false,"isPublic":true},"archive":{"name":"archive","async":true,"parameters":[{"name":"options","type":"object","optional":false,"memberTypes":["boolean"]}],"returnType":"Promise<object>","isStatic":false,"isPublic":true},"getSpec":{"name":"getSpec","async":false,"parameters":[],"returnType":"RuntimeReportSpec","isStatic":false,"isPublic":true},"setSpec":{"name":"setSpec","async":false,"parameters":[{"name":"spec","type":"RuntimeReportSpec","optional":false}],"returnType":"void","isStatic":false,"isPublic":true}},"decoratorConfig":{"tableName":"runtime_reports","indexes":[{"name":"idx_runtime_reports_confirm","columns":["tenantId","createdByUserId","specHash","status"]}],"operationPermissions":{"run":{"action":"read"},"archive":{"action":"create","databaseActions":["SELECT","UPDATE"]}},"api":{"include":["list","get","create","run","archive"],"principalContext":true,"routes":{"run":{"method":"POST","scope":"item","effect":"read","idempotent":true,"openWorld":false},"archive":{"method":"POST","scope":"item","effect":"write","idempotent":true,"openWorld":false}}},"mcp":{"include":["list","get","run","archive"]},"cli":{"include":["list","get","run","archive"]},"tenantScoped":{"mode":"required"},"conflictColumns":["tenant_id","slug","context"]},"extends":"SmrtObject","exportName":"RuntimeReport","collectionExportName":"RuntimeReportCollection","displayLabelField":"title","validationRules":[{"field":"spec","rule":"required","fieldType":"text"},{"field":"status","rule":"required","fieldType":"text"}],"schema":{"tableName":"runtime_reports","ddl":"CREATE TABLE IF NOT EXISTS \\"runtime_reports\\" (\\n \\"_sync_origin_device_id\\" TEXT,\\n \\"_sync_revision\\" INTEGER,\\n \\"id\\" UUID PRIMARY KEY NOT NULL,\\n \\"slug\\" TEXT NOT NULL,\\n \\"context\\" TEXT NOT NULL DEFAULT '',\\n \\"created_at\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\"updated_at\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\"tenant_id\\" UUID NOT NULL,\\n \\"title\\" TEXT,\\n \\"description\\" TEXT,\\n \\"source_id\\" TEXT,\\n \\"spec\\" TEXT NOT NULL,\\n \\"spec_hash\\" TEXT,\\n \\"status\\" TEXT NOT NULL,\\n \\"created_by_user_id\\" TEXT\\n);","columns":{"_sync_origin_device_id":{"type":"TEXT"},"_sync_revision":{"type":"INTEGER"},"id":{"type":"UUID","primaryKey":true,"referenceKind":"id","notNull":true},"slug":{"type":"TEXT","notNull":true},"context":{"type":"TEXT","notNull":true,"default":""},"created_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"updated_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"tenant_id":{"type":"UUID","referenceKind":"tenantId","notNull":true,"unique":false},"title":{"type":"TEXT","notNull":false,"unique":false},"description":{"type":"TEXT","notNull":false,"unique":false},"source_id":{"type":"TEXT","notNull":false,"unique":false},"spec":{"type":"TEXT","notNull":true,"unique":false},"spec_hash":{"type":"TEXT","notNull":false,"unique":false},"status":{"type":"TEXT","notNull":true,"unique":false},"created_by_user_id":{"type":"TEXT","notNull":false,"unique":false}},"indexes":[{"name":"runtime_reports_slug_context_idx","columns":["tenant_id","slug","context"],"unique":true},{"name":"idx_runtime_reports_confirm","columns":["tenant_id","created_by_user_id","spec_hash","status"]},{"name":"runtime_reports_tenant_id_created_at_idx","columns":["tenant_id","created_at"]}],"version":"0197b1d5"},"importPath":"@happyvertical/smrt-reports"},"@happyvertical/smrt-reports:RuntimeReportCollection":{"name":"runtimereportcollection","className":"RuntimeReportCollection","qualifiedName":"@happyvertical/smrt-reports:RuntimeReportCollection","collection":"runtimereports","filePath":"src/runtime-report.ts","packageName":"@happyvertical/smrt-reports","fields":{},"methods":{},"decoratorConfig":{"tableName":"runtime_reports","api":{"include":["list","get","create"]},"mcp":{"include":["list","get"]},"cli":{"include":["list","get"]}},"extends":"SmrtCollection","extendsTypeArg":"RuntimeReport","exportName":"RuntimeReportCollection","collectionExportName":"RuntimeReportCollectionCollection","collectionOf":"@happyvertical/smrt-reports:RuntimeReport","inheritedExposure":["api","mcp","cli"],"schema":{"tableName":"runtime_reports","ddl":"CREATE TABLE IF NOT EXISTS \\"runtime_reports\\" (\\n \\"_sync_origin_device_id\\" TEXT,\\n \\"_sync_revision\\" INTEGER,\\n \\"id\\" UUID PRIMARY KEY NOT NULL,\\n \\"slug\\" TEXT NOT NULL,\\n \\"context\\" TEXT NOT NULL DEFAULT '',\\n \\"created_at\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\"updated_at\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\"tenant_id\\" UUID NOT NULL,\\n \\"title\\" TEXT,\\n \\"description\\" TEXT,\\n \\"source_id\\" TEXT,\\n \\"spec\\" TEXT NOT NULL,\\n \\"spec_hash\\" TEXT,\\n \\"status\\" TEXT NOT NULL,\\n \\"created_by_user_id\\" TEXT\\n);","columns":{"_sync_origin_device_id":{"type":"TEXT"},"_sync_revision":{"type":"INTEGER"},"id":{"type":"UUID","primaryKey":true,"referenceKind":"id","notNull":true},"slug":{"type":"TEXT","notNull":true},"context":{"type":"TEXT","notNull":true,"default":""},"created_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"updated_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"tenant_id":{"type":"UUID","referenceKind":"tenantId","notNull":true,"unique":false},"title":{"type":"TEXT","notNull":false,"unique":false},"description":{"type":"TEXT","notNull":false,"unique":false},"source_id":{"type":"TEXT","notNull":false,"unique":false},"spec":{"type":"TEXT","notNull":true,"unique":false},"spec_hash":{"type":"TEXT","notNull":false,"unique":false},"status":{"type":"TEXT","notNull":true,"unique":false},"created_by_user_id":{"type":"TEXT","notNull":false,"unique":false}},"indexes":[{"name":"runtime_reports_slug_context_idx","columns":["tenant_id","slug","context"],"unique":true},{"name":"idx_runtime_reports_confirm","columns":["tenant_id","created_by_user_id","spec_hash","status"]},{"name":"runtime_reports_tenant_id_created_at_idx","columns":["tenant_id","created_at"]}],"version":"0197b1d5"},"importPath":"@happyvertical/smrt-reports"},"@happyvertical/smrt-reports:SmrtReportRefreshTask":{"name":"smrtreportrefreshtask","className":"SmrtReportRefreshTask","qualifiedName":"@happyvertical/smrt-reports:SmrtReportRefreshTask","collection":"smrtreportrefreshtasks","filePath":"src/scheduler.ts","packageName":"@happyvertical/smrt-reports","fields":{"tenantId":{"type":"text","_meta":{"__tenancy":{"isTenantIdField":true,"autoFilter":true,"required":false,"autoPopulate":true,"nullable":true,"mode":"optional","field":"tenantId","allowSuperAdminBypass":false},"__statedOptions":["sqlType","nullable","__tenancy","required"],"sqlType":"UUID","nullable":true,"required":false},"required":false},"reportClass":{"type":"text","_meta":{"__statedOptions":[]},"required":false},"mode":{"type":"text","_meta":{"__statedOptions":["required","backfill","enum"],"required":true,"backfill":"'incremental'"},"required":true,"enum":["rebuild","incremental"]},"trigger":{"type":"text","_meta":{"__statedOptions":["required","enum"],"required":true},"required":true,"enum":["manual","schedule","change","ttl","job"]},"args":{"type":"json","_meta":{"__statedOptions":[]},"required":false}},"methods":{"run":{"name":"run","async":true,"parameters":[{"name":"args","type":"ReportRefreshJobArgs","optional":true},{"name":"context","type":"JobExecutionContext","optional":true}],"returnType":"Promise<unknown>","isStatic":false,"isPublic":true}},"decoratorConfig":{"tableName":"_smrt_report_refresh_tasks","api":false,"cli":{"include":["list","get"],"skipApiCheck":true,"http":false},"mcp":false,"tenantScoped":{"mode":"optional"},"conflictColumns":["tenant_id","slug","context"]},"extends":"SmrtObject","exportName":"SmrtReportRefreshTask","collectionExportName":"SmrtReportRefreshTaskCollection","validationRules":[{"field":"mode","rule":"required","fieldType":"text"},{"field":"trigger","rule":"required","fieldType":"text"}],"schema":{"tableName":"_smrt_report_refresh_tasks","ddl":"CREATE TABLE IF NOT EXISTS \\"_smrt_report_refresh_tasks\\" (\\n \\"_sync_origin_device_id\\" TEXT,\\n \\"_sync_revision\\" INTEGER,\\n \\"id\\" UUID PRIMARY KEY NOT NULL,\\n \\"slug\\" TEXT NOT NULL,\\n \\"context\\" TEXT NOT NULL DEFAULT '',\\n \\"created_at\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\"updated_at\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\"tenant_id\\" UUID,\\n \\"report_class\\" TEXT,\\n \\"mode\\" TEXT NOT NULL,\\n \\"trigger\\" TEXT NOT NULL,\\n \\"args\\" JSON\\n);","columns":{"_sync_origin_device_id":{"type":"TEXT"},"_sync_revision":{"type":"INTEGER"},"id":{"type":"UUID","primaryKey":true,"referenceKind":"id","notNull":true},"slug":{"type":"TEXT","notNull":true},"context":{"type":"TEXT","notNull":true,"default":""},"created_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"updated_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"tenant_id":{"type":"UUID","referenceKind":"tenantId","notNull":false,"unique":false},"report_class":{"type":"TEXT","notNull":false,"unique":false},"mode":{"type":"TEXT","notNull":true,"unique":false},"trigger":{"type":"TEXT","notNull":true,"unique":false},"args":{"type":"JSON","notNull":false,"unique":false}},"indexes":[{"name":"_smrt_report_refresh_tasks_slug_context_idx","columns":["tenant_id","slug","context"],"unique":true,"nullsNotDistinct":true},{"name":"_smrt_report_refresh_tasks_tenant_id_created_at_idx","columns":["tenant_id","created_at"]}],"version":"f53f73ab"},"importPath":"@happyvertical/smrt-reports/scheduler"},"@happyvertical/smrt-reports:SmrtPrincipalReportRefreshTask":{"name":"smrtprincipalreportrefreshtask","className":"SmrtPrincipalReportRefreshTask","qualifiedName":"@happyvertical/smrt-reports:SmrtPrincipalReportRefreshTask","collection":"smrtprincipalreportrefreshtasks","description":"Worker target whose authority requirement cannot be downgraded by job args.","filePath":"src/scheduler.ts","packageName":"@happyvertical/smrt-reports","fields":{"tenantId":{"type":"text","_meta":{"__tenancy":{"isTenantIdField":true,"mode":"optional","field":"tenantId","autoFilter":true,"autoPopulate":true,"allowSuperAdminBypass":false},"__statedOptions":["sqlType","nullable","__tenancy","required","generated","source"],"required":false,"sqlType":"UUID","generated":true,"source":"tenantScoped_decorator"},"required":false},"reportClass":{"type":"text","_meta":{"__statedOptions":[]},"required":false},"mode":{"type":"text","_meta":{"__statedOptions":["required","backfill","enum"],"required":true,"backfill":"'incremental'"},"required":true,"enum":["rebuild","incremental"]},"trigger":{"type":"text","_meta":{"__statedOptions":["required","enum","backfill"],"required":true,"backfill":"'manual'"},"required":true,"enum":["manual","schedule","change","ttl","job"]},"args":{"type":"json","_meta":{"__statedOptions":[]},"required":false}},"methods":{"run":{"name":"run","async":true,"parameters":[{"name":"args","type":"ReportRefreshJobArgs","optional":true},{"name":"context","type":"JobExecutionContext","optional":true}],"returnType":"Promise<unknown>","isStatic":false,"isPublic":true}},"decoratorConfig":{"tableName":"_smrt_principal_report_refresh_tasks","api":false,"cli":{"include":["list","get"],"skipApiCheck":true,"http":false},"mcp":false,"tenantScoped":{"mode":"optional"},"conflictColumns":["tenant_id","slug","context"]},"extends":"SmrtReportRefreshTask","exportName":"SmrtPrincipalReportRefreshTask","collectionExportName":"SmrtPrincipalReportRefreshTaskCollection","validationRules":[{"field":"mode","rule":"required","fieldType":"text"},{"field":"trigger","rule":"required","fieldType":"text"}],"schema":{"tableName":"_smrt_principal_report_refresh_tasks","ddl":"CREATE TABLE IF NOT EXISTS \\"_smrt_principal_report_refresh_tasks\\" (\\n \\"_sync_origin_device_id\\" TEXT,\\n \\"_sync_revision\\" INTEGER,\\n \\"id\\" UUID PRIMARY KEY NOT NULL,\\n \\"slug\\" TEXT NOT NULL,\\n \\"context\\" TEXT NOT NULL DEFAULT '',\\n \\"created_at\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\"updated_at\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\"tenant_id\\" UUID,\\n \\"report_class\\" TEXT,\\n \\"mode\\" TEXT NOT NULL,\\n \\"trigger\\" TEXT NOT NULL,\\n \\"args\\" JSON\\n);","columns":{"_sync_origin_device_id":{"type":"TEXT"},"_sync_revision":{"type":"INTEGER"},"id":{"type":"UUID","primaryKey":true,"referenceKind":"id","notNull":true},"slug":{"type":"TEXT","notNull":true},"context":{"type":"TEXT","notNull":true,"default":""},"created_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"updated_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"tenant_id":{"type":"UUID","referenceKind":"tenantId","notNull":false,"unique":false},"report_class":{"type":"TEXT","notNull":false,"unique":false},"mode":{"type":"TEXT","notNull":true,"unique":false},"trigger":{"type":"TEXT","notNull":true,"unique":false},"args":{"type":"JSON","notNull":false,"unique":false}},"indexes":[{"name":"_smrt_principal_report_refresh_tasks_slug_context_idx","columns":["tenant_id","slug","context"],"unique":true,"nullsNotDistinct":true},{"name":"_smrt_principal_report_refresh_tasks_tenant_id_created_at_idx","columns":["tenant_id","created_at"]}],"version":"d90299c3"},"importPath":"@happyvertical/smrt-reports/scheduler"},"@happyvertical/smrt-reports:SmrtReportRun":{"name":"smrtreportrun","className":"SmrtReportRun","qualifiedName":"@happyvertical/smrt-reports:SmrtReportRun","collection":"smrtreportruns","filePath":"src/state.ts","packageName":"@happyvertical/smrt-reports","fields":{"tenantId":{"type":"text","_meta":{"__tenancy":{"isTenantIdField":true,"autoFilter":true,"required":false,"autoPopulate":true,"nullable":true,"mode":"optional","field":"tenantId","allowSuperAdminBypass":false},"__statedOptions":["sqlType","nullable","__tenancy","required"],"sqlType":"UUID","nullable":true,"required":false},"required":false},"scopeKey":{"type":"text","_meta":{"__statedOptions":["required"],"required":true},"required":true},"reportClass":{"type":"text","_meta":{"__statedOptions":["required","requiredFor"],"required":true,"requiredFor":"system-table"},"required":true},"sourceClass":{"type":"text","_meta":{"__statedOptions":[]},"required":false},"mode":{"type":"text","_meta":{"__statedOptions":["required","enum"],"required":true},"required":true,"enum":["rebuild","incremental"]},"trigger":{"type":"text","_meta":{"__statedOptions":["required","enum"],"required":true},"required":true,"enum":["manual","schedule","change","ttl","job"]},"status":{"type":"text","_meta":{"__statedOptions":["required","description","enum"],"required":true,"description":"Whether the refresh is running, finished, failed or was skipped."},"required":true,"description":"Whether the refresh is running, finished, failed or was skipped.","enum":["running","success","failed","skipped"]},"startedAt":{"type":"datetime","_meta":{"__statedOptions":["required","description"],"required":true,"description":"When the refresh began."},"required":true,"description":"When the refresh began."},"completedAt":{"type":"datetime","_meta":{"__statedOptions":["nullable","description","required"],"description":"When the refresh finished. Empty while it is still running.","nullable":true,"required":false},"required":false,"description":"When the refresh finished. Empty while it is still running."},"rowCount":{"type":"integer","_meta":{"__statedOptions":["required","description"],"required":true,"description":"How many rows the report held after the refresh."},"required":true,"description":"How many rows the report held after the refresh."},"changedGroupCount":{"type":"integer","_meta":{"__statedOptions":["required"],"required":true},"required":true},"watermarkBefore":{"type":"text","_meta":{"__statedOptions":["nullable","required"],"nullable":true,"required":false},"required":false},"watermarkAfter":{"type":"text","_meta":{"__statedOptions":["nullable","required"],"nullable":true,"required":false},"required":false},"error":{"type":"text","_meta":{"__statedOptions":["nullable","description","required"],"description":"Why the refresh failed. Empty when it worked.","nullable":true,"required":false},"required":false,"description":"Why the refresh failed. Empty when it worked."},"metadata":{"type":"json","_meta":{"__statedOptions":[]},"required":false}},"methods":{},"decoratorConfig":{"tableName":"_smrt_report_runs","api":false,"cli":{"include":["list","get"],"skipApiCheck":true,"http":false},"mcp":false,"tenantScoped":{"mode":"optional"},"conflictColumns":["tenant_id","slug","context"]},"extends":"SmrtObject","exportName":"SmrtReportRun","collectionExportName":"SmrtReportRunCollection","validationRules":[{"field":"scopeKey","rule":"required","fieldType":"text"},{"field":"reportClass","rule":"required","fieldType":"text"},{"field":"mode","rule":"required","fieldType":"text"},{"field":"trigger","rule":"required","fieldType":"text"},{"field":"status","rule":"required","fieldType":"text"},{"field":"startedAt","rule":"required","fieldType":"datetime"},{"field":"rowCount","rule":"required","fieldType":"integer"},{"field":"changedGroupCount","rule":"required","fieldType":"integer"}],"schema":{"tableName":"_smrt_report_runs","ddl":"CREATE TABLE IF NOT EXISTS \\"_smrt_report_runs\\" (\\n \\"_sync_origin_device_id\\" TEXT,\\n \\"_sync_revision\\" INTEGER,\\n \\"id\\" UUID PRIMARY KEY NOT NULL,\\n \\"slug\\" TEXT NOT NULL,\\n \\"context\\" TEXT NOT NULL DEFAULT '',\\n \\"created_at\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\"updated_at\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\"tenant_id\\" UUID,\\n \\"scope_key\\" TEXT NOT NULL,\\n \\"report_class\\" TEXT NOT NULL,\\n \\"source_class\\" TEXT,\\n \\"mode\\" TEXT NOT NULL,\\n \\"trigger\\" TEXT NOT NULL,\\n \\"status\\" TEXT NOT NULL,\\n \\"started_at\\" TIMESTAMP NOT NULL,\\n \\"completed_at\\" TIMESTAMP,\\n \\"row_count\\" INTEGER NOT NULL,\\n \\"changed_group_count\\" INTEGER NOT NULL,\\n \\"watermark_before\\" TEXT,\\n \\"watermark_after\\" TEXT,\\n \\"error\\" TEXT,\\n \\"metadata\\" JSON\\n);","columns":{"_sync_origin_device_id":{"type":"TEXT"},"_sync_revision":{"type":"INTEGER"},"id":{"type":"UUID","primaryKey":true,"referenceKind":"id","notNull":true},"slug":{"type":"TEXT","notNull":true},"context":{"type":"TEXT","notNull":true,"default":""},"created_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"updated_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"tenant_id":{"type":"UUID","referenceKind":"tenantId","notNull":false,"unique":false},"scope_key":{"type":"TEXT","notNull":true,"unique":false},"report_class":{"type":"TEXT","notNull":true,"unique":false},"source_class":{"type":"TEXT","notNull":false,"unique":false},"mode":{"type":"TEXT","notNull":true,"unique":false},"trigger":{"type":"TEXT","notNull":true,"unique":false},"status":{"type":"TEXT","notNull":true,"unique":false},"started_at":{"type":"TIMESTAMP","notNull":true,"unique":false},"completed_at":{"type":"TIMESTAMP","notNull":false,"unique":false},"row_count":{"type":"INTEGER","notNull":true,"unique":false},"changed_group_count":{"type":"INTEGER","notNull":true,"unique":false},"watermark_before":{"type":"TEXT","notNull":false,"unique":false},"watermark_after":{"type":"TEXT","notNull":false,"unique":false},"error":{"type":"TEXT","notNull":false,"unique":false},"metadata":{"type":"JSON","notNull":false,"unique":false}},"indexes":[{"name":"_smrt_report_runs_slug_context_idx","columns":["tenant_id","slug","context"],"unique":true,"nullsNotDistinct":true},{"name":"_smrt_report_runs_tenant_id_created_at_idx","columns":["tenant_id","created_at"]}],"version":"220b56ee"},"importPath":"@happyvertical/smrt-reports/state"},"@happyvertical/smrt-reports:SmrtReportRunCollection":{"name":"smrtreportruncollection","className":"SmrtReportRunCollection","qualifiedName":"@happyvertical/smrt-reports:SmrtReportRunCollection","collection":"smrtreportruns","filePath":"src/state.ts","packageName":"@happyvertical/smrt-reports","fields":{},"methods":{},"decoratorConfig":{"tableName":"_smrt_report_runs","api":false,"mcp":false,"cli":{"include":["list","get"],"skipApiCheck":true}},"extends":"SmrtCollection","extendsTypeArg":"SmrtReportRun","exportName":"SmrtReportRunCollection","collectionExportName":"SmrtReportRunCollectionCollection","collectionOf":"@happyvertical/smrt-reports:SmrtReportRun","inheritedExposure":["api","mcp","cli"],"schema":{"tableName":"_smrt_report_runs","ddl":"CREATE TABLE IF NOT EXISTS \\"_smrt_report_runs\\" (\\n \\"_sync_origin_device_id\\" TEXT,\\n \\"_sync_revision\\" INTEGER,\\n \\"id\\" UUID PRIMARY KEY NOT NULL,\\n \\"slug\\" TEXT NOT NULL,\\n \\"context\\" TEXT NOT NULL DEFAULT '',\\n \\"created_at\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\"updated_at\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\"tenant_id\\" UUID,\\n \\"scope_key\\" TEXT NOT NULL,\\n \\"report_class\\" TEXT NOT NULL,\\n \\"source_class\\" TEXT,\\n \\"mode\\" TEXT NOT NULL,\\n \\"trigger\\" TEXT NOT NULL,\\n \\"status\\" TEXT NOT NULL,\\n \\"started_at\\" TIMESTAMP NOT NULL,\\n \\"completed_at\\" TIMESTAMP,\\n \\"row_count\\" INTEGER NOT NULL,\\n \\"changed_group_count\\" INTEGER NOT NULL,\\n \\"watermark_before\\" TEXT,\\n \\"watermark_after\\" TEXT,\\n \\"error\\" TEXT,\\n \\"metadata\\" JSON\\n);","columns":{"_sync_origin_device_id":{"type":"TEXT"},"_sync_revision":{"type":"INTEGER"},"id":{"type":"UUID","primaryKey":true,"referenceKind":"id","notNull":true},"slug":{"type":"TEXT","notNull":true},"context":{"type":"TEXT","notNull":true,"default":""},"created_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"updated_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"tenant_id":{"type":"UUID","referenceKind":"tenantId","notNull":false,"unique":false},"scope_key":{"type":"TEXT","notNull":true,"unique":false},"report_class":{"type":"TEXT","notNull":true,"unique":false},"source_class":{"type":"TEXT","notNull":false,"unique":false},"mode":{"type":"TEXT","notNull":true,"unique":false},"trigger":{"type":"TEXT","notNull":true,"unique":false},"status":{"type":"TEXT","notNull":true,"unique":false},"started_at":{"type":"TIMESTAMP","notNull":true,"unique":false},"completed_at":{"type":"TIMESTAMP","notNull":false,"unique":false},"row_count":{"type":"INTEGER","notNull":true,"unique":false},"changed_group_count":{"type":"INTEGER","notNull":true,"unique":false},"watermark_before":{"type":"TEXT","notNull":false,"unique":false},"watermark_after":{"type":"TEXT","notNull":false,"unique":false},"error":{"type":"TEXT","notNull":false,"unique":false},"metadata":{"type":"JSON","notNull":false,"unique":false}},"indexes":[{"name":"_smrt_report_runs_slug_context_idx","columns":["tenant_id","slug","context"],"unique":true,"nullsNotDistinct":true},{"name":"_smrt_report_runs_tenant_id_created_at_idx","columns":["tenant_id","created_at"]}],"version":"220b56ee"},"importPath":"@happyvertical/smrt-reports/state"},"@happyvertical/smrt-reports:SmrtReportWatermark":{"name":"smrtreportwatermark","className":"SmrtReportWatermark","qualifiedName":"@happyvertical/smrt-reports:SmrtReportWatermark","collection":"smrtreportwatermarks","filePath":"src/state.ts","packageName":"@happyvertical/smrt-reports","fields":{"tenantId":{"type":"text","_meta":{"__tenancy":{"isTenantIdField":true,"autoFilter":true,"required":false,"autoPopulate":true,"nullable":true,"mode":"optional","field":"tenantId","allowSuperAdminBypass":false},"__statedOptions":["sqlType","nullable","__tenancy","required"],"sqlType":"UUID","nullable":true,"required":false},"required":false},"scopeKey":{"type":"text","_meta":{"__statedOptions":["required"],"required":true},"required":true},"reportClass":{"type":"text","_meta":{"__statedOptions":["required","requiredFor"],"required":true,"requiredFor":"system-table"},"required":true},"sourceClass":{"type":"text","_meta":{"__statedOptions":["required","requiredFor"],"required":true,"requiredFor":"system-table"},"required":true},"watermarkColumn":{"type":"text","_meta":{"__statedOptions":["required","requiredFor"],"required":true,"requiredFor":"system-table"},"required":true},"watermarkValue":{"type":"text","_meta":{"__statedOptions":["nullable","required"],"nullable":true,"required":false},"required":false},"lastRunId":{"type":"text","_meta":{"__statedOptions":["nullable","required"],"nullable":true,"required":false},"required":false}},"methods":{},"decoratorConfig":{"tableName":"_smrt_report_watermarks","conflictColumns":["report_class","scope_key","source_class","watermark_column"],"api":false,"cli":{"include":["list","get"],"skipApiCheck":true,"http":false},"mcp":false,"tenantScoped":{"mode":"optional"}},"extends":"SmrtObject","exportName":"SmrtReportWatermark","collectionExportName":"SmrtReportWatermarkCollection","validationRules":[{"field":"scopeKey","rule":"required","fieldType":"text"},{"field":"reportClass","rule":"required","fieldType":"text"},{"field":"sourceClass","rule":"required","fieldType":"text"},{"field":"watermarkColumn","rule":"required","fieldType":"text"}],"schema":{"tableName":"_smrt_report_watermarks","ddl":"CREATE TABLE IF NOT EXISTS \\"_smrt_report_watermarks\\" (\\n \\"_sync_origin_device_id\\" TEXT,\\n \\"_sync_revision\\" INTEGER,\\n \\"id\\" UUID PRIMARY KEY NOT NULL,\\n \\"slug\\" TEXT NOT NULL,\\n \\"context\\" TEXT NOT NULL DEFAULT '',\\n \\"created_at\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\"updated_at\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\"tenant_id\\" UUID,\\n \\"scope_key\\" TEXT NOT NULL,\\n \\"report_class\\" TEXT NOT NULL,\\n \\"source_class\\" TEXT NOT NULL,\\n \\"watermark_column\\" TEXT NOT NULL,\\n \\"watermark_value\\" TEXT,\\n \\"last_run_id\\" TEXT\\n);","columns":{"_sync_origin_device_id":{"type":"TEXT"},"_sync_revision":{"type":"INTEGER"},"id":{"type":"UUID","primaryKey":true,"referenceKind":"id","notNull":true},"slug":{"type":"TEXT","notNull":true},"context":{"type":"TEXT","notNull":true,"default":""},"created_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"updated_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"tenant_id":{"type":"UUID","referenceKind":"tenantId","notNull":false,"unique":false},"scope_key":{"type":"TEXT","notNull":true,"unique":false},"report_class":{"type":"TEXT","notNull":true,"unique":false},"source_class":{"type":"TEXT","notNull":true,"unique":false},"watermark_column":{"type":"TEXT","notNull":true,"unique":false},"watermark_value":{"type":"TEXT","notNull":false,"unique":false},"last_run_id":{"type":"TEXT","notNull":false,"unique":false}},"indexes":[{"name":"_smrt_report_watermarks_report_class_scope_key_idx","columns":["report_class","scope_key","source_class","watermark_column"],"unique":true},{"name":"_smrt_report_watermarks_slug_context_idx","columns":["slug","context"]},{"name":"_smrt_report_watermarks_tenant_id_created_at_idx","columns":["tenant_id","created_at"]}],"version":"a1bd37f4"},"importPath":"@happyvertical/smrt-reports/state"},"@happyvertical/smrt-reports:SmrtReportWatermarkCollection":{"name":"smrtreportwatermarkcollection","className":"SmrtReportWatermarkCollection","qualifiedName":"@happyvertical/smrt-reports:SmrtReportWatermarkCollection","collection":"smrtreportwatermarks","filePath":"src/state.ts","packageName":"@happyvertical/smrt-reports","fields":{},"methods":{},"decoratorConfig":{"tableName":"_smrt_report_watermarks","api":false,"mcp":false,"cli":{"include":["list","get"],"skipApiCheck":true}},"extends":"SmrtCollection","extendsTypeArg":"SmrtReportWatermark","exportName":"SmrtReportWatermarkCollection","collectionExportName":"SmrtReportWatermarkCollectionCollection","collectionOf":"@happyvertical/smrt-reports:SmrtReportWatermark","inheritedExposure":["api","mcp","cli"],"schema":{"tableName":"_smrt_report_watermarks","ddl":"CREATE TABLE IF NOT EXISTS \\"_smrt_report_watermarks\\" (\\n \\"_sync_origin_device_id\\" TEXT,\\n \\"_sync_revision\\" INTEGER,\\n \\"id\\" UUID PRIMARY KEY NOT NULL,\\n \\"slug\\" TEXT NOT NULL,\\n \\"context\\" TEXT NOT NULL DEFAULT '',\\n \\"created_at\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\"updated_at\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\"tenant_id\\" UUID,\\n \\"scope_key\\" TEXT NOT NULL,\\n \\"report_class\\" TEXT NOT NULL,\\n \\"source_class\\" TEXT NOT NULL,\\n \\"watermark_column\\" TEXT NOT NULL,\\n \\"watermark_value\\" TEXT,\\n \\"last_run_id\\" TEXT\\n);","columns":{"_sync_origin_device_id":{"type":"TEXT"},"_sync_revision":{"type":"INTEGER"},"id":{"type":"UUID","primaryKey":true,"referenceKind":"id","notNull":true},"slug":{"type":"TEXT","notNull":true},"context":{"type":"TEXT","notNull":true,"default":""},"created_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"updated_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"tenant_id":{"type":"UUID","referenceKind":"tenantId","notNull":false,"unique":false},"scope_key":{"type":"TEXT","notNull":true,"unique":false},"report_class":{"type":"TEXT","notNull":true,"unique":false},"source_class":{"type":"TEXT","notNull":true,"unique":false},"watermark_column":{"type":"TEXT","notNull":true,"unique":false},"watermark_value":{"type":"TEXT","notNull":false,"unique":false},"last_run_id":{"type":"TEXT","notNull":false,"unique":false}},"indexes":[{"name":"_smrt_report_watermarks_report_class_scope_key_idx","columns":["report_class","scope_key","source_class","watermark_column"],"unique":true},{"name":"_smrt_report_watermarks_slug_context_idx","columns":["slug","context"]},{"name":"_smrt_report_watermarks_tenant_id_created_at_idx","columns":["tenant_id","created_at"]}],"version":"a1bd37f4"},"importPath":"@happyvertical/smrt-reports/state"},"@happyvertical/smrt-reports:SmrtReportLock":{"name":"smrtreportlock","className":"SmrtReportLock","qualifiedName":"@happyvertical/smrt-reports:SmrtReportLock","collection":"smrtreportlocks","filePath":"src/state.ts","packageName":"@happyvertical/smrt-reports","fields":{"tenantId":{"type":"text","_meta":{"__tenancy":{"isTenantIdField":true,"autoFilter":true,"required":false,"autoPopulate":true,"nullable":true,"mode":"optional","field":"tenantId","allowSuperAdminBypass":false},"__statedOptions":["sqlType","nullable","__tenancy","required"],"sqlType":"UUID","nullable":true,"required":false},"required":false},"scopeKey":{"type":"text","_meta":{"__statedOptions":["required"],"required":true},"required":true},"reportClass":{"type":"text","_meta":{"__statedOptions":["required","requiredFor"],"required":true,"requiredFor":"system-table"},"required":true},"ownerId":{"type":"text","_meta":{"__statedOptions":["nullable","required"],"nullable":true,"required":false},"required":false},"acquiredAt":{"type":"datetime","_meta":{"__statedOptions":["nullable","required"],"nullable":true,"required":false},"required":false},"heartbeatAt":{"type":"datetime","_meta":{"__statedOptions":["nullable","required"],"nullable":true,"required":false},"required":false},"expiresAt":{"type":"datetime","_meta":{"__statedOptions":["nullable","required"],"nullable":true,"required":false},"required":false}},"methods":{},"decoratorConfig":{"tableName":"_smrt_report_locks","conflictColumns":["report_class","scope_key"],"api":false,"cli":{"include":["list","get"],"skipApiCheck":true,"http":false},"mcp":false,"tenantScoped":{"mode":"optional"}},"extends":"SmrtObject","exportName":"SmrtReportLock","collectionExportName":"SmrtReportLockCollection","validationRules":[{"field":"scopeKey","rule":"required","fieldType":"text"},{"field":"reportClass","rule":"required","fieldType":"text"}],"schema":{"tableName":"_smrt_report_locks","ddl":"CREATE TABLE IF NOT EXISTS \\"_smrt_report_locks\\" (\\n \\"_sync_origin_device_id\\" TEXT,\\n \\"_sync_revision\\" INTEGER,\\n \\"id\\" UUID PRIMARY KEY NOT NULL,\\n \\"slug\\" TEXT NOT NULL,\\n \\"context\\" TEXT NOT NULL DEFAULT '',\\n \\"created_at\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\"updated_at\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\"tenant_id\\" UUID,\\n \\"scope_key\\" TEXT NOT NULL,\\n \\"report_class\\" TEXT NOT NULL,\\n \\"owner_id\\" TEXT,\\n \\"acquired_at\\" TIMESTAMP,\\n \\"heartbeat_at\\" TIMESTAMP,\\n \\"expires_at\\" TIMESTAMP\\n);","columns":{"_sync_origin_device_id":{"type":"TEXT"},"_sync_revision":{"type":"INTEGER"},"id":{"type":"UUID","primaryKey":true,"referenceKind":"id","notNull":true},"slug":{"type":"TEXT","notNull":true},"context":{"type":"TEXT","notNull":true,"default":""},"created_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"updated_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"tenant_id":{"type":"UUID","referenceKind":"tenantId","notNull":false,"unique":false},"scope_key":{"type":"TEXT","notNull":true,"unique":false},"report_class":{"type":"TEXT","notNull":true,"unique":false},"owner_id":{"type":"TEXT","notNull":false,"unique":false},"acquired_at":{"type":"TIMESTAMP","notNull":false,"unique":false},"heartbeat_at":{"type":"TIMESTAMP","notNull":false,"unique":false},"expires_at":{"type":"TIMESTAMP","notNull":false,"unique":false}},"indexes":[{"name":"_smrt_report_locks_report_class_scope_key_idx","columns":["report_class","scope_key"],"unique":true},{"name":"_smrt_report_locks_slug_context_idx","columns":["slug","context"]},{"name":"_smrt_report_locks_tenant_id_created_at_idx","columns":["tenant_id","created_at"]}],"version":"1df076b7"},"importPath":"@happyvertical/smrt-reports/state"},"@happyvertical/smrt-reports:SmrtReportLockCollection":{"name":"smrtreportlockcollection","className":"SmrtReportLockCollection","qualifiedName":"@happyvertical/smrt-reports:SmrtReportLockCollection","collection":"smrtreportlocks","filePath":"src/state.ts","packageName":"@happyvertical/smrt-reports","fields":{},"methods":{},"decoratorConfig":{"tableName":"_smrt_report_locks","api":false,"mcp":false,"cli":{"include":["list","get"],"skipApiCheck":true}},"extends":"SmrtCollection","extendsTypeArg":"SmrtReportLock","exportName":"SmrtReportLockCollection","collectionExportName":"SmrtReportLockCollectionCollection","collectionOf":"@happyvertical/smrt-reports:SmrtReportLock","inheritedExposure":["api","mcp","cli"],"schema":{"tableName":"_smrt_report_locks","ddl":"CREATE TABLE IF NOT EXISTS \\"_smrt_report_locks\\" (\\n \\"_sync_origin_device_id\\" TEXT,\\n \\"_sync_revision\\" INTEGER,\\n \\"id\\" UUID PRIMARY KEY NOT NULL,\\n \\"slug\\" TEXT NOT NULL,\\n \\"context\\" TEXT NOT NULL DEFAULT '',\\n \\"created_at\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\"updated_at\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\"tenant_id\\" UUID,\\n \\"scope_key\\" TEXT NOT NULL,\\n \\"report_class\\" TEXT NOT NULL,\\n \\"owner_id\\" TEXT,\\n \\"acquired_at\\" TIMESTAMP,\\n \\"heartbeat_at\\" TIMESTAMP,\\n \\"expires_at\\" TIMESTAMP\\n);","columns":{"_sync_origin_device_id":{"type":"TEXT"},"_sync_revision":{"type":"INTEGER"},"id":{"type":"UUID","primaryKey":true,"referenceKind":"id","notNull":true},"slug":{"type":"TEXT","notNull":true},"context":{"type":"TEXT","notNull":true,"default":""},"created_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"updated_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"tenant_id":{"type":"UUID","referenceKind":"tenantId","notNull":false,"unique":false},"scope_key":{"type":"TEXT","notNull":true,"unique":false},"report_class":{"type":"TEXT","notNull":true,"unique":false},"owner_id":{"type":"TEXT","notNull":false,"unique":false},"acquired_at":{"type":"TIMESTAMP","notNull":false,"unique":false},"heartbeat_at":{"type":"TIMESTAMP","notNull":false,"unique":false},"expires_at":{"type":"TIMESTAMP","notNull":false,"unique":false}},"indexes":[{"name":"_smrt_report_locks_report_class_scope_key_idx","columns":["report_class","scope_key"],"unique":true},{"name":"_smrt_report_locks_slug_context_idx","columns":["slug","context"]},{"name":"_smrt_report_locks_tenant_id_created_at_idx","columns":["tenant_id","created_at"]}],"version":"1df076b7"},"importPath":"@happyvertical/smrt-reports/state"},"@happyvertical/smrt-reports:SmrtReportSchedule":{"name":"smrtreportschedule","className":"SmrtReportSchedule","qualifiedName":"@happyvertical/smrt-reports:SmrtReportSchedule","collection":"smrtreportschedules","filePath":"src/state.ts","packageName":"@happyvertical/smrt-reports","fields":{"tenantId":{"type":"text","_meta":{"__tenancy":{"isTenantIdField":true,"autoFilter":true,"required":false,"autoPopulate":true,"nullable":true,"mode":"optional","field":"tenantId","allowSuperAdminBypass":false},"__statedOptions":["sqlType","nullable","__tenancy","required"],"sqlType":"UUID","nullable":true,"required":false},"required":false},"scopeKey":{"type":"text","_meta":{"__statedOptions":["required"],"required":true},"required":true},"reportClass":{"type":"text","_meta":{"__statedOptions":["required","requiredFor"],"required":true,"requiredFor":"system-table"},"required":true},"cron":{"type":"text","_meta":{"__statedOptions":["required","requiredFor","description"],"required":true,"description":"When the report refreshes, as a cron schedule such as 0 6 * * * for 6 am daily.","requiredFor":"system-table"},"required":true,"description":"When the report refreshes, as a cron schedule such as 0 6 * * * for 6 am daily."},"trigger":{"type":"text","_meta":{"__statedOptions":["required","enum"],"required":true},"required":true,"enum":["manual","schedule","change","ttl","job"]},"mode":{"type":"text","_meta":{"__statedOptions":["required","description","enum"],"required":true,"description":"Rebuild recomputes the whole report. Incremental updates only what changed."},"required":true,"description":"Rebuild recomputes the whole report. Incremental updates only what changed.","enum":["rebuild","incremental"]},"enabled":{"type":"boolean","_meta":{"__statedOptions":["required","description"],"required":true,"description":"Turn off to stop refreshing without deleting the schedule."},"required":true,"description":"Turn off to stop refreshing without deleting the schedule."},"status":{"type":"text","_meta":{"__statedOptions":["required","description","enum"],"required":true,"description":"Whether the schedule is active, paused, disabled or in error."},"required":true,"description":"Whether the schedule is active, paused, disabled or in error.","enum":["active","paused","disabled","error"]},"nextRun":{"type":"datetime","_meta":{"__statedOptions":["nullable","description","required"],"description":"When the report is next due to refresh.","nullable":true,"required":false},"required":false,"description":"When the report is next due to refresh."},"lastRun":{"type":"datetime","_meta":{"__statedOptions":["nullable","description","required"],"description":"When the report last started a scheduled refresh.","nullable":true,"required":false},"required":false,"description":"When the report last started a scheduled refresh."},"lastStatus":{"type":"text","_meta":{"__statedOptions":["nullable","description","enum","required"],"description":"Whether the last scheduled refresh worked or failed.","nullable":true,"required":false},"required":false,"description":"Whether the last scheduled refresh worked or failed.","enum":["success","failed"]},"lastError":{"type":"text","_meta":{"__statedOptions":["nullable","description","required"],"description":"Why the last scheduled refresh failed. Empty when it worked.","nullable":true,"required":false},"required":false,"description":"Why the last scheduled refresh failed. Empty when it worked."},"runCount":{"type":"integer","_meta":{"__statedOptions":["required"],"required":true},"required":true},"successCount":{"type":"integer","_meta":{"__statedOptions":["required"],"required":true},"required":true},"failureCount":{"type":"integer","_meta":{"__statedOptions":["required"],"required":true},"required":true},"runningCount":{"type":"integer","_meta":{"__statedOptions":["required"],"required":true},"required":true},"maxConcurrent":{"type":"integer","_meta":{"__statedOptions":["required"],"required":true},"required":true},"queue":{"type":"text","_meta":{"__statedOptions":["required"],"required":true},"required":true},"priority":{"type":"integer","_meta":{"__statedOptions":["required"],"required":true},"required":true},"timeout":{"type":"integer","_meta":{"__statedOptions":["required"],"required":true},"required":true}},"methods":{},"decoratorConfig":{"tableName":"_smrt_report_schedules","conflictColumns":["report_class","scope_key","cron","mode"],"api":false,"cli":{"include":["list","get"],"skipApiCheck":true,"http":false},"mcp":false,"tenantScoped":{"mode":"optional"}},"extends":"SmrtObject","exportName":"SmrtReportSchedule","collectionExportName":"SmrtReportScheduleCollection","validationRules":[{"field":"scopeKey","rule":"required","fieldType":"text"},{"field":"reportClass","rule":"required","fieldType":"text"},{"field":"cron","rule":"required","fieldType":"text"},{"field":"trigger","rule":"required","fieldType":"text"},{"field":"mode","rule":"required","fieldType":"text"},{"field":"enabled","rule":"required","fieldType":"boolean"},{"field":"status","rule":"required","fieldType":"text"},{"field":"runCount","rule":"required","fieldType":"integer"},{"field":"successCount","rule":"required","fieldType":"integer"},{"field":"failureCount","rule":"required","fieldType":"integer"},{"field":"runningCount","rule":"required","fieldType":"integer"},{"field":"maxConcurrent","rule":"required","fieldType":"integer"},{"field":"queue","rule":"required","fieldType":"text"},{"field":"priority","rule":"required","fieldType":"integer"},{"field":"timeout","rule":"required","fieldType":"integer"}],"schema":{"tableName":"_smrt_report_schedules","ddl":"CREATE TABLE IF NOT EXISTS \\"_smrt_report_schedules\\" (\\n \\"_sync_origin_device_id\\" TEXT,\\n \\"_sync_revision\\" INTEGER,\\n \\"id\\" UUID PRIMARY KEY NOT NULL,\\n \\"slug\\" TEXT NOT NULL,\\n \\"context\\" TEXT NOT NULL DEFAULT '',\\n \\"created_at\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\"updated_at\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\"tenant_id\\" UUID,\\n \\"scope_key\\" TEXT NOT NULL,\\n \\"report_class\\" TEXT NOT NULL,\\n \\"cron\\" TEXT NOT NULL,\\n \\"trigger\\" TEXT NOT NULL,\\n \\"mode\\" TEXT NOT NULL,\\n \\"enabled\\" BOOLEAN NOT NULL,\\n \\"status\\" TEXT NOT NULL,\\n \\"next_run\\" TIMESTAMP,\\n \\"last_run\\" TIMESTAMP,\\n \\"last_status\\" TEXT,\\n \\"last_error\\" TEXT,\\n \\"run_count\\" INTEGER NOT NULL,\\n \\"success_count\\" INTEGER NOT NULL,\\n \\"failure_count\\" INTEGER NOT NULL,\\n \\"running_count\\" INTEGER NOT NULL,\\n \\"max_concurrent\\" INTEGER NOT NULL,\\n \\"queue\\" TEXT NOT NULL,\\n \\"priority\\" INTEGER NOT NULL,\\n \\"timeout\\" INTEGER NOT NULL\\n);","columns":{"_sync_origin_device_id":{"type":"TEXT"},"_sync_revision":{"type":"INTEGER"},"id":{"type":"UUID","primaryKey":true,"referenceKind":"id","notNull":true},"slug":{"type":"TEXT","notNull":true},"context":{"type":"TEXT","notNull":true,"default":""},"created_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"updated_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"tenant_id":{"type":"UUID","referenceKind":"tenantId","notNull":false,"unique":false},"scope_key":{"type":"TEXT","notNull":true,"unique":false},"report_class":{"type":"TEXT","notNull":true,"unique":false},"cron":{"type":"TEXT","notNull":true,"unique":false},"trigger":{"type":"TEXT","notNull":true,"unique":false},"mode":{"type":"TEXT","notNull":true,"unique":false},"enabled":{"type":"BOOLEAN","notNull":true,"unique":false},"status":{"type":"TEXT","notNull":true,"unique":false},"next_run":{"type":"TIMESTAMP","notNull":false,"unique":false},"last_run":{"type":"TIMESTAMP","notNull":false,"unique":false},"last_status":{"type":"TEXT","notNull":false,"unique":false},"last_error":{"type":"TEXT","notNull":false,"unique":false},"run_count":{"type":"INTEGER","notNull":true,"unique":false},"success_count":{"type":"INTEGER","notNull":true,"unique":false},"failure_count":{"type":"INTEGER","notNull":true,"unique":false},"running_count":{"type":"INTEGER","notNull":true,"unique":false},"max_concurrent":{"type":"INTEGER","notNull":true,"unique":false},"queue":{"type":"TEXT","notNull":true,"unique":false},"priority":{"type":"INTEGER","notNull":true,"unique":false},"timeout":{"type":"INTEGER","notNull":true,"unique":false}},"indexes":[{"name":"_smrt_report_schedules_report_class_scope_key_idx","columns":["report_class","scope_key","cron","mode"],"unique":true},{"name":"_smrt_report_schedules_slug_context_idx","columns":["slug","context"]},{"name":"_smrt_report_schedules_tenant_id_created_at_idx","columns":["tenant_id","created_at"]}],"version":"372c07ab"},"importPath":"@happyvertical/smrt-reports/state"},"@happyvertical/smrt-reports:SmrtReportScheduleCollection":{"name":"smrtreportschedulecollection","className":"SmrtReportScheduleCollection","qualifiedName":"@happyvertical/smrt-reports:SmrtReportScheduleCollection","collection":"smrtreportschedules","filePath":"src/state.ts","packageName":"@happyvertical/smrt-reports","fields":{},"methods":{},"decoratorConfig":{"tableName":"_smrt_report_schedules","api":false,"mcp":false,"cli":{"include":["list","get"],"skipApiCheck":true}},"extends":"SmrtCollection","extendsTypeArg":"SmrtReportSchedule","exportName":"SmrtReportScheduleCollection","collectionExportName":"SmrtReportScheduleCollectionCollection","collectionOf":"@happyvertical/smrt-reports:SmrtReportSchedule","inheritedExposure":["api","mcp","cli"],"schema":{"tableName":"_smrt_report_schedules","ddl":"CREATE TABLE IF NOT EXISTS \\"_smrt_report_schedules\\" (\\n \\"_sync_origin_device_id\\" TEXT,\\n \\"_sync_revision\\" INTEGER,\\n \\"id\\" UUID PRIMARY KEY NOT NULL,\\n \\"slug\\" TEXT NOT NULL,\\n \\"context\\" TEXT NOT NULL DEFAULT '',\\n \\"created_at\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\"updated_at\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\"tenant_id\\" UUID,\\n \\"scope_key\\" TEXT NOT NULL,\\n \\"report_class\\" TEXT NOT NULL,\\n \\"cron\\" TEXT NOT NULL,\\n \\"trigger\\" TEXT NOT NULL,\\n \\"mode\\" TEXT NOT NULL,\\n \\"enabled\\" BOOLEAN NOT NULL,\\n \\"status\\" TEXT NOT NULL,\\n \\"next_run\\" TIMESTAMP,\\n \\"last_run\\" TIMESTAMP,\\n \\"last_status\\" TEXT,\\n \\"last_error\\" TEXT,\\n \\"run_count\\" INTEGER NOT NULL,\\n \\"success_count\\" INTEGER NOT NULL,\\n \\"failure_count\\" INTEGER NOT NULL,\\n \\"running_count\\" INTEGER NOT NULL,\\n \\"max_concurrent\\" INTEGER NOT NULL,\\n \\"queue\\" TEXT NOT NULL,\\n \\"priority\\" INTEGER NOT NULL,\\n \\"timeout\\" INTEGER NOT NULL\\n);","columns":{"_sync_origin_device_id":{"type":"TEXT"},"_sync_revision":{"type":"INTEGER"},"id":{"type":"UUID","primaryKey":true,"referenceKind":"id","notNull":true},"slug":{"type":"TEXT","notNull":true},"context":{"type":"TEXT","notNull":true,"default":""},"created_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"updated_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"tenant_id":{"type":"UUID","referenceKind":"tenantId","notNull":false,"unique":false},"scope_key":{"type":"TEXT","notNull":true,"unique":false},"report_class":{"type":"TEXT","notNull":true,"unique":false},"cron":{"type":"TEXT","notNull":true,"unique":false},"trigger":{"type":"TEXT","notNull":true,"unique":false},"mode":{"type":"TEXT","notNull":true,"unique":false},"enabled":{"type":"BOOLEAN","notNull":true,"unique":false},"status":{"type":"TEXT","notNull":true,"unique":false},"next_run":{"type":"TIMESTAMP","notNull":false,"unique":false},"last_run":{"type":"TIMESTAMP","notNull":false,"unique":false},"last_status":{"type":"TEXT","notNull":false,"unique":false},"last_error":{"type":"TEXT","notNull":false,"unique":false},"run_count":{"type":"INTEGER","notNull":true,"unique":false},"success_count":{"type":"INTEGER","notNull":true,"unique":false},"failure_count":{"type":"INTEGER","notNull":true,"unique":false},"running_count":{"type":"INTEGER","notNull":true,"unique":false},"max_concurrent":{"type":"INTEGER","notNull":true,"unique":false},"queue":{"type":"TEXT","notNull":true,"unique":false},"priority":{"type":"INTEGER","notNull":true,"unique":false},"timeout":{"type":"INTEGER","notNull":true,"unique":false}},"indexes":[{"name":"_smrt_report_schedules_report_class_scope_key_idx","columns":["report_class","scope_key","cron","mode"],"unique":true},{"name":"_smrt_report_schedules_slug_context_idx","columns":["slug","context"]},{"name":"_smrt_report_schedules_tenant_id_created_at_idx","columns":["tenant_id","created_at"]}],"version":"372c07ab"},"importPath":"@happyvertical/smrt-reports/state"}},"moduleType":"smrt","recipes":[{"id":"reports.materialized","className":"MaterializedReportsRecipe","label":"Scheduled reports","summary":"Keep totals and trends ready to read, refreshed on a schedule and open to the assistant.","synonyms":["rollups","kpis","refresh schedule","materialized"],"models":["@happyvertical/smrt-reports:SmrtReportRun","@happyvertical/smrt-reports:SmrtReportWatermark","@happyvertical/smrt-reports:SmrtReportLock","@happyvertical/smrt-reports:SmrtReportSchedule","@happyvertical/smrt-reports:SmrtReportRefreshTask","@happyvertical/smrt-reports:SmrtPrincipalReportRefreshTask"],"nav":[],"requires":[],"help":{"markdown":"## Overview\\n\\nReports keep totals and trends, such as revenue by month or signups by week,\\nworked out ahead of time so they open instantly. Someone on your team sets up\\neach report once. This feature then records when each report was last\\nrefreshed, how that went, and when it runs next.\\n\\nReports are calculated on your server, never in the browser, so this feature\\nneeds your app's database.\\n\\n## Tasks\\n\\n### Ask the assistant about a report\\n\\n1. Ask in plain words, for example \\"what was revenue last month?\\".\\n2. The assistant looks up the reports your account may see\\n (\`data.discover\`, \`data.inspect\`), then reads rows with \`reports.query\`.\\n It only ever sees the columns and the customer data you are allowed to see.\\n3. If the numbers look old, ask how fresh the report is. The answer says when\\n it was last refreshed.\\n4. Ask the assistant to refresh a stale report. It previews the refresh with\\n \`reports.refresh\` and your app decides who may apply it.\\n\\nThe assistant offers these tools only when your app has switched them on.\\n\\n### Ask a question no report covers\\n\\n1. Describe what you want to see, for example \\"orders by status this quarter\\".\\n2. The assistant checks what it may report on (\`reports.runtime.sources\`) and\\n shows a preview of the report it would save (\`reports.runtime.define\`).\\n3. Nothing is saved until you confirm that exact report.\\n4. Open it again later with \`reports.runtime.list\` and \`reports.runtime.run\`.\\n\\nThese reports are worked out live each time and their rows are never stored.\\nThey are not refreshed in the background. A report that people open every day\\nis worth asking your team to set up as a refreshed report instead.\\n\\n### Keep a report fresh\\n\\n1. Ask your team how the report refreshes: by hand, on a schedule, after the\\n data changes, or when it goes out of date.\\n2. A scheduled report repeats on its **{field:SmrtReportSchedule.cron}**, either\\n rebuilding everything or updating only what changed, per its\\n **{field:SmrtReportSchedule.mode}**.\\n3. Turn **{field:SmrtReportSchedule.enabled}** off to pause a schedule without\\n losing it.\\n4. **{field:SmrtReportSchedule.nextRun}** shows when it is next due.\\n\\n### Check that a refresh worked\\n\\n1. Look at the latest run for the report. **{field:SmrtReportRun.status}**\\n says whether it is running, finished, failed or skipped.\\n2. **{field:SmrtReportRun.completedAt}** and **{field:SmrtReportRun.rowCount}**\\n show when it finished and how many rows it holds.\\n3. If it failed, **{field:SmrtReportRun.error}** says why.\\n","fieldRefs":["SmrtReportRun.completedAt","SmrtReportRun.error","SmrtReportRun.rowCount","SmrtReportRun.status","SmrtReportSchedule.cron","SmrtReportSchedule.enabled","SmrtReportSchedule.mode","SmrtReportSchedule.nextRun"]},"runtime":"server","demo":{"mode":"server","reasons":["The recipe declares runtime \\"server\\".","Needs a server because its package does not build for a browser: node:crypto/events; @happyvertical/sql root: the sync query builders it needs (validateColumnName, buildWhere, buildAggregate, bucketExpr, tableExists) have no browser-safe SDK entry; and its package depends on @happyvertical/smrt-jobs, @happyvertical/smrt-tenancy, which do not build for a browser (#3615, #3624, #3625, #3627)."]}},{"id":"reports.runtime","className":"RuntimeReportsRecipe","label":"Reports","summary":"Ask for a report, approve it, and share its live totals with your team.","synonyms":["report","summary","summaries","totals","trends","dashboards"],"models":["@happyvertical/smrt-reports:RuntimeReport"],"nav":[{"label":"Saved reports","model":"@happyvertical/smrt-reports:RuntimeReport","icon":"fileText","description":"Reports your team approved, kept up to date.","noun":"report"}],"requires":[],"help":{"markdown":"# Reports\\n\\nAsk the assistant for a total, comparison, or trend. Review the proposed report\\nand approve it to save it. Your saved reports are shared with your team; each\\nperson sees results using their own access to the underlying information.\\n\\nReports run fresh when opened. You can archive a report to hide it from the\\nactive list and restore it later. Creating and restoring reports needs report\\nwriting access. Reports need a connected server; the smrt planner previews them over its\\nsample records instead. Scheduling, renaming, and exporting reports are not available yet.\\n","fieldRefs":[]},"surfaces":[{"kind":"widget","type":"saved-reports","export":"@happyvertical/smrt-reports/svelte#SavedReportsWidget","label":"Saved reports","description":"Your team\u2019s saved reports with their latest figures.","icon":"fileText","options":[{"key":"limit","type":"integer","label":"Reports shown","default":6,"min":1,"max":24}],"sectionDefault":true,"defaultSpan":4,"minSpan":2,"maxSpan":4},{"kind":"route","path":"/reports","export":"@happyvertical/smrt-reports/svelte#RuntimeReportsRoute","label":"Reports"},{"kind":"route","path":"/reports/:id","export":"@happyvertical/smrt-reports/svelte#RuntimeReportDetailRoute","label":"Report detail"},{"kind":"widget","type":"runtime-report-chart","export":"@happyvertical/smrt-reports/svelte#RuntimeReportChartWidget","label":"Report chart","description":"Chart a measure from a saved report.","icon":"chart","optionsEditor":"@happyvertical/smrt-reports/svelte#RuntimeReportWidgetOptions","options":[{"key":"reportId","type":"text","label":"Report","required":true},{"key":"measure","type":"identifier","label":"Measure","required":true},{"key":"dimension","type":"identifier","label":"Dimension"}],"data":{"load":"@happyvertical/smrt-reports#loadRuntimeReportChart","models":["@happyvertical/smrt-reports:RuntimeReport"]},"defaultSpan":2,"maxSpan":4}],"runtime":"server","demo":{"mode":"server","reasons":["The recipe declares runtime \\"server\\".","Needs a server because its package does not build for a browser: node:crypto/events; @happyvertical/sql root: the sync query builders it needs (validateColumnName, buildWhere, buildAggregate, bucketExpr, tableExists) have no browser-safe SDK entry; and its package depends on @happyvertical/smrt-jobs, @happyvertical/smrt-tenancy, which do not build for a browser (#3615, #3624, #3625, #3627)."]}}],"smrtDependencies":["@happyvertical/smrt-core","@happyvertical/smrt-jobs","@happyvertical/smrt-tenancy"],"browser":{"status":"server-only","issues":["#3615","#3624","#3625","#3627"],"reason":"node:crypto/events; @happyvertical/sql root: the sync query builders it needs (validateColumnName, buildWhere, buildAggregate, bucketExpr, tableExists) have no browser-safe SDK entry","via":["@happyvertical/smrt-jobs","@happyvertical/smrt-tenancy"]},"stampsConstructors":true}`));
|
|
5
5
|
//#endregion
|
|
6
6
|
//#region src/state.ts
|
|
7
7
|
var __defProp = Object.defineProperty;
|