feat(keyword-detector): add hyperplan toast and planner filtering to hook
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
@@ -66,9 +66,9 @@ export function createKeywordDetectorHook(
|
|||||||
|
|
||||||
if (isPlannerAgent(currentAgent)) {
|
if (isPlannerAgent(currentAgent)) {
|
||||||
const preFilterCount = detectedKeywords.length
|
const preFilterCount = detectedKeywords.length
|
||||||
detectedKeywords = detectedKeywords.filter((k) => k.type !== "ultrawork")
|
detectedKeywords = detectedKeywords.filter((k) => k.type !== "ultrawork" && k.type !== "hyperplan")
|
||||||
if (preFilterCount > detectedKeywords.length) {
|
if (preFilterCount > detectedKeywords.length) {
|
||||||
log(`[keyword-detector] Filtered ultrawork keywords for planner agent`, { sessionID: input.sessionID, agent: currentAgent })
|
log(`[keyword-detector] Filtered ultrawork/hyperplan keywords for planner agent`, { sessionID: input.sessionID, agent: currentAgent })
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -126,6 +126,29 @@ export function createKeywordDetectorHook(
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const hasHyperplan = detectedKeywords.some((k) => k.type === "hyperplan")
|
||||||
|
if (hasHyperplan) {
|
||||||
|
log(`[keyword-detector] Hyperplan mode activated`, {
|
||||||
|
sessionID: input.sessionID,
|
||||||
|
})
|
||||||
|
|
||||||
|
ctx.client.tui
|
||||||
|
.showToast({
|
||||||
|
body: {
|
||||||
|
title: "Hyperplan Mode Activated",
|
||||||
|
message: "Adversarial planning engaged. 5 hostile members will cross-critique.",
|
||||||
|
variant: "success" as const,
|
||||||
|
duration: 3000,
|
||||||
|
},
|
||||||
|
})
|
||||||
|
.catch((err) =>
|
||||||
|
log(`[keyword-detector] Failed to show toast`, {
|
||||||
|
error: err,
|
||||||
|
sessionID: input.sessionID,
|
||||||
|
})
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
const textPartIndex = output.parts.findIndex((p) => p.type === "text" && p.text !== undefined)
|
const textPartIndex = output.parts.findIndex((p) => p.type === "text" && p.text !== undefined)
|
||||||
if (textPartIndex === -1) {
|
if (textPartIndex === -1) {
|
||||||
log(`[keyword-detector] No text part found, skipping injection`, { sessionID: input.sessionID })
|
log(`[keyword-detector] No text part found, skipping injection`, { sessionID: input.sessionID })
|
||||||
|
|||||||
Reference in New Issue
Block a user