@rebasepro/plugin-ai 0.21.0 → 0.21.1-canary.g8c5a265

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +19 -7
  2. package/package.json +8 -8
package/README.md CHANGED
@@ -9,10 +9,10 @@ pnpm add @rebasepro/plugin-ai
9
9
  ```
10
10
 
11
11
  ESM-only: `"type": "module"` with no CommonJS build, so it is loaded with
12
- `import`. `require()` of it resolves only on Node 22.12+, which supports
13
- `require(esm)`.
12
+ `import`. It needs Node `>=22.22.0` (its `engines` floor), where `require()`
13
+ of it resolves too: Node has supported `require(esm)` since 22.12.
14
14
 
15
- **Peer dependencies:** `react >= 19.2.7`, `react-dom >= 19.2.7`, `react-router ^8`
15
+ **Peer dependencies:** `react ^19.2.7`, `react-dom ^19.2.7`, `react-router ^8.3.0`
16
16
 
17
17
  ## What This Package Does
18
18
 
@@ -53,8 +53,8 @@ Two consequences worth knowing:
53
53
  it is filling. Values of properties marked `admin: { readOnly: true }` or
54
54
  `admin: { disabled: true }` are the exception — they are neither filled nor sent.
55
55
  If the rest is not acceptable for your data, set `endpoint` and run the
56
- service yourself — the reference implementation is `saas/backend/functions/ai.ts`
57
- in the Rebase repository, and the wire format is documented in `src/api.ts`.
56
+ service yourself — [Self-hosting the service](#self-hosting-the-service) lists
57
+ the four routes it has to answer.
58
58
 
59
59
  The plugin renders nothing until the service's `GET /status` reports itself
60
60
  available, so an unreachable host or an exhausted daily quota means no Autofill
@@ -99,7 +99,18 @@ const dataEnhancementPlugin = useDataEnhancementPlugin({
99
99
  ```
100
100
 
101
101
  Your endpoint needs to answer `GET /status`, `POST /autofill` (SSE), `POST /autocomplete`
102
- (SSE) and `POST /prompts`.
102
+ (SSE) and `POST /prompts`. No credential is sent to any of them, and every request
103
+ body is JSON:
104
+
105
+ | Route | Receives | Answers |
106
+ |---|---|---|
107
+ | `GET /status` | — | `{ available, model?, features? }`. Anything but a 2xx with `available: true` hides the Autofill button for the session |
108
+ | `POST /autofill` | `{ entityName, entityDescription?, values, properties, propertyKey?, propertyInstructions?, instructions? }` | SSE: `suggestion_delta` (`{ key, text }`) while a field is being written, `suggestion` (`{ key, value }`) once it is complete, then one `done` (`{ suggestions, usage? }`) — or `error` (`{ message }`). A stream that ends without `done` is reported as truncated |
109
+ | `POST /autocomplete` | `{ textBefore, textAfter }` | SSE: `delta` (`{ text }`) records, or `error` (`{ message }`) |
110
+ | `POST /prompts` | `{ entityName, entityDescription?, input? }` | `{ prompts: string[] }`. A failure falls back to the built-in prompts |
111
+
112
+ A non-2xx answer to `/autofill` or `/autocomplete` carries its message as
113
+ `{ error: { message } }`.
103
114
 
104
115
  ### Editor AI Autocomplete
105
116
 
@@ -130,4 +141,5 @@ token.
130
141
 
131
142
  - `@rebasepro/cms` — The admin panel this plugin extends
132
143
  - `@rebasepro/app` — Core framework providing the plugin system
133
- - `@rebasepro/types` — Shared types (`RebasePlugin`, `CollectionConfig`, etc.)
144
+ - `@rebasepro/cms-types` — `RebasePlugin` and the rest of the admin types
145
+ - `@rebasepro/types` — Shared types (`CollectionConfig`, etc.)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rebasepro/plugin-ai",
3
- "version": "0.21.0",
3
+ "version": "0.21.1-canary.g8c5a265",
4
4
  "description": "AI plugin for the Rebase admin panel: field generation and content assistance.",
5
5
  "keywords": [
6
6
  "rebase",
@@ -35,13 +35,13 @@
35
35
  "./package.json": "./package.json"
36
36
  },
37
37
  "dependencies": {
38
- "@rebasepro/cms": "0.21.0",
39
- "@rebasepro/app": "0.21.0",
40
- "@rebasepro/common": "0.21.0",
41
- "@rebasepro/cms-types": "0.21.0",
42
- "@rebasepro/types": "0.21.0",
43
- "@rebasepro/ui": "0.21.0",
44
- "@rebasepro/utils": "0.21.0"
38
+ "@rebasepro/cms": "0.21.1-canary.g8c5a265",
39
+ "@rebasepro/cms-types": "0.21.1-canary.g8c5a265",
40
+ "@rebasepro/app": "0.21.1-canary.g8c5a265",
41
+ "@rebasepro/ui": "0.21.1-canary.g8c5a265",
42
+ "@rebasepro/common": "0.21.1-canary.g8c5a265",
43
+ "@rebasepro/types": "0.21.1-canary.g8c5a265",
44
+ "@rebasepro/utils": "0.21.1-canary.g8c5a265"
45
45
  },
46
46
  "peerDependencies": {
47
47
  "react": "^19.2.7",