melchizedek-agents 1.0.3 → 1.1.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.
Files changed (122) hide show
  1. package/.env.example +19 -2
  2. package/CHANGELOG.md +292 -0
  3. package/DOCUMENTATION.md +99 -39
  4. package/README.md +1 -0
  5. package/config/agents/README.md +2 -2
  6. package/config/agents/examples/ares.yaml +6 -10
  7. package/config/agents/examples/assistant.yaml +6 -6
  8. package/config/agents/examples/augustin.yaml +9 -15
  9. package/config/agents/examples/cartographers.yaml +6 -6
  10. package/config/agents/examples/council.yaml +6 -6
  11. package/config/agents/examples/critic.yaml +16 -16
  12. package/config/agents/examples/harness.yaml +4 -4
  13. package/config/agents/examples/image_production.yaml +33 -32
  14. package/config/agents/examples/librarian.yaml +4 -4
  15. package/config/agents/examples/patient_advocate.yaml +6 -10
  16. package/config/agents/examples/pipeline.yaml +20 -19
  17. package/config/agents/examples/research.yaml +36 -43
  18. package/config/agents/examples/scribe.yaml +31 -32
  19. package/config/agents/examples/scriptorium.yaml +6 -6
  20. package/config/agents/examples/structured_critic.yaml +82 -0
  21. package/config/agents/examples/style_council.yaml +9 -11
  22. package/config/agents/examples/syndicate.yaml +3 -5
  23. package/config/agents/examples/tutor.yaml +2 -2
  24. package/config/agents/examples/weather.yaml +2 -2
  25. package/config/agents/syndicate.schema.json +797 -9
  26. package/config/agents/syndicateSchema.yaml +109 -72
  27. package/config/agents/templates/README.md +1 -1
  28. package/config/agents/templates/account_memory.yaml +4 -4
  29. package/config/agents/templates/case_desk.yaml +6 -6
  30. package/config/agents/templates/conversational.yaml +2 -2
  31. package/config/agents/templates/draft_review.yaml +6 -6
  32. package/config/agents/templates/intake_extractor.yaml +61 -60
  33. package/config/agents/templates/research_brief.yaml +6 -6
  34. package/config/agents/templates/research_desk.yaml +6 -6
  35. package/config/agents/templates/review_panel.yaml +8 -8
  36. package/config/agents/templates/support_triage.yaml +30 -29
  37. package/config/agents/templates/systems_operator.yaml +21 -5
  38. package/db/migrations/0014_durable_runs.sql +31 -0
  39. package/dist/lib/a2a/app.d.ts +15 -0
  40. package/dist/lib/a2a/app.js +53 -5
  41. package/dist/lib/a2a/executor.d.ts +7 -1
  42. package/dist/lib/a2a/executor.js +34 -4
  43. package/dist/lib/a2a/oauthSetup.d.ts +90 -0
  44. package/dist/lib/a2a/oauthSetup.js +205 -0
  45. package/dist/lib/agentDialect.d.ts +66 -0
  46. package/dist/lib/agentDialect.js +134 -0
  47. package/dist/lib/compile.d.ts +10 -5
  48. package/dist/lib/compile.js +69 -37
  49. package/dist/lib/compileNative.js +2 -0
  50. package/dist/lib/dispatch.d.ts +10 -5
  51. package/dist/lib/dispatch.js +10 -5
  52. package/dist/lib/doctor.d.ts +34 -1
  53. package/dist/lib/doctor.js +47 -3
  54. package/dist/lib/loadSyndicate.d.ts +45 -2
  55. package/dist/lib/loadSyndicate.js +22 -2
  56. package/dist/lib/memory/namespace.d.ts +6 -5
  57. package/dist/lib/memory/namespace.js +6 -5
  58. package/dist/lib/memory/providers.js +3 -4
  59. package/dist/lib/models/capabilities.d.ts +16 -1
  60. package/dist/lib/models/capabilities.js +55 -1
  61. package/dist/lib/observability/tracer.d.ts +8 -1
  62. package/dist/lib/observability/tracer.js +33 -5
  63. package/dist/lib/runtime/approvals.d.ts +6 -0
  64. package/dist/lib/runtime/native/agentLoop.d.ts +18 -1
  65. package/dist/lib/runtime/native/agentLoop.js +105 -11
  66. package/dist/lib/runtime/native/checkpoint.d.ts +164 -0
  67. package/dist/lib/runtime/native/checkpoint.js +365 -0
  68. package/dist/lib/runtime/native/delegate.d.ts +141 -18
  69. package/dist/lib/runtime/native/delegate.js +235 -39
  70. package/dist/lib/runtime/native/interrupts.d.ts +101 -2
  71. package/dist/lib/runtime/native/interrupts.js +201 -1
  72. package/dist/lib/runtime/native/request.d.ts +13 -3
  73. package/dist/lib/runtime/native/request.js +28 -4
  74. package/dist/lib/runtime/native/telemetry.js +10 -15
  75. package/dist/lib/runtime/questions.d.ts +7 -4
  76. package/dist/lib/runtime/sessions.d.ts +1 -1
  77. package/dist/lib/runtime/syndicateTurn.d.ts +7 -1
  78. package/dist/lib/runtime/syndicateTurn.js +74 -22
  79. package/dist/lib/runtime/turnControl.d.ts +15 -0
  80. package/dist/lib/runtime/turnControl.js +10 -0
  81. package/dist/lib/storage/postgres/index.d.ts +6 -1
  82. package/dist/lib/storage/postgres/index.js +7 -2
  83. package/dist/lib/storage/postgres/taskQueue.d.ts +14 -2
  84. package/dist/lib/storage/postgres/taskQueue.js +20 -3
  85. package/dist/lib/storage/postgres/taskStore.d.ts +26 -2
  86. package/dist/lib/storage/postgres/taskStore.js +74 -8
  87. package/dist/lib/syndicateSchema.d.ts +278 -0
  88. package/dist/lib/syndicateSchema.js +182 -15
  89. package/dist/lib/tools/auth.d.ts +7 -5
  90. package/dist/lib/tools/auth.js +12 -4
  91. package/dist/lib/tools/credentialEnv.d.ts +28 -0
  92. package/dist/lib/tools/credentialEnv.js +52 -0
  93. package/dist/lib/tools/credentialStore.js +9 -2
  94. package/dist/lib/tools/mcpToolFactory.d.ts +25 -2
  95. package/dist/lib/tools/mcpToolFactory.js +179 -21
  96. package/dist/lib/tools/oauthHosts.d.ts +71 -0
  97. package/dist/lib/tools/oauthHosts.js +154 -0
  98. package/dist/lib/tools/oauthTools.d.ts +233 -0
  99. package/dist/lib/tools/oauthTools.js +421 -0
  100. package/dist/lib/tools/openapiTools.d.ts +4 -6
  101. package/dist/lib/tools/openapiTools.js +40 -36
  102. package/dist/lib/tools/taskTools.d.ts +30 -5
  103. package/dist/lib/tools/taskTools.js +74 -10
  104. package/dist/lib/workflow.d.ts +8 -4
  105. package/dist/lib/workflow.js +8 -4
  106. package/dist/lib/workflowConfig.d.ts +6 -0
  107. package/dist/scripts/a2a_server.d.ts +36 -0
  108. package/dist/scripts/a2a_server.js +122 -1
  109. package/dist/scripts/assistant_worker.d.ts +10 -0
  110. package/dist/scripts/assistant_worker.js +69 -19
  111. package/dist/scripts/doctor.d.ts +4 -1
  112. package/dist/scripts/doctor.js +5 -2
  113. package/dist/scripts/yaml_codemod.d.ts +52 -0
  114. package/dist/scripts/yaml_codemod.js +570 -0
  115. package/package.json +5 -2
  116. package/skills/briefs/melchizedek-author.md +7 -5
  117. package/skills/briefs/melchizedek-models.md +4 -3
  118. package/skills/briefs/melchizedek.md +1 -0
  119. package/skills/melchizedek/SKILL.md +1 -0
  120. package/skills/melchizedek-author/SKILL.md +7 -4
  121. package/skills/melchizedek-author/assets/minimal.yaml +13 -13
  122. package/skills/melchizedek-models/SKILL.md +6 -3
