From 5255f26d6bd6587552e854bdc613dcc08a9e9577 Mon Sep 17 00:00:00 2001 From: Henrik Hautakoski Date: Thu, 30 Apr 2026 16:56:07 +0200 Subject: [PATCH] add opencode --- opencode/.gitignore | 1 + opencode/bun.lock | 18 +++ opencode/commands/commit.md | 9 ++ opencode/opencode.json | 3 + opencode/package-lock.json | 115 +++++++++++++++ opencode/package.json | 5 + opencode/plugins/notification.ts | 12 ++ opencode/themes/custom.json | 233 +++++++++++++++++++++++++++++++ opencode/tui.json | 4 + 9 files changed, 400 insertions(+) create mode 100644 opencode/.gitignore create mode 100644 opencode/bun.lock create mode 100644 opencode/commands/commit.md create mode 100644 opencode/opencode.json create mode 100644 opencode/package-lock.json create mode 100644 opencode/package.json create mode 100644 opencode/plugins/notification.ts create mode 100644 opencode/themes/custom.json create mode 100644 opencode/tui.json diff --git a/opencode/.gitignore b/opencode/.gitignore new file mode 100644 index 0000000..3c3629e --- /dev/null +++ b/opencode/.gitignore @@ -0,0 +1 @@ +node_modules diff --git a/opencode/bun.lock b/opencode/bun.lock new file mode 100644 index 0000000..7f264dd --- /dev/null +++ b/opencode/bun.lock @@ -0,0 +1,18 @@ +{ + "lockfileVersion": 1, + "configVersion": 1, + "workspaces": { + "": { + "dependencies": { + "@opencode-ai/plugin": "1.3.13", + }, + }, + }, + "packages": { + "@opencode-ai/plugin": ["@opencode-ai/plugin@1.3.13", "", { "dependencies": { "@opencode-ai/sdk": "1.3.13", "zod": "4.1.8" }, "peerDependencies": { "@opentui/core": ">=0.1.95", "@opentui/solid": ">=0.1.95" }, "optionalPeers": ["@opentui/core", "@opentui/solid"] }, "sha512-zHgtWfdDz8Wu8srE8f8HUtPT9i6c3jTmgQKoFZUZ+RR5CMQF1kAlb1cxeEe9Xm2DRNFVJog9Cv/G1iUHYgXSUQ=="], + + "@opencode-ai/sdk": ["@opencode-ai/sdk@1.3.13", "", {}, "sha512-/M6HlNnba+xf1EId6qFb2tG0cvq0db3PCQDug1glrf8wYOU57LYNF8WvHX9zoDKPTMv0F+O4pcP/8J+WvDaxHA=="], + + "zod": ["zod@4.1.8", "", {}, "sha512-5R1P+WwQqmmMIEACyzSvo4JXHY5WiAFHRMg+zBZKgKS+Q1viRa0C1hmUKtHltoIFKtIdki3pRxkmpP74jnNYHQ=="], + } +} diff --git a/opencode/commands/commit.md b/opencode/commands/commit.md new file mode 100644 index 0000000..462dae8 --- /dev/null +++ b/opencode/commands/commit.md @@ -0,0 +1,9 @@ +--- +description: Analyze git changes +agent: build +temprature: 0.1 +--- + +You are analyzing staged changes in git to formalize a commit message and commit the changes. + +* Analyze previous commits to see what style to use. diff --git a/opencode/opencode.json b/opencode/opencode.json new file mode 100644 index 0000000..720ece5 --- /dev/null +++ b/opencode/opencode.json @@ -0,0 +1,3 @@ +{ + "$schema": "https://opencode.ai/config.json" +} diff --git a/opencode/package-lock.json b/opencode/package-lock.json new file mode 100644 index 0000000..8a76a82 --- /dev/null +++ b/opencode/package-lock.json @@ -0,0 +1,115 @@ +{ + "name": "opencode", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "dependencies": { + "@opencode-ai/plugin": "1.3.17" + } + }, + "node_modules/@opencode-ai/plugin": { + "version": "1.3.17", + "resolved": "https://registry.npmjs.org/@opencode-ai/plugin/-/plugin-1.3.17.tgz", + "integrity": "sha512-N5lckFtYvEu2R8K1um//MIOTHsJHniF2kHoPIWPCrxKG5Jpismt1ISGzIiU3aKI2ht/9VgcqKPC5oZFLdmpxPw==", + "license": "MIT", + "dependencies": { + "@opencode-ai/sdk": "1.3.17", + "zod": "4.1.8" + }, + "peerDependencies": { + "@opentui/core": ">=0.1.96", + "@opentui/solid": ">=0.1.96" + }, + "peerDependenciesMeta": { + "@opentui/core": { + "optional": true + }, + "@opentui/solid": { + "optional": true + } + } + }, + "node_modules/@opencode-ai/sdk": { + "version": "1.3.17", + "resolved": "https://registry.npmjs.org/@opencode-ai/sdk/-/sdk-1.3.17.tgz", + "integrity": "sha512-2+MGgu7wynqTBwxezR01VAGhILXlpcHDY/pF7SWB87WOgLt3kD55HjKHNj6PWxyY8n575AZolR95VUC3gtwfmA==", + "license": "MIT", + "dependencies": { + "cross-spawn": "7.0.6" + } + }, + "node_modules/cross-spawn": { + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz", + "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==", + "license": "MIT", + "dependencies": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", + "license": "ISC" + }, + "node_modules/path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "license": "MIT", + "dependencies": { + "shebang-regex": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "license": "ISC", + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "node-which": "bin/node-which" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/zod": { + "version": "4.1.8", + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/colinhacks" + } + } + } +} diff --git a/opencode/package.json b/opencode/package.json new file mode 100644 index 0000000..84371bf --- /dev/null +++ b/opencode/package.json @@ -0,0 +1,5 @@ +{ + "dependencies": { + "@opencode-ai/plugin": "1.3.17" + } +} \ No newline at end of file diff --git a/opencode/plugins/notification.ts b/opencode/plugins/notification.ts new file mode 100644 index 0000000..073c360 --- /dev/null +++ b/opencode/plugins/notification.ts @@ -0,0 +1,12 @@ +import { Plugin } from "@opencode-ai/plugin" + +export const NotificationPlugin : Plugin = async ({ project, client, $, directory, worktree }) => { + return { + event: async ({ event }) => { + // Send notification on session completion + if (event.type === "session.idle") { + await $`notify-send "Opencode" "Agent finished"` + } + }, + } +} diff --git a/opencode/themes/custom.json b/opencode/themes/custom.json new file mode 100644 index 0000000..e16dbc5 --- /dev/null +++ b/opencode/themes/custom.json @@ -0,0 +1,233 @@ +{ + "$schema": "https://opencode.ai/theme.json", + "defs": { + "macRosewater": "#f4dbd6", + "macFlamingo": "#f0c6c6", + "macPink": "#f5bde6", + "macMauve": "#c6a0f6", + "macRed": "#ed8796", + "macMaroon": "#ee99a0", + "macPeach": "#f5a97f", + "macYellow": "#eed49f", + "macGreen": "#a6da95", + "macTeal": "#8bd5ca", + "macSky": "#91d7e3", + "macSapphire": "#7dc4e4", + "macBlue": "#8aadf4", + "macLavender": "#b7bdf8", + "macText": "#eceef4", + "macSubtext1": "#b8c0e0", + "macSubtext0": "#a5adcb", + "macOverlay2": "#767BA0", + "macOverlay1": "#5B5F7C", + "macOverlay0": "#3F4256", + "macSurface2": "#41476F", + "macSurface1": "#343959", + "macSurface0": "#1a1c2d", + "macBase": "#0E1019", + "macMantle": "#0D0F17", + "macCrust": "#0C0D14" + }, + "theme": { + "primary": { + "dark": "macBlue", + "light": "macBlue" + }, + "secondary": { + "dark": "macMauve", + "light": "macMauve" + }, + "accent": { + "dark": "macPink", + "light": "macPink" + }, + "error": { + "dark": "macRed", + "light": "macRed" + }, + "warning": { + "dark": "macYellow", + "light": "macYellow" + }, + "success": { + "dark": "macGreen", + "light": "macGreen" + }, + "info": { + "dark": "macTeal", + "light": "macTeal" + }, + "text": { + "dark": "macText", + "light": "macText" + }, + "textMuted": { + "dark": "macSubtext1", + "light": "macSubtext1" + }, + "background": { + "dark": "macBase", + "light": "macBase" + }, + "backgroundPanel": { + "dark": "macMantle", + "light": "macMantle" + }, + "backgroundElement": { + "dark": "macCrust", + "light": "macCrust" + }, + "border": { + "dark": "macSurface0", + "light": "macSurface0" + }, + "borderActive": { + "dark": "macSurface1", + "light": "macSurface1" + }, + "borderSubtle": { + "dark": "macSurface2", + "light": "macSurface2" + }, + "diffAdded": { + "dark": "macGreen", + "light": "macGreen" + }, + "diffRemoved": { + "dark": "macRed", + "light": "macRed" + }, + "diffContext": { + "dark": "macOverlay2", + "light": "macOverlay2" + }, + "diffHunkHeader": { + "dark": "macPeach", + "light": "macPeach" + }, + "diffHighlightAdded": { + "dark": "macGreen", + "light": "macGreen" + }, + "diffHighlightRemoved": { + "dark": "macRed", + "light": "macRed" + }, + "diffAddedBg": { + "dark": "#29342b", + "light": "#29342b" + }, + "diffRemovedBg": { + "dark": "#3a2a31", + "light": "#3a2a31" + }, + "diffContextBg": { + "dark": "macMantle", + "light": "macMantle" + }, + "diffLineNumber": { + "dark": "macSurface1", + "light": "macSurface1" + }, + "diffAddedLineNumberBg": { + "dark": "#223025", + "light": "#223025" + }, + "diffRemovedLineNumberBg": { + "dark": "#2f242b", + "light": "#2f242b" + }, + "markdownText": { + "dark": "macText", + "light": "macText" + }, + "markdownHeading": { + "dark": "macMauve", + "light": "macMauve" + }, + "markdownLink": { + "dark": "macBlue", + "light": "macBlue" + }, + "markdownLinkText": { + "dark": "macSky", + "light": "macSky" + }, + "markdownCode": { + "dark": "macGreen", + "light": "macGreen" + }, + "markdownBlockQuote": { + "dark": "macYellow", + "light": "macYellow" + }, + "markdownEmph": { + "dark": "macYellow", + "light": "macYellow" + }, + "markdownStrong": { + "dark": "macPeach", + "light": "macPeach" + }, + "markdownHorizontalRule": { + "dark": "macSubtext0", + "light": "macSubtext0" + }, + "markdownListItem": { + "dark": "macBlue", + "light": "macBlue" + }, + "markdownListEnumeration": { + "dark": "macSky", + "light": "macSky" + }, + "markdownImage": { + "dark": "macBlue", + "light": "macBlue" + }, + "markdownImageText": { + "dark": "macSky", + "light": "macSky" + }, + "markdownCodeBlock": { + "dark": "macText", + "light": "macText" + }, + "syntaxComment": { + "dark": "macOverlay2", + "light": "macOverlay2" + }, + "syntaxKeyword": { + "dark": "macMauve", + "light": "macMauve" + }, + "syntaxFunction": { + "dark": "macBlue", + "light": "macBlue" + }, + "syntaxVariable": { + "dark": "macRed", + "light": "macRed" + }, + "syntaxString": { + "dark": "macGreen", + "light": "macGreen" + }, + "syntaxNumber": { + "dark": "macPeach", + "light": "macPeach" + }, + "syntaxType": { + "dark": "macYellow", + "light": "macYellow" + }, + "syntaxOperator": { + "dark": "macSky", + "light": "macSky" + }, + "syntaxPunctuation": { + "dark": "macText", + "light": "macText" + } + } +} diff --git a/opencode/tui.json b/opencode/tui.json new file mode 100644 index 0000000..abdf4d1 --- /dev/null +++ b/opencode/tui.json @@ -0,0 +1,4 @@ +{ + "$schema": "https://opencode.ai/tui.json", + "theme": "custom" +}