@theronap/agnoclast-mcp 0.9.249 → 0.9.250
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 +12 -2
- package/package.json +1 -1
package/lib/server.mjs
CHANGED
|
@@ -1951,7 +1951,7 @@ function renderNudge(payload) {
|
|
|
1951
1951
|
{
|
|
1952
1952
|
title: 'Ask to send an email from the user\'s mailbox (Gmail or Outlook)',
|
|
1953
1953
|
description:
|
|
1954
|
-
'Send an email from the USER\'S OWN connected mailbox, Gmail or Outlook. By default this does NOT send immediately: it creates a request that WAITS for the user to approve it in Agnoclast, and it goes out at once only if their own send rule allows it. The message is frozen when the request is made, so write the final wording. Always show the user what you are about to send and get their agreement first. Returns either an approval link to relay to them, or confirmation that it already went. ⚠ NEVER call this twice for the same email — it is not idempotent, and a retry can send twice.',
|
|
1954
|
+
'Send an email from the USER\'S OWN connected mailbox, Gmail or Outlook. By default this does NOT send immediately: it creates a request that WAITS for the user to approve it in Agnoclast, and it goes out at once only if their own send rule allows it. The message is frozen when the request is made, so write the final wording. Always show the user what you are about to send and get their agreement first. Returns either an approval link to relay to them, or confirmation that it already went. ⚠ NEVER call this twice for the same email — it is not idempotent, and a retry can send twice. IF YOU ARE AN AI AGENT WITH YOUR OWN IDENTITY (a member agent): you send from YOUR OWN address, labelled as an AI agent of your owner, and one of your overseers approves unless their rule for you allows it; a line saying an AI wrote it is added for you. Pass from: \'overseer\' only if an overseer has opened their mailbox to you.',
|
|
1955
1955
|
inputSchema: {
|
|
1956
1956
|
to: z.array(z.string()).min(1).describe('recipient email addresses'),
|
|
1957
1957
|
subject: z.string().min(1).describe('the subject line'),
|
|
@@ -1961,9 +1961,11 @@ function renderNudge(payload) {
|
|
|
1961
1961
|
replyToRecordId: z.string().optional().describe('reply in the thread of this Agnoclast email record'),
|
|
1962
1962
|
replyToMessageId: z.string().optional().describe('reply in the thread of this message id (Gmail or Outlook)'),
|
|
1963
1963
|
account: z.string().email().optional().describe('which connected mailbox (Gmail or Outlook) to send from, when the user has more than one'),
|
|
1964
|
+
from: z.enum(['own', 'overseer']).optional().describe("AI member agents only: 'own' (default) = your own address; 'overseer' = the mailbox an overseer opened to you"),
|
|
1965
|
+
brain: z.string().optional().describe('AI member agents only: which brain this email is for, when you are in more than one'),
|
|
1964
1966
|
},
|
|
1965
1967
|
},
|
|
1966
|
-
async ({ to, subject, text, cc, bcc, replyToRecordId, replyToMessageId, account }) => {
|
|
1968
|
+
async ({ to, subject, text, cc, bcc, replyToRecordId, replyToMessageId, account, from, brain }) => {
|
|
1967
1969
|
let res
|
|
1968
1970
|
try {
|
|
1969
1971
|
res = await fetchCortex(`${BASE}/api/gmail/send-requests`, {
|
|
@@ -1975,6 +1977,8 @@ function renderNudge(payload) {
|
|
|
1975
1977
|
...(replyToRecordId ? { replyToRecordId } : {}),
|
|
1976
1978
|
...(replyToMessageId ? { replyToMessageId } : {}),
|
|
1977
1979
|
...(account ? { account } : {}),
|
|
1980
|
+
...(from ? { from } : {}),
|
|
1981
|
+
...(brain ? { brain } : {}),
|
|
1978
1982
|
}),
|
|
1979
1983
|
}, { idempotent: false, retries: 0 })
|
|
1980
1984
|
} catch (e) {
|
|
@@ -1991,6 +1995,12 @@ function renderNudge(payload) {
|
|
|
1991
1995
|
const reviewUrl = body?.reviewUrl
|
|
1992
1996
|
const acct = body?.request?.account ?? 'your mailbox'
|
|
1993
1997
|
const n = body?.request?.recipientCount ?? to.length
|
|
1998
|
+
// ADR-0092: a member agent's request waits for one of its OVERSEERS, not for "you".
|
|
1999
|
+
if (reviewUrl && body?.waitingFor) {
|
|
2000
|
+
return { content: [{ type: 'text', text:
|
|
2001
|
+
`Email request created from ${acct} to ${n} recipient${n === 1 ? '' : 's'}. It is NOT sent yet: it waits for ` +
|
|
2002
|
+
`${body.waitingFor} to approve it in Agnoclast (${reviewUrl}). Do not send it again.` }] }
|
|
2003
|
+
}
|
|
1994
2004
|
if (reviewUrl) {
|
|
1995
2005
|
// Relayed VERBATIM — this exact sentence is the contract the create route records.
|
|
1996
2006
|
return { content: [{ type: 'text', text:
|
package/package.json
CHANGED