melchizedek-agents 0.9.6 → 0.16.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/.env.example +272 -0
- package/AGENT_SETUP.md +39 -23
- package/CHANGELOG.md +623 -0
- package/DOCUMENTATION.md +429 -109
- package/QUICKSTART.md +92 -18
- package/README.md +45 -5
- package/config/agents/README.md +46 -1
- package/config/agents/examples/ares.yaml +117 -40
- package/config/agents/examples/assistant.yaml +159 -0
- package/config/agents/examples/augustin.yaml +154 -51
- package/config/agents/examples/cartographers.yaml +91 -23
- package/config/agents/examples/claude.yaml +45 -6
- package/config/agents/examples/council.yaml +23 -8
- package/config/agents/examples/critic.yaml +57 -21
- package/config/agents/examples/delegation.yaml +76 -9
- package/config/agents/examples/hierarchical.yaml +55 -8
- package/config/agents/examples/image_production.yaml +54 -16
- package/config/agents/examples/librarian.yaml +70 -14
- package/config/agents/examples/model_zoo.yaml +105 -29
- package/config/agents/examples/patient_advocate.yaml +102 -34
- package/config/agents/examples/research.yaml +250 -0
- package/config/agents/examples/scribe.yaml +242 -0
- package/config/agents/examples/scriptorium.yaml +87 -24
- package/config/agents/examples/style_council.yaml +31 -9
- package/config/agents/examples/syndicate.yaml +29 -10
- package/config/agents/examples/tutor.yaml +10 -3
- package/config/agents/syndicateSchema.yaml +44 -9
- package/config/agents/templates/README.md +58 -0
- package/config/agents/templates/account_memory.yaml +153 -0
- package/config/agents/templates/case_desk.yaml +188 -0
- package/config/agents/templates/conversational.yaml +110 -0
- package/config/agents/templates/draft_review.yaml +130 -0
- package/config/agents/templates/intake_extractor.yaml +152 -0
- package/config/agents/templates/research_brief.yaml +169 -0
- package/config/agents/templates/research_desk.yaml +152 -0
- package/config/agents/templates/review_panel.yaml +188 -0
- package/config/agents/templates/support_triage.yaml +273 -0
- package/config/agents/templates/systems_operator.yaml +157 -0
- package/db/hardening.sql +202 -0
- package/db/memory_v2.sql +77 -0
- package/db/migrations/0001_base.sql +167 -0
- package/db/migrations/0002_erase_scope.sql +172 -0
- package/db/migrations/0003_postgres_storage.sql +58 -0
- package/db/migrations/0004_usage.sql +94 -0
- package/db/migrations/0005_agent_registry.sql +200 -0
- package/db/migrations/0006_task_leases.sql +25 -0
- package/db/migrations/0007_memory_commit.sql +134 -0
- package/db/migrations/0008_memory_retention.sql +37 -0
- package/db/migrations/0009_task_queue.sql +51 -0
- package/db/migrations/0010_erase_complete.sql +180 -0
- package/db/telemetry.sql +401 -0
- package/demo/README.md +77 -0
- package/demo/a2a_demo.mjs +95 -0
- package/dist/lib/a2a/app.d.ts +253 -0
- package/dist/lib/a2a/app.js +751 -0
- package/dist/lib/a2a/executor.d.ts +167 -0
- package/dist/lib/a2a/executor.js +548 -0
- package/dist/lib/a2a/identity.d.ts +122 -0
- package/dist/lib/a2a/identity.js +254 -0
- package/dist/lib/a2a/policy.d.ts +110 -0
- package/dist/lib/a2a/policy.js +178 -0
- package/dist/lib/a2a/redisLimits.d.ts +26 -0
- package/dist/lib/a2a/redisLimits.js +31 -0
- package/dist/lib/a2a/remoteAgent.d.ts +91 -0
- package/dist/lib/a2a/remoteAgent.js +268 -0
- package/dist/lib/a2a/turnLock.d.ts +28 -0
- package/dist/lib/a2a/turnLock.js +76 -0
- package/dist/lib/compile.d.ts +11 -1
- package/dist/lib/compile.js +109 -8
- package/dist/lib/config.d.ts +7 -7
- package/dist/lib/config.js +7 -7
- package/dist/lib/doctor.d.ts +145 -0
- package/dist/lib/doctor.js +517 -0
- package/dist/lib/grounding.d.ts +2 -2
- package/dist/lib/grounding.js +2 -2
- package/dist/lib/guards/index.d.ts +37 -0
- package/dist/lib/guards/index.js +66 -0
- package/dist/lib/guards/science.d.ts +117 -0
- package/dist/lib/guards/science.js +444 -0
- package/dist/lib/index.d.ts +37 -2
- package/dist/lib/index.js +35 -4
- package/dist/lib/loadEnv.d.ts +23 -11
- package/dist/lib/loadEnv.js +77 -29
- package/dist/lib/loadSyndicate.d.ts +97 -5
- package/dist/lib/loadSyndicate.js +176 -76
- package/dist/lib/memory/erase.d.ts +24 -0
- package/dist/lib/memory/erase.js +47 -0
- package/dist/lib/memory/namespace.d.ts +37 -0
- package/dist/lib/memory/namespace.js +74 -0
- package/dist/lib/memory/providers.d.ts +99 -0
- package/dist/lib/memory/providers.js +240 -0
- package/dist/lib/memory/store.d.ts +74 -0
- package/dist/lib/memory/store.js +108 -0
- package/dist/lib/memory/supabaseMemoryService.d.ts +69 -9
- package/dist/lib/memory/supabaseMemoryService.js +239 -125
- package/dist/lib/models/capabilities.d.ts +103 -0
- package/dist/lib/models/capabilities.js +291 -0
- package/dist/lib/models/claudeLlm.d.ts +10 -1
- package/dist/lib/models/claudeLlm.js +57 -27
- package/dist/lib/models/endpoints.d.ts +100 -0
- package/dist/lib/models/endpoints.js +282 -0
- package/dist/lib/models/gateway.d.ts +107 -0
- package/dist/lib/models/gateway.js +157 -0
- package/dist/lib/models/gatewayLlm.d.ts +57 -0
- package/dist/lib/models/gatewayLlm.js +105 -0
- package/dist/lib/models/gptLlm.d.ts +51 -2
- package/dist/lib/models/gptLlm.js +169 -26
- package/dist/lib/models/grokLlm.d.ts +19 -10
- package/dist/lib/models/grokLlm.js +29 -14
- package/dist/lib/models/ollamaLlm.d.ts +26 -0
- package/dist/lib/models/ollamaLlm.js +43 -1
- package/dist/lib/models/openAiCompatibleLlm.d.ts +67 -2
- package/dist/lib/models/openAiCompatibleLlm.js +200 -37
- package/dist/lib/models/providerMap.js +9 -2
- package/dist/lib/models/registry.d.ts +42 -5
- package/dist/lib/models/registry.js +140 -29
- package/dist/lib/models/retry.d.ts +146 -0
- package/dist/lib/models/retry.js +305 -0
- package/dist/lib/models/schemaNormalize.d.ts +20 -0
- package/dist/lib/models/schemaNormalize.js +43 -0
- package/dist/lib/net/addressGuard.d.ts +60 -0
- package/dist/lib/net/addressGuard.js +216 -0
- package/dist/lib/observability/embeddings.d.ts +11 -2
- package/dist/lib/observability/embeddings.js +18 -14
- package/dist/lib/observability/metrics.d.ts +36 -0
- package/dist/lib/observability/metrics.js +86 -0
- package/dist/lib/observability/redact.d.ts +29 -0
- package/dist/lib/observability/redact.js +102 -0
- package/dist/lib/observability/supabaseSpanExporter.d.ts +2 -0
- package/dist/lib/observability/supabaseSpanExporter.js +22 -6
- package/dist/lib/observability/tracer.d.ts +10 -0
- package/dist/lib/observability/tracer.js +70 -3
- package/dist/lib/persistence/supabaseProvider.d.ts +11 -0
- package/dist/lib/persistence/supabaseProvider.js +32 -6
- package/dist/lib/registry.d.ts +87 -0
- package/dist/lib/registry.js +146 -0
- package/dist/lib/runtime/approvals.d.ts +44 -0
- package/dist/lib/runtime/approvals.js +67 -0
- package/dist/lib/runtime/syndicateTurn.d.ts +233 -0
- package/dist/lib/runtime/syndicateTurn.js +597 -0
- package/dist/lib/runtime/turnControl.d.ts +90 -0
- package/dist/lib/runtime/turnControl.js +131 -0
- package/dist/lib/session/supabaseSessionService.js +1 -1
- package/dist/lib/session/transcript.d.ts +9 -1
- package/dist/lib/session/transcript.js +15 -7
- package/dist/lib/skills.d.ts +50 -0
- package/dist/lib/skills.js +138 -0
- package/dist/lib/storage/postgres/index.d.ts +98 -0
- package/dist/lib/storage/postgres/index.js +146 -0
- package/dist/lib/storage/postgres/memoryStore.d.ts +11 -0
- package/dist/lib/storage/postgres/memoryStore.js +82 -0
- package/dist/lib/storage/postgres/sessionService.d.ts +51 -0
- package/dist/lib/storage/postgres/sessionService.js +225 -0
- package/dist/lib/storage/postgres/taskQueue.d.ts +22 -0
- package/dist/lib/storage/postgres/taskQueue.js +101 -0
- package/dist/lib/storage/postgres/taskStore.d.ts +55 -0
- package/dist/lib/storage/postgres/taskStore.js +168 -0
- package/dist/lib/storage/schema.d.ts +27 -0
- package/dist/lib/storage/schema.js +50 -0
- package/dist/lib/storage/schemaVersion.d.ts +25 -0
- package/dist/lib/storage/schemaVersion.js +46 -0
- package/dist/lib/syndicateSchema.d.ts +275 -0
- package/dist/lib/syndicateSchema.js +534 -0
- package/dist/lib/toolRegistry.d.ts +15 -0
- package/dist/lib/toolRegistry.js +59 -10
- package/dist/lib/tools/collectionsSearchTool.js +1 -1
- package/dist/lib/tools/mcpServe.d.ts +45 -0
- package/dist/lib/tools/mcpServe.js +88 -0
- package/dist/lib/tools/mcpToolFactory.d.ts +2 -0
- package/dist/lib/tools/mcpToolFactory.js +41 -21
- package/dist/lib/tools/science/corrections.d.ts +42 -0
- package/dist/lib/tools/science/corrections.js +115 -0
- package/dist/lib/tools/science/europepmc.d.ts +51 -0
- package/dist/lib/tools/science/europepmc.js +127 -0
- package/dist/lib/tools/science/http.d.ts +31 -0
- package/dist/lib/tools/science/http.js +104 -0
- package/dist/lib/tools/science/openalex.d.ts +30 -0
- package/dist/lib/tools/science/openalex.js +81 -0
- package/dist/lib/tools/science/trials.d.ts +58 -0
- package/dist/lib/tools/science/trials.js +203 -0
- package/dist/lib/tools/science/types.d.ts +69 -0
- package/dist/lib/tools/science/types.js +48 -0
- package/dist/lib/tools/scienceTools.d.ts +100 -0
- package/dist/lib/tools/scienceTools.js +277 -0
- package/dist/lib/tools/taskTools.d.ts +204 -0
- package/dist/lib/tools/taskTools.js +374 -0
- package/dist/lib/tools/toolContract.d.ts +17 -4
- package/dist/lib/tools/toolContract.js +13 -5
- package/dist/lib/tools/webExtractTool.d.ts +13 -10
- package/dist/lib/tools/webExtractTool.js +23 -55
- package/dist/lib/tools/webSearchTool.d.ts +2 -1
- package/dist/lib/tools/webSearchTool.js +4 -3
- package/dist/lib/tools/wikiTools.d.ts +2 -2
- package/dist/lib/tools/wikiTools.js +12 -12
- package/dist/lib/tools/xApiSearchTool.d.ts +194 -0
- package/dist/lib/tools/xApiSearchTool.js +583 -0
- package/dist/lib/tools/xSearchTool.js +1 -1
- package/dist/lib/wiki/agentRun.js +1 -1
- package/dist/lib/wiki/builder.js +21 -6
- package/dist/lib/wiki/dive.js +2 -2
- package/dist/lib/wiki/entities.d.ts +2 -2
- package/dist/lib/wiki/entities.js +7 -7
- package/dist/lib/wiki/extract.js +5 -1
- package/dist/lib/wiki/fill.js +5 -5
- package/dist/lib/wiki/format.d.ts +7 -5
- package/dist/lib/wiki/format.js +2 -2
- package/dist/lib/wiki/graph.js +2 -2
- package/dist/lib/wiki/lint.js +2 -2
- package/dist/lib/wiki/markdown.d.ts +1 -1
- package/dist/lib/wiki/markdown.js +6 -1
- package/dist/lib/wiki/pipeline.js +2 -2
- package/dist/lib/wiki/vault.js +2 -2
- package/dist/scripts/a2a_server.d.ts +17 -11
- package/dist/scripts/a2a_server.js +405 -1028
- package/dist/scripts/assistant_worker.d.ts +33 -0
- package/dist/scripts/assistant_worker.js +193 -0
- package/dist/scripts/db.d.ts +26 -0
- package/dist/scripts/db.js +179 -0
- package/dist/scripts/doctor.d.ts +23 -0
- package/dist/scripts/doctor.js +90 -0
- package/dist/scripts/init.d.ts +43 -0
- package/dist/scripts/init.js +152 -0
- package/dist/scripts/registry.d.ts +25 -0
- package/dist/scripts/registry.js +182 -0
- package/dist/scripts/skills_install.d.ts +7 -0
- package/dist/scripts/skills_install.js +137 -0
- package/dist/scripts/syndicate_chat.js +159 -276
- package/package.json +90 -16
- package/skills/README.md +74 -0
- package/skills/briefs/README.md +16 -0
- package/skills/briefs/_shared.md +16 -0
- package/skills/briefs/melchizedek-author.md +60 -0
- package/skills/briefs/melchizedek-memory.md +47 -0
- package/skills/briefs/melchizedek-models.md +47 -0
- package/skills/briefs/melchizedek-scribe.md +37 -0
- package/skills/briefs/melchizedek-serve.md +56 -0
- package/skills/briefs/melchizedek.md +69 -0
- package/skills/briefs/skills-readme.md +33 -0
- package/skills/melchizedek/SKILL.md +159 -0
- package/skills/melchizedek-author/SKILL.md +99 -0
- package/skills/melchizedek-author/templates/minimal.yaml +60 -0
- package/skills/melchizedek-memory/SKILL.md +138 -0
- package/skills/melchizedek-models/SKILL.md +137 -0
- package/skills/melchizedek-scribe/SKILL.md +72 -0
- package/skills/melchizedek-scribe/templates/brief.md +27 -0
- package/skills/melchizedek-serve/SKILL.md +119 -0
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* lib/wiki/graph.ts derives ONE graph: documents joined by markdown
|
|
6
6
|
* links. That graph answers "what should I read next", but it cannot
|
|
7
7
|
* answer "which syndicates call web_search", "what breaks without
|
|
8
|
-
* XAI_API_KEY", or "which decision constrains the
|
|
8
|
+
* XAI_API_KEY", or "which decision constrains the memory schema" —
|
|
9
9
|
* because the things those questions name (agents, tools, models,
|
|
10
10
|
* tables, env vars, decisions) are not documents. They are ENTITIES,
|
|
11
11
|
* and the relations between them are typed, not hyperlinks.
|
|
@@ -146,7 +146,7 @@ export declare function lintEntityGraph(graph: EntityGraph): GraphFinding[];
|
|
|
146
146
|
/**
|
|
147
147
|
* Both stores live in a dot-directory inside the bundle: the vault walker
|
|
148
148
|
* skips dotfiles, so they are invisible to every document operation, they
|
|
149
|
-
* travel with WIKI_ROOT, and the
|
|
149
|
+
* travel with WIKI_ROOT, and publishing the bundle as markdown (*.md only)
|
|
150
150
|
* cannot ship them by accident.
|
|
151
151
|
*/
|
|
152
152
|
export declare function graphDir(wikiRoot: string): string;
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* lib/wiki/graph.ts derives ONE graph: documents joined by markdown
|
|
6
6
|
* links. That graph answers "what should I read next", but it cannot
|
|
7
7
|
* answer "which syndicates call web_search", "what breaks without
|
|
8
|
-
* XAI_API_KEY", or "which decision constrains the
|
|
8
|
+
* XAI_API_KEY", or "which decision constrains the memory schema" —
|
|
9
9
|
* because the things those questions name (agents, tools, models,
|
|
10
10
|
* tables, env vars, decisions) are not documents. They are ENTITIES,
|
|
11
11
|
* and the relations between them are typed, not hyperlinks.
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
import { existsSync, mkdirSync, readFileSync, writeFileSync } from 'node:fs';
|
|
35
35
|
import { dirname, join } from 'node:path';
|
|
36
36
|
import { z } from 'zod';
|
|
37
|
-
import { isPrivatePath } from
|
|
37
|
+
import { isPrivatePath } from './format.js';
|
|
38
38
|
// ── Node vocabulary ──────────────────────────────────────────────────────────
|
|
39
39
|
/**
|
|
40
40
|
* What kinds of thing this graph knows about. A document keeps its OKF
|
|
@@ -84,7 +84,7 @@ export const RELATIONS = {
|
|
|
84
84
|
// that is not a table). The generic structural relations below are left
|
|
85
85
|
// open, because what "contains" or "runs" what differs per repo — a
|
|
86
86
|
// syndicate contains agents here, a collection contains entries on a
|
|
87
|
-
// site, a
|
|
87
|
+
// site, a worker process runs a script on a host.
|
|
88
88
|
contains: {
|
|
89
89
|
tier: 'extracted',
|
|
90
90
|
phrase: 'contains',
|
|
@@ -149,7 +149,7 @@ export const RELATIONS = {
|
|
|
149
149
|
runs: {
|
|
150
150
|
tier: 'extracted',
|
|
151
151
|
phrase: 'runs',
|
|
152
|
-
gloss: 'an entrypoint — a script, a process, a
|
|
152
|
+
gloss: 'an entrypoint — a script, a process, a worker — executes this',
|
|
153
153
|
},
|
|
154
154
|
documents: {
|
|
155
155
|
tier: 'extracted',
|
|
@@ -509,8 +509,8 @@ export function lintEntityGraph(graph) {
|
|
|
509
509
|
// The closure rule mirrors the DOCUMENT invariant exactly: what gets
|
|
510
510
|
// published is the bundle, so a public DOCUMENT may never point into
|
|
511
511
|
// private knowledge. Code-to-code edges are out of scope here — a
|
|
512
|
-
// public module importing a private one is a real fact of
|
|
513
|
-
//
|
|
512
|
+
// public module importing a private one is a real fact of a codebase,
|
|
513
|
+
// governed by what the codebase publishes, not by this graph.
|
|
514
514
|
if (from.kind === 'doc' && !isPrivateNode(from) && isPrivateNode(to)) {
|
|
515
515
|
findings.push({
|
|
516
516
|
severity: 'error',
|
|
@@ -532,7 +532,7 @@ export function lintEntityGraph(graph) {
|
|
|
532
532
|
/**
|
|
533
533
|
* Both stores live in a dot-directory inside the bundle: the vault walker
|
|
534
534
|
* skips dotfiles, so they are invisible to every document operation, they
|
|
535
|
-
* travel with WIKI_ROOT, and the
|
|
535
|
+
* travel with WIKI_ROOT, and publishing the bundle as markdown (*.md only)
|
|
536
536
|
* cannot ship them by accident.
|
|
537
537
|
*/
|
|
538
538
|
export function graphDir(wikiRoot) {
|
package/dist/lib/wiki/extract.js
CHANGED
|
@@ -69,6 +69,10 @@ const BARE_IMPORT_RE = /(?:^|\n)\s*import\s+['"]([^'"\n]+)['"]/g;
|
|
|
69
69
|
const DYNAMIC_IMPORT_RE = /\bimport\(\s*['"]([^'"\n]+)['"]\s*\)/g;
|
|
70
70
|
const ENV_DOT_RE = /process\.env\.([A-Za-z_][A-Za-z0-9_]*)/g;
|
|
71
71
|
const ENV_INDEX_RE = /process\.env\[\s*['"]([A-Za-z_][A-Za-z0-9_]*)['"]\s*\]/g;
|
|
72
|
+
// An injected environment (`env: NodeJS.ProcessEnv = process.env`, the
|
|
73
|
+
// testable form) is read as `env.NAME`. Upper-case names only, so an
|
|
74
|
+
// ordinary object property never reads as a variable.
|
|
75
|
+
const ENV_PARAM_RE = /(?<![\w.])env\.([A-Z][A-Z0-9_]{2,})\b/g;
|
|
72
76
|
/** Resolve a relative specifier against the importing file's repo path. */
|
|
73
77
|
export function resolveLocalImport(fromRelPath, specifier) {
|
|
74
78
|
if (!specifier.startsWith('.'))
|
|
@@ -93,7 +97,7 @@ export function scanModule(text, relPath) {
|
|
|
93
97
|
specifiers.add(match[1]);
|
|
94
98
|
}
|
|
95
99
|
const envVars = new Set();
|
|
96
|
-
for (const re of [ENV_DOT_RE, ENV_INDEX_RE]) {
|
|
100
|
+
for (const re of [ENV_DOT_RE, ENV_INDEX_RE, ENV_PARAM_RE]) {
|
|
97
101
|
re.lastIndex = 0;
|
|
98
102
|
let match;
|
|
99
103
|
while ((match = re.exec(text)) !== null)
|
package/dist/lib/wiki/fill.js
CHANGED
|
@@ -19,11 +19,11 @@
|
|
|
19
19
|
*/
|
|
20
20
|
import { existsSync, readFileSync } from 'node:fs';
|
|
21
21
|
import { resolve } from 'node:path';
|
|
22
|
-
import { runWikiAgent, modelAvailable } from
|
|
23
|
-
import { llmActor } from
|
|
24
|
-
import { buildGraph } from
|
|
25
|
-
import { emitFrontmatter, parseDoc, setSlotContent, slotIsUnfilled, TODO_SENTINEL, } from
|
|
26
|
-
import { loadDoc, writeDocFile } from
|
|
22
|
+
import { runWikiAgent, modelAvailable } from './agentRun.js';
|
|
23
|
+
import { llmActor } from './format.js';
|
|
24
|
+
import { buildGraph } from './graph.js';
|
|
25
|
+
import { emitFrontmatter, parseDoc, setSlotContent, slotIsUnfilled, TODO_SENTINEL, } from './markdown.js';
|
|
26
|
+
import { loadDoc, writeDocFile } from './vault.js';
|
|
27
27
|
// ── Prompt assembly ──────────────────────────────────────────────────────────
|
|
28
28
|
const WRITER_INSTRUCTION = `You write missing prose for knowledge-base documents about a software system.
|
|
29
29
|
You receive one document, the id of one empty slot in it, a hint describing what belongs there, link candidates, and source excerpts.
|
|
@@ -30,12 +30,12 @@ import { z } from 'zod';
|
|
|
30
30
|
/** OKF spec version this profile targets. Written to the root index.md. */
|
|
31
31
|
export declare const OKF_VERSION = "0.2";
|
|
32
32
|
/** Reserved filenames (§3.1) — never concept documents. */
|
|
33
|
-
export declare const RESERVED_FILENAMES: readonly [
|
|
33
|
+
export declare const RESERVED_FILENAMES: readonly ['index.md', 'log.md'];
|
|
34
34
|
export declare function isReservedFilename(fileName: string): boolean;
|
|
35
35
|
/**
|
|
36
36
|
* The subtree that never leaves this repo. Path-based visibility: a doc is
|
|
37
|
-
* private iff its bundle path starts with this prefix.
|
|
38
|
-
*
|
|
37
|
+
* private iff its bundle path starts with this prefix. Whatever publishes
|
|
38
|
+
* the bundle copies it WITHOUT this subtree, and lint's closure rule forbids
|
|
39
39
|
* docs outside it from linking into it — so the published bundle is
|
|
40
40
|
* link-closed by construction (see wiki/decisions/0003.)
|
|
41
41
|
*/
|
|
@@ -46,7 +46,7 @@ export declare function isPrivatePath(bundlePath: string): boolean;
|
|
|
46
46
|
* tolerate unknown types (§11), so this list steers authors without
|
|
47
47
|
* rejecting anything — lint reports an unknown type as INFO, not an error.
|
|
48
48
|
*/
|
|
49
|
-
export declare const CONCEPT_TYPES: readonly [
|
|
49
|
+
export declare const CONCEPT_TYPES: readonly ['overview', 'subsystem', 'syndicate', 'tool', 'model-provider', 'schema', 'protocol', 'runbook', 'guide', 'decision', 'doctrine', 'reference', 'meta'];
|
|
50
50
|
export type ConceptType = (typeof CONCEPT_TYPES)[number];
|
|
51
51
|
/** `human:<id>` | `process:<id>` | `<producer>/<version>` */
|
|
52
52
|
export declare const actorSchema: z.ZodString;
|
|
@@ -126,7 +126,9 @@ export declare function effectiveStatus(fm: ConceptFrontmatter): 'draft' | 'stab
|
|
|
126
126
|
/** Stale when today >= stale_after (§5.5). `today` is YYYY-MM-DD. */
|
|
127
127
|
export declare function isStale(fm: ConceptFrontmatter, today: string): boolean;
|
|
128
128
|
/** Operations recorded in log.md, one `## [date] op | summary` entry each. */
|
|
129
|
-
export declare const LOG_OPS: readonly [
|
|
129
|
+
export declare const LOG_OPS: readonly ['init', 'build', 'fill', 'garden', 'ingest', 'lint',
|
|
130
|
+
/** One asserted relation added to the entity graph (lib/wiki/entities.ts). */
|
|
131
|
+
'relate'];
|
|
130
132
|
export type LogOp = (typeof LOG_OPS)[number];
|
|
131
133
|
export declare const LOG_ENTRY_RE: RegExp;
|
|
132
134
|
export declare function formatLogEntry(date: string, op: LogOp, summary: string, detail?: string): string;
|
package/dist/lib/wiki/format.js
CHANGED
|
@@ -37,8 +37,8 @@ export function isReservedFilename(fileName) {
|
|
|
37
37
|
}
|
|
38
38
|
/**
|
|
39
39
|
* The subtree that never leaves this repo. Path-based visibility: a doc is
|
|
40
|
-
* private iff its bundle path starts with this prefix.
|
|
41
|
-
*
|
|
40
|
+
* private iff its bundle path starts with this prefix. Whatever publishes
|
|
41
|
+
* the bundle copies it WITHOUT this subtree, and lint's closure rule forbids
|
|
42
42
|
* docs outside it from linking into it — so the published bundle is
|
|
43
43
|
* link-closed by construction (see wiki/decisions/0003.)
|
|
44
44
|
*/
|
package/dist/lib/wiki/graph.js
CHANGED
|
@@ -14,8 +14,8 @@
|
|
|
14
14
|
* index could. `wiki:build --graph` merely snapshots this derivation for
|
|
15
15
|
* visualisation.
|
|
16
16
|
*/
|
|
17
|
-
import { effectiveStatus, trustTier } from
|
|
18
|
-
import { lookupTarget, resolveLinkTarget, } from
|
|
17
|
+
import { effectiveStatus, trustTier } from './format.js';
|
|
18
|
+
import { lookupTarget, resolveLinkTarget, } from './vault.js';
|
|
19
19
|
// ── Construction ─────────────────────────────────────────────────────────────
|
|
20
20
|
export function buildGraph(vault) {
|
|
21
21
|
const nodes = new Map();
|
package/dist/lib/wiki/lint.js
CHANGED
|
@@ -25,8 +25,8 @@
|
|
|
25
25
|
* itself know any private vocabulary.
|
|
26
26
|
*/
|
|
27
27
|
import { posix } from 'node:path';
|
|
28
|
-
import { CONCEPT_TYPES, isStale, LOG_ENTRY_RE, } from
|
|
29
|
-
import { docsInDirectory, lookupTarget, resolveLinkTarget, } from
|
|
28
|
+
import { CONCEPT_TYPES, isStale, LOG_ENTRY_RE, } from './format.js';
|
|
29
|
+
import { docsInDirectory, lookupTarget, resolveLinkTarget, } from './vault.js';
|
|
30
30
|
function report(findings) {
|
|
31
31
|
const errors = findings.filter((f) => f.severity === 'error').length;
|
|
32
32
|
const warnings = findings.filter((f) => f.severity === 'warning').length;
|
|
@@ -118,7 +118,7 @@ export declare function generatedBlock(id: string, source: string, content: stri
|
|
|
118
118
|
/** Splice `content` between a slot's markers. Null when the slot is absent. */
|
|
119
119
|
export declare function setSlotContent(raw: string, slotId: string, content: string): string | null;
|
|
120
120
|
/** Splice `content` between a generated block's markers. Null when absent. */
|
|
121
|
-
export declare function setGeneratedContent(raw: string, blockId: string, content: string): string | null;
|
|
121
|
+
export declare function setGeneratedContent(raw: string, blockId: string, content: string, source?: string): string | null;
|
|
122
122
|
/**
|
|
123
123
|
* Insert a log entry newest-first: after the preamble (everything before the
|
|
124
124
|
* first `## [` entry), before existing entries. log.md stays chronologically
|
|
@@ -304,12 +304,17 @@ export function setSlotContent(raw, slotId, content) {
|
|
|
304
304
|
].join('\n');
|
|
305
305
|
}
|
|
306
306
|
/** Splice `content` between a generated block's markers. Null when absent. */
|
|
307
|
-
export function setGeneratedContent(raw, blockId, content) {
|
|
307
|
+
export function setGeneratedContent(raw, blockId, content, source) {
|
|
308
308
|
const doc = parseDoc(raw);
|
|
309
309
|
const block = doc.generated.find((b) => b.id === blockId);
|
|
310
310
|
if (!block)
|
|
311
311
|
return null;
|
|
312
312
|
const lines = raw.split('\n');
|
|
313
|
+
// A source that moved (a file relocated in the repo) rewrites the opening
|
|
314
|
+
// marker too, so the attribution never outlives the file it names.
|
|
315
|
+
if (source !== undefined && block.source !== source) {
|
|
316
|
+
lines[block.startLine - 1] = generatedBlock(blockId, source, '').split('\n')[0];
|
|
317
|
+
}
|
|
313
318
|
return [
|
|
314
319
|
...lines.slice(0, block.startLine),
|
|
315
320
|
content.trim(),
|
|
@@ -15,8 +15,8 @@
|
|
|
15
15
|
* caller extracted from its own truth. This module never guesses what a
|
|
16
16
|
* repo contains.
|
|
17
17
|
*/
|
|
18
|
-
import { buildEntityGraph, entityStats, lintEntityGraph, loadRelations, NODE_KINDS, relationEdges, RELATIONS, writeSnapshot, } from
|
|
19
|
-
import { table } from
|
|
18
|
+
import { buildEntityGraph, entityStats, lintEntityGraph, loadRelations, NODE_KINDS, relationEdges, RELATIONS, writeSnapshot, } from './entities.js';
|
|
19
|
+
import { table } from './markdown.js';
|
|
20
20
|
/**
|
|
21
21
|
* Merge the derived layer with the asserted relations and (unless this is a
|
|
22
22
|
* lint-only run) refresh the snapshot the wiki tools read. The snapshot
|
package/dist/lib/wiki/vault.js
CHANGED
|
@@ -19,8 +19,8 @@
|
|
|
19
19
|
*/
|
|
20
20
|
import { existsSync, mkdirSync, readdirSync, readFileSync, writeFileSync, } from 'node:fs';
|
|
21
21
|
import { dirname, join, posix, resolve, sep } from 'node:path';
|
|
22
|
-
import { conceptFrontmatterSchema, isPrivatePath, isReservedFilename, } from
|
|
23
|
-
import { parseDoc } from
|
|
22
|
+
import { conceptFrontmatterSchema, isPrivatePath, isReservedFilename, } from './format.js';
|
|
23
|
+
import { parseDoc } from './markdown.js';
|
|
24
24
|
// ── Bundle root ──────────────────────────────────────────────────────────────
|
|
25
25
|
/**
|
|
26
26
|
* WIKI_ROOT env var wins; default is `<cwd>/wiki`. The default used to be
|
|
@@ -1,12 +1,18 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
export
|
|
2
|
+
import type { Server } from 'node:http';
|
|
3
|
+
import { createA2AApp } from '../lib/a2a/app.ts';
|
|
4
|
+
export { describeTurnError } from '../lib/a2a/executor.ts';
|
|
5
|
+
/**
|
|
6
|
+
* What a deployment adds on top of the environment-driven server: its own
|
|
7
|
+
* routes and any createA2AApp option. A private deployment imports
|
|
8
|
+
* `startServer` from `melchizedek-agents/server`, registers its tools with
|
|
9
|
+
* `registerTool`, and passes its routes here, so it inherits every
|
|
10
|
+
* environment variable this file reads (ADR 0022).
|
|
11
|
+
*/
|
|
12
|
+
export interface ServerExtensions {
|
|
13
|
+
/** Mounted after authentication, before the built-in routes. */
|
|
14
|
+
routes?: (app: import('express').Express) => void;
|
|
15
|
+
/** Any other createA2AApp option; wins over what the environment sets. */
|
|
16
|
+
options?: Partial<Parameters<typeof createA2AApp>[0]>;
|
|
17
|
+
}
|
|
18
|
+
export declare function startServer(syndicateName?: string, extensions?: ServerExtensions): Promise<Server>;
|