permission addition
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -0,0 +1 @@
|
|||||||
|
*example
|
||||||
|
|||||||
@@ -160,6 +160,8 @@ This allows development before the SDK is officially published to npm.
|
|||||||
|
|
||||||
## Install Into Paperclip (Local Development)
|
## 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
|
### Step 1: Build the plugin
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
@@ -176,10 +178,13 @@ After building, install the plugin into your local Paperclip instance using the
|
|||||||
curl -X POST http://localhost:3100/api/plugins/install \
|
curl -X POST http://localhost:3100/api/plugins/install \
|
||||||
-H "Content-Type: application/json" \
|
-H "Content-Type: application/json" \
|
||||||
-H "Authorization: Bearer <your-api-key>" \
|
-H "Authorization: Bearer <your-api-key>" \
|
||||||
-d '{"packageName":"/home/mike/code/paperclip_plugins/plugin-agent-permissions","isLocalPath":true}'
|
-d '{"packageName":"/absolute/path/to/paperclip_plugins/plugin-agent-permissions","isLocalPath":true}'
|
||||||
```
|
```
|
||||||
|
|
||||||
**Note:** Replace `<your-api-key>` with your Paperclip API key. For local development, you can get this from browser dev tools or the CLI config.
|
**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.
|
The server watches local-path plugins and will automatically restart the worker after rebuilds.
|
||||||
|
|
||||||
@@ -190,7 +195,7 @@ curl http://localhost:3100/api/plugins \
|
|||||||
-H "Authorization: Bearer <your-api-key>"
|
-H "Authorization: Bearer <your-api-key>"
|
||||||
```
|
```
|
||||||
|
|
||||||
You should see `plugin-agent-permissions` in the list.
|
You should see `plugin-agent-permissions` in the list. (Replace 3100 with your port if different.)
|
||||||
|
|
||||||
## Uninstall
|
## Uninstall
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import type { PaperclipPluginManifestV1 } from "@paperclipai/plugin-sdk";
|
import type { PaperclipPluginManifestV1 } from "@paperclipai/plugin-sdk";
|
||||||
|
|
||||||
const manifest: PaperclipPluginManifestV1 = {
|
const manifest: PaperclipPluginManifestV1 = {
|
||||||
id: "paperclipai.plugin-agent-permissions",
|
id: "frenocorp.plugin-agent-permissions",
|
||||||
apiVersion: 1,
|
apiVersion: 1,
|
||||||
version: "0.1.0",
|
version: "0.1.0",
|
||||||
displayName: "Agent Permissions",
|
displayName: "Agent Permissions",
|
||||||
@@ -10,6 +10,8 @@ const manifest: PaperclipPluginManifestV1 = {
|
|||||||
categories: ["ui", "automation"],
|
categories: ["ui", "automation"],
|
||||||
capabilities: [
|
capabilities: [
|
||||||
"agents.read",
|
"agents.read",
|
||||||
|
"plugin.state.read",
|
||||||
|
"plugin.state.write",
|
||||||
"ui.detailTab.register",
|
"ui.detailTab.register",
|
||||||
"ui.sidebar.register"
|
"ui.sidebar.register"
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -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.
|
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
|
```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" \
|
-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
|
## Build Options
|
||||||
|
|
||||||
- `pnpm build` uses esbuild presets from `@paperclipai/plugin-sdk/bundlers`.
|
- `pnpm build` uses esbuild presets from `@paperclipai/plugin-sdk/bundlers`.
|
||||||
- `pnpm build:rollup` uses rollup presets from the same SDK.
|
- `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