@jiyr0119/dsh-service-console 0.2.2 → 0.3.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.
@@ -20,7 +20,6 @@ async function stopService(deps, serviceId, mode) {
20
20
  const svc = (await deps.buildSnapshot()).services.find((x) => x.id === serviceId);
21
21
  if (!svc) return err("TARGET_GONE", "该服务已结束,列表已刷新");
22
22
  if (svc.protected) return err("PROTECTED_PROCESS", "该进程受保护,不能通过 Service Console 操作");
23
- if (svc.ownership === "unknown") return err("UNKNOWN_OWNERSHIP", "无法确认服务来源,默认不允许控制");
24
23
  const target = svc.processGroupId ? "-" + svc.processGroupId : String(svc.pid);
25
24
  await (deps.commandRunner || runCommand)("kill -TERM " + target, 3e3);
26
25
  const deadline = Date.now() + (deps.config.gracefulTimeout || 3e3);
@@ -1,14 +1,25 @@
1
+ /**
2
+ * dsh-service-console — 面板组件(原生包 v2)
3
+ *
4
+ * 架构对齐 dsh-workspace-explorer:
5
+ * - i18n: 通过 locale.bind(NS) 获取翻译函数(而非硬编码 TEXTS)
6
+ * - API: 通过 fetch 直连 webServer JSON 路由(不走 host.call / LLM)
7
+ * - UI: 抽屉式面板 + Tab 栏(服务 / 设置),对标 workspace-explorer 视觉风格
8
+ */
1
9
  import * as React from 'react';
2
10
  interface TimerLike {
3
11
  timeout(callback: () => void, delay: number): () => void;
4
12
  }
5
- export declare function bindTimer(t: TimerLike): void;
6
- export declare function bindLocale(locale: {
7
- getLocale: () => {
13
+ interface LocaleLike {
14
+ getLocale(): {
8
15
  id?: string;
9
16
  };
10
- subscribe: (fn: () => void) => () => void;
11
- }): void;
17
+ subscribe(fn: () => void): () => void;
18
+ bind(ns: string): (key: string, vars?: Record<string, string | number>) => string;
19
+ }
20
+ export declare function bindTimer(t: TimerLike): void;
21
+ export declare function bindLocale(locale: LocaleLike): void;
12
22
  export declare function ServiceConsoleEntry(): React.ReactElement;
23
+ export declare function ServiceConsoleSettings(): React.ReactElement;
13
24
  export declare function ServiceConsolePanel(): React.ReactElement | null;
14
25
  export {};
@@ -0,0 +1,6 @@
1
+ /**
2
+ * dsh-service-console — i18n 词典(对齐 DSH locale.register 机制)
3
+ * 与 dsh-workspace-explorer 共享设计语言:flat key → template string with {vars}
4
+ */
5
+ export declare const ZH_DICT: Record<string, string>;
6
+ export declare const EN_DICT: Record<string, string>;
@@ -1,10 +1,12 @@
1
+ interface CtxLike {
2
+ get(name: string): unknown;
3
+ effect(fn: () => () => void): void;
4
+ timer: {
5
+ timeout(cb: () => void, ms: number): () => void;
6
+ };
7
+ }
1
8
  declare const _default: {
2
9
  inject: string[];
3
- apply(ctx: {
4
- get(name: string): unknown;
5
- timer: {
6
- timeout(cb: () => void, ms: number): () => void;
7
- };
8
- }): void;
10
+ apply(ctx: CtxLike): void;
9
11
  };
10
12
  export default _default;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jiyr0119/dsh-service-console",
3
- "version": "0.2.2",
3
+ "version": "0.3.1",
4
4
  "description": "DeepSeek Harness 本地开发服务控制台(原生插件):发现监听端口,识别服务归属,安全查看/停止/重启。Local development service console for DSH.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -39,6 +39,7 @@
39
39
  "dynamic",
40
40
  "docs",
41
41
  "assets",
42
+ "demo",
42
43
  "README.md",
43
44
  "README.zh.md",
44
45
  "LICENSE",