insightfulpipe 0.1.1 → 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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "insightfulpipe",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "description": "InsightfulPipe CLI — query your marketing data from the terminal",
5
5
  "bin": {
6
6
  "insightfulpipe": "bin/cli.js"
@@ -8,6 +8,7 @@
8
8
  "files": [
9
9
  "bin/",
10
10
  "src/",
11
+ "scripts/",
11
12
  "skills/",
12
13
  "README.md",
13
14
  "CHANGELOG.md",
@@ -18,6 +19,7 @@
18
19
  "type": "module",
19
20
  "scripts": {
20
21
  "start": "node bin/cli.js",
22
+ "postinstall": "node scripts/postinstall.js",
21
23
  "test": "node --test",
22
24
  "test:unit": "node --test test/cli.test.js",
23
25
  "test:live": "node --test test/live-smoke.test.js"
@@ -0,0 +1,33 @@
1
+ #!/usr/bin/env node
2
+
3
+ import { existsSync, mkdirSync, writeFileSync, readFileSync } from 'fs';
4
+ import { join, dirname } from 'path';
5
+ import { fileURLToPath } from 'url';
6
+
7
+ // Auto-detect skills directory: env var > known OpenClaw paths
8
+ const KNOWN_PATHS = [
9
+ process.env.OPENCLAW_SKILLS_DIR,
10
+ '/openclaw/skills',
11
+ join(process.env.HOME || '', '.openclaw', 'skills'),
12
+ ];
13
+
14
+ const skillsDir = KNOWN_PATHS.find((p) => p && existsSync(p));
15
+ if (!skillsDir) {
16
+ process.exit(0);
17
+ }
18
+
19
+ const targetDir = join(skillsDir, 'insightfulpipe');
20
+ const __dirname = dirname(fileURLToPath(import.meta.url));
21
+ const skillSource = join(__dirname, '..', 'skills', 'insightfulpipe', 'SKILL.md');
22
+
23
+ if (!existsSync(skillSource)) {
24
+ process.exit(0);
25
+ }
26
+
27
+ try {
28
+ mkdirSync(targetDir, { recursive: true });
29
+ writeFileSync(join(targetDir, 'SKILL.md'), readFileSync(skillSource));
30
+ console.log(`InsightfulPipe skill installed to ${targetDir}`);
31
+ } catch (err) {
32
+ console.error(`Warning: could not install skill to ${targetDir}: ${err.message}`);
33
+ }