@jiyr0119/dsh-service-console 0.6.0 → 0.7.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/dsh.plugin.json +1 -1
- package/lib/client/i18n.js +59 -0
- package/lib/client.js +391 -165
- package/lib/host/config.js +19 -5
- package/lib/host/lifecycle.js +1 -0
- package/lib/host/process-inspector.js +2 -1
- package/lib/host/protection.js +41 -0
- package/lib/host/service-registry.js +14 -5
- package/lib/host/service-tool.js +158 -0
- package/lib/index.js +59 -28
- package/lib/types/client/ServiceConsole.d.ts +18 -8
- package/lib/types/client/dictionaries.d.ts +153 -2
- package/lib/types/client/i18n.d.ts +30 -0
- package/lib/types/client/index.d.ts +26 -7
- package/lib/types/host/config.d.ts +1 -0
- package/lib/types/host/process-inspector.d.ts +2 -0
- package/lib/types/host/protection.d.ts +21 -0
- package/lib/types/host/service-registry.d.ts +2 -1
- package/lib/types/host/service-tool.d.ts +6 -0
- package/lib/types/host/types.d.ts +2 -0
- package/manifest.json +1 -1
- package/package.json +6 -1
|
@@ -1,12 +1,31 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
/**
|
|
2
|
+
* dsh-service-console — Client 入口(原生包 v2)
|
|
3
|
+
*
|
|
4
|
+
* 架构对齐 dsh-workspace-explorer:
|
|
5
|
+
* - 通过 locale.register + locale.bind 实现国际化(词典键编译期校验)
|
|
6
|
+
* - 通过 webServer JSON 路由调用 Host(fetch 直连,不走 host.call / LLM)
|
|
7
|
+
* - 注册 DSH 设置壳的 settings.section 页
|
|
8
|
+
* - 注册 shell.overlay 抽屉面板 + header 入口按钮
|
|
9
|
+
*
|
|
10
|
+
* 类型化(P0-5):ctx 来自 @deepseek-ai/cordis,ctx.slots / ctx.locale /
|
|
11
|
+
* SlotMap 键均由平台类型包增广;平台包仅 type-only 导入,构建时擦除。
|
|
12
|
+
*/
|
|
13
|
+
import type { Context } from '@deepseek-ai/cordis';
|
|
14
|
+
import { type ConsoleKey } from './dictionaries';
|
|
15
|
+
declare module '@deepseek-ai/dsh-client-ui-slots' {
|
|
16
|
+
interface LocaleNamespaceMap {
|
|
17
|
+
'dsh-service-console': ConsoleKey;
|
|
18
|
+
}
|
|
7
19
|
}
|
|
20
|
+
/** cordis-plugin-timer 未随本包安装类型;客户端只用 timeout 一种能力,结构化声明 */
|
|
21
|
+
interface TimerLike {
|
|
22
|
+
timeout(callback: () => void, delay: number): () => void;
|
|
23
|
+
}
|
|
24
|
+
type ClientContext = Context & {
|
|
25
|
+
timer: TimerLike;
|
|
26
|
+
};
|
|
8
27
|
declare const _default: {
|
|
9
28
|
inject: string[];
|
|
10
|
-
apply(ctx:
|
|
29
|
+
apply(ctx: ClientContext): void;
|
|
11
30
|
};
|
|
12
31
|
export default _default;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { Config } from './types';
|
|
2
2
|
export declare const DEFAULT_CONFIG: Config;
|
|
3
|
+
export declare const REFRESH_INTERVAL_CHOICES: readonly number[];
|
|
3
4
|
export declare const CONFIG_LIMITS: Record<string, [number, number]>;
|
|
4
5
|
export declare function loadConfigFromFile(): Config;
|
|
5
6
|
export declare function saveConfigToFile(config: Config): void;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export interface ProtectionGuard {
|
|
2
|
+
/** 不可停止的端口(如 ctx.webServer.port —— 停掉它会断开当前 DSH 界面) */
|
|
3
|
+
protectedPorts?: readonly number[];
|
|
4
|
+
/** 不可停止的 PID(如插件所在宿主进程 process.pid) */
|
|
5
|
+
protectedPids?: readonly number[];
|
|
6
|
+
}
|
|
7
|
+
export interface ProtectionTarget {
|
|
8
|
+
pid: number;
|
|
9
|
+
name?: string | null;
|
|
10
|
+
command?: string | null;
|
|
11
|
+
cwd?: string | null;
|
|
12
|
+
listeners: readonly {
|
|
13
|
+
port: number;
|
|
14
|
+
user?: string | null;
|
|
15
|
+
}[];
|
|
16
|
+
}
|
|
17
|
+
export interface ProtectionResult {
|
|
18
|
+
protected: boolean;
|
|
19
|
+
evidence: string[];
|
|
20
|
+
}
|
|
21
|
+
export declare function classifyProtection(proc: ProtectionTarget, guard?: ProtectionGuard): ProtectionResult;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import type { LedgerEntry, Snapshot, WorkspaceLike } from './types';
|
|
2
2
|
import { type CommandRunner } from './process-inspector';
|
|
3
|
-
|
|
3
|
+
import { type ProtectionGuard } from './protection';
|
|
4
|
+
export declare function buildSnapshot(ledgers: LedgerEntry[], workspaces: WorkspaceLike[], commandRunner?: CommandRunner, guard?: ProtectionGuard): Promise<Snapshot>;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { Snapshot } from './types';
|
|
2
|
+
export interface ServiceToolDeps {
|
|
3
|
+
/** 与 API scan 路由同源的快照函数(含受保护判定 guard) */
|
|
4
|
+
snapshot(): Promise<Snapshot>;
|
|
5
|
+
}
|
|
6
|
+
export declare function buildServiceTool(deps: ServiceToolDeps): import("@deepseek-ai/dsh-tools").ToolDefinition;
|
package/manifest.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jiyr0119/dsh-service-console",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.1",
|
|
4
4
|
"description": "DeepSeek Harness 本地开发服务控制台(原生插件):发现监听端口,识别服务归属,安全查看/停止/重启。Local development service console for DSH.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -80,8 +80,13 @@
|
|
|
80
80
|
"@deepseek-ai/cordis": "~4.0.4",
|
|
81
81
|
"@deepseek-ai/dsh-client-locale": "^0.2.0-rc.2",
|
|
82
82
|
"@deepseek-ai/dsh-client-ui-conversation": "^0.2.0-rc.2",
|
|
83
|
+
"@deepseek-ai/dsh-client-ui-layout": "^0.2.0-rc.2",
|
|
84
|
+
"@deepseek-ai/dsh-client-ui-primitives": "^0.2.0-rc.2",
|
|
85
|
+
"@deepseek-ai/dsh-client-ui-renderer": "^0.2.0-rc.2",
|
|
86
|
+
"@deepseek-ai/dsh-client-ui-settings": "^0.2.0-rc.2",
|
|
83
87
|
"@deepseek-ai/dsh-client-ui-slots": "^0.2.0-rc.2",
|
|
84
88
|
"@deepseek-ai/dsh-host-webserver": "^0.2.0-rc.2",
|
|
89
|
+
"@deepseek-ai/dsh-tools": "^0.2.0-rc.2",
|
|
85
90
|
"@types/node": "^22.0.0",
|
|
86
91
|
"@types/react": "^18.3.1",
|
|
87
92
|
"cordis": "^4.0.0-rc.7",
|