grokbox 0.0.1 → 0.1.0-alpha.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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 grokbox contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,34 +1,232 @@
1
1
  # grokbox
2
2
 
3
- Unofficial local CLI for inspecting and messaging a running Grok Bot host.
4
- It is not affiliated with or endorsed by Anysphere, Cursor, or xAI.
3
+ Unofficial CLI and control plane for operating Grok Bot cloud computers from
4
+ inside or outside the box. The canonical command is `grokbox`; `gbox` is an
5
+ exact alias.
5
6
 
6
- ## Requirements
7
+ This project is not affiliated with or endorsed by Anysphere, Cursor, xAI, or
8
+ Grok Bot. Grok Bot, Cursor, and related names identify compatible products and
9
+ remain the property of their respective owners.
7
10
 
8
- - Bun 1.3 or newer
9
- - A reachable Grok Bot host on the same machine or network
11
+ > **Alpha:** current `main` is `0.1.0-alpha.0`. Prereleases publish on npm under
12
+ > the `next` dist-tag after release checks and external acceptance. The existing
13
+ > npm `0.0.1` is an earlier unsupported snapshot and does not represent current
14
+ > `main`.
15
+
16
+ ## What it does
17
+
18
+ ```text
19
+ Profile -> local daemon -> local Grok Bot Gateway
20
+ -> remote daemon over private Tailscale Serve
21
+ -> explicit direct-local or Gateway compatibility path
22
+ -> explicit Cursor Sandbox or quota compatibility adapter
23
+ ```
24
+
25
+ Implemented command families:
26
+
27
+ ```text
28
+ init skills profile daemon doctor recover box quota
29
+ agents groups send history memory events is
30
+ fs exec jobs desktop
31
+ ```
32
+
33
+ Highlights:
34
+
35
+ - strict local and remote Profiles with separate credential authorities;
36
+ - finite Unix-socket/loopback daemon and private Tailscale Serve mapping;
37
+ - agent/group management, send, transcript, Memory, and bounded events;
38
+ - named-root governed file reads and mutations;
39
+ - literal structured execution with durable Jobs and bounded logs;
40
+ - layered read-only diagnosis and explicit recovery;
41
+ - opt-in Sandbox lifecycle, quota, and desktop compatibility adapters.
42
+
43
+ The daemon does not provide a generic raw RPC or shell. Gateway-only Profiles
44
+ never gain host filesystem or process authority.
45
+
46
+ ## Prerequisites and platform support
47
+
48
+ - Node.js 20+ for the published-style CLI runtime.
49
+ - Bun 1.3.14 for source development and the pre-release source shim.
50
+ - An existing Grok Bot cloud computer that you own or are authorized to use.
51
+ - Tailscale plus BatchMode SSH for remote bootstrap/recovery; bootstrap also
52
+ needs npm or Bun locally to repack the installed runtime for transfer.
53
+
54
+ | Role | Supported or tested |
55
+ | --- | --- |
56
+ | Source development | Linux and macOS |
57
+ | Node CLI | Linux and macOS |
58
+ | Box daemon, files, Jobs, desktop | Linux |
59
+ | Keychain secret references | macOS |
60
+ | Windows | Not currently supported or tested |
61
+
62
+ ## Five-minute source quick start
63
+
64
+ ```bash
65
+ git clone https://github.com/yoyooyooo/grokbox.git
66
+ cd grokbox
67
+ bun install --frozen-lockfile
68
+ bun run typecheck
69
+ bun run grokbox -- --help
70
+ bun run grokbox -- doctor
71
+ ```
72
+
73
+ `doctor` is read-only. It reports each configured boundary separately and does
74
+ not wake a Sandbox, alter Tailscale Serve, start a daemon, or rotate a
75
+ credential.
76
+
77
+ Inside a running Grok Bot box, the no-file `default` Profile discovers the
78
+ loopback Gateway from `/home/box/sand-data/gateway.json`. If no local Gateway or
79
+ configured Profile is available, commands fail closed.
10
80
 
11
81
  ## Install
12
82
 
13
83
  ```bash
14
- bun add --global grokbox
15
- grok-bot --help
84
+ npm install --global grokbox@next
85
+ grokbox --version
86
+ gbox --help
87
+ ```
88
+
89
+ Node.js 20 or newer is required. Bun is not required by the published package.
90
+
91
+ ## Source-backed global shim
92
+
93
+ To test an unpublished checkout, install `grokbox` and `gbox` into
94
+ `~/.local/bin` while executing its TypeScript entry directly through Bun:
95
+
96
+ ```bash
97
+ bun run shim:install
98
+ grokbox --version
99
+ gbox --help
100
+ grokbox doctor
101
+ ```
102
+
103
+ The installer is idempotent, writes both aliases atomically, refuses to replace
104
+ an unrelated command, and verifies each installed command from outside the
105
+ repository. It records the absolute checkout and Bun paths, so rerun it after
106
+ moving the repository or Bun executable. This is a local-real source harness;
107
+ it does not replace the separate Node tarball verification.
108
+
109
+ ## Remote initialization
110
+
111
+ Start with discovery and diagnosis. Bootstrap is an explicit privileged step:
112
+
113
+ ```bash
114
+ grokbox init remote --peer <tailnet-peer>
115
+ grokbox doctor --profile remote
116
+
117
+ # Installs/replaces the grokbox daemon, rotates its credential, and applies only
118
+ # the recorded private Serve mapping. Requires BatchMode SSH and confirmation.
119
+ grokbox init remote --peer <tailnet-peer> --bootstrap --yes
16
120
  ```
