dsh-quay-bot 1.0.1 → 1.0.4
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/README.md +28 -105
- package/botscreen/requirements.txt +1 -1
- package/client.js +3 -2
- package/cordis.patch.yml +1 -1
- package/host/api.js +4 -0
- package/host/remote.js +285 -8
- package/host/screen.js +22 -86
- package/package.json +33 -30
- package/remote/bin/dsh-remote.mjs +435 -0
- package/remote/package.json +27 -0
- package/remote/src/config.mjs +183 -0
- package/remote/src/crypto.mjs +220 -0
- package/remote/src/keys.mjs +226 -0
- package/remote/src/proxy.mjs +1028 -0
- package/remote/src/sessions.mjs +163 -0
- package/remote/src/shim.js +838 -0
- package/remote/src/supervisor.mjs +207 -0
- package/remote/src/tunnel.mjs +533 -0
- package/remote/src/upstream.mjs +403 -0
- package/remote/src/util.mjs +149 -0
- package/remote/src/ws.mjs +313 -0
- package/LICENSE +0 -21
- package/avatar/build.mjs +0 -81
- package/avatar/gallery/droid.json +0 -14
- package/avatar/gallery/ghost.json +0 -14
- package/avatar/gallery/grok-pod.json +0 -14
- package/avatar/gallery/guardian.json +0 -14
- package/avatar/gallery/mecha.json +0 -14
- package/avatar/gallery/mochi.json +0 -14
- package/avatar/gallery/neko.json +0 -14
- package/avatar/gallery/orbiter.json +0 -14
- package/avatar/gallery/relay.json +0 -14
- package/avatar/gallery/spark.json +0 -14
- package/avatar/src/bot/clay.ts +0 -135
- package/avatar/src/bot/effects.ts +0 -100
- package/avatar/src/bot/grok-bot.ts +0 -626
- package/avatar/src/bot/index.ts +0 -15
- package/avatar/src/bot/palettes.ts +0 -62
- package/avatar/src/bot/ring.ts +0 -219
- package/avatar/src/bot/scheduler.ts +0 -239
- package/avatar/src/bot/shapes.ts +0 -277
- package/avatar/src/bot/spring.ts +0 -196
- package/avatar/src/core/color.ts +0 -92
- package/avatar/src/core/eyes.ts +0 -297
- package/avatar/src/core/field.ts +0 -482
- package/avatar/src/core/frame.ts +0 -655
- package/avatar/src/core/fx.ts +0 -375
- package/avatar/src/core/index.ts +0 -49
- package/avatar/src/core/paint.ts +0 -331
- package/avatar/src/core/path.ts +0 -495
- package/avatar/src/core/pose.ts +0 -581
- package/avatar/src/core/svg.ts +0 -98
- package/avatar/src/core/types.ts +0 -153
- package/avatar/src/core/validate.ts +0 -296
- package/avatar/src/core/volume.ts +0 -681
- package/avatar/src/entry.ts +0 -260
- package/bin/doctor.mjs +0 -148
- package/botscreen/requirements-offline.txt +0 -11
- package/market/index.json +0 -41
- package/vendor/wheels/any/annotated_doc-0.0.7-py3-none-any.whl +0 -0
- package/vendor/wheels/any/annotated_types-0.8.0-py3-none-any.whl +0 -0
- package/vendor/wheels/any/anyio-4.16.0-py3-none-any.whl +0 -0
- package/vendor/wheels/any/certifi-2026.11.20-py3-none-any.whl +0 -0
- package/vendor/wheels/any/click-8.5.1-py3-none-any.whl +0 -0
- package/vendor/wheels/any/fastapi-0.165.0-py3-none-any.whl +0 -0
- package/vendor/wheels/any/h11-0.16.0-py3-none-any.whl +0 -0
- package/vendor/wheels/any/httpcore-1.0.9-py3-none-any.whl +0 -0
- package/vendor/wheels/any/httpx-0.29.0-py3-none-any.whl +0 -0
- package/vendor/wheels/any/idna-3.20-py3-none-any.whl +0 -0
- package/vendor/wheels/any/mss-10.2.0-py3-none-any.whl +0 -0
- package/vendor/wheels/any/opentelemetry_api-1.45.2-py3-none-any.whl +0 -0
- package/vendor/wheels/any/pydantic-2.14.4-py3-none-any.whl +0 -0
- package/vendor/wheels/any/python_multipart-0.0.34-py3-none-any.whl +0 -0
- package/vendor/wheels/any/python_xlib-0.33-py2.py3-none-any.whl +0 -0
- package/vendor/wheels/any/six-1.17.0-py2.py3-none-any.whl +0 -0
- package/vendor/wheels/any/starlette-1.10.0-py3-none-any.whl +0 -0
- package/vendor/wheels/any/typing_extensions-4.16.0-py3-none-any.whl +0 -0
- package/vendor/wheels/any/typing_inspection-0.4.5-py3-none-any.whl +0 -0
- package/vendor/wheels/any/uvicorn-0.54.0-py3-none-any.whl +0 -0
- package/vendor/wheels/linux-aarch64/pillow-12.2.0-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.whl +0 -0
- package/vendor/wheels/linux-aarch64/pydantic_core-2.50.5-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.whl +0 -0
- package/vendor/wheels/linux-aarch64/websockets-17.4-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl +0 -0
- package/vendor/wheels/linux-x86_64/pillow-12.2.0-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl +0 -0
- package/vendor/wheels/linux-x86_64/pydantic_core-2.50.5-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl +0 -0
- package/vendor/wheels/linux-x86_64/websockets-17.4-cp312-cp312-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl +0 -0
package/host/screen.js
CHANGED
|
@@ -26,7 +26,7 @@ const LOCAL_HOSTS = new Set(['127.0.0.1', 'localhost', '::1', '[::1]'])
|
|
|
26
26
|
const __dirname = dirname(fileURLToPath(import.meta.url))
|
|
27
27
|
// Keep in sync with botscreen/requirements.txt. Checking every runtime import avoids
|
|
28
28
|
// half-bootstrapped environments where the gateway process starts but immediately exits.
|
|
29
|
-
const PY_DEPS_CHECK = 'import fastapi, uvicorn, multipart, PIL, Xlib, websockets, httpx
|
|
29
|
+
const PY_DEPS_CHECK = 'import fastapi, uvicorn, multipart, pydantic, PIL, Xlib, websockets, httpx'
|
|
30
30
|
const _pyChecked = new Map()
|
|
31
31
|
|
|
32
32
|
let _lastLocalCpuSample = null
|
|
@@ -248,17 +248,6 @@ const AUTO_SYSTEM_PACKAGES = [
|
|
|
248
248
|
'adwaita-icon-theme', 'fonts-noto-color-emoji', 'fonts-noto-cjk',
|
|
249
249
|
]
|
|
250
250
|
|
|
251
|
-
/**
|
|
252
|
-
* Binaries the bundled desktop actually launches. Probing every one of them (not just
|
|
253
|
-
* the X core) is what makes `npm i` alone sufficient: a host that already had `Xvfb`
|
|
254
|
-
* but no `tint2`/`picom`/`pcmanfm` would otherwise be skipped and boot a crippled shell.
|
|
255
|
-
*/
|
|
256
|
-
const REQUIRED_BINS = [
|
|
257
|
-
'Xvfb', 'xauth', 'xdotool', 'xclip', 'openbox',
|
|
258
|
-
'tint2', 'picom', 'pcmanfm', 'xterm', 'xfwm4', 'xfdesktop4',
|
|
259
|
-
'x11vnc', 'websockify', 'feh',
|
|
260
|
-
]
|
|
261
|
-
|
|
262
251
|
function hasPythonDepsSync(py) {
|
|
263
252
|
if (_pyChecked.has(py)) return _pyChecked.get(py)
|
|
264
253
|
try {
|
|
@@ -333,7 +322,10 @@ function ensureSystemDependencies(logger) {
|
|
|
333
322
|
logger?.warn?.('botmode: system dependency auto-install disabled by BOTSCREEN_AUTO_INSTALL_DEPS=0')
|
|
334
323
|
return
|
|
335
324
|
}
|
|
336
|
-
const
|
|
325
|
+
const requiredBins = [
|
|
326
|
+
'Xvfb', 'xauth', 'xdotool', 'xclip', 'openbox',
|
|
327
|
+
]
|
|
328
|
+
const missingBins = requiredBins.filter(name =>
|
|
337
329
|
!runQuiet('sh', ['-c', `command -v ${name} >/dev/null 2>&1`], { timeout: 10_000 }),
|
|
338
330
|
)
|
|
339
331
|
if (!missingBins.length) return
|
|
@@ -341,38 +333,20 @@ function ensureSystemDependencies(logger) {
|
|
|
341
333
|
logger?.warn?.(`botmode: missing BotScreen system components (${missingBins.join(', ')}); install them manually`)
|
|
342
334
|
return
|
|
343
335
|
}
|
|
344
|
-
const
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
: (runQuiet('sh', ['-c', 'command -v sudo >/dev/null 2>&1 && sudo -n true'], { timeout: 10_000 }) ? ['sudo', '-n'] : null)
|
|
348
|
-
if (sudo === null) {
|
|
349
|
-
logger?.warn?.(
|
|
350
|
-
`botmode: missing BotScreen system components (${missingBins.join(', ')}); `
|
|
351
|
-
+ `no passwordless sudo. Run once: sudo apt-get install -y --no-install-recommends ${AUTO_SYSTEM_PACKAGES.join(' ')}`,
|
|
352
|
-
)
|
|
353
|
-
return
|
|
354
|
-
}
|
|
336
|
+
const sudo = runQuiet('sh', ['-c', 'command -v sudo >/dev/null 2>&1 && sudo -n true'], { timeout: 10_000 })
|
|
337
|
+
? ['sudo', '-n']
|
|
338
|
+
: []
|
|
355
339
|
logger?.info?.(`botmode: installing BotScreen system components: ${missingBins.join(', ')}`)
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
const apt = (args, timeout) => (sudo.length
|
|
359
|
-
? run([...sudo, 'apt-get', ...args], timeout)
|
|
360
|
-
: run(['apt-get', ...args], timeout))
|
|
361
|
-
if (!apt(['update', '-qq'], 300_000)) {
|
|
362
|
-
logger?.warn?.('botmode: apt-get update failed; BotScreen system components stay missing')
|
|
363
|
-
return
|
|
340
|
+
if (!runQuiet('apt-get', ['update', '-qq'], { timeout: 300_000 })) {
|
|
341
|
+
throw new Error('apt-get update 失败,无法自动安装 BotScreen 系统依赖')
|
|
364
342
|
}
|
|
365
|
-
const
|
|
366
|
-
const
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
+ `run: sudo apt-get install -y --no-install-recommends ${AUTO_SYSTEM_PACKAGES.join(' ')}`,
|
|
373
|
-
)
|
|
374
|
-
} else {
|
|
375
|
-
logger?.info?.('botmode: BotScreen system components installed')
|
|
343
|
+
const env = { ...process.env, DEBIAN_FRONTEND: 'noninteractive' }
|
|
344
|
+
const installCmd = sudo.length ? sudo[0] : 'apt-get'
|
|
345
|
+
const installArgs = sudo.length
|
|
346
|
+
? [...sudo.slice(1), 'apt-get', 'install', '-y', '--no-install-recommends', ...AUTO_SYSTEM_PACKAGES]
|
|
347
|
+
: ['install', '-y', '--no-install-recommends', ...AUTO_SYSTEM_PACKAGES]
|
|
348
|
+
if (!runQuiet(installCmd, installArgs, { env, timeout: 900_000 })) {
|
|
349
|
+
throw new Error('apt-get install 失败,无法自动安装 BotScreen 系统依赖')
|
|
376
350
|
}
|
|
377
351
|
}
|
|
378
352
|
|
|
@@ -382,7 +356,7 @@ function findBotscreenRuntime({ botscreenRoot, pythonBin, logDir } = {}) {
|
|
|
382
356
|
const candidates = [
|
|
383
357
|
botscreenRoot,
|
|
384
358
|
process.env.BOTSCREEN_ROOT,
|
|
385
|
-
pluginRoot, // bundled inside dsh-
|
|
359
|
+
pluginRoot, // bundled inside @local/dsh-botmode
|
|
386
360
|
repoRoot,
|
|
387
361
|
'/opt/botscreen',
|
|
388
362
|
join(homedir(), 'Desktop', 'dsh- bot'),
|
|
@@ -432,48 +406,10 @@ function findBotscreenRuntime({ botscreenRoot, pythonBin, logDir } = {}) {
|
|
|
432
406
|
return null
|
|
433
407
|
}
|
|
434
408
|
|
|
435
|
-
|
|
436
|
-
function offlineWheelDirs(pluginRoot) {
|
|
437
|
-
const base = join(pluginRoot, 'vendor', 'wheels')
|
|
438
|
-
const archDir = process.arch === 'arm64'
|
|
439
|
-
? 'linux-aarch64'
|
|
440
|
-
: (process.arch === 'x64' ? 'linux-x86_64' : '')
|
|
441
|
-
const dirs = [join(base, 'any'), archDir ? join(base, archDir) : ''].filter(d => d && existsSync(d))
|
|
442
|
-
return dirs
|
|
443
|
-
}
|
|
444
|
-
|
|
445
|
-
/**
|
|
446
|
-
* Install the gateway's Python deps with zero user interaction:
|
|
447
|
-
* 1. offline from the bundle's vendored wheels (matches CPython 3.12 x86_64/arm64), else
|
|
448
|
-
* 2. online from PyPI as a fallback for other interpreters.
|
|
449
|
-
* The offline set omits optional accelerators (uvloop/httptools/watchfiles); uvicorn falls
|
|
450
|
-
* back to pure-Python h11 automatically, and the live `import` probe stays satisfied.
|
|
451
|
-
*/
|
|
452
|
-
async function installPythonDeps(python, root, pluginRoot, logger) {
|
|
453
|
-
const env = { ...process.env, PIP_DISABLE_PIP_VERSION_CHECK: '1' }
|
|
454
|
-
const offlineReq = join(root, 'botscreen', 'requirements-offline.txt')
|
|
455
|
-
const wheelDirs = offlineWheelDirs(pluginRoot)
|
|
456
|
-
if (wheelDirs.length && existsSync(offlineReq)) {
|
|
457
|
-
const args = ['-m', 'pip', 'install', '-q', '--no-index', '--disable-pip-version-check']
|
|
458
|
-
for (const dir of wheelDirs) args.push('--find-links', dir)
|
|
459
|
-
args.push('-r', offlineReq)
|
|
460
|
-
try {
|
|
461
|
-
await execFileAsync(python, args, { env, timeout: 600_000 })
|
|
462
|
-
logger?.info?.('botmode: BotScreen Python deps installed from bundled wheels (offline)')
|
|
463
|
-
return 'bundled'
|
|
464
|
-
} catch (error) {
|
|
465
|
-
logger?.warn?.(`botmode: bundled wheel set did not satisfy ${python} (${String(error?.message || error).slice(0, 200)}); falling back to PyPI`)
|
|
466
|
-
}
|
|
467
|
-
}
|
|
468
|
-
const reqFile = join(root, 'botscreen', 'requirements.txt')
|
|
469
|
-
await execFileAsync(python, ['-m', 'pip', 'install', '-q', '--disable-pip-version-check', '-r', reqFile], { env, timeout: 600_000 })
|
|
470
|
-
logger?.info?.('botmode: BotScreen Python deps installed from PyPI')
|
|
471
|
-
return 'pypi'
|
|
472
|
-
}
|
|
473
|
-
|
|
474
|
-
async function bootstrapVenv(runtime, logDir, logPath, logger) {
|
|
409
|
+
async function bootstrapVenv(runtime, logDir, logPath) {
|
|
475
410
|
const venvDir = resolve(dirname(runtime.python), '..')
|
|
476
411
|
const pluginRoot = resolve(__dirname, '..')
|
|
412
|
+
const reqFile = join(runtime.root, 'botscreen', 'requirements.txt')
|
|
477
413
|
const invalidVenv = !isUsableVenv(runtime.python)
|
|
478
414
|
if (!invalidVenv) {
|
|
479
415
|
// Nothing to do: keep the existing interpreter and its pip as-is.
|
|
@@ -484,7 +420,7 @@ async function bootstrapVenv(runtime, logDir, logPath, logger) {
|
|
|
484
420
|
await execFileAsync('python3', ['-m', 'venv', '--without-pip', venvDir], { timeout: 60_000 })
|
|
485
421
|
}
|
|
486
422
|
await ensurePipInVenv(runtime.python, pluginRoot)
|
|
487
|
-
await
|
|
423
|
+
await execFileAsync(runtime.python, ['-m', 'pip', 'install', '-q', '-r', reqFile], { timeout: 300_000 })
|
|
488
424
|
_pyChecked.delete(runtime.python)
|
|
489
425
|
return runtime.python
|
|
490
426
|
}
|
|
@@ -764,7 +700,7 @@ export class ScreenBridge {
|
|
|
764
700
|
if (runtime.needsBootstrap) {
|
|
765
701
|
try {
|
|
766
702
|
this.logger?.info?.(`botmode: bootstrapping embedded BotScreen Python venv at ${logBase}`)
|
|
767
|
-
await bootstrapVenv(runtime, logBase, logPath
|
|
703
|
+
await bootstrapVenv(runtime, logBase, logPath)
|
|
768
704
|
} catch (err) {
|
|
769
705
|
if (logFd !== null) {
|
|
770
706
|
try { closeSync(logFd) } catch (_e) { /* ignore */ }
|
package/package.json
CHANGED
|
@@ -1,36 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-quay-bot",
|
|
3
|
-
"version": "1.0.
|
|
4
|
-
"description": "Bot mode for DeepSeek Harness: isolated Bot personas, loop-guarded teammate messaging, Hermes-style Group Rooms, persistent Routines, a pluggable Team Memory Hub, and a bundled BotScreen virtual desktop — installs and runs with no separate dependency setup.",
|
|
5
|
-
"author": "kdczyz",
|
|
6
|
-
"keywords": [
|
|
7
|
-
"dsh",
|
|
8
|
-
"dsh-plugin",
|
|
9
|
-
"dsh-bundle",
|
|
10
|
-
"deepseek-harness",
|
|
11
|
-
"dsh-botmode",
|
|
12
|
-
"botmode",
|
|
13
|
-
"botscreen",
|
|
14
|
-
"bot",
|
|
15
|
-
"multi-agent",
|
|
16
|
-
"group-room",
|
|
17
|
-
"agent-team",
|
|
18
|
-
"virtual-desktop",
|
|
19
|
-
"vnc"
|
|
20
|
-
],
|
|
3
|
+
"version": "1.0.4",
|
|
21
4
|
"type": "module",
|
|
22
|
-
"license": "MIT",
|
|
23
5
|
"engines": {
|
|
24
|
-
"node": ">=22.
|
|
25
|
-
"dsh": ">=0.2.2-rc.3"
|
|
6
|
+
"node": ">=22.5.0"
|
|
26
7
|
},
|
|
27
8
|
"scripts": {
|
|
28
|
-
"test": "node test/host.test.mjs && node test/screen.test.mjs && node test/avatar.test.mjs && node test/artifacts.test.mjs && node test/routines.test.mjs && node test/qr.test.mjs && node test/remote.test.mjs"
|
|
29
|
-
"doctor": "node bin/doctor.mjs"
|
|
30
|
-
},
|
|
31
|
-
"bin": {
|
|
32
|
-
"dsh-quay-bot": "bin/doctor.mjs"
|
|
9
|
+
"test": "node test/host.test.mjs && node test/screen.test.mjs && node test/avatar.test.mjs && node test/artifacts.test.mjs && node test/routines.test.mjs && node test/isolation.test.mjs && node test/governance-channels.test.mjs && node test/qr.test.mjs && node test/remote.test.mjs && node --test remote/test/*.test.mjs"
|
|
33
10
|
},
|
|
11
|
+
"description": "Bot mode for DeepSeek Harness: isolated Bot personas, loop-guarded teammate messaging, Hermes-style Group Rooms, persistent Routines and a pluggable Team Memory Hub (built-in memory_tencentdb).",
|
|
34
12
|
"exports": {
|
|
35
13
|
".": "./index.js",
|
|
36
14
|
"./client": "./client.js",
|
|
@@ -41,16 +19,22 @@
|
|
|
41
19
|
"files": [
|
|
42
20
|
"index.js",
|
|
43
21
|
"client.js",
|
|
44
|
-
"avatar
|
|
45
|
-
"
|
|
22
|
+
"avatar/catalog.json",
|
|
23
|
+
"avatar/dist/avatar-engine.js",
|
|
24
|
+
"avatar/LICENSE",
|
|
46
25
|
"botscreen/**/*",
|
|
26
|
+
"!botscreen/**/__pycache__/**",
|
|
27
|
+
"!botscreen/**/*.pyc",
|
|
47
28
|
"builtin-skills/**/*",
|
|
29
|
+
"remote/bin/**/*",
|
|
30
|
+
"remote/src/**/*",
|
|
31
|
+
"remote/package.json",
|
|
48
32
|
"vendor/**/*",
|
|
49
33
|
"host/**/*.js",
|
|
34
|
+
"host/**/*.mjs",
|
|
50
35
|
"host/**/*.json",
|
|
51
36
|
"cordis.patch.yml",
|
|
52
37
|
"locale/*.json",
|
|
53
|
-
"market/index.json",
|
|
54
38
|
"docs",
|
|
55
39
|
"icon.svg",
|
|
56
40
|
"README.md"
|
|
@@ -70,5 +54,24 @@
|
|
|
70
54
|
"@deepseek-ai/dsh-api-session-controller"
|
|
71
55
|
]
|
|
72
56
|
}
|
|
73
|
-
}
|
|
57
|
+
},
|
|
58
|
+
"license": "MIT",
|
|
59
|
+
"author": "kdczyz",
|
|
60
|
+
"repository": {
|
|
61
|
+
"type": "git",
|
|
62
|
+
"url": "git+https://github.com/kdczyz/dsh-bot.git",
|
|
63
|
+
"directory": "packages/dsh-botmode"
|
|
64
|
+
},
|
|
65
|
+
"homepage": "https://github.com/kdczyz/dsh-bot#readme",
|
|
66
|
+
"keywords": [
|
|
67
|
+
"dsh",
|
|
68
|
+
"dsh-plugin",
|
|
69
|
+
"dsh-bundle",
|
|
70
|
+
"deepseek-harness",
|
|
71
|
+
"dsh-botmode",
|
|
72
|
+
"botmode",
|
|
73
|
+
"botscreen",
|
|
74
|
+
"dsh-remote",
|
|
75
|
+
"multi-agent"
|
|
76
|
+
]
|
|
74
77
|
}
|