@easynet-run/react
v0.43.3
Published
EasyNet Axon React SDK hooks for URI-first ability invocation.
Downloads
89
Readme
What is this?
This is the React surface for Axon, a protocol-level control plane that treats agent capabilities as first-class network objects. Axon collapses tenant isolation, rate limiting, policy, node selection, concurrency admission, and circuit breaking into a single atomic decision — no race window between policy check and routing.
The React SDK provides hooks that bind to Axon abilities declaratively, with loading/error state management built in. The native Dendrite bridge handles all protocol-level work; the browser delegates to a Node.js/BFF backend for native library loading.
Install
npm install @easynet-run/reactPlatform / Native Bundle Notes
- The published React package is Linux x86_64 native-packaged by default from CI.
- Other targets (iOS/Android/macOS arm64/Windows) should use their corresponding SDK pack in GitHub Releases:
- download
sdk-packs-<target>.tar.gz - use the
react/directory*.tgzartifact.
- download
- For local development where the native target differs from host:
- set
EASYNET_DENDRITE_BRIDGE_LIBto the exact library path you want to bind. - set
EASYNET_DENDRITE_BRIDGE_HOME=<pack-root>(containsnative/) to reuse one shared extracted directory for all SDKs.
- set
Target mapping quick reference:
- macOS arm64:
sdk-packs-aarch64-apple-darwin.tar.gz - macOS x86_64:
sdk-packs-x86_64-apple-darwin.tar.gz - iOS arm64:
sdk-packs-aarch64-apple-ios.tar.gz - iOS x86_64:
sdk-packs-x86_64-apple-ios.tar.gz - Android:
sdk-packs-aarch64-linux-android.tar.gz - Linux x86_64:
sdk-packs-x86_64-unknown-linux-gnu.tar.gz - Linux arm64:
sdk-packs-aarch64-unknown-linux-gnu.tar.gz - Windows:
sdk-packs-x86_64-pc-windows-msvc.tar.gz
Quick Start
Invoke an ability
import { useAbility } from "@easynet-run/react";
function QuoteWidget() {
const quote = useAbility(
"easynet:///r/org/reg/agent.quote-bot/abilities/order.quote@1?tenant_id=tenant-test",
{ tenant: "tenant-test" }
);
const handleClick = async () => {
const result = await quote.call({ sku: "A1", qty: 2 });
console.log(result);
};
return <button onClick={handleClick}>Get Quote</button>;
}Bridge LLM tools to abilities
import { useAbilityTools } from "@easynet-run/react";
const tools = useAbilityTools([
"easynet:///r/org/reg/agent.search/abilities/web.search@1?tenant_id=t",
"easynet:///r/org/reg/agent.calc/abilities/math.eval@1?tenant_id=t",
]);Capabilities
useAbility(uri, options)— declarative ability binding with loading/error state.useAbilityTools(uris)— register abilities as LLM-compatible tool definitions.- Subject binding — optional
principalfor subject-scoped invocation with automatic URI visibility mapping. - Context-aware — transport, tenant, and principal binding through React context.
Architecture note
The browser cannot load the native Dendrite bridge directly. Production deployments require a Node.js or BFF process as the bridge host. For SSR, tests, or dev scripts that need a local runtime, use startServer from @easynet-run/node — it supports the same federation options (hub, hubTenant, hubLabel) for NAT-friendly operation.
License
Apache-2.0 — see LICENSE.
