@theronap/agnoclast-mcp 0.9.301 → 0.9.302

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.
@@ -20,8 +20,10 @@
20
20
  // · a document or spreadsheet the session OPENED outside a repo — what the person handed it to work on.
21
21
  // Never: anything under node_modules, .git, ~/.claude, ~/.cortex, temp folders, dotfiles, or over 50 MB.
22
22
  //
23
- // It says nothing when the person has not turned on "Let assistants upload files": the upload would be refused. Its
24
- // words are facts and options marked "Agnoclast note:", like every other note since 0.9.299.
23
+ // It says nothing unless Agnoclast answers that this person's AI may store files: a paid brain plan, the feature on,
24
+ // and "Let assistants upload files" turned on (ADR-0108; /api/stored-files/capture-status). No answer is silence too,
25
+ // so a free account is never prompted. Its words are facts and options marked "Agnoclast note:", like every other
26
+ // note since 0.9.299.
25
27
  //
26
28
  // ⚠ SELF-CONTAINED ON PURPOSE: setup copies this one file to ~/.cortex/hooks/ and Claude Code runs it with plain
27
29
  // `node` after every Write / Edit / Read, so it may import only Node built-ins (no npx start-up on the hot path).
@@ -33,7 +35,6 @@ import { createHash } from 'node:crypto'
33
35
 
34
36
  export const MAX_BYTES = 50 * 1024 * 1024
35
37
  export const RENUDGE_MS = 10 * 60 * 1000
36
- const UPLOAD_SETTING = 'documents.agent_uploads'
37
38
 
38
39
  const DOCUMENTS = new Set(['docx', 'doc', 'dotx', 'xlsx', 'xlsm', 'xls', 'pptx', 'ppt', 'potx', 'pdf', 'odt', 'ods', 'odp', 'rtf', 'pages', 'numbers', 'key'])
39
40
  const DELIVERABLES = new Set(['md', 'markdown', 'html', 'htm', 'csv', 'tsv', 'txt', 'ipynb', 'png', 'jpg', 'jpeg', 'gif', 'webp', 'svg'])
@@ -112,16 +113,15 @@ export function agnoclastCredentials({ home, env = process.env, read = readFileS
112
113
  return { token, base: (base || 'https://agnoclast.com').replace(/\/+$/, '') }
113
114
  }
114
115
 
115
- /** true / false from the server, or null when it could not be asked. */
116
+ /** true / false from the server's capture-status, or null when it could not be asked. */
116
117
  async function uploadsAllowed({ home, fetchImpl = globalThis.fetch }) {
117
118
  const { token, base } = agnoclastCredentials({ home })
118
119
  if (!token || !fetchImpl) return null
119
120
  try {
120
- const res = await fetchImpl(`${base}/api/settings`, { headers: { Authorization: `Bearer ${token}` }, signal: AbortSignal.timeout(4000) })
121
+ const res = await fetchImpl(`${base}/api/stored-files/capture-status`, { headers: { Authorization: `Bearer ${token}` }, signal: AbortSignal.timeout(4000) })
121
122
  if (!res.ok) return null
122
123
  const view = await res.json()
123
- const s = (view?.settings ?? []).find((x) => x?.key === UPLOAD_SETTING)
124
- return s ? Boolean(s.value) : null
124
+ return typeof view?.store === 'boolean' ? view.store : null
125
125
  } catch { return null }
126
126
  }
127
127
 
@@ -159,8 +159,8 @@ export async function runFileCapture({ input, home = homedir(), now = Date.now()
159
159
  state.uploads = await uploadsAllowed({ home, fetchImpl })
160
160
  state.uploadsAt = now
161
161
  }
162
- // Off: say nothing, the upload would only be refused. Unknown (offline, old server): say it, and let the tool report.
163
- if (state.uploads === false) { save(file, state); return null }
162
+ // Only a yes is a yes: not paid, uploads off, offline or an old server all say nothing.
163
+ if (state.uploads !== true) { save(file, state); return null }
164
164
  state.nudged = { ...state.nudged, [d.path]: now }
165
165
  save(file, state)
166
166
  return { hookSpecificOutput: { hookEventName: 'PostToolUse', additionalContext: nudgeText(d) } }
@@ -22,7 +22,7 @@ export const REGULAR_ONLY_TOOLS = [
22
22
  'list_records', 'read_record', 'timeline_pull', 'record_status', 'set_record_notes', 'set_record_privacy',
23
23
  'relabel_record_people', 'supersede_record', 'move_record', 'contain_record', 'pending_records', 'claim_record',
24
24
  'route_record', 'unroute_record', 'request_file', 'get_file', 'create_custom_source', 'search_spam_email',
25
- 'gmail_modify', 'draft_email_reply', 'request_send_email', 'send_imessage', 'add_to_brain',
25
+ 'gmail_modify', 'draft_email_reply', 'request_send_email', 'send_imessage',
26
26
  ]
27
27
 
28
28
  /** What a locked tool answers when the check itself could not be made. Nothing was run. */
@@ -11,7 +11,7 @@
11
11
  // That is safe because hiding a tool is a courtesy, and every gated route checks its own flag on the server.
12
12
 
13
13
  /** Tools any release flag gates — hidden when the server cannot be asked. Mirror of allGatedTools(). */
14
- export const GATED_FALLBACK = ['arrivals', 'attach_document', 'document_diff', 'export_page', 'file_arrival', 'file_document', 'find_documents', 'finish_task', 'get_document', 'hand_task', 'handed_tasks', 'hold_task', 'import_document_as_page', 'intake_shadow', 'list_documents', 'my_messages', 'my_tasks', 'pin_document', 'read_conversation', 'read_document', 'send_message', 'set_manager', 'tasks_waiting', 'upload_document_version']
14
+ export const GATED_FALLBACK = ['arrivals', 'attach_document', 'document_diff', 'export_page', 'file_arrival', 'file_document', 'find_documents', 'finish_task', 'get_document', 'hand_task', 'handed_tasks', 'hold_task', 'import_document_as_page', 'intake_shadow', 'list_documents', 'my_messages', 'my_tasks', 'pin_document', 'read_conversation', 'read_document', 'send_message', 'set_manager', 'store_file', 'tasks_waiting', 'upload_document_version']
15
15
 
16
16
  export const RELEASE_FETCH_TIMEOUT_MS = 2500
17
17
  /** A remembered answer older than this is not trusted: a week covers a quiet weekend without hiding tools for long. */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@theronap/agnoclast-mcp",
3
- "version": "0.9.301",
3
+ "version": "0.9.302",
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": {