@kaelio/ktx 0.0.0 → 0.1.0-rc.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/LICENSE +202 -0
- package/assets/demo/orbit/demo.db +0 -0
- package/assets/demo/orbit/knowledge/global/activation-policy.md +18 -0
- package/assets/demo/orbit/knowledge/global/arr-contract-first.md +18 -0
- package/assets/demo/orbit/knowledge/global/customer-health-scoring.md +20 -0
- package/assets/demo/orbit/knowledge/global/discount-expiration.md +19 -0
- package/assets/demo/orbit/knowledge/global/internal-test-exclusion.md +16 -0
- package/assets/demo/orbit/knowledge/global/nrr-retention.md +19 -0
- package/assets/demo/orbit/knowledge/global/procurement-workflows.md +17 -0
- package/assets/demo/orbit/knowledge/global/revenue-gross-to-net.md +17 -0
- package/assets/demo/orbit/knowledge/global/segment-classification.md +17 -0
- package/assets/demo/orbit/knowledge/global/support-escalation.md +17 -0
- package/assets/demo/orbit/links/provenance.json +209 -0
- package/assets/demo/orbit/manifest.json +58 -0
- package/assets/demo/orbit/raw-sources/bi/account_retention.view.lkml +67 -0
- package/assets/demo/orbit/raw-sources/bi/arr_daily.view.lkml +28 -0
- package/assets/demo/orbit/raw-sources/bi/customer_health.view.lkml +50 -0
- package/assets/demo/orbit/raw-sources/bi/procurement_activity.view.lkml +46 -0
- package/assets/demo/orbit/raw-sources/bi/retention_exec_q1.dashboard.lookml +28 -0
- package/assets/demo/orbit/raw-sources/bi/revenue_daily.view.lkml +52 -0
- package/assets/demo/orbit/raw-sources/bi/revenue_exec.dashboard.lookml +28 -0
- package/assets/demo/orbit/raw-sources/dbt/dbt_project.yml +10 -0
- package/assets/demo/orbit/raw-sources/dbt/models/marts/mart_arr_daily.sql +5 -0
- package/assets/demo/orbit/raw-sources/dbt/models/marts/mart_customer_health.sql +10 -0
- package/assets/demo/orbit/raw-sources/dbt/models/marts/mart_revenue_daily.sql +8 -0
- package/assets/demo/orbit/raw-sources/dbt/schema.yml +455 -0
- package/assets/demo/orbit/raw-sources/dbt/sources.yml +48 -0
- package/assets/demo/orbit/raw-sources/notion/activation-policy-decision-record.md +49 -0
- package/assets/demo/orbit/raw-sources/notion/analyst-onboarding.md +35 -0
- package/assets/demo/orbit/raw-sources/notion/arr-and-contract-reporting-notes.md +64 -0
- package/assets/demo/orbit/raw-sources/notion/customer-health-playbook.md +55 -0
- package/assets/demo/orbit/raw-sources/notion/retention-and-nrr-definition-notes.md +58 -0
- package/assets/demo/orbit/raw-sources/notion/revenue-reporting-policy.md +64 -0
- package/assets/demo/orbit/raw-sources/notion/sales-ops-segmentation-guide.md +58 -0
- package/assets/demo/orbit/raw-sources/notion/support-escalation-runbook.md +38 -0
- package/assets/demo/orbit/raw-sources/warehouse/accounts.csv +211 -0
- package/assets/demo/orbit/raw-sources/warehouse/arr_movements.csv +721 -0
- package/assets/demo/orbit/raw-sources/warehouse/contracts.csv +321 -0
- package/assets/demo/orbit/raw-sources/warehouse/invoices.csv +3001 -0
- package/assets/demo/orbit/raw-sources/warehouse/plans.csv +5 -0
- package/assets/demo/orbit/raw-sources/warehouse/purchase_requests.csv +5201 -0
- package/assets/demo/orbit/raw-sources/warehouse/support_tickets.csv +521 -0
- package/assets/demo/orbit/raw-sources/warehouse/users.csv +1261 -0
- package/assets/demo/orbit/replay.memory-flow.v1.json +707 -0
- package/assets/demo/orbit/reports/seeded-demo-report.json +40 -0
- package/assets/demo/orbit/semantic-layer/orbit_demo/accounts.yaml +44 -0
- package/assets/demo/orbit/semantic-layer/orbit_demo/arr_movements.yaml +38 -0
- package/assets/demo/orbit/semantic-layer/orbit_demo/contracts.yaml +39 -0
- package/assets/demo/orbit/semantic-layer/orbit_demo/invoices.yaml +33 -0
- package/assets/demo/orbit/semantic-layer/orbit_demo/purchase_requests.yaml +33 -0
- package/assets/demo/orbit/semantic-layer/orbit_demo/support_tickets.yaml +37 -0
- package/assets/python/kaelio_ktx-0.1.0-py3-none-any.whl +0 -0
- package/assets/python/manifest.json +11 -0
- package/dist/agent-runtime.d.ts +33 -0
- package/dist/agent-runtime.js +62 -0
- package/dist/agent-runtime.test.d.ts +1 -0
- package/dist/agent-runtime.test.js +117 -0
- package/dist/agent-search-readiness.d.ts +11 -0
- package/dist/agent-search-readiness.js +60 -0
- package/dist/agent-search-readiness.test.d.ts +1 -0
- package/dist/agent-search-readiness.test.js +40 -0
- package/dist/agent.d.ts +71 -0
- package/dist/agent.js +156 -0
- package/dist/agent.test.d.ts +1 -0
- package/dist/agent.test.js +338 -0
- package/dist/bin.d.ts +2 -0
- package/dist/bin.js +7 -0
- package/dist/clack.d.ts +6 -0
- package/dist/clack.js +4 -0
- package/dist/cli-program.d.ts +43 -0
- package/dist/cli-program.js +195 -0
- package/dist/cli-runtime.d.ts +52 -0
- package/dist/cli-runtime.js +45 -0
- package/dist/command-schemas.d.ts +96 -0
- package/dist/command-schemas.js +80 -0
- package/dist/commands/agent-commands.d.ts +3 -0
- package/dist/commands/agent-commands.js +126 -0
- package/dist/commands/completion-commands.d.ts +3 -0
- package/dist/commands/completion-commands.js +39 -0
- package/dist/commands/connection-commands.d.ts +4 -0
- package/dist/commands/connection-commands.js +287 -0
- package/dist/commands/connection-mapping.d.ts +63 -0
- package/dist/commands/connection-mapping.js +299 -0
- package/dist/commands/connection-mapping.test.d.ts +1 -0
- package/dist/commands/connection-mapping.test.js +230 -0
- package/dist/commands/connection-metabase-commands.d.ts +3 -0
- package/dist/commands/connection-metabase-commands.js +73 -0
- package/dist/commands/connection-metabase-setup.d.ts +83 -0
- package/dist/commands/connection-metabase-setup.js +540 -0
- package/dist/commands/connection-metabase-setup.test.d.ts +1 -0
- package/dist/commands/connection-metabase-setup.test.js +894 -0
- package/dist/commands/connection-notion-commands.d.ts +3 -0
- package/dist/commands/connection-notion-commands.js +74 -0
- package/dist/commands/connection-notion-tree.d.ts +68 -0
- package/dist/commands/connection-notion-tree.js +412 -0
- package/dist/commands/connection-notion-tree.test.d.ts +1 -0
- package/dist/commands/connection-notion-tree.test.js +237 -0
- package/dist/commands/connection-notion-tui.d.ts +71 -0
- package/dist/commands/connection-notion-tui.js +224 -0
- package/dist/commands/connection-notion-tui.test.d.ts +1 -0
- package/dist/commands/connection-notion-tui.test.js +237 -0
- package/dist/commands/connection-notion.d.ts +37 -0
- package/dist/commands/connection-notion.js +203 -0
- package/dist/commands/connection-notion.test.d.ts +1 -0
- package/dist/commands/connection-notion.test.js +364 -0
- package/dist/commands/demo-commands.d.ts +10 -0
- package/dist/commands/demo-commands.js +214 -0
- package/dist/commands/demo-commands.test.d.ts +1 -0
- package/dist/commands/demo-commands.test.js +24 -0
- package/dist/commands/doctor-commands.d.ts +3 -0
- package/dist/commands/doctor-commands.js +37 -0
- package/dist/commands/ingest-commands.d.ts +9 -0
- package/dist/commands/ingest-commands.js +129 -0
- package/dist/commands/knowledge-commands.d.ts +3 -0
- package/dist/commands/knowledge-commands.js +79 -0
- package/dist/commands/public-ingest-commands.d.ts +3 -0
- package/dist/commands/public-ingest-commands.js +92 -0
- package/dist/commands/runtime-commands.d.ts +3 -0
- package/dist/commands/runtime-commands.js +87 -0
- package/dist/commands/scan-commands.d.ts +3 -0
- package/dist/commands/scan-commands.js +249 -0
- package/dist/commands/serve-commands.d.ts +3 -0
- package/dist/commands/serve-commands.js +48 -0
- package/dist/commands/setup-commands.d.ts +3 -0
- package/dist/commands/setup-commands.js +378 -0
- package/dist/commands/sl-commands.d.ts +3 -0
- package/dist/commands/sl-commands.js +129 -0
- package/dist/commands/status-commands.d.ts +3 -0
- package/dist/commands/status-commands.js +15 -0
- package/dist/completion.d.ts +12 -0
- package/dist/completion.js +272 -0
- package/dist/connection.d.ts +62 -0
- package/dist/connection.js +261 -0
- package/dist/connection.test.d.ts +1 -0
- package/dist/connection.test.js +482 -0
- package/dist/context-build-view.d.ts +42 -0
- package/dist/context-build-view.js +309 -0
- package/dist/context-build-view.test.d.ts +1 -0
- package/dist/context-build-view.test.js +225 -0
- package/dist/demo-assets.d.ts +29 -0
- package/dist/demo-assets.js +229 -0
- package/dist/demo-assets.test.d.ts +1 -0
- package/dist/demo-assets.test.js +208 -0
- package/dist/demo-full.d.ts +32 -0
- package/dist/demo-full.js +158 -0
- package/dist/demo-full.test.d.ts +1 -0
- package/dist/demo-full.test.js +168 -0
- package/dist/demo-interaction.d.ts +66 -0
- package/dist/demo-interaction.js +136 -0
- package/dist/demo-interaction.test.d.ts +1 -0
- package/dist/demo-interaction.test.js +91 -0
- package/dist/demo-metrics.d.ts +35 -0
- package/dist/demo-metrics.js +131 -0
- package/dist/demo-metrics.test.d.ts +1 -0
- package/dist/demo-metrics.test.js +108 -0
- package/dist/demo-progress.d.ts +4 -0
- package/dist/demo-progress.js +76 -0
- package/dist/demo-progress.test.d.ts +1 -0
- package/dist/demo-progress.test.js +168 -0
- package/dist/demo-replay-store.d.ts +12 -0
- package/dist/demo-replay-store.js +47 -0
- package/dist/demo-replay-store.test.d.ts +1 -0
- package/dist/demo-replay-store.test.js +50 -0
- package/dist/demo-scan.d.ts +31 -0
- package/dist/demo-scan.js +171 -0
- package/dist/demo-scan.test.d.ts +1 -0
- package/dist/demo-scan.test.js +27 -0
- package/dist/demo-seeded-inspect.d.ts +127 -0
- package/dist/demo-seeded-inspect.js +198 -0
- package/dist/demo-seeded-inspect.test.d.ts +1 -0
- package/dist/demo-seeded-inspect.test.js +108 -0
- package/dist/demo-seeded.d.ts +11 -0
- package/dist/demo-seeded.js +19 -0
- package/dist/demo-seeded.test.d.ts +1 -0
- package/dist/demo-seeded.test.js +98 -0
- package/dist/demo.d.ts +74 -0
- package/dist/demo.js +378 -0
- package/dist/demo.test.d.ts +1 -0
- package/dist/demo.test.js +506 -0
- package/dist/dev.d.ts +3 -0
- package/dist/dev.js +42 -0
- package/dist/dev.test.d.ts +1 -0
- package/dist/dev.test.js +506 -0
- package/dist/doctor.d.ts +64 -0
- package/dist/doctor.js +272 -0
- package/dist/doctor.test.d.ts +1 -0
- package/dist/doctor.test.js +339 -0
- package/dist/example-smoke.test.d.ts +1 -0
- package/dist/example-smoke.test.js +182 -0
- package/dist/historic-sql-doctor.d.ts +22 -0
- package/dist/historic-sql-doctor.js +88 -0
- package/dist/historic-sql-doctor.test.d.ts +1 -0
- package/dist/historic-sql-doctor.test.js +141 -0
- package/dist/index.d.ts +17 -0
- package/dist/index.js +14 -0
- package/dist/index.test.d.ts +1 -0
- package/dist/index.test.js +1740 -0
- package/dist/ingest-report-file.d.ts +2 -0
- package/dist/ingest-report-file.js +20 -0
- package/dist/ingest-report-file.test.d.ts +1 -0
- package/dist/ingest-report-file.test.js +63 -0
- package/dist/ingest.d.ts +53 -0
- package/dist/ingest.js +288 -0
- package/dist/ingest.test.d.ts +1 -0
- package/dist/ingest.test.js +1806 -0
- package/dist/io/mode.d.ts +9 -0
- package/dist/io/mode.js +28 -0
- package/dist/io/mode.test.d.ts +1 -0
- package/dist/io/mode.test.js +48 -0
- package/dist/io/print-list.d.ts +27 -0
- package/dist/io/print-list.js +121 -0
- package/dist/io/print-list.test.d.ts +1 -0
- package/dist/io/print-list.test.js +147 -0
- package/dist/io/symbols.d.ts +12 -0
- package/dist/io/symbols.js +29 -0
- package/dist/knowledge.d.ts +37 -0
- package/dist/knowledge.js +58 -0
- package/dist/knowledge.test.d.ts +1 -0
- package/dist/knowledge.test.js +72 -0
- package/dist/local-adapters.d.ts +9 -0
- package/dist/local-adapters.js +169 -0
- package/dist/local-scan-connectors.d.ts +3 -0
- package/dist/local-scan-connectors.js +70 -0
- package/dist/local-scan-connectors.test.d.ts +1 -0
- package/dist/local-scan-connectors.test.js +114 -0
- package/dist/managed-local-embeddings.d.ts +36 -0
- package/dist/managed-local-embeddings.js +48 -0
- package/dist/managed-local-embeddings.test.d.ts +1 -0
- package/dist/managed-local-embeddings.test.js +154 -0
- package/dist/managed-python-command.d.ts +29 -0
- package/dist/managed-python-command.js +81 -0
- package/dist/managed-python-command.test.d.ts +1 -0
- package/dist/managed-python-command.test.js +180 -0
- package/dist/managed-python-daemon.d.ts +79 -0
- package/dist/managed-python-daemon.js +267 -0
- package/dist/managed-python-daemon.test.d.ts +1 -0
- package/dist/managed-python-daemon.test.js +196 -0
- package/dist/managed-python-http.d.ts +37 -0
- package/dist/managed-python-http.js +109 -0
- package/dist/managed-python-http.test.d.ts +1 -0
- package/dist/managed-python-http.test.js +147 -0
- package/dist/managed-python-runtime.d.ts +125 -0
- package/dist/managed-python-runtime.js +311 -0
- package/dist/managed-python-runtime.test.d.ts +1 -0
- package/dist/managed-python-runtime.test.js +373 -0
- package/dist/memory-flow-hud.d.ts +32 -0
- package/dist/memory-flow-hud.js +342 -0
- package/dist/memory-flow-interactive.d.ts +29 -0
- package/dist/memory-flow-interactive.js +94 -0
- package/dist/memory-flow-interactive.test.d.ts +1 -0
- package/dist/memory-flow-interactive.test.js +109 -0
- package/dist/memory-flow-tui.d.ts +76 -0
- package/dist/memory-flow-tui.js +359 -0
- package/dist/memory-flow-tui.test.d.ts +1 -0
- package/dist/memory-flow-tui.test.js +247 -0
- package/dist/next-steps.d.ts +52 -0
- package/dist/next-steps.js +84 -0
- package/dist/next-steps.test.d.ts +1 -0
- package/dist/next-steps.test.js +106 -0
- package/dist/project-dir.d.ts +1 -0
- package/dist/project-dir.js +4 -0
- package/dist/project-dir.test.d.ts +1 -0
- package/dist/project-dir.test.js +141 -0
- package/dist/project-resolver.d.ts +7 -0
- package/dist/project-resolver.js +42 -0
- package/dist/project-resolver.test.d.ts +1 -0
- package/dist/project-resolver.test.js +49 -0
- package/dist/prompt-navigation.d.ts +6 -0
- package/dist/prompt-navigation.js +38 -0
- package/dist/prompt-navigation.test.d.ts +1 -0
- package/dist/prompt-navigation.test.js +25 -0
- package/dist/public-ingest.d.ts +63 -0
- package/dist/public-ingest.js +202 -0
- package/dist/public-ingest.test.d.ts +1 -0
- package/dist/public-ingest.test.js +208 -0
- package/dist/runtime.d.ts +49 -0
- package/dist/runtime.js +135 -0
- package/dist/runtime.test.d.ts +1 -0
- package/dist/runtime.test.js +272 -0
- package/dist/scan.d.ts +100 -0
- package/dist/scan.js +516 -0
- package/dist/scan.test.d.ts +1 -0
- package/dist/scan.test.js +1751 -0
- package/dist/serve.d.ts +51 -0
- package/dist/serve.js +102 -0
- package/dist/serve.test.d.ts +1 -0
- package/dist/serve.test.js +437 -0
- package/dist/setup-agents.d.ts +86 -0
- package/dist/setup-agents.js +257 -0
- package/dist/setup-agents.test.d.ts +1 -0
- package/dist/setup-agents.test.js +132 -0
- package/dist/setup-context.d.ts +116 -0
- package/dist/setup-context.js +564 -0
- package/dist/setup-context.test.d.ts +1 -0
- package/dist/setup-context.test.js +301 -0
- package/dist/setup-databases.d.ts +80 -0
- package/dist/setup-databases.js +1041 -0
- package/dist/setup-databases.test.d.ts +1 -0
- package/dist/setup-databases.test.js +1102 -0
- package/dist/setup-embeddings.d.ts +57 -0
- package/dist/setup-embeddings.js +388 -0
- package/dist/setup-embeddings.test.d.ts +1 -0
- package/dist/setup-embeddings.test.js +366 -0
- package/dist/setup-interrupt.d.ts +15 -0
- package/dist/setup-interrupt.js +65 -0
- package/dist/setup-interrupt.test.d.ts +1 -0
- package/dist/setup-interrupt.test.js +58 -0
- package/dist/setup-models.d.ts +68 -0
- package/dist/setup-models.js +313 -0
- package/dist/setup-models.test.d.ts +1 -0
- package/dist/setup-models.test.js +482 -0
- package/dist/setup-project.d.ts +47 -0
- package/dist/setup-project.js +274 -0
- package/dist/setup-project.test.d.ts +1 -0
- package/dist/setup-project.test.js +221 -0
- package/dist/setup-ready-menu.d.ts +19 -0
- package/dist/setup-ready-menu.js +43 -0
- package/dist/setup-ready-menu.test.d.ts +1 -0
- package/dist/setup-ready-menu.test.js +35 -0
- package/dist/setup-secrets.d.ts +7 -0
- package/dist/setup-secrets.js +15 -0
- package/dist/setup-secrets.test.d.ts +1 -0
- package/dist/setup-secrets.test.js +30 -0
- package/dist/setup-sources.d.ts +98 -0
- package/dist/setup-sources.js +969 -0
- package/dist/setup-sources.test.d.ts +1 -0
- package/dist/setup-sources.test.js +582 -0
- package/dist/setup.d.ts +157 -0
- package/dist/setup.js +488 -0
- package/dist/setup.test.d.ts +1 -0
- package/dist/setup.test.js +1220 -0
- package/dist/sl.d.ts +59 -0
- package/dist/sl.js +98 -0
- package/dist/sl.test.d.ts +1 -0
- package/dist/sl.test.js +333 -0
- package/dist/standalone-smoke.test.d.ts +1 -0
- package/dist/standalone-smoke.test.js +714 -0
- package/dist/startup-profile.d.ts +3 -0
- package/dist/startup-profile.js +44 -0
- package/dist/viz-fallback.d.ts +28 -0
- package/dist/viz-fallback.js +51 -0
- package/dist/viz-fallback.test.d.ts +1 -0
- package/dist/viz-fallback.test.js +77 -0
- package/node_modules/@ktx/connector-bigquery/dist/connector.d.ts +136 -0
- package/node_modules/@ktx/connector-bigquery/dist/connector.js +336 -0
- package/node_modules/@ktx/connector-bigquery/dist/connector.test.d.ts +1 -0
- package/node_modules/@ktx/connector-bigquery/dist/connector.test.js +238 -0
- package/node_modules/@ktx/connector-bigquery/dist/dialect.d.ts +29 -0
- package/node_modules/@ktx/connector-bigquery/dist/dialect.js +178 -0
- package/node_modules/@ktx/connector-bigquery/dist/dialect.test.d.ts +1 -0
- package/node_modules/@ktx/connector-bigquery/dist/dialect.test.js +36 -0
- package/node_modules/@ktx/connector-bigquery/dist/index.d.ts +3 -0
- package/node_modules/@ktx/connector-bigquery/dist/index.js +3 -0
- package/node_modules/@ktx/connector-bigquery/dist/live-database-introspection.d.ts +10 -0
- package/node_modules/@ktx/connector-bigquery/dist/live-database-introspection.js +20 -0
- package/node_modules/@ktx/connector-bigquery/dist/package-exports.test.d.ts +1 -0
- package/node_modules/@ktx/connector-bigquery/dist/package-exports.test.js +10 -0
- package/node_modules/@ktx/connector-bigquery/package.json +23 -0
- package/node_modules/@ktx/connector-clickhouse/dist/connector.d.ts +113 -0
- package/node_modules/@ktx/connector-clickhouse/dist/connector.js +331 -0
- package/node_modules/@ktx/connector-clickhouse/dist/connector.test.d.ts +1 -0
- package/node_modules/@ktx/connector-clickhouse/dist/connector.test.js +236 -0
- package/node_modules/@ktx/connector-clickhouse/dist/dialect.d.ts +33 -0
- package/node_modules/@ktx/connector-clickhouse/dist/dialect.js +236 -0
- package/node_modules/@ktx/connector-clickhouse/dist/dialect.test.d.ts +1 -0
- package/node_modules/@ktx/connector-clickhouse/dist/dialect.test.js +36 -0
- package/node_modules/@ktx/connector-clickhouse/dist/index.d.ts +3 -0
- package/node_modules/@ktx/connector-clickhouse/dist/index.js +3 -0
- package/node_modules/@ktx/connector-clickhouse/dist/live-database-introspection.d.ts +11 -0
- package/node_modules/@ktx/connector-clickhouse/dist/live-database-introspection.js +21 -0
- package/node_modules/@ktx/connector-clickhouse/dist/package-exports.test.d.ts +1 -0
- package/node_modules/@ktx/connector-clickhouse/dist/package-exports.test.js +10 -0
- package/node_modules/@ktx/connector-clickhouse/package.json +23 -0
- package/node_modules/@ktx/connector-mysql/dist/connector.d.ts +116 -0
- package/node_modules/@ktx/connector-mysql/dist/connector.js +369 -0
- package/node_modules/@ktx/connector-mysql/dist/connector.test.d.ts +1 -0
- package/node_modules/@ktx/connector-mysql/dist/connector.test.js +226 -0
- package/node_modules/@ktx/connector-mysql/dist/dialect.d.ts +29 -0
- package/node_modules/@ktx/connector-mysql/dist/dialect.js +171 -0
- package/node_modules/@ktx/connector-mysql/dist/dialect.test.d.ts +1 -0
- package/node_modules/@ktx/connector-mysql/dist/dialect.test.js +36 -0
- package/node_modules/@ktx/connector-mysql/dist/index.d.ts +3 -0
- package/node_modules/@ktx/connector-mysql/dist/index.js +3 -0
- package/node_modules/@ktx/connector-mysql/dist/live-database-introspection.d.ts +11 -0
- package/node_modules/@ktx/connector-mysql/dist/live-database-introspection.js +21 -0
- package/node_modules/@ktx/connector-mysql/dist/package-exports.test.d.ts +1 -0
- package/node_modules/@ktx/connector-mysql/dist/package-exports.test.js +11 -0
- package/node_modules/@ktx/connector-mysql/package.json +23 -0
- package/node_modules/@ktx/connector-postgres/dist/connector.d.ts +135 -0
- package/node_modules/@ktx/connector-postgres/dist/connector.js +460 -0
- package/node_modules/@ktx/connector-postgres/dist/connector.test.d.ts +1 -0
- package/node_modules/@ktx/connector-postgres/dist/connector.test.js +289 -0
- package/node_modules/@ktx/connector-postgres/dist/dialect.d.ts +29 -0
- package/node_modules/@ktx/connector-postgres/dist/dialect.js +182 -0
- package/node_modules/@ktx/connector-postgres/dist/dialect.test.d.ts +1 -0
- package/node_modules/@ktx/connector-postgres/dist/dialect.test.js +37 -0
- package/node_modules/@ktx/connector-postgres/dist/historic-sql-query-client.d.ts +14 -0
- package/node_modules/@ktx/connector-postgres/dist/historic-sql-query-client.js +24 -0
- package/node_modules/@ktx/connector-postgres/dist/historic-sql-query-client.test.d.ts +1 -0
- package/node_modules/@ktx/connector-postgres/dist/historic-sql-query-client.test.js +46 -0
- package/node_modules/@ktx/connector-postgres/dist/index.d.ts +4 -0
- package/node_modules/@ktx/connector-postgres/dist/index.js +4 -0
- package/node_modules/@ktx/connector-postgres/dist/live-database-introspection.d.ts +11 -0
- package/node_modules/@ktx/connector-postgres/dist/live-database-introspection.js +21 -0
- package/node_modules/@ktx/connector-postgres/dist/package-exports.test.d.ts +1 -0
- package/node_modules/@ktx/connector-postgres/dist/package-exports.test.js +12 -0
- package/node_modules/@ktx/connector-postgres/package.json +23 -0
- package/node_modules/@ktx/connector-posthog/dist/connector.d.ts +90 -0
- package/node_modules/@ktx/connector-posthog/dist/connector.js +441 -0
- package/node_modules/@ktx/connector-posthog/dist/connector.test.d.ts +1 -0
- package/node_modules/@ktx/connector-posthog/dist/connector.test.js +342 -0
- package/node_modules/@ktx/connector-posthog/dist/dialect.d.ts +37 -0
- package/node_modules/@ktx/connector-posthog/dist/dialect.js +220 -0
- package/node_modules/@ktx/connector-posthog/dist/dialect.test.d.ts +1 -0
- package/node_modules/@ktx/connector-posthog/dist/dialect.test.js +34 -0
- package/node_modules/@ktx/connector-posthog/dist/index.d.ts +4 -0
- package/node_modules/@ktx/connector-posthog/dist/index.js +4 -0
- package/node_modules/@ktx/connector-posthog/dist/live-database-introspection.d.ts +12 -0
- package/node_modules/@ktx/connector-posthog/dist/live-database-introspection.js +22 -0
- package/node_modules/@ktx/connector-posthog/dist/package-exports.test.d.ts +1 -0
- package/node_modules/@ktx/connector-posthog/dist/package-exports.test.js +10 -0
- package/node_modules/@ktx/connector-posthog/dist/schema-descriptions.d.ts +3 -0
- package/node_modules/@ktx/connector-posthog/dist/schema-descriptions.js +90 -0
- package/node_modules/@ktx/connector-posthog/package.json +21 -0
- package/node_modules/@ktx/connector-snowflake/dist/connector.d.ts +128 -0
- package/node_modules/@ktx/connector-snowflake/dist/connector.js +494 -0
- package/node_modules/@ktx/connector-snowflake/dist/connector.test.d.ts +1 -0
- package/node_modules/@ktx/connector-snowflake/dist/connector.test.js +215 -0
- package/node_modules/@ktx/connector-snowflake/dist/dialect.d.ts +29 -0
- package/node_modules/@ktx/connector-snowflake/dist/dialect.js +156 -0
- package/node_modules/@ktx/connector-snowflake/dist/dialect.test.d.ts +1 -0
- package/node_modules/@ktx/connector-snowflake/dist/dialect.test.js +34 -0
- package/node_modules/@ktx/connector-snowflake/dist/index.d.ts +3 -0
- package/node_modules/@ktx/connector-snowflake/dist/index.js +3 -0
- package/node_modules/@ktx/connector-snowflake/dist/live-database-introspection.d.ts +11 -0
- package/node_modules/@ktx/connector-snowflake/dist/live-database-introspection.js +21 -0
- package/node_modules/@ktx/connector-snowflake/dist/package-exports.test.d.ts +1 -0
- package/node_modules/@ktx/connector-snowflake/dist/package-exports.test.js +10 -0
- package/node_modules/@ktx/connector-snowflake/package.json +23 -0
- package/node_modules/@ktx/connector-sqlite/dist/connector.d.ts +61 -0
- package/node_modules/@ktx/connector-sqlite/dist/connector.js +255 -0
- package/node_modules/@ktx/connector-sqlite/dist/connector.test.d.ts +1 -0
- package/node_modules/@ktx/connector-sqlite/dist/connector.test.js +191 -0
- package/node_modules/@ktx/connector-sqlite/dist/dialect.d.ts +29 -0
- package/node_modules/@ktx/connector-sqlite/dist/dialect.js +146 -0
- package/node_modules/@ktx/connector-sqlite/dist/dialect.test.d.ts +1 -0
- package/node_modules/@ktx/connector-sqlite/dist/dialect.test.js +23 -0
- package/node_modules/@ktx/connector-sqlite/dist/index.d.ts +3 -0
- package/node_modules/@ktx/connector-sqlite/dist/index.js +3 -0
- package/node_modules/@ktx/connector-sqlite/dist/live-database-introspection.d.ts +8 -0
- package/node_modules/@ktx/connector-sqlite/dist/live-database-introspection.js +20 -0
- package/node_modules/@ktx/connector-sqlite/dist/package-exports.test.d.ts +1 -0
- package/node_modules/@ktx/connector-sqlite/dist/package-exports.test.js +11 -0
- package/node_modules/@ktx/connector-sqlite/package.json +23 -0
- package/node_modules/@ktx/connector-sqlserver/dist/connector.d.ts +137 -0
- package/node_modules/@ktx/connector-sqlserver/dist/connector.js +482 -0
- package/node_modules/@ktx/connector-sqlserver/dist/connector.test.d.ts +1 -0
- package/node_modules/@ktx/connector-sqlserver/dist/connector.test.js +278 -0
- package/node_modules/@ktx/connector-sqlserver/dist/dialect.d.ts +30 -0
- package/node_modules/@ktx/connector-sqlserver/dist/dialect.js +169 -0
- package/node_modules/@ktx/connector-sqlserver/dist/dialect.test.d.ts +1 -0
- package/node_modules/@ktx/connector-sqlserver/dist/dialect.test.js +36 -0
- package/node_modules/@ktx/connector-sqlserver/dist/index.d.ts +3 -0
- package/node_modules/@ktx/connector-sqlserver/dist/index.js +3 -0
- package/node_modules/@ktx/connector-sqlserver/dist/live-database-introspection.d.ts +11 -0
- package/node_modules/@ktx/connector-sqlserver/dist/live-database-introspection.js +21 -0
- package/node_modules/@ktx/connector-sqlserver/dist/package-exports.test.d.ts +1 -0
- package/node_modules/@ktx/connector-sqlserver/dist/package-exports.test.js +10 -0
- package/node_modules/@ktx/connector-sqlserver/package.json +23 -0
- package/node_modules/@ktx/context/dist/agent/agent-runner.service.d.ts +37 -0
- package/node_modules/@ktx/context/dist/agent/agent-runner.service.js +61 -0
- package/node_modules/@ktx/context/dist/agent/agent-runner.service.test.d.ts +1 -0
- package/node_modules/@ktx/context/dist/agent/agent-runner.service.test.js +304 -0
- package/node_modules/@ktx/context/dist/agent/index.d.ts +2 -0
- package/node_modules/@ktx/context/dist/agent/index.js +1 -0
- package/node_modules/@ktx/context/dist/connections/connection-type.d.ts +26 -0
- package/node_modules/@ktx/context/dist/connections/connection-type.js +25 -0
- package/node_modules/@ktx/context/dist/connections/index.d.ts +9 -0
- package/node_modules/@ktx/context/dist/connections/index.js +8 -0
- package/node_modules/@ktx/context/dist/connections/local-query-executor.d.ts +6 -0
- package/node_modules/@ktx/context/dist/connections/local-query-executor.js +21 -0
- package/node_modules/@ktx/context/dist/connections/local-query-executor.test.d.ts +1 -0
- package/node_modules/@ktx/context/dist/connections/local-query-executor.test.js +48 -0
- package/node_modules/@ktx/context/dist/connections/local-warehouse-descriptor.d.ts +20 -0
- package/node_modules/@ktx/context/dist/connections/local-warehouse-descriptor.js +72 -0
- package/node_modules/@ktx/context/dist/connections/local-warehouse-descriptor.test.d.ts +1 -0
- package/node_modules/@ktx/context/dist/connections/local-warehouse-descriptor.test.js +49 -0
- package/node_modules/@ktx/context/dist/connections/notion-config.d.ts +37 -0
- package/node_modules/@ktx/context/dist/connections/notion-config.js +128 -0
- package/node_modules/@ktx/context/dist/connections/notion-config.test.d.ts +1 -0
- package/node_modules/@ktx/context/dist/connections/notion-config.test.js +91 -0
- package/node_modules/@ktx/context/dist/connections/postgres-query-executor.d.ts +25 -0
- package/node_modules/@ktx/context/dist/connections/postgres-query-executor.js +55 -0
- package/node_modules/@ktx/context/dist/connections/postgres-query-executor.test.d.ts +1 -0
- package/node_modules/@ktx/context/dist/connections/postgres-query-executor.test.js +96 -0
- package/node_modules/@ktx/context/dist/connections/query-executor.d.ts +19 -0
- package/node_modules/@ktx/context/dist/connections/query-executor.js +3 -0
- package/node_modules/@ktx/context/dist/connections/read-only-sql.d.ts +2 -0
- package/node_modules/@ktx/context/dist/connections/read-only-sql.js +19 -0
- package/node_modules/@ktx/context/dist/connections/read-only-sql.test.d.ts +1 -0
- package/node_modules/@ktx/context/dist/connections/read-only-sql.test.js +20 -0
- package/node_modules/@ktx/context/dist/connections/sqlite-query-executor.d.ts +3 -0
- package/node_modules/@ktx/context/dist/connections/sqlite-query-executor.js +76 -0
- package/node_modules/@ktx/context/dist/connections/sqlite-query-executor.test.d.ts +1 -0
- package/node_modules/@ktx/context/dist/connections/sqlite-query-executor.test.js +119 -0
- package/node_modules/@ktx/context/dist/core/config-reference.d.ts +2 -0
- package/node_modules/@ktx/context/dist/core/config-reference.js +29 -0
- package/node_modules/@ktx/context/dist/core/config-reference.test.d.ts +1 -0
- package/node_modules/@ktx/context/dist/core/config-reference.test.js +27 -0
- package/node_modules/@ktx/context/dist/core/config.d.ts +25 -0
- package/node_modules/@ktx/context/dist/core/config.js +14 -0
- package/node_modules/@ktx/context/dist/core/embedding.d.ts +5 -0
- package/node_modules/@ktx/context/dist/core/embedding.js +1 -0
- package/node_modules/@ktx/context/dist/core/file-store.d.ts +30 -0
- package/node_modules/@ktx/context/dist/core/file-store.js +1 -0
- package/node_modules/@ktx/context/dist/core/git-env.d.ts +2 -0
- package/node_modules/@ktx/context/dist/core/git-env.js +26 -0
- package/node_modules/@ktx/context/dist/core/git.service.assert-worktree-clean.test.d.ts +1 -0
- package/node_modules/@ktx/context/dist/core/git.service.assert-worktree-clean.test.js +62 -0
- package/node_modules/@ktx/context/dist/core/git.service.d.ts +181 -0
- package/node_modules/@ktx/context/dist/core/git.service.delete-directories.test.d.ts +1 -0
- package/node_modules/@ktx/context/dist/core/git.service.delete-directories.test.js +61 -0
- package/node_modules/@ktx/context/dist/core/git.service.js +720 -0
- package/node_modules/@ktx/context/dist/core/git.service.reset-hard.test.d.ts +1 -0
- package/node_modules/@ktx/context/dist/core/git.service.reset-hard.test.js +47 -0
- package/node_modules/@ktx/context/dist/core/git.service.test.d.ts +1 -0
- package/node_modules/@ktx/context/dist/core/git.service.test.js +284 -0
- package/node_modules/@ktx/context/dist/core/index.d.ts +10 -0
- package/node_modules/@ktx/context/dist/core/index.js +5 -0
- package/node_modules/@ktx/context/dist/core/redaction.d.ts +4 -0
- package/node_modules/@ktx/context/dist/core/redaction.js +39 -0
- package/node_modules/@ktx/context/dist/core/session-worktree.service.d.ts +38 -0
- package/node_modules/@ktx/context/dist/core/session-worktree.service.js +65 -0
- package/node_modules/@ktx/context/dist/core/session-worktree.service.test.d.ts +1 -0
- package/node_modules/@ktx/context/dist/core/session-worktree.service.test.js +97 -0
- package/node_modules/@ktx/context/dist/daemon/index.d.ts +1 -0
- package/node_modules/@ktx/context/dist/daemon/index.js +1 -0
- package/node_modules/@ktx/context/dist/daemon/semantic-layer-compute.d.ts +72 -0
- package/node_modules/@ktx/context/dist/daemon/semantic-layer-compute.js +191 -0
- package/node_modules/@ktx/context/dist/daemon/semantic-layer-compute.test.d.ts +1 -0
- package/node_modules/@ktx/context/dist/daemon/semantic-layer-compute.test.js +301 -0
- package/node_modules/@ktx/context/dist/index.d.ts +21 -0
- package/node_modules/@ktx/context/dist/index.js +18 -0
- package/node_modules/@ktx/context/dist/index.test.d.ts +1 -0
- package/node_modules/@ktx/context/dist/index.test.js +10 -0
- package/node_modules/@ktx/context/dist/ingest/action-identity.d.ts +3 -0
- package/node_modules/@ktx/context/dist/ingest/action-identity.js +6 -0
- package/node_modules/@ktx/context/dist/ingest/action-identity.test.d.ts +1 -0
- package/node_modules/@ktx/context/dist/ingest/action-identity.test.js +19 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/dbt/chunk.d.ts +7 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/dbt/chunk.js +110 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/dbt/chunk.test.d.ts +1 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/dbt/chunk.test.js +30 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/dbt/dbt.adapter.d.ts +16 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/dbt/dbt.adapter.js +40 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/dbt/dbt.adapter.test.d.ts +1 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/dbt/dbt.adapter.test.js +39 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/dbt/detect.d.ts +1 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/dbt/detect.js +12 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/dbt/fetch.d.ts +19 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/dbt/fetch.js +43 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/dbt/fetch.test.d.ts +1 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/dbt/fetch.test.js +30 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/dbt/parse.d.ts +6 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/dbt/parse.js +23 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/dbt/parse.test.d.ts +1 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/dbt/parse.test.js +7 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/dbt-descriptions/match-tables.d.ts +27 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/dbt-descriptions/match-tables.js +80 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/dbt-descriptions/match-tables.test.d.ts +1 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/dbt-descriptions/match-tables.test.js +59 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/dbt-descriptions/merge-semantic-model-tables.d.ts +3 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/dbt-descriptions/merge-semantic-model-tables.js +28 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/dbt-descriptions/merge-semantic-model-tables.test.d.ts +1 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/dbt-descriptions/merge-semantic-model-tables.test.js +55 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/dbt-descriptions/parse-schema.d.ts +65 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/dbt-descriptions/parse-schema.js +432 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/dbt-descriptions/parse-schema.test.d.ts +1 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/dbt-descriptions/parse-schema.test.js +195 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/dbt-descriptions/to-description-updates.d.ts +13 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/dbt-descriptions/to-description-updates.js +46 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/dbt-descriptions/to-description-updates.test.d.ts +1 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/dbt-descriptions/to-description-updates.test.js +88 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/dbt-descriptions/to-metadata-updates.d.ts +9 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/dbt-descriptions/to-metadata-updates.js +57 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/dbt-descriptions/to-metadata-updates.test.d.ts +1 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/dbt-descriptions/to-metadata-updates.test.js +68 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/dbt-descriptions/to-relationship-updates.d.ts +12 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/dbt-descriptions/to-relationship-updates.js +34 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/dbt-descriptions/to-relationship-updates.test.d.ts +1 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/dbt-descriptions/to-relationship-updates.test.js +56 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/dbt-extraction-golden-parity.test.d.ts +1 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/dbt-extraction-golden-parity.test.js +392 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/fake/fake.adapter.d.ts +7 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/fake/fake.adapter.js +42 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/historic-sql/bigquery-query-history-reader.d.ts +11 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/historic-sql/bigquery-query-history-reader.js +175 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/historic-sql/bigquery-query-history-reader.test.d.ts +1 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/historic-sql/bigquery-query-history-reader.test.js +163 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/historic-sql/chunk.d.ts +3 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/historic-sql/chunk.js +75 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/historic-sql/chunk.test.d.ts +1 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/historic-sql/chunk.test.js +228 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/historic-sql/detect.d.ts +1 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/historic-sql/detect.js +37 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/historic-sql/detect.test.d.ts +1 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/historic-sql/detect.test.js +167 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/historic-sql/errors.d.ts +35 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/historic-sql/errors.js +32 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/historic-sql/historic-sql.adapter.d.ts +25 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/historic-sql/historic-sql.adapter.js +90 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/historic-sql/historic-sql.adapter.test.d.ts +1 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/historic-sql/historic-sql.adapter.test.js +259 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/historic-sql/postgres-pgss-query-history-reader.d.ts +8 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/historic-sql/postgres-pgss-query-history-reader.js +202 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/historic-sql/postgres-pgss-query-history-reader.test.d.ts +1 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/historic-sql/postgres-pgss-query-history-reader.test.js +248 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/historic-sql/snowflake-query-history-reader.d.ts +5 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/historic-sql/snowflake-query-history-reader.js +165 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/historic-sql/snowflake-query-history-reader.test.d.ts +1 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/historic-sql/snowflake-query-history-reader.test.js +162 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/historic-sql/stage-pgss-golden.test.d.ts +1 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/historic-sql/stage-pgss-golden.test.js +107 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/historic-sql/stage-pgss.d.ts +37 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/historic-sql/stage-pgss.js +364 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/historic-sql/stage-pgss.test.d.ts +1 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/historic-sql/stage-pgss.test.js +592 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/historic-sql/stage.d.ts +13 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/historic-sql/stage.js +442 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/historic-sql/stage.test.d.ts +1 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/historic-sql/stage.test.js +727 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/historic-sql/types.d.ts +209 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/historic-sql/types.js +93 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/live-database/chunk.d.ts +2 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/live-database/chunk.js +44 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/live-database/chunk.test.d.ts +1 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/live-database/chunk.test.js +95 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/live-database/daemon-introspection.d.ts +20 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/live-database/daemon-introspection.js +190 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/live-database/daemon-introspection.test.d.ts +1 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/live-database/daemon-introspection.test.js +209 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/live-database/extracted-schema.d.ts +29 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/live-database/extracted-schema.js +28 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/live-database/extracted-schema.test.d.ts +1 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/live-database/extracted-schema.test.js +129 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/live-database/live-database.adapter.d.ts +11 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/live-database/live-database.adapter.js +24 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/live-database/live-database.adapter.test.d.ts +1 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/live-database/live-database.adapter.test.js +55 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/live-database/manifest.d.ts +60 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/live-database/manifest.js +160 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/live-database/manifest.test.d.ts +1 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/live-database/manifest.test.js +238 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/live-database/stage.d.ts +12 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/live-database/stage.js +105 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/live-database/stage.test.d.ts +1 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/live-database/stage.test.js +133 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/live-database/structural-sync.d.ts +89 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/live-database/structural-sync.js +335 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/live-database/structural-sync.test.d.ts +1 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/live-database/structural-sync.test.js +416 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/live-database/types.d.ts +8 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/live-database/types.js +1 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/looker/chunk.d.ts +2 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/looker/chunk.js +146 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/looker/chunk.test.d.ts +1 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/looker/chunk.test.js +142 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/looker/client-boundary.test.d.ts +1 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/looker/client-boundary.test.js +12 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/looker/client.d.ts +83 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/looker/client.js +554 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/looker/client.test.d.ts +1 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/looker/client.test.js +392 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/looker/daemon-table-identifier-parser.d.ts +7 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/looker/daemon-table-identifier-parser.js +57 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/looker/daemon-table-identifier-parser.test.d.ts +1 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/looker/daemon-table-identifier-parser.test.js +40 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/looker/detect.d.ts +1 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/looker/detect.js +26 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/looker/detect.test.d.ts +1 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/looker/detect.test.js +39 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/looker/evidence-documents.d.ts +3 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/looker/evidence-documents.js +311 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/looker/evidence-documents.test.d.ts +1 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/looker/evidence-documents.test.js +178 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/looker/factory.d.ts +21 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/looker/factory.js +22 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/looker/factory.test.d.ts +1 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/looker/factory.test.js +55 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/looker/fetch-report.d.ts +3 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/looker/fetch-report.js +21 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/looker/fetch-report.test.d.ts +1 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/looker/fetch-report.test.js +71 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/looker/fetch.d.ts +31 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/looker/fetch.js +395 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/looker/fetch.test.d.ts +1 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/looker/fetch.test.js +592 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/looker/local-looker.adapter.d.ts +10 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/looker/local-looker.adapter.js +45 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/looker/local-runtime-store.d.ts +50 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/looker/local-runtime-store.js +196 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/looker/local-runtime-store.test.d.ts +1 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/looker/local-runtime-store.test.js +106 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/looker/looker.adapter.d.ts +57 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/looker/looker.adapter.js +47 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/looker/looker.adapter.test.d.ts +1 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/looker/looker.adapter.test.js +99 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/looker/mapping.d.ts +126 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/looker/mapping.js +303 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/looker/mapping.test.d.ts +1 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/looker/mapping.test.js +334 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/looker/reconcile.d.ts +2 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/looker/reconcile.js +20 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/looker/reconcile.test.d.ts +1 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/looker/reconcile.test.js +22 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/looker/scope.d.ts +6 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/looker/scope.js +55 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/looker/scope.test.d.ts +1 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/looker/scope.test.js +84 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/looker/target-connections.d.ts +1 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/looker/target-connections.js +38 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/looker/target-connections.test.d.ts +1 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/looker/target-connections.test.js +71 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/looker/tools/looker-query-to-sl.tool.d.ts +107 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/looker/tools/looker-query-to-sl.tool.js +236 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/looker/tools/looker-query-to-sl.tool.test.d.ts +1 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/looker/tools/looker-query-to-sl.tool.test.js +211 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/looker/types.d.ts +439 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/looker/types.js +198 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/looker/types.test.d.ts +1 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/looker/types.test.js +260 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/lookml/chunk.d.ts +19 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/lookml/chunk.js +128 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/lookml/chunk.test.d.ts +1 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/lookml/chunk.test.js +213 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/lookml/detect.d.ts +1 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/lookml/detect.js +11 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/lookml/detect.test.d.ts +1 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/lookml/detect.test.js +37 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/lookml/fetch-report.d.ts +15 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/lookml/fetch-report.js +98 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/lookml/fetch-report.test.d.ts +1 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/lookml/fetch-report.test.js +82 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/lookml/fetch.d.ts +15 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/lookml/fetch.js +54 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/lookml/fetch.test.d.ts +1 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/lookml/fetch.test.js +121 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/lookml/graph.d.ts +16 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/lookml/graph.js +85 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/lookml/graph.test.d.ts +1 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/lookml/graph.test.js +105 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/lookml/lookml.adapter.d.ts +15 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/lookml/lookml.adapter.js +38 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/lookml/lookml.adapter.test.d.ts +1 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/lookml/lookml.adapter.test.js +39 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/lookml/parse.d.ts +35 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/lookml/parse.js +149 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/lookml/parse.test.d.ts +1 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/lookml/parse.test.js +118 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/lookml/pull-config.d.ts +37 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/lookml/pull-config.js +26 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/lookml/pull-config.test.d.ts +1 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/lookml/pull-config.test.js +128 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/metabase/card-references.d.ts +13 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/metabase/card-references.js +37 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/metabase/card-references.test.d.ts +1 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/metabase/card-references.test.js +36 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/metabase/chunk.d.ts +6 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/metabase/chunk.js +208 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/metabase/chunk.test.d.ts +1 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/metabase/chunk.test.js +288 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/metabase/client-boundary.test.d.ts +1 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/metabase/client-boundary.test.js +38 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/metabase/client-port.d.ts +167 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/metabase/client-port.js +9 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/metabase/client-port.test.d.ts +1 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/metabase/client-port.test.js +83 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/metabase/client.d.ts +121 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/metabase/client.js +604 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/metabase/client.test.d.ts +1 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/metabase/client.test.js +305 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/metabase/detect.d.ts +1 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/metabase/detect.js +20 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/metabase/detect.test.d.ts +1 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/metabase/detect.test.js +42 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/metabase/fanout-planner.d.ts +17 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/metabase/fanout-planner.js +23 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/metabase/fanout-planner.test.d.ts +1 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/metabase/fanout-planner.test.js +44 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/metabase/fetch-scope.d.ts +31 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/metabase/fetch-scope.js +72 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/metabase/fetch-scope.test.d.ts +1 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/metabase/fetch-scope.test.js +128 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/metabase/fetch.d.ts +11 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/metabase/fetch.js +235 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/metabase/fetch.test.d.ts +1 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/metabase/fetch.test.js +472 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/metabase/local-metabase.adapter.d.ts +10 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/metabase/local-metabase.adapter.js +45 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/metabase/local-metabase.adapter.test.d.ts +1 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/metabase/local-metabase.adapter.test.js +44 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/metabase/local-source-state-store.d.ts +85 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/metabase/local-source-state-store.js +369 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/metabase/local-source-state-store.test.d.ts +1 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/metabase/local-source-state-store.test.js +292 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/metabase/mapping.d.ts +92 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/metabase/mapping.js +220 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/metabase/mapping.test.d.ts +1 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/metabase/mapping.test.js +215 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/metabase/metabase.adapter.d.ts +17 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/metabase/metabase.adapter.js +40 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/metabase/metabase.adapter.test.d.ts +1 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/metabase/metabase.adapter.test.js +129 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/metabase/serialize-card.d.ts +53 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/metabase/serialize-card.js +67 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/metabase/serialize-card.test.d.ts +1 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/metabase/serialize-card.test.js +205 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/metabase/source-state-port.d.ts +21 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/metabase/source-state-port.js +1 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/metabase/types.d.ts +142 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/metabase/types.js +106 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/metabase/types.test.d.ts +1 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/metabase/types.test.js +75 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/metricflow/chunk.d.ts +19 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/metricflow/chunk.js +81 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/metricflow/chunk.test.d.ts +1 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/metricflow/chunk.test.js +114 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/metricflow/deep-parse.d.ts +77 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/metricflow/deep-parse.js +460 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/metricflow/deep-parse.test.d.ts +1 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/metricflow/deep-parse.test.js +1139 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/metricflow/detect.d.ts +1 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/metricflow/detect.js +34 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/metricflow/detect.test.d.ts +1 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/metricflow/detect.test.js +43 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/metricflow/fetch.d.ts +11 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/metricflow/fetch.js +51 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/metricflow/fetch.test.d.ts +1 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/metricflow/fetch.test.js +97 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/metricflow/graph.d.ts +25 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/metricflow/graph.js +163 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/metricflow/graph.test.d.ts +1 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/metricflow/graph.test.js +245 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/metricflow/import-semantic-models.d.ts +29 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/metricflow/import-semantic-models.js +152 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/metricflow/import-semantic-models.test.d.ts +1 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/metricflow/import-semantic-models.test.js +318 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/metricflow/metricflow.adapter.d.ts +14 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/metricflow/metricflow.adapter.js +38 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/metricflow/metricflow.adapter.test.d.ts +1 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/metricflow/metricflow.adapter.test.js +90 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/metricflow/parse.d.ts +42 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/metricflow/parse.js +150 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/metricflow/parse.test.d.ts +1 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/metricflow/parse.test.js +171 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/metricflow/pull-config.d.ts +37 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/metricflow/pull-config.js +24 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/metricflow/pull-config.test.d.ts +1 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/metricflow/pull-config.test.js +57 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/metricflow/semantic-models.d.ts +39 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/metricflow/semantic-models.js +278 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/metricflow/semantic-models.test.d.ts +1 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/metricflow/semantic-models.test.js +204 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/notion/chunk.d.ts +4 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/notion/chunk.js +134 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/notion/cluster.d.ts +10 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/notion/cluster.js +81 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/notion/cluster.test.d.ts +1 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/notion/cluster.test.js +106 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/notion/detect.d.ts +1 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/notion/detect.js +20 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/notion/fetch.d.ts +9 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/notion/fetch.js +513 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/notion/fetch.test.d.ts +1 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/notion/fetch.test.js +355 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/notion/normalize.d.ts +10 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/notion/normalize.js +165 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/notion/normalize.test.d.ts +1 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/notion/normalize.test.js +64 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/notion/notion-client.d.ts +74 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/notion/notion-client.js +107 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/notion/notion-client.test.d.ts +1 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/notion/notion-client.test.js +49 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/notion/notion.adapter.d.ts +42 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/notion/notion.adapter.js +108 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/notion/notion.adapter.test.d.ts +1 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/notion/notion.adapter.test.js +271 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/notion/pull-config.d.ts +2 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/notion/pull-config.js +4 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/notion/types.d.ts +96 -0
- package/node_modules/@ktx/context/dist/ingest/adapters/notion/types.js +61 -0
- package/node_modules/@ktx/context/dist/ingest/canonical-pins.d.ts +10 -0
- package/node_modules/@ktx/context/dist/ingest/canonical-pins.js +43 -0
- package/node_modules/@ktx/context/dist/ingest/canonical-pins.test.d.ts +1 -0
- package/node_modules/@ktx/context/dist/ingest/canonical-pins.test.js +66 -0
- package/node_modules/@ktx/context/dist/ingest/clustering/kmeans.d.ts +11 -0
- package/node_modules/@ktx/context/dist/ingest/clustering/kmeans.js +101 -0
- package/node_modules/@ktx/context/dist/ingest/clustering/kmeans.test.d.ts +1 -0
- package/node_modules/@ktx/context/dist/ingest/clustering/kmeans.test.js +61 -0
- package/node_modules/@ktx/context/dist/ingest/context-candidates/candidate-dedup.service.d.ts +27 -0
- package/node_modules/@ktx/context/dist/ingest/context-candidates/candidate-dedup.service.js +234 -0
- package/node_modules/@ktx/context/dist/ingest/context-candidates/candidate-dedup.service.test.d.ts +1 -0
- package/node_modules/@ktx/context/dist/ingest/context-candidates/candidate-dedup.service.test.js +216 -0
- package/node_modules/@ktx/context/dist/ingest/context-candidates/context-candidate-carryforward.service.d.ts +31 -0
- package/node_modules/@ktx/context/dist/ingest/context-candidates/context-candidate-carryforward.service.js +131 -0
- package/node_modules/@ktx/context/dist/ingest/context-candidates/context-candidate-carryforward.service.test.d.ts +1 -0
- package/node_modules/@ktx/context/dist/ingest/context-candidates/context-candidate-carryforward.service.test.js +161 -0
- package/node_modules/@ktx/context/dist/ingest/context-candidates/curator-pagination.service.d.ts +65 -0
- package/node_modules/@ktx/context/dist/ingest/context-candidates/curator-pagination.service.js +240 -0
- package/node_modules/@ktx/context/dist/ingest/context-candidates/curator-pagination.service.test.d.ts +1 -0
- package/node_modules/@ktx/context/dist/ingest/context-candidates/curator-pagination.service.test.js +168 -0
- package/node_modules/@ktx/context/dist/ingest/context-candidates/embedding-text.d.ts +6 -0
- package/node_modules/@ktx/context/dist/ingest/context-candidates/embedding-text.js +3 -0
- package/node_modules/@ktx/context/dist/ingest/context-candidates/embedding-text.test.d.ts +1 -0
- package/node_modules/@ktx/context/dist/ingest/context-candidates/embedding-text.test.js +10 -0
- package/node_modules/@ktx/context/dist/ingest/context-candidates/index.d.ts +9 -0
- package/node_modules/@ktx/context/dist/ingest/context-candidates/index.js +4 -0
- package/node_modules/@ktx/context/dist/ingest/context-candidates/store.d.ts +24 -0
- package/node_modules/@ktx/context/dist/ingest/context-candidates/store.js +1 -0
- package/node_modules/@ktx/context/dist/ingest/context-candidates/store.test.d.ts +1 -0
- package/node_modules/@ktx/context/dist/ingest/context-candidates/store.test.js +67 -0
- package/node_modules/@ktx/context/dist/ingest/context-candidates/types.d.ts +103 -0
- package/node_modules/@ktx/context/dist/ingest/context-candidates/types.js +1 -0
- package/node_modules/@ktx/context/dist/ingest/context-evidence/context-evidence-index.service.d.ts +53 -0
- package/node_modules/@ktx/context/dist/ingest/context-evidence/context-evidence-index.service.js +303 -0
- package/node_modules/@ktx/context/dist/ingest/context-evidence/context-evidence-index.service.test.d.ts +1 -0
- package/node_modules/@ktx/context/dist/ingest/context-evidence/context-evidence-index.service.test.js +374 -0
- package/node_modules/@ktx/context/dist/ingest/context-evidence/index.d.ts +5 -0
- package/node_modules/@ktx/context/dist/ingest/context-evidence/index.js +2 -0
- package/node_modules/@ktx/context/dist/ingest/context-evidence/sqlite-context-evidence-store.d.ts +89 -0
- package/node_modules/@ktx/context/dist/ingest/context-evidence/sqlite-context-evidence-store.js +1025 -0
- package/node_modules/@ktx/context/dist/ingest/context-evidence/sqlite-context-evidence-store.test.d.ts +1 -0
- package/node_modules/@ktx/context/dist/ingest/context-evidence/sqlite-context-evidence-store.test.js +416 -0
- package/node_modules/@ktx/context/dist/ingest/context-evidence/store.d.ts +10 -0
- package/node_modules/@ktx/context/dist/ingest/context-evidence/store.js +1 -0
- package/node_modules/@ktx/context/dist/ingest/context-evidence/store.test.d.ts +1 -0
- package/node_modules/@ktx/context/dist/ingest/context-evidence/store.test.js +55 -0
- package/node_modules/@ktx/context/dist/ingest/context-evidence/types.d.ts +49 -0
- package/node_modules/@ktx/context/dist/ingest/context-evidence/types.js +1 -0
- package/node_modules/@ktx/context/dist/ingest/dbt-shared/project-vars.d.ts +12 -0
- package/node_modules/@ktx/context/dist/ingest/dbt-shared/project-vars.js +86 -0
- package/node_modules/@ktx/context/dist/ingest/dbt-shared/project-vars.test.d.ts +1 -0
- package/node_modules/@ktx/context/dist/ingest/dbt-shared/project-vars.test.js +90 -0
- package/node_modules/@ktx/context/dist/ingest/dbt-shared/schema-files.d.ts +3 -0
- package/node_modules/@ktx/context/dist/ingest/dbt-shared/schema-files.js +62 -0
- package/node_modules/@ktx/context/dist/ingest/dbt-shared/schema-files.test.d.ts +1 -0
- package/node_modules/@ktx/context/dist/ingest/dbt-shared/schema-files.test.js +35 -0
- package/node_modules/@ktx/context/dist/ingest/diff-set.service.d.ts +8 -0
- package/node_modules/@ktx/context/dist/ingest/diff-set.service.js +41 -0
- package/node_modules/@ktx/context/dist/ingest/diff-set.service.test.d.ts +1 -0
- package/node_modules/@ktx/context/dist/ingest/diff-set.service.test.js +132 -0
- package/node_modules/@ktx/context/dist/ingest/git-env.d.ts +2 -0
- package/node_modules/@ktx/context/dist/ingest/git-env.js +18 -0
- package/node_modules/@ktx/context/dist/ingest/index.d.ts +139 -0
- package/node_modules/@ktx/context/dist/ingest/index.js +86 -0
- package/node_modules/@ktx/context/dist/ingest/ingest-bundle.runner.d.ts +37 -0
- package/node_modules/@ktx/context/dist/ingest/ingest-bundle.runner.js +1161 -0
- package/node_modules/@ktx/context/dist/ingest/ingest-bundle.runner.test.d.ts +1 -0
- package/node_modules/@ktx/context/dist/ingest/ingest-bundle.runner.test.js +1583 -0
- package/node_modules/@ktx/context/dist/ingest/ingest-prompts.test.d.ts +1 -0
- package/node_modules/@ktx/context/dist/ingest/ingest-prompts.test.js +61 -0
- package/node_modules/@ktx/context/dist/ingest/ingest-runtime-assets.test.d.ts +1 -0
- package/node_modules/@ktx/context/dist/ingest/ingest-runtime-assets.test.js +107 -0
- package/node_modules/@ktx/context/dist/ingest/local-adapters.d.ts +26 -0
- package/node_modules/@ktx/context/dist/ingest/local-adapters.js +187 -0
- package/node_modules/@ktx/context/dist/ingest/local-adapters.test.d.ts +1 -0
- package/node_modules/@ktx/context/dist/ingest/local-adapters.test.js +397 -0
- package/node_modules/@ktx/context/dist/ingest/local-bundle-ingest.test.d.ts +1 -0
- package/node_modules/@ktx/context/dist/ingest/local-bundle-ingest.test.js +506 -0
- package/node_modules/@ktx/context/dist/ingest/local-bundle-runtime.d.ts +38 -0
- package/node_modules/@ktx/context/dist/ingest/local-bundle-runtime.js +436 -0
- package/node_modules/@ktx/context/dist/ingest/local-bundle-runtime.test.d.ts +1 -0
- package/node_modules/@ktx/context/dist/ingest/local-bundle-runtime.test.js +107 -0
- package/node_modules/@ktx/context/dist/ingest/local-embedding-provider.integration.test.d.ts +1 -0
- package/node_modules/@ktx/context/dist/ingest/local-embedding-provider.integration.test.js +140 -0
- package/node_modules/@ktx/context/dist/ingest/local-ingest.d.ts +93 -0
- package/node_modules/@ktx/context/dist/ingest/local-ingest.js +306 -0
- package/node_modules/@ktx/context/dist/ingest/local-mapping-reconcile.d.ts +2 -0
- package/node_modules/@ktx/context/dist/ingest/local-mapping-reconcile.js +52 -0
- package/node_modules/@ktx/context/dist/ingest/local-mapping-reconcile.test.d.ts +1 -0
- package/node_modules/@ktx/context/dist/ingest/local-mapping-reconcile.test.js +68 -0
- package/node_modules/@ktx/context/dist/ingest/local-metabase-ingest.test.d.ts +1 -0
- package/node_modules/@ktx/context/dist/ingest/local-metabase-ingest.test.js +283 -0
- package/node_modules/@ktx/context/dist/ingest/local-stage-ingest.d.ts +53 -0
- package/node_modules/@ktx/context/dist/ingest/local-stage-ingest.js +280 -0
- package/node_modules/@ktx/context/dist/ingest/local-stage-ingest.test.d.ts +1 -0
- package/node_modules/@ktx/context/dist/ingest/local-stage-ingest.test.js +555 -0
- package/node_modules/@ktx/context/dist/ingest/memory-flow/acceptance-fixtures.d.ts +6 -0
- package/node_modules/@ktx/context/dist/ingest/memory-flow/acceptance-fixtures.js +155 -0
- package/node_modules/@ktx/context/dist/ingest/memory-flow/acceptance.test.d.ts +1 -0
- package/node_modules/@ktx/context/dist/ingest/memory-flow/acceptance.test.js +43 -0
- package/node_modules/@ktx/context/dist/ingest/memory-flow/events.d.ts +9 -0
- package/node_modules/@ktx/context/dist/ingest/memory-flow/events.js +196 -0
- package/node_modules/@ktx/context/dist/ingest/memory-flow/events.test.d.ts +1 -0
- package/node_modules/@ktx/context/dist/ingest/memory-flow/events.test.js +319 -0
- package/node_modules/@ktx/context/dist/ingest/memory-flow/index.d.ts +6 -0
- package/node_modules/@ktx/context/dist/ingest/memory-flow/index.js +4 -0
- package/node_modules/@ktx/context/dist/ingest/memory-flow/interaction.d.ts +9 -0
- package/node_modules/@ktx/context/dist/ingest/memory-flow/interaction.js +315 -0
- package/node_modules/@ktx/context/dist/ingest/memory-flow/interaction.test.d.ts +1 -0
- package/node_modules/@ktx/context/dist/ingest/memory-flow/interaction.test.js +264 -0
- package/node_modules/@ktx/context/dist/ingest/memory-flow/interactive-render.d.ts +2 -0
- package/node_modules/@ktx/context/dist/ingest/memory-flow/interactive-render.js +121 -0
- package/node_modules/@ktx/context/dist/ingest/memory-flow/interactive-render.test.d.ts +1 -0
- package/node_modules/@ktx/context/dist/ingest/memory-flow/interactive-render.test.js +160 -0
- package/node_modules/@ktx/context/dist/ingest/memory-flow/live-buffer.d.ts +3 -0
- package/node_modules/@ktx/context/dist/ingest/memory-flow/live-buffer.js +53 -0
- package/node_modules/@ktx/context/dist/ingest/memory-flow/live-buffer.test.d.ts +1 -0
- package/node_modules/@ktx/context/dist/ingest/memory-flow/live-buffer.test.js +77 -0
- package/node_modules/@ktx/context/dist/ingest/memory-flow/package-export.test.d.ts +1 -0
- package/node_modules/@ktx/context/dist/ingest/memory-flow/package-export.test.js +9 -0
- package/node_modules/@ktx/context/dist/ingest/memory-flow/render.d.ts +2 -0
- package/node_modules/@ktx/context/dist/ingest/memory-flow/render.js +84 -0
- package/node_modules/@ktx/context/dist/ingest/memory-flow/render.test.d.ts +1 -0
- package/node_modules/@ktx/context/dist/ingest/memory-flow/render.test.js +105 -0
- package/node_modules/@ktx/context/dist/ingest/memory-flow/schema.d.ts +190 -0
- package/node_modules/@ktx/context/dist/ingest/memory-flow/schema.js +155 -0
- package/node_modules/@ktx/context/dist/ingest/memory-flow/schema.test.d.ts +1 -0
- package/node_modules/@ktx/context/dist/ingest/memory-flow/schema.test.js +146 -0
- package/node_modules/@ktx/context/dist/ingest/memory-flow/summary.d.ts +2 -0
- package/node_modules/@ktx/context/dist/ingest/memory-flow/summary.js +76 -0
- package/node_modules/@ktx/context/dist/ingest/memory-flow/summary.test.d.ts +1 -0
- package/node_modules/@ktx/context/dist/ingest/memory-flow/summary.test.js +111 -0
- package/node_modules/@ktx/context/dist/ingest/memory-flow/types.d.ts +207 -0
- package/node_modules/@ktx/context/dist/ingest/memory-flow/types.js +1 -0
- package/node_modules/@ktx/context/dist/ingest/memory-flow/view-model.d.ts +2 -0
- package/node_modules/@ktx/context/dist/ingest/memory-flow/view-model.js +446 -0
- package/node_modules/@ktx/context/dist/ingest/memory-flow/view-model.test.d.ts +1 -0
- package/node_modules/@ktx/context/dist/ingest/memory-flow/view-model.test.js +397 -0
- package/node_modules/@ktx/context/dist/ingest/memory-flow/visuals.d.ts +20 -0
- package/node_modules/@ktx/context/dist/ingest/memory-flow/visuals.js +44 -0
- package/node_modules/@ktx/context/dist/ingest/memory-flow/visuals.test.d.ts +1 -0
- package/node_modules/@ktx/context/dist/ingest/memory-flow/visuals.test.js +49 -0
- package/node_modules/@ktx/context/dist/ingest/metabase-mapping.d.ts +2 -0
- package/node_modules/@ktx/context/dist/ingest/metabase-mapping.js +1 -0
- package/node_modules/@ktx/context/dist/ingest/page-triage/index.d.ts +2 -0
- package/node_modules/@ktx/context/dist/ingest/page-triage/index.js +1 -0
- package/node_modules/@ktx/context/dist/ingest/page-triage/page-triage.service.d.ts +85 -0
- package/node_modules/@ktx/context/dist/ingest/page-triage/page-triage.service.js +323 -0
- package/node_modules/@ktx/context/dist/ingest/page-triage/page-triage.service.test.d.ts +1 -0
- package/node_modules/@ktx/context/dist/ingest/page-triage/page-triage.service.test.js +472 -0
- package/node_modules/@ktx/context/dist/ingest/parsed-target-table.d.ts +21 -0
- package/node_modules/@ktx/context/dist/ingest/parsed-target-table.js +24 -0
- package/node_modules/@ktx/context/dist/ingest/ports.d.ts +339 -0
- package/node_modules/@ktx/context/dist/ingest/ports.js +1 -0
- package/node_modules/@ktx/context/dist/ingest/raw-sources-paths.d.ts +4 -0
- package/node_modules/@ktx/context/dist/ingest/raw-sources-paths.js +16 -0
- package/node_modules/@ktx/context/dist/ingest/raw-sources-paths.test.d.ts +1 -0
- package/node_modules/@ktx/context/dist/ingest/raw-sources-paths.test.js +18 -0
- package/node_modules/@ktx/context/dist/ingest/repo-fetch.d.ts +34 -0
- package/node_modules/@ktx/context/dist/ingest/repo-fetch.js +132 -0
- package/node_modules/@ktx/context/dist/ingest/repo-fetch.test.d.ts +1 -0
- package/node_modules/@ktx/context/dist/ingest/repo-fetch.test.js +168 -0
- package/node_modules/@ktx/context/dist/ingest/report-snapshot.d.ts +189 -0
- package/node_modules/@ktx/context/dist/ingest/report-snapshot.js +169 -0
- package/node_modules/@ktx/context/dist/ingest/report-snapshot.test.d.ts +1 -0
- package/node_modules/@ktx/context/dist/ingest/report-snapshot.test.js +206 -0
- package/node_modules/@ktx/context/dist/ingest/reports.d.ts +69 -0
- package/node_modules/@ktx/context/dist/ingest/reports.js +20 -0
- package/node_modules/@ktx/context/dist/ingest/source-adapter-registry.d.ts +8 -0
- package/node_modules/@ktx/context/dist/ingest/source-adapter-registry.js +23 -0
- package/node_modules/@ktx/context/dist/ingest/source-adapter-registry.test.d.ts +1 -0
- package/node_modules/@ktx/context/dist/ingest/source-adapter-registry.test.js +35 -0
- package/node_modules/@ktx/context/dist/ingest/sqlite-bundle-ingest-store.d.ts +38 -0
- package/node_modules/@ktx/context/dist/ingest/sqlite-bundle-ingest-store.js +470 -0
- package/node_modules/@ktx/context/dist/ingest/sqlite-bundle-ingest-store.test.d.ts +1 -0
- package/node_modules/@ktx/context/dist/ingest/sqlite-bundle-ingest-store.test.js +325 -0
- package/node_modules/@ktx/context/dist/ingest/sqlite-local-ingest-store.d.ts +19 -0
- package/node_modules/@ktx/context/dist/ingest/sqlite-local-ingest-store.js +190 -0
- package/node_modules/@ktx/context/dist/ingest/sqlite-local-ingest-store.test.d.ts +1 -0
- package/node_modules/@ktx/context/dist/ingest/sqlite-local-ingest-store.test.js +143 -0
- package/node_modules/@ktx/context/dist/ingest/stages/build-reconcile-context.context-candidates.test.d.ts +1 -0
- package/node_modules/@ktx/context/dist/ingest/stages/build-reconcile-context.context-candidates.test.js +102 -0
- package/node_modules/@ktx/context/dist/ingest/stages/build-reconcile-context.d.ts +61 -0
- package/node_modules/@ktx/context/dist/ingest/stages/build-reconcile-context.js +109 -0
- package/node_modules/@ktx/context/dist/ingest/stages/build-reconcile-context.test.d.ts +1 -0
- package/node_modules/@ktx/context/dist/ingest/stages/build-reconcile-context.test.js +75 -0
- package/node_modules/@ktx/context/dist/ingest/stages/build-wu-context.d.ts +27 -0
- package/node_modules/@ktx/context/dist/ingest/stages/build-wu-context.js +81 -0
- package/node_modules/@ktx/context/dist/ingest/stages/build-wu-context.test.d.ts +1 -0
- package/node_modules/@ktx/context/dist/ingest/stages/build-wu-context.test.js +170 -0
- package/node_modules/@ktx/context/dist/ingest/stages/stage-1-stage-raw-files.d.ts +13 -0
- package/node_modules/@ktx/context/dist/ingest/stages/stage-1-stage-raw-files.js +24 -0
- package/node_modules/@ktx/context/dist/ingest/stages/stage-1-stage-raw-files.test.d.ts +1 -0
- package/node_modules/@ktx/context/dist/ingest/stages/stage-1-stage-raw-files.test.js +54 -0
- package/node_modules/@ktx/context/dist/ingest/stages/stage-3-work-units.d.ts +44 -0
- package/node_modules/@ktx/context/dist/ingest/stages/stage-3-work-units.js +100 -0
- package/node_modules/@ktx/context/dist/ingest/stages/stage-3-work-units.test.d.ts +1 -0
- package/node_modules/@ktx/context/dist/ingest/stages/stage-3-work-units.test.js +134 -0
- package/node_modules/@ktx/context/dist/ingest/stages/stage-4-reconciliation.d.ts +29 -0
- package/node_modules/@ktx/context/dist/ingest/stages/stage-4-reconciliation.js +17 -0
- package/node_modules/@ktx/context/dist/ingest/stages/stage-4-reconciliation.test.d.ts +1 -0
- package/node_modules/@ktx/context/dist/ingest/stages/stage-4-reconciliation.test.js +144 -0
- package/node_modules/@ktx/context/dist/ingest/stages/stage-index.types.d.ts +50 -0
- package/node_modules/@ktx/context/dist/ingest/stages/stage-index.types.js +1 -0
- package/node_modules/@ktx/context/dist/ingest/stages/validate-wu-sources.d.ts +9 -0
- package/node_modules/@ktx/context/dist/ingest/stages/validate-wu-sources.js +14 -0
- package/node_modules/@ktx/context/dist/ingest/stages/validate-wu-sources.test.d.ts +1 -0
- package/node_modules/@ktx/context/dist/ingest/stages/validate-wu-sources.test.js +27 -0
- package/node_modules/@ktx/context/dist/ingest/tools/emit-artifact-resolution.tool.d.ts +13 -0
- package/node_modules/@ktx/context/dist/ingest/tools/emit-artifact-resolution.tool.js +40 -0
- package/node_modules/@ktx/context/dist/ingest/tools/emit-conflict-resolution.tool.d.ts +13 -0
- package/node_modules/@ktx/context/dist/ingest/tools/emit-conflict-resolution.tool.js +31 -0
- package/node_modules/@ktx/context/dist/ingest/tools/emit-eviction-decision.tool.d.ts +13 -0
- package/node_modules/@ktx/context/dist/ingest/tools/emit-eviction-decision.tool.js +38 -0
- package/node_modules/@ktx/context/dist/ingest/tools/emit-reconciliation-records.tool.test.d.ts +1 -0
- package/node_modules/@ktx/context/dist/ingest/tools/emit-reconciliation-records.tool.test.js +198 -0
- package/node_modules/@ktx/context/dist/ingest/tools/emit-unmapped-fallback.tool.d.ts +12 -0
- package/node_modules/@ktx/context/dist/ingest/tools/emit-unmapped-fallback.tool.js +41 -0
- package/node_modules/@ktx/context/dist/ingest/tools/eviction-list.tool.d.ts +8 -0
- package/node_modules/@ktx/context/dist/ingest/tools/eviction-list.tool.js +25 -0
- package/node_modules/@ktx/context/dist/ingest/tools/eviction-list.tool.test.d.ts +1 -0
- package/node_modules/@ktx/context/dist/ingest/tools/eviction-list.tool.test.js +44 -0
- package/node_modules/@ktx/context/dist/ingest/tools/read-raw-file.tool.d.ts +8 -0
- package/node_modules/@ktx/context/dist/ingest/tools/read-raw-file.tool.js +34 -0
- package/node_modules/@ktx/context/dist/ingest/tools/read-raw-file.tool.test.d.ts +1 -0
- package/node_modules/@ktx/context/dist/ingest/tools/read-raw-file.tool.test.js +45 -0
- package/node_modules/@ktx/context/dist/ingest/tools/read-raw-span.tool.d.ts +10 -0
- package/node_modules/@ktx/context/dist/ingest/tools/read-raw-span.tool.js +40 -0
- package/node_modules/@ktx/context/dist/ingest/tools/read-raw-span.tool.test.d.ts +1 -0
- package/node_modules/@ktx/context/dist/ingest/tools/read-raw-span.tool.test.js +34 -0
- package/node_modules/@ktx/context/dist/ingest/tools/stage-diff.tool.d.ts +8 -0
- package/node_modules/@ktx/context/dist/ingest/tools/stage-diff.tool.js +37 -0
- package/node_modules/@ktx/context/dist/ingest/tools/stage-diff.tool.test.d.ts +1 -0
- package/node_modules/@ktx/context/dist/ingest/tools/stage-diff.tool.test.js +112 -0
- package/node_modules/@ktx/context/dist/ingest/tools/stage-list.tool.d.ts +5 -0
- package/node_modules/@ktx/context/dist/ingest/tools/stage-list.tool.js +22 -0
- package/node_modules/@ktx/context/dist/ingest/tools/stage-list.tool.test.d.ts +1 -0
- package/node_modules/@ktx/context/dist/ingest/tools/stage-list.tool.test.js +50 -0
- package/node_modules/@ktx/context/dist/ingest/tools/tool-call-logger.d.ts +33 -0
- package/node_modules/@ktx/context/dist/ingest/tools/tool-call-logger.js +82 -0
- package/node_modules/@ktx/context/dist/ingest/types.d.ts +144 -0
- package/node_modules/@ktx/context/dist/ingest/types.js +1 -0
- package/node_modules/@ktx/context/dist/llm/debug-request-recorder.d.ts +44 -0
- package/node_modules/@ktx/context/dist/llm/debug-request-recorder.js +79 -0
- package/node_modules/@ktx/context/dist/llm/debug-request-recorder.test.d.ts +1 -0
- package/node_modules/@ktx/context/dist/llm/debug-request-recorder.test.js +112 -0
- package/node_modules/@ktx/context/dist/llm/embedding-port.d.ts +17 -0
- package/node_modules/@ktx/context/dist/llm/embedding-port.js +31 -0
- package/node_modules/@ktx/context/dist/llm/embedding-port.test.d.ts +1 -0
- package/node_modules/@ktx/context/dist/llm/embedding-port.test.js +34 -0
- package/node_modules/@ktx/context/dist/llm/generation.d.ts +21 -0
- package/node_modules/@ktx/context/dist/llm/generation.js +46 -0
- package/node_modules/@ktx/context/dist/llm/index.d.ts +5 -0
- package/node_modules/@ktx/context/dist/llm/index.js +4 -0
- package/node_modules/@ktx/context/dist/llm/local-config.d.ts +14 -0
- package/node_modules/@ktx/context/dist/llm/local-config.js +109 -0
- package/node_modules/@ktx/context/dist/llm/local-config.test.d.ts +1 -0
- package/node_modules/@ktx/context/dist/llm/local-config.test.js +127 -0
- package/node_modules/@ktx/context/dist/mcp/context-tools.d.ts +9 -0
- package/node_modules/@ktx/context/dist/mcp/context-tools.js +324 -0
- package/node_modules/@ktx/context/dist/mcp/index.d.ts +5 -0
- package/node_modules/@ktx/context/dist/mcp/index.js +3 -0
- package/node_modules/@ktx/context/dist/mcp/local-project-ports.d.ts +16 -0
- package/node_modules/@ktx/context/dist/mcp/local-project-ports.js +565 -0
- package/node_modules/@ktx/context/dist/mcp/local-project-ports.test.d.ts +1 -0
- package/node_modules/@ktx/context/dist/mcp/local-project-ports.test.js +984 -0
- package/node_modules/@ktx/context/dist/mcp/server.d.ts +7 -0
- package/node_modules/@ktx/context/dist/mcp/server.js +69 -0
- package/node_modules/@ktx/context/dist/mcp/server.test.d.ts +1 -0
- package/node_modules/@ktx/context/dist/mcp/server.test.js +779 -0
- package/node_modules/@ktx/context/dist/mcp/types.d.ts +317 -0
- package/node_modules/@ktx/context/dist/mcp/types.js +1 -0
- package/node_modules/@ktx/context/dist/memory/capture-signals.d.ts +8 -0
- package/node_modules/@ktx/context/dist/memory/capture-signals.js +104 -0
- package/node_modules/@ktx/context/dist/memory/index.d.ts +6 -0
- package/node_modules/@ktx/context/dist/memory/index.js +5 -0
- package/node_modules/@ktx/context/dist/memory/local-memory-runs.d.ts +22 -0
- package/node_modules/@ktx/context/dist/memory/local-memory-runs.js +165 -0
- package/node_modules/@ktx/context/dist/memory/local-memory.d.ts +23 -0
- package/node_modules/@ktx/context/dist/memory/local-memory.js +378 -0
- package/node_modules/@ktx/context/dist/memory/local-memory.test.d.ts +1 -0
- package/node_modules/@ktx/context/dist/memory/local-memory.test.js +159 -0
- package/node_modules/@ktx/context/dist/memory/memory-agent.service.d.ts +59 -0
- package/node_modules/@ktx/context/dist/memory/memory-agent.service.ingest.test.d.ts +1 -0
- package/node_modules/@ktx/context/dist/memory/memory-agent.service.ingest.test.js +301 -0
- package/node_modules/@ktx/context/dist/memory/memory-agent.service.js +535 -0
- package/node_modules/@ktx/context/dist/memory/memory-agent.service.test.d.ts +1 -0
- package/node_modules/@ktx/context/dist/memory/memory-agent.service.test.js +413 -0
- package/node_modules/@ktx/context/dist/memory/memory-runs.d.ts +54 -0
- package/node_modules/@ktx/context/dist/memory/memory-runs.js +78 -0
- package/node_modules/@ktx/context/dist/memory/memory-runs.test.d.ts +1 -0
- package/node_modules/@ktx/context/dist/memory/memory-runs.test.js +158 -0
- package/node_modules/@ktx/context/dist/memory/memory-runtime-assets.test.d.ts +1 -0
- package/node_modules/@ktx/context/dist/memory/memory-runtime-assets.test.js +83 -0
- package/node_modules/@ktx/context/dist/memory/types.d.ts +133 -0
- package/node_modules/@ktx/context/dist/memory/types.js +1 -0
- package/node_modules/@ktx/context/dist/package-exports.test.d.ts +1 -0
- package/node_modules/@ktx/context/dist/package-exports.test.js +245 -0
- package/node_modules/@ktx/context/dist/project/config.d.ts +118 -0
- package/node_modules/@ktx/context/dist/project/config.js +346 -0
- package/node_modules/@ktx/context/dist/project/config.test.d.ts +1 -0
- package/node_modules/@ktx/context/dist/project/config.test.js +347 -0
- package/node_modules/@ktx/context/dist/project/index.d.ts +11 -0
- package/node_modules/@ktx/context/dist/project/index.js +6 -0
- package/node_modules/@ktx/context/dist/project/local-git-file-store.d.ts +23 -0
- package/node_modules/@ktx/context/dist/project/local-git-file-store.js +140 -0
- package/node_modules/@ktx/context/dist/project/local-git-file-store.test.d.ts +1 -0
- package/node_modules/@ktx/context/dist/project/local-git-file-store.test.js +71 -0
- package/node_modules/@ktx/context/dist/project/local-state-db.d.ts +2 -0
- package/node_modules/@ktx/context/dist/project/local-state-db.js +4 -0
- package/node_modules/@ktx/context/dist/project/mappings-yaml-schema.d.ts +35 -0
- package/node_modules/@ktx/context/dist/project/mappings-yaml-schema.js +85 -0
- package/node_modules/@ktx/context/dist/project/mappings-yaml-schema.test.d.ts +1 -0
- package/node_modules/@ktx/context/dist/project/mappings-yaml-schema.test.js +67 -0
- package/node_modules/@ktx/context/dist/project/project.d.ts +30 -0
- package/node_modules/@ktx/context/dist/project/project.js +90 -0
- package/node_modules/@ktx/context/dist/project/project.test.d.ts +1 -0
- package/node_modules/@ktx/context/dist/project/project.test.js +58 -0
- package/node_modules/@ktx/context/dist/project/setup-config.d.ts +8 -0
- package/node_modules/@ktx/context/dist/project/setup-config.js +41 -0
- package/node_modules/@ktx/context/dist/project/setup-config.test.d.ts +1 -0
- package/node_modules/@ktx/context/dist/project/setup-config.test.js +56 -0
- package/node_modules/@ktx/context/dist/prompts/index.d.ts +2 -0
- package/node_modules/@ktx/context/dist/prompts/index.js +1 -0
- package/node_modules/@ktx/context/dist/prompts/prompt.service.d.ts +28 -0
- package/node_modules/@ktx/context/dist/prompts/prompt.service.js +84 -0
- package/node_modules/@ktx/context/dist/prompts/prompt.service.test.d.ts +1 -0
- package/node_modules/@ktx/context/dist/prompts/prompt.service.test.js +43 -0
- package/node_modules/@ktx/context/dist/scan/credentials.d.ts +8 -0
- package/node_modules/@ktx/context/dist/scan/credentials.js +38 -0
- package/node_modules/@ktx/context/dist/scan/credentials.test.d.ts +1 -0
- package/node_modules/@ktx/context/dist/scan/credentials.test.js +161 -0
- package/node_modules/@ktx/context/dist/scan/data-dictionary.d.ts +22 -0
- package/node_modules/@ktx/context/dist/scan/data-dictionary.js +66 -0
- package/node_modules/@ktx/context/dist/scan/data-dictionary.test.d.ts +1 -0
- package/node_modules/@ktx/context/dist/scan/data-dictionary.test.js +92 -0
- package/node_modules/@ktx/context/dist/scan/description-generation.d.ts +103 -0
- package/node_modules/@ktx/context/dist/scan/description-generation.js +376 -0
- package/node_modules/@ktx/context/dist/scan/description-generation.test.d.ts +1 -0
- package/node_modules/@ktx/context/dist/scan/description-generation.test.js +271 -0
- package/node_modules/@ktx/context/dist/scan/embedding-text.d.ts +21 -0
- package/node_modules/@ktx/context/dist/scan/embedding-text.js +23 -0
- package/node_modules/@ktx/context/dist/scan/embedding-text.test.d.ts +1 -0
- package/node_modules/@ktx/context/dist/scan/embedding-text.test.js +36 -0
- package/node_modules/@ktx/context/dist/scan/enrichment-state.d.ts +48 -0
- package/node_modules/@ktx/context/dist/scan/enrichment-state.js +44 -0
- package/node_modules/@ktx/context/dist/scan/enrichment-state.test.d.ts +1 -0
- package/node_modules/@ktx/context/dist/scan/enrichment-state.test.js +147 -0
- package/node_modules/@ktx/context/dist/scan/enrichment-summary.d.ts +4 -0
- package/node_modules/@ktx/context/dist/scan/enrichment-summary.js +44 -0
- package/node_modules/@ktx/context/dist/scan/enrichment-summary.test.d.ts +1 -0
- package/node_modules/@ktx/context/dist/scan/enrichment-summary.test.js +34 -0
- package/node_modules/@ktx/context/dist/scan/enrichment-types.d.ts +104 -0
- package/node_modules/@ktx/context/dist/scan/enrichment-types.js +9 -0
- package/node_modules/@ktx/context/dist/scan/enrichment-types.test.d.ts +1 -0
- package/node_modules/@ktx/context/dist/scan/enrichment-types.test.js +141 -0
- package/node_modules/@ktx/context/dist/scan/index.d.ts +68 -0
- package/node_modules/@ktx/context/dist/scan/index.js +35 -0
- package/node_modules/@ktx/context/dist/scan/local-enrichment-artifacts.d.ts +32 -0
- package/node_modules/@ktx/context/dist/scan/local-enrichment-artifacts.js +264 -0
- package/node_modules/@ktx/context/dist/scan/local-enrichment-artifacts.test.d.ts +1 -0
- package/node_modules/@ktx/context/dist/scan/local-enrichment-artifacts.test.js +725 -0
- package/node_modules/@ktx/context/dist/scan/local-enrichment.d.ts +49 -0
- package/node_modules/@ktx/context/dist/scan/local-enrichment.js +497 -0
- package/node_modules/@ktx/context/dist/scan/local-enrichment.test.d.ts +1 -0
- package/node_modules/@ktx/context/dist/scan/local-enrichment.test.js +665 -0
- package/node_modules/@ktx/context/dist/scan/local-scan.d.ts +65 -0
- package/node_modules/@ktx/context/dist/scan/local-scan.js +367 -0
- package/node_modules/@ktx/context/dist/scan/local-scan.test.d.ts +1 -0
- package/node_modules/@ktx/context/dist/scan/local-scan.test.js +1331 -0
- package/node_modules/@ktx/context/dist/scan/local-structural-artifacts.d.ts +10 -0
- package/node_modules/@ktx/context/dist/scan/local-structural-artifacts.js +86 -0
- package/node_modules/@ktx/context/dist/scan/local-structural-artifacts.test.d.ts +1 -0
- package/node_modules/@ktx/context/dist/scan/local-structural-artifacts.test.js +145 -0
- package/node_modules/@ktx/context/dist/scan/orchestrator.d.ts +44 -0
- package/node_modules/@ktx/context/dist/scan/orchestrator.js +186 -0
- package/node_modules/@ktx/context/dist/scan/orchestrator.test.d.ts +1 -0
- package/node_modules/@ktx/context/dist/scan/orchestrator.test.js +335 -0
- package/node_modules/@ktx/context/dist/scan/relationship-artifacts.d.ts +20 -0
- package/node_modules/@ktx/context/dist/scan/relationship-artifacts.js +45 -0
- package/node_modules/@ktx/context/dist/scan/relationship-artifacts.test.d.ts +1 -0
- package/node_modules/@ktx/context/dist/scan/relationship-artifacts.test.js +270 -0
- package/node_modules/@ktx/context/dist/scan/relationship-benchmark-report.d.ts +52 -0
- package/node_modules/@ktx/context/dist/scan/relationship-benchmark-report.js +252 -0
- package/node_modules/@ktx/context/dist/scan/relationship-benchmark-report.test.d.ts +1 -0
- package/node_modules/@ktx/context/dist/scan/relationship-benchmark-report.test.js +389 -0
- package/node_modules/@ktx/context/dist/scan/relationship-benchmarks.d.ts +148 -0
- package/node_modules/@ktx/context/dist/scan/relationship-benchmarks.js +646 -0
- package/node_modules/@ktx/context/dist/scan/relationship-benchmarks.test.d.ts +1 -0
- package/node_modules/@ktx/context/dist/scan/relationship-benchmarks.test.js +1068 -0
- package/node_modules/@ktx/context/dist/scan/relationship-budget.d.ts +19 -0
- package/node_modules/@ktx/context/dist/scan/relationship-budget.js +34 -0
- package/node_modules/@ktx/context/dist/scan/relationship-budget.test.d.ts +1 -0
- package/node_modules/@ktx/context/dist/scan/relationship-budget.test.js +71 -0
- package/node_modules/@ktx/context/dist/scan/relationship-candidates.d.ts +49 -0
- package/node_modules/@ktx/context/dist/scan/relationship-candidates.js +534 -0
- package/node_modules/@ktx/context/dist/scan/relationship-candidates.test.d.ts +1 -0
- package/node_modules/@ktx/context/dist/scan/relationship-candidates.test.js +747 -0
- package/node_modules/@ktx/context/dist/scan/relationship-composite-candidates.d.ts +66 -0
- package/node_modules/@ktx/context/dist/scan/relationship-composite-candidates.js +422 -0
- package/node_modules/@ktx/context/dist/scan/relationship-composite-candidates.test.d.ts +1 -0
- package/node_modules/@ktx/context/dist/scan/relationship-composite-candidates.test.js +69 -0
- package/node_modules/@ktx/context/dist/scan/relationship-diagnostics.d.ts +94 -0
- package/node_modules/@ktx/context/dist/scan/relationship-diagnostics.js +224 -0
- package/node_modules/@ktx/context/dist/scan/relationship-diagnostics.test.d.ts +1 -0
- package/node_modules/@ktx/context/dist/scan/relationship-diagnostics.test.js +333 -0
- package/node_modules/@ktx/context/dist/scan/relationship-discovery.d.ts +29 -0
- package/node_modules/@ktx/context/dist/scan/relationship-discovery.js +248 -0
- package/node_modules/@ktx/context/dist/scan/relationship-discovery.test.d.ts +1 -0
- package/node_modules/@ktx/context/dist/scan/relationship-discovery.test.js +636 -0
- package/node_modules/@ktx/context/dist/scan/relationship-feedback-calibration.d.ts +70 -0
- package/node_modules/@ktx/context/dist/scan/relationship-feedback-calibration.js +170 -0
- package/node_modules/@ktx/context/dist/scan/relationship-feedback-calibration.test.d.ts +1 -0
- package/node_modules/@ktx/context/dist/scan/relationship-feedback-calibration.test.js +175 -0
- package/node_modules/@ktx/context/dist/scan/relationship-feedback-export.d.ts +54 -0
- package/node_modules/@ktx/context/dist/scan/relationship-feedback-export.js +96 -0
- package/node_modules/@ktx/context/dist/scan/relationship-feedback-export.test.d.ts +1 -0
- package/node_modules/@ktx/context/dist/scan/relationship-feedback-export.test.js +241 -0
- package/node_modules/@ktx/context/dist/scan/relationship-formal-metadata.d.ts +7 -0
- package/node_modules/@ktx/context/dist/scan/relationship-formal-metadata.js +43 -0
- package/node_modules/@ktx/context/dist/scan/relationship-formal-metadata.test.d.ts +1 -0
- package/node_modules/@ktx/context/dist/scan/relationship-formal-metadata.test.js +125 -0
- package/node_modules/@ktx/context/dist/scan/relationship-graph-resolver.d.ts +48 -0
- package/node_modules/@ktx/context/dist/scan/relationship-graph-resolver.js +367 -0
- package/node_modules/@ktx/context/dist/scan/relationship-graph-resolver.test.d.ts +1 -0
- package/node_modules/@ktx/context/dist/scan/relationship-graph-resolver.test.js +604 -0
- package/node_modules/@ktx/context/dist/scan/relationship-llm-proposal.d.ts +33 -0
- package/node_modules/@ktx/context/dist/scan/relationship-llm-proposal.js +197 -0
- package/node_modules/@ktx/context/dist/scan/relationship-llm-proposal.test.d.ts +1 -0
- package/node_modules/@ktx/context/dist/scan/relationship-llm-proposal.test.js +219 -0
- package/node_modules/@ktx/context/dist/scan/relationship-locality.d.ts +15 -0
- package/node_modules/@ktx/context/dist/scan/relationship-locality.js +116 -0
- package/node_modules/@ktx/context/dist/scan/relationship-locality.test.d.ts +1 -0
- package/node_modules/@ktx/context/dist/scan/relationship-locality.test.js +128 -0
- package/node_modules/@ktx/context/dist/scan/relationship-name-similarity.d.ts +13 -0
- package/node_modules/@ktx/context/dist/scan/relationship-name-similarity.js +123 -0
- package/node_modules/@ktx/context/dist/scan/relationship-name-similarity.test.d.ts +1 -0
- package/node_modules/@ktx/context/dist/scan/relationship-name-similarity.test.js +68 -0
- package/node_modules/@ktx/context/dist/scan/relationship-profiling.d.ts +55 -0
- package/node_modules/@ktx/context/dist/scan/relationship-profiling.js +321 -0
- package/node_modules/@ktx/context/dist/scan/relationship-profiling.test.d.ts +1 -0
- package/node_modules/@ktx/context/dist/scan/relationship-profiling.test.js +313 -0
- package/node_modules/@ktx/context/dist/scan/relationship-review-apply.d.ts +34 -0
- package/node_modules/@ktx/context/dist/scan/relationship-review-apply.js +152 -0
- package/node_modules/@ktx/context/dist/scan/relationship-review-apply.test.d.ts +1 -0
- package/node_modules/@ktx/context/dist/scan/relationship-review-apply.test.js +322 -0
- package/node_modules/@ktx/context/dist/scan/relationship-review-decisions.d.ts +46 -0
- package/node_modules/@ktx/context/dist/scan/relationship-review-decisions.js +92 -0
- package/node_modules/@ktx/context/dist/scan/relationship-review-decisions.test.d.ts +1 -0
- package/node_modules/@ktx/context/dist/scan/relationship-review-decisions.test.js +314 -0
- package/node_modules/@ktx/context/dist/scan/relationship-scoring.d.ts +29 -0
- package/node_modules/@ktx/context/dist/scan/relationship-scoring.js +95 -0
- package/node_modules/@ktx/context/dist/scan/relationship-scoring.test.d.ts +1 -0
- package/node_modules/@ktx/context/dist/scan/relationship-scoring.test.js +86 -0
- package/node_modules/@ktx/context/dist/scan/relationship-threshold-advice.d.ts +60 -0
- package/node_modules/@ktx/context/dist/scan/relationship-threshold-advice.js +190 -0
- package/node_modules/@ktx/context/dist/scan/relationship-threshold-advice.test.d.ts +1 -0
- package/node_modules/@ktx/context/dist/scan/relationship-threshold-advice.test.js +205 -0
- package/node_modules/@ktx/context/dist/scan/relationship-validation.d.ts +44 -0
- package/node_modules/@ktx/context/dist/scan/relationship-validation.js +240 -0
- package/node_modules/@ktx/context/dist/scan/relationship-validation.test.d.ts +1 -0
- package/node_modules/@ktx/context/dist/scan/relationship-validation.test.js +450 -0
- package/node_modules/@ktx/context/dist/scan/sqlite-local-enrichment-state-store.d.ts +12 -0
- package/node_modules/@ktx/context/dist/scan/sqlite-local-enrichment-state-store.js +190 -0
- package/node_modules/@ktx/context/dist/scan/type-normalization.d.ts +8 -0
- package/node_modules/@ktx/context/dist/scan/type-normalization.js +23 -0
- package/node_modules/@ktx/context/dist/scan/type-normalization.test.d.ts +1 -0
- package/node_modules/@ktx/context/dist/scan/type-normalization.test.js +21 -0
- package/node_modules/@ktx/context/dist/scan/types.d.ts +299 -0
- package/node_modules/@ktx/context/dist/scan/types.js +13 -0
- package/node_modules/@ktx/context/dist/scan/types.test.d.ts +1 -0
- package/node_modules/@ktx/context/dist/scan/types.test.js +206 -0
- package/node_modules/@ktx/context/dist/search/backend-conformance.d.ts +39 -0
- package/node_modules/@ktx/context/dist/search/backend-conformance.js +88 -0
- package/node_modules/@ktx/context/dist/search/backend-conformance.test.d.ts +1 -0
- package/node_modules/@ktx/context/dist/search/backend-conformance.test.js +407 -0
- package/node_modules/@ktx/context/dist/search/hybrid-search-core.d.ts +4 -0
- package/node_modules/@ktx/context/dist/search/hybrid-search-core.js +106 -0
- package/node_modules/@ktx/context/dist/search/hybrid-search-core.test.d.ts +1 -0
- package/node_modules/@ktx/context/dist/search/hybrid-search-core.test.js +113 -0
- package/node_modules/@ktx/context/dist/search/index.d.ts +6 -0
- package/node_modules/@ktx/context/dist/search/index.js +4 -0
- package/node_modules/@ktx/context/dist/search/pglite-owner-process.d.ts +27 -0
- package/node_modules/@ktx/context/dist/search/pglite-owner-process.js +89 -0
- package/node_modules/@ktx/context/dist/search/pglite-owner-process.test.d.ts +1 -0
- package/node_modules/@ktx/context/dist/search/pglite-owner-process.test.js +286 -0
- package/node_modules/@ktx/context/dist/search/pglite-runtime-boundary.test.d.ts +1 -0
- package/node_modules/@ktx/context/dist/search/pglite-runtime-boundary.test.js +47 -0
- package/node_modules/@ktx/context/dist/search/pglite-spike.test.d.ts +1 -0
- package/node_modules/@ktx/context/dist/search/pglite-spike.test.js +249 -0
- package/node_modules/@ktx/context/dist/search/query.d.ts +3 -0
- package/node_modules/@ktx/context/dist/search/query.js +15 -0
- package/node_modules/@ktx/context/dist/search/query.test.d.ts +1 -0
- package/node_modules/@ktx/context/dist/search/query.test.js +23 -0
- package/node_modules/@ktx/context/dist/search/rrf.d.ts +5 -0
- package/node_modules/@ktx/context/dist/search/rrf.js +13 -0
- package/node_modules/@ktx/context/dist/search/rrf.test.d.ts +1 -0
- package/node_modules/@ktx/context/dist/search/rrf.test.js +47 -0
- package/node_modules/@ktx/context/dist/search/types.d.ts +73 -0
- package/node_modules/@ktx/context/dist/search/types.js +1 -0
- package/node_modules/@ktx/context/dist/skills/index.d.ts +2 -0
- package/node_modules/@ktx/context/dist/skills/index.js +1 -0
- package/node_modules/@ktx/context/dist/skills/skills-registry.service.d.ts +35 -0
- package/node_modules/@ktx/context/dist/skills/skills-registry.service.js +215 -0
- package/node_modules/@ktx/context/dist/skills/skills-registry.service.test.d.ts +1 -0
- package/node_modules/@ktx/context/dist/skills/skills-registry.service.test.js +161 -0
- package/node_modules/@ktx/context/dist/sl/descriptions.d.ts +14 -0
- package/node_modules/@ktx/context/dist/sl/descriptions.js +20 -0
- package/node_modules/@ktx/context/dist/sl/index.d.ts +13 -0
- package/node_modules/@ktx/context/dist/sl/index.js +9 -0
- package/node_modules/@ktx/context/dist/sl/local-query.d.ts +17 -0
- package/node_modules/@ktx/context/dist/sl/local-query.js +111 -0
- package/node_modules/@ktx/context/dist/sl/local-query.test.d.ts +1 -0
- package/node_modules/@ktx/context/dist/sl/local-query.test.js +218 -0
- package/node_modules/@ktx/context/dist/sl/local-sl.d.ts +54 -0
- package/node_modules/@ktx/context/dist/sl/local-sl.js +443 -0
- package/node_modules/@ktx/context/dist/sl/local-sl.test.d.ts +1 -0
- package/node_modules/@ktx/context/dist/sl/local-sl.test.js +254 -0
- package/node_modules/@ktx/context/dist/sl/pglite-sl-search-prototype.d.ts +16 -0
- package/node_modules/@ktx/context/dist/sl/pglite-sl-search-prototype.js +431 -0
- package/node_modules/@ktx/context/dist/sl/pglite-sl-search-prototype.test.d.ts +1 -0
- package/node_modules/@ktx/context/dist/sl/pglite-sl-search-prototype.test.js +237 -0
- package/node_modules/@ktx/context/dist/sl/ports.d.ts +60 -0
- package/node_modules/@ktx/context/dist/sl/ports.js +1 -0
- package/node_modules/@ktx/context/dist/sl/schemas.d.ts +141 -0
- package/node_modules/@ktx/context/dist/sl/schemas.js +132 -0
- package/node_modules/@ktx/context/dist/sl/semantic-layer.service.d.ts +199 -0
- package/node_modules/@ktx/context/dist/sl/semantic-layer.service.js +936 -0
- package/node_modules/@ktx/context/dist/sl/semantic-layer.service.test.d.ts +1 -0
- package/node_modules/@ktx/context/dist/sl/semantic-layer.service.test.js +602 -0
- package/node_modules/@ktx/context/dist/sl/sl-dictionary-profile.d.ts +9 -0
- package/node_modules/@ktx/context/dist/sl/sl-dictionary-profile.js +80 -0
- package/node_modules/@ktx/context/dist/sl/sl-dictionary-profile.test.d.ts +1 -0
- package/node_modules/@ktx/context/dist/sl/sl-dictionary-profile.test.js +88 -0
- package/node_modules/@ktx/context/dist/sl/sl-search.service.d.ts +16 -0
- package/node_modules/@ktx/context/dist/sl/sl-search.service.js +133 -0
- package/node_modules/@ktx/context/dist/sl/sl-search.service.test.d.ts +1 -0
- package/node_modules/@ktx/context/dist/sl/sl-search.service.test.js +142 -0
- package/node_modules/@ktx/context/dist/sl/sl-validator.port.d.ts +7 -0
- package/node_modules/@ktx/context/dist/sl/sl-validator.port.js +1 -0
- package/node_modules/@ktx/context/dist/sl/sqlite-sl-sources-index.d.ts +54 -0
- package/node_modules/@ktx/context/dist/sl/sqlite-sl-sources-index.js +407 -0
- package/node_modules/@ktx/context/dist/sl/sqlite-sl-sources-index.test.d.ts +1 -0
- package/node_modules/@ktx/context/dist/sl/sqlite-sl-sources-index.test.js +139 -0
- package/node_modules/@ktx/context/dist/sl/tools/base-semantic-layer.tool.d.ts +45 -0
- package/node_modules/@ktx/context/dist/sl/tools/base-semantic-layer.tool.js +91 -0
- package/node_modules/@ktx/context/dist/sl/tools/connection-id-schema.d.ts +2 -0
- package/node_modules/@ktx/context/dist/sl/tools/connection-id-schema.js +5 -0
- package/node_modules/@ktx/context/dist/sl/tools/connection-id-schema.test.d.ts +1 -0
- package/node_modules/@ktx/context/dist/sl/tools/connection-id-schema.test.js +14 -0
- package/node_modules/@ktx/context/dist/sl/tools/index.d.ts +11 -0
- package/node_modules/@ktx/context/dist/sl/tools/index.js +8 -0
- package/node_modules/@ktx/context/dist/sl/tools/sl-discover.tool.d.ts +52 -0
- package/node_modules/@ktx/context/dist/sl/tools/sl-discover.tool.js +259 -0
- package/node_modules/@ktx/context/dist/sl/tools/sl-edit-source.tool.d.ts +31 -0
- package/node_modules/@ktx/context/dist/sl/tools/sl-edit-source.tool.js +160 -0
- package/node_modules/@ktx/context/dist/sl/tools/sl-edit-source.tool.test.d.ts +1 -0
- package/node_modules/@ktx/context/dist/sl/tools/sl-edit-source.tool.test.js +147 -0
- package/node_modules/@ktx/context/dist/sl/tools/sl-read-source.tool.d.ts +23 -0
- package/node_modules/@ktx/context/dist/sl/tools/sl-read-source.tool.js +47 -0
- package/node_modules/@ktx/context/dist/sl/tools/sl-read-source.tool.session.test.d.ts +1 -0
- package/node_modules/@ktx/context/dist/sl/tools/sl-read-source.tool.session.test.js +55 -0
- package/node_modules/@ktx/context/dist/sl/tools/sl-rollback.tool.d.ts +25 -0
- package/node_modules/@ktx/context/dist/sl/tools/sl-rollback.tool.js +63 -0
- package/node_modules/@ktx/context/dist/sl/tools/sl-rollback.tool.test.d.ts +1 -0
- package/node_modules/@ktx/context/dist/sl/tools/sl-rollback.tool.test.js +57 -0
- package/node_modules/@ktx/context/dist/sl/tools/sl-validate.tool.d.ts +23 -0
- package/node_modules/@ktx/context/dist/sl/tools/sl-validate.tool.js +100 -0
- package/node_modules/@ktx/context/dist/sl/tools/sl-validate.tool.test.d.ts +1 -0
- package/node_modules/@ktx/context/dist/sl/tools/sl-validate.tool.test.js +54 -0
- package/node_modules/@ktx/context/dist/sl/tools/sl-warehouse-validation.d.ts +29 -0
- package/node_modules/@ktx/context/dist/sl/tools/sl-warehouse-validation.js +238 -0
- package/node_modules/@ktx/context/dist/sl/tools/sl-warehouse-validation.test.d.ts +1 -0
- package/node_modules/@ktx/context/dist/sl/tools/sl-warehouse-validation.test.js +115 -0
- package/node_modules/@ktx/context/dist/sl/tools/sl-write-source.tool.d.ts +296 -0
- package/node_modules/@ktx/context/dist/sl/tools/sl-write-source.tool.js +301 -0
- package/node_modules/@ktx/context/dist/sl/tools/sl-write-source.tool.test.d.ts +1 -0
- package/node_modules/@ktx/context/dist/sl/tools/sl-write-source.tool.test.js +225 -0
- package/node_modules/@ktx/context/dist/sl/types.d.ts +111 -0
- package/node_modules/@ktx/context/dist/sl/types.js +1 -0
- package/node_modules/@ktx/context/dist/sql-analysis/http-sql-analysis-port.d.ts +7 -0
- package/node_modules/@ktx/context/dist/sql-analysis/http-sql-analysis-port.js +125 -0
- package/node_modules/@ktx/context/dist/sql-analysis/http-sql-analysis-port.test.d.ts +1 -0
- package/node_modules/@ktx/context/dist/sql-analysis/http-sql-analysis-port.test.js +50 -0
- package/node_modules/@ktx/context/dist/sql-analysis/index.d.ts +3 -0
- package/node_modules/@ktx/context/dist/sql-analysis/index.js +1 -0
- package/node_modules/@ktx/context/dist/sql-analysis/ports.d.ts +17 -0
- package/node_modules/@ktx/context/dist/sql-analysis/ports.js +1 -0
- package/node_modules/@ktx/context/dist/test/make-local-git-repo.d.ts +10 -0
- package/node_modules/@ktx/context/dist/test/make-local-git-repo.js +34 -0
- package/node_modules/@ktx/context/dist/tools/authors.d.ts +8 -0
- package/node_modules/@ktx/context/dist/tools/authors.js +4 -0
- package/node_modules/@ktx/context/dist/tools/base-tool.d.ts +83 -0
- package/node_modules/@ktx/context/dist/tools/base-tool.js +77 -0
- package/node_modules/@ktx/context/dist/tools/context-candidate-mark.tool.d.ts +41 -0
- package/node_modules/@ktx/context/dist/tools/context-candidate-mark.tool.js +44 -0
- package/node_modules/@ktx/context/dist/tools/context-candidate-write.tool.d.ts +64 -0
- package/node_modules/@ktx/context/dist/tools/context-candidate-write.tool.js +140 -0
- package/node_modules/@ktx/context/dist/tools/context-evidence-ids.d.ts +3 -0
- package/node_modules/@ktx/context/dist/tools/context-evidence-ids.js +12 -0
- package/node_modules/@ktx/context/dist/tools/context-evidence-neighbors.tool.d.ts +48 -0
- package/node_modules/@ktx/context/dist/tools/context-evidence-neighbors.tool.js +69 -0
- package/node_modules/@ktx/context/dist/tools/context-evidence-read.tool.d.ts +37 -0
- package/node_modules/@ktx/context/dist/tools/context-evidence-read.tool.js +118 -0
- package/node_modules/@ktx/context/dist/tools/context-evidence-search.tool.d.ts +57 -0
- package/node_modules/@ktx/context/dist/tools/context-evidence-search.tool.js +92 -0
- package/node_modules/@ktx/context/dist/tools/context-evidence-tool-store.d.ts +112 -0
- package/node_modules/@ktx/context/dist/tools/context-evidence-tool-store.js +1 -0
- package/node_modules/@ktx/context/dist/tools/context-evidence-tools.test.d.ts +1 -0
- package/node_modules/@ktx/context/dist/tools/context-evidence-tools.test.js +486 -0
- package/node_modules/@ktx/context/dist/tools/context-ingest-metadata.d.ts +9 -0
- package/node_modules/@ktx/context/dist/tools/context-ingest-metadata.js +13 -0
- package/node_modules/@ktx/context/dist/tools/index.d.ts +17 -0
- package/node_modules/@ktx/context/dist/tools/index.js +10 -0
- package/node_modules/@ktx/context/dist/tools/sql-edit-replacer.d.ts +16 -0
- package/node_modules/@ktx/context/dist/tools/sql-edit-replacer.js +173 -0
- package/node_modules/@ktx/context/dist/tools/tool-session.d.ts +51 -0
- package/node_modules/@ktx/context/dist/tools/tool-session.js +1 -0
- package/node_modules/@ktx/context/dist/tools/touched-sl-sources.d.ts +12 -0
- package/node_modules/@ktx/context/dist/tools/touched-sl-sources.js +47 -0
- package/node_modules/@ktx/context/dist/tools/touched-sl-sources.test.d.ts +1 -0
- package/node_modules/@ktx/context/dist/tools/touched-sl-sources.test.js +31 -0
- package/node_modules/@ktx/context/dist/wiki/index.d.ts +8 -0
- package/node_modules/@ktx/context/dist/wiki/index.js +5 -0
- package/node_modules/@ktx/context/dist/wiki/knowledge-search-text.d.ts +1 -0
- package/node_modules/@ktx/context/dist/wiki/knowledge-search-text.js +7 -0
- package/node_modules/@ktx/context/dist/wiki/knowledge-wiki.service.d.ts +76 -0
- package/node_modules/@ktx/context/dist/wiki/knowledge-wiki.service.js +343 -0
- package/node_modules/@ktx/context/dist/wiki/knowledge-wiki.service.test.d.ts +1 -0
- package/node_modules/@ktx/context/dist/wiki/knowledge-wiki.service.test.js +93 -0
- package/node_modules/@ktx/context/dist/wiki/local-knowledge.d.ts +55 -0
- package/node_modules/@ktx/context/dist/wiki/local-knowledge.js +284 -0
- package/node_modules/@ktx/context/dist/wiki/local-knowledge.test.d.ts +1 -0
- package/node_modules/@ktx/context/dist/wiki/local-knowledge.test.js +200 -0
- package/node_modules/@ktx/context/dist/wiki/ports.d.ts +68 -0
- package/node_modules/@ktx/context/dist/wiki/ports.js +1 -0
- package/node_modules/@ktx/context/dist/wiki/sqlite-knowledge-index.d.ts +43 -0
- package/node_modules/@ktx/context/dist/wiki/sqlite-knowledge-index.js +206 -0
- package/node_modules/@ktx/context/dist/wiki/sqlite-knowledge-index.test.d.ts +1 -0
- package/node_modules/@ktx/context/dist/wiki/sqlite-knowledge-index.test.js +97 -0
- package/node_modules/@ktx/context/dist/wiki/tools/index.d.ts +5 -0
- package/node_modules/@ktx/context/dist/wiki/tools/index.js +5 -0
- package/node_modules/@ktx/context/dist/wiki/tools/wiki-list-tags.tool.d.ts +18 -0
- package/node_modules/@ktx/context/dist/wiki/tools/wiki-list-tags.tool.js +39 -0
- package/node_modules/@ktx/context/dist/wiki/tools/wiki-list-tags.tool.test.d.ts +1 -0
- package/node_modules/@ktx/context/dist/wiki/tools/wiki-list-tags.tool.test.js +36 -0
- package/node_modules/@ktx/context/dist/wiki/tools/wiki-read.tool.d.ts +28 -0
- package/node_modules/@ktx/context/dist/wiki/tools/wiki-read.tool.js +54 -0
- package/node_modules/@ktx/context/dist/wiki/tools/wiki-remove.tool.d.ts +26 -0
- package/node_modules/@ktx/context/dist/wiki/tools/wiki-remove.tool.js +63 -0
- package/node_modules/@ktx/context/dist/wiki/tools/wiki-remove.tool.test.d.ts +1 -0
- package/node_modules/@ktx/context/dist/wiki/tools/wiki-remove.tool.test.js +54 -0
- package/node_modules/@ktx/context/dist/wiki/tools/wiki-search.tool.d.ts +49 -0
- package/node_modules/@ktx/context/dist/wiki/tools/wiki-search.tool.js +51 -0
- package/node_modules/@ktx/context/dist/wiki/tools/wiki-search.tool.test.d.ts +1 -0
- package/node_modules/@ktx/context/dist/wiki/tools/wiki-search.tool.test.js +35 -0
- package/node_modules/@ktx/context/dist/wiki/tools/wiki-write.tool.d.ts +77 -0
- package/node_modules/@ktx/context/dist/wiki/tools/wiki-write.tool.js +138 -0
- package/node_modules/@ktx/context/dist/wiki/tools/wiki-write.tool.test.d.ts +1 -0
- package/node_modules/@ktx/context/dist/wiki/tools/wiki-write.tool.test.js +147 -0
- package/node_modules/@ktx/context/dist/wiki/types.d.ts +48 -0
- package/node_modules/@ktx/context/dist/wiki/types.js +1 -0
- package/node_modules/@ktx/context/package.json +134 -0
- package/node_modules/@ktx/context/prompts/memory_agent_backfill.md +21 -0
- package/node_modules/@ktx/context/prompts/memory_agent_bundle_ingest_reconcile.md +27 -0
- package/node_modules/@ktx/context/prompts/memory_agent_bundle_ingest_work_unit.md +28 -0
- package/node_modules/@ktx/context/prompts/memory_agent_external_ingest.md +28 -0
- package/node_modules/@ktx/context/prompts/memory_agent_research.md +30 -0
- package/node_modules/@ktx/context/prompts/skills/light_extraction.md +40 -0
- package/node_modules/@ktx/context/prompts/skills/page_triage_classifier.md +102 -0
- package/node_modules/@ktx/context/skills/dbt_ingest/SKILL.md +34 -0
- package/node_modules/@ktx/context/skills/historic_sql_curator/SKILL.md +153 -0
- package/node_modules/@ktx/context/skills/historic_sql_ingest/SKILL.md +170 -0
- package/node_modules/@ktx/context/skills/ingest_triage/SKILL.md +77 -0
- package/node_modules/@ktx/context/skills/knowledge_capture/SKILL.md +124 -0
- package/node_modules/@ktx/context/skills/live_database_ingest/SKILL.md +58 -0
- package/node_modules/@ktx/context/skills/looker_ingest/SKILL.md +217 -0
- package/node_modules/@ktx/context/skills/lookml_ingest/SKILL.md +180 -0
- package/node_modules/@ktx/context/skills/metabase_ingest/SKILL.md +218 -0
- package/node_modules/@ktx/context/skills/metricflow_ingest/SKILL.md +274 -0
- package/node_modules/@ktx/context/skills/notion_synthesize/SKILL.md +69 -0
- package/node_modules/@ktx/context/skills/sl/SKILL.md +240 -0
- package/node_modules/@ktx/context/skills/sl_capture/SKILL.md +276 -0
- package/node_modules/@ktx/llm/dist/embedding-health.d.ts +14 -0
- package/node_modules/@ktx/llm/dist/embedding-health.js +36 -0
- package/node_modules/@ktx/llm/dist/embedding-health.test.d.ts +1 -0
- package/node_modules/@ktx/llm/dist/embedding-health.test.js +72 -0
- package/node_modules/@ktx/llm/dist/embedding-provider.d.ts +35 -0
- package/node_modules/@ktx/llm/dist/embedding-provider.js +287 -0
- package/node_modules/@ktx/llm/dist/embedding-provider.test.d.ts +1 -0
- package/node_modules/@ktx/llm/dist/embedding-provider.test.js +99 -0
- package/node_modules/@ktx/llm/dist/index.d.ts +10 -0
- package/node_modules/@ktx/llm/dist/index.js +6 -0
- package/node_modules/@ktx/llm/dist/message-builder.d.ts +40 -0
- package/node_modules/@ktx/llm/dist/message-builder.js +135 -0
- package/node_modules/@ktx/llm/dist/message-builder.test.d.ts +1 -0
- package/node_modules/@ktx/llm/dist/message-builder.test.js +97 -0
- package/node_modules/@ktx/llm/dist/model-health.d.ts +18 -0
- package/node_modules/@ktx/llm/dist/model-health.js +38 -0
- package/node_modules/@ktx/llm/dist/model-health.test.d.ts +1 -0
- package/node_modules/@ktx/llm/dist/model-health.test.js +41 -0
- package/node_modules/@ktx/llm/dist/model-provider.d.ts +18 -0
- package/node_modules/@ktx/llm/dist/model-provider.js +111 -0
- package/node_modules/@ktx/llm/dist/model-provider.test.d.ts +1 -0
- package/node_modules/@ktx/llm/dist/model-provider.test.js +127 -0
- package/node_modules/@ktx/llm/dist/package-exports.test.d.ts +1 -0
- package/node_modules/@ktx/llm/dist/package-exports.test.js +17 -0
- package/node_modules/@ktx/llm/dist/repair.d.ts +8 -0
- package/node_modules/@ktx/llm/dist/repair.js +75 -0
- package/node_modules/@ktx/llm/dist/repair.test.d.ts +1 -0
- package/node_modules/@ktx/llm/dist/repair.test.js +78 -0
- package/node_modules/@ktx/llm/dist/types.d.ts +105 -0
- package/node_modules/@ktx/llm/dist/types.js +1 -0
- package/node_modules/@ktx/llm/package.json +26 -0
- package/package.json +73 -7
- package/README.md +0 -3
|
@@ -0,0 +1,1740 @@
|
|
|
1
|
+
import { mkdtemp, readFile, rm, writeFile } from 'node:fs/promises';
|
|
2
|
+
import { createRequire } from 'node:module';
|
|
3
|
+
import { tmpdir } from 'node:os';
|
|
4
|
+
import { join } from 'node:path';
|
|
5
|
+
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
|
|
6
|
+
import { getKtxCliPackageInfo, packageInfoFromJson, rendererUnavailableVizFallback, renderMemoryFlowTui, resolveVizFallback, runKtxCli, sanitizeMemoryFlowTuiError, startLiveMemoryFlowTui, warnVizFallbackOnce, } from './index.js';
|
|
7
|
+
const require = createRequire(import.meta.url);
|
|
8
|
+
function makeIo(options = {}) {
|
|
9
|
+
let stdout = '';
|
|
10
|
+
let stderr = '';
|
|
11
|
+
return {
|
|
12
|
+
io: {
|
|
13
|
+
stdout: {
|
|
14
|
+
isTTY: options.stdoutIsTty,
|
|
15
|
+
write: (chunk) => {
|
|
16
|
+
stdout += chunk;
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
stderr: {
|
|
20
|
+
write: (chunk) => {
|
|
21
|
+
stderr += chunk;
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
stdout: () => stdout,
|
|
26
|
+
stderr: () => stderr,
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
describe('getKtxCliPackageInfo', () => {
|
|
30
|
+
it('identifies the CLI package and its context dependency', () => {
|
|
31
|
+
expect(getKtxCliPackageInfo()).toEqual({
|
|
32
|
+
name: '@ktx/cli',
|
|
33
|
+
version: '0.0.0-private',
|
|
34
|
+
contextPackageName: '@ktx/context',
|
|
35
|
+
});
|
|
36
|
+
});
|
|
37
|
+
it('exports package metadata for package managers and runtime diagnostics', () => {
|
|
38
|
+
const packageJson = require('@ktx/cli/package.json');
|
|
39
|
+
expect(packageJson).toMatchObject({
|
|
40
|
+
name: '@ktx/cli',
|
|
41
|
+
version: '0.0.0-private',
|
|
42
|
+
});
|
|
43
|
+
});
|
|
44
|
+
it('normalizes public package metadata from package.json contents', () => {
|
|
45
|
+
expect(packageInfoFromJson({
|
|
46
|
+
name: '@kaelio/ktx',
|
|
47
|
+
version: '0.1.0',
|
|
48
|
+
})).toEqual({
|
|
49
|
+
name: '@kaelio/ktx',
|
|
50
|
+
version: '0.1.0',
|
|
51
|
+
contextPackageName: '@ktx/context',
|
|
52
|
+
});
|
|
53
|
+
});
|
|
54
|
+
});
|
|
55
|
+
describe('memory-flow renderer exports', () => {
|
|
56
|
+
it('exports runtime-agnostic renderer entry points for hosted terminal clients', () => {
|
|
57
|
+
expect(renderMemoryFlowTui).toBeTypeOf('function');
|
|
58
|
+
expect(startLiveMemoryFlowTui).toBeTypeOf('function');
|
|
59
|
+
expect(sanitizeMemoryFlowTuiError('token=abc123')).toBe('[redacted]');
|
|
60
|
+
});
|
|
61
|
+
it('exports shared visualization fallback helpers for hosted terminal clients', () => {
|
|
62
|
+
const fallback = resolveVizFallback({ stdout: { isTTY: true }, stderr: { write: vi.fn() } }, { TERM: 'dumb' });
|
|
63
|
+
expect(fallback).toEqual({
|
|
64
|
+
shouldDegrade: true,
|
|
65
|
+
reason: 'term-dumb',
|
|
66
|
+
message: 'TERM=dumb does not support the visual renderer',
|
|
67
|
+
});
|
|
68
|
+
expect(rendererUnavailableVizFallback()).toEqual({
|
|
69
|
+
shouldDegrade: true,
|
|
70
|
+
reason: 'renderer-unavailable',
|
|
71
|
+
message: 'the terminal renderer is unavailable',
|
|
72
|
+
});
|
|
73
|
+
expect(warnVizFallbackOnce).toBeTypeOf('function');
|
|
74
|
+
});
|
|
75
|
+
});
|
|
76
|
+
describe('runKtxCli', () => {
|
|
77
|
+
let tempDir;
|
|
78
|
+
beforeEach(async () => {
|
|
79
|
+
tempDir = await mkdtemp(join(tmpdir(), 'ktx-cli-'));
|
|
80
|
+
});
|
|
81
|
+
afterEach(async () => {
|
|
82
|
+
await rm(tempDir, { recursive: true, force: true });
|
|
83
|
+
});
|
|
84
|
+
it('prints version information', async () => {
|
|
85
|
+
const testIo = makeIo();
|
|
86
|
+
await expect(runKtxCli(['--version'], testIo.io)).resolves.toBe(0);
|
|
87
|
+
expect(testIo.stdout()).toBe('@ktx/cli 0.0.0-private\n');
|
|
88
|
+
expect(testIo.stderr()).toBe('');
|
|
89
|
+
});
|
|
90
|
+
it('prints the May 6 public command surface in root help', async () => {
|
|
91
|
+
const testIo = makeIo();
|
|
92
|
+
await expect(runKtxCli(['--help'], testIo.io)).resolves.toBe(0);
|
|
93
|
+
expect(testIo.stdout()).toContain('Usage: ktx [options] [command]');
|
|
94
|
+
for (const command of ['setup', 'connection', 'ingest', 'wiki', 'sl', 'runtime', 'serve', 'status']) {
|
|
95
|
+
expect(testIo.stdout()).toContain(`${command}`);
|
|
96
|
+
}
|
|
97
|
+
for (const removed of ['demo', 'init', 'connect', 'scan', 'ask', 'knowledge', 'agent', 'completion']) {
|
|
98
|
+
expect(testIo.stdout()).not.toContain(`${removed} [`);
|
|
99
|
+
expect(testIo.stdout()).not.toContain(`${removed} `);
|
|
100
|
+
}
|
|
101
|
+
expect(testIo.stdout()).toContain('--project-dir <path>');
|
|
102
|
+
expect(testIo.stdout()).toContain('KTX_PROJECT_DIR');
|
|
103
|
+
expect(testIo.stdout()).toContain('--debug');
|
|
104
|
+
expect(testIo.stdout()).not.toContain('--' + 'verbose');
|
|
105
|
+
expect(testIo.stdout()).toContain('Advanced:');
|
|
106
|
+
expect(testIo.stdout()).toContain('ktx dev');
|
|
107
|
+
expect(testIo.stderr()).toBe('');
|
|
108
|
+
});
|
|
109
|
+
it('routes runtime management commands with the CLI package version', async () => {
|
|
110
|
+
const runtime = vi.fn(async () => 0);
|
|
111
|
+
const installIo = makeIo();
|
|
112
|
+
const startIo = makeIo();
|
|
113
|
+
const stopIo = makeIo();
|
|
114
|
+
const statusIo = makeIo();
|
|
115
|
+
const doctorIo = makeIo();
|
|
116
|
+
const pruneIo = makeIo();
|
|
117
|
+
await expect(runKtxCli(['runtime', 'install', '--feature', 'local-embeddings', '--force', '--yes'], installIo.io, {
|
|
118
|
+
runtime,
|
|
119
|
+
})).resolves.toBe(0);
|
|
120
|
+
await expect(runKtxCli(['runtime', 'start', '--feature', 'local-embeddings', '--force'], startIo.io, { runtime })).resolves.toBe(0);
|
|
121
|
+
await expect(runKtxCli(['runtime', 'stop'], stopIo.io, { runtime })).resolves.toBe(0);
|
|
122
|
+
await expect(runKtxCli(['runtime', 'status', '--json'], statusIo.io, { runtime })).resolves.toBe(0);
|
|
123
|
+
await expect(runKtxCli(['runtime', 'doctor'], doctorIo.io, { runtime })).resolves.toBe(0);
|
|
124
|
+
await expect(runKtxCli(['runtime', 'prune', '--dry-run'], pruneIo.io, { runtime })).resolves.toBe(0);
|
|
125
|
+
expect(runtime).toHaveBeenNthCalledWith(1, {
|
|
126
|
+
command: 'install',
|
|
127
|
+
cliVersion: '0.0.0-private',
|
|
128
|
+
feature: 'local-embeddings',
|
|
129
|
+
force: true,
|
|
130
|
+
}, installIo.io);
|
|
131
|
+
expect(runtime).toHaveBeenNthCalledWith(2, {
|
|
132
|
+
command: 'start',
|
|
133
|
+
cliVersion: '0.0.0-private',
|
|
134
|
+
feature: 'local-embeddings',
|
|
135
|
+
force: true,
|
|
136
|
+
}, startIo.io);
|
|
137
|
+
expect(runtime).toHaveBeenNthCalledWith(3, {
|
|
138
|
+
command: 'stop',
|
|
139
|
+
cliVersion: '0.0.0-private',
|
|
140
|
+
}, stopIo.io);
|
|
141
|
+
expect(runtime).toHaveBeenNthCalledWith(4, {
|
|
142
|
+
command: 'status',
|
|
143
|
+
cliVersion: '0.0.0-private',
|
|
144
|
+
json: true,
|
|
145
|
+
}, statusIo.io);
|
|
146
|
+
expect(runtime).toHaveBeenNthCalledWith(5, {
|
|
147
|
+
command: 'doctor',
|
|
148
|
+
cliVersion: '0.0.0-private',
|
|
149
|
+
json: false,
|
|
150
|
+
}, doctorIo.io);
|
|
151
|
+
expect(runtime).toHaveBeenNthCalledWith(6, {
|
|
152
|
+
command: 'prune',
|
|
153
|
+
cliVersion: '0.0.0-private',
|
|
154
|
+
dryRun: true,
|
|
155
|
+
yes: false,
|
|
156
|
+
}, pruneIo.io);
|
|
157
|
+
});
|
|
158
|
+
it('routes sl query managed runtime install policies', async () => {
|
|
159
|
+
const sl = vi.fn(async () => 0);
|
|
160
|
+
const promptIo = makeIo();
|
|
161
|
+
await expect(runKtxCli(['--project-dir', tempDir, 'sl', 'query', '--measure', 'orders.order_count'], promptIo.io, { sl })).resolves.toBe(0);
|
|
162
|
+
expect(sl).toHaveBeenLastCalledWith(expect.objectContaining({
|
|
163
|
+
command: 'query',
|
|
164
|
+
projectDir: tempDir,
|
|
165
|
+
cliVersion: '0.0.0-private',
|
|
166
|
+
runtimeInstallPolicy: 'prompt',
|
|
167
|
+
query: expect.objectContaining({ measures: ['orders.order_count'], dimensions: [] }),
|
|
168
|
+
}), promptIo.io);
|
|
169
|
+
const autoIo = makeIo();
|
|
170
|
+
await expect(runKtxCli(['--project-dir', tempDir, 'sl', 'query', '--measure', 'orders.order_count', '--yes'], autoIo.io, {
|
|
171
|
+
sl,
|
|
172
|
+
})).resolves.toBe(0);
|
|
173
|
+
expect(sl).toHaveBeenLastCalledWith(expect.objectContaining({
|
|
174
|
+
cliVersion: '0.0.0-private',
|
|
175
|
+
runtimeInstallPolicy: 'auto',
|
|
176
|
+
}), autoIo.io);
|
|
177
|
+
const noInputIo = makeIo();
|
|
178
|
+
await expect(runKtxCli(['--project-dir', tempDir, 'sl', 'query', '--measure', 'orders.order_count', '--no-input'], noInputIo.io, { sl })).resolves.toBe(0);
|
|
179
|
+
expect(sl).toHaveBeenLastCalledWith(expect.objectContaining({
|
|
180
|
+
cliVersion: '0.0.0-private',
|
|
181
|
+
runtimeInstallPolicy: 'never',
|
|
182
|
+
}), noInputIo.io);
|
|
183
|
+
});
|
|
184
|
+
it('rejects conflicting sl query runtime install flags', async () => {
|
|
185
|
+
const io = makeIo();
|
|
186
|
+
const sl = vi.fn(async () => 0);
|
|
187
|
+
await expect(runKtxCli(['--project-dir', tempDir, 'sl', 'query', '--measure', 'orders.order_count', '--yes', '--no-input'], io.io, { sl })).resolves.toBe(1);
|
|
188
|
+
expect(sl).not.toHaveBeenCalled();
|
|
189
|
+
expect(io.stderr()).toContain('Choose only one runtime install mode: --yes or --no-input');
|
|
190
|
+
});
|
|
191
|
+
it('exposes demo under setup help instead of root help', async () => {
|
|
192
|
+
const testIo = makeIo();
|
|
193
|
+
await expect(runKtxCli(['setup', '--help'], testIo.io)).resolves.toBe(0);
|
|
194
|
+
expect(testIo.stdout()).toContain('Usage: ktx setup [options] [command]');
|
|
195
|
+
expect(testIo.stdout()).toContain('demo');
|
|
196
|
+
expect(testIo.stdout()).toContain('Run the packaged KTX demo from setup');
|
|
197
|
+
expect(testIo.stdout()).not.toContain('--skip-llm');
|
|
198
|
+
expect(testIo.stdout()).not.toContain('--skip-embeddings');
|
|
199
|
+
expect(testIo.stdout()).not.toContain('--embedding-model');
|
|
200
|
+
expect(testIo.stdout()).not.toContain('--embedding-dimensions');
|
|
201
|
+
expect(testIo.stdout()).not.toContain('--embedding-base-url');
|
|
202
|
+
expect(testIo.stderr()).toBe('');
|
|
203
|
+
});
|
|
204
|
+
it('prints help for bare ktx outside a TTY', async () => {
|
|
205
|
+
const setup = vi.fn(async () => 0);
|
|
206
|
+
const testIo = makeIo({ stdoutIsTty: false });
|
|
207
|
+
await expect(runKtxCli([], testIo.io, { setup })).resolves.toBe(0);
|
|
208
|
+
expect(testIo.stdout()).toContain('Usage: ktx [options] [command]');
|
|
209
|
+
expect(setup).not.toHaveBeenCalled();
|
|
210
|
+
expect(testIo.stderr()).toBe('');
|
|
211
|
+
});
|
|
212
|
+
it('starts setup for bare ktx in a TTY when no project is discoverable', async () => {
|
|
213
|
+
const { mkdtemp, realpath, rm } = await import('node:fs/promises');
|
|
214
|
+
const { tmpdir } = await import('node:os');
|
|
215
|
+
const { join } = await import('node:path');
|
|
216
|
+
const originalCwd = process.cwd();
|
|
217
|
+
const tempDir = await mkdtemp(join(tmpdir(), 'ktx-bare-setup-'));
|
|
218
|
+
const setup = vi.fn(async () => 0);
|
|
219
|
+
const testIo = makeIo({ stdoutIsTty: true });
|
|
220
|
+
const previousProjectDir = process.env.KTX_PROJECT_DIR;
|
|
221
|
+
const expectedProjectDir = await realpath(tempDir);
|
|
222
|
+
try {
|
|
223
|
+
delete process.env.KTX_PROJECT_DIR;
|
|
224
|
+
process.chdir(tempDir);
|
|
225
|
+
await expect(runKtxCli([], testIo.io, { setup })).resolves.toBe(0);
|
|
226
|
+
expect(setup).toHaveBeenCalledWith({
|
|
227
|
+
command: 'run',
|
|
228
|
+
projectDir: expectedProjectDir,
|
|
229
|
+
mode: 'auto',
|
|
230
|
+
agents: false,
|
|
231
|
+
agentScope: 'project',
|
|
232
|
+
agentInstallMode: 'cli',
|
|
233
|
+
skipAgents: false,
|
|
234
|
+
inputMode: 'auto',
|
|
235
|
+
yes: false,
|
|
236
|
+
cliVersion: '0.0.0-private',
|
|
237
|
+
skipLlm: false,
|
|
238
|
+
skipEmbeddings: false,
|
|
239
|
+
databaseSchemas: [],
|
|
240
|
+
skipDatabases: false,
|
|
241
|
+
skipSources: false,
|
|
242
|
+
}, testIo.io);
|
|
243
|
+
expect(testIo.stdout()).not.toContain('Usage: ktx [options] [command]');
|
|
244
|
+
expect(testIo.stderr()).toBe('');
|
|
245
|
+
}
|
|
246
|
+
finally {
|
|
247
|
+
process.chdir(originalCwd);
|
|
248
|
+
if (previousProjectDir === undefined) {
|
|
249
|
+
delete process.env.KTX_PROJECT_DIR;
|
|
250
|
+
}
|
|
251
|
+
else {
|
|
252
|
+
process.env.KTX_PROJECT_DIR = previousProjectDir;
|
|
253
|
+
}
|
|
254
|
+
await rm(tempDir, { recursive: true, force: true });
|
|
255
|
+
}
|
|
256
|
+
});
|
|
257
|
+
it('prints help without project status for bare ktx in a TTY when a project is discoverable', async () => {
|
|
258
|
+
const { mkdtemp, realpath, rm, writeFile } = await import('node:fs/promises');
|
|
259
|
+
const { tmpdir } = await import('node:os');
|
|
260
|
+
const { join } = await import('node:path');
|
|
261
|
+
const originalCwd = process.cwd();
|
|
262
|
+
const previousProjectDir = process.env.KTX_PROJECT_DIR;
|
|
263
|
+
const tempDir = await mkdtemp(join(tmpdir(), 'ktx-bare-existing-'));
|
|
264
|
+
const setup = vi.fn(async () => 0);
|
|
265
|
+
const testIo = makeIo({ stdoutIsTty: true });
|
|
266
|
+
const expectedProjectDir = await realpath(tempDir);
|
|
267
|
+
try {
|
|
268
|
+
delete process.env.KTX_PROJECT_DIR;
|
|
269
|
+
await writeFile(join(tempDir, 'ktx.yaml'), 'project: revenue\nconnections: {}\n', 'utf-8');
|
|
270
|
+
process.chdir(tempDir);
|
|
271
|
+
await expect(runKtxCli([], testIo.io, { setup })).resolves.toBe(0);
|
|
272
|
+
expect(testIo.stdout()).toContain('Usage: ktx [options] [command]');
|
|
273
|
+
expect(testIo.stdout()).not.toContain(`Project: ${expectedProjectDir}`);
|
|
274
|
+
expect(setup).not.toHaveBeenCalled();
|
|
275
|
+
}
|
|
276
|
+
finally {
|
|
277
|
+
process.chdir(originalCwd);
|
|
278
|
+
if (previousProjectDir === undefined) {
|
|
279
|
+
delete process.env.KTX_PROJECT_DIR;
|
|
280
|
+
}
|
|
281
|
+
else {
|
|
282
|
+
process.env.KTX_PROJECT_DIR = previousProjectDir;
|
|
283
|
+
}
|
|
284
|
+
await rm(tempDir, { recursive: true, force: true });
|
|
285
|
+
}
|
|
286
|
+
});
|
|
287
|
+
it('does not invoke status for bare ktx in a TTY when status would fail', async () => {
|
|
288
|
+
const setup = vi.fn(async () => {
|
|
289
|
+
throw new Error('Unsupported ingest.llm: use top-level llm.provider, llm.models, and ingest.workUnits');
|
|
290
|
+
});
|
|
291
|
+
const testIo = makeIo({ stdoutIsTty: true });
|
|
292
|
+
const previousProjectDir = process.env.KTX_PROJECT_DIR;
|
|
293
|
+
try {
|
|
294
|
+
process.env.KTX_PROJECT_DIR = tempDir;
|
|
295
|
+
await expect(runKtxCli([], testIo.io, { setup })).resolves.toBe(0);
|
|
296
|
+
expect(testIo.stdout()).toContain('Usage: ktx [options] [command]');
|
|
297
|
+
expect(setup).not.toHaveBeenCalled();
|
|
298
|
+
expect(testIo.stderr()).toBe('');
|
|
299
|
+
}
|
|
300
|
+
finally {
|
|
301
|
+
if (previousProjectDir === undefined) {
|
|
302
|
+
delete process.env.KTX_PROJECT_DIR;
|
|
303
|
+
}
|
|
304
|
+
else {
|
|
305
|
+
process.env.KTX_PROJECT_DIR = previousProjectDir;
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
});
|
|
309
|
+
it('rejects removed verbose global option through Commander', async () => {
|
|
310
|
+
const testIo = makeIo();
|
|
311
|
+
const removedVerboseOption = '--' + 'verbose';
|
|
312
|
+
await expect(runKtxCli([removedVerboseOption, 'connection', 'list'], testIo.io)).resolves.toBe(1);
|
|
313
|
+
expect(testIo.stderr()).toContain(`unknown option '${removedVerboseOption}'`);
|
|
314
|
+
expect(testIo.stdout()).toBe('');
|
|
315
|
+
});
|
|
316
|
+
it('prints a zsh completion function', async () => {
|
|
317
|
+
const testIo = makeIo();
|
|
318
|
+
const zshWords = '$' + '{words[@]}';
|
|
319
|
+
await expect(runKtxCli(['dev', 'completion', 'zsh'], testIo.io)).resolves.toBe(0);
|
|
320
|
+
expect(testIo.stdout()).toContain('#compdef ktx');
|
|
321
|
+
expect(testIo.stdout()).toContain('KTX_COMPLETION_COMMAND:-ktx');
|
|
322
|
+
expect(testIo.stdout()).toContain(`dev __complete --shell zsh --position "$CURRENT" -- "${zshWords}"`);
|
|
323
|
+
expect(testIo.stdout()).toContain('compdef _ktx ktx');
|
|
324
|
+
expect(testIo.stderr()).toBe('');
|
|
325
|
+
});
|
|
326
|
+
it('installs zsh completions into the user zsh config directory', async () => {
|
|
327
|
+
const testIo = makeIo();
|
|
328
|
+
const previousHome = process.env.HOME;
|
|
329
|
+
const previousZdotdir = process.env.ZDOTDIR;
|
|
330
|
+
const tempHome = await mkdtemp(join(tmpdir(), 'ktx-completion-home-'));
|
|
331
|
+
try {
|
|
332
|
+
process.env.HOME = tempHome;
|
|
333
|
+
delete process.env.ZDOTDIR;
|
|
334
|
+
await expect(runKtxCli(['dev', 'completion', 'zsh', '--install'], testIo.io)).resolves.toBe(0);
|
|
335
|
+
const completionFile = await readFile(join(tempHome, '.zfunc', '_ktx'), 'utf-8');
|
|
336
|
+
const zshrc = await readFile(join(tempHome, '.zshrc'), 'utf-8');
|
|
337
|
+
expect(completionFile).toContain('#compdef ktx');
|
|
338
|
+
expect(zshrc).toContain('# >>> ktx completion >>>');
|
|
339
|
+
expect(zshrc).toContain('_ktx_completion_command()');
|
|
340
|
+
expect(zshrc).toContain('"name": "ktx-workspace"');
|
|
341
|
+
expect(zshrc).toContain('scripts/run-ktx.mjs');
|
|
342
|
+
expect(zshrc).toContain("export KTX_COMPLETION_COMMAND='$(_ktx_completion_command)'");
|
|
343
|
+
expect(zshrc).toContain('setopt complete_aliases');
|
|
344
|
+
expect(zshrc).toContain('fpath=("$HOME/.zfunc" $fpath)');
|
|
345
|
+
expect(zshrc).toContain('autoload -Uz compinit');
|
|
346
|
+
expect(zshrc).toContain('compinit');
|
|
347
|
+
expect(testIo.stdout()).toContain('Installed zsh completion:');
|
|
348
|
+
expect(testIo.stdout()).toContain('Restart your shell or run: source ~/.zshrc');
|
|
349
|
+
expect(testIo.stderr()).toBe('');
|
|
350
|
+
}
|
|
351
|
+
finally {
|
|
352
|
+
if (previousHome === undefined) {
|
|
353
|
+
delete process.env.HOME;
|
|
354
|
+
}
|
|
355
|
+
else {
|
|
356
|
+
process.env.HOME = previousHome;
|
|
357
|
+
}
|
|
358
|
+
if (previousZdotdir === undefined) {
|
|
359
|
+
delete process.env.ZDOTDIR;
|
|
360
|
+
}
|
|
361
|
+
else {
|
|
362
|
+
process.env.ZDOTDIR = previousZdotdir;
|
|
363
|
+
}
|
|
364
|
+
await rm(tempHome, { recursive: true, force: true });
|
|
365
|
+
}
|
|
366
|
+
});
|
|
367
|
+
it('updates zsh completion install block idempotently before existing compinit', async () => {
|
|
368
|
+
const firstIo = makeIo();
|
|
369
|
+
const secondIo = makeIo();
|
|
370
|
+
const previousHome = process.env.HOME;
|
|
371
|
+
const previousZdotdir = process.env.ZDOTDIR;
|
|
372
|
+
const tempHome = await mkdtemp(join(tmpdir(), 'ktx-completion-home-'));
|
|
373
|
+
try {
|
|
374
|
+
process.env.HOME = tempHome;
|
|
375
|
+
delete process.env.ZDOTDIR;
|
|
376
|
+
await writeFile(join(tempHome, '.zshrc'), 'export EDITOR=vim\nautoload -Uz compinit\ncompinit\n', 'utf-8');
|
|
377
|
+
await expect(runKtxCli(['dev', 'completion', 'zsh', '--install'], firstIo.io)).resolves.toBe(0);
|
|
378
|
+
await expect(runKtxCli(['dev', 'completion', 'zsh', '--install'], secondIo.io)).resolves.toBe(0);
|
|
379
|
+
const zshrc = await readFile(join(tempHome, '.zshrc'), 'utf-8');
|
|
380
|
+
expect(zshrc.match(/# >>> ktx completion >>>/g)).toHaveLength(1);
|
|
381
|
+
expect(zshrc.indexOf('fpath=("$HOME/.zfunc" $fpath)')).toBeLessThan(zshrc.indexOf('autoload -Uz compinit'));
|
|
382
|
+
expect(zshrc.match(/_ktx_completion_command\(\)/g)).toHaveLength(1);
|
|
383
|
+
expect(zshrc.match(/^compinit$/gm)).toHaveLength(1);
|
|
384
|
+
expect(secondIo.stdout()).toContain('Updated zsh config:');
|
|
385
|
+
expect(firstIo.stderr()).toBe('');
|
|
386
|
+
expect(secondIo.stderr()).toBe('');
|
|
387
|
+
}
|
|
388
|
+
finally {
|
|
389
|
+
if (previousHome === undefined) {
|
|
390
|
+
delete process.env.HOME;
|
|
391
|
+
}
|
|
392
|
+
else {
|
|
393
|
+
process.env.HOME = previousHome;
|
|
394
|
+
}
|
|
395
|
+
if (previousZdotdir === undefined) {
|
|
396
|
+
delete process.env.ZDOTDIR;
|
|
397
|
+
}
|
|
398
|
+
else {
|
|
399
|
+
process.env.ZDOTDIR = previousZdotdir;
|
|
400
|
+
}
|
|
401
|
+
await rm(tempHome, { recursive: true, force: true });
|
|
402
|
+
}
|
|
403
|
+
});
|
|
404
|
+
it('completes root and nested Commander command names', async () => {
|
|
405
|
+
const rootIo = makeIo();
|
|
406
|
+
const connectionIo = makeIo();
|
|
407
|
+
await expect(runKtxCli(['dev', '__complete', '--shell', 'zsh', '--position', '2', '--', 'ktx', 'co'], rootIo.io)).resolves.toBe(0);
|
|
408
|
+
await expect(runKtxCli(['dev', '__complete', '--shell', 'zsh', '--position', '3', '--', 'ktx', 'connection', 'm'], connectionIo.io)).resolves.toBe(0);
|
|
409
|
+
expect(rootIo.stdout()).toContain('connection:Add, list, test, and map data sources');
|
|
410
|
+
expect(rootIo.stdout()).not.toContain('__complete');
|
|
411
|
+
expect(connectionIo.stdout()).toContain('map:Refresh and validate BI-to-warehouse mappings');
|
|
412
|
+
expect(connectionIo.stdout()).toContain('mapping:Manage Metabase warehouse mappings');
|
|
413
|
+
expect(rootIo.stderr()).toBe('');
|
|
414
|
+
expect(connectionIo.stderr()).toBe('');
|
|
415
|
+
});
|
|
416
|
+
it('completes options and Commander choices', async () => {
|
|
417
|
+
const optionIo = makeIo();
|
|
418
|
+
const choiceIo = makeIo();
|
|
419
|
+
await expect(runKtxCli(['dev', '__complete', '--shell', 'zsh', '--position', '4', '--', 'ktx', 'connection', 'add', '--cr'], optionIo.io)).resolves.toBe(0);
|
|
420
|
+
await expect(runKtxCli([
|
|
421
|
+
'dev',
|
|
422
|
+
'__complete',
|
|
423
|
+
'--shell',
|
|
424
|
+
'zsh',
|
|
425
|
+
'--position',
|
|
426
|
+
'7',
|
|
427
|
+
'--',
|
|
428
|
+
'ktx',
|
|
429
|
+
'connection',
|
|
430
|
+
'add',
|
|
431
|
+
'notion',
|
|
432
|
+
'docs',
|
|
433
|
+
'--crawl-mode',
|
|
434
|
+
'',
|
|
435
|
+
], choiceIo.io)).resolves.toBe(0);
|
|
436
|
+
expect(optionIo.stdout()).toContain('--crawl-mode:Notion crawl mode');
|
|
437
|
+
expect(choiceIo.stdout()).toContain('all_accessible');
|
|
438
|
+
expect(choiceIo.stdout()).toContain('selected_roots');
|
|
439
|
+
expect(optionIo.stderr()).toBe('');
|
|
440
|
+
expect(choiceIo.stderr()).toBe('');
|
|
441
|
+
});
|
|
442
|
+
it('dispatches serve stdio commands', async () => {
|
|
443
|
+
const testIo = makeIo();
|
|
444
|
+
const serveStdio = vi.fn().mockResolvedValue(0);
|
|
445
|
+
await expect(runKtxCli(['--project-dir', tempDir, 'serve', '--mcp', 'stdio', '--user-id', 'agent'], testIo.io, {
|
|
446
|
+
serveStdio,
|
|
447
|
+
})).resolves.toBe(0);
|
|
448
|
+
expect(serveStdio).toHaveBeenCalledWith({
|
|
449
|
+
mcp: 'stdio',
|
|
450
|
+
projectDir: tempDir,
|
|
451
|
+
userId: 'agent',
|
|
452
|
+
semanticCompute: false,
|
|
453
|
+
semanticComputeUrl: undefined,
|
|
454
|
+
executeQueries: false,
|
|
455
|
+
memoryCapture: false,
|
|
456
|
+
memoryModel: undefined,
|
|
457
|
+
cliVersion: '0.0.0-private',
|
|
458
|
+
runtimeInstallPolicy: 'prompt',
|
|
459
|
+
});
|
|
460
|
+
});
|
|
461
|
+
it('routes public ingest through the public ingest parser', async () => {
|
|
462
|
+
const testIo = makeIo();
|
|
463
|
+
const ingest = vi.fn().mockResolvedValue(0);
|
|
464
|
+
await expect(runKtxCli(['--project-dir', '/tmp/project', 'ingest', 'warehouse'], testIo.io, { publicIngest: ingest })).resolves.toBe(0);
|
|
465
|
+
expect(ingest).toHaveBeenCalledWith({
|
|
466
|
+
command: 'run',
|
|
467
|
+
projectDir: '/tmp/project',
|
|
468
|
+
targetConnectionId: 'warehouse',
|
|
469
|
+
all: false,
|
|
470
|
+
json: false,
|
|
471
|
+
inputMode: 'auto',
|
|
472
|
+
}, testIo.io);
|
|
473
|
+
});
|
|
474
|
+
it('prints public ingest watch help from Commander', async () => {
|
|
475
|
+
const testIo = makeIo();
|
|
476
|
+
const publicIngest = vi.fn(async () => 0);
|
|
477
|
+
const lowLevelIngest = vi.fn(async () => 0);
|
|
478
|
+
await expect(runKtxCli(['ingest', 'watch', '--help'], testIo.io, { publicIngest, ingest: lowLevelIngest })).resolves.toBe(0);
|
|
479
|
+
expect(testIo.stdout()).toContain('Usage: ktx ingest watch [options] [runId]');
|
|
480
|
+
expect(testIo.stdout()).toContain('[runId]');
|
|
481
|
+
expect(testIo.stdout()).toContain('--project-dir <path>');
|
|
482
|
+
expect(testIo.stdout()).toContain('--json');
|
|
483
|
+
expect(testIo.stdout()).toContain('--no-input');
|
|
484
|
+
expect(testIo.stderr()).toBe('');
|
|
485
|
+
expect(publicIngest).not.toHaveBeenCalled();
|
|
486
|
+
expect(lowLevelIngest).not.toHaveBeenCalled();
|
|
487
|
+
});
|
|
488
|
+
it('dispatches public ingest status and watch through Commander', async () => {
|
|
489
|
+
const statusIo = makeIo();
|
|
490
|
+
const watchIo = makeIo();
|
|
491
|
+
const publicIngest = vi.fn(async () => 0);
|
|
492
|
+
await expect(runKtxCli(['--project-dir', tempDir, 'ingest', 'status', 'run-1', '--json', '--no-input'], statusIo.io, {
|
|
493
|
+
publicIngest,
|
|
494
|
+
})).resolves.toBe(0);
|
|
495
|
+
await expect(runKtxCli(['--project-dir', tempDir, 'ingest', 'watch', '--no-input'], watchIo.io, {
|
|
496
|
+
publicIngest,
|
|
497
|
+
})).resolves.toBe(0);
|
|
498
|
+
expect(publicIngest).toHaveBeenNthCalledWith(1, {
|
|
499
|
+
command: 'status',
|
|
500
|
+
projectDir: tempDir,
|
|
501
|
+
runId: 'run-1',
|
|
502
|
+
json: true,
|
|
503
|
+
inputMode: 'disabled',
|
|
504
|
+
}, statusIo.io);
|
|
505
|
+
expect(publicIngest).toHaveBeenNthCalledWith(2, {
|
|
506
|
+
command: 'watch',
|
|
507
|
+
projectDir: tempDir,
|
|
508
|
+
json: false,
|
|
509
|
+
inputMode: 'disabled',
|
|
510
|
+
}, watchIo.io);
|
|
511
|
+
expect(statusIo.stderr()).toBe('');
|
|
512
|
+
expect(watchIo.stderr()).toBe('');
|
|
513
|
+
});
|
|
514
|
+
it('rejects standalone demo commands', async () => {
|
|
515
|
+
const testIo = makeIo();
|
|
516
|
+
const demo = vi.fn().mockResolvedValue(0);
|
|
517
|
+
await expect(runKtxCli(['demo', '--mode', 'replay', '--no-input'], testIo.io, { demo })).resolves.toBe(1);
|
|
518
|
+
expect(testIo.stderr()).toMatch(/unknown command|error:/i);
|
|
519
|
+
expect(demo).not.toHaveBeenCalled();
|
|
520
|
+
});
|
|
521
|
+
it('dispatches setup demo commands', async () => {
|
|
522
|
+
const testIo = makeIo();
|
|
523
|
+
const demo = vi.fn().mockResolvedValue(0);
|
|
524
|
+
await expect(runKtxCli(['--project-dir', tempDir, 'setup', 'demo', '--mode', 'replay', '--no-input'], testIo.io, { demo })).resolves.toBe(0);
|
|
525
|
+
expect(demo).toHaveBeenCalledWith({
|
|
526
|
+
command: 'replay',
|
|
527
|
+
projectDir: tempDir,
|
|
528
|
+
outputMode: 'viz',
|
|
529
|
+
inputMode: 'disabled',
|
|
530
|
+
}, testIo.io);
|
|
531
|
+
demo.mockClear();
|
|
532
|
+
await expect(runKtxCli(['--project-dir', tempDir, 'setup', 'demo', '--mode', 'seeded', '--no-input'], testIo.io, {
|
|
533
|
+
demo,
|
|
534
|
+
})).resolves.toBe(0);
|
|
535
|
+
expect(demo).toHaveBeenCalledWith({
|
|
536
|
+
command: 'seeded',
|
|
537
|
+
projectDir: tempDir,
|
|
538
|
+
outputMode: 'viz',
|
|
539
|
+
inputMode: 'disabled',
|
|
540
|
+
}, testIo.io);
|
|
541
|
+
demo.mockClear();
|
|
542
|
+
await expect(runKtxCli(['--project-dir', tempDir, 'setup', '--no-input', 'demo', '--mode', 'seeded'], testIo.io, {
|
|
543
|
+
demo,
|
|
544
|
+
})).resolves.toBe(0);
|
|
545
|
+
expect(demo).toHaveBeenCalledWith({
|
|
546
|
+
command: 'seeded',
|
|
547
|
+
projectDir: tempDir,
|
|
548
|
+
outputMode: 'viz',
|
|
549
|
+
inputMode: 'disabled',
|
|
550
|
+
}, testIo.io);
|
|
551
|
+
demo.mockClear();
|
|
552
|
+
await expect(runKtxCli(['--project-dir', tempDir, 'setup', 'demo', 'inspect', '--no-input'], testIo.io, { demo })).resolves.toBe(0);
|
|
553
|
+
expect(demo).toHaveBeenCalledWith({
|
|
554
|
+
command: 'inspect',
|
|
555
|
+
projectDir: tempDir,
|
|
556
|
+
outputMode: 'plain',
|
|
557
|
+
inputMode: 'disabled',
|
|
558
|
+
}, testIo.io);
|
|
559
|
+
});
|
|
560
|
+
it('dispatches demo ingest argv', async () => {
|
|
561
|
+
const testIo = makeIo();
|
|
562
|
+
const demo = vi.fn().mockResolvedValue(0);
|
|
563
|
+
await expect(runKtxCli(['--project-dir', tempDir, 'setup', 'demo', 'ingest', '--mode', 'full', '--no-input'], testIo.io, {
|
|
564
|
+
demo,
|
|
565
|
+
})).resolves.toBe(0);
|
|
566
|
+
expect(demo).toHaveBeenCalledWith({
|
|
567
|
+
command: 'ingest',
|
|
568
|
+
mode: 'full',
|
|
569
|
+
projectDir: tempDir,
|
|
570
|
+
outputMode: 'viz',
|
|
571
|
+
inputMode: 'disabled',
|
|
572
|
+
}, testIo.io);
|
|
573
|
+
demo.mockClear();
|
|
574
|
+
await expect(runKtxCli(['--project-dir', tempDir, 'setup', '--no-input', 'demo', 'ingest', '--mode', 'seeded'], testIo.io, {
|
|
575
|
+
demo,
|
|
576
|
+
})).resolves.toBe(0);
|
|
577
|
+
expect(demo).toHaveBeenCalledWith({
|
|
578
|
+
command: 'ingest',
|
|
579
|
+
mode: 'seeded',
|
|
580
|
+
projectDir: tempDir,
|
|
581
|
+
outputMode: 'viz',
|
|
582
|
+
inputMode: 'disabled',
|
|
583
|
+
}, testIo.io);
|
|
584
|
+
demo.mockClear();
|
|
585
|
+
await expect(runKtxCli(['--project-dir', tempDir, 'setup', 'demo', 'ingest', '--mode', 'full', '--no-input', '--plain'], testIo.io, {
|
|
586
|
+
demo,
|
|
587
|
+
})).resolves.toBe(0);
|
|
588
|
+
expect(demo).toHaveBeenCalledWith({
|
|
589
|
+
command: 'ingest',
|
|
590
|
+
mode: 'full',
|
|
591
|
+
projectDir: tempDir,
|
|
592
|
+
outputMode: 'plain',
|
|
593
|
+
inputMode: 'disabled',
|
|
594
|
+
}, testIo.io);
|
|
595
|
+
});
|
|
596
|
+
it('prints public ingest help without invoking ingest execution', async () => {
|
|
597
|
+
const testIo = makeIo();
|
|
598
|
+
const publicIngest = vi.fn();
|
|
599
|
+
const lowLevelIngest = vi.fn();
|
|
600
|
+
await expect(runKtxCli(['ingest', '--help'], testIo.io, { publicIngest, ingest: lowLevelIngest })).resolves.toBe(0);
|
|
601
|
+
expect(testIo.stdout()).toContain('Usage: ktx ingest [options] [connectionId]');
|
|
602
|
+
expect(testIo.stdout()).toContain('Build and refresh KTX context from configured sources');
|
|
603
|
+
expect(testIo.stdout()).toContain('status');
|
|
604
|
+
expect(testIo.stdout()).toContain('watch');
|
|
605
|
+
expect(testIo.stdout()).toContain('ktx ingest --all [options]');
|
|
606
|
+
expect(testIo.stdout()).toContain('ktx ingest status [runId] [options]');
|
|
607
|
+
expect(testIo.stdout()).toContain('ktx ingest watch [runId] [options]');
|
|
608
|
+
expect(testIo.stdout()).not.toContain('ktx ingest replay <runId> [options]');
|
|
609
|
+
expect(testIo.stdout()).toContain('--no-input');
|
|
610
|
+
expect(testIo.stdout()).not.toContain('--adapter');
|
|
611
|
+
expect(testIo.stderr()).toBe('');
|
|
612
|
+
expect(publicIngest).not.toHaveBeenCalled();
|
|
613
|
+
expect(lowLevelIngest).not.toHaveBeenCalled();
|
|
614
|
+
});
|
|
615
|
+
it('reserves public ingest run while keeping dev ingest run available', async () => {
|
|
616
|
+
const publicRunIo = makeIo();
|
|
617
|
+
const publicHelpIo = makeIo();
|
|
618
|
+
const devRunIo = makeIo();
|
|
619
|
+
const publicIngest = vi.fn(async () => 0);
|
|
620
|
+
const lowLevelIngest = vi.fn(async () => 0);
|
|
621
|
+
await expect(runKtxCli(['ingest', 'run'], publicRunIo.io, { publicIngest, ingest: lowLevelIngest })).resolves.toBe(1);
|
|
622
|
+
expect(publicRunIo.stderr()).toMatch(/invalid argument|reserved|run/i);
|
|
623
|
+
expect(publicIngest).not.toHaveBeenCalled();
|
|
624
|
+
await expect(runKtxCli(['ingest', 'run', '--help'], publicHelpIo.io, { publicIngest, ingest: lowLevelIngest })).resolves.toBe(0);
|
|
625
|
+
expect(publicHelpIo.stdout()).toContain('Usage: ktx ingest [options] [connectionId]');
|
|
626
|
+
expect(publicHelpIo.stdout()).not.toContain('Usage: ktx ingest ' + 'run');
|
|
627
|
+
await expect(runKtxCli(['dev', 'ingest', 'run', '--connection-id', 'warehouse', '--adapter', 'metabase'], devRunIo.io, {
|
|
628
|
+
publicIngest,
|
|
629
|
+
ingest: lowLevelIngest,
|
|
630
|
+
})).resolves.toBe(0);
|
|
631
|
+
expect(lowLevelIngest).toHaveBeenCalledWith(expect.objectContaining({ command: 'run', connectionId: 'warehouse', adapter: 'metabase' }), expect.anything());
|
|
632
|
+
});
|
|
633
|
+
it('dispatches dev doctor and ingest parser cases through Commander', async () => {
|
|
634
|
+
const doctor = vi.fn(async () => 0);
|
|
635
|
+
const ingest = vi.fn(async () => 0);
|
|
636
|
+
const doctorIo = makeIo();
|
|
637
|
+
const ingestRunIo = makeIo();
|
|
638
|
+
const ingestReplayHelpIo = makeIo();
|
|
639
|
+
await expect(runKtxCli(['dev', 'doctor', 'setup', '--json', '--no-input'], doctorIo.io, { doctor })).resolves.toBe(0);
|
|
640
|
+
await expect(runKtxCli([
|
|
641
|
+
'dev',
|
|
642
|
+
'ingest',
|
|
643
|
+
'run',
|
|
644
|
+
'--project-dir',
|
|
645
|
+
tempDir,
|
|
646
|
+
'--connection-id',
|
|
647
|
+
'warehouse',
|
|
648
|
+
'--adapter',
|
|
649
|
+
'fake',
|
|
650
|
+
'--source-dir',
|
|
651
|
+
tempDir,
|
|
652
|
+
'--debug-llm-request-file',
|
|
653
|
+
`${tempDir}/debug.jsonl`,
|
|
654
|
+
'--json',
|
|
655
|
+
'--no-input',
|
|
656
|
+
], ingestRunIo.io, { ingest })).resolves.toBe(0);
|
|
657
|
+
await expect(runKtxCli(['dev', 'ingest', 'replay', '--help'], ingestReplayHelpIo.io, { ingest })).resolves.toBe(0);
|
|
658
|
+
expect(doctor).toHaveBeenCalledWith({ command: 'setup', outputMode: 'json', inputMode: 'disabled' }, doctorIo.io);
|
|
659
|
+
expect(ingest).toHaveBeenCalledWith({
|
|
660
|
+
command: 'run',
|
|
661
|
+
projectDir: tempDir,
|
|
662
|
+
connectionId: 'warehouse',
|
|
663
|
+
adapter: 'fake',
|
|
664
|
+
sourceDir: tempDir,
|
|
665
|
+
databaseIntrospectionUrl: undefined,
|
|
666
|
+
cliVersion: '0.0.0-private',
|
|
667
|
+
runtimeInstallPolicy: 'never',
|
|
668
|
+
debugLlmRequestFile: `${tempDir}/debug.jsonl`,
|
|
669
|
+
outputMode: 'json',
|
|
670
|
+
inputMode: 'disabled',
|
|
671
|
+
}, ingestRunIo.io);
|
|
672
|
+
expect(ingestReplayHelpIo.stdout()).toContain('Usage: ktx dev ingest replay [options] <runId>');
|
|
673
|
+
expect(ingestReplayHelpIo.stdout()).toContain('<runId>');
|
|
674
|
+
expect(doctorIo.stderr()).toBe('');
|
|
675
|
+
expect(ingestRunIo.stderr()).toBe('');
|
|
676
|
+
expect(ingestReplayHelpIo.stderr()).toBe('');
|
|
677
|
+
});
|
|
678
|
+
it('routes ingest managed runtime install policies', async () => {
|
|
679
|
+
const autoIo = makeIo();
|
|
680
|
+
const conflictIo = makeIo();
|
|
681
|
+
const ingest = vi.fn(async () => 0);
|
|
682
|
+
await expect(runKtxCli([
|
|
683
|
+
'dev',
|
|
684
|
+
'ingest',
|
|
685
|
+
'run',
|
|
686
|
+
'--project-dir',
|
|
687
|
+
tempDir,
|
|
688
|
+
'--connection-id',
|
|
689
|
+
'warehouse',
|
|
690
|
+
'--adapter',
|
|
691
|
+
'looker',
|
|
692
|
+
'--yes',
|
|
693
|
+
], autoIo.io, { ingest })).resolves.toBe(0);
|
|
694
|
+
await expect(runKtxCli([
|
|
695
|
+
'dev',
|
|
696
|
+
'ingest',
|
|
697
|
+
'run',
|
|
698
|
+
'--project-dir',
|
|
699
|
+
tempDir,
|
|
700
|
+
'--connection-id',
|
|
701
|
+
'warehouse',
|
|
702
|
+
'--adapter',
|
|
703
|
+
'looker',
|
|
704
|
+
'--yes',
|
|
705
|
+
'--no-input',
|
|
706
|
+
], conflictIo.io, { ingest })).resolves.toBe(1);
|
|
707
|
+
expect(ingest).toHaveBeenCalledWith(expect.objectContaining({
|
|
708
|
+
command: 'run',
|
|
709
|
+
cliVersion: '0.0.0-private',
|
|
710
|
+
runtimeInstallPolicy: 'auto',
|
|
711
|
+
}), autoIo.io);
|
|
712
|
+
expect(conflictIo.stderr()).toContain('Choose only one runtime install mode: --yes or --no-input');
|
|
713
|
+
});
|
|
714
|
+
it('dispatches public connection through the existing connection implementation', async () => {
|
|
715
|
+
const testIo = makeIo();
|
|
716
|
+
const connection = vi.fn(async () => 0);
|
|
717
|
+
await expect(runKtxCli(['--project-dir', tempDir, 'connection', 'list'], testIo.io, { connection })).resolves.toBe(0);
|
|
718
|
+
expect(connection).toHaveBeenCalledWith({ command: 'list', projectDir: tempDir }, testIo.io);
|
|
719
|
+
expect(testIo.stderr()).toBe('');
|
|
720
|
+
});
|
|
721
|
+
it('dispatches setup status and top-level status through the setup runner', async () => {
|
|
722
|
+
const setup = vi.fn(async () => 0);
|
|
723
|
+
const setupIo = makeIo();
|
|
724
|
+
const statusIo = makeIo();
|
|
725
|
+
await expect(runKtxCli(['--project-dir', tempDir, 'setup', 'status', '--json'], setupIo.io, { setup })).resolves.toBe(0);
|
|
726
|
+
await expect(runKtxCli(['--project-dir', tempDir, 'status', '--json'], statusIo.io, { setup })).resolves.toBe(0);
|
|
727
|
+
expect(setup).toHaveBeenNthCalledWith(1, { command: 'status', projectDir: tempDir, json: true }, setupIo.io);
|
|
728
|
+
expect(setup).toHaveBeenNthCalledWith(2, { command: 'status', projectDir: tempDir, json: true }, statusIo.io);
|
|
729
|
+
});
|
|
730
|
+
it('dispatches setup context recovery commands through the setup runner', async () => {
|
|
731
|
+
const setup = vi.fn(async () => 0);
|
|
732
|
+
const buildIo = makeIo();
|
|
733
|
+
const watchIo = makeIo();
|
|
734
|
+
const statusIo = makeIo();
|
|
735
|
+
const stopIo = makeIo();
|
|
736
|
+
await expect(runKtxCli(['--project-dir', tempDir, 'setup', 'context', 'build'], buildIo.io, { setup })).resolves.toBe(0);
|
|
737
|
+
await expect(runKtxCli(['--project-dir', tempDir, 'setup', 'context', 'watch', 'setup-context-local-1'], watchIo.io, {
|
|
738
|
+
setup,
|
|
739
|
+
})).resolves.toBe(0);
|
|
740
|
+
await expect(runKtxCli(['--project-dir', tempDir, 'setup', 'context', 'status', 'setup-context-local-1', '--json'], statusIo.io, {
|
|
741
|
+
setup,
|
|
742
|
+
})).resolves.toBe(0);
|
|
743
|
+
await expect(runKtxCli(['--project-dir', tempDir, 'setup', 'context', 'stop', 'setup-context-local-1'], stopIo.io, {
|
|
744
|
+
setup,
|
|
745
|
+
})).resolves.toBe(0);
|
|
746
|
+
expect(setup).toHaveBeenNthCalledWith(1, { command: 'context-build', projectDir: tempDir, inputMode: 'auto' }, buildIo.io);
|
|
747
|
+
expect(setup).toHaveBeenNthCalledWith(2, { command: 'context-watch', projectDir: tempDir, runId: 'setup-context-local-1', inputMode: 'auto' }, watchIo.io);
|
|
748
|
+
expect(setup).toHaveBeenNthCalledWith(3, { command: 'context-status', projectDir: tempDir, runId: 'setup-context-local-1', json: true }, statusIo.io);
|
|
749
|
+
expect(setup).toHaveBeenNthCalledWith(4, { command: 'context-stop', projectDir: tempDir, runId: 'setup-context-local-1' }, stopIo.io);
|
|
750
|
+
});
|
|
751
|
+
it('dispatches Anthropic setup flags to the setup runner', async () => {
|
|
752
|
+
const setup = vi.fn(async () => 0);
|
|
753
|
+
const setupIo = makeIo();
|
|
754
|
+
await expect(runKtxCli([
|
|
755
|
+
'--project-dir',
|
|
756
|
+
tempDir,
|
|
757
|
+
'setup',
|
|
758
|
+
'--no-input',
|
|
759
|
+
'--anthropic-api-key-env',
|
|
760
|
+
'ANTHROPIC_API_KEY',
|
|
761
|
+
'--anthropic-model',
|
|
762
|
+
'claude-sonnet-4-6',
|
|
763
|
+
], setupIo.io, { setup })).resolves.toBe(0);
|
|
764
|
+
expect(setup).toHaveBeenCalledWith(expect.objectContaining({
|
|
765
|
+
command: 'run',
|
|
766
|
+
projectDir: tempDir,
|
|
767
|
+
inputMode: 'disabled',
|
|
768
|
+
cliVersion: '0.0.0-private',
|
|
769
|
+
anthropicApiKeyEnv: 'ANTHROPIC_API_KEY',
|
|
770
|
+
anthropicModel: 'claude-sonnet-4-6',
|
|
771
|
+
skipLlm: false,
|
|
772
|
+
}), setupIo.io);
|
|
773
|
+
});
|
|
774
|
+
it('rejects conflicting Anthropic credential setup flags', async () => {
|
|
775
|
+
const setup = vi.fn(async () => 0);
|
|
776
|
+
const setupIo = makeIo();
|
|
777
|
+
await expect(runKtxCli([
|
|
778
|
+
'--project-dir',
|
|
779
|
+
tempDir,
|
|
780
|
+
'setup',
|
|
781
|
+
'--anthropic-api-key-env',
|
|
782
|
+
'ANTHROPIC_API_KEY',
|
|
783
|
+
'--anthropic-api-key-file',
|
|
784
|
+
'/tmp/anthropic-key',
|
|
785
|
+
], setupIo.io, { setup })).resolves.toBe(1);
|
|
786
|
+
expect(setup).not.toHaveBeenCalled();
|
|
787
|
+
expect(setupIo.stderr()).toContain('Choose only one Anthropic credential source');
|
|
788
|
+
});
|
|
789
|
+
it('dispatches embedding setup flags to the setup runner', async () => {
|
|
790
|
+
const setup = vi.fn(async () => 0);
|
|
791
|
+
const setupIo = makeIo();
|
|
792
|
+
await expect(runKtxCli([
|
|
793
|
+
'--project-dir',
|
|
794
|
+
tempDir,
|
|
795
|
+
'setup',
|
|
796
|
+
'--no-input',
|
|
797
|
+
'--skip-llm',
|
|
798
|
+
'--embedding-backend',
|
|
799
|
+
'openai',
|
|
800
|
+
'--embedding-api-key-env',
|
|
801
|
+
'OPENAI_API_KEY',
|
|
802
|
+
], setupIo.io, { setup })).resolves.toBe(0);
|
|
803
|
+
expect(setup).toHaveBeenCalledWith(expect.objectContaining({
|
|
804
|
+
command: 'run',
|
|
805
|
+
projectDir: tempDir,
|
|
806
|
+
inputMode: 'disabled',
|
|
807
|
+
skipLlm: true,
|
|
808
|
+
embeddingBackend: 'openai',
|
|
809
|
+
embeddingApiKeyEnv: 'OPENAI_API_KEY',
|
|
810
|
+
skipEmbeddings: false,
|
|
811
|
+
}), setupIo.io);
|
|
812
|
+
});
|
|
813
|
+
it('dispatches database setup flags to the setup runner', async () => {
|
|
814
|
+
const setup = vi.fn(async () => 0);
|
|
815
|
+
const setupIo = makeIo();
|
|
816
|
+
await expect(runKtxCli([
|
|
817
|
+
'setup',
|
|
818
|
+
'--project-dir',
|
|
819
|
+
'/tmp/project',
|
|
820
|
+
'--no-input',
|
|
821
|
+
'--yes',
|
|
822
|
+
'--skip-llm',
|
|
823
|
+
'--skip-embeddings',
|
|
824
|
+
'--database',
|
|
825
|
+
'postgres',
|
|
826
|
+
'--new-database-connection-id',
|
|
827
|
+
'warehouse',
|
|
828
|
+
'--database-url',
|
|
829
|
+
'env:DATABASE_URL',
|
|
830
|
+
'--database-schema',
|
|
831
|
+
'public',
|
|
832
|
+
'--enable-historic-sql',
|
|
833
|
+
'--historic-sql-window-days',
|
|
834
|
+
'30',
|
|
835
|
+
'--historic-sql-min-calls',
|
|
836
|
+
'12',
|
|
837
|
+
], setupIo.io, { setup })).resolves.toBe(0);
|
|
838
|
+
expect(setup).toHaveBeenCalledWith(expect.objectContaining({
|
|
839
|
+
command: 'run',
|
|
840
|
+
projectDir: '/tmp/project',
|
|
841
|
+
inputMode: 'disabled',
|
|
842
|
+
yes: true,
|
|
843
|
+
cliVersion: '0.0.0-private',
|
|
844
|
+
skipLlm: true,
|
|
845
|
+
skipEmbeddings: true,
|
|
846
|
+
databaseDrivers: ['postgres'],
|
|
847
|
+
databaseConnectionId: 'warehouse',
|
|
848
|
+
databaseUrl: 'env:DATABASE_URL',
|
|
849
|
+
databaseSchemas: ['public'],
|
|
850
|
+
enableHistoricSql: true,
|
|
851
|
+
historicSqlWindowDays: 30,
|
|
852
|
+
historicSqlMinCalls: 12,
|
|
853
|
+
skipDatabases: false,
|
|
854
|
+
}), setupIo.io);
|
|
855
|
+
});
|
|
856
|
+
it('dispatches setup source flags', async () => {
|
|
857
|
+
const setup = vi.fn(async () => 0);
|
|
858
|
+
const testIo = makeIo();
|
|
859
|
+
await expect(runKtxCli([
|
|
860
|
+
'--project-dir',
|
|
861
|
+
tempDir,
|
|
862
|
+
'setup',
|
|
863
|
+
'--no-input',
|
|
864
|
+
'--source',
|
|
865
|
+
'metabase',
|
|
866
|
+
'--source-connection-id',
|
|
867
|
+
'prod_metabase',
|
|
868
|
+
'--source-url',
|
|
869
|
+
'https://metabase.example.com',
|
|
870
|
+
'--source-api-key-ref',
|
|
871
|
+
'env:METABASE_API_KEY',
|
|
872
|
+
'--source-warehouse-connection-id',
|
|
873
|
+
'warehouse',
|
|
874
|
+
'--metabase-database-id',
|
|
875
|
+
'1',
|
|
876
|
+
'--skip-llm',
|
|
877
|
+
'--skip-embeddings',
|
|
878
|
+
'--skip-databases',
|
|
879
|
+
], testIo.io, { setup })).resolves.toBe(0);
|
|
880
|
+
expect(setup).toHaveBeenCalledWith(expect.objectContaining({
|
|
881
|
+
command: 'run',
|
|
882
|
+
projectDir: tempDir,
|
|
883
|
+
source: 'metabase',
|
|
884
|
+
sourceConnectionId: 'prod_metabase',
|
|
885
|
+
sourceUrl: 'https://metabase.example.com',
|
|
886
|
+
sourceApiKeyRef: 'env:METABASE_API_KEY',
|
|
887
|
+
sourceWarehouseConnectionId: 'warehouse',
|
|
888
|
+
metabaseDatabaseId: 1,
|
|
889
|
+
}), testIo.io);
|
|
890
|
+
});
|
|
891
|
+
it('dispatches setup agent flags and removal', async () => {
|
|
892
|
+
const setup = vi.fn(async () => 0);
|
|
893
|
+
const setupIo = makeIo();
|
|
894
|
+
const removeIo = makeIo();
|
|
895
|
+
await expect(runKtxCli([
|
|
896
|
+
'--project-dir',
|
|
897
|
+
tempDir,
|
|
898
|
+
'setup',
|
|
899
|
+
'--agents',
|
|
900
|
+
'--target',
|
|
901
|
+
'codex',
|
|
902
|
+
'--project',
|
|
903
|
+
'--agent-install-mode',
|
|
904
|
+
'both',
|
|
905
|
+
'--no-input',
|
|
906
|
+
'--yes',
|
|
907
|
+
], setupIo.io, { setup })).resolves.toBe(0);
|
|
908
|
+
await expect(runKtxCli(['--project-dir', tempDir, 'setup', 'remove', '--agents'], removeIo.io, { setup })).resolves.toBe(0);
|
|
909
|
+
expect(setup).toHaveBeenNthCalledWith(1, expect.objectContaining({
|
|
910
|
+
command: 'run',
|
|
911
|
+
agents: true,
|
|
912
|
+
target: 'codex',
|
|
913
|
+
agentScope: 'project',
|
|
914
|
+
agentInstallMode: 'both',
|
|
915
|
+
inputMode: 'disabled',
|
|
916
|
+
yes: true,
|
|
917
|
+
}), setupIo.io);
|
|
918
|
+
expect(setup).toHaveBeenNthCalledWith(2, { command: 'remove-agents', projectDir: tempDir }, removeIo.io);
|
|
919
|
+
});
|
|
920
|
+
it('rejects source-path with source-git-url', async () => {
|
|
921
|
+
const setup = vi.fn(async () => 0);
|
|
922
|
+
const testIo = makeIo();
|
|
923
|
+
await expect(runKtxCli([
|
|
924
|
+
'--project-dir',
|
|
925
|
+
tempDir,
|
|
926
|
+
'setup',
|
|
927
|
+
'--no-input',
|
|
928
|
+
'--source',
|
|
929
|
+
'dbt',
|
|
930
|
+
'--source-path',
|
|
931
|
+
'/repo/dbt',
|
|
932
|
+
'--source-git-url',
|
|
933
|
+
'https://github.com/acme/dbt.git',
|
|
934
|
+
], testIo.io, { setup })).resolves.toBe(1);
|
|
935
|
+
expect(setup).not.toHaveBeenCalled();
|
|
936
|
+
expect(testIo.stderr()).toContain('Choose only one source location');
|
|
937
|
+
});
|
|
938
|
+
it('rejects deterministic as a setup embedding backend', async () => {
|
|
939
|
+
const setup = vi.fn(async () => 0);
|
|
940
|
+
const setupIo = makeIo();
|
|
941
|
+
await expect(runKtxCli(['--project-dir', tempDir, 'setup', '--embedding-backend', 'deterministic'], setupIo.io, { setup })).resolves.toBe(1);
|
|
942
|
+
expect(setup).not.toHaveBeenCalled();
|
|
943
|
+
expect(setupIo.stderr()).toContain("invalid choice 'deterministic'");
|
|
944
|
+
});
|
|
945
|
+
it('rejects gateway as a setup embedding backend', async () => {
|
|
946
|
+
const setup = vi.fn(async () => 0);
|
|
947
|
+
const setupIo = makeIo();
|
|
948
|
+
await expect(runKtxCli(['--project-dir', tempDir, 'setup', '--embedding-backend', 'gateway'], setupIo.io, { setup })).resolves.toBe(1);
|
|
949
|
+
expect(setup).not.toHaveBeenCalled();
|
|
950
|
+
expect(setupIo.stderr()).toContain("invalid choice 'gateway'");
|
|
951
|
+
});
|
|
952
|
+
it('rejects conflicting embedding credential setup flags', async () => {
|
|
953
|
+
const setup = vi.fn(async () => 0);
|
|
954
|
+
const setupIo = makeIo();
|
|
955
|
+
await expect(runKtxCli([
|
|
956
|
+
'--project-dir',
|
|
957
|
+
tempDir,
|
|
958
|
+
'setup',
|
|
959
|
+
'--embedding-backend',
|
|
960
|
+
'openai',
|
|
961
|
+
'--embedding-api-key-env',
|
|
962
|
+
'OPENAI_API_KEY',
|
|
963
|
+
'--embedding-api-key-file',
|
|
964
|
+
'/tmp/openai-key',
|
|
965
|
+
], setupIo.io, { setup })).resolves.toBe(1);
|
|
966
|
+
expect(setup).not.toHaveBeenCalled();
|
|
967
|
+
expect(setupIo.stderr()).toContain('Choose only one embedding credential source');
|
|
968
|
+
});
|
|
969
|
+
it('rejects conflicting Historic SQL setup flags', async () => {
|
|
970
|
+
const setup = vi.fn(async () => 0);
|
|
971
|
+
const setupIo = makeIo();
|
|
972
|
+
await expect(runKtxCli(['--project-dir', tempDir, 'setup', '--enable-historic-sql', '--disable-historic-sql'], setupIo.io, {
|
|
973
|
+
setup,
|
|
974
|
+
})).resolves.toBe(1);
|
|
975
|
+
expect(setup).not.toHaveBeenCalled();
|
|
976
|
+
expect(setupIo.stderr()).toContain('Choose only one Historic SQL action');
|
|
977
|
+
});
|
|
978
|
+
it('registers hidden agent help and tools discovery without showing agent in root help', async () => {
|
|
979
|
+
const helpIo = makeIo();
|
|
980
|
+
const toolsIo = makeIo();
|
|
981
|
+
const agent = vi.fn(async () => 0);
|
|
982
|
+
await expect(runKtxCli(['agent', '--help'], helpIo.io, { agent })).resolves.toBe(0);
|
|
983
|
+
await expect(runKtxCli(['--project-dir', tempDir, 'agent', 'tools', '--json'], toolsIo.io, { agent })).resolves.toBe(0);
|
|
984
|
+
expect(helpIo.stdout()).toContain('Usage: ktx agent');
|
|
985
|
+
expect(toolsIo.stderr()).toBe('');
|
|
986
|
+
expect(agent).toHaveBeenCalledWith({ command: 'tools', projectDir: tempDir, json: true }, toolsIo.io);
|
|
987
|
+
});
|
|
988
|
+
it('dispatches full hidden agent commands without exposing agent in root help', async () => {
|
|
989
|
+
const agent = vi.fn(async () => 0);
|
|
990
|
+
const cases = [
|
|
991
|
+
{
|
|
992
|
+
argv: ['--project-dir', tempDir, 'agent', 'context', '--json'],
|
|
993
|
+
args: { command: 'context', projectDir: tempDir, json: true },
|
|
994
|
+
},
|
|
995
|
+
{
|
|
996
|
+
argv: [
|
|
997
|
+
'--project-dir',
|
|
998
|
+
tempDir,
|
|
999
|
+
'agent',
|
|
1000
|
+
'sl',
|
|
1001
|
+
'list',
|
|
1002
|
+
'--json',
|
|
1003
|
+
'--connection-id',
|
|
1004
|
+
'warehouse',
|
|
1005
|
+
'--query',
|
|
1006
|
+
'orders',
|
|
1007
|
+
],
|
|
1008
|
+
args: { command: 'sl-list', projectDir: tempDir, json: true, connectionId: 'warehouse', query: 'orders' },
|
|
1009
|
+
},
|
|
1010
|
+
{
|
|
1011
|
+
argv: ['--project-dir', tempDir, 'agent', 'sl', 'read', 'orders', '--json', '--connection-id', 'warehouse'],
|
|
1012
|
+
args: { command: 'sl-read', projectDir: tempDir, json: true, sourceName: 'orders', connectionId: 'warehouse' },
|
|
1013
|
+
},
|
|
1014
|
+
{
|
|
1015
|
+
argv: [
|
|
1016
|
+
'--project-dir',
|
|
1017
|
+
tempDir,
|
|
1018
|
+
'agent',
|
|
1019
|
+
'sl',
|
|
1020
|
+
'query',
|
|
1021
|
+
'--json',
|
|
1022
|
+
'--connection-id',
|
|
1023
|
+
'warehouse',
|
|
1024
|
+
'--query-file',
|
|
1025
|
+
'/tmp/query.json',
|
|
1026
|
+
'--execute',
|
|
1027
|
+
'--max-rows',
|
|
1028
|
+
'100',
|
|
1029
|
+
],
|
|
1030
|
+
args: {
|
|
1031
|
+
command: 'sl-query',
|
|
1032
|
+
projectDir: tempDir,
|
|
1033
|
+
json: true,
|
|
1034
|
+
connectionId: 'warehouse',
|
|
1035
|
+
queryFile: '/tmp/query.json',
|
|
1036
|
+
execute: true,
|
|
1037
|
+
maxRows: 100,
|
|
1038
|
+
cliVersion: '0.0.0-private',
|
|
1039
|
+
runtimeInstallPolicy: 'prompt',
|
|
1040
|
+
},
|
|
1041
|
+
},
|
|
1042
|
+
{
|
|
1043
|
+
argv: ['--project-dir', tempDir, 'agent', 'wiki', 'search', 'revenue', '--json', '--limit', '5'],
|
|
1044
|
+
args: { command: 'wiki-search', projectDir: tempDir, json: true, query: 'revenue', limit: 5 },
|
|
1045
|
+
},
|
|
1046
|
+
{
|
|
1047
|
+
argv: ['--project-dir', tempDir, 'agent', 'wiki', 'read', 'page-1', '--json'],
|
|
1048
|
+
args: { command: 'wiki-read', projectDir: tempDir, json: true, pageId: 'page-1' },
|
|
1049
|
+
},
|
|
1050
|
+
{
|
|
1051
|
+
argv: [
|
|
1052
|
+
'--project-dir',
|
|
1053
|
+
tempDir,
|
|
1054
|
+
'agent',
|
|
1055
|
+
'sql',
|
|
1056
|
+
'execute',
|
|
1057
|
+
'--json',
|
|
1058
|
+
'--connection-id',
|
|
1059
|
+
'warehouse',
|
|
1060
|
+
'--sql-file',
|
|
1061
|
+
'/tmp/query.sql',
|
|
1062
|
+
'--max-rows',
|
|
1063
|
+
'100',
|
|
1064
|
+
],
|
|
1065
|
+
args: {
|
|
1066
|
+
command: 'sql-execute',
|
|
1067
|
+
projectDir: tempDir,
|
|
1068
|
+
json: true,
|
|
1069
|
+
connectionId: 'warehouse',
|
|
1070
|
+
sqlFile: '/tmp/query.sql',
|
|
1071
|
+
maxRows: 100,
|
|
1072
|
+
},
|
|
1073
|
+
},
|
|
1074
|
+
];
|
|
1075
|
+
for (const entry of cases) {
|
|
1076
|
+
const io = makeIo();
|
|
1077
|
+
await expect(runKtxCli(entry.argv, io.io, { agent })).resolves.toBe(0);
|
|
1078
|
+
expect(agent).toHaveBeenLastCalledWith(entry.args, io.io);
|
|
1079
|
+
expect(io.stderr()).toBe('');
|
|
1080
|
+
}
|
|
1081
|
+
const helpIo = makeIo();
|
|
1082
|
+
await expect(runKtxCli(['--help'], helpIo.io, { agent })).resolves.toBe(0);
|
|
1083
|
+
expect(helpIo.stdout()).not.toContain('agent ');
|
|
1084
|
+
});
|
|
1085
|
+
it('routes hidden agent SL query managed runtime policies', async () => {
|
|
1086
|
+
const autoIo = makeIo();
|
|
1087
|
+
const neverIo = makeIo();
|
|
1088
|
+
const conflictIo = makeIo();
|
|
1089
|
+
const agent = vi.fn(async () => 0);
|
|
1090
|
+
await expect(runKtxCli([
|
|
1091
|
+
'--project-dir',
|
|
1092
|
+
tempDir,
|
|
1093
|
+
'agent',
|
|
1094
|
+
'sl',
|
|
1095
|
+
'query',
|
|
1096
|
+
'--json',
|
|
1097
|
+
'--connection-id',
|
|
1098
|
+
'warehouse',
|
|
1099
|
+
'--query-file',
|
|
1100
|
+
'/tmp/query.json',
|
|
1101
|
+
'--yes',
|
|
1102
|
+
], autoIo.io, { agent })).resolves.toBe(0);
|
|
1103
|
+
await expect(runKtxCli([
|
|
1104
|
+
'--project-dir',
|
|
1105
|
+
tempDir,
|
|
1106
|
+
'agent',
|
|
1107
|
+
'sl',
|
|
1108
|
+
'query',
|
|
1109
|
+
'--json',
|
|
1110
|
+
'--connection-id',
|
|
1111
|
+
'warehouse',
|
|
1112
|
+
'--query-file',
|
|
1113
|
+
'/tmp/query.json',
|
|
1114
|
+
'--no-input',
|
|
1115
|
+
], neverIo.io, { agent })).resolves.toBe(0);
|
|
1116
|
+
await expect(runKtxCli([
|
|
1117
|
+
'--project-dir',
|
|
1118
|
+
tempDir,
|
|
1119
|
+
'agent',
|
|
1120
|
+
'sl',
|
|
1121
|
+
'query',
|
|
1122
|
+
'--json',
|
|
1123
|
+
'--connection-id',
|
|
1124
|
+
'warehouse',
|
|
1125
|
+
'--query-file',
|
|
1126
|
+
'/tmp/query.json',
|
|
1127
|
+
'--yes',
|
|
1128
|
+
'--no-input',
|
|
1129
|
+
], conflictIo.io, { agent })).resolves.toBe(1);
|
|
1130
|
+
expect(agent).toHaveBeenNthCalledWith(1, {
|
|
1131
|
+
command: 'sl-query',
|
|
1132
|
+
projectDir: tempDir,
|
|
1133
|
+
json: true,
|
|
1134
|
+
connectionId: 'warehouse',
|
|
1135
|
+
queryFile: '/tmp/query.json',
|
|
1136
|
+
execute: false,
|
|
1137
|
+
cliVersion: '0.0.0-private',
|
|
1138
|
+
runtimeInstallPolicy: 'auto',
|
|
1139
|
+
}, autoIo.io);
|
|
1140
|
+
expect(agent).toHaveBeenNthCalledWith(2, {
|
|
1141
|
+
command: 'sl-query',
|
|
1142
|
+
projectDir: tempDir,
|
|
1143
|
+
json: true,
|
|
1144
|
+
connectionId: 'warehouse',
|
|
1145
|
+
queryFile: '/tmp/query.json',
|
|
1146
|
+
execute: false,
|
|
1147
|
+
cliVersion: '0.0.0-private',
|
|
1148
|
+
runtimeInstallPolicy: 'never',
|
|
1149
|
+
}, neverIo.io);
|
|
1150
|
+
expect(conflictIo.stderr()).toContain('Choose only one runtime install mode: --yes or --no-input');
|
|
1151
|
+
});
|
|
1152
|
+
it('prints semantic-layer hybrid search metadata from the hidden agent sl list command', async () => {
|
|
1153
|
+
const agent = vi.fn(async (args, io) => {
|
|
1154
|
+
expect(args).toEqual({
|
|
1155
|
+
command: 'sl-list',
|
|
1156
|
+
projectDir: tempDir,
|
|
1157
|
+
json: true,
|
|
1158
|
+
connectionId: 'warehouse',
|
|
1159
|
+
query: 'paid',
|
|
1160
|
+
});
|
|
1161
|
+
io.stdout.write(`${JSON.stringify({
|
|
1162
|
+
sources: [
|
|
1163
|
+
{
|
|
1164
|
+
connectionId: 'warehouse',
|
|
1165
|
+
connectionName: 'warehouse',
|
|
1166
|
+
name: 'orders',
|
|
1167
|
+
columnCount: 2,
|
|
1168
|
+
measureCount: 1,
|
|
1169
|
+
joinCount: 0,
|
|
1170
|
+
score: 0.03278688524590164,
|
|
1171
|
+
matchReasons: ['dictionary'],
|
|
1172
|
+
dictionaryMatches: [{ column: 'status', values: ['paid'] }],
|
|
1173
|
+
},
|
|
1174
|
+
],
|
|
1175
|
+
totalSources: 1,
|
|
1176
|
+
}, null, 2)}\n`);
|
|
1177
|
+
return 0;
|
|
1178
|
+
});
|
|
1179
|
+
const io = makeIo();
|
|
1180
|
+
await expect(runKtxCli(['--project-dir', tempDir, 'agent', 'sl', 'list', '--json', '--connection-id', 'warehouse', '--query', 'paid'], io.io, { agent })).resolves.toBe(0);
|
|
1181
|
+
expect(JSON.parse(io.stdout())).toEqual({
|
|
1182
|
+
sources: [
|
|
1183
|
+
expect.objectContaining({
|
|
1184
|
+
connectionId: 'warehouse',
|
|
1185
|
+
name: 'orders',
|
|
1186
|
+
matchReasons: ['dictionary'],
|
|
1187
|
+
dictionaryMatches: [{ column: 'status', values: ['paid'] }],
|
|
1188
|
+
}),
|
|
1189
|
+
],
|
|
1190
|
+
totalSources: 1,
|
|
1191
|
+
});
|
|
1192
|
+
});
|
|
1193
|
+
it('prints wiki hybrid search metadata from the hidden agent wiki search command', async () => {
|
|
1194
|
+
const agent = vi.fn(async (args, io) => {
|
|
1195
|
+
expect(args).toEqual({
|
|
1196
|
+
command: 'wiki-search',
|
|
1197
|
+
projectDir: tempDir,
|
|
1198
|
+
json: true,
|
|
1199
|
+
query: 'paid order',
|
|
1200
|
+
limit: 5,
|
|
1201
|
+
});
|
|
1202
|
+
io.stdout.write(`${JSON.stringify({
|
|
1203
|
+
results: [
|
|
1204
|
+
{
|
|
1205
|
+
key: 'metrics/revenue',
|
|
1206
|
+
path: 'knowledge/global/metrics/revenue.md',
|
|
1207
|
+
scope: 'GLOBAL',
|
|
1208
|
+
summary: 'Revenue metric definition',
|
|
1209
|
+
score: 0.02459016393442623,
|
|
1210
|
+
matchReasons: ['lexical', 'token'],
|
|
1211
|
+
},
|
|
1212
|
+
],
|
|
1213
|
+
totalFound: 1,
|
|
1214
|
+
}, null, 2)}\n`);
|
|
1215
|
+
return 0;
|
|
1216
|
+
});
|
|
1217
|
+
const io = makeIo();
|
|
1218
|
+
await expect(runKtxCli(['--project-dir', tempDir, 'agent', 'wiki', 'search', 'paid order', '--json', '--limit', '5'], io.io, {
|
|
1219
|
+
agent,
|
|
1220
|
+
})).resolves.toBe(0);
|
|
1221
|
+
expect(JSON.parse(io.stdout())).toEqual({
|
|
1222
|
+
results: [
|
|
1223
|
+
expect.objectContaining({
|
|
1224
|
+
key: 'metrics/revenue',
|
|
1225
|
+
path: 'knowledge/global/metrics/revenue.md',
|
|
1226
|
+
matchReasons: ['lexical', 'token'],
|
|
1227
|
+
}),
|
|
1228
|
+
],
|
|
1229
|
+
totalFound: 1,
|
|
1230
|
+
});
|
|
1231
|
+
});
|
|
1232
|
+
it('dispatches public connection subcommands through the existing connection implementation', async () => {
|
|
1233
|
+
const tempDir = await mkdtemp(join(tmpdir(), 'ktx-connection-dispatch-'));
|
|
1234
|
+
const connection = vi.fn(async () => 0);
|
|
1235
|
+
await expect(runKtxCli(['--project-dir', tempDir, 'connection', 'list'], makeIo().io, { connection })).resolves.toBe(0);
|
|
1236
|
+
const removeIo = makeIo();
|
|
1237
|
+
await expect(runKtxCli(['--project-dir', tempDir, 'connection', 'remove', 'warehouse', '--force', '--no-input'], removeIo.io, {
|
|
1238
|
+
connection,
|
|
1239
|
+
})).resolves.toBe(0);
|
|
1240
|
+
const mapIo = makeIo();
|
|
1241
|
+
await expect(runKtxCli(['--project-dir', tempDir, 'connection', 'map', 'prod-metabase', '--json'], mapIo.io, {
|
|
1242
|
+
connection,
|
|
1243
|
+
})).resolves.toBe(0);
|
|
1244
|
+
expect(connection).toHaveBeenNthCalledWith(1, { command: 'list', projectDir: tempDir }, expect.anything());
|
|
1245
|
+
expect(connection).toHaveBeenNthCalledWith(2, {
|
|
1246
|
+
command: 'remove',
|
|
1247
|
+
projectDir: tempDir,
|
|
1248
|
+
connectionId: 'warehouse',
|
|
1249
|
+
force: true,
|
|
1250
|
+
inputMode: 'disabled',
|
|
1251
|
+
}, expect.anything());
|
|
1252
|
+
expect(connection).toHaveBeenNthCalledWith(3, {
|
|
1253
|
+
command: 'map',
|
|
1254
|
+
projectDir: tempDir,
|
|
1255
|
+
sourceConnectionId: 'prod-metabase',
|
|
1256
|
+
json: true,
|
|
1257
|
+
}, expect.anything());
|
|
1258
|
+
await rm(tempDir, { recursive: true, force: true });
|
|
1259
|
+
});
|
|
1260
|
+
it('prints help for connection metabase setup', async () => {
|
|
1261
|
+
const helpIo = makeIo();
|
|
1262
|
+
await expect(runKtxCli(['connection', 'metabase', 'setup', '--help'], helpIo.io)).resolves.toBe(0);
|
|
1263
|
+
expect(helpIo.stdout()).toContain('Usage: ktx connection metabase setup');
|
|
1264
|
+
for (const option of [
|
|
1265
|
+
'--id <connectionId>',
|
|
1266
|
+
'--url <url>',
|
|
1267
|
+
'--api-key <key>',
|
|
1268
|
+
'--username <email>',
|
|
1269
|
+
'--password <password>',
|
|
1270
|
+
'--mint-api-key',
|
|
1271
|
+
'--map <metabaseDatabaseId=targetConnectionId>',
|
|
1272
|
+
'--sync <metabaseDatabaseId>',
|
|
1273
|
+
'--sync-mode <mode>',
|
|
1274
|
+
'--run-ingest',
|
|
1275
|
+
'--yes',
|
|
1276
|
+
'--no-input',
|
|
1277
|
+
]) {
|
|
1278
|
+
expect(helpIo.stdout()).toContain(option);
|
|
1279
|
+
}
|
|
1280
|
+
expect(helpIo.stdout()).toContain('Guided equivalent of:');
|
|
1281
|
+
for (const line of [
|
|
1282
|
+
'ktx connection mapping refresh <connectionId> --auto-accept',
|
|
1283
|
+
'ktx connection mapping set <connectionId> databaseMappings <id>=<target>',
|
|
1284
|
+
'ktx connection mapping set-sync-enabled <connectionId> <id> --enabled true',
|
|
1285
|
+
'ktx ingest <connectionId>',
|
|
1286
|
+
]) {
|
|
1287
|
+
expect(helpIo.stdout()).toContain(line);
|
|
1288
|
+
}
|
|
1289
|
+
expect(helpIo.stderr()).toBe('');
|
|
1290
|
+
});
|
|
1291
|
+
it('dispatches connection metabase setup through Commander', async () => {
|
|
1292
|
+
const connectionMetabaseSetup = vi.fn(async () => 0);
|
|
1293
|
+
const fakeMetabaseCredential = 'mb_example';
|
|
1294
|
+
const setupIo = makeIo();
|
|
1295
|
+
await expect(runKtxCli([
|
|
1296
|
+
'connection',
|
|
1297
|
+
'metabase',
|
|
1298
|
+
'setup',
|
|
1299
|
+
'--project-dir',
|
|
1300
|
+
tempDir,
|
|
1301
|
+
'--id',
|
|
1302
|
+
'metabase',
|
|
1303
|
+
'--url',
|
|
1304
|
+
'http://metabase.example.test:3000',
|
|
1305
|
+
'--api-key',
|
|
1306
|
+
'mb_example',
|
|
1307
|
+
'--map',
|
|
1308
|
+
'2=orbit',
|
|
1309
|
+
'--sync',
|
|
1310
|
+
'2',
|
|
1311
|
+
'--yes',
|
|
1312
|
+
'--no-input',
|
|
1313
|
+
], setupIo.io, { connectionMetabaseSetup })).resolves.toBe(0);
|
|
1314
|
+
expect(connectionMetabaseSetup).toHaveBeenCalledWith({
|
|
1315
|
+
command: 'setup',
|
|
1316
|
+
projectDir: tempDir,
|
|
1317
|
+
connectionId: 'metabase',
|
|
1318
|
+
url: 'http://metabase.example.test:3000',
|
|
1319
|
+
apiKey: fakeMetabaseCredential,
|
|
1320
|
+
mintApiKey: false,
|
|
1321
|
+
mappings: [{ metabaseDatabaseId: 2, targetConnectionId: 'orbit' }],
|
|
1322
|
+
syncEnabledDatabaseIds: [2],
|
|
1323
|
+
syncMode: 'ALL',
|
|
1324
|
+
runIngest: false,
|
|
1325
|
+
yes: true,
|
|
1326
|
+
inputMode: 'disabled',
|
|
1327
|
+
}, expect.anything());
|
|
1328
|
+
expect(setupIo.stderr()).toBe('');
|
|
1329
|
+
});
|
|
1330
|
+
it('validates connection metabase setup option values before runner dispatch', async () => {
|
|
1331
|
+
const connectionMetabaseSetup = vi.fn(async () => 0);
|
|
1332
|
+
for (const argv of [
|
|
1333
|
+
[
|
|
1334
|
+
'connection',
|
|
1335
|
+
'metabase',
|
|
1336
|
+
'setup',
|
|
1337
|
+
'--project-dir',
|
|
1338
|
+
tempDir,
|
|
1339
|
+
'--url',
|
|
1340
|
+
'http://metabase.example.test:3000',
|
|
1341
|
+
'--api-key',
|
|
1342
|
+
'mb_example',
|
|
1343
|
+
'--map',
|
|
1344
|
+
'nope=orbit',
|
|
1345
|
+
],
|
|
1346
|
+
[
|
|
1347
|
+
'connection',
|
|
1348
|
+
'metabase',
|
|
1349
|
+
'setup',
|
|
1350
|
+
'--project-dir',
|
|
1351
|
+
tempDir,
|
|
1352
|
+
'--url',
|
|
1353
|
+
'http://metabase.example.test:3000',
|
|
1354
|
+
'--api-key',
|
|
1355
|
+
'mb_example',
|
|
1356
|
+
'--map',
|
|
1357
|
+
'2=../orbit',
|
|
1358
|
+
],
|
|
1359
|
+
[
|
|
1360
|
+
'connection',
|
|
1361
|
+
'metabase',
|
|
1362
|
+
'setup',
|
|
1363
|
+
'--project-dir',
|
|
1364
|
+
tempDir,
|
|
1365
|
+
'--url',
|
|
1366
|
+
'http://metabase.example.test:3000',
|
|
1367
|
+
'--api-key',
|
|
1368
|
+
'mb_example',
|
|
1369
|
+
'--sync',
|
|
1370
|
+
'nope',
|
|
1371
|
+
],
|
|
1372
|
+
[
|
|
1373
|
+
'connection',
|
|
1374
|
+
'metabase',
|
|
1375
|
+
'setup',
|
|
1376
|
+
'--project-dir',
|
|
1377
|
+
tempDir,
|
|
1378
|
+
'--url',
|
|
1379
|
+
'http://metabase.example.test:3000',
|
|
1380
|
+
'--api-key',
|
|
1381
|
+
'mb_example',
|
|
1382
|
+
'--sync-mode',
|
|
1383
|
+
'BAD',
|
|
1384
|
+
],
|
|
1385
|
+
[
|
|
1386
|
+
'connection',
|
|
1387
|
+
'metabase',
|
|
1388
|
+
'setup',
|
|
1389
|
+
'--project-dir',
|
|
1390
|
+
tempDir,
|
|
1391
|
+
'--url',
|
|
1392
|
+
'http://metabase.example.test:3000',
|
|
1393
|
+
'--api-key',
|
|
1394
|
+
'mb_example',
|
|
1395
|
+
'--mint-api-key',
|
|
1396
|
+
'--api-key',
|
|
1397
|
+
'also_bad',
|
|
1398
|
+
],
|
|
1399
|
+
]) {
|
|
1400
|
+
const testIo = makeIo();
|
|
1401
|
+
await expect(runKtxCli(argv, testIo.io, { connectionMetabaseSetup })).resolves.toBe(1);
|
|
1402
|
+
expect(testIo.stderr()).toMatch(/map|sync|sync-mode|conflict|cannot be used|invalid|integer|choices/i);
|
|
1403
|
+
}
|
|
1404
|
+
expect(connectionMetabaseSetup).not.toHaveBeenCalled();
|
|
1405
|
+
});
|
|
1406
|
+
it('rejects commands removed from the May 6 root surface', async () => {
|
|
1407
|
+
for (const argv of [
|
|
1408
|
+
['init'],
|
|
1409
|
+
['connect', 'list'],
|
|
1410
|
+
['scan', 'warehouse'],
|
|
1411
|
+
['knowledge', 'list'],
|
|
1412
|
+
['ask', 'What sources are connected?'],
|
|
1413
|
+
]) {
|
|
1414
|
+
const testIo = makeIo();
|
|
1415
|
+
await expect(runKtxCli(argv, testIo.io)).resolves.toBe(1);
|
|
1416
|
+
expect(testIo.stderr()).toMatch(/unknown command|error:/);
|
|
1417
|
+
}
|
|
1418
|
+
});
|
|
1419
|
+
it('dispatches connection add options through Commander', async () => {
|
|
1420
|
+
const testIo = makeIo();
|
|
1421
|
+
const connection = vi.fn(async () => 0);
|
|
1422
|
+
await expect(runKtxCli([
|
|
1423
|
+
'connection',
|
|
1424
|
+
'add',
|
|
1425
|
+
'notion',
|
|
1426
|
+
'notion-main',
|
|
1427
|
+
'--project-dir',
|
|
1428
|
+
tempDir,
|
|
1429
|
+
'--token-env',
|
|
1430
|
+
'NOTION_AUTH_TOKEN',
|
|
1431
|
+
'--crawl-mode',
|
|
1432
|
+
'selected_roots',
|
|
1433
|
+
'--root-page-id',
|
|
1434
|
+
'page-1',
|
|
1435
|
+
'--root-database-id',
|
|
1436
|
+
'database-1',
|
|
1437
|
+
'--max-pages',
|
|
1438
|
+
'80',
|
|
1439
|
+
], testIo.io, { connection })).resolves.toBe(0);
|
|
1440
|
+
expect(connection).toHaveBeenCalledWith({
|
|
1441
|
+
command: 'add',
|
|
1442
|
+
projectDir: tempDir,
|
|
1443
|
+
driver: 'notion',
|
|
1444
|
+
connectionId: 'notion-main',
|
|
1445
|
+
url: undefined,
|
|
1446
|
+
schemas: [],
|
|
1447
|
+
readonly: false,
|
|
1448
|
+
force: false,
|
|
1449
|
+
allowLiteralCredentials: false,
|
|
1450
|
+
notion: {
|
|
1451
|
+
authTokenRef: 'env:NOTION_AUTH_TOKEN',
|
|
1452
|
+
crawlMode: 'selected_roots',
|
|
1453
|
+
rootPageIds: ['page-1'],
|
|
1454
|
+
rootDatabaseIds: ['database-1'],
|
|
1455
|
+
rootDataSourceIds: [],
|
|
1456
|
+
maxPagesPerRun: 80,
|
|
1457
|
+
maxKnowledgeCreatesPerRun: undefined,
|
|
1458
|
+
maxKnowledgeUpdatesPerRun: undefined,
|
|
1459
|
+
},
|
|
1460
|
+
}, testIo.io);
|
|
1461
|
+
expect(testIo.stderr()).toBe('');
|
|
1462
|
+
});
|
|
1463
|
+
it('prints generated connection notion pick help without invoking execution', async () => {
|
|
1464
|
+
const helpCases = [
|
|
1465
|
+
['connection', 'notion', '--help'],
|
|
1466
|
+
['connection', 'notion', 'pick', '--help'],
|
|
1467
|
+
['connection', 'notion', 'pick', 'notion-main', '--help'],
|
|
1468
|
+
];
|
|
1469
|
+
for (const argv of helpCases) {
|
|
1470
|
+
const testIo = makeIo();
|
|
1471
|
+
const connectionNotion = vi.fn(async () => 0);
|
|
1472
|
+
await expect(runKtxCli(argv, testIo.io, { connectionNotion })).resolves.toBe(0);
|
|
1473
|
+
expect(testIo.stdout()).toContain('Usage: ktx connection notion');
|
|
1474
|
+
expect(testIo.stdout()).toContain('pick');
|
|
1475
|
+
expect(testIo.stderr()).toBe('');
|
|
1476
|
+
expect(connectionNotion).not.toHaveBeenCalled();
|
|
1477
|
+
}
|
|
1478
|
+
});
|
|
1479
|
+
it('dispatches connection notion pick through Commander', async () => {
|
|
1480
|
+
const testIo = makeIo();
|
|
1481
|
+
const connectionNotion = vi.fn(async () => 0);
|
|
1482
|
+
await expect(runKtxCli([
|
|
1483
|
+
'--project-dir',
|
|
1484
|
+
tempDir,
|
|
1485
|
+
'connection',
|
|
1486
|
+
'notion',
|
|
1487
|
+
'pick',
|
|
1488
|
+
'notion-main',
|
|
1489
|
+
'--no-input',
|
|
1490
|
+
'--root-page-id',
|
|
1491
|
+
'11111111222233334444555555555555',
|
|
1492
|
+
'--root-page-id',
|
|
1493
|
+
'11111111-2222-3333-4444-555555555555',
|
|
1494
|
+
], testIo.io, { connectionNotion })).resolves.toBe(0);
|
|
1495
|
+
expect(connectionNotion).toHaveBeenCalledWith({
|
|
1496
|
+
command: 'pick',
|
|
1497
|
+
projectDir: tempDir,
|
|
1498
|
+
connectionId: 'notion-main',
|
|
1499
|
+
mode: 'non-interactive',
|
|
1500
|
+
rootPageIds: ['11111111-2222-3333-4444-555555555555'],
|
|
1501
|
+
}, testIo.io);
|
|
1502
|
+
expect(testIo.stderr()).toBe('');
|
|
1503
|
+
});
|
|
1504
|
+
it('ignores connection notion pick root page flags in interactive mode', async () => {
|
|
1505
|
+
const testIo = makeIo();
|
|
1506
|
+
const connectionNotion = vi.fn(async () => 0);
|
|
1507
|
+
await expect(runKtxCli(['connection', 'notion', 'pick', 'notion-main', '--root-page-id', 'not-a-uuid'], testIo.io, {
|
|
1508
|
+
connectionNotion,
|
|
1509
|
+
})).resolves.toBe(0);
|
|
1510
|
+
expect(connectionNotion).toHaveBeenCalledWith({
|
|
1511
|
+
command: 'pick',
|
|
1512
|
+
projectDir: expect.any(String),
|
|
1513
|
+
connectionId: 'notion-main',
|
|
1514
|
+
mode: 'interactive',
|
|
1515
|
+
}, testIo.io);
|
|
1516
|
+
expect(testIo.stderr()).toBe('');
|
|
1517
|
+
});
|
|
1518
|
+
it('rejects connection notion pick no-input mode without root page ids', async () => {
|
|
1519
|
+
const testIo = makeIo();
|
|
1520
|
+
const connectionNotion = vi.fn(async () => 0);
|
|
1521
|
+
await expect(runKtxCli(['connection', 'notion', 'pick', 'notion-main', '--no-input'], testIo.io, { connectionNotion })).resolves.toBe(1);
|
|
1522
|
+
expect(connectionNotion).not.toHaveBeenCalled();
|
|
1523
|
+
expect(testIo.stderr()).toContain('connection notion pick --no-input requires at least one --root-page-id');
|
|
1524
|
+
});
|
|
1525
|
+
it('writes basic debug dispatch information when --debug is set', async () => {
|
|
1526
|
+
const testIo = makeIo();
|
|
1527
|
+
const connection = vi.fn().mockResolvedValue(0);
|
|
1528
|
+
await expect(runKtxCli(['--project-dir', tempDir, '--debug', 'connection', 'list'], testIo.io, { connection })).resolves.toBe(0);
|
|
1529
|
+
expect(testIo.stderr()).toContain(`[debug] projectDir=${tempDir}`);
|
|
1530
|
+
expect(testIo.stderr()).toContain('[debug] dispatch=connection');
|
|
1531
|
+
});
|
|
1532
|
+
it('routes low-level scan through ktx dev with top-level project-dir', async () => {
|
|
1533
|
+
const testIo = makeIo();
|
|
1534
|
+
const scan = vi.fn().mockResolvedValue(0);
|
|
1535
|
+
await expect(runKtxCli(['--project-dir', tempDir, 'dev', 'scan', 'warehouse'], testIo.io, { scan })).resolves.toBe(0);
|
|
1536
|
+
expect(scan).toHaveBeenCalledWith({
|
|
1537
|
+
command: 'run',
|
|
1538
|
+
projectDir: tempDir,
|
|
1539
|
+
connectionId: 'warehouse',
|
|
1540
|
+
mode: 'structural',
|
|
1541
|
+
detectRelationships: false,
|
|
1542
|
+
dryRun: false,
|
|
1543
|
+
databaseIntrospectionUrl: undefined,
|
|
1544
|
+
cliVersion: '0.0.0-private',
|
|
1545
|
+
runtimeInstallPolicy: 'prompt',
|
|
1546
|
+
}, testIo.io);
|
|
1547
|
+
});
|
|
1548
|
+
it('routes scan managed runtime install policies', async () => {
|
|
1549
|
+
const autoIo = makeIo();
|
|
1550
|
+
const neverIo = makeIo();
|
|
1551
|
+
const conflictIo = makeIo();
|
|
1552
|
+
const scan = vi.fn().mockResolvedValue(0);
|
|
1553
|
+
await expect(runKtxCli(['--project-dir', tempDir, 'dev', 'scan', 'warehouse', '--yes'], autoIo.io, { scan }))
|
|
1554
|
+
.resolves.toBe(0);
|
|
1555
|
+
await expect(runKtxCli(['--project-dir', tempDir, 'dev', 'scan', 'warehouse', '--no-input'], neverIo.io, { scan }))
|
|
1556
|
+
.resolves.toBe(0);
|
|
1557
|
+
await expect(runKtxCli(['--project-dir', tempDir, 'dev', 'scan', 'warehouse', '--yes', '--no-input'], conflictIo.io, {
|
|
1558
|
+
scan,
|
|
1559
|
+
})).resolves.toBe(1);
|
|
1560
|
+
expect(scan).toHaveBeenNthCalledWith(1, expect.objectContaining({
|
|
1561
|
+
command: 'run',
|
|
1562
|
+
runtimeInstallPolicy: 'auto',
|
|
1563
|
+
}), autoIo.io);
|
|
1564
|
+
expect(scan).toHaveBeenNthCalledWith(2, expect.objectContaining({
|
|
1565
|
+
command: 'run',
|
|
1566
|
+
runtimeInstallPolicy: 'never',
|
|
1567
|
+
}), neverIo.io);
|
|
1568
|
+
expect(conflictIo.stderr()).toContain('Choose only one runtime install mode: --yes or --no-input');
|
|
1569
|
+
});
|
|
1570
|
+
it('dispatches serve public command options through Commander', async () => {
|
|
1571
|
+
const serveIo = makeIo();
|
|
1572
|
+
const serveStdio = vi.fn(async () => 0);
|
|
1573
|
+
await expect(runKtxCli([
|
|
1574
|
+
'serve',
|
|
1575
|
+
'--mcp',
|
|
1576
|
+
'stdio',
|
|
1577
|
+
'--project-dir',
|
|
1578
|
+
tempDir,
|
|
1579
|
+
'--semantic-compute-url',
|
|
1580
|
+
'http://127.0.0.1:18080',
|
|
1581
|
+
'--execute-queries',
|
|
1582
|
+
'--memory-capture',
|
|
1583
|
+
'--memory-model',
|
|
1584
|
+
'openai/gpt-5.2',
|
|
1585
|
+
], serveIo.io, { serveStdio })).resolves.toBe(0);
|
|
1586
|
+
expect(serveStdio).toHaveBeenCalledWith({
|
|
1587
|
+
mcp: 'stdio',
|
|
1588
|
+
projectDir: tempDir,
|
|
1589
|
+
userId: 'local',
|
|
1590
|
+
semanticCompute: true,
|
|
1591
|
+
semanticComputeUrl: 'http://127.0.0.1:18080',
|
|
1592
|
+
databaseIntrospectionUrl: undefined,
|
|
1593
|
+
executeQueries: true,
|
|
1594
|
+
memoryCapture: true,
|
|
1595
|
+
memoryModel: 'openai/gpt-5.2',
|
|
1596
|
+
cliVersion: '0.0.0-private',
|
|
1597
|
+
runtimeInstallPolicy: 'prompt',
|
|
1598
|
+
});
|
|
1599
|
+
expect(serveIo.stderr()).toBe('');
|
|
1600
|
+
});
|
|
1601
|
+
it('routes serve managed runtime install policies', async () => {
|
|
1602
|
+
const autoIo = makeIo();
|
|
1603
|
+
const neverIo = makeIo();
|
|
1604
|
+
const conflictIo = makeIo();
|
|
1605
|
+
const serveStdio = vi.fn(async () => 0);
|
|
1606
|
+
await expect(runKtxCli(['serve', '--mcp', 'stdio', '--project-dir', tempDir, '--semantic-compute', '--yes'], autoIo.io, {
|
|
1607
|
+
serveStdio,
|
|
1608
|
+
})).resolves.toBe(0);
|
|
1609
|
+
await expect(runKtxCli(['serve', '--mcp', 'stdio', '--project-dir', tempDir, '--semantic-compute', '--no-input'], neverIo.io, {
|
|
1610
|
+
serveStdio,
|
|
1611
|
+
})).resolves.toBe(0);
|
|
1612
|
+
await expect(runKtxCli(['serve', '--mcp', 'stdio', '--project-dir', tempDir, '--semantic-compute', '--yes', '--no-input'], conflictIo.io, { serveStdio })).resolves.toBe(1);
|
|
1613
|
+
expect(serveStdio).toHaveBeenNthCalledWith(1, {
|
|
1614
|
+
mcp: 'stdio',
|
|
1615
|
+
projectDir: tempDir,
|
|
1616
|
+
userId: 'local',
|
|
1617
|
+
semanticCompute: true,
|
|
1618
|
+
semanticComputeUrl: undefined,
|
|
1619
|
+
databaseIntrospectionUrl: undefined,
|
|
1620
|
+
executeQueries: false,
|
|
1621
|
+
memoryCapture: false,
|
|
1622
|
+
memoryModel: undefined,
|
|
1623
|
+
cliVersion: '0.0.0-private',
|
|
1624
|
+
runtimeInstallPolicy: 'auto',
|
|
1625
|
+
});
|
|
1626
|
+
expect(serveStdio).toHaveBeenNthCalledWith(2, {
|
|
1627
|
+
mcp: 'stdio',
|
|
1628
|
+
projectDir: tempDir,
|
|
1629
|
+
userId: 'local',
|
|
1630
|
+
semanticCompute: true,
|
|
1631
|
+
semanticComputeUrl: undefined,
|
|
1632
|
+
databaseIntrospectionUrl: undefined,
|
|
1633
|
+
executeQueries: false,
|
|
1634
|
+
memoryCapture: false,
|
|
1635
|
+
memoryModel: undefined,
|
|
1636
|
+
cliVersion: '0.0.0-private',
|
|
1637
|
+
runtimeInstallPolicy: 'never',
|
|
1638
|
+
});
|
|
1639
|
+
expect(conflictIo.stderr()).toContain('Choose only one runtime install mode: --yes or --no-input');
|
|
1640
|
+
});
|
|
1641
|
+
it('prints dev help for bare dev commands', async () => {
|
|
1642
|
+
const testIo = makeIo();
|
|
1643
|
+
await expect(runKtxCli(['dev'], testIo.io)).resolves.toBe(0);
|
|
1644
|
+
expect(testIo.stdout()).toContain('Usage: ktx dev [options] [command]');
|
|
1645
|
+
expect(testIo.stdout()).toContain('Low-level diagnostics');
|
|
1646
|
+
expect(testIo.stdout()).toContain('scan');
|
|
1647
|
+
expect(testIo.stdout()).toContain('ingest');
|
|
1648
|
+
expect(testIo.stdout()).toContain('mapping');
|
|
1649
|
+
expect(testIo.stdout()).not.toContain('model');
|
|
1650
|
+
expect(testIo.stdout()).not.toContain('knowledge');
|
|
1651
|
+
expect(testIo.stderr()).toBe('');
|
|
1652
|
+
});
|
|
1653
|
+
it('prints dev command help without invoking low-level execution', async () => {
|
|
1654
|
+
for (const [command, expected] of [
|
|
1655
|
+
['scan', ['Usage: ktx dev scan', '--dry-run', 'status', 'report']],
|
|
1656
|
+
['ingest', ['Usage: ktx dev ingest', 'run', 'replay']],
|
|
1657
|
+
['mapping', ['Usage: ktx dev mapping', 'sync-state', 'validate']],
|
|
1658
|
+
]) {
|
|
1659
|
+
const testIo = makeIo();
|
|
1660
|
+
const scan = vi.fn().mockResolvedValue(0);
|
|
1661
|
+
const sl = vi.fn().mockResolvedValue(0);
|
|
1662
|
+
await expect(runKtxCli(['dev', command, '--help'], testIo.io, { scan, sl })).resolves.toBe(0);
|
|
1663
|
+
for (const text of expected) {
|
|
1664
|
+
expect(testIo.stdout()).toContain(text);
|
|
1665
|
+
}
|
|
1666
|
+
expect(testIo.stderr()).toBe('');
|
|
1667
|
+
expect(scan).not.toHaveBeenCalled();
|
|
1668
|
+
expect(sl).not.toHaveBeenCalled();
|
|
1669
|
+
}
|
|
1670
|
+
});
|
|
1671
|
+
it('prints dev scan subcommand help without invoking scan execution', async () => {
|
|
1672
|
+
const testIo = makeIo();
|
|
1673
|
+
const scan = vi.fn().mockResolvedValue(0);
|
|
1674
|
+
await expect(runKtxCli(['dev', 'scan', 'report', '--help'], testIo.io, { scan })).resolves.toBe(0);
|
|
1675
|
+
expect(testIo.stdout()).toContain('Usage: ktx dev scan report [options] <runId>');
|
|
1676
|
+
expect(testIo.stderr()).toBe('');
|
|
1677
|
+
expect(scan).not.toHaveBeenCalled();
|
|
1678
|
+
});
|
|
1679
|
+
it('rejects removed reserved dev subcommands', async () => {
|
|
1680
|
+
const testIo = makeIo();
|
|
1681
|
+
await expect(runKtxCli(['dev', 'artifacts'], testIo.io)).resolves.toBe(1);
|
|
1682
|
+
expect(testIo.stderr()).toMatch(/unknown command|error:/);
|
|
1683
|
+
});
|
|
1684
|
+
it('rejects mutually exclusive output modes before invoking runners', async () => {
|
|
1685
|
+
const ingest = vi.fn(async () => 0);
|
|
1686
|
+
const demo = vi.fn(async () => 0);
|
|
1687
|
+
for (const argv of [
|
|
1688
|
+
['dev', 'ingest', 'run', '--connection-id', 'warehouse', '--adapter', 'fake', '--json', '--plain'],
|
|
1689
|
+
['dev', 'ingest', 'status', 'run-1', '--json', '--viz'],
|
|
1690
|
+
['setup', 'demo', '--json', '--plain'],
|
|
1691
|
+
['setup', 'demo', 'replay', '--json', '--plain'],
|
|
1692
|
+
]) {
|
|
1693
|
+
const testIo = makeIo();
|
|
1694
|
+
await expect(runKtxCli(argv, testIo.io, { ingest, demo })).resolves.toBe(1);
|
|
1695
|
+
expect(testIo.stderr()).toMatch(/conflict|cannot be used/i);
|
|
1696
|
+
}
|
|
1697
|
+
expect(ingest).not.toHaveBeenCalled();
|
|
1698
|
+
expect(demo).not.toHaveBeenCalled();
|
|
1699
|
+
});
|
|
1700
|
+
it('rejects mutually exclusive credential and scan mode options before invoking runners', async () => {
|
|
1701
|
+
const connection = vi.fn(async () => 0);
|
|
1702
|
+
const scan = vi.fn(async () => 0);
|
|
1703
|
+
const tokenIo = makeIo();
|
|
1704
|
+
await expect(runKtxCli([
|
|
1705
|
+
'connection',
|
|
1706
|
+
'add',
|
|
1707
|
+
'notion',
|
|
1708
|
+
'notion-main',
|
|
1709
|
+
'--token-env',
|
|
1710
|
+
'NOTION_TOKEN',
|
|
1711
|
+
'--token-file',
|
|
1712
|
+
'/tmp/notion-token',
|
|
1713
|
+
'--root-page-id',
|
|
1714
|
+
'11111111111111111111111111111111',
|
|
1715
|
+
], tokenIo.io, { connection })).resolves.toBe(1);
|
|
1716
|
+
expect(tokenIo.stderr()).toMatch(/conflict|cannot be used/i);
|
|
1717
|
+
expect(connection).not.toHaveBeenCalled();
|
|
1718
|
+
expect(scan).not.toHaveBeenCalled();
|
|
1719
|
+
});
|
|
1720
|
+
it('validates connection mapping set syntax before runner domain validation', async () => {
|
|
1721
|
+
const badFieldIo = makeIo();
|
|
1722
|
+
await expect(runKtxCli(['connection', 'mapping', 'set', 'prod-metabase', 'invalidMappings', '1=warehouse'], badFieldIo.io)).resolves.toBe(1);
|
|
1723
|
+
expect(badFieldIo.stderr()).toContain('databaseMappings or connectionMappings');
|
|
1724
|
+
for (const assignment of ['missing-equals', '=warehouse', '1=']) {
|
|
1725
|
+
const testIo = makeIo();
|
|
1726
|
+
await expect(runKtxCli(['connection', 'mapping', 'set', 'prod-metabase', 'databaseMappings', assignment], testIo.io)).resolves.toBe(1);
|
|
1727
|
+
expect(testIo.stderr()).toContain('non-empty <key>=<value>');
|
|
1728
|
+
}
|
|
1729
|
+
});
|
|
1730
|
+
it('does not expose root init after setup owns project creation', async () => {
|
|
1731
|
+
const testIo = makeIo();
|
|
1732
|
+
await expect(runKtxCli(['init'], testIo.io)).resolves.toBe(1);
|
|
1733
|
+
expect(testIo.stderr()).toContain("error: unknown command 'init'");
|
|
1734
|
+
});
|
|
1735
|
+
it('returns an error code for unknown commands', async () => {
|
|
1736
|
+
const testIo = makeIo();
|
|
1737
|
+
await expect(runKtxCli(['unknown'], testIo.io)).resolves.toBe(1);
|
|
1738
|
+
expect(testIo.stderr()).toContain("error: unknown command 'unknown'");
|
|
1739
|
+
});
|
|
1740
|
+
});
|