melchizedek-agents 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENT_SETUP.md +182 -0
- package/DOCUMENTATION.md +614 -0
- package/LICENSE +21 -0
- package/QUICKSTART.md +164 -0
- package/README.md +151 -0
- package/config/agents/README.md +27 -0
- package/config/agents/examples/ares.yaml +74 -0
- package/config/agents/examples/cartographers.yaml +115 -0
- package/config/agents/examples/claude.yaml +17 -0
- package/config/agents/examples/council.yaml +65 -0
- package/config/agents/examples/critic.yaml +74 -0
- package/config/agents/examples/delegation.yaml +29 -0
- package/config/agents/examples/hierarchical.yaml +26 -0
- package/config/agents/examples/image_production.yaml +112 -0
- package/config/agents/examples/librarian.yaml +75 -0
- package/config/agents/examples/model_zoo.yaml +81 -0
- package/config/agents/examples/patient_advocate.yaml +107 -0
- package/config/agents/examples/scriptorium.yaml +96 -0
- package/config/agents/examples/style_council.yaml +83 -0
- package/config/agents/examples/syndicate.yaml +34 -0
- package/config/agents/examples/tutor.yaml +66 -0
- package/config/agents/syndicateSchema.yaml +291 -0
- package/dist/lib/config.d.ts +108 -0
- package/dist/lib/config.js +110 -0
- package/dist/lib/dispatch.d.ts +133 -0
- package/dist/lib/dispatch.js +182 -0
- package/dist/lib/grounding.d.ts +28 -0
- package/dist/lib/grounding.js +61 -0
- package/dist/lib/index.d.ts +14 -0
- package/dist/lib/index.js +13 -0
- package/dist/lib/loadEnv.d.ts +21 -0
- package/dist/lib/loadEnv.js +58 -0
- package/dist/lib/loadSyndicate.d.ts +177 -0
- package/dist/lib/loadSyndicate.js +264 -0
- package/dist/lib/memory/supabaseMemoryService.d.ts +118 -0
- package/dist/lib/memory/supabaseMemoryService.js +499 -0
- package/dist/lib/models/claudeLlm.d.ts +93 -0
- package/dist/lib/models/claudeLlm.js +332 -0
- package/dist/lib/models/gptLlm.d.ts +110 -0
- package/dist/lib/models/gptLlm.js +497 -0
- package/dist/lib/models/grokLlm.d.ts +64 -0
- package/dist/lib/models/grokLlm.js +86 -0
- package/dist/lib/models/ollamaLlm.d.ts +105 -0
- package/dist/lib/models/ollamaLlm.js +134 -0
- package/dist/lib/models/openAiCompatibleLlm.d.ts +125 -0
- package/dist/lib/models/openAiCompatibleLlm.js +331 -0
- package/dist/lib/models/providerMap.d.ts +28 -0
- package/dist/lib/models/providerMap.js +45 -0
- package/dist/lib/models/registry.d.ts +71 -0
- package/dist/lib/models/registry.js +159 -0
- package/dist/lib/models/schemaNormalize.d.ts +22 -0
- package/dist/lib/models/schemaNormalize.js +58 -0
- package/dist/lib/observability/supabaseSpanExporter.d.ts +35 -0
- package/dist/lib/observability/supabaseSpanExporter.js +115 -0
- package/dist/lib/observability/tracer.d.ts +44 -0
- package/dist/lib/observability/tracer.js +242 -0
- package/dist/lib/persistence/supabaseProvider.d.ts +44 -0
- package/dist/lib/persistence/supabaseProvider.js +88 -0
- package/dist/lib/session/supabaseSessionService.d.ts +26 -0
- package/dist/lib/session/supabaseSessionService.js +193 -0
- package/dist/lib/session/transcript.d.ts +193 -0
- package/dist/lib/session/transcript.js +309 -0
- package/dist/lib/toolRegistry.d.ts +15 -0
- package/dist/lib/toolRegistry.js +58 -0
- package/dist/lib/tools/collectionsSearchTool.d.ts +55 -0
- package/dist/lib/tools/collectionsSearchTool.js +86 -0
- package/dist/lib/tools/generateImageTool.d.ts +16 -0
- package/dist/lib/tools/generateImageTool.js +119 -0
- package/dist/lib/tools/inspectImageTool.d.ts +21 -0
- package/dist/lib/tools/inspectImageTool.js +97 -0
- package/dist/lib/tools/mcpToolFactory.d.ts +2 -0
- package/dist/lib/tools/mcpToolFactory.js +116 -0
- package/dist/lib/tools/toolContract.d.ts +78 -0
- package/dist/lib/tools/toolContract.js +129 -0
- package/dist/lib/tools/webExtractTool.d.ts +70 -0
- package/dist/lib/tools/webExtractTool.js +461 -0
- package/dist/lib/tools/webSearchTool.d.ts +53 -0
- package/dist/lib/tools/webSearchTool.js +126 -0
- package/dist/lib/tools/wikiTools.d.ts +112 -0
- package/dist/lib/tools/wikiTools.js +697 -0
- package/dist/lib/tools/xSearchTool.d.ts +61 -0
- package/dist/lib/tools/xSearchTool.js +125 -0
- package/dist/lib/wiki/agentRun.d.ts +39 -0
- package/dist/lib/wiki/agentRun.js +79 -0
- package/dist/lib/wiki/builder.d.ts +71 -0
- package/dist/lib/wiki/builder.js +165 -0
- package/dist/lib/wiki/dive.d.ts +56 -0
- package/dist/lib/wiki/dive.js +208 -0
- package/dist/lib/wiki/entities.d.ts +220 -0
- package/dist/lib/wiki/entities.js +661 -0
- package/dist/lib/wiki/extract.d.ts +97 -0
- package/dist/lib/wiki/extract.js +305 -0
- package/dist/lib/wiki/fill.d.ts +37 -0
- package/dist/lib/wiki/fill.js +175 -0
- package/dist/lib/wiki/format.d.ts +132 -0
- package/dist/lib/wiki/format.js +177 -0
- package/dist/lib/wiki/graph.d.ts +80 -0
- package/dist/lib/wiki/graph.js +147 -0
- package/dist/lib/wiki/lint.d.ts +58 -0
- package/dist/lib/wiki/lint.js +267 -0
- package/dist/lib/wiki/markdown.d.ts +127 -0
- package/dist/lib/wiki/markdown.js +336 -0
- package/dist/lib/wiki/pipeline.d.ts +69 -0
- package/dist/lib/wiki/pipeline.js +119 -0
- package/dist/lib/wiki/vault.d.ts +84 -0
- package/dist/lib/wiki/vault.js +194 -0
- package/dist/scripts/a2a_server.d.ts +2 -0
- package/dist/scripts/a2a_server.js +997 -0
- package/dist/scripts/syndicate_chat.d.ts +2 -0
- package/dist/scripts/syndicate_chat.js +485 -0
- package/package.json +96 -0
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* lib/tools/wikiTools.ts — the wiki's tool surface, defined once.
|
|
3
|
+
*
|
|
4
|
+
* WHY this file exists:
|
|
5
|
+
* Everything an agent (or MCP client) can DO with the knowledge bundle is
|
|
6
|
+
* a ToolContract here — zod schema single source of truth, derived into
|
|
7
|
+
* ADK FunctionTools for syndicate agents and MCP definitions for outside
|
|
8
|
+
* clients, exactly like the rest of lib/tools.
|
|
9
|
+
*
|
|
10
|
+
* Three capability tiers, deliberately separated:
|
|
11
|
+
*
|
|
12
|
+
* NAVIGATE (wiki_map, wiki_read, wiki_search, wiki_links, wiki_dive,
|
|
13
|
+
* wiki_graph) — pure functions over the bundle. No model, no writes,
|
|
14
|
+
* instant. These are what "repo dive" means: an agent on a knowledge
|
|
15
|
+
* task orients, searches, follows links, and gets an ordered reading
|
|
16
|
+
* plan. wiki_graph adds the second layer — the ENTITY graph of agents,
|
|
17
|
+
* tools, models, modules, tables and env vars derived from repo truth
|
|
18
|
+
* (lib/wiki/entities.ts) — which answers relational questions no
|
|
19
|
+
* amount of document search can ("who calls this tool").
|
|
20
|
+
*
|
|
21
|
+
* WRITE (wiki_save, wiki_relate) — the only two write paths, both gated.
|
|
22
|
+
* wiki_save: parse → profile validation → lint (errors block,
|
|
23
|
+
* including the private-closure rule) → path-jailed write → directory
|
|
24
|
+
* index refresh → log.md entry. wiki_relate: one asserted relation,
|
|
25
|
+
* refused unless the relation is an INFERRED one (structural relations
|
|
26
|
+
* are derived by the build), both endpoints exist, no public document
|
|
27
|
+
* points into the private annex, and evidence is supplied. Agents
|
|
28
|
+
* cannot corrupt the bundle through either door; the worst they can do
|
|
29
|
+
* is write mediocre prose, which lint's warnings surface and git can
|
|
30
|
+
* revert.
|
|
31
|
+
*
|
|
32
|
+
* AGENTIC (wiki_query, wiki_garden) — composites that put a model in
|
|
33
|
+
* the loop, running a one-shot agent equipped with the tier-1 (and for
|
|
34
|
+
* garden, tier-2) tools. Exposed so an MCP client can ask the wiki a
|
|
35
|
+
* question or delegate an edit as ONE call.
|
|
36
|
+
*
|
|
37
|
+
* Exposure stays deliberate (the registry/server decide); defining these
|
|
38
|
+
* contracts publishes nothing by itself.
|
|
39
|
+
*/
|
|
40
|
+
import { z } from 'zod';
|
|
41
|
+
import { type ToolContract } from './toolContract.ts';
|
|
42
|
+
export declare const wikiMapContract: ToolContract<z.ZodObject<{}, z.core.$strip>>;
|
|
43
|
+
export declare const wikiReadContract: ToolContract<z.ZodObject<{
|
|
44
|
+
path: z.ZodString;
|
|
45
|
+
section: z.ZodOptional<z.ZodString>;
|
|
46
|
+
}, z.core.$strip>>;
|
|
47
|
+
export declare const wikiSearchContract: ToolContract<z.ZodObject<{
|
|
48
|
+
query: z.ZodString;
|
|
49
|
+
limit: z.ZodDefault<z.ZodNumber>;
|
|
50
|
+
}, z.core.$strip>>;
|
|
51
|
+
export declare const wikiLinksContract: ToolContract<z.ZodObject<{
|
|
52
|
+
path: z.ZodString;
|
|
53
|
+
depth: z.ZodDefault<z.ZodNumber>;
|
|
54
|
+
direction: z.ZodDefault<z.ZodEnum<{
|
|
55
|
+
in: "in";
|
|
56
|
+
out: "out";
|
|
57
|
+
both: "both";
|
|
58
|
+
}>>;
|
|
59
|
+
}, z.core.$strip>>;
|
|
60
|
+
export declare const wikiDiveContract: ToolContract<z.ZodObject<{
|
|
61
|
+
task: z.ZodString;
|
|
62
|
+
budget_words: z.ZodDefault<z.ZodNumber>;
|
|
63
|
+
}, z.core.$strip>>;
|
|
64
|
+
export declare const wikiGraphContract: ToolContract<z.ZodObject<{
|
|
65
|
+
node: z.ZodOptional<z.ZodString>;
|
|
66
|
+
find: z.ZodOptional<z.ZodString>;
|
|
67
|
+
kind: z.ZodOptional<z.ZodString>;
|
|
68
|
+
path_to: z.ZodOptional<z.ZodString>;
|
|
69
|
+
relations: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
70
|
+
depth: z.ZodDefault<z.ZodNumber>;
|
|
71
|
+
direction: z.ZodDefault<z.ZodEnum<{
|
|
72
|
+
in: "in";
|
|
73
|
+
out: "out";
|
|
74
|
+
both: "both";
|
|
75
|
+
}>>;
|
|
76
|
+
limit: z.ZodDefault<z.ZodNumber>;
|
|
77
|
+
}, z.core.$strip>>;
|
|
78
|
+
export declare const wikiRelateContract: ToolContract<z.ZodObject<{
|
|
79
|
+
from: z.ZodString;
|
|
80
|
+
to: z.ZodString;
|
|
81
|
+
relation: z.ZodString;
|
|
82
|
+
evidence: z.ZodString;
|
|
83
|
+
actor: z.ZodString;
|
|
84
|
+
note: z.ZodOptional<z.ZodString>;
|
|
85
|
+
}, z.core.$strip>>;
|
|
86
|
+
export declare const wikiSaveContract: ToolContract<z.ZodObject<{
|
|
87
|
+
path: z.ZodString;
|
|
88
|
+
content: z.ZodString;
|
|
89
|
+
actor: z.ZodString;
|
|
90
|
+
summary: z.ZodString;
|
|
91
|
+
}, z.core.$strip>>;
|
|
92
|
+
export declare const wikiQueryContract: ToolContract<z.ZodObject<{
|
|
93
|
+
question: z.ZodString;
|
|
94
|
+
model: z.ZodOptional<z.ZodString>;
|
|
95
|
+
}, z.core.$strip>>;
|
|
96
|
+
export declare const wikiGardenContract: ToolContract<z.ZodObject<{
|
|
97
|
+
instruction: z.ZodString;
|
|
98
|
+
model: z.ZodOptional<z.ZodString>;
|
|
99
|
+
}, z.core.$strip>>;
|
|
100
|
+
/** Everything an MCP client may be offered (see the wiki MCP server script). */
|
|
101
|
+
export declare const WIKI_TOOL_CONTRACTS: readonly ToolContract<any>[];
|
|
102
|
+
/**
|
|
103
|
+
* What syndicate agents may declare in YAML (via lib/toolRegistry.ts).
|
|
104
|
+
* The agentic composites are excluded on purpose: a syndicate reaches
|
|
105
|
+
* query/garden behavior by BEING the agent with these primitives, not by
|
|
106
|
+
* nesting another agent run inside a tool call.
|
|
107
|
+
*/
|
|
108
|
+
export declare const WIKI_AGENT_TOOL_CONTRACTS: readonly ToolContract<any>[];
|
|
109
|
+
/** Lint the whole bundle — shared by the build script and tests. */
|
|
110
|
+
export declare function lintWholeVault(): string;
|
|
111
|
+
/** Census helper for scripts (not a tool): concepts + word count. */
|
|
112
|
+
export declare function vaultCensus(): string;
|