@surfaceapi/mastra 0.1.1 → 0.1.3

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 +11 -4
  2. package/index.js +2 -2
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -8,16 +8,25 @@ Surface by Canada Site Ops. Ontario, Canada.
8
8
 
9
9
  ## Get a free API key in about 10 seconds
10
10
 
11
- No email, no card. Then set `SURFACE_API_KEY`, or pass `apiKey`. The tool sends it as `Authorization: Bearer <key>`.
11
+ No email, no card. Then set `SURFACE_KEY` or `SURFACE_API_KEY`, or pass `apiKey`. The tool sends it as `Authorization: Bearer <key>`.
12
12
 
13
13
  ```bash
14
14
  curl -s -X POST https://nova-otter-delta-cloud.grok.me/v1/keys
15
15
  # returns {"key","created_at","free_monthly":1000000,"usage_url"}
16
- export SURFACE_API_KEY=... # paste the key value
16
+ export SURFACE_KEY=... # or SURFACE_API_KEY; paste the key value
17
17
  ```
18
18
 
19
19
  A key gets its own million free requests a month. Anonymous calls still work on a shared demo limit.
20
20
 
21
+ ## Check a link with the key you just minted
22
+
23
+ ```bash
24
+ npx @surfaceapi/surface init
25
+ npx @surfaceapi/surface preflight https://youtu.be/jNQXAC9IVRw
26
+ ```
27
+
28
+ The first command writes `.env`. The second reads that key and calls `POST /v1/preflight`. The answer is `fetch` or `skip`.
29
+
21
30
  ## Install
22
31
 
23
32
  ```bash
@@ -44,5 +53,3 @@ Point any MCP client at `https://nova-otter-delta-cloud.grok.me/mcp` (tool `pref
44
53
  - https://www.npmjs.com/package/@surfaceapi/surface
45
54
  - https://pypi.org/project/surfaceapi/
46
55
  - https://huggingface.co/spaces/surfaceapi/surface-preflight
47
-
48
- CLI and GitHub Action are coming soon.
package/index.js CHANGED
@@ -12,13 +12,13 @@ const env = (k) => (typeof process !== "undefined" && process.env ? process.env[
12
12
 
13
13
  export async function preflight(url, { apiKey, baseUrl, headers, timeoutMs = 15000 } = {}) {
14
14
  const base = (baseUrl || env("SURFACE_BASE_URL") || DEFAULT_BASE_URL).replace(/\/$/, "");
15
- const key = apiKey || env("SURFACE_API_KEY");
15
+ const key = apiKey || env("SURFACE_KEY") || env("SURFACE_API_KEY");
16
16
  const res = await fetch(base + "/v1/preflight", {
17
17
  method: "POST",
18
18
  headers: {
19
19
  "content-type": "application/json",
20
20
  accept: "application/json",
21
- "user-agent": "@surfaceapi/mastra/0.1.1",
21
+ "user-agent": "@surfaceapi/mastra/0.1.2",
22
22
  ...(key ? { authorization: "Bearer " + key } : {}),
23
23
  ...(headers || {}),
24
24
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@surfaceapi/mastra",
3
- "version": "0.1.1",
3
+ "version": "0.1.3",
4
4
  "description": "Surface for Mastra: the link-safety layer between an AI agent and the open web. One tool, surface_preflight, that answers fetch or skip without returning the page.",
5
5
  "type": "module",
6
6
  "main": "./index.js",