@grympler/opencode-tmux-handover 1.0.0 → 1.0.1

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/package.json +1 -1
  2. package/src/index.ts +15 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@grympler/opencode-tmux-handover",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "OpenCode Desktop plugin for launching tmux with AI assistants (OpenCode, Claude, Copilot) in split panes",
5
5
  "main": "src/index.ts",
6
6
  "type": "module",
package/src/index.ts CHANGED
@@ -1,6 +1,8 @@
1
1
  import type { Plugin } from "@opencode-ai/plugin"
2
2
  import { fileURLToPath } from "url"
3
3
  import { dirname, join } from "path"
4
+ import { existsSync } from "fs"
5
+ import { homedir } from "os"
4
6
  import { loadConfig } from "./config.js"
5
7
 
6
8
  const __filename = fileURLToPath(import.meta.url)
@@ -9,6 +11,19 @@ const __dirname = dirname(__filename)
9
11
  export const TmuxLauncher: Plugin = async ({ $, directory }) => {
10
12
  const config = loadConfig()
11
13
 
14
+ // Auto-install check: ensure commands are symlinked
15
+ const installCheckPath = join(homedir(), ".config", "opencode", "commands", "tt-configure.md")
16
+ if (!existsSync(installCheckPath)) {
17
+ try {
18
+ const installScript = join(__dirname, "..", "install.sh")
19
+ // Run install script quietly
20
+ await $`bash ${installScript}`.quiet()
21
+ console.log("tt-plugin: Auto-installation completed")
22
+ } catch (err) {
23
+ console.error("tt-plugin: Auto-install failed:", err)
24
+ }
25
+ }
26
+
12
27
  return {
13
28
  "command.execute.before": async (input, output) => {
14
29
  const commandName = input.command || ""