pi-webmcp 0.1.0 → 0.1.2
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
CHANGED
|
@@ -3,9 +3,11 @@
|
|
|
3
3
|
A [Pi](https://pi.dev/) extension that connects Pi to webpages that register [WebMCP](https://github.com/webmachinelearning/webmcp) tools.
|
|
4
4
|
|
|
5
5
|
> [!IMPORTANT]
|
|
6
|
+
>
|
|
6
7
|
> Both the WebMCP specification and Chrome’s implementation are in active development. Anticipate breaking changes that affect this extension.
|
|
7
8
|
|
|
8
9
|
> [!CAUTION]
|
|
10
|
+
>
|
|
9
11
|
> This extension can pose a security risk in its default operating mode once the `/webmcp` command is run. A malicious webpage could poison the running Pi session’s context via its WebMCP tool instructions.
|
|
10
12
|
>
|
|
11
13
|
> Use at your own risk. Consider setting `allowedOrigins` to restrict which webpages Pi can connect to.
|
|
@@ -20,20 +22,20 @@ A [Pi](https://pi.dev/) extension that connects Pi to webpages that register [We
|
|
|
20
22
|
|
|
21
23
|
2. Enable Chrome remote debugging by visiting [`chrome://inspect/#remote-debugging`](chrome://inspect/#remote-debugging).
|
|
22
24
|
|
|
23
|
-

|
|
25
|
+

|
|
24
26
|
|
|
25
27
|
3. Enable the relevant Chrome flags for WebMCP.
|
|
26
28
|
|
|
27
29
|
- [`chrome://flags/#devtools-webmcp-support`](chrome://flags/#devtools-webmcp-support)
|
|
28
30
|
- [`chrome://flags/#enable-webmcp-testing`](chrome://flags/#enable-webmcp-testing)
|
|
29
31
|
|
|
30
|
-

|
|
32
|
+

|
|
31
33
|
|
|
32
34
|
## Usage
|
|
33
35
|
|
|
34
36
|
1. Run `/webmcp` and accept the once-per-session confirmation prompt in Chrome.
|
|
35
37
|
|
|
36
|
-

|
|
38
|
+

|
|
37
39
|
|
|
38
40
|
2. Navigate to a WebMCP-capable page, such as Chrome Lab’s [WebMCP Travel](https://googlechromelabs.github.io/webmcp-tools/demos/react-flightsearch/) demo.
|
|
39
41
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-webmcp",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"description": "A Pi extension that connects Pi to webpages that register WebMCP tools.",
|
|
@@ -21,8 +21,7 @@
|
|
|
21
21
|
"files": [
|
|
22
22
|
".pi/extensions/**",
|
|
23
23
|
"src/**",
|
|
24
|
-
"docs/**"
|
|
25
|
-
".github/*.png"
|
|
24
|
+
"docs/**"
|
|
26
25
|
],
|
|
27
26
|
"scripts": {
|
|
28
27
|
"typecheck": "tsc --noEmit",
|
package/src/main.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ExtensionAPI, ExtensionCommandContext } from "@earendil-works/pi-coding-agent";
|
|
2
2
|
import { Key, matchesKey } from "@earendil-works/pi-tui";
|
|
3
|
-
import
|
|
3
|
+
import * as NodeHttpServer from "@effect/platform-node/NodeHttpServer";
|
|
4
4
|
import { Layer, ManagedRuntime, Option, Schema } from "effect";
|
|
5
5
|
import { memoize } from "micro-memoize";
|
|
6
6
|
import { Type } from "typebox";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { AgentToolResult } from "@earendil-works/pi-coding-agent";
|
|
2
|
-
import
|
|
2
|
+
import * as NodeHttpServer from "@effect/platform-node/NodeHttpServer";
|
|
3
3
|
import { Context, Effect, FileSystem, Layer, Path, Ref, Scope } from "effect";
|
|
4
4
|
import { HttpPlatform, HttpServer, HttpServerRequest, HttpServerRespondable, HttpServerResponse, HttpStaticServer } from "effect/unstable/http";
|
|
5
5
|
import { PiContext } from "./PiApi";
|
|
Binary file
|
|
Binary file
|
|
Binary file
|