@dcrays/mbh-chat 0.1.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 +7 -0
- package/agent-presets/mbh-chat/agent.cordis.yml +334 -0
- package/agent-presets/mbh-chat/preset.yml +2 -0
- package/bridge/index.js +593 -0
- package/cordis.patch.yml +23 -0
- package/package.json +50 -0
- package/plugin/index.d.ts +36 -0
- package/plugin/index.js +68 -0
package/cordis.patch.yml
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
- insert:
|
|
2
|
+
- id: mbhchat-bridge
|
|
3
|
+
name: '@dcrays/mbh-chat'
|
|
4
|
+
disabled: !!js process.env.DSH_MBHCHAT_DISABLED === '1'
|
|
5
|
+
inject:
|
|
6
|
+
- webServer
|
|
7
|
+
- tools
|
|
8
|
+
- settings
|
|
9
|
+
- connection
|
|
10
|
+
config:
|
|
11
|
+
enabled: true
|
|
12
|
+
watch: !!js process.env.DSH_MBHCHAT_WATCH === '1'
|
|
13
|
+
restart: true
|
|
14
|
+
restartDelayMs: 1000
|
|
15
|
+
restartMaxDelayMs: 30000
|
|
16
|
+
shutdownTimeoutMs: 5000
|
|
17
|
+
manageAgentPreset: true
|
|
18
|
+
|
|
19
|
+
# Host default for sessions that do not name a preset. The plugin also copies
|
|
20
|
+
# `agent-presets/mbhchat` into `$DSH_HOME/.agent-presets` and writes settings.
|
|
21
|
+
- id: agent-presets
|
|
22
|
+
config:
|
|
23
|
+
default: mbh-chat
|
package/package.json
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@dcrays/mbh-chat",
|
|
3
|
+
"version": "0.1.4",
|
|
4
|
+
"description": "DeepSeek Harness host plugin and headless sidecar bridge for MBHChat/Mobook (production)",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "plugin/index.js",
|
|
7
|
+
"types": "plugin/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"types": "./plugin/index.d.ts",
|
|
11
|
+
"default": "./plugin/index.js"
|
|
12
|
+
},
|
|
13
|
+
"./cordis.patch.yml": "./cordis.patch.yml",
|
|
14
|
+
"./package.json": "./package.json"
|
|
15
|
+
},
|
|
16
|
+
"files": [
|
|
17
|
+
"plugin/**",
|
|
18
|
+
"bridge/**",
|
|
19
|
+
"agent-presets/**",
|
|
20
|
+
"cordis.patch.yml",
|
|
21
|
+
"README.md",
|
|
22
|
+
"!**/*.map"
|
|
23
|
+
],
|
|
24
|
+
"dsh": {
|
|
25
|
+
"bundle": {
|
|
26
|
+
"patch": "./cordis.patch.yml"
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
"engines": {
|
|
30
|
+
"node": ">=24.0.0"
|
|
31
|
+
},
|
|
32
|
+
"dependencies": {
|
|
33
|
+
"ali-oss": "6.23.0",
|
|
34
|
+
"unzipper": "0.12.3",
|
|
35
|
+
"ws": "^8.21.0",
|
|
36
|
+
"zod": "^4.4.3"
|
|
37
|
+
},
|
|
38
|
+
"peerDependencies": {
|
|
39
|
+
"@deepseek-ai/cordis": "^4.0.2",
|
|
40
|
+
"@deepseek-ai/dsh-client-connection": "0.1.2-rc.1",
|
|
41
|
+
"@deepseek-ai/dsh-home-paths": "0.1.2-rc.1",
|
|
42
|
+
"@deepseek-ai/dsh-host-webserver": "0.1.2-rc.1",
|
|
43
|
+
"@deepseek-ai/dsh-session": "0.1.2-rc.1",
|
|
44
|
+
"@deepseek-ai/dsh-tools": "0.1.2-rc.1",
|
|
45
|
+
"@deepseek-ai/schemastery": "^3.18.1"
|
|
46
|
+
},
|
|
47
|
+
"publishConfig": {
|
|
48
|
+
"access": "public"
|
|
49
|
+
}
|
|
50
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { Context } from '@deepseek-ai/cordis';
|
|
2
|
+
import type { WebRoute } from '@deepseek-ai/dsh-host-webserver';
|
|
3
|
+
import z from '@deepseek-ai/schemastery';
|
|
4
|
+
import type { MbhchatBridgeStatus } from '../src/host/bridge-status.js';
|
|
5
|
+
export { DEFAULT_BUILD_ENV } from '../src/config/env-config.js';
|
|
6
|
+
export declare const name = "mbh-chat";
|
|
7
|
+
export declare const inject: string[];
|
|
8
|
+
export declare const MBHCHAT_STATUS_ROUTE = "/api/mobook/mbhchat/status";
|
|
9
|
+
export interface Config {
|
|
10
|
+
enabled: boolean;
|
|
11
|
+
watch: boolean;
|
|
12
|
+
restart: boolean;
|
|
13
|
+
restartDelayMs: number;
|
|
14
|
+
restartMaxDelayMs: number;
|
|
15
|
+
shutdownTimeoutMs: number;
|
|
16
|
+
manageAgentPreset: boolean;
|
|
17
|
+
}
|
|
18
|
+
export declare const Config: z<Config>;
|
|
19
|
+
interface SidecarOptions {
|
|
20
|
+
packageRoot: string;
|
|
21
|
+
bridgeEntry: string;
|
|
22
|
+
}
|
|
23
|
+
export declare function createMbhchatStatusHandler(options: {
|
|
24
|
+
readStatus: () => Promise<MbhchatBridgeStatus>;
|
|
25
|
+
unavailableStatus: () => MbhchatBridgeStatus;
|
|
26
|
+
onUnavailable?: (error: unknown) => void;
|
|
27
|
+
onAvailable?: () => void;
|
|
28
|
+
}): WebRoute['handler'];
|
|
29
|
+
export declare function createSidecarArgs(options: SidecarOptions, watch: boolean, bootstrap?: string | undefined): string[];
|
|
30
|
+
export declare function resolveBridgeEntry(packageRoot: string): string;
|
|
31
|
+
export declare function resolveSidecarWorkingDirectory(packageRoot: string, dshHome: string): string;
|
|
32
|
+
export declare function createSidecarEnvironment(dshHome: string, sessionCookie: string, environment?: NodeJS.ProcessEnv, electron?: boolean): NodeJS.ProcessEnv;
|
|
33
|
+
export declare function shouldStartSidecar(config: Config, dshHome?: string): boolean;
|
|
34
|
+
/** Exponential backoff with a floor of restartDelayMs; attempt 0 still waits the full base delay. */
|
|
35
|
+
export declare function restartBackoffDelayMs(restartDelayMs: number, restartMaxDelayMs: number, restartAttempt: number): number;
|
|
36
|
+
export declare function apply(ctx: Context, config: Config): void;
|