Overhaul Feynman harness: streamline agents, prompts, and extensions
Remove legacy chains, skills, and config modules. Add citation agent, SYSTEM.md, modular research-tools extension, and web-access layer. Add ralph-wiggum to Pi package stack for long-running loops. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
54
tests/pi-web-access.test.ts
Normal file
54
tests/pi-web-access.test.ts
Normal file
@@ -0,0 +1,54 @@
|
||||
import test from "node:test";
|
||||
import assert from "node:assert/strict";
|
||||
import { mkdtempSync, mkdirSync, writeFileSync } from "node:fs";
|
||||
import { tmpdir } from "node:os";
|
||||
import { join } from "node:path";
|
||||
|
||||
import {
|
||||
formatPiWebAccessDoctorLines,
|
||||
getPiWebAccessStatus,
|
||||
getPiWebSearchConfigPath,
|
||||
loadPiWebAccessConfig,
|
||||
} from "../src/pi/web-access.js";
|
||||
|
||||
test("loadPiWebAccessConfig returns empty config when Pi web config is missing", () => {
|
||||
const root = mkdtempSync(join(tmpdir(), "feynman-pi-web-"));
|
||||
const configPath = getPiWebSearchConfigPath(root);
|
||||
|
||||
assert.deepEqual(loadPiWebAccessConfig(configPath), {});
|
||||
});
|
||||
|
||||
test("getPiWebAccessStatus reads Pi web-access config directly", () => {
|
||||
const root = mkdtempSync(join(tmpdir(), "feynman-pi-web-"));
|
||||
const configPath = getPiWebSearchConfigPath(root);
|
||||
mkdirSync(join(root, ".pi"), { recursive: true });
|
||||
writeFileSync(
|
||||
configPath,
|
||||
JSON.stringify({
|
||||
provider: "gemini",
|
||||
searchProvider: "gemini",
|
||||
chromeProfile: "Profile 2",
|
||||
geminiApiKey: "AIza...",
|
||||
}),
|
||||
"utf8",
|
||||
);
|
||||
|
||||
const status = getPiWebAccessStatus(loadPiWebAccessConfig(configPath), configPath);
|
||||
assert.equal(status.routeLabel, "Gemini");
|
||||
assert.equal(status.requestProvider, "gemini");
|
||||
assert.equal(status.geminiApiConfigured, true);
|
||||
assert.equal(status.perplexityConfigured, false);
|
||||
assert.equal(status.chromeProfile, "Profile 2");
|
||||
});
|
||||
|
||||
test("formatPiWebAccessDoctorLines reports Pi-managed web access", () => {
|
||||
const lines = formatPiWebAccessDoctorLines(
|
||||
getPiWebAccessStatus({
|
||||
provider: "auto",
|
||||
searchProvider: "auto",
|
||||
}, "/tmp/pi-web-search.json"),
|
||||
);
|
||||
|
||||
assert.equal(lines[0], "web access: pi-web-access");
|
||||
assert.ok(lines.some((line) => line.includes("/tmp/pi-web-search.json")));
|
||||
});
|
||||
Reference in New Issue
Block a user