bridge-agent 0.13.12 → 0.15.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -22314,8 +22314,9 @@ async function getProject(ctx) {
22314
22314
  async function updateProject(ctx, description) {
22315
22315
  return request(ctx, "PATCH", projectPath(ctx), { description });
22316
22316
  }
22317
- async function getTodos(ctx) {
22318
- return request(ctx, "GET", projectPath(ctx, "/todos"));
22317
+ async function getTodos(ctx, scope) {
22318
+ const qs = scope === "active" ? "?scope=active" : "";
22319
+ return request(ctx, "GET", projectPath(ctx, `/todos${qs}`));
22319
22320
  }
22320
22321
  async function cancelRun(ctx) {
22321
22322
  return request(ctx, "POST", projectPath(ctx, "/runs/cancel"));
@@ -22393,7 +22394,7 @@ async function assignTask(ctx, todoId, agentId) {
22393
22394
  }
22394
22395
  async function getAgentOutput(ctx, agentId, lines) {
22395
22396
  const qs = lines !== void 0 ? `?lines=${lines}` : "";
22396
- return request(ctx, "GET", projectPath(ctx, `/agents/${agentId}/output${qs}`));
22397
+ return request(ctx, "GET", projectPath(ctx, `/panels/${agentId}/output${qs}`));
22397
22398
  }
22398
22399
  async function sendAgentInput(ctx, agentId, text) {
22399
22400
  return request(ctx, "POST", workspacePath(ctx, `/agents/${agentId}/input`), { text });
@@ -22423,6 +22424,7 @@ async function getProjectEvents(ctx, opts) {
22423
22424
  if (opts?.search) params.set("search", opts.search);
22424
22425
  if (opts?.limit) params.set("limit", String(opts.limit));
22425
22426
  if (opts?.includeArchived) params.set("includeArchived", "true");
22427
+ if (opts?.permanent) params.set("permanent", "true");
22426
22428
  const qs = params.toString();
22427
22429
  const basePath = opts?.workspaceScope ? workspacePath(ctx, `/events${qs ? "?" + qs : ""}`) : projectPath(ctx, `/events${qs ? "?" + qs : ""}`, opts?.projectId);
22428
22430
  return request(ctx, "GET", basePath);
@@ -22442,7 +22444,18 @@ async function listPersonas(ctx, opts) {
22442
22444
  return request(ctx, "GET", workspacePath(ctx, `/personas${qs ? "?" + qs : ""}`));
22443
22445
  }
22444
22446
  async function getPersona(ctx, params) {
22445
- return request(ctx, "GET", workspacePath(ctx, `/personas/${encodeURIComponent(params.id)}`));
22447
+ const qs = new URLSearchParams();
22448
+ if (params.fields?.length) qs.set("fields", params.fields.join(","));
22449
+ const qstr = qs.toString();
22450
+ const res = await request(ctx, "GET", workspacePath(ctx, `/personas/${encodeURIComponent(params.id)}${qstr ? "?" + qstr : ""}`));
22451
+ if (params.fields?.length && res.persona) {
22452
+ const projected = {};
22453
+ for (const k of params.fields) {
22454
+ if (k in res.persona) projected[k] = res.persona[k];
22455
+ }
22456
+ return { persona: projected };
22457
+ }
22458
+ return res;
22446
22459
  }
22447
22460
  async function createPersona(ctx, params) {
22448
22461
  const body = { ...params, scope: params.projectId ? "project" : "workspace" };
@@ -22497,7 +22510,7 @@ async function getRolePrompt(ctx, role) {
22497
22510
  console.error("[mcp] prompts.runtime_var.substituted", { role, var: "PROJECT_ID", resolved: true });
22498
22511
  }
22499
22512
  if (content.includes("{{GROUP_ID}}")) {
22500
- content = content.replaceAll("{{GROUP_ID}}", "none");
22513
+ content = content.replaceAll("{{GROUP_ID}}", ctx.groupId ?? "none");
22501
22514
  console.error("[mcp] prompts.runtime_var.substituted", { role, var: "GROUP_ID", resolved: true });
22502
22515
  }
22503
22516
  return { ...res, content };
@@ -22554,10 +22567,12 @@ function registerPlanTools(server, ctx) {
22554
22567
  function registerTodoTools(server, ctx) {
22555
22568
  server.tool(
22556
22569
  "bridge_get_todos",
22557
- "List all todos for this Bridge project from the most recent orchestration session. Returns session context (spec, status, name) alongside todos so you understand what the run is about. If session is null, no run has been started yet.",
22558
- {},
22559
- async () => {
22560
- const data = await getTodos(ctx);
22570
+ 'List todos for this Bridge project. By default returns planning-draft todos only (pending items from a planning session). Pass scope:"active" to return the full todo DAG for the in-flight run (all statuses, ordered by seq). Returns session context (spec, status, name) alongside todos.',
22571
+ {
22572
+ scope: external_exports.enum(["planning", "active"]).optional().describe("planning (default): pending planning-draft todos only. active: full todo DAG for the in-flight run.")
22573
+ },
22574
+ async ({ scope }) => {
22575
+ const data = await getTodos(ctx, scope ?? void 0);
22561
22576
  return {
22562
22577
  content: [{
22563
22578
  type: "text",
@@ -22691,7 +22706,26 @@ var BRIDGE_TOOL_DOCS = {
22691
22706
  bridge_status_panel: "Get status of any panel in the workspace regardless of project",
22692
22707
  // Personas
22693
22708
  bridge_get_persona: "Fetch a persona by id (name, systemPrompt, role, agentKey)",
22694
- bridge_list_personas: "List all personas visible to the caller (workspace + personal)"
22709
+ bridge_list_personas: "List all personas visible to the caller (workspace + personal)",
22710
+ bridge_create_persona: "Create a custom persona definition",
22711
+ bridge_update_persona: "Update persona definition fields",
22712
+ bridge_archive_persona: "Archive an outdated persona",
22713
+ bridge_launch_persona: "Spawn a worker initialized with a specific persona",
22714
+ bridge_apply_persona: "Apply persona configuration to an existing running worker",
22715
+ // Messaging
22716
+ bridge_send_message: "Send direct message to peer agent conversation",
22717
+ bridge_poll_messages: "Poll unread messages delivered to this agent",
22718
+ // Role Prompts
22719
+ bridge_list_role_prompts: "List available system role prompt templates",
22720
+ bridge_get_role_prompt: "Fetch resolved system role prompt template",
22721
+ bridge_update_role_prompt: "Update custom role prompt template",
22722
+ bridge_delete_role_prompt: "Delete custom role prompt template",
22723
+ // Events & Memory
22724
+ bridge_agent_is_idle: "Check if agent terminal PTY is idle and ready for command injection",
22725
+ bridge_record_event: "Record an event, constraint, or blocker for orchestration memory",
22726
+ bridge_get_project_events: "Fetch recorded project events filtered by tags or permanence",
22727
+ bridge_get_project_memory: "Fetch durable permanent guardrails and architectural constraints",
22728
+ bridge_update_todo_status: "Update todo status directly without modifying title"
22695
22729
  };
22696
22730
  if (Object.keys(BRIDGE_TOOL_DOCS).length === 0) {
22697
22731
  throw new Error("BRIDGE_TOOL_DOCS registry is empty at module load \u2014 fail fast");
@@ -22850,6 +22884,22 @@ function registerOrchestrationTools(server, ctx) {
22850
22884
  },
22851
22885
  (opts) => safe(() => getProjectEvents(ctx, opts))
22852
22886
  );
22887
+ server.tool(
22888
+ "bridge_get_project_memory",
22889
+ "Get durable project memory guardrails (permanent constraints, architectural decisions, and active blockers). Excludes soft-archived items.",
22890
+ {
22891
+ projectId: external_exports.string().min(1).optional().describe("Target project ID. Defaults to caller panel project."),
22892
+ limit: external_exports.number().int().min(1).max(50).optional().default(20).describe("Max memories to retrieve")
22893
+ },
22894
+ async (opts) => safe(async () => {
22895
+ try {
22896
+ return await getProjectEvents(ctx, { ...opts, permanent: true, limit: opts.limit ?? 20 });
22897
+ } catch (error2) {
22898
+ console.error("[memory] bridge_get_project_memory read failure", { error: String(error2), projectId: opts.projectId ?? ctx.projectId });
22899
+ throw error2;
22900
+ }
22901
+ })
22902
+ );
22853
22903
  }
22854
22904
 
22855
22905
  // ../mcp-server/src/tools/messaging.ts
@@ -22995,7 +23045,8 @@ var ListPersonasSchema = external_exports.object({
22995
23045
  });
22996
23046
  var GetPersonaSchema = external_exports.object({
22997
23047
  id: external_exports.string().min(1).describe("Persona id (UUID)"),
22998
- projectId: external_exports.string().min(1).optional()
23048
+ projectId: external_exports.string().min(1).optional(),
23049
+ fields: external_exports.array(external_exports.enum(["id", "name", "systemPrompt", "description", "createdAt"])).optional().describe('Fields to project (e.g. ["systemPrompt"] reduces payload by ~75%).')
22999
23050
  });
23000
23051
  var CreatePersonaSchema = external_exports.object({
23001
23052
  name: external_exports.string().min(1).max(80),