@theronap/agnoclast-mcp 0.9.315 → 0.9.316
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/release_gate.mjs +1 -1
- package/lib/server.mjs +39 -6
- package/lib/settings_render.mjs +11 -0
- package/package.json +1 -1
package/lib/release_gate.mjs
CHANGED
|
@@ -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', 'place_split_records', 'read_conversation', 'read_document', 'send_message', 'set_manager', 'split_page', 'split_records', 'store_file', 'tasks_waiting', 'undo_split', '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', 'place_split_records', 'read_conversation', 'read_document', 'send_message', 'set_manager', 'set_working_hours', 'split_page', 'split_records', 'store_file', 'tasks_waiting', 'undo_split', '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/lib/server.mjs
CHANGED
|
@@ -3810,6 +3810,36 @@ function renderNudge(payload) {
|
|
|
3810
3810
|
},
|
|
3811
3811
|
)
|
|
3812
3812
|
|
|
3813
|
+
// Working hours (obligation fe54ef05): the person's own, and their agents' — all of them, a kind (Grok Bots) or one by
|
|
3814
|
+
// name — per weekday. Like set_setting, only when the person asks. A change takes effect tomorrow.
|
|
3815
|
+
server.registerTool(
|
|
3816
|
+
'set_working_hours',
|
|
3817
|
+
{
|
|
3818
|
+
title: 'Set working hours',
|
|
3819
|
+
description: "Set the person's own working hours, or their agents', per weekday — ONLY when they asked you to (\"make Grok Bots weekdays 8 to 7\", \"I work 9 to 5\"). `who`: \"me\" (when Agnoclast may interrupt them about their agents), \"all agents\", a kind such as \"Grok Bots\", or one agent by its connection name from my_settings. `hours`: every day stated, e.g. {\"weekdays\": \"8am-7pm\", \"fri\": \"8am-5pm\", \"weekends\": \"off\"}; \"all day\" and \"off\" work, and a span past midnight like \"8pm-2am\" belongs to the night it starts. The new hours take effect tomorrow; the agent sees them in setup_status and confirms there. Pass `clear: true` with `who` to remove a rule. Say what you set and that they can change it in Settings.",
|
|
3820
|
+
inputSchema: {
|
|
3821
|
+
who: z.string().describe('"me", "all agents", a kind such as "Grok Bots", or one agent\'s connection name'),
|
|
3822
|
+
hours: z.record(z.string()).optional().describe('day → hours, every day stated: mon … sun, weekdays, weekends or every day'),
|
|
3823
|
+
clear: z.boolean().optional().describe('true to remove this rule instead'),
|
|
3824
|
+
},
|
|
3825
|
+
},
|
|
3826
|
+
async ({ who, hours, clear }) => {
|
|
3827
|
+
let res
|
|
3828
|
+
try {
|
|
3829
|
+
res = await fetchCortex(`${BASE}/api/settings`, {
|
|
3830
|
+
method: 'POST',
|
|
3831
|
+
headers: { Authorization: `Bearer ${TOKEN}`, 'Content-Type': 'application/json' },
|
|
3832
|
+
body: JSON.stringify(clear ? { clear_hours: who } : { hours: { who, week: hours } }),
|
|
3833
|
+
})
|
|
3834
|
+
} catch (e) { return toolError(`Could not reach settings: ${e.message}`) }
|
|
3835
|
+
const out = await res.json().catch(() => null)
|
|
3836
|
+
if (res.status === 404) return toolError('Working hours are not turned on for this account yet.')
|
|
3837
|
+
if (!res.ok) return toolError(`Not changed: ${out?.detail ?? out?.error ?? res.status}`)
|
|
3838
|
+
if (clear) return { content: [{ type: 'text', text: out.removed ? `Removed the hours for ${out.label}. They fall back to the next rule, or to their usual rhythm.` : `${out.label} had no hours set.` }] }
|
|
3839
|
+
return { content: [{ type: 'text', text: `Hours for ${out.label} set, starting ${out.effectiveFrom}. They can change them in Settings (or ask you).` }] }
|
|
3840
|
+
},
|
|
3841
|
+
)
|
|
3842
|
+
|
|
3813
3843
|
// 2026-10-02. Removal was built in August with this tool planned and never wired, so an assistant could
|
|
3814
3844
|
// add people to a brain but not remove them. Two calls, always: the first changes nothing.
|
|
3815
3845
|
server.registerTool(
|
|
@@ -6330,17 +6360,19 @@ function renderNudge(payload) {
|
|
|
6330
6360
|
ai_reach: z.string().optional().describe('optional: how much they let it do'),
|
|
6331
6361
|
together: z.string().optional().describe('optional: solo or team'),
|
|
6332
6362
|
runs_unattended: z.boolean().optional().describe('true if you run on your own, on a schedule or without the person in the chat'),
|
|
6363
|
+
schedule: z.string().optional().describe('only after setup_status showed you working hours and your own schedule now matches them: the code it gave, to confirm'),
|
|
6333
6364
|
},
|
|
6334
6365
|
},
|
|
6335
|
-
async ({ use_case, goals, ai_app, ai_where, ai_reach, together, runs_unattended }) => {
|
|
6366
|
+
async ({ use_case, goals, ai_app, ai_where, ai_reach, together, runs_unattended, schedule }) => {
|
|
6336
6367
|
const saving = use_case !== undefined || goals !== undefined
|
|
6368
|
+
const q = new URLSearchParams({ ...(runs_unattended ? { unattended: '1' } : {}), ...(schedule ? { schedule } : {}) }).toString()
|
|
6337
6369
|
let res
|
|
6338
6370
|
try {
|
|
6339
|
-
res = await fetchCortex(`${BASE}/api/setup-status${!saving &&
|
|
6371
|
+
res = await fetchCortex(`${BASE}/api/setup-status${!saving && q ? `?${q}` : ''}`, saving
|
|
6340
6372
|
? {
|
|
6341
6373
|
method: 'POST',
|
|
6342
6374
|
headers: { Authorization: `Bearer ${TOKEN}`, 'Content-Type': 'application/json' },
|
|
6343
|
-
body: JSON.stringify({ unattended: runs_unattended === true, useCase: use_case, goals, together, ai: { app: ai_app, where: ai_where, reach: ai_reach } }),
|
|
6375
|
+
body: JSON.stringify({ unattended: runs_unattended === true, schedule, useCase: use_case, goals, together, ai: { app: ai_app, where: ai_where, reach: ai_reach } }),
|
|
6344
6376
|
}
|
|
6345
6377
|
: { headers: { Authorization: `Bearer ${TOKEN}` } })
|
|
6346
6378
|
} catch (e) {
|
|
@@ -6419,7 +6451,7 @@ function renderNudge(payload) {
|
|
|
6419
6451
|
try {
|
|
6420
6452
|
const out = await tasksCall('', { method: 'POST', body: JSON.stringify({ action: 'hand', to, task }) })
|
|
6421
6453
|
tasksWatch = true
|
|
6422
|
-
return { content: [{ type: 'text', text: `Queued for ${out.task.to} (task ${out.task.id}). It is picked up on that agent's next call. Check with handed_tasks
|
|
6454
|
+
return { content: [{ type: 'text', text: `Queued for ${out.task.to} (task ${out.task.id}). It is picked up on that agent's next call. Check with handed_tasks.${out.note ? `\n${out.note}` : ''}` }] }
|
|
6423
6455
|
} catch (e) { return toolError(`Not queued: ${e.message}`) }
|
|
6424
6456
|
},
|
|
6425
6457
|
)
|
|
@@ -6452,8 +6484,9 @@ function renderNudge(payload) {
|
|
|
6452
6484
|
},
|
|
6453
6485
|
async () => {
|
|
6454
6486
|
try {
|
|
6455
|
-
const { waiting, newest } = await tasksCall('?box=count')
|
|
6456
|
-
|
|
6487
|
+
const { waiting, newest, hours_changed } = await tasksCall('?box=count')
|
|
6488
|
+
const hours = hours_changed ? '\nhours: your person changed your working hours. Call setup_status with runs_unattended true to see them.' : ''
|
|
6489
|
+
return { content: [{ type: 'text', text: `waiting: ${waiting}\nnewest: ${newest ?? 'none'}${hours}` }] }
|
|
6457
6490
|
} catch (e) { return toolError(`Could not count your tasks: ${e.message}`) }
|
|
6458
6491
|
},
|
|
6459
6492
|
)
|
package/lib/settings_render.mjs
CHANGED
|
@@ -16,6 +16,17 @@ export function renderSettings(view) {
|
|
|
16
16
|
lines.push('')
|
|
17
17
|
lines.push(`TIMEZONE: ${view?.timezone ? one(view.timezone) : 'not set'}`)
|
|
18
18
|
lines.push('')
|
|
19
|
+
if (view?.hours) {
|
|
20
|
+
lines.push('WORKING HOURS — when the person may be interrupted (You), and when each agent checks for tasks:')
|
|
21
|
+
const rules = Array.isArray(view.hours.rules) ? view.hours.rules : []
|
|
22
|
+
for (const r of rules) lines.push(` ${one(r.who)}: ${one(r.hours)}${r.startsOn ? ` (starts ${one(r.startsOn)})` : ''}`)
|
|
23
|
+
if (!rules.length) lines.push(' none set: 8 AM–9 PM for the person; agents judged by their usual rhythm')
|
|
24
|
+
for (const a of Array.isArray(view.hours.agents) ? view.hours.agents : []) {
|
|
25
|
+
if (a.label) lines.push(` agent ${one(a.label)}: ${a.hours ? `${one(a.hours)} (from ${one(a.from)})` : one(a.from)}`)
|
|
26
|
+
}
|
|
27
|
+
lines.push('Change these only when the person asks: set_working_hours.')
|
|
28
|
+
lines.push('')
|
|
29
|
+
}
|
|
19
30
|
lines.push('Change one only when the person asks: set_setting. They can also change these in Settings (console avatar menu, or ⌘, in the desktop app).')
|
|
20
31
|
return lines.join('\n')
|
|
21
32
|
}
|
package/package.json
CHANGED