126 lines
3.1 KiB
Markdown
126 lines
3.1 KiB
Markdown
# Log Viewer Plugin
|
|
|
|
A Paperclip plugin that monitors and displays agent run logs and activity in real-time.
|
|
|
|
## Features
|
|
|
|
- **Dashboard Widget**: Shows recent log activity on the main dashboard
|
|
- **Full Log Page**: View all captured events with filtering
|
|
- **Event Tracking**: Captures:
|
|
- Agent run started/finished/failed
|
|
- Issue created/updated
|
|
- Goal created
|
|
- Agent created
|
|
|
|
## Development
|
|
|
|
```bash
|
|
pnpm install
|
|
pnpm dev # watch builds
|
|
pnpm dev:ui # local dev server with hot-reload events
|
|
pnpm test
|
|
```
|
|
|
|
This scaffold snapshots `@paperclipai/plugin-sdk` and `@paperclipai/shared` from a local Paperclip checkout at:
|
|
|
|
`/home/mike/code/paperclip/packages/plugins/sdk`
|
|
|
|
The packed tarballs live in `.paperclip-sdk/` for local development. Before publishing this plugin, switch those dependencies to published package versions once they are available on npm.
|
|
|
|
## Install Into Paperclip (Local Development)
|
|
|
|
The API port may vary depending on your setup. Common ports are `3100` (dev server) or `8087`. Check your Paperclip startup logs or use `curl http://localhost:3100/api/health` to find the correct port.
|
|
|
|
### Step 1: Build the plugin
|
|
|
|
```bash
|
|
cd plugin-log-viewer
|
|
pnpm install
|
|
pnpm build
|
|
```
|
|
|
|
### Step 2: Install into Paperclip
|
|
|
|
After building, install the plugin into your local Paperclip instance using the API:
|
|
|
|
```bash
|
|
curl -X POST http://localhost:3100/api/plugins/install \
|
|
-H "Content-Type: application/json" \
|
|
-H "Authorization: Bearer <your-api-key>" \
|
|
-d '{"packageName":"/absolute/path/to/paperclip_plugins/plugin-log-viewer","isLocalPath":true}'
|
|
```
|
|
|
|
**Note:**
|
|
- Replace `<your-api-key>` with your Paperclip API key
|
|
- Replace `/absolute/path/to/paperclip_plugins` with the actual absolute path to this repository
|
|
- The port (3100) may need to be changed to match your Paperclip instance (e.g., 8087)
|
|
|
|
The server watches local-path plugins and will automatically restart the worker after rebuilds.
|
|
|
|
### Step 3: Verify installation
|
|
|
|
```bash
|
|
curl http://localhost:3100/api/plugins \
|
|
-H "Authorization: Bearer <your-api-key>"
|
|
```
|
|
|
|
You should see `plugin-log-viewer` in the list. (Replace 3100 with your port if different.)
|
|
|
|
## Uninstall
|
|
|
|
```bash
|
|
curl -X DELETE http://localhost:3100/api/plugins/paperclipai.plugin-log-viewer \
|
|
-H "Authorization: Bearer <your-api-key>"
|
|
```
|
|
|
|
## Build Options
|
|
|
|
- `pnpm build` uses esbuild presets from `@paperclipai/plugin-sdk/bundlers`.
|
|
- `pnpm build:rollup` uses rollup presets from the same SDK.
|
|
|
|
## Publishing to npm
|
|
|
|
### Prerequisites
|
|
|
|
1. An npm account with publish permissions
|
|
2. The `@paperclipai/plugin-sdk` must be published to npm (currently in development)
|
|
|
|
### Steps
|
|
|
|
1. **Update package.json**
|
|
```json
|
|
{
|
|
"private": false,
|
|
"version": "1.0.0",
|
|
"publishConfig": {
|
|
"access": "public"
|
|
}
|
|
}
|
|
```
|
|
|
|
2. **Replace local SDK references**
|
|
|
|
Change from:
|
|
```json
|
|
"@paperclipai/plugin-sdk": "file:.paperclip-sdk/paperclipai-plugin-sdk-1.0.0.tgz"
|
|
```
|
|
|
|
To:
|
|
```json
|
|
"@paperclipai/plugin-sdk": "^1.0.0"
|
|
```
|
|
|
|
3. **Build and publish**
|
|
```bash
|
|
pnpm build
|
|
npm publish
|
|
```
|
|
|
|
## License
|
|
|
|
MIT
|
|
|
|
## Author
|
|
|
|
FrenoCorp
|