MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / install_copilot_durable_context

Function install_copilot_durable_context

src/cli/cli.c:9074–9109  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

9072}
9073
9074static void install_copilot_durable_context(const char *home, const char *binary_path, bool force,
9075 bool dry_run) {
9076 char config_dir[CLI_BUF_1K];
9077 char hooks_dir[CLI_BUF_1K];
9078 char hook_path[CLI_BUF_1K];
9079 char skills_dir[CLI_BUF_1K];
9080 char agent_path[CLI_BUF_1K];
9081 cbm_copilot_config_dir(home, config_dir, sizeof(config_dir));
9082 snprintf(hooks_dir, sizeof(hooks_dir), "%s/hooks", config_dir);
9083 snprintf(hook_path, sizeof(hook_path), "%s/hooks/codebase-memory-mcp.json", config_dir);
9084 snprintf(skills_dir, sizeof(skills_dir), "%s/skills", config_dir);
9085 snprintf(agent_path, sizeof(agent_path), "%s/agents/codebase-memory.agent.md", config_dir);
9086 install_agent_skill("Copilot", skills_dir, force, dry_run);
9087 install_tiered_agent_profiles(
9088 (cbm_tiered_profile_set_t){
9089 .label = "Copilot",
9090 .verify_path = agent_path,
9091 .binary_path = binary_path,
9092 .legacy_verify_content = legacy_copilot_verify_agent_content,
9093 .dialect = CBM_GRAPH_DIALECT_COPILOT,
9094 },
9095 dry_run);
9096 if (g_install_plan) {
9097 plan_record("Copilot", "hook", hook_path);
9098 return;
9099 }
9100 bool hook_ok = true;
9101 if (!dry_run && (!cbm_mkdir_p_ex(hooks_dir, CLI_OCTAL_PERM, CBM_MKDIR_FOLLOW_OWNED) ||
9102 cbm_upsert_copilot_hooks(binary_path, hook_path) != CLI_OK)) {
9103 hook_ok = false;
9104 record_agent_config_error(false, "Copilot", "lifecycle_hook_install", hook_path);
9105 }
9106 if (hook_ok) {
9107 printf(" hooks: SessionStart + SubagentStart (dynamic graph context)\n");
9108 }
9109}
9110
9111static bool cbm_omp_agent_dir(const char *home_dir, char *out, size_t out_sz) {
9112 char profile_buf[CLI_BUF_256];

Callers 1

Calls 7

cbm_copilot_config_dirFunction · 0.85
install_agent_skillFunction · 0.85
plan_recordFunction · 0.85
cbm_mkdir_p_exFunction · 0.85
cbm_upsert_copilot_hooksFunction · 0.85

Tested by

no test coverage detected