feat(plugins)!: make Sidekick exclusive to Claude Code (#7278)
This commit is contained in:
@@ -19,8 +19,6 @@ import hook_runner # noqa: E402
|
||||
import telemetry # noqa: E402
|
||||
from memory_core import ( # noqa: E402
|
||||
configure_harness,
|
||||
record_sidekick_start,
|
||||
record_sidekick_stop,
|
||||
record_tool,
|
||||
)
|
||||
|
||||
@@ -30,8 +28,6 @@ EVENTS = {
|
||||
"postToolUse": "post-tool",
|
||||
"postToolUseFailure": "post-tool-failure",
|
||||
"afterAgentResponse": "assistant-stop",
|
||||
"subagentStart": "sidekick-start",
|
||||
"subagentStop": "sidekick-stop",
|
||||
"stop": "stop",
|
||||
"sessionEnd": "session-end",
|
||||
"preCompact": "pre-compact",
|
||||
@@ -52,10 +48,6 @@ def normalize(payload: dict, event: str) -> dict:
|
||||
value.setdefault("last_assistant_message", value["text"])
|
||||
if "summary" in value:
|
||||
value.setdefault("last_assistant_message", value["summary"])
|
||||
if "subagent_id" in value:
|
||||
value.setdefault("agent_id", value["subagent_id"])
|
||||
if "subagent_type" in value:
|
||||
value.setdefault("agent_type", value["subagent_type"])
|
||||
return {"action": EVENTS[event], "payload": value}
|
||||
|
||||
|
||||
@@ -67,15 +59,6 @@ def _record_response(store, payload):
|
||||
hook_runner.default_record_stop(store, payload)
|
||||
|
||||
|
||||
def _record_sidekick_start(store, payload):
|
||||
record_sidekick_start(store, payload, inject_context=False)
|
||||
return {"permission": "allow"}
|
||||
|
||||
|
||||
def _record_sidekick_stop(store, payload):
|
||||
record_sidekick_stop(store, payload)
|
||||
|
||||
|
||||
def main() -> int:
|
||||
if len(sys.argv) != 2 or sys.argv[1] not in EVENTS:
|
||||
return 2
|
||||
@@ -100,8 +83,6 @@ def main() -> int:
|
||||
extra_actions={
|
||||
"post-tool-failure": _record_failure,
|
||||
"assistant-stop": _record_response,
|
||||
"sidekick-start": _record_sidekick_start,
|
||||
"sidekick-stop": _record_sidekick_stop,
|
||||
},
|
||||
automatic_flush_reasons={"session-end", "pre-compact"},
|
||||
)
|
||||
@@ -119,8 +100,6 @@ def main() -> int:
|
||||
}
|
||||
if environment:
|
||||
print(json.dumps({"env": environment}))
|
||||
elif event == "subagentStart":
|
||||
print(json.dumps({"permission": "allow"}))
|
||||
return result
|
||||
|
||||
|
||||
|
||||
@@ -6,8 +6,6 @@
|
||||
"postToolUse": [{ "command": "python3 \"${CURSOR_PLUGIN_ROOT}/hooks/adapter.py\" postToolUse", "timeout": 3 }],
|
||||
"postToolUseFailure": [{ "command": "python3 \"${CURSOR_PLUGIN_ROOT}/hooks/adapter.py\" postToolUseFailure", "timeout": 3 }],
|
||||
"afterAgentResponse": [{ "command": "python3 \"${CURSOR_PLUGIN_ROOT}/hooks/adapter.py\" afterAgentResponse", "timeout": 3 }],
|
||||
"subagentStart": [{ "command": "python3 \"${CURSOR_PLUGIN_ROOT}/hooks/adapter.py\" subagentStart", "matcher": "^sidekick$", "timeout": 5 }],
|
||||
"subagentStop": [{ "command": "python3 \"${CURSOR_PLUGIN_ROOT}/hooks/adapter.py\" subagentStop", "matcher": "^sidekick$", "timeout": 5 }],
|
||||
"stop": [{ "command": "python3 \"${CURSOR_PLUGIN_ROOT}/hooks/adapter.py\" stop", "timeout": 3 }],
|
||||
"preCompact": [{ "command": "python3 \"${CURSOR_PLUGIN_ROOT}/hooks/adapter.py\" preCompact", "timeout": 5 }],
|
||||
"sessionEnd": [{ "command": "python3 \"${CURSOR_PLUGIN_ROOT}/hooks/adapter.py\" sessionEnd", "timeout": 5 }]
|
||||
|
||||
Reference in New Issue
Block a user