verdo-mcp 1.1.0 → 2.0.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/README.md +21 -8
- package/dist/definitions.d.ts +781 -0
- package/dist/definitions.js +389 -0
- package/dist/index.js +1 -1
- package/dist/tools.d.ts +27 -112
- package/dist/tools.js +125 -188
- package/package.json +3 -1
|
@@ -0,0 +1,389 @@
|
|
|
1
|
+
// Verdo MCP tool definitions and the text every tool returns, shared by both transports:
|
|
2
|
+
// the stdio server in this package (src/tools.ts, over the REST API) and the remote
|
|
3
|
+
// server at verdo.ink/api/mcp (in-process). Pure: no fetch, no environment, no imports,
|
|
4
|
+
// so the remote server can import it without pulling in the stdio runtime.
|
|
5
|
+
//
|
|
6
|
+
// Guardrail: the agent proposes, a person decides. No tool invites, settles or picks an
|
|
7
|
+
// outcome. No tool sends a notice of its own: a routing rule a person configured may (P93:
|
|
8
|
+
// the rule's approver by email, the rule's channel), never for a draft-only key. Writes (2.0.0): create_decision (proposes; sends no participants), and,
|
|
9
|
+
// for the request the caller created, cancel_decision (withdraw it) and edit_decision (revise
|
|
10
|
+
// it; voids votes). There is no reject or approve tool: rejecting is the human approver's call
|
|
11
|
+
// (Alex, 2026-11-25: AI boundary, Prompt 63). get_close_summary only reads and points the agent
|
|
12
|
+
// at a person.
|
|
13
|
+
// Values the API accepts (DB checks in migrations 0041 and 0042). Owner and approver
|
|
14
|
+
// modes need a named person, which this API cannot set, so they are not offered.
|
|
15
|
+
export const METHODS = ["single_choice", "ranked_choice", "approval", "dot"];
|
|
16
|
+
export const AUTHORITY_MODES = ["majority", "consensus"];
|
|
17
|
+
export const DEFAULT_DEADLINE_HOURS = 48;
|
|
18
|
+
export const MAX_DEADLINE_HOURS = 720;
|
|
19
|
+
export const MAX_TITLE_LENGTH = 140;
|
|
20
|
+
export const MIN_OPTIONS = 2;
|
|
21
|
+
export const MAX_OPTIONS = 10;
|
|
22
|
+
export const MAX_IDEMPOTENCY_KEY = 128;
|
|
23
|
+
export const MAX_TAGS = 20;
|
|
24
|
+
export const NOTIFICATION_STATUSES = ["pending", "delivered", "partially_delivered", "failed"];
|
|
25
|
+
export const LIFECYCLE_FILTER = ["draft", "active", "decided", "implemented", "stalled", "superseded", "reversed", "cancelled", "rejected"];
|
|
26
|
+
export const REMOVED_TOOLS = {
|
|
27
|
+
close_decision: "close_decision was removed in 1.1.0: agents cannot close decisions. Use get_close_summary to find out who makes the call.",
|
|
28
|
+
add_participants: "add_participants was removed in 1.1.0: agents cannot invite people. Send the dashboard link to the decision's owner; they share the voter link.",
|
|
29
|
+
request_close: "request_close was renamed get_close_summary: the same read-only tool. Use get_close_summary.",
|
|
30
|
+
};
|
|
31
|
+
export function proposedText(id, url, args, meta = {}) {
|
|
32
|
+
const replay = meta.created === false;
|
|
33
|
+
return [
|
|
34
|
+
replay ? `Existing decision returned (same idempotency_key; nothing new was created).` : `Decision proposed.`,
|
|
35
|
+
``,
|
|
36
|
+
`ID: ${id}`,
|
|
37
|
+
...(meta.requestFingerprint ? [`Request fingerprint: ${meta.requestFingerprint}`] : []),
|
|
38
|
+
`Dashboard: ${url}`,
|
|
39
|
+
`Title: ${args.title}`,
|
|
40
|
+
`Options: ${args.options.join(", ")}`,
|
|
41
|
+
`Method: ${args.method ?? "single_choice"}`,
|
|
42
|
+
`Deadline: ${args.deadline_hours ?? DEFAULT_DEADLINE_HOURS} hours from now`,
|
|
43
|
+
``,
|
|
44
|
+
`Nobody has been invited. If its tags matched a routing rule, Verdo has told that rule's approver; otherwise send the dashboard link to the person who owns this decision: they share the voter link with the team and make the call.`,
|
|
45
|
+
`Use check_decision with id "${id}" to see progress.`,
|
|
46
|
+
].join("\n");
|
|
47
|
+
}
|
|
48
|
+
// Fields follow the API's DecisionPayload (packages/integrations-zapier/src/events/types.ts).
|
|
49
|
+
export function formatDecision(d) {
|
|
50
|
+
const lines = [`Decision: ${d.title}`, `Status: ${d.status}`, `Method: ${d.method}`, `ID: ${d.decision_id ?? d.id}`];
|
|
51
|
+
if (d.outcome)
|
|
52
|
+
lines.push(`Outcome: ${d.outcome}`);
|
|
53
|
+
if (d.decided_at)
|
|
54
|
+
lines.push(`Decided at: ${d.decided_at}`);
|
|
55
|
+
const owner = d.owner;
|
|
56
|
+
if (owner?.name || owner?.email)
|
|
57
|
+
lines.push(`Owner: ${owner.name ?? owner.email}`);
|
|
58
|
+
// Record lite (Prompt 62): present only when approved for external sharing.
|
|
59
|
+
if (typeof d.rationale === "string" && d.rationale)
|
|
60
|
+
lines.push(`Rationale: ${d.rationale}`);
|
|
61
|
+
// Prompt 88: what the outcome is bound to. Compare with the fingerprint create_decision returned.
|
|
62
|
+
if (typeof d.request_fingerprint === "string" && d.request_fingerprint)
|
|
63
|
+
lines.push(`Request fingerprint: ${d.request_fingerprint}`);
|
|
64
|
+
// Prompt 91: the agent-layer fields.
|
|
65
|
+
if (typeof d.notification_status === "string" && d.notification_status)
|
|
66
|
+
lines.push(`Notification status: ${d.notification_status}`);
|
|
67
|
+
if (typeof d.routing_rule_label === "string" && d.routing_rule_label)
|
|
68
|
+
lines.push(`Routing rule: ${d.routing_rule_label}`);
|
|
69
|
+
if (typeof d.source_agent === "string" && d.source_agent)
|
|
70
|
+
lines.push(`Created by agent: ${d.source_agent}`);
|
|
71
|
+
if (typeof d.idempotency_key === "string" && d.idempotency_key)
|
|
72
|
+
lines.push(`Idempotency key: ${d.idempotency_key}`);
|
|
73
|
+
const breakdown = d.vote_breakdown;
|
|
74
|
+
if (breakdown?.length) {
|
|
75
|
+
lines.push(``, `Options:`);
|
|
76
|
+
for (const o of breakdown) {
|
|
77
|
+
lines.push(` - ${o.option} (${o.votes} vote${o.votes === 1 ? "" : "s"})`);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
if (d.url)
|
|
81
|
+
lines.push(``, `Dashboard: ${d.url}`);
|
|
82
|
+
return lines.join("\n");
|
|
83
|
+
}
|
|
84
|
+
export function listText(decisions, query) {
|
|
85
|
+
if (decisions.length === 0) {
|
|
86
|
+
return query ? `No decisions found matching "${query}".` : "No decisions in this workspace.";
|
|
87
|
+
}
|
|
88
|
+
const lines = [`${decisions.length} decision${decisions.length === 1 ? "" : "s"} found:`, ``];
|
|
89
|
+
for (const d of decisions)
|
|
90
|
+
lines.push(`- [${d.status}] ${d.title} (id: ${d.id})`);
|
|
91
|
+
return lines.join("\n");
|
|
92
|
+
}
|
|
93
|
+
// ---- Precedent (Prompt 64, I-4 + I-5): past records, never consent ----
|
|
94
|
+
export const PRECEDENT_NOTE = "Past records for reference. Not consent or authorization.";
|
|
95
|
+
export const SEARCH_LIMIT_DEFAULT = 10;
|
|
96
|
+
export const SEARCH_LIMIT_MAX = 50;
|
|
97
|
+
const day = (iso) => (iso ? String(iso).slice(0, 10) : "date unknown");
|
|
98
|
+
function precedentLine(p) {
|
|
99
|
+
const bits = [p.winner ? `outcome: ${p.winner}` : null, `decided ${day(p.settled_at)}`, p.owner_name ? `owner: ${p.owner_name}` : null];
|
|
100
|
+
return `- [${p.status}] ${p.title} (id: ${p.id}): ${bits.filter(Boolean).join(", ")}`;
|
|
101
|
+
}
|
|
102
|
+
/** The section create_decision appends when there are past decisions with a similar title. */
|
|
103
|
+
export function precedentSection(items) {
|
|
104
|
+
if (items.length === 0)
|
|
105
|
+
return "";
|
|
106
|
+
return ["", "", `Previously decided (${PRECEDENT_NOTE}):`, ...items.map(precedentLine)].join("\n");
|
|
107
|
+
}
|
|
108
|
+
export function searchText(items, query) {
|
|
109
|
+
if (items.length === 0)
|
|
110
|
+
return `No past decided decisions found matching "${query}". ${PRECEDENT_NOTE}`;
|
|
111
|
+
return [
|
|
112
|
+
`${items.length} past decision${items.length === 1 ? "" : "s"} matching "${query}" (newest first):`,
|
|
113
|
+
``,
|
|
114
|
+
...items.map(precedentLine),
|
|
115
|
+
``,
|
|
116
|
+
`${PRECEDENT_NOTE} execution_authorized: false.`,
|
|
117
|
+
].join("\n");
|
|
118
|
+
}
|
|
119
|
+
export function precedentText(d) {
|
|
120
|
+
const lines = [`Past decision: ${d.title}`, `Status: ${d.status}`, `ID: ${d.id}`];
|
|
121
|
+
if (d.winner)
|
|
122
|
+
lines.push(`Outcome: ${d.winner}`);
|
|
123
|
+
lines.push(`Decided: ${day(d.settled_at)}`);
|
|
124
|
+
if (d.owner_name)
|
|
125
|
+
lines.push(`Owner: ${d.owner_name}`);
|
|
126
|
+
if (d.authority_mode)
|
|
127
|
+
lines.push(`How it was decided: ${d.authority_mode}`);
|
|
128
|
+
// Only a rationale approved for external sharing is ever returned.
|
|
129
|
+
if (d.rationale)
|
|
130
|
+
lines.push(`Rationale: ${d.rationale}`);
|
|
131
|
+
if (d.vote_counts.length) {
|
|
132
|
+
lines.push(``, `Votes per option:`);
|
|
133
|
+
for (const o of d.vote_counts)
|
|
134
|
+
lines.push(` - ${o.option} (${o.votes} vote${o.votes === 1 ? "" : "s"})`);
|
|
135
|
+
}
|
|
136
|
+
if (d.related.length) {
|
|
137
|
+
lines.push(``, `Related decisions on the same question:`);
|
|
138
|
+
for (const r of d.related)
|
|
139
|
+
lines.push(` - [${r.status}] ${r.title} (id: ${r.id}), decided ${day(r.settled_at)}`);
|
|
140
|
+
}
|
|
141
|
+
lines.push(``, `This is a historical record, not consent or authorization to repeat the decision. execution_authorized: false.`);
|
|
142
|
+
return lines.join("\n");
|
|
143
|
+
}
|
|
144
|
+
export function closeSummaryText(d) {
|
|
145
|
+
if (d.status !== "active") {
|
|
146
|
+
return `This decision is no longer open (status: ${d.status}). Nothing to close.\n\n${formatDecision(d)}`;
|
|
147
|
+
}
|
|
148
|
+
const owner = d.owner;
|
|
149
|
+
const who = owner?.name || owner?.email
|
|
150
|
+
? [owner.name, owner.email ? `<${owner.email}>` : null].filter(Boolean).join(" ")
|
|
151
|
+
: "the person who owns this decision in Verdo (no owner is named on it)";
|
|
152
|
+
return [
|
|
153
|
+
`Agents cannot close Verdo decisions. A person makes the call.`,
|
|
154
|
+
``,
|
|
155
|
+
`Ask ${who} to open ${d.url} and close it there.`,
|
|
156
|
+
`Share the current tally below so they can decide.`,
|
|
157
|
+
``,
|
|
158
|
+
formatDecision(d),
|
|
159
|
+
].join("\n");
|
|
160
|
+
}
|
|
161
|
+
/** cancel_decision's answer (Prompt 91). */
|
|
162
|
+
export function cancelledText(id, url) {
|
|
163
|
+
return [`Decision cancelled.`, ``, `ID: ${id}`, `Dashboard: ${url}`, `It is closed for good. Anyone it was sent to sees it was withdrawn.`].join("\n");
|
|
164
|
+
}
|
|
165
|
+
/** edit_decision's answer (Prompt 91). */
|
|
166
|
+
export function editedText(id, r) {
|
|
167
|
+
if (!r.changed)
|
|
168
|
+
return [`Nothing changed: the title, description and options are as they were.`, `ID: ${id}`].join("\n");
|
|
169
|
+
return [
|
|
170
|
+
`Decision updated.`,
|
|
171
|
+
``,
|
|
172
|
+
`ID: ${id}`,
|
|
173
|
+
`New request fingerprint: ${r.requestFingerprint ?? "(none)"}`,
|
|
174
|
+
`Votes voided: ${r.votesVoided}. Everyone who had voted approved the old version and is asked again.`,
|
|
175
|
+
].join("\n");
|
|
176
|
+
}
|
|
177
|
+
export function unknownToolText(name) {
|
|
178
|
+
const tools = toolDefinitions().map((t) => t.name).join(", ");
|
|
179
|
+
return `${REMOVED_TOOLS[name] ?? `Unknown tool: ${name}.`} Available tools: ${tools}.`;
|
|
180
|
+
}
|
|
181
|
+
export function toolDefinitions(opts = {}) {
|
|
182
|
+
const meta = opts.meta ? { _meta: opts.meta } : {};
|
|
183
|
+
return [
|
|
184
|
+
{
|
|
185
|
+
name: "create_decision",
|
|
186
|
+
description: "Propose a team decision in the user's Verdo workspace. The agent proposes; a person decides. It invites nobody: the decision opens in the workspace's dashboard, where its owner shares the voter link and makes the call. Tags can route it to an approver configured in Verdo; a routing rule then emails that approver and posts to the rule's channel (not with a draft-only key). The deadline starts counting when it is created. Returns the decision ID, its request fingerprint, the dashboard link to send to that person, and up to 3 previously decided decisions with a similar title: past records for reference, not consent or authorization. With an idempotency_key, a retry returns the same decision instead of creating a second one.",
|
|
187
|
+
annotations: {
|
|
188
|
+
title: "Propose Decision",
|
|
189
|
+
readOnlyHint: false,
|
|
190
|
+
destructiveHint: false,
|
|
191
|
+
idempotentHint: false,
|
|
192
|
+
openWorldHint: false,
|
|
193
|
+
},
|
|
194
|
+
inputSchema: {
|
|
195
|
+
type: "object",
|
|
196
|
+
required: ["title", "options"],
|
|
197
|
+
properties: {
|
|
198
|
+
title: { type: "string", maxLength: MAX_TITLE_LENGTH, description: "The decision question (max 140 characters)" },
|
|
199
|
+
options: {
|
|
200
|
+
type: "array",
|
|
201
|
+
minItems: MIN_OPTIONS,
|
|
202
|
+
maxItems: MAX_OPTIONS,
|
|
203
|
+
items: { type: "string" },
|
|
204
|
+
description: "2-10 options to vote on",
|
|
205
|
+
},
|
|
206
|
+
method: {
|
|
207
|
+
type: "string",
|
|
208
|
+
enum: [...METHODS],
|
|
209
|
+
description: "Voting method. Default: single_choice",
|
|
210
|
+
},
|
|
211
|
+
deadline_hours: {
|
|
212
|
+
type: "integer",
|
|
213
|
+
minimum: 1,
|
|
214
|
+
maximum: MAX_DEADLINE_HOURS,
|
|
215
|
+
description: "Hours until the decision closes. Default 48, max 720 (30 days).",
|
|
216
|
+
},
|
|
217
|
+
authority_mode: {
|
|
218
|
+
type: "string",
|
|
219
|
+
enum: [...AUTHORITY_MODES],
|
|
220
|
+
description: "How the result is reached: majority (most votes) or consensus (everyone agrees). Default: majority. Owner and approver modes need a named person and are set up in Verdo, not here.",
|
|
221
|
+
},
|
|
222
|
+
anonymous: {
|
|
223
|
+
type: "boolean",
|
|
224
|
+
description: "Whether votes are anonymous. Default: false",
|
|
225
|
+
},
|
|
226
|
+
idempotency_key: {
|
|
227
|
+
type: "string",
|
|
228
|
+
minLength: 1,
|
|
229
|
+
maxLength: MAX_IDEMPOTENCY_KEY,
|
|
230
|
+
description: "Optional. Retry safety: while the decision this key created is still open, the same key returns it instead of creating another. Case-sensitive, up to 128 characters.",
|
|
231
|
+
},
|
|
232
|
+
tags: {
|
|
233
|
+
type: "array",
|
|
234
|
+
maxItems: MAX_TAGS,
|
|
235
|
+
items: { type: "string", maxLength: 50 },
|
|
236
|
+
description: "Optional. Tags for the decision; a workspace routing rule matching one of them assigns its approver.",
|
|
237
|
+
},
|
|
238
|
+
source_agent: {
|
|
239
|
+
type: "string",
|
|
240
|
+
maxLength: 200,
|
|
241
|
+
description: "Optional. A name for the agent creating this, recorded on the decision. Default: the API key's name or the connected app.",
|
|
242
|
+
},
|
|
243
|
+
},
|
|
244
|
+
},
|
|
245
|
+
...meta,
|
|
246
|
+
},
|
|
247
|
+
{
|
|
248
|
+
name: "check_decision",
|
|
249
|
+
description: "Check the status, votes and outcome of a Verdo decision. Returns the status, the vote count per option, the owner if one is named, the outcome once a person has decided, the dashboard link, and its request fingerprint (compare it with the one create_decision returned), notification status, routing rule, creating agent and idempotency key.",
|
|
250
|
+
annotations: {
|
|
251
|
+
title: "Check Decision",
|
|
252
|
+
readOnlyHint: true,
|
|
253
|
+
destructiveHint: false,
|
|
254
|
+
idempotentHint: true,
|
|
255
|
+
openWorldHint: false,
|
|
256
|
+
},
|
|
257
|
+
inputSchema: {
|
|
258
|
+
type: "object",
|
|
259
|
+
required: ["id"],
|
|
260
|
+
properties: {
|
|
261
|
+
id: { type: "string", format: "uuid", description: "The decision ID from create_decision" },
|
|
262
|
+
},
|
|
263
|
+
},
|
|
264
|
+
...meta,
|
|
265
|
+
},
|
|
266
|
+
{
|
|
267
|
+
name: "list_decisions",
|
|
268
|
+
description: "List or search decisions in the workspace. Returns up to 25 decisions with their status and title. Use the query parameter to search by title, and the optional filters to narrow by status, tags, creating agent or notification status.",
|
|
269
|
+
annotations: {
|
|
270
|
+
title: "List Decisions",
|
|
271
|
+
readOnlyHint: true,
|
|
272
|
+
destructiveHint: false,
|
|
273
|
+
idempotentHint: true,
|
|
274
|
+
openWorldHint: false,
|
|
275
|
+
},
|
|
276
|
+
inputSchema: {
|
|
277
|
+
type: "object",
|
|
278
|
+
properties: {
|
|
279
|
+
query: { type: "string", description: "Search term to filter decisions by title (optional)" },
|
|
280
|
+
lifecycle_status: { type: "array", items: { type: "string", enum: [...LIFECYCLE_FILTER] }, description: "Only these statuses (optional)" },
|
|
281
|
+
tags: { type: "array", maxItems: MAX_TAGS, items: { type: "string" }, description: "Only decisions with any of these tags (optional)" },
|
|
282
|
+
source_agent: { type: "string", description: "Only decisions created by this agent name (optional)" },
|
|
283
|
+
notification_status: { type: "string", enum: [...NOTIFICATION_STATUSES], description: "Only decisions in this notification state (optional)" },
|
|
284
|
+
},
|
|
285
|
+
},
|
|
286
|
+
...meta,
|
|
287
|
+
},
|
|
288
|
+
{
|
|
289
|
+
name: "search_decisions",
|
|
290
|
+
description: "Search past decided decisions in this workspace by words in their title, newest first. Returns each decision's ID, title, status, outcome, decision date and owner. Results are past records, not consent (execution_authorized: false): a past decision never authorizes repeating it, and a new decision still needs the team.",
|
|
291
|
+
annotations: {
|
|
292
|
+
title: "Search Past Decisions",
|
|
293
|
+
readOnlyHint: true,
|
|
294
|
+
destructiveHint: false,
|
|
295
|
+
idempotentHint: true,
|
|
296
|
+
openWorldHint: false,
|
|
297
|
+
},
|
|
298
|
+
inputSchema: {
|
|
299
|
+
type: "object",
|
|
300
|
+
required: ["query"],
|
|
301
|
+
properties: {
|
|
302
|
+
query: { type: "string", maxLength: 140, description: "Words to look for in past decision titles" },
|
|
303
|
+
limit: { type: "integer", minimum: 1, maximum: SEARCH_LIMIT_MAX, description: `How many to return. Default ${SEARCH_LIMIT_DEFAULT}, max ${SEARCH_LIMIT_MAX}.` },
|
|
304
|
+
},
|
|
305
|
+
},
|
|
306
|
+
...meta,
|
|
307
|
+
},
|
|
308
|
+
{
|
|
309
|
+
name: "get_precedent",
|
|
310
|
+
description: "Retrieve a past decision record: its outcome, date, owner, how it was decided, the vote count per option, the rationale if it was approved for sharing, and related decisions on the same question. This is a past record, not consent or authorization to repeat the decision (execution_authorized: false).",
|
|
311
|
+
annotations: {
|
|
312
|
+
title: "Get Past Decision Record",
|
|
313
|
+
readOnlyHint: true,
|
|
314
|
+
destructiveHint: false,
|
|
315
|
+
idempotentHint: true,
|
|
316
|
+
openWorldHint: false,
|
|
317
|
+
},
|
|
318
|
+
inputSchema: {
|
|
319
|
+
type: "object",
|
|
320
|
+
required: ["decision_id"],
|
|
321
|
+
properties: {
|
|
322
|
+
decision_id: { type: "string", format: "uuid", description: "A decided decision's ID, from search_decisions" },
|
|
323
|
+
},
|
|
324
|
+
},
|
|
325
|
+
...meta,
|
|
326
|
+
},
|
|
327
|
+
{
|
|
328
|
+
name: "get_close_summary",
|
|
329
|
+
description: "Returns the owner, dashboard link and current tally for a decision, so you can ask the owner to close it. Read-only — changes nothing.",
|
|
330
|
+
annotations: {
|
|
331
|
+
title: "Get Close Summary",
|
|
332
|
+
readOnlyHint: true,
|
|
333
|
+
destructiveHint: false,
|
|
334
|
+
idempotentHint: true,
|
|
335
|
+
openWorldHint: false,
|
|
336
|
+
},
|
|
337
|
+
inputSchema: {
|
|
338
|
+
type: "object",
|
|
339
|
+
required: ["id"],
|
|
340
|
+
properties: {
|
|
341
|
+
id: { type: "string", format: "uuid", description: "The decision ID" },
|
|
342
|
+
},
|
|
343
|
+
},
|
|
344
|
+
...meta,
|
|
345
|
+
},
|
|
346
|
+
{
|
|
347
|
+
name: "cancel_decision",
|
|
348
|
+
description: "Withdraw a draft or open decision this connection or API key created. It closes for good as cancelled; anyone it was sent to sees it was withdrawn. This does not decide anything: to reject, the approver uses Verdo. Needs a full-access key or a connected app; draft-only keys are refused.",
|
|
349
|
+
annotations: {
|
|
350
|
+
title: "Cancel My Decision",
|
|
351
|
+
readOnlyHint: false,
|
|
352
|
+
destructiveHint: true,
|
|
353
|
+
idempotentHint: false,
|
|
354
|
+
openWorldHint: false,
|
|
355
|
+
},
|
|
356
|
+
inputSchema: {
|
|
357
|
+
type: "object",
|
|
358
|
+
required: ["decision_id"],
|
|
359
|
+
properties: {
|
|
360
|
+
decision_id: { type: "string", format: "uuid", description: "The decision ID from create_decision" },
|
|
361
|
+
reason: { type: "string", maxLength: 500, description: "Optional. Why it is being withdrawn (shown to the people it was sent to)." },
|
|
362
|
+
},
|
|
363
|
+
},
|
|
364
|
+
...meta,
|
|
365
|
+
},
|
|
366
|
+
{
|
|
367
|
+
name: "edit_decision",
|
|
368
|
+
description: "Revise a draft or open decision this connection or API key created: its title, description or options. A change voids every vote cast so far (people approved the old version) and changes the request fingerprint. Needs a full-access key or a connected app; draft-only keys are refused.",
|
|
369
|
+
annotations: {
|
|
370
|
+
title: "Edit My Decision",
|
|
371
|
+
readOnlyHint: false,
|
|
372
|
+
destructiveHint: true,
|
|
373
|
+
idempotentHint: true,
|
|
374
|
+
openWorldHint: false,
|
|
375
|
+
},
|
|
376
|
+
inputSchema: {
|
|
377
|
+
type: "object",
|
|
378
|
+
required: ["decision_id"],
|
|
379
|
+
properties: {
|
|
380
|
+
decision_id: { type: "string", format: "uuid", description: "The decision ID from create_decision" },
|
|
381
|
+
title: { type: "string", maxLength: MAX_TITLE_LENGTH, description: "New question (optional)" },
|
|
382
|
+
description: { type: "string", description: "New description (optional)" },
|
|
383
|
+
options: { type: "array", minItems: MIN_OPTIONS, maxItems: MAX_OPTIONS, items: { type: "string" }, description: "The full new list of options (optional)" },
|
|
384
|
+
},
|
|
385
|
+
},
|
|
386
|
+
...meta,
|
|
387
|
+
},
|
|
388
|
+
];
|
|
389
|
+
}
|
package/dist/index.js
CHANGED
|
@@ -29,7 +29,7 @@ const keyStore = {
|
|
|
29
29
|
}
|
|
30
30
|
},
|
|
31
31
|
};
|
|
32
|
-
const server = new Server({ name: "verdo-team-decisions", version: "
|
|
32
|
+
const server = new Server({ name: "verdo-team-decisions", version: "2.0.0" }, { capabilities: { tools: {} } });
|
|
33
33
|
server.setRequestHandler(ListToolsRequestSchema, async () => ({
|
|
34
34
|
tools: toolDefinitions(),
|
|
35
35
|
}));
|
package/dist/tools.d.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { AUTHORITY_MODES, METHODS, toolDefinitions } from "./definitions.js";
|
|
2
|
+
export { AUTHORITY_MODES, METHODS, toolDefinitions };
|
|
1
3
|
export type ApiKeyStore = {
|
|
2
4
|
get(): Promise<string | null>;
|
|
3
5
|
};
|
|
@@ -8,8 +10,6 @@ type Text = {
|
|
|
8
10
|
}[];
|
|
9
11
|
isError?: boolean;
|
|
10
12
|
};
|
|
11
|
-
export declare const METHODS: readonly ["single_choice", "ranked_choice", "approval", "dot"];
|
|
12
|
-
export declare const AUTHORITY_MODES: readonly ["majority", "consensus"];
|
|
13
13
|
export declare function createDecision(args: {
|
|
14
14
|
title: string;
|
|
15
15
|
options: string[];
|
|
@@ -17,123 +17,38 @@ export declare function createDecision(args: {
|
|
|
17
17
|
deadline_hours?: number;
|
|
18
18
|
authority_mode?: string;
|
|
19
19
|
anonymous?: boolean;
|
|
20
|
+
idempotency_key?: string;
|
|
21
|
+
tags?: string[];
|
|
22
|
+
source_agent?: string;
|
|
23
|
+
}, store: ApiKeyStore): Promise<Text>;
|
|
24
|
+
export declare function searchDecisions(args: {
|
|
25
|
+
query: string;
|
|
26
|
+
limit?: number;
|
|
27
|
+
}, store: ApiKeyStore): Promise<Text>;
|
|
28
|
+
export declare function getPrecedent(args: {
|
|
29
|
+
decision_id: string;
|
|
20
30
|
}, store: ApiKeyStore): Promise<Text>;
|
|
21
31
|
export declare function checkDecision(args: {
|
|
22
32
|
id: string;
|
|
23
33
|
}, store: ApiKeyStore): Promise<Text>;
|
|
24
34
|
export declare function listDecisions(args: {
|
|
25
35
|
query?: string;
|
|
36
|
+
lifecycle_status?: string[];
|
|
37
|
+
tags?: string[];
|
|
38
|
+
source_agent?: string;
|
|
39
|
+
notification_status?: string;
|
|
26
40
|
}, store: ApiKeyStore): Promise<Text>;
|
|
27
|
-
export declare function
|
|
41
|
+
export declare function getCloseSummary(args: {
|
|
28
42
|
id: string;
|
|
29
43
|
}, store: ApiKeyStore): Promise<Text>;
|
|
44
|
+
export declare function cancelDecision(args: {
|
|
45
|
+
decision_id: string;
|
|
46
|
+
reason?: string;
|
|
47
|
+
}, store: ApiKeyStore): Promise<Text>;
|
|
48
|
+
export declare function editDecision(args: {
|
|
49
|
+
decision_id: string;
|
|
50
|
+
title?: string;
|
|
51
|
+
description?: string;
|
|
52
|
+
options?: string[];
|
|
53
|
+
}, store: ApiKeyStore): Promise<Text>;
|
|
30
54
|
export declare function callTool(name: string, a: Record<string, unknown>, store: ApiKeyStore): Promise<Text>;
|
|
31
|
-
export declare function toolDefinitions(): ({
|
|
32
|
-
name: string;
|
|
33
|
-
description: string;
|
|
34
|
-
annotations: {
|
|
35
|
-
title: string;
|
|
36
|
-
readOnlyHint: boolean;
|
|
37
|
-
destructiveHint: boolean;
|
|
38
|
-
idempotentHint: boolean;
|
|
39
|
-
openWorldHint: boolean;
|
|
40
|
-
};
|
|
41
|
-
inputSchema: {
|
|
42
|
-
type: "object";
|
|
43
|
-
required: string[];
|
|
44
|
-
properties: {
|
|
45
|
-
title: {
|
|
46
|
-
type: string;
|
|
47
|
-
maxLength: number;
|
|
48
|
-
description: string;
|
|
49
|
-
};
|
|
50
|
-
options: {
|
|
51
|
-
type: string;
|
|
52
|
-
minItems: number;
|
|
53
|
-
maxItems: number;
|
|
54
|
-
items: {
|
|
55
|
-
type: string;
|
|
56
|
-
};
|
|
57
|
-
description: string;
|
|
58
|
-
};
|
|
59
|
-
method: {
|
|
60
|
-
type: string;
|
|
61
|
-
enum: ("single_choice" | "ranked_choice" | "approval" | "dot")[];
|
|
62
|
-
description: string;
|
|
63
|
-
};
|
|
64
|
-
deadline_hours: {
|
|
65
|
-
type: string;
|
|
66
|
-
minimum: number;
|
|
67
|
-
maximum: number;
|
|
68
|
-
description: string;
|
|
69
|
-
};
|
|
70
|
-
authority_mode: {
|
|
71
|
-
type: string;
|
|
72
|
-
enum: ("majority" | "consensus")[];
|
|
73
|
-
description: string;
|
|
74
|
-
};
|
|
75
|
-
anonymous: {
|
|
76
|
-
type: string;
|
|
77
|
-
description: string;
|
|
78
|
-
};
|
|
79
|
-
id?: undefined;
|
|
80
|
-
query?: undefined;
|
|
81
|
-
};
|
|
82
|
-
};
|
|
83
|
-
} | {
|
|
84
|
-
name: string;
|
|
85
|
-
description: string;
|
|
86
|
-
annotations: {
|
|
87
|
-
title: string;
|
|
88
|
-
readOnlyHint: boolean;
|
|
89
|
-
destructiveHint: boolean;
|
|
90
|
-
idempotentHint: boolean;
|
|
91
|
-
openWorldHint: boolean;
|
|
92
|
-
};
|
|
93
|
-
inputSchema: {
|
|
94
|
-
type: "object";
|
|
95
|
-
required: string[];
|
|
96
|
-
properties: {
|
|
97
|
-
id: {
|
|
98
|
-
type: string;
|
|
99
|
-
format: string;
|
|
100
|
-
description: string;
|
|
101
|
-
};
|
|
102
|
-
title?: undefined;
|
|
103
|
-
options?: undefined;
|
|
104
|
-
method?: undefined;
|
|
105
|
-
deadline_hours?: undefined;
|
|
106
|
-
authority_mode?: undefined;
|
|
107
|
-
anonymous?: undefined;
|
|
108
|
-
query?: undefined;
|
|
109
|
-
};
|
|
110
|
-
};
|
|
111
|
-
} | {
|
|
112
|
-
name: string;
|
|
113
|
-
description: string;
|
|
114
|
-
annotations: {
|
|
115
|
-
title: string;
|
|
116
|
-
readOnlyHint: boolean;
|
|
117
|
-
destructiveHint: boolean;
|
|
118
|
-
idempotentHint: boolean;
|
|
119
|
-
openWorldHint: boolean;
|
|
120
|
-
};
|
|
121
|
-
inputSchema: {
|
|
122
|
-
type: "object";
|
|
123
|
-
properties: {
|
|
124
|
-
query: {
|
|
125
|
-
type: string;
|
|
126
|
-
description: string;
|
|
127
|
-
};
|
|
128
|
-
title?: undefined;
|
|
129
|
-
options?: undefined;
|
|
130
|
-
method?: undefined;
|
|
131
|
-
deadline_hours?: undefined;
|
|
132
|
-
authority_mode?: undefined;
|
|
133
|
-
anonymous?: undefined;
|
|
134
|
-
id?: undefined;
|
|
135
|
-
};
|
|
136
|
-
required?: undefined;
|
|
137
|
-
};
|
|
138
|
-
})[];
|
|
139
|
-
export {};
|