Skip to content

Commit 0c41616

Browse files
committed
fix: Formatting in plugins
1 parent 8cdf460 commit 0c41616

2 files changed

Lines changed: 22 additions & 22 deletions

File tree

content/relayer/1.2.x/plugins/index.mdx

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -346,30 +346,30 @@ curl -X POST http://localhost:8080/api/v1/plugins/example-plugin/call \
346346

347347
```
348348

349-
== Response Fields
349+
## Response Fields
350350

351351
- **`data`**: The value returned by your plugin's handler function (decoded from JSON when possible)
352352
- **`metadata.logs`**: Terminal output from the plugin (console.log, console.error, etc.) when `emit_logs` is true
353353
- **`metadata.traces`**: Messages exchanged between the plugin and the Relayer via PluginAPI when `emit_traces` is true
354354
- **`error`**: Error message if the plugin execution failed (business errors)
355355

356-
== Key-Value Storage
356+
## Key-Value Storage
357357

358358
The Relayer provides a built-in key-value store for plugins to maintain persistent state across invocations. This addresses the core problem of enabling persistent state management and programmatic configuration updates for plugins.
359359

360-
=== Why a KV store?
360+
### Why a KV store?
361361

362362
- Plugins execute as isolated processes with no persistent memory
363363
- No mechanism exists to maintain state between invocations
364364
- Plugins requiring shared state or coordination need safe concurrency primitives
365365

366-
=== Configuration
366+
### Configuration
367367

368368
- Reuses the same Redis URL as the Relayer via the `REDIS_URL` environment variable
369369
- No extra configuration is required
370370
- Keys are namespaced per plugin ID to prevent collisions
371371

372-
=== Usage
372+
### Usage
373373

374374
Access the KV store through the `kv` property in the `PluginContext`:
375375

@@ -394,7 +394,7 @@ export async function handler(context: PluginContext) {
394394
395395
```
396396

397-
=== Available Methods
397+
### Available Methods
398398

399399
- `get<T>(key: string): Promise<T | null>`
400400
- `set(key: string, value: unknown, opts?: ttlSec?: number ): Promise<boolean>`
@@ -406,16 +406,16 @@ export async function handler(context: PluginContext) {
406406

407407
Keys must match `[A-Za-z0-9:_-]1,512` and are automatically namespaced per plugin.
408408

409-
== Migration from Legacy Patterns
409+
## Migration from Legacy Patterns
410410

411-
=== Current Status
411+
### Current Status
412412

413413
-**Legacy plugins still work** - No immediate action required
414414
- ⚠️ **Deprecation warnings** - Legacy plugins will show console warnings
415415
- 📅 **Future removal** - The legacy `runPlugin` and two-parameter `handler(api, params)` will be removed in a future major version
416416
- 🎯 **Recommended action** - Migrate to single-parameter `PluginContext` handler for new plugins and KV access
417417

418-
=== Migration Steps
418+
### Migration Steps
419419

420420
If you have existing plugins using `runPlugin()` or the two-parameter handler, migration is simple:
421421

@@ -455,7 +455,7 @@ export async function handler(context: PluginContext): Promise<any>
455455
456456
```
457457

458-
=== Step-by-Step Migration
458+
### Step-by-Step Migration
459459

460460
1. **Remove the `runPlugin()` call** at the bottom of your file
461461
2. **Rename your function to `handler`** (or create a new handler export)
@@ -464,7 +464,7 @@ export async function handler(context: PluginContext): Promise<any>
464464
5. **Test your plugin** to ensure it works with the new pattern
465465
6. **Update your documentation** to reflect the new pattern
466466

467-
=== Backwards Compatibility
467+
### Backwards Compatibility
468468

469469
The relayer will automatically detect which pattern your plugin uses:
470470

content/relayer/plugins/index.mdx

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -346,30 +346,30 @@ curl -X POST http://localhost:8080/api/v1/plugins/example-plugin/call \
346346

347347
```
348348

349-
== Response Fields
349+
## Response Fields
350350

351351
- **`data`**: The value returned by your plugin's handler function (decoded from JSON when possible)
352352
- **`metadata.logs`**: Terminal output from the plugin (console.log, console.error, etc.) when `emit_logs` is true
353353
- **`metadata.traces`**: Messages exchanged between the plugin and the Relayer via PluginAPI when `emit_traces` is true
354354
- **`error`**: Error message if the plugin execution failed (business errors)
355355

356-
== Key-Value Storage
356+
## Key-Value Storage
357357

358358
The Relayer provides a built-in key-value store for plugins to maintain persistent state across invocations. This addresses the core problem of enabling persistent state management and programmatic configuration updates for plugins.
359359

360-
=== Why a KV store?
360+
### Why a KV store?
361361

362362
- Plugins execute as isolated processes with no persistent memory
363363
- No mechanism exists to maintain state between invocations
364364
- Plugins requiring shared state or coordination need safe concurrency primitives
365365

366-
=== Configuration
366+
### Configuration
367367

368368
- Reuses the same Redis URL as the Relayer via the `REDIS_URL` environment variable
369369
- No extra configuration is required
370370
- Keys are namespaced per plugin ID to prevent collisions
371371

372-
=== Usage
372+
### Usage
373373

374374
Access the KV store through the `kv` property in the `PluginContext`:
375375

@@ -394,7 +394,7 @@ export async function handler(context: PluginContext) {
394394
395395
```
396396

397-
=== Available Methods
397+
### Available Methods
398398

399399
- `get<T>(key: string): Promise<T | null>`
400400
- `set(key: string, value: unknown, opts?: ttlSec?: number ): Promise<boolean>`
@@ -406,16 +406,16 @@ export async function handler(context: PluginContext) {
406406

407407
Keys must match `[A-Za-z0-9:_-]1,512` and are automatically namespaced per plugin.
408408

409-
== Migration from Legacy Patterns
409+
## Migration from Legacy Patterns
410410

411-
=== Current Status
411+
### Current Status
412412

413413
-**Legacy plugins still work** - No immediate action required
414414
- ⚠️ **Deprecation warnings** - Legacy plugins will show console warnings
415415
- 📅 **Future removal** - The legacy `runPlugin` and two-parameter `handler(api, params)` will be removed in a future major version
416416
- 🎯 **Recommended action** - Migrate to single-parameter `PluginContext` handler for new plugins and KV access
417417

418-
=== Migration Steps
418+
### Migration Steps
419419

420420
If you have existing plugins using `runPlugin()` or the two-parameter handler, migration is simple:
421421

@@ -455,7 +455,7 @@ export async function handler(context: PluginContext): Promise<any>
455455
456456
```
457457

458-
=== Step-by-Step Migration
458+
### Step-by-Step Migration
459459

460460
1. **Remove the `runPlugin()` call** at the bottom of your file
461461
2. **Rename your function to `handler`** (or create a new handler export)
@@ -464,7 +464,7 @@ export async function handler(context: PluginContext): Promise<any>
464464
5. **Test your plugin** to ensure it works with the new pattern
465465
6. **Update your documentation** to reflect the new pattern
466466

467-
=== Backwards Compatibility
467+
### Backwards Compatibility
468468

469469
The relayer will automatically detect which pattern your plugin uses:
470470

0 commit comments

Comments
 (0)