Add packages/mosaic registry schemas, validation, read-only CLI; pin pi 0.85.1 (#1499)
This commit is contained in:
@@ -7,7 +7,7 @@ import { join, resolve } from 'node:path';
|
||||
import { spawnSync } from 'node:child_process';
|
||||
|
||||
const source = resolve(import.meta.dirname, '..');
|
||||
for (const agent of ['darkwing', 'dewey', 'filbert']) test(`${agent} launch context, resources, session recovery, and refusals`, () => {
|
||||
for (const agent of ['darkwing', 'dewey', 'filbert', 'sage']) test(`${agent} launch context, resources, session recovery, and refusals`, () => {
|
||||
const root = mkdtempSync(join(tmpdir(), `${agent} launch `));
|
||||
try {
|
||||
for (const dir of ['agents', 'scripts', 'contracts', 'user', 'node_modules/.bin', 'extensions/goal']) {
|
||||
@@ -24,7 +24,7 @@ for (const agent of ['darkwing', 'dewey', 'filbert']) test(`${agent} launch cont
|
||||
cpSync(join(source, 'scripts/agent-host-dev.sh'), join(root, 'scripts/agent-host-dev.sh'));
|
||||
cpSync(join(source, 'scripts/agent.sh'), join(root, 'scripts/agent.sh'));
|
||||
cpSync(join(source, 'skills'), join(root, 'skills'), { recursive: true });
|
||||
writeFileSync(join(root, 'package.json'), JSON.stringify({ dependencies: { '@earendil-works/pi-coding-agent': '0.84.4' } }));
|
||||
writeFileSync(join(root, 'package.json'), JSON.stringify({ dependencies: { '@earendil-works/pi-coding-agent': '0.85.1' } }));
|
||||
for (const file of ['contracts/CONSTITUTION.md', 'contracts/STANDARDS.md', 'user/USER.md', 'AGENTS.md']) {
|
||||
writeFileSync(join(root, file), `fixture ${file}\n`);
|
||||
}
|
||||
@@ -33,7 +33,7 @@ for (const agent of ['darkwing', 'dewey', 'filbert']) test(`${agent} launch cont
|
||||
writeFileSync(join(root, 'scripts/sync-dev-extensions.sh'), '#!/bin/sh\nexit 0\n', { mode: 0o755 });
|
||||
writeFileSync(join(root, 'node_modules/.bin/pi'), `#!/usr/bin/env node
|
||||
const fs = require('node:fs');
|
||||
if (process.argv[2] === '--version') { console.log('0.84.4'); process.exit(0); }
|
||||
if (process.argv[2] === '--version') { console.log('0.85.1'); process.exit(0); }
|
||||
fs.writeFileSync('capture.json', JSON.stringify({args: process.argv.slice(2), agent: process.env.MOSAIC_AGENT_NAME, incarnation: process.env.MOSAIC_LAUNCH_INCARNATION}));
|
||||
`, { mode: 0o755 });
|
||||
const launch = (args = '', tty = true) => spawnSync(tty ? 'script' : 'bash', tty
|
||||
@@ -61,8 +61,9 @@ fs.writeFileSync('capture.json', JSON.stringify({args: process.argv.slice(2), ag
|
||||
let captured = JSON.parse(readFileSync(join(root, 'capture.json')));
|
||||
assert.equal(captured.incarnation, undefined);
|
||||
assert.equal(captured.agent, agent);
|
||||
assert.equal(captured.args[captured.args.indexOf('--provider') + 1], agent === 'filbert' ? 'openai-codex' : 'test');
|
||||
assert.equal(captured.args[captured.args.indexOf('--model') + 1], agent === 'filbert' ? 'gpt-6-astra' : 'test-model');
|
||||
assert.equal(captured.args[captured.args.indexOf('--provider') + 1], agent === 'filbert' ? 'openai-codex' : agent === 'sage' ? 'zai' : 'test');
|
||||
assert.equal(captured.args[captured.args.indexOf('--model') + 1], agent === 'filbert' ? 'gpt-6-astra' : agent === 'sage' ? 'glm-5.3' : 'test-model');
|
||||
if (agent === 'sage') assert.equal(captured.args[captured.args.indexOf('--thinking') + 1], 'high');
|
||||
if (agent === 'filbert') assert.equal(captured.args[captured.args.indexOf('--thinking') + 1], 'low');
|
||||
assert.equal(captured.args[captured.args.indexOf('--session-dir') + 1], join(root, `.pi/state/${agent}/sessions`));
|
||||
assert.equal(captured.args.includes('--continue'), false);
|
||||
|
||||
Reference in New Issue
Block a user