vctx 0.1.0__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 (119) hide show
  1. vctx-0.1.0/.github/workflows/ci.yml +46 -0
  2. vctx-0.1.0/.github/workflows/publish.yml +53 -0
  3. vctx-0.1.0/.gitignore +31 -0
  4. vctx-0.1.0/.hermes/plans/2026-06-25_145239-knowledge-flow-slice-priority.md +229 -0
  5. vctx-0.1.0/.python-version +1 -0
  6. vctx-0.1.0/LICENSE +21 -0
  7. vctx-0.1.0/PKG-INFO +25 -0
  8. vctx-0.1.0/README.md +134 -0
  9. vctx-0.1.0/docs/api.md +816 -0
  10. vctx-0.1.0/docs/architecture.md +108 -0
  11. vctx-0.1.0/docs/context.md +79 -0
  12. vctx-0.1.0/docs/development.md +319 -0
  13. vctx-0.1.0/docs/examples/vctx.visual-auto-side-effect.toml +21 -0
  14. vctx-0.1.0/docs/graph/README.md +41 -0
  15. vctx-0.1.0/docs/graph/ai.md +215 -0
  16. vctx-0.1.0/docs/graph/app.md +109 -0
  17. vctx-0.1.0/docs/graph/model-transforms.md +120 -0
  18. vctx-0.1.0/docs/graph/models.md +132 -0
  19. vctx-0.1.0/docs/graph/net.md +317 -0
  20. vctx-0.1.0/pyproject.toml +58 -0
  21. vctx-0.1.0/scripts/check_module_layout.py +201 -0
  22. vctx-0.1.0/scripts/smoke_knowledge_flow.py +57 -0
  23. vctx-0.1.0/scripts/smoke_local_asr.py +57 -0
  24. vctx-0.1.0/scripts/smoke_url_subtitles.py +47 -0
  25. vctx-0.1.0/src/vctx/__init__.py +5 -0
  26. vctx-0.1.0/src/vctx/app/__init__.py +0 -0
  27. vctx-0.1.0/src/vctx/app/chunk.py +38 -0
  28. vctx-0.1.0/src/vctx/app/credentials.py +55 -0
  29. vctx-0.1.0/src/vctx/app/doctor.py +42 -0
  30. vctx-0.1.0/src/vctx/app/metadata.py +30 -0
  31. vctx-0.1.0/src/vctx/app/prepare.py +804 -0
  32. vctx-0.1.0/src/vctx/app/render.py +69 -0
  33. vctx-0.1.0/src/vctx/app/result.py +112 -0
  34. vctx-0.1.0/src/vctx/chunking.py +75 -0
  35. vctx-0.1.0/src/vctx/cli.py +221 -0
  36. vctx-0.1.0/src/vctx/config.py +552 -0
  37. vctx-0.1.0/src/vctx/errors.py +25 -0
  38. vctx-0.1.0/src/vctx/io.py +60 -0
  39. vctx-0.1.0/src/vctx/models/__init__.py +10 -0
  40. vctx-0.1.0/src/vctx/models/acquisition.py +108 -0
  41. vctx-0.1.0/src/vctx/models/artifacts.py +37 -0
  42. vctx-0.1.0/src/vctx/models/knowledge_flow.py +40 -0
  43. vctx-0.1.0/src/vctx/models/manifest.py +99 -0
  44. vctx-0.1.0/src/vctx/models/media.py +127 -0
  45. vctx-0.1.0/src/vctx/models/metadata.py +18 -0
  46. vctx-0.1.0/src/vctx/models/visual.py +181 -0
  47. vctx-0.1.0/src/vctx/net.py +239 -0
  48. vctx-0.1.0/src/vctx/render/__init__.py +0 -0
  49. vctx-0.1.0/src/vctx/render/bundle.py +107 -0
  50. vctx-0.1.0/src/vctx/render/markdown.py +287 -0
  51. vctx-0.1.0/src/vctx/sources/__init__.py +0 -0
  52. vctx-0.1.0/src/vctx/sources/detect.py +43 -0
  53. vctx-0.1.0/src/vctx/sources/local_file_source.py +80 -0
  54. vctx-0.1.0/src/vctx/sources/ytdlp_source.py +480 -0
  55. vctx-0.1.0/src/vctx/subtitles.py +54 -0
  56. vctx-0.1.0/src/vctx/transcript.py +136 -0
  57. vctx-0.1.0/src/vctx/transforms/__init__.py +0 -0
  58. vctx-0.1.0/src/vctx/transforms/ai_routes.py +205 -0
  59. vctx-0.1.0/src/vctx/transforms/asr.py +291 -0
  60. vctx-0.1.0/src/vctx/transforms/knowledge_flow.py +248 -0
  61. vctx-0.1.0/src/vctx/transforms/model_resolution.py +347 -0
  62. vctx-0.1.0/src/vctx/transforms/planning.py +178 -0
  63. vctx-0.1.0/src/vctx/transforms/text_ai.py +172 -0
  64. vctx-0.1.0/src/vctx/transforms/visual_cases.py +245 -0
  65. vctx-0.1.0/src/vctx/transforms/visual_evidence.py +287 -0
  66. vctx-0.1.0/src/vctx/transforms/visual_execute.py +150 -0
  67. vctx-0.1.0/src/vctx/transforms/visual_frames.py +95 -0
  68. vctx-0.1.0/src/vctx/transforms/visual_ocr.py +81 -0
  69. vctx-0.1.0/src/vctx/transforms/visual_planning.py +344 -0
  70. vctx-0.1.0/src/vctx/transforms/visual_routes.py +150 -0
  71. vctx-0.1.0/src/vctx/transforms/visual_vlm.py +171 -0
  72. vctx-0.1.0/src/vctx/util.py +19 -0
  73. vctx-0.1.0/tests/integration/test_fixed_source_network.py +108 -0
  74. vctx-0.1.0/tests/integration/test_fixed_ted_visual_side_effects.py +419 -0
  75. vctx-0.1.0/tests/test_ai_dispatch_contracts.py +201 -0
  76. vctx-0.1.0/tests/test_chunk_command.py +46 -0
  77. vctx-0.1.0/tests/test_cli_config_selection.py +77 -0
  78. vctx-0.1.0/tests/test_config_and_transforms.py +163 -0
  79. vctx-0.1.0/tests/test_config_file.py +335 -0
  80. vctx-0.1.0/tests/test_doctor_command.py +24 -0
  81. vctx-0.1.0/tests/test_faster_whisper_asr.py +222 -0
  82. vctx-0.1.0/tests/test_instance_config.py +90 -0
  83. vctx-0.1.0/tests/test_knowledge_flow.py +275 -0
  84. vctx-0.1.0/tests/test_knowledge_flow_bundle.py +138 -0
  85. vctx-0.1.0/tests/test_knowledge_flow_llm.py +109 -0
  86. vctx-0.1.0/tests/test_local_prepare.py +217 -0
  87. vctx-0.1.0/tests/test_metadata_command.py +43 -0
  88. vctx-0.1.0/tests/test_model_resolution.py +194 -0
  89. vctx-0.1.0/tests/test_multilingual_preservation.py +126 -0
  90. vctx-0.1.0/tests/test_net_runtime.py +229 -0
  91. vctx-0.1.0/tests/test_online_asr.py +269 -0
  92. vctx-0.1.0/tests/test_openrouter_registry.py +116 -0
  93. vctx-0.1.0/tests/test_prepare_asr_integration.py +106 -0
  94. vctx-0.1.0/tests/test_prepare_llm_essential_cases.py +194 -0
  95. vctx-0.1.0/tests/test_prepare_llm_knowledge_flow.py +195 -0
  96. vctx-0.1.0/tests/test_prepare_partial.py +123 -0
  97. vctx-0.1.0/tests/test_prepare_url.py +167 -0
  98. vctx-0.1.0/tests/test_prepare_url_asr.py +171 -0
  99. vctx-0.1.0/tests/test_prepare_visual_capture.py +213 -0
  100. vctx-0.1.0/tests/test_prepare_visual_ocr.py +251 -0
  101. vctx-0.1.0/tests/test_prepare_visual_vlm.py +514 -0
  102. vctx-0.1.0/tests/test_render_command.py +128 -0
  103. vctx-0.1.0/tests/test_render_knowledge_flow.py +117 -0
  104. vctx-0.1.0/tests/test_render_visual_records.py +94 -0
  105. vctx-0.1.0/tests/test_smoke_knowledge_flow.py +96 -0
  106. vctx-0.1.0/tests/test_text_ai.py +196 -0
  107. vctx-0.1.0/tests/test_visual_acquisition_planning.py +227 -0
  108. vctx-0.1.0/tests/test_visual_cases.py +292 -0
  109. vctx-0.1.0/tests/test_visual_cases_llm.py +105 -0
  110. vctx-0.1.0/tests/test_visual_evidence_scoring.py +88 -0
  111. vctx-0.1.0/tests/test_visual_frames.py +76 -0
  112. vctx-0.1.0/tests/test_visual_model_ref_routes.py +538 -0
  113. vctx-0.1.0/tests/test_visual_motive_satisfaction.py +80 -0
  114. vctx-0.1.0/tests/test_visual_ocr.py +46 -0
  115. vctx-0.1.0/tests/test_visual_vlm.py +189 -0
  116. vctx-0.1.0/tests/test_webvtt_parser.py +20 -0
  117. vctx-0.1.0/tests/test_writer.py +17 -0
  118. vctx-0.1.0/tests/test_ytdlp_source.py +610 -0
  119. vctx-0.1.0/uv.lock +934 -0
