@theronap/agnoclast-mcp 0.9.267 → 0.9.268

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.
@@ -5,7 +5,7 @@
5
5
  // that web/lib/engine/release.test.ts pins to the server's registry.
6
6
 
7
7
  /** Tools any release flag gates — hidden when the server cannot be asked. Mirror of allGatedTools(). */
8
- export const GATED_FALLBACK = ['attach_document', 'document_diff', 'get_document', 'intake_shadow', 'list_documents', 'my_messages', 'pin_document', 'read_conversation', 'read_document', 'send_message', 'set_manager', 'upload_document_version']
8
+ export const GATED_FALLBACK = ['attach_document', 'document_diff', 'export_page', 'get_document', 'intake_shadow', 'list_documents', 'my_messages', 'pin_document', 'read_conversation', 'read_document', 'send_message', 'set_manager', 'upload_document_version']
9
9
 
10
10
  export const RELEASE_FETCH_TIMEOUT_MS = 2500
11
11
 
package/lib/server.mjs CHANGED
@@ -7416,6 +7416,35 @@ function renderNudge(payload) {
7416
7416
  },
7417
7417
  )
7418
7418
 
7419
+ // TEXT-FIRST TEST, slice A (2026-10-26): a page rendered as a styled Word doc, in its brain's style.
7420
+ server.registerTool(
7421
+ 'export_page',
7422
+ {
7423
+ title: 'Export a page as a styled Word document',
7424
+ description: 'Render a wiki page as a .docx in its brain\'s document style (set by the brain\'s owner or admins in the console) and save it to ~/Downloads/cortex/. Use it when someone needs to SEND or print a page: the page stays the master; the Word file is a copy of it. For PDF, the person uses Export ▸ PDF on the page in Agnoclast.',
7425
+ inputSchema: {
7426
+ page: z.string().describe('the page: its exact title, its `ref:` from read_page, or a document id'),
7427
+ tier: z.string().optional().describe('which copy of a two-copy page (e.g. "scoped"); default the most recently written'),
7428
+ },
7429
+ },
7430
+ async ({ page, tier }) => {
7431
+ const q = new URLSearchParams({ page })
7432
+ if (tier) q.set('tier', tier)
7433
+ let res
7434
+ try { res = await fetchCortex(`${BASE}/api/brain/page/export?${q}`, { headers: { Authorization: `Bearer ${TOKEN}` } }) }
7435
+ catch (e) { return toolError(`Could not export: ${e.message}`) }
7436
+ if (!res.ok) return docFail('export the page', res)
7437
+ const buf = Buffer.from(await res.arrayBuffer())
7438
+ const m = /filename="([^"]+)"/.exec(res.headers.get('content-disposition') ?? '')
7439
+ const name = (m ? m[1] : 'page.docx').replace(/[^\w.\- ]/g, '_')
7440
+ const dir = join(homedir(), 'Downloads', 'cortex')
7441
+ mkdirSync(dir, { recursive: true })
7442
+ const path = join(dir, name)
7443
+ writeFileSync(path, buf)
7444
+ return { content: [{ type: 'text', text: `Saved "${page}" as a styled Word document: ${path} (${Math.round(buf.length / 1024)} KB).` }] }
7445
+ },
7446
+ )
7447
+
7419
7448
  // UPLOADS (slice 4). The server refuses an assistant unless the person turned on "Let assistants upload
7420
7449
  // files" in Agnoclast → Settings — a switch only the console can flip. These tools never ask for it.
7421
7450
  // Bytes go straight to storage on the signed URL the server hands out, then the server reads them back.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@theronap/agnoclast-mcp",
3
- "version": "0.9.267",
3
+ "version": "0.9.268",
4
4
  "description": "Connect your AI assistant to Cortex — your org's projects, activity, gaps, and directives, scoped to you.",
5
5
  "type": "module",
6
6
  "bin": {