codex-can-see 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 (56) hide show
  1. codex_can_see-0.1.0/.agents/plugins/marketplace.json +20 -0
  2. codex_can_see-0.1.0/.claude-plugin/marketplace.json +14 -0
  3. codex_can_see-0.1.0/.gitignore +15 -0
  4. codex_can_see-0.1.0/LICENSE +21 -0
  5. codex_can_see-0.1.0/PKG-INFO +351 -0
  6. codex_can_see-0.1.0/README.md +329 -0
  7. codex_can_see-0.1.0/plugin/.claude-plugin/plugin.json +9 -0
  8. codex_can_see-0.1.0/plugin/.codex-plugin/plugin.json +6 -0
  9. codex_can_see-0.1.0/plugin/skills/codex-can-see/SKILL.md +54 -0
  10. codex_can_see-0.1.0/plugin/skills/codex-can-see/references/output-contract.md +29 -0
  11. codex_can_see-0.1.0/pyproject.toml +40 -0
  12. codex_can_see-0.1.0/src/codex_can_see/__init__.py +1 -0
  13. codex_can_see-0.1.0/src/codex_can_see/analyze.py +242 -0
  14. codex_can_see-0.1.0/src/codex_can_see/backend.py +154 -0
  15. codex_can_see-0.1.0/src/codex_can_see/bootstrap.py +176 -0
  16. codex_can_see-0.1.0/src/codex_can_see/captions.py +113 -0
  17. codex_can_see-0.1.0/src/codex_can_see/cli.py +92 -0
  18. codex_can_see-0.1.0/src/codex_can_see/config.py +411 -0
  19. codex_can_see-0.1.0/src/codex_can_see/doctor.py +300 -0
  20. codex_can_see-0.1.0/src/codex_can_see/download.py +224 -0
  21. codex_can_see-0.1.0/src/codex_can_see/evidence.py +95 -0
  22. codex_can_see-0.1.0/src/codex_can_see/frames.py +758 -0
  23. codex_can_see-0.1.0/src/codex_can_see/log.py +15 -0
  24. codex_can_see-0.1.0/src/codex_can_see/provider_spec.py +205 -0
  25. codex_can_see-0.1.0/src/codex_can_see/providers/__init__.py +0 -0
  26. codex_can_see-0.1.0/src/codex_can_see/providers/anthropic.yaml +28 -0
  27. codex_can_see-0.1.0/src/codex_can_see/providers/openai.yaml +25 -0
  28. codex_can_see-0.1.0/src/codex_can_see/report.py +78 -0
  29. codex_can_see-0.1.0/src/codex_can_see/resilient.py +91 -0
  30. codex_can_see-0.1.0/src/codex_can_see/runtime.py +35 -0
  31. codex_can_see-0.1.0/src/codex_can_see/setup.py +349 -0
  32. codex_can_see-0.1.0/src/codex_can_see/state.py +183 -0
  33. codex_can_see-0.1.0/src/codex_can_see/strategy_base.py +22 -0
  34. codex_can_see-0.1.0/src/codex_can_see/strategy_local.py +13 -0
  35. codex_can_see-0.1.0/src/codex_can_see/strategy_provider.py +205 -0
  36. codex_can_see-0.1.0/src/codex_can_see/time_window.py +81 -0
  37. codex_can_see-0.1.0/src/codex_can_see/transcribe_mlx.py +24 -0
  38. codex_can_see-0.1.0/src/codex_can_see/transcript.py +262 -0
  39. codex_can_see-0.1.0/tests/test_analysis_pipeline.py +178 -0
  40. codex_can_see-0.1.0/tests/test_backend.py +127 -0
  41. codex_can_see-0.1.0/tests/test_bootstrap.py +231 -0
  42. codex_can_see-0.1.0/tests/test_cli_contract.py +94 -0
  43. codex_can_see-0.1.0/tests/test_config.py +381 -0
  44. codex_can_see-0.1.0/tests/test_docs_release.py +55 -0
  45. codex_can_see-0.1.0/tests/test_doctor.py +182 -0
  46. codex_can_see-0.1.0/tests/test_download.py +19 -0
  47. codex_can_see-0.1.0/tests/test_packaging.py +89 -0
  48. codex_can_see-0.1.0/tests/test_pipeline_logging.py +108 -0
  49. codex_can_see-0.1.0/tests/test_plugin_layout.py +109 -0
  50. codex_can_see-0.1.0/tests/test_provider.py +577 -0
  51. codex_can_see-0.1.0/tests/test_report.py +94 -0
  52. codex_can_see-0.1.0/tests/test_resilient.py +64 -0
  53. codex_can_see-0.1.0/tests/test_setup.py +233 -0
  54. codex_can_see-0.1.0/tests/test_state.py +120 -0
  55. codex_can_see-0.1.0/tests/test_time_window.py +89 -0
  56. codex_can_see-0.1.0/tests/test_transcript.py +287 -0
