mirror of
https://github.com/harivansh-afk/clanker-agent.git
synced 2026-04-15 18:01:26 +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
|
|
@ -1,4 +1,4 @@
|
|||
import { complete, getModel } from "@mariozechner/pi-ai";
|
||||
import { complete, getModel } from "@mariozechner/companion-ai";
|
||||
|
||||
const model = getModel("google", "gemini-2.5-flash");
|
||||
console.log(model.id, typeof complete);
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
#!/usr/bin/env bash
|
||||
#
|
||||
# Build pi binaries for all platforms locally.
|
||||
# Build companion binaries for all platforms locally.
|
||||
# Mirrors .github/workflows/build-binaries.yml
|
||||
#
|
||||
# Usage:
|
||||
|
|
@ -12,11 +12,11 @@
|
|||
#
|
||||
# Output:
|
||||
# packages/coding-agent/binaries/
|
||||
# pi-darwin-arm64.tar.gz
|
||||
# pi-darwin-x64.tar.gz
|
||||
# pi-linux-x64.tar.gz
|
||||
# pi-linux-arm64.tar.gz
|
||||
# pi-windows-x64.zip
|
||||
# companion-darwin-arm64.tar.gz
|
||||
# companion-darwin-x64.tar.gz
|
||||
# companion-linux-x64.tar.gz
|
||||
# companion-linux-arm64.tar.gz
|
||||
# companion-windows-x64.zip
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
|
|
@ -107,9 +107,9 @@ for platform in "${PLATFORMS[@]}"; do
|
|||
# call site has a try/catch fallback. For Windows builds, we copy the
|
||||
# appropriate .node file alongside the binary below.
|
||||
if [[ "$platform" == "windows-x64" ]]; then
|
||||
bun build --compile --external koffi --target=bun-$platform ./dist/cli.js --outfile binaries/$platform/pi.exe
|
||||
bun build --compile --external koffi --target=bun-$platform ./dist/cli.js --outfile binaries/$platform/companion.exe
|
||||
else
|
||||
bun build --compile --external koffi --target=bun-$platform ./dist/cli.js --outfile binaries/$platform/pi
|
||||
bun build --compile --external koffi --target=bun-$platform ./dist/cli.js --outfile binaries/$platform/companion
|
||||
fi
|
||||
done
|
||||
|
||||
|
|
@ -141,12 +141,12 @@ cd binaries
|
|||
for platform in "${PLATFORMS[@]}"; do
|
||||
if [[ "$platform" == "windows-x64" ]]; then
|
||||
# Windows (zip)
|
||||
echo "Creating pi-$platform.zip..."
|
||||
(cd $platform && zip -r ../pi-$platform.zip .)
|
||||
echo "Creating companion-$platform.zip..."
|
||||
(cd $platform && zip -r ../companion-$platform.zip .)
|
||||
else
|
||||
# Unix platforms (tar.gz) - use wrapper directory for mise compatibility
|
||||
echo "Creating pi-$platform.tar.gz..."
|
||||
mv $platform pi && tar -czf pi-$platform.tar.gz pi && mv pi $platform
|
||||
echo "Creating companion-$platform.tar.gz..."
|
||||
mv $platform companion && tar -czf companion-$platform.tar.gz companion && mv companion $platform
|
||||
fi
|
||||
done
|
||||
|
||||
|
|
@ -155,9 +155,9 @@ echo "==> Extracting archives for testing..."
|
|||
for platform in "${PLATFORMS[@]}"; do
|
||||
rm -rf $platform
|
||||
if [[ "$platform" == "windows-x64" ]]; then
|
||||
mkdir -p $platform && (cd $platform && unzip -q ../pi-$platform.zip)
|
||||
mkdir -p $platform && (cd $platform && unzip -q ../companion-$platform.zip)
|
||||
else
|
||||
tar -xzf pi-$platform.tar.gz && mv pi $platform
|
||||
tar -xzf companion-$platform.tar.gz && mv companion $platform
|
||||
fi
|
||||
done
|
||||
|
||||
|
|
@ -168,5 +168,5 @@ ls -lh *.tar.gz *.zip 2>/dev/null || true
|
|||
echo ""
|
||||
echo "Extracted directories for testing:"
|
||||
for platform in "${PLATFORMS[@]}"; do
|
||||
echo " binaries/$platform/pi"
|
||||
echo " binaries/$platform/companion"
|
||||
done
|
||||
|
|
|
|||
|
|
@ -2,34 +2,34 @@ import { mkdir } from "node:fs/promises";
|
|||
import path from "node:path";
|
||||
import { build } from "esbuild";
|
||||
|
||||
const sourceRoot = process.env.PI_BUILTIN_EXTENSIONS_SRC
|
||||
? path.resolve(process.env.PI_BUILTIN_EXTENSIONS_SRC)
|
||||
const sourceRoot = process.env.COMPANION_BUILTIN_EXTENSIONS_SRC
|
||||
? path.resolve(process.env.COMPANION_BUILTIN_EXTENSIONS_SRC)
|
||||
: path.resolve(process.cwd(), "packages");
|
||||
const outputRoot = process.env.PI_BUILTIN_EXTENSIONS_OUT
|
||||
? path.resolve(process.env.PI_BUILTIN_EXTENSIONS_OUT)
|
||||
const outputRoot = process.env.COMPANION_BUILTIN_EXTENSIONS_OUT
|
||||
? path.resolve(process.env.COMPANION_BUILTIN_EXTENSIONS_OUT)
|
||||
: path.resolve(process.cwd(), ".tmp/builtins");
|
||||
|
||||
const entries = [
|
||||
{
|
||||
name: "pi-channels",
|
||||
entry: path.join(sourceRoot, "pi-channels", "src", "index.ts"),
|
||||
name: "companion-channels",
|
||||
entry: path.join(sourceRoot, "companion-channels", "src", "index.ts"),
|
||||
},
|
||||
{
|
||||
name: "pi-teams",
|
||||
entry: path.join(sourceRoot, "pi-teams", "extensions", "index.ts"),
|
||||
name: "companion-teams",
|
||||
entry: path.join(sourceRoot, "companion-teams", "extensions", "index.ts"),
|
||||
},
|
||||
{
|
||||
name: "pi-grind",
|
||||
entry: path.join(sourceRoot, "pi-grind", "src", "index.ts"),
|
||||
name: "companion-grind",
|
||||
entry: path.join(sourceRoot, "companion-grind", "src", "index.ts"),
|
||||
},
|
||||
];
|
||||
|
||||
const external = [
|
||||
"@mariozechner/pi-agent-core",
|
||||
"@mariozechner/pi-ai",
|
||||
"@mariozechner/pi-ai/oauth",
|
||||
"@mariozechner/pi-coding-agent",
|
||||
"@mariozechner/pi-tui",
|
||||
"@mariozechner/companion-agent-core",
|
||||
"@mariozechner/companion-ai",
|
||||
"@mariozechner/companion-ai/oauth",
|
||||
"@mariozechner/companion-coding-agent",
|
||||
"@mariozechner/companion-tui",
|
||||
"@sinclair/typebox",
|
||||
];
|
||||
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ function encodeSessionDir(dir: string): string {
|
|||
return "--" + normalized.replace(/\//g, "-") + "--";
|
||||
}
|
||||
|
||||
const sessionsBase = path.join(process.env.HOME!, ".pi/agent/sessions");
|
||||
const sessionsBase = path.join(process.env.HOME!, ".companion/agent/sessions");
|
||||
const encodedDir = encodeSessionDir(directory);
|
||||
const sessionsDir = path.join(sessionsBase, encodedDir);
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
#!/usr/bin/env node
|
||||
/**
|
||||
* Release script for pi
|
||||
* Release script for companion
|
||||
*
|
||||
* Usage: node scripts/release.mjs <major|minor|patch>
|
||||
*
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
* optionally spawns subagents to analyze patterns.
|
||||
*
|
||||
* Usage: npx tsx scripts/session-transcripts.ts [--analyze] [--output <dir>] [cwd]
|
||||
* --analyze Spawn pi subagents to analyze each transcript file
|
||||
* --analyze Spawn companion subagents to analyze each transcript file
|
||||
* --output <dir> Output directory for transcript files (defaults to ./session-transcripts)
|
||||
* cwd Working directory to extract sessions for (defaults to current)
|
||||
*/
|
||||
|
|
@ -94,7 +94,7 @@ function runSubagent(
|
|||
): Promise<{ success: boolean }> {
|
||||
return new Promise((resolve) => {
|
||||
const child = spawn(
|
||||
"pi",
|
||||
"companion",
|
||||
["--mode", "json", "--tools", "read,write", "-p", prompt],
|
||||
{
|
||||
cwd,
|
||||
|
|
@ -158,7 +158,7 @@ function runSubagent(
|
|||
});
|
||||
|
||||
child.on("error", (err) => {
|
||||
console.error(chalk.red(` Failed to spawn pi: ${err.message}`));
|
||||
console.error(chalk.red(` Failed to spawn companion: ${err.message}`));
|
||||
resolve({ success: false });
|
||||
});
|
||||
});
|
||||
|
|
@ -188,7 +188,7 @@ async function main() {
|
|||
const cwd = resolve(cwdArg || process.cwd());
|
||||
|
||||
mkdirSync(outputDir, { recursive: true });
|
||||
const sessionsBase = join(homedir(), ".pi/agent/sessions");
|
||||
const sessionsBase = join(homedir(), ".companion/agent/sessions");
|
||||
const sessionDirName = cwdToSessionDir(cwd);
|
||||
const sessionDir = join(sessionsBase, sessionDirName);
|
||||
|
||||
|
|
@ -281,13 +281,13 @@ async function main() {
|
|||
|
||||
if (!analyzeFlag) {
|
||||
console.log(
|
||||
"\nRun with --analyze to spawn pi subagents for pattern analysis.",
|
||||
"\nRun with --analyze to spawn companion subagents for pattern analysis.",
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
// Find AGENTS.md files to compare against
|
||||
const globalAgentsMd = join(homedir(), ".pi/agent/AGENTS.md");
|
||||
const globalAgentsMd = join(homedir(), ".companion/agent/AGENTS.md");
|
||||
const localAgentsMd = join(cwd, "AGENTS.md");
|
||||
const agentsMdFiles = [globalAgentsMd, localAgentsMd].filter(existsSync);
|
||||
const agentsMdSection =
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue