null
feat: deploy BotPsy local WebGPU static Space
1cc8d34
Raw History Blame Contribute Delete
1.31 kB
import type { ExecutionId, ProposalId, SessionEpoch } from './ids.ts';
import type { ToolCall } from './engine.ts';
export type EffectCategory = 'pure-local' | 'external-read' | 'external-write' | 'financial';
export interface JsonSchema {
type?: 'object' | 'array' | 'string' | 'number' | 'integer' | 'boolean' | 'null';
properties?: Record<string, JsonSchema>;
required?: string[];
items?: JsonSchema;
enum?: Array<string | number | boolean | null>;
minimum?: number;
maximum?: number;
minLength?: number;
maxLength?: number;
additionalProperties?: boolean;
description?: string;
}
export interface ToolDefinition {
name: string;
description: string;
parameters: JsonSchema;
effect: EffectCategory;
networkDestinations: string[];
timeoutMs: number;
maxOutputBytes: number;
idempotency: 'idempotent' | 'at-most-once' | 'non-idempotent';
}
export interface ToolExecutionReceipt {
proposalId: ProposalId;
executionId: ExecutionId;
epoch: SessionEpoch;
call: ToolCall;
status: 'pending' | 'running' | 'succeeded' | 'failed' | 'cancelled' | 'refused';
startedAt: number;
finishedAt?: number;
output?: string;
error?: string;
}
export interface ToolAuthorization {
proposalId: ProposalId;
approved: boolean;
arguments: Record<string, unknown>;
}