@duckcodeailabs/dql-agent 1.6.21 → 1.6.22
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/agent-run-engine.d.ts +287 -0
- package/dist/agent-run-engine.d.ts.map +1 -0
- package/dist/agent-run-engine.js +916 -0
- package/dist/agent-run-engine.js.map +1 -0
- package/dist/agent-run-gates.d.ts +26 -0
- package/dist/agent-run-gates.d.ts.map +1 -0
- package/dist/agent-run-gates.js +170 -0
- package/dist/agent-run-gates.js.map +1 -0
- package/dist/agent-run-planner.d.ts +32 -0
- package/dist/agent-run-planner.d.ts.map +1 -0
- package/dist/agent-run-planner.js +280 -0
- package/dist/agent-run-planner.js.map +1 -0
- package/dist/answer-loop.d.ts +49 -0
- package/dist/answer-loop.d.ts.map +1 -1
- package/dist/answer-loop.js +292 -17
- package/dist/answer-loop.js.map +1 -1
- package/dist/app-builder.d.ts +6 -0
- package/dist/app-builder.d.ts.map +1 -1
- package/dist/app-builder.js +95 -2
- package/dist/app-builder.js.map +1 -1
- package/dist/app-planner.d.ts +78 -0
- package/dist/app-planner.d.ts.map +1 -0
- package/dist/app-planner.js +145 -0
- package/dist/app-planner.js.map +1 -0
- package/dist/embeddings/provider.d.ts +66 -0
- package/dist/embeddings/provider.d.ts.map +1 -0
- package/dist/embeddings/provider.js +105 -0
- package/dist/embeddings/provider.js.map +1 -0
- package/dist/hints/git-store.d.ts +69 -0
- package/dist/hints/git-store.d.ts.map +1 -0
- package/dist/hints/git-store.js +244 -0
- package/dist/hints/git-store.js.map +1 -0
- package/dist/hints/retrieval.d.ts +49 -0
- package/dist/hints/retrieval.d.ts.map +1 -0
- package/dist/hints/retrieval.js +60 -0
- package/dist/hints/retrieval.js.map +1 -0
- package/dist/hints/store.d.ts +39 -0
- package/dist/hints/store.d.ts.map +1 -0
- package/dist/hints/store.js +279 -0
- package/dist/hints/store.js.map +1 -0
- package/dist/hints/types.d.ts +147 -0
- package/dist/hints/types.d.ts.map +1 -0
- package/dist/hints/types.js +92 -0
- package/dist/hints/types.js.map +1 -0
- package/dist/index.d.ts +43 -6
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +35 -3
- package/dist/index.js.map +1 -1
- package/dist/intent-controller.d.ts +63 -0
- package/dist/intent-controller.d.ts.map +1 -0
- package/dist/intent-controller.js +150 -0
- package/dist/intent-controller.js.map +1 -0
- package/dist/kg/build.d.ts.map +1 -1
- package/dist/kg/build.js +2 -0
- package/dist/kg/build.js.map +1 -1
- package/dist/kg/sqlite-fts.js +4 -0
- package/dist/kg/sqlite-fts.js.map +1 -1
- package/dist/kg/types.d.ts +10 -0
- package/dist/kg/types.d.ts.map +1 -1
- package/dist/metadata/catalog.d.ts +81 -4
- package/dist/metadata/catalog.d.ts.map +1 -1
- package/dist/metadata/catalog.js +208 -1
- package/dist/metadata/catalog.js.map +1 -1
- package/dist/metadata/drafts.d.ts +22 -0
- package/dist/metadata/drafts.d.ts.map +1 -1
- package/dist/metadata/drafts.js +126 -2
- package/dist/metadata/drafts.js.map +1 -1
- package/dist/metadata/grain-gate.d.ts +61 -0
- package/dist/metadata/grain-gate.d.ts.map +1 -0
- package/dist/metadata/grain-gate.js +265 -0
- package/dist/metadata/grain-gate.js.map +1 -0
- package/dist/metadata/identity.d.ts +47 -0
- package/dist/metadata/identity.d.ts.map +1 -0
- package/dist/metadata/identity.js +147 -0
- package/dist/metadata/identity.js.map +1 -0
- package/dist/metadata/metric-match.d.ts +93 -0
- package/dist/metadata/metric-match.d.ts.map +1 -0
- package/dist/metadata/metric-match.js +233 -0
- package/dist/metadata/metric-match.js.map +1 -0
- package/dist/metadata/sql-grounding.d.ts +149 -0
- package/dist/metadata/sql-grounding.d.ts.map +1 -0
- package/dist/metadata/sql-grounding.js +397 -0
- package/dist/metadata/sql-grounding.js.map +1 -0
- package/dist/metadata/sql-retrieval.d.ts +29 -0
- package/dist/metadata/sql-retrieval.d.ts.map +1 -0
- package/dist/metadata/sql-retrieval.js +79 -0
- package/dist/metadata/sql-retrieval.js.map +1 -0
- package/dist/narrate.d.ts +52 -0
- package/dist/narrate.d.ts.map +1 -0
- package/dist/narrate.js +263 -0
- package/dist/narrate.js.map +1 -0
- package/dist/propose/build-from-prompt.d.ts +160 -0
- package/dist/propose/build-from-prompt.d.ts.map +1 -0
- package/dist/propose/build-from-prompt.js +815 -0
- package/dist/propose/build-from-prompt.js.map +1 -0
- package/dist/propose/classify.d.ts +55 -0
- package/dist/propose/classify.d.ts.map +1 -0
- package/dist/propose/classify.js +167 -0
- package/dist/propose/classify.js.map +1 -0
- package/dist/propose/config.d.ts +39 -0
- package/dist/propose/config.d.ts.map +1 -0
- package/dist/propose/config.js +52 -0
- package/dist/propose/config.js.map +1 -0
- package/dist/propose/dbt-artifacts.d.ts +134 -0
- package/dist/propose/dbt-artifacts.d.ts.map +1 -0
- package/dist/propose/dbt-artifacts.js +320 -0
- package/dist/propose/dbt-artifacts.js.map +1 -0
- package/dist/propose/edit-block.d.ts +74 -0
- package/dist/propose/edit-block.d.ts.map +1 -0
- package/dist/propose/edit-block.js +133 -0
- package/dist/propose/edit-block.js.map +1 -0
- package/dist/propose/enrich.d.ts +48 -0
- package/dist/propose/enrich.d.ts.map +1 -0
- package/dist/propose/enrich.js +125 -0
- package/dist/propose/enrich.js.map +1 -0
- package/dist/propose/generate-sql.d.ts +61 -0
- package/dist/propose/generate-sql.d.ts.map +1 -0
- package/dist/propose/generate-sql.js +180 -0
- package/dist/propose/generate-sql.js.map +1 -0
- package/dist/propose/index.d.ts +24 -0
- package/dist/propose/index.d.ts.map +1 -0
- package/dist/propose/index.js +15 -0
- package/dist/propose/index.js.map +1 -0
- package/dist/propose/propose.d.ts +226 -0
- package/dist/propose/propose.d.ts.map +1 -0
- package/dist/propose/propose.js +668 -0
- package/dist/propose/propose.js.map +1 -0
- package/dist/propose/reflect-block.d.ts +99 -0
- package/dist/propose/reflect-block.d.ts.map +1 -0
- package/dist/propose/reflect-block.js +220 -0
- package/dist/propose/reflect-block.js.map +1 -0
- package/dist/propose/write-draft.d.ts +90 -0
- package/dist/propose/write-draft.d.ts.map +1 -0
- package/dist/propose/write-draft.js +185 -0
- package/dist/propose/write-draft.js.map +1 -0
- package/dist/providers/claude.d.ts +13 -1
- package/dist/providers/claude.d.ts.map +1 -1
- package/dist/providers/claude.js +20 -2
- package/dist/providers/claude.js.map +1 -1
- package/dist/providers/gemini.d.ts +13 -1
- package/dist/providers/gemini.d.ts.map +1 -1
- package/dist/providers/gemini.js +24 -3
- package/dist/providers/gemini.js.map +1 -1
- package/dist/providers/index.d.ts +3 -3
- package/dist/providers/index.d.ts.map +1 -1
- package/dist/providers/index.js +3 -3
- package/dist/providers/index.js.map +1 -1
- package/dist/research-loop.d.ts +62 -0
- package/dist/research-loop.d.ts.map +1 -0
- package/dist/research-loop.js +210 -0
- package/dist/research-loop.js.map +1 -0
- package/dist/skills/defaults.d.ts +37 -0
- package/dist/skills/defaults.d.ts.map +1 -0
- package/dist/skills/defaults.js +152 -0
- package/dist/skills/defaults.js.map +1 -0
- package/dist/skills/loader.d.ts +60 -0
- package/dist/skills/loader.d.ts.map +1 -1
- package/dist/skills/loader.js +164 -2
- package/dist/skills/loader.js.map +1 -1
- package/package.json +7 -5
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Scoped correction memory ("mini Hint Graph") types.
|
|
3
|
+
*
|
|
4
|
+
* When an analyst corrects a Tier-2 generated answer, that knowledge is captured
|
|
5
|
+
* as a scoped, approved-only, Git-versioned **hint**. Hints never override
|
|
6
|
+
* certified routing — they are folded into the agent's context AFTER certified
|
|
7
|
+
* artifacts, semantic context, and graph anchors, and only when `approved`.
|
|
8
|
+
*
|
|
9
|
+
* Source of truth = Git:
|
|
10
|
+
* - `.dql/traces/*.trace.json` — raw correction traces (what was wrong + the fix)
|
|
11
|
+
* - `.dql/hints/*.hint.yaml` — candidate/approved/rejected hints
|
|
12
|
+
* - `.dql/reviews/*.review.yaml` — human review decisions
|
|
13
|
+
*
|
|
14
|
+
* `.dql/cache/agent-kg.sqlite` carries a rebuildable FTS index of approved hints
|
|
15
|
+
* (Git authoritative; SQLite is just a fast scoped lookup).
|
|
16
|
+
*/
|
|
17
|
+
/**
|
|
18
|
+
* Does a hint's scope apply to the question's resolved scope?
|
|
19
|
+
*
|
|
20
|
+
* Semantics: a hint scope field constrains ONLY when the hint declares it. For
|
|
21
|
+
* each declared field, the question must declare the same value (case-insensitive).
|
|
22
|
+
* If the question does not declare a field the hint constrains, the hint does
|
|
23
|
+
* NOT apply (we never apply a narrower-than-known hint to an unknown context),
|
|
24
|
+
* EXCEPT `dialect`, which applies when the question's dialect is unknown (so a
|
|
25
|
+
* project-wide dialect hint is not silently dropped before a warehouse is wired).
|
|
26
|
+
*
|
|
27
|
+
* Undeclared hint fields are wildcards and never block a match.
|
|
28
|
+
*/
|
|
29
|
+
export function hintAppliesToScope(scope, question) {
|
|
30
|
+
const matched = [];
|
|
31
|
+
const constrainedFields = [
|
|
32
|
+
['metric', 'metric'],
|
|
33
|
+
['dbtModel', 'dbtModel'],
|
|
34
|
+
['domain', 'domain'],
|
|
35
|
+
['term', 'term'],
|
|
36
|
+
['block', 'block'],
|
|
37
|
+
];
|
|
38
|
+
for (const [hintField, qField] of constrainedFields) {
|
|
39
|
+
const want = scope[hintField];
|
|
40
|
+
if (want === undefined || want === '')
|
|
41
|
+
continue; // wildcard
|
|
42
|
+
const have = question[qField];
|
|
43
|
+
if (have === undefined || have === '') {
|
|
44
|
+
return { applies: false, reason: `hint requires ${hintField}=${want} but question scope is unknown` };
|
|
45
|
+
}
|
|
46
|
+
if (!eqScope(want, have)) {
|
|
47
|
+
return { applies: false, reason: `hint ${hintField}=${want} ≠ question ${String(have)}` };
|
|
48
|
+
}
|
|
49
|
+
matched.push(`${hintField}=${want}`);
|
|
50
|
+
}
|
|
51
|
+
// Dialect: constrain when both sides know it; tolerate unknown question dialect.
|
|
52
|
+
if (scope.dialect && scope.dialect !== '') {
|
|
53
|
+
if (question.dialect && question.dialect !== '') {
|
|
54
|
+
if (!eqScope(scope.dialect, question.dialect)) {
|
|
55
|
+
return { applies: false, reason: `hint dialect=${scope.dialect} ≠ question ${question.dialect}` };
|
|
56
|
+
}
|
|
57
|
+
matched.push(`dialect=${scope.dialect}`);
|
|
58
|
+
}
|
|
59
|
+
// else: dialect unknown for the question — do not block; note advisory match.
|
|
60
|
+
}
|
|
61
|
+
return {
|
|
62
|
+
applies: true,
|
|
63
|
+
reason: matched.length > 0 ? matched.join(', ') : 'project-wide hint (no scope constraints)',
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
/** Two hints conflict when their scopes overlap on the same concept. */
|
|
67
|
+
export function hintsConflict(a, b) {
|
|
68
|
+
if (a.id === b.id)
|
|
69
|
+
return false;
|
|
70
|
+
if (a.supersedes === b.id || b.supersedes === a.id)
|
|
71
|
+
return false; // explicit resolution
|
|
72
|
+
return scopesOverlap(a.scope, b.scope);
|
|
73
|
+
}
|
|
74
|
+
function scopesOverlap(a, b) {
|
|
75
|
+
const fields = ['metric', 'dbtModel', 'domain', 'dialect', 'term', 'block'];
|
|
76
|
+
let sharedConstraint = false;
|
|
77
|
+
for (const field of fields) {
|
|
78
|
+
const av = a[field];
|
|
79
|
+
const bv = b[field];
|
|
80
|
+
if (av && bv) {
|
|
81
|
+
if (!eqScope(av, bv))
|
|
82
|
+
return false; // disjoint on a declared field → no overlap
|
|
83
|
+
sharedConstraint = true;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
// Overlap only when they actually share at least one declared, equal field.
|
|
87
|
+
return sharedConstraint;
|
|
88
|
+
}
|
|
89
|
+
function eqScope(a, b) {
|
|
90
|
+
return a.trim().toLowerCase() === b.trim().toLowerCase();
|
|
91
|
+
}
|
|
92
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/hints/types.ts"],"names":[],"mappings":"AAAA;;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QACpB,MAAM,EAAE,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC;QACpB,IAAI,EAAE,IAAI,EAAE,EAAE,CAAC;YACb,IAAI,CAAC,OAAO,CAAC,EAAE,EAAE,EAAE,CAAC;gBAAE,OAAO,KAAK,CAAC,CAAC,4CAA4C;YAChF,gBAAgB,GAAG,IAAI,CAAC;QAC1B,CAAC;IACH,CAAC;IACD,4EAA4E;IAC5E,OAAO,gBAAgB,CAAC;AAC1B,CAAC;AAED,SAAS,OAAO,CAAC,CAAS,EAAE,CAAS;IACnC,OAAO,CAAC,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,KAAK,CAAC,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;AAC3D,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -11,10 +11,24 @@ import type { DQLManifest } from "@duckcodeailabs/dql-core";
|
|
|
11
11
|
export { KGStore } from "./kg/sqlite-fts.js";
|
|
12
12
|
export type { KGNode, KGEdge, KGNodeKind, KGSearchHit, KGFeedbackRow, KGSearchOptions, } from "./kg/types.js";
|
|
13
13
|
export { buildKGFromManifest, buildKGFromSemanticLayer } from "./kg/build.js";
|
|
14
|
-
export { activeSkills, buildSkillBlockHints, loadSkills, parseSkill, buildSkillsPrompt, } from "./skills/loader.js";
|
|
15
|
-
export type { Skill, SkillLoadResult } from "./skills/loader.js";
|
|
14
|
+
export { activeSkills, buildSkillBlockHints, loadSkills, parseSkill, renderSkill, buildSkillsPrompt, selectRelevantSkills, writeSkill, upsertSkill, deleteSkill, skillsDir, skillPath, } from "./skills/loader.js";
|
|
15
|
+
export type { Skill, SkillLoadResult, WriteSkillInput, SelectRelevantSkillsOptions, } from "./skills/loader.js";
|
|
16
|
+
export { seedDefaultSkills } from "./skills/defaults.js";
|
|
17
|
+
export type { SeedDefaultSkillsOptions, SeedDefaultSkillsResult, } from "./skills/defaults.js";
|
|
16
18
|
export { answer, parseProposal } from "./answer-loop.js";
|
|
17
|
-
export
|
|
19
|
+
export { decideAgentAction, looksLikeComposeApp, looksLikeFollowUp, type AgentAction, type IntentDecision, type IntentDecisionInput, type IntentSignals, } from "./intent-controller.js";
|
|
20
|
+
export { AgentRunEngine, AGENT_RUN_ESCALATION_MAP, createDeterministicAgentRunPlanner, defaultSuccessCriteria, FileAgentRunStore, InMemoryAgentRunStore, defaultAgentRunStorePath, selectRoute, } from "./agent-run-engine.js";
|
|
21
|
+
export type { FileAgentRunStoreOptions } from "./agent-run-engine.js";
|
|
22
|
+
export type { AgentRouteExecutionContext, AgentRouteExecutor, AgentRouteExecutorResult, AgentRun, AgentRunArtifact, AgentRunArtifactKind, AgentRunAudience, AgentRunEngineOptions, AgentRunEvaluation, AgentRunEvaluationSeverity, AgentRunEvent, AgentRunExecutors, AgentRunGate, AgentRunGateContext, AgentRunGates, AgentRunNextAction, AgentRunPlan, AgentRunPlanInput, AgentRunPlanner, AgentRunPlanSource, AgentRunPlannedStep, AgentRunReplanDecision, AgentRunReplanInput, AgentRunRepairAction, AgentRunRequest, AgentRunRequestedMode, AgentRunRoute, AgentRunSelectedObject, AgentRunStatus, AgentRunStep, AgentRunStepStatus, AgentRunStopReason, AgentRunStore, AgentRunTrustState, } from "./agent-run-engine.js";
|
|
23
|
+
export { defaultAgentRunGates } from "./agent-run-gates.js";
|
|
24
|
+
export { narrateResult, type NarrateInput, type NarrateItem, type NarrateResult, type NarrateResultData, type NarrateCompletion, type NarrateOptions, } from "./narrate.js";
|
|
25
|
+
export { createLlmAgentRunPlanner, type AgentRunPlannerCompletion, type LlmAgentRunPlannerOptions, } from "./agent-run-planner.js";
|
|
26
|
+
export { planApp, type AppPlan as AgentAppPlan, type AppPlanSection, type AppPlanFilter as AgentAppPlanFilter, type PlanBlock, } from "./app-planner.js";
|
|
27
|
+
export { planResearch, type ResearchPlan, type ResearchStep, type ResearchFollowUp, } from "./research-loop.js";
|
|
28
|
+
export { loadSemanticMetrics } from "./propose/build-from-prompt.js";
|
|
29
|
+
export type { AgentAnalysisPlan, AgentAnswer, AgentCitation, AgentFollowUpContext, AgentJoinPath, AgentIntent, AgentResultPayload, AgentSchemaColumn, AgentSchemaTable, AnswerKind, AnswerLoopInput, AiRoute, AiRouteTier, } from "./answer-loop.js";
|
|
30
|
+
export { matchSemanticMetric } from "./metadata/metric-match.js";
|
|
31
|
+
export type { MetricMatch, MatchSemanticMetricOptions } from "./metadata/metric-match.js";
|
|
18
32
|
export { APP_BUILDER_SKILLS, planAppFromPrompt, validateAppPlan, generateAppFromPlan, } from "./app-builder.js";
|
|
19
33
|
export type { AppBuilderSkill, AppBuilderSkillId, AppPlan, AppPlanAnalysisIntent, AppPlanFilter, AppPlanFollowUpAction, AppPlanPage, AppPlanTile, AppPlanTileKind, AppPlanTileRole, AppPlanTrustState, AppPlanValidationIssue, AppPlanValidationResult, GeneratedAppPackage, GenerateAppFromPlanOptions, PlanAppFromPromptInput, } from "./app-builder.js";
|
|
20
34
|
export { MemoryStore, defaultMemoryPath, ensureDefaultMemoryFiles, } from "./memory/sqlite-memory.js";
|
|
@@ -24,12 +38,35 @@ export { buildBlockBusinessFingerprint, buildBlockSqlFingerprints, fingerprintSq
|
|
|
24
38
|
export type { BlockBusinessFingerprint, BlockSqlFingerprints, BuildBlockBusinessFingerprintInput, } from "./metadata/block-fingerprints.js";
|
|
25
39
|
export { buildAnalysisQuestionPlan, certifiedApplicabilityForObject, scoreAllowedSqlRelationWithAnalysisPlan, scoreMetadataObjectWithAnalysisPlan, sortAllowedSqlContextForAnalysisPlan, } from "./metadata/analysis-planner.js";
|
|
26
40
|
export type { AnalysisEntityMention, AnalysisQuestionMode, AnalysisQuestionPlan, AllowedSqlRelationScore, CertifiedApplicabilityKind, CertifiedBlockApplicability, } from "./metadata/analysis-planner.js";
|
|
41
|
+
export { grainMatches, requestedGrainFromPlan, } from "./metadata/grain-gate.js";
|
|
42
|
+
export type { GrainGateKind, GrainGateResult, RequestedGrain, } from "./metadata/grain-gate.js";
|
|
27
43
|
export { validateSqlAgainstLocalContext, } from "./metadata/sql-context-validation.js";
|
|
28
|
-
export {
|
|
29
|
-
export type {
|
|
44
|
+
export { buildSchemaGrounding, buildGroundingFromRuntimeRelations, renderGroundingForPrompt, resolveRelationsInSql, validateSqlAgainstGrounding, relationKeys, } from "./metadata/sql-grounding.js";
|
|
45
|
+
export type { SchemaGrounding, GroundedTable, GroundedColumn, GroundedJoinKey, BuildSchemaGroundingOptions, RuntimeRelationInput, RelationResolution, GroundingValidationCode, GroundingValidationResult, } from "./metadata/sql-grounding.js";
|
|
46
|
+
export { selectRelevantModels } from "./metadata/sql-retrieval.js";
|
|
47
|
+
export type { SelectRelevantModelsOptions } from "./metadata/sql-retrieval.js";
|
|
48
|
+
export { deriveGeneratedDraftSlug, deriveSemanticDraftName, upsertGeneratedDraft, } from "./metadata/drafts.js";
|
|
49
|
+
export type { SemanticDraftNameInput } from "./metadata/drafts.js";
|
|
50
|
+
export { persistOwner, readPersistedOwner, resolveLocalOwner, } from "./metadata/identity.js";
|
|
51
|
+
export type { ResolveOwnerOptions } from "./metadata/identity.js";
|
|
52
|
+
export { propose, proposePlan, buildProposePreview, buildFromPrompt, loadDbtArtifacts, upsertProposedDraft, renderProposedDraft, blockSlug, resolveProposeConfig, DEFAULT_PROPOSE_CONFIG, classifyModel, resolveDomain, enrichProposal, enrichProposals, } from "./propose/index.js";
|
|
53
|
+
export type { ProposeOptions, ProposeSummary, ProposalResult, ProposalInference, ProposalRanking, ProposedPattern, ProposePlan, ProposePlanOptions, ProposePlanDomain, ProposePlanCandidate, ProposePreviewOptions, BuildFromPromptOptions, BuildFromPromptContext, BuildFromPromptResult, BuildCellResult, BuildBlockResult, BuildMode, BuildRoute, CertifierVerdict, ProposeConfig, ProposeConfigInput, Classification, ClassificationResult, ProposedDraftRecord, WrittenDraft, DbtArtifacts, DbtModelNode, DbtSourceNode, DbtColumn, EnrichFacts, EnrichedContent, EnrichOptions, ReflectableDraft, ExecutionProbe, BlockReflection, ReflectionFix, } from "./propose/index.js";
|
|
54
|
+
export { reflectAndReviseBlock } from "./propose/index.js";
|
|
55
|
+
export type { BuildLocalContextPackRequest, EnsureMetadataCatalogOptions, EnsureMetadataCatalogResult, DqlContextPack, LocalContextPack, MetadataCandidateConflict, MetadataDiagnostic, MetadataEdge, MetadataAgentIntent, MetadataAllowedSqlContext, MetadataAnswerRoute, MetadataEvidenceRole, MetadataFollowUpContext, MetadataMissingContext, MetadataObject, MetadataRouteDecision, GrainGateRouteInfo, MetadataDomainShard, MetadataSourceFingerprint, MetadataSnapshot, MetadataTrustLabel, PlanAgentAnswerResult, QueryRunSummary, RuntimeSchemaSnapshot, RuntimeSchemaTable, RuntimeSchemaColumn, } from "./metadata/catalog.js";
|
|
30
56
|
export type { SqlContextValidationCode, SqlContextValidationOptions, SqlContextValidationResult, } from "./metadata/sql-context-validation.js";
|
|
31
57
|
export type { GeneratedDraftBlock, GeneratedDraftRecord, } from "./metadata/drafts.js";
|
|
32
|
-
export {
|
|
58
|
+
export { HintStore, } from "./hints/store.js";
|
|
59
|
+
export type { SearchApprovedHintsOptions, } from "./hints/store.js";
|
|
60
|
+
export { recordCorrectionTrace, reviewHint, reindexHints, listHintsFromGit, getHintFromGit, writeHintFile, readHintFile, hintsDir, tracesDir, reviewsDir, defaultHintIndexPath, } from "./hints/git-store.js";
|
|
61
|
+
export type { RecordCorrectionTraceInput, RecordCorrectionTraceResult, ReviewHintInput, ReviewHintResult, } from "./hints/git-store.js";
|
|
62
|
+
export { retrieveScopedHints, } from "./hints/retrieval.js";
|
|
63
|
+
export type { AppliedHint, HintRetrievalResult, RetrieveScopedHintsOptions, } from "./hints/retrieval.js";
|
|
64
|
+
export { hintAppliesToScope, hintsConflict, } from "./hints/types.js";
|
|
65
|
+
export type { CorrectionTrace, Hint, HintReview, HintScope, HintStatus, QuestionScope, ScopedHintMatch, } from "./hints/types.js";
|
|
66
|
+
export { HashedTokenEmbeddingProvider, defaultEmbeddingProvider, cosineSimilarity, hybridRank, } from "./embeddings/provider.js";
|
|
67
|
+
export type { EmbeddingProvider, HybridRankItem, HybridRankOptions, HybridRanked, } from "./embeddings/provider.js";
|
|
68
|
+
export type { AppliedContextHint, } from "./metadata/catalog.js";
|
|
69
|
+
export { ClaudeProvider, OpenAIProvider, GeminiProvider, OllamaProvider, pickProvider, buildProvider, normalizeAnthropicBaseUrl, normalizeGeminiBaseUrl, } from "./providers/index.js";
|
|
33
70
|
export type { AgentProvider, AgentMessage, ProviderName, ProviderRunOptions, } from "./providers/index.js";
|
|
34
71
|
/**
|
|
35
72
|
* Default location for the agent's SQLite KG file.
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAIH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAIH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAe5D,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAC7C,YAAY,EACV,MAAM,EACN,MAAM,EACN,UAAU,EACV,WAAW,EACX,aAAa,EACb,eAAe,GAChB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,mBAAmB,EAAE,wBAAwB,EAAE,MAAM,eAAe,CAAC;AAC9E,OAAO,EACL,YAAY,EACZ,oBAAoB,EACpB,UAAU,EACV,UAAU,EACV,WAAW,EACX,iBAAiB,EACjB,oBAAoB,EACpB,UAAU,EACV,WAAW,EACX,WAAW,EACX,SAAS,EACT,SAAS,GACV,MAAM,oBAAoB,CAAC;AAC5B,YAAY,EACV,KAAK,EACL,eAAe,EACf,eAAe,EACf,2BAA2B,GAC5B,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,C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,aAAa,EACb,yBAAyB,EACzB,sBAAsB,GACvB,MAAM,sBAAsB,CAAC;AAC9B,YAAY,EACV,aAAa,EACb,YAAY,EACZ,YAAY,EACZ,kBAAkB,GACnB,MAAM,sBAAsB,CAAC;AAE9B;;;GAGG;AACH,wBAAgB,aAAa,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CAEzD;AAED,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,EAAE,WAAW,CAAC;IACvB,4EAA4E;IAC5E,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,8CAA8C;IAC9C,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED;;;;GAIG;AACH,wBAAsB,cAAc,CAClC,WAAW,EAAE,MAAM,EACnB,IAAI,GAAE,cAAmB,GACxB,OAAO,CAAC;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC,CA8C3D;AAED;;;GAGG;AACH,wBAAgB,sBAAsB,CACpC,WAAW,EAAE,MAAM,EACnB,MAAM,SAAI,GACT,KAAK,CAAC;IACP,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,GAAG,EAAE,MAAM,CAAC;CACb,CAAC,CAOD"}
|
package/dist/index.js
CHANGED
|
@@ -14,18 +14,42 @@ import { KGStore } from "./kg/sqlite-fts.js";
|
|
|
14
14
|
import { buildKGFromManifest, buildKGFromSemanticLayer } from "./kg/build.js";
|
|
15
15
|
import { loadSkills } from "./skills/loader.js";
|
|
16
16
|
import { ensureMetadataCatalogFresh } from "./metadata/catalog.js";
|
|
17
|
+
import { reindexHints } from "./hints/git-store.js";
|
|
17
18
|
export { KGStore } from "./kg/sqlite-fts.js";
|
|
18
19
|
export { buildKGFromManifest, buildKGFromSemanticLayer } from "./kg/build.js";
|
|
19
|
-
export { activeSkills, buildSkillBlockHints, loadSkills, parseSkill, buildSkillsPrompt, } from "./skills/loader.js";
|
|
20
|
+
export { activeSkills, buildSkillBlockHints, loadSkills, parseSkill, renderSkill, buildSkillsPrompt, selectRelevantSkills, writeSkill, upsertSkill, deleteSkill, skillsDir, skillPath, } from "./skills/loader.js";
|
|
21
|
+
export { seedDefaultSkills } from "./skills/defaults.js";
|
|
20
22
|
export { answer, parseProposal } from "./answer-loop.js";
|
|
23
|
+
export { decideAgentAction, looksLikeComposeApp, looksLikeFollowUp, } from "./intent-controller.js";
|
|
24
|
+
export { AgentRunEngine, AGENT_RUN_ESCALATION_MAP, createDeterministicAgentRunPlanner, defaultSuccessCriteria, FileAgentRunStore, InMemoryAgentRunStore, defaultAgentRunStorePath, selectRoute, } from "./agent-run-engine.js";
|
|
25
|
+
export { defaultAgentRunGates } from "./agent-run-gates.js";
|
|
26
|
+
export { narrateResult, } from "./narrate.js";
|
|
27
|
+
export { createLlmAgentRunPlanner, } from "./agent-run-planner.js";
|
|
28
|
+
export { planApp, } from "./app-planner.js";
|
|
29
|
+
export { planResearch, } from "./research-loop.js";
|
|
30
|
+
export { loadSemanticMetrics } from "./propose/build-from-prompt.js";
|
|
31
|
+
export { matchSemanticMetric } from "./metadata/metric-match.js";
|
|
21
32
|
export { APP_BUILDER_SKILLS, planAppFromPrompt, validateAppPlan, generateAppFromPlan, } from "./app-builder.js";
|
|
22
33
|
export { MemoryStore, defaultMemoryPath, ensureDefaultMemoryFiles, } from "./memory/sqlite-memory.js";
|
|
23
34
|
export { MetadataCatalog, buildLocalContextPack, buildMetadataSnapshot, defaultMetadataPath, ensureMetadataCatalogFresh, openMetadataCatalog, planAgentAnswer, recordRuntimeSchemaSnapshot, recordQueryRun, upsertMetadataSnapshot, } from "./metadata/catalog.js";
|
|
24
35
|
export { buildBlockBusinessFingerprint, buildBlockSqlFingerprints, fingerprintSql, normalizeBusinessFingerprintToken, normalizeSqlForFingerprint, } from "./metadata/block-fingerprints.js";
|
|
25
36
|
export { buildAnalysisQuestionPlan, certifiedApplicabilityForObject, scoreAllowedSqlRelationWithAnalysisPlan, scoreMetadataObjectWithAnalysisPlan, sortAllowedSqlContextForAnalysisPlan, } from "./metadata/analysis-planner.js";
|
|
37
|
+
export { grainMatches, requestedGrainFromPlan, } from "./metadata/grain-gate.js";
|
|
26
38
|
export { validateSqlAgainstLocalContext, } from "./metadata/sql-context-validation.js";
|
|
27
|
-
export {
|
|
28
|
-
export {
|
|
39
|
+
export { buildSchemaGrounding, buildGroundingFromRuntimeRelations, renderGroundingForPrompt, resolveRelationsInSql, validateSqlAgainstGrounding, relationKeys, } from "./metadata/sql-grounding.js";
|
|
40
|
+
export { selectRelevantModels } from "./metadata/sql-retrieval.js";
|
|
41
|
+
export { deriveGeneratedDraftSlug, deriveSemanticDraftName, upsertGeneratedDraft, } from "./metadata/drafts.js";
|
|
42
|
+
export { persistOwner, readPersistedOwner, resolveLocalOwner, } from "./metadata/identity.js";
|
|
43
|
+
export { propose, proposePlan, buildProposePreview, buildFromPrompt, loadDbtArtifacts, upsertProposedDraft, renderProposedDraft, blockSlug, resolveProposeConfig, DEFAULT_PROPOSE_CONFIG, classifyModel, resolveDomain, enrichProposal, enrichProposals, } from "./propose/index.js";
|
|
44
|
+
export { reflectAndReviseBlock } from "./propose/index.js";
|
|
45
|
+
// --- Scoped correction memory (hints) ---
|
|
46
|
+
export { HintStore, } from "./hints/store.js";
|
|
47
|
+
export { recordCorrectionTrace, reviewHint, reindexHints, listHintsFromGit, getHintFromGit, writeHintFile, readHintFile, hintsDir, tracesDir, reviewsDir, defaultHintIndexPath, } from "./hints/git-store.js";
|
|
48
|
+
export { retrieveScopedHints, } from "./hints/retrieval.js";
|
|
49
|
+
export { hintAppliesToScope, hintsConflict, } from "./hints/types.js";
|
|
50
|
+
// --- Pluggable semantic retrieval (embeddings) ---
|
|
51
|
+
export { HashedTokenEmbeddingProvider, defaultEmbeddingProvider, cosineSimilarity, hybridRank, } from "./embeddings/provider.js";
|
|
52
|
+
export { ClaudeProvider, OpenAIProvider, GeminiProvider, OllamaProvider, pickProvider, buildProvider, normalizeAnthropicBaseUrl, normalizeGeminiBaseUrl, } from "./providers/index.js";
|
|
29
53
|
/**
|
|
30
54
|
* Default location for the agent's SQLite KG file.
|
|
31
55
|
* Mirrors the manifest cache layout under `.dql/cache/`.
|
|
@@ -74,6 +98,14 @@ export async function reindexProject(projectRoot, opts = {}) {
|
|
|
74
98
|
semanticLayer,
|
|
75
99
|
force: true,
|
|
76
100
|
});
|
|
101
|
+
// Rebuild the approved-hint index (Git authoritative; SQLite is a view). Safe
|
|
102
|
+
// when no hints exist — yields an empty index.
|
|
103
|
+
try {
|
|
104
|
+
reindexHints(projectRoot, opts.kgPath ?? defaultKgPath(projectRoot));
|
|
105
|
+
}
|
|
106
|
+
catch {
|
|
107
|
+
// Hint indexing is advisory; never fail a reindex over it.
|
|
108
|
+
}
|
|
77
109
|
return { nodes: nodes.length, edges: edges.length, skills: skills.length };
|
|
78
110
|
}
|
|
79
111
|
/**
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAEnD,OAAO,EACL,aAAa,EACb,iBAAiB,EACjB,sBAAsB,EACtB,mCAAmC,GACpC,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAC7C,OAAO,EAAE,mBAAmB,EAAE,wBAAwB,EAAE,MAAM,eAAe,CAAC;AAC9E,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAGhD,OAAO,EAAE,0BAA0B,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQ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AC,CAAC,MAAM,IAAI,CAAC,CAAC,MAAM;KAC7B,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Intent controller (P0) — the deciding front door of the agent.
|
|
3
|
+
*
|
|
4
|
+
* Instead of "always generate SQL", the controller looks at each turn and DECIDES
|
|
5
|
+
* what it deserves: answer it now, ask one sharp clarifying question, run a
|
|
6
|
+
* multi-step investigation, or compose an app/dashboard. It maps the existing
|
|
7
|
+
* fine-grained `MetadataAgentIntent` taxonomy + retrieval signals into a small set
|
|
8
|
+
* of high-level ACTIONS the rest of the system routes on, and it carries a
|
|
9
|
+
* human-facing rationale (show-your-work) and follow-up awareness so a turn like
|
|
10
|
+
* "why?" or "break that down" is understood in context rather than re-generated
|
|
11
|
+
* from scratch.
|
|
12
|
+
*
|
|
13
|
+
* Deterministic + offline by design: heuristics over the question, the classified
|
|
14
|
+
* intent, and match scores — no extra model call. A caller may refine with an LLM,
|
|
15
|
+
* but the default is fast, testable, and reliable.
|
|
16
|
+
*/
|
|
17
|
+
import type { MetadataAgentIntent } from './metadata/catalog.js';
|
|
18
|
+
/** The high-level action the agent will take for a turn. */
|
|
19
|
+
export type AgentAction = 'answer' | 'clarify' | 'investigate' | 'compose_app';
|
|
20
|
+
export interface IntentSignals {
|
|
21
|
+
/** Best certified-artifact match score (0..1), if any. */
|
|
22
|
+
certifiedScore?: number;
|
|
23
|
+
/** Best governed-metric match score (0..1), if any. */
|
|
24
|
+
metricScore?: number;
|
|
25
|
+
/** Whether KG retrieval surfaced relevant governed context at all. */
|
|
26
|
+
hasRetrieval?: boolean;
|
|
27
|
+
/** Missing-context messages from the catalog route (drives clarify). */
|
|
28
|
+
missingContext?: string[];
|
|
29
|
+
}
|
|
30
|
+
export interface IntentDecisionInput {
|
|
31
|
+
question: string;
|
|
32
|
+
/** The fine-grained intent already classified upstream. */
|
|
33
|
+
intent: MetadataAgentIntent;
|
|
34
|
+
signals?: IntentSignals;
|
|
35
|
+
/** True when this turn is a follow-up (e.g. a drilldown carrier was present). */
|
|
36
|
+
isFollowUp?: boolean;
|
|
37
|
+
/** Recent turns (most recent last) — used to resolve deictic follow-ups. */
|
|
38
|
+
history?: Array<{
|
|
39
|
+
role: 'user' | 'assistant';
|
|
40
|
+
text: string;
|
|
41
|
+
}>;
|
|
42
|
+
}
|
|
43
|
+
export interface IntentDecision {
|
|
44
|
+
action: AgentAction;
|
|
45
|
+
/** Confidence in the action choice, 0..1. */
|
|
46
|
+
confidence: number;
|
|
47
|
+
/** One-sentence, business-facing rationale for the choice. */
|
|
48
|
+
reason: string;
|
|
49
|
+
/** Present when action is clarify: the single question to ask. */
|
|
50
|
+
clarifyingQuestion?: string;
|
|
51
|
+
/** True when the turn references prior context ("it", "that", "why", "more"). */
|
|
52
|
+
followsUp: boolean;
|
|
53
|
+
}
|
|
54
|
+
/** Heuristic: does the question explicitly ask to build a dashboard/app? */
|
|
55
|
+
export declare function looksLikeComposeApp(question: string): boolean;
|
|
56
|
+
/** Heuristic: is this turn a follow-up that depends on prior context? */
|
|
57
|
+
export declare function looksLikeFollowUp(question: string, hasHistory: boolean): boolean;
|
|
58
|
+
/**
|
|
59
|
+
* Decide the high-level action for a turn. Deterministic; returns the action plus
|
|
60
|
+
* a rationale and (for clarify) a single sharp question.
|
|
61
|
+
*/
|
|
62
|
+
export declare function decideAgentAction(input: IntentDecisionInput): IntentDecision;
|
|
63
|
+
//# sourceMappingURL=intent-controller.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"intent-controller.d.ts","sourceRoot":"","sources":["../src/intent-controller.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAEjE,4DAA4D;AAC5D,MAAM,MAAM,WAAW,GAAG,QAAQ,GAAG,SAAS,GAAG,aAAa,GAAG,aAAa,CAAC;AAE/E,MAAM,WAAW,aAAa;IAC5B,0DAA0D;IAC1D,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,uDAAuD;IACvD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,sEAAsE;IACtE,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,wEAAwE;IACxE,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;CAC3B;AAED,MAAM,WAAW,mBAAmB;IAClC,QAAQ,EAAE,MAAM,CAAC;IACjB,2DAA2D;IAC3D,MAAM,EAAE,mBAAmB,CAAC;IAC5B,OAAO,CAAC,EAAE,aAAa,CAAC;IACxB,iFAAiF;IACjF,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,4EAA4E;IAC5E,OAAO,CAAC,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,GAAG,WAAW,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CAC/D;AAED,MAAM,WAAW,cAAc;IAC7B,MAAM,EAAE,WAAW,CAAC;IACpB,6CAA6C;IAC7C,UAAU,EAAE,MAAM,CAAC;IACnB,8DAA8D;IAC9D,MAAM,EAAE,MAAM,CAAC;IACf,kEAAkE;IAClE,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,iFAAiF;IACjF,SAAS,EAAE,OAAO,CAAC;CACpB;AA0CD,4EAA4E;AAC5E,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAE7D;AAED,yEAAyE;AACzE,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,GAAG,OAAO,CAMhF;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,mBAAmB,GAAG,cAAc,CAmF5E"}
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Intent controller (P0) — the deciding front door of the agent.
|
|
3
|
+
*
|
|
4
|
+
* Instead of "always generate SQL", the controller looks at each turn and DECIDES
|
|
5
|
+
* what it deserves: answer it now, ask one sharp clarifying question, run a
|
|
6
|
+
* multi-step investigation, or compose an app/dashboard. It maps the existing
|
|
7
|
+
* fine-grained `MetadataAgentIntent` taxonomy + retrieval signals into a small set
|
|
8
|
+
* of high-level ACTIONS the rest of the system routes on, and it carries a
|
|
9
|
+
* human-facing rationale (show-your-work) and follow-up awareness so a turn like
|
|
10
|
+
* "why?" or "break that down" is understood in context rather than re-generated
|
|
11
|
+
* from scratch.
|
|
12
|
+
*
|
|
13
|
+
* Deterministic + offline by design: heuristics over the question, the classified
|
|
14
|
+
* intent, and match scores — no extra model call. A caller may refine with an LLM,
|
|
15
|
+
* but the default is fast, testable, and reliable.
|
|
16
|
+
*/
|
|
17
|
+
/** A confident match means a certified block or governed metric clearly fits. */
|
|
18
|
+
const STRONG_MATCH = 0.5;
|
|
19
|
+
/** Build-an-app phrasing: an explicit verb on a dashboard/app noun. */
|
|
20
|
+
const COMPOSE_APP_RE = /\b(build|create|make|set ?up|put ?together|assemble|design|generate|spin ?up|give me)\b[^.?!]*\b(dashboard|dashboards|app|apps|cockpit|scorecard|overview|workspace|monitor|report)\b/i;
|
|
21
|
+
/** "Monitor / keep an eye on X over time" also implies a standing surface. */
|
|
22
|
+
const MONITOR_RE = /\b(monitor|keep an eye on|track .* over time|standing (view|report)|watch over time)\b/i;
|
|
23
|
+
/**
|
|
24
|
+
* EXPLICIT investigation phrasing — a "why / root cause / what happened" question
|
|
25
|
+
* is an investigation even when a governed metric matches, so this beats a direct
|
|
26
|
+
* answer. Returning just the number would miss the point of the ask.
|
|
27
|
+
*/
|
|
28
|
+
const STRONG_INVESTIGATE_RE = /\b(why|what'?s driving|what is driving|root ?cause|diagnose|deep ?dive|investigate|what (happened|caused|changed)|drivers? of|contributed to|explain the|analy[sz]e|anomal)\b/i;
|
|
29
|
+
/** SOFT analytical phrasing — only investigate when no confident direct answer fits. */
|
|
30
|
+
const SOFT_INVESTIGATE_RE = /\b(break ?down|breakdown|compare|vs\.?|versus|trend over|over time|by (region|segment|month|day|week|category|product|location|type))\b/i;
|
|
31
|
+
/** Deictic / continuation phrasing that only makes sense against a prior turn. */
|
|
32
|
+
const FOLLOW_UP_RE = /^\s*(why|how come|and|but|what about|how about|ok|okay|so|then|more|show more|drill|dig|expand|same|that one|those|these|it|this)\b|\b(again|instead|by (region|segment|month|day|category|product|location))\b/i;
|
|
33
|
+
/** Truly diagnostic intents — investigate even when a metric matches. */
|
|
34
|
+
const DIAGNOSTIC_INTENTS = new Set([
|
|
35
|
+
'diagnose_change',
|
|
36
|
+
'anomaly_investigation',
|
|
37
|
+
]);
|
|
38
|
+
/** Softer analytical intents — investigate only when no confident answer fits. */
|
|
39
|
+
const SOFT_INVESTIGATIVE_INTENTS = new Set([
|
|
40
|
+
'driver_breakdown',
|
|
41
|
+
'segment_compare',
|
|
42
|
+
'entity_drilldown',
|
|
43
|
+
]);
|
|
44
|
+
const DIRECT_ANSWER_INTENTS = new Set([
|
|
45
|
+
'exact_certified_lookup',
|
|
46
|
+
'definition_lookup',
|
|
47
|
+
'ad_hoc_ranking',
|
|
48
|
+
]);
|
|
49
|
+
/** Heuristic: does the question explicitly ask to build a dashboard/app? */
|
|
50
|
+
export function looksLikeComposeApp(question) {
|
|
51
|
+
return COMPOSE_APP_RE.test(question) || MONITOR_RE.test(question);
|
|
52
|
+
}
|
|
53
|
+
/** Heuristic: is this turn a follow-up that depends on prior context? */
|
|
54
|
+
export function looksLikeFollowUp(question, hasHistory) {
|
|
55
|
+
if (!hasHistory)
|
|
56
|
+
return false;
|
|
57
|
+
const trimmed = question.trim();
|
|
58
|
+
// Short + deictic, or starts with a continuation word.
|
|
59
|
+
if (FOLLOW_UP_RE.test(trimmed))
|
|
60
|
+
return true;
|
|
61
|
+
return trimmed.split(/\s+/).length <= 4 && /\b(it|that|this|those|these|them)\b/i.test(trimmed);
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Decide the high-level action for a turn. Deterministic; returns the action plus
|
|
65
|
+
* a rationale and (for clarify) a single sharp question.
|
|
66
|
+
*/
|
|
67
|
+
export function decideAgentAction(input) {
|
|
68
|
+
const { question, intent } = input;
|
|
69
|
+
const signals = input.signals ?? {};
|
|
70
|
+
const certified = signals.certifiedScore ?? 0;
|
|
71
|
+
const metric = signals.metricScore ?? 0;
|
|
72
|
+
const bestMatch = Math.max(certified, metric);
|
|
73
|
+
const hasMissing = (signals.missingContext?.length ?? 0) > 0;
|
|
74
|
+
const followsUp = input.isFollowUp ?? looksLikeFollowUp(question, (input.history?.length ?? 0) > 0);
|
|
75
|
+
// 1) Explicit "build me a dashboard/app" → compose an app, regardless of match.
|
|
76
|
+
if (looksLikeComposeApp(question)) {
|
|
77
|
+
return {
|
|
78
|
+
action: 'compose_app',
|
|
79
|
+
confidence: 0.8,
|
|
80
|
+
reason: 'This asks to assemble a standing view, so I will compose an app from the relevant certified blocks rather than answer a single question.',
|
|
81
|
+
followsUp,
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
// 2) EXPLICIT investigation ("why / root cause / what happened") wins even over a
|
|
85
|
+
// metric match — returning a single number would miss the point of the ask.
|
|
86
|
+
if (STRONG_INVESTIGATE_RE.test(question) || DIAGNOSTIC_INTENTS.has(intent)) {
|
|
87
|
+
return {
|
|
88
|
+
action: 'investigate',
|
|
89
|
+
confidence: 0.75,
|
|
90
|
+
reason: 'This is an open-ended analytical question, so I will investigate it across the governed metrics and lineage rather than return one number.',
|
|
91
|
+
followsUp,
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
// 3) A confident certified block or governed metric fits → answer it directly,
|
|
95
|
+
// even if the phrasing looks lightly analytical (don't over-investigate a lookup).
|
|
96
|
+
if (bestMatch >= STRONG_MATCH && !hasMissing && intent !== 'clarify') {
|
|
97
|
+
const via = certified >= metric ? 'a certified block' : 'a governed metric';
|
|
98
|
+
return {
|
|
99
|
+
action: 'answer',
|
|
100
|
+
confidence: Math.min(0.95, 0.5 + bestMatch / 2),
|
|
101
|
+
reason: `${via} answers this directly, so I will answer from the governed layer.`,
|
|
102
|
+
followsUp,
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
// 4) Softer analytical phrasing/intent (breakdown / compare / trend) with no
|
|
106
|
+
// confident direct answer → investigate.
|
|
107
|
+
if (SOFT_INVESTIGATE_RE.test(question) || SOFT_INVESTIGATIVE_INTENTS.has(intent)) {
|
|
108
|
+
return {
|
|
109
|
+
action: 'investigate',
|
|
110
|
+
confidence: 0.65,
|
|
111
|
+
reason: 'This asks for a breakdown or comparison without a single governed answer, so I will investigate it.',
|
|
112
|
+
followsUp,
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
// 4) Missing context or an explicit clarify intent → ask ONE sharp question.
|
|
116
|
+
if (hasMissing || intent === 'clarify' || intent === 'trust_gap_review') {
|
|
117
|
+
return {
|
|
118
|
+
action: 'clarify',
|
|
119
|
+
confidence: 0.6,
|
|
120
|
+
reason: 'The request is missing a business object, measure, or grain I need before answering safely.',
|
|
121
|
+
clarifyingQuestion: buildClarifyingQuestion(question, signals),
|
|
122
|
+
followsUp,
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
// 5) Direct-answer intent with some retrieval → answer (generate grounded SQL).
|
|
126
|
+
if (DIRECT_ANSWER_INTENTS.has(intent) && (signals.hasRetrieval ?? false)) {
|
|
127
|
+
return {
|
|
128
|
+
action: 'answer',
|
|
129
|
+
confidence: 0.55,
|
|
130
|
+
reason: 'A specific, answerable question with governed context available — I will answer it.',
|
|
131
|
+
followsUp,
|
|
132
|
+
};
|
|
133
|
+
}
|
|
134
|
+
// 6) Default: nothing governed matched and it is not clearly analytical → clarify
|
|
135
|
+
// honestly rather than guess.
|
|
136
|
+
return {
|
|
137
|
+
action: 'clarify',
|
|
138
|
+
confidence: 0.5,
|
|
139
|
+
reason: 'I could not match this to a certified block, governed metric, or clear analysis, so I will ask for the missing detail.',
|
|
140
|
+
clarifyingQuestion: buildClarifyingQuestion(question, signals),
|
|
141
|
+
followsUp,
|
|
142
|
+
};
|
|
143
|
+
}
|
|
144
|
+
function buildClarifyingQuestion(question, signals) {
|
|
145
|
+
const missing = signals.missingContext?.[0];
|
|
146
|
+
if (missing)
|
|
147
|
+
return missing;
|
|
148
|
+
return `For "${question.trim().slice(0, 80)}", which business object and measure should I use, and at what grain (e.g. by day, by customer)?`;
|
|
149
|
+
}
|
|
150
|
+
//# sourceMappingURL=intent-controller.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"intent-controller.js","sourceRoot":"","sources":["../src/intent-controller.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAyCH,iFAAiF;AACjF,MAAM,YAAY,GAAG,GAAG,CAAC;AAEzB,uEAAuE;AACvE,MAAM,cAAc,GAClB,wLAAwL,CAAC;AAC3L,8EAA8E;AAC9E,MAAM,UAAU,GAAG,yFAAyF,CAAC;AAC7G;;;;GAIG;AACH,MAAM,qBAAqB,GACzB,gLAAgL,CAAC;AACnL,wFAAwF;AACxF,MAAM,mBAAmB,GACvB,0IAA0I,CAAC;AAC7I,kFAAkF;AAClF,MAAM,YAAY,GAChB,kNAAkN,CAAC;AAErN,yEAAyE;AACzE,MAAM,kBAAkB,GAAG,IAAI,GAAG,CAAsB;IACtD,iBAAiB;IACjB,uBAAuB;CACxB,CAAC,CAAC;AACH,kFAAkF;AAClF,MAAM,0BAA0B,GAAG,IAAI,GAAG,CAAsB;IAC9D,kBAAkB;IAClB,iBAAiB;IACjB,kBAAkB;CACnB,CAAC,CAAC;AAEH,MAAM,qBAAqB,GAAG,IAAI,GAAG,CAAsB;IACzD,wBAAwB;IACxB,mBAAmB;IACnB,gBAAgB;CACjB,CAAC,CAAC;AAEH,4EAA4E;AAC5E,MAAM,UAAU,mBAAmB,CAAC,QAAgB;IAClD,OAAO,cAAc,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,UAAU,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;AACpE,CAAC;AAED,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C,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,YAAY,IAAI,KAAK,CAAC,EAAE,CAAC;QACzE,OAAO;YACL,MAAM,EAAE,QAAQ;YAChB,UAAU,EAAE,IAAI;YAChB,MAAM,EAAE,qFAAqF;YAC7F,SAAS;SACV,CAAC;IACJ,CAAC;IAED,kFAAkF;IAClF,iCAAiC;IACjC,OAAO;QACL,MAAM,EAAE,SAAS;QACjB,UAAU,EAAE,GAAG;QACf,MAAM,EAAE,wHAAwH;QAChI,kBAAkB,EAAE,uBAAuB,CAAC,QAAQ,EAAE,OAAO,CAAC;QAC9D,SAAS;KACV,CAAC;AACJ,CAAC;AAED,SAAS,uBAAuB,CAAC,QAAgB,EAAE,OAAsB;IACvE,MAAM,OAAO,GAAG,OAAO,CAAC,cAAc,EAAE,CAAC,CAAC,CAAC,CAAC;IAC5C,IAAI,OAAO;QAAE,OAAO,OAAO,CAAC;IAC5B,OAAO,QAAQ,QAAQ,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,kGAAkG,CAAC;AAChJ,CAAC"}
|
package/dist/kg/build.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../../src/kg/build.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EACV,WAAW,EAIX,aAAa,EACd,MAAM,0BAA0B,CAAC;AAClC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,EAA+B,MAAM,YAAY,CAAC;AAG9E,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,WAAW,GAAG;IAC1D,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,KAAK,EAAE,MAAM,EAAE,CAAC;CACjB,
|
|
1
|
+
{"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../../src/kg/build.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EACV,WAAW,EAIX,aAAa,EACd,MAAM,0BAA0B,CAAC;AAClC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,EAA+B,MAAM,YAAY,CAAC;AAG9E,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,WAAW,GAAG;IAC1D,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,KAAK,EAAE,MAAM,EAAE,CAAC;CACjB,CA2TA;AAmCD,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,aAAa,GAAG,SAAS,GAAG;IAC1E,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,KAAK,EAAE,MAAM,EAAE,CAAC;CACjB,CA+KA"}
|
package/dist/kg/build.js
CHANGED
|
@@ -81,6 +81,8 @@ export function buildKGFromManifest(manifest) {
|
|
|
81
81
|
datalexContract: block.datalexContract,
|
|
82
82
|
businessRules: block.businessRules ?? block.invariants,
|
|
83
83
|
caveats: block.caveats,
|
|
84
|
+
dataState: block.dataState,
|
|
85
|
+
dataStateDetail: block.dataStateDetail,
|
|
84
86
|
sourcePath: block.filePath,
|
|
85
87
|
sourceTier: 'certified_artifact',
|
|
86
88
|
certification: block.status === 'certified' ? 'certified' : 'analyst_review_required',
|