@edda-business/mcp 0.58.0 → 0.59.0

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/server.js +24 -27
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@edda-business/mcp",
3
- "version": "0.58.0",
3
+ "version": "0.59.0",
4
4
  "description": "Edda — the company data layer for AI agents.",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
package/src/server.js CHANGED
@@ -691,44 +691,41 @@ export function createServer() {
691
691
  );
692
692
 
693
693
  // ===========================================================================
694
- // TOOL: propose_company_file — POST /v2/company/propose
694
+ // TOOL: propose_company_file — POST /v2/company/pages
695
695
  // The WRITE side of the company vault (search_company_knowledge is the read side).
696
- // Admin-only: only an owner/admin may add to the shared knowledge; a member's agent
697
- // can read the company vault but gets a permission message here.
696
+ // Writes an in-app company page directly (no GitHub). Members with a write role
697
+ // publish it live; viewers land it in the company inbox for an admin to approve.
698
698
  // ===========================================================================
699
699
  server.tool(
700
700
  "propose_company_file",
701
- "Propose a markdown file for the SHARED COMPANY vault — the workspace's declared knowledge " +
701
+ "Add a markdown page to the SHARED COMPANY vault — the workspace's declared knowledge " +
702
702
  "(policies, playbooks, decisions, SOPs, how-we-work) that every member's agent can read via " +
703
- "search_company_knowledge. This OPENS A PULL REQUEST against the connected company repo for a " +
704
- "human to review and merge in GitHub nothing goes live until it's merged (company knowledge " +
705
- "is shared + institutional, so review-before-publish is the default; on merge the normal git " +
706
- "sync ingests it). Use it to contribute company-wide knowledge. ADMIN-ONLY: only an owner/admin " +
707
- "may propose; a regular member's agent can READ the vault but gets a permission message here. " +
708
- "NOT the member's private notes (use propose_vault_file), NOT a note on a contact (use save_note).",
703
+ "search_company_knowledge. This writes the page IN-APP: a member with a write role publishes " +
704
+ "it live immediately; a viewer's page lands in the company inbox for an admin to approve. Set " +
705
+ "`visibility` to scope who sees it 'company' (everyone, the default), 'department' (the team), " +
706
+ "or 'owner' (just you). Use it to contribute company-wide knowledge. " +
707
+ "NOT the member's private vault (use save_to_vault), NOT a note on a contact (use save_note).",
709
708
  {
710
- folder: z.string().describe("The company-vault folder to file under (e.g. 'company-wiki', 'decisions', 'projects', 'clients'). Must be an existing company folder; no slashes."),
711
- name: z.string().describe("The file name, ending in .md, e.g. 'Refund Policy.md' or 'Q3 Planning — 2026-08-22.md'."),
712
- content: z.string().describe("The full markdown content of the file."),
713
- subfolder: z.string().optional().describe("Optional subfolder within the folder."),
714
- message: z.string().optional().describe("Optional PR title / commit message describing the change."),
715
- pr_group: z.string().optional().describe("Optional key to batch several proposals from one work session into a SINGLE pull request (same key → same PR)."),
709
+ name: z.string().describe("The page name, e.g. 'Refund Policy' or 'Q3 Planning — 2026-08-22'. A '.md' suffix is added if missing."),
710
+ content: z.string().describe("The full markdown content of the page."),
711
+ visibility: z.enum(["owner", "department", "company"]).optional().describe("Who can see the page: 'company' (everyone — default), 'department' (the team), or 'owner' (just you)."),
712
+ folder_id: z.string().optional().describe("Optional id of an existing company folder to file under. Omit to land it in the default 'wiki' folder."),
716
713
  },
717
- async ({ folder, name, content, subfolder, message, pr_group }) => {
714
+ async ({ name, content, visibility, folder_id }) => {
718
715
  try {
719
- const r = await post("/v2/company/propose", { folder, name, content, subfolder, message, pr_group });
720
- const how = r?.added_to_existing ? "added to the open PR" : "opened a pull request";
721
- return { content: [{ type: "text", text: `Proposed "${name}" — ${how}${r?.pr_url ? `: ${r.pr_url}` : ""}. Review the diff and merge it in GitHub to publish into company knowledge.` }] };
716
+ const r = await post("/v2/company/pages", { name, content, visibility: visibility ?? "company", folder_id });
717
+ const live = r?.page?.status === "live";
718
+ const where = live
719
+ ? `published live to the company vault — searchable now`
720
+ : `sent to the company inbox for an admin to approve`;
721
+ return { content: [{ type: "text", text: `"${r?.page?.name ?? name}" ${where}.` }] };
722
722
  } catch (e) {
723
723
  const msg = String(e?.message || e);
724
- if (msg.includes("admins_only") || msg.includes("(403)")) {
725
- return { content: [{ type: "text", text: `Not proposedwriting to the company vault is admin-only. You can READ it with search_company_knowledge, but only an owner/admin can propose changes.` }] };
726
- }
727
- if (msg.includes("no_company_repo")) {
728
- return { content: [{ type: "text", text: `Not proposed — no company GitHub repo is connected. An admin connects one under Company vault first.` }] };
724
+ if (msg.includes("forbidden") || msg.includes("(403)")) {
725
+ return { content: [{ type: "text", text: `Not savedyou don't have access to write to this company vault.` }] };
729
726
  }
730
- if (msg.includes("repo_write_denied")) {
731
- return { content: [{ type: "text", text: `Not proposedthe connected repo token is read-only. An admin must reconnect it with Contents:write + Pull requests:write.` }] };
727
+ if (msg.includes("bad_folder")) {
728
+ return { content: [{ type: "text", text: `Not savedthat folder_id isn't a company folder in this workspace. Omit it to use the default 'wiki' folder.` }] };
732
729
  }
733
730
  throw e;
734
731
  }