@ynhcj/xiaoyi-channel 0.0.123-next → 0.0.124-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/index.js +5 -10
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -25,9 +25,13 @@ function registerFullHooks(api) {
|
|
|
25
25
|
const beforePromptBuildHandler = createBeforePromptBuildHandler(skillRetrieverConfig);
|
|
26
26
|
api.on("before_prompt_build", beforePromptBuildHandler);
|
|
27
27
|
registerSelfEvolutionToolResultNudge(api);
|
|
28
|
+
}
|
|
29
|
+
function registerCsplHook(api) {
|
|
28
30
|
// CSPL security scanning via after_tool_call hook.
|
|
29
31
|
// When CSPL returns REJECT, injects a steer message (with /steer prefix)
|
|
30
32
|
// into the active Pi run to interrupt the agent.
|
|
33
|
+
// Only registered in "full" mode because it depends on handleXYMessage
|
|
34
|
+
// having cached cfg/runtime via setCsplSteerContext.
|
|
31
35
|
api.on("after_tool_call", async (event, ctx) => {
|
|
32
36
|
if (!ALLOWED_TOOLS.includes(event.toolName)) {
|
|
33
37
|
return;
|
|
@@ -85,21 +89,12 @@ export default definePluginEntry({
|
|
|
85
89
|
// Always register the provider so wrapStreamFn/prepareExtraParams work
|
|
86
90
|
// in ALL registration modes (not just "full").
|
|
87
91
|
api.registerProvider(xiaoyiProvider);
|
|
88
|
-
if (api.registrationMode === "cli-metadata") {
|
|
89
|
-
return;
|
|
90
|
-
}
|
|
91
|
-
if (api.registrationMode === "tool-discovery") {
|
|
92
|
-
registerFullHooks(api);
|
|
93
|
-
return;
|
|
94
|
-
}
|
|
95
92
|
// Register channel plugin and set runtime
|
|
96
93
|
api.registerChannel({ plugin: xyPlugin });
|
|
97
94
|
setXYRuntime(api.runtime);
|
|
98
|
-
if (api.registrationMode === "discovery") {
|
|
99
|
-
return;
|
|
100
|
-
}
|
|
101
95
|
if (api.registrationMode === "full") {
|
|
102
96
|
registerFullHooks(api);
|
|
97
|
+
registerCsplHook(api);
|
|
103
98
|
}
|
|
104
99
|
},
|
|
105
100
|
});
|