@kaelio/ktx 0.5.0 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/python/{kaelio_ktx-0.5.0-py3-none-any.whl → kaelio_ktx-0.7.0-py3-none-any.whl} +0 -0
- package/assets/python/manifest.json +4 -4
- package/dist/.tsbuildinfo +1 -1
- package/dist/clack.d.ts +8 -0
- package/dist/clack.js +14 -0
- package/dist/connection.js +2 -9
- package/dist/connectors/bigquery/connector.d.ts +6 -1
- package/dist/connectors/bigquery/connector.js +38 -9
- package/dist/connectors/bigquery/dialect.d.ts +11 -9
- package/dist/connectors/bigquery/dialect.js +25 -45
- package/dist/connectors/clickhouse/connector.d.ts +5 -0
- package/dist/connectors/clickhouse/connector.js +36 -3
- package/dist/connectors/clickhouse/dialect.d.ts +11 -12
- package/dist/connectors/clickhouse/dialect.js +25 -100
- package/dist/connectors/mysql/connector.d.ts +7 -1
- package/dist/connectors/mysql/connector.js +67 -9
- package/dist/connectors/mysql/dialect.d.ts +11 -9
- package/dist/connectors/mysql/dialect.js +25 -43
- package/dist/connectors/postgres/connector.d.ts +6 -0
- package/dist/connectors/postgres/connector.js +67 -12
- package/dist/connectors/postgres/dialect.d.ts +11 -9
- package/dist/connectors/postgres/dialect.js +26 -35
- package/dist/connectors/snowflake/connector.d.ts +8 -3
- package/dist/connectors/snowflake/connector.js +39 -20
- package/dist/connectors/snowflake/dialect.d.ts +11 -9
- package/dist/connectors/snowflake/dialect.js +25 -24
- package/dist/connectors/sqlite/connector.d.ts +3 -1
- package/dist/connectors/sqlite/connector.js +23 -3
- package/dist/connectors/sqlite/dialect.d.ts +11 -9
- package/dist/connectors/sqlite/dialect.js +25 -29
- package/dist/connectors/sqlserver/connector.d.ts +6 -0
- package/dist/connectors/sqlserver/connector.js +56 -9
- package/dist/connectors/sqlserver/dialect.d.ts +11 -10
- package/dist/connectors/sqlserver/dialect.js +24 -40
- package/dist/context/connections/connection-type.d.ts +1 -1
- package/dist/context/connections/dialect-helpers.d.ts +9 -0
- package/dist/context/connections/dialect-helpers.js +67 -0
- package/dist/context/connections/dialects.d.ts +23 -5
- package/dist/context/connections/dialects.js +18 -56
- package/dist/context/connections/drivers.d.ts +23 -0
- package/dist/context/connections/drivers.js +171 -0
- package/dist/context/connections/local-query-executor.js +25 -7
- package/dist/context/connections/local-warehouse-descriptor.js +0 -2
- package/dist/context/connections/postgres-query-executor.js +1 -1
- package/dist/context/connections/sqlite-query-executor.js +1 -1
- package/dist/context/ingest/adapters/historic-sql/chunk-unified.js +1 -1
- package/dist/context/ingest/adapters/historic-sql/connection-dialect.js +11 -7
- package/dist/context/ingest/adapters/historic-sql/evidence-tool.d.ts +1 -1
- package/dist/context/ingest/adapters/historic-sql/evidence-tool.js +8 -5
- package/dist/context/ingest/adapters/historic-sql/evidence.d.ts +4 -4
- package/dist/context/ingest/adapters/historic-sql/evidence.js +2 -2
- package/dist/context/ingest/adapters/historic-sql/projection.js +5 -2
- package/dist/context/ingest/adapters/live-database/daemon-introspection.js +1 -1
- package/dist/context/ingest/adapters/live-database/stage.d.ts +2 -0
- package/dist/context/ingest/adapters/live-database/stage.js +9 -0
- package/dist/context/ingest/adapters/looker/mapping.d.ts +0 -3
- package/dist/context/ingest/adapters/looker/mapping.js +0 -3
- package/dist/context/ingest/adapters/looker/types.d.ts +1 -1
- package/dist/context/ingest/historic-sql-probes/bigquery-runner.d.ts +34 -0
- package/dist/context/ingest/historic-sql-probes/bigquery-runner.js +99 -0
- package/dist/context/ingest/historic-sql-probes/postgres-runner.d.ts +26 -0
- package/dist/context/ingest/historic-sql-probes/postgres-runner.js +76 -0
- package/dist/context/ingest/historic-sql-probes/snowflake-runner.d.ts +29 -0
- package/dist/context/ingest/historic-sql-probes/snowflake-runner.js +62 -0
- package/dist/context/ingest/historic-sql-probes.d.ts +46 -0
- package/dist/context/ingest/historic-sql-probes.js +62 -0
- package/dist/context/ingest/local-adapters.js +0 -1
- package/dist/context/ingest/local-ingest.js +1 -1
- package/dist/context/llm/claude-code-runtime.js +16 -1
- package/dist/context/mcp/context-tools.js +11 -48
- package/dist/context/mcp/local-project-ports.js +0 -3
- package/dist/context/project/config.d.ts +0 -8
- package/dist/context/project/driver-schemas.d.ts +0 -4
- package/dist/context/project/driver-schemas.js +0 -2
- package/dist/context/scan/constraint-discovery.d.ts +19 -0
- package/dist/context/scan/constraint-discovery.js +23 -0
- package/dist/context/scan/enabled-tables.d.ts +4 -5
- package/dist/context/scan/enabled-tables.js +4 -18
- package/dist/context/scan/entity-details.js +14 -44
- package/dist/context/scan/local-enrichment.js +13 -1
- package/dist/context/scan/local-scan.js +5 -4
- package/dist/context/scan/local-structural-artifacts.js +51 -0
- package/dist/context/scan/relationship-benchmarks.js +9 -6
- package/dist/context/scan/relationship-composite-candidates.d.ts +3 -2
- package/dist/context/scan/relationship-composite-candidates.js +21 -33
- package/dist/context/scan/relationship-discovery.d.ts +3 -2
- package/dist/context/scan/relationship-discovery.js +4 -4
- package/dist/context/scan/relationship-profiling.d.ts +2 -3
- package/dist/context/scan/relationship-profiling.js +25 -94
- package/dist/context/scan/relationship-validation.d.ts +3 -2
- package/dist/context/scan/relationship-validation.js +12 -22
- package/dist/context/scan/table-ref.d.ts +1 -2
- package/dist/context/scan/table-ref.js +3 -4
- package/dist/context/scan/types.d.ts +6 -2
- package/dist/context/scan/warehouse-catalog.js +31 -48
- package/dist/context/sl/local-query.js +0 -3
- package/dist/context/sl/local-sl.js +0 -13
- package/dist/context/sl/semantic-layer.service.js +1 -4
- package/dist/context/tools/context-candidate-write.tool.d.ts +2 -2
- package/dist/context-build-view.js +1 -1
- package/dist/database-tree-picker.js +14 -7
- package/dist/error-message.d.ts +1 -0
- package/dist/error-message.js +29 -0
- package/dist/ingest-depth.js +0 -1
- package/dist/ingest.js +2 -2
- package/dist/llm/embedding-health.js +2 -2
- package/dist/local-scan-connectors.js +13 -56
- package/dist/managed-local-embeddings.js +2 -1
- package/dist/managed-python-daemon.d.ts +5 -0
- package/dist/managed-python-daemon.js +29 -9
- package/dist/managed-python-http.js +2 -1
- package/dist/public-ingest.js +1 -6
- package/dist/runtime-requirements.js +2 -2
- package/dist/setup-agents.d.ts +1 -1
- package/dist/setup-agents.js +16 -74
- package/dist/setup-context.js +2 -1
- package/dist/setup-databases.d.ts +3 -13
- package/dist/setup-databases.js +141 -313
- package/dist/setup-embeddings.js +10 -2
- package/dist/setup-project.d.ts +0 -8
- package/dist/setup-project.js +3 -27
- package/dist/setup-runtime.js +2 -1
- package/dist/setup-sources.js +2 -1
- package/dist/setup.js +11 -18
- package/dist/skills/historic_sql_patterns/SKILL.md +1 -3
- package/dist/skills/historic_sql_table_digest/SKILL.md +0 -1
- package/dist/skills/sl/SKILL.md +2 -2
- package/dist/sql.js +0 -4
- package/dist/status-project.d.ts +3 -18
- package/dist/status-project.js +42 -216
- package/dist/telemetry/events.d.ts +1 -1
- package/dist/telemetry/index.js +8 -3
- package/dist/tree-picker-state.d.ts +2 -2
- package/dist/tree-picker-state.js +29 -13
- package/dist/tree-picker-tui.d.ts +3 -1
- package/dist/tree-picker-tui.js +20 -32
- package/package.json +6 -6
- package/dist/admin-reindex.test.d.ts +0 -1
- package/dist/admin-reindex.test.js +0 -119
- package/dist/admin.test.d.ts +0 -1
- package/dist/admin.test.js +0 -201
- package/dist/cli-program-telemetry.test.d.ts +0 -1
- package/dist/cli-program-telemetry.test.js +0 -89
- package/dist/cli-program.test.d.ts +0 -1
- package/dist/cli-program.test.js +0 -71
- package/dist/command-tree.test.d.ts +0 -1
- package/dist/command-tree.test.js +0 -126
- package/dist/commands/mcp-commands.test.d.ts +0 -1
- package/dist/commands/mcp-commands.test.js +0 -111
- package/dist/commands/sql-commands.test.d.ts +0 -1
- package/dist/commands/sql-commands.test.js +0 -68
- package/dist/connection.test.d.ts +0 -1
- package/dist/connection.test.js +0 -426
- package/dist/connectors/bigquery/connector.test.d.ts +0 -1
- package/dist/connectors/bigquery/connector.test.js +0 -363
- package/dist/connectors/bigquery/dialect.test.d.ts +0 -1
- package/dist/connectors/bigquery/dialect.test.js +0 -36
- package/dist/connectors/clickhouse/connector.test.d.ts +0 -1
- package/dist/connectors/clickhouse/connector.test.js +0 -342
- package/dist/connectors/clickhouse/dialect.test.d.ts +0 -1
- package/dist/connectors/clickhouse/dialect.test.js +0 -36
- package/dist/connectors/mysql/connector.test.d.ts +0 -1
- package/dist/connectors/mysql/connector.test.js +0 -365
- package/dist/connectors/mysql/dialect.test.d.ts +0 -1
- package/dist/connectors/mysql/dialect.test.js +0 -36
- package/dist/connectors/postgres/connector.test.d.ts +0 -1
- package/dist/connectors/postgres/connector.test.js +0 -391
- package/dist/connectors/postgres/dialect.test.d.ts +0 -1
- package/dist/connectors/postgres/dialect.test.js +0 -37
- package/dist/connectors/postgres/historic-sql-query-client.test.d.ts +0 -1
- package/dist/connectors/postgres/historic-sql-query-client.test.js +0 -45
- package/dist/connectors/snowflake/connector.test.d.ts +0 -1
- package/dist/connectors/snowflake/connector.test.js +0 -462
- package/dist/connectors/snowflake/dialect.test.d.ts +0 -1
- package/dist/connectors/snowflake/dialect.test.js +0 -34
- package/dist/connectors/snowflake/identifiers.test.d.ts +0 -1
- package/dist/connectors/snowflake/identifiers.test.js +0 -12
- package/dist/connectors/snowflake/sdk-logger.test.d.ts +0 -1
- package/dist/connectors/snowflake/sdk-logger.test.js +0 -47
- package/dist/connectors/sqlite/connector.test.d.ts +0 -1
- package/dist/connectors/sqlite/connector.test.js +0 -207
- package/dist/connectors/sqlite/dialect.test.d.ts +0 -1
- package/dist/connectors/sqlite/dialect.test.js +0 -23
- package/dist/connectors/sqlserver/connector.test.d.ts +0 -1
- package/dist/connectors/sqlserver/connector.test.js +0 -313
- package/dist/connectors/sqlserver/dialect.test.d.ts +0 -1
- package/dist/connectors/sqlserver/dialect.test.js +0 -36
- package/dist/context/connections/bigquery-identifiers.test.d.ts +0 -1
- package/dist/context/connections/bigquery-identifiers.test.js +0 -13
- package/dist/context/connections/dialects.test.d.ts +0 -1
- package/dist/context/connections/dialects.test.js +0 -24
- package/dist/context/connections/local-query-executor.test.d.ts +0 -1
- package/dist/context/connections/local-query-executor.test.js +0 -48
- package/dist/context/connections/local-warehouse-descriptor.test.d.ts +0 -1
- package/dist/context/connections/local-warehouse-descriptor.test.js +0 -53
- package/dist/context/connections/notion-config.test.d.ts +0 -1
- package/dist/context/connections/notion-config.test.js +0 -121
- package/dist/context/connections/postgres-query-executor.test.d.ts +0 -1
- package/dist/context/connections/postgres-query-executor.test.js +0 -91
- package/dist/context/connections/read-only-sql.test.d.ts +0 -1
- package/dist/context/connections/read-only-sql.test.js +0 -20
- package/dist/context/connections/sqlite-query-executor.test.d.ts +0 -1
- package/dist/context/connections/sqlite-query-executor.test.js +0 -113
- package/dist/context/core/config-reference.test.d.ts +0 -1
- package/dist/context/core/config-reference.test.js +0 -27
- package/dist/context/core/git.service.assert-worktree-clean.test.d.ts +0 -1
- package/dist/context/core/git.service.assert-worktree-clean.test.js +0 -62
- package/dist/context/core/git.service.delete-directories.test.d.ts +0 -1
- package/dist/context/core/git.service.delete-directories.test.js +0 -61
- package/dist/context/core/git.service.patch.test.d.ts +0 -1
- package/dist/context/core/git.service.patch.test.js +0 -40
- package/dist/context/core/git.service.reset-hard.test.d.ts +0 -1
- package/dist/context/core/git.service.reset-hard.test.js +0 -47
- package/dist/context/core/git.service.test.d.ts +0 -1
- package/dist/context/core/git.service.test.js +0 -357
- package/dist/context/core/session-worktree.service.test.d.ts +0 -1
- package/dist/context/core/session-worktree.service.test.js +0 -97
- package/dist/context/daemon/semantic-layer-compute.test.d.ts +0 -1
- package/dist/context/daemon/semantic-layer-compute.test.js +0 -305
- package/dist/context/index-sync/reindex.test.d.ts +0 -1
- package/dist/context/index-sync/reindex.test.js +0 -139
- package/dist/context/ingest/action-identity.test.d.ts +0 -1
- package/dist/context/ingest/action-identity.test.js +0 -19
- package/dist/context/ingest/adapters/dbt/chunk.test.d.ts +0 -1
- package/dist/context/ingest/adapters/dbt/chunk.test.js +0 -30
- package/dist/context/ingest/adapters/dbt/dbt.adapter.test.d.ts +0 -1
- package/dist/context/ingest/adapters/dbt/dbt.adapter.test.js +0 -43
- package/dist/context/ingest/adapters/dbt/fetch.test.d.ts +0 -1
- package/dist/context/ingest/adapters/dbt/fetch.test.js +0 -30
- package/dist/context/ingest/adapters/dbt/parse.test.d.ts +0 -1
- package/dist/context/ingest/adapters/dbt/parse.test.js +0 -7
- package/dist/context/ingest/adapters/dbt-descriptions/parse-schema.test.d.ts +0 -1
- package/dist/context/ingest/adapters/dbt-descriptions/parse-schema.test.js +0 -195
- package/dist/context/ingest/adapters/historic-sql/bigquery-query-history-reader.test.d.ts +0 -1
- package/dist/context/ingest/adapters/historic-sql/bigquery-query-history-reader.test.js +0 -121
- package/dist/context/ingest/adapters/historic-sql/buckets.test.d.ts +0 -1
- package/dist/context/ingest/adapters/historic-sql/buckets.test.js +0 -49
- package/dist/context/ingest/adapters/historic-sql/chunk-unified.test.d.ts +0 -1
- package/dist/context/ingest/adapters/historic-sql/chunk-unified.test.js +0 -160
- package/dist/context/ingest/adapters/historic-sql/detect.test.d.ts +0 -1
- package/dist/context/ingest/adapters/historic-sql/detect.test.js +0 -48
- package/dist/context/ingest/adapters/historic-sql/evidence-tool.test.d.ts +0 -1
- package/dist/context/ingest/adapters/historic-sql/evidence-tool.test.js +0 -67
- package/dist/context/ingest/adapters/historic-sql/evidence.test.d.ts +0 -1
- package/dist/context/ingest/adapters/historic-sql/evidence.test.js +0 -43
- package/dist/context/ingest/adapters/historic-sql/historic-sql.adapter.test.d.ts +0 -1
- package/dist/context/ingest/adapters/historic-sql/historic-sql.adapter.test.js +0 -98
- package/dist/context/ingest/adapters/historic-sql/local-ingest-acceptance.test.d.ts +0 -1
- package/dist/context/ingest/adapters/historic-sql/local-ingest-acceptance.test.js +0 -235
- package/dist/context/ingest/adapters/historic-sql/pattern-inputs.test.d.ts +0 -1
- package/dist/context/ingest/adapters/historic-sql/pattern-inputs.test.js +0 -68
- package/dist/context/ingest/adapters/historic-sql/postgres-pgss-reader.test.d.ts +0 -1
- package/dist/context/ingest/adapters/historic-sql/postgres-pgss-reader.test.js +0 -205
- package/dist/context/ingest/adapters/historic-sql/projection.test.d.ts +0 -1
- package/dist/context/ingest/adapters/historic-sql/projection.test.js +0 -392
- package/dist/context/ingest/adapters/historic-sql/redaction.test.d.ts +0 -1
- package/dist/context/ingest/adapters/historic-sql/redaction.test.js +0 -22
- package/dist/context/ingest/adapters/historic-sql/skill-schemas.test.d.ts +0 -1
- package/dist/context/ingest/adapters/historic-sql/skill-schemas.test.js +0 -62
- package/dist/context/ingest/adapters/historic-sql/snowflake-query-history-reader.test.d.ts +0 -1
- package/dist/context/ingest/adapters/historic-sql/snowflake-query-history-reader.test.js +0 -117
- package/dist/context/ingest/adapters/historic-sql/stage-unified.test.d.ts +0 -1
- package/dist/context/ingest/adapters/historic-sql/stage-unified.test.js +0 -405
- package/dist/context/ingest/adapters/historic-sql/types.test.d.ts +0 -1
- package/dist/context/ingest/adapters/historic-sql/types.test.js +0 -87
- package/dist/context/ingest/adapters/live-database/chunk.test.d.ts +0 -1
- package/dist/context/ingest/adapters/live-database/chunk.test.js +0 -95
- package/dist/context/ingest/adapters/live-database/daemon-introspection.test.d.ts +0 -1
- package/dist/context/ingest/adapters/live-database/daemon-introspection.test.js +0 -241
- package/dist/context/ingest/adapters/live-database/live-database.adapter.test.d.ts +0 -1
- package/dist/context/ingest/adapters/live-database/live-database.adapter.test.js +0 -105
- package/dist/context/ingest/adapters/live-database/manifest.test.d.ts +0 -1
- package/dist/context/ingest/adapters/live-database/manifest.test.js +0 -291
- package/dist/context/ingest/adapters/live-database/stage.test.d.ts +0 -1
- package/dist/context/ingest/adapters/live-database/stage.test.js +0 -133
- package/dist/context/ingest/adapters/looker/chunk.test.d.ts +0 -1
- package/dist/context/ingest/adapters/looker/chunk.test.js +0 -142
- package/dist/context/ingest/adapters/looker/client-boundary.test.d.ts +0 -1
- package/dist/context/ingest/adapters/looker/client-boundary.test.js +0 -12
- package/dist/context/ingest/adapters/looker/client.test.d.ts +0 -1
- package/dist/context/ingest/adapters/looker/client.test.js +0 -407
- package/dist/context/ingest/adapters/looker/daemon-table-identifier-parser.test.d.ts +0 -1
- package/dist/context/ingest/adapters/looker/daemon-table-identifier-parser.test.js +0 -40
- package/dist/context/ingest/adapters/looker/detect.test.d.ts +0 -1
- package/dist/context/ingest/adapters/looker/detect.test.js +0 -39
- package/dist/context/ingest/adapters/looker/evidence-documents.test.d.ts +0 -1
- package/dist/context/ingest/adapters/looker/evidence-documents.test.js +0 -178
- package/dist/context/ingest/adapters/looker/factory.test.d.ts +0 -1
- package/dist/context/ingest/adapters/looker/factory.test.js +0 -55
- package/dist/context/ingest/adapters/looker/fetch-report.test.d.ts +0 -1
- package/dist/context/ingest/adapters/looker/fetch-report.test.js +0 -71
- package/dist/context/ingest/adapters/looker/fetch.test.d.ts +0 -1
- package/dist/context/ingest/adapters/looker/fetch.test.js +0 -592
- package/dist/context/ingest/adapters/looker/local-runtime-store.test.d.ts +0 -1
- package/dist/context/ingest/adapters/looker/local-runtime-store.test.js +0 -106
- package/dist/context/ingest/adapters/looker/looker.adapter.test.d.ts +0 -1
- package/dist/context/ingest/adapters/looker/looker.adapter.test.js +0 -99
- package/dist/context/ingest/adapters/looker/mapping.test.d.ts +0 -1
- package/dist/context/ingest/adapters/looker/mapping.test.js +0 -334
- package/dist/context/ingest/adapters/looker/reconcile.test.d.ts +0 -1
- package/dist/context/ingest/adapters/looker/reconcile.test.js +0 -12
- package/dist/context/ingest/adapters/looker/scope.test.d.ts +0 -1
- package/dist/context/ingest/adapters/looker/scope.test.js +0 -84
- package/dist/context/ingest/adapters/looker/target-connections.test.d.ts +0 -1
- package/dist/context/ingest/adapters/looker/target-connections.test.js +0 -71
- package/dist/context/ingest/adapters/looker/tools/looker-query-to-sl.tool.test.d.ts +0 -1
- package/dist/context/ingest/adapters/looker/tools/looker-query-to-sl.tool.test.js +0 -211
- package/dist/context/ingest/adapters/looker/types.test.d.ts +0 -1
- package/dist/context/ingest/adapters/looker/types.test.js +0 -261
- package/dist/context/ingest/adapters/lookml/chunk.test.d.ts +0 -1
- package/dist/context/ingest/adapters/lookml/chunk.test.js +0 -213
- package/dist/context/ingest/adapters/lookml/detect.test.d.ts +0 -1
- package/dist/context/ingest/adapters/lookml/detect.test.js +0 -37
- package/dist/context/ingest/adapters/lookml/fetch-report.test.d.ts +0 -1
- package/dist/context/ingest/adapters/lookml/fetch-report.test.js +0 -82
- package/dist/context/ingest/adapters/lookml/fetch.test.d.ts +0 -1
- package/dist/context/ingest/adapters/lookml/fetch.test.js +0 -121
- package/dist/context/ingest/adapters/lookml/graph.test.d.ts +0 -1
- package/dist/context/ingest/adapters/lookml/graph.test.js +0 -105
- package/dist/context/ingest/adapters/lookml/lookml.adapter.test.d.ts +0 -1
- package/dist/context/ingest/adapters/lookml/lookml.adapter.test.js +0 -49
- package/dist/context/ingest/adapters/lookml/parse.test.d.ts +0 -1
- package/dist/context/ingest/adapters/lookml/parse.test.js +0 -118
- package/dist/context/ingest/adapters/lookml/pull-config.test.d.ts +0 -1
- package/dist/context/ingest/adapters/lookml/pull-config.test.js +0 -128
- package/dist/context/ingest/adapters/metabase/card-references.test.d.ts +0 -1
- package/dist/context/ingest/adapters/metabase/card-references.test.js +0 -36
- package/dist/context/ingest/adapters/metabase/chunk.test.d.ts +0 -1
- package/dist/context/ingest/adapters/metabase/chunk.test.js +0 -299
- package/dist/context/ingest/adapters/metabase/client-boundary.test.d.ts +0 -1
- package/dist/context/ingest/adapters/metabase/client-boundary.test.js +0 -38
- package/dist/context/ingest/adapters/metabase/client-port.test.d.ts +0 -1
- package/dist/context/ingest/adapters/metabase/client-port.test.js +0 -86
- package/dist/context/ingest/adapters/metabase/client.test.d.ts +0 -1
- package/dist/context/ingest/adapters/metabase/client.test.js +0 -377
- package/dist/context/ingest/adapters/metabase/detect.test.d.ts +0 -1
- package/dist/context/ingest/adapters/metabase/detect.test.js +0 -42
- package/dist/context/ingest/adapters/metabase/fanout-planner.test.d.ts +0 -1
- package/dist/context/ingest/adapters/metabase/fanout-planner.test.js +0 -44
- package/dist/context/ingest/adapters/metabase/fetch-scope.test.d.ts +0 -1
- package/dist/context/ingest/adapters/metabase/fetch-scope.test.js +0 -124
- package/dist/context/ingest/adapters/metabase/fetch.test.d.ts +0 -1
- package/dist/context/ingest/adapters/metabase/fetch.test.js +0 -557
- package/dist/context/ingest/adapters/metabase/local-metabase.adapter.test.d.ts +0 -1
- package/dist/context/ingest/adapters/metabase/local-metabase.adapter.test.js +0 -56
- package/dist/context/ingest/adapters/metabase/local-source-state-store.test.d.ts +0 -1
- package/dist/context/ingest/adapters/metabase/local-source-state-store.test.js +0 -99
- package/dist/context/ingest/adapters/metabase/mapping.test.d.ts +0 -1
- package/dist/context/ingest/adapters/metabase/mapping.test.js +0 -215
- package/dist/context/ingest/adapters/metabase/metabase.adapter.test.d.ts +0 -1
- package/dist/context/ingest/adapters/metabase/metabase.adapter.test.js +0 -129
- package/dist/context/ingest/adapters/metabase/serialize-card.test.d.ts +0 -1
- package/dist/context/ingest/adapters/metabase/serialize-card.test.js +0 -205
- package/dist/context/ingest/adapters/metabase/types.test.d.ts +0 -1
- package/dist/context/ingest/adapters/metabase/types.test.js +0 -75
- package/dist/context/ingest/adapters/metricflow/chunk.test.d.ts +0 -1
- package/dist/context/ingest/adapters/metricflow/chunk.test.js +0 -114
- package/dist/context/ingest/adapters/metricflow/deep-parse.test.d.ts +0 -1
- package/dist/context/ingest/adapters/metricflow/deep-parse.test.js +0 -1139
- package/dist/context/ingest/adapters/metricflow/detect.test.d.ts +0 -1
- package/dist/context/ingest/adapters/metricflow/detect.test.js +0 -43
- package/dist/context/ingest/adapters/metricflow/fetch.test.d.ts +0 -1
- package/dist/context/ingest/adapters/metricflow/fetch.test.js +0 -97
- package/dist/context/ingest/adapters/metricflow/graph.test.d.ts +0 -1
- package/dist/context/ingest/adapters/metricflow/graph.test.js +0 -245
- package/dist/context/ingest/adapters/metricflow/import-semantic-models.test.d.ts +0 -1
- package/dist/context/ingest/adapters/metricflow/import-semantic-models.test.js +0 -318
- package/dist/context/ingest/adapters/metricflow/metricflow.adapter.test.d.ts +0 -1
- package/dist/context/ingest/adapters/metricflow/metricflow.adapter.test.js +0 -212
- package/dist/context/ingest/adapters/metricflow/parse.test.d.ts +0 -1
- package/dist/context/ingest/adapters/metricflow/parse.test.js +0 -171
- package/dist/context/ingest/adapters/metricflow/pull-config.test.d.ts +0 -1
- package/dist/context/ingest/adapters/metricflow/pull-config.test.js +0 -57
- package/dist/context/ingest/adapters/metricflow/semantic-models.test.d.ts +0 -1
- package/dist/context/ingest/adapters/metricflow/semantic-models.test.js +0 -204
- package/dist/context/ingest/adapters/notion/cluster.test.d.ts +0 -1
- package/dist/context/ingest/adapters/notion/cluster.test.js +0 -123
- package/dist/context/ingest/adapters/notion/fetch.test.d.ts +0 -1
- package/dist/context/ingest/adapters/notion/fetch.test.js +0 -358
- package/dist/context/ingest/adapters/notion/local-state-store.test.d.ts +0 -1
- package/dist/context/ingest/adapters/notion/local-state-store.test.js +0 -29
- package/dist/context/ingest/adapters/notion/normalize.test.d.ts +0 -1
- package/dist/context/ingest/adapters/notion/normalize.test.js +0 -64
- package/dist/context/ingest/adapters/notion/notion-client.test.d.ts +0 -1
- package/dist/context/ingest/adapters/notion/notion-client.test.js +0 -49
- package/dist/context/ingest/adapters/notion/notion.adapter.test.d.ts +0 -1
- package/dist/context/ingest/adapters/notion/notion.adapter.test.js +0 -315
- package/dist/context/ingest/artifact-gates.test.d.ts +0 -1
- package/dist/context/ingest/artifact-gates.test.js +0 -167
- package/dist/context/ingest/canonical-pins.test.d.ts +0 -1
- package/dist/context/ingest/canonical-pins.test.js +0 -66
- package/dist/context/ingest/clustering/kmeans.test.d.ts +0 -1
- package/dist/context/ingest/clustering/kmeans.test.js +0 -61
- package/dist/context/ingest/context-candidates/candidate-dedup.service.test.d.ts +0 -1
- package/dist/context/ingest/context-candidates/candidate-dedup.service.test.js +0 -216
- package/dist/context/ingest/context-candidates/context-candidate-carryforward.service.test.d.ts +0 -1
- package/dist/context/ingest/context-candidates/context-candidate-carryforward.service.test.js +0 -161
- package/dist/context/ingest/context-candidates/curator-pagination.service.test.d.ts +0 -1
- package/dist/context/ingest/context-candidates/curator-pagination.service.test.js +0 -168
- package/dist/context/ingest/context-candidates/embedding-text.test.d.ts +0 -1
- package/dist/context/ingest/context-candidates/embedding-text.test.js +0 -10
- package/dist/context/ingest/context-candidates/store.test.d.ts +0 -1
- package/dist/context/ingest/context-candidates/store.test.js +0 -67
- package/dist/context/ingest/context-evidence/context-evidence-index.service.test.d.ts +0 -1
- package/dist/context/ingest/context-evidence/context-evidence-index.service.test.js +0 -374
- package/dist/context/ingest/context-evidence/sqlite-context-evidence-store.test.d.ts +0 -1
- package/dist/context/ingest/context-evidence/sqlite-context-evidence-store.test.js +0 -416
- package/dist/context/ingest/context-evidence/store.test.d.ts +0 -1
- package/dist/context/ingest/context-evidence/store.test.js +0 -55
- package/dist/context/ingest/dbt-shared/project-vars.test.d.ts +0 -1
- package/dist/context/ingest/dbt-shared/project-vars.test.js +0 -90
- package/dist/context/ingest/dbt-shared/schema-files.test.d.ts +0 -1
- package/dist/context/ingest/dbt-shared/schema-files.test.js +0 -35
- package/dist/context/ingest/diff-set.service.test.d.ts +0 -1
- package/dist/context/ingest/diff-set.service.test.js +0 -132
- package/dist/context/ingest/final-gate-repair.test.d.ts +0 -1
- package/dist/context/ingest/final-gate-repair.test.js +0 -109
- package/dist/context/ingest/finalization-scope.test.d.ts +0 -1
- package/dist/context/ingest/finalization-scope.test.js +0 -114
- package/dist/context/ingest/ingest-bundle.runner.isolated-diff.test.d.ts +0 -1
- package/dist/context/ingest/ingest-bundle.runner.isolated-diff.test.js +0 -1928
- package/dist/context/ingest/ingest-bundle.runner.test.d.ts +0 -1
- package/dist/context/ingest/ingest-bundle.runner.test.js +0 -1899
- package/dist/context/ingest/ingest-prompts.test.d.ts +0 -1
- package/dist/context/ingest/ingest-prompts.test.js +0 -32
- package/dist/context/ingest/ingest-runtime-assets.test.d.ts +0 -1
- package/dist/context/ingest/ingest-runtime-assets.test.js +0 -89
- package/dist/context/ingest/ingest-trace.test.d.ts +0 -1
- package/dist/context/ingest/ingest-trace.test.js +0 -76
- package/dist/context/ingest/isolated-diff/git-patch.test.d.ts +0 -1
- package/dist/context/ingest/isolated-diff/git-patch.test.js +0 -76
- package/dist/context/ingest/isolated-diff/patch-integrator.test.d.ts +0 -1
- package/dist/context/ingest/isolated-diff/patch-integrator.test.js +0 -369
- package/dist/context/ingest/isolated-diff/textual-conflict-resolver.test.d.ts +0 -1
- package/dist/context/ingest/isolated-diff/textual-conflict-resolver.test.js +0 -101
- package/dist/context/ingest/isolated-diff/work-unit-executor.test.d.ts +0 -1
- package/dist/context/ingest/isolated-diff/work-unit-executor.test.js +0 -137
- package/dist/context/ingest/local-adapters.test.d.ts +0 -1
- package/dist/context/ingest/local-adapters.test.js +0 -612
- package/dist/context/ingest/local-bundle-ingest.test.d.ts +0 -1
- package/dist/context/ingest/local-bundle-ingest.test.js +0 -794
- package/dist/context/ingest/local-bundle-runtime.test.d.ts +0 -1
- package/dist/context/ingest/local-bundle-runtime.test.js +0 -240
- package/dist/context/ingest/local-embedding-provider.integration.test.d.ts +0 -1
- package/dist/context/ingest/local-embedding-provider.integration.test.js +0 -139
- package/dist/context/ingest/local-mapping-reconcile.test.d.ts +0 -1
- package/dist/context/ingest/local-mapping-reconcile.test.js +0 -61
- package/dist/context/ingest/local-metabase-ingest.test.d.ts +0 -1
- package/dist/context/ingest/local-metabase-ingest.test.js +0 -227
- package/dist/context/ingest/local-stage-ingest.test.d.ts +0 -1
- package/dist/context/ingest/local-stage-ingest.test.js +0 -581
- package/dist/context/ingest/memory-flow/acceptance-fixtures.d.ts +0 -6
- package/dist/context/ingest/memory-flow/acceptance-fixtures.js +0 -155
- package/dist/context/ingest/memory-flow/acceptance.test.d.ts +0 -1
- package/dist/context/ingest/memory-flow/acceptance.test.js +0 -43
- package/dist/context/ingest/memory-flow/events.test.d.ts +0 -1
- package/dist/context/ingest/memory-flow/events.test.js +0 -319
- package/dist/context/ingest/memory-flow/interaction.test.d.ts +0 -1
- package/dist/context/ingest/memory-flow/interaction.test.js +0 -264
- package/dist/context/ingest/memory-flow/interactive-render.test.d.ts +0 -1
- package/dist/context/ingest/memory-flow/interactive-render.test.js +0 -160
- package/dist/context/ingest/memory-flow/live-buffer.test.d.ts +0 -1
- package/dist/context/ingest/memory-flow/live-buffer.test.js +0 -77
- package/dist/context/ingest/memory-flow/render.test.d.ts +0 -1
- package/dist/context/ingest/memory-flow/render.test.js +0 -105
- package/dist/context/ingest/memory-flow/schema.test.d.ts +0 -1
- package/dist/context/ingest/memory-flow/schema.test.js +0 -147
- package/dist/context/ingest/memory-flow/summary.test.d.ts +0 -1
- package/dist/context/ingest/memory-flow/summary.test.js +0 -130
- package/dist/context/ingest/memory-flow/view-model.test.d.ts +0 -1
- package/dist/context/ingest/memory-flow/view-model.test.js +0 -397
- package/dist/context/ingest/memory-flow/visuals.test.d.ts +0 -1
- package/dist/context/ingest/memory-flow/visuals.test.js +0 -49
- package/dist/context/ingest/page-triage/page-triage.service.test.d.ts +0 -1
- package/dist/context/ingest/page-triage/page-triage.service.test.js +0 -311
- package/dist/context/ingest/raw-sources-paths.test.d.ts +0 -1
- package/dist/context/ingest/raw-sources-paths.test.js +0 -18
- package/dist/context/ingest/repo-fetch.test.d.ts +0 -1
- package/dist/context/ingest/repo-fetch.test.js +0 -168
- package/dist/context/ingest/report-snapshot.test.d.ts +0 -1
- package/dist/context/ingest/report-snapshot.test.js +0 -329
- package/dist/context/ingest/semantic-layer-target-policy.test.d.ts +0 -1
- package/dist/context/ingest/semantic-layer-target-policy.test.js +0 -25
- package/dist/context/ingest/source-adapter-registry.test.d.ts +0 -1
- package/dist/context/ingest/source-adapter-registry.test.js +0 -35
- package/dist/context/ingest/sqlite-bundle-ingest-store.test.d.ts +0 -1
- package/dist/context/ingest/sqlite-bundle-ingest-store.test.js +0 -517
- package/dist/context/ingest/sqlite-local-ingest-store.test.d.ts +0 -1
- package/dist/context/ingest/sqlite-local-ingest-store.test.js +0 -143
- package/dist/context/ingest/stages/build-reconcile-context.context-candidates.test.d.ts +0 -1
- package/dist/context/ingest/stages/build-reconcile-context.context-candidates.test.js +0 -102
- package/dist/context/ingest/stages/build-reconcile-context.test.d.ts +0 -1
- package/dist/context/ingest/stages/build-reconcile-context.test.js +0 -141
- package/dist/context/ingest/stages/build-wu-context.test.d.ts +0 -1
- package/dist/context/ingest/stages/build-wu-context.test.js +0 -196
- package/dist/context/ingest/stages/stage-1-stage-raw-files.test.d.ts +0 -1
- package/dist/context/ingest/stages/stage-1-stage-raw-files.test.js +0 -54
- package/dist/context/ingest/stages/stage-3-work-units.test.d.ts +0 -1
- package/dist/context/ingest/stages/stage-3-work-units.test.js +0 -175
- package/dist/context/ingest/stages/stage-4-reconciliation.test.d.ts +0 -1
- package/dist/context/ingest/stages/stage-4-reconciliation.test.js +0 -144
- package/dist/context/ingest/stages/validate-wu-sources.test.d.ts +0 -1
- package/dist/context/ingest/stages/validate-wu-sources.test.js +0 -27
- package/dist/context/ingest/tools/emit-reconciliation-records.tool.test.d.ts +0 -1
- package/dist/context/ingest/tools/emit-reconciliation-records.tool.test.js +0 -237
- package/dist/context/ingest/tools/eviction-list.tool.test.d.ts +0 -1
- package/dist/context/ingest/tools/eviction-list.tool.test.js +0 -44
- package/dist/context/ingest/tools/read-raw-file.tool.test.d.ts +0 -1
- package/dist/context/ingest/tools/read-raw-file.tool.test.js +0 -45
- package/dist/context/ingest/tools/read-raw-span.tool.test.d.ts +0 -1
- package/dist/context/ingest/tools/read-raw-span.tool.test.js +0 -34
- package/dist/context/ingest/tools/stage-diff.tool.test.d.ts +0 -1
- package/dist/context/ingest/tools/stage-diff.tool.test.js +0 -112
- package/dist/context/ingest/tools/stage-list.tool.test.d.ts +0 -1
- package/dist/context/ingest/tools/stage-list.tool.test.js +0 -58
- package/dist/context/ingest/tools/tool-transcript-summary.test.d.ts +0 -1
- package/dist/context/ingest/tools/tool-transcript-summary.test.js +0 -141
- package/dist/context/ingest/tools/warehouse-verification/discover-data.tool.test.d.ts +0 -1
- package/dist/context/ingest/tools/warehouse-verification/discover-data.tool.test.js +0 -107
- package/dist/context/ingest/tools/warehouse-verification/entity-details.tool.test.d.ts +0 -1
- package/dist/context/ingest/tools/warehouse-verification/entity-details.tool.test.js +0 -146
- package/dist/context/ingest/tools/warehouse-verification/sql-execution.tool.test.d.ts +0 -1
- package/dist/context/ingest/tools/warehouse-verification/sql-execution.tool.test.js +0 -50
- package/dist/context/ingest/wiki-body-refs.test.d.ts +0 -1
- package/dist/context/ingest/wiki-body-refs.test.js +0 -138
- package/dist/context/ingest/wiki-sl-ref-repair.test.d.ts +0 -1
- package/dist/context/ingest/wiki-sl-ref-repair.test.js +0 -81
- package/dist/context/llm/ai-sdk-runtime.test.d.ts +0 -1
- package/dist/context/llm/ai-sdk-runtime.test.js +0 -308
- package/dist/context/llm/claude-code-env.test.d.ts +0 -1
- package/dist/context/llm/claude-code-env.test.js +0 -17
- package/dist/context/llm/claude-code-models.test.d.ts +0 -1
- package/dist/context/llm/claude-code-models.test.js +0 -15
- package/dist/context/llm/claude-code-runtime.test.d.ts +0 -1
- package/dist/context/llm/claude-code-runtime.test.js +0 -434
- package/dist/context/llm/debug-request-recorder.test.d.ts +0 -1
- package/dist/context/llm/debug-request-recorder.test.js +0 -112
- package/dist/context/llm/embedding-port.test.d.ts +0 -1
- package/dist/context/llm/embedding-port.test.js +0 -34
- package/dist/context/llm/local-config.test.d.ts +0 -1
- package/dist/context/llm/local-config.test.js +0 -164
- package/dist/context/llm/runtime-local-config.test.d.ts +0 -1
- package/dist/context/llm/runtime-local-config.test.js +0 -17
- package/dist/context/llm/runtime-tools.test.d.ts +0 -1
- package/dist/context/llm/runtime-tools.test.js +0 -36
- package/dist/context/mcp/local-project-ports.test.d.ts +0 -1
- package/dist/context/mcp/local-project-ports.test.js +0 -689
- package/dist/context/mcp/server.test.d.ts +0 -1
- package/dist/context/mcp/server.test.js +0 -902
- package/dist/context/memory/local-memory.test.d.ts +0 -1
- package/dist/context/memory/local-memory.test.js +0 -173
- package/dist/context/memory/memory-agent.service.ingest.test.d.ts +0 -1
- package/dist/context/memory/memory-agent.service.ingest.test.js +0 -355
- package/dist/context/memory/memory-agent.service.test.d.ts +0 -1
- package/dist/context/memory/memory-agent.service.test.js +0 -413
- package/dist/context/memory/memory-runs.test.d.ts +0 -1
- package/dist/context/memory/memory-runs.test.js +0 -158
- package/dist/context/memory/memory-runtime-assets.test.d.ts +0 -1
- package/dist/context/memory/memory-runtime-assets.test.js +0 -162
- package/dist/context/project/config.test.d.ts +0 -1
- package/dist/context/project/config.test.js +0 -467
- package/dist/context/project/driver-schemas.test.d.ts +0 -1
- package/dist/context/project/driver-schemas.test.js +0 -125
- package/dist/context/project/local-git-file-store.test.d.ts +0 -1
- package/dist/context/project/local-git-file-store.test.js +0 -71
- package/dist/context/project/mappings-yaml-schema.test.d.ts +0 -1
- package/dist/context/project/mappings-yaml-schema.test.js +0 -79
- package/dist/context/project/project.test.d.ts +0 -1
- package/dist/context/project/project.test.js +0 -55
- package/dist/context/project/setup-config.test.d.ts +0 -1
- package/dist/context/project/setup-config.test.js +0 -38
- package/dist/context/prompts/prompt.service.test.d.ts +0 -1
- package/dist/context/prompts/prompt.service.test.js +0 -43
- package/dist/context/scan/credentials.test.d.ts +0 -1
- package/dist/context/scan/credentials.test.js +0 -162
- package/dist/context/scan/data-dictionary.test.d.ts +0 -1
- package/dist/context/scan/data-dictionary.test.js +0 -92
- package/dist/context/scan/description-generation.test.d.ts +0 -1
- package/dist/context/scan/description-generation.test.js +0 -693
- package/dist/context/scan/embedding-text.test.d.ts +0 -1
- package/dist/context/scan/embedding-text.test.js +0 -36
- package/dist/context/scan/enrichment-state.test.d.ts +0 -1
- package/dist/context/scan/enrichment-state.test.js +0 -147
- package/dist/context/scan/enrichment-summary.test.d.ts +0 -1
- package/dist/context/scan/enrichment-summary.test.js +0 -34
- package/dist/context/scan/enrichment-types.test.d.ts +0 -1
- package/dist/context/scan/enrichment-types.test.js +0 -141
- package/dist/context/scan/entity-details.test.d.ts +0 -1
- package/dist/context/scan/entity-details.test.js +0 -234
- package/dist/context/scan/local-enrichment-artifacts.test.d.ts +0 -1
- package/dist/context/scan/local-enrichment-artifacts.test.js +0 -771
- package/dist/context/scan/local-enrichment.test.d.ts +0 -1
- package/dist/context/scan/local-enrichment.test.js +0 -765
- package/dist/context/scan/local-scan.test.d.ts +0 -1
- package/dist/context/scan/local-scan.test.js +0 -1663
- package/dist/context/scan/local-structural-artifacts.test.d.ts +0 -1
- package/dist/context/scan/local-structural-artifacts.test.js +0 -144
- package/dist/context/scan/relationship-benchmark-report.test.d.ts +0 -1
- package/dist/context/scan/relationship-benchmark-report.test.js +0 -389
- package/dist/context/scan/relationship-benchmarks.test.d.ts +0 -1
- package/dist/context/scan/relationship-benchmarks.test.js +0 -1072
- package/dist/context/scan/relationship-budget.test.d.ts +0 -1
- package/dist/context/scan/relationship-budget.test.js +0 -71
- package/dist/context/scan/relationship-candidates.test.d.ts +0 -1
- package/dist/context/scan/relationship-candidates.test.js +0 -747
- package/dist/context/scan/relationship-composite-candidates.test.d.ts +0 -1
- package/dist/context/scan/relationship-composite-candidates.test.js +0 -69
- package/dist/context/scan/relationship-diagnostics.test.d.ts +0 -1
- package/dist/context/scan/relationship-diagnostics.test.js +0 -333
- package/dist/context/scan/relationship-discovery.test.d.ts +0 -1
- package/dist/context/scan/relationship-discovery.test.js +0 -618
- package/dist/context/scan/relationship-formal-metadata.test.d.ts +0 -1
- package/dist/context/scan/relationship-formal-metadata.test.js +0 -125
- package/dist/context/scan/relationship-graph-resolver.test.d.ts +0 -1
- package/dist/context/scan/relationship-graph-resolver.test.js +0 -604
- package/dist/context/scan/relationship-llm-proposal.test.d.ts +0 -1
- package/dist/context/scan/relationship-llm-proposal.test.js +0 -197
- package/dist/context/scan/relationship-locality.test.d.ts +0 -1
- package/dist/context/scan/relationship-locality.test.js +0 -128
- package/dist/context/scan/relationship-name-similarity.test.d.ts +0 -1
- package/dist/context/scan/relationship-name-similarity.test.js +0 -68
- package/dist/context/scan/relationship-profiling.test.d.ts +0 -1
- package/dist/context/scan/relationship-profiling.test.js +0 -392
- package/dist/context/scan/relationship-scoring.test.d.ts +0 -1
- package/dist/context/scan/relationship-scoring.test.js +0 -86
- package/dist/context/scan/relationship-validation.test.d.ts +0 -1
- package/dist/context/scan/relationship-validation.test.js +0 -455
- package/dist/context/scan/table-ref.test.d.ts +0 -1
- package/dist/context/scan/table-ref.test.js +0 -53
- package/dist/context/scan/type-normalization.test.d.ts +0 -1
- package/dist/context/scan/type-normalization.test.js +0 -21
- package/dist/context/scan/types.test.d.ts +0 -1
- package/dist/context/scan/types.test.js +0 -206
- package/dist/context/scan/warehouse-catalog.test.d.ts +0 -1
- package/dist/context/scan/warehouse-catalog.test.js +0 -158
- package/dist/context/search/backend-conformance.test-utils.d.ts +0 -39
- package/dist/context/search/backend-conformance.test-utils.js +0 -88
- package/dist/context/search/backend-conformance.test-utils.test.d.ts +0 -1
- package/dist/context/search/backend-conformance.test-utils.test.js +0 -408
- package/dist/context/search/discover.test.d.ts +0 -1
- package/dist/context/search/discover.test.js +0 -197
- package/dist/context/search/hybrid-search-core.test.d.ts +0 -1
- package/dist/context/search/hybrid-search-core.test.js +0 -113
- package/dist/context/search/pglite-owner-process.test.d.ts +0 -1
- package/dist/context/search/pglite-owner-process.test.js +0 -273
- package/dist/context/search/pglite-runtime-boundary.test.d.ts +0 -1
- package/dist/context/search/pglite-runtime-boundary.test.js +0 -40
- package/dist/context/search/pglite-spike.test.d.ts +0 -1
- package/dist/context/search/pglite-spike.test.js +0 -249
- package/dist/context/search/query.test.d.ts +0 -1
- package/dist/context/search/query.test.js +0 -23
- package/dist/context/search/rrf.test.d.ts +0 -1
- package/dist/context/search/rrf.test.js +0 -47
- package/dist/context/skills/skills-registry.service.test.d.ts +0 -1
- package/dist/context/skills/skills-registry.service.test.js +0 -161
- package/dist/context/sl/dictionary-search.test.d.ts +0 -1
- package/dist/context/sl/dictionary-search.test.js +0 -204
- package/dist/context/sl/local-query.test.d.ts +0 -1
- package/dist/context/sl/local-query.test.js +0 -283
- package/dist/context/sl/local-sl.test.d.ts +0 -1
- package/dist/context/sl/local-sl.test.js +0 -334
- package/dist/context/sl/pglite-sl-search-prototype.test.d.ts +0 -1
- package/dist/context/sl/pglite-sl-search-prototype.test.js +0 -240
- package/dist/context/sl/schemas.contract.test.d.ts +0 -1
- package/dist/context/sl/schemas.contract.test.js +0 -62
- package/dist/context/sl/semantic-layer.service.test.d.ts +0 -1
- package/dist/context/sl/semantic-layer.service.test.js +0 -1107
- package/dist/context/sl/sl-dictionary-profile.test.d.ts +0 -1
- package/dist/context/sl/sl-dictionary-profile.test.js +0 -88
- package/dist/context/sl/sl-search.service.test.d.ts +0 -1
- package/dist/context/sl/sl-search.service.test.js +0 -256
- package/dist/context/sl/sqlite-sl-sources-index.test.d.ts +0 -1
- package/dist/context/sl/sqlite-sl-sources-index.test.js +0 -175
- package/dist/context/sl/tools/connection-id-schema.test.d.ts +0 -1
- package/dist/context/sl/tools/connection-id-schema.test.js +0 -14
- package/dist/context/sl/tools/sl-discover.tool.test.d.ts +0 -1
- package/dist/context/sl/tools/sl-discover.tool.test.js +0 -72
- package/dist/context/sl/tools/sl-edit-source.tool.test.d.ts +0 -1
- package/dist/context/sl/tools/sl-edit-source.tool.test.js +0 -184
- package/dist/context/sl/tools/sl-read-source.tool.session.test.d.ts +0 -1
- package/dist/context/sl/tools/sl-read-source.tool.session.test.js +0 -55
- package/dist/context/sl/tools/sl-rollback.tool.test.d.ts +0 -1
- package/dist/context/sl/tools/sl-rollback.tool.test.js +0 -57
- package/dist/context/sl/tools/sl-validate.tool.test.d.ts +0 -1
- package/dist/context/sl/tools/sl-validate.tool.test.js +0 -54
- package/dist/context/sl/tools/sl-warehouse-validation.test.d.ts +0 -1
- package/dist/context/sl/tools/sl-warehouse-validation.test.js +0 -136
- package/dist/context/sl/tools/sl-write-source.tool.test.d.ts +0 -1
- package/dist/context/sl/tools/sl-write-source.tool.test.js +0 -307
- package/dist/context/sql-analysis/http-sql-analysis-port.test.d.ts +0 -1
- package/dist/context/sql-analysis/http-sql-analysis-port.test.js +0 -147
- package/dist/context/test/make-local-git-repo.d.ts +0 -10
- package/dist/context/test/make-local-git-repo.js +0 -34
- package/dist/context/tools/context-evidence-tools.test.d.ts +0 -1
- package/dist/context/tools/context-evidence-tools.test.js +0 -486
- package/dist/context/tools/touched-sl-sources.test.d.ts +0 -1
- package/dist/context/tools/touched-sl-sources.test.js +0 -31
- package/dist/context/wiki/knowledge-wiki.service.test.d.ts +0 -1
- package/dist/context/wiki/knowledge-wiki.service.test.js +0 -205
- package/dist/context/wiki/local-knowledge.test.d.ts +0 -1
- package/dist/context/wiki/local-knowledge.test.js +0 -270
- package/dist/context/wiki/sqlite-knowledge-index.test.d.ts +0 -1
- package/dist/context/wiki/sqlite-knowledge-index.test.js +0 -129
- package/dist/context/wiki/tools/wiki-list-tags.tool.test.d.ts +0 -1
- package/dist/context/wiki/tools/wiki-list-tags.tool.test.js +0 -35
- package/dist/context/wiki/tools/wiki-read.tool.test.d.ts +0 -1
- package/dist/context/wiki/tools/wiki-read.tool.test.js +0 -66
- package/dist/context/wiki/tools/wiki-remove.tool.test.d.ts +0 -1
- package/dist/context/wiki/tools/wiki-remove.tool.test.js +0 -95
- package/dist/context/wiki/tools/wiki-search.tool.test.d.ts +0 -1
- package/dist/context/wiki/tools/wiki-search.tool.test.js +0 -35
- package/dist/context/wiki/tools/wiki-write.tool.test.d.ts +0 -1
- package/dist/context/wiki/tools/wiki-write.tool.test.js +0 -264
- package/dist/context/wiki/wiki-ref-validation.test.d.ts +0 -1
- package/dist/context/wiki/wiki-ref-validation.test.js +0 -64
- package/dist/context-build-view.test.d.ts +0 -1
- package/dist/context-build-view.test.js +0 -942
- package/dist/database-tree-picker.test.d.ts +0 -1
- package/dist/database-tree-picker.test.js +0 -188
- package/dist/demo-assets.test.d.ts +0 -1
- package/dist/demo-assets.test.js +0 -121
- package/dist/demo-metrics.test.d.ts +0 -1
- package/dist/demo-metrics.test.js +0 -108
- package/dist/doctor.test.d.ts +0 -1
- package/dist/doctor.test.js +0 -596
- package/dist/embedding-resolution.test.d.ts +0 -1
- package/dist/embedding-resolution.test.js +0 -132
- package/dist/example-smoke.test.d.ts +0 -1
- package/dist/example-smoke.test.js +0 -83
- package/dist/index.test.d.ts +0 -1
- package/dist/index.test.js +0 -1300
- package/dist/ingest-query-executor.test.d.ts +0 -1
- package/dist/ingest-query-executor.test.js +0 -71
- package/dist/ingest-report-file.test.d.ts +0 -1
- package/dist/ingest-report-file.test.js +0 -63
- package/dist/ingest-viz.test.d.ts +0 -1
- package/dist/ingest-viz.test.js +0 -691
- package/dist/ingest.test-utils.d.ts +0 -126
- package/dist/ingest.test-utils.js +0 -629
- package/dist/ingest.test.d.ts +0 -1
- package/dist/ingest.test.js +0 -1568
- package/dist/io/logger.test.d.ts +0 -1
- package/dist/io/logger.test.js +0 -55
- package/dist/io/mode.test.d.ts +0 -1
- package/dist/io/mode.test.js +0 -48
- package/dist/io/print-list.test.d.ts +0 -1
- package/dist/io/print-list.test.js +0 -277
- package/dist/knowledge.test.d.ts +0 -1
- package/dist/knowledge.test.js +0 -198
- package/dist/llm/embedding-health.test.d.ts +0 -1
- package/dist/llm/embedding-health.test.js +0 -72
- package/dist/llm/embedding-provider.test.d.ts +0 -1
- package/dist/llm/embedding-provider.test.js +0 -84
- package/dist/llm/message-builder.test.d.ts +0 -1
- package/dist/llm/message-builder.test.js +0 -127
- package/dist/llm/model-health.test.d.ts +0 -1
- package/dist/llm/model-health.test.js +0 -55
- package/dist/llm/model-provider.test.d.ts +0 -1
- package/dist/llm/model-provider.test.js +0 -246
- package/dist/llm/repair.test.d.ts +0 -1
- package/dist/llm/repair.test.js +0 -78
- package/dist/local-adapters.test.d.ts +0 -1
- package/dist/local-adapters.test.js +0 -166
- package/dist/local-scan-connectors.test.d.ts +0 -1
- package/dist/local-scan-connectors.test.js +0 -92
- package/dist/managed-local-embeddings.test.d.ts +0 -1
- package/dist/managed-local-embeddings.test.js +0 -229
- package/dist/managed-mcp-daemon.test.d.ts +0 -1
- package/dist/managed-mcp-daemon.test.js +0 -187
- package/dist/managed-python-command.test.d.ts +0 -1
- package/dist/managed-python-command.test.js +0 -262
- package/dist/managed-python-daemon.test.d.ts +0 -1
- package/dist/managed-python-daemon.test.js +0 -360
- package/dist/managed-python-http.test.d.ts +0 -1
- package/dist/managed-python-http.test.js +0 -177
- package/dist/managed-python-runtime.test.d.ts +0 -1
- package/dist/managed-python-runtime.test.js +0 -426
- package/dist/mcp-http-server.test.d.ts +0 -1
- package/dist/mcp-http-server.test.js +0 -209
- package/dist/mcp-server-factory.test.d.ts +0 -1
- package/dist/mcp-server-factory.test.js +0 -142
- package/dist/memory-flow-interactive.test.d.ts +0 -1
- package/dist/memory-flow-interactive.test.js +0 -109
- package/dist/memory-flow-tui.test.d.ts +0 -1
- package/dist/memory-flow-tui.test.js +0 -247
- package/dist/next-steps.test.d.ts +0 -1
- package/dist/next-steps.test.js +0 -77
- package/dist/notion-page-picker.test.d.ts +0 -1
- package/dist/notion-page-picker.test.js +0 -244
- package/dist/print-command-tree.test.d.ts +0 -1
- package/dist/print-command-tree.test.js +0 -37
- package/dist/project-dir.test.d.ts +0 -1
- package/dist/project-dir.test.js +0 -124
- package/dist/project-resolver.test.d.ts +0 -1
- package/dist/project-resolver.test.js +0 -49
- package/dist/prompt-navigation.test.d.ts +0 -1
- package/dist/prompt-navigation.test.js +0 -33
- package/dist/proxy-env.test.d.ts +0 -1
- package/dist/proxy-env.test.js +0 -17
- package/dist/public-ingest-copy.test.d.ts +0 -1
- package/dist/public-ingest-copy.test.js +0 -24
- package/dist/public-ingest.test.d.ts +0 -1
- package/dist/public-ingest.test.js +0 -891
- package/dist/runtime-requirements.test.d.ts +0 -1
- package/dist/runtime-requirements.test.js +0 -73
- package/dist/runtime.test.d.ts +0 -1
- package/dist/runtime.test.js +0 -381
- package/dist/scan.test.d.ts +0 -1
- package/dist/scan.test.js +0 -1123
- package/dist/setup-agents.test.d.ts +0 -1
- package/dist/setup-agents.test.js +0 -1028
- package/dist/setup-context.test.d.ts +0 -1
- package/dist/setup-context.test.js +0 -491
- package/dist/setup-databases.test.d.ts +0 -1
- package/dist/setup-databases.test.js +0 -2101
- package/dist/setup-demo-tour.test.d.ts +0 -1
- package/dist/setup-demo-tour.test.js +0 -221
- package/dist/setup-embeddings.test.d.ts +0 -1
- package/dist/setup-embeddings.test.js +0 -436
- package/dist/setup-interrupt.test.d.ts +0 -1
- package/dist/setup-interrupt.test.js +0 -77
- package/dist/setup-models.test.d.ts +0 -1
- package/dist/setup-models.test.js +0 -885
- package/dist/setup-project.test.d.ts +0 -1
- package/dist/setup-project.test.js +0 -209
- package/dist/setup-prompts.test.d.ts +0 -1
- package/dist/setup-prompts.test.js +0 -208
- package/dist/setup-ready-menu.test.d.ts +0 -1
- package/dist/setup-ready-menu.test.js +0 -44
- package/dist/setup-runtime.test.d.ts +0 -1
- package/dist/setup-runtime.test.js +0 -111
- package/dist/setup-secrets.test.d.ts +0 -1
- package/dist/setup-secrets.test.js +0 -30
- package/dist/setup-sources-notion.test.d.ts +0 -1
- package/dist/setup-sources-notion.test.js +0 -109
- package/dist/setup-sources.test.d.ts +0 -1
- package/dist/setup-sources.test.js +0 -1303
- package/dist/setup.test.d.ts +0 -1
- package/dist/setup.test.js +0 -1825
- package/dist/sl.test.d.ts +0 -1
- package/dist/sl.test.js +0 -567
- package/dist/source-mapping.test.d.ts +0 -1
- package/dist/source-mapping.test.js +0 -65
- package/dist/sql.test.d.ts +0 -1
- package/dist/sql.test.js +0 -253
- package/dist/standalone-smoke.test.d.ts +0 -1
- package/dist/standalone-smoke.test.js +0 -250
- package/dist/status-project.test.d.ts +0 -1
- package/dist/status-project.test.js +0 -502
- package/dist/telemetry/command-hook.test.d.ts +0 -1
- package/dist/telemetry/command-hook.test.js +0 -31
- package/dist/telemetry/demo-detect.test.d.ts +0 -1
- package/dist/telemetry/demo-detect.test.js +0 -22
- package/dist/telemetry/emitter.test.d.ts +0 -1
- package/dist/telemetry/emitter.test.js +0 -103
- package/dist/telemetry/events.snapshot.test.d.ts +0 -1
- package/dist/telemetry/events.snapshot.test.js +0 -135
- package/dist/telemetry/events.test.d.ts +0 -1
- package/dist/telemetry/events.test.js +0 -136
- package/dist/telemetry/identity.test.d.ts +0 -1
- package/dist/telemetry/identity.test.js +0 -148
- package/dist/telemetry/project-snapshot.test.d.ts +0 -1
- package/dist/telemetry/project-snapshot.test.js +0 -71
- package/dist/telemetry/schema-writer.test.d.ts +0 -1
- package/dist/telemetry/schema-writer.test.js +0 -23
- package/dist/telemetry/scrubber.test.d.ts +0 -1
- package/dist/telemetry/scrubber.test.js +0 -21
- package/dist/text-ingest.test.d.ts +0 -1
- package/dist/text-ingest.test.js +0 -247
- package/dist/tree-picker-state.test.d.ts +0 -1
- package/dist/tree-picker-state.test.js +0 -303
- package/dist/tree-picker-tui.test.d.ts +0 -1
- package/dist/tree-picker-tui.test.js +0 -248
- package/dist/viz-fallback.test.d.ts +0 -1
- package/dist/viz-fallback.test.js +0 -77
package/dist/index.test.js
DELETED
|
@@ -1,1300 +0,0 @@
|
|
|
1
|
-
import { mkdtemp, 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 { initKtxProject } from './context/project/project.js';
|
|
6
|
-
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
|
|
7
|
-
import { getKtxCliPackageInfo, packageInfoFromJson, rendererUnavailableVizFallback, renderMemoryFlowTui, resolveVizFallback, runKtxCli, sanitizeMemoryFlowTuiError, startLiveMemoryFlowTui, warnVizFallbackOnce, } from './index.js';
|
|
8
|
-
const require = createRequire(import.meta.url);
|
|
9
|
-
const cliPackageJson = require('@kaelio/ktx/package.json');
|
|
10
|
-
const cliVersion = cliPackageJson.version;
|
|
11
|
-
function makeIo(options = {}) {
|
|
12
|
-
let stdout = '';
|
|
13
|
-
let stderr = '';
|
|
14
|
-
return {
|
|
15
|
-
io: {
|
|
16
|
-
stdout: {
|
|
17
|
-
isTTY: options.stdoutIsTty,
|
|
18
|
-
write: (chunk) => {
|
|
19
|
-
stdout += chunk;
|
|
20
|
-
},
|
|
21
|
-
},
|
|
22
|
-
stderr: {
|
|
23
|
-
write: (chunk) => {
|
|
24
|
-
stderr += chunk;
|
|
25
|
-
},
|
|
26
|
-
},
|
|
27
|
-
},
|
|
28
|
-
stdout: () => stdout,
|
|
29
|
-
stderr: () => stderr,
|
|
30
|
-
};
|
|
31
|
-
}
|
|
32
|
-
describe('getKtxCliPackageInfo', () => {
|
|
33
|
-
it('identifies the CLI package', () => {
|
|
34
|
-
expect(getKtxCliPackageInfo()).toEqual({
|
|
35
|
-
name: '@kaelio/ktx',
|
|
36
|
-
version: cliVersion,
|
|
37
|
-
});
|
|
38
|
-
});
|
|
39
|
-
it('exports package metadata for package managers and runtime diagnostics', () => {
|
|
40
|
-
const packageJson = require('@kaelio/ktx/package.json');
|
|
41
|
-
expect(packageJson).toMatchObject({
|
|
42
|
-
name: '@kaelio/ktx',
|
|
43
|
-
version: cliVersion,
|
|
44
|
-
});
|
|
45
|
-
expect(cliVersion).toMatch(/^\d+\.\d+\.\d+/);
|
|
46
|
-
});
|
|
47
|
-
it('normalizes public package metadata from package.json contents', () => {
|
|
48
|
-
expect(packageInfoFromJson({
|
|
49
|
-
name: '@kaelio/ktx',
|
|
50
|
-
version: '0.1.0',
|
|
51
|
-
})).toEqual({
|
|
52
|
-
name: '@kaelio/ktx',
|
|
53
|
-
version: '0.1.0',
|
|
54
|
-
});
|
|
55
|
-
});
|
|
56
|
-
});
|
|
57
|
-
describe('memory-flow renderer exports', () => {
|
|
58
|
-
it('exports runtime-agnostic renderer entry points for hosted terminal clients', () => {
|
|
59
|
-
expect(renderMemoryFlowTui).toBeTypeOf('function');
|
|
60
|
-
expect(startLiveMemoryFlowTui).toBeTypeOf('function');
|
|
61
|
-
expect(sanitizeMemoryFlowTuiError('token=abc123')).toBe('[redacted]');
|
|
62
|
-
});
|
|
63
|
-
it('exports shared visualization fallback helpers for hosted terminal clients', () => {
|
|
64
|
-
const fallback = resolveVizFallback({ stdout: { isTTY: true }, stderr: { write: vi.fn() } }, { TERM: 'dumb' });
|
|
65
|
-
expect(fallback).toEqual({
|
|
66
|
-
shouldDegrade: true,
|
|
67
|
-
reason: 'term-dumb',
|
|
68
|
-
message: 'TERM=dumb does not support the visual renderer',
|
|
69
|
-
});
|
|
70
|
-
expect(rendererUnavailableVizFallback()).toEqual({
|
|
71
|
-
shouldDegrade: true,
|
|
72
|
-
reason: 'renderer-unavailable',
|
|
73
|
-
message: 'the terminal renderer is unavailable',
|
|
74
|
-
});
|
|
75
|
-
expect(warnVizFallbackOnce).toBeTypeOf('function');
|
|
76
|
-
});
|
|
77
|
-
});
|
|
78
|
-
describe('runKtxCli', () => {
|
|
79
|
-
let tempDir;
|
|
80
|
-
beforeEach(async () => {
|
|
81
|
-
tempDir = await mkdtemp(join(tmpdir(), 'ktx-cli-'));
|
|
82
|
-
await writeFile(join(tempDir, 'ktx.yaml'), '{}\n', 'utf-8');
|
|
83
|
-
});
|
|
84
|
-
afterEach(async () => {
|
|
85
|
-
await rm(tempDir, { recursive: true, force: true });
|
|
86
|
-
});
|
|
87
|
-
it('prints version information', async () => {
|
|
88
|
-
const testIo = makeIo();
|
|
89
|
-
await expect(runKtxCli(['--version'], testIo.io)).resolves.toBe(0);
|
|
90
|
-
expect(testIo.stdout()).toBe(`@kaelio/ktx ${cliVersion}\n`);
|
|
91
|
-
expect(testIo.stderr()).toBe('');
|
|
92
|
-
});
|
|
93
|
-
it('prints the public command surface in root help', async () => {
|
|
94
|
-
const testIo = makeIo();
|
|
95
|
-
await expect(runKtxCli(['--help'], testIo.io)).resolves.toBe(0);
|
|
96
|
-
expect(testIo.stdout()).toContain('Usage: ktx [options] [command]');
|
|
97
|
-
expect(testIo.stdout()).toContain('KTX data agent context layer CLI');
|
|
98
|
-
for (const command of ['setup', 'connection', 'ingest', 'wiki', 'sl', 'status', 'admin']) {
|
|
99
|
-
expect(testIo.stdout()).toContain(`${command}`);
|
|
100
|
-
}
|
|
101
|
-
expect(testIo.stdout()).not.toMatch(/^ dev\s/m);
|
|
102
|
-
expect(testIo.stdout()).not.toMatch(/^ scan\s/m);
|
|
103
|
-
for (const removed of ['demo', 'init', 'connect', 'ask', 'knowledge', 'agent', 'completion', 'serve']) {
|
|
104
|
-
expect(testIo.stdout()).not.toMatch(new RegExp(`^\\s+${removed}(?:\\s|\\[|$)`, 'm'));
|
|
105
|
-
}
|
|
106
|
-
expect(testIo.stdout()).toContain('--project-dir <path>');
|
|
107
|
-
expect(testIo.stdout()).toContain('KTX_PROJECT_DIR');
|
|
108
|
-
expect(testIo.stdout()).toContain('--debug');
|
|
109
|
-
expect(testIo.stdout()).not.toContain('--' + 'verbose');
|
|
110
|
-
expect(testIo.stdout()).not.toContain('Advanced:');
|
|
111
|
-
expect(testIo.stderr()).toBe('');
|
|
112
|
-
});
|
|
113
|
-
it('routes supported public wiki commands', async () => {
|
|
114
|
-
const knowledge = vi.fn(async () => 0);
|
|
115
|
-
const listIo = makeIo();
|
|
116
|
-
await expect(runKtxCli(['--project-dir', tempDir, 'wiki', '--json'], listIo.io, { knowledge }))
|
|
117
|
-
.resolves.toBe(0);
|
|
118
|
-
expect(knowledge).toHaveBeenCalledWith(expect.objectContaining({
|
|
119
|
-
command: 'list',
|
|
120
|
-
projectDir: tempDir,
|
|
121
|
-
userId: 'local',
|
|
122
|
-
json: true,
|
|
123
|
-
}), listIo.io);
|
|
124
|
-
const searchIo = makeIo();
|
|
125
|
-
await expect(runKtxCli(['--project-dir', tempDir, 'wiki', 'revenue', '--limit', '5'], searchIo.io, { knowledge })).resolves.toBe(0);
|
|
126
|
-
expect(knowledge).toHaveBeenLastCalledWith(expect.objectContaining({
|
|
127
|
-
command: 'search',
|
|
128
|
-
projectDir: tempDir,
|
|
129
|
-
query: 'revenue',
|
|
130
|
-
userId: 'local',
|
|
131
|
-
json: false,
|
|
132
|
-
limit: 5,
|
|
133
|
-
}), searchIo.io);
|
|
134
|
-
const debugSearchIo = makeIo();
|
|
135
|
-
await expect(runKtxCli(['--project-dir', tempDir, '--debug', 'wiki', 'revenue'], debugSearchIo.io, { knowledge })).resolves.toBe(0);
|
|
136
|
-
expect(knowledge).toHaveBeenLastCalledWith(expect.objectContaining({
|
|
137
|
-
command: 'search',
|
|
138
|
-
projectDir: tempDir,
|
|
139
|
-
query: 'revenue',
|
|
140
|
-
userId: 'local',
|
|
141
|
-
json: false,
|
|
142
|
-
debug: true,
|
|
143
|
-
}), debugSearchIo.io);
|
|
144
|
-
const multiWordIo = makeIo();
|
|
145
|
-
await expect(runKtxCli(['--project-dir', tempDir, 'wiki', 'revenue', 'policy'], multiWordIo.io, { knowledge })).resolves.toBe(0);
|
|
146
|
-
expect(knowledge).toHaveBeenLastCalledWith(expect.objectContaining({
|
|
147
|
-
command: 'search',
|
|
148
|
-
projectDir: tempDir,
|
|
149
|
-
query: 'revenue policy',
|
|
150
|
-
userId: 'local',
|
|
151
|
-
json: false,
|
|
152
|
-
}), multiWordIo.io);
|
|
153
|
-
});
|
|
154
|
-
it('rejects unknown write-style flags on the flattened wiki and sl commands', async () => {
|
|
155
|
-
const knowledge = vi.fn(async () => 0);
|
|
156
|
-
const sl = vi.fn(async () => 0);
|
|
157
|
-
const wikiIo = makeIo();
|
|
158
|
-
await expect(runKtxCli(['--project-dir', tempDir, 'wiki', 'revenue', '--summary', 'Revenue', '--content', 'Revenue.'], wikiIo.io, { knowledge })).resolves.toBe(1);
|
|
159
|
-
expect(wikiIo.stderr()).toMatch(/unknown option|error:/);
|
|
160
|
-
expect(knowledge).not.toHaveBeenCalled();
|
|
161
|
-
const slIo = makeIo();
|
|
162
|
-
await expect(runKtxCli(['--project-dir', tempDir, 'sl', 'orders', '--yaml', 'name: orders'], slIo.io, { sl })).resolves.toBe(1);
|
|
163
|
-
expect(slIo.stderr()).toMatch(/unknown option|error:/);
|
|
164
|
-
expect(sl).not.toHaveBeenCalled();
|
|
165
|
-
});
|
|
166
|
-
it('routes sl search via the flattened query positional and rejects unknown flags', async () => {
|
|
167
|
-
const sl = vi.fn(async () => 0);
|
|
168
|
-
const searchIo = makeIo();
|
|
169
|
-
await expect(runKtxCli(['--project-dir', tempDir, 'sl', 'revenue', '--connection-id', 'warehouse', '--limit', '5', '--json'], searchIo.io, { sl })).resolves.toBe(0);
|
|
170
|
-
expect(sl).toHaveBeenCalledWith(expect.objectContaining({
|
|
171
|
-
command: 'search',
|
|
172
|
-
projectDir: tempDir,
|
|
173
|
-
connectionId: 'warehouse',
|
|
174
|
-
query: 'revenue',
|
|
175
|
-
limit: 5,
|
|
176
|
-
json: true,
|
|
177
|
-
output: undefined,
|
|
178
|
-
}), searchIo.io);
|
|
179
|
-
const bareIo = makeIo();
|
|
180
|
-
await expect(runKtxCli(['--project-dir', tempDir, 'sl', '--connection-id', 'warehouse', '--json'], bareIo.io, { sl })).resolves.toBe(0);
|
|
181
|
-
expect(sl).toHaveBeenLastCalledWith(expect.objectContaining({
|
|
182
|
-
command: 'list',
|
|
183
|
-
projectDir: tempDir,
|
|
184
|
-
connectionId: 'warehouse',
|
|
185
|
-
json: true,
|
|
186
|
-
output: undefined,
|
|
187
|
-
}), bareIo.io);
|
|
188
|
-
const unknownIo = makeIo();
|
|
189
|
-
await expect(runKtxCli(['--project-dir', tempDir, 'sl', '--query', 'revenue'], unknownIo.io, { sl })).resolves.toBe(1);
|
|
190
|
-
expect(unknownIo.stderr()).toContain("unknown option '--query'");
|
|
191
|
-
});
|
|
192
|
-
it('routes runtime management commands with the CLI package version', async () => {
|
|
193
|
-
const runtime = vi.fn(async () => 0);
|
|
194
|
-
const installIo = makeIo();
|
|
195
|
-
const startIo = makeIo();
|
|
196
|
-
const stopIo = makeIo();
|
|
197
|
-
const stopAllIo = makeIo();
|
|
198
|
-
const statusIo = makeIo();
|
|
199
|
-
const pruneIo = makeIo();
|
|
200
|
-
await expect(runKtxCli(['admin', 'runtime', 'install', '--feature', 'local-embeddings', '--force', '--yes'], installIo.io, {
|
|
201
|
-
runtime,
|
|
202
|
-
})).resolves.toBe(0);
|
|
203
|
-
await expect(runKtxCli(['admin', 'runtime', 'start', '--feature', 'local-embeddings', '--force'], startIo.io, { runtime })).resolves.toBe(0);
|
|
204
|
-
await expect(runKtxCli(['admin', 'runtime', 'stop'], stopIo.io, { runtime })).resolves.toBe(0);
|
|
205
|
-
await expect(runKtxCli(['admin', 'runtime', 'stop', '--all'], stopAllIo.io, { runtime })).resolves.toBe(0);
|
|
206
|
-
await expect(runKtxCli(['admin', 'runtime', 'status', '--json'], statusIo.io, { runtime })).resolves.toBe(0);
|
|
207
|
-
await expect(runKtxCli(['admin', 'runtime', 'prune', '--dry-run'], pruneIo.io, { runtime })).resolves.toBe(1);
|
|
208
|
-
expect(runtime).toHaveBeenNthCalledWith(1, {
|
|
209
|
-
command: 'install',
|
|
210
|
-
cliVersion,
|
|
211
|
-
feature: 'local-embeddings',
|
|
212
|
-
force: true,
|
|
213
|
-
}, installIo.io);
|
|
214
|
-
expect(runtime).toHaveBeenNthCalledWith(2, {
|
|
215
|
-
command: 'start',
|
|
216
|
-
cliVersion,
|
|
217
|
-
projectDir: expect.any(String),
|
|
218
|
-
feature: 'local-embeddings',
|
|
219
|
-
force: true,
|
|
220
|
-
}, startIo.io);
|
|
221
|
-
expect(runtime).toHaveBeenNthCalledWith(3, {
|
|
222
|
-
command: 'stop',
|
|
223
|
-
cliVersion,
|
|
224
|
-
projectDir: expect.any(String),
|
|
225
|
-
all: false,
|
|
226
|
-
}, stopIo.io);
|
|
227
|
-
expect(runtime).toHaveBeenNthCalledWith(4, {
|
|
228
|
-
command: 'stop',
|
|
229
|
-
cliVersion,
|
|
230
|
-
projectDir: expect.any(String),
|
|
231
|
-
all: true,
|
|
232
|
-
}, stopAllIo.io);
|
|
233
|
-
expect(runtime).toHaveBeenNthCalledWith(5, {
|
|
234
|
-
command: 'status',
|
|
235
|
-
cliVersion,
|
|
236
|
-
json: true,
|
|
237
|
-
}, statusIo.io);
|
|
238
|
-
expect(runtime).toHaveBeenCalledTimes(5);
|
|
239
|
-
for (const io of [installIo, startIo, stopIo, stopAllIo, statusIo]) {
|
|
240
|
-
expect(io.stderr()).toBe('');
|
|
241
|
-
}
|
|
242
|
-
expect(pruneIo.stderr()).toMatch(/unknown command|error:/);
|
|
243
|
-
});
|
|
244
|
-
it('prints the resolved project directory for ordinary project commands', async () => {
|
|
245
|
-
const connection = vi.fn(async () => 0);
|
|
246
|
-
const testIo = makeIo();
|
|
247
|
-
await expect(runKtxCli(['--project-dir', tempDir, 'connection', 'list'], testIo.io, { connection })).resolves.toBe(0);
|
|
248
|
-
expect(connection).toHaveBeenCalledWith({ command: 'list', projectDir: tempDir }, testIo.io);
|
|
249
|
-
expect(testIo.stderr()).toBe(`Project: ${tempDir}\n`);
|
|
250
|
-
});
|
|
251
|
-
it('does not print the command-level project directory line for setup', async () => {
|
|
252
|
-
const setup = vi.fn(async () => 0);
|
|
253
|
-
const testIo = makeIo();
|
|
254
|
-
await expect(runKtxCli(['--project-dir', tempDir, 'setup', '--no-input'], testIo.io, { setup })).resolves.toBe(0);
|
|
255
|
-
expect(setup).toHaveBeenCalledWith(expect.objectContaining({
|
|
256
|
-
command: 'run',
|
|
257
|
-
projectDir: tempDir,
|
|
258
|
-
}), testIo.io);
|
|
259
|
-
expect(testIo.stderr()).toBe('');
|
|
260
|
-
});
|
|
261
|
-
it('skips the project directory line for JSON output mode', async () => {
|
|
262
|
-
const publicIngest = vi.fn(async () => 0);
|
|
263
|
-
const jsonIo = makeIo();
|
|
264
|
-
await expect(runKtxCli(['--project-dir', tempDir, 'ingest', 'warehouse', '--json'], jsonIo.io, { publicIngest })).resolves.toBe(0);
|
|
265
|
-
expect(jsonIo.stderr()).toBe('');
|
|
266
|
-
});
|
|
267
|
-
it('documents runtime stop all in command help', async () => {
|
|
268
|
-
const testIo = makeIo();
|
|
269
|
-
await expect(runKtxCli(['admin', 'runtime', 'stop', '--help'], testIo.io)).resolves.toBe(0);
|
|
270
|
-
expect(testIo.stdout()).toContain('--all');
|
|
271
|
-
expect(testIo.stdout()).toContain('Stop all KTX daemon processes recorded or discoverable');
|
|
272
|
-
expect(testIo.stdout()).toContain('on this machine');
|
|
273
|
-
expect(testIo.stderr()).toBe('');
|
|
274
|
-
});
|
|
275
|
-
it('routes sl query managed runtime install policies', async () => {
|
|
276
|
-
const sl = vi.fn(async () => 0);
|
|
277
|
-
const promptIo = makeIo();
|
|
278
|
-
await expect(runKtxCli(['--project-dir', tempDir, 'sl', 'query', '--measure', 'orders.order_count'], promptIo.io, { sl })).resolves.toBe(0);
|
|
279
|
-
expect(sl).toHaveBeenLastCalledWith(expect.objectContaining({
|
|
280
|
-
command: 'query',
|
|
281
|
-
projectDir: tempDir,
|
|
282
|
-
cliVersion,
|
|
283
|
-
runtimeInstallPolicy: 'prompt',
|
|
284
|
-
query: expect.objectContaining({ measures: ['orders.order_count'], dimensions: [] }),
|
|
285
|
-
}), promptIo.io);
|
|
286
|
-
const autoIo = makeIo();
|
|
287
|
-
await expect(runKtxCli(['--project-dir', tempDir, 'sl', 'query', '--measure', 'orders.order_count', '--yes'], autoIo.io, {
|
|
288
|
-
sl,
|
|
289
|
-
})).resolves.toBe(0);
|
|
290
|
-
expect(sl).toHaveBeenLastCalledWith(expect.objectContaining({
|
|
291
|
-
cliVersion,
|
|
292
|
-
runtimeInstallPolicy: 'auto',
|
|
293
|
-
}), autoIo.io);
|
|
294
|
-
const noInputIo = makeIo();
|
|
295
|
-
await expect(runKtxCli(['--project-dir', tempDir, 'sl', 'query', '--measure', 'orders.order_count', '--no-input'], noInputIo.io, { sl })).resolves.toBe(0);
|
|
296
|
-
expect(sl).toHaveBeenLastCalledWith(expect.objectContaining({
|
|
297
|
-
cliVersion,
|
|
298
|
-
runtimeInstallPolicy: 'never',
|
|
299
|
-
}), noInputIo.io);
|
|
300
|
-
});
|
|
301
|
-
it('rejects conflicting sl query runtime install flags', async () => {
|
|
302
|
-
const io = makeIo();
|
|
303
|
-
const sl = vi.fn(async () => 0);
|
|
304
|
-
await expect(runKtxCli(['--project-dir', tempDir, 'sl', 'query', '--measure', 'orders.order_count', '--yes', '--no-input'], io.io, { sl })).resolves.toBe(1);
|
|
305
|
-
expect(sl).not.toHaveBeenCalled();
|
|
306
|
-
expect(io.stderr()).toContain('Choose only one runtime install mode: --yes or --no-input');
|
|
307
|
-
});
|
|
308
|
-
it('documents setup with only the common interactive options visible', async () => {
|
|
309
|
-
const testIo = makeIo();
|
|
310
|
-
await expect(runKtxCli(['setup', '--help'], testIo.io)).resolves.toBe(0);
|
|
311
|
-
const stdout = testIo.stdout();
|
|
312
|
-
expect(stdout).toContain('Usage: ktx setup [options]');
|
|
313
|
-
expect(stdout).toContain('--agents');
|
|
314
|
-
expect(stdout).toContain('--target <target>');
|
|
315
|
-
expect(stdout).toContain('--global');
|
|
316
|
-
expect(stdout).toContain('--local');
|
|
317
|
-
expect(stdout).toContain('--yes');
|
|
318
|
-
expect(stdout).toContain('--no-input');
|
|
319
|
-
expect(stdout).toContain('Global Options:');
|
|
320
|
-
expect(stdout.match(/--project-dir <path>/g)).toHaveLength(1);
|
|
321
|
-
expect(stdout).not.toContain('Commands:');
|
|
322
|
-
expect(stdout).not.toContain('setup demo');
|
|
323
|
-
expect(stdout).not.toContain('setup context');
|
|
324
|
-
for (const hiddenFlag of [
|
|
325
|
-
'--agent-scope',
|
|
326
|
-
'--skip-agents',
|
|
327
|
-
'--llm-backend',
|
|
328
|
-
'--anthropic-api-key-env',
|
|
329
|
-
'--vertex-project',
|
|
330
|
-
'--embedding-backend',
|
|
331
|
-
'--database ',
|
|
332
|
-
'--database-connection-id',
|
|
333
|
-
'--enable-historic-sql',
|
|
334
|
-
'--historic-sql-min-executions',
|
|
335
|
-
'--enable-query-history',
|
|
336
|
-
'--disable-query-history',
|
|
337
|
-
'--query-history-window-days',
|
|
338
|
-
'--query-history-min-executions',
|
|
339
|
-
'--query-history-service-account-pattern',
|
|
340
|
-
'--query-history-redaction-pattern',
|
|
341
|
-
'--skip-databases',
|
|
342
|
-
'--source ',
|
|
343
|
-
'--source-connection-id',
|
|
344
|
-
'--metabase-database-id',
|
|
345
|
-
'--notion-root-page-id',
|
|
346
|
-
'--skip-initial-source-ingest',
|
|
347
|
-
'--skip-sources',
|
|
348
|
-
'--skip-llm',
|
|
349
|
-
'--skip-embeddings',
|
|
350
|
-
'--embedding-model',
|
|
351
|
-
'--embedding-dimensions',
|
|
352
|
-
'--embedding-base-url',
|
|
353
|
-
]) {
|
|
354
|
-
expect(stdout).not.toContain(hiddenFlag);
|
|
355
|
-
}
|
|
356
|
-
expect(stdout).not.toMatch(/^ --project\s/m);
|
|
357
|
-
expect(stdout).not.toContain('primary ' + 'source');
|
|
358
|
-
expect(stdout).not.toContain('primary ' + 'sources');
|
|
359
|
-
expect(testIo.stderr()).toBe('');
|
|
360
|
-
});
|
|
361
|
-
it('prints help for bare ktx outside a TTY', async () => {
|
|
362
|
-
const setup = vi.fn(async () => 0);
|
|
363
|
-
const testIo = makeIo({ stdoutIsTty: false });
|
|
364
|
-
await expect(runKtxCli([], testIo.io, { setup })).resolves.toBe(0);
|
|
365
|
-
expect(testIo.stdout()).toContain('Usage: ktx [options] [command]');
|
|
366
|
-
expect(setup).not.toHaveBeenCalled();
|
|
367
|
-
expect(testIo.stderr()).toBe('');
|
|
368
|
-
});
|
|
369
|
-
it('keeps representative JSON command stdout parseable', async () => {
|
|
370
|
-
const projectDir = join(tempDir, 'project');
|
|
371
|
-
await initKtxProject({ projectDir });
|
|
372
|
-
const commands = [
|
|
373
|
-
['--project-dir', projectDir, 'status', '--json'],
|
|
374
|
-
['--project-dir', projectDir, 'sl', '--json'],
|
|
375
|
-
];
|
|
376
|
-
for (const argv of commands) {
|
|
377
|
-
const testIo = makeIo();
|
|
378
|
-
const code = await runKtxCli(argv, testIo.io);
|
|
379
|
-
expect([0, 1]).toContain(code);
|
|
380
|
-
expect(() => JSON.parse(testIo.stdout())).not.toThrow();
|
|
381
|
-
expect(testIo.stderr()).toBe('');
|
|
382
|
-
}
|
|
383
|
-
});
|
|
384
|
-
it('starts setup for bare ktx in a TTY when no project is discoverable', async () => {
|
|
385
|
-
const { mkdtemp, realpath, rm } = await import('node:fs/promises');
|
|
386
|
-
const { tmpdir } = await import('node:os');
|
|
387
|
-
const { join } = await import('node:path');
|
|
388
|
-
const originalCwd = process.cwd();
|
|
389
|
-
const tempDir = await mkdtemp(join(tmpdir(), 'ktx-bare-setup-'));
|
|
390
|
-
const setup = vi.fn(async () => 0);
|
|
391
|
-
const testIo = makeIo({ stdoutIsTty: true });
|
|
392
|
-
const previousProjectDir = process.env.KTX_PROJECT_DIR;
|
|
393
|
-
const expectedProjectDir = await realpath(tempDir);
|
|
394
|
-
try {
|
|
395
|
-
delete process.env.KTX_PROJECT_DIR;
|
|
396
|
-
process.chdir(tempDir);
|
|
397
|
-
await expect(runKtxCli([], testIo.io, { setup })).resolves.toBe(0);
|
|
398
|
-
expect(setup).toHaveBeenCalledWith({
|
|
399
|
-
command: 'run',
|
|
400
|
-
projectDir: expectedProjectDir,
|
|
401
|
-
mode: 'auto',
|
|
402
|
-
agents: false,
|
|
403
|
-
agentScope: 'project',
|
|
404
|
-
skipAgents: false,
|
|
405
|
-
inputMode: 'auto',
|
|
406
|
-
yes: false,
|
|
407
|
-
cliVersion,
|
|
408
|
-
skipLlm: false,
|
|
409
|
-
skipEmbeddings: false,
|
|
410
|
-
databaseSchemas: [],
|
|
411
|
-
skipDatabases: false,
|
|
412
|
-
skipSources: false,
|
|
413
|
-
}, testIo.io);
|
|
414
|
-
expect(testIo.stdout()).not.toContain('Usage: ktx [options] [command]');
|
|
415
|
-
expect(testIo.stderr()).toBe('');
|
|
416
|
-
}
|
|
417
|
-
finally {
|
|
418
|
-
process.chdir(originalCwd);
|
|
419
|
-
if (previousProjectDir === undefined) {
|
|
420
|
-
delete process.env.KTX_PROJECT_DIR;
|
|
421
|
-
}
|
|
422
|
-
else {
|
|
423
|
-
process.env.KTX_PROJECT_DIR = previousProjectDir;
|
|
424
|
-
}
|
|
425
|
-
await rm(tempDir, { recursive: true, force: true });
|
|
426
|
-
}
|
|
427
|
-
});
|
|
428
|
-
it('prints help without project status for bare ktx in a TTY when a project is discoverable', async () => {
|
|
429
|
-
const { mkdtemp, realpath, rm, writeFile } = await import('node:fs/promises');
|
|
430
|
-
const { tmpdir } = await import('node:os');
|
|
431
|
-
const { join } = await import('node:path');
|
|
432
|
-
const originalCwd = process.cwd();
|
|
433
|
-
const previousProjectDir = process.env.KTX_PROJECT_DIR;
|
|
434
|
-
const tempDir = await mkdtemp(join(tmpdir(), 'ktx-bare-existing-'));
|
|
435
|
-
const setup = vi.fn(async () => 0);
|
|
436
|
-
const testIo = makeIo({ stdoutIsTty: true });
|
|
437
|
-
const expectedProjectDir = await realpath(tempDir);
|
|
438
|
-
try {
|
|
439
|
-
delete process.env.KTX_PROJECT_DIR;
|
|
440
|
-
await writeFile(join(tempDir, 'ktx.yaml'), 'connections: {}\n', 'utf-8');
|
|
441
|
-
process.chdir(tempDir);
|
|
442
|
-
await expect(runKtxCli([], testIo.io, { setup })).resolves.toBe(0);
|
|
443
|
-
expect(testIo.stdout()).toContain('Usage: ktx [options] [command]');
|
|
444
|
-
expect(testIo.stdout()).not.toContain(`Project: ${expectedProjectDir}`);
|
|
445
|
-
expect(setup).not.toHaveBeenCalled();
|
|
446
|
-
}
|
|
447
|
-
finally {
|
|
448
|
-
process.chdir(originalCwd);
|
|
449
|
-
if (previousProjectDir === undefined) {
|
|
450
|
-
delete process.env.KTX_PROJECT_DIR;
|
|
451
|
-
}
|
|
452
|
-
else {
|
|
453
|
-
process.env.KTX_PROJECT_DIR = previousProjectDir;
|
|
454
|
-
}
|
|
455
|
-
await rm(tempDir, { recursive: true, force: true });
|
|
456
|
-
}
|
|
457
|
-
});
|
|
458
|
-
it('does not invoke status for bare ktx in a TTY when status would fail', async () => {
|
|
459
|
-
const setup = vi.fn(async () => {
|
|
460
|
-
throw new Error('Unsupported ingest.llm: use top-level llm.provider, llm.models, and ingest.workUnits');
|
|
461
|
-
});
|
|
462
|
-
const testIo = makeIo({ stdoutIsTty: true });
|
|
463
|
-
const previousProjectDir = process.env.KTX_PROJECT_DIR;
|
|
464
|
-
try {
|
|
465
|
-
process.env.KTX_PROJECT_DIR = tempDir;
|
|
466
|
-
await expect(runKtxCli([], testIo.io, { setup })).resolves.toBe(0);
|
|
467
|
-
expect(testIo.stdout()).toContain('Usage: ktx [options] [command]');
|
|
468
|
-
expect(setup).not.toHaveBeenCalled();
|
|
469
|
-
expect(testIo.stderr()).toBe('');
|
|
470
|
-
}
|
|
471
|
-
finally {
|
|
472
|
-
if (previousProjectDir === undefined) {
|
|
473
|
-
delete process.env.KTX_PROJECT_DIR;
|
|
474
|
-
}
|
|
475
|
-
else {
|
|
476
|
-
process.env.KTX_PROJECT_DIR = previousProjectDir;
|
|
477
|
-
}
|
|
478
|
-
}
|
|
479
|
-
});
|
|
480
|
-
it('rejects removed verbose global option through Commander', async () => {
|
|
481
|
-
const testIo = makeIo();
|
|
482
|
-
const removedVerboseOption = '--' + 'verbose';
|
|
483
|
-
await expect(runKtxCli([removedVerboseOption, 'connection', 'list'], testIo.io)).resolves.toBe(1);
|
|
484
|
-
expect(testIo.stderr()).toContain(`unknown option '${removedVerboseOption}'`);
|
|
485
|
-
expect(testIo.stdout()).toBe('');
|
|
486
|
-
});
|
|
487
|
-
it('rejects removed shell completion commands', async () => {
|
|
488
|
-
const completionIo = makeIo();
|
|
489
|
-
const hiddenIo = makeIo();
|
|
490
|
-
await expect(runKtxCli(['admin', 'completion', 'zsh'], completionIo.io)).resolves.toBe(1);
|
|
491
|
-
await expect(runKtxCli(['admin', '__complete', '--shell', 'zsh', '--position', '2', '--', 'ktx', 'co'], hiddenIo.io)).resolves.toBe(1);
|
|
492
|
-
expect(completionIo.stderr()).toMatch(/unknown command|error:/);
|
|
493
|
-
expect(hiddenIo.stderr()).toMatch(/unknown command|error:/);
|
|
494
|
-
});
|
|
495
|
-
it('rejects removed serve commands', async () => {
|
|
496
|
-
const testIo = makeIo();
|
|
497
|
-
await expect(runKtxCli(['--project-dir', tempDir, 'serve', '--mcp', 'stdio', '--user-id', 'agent'], testIo.io))
|
|
498
|
-
.resolves.toBe(1);
|
|
499
|
-
expect(testIo.stderr()).toMatch(/unknown command|error:/);
|
|
500
|
-
});
|
|
501
|
-
it('routes public connection-centric ingest shorthand', async () => {
|
|
502
|
-
const testIo = makeIo();
|
|
503
|
-
const publicIngest = vi.fn().mockResolvedValue(0);
|
|
504
|
-
await expect(runKtxCli(['--project-dir', tempDir, 'ingest', 'warehouse', '--fast', '--no-input'], testIo.io, {
|
|
505
|
-
publicIngest,
|
|
506
|
-
})).resolves.toBe(0);
|
|
507
|
-
expect(publicIngest).toHaveBeenCalledWith({
|
|
508
|
-
command: 'run',
|
|
509
|
-
projectDir: tempDir,
|
|
510
|
-
targetConnectionId: 'warehouse',
|
|
511
|
-
all: false,
|
|
512
|
-
json: false,
|
|
513
|
-
inputMode: 'disabled',
|
|
514
|
-
depth: 'fast',
|
|
515
|
-
queryHistory: 'default',
|
|
516
|
-
cliVersion,
|
|
517
|
-
runtimeInstallPolicy: 'never',
|
|
518
|
-
}, testIo.io);
|
|
519
|
-
expect(testIo.stderr()).toBe(`Project: ${tempDir}\n`);
|
|
520
|
-
});
|
|
521
|
-
it('routes public ingest --all --deep with JSON output', async () => {
|
|
522
|
-
const testIo = makeIo();
|
|
523
|
-
const publicIngest = vi.fn().mockResolvedValue(0);
|
|
524
|
-
await expect(runKtxCli(['--project-dir', tempDir, 'ingest', '--all', '--deep', '--json'], testIo.io, {
|
|
525
|
-
publicIngest,
|
|
526
|
-
})).resolves.toBe(0);
|
|
527
|
-
expect(publicIngest).toHaveBeenCalledWith({
|
|
528
|
-
command: 'run',
|
|
529
|
-
projectDir: tempDir,
|
|
530
|
-
all: true,
|
|
531
|
-
json: true,
|
|
532
|
-
inputMode: 'auto',
|
|
533
|
-
depth: 'deep',
|
|
534
|
-
queryHistory: 'default',
|
|
535
|
-
cliVersion,
|
|
536
|
-
runtimeInstallPolicy: 'prompt',
|
|
537
|
-
}, testIo.io);
|
|
538
|
-
expect(testIo.stderr()).toBe('');
|
|
539
|
-
});
|
|
540
|
-
it('routes public ingest --yes as automatic runtime installation', async () => {
|
|
541
|
-
const testIo = makeIo();
|
|
542
|
-
const publicIngest = vi.fn().mockResolvedValue(0);
|
|
543
|
-
await expect(runKtxCli(['--project-dir', tempDir, 'ingest', 'warehouse', '--yes'], testIo.io, {
|
|
544
|
-
publicIngest,
|
|
545
|
-
})).resolves.toBe(0);
|
|
546
|
-
expect(publicIngest).toHaveBeenCalledWith(expect.objectContaining({
|
|
547
|
-
projectDir: tempDir,
|
|
548
|
-
targetConnectionId: 'warehouse',
|
|
549
|
-
runtimeInstallPolicy: 'auto',
|
|
550
|
-
}), testIo.io);
|
|
551
|
-
});
|
|
552
|
-
it('rejects conflicting public ingest runtime install modes', async () => {
|
|
553
|
-
const testIo = makeIo();
|
|
554
|
-
const publicIngest = vi.fn().mockResolvedValue(0);
|
|
555
|
-
await expect(runKtxCli(['--project-dir', tempDir, 'ingest', 'warehouse', '--yes', '--no-input'], testIo.io, {
|
|
556
|
-
publicIngest,
|
|
557
|
-
})).resolves.toBe(1);
|
|
558
|
-
expect(publicIngest).not.toHaveBeenCalled();
|
|
559
|
-
expect(testIo.stderr()).toContain('Choose only one runtime install mode: --yes or --no-input');
|
|
560
|
-
});
|
|
561
|
-
it('rejects mutually exclusive public ingest depth flags before dispatch', async () => {
|
|
562
|
-
const testIo = makeIo();
|
|
563
|
-
const publicIngest = vi.fn().mockResolvedValue(0);
|
|
564
|
-
await expect(runKtxCli(['--project-dir', '/tmp/project', 'ingest', 'warehouse', '--fast', '--deep'], testIo.io, {
|
|
565
|
-
publicIngest,
|
|
566
|
-
})).resolves.toBe(1);
|
|
567
|
-
expect(publicIngest).not.toHaveBeenCalled();
|
|
568
|
-
expect(testIo.stderr()).toMatch(/option '--(deep|fast)' cannot be used with option '--(fast|deep)'/);
|
|
569
|
-
});
|
|
570
|
-
it.each(['run', 'status', 'watch', 'replay'])('routes former ingest subcommand name "%s" as a connection id', async (connectionId) => {
|
|
571
|
-
const testIo = makeIo();
|
|
572
|
-
const publicIngest = vi.fn(async () => 0);
|
|
573
|
-
await expect(runKtxCli(['--project-dir', tempDir, 'ingest', connectionId, '--no-input'], testIo.io, {
|
|
574
|
-
publicIngest,
|
|
575
|
-
})).resolves.toBe(0);
|
|
576
|
-
expect(publicIngest).toHaveBeenCalledWith({
|
|
577
|
-
command: 'run',
|
|
578
|
-
projectDir: tempDir,
|
|
579
|
-
targetConnectionId: connectionId,
|
|
580
|
-
all: false,
|
|
581
|
-
json: false,
|
|
582
|
-
inputMode: 'disabled',
|
|
583
|
-
queryHistory: 'default',
|
|
584
|
-
cliVersion,
|
|
585
|
-
runtimeInstallPolicy: 'never',
|
|
586
|
-
}, testIo.io);
|
|
587
|
-
});
|
|
588
|
-
it('rejects standalone demo commands', async () => {
|
|
589
|
-
const testIo = makeIo();
|
|
590
|
-
await expect(runKtxCli(['demo', '--mode', 'replay', '--no-input'], testIo.io)).resolves.toBe(1);
|
|
591
|
-
expect(testIo.stderr()).toMatch(/unknown command|error:/i);
|
|
592
|
-
});
|
|
593
|
-
it('rejects removed setup subcommands', async () => {
|
|
594
|
-
const setup = vi.fn(async () => 0);
|
|
595
|
-
const cases = [
|
|
596
|
-
['setup', 'demo', '--mode', 'replay', '--no-input'],
|
|
597
|
-
['setup', '--no-input', 'demo', '--mode', 'seeded'],
|
|
598
|
-
['setup', 'demo', 'ingest', '--mode', 'full', '--no-input'],
|
|
599
|
-
['setup', 'context', 'build'],
|
|
600
|
-
['setup', 'context', 'watch', 'setup-context-local-1'],
|
|
601
|
-
['setup', 'context', 'status', 'setup-context-local-1', '--json'],
|
|
602
|
-
['setup', 'context', 'stop', 'setup-context-local-1'],
|
|
603
|
-
['setup', 'remove', '--agents'],
|
|
604
|
-
['setup', 'status', '--json'],
|
|
605
|
-
];
|
|
606
|
-
for (const args of cases) {
|
|
607
|
-
const testIo = makeIo();
|
|
608
|
-
await expect(runKtxCli(['--project-dir', tempDir, ...args], testIo.io, { setup })).resolves.toBe(1);
|
|
609
|
-
expect(testIo.stderr()).toMatch(/unknown command|error:/i);
|
|
610
|
-
}
|
|
611
|
-
expect(setup).not.toHaveBeenCalled();
|
|
612
|
-
});
|
|
613
|
-
it('rejects removed setup options', async () => {
|
|
614
|
-
const setup = vi.fn(async () => 0);
|
|
615
|
-
const cases = [
|
|
616
|
-
['setup', '--new'],
|
|
617
|
-
['setup', '--existing'],
|
|
618
|
-
['setup', '--project'],
|
|
619
|
-
['setup', '--agent-scope', 'global'],
|
|
620
|
-
['setup', '--anthropic-model', 'claude-sonnet-4-6'],
|
|
621
|
-
['setup', '--new-database-connection-id', 'warehouse'],
|
|
622
|
-
['setup', '--skip-initial-source-ingest'],
|
|
623
|
-
];
|
|
624
|
-
for (const args of cases) {
|
|
625
|
-
const testIo = makeIo();
|
|
626
|
-
await expect(runKtxCli(['--project-dir', tempDir, ...args], testIo.io, { setup })).resolves.toBe(1);
|
|
627
|
-
expect(testIo.stderr()).toMatch(/unknown option|error:/i);
|
|
628
|
-
}
|
|
629
|
-
expect(setup).not.toHaveBeenCalled();
|
|
630
|
-
});
|
|
631
|
-
it('prints ingest help without invoking ingest execution', async () => {
|
|
632
|
-
const testIo = makeIo();
|
|
633
|
-
const publicIngest = vi.fn();
|
|
634
|
-
await expect(runKtxCli(['ingest', '--help'], testIo.io, { publicIngest })).resolves.toBe(0);
|
|
635
|
-
expect(testIo.stdout()).toContain('Usage: ktx ingest');
|
|
636
|
-
expect(testIo.stdout()).toContain('Build or inspect KTX context');
|
|
637
|
-
expect(testIo.stdout()).toContain('--all');
|
|
638
|
-
expect(testIo.stdout()).toContain('--fast');
|
|
639
|
-
expect(testIo.stdout()).toContain('--deep');
|
|
640
|
-
expect(testIo.stdout()).toContain('--query-history');
|
|
641
|
-
expect(testIo.stdout()).toContain('--no-query-history');
|
|
642
|
-
expect(testIo.stdout()).toContain('--query-history-window-days <days>');
|
|
643
|
-
expect(testIo.stdout()).toContain('--text');
|
|
644
|
-
expect(testIo.stdout()).toContain('--file');
|
|
645
|
-
expect(testIo.stdout()).not.toMatch(/^ status\s/m);
|
|
646
|
-
expect(testIo.stdout()).not.toMatch(/^ replay\s/m);
|
|
647
|
-
expect(testIo.stdout()).not.toMatch(/^ run\s/m);
|
|
648
|
-
expect(testIo.stdout()).not.toMatch(/^ watch\s/m);
|
|
649
|
-
expect(testIo.stdout()).not.toContain('--manifest');
|
|
650
|
-
expect(testIo.stderr()).toBe('');
|
|
651
|
-
expect(publicIngest).not.toHaveBeenCalled();
|
|
652
|
-
});
|
|
653
|
-
it('routes text memory ingest through Commander without exposing chat ids', async () => {
|
|
654
|
-
const textIngest = vi.fn(async () => 0);
|
|
655
|
-
const testIo = makeIo();
|
|
656
|
-
await expect(runKtxCli([
|
|
657
|
-
'--project-dir',
|
|
658
|
-
tempDir,
|
|
659
|
-
'ingest',
|
|
660
|
-
'--text',
|
|
661
|
-
'Revenue means gross receipts.',
|
|
662
|
-
'--text',
|
|
663
|
-
'Orders are completed purchases.',
|
|
664
|
-
'--connection-id',
|
|
665
|
-
'warehouse',
|
|
666
|
-
'--user-id',
|
|
667
|
-
'agent',
|
|
668
|
-
'--json',
|
|
669
|
-
'--fail-fast',
|
|
670
|
-
], testIo.io, { textIngest })).resolves.toBe(0);
|
|
671
|
-
expect(textIngest).toHaveBeenCalledWith({
|
|
672
|
-
projectDir: tempDir,
|
|
673
|
-
texts: ['Revenue means gross receipts.', 'Orders are completed purchases.'],
|
|
674
|
-
files: [],
|
|
675
|
-
connectionId: 'warehouse',
|
|
676
|
-
userId: 'agent',
|
|
677
|
-
json: true,
|
|
678
|
-
failFast: true,
|
|
679
|
-
}, testIo.io);
|
|
680
|
-
expect(testIo.stderr()).toBe('');
|
|
681
|
-
});
|
|
682
|
-
it('rejects a positional connection id when --text is supplied', async () => {
|
|
683
|
-
const textIngest = vi.fn(async () => 0);
|
|
684
|
-
const publicIngest = vi.fn(async () => 0);
|
|
685
|
-
const testIo = makeIo();
|
|
686
|
-
await expect(runKtxCli(['--project-dir', tempDir, 'ingest', 'warehouse', '--text', 'hello'], testIo.io, { textIngest, publicIngest })).resolves.toBe(1);
|
|
687
|
-
expect(textIngest).not.toHaveBeenCalled();
|
|
688
|
-
expect(publicIngest).not.toHaveBeenCalled();
|
|
689
|
-
expect(testIo.stderr()).toMatch(/--text\/--file does not accept a positional connection id/);
|
|
690
|
-
});
|
|
691
|
-
it('treats bare ingest as ingest --all', async () => {
|
|
692
|
-
const publicIngest = vi.fn().mockResolvedValue(0);
|
|
693
|
-
const testIo = makeIo();
|
|
694
|
-
await expect(runKtxCli(['--project-dir', tempDir, 'ingest', '--no-input'], testIo.io, { publicIngest })).resolves.toBe(0);
|
|
695
|
-
expect(publicIngest).toHaveBeenCalledWith(expect.objectContaining({
|
|
696
|
-
command: 'run',
|
|
697
|
-
projectDir: tempDir,
|
|
698
|
-
all: true,
|
|
699
|
-
}), testIo.io);
|
|
700
|
-
const args = publicIngest.mock.calls[0]?.[0];
|
|
701
|
-
expect(args.targetConnectionId).toBeUndefined();
|
|
702
|
-
});
|
|
703
|
-
it('rejects old adapter-backed ingest flags at the top level and under admin', async () => {
|
|
704
|
-
const rootRunIo = makeIo();
|
|
705
|
-
const devRunIo = makeIo();
|
|
706
|
-
const publicIngest = vi.fn(async () => 0);
|
|
707
|
-
await expect(runKtxCli(['ingest', 'run', '--connection-id', 'warehouse', '--adapter', 'metabase'], rootRunIo.io, {
|
|
708
|
-
publicIngest,
|
|
709
|
-
})).resolves.toBe(1);
|
|
710
|
-
await expect(runKtxCli(['admin', 'ingest', 'run', '--connection-id', 'warehouse', '--adapter', 'metabase'], devRunIo.io, {
|
|
711
|
-
publicIngest,
|
|
712
|
-
})).resolves.toBe(1);
|
|
713
|
-
expect(publicIngest).not.toHaveBeenCalled();
|
|
714
|
-
expect(rootRunIo.stderr()).toMatch(/unknown option '--connection-id'|error:/);
|
|
715
|
-
expect(devRunIo.stderr()).toMatch(/unknown command|error:/);
|
|
716
|
-
});
|
|
717
|
-
it('rejects removed admin doctor and removed ingest parser cases', async () => {
|
|
718
|
-
const doctor = vi.fn(async () => 0);
|
|
719
|
-
const doctorIo = makeIo();
|
|
720
|
-
const ingestRunIo = makeIo();
|
|
721
|
-
await expect(runKtxCli(['admin', 'doctor', 'setup', '--json', '--no-input'], doctorIo.io, { doctor })).resolves.toBe(1);
|
|
722
|
-
await expect(runKtxCli([
|
|
723
|
-
'ingest',
|
|
724
|
-
'run',
|
|
725
|
-
'--project-dir',
|
|
726
|
-
tempDir,
|
|
727
|
-
'--connection-id',
|
|
728
|
-
'warehouse',
|
|
729
|
-
'--adapter',
|
|
730
|
-
'fake',
|
|
731
|
-
'--source-dir',
|
|
732
|
-
tempDir,
|
|
733
|
-
'--debug-llm-request-file',
|
|
734
|
-
`${tempDir}/debug.jsonl`,
|
|
735
|
-
'--json',
|
|
736
|
-
'--no-input',
|
|
737
|
-
], ingestRunIo.io, {})).resolves.toBe(1);
|
|
738
|
-
expect(doctor).not.toHaveBeenCalled();
|
|
739
|
-
expect(doctorIo.stderr()).toMatch(/unknown command|error:/);
|
|
740
|
-
expect(ingestRunIo.stderr()).toMatch(/unknown option '--connection-id'|error:/);
|
|
741
|
-
});
|
|
742
|
-
it('dispatches public connection through the existing connection implementation', async () => {
|
|
743
|
-
const testIo = makeIo();
|
|
744
|
-
const connection = vi.fn(async () => 0);
|
|
745
|
-
await expect(runKtxCli(['--project-dir', tempDir, 'connection', 'list'], testIo.io, { connection })).resolves.toBe(0);
|
|
746
|
-
expect(connection).toHaveBeenCalledWith({ command: 'list', projectDir: tempDir }, testIo.io);
|
|
747
|
-
expect(testIo.stderr()).toBe(`Project: ${tempDir}\n`);
|
|
748
|
-
});
|
|
749
|
-
it('routes top-level status through doctor', async () => {
|
|
750
|
-
const setup = vi.fn(async () => 0);
|
|
751
|
-
const doctor = vi.fn(async () => 0);
|
|
752
|
-
const statusIo = makeIo();
|
|
753
|
-
await expect(runKtxCli(['--project-dir', tempDir, 'status', '--json', '--no-input'], statusIo.io, { setup, doctor })).resolves.toBe(0);
|
|
754
|
-
expect(setup).not.toHaveBeenCalled();
|
|
755
|
-
expect(doctor).toHaveBeenCalledWith({ command: 'project', projectDir: tempDir, outputMode: 'json', inputMode: 'disabled', verbose: false, fast: false }, statusIo.io);
|
|
756
|
-
expect(statusIo.stderr()).toBe('');
|
|
757
|
-
});
|
|
758
|
-
it('routes top-level status without a project to setup doctor checks', async () => {
|
|
759
|
-
const { mkdtemp, rm } = await import('node:fs/promises');
|
|
760
|
-
const { tmpdir } = await import('node:os');
|
|
761
|
-
const { join } = await import('node:path');
|
|
762
|
-
const originalCwd = process.cwd();
|
|
763
|
-
const previousProjectDir = process.env.KTX_PROJECT_DIR;
|
|
764
|
-
const tempCwd = await mkdtemp(join(tmpdir(), 'ktx-status-no-project-'));
|
|
765
|
-
const doctor = vi.fn(async () => 0);
|
|
766
|
-
const statusIo = makeIo();
|
|
767
|
-
try {
|
|
768
|
-
delete process.env.KTX_PROJECT_DIR;
|
|
769
|
-
process.chdir(tempCwd);
|
|
770
|
-
await expect(runKtxCli(['status', '--json', '--no-input'], statusIo.io, { doctor })).resolves.toBe(0);
|
|
771
|
-
expect(doctor).toHaveBeenCalledWith({ command: 'setup', outputMode: 'json', inputMode: 'disabled', verbose: false }, statusIo.io);
|
|
772
|
-
expect(statusIo.stderr()).toBe('');
|
|
773
|
-
}
|
|
774
|
-
finally {
|
|
775
|
-
process.chdir(originalCwd);
|
|
776
|
-
if (previousProjectDir === undefined) {
|
|
777
|
-
delete process.env.KTX_PROJECT_DIR;
|
|
778
|
-
}
|
|
779
|
-
else {
|
|
780
|
-
process.env.KTX_PROJECT_DIR = previousProjectDir;
|
|
781
|
-
}
|
|
782
|
-
await rm(tempCwd, { recursive: true, force: true });
|
|
783
|
-
}
|
|
784
|
-
});
|
|
785
|
-
it('dispatches Anthropic setup flags to the setup runner', async () => {
|
|
786
|
-
const setup = vi.fn(async () => 0);
|
|
787
|
-
const setupIo = makeIo();
|
|
788
|
-
await expect(runKtxCli([
|
|
789
|
-
'--project-dir',
|
|
790
|
-
tempDir,
|
|
791
|
-
'setup',
|
|
792
|
-
'--no-input',
|
|
793
|
-
'--anthropic-api-key-env',
|
|
794
|
-
'ANTHROPIC_API_KEY',
|
|
795
|
-
'--llm-model',
|
|
796
|
-
'claude-sonnet-4-6',
|
|
797
|
-
], setupIo.io, { setup })).resolves.toBe(0);
|
|
798
|
-
expect(setup).toHaveBeenCalledWith(expect.objectContaining({
|
|
799
|
-
command: 'run',
|
|
800
|
-
projectDir: tempDir,
|
|
801
|
-
inputMode: 'disabled',
|
|
802
|
-
cliVersion,
|
|
803
|
-
anthropicApiKeyEnv: 'ANTHROPIC_API_KEY', // pragma: allowlist secret
|
|
804
|
-
llmModel: 'claude-sonnet-4-6',
|
|
805
|
-
skipLlm: false,
|
|
806
|
-
}), setupIo.io);
|
|
807
|
-
});
|
|
808
|
-
it('dispatches Vertex AI setup flags to the setup runner', async () => {
|
|
809
|
-
const setup = vi.fn(async () => 0);
|
|
810
|
-
const setupIo = makeIo();
|
|
811
|
-
await expect(runKtxCli([
|
|
812
|
-
'--project-dir',
|
|
813
|
-
tempDir,
|
|
814
|
-
'setup',
|
|
815
|
-
'--no-input',
|
|
816
|
-
'--llm-backend',
|
|
817
|
-
'vertex',
|
|
818
|
-
'--vertex-project',
|
|
819
|
-
'local-gcp-project',
|
|
820
|
-
'--vertex-location',
|
|
821
|
-
'us-east5',
|
|
822
|
-
'--llm-model',
|
|
823
|
-
'claude-sonnet-4-6',
|
|
824
|
-
], setupIo.io, { setup })).resolves.toBe(0);
|
|
825
|
-
expect(setup).toHaveBeenCalledWith(expect.objectContaining({
|
|
826
|
-
command: 'run',
|
|
827
|
-
projectDir: tempDir,
|
|
828
|
-
inputMode: 'disabled',
|
|
829
|
-
cliVersion,
|
|
830
|
-
llmBackend: 'vertex',
|
|
831
|
-
vertexProject: 'local-gcp-project',
|
|
832
|
-
vertexLocation: 'us-east5',
|
|
833
|
-
llmModel: 'claude-sonnet-4-6',
|
|
834
|
-
skipLlm: false,
|
|
835
|
-
}), setupIo.io);
|
|
836
|
-
});
|
|
837
|
-
it('dispatches the provider-neutral LLM model setup flag to the setup runner', async () => {
|
|
838
|
-
const setup = vi.fn(async () => 0);
|
|
839
|
-
const setupIo = makeIo();
|
|
840
|
-
await expect(runKtxCli([
|
|
841
|
-
'--project-dir',
|
|
842
|
-
tempDir,
|
|
843
|
-
'setup',
|
|
844
|
-
'--no-input',
|
|
845
|
-
'--llm-backend',
|
|
846
|
-
'claude-code',
|
|
847
|
-
'--llm-model',
|
|
848
|
-
'opus',
|
|
849
|
-
], setupIo.io, { setup })).resolves.toBe(0);
|
|
850
|
-
expect(setup).toHaveBeenCalledWith(expect.objectContaining({
|
|
851
|
-
command: 'run',
|
|
852
|
-
projectDir: tempDir,
|
|
853
|
-
inputMode: 'disabled',
|
|
854
|
-
cliVersion,
|
|
855
|
-
llmBackend: 'claude-code',
|
|
856
|
-
llmModel: 'opus',
|
|
857
|
-
skipLlm: false,
|
|
858
|
-
}), setupIo.io);
|
|
859
|
-
});
|
|
860
|
-
it('rejects conflicting Anthropic credential setup flags', async () => {
|
|
861
|
-
const setup = vi.fn(async () => 0);
|
|
862
|
-
const setupIo = makeIo();
|
|
863
|
-
await expect(runKtxCli([
|
|
864
|
-
'--project-dir',
|
|
865
|
-
tempDir,
|
|
866
|
-
'setup',
|
|
867
|
-
'--anthropic-api-key-env',
|
|
868
|
-
'ANTHROPIC_API_KEY',
|
|
869
|
-
'--anthropic-api-key-file',
|
|
870
|
-
'/tmp/anthropic-key',
|
|
871
|
-
], setupIo.io, { setup })).resolves.toBe(1);
|
|
872
|
-
expect(setup).not.toHaveBeenCalled();
|
|
873
|
-
expect(setupIo.stderr()).toContain('Choose only one Anthropic credential source');
|
|
874
|
-
});
|
|
875
|
-
it('dispatches embedding setup flags to the setup runner', async () => {
|
|
876
|
-
const setup = vi.fn(async () => 0);
|
|
877
|
-
const setupIo = makeIo();
|
|
878
|
-
await expect(runKtxCli([
|
|
879
|
-
'--project-dir',
|
|
880
|
-
tempDir,
|
|
881
|
-
'setup',
|
|
882
|
-
'--no-input',
|
|
883
|
-
'--skip-llm',
|
|
884
|
-
'--embedding-backend',
|
|
885
|
-
'openai',
|
|
886
|
-
'--embedding-api-key-env',
|
|
887
|
-
'OPENAI_API_KEY',
|
|
888
|
-
], setupIo.io, { setup })).resolves.toBe(0);
|
|
889
|
-
expect(setup).toHaveBeenCalledWith(expect.objectContaining({
|
|
890
|
-
command: 'run',
|
|
891
|
-
projectDir: tempDir,
|
|
892
|
-
inputMode: 'disabled',
|
|
893
|
-
skipLlm: true,
|
|
894
|
-
embeddingBackend: 'openai',
|
|
895
|
-
embeddingApiKeyEnv: 'OPENAI_API_KEY', // pragma: allowlist secret
|
|
896
|
-
skipEmbeddings: false,
|
|
897
|
-
}), setupIo.io);
|
|
898
|
-
});
|
|
899
|
-
it('dispatches database setup flags to the setup runner', async () => {
|
|
900
|
-
const setup = vi.fn(async () => 0);
|
|
901
|
-
const setupIo = makeIo();
|
|
902
|
-
await expect(runKtxCli([
|
|
903
|
-
'setup',
|
|
904
|
-
'--project-dir',
|
|
905
|
-
'/tmp/project',
|
|
906
|
-
'--no-input',
|
|
907
|
-
'--yes',
|
|
908
|
-
'--skip-llm',
|
|
909
|
-
'--skip-embeddings',
|
|
910
|
-
'--database',
|
|
911
|
-
'postgres',
|
|
912
|
-
'--database-connection-id',
|
|
913
|
-
'warehouse',
|
|
914
|
-
'--database-url',
|
|
915
|
-
'env:DATABASE_URL',
|
|
916
|
-
'--database-schema',
|
|
917
|
-
'public',
|
|
918
|
-
'--enable-query-history',
|
|
919
|
-
'--query-history-window-days',
|
|
920
|
-
'30',
|
|
921
|
-
'--query-history-min-executions',
|
|
922
|
-
'12',
|
|
923
|
-
], setupIo.io, { setup })).resolves.toBe(0);
|
|
924
|
-
expect(setup).toHaveBeenCalledWith(expect.objectContaining({
|
|
925
|
-
command: 'run',
|
|
926
|
-
projectDir: '/tmp/project',
|
|
927
|
-
inputMode: 'disabled',
|
|
928
|
-
yes: true,
|
|
929
|
-
cliVersion,
|
|
930
|
-
skipLlm: true,
|
|
931
|
-
skipEmbeddings: true,
|
|
932
|
-
databaseDrivers: ['postgres'],
|
|
933
|
-
databaseConnectionId: 'warehouse',
|
|
934
|
-
databaseUrl: 'env:DATABASE_URL',
|
|
935
|
-
databaseSchemas: ['public'],
|
|
936
|
-
enableQueryHistory: true,
|
|
937
|
-
queryHistoryWindowDays: 30,
|
|
938
|
-
queryHistoryMinExecutions: 12,
|
|
939
|
-
skipDatabases: false,
|
|
940
|
-
}), setupIo.io);
|
|
941
|
-
});
|
|
942
|
-
it('dispatches setup database connection ids that match former ingest subcommand names', async () => {
|
|
943
|
-
const testIo = makeIo();
|
|
944
|
-
const setup = vi.fn(async () => 0);
|
|
945
|
-
await expect(runKtxCli(['setup', '--database-connection-id', 'status', '--no-input'], testIo.io, { setup })).resolves.toBe(0);
|
|
946
|
-
expect(setup).toHaveBeenCalledWith(expect.objectContaining({
|
|
947
|
-
command: 'run',
|
|
948
|
-
databaseConnectionIds: ['status'],
|
|
949
|
-
}), testIo.io);
|
|
950
|
-
});
|
|
951
|
-
it('dispatches non-TTY agents setup with target without requiring --no-input or --yes', async () => {
|
|
952
|
-
const testIo = makeIo({ stdoutIsTty: false });
|
|
953
|
-
const setup = vi.fn(async () => 0);
|
|
954
|
-
await expect(runKtxCli(['--project-dir', tempDir, 'setup', '--agents', '--target', 'claude-code'], testIo.io, { setup })).resolves.toBe(0);
|
|
955
|
-
expect(setup).toHaveBeenCalledWith(expect.objectContaining({
|
|
956
|
-
command: 'run',
|
|
957
|
-
projectDir: tempDir,
|
|
958
|
-
agents: true,
|
|
959
|
-
target: 'claude-code',
|
|
960
|
-
agentScope: 'project',
|
|
961
|
-
inputMode: 'auto',
|
|
962
|
-
yes: false,
|
|
963
|
-
}), testIo.io);
|
|
964
|
-
expect(testIo.stderr()).toBe('');
|
|
965
|
-
});
|
|
966
|
-
it('dispatches setup source flags', async () => {
|
|
967
|
-
const setup = vi.fn(async () => 0);
|
|
968
|
-
const testIo = makeIo();
|
|
969
|
-
await expect(runKtxCli([
|
|
970
|
-
'--project-dir',
|
|
971
|
-
tempDir,
|
|
972
|
-
'setup',
|
|
973
|
-
'--no-input',
|
|
974
|
-
'--source',
|
|
975
|
-
'metabase',
|
|
976
|
-
'--source-connection-id',
|
|
977
|
-
'prod_metabase',
|
|
978
|
-
'--source-url',
|
|
979
|
-
'https://metabase.example.com',
|
|
980
|
-
'--source-api-key-ref',
|
|
981
|
-
'env:METABASE_API_KEY',
|
|
982
|
-
'--source-warehouse-connection-id',
|
|
983
|
-
'warehouse',
|
|
984
|
-
'--metabase-database-id',
|
|
985
|
-
'1',
|
|
986
|
-
'--skip-llm',
|
|
987
|
-
'--skip-embeddings',
|
|
988
|
-
'--skip-databases',
|
|
989
|
-
], testIo.io, { setup })).resolves.toBe(0);
|
|
990
|
-
expect(setup).toHaveBeenCalledWith(expect.objectContaining({
|
|
991
|
-
command: 'run',
|
|
992
|
-
projectDir: tempDir,
|
|
993
|
-
source: 'metabase',
|
|
994
|
-
sourceConnectionId: 'prod_metabase',
|
|
995
|
-
sourceUrl: 'https://metabase.example.com',
|
|
996
|
-
sourceApiKeyRef: 'env:METABASE_API_KEY', // pragma: allowlist secret
|
|
997
|
-
sourceWarehouseConnectionId: 'warehouse',
|
|
998
|
-
metabaseDatabaseId: 1,
|
|
999
|
-
}), testIo.io);
|
|
1000
|
-
});
|
|
1001
|
-
it('dispatches setup agent flags', async () => {
|
|
1002
|
-
const setup = vi.fn(async () => 0);
|
|
1003
|
-
const setupIo = makeIo();
|
|
1004
|
-
await expect(runKtxCli([
|
|
1005
|
-
'--project-dir',
|
|
1006
|
-
tempDir,
|
|
1007
|
-
'setup',
|
|
1008
|
-
'--agents',
|
|
1009
|
-
'--target',
|
|
1010
|
-
'codex',
|
|
1011
|
-
'--no-input',
|
|
1012
|
-
'--yes',
|
|
1013
|
-
], setupIo.io, { setup })).resolves.toBe(0);
|
|
1014
|
-
expect(setup).toHaveBeenCalledWith(expect.objectContaining({
|
|
1015
|
-
command: 'run',
|
|
1016
|
-
agents: true,
|
|
1017
|
-
target: 'codex',
|
|
1018
|
-
agentScope: 'project',
|
|
1019
|
-
inputMode: 'disabled',
|
|
1020
|
-
yes: true,
|
|
1021
|
-
}), setupIo.io);
|
|
1022
|
-
});
|
|
1023
|
-
it('rejects --local with non-Claude targets', async () => {
|
|
1024
|
-
const setup = vi.fn(async () => 0);
|
|
1025
|
-
const setupIo = makeIo();
|
|
1026
|
-
await expect(runKtxCli(['--project-dir', tempDir, 'setup', '--agents', '--target', 'cursor', '--local', '--no-input'], setupIo.io, { setup })).resolves.toBe(1);
|
|
1027
|
-
expect(setupIo.stderr()).toContain('--local is only supported with --target claude-code');
|
|
1028
|
-
expect(setup).not.toHaveBeenCalled();
|
|
1029
|
-
});
|
|
1030
|
-
it('rejects --local and --global together', async () => {
|
|
1031
|
-
const setup = vi.fn(async () => 0);
|
|
1032
|
-
const setupIo = makeIo();
|
|
1033
|
-
await expect(runKtxCli(['--project-dir', tempDir, 'setup', '--agents', '--target', 'claude-code', '--local', '--global', '--no-input'], setupIo.io, { setup })).resolves.toBe(1);
|
|
1034
|
-
expect(setupIo.stderr()).toContain('Choose only one agent scope: --local or --global.');
|
|
1035
|
-
expect(setup).not.toHaveBeenCalled();
|
|
1036
|
-
});
|
|
1037
|
-
it('rejects source-path with source-git-url', async () => {
|
|
1038
|
-
const setup = vi.fn(async () => 0);
|
|
1039
|
-
const testIo = makeIo();
|
|
1040
|
-
await expect(runKtxCli([
|
|
1041
|
-
'--project-dir',
|
|
1042
|
-
tempDir,
|
|
1043
|
-
'setup',
|
|
1044
|
-
'--no-input',
|
|
1045
|
-
'--source',
|
|
1046
|
-
'dbt',
|
|
1047
|
-
'--source-path',
|
|
1048
|
-
'/repo/dbt',
|
|
1049
|
-
'--source-git-url',
|
|
1050
|
-
'https://github.com/acme/dbt.git',
|
|
1051
|
-
], testIo.io, { setup })).resolves.toBe(1);
|
|
1052
|
-
expect(setup).not.toHaveBeenCalled();
|
|
1053
|
-
expect(testIo.stderr()).toContain('Choose only one source location');
|
|
1054
|
-
});
|
|
1055
|
-
it('rejects deterministic as a setup embedding backend', async () => {
|
|
1056
|
-
const setup = vi.fn(async () => 0);
|
|
1057
|
-
const setupIo = makeIo();
|
|
1058
|
-
await expect(runKtxCli(['--project-dir', tempDir, 'setup', '--embedding-backend', 'deterministic'], setupIo.io, { setup })).resolves.toBe(1);
|
|
1059
|
-
expect(setup).not.toHaveBeenCalled();
|
|
1060
|
-
expect(setupIo.stderr()).toContain("invalid choice 'deterministic'");
|
|
1061
|
-
});
|
|
1062
|
-
it('rejects gateway as a setup embedding backend', async () => {
|
|
1063
|
-
const setup = vi.fn(async () => 0);
|
|
1064
|
-
const setupIo = makeIo();
|
|
1065
|
-
await expect(runKtxCli(['--project-dir', tempDir, 'setup', '--embedding-backend', 'gateway'], setupIo.io, { setup })).resolves.toBe(1);
|
|
1066
|
-
expect(setup).not.toHaveBeenCalled();
|
|
1067
|
-
expect(setupIo.stderr()).toContain("invalid choice 'gateway'");
|
|
1068
|
-
});
|
|
1069
|
-
it('rejects conflicting embedding credential setup flags', async () => {
|
|
1070
|
-
const setup = vi.fn(async () => 0);
|
|
1071
|
-
const setupIo = makeIo();
|
|
1072
|
-
await expect(runKtxCli([
|
|
1073
|
-
'--project-dir',
|
|
1074
|
-
tempDir,
|
|
1075
|
-
'setup',
|
|
1076
|
-
'--embedding-backend',
|
|
1077
|
-
'openai',
|
|
1078
|
-
'--embedding-api-key-env',
|
|
1079
|
-
'OPENAI_API_KEY',
|
|
1080
|
-
'--embedding-api-key-file',
|
|
1081
|
-
'/tmp/openai-key',
|
|
1082
|
-
], setupIo.io, { setup })).resolves.toBe(1);
|
|
1083
|
-
expect(setup).not.toHaveBeenCalled();
|
|
1084
|
-
expect(setupIo.stderr()).toContain('Choose only one embedding credential source');
|
|
1085
|
-
});
|
|
1086
|
-
it('rejects conflicting query-history setup flags', async () => {
|
|
1087
|
-
const setup = vi.fn(async () => 0);
|
|
1088
|
-
const setupIo = makeIo();
|
|
1089
|
-
await expect(runKtxCli(['--project-dir', tempDir, 'setup', '--enable-query-history', '--disable-query-history'], setupIo.io, {
|
|
1090
|
-
setup,
|
|
1091
|
-
})).resolves.toBe(1);
|
|
1092
|
-
expect(setup).not.toHaveBeenCalled();
|
|
1093
|
-
expect(setupIo.stderr()).toContain('Choose only one query-history action: --enable-query-history or --disable-query-history.');
|
|
1094
|
-
});
|
|
1095
|
-
it('rejects the removed hidden agent command', async () => {
|
|
1096
|
-
const io = makeIo();
|
|
1097
|
-
await expect(runKtxCli(['agent'], io.io)).resolves.toBe(1);
|
|
1098
|
-
expect(io.stderr()).toContain("unknown command 'agent'");
|
|
1099
|
-
expect(io.stdout()).toBe('');
|
|
1100
|
-
});
|
|
1101
|
-
it('routes public SL query files with managed runtime policies', async () => {
|
|
1102
|
-
const autoIo = makeIo();
|
|
1103
|
-
const neverIo = makeIo();
|
|
1104
|
-
const conflictIo = makeIo();
|
|
1105
|
-
const sl = vi.fn(async () => 0);
|
|
1106
|
-
await expect(runKtxCli([
|
|
1107
|
-
'--project-dir',
|
|
1108
|
-
tempDir,
|
|
1109
|
-
'sl',
|
|
1110
|
-
'query',
|
|
1111
|
-
'--connection-id',
|
|
1112
|
-
'warehouse',
|
|
1113
|
-
'--query-file',
|
|
1114
|
-
'/tmp/query.json',
|
|
1115
|
-
'--yes',
|
|
1116
|
-
], autoIo.io, { sl })).resolves.toBe(0);
|
|
1117
|
-
await expect(runKtxCli([
|
|
1118
|
-
'--project-dir',
|
|
1119
|
-
tempDir,
|
|
1120
|
-
'sl',
|
|
1121
|
-
'query',
|
|
1122
|
-
'--connection-id',
|
|
1123
|
-
'warehouse',
|
|
1124
|
-
'--query-file',
|
|
1125
|
-
'/tmp/query.json',
|
|
1126
|
-
'--no-input',
|
|
1127
|
-
], neverIo.io, { sl })).resolves.toBe(0);
|
|
1128
|
-
await expect(runKtxCli([
|
|
1129
|
-
'--project-dir',
|
|
1130
|
-
tempDir,
|
|
1131
|
-
'sl',
|
|
1132
|
-
'query',
|
|
1133
|
-
'--connection-id',
|
|
1134
|
-
'warehouse',
|
|
1135
|
-
'--query-file',
|
|
1136
|
-
'/tmp/query.json',
|
|
1137
|
-
'--yes',
|
|
1138
|
-
'--no-input',
|
|
1139
|
-
], conflictIo.io, { sl })).resolves.toBe(1);
|
|
1140
|
-
expect(sl).toHaveBeenNthCalledWith(1, {
|
|
1141
|
-
command: 'query',
|
|
1142
|
-
projectDir: tempDir,
|
|
1143
|
-
connectionId: 'warehouse',
|
|
1144
|
-
queryFile: '/tmp/query.json',
|
|
1145
|
-
execute: false,
|
|
1146
|
-
format: 'json',
|
|
1147
|
-
cliVersion,
|
|
1148
|
-
runtimeInstallPolicy: 'auto',
|
|
1149
|
-
}, autoIo.io);
|
|
1150
|
-
expect(sl).toHaveBeenNthCalledWith(2, {
|
|
1151
|
-
command: 'query',
|
|
1152
|
-
projectDir: tempDir,
|
|
1153
|
-
connectionId: 'warehouse',
|
|
1154
|
-
queryFile: '/tmp/query.json',
|
|
1155
|
-
execute: false,
|
|
1156
|
-
format: 'json',
|
|
1157
|
-
cliVersion,
|
|
1158
|
-
runtimeInstallPolicy: 'never',
|
|
1159
|
-
}, neverIo.io);
|
|
1160
|
-
expect(conflictIo.stderr()).toContain('Choose only one runtime install mode: --yes or --no-input');
|
|
1161
|
-
});
|
|
1162
|
-
it('dispatches public connection subcommands through the existing connection implementation', async () => {
|
|
1163
|
-
const tempDir = await mkdtemp(join(tmpdir(), 'ktx-connection-dispatch-'));
|
|
1164
|
-
await writeFile(join(tempDir, 'ktx.yaml'), '{}\n', 'utf-8');
|
|
1165
|
-
const connection = vi.fn(async () => 0);
|
|
1166
|
-
await expect(runKtxCli(['--project-dir', tempDir, 'connection', 'list'], makeIo().io, { connection })).resolves.toBe(0);
|
|
1167
|
-
const testIo = makeIo();
|
|
1168
|
-
await expect(runKtxCli(['--project-dir', tempDir, 'connection', 'test', 'warehouse'], testIo.io, {
|
|
1169
|
-
connection,
|
|
1170
|
-
})).resolves.toBe(0);
|
|
1171
|
-
expect(connection).toHaveBeenNthCalledWith(1, { command: 'list', projectDir: tempDir }, expect.anything());
|
|
1172
|
-
expect(connection).toHaveBeenNthCalledWith(2, {
|
|
1173
|
-
command: 'test',
|
|
1174
|
-
projectDir: tempDir,
|
|
1175
|
-
connectionId: 'warehouse',
|
|
1176
|
-
}, expect.anything());
|
|
1177
|
-
await rm(tempDir, { recursive: true, force: true });
|
|
1178
|
-
});
|
|
1179
|
-
it('prints only list and test in connection help', async () => {
|
|
1180
|
-
const helpIo = makeIo();
|
|
1181
|
-
await expect(runKtxCli(['connection', '--help'], helpIo.io)).resolves.toBe(0);
|
|
1182
|
-
expect(helpIo.stdout()).toContain('Usage: ktx connection');
|
|
1183
|
-
expect(helpIo.stdout()).toContain('list');
|
|
1184
|
-
expect(helpIo.stdout()).toContain('test [options] [connectionId]');
|
|
1185
|
-
for (const removed of ['add', 'remove', 'map', 'mapping', 'metabase', 'notion']) {
|
|
1186
|
-
expect(helpIo.stdout()).not.toMatch(new RegExp(`\\b${removed}\\b`));
|
|
1187
|
-
}
|
|
1188
|
-
expect(helpIo.stderr()).toBe('');
|
|
1189
|
-
});
|
|
1190
|
-
it('rejects removed connection subcommands', async () => {
|
|
1191
|
-
for (const argv of [
|
|
1192
|
-
['connection', 'add', 'postgres', 'warehouse'],
|
|
1193
|
-
['connection', 'remove', 'warehouse'],
|
|
1194
|
-
['connection', 'map', 'prod-metabase'],
|
|
1195
|
-
['connection', 'mapping'],
|
|
1196
|
-
['connection', 'metabase'],
|
|
1197
|
-
['connection', 'notion'],
|
|
1198
|
-
]) {
|
|
1199
|
-
const testIo = makeIo();
|
|
1200
|
-
await expect(runKtxCli(argv, testIo.io)).resolves.toBe(1);
|
|
1201
|
-
expect(testIo.stderr()).toMatch(/unknown command|error:/);
|
|
1202
|
-
}
|
|
1203
|
-
});
|
|
1204
|
-
it('rejects commands removed from the May 6 root surface', async () => {
|
|
1205
|
-
for (const argv of [
|
|
1206
|
-
['init'],
|
|
1207
|
-
['connect', 'list'],
|
|
1208
|
-
['knowledge', 'list'],
|
|
1209
|
-
['ask', 'What sources are connected?'],
|
|
1210
|
-
]) {
|
|
1211
|
-
const testIo = makeIo();
|
|
1212
|
-
await expect(runKtxCli(argv, testIo.io)).resolves.toBe(1);
|
|
1213
|
-
expect(testIo.stderr()).toMatch(/unknown command|error:/);
|
|
1214
|
-
}
|
|
1215
|
-
});
|
|
1216
|
-
it('writes basic debug dispatch information when --debug is set', async () => {
|
|
1217
|
-
const testIo = makeIo();
|
|
1218
|
-
const connection = vi.fn().mockResolvedValue(0);
|
|
1219
|
-
await expect(runKtxCli(['--project-dir', tempDir, '--debug', 'connection', 'list'], testIo.io, { connection })).resolves.toBe(0);
|
|
1220
|
-
expect(testIo.stderr()).toContain(`[debug] projectDir=${tempDir}`);
|
|
1221
|
-
expect(testIo.stderr()).toContain('[debug] dispatch=connection');
|
|
1222
|
-
});
|
|
1223
|
-
it.each([
|
|
1224
|
-
{ argv: ['scan'] },
|
|
1225
|
-
{ argv: ['scan', '--help'] },
|
|
1226
|
-
{ argv: ['scan', 'warehouse'] },
|
|
1227
|
-
{ argv: ['scan', 'warehouse', '--project-dir', '/tmp/project'] },
|
|
1228
|
-
{ argv: ['scan', 'warehouse', '--mode', 'relationships'] },
|
|
1229
|
-
])('rejects removed top-level scan command $argv', async ({ argv }) => {
|
|
1230
|
-
const testIo = makeIo();
|
|
1231
|
-
const publicIngest = vi.fn().mockResolvedValue(0);
|
|
1232
|
-
await expect(runKtxCli(argv, testIo.io, { publicIngest })).resolves.toBe(1);
|
|
1233
|
-
expect(testIo.stderr()).toMatch(/unknown command|error:/);
|
|
1234
|
-
expect(publicIngest).not.toHaveBeenCalled();
|
|
1235
|
-
});
|
|
1236
|
-
it('rejects removed public serve command options before dispatch', async () => {
|
|
1237
|
-
const serveIo = makeIo();
|
|
1238
|
-
await expect(runKtxCli([
|
|
1239
|
-
'serve',
|
|
1240
|
-
'--mcp',
|
|
1241
|
-
'stdio',
|
|
1242
|
-
'--project-dir',
|
|
1243
|
-
tempDir,
|
|
1244
|
-
'--semantic-compute-url',
|
|
1245
|
-
'http://127.0.0.1:18080',
|
|
1246
|
-
'--execute-queries',
|
|
1247
|
-
'--memory-capture',
|
|
1248
|
-
'--memory-model',
|
|
1249
|
-
'openai/gpt-5.2',
|
|
1250
|
-
], serveIo.io)).resolves.toBe(1);
|
|
1251
|
-
expect(serveIo.stderr()).toMatch(/unknown command|error:/);
|
|
1252
|
-
});
|
|
1253
|
-
it('prints admin help for bare admin commands', async () => {
|
|
1254
|
-
const testIo = makeIo();
|
|
1255
|
-
await expect(runKtxCli(['admin'], testIo.io)).resolves.toBe(0);
|
|
1256
|
-
expect(testIo.stdout()).toContain('Usage: ktx admin [options] [command]');
|
|
1257
|
-
expect(testIo.stdout()).toContain('Low-level project initialization');
|
|
1258
|
-
expect(testIo.stdout()).toContain('init');
|
|
1259
|
-
expect(testIo.stdout()).toContain('runtime');
|
|
1260
|
-
expect(testIo.stdout()).not.toContain('scan');
|
|
1261
|
-
expect(testIo.stdout()).not.toContain('ingest');
|
|
1262
|
-
expect(testIo.stdout()).not.toContain('mapping');
|
|
1263
|
-
expect(testIo.stdout()).not.toContain('model');
|
|
1264
|
-
expect(testIo.stdout()).not.toContain('knowledge');
|
|
1265
|
-
expect(testIo.stderr()).toBe('');
|
|
1266
|
-
});
|
|
1267
|
-
it('rejects removed admin command groups without invoking execution', async () => {
|
|
1268
|
-
for (const command of ['scan', 'ingest', 'mapping']) {
|
|
1269
|
-
const testIo = makeIo();
|
|
1270
|
-
const publicIngest = vi.fn().mockResolvedValue(0);
|
|
1271
|
-
const sl = vi.fn().mockResolvedValue(0);
|
|
1272
|
-
await expect(runKtxCli(['admin', command], testIo.io, { publicIngest, sl })).resolves.toBe(1);
|
|
1273
|
-
expect(testIo.stderr()).toMatch(/unknown command|error:/);
|
|
1274
|
-
expect(publicIngest).not.toHaveBeenCalled();
|
|
1275
|
-
expect(sl).not.toHaveBeenCalled();
|
|
1276
|
-
}
|
|
1277
|
-
});
|
|
1278
|
-
it('rejects removed reserved admin subcommands', async () => {
|
|
1279
|
-
const testIo = makeIo();
|
|
1280
|
-
await expect(runKtxCli(['admin', 'artifacts'], testIo.io)).resolves.toBe(1);
|
|
1281
|
-
expect(testIo.stderr()).toMatch(/unknown command|error:/);
|
|
1282
|
-
});
|
|
1283
|
-
it('rejects mutually exclusive public ingest output modes before invoking runners', async () => {
|
|
1284
|
-
const publicIngest = vi.fn(async () => 0);
|
|
1285
|
-
const testIo = makeIo();
|
|
1286
|
-
await expect(runKtxCli(['ingest', 'warehouse', '--json', '--plain'], testIo.io, { publicIngest })).resolves.toBe(1);
|
|
1287
|
-
expect(testIo.stderr()).toMatch(/conflict|cannot be used/i);
|
|
1288
|
-
expect(publicIngest).not.toHaveBeenCalled();
|
|
1289
|
-
});
|
|
1290
|
-
it('does not expose root init after setup owns project creation', async () => {
|
|
1291
|
-
const testIo = makeIo();
|
|
1292
|
-
await expect(runKtxCli(['init'], testIo.io)).resolves.toBe(1);
|
|
1293
|
-
expect(testIo.stderr()).toContain("error: unknown command 'init'");
|
|
1294
|
-
});
|
|
1295
|
-
it('returns an error code for unknown commands', async () => {
|
|
1296
|
-
const testIo = makeIo();
|
|
1297
|
-
await expect(runKtxCli(['unknown'], testIo.io)).resolves.toBe(1);
|
|
1298
|
-
expect(testIo.stderr()).toContain("error: unknown command 'unknown'");
|
|
1299
|
-
});
|
|
1300
|
-
});
|