@brightbeamai/chap-coordinator-mcp 0.2.9

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.
@@ -0,0 +1,629 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/schemas.ts
21
+ var schemas_exports = {};
22
+ __export(schemas_exports, {
23
+ SCHEMAS: () => SCHEMAS,
24
+ TOOL_NAMES: () => TOOL_NAMES,
25
+ coerceToolArgs: () => coerceToolArgs,
26
+ methodForTool: () => methodForTool,
27
+ schemaFor: () => schemaFor
28
+ });
29
+ module.exports = __toCommonJS(schemas_exports);
30
+ var PARTICIPANT_URI = {
31
+ type: "string",
32
+ description: "Participant URI, e.g. 'human:alice@example.org' or 'agent:bot@local'."
33
+ };
34
+ var WORKSPACE_ID = {
35
+ type: "string",
36
+ description: "Workspace identifier, e.g. 'wsp_techcorp_support'."
37
+ };
38
+ var TASK_ID = {
39
+ type: "string",
40
+ description: "Task identifier returned by chap.task.create."
41
+ };
42
+ var ROUTING_HINTS = {
43
+ type: "object",
44
+ description: "Optional signals for the routing/1.0 profile.",
45
+ properties: {
46
+ criticality: { type: "string", enum: ["low", "medium", "high", "critical"] },
47
+ deadline: { type: "string", description: "ISO 8601 timestamp." },
48
+ risk_tier: { type: "string" },
49
+ max_cost_usd: { type: "number" }
50
+ },
51
+ additionalProperties: true
52
+ };
53
+ var SCHEMAS = {
54
+ "chap.workspace.create": {
55
+ type: "object",
56
+ properties: {
57
+ workspace: { ...WORKSPACE_ID, description: "Workspace id to create. If omitted, one is generated." },
58
+ profiles: {
59
+ type: "array",
60
+ items: { type: "string" },
61
+ description: "Profile identifiers to enable, e.g. ['core/1.0', 'review/1.0']."
62
+ },
63
+ mode: { type: "string", enum: ["shadow", "trial", "production"], default: "trial" },
64
+ mode_ceiling: { type: "string", enum: ["shadow", "trial", "production"], default: "production" }
65
+ },
66
+ additionalProperties: false
67
+ },
68
+ "chap.workspace.describe": {
69
+ type: "object",
70
+ properties: { workspace: WORKSPACE_ID },
71
+ required: ["workspace"]
72
+ },
73
+ "chap.workspace.set_profiles": {
74
+ type: "object",
75
+ properties: {
76
+ workspace: WORKSPACE_ID,
77
+ profiles: { type: "array", items: { type: "string" } }
78
+ },
79
+ required: ["workspace", "profiles"]
80
+ },
81
+ "chap.participant.join": {
82
+ type: "object",
83
+ properties: {
84
+ workspace: WORKSPACE_ID,
85
+ from: PARTICIPANT_URI,
86
+ type: { type: "string", enum: ["human", "agent", "service", "group", "workspace"] },
87
+ role: { type: "string", description: "Operator-defined role, e.g. 'reviewer' or 'drafter'." },
88
+ display_name: { type: "string" }
89
+ },
90
+ required: ["workspace", "from", "type"]
91
+ },
92
+ "chap.participant.leave": {
93
+ type: "object",
94
+ properties: { workspace: WORKSPACE_ID, from: PARTICIPANT_URI },
95
+ required: ["workspace", "from"]
96
+ },
97
+ "chap.task.create": {
98
+ type: "object",
99
+ properties: {
100
+ workspace: WORKSPACE_ID,
101
+ from: { ...PARTICIPANT_URI, description: "Delegator URI." },
102
+ kind: { type: "string", description: "Task kind, e.g. 'draft_response' or 'review'." },
103
+ assignee: { ...PARTICIPANT_URI, description: "Who the task is assigned to. Must be a workspace member." },
104
+ input: { type: "object", description: "Task-specific input payload.", additionalProperties: true },
105
+ routing_hints: ROUTING_HINTS,
106
+ mode: { type: "string", enum: ["shadow", "trial", "production"] }
107
+ },
108
+ required: ["workspace", "from", "kind", "assignee", "input"]
109
+ },
110
+ "chap.task.update": {
111
+ type: "object",
112
+ properties: {
113
+ workspace: WORKSPACE_ID,
114
+ from: PARTICIPANT_URI,
115
+ task_id: TASK_ID,
116
+ state: { type: "string", enum: ["in_progress", "review_requested", "declined", "paused", "cancelled", "completed"] },
117
+ progress_note: { type: "string" }
118
+ },
119
+ required: ["workspace", "from", "task_id", "state"]
120
+ },
121
+ "chap.task.complete": {
122
+ type: "object",
123
+ properties: {
124
+ workspace: WORKSPACE_ID,
125
+ from: PARTICIPANT_URI,
126
+ task_id: TASK_ID,
127
+ output: { description: "The task's output artefact. Pass as a JSON object or array, not a JSON-encoded string." },
128
+ confidence: { type: "number", description: "Self-reported confidence (0-1), where supported." },
129
+ routing_hints: ROUTING_HINTS
130
+ },
131
+ required: ["workspace", "from", "task_id"]
132
+ },
133
+ "chap.audit.read": {
134
+ type: "object",
135
+ properties: {
136
+ workspace: WORKSPACE_ID,
137
+ range: {
138
+ type: "object",
139
+ properties: {
140
+ from_seq: { type: "integer", description: "Start sequence number (inclusive)." },
141
+ to_seq: { type: "integer", description: "End sequence number (exclusive)." }
142
+ }
143
+ },
144
+ filter: {
145
+ type: "object",
146
+ properties: {
147
+ method: { type: "string" },
148
+ from: { type: "string" },
149
+ task_id: { type: "string" }
150
+ }
151
+ }
152
+ },
153
+ required: ["workspace"]
154
+ },
155
+ // ============================================================
156
+ // review/1.0
157
+ // ============================================================
158
+ "chap.review.request": {
159
+ type: "object",
160
+ properties: {
161
+ workspace: WORKSPACE_ID,
162
+ from: PARTICIPANT_URI,
163
+ task_id: TASK_ID,
164
+ to: {
165
+ oneOf: [PARTICIPANT_URI, { type: "array", items: PARTICIPANT_URI }],
166
+ description: "One or more reviewers. A single URI string, or a JSON array of URI strings (not a JSON-encoded string)."
167
+ },
168
+ rule: {
169
+ type: "string",
170
+ enum: ["any_one_approves", "all_approve", "quorum:2", "quorum:3"],
171
+ default: "any_one_approves"
172
+ },
173
+ artefact: { description: "The draft being submitted for review. Pass as a JSON object or array, not a JSON-encoded string." },
174
+ deadline: { type: "string" }
175
+ },
176
+ required: ["workspace", "from", "task_id", "to", "artefact"]
177
+ },
178
+ "chap.decide.approve": {
179
+ type: "object",
180
+ properties: {
181
+ workspace: WORKSPACE_ID,
182
+ from: PARTICIPANT_URI,
183
+ task_id: TASK_ID,
184
+ comment: { type: "string" },
185
+ tags: { type: "array", items: { type: "string" } }
186
+ },
187
+ required: ["workspace", "from", "task_id"]
188
+ },
189
+ "chap.decide.reject": {
190
+ type: "object",
191
+ properties: {
192
+ workspace: WORKSPACE_ID,
193
+ from: PARTICIPANT_URI,
194
+ task_id: TASK_ID,
195
+ comment: { type: "string" },
196
+ tags: { type: "array", items: { type: "string" } },
197
+ request_revision: { type: "boolean", description: "If true, task returns to in_progress instead of declined." }
198
+ },
199
+ required: ["workspace", "from", "task_id"]
200
+ },
201
+ "chap.decide.override": {
202
+ type: "object",
203
+ properties: {
204
+ workspace: WORKSPACE_ID,
205
+ from: PARTICIPANT_URI,
206
+ task_id: TASK_ID,
207
+ diff: {
208
+ type: "array",
209
+ description: "RFC 6902 JSON Patch operations applied to the artefact under review.",
210
+ items: {
211
+ type: "object",
212
+ properties: {
213
+ op: { type: "string", enum: ["add", "replace", "remove", "copy", "move", "test"] },
214
+ path: { type: "string" },
215
+ value: {},
216
+ from: { type: "string" }
217
+ },
218
+ required: ["op", "path"]
219
+ }
220
+ },
221
+ rationale: { type: "string", description: "Why the override was applied. Required for the structured-override audit trail." },
222
+ tags: { type: "array", items: { type: "string" } },
223
+ policy_refs: { type: "array", items: { type: "string" } },
224
+ logical_id: { type: "string" },
225
+ intent_preserved: { type: "boolean" }
226
+ },
227
+ required: ["workspace", "from", "task_id", "diff", "rationale"]
228
+ },
229
+ "chap.abstain.declare": {
230
+ type: "object",
231
+ properties: {
232
+ workspace: WORKSPACE_ID,
233
+ from: PARTICIPANT_URI,
234
+ task_id: TASK_ID,
235
+ reason: { type: "string" },
236
+ category: { type: "string", enum: ["conflict_of_interest", "insufficient_context", "out_of_scope", "other"] }
237
+ },
238
+ required: ["workspace", "from", "task_id", "reason"]
239
+ },
240
+ "chap.escalate.raise": {
241
+ type: "object",
242
+ properties: {
243
+ workspace: WORKSPACE_ID,
244
+ from: PARTICIPANT_URI,
245
+ original_task_id: TASK_ID,
246
+ new_task: {
247
+ type: "object",
248
+ properties: {
249
+ kind: { type: "string" },
250
+ assignee: PARTICIPANT_URI,
251
+ input: { type: "object", additionalProperties: true }
252
+ },
253
+ required: ["assignee"]
254
+ }
255
+ },
256
+ required: ["workspace", "from", "original_task_id", "new_task"]
257
+ },
258
+ // ============================================================
259
+ // whisper/1.0
260
+ // ============================================================
261
+ "chap.whisper.ask": {
262
+ type: "object",
263
+ properties: {
264
+ workspace: WORKSPACE_ID,
265
+ from: PARTICIPANT_URI,
266
+ task_id: TASK_ID,
267
+ to: { type: "array", items: PARTICIPANT_URI, description: "Who is being asked." },
268
+ question: { type: "string" },
269
+ options: {
270
+ type: "array",
271
+ items: { type: "object", properties: { id: { type: "string" }, label: { type: "string" } }, required: ["id"] },
272
+ description: "Optional multiple-choice options. If present, answer_option must be one of these ids."
273
+ },
274
+ deadline_ms: { type: "integer", description: "Time-to-live in milliseconds from now." },
275
+ default_if_lapsed: { description: "Value applied if the whisper lapses without an answer." },
276
+ urgency: { type: "string", enum: ["low", "medium", "high"], default: "low" }
277
+ },
278
+ required: ["workspace", "from", "task_id", "to", "question", "deadline_ms", "default_if_lapsed"]
279
+ },
280
+ "chap.whisper.answer": {
281
+ type: "object",
282
+ properties: {
283
+ workspace: WORKSPACE_ID,
284
+ from: PARTICIPANT_URI,
285
+ whisper_id: { type: "string" },
286
+ answer_option: { type: "string", description: "Option id (required when the whisper has options)." },
287
+ answer: { type: "string", description: "Free-text answer (when no options)." },
288
+ comment: { type: "string" }
289
+ },
290
+ required: ["workspace", "from", "whisper_id"]
291
+ },
292
+ // ============================================================
293
+ // deliberation/1.0
294
+ // ============================================================
295
+ "chap.deliberate.open": {
296
+ type: "object",
297
+ properties: {
298
+ workspace: WORKSPACE_ID,
299
+ from: PARTICIPANT_URI,
300
+ to: { type: "array", items: PARTICIPANT_URI, description: "Deliberation participants." },
301
+ task_id: TASK_ID,
302
+ rule: {
303
+ type: "string",
304
+ description: "Voting rule. Examples: any_one_approves, all_approve, quorum:N, weighted_vote:T, weighted_vote_with_veto:T."
305
+ },
306
+ question: { type: "string" },
307
+ weights: { type: "object", additionalProperties: { type: "number" }, description: "Voter -> weight map (for weighted rules)." },
308
+ veto: { type: "object", additionalProperties: { type: "boolean" }, description: "Voter -> can-veto map." },
309
+ deadline: { type: "string" }
310
+ },
311
+ required: ["workspace", "from", "to", "rule"]
312
+ },
313
+ "chap.deliberate.comment": {
314
+ type: "object",
315
+ properties: {
316
+ workspace: WORKSPACE_ID,
317
+ from: PARTICIPANT_URI,
318
+ deliberation_id: { type: "string" },
319
+ comment: { type: "string" }
320
+ },
321
+ required: ["workspace", "from", "deliberation_id", "comment"]
322
+ },
323
+ "chap.deliberate.vote": {
324
+ type: "object",
325
+ properties: {
326
+ workspace: WORKSPACE_ID,
327
+ from: PARTICIPANT_URI,
328
+ deliberation_id: { type: "string" },
329
+ vote: { type: "string", enum: ["yea", "nay", "abstain"] },
330
+ weight: { type: "number" },
331
+ comment: { type: "string" },
332
+ veto_invoked: { type: "boolean" }
333
+ },
334
+ required: ["workspace", "from", "deliberation_id", "vote"]
335
+ },
336
+ "chap.deliberate.close": {
337
+ type: "object",
338
+ properties: {
339
+ workspace: WORKSPACE_ID,
340
+ from: PARTICIPANT_URI,
341
+ deliberation_id: { type: "string" }
342
+ },
343
+ required: ["workspace", "from", "deliberation_id"]
344
+ },
345
+ // ============================================================
346
+ // handoff/1.0
347
+ // ============================================================
348
+ "chap.handoff.propose": {
349
+ type: "object",
350
+ properties: {
351
+ workspace: WORKSPACE_ID,
352
+ from: PARTICIPANT_URI,
353
+ to: { type: "string", description: "Recipient (URI or 'group:...')." },
354
+ tasks: {
355
+ type: "array",
356
+ items: {
357
+ type: "object",
358
+ properties: {
359
+ task_id: TASK_ID,
360
+ title: { type: "string" },
361
+ status_summary: { type: "string" },
362
+ next_action: { type: "string" },
363
+ blockers: { type: "array", items: { type: "string" } }
364
+ },
365
+ required: ["task_id"]
366
+ }
367
+ },
368
+ summary: { type: "string" },
369
+ context_links: { type: "array", items: { type: "string" } }
370
+ },
371
+ required: ["workspace", "from", "to", "tasks"]
372
+ },
373
+ "chap.handoff.accept": {
374
+ type: "object",
375
+ properties: {
376
+ workspace: WORKSPACE_ID,
377
+ from: PARTICIPANT_URI,
378
+ handoff_id: { type: "string" },
379
+ accepted_task_ids: { type: "array", items: TASK_ID, description: "If omitted, all proposed tasks are accepted." },
380
+ comment: { type: "string" }
381
+ },
382
+ required: ["workspace", "from", "handoff_id"]
383
+ },
384
+ "chap.handoff.decline": {
385
+ type: "object",
386
+ properties: {
387
+ workspace: WORKSPACE_ID,
388
+ from: PARTICIPANT_URI,
389
+ handoff_id: { type: "string" },
390
+ reason: { type: "string" },
391
+ suggested_target: PARTICIPANT_URI
392
+ },
393
+ required: ["workspace", "from", "handoff_id"]
394
+ },
395
+ // ============================================================
396
+ // control/1.0
397
+ // ============================================================
398
+ "chap.control.pause": {
399
+ type: "object",
400
+ properties: {
401
+ workspace: WORKSPACE_ID,
402
+ from: PARTICIPANT_URI,
403
+ scope: { type: "string", enum: ["task", "participant", "workspace"], default: "task" },
404
+ task_id: TASK_ID,
405
+ participant_uri: PARTICIPANT_URI,
406
+ in_flight_policy: { type: "string", enum: ["allow_to_complete", "interrupt"] },
407
+ reason: { type: "string" }
408
+ },
409
+ required: ["workspace", "from"]
410
+ },
411
+ "chap.control.resume": {
412
+ type: "object",
413
+ properties: {
414
+ workspace: WORKSPACE_ID,
415
+ from: PARTICIPANT_URI,
416
+ scope: { type: "string", enum: ["task", "participant", "workspace"], default: "task" },
417
+ task_id: TASK_ID,
418
+ participant_uri: PARTICIPANT_URI
419
+ },
420
+ required: ["workspace", "from"]
421
+ },
422
+ "chap.control.cancel": {
423
+ type: "object",
424
+ properties: {
425
+ workspace: WORKSPACE_ID,
426
+ from: PARTICIPANT_URI,
427
+ task_id: TASK_ID,
428
+ reason: { type: "string" }
429
+ },
430
+ required: ["workspace", "from", "task_id"]
431
+ },
432
+ "chap.control.snapshot": {
433
+ type: "object",
434
+ properties: {
435
+ workspace: WORKSPACE_ID,
436
+ from: PARTICIPANT_URI,
437
+ label: { type: "string" },
438
+ include: { type: "array", items: { type: "string" }, description: "Aspects to snapshot, e.g. ['members', 'open_tasks', 'mode_ceiling']." }
439
+ },
440
+ required: ["workspace", "from"]
441
+ },
442
+ "chap.control.rollback": {
443
+ type: "object",
444
+ properties: {
445
+ workspace: WORKSPACE_ID,
446
+ from: PARTICIPANT_URI,
447
+ to_snapshot_artefact_id: { type: "string" },
448
+ what_to_restore: { type: "array", items: { type: "string" } },
449
+ reason: { type: "string" }
450
+ },
451
+ required: ["workspace", "from", "to_snapshot_artefact_id"]
452
+ },
453
+ "chap.control.supersede": {
454
+ type: "object",
455
+ properties: {
456
+ workspace: WORKSPACE_ID,
457
+ from: PARTICIPANT_URI,
458
+ task_id: TASK_ID,
459
+ successor_task: {
460
+ type: "object",
461
+ properties: {
462
+ kind: { type: "string" },
463
+ assignee: PARTICIPANT_URI,
464
+ input: { type: "object", additionalProperties: true }
465
+ },
466
+ required: ["kind"]
467
+ },
468
+ reason: { type: "string" }
469
+ },
470
+ required: ["workspace", "from", "task_id", "successor_task"]
471
+ },
472
+ "chap.control.set_mode_ceiling": {
473
+ type: "object",
474
+ properties: {
475
+ workspace: WORKSPACE_ID,
476
+ from: PARTICIPANT_URI,
477
+ new_ceiling: { type: "string", enum: ["shadow", "trial", "production"] },
478
+ reason: { type: "string" }
479
+ },
480
+ required: ["workspace", "from", "new_ceiling"]
481
+ },
482
+ // ============================================================
483
+ // routing/1.0
484
+ // ============================================================
485
+ "chap.task.route": {
486
+ type: "object",
487
+ properties: {
488
+ workspace: WORKSPACE_ID,
489
+ from: PARTICIPANT_URI,
490
+ task_id: TASK_ID,
491
+ candidates: { type: "array", items: PARTICIPANT_URI, description: "Candidate assignees." }
492
+ },
493
+ required: ["workspace", "from", "task_id", "candidates"]
494
+ },
495
+ "chap.review.depth": {
496
+ type: "object",
497
+ properties: {
498
+ workspace: WORKSPACE_ID,
499
+ from: PARTICIPANT_URI,
500
+ task_id: TASK_ID,
501
+ artefact_routing_hints: {
502
+ type: "object",
503
+ description: "Per-artefact signals like confidence, model_id, cost_consumed_usd.",
504
+ additionalProperties: true
505
+ }
506
+ },
507
+ required: ["workspace", "from", "task_id"]
508
+ },
509
+ "chap.escalate.auto": {
510
+ type: "object",
511
+ properties: {
512
+ workspace: WORKSPACE_ID,
513
+ from: PARTICIPANT_URI,
514
+ task_id: TASK_ID,
515
+ default_escalation_target: PARTICIPANT_URI
516
+ },
517
+ required: ["workspace", "from", "task_id"]
518
+ },
519
+ // ============================================================
520
+ // security-signed/1.0
521
+ // ============================================================
522
+ "chap.participant.rotate_key": {
523
+ type: "object",
524
+ properties: {
525
+ workspace: WORKSPACE_ID,
526
+ from: PARTICIPANT_URI,
527
+ old_kid: { type: "string" },
528
+ new_jwk: { type: "object", additionalProperties: true }
529
+ },
530
+ required: ["workspace", "from", "old_kid", "new_jwk"]
531
+ },
532
+ "chap.participant.revoke_key": {
533
+ type: "object",
534
+ properties: {
535
+ workspace: WORKSPACE_ID,
536
+ from: PARTICIPANT_URI,
537
+ target_uri: PARTICIPANT_URI,
538
+ kid: { type: "string" },
539
+ reason: { type: "string" }
540
+ },
541
+ required: ["workspace", "from", "target_uri", "kid"]
542
+ },
543
+ // ============================================================
544
+ // audit-scitt/1.0
545
+ // ============================================================
546
+ "chap.audit.submit_to_scitt": {
547
+ type: "object",
548
+ properties: {
549
+ workspace: WORKSPACE_ID,
550
+ from: PARTICIPANT_URI,
551
+ range: {
552
+ type: "object",
553
+ properties: {
554
+ from_seq: { type: "integer" },
555
+ to_seq: { type: "integer" }
556
+ }
557
+ },
558
+ issuer: { type: "string" }
559
+ },
560
+ required: ["workspace"]
561
+ },
562
+ "chap.audit.verify_receipt": {
563
+ type: "object",
564
+ properties: {
565
+ workspace: WORKSPACE_ID,
566
+ from: PARTICIPANT_URI,
567
+ receipt: { type: "object", additionalProperties: true }
568
+ },
569
+ required: ["workspace", "receipt"]
570
+ },
571
+ "chap.audit.verify_chain": {
572
+ type: "object",
573
+ properties: { workspace: WORKSPACE_ID, from: PARTICIPANT_URI },
574
+ required: ["workspace"]
575
+ }
576
+ };
577
+ var TOOL_NAMES = Object.keys(SCHEMAS);
578
+ function schemaFor(toolName) {
579
+ return SCHEMAS[toolName] ?? null;
580
+ }
581
+ function methodForTool(toolName) {
582
+ if (!toolName.startsWith("chap.")) return null;
583
+ return toolName.slice("chap.".length);
584
+ }
585
+ function admitsType(schema, t) {
586
+ if (!schema) return false;
587
+ if (schema.type === t) return true;
588
+ if (schema.oneOf) return schema.oneOf.some((s) => admitsType(s, t));
589
+ if (schema.type === void 0 && !schema.oneOf && !schema.enum) return true;
590
+ return false;
591
+ }
592
+ function coerceValue(value, schema) {
593
+ if (typeof value !== "string") return value;
594
+ const trimmed = value.trim();
595
+ if (trimmed.length === 0) return value;
596
+ const looksLikeObject = trimmed.startsWith("{");
597
+ const looksLikeArray = trimmed.startsWith("[");
598
+ if (!looksLikeObject && !looksLikeArray) return value;
599
+ const wantObject = looksLikeObject && admitsType(schema, "object");
600
+ const wantArray = looksLikeArray && admitsType(schema, "array");
601
+ if (!wantObject && !wantArray) return value;
602
+ try {
603
+ const parsed = JSON.parse(value);
604
+ if (Array.isArray(parsed) && admitsType(schema, "array")) return parsed;
605
+ if (parsed !== null && typeof parsed === "object" && !Array.isArray(parsed) && admitsType(schema, "object")) return parsed;
606
+ return value;
607
+ } catch {
608
+ return value;
609
+ }
610
+ }
611
+ function coerceToolArgs(toolName, args) {
612
+ const schema = schemaFor(toolName);
613
+ const props = schema?.properties;
614
+ if (!props) return args;
615
+ const out = {};
616
+ for (const [key, value] of Object.entries(args)) {
617
+ out[key] = coerceValue(value, props[key]);
618
+ }
619
+ return out;
620
+ }
621
+ // Annotate the CommonJS export names for ESM import in node:
622
+ 0 && (module.exports = {
623
+ SCHEMAS,
624
+ TOOL_NAMES,
625
+ coerceToolArgs,
626
+ methodForTool,
627
+ schemaFor
628
+ });
629
+ //# sourceMappingURL=schemas.cjs.map