@klex/agent-admin-api 0.1.1 → 0.3.0

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 (3) hide show
  1. package/README.md +33 -1
  2. package/dist/index.d.ts +1022 -313
  3. package/package.json +8 -3
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # @klex/agent-admin-api
2
2
 
3
- Shared types for the Klex Agent Admin API.
3
+ Shared types for the Klex Bot Admin API.
4
4
 
5
5
  The package exports the routed Hono application type through `AdminApi` and
6
6
  `AdminApiServer`, plus the `OpenAPIHono` type used to build RPC clients.
@@ -13,4 +13,36 @@ const client = hc<AdminApi>('https://agent.example');
13
13
  const health = await client.v1.health.$get();
14
14
  ```
15
15
 
16
+ ## MCP OAuth authorization
17
+
18
+ Version 0.2 adds the consolidated MCP authorization contract. Authorization is
19
+ managed through the MCP server resource:
20
+
21
+ - `PUT /v1/mcp-servers/:name/authorization` starts an interactive OAuth flow or
22
+ returns the existing pending flow.
23
+ - `DELETE /v1/mcp-servers/:name/authorization` cancels a pending flow.
24
+ - `POST /v1/mcp-oauth/callback` delivers the provider result using its OAuth
25
+ `state` value.
26
+ - `GET /v1/mcp-servers` and `GET /v1/mcp-servers/:name` expose authorization
27
+ status, pending authorization metadata, connection errors, and retry timing.
28
+
29
+ The start response contains the provider authorization URL and its associated
30
+ state. Treat both as secrets: do not log them or expose them beyond the client
31
+ that opens the authorization flow. Callback state is single-use and expires at
32
+ the response's `expiresAt` timestamp.
33
+
34
+ Error responses include a machine-readable `code` alongside the human-readable
35
+ `error` message so clients can distinguish unsupported transports, manually
36
+ configured credentials, connected servers, unavailable Cloud authorization,
37
+ and authorization timeouts.
38
+
39
+ ## God session management
40
+
41
+ The Admin API contract includes the dedicated God Messages session:
42
+
43
+ - `POST /v1/god-messages` submits a trusted multipart directive.
44
+ - `GET /v1/god-messages/session` returns the current session state.
45
+ - `GET /v1/god-messages/messages` returns cursor-paginated session history.
46
+ - `POST /v1/god-messages/reset` replaces a resettable session.
47
+
16
48
  Install `hono` and `@hono/zod-openapi` as peer dependencies.