@theronap/agnoclast-mcp 0.9.268 → 0.9.270

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', 'export_page', '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', 'import_document_as_page', '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
@@ -7445,6 +7445,38 @@ function renderNudge(payload) {
7445
7445
  },
7446
7446
  )
7447
7447
 
7448
+ // TEXT-FIRST TEST, slice B (2026-10-26): a stored Word document becomes a page; the .docx moves onto it, pinned.
7449
+ server.registerTool(
7450
+ 'import_document_as_page',
7451
+ {
7452
+ title: 'Turn a stored Word document into a page',
7453
+ description: 'Convert a stored .docx into an editable wiki page — headings become sections, lists/tables/bold/links survive, images are left out (the original keeps them). The new page is created at the same visibility as the file\'s current page, links back to it, and the old page gets one line linking forward. The .docx moves onto the new page, pinned, and the two are KEPT IN STEP: a save of the Word file rewrites the page, and a page edit rebuilds the Word file the next time it is opened (never overwriting when both changed — the page then says so). Needs edit access to the file\'s page. Afterwards, link the new page to the people, classes or projects it is about with edit_page.',
7454
+ inputSchema: {
7455
+ file_id: z.string().describe('the stored file\'s id (from list_documents or read_page\'s 📌/📎 lines)'),
7456
+ title: z.string().optional().describe('the new page\'s name; default the file\'s title'),
7457
+ },
7458
+ },
7459
+ async ({ file_id, title }) => {
7460
+ let res
7461
+ try {
7462
+ res = await fetchCortex(`${BASE}/api/stored-files/${encodeURIComponent(file_id)}/import-page`, {
7463
+ method: 'POST', headers: { Authorization: `Bearer ${TOKEN}`, 'Content-Type': 'application/json' },
7464
+ body: JSON.stringify(title ? { title } : {}),
7465
+ })
7466
+ } catch (e) { return toolError(`Could not import: ${e.message}`) }
7467
+ if (!res.ok) return docFail('import the document', res)
7468
+ const o = await res.json()
7469
+ const lines = [`Made the page "${o.title}" (ref ${o.ref}, ${o.tier}) with ${o.sections} section${o.sections === 1 ? '' : 's'}; the .docx is pinned on it as the original.`]
7470
+ if (o.images) lines.push(`${o.images} image${o.images === 1 ? ' was' : 's were'} left out — the original file keeps ${o.images === 1 ? 'it' : 'them'}.`)
7471
+ if (o.shortenedHeadings) lines.push(`${o.shortenedHeadings} heading${o.shortenedHeadings === 1 ? ' was' : 's were'} over 80 characters and shortened.`)
7472
+ if (o.splitSections) lines.push(`${o.splitSections} very long section${o.splitSections === 1 ? ' was' : 's were'} split into parts.`)
7473
+ lines.push(o.linkedFromOldPage ? 'The old page now links to it.' : 'The old page could not be given a link line; add one with edit_page if it matters.')
7474
+ lines.push('The page and the Word file are now kept in step — a save of either updates the other.')
7475
+ lines.push(`Next: read_page "${o.title}" and link it to the people, classes or projects it is about with edit_page.`)
7476
+ return { content: [{ type: 'text', text: lines.join('\n') }] }
7477
+ },
7478
+ )
7479
+
7448
7480
  // UPLOADS (slice 4). The server refuses an assistant unless the person turned on "Let assistants upload
7449
7481
  // files" in Agnoclast → Settings — a switch only the console can flip. These tools never ask for it.
7450
7482
  // 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.268",
3
+ "version": "0.9.270",
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": {