fix(hooks, uninstall, lifecycle): resolve fallback syntax, MCP cleanup, launchd XML escaping, and agent tool definitions - #476
Open
seb4ez wants to merge 4 commits into
Conversation
…, sync delimiters, and add Windows MCP cleanup
… state, and add MCP tools to agent frontmatters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Bounty eligibility
Summary
Resolves critical cross-platform synchronization, uninstaller cleanup, telemetry formatting, macOS launchd XML escaping, and agent MCP tool whitelist defects:
hooks/block-monk.ps1: Fixed a fatal PowerShell syntax error in the fallback hash table (missing opening@{).hooks/block-monk.sh: Restored newline (\n) unescaping prior to normalization to prevent multiline shell command bypasses..antigravity-plugin/hooks.json: Corrected thePreInvocationhook path to point tohooks/ensure-monk-agent.*rather thanscripts/ensure-monk-agent.*, ensuring valid JSON stdout contracts.scripts/uninstall-monk-agent.ps1: ImplementedRemove-AntigravityMcpto prevent orphaned MCP registrations in~/.gemini/config/mcp_config.jsonafter uninstallation on Windows, and sanitized UTF-16 null bytes inTest-MonkOwnsDistro.scripts/monk-launcher-telemetry.ps1: Standardizedlast-launch-emittimestamp storage to integer Unix epoch seconds, restoring deduplication compatibility with the POSIX.shsibling.scripts/start-monk-agent.sh: Addedxml_escapefor plist interpolation, removed stalepid_fileon Launchd starts to prevent premature loop aborts, and trackedplugin_versionin Linux state files.agents/*.md: Addedmcp__plugin_monk_monk__*to subagent tool whitelists and replaced raw CLI prompt invocations with MCP tooling directives.Changes
hooks/block-monk.ps1.awknewline unescape inhooks/block-monk.sh..antigravity-plugin/andplugins/monk/.PreInvocationand diagnostics hooks in.antigravity-plugin/.Remove-AntigravityMcpand WSL UTF-16 null-byte sanitization inuninstall-monk-agent.ps1.monk-launcher-telemetry.ps1.start-monk-agent.sh.agents/*.md.Test Coverage
tests/monk-comprehensive-audit.test.mjs(26/26 tests passing viapnpm test):hooks/block-monk.ps1 must not have missing @{ in fallback hashtablehooks/block-monk.sh must unescape JSON newlines (\n) before normalizationAll block-monk hooks across plugins must have synchronized delimiter regexes.antigravity-plugin/hooks.json PreInvocation hook must point to hooks/ directory.antigravity-plugin/hooks/ensure-monk-agent.ps1 must not self-silence via $BashUsable on Windows.antigravity-plugin/hooks/monk-diagnostics.ps1 must guarantee {} on stdoutscripts/uninstall-monk-agent.ps1 must implement Remove-AntigravityMcpscripts/monk-launcher-telemetry.ps1 must write epoch seconds to last-launch-emitscripts/start-monk-agent.sh must define xml_escape and sanitize plist interpolationsscripts/start-monk-agent.sh must track agent_local and plugin_version in Linux state fileAgent definitions must include mcp__* tools in frontmatterAgent prompts must not instruct execution of forbidden CLI commands