tuna-agent 0.1.158 → 0.1.160
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.
|
@@ -360,7 +360,7 @@ Transcript context: "${(transcript || '').slice(0, 4000)}"
|
|
|
360
360
|
Return ONLY a JSON object, no markdown fences:
|
|
361
361
|
{
|
|
362
362
|
"video_summary": "One detailed cinematic paragraph (5-8 sentences, English) telling the WHOLE story start to finish: setup, key beats, climax, resolution. This is the narrative spine — be specific about what happens.",
|
|
363
|
-
"video_style": "3-4 sentences (English): artistic medium (2D/3D/live-action/CGI), color
|
|
363
|
+
"video_style": "3-4 sentences (English) capturing the EXACT visual aesthetic so a video generator can REPRODUCE this exact look. Be hyper-specific and concrete: the artistic medium (2D/3D/live-action/CGI/anime); the precise film stock or camera look (e.g. '35mm anamorphic', 'vintage 16mm film grain', 'crisp digital 8k', 'DSLR handheld'); the exact color grade (named tones, contrast, saturation, e.g. 'teal-orange grade, crushed blacks'); the exact lighting (source, direction, hardness, time of day); lens character + depth of field; and any texture/grain/film artifacts. Name concrete techniques, NOT vague vibes like 'cinematic' or 'beautiful'. Do NOT name copyrighted studios or brands.",
|
|
364
364
|
"characters": [
|
|
365
365
|
{ "name": "SHORT_UPPERCASE_LABEL", "description": "one-line English visual description: age/build, face, hair, outfit, colors, distinguishing features" }
|
|
366
366
|
]
|
package/dist/daemon/index.d.ts
CHANGED
package/dist/daemon/index.js
CHANGED
|
@@ -1,17 +1,10 @@
|
|
|
1
|
+
// ⚠ MUST be first: side-effect import that populates process.env from
|
|
2
|
+
// ~/.tuna-agent/.env BEFORE any other module captures env at its top
|
|
3
|
+
// level. See load-env.ts for the long-form explanation.
|
|
4
|
+
import './load-env.js';
|
|
1
5
|
import fs from 'fs';
|
|
2
6
|
import path from 'path';
|
|
3
7
|
import os from 'os';
|
|
4
|
-
// Load .env from ~/.tuna-agent/.env if exists (ensure OPENAI_API_KEY etc. available)
|
|
5
|
-
const envPath = path.join(os.homedir(), '.tuna-agent', '.env');
|
|
6
|
-
if (fs.existsSync(envPath)) {
|
|
7
|
-
const envContent = fs.readFileSync(envPath, 'utf8');
|
|
8
|
-
for (const line of envContent.split('\n')) {
|
|
9
|
-
const match = line.match(/^\s*([A-Z_][A-Z0-9_]*)\s*=\s*(.*)\s*$/);
|
|
10
|
-
if (match && !process.env[match[1]]) {
|
|
11
|
-
process.env[match[1]] = match[2].replace(/^["']|["']$/g, '');
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
8
|
import { AgentWebSocketClient } from './ws-client.js';
|
|
16
9
|
import { removePid, loadConfig, saveConfig } from '../config/store.js';
|
|
17
10
|
import { validateMessage } from '../utils/message-schemas.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
// Side-effect module: load ~/.tuna-agent/.env into process.env BEFORE any
|
|
2
|
+
// other daemon module reads process.env at its top level.
|
|
3
|
+
//
|
|
4
|
+
// daemon/index.ts must import this FIRST so the side-effect runs before
|
|
5
|
+
// modules like analyze-video-handler.ts capture `process.env.OPENAI_API_KEY`
|
|
6
|
+
// into a module-top const. ESM imports execute in dependency order, so
|
|
7
|
+
// putting this import line above the analyze-video-handler import (directly
|
|
8
|
+
// or transitively) guarantees the env is populated when those consts are
|
|
9
|
+
// evaluated.
|
|
10
|
+
//
|
|
11
|
+
// Previously the env loader lived inline in daemon/index.ts AFTER the
|
|
12
|
+
// imports — but ES module imports are processed BEFORE any executable code
|
|
13
|
+
// in the file, so analyze-video-handler captured OPENAI_API_KEY='' and the
|
|
14
|
+
// analyze flow died with 'OPENAI_API_KEY not set' even though the .env
|
|
15
|
+
// file was correct.
|
|
16
|
+
import fs from 'fs';
|
|
17
|
+
import path from 'path';
|
|
18
|
+
import os from 'os';
|
|
19
|
+
const envPath = path.join(os.homedir(), '.tuna-agent', '.env');
|
|
20
|
+
if (fs.existsSync(envPath)) {
|
|
21
|
+
const envContent = fs.readFileSync(envPath, 'utf8');
|
|
22
|
+
for (const line of envContent.split('\n')) {
|
|
23
|
+
const match = line.match(/^\s*([A-Z_][A-Z0-9_]*)\s*=\s*(.*)\s*$/);
|
|
24
|
+
if (match && !process.env[match[1]]) {
|
|
25
|
+
process.env[match[1]] = match[2].replace(/^["']|["']$/g, '');
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|