| 7649 | } |
| 7650 | |
| 7651 | static void install_copilot_durable_context(const char *home, const char *binary_path, bool force, |
| 7652 | bool dry_run) { |
| 7653 | char config_dir[CLI_BUF_1K]; |
| 7654 | char hooks_dir[CLI_BUF_1K]; |
| 7655 | char hook_path[CLI_BUF_1K]; |
| 7656 | char skills_dir[CLI_BUF_1K]; |
| 7657 | char agent_path[CLI_BUF_1K]; |
| 7658 | cbm_copilot_config_dir(home, config_dir, sizeof(config_dir)); |
| 7659 | snprintf(hooks_dir, sizeof(hooks_dir), "%s/hooks", config_dir); |
| 7660 | snprintf(hook_path, sizeof(hook_path), "%s/hooks/codebase-memory-mcp.json", config_dir); |
| 7661 | snprintf(skills_dir, sizeof(skills_dir), "%s/skills", config_dir); |
| 7662 | snprintf(agent_path, sizeof(agent_path), "%s/agents/codebase-memory.agent.md", config_dir); |
| 7663 | install_agent_skill("Copilot", skills_dir, force, dry_run); |
| 7664 | install_tiered_agent_profiles( |
| 7665 | (cbm_tiered_profile_set_t){ |
| 7666 | .label = "Copilot", |
| 7667 | .verify_path = agent_path, |
| 7668 | .binary_path = binary_path, |
| 7669 | .legacy_verify_content = legacy_copilot_verify_agent_content, |
| 7670 | .dialect = CBM_GRAPH_DIALECT_COPILOT, |
| 7671 | }, |
| 7672 | dry_run); |
| 7673 | if (g_install_plan) { |
| 7674 | plan_record("Copilot", "hook", hook_path); |
| 7675 | return; |
| 7676 | } |
| 7677 | bool hook_ok = true; |
| 7678 | if (!dry_run && (!cbm_mkdir_p(hooks_dir, CLI_OCTAL_PERM) || |
| 7679 | cbm_upsert_copilot_hooks(binary_path, hook_path) != CLI_OK)) { |
| 7680 | hook_ok = false; |
| 7681 | record_agent_config_error(false, "Copilot", "lifecycle_hook_install", hook_path); |
| 7682 | } |
| 7683 | if (hook_ok) { |
| 7684 | printf(" hooks: SessionStart + SubagentStart (dynamic graph context)\n"); |
| 7685 | } |
| 7686 | } |
| 7687 | |
| 7688 | typedef struct { |
| 7689 | cbm_agent_client_resolve_options_t options; |
no test coverage detected