vapviz 1.0.1__tar.gz

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.
Files changed (101) hide show
  1. vapviz-1.0.1/.claude/launch.json +11 -0
  2. vapviz-1.0.1/.dockerignore +28 -0
  3. vapviz-1.0.1/.github/workflows/ci.yml +111 -0
  4. vapviz-1.0.1/.github/workflows/release.yml +78 -0
  5. vapviz-1.0.1/.gitignore +49 -0
  6. vapviz-1.0.1/CHANGELOG.md +102 -0
  7. vapviz-1.0.1/CONTRIBUTING.md +161 -0
  8. vapviz-1.0.1/Dockerfile +40 -0
  9. vapviz-1.0.1/LICENSE +21 -0
  10. vapviz-1.0.1/PKG-INFO +1083 -0
  11. vapviz-1.0.1/README.md +1016 -0
  12. vapviz-1.0.1/docker-compose.yml +23 -0
  13. vapviz-1.0.1/docs/ARCHITECTURE.md +1176 -0
  14. vapviz-1.0.1/docs/DEPLOYMENT.md +550 -0
  15. vapviz-1.0.1/docs/DEVELOPER_REFERENCE.md +1888 -0
  16. vapviz-1.0.1/docs/TUTORIAL.md +1419 -0
  17. vapviz-1.0.1/docs/release-notes-v1.0.1.md +63 -0
  18. vapviz-1.0.1/docs/screenshot.png +0 -0
  19. vapviz-1.0.1/examples/anthropic_demo.py +135 -0
  20. vapviz-1.0.1/examples/async_demo.py +112 -0
  21. vapviz-1.0.1/examples/autogen_demo.py +111 -0
  22. vapviz-1.0.1/examples/budgets_demo.py +63 -0
  23. vapviz-1.0.1/examples/cost_tracking_demo.py +205 -0
  24. vapviz-1.0.1/examples/crewai_demo.py +231 -0
  25. vapviz-1.0.1/examples/error_handling_demo.py +171 -0
  26. vapviz-1.0.1/examples/evals_demo.py +69 -0
  27. vapviz-1.0.1/examples/langgraph_demo.py +136 -0
  28. vapviz-1.0.1/examples/llamaindex_demo.py +97 -0
  29. vapviz-1.0.1/examples/openai_demo.py +122 -0
  30. vapviz-1.0.1/examples/otel_demo.py +74 -0
  31. vapviz-1.0.1/examples/pydantic_ai_demo.py +160 -0
  32. vapviz-1.0.1/examples/remote_ingest_demo.py +206 -0
  33. vapviz-1.0.1/examples/simple_demo.py +99 -0
  34. vapviz-1.0.1/pyproject.toml +76 -0
  35. vapviz-1.0.1/run_dev.py +60 -0
  36. vapviz-1.0.1/tests/conftest.py +37 -0
  37. vapviz-1.0.1/tests/test_anthropic_patch.py +179 -0
  38. vapviz-1.0.1/tests/test_autogen.py +196 -0
  39. vapviz-1.0.1/tests/test_budgets.py +189 -0
  40. vapviz-1.0.1/tests/test_cost.py +179 -0
  41. vapviz-1.0.1/tests/test_crewai_listener.py +444 -0
  42. vapviz-1.0.1/tests/test_evals.py +206 -0
  43. vapviz-1.0.1/tests/test_langchain.py +290 -0
  44. vapviz-1.0.1/tests/test_llamaindex.py +174 -0
  45. vapviz-1.0.1/tests/test_metrics.py +299 -0
  46. vapviz-1.0.1/tests/test_openai_patch.py +226 -0
  47. vapviz-1.0.1/tests/test_otel.py +202 -0
  48. vapviz-1.0.1/tests/test_pydantic_ai.py +272 -0
  49. vapviz-1.0.1/tests/test_search.py +198 -0
  50. vapviz-1.0.1/tests/test_server.py +276 -0
  51. vapviz-1.0.1/tests/test_store.py +320 -0
  52. vapviz-1.0.1/tests/test_tracer.py +319 -0
  53. vapviz-1.0.1/ui/index.html +12 -0
  54. vapviz-1.0.1/ui/package-lock.json +3146 -0
  55. vapviz-1.0.1/ui/package.json +31 -0
  56. vapviz-1.0.1/ui/postcss.config.js +6 -0
  57. vapviz-1.0.1/ui/src/App.tsx +202 -0
  58. vapviz-1.0.1/ui/src/components/AgentGraph.tsx +194 -0
  59. vapviz-1.0.1/ui/src/components/Dashboard.tsx +303 -0
  60. vapviz-1.0.1/ui/src/components/EventTimeline.tsx +82 -0
  61. vapviz-1.0.1/ui/src/components/ExportMenu.tsx +94 -0
  62. vapviz-1.0.1/ui/src/components/NodeDetail.tsx +172 -0
  63. vapviz-1.0.1/ui/src/components/ReplayBar.tsx +90 -0
  64. vapviz-1.0.1/ui/src/components/RunComparison.tsx +212 -0
  65. vapviz-1.0.1/ui/src/components/RunList.tsx +247 -0
  66. vapviz-1.0.1/ui/src/components/TagEditor.tsx +80 -0
  67. vapviz-1.0.1/ui/src/hooks/useRunStream.ts +40 -0
  68. vapviz-1.0.1/ui/src/index.css +13 -0
  69. vapviz-1.0.1/ui/src/lib/replay.ts +59 -0
  70. vapviz-1.0.1/ui/src/main.tsx +10 -0
  71. vapviz-1.0.1/ui/src/store/runStore.ts +156 -0
  72. vapviz-1.0.1/ui/src/types/events.ts +116 -0
  73. vapviz-1.0.1/ui/tailwind.config.ts +9 -0
  74. vapviz-1.0.1/ui/tsconfig.json +20 -0
  75. vapviz-1.0.1/ui/vite.config.ts +15 -0
  76. vapviz-1.0.1/vapviz/__init__.py +96 -0
  77. vapviz-1.0.1/vapviz/_static/assets/html2canvas.esm-QH1iLAAe.js +22 -0
  78. vapviz-1.0.1/vapviz/_static/assets/index-BUAv_uWv.css +1 -0
  79. vapviz-1.0.1/vapviz/_static/assets/index-DgDrdw1j.js +228 -0
  80. vapviz-1.0.1/vapviz/_static/index.html +13 -0
  81. vapviz-1.0.1/vapviz/backends/__init__.py +3 -0
  82. vapviz-1.0.1/vapviz/backends/sqlite.py +281 -0
  83. vapviz-1.0.1/vapviz/budgets.py +199 -0
  84. vapviz-1.0.1/vapviz/cli.py +67 -0
  85. vapviz-1.0.1/vapviz/cost.py +111 -0
  86. vapviz-1.0.1/vapviz/evals.py +236 -0
  87. vapviz-1.0.1/vapviz/events.py +85 -0
  88. vapviz-1.0.1/vapviz/integrations/__init__.py +3 -0
  89. vapviz-1.0.1/vapviz/integrations/anthropic_sdk.py +131 -0
  90. vapviz-1.0.1/vapviz/integrations/autogen.py +328 -0
  91. vapviz-1.0.1/vapviz/integrations/crewai_listener.py +803 -0
  92. vapviz-1.0.1/vapviz/integrations/langchain.py +346 -0
  93. vapviz-1.0.1/vapviz/integrations/llamaindex.py +304 -0
  94. vapviz-1.0.1/vapviz/integrations/openai_sdk.py +137 -0
  95. vapviz-1.0.1/vapviz/integrations/otel.py +329 -0
  96. vapviz-1.0.1/vapviz/integrations/pydantic_ai.py +398 -0
  97. vapviz-1.0.1/vapviz/metrics.py +217 -0
  98. vapviz-1.0.1/vapviz/search.py +67 -0
  99. vapviz-1.0.1/vapviz/server.py +261 -0
  100. vapviz-1.0.1/vapviz/store.py +294 -0
  101. vapviz-1.0.1/vapviz/tracer.py +307 -0
