This commit is contained in:
@@ -3,7 +3,7 @@ import assert from 'node:assert/strict';
|
||||
import { mkdtempSync, readFileSync, existsSync, rmSync } from 'node:fs';
|
||||
import { tmpdir } from 'node:os';
|
||||
import path from 'node:path';
|
||||
import { ensureAgentWorkspace, applyAssistantName, normalizeAssistantName, templateWorkspaceDir } from '../daemon/agent-workspace.js';
|
||||
import { ensureAgentWorkspace, applyAssistantName, applyAssistantPrompt, normalizeAssistantName, templateWorkspaceDir } from '../daemon/agent-workspace.js';
|
||||
|
||||
const previous = process.env.XDG_DATA_HOME;
|
||||
const data = mkdtempSync(path.join(tmpdir(), 'jarvis-workspace-'));
|
||||
@@ -23,7 +23,10 @@ test('workspace seed copies SOUL and bootstrap, then name writes IDENTITY.md', (
|
||||
const again = ensureAgentWorkspace({ name: 'Ada' });
|
||||
assert.equal(again, dir);
|
||||
assert.match(readFileSync(path.join(dir, 'IDENTITY.md'), 'utf8'), /\*\*Name:\*\* Ada/);
|
||||
assert.equal(normalizeAssistantName(' '), 'Jarvis');
|
||||
applyAssistantPrompt(dir, 'Be a dry ship cook. Never say great question.');
|
||||
assert.match(readFileSync(path.join(dir, 'PERSONA.md'), 'utf8'), /dry ship cook/);
|
||||
applyAssistantPrompt(dir, '');
|
||||
assert.equal(readFileSync(path.join(dir, 'PERSONA.md'), 'utf8').trim(), '# PERSONA.md');
|
||||
assert.match(templateWorkspaceDir(), /agent-workspace$/);
|
||||
});
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@ import { tmpdir } from 'node:os';
|
||||
import path from 'node:path';
|
||||
process.env.XDG_STATE_HOME = mkdtempSync(path.join(tmpdir(), 'jarvis-daemon-test-'));
|
||||
process.env.XDG_DATA_HOME = mkdtempSync(path.join(tmpdir(), 'jarvis-daemon-data-'));
|
||||
process.env.XDG_CONFIG_HOME = mkdtempSync(path.join(tmpdir(), 'jarvis-daemon-config-'));
|
||||
import test from 'node:test';
|
||||
import assert from 'node:assert/strict';
|
||||
import { VoiceStateMachine } from '../daemon/voice-state.js';
|
||||
@@ -78,6 +79,8 @@ test('harness bridge caps voice shell chaining', () => {
|
||||
assert.match(bridge.options.cwd, /jarvis\/workspace$/);
|
||||
assert.match(bridge.options.system, /You are Jarvis/);
|
||||
assert.match(bridge.options.system, /SOUL\.md/);
|
||||
assert.match(bridge.options.system, /PERSONA\.md/);
|
||||
assert.doesNotMatch(bridge.options.system, /User personality notes/);
|
||||
assert.deepEqual(bridge.options.builtinTools, [
|
||||
'read_file',
|
||||
'write_file',
|
||||
|
||||
@@ -3,7 +3,7 @@ import test from 'node:test';
|
||||
import assert from 'node:assert/strict';
|
||||
import { createRuntimeTools } from '../skills/runtime-tools.js';
|
||||
import { assertSdkVersion } from '../daemon/qvac-master.js';
|
||||
import { parseHudSidecar, VOICE_SYSTEM_PROMPT } from '../skills/voice-prompt.js';
|
||||
import { parseHudSidecar, VOICE_SYSTEM_PROMPT, voiceSystemPrompt } from '../skills/voice-prompt.js';
|
||||
import { createPhase2Tools } from '../skills/phase2-tools.js';
|
||||
import { createQvacTools } from '../skills/qvac-tools.js';
|
||||
import { profile } from '../daemon/model-profiles.js';
|
||||
@@ -158,8 +158,14 @@ test('public web search and fetch do not require confirmation', () => {
|
||||
assert.equal(policy.needsPermission('code_search', 'ask'), false);
|
||||
assert.equal(policy.needsPermission('run_terminal_cmd', 'ask'), true);
|
||||
assert.match(VOICE_SYSTEM_PROMPT, /Follow SOUL\.md, IDENTITY\.md, AGENTS\.md/);
|
||||
assert.match(VOICE_SYSTEM_PROMPT, /PERSONA\.md/);
|
||||
assert.doesNotMatch(VOICE_SYSTEM_PROMPT, /User personality notes/);
|
||||
assert.match(voiceSystemPrompt('Ada', 'Be dry. Skip filler.'), /You are Ada/);
|
||||
assert.match(voiceSystemPrompt('Ada', 'Be dry. Skip filler.'), /User personality notes/);
|
||||
assert.match(voiceSystemPrompt('Ada', 'Be dry. Skip filler.'), /Be dry\. Skip filler\./);
|
||||
assert.equal(policy.needsPermission('write_file', 'ask'), true);
|
||||
assert.equal(policy.isIdentityPath('USER.md'), true);
|
||||
assert.equal(policy.isIdentityPath('PERSONA.md'), true);
|
||||
assert.equal(policy.isIdentityPath('memory/2026-09-12.md'), true);
|
||||
assert.equal(policy.isIdentityPath('/tmp/secret.txt'), false);
|
||||
});
|
||||
|
||||
@@ -185,6 +185,8 @@ test('catalog defaults enable CPU wake, workspace files, and idle VRAM unload',
|
||||
assert.equal(settings.freeVramOnIdle, true);
|
||||
assert.equal(settings.wakeCommand, 'jarvis-wake-bridge');
|
||||
assert.equal(settings.assistantName, 'Jarvis');
|
||||
assert.equal(settings.assistantPrompt, '');
|
||||
assert.equal(voiceSettings({ assistantName: ' Ada ' }).assistantName, 'Ada');
|
||||
assert.equal(voiceSettings({ assistantName: '<script>' }).assistantName, 'Jarvis');
|
||||
assert.equal(voiceSettings({ assistantPrompt: 'Be dry.\nSkip filler. ' }).assistantPrompt, 'Be dry.\nSkip filler.');
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user