@@ -47,7 +47,7 @@
47
47
  }
48
48
  },
49
49
  "require_approval": {
50
- "description": "Tools from this agent's `tools` that run only after a person approves the exact call (ADR 0028): the A2A task ends input-required until the caller answers approve or reject. Allowed on the orchestrator and on plan-dispatch routes.",
50
+ "description": "Tools from this agent's `tools` that run only after a person approves the exact call (ADR 0028): the A2A task ends input-required until the caller answers approve or reject. Allowed on any agent but one a workflow map node runs; inside a delegated subagent the pause reaches the caller through its open call (ADR 0110).",
51
51
  "type": "array",
52
52
  "items": {
53
53
  "type": "string",
@@ -156,7 +156,8 @@
156
156
  }
157
157
  },
158
158
  "additionalProperties": {},
159
- "description": "Model generation config (@google/genai GenerateContentConfig). Do not set tools here."
159
+ "description": "Deprecated v1 spelling (ADR 0115): write `sampling` (temperature, top_p, max_output_tokens, stop), `output.mime` (responseMimeType) and `reasoning` (thinkingConfig, reasoningEffort) instead; npx melchizedek-codemod rewrites a file. Still read: the Gemini GenerateContentConfig shape the engine takes. Do not set tools here.",
160
+ "deprecated": true
160
161
  },
161
162
  "reasoning": {
162
163
  "anyOf": [
@@ -187,13 +188,249 @@
187
188
  ],
188
189
  "description": "How hard this agent reasons, on any provider: none | low | medium | high, or { budget_tokens: <int> }. Replaces generateContentConfig.thinkingConfig and reasoningEffort (ADR 0047)."
189
190
  },
