opencode-resolve 0.1.16 → 0.1.17

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.
package/dist/index.js CHANGED
@@ -3,9 +3,20 @@ export * from "./agents.js";
3
3
  export * from "./utils.js";
4
4
  export * from "./config.js";
5
5
  export * from "./state.js";
6
+ import { fileURLToPath } from "node:url";
7
+ import { dirname } from "node:path";
6
8
  import { getTools } from "./tools/index.js";
7
9
  import { getHooks } from "./hooks/index.js";
8
10
  import { createSessionState } from "./state.js";
11
+ import { PLUGIN_VERSION } from "./utils.js";
12
+ if (process.env.OPENCODE_RESOLVE_QUIET !== "1") {
13
+ let where = "";
14
+ try {
15
+ where = ` (from: ${dirname(fileURLToPath(import.meta.url))})`;
16
+ }
17
+ catch { /* ignore */ }
18
+ console.log(`[opencode-resolve] v${PLUGIN_VERSION} loaded${where}`);
19
+ }
9
20
  export const OpencodeResolve = async ({ directory }, options) => {
10
21
  const sessionState = createSessionState();
11
22
  return {
@@ -238,6 +238,11 @@ export declare function getTools(sessionState: SessionState): {
238
238
  args: {};
239
239
  execute(args: Record<string, never>, context: import("@opencode-ai/plugin").ToolContext): Promise<import("@opencode-ai/plugin").ToolResult>;
240
240
  };
241
+ "resolve-version": {
242
+ description: string;
243
+ args: {};
244
+ execute(args: Record<string, never>, context: import("@opencode-ai/plugin").ToolContext): Promise<import("@opencode-ai/plugin").ToolResult>;
245
+ };
241
246
  "resolve-state": {
242
247
  description: string;
243
248
  args: {
@@ -2,7 +2,9 @@ import { tool } from "@opencode-ai/plugin";
2
2
  import { stat, readFile, access } from "node:fs/promises";
3
3
  import { resolve, join } from "node:path";
4
4
  import { writeFileSync, mkdirSync } from "node:fs";
5
- import { classifyBashCommand, runCommand, sanitizeShellArg, truncateOutput } from "../utils.js";
5
+ import { fileURLToPath } from "node:url";
6
+ import { dirname } from "node:path";
7
+ import { classifyBashCommand, runCommand, sanitizeShellArg, truncateOutput, PLUGIN_VERSION } from "../utils.js";
6
8
  import { DIAGNOSTICS_TTL_MS } from "../state.js";
7
9
  import { VALID_PROFILES, VALID_TIERS, VALID_AGENT_NAME_SET, VALID_AGENT_NAMES } from "../agents.js";
8
10
  const WRITE_CAPABLE_AGENTS = new Set(["resolver", "codex", "coder", "glm", "gpt-coder", "debugger"]);
@@ -1140,6 +1142,23 @@ export function getTools(sessionState) {
1140
1142
  return results.join("\n");
1141
1143
  },
1142
1144
  }),
1145
+ "resolve-version": tool({
1146
+ description: "Report the currently loaded opencode-resolve plugin version and the cache path it was loaded from. Use to confirm whether a recent install/update actually took effect inside OpenCode.",
1147
+ args: {},
1148
+ async execute(_args, ctx) {
1149
+ let loadedFrom = "unknown";
1150
+ try {
1151
+ loadedFrom = dirname(fileURLToPath(import.meta.url));
1152
+ }
1153
+ catch { /* ignore */ }
1154
+ const lines = [
1155
+ `opencode-resolve v${PLUGIN_VERSION}`,
1156
+ `loaded from: ${loadedFrom}`,
1157
+ ];
1158
+ ctx.metadata({ title: `version: v${PLUGIN_VERSION}` });
1159
+ return lines.join("\n");
1160
+ },
1161
+ }),
1143
1162
  "resolve-state": tool({
1144
1163
  description: "Read or write session state checkpoints to .opencode/resolve-state.json. Enables session resumption and cross-turn state persistence. Use 'save' to checkpoint current progress, 'load' to read last checkpoint.",
1145
1164
  args: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opencode-resolve",
3
- "version": "0.1.16",
3
+ "version": "0.1.17",
4
4
  "description": "OpenCode plugin that adds a lightweight resolver/coder harness for continuous agentic coding.",
5
5
  "type": "module",
6
6
  "homepage": "https://jshsakura.github.io/opencode-resolve/",