Metadata-Version: 2.3
Name: s-layer-flint-charts
Version: 0.2.0
Summary: Semantic-layer-aware Flint charts for agents: types, grain guard and show_chart tool
Author: Anentropic
Author-email: Anentropic <ego@anentropic.com>
Requires-Dist: orjson>=3.10
Requires-Dist: pyarrow>=18
Requires-Dist: s-layer-semantic-formats>=0.2.0,<0.3
Requires-Dist: semolina>=0.9.1
Requires-Dist: pydantic-ai-slim>=2.0 ; extra == 'pydantic-ai'
Requires-Dist: backports-zstd>=1.0 ; python_full_version < '3.14' and extra == 'server'
Requires-Dist: starlette>=0.40 ; extra == 'server'
Requires-Dist: mcp>=2.0 ; extra == 'validate'
Requires-Python: >=3.11
Provides-Extra: pydantic-ai
Provides-Extra: server
Provides-Extra: validate
Description-Content-Type: text/markdown

# s-layer-flint-charts

Semantic-layer-aware Flint charts for agents: types, grain guard and show_chart tool

This repository holds two packages:

- `s-layer-flint-charts` (Python, repository root): maps semantic-layer field metadata to
  [Flint](https://github.com/microsoft/flint-chart) types, guards chart grain and serves the
  `show_chart` tool.
- `@s-layer/flint-charts` (TypeScript, `ts/`): renders those charts in agent chat UIs.

## Installation

```bash
pip install s-layer-flint-charts
```

## Development

### Quality Gates

Before committing, all code must pass:

```bash
prek run --all-files  # Runs typecheck, lint, format, test
```

Or run individually:
```bash
uv run basedpyright  # Type checking (strict mode)
uv run ruff check    # Linting
uv run ruff format --check  # Formatting
uv run pytest        # Tests
```

### Setup

```bash
# Install dependencies, with every extra
uv sync --dev --all-extras

# The sidecar tests run flint-chart-mcp from ts/node_modules
pnpm --dir ts install

# Install git hooks
prek install
```

### TypeScript package

```bash
cd ts
pnpm install
pnpm lint && pnpm typecheck && pnpm test
pnpm test:browser  # Playwright, in Chromium (pnpm exec playwright install chromium first)
```

### Releases

The packages are released apart. Tag `vX.Y.Z` releases the Python package to PyPI; tag
`ts-vX.Y.Z`, after setting that version in `ts/package.json` and `VERSION` in `ts/src/index.ts`,
releases the npm package.

## License

MIT
