opencode-navigator 0.11.0

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.
package/package.json ADDED
@@ -0,0 +1,89 @@
1
+ {
2
+ "$schema": "https://json.schemastore.org/package.json",
3
+ "name": "opencode-navigator",
4
+ "version": "0.11.0",
5
+ "description": "Search, navigate, and manage OpenCode sessions from the TUI",
6
+ "type": "module",
7
+ "packageManager": "bun@1.4.0",
8
+ "license": "MIT",
9
+ "author": "St1ggy",
10
+ "repository": {
11
+ "type": "git",
12
+ "url": "git+https://github.com/St1ggy/opencode-navigator.git"
13
+ },
14
+ "homepage": "https://github.com/St1ggy/opencode-navigator#readme",
15
+ "bugs": {
16
+ "url": "https://github.com/St1ggy/opencode-navigator/issues"
17
+ },
18
+ "keywords": [
19
+ "opencode",
20
+ "opencode-plugin",
21
+ "tui",
22
+ "sidebar",
23
+ "search",
24
+ "navigator",
25
+ "skills",
26
+ "mcp"
27
+ ],
28
+ "files": [
29
+ "dist",
30
+ "assets",
31
+ "scripts/install-font.mjs",
32
+ "README.md",
33
+ "LICENSE"
34
+ ],
35
+ "bin": {
36
+ "opencode-navigator-font": "./scripts/install-font.mjs"
37
+ },
38
+ "exports": {
39
+ "./tui": {
40
+ "import": "./dist/tui.js"
41
+ }
42
+ },
43
+ "publishConfig": {
44
+ "access": "public"
45
+ },
46
+ "engines": {
47
+ "opencode": ">=1.18.30"
48
+ },
49
+ "scripts": {
50
+ "build": "bun run build.ts",
51
+ "bundle:size": "bun run build && bun run scripts/check-bundle-size.ts",
52
+ "format": "prettier --write --ignore-unknown .",
53
+ "format:check": "prettier --check --ignore-unknown .",
54
+ "font:install": "node scripts/install-font.mjs",
55
+ "font:build": "uv run scripts/generate-corner-font.py",
56
+ "font:check": "uv run scripts/generate-corner-font.py --check",
57
+ "lint": "bun run lint:eslint",
58
+ "lint:eslint": "eslint . --max-warnings 0",
59
+ "lint:fix": "eslint . --fix && bun run format",
60
+ "prepublishOnly": "bun run check",
61
+ "test": "bun run build && bun test --preload @opentui/solid/preload",
62
+ "test:e2e": "bun run build && bash scripts/smoke-opencode.sh",
63
+ "typecheck": "tsc --noEmit",
64
+ "check": "bun run test && bun run typecheck && bun run lint && bun run bundle:size && bun run format:check"
65
+ },
66
+ "peerDependencies": {
67
+ "@opencode-ai/plugin": ">=1.18.30",
68
+ "@opentui/core": ">=0.4.5",
69
+ "@opentui/keymap": ">=0.4.5",
70
+ "@opentui/solid": ">=0.4.5",
71
+ "solid-js": ">=1.9.12"
72
+ },
73
+ "devDependencies": {
74
+ "@opencode-ai/plugin": "1.18.30",
75
+ "@opencode-ai/sdk": "1.18.30",
76
+ "@opentui/core": "0.4.5",
77
+ "@opentui/keymap": "0.4.5",
78
+ "@opentui/solid": "0.4.5",
79
+ "@st1ggy/linter-config": "7.3.1",
80
+ "@types/bun": "1.4.0",
81
+ "eslint": "10.8.0",
82
+ "eslint-config-prettier": "10.1.8",
83
+ "eslint-plugin-solid": "0.18.0",
84
+ "prettier": "3.9.6",
85
+ "solid-js": "1.9.12",
86
+ "typescript": "6.0.3",
87
+ "web-tree-sitter": "0.25.10"
88
+ }
89
+ }
@@ -0,0 +1,75 @@
1
+ #!/usr/bin/env node
2
+ import { execFile } from 'node:child_process'
3
+ import { copyFile, mkdir, rename, unlink } from 'node:fs/promises'
4
+ import { homedir } from 'node:os'
5
+ import { dirname, join, resolve } from 'node:path'
6
+ import process from 'node:process'
7
+ import { fileURLToPath } from 'node:url'
8
+ import { parseArgs, promisify } from 'node:util'
9
+
10
+ const filename = 'OpenCodeNavigatorCorners.ttf'
11
+ const execute = promisify(execFile)
12
+ const { values } = parseArgs({
13
+ options: {
14
+ help: { type: 'boolean', short: 'h' },
15
+ directory: { type: 'string' },
16
+ source: { type: 'string' },
17
+ uninstall: { type: 'boolean' },
18
+ },
19
+ })
20
+
21
+ if (values.help) {
22
+ console.log('Usage: opencode-navigator-font [--uninstall] [--directory PATH] [--source FONT.ttf]')
23
+ console.log('Installs the Navigator corner font for the current user. Keep your main terminal font unchanged.')
24
+ } else {
25
+ const directories = {
26
+ darwin: join(homedir(), 'Library', 'Fonts'),
27
+ linux: join(process.env.XDG_DATA_HOME || join(homedir(), '.local', 'share'), 'fonts', 'opencode-navigator'),
28
+ win32: process.env.LOCALAPPDATA && join(process.env.LOCALAPPDATA, 'Microsoft', 'Windows', 'Fonts'),
29
+ }
30
+ const directory = values.directory || directories[process.platform]
31
+
32
+ if (!directory) throw new Error('Specify --directory with your user font directory on this platform.')
33
+
34
+ const destination = resolve(directory, filename)
35
+ const registry = String.raw`HKCU\Software\Microsoft\Windows NT\CurrentVersion\Fonts`
36
+ const fontName = 'OpenCode Navigator Corners (TrueType)'
37
+
38
+ if (values.uninstall) {
39
+ await unlink(destination)
40
+
41
+ if (process.platform === 'win32' && !values.directory) {
42
+ await execute('reg.exe', ['delete', registry, '/v', fontName, '/f'])
43
+ }
44
+
45
+ console.log(`Removed ${destination}`)
46
+ } else {
47
+ const source = values.source
48
+ ? resolve(values.source)
49
+ : fileURLToPath(new URL(`../assets/${filename}`, import.meta.url))
50
+
51
+ await mkdir(dirname(destination), { recursive: true })
52
+ const temporary = `${destination}.${process.pid}.tmp`
53
+
54
+ try {
55
+ await copyFile(source, temporary)
56
+ await rename(temporary, destination)
57
+ } finally {
58
+ await unlink(temporary).catch((error) => {
59
+ if (error.code !== 'ENOENT') throw error
60
+ })
61
+ }
62
+
63
+ if (process.platform === 'win32' && !values.directory) {
64
+ await execute('reg.exe', ['add', registry, '/v', fontName, '/t', 'REG_SZ', '/d', destination, '/f'])
65
+ }
66
+
67
+ console.log(`Installed ${destination}`)
68
+ }
69
+
70
+ if (process.platform === 'linux' && !values.directory) {
71
+ await execute('fc-cache', ['-f', directory])
72
+ }
73
+
74
+ console.log('Fully restart your terminal application, then restart OpenCode.')
75
+ }