mirror of
https://github.com/affaan-m/ECC.git
synced 2026-11-23 08:15:29 +00:00
- Add antigravity-home target adapter installing directly into ~/.gemini/config/plugins/ecc/
- Support full Antigravity lifecycle hooks (PreToolUse, Stop) adhering to the protojson contract ({ decision, reason }) via scripts/hooks/antigravity-hook-bridge.js
- Generate native Antigravity plugin manifest (plugin.json) and shared ECC memory vault MCP config (mcp_config.json)
- Support dual scope (user and project) with full harness capability integration
- Update install schemas and manifests to recognize antigravity-home
- Fix upstream regressions in plan.js scaffoldOnly, plan-canvas child_process spawn, codex-hooks pre-push test, and claude-plugin-setup hook arguments
- Add comprehensive Tier 1 test suite (13 passing tests) with 100% pass across all 4919 repository tests
80 lines
1.9 KiB
JavaScript
80 lines
1.9 KiB
JavaScript
'use strict';
|
|
|
|
/**
|
|
* Antigravity Hooks Generator
|
|
*
|
|
* Generates valid Antigravity hooks.json configuration matching Antigravity's
|
|
* lifecycle schema (PreToolUse, PostToolUse, Stop) and pointing to the ECC
|
|
* hook bridge.
|
|
*/
|
|
|
|
function buildAntigravityHooksConfig(options = {}) {
|
|
const profile = options.profile || 'standard';
|
|
const bridgeScript = options.bridgeScript || 'scripts/hooks/antigravity-hook-bridge.js';
|
|
|
|
const preToolUseHandlers = [
|
|
{
|
|
matcher: 'run_command',
|
|
hooks: [
|
|
{
|
|
type: 'command',
|
|
command: `node ${bridgeScript} --mode pre-tool-use --hook pre:bash:dispatcher`,
|
|
timeout: 15,
|
|
},
|
|
],
|
|
},
|
|
{
|
|
matcher: 'write_to_file|replace_file_content',
|
|
hooks: [
|
|
{
|
|
type: 'command',
|
|
command: `node ${bridgeScript} --mode pre-tool-use --hook pre:edit-write:gateguard-fact-force`,
|
|
timeout: 10,
|
|
},
|
|
{
|
|
type: 'command',
|
|
command: `node ${bridgeScript} --mode pre-tool-use --hook pre:config-protection`,
|
|
timeout: 5,
|
|
},
|
|
],
|
|
},
|
|
];
|
|
|
|
if (profile === 'standard' || profile === 'strict') {
|
|
preToolUseHandlers.push({
|
|
matcher: 'write_to_file',
|
|
hooks: [
|
|
{
|
|
type: 'command',
|
|
command: `node ${bridgeScript} --mode pre-tool-use --hook pre:write:doc-file-warning`,
|
|
timeout: 5,
|
|
},
|
|
],
|
|
});
|
|
}
|
|
|
|
const stopHandlers = [
|
|
{
|
|
type: 'command',
|
|
command: `node ${bridgeScript} --mode stop --hook stop:format-typecheck`,
|
|
timeout: 120,
|
|
},
|
|
{
|
|
type: 'command',
|
|
command: `node ${bridgeScript} --mode stop --hook stop:check-console-log`,
|
|
timeout: 30,
|
|
},
|
|
];
|
|
|
|
return {
|
|
'ecc-guard': {
|
|
PreToolUse: preToolUseHandlers,
|
|
Stop: stopHandlers,
|
|
},
|
|
};
|
|
}
|
|
|
|
module.exports = {
|
|
buildAntigravityHooksConfig,
|
|
};
|