Local API / MCP / SDK

Version 1 · Local processing · No content in agent responses

日本語

Node.jsとGoogle Chromeが必要です。サイトのソースを取得し、依存をインストールしてビルドします。ローカル設定で入力ファイル・出力フォルダ・レシピを登録してください。APIは登録したジョブ名だけを受け付けます。出力フォルダは先に作成してください。

標準では顔・背景保護の出力に .review が付き、needs_review を返します。無人で確定する場合だけ allowUnreviewedExport: true を設定してください。元のファイルは上書きしません。

English

Requires Node.js and Google Chrome. Install dependencies and build the source project. Register an input file, existing output folder and recipe in a local configuration. Agents can pass registered job names only. Results are saved locally with unique names.

Protected outputs default to .review files and needs_review. Enable allowUnreviewedExport: true only for trusted unattended workflows. No originals are overwritten.

Français

Node.js et Google Chrome sont nécessaires. Installez les dépendances et compilez le projet. Enregistrez un fichier d’entrée, un dossier de sortie existant et une recette dans la configuration locale. Les agents utilisent uniquement les noms de tâches enregistrées.

Les sorties protégées portent par défaut .review et l’état needs_review. Activez allowUnreviewedExport: true uniquement pour un traitement sans surveillance de confiance. Les originaux ne sont jamais écrasés.

1. jobs.json

{
  "version": 1,
  "jobs": {
    "interview": {
      "input": "C:/Media/interview.mp4",
      "output": "C:/Media/exports",
      "recipe": "C:/Media/subtitles.orihako",
      "allowUnreviewedExport": false,
      "approvedModels": ["tiny", "base", "face", "background"]
    }
  }
}

2. CLI / HTTP

node scripts/agent.mjs run jobs.json interview

# PowerShell — generate a new secret locally; do not share it
$env:ORIHAKO_STREAM_JOBS = 'C:/Media/jobs.json'
$env:ORIHAKO_STREAM_TOKEN = [guid]::NewGuid().ToString('N') + [guid]::NewGuid().ToString('N')
node scripts/agent.mjs http

Bind: 127.0.0.1:4191. All requests require Authorization: Bearer TOKEN. Other origins are rejected. Keep the token local; do not include it in recipes or agent messages.

GET    /v1/jobs               → registered job names
POST   /v1/jobs {"job":"interview"} → 202 {id,status,progress,error}
GET    /v1/jobs/:id           → {id,status,progress,error}
DELETE /v1/jobs/:id           → cancellation requested

States: queued / running / complete / needs_review / failed / cancelled

One active job per process. No upload, transcript retrieval, arbitrary filesystem path, shell command or remote inference endpoint.

3. MCP

{"mcpServers":{"orihako-stream":{
 "command":"node",
 "args":["C:/dev-work/stream/scripts/agent.mjs","mcp"],
 "env":{"ORIHAKO_STREAM_JOBS":"C:/Media/jobs.json"}
}}}
stream_list_jobs()
stream_run_job({"job":"interview"})
stream_job_status({"id":"OPAQUE_JOB_ID"})
stream_cancel_job({"id":"OPAQUE_JOB_ID"})

4. Browser SDK

// Runs in the local editor page. File is selected by the user.
await window.orihakoStream.open(file);
const recipe = window.orihakoStream.getRecipe();
recipe.ranges = [{start: 1, end: 8}];
recipe.transcribe = true;
recipe.language = 'fr'; // ja / en / fr
recipe.model = 'auto'; // auto / tiny / base / small
const result = await window.orihakoStream.runRecipe(recipe);
window.orihakoStream.status();
window.orihakoStream.cancel();
// Only local browser code can obtain the rendered Blob.
const blob = await window.orihakoStream.result();

The browser SDK has access to the local content by design. HTTP/MCP responses do not expose that content. Do not relay blobs or transcripts to cloud agents.

Model permissions / モデルの許可 / Autorisation des modèles

ブラウザでは取得前に容量を表示して確認します。無人実行はローカル設定の approvedModels で明示許可し、未承認モデルを拒否します。自動選択・フォールバックには tiny と base の両方を許可してください。

The browser asks before downloading models. Unattended jobs require an explicit approvedModels list. Include tiny and base for automatic selection and fallback. Missing permission fails the job instead of opening a hidden dialog.

Le navigateur demande l’accord avant le téléchargement. Les tâches automatiques nécessitent une liste approvedModels explicite. Autorisez tiny et base pour la sélection automatique et le repli.

Recipe v1

{"version":1,"ranges":[],"gain":1,"fade":0,"mute":false,
 "subtitles":true,"face":false,"background":"none","masks":[],
 "format":"webm","size":"720","aspect":"source",
 "model":"auto","language":"ja","transcribe":false,"silence":false,
 "protection":{"style":"mosaic","strength":0.65,"opacity":1,"emoji":"🙂","image":""}}

Ranges use seconds on the original timeline. Their order defines output order. Empty ranges keep the full file. Masks use original-image fractions (x, y, width, height) and original start/end times. Unknown keys and invalid values are rejected. Subtitle text edits never synthesize or replace spoken audio.

Cover styles: mosaic / blur / solid / emoji / image. Local raster images are embedded in recipe/project files; never share a recipe without reviewing its image. Transparent effects are decorative, not reliable anonymization.

Limits

500 MB per input, 30 minutes for AI audio analysis, sequential batch processing. Codec support depends on the installed browser. Models must be deployed under the same origin; no remote-model fallback is enabled. The local helper requires the built dist folder and installed dependencies.