@kaelio/ktx 0.7.0 → 0.8.0
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/assets/python/{kaelio_ktx-0.7.0-py3-none-any.whl → kaelio_ktx-0.8.0-py3-none-any.whl} +0 -0
- package/assets/python/manifest.json +4 -4
- package/dist/.tsbuildinfo +1 -1
- package/dist/cli-program.js +7 -0
- package/dist/command-schemas.d.ts +1 -1
- package/dist/command-tree.js +5 -1
- package/dist/commands/completion-commands.d.ts +3 -0
- package/dist/commands/completion-commands.js +38 -0
- package/dist/commands/ingest-commands.js +0 -4
- package/dist/commands/knowledge-commands.js +15 -2
- package/dist/commands/setup-commands.js +2 -2
- package/dist/commands/sl-commands.js +19 -7
- package/dist/completion/complete-engine.d.ts +19 -0
- package/dist/completion/complete-engine.js +128 -0
- package/dist/completion/completion-scripts.d.ts +1 -0
- package/dist/completion/completion-scripts.js +36 -0
- package/dist/completion/dynamic-candidates.d.ts +6 -0
- package/dist/completion/dynamic-candidates.js +98 -0
- package/dist/connection-drivers.d.ts +3 -0
- package/dist/connection-drivers.js +17 -0
- package/dist/context/ingest/ingest-bundle.runner.d.ts +8 -0
- package/dist/context/ingest/ingest-bundle.runner.js +72 -15
- package/dist/context/ingest/ingest-profile.d.ts +102 -0
- package/dist/context/ingest/ingest-profile.js +306 -0
- package/dist/context/ingest/isolated-diff/work-unit-executor.js +25 -2
- package/dist/context/ingest/local-bundle-runtime.js +1 -0
- package/dist/context/ingest/local-ingest.d.ts +1 -1
- package/dist/context/ingest/local-ingest.js +6 -4
- package/dist/context/ingest/memory-flow/events.js +2 -1
- package/dist/context/ingest/ports.d.ts +2 -0
- package/dist/context/ingest/reports.d.ts +3 -0
- package/dist/context/ingest/reports.js +10 -0
- package/dist/context/ingest/stages/stage-3-work-units.d.ts +3 -1
- package/dist/context/ingest/stages/stage-3-work-units.js +2 -0
- package/dist/context/ingest/stages/stage-4-reconciliation.d.ts +2 -1
- package/dist/context/ingest/stages/stage-4-reconciliation.js +1 -1
- package/dist/context/ingest/tools/tool-call-logger.d.ts +6 -0
- package/dist/context/ingest/tools/tool-call-logger.js +36 -1
- package/dist/context/llm/ai-sdk-runtime.js +32 -3
- package/dist/context/llm/claude-code-runtime.js +35 -2
- package/dist/context/llm/runtime-port.d.ts +25 -0
- package/dist/context/mcp/context-tools.d.ts +2 -1
- package/dist/context/mcp/context-tools.js +82 -15
- package/dist/context/mcp/server.js +4 -0
- package/dist/context/mcp/types.d.ts +15 -1
- package/dist/context/project/config.d.ts +1 -0
- package/dist/context/project/config.js +4 -0
- package/dist/context/project/driver-schemas.js +1 -1
- package/dist/context/search/discover.js +4 -3
- package/dist/context/sl/local-sl.d.ts +15 -0
- package/dist/context/sl/local-sl.js +30 -0
- package/dist/context/wiki/local-knowledge.d.ts +10 -0
- package/dist/context/wiki/local-knowledge.js +22 -0
- package/dist/context-build-view.d.ts +0 -3
- package/dist/context-build-view.js +1 -7
- package/dist/ingest.js +7 -10
- package/dist/knowledge.d.ts +5 -0
- package/dist/knowledge.js +10 -1
- package/dist/public-ingest-copy.js +1 -1
- package/dist/public-ingest.d.ts +0 -7
- package/dist/public-ingest.js +20 -34
- package/dist/setup-context.js +6 -38
- package/dist/setup-databases.js +13 -82
- package/dist/setup-sources.js +33 -5
- package/dist/setup.js +2 -2
- package/dist/skills/analytics/SKILL.md +6 -1
- package/dist/sl.d.ts +6 -1
- package/dist/sl.js +32 -8
- package/dist/telemetry/emitter.js +1 -1
- package/dist/telemetry/events.d.ts +4 -3
- package/dist/telemetry/events.js +7 -3
- package/dist/telemetry/identity.d.ts +1 -1
- package/dist/telemetry/identity.js +13 -10
- package/dist/telemetry/index.d.ts +1 -1
- package/dist/telemetry/index.js +5 -1
- package/package.json +22 -22
- package/dist/ingest-depth.d.ts +0 -8
- package/dist/ingest-depth.js +0 -56
- package/dist/setup-database-context-depth.d.ts +0 -23
- package/dist/setup-database-context-depth.js +0 -84
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kaelio/ktx",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.0",
|
|
4
4
|
"description": "Standalone ktx context layer for data agents",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"engines": {
|
|
@@ -28,36 +28,36 @@
|
|
|
28
28
|
"provenance": true
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@ai-sdk/anthropic": "3.0.
|
|
32
|
-
"@ai-sdk/devtools": "0.0.
|
|
33
|
-
"@ai-sdk/google-vertex": "^4.0.
|
|
34
|
-
"@anthropic-ai/claude-agent-sdk": "0.3.
|
|
31
|
+
"@ai-sdk/anthropic": "3.0.78",
|
|
32
|
+
"@ai-sdk/devtools": "0.0.18",
|
|
33
|
+
"@ai-sdk/google-vertex": "^4.0.134",
|
|
34
|
+
"@anthropic-ai/claude-agent-sdk": "0.3.146",
|
|
35
35
|
"@clack/prompts": "1.4.0",
|
|
36
|
-
"@clickhouse/client": "^1.18.
|
|
36
|
+
"@clickhouse/client": "^1.18.5",
|
|
37
37
|
"@commander-js/extra-typings": "14.0.0",
|
|
38
38
|
"@google-cloud/bigquery": "^8.3.1",
|
|
39
39
|
"@looker/sdk": "^26.8.0",
|
|
40
40
|
"@looker/sdk-node": "^26.8.0",
|
|
41
41
|
"@looker/sdk-rtl": "^21.6.5",
|
|
42
42
|
"@modelcontextprotocol/sdk": "^1.29.0",
|
|
43
|
-
"@notionhq/client": "^5.
|
|
44
|
-
"ai": "^6.0.
|
|
43
|
+
"@notionhq/client": "^5.22.0",
|
|
44
|
+
"ai": "^6.0.188",
|
|
45
45
|
"better-sqlite3": "^12.10.0",
|
|
46
46
|
"commander": "14.0.3",
|
|
47
|
-
"fflate": "^0.8.
|
|
47
|
+
"fflate": "^0.8.3",
|
|
48
48
|
"handlebars": "^4.7.9",
|
|
49
|
-
"ink": "^7.0.
|
|
49
|
+
"ink": "^7.0.3",
|
|
50
50
|
"lookml-parser": "7.1.0",
|
|
51
51
|
"minimatch": "^10.2.5",
|
|
52
|
-
"mssql": "^12.5.
|
|
52
|
+
"mssql": "^12.5.4",
|
|
53
53
|
"mysql2": "^3.22.3",
|
|
54
|
-
"openai": "^6.
|
|
54
|
+
"openai": "^6.38.0",
|
|
55
55
|
"p-limit": "^7.3.0",
|
|
56
|
-
"pg": "^8.
|
|
57
|
-
"posthog-node": "^5.
|
|
56
|
+
"pg": "^8.21.0",
|
|
57
|
+
"posthog-node": "^5.34.9",
|
|
58
58
|
"react": "^19.2.6",
|
|
59
59
|
"simple-git": "3.36.0",
|
|
60
|
-
"snowflake-sdk": "^2.4.
|
|
60
|
+
"snowflake-sdk": "^2.4.2",
|
|
61
61
|
"yaml": "^2.9.0",
|
|
62
62
|
"zod": "^4.4.3"
|
|
63
63
|
},
|
|
@@ -66,25 +66,25 @@
|
|
|
66
66
|
"@electric-sql/pglite-socket": "^0.1.5",
|
|
67
67
|
"@types/better-sqlite3": "^7.6.13",
|
|
68
68
|
"@types/mssql": "^12.3.0",
|
|
69
|
-
"@types/node": "^25.
|
|
69
|
+
"@types/node": "^25.9.1",
|
|
70
70
|
"@types/pg": "^8.20.0",
|
|
71
|
-
"@types/react": "^19.2.
|
|
72
|
-
"@vitest/coverage-v8": "^4.1.
|
|
71
|
+
"@types/react": "^19.2.15",
|
|
72
|
+
"@vitest/coverage-v8": "^4.1.7",
|
|
73
73
|
"ajv": "8.20.0",
|
|
74
74
|
"ink-testing-library": "^4.0.0",
|
|
75
75
|
"typescript": "^6.0.3",
|
|
76
|
-
"vitest": "^4.1.
|
|
76
|
+
"vitest": "^4.1.7"
|
|
77
77
|
},
|
|
78
78
|
"license": "Apache-2.0",
|
|
79
79
|
"repository": {
|
|
80
80
|
"type": "git",
|
|
81
|
-
"url": "https://github.com/Kaelio/ktx",
|
|
81
|
+
"url": "https://github.com/Kaelio/ktx-ai-data-agents-context",
|
|
82
82
|
"directory": "packages/cli"
|
|
83
83
|
},
|
|
84
84
|
"bugs": {
|
|
85
|
-
"url": "https://github.com/Kaelio/ktx/issues"
|
|
85
|
+
"url": "https://github.com/Kaelio/ktx-ai-data-agents-context/issues"
|
|
86
86
|
},
|
|
87
|
-
"homepage": "https://github.com/Kaelio/ktx#readme",
|
|
87
|
+
"homepage": "https://github.com/Kaelio/ktx-ai-data-agents-context#readme",
|
|
88
88
|
"scripts": {
|
|
89
89
|
"assets:demo": "node scripts/build-demo-assets.mjs",
|
|
90
90
|
"build": "tsc -p tsconfig.json && node dist/telemetry/schema-writer.js src/telemetry/events.schema.json ../../python/ktx-daemon/src/ktx_daemon/telemetry/events.schema.json && node scripts/copy-runtime-assets.mjs && node ../../scripts/prepare-cli-bin.mjs",
|
package/dist/ingest-depth.d.ts
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { KtxProjectConfig, KtxProjectConnectionConfig } from './context/project/config.js';
|
|
2
|
-
export type KtxDatabaseContextDepth = 'fast' | 'deep';
|
|
3
|
-
export declare function normalizeConnectionDriver(connection: KtxProjectConnectionConfig): string;
|
|
4
|
-
export declare function isDatabaseDriver(driver: string): boolean;
|
|
5
|
-
export declare function databaseContextDepth(connection: KtxProjectConnectionConfig): KtxDatabaseContextDepth | undefined;
|
|
6
|
-
export declare function withDatabaseContextDepth(connection: KtxProjectConnectionConfig, depth: KtxDatabaseContextDepth): KtxProjectConnectionConfig;
|
|
7
|
-
export declare function deepReadinessGaps(config: KtxProjectConfig): string[];
|
|
8
|
-
export declare function recommendedDatabaseContextDepth(config: KtxProjectConfig): KtxDatabaseContextDepth;
|
package/dist/ingest-depth.js
DELETED
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
const KTX_DATABASE_DRIVER_IDS = new Set([
|
|
2
|
-
'sqlite',
|
|
3
|
-
'postgres',
|
|
4
|
-
'mysql',
|
|
5
|
-
'clickhouse',
|
|
6
|
-
'sqlserver',
|
|
7
|
-
'bigquery',
|
|
8
|
-
'snowflake',
|
|
9
|
-
]);
|
|
10
|
-
export function normalizeConnectionDriver(connection) {
|
|
11
|
-
return String(connection.driver ?? '')
|
|
12
|
-
.trim()
|
|
13
|
-
.toLowerCase();
|
|
14
|
-
}
|
|
15
|
-
export function isDatabaseDriver(driver) {
|
|
16
|
-
return KTX_DATABASE_DRIVER_IDS.has(driver.trim().toLowerCase());
|
|
17
|
-
}
|
|
18
|
-
function connectionContextRecord(connection) {
|
|
19
|
-
const context = connection.context;
|
|
20
|
-
return typeof context === 'object' && context !== null && !Array.isArray(context)
|
|
21
|
-
? context
|
|
22
|
-
: {};
|
|
23
|
-
}
|
|
24
|
-
export function databaseContextDepth(connection) {
|
|
25
|
-
const depth = connectionContextRecord(connection).depth;
|
|
26
|
-
return depth === 'fast' || depth === 'deep' ? depth : undefined;
|
|
27
|
-
}
|
|
28
|
-
export function withDatabaseContextDepth(connection, depth) {
|
|
29
|
-
return {
|
|
30
|
-
...connection,
|
|
31
|
-
context: {
|
|
32
|
-
...connectionContextRecord(connection),
|
|
33
|
-
depth,
|
|
34
|
-
},
|
|
35
|
-
};
|
|
36
|
-
}
|
|
37
|
-
export function deepReadinessGaps(config) {
|
|
38
|
-
const gaps = [];
|
|
39
|
-
if (config.llm.provider.backend === 'none' || !config.llm.models.default) {
|
|
40
|
-
gaps.push('model configuration');
|
|
41
|
-
}
|
|
42
|
-
if (config.scan.enrichment.mode !== 'llm') {
|
|
43
|
-
gaps.push('scan enrichment mode');
|
|
44
|
-
}
|
|
45
|
-
const embeddings = config.scan.enrichment.embeddings;
|
|
46
|
-
if (!embeddings ||
|
|
47
|
-
embeddings.backend === 'none' ||
|
|
48
|
-
!embeddings.model ||
|
|
49
|
-
embeddings.dimensions <= 0) {
|
|
50
|
-
gaps.push('scan embeddings');
|
|
51
|
-
}
|
|
52
|
-
return gaps;
|
|
53
|
-
}
|
|
54
|
-
export function recommendedDatabaseContextDepth(config) {
|
|
55
|
-
return deepReadinessGaps(config).length === 0 ? 'deep' : 'fast';
|
|
56
|
-
}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { type KtxLocalProject } from './context/project/project.js';
|
|
2
|
-
import { type KtxProjectConnectionConfig } from './context/project/config.js';
|
|
3
|
-
import type { KtxSetupPromptOption } from './setup-prompts.js';
|
|
4
|
-
export interface KtxSetupDatabaseContextDepthArgs {
|
|
5
|
-
inputMode: 'auto' | 'disabled';
|
|
6
|
-
}
|
|
7
|
-
export interface KtxSetupDatabaseContextDepthPromptAdapter {
|
|
8
|
-
select(options: {
|
|
9
|
-
message: string;
|
|
10
|
-
options: KtxSetupPromptOption[];
|
|
11
|
-
}): Promise<string>;
|
|
12
|
-
}
|
|
13
|
-
export declare function ensureSetupDatabaseContextDepths(input: {
|
|
14
|
-
project: KtxLocalProject;
|
|
15
|
-
args: KtxSetupDatabaseContextDepthArgs;
|
|
16
|
-
prompts: KtxSetupDatabaseContextDepthPromptAdapter;
|
|
17
|
-
}): Promise<KtxLocalProject | 'back'>;
|
|
18
|
-
export declare function applySetupDatabaseContextDepth(input: {
|
|
19
|
-
project: KtxLocalProject;
|
|
20
|
-
connection: KtxProjectConnectionConfig;
|
|
21
|
-
args: KtxSetupDatabaseContextDepthArgs;
|
|
22
|
-
prompts: KtxSetupDatabaseContextDepthPromptAdapter;
|
|
23
|
-
}): Promise<KtxProjectConnectionConfig | 'back'>;
|
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
import { writeFile } from 'node:fs/promises';
|
|
2
|
-
import { loadKtxProject } from './context/project/project.js';
|
|
3
|
-
import { serializeKtxProjectConfig } from './context/project/config.js';
|
|
4
|
-
import { databaseContextDepth, deepReadinessGaps, isDatabaseDriver, normalizeConnectionDriver, recommendedDatabaseContextDepth, withDatabaseContextDepth, } from './ingest-depth.js';
|
|
5
|
-
function databaseConnectionsNeedingDepth(project) {
|
|
6
|
-
return Object.entries(project.config.connections)
|
|
7
|
-
.filter(([, connection]) => isDatabaseDriver(normalizeConnectionDriver(connection)))
|
|
8
|
-
.filter(([, connection]) => databaseContextDepth(connection) === undefined)
|
|
9
|
-
.map(([connectionId]) => connectionId)
|
|
10
|
-
.sort((left, right) => left.localeCompare(right));
|
|
11
|
-
}
|
|
12
|
-
async function chooseSetupDatabaseContextDepth(input) {
|
|
13
|
-
const recommended = recommendedDatabaseContextDepth(input.project.config);
|
|
14
|
-
if (input.args.inputMode === 'disabled') {
|
|
15
|
-
return recommended;
|
|
16
|
-
}
|
|
17
|
-
const deepReady = deepReadinessGaps(input.project.config).length === 0;
|
|
18
|
-
const options = recommended === 'deep'
|
|
19
|
-
? [
|
|
20
|
-
{
|
|
21
|
-
value: 'deep',
|
|
22
|
-
label: 'Deep: AI descriptions, embeddings, relationships, slower',
|
|
23
|
-
hint: 'recommended',
|
|
24
|
-
},
|
|
25
|
-
{ value: 'fast', label: 'Fast: schema only, no AI, quickest' },
|
|
26
|
-
{ value: 'back', label: 'Back' },
|
|
27
|
-
]
|
|
28
|
-
: [
|
|
29
|
-
{ value: 'fast', label: 'Fast: schema only, no AI, quickest', hint: 'recommended' },
|
|
30
|
-
{ value: 'deep', label: 'Deep: AI descriptions, embeddings, relationships, slower' },
|
|
31
|
-
{ value: 'back', label: 'Back' },
|
|
32
|
-
];
|
|
33
|
-
const choice = await input.prompts.select({
|
|
34
|
-
message: 'How much database context should KTX build?\n\n' +
|
|
35
|
-
(deepReady
|
|
36
|
-
? 'Deep is available because model, embedding, and scan enrichment are configured.'
|
|
37
|
-
: 'Fast is recommended because model, embedding, or scan enrichment is not configured.'),
|
|
38
|
-
options,
|
|
39
|
-
});
|
|
40
|
-
if (choice === 'back') {
|
|
41
|
-
return 'back';
|
|
42
|
-
}
|
|
43
|
-
if (choice === 'fast' || choice === 'deep') {
|
|
44
|
-
return choice;
|
|
45
|
-
}
|
|
46
|
-
return recommended;
|
|
47
|
-
}
|
|
48
|
-
async function writeDatabaseContextDepths(project, connectionIds, depth) {
|
|
49
|
-
if (connectionIds.length === 0) {
|
|
50
|
-
return project;
|
|
51
|
-
}
|
|
52
|
-
const nextConnections = { ...project.config.connections };
|
|
53
|
-
for (const connectionId of connectionIds) {
|
|
54
|
-
const connection = nextConnections[connectionId];
|
|
55
|
-
if (connection) {
|
|
56
|
-
nextConnections[connectionId] = withDatabaseContextDepth(connection, depth);
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
const nextConfig = { ...project.config, connections: nextConnections };
|
|
60
|
-
await writeFile(project.configPath, serializeKtxProjectConfig(nextConfig), 'utf-8');
|
|
61
|
-
return await loadKtxProject({ projectDir: project.projectDir });
|
|
62
|
-
}
|
|
63
|
-
export async function ensureSetupDatabaseContextDepths(input) {
|
|
64
|
-
const missingDepthConnectionIds = databaseConnectionsNeedingDepth(input.project);
|
|
65
|
-
if (missingDepthConnectionIds.length === 0) {
|
|
66
|
-
return input.project;
|
|
67
|
-
}
|
|
68
|
-
const depth = await chooseSetupDatabaseContextDepth(input);
|
|
69
|
-
if (depth === 'back') {
|
|
70
|
-
return 'back';
|
|
71
|
-
}
|
|
72
|
-
return await writeDatabaseContextDepths(input.project, missingDepthConnectionIds, depth);
|
|
73
|
-
}
|
|
74
|
-
export async function applySetupDatabaseContextDepth(input) {
|
|
75
|
-
if (!isDatabaseDriver(normalizeConnectionDriver(input.connection)) ||
|
|
76
|
-
databaseContextDepth(input.connection) !== undefined) {
|
|
77
|
-
return input.connection;
|
|
78
|
-
}
|
|
79
|
-
const depth = await chooseSetupDatabaseContextDepth(input);
|
|
80
|
-
if (depth === 'back') {
|
|
81
|
-
return 'back';
|
|
82
|
-
}
|
|
83
|
-
return withDatabaseContextDepth(input.connection, depth);
|
|
84
|
-
}
|