@resolveio/server-lib 22.0.7 → 22.0.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.
@@ -96,7 +96,7 @@ var report_builder_unwinds_1 = require("../util/report-builder-unwinds");
96
96
  var schema_report_builder_1 = require("../util/schema-report-builder");
97
97
  var tokenizer_1 = require("../util/tokenizer");
98
98
  var ai_terminal_1 = require("./ai-terminal");
99
- var DEFAULT_REPORT_BUILDER_CODEX_MODEL = 'gpt-5.2-codex';
99
+ var DEFAULT_REPORT_BUILDER_CODEX_MODEL = 'gpt-5.3-codex';
100
100
  var DEFAULT_REPORT_BUILDER_CODEX_TIMEOUT_MS = 60000;
101
101
  var reportBuilderCodexClient = null;
102
102
  function loadReportBuilderMethods(methodManager) {
@@ -1846,6 +1846,10 @@ function buildReportBuilderSystemPrompt(reportType) {
1846
1846
  'Translate the request into concrete layout_columns, groups_row, sort, totals, filters, and links whenever possible.',
1847
1847
  'Every layout column must be complete: include a header plus at least one mapping with a valid field_path (or text mode with non-empty text). Do not return columns without mapped fields.',
1848
1848
  'Unless the user explicitly asks for a different order, add sort entries for the primary grouping/identifier fields (groups_row or the first key layout_columns) using ascending order so results are alphabetical.',
1849
+ 'Always prioritize sort on popular business keys when available: name, company, item (fallback: title, label, customer). Keep ascending unless user asks otherwise.',
1850
+ 'If no popular key exists, add stable fallback sort using createdAt/date_created then _id.',
1851
+ 'Use filters with explicit boolean logic: $and for required constraints and $or for alternate matches.',
1852
+ 'Use custom fields when the request asks for derived metrics (ratios, percentages, margins, computed totals).',
1849
1853
  'If the request specifies a time grain (daily/weekly/monthly/etc), set date_interval and id_date_field to the best matching date field.',
1850
1854
  'If you need sample records to confirm field choices, you may return JSON with {"mongo_read": { "collection": "<collection>", "query": {}, "options": {"limit": 5} }, "notes": "why you need data"} .',
1851
1855
  'Only request mongo_read when necessary and only use collections from available_collections.',
@@ -1853,8 +1857,9 @@ function buildReportBuilderSystemPrompt(reportType) {
1853
1857
  'Use field_type to guide filters/totals (numeric fields for totals, date fields for date_interval, boolean fields for boolean_value).',
1854
1858
  'If field_summary.truncated is true, only use provided fields and note missing needs in notes.',
1855
1859
  'If you need joined data, add collection_joins with an alias and use the alias in field_path.',
1860
+ 'When fields require related records, use lookup paths and joins rather than guessing flat field names.',
1856
1861
  'array_summary lists array roots and candidate key_fields for linking arrays.',
1857
- 'If you select fields from multiple array roots, add links that align the arrays using key_fields.',
1862
+ 'If you select fields from multiple array roots, add links that align arrays using shared identifiers (_id or id_<x> style keys).',
1858
1863
  'Avoid mixing unrelated array roots without links; prefer a single array root or non-array fields to prevent duplicate rows.',
1859
1864
  'Return a single valid JSON object with double quotes and no trailing commas.',
1860
1865
  'Omit keys you cannot confidently fill.',