@botiverse/porthole 0.5.0 → 0.5.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/dist/bridge/bridge.d.ts +12 -4
- package/dist/bridge/bridge.js +58 -26
- package/dist/bridge/navigation.d.ts +11 -0
- package/dist/bridge/navigation.js +30 -0
- package/dist/bridge/refusal.d.ts +53 -0
- package/dist/bridge/refusal.js +121 -0
- package/dist/bridge/types.d.ts +7 -0
- package/dist/check/page-source.js +1 -1
- package/dist/check/page.js +5 -0
- package/dist/config/capabilities.d.ts +5 -0
- package/dist/conformance/harness-source.js +1 -1
- package/dist/guide/guide.js +14 -4
- package/dist/host/create-host.js +15 -4
- package/dist/host/types.d.ts +15 -2
- package/dist/index.d.ts +2 -1
- package/dist/index.js +3 -1
- package/dist/mcp/adapter.js +22 -7
- package/dist/protocol/mcp-apps.d.ts +6 -0
- package/dist/protocol/mcp-apps.js +6 -0
- package/dist/protocol/shell-adapter.js +14 -2
- package/dist/react/frame.d.ts +19 -4
- package/dist/react/frame.js +37 -9
- package/dist/shell/runtime.js +34 -8
- package/docs/ADOPTING.md +39 -9
- package/docs/DECISIONS.md +92 -0
- package/docs/DESIGN.md +12 -7
- package/package.json +1 -1
- package/src/bridge/bridge.ts +70 -22
- package/src/bridge/navigation.ts +34 -0
- package/src/bridge/refusal.ts +151 -0
- package/src/bridge/types.ts +12 -1
- package/src/check/page.ts +7 -0
- package/src/config/capabilities.ts +5 -1
- package/src/guide/guide.ts +18 -4
- package/src/host/create-host.ts +16 -4
- package/src/host/types.ts +13 -2
- package/src/index.ts +9 -0
- package/src/mcp/adapter.ts +26 -6
- package/src/protocol/mcp-apps.ts +7 -0
- package/src/protocol/shell-adapter.ts +15 -2
- package/src/react/frame.tsx +53 -14
- package/src/shell/runtime.ts +34 -8
package/dist/check/page.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { capabilitySpec, isCapabilityName, } from "../config/capabilities.js";
|
|
2
|
+
import { addressWithoutQuery } from "../bridge/navigation.js";
|
|
2
3
|
import { createHost } from "../host/create-host.js";
|
|
3
4
|
import { webPlatform } from "../platform/web.js";
|
|
4
5
|
import { contentLine, instrumented, } from "./instrument.js";
|
|
@@ -150,6 +151,10 @@ const check = {
|
|
|
150
151
|
calls.push({ capability, outcome: refusal });
|
|
151
152
|
}
|
|
152
153
|
});
|
|
154
|
+
// A navigation the shell stopped (P080): the content tried to leave its page.
|
|
155
|
+
display.on("navigationBlocked", ({ url }) => {
|
|
156
|
+
run.data.errors.push(`It tried to navigate its frame to ${addressWithoutQuery(url)}, and was stopped: content never leaves its page`);
|
|
157
|
+
});
|
|
153
158
|
display.on("outcome", (outcome) => {
|
|
154
159
|
run.data.outcome = outcome.state === "blocked" ? `blocked: ${outcome.reason}` : outcome.state;
|
|
155
160
|
});
|
|
@@ -169,8 +169,13 @@ export interface CapabilityArgs {
|
|
|
169
169
|
readonly content?: readonly unknown[];
|
|
170
170
|
readonly structuredContent?: Readonly<Record<string, unknown>>;
|
|
171
171
|
};
|
|
172
|
+
/**
|
|
173
|
+
* `navigationBlocked`: the address a navigation of the frame went to when the shell cancelled it
|
|
174
|
+
* (P080), the content's word; `message` is then Porthole's, which names it without its query.
|
|
175
|
+
*/
|
|
172
176
|
readonly reportError: {
|
|
173
177
|
readonly message: string;
|
|
178
|
+
readonly navigationBlocked?: string;
|
|
174
179
|
};
|
|
175
180
|
readonly resize: {
|
|
176
181
|
readonly height: number;
|