@@ -0,0 +1,11 @@
1
+ {
2
+ "version": "0.0.1",
3
+ "configurations": [
4
+ {
5
+ "name": "vap-ui",
6
+ "runtimeExecutable": "cmd",
7
+ "runtimeArgs": ["/c", "cd ui && npm run dev"],
8
+ "port": 5173
9
+ }
10
+ ]
11
+ }
@@ -0,0 +1,28 @@
1
+ # Python
2
+ __pycache__/
3
+ *.py[cod]
4
+ *.egg-info/
5
+ .venv/
6
+ dist/
7
+ build/
8
+ .pytest_cache/
9
+
10
+ # Node
11
+ ui/node_modules/
12
+ ui/dist/
13
+
14
+ # Data / secrets
15
+ *.db
16
+ *.db-wal
17
+ *.db-shm
18
+ .env
19
+ *.env
20
+
21
+ # Dev artifacts
22
+ .git/
23
+ docs/screenshot.png
24
+ take_screenshot.py
25
+
26
+ # OS
27
+ .DS_Store
28
+ Thumbs.db
@@ -0,0 +1,111 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ pull_request:
7
+ branches: [main]
8
+
9
+ # Cancel superseded runs on the same ref.
10
+ concurrency:
11
+ group: ci-${{ github.ref }}
12
+ cancel-in-progress: true
13
+
14
+ permissions:
15
+ contents: read
16
+
17
+ jobs:
18
+ test:
19
+ name: tests (py${{ matrix.python-version }})
20
+ runs-on: ubuntu-latest
21
+ strategy:
22
+ fail-fast: false
23
+ matrix:
24
+ python-version: ["3.11", "3.12", "3.13"]
25
+ steps:
26
+ - uses: actions/checkout@v4
27
+
28
+ - name: Set up Python ${{ matrix.python-version }}
29
+ uses: actions/setup-python@v5
30
+ with:
31
+ python-version: ${{ matrix.python-version }}
32
+ cache: pip
33
+ cache-dependency-path: pyproject.toml
34
+
35
+ - name: Install package + dev deps
36
+ run: |
37
+ python -m pip install --upgrade pip
38
+ pip install -e ".[dev]"
39
+
40
+ - name: Run test suite
41
+ run: pytest -q
42
+
43
+ ui:
44
+ name: ui build
45
+ runs-on: ubuntu-latest
46
+ defaults:
47
+ run:
48
+ working-directory: ui
49
+ steps:
50
+ - uses: actions/checkout@v4
51
+
52
+ - name: Set up Node
53
+ uses: actions/setup-node@v4
54
+ with:
55
+ node-version: "20"
56
+ cache: npm
57
+ cache-dependency-path: ui/package-lock.json
58
+
59
+ - name: Install dependencies
60
+ run: npm ci
61
+
62
+ - name: Type-check and build
63
+ run: npm run build
64
+
65
+ package:
66
+ name: build & check package
67
+ runs-on: ubuntu-latest
68
+ steps:
69
+ - uses: actions/checkout@v4
70
+
71
+ - name: Set up Node
72
+ uses: actions/setup-node@v4
73
+ with:
74
+ node-version: "20"
75
+ cache: npm
76
+ cache-dependency-path: ui/package-lock.json
77
+
78
+ - name: Build the UI and stage it into the package
79
+ run: |
80
+ cd ui && npm ci && npm run build && cd ..
81
+ rm -rf vapviz/_static
82
+ cp -r ui/dist vapviz/_static
83
+
84
+ - name: Set up Python
85
+ uses: actions/setup-python@v5
86
+ with:
87
+ python-version: "3.12"
88
+
89
+ - name: Build sdist and wheel
90
+ run: |
91
+ python -m pip install --upgrade pip build twine
92
+ python -m build
93
+
94
+ - name: Verify the UI is bundled in the wheel
95
+ run: |
96
+ python - <<'PY'
97
+ import zipfile, glob
98
+ whl = glob.glob("dist/*.whl")[0]
99
+ names = zipfile.ZipFile(whl).namelist()
100
+ assert "vapviz/_static/index.html" in names, "UI not bundled in wheel"
101
+ print("OK: UI bundled in", whl)
102
+ PY
103
+
104
+ - name: Check distribution metadata
105
+ run: python -m twine check dist/*
106
+
107
+ - name: Upload distribution artifacts
108
+ uses: actions/upload-artifact@v4
109
+ with:
110
+ name: dist
111
+ path: dist/*
@@ -0,0 +1,78 @@
1
+ name: Release
2
+
3
+ # Publishes to PyPI when a version tag (e.g. v0.8.0) is pushed.
4
+ #
5
+ # Uses PyPI Trusted Publishing (OIDC) — no API token/secret required. One-time
6
+ # setup on PyPI: Project → Settings → Publishing → add a GitHub publisher with
7
+ # owner: kochrisdev repo: vapviz workflow: release.yml environment: pypi
8
+ # See https://docs.pypi.org/trusted-publishers/
9
+
10
+ on:
11
+ push:
12
+ tags: ["v*.*.*"]
13
+
14
+ permissions:
15
+ contents: read
16
+
17
+ jobs:
18
+ build:
19
+ name: build distribution
20
+ runs-on: ubuntu-latest
21
+ steps:
22
+ - uses: actions/checkout@v4
23
+
24
+ - name: Set up Node
25
+ uses: actions/setup-node@v4
26
+ with:
27
+ node-version: "20"
28
+ cache: npm
29
+ cache-dependency-path: ui/package-lock.json
30
+
31
+ - name: Build the UI and stage it into the package
32
+ run: |
33
+ cd ui && npm ci && npm run build && cd ..
34
+ rm -rf vapviz/_static
35
+ cp -r ui/dist vapviz/_static
36
+
37
+ - name: Set up Python
38
+ uses: actions/setup-python@v5
39
+ with:
40
+ python-version: "3.12"
41
+
42
+ - name: Build sdist and wheel
43
+ run: |
44
+ python -m pip install --upgrade pip build twine
45
+ python -m build
46
+
47
+ - name: Check distribution metadata
48
+ run: python -m twine check dist/*
49
+
50
+ - name: Verify tag matches package version
51
+ run: |
52
+ TAG="${GITHUB_REF_NAME#v}"
53
+ PKG=$(ls dist/*.tar.gz | sed -E 's/.*-([0-9][^-]*)\.tar\.gz/\1/')
54
+ echo "tag=$TAG package=$PKG"
55
+ test "$TAG" = "$PKG"
56
+
57
+ - name: Upload distribution artifacts
58
+ uses: actions/upload-artifact@v4
59
+ with:
60
+ name: dist
61
+ path: dist/*
62
+
63
+ publish:
64
+ name: publish to PyPI
65
+ needs: build
66
+ runs-on: ubuntu-latest
67
+ environment: pypi
68
+ permissions:
69
+ id-token: write # required for OIDC trusted publishing
70
+ steps:
71
+ - name: Download distribution artifacts
72
+ uses: actions/download-artifact@v4
73
+ with:
74
+ name: dist
75
+ path: dist
76
+
77
+ - name: Publish to PyPI
78
+ uses: pypa/gh-action-pypi-publish@release/v1
@@ -0,0 +1,49 @@
1
+ # Python
2
+ __pycache__/
3
+ *.py[cod]
4
+ *.pyo
5
+ *.pyd
6
+ .Python
7
+ *.egg-info/
8
+ dist/
9
+ build/
10
+ .venv/
11
+ venv/
12
+ env/
13
+ .env
14
+ *.egg
15
+
16
+ # Node
17
+ ui/node_modules/
18
+ ui/dist/
19
+ ui/.vite/
20
+
21
+ # Bundled UI copied into the package at build time
22
+ vapviz/_static/
23
+
24
+ # Logs
25
+ *.log
26
+ /logs/
27
+
28
+ # OS
29
+ .DS_Store
30
+ Thumbs.db
31
+
32
+ # IDE
33
+ .vscode/
34
+ .idea/
35
+ *.swp
36
+ *.swo
37
+
38
+ # Temp
39
+ /C:/Temp/
40
+
41
+ # Runtime data — local SQLite stores and server logs
42
+ vapviz.db
43
+ vapviz.db-shm
44
+ vapviz.db-wal
45
+ *.db
46
+ *.db-shm
47
+ *.db-wal
48
+ .vap_server.out
49
+ .vap_server.err
@@ -0,0 +1,102 @@
1
+ # Changelog
2
+
3
+ All notable changes to vapviz are documented here. The format is based on
4
+ [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to
5
+ [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
+
7
+ For the detailed per-release notes (APIs, fixes, internals), see the
8
+ [Developer Reference changelog](docs/DEVELOPER_REFERENCE.md#changelog).
9
+
10
+ ## [Unreleased]
11
+
12
+ _Nothing yet._
13
+
14
+ ## [1.0.1]
15
+
16
+ ### Changed
17
+ - **Renamed the project to `vapviz`.** The PyPI name `vap` was already taken by an unrelated
18
+ project, so the distribution, the import package, and the CLI are all `vapviz` now:
19
+ `pip install vapviz`, `import vapviz`, `vapviz serve`. (The `Vap*` public class names — `VapEvent`,
20
+ `VapPydanticAI`, etc. — are unchanged.)
21
+
22
+ ## [1.0.0]
23
+
24
+ First stable release. The public API now follows [Semantic Versioning](https://semver.org/) — see
25
+ the [Versioning & Stability](README.md#versioning--stability) section for the tracked surface.
26
+
27
+ ### Added
28
+ - The published wheel bundles the built React UI, so `pip install vapviz && vapviz serve` serves the full UI with no Node build (`vapviz serve` auto-detects the bundled UI; `--static-dir` still overrides).
29
+ - Root `CHANGELOG.md` and a documented public-API stability policy.
30
+ - Anthropic integration tests (`tests/test_anthropic_patch.py`), closing the last integration coverage gap (269 tests).
31
+
32
+ ### Changed
33
+ - Promoted to `Development Status :: 5 - Production/Stable`.
34
+
35
+ This release adds no new tracing/integration features beyond 0.15.0 — it marks the project as stable. The capability set: 7 framework integrations (Anthropic, OpenAI, LangChain, CrewAI, Pydantic AI, LlamaIndex, AutoGen), OpenTelemetry export, an analytics dashboard, cost/latency budgets with alerting, agent evals & scoring, run search & tagging, and trace replay.
36
+
37
+ ## [0.15.0]
38
+ ### Added
39
+ - Trace replay / time-travel: a UI scrubber (`ReplayBar`) that replays a run event-by-event; the graph fills in node by node.
40
+
41
+ ## [0.14.0]
42
+ ### Added
43
+ - Run search (`GET /search`) across run labels and node inputs/outputs, with `status` / `kind` / `tool` / `tag` filters.
44
+ - Persistent per-run tags (`GET`/`PUT /runs/{id}/tags`, stored in SQLite); UI search box, tag chips, and inline tag editor.
45
+
46
+ ## [0.13.0]
47
+ ### Added
48
+ - Agent evals & scoring: `eval_run(run, [checks…])` → `EvalResult` with built-in `max_cost` / `max_latency` / `max_tokens` / `no_errors` / `output_contains` plus `custom` and `judge` hooks; declarative `POST /runs/{id}/eval`.
49
+
50
+ ## [0.12.0]
51
+ ### Added
52
+ - Cost & latency budgets: `Budget`, `check_budget()`, `enable_budget_alerts(budget, on_alert=…)`, and `GET /runs/{id}/budget`.
53
+
54
+ ## [0.11.0]
55
+ ### Added
56
+ - AutoGen (AG2) integration: `VapAutoGen` traces `ConversableAgent` conversations (chat, agent turns, tool calls).
57
+
58
+ ## [0.10.0]
59
+ ### Added
60
+ - LlamaIndex integration: `VapLlamaIndex` span handler traces query engines, retrievers, embeddings, and LLM calls.
61
+
62
+ ## [0.9.0]
63
+ ### Added
64
+ - OpenTelemetry export: `enable_otel_export(...)` mirrors each run into OTLP spans (Jaeger / Grafana Tempo / Datadog).
65
+
66
+ ## [0.8.0]
67
+ ### Added
68
+ - Pydantic AI integration: `VapPydanticAI` traces `Agent.run` / `run_sync` (model requests + tool calls).
69
+ - PyPI-ready packaging (license, classifiers, URLs), MIT `LICENSE`, GitHub Actions CI + release workflows, and `CONTRIBUTING.md`.
70
+
71
+ ## [0.7.0]
72
+ ### Added
73
+ - Analytics dashboard + `GET /metrics`: cross-run cost, tokens, success rate, per-model breakdown, and cost-over-time.
74
+
75
+ ## [0.6.0]
76
+ ### Added
77
+ - CrewAI integration: `VapCrewAIListener` traces Crews, Tasks, Agent executions, Tool calls, and LLM round-trips.
78
+
79
+ ## [0.5.0]
80
+ ### Added
81
+ - Run comparison (side-by-side diff) and export (JSON download + PNG capture).
82
+
83
+ ## [0.4.0]
84
+ ### Added
85
+ - Token cost tracking: pricing table, `calculate_cost()`, per-node cost overlay, per-run totals.
86
+
87
+ ## [0.3.0]
88
+ ### Added
89
+ - OpenAI SDK and LangChain / LangGraph integrations.
90
+
91
+ ## [0.2.0]
92
+ ### Added
93
+ - Async tracer (`atrace` / `astep`), SQLite persistence, the `vapviz serve` CLI.
94
+
95
+ ## [0.1.0]
96
+ ### Added
97
+ - Initial release: sync tracer, in-memory store, FastAPI + SSE server, ReactFlow UI, Anthropic SDK integration.
98
+
99
+ [Unreleased]: https://github.com/kochrisdev/vapviz/compare/v1.0.1...HEAD
100
+ [1.0.1]: https://github.com/kochrisdev/vapviz/releases/tag/v1.0.1
101
+ [1.0.0]: https://github.com/kochrisdev/vapviz/releases/tag/v1.0.0
102
+ [0.15.0]: https://github.com/kochrisdev/vapviz/releases/tag/v0.15.0
@@ -0,0 +1,161 @@
1
+ # Contributing to vapviz
2
+
3
+ Thanks for your interest in improving vapviz! This guide covers how to set up a
4
+ development environment, the checks your change needs to pass, and how to get a
5
+ pull request merged.
6
+
7
+ By participating, you agree that your contributions will be licensed under the
8
+ project's [MIT License](LICENSE).
9
+
10
+ ---
11
+
12
+ ## Ways to contribute
13
+
14
+ - **Report a bug** or **request a feature** — open an
15
+ [issue](https://github.com/kochrisdev/vapviz/issues). For bugs, include the vapviz
16
+ version, Python version, a minimal repro, and the expected vs. actual behaviour.
17
+ - **Improve the docs** — fixes to `README.md` or anything under `docs/` are very
18
+ welcome and make great first contributions.
19
+ - **Send a pull request** — see the workflow below. For anything non-trivial,
20
+ please open an issue first so we can agree on the approach before you build it.
21
+
22
+ ---
23
+
24
+ ## Development setup
25
+
26
+ vapviz is a Python package (`vapviz/`) plus a Vite + React UI (`ui/`). You need
27
+ **Python 3.11+** and **Node 20+**.
28
+
29
+ ```bash
30
+ git clone https://github.com/kochrisdev/vapviz.git
31
+ cd vapviz
32
+
33
+ # Python — editable install with all integrations + test/dev tooling
34
+ pip install -e ".[dev]"
35
+
36
+ # UI
37
+ cd ui && npm ci && cd ..
38
+ ```
39
+
40
+ Run the whole thing locally (server + a demo agent, hot-reloading UI):
41
+
42
+ ```bash
43
+ python run_dev.py # server + demo on http://localhost:8001
44
+ # in another terminal:
45
+ cd ui && npm run dev # UI dev server on http://localhost:5173
46
+ ```
47
+
48
+ ---
49
+
50
+ ## Checks your change must pass
51
+
52
+ CI ([`.github/workflows/ci.yml`](.github/workflows/ci.yml)) runs these on every
53
+ push and pull request to `main`. Run them locally before pushing:
54
+
55
+ ```bash
56
+ # Python test suite — 269 tests; integration tests skip automatically
57
+ # when their framework (crewai, pydantic-ai, langchain, …) isn't installed
58
+ pytest -q
59
+
60
+ # UI type-check + production build
61
+ cd ui && npm run build && cd ..
62
+
63
+ # Package builds cleanly and its metadata is valid
64
+ python -m build
65
+ python -m twine check dist/*
66
+ ```
67
+
68
+ CI runs the test suite against Python 3.11, 3.12, and 3.13, so avoid
69
+ version-specific APIs.
70
+
71
+ ---
72
+
73
+ ## Coding guidelines
74
+
75
+ - **Match the surrounding code.** Mirror the existing naming, comment density,
76
+ and idioms in the file you're editing rather than introducing a new style.
77
+ - **Type everything.** The package ships type hints (`Typing :: Typed`); keep new
78
+ Python code annotated and new TypeScript code free of `any` where practical.
79
+ - **Tests are required for behaviour changes.** Add or update tests under
80
+ `tests/`. Keep them hermetic — no network calls or API keys. The integration
81
+ tests use each framework's built-in fakes (e.g. Pydantic AI's `TestModel`,
82
+ mocked SDK clients) and `pytest.importorskip` so the suite stays green even
83
+ when the optional dependency is absent.
84
+ - **Keep tracing best-effort.** Instrumentation must never break the user's
85
+ agent — failures in a listener/patch should be swallowed, not raised.
86
+ - **Update the docs.** If you change public behaviour, update the relevant file
87
+ in `docs/` (and `README.md` where it overlaps) in the same PR.
88
+
89
+ Get oriented with the
90
+ [Project Structure](README.md#project-structure) section and
91
+ [`docs/ARCHITECTURE.md`](docs/ARCHITECTURE.md).
92
+
93
+ ### Adding a new framework integration
94
+
95
+ Integrations live in `vapviz/integrations/` and follow one of two patterns
96
+ (SDK monkey-patch, or event-bus/listener) described in the
97
+ [Extension Guide](docs/ARCHITECTURE.md#extension-guide). When you add one:
98
+
99
+ 1. Implement it in `vapviz/integrations/<name>.py`, reusing `vapviz.calculate_cost`
100
+ for LLM cost and emitting standard `VapEvent`s so it works with the existing
101
+ store, server, and UI unchanged.
102
+ 2. Add an optional extra in `pyproject.toml` (and to the `all` / `dev` groups).
103
+ 3. Add `tests/test_<name>.py`, guarded with
104
+ `pytest.importorskip("<package>")` and using the framework's test doubles.
105
+ 4. Add an `examples/<name>_demo.py` and document it in `README.md`,
106
+ `docs/TUTORIAL.md`, `docs/ARCHITECTURE.md`, and `docs/DEVELOPER_REFERENCE.md`.
107
+
108
+ ---
109
+
110
+ ## Commit messages
111
+
112
+ This repo uses [Conventional Commits](https://www.conventionalcommits.org/).
113
+ Prefix the subject with the change type, e.g.:
114
+
115
+ ```
116
+ feat(pydantic-ai): trace Pydantic AI agents
117
+ fix(tests): reset _current_step ContextVar between tests
118
+ docs: document the analytics dashboard
119
+ ci: add GitHub Actions CI/release + PyPI release metadata
120
+ ```
121
+
122
+ Common types: `feat`, `fix`, `docs`, `test`, `refactor`, `perf`, `ci`, `chore`.
123
+ Keep the subject in the imperative mood and under ~72 characters; put detail and
124
+ rationale in the body.
125
+
126
+ ---
127
+
128
+ ## Pull request workflow
129
+
130
+ 1. Fork the repo (or create a branch if you have write access) — don't commit
131
+ directly to `main`.
132
+ 2. Make your change with tests and docs updated.
133
+ 3. Run the [checks above](#checks-your-change-must-pass) locally.
134
+ 4. Open a PR against `main` with a clear description of **what** changed and
135
+ **why**. Link any related issue.
136
+ 5. Make sure CI is green — PRs are merged only when all jobs pass.
137
+
138
+ Small, focused PRs are reviewed fastest. If a change is large, consider splitting
139
+ it (e.g. one PR for the feature, one for docs).
140
+
141
+ ---
142
+
143
+ ## Releasing (maintainers)
144
+
145
+ Releases are tag-driven and publish to PyPI via
146
+ [Trusted Publishing](https://docs.pypi.org/trusted-publishers/) — no API tokens.
147
+
148
+ 1. Bump `version` in [`pyproject.toml`](pyproject.toml) and add a changelog entry
149
+ in [`docs/DEVELOPER_REFERENCE.md`](docs/DEVELOPER_REFERENCE.md#changelog).
150
+ 2. Commit, then tag and push:
151
+ ```bash
152
+ git tag v0.8.0 && git push origin v0.8.0
153
+ ```
154
+ 3. [`.github/workflows/release.yml`](.github/workflows/release.yml) builds the
155
+ distribution, verifies the tag matches the package version, and publishes to
156
+ PyPI. (Requires the one-time PyPI publisher configuration noted in that
157
+ workflow's header.)
158
+
159
+ ---
160
+
161
+ Questions? Open an [issue](https://github.com/kochrisdev/vapviz/issues) — happy to help.
@@ -0,0 +1,40 @@
1
+ # ── Stage 1: Build the React UI ───────────────────────────────────────────────
2
+ FROM node:20-alpine AS ui-builder
3
+
4
+ WORKDIR /app/ui
5
+ COPY ui/package*.json ./
6
+ RUN npm ci
7
+ COPY ui/ .
8
+ RUN npm run build # output → /app/ui/dist
9
+
10
+
11
+ # ── Stage 2: Python runtime ───────────────────────────────────────────────────
12
+ FROM python:3.11-slim
13
+
14
+ # System deps (SQLite is bundled with Python — no extra install needed)
15
+ RUN apt-get update && apt-get install -y --no-install-recommends \
16
+ && rm -rf /var/lib/apt/lists/*
17
+
18
+ WORKDIR /app
19
+
20
+ # Install Python package
21
+ COPY pyproject.toml ./
22
+ COPY vapviz/ ./vapviz/
23
+ RUN pip install --no-cache-dir -e .
24
+
25
+ # Copy built UI from stage 1
26
+ COPY --from=ui-builder /app/ui/dist ./ui/dist
27
+
28
+ # Data directory for SQLite persistence (mount a volume here)
29
+ RUN mkdir -p /data
30
+
31
+ EXPOSE 8001
32
+
33
+ # Default: persist to /data/vapviz.db and serve the built UI.
34
+ # Override CMD or set env vars at runtime to customise.
35
+ CMD ["vapviz", "serve", \
36
+ "--host", "0.0.0.0", \
37
+ "--port", "8001", \
38
+ "--db", "/data/vapviz.db", \
39
+ "--static-dir", "ui/dist", \
40
+ "--log-level", "info"]
vapviz-1.0.1/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 kochrisdev
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.