Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions EBAEventProbe/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# This is a .env file example, please copy it to .env before running the plugin.
# Start the standalone runtime with `lbp rt --debug-only` first, then keep this
# URL aligned with the runtime debug websocket port.
DEBUG_RUNTIME_WS_URL=ws://localhost:5401/debug/ws

# Optional. Defaults to eba_event_probe.jsonl in the plugin working directory.
EBA_PROBE_LOG=eba_event_probe.jsonl

# Optional. Set to 1 to make the plugin call LangBot plugin APIs when it
# receives the first MessageReceived event.
EBA_PROBE_API=0
11 changes: 11 additions & 0 deletions EBAEventProbe/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Runtime output generated by this probe plugin.
eba_event_probe.jsonl

# Local runtime connection settings.
.env

# Python cache and local virtual environments.
__pycache__/
*.py[cod]
.venv/
venv/
81 changes: 81 additions & 0 deletions EBAEventProbe/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
# EBA Event Probe

EBA Event Probe is a test plugin for the Event-Based Agent architecture. It registers one `EventListener` and records every supported EBA platform event it receives.

It is useful when validating:

- whether LangBot forwards platform EBA events into the plugin runtime;
- whether plugin API calls still work from an EBA event handler;
- whether a standalone runtime can deliver EBA events to plugin listeners;
- whether new platform adapters expose the expected event coverage.

## Events

The listener currently records:

- `MessageReceived`
- `MessageEdited`
- `MessageDeleted`
- `MessageReactionReceived`
- `FeedbackReceived`
- `GroupMemberJoined`
- `GroupMemberLeft`
- `GroupMemberBanned`
- `BotInvitedToGroup`
- `BotRemovedFromGroup`
- `BotMuted`
- `BotUnmuted`
- `PlatformSpecificEventReceived`

## Output

Each received event is appended as one JSON object per line:

```json
{"event_name":"MessageReceived","query_id":0,"event":{}}
```

Set `EBA_PROBE_LOG` to change the log path. If it is not set, the plugin writes to `eba_event_probe.jsonl` in the current working directory.

## API Probe

Set `EBA_PROBE_API=1` to make the listener call plugin APIs after the first `MessageReceived` event:

- `get_langbot_version`
- `get_bots`
- `get_bot_info`
- `send_message`
- plugin storage set/get/list/delete
- workspace storage set/get/list/delete
- `list_plugins_manifest`
- `list_commands`
- `list_tools`
- `list_knowledge_bases`

Additional probe flags:

- `EBA_PROBE_COMPONENT_SWEEP=1` sends a component matrix to the triggering chat: plain text, mentions, `AtAll` in groups, base64 image, quote, file, and flattened forward.
- `EBA_PROBE_PLATFORM_API=1` calls safe common platform APIs and selected `call_platform_api` actions for the adapter.
- `EBA_PROBE_DESTRUCTIVE=1` enables destructive or externally visible moderation-style calls. Keep it disabled unless the test uses disposable targets.

Query-based APIs such as `EventContext.reply()` are intentionally not called by this EBA probe because standalone EBA platform events do not have a pipeline query context.

## Standalone Runtime

Start the runtime:

```bash
lbp rt --debug-only
```

Copy `.env.example` to `.env`, adjust `DEBUG_RUNTIME_WS_URL` if needed, then run the plugin:

```bash
lbp run
```

Run the standalone probe driver from this plugin directory to verify both event delivery and API calls:

```bash
python scripts/standalone_runtime_probe.py
```
4 changes: 4 additions & 0 deletions EBAEventProbe/assets/icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions EBAEventProbe/components/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

1 change: 1 addition & 0 deletions EBAEventProbe/components/event_listener/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

Loading