@hashgraphonline/standards-agent-kit 0.2.162 → 0.2.165

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 CHANGED
@@ -162,6 +162,74 @@ The SDK provides a comprehensive set of tools for HCS-10 agent operations:
162
162
  - **AcceptConnectionRequestTool**: Accept incoming connections
163
163
  - **ListUnapprovedConnectionRequestsTool**: View pending requests
164
164
 
165
+ ## Registry Broker Plugin
166
+
167
+ The `RegistryBrokerPlugin` bridges the [`RegistryBrokerClient`](https://hashgraphonline.com/docs/registry-broker/api/client) inside every Hedera Agent Kit integration. Once registered, agents can call *any* broker endpoint (search, chat, registration, UAID utilities, ledger auth, credits, encryption) through a single tool. The plugin automatically reuses shared credentials and keeps encrypted chat handles alive via `conversation.*` operations.
168
+
169
+ ```ts
170
+ import { PluginRegistry } from 'hedera-agent-kit';
171
+ import { RegistryBrokerPlugin } from '@hashgraphonline/standards-agent-kit';
172
+
173
+ const pluginRegistry = new PluginRegistry();
174
+ pluginRegistry.register(
175
+ new RegistryBrokerPlugin(),
176
+ );
177
+ ```
178
+
179
+ Configure credentials via `registryBroker` plugin config or environment variables:
180
+
181
+ ```ts
182
+ const plugin = new RegistryBrokerPlugin();
183
+ await plugin.initialize({
184
+ config: {
185
+ hederaKit,
186
+ registryBroker: {
187
+ client: {
188
+ baseUrl: process.env.REGISTRY_BROKER_BASE_URL,
189
+ apiKey: process.env.REGISTRY_BROKER_API_KEY,
190
+ },
191
+ },
192
+ },
193
+ logger,
194
+ });
195
+ ```
196
+
197
+ > **Env Fallbacks**
198
+ >
199
+ > - `REGISTRY_BROKER_API_KEY` / `RB_API_KEY`
200
+ > - `REGISTRY_BROKER_BASE_URL`
201
+ > - `REGISTRY_BROKER_LEDGER_ACCOUNT_ID`, `REGISTRY_BROKER_LEDGER_NETWORK`, `REGISTRY_BROKER_LEDGER_PRIVATE_KEY` (or `HEDERA_ACCOUNT_ID` / `HEDERA_PRIVATE_KEY`) – enables automatic ledger authentication if no API key is supplied.
202
+
203
+ Every operation is invoked through `registry_broker_operation`:
204
+
205
+ ```ts
206
+ const [registryTool] = plugin.getTools();
207
+
208
+ // Discovery
209
+ await registryTool._call({
210
+ operation: 'search',
211
+ payload: { q: 'openrouter', limit: 5 },
212
+ });
213
+
214
+ // Chat with broker-managed UAIDs
215
+ const session = await registryTool._call({
216
+ operation: 'chat.createSession',
217
+ payload: {
218
+ uaid: 'uaid:aid:2bnewJwP95isoCUkT5mee5gm212WS76tphHwBQvbWoquRa9kt89UanrBqHXpaSh4AN;uid=anthropic/claude-3.5-sonnet;registry=openrouter;proto=openrouter;nativeId=anthropic/claude-3.5-sonnet',
219
+ historyTtlSeconds: 900,
220
+ },
221
+ });
222
+ await registryTool._call({
223
+ operation: 'chat.sendMessage',
224
+ payload: {
225
+ sessionId: JSON.parse(session).result.sessionId,
226
+ message: 'Hello from the Hedera Agent Kit plugin!',
227
+ },
228
+ });
229
+ ```
230
+
231
+ For encrypted chat flows, call `chat.start`, `chat.createEncryptedSession`, or `chat.acceptEncryptedSession`. The plugin returns a `handleId`; subsequent `conversation.send`, `conversation.decryptHistoryEntry`, and `conversation.release` operations reuse that state without exposing the raw `ChatConversationHandle`.
232
+
165
233
  ## Plugin Development
166
234
 
167
235
  Create custom plugins by extending the base plugin interface:
@@ -27,7 +27,7 @@ export interface CompletedInscriptionResponse {
27
27
  /**
28
28
  * Builder for Inscription operations
29
29
  */
30
- type InscriptionSDKInstance = InstanceType<typeof InscriptionSDK>;
30
+ type InscriptionSDKInstance = InscriptionSDK;
31
31
  export declare const toDashedTransactionId: (transactionId: string) => string;
32
32
  export declare class InscriberBuilder extends BaseServiceBuilder {
33
33
  protected inscriptionSDK?: InscriptionSDKInstance;
@@ -59,7 +59,7 @@ export declare class InscriberBuilder extends BaseServiceBuilder {
59
59
  /**
60
60
  * Get or create Inscription SDK
61
61
  */
62
- protected getInscriptionSDK(_options: InscriptionOptions): Promise<InscriptionSDKInstance | null>;
62
+ protected getInscriptionSDK(options: InscriptionOptions): Promise<InscriptionSDKInstance | null>;
63
63
  /**
64
64
  * Inscribe content using server-side authentication
65
65
  */