{"_id":"@azatakmyradov/opencode-workflows-plugin","_rev":"4-4e0c90c2bc0b2ab3d7f03771ec68e316","name":"@azatakmyradov/opencode-workflows-plugin","dist-tags":{"latest":"0.1.3"},"versions":{"0.0.0":{"name":"@azatakmyradov/opencode-workflows-plugin","version":"0.0.0","keywords":["agents","opencode","opencode-plugin","sandbox","tui","workflow"],"license":"MIT","_id":"@azatakmyradov/opencode-workflows-plugin@0.0.0","maintainers":[{"name":"azatakmyradov","email":"azat@akmyradov.me"}],"homepage":"https://github.com/azatakmyradov/opencode-plugins/tree/main/packages/workflows","bugs":{"url":"https://github.com/azatakmyradov/opencode-plugins/issues"},"dist":{"shasum":"c48e03b1358a867638f5ea1b0d07561648b692b9","tarball":"https://registry.npmjs.org/@azatakmyradov/opencode-workflows-plugin/-/opencode-workflows-plugin-0.0.0.tgz","fileCount":6,"integrity":"sha512-D3apyDgb6jiF2k15TxLLoI+T9DBASUty5CUuFitbeCHmex61I+7SHUXfMIMlNIZD077CsKy5BGrZZElkZvUGGA==","signatures":[{"sig":"MEUCIEiI2v9Pf9fXH+F9RpW4y4Oe+lwruJkhxAULnSqOMhfUAiEAlUa9ZrKOtRVJtXGWa4VPbPZHp6nviZWA38OXRd3zQYk=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":203767},"type":"module","exports":{".":"./dist/index.js","./rpc":"./dist/rpc.js","./tui":"./dist/tui.js"},"gitHead":"0313e66e7dba531a59a5de3ef4af03622ff9a432","scripts":{"test":"vp test run","build":"bun ../../scripts/build.ts .","check":"tsc --noEmit","prepack":"bun run build"},"_npmUser":{"name":"azatakmyradov","email":"azat@akmyradov.me"},"repository":{"url":"git+https://github.com/azatakmyradov/opencode-plugins.git","type":"git","directory":"packages/workflows"},"_npmVersion":"11.19.0","description":"Sandboxed multi-agent workflow runs for OpenCode V2","directories":{},"_nodeVersion":"24.20.0","dependencies":{"zod":"4.1.8","acorn":"^8.14.0","effect":"4.0.0-rc.112","@opencode-ai/plugin":"0.0.0-beta-18721","@opencode-ai/schema":"0.0.0-beta-18721"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"peerDependencies":{"solid-js":">=1.9.0","@opentui/core":">=0.5.9","@opentui/solid":">=0.5.9"},"peerDependenciesMeta":{"solid-js":{"optional":true},"@opentui/core":{"optional":true},"@opentui/solid":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/opencode-workflows-plugin_0.0.0_1788209407307_0.2745243600612395","host":"s3://npm-registry-packages-npm-production"}},"0.1.0":{"name":"@azatakmyradov/opencode-workflows-plugin","version":"0.1.0","keywords":["agents","opencode","opencode-plugin","sandbox","tui","workflow"],"license":"MIT","_id":"@azatakmyradov/opencode-workflows-plugin@0.1.0","maintainers":[{"name":"azatakmyradov","email":"azat@akmyradov.me"}],"homepage":"https://github.com/azatakmyradov/opencode-plugins/tree/main/packages/workflows","bugs":{"url":"https://github.com/azatakmyradov/opencode-plugins/issues"},"dist":{"shasum":"4625ba838f624a5535a5717f88ef7fa7405dc051","tarball":"https://registry.npmjs.org/@azatakmyradov/opencode-workflows-plugin/-/opencode-workflows-plugin-0.1.0.tgz","fileCount":6,"integrity":"sha512-i4raALN5u0JJQZGhFh0+R4iOXXO4OMnNhL2+/x0G0J36fjYYtFbtwfVuny+0Q+AVwn0ekJziLlhpZQdJr8ZBUA==","signatures":[{"sig":"MEQCICMYI5rXXr4Lge9E8ClX6rmp4PcRJz9FLVnHIHlYsuI6AiAA3+VsU6AL06aLzloRbmwlmR65GzbPti/+75CDrYF0QA==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@azatakmyradov%2fopencode-workflows-plugin@0.1.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":203767},"type":"module","exports":{".":"./dist/index.js","./rpc":"./dist/rpc.js","./tui":"./dist/tui.js"},"gitHead":"7d969f97f9fc293cea0a8325293363b5c4ad34f1","scripts":{"test":"vp test run","build":"bun ../../scripts/build.ts .","check":"tsc --noEmit","prepack":"bun run build"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:3dca0b62-0d8e-4dbd-b3ff-376c386d1ec2"}},"repository":{"url":"git+https://github.com/azatakmyradov/opencode-plugins.git","type":"git","directory":"packages/workflows"},"_npmVersion":"11.17.0","description":"Sandboxed multi-agent workflow runs for OpenCode V2","directories":{},"_nodeVersion":"24.19.0","dependencies":{"zod":"4.1.8","acorn":"^8.14.0","effect":"4.0.0-rc.112","@opencode-ai/plugin":"0.0.0-beta-18721","@opencode-ai/schema":"0.0.0-beta-18721"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"peerDependencies":{"solid-js":">=1.9.0","@opentui/core":">=0.5.9","@opentui/solid":">=0.5.9"},"peerDependenciesMeta":{"solid-js":{"optional":true},"@opentui/core":{"optional":true},"@opentui/solid":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/opencode-workflows-plugin_0.1.0_1788209610742_0.10871301786129717","host":"s3://npm-registry-packages-npm-production"}},"0.1.2":{"name":"@azatakmyradov/opencode-workflows-plugin","version":"0.1.2","keywords":["agents","opencode","opencode-plugin","sandbox","tui","workflow"],"license":"MIT","_id":"@azatakmyradov/opencode-workflows-plugin@0.1.2","maintainers":[{"name":"azatakmyradov","email":"azat@akmyradov.me"}],"homepage":"https://github.com/azatakmyradov/opencode-plugins/tree/main/packages/workflows","bugs":{"url":"https://github.com/azatakmyradov/opencode-plugins/issues"},"dist":{"shasum":"27d84f8180c1666135ed8de3cb643558ad5faab7","tarball":"https://registry.npmjs.org/@azatakmyradov/opencode-workflows-plugin/-/opencode-workflows-plugin-0.1.2.tgz","fileCount":11,"integrity":"sha512-Hpusd8GQduRyc5nkfAP1vHJopOvddPJTpx2ImeN0vPTtmEn5WTBqGW7DOc8AT9+9Lnrr+JktvH7yVCT+04J7OQ==","signatures":[{"sig":"MEYCIQCXXbyYjjINrY29342SkUbCIrV83LYnyJ5S9tP0xB8yjgIhANoTIMGlBxPlsfzYM/8srMxIELI18WoYkuwE6iPpqRlO","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@azatakmyradov%2fopencode-workflows-plugin@0.1.2","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":175630},"type":"module","exports":{".":"./dist/index.js","./rpc":"./dist/rpc.js","./tui":"./dist/tui.js"},"gitHead":"f96d1996f4395a33489708bb67151ad69b3a1e9e","scripts":{"test":"vp test run","build":"bun ../../scripts/build.ts . --splitting","check":"tsc --noEmit","prepack":"bun run build"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:3dca0b62-0d8e-4dbd-b3ff-376c386d1ec2"}},"repository":{"url":"git+https://github.com/azatakmyradov/opencode-plugins.git","type":"git","directory":"packages/workflows"},"_npmVersion":"11.17.0","description":"Sandboxed multi-agent workflow runs for OpenCode V2","directories":{},"_nodeVersion":"24.19.0","dependencies":{"zod":"4.1.8","acorn":"^8.14.0","effect":"4.0.0-rc.112","@opencode-ai/plugin":"0.0.0-beta-18721","@opencode-ai/schema":"0.0.0-beta-18721"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"peerDependencies":{"solid-js":">=1.9.0","@opentui/core":">=0.5.9","@opentui/solid":">=0.5.9"},"peerDependenciesMeta":{"solid-js":{"optional":true},"@opentui/core":{"optional":true},"@opentui/solid":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/opencode-workflows-plugin_0.1.2_1788388801082_0.8030805768152105","host":"s3://npm-registry-packages-npm-production"}},"0.1.3":{"name":"@azatakmyradov/opencode-workflows-plugin","version":"0.1.3","description":"Sandboxed multi-agent workflow runs for OpenCode V2","keywords":["agents","opencode","opencode-plugin","sandbox","tui","workflow"],"homepage":"https://github.com/azatakmyradov/opencode-plugins/tree/main/packages/workflows","bugs":{"url":"https://github.com/azatakmyradov/opencode-plugins/issues"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/azatakmyradov/opencode-plugins.git","directory":"packages/workflows"},"type":"module","exports":{".":"./dist/index.js","./tui":"./dist/tui.js","./rpc":"./dist/rpc.js"},"publishConfig":{"access":"public"},"scripts":{"build":"bun ../../scripts/build.ts . --splitting","check":"tsc --noEmit","prepack":"bun run build","test":"vp test run"},"dependencies":{"@opencode-ai/plugin":"0.0.0-beta-18721","@opencode-ai/schema":"0.0.0-beta-18721","acorn":"^8.14.0","effect":"4.0.0-rc.112","zod":"4.1.8"},"peerDependencies":{"@opentui/core":">=0.5.9","@opentui/solid":">=0.5.9","solid-js":">=1.9.0"},"peerDependenciesMeta":{"@opentui/core":{"optional":true},"@opentui/solid":{"optional":true},"solid-js":{"optional":true}},"gitHead":"efc4e2f82cc193c956ee3119178ccc4f66759ac3","_id":"@azatakmyradov/opencode-workflows-plugin@0.1.3","_nodeVersion":"24.20.0","_npmVersion":"11.19.0","dist":{"integrity":"sha512-SgNYuqO3sLKPPFXVTMMboNJjPjZmXT8JzenOD/fMorKyDF8QfAWZYIhuz10bOm2lNUka9j5B7DVYLH+htcpoZw==","shasum":"64d9a0d1b2a8c1e2ec5d7af2271311fd0794bbce","tarball":"https://registry.npmjs.org/@azatakmyradov/opencode-workflows-plugin/-/opencode-workflows-plugin-0.1.3.tgz","fileCount":11,"unpackedSize":177800,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@azatakmyradov%2fopencode-workflows-plugin@0.1.3","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIExvLMos6ixYqEEJn9syXYQ9wyYCy/gWg6JbnrhjLU2lAiBC5wXN2Bu/iDYilwzIR4+tRWaYpQ7hp3eaMZirMCH+Ww=="}]},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:3dca0b62-0d8e-4dbd-b3ff-376c386d1ec2"}},"directories":{},"maintainers":[{"name":"azatakmyradov","email":"azat@akmyradov.me"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/opencode-workflows-plugin_0.1.3_1788757425110_0.94566616995775"},"_hasShrinkwrap":false}},"time":{"created":"2026-08-31T20:50:07.139Z","modified":"2026-09-07T05:03:45.623Z","0.0.0":"2026-08-31T20:50:07.477Z","0.1.0":"2026-08-31T20:53:30.886Z","0.1.2":"2026-09-02T22:40:01.220Z","0.1.3":"2026-09-07T05:03:45.283Z"},"bugs":{"url":"https://github.com/azatakmyradov/opencode-plugins/issues"},"license":"MIT","homepage":"https://github.com/azatakmyradov/opencode-plugins/tree/main/packages/workflows","keywords":["agents","opencode","opencode-plugin","sandbox","tui","workflow"],"repository":{"type":"git","url":"git+https://github.com/azatakmyradov/opencode-plugins.git","directory":"packages/workflows"},"description":"Sandboxed multi-agent workflow runs for OpenCode V2","maintainers":[{"name":"azatakmyradov","email":"azat@akmyradov.me"}],"readme":"# @azatakmyradov/opencode-workflows-plugin\n\nOpenCode V2 plugin that adds a `workflow` tool for model-authored multi-agent orchestration, a port of pi-setup's workflow engine. The model writes an inline JavaScript orchestration script; the script runs in a hardened sandbox and each `agent()` call it makes runs as a real OpenCode child session.\n\n## Install\n\nInstall the plugin from npm:\n\n```bash\nopencode2 plugin add @azatakmyradov/opencode-workflows-plugin\nopencode2 plugin list\n```\n\nThe server entrypoint enables the TUI entrypoint. An unversioned install starts with its cached version and checks npm for updates in the background. A downloaded update takes effect the next time the service starts. Restart it now with:\n\n```bash\nopencode2 service restart\n```\n\nUse an exact package version for a reproducible install that does not update.\n\n## Requirements\n\nA system Node.js of version 22 or newer with `--permission` support is required. The plugin resolves the binary in this order:\n\n1. The `nodePath` plugin option.\n2. The `OPENCODE_WORKFLOWS_NODE` environment variable.\n3. `node` on `PATH`.\n4. `/opt/homebrew/bin/node`.\n5. `/usr/local/bin/node`.\n\nThere is no unsandboxed fallback. Without a suitable Node binary, the `workflow` tool returns an error instead of running the script.\n\n## Invocation\n\nThe tool description states that `workflow` is only to be called when you say \"ultracode\" or explicitly request a workflow run. Saying \"ultracode\" in your prompt also pre-approves the tool permission; otherwise OpenCode asks before the run starts.\n\nRuns block by default and show live progress. Pass `background: true` to get a run id immediately; the report arrives later as a follow-up message in the session.\n\nExample invocation:\n\n```\nultracode: review src/*.ts for reliability risks with 3 parallel agents, then summarize the findings\n```\n\n## Writing workflows\n\nThe script body is an async function with these primitives:\n\n- `export const meta = { name, description, phases: [{ title, detail? }] }` — metadata for the progress UI. Declare all phases up front.\n- `phase(title)` — mark the current phase at runtime.\n- `await agent(prompt, { label?, phase?, schema?, model?, provider?, effort? })` — run one subagent in an isolated child session and wait for it. Always resolves to `{ ok, output, structured?, error? }`.\n- `await parallel([() => agent(...), () => agent(...)], { concurrency? })` — run zero-argument agent thunks concurrently and return results in order.\n- `args` — the parsed value of the `args` tool parameter, or `undefined`.\n- A final `return` of a JSON-serializable aggregate.\n\n```js\nexport const meta = {\n  name: \"reliability-review\",\n  description: \"Review modules for reliability risks, then report\",\n  phases: [{ title: \"Scan\" }, { title: \"Report\" }],\n};\nconst FINDINGS = {\n  type: \"object\",\n  properties: { issues: { type: \"array\", items: { type: \"string\" } }, ok: { type: \"boolean\" } },\n  required: [\"issues\", \"ok\"],\n};\nphase(\"Scan\");\nconst scans = await parallel(\n  args.files.map(\n    (f) => () =>\n      agent(`Review ${f} for correctness and reliability risks.`, {\n        label: `scan:${f}`,\n        phase: \"Scan\",\n        schema: FINDINGS,\n      }),\n  ),\n);\nconst findings = scans.filter((r) => r.ok).map((r) => r.structured);\nphase(\"Report\");\nconst report = await agent(`Summarize these findings: ${JSON.stringify(findings)}`, {\n  label: \"report\",\n  phase: \"Report\",\n});\nreturn { findings, report: report.ok ? report.output : report.error };\n```\n\n`agent()` never throws, so scripts must check `.ok` before using `.output` or `.structured`. `model` and `provider` override the session model, and `effort` selects a model variant, such as `provider/model#high`.\n\nPassing a `schema` gives the child a `structured_output` tool and returns the validated object in `structured`. Only the first call is recorded. If a schema was requested and the child never delivered one, that agent reports failure.\n\n## Agents\n\nEach `agent()` call runs as a real top-level OpenCode session titled `workflow <runId> · <label>`, with the normal tool set minus the `workflow` tool, so children cannot recursively orchestrate workflows.\n\nCosts scale with the script: a run may make up to 32 agent calls, at a concurrency of up to 4. Those are real sessions with real token usage.\n\n## Sandbox\n\nThe orchestration script itself never runs in the OpenCode process. It is executed by an external Node binary spawned with `--permission`, with no filesystem, network, process, import, or `eval` access. A script that blocks the event loop for about 15 seconds is killed.\n\nBudgets per run: 512 KiB of script, 256 KiB of arguments, 1 MiB of result, at most 32 agent calls, and a concurrency cap of 4.\n\n## Dashboard\n\nOpen `/workflows` from a session to see that session's runs in the TUI dashboard. It provides a run list, a run detail view, and per-agent transcripts. Press `a` on a running run to abort it.\n\n## Options\n\n| Option     | Type   | Description                                            |\n| ---------- | ------ | ------------------------------------------------------ |\n| `nodePath` | string | Absolute path to the Node binary used for the sandbox. |\n\n## Storage\n\nEach run writes artifacts to `$OPENCODE_WORKFLOWS_DIR/<projectID>/wf_<hex>/`, or to `${XDG_DATA_HOME:-~/.local/share}/opencode/workflows/<projectID>/wf_<hex>/` when that variable is unset. A run directory holds `script.js`, `args.json`, `workflow.json`, `transcripts.json`, and `result.json`. Artifacts are pruned after 14 days.\n\nA compact index of runs is kept in OpenCode plugin storage under the project's stable ID, so the dashboard lists past runs across service restarts.\n\n## Development\n\nFor local development, run `bun install`. Register the plugin by its package directory — a direct source-file path is not loaded:\n\n```jsonc\n// opencode.jsonc\n{\n  \"plugins\": [{ \"package\": \"/absolute/path/to/opencode-plugins/packages/workflows\" }],\n}\n```\n\nThe package-root `index.ts` and `tui.tsx` shims re-export `src/`, so the directory entry loads both the server and TUI entrypoints from source.\n\n```bash\nbun run --filter @azatakmyradov/opencode-workflows-plugin check\nbun run --filter @azatakmyradov/opencode-workflows-plugin test\nbun run --filter @azatakmyradov/opencode-workflows-plugin build\n```\n","readmeFilename":"README.md"}