devframe 0.1.16 → 0.1.18
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/adapters/build.d.mts +1 -1
- package/dist/adapters/build.mjs +13 -6
- package/dist/adapters/cli.d.mts +1 -1
- package/dist/adapters/cli.mjs +6 -6
- package/dist/adapters/embedded.d.mts +1 -1
- package/dist/adapters/kit.d.mts +1 -1
- package/dist/adapters/mcp.d.mts +1 -1
- package/dist/adapters/mcp.mjs +2 -2
- package/dist/adapters/vite.d.mts +1 -1
- package/dist/adapters/vite.mjs +1 -1
- package/dist/client/index.d.mts +5 -4
- package/dist/client/index.mjs +1 -1
- package/dist/{client-4WrEozlH.mjs → client-CsR1_h3o.mjs} +14 -6
- package/dist/constants.d.mts +1 -1
- package/dist/{context-BrePWeyd.mjs → context-xQo1FcxX.mjs} +107 -56
- package/dist/{devtool-OJ3QW0ns.d.mts → devtool-CHT-4_OU.d.mts} +156 -48
- package/dist/helpers/nuxt/runtime/plugin.client.mjs +1 -1
- package/dist/index-Cei8vVcd.d.mts +140 -0
- package/dist/index.d.mts +4 -4
- package/dist/index.mjs +1 -1
- package/dist/node/index.d.mts +38 -10
- package/dist/node/index.mjs +4 -4
- package/dist/recipes/open-helpers.d.mts +5 -1
- package/dist/recipes/open-helpers.mjs +2 -2
- package/dist/rpc/index.d.mts +3 -2
- package/dist/rpc/index.mjs +4 -3
- package/dist/rpc/transports/ws-client.d.mts +1 -1
- package/dist/rpc/transports/ws-client.mjs +19 -4
- package/dist/rpc/transports/ws-server.d.mts +1 -1
- package/dist/rpc/transports/ws-server.mjs +19 -4
- package/dist/{rpc-9FNa3Inb.mjs → rpc-hbRk8qtt.mjs} +15 -33
- package/dist/serialization-CWcWE7x7.mjs +112 -0
- package/dist/{src-BoIqXRc9.mjs → src-DIKqQIjp.mjs} +1 -1
- package/dist/{static-dump-CQUC1aIW.mjs → static-dump-DwFfj4U_.mjs} +21 -6
- package/dist/types/index.d.mts +4 -4
- package/dist/{index-DvKDO5H8.d.mts → types-BkyzI9r4.d.mts} +35 -95
- package/dist/utils/events.d.mts +1 -1
- package/dist/utils/shared-state.d.mts +1 -1
- package/dist/utils/shared-state.mjs +1 -1
- package/dist/utils/state.d.mts +1 -1
- package/dist/utils/state.mjs +1 -1
- package/dist/utils/when.d.mts +1 -1
- package/dist/ws-client-CDGmViwt.d.mts +26 -0
- package/dist/{ws-server--IuUAaGi.d.mts → ws-server-Cu8tmZcF.d.mts} +12 -0
- package/package.json +1 -1
- package/dist/ws-client-CklfxUHE.d.mts +0 -17
- /package/dist/{_shared-CU6dE-VX.mjs → _shared-Bxa2_kq7.mjs} +0 -0
- /package/dist/{define-Bb4zh-Dc.mjs → define-CW9gLnyG.mjs} +0 -0
- /package/dist/{immer-HjMAm3b6.mjs → immer-DEqg5kOd.mjs} +0 -0
- /package/dist/{main-DpINGndA.mjs → main-BJD9t8dk.mjs} +0 -0
- /package/dist/{open-BtOOEldu.mjs → open-BMO2_-wC.mjs} +0 -0
- /package/dist/{server-DrBxa6ZV.mjs → server-DkJ2-s0Y.mjs} +0 -0
- /package/dist/{transports-BPUzHhI2.mjs → transports-4bqw6Fqg.mjs} +0 -0
- /package/dist/{when-CGLewRtm.d.mts → when-aBBXAEh5.d.mts} +0 -0
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t as DevToolsNodeRpcSessionMeta } from "./ws-server
|
|
1
|
+
import { g as RpcFunctionsCollectorBase } from "./index-Cei8vVcd.mjs";
|
|
2
|
+
import { t as DevToolsNodeRpcSessionMeta } from "./ws-server-Cu8tmZcF.mjs";
|
|
3
3
|
import { GenericSchema, InferOutput } from "valibot";
|
|
4
|
+
import { Logger, createLogger, defineDiagnostics } from "logs-sdk";
|
|
4
5
|
import { BirpcReturn } from "birpc";
|
|
5
6
|
import { CAC } from "cac";
|
|
6
7
|
import { ChildProcess } from "node:child_process";
|
|
@@ -400,6 +401,72 @@ interface DevToolsCommandShortcutOverrides {
|
|
|
400
401
|
[commandId: string]: DevToolsCommandKeybinding[];
|
|
401
402
|
}
|
|
402
403
|
//#endregion
|
|
404
|
+
//#region src/types/diagnostics.d.ts
|
|
405
|
+
/**
|
|
406
|
+
* A diagnostics definition object built with `defineDiagnostics`. Typed as
|
|
407
|
+
* `unknown` because each integration's definition has a distinct narrow shape
|
|
408
|
+
* (e.g. specific code keys like `DF0001` / `MYP0001`), and TypeScript's mapped
|
|
409
|
+
* types don't allow assigning a narrow-keyed `DiagnosticsResult` to a
|
|
410
|
+
* generically-keyed one. The host stores them in a heterogeneous list and
|
|
411
|
+
* rebuilds the logger on `register()`.
|
|
412
|
+
*/
|
|
413
|
+
type DevToolsDiagnosticsDefinition = ReturnType<typeof defineDiagnostics<any>>;
|
|
414
|
+
/** A `logs-sdk` Logger instance built with `createLogger`. */
|
|
415
|
+
type DevToolsDiagnosticsLogger = Logger<readonly any[]>;
|
|
416
|
+
/**
|
|
417
|
+
* Host for structured diagnostics — a thin layer over `logs-sdk` that lets
|
|
418
|
+
* integrations register their own coded errors/warnings into the shared
|
|
419
|
+
* logger without taking a direct dependency on `logs-sdk`.
|
|
420
|
+
*
|
|
421
|
+
* Typical usage from a plugin's `setup(ctx)`:
|
|
422
|
+
*
|
|
423
|
+
* ```ts
|
|
424
|
+
* const myDiagnostics = ctx.diagnostics.defineDiagnostics({
|
|
425
|
+
* docsBase: 'https://example.com/errors',
|
|
426
|
+
* codes: {
|
|
427
|
+
* MYP0001: { message: 'Something went wrong' },
|
|
428
|
+
* },
|
|
429
|
+
* })
|
|
430
|
+
* ctx.diagnostics.register(myDiagnostics)
|
|
431
|
+
*
|
|
432
|
+
* // Later (loose typing):
|
|
433
|
+
* ctx.diagnostics.logger.MYP0001().warn()
|
|
434
|
+
*
|
|
435
|
+
* // Or with full typing, keep your own logger reference:
|
|
436
|
+
* const logger = ctx.diagnostics.createLogger({ diagnostics: [myDiagnostics] })
|
|
437
|
+
* logger.MYP0001().warn()
|
|
438
|
+
* ```
|
|
439
|
+
*/
|
|
440
|
+
interface DevToolsDiagnosticsHost {
|
|
441
|
+
/**
|
|
442
|
+
* The combined `logs-sdk` Logger including all registered diagnostic
|
|
443
|
+
* definitions. The getter always returns the freshest logger — it is
|
|
444
|
+
* rebuilt each time `register()` is called, so cached references to
|
|
445
|
+
* older loggers will not see codes registered later.
|
|
446
|
+
*/
|
|
447
|
+
readonly logger: DevToolsDiagnosticsLogger;
|
|
448
|
+
/**
|
|
449
|
+
* Register an additional diagnostic definition with this host. After
|
|
450
|
+
* registration, codes from the new definition are accessible on
|
|
451
|
+
* `host.logger`. Accepts any `DiagnosticsResult` produced by
|
|
452
|
+
* `defineDiagnostics` — the parameter is typed as `unknown` to avoid
|
|
453
|
+
* mapped-type variance issues with narrowly-keyed definitions.
|
|
454
|
+
*/
|
|
455
|
+
register: (definitions: unknown) => void;
|
|
456
|
+
/**
|
|
457
|
+
* Re-export of `logs-sdk`'s `defineDiagnostics`. Integrations can build
|
|
458
|
+
* their own diagnostic definitions without taking a direct dependency on
|
|
459
|
+
* `logs-sdk`.
|
|
460
|
+
*/
|
|
461
|
+
defineDiagnostics: typeof defineDiagnostics;
|
|
462
|
+
/**
|
|
463
|
+
* Re-export of `logs-sdk`'s `createLogger`. Use this when an integration
|
|
464
|
+
* wants its own typed Logger reference instead of going through
|
|
465
|
+
* `host.logger` (which is loosely typed).
|
|
466
|
+
*/
|
|
467
|
+
createLogger: typeof createLogger;
|
|
468
|
+
}
|
|
469
|
+
//#endregion
|
|
403
470
|
//#region src/types/docks.d.ts
|
|
404
471
|
interface DevToolsDockHost {
|
|
405
472
|
readonly views: Map<string, DevToolsDockUserEntry>;
|
|
@@ -539,7 +606,7 @@ interface DevToolsViewCustomRender extends DevToolsDockEntryBase {
|
|
|
539
606
|
}
|
|
540
607
|
interface DevToolsViewBuiltin extends DevToolsDockEntryBase {
|
|
541
608
|
type: '~builtin';
|
|
542
|
-
id: '~terminals' | '~
|
|
609
|
+
id: '~terminals' | '~messages' | '~client-auth-notice' | '~settings' | '~popup';
|
|
543
610
|
}
|
|
544
611
|
interface JsonRenderElement {
|
|
545
612
|
type: string;
|
|
@@ -596,10 +663,10 @@ interface DevToolsHost {
|
|
|
596
663
|
resolveOrigin: () => string;
|
|
597
664
|
}
|
|
598
665
|
//#endregion
|
|
599
|
-
//#region src/types/
|
|
600
|
-
type
|
|
601
|
-
type
|
|
602
|
-
interface
|
|
666
|
+
//#region src/types/messages.d.ts
|
|
667
|
+
type DevToolsMessageLevel = 'info' | 'warn' | 'error' | 'success' | 'debug';
|
|
668
|
+
type DevToolsMessageEntryFrom = 'server' | 'browser';
|
|
669
|
+
interface DevToolsMessageElementPosition {
|
|
603
670
|
/** CSS selector for the element */
|
|
604
671
|
selector?: string;
|
|
605
672
|
/** Bounding box of the element */
|
|
@@ -612,7 +679,7 @@ interface DevToolsLogElementPosition {
|
|
|
612
679
|
/** Human-readable description of the element */
|
|
613
680
|
description?: string;
|
|
614
681
|
}
|
|
615
|
-
interface
|
|
682
|
+
interface DevToolsMessageFilePosition {
|
|
616
683
|
/** Absolute or relative file path */
|
|
617
684
|
file: string;
|
|
618
685
|
/** Line number (1-based) */
|
|
@@ -620,13 +687,13 @@ interface DevToolsLogFilePosition {
|
|
|
620
687
|
/** Column number (1-based) */
|
|
621
688
|
column?: number;
|
|
622
689
|
}
|
|
623
|
-
interface
|
|
690
|
+
interface DevToolsMessageEntry {
|
|
624
691
|
/**
|
|
625
|
-
* Unique identifier for this
|
|
692
|
+
* Unique identifier for this message entry (auto-generated if not provided)
|
|
626
693
|
*/
|
|
627
694
|
id: string;
|
|
628
695
|
/**
|
|
629
|
-
* Short title or summary of the
|
|
696
|
+
* Short title or summary of the message
|
|
630
697
|
*/
|
|
631
698
|
message: string;
|
|
632
699
|
/**
|
|
@@ -636,7 +703,7 @@ interface DevToolsLogEntry {
|
|
|
636
703
|
/**
|
|
637
704
|
* Severity level, determines color and icon
|
|
638
705
|
*/
|
|
639
|
-
level:
|
|
706
|
+
level: DevToolsMessageLevel;
|
|
640
707
|
/**
|
|
641
708
|
* Optional stack trace string
|
|
642
709
|
*/
|
|
@@ -644,19 +711,19 @@ interface DevToolsLogEntry {
|
|
|
644
711
|
/**
|
|
645
712
|
* Optional DOM element position info (e.g., for a11y issues)
|
|
646
713
|
*/
|
|
647
|
-
elementPosition?:
|
|
714
|
+
elementPosition?: DevToolsMessageElementPosition;
|
|
648
715
|
/**
|
|
649
716
|
* Optional source file position info (e.g., for lint errors)
|
|
650
717
|
*/
|
|
651
|
-
filePosition?:
|
|
718
|
+
filePosition?: DevToolsMessageFilePosition;
|
|
652
719
|
/**
|
|
653
|
-
* Whether this
|
|
720
|
+
* Whether this message should also appear as a toast notification
|
|
654
721
|
*/
|
|
655
722
|
notify?: boolean;
|
|
656
723
|
/**
|
|
657
|
-
* Origin of the
|
|
724
|
+
* Origin of the message entry, automatically set by the context
|
|
658
725
|
*/
|
|
659
|
-
from:
|
|
726
|
+
from: DevToolsMessageEntryFrom;
|
|
660
727
|
/**
|
|
661
728
|
* Grouping category (e.g., 'a11y', 'lint', 'runtime', 'test')
|
|
662
729
|
*/
|
|
@@ -670,74 +737,92 @@ interface DevToolsLogEntry {
|
|
|
670
737
|
*/
|
|
671
738
|
autoDismiss?: number;
|
|
672
739
|
/**
|
|
673
|
-
* Time in ms to auto-delete this
|
|
740
|
+
* Time in ms to auto-delete this message entry (server-side)
|
|
674
741
|
*/
|
|
675
742
|
autoDelete?: number;
|
|
676
743
|
/**
|
|
677
|
-
* Timestamp when the
|
|
744
|
+
* Timestamp when the message was created (auto-generated if not provided)
|
|
678
745
|
*/
|
|
679
746
|
timestamp: number;
|
|
680
747
|
/**
|
|
681
|
-
* Status of the
|
|
748
|
+
* Status of the message entry (e.g., 'loading' while an operation is in progress).
|
|
682
749
|
* Defaults to 'idle' when not specified.
|
|
683
750
|
*/
|
|
684
751
|
status?: 'loading' | 'idle';
|
|
685
752
|
}
|
|
686
753
|
/**
|
|
687
|
-
* Input type for creating a
|
|
688
|
-
* `id`, `timestamp`, and `
|
|
754
|
+
* Input type for creating a message entry.
|
|
755
|
+
* `id`, `timestamp`, and `from` are auto-filled by the host.
|
|
689
756
|
*/
|
|
690
|
-
type
|
|
757
|
+
type DevToolsMessageEntryInput = Omit<DevToolsMessageEntry, 'id' | 'timestamp' | 'from'> & {
|
|
691
758
|
id?: string;
|
|
692
759
|
timestamp?: number;
|
|
693
760
|
};
|
|
694
|
-
interface
|
|
695
|
-
/** The underlying
|
|
696
|
-
readonly entry:
|
|
761
|
+
interface DevToolsMessageHandle {
|
|
762
|
+
/** The underlying message entry data */
|
|
763
|
+
readonly entry: DevToolsMessageEntry;
|
|
697
764
|
/** Shortcut to entry.id */
|
|
698
765
|
readonly id: string;
|
|
699
|
-
/** Partial update of this
|
|
700
|
-
update: (patch: Partial<
|
|
701
|
-
/** Remove this
|
|
766
|
+
/** Partial update of this message entry */
|
|
767
|
+
update: (patch: Partial<DevToolsMessageEntryInput>) => Promise<DevToolsMessageEntry | undefined>;
|
|
768
|
+
/** Remove this message entry */
|
|
702
769
|
dismiss: () => Promise<void>;
|
|
703
770
|
}
|
|
704
|
-
interface
|
|
771
|
+
interface DevToolsMessagesClient {
|
|
705
772
|
/**
|
|
706
|
-
* Add a
|
|
773
|
+
* Add a message entry. Returns a Promise resolving to a handle for subsequent updates/dismissal.
|
|
707
774
|
* Can be used without `await` for fire-and-forget usage.
|
|
708
775
|
*/
|
|
709
|
-
add: (input:
|
|
710
|
-
/** Remove a
|
|
776
|
+
add: (input: DevToolsMessageEntryInput) => Promise<DevToolsMessageHandle>;
|
|
777
|
+
/** Remove a message entry by id */
|
|
711
778
|
remove: (id: string) => Promise<void>;
|
|
712
|
-
/** Clear all
|
|
779
|
+
/** Clear all message entries */
|
|
713
780
|
clear: () => Promise<void>;
|
|
714
781
|
}
|
|
715
|
-
interface
|
|
716
|
-
readonly entries: Map<string,
|
|
782
|
+
interface DevToolsMessagesHost {
|
|
783
|
+
readonly entries: Map<string, DevToolsMessageEntry>;
|
|
717
784
|
readonly events: EventEmitter<{
|
|
718
|
-
'
|
|
719
|
-
'
|
|
720
|
-
'
|
|
721
|
-
'
|
|
785
|
+
'message:added': (entry: DevToolsMessageEntry) => void;
|
|
786
|
+
'message:updated': (entry: DevToolsMessageEntry) => void;
|
|
787
|
+
'message:removed': (id: string) => void;
|
|
788
|
+
'message:cleared': () => void;
|
|
722
789
|
}>;
|
|
723
790
|
/**
|
|
724
|
-
* Add a new
|
|
791
|
+
* Add a new message entry. If an entry with the same `id` already exists, it will be updated instead.
|
|
725
792
|
* Returns a handle for subsequent updates/dismissal. Can be used without `await` for fire-and-forget.
|
|
726
793
|
*/
|
|
727
|
-
add: (entry:
|
|
794
|
+
add: (entry: DevToolsMessageEntryInput) => Promise<DevToolsMessageHandle>;
|
|
728
795
|
/**
|
|
729
|
-
* Update an existing
|
|
796
|
+
* Update an existing message entry by id (partial update)
|
|
730
797
|
*/
|
|
731
|
-
update: (id: string, patch: Partial<
|
|
798
|
+
update: (id: string, patch: Partial<DevToolsMessageEntryInput>) => Promise<DevToolsMessageEntry | undefined>;
|
|
732
799
|
/**
|
|
733
|
-
* Remove a
|
|
800
|
+
* Remove a message entry by id
|
|
734
801
|
*/
|
|
735
802
|
remove: (id: string) => Promise<void>;
|
|
736
803
|
/**
|
|
737
|
-
* Clear all
|
|
804
|
+
* Clear all message entries
|
|
738
805
|
*/
|
|
739
806
|
clear: () => Promise<void>;
|
|
740
807
|
}
|
|
808
|
+
/** @deprecated alias of {@link DevToolsMessageLevel}. Will be removed in a future release. */
|
|
809
|
+
type DevToolsLogLevel = DevToolsMessageLevel;
|
|
810
|
+
/** @deprecated alias of {@link DevToolsMessageEntryFrom}. Will be removed in a future release. */
|
|
811
|
+
type DevToolsLogEntryFrom = DevToolsMessageEntryFrom;
|
|
812
|
+
/** @deprecated alias of {@link DevToolsMessageElementPosition}. Will be removed in a future release. */
|
|
813
|
+
type DevToolsLogElementPosition = DevToolsMessageElementPosition;
|
|
814
|
+
/** @deprecated alias of {@link DevToolsMessageFilePosition}. Will be removed in a future release. */
|
|
815
|
+
type DevToolsLogFilePosition = DevToolsMessageFilePosition;
|
|
816
|
+
/** @deprecated alias of {@link DevToolsMessageEntry}. Will be removed in a future release. */
|
|
817
|
+
type DevToolsLogEntry = DevToolsMessageEntry;
|
|
818
|
+
/** @deprecated alias of {@link DevToolsMessageEntryInput}. Will be removed in a future release. */
|
|
819
|
+
type DevToolsLogEntryInput = DevToolsMessageEntryInput;
|
|
820
|
+
/** @deprecated alias of {@link DevToolsMessageHandle}. Will be removed in a future release. */
|
|
821
|
+
type DevToolsLogHandle = DevToolsMessageHandle;
|
|
822
|
+
/** @deprecated alias of {@link DevToolsMessagesClient}. Will be removed in a future release. */
|
|
823
|
+
type DevToolsLogsClient = DevToolsMessagesClient;
|
|
824
|
+
/** @deprecated alias of {@link DevToolsMessagesHost}. Will be removed in a future release. */
|
|
825
|
+
type DevToolsLogsHost = DevToolsMessagesHost;
|
|
741
826
|
//#endregion
|
|
742
827
|
//#region src/types/rpc-augments.d.ts
|
|
743
828
|
/**
|
|
@@ -964,7 +1049,21 @@ interface DevToolsNodeContext {
|
|
|
964
1049
|
views: DevToolsViewHost;
|
|
965
1050
|
utils: DevToolsNodeUtils;
|
|
966
1051
|
terminals: DevToolsTerminalHost;
|
|
967
|
-
|
|
1052
|
+
/**
|
|
1053
|
+
* User-facing message subsystem — toast notifications and the
|
|
1054
|
+
* "Messages & Notifications" dock panel. Plugins call
|
|
1055
|
+
* `ctx.messages.add({ ... })` to surface activity to users.
|
|
1056
|
+
*/
|
|
1057
|
+
messages: DevToolsMessagesHost;
|
|
1058
|
+
/**
|
|
1059
|
+
* @deprecated Use `ctx.messages` instead. Will be removed in a future release.
|
|
1060
|
+
*/
|
|
1061
|
+
readonly logs: DevToolsMessagesHost;
|
|
1062
|
+
/**
|
|
1063
|
+
* Structured diagnostics host — wraps `logs-sdk` and lets integrations
|
|
1064
|
+
* register their own coded errors/warnings into the shared logger.
|
|
1065
|
+
*/
|
|
1066
|
+
diagnostics: DevToolsDiagnosticsHost;
|
|
968
1067
|
commands: DevToolsCommandsHost;
|
|
969
1068
|
/**
|
|
970
1069
|
* Agent host — aggregates the agent-exposed surface of this devtool.
|
|
@@ -989,6 +1088,15 @@ interface DevToolsNodeUtils {
|
|
|
989
1088
|
interface ConnectionMeta {
|
|
990
1089
|
backend: 'websocket' | 'static';
|
|
991
1090
|
websocket?: number | string;
|
|
1091
|
+
/**
|
|
1092
|
+
* Names of RPC functions that have declared `jsonSerializable: true`.
|
|
1093
|
+
* Used by the WS / static client to dispatch the per-call wire
|
|
1094
|
+
* serializer (strict JSON for these methods, structured-clone for
|
|
1095
|
+
* the rest). Populated by the server / build adapter; absent on
|
|
1096
|
+
* legacy clients, in which case all outgoing messages fall back to
|
|
1097
|
+
* structured-clone.
|
|
1098
|
+
*/
|
|
1099
|
+
jsonSerializableMethods?: string[];
|
|
992
1100
|
}
|
|
993
1101
|
interface RemoteConnectionInfo extends ConnectionMeta {
|
|
994
1102
|
backend: 'websocket';
|
|
@@ -1122,4 +1230,4 @@ interface DevtoolDefinition {
|
|
|
1122
1230
|
}
|
|
1123
1231
|
declare function defineDevtool(d: DevtoolDefinition): DevtoolDefinition;
|
|
1124
1232
|
//#endregion
|
|
1125
|
-
export { DevToolsLogsHost as $, DevToolsViewHost as A,
|
|
1233
|
+
export { DevToolsLogsHost as $, EventsMap as $t, DevToolsViewHost as A, DevToolsDiagnosticsHost as At, DevToolsTerminalStatus as B, DevToolsServerCommandEntry as Bt, ImmutableSet as C, DevToolsViewLauncher as Ct, createSharedState as D, JsonRenderer as Dt, SharedStateOptions as E, JsonRenderSpec as Et, DevToolsChildProcessTerminalSession as F, DevToolsCommandHandle as Ft, DevToolsLogElementPosition as G, AgentResourceContent as Gt, DevToolsRpcClientFunctions as H, AgentHandle as Ht, DevToolsTerminalHost as I, DevToolsCommandKeybinding as It, DevToolsLogEntryInput as J, AgentToolInput as Jt, DevToolsLogEntry as K, AgentResourceInput as Kt, DevToolsTerminalSession as L, DevToolsCommandShortcutOverrides as Lt, PartialWithoutId as M, DevToolsClientCommand as Mt, Thenable as N, DevToolsCommandBase as Nt, Objectish as O, RemoteDockOptions as Ot, DevToolsChildProcessExecuteOptions as P, DevToolsCommandEntry as Pt, DevToolsLogsClient as Q, EventUnsubscribe as Qt, DevToolsTerminalSessionBase as R, DevToolsCommandsHost as Rt, ImmutableObject as S, DevToolsViewJsonRender as St, SharedStateEvents as T, JsonRenderElement as Tt, DevToolsRpcServerFunctions as U, AgentManifest as Ut, DevToolsDocksUserSettings as V, DevToolsServerCommandInput as Vt, DevToolsRpcSharedStates as W, AgentResource as Wt, DevToolsLogHandle as X, DevToolsAgentHostEvents as Xt, DevToolsLogFilePosition as Y, DevToolsAgentHost as Yt, DevToolsLogLevel as Z, EventEmitter as Zt, RpcSharedStateGetOptions as _, DevToolsDockUserEntry as _t, DevtoolRuntime as a, DevToolsMessageHandle as at, ImmutableArray as b, DevToolsViewCustomRender as bt, defineDevtool as c, DevToolsMessagesHost as ct, DevToolsNodeContext as d, DevToolsDockEntriesGrouped as dt, CliFlagsSchema as en, DevToolsMessageElementPosition as et, DevToolsNodeUtils as f, DevToolsDockEntry as ft, RpcFunctionsHost as g, DevToolsDockHost as gt, RpcBroadcastOptions as h, DevToolsDockEntryIcon as ht, DevtoolDeploymentKind as i, DevToolsMessageFilePosition as it, EntriesToObject as j, DevToolsDiagnosticsLogger as jt, Patch as k, DevToolsDiagnosticsDefinition as kt, ConnectionMeta as l, DevToolsHost as lt, DevToolsNodeRpcSession as m, DevToolsDockEntryCategory as mt, DevtoolCliOptions as n, defineCliFlags as nn, DevToolsMessageEntryFrom as nt, DevtoolSetupInfo as o, DevToolsMessageLevel as ot, RemoteConnectionInfo as p, DevToolsDockEntryBase as pt, DevToolsLogEntryFrom as q, AgentTool as qt, DevtoolDefinition as r, DevToolsMessageEntryInput as rt, DevtoolSpaOptions as s, DevToolsMessagesClient as st, DevtoolBrowserContext as t, InferCliFlags as tn, DevToolsMessageEntry as tt, DevToolsCapabilities as u, ClientScriptEntry as ut, RpcSharedStateHost as v, DevToolsViewAction as vt, SharedState as w, DevToolsViewLauncherStatus as wt, ImmutableMap as x, DevToolsViewIframe as xt, Immutable as y, DevToolsViewBuiltin as yt, DevToolsTerminalSessionStreamChunkEvent as z, DevToolsCommandsHostEvents as zt };
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
import { C as RpcReturnSchema, S as RpcFunctionsCollector, b as RpcFunctionSetupResult, c as RpcDumpClientOptions, g as RpcFunctionDefinitionAny, h as RpcFunctionDefinition, i as RpcArgsSchema, l as RpcDumpCollectionOptions, n as BirpcReturn, o as RpcDefinitionsToFunctions, p as RpcDumpStore, x as RpcFunctionType } from "./types-BkyzI9r4.mjs";
|
|
2
|
+
import { deserialize as structuredCloneDeserialize, parse as structuredCloneParse, serialize as structuredCloneSerialize, stringify as structuredCloneStringify } from "structured-clone-es";
|
|
3
|
+
|
|
4
|
+
//#region src/rpc/cache.d.ts
|
|
5
|
+
interface RpcCacheOptions {
|
|
6
|
+
functions: string[];
|
|
7
|
+
keySerializer?: (args: unknown[]) => string;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* @experimental API is expected to change.
|
|
11
|
+
*/
|
|
12
|
+
declare class RpcCacheManager {
|
|
13
|
+
private cacheMap;
|
|
14
|
+
private options;
|
|
15
|
+
private keySerializer;
|
|
16
|
+
constructor(options: RpcCacheOptions);
|
|
17
|
+
updateOptions(options: Partial<RpcCacheOptions>): void;
|
|
18
|
+
cached<T>(m: string, a: unknown[]): T | undefined;
|
|
19
|
+
apply(req: {
|
|
20
|
+
m: string;
|
|
21
|
+
a: unknown[];
|
|
22
|
+
}, res: unknown): void;
|
|
23
|
+
validate(m: string): boolean;
|
|
24
|
+
clear(fn?: string): void;
|
|
25
|
+
}
|
|
26
|
+
//#endregion
|
|
27
|
+
//#region src/rpc/collector.d.ts
|
|
28
|
+
declare class RpcFunctionsCollectorBase<LocalFunctions extends Record<string, any>, SetupContext> implements RpcFunctionsCollector<LocalFunctions, SetupContext> {
|
|
29
|
+
readonly context: SetupContext;
|
|
30
|
+
readonly definitions: Map<string, RpcFunctionDefinition<string, any, any, any, any, any, SetupContext>>;
|
|
31
|
+
readonly functions: LocalFunctions;
|
|
32
|
+
private readonly _onChanged;
|
|
33
|
+
constructor(context: SetupContext);
|
|
34
|
+
register(fn: RpcFunctionDefinition<string, any, any, any, any, any, SetupContext>, force?: boolean): void;
|
|
35
|
+
update(fn: RpcFunctionDefinition<string, any, any, any, any, any, SetupContext>, force?: boolean): void;
|
|
36
|
+
onChanged(fn: (id?: string) => void): () => void;
|
|
37
|
+
getHandler<T extends keyof LocalFunctions>(name: T): Promise<LocalFunctions[T]>;
|
|
38
|
+
getSchema<T extends keyof LocalFunctions>(name: T): {
|
|
39
|
+
args: RpcArgsSchema | undefined;
|
|
40
|
+
returns: RpcReturnSchema | undefined;
|
|
41
|
+
};
|
|
42
|
+
has(name: string): boolean;
|
|
43
|
+
get(name: string): RpcFunctionDefinition<string, any, any, any, any, any, SetupContext> | undefined;
|
|
44
|
+
list(): string[];
|
|
45
|
+
}
|
|
46
|
+
//#endregion
|
|
47
|
+
//#region src/rpc/define.d.ts
|
|
48
|
+
declare function 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>): RpcFunctionDefinition<NAME, TYPE, ARGS, RETURN, AS, RS>;
|
|
49
|
+
declare function createDefineWrapperWithContext<CONTEXT>(): <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, CONTEXT>) => RpcFunctionDefinition<NAME, TYPE, ARGS, RETURN, AS, RS, CONTEXT>;
|
|
50
|
+
//#endregion
|
|
51
|
+
//#region src/rpc/dumps.d.ts
|
|
52
|
+
/**
|
|
53
|
+
* Collects pre-computed dumps by executing functions with their defined input combinations.
|
|
54
|
+
* Static functions without dump config automatically get `{ inputs: [[]] }`.
|
|
55
|
+
*
|
|
56
|
+
* @example
|
|
57
|
+
* ```ts
|
|
58
|
+
* const store = await dumpFunctions([greet], context, { concurrency: 10 })
|
|
59
|
+
* ```
|
|
60
|
+
*/
|
|
61
|
+
declare function dumpFunctions<T extends readonly RpcFunctionDefinitionAny[]>(definitions: T, context?: any, options?: RpcDumpCollectionOptions): Promise<RpcDumpStore<RpcDefinitionsToFunctions<T>>>;
|
|
62
|
+
/**
|
|
63
|
+
* Creates a client that serves pre-computed results from a dump store.
|
|
64
|
+
* Uses argument hashing to match calls to stored records.
|
|
65
|
+
*
|
|
66
|
+
* @example
|
|
67
|
+
* ```ts
|
|
68
|
+
* const client = createClientFromDump(store)
|
|
69
|
+
* await client.greet('Alice')
|
|
70
|
+
* ```
|
|
71
|
+
*/
|
|
72
|
+
declare function createClientFromDump<T extends Record<string, any>>(store: RpcDumpStore<T>, options?: RpcDumpClientOptions): BirpcReturn<T>;
|
|
73
|
+
/**
|
|
74
|
+
* Filters function definitions to only those with dump definitions.
|
|
75
|
+
* Note: Only checks the definition itself, not setup results.
|
|
76
|
+
*/
|
|
77
|
+
declare function getDefinitionsWithDumps<T extends readonly RpcFunctionDefinitionAny[]>(definitions: T): RpcFunctionDefinitionAny[];
|
|
78
|
+
//#endregion
|
|
79
|
+
//#region src/rpc/handler.d.ts
|
|
80
|
+
declare function getRpcResolvedSetupResult<NAME extends string, TYPE extends RpcFunctionType, ARGS extends any[], RETURN = void, CONTEXT = undefined>(definition: RpcFunctionDefinition<NAME, TYPE, ARGS, RETURN, any, any, CONTEXT>, context: CONTEXT): Promise<RpcFunctionSetupResult<ARGS, RETURN>>;
|
|
81
|
+
declare function getRpcHandler<NAME extends string, TYPE extends RpcFunctionType, ARGS extends any[], RETURN = void, CONTEXT = undefined>(definition: RpcFunctionDefinition<NAME, TYPE, ARGS, RETURN, any, any, CONTEXT>, context: CONTEXT): Promise<(...args: ARGS) => RETURN>;
|
|
82
|
+
//#endregion
|
|
83
|
+
//#region src/rpc/serialization.d.ts
|
|
84
|
+
/**
|
|
85
|
+
* Wire format used by the WS RPC transport.
|
|
86
|
+
*
|
|
87
|
+
* - **JSON (default, unprefixed):** payload is plain JSON text. Used when
|
|
88
|
+
* the dispatched method is declared `jsonSerializable: true`. Encoded
|
|
89
|
+
* via {@link strictJsonStringify} (rejects non-JSON values), decoded
|
|
90
|
+
* via `JSON.parse`.
|
|
91
|
+
* - **Structured-clone (`s:` prefix):** payload is `s:` followed by
|
|
92
|
+
* `structured-clone-es` text. Used when the method is declared
|
|
93
|
+
* `jsonSerializable: false` (or omitted, the default). Round-trips
|
|
94
|
+
* `Map`, `Set`, `Date`, `BigInt`, cycles, and class instances.
|
|
95
|
+
*
|
|
96
|
+
* birpc envelopes always start with `{`, so a leading byte that is not
|
|
97
|
+
* `s` is unambiguously JSON. Each direction independently chooses its
|
|
98
|
+
* encoding from local definitions — request and response are not
|
|
99
|
+
* coupled by a mirror rule.
|
|
100
|
+
*/
|
|
101
|
+
declare const STRUCTURED_CLONE_PREFIX = "s:";
|
|
102
|
+
/**
|
|
103
|
+
* `JSON.stringify` with a single-pass strict replacer.
|
|
104
|
+
*
|
|
105
|
+
* Throws `DF0020` synchronously when the value contains a type JSON
|
|
106
|
+
* cannot round-trip losslessly: `Map`, `Set`, `Date`, `BigInt`, class
|
|
107
|
+
* instances, or `undefined` inside an array (silently becomes `null`).
|
|
108
|
+
*
|
|
109
|
+
* Native pass-throughs (no extra work needed):
|
|
110
|
+
* - circular references — `JSON.stringify` raises `TypeError`.
|
|
111
|
+
* - `BigInt` at top level — caught here for a friendlier error path.
|
|
112
|
+
*
|
|
113
|
+
* Lenient cases (allowed without throwing):
|
|
114
|
+
* - `undefined` as an object property — legitimate optional field;
|
|
115
|
+
* JSON.stringify just omits it.
|
|
116
|
+
* - `undefined` at the root — legitimate "action returned nothing".
|
|
117
|
+
* - `Symbol` / `Function` values — semantically "drop me" in JSON.
|
|
118
|
+
*
|
|
119
|
+
* `fnName` is used only for the diagnostic message — pass the RPC
|
|
120
|
+
* function name when calling from a wire serializer / dump writer so
|
|
121
|
+
* the error points at the offending function.
|
|
122
|
+
*/
|
|
123
|
+
declare function strictJsonStringify(value: unknown, fnName?: string): string;
|
|
124
|
+
//#endregion
|
|
125
|
+
//#region src/rpc/validation.d.ts
|
|
126
|
+
/**
|
|
127
|
+
* Validates RPC function definitions.
|
|
128
|
+
* Action and event functions cannot have dumps (side effects should not be cached).
|
|
129
|
+
*
|
|
130
|
+
* @throws {Error} If an action or event function has a dump configuration
|
|
131
|
+
*/
|
|
132
|
+
declare function validateDefinitions(definitions: readonly RpcFunctionDefinitionAny[]): void;
|
|
133
|
+
/**
|
|
134
|
+
* Validates a single RPC function definition.
|
|
135
|
+
*
|
|
136
|
+
* @throws {Error} If an action or event function has a dump configuration
|
|
137
|
+
*/
|
|
138
|
+
declare function validateDefinition(definition: RpcFunctionDefinitionAny): void;
|
|
139
|
+
//#endregion
|
|
140
|
+
export { RpcCacheManager as _, structuredCloneDeserialize as a, structuredCloneStringify as c, createClientFromDump as d, dumpFunctions as f, RpcFunctionsCollectorBase as g, defineRpcFunction as h, strictJsonStringify as i, getRpcHandler as l, createDefineWrapperWithContext as m, validateDefinitions as n, structuredCloneParse as o, getDefinitionsWithDumps as p, STRUCTURED_CLONE_PREFIX as r, structuredCloneSerialize as s, validateDefinition as t, getRpcResolvedSetupResult as u, RpcCacheOptions as v };
|
package/dist/index.d.mts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { $ as DevToolsLogsHost, A as DevToolsViewHost, At as
|
|
2
|
-
import {
|
|
3
|
-
import { t as DevToolsNodeRpcSessionMeta } from "./ws-server
|
|
1
|
+
import { $ as DevToolsLogsHost, $t as EventsMap, A as DevToolsViewHost, At as DevToolsDiagnosticsHost, B as DevToolsTerminalStatus, Bt as DevToolsServerCommandEntry, Ct as DevToolsViewLauncher, Dt as JsonRenderer, Et as JsonRenderSpec, F as DevToolsChildProcessTerminalSession, Ft as DevToolsCommandHandle, G as DevToolsLogElementPosition, Gt as AgentResourceContent, H as DevToolsRpcClientFunctions, Ht as AgentHandle, I as DevToolsTerminalHost, It as DevToolsCommandKeybinding, J as DevToolsLogEntryInput, Jt as AgentToolInput, K as DevToolsLogEntry, Kt as AgentResourceInput, L as DevToolsTerminalSession, Lt as DevToolsCommandShortcutOverrides, M as PartialWithoutId, Mt as DevToolsClientCommand, N as Thenable, Nt as DevToolsCommandBase, Ot as RemoteDockOptions, P as DevToolsChildProcessExecuteOptions, Pt as DevToolsCommandEntry, Q as DevToolsLogsClient, Qt as EventUnsubscribe, R as DevToolsTerminalSessionBase, Rt as DevToolsCommandsHost, St as DevToolsViewJsonRender, Tt as JsonRenderElement, U as DevToolsRpcServerFunctions, Ut as AgentManifest, V as DevToolsDocksUserSettings, Vt as DevToolsServerCommandInput, W as DevToolsRpcSharedStates, Wt as AgentResource, X as DevToolsLogHandle, Xt as DevToolsAgentHostEvents, Y as DevToolsLogFilePosition, Yt as DevToolsAgentHost, Z as DevToolsLogLevel, Zt as EventEmitter, _ as RpcSharedStateGetOptions, _t as DevToolsDockUserEntry, a as DevtoolRuntime, at as DevToolsMessageHandle, bt as DevToolsViewCustomRender, c as defineDevtool, ct as DevToolsMessagesHost, d as DevToolsNodeContext, dt as DevToolsDockEntriesGrouped, en as CliFlagsSchema, et as DevToolsMessageElementPosition, f as DevToolsNodeUtils, ft as DevToolsDockEntry, g as RpcFunctionsHost, gt as DevToolsDockHost, h as RpcBroadcastOptions, ht as DevToolsDockEntryIcon, i as DevtoolDeploymentKind, it as DevToolsMessageFilePosition, j as EntriesToObject, jt as DevToolsDiagnosticsLogger, kt as DevToolsDiagnosticsDefinition, l as ConnectionMeta, lt as DevToolsHost, m as DevToolsNodeRpcSession, mt as DevToolsDockEntryCategory, n as DevtoolCliOptions, nn as defineCliFlags, nt as DevToolsMessageEntryFrom, o as DevtoolSetupInfo, ot as DevToolsMessageLevel, p as RemoteConnectionInfo, pt as DevToolsDockEntryBase, q as DevToolsLogEntryFrom, qt as AgentTool, r as DevtoolDefinition, rt as DevToolsMessageEntryInput, s as DevtoolSpaOptions, st as DevToolsMessagesClient, t as DevtoolBrowserContext, tn as InferCliFlags, tt as DevToolsMessageEntry, u as DevToolsCapabilities, ut as ClientScriptEntry, v as RpcSharedStateHost, vt as DevToolsViewAction, wt as DevToolsViewLauncherStatus, xt as DevToolsViewIframe, yt as DevToolsViewBuiltin, z as DevToolsTerminalSessionStreamChunkEvent, zt as DevToolsCommandsHostEvents } from "./devtool-CHT-4_OU.mjs";
|
|
2
|
+
import { C as RpcReturnSchema, h as RpcFunctionDefinition, i as RpcArgsSchema, m as RpcFunctionAgentOptions, x as RpcFunctionType } from "./types-BkyzI9r4.mjs";
|
|
3
|
+
import { t as DevToolsNodeRpcSessionMeta } from "./ws-server-Cu8tmZcF.mjs";
|
|
4
4
|
|
|
5
5
|
//#region src/define.d.ts
|
|
6
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, DevToolsNodeContext>) => RpcFunctionDefinition<NAME, TYPE, ARGS, RETURN, AS, RS, DevToolsNodeContext>;
|
|
7
7
|
declare function defineCommand(command: DevToolsServerCommandInput): DevToolsServerCommandInput;
|
|
8
8
|
declare function defineJsonRenderSpec(spec: JsonRenderSpec): JsonRenderSpec;
|
|
9
9
|
//#endregion
|
|
10
|
-
export { AgentHandle, AgentManifest, AgentResource, AgentResourceContent, AgentResourceInput, AgentTool, AgentToolInput, type CliFlagsSchema, ClientScriptEntry, ConnectionMeta, DevToolsAgentHost, DevToolsAgentHostEvents, DevToolsCapabilities, DevToolsChildProcessExecuteOptions, DevToolsChildProcessTerminalSession, DevToolsClientCommand, DevToolsCommandBase, DevToolsCommandEntry, DevToolsCommandHandle, DevToolsCommandKeybinding, DevToolsCommandShortcutOverrides, DevToolsCommandsHost, DevToolsCommandsHostEvents, DevToolsDockEntriesGrouped, DevToolsDockEntry, DevToolsDockEntryBase, DevToolsDockEntryCategory, DevToolsDockEntryIcon, DevToolsDockHost, DevToolsDockUserEntry, DevToolsDocksUserSettings, DevToolsHost, DevToolsLogElementPosition, DevToolsLogEntry, DevToolsLogEntryFrom, DevToolsLogEntryInput, DevToolsLogFilePosition, DevToolsLogHandle, DevToolsLogLevel, DevToolsLogsClient, DevToolsLogsHost, DevToolsNodeContext, DevToolsNodeRpcSession, DevToolsNodeRpcSessionMeta, DevToolsNodeUtils, DevToolsRpcClientFunctions, DevToolsRpcServerFunctions, DevToolsRpcSharedStates, DevToolsServerCommandEntry, DevToolsServerCommandInput, DevToolsTerminalHost, DevToolsTerminalSession, DevToolsTerminalSessionBase, DevToolsTerminalSessionStreamChunkEvent, DevToolsTerminalStatus, DevToolsViewAction, DevToolsViewBuiltin, DevToolsViewCustomRender, DevToolsViewHost, DevToolsViewIframe, DevToolsViewJsonRender, DevToolsViewLauncher, DevToolsViewLauncherStatus, DevtoolBrowserContext, DevtoolCliOptions, DevtoolDefinition, DevtoolDeploymentKind, DevtoolRuntime, DevtoolSetupInfo, DevtoolSpaOptions, EntriesToObject, EventEmitter, EventUnsubscribe, EventsMap, type InferCliFlags, JsonRenderElement, JsonRenderSpec, JsonRenderer, PartialWithoutId, RemoteConnectionInfo, RemoteDockOptions, RpcBroadcastOptions, RpcFunctionAgentOptions, RpcFunctionsHost, RpcSharedStateGetOptions, RpcSharedStateHost, Thenable, defineCliFlags, defineCommand, defineDevtool, defineJsonRenderSpec, defineRpcFunction };
|
|
10
|
+
export { AgentHandle, AgentManifest, AgentResource, AgentResourceContent, AgentResourceInput, AgentTool, AgentToolInput, type CliFlagsSchema, ClientScriptEntry, ConnectionMeta, DevToolsAgentHost, DevToolsAgentHostEvents, DevToolsCapabilities, DevToolsChildProcessExecuteOptions, DevToolsChildProcessTerminalSession, DevToolsClientCommand, DevToolsCommandBase, DevToolsCommandEntry, DevToolsCommandHandle, DevToolsCommandKeybinding, DevToolsCommandShortcutOverrides, DevToolsCommandsHost, DevToolsCommandsHostEvents, DevToolsDiagnosticsDefinition, DevToolsDiagnosticsHost, DevToolsDiagnosticsLogger, DevToolsDockEntriesGrouped, DevToolsDockEntry, DevToolsDockEntryBase, DevToolsDockEntryCategory, DevToolsDockEntryIcon, DevToolsDockHost, DevToolsDockUserEntry, DevToolsDocksUserSettings, DevToolsHost, DevToolsLogElementPosition, DevToolsLogEntry, DevToolsLogEntryFrom, DevToolsLogEntryInput, DevToolsLogFilePosition, DevToolsLogHandle, DevToolsLogLevel, DevToolsLogsClient, DevToolsLogsHost, DevToolsMessageElementPosition, DevToolsMessageEntry, DevToolsMessageEntryFrom, DevToolsMessageEntryInput, DevToolsMessageFilePosition, DevToolsMessageHandle, DevToolsMessageLevel, DevToolsMessagesClient, DevToolsMessagesHost, DevToolsNodeContext, DevToolsNodeRpcSession, DevToolsNodeRpcSessionMeta, DevToolsNodeUtils, DevToolsRpcClientFunctions, DevToolsRpcServerFunctions, DevToolsRpcSharedStates, DevToolsServerCommandEntry, DevToolsServerCommandInput, DevToolsTerminalHost, DevToolsTerminalSession, DevToolsTerminalSessionBase, DevToolsTerminalSessionStreamChunkEvent, DevToolsTerminalStatus, DevToolsViewAction, DevToolsViewBuiltin, DevToolsViewCustomRender, DevToolsViewHost, DevToolsViewIframe, DevToolsViewJsonRender, DevToolsViewLauncher, DevToolsViewLauncherStatus, DevtoolBrowserContext, DevtoolCliOptions, DevtoolDefinition, DevtoolDeploymentKind, DevtoolRuntime, DevtoolSetupInfo, DevtoolSpaOptions, EntriesToObject, EventEmitter, EventUnsubscribe, EventsMap, type InferCliFlags, JsonRenderElement, JsonRenderSpec, JsonRenderer, PartialWithoutId, RemoteConnectionInfo, RemoteDockOptions, RpcBroadcastOptions, RpcFunctionAgentOptions, RpcFunctionsHost, RpcSharedStateGetOptions, RpcSharedStateHost, Thenable, defineCliFlags, defineCommand, defineDevtool, defineJsonRenderSpec, defineRpcFunction };
|
package/dist/index.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { i as defineCliFlags, n as defineJsonRenderSpec, r as defineRpcFunction, t as defineCommand } from "./src-
|
|
1
|
+
import { i as defineCliFlags, n as defineJsonRenderSpec, r as defineRpcFunction, t as defineCommand } from "./src-DIKqQIjp.mjs";
|
|
2
2
|
export { defineCliFlags, defineCommand, defineJsonRenderSpec, defineRpcFunction };
|
package/dist/node/index.d.mts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { A as DevToolsViewHost$1, At as DevToolsDiagnosticsHost$1, Bt as DevToolsServerCommandEntry, F as DevToolsChildProcessTerminalSession, Ft as DevToolsCommandHandle, Gt as AgentResourceContent, H as DevToolsRpcClientFunctions, Ht as AgentHandle, I as DevToolsTerminalHost$1, Jt as AgentToolInput, Kt as AgentResourceInput, L as DevToolsTerminalSession, M as PartialWithoutId, P as DevToolsChildProcessExecuteOptions, R as DevToolsTerminalSessionBase, Rt as DevToolsCommandsHost$1, U as DevToolsRpcServerFunctions, Ut as AgentManifest, V as DevToolsDocksUserSettings, Vt as DevToolsServerCommandInput, Wt as AgentResource, Xt as DevToolsAgentHostEvents, Yt as DevToolsAgentHost$1, Zt as EventEmitter, _t as DevToolsDockUserEntry, at as DevToolsMessageHandle, ct as DevToolsMessagesHost$1, d as DevToolsNodeContext, ft as DevToolsDockEntry, g as RpcFunctionsHost$1, gt as DevToolsDockHost$1, h as RpcBroadcastOptions, jt as DevToolsDiagnosticsLogger, lt as DevToolsHost, m as DevToolsNodeRpcSession, qt as AgentTool, rt as DevToolsMessageEntryInput, tt as DevToolsMessageEntry, ut as ClientScriptEntry, v as RpcSharedStateHost, w as SharedState } from "../devtool-CHT-4_OU.mjs";
|
|
2
|
+
import { g as RpcFunctionsCollectorBase } from "../index-Cei8vVcd.mjs";
|
|
3
|
+
import { g as RpcFunctionDefinitionAny } from "../types-BkyzI9r4.mjs";
|
|
4
|
+
import { createLogger, defineDiagnostics } from "logs-sdk";
|
|
3
5
|
import { BirpcGroup } from "birpc";
|
|
4
6
|
import { WebSocketServer } from "ws";
|
|
5
7
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
@@ -168,6 +170,19 @@ declare class DevToolsCommandsHost implements DevToolsCommandsHost$1 {
|
|
|
168
170
|
private toSerializable;
|
|
169
171
|
}
|
|
170
172
|
//#endregion
|
|
173
|
+
//#region src/node/host-diagnostics.d.ts
|
|
174
|
+
declare class DevToolsDiagnosticsHost implements DevToolsDiagnosticsHost$1 {
|
|
175
|
+
readonly context: DevToolsNodeContext;
|
|
176
|
+
private _definitions;
|
|
177
|
+
private _logger;
|
|
178
|
+
readonly defineDiagnostics: typeof defineDiagnostics;
|
|
179
|
+
readonly createLogger: typeof createLogger;
|
|
180
|
+
constructor(context: DevToolsNodeContext, initialDefinitions?: unknown[]);
|
|
181
|
+
get logger(): DevToolsDiagnosticsLogger;
|
|
182
|
+
register(definitions: unknown): void;
|
|
183
|
+
private _rebuild;
|
|
184
|
+
}
|
|
185
|
+
//#endregion
|
|
171
186
|
//#region src/node/host-docks.d.ts
|
|
172
187
|
declare class DevToolsDockHost implements DevToolsDockHost$1 {
|
|
173
188
|
readonly context: DevToolsNodeContext;
|
|
@@ -229,11 +244,11 @@ interface CreateH3DevToolsHostOptions {
|
|
|
229
244
|
*/
|
|
230
245
|
declare function createH3DevToolsHost(options: CreateH3DevToolsHostOptions): DevToolsHost;
|
|
231
246
|
//#endregion
|
|
232
|
-
//#region src/node/host-
|
|
233
|
-
declare class
|
|
247
|
+
//#region src/node/host-messages.d.ts
|
|
248
|
+
declare class DevToolsMessagesHost implements DevToolsMessagesHost$1 {
|
|
234
249
|
readonly context: DevToolsNodeContext;
|
|
235
|
-
readonly entries:
|
|
236
|
-
readonly events:
|
|
250
|
+
readonly entries: DevToolsMessagesHost$1['entries'];
|
|
251
|
+
readonly events: DevToolsMessagesHost$1['events'];
|
|
237
252
|
/** Tracks when each entry was last added or updated (monotonic) */
|
|
238
253
|
readonly lastModified: Map<string, number>;
|
|
239
254
|
/** Tracks recently removed entry IDs with their removal time */
|
|
@@ -245,8 +260,8 @@ declare class DevToolsLogsHost implements DevToolsLogsHost$1 {
|
|
|
245
260
|
private _clock;
|
|
246
261
|
private _tick;
|
|
247
262
|
constructor(context: DevToolsNodeContext);
|
|
248
|
-
add(input:
|
|
249
|
-
update(id: string, patch: Partial<
|
|
263
|
+
add(input: DevToolsMessageEntryInput): Promise<DevToolsMessageHandle>;
|
|
264
|
+
update(id: string, patch: Partial<DevToolsMessageEntryInput>): Promise<DevToolsMessageEntry | undefined>;
|
|
250
265
|
remove(id: string): Promise<void>;
|
|
251
266
|
clear(): Promise<void>;
|
|
252
267
|
private _createHandle;
|
|
@@ -332,20 +347,33 @@ interface StartedServer {
|
|
|
332
347
|
declare function startHttpAndWs(options: StartHttpAndWsOptions): Promise<StartedServer>;
|
|
333
348
|
//#endregion
|
|
334
349
|
//#region src/node/static-dump.d.ts
|
|
350
|
+
type StaticRpcDumpSerialization = 'json' | 'structured-clone';
|
|
335
351
|
interface StaticRpcDumpManifestStaticEntry {
|
|
336
352
|
type: 'static';
|
|
337
353
|
path: string;
|
|
354
|
+
/** Encoder used when this entry's file was written. Default: `'json'`. */
|
|
355
|
+
serialization?: StaticRpcDumpSerialization;
|
|
338
356
|
}
|
|
339
357
|
interface StaticRpcDumpManifestQueryEntry {
|
|
340
358
|
type: 'query';
|
|
341
359
|
records: Record<string, string>;
|
|
342
360
|
fallback?: string;
|
|
361
|
+
/** Encoder used when each record/fallback file was written. Default: `'json'`. */
|
|
362
|
+
serialization?: StaticRpcDumpSerialization;
|
|
343
363
|
}
|
|
344
364
|
type StaticRpcDumpManifestValue = StaticRpcDumpManifestStaticEntry | StaticRpcDumpManifestQueryEntry | any;
|
|
345
365
|
type StaticRpcDumpManifest = Record<string, StaticRpcDumpManifestValue>;
|
|
366
|
+
interface StaticRpcDumpFile {
|
|
367
|
+
/** Whether this file was written via `JSON.stringify` or `structured-clone-es.stringify`. */
|
|
368
|
+
serialization: StaticRpcDumpSerialization;
|
|
369
|
+
/** Function name the file belongs to — used to scope `DF0019` errors during write. */
|
|
370
|
+
fnName: string;
|
|
371
|
+
/** Payload to encode. */
|
|
372
|
+
data: unknown;
|
|
373
|
+
}
|
|
346
374
|
interface StaticRpcDumpCollection {
|
|
347
375
|
manifest: StaticRpcDumpManifest;
|
|
348
|
-
files: Record<string,
|
|
376
|
+
files: Record<string, StaticRpcDumpFile>;
|
|
349
377
|
}
|
|
350
378
|
declare function collectStaticRpcDump(definitions: Iterable<RpcFunctionDefinitionAny>, context: any): Promise<StaticRpcDumpCollection>;
|
|
351
379
|
//#endregion
|
|
@@ -362,4 +390,4 @@ declare function createStorage<T extends object>(options: CreateStorageOptions<T
|
|
|
362
390
|
declare function isObject(value: unknown): value is Record<string, any>;
|
|
363
391
|
declare function normalizeHttpServerUrl(host: string, port: number | string): string;
|
|
364
392
|
//#endregion
|
|
365
|
-
export { ContextUtils, CreateH3DevToolsHostOptions, CreateHostContextOptions, CreateStorageOptions, DevToolsAgentHost, DevToolsCommandsHost, DevToolsDockHost, DevToolsInternalContext,
|
|
393
|
+
export { ContextUtils, CreateH3DevToolsHostOptions, CreateHostContextOptions, CreateStorageOptions, DevToolsAgentHost, DevToolsCommandsHost, DevToolsDiagnosticsHost, DevToolsDockHost, DevToolsInternalContext, DevToolsMessagesHost, DevToolsTerminalHost, DevToolsViewHost, InternalAnonymousAuthStorage, PendingAuthRequest, RemoteTokenRecord, RpcFunctionsHost, StartHttpAndWsOptions, StartedServer, StaticRpcDumpCollection, StaticRpcDumpFile, StaticRpcDumpManifest, StaticRpcDumpManifestQueryEntry, StaticRpcDumpManifestStaticEntry, StaticRpcDumpManifestValue, StaticRpcDumpSerialization, abortPendingAuth, collectStaticRpcDump, consumeTempAuthToken, createH3DevToolsHost, createHostContext, createRpcSharedStateServerHost, createStorage, getInternalContext, getPendingAuth, getTempAuthToken, internalContextMap, isObject, normalizeHttpServerUrl, refreshTempAuthToken, revokeActiveConnectionsForToken, revokeAuthToken, setPendingAuth, startHttpAndWs };
|