191
+ "sampling": {
192
+ "type": "object",
193
+ "properties": {
194
+ "temperature": {
195
+ "description": "Sampling temperature. Replaces generateContentConfig.temperature.",
196
+ "type": "number"
197
+ },
198
+ "top_p": {
199
+ "description": "Nucleus sampling. Replaces generateContentConfig.topP.",
200
+ "type": "number"
201
+ },
202
+ "max_output_tokens": {
203
+ "description": "Cap on the reply's tokens. Replaces generateContentConfig.maxOutputTokens.",
204
+ "type": "integer",
205
+ "exclusiveMinimum": 0,
206
+ "maximum": 9007199254740991
207
+ },
208
+ "stop": {
209
+ "description": "Stop sequences. Replaces generateContentConfig.stopSequences.",
210
+ "minItems": 1,
211
+ "type": "array",
212
+ "items": {
213
+ "type": "string"
214
+ }
215
+ }
216
+ },
217
+ "additionalProperties": false,
218
+ "description": "How this agent samples, on any provider (ADR 0115). Replaces the same keys under generateContentConfig; cannot be combined with them.",
219
+ "minProperties": 1
220
+ },
221
+ "output": {
222
+ "type": "object",
223
+ "properties": {
224
+ "schema": {
225
+ "description": "JSON Schema the final reply is one object of. Replaces outputSchema; same behaviour beside tools and subagents (ADR 0109).",
226
+ "type": "object",
227
+ "propertyNames": {
228
+ "type": "string"
229
+ },
230
+ "additionalProperties": {}
231
+ },
232
+ "mime": {
233
+ "description": "application/json: JSON mode without a schema. Replaces generateContentConfig.responseMimeType.",
234
+ "type": "string",
235
+ "enum": [
236
+ "application/json",
237
+ "text/plain"
238
+ ]
239
+ }
240
+ },
241
+ "additionalProperties": false,
242
+ "description": "What this agent's final reply is (ADR 0115). Replaces outputSchema and generateContentConfig.responseMimeType; cannot be combined with them.",
243
+ "minProperties": 1
244
+ },
245
+ "model_overrides": {
246
+ "type": "object",
247
+ "properties": {
248
+ "gemini": {
249
+ "type": "object",
250
+ "properties": {
251
+ "instruction": {
252
+ "description": "Replaces the agent's instruction on this provider.",
253
+ "type": "string",
254
+ "minLength": 1
255
+ },
256
+ "instruction_append": {
257
+ "description": "Appended to the agent's instruction, after a blank line, on this provider.",
258
+ "type": "string",
259
+ "minLength": 1
260
+ }
261
+ },
262
+ "additionalProperties": false,
263
+ "description": "The instruction on one provider: exactly one of instruction or instruction_append.",
264
+ "oneOf": [
265
+ {
266
+ "required": [
267
+ "instruction"
268
+ ]
269
+ },
270
+ {
271
+ "required": [
272
+ "instruction_append"
273
+ ]
274
+ }
275
+ ]
276
+ },
277
+ "anthropic": {
278
+ "type": "object",
279
+ "properties": {
280
+ "instruction": {
281
+ "description": "Replaces the agent's instruction on this provider.",
282
+ "type": "string",
283
+ "minLength": 1
284
+ },
285
+ "instruction_append": {
286
+ "description": "Appended to the agent's instruction, after a blank line, on this provider.",
287
+ "type": "string",
288
+ "minLength": 1
289
+ }
290
+ },
291
+ "additionalProperties": false,
292
+ "description": "The instruction on one provider: exactly one of instruction or instruction_append.",
293
+ "oneOf": [
294
+ {
295
+ "required": [
296
+ "instruction"
297
+ ]
298
+ },
299
+ {
300
+ "required": [
301
+ "instruction_append"
302
+ ]
303
+ }
304
+ ]
305
+ },
306
+ "openai": {
307
+ "type": "object",
308
+ "properties": {
309
+ "instruction": {
310
+ "description": "Replaces the agent's instruction on this provider.",
311
+ "type": "string",
312
+ "minLength": 1
313
+ },
314
+ "instruction_append": {
315
+ "description": "Appended to the agent's instruction, after a blank line, on this provider.",
316
+ "type": "string",
317
+ "minLength": 1
318
+ }
319
+ },
320
+ "additionalProperties": false,
321
+ "description": "The instruction on one provider: exactly one of instruction or instruction_append.",
322
+ "oneOf": [
323
+ {
324
+ "required": [
325
+ "instruction"
326
+ ]
327
+ },
328
+ {
329
+ "required": [
330
+ "instruction_append"
331
+ ]
332
+ }
333
+ ]
334
+ },
335
+ "xai": {
336
+ "type": "object",
337
+ "properties": {
338
+ "instruction": {
339
+ "description": "Replaces the agent's instruction on this provider.",
340
+ "type": "string",
341
+ "minLength": 1
342
+ },
343
+ "instruction_append": {
344
+ "description": "Appended to the agent's instruction, after a blank line, on this provider.",
345
+ "type": "string",
346
+ "minLength": 1
347
+ }
348
+ },
349
+ "additionalProperties": false,
350
+ "description": "The instruction on one provider: exactly one of instruction or instruction_append.",
351
+ "oneOf": [
352
+ {
353
+ "required": [
354
+ "instruction"
355
+ ]
356
+ },
357
+ {
358
+ "required": [
359
+ "instruction_append"
360
+ ]
361
+ }
362
+ ]
363
+ },
364
+ "moonshot": {
365
+ "type": "object",
366
+ "properties": {
367
+ "instruction": {
368
+ "description": "Replaces the agent's instruction on this provider.",
369
+ "type": "string",
370
+ "minLength": 1
371
+ },
372
+ "instruction_append": {
373
+ "description": "Appended to the agent's instruction, after a blank line, on this provider.",
374
+ "type": "string",
375
+ "minLength": 1
376
+ }
377
+ },
378
+ "additionalProperties": false,
379
+ "description": "The instruction on one provider: exactly one of instruction or instruction_append.",
380
+ "oneOf": [
381
+ {
382
+ "required": [
383
+ "instruction"
384
+ ]
385
+ },
386
+ {
387
+ "required": [
388
+ "instruction_append"
389
+ ]
390
+ }
391
+ ]
392
+ },
393
+ "ollama": {
394
+ "type": "object",
395
+ "properties": {
396
+ "instruction": {
397
+ "description": "Replaces the agent's instruction on this provider.",
398
+ "type": "string",
399
+ "minLength": 1
400
+ },
401
+ "instruction_append": {
402
+ "description": "Appended to the agent's instruction, after a blank line, on this provider.",
403
+ "type": "string",
404
+ "minLength": 1
405
+ }
406
+ },
407
+ "additionalProperties": false,
408
+ "description": "The instruction on one provider: exactly one of instruction or instruction_append.",
409
+ "oneOf": [
410
+ {
411
+ "required": [
412
+ "instruction"
413
+ ]
414
+ },
415
+ {
416
+ "required": [
417
+ "instruction_append"
418
+ ]
419
+ }
420
+ ]
421
+ }
422
+ },
423
+ "additionalProperties": false,
424
+ "description": "Per-provider instruction, keyed by the provider of the agent's model id (lib/models/providerMap.ts). Applied at compile time before the skills index; not to fallback_model, and never to globalInstruction (ADR 0115)."
425
+ },
190
426
  "outputSchema": {
191
- "description": "JSON Schema for structured output: the agent answers with one JSON object matching it. Hold it on a leaf; an agent that delegates and holds one ends its turn on that JSON.",
427
+ "description": "Deprecated v1 spelling (ADR 0115): write output.schema. JSON Schema for structured output: the agent answers with one JSON object matching it. An agent that also calls tools or delegates to subagents does that first, then ends its turn on that JSON: the schema travels beside the tools where the model takes both in one request, as a set_model_response tool elsewhere (the capability matrix's structured_output_with_tools, ADR 0109).",
192
428
  "type": "object",
193
429
  "propertyNames": {
194
430
  "type": "string"
195
431
  },
196
- "additionalProperties": {}
432
+ "additionalProperties": {},
433
+ "deprecated": true
197
434
  },
