a template starter repo for sveltekit projects
0

Configure Feed

Select the types of activity you want to include in your feed.

suede / .opencode / plugins / version-check.ts
1.7 kB 44 lines
1// OpenCode Plugin: Version Check (no-op) 2// 3// Suede does not run `deciduous update` (see AGENTS.md "Do not run 4// `deciduous update`" note). The upstream `deciduous` tool's 5// `update` subcommand regenerates `.opencode/`, `.claude/`, and 6// `AGENTS.md` from its own defaults, which would silently overwrite 7// the hand-edited integration files in this repo. We treat version 8// upgrades as opt-in: install a new `deciduous` binary if you want 9// new features, then *manually* reconcile any new files you want to 10// pull in — never via `deciduous update`. 11// 12// This plugin used to phone crates.io once per 24h and prompt the 13// user to upgrade + run `deciduous update`. It was rewritten as a 14// no-op for the reason above. The first time it runs, it appends a 15// single line to `.deciduous/plugin.log` so the no-op is observable 16// to anyone reading the log. 17 18import type { Plugin } from '@opencode-ai/plugin'; 19 20export const VersionCheck: Plugin = async () => { 21 return { 22 'tool.execute.before': async () => { 23 try { 24 const fs = await import('fs'); 25 const path = await import('path'); 26 if (!fs.existsSync('.deciduous')) return; 27 const marker = path.join('.deciduous', '.version_check_disabled'); 28 if (fs.existsSync(marker)) return; 29 fs.writeFileSync( 30 marker, 31 `version-check plugin disabled at ${new Date().toISOString()}\n` + 32 `See AGENTS.md: do not run \`deciduous update\`.\n` 33 ); 34 const logFile = path.join('.deciduous', 'plugin.log'); 35 fs.appendFileSync( 36 logFile, 37 `[${new Date().toISOString()}] version-check plugin: no-op. Do not run \`deciduous update\` (see AGENTS.md).\n` 38 ); 39 } catch { 40 // Never let the plugin break edits. 41 } 42 } 43 }; 44};