@phi-code-admin/phi-code 0.59.3 → 0.59.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/core/default-models.json +75 -0
- package/dist/core/export-html/template.css +971 -0
- package/dist/core/export-html/template.html +54 -0
- package/dist/modes/interactive/theme/dark.json +85 -0
- package/dist/modes/interactive/theme/light.json +84 -0
- package/dist/modes/interactive/theme/theme-schema.json +335 -0
- package/package.json +5 -3
- package/scripts/migrate-sessions.sh +93 -0
- package/scripts/postinstall.cjs +40 -0
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* Post-install script: copies bundled extensions, agents, and skills
|
|
4
|
+
* to ~/.phi/agent/ so Pi discovers them automatically.
|
|
5
|
+
*/
|
|
6
|
+
const { existsSync, mkdirSync, cpSync, readdirSync } = require("fs");
|
|
7
|
+
const { join } = require("path");
|
|
8
|
+
const { homedir } = require("os");
|
|
9
|
+
|
|
10
|
+
const agentDir = join(homedir(), ".phi", "agent");
|
|
11
|
+
const packageDir = __dirname.replace(/[/\\]scripts$/, "");
|
|
12
|
+
|
|
13
|
+
const copies = [
|
|
14
|
+
{ src: "extensions/phi", dest: join(agentDir, "extensions"), label: "extensions" },
|
|
15
|
+
{ src: "agents", dest: join(agentDir, "agents"), label: "agents" },
|
|
16
|
+
{ src: "skills", dest: join(agentDir, "skills"), label: "skills" },
|
|
17
|
+
];
|
|
18
|
+
|
|
19
|
+
for (const { src, dest, label } of copies) {
|
|
20
|
+
const srcDir = join(packageDir, src);
|
|
21
|
+
if (!existsSync(srcDir)) continue;
|
|
22
|
+
|
|
23
|
+
mkdirSync(dest, { recursive: true });
|
|
24
|
+
|
|
25
|
+
const files = readdirSync(srcDir);
|
|
26
|
+
let copied = 0;
|
|
27
|
+
for (const file of files) {
|
|
28
|
+
const srcPath = join(srcDir, file);
|
|
29
|
+
const destPath = join(dest, file);
|
|
30
|
+
try {
|
|
31
|
+
cpSync(srcPath, destPath, { recursive: true, force: true });
|
|
32
|
+
copied++;
|
|
33
|
+
} catch (e) {
|
|
34
|
+
// Skip files that can't be copied (permissions, etc.)
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
if (copied > 0) {
|
|
38
|
+
console.log(` Φ Installed ${copied} ${label} to ${dest}`);
|
|
39
|
+
}
|
|
40
|
+
}
|