openwrk 0.11.41 → 0.11.43
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/bin/openwrk +61 -0
- package/package.json +16 -48
- package/postinstall.mjs +42 -0
- package/LICENSE +0 -21
- package/README.md +0 -164
- package/dist/openwrk +0 -0
package/bin/openwrk
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
const childProcess = require("child_process")
|
|
4
|
+
const os = require("os")
|
|
5
|
+
const path = require("path")
|
|
6
|
+
|
|
7
|
+
function run(target) {
|
|
8
|
+
const result = childProcess.spawnSync(target, process.argv.slice(2), {
|
|
9
|
+
stdio: "inherit",
|
|
10
|
+
})
|
|
11
|
+
if (result.error) {
|
|
12
|
+
console.error(result.error.message)
|
|
13
|
+
process.exit(1)
|
|
14
|
+
}
|
|
15
|
+
const code = typeof result.status === "number" ? result.status : 0
|
|
16
|
+
process.exit(code)
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
const envPath = process.env.OPENWRK_BIN_PATH
|
|
20
|
+
if (envPath) {
|
|
21
|
+
run(envPath)
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
const platformMap = {
|
|
25
|
+
darwin: "darwin",
|
|
26
|
+
linux: "linux",
|
|
27
|
+
win32: "windows",
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
const archMap = {
|
|
31
|
+
x64: "x64",
|
|
32
|
+
arm64: "arm64",
|
|
33
|
+
arm: "arm",
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
let platform = platformMap[os.platform()]
|
|
37
|
+
if (!platform) {
|
|
38
|
+
platform = os.platform()
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
let arch = archMap[os.arch()]
|
|
42
|
+
if (!arch) {
|
|
43
|
+
arch = os.arch()
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
const pkg = `openwrk-${platform}-${arch}`
|
|
47
|
+
const binary = platform === "windows" ? "openwrk.exe" : "openwrk"
|
|
48
|
+
|
|
49
|
+
let pkgJsonPath
|
|
50
|
+
try {
|
|
51
|
+
pkgJsonPath = require.resolve(`${pkg}/package.json`)
|
|
52
|
+
} catch {
|
|
53
|
+
console.error(
|
|
54
|
+
`openwrk: no prebuilt binary package found for ${platform}/${arch}.\n` +
|
|
55
|
+
`Try installing the platform package manually: ${pkg}`,
|
|
56
|
+
)
|
|
57
|
+
process.exit(1)
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
const resolved = path.join(path.dirname(pkgJsonPath), "bin", binary)
|
|
61
|
+
run(resolved)
|
package/package.json
CHANGED
|
@@ -1,55 +1,23 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "openwrk",
|
|
3
|
-
"version": "0.11.
|
|
3
|
+
"version": "0.11.43",
|
|
4
4
|
"description": "Headless OpenWork host orchestrator for OpenCode + OpenWork server + Owpenbot",
|
|
5
|
-
"type": "module",
|
|
6
|
-
"bin": {
|
|
7
|
-
"openwrk": "dist/openwrk"
|
|
8
|
-
},
|
|
9
|
-
"files": [
|
|
10
|
-
"dist",
|
|
11
|
-
"README.md"
|
|
12
|
-
],
|
|
13
|
-
"repository": {
|
|
14
|
-
"type": "git",
|
|
15
|
-
"url": "git+https://github.com/different-ai/openwork.git",
|
|
16
|
-
"directory": "packages/headless"
|
|
17
|
-
},
|
|
18
|
-
"homepage": "https://github.com/different-ai/openwork/tree/dev/packages/headless",
|
|
19
|
-
"bugs": {
|
|
20
|
-
"url": "https://github.com/different-ai/openwork/issues"
|
|
21
|
-
},
|
|
22
|
-
"keywords": [
|
|
23
|
-
"openwork",
|
|
24
|
-
"opencode",
|
|
25
|
-
"headless",
|
|
26
|
-
"cli",
|
|
27
|
-
"agent"
|
|
28
|
-
],
|
|
29
5
|
"license": "MIT",
|
|
30
|
-
"
|
|
31
|
-
"
|
|
6
|
+
"bin": {
|
|
7
|
+
"openwrk": "./bin/openwrk"
|
|
32
8
|
},
|
|
33
|
-
"
|
|
34
|
-
"
|
|
35
|
-
"@opentui/core": "0.1.77",
|
|
36
|
-
"@opentui/solid": "0.1.77",
|
|
37
|
-
"openwork-server": "0.11.41",
|
|
38
|
-
"owpenwork": "0.11.41",
|
|
39
|
-
"solid-js": "1.9.9"
|
|
9
|
+
"scripts": {
|
|
10
|
+
"postinstall": "bun ./postinstall.mjs || node ./postinstall.mjs"
|
|
40
11
|
},
|
|
41
|
-
"
|
|
42
|
-
"
|
|
43
|
-
"
|
|
44
|
-
"
|
|
12
|
+
"optionalDependencies": {
|
|
13
|
+
"openwrk-darwin-arm64": "0.11.43",
|
|
14
|
+
"openwrk-darwin-x64": "0.11.43",
|
|
15
|
+
"openwrk-linux-x64": "0.11.43",
|
|
16
|
+
"openwrk-linux-arm64": "0.11.43",
|
|
17
|
+
"openwrk-windows-x64": "0.11.43"
|
|
45
18
|
},
|
|
46
|
-
"
|
|
47
|
-
"
|
|
48
|
-
"
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
"build:sidecars": "node scripts/build-sidecars.mjs",
|
|
52
|
-
"typecheck": "tsc -p tsconfig.typecheck.json",
|
|
53
|
-
"test:router": "pnpm build && node scripts/router.mjs"
|
|
54
|
-
}
|
|
55
|
-
}
|
|
19
|
+
"files": [
|
|
20
|
+
"bin",
|
|
21
|
+
"postinstall.mjs"
|
|
22
|
+
]
|
|
23
|
+
}
|
package/postinstall.mjs
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
import os from "os"
|
|
4
|
+
import { createRequire } from "module"
|
|
5
|
+
|
|
6
|
+
const require = createRequire(import.meta.url)
|
|
7
|
+
|
|
8
|
+
function detect() {
|
|
9
|
+
const platformMap = {
|
|
10
|
+
darwin: "darwin",
|
|
11
|
+
linux: "linux",
|
|
12
|
+
win32: "windows",
|
|
13
|
+
}
|
|
14
|
+
const archMap = {
|
|
15
|
+
x64: "x64",
|
|
16
|
+
arm64: "arm64",
|
|
17
|
+
arm: "arm",
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
const platform = platformMap[os.platform()] || os.platform()
|
|
21
|
+
const arch = archMap[os.arch()] || os.arch()
|
|
22
|
+
return { platform, arch }
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
function name() {
|
|
26
|
+
const { platform, arch } = detect()
|
|
27
|
+
return `openwrk-${platform}-${arch}`
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
try {
|
|
31
|
+
const pkg = name()
|
|
32
|
+
require.resolve(`${pkg}/package.json`)
|
|
33
|
+
console.log(`openwrk: verified platform package: ${pkg}`)
|
|
34
|
+
} catch (error) {
|
|
35
|
+
const pkg = name()
|
|
36
|
+
console.error(
|
|
37
|
+
`openwrk: failed to locate platform binary package (${pkg}).\n` +
|
|
38
|
+
`Your package manager may have skipped optionalDependencies.\n` +
|
|
39
|
+
`Try installing it manually: npm i -g ${pkg}`,
|
|
40
|
+
)
|
|
41
|
+
process.exit(1)
|
|
42
|
+
}
|
package/LICENSE
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2026 Different AI
|
|
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
DELETED
|
@@ -1,164 +0,0 @@
|
|
|
1
|
-
# Openwrk
|
|
2
|
-
|
|
3
|
-
Headless host orchestrator for OpenCode + OpenWork server + Owpenbot. This is a CLI-first way to run host mode without the desktop UI.
|
|
4
|
-
|
|
5
|
-
## Quick start
|
|
6
|
-
|
|
7
|
-
```bash
|
|
8
|
-
npm install -g openwrk
|
|
9
|
-
openwrk start --workspace /path/to/workspace --approval auto
|
|
10
|
-
```
|
|
11
|
-
|
|
12
|
-
When run in a TTY, `openwrk` shows an interactive status dashboard with service health, ports, and
|
|
13
|
-
connection details. Use `openwrk serve` or `--no-tui` for log-only mode.
|
|
14
|
-
|
|
15
|
-
```bash
|
|
16
|
-
openwrk serve --workspace /path/to/workspace
|
|
17
|
-
```
|
|
18
|
-
|
|
19
|
-
`openwrk` ships as a compiled binary, so Bun is not required at runtime.
|
|
20
|
-
|
|
21
|
-
`openwrk` downloads and caches the `openwork-server`, `owpenbot`, and `opencode` sidecars on
|
|
22
|
-
first run using a SHA-256 manifest. Use `--sidecar-dir` or `OPENWRK_SIDECAR_DIR` to control the
|
|
23
|
-
cache location, and `--sidecar-base-url` / `--sidecar-manifest` to point at a custom host.
|
|
24
|
-
|
|
25
|
-
Use `--sidecar-source` to control where `openwork-server` and `owpenbot` are resolved
|
|
26
|
-
(`auto` | `bundled` | `downloaded` | `external`), and `--opencode-source` to control
|
|
27
|
-
`opencode` resolution. Set `OPENWRK_SIDECAR_SOURCE` / `OPENWRK_OPENCODE_SOURCE` to
|
|
28
|
-
apply the same policies via env vars.
|
|
29
|
-
|
|
30
|
-
By default the manifest is fetched from
|
|
31
|
-
`https://github.com/different-ai/openwork/releases/download/openwrk-v<openwrk-version>/openwrk-sidecars.json`.
|
|
32
|
-
|
|
33
|
-
Owpenbot is optional. If it exits, `openwrk` continues running unless you pass
|
|
34
|
-
`--owpenbot-required` or set `OPENWRK_OWPENBOT_REQUIRED=1`.
|
|
35
|
-
|
|
36
|
-
For development overrides only, set `OPENWRK_ALLOW_EXTERNAL=1` or pass `--allow-external` to use
|
|
37
|
-
locally installed `openwork-server` or `owpenbot` binaries.
|
|
38
|
-
|
|
39
|
-
Add `--verbose` (or `OPENWRK_VERBOSE=1`) to print extra diagnostics about resolved binaries.
|
|
40
|
-
|
|
41
|
-
Or from source:
|
|
42
|
-
|
|
43
|
-
```bash
|
|
44
|
-
pnpm --filter openwrk dev -- \
|
|
45
|
-
start --workspace /path/to/workspace --approval auto --allow-external
|
|
46
|
-
```
|
|
47
|
-
|
|
48
|
-
The command prints pairing details (OpenWork server URL + token, OpenCode URL + auth) so remote OpenWork clients can connect.
|
|
49
|
-
|
|
50
|
-
Use `--detach` to keep services running and exit the dashboard. The detach summary includes the
|
|
51
|
-
OpenWork URL, tokens, and the `opencode attach` command.
|
|
52
|
-
|
|
53
|
-
## Sandbox mode (Docker / Apple container)
|
|
54
|
-
|
|
55
|
-
`openwrk` can run the sidecars inside a Linux container boundary while still mounting your workspace
|
|
56
|
-
from the host.
|
|
57
|
-
|
|
58
|
-
```bash
|
|
59
|
-
# Auto-pick sandbox backend (prefers Apple container on supported Macs)
|
|
60
|
-
openwrk start --sandbox auto --workspace /path/to/workspace --approval auto
|
|
61
|
-
|
|
62
|
-
# Explicit backends
|
|
63
|
-
openwrk start --sandbox docker --workspace /path/to/workspace --approval auto
|
|
64
|
-
openwrk start --sandbox container --workspace /path/to/workspace --approval auto
|
|
65
|
-
```
|
|
66
|
-
|
|
67
|
-
Notes:
|
|
68
|
-
|
|
69
|
-
- `--sandbox auto` prefers Apple `container` on supported Macs (arm64), otherwise Docker.
|
|
70
|
-
- Docker backend requires `docker` on your PATH.
|
|
71
|
-
- Apple container backend requires the `container` CLI (https://github.com/apple/container).
|
|
72
|
-
- In sandbox mode, sidecars are resolved for a Linux target (and `--sidecar-source` / `--opencode-source`
|
|
73
|
-
are effectively `downloaded`).
|
|
74
|
-
- Custom `--*-bin` overrides are not supported in sandbox mode yet.
|
|
75
|
-
- Use `--sandbox-image` to pick an image with the toolchain you want available to OpenCode.
|
|
76
|
-
- Use `--sandbox-persist-dir` to control the host directory mounted at `/persist` inside the container.
|
|
77
|
-
|
|
78
|
-
### Extra mounts (allowlisted)
|
|
79
|
-
|
|
80
|
-
You can add explicit, validated mounts into `/workspace/extra/*`:
|
|
81
|
-
|
|
82
|
-
```bash
|
|
83
|
-
openwrk start --sandbox auto --sandbox-mount "/path/on/host:datasets:ro" --workspace /path/to/workspace
|
|
84
|
-
```
|
|
85
|
-
|
|
86
|
-
Additional mounts are blocked unless you create an allowlist at:
|
|
87
|
-
|
|
88
|
-
- `~/.config/openwork/sandbox-mount-allowlist.json`
|
|
89
|
-
|
|
90
|
-
Override with `OPENWRK_SANDBOX_MOUNT_ALLOWLIST`.
|
|
91
|
-
|
|
92
|
-
## Logging
|
|
93
|
-
|
|
94
|
-
`openwrk` emits a unified log stream from OpenCode, OpenWork server, and Owpenbot. Use JSON format for
|
|
95
|
-
structured, OpenTelemetry-friendly logs and a stable run id for correlation.
|
|
96
|
-
|
|
97
|
-
```bash
|
|
98
|
-
OPENWRK_LOG_FORMAT=json openwrk start --workspace /path/to/workspace
|
|
99
|
-
```
|
|
100
|
-
|
|
101
|
-
Use `--run-id` or `OPENWRK_RUN_ID` to supply your own correlation id.
|
|
102
|
-
|
|
103
|
-
OpenWork server logs every request with method, path, status, and duration. Disable this when running
|
|
104
|
-
`openwork-server` directly by setting `OPENWORK_LOG_REQUESTS=0` or passing `--no-log-requests`.
|
|
105
|
-
|
|
106
|
-
## Router daemon (multi-workspace)
|
|
107
|
-
|
|
108
|
-
The router keeps a single OpenCode process alive and switches workspaces JIT using the `directory` parameter.
|
|
109
|
-
|
|
110
|
-
```bash
|
|
111
|
-
openwrk daemon start
|
|
112
|
-
openwrk workspace add /path/to/workspace-a
|
|
113
|
-
openwrk workspace add /path/to/workspace-b
|
|
114
|
-
openwrk workspace list --json
|
|
115
|
-
openwrk workspace path <id>
|
|
116
|
-
openwrk instance dispose <id>
|
|
117
|
-
```
|
|
118
|
-
|
|
119
|
-
Use `OPENWRK_DATA_DIR` or `--data-dir` to isolate router state in tests.
|
|
120
|
-
|
|
121
|
-
## Pairing notes
|
|
122
|
-
|
|
123
|
-
- Use the **OpenWork connect URL** and **client token** to connect a remote OpenWork client.
|
|
124
|
-
- The OpenWork server advertises the **OpenCode connect URL** plus optional basic auth credentials to the client.
|
|
125
|
-
|
|
126
|
-
## Approvals (manual mode)
|
|
127
|
-
|
|
128
|
-
```bash
|
|
129
|
-
openwrk approvals list \
|
|
130
|
-
--openwork-url http://<host>:8787 \
|
|
131
|
-
--host-token <token>
|
|
132
|
-
|
|
133
|
-
openwrk approvals reply <id> --allow \
|
|
134
|
-
--openwork-url http://<host>:8787 \
|
|
135
|
-
--host-token <token>
|
|
136
|
-
```
|
|
137
|
-
|
|
138
|
-
## Health checks
|
|
139
|
-
|
|
140
|
-
```bash
|
|
141
|
-
openwrk status \
|
|
142
|
-
--openwork-url http://<host>:8787 \
|
|
143
|
-
--opencode-url http://<host>:4096
|
|
144
|
-
```
|
|
145
|
-
|
|
146
|
-
## Smoke checks
|
|
147
|
-
|
|
148
|
-
```bash
|
|
149
|
-
openwrk start --workspace /path/to/workspace --check --check-events
|
|
150
|
-
```
|
|
151
|
-
|
|
152
|
-
This starts the services, verifies health + SSE events, then exits cleanly.
|
|
153
|
-
|
|
154
|
-
## Local development
|
|
155
|
-
|
|
156
|
-
Point to source CLIs for fast iteration:
|
|
157
|
-
|
|
158
|
-
```bash
|
|
159
|
-
openwrk start \
|
|
160
|
-
--workspace /path/to/workspace \
|
|
161
|
-
--allow-external \
|
|
162
|
-
--openwork-server-bin packages/server/src/cli.ts \
|
|
163
|
-
--owpenbot-bin ../owpenbot/dist/cli.js
|
|
164
|
-
```
|
package/dist/openwrk
DELETED
|
Binary file
|