@botiverse/porthole 0.10.0 → 0.13.0
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/annotate/types.d.ts +18 -6
- package/dist/annotate/validate.d.ts +11 -1
- package/dist/annotate/validate.js +18 -1
- package/dist/bridge/bridge.d.ts +8 -1
- package/dist/bridge/bridge.js +7 -0
- package/dist/bridge/unseen.d.ts +8 -0
- package/dist/bridge/unseen.js +17 -0
- package/dist/check/files.d.ts +2 -0
- package/dist/check/files.js +71 -50
- package/dist/check/lint.d.ts +8 -1
- package/dist/check/lint.js +18 -0
- package/dist/check/markup.d.ts +7 -0
- package/dist/check/markup.js +49 -0
- package/dist/check/page-source.js +1 -1
- package/dist/check/scroll.d.ts +116 -0
- package/dist/check/scroll.js +1485 -0
- package/dist/config/capabilities.d.ts +16 -3
- package/dist/config/capabilities.js +1 -0
- package/dist/conformance/harness-source.js +1 -1
- package/dist/conformance/runtime.js +6 -0
- package/dist/guide/guide.js +1 -1
- package/dist/guide/runtime.js +2 -2
- package/dist/host/create-host.js +30 -3
- package/dist/host/types.d.ts +15 -0
- package/dist/index.d.ts +2 -1
- package/dist/index.js +1 -0
- package/dist/platform/focus-guard.d.ts +143 -0
- package/dist/platform/focus-guard.js +445 -0
- package/dist/platform/types.d.ts +18 -0
- package/dist/platform/web.js +22 -0
- package/dist/react/frame.d.ts +10 -1
- package/dist/react/frame.js +4 -0
- package/dist/runtime/requests.d.ts +5 -0
- package/dist/runtime/requests.js +41 -4
- package/dist/runtime/types.generated.js +1 -1
- package/dist/shell/annotate.d.ts +2 -1
- package/dist/shell/annotate.js +29 -12
- package/dist/shell/use.js +9 -1
- package/docs/ADOPTING.md +106 -5
- package/docs/ARCHITECTURE.md +2 -1
- package/docs/DECISIONS.md +741 -2
- package/docs/DESIGN.md +38 -9
- package/docs/THREAT_MODEL.md +146 -19
- package/package.json +1 -1
- package/src/annotate/types.ts +19 -6
- package/src/annotate/validate.ts +20 -1
- package/src/bridge/bridge.ts +17 -1
- package/src/bridge/unseen.ts +24 -0
- package/src/check/files.ts +72 -54
- package/src/check/lint.ts +24 -0
- package/src/check/markup.ts +53 -0
- package/src/check/scroll.ts +1825 -0
- package/src/config/capabilities.ts +16 -3
- package/src/conformance/runtime.ts +9 -0
- package/src/guide/guide.ts +1 -0
- package/src/guide/runtime.ts +2 -2
- package/src/host/create-host.ts +38 -3
- package/src/host/types.ts +13 -0
- package/src/index.ts +2 -0
- package/src/platform/focus-guard.ts +572 -0
- package/src/platform/types.ts +17 -0
- package/src/platform/web.ts +22 -0
- package/src/react/frame.tsx +12 -1
- package/src/runtime/requests.ts +50 -6
- package/src/runtime/types.generated.ts +1 -1
- package/src/shell/annotate.ts +29 -12
- package/src/shell/use.ts +9 -1
- package/types/runtime/v1/comments.d.ts +20 -6
|
@@ -15,9 +15,14 @@ export type CapabilityName = (typeof CAPABILITY_NAMES)[number];
|
|
|
15
15
|
/**
|
|
16
16
|
* What must hold before a call reaches the host's handler. A capability's gates all apply.
|
|
17
17
|
*
|
|
18
|
-
* - `user-activation`: the call follows a real user gesture
|
|
19
|
-
*
|
|
20
|
-
*
|
|
18
|
+
* - `user-activation`: the call follows a real user gesture. The shell refuses a call without one
|
|
19
|
+
* in its frame, but that check is the page's own (a page posts the call itself and skips it).
|
|
20
|
+
* The host checks its own page's transient activation, which a gesture in a child frame
|
|
21
|
+
* propagates to, and which lasts 5 s after any gesture anywhere on the host's page: a click on
|
|
22
|
+
* the host's own UI, or the person typing in its own composer, counts. So it stops calls made on
|
|
23
|
+
* load, or on a timer while nobody does anything; it is not proof that the gesture was in this
|
|
24
|
+
* frame, nor of intent. Where a capability needs that (`comments`, P109: its draft goes into
|
|
25
|
+
* the person's composer), the host also asks that its page's focus be in the calling frame.
|
|
21
26
|
* - `confirm`: the host's `confirm` function shows a person the call's whole effect, and the call
|
|
22
27
|
* goes only if they accept. No `confirm` function means the call is refused (fail closed).
|
|
23
28
|
* - `rateLimit`: at most `perMinute` calls per display per minute; the rest are refused.
|
|
@@ -53,6 +58,13 @@ export interface CapabilitySpec {
|
|
|
53
58
|
readonly method: string;
|
|
54
59
|
readonly sdk?: string;
|
|
55
60
|
};
|
|
61
|
+
/**
|
|
62
|
+
* Its `user-activation` gate also needs the person in the calling frame (P109): the host page's
|
|
63
|
+
* focus in that frame, which a press on it or a Tab into it gives and the focus guard keeps from
|
|
64
|
+
* a frame's own `focus()`. Activation alone lasts 5 s after any gesture on the host's page,
|
|
65
|
+
* typing in its own composer included.
|
|
66
|
+
*/
|
|
67
|
+
readonly inFrame?: true;
|
|
56
68
|
}
|
|
57
69
|
/** The most text one `copyText` call carries. */
|
|
58
70
|
export declare const MAX_COPY_CHARS = 20000;
|
|
@@ -174,6 +186,7 @@ export declare const CAPABILITIES: {
|
|
|
174
186
|
readonly request: {
|
|
175
187
|
readonly method: "porthole/call";
|
|
176
188
|
};
|
|
189
|
+
readonly inFrame: true;
|
|
177
190
|
};
|
|
178
191
|
/** This artifact's current version, and a new version of it, base-checked (P088). */
|
|
179
192
|
readonly artifact: {
|
|
@@ -109,6 +109,7 @@ export const CAPABILITIES = {
|
|
|
109
109
|
defaultGates: ["user-activation", rate(30)],
|
|
110
110
|
served: "handler",
|
|
111
111
|
request: { method: "porthole/call" },
|
|
112
|
+
inFrame: true,
|
|
112
113
|
},
|
|
113
114
|
/** This artifact's current version, and a new version of it, base-checked (P088). */
|
|
114
115
|
artifact: { defaultGates: [rate(10)], served: "handler", request: { method: "porthole/call" } },
|