Add unit tests for skill capabilities, skill planner, and UV setup
- Implement tests for random ID generation, ensuring preference for crypto.randomUUID. - Create tests for runtime context capabilities, validating the injection of enabled skill capabilities. - Add tests for skill capability parsing, including classification and command example extraction. - Introduce tests for the skill planner, verifying tool call planning based on user requests and attachment requirements. - Establish tests for UV setup, ensuring proper handling of Python installation scenarios and environment checks.
This commit is contained in:
@@ -4,7 +4,71 @@ export interface AttachedFileMeta {
|
||||
fileSize: number;
|
||||
preview: string | null;
|
||||
filePath?: string;
|
||||
source?: 'user-upload' | 'tool-result' | 'message-ref';
|
||||
source?: 'user-upload' | 'tool-result' | 'tool-artifact' | 'message-ref';
|
||||
}
|
||||
|
||||
export type ToolLifecycleStatus = 'running' | 'completed' | 'error';
|
||||
|
||||
export type ToolArtifactKind =
|
||||
| 'file'
|
||||
| 'image'
|
||||
| 'table'
|
||||
| 'url'
|
||||
| 'json'
|
||||
| 'text'
|
||||
| 'unknown';
|
||||
|
||||
export interface ToolArtifact {
|
||||
kind?: ToolArtifactKind;
|
||||
name?: string;
|
||||
label?: string;
|
||||
description?: string;
|
||||
mimeType?: string;
|
||||
uri?: string;
|
||||
filePath?: string;
|
||||
preview?: string | null;
|
||||
metadata?: Record<string, unknown>;
|
||||
}
|
||||
|
||||
export interface ToolErrorInfo {
|
||||
code?: string;
|
||||
message: string;
|
||||
details?: unknown;
|
||||
}
|
||||
|
||||
export interface ToolRenderHints {
|
||||
card?:
|
||||
| 'generic'
|
||||
| 'document-analysis'
|
||||
| 'search-results'
|
||||
| 'browser-step'
|
||||
| 'command-output'
|
||||
| 'skill-install';
|
||||
preferredView?: 'summary' | 'table' | 'log' | 'artifact-list';
|
||||
skillType?: string;
|
||||
metadata?: Record<string, unknown>;
|
||||
}
|
||||
|
||||
export interface ToolResultPayload {
|
||||
ok?: boolean;
|
||||
summary?: string;
|
||||
structuredData?: unknown;
|
||||
files?: AttachedFileMeta[];
|
||||
artifacts?: ToolArtifact[];
|
||||
logs?: Array<string | Record<string, unknown>>;
|
||||
error?: string | ToolErrorInfo;
|
||||
retryable?: boolean;
|
||||
skillType?: string;
|
||||
renderHints?: ToolRenderHints;
|
||||
raw?: unknown;
|
||||
}
|
||||
|
||||
export interface ToolCallPayload {
|
||||
id?: string;
|
||||
name?: string;
|
||||
input?: unknown;
|
||||
arguments?: unknown;
|
||||
summary?: string;
|
||||
}
|
||||
|
||||
export interface ContentBlockSource {
|
||||
@@ -23,9 +87,17 @@ export interface ContentBlock {
|
||||
mimeType?: string;
|
||||
id?: string;
|
||||
name?: string;
|
||||
toolCallId?: string;
|
||||
input?: unknown;
|
||||
arguments?: unknown;
|
||||
content?: string | ContentBlock[];
|
||||
result?: ToolResultPayload | unknown;
|
||||
summary?: string;
|
||||
ok?: boolean;
|
||||
error?: string | ToolErrorInfo;
|
||||
artifacts?: ToolArtifact[];
|
||||
renderHints?: ToolRenderHints;
|
||||
metadata?: Record<string, unknown>;
|
||||
}
|
||||
|
||||
export type RawMessageRole = 'user' | 'assistant' | 'system' | 'toolresult' | 'tool_result';
|
||||
@@ -40,7 +112,8 @@ export interface RawMessage {
|
||||
details?: unknown;
|
||||
isError?: boolean;
|
||||
question?: string[];
|
||||
toolCall?: Record<string, unknown> | null;
|
||||
toolCall?: ToolCallPayload | Record<string, unknown> | null;
|
||||
toolResult?: ToolResultPayload | null;
|
||||
_attachedFiles?: AttachedFileMeta[];
|
||||
_toolStatuses?: ToolStatus[];
|
||||
}
|
||||
@@ -49,12 +122,15 @@ export interface ToolStatus {
|
||||
id?: string;
|
||||
toolCallId?: string;
|
||||
name: string;
|
||||
status: 'running' | 'completed' | 'error';
|
||||
status: ToolLifecycleStatus;
|
||||
durationMs?: number;
|
||||
summary?: string;
|
||||
updatedAt: number;
|
||||
input?: unknown;
|
||||
result?: unknown;
|
||||
result?: ToolResultPayload | unknown;
|
||||
error?: string | ToolErrorInfo;
|
||||
artifacts?: ToolArtifact[];
|
||||
renderHints?: ToolRenderHints;
|
||||
}
|
||||
|
||||
export interface ChatSession {
|
||||
|
||||
Reference in New Issue
Block a user