From e281fc7b8c7b09b57e693abd4413f7ab11fa3d3c Mon Sep 17 00:00:00 2001 From: Daniel Smolsky Date: Tue, 25 Nov 2025 02:47:42 -0500 Subject: [PATCH 1/2] Add logging to version checker for better observability - Accept optional logger parameter in checkForUpdates - Log when version check is skipped (npm fetch failed) - Log when plugin is up to date with current versions - Log when an update is available with version details --- index.ts | 2 +- lib/version-checker.ts | 14 +++++++++++--- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/index.ts b/index.ts index fc2e7726..d3e5ab15 100644 --- a/index.ts +++ b/index.ts @@ -147,7 +147,7 @@ const plugin: Plugin = (async (ctx) => { }) // Check for updates on launch (fire and forget) - checkForUpdates(ctx.client).catch(() => {}) + checkForUpdates(ctx.client, logger).catch(() => {}) return { /** diff --git a/lib/version-checker.ts b/lib/version-checker.ts index fcc0c97a..ab20e771 100644 --- a/lib/version-checker.ts +++ b/lib/version-checker.ts @@ -65,15 +65,23 @@ export function isOutdated(local: string, remote: string): boolean { * Checks for updates and shows a toast if outdated. * Fire-and-forget: does not throw, logs errors silently. */ -export async function checkForUpdates(client: any): Promise { +export async function checkForUpdates(client: any, logger?: { info: (component: string, message: string, data?: any) => void }): Promise { try { const local = getLocalVersion() const npm = await getNpmVersion() - if (!npm || !isOutdated(local, npm)) { - return // Up to date or couldn't fetch + if (!npm) { + logger?.info("version", "Version check skipped", { reason: "npm fetch failed" }) + return } + if (!isOutdated(local, npm)) { + logger?.info("version", "Up to date", { local, npm }) + return + } + + logger?.info("version", "Update available", { local, npm }) + await client.tui.showToast({ body: { title: "DCP: Update available", From 832833bace660463ab3c3de5da6d818b192b3d8b Mon Sep 17 00:00:00 2001 From: Daniel Smolsky Date: Tue, 25 Nov 2025 02:48:02 -0500 Subject: [PATCH 2/2] v0.3.13 - Bump version --- README.md | 2 +- package-lock.json | 4 ++-- package.json | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 7fcc1fe0..c80b831a 100644 --- a/README.md +++ b/README.md @@ -78,7 +78,7 @@ If you want to ensure a specific version is always used or update your version, ```json { "plugin": [ - "@tarquinen/opencode-dcp@0.3.12" + "@tarquinen/opencode-dcp@0.3.13" ] } ``` diff --git a/package-lock.json b/package-lock.json index b2abf5fa..c1053a8b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@tarquinen/opencode-dcp", - "version": "0.3.12", + "version": "0.3.13", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@tarquinen/opencode-dcp", - "version": "0.3.12", + "version": "0.3.13", "license": "MIT", "dependencies": { "@ai-sdk/openai-compatible": "^1.0.27", diff --git a/package.json b/package.json index 47bfe924..6a3c5c6f 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "$schema": "https://json.schemastore.org/package.json", "name": "@tarquinen/opencode-dcp", - "version": "0.3.12", + "version": "0.3.13", "type": "module", "description": "OpenCode plugin that optimizes token usage by pruning obsolete tool outputs from conversation context", "main": "./dist/index.js",