@ravefox/space 0.2.1 → 0.4.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 +104 -31
- package/bin/space.js +113 -0
- package/lib/agents.js +181 -0
- package/lib/boardTools.js +89 -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 +39 -0
- package/lib/runtime.js +253 -0
- package/lib/store.js +96 -0
- package/lib/tools.js +93 -0
- package/lib/workspaceSandbox.js +77 -0
- package/lib/workspaceTools.js +160 -0
- package/lib/workspaceWorker.js +17 -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
package/src/lib/daemon-store.js
DELETED
|
@@ -1,119 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Local daemon credential storage.
|
|
3
|
-
*
|
|
4
|
-
* A daemon is one machine-level supervisor, not an agent token file. Keep its
|
|
5
|
-
* credential in its own 0700 directory and enforce 0600 on every write; the
|
|
6
|
-
* bearer must never be printed or placed in the ordinary CLI config file.
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
import {
|
|
10
|
-
chmodSync,
|
|
11
|
-
existsSync,
|
|
12
|
-
mkdirSync,
|
|
13
|
-
readFileSync,
|
|
14
|
-
renameSync,
|
|
15
|
-
statSync,
|
|
16
|
-
unlinkSync,
|
|
17
|
-
writeFileSync,
|
|
18
|
-
} from 'fs';
|
|
19
|
-
import { homedir } from 'os';
|
|
20
|
-
import { join } from 'path';
|
|
21
|
-
|
|
22
|
-
const daemonDir = () => join(homedir(), '.commonly', 'daemon');
|
|
23
|
-
export const daemonRecordPath = () => join(daemonDir(), 'machine.json');
|
|
24
|
-
export const daemonStopPath = () => join(daemonDir(), 'stopped.json');
|
|
25
|
-
|
|
26
|
-
// A terminal machine-key verdict survives launchd's one unavoidable restart.
|
|
27
|
-
// It contains no bearer; registration clears it only after the new key is safe.
|
|
28
|
-
export const loadDaemonStop = (record = { machineDbId: 'unregistered' }) => {
|
|
29
|
-
const path = daemonStopPath();
|
|
30
|
-
if (!existsSync(path)) return null;
|
|
31
|
-
const value = JSON.parse(readFileSync(path, 'utf8'));
|
|
32
|
-
return value.machineDbId === record.machineDbId ? value : null;
|
|
33
|
-
};
|
|
34
|
-
|
|
35
|
-
export const saveDaemonStop = (record, exitCode) => {
|
|
36
|
-
const dir = daemonDir();
|
|
37
|
-
if (!existsSync(dir)) mkdirSync(dir, { recursive: true, mode: 0o700 });
|
|
38
|
-
chmodSync(dir, 0o700);
|
|
39
|
-
const path = daemonStopPath();
|
|
40
|
-
const tmp = `${path}.${process.pid}.tmp`;
|
|
41
|
-
try {
|
|
42
|
-
writeFileSync(tmp, `${JSON.stringify({ machineDbId: record.machineDbId, exitCode })}\n`, { mode: 0o600, flag: 'wx' });
|
|
43
|
-
renameSync(tmp, path);
|
|
44
|
-
} catch (error) {
|
|
45
|
-
if (existsSync(tmp)) unlinkSync(tmp);
|
|
46
|
-
throw error;
|
|
47
|
-
}
|
|
48
|
-
};
|
|
49
|
-
|
|
50
|
-
export const clearDaemonStop = () => {
|
|
51
|
-
if (existsSync(daemonStopPath())) unlinkSync(daemonStopPath());
|
|
52
|
-
};
|
|
53
|
-
|
|
54
|
-
const validateRecord = (record) => {
|
|
55
|
-
if (!record
|
|
56
|
-
|| typeof record.machineDbId !== 'string'
|
|
57
|
-
|| typeof record.machineId !== 'string'
|
|
58
|
-
|| typeof record.machineName !== 'string'
|
|
59
|
-
|| typeof record.instanceUrl !== 'string'
|
|
60
|
-
|| typeof record.daemonToken !== 'string'
|
|
61
|
-
|| !record.daemonToken.startsWith('cm_daemon_')) {
|
|
62
|
-
throw new Error('Daemon credential file is invalid. Revoke the machine before registering again.');
|
|
63
|
-
}
|
|
64
|
-
return record;
|
|
65
|
-
};
|
|
66
|
-
|
|
67
|
-
export const loadDaemonRecord = ({ platform = process.platform } = {}) => {
|
|
68
|
-
const path = daemonRecordPath();
|
|
69
|
-
const dir = daemonDir();
|
|
70
|
-
if (!existsSync(path)) return null;
|
|
71
|
-
// D245: Windows has no POSIX mode bits. Node reports every file there as
|
|
72
|
-
// 0o666 (0o444 when read-only) whatever its ACL, so this check refused every
|
|
73
|
-
// registration on Windows. Access there is the ACL's job; the record sits in
|
|
74
|
-
// the user's profile, which only that user (and administrators) can read.
|
|
75
|
-
const posix = platform !== 'win32';
|
|
76
|
-
if (posix && (statSync(dir).mode & 0o077) !== 0) {
|
|
77
|
-
throw new Error(`Daemon credential directory permissions are insecure at ${dir}. Set them to 0700 before running the daemon.`);
|
|
78
|
-
}
|
|
79
|
-
if (posix && (statSync(path).mode & 0o077) !== 0) {
|
|
80
|
-
throw new Error(`Daemon credential file permissions are insecure at ${path}. Set them to 0600 before running the daemon.`);
|
|
81
|
-
}
|
|
82
|
-
try {
|
|
83
|
-
return validateRecord(JSON.parse(readFileSync(path, 'utf8')));
|
|
84
|
-
} catch (error) {
|
|
85
|
-
if (error instanceof Error && error.message.startsWith('Daemon credential file')) {
|
|
86
|
-
throw new Error(`${error.message} (${path})`);
|
|
87
|
-
}
|
|
88
|
-
throw new Error(`Daemon credential file is unreadable at ${path}. Revoke the machine before registering again.`);
|
|
89
|
-
}
|
|
90
|
-
};
|
|
91
|
-
|
|
92
|
-
export const saveDaemonRecord = (record) => {
|
|
93
|
-
const safeRecord = validateRecord(record);
|
|
94
|
-
const dir = daemonDir();
|
|
95
|
-
if (!existsSync(dir)) mkdirSync(dir, { recursive: true, mode: 0o700 });
|
|
96
|
-
chmodSync(dir, 0o700);
|
|
97
|
-
|
|
98
|
-
const path = daemonRecordPath();
|
|
99
|
-
const temporaryPath = `${path}.${process.pid}.tmp`;
|
|
100
|
-
try {
|
|
101
|
-
writeFileSync(temporaryPath, `${JSON.stringify(safeRecord, null, 2)}\n`, { mode: 0o600 });
|
|
102
|
-
chmodSync(temporaryPath, 0o600);
|
|
103
|
-
renameSync(temporaryPath, path);
|
|
104
|
-
chmodSync(path, 0o600);
|
|
105
|
-
} catch (error) {
|
|
106
|
-
if (existsSync(temporaryPath)) unlinkSync(temporaryPath);
|
|
107
|
-
throw error;
|
|
108
|
-
}
|
|
109
|
-
};
|
|
110
|
-
|
|
111
|
-
// Call this only after the owner has revoked the matching server-side machine.
|
|
112
|
-
// Local deletion first would strand a live credential with no CLI path to
|
|
113
|
-
// revoke it, which is exactly the failure this command exists to prevent.
|
|
114
|
-
export const removeDaemonRecord = () => {
|
|
115
|
-
const path = daemonRecordPath();
|
|
116
|
-
if (!existsSync(path)) return false;
|
|
117
|
-
unlinkSync(path);
|
|
118
|
-
return true;
|
|
119
|
-
};
|