craby-gateway 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/README.md ADDED
@@ -0,0 +1,125 @@
1
+ # @craby-ai/gateway
2
+
3
+ CLI package for running the Craby desktop gateway service.
4
+
5
+ ## Install
6
+
7
+ ```bash
8
+ npm install -g @craby-ai/gateway
9
+ ```
10
+
11
+ Requires Node 20 or newer.
12
+
13
+ First-time setup now writes a user config file at `~/.craby-ai/gateway.yaml`.
14
+
15
+ ## Publish
16
+
17
+ Set your npmjs access token in the repo root `.npmrc` file. A checked-in example lives at `.npmrc.example`, while `.npmrc` is gitignored:
18
+
19
+ ```bash
20
+ cp .npmrc.example .npmrc
21
+ ```
22
+
23
+ Then edit `.npmrc` and set:
24
+
25
+ ```ini
26
+ //registry.npmjs.org/:_authToken=npm_xxxxxxxxxxxxxxxxxxxx
27
+ ```
28
+
29
+ Build and inspect the package contents before publishing:
30
+
31
+ ```bash
32
+ pnpm --filter @remote-agent/desktop-gateway run pack:check
33
+ ```
34
+
35
+ Publish from the workspace package:
36
+
37
+ ```bash
38
+ pnpm --filter @remote-agent/desktop-gateway run publish:npm
39
+ ```
40
+
41
+ Useful verification commands:
42
+
43
+ ```bash
44
+ npm whoami --userconfig ../../.npmrc
45
+ npm view @craby-ai/gateway version
46
+ ```
47
+
48
+ ## Run
49
+
50
+ Initialize the user config, inspect local provider versions, then start the gateway:
51
+
52
+ ```bash
53
+ craby-gateway init
54
+ craby-gateway doctor
55
+ craby-gateway start
56
+ ```
57
+
58
+ `craby-gateway start` also auto-creates `~/.craby-ai/gateway.yaml` if it does not exist yet.
59
+
60
+ By default `start` prints a short startup summary to the terminal and writes detailed runtime logs to `~/.craby-ai/logs/gateway.log`. Add `--log` to mirror runtime logs to the console too:
61
+
62
+ ```bash
63
+ craby-gateway start --log
64
+ ```
65
+
66
+ The generated YAML is grouped by concern instead of keeping everything flat:
67
+
68
+ ```yaml
69
+ configVersion: 1
70
+ gateway:
71
+ host: 0.0.0.0
72
+ port: 8787
73
+ httpsEnabled: false
74
+ httpsPort: 8787
75
+ apiKey: ...
76
+ accessSecret: ...
77
+ refreshSecret: ...
78
+ enableNativeProviders: true
79
+ requireNativeCodex: false
80
+ workspaceRoot: ~/...
81
+ auditLogPath: ~/.craby-ai/logs/audit.log
82
+ gatewayLogPath: ~/.craby-ai/logs/gateway.log
83
+ idleTtlMs: 900000
84
+ ```
85
+
86
+ Default config values include:
87
+
88
+ - `httpsEnabled: false`
89
+ - `port: 8787`
90
+ - generated `apiKey`, `accessSecret`, and `refreshSecret`
91
+ - `enableNativeProviders: true`
92
+ - detailed runtime logs at `~/.craby-ai/logs/gateway.log`
93
+
94
+ Older flat config files are still accepted for compatibility.
95
+
96
+ The `doctor` command checks:
97
+
98
+ - whether the user's machine exposes a working `codex --version` command
99
+ - the bundled `@anthropic-ai/claude-agent-sdk` version installed with the package
100
+ - the user's machine `claude --version` output when that command exists
101
+
102
+ The package still accepts environment variable overrides. Common ones include:
103
+
104
+ - `GATEWAY_HOST`
105
+ - `GATEWAY_PORT`
106
+ - `GATEWAY_HTTPS_ENABLED`
107
+ - `GATEWAY_HTTPS_PORT`
108
+ - `GATEWAY_WORKSPACE_ROOT`
109
+ - `ENABLE_NATIVE_PROVIDERS`
110
+ - `REQUIRE_NATIVE_CODEX`
111
+ - `GATEWAY_BOOTSTRAP_PAIRING_CODE_ON_START`
112
+
113
+ You can also point commands at a custom config file:
114
+
115
+ ```bash
116
+ craby-gateway doctor --config /path/to/gateway.yaml
117
+ craby-gateway start --config /path/to/gateway.yaml --log
118
+ ```
119
+
120
+ ## Notes
121
+
122
+ - The published package ships a bundled, minified gateway entrypoint.
123
+ - `yaml`, `qrcode-terminal`, and `pino` are bundled into the published CLI package.
124
+ - The published gateway does not install `@openai/codex`; Codex execution relies on the user's system `codex` command or `REMOTE_AGENT_CODEX_BIN`.
125
+ - `@anthropic-ai/claude-agent-sdk` stays as a runtime dependency because native Claude integration still loads it dynamically.