mirror of
https://github.com/harivansh-afk/clanker-agent.git
synced 2026-04-20 19:02:09 +00:00
move pi-mono into companion-cloud as apps/companion-os
- Copy all pi-mono source into apps/companion-os/ - Update Dockerfile to COPY pre-built binary instead of downloading from GitHub Releases - Update deploy-staging.yml to build pi from source (bun compile) before Docker build - Add apps/companion-os/** to path triggers - No more cross-repo dispatch needed Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
commit
0250f72976
579 changed files with 206942 additions and 0 deletions
43
packages/pi-teams/src/utils/paths.ts
Normal file
43
packages/pi-teams/src/utils/paths.ts
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
import fs from "node:fs";
|
||||
import os from "node:os";
|
||||
import path from "node:path";
|
||||
|
||||
export const PI_DIR = path.join(os.homedir(), ".pi");
|
||||
export const TEAMS_DIR = path.join(PI_DIR, "teams");
|
||||
export const TASKS_DIR = path.join(PI_DIR, "tasks");
|
||||
|
||||
export function ensureDirs() {
|
||||
if (!fs.existsSync(PI_DIR)) fs.mkdirSync(PI_DIR);
|
||||
if (!fs.existsSync(TEAMS_DIR)) fs.mkdirSync(TEAMS_DIR);
|
||||
if (!fs.existsSync(TASKS_DIR)) fs.mkdirSync(TASKS_DIR);
|
||||
}
|
||||
|
||||
export function sanitizeName(name: string): string {
|
||||
// Allow only alphanumeric characters, hyphens, and underscores.
|
||||
if (/[^a-zA-Z0-9_-]/.test(name)) {
|
||||
throw new Error(
|
||||
`Invalid name: "${name}". Only alphanumeric characters, hyphens, and underscores are allowed.`,
|
||||
);
|
||||
}
|
||||
return name;
|
||||
}
|
||||
|
||||
export function teamDir(teamName: string) {
|
||||
return path.join(TEAMS_DIR, sanitizeName(teamName));
|
||||
}
|
||||
|
||||
export function taskDir(teamName: string) {
|
||||
return path.join(TASKS_DIR, sanitizeName(teamName));
|
||||
}
|
||||
|
||||
export function inboxPath(teamName: string, agentName: string) {
|
||||
return path.join(
|
||||
teamDir(teamName),
|
||||
"inboxes",
|
||||
`${sanitizeName(agentName)}.json`,
|
||||
);
|
||||
}
|
||||
|
||||
export function configPath(teamName: string) {
|
||||
return path.join(teamDir(teamName), "config.json");
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue