@dougbots/avenor-opencode 0.3.0 → 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 +28 -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,16 +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
- label: z.string().optional().describe("Human-readable label for the run"),
203
- timeout: z.string().optional().describe("Timeout duration (e.g. 3600s)"),
204
- model: z.string().optional().describe("Model override"),
205
- backend: z.string().optional().describe("Backend override"),
206
- server_url: z.string().optional().describe("Backend server URL"),
207
- supervisor_id: z.string().optional().describe("Reuse an existing supervisor by socket path"),
208
- 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.")
209
209
  },
210
210
  async execute(args, context) {
211
211
  const parentRunId = ensureParentRunId();
@@ -214,7 +214,7 @@ const AvenorPlugin = async (ctx) => {
214
214
  prompt: args.prompt,
215
215
  promptFile: args.prompt_file,
216
216
  label: args.label,
217
- dir: context.directory,
217
+ dir: args.dir ?? context.directory,
218
218
  timeout: args.timeout,
219
219
  model: args.model,
220
220
  backend: args.backend,
@@ -309,8 +309,8 @@ const AvenorPlugin = async (ctx) => {
309
309
  avenor_status: tool({
310
310
  description: "Get status of a run or all runs. Surfaces pending permission requests.",
311
311
  args: {
312
- run_id: z.string().optional().describe("Specific run ID to query"),
313
- 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")
314
314
  },
315
315
  async execute(args, _context) {
316
316
  const result = await statusTool({
@@ -323,10 +323,10 @@ const AvenorPlugin = async (ctx) => {
323
323
  avenor_answer_permission: tool({
324
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\".",
325
325
  args: {
326
- run_id: z.string().describe("Run ID with the pending permission"),
327
- option_id: z.string().describe("allow_once | allow_always | deny, or option_id from pending_permission.options"),
328
- request_id: z.string().optional().describe("Permission request ID (auto-discovered if omitted)"),
329
- 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")
330
330
  },
331
331
  async execute(args, _context) {
332
332
  const result = await answerPermissionTool({
@@ -341,10 +341,10 @@ const AvenorPlugin = async (ctx) => {
341
341
  avenor_follow_up: tool({
342
342
  description: "Resume a completed run with a follow-up message.",
343
343
  args: {
344
- run_id: z.string().describe("Completed run ID to resume"),
345
- message: z.string().describe("Follow-up message text"),
346
- label: z.string().optional().describe("Override label (defaults to <original>-followup)"),
347
- 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")
348
348
  },
349
349
  async execute(args, _context) {
350
350
  const result = await followUpTool({
@@ -359,10 +359,10 @@ const AvenorPlugin = async (ctx) => {
359
359
  avenor_events: tool({
360
360
  description: "Read events from a run. Filter by type. Returns last N events.",
361
361
  args: {
362
- run_id: z.string().describe("Run ID to read events from"),
363
- types: z.array(z.string()).optional().describe("Filter by event types"),
364
- limit: z.number().optional().describe("Max events to return (default 50)"),
365
- 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")
366
366
  },
367
367
  async execute(args, _context) {
368
368
  const result = await eventsTool({
@@ -377,8 +377,8 @@ const AvenorPlugin = async (ctx) => {
377
377
  avenor_shutdown: tool({
378
378
  description: "Shut down the avenor supervisor and clean up temp files.",
379
379
  args: {
380
- supervisor_id: z.string().optional().describe("Supervisor to shut down (defaults to singleton)"),
381
- 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")
382
382
  },
383
383
  async execute(args, _context) {
384
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.0",
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"