diff --git a/.env.example b/.env.example index e03919b..3cd5202 100644 --- a/.env.example +++ b/.env.example @@ -78,37 +78,37 @@ OPENAI_API_KEY=sk-your-openai-key-here # Enable scholarly literature search across academic databases. # When enabled, the pipeline searches for peer-reviewed sources # related to the video's claims and cites them in the report. -# RESEACH_ENABLED=true +# RESEARCH_ENABLED=true # Research depth: none | light | medium | deep # none = skip research (same as not setting --research) # light = top 3 results per claim # medium = top 5 results per claim (default when --research is on) # deep = multi-pass iterative research with gap analysis -# RESEACH_DEPTH=medium +# RESEARCH_DEPTH=medium # Max sources cited in the final report -# RESEACH_MAX_SOURCES=10 +# RESEARCH_MAX_SOURCES=10 # Max papers retrieved per search query per database -# RESEACH_MAX_PAPERS_PER_TOPIC=5 +# RESEARCH_MAX_PAPERS_PER_TOPIC=5 # Academic databases to search (comma-separated) # Available: arxiv, semantic_scholar, crossref, openalex -# RESEACH_APIS=arxiv,semantic_scholar,crossref,openalex +# RESEARCH_APIS=arxiv,semantic_scholar,crossref,openalex # Semantic Scholar API key (optional, free signup at semanticscholar.org) # Raises rate limit from 100 to 1000 requests per 5 minutes # SEMANTIC_SCHOLAR_API_KEY=your-s2-key-here # Email for CrossRef polite pool identification (recommended) -# RESEACH_MAILTO=your-email@example.com +# RESEARCH_MAILTO=your-email@example.com # Citation style: apa | chicago | ieee # CITATION_STYLE=apa # Per-fetch timeout in milliseconds -# RESEACH_TIMEOUT_MS=15000 +# RESEARCH_TIMEOUT_MS=15000 # ── Evidence Synthesis & Verification ──────────────────────────────── # Compare video claims against retrieved literature. @@ -144,7 +144,7 @@ OPENAI_API_KEY=sk-your-openai-key-here # ── Iterative Deep Research ────────────────────────────────────────── # Maximum iterations for deep research mode (--research-depth deep). # The pipeline stops early if no new sources are found. -# RESEACH_ITERATIONS=3 +# RESEARCH_ITERATIONS=3 # ── Audio-only Downloads ────────────────────────────────────────────── # When enabled, yt-dlp downloads best audio stream instead of full video. @@ -155,7 +155,7 @@ OPENAI_API_KEY=sk-your-openai-key-here # Public web beta is BYOK-only. Operator-funded usage is intentionally disabled # until quota accounting is durable across Cloud Run instances. ALLOWED_ORIGINS=https://jongan69.github.io -ALLOWED_VIDEO_HOSTS=youtube.com,www.youtube.com,m.youtube.com,youtu.be,vimeo.com,www.vimeo.com,player.vimeo.com,media.w3.org +ALLOWED_VIDEO_HOSTS=youtube.com,www.youtube.com,m.youtube.com,youtu.be,vimeo.com,www.vimeo.com,player.vimeo.com,media.w3.org,x.com,www.x.com,twitter.com,www.twitter.com # Required only for the operator job-list endpoint. # ADMIN_TOKEN= diff --git a/Dockerfile b/Dockerfile index 880ae6e..ab4886c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,11 +6,16 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ && pip3 install --no-cache-dir yt-dlp --break-system-packages \ && apt-get clean && rm -rf /var/lib/apt/lists/* +# Install Bun (for dependency install and runtime scripts) +ENV BUN_INSTALL=/root/.bun +RUN curl -fsSL https://bun.sh/install | BUN_INSTALL=$BUN_INSTALL bash \ + && ln -s "$BUN_INSTALL/bin/bun" /usr/local/bin/bun + WORKDIR /app -# Install Node deps -COPY package.json package-lock.json ./ -RUN npm install --production +# Install Node deps (Bun) +COPY package.json bun.lock ./ +RUN bun install --frozen-lockfile --production # Copy app code COPY scripts/ ./scripts/ diff --git a/scripts/deploy/oracle-setup.sh b/scripts/deploy/oracle-setup.sh index 579de54..39ed117 100644 --- a/scripts/deploy/oracle-setup.sh +++ b/scripts/deploy/oracle-setup.sh @@ -36,7 +36,14 @@ else fi # ---- Install Node deps ---- -npm install --production +if ! command -v bun >/dev/null 2>&1; then + echo "Installing Bun..." + curl -fsSL https://bun.sh/install | bash + export BUN_INSTALL="${BUN_INSTALL:-$HOME/.bun}" + export PATH="$BUN_INSTALL/bin:$PATH" +fi + +bun install --frozen-lockfile --production # ---- Configure env ---- if [ ! -f ".env" ]; then diff --git a/scripts/pipeline.mjs b/scripts/pipeline.mjs index eb0a564..047a6d7 100644 --- a/scripts/pipeline.mjs +++ b/scripts/pipeline.mjs @@ -172,7 +172,7 @@ export async function runPipeline({url, options = {}, apiKey, tempDir, onProgres // Stage 3: Domain detection onProgress('analyze', 60, 'Detecting research domain...'); - const domain = config.domain ? getDomain(config.domain) : detectDomain(timestamped); + let domain = config.domain ? getDomain(config.domain) : detectDomain(timestamped); if (!domain) domain = {name:'General',reportSystemPrompt:'',evidenceSystemPrompt:'',queryPlannerPrompt:'',evaluationRubric:''}; // Stage 4: Research (literature search + citations) diff --git a/scripts/web/security.mjs b/scripts/web/security.mjs index 7a77bcd..3f7e6ef 100644 --- a/scripts/web/security.mjs +++ b/scripts/web/security.mjs @@ -5,6 +5,7 @@ export const DEFAULT_VIDEO_HOSTS = [ 'youtube.com', 'www.youtube.com', 'm.youtube.com', 'youtu.be', 'vimeo.com', 'www.vimeo.com', 'player.vimeo.com', 'media.w3.org', + 'x.com', 'www.x.com', 'twitter.com', 'www.twitter.com', ]; export const parseAllowedHosts = (value = process.env.ALLOWED_VIDEO_HOSTS) =>