17
121
 
18
- For a one-off run:
122
+ Home reads are a separate authority transition and are never implied by
123
+ bootstrap:
19
124
 
20
125
  ```bash
21
- bunx grokbox --help
126
+ grokbox init remote --peer <tailnet-peer> --bootstrap --admit-home-read --yes
22
127
  ```
23
128
 
24
- ## Common commands
129
+ Review the named filesystem roots and process allowlist before enabling host
130
+ capabilities.
131
+
132
+ ## Common safe probes
25
133
 
26
134
  ```bash
27
- grok-bot doctor
28
- grok-bot agents list
29
- grok-bot send <agent> "status only"
30
- grok-bot history tail <agent>
31
- grok-bot skills list
135
+ grokbox profile list --table
136
+ grokbox doctor
137
+ grokbox daemon status
138
+ grokbox agents list --table
139
+ grokbox groups list --table
140
+ grokbox history tail <target> --limit 20
141
+ grokbox memory list <agent>
142
+ grokbox fs stat workspace:/artifact.txt
143
+ grokbox jobs list --table
144
+ grokbox desktop status --table
145
+ ```
146
+
147
+ Mutating commands require explicit capability and, where destructive, explicit
148
+ confirmation. `desktop prune run` defaults to dry-run; `--yes` invokes the
149
+ upstream stop-window path and deletes that fork's Chrome profile.
150
+
151
+ ## Credentials
152
+
153
+ Never pass Gateway, daemon, Sandbox, quota, SSH, or tailnet credentials on
154
+ argv, in issues, fixtures, snapshots, or ordinary logs.
155
+
156
+ Secret references are purpose-specific:
157
+
158
+ ```text
159
+ env:<NAME>
160
+ file:<absolute-path>
161
+ keychain:<service>/<account>
32
162
  ```
33
163
 
