botmux 3.5.0 → 3.5.2
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/dist/adapters/backend/sandbox.d.ts +99 -279
- package/dist/adapters/backend/sandbox.d.ts.map +1 -1
- package/dist/adapters/backend/sandbox.js +424 -826
- package/dist/adapters/backend/sandbox.js.map +1 -1
- package/dist/adapters/cli/codex.d.ts.map +1 -1
- package/dist/adapters/cli/codex.js +4 -0
- package/dist/adapters/cli/codex.js.map +1 -1
- package/dist/adapters/cli/fs-policy.d.ts +244 -0
- package/dist/adapters/cli/fs-policy.d.ts.map +1 -0
- package/dist/adapters/cli/fs-policy.js +539 -0
- package/dist/adapters/cli/fs-policy.js.map +1 -0
- package/dist/adapters/cli/read-isolation.d.ts +14 -200
- package/dist/adapters/cli/read-isolation.d.ts.map +1 -1
- package/dist/adapters/cli/read-isolation.js +18 -477
- package/dist/adapters/cli/read-isolation.js.map +1 -1
- package/dist/bot-registry.d.ts +26 -23
- package/dist/bot-registry.d.ts.map +1 -1
- package/dist/bot-registry.js +16 -0
- package/dist/bot-registry.js.map +1 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +25 -18
- package/dist/cli.js.map +1 -1
- package/dist/core/command-handler.d.ts.map +1 -1
- package/dist/core/command-handler.js +16 -58
- package/dist/core/command-handler.js.map +1 -1
- package/dist/core/dashboard-ipc-server.d.ts.map +1 -1
- package/dist/core/dashboard-ipc-server.js +26 -27
- package/dist/core/dashboard-ipc-server.js.map +1 -1
- package/dist/core/passthrough-commands.d.ts.map +1 -1
- package/dist/core/passthrough-commands.js +1 -1
- package/dist/core/passthrough-commands.js.map +1 -1
- package/dist/core/plugins/mcp/gateway-installer.d.ts.map +1 -1
- package/dist/core/plugins/mcp/gateway-installer.js +14 -2
- package/dist/core/plugins/mcp/gateway-installer.js.map +1 -1
- package/dist/core/session-manager.d.ts.map +1 -1
- package/dist/core/session-manager.js +90 -60
- package/dist/core/session-manager.js.map +1 -1
- package/dist/core/worker-pool.d.ts +24 -0
- package/dist/core/worker-pool.d.ts.map +1 -1
- package/dist/core/worker-pool.js +50 -6
- package/dist/core/worker-pool.js.map +1 -1
- package/dist/daemon.d.ts.map +1 -1
- package/dist/daemon.js +6 -0
- package/dist/daemon.js.map +1 -1
- package/dist/dashboard/bot-payload.d.ts +5 -0
- package/dist/dashboard/bot-payload.d.ts.map +1 -1
- package/dist/dashboard/bot-payload.js +7 -0
- package/dist/dashboard/bot-payload.js.map +1 -1
- package/dist/dashboard/web/bot-defaults-page.d.ts +16 -0
- package/dist/dashboard/web/bot-defaults-page.d.ts.map +1 -1
- package/dist/dashboard/web/bot-defaults-page.js +225 -6
- package/dist/dashboard/web/bot-defaults-page.js.map +1 -1
- package/dist/dashboard/web/bot-defaults.d.ts +7 -0
- package/dist/dashboard/web/bot-defaults.d.ts.map +1 -1
- package/dist/dashboard/web/bot-defaults.js.map +1 -1
- package/dist/dashboard/web/i18n.d.ts.map +1 -1
- package/dist/dashboard/web/i18n.js +38 -22
- package/dist/dashboard/web/i18n.js.map +1 -1
- package/dist/dashboard/web/sessions-page.d.ts.map +1 -1
- package/dist/dashboard/web/sessions-page.js +1 -44
- package/dist/dashboard/web/sessions-page.js.map +1 -1
- package/dist/dashboard-web/app.js +1 -1
- package/dist/dashboard-web/chunks/bot-defaults-page-AUKV7P4L.js +10 -0
- package/dist/dashboard-web/chunks/{chunk-QCPPKCX3.js → chunk-KPQAUX7V.js} +1 -1
- package/dist/dashboard-web/chunks/{chunk-WXPMNEYV.js → chunk-NRL6CVAS.js} +1 -1
- package/dist/dashboard-web/chunks/{chunk-EJDYUINZ.js → chunk-R7IAKAYX.js} +1 -1
- package/dist/dashboard-web/chunks/{chunk-H7P5UV4W.js → chunk-X2L65IOM.js} +6 -6
- package/dist/dashboard-web/chunks/{connectors-page-IR54AOAI.js → connectors-page-HDQFEXZI.js} +1 -1
- package/dist/dashboard-web/chunks/{groups-page-3P4TLUMF.js → groups-page-6DKXBYOM.js} +1 -1
- package/dist/dashboard-web/chunks/{insights-page-TDCZV56A.js → insights-page-NWARTJ6J.js} +1 -1
- package/dist/dashboard-web/chunks/{monitor-room-QWCWL3SX.js → monitor-room-AGX3XRJX.js} +1 -1
- package/dist/dashboard-web/chunks/{monitoring-page-IOWFSNVC.js → monitoring-page-GGGIWN4C.js} +1 -1
- package/dist/dashboard-web/chunks/{office-page-5AUPEHZP.js → office-page-6SIVKSK3.js} +1 -1
- package/dist/dashboard-web/chunks/{overview-page-QJMI6NLW.js → overview-page-FVR3NKAF.js} +1 -1
- package/dist/dashboard-web/chunks/{roles-page-WJVB52ET.js → roles-page-WE2YB7KN.js} +1 -1
- package/dist/dashboard-web/chunks/{schedules-page-RVRWHP4V.js → schedules-page-TB3I24XN.js} +1 -1
- package/dist/dashboard-web/chunks/sessions-page-KOOOASIL.js +2 -0
- package/dist/dashboard-web/chunks/{settings-page-TNZEPC7V.js → settings-page-IEBR7TGN.js} +1 -1
- package/dist/dashboard-web/chunks/{skills-page-7YT5TIX5.js → skills-page-3QAT2IWD.js} +1 -1
- package/dist/dashboard-web/chunks/{team-federation-page-NJZKTU7A.js → team-federation-page-K4VVAVAK.js} +1 -1
- package/dist/dashboard-web/chunks/{v3-page-NQ73UA2Q.js → v3-page-V6IOJR2B.js} +1 -1
- package/dist/dashboard-web/chunks/{whiteboards-page-DSM3MDMN.js → whiteboards-page-V6CGKRNX.js} +1 -1
- package/dist/dashboard-web/style.css +20 -3
- package/dist/dashboard.js +86 -1
- package/dist/dashboard.js.map +1 -1
- package/dist/global-config.d.ts.map +1 -1
- package/dist/global-config.js +4 -1
- package/dist/global-config.js.map +1 -1
- package/dist/i18n/en.d.ts.map +1 -1
- package/dist/i18n/en.js +1 -19
- package/dist/i18n/en.js.map +1 -1
- package/dist/i18n/zh.d.ts.map +1 -1
- package/dist/i18n/zh.js +1 -19
- package/dist/i18n/zh.js.map +1 -1
- package/dist/im/lark/card-builder.d.ts +0 -13
- package/dist/im/lark/card-builder.d.ts.map +1 -1
- package/dist/im/lark/card-builder.js +0 -34
- package/dist/im/lark/card-builder.js.map +1 -1
- package/dist/im/lark/card-handler.d.ts.map +1 -1
- package/dist/im/lark/card-handler.js +1 -30
- package/dist/im/lark/card-handler.js.map +1 -1
- package/dist/im/lark/client.d.ts +36 -0
- package/dist/im/lark/client.d.ts.map +1 -1
- package/dist/im/lark/client.js +80 -0
- package/dist/im/lark/client.js.map +1 -1
- package/dist/im/lark/event-dispatcher.d.ts.map +1 -1
- package/dist/im/lark/event-dispatcher.js +28 -3
- package/dist/im/lark/event-dispatcher.js.map +1 -1
- package/dist/services/sandbox-migration.d.ts +14 -0
- package/dist/services/sandbox-migration.d.ts.map +1 -0
- package/dist/services/sandbox-migration.js +85 -0
- package/dist/services/sandbox-migration.js.map +1 -0
- package/dist/services/sandbox-store.d.ts +28 -0
- package/dist/services/sandbox-store.d.ts.map +1 -1
- package/dist/services/sandbox-store.js +82 -0
- package/dist/services/sandbox-store.js.map +1 -1
- package/dist/types.d.ts +13 -1
- package/dist/types.d.ts.map +1 -1
- package/dist/utils/child-env.d.ts +2 -2
- package/dist/utils/child-env.d.ts.map +1 -1
- package/dist/utils/child-env.js +14 -0
- package/dist/utils/child-env.js.map +1 -1
- package/dist/worker.js +417 -498
- package/dist/worker.js.map +1 -1
- package/dist/workflows/events/payloads.d.ts +56 -0
- package/dist/workflows/events/payloads.d.ts.map +1 -1
- package/dist/workflows/events/payloads.js +9 -0
- package/dist/workflows/events/payloads.js.map +1 -1
- package/dist/workflows/events/schema.d.ts +86 -0
- package/dist/workflows/events/schema.d.ts.map +1 -1
- package/dist/workflows/shared/sandbox-policy.d.ts +10 -1
- package/dist/workflows/shared/sandbox-policy.d.ts.map +1 -1
- package/dist/workflows/shared/sandbox-policy.js +12 -0
- package/dist/workflows/shared/sandbox-policy.js.map +1 -1
- package/dist/workflows/v3/bot-resolve.d.ts.map +1 -1
- package/dist/workflows/v3/bot-resolve.js +36 -0
- package/dist/workflows/v3/bot-resolve.js.map +1 -1
- package/dist/workflows/v3/contract.d.ts +8 -0
- package/dist/workflows/v3/contract.d.ts.map +1 -1
- package/dist/workflows/v3/contract.js.map +1 -1
- package/package.json +1 -1
- package/dist/dashboard-web/chunks/bot-defaults-page-O376WSER.js +0 -5
- package/dist/dashboard-web/chunks/sessions-page-KWLGBX6G.js +0 -3
- package/dist/services/sandbox-land.d.ts +0 -45
- package/dist/services/sandbox-land.d.ts.map +0 -1
- package/dist/services/sandbox-land.js +0 -394
- package/dist/services/sandbox-land.js.map +0 -1
package/dist/dashboard.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// src/dashboard.ts
|
|
2
2
|
import { createServer, get as httpGet, request as httpRequest } from 'node:http';
|
|
3
3
|
import { createServer as createTcpServer, connect as netConnect } from 'node:net';
|
|
4
|
-
import { readFileSync, existsSync, mkdirSync, readdirSync, statSync, createReadStream, } from 'node:fs';
|
|
4
|
+
import { readFileSync, existsSync, mkdirSync, readdirSync, statSync, createReadStream, realpathSync, } from 'node:fs';
|
|
5
5
|
import { atomicWriteFileSync } from './utils/atomic-write.js';
|
|
6
6
|
import { join, dirname, extname, resolve, relative, isAbsolute } from 'node:path';
|
|
7
7
|
import { homedir } from 'node:os';
|
|
@@ -212,6 +212,64 @@ const debugTerminalManager = createDebugTerminalManager({
|
|
|
212
212
|
* tasks (see scheduler.belongsToOwner). Returns undefined when the row is
|
|
213
213
|
* genuinely unknown or no daemon is online.
|
|
214
214
|
*/
|
|
215
|
+
/**
|
|
216
|
+
* Read-only directory listing for the dashboard sandbox-paths tree picker.
|
|
217
|
+
* Served locally by the dashboard process (same host as the daemons). Returns
|
|
218
|
+
* immediate CHILD DIRECTORIES only — never file contents. Trust model matches
|
|
219
|
+
* validateWorkingDir: the caller is an authed admin and the daemon already runs
|
|
220
|
+
* prompts with full FS access, so this is a convenience browser, not a security
|
|
221
|
+
* boundary. Symlinks are realpath-resolved; a raw path is never echoed into an
|
|
222
|
+
* error the browser renders verbatim.
|
|
223
|
+
*/
|
|
224
|
+
function listDirLocally(rawPath) {
|
|
225
|
+
// Canonicalize $HOME so the root entry + the `~` the frontend expands both use
|
|
226
|
+
// the SAME canonical form the child listings (realpathSync below) and the
|
|
227
|
+
// worker's sandbox binds use. On a symlinked-$HOME host (/home/u →
|
|
228
|
+
// /data00/home/u) the lexical homedir() would make `~/.claude` expand to
|
|
229
|
+
// /home/u/.claude while the tree's child nodes come back as /data00/... — the
|
|
230
|
+
// picker would then never match its own recommendation entries.
|
|
231
|
+
let home = homedir();
|
|
232
|
+
try {
|
|
233
|
+
home = realpathSync(home);
|
|
234
|
+
}
|
|
235
|
+
catch { /* lexical fallback if unresolvable */ }
|
|
236
|
+
if (!rawPath) {
|
|
237
|
+
// Root view: HOME first (the common case), then filesystem root. `home` is
|
|
238
|
+
// also returned explicitly so the frontend doesn't guess from entries[0].
|
|
239
|
+
const roots = [...new Set([home, '/'])];
|
|
240
|
+
return {
|
|
241
|
+
ok: true, path: null, parent: null, home,
|
|
242
|
+
entries: roots.map(p => ({ name: p, path: p, kind: 'dir' })),
|
|
243
|
+
};
|
|
244
|
+
}
|
|
245
|
+
const expanded = rawPath.startsWith('~') ? join(home, rawPath.slice(1)) : rawPath;
|
|
246
|
+
let resolved;
|
|
247
|
+
try {
|
|
248
|
+
resolved = realpathSync(expanded);
|
|
249
|
+
}
|
|
250
|
+
catch {
|
|
251
|
+
return { ok: false, path: null, parent: null, entries: [], error: 'path_not_found' };
|
|
252
|
+
}
|
|
253
|
+
let entries;
|
|
254
|
+
try {
|
|
255
|
+
entries = readdirSync(resolved, { withFileTypes: true })
|
|
256
|
+
.filter(d => {
|
|
257
|
+
try {
|
|
258
|
+
return d.isDirectory() || (d.isSymbolicLink() && statSync(join(resolved, d.name)).isDirectory());
|
|
259
|
+
}
|
|
260
|
+
catch {
|
|
261
|
+
return false;
|
|
262
|
+
}
|
|
263
|
+
})
|
|
264
|
+
.map(d => ({ name: d.name, path: join(resolved, d.name), kind: 'dir' }))
|
|
265
|
+
.sort((a, b) => a.name.localeCompare(b.name));
|
|
266
|
+
}
|
|
267
|
+
catch (e) {
|
|
268
|
+
return { ok: false, path: resolved, parent: null, entries: [], error: e?.code === 'EACCES' ? 'permission_denied' : 'cannot_read_dir' };
|
|
269
|
+
}
|
|
270
|
+
const parent = resolved === '/' ? null : dirname(resolved);
|
|
271
|
+
return { ok: true, path: resolved, parent, entries };
|
|
272
|
+
}
|
|
215
273
|
function resolveScheduleOwner(id) {
|
|
216
274
|
const explicit = aggregator.scheduleOwnerOf(id);
|
|
217
275
|
if (explicit)
|
|
@@ -4072,6 +4130,33 @@ const server = createServer(async (req, res) => {
|
|
|
4072
4130
|
res.end(await upstream.text());
|
|
4073
4131
|
return;
|
|
4074
4132
|
}
|
|
4133
|
+
// PUT /api/bots/:appId/sandbox-paths — proxy to that bot's daemon.
|
|
4134
|
+
// Body `{ readWrite?: string[]; readOnly?: string[]; deny?: string[] }`.
|
|
4135
|
+
let mBotSandboxPaths;
|
|
4136
|
+
if (req.method === 'PUT' && (mBotSandboxPaths = url.pathname.match(/^\/api\/bots\/([^/]+)\/sandbox-paths$/))) {
|
|
4137
|
+
const appId = decodeURIComponent(mBotSandboxPaths[1]);
|
|
4138
|
+
const chunks = [];
|
|
4139
|
+
for await (const c of req)
|
|
4140
|
+
chunks.push(c);
|
|
4141
|
+
const raw = Buffer.concat(chunks).toString('utf8') || '{}';
|
|
4142
|
+
const upstream = await proxyToDaemon(appId, `/api/bot-sandbox-paths`, {
|
|
4143
|
+
method: 'PUT',
|
|
4144
|
+
headers: { 'content-type': 'application/json' },
|
|
4145
|
+
body: raw,
|
|
4146
|
+
});
|
|
4147
|
+
res.writeHead(upstream.status, { 'content-type': 'application/json' });
|
|
4148
|
+
res.end(await upstream.text());
|
|
4149
|
+
return;
|
|
4150
|
+
}
|
|
4151
|
+
// GET /api/fs/list?path=… — read-only directory listing for the sandbox-paths
|
|
4152
|
+
// tree picker. Not bot-specific (the filesystem is shared with this host's
|
|
4153
|
+
// daemons — the dashboard process runs on the SAME machine), so serve it
|
|
4154
|
+
// locally instead of proxying. Returns immediate child directories only.
|
|
4155
|
+
if (req.method === 'GET' && url.pathname === '/api/fs/list') {
|
|
4156
|
+
res.writeHead(200, { 'content-type': 'application/json' });
|
|
4157
|
+
res.end(JSON.stringify(listDirLocally(url.searchParams.get('path') ?? '')));
|
|
4158
|
+
return;
|
|
4159
|
+
}
|
|
4075
4160
|
// PUT /api/bots/:appId/sandbox — proxy to that bot's daemon. Body `{ enabled: boolean }`.
|
|
4076
4161
|
let mBotSandbox;
|
|
4077
4162
|
if (req.method === 'PUT' && (mBotSandbox = url.pathname.match(/^\/api\/bots\/([^/]+)\/sandbox$/))) {
|