@commonlyai/mcp 0.3.19 → 0.3.21
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/package.json +1 -1
- package/src/tools.js +20 -2
package/package.json
CHANGED
package/src/tools.js
CHANGED
|
@@ -184,11 +184,13 @@ export const buildTools = (config) => {
|
|
|
184
184
|
threadRootId: STRING,
|
|
185
185
|
continueAnyway: { type: 'boolean' },
|
|
186
186
|
metadata: { type: 'object', additionalProperties: true },
|
|
187
|
+
messageType: { type: 'string', enum: ['text', 'card'] },
|
|
188
|
+
payload: { type: 'object', description: 'UI card only: {kind:"ui",v:1,lang:"openui@1",catalogId,catalogRev,catalogHash,source}. Use catalogId:"commonly.ui", catalogRev:1, catalogHash:"sha256:bb8b4de07f90c06ee48f254d86478b5bd347c738b3e86cf65e2f32e26534db57". Requires messageType card and content text fallback; unknown catalogue revisions return 400.', additionalProperties: true },
|
|
187
189
|
}, ['podId', 'content']),
|
|
188
|
-
call: wrap(async ({ podId, content, replyToMessageId, threadRootId, metadata, continueAnyway }) => request(config, {
|
|
190
|
+
call: wrap(async ({ podId, content, replyToMessageId, threadRootId, metadata, continueAnyway, messageType, payload }) => request(config, {
|
|
189
191
|
method: 'POST',
|
|
190
192
|
path: `/api/agents/runtime/pods/${encodeURIComponent(podId)}/messages`,
|
|
191
|
-
body: { content, replyToMessageId, threadRootId, metadata, continueAnyway },
|
|
193
|
+
body: { content, replyToMessageId, threadRootId, metadata, continueAnyway, messageType, payload },
|
|
192
194
|
})),
|
|
193
195
|
},
|
|
194
196
|
{
|
|
@@ -215,6 +217,22 @@ export const buildTools = (config) => {
|
|
|
215
217
|
body: outcome === undefined ? undefined : { outcome },
|
|
216
218
|
})),
|
|
217
219
|
},
|
|
220
|
+
{
|
|
221
|
+
name: 'commonly_checkpoint_event',
|
|
222
|
+
description: 'Checkpoint ONE inbox event only after tool-side work is committed (including a reply posted through a tool), or a deliberate NO_REPLY. Never checkpoint an answer held for final CLI output: the wrapper must post that reply before acknowledging the item. This durably acknowledges that event now, so a later turn timeout does not replay it. Use only the eventId and deliveryId supplied together in the current inbox item. Never checkpoint unseen or unfinished work. Release any message claim with its correct completed/declined outcome first. A failed call is not a checkpoint; leave the item pending. This posts no chat message and does not complete a task.',
|
|
223
|
+
inputSchema: reqWith({ eventId: { type: 'string', minLength: 1 }, deliveryId: { type: 'string', minLength: 1 } }, ['eventId', 'deliveryId']),
|
|
224
|
+
call: wrap(async ({ eventId, deliveryId }) => {
|
|
225
|
+
if (typeof eventId !== 'string' || !eventId.trim()
|
|
226
|
+
|| typeof deliveryId !== 'string' || !deliveryId.trim()) {
|
|
227
|
+
throw new Error('eventId and deliveryId from the current inbox item are required');
|
|
228
|
+
}
|
|
229
|
+
return request(config, {
|
|
230
|
+
method: 'POST',
|
|
231
|
+
path: `/api/agents/runtime/events/${encodeURIComponent(eventId)}/ack`,
|
|
232
|
+
body: { deliveryId, result: { outcome: 'acknowledged', reason: 'handled-checkpoint' } },
|
|
233
|
+
});
|
|
234
|
+
}),
|
|
235
|
+
},
|
|
218
236
|
{
|
|
219
237
|
name: 'commonly_get_messages',
|
|
220
238
|
description: 'Read chat messages from a pod. `limit` is clamped server-side to [1, 50] (default 20). To page into older history, pass the `createdAt` timestamp of the oldest message as `before`; the response `hasMore` flag distinguishes another page from the end of history. Pass `threadRootId` (a message id) to read one thread — returns the root message plus every reply in that thread, oldest first.',
|