@vextlabs/theron-agent-sdk 0.3.0 → 0.3.1
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/CHANGELOG.md +16 -0
- package/dist/adapters/theron.cjs +13 -2
- package/dist/adapters/theron.js +13 -2
- package/dist/agent/index.cjs +111 -2
- package/dist/agent/index.d.cts +43 -2
- package/dist/agent/index.d.ts +43 -2
- package/dist/agent/index.js +108 -3
- package/dist/council/index.cjs +4 -0
- package/dist/council/index.d.cts +25 -1
- package/dist/council/index.d.ts +25 -1
- package/dist/council/index.js +4 -1
- package/dist/index.cjs +490 -65
- package/dist/index.d.cts +64 -5
- package/dist/index.d.ts +64 -5
- package/dist/index.js +479 -66
- package/dist/loop/index.cjs +2 -1
- package/dist/loop/index.d.cts +3 -0
- package/dist/loop/index.d.ts +3 -0
- package/dist/loop/index.js +2 -1
- package/dist/mcp/index.cjs +27 -10
- package/dist/mcp/index.d.cts +2 -1
- package/dist/mcp/index.d.ts +2 -1
- package/dist/mcp/index.js +27 -10
- package/dist/runtime/index.cjs +145 -33
- package/dist/runtime/index.d.cts +78 -3
- package/dist/runtime/index.d.ts +78 -3
- package/dist/runtime/index.js +144 -34
- package/dist/tools/index.cjs +45 -10
- package/dist/tools/index.js +45 -10
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
export { Agent, AgentConfig, AgentInstruction, AgentResult } from './agent/index.cjs';
|
|
2
|
-
export { Council, CouncilConfig, CouncilOutput, Reconciler } from './council/index.cjs';
|
|
1
|
+
export { Agent, AgentConfig, AgentInstruction, AgentResult, MarkdownAgentType, loadAllMarkdownAgents, loadMarkdownAgents, parseMarkdownAgent, subAgentToolName } from './agent/index.cjs';
|
|
2
|
+
export { ClaimExtractor, Council, CouncilConfig, CouncilOutput, Reconciler, sentenceClaimExtractor } from './council/index.cjs';
|
|
3
3
|
export { Session, SessionConfig, SessionEvent } from './session/index.cjs';
|
|
4
4
|
export { InMemoryStore, Memory, MemoryQuery, MemoryRecord } from './memory/index.cjs';
|
|
5
5
|
export { Tool, ToolContext, ToolSchema, defineTool } from './tools/index.cjs';
|
|
6
6
|
export { Verifier, VerifierIssue, VerifierKernels, VerifierResult, defineVerifier } from './verifiers/index.cjs';
|
|
7
|
-
export { ModelAdapter, Runner, RunnerConfig, RunnerEvent } from './runtime/index.cjs';
|
|
7
|
+
export { CloudExecOptions, CloudExecResult, CloudSession, CloudSessionProvider, LocalCloudSession, LocalCloudSessionProvider, ModelAdapter, RunOptions, Runner, RunnerConfig, RunnerEvent } from './runtime/index.cjs';
|
|
8
8
|
export { MCPClient, McpServerConfig, McpTool, collectMcpTools } from './mcp/index.cjs';
|
|
9
9
|
export { TheronAdapterOptions, theron, theronAdapter } from './adapters/theron.cjs';
|
|
10
10
|
export { InMemoryReceiptSink, Receipt, ReceiptEmitter, ReceiptEmitterConfig, ReceiptInput, ReceiptSigner, ReceiptSink, fileReceiptSink, httpReceiptSink } from './receipts/index.cjs';
|
|
@@ -12,6 +12,31 @@ export { BoundWorkingSetResult, ChatMessage, CompactHistoryOptions, CompactHisto
|
|
|
12
12
|
export { BestOfNOptions, BestOfNResult, ChainOfVerificationOptions, ChainOfVerificationResult, MeasureLiftOptions, MeasureLiftResult, MixtureOfAgentsOptions, MixtureOfAgentsResult, ReflexionOptions, ReflexionResult, SelfConsistencyOptions, SelfConsistencyResult, SelfRefineOptions, SelfRefineResult, TreeOfThoughtsOptions, TreeOfThoughtsResult, bestOfN, chainOfVerification, measureLift, mixtureOfAgents, reflexion, selfConsistency, selfRefine, treeOfThoughts } from './patterns/index.cjs';
|
|
13
13
|
export { z as zod } from 'zod';
|
|
14
14
|
|
|
15
|
+
interface MarkdownSkill {
|
|
16
|
+
/** Slug used to invoke the skill (/<name>). Lowercased, kebab. */
|
|
17
|
+
name: string;
|
|
18
|
+
/** One-line summary the model uses to decide relevance. */
|
|
19
|
+
description: string;
|
|
20
|
+
/** The instruction pack — the Markdown body after the frontmatter. */
|
|
21
|
+
body: string;
|
|
22
|
+
/** Optional tool allowlist surfaced while the skill is active. */
|
|
23
|
+
allowedTools?: string[];
|
|
24
|
+
/** Optional per-skill model override. */
|
|
25
|
+
model?: string;
|
|
26
|
+
/** Source file path (for diagnostics / "where did this come from"). */
|
|
27
|
+
source: string;
|
|
28
|
+
}
|
|
29
|
+
/** Parse one SKILL.md file. Returns null if it lacks frontmatter or a body. */
|
|
30
|
+
declare function parseMarkdownSkill(filename: string, content: string): MarkdownSkill | null;
|
|
31
|
+
/** Load all SKILL.md files from a directory. Never throws. */
|
|
32
|
+
declare function loadMarkdownSkills(dir: string): Promise<MarkdownSkill[]>;
|
|
33
|
+
/**
|
|
34
|
+
* Load skills from both global (~/.theron/skills) and project-local
|
|
35
|
+
* (<project>/.theron/skills) directories. Project-local wins on name
|
|
36
|
+
* collisions. Never throws.
|
|
37
|
+
*/
|
|
38
|
+
declare function loadAllMarkdownSkills(projectDir?: string): Promise<MarkdownSkill[]>;
|
|
39
|
+
|
|
15
40
|
/** OpenAI-compatible function tool definition (same shape as Anthropic via the `tools` field). */
|
|
16
41
|
interface LocalToolDef {
|
|
17
42
|
type: "function";
|
|
@@ -55,6 +80,40 @@ declare const MUTATING_LOCAL_TOOLS: ReadonlySet<string>;
|
|
|
55
80
|
*/
|
|
56
81
|
declare function buildLocalToolSchemas(descriptions: Record<string, string>): LocalToolDef[];
|
|
57
82
|
|
|
58
|
-
|
|
83
|
+
type ReasoningTier = "arithmetic" | "cas_algebra" | "smt_z3" | "lean4_proof" | "test_suite" | "source_presence";
|
|
84
|
+
interface ReasoningCertificate {
|
|
85
|
+
/** The oracle class. Each is a different execution class from the model. */
|
|
86
|
+
tier: ReasoningTier;
|
|
87
|
+
/** What to re-run to check this, e.g. "js_runtime" | "z3:4.13" | "lean4:4.9". */
|
|
88
|
+
oracle_id: string;
|
|
89
|
+
oracle_version: string;
|
|
90
|
+
/** sha256 of the canonical claim text fed to the oracle (binds the cert to the claim). */
|
|
91
|
+
claim_input_hash: string;
|
|
92
|
+
verdict: "PASS" | "FAIL" | "ABSTAIN";
|
|
93
|
+
verdict_detail: string;
|
|
94
|
+
/** What this cert PROVES. */
|
|
95
|
+
certifies: string;
|
|
96
|
+
/** MANDATORY — what this cert does NOT prove. Prevents over-reading the badge. */
|
|
97
|
+
does_not_certify: string;
|
|
98
|
+
oracle_ts: number;
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Certify the arithmetic claims in `text` via JS re-computation (Tier 0, $0, sound).
|
|
102
|
+
* Returns PASS only if every "A op B = C" in the text re-computes; FAIL if any is
|
|
103
|
+
* wrong; ABSTAIN when there is NO arithmetic claim to check (never PASS prose).
|
|
104
|
+
*/
|
|
105
|
+
declare function certifyArithmetic(text: string): Promise<ReasoningCertificate>;
|
|
106
|
+
/**
|
|
107
|
+
* Offline, vendor-independent re-check. Re-runs the SAME deterministic oracle on the
|
|
108
|
+
* claim text and confirms it reproduces the certificate's verdict AND that the claim
|
|
109
|
+
* text matches `claim_input_hash`. Anyone can run this with zero trust in Vext —
|
|
110
|
+
* that neutrality (verifier ≠ vendor) is the whole point.
|
|
111
|
+
*/
|
|
112
|
+
declare function verifyReasoningCertificate(cert: ReasoningCertificate, claimText: string): Promise<{
|
|
113
|
+
ok: boolean;
|
|
114
|
+
reasons: string[];
|
|
115
|
+
}>;
|
|
116
|
+
|
|
117
|
+
declare const VERSION = "0.3.1";
|
|
59
118
|
|
|
60
|
-
export { LOCAL_TOOL_NAMES, LOCAL_TOOL_PARAMETERS, type LocalToolDef, MUTATING_LOCAL_TOOLS, VERSION, buildLocalToolSchemas };
|
|
119
|
+
export { LOCAL_TOOL_NAMES, LOCAL_TOOL_PARAMETERS, type LocalToolDef, MUTATING_LOCAL_TOOLS, type MarkdownSkill, type ReasoningCertificate, type ReasoningTier, VERSION, buildLocalToolSchemas, certifyArithmetic, loadAllMarkdownSkills, loadMarkdownSkills, parseMarkdownSkill, verifyReasoningCertificate };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
export { Agent, AgentConfig, AgentInstruction, AgentResult } from './agent/index.js';
|
|
2
|
-
export { Council, CouncilConfig, CouncilOutput, Reconciler } from './council/index.js';
|
|
1
|
+
export { Agent, AgentConfig, AgentInstruction, AgentResult, MarkdownAgentType, loadAllMarkdownAgents, loadMarkdownAgents, parseMarkdownAgent, subAgentToolName } from './agent/index.js';
|
|
2
|
+
export { ClaimExtractor, Council, CouncilConfig, CouncilOutput, Reconciler, sentenceClaimExtractor } from './council/index.js';
|
|
3
3
|
export { Session, SessionConfig, SessionEvent } from './session/index.js';
|
|
4
4
|
export { InMemoryStore, Memory, MemoryQuery, MemoryRecord } from './memory/index.js';
|
|
5
5
|
export { Tool, ToolContext, ToolSchema, defineTool } from './tools/index.js';
|
|
6
6
|
export { Verifier, VerifierIssue, VerifierKernels, VerifierResult, defineVerifier } from './verifiers/index.js';
|
|
7
|
-
export { ModelAdapter, Runner, RunnerConfig, RunnerEvent } from './runtime/index.js';
|
|
7
|
+
export { CloudExecOptions, CloudExecResult, CloudSession, CloudSessionProvider, LocalCloudSession, LocalCloudSessionProvider, ModelAdapter, RunOptions, Runner, RunnerConfig, RunnerEvent } from './runtime/index.js';
|
|
8
8
|
export { MCPClient, McpServerConfig, McpTool, collectMcpTools } from './mcp/index.js';
|
|
9
9
|
export { TheronAdapterOptions, theron, theronAdapter } from './adapters/theron.js';
|
|
10
10
|
export { InMemoryReceiptSink, Receipt, ReceiptEmitter, ReceiptEmitterConfig, ReceiptInput, ReceiptSigner, ReceiptSink, fileReceiptSink, httpReceiptSink } from './receipts/index.js';
|
|
@@ -12,6 +12,31 @@ export { BoundWorkingSetResult, ChatMessage, CompactHistoryOptions, CompactHisto
|
|
|
12
12
|
export { BestOfNOptions, BestOfNResult, ChainOfVerificationOptions, ChainOfVerificationResult, MeasureLiftOptions, MeasureLiftResult, MixtureOfAgentsOptions, MixtureOfAgentsResult, ReflexionOptions, ReflexionResult, SelfConsistencyOptions, SelfConsistencyResult, SelfRefineOptions, SelfRefineResult, TreeOfThoughtsOptions, TreeOfThoughtsResult, bestOfN, chainOfVerification, measureLift, mixtureOfAgents, reflexion, selfConsistency, selfRefine, treeOfThoughts } from './patterns/index.js';
|
|
13
13
|
export { z as zod } from 'zod';
|
|
14
14
|
|
|
15
|
+
interface MarkdownSkill {
|
|
16
|
+
/** Slug used to invoke the skill (/<name>). Lowercased, kebab. */
|
|
17
|
+
name: string;
|
|
18
|
+
/** One-line summary the model uses to decide relevance. */
|
|
19
|
+
description: string;
|
|
20
|
+
/** The instruction pack — the Markdown body after the frontmatter. */
|
|
21
|
+
body: string;
|
|
22
|
+
/** Optional tool allowlist surfaced while the skill is active. */
|
|
23
|
+
allowedTools?: string[];
|
|
24
|
+
/** Optional per-skill model override. */
|
|
25
|
+
model?: string;
|
|
26
|
+
/** Source file path (for diagnostics / "where did this come from"). */
|
|
27
|
+
source: string;
|
|
28
|
+
}
|
|
29
|
+
/** Parse one SKILL.md file. Returns null if it lacks frontmatter or a body. */
|
|
30
|
+
declare function parseMarkdownSkill(filename: string, content: string): MarkdownSkill | null;
|
|
31
|
+
/** Load all SKILL.md files from a directory. Never throws. */
|
|
32
|
+
declare function loadMarkdownSkills(dir: string): Promise<MarkdownSkill[]>;
|
|
33
|
+
/**
|
|
34
|
+
* Load skills from both global (~/.theron/skills) and project-local
|
|
35
|
+
* (<project>/.theron/skills) directories. Project-local wins on name
|
|
36
|
+
* collisions. Never throws.
|
|
37
|
+
*/
|
|
38
|
+
declare function loadAllMarkdownSkills(projectDir?: string): Promise<MarkdownSkill[]>;
|
|
39
|
+
|
|
15
40
|
/** OpenAI-compatible function tool definition (same shape as Anthropic via the `tools` field). */
|
|
16
41
|
interface LocalToolDef {
|
|
17
42
|
type: "function";
|
|
@@ -55,6 +80,40 @@ declare const MUTATING_LOCAL_TOOLS: ReadonlySet<string>;
|
|
|
55
80
|
*/
|
|
56
81
|
declare function buildLocalToolSchemas(descriptions: Record<string, string>): LocalToolDef[];
|
|
57
82
|
|
|
58
|
-
|
|
83
|
+
type ReasoningTier = "arithmetic" | "cas_algebra" | "smt_z3" | "lean4_proof" | "test_suite" | "source_presence";
|
|
84
|
+
interface ReasoningCertificate {
|
|
85
|
+
/** The oracle class. Each is a different execution class from the model. */
|
|
86
|
+
tier: ReasoningTier;
|
|
87
|
+
/** What to re-run to check this, e.g. "js_runtime" | "z3:4.13" | "lean4:4.9". */
|
|
88
|
+
oracle_id: string;
|
|
89
|
+
oracle_version: string;
|
|
90
|
+
/** sha256 of the canonical claim text fed to the oracle (binds the cert to the claim). */
|
|
91
|
+
claim_input_hash: string;
|
|
92
|
+
verdict: "PASS" | "FAIL" | "ABSTAIN";
|
|
93
|
+
verdict_detail: string;
|
|
94
|
+
/** What this cert PROVES. */
|
|
95
|
+
certifies: string;
|
|
96
|
+
/** MANDATORY — what this cert does NOT prove. Prevents over-reading the badge. */
|
|
97
|
+
does_not_certify: string;
|
|
98
|
+
oracle_ts: number;
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Certify the arithmetic claims in `text` via JS re-computation (Tier 0, $0, sound).
|
|
102
|
+
* Returns PASS only if every "A op B = C" in the text re-computes; FAIL if any is
|
|
103
|
+
* wrong; ABSTAIN when there is NO arithmetic claim to check (never PASS prose).
|
|
104
|
+
*/
|
|
105
|
+
declare function certifyArithmetic(text: string): Promise<ReasoningCertificate>;
|
|
106
|
+
/**
|
|
107
|
+
* Offline, vendor-independent re-check. Re-runs the SAME deterministic oracle on the
|
|
108
|
+
* claim text and confirms it reproduces the certificate's verdict AND that the claim
|
|
109
|
+
* text matches `claim_input_hash`. Anyone can run this with zero trust in Vext —
|
|
110
|
+
* that neutrality (verifier ≠ vendor) is the whole point.
|
|
111
|
+
*/
|
|
112
|
+
declare function verifyReasoningCertificate(cert: ReasoningCertificate, claimText: string): Promise<{
|
|
113
|
+
ok: boolean;
|
|
114
|
+
reasons: string[];
|
|
115
|
+
}>;
|
|
116
|
+
|
|
117
|
+
declare const VERSION = "0.3.1";
|
|
59
118
|
|
|
60
|
-
export { LOCAL_TOOL_NAMES, LOCAL_TOOL_PARAMETERS, type LocalToolDef, MUTATING_LOCAL_TOOLS, VERSION, buildLocalToolSchemas };
|
|
119
|
+
export { LOCAL_TOOL_NAMES, LOCAL_TOOL_PARAMETERS, type LocalToolDef, MUTATING_LOCAL_TOOLS, type MarkdownSkill, type ReasoningCertificate, type ReasoningTier, VERSION, buildLocalToolSchemas, certifyArithmetic, loadAllMarkdownSkills, loadMarkdownSkills, parseMarkdownSkill, verifyReasoningCertificate };
|