bridge-agent 0.13.1 → 0.13.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.
@@ -22370,8 +22370,12 @@ async function pollAgentMessages(ctx, since) {
22370
22370
  projectPath(ctx, `/messages${qs}`)
22371
22371
  );
22372
22372
  }
22373
+ function isProjectScoped(ctx) {
22374
+ return !!ctx.projectId && ctx.projectId !== "workspace";
22375
+ }
22373
22376
  async function listAgents(ctx) {
22374
- return request(ctx, "GET", workspacePath(ctx, "/agents"));
22377
+ const suffix = isProjectScoped(ctx) ? `/agents?projectId=${encodeURIComponent(ctx.projectId)}` : "/agents";
22378
+ return request(ctx, "GET", workspacePath(ctx, suffix));
22375
22379
  }
22376
22380
  async function getAgentStatus(ctx, agentId) {
22377
22381
  return request(ctx, "GET", projectPath(ctx, `/agents/${agentId}`));
@@ -22746,7 +22750,7 @@ function registerOrchestrationTools(server, ctx) {
22746
22750
  );
22747
22751
  server.tool(
22748
22752
  "bridge_list_agents",
22749
- 'List all active agents in this workspace (cross-project). Each entry includes agentId, agentKey, status (idle/busy/disconnected), assignedTodo, role, runnerCmd, projectId, inRun, state (idle/working), lastOutputAt, and contextUsedPct (0\u2013100, null if not a Claude agent). inRun:true means the agent is already registered in the active run. inRun:false means it was spawned after the run started or in a previous session \u2014 it can still be assigned (auto-registered on first assign). Returns agents from all projects in the workspace \u2014 not just the current project. Runner agents (role:"runner") are dev server consoles \u2014 use bridge_get_agent_output to read them.',
22753
+ `List active agents in your scope. Project-scoped contexts (the default) see ONLY this project's agents; workspace-scoped contexts see all agents across projects. Each entry includes agentId, agentKey, status (idle/busy/disconnected), assignedTodo, role, runnerCmd, projectId, inRun, state (idle/working), lastOutputAt, and contextUsedPct (0\u2013100, null if not a Claude agent). inRun:true means the agent is already registered in the active run. inRun:false means it was spawned after the run started or in a previous session \u2014 it can still be assigned (auto-registered on first assign). Runner agents (role:"runner") are dev server consoles \u2014 use bridge_get_agent_output to read them.`,
22750
22754
  {},
22751
22755
  () => safe(() => listAgents(ctx))
22752
22756
  );
@@ -22895,9 +22899,13 @@ async function safe2(fn) {
22895
22899
  function registerWorkspaceTools(server, ctx) {
22896
22900
  server.tool(
22897
22901
  "bridge_list_groups",
22898
- "List all agent groups (teams) in the workspace. Returns groupId, teamName (human-readable name if set), member agentIds, and agent count.",
22902
+ "List agent groups (teams) in your scope. Project-scoped contexts see only their project's groups; workspace scope sees all. Returns groupId, teamName (human-readable name if set), member agentIds, and agent count.",
22899
22903
  {},
22900
- () => safe2(() => request(ctx, "GET", workspacePath(ctx, "/groups")))
22904
+ () => safe2(() => request(
22905
+ ctx,
22906
+ "GET",
22907
+ workspacePath(ctx, isProjectScoped(ctx) ? `/groups?projectId=${encodeURIComponent(ctx.projectId)}` : "/groups")
22908
+ ))
22901
22909
  );
22902
22910
  server.tool(
22903
22911
  "bridge_get_group_status",
@@ -22940,7 +22948,7 @@ function registerWorkspaceTools(server, ctx) {
22940
22948
  );
22941
22949
  server.tool(
22942
22950
  "bridge_peek_panel",
22943
- "Read the last N lines of any panel's terminal output, workspace-wide (no project boundary). Use this to check what a specific agent is doing.",
22951
+ "Read the last N lines of a panel's terminal output. Project-scoped contexts may only peek at their own project's panels (403 cross_project_block otherwise); workspace scope has no project boundary. Use this to check what a specific agent is doing.",
22944
22952
  {
22945
22953
  agentId: external_exports.string().describe("The panel/agent ID to peek at"),
22946
22954
  lines: external_exports.number().int().min(1).max(300).optional().describe("Trailing lines to return (default 50, max 300)")
@@ -22949,7 +22957,7 @@ function registerWorkspaceTools(server, ctx) {
22949
22957
  );
22950
22958
  server.tool(
22951
22959
  "bridge_status_panel",
22952
- "Get current status of any panel in the workspace, regardless of project. Returns agentKey, status, daemonId, role, projectId.",
22960
+ "Get current status of a panel. Project-scoped contexts may only inspect their own project's panels (403 cross_project_block otherwise). Returns agentKey, status, daemonId, role, projectId.",
22953
22961
  { agentId: external_exports.string().describe("The panel/agent ID to inspect") },
22954
22962
  ({ agentId }) => safe2(() => request(ctx, "GET", workspacePath(ctx, `/agents/${agentId}`)))
22955
22963
  );