@best-agent/protocol
v0.0.2-beta.8
Published
Shared public contract for `best-agent`.
Readme
@best-agent/protocol
Shared public contract for best-agent.
Main Exports
Authoring helpers:
defineTool(...)defineSkill(...)- plain
ContributionDefinitionobjects
Key public types:
- thread and turn types:
ThreadThreadDetailThreadListItemThreadModeTurnStatus
- discovery and config:
ProviderConfigAgentDefinitionAgentDefinitionModelStrategyAgentLoopKindAgentProfileSummaryToolConflictStrategyToolSummarySkillSummaryExtensionSummaryMcpServerSummary
- runtime events:
EventEnvelopeServerEventType- approval, workflow, research, telemetry, and compaction event shapes
- cross-session memory and approvals:
ProjectMemoryRecordGuardianAssessmentHostedPreToolUseRequestHostedPostToolUseRequest
- graph-owned kernel types:
PlanProjectionNodeContractClosurePolicyVerdictVerdictRecordContinuitySnapshotNodePacket
- request and response types for:
- thread lifecycle
- approvals
- run/stream/interrupt/queue/steer
- diagnostics and compaction
- research queries
RpcMethodMapfor method-to-params/result dispatch typing
Features
- one typed contract shared by
app-server,acp-server,sdk-ts, hosted contributions, and runtime internals - one method-to-params/result map shared by
server,sdk-ts, and gateway clients - structured tool inputs via
inputSchema - composition primitives for
AgentDefinitionand tool conflict handling - first-class thread modes, queue/steer controls, diagnostics, telemetry, workflows, and research
Example
import { defineSkill, defineTool, type ContributionDefinition, type ProviderConfig } from "@best-agent/protocol";
const provider: ProviderConfig = {
kind: "openai",
model: "gpt-5-mini",
};
const echoTool = defineTool({
name: "echo-json",
description: "Echo text from a JSON payload.",
inputSchema: {
type: "object",
properties: {
text: { type: "string" },
},
required: ["text"],
},
});
const summarySkill = defineSkill({
id: "concise",
name: "Concise",
description: "Respond briefly.",
content: "Keep answers short.",
});
export const contribution: ContributionDefinition = {
name: "demo",
tools: [echoTool],
skills: [summarySkill],
};Does Not Own
- runtime logic
- storage implementations
- provider calls
- tool execution
If a type must cross a process boundary, it belongs here.
