devframe 0.9.12 → 0.9.14
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/{_shared-DEAMiPfH.d.mts → _shared-Bf2FcfJ4.d.mts} +1 -1
- package/dist/adapters/build.d.mts +5 -6
- package/dist/adapters/build.mjs +2 -2
- package/dist/adapters/cac.d.mts +5 -5
- package/dist/adapters/cac.mjs +1 -1
- package/dist/adapters/dev.d.mts +6 -6
- package/dist/adapters/dev.mjs +1 -1
- package/dist/adapters/embedded.d.mts +4 -5
- package/dist/adapters/initiate.d.mts +10 -11
- package/dist/adapters/initiate.mjs +1 -1
- package/dist/adapters/mcp.d.mts +5 -5
- package/dist/adapters/mcp.mjs +1 -1
- package/dist/cli/main.d.mts +2 -3
- package/dist/client/index.d.mts +144 -36
- package/dist/client/index.mjs +223 -34
- package/dist/constants.d.mts +20 -21
- package/dist/{context-BBWPLDHh.d.mts → context-B7411Bem.d.mts} +25 -5
- package/dist/{context-_temOGDB.d.mts → context-CIsx_QnV.d.mts} +1 -1
- package/dist/{context-DwGevWqT.mjs → context-Cdj9z9m2.mjs} +9 -2
- package/dist/{dev-CZ1fu4J1.mjs → dev-DpfkCVqo.mjs} +2 -2
- package/dist/in-page-channel/index.d.mts +76 -38
- package/dist/in-page-channel/index.mjs +56 -22
- package/dist/{index-1ezCLThh.d.mts → index--pZ3fdAq.d.mts} +23 -3
- package/dist/index.d.mts +5 -5
- package/dist/{instance-shell-xuu6jg51.mjs → instance-shell-370Oee9K.mjs} +4 -12
- package/dist/{instance-shell-BUyYrKlu.d.mts → instance-shell-B-FE8NY5.d.mts} +5 -5
- package/dist/internal/index.d.mts +15 -15
- package/dist/internal/index.mjs +1 -1
- package/dist/node/auth.d.mts +3 -3
- package/dist/node/auth.mjs +2 -2
- package/dist/node/hub-internals.d.mts +2 -2
- package/dist/node/index.d.mts +6 -6
- package/dist/node/index.mjs +1 -1
- package/dist/nostics-DD6gsDZA.mjs +108 -0
- package/dist/recipes/common-rpc-functions.d.mts +7 -8
- package/dist/recipes/interactive-auth.d.mts +32 -22
- package/dist/recipes/interactive-auth.mjs +58 -18
- package/dist/rpc/client.d.mts +2 -3
- package/dist/rpc/dump.d.mts +16 -17
- package/dist/rpc/dump.mjs +1 -1
- package/dist/rpc/server.d.mts +2 -3
- package/dist/rpc/transports/sse-server.d.mts +4 -5
- package/dist/rpc/transports/ws-bun.d.mts +6 -7
- package/dist/rpc/transports/ws-deno.d.mts +5 -6
- package/dist/{rpc-core-DiCr5etS.d.mts → rpc-core-D7WvbvK0.d.mts} +2 -2
- package/dist/{shared-state-CaxB1q0h.mjs → shared-state-eQVYHNqA.mjs} +4 -1
- package/dist/{state-Mwt6--el.mjs → state-W4wI6X5X.mjs} +14 -1
- package/dist/types/index.d.mts +1 -1
- package/dist/utils/agent-tool-name.d.mts +2 -3
- package/dist/utils/colors.d.mts +4 -5
- package/dist/utils/crypto-token.d.mts +4 -5
- package/dist/utils/events.d.mts +3 -4
- package/dist/utils/hash.d.mts +2 -3
- package/dist/utils/launch-editor.d.mts +2 -3
- package/dist/utils/nanoid.d.mts +2 -3
- package/dist/utils/open.d.mts +2 -3
- package/dist/utils/remote-assets.d.mts +2 -3
- package/dist/utils/serve-static.d.mts +6 -7
- package/dist/utils/shared-state.d.mts +1 -1
- package/dist/utils/shared-state.mjs +1 -1
- package/dist/utils/simple-schema.d.mts +17 -18
- package/dist/utils/streaming-channel.d.mts +1 -1
- package/dist/utils/streaming-channel.mjs +4 -1
- package/dist/utils/structured-clone.d.mts +5 -6
- package/dist/utils/when.d.mts +6 -7
- package/dist/{write-BuLCrn9h.mjs → write-D2AJqVT8.mjs} +1 -1
- package/package.json +4 -4
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { n as WsOriginRegistry } from "../../ws-server-D2nv68Hg.mjs";
|
|
2
|
-
import { t as ContextRpcServer } from "../../rpc-core-
|
|
2
|
+
import { t as ContextRpcServer } from "../../rpc-core-D7WvbvK0.mjs";
|
|
3
3
|
//#region src/rpc/transports/ws-deno.d.ts
|
|
4
|
-
interface AttachDenoWsTransportOptions {
|
|
4
|
+
export interface AttachDenoWsTransportOptions {
|
|
5
5
|
/** Same contract as `WsRpcTransportOptions.allowedOrigins`. */
|
|
6
6
|
allowedOrigins?: readonly string[] | WsOriginRegistry | false;
|
|
7
7
|
}
|
|
8
|
-
interface DenoWsTier {
|
|
8
|
+
export interface DenoWsTier {
|
|
9
9
|
/**
|
|
10
10
|
* Complete a WS upgrade request; `Deno.serve`'s handler info as the 2nd
|
|
11
11
|
* argument. Unlike Bun, Deno's adapter attaches the socket to the returned
|
|
@@ -21,6 +21,5 @@ interface DenoWsTier {
|
|
|
21
21
|
* app's own origin, with no side-car server. Load it dynamically so the Deno
|
|
22
22
|
* adapter never enters a Node-only bundle path.
|
|
23
23
|
*/
|
|
24
|
-
declare function attachDenoWsTransport(core: ContextRpcServer, options?: AttachDenoWsTransportOptions): Promise<DenoWsTier>;
|
|
25
|
-
//#endregion
|
|
26
|
-
export { AttachDenoWsTransportOptions, DenoWsTier, attachDenoWsTransport };
|
|
24
|
+
export declare function attachDenoWsTransport(core: ContextRpcServer, options?: AttachDenoWsTransportOptions): Promise<DenoWsTier>;
|
|
25
|
+
//#endregion
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { c as DevframeNodeRpcSessionMeta, l as DevframeRpcConnection } from "./ws-server-D2nv68Hg.mjs";
|
|
2
|
-
import { Tt as DevframeAuthHandler, o as DevframeNodeContext, s as DevframeNodeRpcSession, vt as DevframeRpcClientFunctions, yt as DevframeRpcServerFunctions } from "./context-
|
|
3
|
-
import "./index
|
|
2
|
+
import { Tt as DevframeAuthHandler, o as DevframeNodeContext, s as DevframeNodeRpcSession, vt as DevframeRpcClientFunctions, yt as DevframeRpcServerFunctions } from "./context-B7411Bem.mjs";
|
|
3
|
+
import "./index--pZ3fdAq.mjs";
|
|
4
4
|
import { BirpcGroup, EventOptions } from "birpc";
|
|
5
5
|
//#region src/node/rpc-core.d.ts
|
|
6
6
|
interface CreateContextRpcServerOptions {
|
|
@@ -932,10 +932,13 @@ function createSharedState(options) {
|
|
|
932
932
|
rememberSyncId(syncIds, syncId);
|
|
933
933
|
if (enablePatches$1) {
|
|
934
934
|
const [nextState, patches] = produceWithPatches(state, fn);
|
|
935
|
+
if (nextState === state) return;
|
|
935
936
|
state = nextState;
|
|
936
937
|
events.emit("updated", state, patches, syncId);
|
|
937
938
|
} else {
|
|
938
|
-
|
|
939
|
+
const nextState = produce(state, fn);
|
|
940
|
+
if (nextState === state) return;
|
|
941
|
+
state = nextState;
|
|
939
942
|
events.emit("updated", state, void 0, syncId);
|
|
940
943
|
}
|
|
941
944
|
},
|
|
@@ -1215,6 +1215,19 @@ function getTempAuthCode() {
|
|
|
1215
1215
|
return ensureTempAuthCode();
|
|
1216
1216
|
}
|
|
1217
1217
|
/**
|
|
1218
|
+
* The current code plus its expiry timestamp, for display (e.g. the auth
|
|
1219
|
+
* banner). An already-expired code is rotated first, so the returned code is
|
|
1220
|
+
* always redeemable for its remaining lifetime.
|
|
1221
|
+
*/
|
|
1222
|
+
function getTempAuthCodeInfo() {
|
|
1223
|
+
ensureTempAuthCode();
|
|
1224
|
+
if (Date.now() > tempAuthCodeExpiresAt) refreshTempAuthCode();
|
|
1225
|
+
return {
|
|
1226
|
+
code: tempAuthCode,
|
|
1227
|
+
expireAt: tempAuthCodeExpiresAt
|
|
1228
|
+
};
|
|
1229
|
+
}
|
|
1230
|
+
/**
|
|
1218
1231
|
* Rotate the authentication code, resetting its expiry window and failed-attempt
|
|
1219
1232
|
* counter. Call this when a new authentication flow begins (e.g. when an
|
|
1220
1233
|
* untrusted client starts authenticating) so the displayed code is freshly
|
|
@@ -1296,4 +1309,4 @@ function exchangeTempAuthCode(code, session, info, storage) {
|
|
|
1296
1309
|
return authToken;
|
|
1297
1310
|
}
|
|
1298
1311
|
//#endregion
|
|
1299
|
-
export {
|
|
1312
|
+
export { getTempAuthCodeInfo as a, getTempAuthCode as i, describeUA as n, refreshTempAuthCode as o, exchangeTempAuthCode as r, verifyAuthToken as s, buildOtpAuthUrl as t };
|
package/dist/types/index.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { g as RpcFunctionAgentOptions } from "../types-Dq4i156u.mjs";
|
|
2
2
|
import { c as DevframeNodeRpcSessionMeta, d as DevframeRpcTransportKind, l as DevframeRpcConnection, u as DevframeRpcConnectionRequest } from "../ws-server-D2nv68Hg.mjs";
|
|
3
|
-
import { $ as DevframeServiceOf, At as AgentHandle, B as DevframeSetupInfo, Bt as DevframeAgentHostEvents, Ct as DevframeDiagnosticsHost, F as DevframeDefinition, Ft as AgentTool, G as McpAuthorization, H as DevframeSnapshotRpcInputs, Ht as EventUnsubscribe, I as DevframeDeploymentKind, It as AgentToolInput, J as DevframeServiceDefinition, K as McpRouteOptions, L as DevframeDockDefaults, Lt as AgentToolProvider, Mt as AgentResource, Nt as AgentResourceContent, P as DevframeCliOptions, Pt as AgentResourceInput, Q as DevframeServiceMeta, R as DevframeDuplicationStrategy, Rt as AgentToolProviderHandle, St as DevframeStorageScope, U as DevframeSseOptions, Ut as EventsMap, V as DevframeSnapshotRpcEntry, Vt as EventEmitter, W as DevframeWsOptions, X as DevframeServiceId, Y as DevframeServiceDescriptor, Z as DevframeServiceInput, _t as DevframeViewHost, a as DevframeConnectionConfigsRegistry, at as DevframeScopedNodeContext, bt as DevframeRpcSharedStates, c as RpcBroadcastOptions, ct as DevframeSettings, d as RpcSharedStateHost, dt as ScopedBroadcastOptions, et as DevframeServiceScopeOf, f as RpcStreamingChannel, ft as ScopedClientFunctions, gt as SettingsForNamespace, ht as ScopedSharedStates, i as DevframeCapabilities, it as DevframeServicesState, jt as AgentManifest, l as RpcFunctionsHost, lt as DevframeSettingsRegistry, m as RpcStreamingHost, mt as ScopedServerFunctions, n as ConnectionMetaSse, nt as DevframeServicesRegistry, o as DevframeNodeContext, ot as DevframeScopedNodeRpc, p as RpcStreamingChannelOptions, pt as ScopedRpcFn, q as McpSetting, r as ConnectionMetaWebsocket, rt as DevframeServicesScopeRegistry, s as DevframeNodeRpcSession, st as DevframeScopedStreamingHost, t as ConnectionMeta, tt as DevframeServicesHost, u as RpcSharedStateGetOptions, ut as DevframeSettingsStore, vt as DevframeRpcClientFunctions, wt as DevframeDiagnosticsLogger, xt as DevframeHost, yt as DevframeRpcServerFunctions, z as DevframeRpcOptions, zt as DevframeAgentHost } from "../context-
|
|
3
|
+
import { $ as DevframeServiceOf, At as AgentHandle, B as DevframeSetupInfo, Bt as DevframeAgentHostEvents, Ct as DevframeDiagnosticsHost, F as DevframeDefinition, Ft as AgentTool, G as McpAuthorization, H as DevframeSnapshotRpcInputs, Ht as EventUnsubscribe, I as DevframeDeploymentKind, It as AgentToolInput, J as DevframeServiceDefinition, K as McpRouteOptions, L as DevframeDockDefaults, Lt as AgentToolProvider, Mt as AgentResource, Nt as AgentResourceContent, P as DevframeCliOptions, Pt as AgentResourceInput, Q as DevframeServiceMeta, R as DevframeDuplicationStrategy, Rt as AgentToolProviderHandle, St as DevframeStorageScope, U as DevframeSseOptions, Ut as EventsMap, V as DevframeSnapshotRpcEntry, Vt as EventEmitter, W as DevframeWsOptions, X as DevframeServiceId, Y as DevframeServiceDescriptor, Z as DevframeServiceInput, _t as DevframeViewHost, a as DevframeConnectionConfigsRegistry, at as DevframeScopedNodeContext, bt as DevframeRpcSharedStates, c as RpcBroadcastOptions, ct as DevframeSettings, d as RpcSharedStateHost, dt as ScopedBroadcastOptions, et as DevframeServiceScopeOf, f as RpcStreamingChannel, ft as ScopedClientFunctions, gt as SettingsForNamespace, ht as ScopedSharedStates, i as DevframeCapabilities, it as DevframeServicesState, jt as AgentManifest, l as RpcFunctionsHost, lt as DevframeSettingsRegistry, m as RpcStreamingHost, mt as ScopedServerFunctions, n as ConnectionMetaSse, nt as DevframeServicesRegistry, o as DevframeNodeContext, ot as DevframeScopedNodeRpc, p as RpcStreamingChannelOptions, pt as ScopedRpcFn, q as McpSetting, r as ConnectionMetaWebsocket, rt as DevframeServicesScopeRegistry, s as DevframeNodeRpcSession, st as DevframeScopedStreamingHost, t as ConnectionMeta, tt as DevframeServicesHost, u as RpcSharedStateGetOptions, ut as DevframeSettingsStore, vt as DevframeRpcClientFunctions, wt as DevframeDiagnosticsLogger, xt as DevframeHost, yt as DevframeRpcServerFunctions, z as DevframeRpcOptions, zt as DevframeAgentHost } from "../context-B7411Bem.mjs";
|
|
4
4
|
import { a as RemoteAssetsStore, i as RemoteAssetsProviderCustom, n as RemoteAssetsErrorMessage, o as StaticAssetsSource, r as RemoteAssetsProvider, t as RemoteAssets } from "../remote-assets-eBvSKZMS.mjs";
|
|
5
5
|
import { i as DevframeDefineDiagnosticsOptions } from "../nostics-0sKe5HIj.mjs";
|
|
6
6
|
export { AgentHandle, AgentManifest, AgentResource, AgentResourceContent, AgentResourceInput, AgentTool, AgentToolInput, AgentToolProvider, AgentToolProviderHandle, ConnectionMeta, ConnectionMetaSse, ConnectionMetaWebsocket, DevframeAgentHost, DevframeAgentHostEvents, DevframeCapabilities, DevframeCliOptions, DevframeConnectionConfigsRegistry, type DevframeDefineDiagnosticsOptions, DevframeDefinition, DevframeDeploymentKind, DevframeDiagnosticsHost, DevframeDiagnosticsLogger, DevframeDockDefaults, DevframeDuplicationStrategy, DevframeHost, DevframeNodeContext, DevframeNodeRpcSession, type DevframeNodeRpcSessionMeta, DevframeRpcClientFunctions, type DevframeRpcConnection, type DevframeRpcConnectionRequest, DevframeRpcOptions, DevframeRpcServerFunctions, DevframeRpcSharedStates, type DevframeRpcTransportKind, DevframeScopedNodeContext, DevframeScopedNodeRpc, DevframeScopedStreamingHost, DevframeServiceDefinition, DevframeServiceDescriptor, DevframeServiceId, DevframeServiceInput, DevframeServiceMeta, DevframeServiceOf, DevframeServiceScopeOf, DevframeServicesHost, DevframeServicesRegistry, DevframeServicesScopeRegistry, DevframeServicesState, DevframeSettings, DevframeSettingsRegistry, DevframeSettingsStore, DevframeSetupInfo, DevframeSnapshotRpcEntry, DevframeSnapshotRpcInputs, DevframeSseOptions, DevframeStorageScope, DevframeViewHost, DevframeWsOptions, EventEmitter, EventUnsubscribe, EventsMap, McpAuthorization, McpRouteOptions, McpSetting, RemoteAssets, RemoteAssetsErrorMessage, RemoteAssetsProvider, RemoteAssetsProviderCustom, RemoteAssetsStore, RpcBroadcastOptions, type RpcFunctionAgentOptions, RpcFunctionsHost, RpcSharedStateGetOptions, RpcSharedStateHost, RpcStreamingChannel, RpcStreamingChannelOptions, RpcStreamingHost, ScopedBroadcastOptions, ScopedClientFunctions, ScopedRpcFn, ScopedServerFunctions, ScopedSharedStates, SettingsForNamespace, StaticAssetsSource };
|
|
@@ -19,6 +19,5 @@
|
|
|
19
19
|
* that display a tool's id (e.g. the inspect plugin's agent view) can
|
|
20
20
|
* import it too and show the name a client actually calls.
|
|
21
21
|
*/
|
|
22
|
-
declare function toAgentToolName(id: string): string;
|
|
23
|
-
//#endregion
|
|
24
|
-
export { toAgentToolName };
|
|
22
|
+
export declare function toAgentToolName(id: string): string;
|
|
23
|
+
//#endregion
|
package/dist/utils/colors.d.mts
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* A colorizer, callable as a function (`colors.red('foo')`) or as a
|
|
4
4
|
* tagged template (``colors.red`foo ${bar}` ``).
|
|
5
5
|
*/
|
|
6
|
-
interface ColorFn {
|
|
6
|
+
export interface ColorFn {
|
|
7
7
|
(text: unknown): string;
|
|
8
8
|
(template: TemplateStringsArray, ...values: unknown[]): string;
|
|
9
9
|
}
|
|
@@ -11,7 +11,7 @@ interface ColorFn {
|
|
|
11
11
|
* Minimal terminal color palette. Each entry is callable as both a
|
|
12
12
|
* plain function and a tagged template.
|
|
13
13
|
*/
|
|
14
|
-
interface Colors {
|
|
14
|
+
export interface Colors {
|
|
15
15
|
blue: ColorFn;
|
|
16
16
|
cyan: ColorFn;
|
|
17
17
|
gray: ColorFn;
|
|
@@ -23,6 +23,5 @@ interface Colors {
|
|
|
23
23
|
reset: ColorFn;
|
|
24
24
|
underline: ColorFn;
|
|
25
25
|
}
|
|
26
|
-
declare const colors: Colors;
|
|
27
|
-
//#endregion
|
|
28
|
-
export { ColorFn, Colors, colors };
|
|
26
|
+
export declare const colors: Colors;
|
|
27
|
+
//#endregion
|
|
@@ -4,13 +4,13 @@
|
|
|
4
4
|
* bearer credential, e.g. the persistent client auth token or an ephemeral
|
|
5
5
|
* remote-dock token. Defaults to 16 bytes (128 bits) of entropy.
|
|
6
6
|
*/
|
|
7
|
-
declare function randomToken(byteLength?: number): string;
|
|
7
|
+
export declare function randomToken(byteLength?: number): string;
|
|
8
8
|
/**
|
|
9
9
|
* Generate a uniformly-distributed string of decimal digits using rejection
|
|
10
10
|
* sampling to avoid modulo bias. Intended for short, human-typed one-time
|
|
11
11
|
* codes (e.g. a 6-digit authentication code). Leading zeros are preserved.
|
|
12
12
|
*/
|
|
13
|
-
declare function randomDigits(length: number): string;
|
|
13
|
+
export declare function randomDigits(length: number): string;
|
|
14
14
|
/**
|
|
15
15
|
* Constant-time string equality. Compares every character so the comparison
|
|
16
16
|
* time does not depend on the position of the first mismatch, mitigating
|
|
@@ -19,6 +19,5 @@ declare function randomDigits(length: number): string;
|
|
|
19
19
|
* Length is treated as public (it short-circuits on differing lengths), which
|
|
20
20
|
* is appropriate for fixed-length codes and tokens.
|
|
21
21
|
*/
|
|
22
|
-
declare function timingSafeEqual(a: string, b: string): boolean;
|
|
23
|
-
//#endregion
|
|
24
|
-
export { randomDigits, randomToken, timingSafeEqual };
|
|
22
|
+
export declare function timingSafeEqual(a: string, b: string): boolean;
|
|
23
|
+
//#endregion
|
package/dist/utils/events.d.mts
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { Ut as EventsMap, Vt as EventEmitter } from "../context-
|
|
1
|
+
import { Ut as EventsMap, Vt as EventEmitter } from "../context-B7411Bem.mjs";
|
|
2
2
|
//#region src/utils/events.d.ts
|
|
3
3
|
/**
|
|
4
4
|
* Create event emitter.
|
|
5
5
|
*/
|
|
6
|
-
declare function createEventEmitter<Events extends EventsMap>(): EventEmitter<Events>;
|
|
7
|
-
//#endregion
|
|
8
|
-
export { createEventEmitter };
|
|
6
|
+
export declare function createEventEmitter<Events extends EventsMap>(): EventEmitter<Events>;
|
|
7
|
+
//#endregion
|
package/dist/utils/hash.d.mts
CHANGED
|
@@ -8,6 +8,5 @@
|
|
|
8
8
|
* `'subl'`) or absolute binary path. Otherwise the editor is auto-detected
|
|
9
9
|
* via the `LAUNCH_EDITOR` env var with a fallback to common defaults.
|
|
10
10
|
*/
|
|
11
|
-
declare function launchEditor(target: string, editor?: string): void;
|
|
12
|
-
//#endregion
|
|
13
|
-
export { launchEditor };
|
|
11
|
+
export declare function launchEditor(target: string, editor?: string): void;
|
|
12
|
+
//#endregion
|
package/dist/utils/nanoid.d.mts
CHANGED
package/dist/utils/open.d.mts
CHANGED
|
@@ -3,6 +3,5 @@
|
|
|
3
3
|
* Open a URL, file, or other target in its default OS handler
|
|
4
4
|
* (browser for URLs, Finder/Explorer for paths, etc.).
|
|
5
5
|
*/
|
|
6
|
-
declare function open(target: string): Promise<void>;
|
|
7
|
-
//#endregion
|
|
8
|
-
export { open };
|
|
6
|
+
export declare function open(target: string): Promise<void>;
|
|
7
|
+
//#endregion
|
|
@@ -16,6 +16,5 @@ import { a as RemoteAssetsStore, o as StaticAssetsSource } from "../remote-asset
|
|
|
16
16
|
* per-source string still wins and an explicit `null` still opts out of the
|
|
17
17
|
* installed-copy lookup.
|
|
18
18
|
*/
|
|
19
|
-
declare function resolveStaticAssetsSource(source: StaticAssetsSource, projectStorageDir: string, defaultResolveFrom?: string | null): string | RemoteAssetsStore;
|
|
20
|
-
//#endregion
|
|
21
|
-
export { resolveStaticAssetsSource };
|
|
19
|
+
export declare function resolveStaticAssetsSource(source: StaticAssetsSource, projectStorageDir: string, defaultResolveFrom?: string | null): string | RemoteAssetsStore;
|
|
20
|
+
//#endregion
|
|
@@ -6,8 +6,8 @@ import { EventHandler, H3 } from "h3";
|
|
|
6
6
|
* What the static-serving engine accepts: a local directory, or a resolved
|
|
7
7
|
* {@link RemoteAssetsStore} back-proxy (from `devframe/utils/remote-assets`).
|
|
8
8
|
*/
|
|
9
|
-
type ServableAssets = string | RemoteAssetsStore;
|
|
10
|
-
interface ServeStaticOptions {
|
|
9
|
+
export type ServableAssets = string | RemoteAssetsStore;
|
|
10
|
+
export interface ServeStaticOptions {
|
|
11
11
|
/** Default: `['index.html']`. */
|
|
12
12
|
indexNames?: string[];
|
|
13
13
|
/** SPA fallback to `indexNames[0]` on miss. Default: `true`. */
|
|
@@ -24,7 +24,7 @@ interface ServeStaticOptions {
|
|
|
24
24
|
* file extension falls back to `<dir>/index.html` so client-side routing
|
|
25
25
|
* works.
|
|
26
26
|
*/
|
|
27
|
-
declare function serveStaticHandler(source: ServableAssets, options?: ServeStaticOptions): EventHandler;
|
|
27
|
+
export declare function serveStaticHandler(source: ServableAssets, options?: ServeStaticOptions): EventHandler;
|
|
28
28
|
/**
|
|
29
29
|
* Mount {@link serveStaticHandler} on an h3 app at `base`.
|
|
30
30
|
*
|
|
@@ -32,7 +32,7 @@ declare function serveStaticHandler(source: ServableAssets, options?: ServeStati
|
|
|
32
32
|
* from `event.url.pathname`, so the file resolver sees paths relative to
|
|
33
33
|
* `dir`.
|
|
34
34
|
*/
|
|
35
|
-
declare function mountStaticHandler(app: H3, base: string, source: ServableAssets, options?: ServeStaticOptions): void;
|
|
35
|
+
export declare function mountStaticHandler(app: H3, base: string, source: ServableAssets, options?: ServeStaticOptions): void;
|
|
36
36
|
/**
|
|
37
37
|
* Connect/Express-style Node middleware variant of {@link serveStaticHandler}.
|
|
38
38
|
*
|
|
@@ -40,6 +40,5 @@ declare function mountStaticHandler(app: H3, base: string, source: ServableAsset
|
|
|
40
40
|
* Connect stack; avoids forcing the host package to depend on h3 just to
|
|
41
41
|
* adapt an event handler back into Node middleware.
|
|
42
42
|
*/
|
|
43
|
-
declare function serveStaticNodeMiddleware(source: ServableAssets, options?: ServeStaticOptions): (req: IncomingMessage, res: ServerResponse, next?: (err?: Error) => void) => void;
|
|
44
|
-
//#endregion
|
|
45
|
-
export { ServableAssets, ServeStaticOptions, mountStaticHandler, serveStaticHandler, serveStaticNodeMiddleware };
|
|
43
|
+
export declare function serveStaticNodeMiddleware(source: ServableAssets, options?: ServeStaticOptions): (req: IncomingMessage, res: ServerResponse, next?: (err?: Error) => void) => void;
|
|
44
|
+
//#endregion
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { A as SharedStateEvents, D as ImmutableObject, E as ImmutableMap, M as SharedStatePatch, N as createSharedState, O as ImmutableSet, T as ImmutableArray, j as SharedStateOptions, k as SharedState, w as Immutable } from "../context-
|
|
1
|
+
import { A as SharedStateEvents, D as ImmutableObject, E as ImmutableMap, M as SharedStatePatch, N as createSharedState, O as ImmutableSet, T as ImmutableArray, j as SharedStateOptions, k as SharedState, w as Immutable } from "../context-B7411Bem.mjs";
|
|
2
2
|
export { Immutable, ImmutableArray, ImmutableMap, ImmutableObject, ImmutableSet, SharedState, SharedStateEvents, SharedStateOptions, SharedStatePatch, createSharedState };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as createSharedState } from "../shared-state-
|
|
1
|
+
import { t as createSharedState } from "../shared-state-eQVYHNqA.mjs";
|
|
2
2
|
export { createSharedState };
|
|
@@ -32,7 +32,7 @@ import { StandardSchemaV1 } from "@standard-schema/spec";
|
|
|
32
32
|
* standard `~standard` prop so the CLI-flags adapter can introspect the
|
|
33
33
|
* schema kind without importing any validator.
|
|
34
34
|
*/
|
|
35
|
-
interface SimpleSchema<Input, Output = Input> extends StandardSchemaV1<Input, Output> {
|
|
35
|
+
export interface SimpleSchema<Input, Output = Input> extends StandardSchemaV1<Input, Output> {
|
|
36
36
|
/** Schema kind marker, e.g. `'string'`, `'boolean'`, `'optional'`. */
|
|
37
37
|
readonly type: string;
|
|
38
38
|
/** Inner schema for wrapper kinds (`optional` / `nullable`). */
|
|
@@ -41,25 +41,25 @@ interface SimpleSchema<Input, Output = Input> extends StandardSchemaV1<Input, Ou
|
|
|
41
41
|
readonly description?: string;
|
|
42
42
|
}
|
|
43
43
|
/** Any string. */
|
|
44
|
-
declare function string(): SimpleSchema<string>;
|
|
44
|
+
export declare function string(): SimpleSchema<string>;
|
|
45
45
|
/** A finite number (rejects `NaN`). */
|
|
46
|
-
declare function number(): SimpleSchema<number>;
|
|
46
|
+
export declare function number(): SimpleSchema<number>;
|
|
47
47
|
/** A boolean. */
|
|
48
|
-
declare function boolean(): SimpleSchema<boolean>;
|
|
48
|
+
export declare function boolean(): SimpleSchema<boolean>;
|
|
49
49
|
/** `undefined`, mirroring valibot's `void`. */
|
|
50
|
-
declare function voidType(): SimpleSchema<void>;
|
|
50
|
+
export declare function voidType(): SimpleSchema<void>;
|
|
51
51
|
/** `null`. */
|
|
52
|
-
declare function nullType(): SimpleSchema<null>;
|
|
52
|
+
export declare function nullType(): SimpleSchema<null>;
|
|
53
53
|
/** One of a fixed set of literal values. */
|
|
54
|
-
declare function picklist<const T extends readonly (string | number | boolean)[]>(values: T): SimpleSchema<T[number]>;
|
|
54
|
+
export declare function picklist<const T extends readonly (string | number | boolean)[]>(values: T): SimpleSchema<T[number]>;
|
|
55
55
|
/** A single literal value (string / number / boolean). */
|
|
56
|
-
declare function literal<const T extends string | number | boolean>(value: T): SimpleSchema<T>;
|
|
56
|
+
export declare function literal<const T extends string | number | boolean>(value: T): SimpleSchema<T>;
|
|
57
57
|
/** A value matching any one of the given schemas. */
|
|
58
|
-
declare function union<const T extends readonly StandardSchemaV1[]>(options: T): SimpleSchema<StandardSchemaV1.InferInput<T[number]>, StandardSchemaV1.InferOutput<T[number]>>;
|
|
58
|
+
export declare function union<const T extends readonly StandardSchemaV1[]>(options: T): SimpleSchema<StandardSchemaV1.InferInput<T[number]>, StandardSchemaV1.InferOutput<T[number]>>;
|
|
59
59
|
/** A record with string keys whose values each satisfy the value schema. */
|
|
60
|
-
declare function record<V extends StandardSchemaV1>(_key: StandardSchemaV1, value: V): SimpleSchema<Record<string, StandardSchemaV1.InferInput<V>>, Record<string, StandardSchemaV1.InferOutput<V>>>;
|
|
60
|
+
export declare function record<V extends StandardSchemaV1>(_key: StandardSchemaV1, value: V): SimpleSchema<Record<string, StandardSchemaV1.InferInput<V>>, Record<string, StandardSchemaV1.InferOutput<V>>>;
|
|
61
61
|
/** An array whose every element satisfies the item schema. */
|
|
62
|
-
declare function array<T extends StandardSchemaV1>(item: T): SimpleSchema<StandardSchemaV1.InferInput<T>[], StandardSchemaV1.InferOutput<T>[]>;
|
|
62
|
+
export declare function array<T extends StandardSchemaV1>(item: T): SimpleSchema<StandardSchemaV1.InferInput<T>[], StandardSchemaV1.InferOutput<T>[]>;
|
|
63
63
|
/** Flatten an intersection into a single object literal for readable types. */
|
|
64
64
|
type Prettify<T> = { [K in keyof T]: T[K]; } & {};
|
|
65
65
|
/**
|
|
@@ -70,19 +70,19 @@ type Prettify<T> = { [K in keyof T]: T[K]; } & {};
|
|
|
70
70
|
type InferField<T extends StandardSchemaV1, Mode extends 'input' | 'output'> = Mode extends 'input' ? StandardSchemaV1.InferInput<T> : StandardSchemaV1.InferOutput<T>;
|
|
71
71
|
type InferObject<T extends Record<string, StandardSchemaV1>, Mode extends 'input' | 'output'> = Prettify<{ [K in keyof T as undefined extends InferField<T[K], Mode> ? never : K]: InferField<T[K], Mode>; } & { [K in keyof T as undefined extends InferField<T[K], Mode> ? K : never]?: InferField<T[K], Mode>; }>;
|
|
72
72
|
/** An object whose known keys each satisfy their schema (extra keys are kept). */
|
|
73
|
-
declare function object<T extends Record<string, StandardSchemaV1>>(shape: T): SimpleSchema<InferObject<T, 'input'>, InferObject<T, 'output'>>;
|
|
73
|
+
export declare function object<T extends Record<string, StandardSchemaV1>>(shape: T): SimpleSchema<InferObject<T, 'input'>, InferObject<T, 'output'>>;
|
|
74
74
|
/** Allow `undefined` in addition to the inner schema. */
|
|
75
|
-
declare function optional<T extends StandardSchemaV1>(inner: T): SimpleSchema<StandardSchemaV1.InferInput<T> | undefined, StandardSchemaV1.InferOutput<T> | undefined>;
|
|
75
|
+
export declare function optional<T extends StandardSchemaV1>(inner: T): SimpleSchema<StandardSchemaV1.InferInput<T> | undefined, StandardSchemaV1.InferOutput<T> | undefined>;
|
|
76
76
|
/** Allow `null` in addition to the inner schema. */
|
|
77
|
-
declare function nullable<T extends StandardSchemaV1>(inner: T): SimpleSchema<StandardSchemaV1.InferInput<T> | null, StandardSchemaV1.InferOutput<T> | null>;
|
|
77
|
+
export declare function nullable<T extends StandardSchemaV1>(inner: T): SimpleSchema<StandardSchemaV1.InferInput<T> | null, StandardSchemaV1.InferOutput<T> | null>;
|
|
78
78
|
/** Attach a human-readable description (used for CLI option help). */
|
|
79
|
-
declare function describe<T extends SimpleSchema<any, any>>(schema: T, description: string): T;
|
|
79
|
+
export declare function describe<T extends SimpleSchema<any, any>>(schema: T, description: string): T;
|
|
80
80
|
/**
|
|
81
81
|
* Grouped access to every builder: `s.string()`, `s.object({ ... })`,
|
|
82
82
|
* `s.void()`, etc. Handy for a valibot-like `import { s } from
|
|
83
83
|
* 'devframe/utils/simple-schema'` call site.
|
|
84
84
|
*/
|
|
85
|
-
declare const s: {
|
|
85
|
+
export declare const s: {
|
|
86
86
|
readonly string: typeof string;
|
|
87
87
|
readonly number: typeof number;
|
|
88
88
|
readonly boolean: typeof boolean;
|
|
@@ -98,5 +98,4 @@ declare const s: {
|
|
|
98
98
|
readonly nullable: typeof nullable;
|
|
99
99
|
readonly describe: typeof describe;
|
|
100
100
|
};
|
|
101
|
-
//#endregion
|
|
102
|
-
export { SimpleSchema, array, boolean, describe, literal, nullType, nullable, number, object, optional, picklist, record, s, string, union, voidType };
|
|
101
|
+
//#endregion
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { C as createStreamSink, S as createStreamReader, _ as CreateStreamSinkOptions, b as StreamSink, g as CreateStreamReaderOptions, h as BufferedChunk, v as StreamErrorPayload, x as StreamSinkEvents, y as StreamReader } from "../context-
|
|
1
|
+
import { C as createStreamSink, S as createStreamReader, _ as CreateStreamSinkOptions, b as StreamSink, g as CreateStreamReaderOptions, h as BufferedChunk, v as StreamErrorPayload, x as StreamSinkEvents, y as StreamReader } from "../context-B7411Bem.mjs";
|
|
2
2
|
export { BufferedChunk, CreateStreamReaderOptions, CreateStreamSinkOptions, StreamErrorPayload, StreamReader, StreamSink, StreamSinkEvents, createStreamReader, createStreamSink };
|
|
@@ -26,7 +26,10 @@ function createStreamSink(options = {}) {
|
|
|
26
26
|
seq: lastSeq,
|
|
27
27
|
chunk
|
|
28
28
|
});
|
|
29
|
-
if (buffer.length > replayWindow)
|
|
29
|
+
if (buffer.length > replayWindow) {
|
|
30
|
+
if (buffer.length - replayWindow === 1) buffer.shift();
|
|
31
|
+
else buffer.splice(0, buffer.length - replayWindow);
|
|
32
|
+
}
|
|
30
33
|
}
|
|
31
34
|
events.emit("chunk", lastSeq, chunk);
|
|
32
35
|
}
|
|
@@ -3,19 +3,18 @@
|
|
|
3
3
|
* Serialize a structured-cloneable value (`Map`, `Set`, `Date`, `BigInt`,
|
|
4
4
|
* cycles, class instances, …) into a JSON-safe records array.
|
|
5
5
|
*/
|
|
6
|
-
declare function structuredCloneSerialize(value: unknown): unknown[];
|
|
6
|
+
export declare function structuredCloneSerialize(value: unknown): unknown[];
|
|
7
7
|
/**
|
|
8
8
|
* Inverse of {@link structuredCloneSerialize}.
|
|
9
9
|
*/
|
|
10
|
-
declare function structuredCloneDeserialize<T = unknown>(value: unknown[]): T;
|
|
10
|
+
export declare function structuredCloneDeserialize<T = unknown>(value: unknown[]): T;
|
|
11
11
|
/**
|
|
12
12
|
* Serialize a structured-cloneable value to a single string. Equivalent
|
|
13
13
|
* to `JSON.stringify(structuredCloneSerialize(value))`.
|
|
14
14
|
*/
|
|
15
|
-
declare function structuredCloneStringify(value: unknown): string;
|
|
15
|
+
export declare function structuredCloneStringify(value: unknown): string;
|
|
16
16
|
/**
|
|
17
17
|
* Inverse of {@link structuredCloneStringify}.
|
|
18
18
|
*/
|
|
19
|
-
declare function structuredCloneParse<T = unknown>(value: string): T;
|
|
20
|
-
//#endregion
|
|
21
|
-
export { structuredCloneDeserialize, structuredCloneParse, structuredCloneSerialize, structuredCloneStringify };
|
|
19
|
+
export declare function structuredCloneParse<T = unknown>(value: string): T;
|
|
20
|
+
//#endregion
|
package/dist/utils/when.d.mts
CHANGED
|
@@ -16,7 +16,7 @@ import { WhenExpression as WhenExpression$1 } from "whenexpr";
|
|
|
16
16
|
* `&&`, `||`, `+`, `-`, `*`, `/`, `%`. Parentheses, number and string literals
|
|
17
17
|
* are also supported.
|
|
18
18
|
*/
|
|
19
|
-
interface WhenContext {
|
|
19
|
+
export interface WhenContext {
|
|
20
20
|
clientType: 'embedded' | 'standalone';
|
|
21
21
|
dockOpen: boolean;
|
|
22
22
|
paletteOpen: boolean;
|
|
@@ -29,9 +29,9 @@ interface WhenContext {
|
|
|
29
29
|
* helpers to surface unknown context keys and syntax errors as TypeScript
|
|
30
30
|
* errors at the call site.
|
|
31
31
|
*/
|
|
32
|
-
type WhenExpression<T, S extends string> = WhenExpression$1<T, S>;
|
|
32
|
+
export type WhenExpression<T, S extends string> = WhenExpression$1<T, S>;
|
|
33
33
|
/** Options for `evaluateWhen`. */
|
|
34
|
-
interface EvaluateWhenOptions {
|
|
34
|
+
export interface EvaluateWhenOptions {
|
|
35
35
|
/**
|
|
36
36
|
* Throw when the expression references a context key that does not exist.
|
|
37
37
|
*
|
|
@@ -45,11 +45,10 @@ interface EvaluateWhenOptions {
|
|
|
45
45
|
* @example
|
|
46
46
|
* evaluateWhen('dockOpen && clientType == embedded', ctx)
|
|
47
47
|
*/
|
|
48
|
-
declare function evaluateWhen<T extends object, const E extends string>(expression: E & WhenExpression$1<T, E>, context: T, options?: EvaluateWhenOptions): boolean;
|
|
48
|
+
export declare function evaluateWhen<T extends object, const E extends string>(expression: E & WhenExpression$1<T, E>, context: T, options?: EvaluateWhenOptions): boolean;
|
|
49
49
|
/**
|
|
50
50
|
* Resolve a context value by key. Supports namespaced keys with `.` or `:`
|
|
51
51
|
* separators. Returns `undefined` for unknown keys.
|
|
52
52
|
*/
|
|
53
|
-
declare function resolveContextValue<T extends Record<string, unknown>>(key: string, context: T): unknown;
|
|
54
|
-
//#endregion
|
|
55
|
-
export { EvaluateWhenOptions, WhenContext, WhenExpression, evaluateWhen, resolveContextValue };
|
|
53
|
+
export declare function resolveContextValue<T extends Record<string, unknown>>(key: string, context: T): unknown;
|
|
54
|
+
//#endregion
|
|
@@ -62,7 +62,7 @@ var Queue = class {
|
|
|
62
62
|
}
|
|
63
63
|
};
|
|
64
64
|
//#endregion
|
|
65
|
-
//#region ../../node_modules/.pnpm/p-limit@7.3.
|
|
65
|
+
//#region ../../node_modules/.pnpm/p-limit@7.3.2/node_modules/p-limit/index.js
|
|
66
66
|
function pLimit(concurrency) {
|
|
67
67
|
let rejectOnClear = false;
|
|
68
68
|
if (typeof concurrency === "object") ({concurrency, rejectOnClear = false} = concurrency);
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "devframe",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.9.
|
|
4
|
+
"version": "0.9.14",
|
|
5
5
|
"description": "Framework for building one portable devtool integration that runs in any viewer.",
|
|
6
6
|
"author": "Anthony Fu <anthonyfu117@hotmail.com>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -92,7 +92,7 @@
|
|
|
92
92
|
"@standard-schema/spec": "^1.1.0",
|
|
93
93
|
"birpc": "^4.2.0",
|
|
94
94
|
"crossws": "^0.4.12",
|
|
95
|
-
"h3": "^2.0.1-rc.
|
|
95
|
+
"h3": "^2.0.1-rc.31",
|
|
96
96
|
"mrmime": "^2.0.1",
|
|
97
97
|
"nostics": "^1.2.0",
|
|
98
98
|
"pathe": "^2.0.3",
|
|
@@ -107,11 +107,11 @@
|
|
|
107
107
|
"mlly": "^1.8.2",
|
|
108
108
|
"obug": "^2.1.4",
|
|
109
109
|
"ohash": "^2.0.12",
|
|
110
|
-
"p-limit": "^7.3.
|
|
110
|
+
"p-limit": "^7.3.2",
|
|
111
111
|
"perfect-debounce": "^2.1.0",
|
|
112
112
|
"structured-clone-es": "^2.0.1",
|
|
113
113
|
"tinyglobby": "^0.2.17",
|
|
114
|
-
"tsdown": "^0.
|
|
114
|
+
"tsdown": "^0.23.0",
|
|
115
115
|
"ua-parser-modern": "^0.1.1",
|
|
116
116
|
"valibot": "^1.4.2",
|
|
117
117
|
"whenexpr": "^0.1.2",
|