| 7693 | } |
| 7694 | |
| 7695 | static void install_copilot_durable_context(const char *home, const char *binary_path, bool force, |
| 7696 | bool dry_run) { |
| 7697 | char config_dir[CLI_BUF_1K]; |
| 7698 | char hooks_dir[CLI_BUF_1K]; |
| 7699 | char hook_path[CLI_BUF_1K]; |
| 7700 | char skills_dir[CLI_BUF_1K]; |
| 7701 | char agent_path[CLI_BUF_1K]; |
| 7702 | cbm_copilot_config_dir(home, config_dir, sizeof(config_dir)); |
| 7703 | snprintf(hooks_dir, sizeof(hooks_dir), "%s/hooks", config_dir); |
| 7704 | snprintf(hook_path, sizeof(hook_path), "%s/hooks/codebase-memory-mcp.json", config_dir); |
| 7705 | snprintf(skills_dir, sizeof(skills_dir), "%s/skills", config_dir); |
| 7706 | snprintf(agent_path, sizeof(agent_path), "%s/agents/codebase-memory.agent.md", config_dir); |
| 7707 | install_agent_skill("Copilot", skills_dir, force, dry_run); |
| 7708 | install_tiered_agent_profiles( |
| 7709 | (cbm_tiered_profile_set_t){ |
| 7710 | .label = "Copilot", |
| 7711 | .verify_path = agent_path, |
| 7712 | .binary_path = binary_path, |
| 7713 | .legacy_verify_content = legacy_copilot_verify_agent_content, |
| 7714 | .dialect = CBM_GRAPH_DIALECT_COPILOT, |
| 7715 | }, |
| 7716 | dry_run); |
| 7717 | if (g_install_plan) { |
| 7718 | plan_record("Copilot", "hook", hook_path); |
| 7719 | return; |
| 7720 | } |
| 7721 | bool hook_ok = true; |
| 7722 | if (!dry_run && (!cbm_mkdir_p(hooks_dir, CLI_OCTAL_PERM) || |
| 7723 | cbm_upsert_copilot_hooks(binary_path, hook_path) != CLI_OK)) { |
| 7724 | hook_ok = false; |
| 7725 | record_agent_config_error(false, "Copilot", "lifecycle_hook_install", hook_path); |
| 7726 | } |
| 7727 | if (hook_ok) { |
| 7728 | printf(" hooks: SessionStart + SubagentStart (dynamic graph context)\n"); |
| 7729 | } |
| 7730 | } |
| 7731 | |
| 7732 | typedef struct { |
| 7733 | cbm_agent_client_resolve_options_t options; |
no test coverage detected