@duckcodeailabs/dql-cli 1.6.6 → 1.6.8

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.
@@ -2619,7 +2619,7 @@ export async function startLocalServer(opts) {
2619
2619
  res.end(serializeJSON({ error: 'Invalid JSON body' }));
2620
2620
  return;
2621
2621
  }
2622
- const { provider, messages, upstream } = body;
2622
+ const { provider, messages, upstream, conversationContext } = body;
2623
2623
  const resolvedProvider = isLLMProviderId(provider) ? provider : resolveDefaultLLMProvider(projectRoot);
2624
2624
  const runner = resolvedProvider ? getLLMRunner(resolvedProvider) : null;
2625
2625
  if (!resolvedProvider || !runner) {
@@ -2645,6 +2645,9 @@ export async function startLocalServer(opts) {
2645
2645
  provider: resolvedProvider,
2646
2646
  messages,
2647
2647
  upstream,
2648
+ conversationContext: conversationContext && typeof conversationContext === 'object' && !Array.isArray(conversationContext)
2649
+ ? conversationContext
2650
+ : undefined,
2648
2651
  projectRoot,
2649
2652
  executeCertifiedBlock: executeCertifiedBlockForAgent,
2650
2653
  executeGeneratedSql: executeGeneratedSqlForAgent,
@@ -3048,8 +3051,8 @@ export async function startLocalServer(opts) {
3048
3051
  const graph = buildProjectLineageGraph(projectRoot, semanticLayer);
3049
3052
  const node = resolveLineageNode(graph, rawNodeId);
3050
3053
  if (!node) {
3051
- res.writeHead(404, { 'Content-Type': 'application/json; charset=utf-8' });
3052
- res.end(serializeJSON({ error: `Lineage node "${rawNodeId}" not found` }));
3054
+ res.writeHead(200, { 'Content-Type': 'application/json; charset=utf-8' });
3055
+ res.end(serializeJSON({ node: null, incoming: [], outgoing: [] }));
3053
3056
  return;
3054
3057
  }
3055
3058
  res.writeHead(200, { 'Content-Type': 'application/json; charset=utf-8' });
@@ -3143,8 +3146,8 @@ export async function startLocalServer(opts) {
3143
3146
  const maxPaths = Number(url.searchParams.get('maxPaths') ?? '20') || 20;
3144
3147
  const result = queryCompleteLineagePaths(graph, rawNodeId, { maxDepth, maxPaths });
3145
3148
  if (!result) {
3146
- res.writeHead(404, { 'Content-Type': 'application/json; charset=utf-8' });
3147
- res.end(serializeJSON({ error: `Node "${rawNodeId}" not found` }));
3149
+ res.writeHead(200, { 'Content-Type': 'application/json; charset=utf-8' });
3150
+ res.end('null');
3148
3151
  return;
3149
3152
  }
3150
3153
  res.writeHead(200, { 'Content-Type': 'application/json; charset=utf-8' });
@@ -3296,10 +3299,7 @@ table: ${table}${tagList}
3296
3299
  return;
3297
3300
  }
3298
3301
  const content = readFileSync(filePath);
3299
- res.writeHead(200, {
3300
- 'Content-Type': contentTypeFor(filePath),
3301
- 'Cache-Control': 'no-store, max-age=0',
3302
- });
3302
+ res.writeHead(200, { 'Content-Type': contentTypeFor(filePath) });
3303
3303
  res.end(content);
3304
3304
  });
3305
3305
  return new Promise((resolvePromise, reject) => {
@@ -6871,13 +6871,13 @@ function isAgentValueProbeColumn(column) {
6871
6871
  return true;
6872
6872
  return /\b(char|character|clob|email|string|text|uuid|varchar)\b/.test(type);
6873
6873
  }
6874
- function buildAgentValueProbeSql(table, column, searchTerms, connection) {
6874
+ export function buildAgentValueProbeSql(table, column, searchTerms, connection) {
6875
6875
  const relation = quoteAgentRelation(table.relation, connection);
6876
6876
  const identifier = quoteAgentIdentifier(column, connection);
6877
6877
  const castValue = `LOWER(CAST(${identifier} AS ${agentTextCastType(connection.driver)}))`;
6878
6878
  const predicates = searchTerms
6879
6879
  .slice(0, 5)
6880
- .map((term) => `${castValue} LIKE ${sqlStringLiteral(`%${escapeSqlLike(term.toLowerCase())}%`)} ESCAPE '\\\\'`)
6880
+ .map((term) => `${castValue} LIKE ${sqlStringLiteral(`%${escapeSqlLike(term.toLowerCase())}%`)} ESCAPE '\\'`)
6881
6881
  .join(' OR ');
6882
6882
  return [
6883
6883
  `SELECT DISTINCT CAST(${identifier} AS ${agentTextCastType(connection.driver)}) AS value`,