@duckcodeailabs/dql-cli 1.14.3-rc.1 → 1.14.5
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/args.d.ts +2 -0
- package/dist/args.d.ts.map +1 -1
- package/dist/args.js +12 -0
- package/dist/args.js.map +1 -1
- package/dist/ask-runtime/analytical-planner.d.ts +14 -0
- package/dist/ask-runtime/analytical-planner.d.ts.map +1 -0
- package/dist/ask-runtime/analytical-planner.js +197 -0
- package/dist/ask-runtime/analytical-planner.js.map +1 -0
- package/dist/ask-runtime/readiness.d.ts +36 -0
- package/dist/ask-runtime/readiness.d.ts.map +1 -0
- package/dist/ask-runtime/readiness.js +65 -0
- package/dist/ask-runtime/readiness.js.map +1 -0
- package/dist/assets/dql-notebook/assets/{AgentLogPage-Jbyb4so-.js → AgentLogPage-XonDlOVv.js} +1 -1
- package/dist/assets/dql-notebook/assets/{AiBuildDialog-Du07X1qO.js → AiBuildDialog-DwHVVFIS.js} +1 -1
- package/dist/assets/dql-notebook/assets/{AiBuildResult-xKtGthWv.js → AiBuildResult-BImB4Wej.js} +1 -1
- package/dist/assets/dql-notebook/assets/{AiSidePanel-CE_L04dK.js → AiSidePanel-D7fFBhgc.js} +1 -1
- package/dist/assets/dql-notebook/assets/{AnalyticsHome-CiUE10uF.js → AnalyticsHome-CHvGWG92.js} +1 -1
- package/dist/assets/dql-notebook/assets/{AppsView-DlNaTuwD.js → AppsView-DNhs0MyO.js} +4 -4
- package/dist/assets/dql-notebook/assets/{AskObservabilityPage-DracZPI9.js → AskObservabilityPage-1WYjAf8-.js} +1 -1
- package/dist/assets/dql-notebook/assets/AskTracePage-D6_RunIf.js +8 -0
- package/dist/assets/dql-notebook/assets/{BlockStudio-DQS5Hcq9.js → BlockStudio-DWMOCHy5.js} +1 -1
- package/dist/assets/dql-notebook/assets/{BusinessArtifactView-CqV4i9l_.js → BusinessArtifactView-guqlfQ0j.js} +1 -1
- package/dist/assets/dql-notebook/assets/{DbtFirstModelingPage-JKhB_Y2H.js → DbtFirstModelingPage-DE7ewjMK.js} +1 -1
- package/dist/assets/dql-notebook/assets/{GitPage-DjaNp0o3.js → GitPage-CM3cgHtf.js} +1 -1
- package/dist/assets/dql-notebook/assets/{GlobalAiRail-CsV3zlc8.js → GlobalAiRail-BWfeK8lb.js} +1 -1
- package/dist/assets/dql-notebook/assets/{GovernedContextPage-uXUHUOIJ.js → GovernedContextPage-2Ld4yIgE.js} +1 -1
- package/dist/assets/dql-notebook/assets/{HelpDocsPage-Hbh9IeYB.js → HelpDocsPage-BxBzoxBO.js} +1 -1
- package/dist/assets/dql-notebook/assets/{HomePage-CRRl-R_v.js → HomePage-D4ZjCFfB.js} +1 -1
- package/dist/assets/dql-notebook/assets/{LineageDAG-OMUP2sbl.js → LineageDAG-DLdogZMo.js} +1 -1
- package/dist/assets/dql-notebook/assets/{LineageDetailView-C964BLuV.js → LineageDetailView-CqPB_tFP.js} +1 -1
- package/dist/assets/dql-notebook/assets/{LineageDrawer-CzY0nfpD.js → LineageDrawer-LZyR3zHf.js} +1 -1
- package/dist/assets/dql-notebook/assets/{LineagePathBreadcrumb-0Gi-Fm1B.js → LineagePathBreadcrumb-BZ7EcIxp.js} +1 -1
- package/dist/assets/dql-notebook/assets/{MiniLineageGraph-wn0wLc9m.js → MiniLineageGraph-Be_kqIq2.js} +1 -1
- package/dist/assets/dql-notebook/assets/{NewBlockModal-kMAzk91d.js → NewBlockModal-C9MKCa6R.js} +1 -1
- package/dist/assets/dql-notebook/assets/{NewNotebookModal-D_cWd_6M.js → NewNotebookModal-ZxHbTU9u.js} +1 -1
- package/dist/assets/dql-notebook/assets/{NotebookEditor-Bax0lxaz.js → NotebookEditor-Bh39Vsg0.js} +1 -1
- package/dist/assets/dql-notebook/assets/{ReadinessPage-DEUIXQQY.js → ReadinessPage-jKOBKkED.js} +1 -1
- package/dist/assets/dql-notebook/assets/{SetupOnboarding-CyE-Ex41.js → SetupOnboarding-BRut9nLO.js} +1 -1
- package/dist/assets/dql-notebook/assets/{SkillsPage-QgvKGPxE.js → SkillsPage-D9msUOxY.js} +1 -1
- package/dist/assets/dql-notebook/assets/{TrustBadge-D5CGp0cu.js → TrustBadge-D1CGSj0Y.js} +1 -1
- package/dist/assets/dql-notebook/assets/UnifiedAgentRunPanel-BexNjqJd.js +88 -0
- package/dist/assets/dql-notebook/assets/{answer-to-notebook-tACdCsTV.js → answer-to-notebook-zHFOdR6E.js} +1 -1
- package/dist/assets/dql-notebook/assets/{arrow-left-CF6wxXU5.js → arrow-left-C1tZBhgf.js} +1 -1
- package/dist/assets/dql-notebook/assets/{arrow-right-C7G3M_S8.js → arrow-right-BP5vPPNo.js} +1 -1
- package/dist/assets/dql-notebook/assets/{book-open-text-DDBO8G7L.js → book-open-text-BD3-ATYI.js} +1 -1
- package/dist/assets/dql-notebook/assets/{chevron-left-DxajrX2v.js → chevron-left-3opVgscY.js} +1 -1
- package/dist/assets/dql-notebook/assets/{circle-x-HBvXjnT6.js → circle-x-Bg9-70KN.js} +1 -1
- package/dist/assets/dql-notebook/assets/{clock-3-CJIdsPLt.js → clock-3-DLV5puGW.js} +1 -1
- package/dist/assets/dql-notebook/assets/{external-link-WciAU8Bu.js → external-link-BjD8w9QU.js} +1 -1
- package/dist/assets/dql-notebook/assets/{grip-vertical-DVu7ok6x.js → grip-vertical-DqIc09oX.js} +1 -1
- package/dist/assets/dql-notebook/assets/{index-D3wnucQC.js → index-C9KfoqCR.js} +2 -2
- package/dist/assets/dql-notebook/assets/{link-2-C6uQx50X.js → link-2-5s0hUu6w.js} +1 -1
- package/dist/assets/dql-notebook/assets/{list-tree-DapsIuQB.js → list-tree-67yz_uCY.js} +1 -1
- package/dist/assets/dql-notebook/assets/{minimize-2-BlVoipnT.js → minimize-2-BJw5tlPC.js} +1 -1
- package/dist/assets/dql-notebook/assets/{panel-right-open-DcnKWxfx.js → panel-right-open-CyhTG-tw.js} +1 -1
- package/dist/assets/dql-notebook/assets/{play-CNuRuaAs.js → play-CsY8D5M2.js} +1 -1
- package/dist/assets/dql-notebook/assets/{rotate-ccw-B2p953Zh.js → rotate-ccw-RvwtBcw9.js} +1 -1
- package/dist/assets/dql-notebook/assets/{semantic-fields-2fWgkTJc.js → semantic-fields-EorgHwAj.js} +1 -1
- package/dist/assets/dql-notebook/assets/{sliders-horizontal-DwRTu1w4.js → sliders-horizontal-jQ_fUiYf.js} +1 -1
- package/dist/assets/dql-notebook/assets/{star-Cbaj4F3i.js → star-N_C8YvbB.js} +1 -1
- package/dist/assets/dql-notebook/assets/{style-NlN9F6JE.js → style-D6AlWDHX.js} +1 -1
- package/dist/assets/dql-notebook/assets/{triangle-alert-BPHvH1wA.js → triangle-alert-D1WefIrN.js} +1 -1
- package/dist/assets/dql-notebook/assets/{upload-DIqK0KE1.js → upload-CFJjpPL4.js} +1 -1
- package/dist/assets/dql-notebook/assets/{usePersistedAgentThreadId-DpQXOEDw.js → usePersistedAgentThreadId-B5pTglEr.js} +1 -1
- package/dist/assets/dql-notebook/assets/{user-round-DukNupB_.js → user-round-DL6DLw0m.js} +1 -1
- package/dist/assets/dql-notebook/assets/{wand-sparkles-CAwLX0b9.js → wand-sparkles-CNUjLDqT.js} +1 -1
- package/dist/assets/dql-notebook/assets/{workflow-bOT-NqdO.js → workflow-0NUwpoQ4.js} +1 -1
- package/dist/assets/dql-notebook/assets/{wrench-1m0_kcza.js → wrench-QNiznShi.js} +1 -1
- package/dist/assets/dql-notebook/assets/{x-fp82BETM.js → x-BhTl5gZs.js} +1 -1
- package/dist/assets/dql-notebook/index.html +1 -1
- package/dist/commands/agent-eval-cassette.d.ts.map +1 -1
- package/dist/commands/agent-eval-cassette.js +15 -0
- package/dist/commands/agent-eval-cassette.js.map +1 -1
- package/dist/commands/agent-shadow-report.d.ts +17 -0
- package/dist/commands/agent-shadow-report.d.ts.map +1 -0
- package/dist/commands/agent-shadow-report.js +149 -0
- package/dist/commands/agent-shadow-report.js.map +1 -0
- package/dist/commands/agent.d.ts.map +1 -1
- package/dist/commands/agent.js +6 -2
- package/dist/commands/agent.js.map +1 -1
- package/dist/commands/notebook.d.ts +2 -1
- package/dist/commands/notebook.d.ts.map +1 -1
- package/dist/commands/notebook.js +8 -1
- package/dist/commands/notebook.js.map +1 -1
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -1
- package/dist/llm/providers/ask-v2-analyst-prompt.d.ts +32 -0
- package/dist/llm/providers/ask-v2-analyst-prompt.d.ts.map +1 -0
- package/dist/llm/providers/ask-v2-analyst-prompt.js +136 -0
- package/dist/llm/providers/ask-v2-analyst-prompt.js.map +1 -0
- package/dist/llm/providers/dql-agent-provider.d.ts +77 -1
- package/dist/llm/providers/dql-agent-provider.d.ts.map +1 -1
- package/dist/llm/providers/dql-agent-provider.js +4851 -354
- package/dist/llm/providers/dql-agent-provider.js.map +1 -1
- package/dist/llm/types.d.ts +124 -2
- package/dist/llm/types.d.ts.map +1 -1
- package/dist/local-runtime.d.ts +352 -3
- package/dist/local-runtime.d.ts.map +1 -1
- package/dist/local-runtime.js +4916 -238
- package/dist/local-runtime.js.map +1 -1
- package/dist/metricflow.d.ts.map +1 -1
- package/dist/metricflow.js +87 -11
- package/dist/metricflow.js.map +1 -1
- package/dist/package.json +10 -10
- package/dist/providers/oauth/claude-oauth.d.ts +14 -0
- package/dist/providers/oauth/claude-oauth.d.ts.map +1 -1
- package/dist/providers/oauth/claude-oauth.js +32 -5
- package/dist/providers/oauth/claude-oauth.js.map +1 -1
- package/dist/research-lineage-program.d.ts +29 -0
- package/dist/research-lineage-program.d.ts.map +1 -0
- package/dist/research-lineage-program.js +389 -0
- package/dist/research-lineage-program.js.map +1 -0
- package/dist/retrieval-health.d.ts.map +1 -1
- package/dist/retrieval-health.js +5 -2
- package/dist/retrieval-health.js.map +1 -1
- package/dist/semantic-runtime.d.ts.map +1 -1
- package/dist/semantic-runtime.js +73 -2
- package/dist/semantic-runtime.js.map +1 -1
- package/package.json +10 -10
- package/dist/assets/dql-notebook/assets/AskTracePage-CSMoMw9a.js +0 -8
- package/dist/assets/dql-notebook/assets/UnifiedAgentRunPanel-BjsTE6yf.js +0 -89
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The system prompt for the authoritative V2 Ask analyst.
|
|
3
|
+
*
|
|
4
|
+
* V2's whole premise is that the LLM owns business interpretation while DQL
|
|
5
|
+
* owns governance — but the prompt that carried that responsibility was a
|
|
6
|
+
* single sentence listing tool names. A model told only "inspect context, then
|
|
7
|
+
* pick a tier" has no basis for deciding what the question MEANS, when a
|
|
8
|
+
* pronoun is too ambiguous to guess at, or what to do with a typed observation
|
|
9
|
+
* that says a tier cannot serve the request. Those are exactly the decisions
|
|
10
|
+
* the architecture assigns to it.
|
|
11
|
+
*
|
|
12
|
+
* Written as instructions to an analyst, not as a tool manifest. The tool
|
|
13
|
+
* kernel remains the authority on what may be called: this explains the
|
|
14
|
+
* reasoning the kernel cannot express, and never grants permission the kernel
|
|
15
|
+
* would refuse.
|
|
16
|
+
*/
|
|
17
|
+
/**
|
|
18
|
+
* The text-protocol response contract for the V2 analyst.
|
|
19
|
+
*
|
|
20
|
+
* The default contract offers two response shapes, and the second is a final
|
|
21
|
+
* answer carrying raw SQL. In V2 that shape is illegal — the host owns
|
|
22
|
+
* execution — and it is also unparseable: it has no `tool` key, so the loop
|
|
23
|
+
* reads it as prose, retries once, and terminates the turn as
|
|
24
|
+
* ASK_V2_INVALID_TOOL_RESPONSE. A model doing exactly what it was told to do
|
|
25
|
+
* failed every question that needed more than an exact certified match, with
|
|
26
|
+
* zero tool calls recorded. Every legal V2 response is a tool call, so this
|
|
27
|
+
* contract offers exactly that and names the tool that ends the turn.
|
|
28
|
+
*/
|
|
29
|
+
export function buildAskV2TextToolContract(tools, maxToolCalls) {
|
|
30
|
+
const toolLines = tools.map((tool) => {
|
|
31
|
+
const props = tool.inputSchema?.properties;
|
|
32
|
+
const params = props ? Object.keys(props).join(', ') : '';
|
|
33
|
+
return `- ${tool.name}(${params}): ${tool.description}`;
|
|
34
|
+
});
|
|
35
|
+
return [
|
|
36
|
+
'Every response you give is a tool call. Respond with a single ```json fenced object:',
|
|
37
|
+
'',
|
|
38
|
+
'{"tool": "<name>", "input": { ... }}',
|
|
39
|
+
'',
|
|
40
|
+
'Rules:',
|
|
41
|
+
`- You may make at most ${maxToolCalls} tool call(s) this turn.`,
|
|
42
|
+
'- Never answer in prose, and never return SQL as your response. DQL executes;'
|
|
43
|
+
+ ' you decide what to execute by calling a tool.',
|
|
44
|
+
'- Reach the answer with a run tool (run_certified, compile_and_run_semantic,'
|
|
45
|
+
+ ' compile_and_run_dql, or validate_and_run_sql), then call finish_answer to close the turn.',
|
|
46
|
+
'- finish_answer is only for a turn that has already executed or has genuinely exhausted the tiers.'
|
|
47
|
+
+ ' If a tool returns ok:false with safeNextTools, call one of those instead.',
|
|
48
|
+
'- A ranking needs BOTH orderBy and limit in the same call: a limit without an orderBy returns'
|
|
49
|
+
+ ' arbitrary rows, and both are refused when the question asked for no ranking at all.',
|
|
50
|
+
'- Use request_clarification when a choice genuinely changes the result.',
|
|
51
|
+
'- Only reference identifiers a tool has returned to you. Do not invent them.',
|
|
52
|
+
'',
|
|
53
|
+
'Available tools:',
|
|
54
|
+
...toolLines,
|
|
55
|
+
].join('\n');
|
|
56
|
+
}
|
|
57
|
+
/** The turn classes that carry prior-result context worth naming explicitly. */
|
|
58
|
+
const CONVERSATIONAL_TURN_CLASSES = new Set(['prior_result', 'clarification_response']);
|
|
59
|
+
export function buildAskV2AnalystSystemPrompt(state) {
|
|
60
|
+
const sections = [
|
|
61
|
+
[
|
|
62
|
+
'You are the analyst for a governed analytics system. You decide what the question means in business terms,',
|
|
63
|
+
'which governed asset answers it, and how to explain the result. DQL owns governance: it validates identifiers,',
|
|
64
|
+
'proves relationships, compiles queries, freezes plans, executes them, and assigns trust. You never assign a',
|
|
65
|
+
'trust label, invent an identifier, or bypass a refusal.',
|
|
66
|
+
].join(' '),
|
|
67
|
+
[
|
|
68
|
+
'ROUTE IN THIS ORDER, and prefer the highest tier that genuinely answers the question:',
|
|
69
|
+
'1. A certified block — a governed contract someone has already reviewed and approved. Prefer it whenever it',
|
|
70
|
+
'answers the question as asked.',
|
|
71
|
+
'2. The semantic layer — compiled business meaning. Use it when a governed metric and admitted dimensions cover',
|
|
72
|
+
'the request.',
|
|
73
|
+
'3. Governed relational/DQL — when the semantic layer cannot express the shape but the relationships are proven.',
|
|
74
|
+
'4. Exploratory SQL — the last resort, always labelled review-required.',
|
|
75
|
+
'Do not skip a tier because a lower one looks easier, and do not force a higher tier that does not fit.',
|
|
76
|
+
].join(' '),
|
|
77
|
+
[
|
|
78
|
+
'A FAILED TOOL CALL IS INFORMATION, NOT A DEAD END. Observations are typed and tell you what to try next:',
|
|
79
|
+
'no certified fit means inspect the semantic layer; a semantic incompatibility means inspect relational context;',
|
|
80
|
+
'no governed path means inspect the qualified physical schema; a SQL identifier or syntax error means correct it',
|
|
81
|
+
'once. Only an authorization denial, an unsafe join, a stale snapshot, an exhausted budget, or genuinely absent',
|
|
82
|
+
'evidence should stop you before a plan is frozen.',
|
|
83
|
+
].join(' '),
|
|
84
|
+
[
|
|
85
|
+
'WHEN A TOOL RETURNS ok:false, READ safeNextTools AND CALL ONE OF THEM ON YOUR NEXT TURN.',
|
|
86
|
+
'That field is the host telling you the one move that can still succeed. Never repeat a call that was just',
|
|
87
|
+
'refused — repeating it cannot change the answer and spends the budget the working path needed.',
|
|
88
|
+
'A refused finish_answer means the turn is NOT finished: you have not yet reached a tier that can execute.',
|
|
89
|
+
].join(' '),
|
|
90
|
+
[
|
|
91
|
+
'WORK DOWN THE LADDER BEFORE CONCLUDING ANYTHING IS MISSING. One tier failing says nothing about the next:',
|
|
92
|
+
'a metric that will not compile semantically is very often answerable through governed relational/DQL, and',
|
|
93
|
+
'failing that, through review-required exploratory SQL. Only after the lower tiers have actually been tried',
|
|
94
|
+
'and refused may you report a gap. Reporting "not modeled" while an untried tier remains is a wrong answer,',
|
|
95
|
+
'not a cautious one.',
|
|
96
|
+
].join(' '),
|
|
97
|
+
[
|
|
98
|
+
'USE IDENTIFIERS EXACTLY AS A TOOL RETURNED THEM. Copy metric, dimension, relation and path IDs verbatim from',
|
|
99
|
+
'the inspect results — never abbreviate, re-case, guess, or construct one that looks plausible. An identifier',
|
|
100
|
+
'the snapshot did not admit is refused, and that refusal costs a turn.',
|
|
101
|
+
].join(' '),
|
|
102
|
+
[
|
|
103
|
+
'BE TRUTHFUL ABOUT WHAT IS MISSING, once you have earned that conclusion. If the business has not modeled what',
|
|
104
|
+
'was asked for, say exactly that and name the closest governed alternative — never imply the data merely could',
|
|
105
|
+
'not be retrieved, and never claim something is unmodeled when it was only pruned from the candidates you were',
|
|
106
|
+
'shown. Do not claim any result until a run tool has actually returned an executed result.',
|
|
107
|
+
].join(' '),
|
|
108
|
+
[
|
|
109
|
+
'ASK ONE GOOD QUESTION RATHER THAN GUESSING. When a reference could mean several things, call request_clarification',
|
|
110
|
+
'with the concrete choices you found. One precise question is a good answer; a silently chosen member is a wrong',
|
|
111
|
+
'answer the user cannot see. Ask at most once, and only when the choice genuinely changes the result.',
|
|
112
|
+
].join(' '),
|
|
113
|
+
];
|
|
114
|
+
if (CONVERSATIONAL_TURN_CLASSES.has(state.turnClass)) {
|
|
115
|
+
sections.push([
|
|
116
|
+
'THIS TURN CONTINUES THE PREVIOUS ANSWER. Call inspect_conversation_result FIRST and work from what it returns:',
|
|
117
|
+
'the columns, the members, and the selection the user has already made. A pronoun or a bare name refers to that',
|
|
118
|
+
'result. If the host has already bound one member, it is authoritative — use it. If several members could match,',
|
|
119
|
+
'ask which one. Never re-derive the prior answer from the question text alone.',
|
|
120
|
+
].join(' '));
|
|
121
|
+
}
|
|
122
|
+
sections.push([
|
|
123
|
+
'ONLY BIND TIME WHEN THE QUESTION ASKS FOR IT. "Revenue by month", "last quarter" and "the trend" are time',
|
|
124
|
+
'questions; "who are the top customers by revenue" is not. When the question does ask for time, send both an',
|
|
125
|
+
'admitted timeDimensionId AND a grain that THAT axis declares — take both from the same admittedTimeDimensions',
|
|
126
|
+
'entry, because a grain declared on a different axis is refused just as a made-up one is. When it',
|
|
127
|
+
'does not, omit both fields entirely rather than supplying a default: an unnecessary time binding is refused',
|
|
128
|
+
'just as firmly as a wrong one, and it costs the same turn.',
|
|
129
|
+
].join(' '));
|
|
130
|
+
sections.push([
|
|
131
|
+
'Never write SQL outside validate_and_run_sql. Use only the supplied canonical Ask tools, and only the',
|
|
132
|
+
'identifiers they returned to you.',
|
|
133
|
+
].join(' '));
|
|
134
|
+
return sections.join('\n\n');
|
|
135
|
+
}
|
|
136
|
+
//# sourceMappingURL=ask-v2-analyst-prompt.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ask-v2-analyst-prompt.js","sourceRoot":"","sources":["../../../src/llm/providers/ask-v2-analyst-prompt.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAIH;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,0BAA0B,CACxC,KAAqC,EACrC,YAAoB;IAEpB,MAAM,SAAS,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE;QACnC,MAAM,KAAK,GAAI,IAAI,CAAC,WAAoE,EAAE,UAAU,CAAC;QACrG,MAAM,MAAM,GAAG,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;QAC1D,OAAO,KAAK,IAAI,CAAC,IAAI,IAAI,MAAM,MAAM,IAAI,CAAC,WAAW,EAAE,CAAC;IAC1D,CAAC,CAAC,CAAC;IACH,OAAO;QACL,sFAAsF;QACtF,EAAE;QACF,sCAAsC;QACtC,EAAE;QACF,QAAQ;QACR,0BAA0B,YAAY,0BAA0B;QAChE,+EAA+E;cAC3E,gDAAgD;QACpD,8EAA8E;cAC1E,4FAA4F;QAChG,oGAAoG;cACh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CAAC,GAAG,CAAC,KAAK,CAAC,SAAS,CAAC,EAAE,CAAC;QACrD,QAAQ,CAAC,IAAI,CAAC;YACZ,gHAAgH;YAChH,gHAAgH;YAChH,iHAAiH;YACjH,+EAA+E;SAChF,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;IACf,CAAC;IAED,QAAQ,CAAC,IAAI,CAAC;QACZ,2GAA2G;QAC3G,6GAA6G;QAC7G,+GAA+G;QAC/G,kGAAkG;QAClG,6GAA6G;QAC7G,4DAA4D;KAC7D,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;IAEb,QAAQ,CAAC,IAAI,CAAC;QACZ,uGAAuG;QACvG,mCAAmC;KACpC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;IAEb,OAAO,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;AAC/B,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type ProviderFailureDiagnosticV1 } from '@duckcodeailabs/dql-agent';
|
|
2
|
-
import { type AgentAnswer, type CertifiedFitConfirmation, type AgentFollowUpContext, type AgentProvider, type ConversationSnapshot, type LocalContextPack, type AgenticLane } from '@duckcodeailabs/dql-agent';
|
|
2
|
+
import { type AgentAnswer, type CertifiedFitConfirmation, type AgentFollowUpContext, type AgentProvider, type ConversationSnapshot, type LocalContextPack, type AgenticLane, type OrchestratorPolicy, type AskAgentStateV4, type AskSemanticCapabilityHandleV1, type AskV2ResearchBranchReceiptInput, type AgentEvidenceCandidate, type AnswerLoopInput } from '@duckcodeailabs/dql-agent';
|
|
3
3
|
import type { AgentRunRequest, AgentRunner, ProviderId } from '../types.js';
|
|
4
4
|
import { buildAnswerLoopTools } from '../answer-loop-tools.js';
|
|
5
5
|
/**
|
|
@@ -20,6 +20,69 @@ declare function providerBoundaryDiagnostic(input: {
|
|
|
20
20
|
error?: unknown;
|
|
21
21
|
code?: string;
|
|
22
22
|
}): ProviderFailureDiagnosticV1;
|
|
23
|
+
type V2SemanticCapabilityRole = 'metric' | 'dimension' | 'time_dimension' | 'filter_dimension';
|
|
24
|
+
/**
|
|
25
|
+
* V2 normally receives opaque qualified IDs. Some native/text tool callers
|
|
26
|
+
* still submit a compiler-facing runtime name from the safe card. Accept
|
|
27
|
+
* only a unique, exact runtime-name match from the currently visible,
|
|
28
|
+
* snapshot-bound capability set; this is not alias or lexical resolution.
|
|
29
|
+
*
|
|
30
|
+
* When a concrete semantic metric and a generic semantic measure share a
|
|
31
|
+
* runtime name, prefer the concrete metric. A tie at the same authority
|
|
32
|
+
* level remains ambiguous and is rejected pre-freeze.
|
|
33
|
+
*/
|
|
34
|
+
declare function resolveV2SemanticCapabilityReference(input: {
|
|
35
|
+
reference: string;
|
|
36
|
+
role: V2SemanticCapabilityRole;
|
|
37
|
+
candidates: readonly AgentEvidenceCandidate[];
|
|
38
|
+
capabilities: ReadonlyMap<string, AskSemanticCapabilityHandleV1> | undefined;
|
|
39
|
+
}): string | undefined;
|
|
40
|
+
/**
|
|
41
|
+
* The V2 serving controller intentionally does not call `answer()`.
|
|
42
|
+
*
|
|
43
|
+
* Every canonical tool consumes explicit, snapshot-qualified arguments. The
|
|
44
|
+
* model owns business interpretation; this adapter owns identifier admission,
|
|
45
|
+
* priority, compiler/executor boundaries, and trusted receipts. It never
|
|
46
|
+
* searches the mutable KG or reads a V1 precomputed route/plan.
|
|
47
|
+
*/
|
|
48
|
+
declare function createAskV2LaneHandler(state: AskAgentStateV4, limits?: {
|
|
49
|
+
maxToolCalls?: number;
|
|
50
|
+
maxProviderDispatches?: number;
|
|
51
|
+
}): (input: AnswerLoopInput) => Promise<AgentAnswer>;
|
|
52
|
+
interface AskV2ResearchHypothesis {
|
|
53
|
+
id: string;
|
|
54
|
+
kind: 'analytical' | 'lineage';
|
|
55
|
+
question: string;
|
|
56
|
+
/** Optional opaque host handle for an already-frozen analytical child. */
|
|
57
|
+
frozenChildId?: string;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Parse only a provider-authored explicit research plan. There is no
|
|
61
|
+
* heuristic branch generation here: a malformed or too-thin plan remains a
|
|
62
|
+
* limited-scope observation instead of pretending that several hypotheses
|
|
63
|
+
* were investigated.
|
|
64
|
+
*/
|
|
65
|
+
declare function parseAskV2ResearchHypotheses(text: string): AskV2ResearchHypothesis[];
|
|
66
|
+
/**
|
|
67
|
+
* A Research analytical branch is supported only when a host execution has a
|
|
68
|
+
* complete, internally consistent receipt or an already-built deterministic
|
|
69
|
+
* fact set. A tool merely returning `executed` is not evidence: that fact
|
|
70
|
+
* can exist before a result contract is persisted, and it must not turn an
|
|
71
|
+
* empty/failed/cancelled branch into a research conclusion.
|
|
72
|
+
*/
|
|
73
|
+
declare function askV2ResearchAnalyticalBranchReceipt(input: {
|
|
74
|
+
id: string;
|
|
75
|
+
child: AskAgentStateV4;
|
|
76
|
+
answer: AgentAnswer;
|
|
77
|
+
}): AskV2ResearchBranchReceiptInput;
|
|
78
|
+
/**
|
|
79
|
+
* Explicit Research remains one V2 runtime: the provider first proposes real
|
|
80
|
+
* hypotheses from the immutable safe cards, each analytical child runs an
|
|
81
|
+
* isolated V2 cascade, and lineage receives its own snapshot program. No
|
|
82
|
+
* legacy research controller, V1 answer loop, or fabricated branch list is
|
|
83
|
+
* involved.
|
|
84
|
+
*/
|
|
85
|
+
declare function createAskV2ResearchLaneHandler(state: AskAgentStateV4): (input: AnswerLoopInput) => Promise<AgentAnswer>;
|
|
23
86
|
declare function createCertifiedFitConfirmation(provider: AgentProvider, signal?: AbortSignal): CertifiedFitConfirmation;
|
|
24
87
|
/**
|
|
25
88
|
* Decide whether the answer path needs a live warehouse-schema read up front.
|
|
@@ -50,6 +113,13 @@ declare function readAgentConfig(projectRoot: string): Record<string, unknown> |
|
|
|
50
113
|
* retrieval evidence lives.
|
|
51
114
|
*/
|
|
52
115
|
declare function agenticLaneForRequest(req: AgentRunRequest): AgenticLane;
|
|
116
|
+
/**
|
|
117
|
+
* V2 is selected by the server-side Ask runtime, not a project setting or a
|
|
118
|
+
* browser request. This is the single handoff that makes the bounded analyst
|
|
119
|
+
* tool loop authoritative for a V2 free-text turn while preserving V1's
|
|
120
|
+
* explicit project-config migration behaviour.
|
|
121
|
+
*/
|
|
122
|
+
declare function orchestratorPolicyForRequest(req: AgentRunRequest): OrchestratorPolicy;
|
|
53
123
|
export declare function applyEvalCassette(provider: AgentProvider, projectRoot: string): AgentProvider;
|
|
54
124
|
/**
|
|
55
125
|
* Create a replay-only provider when the runtime is launched for an offline
|
|
@@ -119,6 +189,8 @@ export declare function resolveAgentFollowUpContext(rawContext: Record<string, u
|
|
|
119
189
|
declare function followUpFromConversationContext(req: AgentRunRequest, question: string): AgentFollowUpContext | undefined;
|
|
120
190
|
export declare const __test__: {
|
|
121
191
|
agenticLaneForRequest: typeof agenticLaneForRequest;
|
|
192
|
+
resolveV2SemanticCapabilityReference: typeof resolveV2SemanticCapabilityReference;
|
|
193
|
+
orchestratorPolicyForRequest: typeof orchestratorPolicyForRequest;
|
|
122
194
|
applyTopicShiftGuard: typeof applyTopicShiftGuard;
|
|
123
195
|
isDrilldownFollowUp: typeof isDrilldownFollowUp;
|
|
124
196
|
buildAnswerLoopTools: typeof buildAnswerLoopTools;
|
|
@@ -134,6 +206,10 @@ export declare const __test__: {
|
|
|
134
206
|
researchDispatchPurposeForTool: typeof researchDispatchPurposeForTool;
|
|
135
207
|
readAgentConfig: typeof readAgentConfig;
|
|
136
208
|
providerBoundaryDiagnostic: typeof providerBoundaryDiagnostic;
|
|
209
|
+
createAskV2LaneHandler: typeof createAskV2LaneHandler;
|
|
210
|
+
createAskV2ResearchLaneHandler: typeof createAskV2ResearchLaneHandler;
|
|
211
|
+
parseAskV2ResearchHypotheses: typeof parseAskV2ResearchHypotheses;
|
|
212
|
+
askV2ResearchAnalyticalBranchReceipt: typeof askV2ResearchAnalyticalBranchReceipt;
|
|
137
213
|
};
|
|
138
214
|
declare function researchDispatchPurposeForTool(toolName: string): 'research_narration' | 'research_tool';
|
|
139
215
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dql-agent-provider.d.ts","sourceRoot":"","sources":["../../../src/llm/providers/dql-agent-provider.ts"],"names":[],"mappings":"AAAA,OAAO,EAUL,KAAK,2BAA2B,EACjC,MAAM,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"dql-agent-provider.d.ts","sourceRoot":"","sources":["../../../src/llm/providers/dql-agent-provider.ts"],"names":[],"mappings":"AAAA,OAAO,EAUL,KAAK,2BAA2B,EACjC,MAAM,2BAA2B,CAAC;AAInC,OAAO,EAoBL,KAAK,WAAW,EAEhB,KAAK,wBAAwB,EAE7B,KAAK,oBAAoB,EAIzB,KAAK,aAAa,EAGlB,KAAK,oBAAoB,EAEzB,KAAK,gBAAgB,EAoCrB,KAAK,WAAW,EAChB,KAAK,kBAAkB,EACvB,KAAK,eAAe,EAIpB,KAAK,6BAA6B,EAIlC,KAAK,+BAA+B,EACpC,KAAK,sBAAsB,EAE3B,KAAK,eAAe,EAErB,MAAM,2BAA2B,CAAC;AAkBnC,OAAO,KAAK,EAAE,eAAe,EAAE,WAAW,EAA4B,UAAU,EAAE,MAAM,aAAa,CAAC;AACtG,OAAO,EAAE,oBAAoB,EAAkC,MAAM,yBAAyB,CAAC;AAQ/F;;;;GAIG;AACH,KAAK,gBAAgB,GACjB,OAAO,CAAC,UAAU,EAAE,WAAW,GAAG,QAAQ,GAAG,QAAQ,GAAG,QAAQ,GAAG,eAAe,CAAC,GACnF,aAAa,GACb,OAAO,CAAC;AAoFZ;;;;GAIG;AACH,iBAAS,0BAA0B,CAAC,KAAK,EAAE;IACzC,UAAU,EAAE,gBAAgB,CAAC;IAC7B,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,2BAA2B,CAAC,OAAO,CAAC,CAAC;IAC5C,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,GAAG,2BAA2B,CA0B9B;AA2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