@sisense/sdk-ai-core 0.9.0 → 0.10.1

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 (74) hide show
  1. package/dist/constants.d.ts +2 -0
  2. package/dist/constants.d.ts.map +1 -1
  3. package/dist/engines/build-chart/build-chart-engine.d.ts +3 -4
  4. package/dist/engines/build-chart/build-chart-engine.d.ts.map +1 -1
  5. package/dist/engines/build-chart/build-chart-service.d.ts +3 -3
  6. package/dist/engines/build-chart/build-chart-service.d.ts.map +1 -1
  7. package/dist/engines/build-chart/create-chart/create-chart.d.ts +8 -4
  8. package/dist/engines/build-chart/create-chart/create-chart.d.ts.map +1 -1
  9. package/dist/engines/build-chart/create-chart/generate-chart-table.d.ts +21 -2
  10. package/dist/engines/build-chart/create-chart/generate-chart-table.d.ts.map +1 -1
  11. package/dist/engines/build-chart/dataset-from-saved-chart-widget.d.ts +11 -0
  12. package/dist/engines/build-chart/dataset-from-saved-chart-widget.d.ts.map +1 -0
  13. package/dist/engines/build-chart/types.d.ts +55 -39
  14. package/dist/engines/build-chart/types.d.ts.map +1 -1
  15. package/dist/engines/build-chart/update-chart/apply-prior-chart-style.d.ts +10 -0
  16. package/dist/engines/build-chart/update-chart/apply-prior-chart-style.d.ts.map +1 -0
  17. package/dist/engines/build-chart/update-chart/chart-options-schemas.d.ts +2609 -890
  18. package/dist/engines/build-chart/update-chart/chart-options-schemas.d.ts.map +1 -1
  19. package/dist/engines/build-chart/update-chart/schemas.d.ts +9 -9
  20. package/dist/engines/build-chart/update-chart/update-chart-data-options.d.ts.map +1 -1
  21. package/dist/engines/build-chart/update-chart/update-chart-query.d.ts +8 -0
  22. package/dist/engines/build-chart/update-chart/update-chart-query.d.ts.map +1 -0
  23. package/dist/engines/build-chart/update-chart/update-chart-style-options.d.ts.map +1 -1
  24. package/dist/engines/build-chart/update-chart/update-chart-title.d.ts.map +1 -1
  25. package/dist/engines/build-chart/update-chart/update-chart-type.d.ts.map +1 -1
  26. package/dist/engines/build-csv-model/build-csv-model-engine.d.ts.map +1 -1
  27. package/dist/engines/build-csv-model/rest-build.d.ts.map +1 -1
  28. package/dist/engines/build-csv-model/types.d.ts +10 -0
  29. package/dist/engines/build-csv-model/types.d.ts.map +1 -1
  30. package/dist/engines/build-dashboard/add-dashboard-filters.d.ts.map +1 -1
  31. package/dist/engines/build-dashboard/add-dashboard-widgets.d.ts.map +1 -1
  32. package/dist/engines/build-dashboard/build-dashboard-engine.d.ts +2 -5
  33. package/dist/engines/build-dashboard/build-dashboard-engine.d.ts.map +1 -1
  34. package/dist/engines/build-dashboard/build-dashboard-service.d.ts.map +1 -1
  35. package/dist/engines/build-dashboard/create-chart-widget.d.ts.map +1 -1
  36. package/dist/engines/build-dashboard/create-dashboard.d.ts.map +1 -1
  37. package/dist/engines/build-dashboard/load-existing-fusion-dashboard.d.ts.map +1 -1
  38. package/dist/engines/build-dashboard/types.d.ts +34 -6
  39. package/dist/engines/build-dashboard/types.d.ts.map +1 -1
  40. package/dist/engines/build-dashboard/update-chart-widget.d.ts.map +1 -1
  41. package/dist/engines/build-dashboard/update-dashboard.d.ts.map +1 -1
  42. package/dist/engines/build-data-model/build-data-model-engine.d.ts.map +1 -1
  43. package/dist/engines/build-query/build-query-engine.d.ts.map +1 -1
  44. package/dist/engines/build-query/types.d.ts +28 -9
  45. package/dist/engines/build-query/types.d.ts.map +1 -1
  46. package/dist/engines/get-dashboards/get-dashboards-engine.d.ts.map +1 -1
  47. package/dist/engines/get-dashboards/types.d.ts +5 -0
  48. package/dist/engines/get-dashboards/types.d.ts.map +1 -1
  49. package/dist/engines/get-data-source-fields/get-data-source-fields-engine.d.ts.map +1 -1
  50. package/dist/engines/get-data-source-fields/types.d.ts +5 -0
  51. package/dist/engines/get-data-source-fields/types.d.ts.map +1 -1
  52. package/dist/engines/get-data-sources/get-data-sources-engine.d.ts.map +1 -1
  53. package/dist/engines/get-data-sources/types.d.ts +5 -0
  54. package/dist/engines/get-data-sources/types.d.ts.map +1 -1
  55. package/dist/engines/manage-perspectives/manage-perspectives-engine.d.ts.map +1 -1
  56. package/dist/engines/manage-perspectives/types.d.ts +37 -0
  57. package/dist/engines/manage-perspectives/types.d.ts.map +1 -1
  58. package/dist/engines/recommend-queries/recommend-queries-engine.d.ts.map +1 -1
  59. package/dist/engines/recommend-queries/types.d.ts +5 -0
  60. package/dist/engines/recommend-queries/types.d.ts.map +1 -1
  61. package/dist/engines/shared/get-filters-json-for-llm-summary.d.ts +12 -0
  62. package/dist/engines/shared/get-filters-json-for-llm-summary.d.ts.map +1 -0
  63. package/dist/engines/shared/nlq-query-helpers.d.ts +13 -3
  64. package/dist/engines/shared/nlq-query-helpers.d.ts.map +1 -1
  65. package/dist/index.d.ts +10 -0
  66. package/dist/index.d.ts.map +1 -1
  67. package/dist/index.js +4878 -3898
  68. package/dist/index.js.map +1 -1
  69. package/dist/services/llm/llm-consumption-service.d.ts.map +1 -1
  70. package/dist/services/nlq/nlq-service.d.ts +33 -3
  71. package/dist/services/nlq/nlq-service.d.ts.map +1 -1
  72. package/dist/utils/dev-debug.d.ts +8 -0
  73. package/dist/utils/dev-debug.d.ts.map +1 -0
  74. package/package.json +1 -1
