@happyvertical/smrt-reports 0.57.6 → 0.57.8
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/AGENTS.md +10 -0
- package/dist/chunks/runtime-time-D7JZ1e4J.js +1052 -0
- package/dist/chunks/runtime-time-D7JZ1e4J.js.map +1 -0
- package/dist/index.d.ts +7 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +58 -591
- package/dist/index.js.map +1 -1
- package/dist/manifest.json +28 -4
- package/dist/playground.js +1 -1
- package/dist/playground.js.map +1 -1
- package/dist/recipes.d.ts +21 -0
- package/dist/recipes.d.ts.map +1 -1
- package/dist/runtime-compiler.d.ts +7 -40
- package/dist/runtime-compiler.d.ts.map +1 -1
- package/dist/runtime-dimensions.d.ts +43 -0
- package/dist/runtime-dimensions.d.ts.map +1 -0
- package/dist/runtime-memory.d.ts +81 -0
- package/dist/runtime-memory.d.ts.map +1 -0
- package/dist/runtime-plan.d.ts +121 -0
- package/dist/runtime-plan.d.ts.map +1 -0
- package/dist/runtime-report.d.ts.map +1 -1
- package/dist/runtime-server.d.ts.map +1 -1
- package/dist/runtime-spec-hash.d.ts +11 -0
- package/dist/runtime-spec-hash.d.ts.map +1 -0
- package/dist/runtime-spec.d.ts +16 -4
- package/dist/runtime-spec.d.ts.map +1 -1
- package/dist/runtime-time.d.ts +41 -0
- package/dist/runtime-time.d.ts.map +1 -0
- package/dist/smrt-knowledge.json +37 -12
- package/dist/spec.d.ts +25 -0
- package/dist/spec.d.ts.map +1 -0
- package/dist/spec.js +2 -0
- package/dist/state.js +1 -1
- package/dist/state.js.map +1 -1
- package/dist/svelte/ReportConfirmation.svelte +97 -24
- package/dist/svelte/ReportConfirmation.svelte.d.ts +20 -0
- package/dist/svelte/ReportConfirmation.svelte.d.ts.map +1 -1
- package/dist/svelte/ReportDetail.svelte +263 -12
- package/dist/svelte/ReportDetail.svelte.d.ts +10 -1
- package/dist/svelte/ReportDetail.svelte.d.ts.map +1 -1
- package/dist/svelte/ReportPicker.svelte +47 -14
- package/dist/svelte/ReportPicker.svelte.d.ts +3 -0
- package/dist/svelte/ReportPicker.svelte.d.ts.map +1 -1
- package/dist/svelte/ReportResult.svelte +216 -35
- package/dist/svelte/ReportResult.svelte.d.ts +8 -2
- package/dist/svelte/ReportResult.svelte.d.ts.map +1 -1
- package/dist/svelte/RuntimeReportWidgetOptions.svelte +9 -1
- package/dist/svelte/RuntimeReportWidgetOptions.svelte.d.ts.map +1 -1
- package/dist/svelte/SavedReportCard.svelte +242 -0
- package/dist/svelte/SavedReportCard.svelte.d.ts +30 -0
- package/dist/svelte/SavedReportCard.svelte.d.ts.map +1 -0
- package/dist/svelte/SavedReports.svelte +206 -33
- package/dist/svelte/SavedReports.svelte.d.ts +13 -0
- package/dist/svelte/SavedReports.svelte.d.ts.map +1 -1
- package/dist/svelte/SavedReportsWidget.svelte +59 -0
- package/dist/svelte/SavedReportsWidget.svelte.d.ts +19 -0
- package/dist/svelte/SavedReportsWidget.svelte.d.ts.map +1 -0
- package/dist/svelte/client.d.ts.map +1 -1
- package/dist/svelte/client.js +3 -0
- package/dist/svelte/describe.d.ts +94 -0
- package/dist/svelte/describe.d.ts.map +1 -0
- package/dist/svelte/describe.js +249 -0
- package/dist/svelte/index.d.ts +4 -1
- package/dist/svelte/index.d.ts.map +1 -1
- package/dist/svelte/index.js +4 -1
- package/dist/svelte/messages.d.ts +48 -0
- package/dist/svelte/messages.d.ts.map +1 -1
- package/dist/svelte/messages.js +59 -11
- package/dist/svelte/playground.d.ts +2 -2
- package/dist/svelte/playground.d.ts.map +1 -1
- package/dist/svelte/playground.js +1 -1
- package/dist/svelte/types.d.ts +2 -0
- package/dist/svelte/types.d.ts.map +1 -1
- package/package.json +13 -9
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runtime-time-D7JZ1e4J.js","names":["year"],"sources":["../../src/runtime-spec.ts","../../src/runtime-plan.ts","../../src/runtime-dimensions.ts","../../src/runtime-memory.ts","../../src/runtime-time.ts"],"sourcesContent":["/**\n * Declarative runtime report specification (#3711).\n *\n * A runtime report is DATA, never code: a closed, versioned structure that a\n * user (or the assistant on a user's behalf) can propose at runtime. The spec\n * grammar deliberately has no free-form SQL, no expression language, no raw\n * identifiers and no join syntax. Every name in it is later resolved against\n * the ObjectRegistry field policy by `compileRuntimeReportSpec()`; this module\n * only enforces the STRUCTURE (shape, bounds, alias hygiene) and normalizes\n * defaults so equal specs hash equally.\n *\n * The parser accepts no authority. Nothing in a spec names a tenant, a\n * principal, a permission, a table, a column alias that is not a plain\n * identifier, or an SQL fragment.\n *\n * Browser-safe (#4100): this module imports no Node built-in and, of\n * smrt-core, only the import-free `SmrtError` subpath (never the root entry),\n * so the grammar ships on the `./spec` subpath. The `node:crypto` hash lives in\n * `runtime-spec-hash.ts`, which only server modules import.\n */\n\nimport { SmrtError } from '@happyvertical/smrt-core/smrt-error';\n\nexport const RUNTIME_REPORT_SPEC_VERSION = 1 as const;\n\nexport const RUNTIME_REPORT_LIMITS = Object.freeze({\n maxTitleLength: 120,\n maxDescriptionLength: 500,\n maxDimensions: 4,\n maxMeasures: 6,\n maxFilters: 12,\n maxHaving: 4,\n maxSort: 3,\n maxInValues: 100,\n maxStringValueLength: 256,\n defaultRowLimit: 100,\n maxRowLimit: 1000,\n maxAliasLength: 40,\n maxFieldNameLength: 64,\n maxSourceIdLength: 120,\n});\n\nexport const RUNTIME_REPORT_BUCKETS = [\n 'minute',\n 'hour',\n 'day',\n 'week',\n 'month',\n 'quarter',\n 'year',\n] as const;\nexport type RuntimeReportBucket = (typeof RUNTIME_REPORT_BUCKETS)[number];\n\nexport const RUNTIME_REPORT_MEASURE_FNS = [\n 'count',\n 'countDistinct',\n 'sum',\n 'avg',\n 'min',\n 'max',\n] as const;\nexport type RuntimeReportMeasureFn =\n (typeof RUNTIME_REPORT_MEASURE_FNS)[number];\n\nexport const RUNTIME_REPORT_FILTER_OPS = [\n 'eq',\n 'ne',\n 'gt',\n 'gte',\n 'lt',\n 'lte',\n 'in',\n 'notIn',\n 'contains',\n 'isNull',\n 'isNotNull',\n] as const;\nexport type RuntimeReportFilterOp = (typeof RUNTIME_REPORT_FILTER_OPS)[number];\n\nexport const RUNTIME_REPORT_HAVING_OPS = [\n 'eq',\n 'ne',\n 'gt',\n 'gte',\n 'lt',\n 'lte',\n] as const;\nexport type RuntimeReportHavingOp = (typeof RUNTIME_REPORT_HAVING_OPS)[number];\n\nexport const RUNTIME_REPORT_CHART_TYPES = [\n 'table',\n 'bar',\n 'line',\n 'pie',\n 'stat',\n] as const;\nexport type RuntimeReportChartType =\n (typeof RUNTIME_REPORT_CHART_TYPES)[number];\n\nexport type RuntimeReportScalar = string | number | boolean;\n\nexport interface RuntimeReportDimension {\n /** Source field name as declared on the model (for example `issuedAt`). */\n field: string;\n /** Output column alias. Defaults to the snake_case field (plus bucket). */\n as: string;\n /** Time bucket; only valid on datetime fields. */\n bucket?: RuntimeReportBucket;\n}\n\nexport interface RuntimeReportMeasure {\n fn: RuntimeReportMeasureFn;\n /** Source field; omitted only for a plain row `count`. */\n field?: string;\n as: string;\n}\n\nexport interface RuntimeReportFilter {\n field: string;\n op: RuntimeReportFilterOp;\n /** Scalar, or a bounded array for `in`/`notIn`; absent for null tests. */\n value?: RuntimeReportScalar | RuntimeReportScalar[];\n}\n\nexport interface RuntimeReportHaving {\n /** A measure alias declared by this spec. */\n measure: string;\n op: RuntimeReportHavingOp;\n value: number;\n}\n\nexport interface RuntimeReportSort {\n /** A dimension or measure alias declared by this spec. */\n by: string;\n direction: 'asc' | 'desc';\n}\n\nexport interface RuntimeReportChart {\n type: RuntimeReportChartType;\n /** Dimension alias for the category/x axis. */\n x?: string;\n /** Measure aliases for the value/y axis. */\n y?: string[];\n}\n\nexport interface RuntimeReportSpec {\n version: typeof RUNTIME_REPORT_SPEC_VERSION;\n title: string;\n description?: string;\n /** A server-owned source id; resolved against an allow-list at compile. */\n source: string;\n dimensions: RuntimeReportDimension[];\n measures: RuntimeReportMeasure[];\n filters: RuntimeReportFilter[];\n having: RuntimeReportHaving[];\n sort: RuntimeReportSort[];\n limit: number;\n chart: RuntimeReportChart;\n}\n\nexport type RuntimeReportErrorCode =\n | 'invalid_spec'\n | 'unknown_source'\n | 'unknown_field'\n | 'invalid_operation'\n | 'invalid_value'\n | 'tenant_required'\n | 'confirmation_required'\n | 'unsupported_source'\n | 'invalid_result';\n\n/**\n * Raised for any spec or compile rejection. The message is safe to hand back\n * to a model so it can repair the spec; it never echoes restricted-field\n * metadata (a hidden field is reported exactly like an absent one).\n */\nexport class RuntimeReportError extends SmrtError {\n readonly code: RuntimeReportErrorCode;\n readonly path: string;\n /**\n * HTTP-style status so tool loops classify it: 4xx input problems are\n * repairable by the caller, `tenant_required` and `confirmation_required`\n * are denials, results that cannot be represented are server errors.\n */\n readonly status: number;\n\n constructor(code: RuntimeReportErrorCode, path: string, message: string) {\n super(path ? `${path}: ${message}` : message, code, 'validation');\n this.name = 'RuntimeReportError';\n this.code = code;\n this.path = path;\n this.status =\n code === 'tenant_required' || code === 'confirmation_required'\n ? 403\n : code === 'invalid_result'\n ? 500\n : 422;\n }\n}\n\nfunction fail(path: string, message: string): never {\n throw new RuntimeReportError('invalid_spec', path, message);\n}\n\n/** Output aliases that would be reserved words in at least one SQL dialect. */\nconst RESERVED_ALIASES: ReadonlySet<string> = new Set([\n 'all',\n 'and',\n 'as',\n 'asc',\n 'between',\n 'by',\n 'case',\n 'cast',\n 'check',\n 'column',\n 'constraint',\n 'create',\n 'cross',\n 'default',\n 'delete',\n 'desc',\n 'distinct',\n 'drop',\n 'else',\n 'end',\n 'except',\n 'exists',\n 'false',\n 'for',\n 'foreign',\n 'from',\n 'full',\n 'group',\n 'having',\n 'in',\n 'inner',\n 'insert',\n 'intersect',\n 'into',\n 'is',\n 'join',\n 'left',\n 'like',\n 'limit',\n 'natural',\n 'not',\n 'null',\n 'offset',\n 'on',\n 'or',\n 'order',\n 'outer',\n 'primary',\n 'references',\n 'right',\n 'select',\n 'set',\n 'table',\n 'then',\n 'to',\n 'true',\n 'union',\n 'unique',\n 'update',\n 'user',\n 'using',\n 'values',\n 'when',\n 'where',\n 'with',\n]);\n\nconst ALIAS_PATTERN = /^[a-z][a-z0-9_]*$/;\nconst FIELD_PATTERN = /^[A-Za-z][A-Za-z0-9_]*$/;\nconst SOURCE_PATTERN = /^[A-Za-z@][A-Za-z0-9_@./:-]*$/;\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return (\n typeof value === 'object' &&\n value !== null &&\n !Array.isArray(value) &&\n (Object.getPrototypeOf(value) === Object.prototype ||\n Object.getPrototypeOf(value) === null)\n );\n}\n\nfunction strictObject(\n value: unknown,\n path: string,\n allowed: readonly string[],\n): Record<string, unknown> {\n if (!isRecord(value)) fail(path, 'must be an object');\n for (const key of Object.keys(value)) {\n if (!allowed.includes(key)) fail(`${path}.${key}`, 'is not a known key');\n }\n return value;\n}\n\nfunction strictArray(\n value: unknown,\n path: string,\n max: number,\n min = 0,\n): unknown[] {\n if (value === undefined) return [];\n if (!Array.isArray(value)) fail(path, 'must be an array');\n if (value.length > max) fail(path, `must have at most ${max} entries`);\n if (value.length < min) fail(path, `must have at least ${min} entries`);\n return value;\n}\n\nfunction text(\n value: unknown,\n path: string,\n max: number,\n options: { optional?: boolean } = {},\n): string {\n if (typeof value !== 'string') {\n if (options.optional && value === undefined) return '';\n fail(path, 'must be a string');\n }\n const trimmed = value.trim();\n if (trimmed.length === 0 && !options.optional) {\n fail(path, 'must not be empty');\n }\n if (trimmed.length > max) fail(path, `must be at most ${max} characters`);\n // Titles/descriptions are echoed into UIs and prompts: keep them printable.\n // biome-ignore lint/suspicious/noControlCharactersInRegex: intentional guard\n if (/[\\u0000-\\u0008\\u000b\\u000c\\u000e-\\u001f\\u007f]/.test(trimmed)) {\n fail(path, 'must not contain control characters');\n }\n return trimmed;\n}\n\nfunction oneOf<T extends string>(\n value: unknown,\n path: string,\n allowed: readonly T[],\n): T {\n if (typeof value !== 'string' || !allowed.includes(value as T)) {\n fail(path, `must be one of: ${allowed.join(', ')}`);\n }\n return value as T;\n}\n\nfunction fieldName(value: unknown, path: string): string {\n if (typeof value !== 'string') fail(path, 'must be a string');\n if (\n value.length === 0 ||\n value.length > RUNTIME_REPORT_LIMITS.maxFieldNameLength ||\n !FIELD_PATTERN.test(value)\n ) {\n fail(path, 'must be a plain field name (letters, digits, underscore)');\n }\n return value;\n}\n\nfunction alias(value: unknown, path: string): string {\n if (typeof value !== 'string') fail(path, 'must be a string');\n if (\n value.length === 0 ||\n value.length > RUNTIME_REPORT_LIMITS.maxAliasLength ||\n !ALIAS_PATTERN.test(value)\n ) {\n fail(\n path,\n `must be a lowercase identifier of at most ${RUNTIME_REPORT_LIMITS.maxAliasLength} characters (a-z, 0-9, underscore)`,\n );\n }\n if (RESERVED_ALIASES.has(value)) fail(path, `'${value}' is a reserved word`);\n return value;\n}\n\nfunction scalar(value: unknown, path: string): RuntimeReportScalar {\n if (typeof value === 'string') {\n if (value.length > RUNTIME_REPORT_LIMITS.maxStringValueLength) {\n fail(\n path,\n `must be at most ${RUNTIME_REPORT_LIMITS.maxStringValueLength} characters`,\n );\n }\n if (value.includes('\\u0000')) fail(path, 'must not contain NUL');\n return value;\n }\n if (typeof value === 'number') {\n if (!Number.isFinite(value)) fail(path, 'must be a finite number');\n return value;\n }\n if (typeof value === 'boolean') return value;\n return fail(path, 'must be a string, number or boolean');\n}\n\nfunction snake(name: string): string {\n return name\n .replace(/([a-z\\d])([A-Z])/g, '$1_$2')\n .replace(/([A-Z]+)([A-Z][a-z])/g, '$1_$2')\n .toLowerCase();\n}\n\nfunction parseDimension(value: unknown, path: string): RuntimeReportDimension {\n const raw = strictObject(value, path, ['field', 'as', 'bucket']);\n const field = fieldName(raw.field, `${path}.field`);\n const bucket =\n raw.bucket === undefined\n ? undefined\n : oneOf(raw.bucket, `${path}.bucket`, RUNTIME_REPORT_BUCKETS);\n const as =\n raw.as === undefined\n ? alias(bucket ? `${snake(field)}_${bucket}` : snake(field), `${path}.as`)\n : alias(raw.as, `${path}.as`);\n return { field, as, ...(bucket ? { bucket } : {}) };\n}\n\nfunction parseMeasure(value: unknown, path: string): RuntimeReportMeasure {\n const raw = strictObject(value, path, ['fn', 'field', 'as']);\n const fn = oneOf(raw.fn, `${path}.fn`, RUNTIME_REPORT_MEASURE_FNS);\n const field =\n raw.field === undefined ? undefined : fieldName(raw.field, `${path}.field`);\n if (!field && fn !== 'count') fail(`${path}.field`, `is required for ${fn}`);\n const as =\n raw.as === undefined\n ? alias(\n field ? `${snake(fn)}_${snake(field)}` : 'row_count',\n `${path}.as`,\n )\n : alias(raw.as, `${path}.as`);\n return { fn, ...(field ? { field } : {}), as };\n}\n\nfunction parseFilter(value: unknown, path: string): RuntimeReportFilter {\n const raw = strictObject(value, path, ['field', 'op', 'value']);\n const field = fieldName(raw.field, `${path}.field`);\n const op = oneOf(raw.op, `${path}.op`, RUNTIME_REPORT_FILTER_OPS);\n if (op === 'isNull' || op === 'isNotNull') {\n if (raw.value !== undefined)\n fail(`${path}.value`, `must be omitted for ${op}`);\n return { field, op };\n }\n if (raw.value === undefined) fail(`${path}.value`, `is required for ${op}`);\n if (op === 'in' || op === 'notIn') {\n const values = strictArray(\n raw.value,\n `${path}.value`,\n RUNTIME_REPORT_LIMITS.maxInValues,\n 1,\n ).map((entry, index) => scalar(entry, `${path}.value[${index}]`));\n return { field, op, value: values };\n }\n if (Array.isArray(raw.value))\n fail(`${path}.value`, `must be a scalar for ${op}`);\n const parsed = scalar(raw.value, `${path}.value`);\n if (op === 'contains' && typeof parsed !== 'string') {\n fail(`${path}.value`, 'must be a string for contains');\n }\n return { field, op, value: parsed };\n}\n\nfunction parseHaving(value: unknown, path: string): RuntimeReportHaving {\n const raw = strictObject(value, path, ['measure', 'op', 'value']);\n const measure = alias(raw.measure, `${path}.measure`);\n const op = oneOf(raw.op, `${path}.op`, RUNTIME_REPORT_HAVING_OPS);\n if (typeof raw.value !== 'number' || !Number.isFinite(raw.value)) {\n fail(`${path}.value`, 'must be a finite number');\n }\n return { measure, op, value: raw.value };\n}\n\nfunction parseSort(value: unknown, path: string): RuntimeReportSort {\n const raw = strictObject(value, path, ['by', 'direction']);\n const by = alias(raw.by, `${path}.by`);\n const direction =\n raw.direction === undefined\n ? 'asc'\n : oneOf(raw.direction, `${path}.direction`, ['asc', 'desc'] as const);\n return { by, direction };\n}\n\n/**\n * Parse and normalize an untrusted spec (an object, or its JSON string form).\n *\n * Structural only: aliases are unique and well-formed, sort/having/chart refer\n * to aliases the spec itself declares, and every bound is enforced. Field,\n * source, permission and type checks happen at compile time because they\n * depend on the registry and the live principal.\n */\nexport function parseRuntimeReportSpec(input: unknown): RuntimeReportSpec {\n let candidate = input;\n if (typeof input === 'string') {\n if (input.length > 64 * 1024) fail('', 'spec JSON is too large');\n try {\n candidate = JSON.parse(input);\n } catch {\n fail('', 'spec is not valid JSON');\n }\n }\n const raw = strictObject(candidate, 'spec', [\n 'version',\n 'title',\n 'description',\n 'source',\n 'dimensions',\n 'measures',\n 'filters',\n 'having',\n 'sort',\n 'limit',\n 'chart',\n ]);\n if (\n raw.version !== undefined &&\n raw.version !== RUNTIME_REPORT_SPEC_VERSION\n ) {\n fail(\n 'spec.version',\n `unsupported version (expected ${RUNTIME_REPORT_SPEC_VERSION})`,\n );\n }\n const title = text(\n raw.title,\n 'spec.title',\n RUNTIME_REPORT_LIMITS.maxTitleLength,\n );\n const description = text(\n raw.description,\n 'spec.description',\n RUNTIME_REPORT_LIMITS.maxDescriptionLength,\n { optional: true },\n );\n if (\n typeof raw.source !== 'string' ||\n raw.source.length === 0 ||\n raw.source.length > RUNTIME_REPORT_LIMITS.maxSourceIdLength ||\n !SOURCE_PATTERN.test(raw.source)\n ) {\n fail('spec.source', 'must be a source id');\n }\n\n const dimensions = strictArray(\n raw.dimensions,\n 'spec.dimensions',\n RUNTIME_REPORT_LIMITS.maxDimensions,\n ).map((entry, index) => parseDimension(entry, `spec.dimensions[${index}]`));\n const measures = strictArray(\n raw.measures,\n 'spec.measures',\n RUNTIME_REPORT_LIMITS.maxMeasures,\n 1,\n ).map((entry, index) => parseMeasure(entry, `spec.measures[${index}]`));\n const filters = strictArray(\n raw.filters,\n 'spec.filters',\n RUNTIME_REPORT_LIMITS.maxFilters,\n ).map((entry, index) => parseFilter(entry, `spec.filters[${index}]`));\n const having = strictArray(\n raw.having,\n 'spec.having',\n RUNTIME_REPORT_LIMITS.maxHaving,\n ).map((entry, index) => parseHaving(entry, `spec.having[${index}]`));\n const sort = strictArray(\n raw.sort,\n 'spec.sort',\n RUNTIME_REPORT_LIMITS.maxSort,\n ).map((entry, index) => parseSort(entry, `spec.sort[${index}]`));\n\n const dimensionAliases = new Set<string>();\n const measureAliases = new Set<string>();\n const seen = new Set<string>();\n for (const [index, dimension] of dimensions.entries()) {\n if (seen.has(dimension.as)) {\n fail(`spec.dimensions[${index}].as`, `duplicate alias '${dimension.as}'`);\n }\n seen.add(dimension.as);\n dimensionAliases.add(dimension.as);\n }\n for (const [index, measure] of measures.entries()) {\n if (seen.has(measure.as)) {\n fail(`spec.measures[${index}].as`, `duplicate alias '${measure.as}'`);\n }\n seen.add(measure.as);\n measureAliases.add(measure.as);\n }\n for (const [index, entry] of having.entries()) {\n if (!measureAliases.has(entry.measure)) {\n fail(`spec.having[${index}].measure`, 'must be a declared measure alias');\n }\n }\n for (const [index, entry] of sort.entries()) {\n if (!seen.has(entry.by)) {\n fail(\n `spec.sort[${index}].by`,\n 'must be a declared dimension or measure alias',\n );\n }\n }\n\n let limit: number = RUNTIME_REPORT_LIMITS.defaultRowLimit;\n if (raw.limit !== undefined) {\n if (\n typeof raw.limit !== 'number' ||\n !Number.isSafeInteger(raw.limit) ||\n raw.limit < 1 ||\n raw.limit > RUNTIME_REPORT_LIMITS.maxRowLimit\n ) {\n fail(\n 'spec.limit',\n `must be an integer between 1 and ${RUNTIME_REPORT_LIMITS.maxRowLimit}`,\n );\n }\n limit = raw.limit;\n }\n\n let chart: RuntimeReportChart = { type: 'table' };\n if (raw.chart !== undefined) {\n const rawChart = strictObject(raw.chart, 'spec.chart', ['type', 'x', 'y']);\n const type = oneOf(\n rawChart.type,\n 'spec.chart.type',\n RUNTIME_REPORT_CHART_TYPES,\n );\n const x =\n rawChart.x === undefined ? undefined : alias(rawChart.x, 'spec.chart.x');\n if (x !== undefined && !dimensionAliases.has(x)) {\n fail('spec.chart.x', 'must be a declared dimension alias');\n }\n const y = strictArray(\n rawChart.y,\n 'spec.chart.y',\n RUNTIME_REPORT_LIMITS.maxMeasures,\n ).map((entry, index) => alias(entry, `spec.chart.y[${index}]`));\n for (const [index, name] of y.entries()) {\n if (!measureAliases.has(name)) {\n fail(`spec.chart.y[${index}]`, 'must be a declared measure alias');\n }\n }\n chart = { type, ...(x ? { x } : {}), ...(y.length > 0 ? { y } : {}) };\n }\n\n return {\n version: RUNTIME_REPORT_SPEC_VERSION,\n title,\n ...(description ? { description } : {}),\n source: raw.source as string,\n dimensions,\n measures,\n filters,\n having,\n sort,\n limit,\n chart,\n };\n}\n\nfunction canonicalize(value: unknown): unknown {\n if (Array.isArray(value)) return value.map(canonicalize);\n if (isRecord(value)) {\n return Object.fromEntries(\n Object.keys(value)\n .sort()\n .map((key) => [key, canonicalize(value[key])]),\n );\n }\n return value;\n}\n\n/**\n * Stable JSON text for storage (sorted keys). It is also the exact input of\n * `runtimeReportSpecHash` (server) and `runtimeReportSpecDigest` (browser).\n */\nexport function serializeRuntimeReportSpec(spec: RuntimeReportSpec): string {\n return JSON.stringify(canonicalize(spec));\n}\n\n/**\n * Browser-safe twin of the server's `runtimeReportSpecHash`: the same SHA-256\n * hex over the same canonical JSON, computed with Web Crypto. Asynchronous\n * because `crypto.subtle` is; it needs a secure context (https or localhost).\n */\nexport async function runtimeReportSpecDigest(\n spec: RuntimeReportSpec,\n): Promise<string> {\n const subtle = globalThis.crypto?.subtle;\n if (!subtle) {\n throw new Error(\n 'runtimeReportSpecDigest needs Web Crypto (crypto.subtle), which browsers offer only in a secure context',\n );\n }\n const bytes = new TextEncoder().encode(serializeRuntimeReportSpec(spec));\n const digest = new Uint8Array(await subtle.digest('SHA-256', bytes));\n return Array.from(digest, (byte) => byte.toString(16).padStart(2, '0')).join(\n '',\n );\n}\n","/**\n * Runtime report planning rules shared by the SQL compiler and the in-memory\n * runner (#3711, #4100).\n *\n * Everything here is a pure function of a parsed spec and a resolved field\n * set: which operators and aggregates a field type admits, how filter values\n * are coerced, how result columns are described and how cells are normalized.\n * `compileRuntimeReportSpec()` (server, ObjectRegistry + SQL) and\n * `runRuntimeReportInMemory()` (browser-safe) both call these, so the two\n * paths cannot disagree about what a spec means. Browser-safe: no Node\n * built-ins, no registry.\n */\n\nimport {\n type RuntimeReportChart,\n RuntimeReportError,\n type RuntimeReportFilter,\n type RuntimeReportSpec,\n} from './runtime-spec.js';\n\nexport type RuntimeReportColumnType =\n | 'string'\n | 'integer'\n | 'decimal'\n | 'boolean'\n | 'datetime'\n | 'id';\n\nexport interface RuntimeReportColumn {\n id: string;\n label: string;\n role: 'dimension' | 'measure';\n type: RuntimeReportColumnType;\n /** Source field this column derives from (absent for a row count). */\n field?: string;\n fn?: string;\n bucket?: string;\n /** Field format hint carried from the model (for example `money`). */\n format?: string;\n}\n\nexport interface RuntimeReportResult {\n version: 1;\n specHash: string;\n title: string;\n columns: RuntimeReportColumn[];\n rows: Record<string, string | number | boolean | null>[];\n rowCount: number;\n /** True when more rows existed than the spec/host limit. */\n truncated: boolean;\n ranAt: string;\n chart: RuntimeReportChart;\n}\n\nexport interface RuntimeReportSourceDescription {\n id: string;\n label: string;\n description?: string;\n /** Fields the live principal may group by, filter on or aggregate. */\n fields: {\n name: string;\n label: string;\n type: RuntimeReportColumnType;\n format?: string;\n /** Declared values of a closed text field (a status, a kind). */\n enum?: readonly string[];\n /**\n * How the field reads as a grouping, when it is a useful one: a time axis\n * (bucket it), a category (a status, a kind, a flag) or a relation (a\n * customer). Absent: not offered as a grouping (ids, free text, hashes,\n * internal bookkeeping), though a spec may still name it.\n */\n dimension?: RuntimeReportDimensionKind;\n filterOperators: readonly string[];\n aggregates: readonly string[];\n }[];\n /** Datetime fields a report can bucket or filter by period, default first. */\n timeFields: string[];\n /** The source's natural date (an invoice's issue date): what \"by month\" buckets. */\n defaultTimeField?: string;\n /** Category and relation fields worth grouping by, most useful first. */\n dimensions: string[];\n}\n\n/** How a field reads as a grouping; see `RuntimeReportSourceDescription`. */\nexport type RuntimeReportDimensionKind = 'time' | 'category' | 'relation';\n\n/**\n * Grouping hints a source definition may declare (#4100). `timeField` names\n * the natural date; `dimensions` lists, in order, the fields worth grouping\n * by. Both use canonical public names; unknown names reject the source.\n * Omitted, both are derived from field metadata (`runtime-dimensions.ts`).\n */\nexport interface RuntimeReportDimensionHints {\n timeField?: string;\n dimensions?: readonly string[];\n}\n\n/** A nameable source field after every exposure rule has been applied. */\nexport interface RuntimeReportPlanField {\n name: string;\n type: RuntimeReportColumnType;\n format?: string;\n label: string;\n /** Declared values of a closed text field. */\n enum?: readonly string[];\n /** `@field({ ui: { format: 'date' } })`: a business date, not a timestamp. */\n businessDate?: boolean;\n}\n\nconst UUID_PATTERN =\n /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;\n\nexport function humanizeRuntimeReportName(name: string): string {\n return name\n .replace(/([a-z\\d])([A-Z])/g, '$1 $2')\n .replace(/[_-]+/g, ' ')\n .replace(/^./, (value) => value.toUpperCase());\n}\n\nexport function unknownRuntimeReportField(path: string, name: string): never {\n throw new RuntimeReportError(\n 'unknown_field',\n path,\n `'${name}' is not a field available on this source`,\n );\n}\n\nfunction badOperation(path: string, message: string): never {\n throw new RuntimeReportError('invalid_operation', path, message);\n}\n\nfunction badValue(path: string, message: string): never {\n throw new RuntimeReportError('invalid_value', path, message);\n}\n\nexport const RUNTIME_REPORT_OPERATORS_BY_TYPE: Readonly<\n Record<RuntimeReportColumnType, readonly RuntimeReportFilter['op'][]>\n> = {\n string: [\n 'eq',\n 'ne',\n 'gt',\n 'gte',\n 'lt',\n 'lte',\n 'in',\n 'notIn',\n 'contains',\n 'isNull',\n 'isNotNull',\n ],\n integer: [\n 'eq',\n 'ne',\n 'gt',\n 'gte',\n 'lt',\n 'lte',\n 'in',\n 'notIn',\n 'isNull',\n 'isNotNull',\n ],\n decimal: [\n 'eq',\n 'ne',\n 'gt',\n 'gte',\n 'lt',\n 'lte',\n 'in',\n 'notIn',\n 'isNull',\n 'isNotNull',\n ],\n datetime: [\n 'eq',\n 'ne',\n 'gt',\n 'gte',\n 'lt',\n 'lte',\n 'in',\n 'notIn',\n 'isNull',\n 'isNotNull',\n ],\n boolean: ['eq', 'ne', 'isNull', 'isNotNull'],\n id: ['eq', 'ne', 'in', 'notIn', 'isNull', 'isNotNull'],\n};\n\nexport function runtimeReportAggregatesFor(\n type: RuntimeReportColumnType,\n): readonly string[] {\n if (type === 'integer' || type === 'decimal') {\n return ['count', 'countDistinct', 'sum', 'avg', 'min', 'max'];\n }\n if (type === 'datetime') return ['count', 'countDistinct', 'min', 'max'];\n return ['count', 'countDistinct'];\n}\n\n/** Reject an operator the field's type does not admit. */\nexport function assertRuntimeReportFilterOperator(\n filter: RuntimeReportFilter,\n type: RuntimeReportColumnType,\n path: string,\n): void {\n if (!RUNTIME_REPORT_OPERATORS_BY_TYPE[type].includes(filter.op)) {\n badOperation(\n `${path}.op`,\n `'${filter.op}' is not valid for ${type} fields`,\n );\n }\n}\n\n/** Coerce one filter value to the field's type (ids lower-cased, datetimes to `Date`). */\nexport function coerceRuntimeReportValue(\n type: RuntimeReportColumnType,\n value: unknown,\n path: string,\n): string | number | boolean | Date {\n switch (type) {\n case 'string':\n if (typeof value !== 'string') badValue(path, 'must be a string');\n return value;\n case 'integer':\n if (typeof value !== 'number' || !Number.isSafeInteger(value)) {\n badValue(path, 'must be a safe integer');\n }\n return value;\n case 'decimal':\n if (typeof value !== 'number' || !Number.isFinite(value)) {\n badValue(path, 'must be a finite number');\n }\n return value;\n case 'boolean':\n if (typeof value !== 'boolean') badValue(path, 'must be true or false');\n return value;\n case 'datetime': {\n if (typeof value !== 'string')\n badValue(path, 'must be an ISO-8601 string');\n const parsed = new Date(value);\n if (Number.isNaN(parsed.getTime()) || !/^\\d{4}-\\d{2}-\\d{2}/.test(value)) {\n badValue(path, 'must be an ISO-8601 date or timestamp');\n }\n return parsed;\n }\n case 'id':\n if (typeof value !== 'string' || !UUID_PATTERN.test(value)) {\n badValue(path, 'must be a UUID');\n }\n return value.toLowerCase();\n }\n}\n\n/**\n * Resolve a source's `fields` allow-list and `excludeFields` deny-list against\n * the canonical names it declares. Unknown or malformed names reject the whole\n * source (`unsupported_source`), misspelled exclusions included.\n */\nexport function resolveRuntimeReportFieldPolicy(\n source: {\n fields?: readonly string[];\n excludeFields?: readonly string[];\n timeField?: string;\n dimensions?: readonly string[];\n },\n knownNames: ReadonlySet<string>,\n): { included?: Set<string>; excluded?: Set<string> } {\n const policy = (\n key: 'fields' | 'excludeFields' | 'dimensions',\n ): Set<string> | undefined => {\n const value = source[key];\n if (value === undefined) return undefined;\n if (\n !Array.isArray(value) ||\n Array.from(value).some(\n (name) => typeof name !== 'string' || !knownNames.has(name),\n )\n ) {\n throw new RuntimeReportError(\n 'unsupported_source',\n `source.${key}`,\n `${key} must contain canonical field names declared on the source`,\n );\n }\n return new Set(value);\n };\n const included = policy('fields');\n const excluded = policy('excludeFields');\n policy('dimensions');\n if (\n source.timeField !== undefined &&\n (typeof source.timeField !== 'string' || !knownNames.has(source.timeField))\n ) {\n throw new RuntimeReportError(\n 'unsupported_source',\n 'source.timeField',\n 'timeField must be a canonical field name declared on the source',\n );\n }\n return {\n ...(included ? { included } : {}),\n ...(excluded ? { excluded } : {}),\n };\n}\n\nfunction measureColumnType(\n fn: string,\n field: RuntimeReportPlanField | undefined,\n): RuntimeReportColumnType {\n if (fn === 'count' || fn === 'countDistinct') return 'integer';\n if (fn === 'avg') return 'decimal';\n return field?.type ?? 'decimal';\n}\n\n/**\n * Validate the spec's dimensions and measures against the resolved fields and\n * describe the result columns, dimensions first. Filters are validated by the\n * caller, after this, so error order matches across both runners.\n */\nexport function planRuntimeReportColumns(\n spec: RuntimeReportSpec,\n fields: ReadonlyMap<string, RuntimeReportPlanField>,\n): RuntimeReportColumn[] {\n const lookup = (name: string, path: string): RuntimeReportPlanField => {\n const field = fields.get(name);\n if (!field) unknownRuntimeReportField(path, name);\n return field;\n };\n const columns: RuntimeReportColumn[] = [];\n for (const [index, dimension] of spec.dimensions.entries()) {\n const path = `spec.dimensions[${index}]`;\n const field = lookup(dimension.field, `${path}.field`);\n if (dimension.bucket && field.type !== 'datetime') {\n badOperation(\n `${path}.bucket`,\n 'buckets are only valid on datetime fields',\n );\n }\n columns.push({\n id: dimension.as,\n label: humanizeRuntimeReportName(dimension.as),\n role: 'dimension',\n type: dimension.bucket ? 'datetime' : field.type,\n field: field.name,\n ...(dimension.bucket ? { bucket: dimension.bucket } : {}),\n ...(field.format && !dimension.bucket ? { format: field.format } : {}),\n });\n }\n for (const [index, measure] of spec.measures.entries()) {\n const path = `spec.measures[${index}]`;\n const field = measure.field\n ? lookup(measure.field, `${path}.field`)\n : undefined;\n if (\n (measure.fn === 'sum' || measure.fn === 'avg') &&\n field?.type !== 'integer' &&\n field?.type !== 'decimal'\n ) {\n badOperation(`${path}.fn`, `${measure.fn} requires a numeric field`);\n }\n if (\n (measure.fn === 'min' || measure.fn === 'max') &&\n field?.type !== 'integer' &&\n field?.type !== 'decimal' &&\n field?.type !== 'datetime'\n ) {\n badOperation(\n `${path}.fn`,\n `${measure.fn} requires a numeric or datetime field`,\n );\n }\n const keepsFormat =\n field?.format &&\n (measure.fn === 'sum' ||\n measure.fn === 'min' ||\n measure.fn === 'max' ||\n measure.fn === 'avg');\n columns.push({\n id: measure.as,\n label: humanizeRuntimeReportName(measure.as),\n role: 'measure',\n type: measureColumnType(measure.fn, field),\n ...(field ? { field: field.name } : {}),\n fn: measure.fn,\n ...(keepsFormat ? { format: field?.format } : {}),\n });\n }\n return columns;\n}\n\n/** Normalize one result cell to the wire shape (safe integers, ISO datetimes). */\nexport function normalizeRuntimeReportCell(\n column: RuntimeReportColumn,\n value: unknown,\n): string | number | boolean | null {\n if (value === null || value === undefined) return null;\n if (value instanceof Date) return value.toISOString();\n if (typeof value === 'bigint') {\n const asNumber = Number(value);\n if (!Number.isSafeInteger(asNumber)) {\n throw new RuntimeReportError(\n 'invalid_result',\n column.id,\n 'integer result exceeds the JavaScript safe range',\n );\n }\n return asNumber;\n }\n if (column.type === 'boolean') {\n if (value === 1 || value === '1' || value === 'true' || value === true) {\n return true;\n }\n if (value === 0 || value === '0' || value === 'false' || value === false) {\n return false;\n }\n }\n if (column.type === 'integer' || column.type === 'decimal') {\n const numeric = typeof value === 'number' ? value : Number(value);\n if (!Number.isFinite(numeric)) {\n throw new RuntimeReportError(\n 'invalid_result',\n column.id,\n 'numeric result is not finite',\n );\n }\n if (column.type === 'integer' && !Number.isSafeInteger(numeric)) {\n throw new RuntimeReportError(\n 'invalid_result',\n column.id,\n 'integer result exceeds the JavaScript safe range',\n );\n }\n return numeric;\n }\n if (\n typeof value === 'string' ||\n typeof value === 'number' ||\n typeof value === 'boolean'\n ) {\n return value;\n }\n return String(value);\n}\n","/**\n * Grouping and time hints for a report source (#4100): which fields read as a\n * time axis, which one is the source's natural date, and which are worth\n * grouping by, most useful first.\n *\n * Both runners' source descriptions (`describeRuntimeReportSource()`,\n * `describeRuntimeReportMemorySource()`) carry these, so an assistant or a\n * report builder offers \"Issue date by month\", \"Status\" and \"Customer\", never\n * an id, a hash or internal bookkeeping. A source definition may declare them\n * (`timeField`, `dimensions`); otherwise they are derived from field metadata\n * in this order:\n *\n * - time fields: every datetime field except a soft-delete stamp;\n * - the natural date: a business date (`@field({ ui: { format: 'date' } })`),\n * else the first datetime that is not bookkeeping (`createdAt`, `updatedAt`,\n * `syncedAt`, `last…At`), else `createdAt`;\n * - groupings: closed text fields (declared `enum`) and booleans as\n * categories, foreign keys as relations; never `id`, free text, or a field\n * whose name marks it internal (`…Hash`, `…Json`, `…Token`, `…Authority`,\n * `…Snapshot`, `external…`, `historical…`), ranked status, then kind/type,\n * then people and things (customer, vendor, product), then other categories,\n * other relations, then flags.\n *\n * These are hints for choosing, not authority: a spec may still group by any\n * field the source exposes, and the compiler's field policy is unchanged.\n * Browser-safe: no Node built-ins, no registry.\n */\n\nimport type {\n RuntimeReportDimensionHints,\n RuntimeReportDimensionKind,\n RuntimeReportPlanField,\n RuntimeReportSourceDescription,\n} from './runtime-plan.js';\nimport {\n RUNTIME_REPORT_OPERATORS_BY_TYPE,\n runtimeReportAggregatesFor,\n} from './runtime-plan.js';\n\n/** Names that mark plumbing, never a grouping a person asks for. */\nconst INTERNAL_NAME =\n /^(?:id|_.*)$|(?:Hash|Json|Token|Secret|Signature|Authority|Snapshot|Checksum|Cursor|Etag)$|^(?:external|historical)[A-Z]/;\n/** Timestamps a framework or a sync writes; never the natural date. */\nconst BOOKKEEPING_TIME =\n /^(?:created|updated|deleted|synced|archived)At$|^last[A-Z]\\w*At$/;\nconst STATUS_NAME = /^(?:status|state)$|(?:Status|State)$/;\nconst KIND_NAME =\n /^(?:kind|type|category|method|channel|stage|priority|segment|tier|source)$|(?:Kind|Type|Category|Method|Channel|Stage|Priority|Segment|Tier)$/;\nconst PARTY_RELATION =\n /^(?:customer|vendor|supplier|client|member|employee|owner|assignee|product|location|project|account|contact)Id$/;\n/** More distinct values than this is not a category anyone groups by. */\nconst MAX_CATEGORY_VALUES = 50;\n\nfunction kindOf(\n field: RuntimeReportPlanField,\n): RuntimeReportDimensionKind | undefined {\n if (field.type === 'datetime') {\n return field.name === 'deletedAt' ? undefined : 'time';\n }\n if (INTERNAL_NAME.test(field.name)) return undefined;\n if (field.type === 'boolean') return 'category';\n if (\n field.type === 'string' &&\n field.enum &&\n field.enum.length > 0 &&\n field.enum.length <= MAX_CATEGORY_VALUES\n ) {\n return 'category';\n }\n if (field.type === 'id' && /Id$/.test(field.name)) return 'relation';\n return undefined;\n}\n\nfunction rank(field: RuntimeReportPlanField): number {\n if (field.type === 'boolean') return 10;\n if (field.type === 'id') return PARTY_RELATION.test(field.name) ? 70 : 30;\n if (STATUS_NAME.test(field.name)) return 100;\n if (KIND_NAME.test(field.name)) return 80;\n return 50;\n}\n\nexport interface RuntimeReportDimensionPlan {\n kinds: Map<string, RuntimeReportDimensionKind>;\n timeFields: string[];\n defaultTimeField?: string;\n dimensions: string[];\n}\n\n/**\n * Plan the time and grouping hints for resolved fields. Declared hints that\n * name a field this principal cannot see are dropped (the field set already\n * hides it), never reported.\n */\nexport function planRuntimeReportDimensions(\n fields: ReadonlyMap<string, RuntimeReportPlanField>,\n hints: RuntimeReportDimensionHints = {},\n): RuntimeReportDimensionPlan {\n const all = [...fields.values()];\n const kinds = new Map<string, RuntimeReportDimensionKind>();\n for (const field of all) {\n const kind = kindOf(field);\n if (kind) kinds.set(field.name, kind);\n }\n\n const times = all.filter((field) => kinds.get(field.name) === 'time');\n const declaredTime =\n hints.timeField && fields.get(hints.timeField)?.type === 'datetime'\n ? hints.timeField\n : undefined;\n const defaultTimeField =\n declaredTime ??\n times.find((field) => field.businessDate)?.name ??\n times.find((field) => !BOOKKEEPING_TIME.test(field.name))?.name ??\n times.find((field) => field.name === 'createdAt')?.name ??\n times[0]?.name;\n const timeFields = [\n ...(defaultTimeField ? [defaultTimeField] : []),\n ...times.map((f) => f.name).filter((name) => name !== defaultTimeField),\n ];\n\n let dimensions: string[];\n if (hints.dimensions) {\n dimensions = hints.dimensions.filter(\n (name) => fields.has(name) && fields.get(name)?.type !== 'datetime',\n );\n for (const name of dimensions) {\n if (!kinds.has(name)) {\n kinds.set(\n name,\n fields.get(name)?.type === 'id' ? 'relation' : 'category',\n );\n }\n }\n // Declared groupings replace the derived ones; time stays time.\n for (const [name, kind] of [...kinds]) {\n if (kind !== 'time' && !dimensions.includes(name)) kinds.delete(name);\n }\n } else {\n dimensions = all\n .filter((field) => {\n const kind = kinds.get(field.name);\n return kind === 'category' || kind === 'relation';\n })\n .map((field, index) => ({ field, index }))\n .sort((a, b) => rank(b.field) - rank(a.field) || a.index - b.index)\n .map(({ field }) => field.name);\n }\n return {\n kinds,\n timeFields,\n ...(defaultTimeField ? { defaultTimeField } : {}),\n dimensions,\n };\n}\n\n/** The described fields and grouping hints of a source with these fields. */\nexport function describeRuntimeReportSourceFields(\n fields: ReadonlyMap<string, RuntimeReportPlanField>,\n hints: RuntimeReportDimensionHints = {},\n): Pick<\n RuntimeReportSourceDescription,\n 'fields' | 'timeFields' | 'defaultTimeField' | 'dimensions'\n> {\n const plan = planRuntimeReportDimensions(fields, hints);\n return {\n fields: [...fields.values()].map((field) => {\n const dimension = plan.kinds.get(field.name);\n return {\n name: field.name,\n label: field.label,\n type: field.type,\n ...(field.format ? { format: field.format } : {}),\n ...(field.enum ? { enum: field.enum } : {}),\n ...(dimension ? { dimension } : {}),\n filterOperators: RUNTIME_REPORT_OPERATORS_BY_TYPE[field.type],\n aggregates: runtimeReportAggregatesFor(field.type),\n };\n }),\n timeFields: plan.timeFields,\n ...(plan.defaultTimeField\n ? { defaultTimeField: plan.defaultTimeField }\n : {}),\n dimensions: plan.dimensions,\n };\n}\n","/**\n * Database-free runtime report runner (#4100).\n *\n * `runRuntimeReportInMemory()` evaluates a parsed `RuntimeReportSpec` over\n * rows the caller already holds and returns the same `RuntimeReportResult`\n * shape `runRuntimeReport()` returns. It shares the column, operator, value\n * coercion and cell rules with the SQL compiler (`runtime-plan.ts`), and its\n * SQL-shaped semantics (NULL handling, grouping, buckets, HAVING, ordering,\n * truncation) are held to the SQL path by `runtime-memory-parity.test.ts`.\n *\n * It is a BROWSER PREVIEW AND TEST RUNNER, NOT AN AUTHORITY BOUNDARY. Its\n * source descriptions are caller-supplied and carry no registry field policy,\n * principal, RBAC or tenant: whoever hands it rows has already decided the\n * caller may see them. Production reports still compile on the server\n * (`compileRuntimeReportSpec()` with the live principal) and save only through\n * `saveRuntimeReport()`.\n */\n\nimport { describeRuntimeReportSourceFields } from './runtime-dimensions.js';\nimport {\n assertRuntimeReportFilterOperator,\n coerceRuntimeReportValue,\n humanizeRuntimeReportName,\n normalizeRuntimeReportCell,\n planRuntimeReportColumns,\n type RuntimeReportColumn,\n type RuntimeReportColumnType,\n type RuntimeReportPlanField,\n type RuntimeReportResult,\n type RuntimeReportSourceDescription,\n resolveRuntimeReportFieldPolicy,\n unknownRuntimeReportField,\n} from './runtime-plan.js';\nimport {\n parseRuntimeReportSpec,\n RUNTIME_REPORT_LIMITS,\n type RuntimeReportBucket,\n RuntimeReportError,\n type RuntimeReportFilter,\n type RuntimeReportHaving,\n type RuntimeReportSpec,\n runtimeReportSpecDigest,\n} from './runtime-spec.js';\n\n/** One declared field of an in-memory source; rows are keyed by `name`. */\nexport interface RuntimeReportMemoryField {\n name: string;\n type: RuntimeReportColumnType;\n label?: string;\n /**\n * Format hint carried onto result columns (`money`), as `@field({ ui:\n * { format } })` declares it; `date` on a datetime marks a business date.\n */\n format?: string;\n /** Declared values of a closed text field (a status). */\n enum?: readonly string[];\n}\n\n/**\n * An in-memory report source: the browser counterpart of a server\n * `RuntimeReportSourceDefinition`. `schema` declares the fields the rows\n * carry; `fields` / `excludeFields` narrow them exactly as on the server\n * (omitted `fields` keeps every declared field, exclusions win, unknown names\n * reject the source). Names starting with `_` and `tenantId` are never\n * nameable. A declared `deletedAt` field soft-deletes rows where it is set.\n */\nexport interface RuntimeReportMemorySource {\n id: string;\n label?: string;\n description?: string;\n schema: readonly RuntimeReportMemoryField[];\n fields?: readonly string[];\n excludeFields?: readonly string[];\n /** The natural date \"by month\" buckets; derived when omitted. */\n timeField?: string;\n /** Fields worth grouping by, most useful first; derived when omitted. */\n dimensions?: readonly string[];\n}\n\nexport type RuntimeReportMemoryRow = Readonly<Record<string, unknown>>;\n\nexport interface RunRuntimeReportInMemoryOptions {\n /** Caller-owned allow-list; the spec reaches nothing outside it. */\n sources: readonly RuntimeReportMemorySource[];\n /** Host row ceiling applied on top of the spec's own limit. */\n maxRows?: number;\n /** Clock for `ranAt`; pass a fixed one for deterministic previews. */\n now?: () => Date;\n}\n\nconst NON_NAMEABLE = new Set(['tenantId', 'tenant_id']);\n\nfunction resolveMemorySource(\n sources: readonly RuntimeReportMemorySource[],\n id: string,\n): RuntimeReportMemorySource {\n const source = sources.find((candidate) => candidate.id === id);\n if (!source) {\n throw new RuntimeReportError(\n 'unknown_source',\n 'spec.source',\n `'${id}' is not an available report source`,\n );\n }\n return source;\n}\n\nfunction memoryFields(\n source: RuntimeReportMemorySource,\n): Map<string, RuntimeReportPlanField> {\n const known = new Set(source.schema.map((field) => field.name));\n const { included, excluded } = resolveRuntimeReportFieldPolicy(source, known);\n const fields = new Map<string, RuntimeReportPlanField>();\n for (const field of source.schema) {\n if (\n field.name.startsWith('_') ||\n NON_NAMEABLE.has(field.name) ||\n excluded?.has(field.name) ||\n (included && !included.has(field.name)) ||\n fields.has(field.name)\n ) {\n continue;\n }\n fields.set(field.name, {\n name: field.name,\n type: field.type,\n ...(field.format ? { format: field.format } : {}),\n ...(field.type === 'string' && field.enum?.length\n ? { enum: field.enum }\n : {}),\n ...(field.type === 'datetime' && field.format === 'date'\n ? { businessDate: true }\n : {}),\n label: field.label ?? humanizeRuntimeReportName(field.name),\n });\n }\n return fields;\n}\n\n/**\n * Describe what a spec may reference on an in-memory source: the browser\n * counterpart of `describeRuntimeReportSource()` (`reports.runtime.sources`).\n */\nexport function describeRuntimeReportMemorySource(\n sources: readonly RuntimeReportMemorySource[],\n sourceId: string,\n): RuntimeReportSourceDescription {\n const source = resolveMemorySource(sources, sourceId);\n return {\n id: source.id,\n label: source.label ?? humanizeRuntimeReportName(source.id),\n ...(source.description ? { description: source.description } : {}),\n ...describeRuntimeReportSourceFields(memoryFields(source), source),\n };\n}\n\n// ---------------------------------------------------------------------------\n// Values. Rows are untrusted-shape data, so every read is typed defensively.\n\ntype Cell = string | number | boolean | Date | null;\n\nfunction toDate(value: unknown): Date | null {\n if (value instanceof Date) {\n return Number.isNaN(value.getTime()) ? null : value;\n }\n if (typeof value === 'string' || typeof value === 'number') {\n const parsed = new Date(value);\n return Number.isNaN(parsed.getTime()) ? null : parsed;\n }\n return null;\n}\n\n/** Read a row value as the field's type; null when absent or unreadable. */\nfunction readCell(\n row: RuntimeReportMemoryRow,\n field: RuntimeReportPlanField,\n): Cell {\n const value = row[field.name];\n if (value === null || value === undefined) return null;\n switch (field.type) {\n case 'integer':\n case 'decimal': {\n if (typeof value === 'bigint') {\n // Past the safe range two integers become one Number, silently\n // merging groups and distinct counts; refuse rather than mis-count.\n if (\n value > BigInt(Number.MAX_SAFE_INTEGER) ||\n value < BigInt(Number.MIN_SAFE_INTEGER)\n ) {\n throw new RuntimeReportError(\n 'invalid_result',\n field.name,\n 'integer value exceeds the JavaScript safe range',\n );\n }\n return Number(value);\n }\n const numeric =\n typeof value === 'number'\n ? value\n : typeof value === 'string' && value.trim() !== ''\n ? Number(value)\n : Number.NaN;\n return Number.isFinite(numeric) ? numeric : null;\n }\n case 'boolean':\n if (value === true || value === 1 || value === '1' || value === 'true')\n return true;\n if (value === false || value === 0 || value === '0' || value === 'false')\n return false;\n return null;\n case 'datetime':\n return toDate(value);\n default:\n return typeof value === 'string' ? value : String(value);\n }\n}\n\n/**\n * SQL-style comparison of two non-null cells of one type. Strings compare by\n * UTF-16 code unit, which matches SQLite's BINARY collation for the BMP.\n */\nfunction compareCells(a: Exclude<Cell, null>, b: Exclude<Cell, null>): number {\n const left = a instanceof Date ? a.getTime() : a;\n const right = b instanceof Date ? b.getTime() : b;\n if (typeof left === 'boolean' || typeof right === 'boolean') {\n return Number(left) - Number(right);\n }\n if (left < right) return -1;\n if (left > right) return 1;\n return 0;\n}\n\ntype Predicate = (row: RuntimeReportMemoryRow) => boolean;\n\nfunction filterPredicate(\n filter: RuntimeReportFilter,\n field: RuntimeReportPlanField,\n path: string,\n): Predicate {\n assertRuntimeReportFilterOperator(filter, field.type, path);\n const read = (row: RuntimeReportMemoryRow) => readCell(row, field);\n switch (filter.op) {\n case 'isNull':\n return (row) => read(row) === null;\n case 'isNotNull':\n return (row) => read(row) !== null;\n case 'in':\n case 'notIn': {\n const values = (filter.value as unknown[]).map((entry, index) =>\n coerceRuntimeReportValue(field.type, entry, `${path}.value[${index}]`),\n );\n const member = (cell: Exclude<Cell, null>) =>\n values.some((value) => compareCells(cell, value) === 0);\n // SQL: NULL IN (...) and NULL NOT IN (...) are both unknown, so false.\n return filter.op === 'in'\n ? (row) => {\n const cell = read(row);\n return cell !== null && member(cell);\n }\n : (row) => {\n const cell = read(row);\n return cell !== null && !member(cell);\n };\n }\n case 'contains': {\n const needle = coerceRuntimeReportValue(\n field.type,\n filter.value,\n `${path}.value`,\n ) as string;\n // Case-sensitive substring, as the SQL builder's instr()/strpos().\n return (row) => {\n const cell = read(row);\n return typeof cell === 'string' && cell.includes(needle);\n };\n }\n default: {\n const target = coerceRuntimeReportValue(\n field.type,\n filter.value,\n `${path}.value`,\n );\n const test = {\n eq: (order: number) => order === 0,\n ne: (order: number) => order !== 0,\n gt: (order: number) => order > 0,\n gte: (order: number) => order >= 0,\n lt: (order: number) => order < 0,\n lte: (order: number) => order <= 0,\n }[filter.op];\n // Any comparison with NULL is unknown in SQL, so the row is excluded.\n return (row) => {\n const cell = read(row);\n return cell !== null && test(compareCells(cell, target));\n };\n }\n }\n}\n\n/** UTC start of the bucket containing `date`, as the SQL builder truncates. */\nfunction bucketStart(date: Date, bucket: RuntimeReportBucket): Date {\n const y = date.getUTCFullYear();\n const m = date.getUTCMonth();\n const d = date.getUTCDate();\n switch (bucket) {\n case 'minute':\n return new Date(\n Date.UTC(y, m, d, date.getUTCHours(), date.getUTCMinutes()),\n );\n case 'hour':\n return new Date(Date.UTC(y, m, d, date.getUTCHours()));\n case 'day':\n return new Date(Date.UTC(y, m, d));\n case 'week': {\n // Weeks start on Monday (ISO), like date_trunc('week') and the SQLite expr.\n const daysSinceMonday = (date.getUTCDay() + 6) % 7;\n return new Date(Date.UTC(y, m, d - daysSinceMonday));\n }\n case 'month':\n return new Date(Date.UTC(y, m, 1));\n case 'quarter':\n return new Date(Date.UTC(y, Math.floor(m / 3) * 3, 1));\n case 'year':\n return new Date(Date.UTC(y, 0, 1));\n }\n}\n\nfunction cellKey(cell: Cell): string {\n if (cell === null) return 'n';\n if (cell instanceof Date) return `d${cell.getTime()}`;\n return `${typeof cell}:${String(cell)}`;\n}\n\nfunction aggregate(fn: string, cells: Cell[] | null, rowCount: number): Cell {\n if (cells === null) return rowCount; // count(*)\n const present = cells.filter(\n (cell): cell is Exclude<Cell, null> => cell !== null,\n );\n switch (fn) {\n case 'count':\n return present.length;\n case 'countDistinct':\n return new Set(present.map(cellKey)).size;\n case 'sum': {\n if (present.length === 0) return null;\n return (present as number[]).reduce((total, value) => total + value, 0);\n }\n case 'avg': {\n if (present.length === 0) return null;\n const total = (present as number[]).reduce(\n (sum, value) => sum + value,\n 0,\n );\n return total / present.length;\n }\n case 'min':\n case 'max': {\n if (present.length === 0) return null;\n let best = present[0];\n for (const cell of present.slice(1)) {\n const order = compareCells(cell, best);\n if (fn === 'min' ? order < 0 : order > 0) best = cell;\n }\n return best;\n }\n default:\n return null;\n }\n}\n\nfunction havingHolds(entry: RuntimeReportHaving, value: Cell): boolean {\n if (typeof value !== 'number') return false; // NULL compares unknown\n switch (entry.op) {\n case 'eq':\n return value === entry.value;\n case 'ne':\n return value !== entry.value;\n case 'gt':\n return value > entry.value;\n case 'gte':\n return value >= entry.value;\n case 'lt':\n return value < entry.value;\n case 'lte':\n return value <= entry.value;\n }\n}\n\n/** NULLs sort first ascending and last descending, as SQLite orders them. */\nfunction compareForSort(a: Cell, b: Cell, direction: 'asc' | 'desc'): number {\n let order: number;\n if (a === null && b === null) order = 0;\n else if (a === null) order = -1;\n else if (b === null) order = 1;\n else order = compareCells(a, b);\n return direction === 'desc' ? -order : order;\n}\n\n/**\n * Evaluate a runtime report spec over in-memory rows of its source.\n *\n * Validation matches the server compiler: an unknown source, a field outside\n * the source's allow-list, a bucket on a non-datetime field, `sum` on text, an\n * operator the field type does not admit or an uncoercible filter value all\n * throw the same `RuntimeReportError` codes and paths. Result datetimes\n * (buckets, datetime dimensions, `min`/`max`) are ISO-8601 UTC strings, the\n * form PostgreSQL and DuckDB results take; SQLite returns bucket TEXT.\n *\n * `rows` are the rows of `spec.source`; the caller picks them. A browser\n * preview, never an authority boundary (see the module comment).\n */\nexport async function runRuntimeReportInMemory(\n input: RuntimeReportSpec,\n rows: readonly RuntimeReportMemoryRow[],\n options: RunRuntimeReportInMemoryOptions,\n): Promise<RuntimeReportResult> {\n const spec = parseRuntimeReportSpec(input);\n const source = resolveMemorySource(options.sources, spec.source);\n const fields = memoryFields(source);\n const columns = planRuntimeReportColumns(spec, fields);\n const lookup = (name: string, path: string): RuntimeReportPlanField => {\n const field = fields.get(name);\n if (!field) unknownRuntimeReportField(path, name);\n return field;\n };\n\n const predicates: Predicate[] = [];\n if (source.schema.some((field) => field.name === 'deletedAt')) {\n predicates.push(\n (row) => row.deletedAt === null || row.deletedAt === undefined,\n );\n }\n for (const [index, filter] of spec.filters.entries()) {\n const path = `spec.filters[${index}]`;\n predicates.push(\n filterPredicate(filter, lookup(filter.field, `${path}.field`), path),\n );\n }\n const kept = rows.filter((row) => predicates.every((test) => test(row)));\n\n // Group by the dimension tuple, in first-seen order.\n const dimensionReaders = spec.dimensions.map((dimension) => {\n const field = fields.get(dimension.field) as RuntimeReportPlanField;\n return (row: RuntimeReportMemoryRow): Cell => {\n const cell = readCell(row, field);\n if (dimension.bucket && cell instanceof Date) {\n return bucketStart(cell, dimension.bucket);\n }\n return cell;\n };\n });\n const groups = new Map<\n string,\n { key: Cell[]; rows: RuntimeReportMemoryRow[] }\n >();\n if (spec.dimensions.length === 0) {\n // An aggregate with no GROUP BY always yields exactly one row.\n groups.set('', { key: [], rows: kept });\n } else {\n for (const row of kept) {\n const key = dimensionReaders.map((read) => read(row));\n // A JSON array keeps tuple boundaries: a '|' inside a value cannot\n // merge two groups.\n const id = JSON.stringify(key.map(cellKey));\n const group = groups.get(id);\n if (group) group.rows.push(row);\n else groups.set(id, { key, rows: [row] });\n }\n }\n\n const measureFields = spec.measures.map((measure) =>\n measure.field\n ? (fields.get(measure.field) as RuntimeReportPlanField)\n : null,\n );\n let results = [...groups.values()].map((group) => {\n const values: Record<string, Cell> = {};\n spec.dimensions.forEach((dimension, index) => {\n values[dimension.as] = group.key[index];\n });\n spec.measures.forEach((measure, index) => {\n const field = measureFields[index];\n values[measure.as] = aggregate(\n measure.fn,\n field ? group.rows.map((row) => readCell(row, field)) : null,\n group.rows.length,\n );\n });\n return values;\n });\n\n if (spec.having.length > 0) {\n results = results.filter((values) =>\n spec.having.every((entry) => havingHolds(entry, values[entry.measure])),\n );\n }\n\n const sort =\n spec.sort.length > 0\n ? spec.sort\n : spec.dimensions.length > 0\n ? [{ by: spec.dimensions[0].as, direction: 'asc' as const }]\n : [];\n if (sort.length > 0) {\n results = results\n .map((values, index) => ({ values, index }))\n .sort((left, right) => {\n for (const entry of sort) {\n const order = compareForSort(\n left.values[entry.by],\n right.values[entry.by],\n entry.direction,\n );\n if (order !== 0) return order;\n }\n return left.index - right.index;\n })\n .map(({ values }) => values);\n }\n\n const limit = Math.min(\n spec.limit,\n options.maxRows ?? RUNTIME_REPORT_LIMITS.maxRowLimit,\n );\n const truncated = results.length > limit;\n const outRows = results.slice(0, limit).map((values) => {\n const out: Record<string, string | number | boolean | null> = {};\n for (const column of columns as RuntimeReportColumn[]) {\n out[column.id] = normalizeRuntimeReportCell(column, values[column.id]);\n }\n return out;\n });\n\n return {\n version: 1,\n specHash: await runtimeReportSpecDigest(spec),\n title: spec.title,\n columns,\n rows: outRows,\n rowCount: outRows.length,\n truncated,\n ranAt: (options.now?.() ?? new Date()).toISOString(),\n chart: spec.chart,\n };\n}\n","/**\n * Time language for runtime reports (#4100): \"by month\", \"weekly\", \"over\n * time\", \"last month\", \"this year\", \"last 90 days\", \"Q3\".\n *\n * A person asks for reports in words; a spec needs a bucket and a `[from, to)`\n * date range. These pure functions turn the words into those values against a\n * caller-supplied `now`, so an assistant (smrt-chat, the planner) resolves\n * time with code rather than asking a model to do date arithmetic. All dates\n * are UTC, like the runners' buckets. Browser-safe.\n */\n\nimport type { RuntimeReportBucket } from './runtime-spec.js';\n\n/** A resolved period: `[from, to)` as `YYYY-MM-DD`, and how to name it. */\nexport interface RuntimeReportTimeRange {\n from: string;\n to: string;\n /** Lower-case words for a title: \"last month\", \"Q3 2025\", \"last 90 days\". */\n label: string;\n}\n\nexport interface RuntimeReportTimeIntent {\n /** A time grouping the words ask for (\"by month\", \"weekly\", \"over time\"). */\n bucket?: RuntimeReportBucket;\n /** A period the words name (\"last quarter\", \"Q3\", \"last 90 days\"). */\n range?: RuntimeReportTimeRange;\n /** The words mention time at all (a grouping, a period or a trend). */\n mentionsTime: boolean;\n}\n\nconst DAY = 86_400_000;\nconst ymd = (time: number) => new Date(time).toISOString().slice(0, 10);\nconst MONTHS = [\n 'january',\n 'february',\n 'march',\n 'april',\n 'may',\n 'june',\n 'july',\n 'august',\n 'september',\n 'october',\n 'november',\n 'december',\n];\nconst ORDINAL_QUARTERS: Record<string, number> = {\n first: 1,\n second: 2,\n third: 3,\n fourth: 4,\n};\n\nconst BUCKET_WORDS: [RuntimeReportBucket, RegExp][] = [\n [\n 'minute',\n /\\b(?:minutely|(?:per|by|each|every|a) minute|minute by minute)\\b/,\n ],\n ['hour', /\\b(?:hourly|(?:per|by|each|every|an?) hour|hour by hour)\\b/],\n ['day', /\\b(?:daily|(?:per|by|each|every|a) day|day by day)\\b/],\n [\n 'week',\n /\\b(?:weekly|(?:per|by|each|every|a) week|week by week|week over week)\\b/,\n ],\n [\n 'month',\n /\\b(?:monthly|(?:per|by|each|every|a) month|month by month|month over month)\\b/,\n ],\n [\n 'quarter',\n /\\b(?:quarterly|(?:per|by|each|every|a) quarter|quarter by quarter|quarter over quarter)\\b/,\n ],\n [\n 'year',\n /\\b(?:yearly|annually|annual|(?:per|by|each|every|a) year|year by year|year over year)\\b/,\n ],\n];\nconst TREND_WORDS = /\\b(?:over time|trends?|trending|timeline|history)\\b/;\n\n/** The bucket \"over time\" means for a period of this many days. */\nexport function runtimeReportBucketForSpan(\n days: number | null,\n): RuntimeReportBucket {\n if (days === null) return 'month';\n if (days <= 31) return 'day';\n if (days <= 92) return 'week';\n if (days <= 3 * 366) return 'month';\n return 'quarter';\n}\n\nfunction span(range: RuntimeReportTimeRange): number {\n return Math.round(\n (Date.parse(`${range.to}T00:00:00Z`) -\n Date.parse(`${range.from}T00:00:00Z`)) /\n DAY,\n );\n}\n\n/**\n * Resolve a period phrase against `now`. Null when the words name no period\n * (or \"all time\"). A quarter or month named without a year is its latest\n * occurrence that has started: in May, \"Q3\" is last year's.\n */\nexport function resolveRuntimeReportTimeRange(\n phrase: string,\n now: Date,\n): RuntimeReportTimeRange | null {\n const text = phrase.toLowerCase().replace(/[_-]+/g, ' ').replace(/\\s+/g, ' ');\n const y = now.getUTCFullYear();\n const m = now.getUTCMonth();\n const today = Date.UTC(y, m, now.getUTCDate());\n const tomorrow = today + DAY;\n const monday = today - ((now.getUTCDay() + 6) % 7) * DAY;\n const quarter = Math.floor(m / 3) * 3;\n const range = (from: number, to: number, label: string) => ({\n from: ymd(from),\n to: ymd(to),\n label,\n });\n\n // \"last 90 days\", \"past 6 months\", \"last 2 weeks\"\n const recent =\n /\\b(?:last|past|previous|trailing)\\s+(\\d{1,4})\\s+(day|week|month|year)s?\\b/.exec(\n text,\n );\n if (recent) {\n const n = Number(recent[1]);\n const unit = recent[2];\n if (n > 0) {\n const from =\n unit === 'day'\n ? tomorrow - n * DAY\n : unit === 'week'\n ? tomorrow - n * 7 * DAY\n : unit === 'month'\n ? Date.UTC(y, m - n, now.getUTCDate() + 1)\n : Date.UTC(y - n, m, now.getUTCDate() + 1);\n return range(from, tomorrow, `last ${n} ${unit}${n === 1 ? '' : 's'}`);\n }\n }\n\n // \"Q3\", \"Q3 2025\", \"third quarter\"\n const q =\n /\\bq([1-4])(?:\\s*(?:of\\s*)?((?:19|20)\\d{2}))?\\b/.exec(text) ??\n /\\b(first|second|third|fourth) quarter(?: (?:of )?((?:19|20)\\d{2}))?\\b/.exec(\n text,\n );\n if (q) {\n const n = /^\\d$/.test(q[1]) ? Number(q[1]) : ORDINAL_QUARTERS[q[1]];\n const startMonth = (n - 1) * 3;\n const year = q[2]\n ? Number(q[2])\n : Date.UTC(y, startMonth, 1) <= today\n ? y\n : y - 1;\n return range(\n Date.UTC(year, startMonth, 1),\n Date.UTC(year, startMonth + 3, 1),\n `Q${n} ${year}`,\n );\n }\n\n if (/\\b(?:year to date|ytd)\\b/.test(text)) {\n return range(Date.UTC(y, 0, 1), tomorrow, 'year to date');\n }\n if (/\\b(?:month to date|mtd)\\b/.test(text)) {\n return range(Date.UTC(y, m, 1), tomorrow, 'month to date');\n }\n if (/\\btoday\\b/.test(text)) return range(today, tomorrow, 'today');\n if (/\\byesterday\\b/.test(text)) return range(today - DAY, today, 'yesterday');\n\n const relative =\n /\\b(this|current|last|previous|past) (week|month|quarter|year)\\b/.exec(\n text,\n );\n if (relative) {\n const last = relative[1] !== 'this' && relative[1] !== 'current';\n const unit = relative[2];\n const label = `${last ? 'last' : 'this'} ${unit}`;\n switch (unit) {\n case 'week':\n return last\n ? range(monday - 7 * DAY, monday, label)\n : range(monday, monday + 7 * DAY, label);\n case 'month':\n return last\n ? range(Date.UTC(y, m - 1, 1), Date.UTC(y, m, 1), label)\n : range(Date.UTC(y, m, 1), Date.UTC(y, m + 1, 1), label);\n case 'quarter':\n return last\n ? range(Date.UTC(y, quarter - 3, 1), Date.UTC(y, quarter, 1), label)\n : range(Date.UTC(y, quarter, 1), Date.UTC(y, quarter + 3, 1), label);\n default:\n return last\n ? range(Date.UTC(y - 1, 0, 1), Date.UTC(y, 0, 1), label)\n : range(Date.UTC(y, 0, 1), Date.UTC(y + 1, 0, 1), label);\n }\n }\n\n // \"December\", \"in March 2025\"\n const month = new RegExp(\n `\\\\b(${MONTHS.join('|')})(?: ((?:19|20)\\\\d{2}))?\\\\b`,\n ).exec(text);\n // \"may\" alone is usually the verb; May counts only with a year.\n if (month && (month[1] !== 'may' || month[2])) {\n const match = month;\n const index = MONTHS.indexOf(match[1]);\n const year = match[2]\n ? Number(match[2])\n : Date.UTC(y, index, 1) <= today\n ? y\n : y - 1;\n const name = match[1].charAt(0).toUpperCase() + match[1].slice(1);\n return range(\n Date.UTC(year, index, 1),\n Date.UTC(year, index + 1, 1),\n `${name} ${year}`,\n );\n }\n\n // \"in 2025\", \"for 2024\", or the period slot holding just a year\n const year =\n /\\b(?:in|for|during)\\s+((?:19|20)\\d{2})\\b/.exec(text) ??\n /^\\s*((?:19|20)\\d{2})\\s*$/.exec(text);\n if (year) {\n const n = Number(year[1]);\n return range(Date.UTC(n, 0, 1), Date.UTC(n + 1, 0, 1), String(n));\n }\n return null;\n}\n\n/**\n * Read a request's time words: a grouping (\"by month\", \"weekly\"; \"over time\"\n * picks one from the period's length), a period, and whether time came up at\n * all (\"the date month\" mentions time without naming either).\n */\nexport function parseRuntimeReportTime(\n text: string,\n now: Date,\n): RuntimeReportTimeIntent {\n const words = text.toLowerCase();\n const range = resolveRuntimeReportTimeRange(words, now) ?? undefined;\n let bucket = BUCKET_WORDS.find(([, pattern]) => pattern.test(words))?.[0];\n const trend = TREND_WORDS.test(words);\n if (!bucket && trend) {\n bucket = runtimeReportBucketForSpan(range ? span(range) : null);\n }\n const mentionsTime =\n Boolean(bucket || range || trend) ||\n /\\b(?:date|dates|time|when|minute|hour|day|week|month|quarter|year)s?\\b/.test(\n words,\n );\n return {\n ...(bucket ? { bucket } : {}),\n ...(range ? { range } : {}),\n mentionsTime,\n };\n}\n"],"mappings":";;AAuBO,IAAM,8BAA8B;AAEpC,IAAM,wBAAwB,OAAO,OAAO;CACjD,gBAAgB;CAChB,sBAAsB;CACtB,eAAe;CACf,aAAa;CACb,YAAY;CACZ,WAAW;CACX,SAAS;CACT,aAAa;CACb,sBAAsB;CACtB,iBAAiB;CACjB,aAAa;CACb,gBAAgB;CAChB,oBAAoB;CACpB,mBAAmB;AACrB,CAAC;AAEM,IAAM,yBAAyB;CACpC;CACA;CACA;CACA;CACA;CACA;CACA;AACF;AAGO,IAAM,6BAA6B;CACxC;CACA;CACA;CACA;CACA;CACA;AACF;AAIO,IAAM,4BAA4B;CACvC;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF;AAGO,IAAM,4BAA4B;CACvC;CACA;CACA;CACA;CACA;CACA;AACF;AAGO,IAAM,6BAA6B;CACxC;CACA;CACA;CACA;CACA;AACF;AAiFO,IAAM,qBAAN,cAAiC,UAAU;CACvC;CACA;;;;;;CAMA;CAET,YAAY,MAA8B,MAAc,SAAiB;EACvE,MAAM,OAAO,GAAG,KAAI,IAAK,YAAY,SAAS,MAAM,YAAY;EAChE,KAAK,OAAO;EACZ,KAAK,OAAO;EACZ,KAAK,OAAO;EACZ,KAAK,SACH,SAAS,qBAAqB,SAAS,0BACnC,MACA,SAAS,mBACP,MACA;CACV;AACF;AAEA,SAAS,KAAK,MAAc,SAAwB;CAClD,MAAM,IAAI,mBAAmB,gBAAgB,MAAM,OAAO;AAC5D;AAGA,IAAM,mCAAwC,IAAI,IAAI;CACpD;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF,CAAC;AAED,IAAM,gBAAgB;AACtB,IAAM,gBAAgB;AACtB,IAAM,iBAAiB;AAEvB,SAAS,SAAS,OAAkD;CAClE,OACE,OAAO,UAAU,YACjB,UAAU,Q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I,GAAG,OAAO,CAAC,KAAK,QACvB,IACA,IAAI;EACV,MAAM,OAAO,MAAM,EAAC,CAAE,OAAO,CAAC,CAAA,CAAE,YAAY,IAAI,MAAM,EAAC,CAAE,MAAM,CAAC;EAChE,OAAO,MACL,KAAK,IAAIA,OAAM,OAAO,CAAC,GACvB,KAAK,IAAIA,OAAM,QAAQ,GAAG,CAAC,GAC3B,GAAG,KAAI,GAAIA,OACb;CACF;CAGA,MAAM,OACJ,2CAA2C,KAAK,IAAI,KACpD,2BAA2B,KAAK,IAAI;CACtC,IAAI,MAAM;EACR,MAAM,IAAI,OAAO,KAAK,EAAE;EACxB,OAAO,MAAM,KAAK,IAAI,GAAG,GAAG,CAAC,GAAG,KAAK,IAAI,IAAI,GAAG,GAAG,CAAC,GAAG,OAAO,CAAC,CAAC;CAClE;CACA,OAAO;AACT;AAOO,SAAS,uBACd,MACA,KACyB;CACzB,MAAM,QAAQ,KAAK,YAAY;CAC/B,MAAM,QAAQ,8BAA8B,OAAO,GAAG,KAAK,KAAA;CAC3D,IAAI,SAAS,aAAa,MAAM,GAAG,aAAa,QAAQ,KAAK,KAAK,CAAC,CAAA,GAAI;CACvE,MAAM,QAAQ,YAAY,KAAK,KAAK;CACpC,IAAI,CAAC,UAAU,OACb,SAAS,2BAA2B,QAAQ,KAAK,KAAK,IAAI,IAAI;CAEhE,MAAM,eACJ,QAAQ,UAAU,SAAS,KAAK,KAChC,yEAAyE,KACvE,KACF;CACF,OAAO;EACL,GAAI,SAAS,EAAE,OAAO,IAAI,CAAC;EAC3B,GAAI,QAAQ,EAAE,MAAM,IAAI,CAAC;EACzB;CACF;AACF"}
|
package/dist/index.d.ts
CHANGED
|
@@ -12,12 +12,18 @@ export { refreshReport, reportRowIdentity, } from './refresh.js';
|
|
|
12
12
|
export { SmrtReport, SmrtReportCollection } from './report.js';
|
|
13
13
|
export type { CompiledRuntimeReport, RunRuntimeReportOptions, RuntimeReportColumn, RuntimeReportColumnType, RuntimeReportCompileContext, RuntimeReportResult, RuntimeReportSourceDefinition, RuntimeReportSourceDescription, } from './runtime-compiler.js';
|
|
14
14
|
export { compileRuntimeReportSpec, describeRuntimeReportSource, runRuntimeReport, } from './runtime-compiler.js';
|
|
15
|
+
export type { RunRuntimeReportInMemoryOptions, RuntimeReportMemoryField, RuntimeReportMemoryRow, RuntimeReportMemorySource, } from './runtime-memory.js';
|
|
16
|
+
export { describeRuntimeReportMemorySource, runRuntimeReportInMemory, } from './runtime-memory.js';
|
|
17
|
+
export type { RuntimeReportDimensionHints, RuntimeReportDimensionKind, } from './runtime-plan.js';
|
|
15
18
|
export type { RuntimeReportStatus, RuntimeReportStoreOptions, SaveRuntimeReportOptions, } from './runtime-report.js';
|
|
16
19
|
export { archiveRuntimeReport, getRuntimeReport, listRuntimeReports, RuntimeReport, RuntimeReportCollection, runStoredRuntimeReport, saveRuntimeReport, } from './runtime-report.js';
|
|
17
20
|
export type { RuntimeReportAwaitingConfirmation, RuntimeReportPrincipal, RuntimeReportServerOptions, RuntimeReportServerSource, } from './runtime-server.js';
|
|
18
21
|
export { archiveRuntimeReportForPrincipal, createRuntimeReportConfirmHandler, getRuntimeReportServerOptions, loadRuntimeReportChart, RuntimeReportHttpError, runRuntimeReportForPrincipal, } from './runtime-server.js';
|
|
19
22
|
export type { RuntimeReportBucket, RuntimeReportChart, RuntimeReportChartType, RuntimeReportDimension, RuntimeReportErrorCode, RuntimeReportFilter, RuntimeReportFilterOp, RuntimeReportHaving, RuntimeReportHavingOp, RuntimeReportMeasure, RuntimeReportMeasureFn, RuntimeReportScalar, RuntimeReportSort, RuntimeReportSpec, } from './runtime-spec.js';
|
|
20
|
-
export { parseRuntimeReportSpec, RUNTIME_REPORT_BUCKETS, RUNTIME_REPORT_CHART_TYPES, RUNTIME_REPORT_FILTER_OPS, RUNTIME_REPORT_HAVING_OPS, RUNTIME_REPORT_LIMITS, RUNTIME_REPORT_MEASURE_FNS, RUNTIME_REPORT_SPEC_VERSION, RuntimeReportError,
|
|
23
|
+
export { parseRuntimeReportSpec, RUNTIME_REPORT_BUCKETS, RUNTIME_REPORT_CHART_TYPES, RUNTIME_REPORT_FILTER_OPS, RUNTIME_REPORT_HAVING_OPS, RUNTIME_REPORT_LIMITS, RUNTIME_REPORT_MEASURE_FNS, RUNTIME_REPORT_SPEC_VERSION, RuntimeReportError, runtimeReportSpecDigest, serializeRuntimeReportSpec, } from './runtime-spec.js';
|
|
24
|
+
export { runtimeReportSpecHash } from './runtime-spec-hash.js';
|
|
25
|
+
export type { RuntimeReportTimeIntent, RuntimeReportTimeRange, } from './runtime-time.js';
|
|
26
|
+
export { parseRuntimeReportTime, resolveRuntimeReportTimeRange, runtimeReportBucketForSpan, } from './runtime-time.js';
|
|
21
27
|
export type { EnqueueReportRefreshOptions, EnsureReportSchedulesOptions, ReportExecutionPrincipalReference, ReportRefreshExecutionAuditEvent, ReportRefreshExecutionAuthority, ReportRefreshExecutionAuthorityContext, ReportRefreshExecutionAuthorityHost, ReportRefreshInterceptorOptions, ReportRefreshJobArgs, ReportScheduleInfo, ReportScheduleRunnerConfig, ReportScheduleRunnerEvents, } from './scheduler.js';
|
|
22
28
|
export { enqueueReportRefresh, ensureReportRefreshSchedules, ReportScheduleRunner, registerReportRefreshExecutionAuthorityHost, registerReportRefreshInterceptor, registerReportRefreshJobIntegritySigner, SmrtPrincipalReportRefreshTask, SmrtReportRefreshTask, } from './scheduler.js';
|
|
23
29
|
export { assertReportTablesReady, REPORT_LOCKS_TABLE, REPORT_REFRESH_TASKS_TABLE, REPORT_RUNS_TABLE, REPORT_RUNTIME_TABLES, REPORT_SCHEDULER_TABLES, REPORT_SCHEDULES_TABLE, REPORT_WATERMARKS_TABLE, SmrtReportLock, SmrtReportLockCollection, SmrtReportRun, SmrtReportRunCollection, SmrtReportSchedule, SmrtReportScheduleCollection, SmrtReportWatermark, SmrtReportWatermarkCollection, scopeKeyForTenant, } from './state.js';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,wBAAwB,CAAC;AAEhC,YAAY,EACV,uBAAuB,EACvB,oBAAoB,EACpB,4BAA4B,EAC5B,2BAA2B,EAC3B,yBAAyB,EACzB,sBAAsB,EACtB,sBAAsB,EACtB,gBAAgB,EAChB,uBAAuB,EACvB,qBAAqB,EACrB,qBAAqB,EACrB,6BAA6B,EAC7B,+BAA+B,EAC/B,yBAAyB,EACzB,yBAAyB,EACzB,gCAAgC,EAChC,kCAAkC,EAClC,4BAA4B,EAC5B,iCAAiC,EACjC,gCAAgC,EAChC,0BAA0B,EAC1B,yBAAyB,EACzB,yBAAyB,EACzB,8BAA8B,EAC9B,oBAAoB,EACpB,iBAAiB,EACjB,+BAA+B,EAC/B,8BAA8B,EAC9B,wBAAwB,EACxB,kBAAkB,EAClB,6BAA6B,EAC7B,uBAAuB,GACxB,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,4BAA4B,EAC5B,yBAAyB,EACzB,2BAA2B,EAC3B,wBAAwB,EACxB,uBAAuB,GACxB,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,UAAU,EACV,cAAc,GACf,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,qBAAqB,EACrB,uBAAuB,EACvB,iBAAiB,EACjB,wBAAwB,GACzB,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,SAAS,EACT,GAAG,EACH,KAAK,EACL,GAAG,EACH,uBAAuB,EACvB,OAAO,EACP,IAAI,EACJ,GAAG,EACH,GAAG,EACH,MAAM,EACN,KAAK,EACL,OAAO,EACP,MAAM,EACN,GAAG,EACH,IAAI,EACJ,IAAI,GACL,MAAM,iBAAiB,CAAC;AACzB,YAAY,EACV,oBAAoB,EACpB,yBAAyB,EACzB,2BAA2B,EAC3B,sBAAsB,EACtB,kBAAkB,EAClB,uBAAuB,EACvB,oBAAoB,EACpB,0BAA0B,EAC1B,uBAAuB,EACvB,sBAA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AqB,CAAC;AAC7B,YAAY,EACV,mBAAmB,EACnB,kBAAkB,EAClB,sBAAsB,EACtB,sBAAsB,EACtB,sBAAsB,EACtB,mBAAmB,EACnB,qBAAqB,EACrB,mBAAmB,EACnB,qBAAqB,EACrB,oBAAoB,EACpB,sBAAsB,EACtB,mBAAmB,EACnB,iBAAiB,EACjB,iBAAiB,GAClB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,sBAAsB,EACtB,sBAAsB,EACtB,0BAA0B,EAC1B,yBAAyB,EACzB,yBAAyB,EACzB,qBAAqB,EACrB,0BAA0B,EAC1B,2BAA2B,EAC3B,kBAAkB,EAClB,qBAAqB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,wBAAwB,CAAC;AAEhC,YAAY,EACV,uBAAuB,EACvB,oBAAoB,EACpB,4BAA4B,EAC5B,2BAA2B,EAC3B,yBAAyB,EACzB,sBAAsB,EACtB,sBAAsB,EACtB,gBAAgB,EAChB,uBAAuB,EACvB,qBAAqB,EACrB,qBAAqB,EACrB,6BAA6B,EAC7B,+BAA+B,EAC/B,yBAAyB,EACzB,yBAAyB,EACzB,gCAAgC,EAChC,kCAAkC,EAClC,4BAA4B,EAC5B,iCAAiC,EACjC,gCAAgC,EAChC,0BAA0B,EAC1B,yBAAyB,EACzB,yBAAyB,EACzB,8BAA8B,EAC9B,oBAAoB,EACpB,iBAAiB,EACjB,+BAA+B,EAC/B,8BAA8B,EAC9B,wBAAwB,EACxB,kBAAkB,EAClB,6BAA6B,EAC7B,uBAAuB,GACxB,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,4BAA4B,EAC5B,yBAAyB,EACzB,2BAA2B,EAC3B,wBAAwB,EACxB,uBAAuB,GACxB,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,UAAU,EACV,cAAc,GACf,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,qBAAqB,EACrB,uBAAuB,EAC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