supipowers 0.1.4 → 0.2.0
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/bin/install.mjs +31 -21
- package/package.json +1 -1
package/bin/install.mjs
CHANGED
|
@@ -4,7 +4,6 @@ import {
|
|
|
4
4
|
intro,
|
|
5
5
|
outro,
|
|
6
6
|
confirm,
|
|
7
|
-
select,
|
|
8
7
|
multiselect,
|
|
9
8
|
spinner,
|
|
10
9
|
isCancel,
|
|
@@ -12,7 +11,7 @@ import {
|
|
|
12
11
|
note,
|
|
13
12
|
} from "@clack/prompts";
|
|
14
13
|
import { spawnSync } from "node:child_process";
|
|
15
|
-
import { readFileSync, existsSync } from "node:fs";
|
|
14
|
+
import { readFileSync, existsSync, mkdirSync, cpSync, readdirSync } from "node:fs";
|
|
16
15
|
import { resolve, dirname, join } from "node:path";
|
|
17
16
|
import { fileURLToPath } from "node:url";
|
|
18
17
|
import { homedir } from "node:os";
|
|
@@ -131,29 +130,40 @@ async function main() {
|
|
|
131
130
|
ompSpinner.stop(`OMP ${ver} detected`);
|
|
132
131
|
}
|
|
133
132
|
|
|
134
|
-
// ── Step 2: Install supipowers
|
|
135
|
-
|
|
136
|
-
const scope = await select({
|
|
137
|
-
message: "Where should supipowers be installed?",
|
|
138
|
-
options: [
|
|
139
|
-
{ value: "global", label: "Global", hint: "available in all projects" },
|
|
140
|
-
{ value: "local", label: "Project-local", hint: "only this directory" },
|
|
141
|
-
],
|
|
142
|
-
});
|
|
143
|
-
if (isCancel(scope)) bail("Cancelled.");
|
|
144
|
-
|
|
145
|
-
const packageSpec = `npm:supipowers@${VERSION}`;
|
|
146
|
-
const installArgs = ["install", packageSpec];
|
|
147
|
-
if (scope === "local") installArgs.push("-l");
|
|
133
|
+
// ── Step 2: Install supipowers into ~/.omp/agent/ ───────────
|
|
148
134
|
|
|
149
135
|
const s = spinner();
|
|
150
|
-
s.start(
|
|
151
|
-
|
|
152
|
-
|
|
136
|
+
s.start("Installing supipowers...");
|
|
137
|
+
|
|
138
|
+
const packageRoot = resolve(__dirname, "..");
|
|
139
|
+
const ompAgent = join(homedir(), ".omp", "agent");
|
|
140
|
+
|
|
141
|
+
try {
|
|
142
|
+
// Copy extension (src/ + package.json) → ~/.omp/agent/extensions/supipowers/
|
|
143
|
+
const extDir = join(ompAgent, "extensions", "supipowers");
|
|
144
|
+
mkdirSync(extDir, { recursive: true });
|
|
145
|
+
cpSync(join(packageRoot, "src"), join(extDir, "src"), { recursive: true });
|
|
146
|
+
cpSync(join(packageRoot, "package.json"), join(extDir, "package.json"));
|
|
147
|
+
|
|
148
|
+
// Copy skills → ~/.omp/agent/skills/<skillname>/SKILL.md
|
|
149
|
+
const skillsSource = join(packageRoot, "skills");
|
|
150
|
+
if (existsSync(skillsSource)) {
|
|
151
|
+
const skillDirs = readdirSync(skillsSource, { withFileTypes: true });
|
|
152
|
+
for (const entry of skillDirs) {
|
|
153
|
+
if (!entry.isDirectory()) continue;
|
|
154
|
+
const skillFile = join(skillsSource, entry.name, "SKILL.md");
|
|
155
|
+
if (!existsSync(skillFile)) continue;
|
|
156
|
+
const destDir = join(ompAgent, "skills", entry.name);
|
|
157
|
+
mkdirSync(destDir, { recursive: true });
|
|
158
|
+
cpSync(skillFile, join(destDir, "SKILL.md"));
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
s.stop("supipowers installed");
|
|
163
|
+
} catch (err) {
|
|
153
164
|
s.stop("Installation failed");
|
|
154
|
-
bail(
|
|
165
|
+
bail(err.message || "Failed to copy files to ~/.omp/agent/");
|
|
155
166
|
}
|
|
156
|
-
s.stop("supipowers installed");
|
|
157
167
|
|
|
158
168
|
// ── Step 3: LSP setup (optional) ──────────────────────────
|
|
159
169
|
|