198
435
  "mcp_server_url": {
199
436
  "description": "MCP server (SSE) whose tools are discovered at runtime and merged with `tools`.",
@@ -208,6 +445,88 @@
208
445
  "minLength": 1
209
446
  }
210
447
  },
448
+ "mcp_auth": {
449
+ "description": "The OAuth grant the MCP server takes (ADR 0112). With authorization_code, each user's own token on their own connection, and mcp_tools is required. Needs mcp_server_url; replaces MCP_BEARER_TOKENS for this server.",
450
+ "type": "object",
451
+ "properties": {
452
+ "oauth2": {
453
+ "type": "object",
454
+ "properties": {
455
+ "provider": {
456
+ "type": "string",
457
+ "pattern": "^[a-z0-9][a-z0-9._-]{0,63}$",
458
+ "description": "The credential store's name for the provider (e.g. github). Every tool naming it shares one grant."
459
+ },
460
+ "grant": {
461
+ "type": "string",
462
+ "enum": [
463
+ "authorization_code",
464
+ "client_credentials"
465
+ ],
466
+ "description": "authorization_code: each user's own token, granted through the consent pause (ADR 0085). client_credentials: the server's own token, from the token endpoint."
467
+ },
468
+ "authorization_url": {
469
+ "description": "The provider's authorization endpoint (https). authorization_code only.",
470
+ "type": "string",
471
+ "format": "uri"
472
+ },
473
+ "token_url": {
474
+ "type": "string",
475
+ "format": "uri",
476
+ "description": "The provider's token endpoint (https)."
477
+ },
478
+ "client_id": {
479
+ "description": "The OAuth client id, written out (it is not a secret). Or client_id_env.",
480
+ "type": "string",
481
+ "minLength": 1,
482
+ "maxLength": 512
483
+ },
484
+ "client_id_env": {
485
+ "description": "Environment variable holding the client id. Or client_id.",
486
+ "type": "string",
487
+ "pattern": "^[A-Z_][A-Z0-9_]*$"
488
+ },
489
+ "client_secret_env": {
490
+ "description": "Environment variable NAME holding the client secret, never the value. Required for client_credentials; omit for a public client (PKCE alone).",
491
+ "type": "string",
492
+ "pattern": "^[A-Z_][A-Z0-9_]*$"
493
+ },
494
+ "scopes": {
495
+ "description": "The scopes the grant asks for.",
496
+ "maxItems": 64,
497
+ "type": "array",
498
+ "items": {
499
+ "type": "string",
500
+ "pattern": "^[\\x21\\x23-\\x5b\\x5d-\\x7e]{1,256}$"
501
+ }
502
+ },
503
+ "authorization_params": {
504
+ "description": "Extra authorization parameters (e.g. access_type: offline). authorization_code only; never state, redirect_uri, scope, client_id or the PKCE pair.",
505
+ "type": "object",
506
+ "propertyNames": {
507
+ "type": "string",
508
+ "pattern": "^[A-Za-z0-9_.-]{1,64}$"
509
+ },
510
+ "additionalProperties": {
511
+ "type": "string",
512
+ "maxLength": 512
513
+ }
514
+ }
515
+ },
516
+ "required": [
517
+ "provider",
518
+ "grant",
519
+ "token_url"
520
+ ],
521
+ "additionalProperties": false,
522
+ "description": "An OAuth 2 access token sent as a bearer token on every call (lib/tools/oauthTools.ts). Secrets come from environment variable names, never values."
523
+ }
524
+ },
525
+ "required": [
526
+ "oauth2"
527
+ ],
528
+ "additionalProperties": false
529
+ },
211
530
  "skills": {
212
531
  "type": "object",
213
532
  "properties": {
@@ -320,6 +639,78 @@
320
639
  "name"
321
640
  ],
322
641
  "additionalProperties": false
642
+ },
643
+ "oauth2": {
644
+ "type": "object",
645
+ "properties": {
646
+ "provider": {
647
+ "type": "string",
648
+ "pattern": "^[a-z0-9][a-z0-9._-]{0,63}$",
649
+ "description": "The credential store's name for the provider (e.g. github). Every tool naming it shares one grant."
650
+ },
651
+ "grant": {
652
+ "type": "string",
653
+ "enum": [
654
+ "authorization_code",
655
+ "client_credentials"
656
+ ],
657
+ "description": "authorization_code: each user's own token, granted through the consent pause (ADR 0085). client_credentials: the server's own token, from the token endpoint."
658
+ },
659
+ "authorization_url": {
660
+ "description": "The provider's authorization endpoint (https). authorization_code only.",
661
+ "type": "string",
662
+ "format": "uri"
663
+ },
664
+ "token_url": {
665
+ "type": "string",
666
+ "format": "uri",
667
+ "description": "The provider's token endpoint (https)."
668
+ },
669
+ "client_id": {
670
+ "description": "The OAuth client id, written out (it is not a secret). Or client_id_env.",
671
+ "type": "string",
672
+ "minLength": 1,
673
+ "maxLength": 512
674
+ },
675
+ "client_id_env": {
676
+ "description": "Environment variable holding the client id. Or client_id.",
677
+ "type": "string",
678
+ "pattern": "^[A-Z_][A-Z0-9_]*$"
679
+ },
680
+ "client_secret_env": {
681
+ "description": "Environment variable NAME holding the client secret, never the value. Required for client_credentials; omit for a public client (PKCE alone).",
682
+ "type": "string",
683
+ "pattern": "^[A-Z_][A-Z0-9_]*$"
684
+ },
685
+ "scopes": {
686
+ "description": "The scopes the grant asks for.",
687
+ "maxItems": 64,
688
+ "type": "array",
689
+ "items": {
690
+ "type": "string",
691
+ "pattern": "^[\\x21\\x23-\\x5b\\x5d-\\x7e]{1,256}$"
692
+ }
693
+ },
694
+ "authorization_params": {
695
+ "description": "Extra authorization parameters (e.g. access_type: offline). authorization_code only; never state, redirect_uri, scope, client_id or the PKCE pair.",
696
+ "type": "object",
697
+ "propertyNames": {
698
+ "type": "string",
699
+ "pattern": "^[A-Za-z0-9_.-]{1,64}$"
700
+ },
701
+ "additionalProperties": {
702
+ "type": "string",
703
+ "maxLength": 512
704
+ }
705
+ }
706
+ },
707
+ "required": [
708
+ "provider",
709
+ "grant",
710
+ "token_url"
711
+ ],
712
+ "additionalProperties": false,
713
+ "description": "An OAuth 2 access token sent as a bearer token on every call (lib/tools/oauthTools.ts). Secrets come from environment variable names, never values."
323
714
  }
