@yuri-dias/agentflow-extensions
v0.1.0
Published
TypeScript/JavaScript SDK and RPC adapter for AgentFlow extension nodes.
Readme
AgentFlow Extensions
TypeScript/JavaScript SDK and RPC adapter for AgentFlow extension nodes.
Install
Install the adapter binary globally so agentflow-extension-rpc is available in
PATH:
npm install -g @yuri-dias/extensionsIn an extension project, add the SDK as a dependency:
bun add @yuri-dias/extensionsIf you prefer not to install the binary globally, set AGENTFLOW_EXTENSION_RPC
to the full path of the installed command before running AgentFlow.
Use
Create a Bun project inside .agentflow/extensions/<name>/ and export an
extension definition:
import { defineExtension } from "@yuri-dias/extensions";
export default defineExtension({
async run(ctx) {
return { ok: true, input: ctx.with };
},
operations: {
async echo(ctx) {
return { message: ctx.with.message };
},
},
});AgentFlow invokes the adapter, which loads the extension entrypoint and handles the RPC protocol. Extension authors only export functions.
Layout
.agentflow/extensions/jira/
package.json
bun.lock
src/main.tsThe workflow node should point at the extension directory and entrypoint:
nodes:
- id: jira_lookup
kind: extension
extension: jira
runtime: bun
mode: oneshot
script: src/main.ts
with:
issue_key: "${inputs.issue_key}"