@ekrooh/bare 0.6.1 → 0.7.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/README.md +3 -2
- package/dist/errors-Bl5w-m62.mjs +56 -0
- package/dist/events-DUGMT3B9.mjs +40 -0
- package/dist/{index-Do-kTNXw.d.mts → index-B3AmX7mC.d.mts} +35 -146
- package/dist/index.d.mts +2 -1
- package/dist/index.mjs +3 -1
- package/dist/{messages-CMNIFMFY.mjs → messages-BxviiFuh.mjs} +182 -73
- package/dist/plugin-BnDh08L_.mjs +111 -0
- package/dist/plugins-discovery-events.d.mts +1 -1
- package/dist/plugins-discovery-events.mjs +1 -1
- package/dist/plugins-health-events.d.mts +1 -1
- package/dist/plugins-health-events.mjs +1 -1
- package/dist/plugins-logs-events.d.mts +2 -1
- package/dist/plugins-logs-events.mjs +1 -1
- package/dist/plugins-media-events.d.mts +1 -1
- package/dist/plugins-media-events.mjs +1 -26
- package/dist/plugins-permissions-events.d.mts +2 -1
- package/dist/plugins-permissions-events.mjs +11 -3
- package/dist/plugins-q6Wno9wN.mjs +77 -0
- package/dist/plugins.d.mts +7 -4
- package/dist/plugins.mjs +1 -1
- package/dist/runtime.d.mts +31 -7
- package/dist/runtime.mjs +657 -124
- package/dist/{static-file-server-COxd-PFR.d.mts → static-file-server-drT1AHqV.d.mts} +26 -4
- package/dist/{store-DTg1jN5E.mjs → store-Bd2wL58k.mjs} +11 -2
- package/dist/sync.d.mts +36 -0
- package/dist/sync.mjs +323 -0
- package/dist/transports.d.mts +28 -1
- package/dist/transports.mjs +332 -168
- package/dist/types-BC39OoZB.d.mts +152 -0
- package/package.json +12 -7
- package/dist/plugins-BnpdCi3A.mjs +0 -156
package/README.md
CHANGED
|
@@ -85,7 +85,8 @@ timeout-bound.
|
|
|
85
85
|
|
|
86
86
|
## Plugins
|
|
87
87
|
|
|
88
|
-
Core ships no product features. Plugin IDs are `
|
|
88
|
+
Core ships no product features. Plugin IDs are namespaced (`app.photos`;
|
|
89
|
+
`core.*` and `vendor.*` are reserved for the framework); events are
|
|
89
90
|
plugin-local (`health.ping`). Runtime adapters: `web`, `android`, `ios`, `bare`.
|
|
90
91
|
Canonical plugins are listed under Repository layout.
|
|
91
92
|
|
|
@@ -143,7 +144,7 @@ Canonical list: [`AGENTS.md`](AGENTS.md#canonical-commands). Common ones:
|
|
|
143
144
|
| `npm run build:core` | Bundle `core/main.core.ts` (esbuild) |
|
|
144
145
|
| `npm run build:web` | Build `examples/web` into the Android app's assets |
|
|
145
146
|
| `npm run build:ios` | iOS inputs (addons, bundle, web assets, xcodegen) |
|
|
146
|
-
| `npm run prebuilds` | Fetch Bare Kit prebuilds (
|
|
147
|
+
| `npm run prebuilds` | Fetch Bare Kit prebuilds (hash-checked, no token) |
|
|
147
148
|
| `npm run playwright:install` | Download Chromium into `.playwright-browsers/` |
|
|
148
149
|
| `npm run smoke:loopback` | Smoke-test the loopback server under `bare` |
|
|
149
150
|
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
// core/messages/constants.ts
|
|
2
|
+
const VERSION = 1;
|
|
3
|
+
const MessageType = { ENVELOPE: 1 };
|
|
4
|
+
/** Canonical error codes. Everything the framework throws uses these; peers
|
|
5
|
+
* may carry arbitrary codes over the wire, and consumers may return app-scoped
|
|
6
|
+
* codes (e.g. `app.photos/not-found`) which are preserved verbatim. Keep
|
|
7
|
+
* `android/src/main/.../ErrorCodes.kt` in sync with the canonical union. */
|
|
8
|
+
const ErrorCode = {
|
|
9
|
+
UNSUPPORTED_CAPABILITY: "UNSUPPORTED_CAPABILITY",
|
|
10
|
+
UNSUPPORTED_EVENT: "UNSUPPORTED_EVENT",
|
|
11
|
+
HOST_ERROR: "HOST_ERROR",
|
|
12
|
+
TRANSPORT_ERROR: "TRANSPORT_ERROR",
|
|
13
|
+
PLUGIN_ERROR: "PLUGIN_ERROR",
|
|
14
|
+
INVALID_RESPONSE: "INVALID_RESPONSE",
|
|
15
|
+
FRAME_TOO_LARGE: "FRAME_TOO_LARGE",
|
|
16
|
+
FRAME_INVALID: "FRAME_INVALID",
|
|
17
|
+
TIMEOUT: "TIMEOUT"
|
|
18
|
+
};
|
|
19
|
+
/** A JSON header must fit a 16-bit big-endian length field. */
|
|
20
|
+
const MAX_HEADER_BYTES = 65535;
|
|
21
|
+
/** Upper bound on one encoded frame. Large binary transfers are a plugin-level
|
|
22
|
+
* concern (out-of-band handles), not an in-band payload. */
|
|
23
|
+
const MAX_FRAME_BYTES = 16777216;
|
|
24
|
+
// core/messages/error-codes.ts
|
|
25
|
+
/** Whether `code` is one of the canonical {@link ErrorCode} values. Own
|
|
26
|
+
* properties only, so `toString` or `__proto__` never match. */
|
|
27
|
+
function isCanonicalErrorCode(code) {
|
|
28
|
+
return typeof code === "string" && Object.prototype.hasOwnProperty.call(ErrorCode, code) && ErrorCode[code] === code;
|
|
29
|
+
}
|
|
30
|
+
// core/messages/types.ts
|
|
31
|
+
var CoreError = class extends Error {
|
|
32
|
+
code;
|
|
33
|
+
constructor(code, message) {
|
|
34
|
+
super(message);
|
|
35
|
+
this.name = "CoreError";
|
|
36
|
+
this.code = code;
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
// core/messages/errors.ts
|
|
40
|
+
/** Success half of an `Either` tuple. */
|
|
41
|
+
function ok(result) {
|
|
42
|
+
return [null, result];
|
|
43
|
+
}
|
|
44
|
+
/** Failure half of an `Either` tuple. Accepts a canonical error code or any
|
|
45
|
+
* app-scoped code (`app.photos/not-found`) — the code is preserved verbatim. */
|
|
46
|
+
function err(code, message) {
|
|
47
|
+
return [new CoreError(code, message), null];
|
|
48
|
+
}
|
|
49
|
+
/** Convenience for constructing a `CoreError` from a possibly-non-canonical
|
|
50
|
+
* wire code: preserves known codes, maps anything else to `PLUGIN_ERROR`.
|
|
51
|
+
* Framework callers that want app codes preserved construct the error
|
|
52
|
+
* directly instead. */
|
|
53
|
+
function coerceErrorCode(code) {
|
|
54
|
+
return isCanonicalErrorCode(code) ? code : ErrorCode.PLUGIN_ERROR;
|
|
55
|
+
}
|
|
56
|
+
export { isCanonicalErrorCode as a, MAX_HEADER_BYTES as c, CoreError as i, MessageType as l, err as n, ErrorCode as o, ok as r, MAX_FRAME_BYTES as s, coerceErrorCode as t, VERSION as u };
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { a as invokeEvent } from "./messages-BxviiFuh.mjs";
|
|
2
|
+
// plugins/media/kinds.ts
|
|
3
|
+
/** The media kinds the native picker understands. Internal (not an `exports`
|
|
4
|
+
* entry): shared by the worklet plugin and the mock transport so both reject
|
|
5
|
+
* the same values. Event specs are types only, so the page can send anything. */
|
|
6
|
+
const MEDIA_KINDS = ["image", "video"];
|
|
7
|
+
function isMediaKind(value) {
|
|
8
|
+
return MEDIA_KINDS.includes(value);
|
|
9
|
+
}
|
|
10
|
+
/** The page-side invoke timeout for `media.pick`/`media.capture`: the native
|
|
11
|
+
* picker/camera is user-mediated and can stay open for minutes. */
|
|
12
|
+
const MEDIA_INVOKE_TIMEOUT_MS = 3e5;
|
|
13
|
+
/** How long the worklet waits for the host's pick/capture. Slightly under the
|
|
14
|
+
* page timeout, so a host that never answers fails the call with a
|
|
15
|
+
* `TIMEOUT` the page can read, before the page gives up on its own. */
|
|
16
|
+
const MEDIA_HOST_TIMEOUT_MS = 295e3;
|
|
17
|
+
// plugins/media/events.ts
|
|
18
|
+
const mediaSpecs = {
|
|
19
|
+
pick: {
|
|
20
|
+
pluginId: "vendor.media",
|
|
21
|
+
name: "media.pick",
|
|
22
|
+
args: {},
|
|
23
|
+
result: {}
|
|
24
|
+
},
|
|
25
|
+
capture: {
|
|
26
|
+
pluginId: "vendor.media",
|
|
27
|
+
name: "media.capture",
|
|
28
|
+
args: {},
|
|
29
|
+
result: {}
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
const mediaEvents = { media: {
|
|
33
|
+
pick(kind = "image") {
|
|
34
|
+
return invokeEvent(mediaSpecs.pick, { kind }, null, MEDIA_INVOKE_TIMEOUT_MS);
|
|
35
|
+
},
|
|
36
|
+
capture(kind = "image") {
|
|
37
|
+
return invokeEvent(mediaSpecs.capture, { kind }, null, MEDIA_INVOKE_TIMEOUT_MS);
|
|
38
|
+
}
|
|
39
|
+
} };
|
|
40
|
+
export { isMediaKind as i, mediaSpecs as n, MEDIA_HOST_TIMEOUT_MS as r, mediaEvents as t };
|
|
@@ -1,146 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
declare const MessageType: {
|
|
3
|
-
readonly ENVELOPE: 1;
|
|
4
|
-
};
|
|
5
|
-
type MessageTypeValue = (typeof MessageType)[keyof typeof MessageType];
|
|
6
|
-
/** Canonical error codes. Everything the framework throws uses these; peers
|
|
7
|
-
* may carry arbitrary codes over the wire, and consumers may return app-scoped
|
|
8
|
-
* codes (e.g. `app.photos/not-found`) which are preserved verbatim. Keep
|
|
9
|
-
* `android/src/main/.../ErrorCodes.kt` in sync with the canonical union. */
|
|
10
|
-
declare const ErrorCode: {
|
|
11
|
-
readonly UNSUPPORTED_CAPABILITY: 'UNSUPPORTED_CAPABILITY';
|
|
12
|
-
readonly UNSUPPORTED_EVENT: 'UNSUPPORTED_EVENT';
|
|
13
|
-
readonly HOST_ERROR: 'HOST_ERROR';
|
|
14
|
-
readonly TRANSPORT_ERROR: 'TRANSPORT_ERROR';
|
|
15
|
-
readonly PLUGIN_ERROR: 'PLUGIN_ERROR';
|
|
16
|
-
readonly INVALID_RESPONSE: 'INVALID_RESPONSE';
|
|
17
|
-
readonly FRAME_TOO_LARGE: 'FRAME_TOO_LARGE';
|
|
18
|
-
readonly FRAME_INVALID: 'FRAME_INVALID';
|
|
19
|
-
readonly TIMEOUT: 'TIMEOUT';
|
|
20
|
-
};
|
|
21
|
-
type ErrorCode = (typeof ErrorCode)[keyof typeof ErrorCode];
|
|
22
|
-
/** A JSON header must fit a 16-bit big-endian length field. */
|
|
23
|
-
declare const MAX_HEADER_BYTES = 65535;
|
|
24
|
-
/** Upper bound on one encoded frame. Large binary transfers are a plugin-level
|
|
25
|
-
* concern (out-of-band handles), not an in-band payload. */
|
|
26
|
-
declare const MAX_FRAME_BYTES: number;
|
|
27
|
-
/** Decoded binary frame (version byte stripped); used by WebSocket and other transports. */
|
|
28
|
-
interface WireMessage {
|
|
29
|
-
type: MessageTypeValue;
|
|
30
|
-
header: MessageHeader;
|
|
31
|
-
payload: Uint8Array;
|
|
32
|
-
}
|
|
33
|
-
type HeaderBase = {
|
|
34
|
-
type: string;
|
|
35
|
-
requestId?: string;
|
|
36
|
-
};
|
|
37
|
-
/** Canonical wire codes plus any app-scoped code consumers define (e.g.
|
|
38
|
-
* `app.photos/not-found`). Framework plugins use the canonical union;
|
|
39
|
-
* arbitrary codes ride the wire verbatim and are never flattened. */
|
|
40
|
-
type ErrorCodeOrString = ErrorCode | (string & {});
|
|
41
|
-
declare class CoreError extends Error {
|
|
42
|
-
code: ErrorCodeOrString;
|
|
43
|
-
constructor(code: ErrorCodeOrString, message: string);
|
|
44
|
-
}
|
|
45
|
-
type CoreErrorWire = {
|
|
46
|
-
code: string;
|
|
47
|
-
message: string;
|
|
48
|
-
};
|
|
49
|
-
type RuntimeTarget = 'web' | 'android' | 'ios' | 'bare';
|
|
50
|
-
type Either<E, A> = [E, null] | [null, A];
|
|
51
|
-
type DispatchEnvelope<TEvent extends string = string, TArgs extends Record<string, unknown> = Record<string, unknown>> = {
|
|
52
|
-
kind: 'dispatch';
|
|
53
|
-
pluginId: string;
|
|
54
|
-
event: TEvent;
|
|
55
|
-
args: TArgs;
|
|
56
|
-
payload?: Uint8Array | ArrayBuffer | string | null;
|
|
57
|
-
};
|
|
58
|
-
type InvokeEnvelope<TEvent extends string = string, TArgs extends Record<string, unknown> = Record<string, unknown>, TResult = unknown> = {
|
|
59
|
-
kind: 'invoke';
|
|
60
|
-
pluginId: string;
|
|
61
|
-
event: TEvent;
|
|
62
|
-
args: TArgs;
|
|
63
|
-
payload?: Uint8Array | ArrayBuffer | string | null;
|
|
64
|
-
timeoutMs?: number;
|
|
65
|
-
__result?: TResult;
|
|
66
|
-
};
|
|
67
|
-
type PluginInvokeRequestHeader = HeaderBase & {
|
|
68
|
-
type: 'INVOKE_REQUEST';
|
|
69
|
-
pluginId: string;
|
|
70
|
-
event: string;
|
|
71
|
-
args?: Record<string, unknown>;
|
|
72
|
-
};
|
|
73
|
-
type PluginInvokeResponseHeader = HeaderBase & {
|
|
74
|
-
type: 'INVOKE_RESPONSE';
|
|
75
|
-
pluginId: string;
|
|
76
|
-
event: string;
|
|
77
|
-
result?: unknown;
|
|
78
|
-
error?: CoreErrorWire;
|
|
79
|
-
};
|
|
80
|
-
type PluginDispatchHeader = HeaderBase & {
|
|
81
|
-
type: 'DISPATCH';
|
|
82
|
-
pluginId: string;
|
|
83
|
-
event: string;
|
|
84
|
-
args?: Record<string, unknown>;
|
|
85
|
-
};
|
|
86
|
-
type PluginHeader = PluginInvokeRequestHeader | PluginInvokeResponseHeader | PluginDispatchHeader;
|
|
87
|
-
/** Worklet → host: ask for merged capability list (host registry + static knowledge). */
|
|
88
|
-
type HostCapabilitiesQueryHeader = {
|
|
89
|
-
type: 'HOST_CAPABILITIES_QUERY';
|
|
90
|
-
requestId: string;
|
|
91
|
-
};
|
|
92
|
-
/** Host → worklet: capability rows contributed by the host. */
|
|
93
|
-
type HostCapabilitiesResponseHeader = {
|
|
94
|
-
type: 'HOST_CAPABILITIES_RESPONSE';
|
|
95
|
-
requestId: string;
|
|
96
|
-
capabilities: CapabilityDescriptor[];
|
|
97
|
-
};
|
|
98
|
-
/** Worklet → host: run a host-registered handler (same pluginId/event as frontend invokes). */
|
|
99
|
-
type HostInvokeRequestHeader = {
|
|
100
|
-
type: 'HOST_INVOKE_REQUEST';
|
|
101
|
-
requestId: string;
|
|
102
|
-
pluginId: string;
|
|
103
|
-
event: string;
|
|
104
|
-
args?: Record<string, unknown>;
|
|
105
|
-
};
|
|
106
|
-
/** Host → worklet: result for {@link HostInvokeRequestHeader}. */
|
|
107
|
-
type HostInvokeResponseHeader = {
|
|
108
|
-
type: 'HOST_INVOKE_RESPONSE';
|
|
109
|
-
requestId: string;
|
|
110
|
-
pluginId: string;
|
|
111
|
-
event: string;
|
|
112
|
-
result?: unknown;
|
|
113
|
-
error?: CoreErrorWire;
|
|
114
|
-
};
|
|
115
|
-
/** Serializable row for discovery and host registry listing. */
|
|
116
|
-
type CapabilityDescriptor = {
|
|
117
|
-
pluginId: string;
|
|
118
|
-
capabilities: string[];
|
|
119
|
-
events: string[];
|
|
120
|
-
runtimes: RuntimeTarget[];
|
|
121
|
-
};
|
|
122
|
-
type MessageHeader = PluginHeader | HostCapabilitiesQueryHeader | HostCapabilitiesResponseHeader | HostInvokeRequestHeader | HostInvokeResponseHeader;
|
|
123
|
-
interface PluginContext {
|
|
124
|
-
runtime: RuntimeTarget;
|
|
125
|
-
payload: Uint8Array;
|
|
126
|
-
/** The registry-validated sender of the envelope. Always equals the
|
|
127
|
-
* wire `pluginId` once the router has matched a manifest — adapters can trust
|
|
128
|
-
* it without re-validating against the wire. */
|
|
129
|
-
sender?: {
|
|
130
|
-
pluginId: string;
|
|
131
|
-
};
|
|
132
|
-
}
|
|
133
|
-
interface PluginRuntimeAdapter {
|
|
134
|
-
dispatch?: (event: string, args: Record<string, unknown> | undefined, context: PluginContext) => void | Promise<void>;
|
|
135
|
-
invoke?: (event: string, args: Record<string, unknown> | undefined, context: PluginContext) => Either<CoreError, unknown> | Promise<Either<CoreError, unknown>>;
|
|
136
|
-
}
|
|
137
|
-
interface PluginManifest {
|
|
138
|
-
id: string;
|
|
139
|
-
version?: string;
|
|
140
|
-
capabilities?: string[];
|
|
141
|
-
events?: string[];
|
|
142
|
-
runtimes: Partial<Record<RuntimeTarget, PluginRuntimeAdapter>>;
|
|
143
|
-
}
|
|
1
|
+
import { E as MessageTypeValue, S as ErrorCode, _ as PluginInvokeResponseHeader, a as Either, b as RuntimeTarget, d as InvokeEnvelope, f as MessageHeader, g as PluginInvokeRequestHeader, i as DispatchEnvelope, m as PluginDispatchHeader, n as CoreError, o as ErrorCodeOrString, p as PluginContext, t as CapabilityDescriptor, v as PluginManifest, x as WireMessage } from "./types-BC39OoZB.mjs";
|
|
144
2
|
/** Success half of an `Either` tuple. */
|
|
145
3
|
declare function ok<T>(result: T): [null, T];
|
|
146
4
|
/** Failure half of an `Either` tuple. Accepts a canonical error code or any
|
|
@@ -181,6 +39,10 @@ interface ProtocolMessenger {
|
|
|
181
39
|
}
|
|
182
40
|
declare function createProtocolMessenger(send: (request: InternalDispatchRequest, payload?: Uint8Array | ArrayBuffer | string | null) => void, options?: {
|
|
183
41
|
platform?: Partial<Platform>;
|
|
42
|
+
/** Append a short tail of the loopback server log (`GET /logs`) to an
|
|
43
|
+
* invoke-timeout rejection. Off by default: log lines are diagnostics for
|
|
44
|
+
* dev and test builds, not text a shipped UI should show. */
|
|
45
|
+
diagnostics?: boolean;
|
|
184
46
|
}): ProtocolMessenger;
|
|
185
47
|
interface PluginRegistry {
|
|
186
48
|
register(plugin: PluginManifest): void;
|
|
@@ -195,10 +57,19 @@ interface PluginRegistry {
|
|
|
195
57
|
}
|
|
196
58
|
declare function createPluginRegistry(): PluginRegistry;
|
|
197
59
|
interface PluginRouter {
|
|
198
|
-
route(header: MessageHeader, payload: Uint8Array
|
|
60
|
+
route(header: MessageHeader, payload: Uint8Array,
|
|
61
|
+
/** Where the message came from. `channel` names the channel it arrived
|
|
62
|
+
* on (e.g. `[ws]`, `[ipc]`); calls with a channel are also held to
|
|
63
|
+
* `maxInflightPerChannel`. */
|
|
64
|
+
context?: {
|
|
65
|
+
channel?: string;
|
|
66
|
+
}): Promise<PluginInvokeResponseHeader | null>;
|
|
199
67
|
}
|
|
200
68
|
type PluginRouterOptions = {
|
|
201
|
-
|
|
69
|
+
/** Delegates an invoke to the host. `timeoutMs` is the event's
|
|
70
|
+
* `hostTimeoutMs` from its manifest, when it declares one; otherwise the
|
|
71
|
+
* bridge default applies. */
|
|
72
|
+
delegateToHost?: (header: PluginInvokeRequestHeader, payload: Uint8Array, timeoutMs?: number) => Promise<PluginInvokeResponseHeader | null>;
|
|
202
73
|
/** Host-registered capabilities (from `HOST_CAPABILITIES_RESPONSE`).
|
|
203
74
|
* Delegation to the host is only permitted for events the host announces
|
|
204
75
|
* here — a deny-by-default allowlist. When omitted or empty, no
|
|
@@ -210,6 +81,16 @@ type PluginRouterOptions = {
|
|
|
210
81
|
* of being queued, so a flood cannot grow memory without bound. Defaults to
|
|
211
82
|
* `DEFAULT_MAX_INFLIGHT`. */
|
|
212
83
|
maxInflight?: number;
|
|
84
|
+
/** Cap on calls routed at once from one channel (see
|
|
85
|
+
* the `channel` passed to `route`), so one peer cannot take every slot: the
|
|
86
|
+
* page cannot starve requests from the host. Defaults to three quarters of
|
|
87
|
+
* `maxInflight`. */
|
|
88
|
+
maxInflightPerChannel?: number;
|
|
89
|
+
/** Cap on calls routed at once to one plugin, so a plugin whose calls are
|
|
90
|
+
* slow cannot take every slot from the others. Defaults to `maxInflight`
|
|
91
|
+
* (no separate cap): a bursty single-plugin app, such as a photo grid, may
|
|
92
|
+
* use every slot. */
|
|
93
|
+
maxInflightPerPlugin?: number;
|
|
213
94
|
/** Plugin ids whose calls must run one at a time, in arrival order. Every
|
|
214
95
|
* other plugin's calls run concurrently, so a slow call never delays them. */
|
|
215
96
|
serialPlugins?: readonly string[];
|
|
@@ -261,6 +142,14 @@ interface EventSpec<TArgs extends Record<string, unknown> = Record<string, never
|
|
|
261
142
|
readonly name: string;
|
|
262
143
|
readonly args: TArgs;
|
|
263
144
|
readonly result: TResult;
|
|
145
|
+
/** Runtime check of the untrusted `args` the page sent. `args` is only a
|
|
146
|
+
* compile-time type: nothing else validates it. When present, the generated
|
|
147
|
+
* adapter runs it before the handler and answers `PLUGIN_ERROR` without
|
|
148
|
+
* calling the handler when it returns false. */
|
|
149
|
+
readonly validate?: (args: unknown) => boolean;
|
|
150
|
+
/** Deadline (ms) for this event when the router delegates it to the host.
|
|
151
|
+
* Set it for user-mediated host calls (permission prompts, pickers). */
|
|
152
|
+
readonly hostTimeoutMs?: number;
|
|
264
153
|
}
|
|
265
154
|
type InvokeHandler<TArgs extends Record<string, unknown> = Record<string, never>, TResult = unknown> = (args: TArgs, context: PluginContext) => Either<CoreError, TResult> | Promise<Either<CoreError, TResult>>;
|
|
266
155
|
type DispatchHandler<TArgs extends Record<string, unknown> = Record<string, never>> = (args: TArgs, context: PluginContext) => void | Promise<void>;
|
|
@@ -346,4 +235,4 @@ type WebConsoleCapture = {
|
|
|
346
235
|
* where there is no loopback backend to ingest into.
|
|
347
236
|
*/
|
|
348
237
|
declare function installWebConsoleCapture(options?: WebConsoleCaptureOptions): WebConsoleCapture;
|
|
349
|
-
export {
|
|
238
|
+
export { Err as A, createPluginRegistry as C, ProtocolMessenger as D, InvokeRequest as E, ok as F, PluginResult as M, coerceErrorCode as N, createProtocolMessenger as O, err as P, createPluginBus as S, DispatchRequest as T, ProtocolOptions as _, LogStore as a, PluginRouter as b, DispatchHandler as c, definePlugin as d, dispatchEvent as f, MessageProtocol as g, Encoder as h, LogSource as i, Ok as j, Platform as k, EventSpec as l, Decoder as m, LogEntry as n, BareRuntimeContext as o, invokeEvent as p, LogLevel as r, createBareRuntimeContext as s, installWebConsoleCapture as t, InvokeHandler as u, PluginBus as v, createPluginRouter as w, PluginRouterOptions as x, PluginRegistry as y };
|
package/dist/index.d.mts
CHANGED
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { C as MAX_FRAME_BYTES, D as VERSION, E as MessageTypeValue, S as ErrorCode, T as MessageType, _ as PluginInvokeResponseHeader, a as Either, b as RuntimeTarget, c as HostCapabilitiesResponseHeader, d as InvokeEnvelope, f as MessageHeader, g as PluginInvokeRequestHeader, h as PluginHeader, i as DispatchEnvelope, l as HostInvokeRequestHeader, m as PluginDispatchHeader, n as CoreError, o as ErrorCodeOrString, p as PluginContext, r as CoreErrorWire, s as HostCapabilitiesQueryHeader, t as CapabilityDescriptor, u as HostInvokeResponseHeader, v as PluginManifest, w as MAX_HEADER_BYTES, x as WireMessage, y as PluginRuntimeAdapter } from "./types-BC39OoZB.mjs";
|
|
2
|
+
import { A as Err, C as createPluginRegistry, D as ProtocolMessenger, E as InvokeRequest, F as ok, M as PluginResult, N as coerceErrorCode, O as createProtocolMessenger, P as err, S as createPluginBus, T as DispatchRequest, _ as ProtocolOptions, b as PluginRouter, c as DispatchHandler, d as definePlugin, f as dispatchEvent, g as MessageProtocol, h as Encoder, j as Ok, k as Platform, l as EventSpec, m as Decoder, o as BareRuntimeContext, p as invokeEvent, s as createBareRuntimeContext, t as installWebConsoleCapture, u as InvokeHandler, v as PluginBus, w as createPluginRouter, x as PluginRouterOptions, y as PluginRegistry } from "./index-B3AmX7mC.mjs";
|
|
2
3
|
export { BareRuntimeContext, CapabilityDescriptor, CoreError, CoreErrorWire, Decoder, DispatchEnvelope, DispatchHandler, DispatchRequest, Either, Encoder, Err, ErrorCode, ErrorCodeOrString, EventSpec, HostCapabilitiesQueryHeader, HostCapabilitiesResponseHeader, HostInvokeRequestHeader, HostInvokeResponseHeader, InvokeEnvelope, InvokeHandler, InvokeRequest, MAX_FRAME_BYTES, MAX_HEADER_BYTES, MessageHeader, MessageProtocol, MessageType, MessageTypeValue, Ok, type Platform, PluginBus, PluginContext, PluginDispatchHeader, PluginHeader, PluginInvokeRequestHeader, PluginInvokeResponseHeader, PluginManifest, PluginRegistry, PluginResult, PluginRouter, PluginRouterOptions, PluginRuntimeAdapter, ProtocolMessenger, ProtocolOptions, RuntimeTarget, VERSION, WireMessage, coerceErrorCode, createBareRuntimeContext, createPluginBus, createPluginRegistry, createPluginRouter, createProtocolMessenger, definePlugin, dispatchEvent, err, installWebConsoleCapture, invokeEvent, ok };
|
package/dist/index.mjs
CHANGED
|
@@ -1 +1,3 @@
|
|
|
1
|
-
|
|
1
|
+
import { c as MAX_HEADER_BYTES, i as CoreError, l as MessageType, n as err, o as ErrorCode, r as ok, s as MAX_FRAME_BYTES, t as coerceErrorCode, u as VERSION } from "./errors-Bl5w-m62.mjs";
|
|
2
|
+
import { a as invokeEvent, d as createPluginRouter, i as dispatchEvent, l as createPluginBus, n as createBareRuntimeContext, o as MessageProtocol, r as definePlugin, s as createProtocolMessenger, t as installWebConsoleCapture, u as createPluginRegistry } from "./messages-BxviiFuh.mjs";
|
|
3
|
+
export { CoreError, ErrorCode, MAX_FRAME_BYTES, MAX_HEADER_BYTES, MessageProtocol, MessageType, VERSION, coerceErrorCode, createBareRuntimeContext, createPluginBus, createPluginRegistry, createPluginRouter, createProtocolMessenger, definePlugin, dispatchEvent, err, installWebConsoleCapture, invokeEvent, ok };
|