| 7904 | } |
| 7905 | |
| 7906 | static void install_copilot_durable_context(const char *home, const char *binary_path, bool force, |
| 7907 | bool dry_run) { |
| 7908 | char config_dir[CLI_BUF_1K]; |
| 7909 | char hooks_dir[CLI_BUF_1K]; |
| 7910 | char hook_path[CLI_BUF_1K]; |
| 7911 | char skills_dir[CLI_BUF_1K]; |
| 7912 | char agent_path[CLI_BUF_1K]; |
| 7913 | cbm_copilot_config_dir(home, config_dir, sizeof(config_dir)); |
| 7914 | snprintf(hooks_dir, sizeof(hooks_dir), "%s/hooks", config_dir); |
| 7915 | snprintf(hook_path, sizeof(hook_path), "%s/hooks/codebase-memory-mcp.json", config_dir); |
| 7916 | snprintf(skills_dir, sizeof(skills_dir), "%s/skills", config_dir); |
| 7917 | snprintf(agent_path, sizeof(agent_path), "%s/agents/codebase-memory.agent.md", config_dir); |
| 7918 | install_agent_skill("Copilot", skills_dir, force, dry_run); |
| 7919 | install_tiered_agent_profiles( |
| 7920 | (cbm_tiered_profile_set_t){ |
| 7921 | .label = "Copilot", |
| 7922 | .verify_path = agent_path, |
| 7923 | .binary_path = binary_path, |
| 7924 | .legacy_verify_content = legacy_copilot_verify_agent_content, |
| 7925 | .dialect = CBM_GRAPH_DIALECT_COPILOT, |
| 7926 | }, |
| 7927 | dry_run); |
| 7928 | if (g_install_plan) { |
| 7929 | plan_record("Copilot", "hook", hook_path); |
| 7930 | return; |
| 7931 | } |
| 7932 | bool hook_ok = true; |
| 7933 | if (!dry_run && (!cbm_mkdir_p(hooks_dir, CLI_OCTAL_PERM) || |
| 7934 | cbm_upsert_copilot_hooks(binary_path, hook_path) != CLI_OK)) { |
| 7935 | hook_ok = false; |
| 7936 | record_agent_config_error(false, "Copilot", "lifecycle_hook_install", hook_path); |
| 7937 | } |
| 7938 | if (hook_ok) { |
| 7939 | printf(" hooks: SessionStart + SubagentStart (dynamic graph context)\n"); |
| 7940 | } |
| 7941 | } |
| 7942 | |
| 7943 | typedef struct { |
| 7944 | cbm_agent_client_resolve_options_t options; |
no test coverage detected