@lightdash/common 0.2066.1 → 0.2067.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (22) hide show
  1. package/dist/cjs/ee/AiAgent/schemas/tools/toolImproveContext.d.ts +1 -1
  2. package/dist/cjs/ee/AiAgent/schemas/tools/toolImproveContext.d.ts.map +1 -1
  3. package/dist/cjs/ee/AiAgent/schemas/tools/toolImproveContext.js +15 -32
  4. package/dist/cjs/ee/AiAgent/schemas/tools/toolImproveContext.js.map +1 -1
  5. package/dist/cjs/ee/AiAgent/schemas/tools/toolProposeChange.d.ts +1 -1
  6. package/dist/cjs/ee/AiAgent/schemas/tools/toolProposeChange.d.ts.map +1 -1
  7. package/dist/cjs/ee/AiAgent/schemas/tools/toolProposeChange.js +13 -24
  8. package/dist/cjs/ee/AiAgent/schemas/tools/toolProposeChange.js.map +1 -1
  9. package/dist/esm/ee/AiAgent/schemas/tools/toolImproveContext.d.ts +1 -1
  10. package/dist/esm/ee/AiAgent/schemas/tools/toolImproveContext.d.ts.map +1 -1
  11. package/dist/esm/ee/AiAgent/schemas/tools/toolImproveContext.js +15 -32
  12. package/dist/esm/ee/AiAgent/schemas/tools/toolImproveContext.js.map +1 -1
  13. package/dist/esm/ee/AiAgent/schemas/tools/toolProposeChange.d.ts +1 -1
  14. package/dist/esm/ee/AiAgent/schemas/tools/toolProposeChange.d.ts.map +1 -1
  15. package/dist/esm/ee/AiAgent/schemas/tools/toolProposeChange.js +13 -24
  16. package/dist/esm/ee/AiAgent/schemas/tools/toolProposeChange.js.map +1 -1
  17. package/dist/tsconfig.types.tsbuildinfo +1 -1
  18. package/dist/types/ee/AiAgent/schemas/tools/toolImproveContext.d.ts +1 -1
  19. package/dist/types/ee/AiAgent/schemas/tools/toolImproveContext.d.ts.map +1 -1
  20. package/dist/types/ee/AiAgent/schemas/tools/toolProposeChange.d.ts +1 -1
  21. package/dist/types/ee/AiAgent/schemas/tools/toolProposeChange.d.ts.map +1 -1
  22. package/package.json +1 -1
@@ -1,6 +1,6 @@
1
1
  import { z } from 'zod';
2
2
  import { AiResultType } from '../../types';
