PYNE Agent

Write scripts from natural language (PYNE Agent) in AXIS using the optional pyne-agent-worker Cloudflare® plugin.

This page

What it does

Describe an indicator or strategy in plain language. The PYNE Agent (Cloudflare® Workers AI™) returns a full script you can insert into the AXIS editor, then run with your normal engine (local PYNE Pro API, edge worker, or Pyodide).

You do not need the full HOOX mesh. The agent worker is usable standalone.

Pine Script™ and TradingView® are trademarks of TradingView®, Inc. Cloudflare® is a registered trademark of Cloudflare®, Inc.

Prerequisites

  1. A deployed pyne-agent-worker origin (or local wrangler dev).
  2. AXIS open in the browser (dev or production PWA).

Optional: API key if the worker has API_KEY set.

Install the plugin

  1. Open Manager → Plugins → Install.
  2. Paste the same-origin module (avoids cross-origin module CORS):
text
/plugins/axis-pine-agent.js

Or the remote copy (needs CORS on the agent Worker):

text
https://pyne-agent-worker.cryptolinx.workers.dev/plugin/axis-pine-agent.js
  1. Set endpoint to the agent Worker origin (no trailing slash), e.g. https://pyne-agent-worker.cryptolinx.workers.dev. Same-origin install still talks to this API host. Workers Manager → PYNE Agent also has an editable Agent endpoint (URL + API key).
  2. Set API key if required.
  3. Prefer v6 / strategy or indicator when you know the target style.
  4. In Workers Manager → PYNE Agent, pick a Persona (auto detects per message): pine writes scripts, axis answers anything about the app and can change it for you (theme, layout, runs), trader does market analysis and risk coaching.
  5. Optionally set PYNE backend (auto / pro / local / worker / container / none) for where parse/lint/eval run. Plugin 0.1.9 always orchestrates (full tool loop).

AXIS migrates a previously saved remote plugin URL to /plugins/axis-pine-agent.js on restore.

AXIS loads component plugins from URL (Manager → Install, or Workers Manager → install agent). You can also open the worker’s built-in chat UI:

text
https://<your-agent-worker>/

or open the Agent panel from the module-bar AI button (command palette “Toggle Agent”, the Extras menu, or Panels on a phone also work). The chat fills that panel.

Typical workflow

  1. Ask for a script (example: “v6 RSI strategy with ATR trailing stop and clear plots”).
  2. Review the fenced Pine block.
  3. Insert into editor (plugin action) or copy/paste.
  4. Select your engine and Run as usual.
  5. Iterate with follow-up messages (“use length input”, “overlay false”, …).

Tips

  • Prefer specific version (v5 / v6) and script kind in the request.
  • The agent may use a private knowledge base (docs + open examples). Quality improves after the operator ingests docs — not required to start chatting.
  • Validation against pyne-worker is optional on the agent side; AXIS evaluation is still your engine plugin.

Troubleshooting

IssueFix
Load errorCheck URL HTTPS, CORS, and that the module is reachable
UnauthorizedMatch plugin apiKey to worker secret
Weak answersIngest KB on the worker; still usable without it
Cannot insertUse copy; ensure plugin api.insertScript is provided by host

See also