T3MP3ST public launch build

This commit is contained in:
t3mp3st contributors committed 2026-07-03 10:57:20 -04:00
1 parent 972247b881
commit 184c7d4e59
1589 files changed
+57150 -506

No files matched your search

Regular → Executable
View File
File mode changed.
+42
View File
@@ -0,0 +1,42 @@
/**
* agentHome() — fix for "redirected HOME breaks local-agent detection".
*
* T3MP3ST may run with $HOME redirected (app-config storage), but the agent CLIs keep their
* own auth artifacts (~/.claude.json, ~/.codex/auth.json, ~/.hermes/.env) in the REAL home.
* If detection/spawn used the redirected HOME, an installed-and-authed agent would look
* unavailable (dead Settings checkboxes). agentHome() resolves the real home independently.
*/
import { describe, it, expect, afterEach } from 'vitest';
import { userInfo } from 'os';
import { agentHome } from '../agent/local-agents.js';
describe('agentHome — real CLI-auth home, independent of a redirected $HOME', () => {
const saved = { override: process.env.T3MP3ST_AGENT_HOME, home: process.env.HOME };
const restore = (k: 'T3MP3ST_AGENT_HOME' | 'HOME', v: string | undefined): void => {
if (v === undefined) delete process.env[k];
else process.env[k] = v;
};
afterEach(() => {
restore('T3MP3ST_AGENT_HOME', saved.override);
restore('HOME', saved.home);
});
it('prefers the explicit T3MP3ST_AGENT_HOME override over a redirected HOME', () => {
process.env.T3MP3ST_AGENT_HOME = '/real/user/home';
process.env.HOME = '/tmp/redirected';
expect(agentHome()).toBe('/real/user/home');
});
it('auto-recovers the real home (OS user DB) when HOME is redirected and no override is set', () => {
delete process.env.T3MP3ST_AGENT_HOME;
process.env.HOME = '/tmp/redirected-should-be-ignored';
// userInfo().homedir reads getpwuid, NOT $HOME → the true home
expect(agentHome()).toBe(userInfo().homedir);
expect(agentHome()).not.toBe('/tmp/redirected-should-be-ignored');
});
it('ignores a blank/whitespace override and falls through to the real home', () => {
process.env.T3MP3ST_AGENT_HOME = ' ';
expect(agentHome()).toBe(userInfo().homedir);
});
});
+38
View File
@@ -0,0 +1,38 @@
/**
* Venice provider — OpenRouter-parity wiring.
* Venice is OpenAI-compatible, so it plugs in everywhere OpenRouter does: the LLMProvider
* union, the config key/provider block, getLLMConfig, the fallback ladder, and a
* VeniceAdapter that reuses the OpenRouter adapter with Venice's base URL. This pins that
* the provider resolves end-to-end so a refactor can't silently drop it.
*/
import { describe, it, expect, afterEach } from 'vitest';
import { config, AVAILABLE_MODELS } from '../config/index.js';
import { createVeniceBackbone } from '../llm/index.js';
const KEY = 'venice-key-abcdef123456';
describe('Venice provider wiring (parity with OpenRouter)', () => {
afterEach(() => { delete process.env.VENICE_API_KEY; });
it('resolves the Venice base URL + default model + key from VENICE_API_KEY', () => {
process.env.VENICE_API_KEY = KEY;
const cfg = config.getLLMConfig('venice');
expect(cfg.provider).toBe('venice');
expect(cfg.baseUrl).toBe('https://api.venice.ai/api/v1');
expect(cfg.model).toBe('llama-3.3-70b');
expect(cfg.apiKey).toBe(KEY);
});
it('the Venice backbone validates and reports the venice provider', () => {
process.env.VENICE_API_KEY = KEY;
const bb = createVeniceBackbone();
expect(bb.getProvider()).toBe('venice');
expect(bb.validateConfig().valid).toBe(true);
});
it('surfaces venice in AVAILABLE_MODELS and getConfiguredProviders', () => {
process.env.VENICE_API_KEY = KEY;
expect(AVAILABLE_MODELS.venice?.length).toBeGreaterThan(0);
expect(config.getConfiguredProviders()).toContain('venice');
});
});