324
715
  },
325
716
  "additionalProperties": false
@@ -465,7 +856,7 @@
465
856
  }
466
857
  },
467
858
  "require_approval": {
468
- "description": "Tools from this agent's `tools` that run only after a person approves the exact call (ADR 0028): the A2A task ends input-required until the caller answers approve or reject. Allowed on the orchestrator and on plan-dispatch routes.",
859
+ "description": "Tools from this agent's `tools` that run only after a person approves the exact call (ADR 0028): the A2A task ends input-required until the caller answers approve or reject. Allowed on any agent but one a workflow map node runs; inside a delegated subagent the pause reaches the caller through its open call (ADR 0110).",
469
860
  "type": "array",
470
861
  "items": {
471
862
  "type": "string",
@@ -574,7 +965,8 @@
574
965
  }
575
966
  },
576
967
  "additionalProperties": {},
577
- "description": "Model generation config (@google/genai GenerateContentConfig). Do not set tools here."
968
+ "description": "Deprecated v1 spelling (ADR 0115): write `sampling` (temperature, top_p, max_output_tokens, stop), `output.mime` (responseMimeType) and `reasoning` (thinkingConfig, reasoningEffort) instead; npx melchizedek-codemod rewrites a file. Still read: the Gemini GenerateContentConfig shape the engine takes. Do not set tools here.",
969
+ "deprecated": true
578
970
  },
579
971
  "reasoning": {
580
972
  "anyOf": [
@@ -605,13 +997,249 @@
605
997
  ],
606
998
  "description": "How hard this agent reasons, on any provider: none | low | medium | high, or { budget_tokens: <int> }. Replaces generateContentConfig.thinkingConfig and reasoningEffort (ADR 0047)."
607
999
  },
