@duckcodeailabs/dql-agent 1.6.31 → 1.6.33
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 +42 -6
- package/dist/agent-run-engine.d.ts.map +1 -1
- package/dist/agent-run-engine.js +133 -79
- package/dist/agent-run-engine.js.map +1 -1
- package/dist/agent-run-gates.d.ts.map +1 -1
- package/dist/agent-run-gates.js +72 -5
- package/dist/agent-run-gates.js.map +1 -1
- package/dist/agent-run-planner.d.ts.map +1 -1
- package/dist/agent-run-planner.js +13 -0
- package/dist/agent-run-planner.js.map +1 -1
- package/dist/answer-loop.d.ts +110 -8
- package/dist/answer-loop.d.ts.map +1 -1
- package/dist/answer-loop.js +1679 -1299
- package/dist/answer-loop.js.map +1 -1
- package/dist/answer-shape.d.ts +16 -0
- package/dist/answer-shape.d.ts.map +1 -0
- package/dist/answer-shape.js +85 -0
- package/dist/answer-shape.js.map +1 -0
- package/dist/cascade/budgets.d.ts +101 -0
- package/dist/cascade/budgets.d.ts.map +1 -0
- package/dist/cascade/budgets.js +184 -0
- package/dist/cascade/budgets.js.map +1 -0
- package/dist/cascade/cascade.d.ts +86 -0
- package/dist/cascade/cascade.d.ts.map +1 -0
- package/dist/cascade/cascade.js +115 -0
- package/dist/cascade/cascade.js.map +1 -0
- package/dist/cascade/route-policy.d.ts +14 -0
- package/dist/cascade/route-policy.d.ts.map +1 -0
- package/dist/cascade/route-policy.js +48 -0
- package/dist/cascade/route-policy.js.map +1 -0
- package/dist/cascade/triage.d.ts +20 -0
- package/dist/cascade/triage.d.ts.map +1 -0
- package/dist/cascade/triage.js +25 -0
- package/dist/cascade/triage.js.map +1 -0
- package/dist/conversation/rolling-summary.d.ts +13 -0
- package/dist/conversation/rolling-summary.d.ts.map +1 -0
- package/dist/conversation/rolling-summary.js +43 -0
- package/dist/conversation/rolling-summary.js.map +1 -0
- package/dist/conversation/session-store.d.ts +110 -0
- package/dist/conversation/session-store.d.ts.map +1 -0
- package/dist/conversation/session-store.js +387 -0
- package/dist/conversation/session-store.js.map +1 -0
- package/dist/conversation/snapshot.d.ts +59 -0
- package/dist/conversation/snapshot.d.ts.map +1 -0
- package/dist/conversation/snapshot.js +153 -0
- package/dist/conversation/snapshot.js.map +1 -0
- package/dist/conversation/working-state.d.ts +49 -0
- package/dist/conversation/working-state.d.ts.map +1 -0
- package/dist/conversation/working-state.js +249 -0
- package/dist/conversation/working-state.js.map +1 -0
- package/dist/embeddings/provider.d.ts +62 -0
- package/dist/embeddings/provider.d.ts.map +1 -1
- package/dist/embeddings/provider.js +98 -0
- package/dist/embeddings/provider.js.map +1 -1
- package/dist/grounding/context-ledger.d.ts +30 -0
- package/dist/grounding/context-ledger.d.ts.map +1 -0
- package/dist/grounding/context-ledger.js +54 -0
- package/dist/grounding/context-ledger.js.map +1 -0
- package/dist/grounding/regrounding.d.ts +24 -0
- package/dist/grounding/regrounding.d.ts.map +1 -0
- package/dist/grounding/regrounding.js +219 -0
- package/dist/grounding/regrounding.js.map +1 -0
- package/dist/grounding/value-index.d.ts +32 -0
- package/dist/grounding/value-index.d.ts.map +1 -0
- package/dist/grounding/value-index.js +67 -0
- package/dist/grounding/value-index.js.map +1 -0
- package/dist/index.d.ts +45 -14
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +102 -11
- package/dist/index.js.map +1 -1
- package/dist/intent-controller.d.ts +7 -0
- package/dist/intent-controller.d.ts.map +1 -1
- package/dist/intent-controller.js +22 -1
- package/dist/intent-controller.js.map +1 -1
- package/dist/kg/build.d.ts.map +1 -1
- package/dist/kg/build.js +44 -17
- package/dist/kg/build.js.map +1 -1
- package/dist/kg/sqlite-fts.d.ts +3 -1
- package/dist/kg/sqlite-fts.d.ts.map +1 -1
- package/dist/kg/sqlite-fts.js +16 -2
- package/dist/kg/sqlite-fts.js.map +1 -1
- package/dist/kg/types.d.ts +23 -1
- package/dist/kg/types.d.ts.map +1 -1
- package/dist/memory/fts-query.d.ts +7 -0
- package/dist/memory/fts-query.d.ts.map +1 -0
- package/dist/memory/fts-query.js +36 -0
- package/dist/memory/fts-query.js.map +1 -0
- package/dist/memory/sqlite-memory.d.ts.map +1 -1
- package/dist/memory/sqlite-memory.js +1 -30
- package/dist/memory/sqlite-memory.js.map +1 -1
- package/dist/metadata/analysis-planner.d.ts +23 -0
- package/dist/metadata/analysis-planner.d.ts.map +1 -1
- package/dist/metadata/analysis-planner.js +432 -2
- package/dist/metadata/analysis-planner.js.map +1 -1
- package/dist/metadata/block-fit.d.ts +24 -0
- package/dist/metadata/block-fit.d.ts.map +1 -0
- package/dist/metadata/block-fit.js +373 -0
- package/dist/metadata/block-fit.js.map +1 -0
- package/dist/metadata/catalog.d.ts +72 -3
- package/dist/metadata/catalog.d.ts.map +1 -1
- package/dist/metadata/catalog.js +1452 -72
- package/dist/metadata/catalog.js.map +1 -1
- package/dist/metadata/drafts.d.ts +25 -0
- package/dist/metadata/drafts.d.ts.map +1 -1
- package/dist/metadata/drafts.js +112 -2
- package/dist/metadata/drafts.js.map +1 -1
- package/dist/metadata/metric-match.d.ts +55 -6
- package/dist/metadata/metric-match.d.ts.map +1 -1
- package/dist/metadata/metric-match.js +158 -13
- package/dist/metadata/metric-match.js.map +1 -1
- package/dist/metadata/sql-context-validation.d.ts +13 -1
- package/dist/metadata/sql-context-validation.d.ts.map +1 -1
- package/dist/metadata/sql-context-validation.js +172 -19
- package/dist/metadata/sql-context-validation.js.map +1 -1
- package/dist/metadata/sql-retrieval.d.ts +3 -2
- package/dist/metadata/sql-retrieval.d.ts.map +1 -1
- package/dist/metadata/sql-retrieval.js +6 -4
- package/dist/metadata/sql-retrieval.js.map +1 -1
- package/dist/providers/claude.d.ts +2 -1
- package/dist/providers/claude.d.ts.map +1 -1
- package/dist/providers/claude.js +95 -0
- package/dist/providers/claude.js.map +1 -1
- package/dist/providers/index.d.ts +1 -1
- package/dist/providers/index.d.ts.map +1 -1
- package/dist/providers/index.js.map +1 -1
- package/dist/providers/openai.d.ts +2 -1
- package/dist/providers/openai.d.ts.map +1 -1
- package/dist/providers/openai.js +143 -0
- package/dist/providers/openai.js.map +1 -1
- package/dist/providers/tool-output.d.ts +2 -0
- package/dist/providers/tool-output.d.ts.map +1 -0
- package/dist/providers/tool-output.js +22 -0
- package/dist/providers/tool-output.js.map +1 -0
- package/dist/providers/types.d.ts +23 -0
- package/dist/providers/types.d.ts.map +1 -1
- package/dist/providers/types.js.map +1 -1
- package/dist/semantic-bridge/compose.d.ts +89 -0
- package/dist/semantic-bridge/compose.d.ts.map +1 -0
- package/dist/semantic-bridge/compose.js +528 -0
- package/dist/semantic-bridge/compose.js.map +1 -0
- package/dist/semantic-bridge/member-select.d.ts +23 -0
- package/dist/semantic-bridge/member-select.d.ts.map +1 -0
- package/dist/semantic-bridge/member-select.js +106 -0
- package/dist/semantic-bridge/member-select.js.map +1 -0
- package/dist/skills/defaults.d.ts.map +1 -1
- package/dist/skills/defaults.js +5 -0
- package/dist/skills/defaults.js.map +1 -1
- package/dist/synthesize.d.ts +26 -0
- package/dist/synthesize.d.ts.map +1 -1
- package/dist/synthesize.js +72 -3
- package/dist/synthesize.js.map +1 -1
- package/dist/tools/registry.d.ts +15 -0
- package/dist/tools/registry.d.ts.map +1 -0
- package/dist/tools/registry.js +692 -0
- package/dist/tools/registry.js.map +1 -0
- package/dist/trust/stamp.d.ts +26 -0
- package/dist/trust/stamp.d.ts.map +1 -0
- package/dist/trust/stamp.js +33 -0
- package/dist/trust/stamp.js.map +1 -0
- package/package.json +4 -4
|
@@ -0,0 +1,692 @@
|
|
|
1
|
+
const BLOCK_STATUS_ENUM = ['draft', 'review', 'certified', 'deprecated', 'pending_recertification'];
|
|
2
|
+
const KG_KIND_ENUM = [
|
|
3
|
+
'block',
|
|
4
|
+
'term',
|
|
5
|
+
'business_view',
|
|
6
|
+
'metric',
|
|
7
|
+
'dimension',
|
|
8
|
+
'measure',
|
|
9
|
+
'entity',
|
|
10
|
+
'semantic_model',
|
|
11
|
+
'saved_query',
|
|
12
|
+
'domain',
|
|
13
|
+
'dbt_model',
|
|
14
|
+
'dbt_source',
|
|
15
|
+
'notebook',
|
|
16
|
+
'dashboard',
|
|
17
|
+
'app',
|
|
18
|
+
'skill',
|
|
19
|
+
];
|
|
20
|
+
const RESEARCH_INTENT_ENUM = [
|
|
21
|
+
'diagnose_change',
|
|
22
|
+
'driver_breakdown',
|
|
23
|
+
'segment_compare',
|
|
24
|
+
'entity_drilldown',
|
|
25
|
+
'anomaly_investigation',
|
|
26
|
+
'trust_gap_review',
|
|
27
|
+
];
|
|
28
|
+
const HINT_STATUS_ENUM = ['candidate', 'approved', 'rejected'];
|
|
29
|
+
const DOMAIN_FILTER_SCHEMA = {
|
|
30
|
+
type: 'object',
|
|
31
|
+
additionalProperties: false,
|
|
32
|
+
properties: {
|
|
33
|
+
domain: { type: 'string', description: 'Filter to a single domain.' },
|
|
34
|
+
},
|
|
35
|
+
};
|
|
36
|
+
const HINT_SCOPE_SCHEMA = {
|
|
37
|
+
type: 'object',
|
|
38
|
+
additionalProperties: false,
|
|
39
|
+
properties: {
|
|
40
|
+
metric: { type: 'string', description: 'Metric or KPI the hint is about.' },
|
|
41
|
+
dbtModel: { type: 'string', description: 'dbt model the hint is about.' },
|
|
42
|
+
domain: { type: 'string', description: 'Business domain the hint applies within.' },
|
|
43
|
+
dialect: { type: 'string', description: 'Warehouse SQL dialect the hint applies within.' },
|
|
44
|
+
term: { type: 'string', description: 'Business term the hint refines.' },
|
|
45
|
+
block: { type: 'string', description: 'Certified block the hint relates to.' },
|
|
46
|
+
},
|
|
47
|
+
};
|
|
48
|
+
const PRIOR_RESULT_REFERENCE_SCHEMA = {
|
|
49
|
+
type: 'object',
|
|
50
|
+
additionalProperties: false,
|
|
51
|
+
required: ['id', 'columns'],
|
|
52
|
+
properties: {
|
|
53
|
+
id: { type: 'string', description: 'Stable id of the prior result set or conversation turn.' },
|
|
54
|
+
question: { type: 'string', description: 'Prior user question that produced the referenced result.' },
|
|
55
|
+
columns: {
|
|
56
|
+
type: 'array',
|
|
57
|
+
items: { type: 'string' },
|
|
58
|
+
description: 'Column names present in the prior result.',
|
|
59
|
+
},
|
|
60
|
+
rowCount: { type: 'number', description: 'Number of rows in the prior result, when known.' },
|
|
61
|
+
sourceSql: { type: 'string', description: 'SQL that produced the prior result, when available. Used only for grounding.' },
|
|
62
|
+
},
|
|
63
|
+
};
|
|
64
|
+
const DQL_ARTIFACT_REFERENCE_SCHEMA = {
|
|
65
|
+
type: 'object',
|
|
66
|
+
additionalProperties: false,
|
|
67
|
+
required: ['kind', 'source'],
|
|
68
|
+
properties: {
|
|
69
|
+
kind: { type: 'string', enum: ['certified_block', 'semantic_block', 'sql_block'] },
|
|
70
|
+
source: { type: 'string', description: 'DQL artifact source text used for the prior result.' },
|
|
71
|
+
name: { type: 'string' },
|
|
72
|
+
sourcePath: { type: 'string' },
|
|
73
|
+
metrics: { type: 'array', items: { type: 'string' } },
|
|
74
|
+
dimensions: { type: 'array', items: { type: 'string' } },
|
|
75
|
+
filters: {
|
|
76
|
+
type: 'array',
|
|
77
|
+
items: {
|
|
78
|
+
type: 'object',
|
|
79
|
+
additionalProperties: false,
|
|
80
|
+
required: ['dimension', 'operator', 'values'],
|
|
81
|
+
properties: {
|
|
82
|
+
dimension: { type: 'string' },
|
|
83
|
+
operator: { type: 'string' },
|
|
84
|
+
values: { type: 'array', items: { type: 'string' } },
|
|
85
|
+
},
|
|
86
|
+
},
|
|
87
|
+
},
|
|
88
|
+
timeDimension: {
|
|
89
|
+
type: 'object',
|
|
90
|
+
additionalProperties: false,
|
|
91
|
+
required: ['name', 'granularity'],
|
|
92
|
+
properties: {
|
|
93
|
+
name: { type: 'string' },
|
|
94
|
+
granularity: { type: 'string' },
|
|
95
|
+
},
|
|
96
|
+
},
|
|
97
|
+
orderBy: {
|
|
98
|
+
type: 'array',
|
|
99
|
+
items: {
|
|
100
|
+
type: 'object',
|
|
101
|
+
additionalProperties: false,
|
|
102
|
+
required: ['name', 'direction'],
|
|
103
|
+
properties: {
|
|
104
|
+
name: { type: 'string' },
|
|
105
|
+
direction: { type: 'string', enum: ['asc', 'desc'] },
|
|
106
|
+
},
|
|
107
|
+
},
|
|
108
|
+
},
|
|
109
|
+
limit: { type: 'number' },
|
|
110
|
+
},
|
|
111
|
+
};
|
|
112
|
+
const CORE_TOOL_DEFINITIONS = [
|
|
113
|
+
{
|
|
114
|
+
name: 'ask_dql',
|
|
115
|
+
description: 'High-level governed ask router. Use first for business questions. Returns certified-vs-generated route, contextPackId, exact block candidate, allowed SQL context, missing context, trust status, and next safe DQL tool.',
|
|
116
|
+
inputSchema: {
|
|
117
|
+
type: 'object',
|
|
118
|
+
additionalProperties: false,
|
|
119
|
+
required: ['question'],
|
|
120
|
+
properties: {
|
|
121
|
+
question: { type: 'string', description: 'Business or analytics question to route through governed DQL context.' },
|
|
122
|
+
focusObjectKey: { type: 'string', description: 'Optional metadata object key to bias retrieval.' },
|
|
123
|
+
limit: { type: 'number', description: 'Maximum metadata objects in the context pack. Default 100.' },
|
|
124
|
+
},
|
|
125
|
+
},
|
|
126
|
+
surfaces: ['mcp', 'mcp_agentic', 'native', 'claude_code', 'answer_loop'],
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
name: 'query_semantic_model',
|
|
130
|
+
description: 'Semantic-layer compiler and bounded preview runner. Use after ask_dql when a governed metric/dimension/time-grain selection can answer the question before deep dbt/warehouse SQL search. Accepts explicit semantic members or a question, returns selected members, compiled SQL, bounded preview rows when runtime execution is available, and a reviewable DQL semantic artifact.',
|
|
131
|
+
inputSchema: {
|
|
132
|
+
type: 'object',
|
|
133
|
+
additionalProperties: false,
|
|
134
|
+
properties: {
|
|
135
|
+
question: {
|
|
136
|
+
type: 'string',
|
|
137
|
+
description: 'Business question to map to semantic-layer members when metrics are not supplied explicitly.',
|
|
138
|
+
},
|
|
139
|
+
metrics: {
|
|
140
|
+
type: 'array',
|
|
141
|
+
items: { type: 'string' },
|
|
142
|
+
description: 'Semantic metric names to compile. When supplied, these are used directly instead of question-based member selection.',
|
|
143
|
+
},
|
|
144
|
+
dimensions: {
|
|
145
|
+
type: 'array',
|
|
146
|
+
items: { type: 'string' },
|
|
147
|
+
description: 'Semantic dimensions to group by.',
|
|
148
|
+
},
|
|
149
|
+
timeDimension: {
|
|
150
|
+
type: 'object',
|
|
151
|
+
additionalProperties: false,
|
|
152
|
+
required: ['name', 'granularity'],
|
|
153
|
+
properties: {
|
|
154
|
+
name: { type: 'string' },
|
|
155
|
+
granularity: { type: 'string' },
|
|
156
|
+
},
|
|
157
|
+
description: 'Optional semantic time dimension and granularity such as {name:"order_date", granularity:"month"}.',
|
|
158
|
+
},
|
|
159
|
+
filters: {
|
|
160
|
+
type: 'array',
|
|
161
|
+
items: {
|
|
162
|
+
type: 'object',
|
|
163
|
+
additionalProperties: false,
|
|
164
|
+
required: ['dimension', 'operator', 'values'],
|
|
165
|
+
properties: {
|
|
166
|
+
dimension: { type: 'string' },
|
|
167
|
+
operator: { type: 'string' },
|
|
168
|
+
values: { type: 'array', items: { type: 'string' } },
|
|
169
|
+
},
|
|
170
|
+
},
|
|
171
|
+
description: 'Optional semantic filters to compile through the semantic layer.',
|
|
172
|
+
},
|
|
173
|
+
orderBy: {
|
|
174
|
+
type: 'array',
|
|
175
|
+
items: {
|
|
176
|
+
type: 'object',
|
|
177
|
+
additionalProperties: false,
|
|
178
|
+
required: ['name', 'direction'],
|
|
179
|
+
properties: {
|
|
180
|
+
name: { type: 'string' },
|
|
181
|
+
direction: { type: 'string', enum: ['asc', 'desc'] },
|
|
182
|
+
},
|
|
183
|
+
},
|
|
184
|
+
description: 'Optional semantic order by clauses.',
|
|
185
|
+
},
|
|
186
|
+
limit: {
|
|
187
|
+
type: 'number',
|
|
188
|
+
description: 'Optional result limit for the compiled semantic query.',
|
|
189
|
+
},
|
|
190
|
+
rowLimit: {
|
|
191
|
+
type: 'number',
|
|
192
|
+
description: 'Maximum rows returned from bounded preview execution. Default 200. Does not change the semantic query limit.',
|
|
193
|
+
},
|
|
194
|
+
saveDraft: {
|
|
195
|
+
type: 'boolean',
|
|
196
|
+
description: 'Persist the generated semantic DQL artifact to blocks/_drafts for review. Default true.',
|
|
197
|
+
},
|
|
198
|
+
dryRun: {
|
|
199
|
+
type: 'boolean',
|
|
200
|
+
description: 'Return the semantic DQL artifact and compiled SQL without runtime execution. Default false.',
|
|
201
|
+
},
|
|
202
|
+
serverUrl: {
|
|
203
|
+
type: 'string',
|
|
204
|
+
description: 'Base URL of the local DQL runtime for preview execution. Default http://127.0.0.1:3474.',
|
|
205
|
+
},
|
|
206
|
+
driver: {
|
|
207
|
+
type: 'string',
|
|
208
|
+
description: 'Optional SQL driver/dialect hint, such as duckdb, snowflake, bigquery, or postgres.',
|
|
209
|
+
},
|
|
210
|
+
tableMapping: {
|
|
211
|
+
type: 'object',
|
|
212
|
+
additionalProperties: { type: 'string' },
|
|
213
|
+
description: 'Optional mapping from semantic table names to physical database relations.',
|
|
214
|
+
},
|
|
215
|
+
},
|
|
216
|
+
},
|
|
217
|
+
surfaces: ['mcp', 'mcp_agentic', 'native', 'claude_code', 'answer_loop'],
|
|
218
|
+
},
|
|
219
|
+
{
|
|
220
|
+
name: 'kg_search',
|
|
221
|
+
description: 'Search the DQL knowledge graph across business terms, business views, blocks, apps, dashboards, notebooks, semantic objects, and dbt/source metadata.',
|
|
222
|
+
inputSchema: {
|
|
223
|
+
type: 'object',
|
|
224
|
+
additionalProperties: false,
|
|
225
|
+
required: ['query'],
|
|
226
|
+
properties: {
|
|
227
|
+
query: { type: 'string', description: 'Natural-language or keyword query.' },
|
|
228
|
+
kinds: {
|
|
229
|
+
type: 'array',
|
|
230
|
+
items: { type: 'string', enum: KG_KIND_ENUM },
|
|
231
|
+
description: 'Optional KG node-kind filter.',
|
|
232
|
+
},
|
|
233
|
+
domain: { type: 'string', description: 'Filter to a single business domain.' },
|
|
234
|
+
limit: { type: 'number', description: 'Max hits. Default 10.' },
|
|
235
|
+
},
|
|
236
|
+
},
|
|
237
|
+
surfaces: ['mcp', 'mcp_agentic', 'native', 'claude_code', 'answer_loop'],
|
|
238
|
+
},
|
|
239
|
+
{
|
|
240
|
+
name: 'search_blocks',
|
|
241
|
+
description: 'Find certified DQL blocks by keyword, domain, or status.',
|
|
242
|
+
inputSchema: {
|
|
243
|
+
type: 'object',
|
|
244
|
+
additionalProperties: false,
|
|
245
|
+
properties: {
|
|
246
|
+
query: { type: 'string', description: 'Substring matched against name, description, or tags.' },
|
|
247
|
+
domain: { type: 'string', description: 'Filter to a single business domain.' },
|
|
248
|
+
status: { type: 'string', enum: BLOCK_STATUS_ENUM, description: 'Filter by certification status.' },
|
|
249
|
+
limit: { type: 'number', description: 'Max results. Default 50.' },
|
|
250
|
+
},
|
|
251
|
+
},
|
|
252
|
+
surfaces: ['mcp', 'mcp_agentic', 'native', 'claude_code', 'answer_loop'],
|
|
253
|
+
},
|
|
254
|
+
{
|
|
255
|
+
name: 'get_block',
|
|
256
|
+
description: 'Return full metadata, dependencies, and SQL for a block.',
|
|
257
|
+
inputSchema: {
|
|
258
|
+
type: 'object',
|
|
259
|
+
additionalProperties: false,
|
|
260
|
+
required: ['name'],
|
|
261
|
+
properties: {
|
|
262
|
+
name: { type: 'string', description: 'Block name as shown in search_blocks.' },
|
|
263
|
+
includeSource: { type: 'boolean', description: 'Include full .dql source text. Default true.' },
|
|
264
|
+
},
|
|
265
|
+
},
|
|
266
|
+
surfaces: ['mcp', 'mcp_agentic', 'native', 'claude_code', 'answer_loop'],
|
|
267
|
+
},
|
|
268
|
+
{
|
|
269
|
+
name: 'query_via_block',
|
|
270
|
+
description: 'Tier-1 of graduated trust. Execute a certified block against the local DQL runtime when the block grain exactly answers the user question. For named-entity filters, custom rankings, breakdowns, comparisons, or drill-throughs, use the block as context and call query_via_metadata instead.',
|
|
271
|
+
inputSchema: {
|
|
272
|
+
type: 'object',
|
|
273
|
+
additionalProperties: false,
|
|
274
|
+
required: ['name'],
|
|
275
|
+
properties: {
|
|
276
|
+
name: { type: 'string', description: 'Certified block to execute.' },
|
|
277
|
+
limit: { type: 'number', description: 'Max rows to return. Default 200.' },
|
|
278
|
+
question: {
|
|
279
|
+
type: 'string',
|
|
280
|
+
description: 'Original question. Enables a defense-in-depth grain gate before serving the block.',
|
|
281
|
+
},
|
|
282
|
+
serverUrl: {
|
|
283
|
+
type: 'string',
|
|
284
|
+
description: 'Base URL of the local DQL runtime. Default http://127.0.0.1:3474.',
|
|
285
|
+
},
|
|
286
|
+
},
|
|
287
|
+
},
|
|
288
|
+
surfaces: ['mcp', 'mcp_agentic', 'native', 'claude_code', 'answer_loop'],
|
|
289
|
+
},
|
|
290
|
+
{
|
|
291
|
+
name: 'inspect_metadata_context',
|
|
292
|
+
description: 'Build the local SQLite metadata context pack for a question. Use before Tier-2 SQL generation to inspect certified blocks, semantic metrics, DQL terms/views, dbt/warehouse objects, lineage edges, diagnostics, selected evidence, rejected candidates, and trust labels.',
|
|
293
|
+
inputSchema: {
|
|
294
|
+
type: 'object',
|
|
295
|
+
additionalProperties: false,
|
|
296
|
+
required: ['question'],
|
|
297
|
+
properties: {
|
|
298
|
+
question: { type: 'string', description: 'User question to ground in the local SQLite metadata catalog.' },
|
|
299
|
+
focusObjectKey: { type: 'string', description: 'Optional object key, such as dql:block:Revenue or semantic:metric:revenue.' },
|
|
300
|
+
objectTypes: { type: 'array', items: { type: 'string' }, description: 'Optional metadata object type filter.' },
|
|
301
|
+
limit: { type: 'number', description: 'Maximum selected objects in the context pack. Default 100.' },
|
|
302
|
+
strictness: {
|
|
303
|
+
type: 'string',
|
|
304
|
+
enum: ['balanced', 'exploratory'],
|
|
305
|
+
description: 'Retrieval depth. Use exploratory for deep research; it widens context when limit is omitted.',
|
|
306
|
+
},
|
|
307
|
+
},
|
|
308
|
+
},
|
|
309
|
+
surfaces: ['mcp', 'mcp_agentic', 'native', 'claude_code', 'answer_loop'],
|
|
310
|
+
},
|
|
311
|
+
{
|
|
312
|
+
name: 'query_via_metadata',
|
|
313
|
+
description: 'Tier-2 of graduated trust. Use when no certified block exactly answers the requested grain, including named filters, rankings, breakdowns, comparisons, anomalies, and drill-throughs. Call inspect_metadata_context first and pass its contextPackId. If proposedSql is omitted, this returns the catalog route plan and allowed SQL context. If proposedSql is supplied, it must be one read-only SELECT/WITH query using only inspected relations/columns. The runtime executes a bounded preview, returns uncertified trust evidence, and saves a reviewable DQL draft.',
|
|
314
|
+
inputSchema: {
|
|
315
|
+
type: 'object',
|
|
316
|
+
additionalProperties: false,
|
|
317
|
+
required: ['question'],
|
|
318
|
+
properties: {
|
|
319
|
+
question: { type: 'string', description: 'The user question being answered, verbatim.' },
|
|
320
|
+
proposedSql: { type: 'string', description: 'Read-only SELECT/WITH SQL inferred from inspected metadata context.' },
|
|
321
|
+
contextPackId: { type: 'string', description: 'Context-pack id returned by inspect_metadata_context.' },
|
|
322
|
+
intent: { type: 'string', enum: RESEARCH_INTENT_ENUM, description: 'Optional deep-research intent.' },
|
|
323
|
+
upstreamRefs: { type: 'array', items: { type: 'string' }, description: 'Tables or blocks involved in the proposed SQL.' },
|
|
324
|
+
outputs: {
|
|
325
|
+
type: 'array',
|
|
326
|
+
items: { type: 'string' },
|
|
327
|
+
description: 'Declared output column names returned by the proposed SQL and written into the DQL draft.',
|
|
328
|
+
},
|
|
329
|
+
followUp: {
|
|
330
|
+
type: 'object',
|
|
331
|
+
additionalProperties: false,
|
|
332
|
+
properties: {
|
|
333
|
+
kind: { type: 'string', enum: ['generic', 'drilldown', 'contextual'] },
|
|
334
|
+
sourceBlockName: { type: 'string' },
|
|
335
|
+
sourceQuestion: { type: 'string' },
|
|
336
|
+
sourceAnswer: { type: 'string' },
|
|
337
|
+
filters: { type: 'array', items: { type: 'string' } },
|
|
338
|
+
dimensions: { type: 'array', items: { type: 'string' } },
|
|
339
|
+
priorResultColumns: { type: 'array', items: { type: 'string' } },
|
|
340
|
+
priorResultValues: {
|
|
341
|
+
type: 'object',
|
|
342
|
+
additionalProperties: { type: 'array', items: { type: 'string' } },
|
|
343
|
+
},
|
|
344
|
+
priorResultRef: PRIOR_RESULT_REFERENCE_SCHEMA,
|
|
345
|
+
priorDqlArtifact: DQL_ARTIFACT_REFERENCE_SCHEMA,
|
|
346
|
+
priorLimit: { type: 'number' },
|
|
347
|
+
priorMeasures: { type: 'array', items: { type: 'string' } },
|
|
348
|
+
},
|
|
349
|
+
},
|
|
350
|
+
proposedDomain: { type: 'string', description: 'Best guess at the DataLex domain that owns this question.' },
|
|
351
|
+
proposedEntity: { type: 'string', description: 'Best guess at the owning entity, such as Customer.' },
|
|
352
|
+
saveDraft: { type: 'boolean', description: 'Persist a draft .dql file. Default true.' },
|
|
353
|
+
dryRun: { type: 'boolean', description: 'Return proposal only without execution. Default false.' },
|
|
354
|
+
regroundAttemptsUsed: {
|
|
355
|
+
type: 'number',
|
|
356
|
+
description: 'Number of expand_context re-ground attempts already used for this query. Pass 1 when retrying with an expanded context pack.',
|
|
357
|
+
},
|
|
358
|
+
limit: { type: 'number', description: 'Max rows to return on execution.' },
|
|
359
|
+
serverUrl: { type: 'string', description: 'Base URL of the local DQL runtime. Default http://127.0.0.1:3474.' },
|
|
360
|
+
},
|
|
361
|
+
},
|
|
362
|
+
surfaces: ['mcp', 'mcp_agentic', 'native', 'claude_code', 'answer_loop'],
|
|
363
|
+
},
|
|
364
|
+
{
|
|
365
|
+
name: 'expand_context',
|
|
366
|
+
description: 'Repair-loop context expander. Use after inspect_metadata_context or query_via_metadata reports an allowed-context gap for a known catalog/runtime relation. It creates a new contextPackId with the requested relation(s), so the agent can retry query_via_metadata without starting over or inventing uninspected SQL.',
|
|
367
|
+
inputSchema: {
|
|
368
|
+
type: 'object',
|
|
369
|
+
additionalProperties: false,
|
|
370
|
+
required: ['contextPackId', 'relations'],
|
|
371
|
+
properties: {
|
|
372
|
+
contextPackId: {
|
|
373
|
+
type: 'string',
|
|
374
|
+
description: 'Existing context-pack id returned by ask_dql or inspect_metadata_context.',
|
|
375
|
+
},
|
|
376
|
+
relations: {
|
|
377
|
+
type: 'array',
|
|
378
|
+
minItems: 1,
|
|
379
|
+
maxItems: 16,
|
|
380
|
+
items: { type: 'string' },
|
|
381
|
+
description: 'Relations to add to the context pack, such as dev.supplies or SHOP.ANALYTICS.supplies.',
|
|
382
|
+
},
|
|
383
|
+
question: {
|
|
384
|
+
type: 'string',
|
|
385
|
+
description: 'Optional refined question used in expansion notes. Defaults to the original context-pack question.',
|
|
386
|
+
},
|
|
387
|
+
},
|
|
388
|
+
},
|
|
389
|
+
surfaces: ['mcp', 'mcp_agentic', 'native', 'claude_code', 'answer_loop'],
|
|
390
|
+
},
|
|
391
|
+
{
|
|
392
|
+
name: 'answer_question',
|
|
393
|
+
description: "Governed one-shot answer. Runs DQL's OWN governed cascade (certified block → semantic metric → generated SQL) end-to-end and returns the executed answer with rows, SQL preview, canonical trust label, citations, and a reviewable draft — the SAME engine and trust guards as the DQL UI. Use this when you want DQL to generate AND answer for you. Prefer query_via_metadata when you want to author the SQL yourself. Requires the DQL runtime (`dql serve`).",
|
|
394
|
+
inputSchema: {
|
|
395
|
+
type: 'object',
|
|
396
|
+
additionalProperties: false,
|
|
397
|
+
required: ['question'],
|
|
398
|
+
properties: {
|
|
399
|
+
question: { type: 'string', description: 'Business or analytics question to answer.' },
|
|
400
|
+
audience: { type: 'string', enum: ['analyst', 'stakeholder'], description: 'Answer audience. Default analyst.' },
|
|
401
|
+
requestedMode: { type: 'string', enum: ['auto', 'ask', 'research'], description: 'Routing mode. Default auto (let the cascade decide).' },
|
|
402
|
+
reasoningEffort: { type: 'string', enum: ['low', 'medium', 'high'], description: 'Optional model effort (host ceilings still apply).' },
|
|
403
|
+
analysisDepth: { type: 'string', enum: ['quick', 'deep'], description: 'Optional retrieval/analysis depth.' },
|
|
404
|
+
threadId: { type: 'string', description: 'Continue a persisted conversation thread.' },
|
|
405
|
+
serverUrl: { type: 'string', description: 'Base URL of the local DQL runtime. Default http://127.0.0.1:3474.' },
|
|
406
|
+
},
|
|
407
|
+
},
|
|
408
|
+
surfaces: ['mcp', 'mcp_agentic'],
|
|
409
|
+
},
|
|
410
|
+
{
|
|
411
|
+
name: 'build_block_from_prompt',
|
|
412
|
+
description: "Governed block builder from a natural-language prompt. Runs DQL's buildFromPrompt (the same governed engine the UI uses) to draft a reusable, review-required DQL block — you do NOT author SQL. Symmetric with build_dql_app. Returns the draft path, dqlArtifact source, and the Certifier verdict; NEVER auto-certifies. Requires the DQL runtime (`dql serve`).",
|
|
413
|
+
inputSchema: {
|
|
414
|
+
type: 'object',
|
|
415
|
+
additionalProperties: false,
|
|
416
|
+
required: ['prompt'],
|
|
417
|
+
properties: {
|
|
418
|
+
prompt: { type: 'string', description: 'What the block should compute, e.g. "weekly revenue by region".' },
|
|
419
|
+
mode: { type: 'string', enum: ['create', 'edit'], description: 'Create a new draft, or edit an existing block in place. Default create.' },
|
|
420
|
+
blockPath: { type: 'string', description: 'Required for mode=edit: the block file to modify.' },
|
|
421
|
+
owner: { type: 'string', description: 'Owner identity to stamp on the draft.' },
|
|
422
|
+
serverUrl: { type: 'string', description: 'Base URL of the local DQL runtime. Default http://127.0.0.1:3474.' },
|
|
423
|
+
},
|
|
424
|
+
},
|
|
425
|
+
surfaces: ['mcp', 'mcp_agentic'],
|
|
426
|
+
},
|
|
427
|
+
{
|
|
428
|
+
name: 'list_metrics',
|
|
429
|
+
description: 'List semantic-layer metrics, optionally filtered by domain.',
|
|
430
|
+
inputSchema: DOMAIN_FILTER_SCHEMA,
|
|
431
|
+
surfaces: ['mcp'],
|
|
432
|
+
},
|
|
433
|
+
{
|
|
434
|
+
name: 'list_dimensions',
|
|
435
|
+
description: 'List semantic-layer dimensions, optionally filtered by domain.',
|
|
436
|
+
inputSchema: DOMAIN_FILTER_SCHEMA,
|
|
437
|
+
surfaces: ['mcp'],
|
|
438
|
+
},
|
|
439
|
+
{
|
|
440
|
+
name: 'lineage_impact',
|
|
441
|
+
description: 'Return upstream/downstream lineage for a block, metric, or model.',
|
|
442
|
+
inputSchema: {
|
|
443
|
+
type: 'object',
|
|
444
|
+
additionalProperties: false,
|
|
445
|
+
required: ['focus'],
|
|
446
|
+
properties: {
|
|
447
|
+
focus: { type: 'string', description: 'Node id, such as block:revenue, or a bare name.' },
|
|
448
|
+
upstreamDepth: { type: 'number' },
|
|
449
|
+
downstreamDepth: { type: 'number' },
|
|
450
|
+
nodeLimit: { type: 'number', description: 'Maximum lineage nodes to return. Default 80.' },
|
|
451
|
+
edgeLimit: { type: 'number', description: 'Maximum lineage edges to return. Default 120.' },
|
|
452
|
+
pathLimit: {
|
|
453
|
+
type: 'number',
|
|
454
|
+
description: 'Maximum complete paths per direction when paths=true. Default 20.',
|
|
455
|
+
},
|
|
456
|
+
paths: { type: 'boolean', description: 'Include full source-to-leaf paths.' },
|
|
457
|
+
recert: { type: 'boolean', description: 'Return re-certification impact for a changed block.' },
|
|
458
|
+
nonSemantic: { type: 'boolean', description: 'With recert, treat the change as non-semantic.' },
|
|
459
|
+
},
|
|
460
|
+
},
|
|
461
|
+
surfaces: ['mcp', 'mcp_agentic', 'native', 'claude_code', 'answer_loop'],
|
|
462
|
+
},
|
|
463
|
+
{
|
|
464
|
+
name: 'certify',
|
|
465
|
+
description: 'Run governance rules against a block and report pass/fail.',
|
|
466
|
+
inputSchema: {
|
|
467
|
+
type: 'object',
|
|
468
|
+
additionalProperties: false,
|
|
469
|
+
required: ['name'],
|
|
470
|
+
properties: {
|
|
471
|
+
name: { type: 'string', description: 'Block name to evaluate.' },
|
|
472
|
+
},
|
|
473
|
+
},
|
|
474
|
+
surfaces: ['mcp', 'mcp_agentic', 'native', 'claude_code'],
|
|
475
|
+
},
|
|
476
|
+
{
|
|
477
|
+
name: 'suggest_block',
|
|
478
|
+
description: 'Write a curated proposed block to the local draft queue with a hand-shaped name and structure, plus the governance gate result. Use when proposing a shared building block; for one-shot ad-hoc Tier-2 captures, use query_via_metadata instead.',
|
|
479
|
+
inputSchema: {
|
|
480
|
+
type: 'object',
|
|
481
|
+
additionalProperties: false,
|
|
482
|
+
required: ['name', 'domain', 'owner', 'description', 'sql'],
|
|
483
|
+
properties: {
|
|
484
|
+
name: { type: 'string', description: 'Proposed block name.' },
|
|
485
|
+
domain: { type: 'string', description: 'Business domain.' },
|
|
486
|
+
owner: { type: 'string', description: 'Block owner identity.' },
|
|
487
|
+
description: { type: 'string', description: 'One-line description.' },
|
|
488
|
+
sql: { type: 'string', description: 'The block body SQL.' },
|
|
489
|
+
tags: { type: 'array', items: { type: 'string' } },
|
|
490
|
+
chartType: { type: 'string', description: 'Optional visualization type.' },
|
|
491
|
+
},
|
|
492
|
+
},
|
|
493
|
+
surfaces: ['mcp', 'mcp_agentic', 'native', 'claude_code'],
|
|
494
|
+
},
|
|
495
|
+
{
|
|
496
|
+
name: 'search_metadata',
|
|
497
|
+
description: 'Grounded-SQL retrieval: rank dbt tables relevant to a request and return each table qualified relation and ref form. Use before writing SQL so you reference the real relation, never a bare model name.',
|
|
498
|
+
inputSchema: {
|
|
499
|
+
type: 'object',
|
|
500
|
+
additionalProperties: false,
|
|
501
|
+
required: ['query'],
|
|
502
|
+
properties: {
|
|
503
|
+
query: { type: 'string', description: 'Natural-language request to find relevant tables for.' },
|
|
504
|
+
limit: { type: 'number', description: 'Max tables to return. Default 12.' },
|
|
505
|
+
},
|
|
506
|
+
},
|
|
507
|
+
surfaces: ['mcp'],
|
|
508
|
+
},
|
|
509
|
+
{
|
|
510
|
+
name: 'get_table_schema',
|
|
511
|
+
description: 'Return the qualified relation, ref form, real columns and types, and inferred join keys for a dbt table by model name, alias, or qualified relation.',
|
|
512
|
+
inputSchema: {
|
|
513
|
+
type: 'object',
|
|
514
|
+
additionalProperties: false,
|
|
515
|
+
required: ['table'],
|
|
516
|
+
properties: {
|
|
517
|
+
table: { type: 'string', description: 'Model name, alias, or qualified relation.' },
|
|
518
|
+
},
|
|
519
|
+
},
|
|
520
|
+
surfaces: ['mcp'],
|
|
521
|
+
},
|
|
522
|
+
{
|
|
523
|
+
name: 'validate_sql',
|
|
524
|
+
description: 'Validate that a read-only SELECT/WITH query references only relations and columns that exist in the dbt schema. Returns the precise offending table or column on a miss.',
|
|
525
|
+
inputSchema: {
|
|
526
|
+
type: 'object',
|
|
527
|
+
additionalProperties: false,
|
|
528
|
+
required: ['sql'],
|
|
529
|
+
properties: {
|
|
530
|
+
sql: { type: 'string', description: 'A read-only SELECT/WITH query to validate against the dbt schema.' },
|
|
531
|
+
query: { type: 'string', description: 'Optional original request, used to scope grounding.' },
|
|
532
|
+
},
|
|
533
|
+
},
|
|
534
|
+
surfaces: ['mcp'],
|
|
535
|
+
},
|
|
536
|
+
{
|
|
537
|
+
name: 'inspect_dql_project',
|
|
538
|
+
description: 'Front-door project health/context tool for MCP clients. Refreshes metadata/index by default and returns block, app, dashboard, semantic, catalog, and recommended-next-step status.',
|
|
539
|
+
inputSchema: {
|
|
540
|
+
type: 'object',
|
|
541
|
+
additionalProperties: false,
|
|
542
|
+
properties: {
|
|
543
|
+
refresh: { type: 'boolean', description: 'Refresh metadata and agent index before returning status. Default true.' },
|
|
544
|
+
},
|
|
545
|
+
},
|
|
546
|
+
surfaces: ['mcp', 'mcp_agentic'],
|
|
547
|
+
},
|
|
548
|
+
{
|
|
549
|
+
name: 'build_dql_block',
|
|
550
|
+
description: 'High-level draft-block tool. Writes a proposed block to the local draft queue with governance results. Does not certify automatically.',
|
|
551
|
+
inputSchema: {
|
|
552
|
+
type: 'object',
|
|
553
|
+
additionalProperties: false,
|
|
554
|
+
required: ['name', 'domain', 'owner', 'description', 'sql'],
|
|
555
|
+
properties: {
|
|
556
|
+
name: { type: 'string', description: 'Proposed block name.' },
|
|
557
|
+
domain: { type: 'string', description: 'Business domain.' },
|
|
558
|
+
owner: { type: 'string', description: 'Block owner identity.' },
|
|
559
|
+
description: { type: 'string', description: 'One-line description.' },
|
|
560
|
+
sql: { type: 'string', description: 'The block body SQL.' },
|
|
561
|
+
tags: { type: 'array', items: { type: 'string' } },
|
|
562
|
+
chartType: { type: 'string', description: 'Optional visualization type.' },
|
|
563
|
+
},
|
|
564
|
+
},
|
|
565
|
+
surfaces: ['mcp'],
|
|
566
|
+
},
|
|
567
|
+
{
|
|
568
|
+
name: 'build_dql_app',
|
|
569
|
+
description: 'High-level app builder. Creates or plans a governed DQL app draft from a prompt using certified tiles first and review-only placeholders for missing evidence.',
|
|
570
|
+
inputSchema: {
|
|
571
|
+
type: 'object',
|
|
572
|
+
additionalProperties: false,
|
|
573
|
+
required: ['prompt'],
|
|
574
|
+
properties: {
|
|
575
|
+
prompt: { type: 'string', description: 'App outcome request.' },
|
|
576
|
+
domain: { type: 'string', description: 'Optional business domain to prioritize.' },
|
|
577
|
+
owner: { type: 'string', description: 'Owner identity to store on the generated app.' },
|
|
578
|
+
aiLayout: { type: 'boolean', description: 'Store richer dynamic GenUI layout metadata.' },
|
|
579
|
+
saveDraft: { type: 'boolean', description: 'Write app draft files. Default true.' },
|
|
580
|
+
overwrite: { type: 'boolean', description: 'Overwrite an existing app folder. Default false.' },
|
|
581
|
+
},
|
|
582
|
+
},
|
|
583
|
+
surfaces: ['mcp'],
|
|
584
|
+
},
|
|
585
|
+
{
|
|
586
|
+
name: 'list_proposals',
|
|
587
|
+
description: 'List Tier-2 block drafts, semantic metric drafts, and semantic recertification proposals ordered by askedTimes DESC. Use this to prioritize recurring questions and composted metrics for certification.',
|
|
588
|
+
inputSchema: {
|
|
589
|
+
type: 'object',
|
|
590
|
+
additionalProperties: false,
|
|
591
|
+
properties: {
|
|
592
|
+
askedAtLeastTimes: {
|
|
593
|
+
type: 'number',
|
|
594
|
+
description: 'Filter to drafts asked at least N times. Default 1.',
|
|
595
|
+
},
|
|
596
|
+
since: {
|
|
597
|
+
type: 'string',
|
|
598
|
+
description: 'ISO 8601 timestamp; only return drafts whose last_asked is on or after this.',
|
|
599
|
+
},
|
|
600
|
+
},
|
|
601
|
+
},
|
|
602
|
+
surfaces: ['mcp'],
|
|
603
|
+
},
|
|
604
|
+
{
|
|
605
|
+
name: 'feedback_record',
|
|
606
|
+
description: 'Record thumbs-up/down feedback on an answer. Feedback feeds promotion signals and answer-quality review; it never upgrades generated output to certified.',
|
|
607
|
+
inputSchema: {
|
|
608
|
+
type: 'object',
|
|
609
|
+
additionalProperties: false,
|
|
610
|
+
required: ['user', 'question', 'answerKind', 'rating'],
|
|
611
|
+
properties: {
|
|
612
|
+
user: { type: 'string', description: 'User who submitted the feedback.' },
|
|
613
|
+
question: { type: 'string', description: 'Original question.' },
|
|
614
|
+
answerKind: { type: 'string', enum: ['certified', 'uncertified'], description: 'How the answer was classified.' },
|
|
615
|
+
blockId: { type: 'string', description: 'Block id the answer was anchored to, if any.' },
|
|
616
|
+
rating: { type: 'string', enum: ['up', 'down'], description: 'Thumbs up or down.' },
|
|
617
|
+
comment: { type: 'string', description: 'Optional free-text rationale.' },
|
|
618
|
+
},
|
|
619
|
+
},
|
|
620
|
+
surfaces: ['mcp'],
|
|
621
|
+
},
|
|
622
|
+
{
|
|
623
|
+
name: 'record_correction',
|
|
624
|
+
description: 'Capture an analyst correction of a Tier-2 generated answer as a scoped, Git-versioned candidate hint. The hint is not used until approved.',
|
|
625
|
+
inputSchema: {
|
|
626
|
+
type: 'object',
|
|
627
|
+
additionalProperties: false,
|
|
628
|
+
required: ['question', 'wrongAnswer', 'correction', 'scope'],
|
|
629
|
+
properties: {
|
|
630
|
+
question: { type: 'string', description: 'The analyst question the Tier-2 answer was for.' },
|
|
631
|
+
wrongAnswer: { type: 'string', description: 'The generated answer or SQL that was wrong.' },
|
|
632
|
+
correction: { type: 'string', description: 'The analyst correction: corrected SQL, rule, or guidance.' },
|
|
633
|
+
scope: HINT_SCOPE_SCHEMA,
|
|
634
|
+
rationale: { type: 'string', description: 'Why the original answer was wrong.' },
|
|
635
|
+
author: { type: 'string', description: 'Who recorded the correction.' },
|
|
636
|
+
correctedSql: { type: 'string', description: 'Optional canonical corrected SQL to endorse.' },
|
|
637
|
+
hintTitle: { type: 'string', description: 'Override the derived hint title.' },
|
|
638
|
+
hintGuidance: { type: 'string', description: 'Override the hint guidance.' },
|
|
639
|
+
tags: { type: 'array', items: { type: 'string' }, description: 'Searchable keywords.' },
|
|
640
|
+
anchorObjectKey: { type: 'string', description: 'Context pack, block, or object id the correction anchored to.' },
|
|
641
|
+
},
|
|
642
|
+
},
|
|
643
|
+
surfaces: ['mcp'],
|
|
644
|
+
},
|
|
645
|
+
{
|
|
646
|
+
name: 'approve_hint',
|
|
647
|
+
description: 'Approve or reject a candidate correction hint. Approval is the only path that makes a scoped hint usable in future Tier-2 drafts.',
|
|
648
|
+
inputSchema: {
|
|
649
|
+
type: 'object',
|
|
650
|
+
additionalProperties: false,
|
|
651
|
+
required: ['hintId', 'decision', 'reviewer'],
|
|
652
|
+
properties: {
|
|
653
|
+
hintId: { type: 'string', description: 'Id of the candidate hint to review.' },
|
|
654
|
+
decision: { type: 'string', enum: ['approved', 'rejected'], description: 'Approve or reject the candidate hint.' },
|
|
655
|
+
reviewer: { type: 'string', description: 'Who is reviewing.' },
|
|
656
|
+
note: { type: 'string', description: 'Optional review note.' },
|
|
657
|
+
},
|
|
658
|
+
},
|
|
659
|
+
surfaces: ['mcp'],
|
|
660
|
+
},
|
|
661
|
+
{
|
|
662
|
+
name: 'list_hints',
|
|
663
|
+
description: 'List scoped correction hints, optionally filtered by lifecycle status, domain, or metric. Approved hints are folded into future Tier-2 drafts after certified routing.',
|
|
664
|
+
inputSchema: {
|
|
665
|
+
type: 'object',
|
|
666
|
+
additionalProperties: false,
|
|
667
|
+
properties: {
|
|
668
|
+
status: { type: 'string', enum: HINT_STATUS_ENUM, description: 'Filter by lifecycle status.' },
|
|
669
|
+
domain: { type: 'string', description: 'Filter to a single domain scope.' },
|
|
670
|
+
metric: { type: 'string', description: 'Filter to a single metric scope.' },
|
|
671
|
+
},
|
|
672
|
+
},
|
|
673
|
+
surfaces: ['mcp'],
|
|
674
|
+
},
|
|
675
|
+
];
|
|
676
|
+
export const DQL_TOOL_REGISTRY = CORE_TOOL_DEFINITIONS;
|
|
677
|
+
export function getDqlToolDefinition(name) {
|
|
678
|
+
const definition = DQL_TOOL_REGISTRY.find((tool) => tool.name === name);
|
|
679
|
+
if (!definition)
|
|
680
|
+
throw new Error(`Unknown DQL tool definition: ${name}`);
|
|
681
|
+
return definition;
|
|
682
|
+
}
|
|
683
|
+
export function dqlToolDefinitionsForSurface(surface) {
|
|
684
|
+
return DQL_TOOL_REGISTRY.filter((tool) => tool.surfaces.includes(surface));
|
|
685
|
+
}
|
|
686
|
+
export function dqlToolNamesForSurface(surface) {
|
|
687
|
+
return dqlToolDefinitionsForSurface(surface).map((tool) => tool.name);
|
|
688
|
+
}
|
|
689
|
+
export function dqlMcpToolNamesForSurface(surface, prefix = 'mcp__dql__') {
|
|
690
|
+
return dqlToolNamesForSurface(surface).map((name) => `${prefix}${name}`);
|
|
691
|
+
}
|
|
692
|
+
//# sourceMappingURL=registry.js.map
|