@rezti/dsh-rez-suite 0.1.4 → 0.1.6
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 +1 -1
- package/README.zh.md +1 -1
- package/lib/client.d.ts +29 -155
- package/lib/client.js +365 -468
- package/lib/index.d.ts +20 -0
- package/lib/index.js +92 -13
- package/lib/style.css +82 -111
- package/package.json +9 -7
- package/src/client/index.ts +33 -21
- package/src/client/locales.ts +25 -7
- package/src/client/panel/AuditTab.tsx +6 -6
- package/src/client/panel/ConfigTab.tsx +141 -86
- package/src/client/panel/panel.module.css +89 -118
- package/src/client/settings-card.tsx +68 -0
- package/src/index.ts +37 -11
- package/src/protocol.ts +23 -0
- package/src/routes.ts +32 -4
- package/src/store.ts +37 -1
- package/src/client/mount.tsx +0 -97
- package/src/client/panel/RezPanel.tsx +0 -53
- package/src/client/panel/controller.ts +0 -42
- package/src/client/sidebar-entry.ts +0 -80
package/README.md
CHANGED
|
@@ -8,4 +8,4 @@ dsh plugin --profile web add @rezti/dsh-rez-suite
|
|
|
8
8
|
|
|
9
9
|
组成见仓库根 README。子包不要单独 `dsh plugin add`。
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
配置在 **设置 → 插件 → 插件配置** 展开 **ReZ-TI**(同页还有独立的 ReZ-TI 标签)。Odoo / Nextcloud / WeCom / HA 的地址和密钥都在「配置」页。个人微信在卡片的「微信」页扫码,然后直接在微信里说话。
|
package/README.zh.md
CHANGED
|
@@ -8,6 +8,6 @@ dsh plugin --profile web add @rezti/dsh-rez-suite
|
|
|
8
8
|
|
|
9
9
|
密钥用环境变量或 dsh-credentials:`REZ_ODOO_TOKEN`、`REZ_NEXTCLOUD_PASSWORD`、`REZ_WECHAT_WEBHOOK`、`REZ_HA_TOKEN`。未配置时不拉起对应 MCP。
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
配置在 **设置 → 插件 → 插件配置** 展开 **ReZ-TI**(同页还有独立的 ReZ-TI 标签)。Odoo / Nextcloud / 企微 / HA 的地址和密钥都在「配置」页。个人微信在卡片的「微信」页扫码,然后直接在微信里说话。
|
|
12
12
|
|
|
13
13
|
子包不要再单独 `dsh plugin add`,否则会重复注册 MCP。
|
package/lib/client.d.ts
CHANGED
|
@@ -7254,6 +7254,8 @@ declare module '@deepseek-ai/cordis' {
|
|
|
7254
7254
|
declare const zh: {
|
|
7255
7255
|
readonly 'entry.label': "Rez";
|
|
7256
7256
|
readonly 'entry.tooltip': "Rez Suite 配置与审计面板";
|
|
7257
|
+
readonly 'settings.title': "ReZ-TI";
|
|
7258
|
+
readonly 'settings.description': "公司 MCP(Odoo / Nextcloud / 企微 / HA)与个人微信扫码通道。";
|
|
7257
7259
|
readonly 'panel.title': "Rez Suite";
|
|
7258
7260
|
readonly 'tab.config': "配置";
|
|
7259
7261
|
readonly 'tab.weixin': "微信";
|
|
@@ -7273,16 +7275,23 @@ declare const zh: {
|
|
|
7273
7275
|
readonly 'config.env': "环境变量 (JSON)";
|
|
7274
7276
|
readonly 'config.headers': "Headers (JSON)";
|
|
7275
7277
|
readonly 'config.jsonInvalid': "JSON 格式错误:{error}";
|
|
7278
|
+
readonly 'config.mcpHint': "四个公司 MCP 在这里配。密钥写入 ~/.dsh/.credentials.yaml(REZ_*)。新填的密钥会立刻拉起连接;改 URL 后如果已经连上,需要重启 dsh web。";
|
|
7279
|
+
readonly 'config.secretConfigured': "已配置(留空则保持)";
|
|
7280
|
+
readonly 'config.secretMissing': "未配置";
|
|
7276
7281
|
readonly 'config.odoo': "Odoo";
|
|
7277
|
-
readonly 'config.odoo.url': "Odoo URL";
|
|
7278
|
-
readonly 'config.odoo.apiKey': "API
|
|
7282
|
+
readonly 'config.odoo.url': "Odoo MCP URL";
|
|
7283
|
+
readonly 'config.odoo.apiKey': "API Token";
|
|
7279
7284
|
readonly 'config.nextcloud': "Nextcloud";
|
|
7280
|
-
readonly 'config.nextcloud.url': "Nextcloud
|
|
7285
|
+
readonly 'config.nextcloud.url': "Nextcloud 主机";
|
|
7281
7286
|
readonly 'config.nextcloud.username': "用户名";
|
|
7282
7287
|
readonly 'config.nextcloud.appPassword': "App Password";
|
|
7283
7288
|
readonly 'config.wecom': "企业微信";
|
|
7284
7289
|
readonly 'config.wecom.botId': "Bot ID";
|
|
7285
7290
|
readonly 'config.wecom.secret': "Secret";
|
|
7291
|
+
readonly 'config.wecom.webhook': "群机器人 Webhook";
|
|
7292
|
+
readonly 'config.ha': "Home Assistant";
|
|
7293
|
+
readonly 'config.ha.url': "HA MCP URL";
|
|
7294
|
+
readonly 'config.ha.token': "长期访问令牌";
|
|
7286
7295
|
readonly 'config.fs': "本地文件 (fs-mcp-server)";
|
|
7287
7296
|
readonly 'config.fs.root': "根目录";
|
|
7288
7297
|
readonly 'config.sqlite': "SQLite (sqlite-mcp-server)";
|
|
@@ -7340,164 +7349,29 @@ declare const zh: {
|
|
|
7340
7349
|
};
|
|
7341
7350
|
type RezKey = keyof typeof zh;
|
|
7342
7351
|
//#endregion
|
|
7343
|
-
//#region src/client/panel/controller.d.ts
|
|
7344
|
-
/**
|
|
7345
|
-
* Rez panel controller: single owner of open/closed state (browser session).
|
|
7346
|
-
*/
|
|
7347
|
-
interface PanelControllerSnapshot {
|
|
7348
|
-
panelOpen: boolean;
|
|
7349
|
-
}
|
|
7350
|
-
declare class PanelController {
|
|
7351
|
-
private panelOpen;
|
|
7352
|
-
private listeners;
|
|
7353
|
-
getSnapshot(): PanelControllerSnapshot;
|
|
7354
|
-
subscribe(fn: () => void): () => void;
|
|
7355
|
-
open(): void;
|
|
7356
|
-
close(): void;
|
|
7357
|
-
toggle(): void;
|
|
7358
|
-
private notify;
|
|
7359
|
-
}
|
|
7360
|
-
//#endregion
|
|
7361
|
-
//#region src/protocol.d.ts
|
|
7362
|
-
/**
|
|
7363
|
-
* Wire contract between the host half (routes.ts / mcp-host.ts) and the
|
|
7364
|
-
* browser half (client/api.ts). Pure types only — imported by both halves,
|
|
7365
|
-
* bundled into each, no runtime identity to share.
|
|
7366
|
-
*/
|
|
7367
|
-
/** MCP server id: arbitrary stable key, e.g. "odoo", "homeassistant". */
|
|
7368
|
-
type RezServerId = string;
|
|
7369
|
-
/** Agent role, the preset-loader key. */
|
|
7370
|
-
type RezRoleId = 'engineer' | 'sales' | 'operations' | 'all';
|
|
7371
|
-
/** Transport kinds the in-plugin MCP host can connect. */
|
|
7372
|
-
type RezMcpTransport = 'stdio' | 'streamable-http';
|
|
7373
|
-
/** One MCP server launch descriptor (standard MCP-style config). */
|
|
7374
|
-
interface RezMcpServerSpec {
|
|
7375
|
-
/** Master switch for this server. */
|
|
7376
|
-
enabled: boolean;
|
|
7377
|
-
/** stdio or streamable-http. */
|
|
7378
|
-
transport: RezMcpTransport;
|
|
7379
|
-
/** stdio executable (npx, uvx, node, absolute binary, ...). */
|
|
7380
|
-
command?: string;
|
|
7381
|
-
/** stdio args passed without shell interpolation. */
|
|
7382
|
-
args?: string[];
|
|
7383
|
-
/** stdio env merged over the scrubbed parent env. */
|
|
7384
|
-
env?: Record<string, string>;
|
|
7385
|
-
/** stdio working directory. */
|
|
7386
|
-
cwd?: string;
|
|
7387
|
-
/** streamable-http endpoint URL. */
|
|
7388
|
-
url?: string;
|
|
7389
|
-
/** streamable-http request headers (Authorization, ...). */
|
|
7390
|
-
headers?: Record<string, string>;
|
|
7391
|
-
/** Per-tool-call timeout in milliseconds. */
|
|
7392
|
-
toolCallTimeoutMs?: number;
|
|
7393
|
-
}
|
|
7394
|
-
/** One server entry projected for the browser (secret values masked). */
|
|
7395
|
-
type RezPublicServer = RezMcpServerSpec;
|
|
7396
|
-
/** Config projection safe for the browser (env/header values replaced by masks). */
|
|
7397
|
-
interface RezPublicConfig {
|
|
7398
|
-
enabled: boolean;
|
|
7399
|
-
role: RezRoleId;
|
|
7400
|
-
servers: Record<string, RezPublicServer>;
|
|
7401
|
-
billing: {
|
|
7402
|
-
inputCostPer1k: number;
|
|
7403
|
-
outputCostPer1k: number;
|
|
7404
|
-
monthlyBudget: number;
|
|
7405
|
-
};
|
|
7406
|
-
}
|
|
7407
|
-
/** One connectivity test outcome for one MCP server. */
|
|
7408
|
-
interface RezTestResult {
|
|
7409
|
-
server: RezServerId;
|
|
7410
|
-
ok: boolean;
|
|
7411
|
-
/** Connected, discovered tools, then closed. */
|
|
7412
|
-
toolCount?: number;
|
|
7413
|
-
/** Server-reported name/version when available. */
|
|
7414
|
-
serverInfo?: string;
|
|
7415
|
-
latencyMs?: number;
|
|
7416
|
-
error?: string;
|
|
7417
|
-
}
|
|
7418
|
-
/** Live status of one MCP server slot. */
|
|
7419
|
-
interface RezServerStatus {
|
|
7420
|
-
server: RezServerId;
|
|
7421
|
-
enabled: boolean;
|
|
7422
|
-
state: 'disconnected' | 'connecting' | 'connected' | 'failed';
|
|
7423
|
-
toolCount: number;
|
|
7424
|
-
registeredTools: number;
|
|
7425
|
-
lastError?: string;
|
|
7426
|
-
startedAt?: number;
|
|
7427
|
-
}
|
|
7428
|
-
/** Complete /api/dsh-rez-suite/status response. */
|
|
7429
|
-
interface RezStatusResponse {
|
|
7430
|
-
role: RezRoleId;
|
|
7431
|
-
servers: RezServerStatus[];
|
|
7432
|
-
totalRegisteredTools: number;
|
|
7433
|
-
}
|
|
7434
|
-
/** QClaw-style WeChat channel status (scan QR, then talk in WeChat). */
|
|
7435
|
-
type RezWeixinPhase = 'idle' | 'login' | 'need_verify' | 'listening' | 'error';
|
|
7436
|
-
interface RezWeixinStatus {
|
|
7437
|
-
loggedIn: boolean;
|
|
7438
|
-
listening: boolean;
|
|
7439
|
-
phase: RezWeixinPhase;
|
|
7440
|
-
qrContent?: string;
|
|
7441
|
-
qrDataUrl?: string;
|
|
7442
|
-
hint: string;
|
|
7443
|
-
}
|
|
7444
|
-
/** One audit ledger row. */
|
|
7445
|
-
interface RezAuditRecord {
|
|
7446
|
-
id: number;
|
|
7447
|
-
ts: number;
|
|
7448
|
-
server: string;
|
|
7449
|
-
tool: string;
|
|
7450
|
-
role: string;
|
|
7451
|
-
inputTokens: number;
|
|
7452
|
-
outputTokens: number;
|
|
7453
|
-
cost: number;
|
|
7454
|
-
durationMs: number;
|
|
7455
|
-
ok: boolean;
|
|
7456
|
-
error?: string;
|
|
7457
|
-
}
|
|
7458
|
-
/** /api/dsh-rez-suite/audit response. */
|
|
7459
|
-
interface RezAuditResponse {
|
|
7460
|
-
totalCalls: number;
|
|
7461
|
-
totalInputTokens: number;
|
|
7462
|
-
totalOutputTokens: number;
|
|
7463
|
-
totalCost: number;
|
|
7464
|
-
monthlyBudget: number;
|
|
7465
|
-
monthCost: number;
|
|
7466
|
-
byServer: Record<string, {
|
|
7467
|
-
calls: number;
|
|
7468
|
-
tokens: number;
|
|
7469
|
-
cost: number;
|
|
7470
|
-
}>;
|
|
7471
|
-
recent: RezAuditRecord[];
|
|
7472
|
-
}
|
|
7473
|
-
//#endregion
|
|
7474
|
-
//#region src/client/api.d.ts
|
|
7475
|
-
declare class RezApi {
|
|
7476
|
-
getConfig(): Promise<RezPublicConfig>;
|
|
7477
|
-
saveConfig(patch: unknown): Promise<RezPublicConfig>;
|
|
7478
|
-
test(): Promise<RezTestResult[]>;
|
|
7479
|
-
status(): Promise<RezStatusResponse>;
|
|
7480
|
-
audit(): Promise<RezAuditResponse>;
|
|
7481
|
-
resetAudit(): Promise<void>;
|
|
7482
|
-
weixinStatus(): Promise<RezWeixinStatus>;
|
|
7483
|
-
weixinLogin(): Promise<RezWeixinStatus>;
|
|
7484
|
-
weixinVerify(code: string): Promise<RezWeixinStatus>;
|
|
7485
|
-
weixinLogout(): Promise<RezWeixinStatus>;
|
|
7486
|
-
}
|
|
7487
|
-
//#endregion
|
|
7488
|
-
//#region src/client/panel/RezPanel.d.ts
|
|
7489
|
-
interface RezPanelProps {
|
|
7490
|
-
controller: PanelController;
|
|
7491
|
-
api: RezApi;
|
|
7492
|
-
}
|
|
7493
|
-
//#endregion
|
|
7494
7352
|
//#region src/client/index.d.ts
|
|
7495
7353
|
declare module '@deepseek-ai/dsh-client-ui-slots' {
|
|
7496
7354
|
interface LocaleNamespaceMap {
|
|
7497
7355
|
'dsh-rez-suite': RezKey;
|
|
7498
7356
|
}
|
|
7357
|
+
interface SlotMap {
|
|
7358
|
+
'settings.plugin.item': {
|
|
7359
|
+
kind: 'list';
|
|
7360
|
+
scope: 'root';
|
|
7361
|
+
owner: {
|
|
7362
|
+
children?: never;
|
|
7363
|
+
};
|
|
7364
|
+
};
|
|
7365
|
+
'settings.plugins.tab': {
|
|
7366
|
+
kind: 'list';
|
|
7367
|
+
scope: 'root';
|
|
7368
|
+
owner: {
|
|
7369
|
+
children?: never;
|
|
7370
|
+
};
|
|
7371
|
+
};
|
|
7372
|
+
}
|
|
7499
7373
|
}
|
|
7500
7374
|
declare const inject: string[];
|
|
7501
7375
|
declare function apply(ctx: ClientContext): void;
|
|
7502
7376
|
//#endregion
|
|
7503
|
-
export { type
|
|
7377
|
+
export { type RezKey, apply, inject };
|