@integrity-labs/agt-cli 0.28.154 → 0.28.156

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/dist/mcp/index.js CHANGED
@@ -22593,7 +22593,7 @@ server.tool(
22593
22593
  );
22594
22594
  server.tool(
22595
22595
  "knowledge_list",
22596
- "List team knowledge entries (ids, titles, source types). Use before knowledge_add to check if a fact is already saved, or before knowledge_update/delete to find the target id. Returns metadata only \u2014 fetch the full content via the webapp if you need to read an entry back.",
22596
+ "List knowledge entries (ids, titles, source types, and scope) visible to this agent: both team-scoped and organization-scoped. Use before knowledge_add to check if a fact is already saved, or before knowledge_update/delete to find the target id AND its scope (you must pass the same scope to update/delete it). Returns metadata only; fetch the full content via the webapp if you need to read an entry back.",
22597
22597
  {},
22598
22598
  async () => {
22599
22599
  const data = await apiPost("/host/my-knowledge", {
@@ -22604,23 +22604,26 @@ server.tool(
22604
22604
  }
22605
22605
  const lines = data.items.map((k) => {
22606
22606
  const inactive = k.is_active ? "" : " (inactive)";
22607
- return `- ${k.title}${inactive} [${k.source_type}, id: ${k.id}]`;
22607
+ return `- [${k.scope ?? "team"}] ${k.title}${inactive} [${k.source_type}, id: ${k.id}]`;
22608
22608
  });
22609
22609
  return { content: [{ type: "text", text: lines.join("\n") }] };
22610
22610
  }
22611
22611
  );
22612
22612
  server.tool(
22613
22613
  "knowledge_add",
22614
- "Save a new durable fact or learning to the team knowledge base. Use when the user explicitly asks you to save/remember something, or when you discover information that will be useful on future runs (e.g. a tenant id, an API key name, a company policy). Do NOT use for tasks (use kanban_add) or trivial one-off answers. Returns the new entry id so you can target it with knowledge_update / knowledge_delete.",
22614
+ 'Save a new durable fact or learning to the knowledge base. Use when the user explicitly asks you to save/remember something, or when you discover information that will be useful on future runs (e.g. a tenant id, an API key name, a company policy). Do NOT use for tasks (use kanban_add) or trivial one-off answers. Defaults to TEAM scope; pass scope:"org" only when the user asks for organization/company-wide knowledge (visible to every team in the org). Returns the new entry id so you can target it with knowledge_update / knowledge_delete.',
22615
22615
  {
22616
22616
  title: external_exports.string().describe("Short title summarising the entry (max 200 chars)"),
22617
22617
  content: external_exports.string().describe("The knowledge content \u2014 the actual fact, learning, or reference material"),
22618
+ scope: external_exports.enum(["team", "org"]).optional().describe('Where to save it. "team" (default) = visible to this team only. "org" = visible to EVERY team in the organization; use ONLY when the user explicitly asks for organization-wide / company-wide knowledge. Never default to "team" when the user asked for org.'),
22618
22619
  source_type: external_exports.enum(["manual", "url", "upload"]).optional().describe('How the entry was sourced \u2014 default "manual" for agent-created entries'),
22619
22620
  source_url: external_exports.string().optional().describe("Optional URL the content was derived from")
22620
22621
  },
22621
22622
  async (params) => {
22623
+ const scope = params.scope ?? "team";
22622
22624
  const data = await apiPost("/host/knowledge", {
22623
22625
  agent_id: AGT_AGENT_ID,
22626
+ scope,
22624
22627
  // ENG-4538 will land a run_id column on team_knowledge; until then
22625
22628
  // the /host/knowledge endpoint has nowhere to stamp AGT_RUN_ID.
22626
22629
  add: [
@@ -22640,19 +22643,21 @@ server.tool(
22640
22643
  isError: true
22641
22644
  };
22642
22645
  }
22646
+ const scopeLabel = scope === "org" ? "organization" : "team";
22643
22647
  return {
22644
22648
  content: [{
22645
22649
  type: "text",
22646
- text: `Saved "${first.title}" to team knowledge (id: ${first.id}). It will appear in future /host/refresh context.`
22650
+ text: `Saved "${first.title}" to ${scopeLabel} knowledge (id: ${first.id}, scope: ${scope}). It will appear in future /host/refresh context once compressed.`
22647
22651
  }]
22648
22652
  };
22649
22653
  }
22650
22654
  );
22651
22655
  server.tool(
22652
22656
  "knowledge_update",
22653
- "Edit an existing knowledge entry by id. Use to correct a saved fact or refine its wording. Only the fields you pass are changed; others are left alone. Call knowledge_list first if you need to find the target id.",
22657
+ "Edit an existing knowledge entry by id. Use to correct a saved fact or refine its wording. Only the fields you pass are changed; others are left alone. Call knowledge_list first if you need to find the target id AND its scope; you must pass the same scope the entry was listed under.",
22654
22658
  {
22655
22659
  id: external_exports.string().describe("Knowledge entry id (uuid) \u2014 from knowledge_list or knowledge_add"),
22660
+ scope: external_exports.enum(["team", "org"]).optional().describe('Scope of the target entry as shown by knowledge_list ("team" default, "org" for organization-wide entries). Must match the entry, or the update will not find it.'),
22656
22661
  title: external_exports.string().optional().describe("New title (max 200 chars). Regenerates the slug."),
22657
22662
  content: external_exports.string().optional().describe("Replacement content for the entry"),
22658
22663
  is_active: external_exports.boolean().optional().describe("Set false to soft-disable without deleting")
@@ -22666,6 +22671,7 @@ server.tool(
22666
22671
  }
22667
22672
  const data = await apiPost("/host/knowledge", {
22668
22673
  agent_id: AGT_AGENT_ID,
22674
+ scope: params.scope ?? "team",
22669
22675
  update: [
22670
22676
  {
22671
22677
  id: params.id,
@@ -22687,13 +22693,15 @@ server.tool(
22687
22693
  );
22688
22694
  server.tool(
22689
22695
  "knowledge_delete",
22690
- "Remove a knowledge entry permanently. Prefer knowledge_update with is_active=false for temporary hides; use delete only when the fact was wrong or no longer applies.",
22696
+ "Remove a knowledge entry permanently. Prefer knowledge_update with is_active=false for temporary hides; use delete only when the fact was wrong or no longer applies. Pass the same scope the entry was listed under.",
22691
22697
  {
22692
- id: external_exports.string().describe("Knowledge entry id (uuid) to delete")
22698
+ id: external_exports.string().describe("Knowledge entry id (uuid) to delete"),
22699
+ scope: external_exports.enum(["team", "org"]).optional().describe('Scope of the target entry as shown by knowledge_list ("team" default, "org" for organization-wide entries). Must match the entry, or the delete will not find it.')
22693
22700
  },
22694
22701
  async (params) => {
22695
22702
  const data = await apiPost("/host/knowledge", {
22696
22703
  agent_id: AGT_AGENT_ID,
22704
+ scope: params.scope ?? "team",
22697
22705
  delete: [{ id: params.id }]
22698
22706
  });
22699
22707
  if (!data.ok || data.deleted !== 1) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@integrity-labs/agt-cli",
3
- "version": "0.28.154",
3
+ "version": "0.28.156",
4
4
  "description": "Augmented Team CLI — agent provisioning and management",
5
5
  "type": "module",
6
6
  "engines": {