@nandoblanco/opencode-local-backup 1.0.1 → 1.0.2

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/index.js +11 -2
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -1235,8 +1235,17 @@ function createPluginDefinition() {
1235
1235
  if (hookReg) registrations.push(hookReg);
1236
1236
  }
1237
1237
 
1238
- if (ctx && ctx.tool && typeof ctx.tool.register === "function") {
1239
- const toolReg = await ctx.tool.register(function (editor) {
1238
+ const toolTransform =
1239
+ ctx && ctx.tool
1240
+ ? typeof ctx.tool.transform === "function"
1241
+ ? ctx.tool.transform.bind(ctx.tool)
1242
+ : typeof ctx.tool.register === "function"
1243
+ ? ctx.tool.register.bind(ctx.tool)
1244
+ : null
1245
+ : null;
1246
+
1247
+ if (toolTransform) {
1248
+ const toolReg = await toolTransform(function (editor) {
1240
1249
  editor.add({
1241
1250
  name: "backup_list",
1242
1251
  description: "List recent automatic and manual file backup snapshots in .backups/ for the current project.",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nandoblanco/opencode-local-backup",
3
- "version": "1.0.1",
3
+ "version": "1.0.2",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },