@ziggs-ai/ziggs-mcp 0.6.1 → 0.6.2
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/pendingDecisions.js +17 -2
- package/dist/tools.js +10 -1
- package/package.json +1 -1
package/dist/pendingDecisions.js
CHANGED
|
@@ -73,14 +73,29 @@ function proposalToItem(p, origin) {
|
|
|
73
73
|
sayReject: `reject ${id}`,
|
|
74
74
|
};
|
|
75
75
|
}
|
|
76
|
+
function linkRequesterHeadline(c) {
|
|
77
|
+
// ZIG-1039: consent cards lead with a readable name + org, id as fallback.
|
|
78
|
+
const name = c.requesterDisplayName?.trim();
|
|
79
|
+
const org = c.requesterOrgName?.trim();
|
|
80
|
+
if (name && org)
|
|
81
|
+
return `${name} (${org})`;
|
|
82
|
+
if (name)
|
|
83
|
+
return name;
|
|
84
|
+
return c.requesterAgentId;
|
|
85
|
+
}
|
|
76
86
|
function linkToItem(c, origin) {
|
|
77
87
|
const id = c.requestId;
|
|
78
88
|
const note = c.message?.trim() || null;
|
|
89
|
+
const headline = linkRequesterHeadline(c);
|
|
79
90
|
return {
|
|
80
91
|
kind: 'link_request',
|
|
81
92
|
agreementId: id,
|
|
82
|
-
title: truncateText(`Agent link · ${
|
|
83
|
-
subtitle: note
|
|
93
|
+
title: truncateText(`Agent link · ${headline}`),
|
|
94
|
+
subtitle: note
|
|
95
|
+
? truncateText(note, 96)
|
|
96
|
+
: c.requesterAgentId && headline !== c.requesterAgentId
|
|
97
|
+
? truncateText(`id: ${c.requesterAgentId}`, 96)
|
|
98
|
+
: null,
|
|
84
99
|
proposedAt: c.requestedAt,
|
|
85
100
|
proposedAtLabel: formatWhen(c.requestedAt),
|
|
86
101
|
appUrl: agreementAppUrl(origin, id),
|
package/dist/tools.js
CHANGED
|
@@ -395,7 +395,7 @@ export function registerZiggsTools(server, creds, cfg) {
|
|
|
395
395
|
return toolError(e.message);
|
|
396
396
|
}
|
|
397
397
|
});
|
|
398
|
-
server.tool('ziggs_agreement_propose', 'Propose an agreement — direct, broadcast, or link; there are no separate publish tools. DIRECT: proposedTo = one counterparty id, chatId required. Omit providerId (or set it to proposedTo) to commission the recipient (they work, your side pays); set providerId to your own agent id to offer (you work, proposedTo pays); a third-party providerId brokers (they work, proposedTo pays) and requires that provider to have a matching active offer. BROADCAST: proposedTo "everyone" (fully public) or "org" (your active org only), chatId optional — with no providerId this publishes a QUEST (whoever claims does the work, your side pays); with providerId = your own id it publishes a STANDING OFFER (you work, the claimer pays). Claiming is ziggs_agreement_claim; browsing is ziggs_marketplace_view. LINK: engagementKind "link" with proposedTo = an agent id proposes bilateral trust (no chat, no money; the
|
|
398
|
+
server.tool('ziggs_agreement_propose', 'Propose an agreement — direct, broadcast, or link; there are no separate publish tools. DIRECT: proposedTo = one counterparty id, chatId required. Omit providerId (or set it to proposedTo) to commission the recipient (they work, your side pays); set providerId to your own agent id to offer (you work, proposedTo pays); a third-party providerId brokers (they work, proposedTo pays) and requires that provider to have a matching active offer. BROADCAST: proposedTo "everyone" (fully public) or "org" (your active org only), chatId optional — with no providerId this publishes a QUEST (whoever claims does the work, your side pays); with providerId = your own id it publishes a STANDING OFFER (you work, the claimer pays). Claiming is ziggs_agreement_claim; browsing is ziggs_marketplace_view. LINK: engagementKind "link" with proposedTo = an agent id proposes bilateral trust (no chat, no money). The server routes parties.proposedTo to that agent\'s owner human (a person decides who their delegate trusts) — the id you pass may differ from parties.proposedTo in the response; when it does, `note` explains the rewrite. Approve via ziggs_agreement_respond. The payer is always derived server-side as the non-providing side — there is no payer input. engagementKind "service" (default) = one deliverable; "hire" = ongoing engagement. Agreements are STANDING by default (lifecycle "open": no expiry, unlimited tasks) — hire once, then keep spawning tasks under the same agreement; set expiresAt (time-bound) or maxExecutions (count-bound) only when the engagement should end on its own. price is recorded on the agreement but does not itself trigger a transfer.', {
|
|
399
399
|
proposedTo: z
|
|
400
400
|
.string()
|
|
401
401
|
.describe('Counterparty id for a direct proposal, or "everyone"/"org" to broadcast'),
|
|
@@ -451,9 +451,18 @@ export function registerZiggsTools(server, creds, cfg) {
|
|
|
451
451
|
}, creds);
|
|
452
452
|
// ZIG-957: link mutations return linkSummary, not the raw Mongo doc.
|
|
453
453
|
const agreementOut = shape === 'link' && agreement ? linkSummary(agreement) : agreement;
|
|
454
|
+
// ZIG-1039: surface the owner-routing rewrite so agents do not think
|
|
455
|
+
// the id they passed was ignored silently.
|
|
456
|
+
const routedProposedTo = shape === 'link' &&
|
|
457
|
+
agreement?.parties?.proposedTo &&
|
|
458
|
+
proposedTo &&
|
|
459
|
+
proposedTo !== agreement.parties.proposedTo
|
|
460
|
+
? `Routed approval to the target agent's owner (${agreement.parties.proposedTo}): a person decides who their delegate trusts. You passed proposedTo=${proposedTo}.`
|
|
461
|
+
: undefined;
|
|
454
462
|
return textResult({
|
|
455
463
|
shape,
|
|
456
464
|
agreement: agreementOut,
|
|
465
|
+
...(routedProposedTo ? { note: routedProposedTo } : {}),
|
|
457
466
|
...(shape === 'quest' || shape === 'offer'
|
|
458
467
|
? {
|
|
459
468
|
nextSteps: 'Published to the marketplace — claimable via ziggs_agreement_claim; it also appears in ziggs_marketplace_view.',
|