@rezti/dsh-rez-suite 0.1.34 → 0.1.36

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.
Files changed (3) hide show
  1. package/lib/index.js +10 -8
  2. package/package.json +10 -10
  3. package/src/rooms.ts +16 -9
package/lib/index.js CHANGED
@@ -2866,19 +2866,21 @@ function isLegalAssistantRoom(hint) {
2866
2866
  function isQccToolName(name) {
2867
2867
  return name.startsWith("mcp__qcc-") || name.startsWith("mcp__qcc__");
2868
2868
  }
2869
- /** Session cwd from a tool execution. Missing / unknown shapes → undefined. */
2870
- function cwdFromExecution(execution) {
2871
- const agent = execution.agent;
2872
- if (typeof agent !== "object" || agent === null) return void 0;
2873
- const record = agent;
2869
+ function readCwdFromObject(value) {
2870
+ if (typeof value !== "object" || value === null) return void 0;
2871
+ const record = value;
2874
2872
  const session = record.session;
2875
2873
  const header = typeof session === "object" && session !== null ? session.header : void 0;
2876
2874
  const candidates = [
2877
- typeof header === "object" && header !== null ? header.cwd : void 0,
2875
+ record.cwd,
2878
2876
  typeof session === "object" && session !== null ? session.cwd : void 0,
2879
- record.cwd
2877
+ typeof header === "object" && header !== null ? header.cwd : void 0
2880
2878
  ];
2881
- for (const value of candidates) if (typeof value === "string" && value.trim().length > 0) return value;
2879
+ for (const item of candidates) if (typeof item === "string" && item.trim().length > 0) return item;
2880
+ }
2881
+ /** Session cwd from a tool execution. Missing / unknown shapes → undefined. */
2882
+ function cwdFromExecution(execution) {
2883
+ return readCwdFromObject(execution) ?? readCwdFromObject(execution.session) ?? readCwdFromObject(execution.agent);
2882
2884
  }
2883
2885
  /**
2884
2886
  * Official `ctx.tools.guard` reason. Only Qichacha tools are gated.
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.34",
4
+ "version": "0.1.36",
5
5
  "type": "module",
6
6
  "engines": {
7
7
  "node": "^22.19.0 || >=24.0.0"
@@ -37,15 +37,15 @@
37
37
  }
38
38
  },
39
39
  "dependencies": {
40
- "@rezti/dsh-rez-gsc": "workspace:*",
41
- "@rezti/dsh-rez-ha-bridge": "workspace:*",
42
- "@rezti/dsh-rez-intent": "workspace:*",
43
- "@rezti/dsh-rez-nextcloud": "workspace:*",
44
- "@rezti/dsh-rez-odoo": "workspace:*",
45
- "@rezti/dsh-rez-sso": "workspace:*",
46
- "@rezti/dsh-rez-tapd": "workspace:*",
47
- "@rezti/dsh-rez-token-manager": "workspace:*",
48
- "@rezti/dsh-rez-wechat": "workspace:*",
40
+ "@rezti/dsh-rez-gsc": "^0.1.1",
41
+ "@rezti/dsh-rez-ha-bridge": "^0.1.9",
42
+ "@rezti/dsh-rez-intent": "^0.1.5",
43
+ "@rezti/dsh-rez-nextcloud": "^0.1.9",
44
+ "@rezti/dsh-rez-odoo": "^0.1.9",
45
+ "@rezti/dsh-rez-sso": "^0.1.11",
46
+ "@rezti/dsh-rez-tapd": "^0.1.1",
47
+ "@rezti/dsh-rez-token-manager": "^0.1.4",
48
+ "@rezti/dsh-rez-wechat": "^0.1.14",
49
49
  "@modelcontextprotocol/sdk": "^1.30.0",
50
50
  "zod": "^4.4.3"
51
51
  },
package/src/rooms.ts CHANGED
@@ -28,26 +28,33 @@ export function isQccToolName(name: string): boolean {
28
28
  return name.startsWith('mcp__qcc-') || name.startsWith('mcp__qcc__')
29
29
  }
30
30
 
31
- /** Session cwd from a tool execution. Missing / unknown shapes undefined. */
32
- export function cwdFromExecution(execution: { agent?: unknown }): string | undefined {
33
- const agent = execution.agent
34
- if (typeof agent !== 'object' || agent === null) return undefined
35
- const record = agent as Record<string, unknown>
31
+ function readCwdFromObject(value: unknown): string | undefined {
32
+ if (typeof value !== 'object' || value === null) return undefined
33
+ const record = value as Record<string, unknown>
36
34
  const session = record.session
37
35
  const header = typeof session === 'object' && session !== null
38
36
  ? (session as Record<string, unknown>).header
39
37
  : undefined
40
38
  const candidates = [
41
- typeof header === 'object' && header !== null ? (header as Record<string, unknown>).cwd : undefined,
42
- typeof session === 'object' && session !== null ? (session as Record<string, unknown>).cwd : undefined,
43
39
  record.cwd,
40
+ typeof session === 'object' && session !== null ? (session as Record<string, unknown>).cwd : undefined,
41
+ typeof header === 'object' && header !== null ? (header as Record<string, unknown>).cwd : undefined,
44
42
  ]
45
- for (const value of candidates) {
46
- if (typeof value === 'string' && value.trim().length > 0) return value
43
+ for (const item of candidates) {
44
+ if (typeof item === 'string' && item.trim().length > 0) return item
47
45
  }
48
46
  return undefined
49
47
  }
50
48
 
49
+ /** Session cwd from a tool execution. Missing / unknown shapes → undefined. */
50
+ export function cwdFromExecution(execution: { agent?: unknown; session?: unknown; cwd?: unknown }): string | undefined {
51
+ return (
52
+ readCwdFromObject(execution)
53
+ ?? readCwdFromObject(execution.session)
54
+ ?? readCwdFromObject(execution.agent)
55
+ )
56
+ }
57
+
51
58
  /**
52
59
  * Official `ctx.tools.guard` reason. Only Qichacha tools are gated.
53
60
  * Must never throw: this guard is global and a throw would block WeChat turns.