@duckcodeailabs/dql-agent 1.6.8 → 1.6.10

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.
@@ -0,0 +1,52 @@
1
+ import type { MetadataAgentIntent, MetadataAllowedSqlContext, MetadataObject } from './catalog.js';
2
+ export type AnalysisQuestionMode = 'exact_lookup' | 'definition' | 'ranking' | 'entity_profile' | 'entity_drilldown' | 'trend' | 'comparison' | 'driver_breakdown' | 'diagnose_change' | 'anomaly' | 'trust_review' | 'general_analysis' | 'clarify';
3
+ export interface AnalysisEntityMention {
4
+ text: string;
5
+ source: 'quoted' | 'named_entity' | 'explicit_filter' | 'email' | 'id';
6
+ typeHint?: string;
7
+ }
8
+ export interface AnalysisQuestionPlan {
9
+ question: string;
10
+ normalizedQuestion: string;
11
+ mode: AnalysisQuestionMode;
12
+ routeIntent: MetadataAgentIntent;
13
+ entities: AnalysisEntityMention[];
14
+ metricTerms: string[];
15
+ dimensionTerms: string[];
16
+ filterTerms: string[];
17
+ timeTerms: string[];
18
+ outputShape: 'value' | 'table' | 'chart' | 'profile' | 'narrative';
19
+ needsGeneratedSql: boolean;
20
+ shouldConsiderCertifiedExact: boolean;
21
+ needsResearchWorkspace: boolean;
22
+ searchQueries: string[];
23
+ searchTerms: string[];
24
+ confidence: number;
25
+ reasons: string[];
26
+ }
27
+ export type CertifiedApplicabilityKind = 'exact_answer' | 'safe_parameterized' | 'context_only' | 'not_applicable';
28
+ export interface CertifiedBlockApplicability {
29
+ objectKey: string;
30
+ name: string;
31
+ kind: CertifiedApplicabilityKind;
32
+ score: number;
33
+ reasons: string[];
34
+ }
35
+ export interface AllowedSqlRelationScore {
36
+ relation: string;
37
+ name: string;
38
+ source: string;
39
+ score: number;
40
+ reasons: string[];
41
+ }
42
+ export declare function buildAnalysisQuestionPlan(question: string, followUp?: unknown): AnalysisQuestionPlan;
43
+ export declare function certifiedApplicabilityForObject(object: MetadataObject, plan: AnalysisQuestionPlan): CertifiedBlockApplicability;
44
+ export declare function scoreMetadataObjectWithAnalysisPlan(object: MetadataObject, plan: AnalysisQuestionPlan): {
45
+ score: number;
46
+ reasons: string[];
47
+ };
48
+ export declare function sortAllowedSqlContextForAnalysisPlan(context: MetadataAllowedSqlContext, plan: AnalysisQuestionPlan, options?: {
49
+ maxRelations?: number;
50
+ }): MetadataAllowedSqlContext;
51
+ export declare function scoreAllowedSqlRelationWithAnalysisPlan(relation: MetadataAllowedSqlContext['relations'][number], plan: AnalysisQuestionPlan): AllowedSqlRelationScore;
52
+ //# sourceMappingURL=analysis-planner.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"analysis-planner.d.ts","sourceRoot":"","sources":["../../src/metadata/analysis-planner.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,mBAAmB,EACnB,yBAAyB,EACzB,cAAc,EACf,MAAM,cAAc,CAAC;AAEtB,MAAM,MAAM,oBAAoB,GAC5B,cAAc,GACd,YAAY,GACZ,SAAS,GACT,gBAAgB,GAChB,kBAAkB,GAClB,OAAO,GACP,YAAY,GACZ,kBAAkB,GAClB,iBAAiB,GACjB,SAAS,GACT,cAAc,GACd,kBAAkB,GAClB,SAAS,CAAC;AAEd,MAAM,WAAW,qBAAqB;IACpC,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,QAAQ,GAAG,cAAc,GAAG,iBAAiB,GAAG,OAAO,GAAG,IAAI,CAAC;IACvE,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,oBAAoB;IACnC,QAAQ,EAAE,MAAM,CAAC;IACjB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,IAAI,EAAE,oBAAoB,CAAC;IAC3B,WAAW,EAAE,mBAAmB,CAAC;IACjC,QAAQ,EAAE,qBAAqB,EAAE,CAAC;IAClC,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,cAAc,EAAE,MAAM,EAAE,CAAC;IACzB,WAAW,EAAE,MAAM,EAAE,CA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