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
package/dist/lib/config.d.ts
CHANGED
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
* Default Gemini model used by the A2A server when no model is specified
|
|
20
20
|
* in the caller's YAML or request.
|
|
21
21
|
*
|
|
22
|
-
* Use gemini-3.
|
|
22
|
+
* Use gemini-3.5-flash-lite for lightweight/cost-efficient loads (subagents,
|
|
23
23
|
* data retrieval). Use gemini-3.8-flash in YAML for production orchestrators.
|
|
24
24
|
*
|
|
25
25
|
* NOTE: gemini-2.5-flash is known incompatible with this framework's
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
*
|
|
29
29
|
* Supported Gemini identifiers: https://ai.google.dev/gemini-api/docs/models
|
|
30
30
|
*/
|
|
31
|
-
export declare const DEFAULT_GEMINI_MODEL = "gemini-3.
|
|
31
|
+
export declare const DEFAULT_GEMINI_MODEL = "gemini-3.5-flash-lite";
|
|
32
32
|
/**
|
|
33
33
|
* Default Claude model used by the A2A server when a claude-* model is
|
|
34
34
|
* requested but no specific identifier is provided.
|
|
@@ -47,14 +47,14 @@ export declare const DEFAULT_GPT_MODEL = "gpt-5-mini";
|
|
|
47
47
|
/**
|
|
48
48
|
* Default xAI model used when a grok-* model is requested but no specific
|
|
49
49
|
* identifier is provided. Requires XAI_API_KEY (lib/models/grokLlm.ts).
|
|
50
|
-
* grok-4.
|
|
50
|
+
* grok-4.7 is a reasoning model (reasoning cannot be disabled); it returns
|
|
51
51
|
* reasoning summaries, which the adapter surfaces as thinking.
|
|
52
52
|
*/
|
|
53
|
-
export declare const DEFAULT_GROK_MODEL = "grok-4.
|
|
53
|
+
export declare const DEFAULT_GROK_MODEL = "grok-4.7";
|
|
54
54
|
/**
|
|
55
|
-
* Reasoning effort sent with grok-4.5 requests: 'low' | 'medium' | 'high'
|
|
56
|
-
* (xAI's own default is 'high'). Pinned to MEDIUM — deeper
|
|
57
|
-
* without high's latency and token cost. Source: docs.x.ai › Model
|
|
55
|
+
* Reasoning effort sent with grok-4.5/4.7 requests: 'low' | 'medium' | 'high'
|
|
56
|
+
* (xAI's own default is 'high'; 4.7 adds 'xhigh'). Pinned to MEDIUM — deeper
|
|
57
|
+
* than low without high's latency and token cost. Source: docs.x.ai › Model
|
|
58
58
|
* capabilities › Text › Reasoning › Effort levels. Older grok ids don't
|
|
59
59
|
* accept the param and never receive it (lib/models/grokLlm.ts).
|
|
60
60
|
*/
|
package/dist/lib/config.js
CHANGED
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
* Default Gemini model used by the A2A server when no model is specified
|
|
21
21
|
* in the caller's YAML or request.
|
|
22
22
|
*
|
|
23
|
-
* Use gemini-3.
|
|
23
|
+
* Use gemini-3.5-flash-lite for lightweight/cost-efficient loads (subagents,
|
|
24
24
|
* data retrieval). Use gemini-3.8-flash in YAML for production orchestrators.
|
|
25
25
|
*
|
|
26
26
|
* NOTE: gemini-2.5-flash is known incompatible with this framework's
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
*
|
|
30
30
|
* Supported Gemini identifiers: https://ai.google.dev/gemini-api/docs/models
|
|
31
31
|
*/
|
|
32
|
-
export const DEFAULT_GEMINI_MODEL = 'gemini-3.
|
|
32
|
+
export const DEFAULT_GEMINI_MODEL = 'gemini-3.5-flash-lite';
|
|
33
33
|
/**
|
|
34
34
|
* Default Claude model used by the A2A server when a claude-* model is
|
|
35
35
|
* requested but no specific identifier is provided.
|
|
@@ -48,14 +48,14 @@ export const DEFAULT_GPT_MODEL = 'gpt-5-mini';
|
|
|
48
48
|
/**
|
|
49
49
|
* Default xAI model used when a grok-* model is requested but no specific
|
|
50
50
|
* identifier is provided. Requires XAI_API_KEY (lib/models/grokLlm.ts).
|
|
51
|
-
* grok-4.
|
|
51
|
+
* grok-4.7 is a reasoning model (reasoning cannot be disabled); it returns
|
|
52
52
|
* reasoning summaries, which the adapter surfaces as thinking.
|
|
53
53
|
*/
|
|
54
|
-
export const DEFAULT_GROK_MODEL = 'grok-4.
|
|
54
|
+
export const DEFAULT_GROK_MODEL = 'grok-4.7';
|
|
55
55
|
/**
|
|
56
|
-
* Reasoning effort sent with grok-4.5 requests: 'low' | 'medium' | 'high'
|
|
57
|
-
* (xAI's own default is 'high'). Pinned to MEDIUM — deeper
|
|
58
|
-
* without high's latency and token cost. Source: docs.x.ai › Model
|
|
56
|
+
* Reasoning effort sent with grok-4.5/4.7 requests: 'low' | 'medium' | 'high'
|
|
57
|
+
* (xAI's own default is 'high'; 4.7 adds 'xhigh'). Pinned to MEDIUM — deeper
|
|
58
|
+
* than low without high's latency and token cost. Source: docs.x.ai › Model
|
|
59
59
|
* capabilities › Text › Reasoning › Effort levels. Older grok ids don't
|
|
60
60
|
* accept the param and never receive it (lib/models/grokLlm.ts).
|
|
61
61
|
*/
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* lib/doctor.ts — the onboarding walkthrough, generated from the truth.
|
|
3
|
+
*
|
|
4
|
+
* WHY this file exists:
|
|
5
|
+
* The question every newcomer asks — "which keys do I need?" — used to be
|
|
6
|
+
* answered by prose in four documents that drift. The doctor answers it
|
|
7
|
+
* from the YAMLs and the environment: every syndicate the loader can see,
|
|
8
|
+
* every agent's model, the provider that id routes to, whether that path
|
|
9
|
+
* is funded (direct key, gateway, or local), and which declared
|
|
10
|
+
* server-side tools the path will drop. Then it says exactly what to set,
|
|
11
|
+
* grouped by how much each variable unlocks.
|
|
12
|
+
*
|
|
13
|
+
* WHAT IT NEVER DOES:
|
|
14
|
+
* - edit .env or any file;
|
|
15
|
+
* - send a request (demo_model_optionality.ts is the live proof);
|
|
16
|
+
* - print a key VALUE. Only names of env vars appear (secrets-hygiene).
|
|
17
|
+
*
|
|
18
|
+
* The routing and capability judgments are not re-implemented here: they
|
|
19
|
+
* come from lib/models/gateway.ts and lib/models/capabilities.ts, the same
|
|
20
|
+
* modules the registry and the A2A server use, so the report cannot
|
|
21
|
+
* disagree with what a run would do.
|
|
22
|
+
*/
|
|
23
|
+
import type { Platform } from './models/endpoints.ts';
|
|
24
|
+
import type { CapabilityGap, CapabilityReport } from './models/capabilities.ts';
|
|
25
|
+
import type { ProviderId } from './models/providerMap.ts';
|
|
26
|
+
/**
|
|
27
|
+
* What a file costs to run: `keyless` (all Ollama), a single provider's id
|
|
28
|
+
* when every agent shares one (`gemini`, `anthropic`, `openai`, `xai` — one
|
|
29
|
+
* key runs it), or `multi-provider` when the models mix.
|
|
30
|
+
*/
|
|
31
|
+
export type Tier = 'keyless' | Exclude<ProviderId, 'ollama'> | 'multi-provider';
|
|
32
|
+
export interface DoctorRow {
|
|
33
|
+
/** Agent name as declared; nested syndicates read "Parent › Child". */
|
|
34
|
+
agent: string;
|
|
35
|
+
role: 'orchestrator' | 'subagent';
|
|
36
|
+
model: string;
|
|
37
|
+
report: CapabilityReport;
|
|
38
|
+
/**
|
|
39
|
+
* What this agent's YAML asks of its model that the resolved path does not
|
|
40
|
+
* fully give it (lib/models/capabilities.ts, ADR 0019). Gaps never block a
|
|
41
|
+
* syndicate; they are printed so a degraded role is not a surprise.
|
|
42
|
+
*/
|
|
43
|
+
gaps: CapabilityGap[];
|
|
44
|
+
}
|
|
45
|
+
export type VerdictState = 'ready' | 'ready-local' | 'via-gateway' | 'blocked';
|
|
46
|
+
export interface DoctorSyndicate {
|
|
47
|
+
/** Path relative to the agents dir, e.g. "examples/council.yaml". */
|
|
48
|
+
file: string;
|
|
49
|
+
name: string;
|
|
50
|
+
tier: Tier;
|
|
51
|
+
/** The `# tier:` header comment, when the file declares one. */
|
|
52
|
+
declaredTier?: string;
|
|
53
|
+
rows: DoctorRow[];
|
|
54
|
+
verdict: {
|
|
55
|
+
state: VerdictState;
|
|
56
|
+
detail: string;
|
|
57
|
+
};
|
|
58
|
+
/** `npm run <script>` when package.json has an alias for this file. */
|
|
59
|
+
runCommand?: string;
|
|
60
|
+
/**
|
|
61
|
+
* A load, parse or validation error (every problem, one per line). Rows
|
|
62
|
+
* are empty when the file itself failed; a nested failure keeps the rows
|
|
63
|
+
* that did resolve.
|
|
64
|
+
*/
|
|
65
|
+
error?: string;
|
|
66
|
+
/**
|
|
67
|
+
* Long-term memory only: the namespace its facts are filed under
|
|
68
|
+
* (ADR 0020), and what is wrong with it, if anything.
|
|
69
|
+
*/
|
|
70
|
+
memory?: {
|
|
71
|
+
namespace: string;
|
|
72
|
+
declared: boolean;
|
|
73
|
+
issue?: string;
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
export interface Unlock {
|
|
77
|
+
env: string;
|
|
78
|
+
provider: ProviderId;
|
|
79
|
+
label: string;
|
|
80
|
+
consoleUrl: string;
|
|
81
|
+
/** Syndicates this one variable would move from blocked to ready. */
|
|
82
|
+
syndicates: string[];
|
|
83
|
+
}
|
|
84
|
+
export interface DoctorResult {
|
|
85
|
+
agentsDir: string;
|
|
86
|
+
syndicates: DoctorSyndicate[];
|
|
87
|
+
unlocks: Unlock[];
|
|
88
|
+
gateway: {
|
|
89
|
+
id: string;
|
|
90
|
+
label: string;
|
|
91
|
+
usable: boolean;
|
|
92
|
+
problem?: string;
|
|
93
|
+
} | null;
|
|
94
|
+
/** Every provider not on its default endpoint: a cloud platform or a proxy (ADR 0023). */
|
|
95
|
+
endpoints: DoctorEndpoint[];
|
|
96
|
+
counts: Record<VerdictState, number>;
|
|
97
|
+
}
|
|
98
|
+
export interface DoctorEndpoint {
|
|
99
|
+
provider: ProviderId;
|
|
100
|
+
platform: Platform | 'invalid';
|
|
101
|
+
label: string;
|
|
102
|
+
/** How it authenticates; a cloud credential chain is not exercised by the doctor. */
|
|
103
|
+
credential: string;
|
|
104
|
+
/** The platform SDK it needs beyond the provider's own, and whether it resolves. */
|
|
105
|
+
sdk?: {
|
|
106
|
+
module: string;
|
|
107
|
+
installed: boolean;
|
|
108
|
+
};
|
|
109
|
+
problems: string[];
|
|
110
|
+
/** Cloud platforms are tested against mocks only (ADR 0023). */
|
|
111
|
+
liveVerified: boolean;
|
|
112
|
+
}
|
|
113
|
+
/** One row per provider that is not on its vendor's public API with an env key. */
|
|
114
|
+
export declare function endpointRows(): DoctorEndpoint[];
|
|
115
|
+
export declare const CONSOLE_URLS: Record<ProviderId, string>;
|
|
116
|
+
/**
|
|
117
|
+
* Every syndicate file the loader can see: the root (this deployment's
|
|
118
|
+
* live syndicates), examples/ (the starter pack) and templates/ (the
|
|
119
|
+
* production templates). The schema document
|
|
120
|
+
* and evals/ are skipped — one is not a syndicate, the others exist to be
|
|
121
|
+
* measured, not served (config/agents/README.md).
|
|
122
|
+
*/
|
|
123
|
+
export declare function listSyndicateFiles(agentsDir: string): string[];
|
|
124
|
+
/** The `# tier:` comment in the file's leading comment block, if any. */
|
|
125
|
+
export declare function declaredTierOf(filePath: string): string | undefined;
|
|
126
|
+
/** The tier the models actually imply. */
|
|
127
|
+
export declare function tierOf(rows: readonly DoctorRow[]): Tier;
|
|
128
|
+
/** `npm run <alias>` for a file, read from package.json scripts. */
|
|
129
|
+
export declare function runCommandFor(file: string, scripts: Record<string, string> | undefined): string | undefined;
|
|
130
|
+
export declare function diagnoseSyndicate(file: string, agentsDir: string, scripts?: Record<string, string>): DoctorSyndicate;
|
|
131
|
+
/**
|
|
132
|
+
* ADR 0020: a long-term syndicate declares the namespace its facts are filed
|
|
133
|
+
* under, and two syndicates share memory only by declaring the same one.
|
|
134
|
+
* Checked for the deployment's own files (the agents-dir root). The shipped
|
|
135
|
+
* examples and templates are copied before use, and a copy gets its own
|
|
136
|
+
* namespace from `npm run doctor -- --fix-namespaces <file>`.
|
|
137
|
+
*/
|
|
138
|
+
export declare function flagMemoryNamespaces(syndicates: DoctorSyndicate[]): void;
|
|
139
|
+
export declare function runDoctor(options?: {
|
|
140
|
+
agentsDir?: string;
|
|
141
|
+
scripts?: Record<string, string>;
|
|
142
|
+
}): DoctorResult;
|
|
143
|
+
export declare function renderDoctor(result: DoctorResult, opts?: {
|
|
144
|
+
color?: boolean;
|
|
145
|
+
}): string;
|