@insy/shared
v0.0.2
Published
Shared types and utilities for Insy
Maintainers
Readme
@insy/shared
Shared types and utilities for Insy
Common TypeScript types and utilities shared across all Insy packages.
Installation
npm install @insy/shared
# or
pnpm add @insy/shared
# or
yarn add @insy/sharedUsage
import type {
ElementInfo,
Framework,
FrameworkContext,
WebSocketMessage,
InsyConfig,
// ... other types
} from '@insy/shared';Types
Framework Detection
FrameworkType- Supported frameworks:'react' | 'vue' | 'svelte' | 'nextjs' | 'html'Framework- Framework info with type, version, and devtools status
Element Context
ElementInfo- Complete element information (tag, class, id, bbox, screenshot, HTML, CSS, selectors)BoundingBox- Element position and dimensionsReactContext- 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 contextsSourceHints- Source file location hints
WebSocket Messages
WebSocketMessage- Base message formatPromptSubmitPayload- Prompt submission with full element contextStatusUpdatePayload- Processing status updatesErrorPayload- Error informationConversationMessage- Chat history message
Configuration
InsyConfig- Full configuration schemaAIConfig- AI provider settingsServerConfig- Server host/port settingsEditorConfig- Editor mode settingsUIConfig- UI preferences
File Attachments
FileAttachment- Image attachment for prompts
Utilities
import { createMessage } from '@insy/shared';
const msg = createMessage('status', { stage: 'analyzing', message: 'Processing...' });Related Packages
- @insy/client - Browser client
- @insy/server - Local server
- @insy/vite - Vite plugin
- @insy/next - Next.js plugin
License
MIT