1000
+ "sampling": {
1001
+ "type": "object",
1002
+ "properties": {
1003
+ "temperature": {
1004
+ "description": "Sampling temperature. Replaces generateContentConfig.temperature.",
1005
+ "type": "number"
1006
+ },
1007
+ "top_p": {
1008
+ "description": "Nucleus sampling. Replaces generateContentConfig.topP.",
1009
+ "type": "number"
1010
+ },
1011
+ "max_output_tokens": {
1012
+ "description": "Cap on the reply's tokens. Replaces generateContentConfig.maxOutputTokens.",
1013
+ "type": "integer",
1014
+ "exclusiveMinimum": 0,
1015
+ "maximum": 9007199254740991
1016
+ },
1017
+ "stop": {
1018
+ "description": "Stop sequences. Replaces generateContentConfig.stopSequences.",
1019
+ "minItems": 1,
1020
+ "type": "array",
1021
+ "items": {
1022
+ "type": "string"
1023
+ }
1024
+ }
1025
+ },
1026
+ "additionalProperties": false,
1027
+ "description": "How this agent samples, on any provider (ADR 0115). Replaces the same keys under generateContentConfig; cannot be combined with them.",
1028
+ "minProperties": 1
1029
+ },
1030
+ "output": {
1031
+ "type": "object",
1032
+ "properties": {
1033
+ "schema": {
1034
+ "description": "JSON Schema the final reply is one object of. Replaces outputSchema; same behaviour beside tools and subagents (ADR 0109).",
1035
+ "type": "object",
1036
+ "propertyNames": {
1037
+ "type": "string"
1038
+ },
1039
+ "additionalProperties": {}
1040
+ },
1041
+ "mime": {
1042
+ "description": "application/json: JSON mode without a schema. Replaces generateContentConfig.responseMimeType.",
1043
+ "type": "string",
1044
+ "enum": [
1045
+ "application/json",
1046
+ "text/plain"
1047
+ ]
1048
+ }
1049
+ },
1050
+ "additionalProperties": false,
1051
+ "description": "What this agent's final reply is (ADR 0115). Replaces outputSchema and generateContentConfig.responseMimeType; cannot be combined with them.",
1052
+ "minProperties": 1
1053
+ },
1054
+ "model_overrides": {
1055
+ "type": "object",
1056
+ "properties": {
1057
+ "gemini": {
1058
+ "type": "object",
1059
+ "properties": {
1060
+ "instruction": {
1061
+ "description": "Replaces the agent's instruction on this provider.",
1062
+ "type": "string",
1063
+ "minLength": 1
1064
+ },
1065
+ "instruction_append": {
1066
+ "description": "Appended to the agent's instruction, after a blank line, on this provider.",
1067
+ "type": "string",
1068
+ "minLength": 1
1069
+ }
1070
+ },
1071
+ "additionalProperties": false,
1072
+ "description": "The instruction on one provider: exactly one of instruction or instruction_append.",
1073
+ "oneOf": [
1074
+ {
1075
+ "required": [
1076
+ "instruction"
1077
+ ]
1078
+ },
1079
+ {
1080
+ "required": [
1081
+ "instruction_append"
1082
+ ]
1083
+ }
1084
+ ]
1085
+ },
1086
+ "anthropic": {
1087
+ "type": "object",
1088
+ "properties": {
1089
+ "instruction": {
1090
+ "description": "Replaces the agent's instruction on this provider.",
1091
+ "type": "string",
1092
+ "minLength": 1
1093
+ },
1094
+ "instruction_append": {
1095
+ "description": "Appended to the agent's instruction, after a blank line, on this provider.",
1096
+ "type": "string",
1097
+ "minLength": 1
1098
+ }
1099
+ },
1100
+ "additionalProperties": false,
1101
+ "description": "The instruction on one provider: exactly one of instruction or instruction_append.",
1102
+ "oneOf": [
1103
+ {
1104
+ "required": [
1105
+ "instruction"
1106
+ ]
1107
+ },
1108
+ {
1109
+ "required": [
1110
+ "instruction_append"
1111
+ ]
1112
+ }
1113
+ ]
1114
+ },
1115
+ "openai": {
1116
+ "type": "object",
1117
+ "properties": {
1118
+ "instruction": {
1119
+ "description": "Replaces the agent's instruction on this provider.",
1120
+ "type": "string",
1121
+ "minLength": 1
1122
+ },
1123
+ "instruction_append": {
1124
+ "description": "Appended to the agent's instruction, after a blank line, on this provider.",
1125
+ "type": "string",
1126
+ "minLength": 1
1127
+ }
1128
+ },
1129
+ "additionalProperties": false,
1130
+ "description": "The instruction on one provider: exactly one of instruction or instruction_append.",
1131
+ "oneOf": [
1132
+ {
1133
+ "required": [
1134
+ "instruction"
1135
+ ]
1136
+ },
1137
+ {
1138
+ "required": [
1139
+ "instruction_append"
1140
+ ]
1141
+ }
1142
+ ]
1143
+ },
1144
+ "xai": {
1145
+ "type": "object",
1146
+ "properties": {
1147
+ "instruction": {
1148
+ "description": "Replaces the agent's instruction on this provider.",
1149
+ "type": "string",
1150
+ "minLength": 1
1151
+ },
1152
+ "instruction_append": {
1153
+ "description": "Appended to the agent's instruction, after a blank line, on this provider.",
1154
+ "type": "string",
1155
+ "minLength": 1
1156
+ }
1157
+ },
1158
+ "additionalProperties": false,
1159
+ "description": "The instruction on one provider: exactly one of instruction or instruction_append.",
1160
+ "oneOf": [
1161
+ {
1162
+ "required": [
1163
+ "instruction"
1164
+ ]
1165
+ },
1166
+ {
1167
+ "required": [
1168
+ "instruction_append"
1169
+ ]
1170
+ }
1171
+ ]
1172
+ },
1173
+ "moonshot": {
1174
+ "type": "object",
1175
+ "properties": {
1176
+ "instruction": {
1177
+ "description": "Replaces the agent's instruction on this provider.",
1178
+ "type": "string",
1179
+ "minLength": 1
1180
+ },
1181
+ "instruction_append": {
1182
+ "description": "Appended to the agent's instruction, after a blank line, on this provider.",
1183
+ "type": "string",
1184
+ "minLength": 1
1185
+ }
1186
+ },
1187
+ "additionalProperties": false,
1188
+ "description": "The instruction on one provider: exactly one of instruction or instruction_append.",
1189
+ "oneOf": [
1190
+ {
1191
+ "required": [
1192
+ "instruction"
1193
+ ]
1194
+ },
1195
+ {
1196
+ "required": [
1197
+ "instruction_append"
1198
+ ]
1199
+ }
1200
+ ]
1201
+ },
1202
+ "ollama": {
1203
+ "type": "object",
1204
+ "properties": {
1205
+ "instruction": {
1206
+ "description": "Replaces the agent's instruction on this provider.",
1207
+ "type": "string",
1208
+ "minLength": 1
1209
+ },
1210
+ "instruction_append": {
1211
+ "description": "Appended to the agent's instruction, after a blank line, on this provider.",
1212
+ "type": "string",
1213
+ "minLength": 1
1214
+ }
1215
+ },
1216
+ "additionalProperties": false,
1217
+ "description": "The instruction on one provider: exactly one of instruction or instruction_append.",
1218
+ "oneOf": [
1219
+ {
1220
+ "required": [
1221
+ "instruction"
1222
+ ]
1223
+ },
1224
+ {
1225
+ "required": [
1226
+ "instruction_append"
1227
+ ]
1228
+ }
1229
+ ]
1230
+ }
1231
+ },
1232
+ "additionalProperties": false,
1233
+ "description": "Per-provider instruction, keyed by the provider of the agent's model id (lib/models/providerMap.ts). Applied at compile time before the skills index; not to fallback_model, and never to globalInstruction (ADR 0115)."
1234
+ },
608
1235
  "outputSchema": {
609
- "description": "JSON Schema for structured output: the agent answers with one JSON object matching it. Hold it on a leaf; an agent that delegates and holds one ends its turn on that JSON.",
1236
+ "description": "Deprecated v1 spelling (ADR 0115): write output.schema. JSON Schema for structured output: the agent answers with one JSON object matching it. An agent that also calls tools or delegates to subagents does that first, then ends its turn on that JSON: the schema travels beside the tools where the model takes both in one request, as a set_model_response tool elsewhere (the capability matrix's structured_output_with_tools, ADR 0109).",
610
1237
  "type": "object",
611
1238
  "propertyNames": {
612
1239
  "type": "string"
613
1240
  },
614
- "additionalProperties": {}
1241
+ "additionalProperties": {},
1242
+ "deprecated": true
615
1243
  },
