@botiverse/porthole 0.3.2 → 0.3.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.
- package/dist/bridge/bridge.d.ts +2 -5
- package/dist/bridge/types.d.ts +11 -4
- package/dist/check/page-source.js +1 -1
- package/dist/conformance/harness-source.js +1 -1
- package/dist/host/create-host.js +5 -1
- package/dist/index.d.ts +1 -1
- package/dist/node/index.d.ts +4 -1
- package/dist/node/index.js +3 -1
- package/dist/react/frame.js +8 -1
- package/dist/server/host.d.ts +4 -1
- package/dist/server/host.js +6 -0
- package/docs/ADOPTING.md +7 -2
- package/docs/DECISIONS.md +20 -0
- package/docs/DESIGN.md +4 -2
- package/package.json +1 -1
- package/src/bridge/bridge.ts +2 -1
- package/src/bridge/types.ts +12 -1
- package/src/host/create-host.ts +5 -1
- package/src/index.ts +1 -0
- package/src/node/index.ts +7 -2
- package/src/react/frame.tsx +8 -1
- package/src/server/host.ts +10 -1
package/dist/bridge/bridge.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type CapabilityName } from "../config/capabilities.ts";
|
|
2
2
|
import type { AnnotationReport } from "../annotate/types.ts";
|
|
3
3
|
import type { PortholeConfig } from "../config/schema.ts";
|
|
4
|
-
import type { CapabilityHandlers, Confirm, HostFunctionBridge, Refusal } from "./types.ts";
|
|
4
|
+
import type { CapabilityHandlers, Confirm, ConfirmDisplay, HostFunctionBridge, Refusal } from "./types.ts";
|
|
5
5
|
/**
|
|
6
6
|
* The host-function bridge: every capability call from a frame passes here, and nowhere else
|
|
7
7
|
* reaches a host handler. In order: declared → arguments well formed → not muted → within its
|
|
@@ -26,10 +26,7 @@ export type BridgeEvent = {
|
|
|
26
26
|
};
|
|
27
27
|
export interface BridgeOptions {
|
|
28
28
|
readonly config: PortholeConfig;
|
|
29
|
-
readonly display:
|
|
30
|
-
readonly id: string;
|
|
31
|
-
readonly title: string;
|
|
32
|
-
};
|
|
29
|
+
readonly display: ConfirmDisplay;
|
|
33
30
|
readonly handlers: CapabilityHandlers;
|
|
34
31
|
readonly confirm?: Confirm;
|
|
35
32
|
/** Whether the embedding page has user activation now; undefined where it can't tell. */
|
package/dist/bridge/types.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { CapabilityArgs, CapabilityName, CapabilityResults, HandledCapability } from "../config/capabilities.ts";
|
|
2
|
+
import type { InstanceRef } from "../isolation/types.ts";
|
|
2
3
|
/**
|
|
3
4
|
* The host-function bridge (ARCHITECTURE § Framework layer): carries a capability call from the
|
|
4
5
|
* frame to the host's handler and its result back, checking at the boundary that the capability
|
|
@@ -17,15 +18,21 @@ export type CapabilityHandler<N extends CapabilityName> = (args: CapabilityArgs[
|
|
|
17
18
|
export type CapabilityHandlers = {
|
|
18
19
|
readonly [N in HandledCapability]?: CapabilityHandler<N>;
|
|
19
20
|
};
|
|
21
|
+
/**
|
|
22
|
+
* The display a confirmation is for, as the host named it: its id and title, and the instance it
|
|
23
|
+
* shows where it is served (P076), so a host can word its dialog from its own records.
|
|
24
|
+
*/
|
|
25
|
+
export interface ConfirmDisplay {
|
|
26
|
+
readonly id: string;
|
|
27
|
+
readonly title: string;
|
|
28
|
+
readonly instance?: InstanceRef;
|
|
29
|
+
}
|
|
20
30
|
/** What a person is asked to confirm: the call's whole effect, not a summary the content chose. */
|
|
21
31
|
export type ConfirmRequest = {
|
|
22
32
|
[N in CapabilityName]: {
|
|
23
33
|
readonly capability: N;
|
|
24
34
|
readonly args: CapabilityArgs[N];
|
|
25
|
-
readonly display:
|
|
26
|
-
readonly id: string;
|
|
27
|
-
readonly title: string;
|
|
28
|
-
};
|
|
35
|
+
readonly display: ConfirmDisplay;
|
|
29
36
|
};
|
|
30
37
|
}[CapabilityName];
|
|
31
38
|
/**
|