@exposify/next 0.0.9 → 0.0.10
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.
- package/README.md +15 -4
- package/dist/index.cjs +3 -3
- package/dist/index.js +3 -3
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -1,14 +1,25 @@
|
|
|
1
1
|
# @exposify/next
|
|
2
2
|
|
|
3
|
-
Next.js integration for
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
Next.js integration for
|
|
4
|
+
[Exposify](https://github.com/ayadagain/agentready#readme): your route
|
|
5
|
+
handlers, pages and Server Actions become MCP tools that AI agents can call,
|
|
6
|
+
at `/mcp` on your own app. Tool calls go over HTTP to your own app, so your
|
|
7
|
+
`proxy.ts`/middleware auth applies — there's no separate service and no
|
|
8
|
+
privilege escalation.
|
|
6
9
|
|
|
7
10
|
```sh
|
|
8
11
|
npm install @exposify/next
|
|
9
12
|
npx @exposify/next setup # pick the endpoints, get the route file to create
|
|
10
13
|
```
|
|
11
14
|
|
|
15
|
+
> **Which package?** Use **`@exposify/next`** for a Next.js app, including one
|
|
16
|
+
> whose users sign in with Supabase Auth (`@supabase/ssr`) — tool calls run
|
|
17
|
+
> through your Next server, so your own auth and checks apply. Use
|
|
18
|
+
> [**`@exposify/supabase`**](https://github.com/ayadagain/agentready/tree/main/packages/supabase)
|
|
19
|
+
> instead when you want an MCP endpoint served straight from a Supabase **edge
|
|
20
|
+
> function** over PostgREST, with RLS as the authorization layer and no Next
|
|
21
|
+
> app in front of it.
|
|
22
|
+
|
|
12
23
|
Or by hand, in two files:
|
|
13
24
|
|
|
14
25
|
```ts
|
|
@@ -197,7 +208,7 @@ alone keep their session in the browser, where the server never sees it.
|
|
|
197
208
|
**No login found, and no sign-in method in the dashboard?** Then agents use
|
|
198
209
|
your app signed out: `/mcp` doesn't ask them to sign in, and your own checks
|
|
199
210
|
decide what they can do. The startup log says which it is
|
|
200
|
-
(`[
|
|
211
|
+
(`[exposify] How agents sign in: ...`), and so does the dashboard's "How
|
|
201
212
|
agents sign in" page. Adding a sign-in method there takes effect within a
|
|
202
213
|
minute.
|
|
203
214
|
|
package/dist/index.cjs
CHANGED
|
@@ -129,7 +129,7 @@ async function runAction(fn, action, args) {
|
|
|
129
129
|
const flow = nextControlFlow(err);
|
|
130
130
|
if (flow && "redirect" in flow) return json(JSON.stringify({ ok: true, redirectedTo: flow.redirect }));
|
|
131
131
|
if (flow) return json(JSON.stringify({ error: ERRORS[flow.status] ?? `HTTP ${flow.status}` }), flow.status);
|
|
132
|
-
console.error(`[
|
|
132
|
+
console.error(`[exposify] server action ${action.export} threw:`, err);
|
|
133
133
|
return json(JSON.stringify({ error: "the action threw an error" }), 500);
|
|
134
134
|
}
|
|
135
135
|
}
|
|
@@ -304,7 +304,7 @@ async function readActionResponse(res, exportName) {
|
|
|
304
304
|
const flow = nextControlFlow({ digest: err.digest });
|
|
305
305
|
if (flow && "redirect" in flow) return json(JSON.stringify({ ok: true, redirectedTo: flow.redirect }));
|
|
306
306
|
if (flow) return json(JSON.stringify({ error: ERRORS[flow.status] ?? `HTTP ${flow.status}` }), flow.status);
|
|
307
|
-
console.error(`[
|
|
307
|
+
console.error(`[exposify] server action ${exportName} threw: ${err.message}`);
|
|
308
308
|
return json(JSON.stringify({ error: "the action threw an error" }), 500);
|
|
309
309
|
}
|
|
310
310
|
}
|
|
@@ -735,7 +735,7 @@ async function agentIp(request, options = {}) {
|
|
|
735
735
|
var import_core2 = require("@exposify/core");
|
|
736
736
|
var DISPATCH_HEADER = "x-exposify-dispatch";
|
|
737
737
|
var PRM_SUFFIX = "/.well-known/oauth-protected-resource";
|
|
738
|
-
var LOG_PREFIX = "[
|
|
738
|
+
var LOG_PREFIX = "[exposify]";
|
|
739
739
|
var ACTION_NOTE = "It returns the action's result, or { ok: true, redirectedTo } when the action redirects; a redirect to a sign-in page means the call wasn't authorised.";
|
|
740
740
|
var LEFT_BLANK = "A field you leave out is as if left blank on the form.";
|
|
741
741
|
var PAGE_NOTE = "Returns the page's main content as text, with links, and the data it was rendered with when the page passes any to its components. An error naming a sign-in page means signing in first.";
|
package/dist/index.js
CHANGED
|
@@ -141,7 +141,7 @@ async function runAction(fn, action, args) {
|
|
|
141
141
|
const flow = nextControlFlow(err);
|
|
142
142
|
if (flow && "redirect" in flow) return json(JSON.stringify({ ok: true, redirectedTo: flow.redirect }));
|
|
143
143
|
if (flow) return json(JSON.stringify({ error: ERRORS[flow.status] ?? `HTTP ${flow.status}` }), flow.status);
|
|
144
|
-
console.error(`[
|
|
144
|
+
console.error(`[exposify] server action ${action.export} threw:`, err);
|
|
145
145
|
return json(JSON.stringify({ error: "the action threw an error" }), 500);
|
|
146
146
|
}
|
|
147
147
|
}
|
|
@@ -316,7 +316,7 @@ async function readActionResponse(res, exportName) {
|
|
|
316
316
|
const flow = nextControlFlow({ digest: err.digest });
|
|
317
317
|
if (flow && "redirect" in flow) return json(JSON.stringify({ ok: true, redirectedTo: flow.redirect }));
|
|
318
318
|
if (flow) return json(JSON.stringify({ error: ERRORS[flow.status] ?? `HTTP ${flow.status}` }), flow.status);
|
|
319
|
-
console.error(`[
|
|
319
|
+
console.error(`[exposify] server action ${exportName} threw: ${err.message}`);
|
|
320
320
|
return json(JSON.stringify({ error: "the action threw an error" }), 500);
|
|
321
321
|
}
|
|
322
322
|
}
|
|
@@ -751,7 +751,7 @@ import {
|
|
|
751
751
|
} from "@exposify/core";
|
|
752
752
|
var DISPATCH_HEADER = "x-exposify-dispatch";
|
|
753
753
|
var PRM_SUFFIX = "/.well-known/oauth-protected-resource";
|
|
754
|
-
var LOG_PREFIX = "[
|
|
754
|
+
var LOG_PREFIX = "[exposify]";
|
|
755
755
|
var ACTION_NOTE = "It returns the action's result, or { ok: true, redirectedTo } when the action redirects; a redirect to a sign-in page means the call wasn't authorised.";
|
|
756
756
|
var LEFT_BLANK = "A field you leave out is as if left blank on the form.";
|
|
757
757
|
var PAGE_NOTE = "Returns the page's main content as text, with links, and the data it was rendered with when the page passes any to its components. An error naming a sign-in page means signing in first.";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@exposify/next",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.10",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.cjs",
|
|
@@ -32,8 +32,8 @@
|
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"@babel/parser": "^8.0.0",
|
|
35
|
-
"@exposify/cli": "0.0.
|
|
36
|
-
"@exposify/core": "0.3.
|
|
35
|
+
"@exposify/cli": "0.0.9",
|
|
36
|
+
"@exposify/core": "0.3.19",
|
|
37
37
|
"tinyglobby": "^0.2.10",
|
|
38
38
|
"zod": "^3.24.0"
|
|
39
39
|
},
|