@rezti/dsh-rez-suite 0.1.35 → 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.
- package/lib/index.js +10 -8
- package/package.json +1 -1
- 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
|
-
|
|
2870
|
-
|
|
2871
|
-
const
|
|
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
|
-
|
|
2875
|
+
record.cwd,
|
|
2878
2876
|
typeof session === "object" && session !== null ? session.cwd : void 0,
|
|
2879
|
-
|
|
2877
|
+
typeof header === "object" && header !== null ? header.cwd : void 0
|
|
2880
2878
|
];
|
|
2881
|
-
for (const
|
|
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.
|
|
4
|
+
"version": "0.1.36",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"engines": {
|
|
7
7
|
"node": "^22.19.0 || >=24.0.0"
|
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
|
-
|
|
32
|
-
|
|
33
|
-
const
|
|
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
|
|
46
|
-
if (typeof
|
|
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.
|