@clearlysh/beehaven 0.8.16
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 -0
- package/README.md +201 -0
- package/dist/__tests__/_cli-switch.js +105 -0
- package/dist/__tests__/agent-wrap-probe.js +136 -0
- package/dist/agent-attribution.js +192 -0
- package/dist/agent-identity-daemon.js +135 -0
- package/dist/agent-onboard.js +156 -0
- package/dist/agent-scope.js +79 -0
- package/dist/agent-sessions.js +370 -0
- package/dist/agent-state.js +482 -0
- package/dist/app-manifest.js +221 -0
- package/dist/app-signer.js +54 -0
- package/dist/app-signing.js +127 -0
- package/dist/audio-play.js +98 -0
- package/dist/avatar-protocol.js +25 -0
- package/dist/avatar-route.js +79 -0
- package/dist/bee/cloud-proxy.js +130 -0
- package/dist/blocked-actions.js +120 -0
- package/dist/build-channel.js +101 -0
- package/dist/buildings/daemon-workspace.js +475 -0
- package/dist/claude-bridge.js +310 -0
- package/dist/claude-credential-store.js +633 -0
- package/dist/clearly-sync.js +518 -0
- package/dist/clearly.js +616 -0
- package/dist/cli-state.js +334 -0
- package/dist/cli.js +6973 -0
- package/dist/commands/agent-skills.js +302 -0
- package/dist/commands/agent.js +1310 -0
- package/dist/commands/app.js +1123 -0
- package/dist/commands/auth.js +171 -0
- package/dist/commands/building-shell.js +392 -0
- package/dist/commands/canvas.js +932 -0
- package/dist/commands/claude.js +218 -0
- package/dist/commands/compliance.js +387 -0
- package/dist/commands/compose.js +507 -0
- package/dist/commands/composition.js +95 -0
- package/dist/commands/connect-session.js +409 -0
- package/dist/commands/conversations.js +160 -0
- package/dist/commands/costs.js +443 -0
- package/dist/commands/d1.js +253 -0
- package/dist/commands/daemon-cmd.js +162 -0
- package/dist/commands/deploy.js +164 -0
- package/dist/commands/design.js +617 -0
- package/dist/commands/dev-generate.js +125 -0
- package/dist/commands/dev.js +109 -0
- package/dist/commands/devices.js +135 -0
- package/dist/commands/explain-router.js +24 -0
- package/dist/commands/explain.js +882 -0
- package/dist/commands/explore.js +264 -0
- package/dist/commands/help.js +2418 -0
- package/dist/commands/init.js +408 -0
- package/dist/commands/install.js +129 -0
- package/dist/commands/library.js +229 -0
- package/dist/commands/marketplace.js +138 -0
- package/dist/commands/mcp-install.js +476 -0
- package/dist/commands/mention.js +257 -0
- package/dist/commands/omni.js +529 -0
- package/dist/commands/secrets.js +323 -0
- package/dist/commands/self-update.js +206 -0
- package/dist/commands/sheet.js +264 -0
- package/dist/commands/shell-output.js +309 -0
- package/dist/commands/shell.js +1048 -0
- package/dist/commands/shop.js +368 -0
- package/dist/commands/skills.js +311 -0
- package/dist/commands/slides.js +418 -0
- package/dist/commands/swarm.js +341 -0
- package/dist/commands/ticket.js +1301 -0
- package/dist/commands/tool.js +312 -0
- package/dist/commands/trash.js +106 -0
- package/dist/commands/treehouse.js +120 -0
- package/dist/commands/user.js +240 -0
- package/dist/commands/voice-tts.js +319 -0
- package/dist/commands/voice.js +166 -0
- package/dist/commands/watch-git.js +401 -0
- package/dist/commands/webhook.js +159 -0
- package/dist/commands/workspace.js +3354 -0
- package/dist/composition-repos.js +91 -0
- package/dist/daemon-avatar.js +130 -0
- package/dist/daemon-claude-code-auto-install.js +52 -0
- package/dist/daemon-client.js +363 -0
- package/dist/daemon-codex.js +349 -0
- package/dist/daemon-entry.js +101 -0
- package/dist/daemon-fetch-allowlist.js +194 -0
- package/dist/daemon-gemini.js +224 -0
- package/dist/daemon-mcp-clearly.js +353 -0
- package/dist/daemon-mcp-sandbox.js +127 -0
- package/dist/daemon-omni-company.js +338 -0
- package/dist/daemon-omni-hooks.js +375 -0
- package/dist/daemon-omni-identity.js +229 -0
- package/dist/daemon-omni-pipeline.js +251 -0
- package/dist/daemon-omni-policies.js +346 -0
- package/dist/daemon-omni-principal.js +580 -0
- package/dist/daemon-omni-tool-gate.js +116 -0
- package/dist/daemon-omni.js +1442 -0
- package/dist/daemon-path-transform.js +120 -0
- package/dist/daemon-write-sandbox.js +191 -0
- package/dist/daemon.js +4471 -0
- package/dist/dashboard.js +846 -0
- package/dist/dep-installer.js +286 -0
- package/dist/dev-mode.js +67 -0
- package/dist/doc-indexer.js +169 -0
- package/dist/e2e-crypto.js +94 -0
- package/dist/feature-flags.js +154 -0
- package/dist/file-browser.js +88 -0
- package/dist/first-party-hives.js +211 -0
- package/dist/folder-sync.js +226 -0
- package/dist/health.js +56 -0
- package/dist/ipc-auth.js +299 -0
- package/dist/ipc-client.js +495 -0
- package/dist/ipc-server.js +684 -0
- package/dist/keychain.js +224 -0
- package/dist/lib/admin-client.js +73 -0
- package/dist/lib/mobile-build-parser.js +156 -0
- package/dist/local-app-manager.js +660 -0
- package/dist/log-redaction.js +89 -0
- package/dist/logger.js +108 -0
- package/dist/manifest.js +143 -0
- package/dist/marketplace.js +793 -0
- package/dist/min-version-copy.js +51 -0
- package/dist/min-version.js +214 -0
- package/dist/public-surface.js +23 -0
- package/dist/relay-presets.js +89 -0
- package/dist/relay.js +2723 -0
- package/dist/repl.js +619 -0
- package/dist/setup-relay.js +363 -0
- package/dist/setup-service.js +536 -0
- package/dist/shared/bee-memory/index.js +6 -0
- package/dist/shared/bee-memory/types.js +682 -0
- package/dist/shared/claude-code/daemon-types.js +112 -0
- package/dist/shared/claude-code/index.js +2 -0
- package/dist/shared/claude-code/types.js +1 -0
- package/dist/shared/status/schema.js +133 -0
- package/dist/shell-session.js +198 -0
- package/dist/speak-lock.js +97 -0
- package/dist/spinner.js +57 -0
- package/dist/telemetry.js +166 -0
- package/dist/terminal/block-parser.js +207 -0
- package/dist/terminal/shell-integration.js +108 -0
- package/dist/transcript-tailer.js +215 -0
- package/dist/tts-qwen3.js +547 -0
- package/dist/types.js +4 -0
- package/dist/utm.js +38 -0
- package/dist/verb-surface.js +331 -0
- package/dist/version-utils.js +85 -0
- package/dist/watcher.js +207 -0
- package/package.json +88 -0
- package/python/qwen3_tts.py +230 -0
- package/scripts/stamp-build-channel.mjs +115 -0
- package/scripts/sync-installed.mjs +159 -0
- package/scripts/sync-skills.mjs +112 -0
- package/skills/README.md +24 -0
- package/skills/agent-doodle-space/SKILL.md +118 -0
- package/skills/agent-home/SKILL.md +98 -0
- package/skills/beehaven-cli/SKILL.md +144 -0
- package/skills/claude-shopper/README.md +90 -0
- package/skills/claude-shopper/SKILL.md +151 -0
- package/skills/clearly-agent/SKILL.md +183 -0
- package/skills/clearly-canvas/SKILL.md +222 -0
- package/skills/clearly-canvas/authoring.md +160 -0
- package/skills/clearly-canvas/communications.md +32 -0
- package/skills/clearly-canvas/composition-patterns.md +84 -0
- package/skills/clearly-canvas/example.mjs +78 -0
- package/skills/clearly-canvas/project-plans.md +156 -0
- package/skills/clearly-canvas/review.mjs +68 -0
- package/skills/clearly-workspace/SKILL.md +79 -0
- package/skills/clearly-workspace/survey.mjs +101 -0
- package/skills/codebase-map/SKILL.md +142 -0
- package/skills/design-craft/SKILL.md +300 -0
- package/skills/index.json +79 -0
- package/skills/layout-systems/SKILL.md +184 -0
- package/skills/pair-on-canvas/SKILL.md +92 -0
|
@@ -0,0 +1,264 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* beehaven explore — Inspect live Durable Object data.
|
|
3
|
+
*
|
|
4
|
+
* Subcommands:
|
|
5
|
+
* beehaven explore ls List active DO types/instances
|
|
6
|
+
* beehaven explore <cell-type> <cell-id> "SQL" Run SQL against a DO
|
|
7
|
+
* beehaven explore watch <cell-type> <cell-id> Live tail of deltas (WebSocket)
|
|
8
|
+
*/
|
|
9
|
+
import WebSocket from 'ws';
|
|
10
|
+
const DEFAULT_PORT = 8787;
|
|
11
|
+
function baseUrl(port) {
|
|
12
|
+
return `http://127.0.0.1:${port}`;
|
|
13
|
+
}
|
|
14
|
+
function wsUrl(port) {
|
|
15
|
+
return `ws://127.0.0.1:${port}`;
|
|
16
|
+
}
|
|
17
|
+
// ── Helpers ──────────────────────────────────────────────────────────────
|
|
18
|
+
async function fetchJSON(url) {
|
|
19
|
+
const res = await fetch(url);
|
|
20
|
+
if (!res.ok) {
|
|
21
|
+
const body = await res.text().catch(() => '');
|
|
22
|
+
throw new Error(`${res.status} ${res.statusText}${body ? ': ' + body : ''}`);
|
|
23
|
+
}
|
|
24
|
+
return res.json();
|
|
25
|
+
}
|
|
26
|
+
async function postJSON(url, body) {
|
|
27
|
+
const res = await fetch(url, {
|
|
28
|
+
method: 'POST',
|
|
29
|
+
headers: { 'Content-Type': 'application/json' },
|
|
30
|
+
body: JSON.stringify(body),
|
|
31
|
+
});
|
|
32
|
+
if (!res.ok) {
|
|
33
|
+
const text = await res.text().catch(() => '');
|
|
34
|
+
throw new Error(`${res.status} ${res.statusText}${text ? ': ' + text : ''}`);
|
|
35
|
+
}
|
|
36
|
+
return res.json();
|
|
37
|
+
}
|
|
38
|
+
function printTable(rows) {
|
|
39
|
+
if (rows.length === 0) {
|
|
40
|
+
console.log(' (no rows)');
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
const cols = Object.keys(rows[0]);
|
|
44
|
+
const widths = cols.map((col) => {
|
|
45
|
+
const max = rows.reduce((w, row) => {
|
|
46
|
+
const val = String(row[col] ?? '');
|
|
47
|
+
return Math.max(w, val.length);
|
|
48
|
+
}, col.length);
|
|
49
|
+
return Math.min(max, 40); // cap column width
|
|
50
|
+
});
|
|
51
|
+
// Header
|
|
52
|
+
const header = cols.map((c, i) => c.padEnd(widths[i])).join(' ');
|
|
53
|
+
const separator = widths.map((w) => '─'.repeat(w)).join('──');
|
|
54
|
+
console.log(` ${header}`);
|
|
55
|
+
console.log(` ${separator}`);
|
|
56
|
+
// Rows
|
|
57
|
+
for (const row of rows) {
|
|
58
|
+
const line = cols
|
|
59
|
+
.map((c, i) => {
|
|
60
|
+
const val = String(row[c] ?? '');
|
|
61
|
+
return val.length > widths[i] ? val.slice(0, widths[i] - 1) + '…' : val.padEnd(widths[i]);
|
|
62
|
+
})
|
|
63
|
+
.join(' ');
|
|
64
|
+
console.log(` ${line}`);
|
|
65
|
+
}
|
|
66
|
+
console.log(`\n ${rows.length} row(s)`);
|
|
67
|
+
}
|
|
68
|
+
// ── ls ───────────────────────────────────────────────────────────────────
|
|
69
|
+
async function listInstances(port, cellType) {
|
|
70
|
+
if (cellType) {
|
|
71
|
+
// List instances of a specific cell type
|
|
72
|
+
const url = `${baseUrl(port)}/cell/${cellType}/instances`;
|
|
73
|
+
try {
|
|
74
|
+
const data = await fetchJSON(url);
|
|
75
|
+
const instances = Array.isArray(data) ? data : (data.instances ?? []);
|
|
76
|
+
if (instances.length === 0) {
|
|
77
|
+
console.log(`\n No active instances for "${cellType}".\n`);
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
80
|
+
console.log(`\n Active instances of "${cellType}":\n`);
|
|
81
|
+
for (const id of instances) {
|
|
82
|
+
console.log(` ${id}`);
|
|
83
|
+
}
|
|
84
|
+
console.log(`\n ${instances.length} instance(s)\n`);
|
|
85
|
+
}
|
|
86
|
+
catch (err) {
|
|
87
|
+
console.error(`\n Failed to list instances: ${err.message}\n`);
|
|
88
|
+
process.exit(1);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
else {
|
|
92
|
+
// List all cell types — hit the health endpoint or /cell list
|
|
93
|
+
// Try listing known cell types from the dev server
|
|
94
|
+
const url = `${baseUrl(port)}/health`;
|
|
95
|
+
try {
|
|
96
|
+
const data = await fetchJSON(url);
|
|
97
|
+
const cells = data.cells ?? data.cellTypes ?? [];
|
|
98
|
+
if (cells.length === 0) {
|
|
99
|
+
console.log('\n No cell types registered. Is the dev server running?\n');
|
|
100
|
+
return;
|
|
101
|
+
}
|
|
102
|
+
console.log('\n Registered cell types:\n');
|
|
103
|
+
for (const cell of cells) {
|
|
104
|
+
// Try to get instance count
|
|
105
|
+
try {
|
|
106
|
+
const instances = await fetchJSON(`${baseUrl(port)}/cell/${cell}/instances`);
|
|
107
|
+
const count = Array.isArray(instances)
|
|
108
|
+
? instances.length
|
|
109
|
+
: (instances.instances?.length ?? '?');
|
|
110
|
+
console.log(` ${cell} (${count} instance${count !== 1 ? 's' : ''})`);
|
|
111
|
+
}
|
|
112
|
+
catch {
|
|
113
|
+
console.log(` ${cell}`);
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
console.log('');
|
|
117
|
+
}
|
|
118
|
+
catch (err) {
|
|
119
|
+
console.error(`\n Could not reach dev server at 127.0.0.1:${port}.`);
|
|
120
|
+
console.error(` Is "beehaven dev" running? (${err.message})\n`);
|
|
121
|
+
process.exit(1);
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
// ── SQL query ────────────────────────────────────────────────────────────
|
|
126
|
+
async function runQuery(port, cellType, cellId, sql) {
|
|
127
|
+
const url = `${baseUrl(port)}/cell/${cellType}/${cellId}/sql/raw`;
|
|
128
|
+
try {
|
|
129
|
+
const data = await postJSON(url, { sql });
|
|
130
|
+
const rows = data.rows ?? data.results ?? data;
|
|
131
|
+
if (!Array.isArray(rows)) {
|
|
132
|
+
console.log('\n Response:');
|
|
133
|
+
console.log(JSON.stringify(data, null, 2));
|
|
134
|
+
return;
|
|
135
|
+
}
|
|
136
|
+
console.log('');
|
|
137
|
+
printTable(rows);
|
|
138
|
+
console.log('');
|
|
139
|
+
}
|
|
140
|
+
catch (err) {
|
|
141
|
+
console.error(`\n Query failed: ${err.message}\n`);
|
|
142
|
+
process.exit(1);
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
// ── watch (live delta tail) ──────────────────────────────────────────────
|
|
146
|
+
function watchDeltas(port, cellType, cellId) {
|
|
147
|
+
const url = `${wsUrl(port)}/cell/${cellType}/${cellId}/ws`;
|
|
148
|
+
console.log(`\n Connecting to ${url}...`);
|
|
149
|
+
const ws = new WebSocket(url);
|
|
150
|
+
let connected = false;
|
|
151
|
+
ws.on('open', () => {
|
|
152
|
+
connected = true;
|
|
153
|
+
console.log(' Connected. Streaming deltas (Ctrl+C to stop):\n');
|
|
154
|
+
});
|
|
155
|
+
ws.on('message', (data) => {
|
|
156
|
+
const raw = data.toString();
|
|
157
|
+
try {
|
|
158
|
+
const msg = JSON.parse(raw);
|
|
159
|
+
const ts = new Date().toISOString().slice(11, 23);
|
|
160
|
+
if (msg.type === 'sql:delta') {
|
|
161
|
+
const { table, op, id, delta, row } = msg;
|
|
162
|
+
const preview = delta ? JSON.stringify(delta) : row ? JSON.stringify(row) : '';
|
|
163
|
+
console.log(` [${ts}] ${op.toUpperCase().padEnd(6)} ${table}/${id} ${truncate(preview, 80)}`);
|
|
164
|
+
}
|
|
165
|
+
else if (msg.type === 'sql:hydration') {
|
|
166
|
+
const tables = msg.tables
|
|
167
|
+
? Object.keys(msg.tables).map((t) => `${t}(${msg.tables[t]?.length ?? '?'})`)
|
|
168
|
+
: [];
|
|
169
|
+
console.log(` [${ts}] HYDRATE ${tables.join(', ')}`);
|
|
170
|
+
}
|
|
171
|
+
else if (msg.type === 'sql:batch') {
|
|
172
|
+
console.log(` [${ts}] BATCH ${msg.deltas?.length ?? '?'} delta(s)`);
|
|
173
|
+
}
|
|
174
|
+
else if (msg.type === 'presence:update' || msg.type === 'presence:leave') {
|
|
175
|
+
console.log(` [${ts}] ${msg.type.toUpperCase().padEnd(16)} ${msg.peerId ?? ''} ${JSON.stringify(msg.state ?? {})}`);
|
|
176
|
+
}
|
|
177
|
+
else {
|
|
178
|
+
// Generic message
|
|
179
|
+
console.log(` [${ts}] ${msg.type ?? 'MSG'} ${truncate(raw, 100)}`);
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
catch {
|
|
183
|
+
// Non-JSON message
|
|
184
|
+
const ts = new Date().toISOString().slice(11, 23);
|
|
185
|
+
console.log(` [${ts}] RAW ${truncate(raw, 100)}`);
|
|
186
|
+
}
|
|
187
|
+
});
|
|
188
|
+
ws.on('error', (err) => {
|
|
189
|
+
if (!connected) {
|
|
190
|
+
console.error(`\n Could not connect to ${url}`);
|
|
191
|
+
console.error(` Is "beehaven dev" running? (${err.message})\n`);
|
|
192
|
+
process.exit(1);
|
|
193
|
+
}
|
|
194
|
+
console.error(` [error] ${err.message}`);
|
|
195
|
+
});
|
|
196
|
+
ws.on('close', (code, reason) => {
|
|
197
|
+
console.log(`\n Connection closed (${code}${reason.length ? ': ' + reason.toString() : ''}).\n`);
|
|
198
|
+
process.exit(0);
|
|
199
|
+
});
|
|
200
|
+
// Clean shutdown
|
|
201
|
+
const cleanup = () => {
|
|
202
|
+
console.log('\n Disconnecting...');
|
|
203
|
+
ws.close();
|
|
204
|
+
setTimeout(() => process.exit(0), 500);
|
|
205
|
+
};
|
|
206
|
+
process.on('SIGINT', cleanup);
|
|
207
|
+
process.on('SIGTERM', cleanup);
|
|
208
|
+
}
|
|
209
|
+
function truncate(s, max) {
|
|
210
|
+
return s.length > max ? s.slice(0, max - 1) + '…' : s;
|
|
211
|
+
}
|
|
212
|
+
// ── Main entry point ─────────────────────────────────────────────────────
|
|
213
|
+
export async function explore(args, options = {}) {
|
|
214
|
+
const port = options.port || DEFAULT_PORT;
|
|
215
|
+
const sub = args[0];
|
|
216
|
+
if (!sub) {
|
|
217
|
+
printUsage();
|
|
218
|
+
return;
|
|
219
|
+
}
|
|
220
|
+
// beehaven explore ls [cell-type]
|
|
221
|
+
if (sub === 'ls') {
|
|
222
|
+
await listInstances(port, args[1]);
|
|
223
|
+
return;
|
|
224
|
+
}
|
|
225
|
+
// beehaven explore watch <cell-type> <cell-id>
|
|
226
|
+
if (sub === 'watch') {
|
|
227
|
+
const cellType = args[1];
|
|
228
|
+
const cellId = args[2];
|
|
229
|
+
if (!cellType || !cellId) {
|
|
230
|
+
console.error('\n Usage: beehaven explore watch <cell-type> <cell-id>\n');
|
|
231
|
+
process.exit(1);
|
|
232
|
+
}
|
|
233
|
+
watchDeltas(port, cellType, cellId);
|
|
234
|
+
return;
|
|
235
|
+
}
|
|
236
|
+
// beehaven explore <cell-type> <cell-id> "SQL query"
|
|
237
|
+
const cellType = args[0];
|
|
238
|
+
const cellId = args[1];
|
|
239
|
+
const sql = args[2];
|
|
240
|
+
if (!cellId || !sql) {
|
|
241
|
+
console.error('\n Usage: beehaven explore <cell-type> <cell-id> "SELECT * FROM table"\n');
|
|
242
|
+
process.exit(1);
|
|
243
|
+
}
|
|
244
|
+
await runQuery(port, cellType, cellId, sql);
|
|
245
|
+
}
|
|
246
|
+
function printUsage() {
|
|
247
|
+
console.log(`
|
|
248
|
+
beehaven explore — Inspect live Durable Object data
|
|
249
|
+
|
|
250
|
+
Usage:
|
|
251
|
+
beehaven explore ls [cell-type] List cell types or instances
|
|
252
|
+
beehaven explore <type> <id> "SQL" Run SQL against a DO
|
|
253
|
+
beehaven explore watch <type> <id> Live tail of deltas
|
|
254
|
+
|
|
255
|
+
Options:
|
|
256
|
+
--port <n> Dev server port (default: 8787)
|
|
257
|
+
|
|
258
|
+
Examples:
|
|
259
|
+
beehaven explore ls List all cell types
|
|
260
|
+
beehaven explore ls notes List instances of "notes"
|
|
261
|
+
beehaven explore notes room-1 "SELECT * FROM notes"
|
|
262
|
+
beehaven explore watch notes room-1 Stream deltas in real time
|
|
263
|
+
`);
|
|
264
|
+
}
|