dsh-multi-chat 0.6.8 → 1.0.1
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 +88 -30
- package/README.zh.md +54 -30
- package/bin/dsh-multi-chat.mjs +5 -9
- package/lib/client.js +778 -0
- package/lib/client.js.map +1 -0
- package/{plugin/dsh-client-ui-multi-wall/lib → lib}/index.js +58 -70
- package/lib/tsconfig.tsbuildinfo +1 -0
- package/lib/types/client/WallToggle.d.ts.map +1 -0
- package/lib/types/client/WallToggle.js +36 -0
- package/lib/types/client/WallToggle.js.map +1 -0
- package/lib/types/client/WallView.d.ts.map +1 -0
- package/lib/types/client/WallView.js +218 -0
- package/lib/types/client/WallView.js.map +1 -0
- package/lib/types/client/index.d.ts.map +1 -0
- package/lib/types/client/index.js +59 -0
- package/lib/types/client/index.js.map +1 -0
- package/lib/types/client/locales.d.ts.map +1 -0
- package/lib/types/client/locales.js +96 -0
- package/lib/types/client/locales.js.map +1 -0
- package/lib/types/client/store.d.ts.map +1 -0
- package/lib/types/client/store.js +27 -0
- package/lib/types/client/store.js.map +1 -0
- package/lib/types/client/wall-injected.d.ts.map +1 -0
- package/lib/types/client/wall-injected.js +76 -0
- package/lib/types/client/wall-injected.js.map +1 -0
- package/lib/types/gateway.d.ts +57 -0
- package/lib/types/gateway.d.ts.map +1 -0
- package/lib/types/gateway.js +566 -0
- package/lib/types/gateway.js.map +1 -0
- package/{plugin/dsh-client-ui-multi-wall/lib → lib}/types/index.d.ts +80 -80
- package/lib/types/index.d.ts.map +1 -0
- package/lib/types/index.js +550 -0
- package/lib/types/index.js.map +1 -0
- package/{plugin/dsh-client-ui-multi-wall/lib → lib}/types/invariant.d.ts +3 -4
- package/lib/types/invariant.d.ts.map +1 -0
- package/lib/types/invariant.js +25 -0
- package/lib/types/invariant.js.map +1 -0
- package/package.json +49 -17
- package/patches/multi-wall.yml +1 -1
- package/scripts/install-plugin.ps1 +6 -9
- package/scripts/start-multi.ps1 +1 -1
- package/scripts/sync-vitest-paths.mjs +63 -0
- package/src/client/WallToggle.module.css +26 -0
- package/src/client/WallToggle.tsx +52 -0
- package/src/client/WallView.module.css +190 -0
- package/src/client/WallView.tsx +406 -0
- package/src/client/index.ts +103 -0
- package/src/client/locales.ts +100 -0
- package/src/client/store.ts +40 -0
- package/src/client/wall-injected.ts +123 -0
- package/src/css-modules.d.ts +5 -0
- package/src/gateway.ts +627 -0
- package/src/index.ts +618 -0
- package/src/invariant.ts +33 -0
- package/plugin/dsh-client-ui-multi-wall/README.md +0 -26
- package/plugin/dsh-client-ui-multi-wall/README.zh.md +0 -26
- package/plugin/dsh-client-ui-multi-wall/cordis.patch.yml +0 -7
- package/plugin/dsh-client-ui-multi-wall/lib/client.js +0 -781
- package/plugin/dsh-client-ui-multi-wall/lib/invariant.js +0 -27
- package/plugin/dsh-client-ui-multi-wall/package.json +0 -88
- /package/{plugin/dsh-client-ui-multi-wall/lib → lib}/types/client/WallToggle.d.ts +0 -0
- /package/{plugin/dsh-client-ui-multi-wall/lib → lib}/types/client/WallView.d.ts +0 -0
- /package/{plugin/dsh-client-ui-multi-wall/lib → lib}/types/client/index.d.ts +0 -0
- /package/{plugin/dsh-client-ui-multi-wall/lib → lib}/types/client/locales.d.ts +0 -0
- /package/{plugin/dsh-client-ui-multi-wall/lib → lib}/types/client/store.d.ts +0 -0
- /package/{plugin/dsh-client-ui-multi-wall/lib → lib}/types/client/wall-injected.d.ts +0 -0
|
@@ -1,81 +1,81 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Multi-window wall plugin, node half: registers the `/multi/api/*` routes
|
|
3
|
-
* on the webserver. The browser half fetches these same-origin to discover
|
|
4
|
-
* which local ports are live DSH instances, to poll liveness, and to
|
|
5
|
-
* terminate a chosen instance (`/multi/api/stop`). The wall itself is pure
|
|
6
|
-
* UI — this half answers a few small JSON requests.
|
|
7
|
-
* @module
|
|
8
|
-
*/
|
|
9
|
-
import type { Context } from '@deepseek-ai/cordis';
|
|
10
|
-
import z from '@deepseek-ai/schemastery';
|
|
11
|
-
/** Stable Cordis plugin name. */
|
|
12
|
-
export declare const name = "
|
|
13
|
-
/** Services required before the probe routes can be registered. */
|
|
14
|
-
export declare const inject: string[];
|
|
15
|
-
/** Plugin config: the wall's auto-discovery scan range. */
|
|
16
|
-
export interface MultiWallConfig {
|
|
17
|
-
/** First port of the auto-discovery range. */
|
|
18
|
-
scanFrom?: number;
|
|
19
|
-
/** Last port of the auto-discovery range. */
|
|
20
|
-
scanTo?: number;
|
|
21
|
-
/** Optional fixed port list; when set, discovery ignores the scan range. */
|
|
22
|
-
ports?: number[];
|
|
23
|
-
/**
|
|
24
|
-
* External base URL reported by `/multi/api/link` (e.g. the authenticated
|
|
25
|
-
* gateway in front of this loopback instance). When set, the link route
|
|
26
|
-
* answers `{ lan: [publicUrl + '/'], reachable: true }`.
|
|
27
|
-
*/
|
|
28
|
-
publicUrl?: string;
|
|
29
|
-
/**
|
|
30
|
-
* Gateway listen port for the inline phone-access gateway. `0` (default)
|
|
31
|
-
* means `targetPort + 5000`.
|
|
32
|
-
*/
|
|
33
|
-
gatewayPort?: number;
|
|
34
|
-
/**
|
|
35
|
-
* Optional fixed login token for the inline gateway. Empty (default) means
|
|
36
|
-
* a random token is generated per gateway start (returned by /multi/api/link).
|
|
37
|
-
*/
|
|
38
|
-
gatewayToken?: string;
|
|
39
|
-
}
|
|
40
|
-
/** Schema-validated config (the Loader resolves defaults for absent keys). */
|
|
41
|
-
export declare const Config: z<Schemastery.ObjectS<{
|
|
42
|
-
scanFrom: z<number, number>;
|
|
43
|
-
scanTo: z<number, number>;
|
|
44
|
-
ports: z<number[], number[]>;
|
|
45
|
-
publicUrl: z<string, string>;
|
|
46
|
-
gatewayPort: z<number, number>;
|
|
47
|
-
gatewayToken: z<string, string>;
|
|
48
|
-
}>, Schemastery.ObjectT<{
|
|
49
|
-
scanFrom: z<number, number>;
|
|
50
|
-
scanTo: z<number, number>;
|
|
51
|
-
ports: z<number[], number[]>;
|
|
52
|
-
publicUrl: z<string, string>;
|
|
53
|
-
gatewayPort: z<number, number>;
|
|
54
|
-
gatewayToken: z<string, string>;
|
|
55
|
-
}>>;
|
|
56
|
-
/** One stop result row from /multi/api/stop. */
|
|
57
|
-
export interface StopRow {
|
|
58
|
-
port: number;
|
|
59
|
-
ok: boolean;
|
|
60
|
-
/** Human-readable failure reason (absent on success). */
|
|
61
|
-
error?: string;
|
|
62
|
-
}
|
|
63
|
-
/**
|
|
64
|
-
* Terminate the DSH instance listening on one local port. The port serving
|
|
65
|
-
* this wall may also be terminated (the user may want to stop the instance
|
|
66
|
-
* they are viewing): the kill is deferred a beat so the HTTP response is
|
|
67
|
-
* written before the process dies, then the listener's PIDs are force-killed.
|
|
68
|
-
* @param port - the target port.
|
|
69
|
-
* @param selfPort - this instance's own listening port.
|
|
70
|
-
* @returns the stop result.
|
|
71
|
-
*/
|
|
72
|
-
export declare function stopPort(port: number, selfPort: number): Promise<StopRow>;
|
|
73
|
-
/**
|
|
74
|
-
* Register the probe routes. Everything lives under `/multi/api` so the
|
|
75
|
-
* plugin is purely additive: exact `ports` (auto-discovery) and `status`
|
|
76
|
-
* (liveness of a specific port list).
|
|
77
|
-
* @param ctx - plugin context carrying the webServer service.
|
|
78
|
-
* @param config - validated {@link MultiWallConfig}.
|
|
79
|
-
*/
|
|
80
|
-
export declare function apply(ctx: Context, config?: MultiWallConfig): void;
|
|
1
|
+
/**
|
|
2
|
+
* Multi-window wall plugin, node half: registers the `/multi/api/*` routes
|
|
3
|
+
* on the webserver. The browser half fetches these same-origin to discover
|
|
4
|
+
* which local ports are live DSH instances, to poll liveness, and to
|
|
5
|
+
* terminate a chosen instance (`/multi/api/stop`). The wall itself is pure
|
|
6
|
+
* UI — this half answers a few small JSON requests.
|
|
7
|
+
* @module dsh-multi-chat
|
|
8
|
+
*/
|
|
9
|
+
import type { Context } from '@deepseek-ai/cordis';
|
|
10
|
+
import z from '@deepseek-ai/schemastery';
|
|
11
|
+
/** Stable Cordis plugin name. */
|
|
12
|
+
export declare const name = "dsh-multi-chat";
|
|
13
|
+
/** Services required before the probe routes can be registered. */
|
|
14
|
+
export declare const inject: string[];
|
|
15
|
+
/** Plugin config: the wall's auto-discovery scan range. */
|
|
16
|
+
export interface MultiWallConfig {
|
|
17
|
+
/** First port of the auto-discovery range. */
|
|
18
|
+
scanFrom?: number;
|
|
19
|
+
/** Last port of the auto-discovery range. */
|
|
20
|
+
scanTo?: number;
|
|
21
|
+
/** Optional fixed port list; when set, discovery ignores the scan range. */
|
|
22
|
+
ports?: number[];
|
|
23
|
+
/**
|
|
24
|
+
* External base URL reported by `/multi/api/link` (e.g. the authenticated
|
|
25
|
+
* gateway in front of this loopback instance). When set, the link route
|
|
26
|
+
* answers `{ lan: [publicUrl + '/'], reachable: true }`.
|
|
27
|
+
*/
|
|
28
|
+
publicUrl?: string;
|
|
29
|
+
/**
|
|
30
|
+
* Gateway listen port for the inline phone-access gateway. `0` (default)
|
|
31
|
+
* means `targetPort + 5000`.
|
|
32
|
+
*/
|
|
33
|
+
gatewayPort?: number;
|
|
34
|
+
/**
|
|
35
|
+
* Optional fixed login token for the inline gateway. Empty (default) means
|
|
36
|
+
* a random token is generated per gateway start (returned by /multi/api/link).
|
|
37
|
+
*/
|
|
38
|
+
gatewayToken?: string;
|
|
39
|
+
}
|
|
40
|
+
/** Schema-validated config (the Loader resolves defaults for absent keys). */
|
|
41
|
+
export declare const Config: z<Schemastery.ObjectS<{
|
|
42
|
+
scanFrom: z<number, number>;
|
|
43
|
+
scanTo: z<number, number>;
|
|
44
|
+
ports: z<number[], number[]>;
|
|
45
|
+
publicUrl: z<string, string>;
|
|
46
|
+
gatewayPort: z<number, number>;
|
|
47
|
+
gatewayToken: z<string, string>;
|
|
48
|
+
}>, Schemastery.ObjectT<{
|
|
49
|
+
scanFrom: z<number, number>;
|
|
50
|
+
scanTo: z<number, number>;
|
|
51
|
+
ports: z<number[], number[]>;
|
|
52
|
+
publicUrl: z<string, string>;
|
|
53
|
+
gatewayPort: z<number, number>;
|
|
54
|
+
gatewayToken: z<string, string>;
|
|
55
|
+
}>>;
|
|
56
|
+
/** One stop result row from /multi/api/stop. */
|
|
57
|
+
export interface StopRow {
|
|
58
|
+
port: number;
|
|
59
|
+
ok: boolean;
|
|
60
|
+
/** Human-readable failure reason (absent on success). */
|
|
61
|
+
error?: string;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Terminate the DSH instance listening on one local port. The port serving
|
|
65
|
+
* this wall may also be terminated (the user may want to stop the instance
|
|
66
|
+
* they are viewing): the kill is deferred a beat so the HTTP response is
|
|
67
|
+
* written before the process dies, then the listener's PIDs are force-killed.
|
|
68
|
+
* @param port - the target port.
|
|
69
|
+
* @param selfPort - this instance's own listening port.
|
|
70
|
+
* @returns the stop result.
|
|
71
|
+
*/
|
|
72
|
+
export declare function stopPort(port: number, selfPort: number): Promise<StopRow>;
|
|
73
|
+
/**
|
|
74
|
+
* Register the probe routes. Everything lives under `/multi/api` so the
|
|
75
|
+
* plugin is purely additive: exact `ports` (auto-discovery) and `status`
|
|
76
|
+
* (liveness of a specific port list).
|
|
77
|
+
* @param ctx - plugin context carrying the webServer service.
|
|
78
|
+
* @param config - validated {@link MultiWallConfig}.
|
|
79
|
+
*/
|
|
80
|
+
export declare function apply(ctx: Context, config?: MultiWallConfig): void;
|
|
81
81
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAMH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAClD,OAAO,CAAC,MAAM,0BAA0B,CAAA;AAIxC,iCAAiC;AACjC,eAAO,MAAM,IAAI,mBAAmB,CAAA;AAEpC,mEAAmE;AACnE,eAAO,MAAM,MAAM,UAAgB,CAAA;AAEnC,2DAA2D;AAC3D,MAAM,WAAW,eAAe;IAC9B,8CAA8C;IAC9C,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,6CAA6C;IAC7C,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,4EAA4E;IAC5E,KAAK,CAAC,EAAE,MAAM,EAAE,CAAA;IAChB;;;;OAIG;IACH,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,CAAA;CACtB;AAED,8EAA8E;AAC9E,eAAO,MAAM,MAAM;;;;;;;;;;;;;;GAOjB,CAAA;AAkDF,gDAAgD;AAChD,MAAM,WAAW,OAAO;IACtB,IAAI,EAAE,MAAM,CAAA;IACZ,EAAE,EAAE,OAAO,CAAA;IACX,yDAAyD;IACzD,KAAK,CAAC,EAAE,MAAM,CAAA;CACf;AAgED;;;;;;;;GAQG;AACH,wBAAsB,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAiB/E;AAiND;;;;;;GAMG;AACH,wBAAgB,KAAK,CAAC,GAAG,EAAE,OAAO,EAAE,MAAM,GAAE,eAAoB,GAAG,IAAI,CAqMtE"}
|