@x1a0f3n9/dsh-typert-registry 0.1.5-rc.2
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/LICENSE +21 -0
- package/README.i18n.yaml +6 -0
- package/README.md +131 -0
- package/README.zh.md +131 -0
- package/lib/client.js +1372 -0
- package/lib/index.js +562 -0
- package/lib/types/client/index.d.ts +10 -0
- package/lib/types/client/index.js +12 -0
- package/lib/types/index.d.ts +18 -0
- package/lib/types/index.js +3 -0
- package/lib/types/service.d.ts +103 -0
- package/lib/types/service.js +600 -0
- package/lib/types/types.d.ts +100 -0
- package/lib/types/types.js +7 -0
- package/package.json +60 -0
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Runtime registry for generated Typert reflection, Remote invocations, and
|
|
3
|
+
* dependency-inverted lookup/Context providers. It performs no TypeScript
|
|
4
|
+
* analysis or schema generation.
|
|
5
|
+
* @module @x1a0f3n9/dsh-typert-registry
|
|
6
|
+
*/
|
|
7
|
+
import { Context, Service } from '@deepseek-ai/cordis';
|
|
8
|
+
import { z } from 'zod';
|
|
9
|
+
import type { InvocationDescriptor, TypertContextRegistry, TypertDisposer, TypertLocalRegistry, TypertLookupRegistry, TypertRemoteRegistry, TypertRegistryContract } from '@x1a0f3n9/dsh-typert-protocol';
|
|
10
|
+
import type { TypertContribution, TypertFace, TypertPackageFilter, TypertPackageRecord, TypertSchemaFilter, TypertSchemaRecord } from './types.ts';
|
|
11
|
+
/**
|
|
12
|
+
* Compose the global key of one generated schema.
|
|
13
|
+
* @param packageName - contributing npm package.
|
|
14
|
+
* @param name - schema export name.
|
|
15
|
+
* @returns `<package>#<name>`.
|
|
16
|
+
*/
|
|
17
|
+
export declare function typertKey(packageName: string, name: string): string;
|
|
18
|
+
/**
|
|
19
|
+
* Compose the identity of one package-face model.
|
|
20
|
+
* @param packageName - contributing npm package.
|
|
21
|
+
* @param face - independently compiled face.
|
|
22
|
+
* @returns `<package>#<face>`.
|
|
23
|
+
*/
|
|
24
|
+
export declare function typertPackageKey(packageName: string, face: TypertFace): string;
|
|
25
|
+
/**
|
|
26
|
+
* Compose the endpoint key used by local and Remote invocation registries.
|
|
27
|
+
* @param descriptor - invocation whose namespace and method form the endpoint.
|
|
28
|
+
* @returns `<namespace>/<method>`.
|
|
29
|
+
*/
|
|
30
|
+
export declare function typertEndpoint(descriptor: Pick<InvocationDescriptor, 'namespace' | 'method'>): string;
|
|
31
|
+
/**
|
|
32
|
+
* Registry of generated schemas, package reflection, invocations, and Remote
|
|
33
|
+
* dependency providers.
|
|
34
|
+
* @typert service typert
|
|
35
|
+
*/
|
|
36
|
+
export declare class TypertRegistry extends Service implements TypertRegistryContract {
|
|
37
|
+
private readonly schemas;
|
|
38
|
+
private readonly packages;
|
|
39
|
+
private readonly localStore;
|
|
40
|
+
private readonly remoteStore;
|
|
41
|
+
private readonly lookupStore;
|
|
42
|
+
private readonly contextStore;
|
|
43
|
+
constructor(ctx: Context);
|
|
44
|
+
/** Current-environment invocation definitions. */
|
|
45
|
+
get local(): TypertLocalRegistry;
|
|
46
|
+
/** Consumer-selected Remote definitions. */
|
|
47
|
+
get remotes(): TypertRemoteRegistry;
|
|
48
|
+
/** Host object lookup providers. */
|
|
49
|
+
get lookups(): TypertLookupRegistry;
|
|
50
|
+
/** Host and Client Context adapters. */
|
|
51
|
+
get contexts(): TypertContextRegistry;
|
|
52
|
+
/**
|
|
53
|
+
* Register one generated contribution atomically for the calling fiber.
|
|
54
|
+
* Duplicate package-face identities, schemas, invocation ids, or endpoints
|
|
55
|
+
* reject the whole batch.
|
|
56
|
+
* @param contribution - generated schemas, reflection, and Host invocations.
|
|
57
|
+
* @returns the exact effect disposer that removes this contribution.
|
|
58
|
+
*/
|
|
59
|
+
register(contribution: TypertContribution): TypertDisposer;
|
|
60
|
+
/**
|
|
61
|
+
* Look up one schema by `<package>#<name>`.
|
|
62
|
+
* @param key - global schema key.
|
|
63
|
+
* @returns the live schema record, or `undefined` when absent.
|
|
64
|
+
*/
|
|
65
|
+
get(key: string): TypertSchemaRecord | undefined;
|
|
66
|
+
/**
|
|
67
|
+
* Resolve one required schema.
|
|
68
|
+
* @param key - global schema key.
|
|
69
|
+
* @returns the live schema record.
|
|
70
|
+
* @throws when the key is malformed, the package face is absent, or the schema is not contributed.
|
|
71
|
+
*/
|
|
72
|
+
resolve(key: string): TypertSchemaRecord;
|
|
73
|
+
/**
|
|
74
|
+
* Enumerate live schemas in registration order.
|
|
75
|
+
* @param filter - optional package and face restriction.
|
|
76
|
+
* @returns matching schema records.
|
|
77
|
+
*/
|
|
78
|
+
list(filter?: TypertSchemaFilter): TypertSchemaRecord[];
|
|
79
|
+
/**
|
|
80
|
+
* Look up generated reflection for one package face.
|
|
81
|
+
* @param packageName - exact npm package name.
|
|
82
|
+
* @param face - face to query; defaults to the host runtime.
|
|
83
|
+
* @returns the live package record, or `undefined` when absent.
|
|
84
|
+
*/
|
|
85
|
+
getPackage(packageName: string, face?: TypertFace): TypertPackageRecord | undefined;
|
|
86
|
+
/**
|
|
87
|
+
* Enumerate generated package reflection in registration order.
|
|
88
|
+
* @param filter - optional package and face restriction.
|
|
89
|
+
* @returns matching package records.
|
|
90
|
+
*/
|
|
91
|
+
listPackages(filter?: TypertPackageFilter): TypertPackageRecord[];
|
|
92
|
+
/**
|
|
93
|
+
* Project a live Zod schema to JSON Schema without caching the result.
|
|
94
|
+
* @param key - global schema key.
|
|
95
|
+
* @param params - Zod projection parameters.
|
|
96
|
+
* @returns a fresh JSON Schema document.
|
|
97
|
+
*/
|
|
98
|
+
toJSONSchema(key: string, params?: z.core.ToJSONSchemaParams): z.core.JSONSchema.BaseSchema;
|
|
99
|
+
private validatePackage;
|
|
100
|
+
private validateSchemas;
|
|
101
|
+
}
|
|
102
|
+
export default TypertRegistry;
|
|
103
|
+
//# sourceMappingURL=service.d.ts.map
|