melchizedek-agents 0.16.2 → 0.17.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 (82) hide show
  1. package/.env.example +17 -0
  2. package/AGENT_SETUP.md +2 -1
  3. package/CHANGELOG.md +142 -0
  4. package/DOCUMENTATION.md +237 -7
  5. package/QUICKSTART.md +2 -2
  6. package/README.md +125 -149
  7. package/config/agents/examples/harness.yaml +135 -0
  8. package/config/agents/examples/model_zoo.yaml +23 -9
  9. package/config/agents/examples/pipeline.yaml +120 -0
  10. package/config/agents/examples/specs/open-meteo-forecast.json +77 -0
  11. package/config/agents/examples/specs/open-meteo-geocoding.json +53 -0
  12. package/config/agents/examples/weather.yaml +59 -0
  13. package/config/agents/syndicateSchema.yaml +112 -1
  14. package/db/migrations/0011_erase_expired.sql +198 -0
  15. package/dist/lib/a2a/app.d.ts +7 -0
  16. package/dist/lib/a2a/app.js +7 -1
  17. package/dist/lib/a2a/executor.js +41 -0
  18. package/dist/lib/compile.d.ts +40 -1
  19. package/dist/lib/compile.js +132 -14
  20. package/dist/lib/config.d.ts +17 -0
  21. package/dist/lib/config.js +17 -0
  22. package/dist/lib/doctor.js +17 -4
  23. package/dist/lib/index.d.ts +2 -0
  24. package/dist/lib/index.js +1 -0
  25. package/dist/lib/loadSyndicate.d.ts +46 -0
  26. package/dist/lib/loadSyndicate.js +19 -3
  27. package/dist/lib/memory/erase.d.ts +5 -0
  28. package/dist/lib/memory/erase.js +5 -0
  29. package/dist/lib/models/capabilities.js +10 -0
  30. package/dist/lib/models/endpoints.d.ts +1 -1
  31. package/dist/lib/models/endpoints.js +4 -1
  32. package/dist/lib/models/gateway.d.ts +2 -2
  33. package/dist/lib/models/gateway.js +4 -4
  34. package/dist/lib/models/kimiLlm.d.ts +123 -0
  35. package/dist/lib/models/kimiLlm.js +171 -0
  36. package/dist/lib/models/providerMap.d.ts +2 -2
  37. package/dist/lib/models/providerMap.js +4 -1
  38. package/dist/lib/models/registry.d.ts +1 -1
  39. package/dist/lib/models/registry.js +11 -3
  40. package/dist/lib/net/redirects.d.ts +14 -0
  41. package/dist/lib/net/redirects.js +94 -0
  42. package/dist/lib/observability/tracer.d.ts +1 -1
  43. package/dist/lib/persistence/supabaseProvider.d.ts +2 -6
  44. package/dist/lib/persistence/supabaseProvider.js +2 -31
  45. package/dist/lib/runtime/questions.d.ts +55 -0
  46. package/dist/lib/runtime/questions.js +107 -0
  47. package/dist/lib/runtime/syndicateTurn.d.ts +42 -4
  48. package/dist/lib/runtime/syndicateTurn.js +162 -16
  49. package/dist/lib/storage/postgres/index.d.ts +6 -0
  50. package/dist/lib/storage/postgres/index.js +11 -0
  51. package/dist/lib/storage/rlsStatus.d.ts +45 -0
  52. package/dist/lib/storage/rlsStatus.js +69 -0
  53. package/dist/lib/syndicateSchema.d.ts +169 -0
  54. package/dist/lib/syndicateSchema.js +327 -2
  55. package/dist/lib/toolRegistry.js +9 -0
  56. package/dist/lib/tools/openapiTools.d.ts +46 -0
  57. package/dist/lib/tools/openapiTools.js +195 -0
  58. package/dist/lib/tools/skillToolset.d.ts +135 -0
  59. package/dist/lib/tools/skillToolset.js +247 -0
  60. package/dist/lib/tools/urlContextTool.d.ts +29 -0
  61. package/dist/lib/tools/urlContextTool.js +39 -0
  62. package/dist/lib/workflow.d.ts +72 -0
  63. package/dist/lib/workflow.js +180 -0
  64. package/dist/lib/workflowConfig.d.ts +95 -0
  65. package/dist/lib/workflowConfig.js +93 -0
  66. package/dist/scripts/syndicate_chat.js +39 -5
  67. package/package.json +4 -1
  68. package/skills/briefs/_shared.md +1 -1
  69. package/skills/briefs/melchizedek-author.md +8 -4
  70. package/skills/briefs/melchizedek-memory.md +1 -1
  71. package/skills/briefs/melchizedek-models.md +1 -1
  72. package/skills/briefs/melchizedek-scribe.md +4 -4
  73. package/skills/briefs/melchizedek-serve.md +1 -1
  74. package/skills/briefs/melchizedek.md +4 -1
  75. package/skills/melchizedek/SKILL.md +4 -1
  76. package/skills/melchizedek-author/SKILL.md +7 -3
  77. package/skills/melchizedek-memory/SKILL.md +1 -1
  78. package/skills/melchizedek-models/SKILL.md +1 -1
  79. package/skills/melchizedek-scribe/SKILL.md +3 -3
  80. package/skills/melchizedek-serve/SKILL.md +1 -1
  81. /package/skills/melchizedek-author/{templates → assets}/minimal.yaml +0 -0
  82. /package/skills/melchizedek-scribe/{templates → assets}/brief.md +0 -0
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: melchizedek
3
- description: Find and run a Melchizedek syndicate (an agent team defined in one YAML file) from the terminal or from inside a coding agent. Use when the user mentions melchizedek, melchizedek-agents, a syndicate, the starter pack, or asks to run, list, or delegate a task to one of these agents; this is also the entry point to the other melchizedek-* skills.
3
+ description: "Find and run a Melchizedek syndicate (an agent team defined in one YAML file) from the terminal or from inside a coding agent. Use when the user mentions melchizedek, melchizedek-agents, a syndicate, the starter pack, or asks to run, list, or delegate a task to one of these agents; this is also the entry point to the other melchizedek-* skills."
4
4
  ---
