@hudsonos/sdk
v0.1.0
Published
SDK for building Hudson apps — types, hooks, and utilities
Maintainers
Readme
@hudsonos/sdk
SDK for building Hudson apps — types, hooks, and utilities.
Install
bun add @hudsonos/sdkPeer dependencies:
bun add react lucide-reactQuick Start
import type { HudsonApp } from '@hudsonos/sdk';
const myApp: HudsonApp = {
id: 'my-app',
name: 'My App',
mode: 'panel',
Provider: ({ children }) => <>{children}</>,
slots: {
Content: () => <div>Hello Hudson</div>,
},
hooks: {
useCommands: () => [],
useStatus: () => ({ label: 'Ready', color: 'emerald' }),
},
};What's Included
Types
HudsonApp— the contract every app must implementHudsonWorkspace— workspace configurationAppIntent— LLM/voice/search intent declarationsServiceDefinition— service registry typesAppPorts— inter-app data pipingCommandOption,ContextMenuEntry— UI overlay types
Hooks
usePersistentState(key, initial)— localStorage-backed useStateuseAppSettings(appId, config)— per-app settings with merge semanticsuseTerminalRelay(options)— WebSocket terminal relay connection
Utilities
sounds— tactile UI sounds via Web Audio APIlogEvent— event-based debug loggingworldToScreen/screenToWorld— canvas viewport mathderiveManifest— build app manifests from HudsonApp definitionsSHELL_THEME— design tokens for Hudson chrome
Platform
PlatformProvider/usePlatform— abstract host-specific concerns (web vs native)usePlatformLayout— derived layout measurementsWEB_ADAPTER— zero-config web defaults
Components
ZoomControls— canvas zoom widget with editable percentage
Styles
Import scrollbar styles for dark-themed panels:
@import "@hudsonos/sdk/styles.css";Tailwind CSS v4
To scan the SDK for Tailwind classes:
@import "tailwindcss";
@source "../node_modules/@hudsonos/sdk/dist/**/*.js";AI Support
AI types (HudsonAIChat, UseHudsonAIOptions, AIAttachment) are exported for typing.
The runtime ships separately as @hudsonos/ai (coming soon).
License
MIT
