devframe 0.2.2 → 0.3.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/dist/adapters/build.d.mts +1 -1
- package/dist/adapters/build.mjs +5 -5
- package/dist/adapters/cli.d.mts +1 -1
- package/dist/adapters/cli.mjs +2 -2
- package/dist/adapters/dev.d.mts +2 -2
- package/dist/adapters/dev.mjs +1 -1
- package/dist/adapters/embedded.d.mts +1 -1
- package/dist/adapters/mcp.d.mts +1 -1
- package/dist/adapters/mcp.mjs +8 -7
- package/dist/client/index.d.mts +18 -4
- package/dist/client/index.mjs +321 -8
- package/dist/{context-BDpuScNZ.d.mts → context-CwjX6sCG.d.mts} +1 -1
- package/dist/{dev-CZ9ZQkuO.mjs → dev-BbmanqL7.mjs} +1 -1
- package/dist/{devframe-DAfZWnpI.d.mts → devframe-sc4cb5xr.d.mts} +48 -90
- package/dist/diagnostics-GitRGKbr.mjs +33 -0
- package/dist/diagnostics-reporter-CBBZwoMv.mjs +38 -0
- package/dist/{rpc-BlVCyk9W.mjs → dump-zMleojnD.mjs} +147 -134
- package/dist/helpers/vite.d.mts +1 -1
- package/dist/helpers/vite.mjs +6 -5
- package/dist/{host-h3-DEfOpa0j.mjs → host-h3-TTunNr_n.mjs} +284 -44
- package/dist/human-id-Dq-qgtES.mjs +803 -0
- package/dist/index-C5PmWqBf.d.mts +79 -0
- package/dist/{index-BNAsgVNz.d.mts → index-CTK6fuXs.d.mts} +31 -78
- package/dist/index-DTeZXHSi.d.mts +639 -0
- package/dist/index.d.mts +4 -4
- package/dist/node/auth.d.mts +2 -2
- package/dist/node/auth.mjs +1 -2
- package/dist/node/index.d.mts +10 -14
- package/dist/node/index.mjs +2 -2
- package/dist/node/internal.d.mts +2 -2
- package/dist/node/internal.mjs +2 -3
- package/dist/recipes/open-helpers.d.mts +1 -1
- package/dist/rpc/dump.d.mts +2 -0
- package/dist/rpc/dump.mjs +2 -0
- package/dist/rpc/index.d.mts +2 -2
- package/dist/rpc/index.mjs +128 -2
- package/dist/rpc/transports/ws-client.d.mts +25 -1
- package/dist/rpc/transports/ws-client.mjs +2 -2
- package/dist/rpc/transports/ws-server.d.mts +1 -1
- package/dist/rpc/transports/ws-server.mjs +2 -2
- package/dist/{serialization-CwO31axa.mjs → serialization-BlqLh4_J.mjs} +4 -38
- package/dist/{server-BGSrxsQb.d.mts → server-ouL4gZbu.d.mts} +1 -1
- package/dist/shared-state-CasqoUba.mjs +1019 -0
- package/dist/{shared-state-BJXkPxtf.mjs → shared-state-u0y123fi.mjs} +6 -6
- package/dist/{storage-D-jLaxDA.mjs → storage-K-OxR1xf.mjs} +5 -3
- package/dist/structured-clone-jegjz0hM.mjs +208 -0
- package/dist/types/index.d.mts +4 -4
- package/dist/utils/events.d.mts +1 -1
- package/dist/utils/hash.mjs +1 -1
- package/dist/utils/shared-state.d.mts +1 -1
- package/dist/utils/shared-state.mjs +1 -1
- package/dist/utils/streaming-channel.d.mts +1 -1
- package/dist/utils/structured-clone.mjs +1 -1
- package/dist/{ws-server-DKlqI8XP.d.mts → ws-server-DOwLJL23.d.mts} +1 -1
- package/package.json +3 -2
- package/skills/devframe/SKILL.md +1 -1
- package/dist/diagnostics-DNxVjo6X.mjs +0 -56
- package/dist/revoke-DDa7VSJa.mjs +0 -35
- package/dist/ws-client-CrLsflnY.d.mts +0 -26
- /package/dist/{hash-CIBte1yS.mjs → hash-bwOD8RgU.mjs} +0 -0
- /package/dist/{structured-clone-CD2l4fI3.mjs → structured-clone-PdCZwt7F.mjs} +0 -0
- /package/dist/{types-DmcujDa5.d.mts → types-BXL7EIDM.d.mts} +0 -0
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { _ as RpcFunctionDefinitionAny, c as RpcDumpClientOptions, l as RpcDumpCollectionOptions, m as RpcDumpStore, n as BirpcReturn, o as RpcDefinitionsToFunctions, p as RpcDumpRecordError } from "./types-BXL7EIDM.mjs";
|
|
2
|
+
|
|
3
|
+
//#region src/rpc/dump/static.d.ts
|
|
4
|
+
type StaticRpcDumpSerialization = 'json' | 'structured-clone';
|
|
5
|
+
interface StaticRpcDumpManifestStaticEntry {
|
|
6
|
+
type: 'static';
|
|
7
|
+
path: string;
|
|
8
|
+
/** Encoder used when this entry's file was written. Default: `'json'`. */
|
|
9
|
+
serialization?: StaticRpcDumpSerialization;
|
|
10
|
+
}
|
|
11
|
+
interface StaticRpcDumpManifestQueryEntry {
|
|
12
|
+
type: 'query';
|
|
13
|
+
records: Record<string, string>;
|
|
14
|
+
fallback?: string;
|
|
15
|
+
/** Encoder used when each record/fallback file was written. Default: `'json'`. */
|
|
16
|
+
serialization?: StaticRpcDumpSerialization;
|
|
17
|
+
}
|
|
18
|
+
type StaticRpcDumpManifestValue = StaticRpcDumpManifestStaticEntry | StaticRpcDumpManifestQueryEntry | any;
|
|
19
|
+
type StaticRpcDumpManifest = Record<string, StaticRpcDumpManifestValue>;
|
|
20
|
+
interface StaticRpcDumpFile {
|
|
21
|
+
/** Whether this file was written via `JSON.stringify` or `structured-clone-es.stringify`. */
|
|
22
|
+
serialization: StaticRpcDumpSerialization;
|
|
23
|
+
/** Function name the file belongs to — used to scope `DF0019` errors during write. */
|
|
24
|
+
fnName: string;
|
|
25
|
+
/** Payload to encode. */
|
|
26
|
+
data: unknown;
|
|
27
|
+
}
|
|
28
|
+
interface StaticRpcDumpCollection {
|
|
29
|
+
manifest: StaticRpcDumpManifest;
|
|
30
|
+
files: Record<string, StaticRpcDumpFile>;
|
|
31
|
+
}
|
|
32
|
+
declare function collectStaticRpcDump(definitions: Iterable<RpcFunctionDefinitionAny>, context: any): Promise<StaticRpcDumpCollection>;
|
|
33
|
+
//#endregion
|
|
34
|
+
//#region src/rpc/dump/collect.d.ts
|
|
35
|
+
/**
|
|
36
|
+
* Collects pre-computed dumps by executing functions with their defined input combinations.
|
|
37
|
+
* Static functions without dump config automatically get `{ inputs: [[]] }`.
|
|
38
|
+
*
|
|
39
|
+
* @example
|
|
40
|
+
* ```ts
|
|
41
|
+
* const store = await dumpFunctions([greet], context, { concurrency: 10 })
|
|
42
|
+
* ```
|
|
43
|
+
*/
|
|
44
|
+
declare function dumpFunctions<T extends readonly RpcFunctionDefinitionAny[]>(definitions: T, context?: any, options?: RpcDumpCollectionOptions): Promise<RpcDumpStore<RpcDefinitionsToFunctions<T>>>;
|
|
45
|
+
/**
|
|
46
|
+
* Creates a client that serves pre-computed results from a dump store.
|
|
47
|
+
* Uses argument hashing to match calls to stored records.
|
|
48
|
+
*
|
|
49
|
+
* @example
|
|
50
|
+
* ```ts
|
|
51
|
+
* const client = createClientFromDump(store)
|
|
52
|
+
* await client.greet('Alice')
|
|
53
|
+
* ```
|
|
54
|
+
*/
|
|
55
|
+
declare function createClientFromDump<T extends Record<string, any>>(store: RpcDumpStore<T>, options?: RpcDumpClientOptions): BirpcReturn<T>;
|
|
56
|
+
/**
|
|
57
|
+
* Filters function definitions to only those with dump definitions.
|
|
58
|
+
* Note: Only checks the definition itself, not setup results.
|
|
59
|
+
*/
|
|
60
|
+
declare function getDefinitionsWithDumps<T extends readonly RpcFunctionDefinitionAny[]>(definitions: T): RpcFunctionDefinitionAny[];
|
|
61
|
+
//#endregion
|
|
62
|
+
//#region src/rpc/dump/error.d.ts
|
|
63
|
+
/**
|
|
64
|
+
* Normalize a thrown value into a plain object suitable for storage in
|
|
65
|
+
* a dump record. Preserves `message`, `name`, `cause`, and any own
|
|
66
|
+
* enumerable properties of an `Error` so consumers reading the dump can
|
|
67
|
+
* reconstruct a richer Error than just `{ message, name }`.
|
|
68
|
+
*
|
|
69
|
+
* Non-`Error` throws are wrapped as `{ name: 'Error', message: String(thrown) }`.
|
|
70
|
+
*/
|
|
71
|
+
declare function serializeDumpError(error: unknown): RpcDumpRecordError;
|
|
72
|
+
/**
|
|
73
|
+
* Inverse of {@link serializeDumpError}: rebuild a thrown `Error` from
|
|
74
|
+
* the plain object stored in a dump record. Preserves `cause`, restores
|
|
75
|
+
* the original `name`, and re-attaches any custom own properties.
|
|
76
|
+
*/
|
|
77
|
+
declare function reviveDumpError(stored: RpcDumpRecordError): Error;
|
|
78
|
+
//#endregion
|
|
79
|
+
export { getDefinitionsWithDumps as a, StaticRpcDumpManifest as c, StaticRpcDumpManifestValue as d, StaticRpcDumpSerialization as f, dumpFunctions as i, StaticRpcDumpManifestQueryEntry as l, serializeDumpError as n, StaticRpcDumpCollection as o, collectStaticRpcDump as p, createClientFromDump as r, StaticRpcDumpFile as s, reviveDumpError as t, StaticRpcDumpManifestStaticEntry as u };
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { C as RpcFunctionsCollector, S as RpcFunctionType, _ as RpcFunctionDefinitionAny,
|
|
1
|
+
import { C as RpcFunctionsCollector, S as RpcFunctionType, _ as RpcFunctionDefinitionAny, g as RpcFunctionDefinition, i as RpcArgsSchema, w as RpcReturnSchema, x as RpcFunctionSetupResult } from "./types-BXL7EIDM.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-C5PmWqBf.mjs";
|
|
2
3
|
|
|
3
4
|
//#region src/rpc/cache.d.ts
|
|
4
5
|
interface RpcCacheOptions {
|
|
@@ -47,82 +48,6 @@ declare class RpcFunctionsCollectorBase<LocalFunctions extends Record<string, an
|
|
|
47
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>;
|
|
48
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>;
|
|
49
50
|
//#endregion
|
|
50
|
-
//#region src/rpc/dump/index.d.ts
|
|
51
|
-
/**
|
|
52
|
-
* Collects pre-computed dumps by executing functions with their defined input combinations.
|
|
53
|
-
* Static functions without dump config automatically get `{ inputs: [[]] }`.
|
|
54
|
-
*
|
|
55
|
-
* @example
|
|
56
|
-
* ```ts
|
|
57
|
-
* const store = await dumpFunctions([greet], context, { concurrency: 10 })
|
|
58
|
-
* ```
|
|
59
|
-
*/
|
|
60
|
-
declare function dumpFunctions<T extends readonly RpcFunctionDefinitionAny[]>(definitions: T, context?: any, options?: RpcDumpCollectionOptions): Promise<RpcDumpStore<RpcDefinitionsToFunctions<T>>>;
|
|
61
|
-
/**
|
|
62
|
-
* Creates a client that serves pre-computed results from a dump store.
|
|
63
|
-
* Uses argument hashing to match calls to stored records.
|
|
64
|
-
*
|
|
65
|
-
* @example
|
|
66
|
-
* ```ts
|
|
67
|
-
* const client = createClientFromDump(store)
|
|
68
|
-
* await client.greet('Alice')
|
|
69
|
-
* ```
|
|
70
|
-
*/
|
|
71
|
-
declare function createClientFromDump<T extends Record<string, any>>(store: RpcDumpStore<T>, options?: RpcDumpClientOptions): BirpcReturn<T>;
|
|
72
|
-
/**
|
|
73
|
-
* Filters function definitions to only those with dump definitions.
|
|
74
|
-
* Note: Only checks the definition itself, not setup results.
|
|
75
|
-
*/
|
|
76
|
-
declare function getDefinitionsWithDumps<T extends readonly RpcFunctionDefinitionAny[]>(definitions: T): RpcFunctionDefinitionAny[];
|
|
77
|
-
//#endregion
|
|
78
|
-
//#region src/rpc/dump/error.d.ts
|
|
79
|
-
/**
|
|
80
|
-
* Normalize a thrown value into a plain object suitable for storage in
|
|
81
|
-
* a dump record. Preserves `message`, `name`, `cause`, and any own
|
|
82
|
-
* enumerable properties of an `Error` so consumers reading the dump can
|
|
83
|
-
* reconstruct a richer Error than just `{ message, name }`.
|
|
84
|
-
*
|
|
85
|
-
* Non-`Error` throws are wrapped as `{ name: 'Error', message: String(thrown) }`.
|
|
86
|
-
*/
|
|
87
|
-
declare function serializeDumpError(error: unknown): RpcDumpRecordError;
|
|
88
|
-
/**
|
|
89
|
-
* Inverse of {@link serializeDumpError}: rebuild a thrown `Error` from
|
|
90
|
-
* the plain object stored in a dump record. Preserves `cause`, restores
|
|
91
|
-
* the original `name`, and re-attaches any custom own properties.
|
|
92
|
-
*/
|
|
93
|
-
declare function reviveDumpError(stored: RpcDumpRecordError): Error;
|
|
94
|
-
//#endregion
|
|
95
|
-
//#region src/rpc/dump/static.d.ts
|
|
96
|
-
type StaticRpcDumpSerialization = 'json' | 'structured-clone';
|
|
97
|
-
interface StaticRpcDumpManifestStaticEntry {
|
|
98
|
-
type: 'static';
|
|
99
|
-
path: string;
|
|
100
|
-
/** Encoder used when this entry's file was written. Default: `'json'`. */
|
|
101
|
-
serialization?: StaticRpcDumpSerialization;
|
|
102
|
-
}
|
|
103
|
-
interface StaticRpcDumpManifestQueryEntry {
|
|
104
|
-
type: 'query';
|
|
105
|
-
records: Record<string, string>;
|
|
106
|
-
fallback?: string;
|
|
107
|
-
/** Encoder used when each record/fallback file was written. Default: `'json'`. */
|
|
108
|
-
serialization?: StaticRpcDumpSerialization;
|
|
109
|
-
}
|
|
110
|
-
type StaticRpcDumpManifestValue = StaticRpcDumpManifestStaticEntry | StaticRpcDumpManifestQueryEntry | any;
|
|
111
|
-
type StaticRpcDumpManifest = Record<string, StaticRpcDumpManifestValue>;
|
|
112
|
-
interface StaticRpcDumpFile {
|
|
113
|
-
/** Whether this file was written via `JSON.stringify` or `structured-clone-es.stringify`. */
|
|
114
|
-
serialization: StaticRpcDumpSerialization;
|
|
115
|
-
/** Function name the file belongs to — used to scope `DF0019` errors during write. */
|
|
116
|
-
fnName: string;
|
|
117
|
-
/** Payload to encode. */
|
|
118
|
-
data: unknown;
|
|
119
|
-
}
|
|
120
|
-
interface StaticRpcDumpCollection {
|
|
121
|
-
manifest: StaticRpcDumpManifest;
|
|
122
|
-
files: Record<string, StaticRpcDumpFile>;
|
|
123
|
-
}
|
|
124
|
-
declare function collectStaticRpcDump(definitions: Iterable<RpcFunctionDefinitionAny>, context: any): Promise<StaticRpcDumpCollection>;
|
|
125
|
-
//#endregion
|
|
126
51
|
//#region src/rpc/handler.d.ts
|
|
127
52
|
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>>;
|
|
128
53
|
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>;
|
|
@@ -184,4 +109,32 @@ declare function validateDefinitions(definitions: readonly RpcFunctionDefinition
|
|
|
184
109
|
*/
|
|
185
110
|
declare function validateDefinition(definition: RpcFunctionDefinitionAny): void;
|
|
186
111
|
//#endregion
|
|
187
|
-
|
|
112
|
+
//#region src/rpc/index.d.ts
|
|
113
|
+
/** @deprecated Import from `devframe/rpc/dump` instead. */
|
|
114
|
+
declare const collectStaticRpcDump: typeof collectStaticRpcDump$1;
|
|
115
|
+
/** @deprecated Import from `devframe/rpc/dump` instead. */
|
|
116
|
+
declare const createClientFromDump: typeof createClientFromDump$1;
|
|
117
|
+
/** @deprecated Import from `devframe/rpc/dump` instead. */
|
|
118
|
+
declare const dumpFunctions: typeof dumpFunctions$1;
|
|
119
|
+
/** @deprecated Import from `devframe/rpc/dump` instead. */
|
|
120
|
+
declare const getDefinitionsWithDumps: typeof getDefinitionsWithDumps$1;
|
|
121
|
+
/** @deprecated Import from `devframe/rpc/dump` instead. */
|
|
122
|
+
declare const reviveDumpError: typeof reviveDumpError$1;
|
|
123
|
+
/** @deprecated Import from `devframe/rpc/dump` instead. */
|
|
124
|
+
declare const serializeDumpError: typeof serializeDumpError$1;
|
|
125
|
+
/** @deprecated Import from `devframe/rpc/dump` instead. */
|
|
126
|
+
type StaticRpcDumpCollection = StaticRpcDumpCollection$1;
|
|
127
|
+
/** @deprecated Import from `devframe/rpc/dump` instead. */
|
|
128
|
+
type StaticRpcDumpFile = StaticRpcDumpFile$1;
|
|
129
|
+
/** @deprecated Import from `devframe/rpc/dump` instead. */
|
|
130
|
+
type StaticRpcDumpManifest = StaticRpcDumpManifest$1;
|
|
131
|
+
/** @deprecated Import from `devframe/rpc/dump` instead. */
|
|
132
|
+
type StaticRpcDumpManifestQueryEntry = StaticRpcDumpManifestQueryEntry$1;
|
|
133
|
+
/** @deprecated Import from `devframe/rpc/dump` instead. */
|
|
134
|
+
type StaticRpcDumpManifestStaticEntry = StaticRpcDumpManifestStaticEntry$1;
|
|
135
|
+
/** @deprecated Import from `devframe/rpc/dump` instead. */
|
|
136
|
+
type StaticRpcDumpManifestValue = StaticRpcDumpManifestValue$1;
|
|
137
|
+
/** @deprecated Import from `devframe/rpc/dump` instead. */
|
|
138
|
+
type StaticRpcDumpSerialization = StaticRpcDumpSerialization$1;
|
|
139
|
+
//#endregion
|
|
140
|
+
export { RpcCacheManager as C, RpcFunctionsCollectorBase as S, strictJsonStringify as _, StaticRpcDumpManifestStaticEntry as a, createDefineWrapperWithContext as b, collectStaticRpcDump as c, getDefinitionsWithDumps as d, reviveDumpError as f, STRUCTURED_CLONE_PREFIX as g, validateDefinitions as h, StaticRpcDumpManifestQueryEntry as i, createClientFromDump as l, validateDefinition as m, StaticRpcDumpFile as n, StaticRpcDumpManifestValue as o, serializeDumpError as p, StaticRpcDumpManifest as r, StaticRpcDumpSerialization as s, StaticRpcDumpCollection as t, dumpFunctions as u, getRpcHandler as v, RpcCacheOptions as w, defineRpcFunction as x, getRpcResolvedSetupResult as y };
|