@ravefox/space 0.2.0 → 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 -203
- package/README.md +89 -26
- 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 +28 -40
- package/NOTICE +0 -44
- 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,71 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* pi extension: Commonly's tools for a pi seat, over MCP.
|
|
3
|
-
*
|
|
4
|
-
* Loaded by adapters/pi.js with `-e`. Reads fd 3 — a pipe the adapter writes the
|
|
5
|
-
* JSON into and ends at spawn, never the environment (see takeServers) — a JSON
|
|
6
|
-
* list of `{ name, command: [...], env: {...} }` for stdio servers and
|
|
7
|
-
* `{ name, url, headers: {...} }` for Streamable HTTP ones — connects to each,
|
|
8
|
-
* asks it for its tools, and registers every one with pi under its own name, so
|
|
9
|
-
* a pi seat calls `commonly_post_message` exactly as a claude or codex seat
|
|
10
|
-
* does. Tool calls are forwarded as MCP `tools/call`; results come back as
|
|
11
|
-
* text. The client lives in pi-mcp-client.mjs (jest-tested); this file only
|
|
12
|
-
* binds it to pi's `registerTool`. `typebox` resolves through pi's extension
|
|
13
|
-
* loader, which aliases its bundled copy — it is not a CLI dependency.
|
|
14
|
-
*
|
|
15
|
-
* pi ships no MCP support of its own (its README: "No MCP. … build an
|
|
16
|
-
* extension that adds MCP support"), so this file is the whole transport story
|
|
17
|
-
* for a pi seat: a server that is not reachable from here is not reachable.
|
|
18
|
-
*/
|
|
19
|
-
|
|
20
|
-
import { Type } from 'typebox';
|
|
21
|
-
import {
|
|
22
|
-
connectMcp, registrableTools, removeSpawnCredential, takeServers, toPiResult,
|
|
23
|
-
} from './pi-mcp-client.mjs';
|
|
24
|
-
|
|
25
|
-
export default async function commonlyMcpBridge(pi) {
|
|
26
|
-
// Read once and consume: the read drains the pipe, so the list (which carries
|
|
27
|
-
// the seat token) does not survive anywhere in this process that a child could
|
|
28
|
-
// reach — not the environment, which is why it does not arrive that way.
|
|
29
|
-
const servers = takeServers();
|
|
30
|
-
// The adapter loads this extension only when it has a list to hand over, so an
|
|
31
|
-
// empty read means the channel itself failed. Say so: the symptom otherwise is
|
|
32
|
-
// a seat that silently has no commonly_* tools at all.
|
|
33
|
-
if (!servers.length) {
|
|
34
|
-
process.stderr.write('[commonly-pi-bridge] no server list on fd 3 — this seat has no commonly_* tools\n');
|
|
35
|
-
}
|
|
36
|
-
const clients = [];
|
|
37
|
-
// Armed before the loop: a failed credential delete below exits the process,
|
|
38
|
-
// and that must not leave a started server running.
|
|
39
|
-
const shutdown = () => { for (const client of clients) client.close(); };
|
|
40
|
-
process.on('exit', shutdown);
|
|
41
|
-
if (typeof pi.on === 'function') pi.on('session_shutdown', shutdown);
|
|
42
|
-
try {
|
|
43
|
-
for (const server of servers) {
|
|
44
|
-
const client = connectMcp(server);
|
|
45
|
-
clients.push(client);
|
|
46
|
-
try {
|
|
47
|
-
await client.initialize();
|
|
48
|
-
// A public seat's entries name the tools it is not offered.
|
|
49
|
-
const tools = registrableTools(await client.listTools(), server);
|
|
50
|
-
for (const tool of tools) {
|
|
51
|
-
pi.registerTool({
|
|
52
|
-
name: tool.name,
|
|
53
|
-
label: tool.name,
|
|
54
|
-
description: tool.description || tool.name,
|
|
55
|
-
// The server's JSON schema, passed through: pi validates against it as-is.
|
|
56
|
-
parameters: Type.Unsafe(tool.inputSchema || { type: 'object', properties: {} }),
|
|
57
|
-
async execute(_toolCallId, params) {
|
|
58
|
-
return toPiResult(await client.callTool(tool.name, params));
|
|
59
|
-
},
|
|
60
|
-
});
|
|
61
|
-
}
|
|
62
|
-
} catch (error) {
|
|
63
|
-
process.stderr.write(`[commonly-pi-bridge] ${server.name}: ${error.message}\n`);
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
} finally {
|
|
67
|
-
// Every server has read the credential by now, and pi has not created the
|
|
68
|
-
// session: it awaits this factory first. See removeSpawnCredential.
|
|
69
|
-
removeSpawnCredential(servers);
|
|
70
|
-
}
|
|
71
|
-
}
|