@theronap/agnoclast-mcp 0.9.340 → 0.9.341
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/lib/server.mjs +4 -3
- package/lib/work_log_render.mjs +14 -2
- package/package.json +1 -1
package/lib/server.mjs
CHANGED
|
@@ -47,7 +47,7 @@ import {
|
|
|
47
47
|
UPDATE_EVENT_DESCRIPTION, UPDATE_SERIES_DESCRIPTION, renderEventCancelled, renderSeriesRevised, seriesPatchBody,
|
|
48
48
|
} from './calendar_events.mjs'
|
|
49
49
|
import { formatFoundDocuments } from './found_documents.mjs'
|
|
50
|
-
import { renderWorkLog } from './work_log_render.mjs'
|
|
50
|
+
import { renderLogWorkResult, renderWorkLog } from './work_log_render.mjs'
|
|
51
51
|
import { fileSealedCapture } from './file_sealed_capture.mjs'
|
|
52
52
|
|
|
53
53
|
// PAGE tiers (ADR-0071). Six for a PAGE; a RECORD keeps three (`privacy` on log_session and
|
|
@@ -2280,7 +2280,7 @@ function renderNudge(payload) {
|
|
|
2280
2280
|
text: z.string().min(1).describe('the message body, as plain text'),
|
|
2281
2281
|
cc: z.array(z.string()).optional().describe('cc addresses'),
|
|
2282
2282
|
bcc: z.array(z.string()).optional().describe('bcc addresses'),
|
|
2283
|
-
replyToRecordId: z.string().optional().describe('
|
|
2283
|
+
replyToRecordId: z.string().optional().describe('the Agnoclast email record you are answering. ALWAYS pass it (or replyToMessageId) when replying to someone\'s email, so the answer stays in their thread; without it they get a new, unconnected email'),
|
|
2284
2284
|
replyToMessageId: z.string().optional().describe('reply in the thread of this message id (Gmail or Outlook)'),
|
|
2285
2285
|
account: z.string().email().optional().describe('which connected mailbox (Gmail or Outlook) to send from, when the user has more than one'),
|
|
2286
2286
|
from: z.enum(['own', 'overseer']).optional().describe("AI member agents only: 'own' (default) = your own address; 'overseer' = the mailbox an overseer opened to you"),
|
|
@@ -6634,7 +6634,8 @@ function renderNudge(payload) {
|
|
|
6634
6634
|
const d = classify(res.status, res.headers.get('content-type'), await res.text(), res.headers.get('x-vercel-id'))
|
|
6635
6635
|
return toolError(`Could not add to your work log: ${d.message}`)
|
|
6636
6636
|
}
|
|
6637
|
-
|
|
6637
|
+
const out = await res.json().catch(() => null)
|
|
6638
|
+
return { content: [{ type: 'text', text: renderLogWorkResult(out?.pagesBehind) }] }
|
|
6638
6639
|
},
|
|
6639
6640
|
)
|
|
6640
6641
|
|
package/lib/work_log_render.mjs
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
// Renders GET /api/me/work-log for the `work_log` tool. Mirrors renderWorkLog in web/lib/engine/agent_work_log.ts
|
|
2
2
|
// (the hosted connector's copy), which this package cannot import.
|
|
3
3
|
const TZ = 'America/Denver'
|
|
4
|
-
const KIND_WORD = { edit: 'edited', placement: 'filed', discard: 'discarded an arrival from' }
|
|
4
|
+
const KIND_WORD = { edit: 'edited', placement: 'filed', discard: 'discarded an arrival from', send: 'emailed' }
|
|
5
|
+
|
|
6
|
+
const PAGE_DEBT_HOW = 'A work-log line does not catch a page up. Read each one and fold in what the newer records change with edit_page. '
|
|
7
|
+
+ 'If they change nothing on a page, name that page in log_work\'s `pages` and say so in the line; that clears it.'
|
|
5
8
|
|
|
6
9
|
const time = (iso) => new Date(iso).toLocaleTimeString('en-US', { timeZone: TZ, hour: 'numeric', minute: '2-digit' })
|
|
7
10
|
const stub = (a) => `${KIND_WORD[a.kind] ?? a.kind} ${a.what ? `"${a.what}"` : 'an item'}${a.reason ? ` (${a.reason})` : ''}`
|
|
@@ -20,7 +23,7 @@ export function renderWorkLog(log) {
|
|
|
20
23
|
if (behind.length) {
|
|
21
24
|
out.push('', `Agnoclast pages: ${behind.length} page${behind.length === 1 ? '' : 's'} you work on ${behind.length === 1 ? 'has' : 'have'} records newer than the page itself:`,
|
|
22
25
|
...behind.slice(0, 20).map((p) => `- "${p.title}": ${p.newer} record${p.newer === 1 ? '' : 's'} filed on it since its last edit (edit_page base_version ${p.version ?? '(read_page for it)'})`),
|
|
23
|
-
|
|
26
|
+
PAGE_DEBT_HOW)
|
|
24
27
|
}
|
|
25
28
|
if (uncovered.length) {
|
|
26
29
|
out.push('', `Not yet covered by a line (${uncovered.length}):`,
|
|
@@ -29,3 +32,12 @@ export function renderWorkLog(log) {
|
|
|
29
32
|
}
|
|
30
33
|
return out.join('\n')
|
|
31
34
|
}
|
|
35
|
+
|
|
36
|
+
/** What log_work answers (mirrors renderLogWorkResult): the line is saved, and any page still behind is named. */
|
|
37
|
+
export function renderLogWorkResult(pagesBehind) {
|
|
38
|
+
if (!pagesBehind?.length) return 'Added to your work log for today.'
|
|
39
|
+
const shown = pagesBehind.slice(0, 5).map((p) =>
|
|
40
|
+
` - "${p.title}": ${p.newer} record${p.newer === 1 ? '' : 's'} filed on it since its last edit (edit_page base_version ${p.version ?? '(read_page for it)'})`).join('\n')
|
|
41
|
+
const more = pagesBehind.length > 5 ? `\n - …and ${pagesBehind.length - 5} more` : ''
|
|
42
|
+
return `Added to your work log for today. It did not catch these pages up:\n\n${shown}${more}\n${PAGE_DEBT_HOW}`
|
|
43
|
+
}
|
package/package.json
CHANGED