Spaces:
Running
Running
Download packages/protocol/src/tools.ts from leventkoldas/botpsy-0.8b-web: direct link, hf CLI and curl.
- Browser
- Download file 1.31 kB
-
https://huggingface.co/spaces/leventkoldas/botpsy-0.8b-web/resolve/main/packages/protocol/src/tools.ts
- Command line
-
hf download hf://spaces/leventkoldas/botpsy-0.8b-web/packages/protocol/src/tools.ts
-
curl -L -o tools.ts https://huggingface.co/spaces/leventkoldas/botpsy-0.8b-web/resolve/main/packages/protocol/src/tools.ts
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>; | |
| } | |