cli-community-intelligence 0.1.14 → 0.1.15

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.
@@ -3,8 +3,11 @@
3
3
 
4
4
  import { exec } from 'child_process'
5
5
  import { promisify } from 'util'
6
+ import { dirname, resolve } from 'path'
7
+ import { fileURLToPath } from 'url'
6
8
 
7
9
  const execAsync = promisify(exec)
10
+ const __dirname = dirname(fileURLToPath(import.meta.url))
8
11
 
9
12
  // ---------------------------------------------------------------------------------------------------------------------
10
13
  //
@@ -30,10 +33,13 @@ const T = {
30
33
 
31
34
  const F = {
32
35
  // Create an execute handler for a given subcommand
36
+ // WHY: resolve the bundled CLI path relative to this file — the `community-intelligence` bin
37
+ // won't be on PATH in OpenClaw's plugin sandbox
33
38
  // @sig buildExecutor :: String -> (String, Object) -> Promise Object
34
39
  buildExecutor: subcommand => async (_toolCallId, params) => {
35
40
  const args = T.toArgs(params)
36
- const cmd = `community-intelligence ${subcommand} ${args}`.trim()
41
+ const cliBin = resolve(__dirname, 'dist/cli.js')
42
+ const cmd = `node "${cliBin}" ${subcommand} ${args}`.trim()
37
43
  try {
38
44
  const { stdout, stderr } = await execAsync(cmd)
39
45
  const text = [stdout, stderr].filter(Boolean).join('\n')
@@ -2,7 +2,7 @@
2
2
  "id": "cli-community-intelligence",
3
3
  "name": "Community Intelligence",
4
4
  "description": "Scrape and query posts from online communities (Reddit, YouTube)",
5
- "version": "0.1.14",
5
+ "version": "0.1.15",
6
6
  "contracts": {
7
7
  "tools": [
8
8
  "community-intelligence-scrape",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cli-community-intelligence",
3
- "version": "0.1.14",
3
+ "version": "0.1.15",
4
4
  "description": "Community intelligence scraper for construction industry market research",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",