Make packages/cli/package.json the single source of truth for the @kaelio/ktx version. publicNpmPackageVersion() now reads it directly, so artifact filenames, release-readiness checks, and the Python wheel version all derive from one field. The duplicate release-policy.json.publicNpmPackageVersion is removed. Previously the two fields could drift: tarballs were named kaelio-ktx-0.4.1.tgz while internally containing @kaelio/ktx@0.0.0-private. - update-public-release-version.mjs rewrites both Python pyproject.toml files (ktx-daemon, ktx-sl) alongside the npm package.jsons, normalizing the version for PEP 440 (e.g. 0.1.0-rc.2 -> 0.1.0rc2). - semantic-release-config.cjs adds the two pyproject.toml files to @semantic-release/git assets so the release commit back to main carries every version source in lockstep. - The six "?? '0.0.0-private'" fallback literals across the CLI are replaced with "?? getKtxCliPackageInfo().version", and createDefaultKtxMcpServer makes its version arg required. - docs/release.md describes the actual commit-back model: the dev tree always reflects the most recent release; no sentinel pin to maintain. Verified: pnpm run artifacts:build now produces kaelio-ktx-0.4.1.tgz and kaelio_ktx-0.4.1-py3-none-any.whl with @kaelio/ktx@0.4.1 inside. Full type-check, dead-code, and 2287 vitests + 173 script tests pass. |
||
|---|---|---|
| .. | ||
| src/ktx_daemon | ||
| tests | ||
| pyproject.toml | ||
| README.md | ||
ktx-daemon
ktx-daemon is the portable Python compute package for KTX.
It supports portable compute in two modes:
- One-shot commands, used by default by the
@kaelio/ktxCLI. - An explicit HTTP server for long-running local MCP sessions.
One-shot semantic query
printf '%s\n' '{"sources":[],"query":{"measures":[],"dimensions":[]},"dialect":"postgres"}' \
| ktx-daemon semantic-query
One-shot source generation
Generate semantic-layer sources from schema scan data:
printf '%s\n' '{"tables":[{"name":"orders","db":"public","columns":[{"name":"id","type":"integer","primary_key":true}]}],"links":[],"dialect":"postgres"}' \
| ktx-daemon semantic-generate-sources
One-shot database introspection
Introspect a Postgres database schema:
printf '%s\n' '{"connection_id":"warehouse","driver":"postgres","url":"postgresql://readonly@example.test/warehouse","schemas":["public"]}' \
| ktx-daemon database-introspect
One-shot LookML parsing
Parse LookML projects into resolved, KSL-ready structures:
printf '%s\n' '{"files":[{"path":"views/orders.view.lkml","content":"view: orders { sql_table_name: public.orders ;; measure: order_count { type: count } }"}],"dialect":"postgres"}' \
| ktx-daemon lookml-parse
One-shot embeddings
Compute text embeddings locally:
printf '%s\n' '{"text":"hello"}' \
| ktx-daemon embedding-compute
Compute text embeddings locally in bulk:
printf '%s\n' '{"texts":["hello","world"]}' \
| ktx-daemon embedding-compute-bulk
One-shot code execution
Execute Python code with the current in-process boundary:
printf '%s\n' '{"code":"result = 1 + 2"}' \
| ktx-daemon code-execute
HTTP compute server
Start the HTTP compute server with code execution disabled:
ktx-daemon serve-http --host 127.0.0.1 --port 8765
Enable HTTP code execution explicitly:
ktx-daemon serve-http --host 127.0.0.1 --port 8765 --enable-code-execution
Available HTTP endpoints:
GET /healthPOST /database/introspectPOST /embeddings/computePOST /embeddings/compute-bulkPOST /lookml/parsePOST /semantic-layer/generate-sourcesPOST /semantic-layer/queryPOST /semantic-layer/validatePOST /code/executewhen--enable-code-executionis passed
The HTTP server exposes Postgres database introspection, LookML parsing, local
embedding compute, and semantic-layer compute for source generation, query
compilation, and validation.
Code execution is off by default. When enabled, it runs Python exec in the
daemon process with the same in-process boundary as the one-shot
code-execute command and does not provide OS-level sandboxing.
HTTP code execution uses the standalone KTX boundary. It does not forward caller authorization headers to a host app and does not connect scratchpad or visualization helpers to host application APIs.