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

Function install_copilot_durable_context

src/cli/cli.c:8059–8094  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

8057}
8058
8059static void install_copilot_durable_context(const char *home, const char *binary_path, bool force,
8060 bool dry_run) {
8061 char config_dir[CLI_BUF_1K];
8062 char hooks_dir[CLI_BUF_1K];
8063 char hook_path[CLI_BUF_1K];
8064 char skills_dir[CLI_BUF_1K];
8065 char agent_path[CLI_BUF_1K];
8066 cbm_copilot_config_dir(home, config_dir, sizeof(config_dir));
8067 snprintf(hooks_dir, sizeof(hooks_dir), "%s/hooks", config_dir);
8068 snprintf(hook_path, sizeof(hook_path), "%s/hooks/codebase-memory-mcp.json", config_dir);
8069 snprintf(skills_dir, sizeof(skills_dir), "%s/skills", config_dir);
8070 snprintf(agent_path, sizeof(agent_path), "%s/agents/codebase-memory.agent.md", config_dir);
8071 install_agent_skill("Copilot", skills_dir, force, dry_run);
8072 install_tiered_agent_profiles(
8073 (cbm_tiered_profile_set_t){
8074 .label = "Copilot",
8075 .verify_path = agent_path,
8076 .binary_path = binary_path,
8077 .legacy_verify_content = legacy_copilot_verify_agent_content,
8078 .dialect = CBM_GRAPH_DIALECT_COPILOT,
8079 },
8080 dry_run);
8081 if (g_install_plan) {
8082 plan_record("Copilot", "hook", hook_path);
8083 return;
8084 }
8085 bool hook_ok = true;
8086 if (!dry_run && (!cbm_mkdir_p(hooks_dir, CLI_OCTAL_PERM) ||
8087 cbm_upsert_copilot_hooks(binary_path, hook_path) != CLI_OK)) {
8088 hook_ok = false;
8089 record_agent_config_error(false, "Copilot", "lifecycle_hook_install", hook_path);
8090 }
8091 if (hook_ok) {
8092 printf(" hooks: SessionStart + SubagentStart (dynamic graph context)\n");
8093 }
8094}
8095
8096typedef struct {
8097 cbm_agent_client_resolve_options_t options;

Callers 1

Calls 7

cbm_copilot_config_dirFunction · 0.85
install_agent_skillFunction · 0.85
plan_recordFunction · 0.85
cbm_mkdir_pFunction · 0.85
cbm_upsert_copilot_hooksFunction · 0.85

Tested by

no test coverage detected