vite-plugin-ai-annotator 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ export {};
@@ -0,0 +1,20 @@
1
+ /**
2
+ * AI Manager for tRPC client management and AI communication
3
+ */
4
+ import type { ElementData, PageInfo, SendMessageResponse } from '../shared/types';
5
+ export interface AIMessageHandler {
6
+ onData: (data: SendMessageResponse) => void;
7
+ onError: (error: any) => void;
8
+ onComplete: () => void;
9
+ }
10
+ export interface AIManager {
11
+ initialize(aiEndpoint: string): void;
12
+ sendMessage(userPrompt: string, selectedElements: ElementData[], pageInfo: PageInfo, cwd: string, handler: AIMessageHandler): Promise<void>;
13
+ newChat(): Promise<void>;
14
+ cancel(): void;
15
+ getSessionId(): string | null;
16
+ isInitialized(): boolean;
17
+ isProcessing(): boolean;
18
+ destroy(): void;
19
+ }
20
+ export declare function createAIManager(verbose?: boolean): AIManager;
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Global console capture system for errors, warnings, and info messages
3
+ */
4
+ declare global {
5
+ interface Console {
6
+ original?: {
7
+ error?: typeof console.error;
8
+ warn?: typeof console.warn;
9
+ info?: typeof console.info;
10
+ log?: typeof console.log;
11
+ assert?: typeof console.assert;
12
+ };
13
+ }
14
+ }
15
+ export declare function initializeConsoleErrorCapture(): void;
16
+ export declare function captureConsoleErrors(): string[];
17
+ export declare function captureConsoleWarnings(): string[];
18
+ export declare function captureConsoleInfo(): string[];
19
+ export declare function flushConsoleCaptures(): void;
20
+ export declare function stopConsoleCapture(): void;
@@ -0,0 +1,33 @@
1
+ /**
2
+ * Framework component detection and file location extraction
3
+ */
4
+ import { ElementSelector } from '../utils/xpath';
5
+ export interface ComponentInfo {
6
+ componentLocation: string;
7
+ componentName?: string;
8
+ elementLocation?: {
9
+ file: string;
10
+ line: number;
11
+ column: number;
12
+ endLine?: number;
13
+ endColumn?: number;
14
+ source?: string;
15
+ };
16
+ framework?: 'vue' | 'react' | 'angular' | 'svelte' | 'vanilla';
17
+ sourceMap?: {
18
+ originalLine: number;
19
+ originalColumn: number;
20
+ originalSource: string;
21
+ originalName?: string;
22
+ };
23
+ sourceHierarchy?: string;
24
+ selectors?: {
25
+ primary: ElementSelector;
26
+ fallbacks: string[];
27
+ confidence: 'high' | 'medium' | 'low';
28
+ };
29
+ }
30
+ /**
31
+ * Find the nearest component in the DOM tree
32
+ */
33
+ export declare function findNearestComponent(element: Element, verbose?: boolean): ComponentInfo | null;
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Inspection Manager for mouse inspection mode handling
3
+ */
4
+ export interface InspectionManager {
5
+ enterInspectionMode(): void;
6
+ exitInspectionMode(): void;
7
+ isInInspectionMode(): boolean;
8
+ destroy(): void;
9
+ }
10
+ export declare function createInspectionManager(onElementSelect?: (element: Element) => void, shouldIgnoreElement?: (element: Element) => boolean, isElementSelected?: (element: Element) => boolean): InspectionManager;
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Browser-side logging utility
3
+ */
4
+ export interface Logger {
5
+ log(...args: any[]): void;
6
+ info(...args: any[]): void;
7
+ warn(...args: any[]): void;
8
+ error(...args: any[]): void;
9
+ }
10
+ export declare function createLogger(verbose: boolean): Logger;
11
+ export declare function createSilentLogger(): Logger;
@@ -0,0 +1,24 @@
1
+ /**
2
+ * Element Selection Manager for element selection, highlighting, and badge management
3
+ */
4
+ import type { ElementData } from '../rpc/define';
5
+ export interface SelectedElementInfo {
6
+ color: string;
7
+ originalOutline: string;
8
+ originalOutlineOffset: string;
9
+ index: number;
10
+ }
11
+ export interface ElementSelectionManager {
12
+ selectElement(element: Element, componentFinder?: (el: Element) => any): void;
13
+ deselectElement(element: Element): void;
14
+ clearAllSelections(): void;
15
+ hasElement(element: Element): boolean;
16
+ getSelectedElements(): Map<Element, SelectedElementInfo>;
17
+ getSelectedCount(): number;
18
+ findSelectedParent(element: Element): Element | null;
19
+ findSelectedChildren(element: Element): Element[];
20
+ buildHierarchicalStructure(componentFinder?: (el: Element) => any, imagePaths?: Map<Element, string>): ElementData[];
21
+ setOnEditClick(callback: (element: Element) => void): void;
22
+ updateBadgeCommentIndicator(element: Element, hasComment: boolean): void;
23
+ }
24
+ export declare function createElementSelectionManager(): ElementSelectionManager;
@@ -0,0 +1,13 @@
1
+ /**
2
+ * CSS styles for the inspector toolbar
3
+ * Organized by component and animation types
4
+ */
5
+ export declare const ANIMATION_CONFIG: {
6
+ readonly DURATIONS: {
7
+ readonly GRADIENT_SHIFT: "7.3s";
8
+ readonly GLOWING_AURA: "9.7s";
9
+ readonly ROTATE_MIST: "13.5s";
10
+ readonly BLINK_EYE: "5s";
11
+ };
12
+ };
13
+ export declare const TOOLBAR_STYLES: import("lit").CSSResult;