@omniterm/plugin-types
Advanced tools
+0
-79
@@ -75,79 +75,2 @@ /** | ||
| } | ||
| /** Display mode shared by side panels with docked/overlay support. */ | ||
| export type PanelDisplayMode = 'overlay' | 'docked'; | ||
| export type WorkspacesPanelMode = PanelDisplayMode; | ||
| export type FilesPanelMode = PanelDisplayMode; | ||
| /** xterm renderer used by ttyd: 'webgl' (GPU, fast) or 'dom' (compatible fallback). */ | ||
| export type TerminalRenderer = 'webgl' | 'dom'; | ||
| /** Persisted host settings, as handed to plugins by `HostContext.settings()`. */ | ||
| export interface Settings { | ||
| trackedRepos: string[]; | ||
| trackedDirs: string[]; | ||
| lastActiveWorktree: string | null; | ||
| sidebarCollapsed: boolean; | ||
| namingSchemes: Record<string, string>; | ||
| terminalFontSize: number; | ||
| defaultShell: string; | ||
| terminalTabs: Record<string, { | ||
| id: string; | ||
| name: string; | ||
| }[]>; | ||
| activeSessionId: string | null; | ||
| activePath: string | null; | ||
| /** | ||
| * Display mode for the left workspaces panel on wide viewports. | ||
| * "docked" pins it as a permanent left sidebar; "overlay" floats it | ||
| * over the terminal area. Narrow viewports (< 768px) always overlay | ||
| * regardless of this value. | ||
| */ | ||
| workspacesPanelMode: WorkspacesPanelMode; | ||
| /** | ||
| * Visibility of the docked workspaces panel. Only consulted when | ||
| * `workspacesPanelMode === "docked"` and the viewport is wide. The | ||
| * overlay path uses transient in-memory state, not this setting. | ||
| */ | ||
| workspacesPanelDockedOpen: boolean; | ||
| /** | ||
| * Display mode for the right files panel on wide viewports. | ||
| * "docked" pins it as a permanent right sidebar (auto-narrows to | ||
| * tree-only when no file tabs are open); "overlay" floats it over | ||
| * the terminal area. Narrow viewports (< 768px) always overlay. | ||
| */ | ||
| filesPanelMode: FilesPanelMode; | ||
| /** | ||
| * Visibility of the docked files panel. Only consulted when | ||
| * `filesPanelMode === "docked"` and the viewport is wide. The | ||
| * overlay path uses transient in-memory state, not this setting. | ||
| */ | ||
| filesPanelDockedOpen: boolean; | ||
| /** | ||
| * Whether the browser-view side panel is open in the UI. null means | ||
| * "user has never interacted with it" — the frontend picks a default | ||
| * (open on desktop, closed on mobile) on first render. | ||
| */ | ||
| browserPanelOpen: boolean | null; | ||
| /** | ||
| * Per-workspace open file tabs. Key is the workspace dir (matches | ||
| * activePath); value is the list of relative paths currently open in | ||
| * the file panel and which one is active. Empty/missing key → no tabs. | ||
| */ | ||
| filePanelTabs: Record<string, { | ||
| open: string[]; | ||
| active: string | null; | ||
| }>; | ||
| /** | ||
| * Whether anonymous usage + performance telemetry is enabled. Opt-out: | ||
| * defaults to true; set false (via the Settings UI or `omniterm telemetry | ||
| * off`) to disable. Env signals (DO_NOT_TRACK, OMNITERM_TELEMETRY=0) override | ||
| * this and force telemetry off regardless. | ||
| */ | ||
| telemetryEnabled: boolean; | ||
| /** | ||
| * xterm renderer for terminals. 'webgl' (default) is GPU-accelerated and far | ||
| * faster for large scrollback; 'dom' is the compatible fallback if webgl | ||
| * misbehaves (rendering/selection glitches on some GPUs or remote setups). | ||
| * Applies to newly opened terminals. | ||
| */ | ||
| terminalRenderer: TerminalRenderer; | ||
| } | ||
| /** | ||
@@ -388,4 +311,2 @@ * A tab-type plugin. One plugin per tab type (terminal, debugger, etc). | ||
| allowedRoots(): string[]; | ||
| /** Current host settings snapshot. */ | ||
| settings(): Settings; | ||
| /** Tracked repositories/directories. */ | ||
@@ -392,0 +313,0 @@ repos(): Repo[]; |
+1
-1
| { | ||
| "name": "@omniterm/plugin-types", | ||
| "version": "0.1.0", | ||
| "version": "0.1.1", | ||
| "description": "Type-only contract between omniterm and its tab-type plugins: TabTypePlugin, HostContext, PluginInstance, and the workspace shapes they carry. No runtime code.", | ||
@@ -5,0 +5,0 @@ "type": "module", |
+24
-4
@@ -7,12 +7,17 @@ # @omniterm/plugin-types | ||
| Install it as a dev dependency and mark it external in your bundler: | ||
| Install it as a dev dependency, keep it external in your bundler, and install | ||
| Express as a runtime dependency: | ||
| ```bash | ||
| npm install --save-dev @omniterm/plugin-types | ||
| npm install express | ||
| ``` | ||
| ```ts | ||
| import type { HostContext, TabTypePlugin } from '@omniterm/plugin-types'; | ||
| import { Router } from 'express'; | ||
| import type { TabTypePlugin } from '@omniterm/plugin-types'; | ||
| export default function createMyPlugin(): TabTypePlugin { | ||
| let nextId = 1; | ||
| return { | ||
@@ -22,5 +27,20 @@ type: 'my-plugin', | ||
| proxyPrefix: '', | ||
| createRouter(host: HostContext) { | ||
| /* ... */ | ||
| manifest: { | ||
| type: 'my-plugin', | ||
| label: 'My Plugin', | ||
| ephemeral: true, | ||
| tabTypeChoice: { label: 'My Plugin' }, | ||
| endpoints: { create: '/api/my-plugin/instances' }, | ||
| iframe: { urlTemplate: '/my-plugin/{id}' }, | ||
| }, | ||
| createRouter() { | ||
| const router = Router(); | ||
| router.post('/api/my-plugin/instances', (_req, res) => { | ||
| res.json({ id: `my-plugin-${nextId++}`, name: 'My Plugin' }); | ||
| }); | ||
| router.get('/my-plugin/:id', (_req, res) => { | ||
| res.type('html').send('<!doctype html><h1>My Plugin</h1>'); | ||
| }); | ||
| return router; | ||
| }, | ||
| }; | ||
@@ -27,0 +47,0 @@ } |
Unstable ownership
Supply chain riskA new collaborator has begun publishing package versions. Package stability and security risk may be elevated.
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
74
37.04%24845
-9.82%433
-15.43%1
Infinity%1
Infinity%