@rezti/dsh-rez-suite 0.1.36 → 0.1.38

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/lib/index.js CHANGED
@@ -2864,7 +2864,7 @@ function isLegalAssistantRoom(hint) {
2864
2864
  return roomFolderFromPath(hint) === LEGAL_ROOM_FOLDER;
2865
2865
  }
2866
2866
  function isQccToolName(name) {
2867
- return name.startsWith("mcp__qcc-") || name.startsWith("mcp__qcc__");
2867
+ return /^mcp__qcc(?:-|__|_)/.test(name);
2868
2868
  }
2869
2869
  function readCwdFromObject(value) {
2870
2870
  if (typeof value !== "object" || value === null) return void 0;
@@ -2921,9 +2921,14 @@ function mcpToolPrefix(server) {
2921
2921
  }
2922
2922
  /** Count tools whose public name belongs to one composed MCP server. */
2923
2923
  function countMcpTools(toolNames, server) {
2924
- const prefix = mcpToolPrefix(server);
2925
2924
  let count = 0;
2926
- for (const name of toolNames) if (name.startsWith(prefix)) count += 1;
2925
+ for (const name of toolNames) {
2926
+ if (server === "qcc") {
2927
+ if (isQccToolName(name)) count += 1;
2928
+ continue;
2929
+ }
2930
+ if (name.startsWith(mcpToolPrefix(server))) count += 1;
2931
+ }
2927
2932
  return count;
2928
2933
  }
2929
2934
  function listRegisteredToolNames(tools) {
@@ -8271,9 +8276,22 @@ function qccRiskMcpConfig(secret) {
8271
8276
  function mountQccMcp(ctx, start = startMcpWhenSecret) {
8272
8277
  let session;
8273
8278
  let pending = false;
8279
+ let retryTimer;
8280
+ const hasRezSso = () => {
8281
+ const host = ctx;
8282
+ if (typeof host.get !== "function") return true;
8283
+ return host.get("rezSso") !== void 0;
8284
+ };
8274
8285
  const ensure = () => {
8275
8286
  (async () => {
8276
8287
  if (session !== void 0 || pending) return;
8288
+ if (!hasRezSso()) {
8289
+ if (retryTimer === void 0) retryTimer = setTimeout(() => {
8290
+ retryTimer = void 0;
8291
+ ensure();
8292
+ }, 300);
8293
+ return;
8294
+ }
8277
8295
  pending = true;
8278
8296
  try {
8279
8297
  const disposeCompany = await start(ctx, {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@rezti/dsh-rez-suite",
3
3
  "description": "ReZ-TI one-package install for DeepSeek Harness. Update with: dsh plugin --profile web update @rezti/dsh-rez-suite",
4
- "version": "0.1.36",
4
+ "version": "0.1.38",
5
5
  "type": "module",
6
6
  "engines": {
7
7
  "node": "^22.19.0 || >=24.0.0"
@@ -8,7 +8,7 @@
8
8
 
9
9
  import { lastMcpStartError, REZ_CREDENTIAL_REFS, secretConfigured, type RezSystem } from '@rezti/dsh-rez-sso'
10
10
  import type { RezConfig, RezServerStatus, RezTestResult } from './protocol.ts'
11
- import { isLegalAssistantRoom, QCC_STATUS_ROOM_OFF } from './rooms.ts'
11
+ import { isLegalAssistantRoom, isQccToolName, QCC_STATUS_ROOM_OFF } from './rooms.ts'
12
12
 
13
13
  export const COMPOSED_SERVERS = ['odoo', 'nextcloud', 'wechat', 'homeassistant', 'tapd', 'gsc', 'qcc', 'tianyancha'] as const
14
14
 
@@ -21,10 +21,13 @@ export function mcpToolPrefix(server: string): string {
21
21
 
22
22
  /** Count tools whose public name belongs to one composed MCP server. */
23
23
  export function countMcpTools(toolNames: readonly string[], server: string): number {
24
- const prefix = mcpToolPrefix(server)
25
24
  let count = 0
26
25
  for (const name of toolNames) {
27
- if (name.startsWith(prefix)) count += 1
26
+ if (server === 'qcc') {
27
+ if (isQccToolName(name)) count += 1
28
+ continue
29
+ }
30
+ if (name.startsWith(mcpToolPrefix(server))) count += 1
28
31
  }
29
32
  return count
30
33
  }
package/src/qcc.ts CHANGED
@@ -61,10 +61,26 @@ export function mountQccMcp(
61
61
  ): () => void {
62
62
  let session: (() => void) | undefined
63
63
  let pending = false
64
+ let retryTimer: ReturnType<typeof setTimeout> | undefined
65
+
66
+ const hasRezSso = (): boolean => {
67
+ const host = ctx as Context & { get?: (name: string) => unknown }
68
+ if (typeof host.get !== 'function') return true
69
+ return host.get('rezSso') !== undefined
70
+ }
64
71
 
65
72
  const ensure = (): void => {
66
73
  void (async () => {
67
74
  if (session !== undefined || pending) return
75
+ if (!hasRezSso()) {
76
+ if (retryTimer === undefined) {
77
+ retryTimer = setTimeout(() => {
78
+ retryTimer = undefined
79
+ ensure()
80
+ }, 300)
81
+ }
82
+ return
83
+ }
68
84
  pending = true
69
85
  try {
70
86
  const disposeCompany = await start(ctx, {
package/src/rooms.ts CHANGED
@@ -25,7 +25,7 @@ export function isLegalAssistantRoom(hint: string | undefined): boolean {
25
25
  }
26
26
 
27
27
  export function isQccToolName(name: string): boolean {
28
- return name.startsWith('mcp__qcc-') || name.startsWith('mcp__qcc__')
28
+ return /^mcp__qcc(?:-|__|_)/.test(name)
29
29
  }
30
30
 
31
31
  function readCwdFromObject(value: unknown): string | undefined {