instantcode
Version:
AI-powered web inspection tool - Pick elements and get instant AI assistance
165 lines (164 loc) • 6.4 kB
TypeScript
import { z } from 'zod';
export declare const ElementDataSchema: z.ZodObject<{
index: z.ZodNumber;
tagName: z.ZodString;
xpath: z.ZodString;
cssSelector: z.ZodString;
textContent: z.ZodString;
attributes: z.ZodRecord<z.ZodString, z.ZodString>;
children: z.ZodArray<z.ZodAny>;
componentData: z.ZodOptional<z.ZodObject<{
componentLocation: z.ZodString;
componentName: z.ZodOptional<z.ZodString>;
elementLocation: z.ZodOptional<z.ZodObject<{
file: z.ZodString;
line: z.ZodNumber;
column: z.ZodNumber;
endLine: z.ZodOptional<z.ZodNumber>;
endColumn: z.ZodOptional<z.ZodNumber>;
source: z.ZodOptional<z.ZodString>;
}, z.core.$strip>>;
framework: z.ZodOptional<z.ZodEnum<{
vue: "vue";
react: "react";
angular: "angular";
svelte: "svelte";
vanilla: "vanilla";
}>>;
sourceMap: z.ZodOptional<z.ZodObject<{
originalLine: z.ZodNumber;
originalColumn: z.ZodNumber;
originalSource: z.ZodString;
originalName: z.ZodOptional<z.ZodString>;
}, z.core.$strip>>;
sourceHierarchy: z.ZodOptional<z.ZodString>;
}, z.core.$strip>>;
}, z.core.$strip>;
export declare const PageInfoSchema: z.ZodObject<{
url: z.ZodString;
title: z.ZodString;
}, z.core.$strip>;
export declare const SendMessageSchema: z.ZodObject<{
userPrompt: z.ZodString;
selectedElements: z.ZodArray<z.ZodObject<{
index: z.ZodNumber;
tagName: z.ZodString;
xpath: z.ZodString;
cssSelector: z.ZodString;
textContent: z.ZodString;
attributes: z.ZodRecord<z.ZodString, z.ZodString>;
children: z.ZodArray<z.ZodAny>;
componentData: z.ZodOptional<z.ZodObject<{
componentLocation: z.ZodString;
componentName: z.ZodOptional<z.ZodString>;
elementLocation: z.ZodOptional<z.ZodObject<{
file: z.ZodString;
line: z.ZodNumber;
column: z.ZodNumber;
endLine: z.ZodOptional<z.ZodNumber>;
endColumn: z.ZodOptional<z.ZodNumber>;
source: z.ZodOptional<z.ZodString>;
}, z.core.$strip>>;
framework: z.ZodOptional<z.ZodEnum<{
vue: "vue";
react: "react";
angular: "angular";
svelte: "svelte";
vanilla: "vanilla";
}>>;
sourceMap: z.ZodOptional<z.ZodObject<{
originalLine: z.ZodNumber;
originalColumn: z.ZodNumber;
originalSource: z.ZodString;
originalName: z.ZodOptional<z.ZodString>;
}, z.core.$strip>>;
sourceHierarchy: z.ZodOptional<z.ZodString>;
}, z.core.$strip>>;
}, z.core.$strip>>;
pageInfo: z.ZodObject<{
url: z.ZodString;
title: z.ZodString;
}, z.core.$strip>;
cwd: z.ZodOptional<z.ZodString>;
sessionId: z.ZodOptional<z.ZodString>;
consoleErrors: z.ZodOptional<z.ZodArray<z.ZodString>>;
consoleWarnings: z.ZodOptional<z.ZodArray<z.ZodString>>;
consoleInfo: z.ZodOptional<z.ZodArray<z.ZodString>>;
}, z.core.$strip>;
export declare const SendMessageResponseSchema: z.ZodUnion<readonly [z.ZodObject<{
type: z.ZodLiteral<"system">;
subtype: z.ZodLiteral<"init">;
cwd: z.ZodString;
session_id: z.ZodString;
apiKeySource: z.ZodString;
mcp_servers: z.ZodArray<z.ZodObject<{
name: z.ZodString;
status: z.ZodString;
}, z.core.$strip>>;
model: z.ZodString;
permissionMode: z.ZodString;
slash_commands: z.ZodArray<z.ZodString>;
tools: z.ZodArray<z.ZodString>;
}, z.core.$strip>, z.ZodObject<{
type: z.ZodLiteral<"assistant">;
message: z.ZodObject<{
id: z.ZodString;
type: z.ZodLiteral<"message">;
role: z.ZodLiteral<"assistant">;
model: z.ZodString;
content: z.ZodArray<z.ZodObject<{
type: z.ZodString;
text: z.ZodOptional<z.ZodString>;
id: z.ZodOptional<z.ZodString>;
name: z.ZodOptional<z.ZodString>;
input: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
}, z.core.$strip>>;
stop_reason: z.ZodOptional<z.ZodNullable<z.ZodString>>;
stop_sequence: z.ZodOptional<z.ZodNullable<z.ZodString>>;
usage: z.ZodOptional<z.ZodObject<{
input_tokens: z.ZodNumber;
cache_creation_input_tokens: z.ZodOptional<z.ZodNumber>;
cache_read_input_tokens: z.ZodOptional<z.ZodNumber>;
output_tokens: z.ZodNumber;
}, z.core.$strip>>;
}, z.core.$strip>;
parent_tool_use_id: z.ZodNullable<z.ZodString>;
session_id: z.ZodString;
}, z.core.$strip>, z.ZodObject<{
type: z.ZodLiteral<"user">;
message: z.ZodObject<{
role: z.ZodLiteral<"user">;
content: z.ZodArray<z.ZodObject<{
type: z.ZodString;
content: z.ZodOptional<z.ZodString>;
tool_use_id: z.ZodOptional<z.ZodString>;
}, z.core.$strip>>;
}, z.core.$strip>;
parent_tool_use_id: z.ZodNullable<z.ZodString>;
session_id: z.ZodString;
}, z.core.$strip>, z.ZodObject<{
type: z.ZodLiteral<"result">;
subtype: z.ZodString;
is_error: z.ZodBoolean;
duration_ms: z.ZodNumber;
duration_api_ms: z.ZodNumber;
num_turns: z.ZodOptional<z.ZodNumber>;
result: z.ZodOptional<z.ZodString>;
session_id: z.ZodString;
total_cost_usd: z.ZodOptional<z.ZodNumber>;
usage: z.ZodOptional<z.ZodObject<{
input_tokens: z.ZodNumber;
cache_creation_input_tokens: z.ZodOptional<z.ZodNumber>;
cache_read_input_tokens: z.ZodOptional<z.ZodNumber>;
output_tokens: z.ZodNumber;
}, z.core.$strip>>;
permission_denials: z.ZodOptional<z.ZodArray<z.ZodObject<{
tool_name: z.ZodString;
tool_use_id: z.ZodString;
tool_input: z.ZodRecord<z.ZodString, z.ZodUnknown>;
}, z.core.$strip>>>;
}, z.core.$strip>]>;
export type ElementData = z.infer<typeof ElementDataSchema>;
export type PageInfo = z.infer<typeof PageInfoSchema>;
export type SendMessage = z.infer<typeof SendMessageSchema>;
export type SendMessageResponse = z.infer<typeof SendMessageResponseSchema>;