@ravefox/space 0.2.1 → 0.3.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 +21 -205
- package/README.md +80 -31
- package/bin/space.js +106 -0
- package/lib/agents.js +119 -0
- package/lib/credentials.js +95 -0
- package/lib/daemon.js +294 -0
- package/lib/harness.js +166 -0
- package/lib/http.js +101 -0
- package/lib/login.js +68 -0
- package/lib/mcp.js +34 -0
- package/lib/runtime.js +241 -0
- package/lib/store.js +96 -0
- package/lib/tools.js +93 -0
- package/package.json +27 -46
- package/NOTICE +0 -55
- package/assets/webhook-sdk/python/bot.py +0 -63
- package/assets/webhook-sdk/python/commonly.py +0 -232
- package/node_modules/@commonlyai/seats/README.md +0 -25
- package/node_modules/@commonlyai/seats/package.json +0 -22
- package/node_modules/@commonlyai/seats/src/adapters/hermes.js +0 -264
- package/node_modules/@commonlyai/seats/src/adapters/stub.js +0 -24
- package/node_modules/@commonlyai/seats/src/contract.js +0 -48
- package/node_modules/@commonlyai/seats/src/failures.js +0 -44
- package/node_modules/@commonlyai/seats/src/harness-plan.js +0 -329
- package/node_modules/@commonlyai/seats/src/index.js +0 -22
- package/node_modules/@commonlyai/seats/src/process-group.js +0 -269
- package/node_modules/@commonlyai/seats/src/record/format.js +0 -737
- package/node_modules/@commonlyai/seats/src/record/otel.js +0 -238
- package/node_modules/@commonlyai/seats/src/runtime-observation.js +0 -29
- package/node_modules/@commonlyai/seats/src/seat-model.js +0 -17
- package/node_modules/@commonlyai/seats/src/supervisor.js +0 -308
- package/node_modules/@commonlyai/seats/src/trace/events.js +0 -46
- package/node_modules/@commonlyai/seats/src/trace/store.js +0 -276
- package/node_modules/@commonlyai/seats/src/turn-processes.js +0 -226
- package/node_modules/@commonlyai/seats/src/upstream-refusal.js +0 -418
- package/node_modules/@commonlyai/seats/src/valet/env.js +0 -201
- package/node_modules/@commonlyai/seats/src/valet/grant.js +0 -123
- package/node_modules/@commonlyai/seats/src/valet/permissions.js +0 -213
- package/node_modules/@commonlyai/seats/src/wire/provider-proxy.js +0 -529
- package/skills/commonly/SKILL.md +0 -233
- package/src/commands/agent.js +0 -6334
- package/src/commands/daemon.js +0 -933
- package/src/commands/dev.js +0 -153
- package/src/commands/doctor.js +0 -141
- package/src/commands/inbox.js +0 -330
- package/src/commands/login.js +0 -194
- package/src/commands/mcp.js +0 -56
- package/src/commands/pod.js +0 -120
- package/src/commands/task.js +0 -279
- package/src/commands/verify.js +0 -48
- package/src/index.js +0 -99
- package/src/lib/adapter-login.js +0 -76
- package/src/lib/adapters/broker-bridge-entry.js +0 -76
- package/src/lib/adapters/claude.js +0 -2207
- package/src/lib/adapters/codex-broker-bridge.mjs +0 -298
- package/src/lib/adapters/codex.js +0 -1898
- package/src/lib/adapters/dsh.js +0 -513
- package/src/lib/adapters/goose.js +0 -510
- package/src/lib/adapters/hermes.js +0 -18
- package/src/lib/adapters/index.js +0 -68
- package/src/lib/adapters/opencode.js +0 -1681
- package/src/lib/adapters/pi-commonly-mcp.mjs +0 -71
- package/src/lib/adapters/pi-mcp-client.mjs +0 -617
- package/src/lib/adapters/pi-shell-env.mjs +0 -41
- package/src/lib/adapters/pi.js +0 -1025
- package/src/lib/adapters/qwen.js +0 -523
- package/src/lib/adapters/seat-model.js +0 -8
- package/src/lib/adapters/stub.js +0 -1
- package/src/lib/adapters/tested-version.js +0 -106
- package/src/lib/api.js +0 -205
- package/src/lib/claim-outcome.js +0 -128
- package/src/lib/claimed-work-gate.js +0 -73
- package/src/lib/cli-hint.js +0 -33
- package/src/lib/commit-attribution.js +0 -391
- package/src/lib/config.js +0 -155
- package/src/lib/content-refusal.js +0 -94
- package/src/lib/credential-file.js +0 -208
- package/src/lib/daemon-agent-states.js +0 -95
- package/src/lib/daemon-hint.js +0 -18
- package/src/lib/daemon-logs.js +0 -43
- package/src/lib/daemon-service-windows.js +0 -263
- package/src/lib/daemon-service.js +0 -486
- package/src/lib/daemon-state.js +0 -84
- package/src/lib/daemon-store.js +0 -119
- package/src/lib/daemon-supervisor.js +0 -629
- package/src/lib/daemon-watch.js +0 -115
- package/src/lib/declared-mcp-guard.js +0 -284
- package/src/lib/default-environment.js +0 -207
- package/src/lib/device-login.js +0 -126
- package/src/lib/digest-frame.js +0 -151
- package/src/lib/doctor.js +0 -291
- package/src/lib/egress-proxy.js +0 -160
- package/src/lib/enforcement.js +0 -946
- package/src/lib/environment.js +0 -681
- package/src/lib/first-output-watchdog.js +0 -191
- package/src/lib/git-readonly-server.js +0 -138
- package/src/lib/git-readonly.js +0 -463
- package/src/lib/git-remote-commonly.mjs +0 -100
- package/src/lib/grant-broker-guard.js +0 -345
- package/src/lib/hooks-config.js +0 -238
- package/src/lib/host-gh-broker.js +0 -152
- package/src/lib/host-gh-shim.mjs +0 -98
- package/src/lib/inbox.js +0 -483
- package/src/lib/instance-proxy.js +0 -76
- package/src/lib/machine-host.js +0 -29
- package/src/lib/mcp-credential-delivery.js +0 -121
- package/src/lib/mcp-first-run.js +0 -50
- package/src/lib/mcp-home.js +0 -644
- package/src/lib/mcp-ready.js +0 -68
- package/src/lib/mcp-server-version.js +0 -123
- package/src/lib/mcp-token.js +0 -36
- package/src/lib/mcp-warm-child.mjs +0 -412
- package/src/lib/memory-bridge.js +0 -191
- package/src/lib/memory-import.js +0 -156
- package/src/lib/missing-harness.js +0 -31
- package/src/lib/model-unavailable.js +0 -154
- package/src/lib/native-runtime-inventory.js +0 -40
- package/src/lib/outsider-grant-mcp.js +0 -82
- package/src/lib/own-key-launch.js +0 -42
- package/src/lib/pod-catch-up.js +0 -55
- package/src/lib/pod-focus.js +0 -224
- package/src/lib/pod-tail.js +0 -68
- package/src/lib/poll-liveness.js +0 -103
- package/src/lib/poll-retry.js +0 -81
- package/src/lib/poller.js +0 -200
- package/src/lib/provider-proxy.js +0 -42
- package/src/lib/public-seat-mcp-flag.js +0 -36
- package/src/lib/public-tool-error.js +0 -60
- package/src/lib/public-withheld-tools.js +0 -48
- package/src/lib/reply-receipt.js +0 -55
- package/src/lib/resolve-on-path.js +0 -22
- package/src/lib/runtime-inventory.js +0 -56
- package/src/lib/runtime-observation.js +0 -37
- package/src/lib/sandbox/bwrap.js +0 -275
- package/src/lib/sandbox/codex-perimeter.js +0 -16
- package/src/lib/sandbox/host-check.js +0 -268
- package/src/lib/sandbox/mode.js +0 -49
- package/src/lib/sandbox/opencode-loopback.mjs +0 -68
- package/src/lib/sandbox/seatbelt.js +0 -684
- package/src/lib/sandbox/turn-dir.js +0 -56
- package/src/lib/sandbox/windows-unsandboxed.js +0 -183
- package/src/lib/sandbox/workspace-git-config.js +0 -243
- package/src/lib/sandbox/workspace-pin.js +0 -158
- package/src/lib/seat-runtime-controls.js +0 -61
- package/src/lib/seat-stop.js +0 -97
- package/src/lib/server-skills.js +0 -32
- package/src/lib/session-recycle.js +0 -219
- package/src/lib/session-store.js +0 -215
- package/src/lib/skill-prompt.js +0 -74
- package/src/lib/skills-import.js +0 -113
- package/src/lib/spawn-credential.js +0 -402
- package/src/lib/spawn-retry.js +0 -311
- package/src/lib/stable-install.js +0 -176
- package/src/lib/supervised-turn.js +0 -352
- package/src/lib/task.js +0 -235
- package/src/lib/turn-failure-notice.js +0 -177
- package/src/lib/unconfined-seat-guard.js +0 -94
- package/src/lib/update-check.js +0 -192
- package/src/lib/upstream-refusal.js +0 -1
- package/src/lib/webhook-server.js +0 -109
- package/src/lib/windows-command.js +0 -393
- package/src/lib/workspace-git.js +0 -87
- package/src/lib/workspace-trust.js +0 -162
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Runs inside OpenCode's private bwrap network namespace. The only route to
|
|
3
|
-
* the host is through the two fixed-origin Unix sockets bound for this spawn.
|
|
4
|
-
*/
|
|
5
|
-
import { spawn, spawnSync } from 'child_process';
|
|
6
|
-
import { existsSync } from 'fs';
|
|
7
|
-
import { createServer, connect } from 'net';
|
|
8
|
-
|
|
9
|
-
const [socketPath, portText, instanceSocketPath, instancePortText, binary, ...args] = process.argv.slice(2);
|
|
10
|
-
const port = Number(portText);
|
|
11
|
-
const instancePort = Number(instancePortText);
|
|
12
|
-
if (!socketPath || !instanceSocketPath || !binary
|
|
13
|
-
|| !Number.isInteger(port) || port < 1 || port > 65535
|
|
14
|
-
|| !Number.isInteger(instancePort) || instancePort < 1 || instancePort > 65535
|
|
15
|
-
|| port === instancePort) {
|
|
16
|
-
throw new Error('OpenCode loopback bridge requires distinct provider and instance ports');
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
const ip = ['/usr/sbin/ip', '/sbin/ip', '/usr/bin/ip', '/bin/ip'].find(existsSync);
|
|
20
|
-
if (!ip) throw new Error('OpenCode isolated loopback requires iproute2');
|
|
21
|
-
const up = spawnSync(ip, ['link', 'set', 'lo', 'up'], { encoding: 'utf8' });
|
|
22
|
-
if (up.error || up.status !== 0) {
|
|
23
|
-
throw new Error(`OpenCode isolated loopback could not start: ${up.error?.message || up.stderr?.trim() || up.status}`);
|
|
24
|
-
}
|
|
25
|
-
const setpriv = ['/usr/bin/setpriv', '/bin/setpriv'].find(existsSync);
|
|
26
|
-
if (!setpriv) throw new Error('OpenCode isolated loopback requires setpriv');
|
|
27
|
-
|
|
28
|
-
const sockets = new Set();
|
|
29
|
-
const makeBridge = (path) => createServer((local) => {
|
|
30
|
-
const proxy = connect(path);
|
|
31
|
-
sockets.add(local);
|
|
32
|
-
sockets.add(proxy);
|
|
33
|
-
local.on('close', () => sockets.delete(local));
|
|
34
|
-
proxy.on('close', () => sockets.delete(proxy));
|
|
35
|
-
local.on('error', () => proxy.destroy());
|
|
36
|
-
proxy.on('error', () => local.destroy());
|
|
37
|
-
local.pipe(proxy).pipe(local);
|
|
38
|
-
});
|
|
39
|
-
const providerBridge = makeBridge(socketPath);
|
|
40
|
-
const instanceBridge = instanceSocketPath === '-' ? null : makeBridge(instanceSocketPath);
|
|
41
|
-
providerBridge.on('error', (err) => { throw err; });
|
|
42
|
-
instanceBridge?.on('error', (err) => { throw err; });
|
|
43
|
-
providerBridge.listen(port, '127.0.0.1', () => {
|
|
44
|
-
const startChild = () => {
|
|
45
|
-
// Only this bridge needs CAP_NET_ADMIN to raise lo and CAP_SETPCAP to drop
|
|
46
|
-
// both capabilities before starting the model process.
|
|
47
|
-
const child = spawn(setpriv, [
|
|
48
|
-
'--bounding-set=-net_admin,-setpcap',
|
|
49
|
-
'--inh-caps=-net_admin,-setpcap',
|
|
50
|
-
'--ambient-caps=-net_admin,-setpcap',
|
|
51
|
-
binary, ...args,
|
|
52
|
-
], { stdio: 'inherit', env: process.env });
|
|
53
|
-
const forward = (signal) => { if (!child.killed) child.kill(signal); };
|
|
54
|
-
process.on('SIGTERM', () => forward('SIGTERM'));
|
|
55
|
-
process.on('SIGINT', () => forward('SIGINT'));
|
|
56
|
-
child.on('error', (err) => {
|
|
57
|
-
process.stderr.write(`${err.message}\n`);
|
|
58
|
-
});
|
|
59
|
-
child.on('close', (code, signal) => {
|
|
60
|
-
for (const socket of sockets) socket.destroy();
|
|
61
|
-
providerBridge.close();
|
|
62
|
-
if (instanceBridge) instanceBridge.close(() => { process.exitCode = code ?? (signal === 'SIGTERM' ? 143 : 1); });
|
|
63
|
-
else process.exitCode = code ?? (signal === 'SIGTERM' ? 143 : 1);
|
|
64
|
-
});
|
|
65
|
-
};
|
|
66
|
-
if (instanceBridge) instanceBridge.listen(instancePort, '127.0.0.1', startChild);
|
|
67
|
-
else startChild();
|
|
68
|
-
});
|