@sowonai/crewx-cli 0.4.0-dev.1 → 0.4.0-dev.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": "@sowonai/crewx-cli",
3
- "version": "0.4.0-dev.1",
3
+ "version": "0.4.0-dev.2",
4
4
  "license": "MIT",
5
5
  "description": "SowonAI CrewX CLI - Bring Your Own AI(BYOA) team in Slack/IDE(MCP) with your existing subscriptions",
6
6
  "private": false,
@@ -18,6 +18,7 @@
18
18
  },
19
19
  "files": [
20
20
  "dist",
21
+ "scripts",
21
22
  "README.md",
22
23
  "crewx.yaml",
23
24
  "docs",
@@ -37,8 +38,8 @@
37
38
  },
38
39
  "scripts": {
39
40
  "build": "nest build",
40
- "postbuild": "node ../../scripts/postbuild-cli.mjs",
41
- "postinstall": "node ../../scripts/postinstall-cli.mjs",
41
+ "postbuild": "node ./scripts/postbuild-cli.mjs",
42
+ "postinstall": "node ./scripts/postinstall-cli.mjs",
42
43
  "start": "node dist/main.js",
43
44
  "start:mcp": "node dist/main.js mcp",
44
45
  "start:slack": "caffeinate -i dotenv -e ../../.env.slack -- node dist/main.js slack --log --agent crewx_glm_dev",
@@ -63,7 +64,7 @@
63
64
  "prepack": "npm run build"
64
65
  },
65
66
  "dependencies": {
66
- "@sowonai/crewx-sdk": "file:../sdk",
67
+ "@sowonai/crewx-sdk": "^0.1.0-dev.0",
67
68
  "@sowonai/nestjs-mcp-adapter": "^0.1.3",
68
69
  "@modelcontextprotocol/sdk": "^1.0.0",
69
70
  "@nestjs/common": "^11.0.0",
@@ -0,0 +1,40 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * Ensure the CLI build artifact has an executable shebang after compilation.
4
+ * Works both inside the monorepo and when the package is installed from npm.
5
+ */
6
+ import { chmodSync, existsSync, readFileSync, writeFileSync } from 'fs';
7
+ import { dirname, join } from 'path';
8
+ import { fileURLToPath } from 'url';
9
+
10
+ const scriptDir = dirname(fileURLToPath(import.meta.url));
11
+ const packageRoot = dirname(scriptDir);
12
+
13
+ const candidatePaths = [
14
+ join(packageRoot, 'dist', 'main.js'),
15
+ join(packageRoot, '..', '..', 'dist', 'main.js')
16
+ ];
17
+
18
+ const targetPath = candidatePaths.find(p => existsSync(p));
19
+
20
+ if (!targetPath) {
21
+ console.warn('⚠️ postbuild skipped: dist/main.js not found (expected during migration)');
22
+ process.exit(0);
23
+ }
24
+
25
+ let content = readFileSync(targetPath, 'utf8');
26
+ const lines = content.split('\n');
27
+ if (lines[0] === '#!/usr/bin/env node' && lines[1] === '#!/usr/bin/env node') {
28
+ lines.shift();
29
+ content = lines.join('\n');
30
+ writeFileSync(targetPath, content);
31
+ console.log('✅ Removed duplicate shebang');
32
+ } else if (!content.startsWith('#!/usr/bin/env node')) {
33
+ writeFileSync(targetPath, '#!/usr/bin/env node\n' + content);
34
+ console.log('✅ Added shebang to dist/main.js');
35
+ } else {
36
+ console.log('✅ Shebang already present');
37
+ }
38
+
39
+ chmodSync(targetPath, 0o755);
40
+ console.log(`✅ Execute permission set (${targetPath})`);
@@ -0,0 +1,30 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * postinstall hook used after npm install to ensure the CrewX CLI binary is executable.
4
+ * Works in both workspace and published package contexts.
5
+ */
6
+ import { chmodSync, existsSync } from 'fs';
7
+ import { dirname, join } from 'path';
8
+ import { fileURLToPath } from 'url';
9
+
10
+ const scriptDir = dirname(fileURLToPath(import.meta.url));
11
+ const packageRoot = dirname(scriptDir);
12
+
13
+ const candidatePaths = [
14
+ join(packageRoot, 'dist', 'main.js'),
15
+ join(packageRoot, '..', '..', 'dist', 'main.js')
16
+ ];
17
+
18
+ const targetPath = candidatePaths.find(p => existsSync(p));
19
+
20
+ if (!targetPath) {
21
+ console.warn('⚠️ postinstall skipped: dist/main.js not found (expected during migration)');
22
+ process.exit(0);
23
+ }
24
+
25
+ try {
26
+ chmodSync(targetPath, 0o755);
27
+ console.log(`✅ Execute permission set for crewx binary (${targetPath})`);
28
+ } catch (err) {
29
+ console.warn('⚠️ postinstall could not set execute permission:', err.message);
30
+ }