@onecrew/pro 0.1.25 → 0.1.27

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/README.md CHANGED
@@ -3,7 +3,7 @@
3
3
  Install Node.js with npm, then run:
4
4
 
5
5
  ```sh
6
- npm install --global @onecrew/pro@0.1.25 --registry=https://registry.npmjs.org/
6
+ npm install --global @onecrew/pro@0.1.27 --registry=https://registry.npmjs.org/
7
7
  onecrew-pro --version
8
8
  onecrew-pro start
9
9
  onecrew-pro status
@@ -11,8 +11,10 @@ onecrew-pro status
11
11
 
12
12
  The service uses the existing OneCrewConnect data directory. Complete sign-in in the local URL printed by start/status.
13
13
 
14
- Before updating, run `onecrew-pro stop` for the profile in use, install the new package version, then run `onecrew-pro start`. For an existing ZIP installation, stop its installed binary before installing the npm package. Keep its data directory.
14
+ Use `onecrew-pro update` for application updates. For an npm reinstall, run `onecrew-pro stop` for the profile in use, install the new package version, then run `onecrew-pro start`. Keep the existing data directory.
15
15
 
16
- MCP clients can run `onecrew-pro mcp`. The service must already be running. `onecrew-pro --print-binary-path` returns the absolute native executable path for clients that need one. Keep optional dependencies enabled so npm can install the platform binary.
16
+ Use `onecrew-pro setup --client codex` or `onecrew-pro setup --client workbuddy` to configure a client and verify HTTP and MCP. Other MCP clients supply `--client mcp --mcp-config <file> --skills-dir <directory>`. See `setup --help` for paths and data profiles.
17
+
18
+ MCP clients run `onecrew-pro mcp`. Its `onecrew_runtime` tool can inspect, start or diagnose a stopped service. `onecrew-pro --print-binary-path` returns the native executable path. Keep optional dependencies enabled so npm installs the platform binary.
17
19
 
18
20
  Connect the AI client you use by following the [macOS npm guide](https://access.onecrewai.io/cli/install/pro/npm) or [Windows npm guide](https://access.onecrewai.io/cli/install/pro/npm/windows). Access provides the client-specific configuration and verification steps.
@@ -3,6 +3,7 @@ const fs = require('node:fs');
3
3
  const path = require('node:path');
4
4
  const { spawn } = require('node:child_process');
5
5
  const { constants } = require('node:os');
6
+ const os = require('node:os');
6
7
 
7
8
  const manifest = require('../package.json');
8
9
  const target = `${process.platform}-${process.arch}`;
@@ -23,9 +24,43 @@ const binary = path.join(
23
24
  if (!fs.statSync(binary).isFile()) throw new Error(`OneCrew Pro binary is missing: ${binary}`);
24
25
 
25
26
  const args = process.argv.slice(2);
26
- if (args.length === 1 && args[0] === '--print-binary-path') {
27
+ if (args[0] === 'setup') {
28
+ require('./setup.cjs')
29
+ .runSetup(args.slice(1), {
30
+ version: manifest.version,
31
+ directory: path.dirname(require.resolve('../package.json')),
32
+ platformDirectory: path.dirname(platformManifestPath),
33
+ })
34
+ .catch((error) => {
35
+ console.error(error.message);
36
+ process.exitCode = 1;
37
+ });
38
+ } else if (args.length === 1 && args[0] === '--print-binary-path') {
27
39
  console.log(binary);
28
40
  } else {
41
+ const installationRoot =
42
+ process.env.ONECREW_INSTALL_DIR ??
43
+ (process.platform === 'win32'
44
+ ? path.join(
45
+ process.env.LOCALAPPDATA ?? path.join(os.homedir(), 'AppData', 'Local'),
46
+ 'OneCrewPro',
47
+ )
48
+ : path.join(os.homedir(), 'Library', 'Application Support', 'OneCrewPro'));
49
+ const setupFile = path.join(installationRoot, 'setup.json');
50
+ const information = args.some((arg) => ['--help', '-h', '--version', '-v', 'help'].includes(arg));
51
+ const explicitProfile = args.some((arg) => arg === '--data-dir' || arg.startsWith('--data-dir='));
52
+ if (
53
+ !information &&
54
+ args.length &&
55
+ !process.env.ONECREW_DATA_DIR &&
56
+ !explicitProfile &&
57
+ fs.existsSync(setupFile)
58
+ ) {
59
+ const setup = JSON.parse(fs.readFileSync(setupFile, 'utf8'));
60
+ if (typeof setup.data_dir !== 'string' || !path.isAbsolute(setup.data_dir))
61
+ throw new Error(`Invalid profile in ${setupFile}`);
62
+ process.env.ONECREW_DATA_DIR = setup.data_dir;
63
+ }
29
64
  const child = spawn(binary, args, { stdio: 'inherit', windowsHide: true });
30
65
  const signals = ['SIGINT', 'SIGTERM', 'SIGHUP'];
31
66
  const handlers = new Map();