3
- export declare const TOOL_IMPROVE_CONTEXT_DESCRIPTION = "\n\n - **When to use the Improve Context Tool:**\n - User guides table/explore selection: \"You can use the main_table for summary queries - you don't need the detailed table\"\n - User shares business methodology: \"Generally we use higher-level categories to have fewer groupings\"\n - User clarifies where to find data: \"Use the dimension table to get category details\"\n - User corrects field usage: \"Filter by order_number not order_id\"\n - User corrects terminology: \"Actually, 'total revenue' means revenue_after_tax\"\n - User provides better formatting/structure: \"I'd structure the examples like this: Category: X, Feedback: Y\"\n - User clarifies business rules: \"Customer count should exclude test accounts\"\n - Your confidence this is a learnable correction (not just a new request) is above 0.7\n\n - **Learning Categories and Examples:**\n\n Category: explore_selection\n Feedback: \"Use the sales_data explore instead of the orders table for revenue analysis\"\n Generated instruction: \"For revenue analysis queries, use the sales_data explore instead of the orders table\"\n\n Category: field_selection\n Feedback1: \"No, use net_revenue instead of gross_revenue\"\n Generated instruction1: \"When users ask for revenue, use the net_revenue field instead of gross_revenue\"\n Feedback2: \"Actually, 'total revenue' should always refer to the revenue_after_tax field\"\n Generated instruction2: \"When users mention 'total revenue', they mean the revenue_after_tax field\"\n\n Category: filter_logic\n Feedback: \"The customer_count should exclude test accounts\"\n Generated instruction: \"When calculating customer_count, always exclude test accounts using the filter is_test_account = false\"\n\n Category: other\n Feedback1: \"Always show results in descending order by default\"\n Generated instruction1: \"When showing metric results, default to descending order unless explicitly requested otherwise\"\n Feedback2: \"We prefer to analyze by region rather than individual store locations\"\n Generated instruction2: \"When analyzing geographic data, use region-level aggregations instead of individual store locations\"\n\n ";
3
+ export declare const TOOL_IMPROVE_CONTEXT_DESCRIPTION = "\nCaptures learnings from user corrections, clarifications, and guidance to improve future responses.\n\n**Supported Learning Categories:**\n- explore_selection: Which tables/explores to use for specific types of queries\n- field_selection: Which fields to use for specific metrics or dimensions\n- filter_logic: How to apply filters for calculations\n- calculation: How to perform specific calculations or aggregations\n- other: General preferences, formatting, or methodologies\n\n**Technical Requirements:**\n- Must provide original query context that led to the learning\n- Must capture what was incorrect and what the correct approach is\n- Must categorize the learning into one of the supported categories\n- Must provide a confidence score (0-1) indicating if this is a learnable pattern\n- Must generate a clear, actionable instruction to append to agent settings\n- Instructions should be specific and context-aware (not overly generic)\n";
4
4
  export declare const toolImproveContextArgsSchema: z.ZodObject<{
5
5
  type: z.ZodLiteral<AiResultType.IMPROVE_CONTEXT>;
6
6
  } & {
@@ -1 +1 @@
1
- {"version":3,"file":"toolImproveContext.d.ts","sourceRoot":"","sources":["../../../../../../src/ee/AiAgent/schemas/tools/toolImproveContext.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAI3C,eAAO,MAAM,gCAAgC,yrEAkC3C,CAAC;AAEH,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;;;;;;;;;;;EAkC7B,CAAC;AAEb,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CACxC,OAAO,4BAA4B,CACtC,CAAC;AAEF,eAAO,MAAM,8BAA8B;;;;;;;;;;;;;;;;;;;EAGzC,CAAC;AAEH,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAC1C,OAAO,8BAA8B,CACxC,CAAC"}
1
+ {"version":3,"file":"toolImproveContext.d.ts","sourceRoot":"","sources":["../../../../../../src/ee/AiAgent/schemas/tools/toolImproveContext.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAI3C,eAAO,MAAM,gCAAgC,w7BAiB5C,CAAC;AAEF,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;;;;;;;;;;;EAkC7B,CAAC;AAEb,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CACxC,OAAO,4BAA4B,CACtC,CAAC;AAEF,eAAO,MAAM,8BAA8B;;;;;;;;;;;;;;;;;;;EAGzC,CAAC;AAEH,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAC1C,OAAO,8BAA8B,CACxC,CAAC"}
@@ -1,7 +1,7 @@
1
1
  import { z } from 'zod';
2
2
  import { type Dimension, type Metric, type Table } from '../../../..';
3
3
  import { AiResultType } from '../../types';
4
- export declare const TOOL_PROPOSE_CHANGE_DESCRIPTION = "\nUse this tool to propose changes to a table's metadata in the semantic layer. This tool creates a change proposal that can be reviewed and approved before being applied.\n\n- When updating descriptions, ensure to preserve as much original content as possible. Remember that descriptions are enclosed in \"description\" tags and you should take the whole value into account as well as its format.\n- If modifying tables, _always_ use the findExplores tool to check existing descriptions before proposing changes to ensure no important content is removed.\n- If modifying metrics or dimensions, _always_ use the findFields tool to check existing descriptions before proposing changes to ensure no important content is removed.\n- If creating a new metric, _always_ use the findFields tool to check existing metrics before proposing changes to ensure no content is duplicated.\n\n- **When to use the Propose Change Tool:**\n - User requests to update a table description: \"Update the description of the customers table\"\n - User wants to improve a dimension description: \"Add a better description for the customer_name field\"\n - User asks to clarify a metric description: \"Update the total_revenue metric description to explain it's net revenue\"\n - User wants to document business logic in descriptions: \"Add a note that active_users excludes test accounts\"\n\n- **What this tool does:**\n - Creates a change proposal and applies it to a changeset (batch of changes)\n - Changes are applied immediately but can be reviewed and rejected afterward\n - Supports updating descriptions for tables, dimensions, and metrics\n - Supports creating new metrics\n - Tracks who proposed the change and when\n - Applied changes can be reviewed and rejected by authorized users\n\n- **Examples:**\n\n User: \"Update the customers table description to mention it includes both B2B and B2C customers\"\n User: \"The revenue_net field should explain it's after taxes and discounts\"\n User: \"Create a new metric called 'Median Order Amount' that calculates the median order amount\"\n";
4
+ export declare const TOOL_PROPOSE_CHANGE_DESCRIPTION = "\nCreates a change proposal for tables, metrics, and dimensions. Changes are applied immediately but can be reviewed and rejected afterward.\n\n**Supported Operations:**\n- Update table descriptions and labels\n- Update metric/dimension descriptions and labels\n- Create new metrics\n\n**Technical Requirements:**\n- When updating descriptions or labels, must preserve as much original content as possible\n- Descriptions should maintain their original format (preserve complete value and formatting)\n- Must provide entity table name, rationale, and change details\n- Changes are tracked with proposer information and timestamp\n- For updates: use \"replace\" operation with complete updated value (not partial)\n- For adding new properties: use \"add\" operation (creates property if it does not exist)\n- For new metrics: use \"create\" operation with full metric definition\n";
5
5
  type ChangePatch<T> = Partial<Record<keyof T, z.ZodType>>;
6
6
  declare const stringOpSchema: z.ZodDiscriminatedUnion<"op", [z.ZodObject<{
7
7
  op: z.ZodLiteral<"replace">;
@@ -1 +1 @@
1
- {"version":3,"file":"toolProposeChange.d.ts","sourceRoot":"","sources":["../../../../../../src/ee/AiAgent/schemas/tools/toolProposeChange.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,KAAK,SAAS,EAAE,KAAK,MAAM,EAAE,KAAK,KAAK,EAAE,MAAM,aAAa,CAAC;AACtE,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAS3C,eAAO,MAAM,+BAA+B,+iEA2B3C,CAAC;AAMF,KAAK,WAAW,CAAC,CAAC,IAAI,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;AAoC1D,QAAA,MAAM,cAAc;;;;;;;;;;;;;;;;;;IAA0B,CAAC;AAqF/C,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAe5B,CAAC;AAEb,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAC;AAChF,MAAM,MAAM,gCAAgC,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;AAC9E,MAAM,MAAM,oBAAoB,GAAG,WAAW,CAAC,SAAS,CAAC,CAAC;AAC1D,MAAM,MAAM,iBAAiB,GAAG,WAAW,CAAC,MAAM,CAAC,CAAC;AACpD,MAAM,MAAM,gBAAgB,GAAG,WAAW,CAAC,KAAK,CAAC,CAAC;AAElD,eAAO,MAAM,6BAA6B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAexC,CAAC;AAEH,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,KAAK,CACzC,OAAO,6BAA6B,CACvC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lightdash/common",
3
- "version": "0.2066.1",
3
+ "version": "0.2067.0",
4
4
  "main": "dist/cjs/index.js",
5
5
  "module": "dist/esm/index.js",
6
6
  "types": "dist/types/index.d.ts",