@naxodev/opencode-music-player 0.1.0 → 0.1.2

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.
Files changed (2) hide show
  1. package/index.tsx +10 -5
  2. package/package.json +1 -1
package/index.tsx CHANGED
@@ -1,5 +1,6 @@
1
1
  /** @jsxImportSource @opentui/solid */
2
2
  import { Plugin } from "@opencode-ai/plugin/tui"
3
+ import { createStore, produce } from "solid-js/store"
3
4
  import { createSessionSystemMedia, openNowPlayingApp } from "./system-media.ts"
4
5
  import { isMac, mergeArtworkCompletion, type SessionMedia } from "./types.ts"
5
6
  import { CompactPlayer, SidebarPlayer, type UiState } from "./ui.tsx"
@@ -82,10 +83,14 @@ export function createController(
82
83
  context: Context,
83
84
  dependencies: ControllerDependencies = controllerDependencies,
84
85
  ): Controller {
85
- const [session, setSession] = context.storage.memory<SessionStore>(
86
- "music-player.session.v5",
87
- { initial: { loading: false, error: null, player: null } },
88
- )
86
+ // Host storage may use another Solid runtime when this plugin comes from npm.
87
+ const [session, setSessionStore] = createStore<SessionStore>({
88
+ loading: false,
89
+ error: null,
90
+ player: null,
91
+ })
92
+ const setSession = (update: (draft: SessionStore) => void) =>
93
+ setSessionStore(produce(update))
89
94
  const media = dependencies.createSessionMedia()
90
95
  let disposed = false
91
96
  let lifecycleGeneration = 0
@@ -400,7 +405,7 @@ export function createMusicPlayerPlugin(options?: {
400
405
  : controllerDependencies,
401
406
  )
402
407
  const unsubApp = context.ui.slot({
403
- append: "app",
408
+ append: "session.composer.top",
404
409
  render: () => <AppHost context={context} ctrl={ctrl} />,
405
410
  })
406
411
  const unsubSidebar = context.ui.slot({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@naxodev/opencode-music-player",
3
- "version": "0.1.0",
3
+ "version": "0.1.2",
4
4
  "description": "macOS system Now Playing controls for the OpenCode 2 TUI",
5
5
  "license": "MIT",
6
6
  "author": {