@ziggs-ai/ziggs-mcp 0.6.0 → 0.6.1
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/dist/tools.js +30 -9
- package/package.json +2 -2
package/dist/tools.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { randomUUID } from 'node:crypto';
|
|
2
2
|
import { z } from 'zod';
|
|
3
|
-
import { getAgreement, getMyAgreements, listMyChats, proposeUnified, delegateAgreement, provisionRelayWorkers, respondToAgreement, revokeAgreement, counterAgreement, fulfillAgreement, sendChatMessage, ConnectionsClient, PaymentsClient, ContextReadClient, GrantsClient, InboxClient, createTask, updateTaskState, replaceTaskPlan, listTasks, getTask, getBackendUrl, fetchMyOrgs, fetchDelegateAccess, GRANTS_CAPABILITIES, contextReadCapability, contextExpandReachCapability, contextDiscoverGrantableCapability, recordArtifactCapability, openConversationCapability, connectionProxyCapability, requestConnectionCapability, agreementClaimCapability, marketplaceViewCapability, } from '@ziggs-ai/api-client';
|
|
3
|
+
import { getAgreement, getMyAgreements, listMyChats, proposeUnified, delegateAgreement, provisionRelayWorkers, respondToAgreement, revokeAgreement, counterAgreement, fulfillAgreement, sendChatMessage, ConnectionsClient, PaymentsClient, ContextReadClient, GrantsClient, InboxClient, createTask, updateTaskState, replaceTaskPlan, listTasks, getTask, getBackendUrl, fetchMyOrgs, fetchDelegateAccess, GRANTS_CAPABILITIES, contextReadCapability, contextExpandReachCapability, contextDiscoverGrantableCapability, recordArtifactCapability, openConversationCapability, connectionProxyCapability, requestConnectionCapability, agreementClaimCapability, marketplaceViewCapability, linkSummary, } from '@ziggs-ai/api-client';
|
|
4
4
|
import { decodeOperatorKeyClaims } from './operatorKey.js';
|
|
5
5
|
import { registerTrustTools } from './trustTools.js';
|
|
6
6
|
import { registerPaymentTools } from './paymentTools.js';
|
|
@@ -408,7 +408,11 @@ export function registerZiggsTools(server, creds, cfg) {
|
|
|
408
408
|
.string()
|
|
409
409
|
.optional()
|
|
410
410
|
.describe('Who does the work. Direct: omitted = proposedTo (commission), your id = offer, another id = broker. Broadcast: omitted = quest, your id = standing offer.'),
|
|
411
|
-
price: z
|
|
411
|
+
price: z
|
|
412
|
+
.number()
|
|
413
|
+
.optional()
|
|
414
|
+
.describe('Amount in CENTS — 500 means $5.00. Optional; does not trigger a transfer by itself. ' +
|
|
415
|
+
'When you quote it to a human, convert: saying "$500" for 500 is off by 100x.'),
|
|
412
416
|
engagementKind: z
|
|
413
417
|
.enum(['hire', 'service', 'link'])
|
|
414
418
|
.optional()
|
|
@@ -445,9 +449,11 @@ export function registerZiggsTools(server, creds, cfg) {
|
|
|
445
449
|
lifecycle,
|
|
446
450
|
billing,
|
|
447
451
|
}, creds);
|
|
452
|
+
// ZIG-957: link mutations return linkSummary, not the raw Mongo doc.
|
|
453
|
+
const agreementOut = shape === 'link' && agreement ? linkSummary(agreement) : agreement;
|
|
448
454
|
return textResult({
|
|
449
455
|
shape,
|
|
450
|
-
agreement,
|
|
456
|
+
agreement: agreementOut,
|
|
451
457
|
...(shape === 'quest' || shape === 'offer'
|
|
452
458
|
? {
|
|
453
459
|
nextSteps: 'Published to the marketplace — claimable via ziggs_agreement_claim; it also appears in ziggs_marketplace_view.',
|
|
@@ -466,10 +472,16 @@ export function registerZiggsTools(server, creds, cfg) {
|
|
|
466
472
|
chatId: z.string().describe('Chat the delegation is coordinated in'),
|
|
467
473
|
description: z.string().describe('What the sub-agreement covers'),
|
|
468
474
|
parentTaskId: z.string().optional(),
|
|
469
|
-
price: z
|
|
475
|
+
price: z
|
|
476
|
+
.number()
|
|
477
|
+
.optional()
|
|
478
|
+
.describe('Amount in CENTS — 500 means $5.00.'),
|
|
470
479
|
expiresAt: z.string().optional(),
|
|
471
480
|
maxExecutions: z.number().int().positive().optional(),
|
|
472
|
-
lifecycle: z
|
|
481
|
+
lifecycle: z
|
|
482
|
+
.enum(['open', 'time-bound', 'count-bound'])
|
|
483
|
+
.optional()
|
|
484
|
+
.describe("Usually inferred: expiresAt → 'time-bound', maxExecutions → 'count-bound', neither → 'open' (standing)."),
|
|
473
485
|
agreementDescription: z.string().optional(),
|
|
474
486
|
}, WRITE, async ({ parentAgreementId, executorId, chatId, description, parentTaskId, price, expiresAt, maxExecutions, lifecycle, agreementDescription, }) => {
|
|
475
487
|
try {
|
|
@@ -504,7 +516,9 @@ export function registerZiggsTools(server, creds, cfg) {
|
|
|
504
516
|
const updated = await respondToAgreement(agreementId, action, creds, {
|
|
505
517
|
ownerUserId: ownerId,
|
|
506
518
|
});
|
|
507
|
-
|
|
519
|
+
// ZIG-957: link approvals/rejects share the same summary shape as claim/revoke.
|
|
520
|
+
const agreement = updated?.engagementKind === 'link' ? linkSummary(updated) : updated;
|
|
521
|
+
return textResult({ agreement });
|
|
508
522
|
}
|
|
509
523
|
catch (e) {
|
|
510
524
|
return toolError(e.message);
|
|
@@ -516,13 +530,17 @@ export function registerZiggsTools(server, creds, cfg) {
|
|
|
516
530
|
try {
|
|
517
531
|
const result = await revokeAgreement(agreementId, creds);
|
|
518
532
|
const isLink = result.agreement?.engagementKind === 'link';
|
|
533
|
+
// ZIG-957: same summary shape as create/list/claim link tools (not the raw Mongo doc).
|
|
534
|
+
const agreement = result.agreement
|
|
535
|
+
? (isLink ? linkSummary(result.agreement) : result.agreement)
|
|
536
|
+
: undefined;
|
|
519
537
|
return textResult({
|
|
520
538
|
status: 'revoked',
|
|
521
539
|
agreementId,
|
|
522
540
|
...(isLink
|
|
523
541
|
? { note: 'Link revoked — unpublished cross-org reach to this peer is blocked again.' }
|
|
524
542
|
: {}),
|
|
525
|
-
agreement
|
|
543
|
+
agreement,
|
|
526
544
|
});
|
|
527
545
|
}
|
|
528
546
|
catch (e) {
|
|
@@ -537,8 +555,11 @@ export function registerZiggsTools(server, creds, cfg) {
|
|
|
537
555
|
.optional()
|
|
538
556
|
.describe('Revised agreement description / terms'),
|
|
539
557
|
expiresAt: z.string().optional().describe('Revised expiry (ISO-8601)'),
|
|
540
|
-
lifecycle: z
|
|
541
|
-
|
|
558
|
+
lifecycle: z
|
|
559
|
+
.enum(['open', 'time-bound', 'count-bound'])
|
|
560
|
+
.optional()
|
|
561
|
+
.describe('Revised lifecycle: open | time-bound | count-bound'),
|
|
562
|
+
maxExecutions: z.number().int().positive().optional().describe('Revised max executions'),
|
|
542
563
|
description: z
|
|
543
564
|
.string()
|
|
544
565
|
.optional()
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ziggs-ai/ziggs-mcp",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.1",
|
|
4
4
|
"description": "MCP server for Claude Code, Cursor, and other MCP hosts — act as your Ziggs delegate agent",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
38
|
"@modelcontextprotocol/sdk": "^1.29.0",
|
|
39
|
-
"@ziggs-ai/api-client": "^0.6.
|
|
39
|
+
"@ziggs-ai/api-client": "^0.6.1",
|
|
40
40
|
"dotenv": "^16.6.1",
|
|
41
41
|
"zod": "^3.24.2"
|
|
42
42
|
},
|