@oriro/orirocli 0.1.9 → 0.1.12
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.
- package/README.md +16 -18
- package/dist/cli.js +4776 -2964
- package/package.json +2 -2
- package/skills/craft/ai-engineering/SKILL.md +2 -2
- package/skills/graphify/SKILL.md +0 -619
- package/skills/graphify/__init__.py +0 -28
- package/skills/graphify/__main__.py +0 -4582
- package/skills/graphify/affected.py +0 -154
- package/skills/graphify/always_on/agents-md.md +0 -12
- package/skills/graphify/always_on/antigravity-rules.md +0 -14
- package/skills/graphify/always_on/claude-md.md +0 -9
- package/skills/graphify/always_on/gemini-md.md +0 -9
- package/skills/graphify/always_on/kiro-steering.md +0 -5
- package/skills/graphify/always_on/vscode-instructions.md +0 -17
- package/skills/graphify/analyze.py +0 -724
- package/skills/graphify/benchmark.py +0 -155
- package/skills/graphify/build.py +0 -487
- package/skills/graphify/cache.py +0 -417
- package/skills/graphify/callflow_html.py +0 -2020
- package/skills/graphify/cluster.py +0 -272
- package/skills/graphify/command-kilo.md +0 -15
- package/skills/graphify/dedup.py +0 -429
- package/skills/graphify/detect.py +0 -1379
- package/skills/graphify/diagnostics.py +0 -390
- package/skills/graphify/export.py +0 -1408
- package/skills/graphify/extract.py +0 -11570
- package/skills/graphify/global_graph.py +0 -159
- package/skills/graphify/google_workspace.py +0 -223
- package/skills/graphify/hooks.py +0 -457
- package/skills/graphify/ingest.py +0 -331
- package/skills/graphify/llm.py +0 -1896
- package/skills/graphify/manifest.py +0 -4
- package/skills/graphify/mcp_ingest.py +0 -392
- package/skills/graphify/multigraph_compat.py +0 -212
- package/skills/graphify/pg_introspect.py +0 -142
- package/skills/graphify/prs.py +0 -748
- package/skills/graphify/querylog.py +0 -70
- package/skills/graphify/report.py +0 -218
- package/skills/graphify/scip_ingest.py +0 -363
- package/skills/graphify/security.py +0 -336
- package/skills/graphify/semantic_cleanup.py +0 -319
- package/skills/graphify/serve.py +0 -1309
- package/skills/graphify/skill-aider.md +0 -1246
- package/skills/graphify/skill-amp.md +0 -613
- package/skills/graphify/skill-claw.md +0 -616
- package/skills/graphify/skill-codex.md +0 -613
- package/skills/graphify/skill-copilot.md +0 -616
- package/skills/graphify/skill-devin.md +0 -1372
- package/skills/graphify/skill-droid.md +0 -613
- package/skills/graphify/skill-kilo.md +0 -625
- package/skills/graphify/skill-kiro.md +0 -615
- package/skills/graphify/skill-opencode.md +0 -608
- package/skills/graphify/skill-pi.md +0 -615
- package/skills/graphify/skill-trae.md +0 -614
- package/skills/graphify/skill-vscode.md +0 -612
- package/skills/graphify/skill-windows.md +0 -651
- package/skills/graphify/skills/amp/references/add-watch.md +0 -56
- package/skills/graphify/skills/amp/references/exports.md +0 -71
- package/skills/graphify/skills/amp/references/extraction-spec.md +0 -68
- package/skills/graphify/skills/amp/references/github-and-merge.md +0 -46
- package/skills/graphify/skills/amp/references/hooks.md +0 -33
- package/skills/graphify/skills/amp/references/query.md +0 -249
- package/skills/graphify/skills/amp/references/transcribe.md +0 -48
- package/skills/graphify/skills/amp/references/update.md +0 -179
- package/skills/graphify/skills/claude/references/add-watch.md +0 -56
- package/skills/graphify/skills/claude/references/exports.md +0 -71
- package/skills/graphify/skills/claude/references/extraction-spec.md +0 -68
- package/skills/graphify/skills/claude/references/github-and-merge.md +0 -46
- package/skills/graphify/skills/claude/references/hooks.md +0 -33
- package/skills/graphify/skills/claude/references/query.md +0 -103
- package/skills/graphify/skills/claude/references/transcribe.md +0 -48
- package/skills/graphify/skills/claude/references/update.md +0 -179
- package/skills/graphify/skills/claw/references/add-watch.md +0 -56
- package/skills/graphify/skills/claw/references/exports.md +0 -71
- package/skills/graphify/skills/claw/references/extraction-spec.md +0 -29
- package/skills/graphify/skills/claw/references/github-and-merge.md +0 -46
- package/skills/graphify/skills/claw/references/hooks.md +0 -33
- package/skills/graphify/skills/claw/references/query.md +0 -249
- package/skills/graphify/skills/claw/references/transcribe.md +0 -48
- package/skills/graphify/skills/claw/references/update.md +0 -179
- package/skills/graphify/skills/codex/references/add-watch.md +0 -56
- package/skills/graphify/skills/codex/references/exports.md +0 -71
- package/skills/graphify/skills/codex/references/extraction-spec.md +0 -29
- package/skills/graphify/skills/codex/references/github-and-merge.md +0 -46
- package/skills/graphify/skills/codex/references/hooks.md +0 -33
- package/skills/graphify/skills/codex/references/query.md +0 -249
- package/skills/graphify/skills/codex/references/transcribe.md +0 -48
- package/skills/graphify/skills/codex/references/update.md +0 -179
- package/skills/graphify/skills/copilot/references/add-watch.md +0 -56
- package/skills/graphify/skills/copilot/references/exports.md +0 -71
- package/skills/graphify/skills/copilot/references/extraction-spec.md +0 -68
- package/skills/graphify/skills/copilot/references/github-and-merge.md +0 -46
- package/skills/graphify/skills/copilot/references/hooks.md +0 -33
- package/skills/graphify/skills/copilot/references/query.md +0 -249
- package/skills/graphify/skills/copilot/references/transcribe.md +0 -48
- package/skills/graphify/skills/copilot/references/update.md +0 -179
- package/skills/graphify/skills/droid/references/add-watch.md +0 -56
- package/skills/graphify/skills/droid/references/exports.md +0 -71
- package/skills/graphify/skills/droid/references/extraction-spec.md +0 -68
- package/skills/graphify/skills/droid/references/github-and-merge.md +0 -46
- package/skills/graphify/skills/droid/references/hooks.md +0 -33
- package/skills/graphify/skills/droid/references/query.md +0 -249
- package/skills/graphify/skills/droid/references/transcribe.md +0 -48
- package/skills/graphify/skills/droid/references/update.md +0 -179
- package/skills/graphify/skills/kilo/references/add-watch.md +0 -56
- package/skills/graphify/skills/kilo/references/exports.md +0 -71
- package/skills/graphify/skills/kilo/references/extraction-spec.md +0 -68
- package/skills/graphify/skills/kilo/references/github-and-merge.md +0 -46
- package/skills/graphify/skills/kilo/references/hooks.md +0 -33
- package/skills/graphify/skills/kilo/references/query.md +0 -249
- package/skills/graphify/skills/kilo/references/transcribe.md +0 -48
- package/skills/graphify/skills/kilo/references/update.md +0 -179
- package/skills/graphify/skills/kiro/references/add-watch.md +0 -56
- package/skills/graphify/skills/kiro/references/exports.md +0 -71
- package/skills/graphify/skills/kiro/references/extraction-spec.md +0 -29
- package/skills/graphify/skills/kiro/references/github-and-merge.md +0 -46
- package/skills/graphify/skills/kiro/references/hooks.md +0 -33
- package/skills/graphify/skills/kiro/references/query.md +0 -249
- package/skills/graphify/skills/kiro/references/transcribe.md +0 -48
- package/skills/graphify/skills/kiro/references/update.md +0 -179
- package/skills/graphify/skills/opencode/references/add-watch.md +0 -56
- package/skills/graphify/skills/opencode/references/exports.md +0 -71
- package/skills/graphify/skills/opencode/references/extraction-spec.md +0 -68
- package/skills/graphify/skills/opencode/references/github-and-merge.md +0 -46
- package/skills/graphify/skills/opencode/references/hooks.md +0 -33
- package/skills/graphify/skills/opencode/references/query.md +0 -249
- package/skills/graphify/skills/opencode/references/transcribe.md +0 -48
- package/skills/graphify/skills/opencode/references/update.md +0 -179
- package/skills/graphify/skills/pi/references/add-watch.md +0 -56
- package/skills/graphify/skills/pi/references/exports.md +0 -71
- package/skills/graphify/skills/pi/references/extraction-spec.md +0 -29
- package/skills/graphify/skills/pi/references/github-and-merge.md +0 -46
- package/skills/graphify/skills/pi/references/hooks.md +0 -33
- package/skills/graphify/skills/pi/references/query.md +0 -249
- package/skills/graphify/skills/pi/references/transcribe.md +0 -48
- package/skills/graphify/skills/pi/references/update.md +0 -179
- package/skills/graphify/skills/trae/references/add-watch.md +0 -56
- package/skills/graphify/skills/trae/references/exports.md +0 -71
- package/skills/graphify/skills/trae/references/extraction-spec.md +0 -68
- package/skills/graphify/skills/trae/references/github-and-merge.md +0 -46
- package/skills/graphify/skills/trae/references/hooks.md +0 -35
- package/skills/graphify/skills/trae/references/query.md +0 -249
- package/skills/graphify/skills/trae/references/transcribe.md +0 -48
- package/skills/graphify/skills/trae/references/update.md +0 -179
- package/skills/graphify/skills/vscode/references/add-watch.md +0 -56
- package/skills/graphify/skills/vscode/references/exports.md +0 -71
- package/skills/graphify/skills/vscode/references/extraction-spec.md +0 -68
- package/skills/graphify/skills/vscode/references/github-and-merge.md +0 -46
- package/skills/graphify/skills/vscode/references/hooks.md +0 -33
- package/skills/graphify/skills/vscode/references/query.md +0 -249
- package/skills/graphify/skills/vscode/references/transcribe.md +0 -48
- package/skills/graphify/skills/vscode/references/update.md +0 -179
- package/skills/graphify/skills/windows/references/add-watch.md +0 -56
- package/skills/graphify/skills/windows/references/exports.md +0 -71
- package/skills/graphify/skills/windows/references/extraction-spec.md +0 -68
- package/skills/graphify/skills/windows/references/github-and-merge.md +0 -46
- package/skills/graphify/skills/windows/references/hooks.md +0 -33
- package/skills/graphify/skills/windows/references/query.md +0 -249
- package/skills/graphify/skills/windows/references/transcribe.md +0 -48
- package/skills/graphify/skills/windows/references/update.md +0 -179
- package/skills/graphify/symbol_resolution.py +0 -538
- package/skills/graphify/transcribe.py +0 -184
- package/skills/graphify/tree_html.py +0 -582
- package/skills/graphify/validate.py +0 -72
- package/skills/graphify/watch.py +0 -898
- package/skills/graphify/wiki.py +0 -282
|
@@ -1,184 +0,0 @@
|
|
|
1
|
-
# Video transcription using faster-whisper
|
|
2
|
-
# Converts video/audio files to text transcripts for graph extraction
|
|
3
|
-
from __future__ import annotations
|
|
4
|
-
|
|
5
|
-
import os
|
|
6
|
-
from pathlib import Path
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
VIDEO_EXTENSIONS = {'.mp4', '.mov', '.webm', '.mkv', '.avi', '.m4v', '.mp3', '.wav', '.m4a', '.ogg'}
|
|
10
|
-
URL_PREFIXES = ('http://', 'https://', 'www.')
|
|
11
|
-
|
|
12
|
-
_DEFAULT_MODEL = "base"
|
|
13
|
-
_TRANSCRIPTS_DIR = "graphify-out/transcripts"
|
|
14
|
-
_FALLBACK_PROMPT = "Use proper punctuation and paragraph breaks."
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
def _model_name() -> str:
|
|
18
|
-
return os.environ.get("GRAPHIFY_WHISPER_MODEL", _DEFAULT_MODEL)
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
def _get_whisper():
|
|
22
|
-
try:
|
|
23
|
-
from faster_whisper import WhisperModel
|
|
24
|
-
return WhisperModel
|
|
25
|
-
except ImportError as exc:
|
|
26
|
-
raise ImportError(
|
|
27
|
-
"Video transcription requires faster-whisper. "
|
|
28
|
-
"Run: pip install 'graphifyy[video]'"
|
|
29
|
-
) from exc
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
def _get_yt_dlp():
|
|
33
|
-
try:
|
|
34
|
-
import yt_dlp
|
|
35
|
-
return yt_dlp
|
|
36
|
-
except ImportError as exc:
|
|
37
|
-
raise ImportError(
|
|
38
|
-
"YouTube/URL download requires yt-dlp. "
|
|
39
|
-
"Run: pip install 'graphifyy[video]'"
|
|
40
|
-
) from exc
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
def is_url(path: str) -> bool:
|
|
44
|
-
"""Return True if the string looks like a URL rather than a file path."""
|
|
45
|
-
return any(path.startswith(p) for p in URL_PREFIXES)
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
def download_audio(url: str, output_dir: Path) -> Path:
|
|
49
|
-
"""Download audio-only stream from a URL using yt-dlp.
|
|
50
|
-
|
|
51
|
-
Returns the path to the downloaded audio file (.m4a or .opus).
|
|
52
|
-
Uses cached file if already downloaded.
|
|
53
|
-
"""
|
|
54
|
-
from graphify.security import validate_url
|
|
55
|
-
validate_url(url) # blocks private IPs, bad schemes before yt-dlp runs
|
|
56
|
-
yt_dlp = _get_yt_dlp()
|
|
57
|
-
output_dir.mkdir(parents=True, exist_ok=True)
|
|
58
|
-
|
|
59
|
-
# yt-dlp uses %(title)s which can be long/weird — use a stable name based on URL hash
|
|
60
|
-
import hashlib
|
|
61
|
-
url_hash = hashlib.sha1(url.encode(), usedforsecurity=False).hexdigest()[:12]
|
|
62
|
-
out_template = str(output_dir / f"yt_{url_hash}.%(ext)s")
|
|
63
|
-
|
|
64
|
-
# Check for already-downloaded file
|
|
65
|
-
for ext in ('.m4a', '.opus', '.mp3', '.ogg', '.wav', '.webm'):
|
|
66
|
-
candidate = output_dir / f"yt_{url_hash}{ext}"
|
|
67
|
-
if candidate.exists():
|
|
68
|
-
print(f" cached audio: {candidate.name}")
|
|
69
|
-
return candidate
|
|
70
|
-
|
|
71
|
-
ydl_opts = {
|
|
72
|
-
'format': 'bestaudio[ext=m4a]/bestaudio/best',
|
|
73
|
-
'outtmpl': out_template,
|
|
74
|
-
'quiet': True,
|
|
75
|
-
'no_warnings': True,
|
|
76
|
-
'noplaylist': True,
|
|
77
|
-
'postprocessors': [], # no ffmpeg needed — use native audio
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
print(f" downloading audio: {url[:80]} ...", flush=True)
|
|
81
|
-
with yt_dlp.YoutubeDL(ydl_opts) as ydl:
|
|
82
|
-
info = ydl.extract_info(url, download=True)
|
|
83
|
-
ext = info.get('ext', 'm4a')
|
|
84
|
-
downloaded = output_dir / f"yt_{url_hash}.{ext}"
|
|
85
|
-
if not downloaded.exists():
|
|
86
|
-
# yt-dlp may have picked a different extension
|
|
87
|
-
for p in output_dir.glob(f"yt_{url_hash}.*"):
|
|
88
|
-
downloaded = p
|
|
89
|
-
break
|
|
90
|
-
return downloaded
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
def build_whisper_prompt(god_nodes: list[dict]) -> str:
|
|
94
|
-
"""Build a domain hint for Whisper from god nodes extracted from the corpus.
|
|
95
|
-
|
|
96
|
-
Formats the top god node labels into a topic string for Whisper.
|
|
97
|
-
The coding agent (Claude Code, Codex, etc.) generates the actual one-sentence
|
|
98
|
-
domain hint from these labels and passes it via GRAPHIFY_WHISPER_PROMPT or
|
|
99
|
-
as initial_prompt — no separate API call needed here.
|
|
100
|
-
"""
|
|
101
|
-
if not god_nodes:
|
|
102
|
-
return _FALLBACK_PROMPT
|
|
103
|
-
|
|
104
|
-
override = os.environ.get("GRAPHIFY_WHISPER_PROMPT")
|
|
105
|
-
if override:
|
|
106
|
-
return override
|
|
107
|
-
|
|
108
|
-
labels = [n.get("label", "") for n in god_nodes[:10] if n.get("label")]
|
|
109
|
-
if not labels:
|
|
110
|
-
return _FALLBACK_PROMPT
|
|
111
|
-
|
|
112
|
-
topics = ", ".join(labels[:5])
|
|
113
|
-
return f"Technical discussion about {topics}. Use proper punctuation and paragraph breaks."
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
def transcribe(
|
|
117
|
-
video_path: Path | str,
|
|
118
|
-
output_dir: Path | None = None,
|
|
119
|
-
initial_prompt: str | None = None,
|
|
120
|
-
force: bool = False,
|
|
121
|
-
) -> Path:
|
|
122
|
-
"""Transcribe a video/audio file or URL to a .txt transcript.
|
|
123
|
-
|
|
124
|
-
If video_path is a URL, audio is downloaded first via yt-dlp.
|
|
125
|
-
Returns the path to the saved transcript file.
|
|
126
|
-
Uses cached transcript if it exists unless force=True.
|
|
127
|
-
|
|
128
|
-
initial_prompt: domain hint for Whisper (built from corpus god nodes).
|
|
129
|
-
force: re-transcribe even if transcript already exists.
|
|
130
|
-
"""
|
|
131
|
-
out_dir = Path(output_dir) if output_dir else Path(_TRANSCRIPTS_DIR)
|
|
132
|
-
out_dir.mkdir(parents=True, exist_ok=True)
|
|
133
|
-
|
|
134
|
-
if is_url(str(video_path)):
|
|
135
|
-
audio_path = download_audio(str(video_path), out_dir / "downloads")
|
|
136
|
-
else:
|
|
137
|
-
audio_path = Path(video_path)
|
|
138
|
-
|
|
139
|
-
transcript_path = out_dir / (audio_path.stem + ".txt")
|
|
140
|
-
if transcript_path.exists() and not force:
|
|
141
|
-
return transcript_path
|
|
142
|
-
|
|
143
|
-
WhisperModel = _get_whisper()
|
|
144
|
-
model_name = _model_name()
|
|
145
|
-
prompt = initial_prompt or _FALLBACK_PROMPT
|
|
146
|
-
|
|
147
|
-
print(f" transcribing {audio_path.name} (model={model_name}) ...", flush=True)
|
|
148
|
-
model = WhisperModel(model_name, device="cpu", compute_type="int8")
|
|
149
|
-
segments, info = model.transcribe(
|
|
150
|
-
str(audio_path),
|
|
151
|
-
beam_size=5,
|
|
152
|
-
initial_prompt=prompt,
|
|
153
|
-
)
|
|
154
|
-
|
|
155
|
-
lines = [segment.text.strip() for segment in segments if segment.text.strip()]
|
|
156
|
-
transcript = "\n".join(lines)
|
|
157
|
-
|
|
158
|
-
transcript_path.write_text(transcript, encoding="utf-8")
|
|
159
|
-
lang = info.language if hasattr(info, "language") else "unknown"
|
|
160
|
-
print(f" transcript saved -> {transcript_path} (lang={lang}, {len(lines)} segments)")
|
|
161
|
-
return transcript_path
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
def transcribe_all(
|
|
165
|
-
video_files: list[str],
|
|
166
|
-
output_dir: Path | None = None,
|
|
167
|
-
initial_prompt: str | None = None,
|
|
168
|
-
) -> list[str]:
|
|
169
|
-
"""Transcribe a list of video/audio files or URLs, return paths to transcript .txt files.
|
|
170
|
-
|
|
171
|
-
Already-transcribed files are returned from cache instantly.
|
|
172
|
-
initial_prompt is shared across all files — built once from corpus god nodes.
|
|
173
|
-
"""
|
|
174
|
-
if not video_files:
|
|
175
|
-
return []
|
|
176
|
-
|
|
177
|
-
transcript_paths = []
|
|
178
|
-
for vf in video_files:
|
|
179
|
-
try:
|
|
180
|
-
t = transcribe(vf, output_dir, initial_prompt=initial_prompt)
|
|
181
|
-
transcript_paths.append(str(t))
|
|
182
|
-
except Exception as exc:
|
|
183
|
-
print(f" warning: could not transcribe {vf}: {exc}")
|
|
184
|
-
return transcript_paths
|