@commonlyai/mcp 0.2.0 → 0.3.0
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 +24 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@commonlyai/mcp",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "Commonly MCP Server \u2014 exposes the kernel HTTP surface (CAP per ADR-004) as standard MCP tools so any MCP-capable runtime can consume `commonly_*` tools without driver-specific code.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
package/src/tools.js
CHANGED
|
@@ -163,6 +163,29 @@ export const buildTools = (config) => {
|
|
|
163
163
|
body: { content, replyToMessageId, metadata },
|
|
164
164
|
})),
|
|
165
165
|
},
|
|
166
|
+
{
|
|
167
|
+
name: 'commonly_claim_message',
|
|
168
|
+
description: 'Claim a message before acting on it (ADR-018). Atomic: exactly one agent wins; if you lose, the response names who holds it and until when — STAND DOWN and do not act on that message. Winning grants ~90s; call again to renew while still working (same call). A claim is the right to DECIDE, not a duty to reply: claim, evaluate, and if you have nothing to add, release it and stay silent. Claims also cover replies in the same replyToMessageId chain.',
|
|
169
|
+
inputSchema: reqWith({
|
|
170
|
+
messageId: STRING,
|
|
171
|
+
podId: STRING,
|
|
172
|
+
leaseSeconds: INT,
|
|
173
|
+
}, ['messageId', 'podId']),
|
|
174
|
+
call: wrap(async ({ messageId, podId, leaseSeconds }) => request(config, {
|
|
175
|
+
method: 'POST',
|
|
176
|
+
path: `/api/agents/runtime/messages/${encodeURIComponent(messageId)}/claim`,
|
|
177
|
+
body: { podId, leaseSeconds },
|
|
178
|
+
})),
|
|
179
|
+
},
|
|
180
|
+
{
|
|
181
|
+
name: 'commonly_release_claim',
|
|
182
|
+
description: 'Release a message claim you hold — the normal end of claim-then-decline, and good hygiene after finishing early. A miss (someone re-won after your lease lapsed) is a result, not an error.',
|
|
183
|
+
inputSchema: reqWith({ messageId: STRING }, ['messageId']),
|
|
184
|
+
call: wrap(async ({ messageId }) => request(config, {
|
|
185
|
+
method: 'DELETE',
|
|
186
|
+
path: `/api/agents/runtime/messages/${encodeURIComponent(messageId)}/claim`,
|
|
187
|
+
})),
|
|
188
|
+
},
|
|
166
189
|
{
|
|
167
190
|
name: 'commonly_get_messages',
|
|
168
191
|
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.',
|
|
@@ -290,7 +313,7 @@ export const buildTools = (config) => {
|
|
|
290
313
|
},
|
|
291
314
|
{
|
|
292
315
|
name: 'commonly_claim_task',
|
|
293
|
-
description: 'Claim a pending task —
|
|
316
|
+
description: 'Claim a pending task — atomic: exactly one claimant wins. The claim is a ~30-minute renewable LEASE, not a tenure (ADR-018 D4): call again to renew while genuinely working; a lapsed lease makes the task claimable by peers, so a dead claimant never holds work forever. A 409 names the live holder and when their lease frees.',
|
|
294
317
|
inputSchema: reqWith({ podId: STRING, taskId: STRING }, ['podId', 'taskId']),
|
|
295
318
|
call: wrap(async ({ podId, taskId }) => request(config, {
|
|
296
319
|
method: 'POST',
|