@ynhcj/xiaoyi-channel 0.0.122-next → 0.0.123-next
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/dist/src/bot.js
CHANGED
|
@@ -23,7 +23,7 @@ import { logger } from "./utils/logger.js";
|
|
|
23
23
|
export async function handleXYMessage(params) {
|
|
24
24
|
const { cfg, runtime, message, accountId, webSocketSessionId } = params;
|
|
25
25
|
// Cache context for CSPL steer injection (after_tool_call hook)
|
|
26
|
-
setCsplSteerContext(cfg, runtime
|
|
26
|
+
setCsplSteerContext(cfg, runtime);
|
|
27
27
|
// Get runtime (already validated in monitor.ts, but get reference for use)
|
|
28
28
|
const core = getXYRuntime();
|
|
29
29
|
try {
|
|
@@ -1,10 +1,5 @@
|
|
|
1
1
|
import type { ClawdbotConfig, RuntimeEnv } from "openclaw/plugin-sdk";
|
|
2
|
-
export declare function setCsplSteerContext(cfg: ClawdbotConfig, runtime: RuntimeEnv
|
|
3
|
-
export declare function getCsplSteerContext(): {
|
|
4
|
-
cfg: ClawdbotConfig | null;
|
|
5
|
-
runtime: RuntimeEnv | null;
|
|
6
|
-
accountId: string;
|
|
7
|
-
};
|
|
2
|
+
export declare function setCsplSteerContext(cfg: ClawdbotConfig, runtime: RuntimeEnv): void;
|
|
8
3
|
/**
|
|
9
4
|
* Inject a steer message into the given session by constructing a synthetic
|
|
10
5
|
* A2A message and dispatching it through handleXYMessage.
|
|
@@ -3,14 +3,9 @@ import { logger } from "../utils/logger.js";
|
|
|
3
3
|
import { randomUUID } from "node:crypto";
|
|
4
4
|
let cachedCfg = null;
|
|
5
5
|
let cachedRuntime = null;
|
|
6
|
-
|
|
7
|
-
export function setCsplSteerContext(cfg, runtime, accountId) {
|
|
6
|
+
export function setCsplSteerContext(cfg, runtime) {
|
|
8
7
|
cachedCfg = cfg;
|
|
9
8
|
cachedRuntime = runtime;
|
|
10
|
-
cachedAccountId = accountId;
|
|
11
|
-
}
|
|
12
|
-
export function getCsplSteerContext() {
|
|
13
|
-
return { cfg: cachedCfg, runtime: cachedRuntime, accountId: cachedAccountId };
|
|
14
9
|
}
|
|
15
10
|
/**
|
|
16
11
|
* Inject a steer message into the given session by constructing a synthetic
|
|
@@ -41,7 +36,7 @@ export async function injectCsplSteer(sessionId, taskId, message) {
|
|
|
41
36
|
cfg: cachedCfg,
|
|
42
37
|
runtime: cachedRuntime,
|
|
43
38
|
message: syntheticMessage,
|
|
44
|
-
accountId:
|
|
39
|
+
accountId: "default",
|
|
45
40
|
});
|
|
46
41
|
return true;
|
|
47
42
|
}
|