@openintentai/mcp-server 0.13.4
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 +123 -0
- package/dist/client.d.ts +302 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/client.js +470 -0
- package/dist/client.js.map +1 -0
- package/dist/config.d.ts +42 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +106 -0
- package/dist/config.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +64 -0
- package/dist/index.js.map +1 -0
- package/dist/resources.d.ts +25 -0
- package/dist/resources.d.ts.map +1 -0
- package/dist/resources.js +96 -0
- package/dist/resources.js.map +1 -0
- package/dist/security.d.ts +75 -0
- package/dist/security.d.ts.map +1 -0
- package/dist/security.js +248 -0
- package/dist/security.js.map +1 -0
- package/dist/tools.d.ts +21 -0
- package/dist/tools.d.ts.map +1 -0
- package/dist/tools.js +1485 -0
- package/dist/tools.js.map +1 -0
- package/openintent-mcp.config.json +18 -0
- package/package.json +55 -0
package/dist/tools.js
ADDED
|
@@ -0,0 +1,1485 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TOOL_DEFINITIONS = void 0;
|
|
4
|
+
exports.handleToolCall = handleToolCall;
|
|
5
|
+
const security_js_1 = require("./security.js");
|
|
6
|
+
function textResult(data) {
|
|
7
|
+
return {
|
|
8
|
+
content: [{ type: "text", text: JSON.stringify(data, null, 2) }],
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
function errorResult(message) {
|
|
12
|
+
return {
|
|
13
|
+
content: [{ type: "text", text: JSON.stringify({ error: message }, null, 2) }],
|
|
14
|
+
isError: true,
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
exports.TOOL_DEFINITIONS = [
|
|
18
|
+
// ── Intent Management ────────────────────────────────────────────────
|
|
19
|
+
{
|
|
20
|
+
name: "openintent_create_intent",
|
|
21
|
+
description: "Create a new intent representing a goal to be coordinated across agents. " +
|
|
22
|
+
"Use this when you need to start a new task, project, or coordination workflow.",
|
|
23
|
+
inputSchema: {
|
|
24
|
+
type: "object",
|
|
25
|
+
properties: {
|
|
26
|
+
title: { type: "string", description: "Human-readable title for the intent" },
|
|
27
|
+
description: { type: "string", description: "Detailed description of the goal" },
|
|
28
|
+
constraints: {
|
|
29
|
+
type: "array",
|
|
30
|
+
items: { type: "string" },
|
|
31
|
+
description: "Optional constraints or rules the intent must satisfy",
|
|
32
|
+
},
|
|
33
|
+
initial_state: {
|
|
34
|
+
type: "object",
|
|
35
|
+
description: "Optional initial key-value state data",
|
|
36
|
+
additionalProperties: true,
|
|
37
|
+
},
|
|
38
|
+
},
|
|
39
|
+
required: ["title"],
|
|
40
|
+
},
|
|
41
|
+
tier: "write",
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
name: "openintent_get_intent",
|
|
45
|
+
description: "Retrieve an intent by its unique ID. Returns the full intent including " +
|
|
46
|
+
"status, state, version, constraints, and metadata.",
|
|
47
|
+
inputSchema: {
|
|
48
|
+
type: "object",
|
|
49
|
+
properties: {
|
|
50
|
+
intent_id: { type: "string", description: "The unique identifier of the intent" },
|
|
51
|
+
},
|
|
52
|
+
required: ["intent_id"],
|
|
53
|
+
},
|
|
54
|
+
tier: "read",
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
name: "openintent_list_intents",
|
|
58
|
+
description: "List intents with optional filtering by status. Useful for discovering " +
|
|
59
|
+
"active work, reviewing completed tasks, or finding blocked intents.",
|
|
60
|
+
inputSchema: {
|
|
61
|
+
type: "object",
|
|
62
|
+
properties: {
|
|
63
|
+
status: {
|
|
64
|
+
type: "string",
|
|
65
|
+
enum: ["draft", "active", "blocked", "completed", "abandoned"],
|
|
66
|
+
description: "Filter intents by status",
|
|
67
|
+
},
|
|
68
|
+
limit: { type: "number", description: "Maximum number of results (default 50)" },
|
|
69
|
+
offset: { type: "number", description: "Pagination offset (default 0)" },
|
|
70
|
+
},
|
|
71
|
+
},
|
|
72
|
+
tier: "read",
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
name: "openintent_update_state",
|
|
76
|
+
description: "Patch the intent's state with new key-value data. Uses optimistic concurrency " +
|
|
77
|
+
"control via version numbers to prevent conflicting updates. You must provide " +
|
|
78
|
+
"the current version obtained from get_intent.",
|
|
79
|
+
inputSchema: {
|
|
80
|
+
type: "object",
|
|
81
|
+
properties: {
|
|
82
|
+
intent_id: { type: "string", description: "The intent to update" },
|
|
83
|
+
version: {
|
|
84
|
+
type: "number",
|
|
85
|
+
description: "Current version of the intent (for conflict detection)",
|
|
86
|
+
},
|
|
87
|
+
state_patch: {
|
|
88
|
+
type: "object",
|
|
89
|
+
description: "Key-value pairs to merge into the intent state",
|
|
90
|
+
additionalProperties: true,
|
|
91
|
+
},
|
|
92
|
+
},
|
|
93
|
+
required: ["intent_id", "version", "state_patch"],
|
|
94
|
+
},
|
|
95
|
+
tier: "write",
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
name: "openintent_set_status",
|
|
99
|
+
description: "Change the lifecycle status of an intent. Valid transitions: " +
|
|
100
|
+
"draft\u2192active, active\u2192blocked/completed/abandoned, blocked\u2192active.",
|
|
101
|
+
inputSchema: {
|
|
102
|
+
type: "object",
|
|
103
|
+
properties: {
|
|
104
|
+
intent_id: { type: "string", description: "The intent to update" },
|
|
105
|
+
version: { type: "number", description: "Current version for conflict detection" },
|
|
106
|
+
status: {
|
|
107
|
+
type: "string",
|
|
108
|
+
enum: ["draft", "active", "blocked", "completed", "abandoned"],
|
|
109
|
+
description: "New status to set",
|
|
110
|
+
},
|
|
111
|
+
},
|
|
112
|
+
required: ["intent_id", "version", "status"],
|
|
113
|
+
},
|
|
114
|
+
tier: "admin",
|
|
115
|
+
},
|
|
116
|
+
// ── Event Logging ────────────────────────────────────────────────────
|
|
117
|
+
{
|
|
118
|
+
name: "openintent_log_event",
|
|
119
|
+
description: "Append an immutable event to an intent's audit log. Events are the " +
|
|
120
|
+
"primary record of all activity and can never be deleted.",
|
|
121
|
+
inputSchema: {
|
|
122
|
+
type: "object",
|
|
123
|
+
properties: {
|
|
124
|
+
intent_id: { type: "string", description: "The intent to log against" },
|
|
125
|
+
event_type: {
|
|
126
|
+
type: "string",
|
|
127
|
+
description: "Type of event (e.g. 'comment', 'state_patched', 'agent_assigned')",
|
|
128
|
+
},
|
|
129
|
+
payload: {
|
|
130
|
+
type: "object",
|
|
131
|
+
description: "Event-specific data",
|
|
132
|
+
additionalProperties: true,
|
|
133
|
+
},
|
|
134
|
+
},
|
|
135
|
+
required: ["intent_id", "event_type"],
|
|
136
|
+
},
|
|
137
|
+
tier: "write",
|
|
138
|
+
},
|
|
139
|
+
{
|
|
140
|
+
name: "openintent_get_events",
|
|
141
|
+
description: "Retrieve the event history for an intent. The event log is immutable " +
|
|
142
|
+
"and provides a full audit trail of all changes and activities.",
|
|
143
|
+
inputSchema: {
|
|
144
|
+
type: "object",
|
|
145
|
+
properties: {
|
|
146
|
+
intent_id: { type: "string", description: "The intent to query" },
|
|
147
|
+
event_type: { type: "string", description: "Filter by event type" },
|
|
148
|
+
limit: { type: "number", description: "Maximum number of events (default 100)" },
|
|
149
|
+
},
|
|
150
|
+
required: ["intent_id"],
|
|
151
|
+
},
|
|
152
|
+
tier: "read",
|
|
153
|
+
},
|
|
154
|
+
// ── Leasing ──────────────────────────────────────────────────────────
|
|
155
|
+
{
|
|
156
|
+
name: "openintent_acquire_lease",
|
|
157
|
+
description: "Acquire an exclusive lease on a scope within an intent. Leases prevent " +
|
|
158
|
+
"concurrent modifications to the same scope by different agents. " +
|
|
159
|
+
"Returns the lease object with its ID and expiration.",
|
|
160
|
+
inputSchema: {
|
|
161
|
+
type: "object",
|
|
162
|
+
properties: {
|
|
163
|
+
intent_id: { type: "string", description: "The intent to lease within" },
|
|
164
|
+
scope: {
|
|
165
|
+
type: "string",
|
|
166
|
+
description: "The scope to acquire (e.g. 'research', 'analysis')",
|
|
167
|
+
},
|
|
168
|
+
duration_seconds: {
|
|
169
|
+
type: "number",
|
|
170
|
+
description: "Lease duration in seconds (default 300)",
|
|
171
|
+
},
|
|
172
|
+
},
|
|
173
|
+
required: ["intent_id", "scope"],
|
|
174
|
+
},
|
|
175
|
+
tier: "admin",
|
|
176
|
+
},
|
|
177
|
+
{
|
|
178
|
+
name: "openintent_release_lease",
|
|
179
|
+
description: "Release a previously acquired lease, allowing other agents to acquire it.",
|
|
180
|
+
inputSchema: {
|
|
181
|
+
type: "object",
|
|
182
|
+
properties: {
|
|
183
|
+
intent_id: { type: "string", description: "The intent containing the lease" },
|
|
184
|
+
lease_id: { type: "string", description: "The lease ID to release" },
|
|
185
|
+
},
|
|
186
|
+
required: ["intent_id", "lease_id"],
|
|
187
|
+
},
|
|
188
|
+
tier: "admin",
|
|
189
|
+
},
|
|
190
|
+
// ── Agent Management ─────────────────────────────────────────────────
|
|
191
|
+
{
|
|
192
|
+
name: "openintent_assign_agent",
|
|
193
|
+
description: "Assign an agent to work on an intent. Agents can be assigned with " +
|
|
194
|
+
"a role such as 'worker', 'reviewer', or 'coordinator'.",
|
|
195
|
+
inputSchema: {
|
|
196
|
+
type: "object",
|
|
197
|
+
properties: {
|
|
198
|
+
intent_id: { type: "string", description: "The intent to assign to" },
|
|
199
|
+
agent_id: { type: "string", description: "The agent identifier to assign" },
|
|
200
|
+
role: {
|
|
201
|
+
type: "string",
|
|
202
|
+
description: "Agent role (default 'worker')",
|
|
203
|
+
},
|
|
204
|
+
},
|
|
205
|
+
required: ["intent_id", "agent_id"],
|
|
206
|
+
},
|
|
207
|
+
tier: "admin",
|
|
208
|
+
},
|
|
209
|
+
{
|
|
210
|
+
name: "openintent_unassign_agent",
|
|
211
|
+
description: "Remove an agent from an intent assignment.",
|
|
212
|
+
inputSchema: {
|
|
213
|
+
type: "object",
|
|
214
|
+
properties: {
|
|
215
|
+
intent_id: { type: "string", description: "The intent to unassign from" },
|
|
216
|
+
agent_id: { type: "string", description: "The agent identifier to remove" },
|
|
217
|
+
},
|
|
218
|
+
required: ["intent_id", "agent_id"],
|
|
219
|
+
},
|
|
220
|
+
tier: "admin",
|
|
221
|
+
},
|
|
222
|
+
// ── Messaging (RFC-0021) ─────────────────────────────────────────────
|
|
223
|
+
{
|
|
224
|
+
name: "openintent_create_channel",
|
|
225
|
+
description: "Create a messaging channel for direct agent-to-agent communication. " +
|
|
226
|
+
"Channels are scoped to an intent and support request/reply, broadcast, " +
|
|
227
|
+
"and point-to-point messaging patterns.",
|
|
228
|
+
inputSchema: {
|
|
229
|
+
type: "object",
|
|
230
|
+
properties: {
|
|
231
|
+
intent_id: { type: "string", description: "The intent to scope the channel to" },
|
|
232
|
+
name: { type: "string", description: "Channel name (e.g. 'data-sync', 'progress')" },
|
|
233
|
+
members: {
|
|
234
|
+
type: "array",
|
|
235
|
+
items: { type: "string" },
|
|
236
|
+
description: "Agent IDs to include in the channel",
|
|
237
|
+
},
|
|
238
|
+
member_policy: {
|
|
239
|
+
type: "string",
|
|
240
|
+
enum: ["explicit", "open"],
|
|
241
|
+
description: "Membership policy (default 'explicit')",
|
|
242
|
+
},
|
|
243
|
+
},
|
|
244
|
+
required: ["intent_id", "name"],
|
|
245
|
+
},
|
|
246
|
+
tier: "admin",
|
|
247
|
+
},
|
|
248
|
+
{
|
|
249
|
+
name: "openintent_send_message",
|
|
250
|
+
description: "Send a message on a channel. Messages can be directed to a specific " +
|
|
251
|
+
"agent (point-to-point) or sent without a target for general consumption.",
|
|
252
|
+
inputSchema: {
|
|
253
|
+
type: "object",
|
|
254
|
+
properties: {
|
|
255
|
+
channel_id: { type: "string", description: "The channel to send on" },
|
|
256
|
+
payload: {
|
|
257
|
+
type: "object",
|
|
258
|
+
description: "Message content",
|
|
259
|
+
additionalProperties: true,
|
|
260
|
+
},
|
|
261
|
+
to: { type: "string", description: "Target agent ID for directed messages" },
|
|
262
|
+
message_type: {
|
|
263
|
+
type: "string",
|
|
264
|
+
description: "Message type (default 'message')",
|
|
265
|
+
},
|
|
266
|
+
},
|
|
267
|
+
required: ["channel_id", "payload"],
|
|
268
|
+
},
|
|
269
|
+
tier: "write",
|
|
270
|
+
},
|
|
271
|
+
{
|
|
272
|
+
name: "openintent_ask",
|
|
273
|
+
description: "Send a request on a channel and await a correlated response. This implements " +
|
|
274
|
+
"the ask/reply pattern where you send a question to a specific agent and " +
|
|
275
|
+
"wait for their response.",
|
|
276
|
+
inputSchema: {
|
|
277
|
+
type: "object",
|
|
278
|
+
properties: {
|
|
279
|
+
channel_id: { type: "string", description: "The channel to ask on" },
|
|
280
|
+
to: { type: "string", description: "Target agent ID to ask" },
|
|
281
|
+
payload: {
|
|
282
|
+
type: "object",
|
|
283
|
+
description: "Request content",
|
|
284
|
+
additionalProperties: true,
|
|
285
|
+
},
|
|
286
|
+
timeout: {
|
|
287
|
+
type: "number",
|
|
288
|
+
description: "Timeout in seconds to wait for response (default 30)",
|
|
289
|
+
},
|
|
290
|
+
},
|
|
291
|
+
required: ["channel_id", "to", "payload"],
|
|
292
|
+
},
|
|
293
|
+
tier: "write",
|
|
294
|
+
},
|
|
295
|
+
{
|
|
296
|
+
name: "openintent_broadcast",
|
|
297
|
+
description: "Broadcast a message to all members of a channel. Useful for status " +
|
|
298
|
+
"updates, progress notifications, or coordination signals.",
|
|
299
|
+
inputSchema: {
|
|
300
|
+
type: "object",
|
|
301
|
+
properties: {
|
|
302
|
+
channel_id: { type: "string", description: "The channel to broadcast on" },
|
|
303
|
+
payload: {
|
|
304
|
+
type: "object",
|
|
305
|
+
description: "Broadcast content",
|
|
306
|
+
additionalProperties: true,
|
|
307
|
+
},
|
|
308
|
+
},
|
|
309
|
+
required: ["channel_id", "payload"],
|
|
310
|
+
},
|
|
311
|
+
tier: "write",
|
|
312
|
+
},
|
|
313
|
+
{
|
|
314
|
+
name: "openintent_get_messages",
|
|
315
|
+
description: "Retrieve messages from a channel, ordered by creation time.",
|
|
316
|
+
inputSchema: {
|
|
317
|
+
type: "object",
|
|
318
|
+
properties: {
|
|
319
|
+
channel_id: { type: "string", description: "The channel to read from" },
|
|
320
|
+
limit: { type: "number", description: "Maximum number of messages to return" },
|
|
321
|
+
},
|
|
322
|
+
required: ["channel_id"],
|
|
323
|
+
},
|
|
324
|
+
tier: "read",
|
|
325
|
+
},
|
|
326
|
+
// ── Workflows (RFC-0011) ──────────────────────────────────────────
|
|
327
|
+
{
|
|
328
|
+
name: "openintent_create_workflow",
|
|
329
|
+
description: "Create a new workflow from a YAML specification. Workflows define " +
|
|
330
|
+
"multi-step coordination patterns with agent assignments and dependencies.",
|
|
331
|
+
inputSchema: {
|
|
332
|
+
type: "object",
|
|
333
|
+
properties: {
|
|
334
|
+
name: { type: "string", description: "Human-readable workflow name" },
|
|
335
|
+
yaml_spec: { type: "string", description: "YAML workflow specification" },
|
|
336
|
+
description: { type: "string", description: "Optional workflow description" },
|
|
337
|
+
},
|
|
338
|
+
required: ["name", "yaml_spec"],
|
|
339
|
+
},
|
|
340
|
+
tier: "write",
|
|
341
|
+
},
|
|
342
|
+
{
|
|
343
|
+
name: "openintent_trigger_workflow",
|
|
344
|
+
description: "Trigger execution of a registered workflow. Optionally provide input " +
|
|
345
|
+
"data that will be available to the workflow's agents.",
|
|
346
|
+
inputSchema: {
|
|
347
|
+
type: "object",
|
|
348
|
+
properties: {
|
|
349
|
+
workflow_id: { type: "string", description: "The workflow to trigger" },
|
|
350
|
+
inputs: {
|
|
351
|
+
type: "object",
|
|
352
|
+
description: "Optional input data for the workflow",
|
|
353
|
+
additionalProperties: true,
|
|
354
|
+
},
|
|
355
|
+
},
|
|
356
|
+
required: ["workflow_id"],
|
|
357
|
+
},
|
|
358
|
+
tier: "admin",
|
|
359
|
+
},
|
|
360
|
+
{
|
|
361
|
+
name: "openintent_get_workflow",
|
|
362
|
+
description: "Retrieve a workflow definition by its ID, including its YAML spec and metadata.",
|
|
363
|
+
inputSchema: {
|
|
364
|
+
type: "object",
|
|
365
|
+
properties: {
|
|
366
|
+
workflow_id: { type: "string", description: "The workflow identifier" },
|
|
367
|
+
},
|
|
368
|
+
required: ["workflow_id"],
|
|
369
|
+
},
|
|
370
|
+
tier: "read",
|
|
371
|
+
},
|
|
372
|
+
{
|
|
373
|
+
name: "openintent_list_workflows",
|
|
374
|
+
description: "List all registered workflows with optional pagination.",
|
|
375
|
+
inputSchema: {
|
|
376
|
+
type: "object",
|
|
377
|
+
properties: {
|
|
378
|
+
limit: { type: "number", description: "Maximum number of results (default 50)" },
|
|
379
|
+
offset: { type: "number", description: "Pagination offset (default 0)" },
|
|
380
|
+
},
|
|
381
|
+
},
|
|
382
|
+
tier: "read",
|
|
383
|
+
},
|
|
384
|
+
// ── Plans & Task Decomposition (RFC-0012) ─────────────────────────
|
|
385
|
+
{
|
|
386
|
+
name: "openintent_create_plan",
|
|
387
|
+
description: "Create a structured execution plan for an intent. Plans define ordered " +
|
|
388
|
+
"steps with dependencies that agents follow to complete complex tasks.",
|
|
389
|
+
inputSchema: {
|
|
390
|
+
type: "object",
|
|
391
|
+
properties: {
|
|
392
|
+
intent_id: { type: "string", description: "The intent this plan belongs to" },
|
|
393
|
+
title: { type: "string", description: "Plan title" },
|
|
394
|
+
steps: {
|
|
395
|
+
type: "array",
|
|
396
|
+
items: {
|
|
397
|
+
type: "object",
|
|
398
|
+
properties: {
|
|
399
|
+
title: { type: "string" },
|
|
400
|
+
description: { type: "string" },
|
|
401
|
+
depends_on: { type: "array", items: { type: "string" } },
|
|
402
|
+
},
|
|
403
|
+
required: ["title"],
|
|
404
|
+
},
|
|
405
|
+
description: "Ordered list of plan steps with optional dependencies",
|
|
406
|
+
},
|
|
407
|
+
},
|
|
408
|
+
required: ["intent_id", "title", "steps"],
|
|
409
|
+
},
|
|
410
|
+
tier: "write",
|
|
411
|
+
},
|
|
412
|
+
{
|
|
413
|
+
name: "openintent_decompose_task",
|
|
414
|
+
description: "Automatically decompose a high-level task description into a structured " +
|
|
415
|
+
"plan with subtasks and dependencies.",
|
|
416
|
+
inputSchema: {
|
|
417
|
+
type: "object",
|
|
418
|
+
properties: {
|
|
419
|
+
intent_id: { type: "string", description: "The intent context for decomposition" },
|
|
420
|
+
task_description: { type: "string", description: "High-level task to decompose" },
|
|
421
|
+
max_depth: { type: "number", description: "Maximum decomposition depth (default 3)" },
|
|
422
|
+
},
|
|
423
|
+
required: ["intent_id", "task_description"],
|
|
424
|
+
},
|
|
425
|
+
tier: "write",
|
|
426
|
+
},
|
|
427
|
+
{
|
|
428
|
+
name: "openintent_get_plan",
|
|
429
|
+
description: "Retrieve a plan by ID including all steps and their current status.",
|
|
430
|
+
inputSchema: {
|
|
431
|
+
type: "object",
|
|
432
|
+
properties: {
|
|
433
|
+
intent_id: { type: "string", description: "The intent containing the plan" },
|
|
434
|
+
plan_id: { type: "string", description: "The plan identifier" },
|
|
435
|
+
},
|
|
436
|
+
required: ["intent_id", "plan_id"],
|
|
437
|
+
},
|
|
438
|
+
tier: "read",
|
|
439
|
+
},
|
|
440
|
+
// ── Coordinator Governance (RFC-0013) ─────────────────────────────
|
|
441
|
+
{
|
|
442
|
+
name: "openintent_set_coordinator",
|
|
443
|
+
description: "Assign a coordinator to an intent with an optional governance policy. " +
|
|
444
|
+
"The coordinator oversees agent work and makes arbitration decisions.",
|
|
445
|
+
inputSchema: {
|
|
446
|
+
type: "object",
|
|
447
|
+
properties: {
|
|
448
|
+
intent_id: { type: "string", description: "The intent to coordinate" },
|
|
449
|
+
coordinator_id: { type: "string", description: "Agent ID of the coordinator" },
|
|
450
|
+
governance_policy: {
|
|
451
|
+
type: "string",
|
|
452
|
+
description: "Governance policy name (default 'default')",
|
|
453
|
+
},
|
|
454
|
+
},
|
|
455
|
+
required: ["intent_id", "coordinator_id"],
|
|
456
|
+
},
|
|
457
|
+
tier: "admin",
|
|
458
|
+
},
|
|
459
|
+
{
|
|
460
|
+
name: "openintent_record_decision",
|
|
461
|
+
description: "Record a governance decision made by a coordinator. Decisions are " +
|
|
462
|
+
"immutable and include rationale for auditability.",
|
|
463
|
+
inputSchema: {
|
|
464
|
+
type: "object",
|
|
465
|
+
properties: {
|
|
466
|
+
intent_id: { type: "string", description: "The intent this decision applies to" },
|
|
467
|
+
decision_type: { type: "string", description: "Type of decision (e.g. 'approval', 'rejection', 'escalation')" },
|
|
468
|
+
rationale: { type: "string", description: "Explanation for the decision" },
|
|
469
|
+
outcome: {
|
|
470
|
+
type: "object",
|
|
471
|
+
description: "Structured outcome data",
|
|
472
|
+
additionalProperties: true,
|
|
473
|
+
},
|
|
474
|
+
},
|
|
475
|
+
required: ["intent_id", "decision_type", "rationale", "outcome"],
|
|
476
|
+
},
|
|
477
|
+
tier: "admin",
|
|
478
|
+
},
|
|
479
|
+
{
|
|
480
|
+
name: "openintent_get_arbitration",
|
|
481
|
+
description: "Retrieve the arbitration history and governance state for an intent.",
|
|
482
|
+
inputSchema: {
|
|
483
|
+
type: "object",
|
|
484
|
+
properties: {
|
|
485
|
+
intent_id: { type: "string", description: "The intent to query" },
|
|
486
|
+
},
|
|
487
|
+
required: ["intent_id"],
|
|
488
|
+
},
|
|
489
|
+
tier: "read",
|
|
490
|
+
},
|
|
491
|
+
// ── Human Escalation (RFC-0013) ────────────────────────────────────
|
|
492
|
+
{
|
|
493
|
+
name: "openintent_escalate_to_human",
|
|
494
|
+
description: "Escalate an intent to a human reviewer when an agent is blocked, " +
|
|
495
|
+
"uncertain, or a decision exceeds its authority. Supports priority " +
|
|
496
|
+
"levels and structured context for the human reviewer.",
|
|
497
|
+
inputSchema: {
|
|
498
|
+
type: "object",
|
|
499
|
+
properties: {
|
|
500
|
+
intent_id: { type: "string", description: "The intent requiring human attention" },
|
|
501
|
+
reason: { type: "string", description: "Why this needs human intervention" },
|
|
502
|
+
priority: {
|
|
503
|
+
type: "string",
|
|
504
|
+
enum: ["low", "normal", "high", "critical"],
|
|
505
|
+
description: "Escalation priority (default: normal)",
|
|
506
|
+
},
|
|
507
|
+
context: {
|
|
508
|
+
type: "object",
|
|
509
|
+
description: "Structured context to help the human reviewer (e.g. options considered, constraints)",
|
|
510
|
+
additionalProperties: true,
|
|
511
|
+
},
|
|
512
|
+
},
|
|
513
|
+
required: ["intent_id", "reason"],
|
|
514
|
+
},
|
|
515
|
+
tier: "write",
|
|
516
|
+
},
|
|
517
|
+
{
|
|
518
|
+
name: "openintent_list_escalations",
|
|
519
|
+
description: "List escalations awaiting human action. Filter by intent or status " +
|
|
520
|
+
"(pending, acknowledged, resolved).",
|
|
521
|
+
inputSchema: {
|
|
522
|
+
type: "object",
|
|
523
|
+
properties: {
|
|
524
|
+
intent_id: { type: "string", description: "Filter to a specific intent" },
|
|
525
|
+
status: {
|
|
526
|
+
type: "string",
|
|
527
|
+
enum: ["pending", "acknowledged", "resolved"],
|
|
528
|
+
description: "Filter by escalation status",
|
|
529
|
+
},
|
|
530
|
+
limit: { type: "number", description: "Max results to return" },
|
|
531
|
+
offset: { type: "number", description: "Pagination offset" },
|
|
532
|
+
},
|
|
533
|
+
required: [],
|
|
534
|
+
},
|
|
535
|
+
tier: "read",
|
|
536
|
+
},
|
|
537
|
+
{
|
|
538
|
+
name: "openintent_resolve_escalation",
|
|
539
|
+
description: "Resolve a pending escalation with a human decision. The resolution " +
|
|
540
|
+
"is recorded immutably for audit and the originating agent is notified.",
|
|
541
|
+
inputSchema: {
|
|
542
|
+
type: "object",
|
|
543
|
+
properties: {
|
|
544
|
+
escalation_id: { type: "string", description: "The escalation to resolve" },
|
|
545
|
+
resolution: {
|
|
546
|
+
type: "string",
|
|
547
|
+
enum: ["approved", "denied", "deferred", "overridden"],
|
|
548
|
+
description: "Resolution outcome",
|
|
549
|
+
},
|
|
550
|
+
decision: {
|
|
551
|
+
type: "object",
|
|
552
|
+
description: "Structured decision data (instructions, constraints, rationale)",
|
|
553
|
+
additionalProperties: true,
|
|
554
|
+
},
|
|
555
|
+
},
|
|
556
|
+
required: ["escalation_id", "resolution", "decision"],
|
|
557
|
+
},
|
|
558
|
+
tier: "admin",
|
|
559
|
+
},
|
|
560
|
+
{
|
|
561
|
+
name: "openintent_request_approval",
|
|
562
|
+
description: "Request explicit human approval before an agent proceeds with an " +
|
|
563
|
+
"action. The agent should poll get_approval_status or wait for a " +
|
|
564
|
+
"notification before continuing.",
|
|
565
|
+
inputSchema: {
|
|
566
|
+
type: "object",
|
|
567
|
+
properties: {
|
|
568
|
+
intent_id: { type: "string", description: "The intent this approval is scoped to" },
|
|
569
|
+
action_description: { type: "string", description: "What the agent wants to do and why approval is needed" },
|
|
570
|
+
urgency: {
|
|
571
|
+
type: "string",
|
|
572
|
+
enum: ["low", "normal", "high", "critical"],
|
|
573
|
+
description: "How urgently approval is needed (default: normal)",
|
|
574
|
+
},
|
|
575
|
+
metadata: {
|
|
576
|
+
type: "object",
|
|
577
|
+
description: "Additional context (estimated cost, risk level, affected resources)",
|
|
578
|
+
additionalProperties: true,
|
|
579
|
+
},
|
|
580
|
+
},
|
|
581
|
+
required: ["intent_id", "action_description"],
|
|
582
|
+
},
|
|
583
|
+
tier: "write",
|
|
584
|
+
},
|
|
585
|
+
{
|
|
586
|
+
name: "openintent_get_approval_status",
|
|
587
|
+
description: "Check the status of a previously submitted approval request. " +
|
|
588
|
+
"Returns pending, approved, or denied with optional reviewer notes.",
|
|
589
|
+
inputSchema: {
|
|
590
|
+
type: "object",
|
|
591
|
+
properties: {
|
|
592
|
+
intent_id: { type: "string", description: "The intent the approval belongs to" },
|
|
593
|
+
approval_id: { type: "string", description: "The approval request ID to check" },
|
|
594
|
+
},
|
|
595
|
+
required: ["intent_id", "approval_id"],
|
|
596
|
+
},
|
|
597
|
+
tier: "read",
|
|
598
|
+
},
|
|
599
|
+
// ── Portfolios (RFC-0004) ─────────────────────────────────────────
|
|
600
|
+
{
|
|
601
|
+
name: "openintent_create_portfolio",
|
|
602
|
+
description: "Create a portfolio to group related intents together. Portfolios " +
|
|
603
|
+
"provide a higher-level view of coordinated work.",
|
|
604
|
+
inputSchema: {
|
|
605
|
+
type: "object",
|
|
606
|
+
properties: {
|
|
607
|
+
name: { type: "string", description: "Portfolio name" },
|
|
608
|
+
description: { type: "string", description: "Optional portfolio description" },
|
|
609
|
+
},
|
|
610
|
+
required: ["name"],
|
|
611
|
+
},
|
|
612
|
+
tier: "write",
|
|
613
|
+
},
|
|
614
|
+
{
|
|
615
|
+
name: "openintent_add_to_portfolio",
|
|
616
|
+
description: "Add an intent to an existing portfolio.",
|
|
617
|
+
inputSchema: {
|
|
618
|
+
type: "object",
|
|
619
|
+
properties: {
|
|
620
|
+
portfolio_id: { type: "string", description: "The portfolio to add to" },
|
|
621
|
+
intent_id: { type: "string", description: "The intent to include" },
|
|
622
|
+
},
|
|
623
|
+
required: ["portfolio_id", "intent_id"],
|
|
624
|
+
},
|
|
625
|
+
tier: "write",
|
|
626
|
+
},
|
|
627
|
+
{
|
|
628
|
+
name: "openintent_get_portfolio",
|
|
629
|
+
description: "Retrieve a portfolio and its constituent intents.",
|
|
630
|
+
inputSchema: {
|
|
631
|
+
type: "object",
|
|
632
|
+
properties: {
|
|
633
|
+
portfolio_id: { type: "string", description: "The portfolio identifier" },
|
|
634
|
+
},
|
|
635
|
+
required: ["portfolio_id"],
|
|
636
|
+
},
|
|
637
|
+
tier: "read",
|
|
638
|
+
},
|
|
639
|
+
// ── Access Control (RFC-0011) ─────────────────────────────────────
|
|
640
|
+
{
|
|
641
|
+
name: "openintent_set_permissions",
|
|
642
|
+
description: "Set the permissions configuration for an intent. Uses optimistic " +
|
|
643
|
+
"concurrency control to prevent conflicting permission changes.",
|
|
644
|
+
inputSchema: {
|
|
645
|
+
type: "object",
|
|
646
|
+
properties: {
|
|
647
|
+
intent_id: { type: "string", description: "The intent to configure" },
|
|
648
|
+
permissions: {
|
|
649
|
+
type: "object",
|
|
650
|
+
description: "Permissions configuration (policy, allow, delegate, context)",
|
|
651
|
+
additionalProperties: true,
|
|
652
|
+
},
|
|
653
|
+
version: { type: "number", description: "Current version for conflict detection" },
|
|
654
|
+
},
|
|
655
|
+
required: ["intent_id", "permissions", "version"],
|
|
656
|
+
},
|
|
657
|
+
tier: "admin",
|
|
658
|
+
},
|
|
659
|
+
{
|
|
660
|
+
name: "openintent_get_permissions",
|
|
661
|
+
description: "Retrieve the current permissions configuration for an intent.",
|
|
662
|
+
inputSchema: {
|
|
663
|
+
type: "object",
|
|
664
|
+
properties: {
|
|
665
|
+
intent_id: { type: "string", description: "The intent to query" },
|
|
666
|
+
},
|
|
667
|
+
required: ["intent_id"],
|
|
668
|
+
},
|
|
669
|
+
tier: "read",
|
|
670
|
+
},
|
|
671
|
+
{
|
|
672
|
+
name: "openintent_grant_access",
|
|
673
|
+
description: "Grant an agent access to an intent with a specific permission level " +
|
|
674
|
+
"and optional scope restrictions.",
|
|
675
|
+
inputSchema: {
|
|
676
|
+
type: "object",
|
|
677
|
+
properties: {
|
|
678
|
+
intent_id: { type: "string", description: "The intent to grant access to" },
|
|
679
|
+
agent_id: { type: "string", description: "The agent to grant access" },
|
|
680
|
+
level: {
|
|
681
|
+
type: "string",
|
|
682
|
+
enum: ["read", "write", "admin"],
|
|
683
|
+
description: "Permission level to grant",
|
|
684
|
+
},
|
|
685
|
+
scopes: {
|
|
686
|
+
type: "array",
|
|
687
|
+
items: { type: "string" },
|
|
688
|
+
description: "Optional scope restrictions (default ['*'] for all)",
|
|
689
|
+
},
|
|
690
|
+
},
|
|
691
|
+
required: ["intent_id", "agent_id", "level"],
|
|
692
|
+
},
|
|
693
|
+
tier: "admin",
|
|
694
|
+
},
|
|
695
|
+
// ── Credential Vaults (RFC-0014) ──────────────────────────────────
|
|
696
|
+
{
|
|
697
|
+
name: "openintent_store_credential",
|
|
698
|
+
description: "Store a credential in a vault. Credentials are encrypted at rest " +
|
|
699
|
+
"and never exposed in API responses or audit logs.",
|
|
700
|
+
inputSchema: {
|
|
701
|
+
type: "object",
|
|
702
|
+
properties: {
|
|
703
|
+
vault_id: { type: "string", description: "The vault to store in" },
|
|
704
|
+
credential_name: { type: "string", description: "Unique name for this credential" },
|
|
705
|
+
credential_type: {
|
|
706
|
+
type: "string",
|
|
707
|
+
description: "Credential type (e.g. 'api_key', 'oauth2', 'bearer')",
|
|
708
|
+
},
|
|
709
|
+
metadata: {
|
|
710
|
+
type: "object",
|
|
711
|
+
description: "Non-sensitive metadata (base_url, auth_type, etc.)",
|
|
712
|
+
additionalProperties: true,
|
|
713
|
+
},
|
|
714
|
+
},
|
|
715
|
+
required: ["vault_id", "credential_name", "credential_type"],
|
|
716
|
+
},
|
|
717
|
+
tier: "admin",
|
|
718
|
+
},
|
|
719
|
+
{
|
|
720
|
+
name: "openintent_get_credential",
|
|
721
|
+
description: "Retrieve credential metadata from a vault. Returns metadata only — " +
|
|
722
|
+
"secrets are never exposed through MCP.",
|
|
723
|
+
inputSchema: {
|
|
724
|
+
type: "object",
|
|
725
|
+
properties: {
|
|
726
|
+
vault_id: { type: "string", description: "The vault containing the credential" },
|
|
727
|
+
credential_name: { type: "string", description: "The credential to retrieve" },
|
|
728
|
+
},
|
|
729
|
+
required: ["vault_id", "credential_name"],
|
|
730
|
+
},
|
|
731
|
+
tier: "admin",
|
|
732
|
+
},
|
|
733
|
+
{
|
|
734
|
+
name: "openintent_grant_tool",
|
|
735
|
+
description: "Grant an agent access to use a specific tool with optional constraints. " +
|
|
736
|
+
"The tool must be backed by a credential in the vault.",
|
|
737
|
+
inputSchema: {
|
|
738
|
+
type: "object",
|
|
739
|
+
properties: {
|
|
740
|
+
intent_id: { type: "string", description: "The intent scope for the grant" },
|
|
741
|
+
agent_id: { type: "string", description: "The agent receiving tool access" },
|
|
742
|
+
tool_name: { type: "string", description: "Name of the tool to grant" },
|
|
743
|
+
constraints: {
|
|
744
|
+
type: "object",
|
|
745
|
+
description: "Optional usage constraints (rate limits, allowed methods, etc.)",
|
|
746
|
+
additionalProperties: true,
|
|
747
|
+
},
|
|
748
|
+
},
|
|
749
|
+
required: ["intent_id", "agent_id", "tool_name"],
|
|
750
|
+
},
|
|
751
|
+
tier: "admin",
|
|
752
|
+
},
|
|
753
|
+
// ── Agent Memory (RFC-0015) ───────────────────────────────────────
|
|
754
|
+
{
|
|
755
|
+
name: "openintent_memory_set",
|
|
756
|
+
description: "Store a value in an agent's persistent memory. Memory is organized " +
|
|
757
|
+
"by namespace and key, with optional TTL for automatic expiration.",
|
|
758
|
+
inputSchema: {
|
|
759
|
+
type: "object",
|
|
760
|
+
properties: {
|
|
761
|
+
agent_id: { type: "string", description: "The agent whose memory to write" },
|
|
762
|
+
namespace: { type: "string", description: "Memory namespace (e.g. 'preferences', 'context')" },
|
|
763
|
+
key: { type: "string", description: "Memory key" },
|
|
764
|
+
value: { description: "Value to store (any JSON-serializable data)" },
|
|
765
|
+
ttl_seconds: { type: "number", description: "Optional time-to-live in seconds" },
|
|
766
|
+
},
|
|
767
|
+
required: ["agent_id", "namespace", "key", "value"],
|
|
768
|
+
},
|
|
769
|
+
tier: "write",
|
|
770
|
+
},
|
|
771
|
+
{
|
|
772
|
+
name: "openintent_memory_get",
|
|
773
|
+
description: "Retrieve a value from an agent's persistent memory by namespace and key.",
|
|
774
|
+
inputSchema: {
|
|
775
|
+
type: "object",
|
|
776
|
+
properties: {
|
|
777
|
+
agent_id: { type: "string", description: "The agent whose memory to read" },
|
|
778
|
+
namespace: { type: "string", description: "Memory namespace" },
|
|
779
|
+
key: { type: "string", description: "Memory key" },
|
|
780
|
+
},
|
|
781
|
+
required: ["agent_id", "namespace", "key"],
|
|
782
|
+
},
|
|
783
|
+
tier: "read",
|
|
784
|
+
},
|
|
785
|
+
{
|
|
786
|
+
name: "openintent_memory_list",
|
|
787
|
+
description: "List all memory keys for an agent, optionally filtered by namespace.",
|
|
788
|
+
inputSchema: {
|
|
789
|
+
type: "object",
|
|
790
|
+
properties: {
|
|
791
|
+
agent_id: { type: "string", description: "The agent whose memory to list" },
|
|
792
|
+
namespace: { type: "string", description: "Optional namespace filter" },
|
|
793
|
+
},
|
|
794
|
+
required: ["agent_id"],
|
|
795
|
+
},
|
|
796
|
+
tier: "read",
|
|
797
|
+
},
|
|
798
|
+
// ── Agent Lifecycle (RFC-0016) ────────────────────────────────────
|
|
799
|
+
{
|
|
800
|
+
name: "openintent_heartbeat",
|
|
801
|
+
description: "Send a heartbeat signal to indicate an agent is alive and healthy. " +
|
|
802
|
+
"Agents that miss heartbeats may be marked as unhealthy.",
|
|
803
|
+
inputSchema: {
|
|
804
|
+
type: "object",
|
|
805
|
+
properties: {
|
|
806
|
+
agent_id: { type: "string", description: "The agent sending the heartbeat" },
|
|
807
|
+
status: {
|
|
808
|
+
type: "string",
|
|
809
|
+
enum: ["healthy", "degraded", "busy"],
|
|
810
|
+
description: "Current agent status (default 'healthy')",
|
|
811
|
+
},
|
|
812
|
+
metadata: {
|
|
813
|
+
type: "object",
|
|
814
|
+
description: "Optional metadata (load, memory usage, etc.)",
|
|
815
|
+
additionalProperties: true,
|
|
816
|
+
},
|
|
817
|
+
},
|
|
818
|
+
required: ["agent_id"],
|
|
819
|
+
},
|
|
820
|
+
tier: "write",
|
|
821
|
+
},
|
|
822
|
+
{
|
|
823
|
+
name: "openintent_get_health",
|
|
824
|
+
description: "Get the health status of an agent including last heartbeat time " +
|
|
825
|
+
"and any reported issues.",
|
|
826
|
+
inputSchema: {
|
|
827
|
+
type: "object",
|
|
828
|
+
properties: {
|
|
829
|
+
agent_id: { type: "string", description: "The agent to check" },
|
|
830
|
+
},
|
|
831
|
+
required: ["agent_id"],
|
|
832
|
+
},
|
|
833
|
+
tier: "read",
|
|
834
|
+
},
|
|
835
|
+
{
|
|
836
|
+
name: "openintent_set_agent_status",
|
|
837
|
+
description: "Set the lifecycle status of an agent (e.g. active, paused, terminated). " +
|
|
838
|
+
"Used by coordinators to manage agent availability.",
|
|
839
|
+
inputSchema: {
|
|
840
|
+
type: "object",
|
|
841
|
+
properties: {
|
|
842
|
+
agent_id: { type: "string", description: "The agent to update" },
|
|
843
|
+
status: {
|
|
844
|
+
type: "string",
|
|
845
|
+
enum: ["active", "paused", "draining", "terminated"],
|
|
846
|
+
description: "New lifecycle status",
|
|
847
|
+
},
|
|
848
|
+
reason: { type: "string", description: "Optional reason for the status change" },
|
|
849
|
+
},
|
|
850
|
+
required: ["agent_id", "status"],
|
|
851
|
+
},
|
|
852
|
+
tier: "admin",
|
|
853
|
+
},
|
|
854
|
+
// ── Triggers (RFC-0017) ───────────────────────────────────────────
|
|
855
|
+
{
|
|
856
|
+
name: "openintent_create_trigger",
|
|
857
|
+
description: "Create a reactive trigger that fires an action when a condition is met. " +
|
|
858
|
+
"Triggers enable event-driven coordination patterns.",
|
|
859
|
+
inputSchema: {
|
|
860
|
+
type: "object",
|
|
861
|
+
properties: {
|
|
862
|
+
intent_id: { type: "string", description: "The intent scope for this trigger" },
|
|
863
|
+
name: { type: "string", description: "Optional trigger name" },
|
|
864
|
+
trigger_type: {
|
|
865
|
+
type: "string",
|
|
866
|
+
enum: ["event", "schedule", "state_change", "webhook"],
|
|
867
|
+
description: "Type of trigger",
|
|
868
|
+
},
|
|
869
|
+
condition: {
|
|
870
|
+
type: "object",
|
|
871
|
+
description: "Trigger condition (event pattern, cron expression, state predicate, etc.)",
|
|
872
|
+
additionalProperties: true,
|
|
873
|
+
},
|
|
874
|
+
action: {
|
|
875
|
+
type: "object",
|
|
876
|
+
description: "Action to execute when triggered (notify, invoke tool, transition status, etc.)",
|
|
877
|
+
additionalProperties: true,
|
|
878
|
+
},
|
|
879
|
+
},
|
|
880
|
+
required: ["intent_id", "trigger_type", "condition", "action"],
|
|
881
|
+
},
|
|
882
|
+
tier: "admin",
|
|
883
|
+
},
|
|
884
|
+
{
|
|
885
|
+
name: "openintent_list_triggers",
|
|
886
|
+
description: "List all triggers configured for an intent.",
|
|
887
|
+
inputSchema: {
|
|
888
|
+
type: "object",
|
|
889
|
+
properties: {
|
|
890
|
+
intent_id: { type: "string", description: "The intent to query" },
|
|
891
|
+
},
|
|
892
|
+
required: ["intent_id"],
|
|
893
|
+
},
|
|
894
|
+
tier: "read",
|
|
895
|
+
},
|
|
896
|
+
{
|
|
897
|
+
name: "openintent_delete_trigger",
|
|
898
|
+
description: "Delete a trigger from an intent.",
|
|
899
|
+
inputSchema: {
|
|
900
|
+
type: "object",
|
|
901
|
+
properties: {
|
|
902
|
+
intent_id: { type: "string", description: "The intent containing the trigger" },
|
|
903
|
+
trigger_id: { type: "string", description: "The trigger to delete" },
|
|
904
|
+
},
|
|
905
|
+
required: ["intent_id", "trigger_id"],
|
|
906
|
+
},
|
|
907
|
+
tier: "admin",
|
|
908
|
+
},
|
|
909
|
+
// ── Cryptographic Agent Identity (RFC-0018) ───────────────────────
|
|
910
|
+
{
|
|
911
|
+
name: "openintent_register_identity",
|
|
912
|
+
description: "Register a cryptographic identity for an agent using Ed25519 key pairs. " +
|
|
913
|
+
"Creates a did:key identifier for the agent.",
|
|
914
|
+
inputSchema: {
|
|
915
|
+
type: "object",
|
|
916
|
+
properties: {
|
|
917
|
+
agent_id: { type: "string", description: "The agent to register" },
|
|
918
|
+
public_key: { type: "string", description: "Base64-encoded Ed25519 public key" },
|
|
919
|
+
key_type: {
|
|
920
|
+
type: "string",
|
|
921
|
+
enum: ["ed25519"],
|
|
922
|
+
description: "Key type (default 'ed25519')",
|
|
923
|
+
},
|
|
924
|
+
},
|
|
925
|
+
required: ["agent_id", "public_key"],
|
|
926
|
+
},
|
|
927
|
+
tier: "admin",
|
|
928
|
+
},
|
|
929
|
+
{
|
|
930
|
+
name: "openintent_verify_challenge",
|
|
931
|
+
description: "Verify a challenge-response proof of identity. The agent must sign " +
|
|
932
|
+
"the challenge with its private key to prove ownership.",
|
|
933
|
+
inputSchema: {
|
|
934
|
+
type: "object",
|
|
935
|
+
properties: {
|
|
936
|
+
agent_id: { type: "string", description: "The agent being verified" },
|
|
937
|
+
challenge: { type: "string", description: "The challenge string to verify against" },
|
|
938
|
+
signature: { type: "string", description: "Base64-encoded signature of the challenge" },
|
|
939
|
+
},
|
|
940
|
+
required: ["agent_id", "challenge", "signature"],
|
|
941
|
+
},
|
|
942
|
+
tier: "admin",
|
|
943
|
+
},
|
|
944
|
+
{
|
|
945
|
+
name: "openintent_rotate_key",
|
|
946
|
+
description: "Rotate an agent's cryptographic key pair. Requires a rotation proof " +
|
|
947
|
+
"signed by the current key to authorize the change.",
|
|
948
|
+
inputSchema: {
|
|
949
|
+
type: "object",
|
|
950
|
+
properties: {
|
|
951
|
+
agent_id: { type: "string", description: "The agent whose key to rotate" },
|
|
952
|
+
new_public_key: { type: "string", description: "Base64-encoded new Ed25519 public key" },
|
|
953
|
+
rotation_proof: { type: "string", description: "Signature proving ownership of the current key" },
|
|
954
|
+
},
|
|
955
|
+
required: ["agent_id", "new_public_key", "rotation_proof"],
|
|
956
|
+
},
|
|
957
|
+
tier: "admin",
|
|
958
|
+
},
|
|
959
|
+
// ── Verifiable Event Logs (RFC-0019) ──────────────────────────────
|
|
960
|
+
{
|
|
961
|
+
name: "openintent_get_hash_chain",
|
|
962
|
+
description: "Retrieve the SHA-256 hash chain for an intent's event log. Each event " +
|
|
963
|
+
"is linked to the previous by its hash, forming a tamper-evident chain.",
|
|
964
|
+
inputSchema: {
|
|
965
|
+
type: "object",
|
|
966
|
+
properties: {
|
|
967
|
+
intent_id: { type: "string", description: "The intent to query" },
|
|
968
|
+
from_sequence: { type: "number", description: "Start sequence number (optional)" },
|
|
969
|
+
to_sequence: { type: "number", description: "End sequence number (optional)" },
|
|
970
|
+
},
|
|
971
|
+
required: ["intent_id"],
|
|
972
|
+
},
|
|
973
|
+
tier: "read",
|
|
974
|
+
},
|
|
975
|
+
{
|
|
976
|
+
name: "openintent_verify_inclusion",
|
|
977
|
+
description: "Verify that a specific event is included in the Merkle tree checkpoint. " +
|
|
978
|
+
"Returns an inclusion proof that can be independently verified.",
|
|
979
|
+
inputSchema: {
|
|
980
|
+
type: "object",
|
|
981
|
+
properties: {
|
|
982
|
+
intent_id: { type: "string", description: "The intent containing the event" },
|
|
983
|
+
event_id: { type: "string", description: "The event to verify" },
|
|
984
|
+
},
|
|
985
|
+
required: ["intent_id", "event_id"],
|
|
986
|
+
},
|
|
987
|
+
tier: "read",
|
|
988
|
+
},
|
|
989
|
+
{
|
|
990
|
+
name: "openintent_get_checkpoint",
|
|
991
|
+
description: "Retrieve a Merkle tree checkpoint for an intent's event log. " +
|
|
992
|
+
"Checkpoints provide a compact, verifiable summary of the log state.",
|
|
993
|
+
inputSchema: {
|
|
994
|
+
type: "object",
|
|
995
|
+
properties: {
|
|
996
|
+
intent_id: { type: "string", description: "The intent to query" },
|
|
997
|
+
checkpoint_id: { type: "string", description: "Specific checkpoint ID (default: latest)" },
|
|
998
|
+
},
|
|
999
|
+
required: ["intent_id"],
|
|
1000
|
+
},
|
|
1001
|
+
tier: "read",
|
|
1002
|
+
},
|
|
1003
|
+
// ── Distributed Tracing (RFC-0020) ────────────────────────────────
|
|
1004
|
+
{
|
|
1005
|
+
name: "openintent_start_trace",
|
|
1006
|
+
description: "Start a new distributed trace for tracking operations across agents. " +
|
|
1007
|
+
"Traces correlate events and tool invocations across the protocol.",
|
|
1008
|
+
inputSchema: {
|
|
1009
|
+
type: "object",
|
|
1010
|
+
properties: {
|
|
1011
|
+
intent_id: { type: "string", description: "The intent to trace within" },
|
|
1012
|
+
trace_name: { type: "string", description: "Human-readable trace name" },
|
|
1013
|
+
parent_trace_id: { type: "string", description: "Parent trace ID for nested traces" },
|
|
1014
|
+
metadata: {
|
|
1015
|
+
type: "object",
|
|
1016
|
+
description: "Optional trace metadata",
|
|
1017
|
+
additionalProperties: true,
|
|
1018
|
+
},
|
|
1019
|
+
},
|
|
1020
|
+
required: ["intent_id", "trace_name"],
|
|
1021
|
+
},
|
|
1022
|
+
tier: "write",
|
|
1023
|
+
},
|
|
1024
|
+
{
|
|
1025
|
+
name: "openintent_get_trace",
|
|
1026
|
+
description: "Retrieve a trace and its spans for analysis.",
|
|
1027
|
+
inputSchema: {
|
|
1028
|
+
type: "object",
|
|
1029
|
+
properties: {
|
|
1030
|
+
intent_id: { type: "string", description: "The intent containing the trace" },
|
|
1031
|
+
trace_id: { type: "string", description: "The trace identifier" },
|
|
1032
|
+
},
|
|
1033
|
+
required: ["intent_id", "trace_id"],
|
|
1034
|
+
},
|
|
1035
|
+
tier: "read",
|
|
1036
|
+
},
|
|
1037
|
+
{
|
|
1038
|
+
name: "openintent_link_spans",
|
|
1039
|
+
description: "Link span entries to an existing trace. Spans represent individual " +
|
|
1040
|
+
"operations within a trace and can be nested via parent_span_id.",
|
|
1041
|
+
inputSchema: {
|
|
1042
|
+
type: "object",
|
|
1043
|
+
properties: {
|
|
1044
|
+
trace_id: { type: "string", description: "The trace to add spans to" },
|
|
1045
|
+
spans: {
|
|
1046
|
+
type: "array",
|
|
1047
|
+
items: {
|
|
1048
|
+
type: "object",
|
|
1049
|
+
properties: {
|
|
1050
|
+
span_id: { type: "string" },
|
|
1051
|
+
parent_span_id: { type: "string" },
|
|
1052
|
+
operation: { type: "string" },
|
|
1053
|
+
status: { type: "string" },
|
|
1054
|
+
},
|
|
1055
|
+
required: ["span_id", "operation"],
|
|
1056
|
+
},
|
|
1057
|
+
description: "Spans to link to the trace",
|
|
1058
|
+
},
|
|
1059
|
+
},
|
|
1060
|
+
required: ["trace_id", "spans"],
|
|
1061
|
+
},
|
|
1062
|
+
tier: "write",
|
|
1063
|
+
},
|
|
1064
|
+
];
|
|
1065
|
+
/**
|
|
1066
|
+
* Route an incoming tool call to the appropriate client method.
|
|
1067
|
+
* The tool must pass both the role gate and the allowlist before execution.
|
|
1068
|
+
*/
|
|
1069
|
+
async function handleToolCall(name, args, client, config) {
|
|
1070
|
+
const permission = (0, security_js_1.isToolPermitted)(name, config);
|
|
1071
|
+
if (!permission.allowed) {
|
|
1072
|
+
return errorResult(permission.reason ?? `Tool "${name}" is not permitted.`);
|
|
1073
|
+
}
|
|
1074
|
+
try {
|
|
1075
|
+
let result;
|
|
1076
|
+
switch (name) {
|
|
1077
|
+
case "openintent_create_intent":
|
|
1078
|
+
result = await client.createIntent({
|
|
1079
|
+
title: args.title,
|
|
1080
|
+
description: args.description,
|
|
1081
|
+
constraints: args.constraints,
|
|
1082
|
+
initial_state: args.initial_state,
|
|
1083
|
+
});
|
|
1084
|
+
break;
|
|
1085
|
+
case "openintent_get_intent":
|
|
1086
|
+
result = await client.getIntent(args.intent_id);
|
|
1087
|
+
break;
|
|
1088
|
+
case "openintent_list_intents":
|
|
1089
|
+
result = await client.listIntents({
|
|
1090
|
+
status: args.status,
|
|
1091
|
+
limit: args.limit,
|
|
1092
|
+
offset: args.offset,
|
|
1093
|
+
});
|
|
1094
|
+
break;
|
|
1095
|
+
case "openintent_update_state":
|
|
1096
|
+
result = await client.updateState({
|
|
1097
|
+
intent_id: args.intent_id,
|
|
1098
|
+
version: args.version,
|
|
1099
|
+
state_patch: args.state_patch,
|
|
1100
|
+
});
|
|
1101
|
+
break;
|
|
1102
|
+
case "openintent_set_status":
|
|
1103
|
+
result = await client.setStatus({
|
|
1104
|
+
intent_id: args.intent_id,
|
|
1105
|
+
version: args.version,
|
|
1106
|
+
status: args.status,
|
|
1107
|
+
});
|
|
1108
|
+
break;
|
|
1109
|
+
case "openintent_log_event":
|
|
1110
|
+
result = await client.logEvent({
|
|
1111
|
+
intent_id: args.intent_id,
|
|
1112
|
+
event_type: args.event_type,
|
|
1113
|
+
payload: args.payload,
|
|
1114
|
+
});
|
|
1115
|
+
break;
|
|
1116
|
+
case "openintent_get_events":
|
|
1117
|
+
result = await client.getEvents({
|
|
1118
|
+
intent_id: args.intent_id,
|
|
1119
|
+
event_type: args.event_type,
|
|
1120
|
+
limit: args.limit,
|
|
1121
|
+
});
|
|
1122
|
+
break;
|
|
1123
|
+
case "openintent_acquire_lease":
|
|
1124
|
+
result = await client.acquireLease({
|
|
1125
|
+
intent_id: args.intent_id,
|
|
1126
|
+
scope: args.scope,
|
|
1127
|
+
duration_seconds: args.duration_seconds,
|
|
1128
|
+
});
|
|
1129
|
+
break;
|
|
1130
|
+
case "openintent_release_lease":
|
|
1131
|
+
result = await client.releaseLease({
|
|
1132
|
+
intent_id: args.intent_id,
|
|
1133
|
+
lease_id: args.lease_id,
|
|
1134
|
+
});
|
|
1135
|
+
break;
|
|
1136
|
+
case "openintent_assign_agent":
|
|
1137
|
+
result = await client.assignAgent({
|
|
1138
|
+
intent_id: args.intent_id,
|
|
1139
|
+
agent_id: args.agent_id,
|
|
1140
|
+
role: args.role,
|
|
1141
|
+
});
|
|
1142
|
+
break;
|
|
1143
|
+
case "openintent_unassign_agent":
|
|
1144
|
+
result = await client.unassignAgent({
|
|
1145
|
+
intent_id: args.intent_id,
|
|
1146
|
+
agent_id: args.agent_id,
|
|
1147
|
+
});
|
|
1148
|
+
break;
|
|
1149
|
+
case "openintent_create_channel":
|
|
1150
|
+
result = await client.createChannel({
|
|
1151
|
+
intent_id: args.intent_id,
|
|
1152
|
+
name: args.name,
|
|
1153
|
+
members: args.members,
|
|
1154
|
+
member_policy: args.member_policy,
|
|
1155
|
+
});
|
|
1156
|
+
break;
|
|
1157
|
+
case "openintent_send_message":
|
|
1158
|
+
result = await client.sendMessage({
|
|
1159
|
+
channel_id: args.channel_id,
|
|
1160
|
+
payload: args.payload,
|
|
1161
|
+
to: args.to,
|
|
1162
|
+
message_type: args.message_type,
|
|
1163
|
+
});
|
|
1164
|
+
break;
|
|
1165
|
+
case "openintent_ask":
|
|
1166
|
+
result = await client.askOnChannel({
|
|
1167
|
+
channel_id: args.channel_id,
|
|
1168
|
+
to: args.to,
|
|
1169
|
+
payload: args.payload,
|
|
1170
|
+
timeout: args.timeout,
|
|
1171
|
+
});
|
|
1172
|
+
break;
|
|
1173
|
+
case "openintent_broadcast":
|
|
1174
|
+
result = await client.broadcastOnChannel({
|
|
1175
|
+
channel_id: args.channel_id,
|
|
1176
|
+
payload: args.payload,
|
|
1177
|
+
});
|
|
1178
|
+
break;
|
|
1179
|
+
case "openintent_get_messages":
|
|
1180
|
+
result = await client.getChannelMessages({
|
|
1181
|
+
channel_id: args.channel_id,
|
|
1182
|
+
limit: args.limit,
|
|
1183
|
+
});
|
|
1184
|
+
break;
|
|
1185
|
+
// ── Workflows (RFC-0011) ──────────────────────────────────────
|
|
1186
|
+
case "openintent_create_workflow":
|
|
1187
|
+
result = await client.createWorkflow({
|
|
1188
|
+
name: args.name,
|
|
1189
|
+
yaml_spec: args.yaml_spec,
|
|
1190
|
+
description: args.description,
|
|
1191
|
+
});
|
|
1192
|
+
break;
|
|
1193
|
+
case "openintent_trigger_workflow":
|
|
1194
|
+
result = await client.triggerWorkflow({
|
|
1195
|
+
workflow_id: args.workflow_id,
|
|
1196
|
+
inputs: args.inputs,
|
|
1197
|
+
});
|
|
1198
|
+
break;
|
|
1199
|
+
case "openintent_get_workflow":
|
|
1200
|
+
result = await client.getWorkflow(args.workflow_id);
|
|
1201
|
+
break;
|
|
1202
|
+
case "openintent_list_workflows":
|
|
1203
|
+
result = await client.listWorkflows({
|
|
1204
|
+
limit: args.limit,
|
|
1205
|
+
offset: args.offset,
|
|
1206
|
+
});
|
|
1207
|
+
break;
|
|
1208
|
+
// ── Plans (RFC-0012) ──────────────────────────────────────────
|
|
1209
|
+
case "openintent_create_plan":
|
|
1210
|
+
result = await client.createPlan({
|
|
1211
|
+
intent_id: args.intent_id,
|
|
1212
|
+
title: args.title,
|
|
1213
|
+
steps: args.steps,
|
|
1214
|
+
});
|
|
1215
|
+
break;
|
|
1216
|
+
case "openintent_decompose_task":
|
|
1217
|
+
result = await client.decomposeTask({
|
|
1218
|
+
intent_id: args.intent_id,
|
|
1219
|
+
task_description: args.task_description,
|
|
1220
|
+
max_depth: args.max_depth,
|
|
1221
|
+
});
|
|
1222
|
+
break;
|
|
1223
|
+
case "openintent_get_plan":
|
|
1224
|
+
result = await client.getPlan({
|
|
1225
|
+
intent_id: args.intent_id,
|
|
1226
|
+
plan_id: args.plan_id,
|
|
1227
|
+
});
|
|
1228
|
+
break;
|
|
1229
|
+
// ── Governance (RFC-0013) ─────────────────────────────────────
|
|
1230
|
+
case "openintent_set_coordinator":
|
|
1231
|
+
result = await client.setCoordinator({
|
|
1232
|
+
intent_id: args.intent_id,
|
|
1233
|
+
coordinator_id: args.coordinator_id,
|
|
1234
|
+
governance_policy: args.governance_policy,
|
|
1235
|
+
});
|
|
1236
|
+
break;
|
|
1237
|
+
case "openintent_record_decision":
|
|
1238
|
+
result = await client.recordDecision({
|
|
1239
|
+
intent_id: args.intent_id,
|
|
1240
|
+
decision_type: args.decision_type,
|
|
1241
|
+
rationale: args.rationale,
|
|
1242
|
+
outcome: args.outcome,
|
|
1243
|
+
});
|
|
1244
|
+
break;
|
|
1245
|
+
case "openintent_get_arbitration":
|
|
1246
|
+
result = await client.getArbitration({
|
|
1247
|
+
intent_id: args.intent_id,
|
|
1248
|
+
});
|
|
1249
|
+
break;
|
|
1250
|
+
// ── Human Escalation (RFC-0013) ───────────────────────────────
|
|
1251
|
+
case "openintent_escalate_to_human":
|
|
1252
|
+
result = await client.escalateToHuman({
|
|
1253
|
+
intent_id: args.intent_id,
|
|
1254
|
+
reason: args.reason,
|
|
1255
|
+
priority: args.priority,
|
|
1256
|
+
context: args.context,
|
|
1257
|
+
});
|
|
1258
|
+
break;
|
|
1259
|
+
case "openintent_list_escalations":
|
|
1260
|
+
result = await client.listEscalations({
|
|
1261
|
+
intent_id: args.intent_id,
|
|
1262
|
+
status: args.status,
|
|
1263
|
+
limit: args.limit,
|
|
1264
|
+
offset: args.offset,
|
|
1265
|
+
});
|
|
1266
|
+
break;
|
|
1267
|
+
case "openintent_resolve_escalation":
|
|
1268
|
+
result = await client.resolveEscalation({
|
|
1269
|
+
escalation_id: args.escalation_id,
|
|
1270
|
+
resolution: args.resolution,
|
|
1271
|
+
decision: args.decision,
|
|
1272
|
+
});
|
|
1273
|
+
break;
|
|
1274
|
+
case "openintent_request_approval":
|
|
1275
|
+
result = await client.requestApproval({
|
|
1276
|
+
intent_id: args.intent_id,
|
|
1277
|
+
action_description: args.action_description,
|
|
1278
|
+
urgency: args.urgency,
|
|
1279
|
+
metadata: args.metadata,
|
|
1280
|
+
});
|
|
1281
|
+
break;
|
|
1282
|
+
case "openintent_get_approval_status":
|
|
1283
|
+
result = await client.getApprovalStatus({
|
|
1284
|
+
intent_id: args.intent_id,
|
|
1285
|
+
approval_id: args.approval_id,
|
|
1286
|
+
});
|
|
1287
|
+
break;
|
|
1288
|
+
// ── Portfolios (RFC-0004) ─────────────────────────────────────
|
|
1289
|
+
case "openintent_create_portfolio":
|
|
1290
|
+
result = await client.createPortfolio({
|
|
1291
|
+
name: args.name,
|
|
1292
|
+
description: args.description,
|
|
1293
|
+
});
|
|
1294
|
+
break;
|
|
1295
|
+
case "openintent_add_to_portfolio":
|
|
1296
|
+
result = await client.addToPortfolio({
|
|
1297
|
+
portfolio_id: args.portfolio_id,
|
|
1298
|
+
intent_id: args.intent_id,
|
|
1299
|
+
});
|
|
1300
|
+
break;
|
|
1301
|
+
case "openintent_get_portfolio":
|
|
1302
|
+
result = await client.getPortfolio(args.portfolio_id);
|
|
1303
|
+
break;
|
|
1304
|
+
// ── Access Control (RFC-0011) ─────────────────────────────────
|
|
1305
|
+
case "openintent_set_permissions":
|
|
1306
|
+
result = await client.setPermissions({
|
|
1307
|
+
intent_id: args.intent_id,
|
|
1308
|
+
permissions: args.permissions,
|
|
1309
|
+
version: args.version,
|
|
1310
|
+
});
|
|
1311
|
+
break;
|
|
1312
|
+
case "openintent_get_permissions":
|
|
1313
|
+
result = await client.getPermissions({
|
|
1314
|
+
intent_id: args.intent_id,
|
|
1315
|
+
});
|
|
1316
|
+
break;
|
|
1317
|
+
case "openintent_grant_access":
|
|
1318
|
+
result = await client.grantAccess({
|
|
1319
|
+
intent_id: args.intent_id,
|
|
1320
|
+
agent_id: args.agent_id,
|
|
1321
|
+
level: args.level,
|
|
1322
|
+
scopes: args.scopes,
|
|
1323
|
+
});
|
|
1324
|
+
break;
|
|
1325
|
+
// ── Credential Vaults (RFC-0014) ──────────────────────────────
|
|
1326
|
+
case "openintent_store_credential":
|
|
1327
|
+
result = await client.storeCredential({
|
|
1328
|
+
vault_id: args.vault_id,
|
|
1329
|
+
credential_name: args.credential_name,
|
|
1330
|
+
credential_type: args.credential_type,
|
|
1331
|
+
metadata: args.metadata,
|
|
1332
|
+
});
|
|
1333
|
+
break;
|
|
1334
|
+
case "openintent_get_credential":
|
|
1335
|
+
result = await client.getCredential({
|
|
1336
|
+
vault_id: args.vault_id,
|
|
1337
|
+
credential_name: args.credential_name,
|
|
1338
|
+
});
|
|
1339
|
+
break;
|
|
1340
|
+
case "openintent_grant_tool":
|
|
1341
|
+
result = await client.grantTool({
|
|
1342
|
+
intent_id: args.intent_id,
|
|
1343
|
+
agent_id: args.agent_id,
|
|
1344
|
+
tool_name: args.tool_name,
|
|
1345
|
+
constraints: args.constraints,
|
|
1346
|
+
});
|
|
1347
|
+
break;
|
|
1348
|
+
// ── Agent Memory (RFC-0015) ───────────────────────────────────
|
|
1349
|
+
case "openintent_memory_set":
|
|
1350
|
+
result = await client.memorySet({
|
|
1351
|
+
agent_id: args.agent_id,
|
|
1352
|
+
namespace: args.namespace,
|
|
1353
|
+
key: args.key,
|
|
1354
|
+
value: args.value,
|
|
1355
|
+
ttl_seconds: args.ttl_seconds,
|
|
1356
|
+
});
|
|
1357
|
+
break;
|
|
1358
|
+
case "openintent_memory_get":
|
|
1359
|
+
result = await client.memoryGet({
|
|
1360
|
+
agent_id: args.agent_id,
|
|
1361
|
+
namespace: args.namespace,
|
|
1362
|
+
key: args.key,
|
|
1363
|
+
});
|
|
1364
|
+
break;
|
|
1365
|
+
case "openintent_memory_list":
|
|
1366
|
+
result = await client.memoryList({
|
|
1367
|
+
agent_id: args.agent_id,
|
|
1368
|
+
namespace: args.namespace,
|
|
1369
|
+
});
|
|
1370
|
+
break;
|
|
1371
|
+
// ── Agent Lifecycle (RFC-0016) ────────────────────────────────
|
|
1372
|
+
case "openintent_heartbeat":
|
|
1373
|
+
result = await client.heartbeat({
|
|
1374
|
+
agent_id: args.agent_id,
|
|
1375
|
+
status: args.status,
|
|
1376
|
+
metadata: args.metadata,
|
|
1377
|
+
});
|
|
1378
|
+
break;
|
|
1379
|
+
case "openintent_get_health":
|
|
1380
|
+
result = await client.getHealth({
|
|
1381
|
+
agent_id: args.agent_id,
|
|
1382
|
+
});
|
|
1383
|
+
break;
|
|
1384
|
+
case "openintent_set_agent_status":
|
|
1385
|
+
result = await client.setAgentStatus({
|
|
1386
|
+
agent_id: args.agent_id,
|
|
1387
|
+
status: args.status,
|
|
1388
|
+
reason: args.reason,
|
|
1389
|
+
});
|
|
1390
|
+
break;
|
|
1391
|
+
// ── Triggers (RFC-0017) ───────────────────────────────────────
|
|
1392
|
+
case "openintent_create_trigger":
|
|
1393
|
+
result = await client.createTrigger({
|
|
1394
|
+
intent_id: args.intent_id,
|
|
1395
|
+
trigger_type: args.trigger_type,
|
|
1396
|
+
condition: args.condition,
|
|
1397
|
+
action: args.action,
|
|
1398
|
+
name: args.name,
|
|
1399
|
+
});
|
|
1400
|
+
break;
|
|
1401
|
+
case "openintent_list_triggers":
|
|
1402
|
+
result = await client.listTriggers({
|
|
1403
|
+
intent_id: args.intent_id,
|
|
1404
|
+
});
|
|
1405
|
+
break;
|
|
1406
|
+
case "openintent_delete_trigger":
|
|
1407
|
+
result = await client.deleteTrigger({
|
|
1408
|
+
intent_id: args.intent_id,
|
|
1409
|
+
trigger_id: args.trigger_id,
|
|
1410
|
+
});
|
|
1411
|
+
break;
|
|
1412
|
+
// ── Cryptographic Identity (RFC-0018) ─────────────────────────
|
|
1413
|
+
case "openintent_register_identity":
|
|
1414
|
+
result = await client.registerIdentity({
|
|
1415
|
+
agent_id: args.agent_id,
|
|
1416
|
+
public_key: args.public_key,
|
|
1417
|
+
key_type: args.key_type,
|
|
1418
|
+
});
|
|
1419
|
+
break;
|
|
1420
|
+
case "openintent_verify_challenge":
|
|
1421
|
+
result = await client.verifyChallenge({
|
|
1422
|
+
agent_id: args.agent_id,
|
|
1423
|
+
challenge: args.challenge,
|
|
1424
|
+
signature: args.signature,
|
|
1425
|
+
});
|
|
1426
|
+
break;
|
|
1427
|
+
case "openintent_rotate_key":
|
|
1428
|
+
result = await client.rotateKey({
|
|
1429
|
+
agent_id: args.agent_id,
|
|
1430
|
+
new_public_key: args.new_public_key,
|
|
1431
|
+
rotation_proof: args.rotation_proof,
|
|
1432
|
+
});
|
|
1433
|
+
break;
|
|
1434
|
+
// ── Verifiable Event Logs (RFC-0019) ──────────────────────────
|
|
1435
|
+
case "openintent_get_hash_chain":
|
|
1436
|
+
result = await client.getHashChain({
|
|
1437
|
+
intent_id: args.intent_id,
|
|
1438
|
+
from_sequence: args.from_sequence,
|
|
1439
|
+
to_sequence: args.to_sequence,
|
|
1440
|
+
});
|
|
1441
|
+
break;
|
|
1442
|
+
case "openintent_verify_inclusion":
|
|
1443
|
+
result = await client.verifyInclusion({
|
|
1444
|
+
intent_id: args.intent_id,
|
|
1445
|
+
event_id: args.event_id,
|
|
1446
|
+
});
|
|
1447
|
+
break;
|
|
1448
|
+
case "openintent_get_checkpoint":
|
|
1449
|
+
result = await client.getCheckpoint({
|
|
1450
|
+
intent_id: args.intent_id,
|
|
1451
|
+
checkpoint_id: args.checkpoint_id,
|
|
1452
|
+
});
|
|
1453
|
+
break;
|
|
1454
|
+
// ── Distributed Tracing (RFC-0020) ────────────────────────────
|
|
1455
|
+
case "openintent_start_trace":
|
|
1456
|
+
result = await client.startTrace({
|
|
1457
|
+
intent_id: args.intent_id,
|
|
1458
|
+
trace_name: args.trace_name,
|
|
1459
|
+
parent_trace_id: args.parent_trace_id,
|
|
1460
|
+
metadata: args.metadata,
|
|
1461
|
+
});
|
|
1462
|
+
break;
|
|
1463
|
+
case "openintent_get_trace":
|
|
1464
|
+
result = await client.getTrace({
|
|
1465
|
+
intent_id: args.intent_id,
|
|
1466
|
+
trace_id: args.trace_id,
|
|
1467
|
+
});
|
|
1468
|
+
break;
|
|
1469
|
+
case "openintent_link_spans":
|
|
1470
|
+
result = await client.linkSpans({
|
|
1471
|
+
trace_id: args.trace_id,
|
|
1472
|
+
spans: args.spans,
|
|
1473
|
+
});
|
|
1474
|
+
break;
|
|
1475
|
+
default:
|
|
1476
|
+
return errorResult(`Unknown tool: ${name}`);
|
|
1477
|
+
}
|
|
1478
|
+
return textResult(result);
|
|
1479
|
+
}
|
|
1480
|
+
catch (err) {
|
|
1481
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
1482
|
+
return errorResult(message);
|
|
1483
|
+
}
|
|
1484
|
+
}
|
|
1485
|
+
//# sourceMappingURL=tools.js.map
|