mirror of
https://github.com/Kaelio/ktx.git
synced 2026-06-25 08:48:08 +02:00
Align the tree with AGENTS.md/CLAUDE.md conventions: - Rewrite user-facing strings, docs, and tests to lowercase `ktx` (no bare uppercase `KTX` tokens remain outside literal identifiers). - Drop the legacy `historicSql` migration path and its now-unused helpers, per the no-backward-compat rule. - Remove `as unknown as` / `any` casts: narrow `BaseTool` generics to `z.ZodObject`, add a typed `createLookerClient`, and delete the dead `getParametersSchema`/`toAnthropicFormat` pre-AI-SDK helpers. - Use `InvalidArgumentError` for Commander parse failures. - Finish the adapter→connector prose conversion in the `ktx.yaml` docs while keeping the literal `adapters` config key.
28 lines
675 B
Python
28 lines
675 B
Python
"""Portable compute package for ktx."""
|
|
|
|
from collections.abc import Callable
|
|
from importlib.metadata import PackageNotFoundError, version
|
|
|
|
PACKAGE_NAME = "ktx-daemon"
|
|
RUNTIME_DISTRIBUTION_NAME = "kaelio-ktx"
|
|
|
|
|
|
def resolve_package_version(
|
|
version_loader: Callable[[str], str] = version,
|
|
) -> str:
|
|
for distribution_name in (RUNTIME_DISTRIBUTION_NAME, PACKAGE_NAME):
|
|
try:
|
|
return version_loader(distribution_name)
|
|
except PackageNotFoundError:
|
|
continue
|
|
return "0.0.0+local"
|
|
|
|
|
|
VERSION = resolve_package_version()
|
|
|
|
__all__ = [
|
|
"PACKAGE_NAME",
|
|
"RUNTIME_DISTRIBUTION_NAME",
|
|
"VERSION",
|
|
"resolve_package_version",
|
|
]
|