@@ -327,4 +327,41 @@ export interface PerspectiveEngineContext {
327
327
  toolCallId: string;
328
328
  httpClient?: HttpClient;
329
329
  }
330
+ /**
331
+ * Canonical tool description for listDataModels — reusable by any host.
332
+ * When getDataSources is also registered, prefer getDataSources for discovery (it includes drafts and live sources); use this tool for Elasticube-only model lists if needed.
333
+ */
334
+ export declare const listDataModelsToolDescription = "Lists all Sisense data models (Elasticubes) available in the instance. Data models and data sources overlap in Sisense \u2014 when getDataSources is available, prefer it for unified discovery.\n\nReturns each model's OID (UUID), title, and type. At the start of a perspective workflow, call this as the ONLY tool in the turn if you use it \u2014 never use an OID from memory, prior context, or examples. After it returns, present the model list and stop; wait for the user to pick a model before calling getModelSchema. Do NOT chain into getModelSchema in the same turn.";
335
+ /**
336
+ * Canonical tool description for getModelSchema — reusable by any host.
337
+ */
338
+ export declare const getModelSchemaToolDescription = "Fetches the full schema of a Sisense data model: all tables with their OIDs and columns (with OIDs and types), plus all relation OIDs.\n\nIMPORTANT: The datamodelOid parameter MUST be a UUID \u2014 use the `oid` field from a `getDataSources` or `listDataModels` result in the current conversation. Never use an OID from memory, context, or examples. Perspective OIDs and legacy datasource string IDs (e.g. \"localhost_aSampleECommerce\") are NOT valid here.\n\nThis is the canonical \"show / explore / view / open the data model\" action (including drafts for inspection). When the user picks a model or uses those verbs about a specific model by name, use the model's oid from the latest getDataSources result. Do not ask \"schema or build?\" for a simple show-model request. Do not use getDataSourceFields as the default exploration action \u2014 that returns a flat field list, not the model diagram.\n\nThis is step 2 of the perspective workflow. After this returns, propose 2-4 concrete perspective ideas (each with: name, tables included, columns hidden, intended audience) and ASK the user which one to create. STOP and wait \u2014 do NOT call createPerspective in the same turn.\n\nPerspective workflow pacing: prefer one major conversational step per assistant reply where possible \u2014 list what exists, inspect and discuss the schema with the user, agree on a design, then call createPerspective in a later focused turn once choices are clear (rather than jumping from first discovery straight to creation in one reply when the user has not confirmed direction).";
339
+ /**
340
+ * Canonical tool description for addRelation — reusable by any host.
341
+ */
342
+ export declare const addRelationToolDescription = "Creates a join relationship between two tables in a Sisense data model.\n\nCall getModelSchema first \u2014 all three IDs (dataset, table, column) must be UUIDs from that response.\nSource = the \"many\" side (fact/transaction table with the FK column).\nTarget = the \"one\" side (dimension/lookup table with the PK column).\n\nCall once per join. The host may refresh the model diagram as each addRelation succeeds.\n\nAfter all addRelation calls succeed in a turn, briefly summarize the joins you created and ASK the user whether to trigger a build now (so the new joins become queryable). Do NOT call triggerBuild automatically \u2014 it requires explicit user agreement.";
343
+ /**
344
+ * Canonical tool description for removeRelation — reusable by any host.
345
+ */
346
+ export declare const removeRelationToolDescription = "Removes a join relationship from a Sisense data model.\n\nCall getModelSchema first to obtain the relations[].oid you want to remove. Pass that as relationOid; the engine validates it exists on the given datamodelOid before sending the mutation.\n\nCall once per relation. The host may refresh the model diagram as each removeRelation succeeds.\n\nAfter all removeRelation calls succeed in a turn, briefly summarize what you removed and ASK the user whether to trigger a build now. Do NOT call triggerBuild automatically \u2014 it requires explicit user agreement.";
347
+ /**
348
+ * Canonical tool description for createPerspective — reusable by any host.
349
+ */
350
+ export declare const createPerspectiveToolDescription = "Creates a new perspective (filtered sub-model) on a Sisense data model. This is step 3 \u2014 the final step \u2014 of the perspective workflow.\n\nFor a new perspective, work in stages: first discover models and wait for the user to pick one, then fetch schema and wait for design agreement, then call this tool in its own turn with OIDs from that schema \u2014 never skip discovery or schema in the same turn as create.\n\nCall getModelSchema first (step 2) to get exact table OIDs, column OIDs, and relation OIDs. Use ONLY OIDs from that schema response \u2014 never invent or guess OIDs.\n\nAfter the user picks a perspective option (or describes a custom one), call this tool IMMEDIATELY in the same turn. Do not ask further confirmation. The host typically opens an interactive diagram of the perspective \u2014 reply with a one-line confirmation; do not narrate the diagram in detail.\n\ndiffType rules:\n- \"include\": allowlist \u2014 only columns listed with enabled:true are visible. Use when exposing a small subset.\n- \"exclude\": denylist \u2014 all columns visible except those listed with enabled:false. Use when hiding a few sensitive columns.\n\ncolumnsDiff must never be empty \u2014 for \"include\" list every visible column with enabled:true; for \"exclude\" list at least one hidden column with enabled:false.\n\nInclude a relation OID only when both connected tables are in the perspective's tables list.";
351
+ /**
352
+ * Canonical tool description for updatePerspective — reusable by any host.
353
+ */
354
+ export declare const updatePerspectiveToolDescription = "Updates an existing Sisense PERSPECTIVE (a saved filtered sub-model / view). This tool does NOT modify the underlying data model \u2014 it only changes which tables/columns/relations a specific perspective exposes.\n\nDO NOT call this tool when the user asks to add, remove, or modify RELATIONS on the data model itself \u2014 that operates on the model, not on a perspective. (To add a relation, use addRelation. To remove a relation, use removeRelation.)\n\nSend only the fields you want to change:\n- To rename a perspective: pass only name.\n- To update column visibility within the perspective: pass the full tables array (it replaces the existing one).\n- To expose another existing table in the perspective: include all existing tables plus the new one in the tables array.\n\nAfter a successful update, call getPerspective with the same perspectiveOid in the next turn so the user sees the refreshed diagram.";
355
+ /**
356
+ * Canonical tool description for getPerspective — reusable by any host.
357
+ */
358
+ export declare const getPerspectiveToolDescription = "Fetches the current state of a Sisense perspective. The host typically renders an interactive diagram when supported.\n\nCall ONLY when the user references a specific perspective by name, asks to view/open/show that perspective, after listPerspectives when they pick one, or directly after a successful updatePerspective.\n\nDo NOT call as a follow-up to getModelSchema for a generic \"show me the model diagram\" \u2014 that is model-level (getModelSchema). Do NOT also call when the user only named the parent data model unless they named a perspective.\n\nThis always fetches fresh state from the server \u2014 never rely on cached args from prior tool calls.\n\nReply with a one-line confirmation; do not narrate the diagram in detail.";
359
+ /**
360
+ * Canonical tool description for triggerBuild — reusable by any host.
361
+ */
362
+ export declare const triggerBuildToolDescription = "Triggers a full build of a Sisense Elasticube and (by default) waits for it to finish.\n\nFull cube rebuilds are disruptive \u2014 long-running and they can block or delay query and chart use on that model until they finish. NEVER call without explicit user agreement in the current conversation.\n\nDESTRUCTIVE / EXPENSIVE: a build recomputes the entire cube and can take 20-90s for small CSV cubes (longer for big ones).\n\nWorkflow rule: after addRelation, table edits, or any other schema change, briefly summarize the change and ASK the user whether to build now. Do not call this tool until the user has explicitly said yes (\"yes, build\", \"go ahead\", \"rebuild now\", etc.). If the user said \"I'll build it myself\" or hasn't responded, do nothing.\n\nPass wait:false only if the user explicitly says \"kick off the build, don't wait\", otherwise leave wait undefined (defaults to true).\n\nConfirm completion in one short line (\"Build done in 32s.\") \u2014 do not narrate progress steps.";
363
+ /**
364
+ * Canonical tool description for listPerspectives — reusable by any host.
365
+ */
366
+ export declare const listPerspectivesToolDescription = "Lists Sisense perspectives. Use whenever the user asks to:\n- \"see / list / show me the perspectives\" (with or without a specific model)\n- \"what perspectives exist on this model\"\n- review existing perspectives before deciding to create / update / delete one\n\nPass datamodelOid to scope to a single model; omit it for a global list across every model the user has access to. Set includeDefault:false to hide the auto-generated Default perspectives.\n\nAfter the result, present the user with a short numbered/bulleted summary (name, table count, default vs custom) and ask which one they want to inspect \u2014 then call getPerspective to render its diagram.";
330
367
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/engines/manage-perspectives/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAItD,eAAO,MAAM,0BAA0B,gDAAe,CAAC;AAEvD,MAAM,WAAW,gBAAgB;IAChC,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;CAC7B;AAED,MAAM,WAAW,oBAAoB;IACpC,MAAM,EAAE,gBAAgB,EAAE,CAAC;CAC3B;AAID,eAAO,MAAM,0BAA0B;;;;;;EAOrC,CAAC;AAEH,MAAM,WAAW,WAAW;IAC3B,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CACb;AAED,MAAM,WAAW,UAAU;IAC1B,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,WAAW,EAAE,CAAC;CACvB;AAED,MAAM,WAAW,aAAa;IAC7B,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,MAAM,EAAE,CAAC;CACjB;AAED,MAAM,WAAW,iBAAiB;IACjC,YAAY,EAAE,MAAM,CAAC;IACrB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,UAAU,EAAE,CAAC;IACrB,SAAS,EAAE,aAAa,EAAE,CAAC;CAC3B;AA+BD,eAAO,MAAM,6BAA6B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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AAE,CAAC,CAAC;IAClC,SAAS,CAAC,EAAE,OAAO,CAAC;CACpB;AAID,eAAO,MAAM,wBAAwB;;;;;;;;;EAenC,CAAC;AAEH,MAAM,WAAW,kBAAkB;IAClC,YAAY,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,QAAQ,GAAG,MAAM,GAAG,QAAQ,GAAG,SAAS,CAAC;IACjD,UAAU,CAAC,EAAE,MAAM,CAAC;CACpB;AAID,eAAO,MAAM,4BAA4B;;;;;;;;;EAgBvC,CAAC;AAEH,MAAM,WAAW,kBAAkB;IAClC,cAAc,EAAE,MAAM,CAAC;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,OAAO,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,sBAAsB;IACtC,YAAY,EAAE,kBAAkB,EAAE,CAAC;CACnC;AAID,MAAM,WAAW,wBAAwB;IACxC,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,UAAU,CAAC;CACxB"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/engines/manage-perspectives/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAItD,eAAO,MAAM,0BAA0B,gDAAe,CAAC;AAEvD,MAAM,WAAW,gBAAgB;IAChC,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;CAC7B;AAED,MAAM,WAAW,oBAAoB;IACpC,MAAM,EAAE,gBAAgB,EAAE,CAAC;CAC3B;AAID,e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IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,sBAAsB;IACtC,YAAY,EAAE,kBAAkB,EAAE,CAAC;CACnC;AAID,MAAM,WAAW,wBAAwB;IACxC,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,UAAU,CAAC;CACxB;AAID;;;GAGG;AACH,eAAO,MAAM,6BAA6B,+jBAEwU,CAAC;AAEnX;;GAEG;AACH,eAAO,MAAM,6BAA6B,4iDAQmV,CAAC;AAE9X;;GAEG;AACH,eAAO,MAAM,0BAA0B,wqBAQmN,CAAC;AAE3P;;GAEG;AACH,eAAO,MAAM,6BAA6B,yjBAM0K,CAAC;AAErN;;GAEG;AACH,eAAO,MAAM,gCAAgC,y5CAcgD,CAAC;AAE9F;;GAEG;AACH,eAAO,MAAM,gCAAgC,y5BASwF,CAAC;AAEtI;;GAEG;AACH,eAAO,MAAM,6BAA6B,wuBAQgC,CAAC;AAE3E;;GAEG;AACH,eAAO,MAAM,2BAA2B,8+BAUqD,CAAC;AAE9F;;GAEG;AACH,eAAO,MAAM,+BAA+B,8pBAO8J,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"recommend-queries-engine.d.ts","sourceRoot":"","sources":["../../../src/engines/recommend-queries/recommend-queries-engine.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAK5C,OAAO,EACN,sBAAsB,EACtB,uBAAuB,EACvB,sBAAsB,EAEtB,6BAA6B,EAG7B,MAAM,SAAS,CAAC;AAEjB;;GAEG;AACH,wBAAgB,0BAA0B,CACzC,UAAU,EAAE,MAAM,GAChB,SAAS,GAAG,SAAS,CAQvB;AAED;;GAEG;AACH,wBAAgB,qBAAqB,CACpC,UAAU,CAAC,EAAE,MAAM,EACnB,eAAe,CAAC,EAAE,MAAM,EAAE,GACxB,MAAM,GAAG,SAAS,CAyBpB;AAED;;;;;;GAMG;AACH,wBAAsB,sBAAsB,CAC3C,MAAM,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,EAC9C,OAAO,EAAE,uBAAuB,EAChC,qBAAqB,CAAC,EAAE,6BAA6B,GACnD,OAAO,CAAC,sBAAsB,CAAC,CAoGjC"}
1
+ {"version":3,"file":"recommend-queries-engine.d.ts","sourceRoot":"","sources":["../../../src/engines/recommend-queries/recommend-queries-engine.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAI5C,OAAO,EACN,sBAAsB,EACtB,uBAAuB,EACvB,sBAAsB,EAEtB,6BAA6B,EAG7B,MAAM,SAAS,CAAC;AAIjB;;GAEG;AACH,wBAAgB,0BAA0B,CACzC,UAAU,EAAE,MAAM,GAChB,SAAS,GAAG,SAAS,CAQvB;AAED;;GAEG;AACH,wBAAgB,qBAAqB,CACpC,UAAU,CAAC,EAAE,MAAM,EACnB,eAAe,CAAC,EAAE,MAAM,EAAE,GACxB,MAAM,GAAG,SAAS,CAyBpB;AAED;;;;;;GAMG;AACH,wBAAsB,sBAAsB,CAC3C,MAAM,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,EAC9C,OAAO,EAAE,uBAAuB,EAChC,qBAAqB,CAAC,EAAE,6BAA6B,GACnD,OAAO,CAAC,sBAAsB,CAAC,CAsGjC"}
@@ -2,6 +2,11 @@ import { z } from 'zod';
2
2
  import { WidgetProps, ChartType } from '@sisense/sdk-ui';
3
3
  import { HttpClient } from '@sisense/sdk-rest-client';
4
4
  import { OpenAI } from 'openai';
5
+ /**
6
+ * Canonical tool description for recommendQueries — reusable by any host (sdk-assistant, MCP server, custom integrations).
7
+ * Hosts may append host-specific notes but should not duplicate or contradict this text.
8
+ */
9
+ export declare const recommendQueriesToolDescription = "Recommend natural language queries to ask on a data source based on explicit user prompt and context.\n\nIMPORTANT:\n- NEVER assume a data source title is valid. If no fresh getDataSources result exists in this conversation, call getDataSources first to validate the data source exists and is queryable (not draft), or ask the user to specify one.\n- Use userPrompt to filter and prioritize relevant recommendations (e.g. \"revenue dashboard\", \"sales analysis\").\n- Use existingWidgets to avoid duplicate recommendations when adding to existing dashboards.\n- Extract chart types from user prompts (e.g. \"bar chart\", \"line chart\") and pass through to chart generation when the host supports it.\n\nDo not call recommendQueries on a draft data model \u2014 drafts are not queryable until built.";
5
10
  /**
6
11
  * Default number of query recommendations to return
7
12
  */
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/engines/recommend-queries/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AACzD,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAErC;;GAEG;AACH,eAAO,MAAM,mBAAmB,IAAI,CAAC;AAErC;;GAEG;AACH,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;EAkBjC,CAAC;AAEH;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACvC;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;IACnB,gCAAgC;IAChC,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,YAAY,CAAC,EAAE,MAAM,CAAC;CACtB;AAED;;GAEG;AACH,MAAM,MAAM,2BAA2B,GAAG;IACzC,mBAAmB,EAAE,MAAM,CAAC;IAC5B,SAAS,EAAE,MAAM,CAAC;CAClB,GAAG,WAAW,CAAC;AAEhB;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACtC;;OAEG;IACH,eAAe,EAAE,2BAA2B,EAAE,CAAC;CAC/C;AAED;;G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MAAM,CAAC,MAAM,EAAE,SAAS,CAYzD,CAAC"}
@@ -0,0 +1,12 @@
1
+ import { Filter, FilterRelations, FunctionCall } from '@sisense/sdk-data';
2
+ /**
3
+ * Compact filter list for LLM-facing chart/dashboard summaries.
4
+ * Translates CSDK {@link Filter} instances via {@link translateQueryToJSON}.
5
+ */
6
+ export declare function getFiltersJsonForLlmSummary(csdkFilters: Filter[] | FilterRelations | readonly Filter[] | undefined | null): unknown[];
7
+ /**
8
+ * Same as {@link getFiltersJsonForLlmSummary}, narrowed to compose-tree
9
+ * {@link FunctionCall} nodes for typed LLM payloads (unknown entries are dropped).
10
+ */
11
+ export declare function getFunctionCallFiltersForLlmSummary(csdkFilters: Filter[] | FilterRelations | readonly Filter[] | undefined | null): FunctionCall[];
12
+ //# sourceMappingURL=get-filters-json-for-llm-summary.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-filters-json-for-llm-summary.d.ts","sourceRoot":"","sources":["../../../src/engines/shared/get-filters-json-for-llm-summary.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAyB/E;;;GAGG;AACH,wBAAgB,2BAA2B,CAC1C,WAAW,EACR,MAAM,EAAE,GACR,eAAe,GACf,SAAS,MAAM,EAAE,GACjB,SAAS,GACT,IAAI,GACL,OAAO,EAAE,CA6BX;AAUD;;;GAGG;AACH,wBAAgB,mCAAmC,CAClD,WAAW,EACR,MAAM,EAAE,GACR,eAAe,GACf,SAAS,MAAM,EAAE,GACjB,SAAS,GACT,IAAI,GACL,YAAY,EAAE,CAEhB"}
@@ -1,5 +1,15 @@
1
- import { NlqV3Result } from '../../services/nlq/nlq-service';
1
+ import { QueryExecutionResult, QueryState } from '../../services/nlq/nlq-service';
2
2
  import { HttpClient } from '@sisense/sdk-rest-client';
3
- /** Call NLQ V3 smartQuery API */
4
- export declare function executeNlqV3Query(dataSourceTitle: string, queryPrompt: string, httpClient?: HttpClient, commonFilters?: unknown): Promise<NlqV3Result | null>;
3
+ /**
4
+ * Layer-2 NLQ fallback when wire `chartState` is disabled (`isNlqDeltaEnabled === false`):
5
+ * prepend a machine-readable JSON snapshot of the prior structural state, then the user's
6
+ * prompt. NLQ receives a single `text` field (no `chartState`). Truncate very large states
7
+ * to cap token growth; truncation is logged.
8
+ */
9
+ export declare function augmentNlqTextWithPriorState(userText: string, priorState: QueryState): {
10
+ text: string;
11
+ truncated: boolean;
12
+ };
13
+ /** Call NLQ V3 smartQuery API; maps wire `chartState` to domain `queryState`. */
14
+ export declare function executeNlqV3Query(dataSourceTitle: string, queryPrompt: string, httpClient?: HttpClient, commonFilters?: unknown, priorQueryState?: QueryState, isNlqDeltaEnabled?: boolean): Promise<QueryExecutionResult | null>;
5
15
  //# sourceMappingURL=nlq-query-helpers.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"nlq-query-helpers.d.ts","sourceRoot":"","sources":["../../../src/engines/shared/nlq-query-helpers.ts"],"names":[],"mappings":"AAAA,OAAO,EAGN,WAAW,EACX,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAEtD,iCAAiC;AACjC,wBAAsB,iBAAiB,CACtC,eAAe,EAAE,MAAM,EACvB,WAAW,EAAE,MAAM,EACnB,UAAU,CAAC,EAAE,UAAU,EACvB,aAAa,CAAC,EAAE,OAAO,GACrB,OAAO,CAAC,WAAW,GAAG,IAAI,CAAC,CAS7B"}
1
+ {"version":3,"file":"nlq-query-helpers.d.ts","sourceRoot":"","sources":["../../../src/engines/shared/nlq-query-helpers.ts"],"names":[],"mappings":"AAAA,OAAO,EAGN,oBAAoB,EACpB,UAAU,EACV,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AA6CtD;;;;;GAKG;AACH,wBAAgB,4BAA4B,CAC3C,QAAQ,EAAE,MAAM,EAChB,UAAU,EAAE,UAAU,GACpB;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,OAAO,CAAA;CAAE,CAStC;AAED,iFAAiF;AACjF,wBAAsB,iBAAiB,CACtC,eAAe,EAAE,MAAM,EACvB,WAAW,EAAE,MAAM,EACnB,UAAU,CAAC,EAAE,UAAU,EACvB,aAAa,CAAC,EAAE,OAAO,EACvB,eAAe,CAAC,EAAE,UAAU,EAC5B,iBAAiB,UAAO,GACtB,OAAO,CAAC,oBAAoB,GAAG,IAAI,CAAC,CAyBtC"}
package/dist/index.d.ts CHANGED
@@ -1,7 +1,17 @@
1
1
  export * from './engines';
2
+ export { buildQueryToolDescription } from './engines/build-query/types';
3
+ export { buildChartToolDescription } from './engines/build-chart/types';
4
+ export { buildDashboardToolDescription } from './engines/build-dashboard/types';
5
+ export { getDataSourcesToolDescription } from './engines/get-data-sources/types';
6
+ export { getDataSourceFieldsToolDescription } from './engines/get-data-source-fields/types';
7
+ export { getDashboardsToolDescription } from './engines/get-dashboards/types';
8
+ export { uploadFilesToolDescription, buildDataModelFromUploadsToolDescription, } from './engines/build-csv-model/types';
9
+ export { recommendQueriesToolDescription } from './engines/recommend-queries/types';
10
+ export { listDataModelsToolDescription, getModelSchemaToolDescription, addRelationToolDescription, removeRelationToolDescription, createPerspectiveToolDescription, updatePerspectiveToolDescription, getPerspectiveToolDescription, triggerBuildToolDescription, listPerspectivesToolDescription, } from './engines/manage-perspectives/types';
2
11
  export * from './constants';
3
12
  export { zodFunction, zodToReadableType, excludeSchemaProperties, filterSchemaProperties, } from './utils/zod-utils';
4
13
  export * from './utils/id-utils';
14
+ export * from './utils/dev-debug';
5
15
  export * from './utils/utils';
6
16
  export * from './utils/http-client';
7
17
  export * from './utils/openai-client';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,cAAc,WAAW,CAAC;AAG1B,cAAc,aAAa,CAAC;AAG5B,OAAO,EACN,WAAW,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