@@ -0,0 +1,46 @@
1
+ name: CI
2
+
3
+ on:
4
+ pull_request:
5
+ push:
6
+ branches: [main]
7
+
8
+ permissions:
9
+ contents: read
10
+
11
+ concurrency:
12
+ group: ci-${{ github.workflow }}-${{ github.ref }}
13
+ cancel-in-progress: true
14
+
15
+ jobs:
16
+ lint-test:
17
+ name: Lint, type-check, test
18
+ runs-on: ubuntu-latest
19
+
20
+ steps:
21
+ - name: Checkout
22
+ uses: actions/checkout@v4
23
+
24
+ - name: Install uv
25
+ uses: astral-sh/setup-uv@v7
26
+ with:
27
+ python-version: "3.14"
28
+ enable-cache: true
29
+
30
+ - name: Sync dependencies
31
+ run: uv sync --locked --dev
32
+
33
+ - name: Check module layout
34
+ run: uv run python scripts/check_module_layout.py
35
+
36
+ - name: Ruff
37
+ run: uv run ruff check .
38
+
39
+ - name: Ty
40
+ run: uv run ty check .
41
+
42
+ - name: Pytest
43
+ run: uv run pytest -q -W error::DeprecationWarning
44
+
45
+ - name: Build package
46
+ run: uv build
@@ -0,0 +1,53 @@
1
+ name: Publish
2
+
3
+ on:
4
+ release:
5
+ types: [published]
6
+ push:
7
+ tags:
8
+ - "v*"
9
+
10
+ permissions:
11
+ contents: read
12
+ id-token: write
13
+
14
+ concurrency:
15
+ group: publish-${{ github.ref }}
16
+ cancel-in-progress: false
17
+
18
+ jobs:
19
+ pypi:
20
+ name: Build and publish to PyPI
21
+ runs-on: ubuntu-latest
22
+ environment: pypi
23
+
24
+ steps:
25
+ - name: Checkout
26
+ uses: actions/checkout@v4
27
+
28
+ - name: Install uv
29
+ uses: astral-sh/setup-uv@v7
30
+ with:
31
+ python-version: "3.14"
32
+ enable-cache: true
33
+
34
+ - name: Sync dependencies
35
+ run: uv sync --locked --dev
36
+
37
+ - name: Check module layout
38
+ run: uv run python scripts/check_module_layout.py
39
+
40
+ - name: Ruff
41
+ run: uv run ruff check .
42
+
43
+ - name: Ty
44
+ run: uv run ty check .
45
+
46
+ - name: Pytest
47
+ run: uv run pytest -q -W error::DeprecationWarning
48
+
49
+ - name: Build distributions
50
+ run: uv build
51
+
52
+ - name: Publish distributions to PyPI
53
+ run: uv publish --trusted-publishing always
vctx-0.1.0/.gitignore ADDED
@@ -0,0 +1,31 @@
1
+ # Python
2
+ __pycache__/
3
+ *.py[cod]
4
+ *.pyo
5
+ *.pyd
6
+ .pytest_cache/
7
+ .ruff_cache/
8
+ .coverage
9
+ htmlcov/
10
+
11
+ # Virtual environments
12
+ .venv/
13
+ venv/
14
+
15
+ # Build artifacts
16
+ build/
17
+ dist/
18
+ *.egg-info/
19
+
20
+ # Local environment
21
+ .env
22
+ .env.*
23
+ !.env.example
24
+
25
+ # vctx local outputs / caches
26
+ out/
27
+ .cache/
28
+ .tmp/
29
+
30
+ # Local development reports
31
+ docs/report/
@@ -0,0 +1,229 @@
1
+ # Knowledge Flow Slice Priority Plan
2
+
3
+ > **For Hermes:** Use subagent-driven-development skill to implement this plan task-by-task.
4
+
5
+ **Goal:** Move `vctx` from an auditable deterministic evidence/knowledge-flow pack toward a useful video-site knowledge-flow summarizer without adding recursive/bloated validation layers.
6
+
7
+ **Architecture:** Keep the core pipeline evidence-linked and ergonomic. LLM summaries and non-deterministic model calls are acceptable when they produce a useful surface for a human or downstream AI. The failure mode to avoid is recursive enrichment: adding validation/graph/chapter layers that are hard to consume, beyond `vctx`'s role, or introduced without asking who needs them and how they will be used. Avoid chapters for now. Avoid broad claim-validation/rich-graph features unless they have a clear consumer-facing ergonomic payoff and a small verification surface.
8
+
9
+ **Tech Stack:** Python, Pydantic models, Typer CLI, pytest, ruff, ty, existing `vctx` transcript/visual/knowledge-flow modules.
10
+
11
+ ---
12
+
13
+ ## Priority Order
14
+
15
+ ### P0 — Plain-Prose Deterministic Knowledge-Flow Extraction
16
+
17
+ **Why first:** Current `knowledge_flow.json` only extracts explicit arrow chains (`A -> B -> C`). Most real videos explain workflows in prose. This slice gives the biggest usefulness jump with a small and verifiable user-facing contract. It should not block later LLM summary work; it gives that summary a better evidence spine.
18
+
19
+ **Scope:** Convert simple ordered prose into evidence-linked flow chains.
20
+
21
+ **In scope deterministic cues:**
22
+ - ordinal sequence: `first`, `then`, `next`, `finally`
23
+ - numbered steps: `step 1`, `step 2`, `1.`, `2.`
24
+ - input/output phrases: `input is`, `output is`, `produces`, `turns X into Y`
25
+ - pipeline/workflow phrases: `pipeline is A, B, C`, `workflow goes from A to B to C`
26
+
27
+ **Out of scope:**
28
+ - arbitrary semantic inference inside this slice
29
+ - adding graph taxonomies
30
+ - broad claim-validation subsystems
31
+
32
+ **Likely files:**
33
+ - Modify: `src/vctx/transforms/knowledge_flow.py`
34
+ - Test: `tests/test_knowledge_flow.py`
35
+ - Possibly docs: `docs/api.md`, `docs/workflow.md`
36
+
37
+ **TDD tasks:**
38
+ 1. Add RED test: `First acquire the URL. Then extract subtitles. Finally summarize.` -> `acquire the URL -> extract subtitles -> summarize` with `seg_000001` evidence.
39
+ 2. Add RED test: `Step 1: download media. Step 2: transcribe audio. Step 3: extract frames.` -> three-step chain.
40
+ 3. Add RED test: `The input is video URL. The output is knowledge-flow pack.` -> `video URL -> knowledge-flow pack`.
41
+ 4. Implement minimal deterministic extractors in `knowledge_flow.py`.
42
+ 5. Verify focused tests and full gate.
43
+
44
+ **Acceptance:**
45
+ - Produces `knowledge_flow.json` from plain prose without visual evidence.
46
+ - Every node/edge cites the segment ID.
47
+ - This slice does not require LLM calls.
48
+ - No new graph taxonomy.
49
+
50
+ ---
51
+
52
+ ### P1 — Ergonomic LLM Summary, Grounded by Existing Flow/Evidence
53
+
54
+ **Why second:** The user-facing product is a summary/knowledge-flow explanation, not only JSON. LLM summary is allowed and useful if its role is ergonomic: turn the existing transcript chunks, kept visual records, and `KnowledgeFlow` into a compact human/AI-readable explanation. Do not turn this into recursive validation or rich graph construction.
55
+
56
+ **Scope:** Add an optional summary artifact/section generated from bounded evidence inputs. If no model is configured, keep deterministic template rendering as fallback.
57
+
58
+ **Likely files:**
59
+ - Modify: `src/vctx/render/knowledge_flow_md.py`
60
+ - Modify: `src/vctx/render/context_md.py`
61
+ - Modify: `src/vctx/render/readable_md.py`
62
+ - Test: `tests/test_render_knowledge_flow.py`
63
+
64
+ **TDD tasks:**
65
+ 1. RED test: summary section answers “what is the workflow?” in 3-6 bullets/short paragraphs.
66
+ 2. RED test: every summary bullet cites source evidence IDs or flow chain evidence.
67
+ 3. RED test: missing model/config falls back to deterministic summary projection rather than failing the pack.
68
+ 4. Implement a narrow summary boundary that consumes existing artifacts; do not add new graph layers.
69
+ 5. Verify full gate.
70
+
71
+ **Acceptance:**
72
+ - Summary improves ergonomics for human/downstream AI reading.
73
+ - It does not introduce a validation subsystem.
74
+ - It does not invent new unsupported graph semantics.
75
+ - LLM output, if used, is bounded by existing evidence artifacts.
76
+
77
+ ---
78
+
79
+ ### P2 — Env-File Credential Presence for `model = "auto"`
80
+
81
+ **Why third:** Improves real usability without changing core semantics. Current adapter can read `runtime.env_files`, but auto route planning only sees shell env.
82
+
83
+ **Scope:** Let auto route discovery know that `OPENROUTER_API_KEY` exists in env files without exposing the value.
84
+
85
+ **Likely files:**
86
+ - Modify: `src/vctx/app/credentials.py` or add credential-presence helper
87
+ - Modify: `src/vctx/app/prepare.py`
88
+ - Test: likely `tests/test_prepare_visual_vlm.py` or new focused credential test
89
+
90
+ **TDD tasks:**
91
+ 1. RED test: config with `runtime.env_files = [".env"]` and `OPENROUTER_API_KEY=...` lets `model="auto"` select cached free VLM.
92
+ 2. Implement `credential_env_presence(...) -> Mapping[str, str]` or equivalent sentinel map.
93
+ 3. Ensure manifest does not include secret values.
94
+ 4. Verify full gate.
95
+
96
+ **Acceptance:**
97
+ - `.env`-only OpenRouter key works for route planning.
98
+ - Secret value never appears in manifest/artifacts.
99
+
100
+ ---
101
+
102
+ ### P3 — Optional Real-World Smoke Script, Not Default CI
103
+
104
+ **Why fourth:** Verifies actual video-site behavior without making CI flaky.
105
+
106
+ **Scope:** Add an opt-in script or documented command that exercises a real URL when env/config is available.
107
+
108
+ **Likely files:**
109
+ - Add: `scripts/smoke_video_knowledge_flow.py` or docs-only smoke section
110
+ - Docs: `docs/workflow.md`
111
+
112
+ **TDD stance:** This is smoke/manual, not default deterministic tests. Keep unit/integration tests mocked.
113
+
114
+ **Acceptance:**
115
+ - Command is opt-in.
116
+ - Skips clearly when no URL/network/key.
117
+ - Verifies files exist: `context.md`, `readable.md`, `knowledge_flow.json`, `manifest.json`.
118
+
119
+ ---
120
+
121
+ ### P4 — Optional LLM Essential-Case Extraction, Strict Fallback
122
+
123
+ **Why later:** Useful for better visual sampling, but introduces model variability. Only do after deterministic prose flow is useful.
124
+
125
+ **Scope:** `transcript -> EssentialVisualCase[]` through configured/free text model, with strict JSON validation and deterministic fallback.
126
+
127
+ **Guardrails:**
128
+ - LLM output is advisory, not authoritative.
129
+ - Invalid/missing output falls back to deterministic cases.
130
+ - Tests monkeypatch adapter; no live LLM in CI.
131
+
132
+ **Acceptance:**
133
+ - Typed cases only.
134
+ - Bad JSON fallback tested.
135
+ - No expansion into broad claim validation.
136
+
137
+ ---
138
+
139
+ ## Explicitly Deprioritized / Avoid for Now
140
+
141
+ ### Chapters
142
+
143
+ **Decision:** Deprioritize. The current goal is knowledge-flow summarization, not chaptering. Chapters add another output family and model route without improving the deterministic evidence spine.
144
+
145
+ **Revisit only if:** user specifically needs navigation/timestamps as a product output.
146
+
147
+ ### Rich Graph Semantics
148
+
149
+ **Decision:** Avoid for now.
150
+
151
+ Concerns:
152
+ - Node/edge taxonomies can become subjective.
153
+ - Verification can become recursive: feature adds semantics, then verifier needs semantics to validate semantics.
154
+ - Likely bloat relative to current deterministic flow needs.
155
+
156
+ **Allowed minimal invariant:** concept nodes + directed edges + evidence IDs only.
157
+
158
+ ### Broad Claim Validation
159
+
160
+ **Decision:** Avoid for now.
161
+
162
+ Concerns:
163
+ - Natural-language claim validation is recursively hard.
164
+ - It encourages building a second reasoning system to validate the first.
165
+ - It may bloat artifacts and tests without deterministic behavior.
166
+
167
+ **Allowed minimal invariant:** every generated node/edge must cite source evidence, and dropped visual records cannot support nodes/edges. This is already deterministic and testable.
168
+
169
+ ### LLM Summary
170
+
171
+ **Decision:** Allowed when it has an ergonomic contract.
172
+
173
+ Good use:
174
+ - compress transcript + kept visual records + knowledge flow into a readable explanation
175
+ - answer what a human/downstream AI actually needs next
176
+ - cite existing evidence IDs/chains
177
+
178
+ Bad use:
179
+ - generate a new recursive claim graph
180
+ - introduce broad validation layers before there is a consumer
181
+ - add artifacts whose only purpose is to justify other artifacts
182
+
183
+
184
+
185
+ ## Definition of “Complete Stage”
186
+
187
+ The current completed stage is:
188
+
189
+ ```text
190
+ deterministic auditable evidence/knowledge-flow pack generator
191
+ ```
192
+
193
+ It is complete when:
194
+ - `prepare` writes transcript/chunk/context artifacts.
195
+ - visual workflow can produce scored records when enabled.
196
+ - `knowledge_flow.json` exists when transcript/visual evidence contains explicit or simple-prose flow.
197
+ - `context.md` and `readable.md` render compact flow chains with evidence IDs.
198
+ - full gate passes.
199
+
200
+ It is not yet:
201
+
202
+ ```text
203
+ full semantic video summarizer
204
+ ```
205
+
206
+ That stage should be approached through ergonomic user/AI-facing surfaces with bounded evidence inputs, not through broad validation/rich-graph layers added for their own sake.
207
+
208
+ ---
209
+
210
+ ## Next Immediate Slice to Execute
211
+
212
+ ### Slice: Plain-Prose Deterministic Knowledge-Flow Extraction
213
+
214
+ **Commit message target:**
215
+
216
+ ```bash
217
+ git commit -m "feat: extract prose knowledge flow"
218
+ ```
219
+
220
+ **Verification command:**
221
+
222
+ ```bash
223
+ git diff --check -- docs src tests && uv run ruff check . && uv run ty check . && uv run pytest -q -W error::DeprecationWarning
224
+ ```
225
+
226
+ **Expected after completion:**
227
+ - Test count increases.
228
+ - `knowledge_flow.json` is useful for simple narrated workflows without arrows.
229
+ - This slice remains small: no chapters, no rich graph, no claim-validation expansion.
@@ -0,0 +1 @@
1
+ 3.14
vctx-0.1.0/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 nostalgia
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.
vctx-0.1.0/PKG-INFO ADDED
@@ -0,0 +1,25 @@
1
+ Metadata-Version: 2.4
2
+ Name: vctx
3
+ Version: 0.1.0
4
+ Summary: Video to context pack CLI for AI agents and automation.
5
+ Author-email: nostalgia <nostalucent@gmail.com>
6
+ License-Expression: MIT
7
+ License-File: LICENSE
8
+ Requires-Python: >=3.14
9
+ Requires-Dist: httpx>=0.28.1
10
+ Requires-Dist: platformdirs>=4.10.0
11
+ Requires-Dist: pydantic>=2.13.4
12
+ Requires-Dist: srt>=3.5.3
13
+ Requires-Dist: tenacity>=9.1.2
14
+ Requires-Dist: typer>=0.26.7
15
+ Requires-Dist: webvtt-py>=0.5.1
16
+ Requires-Dist: yt-dlp>=2026.3.17
17
+ Provides-Extra: asr
18
+ Requires-Dist: faster-whisper>=1.2.1; extra == 'asr'
19
+ Provides-Extra: full
20
+ Requires-Dist: faster-whisper>=1.2.1; extra == 'full'
21
+ Requires-Dist: onnxruntime>=1.20.0; extra == 'full'
22
+ Requires-Dist: rapidocr>=3.4.2; extra == 'full'
23
+ Provides-Extra: visual
24
+ Requires-Dist: onnxruntime>=1.20.0; extra == 'visual'
25
+ Requires-Dist: rapidocr>=3.4.2; extra == 'visual'
vctx-0.1.0/README.md ADDED
@@ -0,0 +1,134 @@
1
+ # vctx
2
+
3
+ `vctx` prepares clean context packs from video URLs, local media, and transcript files.
4
+
5
+ It is for people and agents who want source-grounded video context without a chat app, RAG stack, or hidden model workflow.
6
+
7
+ ## Install for development
8
+
9
+ ```bash
10
+ uv sync
11
+ ```
12
+
13
+ Optional local media/model extras:
14
+
15
+ ```bash
16
+ uv sync --extra asr
17
+ uv sync --extra visual
18
+ uv sync --extra full
19
+ ```
20
+
21
+ ## Essential API
22
+
23
+ ### Prepare a context pack
24
+
25
+ ```bash
26
+ uv run vctx prepare INPUT --out DIR
27
+ ```
28
+
29
+ Examples:
30
+
31
+ ```bash
32
+ uv run vctx prepare ./captions.srt --out ./out/captions
33
+ uv run vctx prepare ./lecture.vtt --out ./out/lecture
34
+ uv run vctx prepare "https://www.ted.com/talks/terry_moore_how_to_tie_your_shoes" --workflow visual --out ./out/ted
35
+ ```
36
+
37
+ ### Useful options
38
+
39
+ ```text
40
+ --workflow default|transcript|visual|full|metadata
41
+ --config PATH
42
+ --offline
43
+ --overwrite
44
+ --chunk-max-chars INT
45
+ --chunk-max-seconds INT
46
+ --cache-dir PATH
47
+ --verbose
48
+ --debug
49
+ ```
50
+
51
+ ### Inspect output
52
+
53
+ Start with:
54
+
55
+ ```text
56
+ DIR/manifest.json
57
+ DIR/readable.md
58
+ DIR/context.md
59
+ ```
60
+
61
+ Core artifacts:
62
+
63
+ ```text
64
+ metadata.json
65
+ transcript.raw.json
66
+ transcript.clean.json
67
+ chunks.json
68
+ transcript.md
69
+ ```
70
+
71
+ Optional visual artifacts:
72
+
73
+ ```text
74
+ visual_records.json OCR/VLM/capture evidence
75
+ visual_scores.json visual satisfaction diagnostics
76
+ visual/frames/*.png captured frames
77
+ ```
78
+
79
+ Optional flow artifact:
80
+
81
+ ```text
82
+ knowledge_flow.json
83
+ ```
84
+
85
+ ## Visual workflow
86
+
87
+ Visual runs use transcript-anchored motives. They fetch video only when useful visual evidence is planned.
88
+
89
+ ```text
90
+ transcript cues
91
+ -> visual motives
92
+ -> frame sampling
93
+ -> OCR and/or VLM description when available
94
+ -> capture records
95
+ -> visual_records.json + visual_scores.json
96
+ ```
97
+
98
+ Use `OPENROUTER_API_KEY` only when selecting OpenRouter-backed VLM/text routes. Secrets are read from environment or configured `.env` files and are not written to artifacts.
99
+
100
+ ### Minimal config selector examples
101
+
102
+ ```toml
103
+ [transforms.asr]
104
+ use = "instance:local-default"
105
+
106
+ [instances.asr.local-default]
107
+ type = "local-faster-whisper"
108
+ model_policy = "auto"
109
+
110
+ [transforms.visual_context]
111
+ use = "auto" # or "instance:my-vlm" / "openrouter:<model-id>"
112
+ ```
113
+
114
+ Transform config uses one selector field, `use`. Do not combine old-style `route`, `instance`, and `model` fields; named providers live under `[instances.asr.*]` and `[instances.vision.*]`.
115
+
116
+ ## What vctx is not
117
+
118
+ - not an AI chat app
119
+ - not a video Q&A system
120
+ - not a knowledge base
121
+ - not a vector/RAG framework
122
+ - not a web backend
123
+ - not a hidden paid model caller
124
+
125
+ ## Developer docs
126
+
127
+ - [`docs/api.md`](docs/api.md) — CLI/config/artifacts.
128
+ - [`docs/architecture.md`](docs/architecture.md) — boundaries.
129
+ - [`docs/graph/README.md`](docs/graph/README.md) — module/API graphs.
130
+ - [`docs/development.md`](docs/development.md) — develop/test/integration workflow.
131
+
132
+ ## License
133
+
134
+ MIT. See [`LICENSE`](LICENSE).