@dougbots/avenor-opencode 0.3.1 → 0.3.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/dist/index.js +27 -28
  2. package/package.json +2 -3
package/dist/index.js CHANGED
@@ -1,5 +1,4 @@
1
1
  import { tool } from "@opencode-ai/plugin";
2
- import { z } from "zod";
3
2
  import * as crypto from "node:crypto";
4
3
  import { answerPermissionTool, eventsTool, followUpTool, shutdownTool, spawnTool, statusTool } from "@dougbots/avenor-core";
5
4
  //#region src/plugin.ts
@@ -196,17 +195,17 @@ const AvenorPlugin = async (ctx) => {
196
195
  avenor_spawn: tool({
197
196
  description: "Dispatch an agent run via avenor. Blocks by default, showing live progress as an updating tool call. Set wait=false for fire-and-forget — you will be re-prompted automatically on completion.",
198
197
  args: {
199
- agent: z.string().describe("Agent name (required, no default)"),
200
- prompt: z.string().optional().describe("Prompt text"),
201
- prompt_file: z.string().optional().describe("Path to prompt file"),
202
- dir: z.string().optional().describe("Working directory for the run (defaults to the session project directory)"),
203
- label: z.string().optional().describe("Human-readable label for the run"),
204
- timeout: z.string().optional().describe("Timeout duration (e.g. 3600s)"),
205
- model: z.string().optional().describe("Model override"),
206
- backend: z.string().optional().describe("Backend override"),
207
- server_url: z.string().optional().describe("Backend server URL"),
208
- supervisor_id: z.string().optional().describe("Reuse an existing supervisor by socket path"),
209
- wait: z.boolean().default(true).describe("Block until complete with live status updates. False = fire-and-forget.")
198
+ agent: tool.schema.string().describe("Agent name (required, no default)"),
199
+ prompt: tool.schema.string().optional().describe("Prompt text"),
200
+ prompt_file: tool.schema.string().optional().describe("Path to prompt file"),
201
+ dir: tool.schema.string().optional().describe("Working directory for the run (defaults to the session project directory)"),
202
+ label: tool.schema.string().optional().describe("Human-readable label for the run"),
203
+ timeout: tool.schema.string().optional().describe("Timeout duration (e.g. 3600s)"),
204
+ model: tool.schema.string().optional().describe("Model override"),
205
+ backend: tool.schema.string().optional().describe("Backend override"),
206
+ server_url: tool.schema.string().optional().describe("Backend server URL"),
207
+ supervisor_id: tool.schema.string().optional().describe("Reuse an existing supervisor by socket path"),
208
+ wait: tool.schema.boolean().default(true).describe("Block until complete with live status updates. False = fire-and-forget.")
210
209
  },
211
210
  async execute(args, context) {
212
211
  const parentRunId = ensureParentRunId();
@@ -310,8 +309,8 @@ const AvenorPlugin = async (ctx) => {
310
309
  avenor_status: tool({
311
310
  description: "Get status of a run or all runs. Surfaces pending permission requests.",
312
311
  args: {
313
- run_id: z.string().optional().describe("Specific run ID to query"),
314
- supervisor_id: z.string().optional().describe("Reuse an existing supervisor by socket path")
312
+ run_id: tool.schema.string().optional().describe("Specific run ID to query"),
313
+ supervisor_id: tool.schema.string().optional().describe("Reuse an existing supervisor by socket path")
315
314
  },
316
315
  async execute(args, _context) {
317
316
  const result = await statusTool({
@@ -324,10 +323,10 @@ const AvenorPlugin = async (ctx) => {
324
323
  avenor_answer_permission: tool({
325
324
  description: "Answer a pending permission request for a sub-agent. Pass option_id from avenor_status pending_permission.options, or use \"allow_once\", \"allow_always\", \"deny\".",
326
325
  args: {
327
- run_id: z.string().describe("Run ID with the pending permission"),
328
- option_id: z.string().describe("allow_once | allow_always | deny, or option_id from pending_permission.options"),
329
- request_id: z.string().optional().describe("Permission request ID (auto-discovered if omitted)"),
330
- supervisor_id: z.string().optional().describe("Reuse an existing supervisor by socket path")
326
+ run_id: tool.schema.string().describe("Run ID with the pending permission"),
327
+ option_id: tool.schema.string().describe("allow_once | allow_always | deny, or option_id from pending_permission.options"),
328
+ request_id: tool.schema.string().optional().describe("Permission request ID (auto-discovered if omitted)"),
329
+ supervisor_id: tool.schema.string().optional().describe("Reuse an existing supervisor by socket path")
331
330
  },
332
331
  async execute(args, _context) {
333
332
  const result = await answerPermissionTool({
@@ -342,10 +341,10 @@ const AvenorPlugin = async (ctx) => {
342
341
  avenor_follow_up: tool({
343
342
  description: "Resume a completed run with a follow-up message.",
344
343
  args: {
345
- run_id: z.string().describe("Completed run ID to resume"),
346
- message: z.string().describe("Follow-up message text"),
347
- label: z.string().optional().describe("Override label (defaults to <original>-followup)"),
348
- supervisor_id: z.string().optional().describe("Reuse an existing supervisor by socket path")
344
+ run_id: tool.schema.string().describe("Completed run ID to resume"),
345
+ message: tool.schema.string().describe("Follow-up message text"),
346
+ label: tool.schema.string().optional().describe("Override label (defaults to <original>-followup)"),
347
+ supervisor_id: tool.schema.string().optional().describe("Reuse an existing supervisor by socket path")
349
348
  },
350
349
  async execute(args, _context) {
351
350
  const result = await followUpTool({
@@ -360,10 +359,10 @@ const AvenorPlugin = async (ctx) => {
360
359
  avenor_events: tool({
361
360
  description: "Read events from a run. Filter by type. Returns last N events.",
362
361
  args: {
363
- run_id: z.string().describe("Run ID to read events from"),
364
- types: z.array(z.string()).optional().describe("Filter by event types"),
365
- limit: z.number().optional().describe("Max events to return (default 50)"),
366
- supervisor_id: z.string().optional().describe("Reuse an existing supervisor by socket path")
362
+ run_id: tool.schema.string().describe("Run ID to read events from"),
363
+ types: tool.schema.array(tool.schema.string()).optional().describe("Filter by event types"),
364
+ limit: tool.schema.number().optional().describe("Max events to return (default 50)"),
365
+ supervisor_id: tool.schema.string().optional().describe("Reuse an existing supervisor by socket path")
367
366
  },
368
367
  async execute(args, _context) {
369
368
  const result = await eventsTool({
@@ -378,8 +377,8 @@ const AvenorPlugin = async (ctx) => {
378
377
  avenor_shutdown: tool({
379
378
  description: "Shut down the avenor supervisor and clean up temp files.",
380
379
  args: {
381
- supervisor_id: z.string().optional().describe("Supervisor to shut down (defaults to singleton)"),
382
- force: z.boolean().optional().describe("Force shutdown instead of graceful")
380
+ supervisor_id: tool.schema.string().optional().describe("Supervisor to shut down (defaults to singleton)"),
381
+ force: tool.schema.boolean().optional().describe("Force shutdown instead of graceful")
383
382
  },
384
383
  async execute(args, _context) {
385
384
  const result = await shutdownTool({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dougbots/avenor-opencode",
3
- "version": "0.3.1",
3
+ "version": "0.3.2",
4
4
  "type": "module",
5
5
  "repository": {
6
6
  "type": "git",
@@ -27,8 +27,7 @@
27
27
  "dev": "tsdown --watch"
28
28
  },
29
29
  "dependencies": {
30
- "@dougbots/avenor-core": "^0.3.0",
31
- "zod": "^4.4.3"
30
+ "@dougbots/avenor-core": "^0.3.2"
32
31
  },
33
32
  "peerDependencies": {
34
33
  "@opencode-ai/plugin": "1.15.3"