checkpoint: massive refactor
This commit is contained in:
@@ -89,13 +89,20 @@ def main():
|
||||
# This prevents the hook from affecting normal CLI usage.
|
||||
hook_context = os.environ.get("GEMINI_CLI_HOOK_CONTEXT")
|
||||
logging.debug(f"Checking GEMINI_CLI_HOOK_CONTEXT: '{hook_context}'")
|
||||
if hook_context != "manual_slop":
|
||||
logging.debug(f"GEMINI_CLI_HOOK_CONTEXT is '{hook_context}', NOT 'manual_slop'. Allowing execution without confirmation.")
|
||||
if hook_context != "manual_slop" and hook_context != "mma_headless":
|
||||
logging.debug(f"GEMINI_CLI_HOOK_CONTEXT is '{hook_context}', NOT 'manual_slop' or 'mma_headless'. Allowing execution without confirmation.")
|
||||
print(json.dumps({
|
||||
"decision": "allow",
|
||||
"reason": f"Non-programmatic usage (GEMINI_CLI_HOOK_CONTEXT={hook_context})."
|
||||
}))
|
||||
return
|
||||
if hook_context == "mma_headless":
|
||||
logging.debug(f"GEMINI_CLI_HOOK_CONTEXT is 'mma_headless'. Allowing execution for sub-agent.")
|
||||
print(json.dumps({
|
||||
"decision": "allow",
|
||||
"reason": "Sub-agent headless mode (MMA)."
|
||||
}))
|
||||
return
|
||||
# 5. Use 'ApiHookClient' (assuming GUI is on http://127.0.0.1:8999)
|
||||
logging.debug("GEMINI_CLI_HOOK_CONTEXT is 'manual_slop'. Proceeding with API Hook Client.")
|
||||
client = ApiHookClient(base_url="http://127.0.0.1:8999")
|
||||
|
||||
Reference in New Issue
Block a user