zenox 1.2.0 → 1.2.2
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/README.md +1 -1
- package/dist/hooks/keyword-detector/index.d.ts +8 -8
- package/dist/index.js +15 -7
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -171,7 +171,7 @@ Zenox checks for updates on startup. When a new version drops:
|
|
|
171
171
|
2. Bun cache is invalidated
|
|
172
172
|
3. Restart to get the update
|
|
173
173
|
|
|
174
|
-
Pin a version to disable: `"zenox@1.2.
|
|
174
|
+
Pin a version to disable: `"zenox@1.2.1"` in your plugins array.
|
|
175
175
|
|
|
176
176
|
## Credits
|
|
177
177
|
|
|
@@ -3,24 +3,24 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Detects special keywords in user messages and:
|
|
5
5
|
* 1. Injects mode-specific context into the message
|
|
6
|
-
* 2.
|
|
7
|
-
*
|
|
6
|
+
* 2. Shows toast notification for user feedback
|
|
7
|
+
*
|
|
8
|
+
* Uses the "chat.message" hook which fires when user submits a message.
|
|
8
9
|
*/
|
|
9
10
|
import type { PluginInput } from "@opencode-ai/plugin";
|
|
10
11
|
interface MessagePart {
|
|
11
12
|
type: string;
|
|
12
13
|
text?: string;
|
|
14
|
+
synthetic?: boolean;
|
|
13
15
|
}
|
|
14
|
-
interface
|
|
16
|
+
interface ChatMessageOutput {
|
|
15
17
|
parts: MessagePart[];
|
|
16
|
-
message:
|
|
17
|
-
variant?: string;
|
|
18
|
-
};
|
|
18
|
+
message: Record<string, unknown>;
|
|
19
19
|
}
|
|
20
20
|
export declare function createKeywordDetectorHook(ctx: PluginInput): {
|
|
21
21
|
"chat.message": (input: {
|
|
22
22
|
sessionID: string;
|
|
23
|
-
agent
|
|
24
|
-
}, output:
|
|
23
|
+
agent?: string;
|
|
24
|
+
}, output: ChatMessageOutput) => Promise<void>;
|
|
25
25
|
};
|
|
26
26
|
export { KEYWORD_CONFIGS, type KeywordType, type KeywordConfig } from "./contexts";
|
package/dist/index.js
CHANGED
|
@@ -17674,13 +17674,19 @@ function createKeywordDetectorHook(ctx) {
|
|
|
17674
17674
|
return;
|
|
17675
17675
|
detectedSessions.add(sessionKey);
|
|
17676
17676
|
const primaryKeyword = detectedKeywords[0];
|
|
17677
|
-
|
|
17678
|
-
|
|
17677
|
+
const textPartIndex = output.parts.findIndex((p) => p.type === "text" && p.text);
|
|
17678
|
+
if (textPartIndex >= 0) {
|
|
17679
|
+
const existingPart = output.parts[textPartIndex];
|
|
17680
|
+
existingPart.text = `${existingPart.text ?? ""}
|
|
17681
|
+
|
|
17682
|
+
${primaryKeyword.context}`;
|
|
17683
|
+
} else {
|
|
17684
|
+
output.parts.push({
|
|
17685
|
+
type: "text",
|
|
17686
|
+
text: primaryKeyword.context,
|
|
17687
|
+
synthetic: true
|
|
17688
|
+
});
|
|
17679
17689
|
}
|
|
17680
|
-
output.parts.push({
|
|
17681
|
-
type: "text",
|
|
17682
|
-
text: primaryKeyword.context
|
|
17683
|
-
});
|
|
17684
17690
|
await ctx.client.tui.showToast({
|
|
17685
17691
|
body: {
|
|
17686
17692
|
title: primaryKeyword.toast.title,
|
|
@@ -17835,7 +17841,9 @@ var ZenoxPlugin = async (ctx) => {
|
|
|
17835
17841
|
};
|
|
17836
17842
|
return {
|
|
17837
17843
|
tool: backgroundTools,
|
|
17838
|
-
|
|
17844
|
+
"chat.message": async (input, output) => {
|
|
17845
|
+
await keywordDetectorHook["chat.message"]?.(input, output);
|
|
17846
|
+
},
|
|
17839
17847
|
event: async (input) => {
|
|
17840
17848
|
const { event } = input;
|
|
17841
17849
|
await autoUpdateHook.event(input);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "zenox",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.2",
|
|
4
4
|
"description": "OpenCode plugin with specialized agents (explorer, librarian, oracle, ui-planner), background tasks for parallel execution, and smart orchestration",
|
|
5
5
|
"author": "Ayush",
|
|
6
6
|
"license": "MIT",
|