5
5
 
6
6
  ## Where the syndicates are
@@ -24,6 +24,9 @@ To modify an example, copy it into `config/agents/` in your project and edit it.
24
24
  ## What each starter-pack syndicate does
25
25
 
26
26
  - `assistant.yaml`: Assistant; the generic starting point: converses, summarizes pasted text or URLs, keeps a task list, and queues background jobs that `npx melchizedek-worker` runs (clone: `npm run assistant:worker`); keyless (Ollama with qwen3:8b pulled).
27
+ - `harness.yaml`: Harness; works from a directory of Agent Skills the way a coding harness does: every skill's frontmatter is in its prompt, it reads the matching SKILL.md and the files it names, `/name` forces a skill, a Checker holds the result to the skill's own rules; `--bind skills_dir=<dir>` points it at a project's shelf (default: this package's own skills); gemini.
28
+ - `weather.yaml`: Weather; an HTTP API as tools from its OpenAPI spec (`openapi:`), no tool code: finds a place and forecasts its weather on Open-Meteo's keyless APIs; gemini.
29
+ - `pipeline.yaml`: Editorial Pipeline; a syndicate as a graph (`workflow:`): a planner routes on a JSON field, a writer and a checker run at once, a join feeds an editor that retries once, the person is asked before a publisher finishes; gemini.
27
30
  - `tutor.yaml`: Tutor; one agent that teaches a topic or pasted material by questioning; keyless (Ollama with qwen3:8b pulled).
28
31
  - `council.yaml`: Council; an advocate and a skeptic argue a question and a chair rules; keyless.
29
32
  - `critic.yaml`: Critic Review Workflow; a Drafter answers, a Critic scores it as JSON with a confidence field, and the loop repeats until confidence reaches 85 or higher (three rounds at most); gemini.
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: melchizedek-author
3
- description: Design or edit a Melchizedek syndicate YAML: the file layout, required keys, orchestrator and subagent blocks, tools by name, output schemas, memory mode, the tier header, and offline validation. Use when the user wants a new agent team, wants to change a syndicate's prompt, model, or tools, or asks what a field in a syndicate file means.
3
+ description: "Design or edit a Melchizedek syndicate YAML: the file layout, required keys, orchestrator and subagent blocks, tools by name, output schemas, memory mode, the tier header, and offline validation. Use when the user wants a new agent team, wants to change a syndicate's prompt, model, or tools, or asks what a field in a syndicate file means."
4
4
  ---
5
5
 
6
6
  ## Where the file goes
@@ -9,7 +9,7 @@ Your syndicates live at the root of `config/agents/` in your project. The file n
9
9
 
10
10
  The environment variable `MELCHIZEDEK_AGENTS_DIR` points the loader at another directory. The schema file `syndicateSchema.yaml` sits beside the examples and documents every field with its ADK counterpart.
11
11
 
12
- A minimal template ships with this skill at `templates/minimal.yaml` relative to this skill's directory. Copy it, rename it, and fill in the fields.
12
+ A minimal template ships with this skill at `assets/minimal.yaml` relative to this skill's directory. Copy it, rename it, and fill in the fields.
13
13
 
