@duckcodeailabs/dql-cli 0.8.11 → 0.8.12
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/assets/dql-notebook/assets/index-8LrBWmPy.js +564 -0
- package/dist/assets/dql-notebook/index.html +1 -1
- package/dist/local-runtime.d.ts.map +1 -1
- package/dist/local-runtime.js +33 -1
- package/dist/local-runtime.js.map +1 -1
- package/dist/package.json +45 -0
- package/package.json +8 -8
- package/dist/assets/dql-notebook/assets/index-Cxj__xjY.js +0 -564
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
<link rel="preconnect" href="https://fonts.googleapis.com" />
|
|
8
8
|
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
|
|
9
9
|
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap" rel="stylesheet" />
|
|
10
|
-
<script type="module" crossorigin src="/assets/index-
|
|
10
|
+
<script type="module" crossorigin src="/assets/index-8LrBWmPy.js"></script>
|
|
11
11
|
<link rel="modulepreload" crossorigin href="/assets/react-CRB3T2We.js">
|
|
12
12
|
<link rel="modulepreload" crossorigin href="/assets/codemirror-CCrEt63p.js">
|
|
13
13
|
<link rel="stylesheet" crossorigin href="/assets/index-BZV40eAE.css">
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"local-runtime.d.ts","sourceRoot":"","sources":["../src/local-runtime.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,aAAa,EAAE,KAAK,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAUtF,OAAO,
|
|
1
|
+
{"version":3,"file":"local-runtime.d.ts","sourceRoot":"","sources":["../src/local-runtime.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,aAAa,EAAE,KAAK,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAUtF,OAAO,EAcL,KAAK,aAAa,EAClB,KAAK,2BAA2B,EAKjC,MAAM,0BAA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AAC,EAAE,MAAM,CAAC;CACnB,GACA;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,aAAa,EAAE,MAAM,CAAA;CAAE,CAyC1D;AAED,wBAAgB,0BAA0B,CACxC,WAAW,EAAE,MAAM,EACnB,OAAO,EAAE;IACP,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,aAAa,CAAC,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,WAAW,EAAE,MAAM,CAAA;KAAE,CAAC;IACtD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,UAAU,GAAG,QAAQ,CAAC;IACjC,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;CAClB,GACA;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,aAAa,EAAE,MAAM,CAAA;CAAE,CAyC1D"}
|
package/dist/local-runtime.js
CHANGED
|
@@ -2,7 +2,7 @@ import { createServer } from 'node:http';
|
|
|
2
2
|
import { existsSync, mkdirSync, readdirSync, readFileSync, rmSync, statSync, watch, writeFileSync } from 'node:fs';
|
|
3
3
|
import { dirname, extname, join, normalize, relative, resolve } from 'node:path';
|
|
4
4
|
import { buildExecutionPlan, createWelcomeNotebook, deserializeNotebook, getConnectorFormSchemas, hasSemanticRefs, resolveSemanticRefs, } from '@duckcodeailabs/dql-notebook';
|
|
5
|
-
import { loadSemanticLayerFromDir, resolveSemanticLayerAsync, Parser, buildLineageGraph, buildManifest, analyzeImpact, buildTrustChain, detectDomainFlows, getDomainTrustOverview, queryLineage, LineageGraph, } from '@duckcodeailabs/dql-core';
|
|
5
|
+
import { loadSemanticLayerFromDir, resolveSemanticLayerAsync, Parser, buildLineageGraph, buildManifest, analyzeImpact, buildTrustChain, detectDomainFlows, getDomainTrustOverview, queryLineage, queryCompleteLineagePaths, LineageGraph, } from '@duckcodeailabs/dql-core';
|
|
6
6
|
import { listBlockTemplates } from './block-templates.js';
|
|
7
7
|
import { buildSemanticObjectDetail, buildSemanticTree, computeSyncDiff, loadSemanticImportManifest, performSemanticImport, previewSemanticImport, syncSemanticImport, } from './semantic-import.js';
|
|
8
8
|
export async function startLocalServer(opts) {
|
|
@@ -1596,6 +1596,27 @@ export async function startLocalServer(opts) {
|
|
|
1596
1596
|
}
|
|
1597
1597
|
return;
|
|
1598
1598
|
}
|
|
1599
|
+
if (req.method === 'GET' && path.startsWith('/api/lineage/paths/')) {
|
|
1600
|
+
const rawNodeId = decodeURIComponent(path.slice('/api/lineage/paths/'.length));
|
|
1601
|
+
try {
|
|
1602
|
+
const graph = buildProjectLineageGraph(projectRoot, semanticLayer);
|
|
1603
|
+
const maxDepth = Number(url.searchParams.get('maxDepth') ?? '10') || 10;
|
|
1604
|
+
const maxPaths = Number(url.searchParams.get('maxPaths') ?? '20') || 20;
|
|
1605
|
+
const result = queryCompleteLineagePaths(graph, rawNodeId, { maxDepth, maxPaths });
|
|
1606
|
+
if (!result) {
|
|
1607
|
+
res.writeHead(404, { 'Content-Type': 'application/json; charset=utf-8' });
|
|
1608
|
+
res.end(serializeJSON({ error: `Node "${rawNodeId}" not found` }));
|
|
1609
|
+
return;
|
|
1610
|
+
}
|
|
1611
|
+
res.writeHead(200, { 'Content-Type': 'application/json; charset=utf-8' });
|
|
1612
|
+
res.end(serializeJSON(result));
|
|
1613
|
+
}
|
|
1614
|
+
catch (error) {
|
|
1615
|
+
res.writeHead(500, { 'Content-Type': 'application/json; charset=utf-8' });
|
|
1616
|
+
res.end(serializeJSON({ error: error instanceof Error ? error.message : String(error) }));
|
|
1617
|
+
}
|
|
1618
|
+
return;
|
|
1619
|
+
}
|
|
1599
1620
|
if (req.method === 'GET' && path === '/api/lineage/trust-chain') {
|
|
1600
1621
|
const from = url.searchParams.get('from');
|
|
1601
1622
|
const to = url.searchParams.get('to');
|
|
@@ -2951,7 +2972,18 @@ function buildNotebookTemplate(title, template) {
|
|
|
2951
2972
|
return JSON.stringify({ version: 1, title, cells }, null, 2);
|
|
2952
2973
|
}
|
|
2953
2974
|
/** Build a lineage graph from the project's blocks and semantic layer. */
|
|
2975
|
+
// Simple lineage graph cache: rebuilds at most every 5 seconds
|
|
2976
|
+
let _lineageCache = null;
|
|
2977
|
+
const LINEAGE_CACHE_TTL_MS = 5000;
|
|
2954
2978
|
function buildProjectLineageGraph(projectRoot, semanticLayer) {
|
|
2979
|
+
if (_lineageCache && Date.now() - _lineageCache.builtAt < LINEAGE_CACHE_TTL_MS) {
|
|
2980
|
+
return _lineageCache.graph;
|
|
2981
|
+
}
|
|
2982
|
+
const graph = buildProjectLineageGraphUncached(projectRoot, semanticLayer);
|
|
2983
|
+
_lineageCache = { graph, builtAt: Date.now() };
|
|
2984
|
+
return graph;
|
|
2985
|
+
}
|
|
2986
|
+
function buildProjectLineageGraphUncached(projectRoot, semanticLayer) {
|
|
2955
2987
|
const manifestPath = join(projectRoot, 'dql-manifest.json');
|
|
2956
2988
|
if (existsSync(manifestPath)) {
|
|
2957
2989
|
try {
|