34
- Run `grok-bot --help` or `grok-bot <command> --help` for the complete command reference.
164
+ A `file:` reference must resolve to a regular file owned by the current POSIX
165
+ user with no group or other permission bits; symbolic links are rejected.
166
+ Profiles never store inline tokens. Gateway, daemon, Sandbox, and quota
167
+ credentials are separate capabilities and are never substituted for one
168
+ another.
169
+
170
+ ## Experimental compatibility surfaces
171
+
172
+ Grok Bot Gateway methods, Cursor Sandbox RPCs, the Cursor web quota endpoint,
173
+ and Grok Bot desktop layout are not documented upstream public APIs. Their
174
+ implementation may break without notice and does not imply provider
175
+ endorsement or authorization.
176
+
177
+ In particular:
178
+
179
+ - official Cursor OAuth has been observed to read Sandbox state but receive 401
180
+ from `EnsureSandBox`;
181
+ - App-free wake and 24–72 hour keeper behavior are not stable claims;
182
+ - quota requires an explicit independent source and has source-local account
183
+ binding;
184
+ - desktop prune is Linux/layout-specific and destructive when confirmed.
185
+
186
+ See [Compatibility and upstream boundary](docs/compatibility.md) before using
187
+ these surfaces. Users are responsible for the terms and policies applying to
188
+ their accounts and environments.
189
+
190
+ ## Development and verification
191
+
192
+ ```bash
193
+ bun install --frozen-lockfile
194
+ bun run typecheck
195
+ bun test
196
+ bun run verify:package
197
+ bun run release:check
198
+ ```
199
+
200
+ The package test builds and packs locally, installs into an isolated system
201
+ Trash fixture, verifies both aliases under Node, checks the exact package
202
+ allowlist, and confirms project and third-party licenses are present. The
203
+ release-candidate workflow builds a downloadable artifact only. Exact version
204
+ tags publish through the separate OIDC Trusted Publishing workflow with npm
205
+ provenance; prereleases use the `next` dist-tag.
206
+
207
+ Real external validation is intentionally separate and requires explicitly
208
+ injected authorized targets. Set `GROKBOX_EXTERNAL_PACKAGE` to an exact registry
209
+ version to test what users install rather than a locally packed tarball.
210
+ Fake-provider or local results do not prove provider authorization, long-lived
211
+ lease behavior, or destructive recovery.
212
+
213
+ ## Documentation
214
+
215
+ - [Documentation map](https://github.com/yoyooyooo/grokbox/blob/main/docs/README.md)
216
+ - [Product contract](https://github.com/yoyooyooo/grokbox/blob/main/docs/product-contract.md)
217
+ - [Architecture](https://github.com/yoyooyooo/grokbox/blob/main/docs/architecture.md)
218
+ - [Compatibility boundary](https://github.com/yoyooyooo/grokbox/blob/main/docs/compatibility.md)
219
+ - [Upstream integration facts](https://github.com/yoyooyooo/grokbox/blob/main/docs/upstream-integration.md)
220
+ - [Security policy](SECURITY.md)
221
+ - [Support](SUPPORT.md)
222
+ - [Contributing](CONTRIBUTING.md)
223
+ - [Changelog](CHANGELOG.md)
224
+
225
+ Current behavior is owned by source and executable tests. Product and
226
+ architecture documents may describe accepted targets; roadmap and local issue
227
+ files do not prove delivery.
228
+
229
+ ## License
230
+
231
+ MIT. See [`LICENSE`](LICENSE). The published bundle's third-party attributions
232
+ are in [`THIRD_PARTY_NOTICES`](THIRD_PARTY_NOTICES).
@@ -0,0 +1,29 @@
1
+ Third-Party Notices
2
+ ===================
3
+
4
+ grokbox's published JavaScript bundle includes the following third-party
5
+ software. This notice is distributed with every grokbox package artifact.
6
+
7
+ Commander.js
8
+ ------------
9
+
10
+ Copyright (c) 2011 TJ Holowaychuk <tj@vision-media.ca>
11
+
12
+ Permission is hereby granted, free of charge, to any person obtaining
13
+ a copy of this software and associated documentation files (the
14
+ 'Software'), to deal in the Software without restriction, including
15
+ without limitation the rights to use, copy, modify, merge, publish,
16
+ distribute, sublicense, and/or sell copies of the Software, and to
17
+ permit persons to whom the Software is furnished to do so, subject to
18
+ the following conditions:
19
+
20
+ The above copyright notice and this permission notice shall be
21
+ included in all copies or substantial portions of the Software.
22
+
23
+ THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
24
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
25
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
26
+ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
27
+ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
28
+ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
29
+ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
package/bin/grokbox ADDED
@@ -0,0 +1,13 @@
1
+ #!/usr/bin/env node
2
+ import {
3
+ RUNTIME_UNSUPPORTED_EXIT_CODE,
4
+ runtimeUnsupportedEnvelope,
5
+ supportsNodeRuntime,
6
+ } from "./runtime.js";
7
+
8
+ if (!supportsNodeRuntime(process.versions.node)) {
9
+ process.stderr.write(`${JSON.stringify(runtimeUnsupportedEnvelope(process.versions.node))}\n`);
10
+ process.exitCode = RUNTIME_UNSUPPORTED_EXIT_CODE;
11
+ } else {
12
+ await import("../dist/index.js");
13
+ }
@@ -0,0 +1,13 @@
1
+ export const MINIMUM_NODE_MAJOR: number;
2
+ export const RUNTIME_UNSUPPORTED_EXIT_CODE: number;
3
+ export function nodeMajor(version: unknown): number | null;
4
+ export function supportsNodeRuntime(version: unknown): boolean;
5
+ export function runtimeUnsupportedEnvelope(version: unknown): {
6
+ ok: false;
7
+ error: {
8
+ code: "runtime_unsupported";
9
+ message: string;
10
+ retryable: false;
11
+ runtime: { nodeMajor: number | null; minimumNodeMajor: number };
12
+ };
13
+ };
package/bin/runtime.js ADDED
@@ -0,0 +1,27 @@
1
+ export const MINIMUM_NODE_MAJOR = 20;
2
+ export const RUNTIME_UNSUPPORTED_EXIT_CODE = 59;
3
+
4
+ export function nodeMajor(version) {
5
+ const major = Number.parseInt(String(version).split(".", 1)[0] ?? "", 10);
6
+ return Number.isSafeInteger(major) ? major : null;
7
+ }
8
+
9
+ export function supportsNodeRuntime(version) {
10
+ const major = nodeMajor(version);
11
+ return major !== null && major >= MINIMUM_NODE_MAJOR;
12
+ }
13
+
14
+ export function runtimeUnsupportedEnvelope(version) {
15
+ return {
16
+ ok: false,
17
+ error: {
18
+ code: "runtime_unsupported",
19
+ message: `grokbox requires Node.js ${MINIMUM_NODE_MAJOR} or newer.`,
20
+ retryable: false,
21
+ runtime: {
22
+ nodeMajor: nodeMajor(version),
23
+ minimumNodeMajor: MINIMUM_NODE_MAJOR,
24
+ },
25
+ },
26
+ };
27
+ }