14
14
  ## Start from the closest example
15
15
 
@@ -31,6 +31,7 @@ Top-level keys:
31
31
  - `variables:`: default values for `{{token}}` placeholders used across the file. Override them at run time with `--bind key=value` or `--bindings '{"key":"value"}'`. The loader injects `{{current_date}}` fresh on every load; omit static date strings.
32
32
  - `memory_extraction_rules:`: domain rules appended to the shared fact-extraction prompt in `long-term` mode, such as what to store and what to skip.
33
33
  - `dispatch:`: switches the syndicate from delegate mode to plan-dispatch routing where a classifier picks a route. In delegate mode, subagents act as tools the orchestrator calls, and the orchestrator re-emits the chosen answer. The `dispatch:` block requires `default_route` naming a declared subagent that can answer any message. It accepts `route_key`, `reason_key`, and `route_overrides` (a list of `{route, pattern, flags, reason}`). A regex match in `route_overrides` pins the route and skips the classifier.
34
+ - `workflow:`: makes the syndicate a graph instead of a delegation: `edges` lists chains of agent names (`START` opens one; a list fans out or in; a map `{route: Agent, default: Agent}` routes on the previous node's output), and `nodes` declares `join`, `map`, `tool` and `ask_user` nodes plus `retry` and `timeout` modifiers. Every node receives the previous node's output as its message. Cannot be combined with `dispatch:`. Read `pipeline.yaml` for the worked example.
34
35
  - `orchestrator:`: required orchestrator block.
35
36
  - `subagents:`: list of subagent blocks; omit it (or pass `[]`) for a single-agent syndicate.
36
37
 
@@ -39,7 +40,10 @@ Agent block keys for the orchestrator and each subagent:
39
40
  - `description`: one line. For a subagent, this acts as the routing API: the orchestrator decides whom to call by reading descriptions, so state what to pass and when to call.
40
41
  - `model`: model identifier, required on the orchestrator. Subagents inherit this model when unset. The melchizedek-models skill covers provider prefixes. Use `gemini-3.8-flash` or `gemini-3.5-flash-lite` for Gemini. The model `gemini-2.5-flash` fails with a 400 error about tool call context circulation.
41
42
  - `instruction`: required system prompt.
42
- - `tools:`: list of registered tool names: `web_search`, `web_extract`, `google_search`, `x_search`, `x_api_search`, `collections_search`, `generate_image`, `inspect_image`, `load_memory`, `preload_memory`, `wiki_map`, `wiki_search`, `wiki_read`, `wiki_links`, `wiki_dive`, `wiki_save`, `wiki_graph`, `wiki_relate`. The loader warns on an unknown name and skips it. Server-side search tools run natively only on providers that offer them; `npx melchizedek-doctor` reports per agent which tools stay or drop.
43
+ - `tools:`: list of registered tool names: `web_search`, `web_extract`, `google_search`, `x_search`, `x_api_search`, `collections_search`, `generate_image`, `inspect_image`, `load_memory`, `preload_memory`, `wiki_map`, `wiki_search`, `wiki_read`, `wiki_links`, `wiki_dive`, `wiki_save`, `wiki_graph`, `wiki_relate`, `url_context` (Gemini reads the pages at URLs in the conversation; a no-op on other providers), and `ask_user` (the agent asks the person and the turn waits for the answer; only on the orchestrator or a plan-dispatch route). The loader warns on an unknown name and skips it. Server-side search tools run natively only on providers that offer them; `npx melchizedek-doctor` reports per agent which tools stay or drop.
44
+ - `examples:` a list of `{input, output}` pairs added to every request as few-shot examples. At the top level, `retries:` tunes self-correction, which is on by default: `model_errors` (2) retries a malformed model reply, `tool_errors` (3) retries a tool that threw; 0 turns either off.
45
+ - `code_execution: gemini` lets a Gemini agent write and run Python in Google's sandbox (nothing runs on your machine). `context: { compact_after_tokens: 60000 }` on a delegate orchestrator summarizes a long conversation instead of overflowing it. `mode: task` on a workflow node makes its output its `finish_task` arguments.
46
+ - `openapi:` a list of OpenAPI 3 spec files (relative to the syndicate file) whose operations become the agent's tools; only GET operations unless `operations` names others; `auth` reads `bearer_env` or `api_key: {env, in, name}` from the environment. Read `weather.yaml` for the worked example.
43
47
  - `mcp_server_url:`: URL on a subagent to discover MCP tools at start. The melchizedek-serve skill covers MCP servers.
44
48
  - `generateContentConfig:`: per-agent options: `temperature`, `maxOutputTokens`, `responseMimeType: "application/json"`, and `thinkingConfig: { thinkingLevel: MEDIUM, includeThoughts: false }` on Gemini models that think. Thinking tokens count against `maxOutputTokens`. The Scribe uses 24576 for `maxOutputTokens`.
45
49
  - `outputSchema:`: a JSON schema using uppercase types (`OBJECT`, `STRING`, `INTEGER`, `BOOLEAN`, `ARRAY`) that the agent reply must satisfy.
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: melchizedek-memory
3
- description: Give a Melchizedek syndicate persistent sessions and long-term memory on Supabase: the memory_system modes, the two tables and the match function, the memory tools, extraction rules, inspection and erasure. Use when the user wants an agent to remember across runs, sets up Supabase for melchizedek, or asks why recall returns nothing.
3
+ description: "Give a Melchizedek syndicate persistent sessions and long-term memory on Supabase: the memory_system modes, the two tables and the match function, the memory tools, extraction rules, inspection and erasure. Use when the user wants an agent to remember across runs, sets up Supabase for melchizedek, or asks why recall returns nothing."
4
4
  ---
5
5
 
6
6
  ## The three memory modes
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: melchizedek-models
3
- description: Choose and wire a model for a Melchizedek agent: how a model id routes to Gemini, Claude, GPT, Grok, or local Ollama, which environment variable each needs, the gateway fallback, the doctor, and per-agent generation settings. Use when the user changes a model line, adds a provider key, sees Model not found or a gateway error, or asks which keys a syndicate needs.
3
+ description: "Choose and wire a model for a Melchizedek agent: how a model id routes to Gemini, Claude, GPT, Grok, or local Ollama, which environment variable each needs, the gateway fallback, the doctor, and per-agent generation settings. Use when the user changes a model line, adds a provider key, sees Model not found or a gateway error, or asks which keys a syndicate needs."
4
4
  ---
5
5
 
6
6
  ## How a model id routes
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: melchizedek-scribe
3
- description: Write a document from a technical brief with the Scribe syndicate: a README section, a skill file, product copy, a runbook. Use when the user wants prose generated from facts they supply, wants to write a SKILL.md, or mentions the scribe; covers the brief format, the one-shot run, capture, and review.
3
+ description: "Write a document from a technical brief with the Scribe syndicate: a README section, a skill file, product copy, a runbook. Use when the user wants prose generated from facts they supply, wants to write a SKILL.md, or mentions the scribe; covers the brief format, the one-shot run, capture, and review."
4
4
  ---
5
5
 
6
6
  ## What the Scribe is
@@ -20,7 +20,7 @@ A brief is plain text. The brief contains these parts, in any order, under any h
20
20
  - LIMITS: word or line caps, required headings, and forbidden constructions.
21
21
  - SOURCE MATERIAL: optional pasted text that the Scribe may quote.
22
22
 
23
- You gather facts from the code, the manifest, and the documentation at hand before running. Place the exact command with its flags under FACTS, and list the exact command again under IDENTIFIERS. A brief template ships with this skill at `templates/brief.md`.
23
+ You gather facts from the code, the manifest, and the documentation at hand before running. Place the exact command with its flags under FACTS, and list the exact command again under IDENTIFIERS. A brief template ships with this skill at `assets/brief.md`.
24
24
 
25
25
  ## Run it and capture the document
26
26
 
@@ -64,7 +64,7 @@ The Auditor catches most discrepancies. A person still reads the final result. I
64
64
  ## Writing a SKILL.md with it
65
65
 
66
66
  When you write a SKILL.md file with the Scribe, place these constraints under LIMITS:
67
- - The exact frontmatter block, with `name` equal to the directory name in lowercase with hyphens, and `description` under 1024 characters stating when to use the skill.
67
+ - The exact frontmatter block, with `name` equal to the directory name in lowercase with hyphens, and `description` in double quotes, under 1024 characters, stating when to use the skill.
68
68
  - The `##` headings in order.
69
69
  - A line cap.
70
70
  - The instruction: "every command in a fenced bash block".
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: melchizedek-serve
3
- description: Expose a Melchizedek syndicate over HTTP with the A2A server, call it from code, give a subagent tools from an MCP server, or serve your own tools as an MCP server. Use when the user mentions melchizedek-serve, A2A, an agent card, mcp_server_url, or wants a syndicate reachable from another application or agent.
3
+ description: "Expose a Melchizedek syndicate over HTTP with the A2A server, call it from code, give a subagent tools from an MCP server, or serve your own tools as an MCP server. Use when the user mentions melchizedek-serve, A2A, an agent card, mcp_server_url, or wants a syndicate reachable from another application or agent."
4
4
  ---
5
5
 
6
6
  ## Serve a syndicate over A2A