permission addition
This commit is contained in:
@@ -27,15 +27,99 @@ This scaffold snapshots `@paperclipai/plugin-sdk` and `@paperclipai/shared` from
|
||||
|
||||
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
|
||||
## 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
|
||||
curl -X POST http://127.0.0.1:3100/api/plugins/install \
|
||||
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" \
|
||||
-d '{"packageName":"/home/mike/code/paperclip_plugins/plugin-log-viewer","isLocalPath":true}'
|
||||
-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
|
||||
|
||||
Reference in New Issue
Block a user