@kaelio/ktx 0.6.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.
Files changed (82) hide show
  1. package/assets/python/{kaelio_ktx-0.6.0-py3-none-any.whl → kaelio_ktx-0.8.0-py3-none-any.whl} +0 -0
  2. package/assets/python/manifest.json +4 -4
  3. package/dist/.tsbuildinfo +1 -1
  4. package/dist/cli-program.js +7 -0
  5. package/dist/command-schemas.d.ts +1 -1
  6. package/dist/command-tree.js +5 -1
  7. package/dist/commands/completion-commands.d.ts +3 -0
  8. package/dist/commands/completion-commands.js +38 -0
  9. package/dist/commands/ingest-commands.js +0 -4
  10. package/dist/commands/knowledge-commands.js +15 -2
  11. package/dist/commands/setup-commands.js +2 -2
  12. package/dist/commands/sl-commands.js +19 -7
  13. package/dist/completion/complete-engine.d.ts +19 -0
  14. package/dist/completion/complete-engine.js +128 -0
  15. package/dist/completion/completion-scripts.d.ts +1 -0
  16. package/dist/completion/completion-scripts.js +36 -0
  17. package/dist/completion/dynamic-candidates.d.ts +6 -0
  18. package/dist/completion/dynamic-candidates.js +98 -0
  19. package/dist/connection-drivers.d.ts +3 -0
  20. package/dist/connection-drivers.js +17 -0
  21. package/dist/context/ingest/ingest-bundle.runner.d.ts +8 -0
  22. package/dist/context/ingest/ingest-bundle.runner.js +72 -15
  23. package/dist/context/ingest/ingest-profile.d.ts +102 -0
  24. package/dist/context/ingest/ingest-profile.js +306 -0
  25. package/dist/context/ingest/isolated-diff/work-unit-executor.js +25 -2
  26. package/dist/context/ingest/local-bundle-runtime.js +1 -0
  27. package/dist/context/ingest/local-ingest.d.ts +1 -1
  28. package/dist/context/ingest/local-ingest.js +6 -4
  29. package/dist/context/ingest/memory-flow/events.js +2 -1
  30. package/dist/context/ingest/ports.d.ts +2 -0
  31. package/dist/context/ingest/reports.d.ts +3 -0
  32. package/dist/context/ingest/reports.js +10 -0
  33. package/dist/context/ingest/stages/stage-3-work-units.d.ts +3 -1
  34. package/dist/context/ingest/stages/stage-3-work-units.js +2 -0
  35. package/dist/context/ingest/stages/stage-4-reconciliation.d.ts +2 -1
  36. package/dist/context/ingest/stages/stage-4-reconciliation.js +1 -1
  37. package/dist/context/ingest/tools/tool-call-logger.d.ts +6 -0
  38. package/dist/context/ingest/tools/tool-call-logger.js +36 -1
  39. package/dist/context/llm/ai-sdk-runtime.js +32 -3
  40. package/dist/context/llm/claude-code-runtime.js +51 -3
  41. package/dist/context/llm/runtime-port.d.ts +25 -0
  42. package/dist/context/mcp/context-tools.d.ts +2 -1
  43. package/dist/context/mcp/context-tools.js +82 -15
  44. package/dist/context/mcp/server.js +4 -0
  45. package/dist/context/mcp/types.d.ts +15 -1
  46. package/dist/context/project/config.d.ts +1 -0
  47. package/dist/context/project/config.js +4 -0
  48. package/dist/context/project/driver-schemas.js +1 -1
  49. package/dist/context/search/discover.js +4 -3
  50. package/dist/context/sl/local-sl.d.ts +15 -0
  51. package/dist/context/sl/local-sl.js +30 -0
  52. package/dist/context/wiki/local-knowledge.d.ts +10 -0
  53. package/dist/context/wiki/local-knowledge.js +22 -0
  54. package/dist/context-build-view.d.ts +0 -3
  55. package/dist/context-build-view.js +1 -7
  56. package/dist/ingest.js +7 -10
  57. package/dist/knowledge.d.ts +5 -0
  58. package/dist/knowledge.js +10 -1
  59. package/dist/public-ingest-copy.js +1 -1
  60. package/dist/public-ingest.d.ts +0 -7
  61. package/dist/public-ingest.js +20 -34
  62. package/dist/setup-context.js +6 -38
  63. package/dist/setup-databases.js +13 -82
  64. package/dist/setup-project.d.ts +0 -8
  65. package/dist/setup-project.js +3 -27
  66. package/dist/setup-sources.js +33 -5
  67. package/dist/setup.js +3 -16
  68. package/dist/skills/analytics/SKILL.md +6 -1
  69. package/dist/sl.d.ts +6 -1
  70. package/dist/sl.js +32 -8
  71. package/dist/telemetry/emitter.js +1 -1
  72. package/dist/telemetry/events.d.ts +4 -3
  73. package/dist/telemetry/events.js +7 -3
  74. package/dist/telemetry/identity.d.ts +1 -1
  75. package/dist/telemetry/identity.js +13 -10
  76. package/dist/telemetry/index.d.ts +1 -1
  77. package/dist/telemetry/index.js +5 -1
  78. package/package.json +22 -22
  79. package/dist/ingest-depth.d.ts +0 -8
  80. package/dist/ingest-depth.js +0 -56
  81. package/dist/setup-database-context-depth.d.ts +0 -23
  82. package/dist/setup-database-context-depth.js +0 -84
@@ -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
- }