mirror of
https://github.com/harivansh-afk/clanker-agent.git
synced 2026-04-16 12:03:23 +00:00
refactor: finish companion rename migration
Complete the remaining pi-to-companion rename across companion-os, web, vm-orchestrator, docker, and archived fixtures. Verification: - semantic rg sweeps for Pi/piConfig/getPi/.pi runtime references - npm run check in apps/companion-os (fails in this worktree: biome not found) Co-authored-by: Codex <noreply@openai.com>
This commit is contained in:
parent
e8fe3d54af
commit
536241053c
303 changed files with 3603 additions and 3602 deletions
|
|
@ -7,7 +7,7 @@ import { SettingsManager } from "../src/core/settings-manager.js";
|
|||
* Tests for the fix to a bug where external file changes to arrays were overwritten.
|
||||
*
|
||||
* The bug scenario was:
|
||||
* 1. Pi starts with settings.json containing packages: ["npm:some-pkg"]
|
||||
* 1. Companion starts with settings.json containing packages: ["npm:some-pkg"]
|
||||
* 2. User externally edits file to packages: []
|
||||
* 3. User changes an unrelated setting (e.g., theme) via UI
|
||||
* 4. save() would overwrite packages back to ["npm:some-pkg"] from stale in-memory state
|
||||
|
|
@ -25,7 +25,7 @@ describe("SettingsManager - External Edit Preservation", () => {
|
|||
rmSync(testDir, { recursive: true });
|
||||
}
|
||||
mkdirSync(agentDir, { recursive: true });
|
||||
mkdirSync(join(projectDir, ".pi"), { recursive: true });
|
||||
mkdirSync(join(projectDir, ".companion"), { recursive: true });
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
|
|
@ -42,15 +42,15 @@ describe("SettingsManager - External Edit Preservation", () => {
|
|||
settingsPath,
|
||||
JSON.stringify({
|
||||
theme: "dark",
|
||||
packages: ["npm:pi-mcp-adapter"],
|
||||
packages: ["npm:companion-mcp-adapter"],
|
||||
}),
|
||||
);
|
||||
|
||||
// Pi starts up, loads settings into memory
|
||||
// Companion starts up and loads settings into memory
|
||||
const manager = SettingsManager.create(projectDir, agentDir);
|
||||
|
||||
// At this point, globalSettings.packages = ["npm:pi-mcp-adapter"]
|
||||
expect(manager.getPackages()).toEqual(["npm:pi-mcp-adapter"]);
|
||||
// At this point, globalSettings.packages = ["npm:companion-mcp-adapter"]
|
||||
expect(manager.getPackages()).toEqual(["npm:companion-mcp-adapter"]);
|
||||
|
||||
// User externally edits settings.json to remove the package
|
||||
const currentSettings = JSON.parse(readFileSync(settingsPath, "utf-8"));
|
||||
|
|
@ -102,7 +102,7 @@ describe("SettingsManager - External Edit Preservation", () => {
|
|||
});
|
||||
|
||||
it("should preserve external project settings changes when updating unrelated project field", async () => {
|
||||
const projectSettingsPath = join(projectDir, ".pi", "settings.json");
|
||||
const projectSettingsPath = join(projectDir, ".companion", "settings.json");
|
||||
writeFileSync(
|
||||
projectSettingsPath,
|
||||
JSON.stringify({
|
||||
|
|
@ -133,7 +133,7 @@ describe("SettingsManager - External Edit Preservation", () => {
|
|||
});
|
||||
|
||||
it("should let in-memory project changes override external changes for the same project field", async () => {
|
||||
const projectSettingsPath = join(projectDir, ".pi", "settings.json");
|
||||
const projectSettingsPath = join(projectDir, ".companion", "settings.json");
|
||||
writeFileSync(
|
||||
projectSettingsPath,
|
||||
JSON.stringify({
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue