@judaharagao/opencode-ssh 1.2.0 → 1.2.1

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.
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAA;;;;;AA4DjD,wBAGC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAA;;;;;AAiCjD,wBAGC"}
package/dist/index.js CHANGED
@@ -1,34 +1,9 @@
1
1
  import { createSshTools } from "./tools.js";
2
2
  import { createSshHooks } from "./hooks.js";
3
3
  import { resolveConfig } from "./config/defaults.js";
4
- /**
5
- * Validate that the host opencode runtime exposes the tool-building API this
6
- * plugin depends on. If the runtime is too old/incompatible, tools are
7
- * disabled instead of crashing at call time.
8
- */
9
- function validatePluginApi(ctx) {
10
- const c = ctx;
11
- if (!c || typeof c !== "object") {
12
- return { ok: false, reason: "Plugin context is invalid" };
13
- }
14
- if (typeof c.tool !== "function") {
15
- return { ok: false, reason: "ctx.tool is not available — runtime too old for tool-based plugins" };
16
- }
17
- const toolNs = c.tool;
18
- if (!toolNs.schema || typeof toolNs.schema !== "object") {
19
- return { ok: false, reason: "ctx.tool.schema (Zod-backed schema helpers) is missing — incompatible @opencode-ai/plugin" };
20
- }
21
- return { ok: true };
22
- }
23
- const SshPlugin = async (ctx, options) => {
4
+ const SshPlugin = async (_ctx, options) => {
24
5
  // ── Resolve configuration ──
25
6
  const config = resolveConfig(options);
26
- // ── Compatibility check against the host runtime ──
27
- const api = validatePluginApi(ctx);
28
- if (!api.ok) {
29
- console.warn(`[opencode-ssh] Plugin API incompatible: ${api.reason}. SSH tools are disabled.`);
30
- return {};
31
- }
32
7
  // ── Create tools and hooks with resolved config ──
33
8
  const tools = createSshTools(config.mode, config.max_sessions, config.default_timeout, config.blocklist_extra, config.ssh_config_path, config.auto_connect, {
34
9
  strictHostKey: config.strict_host_key,
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAA;AAC3C,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAA;AAC3C,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAA;AAGpD;;;;GAIG;AACH,SAAS,iBAAiB,CAAC,GAAY;IACrC,MAAM,CAAC,GAAG,GAA0C,CAAA;IACpD,IAAI,CAAC,CAAC,IAAI,OAAO,CAAC,KAAK,QAAQ,EAAE,CAAC;QAChC,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,2BAA2B,EAAE,CAAA;IAC3D,CAAC;IACD,IAAI,OAAO,CAAC,CAAC,IAAI,KAAK,UAAU,EAAE,CAAC;QACjC,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,oEAAoE,EAAE,CAAA;IACpG,CAAC;IACD,MAAM,MAAM,GAAG,CAAC,CAAC,IAA4B,CAAA;IAC7C,IAAI,CAAC,MAAM,CAAC,MAAM,IAAI,OAAO,MAAM,CAAC,MAAM,KAAK,QAAQ,EAAE,CAAC;QACxD,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,2FAA2F,EAAE,CAAA;IAC3H,CAAC;IACD,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,CAAA;AACrB,CAAC;AAED,MAAM,SAAS,GAAW,KAAK,EAAE,GAAG,EAAE,OAAO,EAAE,EAAE;IAC/C,8BAA8B;IAC9B,MAAM,MAAM,GAAwB,aAAa,CAAC,OAAkC,CAAC,CAAA;IAErF,qDAAqD;IACrD,MAAM,GAAG,GAAG,iBAAiB,CAAC,GAAG,CAAC,CAAA;I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B,MAAM,CAAC,eAAe,EACtB,MAAM,CAAC,eAAe,EACtB,MAAM,CAAC,YAAY,EACnB;QACE,aAAa,EAAE,MAAM,CAAC,eAAe;QACrC,kBAAkB,EAAE,MAAM,CAAC,qBAAqB;QAChD,eAAe,EAAE,MAAM,CAAC,gBAAgB;QACxC,aAAa,EAAE,MAAM,CAAC,cAAc;KACrC,CACF,CAAA;IACD,MAAM,KAAK,GAAG,cAAc,CAAC,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,eAAe,CAAC,CAAA;IAEjE,OAAO;QACL,IAAI,EAAE,KAAK;QACX,GAAG,KAAK;KACT,CAAA;AACH,CAAC,CAAA;AAED,eAAe;IACb,EAAE,EAAE,cAAc;IAClB,MAAM,EAAE,SAAS;CAClB,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@judaharagao/opencode-ssh",
3
- "version": "1.2.0",
3
+ "version": "1.2.1",
4
4
  "description": "SSH access plugin for OpenCode - secure remote command execution with command blocking",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",