616
1244
  "mcp_server_url": {
617
1245
  "description": "MCP server (SSE) whose tools are discovered at runtime and merged with `tools`.",
@@ -626,6 +1254,88 @@
626
1254
  "minLength": 1
627
1255
  }
628
1256
  },
1257
+ "mcp_auth": {
1258
+ "description": "The OAuth grant the MCP server takes (ADR 0112). With authorization_code, each user's own token on their own connection, and mcp_tools is required. Needs mcp_server_url; replaces MCP_BEARER_TOKENS for this server.",
1259
+ "type": "object",
1260
+ "properties": {
1261
+ "oauth2": {
1262
+ "type": "object",
1263
+ "properties": {
1264
+ "provider": {
1265
+ "type": "string",
1266
+ "pattern": "^[a-z0-9][a-z0-9._-]{0,63}$",
1267
+ "description": "The credential store's name for the provider (e.g. github). Every tool naming it shares one grant."
1268
+ },
1269
+ "grant": {
1270
+ "type": "string",
1271
+ "enum": [
1272
+ "authorization_code",
1273
+ "client_credentials"
1274
+ ],
1275
+ "description": "authorization_code: each user's own token, granted through the consent pause (ADR 0085). client_credentials: the server's own token, from the token endpoint."
1276
+ },
1277
+ "authorization_url": {
1278
+ "description": "The provider's authorization endpoint (https). authorization_code only.",
1279
+ "type": "string",
1280
+ "format": "uri"
1281
+ },
1282
+ "token_url": {
1283
+ "type": "string",
1284
+ "format": "uri",
1285
+ "description": "The provider's token endpoint (https)."
1286
+ },
1287
+ "client_id": {
1288
+ "description": "The OAuth client id, written out (it is not a secret). Or client_id_env.",
1289
+ "type": "string",
1290
+ "minLength": 1,
1291
+ "maxLength": 512
1292
+ },
1293
+ "client_id_env": {
1294
+ "description": "Environment variable holding the client id. Or client_id.",
1295
+ "type": "string",
1296
+ "pattern": "^[A-Z_][A-Z0-9_]*$"
1297
+ },
1298
+ "client_secret_env": {
1299
+ "description": "Environment variable NAME holding the client secret, never the value. Required for client_credentials; omit for a public client (PKCE alone).",
1300
+ "type": "string",
1301
+ "pattern": "^[A-Z_][A-Z0-9_]*$"
1302
+ },
1303
+ "scopes": {
1304
+ "description": "The scopes the grant asks for.",
1305
+ "maxItems": 64,
1306
+ "type": "array",
1307
+ "items": {
1308
+ "type": "string",
1309
+ "pattern": "^[\\x21\\x23-\\x5b\\x5d-\\x7e]{1,256}$"
1310
+ }
1311
+ },
1312
+ "authorization_params": {
1313
+ "description": "Extra authorization parameters (e.g. access_type: offline). authorization_code only; never state, redirect_uri, scope, client_id or the PKCE pair.",
1314
+ "type": "object",
1315
+ "propertyNames": {
1316
+ "type": "string",
1317
+ "pattern": "^[A-Za-z0-9_.-]{1,64}$"
1318
+ },
1319
+ "additionalProperties": {
1320
+ "type": "string",
1321
+ "maxLength": 512
1322
+ }
1323
+ }
1324
+ },
1325
+ "required": [
1326
+ "provider",
1327
+ "grant",
1328
+ "token_url"
1329
+ ],
1330
+ "additionalProperties": false,
1331
+ "description": "An OAuth 2 access token sent as a bearer token on every call (lib/tools/oauthTools.ts). Secrets come from environment variable names, never values."
1332
+ }
1333
+ },
1334
+ "required": [
1335
+ "oauth2"
1336
+ ],
1337
+ "additionalProperties": false
1338
+ },
629
1339
  "skills": {
630
1340
  "type": "object",
631
1341
  "properties": {
@@ -738,6 +1448,78 @@
738
1448
  "name"
739
1449
  ],
740
1450
  "additionalProperties": false
1451
+ },
1452
+ "oauth2": {
1453
+ "type": "object",
1454
+ "properties": {
1455
+ "provider": {
1456
+ "type": "string",
1457
+ "pattern": "^[a-z0-9][a-z0-9._-]{0,63}$",
1458
+ "description": "The credential store's name for the provider (e.g. github). Every tool naming it shares one grant."
1459
+ },
1460
+ "grant": {
1461
+ "type": "string",
1462
+ "enum": [
1463
+ "authorization_code",
1464
+ "client_credentials"
1465
+ ],
1466
+ "description": "authorization_code: each user's own token, granted through the consent pause (ADR 0085). client_credentials: the server's own token, from the token endpoint."
1467
+ },
1468
+ "authorization_url": {
1469
+ "description": "The provider's authorization endpoint (https). authorization_code only.",
1470
+ "type": "string",
1471
+ "format": "uri"
1472
+ },
1473
+ "token_url": {
1474
+ "type": "string",
1475
+ "format": "uri",
1476
+ "description": "The provider's token endpoint (https)."
1477
+ },
1478
+ "client_id": {
1479
+ "description": "The OAuth client id, written out (it is not a secret). Or client_id_env.",
1480
+ "type": "string",
1481
+ "minLength": 1,
1482
+ "maxLength": 512
1483
+ },
1484
+ "client_id_env": {
1485
+ "description": "Environment variable holding the client id. Or client_id.",
1486
+ "type": "string",
1487
+ "pattern": "^[A-Z_][A-Z0-9_]*$"
1488
+ },
1489
+ "client_secret_env": {
1490
+ "description": "Environment variable NAME holding the client secret, never the value. Required for client_credentials; omit for a public client (PKCE alone).",
1491
+ "type": "string",
1492
+ "pattern": "^[A-Z_][A-Z0-9_]*$"
1493
+ },
1494
+ "scopes": {
1495
+ "description": "The scopes the grant asks for.",
1496
+ "maxItems": 64,
1497
+ "type": "array",
1498
+ "items": {
1499
+ "type": "string",
1500
+ "pattern": "^[\\x21\\x23-\\x5b\\x5d-\\x7e]{1,256}$"
1501
+ }
1502
+ },
1503
+ "authorization_params": {
1504
+ "description": "Extra authorization parameters (e.g. access_type: offline). authorization_code only; never state, redirect_uri, scope, client_id or the PKCE pair.",
1505
+ "type": "object",
1506
+ "propertyNames": {
1507
+ "type": "string",
1508
+ "pattern": "^[A-Za-z0-9_.-]{1,64}$"
1509
+ },
1510
+ "additionalProperties": {
1511
+ "type": "string",
1512
+ "maxLength": 512
1513
+ }
1514
+ }
1515
+ },
1516
+ "required": [
1517
+ "provider",
1518
+ "grant",
1519
+ "token_url"
1520
+ ],
1521
+ "additionalProperties": false,
1522
+ "description": "An OAuth 2 access token sent as a bearer token on every call (lib/tools/oauthTools.ts). Secrets come from environment variable names, never values."
741
1523
  }
