@sleep2agi/commhub-server 0.9.0-preview.71 → 0.9.0-preview.72

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.
package/src/tools.ts CHANGED
@@ -5780,12 +5780,14 @@ export function registerTools(server: McpServer, clientIP?: string, enforceNetwo
5780
5780
  };
5781
5781
  const pick = (args: Record<string, unknown>, keys: string[]) => Object.fromEntries(keys.filter(k => args[k] !== undefined).map(k => [k, args[k]]));
5782
5782
  const REQ_WRITE_KEYS = [...Object.keys(reqFields), "external_ref", "archived"];
5783
+ const REQ_ID_DESC = "requirement id (req_…) or its short number \"#N\" (e.g. \"#42\", per network; a user token that sees several networks must also pass network_id, else 409 ambiguous_seq)";
5783
5784
 
5784
5785
  server.tool(
5785
5786
  "requirements_list",
5786
- "List requirement tasks in your network. Filters: status (pool/doing/done), project_id ('none' = no project), owner / agent_owner ('user:<id>' / 'node:<id>' / 'none'), updated_since (ISO), external_ref, parent_id / top_level, include_archived. Newest first, max 500. Each task carries children {total, done}.",
5787
+ "List requirement tasks in your network. Filters: seq (the per-network short number shown as #N), status (pool/doing/done), project_id ('none' = no project), owner / agent_owner ('user:<id>' / 'node:<id>' / 'none'), updated_since (ISO), external_ref, parent_id / top_level, include_archived; q = search title / description / owner, agent and participant names / project name / tags (space-separated terms are ANDed). Newest first, 500 per page by default (limit ≤ 1000); has_more + next_cursor → pass cursor for the next page. Each task carries children {total, done}.",
5787
5788
  {
5788
5789
  network_id: z.string().max(200).optional(),
5790
+ seq: z.number().int().positive().optional().describe("short number (#N) of one task in this network"),
5789
5791
  status: z.enum(["pool", "doing", "done"]).optional(),
5790
5792
  project_id: z.string().max(200).optional(),
5791
5793
  owner: z.string().max(210).optional(),
@@ -5794,11 +5796,11 @@ export function registerTools(server: McpServer, clientIP?: string, enforceNetwo
5794
5796
  external_ref: z.string().max(200).optional(),
5795
5797
  include_archived: z.boolean().optional(),
5796
5798
  parent_id: z.string().max(200).optional().describe("children of this requirement ('none' = top level)"),
5797
- top_level: z.boolean().optional(),
5799
+ top_level: z.boolean().optional(), q: z.string().max(200).optional(), limit: z.number().int().min(1).max(1000).optional(), cursor: z.string().max(600).optional(),
5798
5800
  },
5799
5801
  async (args) => {
5800
5802
  const q = new URLSearchParams();
5801
- for (const k of ["status", "project_id", "owner", "agent_owner", "updated_since", "external_ref", "parent_id"] as const) if (args[k] !== undefined) q.set(k, String(args[k]));
5803
+ for (const k of ["seq", "status", "project_id", "owner", "agent_owner", "updated_since", "external_ref", "parent_id", "q", "limit", "cursor"] as const) if (args[k] !== undefined) q.set(k, String(args[k]));
5802
5804
  if (args.include_archived) q.set("include_archived", "1");
5803
5805
  if (args.top_level) q.set("top_level", "1");
5804
5806
  return requirementsCall("GET", `/api/requirements${q.size ? `?${q}` : ""}`, args.network_id);
@@ -5807,8 +5809,8 @@ export function registerTools(server: McpServer, clientIP?: string, enforceNetwo
5807
5809
 
5808
5810
  server.tool(
5809
5811
  "requirements_get",
5810
- "Get one requirement task by id (with description, checklist, owners, project, external_ref).",
5811
- { id: z.string().min(1).max(200), network_id: z.string().max(200).optional() },
5812
+ "Get one requirement task by id or by its short number \"#N\" (with description, checklist, owners, project, external_ref, seq).",
5813
+ { id: z.string().min(1).max(200).describe(REQ_ID_DESC), network_id: z.string().max(200).optional() },
5812
5814
  async ({ id, network_id }) => requirementsCall("GET", `/api/requirements/${encodeURIComponent(id)}`, network_id),
5813
5815
  );
5814
5816
 
@@ -5821,15 +5823,15 @@ export function registerTools(server: McpServer, clientIP?: string, enforceNetwo
5821
5823
 
5822
5824
  server.tool(
5823
5825
  "requirements_update",
5824
- "Patch a requirement task; omitted fields keep their value. archived=true hides it from the default list (agents cannot delete).",
5825
- { id: z.string().min(1).max(200), network_id: z.string().max(200).optional(), ...reqFields, external_ref: z.string().max(200).nullable().optional(), archived: z.boolean().optional() },
5826
+ "Patch a requirement task (id or \"#N\"); omitted fields keep their value. archived=true hides it from the default list (agents cannot delete).",
5827
+ { id: z.string().min(1).max(200).describe(REQ_ID_DESC), network_id: z.string().max(200).optional(), ...reqFields, external_ref: z.string().max(200).nullable().optional(), archived: z.boolean().optional() },
5826
5828
  async (args) => requirementsCall("PATCH", `/api/requirements/${encodeURIComponent(args.id)}`, args.network_id, pick(args, REQ_WRITE_KEYS)),
5827
5829
  );
5828
5830
 
5829
5831
  server.tool(
5830
5832
  "requirements_checklist_toggle",
5831
5833
  "Set one checklist item done / not done (only that item is written, so concurrent edits of other items are kept).",
5832
- { id: z.string().min(1).max(200), item_id: z.string().regex(/^[A-Za-z0-9_-]{1,40}$/), done: z.boolean(), network_id: z.string().max(200).optional() },
5834
+ { id: z.string().min(1).max(200).describe(REQ_ID_DESC), item_id: z.string().regex(/^[A-Za-z0-9_-]{1,40}$/), done: z.boolean(), network_id: z.string().max(200).optional() },
5833
5835
  async ({ id, item_id, done, network_id }) => requirementsCall("PATCH", `/api/requirements/${encodeURIComponent(id)}/checklist/${encodeURIComponent(item_id)}`, network_id, { done }),
5834
5836
  );
5835
5837