@veren/core
v0.0.0
Published
A starter for creating a TypeScript package.
Downloads
54
Readme
@veren/core
@veren/core contains the shared protocol types and small runtime guards used across the monorepo.
Current public API:
- content and tool protocol types from
src/lang.ts - utility types and runtime guards from
src/types.ts
Install
vp add @veren/coreQuick Start
import { Type } from "@sinclair/typebox";
import type { AgentTool } from "@veren/core";
const parameters = Type.Object({
prompt: Type.String(),
});
const echoTool: AgentTool<typeof parameters, { tokens: number }> = {
name: "echo",
label: "Echo",
description: "Return the provided prompt",
parameters,
async execute(toolCallId, params, _signal, onUpdate) {
onUpdate?.({
content: [{ type: "text", text: `${toolCallId}: ${params.prompt}` }],
details: { tokens: 1 },
});
return {
content: [{ type: "text", text: params.prompt }],
details: { tokens: 1 },
};
},
};Exports
Protocol types
TextContentImageContentVideoContentAgentToolResult<T>Tool<TParameters>AgentTool<TParameters, TDetails>AgentToolUpdateCallback<T>
These types are intended for shared message payloads, tool definitions, and tool execution results.
Utility types
Mutable<T>DeepPartial<T>NonNullableFields<T>Type<T>AbstractType<T>Subscribable<T>
Use them to model mutable drafts, partial payloads, normalized records, and constructor-like tokens.
Runtime guards
isType(value)isPromise(value)isSubscribable(value)
They are intentionally small structural checks:
isTypereturnstruefor functions that can act as constructor tokensisPromiseaccepts native promises and Promise/A+ style thenablesisSubscribableaccepts objects with asubscribe()method
Notes
- This package currently exports types and guards only. It does not define application state, schemas, or higher-level domain models yet.
ToolandAgentTooluse@sinclair/typeboxschemas so callers can keep runtime validation and static parameter types aligned.
Development
vp test
vp check