@illusoryai/pi-framer 0.1.0 → 0.1.2

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.
Files changed (3) hide show
  1. package/README.md +19 -0
  2. package/install.mjs +62 -0
  3. package/package.json +4 -1
package/README.md ADDED
@@ -0,0 +1,19 @@
1
+ # @illusoryai/pi-framer
2
+
3
+ Framer CMS management — content CRUD, publishing, and custom code injection.
4
+
5
+ ## Contents
6
+
7
+ | Type | Name | Description |
8
+ |------|------|-------------|
9
+ | Extension | `framer.ts` | Connects to Framer Server API via WebSocket (framer-api SDK) |
10
+ | Skill | `framer-cms` | Blog schema, common workflows, publishing guide |
11
+
12
+ ## Install
13
+
14
+ ```bash
15
+ pi install npm:@illusoryai/pi-framer
16
+ ```
17
+
18
+ Requires `FRAMER_PROJECT_URL` and `FRAMER_API_KEY` environment variables.
19
+ Private package — requires npm auth configured in `~/.npmrc`.
package/install.mjs ADDED
@@ -0,0 +1,62 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * @illusoryai/pi-framer postinstall
4
+ * Auto-installs peer dependencies and registers them in pi settings.
5
+ * Add entries to PEERS array when this package gains peer deps.
6
+ */
7
+ import { execSync } from "node:child_process";
8
+ import { existsSync, readFileSync, writeFileSync } from "node:fs";
9
+ import { join, dirname } from "node:path";
10
+ import { homedir } from "node:os";
11
+ import { fileURLToPath } from "node:url";
12
+
13
+ const PEERS = [];
14
+
15
+ if (PEERS.length === 0) process.exit(0);
16
+
17
+ const __dirname = dirname(fileURLToPath(import.meta.url));
18
+ const globalModules = join(__dirname, "..", "..");
19
+
20
+ for (const peer of PEERS) {
21
+ const peerPath = join(globalModules, peer);
22
+ if (!existsSync(peerPath)) {
23
+ console.log(`[pi-framer] Installing peer: ${peer}`);
24
+ try {
25
+ execSync(`npm install -g ${peer}`, { stdio: "pipe" });
26
+ console.log(`[pi-framer] Installed ${peer}`);
27
+ } catch {
28
+ console.warn(
29
+ `[pi-framer] Could not auto-install ${peer}. Run: pi install npm:${peer}`
30
+ );
31
+ }
32
+ }
33
+ }
34
+
35
+ const home = process.env.SUDO_USER
36
+ ? join("/home", process.env.SUDO_USER)
37
+ : homedir();
38
+ const settingsPath = join(home, ".pi", "agent", "settings.json");
39
+
40
+ if (existsSync(settingsPath)) {
41
+ try {
42
+ const settings = JSON.parse(readFileSync(settingsPath, "utf8"));
43
+ const packages = settings.packages || [];
44
+ let changed = false;
45
+
46
+ for (const peer of PEERS) {
47
+ const entry = `npm:${peer}`;
48
+ if (!packages.includes(entry)) {
49
+ packages.push(entry);
50
+ changed = true;
51
+ }
52
+ }
53
+
54
+ if (changed) {
55
+ settings.packages = packages;
56
+ writeFileSync(settingsPath, JSON.stringify(settings, null, 2) + "\n");
57
+ console.log("[pi-framer] Updated pi settings with peer deps");
58
+ }
59
+ } catch {
60
+ // Don't fail install on settings update error
61
+ }
62
+ }
package/package.json CHANGED
@@ -1,9 +1,12 @@
1
1
  {
2
2
  "name": "@illusoryai/pi-framer",
3
- "version": "0.1.0",
3
+ "version": "0.1.2",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "keywords": ["pi-package"],
7
+ "scripts": {
8
+ "postinstall": "node install.mjs"
9
+ },
7
10
  "pi": {
8
11
  "extensions": "extensions",
9
12
  "skills": "skills"