@persistica/flux-agent 0.0.1 → 0.0.6

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.
package/README.md ADDED
@@ -0,0 +1,22 @@
1
+ # Flux Agent
2
+
3
+ ```TypeScript
4
+ import { FluxAgent, FluxAgentNetworkConnection } from '@persistica/flux-agent';
5
+
6
+ const NETWORK_ID = 'network-id-to-connect-to';
7
+
8
+ const fluxAgent = new FluxAgent(NETWORK_ID);
9
+
10
+ // * Connect to network
11
+ const fluxNetworkConnection: FluxAgentNetworkConnection = await fluxAgent
12
+ .connect(
13
+ 'CODE_TO_ACCESS_NETWORK',
14
+ );
15
+
16
+ console.log(`✅ Agent connected to network ID: '${NETWORK_ID}'`);
17
+
18
+ // * Join network channel
19
+ const fluxConnectedAgentNetworkChannel: FluxNetworkChannel = await fluxNetworkConnection
20
+ .joinChannel('connected-agents');
21
+
22
+ ```