@kaelio/ktx 0.1.0-rc.6 → 0.1.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.1.0rc6-py3-none-any.whl → kaelio_ktx-0.1.0-py3-none-any.whl} +0 -0
- package/assets/python/manifest.json +4 -4
- package/dist/commands/mcp-commands.js +11 -3
- package/dist/commands/mcp-commands.test.js +30 -1
- package/dist/ingest.test.js +2 -26
- package/dist/next-steps.js +1 -1
- package/dist/next-steps.test.js +2 -0
- package/dist/runtime-requirements.d.ts +1 -2
- package/dist/runtime-requirements.js +0 -7
- package/dist/runtime-requirements.test.js +2 -2
- package/dist/setup-agents.d.ts +11 -3
- package/dist/setup-agents.js +397 -134
- package/dist/setup-agents.test.js +359 -61
- package/dist/setup-runtime.d.ts +0 -1
- package/dist/setup-runtime.js +0 -1
- package/dist/setup-runtime.test.js +7 -13
- package/dist/setup.d.ts +3 -0
- package/dist/setup.js +51 -25
- package/dist/setup.test.js +112 -16
- package/node_modules/@ktx/connector-clickhouse/dist/package-exports.test.js +1 -1
- package/node_modules/@ktx/context/dist/core/git.service.d.ts +0 -1
- package/node_modules/@ktx/context/dist/core/git.service.js +0 -12
- package/node_modules/@ktx/context/dist/ingest/adapters/historic-sql/historic-sql.adapter.d.ts +1 -2
- package/node_modules/@ktx/context/dist/ingest/adapters/historic-sql/historic-sql.adapter.js +0 -18
- package/node_modules/@ktx/context/dist/ingest/adapters/historic-sql/local-ingest-acceptance.test.js +6 -6
- package/node_modules/@ktx/context/dist/ingest/adapters/historic-sql/post-processor.d.ts +4 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/historic-sql/post-processor.js +38 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/historic-sql/post-processor.test.js +63 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/historic-sql/projection.d.ts +0 -5
- package/node_modules/@ktx/context/dist/ingest/adapters/historic-sql/projection.js +0 -48
- package/node_modules/@ktx/context/dist/ingest/adapters/historic-sql/projection.test.js +0 -83
- package/node_modules/@ktx/context/dist/ingest/index.d.ts +2 -1
- package/node_modules/@ktx/context/dist/ingest/index.js +1 -0
- package/node_modules/@ktx/context/dist/ingest/ingest-bundle.runner.d.ts +0 -2
- package/node_modules/@ktx/context/dist/ingest/ingest-bundle.runner.isolated-diff.test.js +0 -166
- package/node_modules/@ktx/context/dist/ingest/ingest-bundle.runner.js +45 -235
- package/node_modules/@ktx/context/dist/ingest/ingest-bundle.runner.test.js +38 -193
- package/node_modules/@ktx/context/dist/ingest/local-bundle-ingest.test.js +3 -22
- package/node_modules/@ktx/context/dist/ingest/local-bundle-runtime.js +4 -0
- package/node_modules/@ktx/context/dist/ingest/local-ingest.js +7 -0
- package/node_modules/@ktx/context/dist/ingest/memory-flow/schema.d.ts +4 -4
- package/node_modules/@ktx/context/dist/ingest/memory-flow/schema.js +1 -1
- package/node_modules/@ktx/context/dist/ingest/memory-flow/types.d.ts +1 -1
- package/node_modules/@ktx/context/dist/ingest/ports.d.ts +20 -1
- package/node_modules/@ktx/context/dist/ingest/report-snapshot.d.ts +2 -73
- package/node_modules/@ktx/context/dist/ingest/report-snapshot.js +0 -27
- package/node_modules/@ktx/context/dist/ingest/reports.d.ts +5 -23
- package/node_modules/@ktx/context/dist/ingest/reports.js +24 -7
- package/node_modules/@ktx/context/dist/ingest/types.d.ts +0 -33
- package/node_modules/@ktx/context/dist/package-exports.test.js +1 -2
- package/package.json +4 -4
- package/node_modules/@ktx/context/dist/ingest/finalization-scope.d.ts +0 -22
- package/node_modules/@ktx/context/dist/ingest/finalization-scope.js +0 -95
- package/node_modules/@ktx/context/dist/ingest/finalization-scope.test.js +0 -114
- /package/node_modules/@ktx/context/dist/ingest/{finalization-scope.test.d.ts → adapters/historic-sql/post-processor.test.d.ts} +0 -0
package/assets/python/{kaelio_ktx-0.1.0rc6-py3-none-any.whl → kaelio_ktx-0.1.0-py3-none-any.whl}
RENAMED
|
Binary file
|
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
"schemaVersion": 1,
|
|
3
3
|
"distributionName": "kaelio-ktx",
|
|
4
4
|
"normalizedName": "kaelio_ktx",
|
|
5
|
-
"version": "0.1.
|
|
5
|
+
"version": "0.1.0",
|
|
6
6
|
"wheel": {
|
|
7
|
-
"file": "kaelio_ktx-0.1.
|
|
8
|
-
"sha256": "
|
|
9
|
-
"bytes":
|
|
7
|
+
"file": "kaelio_ktx-0.1.0-py3-none-any.whl",
|
|
8
|
+
"sha256": "1145cf0c90879270dc335a8d0ca49a598f81e0f47a37fdf646fc6c6798fe3c8b",
|
|
9
|
+
"bytes": 80523
|
|
10
10
|
}
|
|
11
11
|
}
|
|
@@ -11,6 +11,16 @@ function tokenFromOption(value) {
|
|
|
11
11
|
function binPath() {
|
|
12
12
|
return fileURLToPath(new URL('../bin.js', import.meta.url));
|
|
13
13
|
}
|
|
14
|
+
function formatMcpStartResultMessage(input) {
|
|
15
|
+
return [
|
|
16
|
+
input.status === 'started' ? `KTX MCP daemon started: ${input.url}` : `KTX MCP daemon already running: ${input.url}`,
|
|
17
|
+
'',
|
|
18
|
+
'KTX is ready for configured agents.',
|
|
19
|
+
'Open your agent for this KTX project and ask a data question, for example:',
|
|
20
|
+
' "Use KTX to show me the available tables and metrics."',
|
|
21
|
+
'',
|
|
22
|
+
].join('\n');
|
|
23
|
+
}
|
|
14
24
|
export function registerMcpCommands(program, context) {
|
|
15
25
|
const mcp = program.command('mcp').description('Run the KTX MCP HTTP server');
|
|
16
26
|
mcp
|
|
@@ -66,9 +76,7 @@ export function registerMcpCommands(program, context) {
|
|
|
66
76
|
allowedOrigins: options.allowedOrigin,
|
|
67
77
|
binPath: binPath(),
|
|
68
78
|
});
|
|
69
|
-
context.io.stdout.write(result.status
|
|
70
|
-
? `KTX MCP daemon started: ${result.url}\n`
|
|
71
|
-
: `KTX MCP daemon already running: ${result.url}\n`);
|
|
79
|
+
context.io.stdout.write(formatMcpStartResultMessage({ status: result.status, url: result.url }));
|
|
72
80
|
});
|
|
73
81
|
mcp
|
|
74
82
|
.command('stop')
|
|
@@ -65,7 +65,36 @@ describe('registerMcpCommands', () => {
|
|
|
65
65
|
registerMcpCommands(program, context);
|
|
66
66
|
await program.parseAsync(['--project-dir', '/tmp/ktx-already', 'mcp', 'start'], { from: 'user' });
|
|
67
67
|
expect(startDaemon).toHaveBeenCalledTimes(1);
|
|
68
|
-
expect(context.io.stdout.write).toHaveBeenCalledWith(
|
|
68
|
+
expect(context.io.stdout.write).toHaveBeenCalledWith([
|
|
69
|
+
'KTX MCP daemon already running: http://127.0.0.1:7878/mcp',
|
|
70
|
+
'',
|
|
71
|
+
'KTX is ready for configured agents.',
|
|
72
|
+
'Open your agent for this KTX project and ask a data question, for example:',
|
|
73
|
+
' "Use KTX to show me the available tables and metrics."',
|
|
74
|
+
'',
|
|
75
|
+
].join('\n'));
|
|
76
|
+
});
|
|
77
|
+
it('prints a friendly next step after starting the daemon', async () => {
|
|
78
|
+
const program = new Command().exitOverride().option('--project-dir <path>');
|
|
79
|
+
const startDaemon = vi.fn().mockResolvedValue({
|
|
80
|
+
status: 'started',
|
|
81
|
+
url: 'http://127.0.0.1:7878/mcp',
|
|
82
|
+
state: {
|
|
83
|
+
schemaVersion: 1,
|
|
84
|
+
pid: 4242,
|
|
85
|
+
host: '127.0.0.1',
|
|
86
|
+
port: 7878,
|
|
87
|
+
tokenAuth: false,
|
|
88
|
+
projectDir: '/tmp/ktx-started',
|
|
89
|
+
startedAt: '2026-05-14T00:00:00.000Z',
|
|
90
|
+
logPath: '/tmp/ktx-started/.ktx/logs/mcp.log',
|
|
91
|
+
},
|
|
92
|
+
});
|
|
93
|
+
const context = makeContext({ deps: { mcp: { startDaemon } } });
|
|
94
|
+
registerMcpCommands(program, context);
|
|
95
|
+
await program.parseAsync(['--project-dir', '/tmp/ktx-started', 'mcp', 'start'], { from: 'user' });
|
|
96
|
+
expect(context.io.stdout.write).toHaveBeenCalledWith(expect.stringContaining('KTX MCP daemon started: http://127.0.0.1:7878/mcp\n\nKTX is ready for configured agents.'));
|
|
97
|
+
expect(context.io.stdout.write).toHaveBeenCalledWith(expect.stringContaining('"Use KTX to show me the available tables and metrics."'));
|
|
69
98
|
});
|
|
70
99
|
it('runs the stdio server with the resolved project directory', async () => {
|
|
71
100
|
const program = new Command().exitOverride().option('--project-dir <path>');
|
package/dist/ingest.test.js
CHANGED
|
@@ -807,16 +807,9 @@ describe('runKtxIngest', () => {
|
|
|
807
807
|
sourceKey: 'historic-sql',
|
|
808
808
|
body: {
|
|
809
809
|
workUnits: [],
|
|
810
|
-
|
|
810
|
+
postProcessor: {
|
|
811
811
|
sourceKey: 'historic-sql',
|
|
812
812
|
status: 'success',
|
|
813
|
-
commitSha: 'finalization-sha',
|
|
814
|
-
touchedPaths: ['semantic-layer/warehouse/_schema/public.yaml', 'wiki/global/historic-sql-orders.md'],
|
|
815
|
-
declaredTouchedSources: [{ connectionId: 'warehouse', sourceName: 'orders' }],
|
|
816
|
-
derivedTouchedSources: [{ connectionId: 'warehouse', sourceName: 'orders' }],
|
|
817
|
-
declaredChangedWikiPageKeys: ['historic-sql-orders'],
|
|
818
|
-
derivedChangedWikiPageKeys: ['historic-sql-orders'],
|
|
819
|
-
mismatches: [],
|
|
820
813
|
result: {
|
|
821
814
|
tableUsageMerged: 56,
|
|
822
815
|
staleTablesMarked: 1,
|
|
@@ -826,24 +819,7 @@ describe('runKtxIngest', () => {
|
|
|
826
819
|
},
|
|
827
820
|
errors: [],
|
|
828
821
|
warnings: [],
|
|
829
|
-
|
|
830
|
-
...Array.from({ length: 57 }, (_, index) => ({
|
|
831
|
-
target: 'sl',
|
|
832
|
-
type: 'updated',
|
|
833
|
-
key: `orders-${index}`,
|
|
834
|
-
detail: 'Merged usage',
|
|
835
|
-
targetConnectionId: 'warehouse',
|
|
836
|
-
rawPaths: ['tables/public/orders.json'],
|
|
837
|
-
})),
|
|
838
|
-
...Array.from({ length: 35 }, (_, index) => ({
|
|
839
|
-
target: 'wiki',
|
|
840
|
-
type: 'updated',
|
|
841
|
-
key: `historic-sql-orders-${index}`,
|
|
842
|
-
detail: 'Projected pattern',
|
|
843
|
-
rawPaths: ['patterns/orders.json'],
|
|
844
|
-
})),
|
|
845
|
-
],
|
|
846
|
-
provenanceExclusions: [],
|
|
822
|
+
touchedSources: [],
|
|
847
823
|
},
|
|
848
824
|
},
|
|
849
825
|
}),
|
package/dist/next-steps.js
CHANGED
|
@@ -29,7 +29,7 @@ function commandLines(commands, indent) {
|
|
|
29
29
|
}
|
|
30
30
|
export function formatNextStepLines(indent = ' ') {
|
|
31
31
|
return [
|
|
32
|
-
`${indent}KTX context is ready for agents. Open your coding agent
|
|
32
|
+
`${indent}KTX context is ready for agents. Open your coding agent from the KTX project directory and ask a data question.`,
|
|
33
33
|
`${indent}Verify with:`,
|
|
34
34
|
...commandLines(KTX_NEXT_STEP_DIRECT_COMMANDS, indent),
|
|
35
35
|
];
|
package/dist/next-steps.test.js
CHANGED
|
@@ -38,8 +38,10 @@ describe('KTX demo next steps', () => {
|
|
|
38
38
|
it('explains what the next-step commands are for', () => {
|
|
39
39
|
const rendered = formatNextStepLines().join('\n');
|
|
40
40
|
expect(rendered).toContain('KTX context is ready for agents.');
|
|
41
|
+
expect(rendered).toContain('KTX project directory');
|
|
41
42
|
expect(rendered).toContain('ask a data question');
|
|
42
43
|
expect(rendered).toContain('Verify with:');
|
|
44
|
+
expect(rendered).not.toContain('this directory');
|
|
43
45
|
expect(rendered).not.toContain('Preferred route');
|
|
44
46
|
expect(rendered).not.toContain('Optional MCP:');
|
|
45
47
|
});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { KtxProjectConfig } from '@ktx/context/project';
|
|
2
2
|
import type { KtxRuntimeFeature } from './managed-python-runtime.js';
|
|
3
3
|
import type { KtxPublicIngestPlan } from './public-ingest.js';
|
|
4
|
-
type KtxRuntimeRequirementReason = '
|
|
4
|
+
type KtxRuntimeRequirementReason = 'query-history' | 'looker-source' | 'database-introspection' | 'local-embeddings';
|
|
5
5
|
interface KtxRuntimeRequirement {
|
|
6
6
|
feature: KtxRuntimeFeature;
|
|
7
7
|
reason: KtxRuntimeRequirementReason;
|
|
@@ -12,7 +12,6 @@ export interface KtxRuntimeRequirements {
|
|
|
12
12
|
requirements: KtxRuntimeRequirement[];
|
|
13
13
|
}
|
|
14
14
|
export interface KtxProjectRuntimeRequirementOptions {
|
|
15
|
-
agents?: boolean;
|
|
16
15
|
databaseIntrospectionFallback?: boolean;
|
|
17
16
|
env?: NodeJS.ProcessEnv | Record<string, string | undefined>;
|
|
18
17
|
}
|
|
@@ -41,13 +41,6 @@ function uniqueRequirements(requirements) {
|
|
|
41
41
|
export function resolveProjectRuntimeRequirements(config, options = {}) {
|
|
42
42
|
const env = options.env ?? process.env;
|
|
43
43
|
const requirements = [];
|
|
44
|
-
if (options.agents === true) {
|
|
45
|
-
requirements.push({
|
|
46
|
-
feature: 'core',
|
|
47
|
-
reason: 'agent-mcp',
|
|
48
|
-
detail: 'Agent MCP setup uses semantic-layer query tools and SQL validation.',
|
|
49
|
-
});
|
|
50
|
-
}
|
|
51
44
|
if (options.databaseIntrospectionFallback === true && !hasDaemonOverride(env)) {
|
|
52
45
|
requirements.push({
|
|
53
46
|
feature: 'core',
|
|
@@ -3,9 +3,9 @@ import { buildDefaultKtxProjectConfig } from '@ktx/context/project';
|
|
|
3
3
|
import { describe, expect, it } from 'vitest';
|
|
4
4
|
import { resolveProjectRuntimeRequirements, resolvePublicIngestRuntimeRequirements, } from './runtime-requirements.js';
|
|
5
5
|
describe('runtime requirement detection', () => {
|
|
6
|
-
it('
|
|
6
|
+
it('does not require runtime for agent/MCP setup alone', () => {
|
|
7
7
|
const config = buildDefaultKtxProjectConfig();
|
|
8
|
-
expect(resolveProjectRuntimeRequirements(config
|
|
8
|
+
expect(resolveProjectRuntimeRequirements(config).features).toEqual([]);
|
|
9
9
|
});
|
|
10
10
|
it('requires core for Looker source ingest unless an external daemon is configured', () => {
|
|
11
11
|
const config = {
|
package/dist/setup-agents.d.ts
CHANGED
|
@@ -12,6 +12,7 @@ export interface KtxSetupAgentsArgs {
|
|
|
12
12
|
scope: KtxAgentScope;
|
|
13
13
|
mode: KtxAgentInstallMode;
|
|
14
14
|
skipAgents: boolean;
|
|
15
|
+
showNextActions?: boolean;
|
|
15
16
|
}
|
|
16
17
|
export type KtxSetupAgentsResult = {
|
|
17
18
|
status: 'ready';
|
|
@@ -21,6 +22,7 @@ export type KtxSetupAgentsResult = {
|
|
|
21
22
|
scope: KtxAgentScope;
|
|
22
23
|
mode: KtxAgentInstallMode;
|
|
23
24
|
}>;
|
|
25
|
+
nextActions?: string;
|
|
24
26
|
} | {
|
|
25
27
|
status: 'skipped';
|
|
26
28
|
projectDir: string;
|
|
@@ -46,7 +48,7 @@ export interface KtxAgentInstallManifest {
|
|
|
46
48
|
entries: Array<{
|
|
47
49
|
kind: 'file';
|
|
48
50
|
path: string;
|
|
49
|
-
role?: 'skill' | 'rule' | 'analytics-skill' | 'claude-
|
|
51
|
+
role?: 'skill' | 'rule' | 'analytics-skill' | 'claude-desktop-skill-bundle' | 'launcher';
|
|
50
52
|
} | {
|
|
51
53
|
kind: 'json-key';
|
|
52
54
|
path: string;
|
|
@@ -54,6 +56,7 @@ export interface KtxAgentInstallManifest {
|
|
|
54
56
|
}>;
|
|
55
57
|
}
|
|
56
58
|
type InstallEntry = KtxAgentInstallManifest['entries'][number];
|
|
59
|
+
export declare function createAgentNextActionsLineFormatter(stdout: KtxCliIo['stdout']): (line: string) => string;
|
|
57
60
|
export declare function collectClaudeDesktopForwardedEnv(source: NodeJS.ProcessEnv): Record<string, string>;
|
|
58
61
|
export declare function agentInstallManifestPath(projectDir: string): string;
|
|
59
62
|
export declare function plannedKtxAgentFiles(input: {
|
|
@@ -79,10 +82,15 @@ export interface KtxSetupAgentsPromptAdapter {
|
|
|
79
82
|
export interface KtxSetupAgentsDeps {
|
|
80
83
|
prompts?: KtxSetupAgentsPromptAdapter;
|
|
81
84
|
}
|
|
82
|
-
export declare function
|
|
85
|
+
export declare function targetDisplayName(target: string): string;
|
|
86
|
+
export interface InstallSummaryEntry {
|
|
87
|
+
title: string;
|
|
88
|
+
lines: string[];
|
|
89
|
+
}
|
|
90
|
+
export declare function formatInstallSummaryLines(installs: Array<{
|
|
83
91
|
target: KtxAgentTarget;
|
|
84
92
|
scope: KtxAgentScope;
|
|
85
93
|
mode: KtxAgentInstallMode;
|
|
86
|
-
}>, entries: InstallEntry[], projectDir: string):
|
|
94
|
+
}>, entries: InstallEntry[], projectDir: string): InstallSummaryEntry[];
|
|
87
95
|
export declare function runKtxSetupAgentsStep(args: KtxSetupAgentsArgs, io: KtxCliIo, deps?: KtxSetupAgentsDeps): Promise<KtxSetupAgentsResult>;
|
|
88
96
|
export {};
|