Shared types and utilities for Insy
npm install @insy/sharedbash
npm install @insy/shared
or
pnpm add @insy/shared
or
yarn add @insy/shared
`
Usage
`typescript
import type {
ElementInfo,
Framework,
FrameworkContext,
WebSocketMessage,
InsyConfig,
// ... other types
} from '@insy/shared';
`
Types
$3
- FrameworkType - Supported frameworks: 'react' | 'vue' | 'svelte' | 'nextjs' | 'html'
- Framework - Framework info with type, version, and devtools status
$3
- ElementInfo - Complete element information (tag, class, id, bbox, screenshot, HTML, CSS, selectors)
- BoundingBox - Element position and dimensions
- ReactContext - React-specific context (component name, props, state, hooks, fiber path, source)
- VueContext - Vue-specific context (component name, props, data, computed)
- HtmlContext - HTML-specific context (attributes, data attributes)
- FrameworkContext - Union of framework contexts
- SourceHints - Source file location hints
$3
- WebSocketMessage - Base message format
- PromptSubmitPayload - Prompt submission with full element context
- StatusUpdatePayload - Processing status updates
- ErrorPayload - Error information
- ConversationMessage - Chat history message
$3
- InsyConfig - Full configuration schema
- AIConfig - AI provider settings
- ServerConfig - Server host/port settings
- EditorConfig - Editor mode settings
- UIConfig - UI preferences
$3
- FileAttachment - Image attachment for prompts
Utilities
`typescript
import { createMessage } from '@insy/shared';
const msg = createMessage('status', { stage: 'analyzing', message: 'Processing...' });
``