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

Function handle_atlas_flow

src/ui/http_server.c:2941–2958  ·  view source on GitHub ↗

GET /api/flow?project=X&id=N — one flow's steps. */

Source from the content-addressed store, hash-verified

2939
2940/* GET /api/flow?project=X&id=N — one flow's steps. */
2941static void handle_atlas_flow(cbm_http_conn_t *c, const cbm_http_req_t *req) {
2942 char project[256] = {0};
2943 cbm_store_t *store = atlas_open_project(c, req, project, sizeof(project));
2944 if (!store)
2945 return;
2946 char id_str[16] = {0};
2947 int id = -1;
2948 if (cbm_http_query_param(req->query, "id", id_str, (int)sizeof(id_str)))
2949 id = atoi(id_str);
2950 char *json = cbm_atlas_flow_json(store, project, id);
2951 char wantg[8] = {0};
2952 cbm_http_query_param(req->query, "guards", wantg, (int)sizeof(wantg));
2953 if (json && wantg[0] == '1')
2954 json = atlas_flow_attach_guards(store, project, json);
2955 json = cbm_atlas_attach_observed(store, project, json);
2956 cbm_store_close(store);
2957 atlas_reply_json(c, json, 404, "{\"error\":\"unknown flow\"}");
2958}
2959
2960/* ── Handle JSON-RPC request ──────────────────────────────────── */
2961

Callers 1

dispatch_requestFunction · 0.85

Calls 7

atlas_open_projectFunction · 0.85
cbm_http_query_paramFunction · 0.85
cbm_atlas_flow_jsonFunction · 0.85
atlas_flow_attach_guardsFunction · 0.85
cbm_store_closeFunction · 0.85
atlas_reply_jsonFunction · 0.85

Tested by

no test coverage detected