@axiom-lattice/core 2.1.33 → 2.1.34

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/index.mjs CHANGED
@@ -2752,11 +2752,19 @@ Skip using this tool when:
2752
2752
  Prerequisites - MUST Complete First
2753
2753
  1. Call query_metrics_list to discover available metrics
2754
2754
  2. Call query_metric_definition(metricName) to get:
2755
- - defaultTimeContext.timeDimension (e.g., "DocDate")
2755
+ - defaultTimeContext.timeDimension (e.g., "DocDate","date")
2756
2756
  - defaultTimeContext.supportedGrains (e.g., ["day", "week", "month", "year"])
2757
2757
  - supportedDimensions[].dim_id (use these for groupBy and filters)
2758
2758
  - supportedDimensions[].filter_operators (allowed operators per dimension)
2759
2759
 
2760
+ **Rules**:
2761
+ - To filter by date: Copy the pattern and replace values
2762
+ \`\`\`json
2763
+ {"dimension": "DocDate", "operator": "BETWEEN", "values": ["2025-01-01", "2025-12-31"]}
2764
+ \`\`\`
2765
+ - To group by time: Use \`"{timeDimension}__{supportedGrain}"\` format (e.g., \`"date__month"\`)
2766
+
2767
+
2760
2768
  The Five Query Patterns
2761
2769
 
2762
2770
  Pattern A - Time Trend (most common first query)
@@ -2764,8 +2772,8 @@ Goal: Show how a metric changes over time within a period
2764
2772
  {
2765
2773
  "metrics": ["order_amt_tax_inc"],
2766
2774
  "groupBy": ["DocDate__month"],
2767
- "filters": [{ "dimension": "DocDate", "operator": "BETWEEN", "values": ["2025-01-01", "2025-12-31"] }],
2768
- "orderBy": [{ "field": "DocDate__month", "direction": "ASC" }]
2775
+ "filters": [{ "dimension": "date", "operator": "BETWEEN", "values": ["2025-01-01", "2025-12-31"] }],
2776
+ "orderBy": [{ "field": "date__month", "direction": "ASC" }]
2769
2777
  }
2770
2778
 
2771
2779
  Pattern B - Dimension Breakdown (who/what is top or bottom)
@@ -2830,25 +2838,7 @@ Common Mistakes to Avoid
2830
2838
  - Omitting date filter entirely - ALWAYS include at least one DocDate filter
2831
2839
  - Querying a metric by an unsupported dimension - only use dim_id from supportedDimensions
2832
2840
  - Putting display name in orderBy.field - must match exactly what's in groupBy
2833
-
2834
- Recommended Analysis Flow
2835
- User question
2836
- |
2837
- \u25BC
2838
- Step 1: query_metrics_list - find matching metric(s)
2839
- |
2840
- \u25BC
2841
- Step 2: query_metric_definition - read defaultTimeContext + supportedDimensions
2842
- |
2843
- \u25BC
2844
- Step 3a: Pattern A (time trend) - get the big picture
2845
- |
2846
- \u251C\u2500 anomaly found? \u2500\u2500\u25BA Step 3c: Pattern C (drill down)
2847
- \u251C\u2500 user asks "who"? \u2500\u2500\u25BA Step 3b: Pattern B (dimension breakdown)
2848
- \u2514\u2500 user asks "compare X and Y"? \u2500\u2500\u25BA Step 3d: Pattern D (multi-metric)
2849
-
2850
- Debug Mode
2851
- Set "debug": true to receive executedSqls in the response to verify generated SQL.`;
2841
+ `;
2852
2842
  function formatSemanticQueryResult(datasourceId, datasourceName, results) {
2853
2843
  if (results.length === 0) {
2854
2844
  return `No data found for the specified query.
@@ -10580,11 +10570,12 @@ ${BASE_PROMPT}` : BASE_PROMPT;
10580
10570
  unsupportedModelBehavior: "ignore"
10581
10571
  }),
10582
10572
  // Subagent middleware: Patches tool calls for compatibility
10583
- createPatchToolCallsMiddleware()
10573
+ createPatchToolCallsMiddleware(),
10574
+ ...customMiddleware
10584
10575
  ],
10585
10576
  defaultInterruptOn: interruptOn,
10586
10577
  subagents,
10587
- generalPurposeAgent: false
10578
+ generalPurposeAgent: true
10588
10579
  }),
10589
10580
  // Automatically summarizes conversation history when token limits are approached
10590
10581
  summarizationMiddleware({