@xinleibird/bridge-opencode 0.1.8 → 0.2.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.
Binary file
Binary file
Binary file
package/bridge.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import type { Plugin } from "@opencode-ai/plugin";
2
2
  import { isAbsolute, join } from "node:path";
3
- import { checkBuffer, refreshBuffer, getVisualSelections } from "./index.cjs";
3
+ import { checkBuffer, refreshBuffer, getVisualSelections, sendMessage } from "./index.cjs";
4
4
 
5
5
  type ToolName = "Edit" | "Write";
6
6
 
@@ -67,6 +67,7 @@ export const BridgePlugin: Plugin = async ({ directory }) => {
67
67
  for (const filePath of call.filePaths) {
68
68
  const status = await checkBuffer(filePath);
69
69
  if (status.hasUnsavedChanges && status.isCurrent) {
70
+ await sendMessage("File has unsaved changes. Please save it first.");
70
71
  throw new Error(
71
72
  "STOP: Cannot apply changes — Neovim has unsaved edits. DO NOT attempt to resolve this yourself. Wait for the user to save or close the file. DO NOT use the Built-In Tools resolve this.",
72
73
  );
@@ -103,8 +104,8 @@ export const BridgePlugin: Plugin = async ({ directory }) => {
103
104
 
104
105
  const lines = filteredSelections.map((s) => {
105
106
  const path = s.filePath.startsWith(cwd + "/")
106
- ? "./" + s.filePath.slice(cwd.length + 1)
107
- : s.filePath;
107
+ ? "- @" + s.filePath.slice(cwd.length + 1)
108
+ : "- " + s.filePath;
108
109
  return `${path}:${s.startLine}-${s.endLine}`;
109
110
  });
110
111
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xinleibird/bridge-opencode",
3
- "version": "0.1.8",
3
+ "version": "0.2.0",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/xinleibird/bridge-opencode"
package/rustfmt.toml ADDED
File without changes