@surfaceapi/langchain 0.1.0 → 0.1.1
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 +40 -2
- package/index.js +1 -1
- package/package.json +27 -7
package/README.md
CHANGED
|
@@ -1,10 +1,48 @@
|
|
|
1
1
|
# @surfaceapi/langchain
|
|
2
2
|
|
|
3
|
-
Surface
|
|
3
|
+
Surface checks a short link before your agent opens it. The answer is fetch or skip. It never returns the page. A hop or a 1×1 pixel counts the same way, with no install. Free for the first million requests a month. https://nova-otter-delta-cloud.grok.me
|
|
4
|
+
|
|
5
|
+
This package adds that check to LangChain.js as one tool: `surface_preflight`.
|
|
6
|
+
|
|
7
|
+
Surface by Canada Site Ops. Ontario, Canada.
|
|
8
|
+
|
|
9
|
+
## Get a free API key in about 10 seconds
|
|
10
|
+
|
|
11
|
+
No email, no card. Then set `SURFACE_API_KEY`, or pass `apiKey`. The tool sends it as `Authorization: Bearer <key>`.
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
curl -s -X POST https://nova-otter-delta-cloud.grok.me/v1/keys
|
|
15
|
+
# returns {"key","created_at","free_monthly":1000000,"usage_url"}
|
|
16
|
+
export SURFACE_API_KEY=... # paste the key value
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
A key gets its own million free requests a month. Anonymous calls still work on a shared demo limit.
|
|
20
|
+
|
|
21
|
+
## Install
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
npm i @surfaceapi/langchain @langchain/core zod
|
|
25
|
+
```
|
|
4
26
|
|
|
5
27
|
```js
|
|
28
|
+
import { createReactAgent } from "@langchain/langgraph/prebuilt";
|
|
6
29
|
import { surface_preflight } from "@surfaceapi/langchain";
|
|
7
30
|
const agent = createReactAgent({ llm, tools: [surface_preflight] });
|
|
8
31
|
```
|
|
9
32
|
|
|
10
|
-
|
|
33
|
+
On any error the tool answers `skip`. You can also call `preflight(url, { apiKey })` directly.
|
|
34
|
+
|
|
35
|
+
## Prefer MCP?
|
|
36
|
+
|
|
37
|
+
Point any MCP client at `https://nova-otter-delta-cloud.grok.me/mcp` (tool `preflight_url`), with the same key in `Authorization: Bearer <key>`.
|
|
38
|
+
|
|
39
|
+
## Also listed
|
|
40
|
+
|
|
41
|
+
- Official MCP Registry: `me.grok.nova-otter-delta-cloud/surface`
|
|
42
|
+
- https://www.curatedmcp.com/marketplace/surface
|
|
43
|
+
- https://www.npmjs.com/package/@surfaceapi/langchain
|
|
44
|
+
- https://www.npmjs.com/package/@surfaceapi/surface
|
|
45
|
+
- https://pypi.org/project/surfaceapi/
|
|
46
|
+
- https://huggingface.co/spaces/surfaceapi/surface-preflight
|
|
47
|
+
|
|
48
|
+
CLI and GitHub Action are coming soon.
|
package/index.js
CHANGED
|
@@ -17,7 +17,7 @@ export async function preflight(url, { apiKey, baseUrl, headers, timeoutMs = 150
|
|
|
17
17
|
headers: {
|
|
18
18
|
"content-type": "application/json",
|
|
19
19
|
accept: "application/json",
|
|
20
|
-
"user-agent": "@surfaceapi/langchain/0.1.
|
|
20
|
+
"user-agent": "@surfaceapi/langchain/0.1.1",
|
|
21
21
|
...(key ? { authorization: "Bearer " + key } : {}),
|
|
22
22
|
...(headers || {}),
|
|
23
23
|
},
|
package/package.json
CHANGED
|
@@ -1,15 +1,35 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@surfaceapi/langchain",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"description": "Surface for langchain: 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",
|
|
7
|
-
"files": [
|
|
8
|
-
|
|
7
|
+
"files": [
|
|
8
|
+
"index.js",
|
|
9
|
+
"README.md",
|
|
10
|
+
"LICENSE"
|
|
11
|
+
],
|
|
12
|
+
"keywords": [
|
|
13
|
+
"langchain",
|
|
14
|
+
"ai-agents",
|
|
15
|
+
"tools",
|
|
16
|
+
"link-safety",
|
|
17
|
+
"url",
|
|
18
|
+
"preflight",
|
|
19
|
+
"mcp",
|
|
20
|
+
"surface"
|
|
21
|
+
],
|
|
9
22
|
"author": "Canada Site Ops <canada.site.ops@gmail.com>",
|
|
10
23
|
"license": "MIT",
|
|
11
|
-
"homepage": "https://otter-
|
|
12
|
-
"peerDependencies": {
|
|
13
|
-
|
|
14
|
-
|
|
24
|
+
"homepage": "https://nova-otter-delta-cloud.grok.me",
|
|
25
|
+
"peerDependencies": {
|
|
26
|
+
"@langchain/core": ">=0.3.0",
|
|
27
|
+
"zod": ">=3.22.0"
|
|
28
|
+
},
|
|
29
|
+
"engines": {
|
|
30
|
+
"node": ">=18"
|
|
31
|
+
},
|
|
32
|
+
"publishConfig": {
|
|
33
|
+
"access": "public"
|
|
34
|
+
}
|
|
15
35
|
}
|