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

Function install_devin_durable_context

src/cli/cli.c:9349–9392  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

9347}
9348
9349static void install_devin_durable_context(const cbm_agent_registry_context_t *registry,
9350 const char *binary_path, const char *config_path,
9351 bool config_resolved, bool inherit_claude_session,
9352 bool force, bool dry_run) {
9353 char devin_dir[CLI_BUF_1K];
9354 char instructions_path[CLI_BUF_1K];
9355 char skills_dir[CLI_BUF_1K];
9356 if (!cbm_devin_user_dir(registry, devin_dir, sizeof(devin_dir))) {
9357 record_agent_config_error(false, "Devin CLI / Local", "context_resolve", "devin");
9358 return;
9359 }
9360 snprintf(instructions_path, sizeof(instructions_path), "%s/AGENTS.md", devin_dir);
9361 snprintf(skills_dir, sizeof(skills_dir), "%s/skills", devin_dir);
9362 install_managed_agent_instructions("Devin CLI / Local", instructions_path, dry_run);
9363 install_agent_skill("Devin CLI / Local", skills_dir, force, dry_run);
9364 bool hook_supported = cbm_optional_hook_supported("devin", registry->options.is_windows);
9365 if (g_install_plan) {
9366 if (hook_supported) {
9367 plan_record("Devin CLI / Local", "hook", config_path);
9368 }
9369 return;
9370 }
9371 if (!hook_supported) {
9372 printf(" hooks: withheld on Windows (vendor hook shell is undocumented)\n");
9373 return;
9374 }
9375 if (!config_resolved) {
9376 printf(" hooks: skipped because the config path was unresolved\n");
9377 return;
9378 }
9379 bool installed = true;
9380 if (!dry_run && ((inherit_claude_session &&
9381 cbm_remove_devin_session_hook(config_path, binary_path) != CLI_OK) ||
9382 cbm_upsert_devin_context_hooks(config_path, binary_path,
9383 !inherit_claude_session) != CLI_OK)) {
9384 installed = false;
9385 record_agent_config_error(false, "Devin CLI / Local", "lifecycle_hook_install",
9386 config_path);
9387 }
9388 if (installed) {
9389 printf(" hooks: %sUserPromptSubmit + PostCompaction (fail-open context)\n",
9390 inherit_claude_session ? "" : "SessionStart + ");
9391 }
9392}
9393
9394/* Write a generated client extension module into `path` as a managed block.
9395 *

Callers 1

Calls 8

cbm_devin_user_dirFunction · 0.85
install_agent_skillFunction · 0.85
plan_recordFunction · 0.85

Tested by

no test coverage detected