742
1524
  },
743
1525
  "additionalProperties": false
@@ -831,7 +1613,7 @@
831
1613
  "additionalProperties": false
832
1614
  },
833
1615
  "yaml_reference": {
834
- "description": "A whole nested syndicate (filename under the agents dir) used as this subagent.",
1616
+ "description": "A whole nested syndicate (filename under the agents dir) used as this subagent. An approval request or ask_user question raised inside it pauses the turn with the agent path (ADR 0110, ADR 0111): a delegate syndicate's gates anywhere, a dispatch syndicate's on its classifier (its routes never run nested), and a workflow's ask_user nodes and gates when it is delegated to as a subagent.",
835
1617
  "type": "string",
836
1618
  "minLength": 1
837
1619
  },
@@ -1166,6 +1948,12 @@
1166
1948
  "exclusiveMinimum": 0,
1167
1949
  "maximum": 9007199254740991
1168
1950
  },
1951
+ "max_concurrency": {
1952
+ "description": "Subagent calls from one orchestrator step that run at once; the rest wait their turn, in call order. Default 4; 1 runs them one after another. A delegate syndicate only (ADR 0116).",
1953
+ "type": "integer",
1954
+ "exclusiveMinimum": 0,
1955
+ "maximum": 32
1956
+ },
1169
1957
  "bundled_references": {
1170
1958
  "description": "Written by the registry publisher, not by hand: every nested yaml_reference this syndicate reaches, as it was when published, so a registry version is one unit (ADR 0018). Nested references load from here instead of from files.",
1171
1959
  "type": "object",