@@ -0,0 +1,20 @@
1
+ {
2
+ "name": "codex-can-see-marketplace",
3
+ "interface": {
4
+ "displayName": "Codex Can See"
5
+ },
6
+ "plugins": [
7
+ {
8
+ "name": "codex-can-see",
9
+ "source": {
10
+ "source": "local",
11
+ "path": "./plugin"
12
+ },
13
+ "policy": {
14
+ "installation": "AVAILABLE",
15
+ "authentication": "ON_INSTALL"
16
+ },
17
+ "category": "Productivity"
18
+ }
19
+ ]
20
+ }
@@ -0,0 +1,14 @@
1
+ {
2
+ "name": "codex-can-see-marketplace",
3
+ "description": "Local-first, frame-backed video analysis",
4
+ "owner": {
5
+ "name": "Codex Can See contributors"
6
+ },
7
+ "plugins": [
8
+ {
9
+ "name": "codex-can-see",
10
+ "source": "./plugin",
11
+ "description": "Analyze video with local, verifiable frame evidence"
12
+ }
13
+ ]
14
+ }
@@ -0,0 +1,15 @@
1
+ __pycache__/
2
+ *.pyc
3
+ .venv
4
+ *.mp4
5
+ *.jpg
6
+ *.json.tmp
7
+ .DS_Store
8
+ work-test/
9
+ *.mp4
10
+ *.mp3
11
+ custom-override.yaml
12
+ dist/
13
+ uv.lock
14
+
15
+ .idea/
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 monodeepdas1215
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.
@@ -0,0 +1,351 @@
1
+ Metadata-Version: 2.5
2
+ Name: codex-can-see
3
+ Version: 0.1.0
4
+ Summary: Local-first, frame-backed video analysis with verifiable evidence
5
+ License-Expression: MIT
6
+ License-File: LICENSE
7
+ Requires-Python: >=3.12
8
+ Requires-Dist: pyyaml<7,>=6
9
+ Requires-Dist: tomli-w<2,>=1.2
10
+ Requires-Dist: yt-dlp<2027,>=2026.8.19
11
+ Provides-Extra: full-cpu
12
+ Requires-Dist: torch==2.8.0; extra == 'full-cpu'
13
+ Requires-Dist: torchaudio==2.8.0; extra == 'full-cpu'
14
+ Requires-Dist: whisperx==3.8.6; extra == 'full-cpu'
15
+ Provides-Extra: full-cuda
16
+ Requires-Dist: torch==2.8.0; extra == 'full-cuda'
17
+ Requires-Dist: torchaudio==2.8.0; extra == 'full-cuda'
18
+ Requires-Dist: whisperx==3.8.6; extra == 'full-cuda'
19
+ Provides-Extra: full-mlx
20
+ Requires-Dist: mlx-whisper==0.4.3; extra == 'full-mlx'
21
+ Description-Content-Type: text/markdown
22
+
23
+ # Codex Can See
24
+
25
+ Codex Can See is a local-first, agent-friendly video evidence tool. It extracts verifiable frames, optionally adds local transcription, asks a configured vision-language model for analysis, and emits one JSON object on stdout for agents to parse. People can inspect the same frames, transcript, report, and work directory.
26
+
27
+ ## How it works
28
+
29
+ ```text
30
+ plugin instructions -> non-mutating doctor -> local evidence extraction -> configured provider -> JSON + report
31
+ ```
32
+
33
+ The plugin never contains Python source code, credentials, state, or an installer. The pinned bootstrap command installs a persistent uv-managed tool environment and records readiness under `~/.config/codex-can-see/`.
34
+
35
+ ## Requirements
36
+
37
+ - macOS Apple Silicon, macOS x86_64, or Linux x86_64
38
+ - [uv](https://docs.astral.sh/uv/)
39
+ - `ffmpeg`
40
+ - `ffprobe`
41
+ - A provider key for OpenAI or Anthropic
42
+
43
+ Windows is unsupported in v0.1.0. Linux CUDA is implemented but remains runtime-untested until validated on real NVIDIA hardware.
44
+
45
+ ## Direct installation
46
+
47
+ Use `uvx` only for first-run bootstrap:
48
+
49
+ ```bash
50
+ uvx codex-can-see@0.1.0 bootstrap \
51
+ --provider openai \
52
+ --transcription yes
53
+ ```
54
+
55
+ Bootstrap then performs the persistent installation itself. After setup, invoke the installed CLI directly:
56
+
57
+ ```bash
58
+ codex-can-see doctor --mode invocation --json
59
+ codex-can-see analyze "$HOME/Movies/demo.mp4" \
60
+ --between 00:10:00 00:13:00 \
61
+ --question "What does the person do with the package?"
62
+ ```
63
+
64
+ For a smaller frame-provider installation without local transcription:
65
+
66
+ ```bash
67
+ uvx codex-can-see@0.1.0 bootstrap \
68
+ --provider anthropic \
69
+ --transcription no
70
+ ```
71
+
72
+ A provider is required even when transcription is disabled because Codex Can See always uses frame-backed provider analysis.
73
+
74
+ ### Non-interactive key input
75
+
76
+ Export the selected provider key before bootstrap:
77
+
78
+ ```bash
79
+ read -r -s OPENAI_API_KEY
80
+ export OPENAI_API_KEY
81
+ uvx codex-can-see@0.1.0 bootstrap --provider openai --transcription yes
82
+ unset OPENAI_API_KEY
83
+ ```
84
+
85
+ Alternatively, pipe exactly one key:
86
+
87
+ ```bash
88
+ printf '%s\n' "$OPENAI_API_KEY" | \
89
+ uvx codex-can-see@0.1.0 bootstrap \
90
+ --provider openai \
91
+ --transcription yes \
92
+ --key-stdin
93
+ ```
94
+
95
+ The key is stored only in `~/.config/codex-can-see/.env`. It is not placed in command arguments, state, runtime configuration, logs, stdout, or the plugin.
96
+
97
+ ## Install as a Codex skill plugin
98
+
99
+ This is a three-step process: register the catalog, install the plugin payload, then bootstrap the Python runtime.
100
+
101
+ ```bash
102
+ # 1. Register the marketplace/catalog
103
+ codex plugin marketplace add monodeepdas1215/codex-can-see --ref v0.1.0
104
+
105
+ # 2. Install the actual plugin
106
+ codex plugin add codex-can-see@codex-can-see-marketplace
107
+
108
+ # 3. Bootstrap the persistent runtime
109
+ uvx codex-can-see@0.1.0 bootstrap \
110
+ --provider openai \
111
+ --transcription yes
112
+ ```
113
+
114
+ ## Install as a Claude Code skill plugin
115
+
116
+ ```bash
117
+ # 1. Register the marketplace/catalog
118
+ claude plugin marketplace add monodeepdas1215/codex-can-see
119
+
120
+ # 2. Install the actual plugin
121
+ claude plugin install codex-can-see@codex-can-see-marketplace
122
+
123
+ # 3. Bootstrap the persistent runtime
124
+ uvx codex-can-see@0.1.0 bootstrap \
125
+ --provider anthropic \
126
+ --transcription yes
127
+ ```
128
+
129
+ The installed skill begins with `codex-can-see doctor --mode invocation --json`. It does not install dependencies, download models, mutate state, or ask for credentials during analysis.
130
+
131
+ ## Runtime profiles
132
+
133
+ | Platform/profile | Local runtime | Fixed model | Package |
134
+ |---|---|---|---|
135
+ | Darwin/arm64 | MLX Whisper | `mlx-community/whisper-small-mlx` | `codex-can-see[full-mlx]` |
136
+ | Darwin/x86_64 | WhisperX CPU | `small` | `codex-can-see[full-cpu]` |
137
+ | Linux/x86_64 CPU | WhisperX CPU | `small` | `codex-can-see[full-cpu]` |
138
+ | Linux/x86_64 CUDA 12.6+ | WhisperX CUDA | `small` | `codex-can-see[full-cuda]` |
139
+ | Transcription disabled | none | none | `codex-can-see` |
140
+
141
+ Whisper model selection is fixed and intentionally not a public setting. A disabled transcription profile performs no model warm-up and checks no model cache, but frame extraction and provider analysis continue.
142
+
143
+ URL sources use the yt-dlp executable installed inside the persistent Codex Can See tool environment. Local files do not make network requests.
144
+
145
+ ## Command interface
146
+
147
+ ```bash
148
+ codex-can-see analyze SOURCE \
149
+ (--start TIME --end TIME | --at TIME | --after TIME | --before TIME | --between TIME TIME) \
150
+ [--question TEXT] \
151
+ [--out-dir DIR]
152
+ ```
153
+
154
+ Only one time-filter form is allowed:
155
+
156
+ | Form | Window |
157
+ |---|---|
158
+ | `--start 10:00 --end 13:00` | exactly `[10:00, 13:00]` |
159
+ | `--between 10:00 13:00` | `[10:00, 13:00]` |
160
+ | `--after 10:00` | `[10:00, end-of-media]` |
161
+ | `--before 13:00` | `[media-start, 13:00]` |
162
+ | `--at 14:32` | `[14:32, 14:37]` |
163
+
164
+ Timestamps remain on the original media timeline.
165
+
166
+ `--out-dir` is request-specific:
167
+
168
+ - missing directories, including parents, are created;
169
+ - an existing empty directory is accepted;
170
+ - a non-directory is rejected;
171
+ - a non-empty directory is rejected to prevent stale artifact mixing;
172
+ - `work_dir` is always an absolute path.
173
+
174
+ Unknown arguments use normal command-line usage errors. Provider, model, frame count, frame quality, frame dimensions, and output format are setup-time settings, not analyze arguments.
175
+
176
+ ## Readiness and exit codes
177
+
178
+ Always start with:
179
+
180
+ ```bash
181
+ codex-can-see doctor --mode invocation --json
182
+ ```
183
+
184
+ The doctor checks state, package version, runtime configuration, provider/key presence, ffmpeg, ffprobe, yt-dlp, backend/profile consistency, and fixed model cache when transcription is enabled. It performs no installation, provider request, model download, state repair, or prompt.
185
+
186
+ ```text
187
+ 0 ready/success
188
+ 2 usage or provider resolution error
189
+ 3 state/schema/package mismatch or incomplete setup
190
+ 4 missing ffmpeg, ffprobe, or yt-dlp
191
+ 5 provider configuration error
192
+ 6 backend/profile mismatch
193
+ 7 bootstrap/runtime installation failure
194
+ 8 media/evidence processing failure
195
+ ```
196
+
197
+ Provider failure during analysis is different from a setup error: Codex Can See preserves local evidence, writes the report, emits valid JSON, sets `answer: null`, adds a redacted warning, and exits `0`.
198
+
199
+ ## Provider and frame overrides
200
+
201
+ Bootstrap accepts one non-secret YAML override:
202
+
203
+ ```yaml
204
+ schema: codex-can-see/runtime-override/v1
205
+ provider: openai
206
+
207
+ auth:
208
+ env: EXAMPLE_API_KEY
209
+ endpoint:
210
+ base_url: https://replacement.example/v1
211
+ model:
212
+ default: compatible-model
213
+
214
+ frames:
215
+ count: 16
216
+ quality: 0.80
217
+ max_dimension: 1280
218
+ ```
219
+
220
+ Install it with:
221
+
222
+ ```bash
223
+ export EXAMPLE_API_KEY="..."
224
+ uvx codex-can-see@0.1.0 bootstrap \
225
+ --provider openai \
226
+ --transcription yes \
227
+ --provider-overrides ./runtime-override.yaml
228
+ ```
229
+
230
+ Allowed bounds are:
231
+
232
+ ```text
233
+ frames.count 1..100
234
+ frames.quality 0.0..1.0
235
+ frames.max_dimension 16..4096
236
+ ```
237
+
238
+ Defaults are `12`, `0.75`, and `1024`. A custom `auth.env` is a variable name, never a secret value.
239
+
240
+ ## Private configuration
241
+
242
+ Readiness and profile metadata are stored in `~/.config/codex-can-see/state.toml`.
243
+
244
+ ```text
245
+ ~/.config/codex-can-see/
246
+ ├── state.toml
247
+ ├── runtime.json
248
+ ├── provider-overrides.json
249
+ └── .env
250
+ ```
251
+
252
+ The directory mode is `0700`; files are mode `0600` and are replaced atomically. `state.toml` contains no key values. Switching providers writes the newly selected key and removes the previous provider's saved key.
253
+
254
+ ## Output contract
255
+
256
+ stdout contains exactly one JSON object. Diagnostics go to stderr.
257
+
258
+ ```json
259
+ {
260
+ "source": {
261
+ "url": "/absolute/path/demo.mp4",
262
+ "duration_sec": 1200.0,
263
+ "title": "demo.mp4"
264
+ },
265
+ "analysis_window": {
266
+ "requested_form": "between",
267
+ "start_seconds": 600.0,
268
+ "end_seconds": 780.0
269
+ },
270
+ "answer": {
271
+ "provider": "openai",
272
+ "model": "gpt-4o",
273
+ "text": "The person lifts the package..."
274
+ },
275
+ "evidence": {
276
+ "frames": [
277
+ {
278
+ "path": "/absolute/path/frames/frame_000.jpg",
279
+ "timestamp_sec": 600.0
280
+ }
281
+ ],
282
+ "transcript": [],
283
+ "transcript_source": "none",
284
+ "transcript_status": "disabled",
285
+ "transcript_error": null
286
+ },
287
+ "warnings": [],
288
+ "work_dir": "/absolute/path"
289
+ }
290
+ ```
291
+
292
+ Interpret transcript status exactly:
293
+
294
+ | Status | Meaning |
295
+ |---|---|
296
+ | `ok` | Transcript segments are available. |
297
+ | `no_speech` | Local Whisper completed and found no speech. |
298
+ | `unavailable` | Local transcription failed; inspect `transcript_error`. |
299
+ | `disabled` | The installed profile intentionally excludes transcription. |
300
+
301
+ `disabled` is not a media observation. `unavailable` does not invalidate frame evidence.
302
+
303
+ ## Work directory
304
+
305
+ `work_dir` contains:
306
+
307
+ - `frames/frame_000.jpg` and sibling keyframes;
308
+ - `frames.json`;
309
+ - `transcript.txt`;
310
+ - `transcription.json` when local Whisper runs;
311
+ - downloaded media and metadata for URL sources;
312
+ - `report.md`.
313
+
314
+ Frame paths in JSON are absolute. Open them directly when visual verification is possible.
315
+
316
+ ## Development
317
+
318
+ Run tests without creating a public development extra:
319
+
320
+ ```bash
321
+ uv run --with pytest --with PyYAML python -m pytest -q
322
+ ```
323
+
324
+ Build Python and plugin artifacts:
325
+
326
+ ```bash
327
+ uv build
328
+ uv run python scripts/build_plugin.py
329
+ ```
330
+
331
+ Validate both plugin surfaces:
332
+
333
+ ```bash
334
+ claude plugin validate ./plugin --strict
335
+ claude plugin validate ./ --strict
336
+ ```
337
+
338
+ ## Uninstall
339
+
340
+ Remove the Python runtime and private configuration:
341
+
342
+ ```bash
343
+ uv tool uninstall codex-can-see
344
+ rm -rf ~/.config/codex-can-see
345
+ ```
346
+
347
+ Remove the agent plugin through Codex or Claude. Agent-plugin removal does not delete user media or Python state.
348
+
349
+ ## License
350
+
351
+ MIT. See [LICENSE](LICENSE).