@rezti/dsh-rez-suite 0.1.4 → 0.1.5
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 +19 -152
- package/lib/client.js +156 -307
- package/lib/index.js +1 -1
- package/lib/style.css +82 -111
- package/package.json +8 -6
- package/src/client/index.ts +33 -21
- package/src/client/locales.ts +4 -0
- package/src/client/panel/AuditTab.tsx +6 -6
- package/src/client/panel/panel.module.css +89 -118
- package/src/client/settings-card.tsx +68 -0
- package/src/index.ts +4 -4
- 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
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 标签)。个人微信在卡片的「微信」页扫码,然后直接在微信里说话。
|
|
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': "微信";
|
|
@@ -7340,164 +7342,29 @@ declare const zh: {
|
|
|
7340
7342
|
};
|
|
7341
7343
|
type RezKey = keyof typeof zh;
|
|
7342
7344
|
//#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
7345
|
//#region src/client/index.d.ts
|
|
7495
7346
|
declare module '@deepseek-ai/dsh-client-ui-slots' {
|
|
7496
7347
|
interface LocaleNamespaceMap {
|
|
7497
7348
|
'dsh-rez-suite': RezKey;
|
|
7498
7349
|
}
|
|
7350
|
+
interface SlotMap {
|
|
7351
|
+
'settings.plugin.item': {
|
|
7352
|
+
kind: 'list';
|
|
7353
|
+
scope: 'root';
|
|
7354
|
+
owner: {
|
|
7355
|
+
children?: never;
|
|
7356
|
+
};
|
|
7357
|
+
};
|
|
7358
|
+
'settings.plugins.tab': {
|
|
7359
|
+
kind: 'list';
|
|
7360
|
+
scope: 'root';
|
|
7361
|
+
owner: {
|
|
7362
|
+
children?: never;
|
|
7363
|
+
};
|
|
7364
|
+
};
|
|
7365
|
+
}
|
|
7499
7366
|
}
|
|
7500
7367
|
declare const inject: string[];
|
|
7501
7368
|
declare function apply(ctx: ClientContext): void;
|
|
7502
7369
|
//#endregion
|
|
7503
|
-
export { type
|
|
7370
|
+
export { type RezKey, apply, inject };
|