devframe 0.4.0 → 0.5.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 +1 -1
- package/dist/adapters/build.d.mts +2 -2
- package/dist/adapters/build.mjs +9 -9
- package/dist/adapters/cli.d.mts +2 -2
- package/dist/adapters/cli.mjs +1 -1
- package/dist/adapters/dev.d.mts +2 -2
- package/dist/adapters/dev.mjs +1 -1
- package/dist/adapters/embedded.d.mts +2 -2
- package/dist/adapters/mcp.d.mts +1 -3
- package/dist/adapters/mcp.mjs +3 -3
- package/dist/client/index.d.mts +28 -42
- package/dist/client/index.mjs +27 -23
- package/dist/constants.d.mts +10 -10
- package/dist/constants.mjs +10 -10
- package/dist/{context-Ca70YtrW.d.mts → context-DTRcO_UH.d.mts} +6 -6
- package/dist/{storage-CZVTPKsw.mjs → context-DaKmhhHY.mjs} +48 -3
- package/dist/{dev-C2wjXjGB.mjs → dev-Cv43GfqM.mjs} +5 -5
- package/dist/{devframe-xC8Q-xyt.d.mts → devframe-BuR6n9ZD.d.mts} +95 -46
- package/dist/{dump-B1wd4u68.mjs → dump-9lKIJTLh.mjs} +15 -11
- package/dist/helpers/vite.d.mts +1 -1
- package/dist/helpers/vite.mjs +4 -4
- package/dist/{host-h3-Div5Vp8R.mjs → host-h3-Dgpgr1Ul.mjs} +16 -16
- package/dist/{index-CTK6fuXs.d.mts → index-C7M1hnvL.d.mts} +2 -2
- package/dist/{index-C5PmWqBf.d.mts → index-DH2sBIwd.d.mts} +1 -1
- package/dist/index.d.mts +5 -5
- package/dist/node/auth.d.mts +5 -5
- package/dist/node/auth.mjs +1 -1
- package/dist/node/{internal.d.mts → hub-internals.d.mts} +3 -3
- package/dist/node/hub-internals.mjs +3 -0
- package/dist/node/index.d.mts +34 -34
- package/dist/node/index.mjs +4 -4
- package/dist/recipes/open-helpers.d.mts +5 -5
- package/dist/{human-id-Dq-qgtES.mjs → revoke-CL0LSAN9.mjs} +35 -35
- package/dist/rpc/dump.d.mts +1 -1
- package/dist/rpc/dump.mjs +1 -1
- package/dist/rpc/index.d.mts +2 -2
- package/dist/rpc/index.mjs +1 -1
- package/dist/rpc/transports/ws-client.d.mts +1 -25
- package/dist/rpc/transports/ws-client.mjs +1 -1
- package/dist/rpc/transports/ws-server.d.mts +2 -2
- package/dist/{server-BO8IDVsJ.mjs → server-BBaBJaUL.mjs} +12 -5
- package/dist/{server-FNcskEBD.d.mts → server-wHlpcdZ9.d.mts} +3 -3
- package/dist/{shared-state-CasqoUba.mjs → shared-state-BlBNYziY.mjs} +1 -1
- package/dist/types/index.d.mts +4 -4
- package/dist/{types-BXL7EIDM.d.mts → types-BkkQ0Txg.d.mts} +5 -5
- package/dist/utils/events.d.mts +1 -1
- package/dist/utils/shared-state.d.mts +1 -1
- package/dist/utils/streaming-channel.d.mts +1 -1
- package/dist/ws-client-CVYX9niP.d.mts +26 -0
- package/dist/{ws-server-DOwLJL23.d.mts → ws-server-C1LjmRnp.d.mts} +6 -6
- package/package.json +6 -5
- package/skills/devframe/SKILL.md +82 -5
- package/dist/index-DTeZXHSi.d.mts +0 -639
- package/dist/node/internal.mjs +0 -49
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { S as RpcFunctionsCollectorBase } from "./index-
|
|
2
|
-
import { t as
|
|
3
|
-
import { Diagnostic, DiagnosticDefinition, defineDiagnostics } from "nostics";
|
|
4
|
-
import { BirpcReturn } from "birpc";
|
|
1
|
+
import { S as RpcFunctionsCollectorBase } from "./index-C7M1hnvL.mjs";
|
|
2
|
+
import { t as DevframeNodeRpcSessionMeta } from "./ws-server-C1LjmRnp.mjs";
|
|
5
3
|
import { CAC } from "cac";
|
|
6
4
|
import { GenericSchema, InferOutput } from "valibot";
|
|
5
|
+
import { BirpcReturn } from "birpc";
|
|
6
|
+
import { Diagnostic, DiagnosticDefinition, defineDiagnostics } from "nostics";
|
|
7
7
|
|
|
8
8
|
//#region src/adapters/flags.d.ts
|
|
9
9
|
/**
|
|
@@ -148,7 +148,7 @@ interface AgentTool {
|
|
|
148
148
|
}[];
|
|
149
149
|
}
|
|
150
150
|
/**
|
|
151
|
-
* Input accepted by `
|
|
151
|
+
* Input accepted by `DevframeAgentHost.registerTool()`. Handler is
|
|
152
152
|
* stripped from the serializable `AgentTool` projection.
|
|
153
153
|
*
|
|
154
154
|
* @experimental
|
|
@@ -170,7 +170,7 @@ interface AgentToolInput {
|
|
|
170
170
|
}
|
|
171
171
|
/**
|
|
172
172
|
* Serializable description of an agent-readable resource. Resources
|
|
173
|
-
* surface structured or textual snapshots of
|
|
173
|
+
* surface structured or textual snapshots of devframe state.
|
|
174
174
|
*
|
|
175
175
|
* @experimental
|
|
176
176
|
*/
|
|
@@ -184,7 +184,7 @@ interface AgentResource {
|
|
|
184
184
|
mimeType?: string;
|
|
185
185
|
}
|
|
186
186
|
/**
|
|
187
|
-
* Input accepted by `
|
|
187
|
+
* Input accepted by `DevframeAgentHost.registerResource()`.
|
|
188
188
|
*
|
|
189
189
|
* @experimental
|
|
190
190
|
*/
|
|
@@ -227,11 +227,11 @@ interface AgentHandle {
|
|
|
227
227
|
unregister: () => void;
|
|
228
228
|
}
|
|
229
229
|
/**
|
|
230
|
-
* Events emitted by `
|
|
230
|
+
* Events emitted by `DevframeAgentHost`.
|
|
231
231
|
*
|
|
232
232
|
* @experimental
|
|
233
233
|
*/
|
|
234
|
-
interface
|
|
234
|
+
interface DevframeAgentHostEvents {
|
|
235
235
|
'agent:tool:registered': (tool: AgentTool) => void;
|
|
236
236
|
'agent:tool:unregistered': (id: string) => void;
|
|
237
237
|
'agent:resource:registered': (resource: AgentResource) => void;
|
|
@@ -251,8 +251,8 @@ interface DevToolsAgentHostEvents {
|
|
|
251
251
|
* @experimental The agent-native surface is experimental and may change
|
|
252
252
|
* without a major version bump until it stabilizes.
|
|
253
253
|
*/
|
|
254
|
-
interface
|
|
255
|
-
readonly events: EventEmitter<
|
|
254
|
+
interface DevframeAgentHost {
|
|
255
|
+
readonly events: EventEmitter<DevframeAgentHostEvents>;
|
|
256
256
|
/**
|
|
257
257
|
* Register a tool not backed by an RPC function. Use this when you
|
|
258
258
|
* want a plain agent action (e.g. a synthesized summary) that
|
|
@@ -292,7 +292,7 @@ interface DevToolsAgentHost {
|
|
|
292
292
|
* types don't allow assigning a narrow-keyed result to a generically-keyed
|
|
293
293
|
* one. The host stores them in a heterogeneous registry.
|
|
294
294
|
*/
|
|
295
|
-
type
|
|
295
|
+
type DevframeDiagnosticsDefinition = ReturnType<typeof defineDiagnostics<any, any>>;
|
|
296
296
|
/**
|
|
297
297
|
* The shared diagnostics lookup exposed by the host. A `Proxy` that resolves
|
|
298
298
|
* any registered code name to its `nostics` handle (a callable that builds
|
|
@@ -300,13 +300,13 @@ type DevToolsDiagnosticsDefinition = ReturnType<typeof defineDiagnostics<any, an
|
|
|
300
300
|
* because it spans heterogeneous definitions registered by different
|
|
301
301
|
* integrations.
|
|
302
302
|
*/
|
|
303
|
-
type
|
|
303
|
+
type DevframeDiagnosticsLogger = Record<string, any>;
|
|
304
304
|
/**
|
|
305
305
|
* Options accepted by the host's `defineDiagnostics()` factory — mirrors
|
|
306
306
|
* `nostics`'s shape but the host pre-wires its ANSI console reporter, so
|
|
307
307
|
* plugins typically omit `reporters`.
|
|
308
308
|
*/
|
|
309
|
-
interface
|
|
309
|
+
interface DevframeDefineDiagnosticsOptions<Codes extends Record<string, DiagnosticDefinition>> {
|
|
310
310
|
docsBase?: string | ((code: keyof Codes) => string | undefined);
|
|
311
311
|
codes: Codes;
|
|
312
312
|
reporters?: ReadonlyArray<(d: Diagnostic, o?: any) => void>;
|
|
@@ -334,7 +334,7 @@ interface DevToolsDefineDiagnosticsOptions<Codes extends Record<string, Diagnost
|
|
|
334
334
|
* throw myDiagnostics.MYP0001()
|
|
335
335
|
* ```
|
|
336
336
|
*/
|
|
337
|
-
interface
|
|
337
|
+
interface DevframeDiagnosticsHost {
|
|
338
338
|
/**
|
|
339
339
|
* Proxy-backed lookup of every registered diagnostic handle by code name.
|
|
340
340
|
* Resolves to a `nostics` `DiagnosticHandle` — a callable that builds a
|
|
@@ -342,7 +342,7 @@ interface DevToolsDiagnosticsHost {
|
|
|
342
342
|
* `throw` to raise. Loosely typed — for autocompletion, keep a reference
|
|
343
343
|
* to the typed result of `defineDiagnostics()` instead.
|
|
344
344
|
*/
|
|
345
|
-
readonly logger:
|
|
345
|
+
readonly logger: DevframeDiagnosticsLogger;
|
|
346
346
|
/**
|
|
347
347
|
* Register additional diagnostic definitions with this host. After
|
|
348
348
|
* registration, codes from the new definition are reachable via
|
|
@@ -356,14 +356,14 @@ interface DevToolsDiagnosticsHost {
|
|
|
356
356
|
* pre-wired. Mirrors `nostics`'s `defineDiagnostics` so integrations don't
|
|
357
357
|
* need to take a direct dependency on `nostics`.
|
|
358
358
|
*/
|
|
359
|
-
defineDiagnostics: <const Codes extends Record<string, DiagnosticDefinition>>(options:
|
|
359
|
+
defineDiagnostics: <const Codes extends Record<string, DiagnosticDefinition>>(options: DevframeDefineDiagnosticsOptions<Codes>) => ReturnType<typeof defineDiagnostics<Codes, any>>;
|
|
360
360
|
}
|
|
361
361
|
//#endregion
|
|
362
362
|
//#region src/types/host.d.ts
|
|
363
|
-
interface
|
|
363
|
+
interface DevframeHost {
|
|
364
364
|
/**
|
|
365
365
|
* Serve a static directory at the given URL base. Called by
|
|
366
|
-
* `
|
|
366
|
+
* `DevframeViewHost.hostStatic`. Implementations map this to whatever
|
|
367
367
|
* the underlying runtime expects (Vite middleware, h3 handler, no-op
|
|
368
368
|
* for build snapshots).
|
|
369
369
|
*/
|
|
@@ -377,16 +377,16 @@ interface DevToolsHost {
|
|
|
377
377
|
*/
|
|
378
378
|
resolveOrigin: () => string;
|
|
379
379
|
/**
|
|
380
|
-
* Resolve a directory the host owns for persisted
|
|
380
|
+
* Resolve a directory the host owns for persisted devframe state.
|
|
381
381
|
* Each host picks its own app-name namespace so storage doesn't
|
|
382
|
-
* collide between, say, the Vite host (`.vite/
|
|
383
|
-
* standalone CLI host (`.<appName>/
|
|
382
|
+
* collide between, say, the Vite host (`.vite/devframe`) and a
|
|
383
|
+
* standalone CLI host (`.<appName>/devframe`).
|
|
384
384
|
*
|
|
385
385
|
* - `workspace` — per-project state (settings, caches). Typically
|
|
386
|
-
* under `${workspaceRoot}/node_modules/.<appName>/
|
|
386
|
+
* under `${workspaceRoot}/node_modules/.<appName>/devframe/`.
|
|
387
387
|
* - `global` — per-user state (auth tokens, machine-wide
|
|
388
388
|
* preferences). Typically under
|
|
389
|
-
* `${homedir()}/.<appName>/
|
|
389
|
+
* `${homedir()}/.<appName>/devframe/`.
|
|
390
390
|
*
|
|
391
391
|
* Implementations should ensure the directory exists or be safe to
|
|
392
392
|
* pass to a downstream `createStorage(...)` call that creates it
|
|
@@ -399,7 +399,7 @@ interface DevToolsHost {
|
|
|
399
399
|
/**
|
|
400
400
|
* To be extended
|
|
401
401
|
*/
|
|
402
|
-
interface
|
|
402
|
+
interface DevframeRpcClientFunctions {
|
|
403
403
|
/**
|
|
404
404
|
* Streaming chunk pushed from server to subscribed clients. Wired by
|
|
405
405
|
* `RpcStreamingHost`; do not register manually.
|
|
@@ -428,7 +428,7 @@ interface DevToolsRpcClientFunctions {
|
|
|
428
428
|
/**
|
|
429
429
|
* To be extended
|
|
430
430
|
*/
|
|
431
|
-
interface
|
|
431
|
+
interface DevframeRpcServerFunctions {
|
|
432
432
|
/**
|
|
433
433
|
* Subscribe a client to a shared-state key. Wired by
|
|
434
434
|
* `RpcSharedStateHost`; do not register manually.
|
|
@@ -501,7 +501,7 @@ interface DevToolsRpcServerFunctions {
|
|
|
501
501
|
/**
|
|
502
502
|
* To be extended
|
|
503
503
|
*/
|
|
504
|
-
interface
|
|
504
|
+
interface DevframeRpcSharedStates {}
|
|
505
505
|
//#endregion
|
|
506
506
|
//#region src/types/utils.d.ts
|
|
507
507
|
type Thenable<T> = T | Promise<T>;
|
|
@@ -513,7 +513,7 @@ type PartialWithoutId<T extends {
|
|
|
513
513
|
};
|
|
514
514
|
//#endregion
|
|
515
515
|
//#region src/types/views.d.ts
|
|
516
|
-
interface
|
|
516
|
+
interface DevframeViewHost {
|
|
517
517
|
/**
|
|
518
518
|
* @internal
|
|
519
519
|
*/
|
|
@@ -573,6 +573,19 @@ interface SharedState<T> {
|
|
|
573
573
|
interface SharedStateEvents<T> {
|
|
574
574
|
updated: (fullState: T, patches: SharedStatePatch[] | undefined, syncId: string) => void;
|
|
575
575
|
}
|
|
576
|
+
interface SharedStateOptions<T> {
|
|
577
|
+
/**
|
|
578
|
+
* Initial state.
|
|
579
|
+
*/
|
|
580
|
+
initialValue: T;
|
|
581
|
+
/**
|
|
582
|
+
* Enable patches.
|
|
583
|
+
*
|
|
584
|
+
* @default false
|
|
585
|
+
*/
|
|
586
|
+
enablePatches?: boolean;
|
|
587
|
+
}
|
|
588
|
+
declare function createSharedState<T extends object>(options: SharedStateOptions<T>): SharedState<T>;
|
|
576
589
|
//#endregion
|
|
577
590
|
//#region src/utils/streaming-channel.d.ts
|
|
578
591
|
/**
|
|
@@ -600,6 +613,14 @@ interface StreamSinkEvents<T> {
|
|
|
600
613
|
/** Terminal — fired exactly once per sink lifetime. */
|
|
601
614
|
end: (error?: StreamErrorPayload) => void;
|
|
602
615
|
}
|
|
616
|
+
interface CreateStreamSinkOptions {
|
|
617
|
+
id?: string;
|
|
618
|
+
/**
|
|
619
|
+
* Size of the per-stream ring buffer kept for replay-on-resubscribe.
|
|
620
|
+
* `0` (default) disables replay.
|
|
621
|
+
*/
|
|
622
|
+
replayWindow?: number;
|
|
623
|
+
}
|
|
603
624
|
/**
|
|
604
625
|
* Server-side producer handle. Two equivalent surfaces share one piece of
|
|
605
626
|
* state: the imperative `write/error/close` triple, and a `WritableStream<T>`
|
|
@@ -640,6 +661,22 @@ interface StreamSink<T> {
|
|
|
640
661
|
*/
|
|
641
662
|
readonly buffer: ReadonlyArray<BufferedChunk<T>>;
|
|
642
663
|
}
|
|
664
|
+
interface CreateStreamReaderOptions {
|
|
665
|
+
id?: string;
|
|
666
|
+
/**
|
|
667
|
+
* Maximum number of buffered chunks held client-side while the consumer
|
|
668
|
+
* isn't draining. On overflow, the oldest chunk is dropped.
|
|
669
|
+
*/
|
|
670
|
+
highWaterMark?: number;
|
|
671
|
+
/**
|
|
672
|
+
* Called when the chunk queue overflows the high-water mark. The RPC
|
|
673
|
+
* layer wires this to a coded warning; the primitive itself is
|
|
674
|
+
* RPC-agnostic.
|
|
675
|
+
*/
|
|
676
|
+
onOverflow?: (dropped: number) => void;
|
|
677
|
+
/** Called when the consumer cancels — the RPC layer sends `:cancel` upstream. */
|
|
678
|
+
onCancel?: () => void;
|
|
679
|
+
}
|
|
643
680
|
/**
|
|
644
681
|
* Client-side consumer handle. Both an `AsyncIterable<T>` (for `for await`)
|
|
645
682
|
* and exposes `readable: ReadableStream<T>` (for `pipeTo`). Pick one — they
|
|
@@ -659,36 +696,48 @@ interface StreamReader<T> extends AsyncIterable<T> {
|
|
|
659
696
|
/** @internal */
|
|
660
697
|
_end: (error?: StreamErrorPayload) => void;
|
|
661
698
|
}
|
|
699
|
+
/**
|
|
700
|
+
* Build a server-side stream sink. RPC-agnostic — the RPC host wires
|
|
701
|
+
* `events.on('chunk' | 'end')` to broadcast, and reads `buffer` to replay
|
|
702
|
+
* for late or reconnecting subscribers.
|
|
703
|
+
*/
|
|
704
|
+
declare function createStreamSink<T>(options?: CreateStreamSinkOptions): StreamSink<T>;
|
|
705
|
+
/**
|
|
706
|
+
* Build a client-side stream reader. RPC-agnostic — the RPC host calls
|
|
707
|
+
* `_push(seq, chunk)` on each incoming chunk and `_end(error?)` on the
|
|
708
|
+
* terminal frame. Consumers iterate with `for await` or pipe `readable`.
|
|
709
|
+
*/
|
|
710
|
+
declare function createStreamReader<T>(options?: CreateStreamReaderOptions): StreamReader<T>;
|
|
662
711
|
//#endregion
|
|
663
712
|
//#region src/types/rpc.d.ts
|
|
664
|
-
interface
|
|
665
|
-
meta:
|
|
666
|
-
rpc: BirpcReturn<
|
|
713
|
+
interface DevframeNodeRpcSession {
|
|
714
|
+
meta: DevframeNodeRpcSessionMeta;
|
|
715
|
+
rpc: BirpcReturn<DevframeRpcClientFunctions, DevframeRpcServerFunctions, false>;
|
|
667
716
|
}
|
|
668
717
|
interface RpcBroadcastOptions<METHOD, Args extends any[]> {
|
|
669
718
|
method: METHOD;
|
|
670
719
|
args: Args;
|
|
671
720
|
optional?: boolean;
|
|
672
721
|
event?: boolean;
|
|
673
|
-
filter?: (client: BirpcReturn<
|
|
722
|
+
filter?: (client: BirpcReturn<DevframeRpcClientFunctions, DevframeRpcServerFunctions, false>) => boolean | void;
|
|
674
723
|
}
|
|
675
|
-
type RpcFunctionsHost = RpcFunctionsCollectorBase<
|
|
724
|
+
type RpcFunctionsHost = RpcFunctionsCollectorBase<DevframeRpcServerFunctions, DevframeNodeContext> & {
|
|
676
725
|
/**
|
|
677
726
|
* Invoke a locally registered server RPC function directly.
|
|
678
727
|
*
|
|
679
728
|
* This bypasses transport and is useful for server-side cross-function calls.
|
|
680
729
|
*/
|
|
681
|
-
invokeLocal: <T extends keyof
|
|
730
|
+
invokeLocal: <T extends keyof DevframeRpcServerFunctions, Args extends Parameters<DevframeRpcServerFunctions[T]>>(method: T, ...args: Args) => Promise<Awaited<ReturnType<DevframeRpcServerFunctions[T]>>>;
|
|
682
731
|
/**
|
|
683
732
|
* Broadcast a message to all connected clients
|
|
684
733
|
*/
|
|
685
|
-
broadcast: <T extends keyof
|
|
734
|
+
broadcast: <T extends keyof DevframeRpcClientFunctions, Args extends Parameters<DevframeRpcClientFunctions[T]>>(options: RpcBroadcastOptions<T, Args>) => Promise<void>;
|
|
686
735
|
/**
|
|
687
736
|
* Get the current RPC client
|
|
688
737
|
*
|
|
689
738
|
* Available in RPC functions to get the current RPC client
|
|
690
739
|
*/
|
|
691
|
-
getCurrentRpcSession: () =>
|
|
740
|
+
getCurrentRpcSession: () => DevframeNodeRpcSession | undefined;
|
|
692
741
|
/**
|
|
693
742
|
* The shared state host
|
|
694
743
|
*/
|
|
@@ -706,7 +755,7 @@ interface RpcSharedStateGetOptions<T> {
|
|
|
706
755
|
initialValue?: T;
|
|
707
756
|
}
|
|
708
757
|
interface RpcSharedStateHost {
|
|
709
|
-
get: <T extends keyof
|
|
758
|
+
get: <T extends keyof DevframeRpcSharedStates>(key: T, options?: RpcSharedStateGetOptions<DevframeRpcSharedStates[T]>) => Promise<SharedState<DevframeRpcSharedStates[T]>>;
|
|
710
759
|
keys: () => string[];
|
|
711
760
|
/**
|
|
712
761
|
* Subscribe to new shared-state keys becoming available. Fires when
|
|
@@ -817,11 +866,11 @@ interface RpcStreamingHost {
|
|
|
817
866
|
*
|
|
818
867
|
* @internal
|
|
819
868
|
*/
|
|
820
|
-
_onSessionDisconnected: (meta:
|
|
869
|
+
_onSessionDisconnected: (meta: DevframeNodeRpcSessionMeta) => void;
|
|
821
870
|
}
|
|
822
871
|
//#endregion
|
|
823
872
|
//#region src/types/context.d.ts
|
|
824
|
-
interface
|
|
873
|
+
interface DevframeCapabilities {
|
|
825
874
|
rpc?: boolean;
|
|
826
875
|
views?: boolean;
|
|
827
876
|
}
|
|
@@ -832,7 +881,7 @@ interface DevToolsCapabilities {
|
|
|
832
881
|
* `createKitContext` adds `docks`, `terminals`, `messages`, and
|
|
833
882
|
* `commands` when mounted into Vite DevTools.
|
|
834
883
|
*/
|
|
835
|
-
interface
|
|
884
|
+
interface DevframeNodeContext {
|
|
836
885
|
readonly workspaceRoot: string;
|
|
837
886
|
readonly cwd: string;
|
|
838
887
|
/**
|
|
@@ -854,20 +903,20 @@ interface DevToolsNodeContext {
|
|
|
854
903
|
* Host runtime abstraction — exposes `mountStatic` / `resolveOrigin` /
|
|
855
904
|
* `getStorageDir`.
|
|
856
905
|
*/
|
|
857
|
-
host:
|
|
906
|
+
host: DevframeHost;
|
|
858
907
|
rpc: RpcFunctionsHost;
|
|
859
|
-
views:
|
|
908
|
+
views: DevframeViewHost;
|
|
860
909
|
/**
|
|
861
910
|
* Structured diagnostics host — wraps `nostics` and lets integrations
|
|
862
911
|
* register their own coded errors/warnings into the shared lookup.
|
|
863
912
|
*/
|
|
864
|
-
diagnostics:
|
|
913
|
+
diagnostics: DevframeDiagnosticsHost;
|
|
865
914
|
/**
|
|
866
915
|
* Agent host — aggregates the agent-exposed surface of this devtool.
|
|
867
916
|
*
|
|
868
917
|
* @experimental
|
|
869
918
|
*/
|
|
870
|
-
agent:
|
|
919
|
+
agent: DevframeAgentHost;
|
|
871
920
|
}
|
|
872
921
|
interface ConnectionMeta {
|
|
873
922
|
backend: 'websocket' | 'static';
|
|
@@ -999,7 +1048,7 @@ interface DevframeDefinition {
|
|
|
999
1048
|
spa?: boolean | Record<string, boolean>;
|
|
1000
1049
|
};
|
|
1001
1050
|
/** Server-side setup — the primary entrypoint. Runs in every runtime. */
|
|
1002
|
-
setup: (ctx:
|
|
1051
|
+
setup: (ctx: DevframeNodeContext, info?: DevframeSetupInfo) => void | Promise<void>;
|
|
1003
1052
|
/** Browser-only setup for the SPA adapter (bundled into the client). */
|
|
1004
1053
|
setupBrowser?: (ctx: DevframeBrowserContext) => void | Promise<void>;
|
|
1005
1054
|
cli?: DevframeCliOptions;
|
|
@@ -1007,4 +1056,4 @@ interface DevframeDefinition {
|
|
|
1007
1056
|
}
|
|
1008
1057
|
declare function defineDevframe(d: DevframeDefinition): DevframeDefinition;
|
|
1009
1058
|
//#endregion
|
|
1010
|
-
export {
|
|
1059
|
+
export { AgentResource as $, ImmutableArray as A, EntriesToObject as B, StreamErrorPayload as C, createStreamReader as D, StreamSinkEvents as E, SharedStateEvents as F, DevframeRpcSharedStates as G, Thenable as H, SharedStateOptions as I, DevframeDiagnosticsDefinition as J, DevframeHost as K, SharedStatePatch as L, ImmutableObject as M, ImmutableSet as N, createStreamSink as O, SharedState as P, AgentManifest as Q, createSharedState as R, CreateStreamSinkOptions as S, StreamSink as T, DevframeRpcClientFunctions as U, PartialWithoutId as V, DevframeRpcServerFunctions as W, DevframeDiagnosticsLogger as X, DevframeDiagnosticsHost as Y, AgentHandle as Z, RpcStreamingChannel as _, DevframeRuntime as a, DevframeAgentHostEvents as at, BufferedChunk as b, defineDevframe as c, EventsMap as ct, DevframeNodeContext as d, defineCliFlags as dt, AgentResourceContent as et, DevframeNodeRpcSession as f, parseCliFlags as ft, RpcSharedStateHost as g, RpcSharedStateGetOptions as h, DevframeDeploymentKind as i, DevframeAgentHost as it, ImmutableMap as j, Immutable as k, ConnectionMeta as l, CliFlagsSchema as lt, RpcFunctionsHost as m, DevframeCliOptions as n, AgentTool as nt, DevframeSetupInfo as o, EventEmitter as ot, RpcBroadcastOptions as p, DevframeDefineDiagnosticsOptions as q, DevframeDefinition as r, AgentToolInput as rt, DevframeSpaOptions as s, EventUnsubscribe as st, DevframeBrowserContext as t, AgentResourceInput as tt, DevframeCapabilities as u, InferCliFlags as ut, RpcStreamingChannelOptions as v, StreamReader as w, CreateStreamReaderOptions as x, RpcStreamingHost as y, DevframeViewHost as z };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as diagnostics } from "./diagnostics-GitRGKbr.mjs";
|
|
2
|
-
import {
|
|
2
|
+
import { DEVFRAME_RPC_DUMP_DIRNAME } from "./constants.mjs";
|
|
3
3
|
import { createHash } from "node:crypto";
|
|
4
4
|
//#region ../../node_modules/.pnpm/ohash@2.0.11/node_modules/ohash/dist/shared/ohash.D__AXeF1.mjs
|
|
5
5
|
function serialize(o) {
|
|
@@ -498,14 +498,18 @@ function getDefinitionsWithDumps(definitions) {
|
|
|
498
498
|
//#endregion
|
|
499
499
|
//#region src/rpc/handler.ts
|
|
500
500
|
async function getRpcResolvedSetupResult(definition, context) {
|
|
501
|
-
if (definition.__resolved) return definition.__resolved;
|
|
502
501
|
if (!definition.setup) return {};
|
|
503
|
-
|
|
504
|
-
definition.
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
502
|
+
if (typeof context === "object" && context !== null) {
|
|
503
|
+
definition.__cache ??= /* @__PURE__ */ new WeakMap();
|
|
504
|
+
let promise = definition.__cache.get(context);
|
|
505
|
+
if (!promise) {
|
|
506
|
+
promise = Promise.resolve(definition.setup(context));
|
|
507
|
+
definition.__cache.set(context, promise);
|
|
508
|
+
}
|
|
509
|
+
return await promise;
|
|
510
|
+
}
|
|
511
|
+
definition.__promise ??= Promise.resolve(definition.setup(context));
|
|
512
|
+
return await definition.__promise;
|
|
509
513
|
}
|
|
510
514
|
async function getRpcHandler(definition, context) {
|
|
511
515
|
if (definition.handler) return definition.handler;
|
|
@@ -519,13 +523,13 @@ function makeDumpKey(name) {
|
|
|
519
523
|
return encodeURIComponent(name.replaceAll(":", "~"));
|
|
520
524
|
}
|
|
521
525
|
function makeStaticPath(name) {
|
|
522
|
-
return `${
|
|
526
|
+
return `${DEVFRAME_RPC_DUMP_DIRNAME}/${makeDumpKey(name)}.static.json`;
|
|
523
527
|
}
|
|
524
528
|
function makeQueryRecordPath(name, hash) {
|
|
525
|
-
return `${
|
|
529
|
+
return `${DEVFRAME_RPC_DUMP_DIRNAME}/${makeDumpKey(name)}.record.${hash}.json`;
|
|
526
530
|
}
|
|
527
531
|
function makeQueryFallbackPath(name) {
|
|
528
|
-
return `${
|
|
532
|
+
return `${DEVFRAME_RPC_DUMP_DIRNAME}/${makeDumpKey(name)}.fallback.json`;
|
|
529
533
|
}
|
|
530
534
|
async function resolveRecord(record) {
|
|
531
535
|
return typeof record === "function" ? await record() : record;
|
package/dist/helpers/vite.d.mts
CHANGED
package/dist/helpers/vite.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { i as diagnostics } from "../shared-state-
|
|
1
|
+
import { DEVFRAME_CONNECTION_META_FILENAME } from "../constants.mjs";
|
|
2
|
+
import { i as diagnostics } from "../shared-state-BlBNYziY.mjs";
|
|
3
3
|
import { n as resolveBasePath } from "../_shared-CUFqO4kJ.mjs";
|
|
4
4
|
import { serveStaticNodeMiddleware } from "../utils/serve-static.mjs";
|
|
5
|
-
import { n as resolveDevServerPort, t as createDevServer } from "../dev-
|
|
5
|
+
import { n as resolveDevServerPort, t as createDevServer } from "../dev-Cv43GfqM.mjs";
|
|
6
6
|
import { resolve } from "pathe";
|
|
7
7
|
//#region src/helpers/vite.ts
|
|
8
8
|
/**
|
|
@@ -61,7 +61,7 @@ function viteDevBridge(d, options = {}) {
|
|
|
61
61
|
}, { method: "warn" });
|
|
62
62
|
return;
|
|
63
63
|
}
|
|
64
|
-
const metaPath = `${base}${
|
|
64
|
+
const metaPath = `${base}${DEVFRAME_CONNECTION_META_FILENAME}`;
|
|
65
65
|
server.middlewares.use(metaPath, (_req, res) => {
|
|
66
66
|
res.setHeader("Content-Type", "application/json");
|
|
67
67
|
res.end(JSON.stringify({
|
|
@@ -2,7 +2,7 @@ import { t as devframeReporter } from "./diagnostics-reporter-CBBZwoMv.mjs";
|
|
|
2
2
|
import { t as diagnostics } from "./diagnostics-GitRGKbr.mjs";
|
|
3
3
|
import { RpcFunctionsCollectorBase } from "./rpc/index.mjs";
|
|
4
4
|
import { defineRpcFunction } from "./index.mjs";
|
|
5
|
-
import { i as diagnostics$1, n as nanoid, r as createEventEmitter, t as createSharedState } from "./shared-state-
|
|
5
|
+
import { i as diagnostics$1, n as nanoid, r as createEventEmitter, t as createSharedState } from "./shared-state-BlBNYziY.mjs";
|
|
6
6
|
import { defineDiagnostics } from "nostics";
|
|
7
7
|
import { isatty } from "node:tty";
|
|
8
8
|
import { formatWithOptions, inspect } from "node:util";
|
|
@@ -19,7 +19,7 @@ import { join } from "pathe";
|
|
|
19
19
|
*
|
|
20
20
|
* @experimental
|
|
21
21
|
*/
|
|
22
|
-
var
|
|
22
|
+
var DevframeAgentHost = class {
|
|
23
23
|
context;
|
|
24
24
|
events = createEventEmitter();
|
|
25
25
|
tools = /* @__PURE__ */ new Map();
|
|
@@ -184,7 +184,7 @@ function hasPositionalKeys(obj) {
|
|
|
184
184
|
}
|
|
185
185
|
//#endregion
|
|
186
186
|
//#region src/node/host-diagnostics.ts
|
|
187
|
-
var
|
|
187
|
+
var DevframeDiagnosticsHost = class {
|
|
188
188
|
context;
|
|
189
189
|
_registry = {};
|
|
190
190
|
logger = new Proxy({}, { get: (_, code) => this._registry[code] });
|
|
@@ -458,8 +458,8 @@ function createDebug(namespace, options) {
|
|
|
458
458
|
enable(process.env.DEBUG || "");
|
|
459
459
|
//#endregion
|
|
460
460
|
//#region src/node/rpc-shared-state.ts
|
|
461
|
-
const debug$1 = createDebug("
|
|
462
|
-
const debugSubscribe = createDebug("
|
|
461
|
+
const debug$1 = createDebug("devframe:rpc:state:changed");
|
|
462
|
+
const debugSubscribe = createDebug("devframe:rpc:state:subscribe");
|
|
463
463
|
function createRpcSharedStateServerHost(rpc) {
|
|
464
464
|
const sharedState = /* @__PURE__ */ new Map();
|
|
465
465
|
const keyAddedListeners = /* @__PURE__ */ new Set();
|
|
@@ -817,7 +817,7 @@ function toErrorPayload(reason) {
|
|
|
817
817
|
}
|
|
818
818
|
//#endregion
|
|
819
819
|
//#region src/node/rpc-streaming.ts
|
|
820
|
-
const debug = createDebug("
|
|
820
|
+
const debug = createDebug("devframe:rpc:streaming");
|
|
821
821
|
const STREAM_KEY_SEPARATOR = "";
|
|
822
822
|
function streamKey(channel, id) {
|
|
823
823
|
return `${channel}${STREAM_KEY_SEPARATOR}${id}`;
|
|
@@ -1117,7 +1117,7 @@ function createRpcStreamingServerHost(rpc) {
|
|
|
1117
1117
|
}
|
|
1118
1118
|
//#endregion
|
|
1119
1119
|
//#region src/node/host-functions.ts
|
|
1120
|
-
const debugBroadcast = createDebug("
|
|
1120
|
+
const debugBroadcast = createDebug("devframe:rpc:broadcast");
|
|
1121
1121
|
var RpcFunctionsHost = class extends RpcFunctionsCollectorBase {
|
|
1122
1122
|
/**
|
|
1123
1123
|
* @internal
|
|
@@ -1165,7 +1165,7 @@ var RpcFunctionsHost = class extends RpcFunctionsCollectorBase {
|
|
|
1165
1165
|
};
|
|
1166
1166
|
//#endregion
|
|
1167
1167
|
//#region src/node/host-views.ts
|
|
1168
|
-
var
|
|
1168
|
+
var DevframeViewHost = class {
|
|
1169
1169
|
context;
|
|
1170
1170
|
/**
|
|
1171
1171
|
* @internal
|
|
@@ -1242,7 +1242,7 @@ const BUILTIN_AGENT_RPC = [
|
|
|
1242
1242
|
//#endregion
|
|
1243
1243
|
//#region src/node/context.ts
|
|
1244
1244
|
/**
|
|
1245
|
-
* Framework- and build-tool-agnostic core of the
|
|
1245
|
+
* Framework- and build-tool-agnostic core of the Devframe node context.
|
|
1246
1246
|
* Wires the RPC host, view (HTTP file-serving) host, diagnostics, and
|
|
1247
1247
|
* agent subsystems. Host adapters can wrap this to augment `ctx` with
|
|
1248
1248
|
* extra surfaces — for example, `@vitejs/devtools-kit`'s
|
|
@@ -1262,12 +1262,12 @@ async function createHostContext(options) {
|
|
|
1262
1262
|
agent: void 0
|
|
1263
1263
|
};
|
|
1264
1264
|
const rpcHost = new RpcFunctionsHost(context);
|
|
1265
|
-
const viewsHost = new
|
|
1266
|
-
const diagnosticsHost = new
|
|
1265
|
+
const viewsHost = new DevframeViewHost(context);
|
|
1266
|
+
const diagnosticsHost = new DevframeDiagnosticsHost(context, [diagnostics$1, diagnostics]);
|
|
1267
1267
|
context.rpc = rpcHost;
|
|
1268
1268
|
context.views = viewsHost;
|
|
1269
1269
|
context.diagnostics = diagnosticsHost;
|
|
1270
|
-
context.agent = new
|
|
1270
|
+
context.agent = new DevframeAgentHost(context);
|
|
1271
1271
|
for (const fn of BUILTIN_AGENT_RPC) rpcHost.register(fn);
|
|
1272
1272
|
for (const fn of builtinRpcDeclarations) rpcHost.register(fn);
|
|
1273
1273
|
return context;
|
|
@@ -1275,9 +1275,9 @@ async function createHostContext(options) {
|
|
|
1275
1275
|
//#endregion
|
|
1276
1276
|
//#region src/node/host-h3.ts
|
|
1277
1277
|
/**
|
|
1278
|
-
* h3-backed {@link
|
|
1278
|
+
* h3-backed {@link DevframeHost} — used by the standalone CLI adapter.
|
|
1279
1279
|
*/
|
|
1280
|
-
function
|
|
1280
|
+
function createH3DevframeHost(options) {
|
|
1281
1281
|
const workspaceRoot = options.workspaceRoot ?? process$1.cwd();
|
|
1282
1282
|
return {
|
|
1283
1283
|
mountStatic(base, distDir) {
|
|
@@ -1287,10 +1287,10 @@ function createH3DevToolsHost(options) {
|
|
|
1287
1287
|
return options.origin;
|
|
1288
1288
|
},
|
|
1289
1289
|
getStorageDir(scope) {
|
|
1290
|
-
const namespace = `.${options.appName}/
|
|
1290
|
+
const namespace = `.${options.appName}/devframe`;
|
|
1291
1291
|
return scope === "workspace" ? join(workspaceRoot, "node_modules", namespace) : join(homedir(), namespace);
|
|
1292
1292
|
}
|
|
1293
1293
|
};
|
|
1294
1294
|
}
|
|
1295
1295
|
//#endregion
|
|
1296
|
-
export { createRpcStreamingServerHost as a,
|
|
1296
|
+
export { createRpcStreamingServerHost as a, DevframeAgentHost as c, RpcFunctionsHost as i, createHostContext as n, createRpcSharedStateServerHost as o, DevframeViewHost as r, DevframeDiagnosticsHost as s, createH3DevframeHost as t };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { C as RpcFunctionsCollector, S as RpcFunctionType, _ as RpcFunctionDefinitionAny, g as RpcFunctionDefinition, i as RpcArgsSchema, w as RpcReturnSchema, x as RpcFunctionSetupResult } from "./types-
|
|
2
|
-
import { a as getDefinitionsWithDumps$1, c as StaticRpcDumpManifest$1, d as StaticRpcDumpManifestValue$1, f as StaticRpcDumpSerialization$1, i as dumpFunctions$1, l as StaticRpcDumpManifestQueryEntry$1, n as serializeDumpError$1, o as StaticRpcDumpCollection$1, p as collectStaticRpcDump$1, r as createClientFromDump$1, s as StaticRpcDumpFile$1, t as reviveDumpError$1, u as StaticRpcDumpManifestStaticEntry$1 } from "./index-
|
|
1
|
+
import { C as RpcFunctionsCollector, S as RpcFunctionType, _ as RpcFunctionDefinitionAny, g as RpcFunctionDefinition, i as RpcArgsSchema, w as RpcReturnSchema, x as RpcFunctionSetupResult } from "./types-BkkQ0Txg.mjs";
|
|
2
|
+
import { a as getDefinitionsWithDumps$1, c as StaticRpcDumpManifest$1, d as StaticRpcDumpManifestValue$1, f as StaticRpcDumpSerialization$1, i as dumpFunctions$1, l as StaticRpcDumpManifestQueryEntry$1, n as serializeDumpError$1, o as StaticRpcDumpCollection$1, p as collectStaticRpcDump$1, r as createClientFromDump$1, s as StaticRpcDumpFile$1, t as reviveDumpError$1, u as StaticRpcDumpManifestStaticEntry$1 } from "./index-DH2sBIwd.mjs";
|
|
3
3
|
|
|
4
4
|
//#region src/rpc/cache.d.ts
|
|
5
5
|
interface RpcCacheOptions {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { _ as RpcFunctionDefinitionAny, c as RpcDumpClientOptions, l as RpcDumpCollectionOptions, m as RpcDumpStore, n as BirpcReturn, o as RpcDefinitionsToFunctions, p as RpcDumpRecordError } from "./types-
|
|
1
|
+
import { _ as RpcFunctionDefinitionAny, c as RpcDumpClientOptions, l as RpcDumpCollectionOptions, m as RpcDumpStore, n as BirpcReturn, o as RpcDefinitionsToFunctions, p as RpcDumpRecordError } from "./types-BkkQ0Txg.mjs";
|
|
2
2
|
|
|
3
3
|
//#region src/rpc/dump/static.d.ts
|
|
4
4
|
type StaticRpcDumpSerialization = 'json' | 'structured-clone';
|
package/dist/index.d.mts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { S as RpcFunctionType, g as RpcFunctionDefinition, h as RpcFunctionAgentOptions, i as RpcArgsSchema, w as RpcReturnSchema } from "./types-
|
|
3
|
-
import { t as
|
|
1
|
+
import { $ as AgentResource, B as EntriesToObject, G as DevframeRpcSharedStates, H as Thenable, J as DevframeDiagnosticsDefinition, K as DevframeHost, Q as AgentManifest, U as DevframeRpcClientFunctions, V as PartialWithoutId, W as DevframeRpcServerFunctions, X as DevframeDiagnosticsLogger, Y as DevframeDiagnosticsHost, Z as AgentHandle, _ as RpcStreamingChannel, a as DevframeRuntime, at as DevframeAgentHostEvents, c as defineDevframe, ct as EventsMap, d as DevframeNodeContext, et as AgentResourceContent, f as DevframeNodeRpcSession, g as RpcSharedStateHost, h as RpcSharedStateGetOptions, i as DevframeDeploymentKind, it as DevframeAgentHost, l as ConnectionMeta, m as RpcFunctionsHost, n as DevframeCliOptions, nt as AgentTool, o as DevframeSetupInfo, ot as EventEmitter, p as RpcBroadcastOptions, q as DevframeDefineDiagnosticsOptions, r as DevframeDefinition, rt as AgentToolInput, s as DevframeSpaOptions, st as EventUnsubscribe, t as DevframeBrowserContext, tt as AgentResourceInput, u as DevframeCapabilities, v as RpcStreamingChannelOptions, y as RpcStreamingHost, z as DevframeViewHost } from "./devframe-BuR6n9ZD.mjs";
|
|
2
|
+
import { S as RpcFunctionType, g as RpcFunctionDefinition, h as RpcFunctionAgentOptions, i as RpcArgsSchema, w as RpcReturnSchema } from "./types-BkkQ0Txg.mjs";
|
|
3
|
+
import { t as DevframeNodeRpcSessionMeta } from "./ws-server-C1LjmRnp.mjs";
|
|
4
4
|
|
|
5
5
|
//#region src/define.d.ts
|
|
6
|
-
declare const defineRpcFunction: <NAME extends string, TYPE extends RpcFunctionType, ARGS extends any[], RETURN = void, const AS extends RpcArgsSchema | undefined = undefined, const RS extends RpcReturnSchema | undefined = undefined>(definition: RpcFunctionDefinition<NAME, TYPE, ARGS, RETURN, AS, RS,
|
|
6
|
+
declare const defineRpcFunction: <NAME extends string, TYPE extends RpcFunctionType, ARGS extends any[], RETURN = void, const AS extends RpcArgsSchema | undefined = undefined, const RS extends RpcReturnSchema | undefined = undefined>(definition: RpcFunctionDefinition<NAME, TYPE, ARGS, RETURN, AS, RS, DevframeNodeContext>) => RpcFunctionDefinition<NAME, TYPE, ARGS, RETURN, AS, RS, DevframeNodeContext>;
|
|
7
7
|
//#endregion
|
|
8
|
-
export { AgentHandle, AgentManifest, AgentResource, AgentResourceContent, AgentResourceInput, AgentTool, AgentToolInput, ConnectionMeta,
|
|
8
|
+
export { AgentHandle, AgentManifest, AgentResource, AgentResourceContent, AgentResourceInput, AgentTool, AgentToolInput, ConnectionMeta, DevframeAgentHost, DevframeAgentHostEvents, DevframeBrowserContext, DevframeCapabilities, DevframeCliOptions, DevframeDefineDiagnosticsOptions, DevframeDefinition, DevframeDeploymentKind, DevframeDiagnosticsDefinition, DevframeDiagnosticsHost, DevframeDiagnosticsLogger, DevframeHost, DevframeNodeContext, DevframeNodeRpcSession, DevframeNodeRpcSessionMeta, DevframeRpcClientFunctions, DevframeRpcServerFunctions, DevframeRpcSharedStates, DevframeRuntime, DevframeSetupInfo, DevframeSpaOptions, DevframeViewHost, EntriesToObject, EventEmitter, EventUnsubscribe, EventsMap, PartialWithoutId, RpcBroadcastOptions, RpcFunctionAgentOptions, RpcFunctionsHost, RpcSharedStateGetOptions, RpcSharedStateHost, RpcStreamingChannel, RpcStreamingChannelOptions, RpcStreamingHost, Thenable, defineDevframe, defineRpcFunction };
|
package/dist/node/auth.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { n as InternalAnonymousAuthStorage } from "../context-
|
|
1
|
+
import { P as SharedState, d as DevframeNodeContext, f as DevframeNodeRpcSession } from "../devframe-BuR6n9ZD.mjs";
|
|
2
|
+
import { n as InternalAnonymousAuthStorage } from "../context-DTRcO_UH.mjs";
|
|
3
3
|
|
|
4
4
|
//#region src/node/auth/revoke.d.ts
|
|
5
5
|
/**
|
|
@@ -8,17 +8,17 @@ import { n as InternalAnonymousAuthStorage } from "../context-Ca70YtrW.mjs";
|
|
|
8
8
|
*
|
|
9
9
|
* Shared between persisted-auth revocation and remote-dock token revocation.
|
|
10
10
|
*/
|
|
11
|
-
declare function revokeActiveConnectionsForToken(context:
|
|
11
|
+
declare function revokeActiveConnectionsForToken(context: DevframeNodeContext, token: string): Promise<void>;
|
|
12
12
|
/**
|
|
13
13
|
* Revoke an auth token: remove from storage and notify all connected clients
|
|
14
14
|
* using this token that they are no longer trusted.
|
|
15
15
|
*/
|
|
16
|
-
declare function revokeAuthToken(context:
|
|
16
|
+
declare function revokeAuthToken(context: DevframeNodeContext, storage: SharedState<InternalAnonymousAuthStorage>, token: string): Promise<void>;
|
|
17
17
|
//#endregion
|
|
18
18
|
//#region src/node/auth/state.d.ts
|
|
19
19
|
interface PendingAuthRequest {
|
|
20
20
|
clientAuthToken: string;
|
|
21
|
-
session:
|
|
21
|
+
session: DevframeNodeRpcSession;
|
|
22
22
|
ua: string;
|
|
23
23
|
origin: string;
|
|
24
24
|
resolve: (result: {
|
package/dist/node/auth.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as
|
|
1
|
+
import { n as revokeAuthToken, r as humanId, t as revokeActiveConnectionsForToken } from "../revoke-CL0LSAN9.mjs";
|
|
2
2
|
//#region src/node/auth/state.ts
|
|
3
3
|
let pendingAuth = null;
|
|
4
4
|
let tempAuthToken = generateTempId();
|