@xyo-network/xl1-protocol-sdk 3.0.0 → 3.0.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/dist/neutral/CreatableProvider/CreatableProvider.d.ts +8 -0
- package/dist/neutral/CreatableProvider/CreatableProvider.d.ts.map +1 -1
- package/dist/neutral/capabilities/Provider.d.ts +13 -38
- package/dist/neutral/capabilities/Provider.d.ts.map +1 -1
- package/dist/neutral/capabilities/connectionTypes.d.ts +2 -1
- package/dist/neutral/capabilities/connectionTypes.d.ts.map +1 -1
- package/dist/neutral/capabilities/index.d.ts +3 -0
- package/dist/neutral/capabilities/index.d.ts.map +1 -1
- package/dist/neutral/capabilities/locatorFromConfig.d.ts +29 -0
- package/dist/neutral/capabilities/locatorFromConfig.d.ts.map +1 -0
- package/dist/neutral/capabilities/needsFromProviderBindings.d.ts +8 -0
- package/dist/neutral/capabilities/needsFromProviderBindings.d.ts.map +1 -0
- package/dist/neutral/capabilities/providerCandidateFromClass.d.ts +7 -0
- package/dist/neutral/capabilities/providerCandidateFromClass.d.ts.map +1 -0
- package/dist/neutral/capabilities/resolveProviders.d.ts +3 -3
- package/dist/neutral/capabilities/resolveProviders.d.ts.map +1 -1
- package/dist/neutral/config/adaptLegacyConfig.d.ts.map +1 -1
- package/dist/neutral/index.mjs +572 -451
- package/dist/neutral/index.mjs.map +4 -4
- package/dist/neutral/simple/StakeEventsViewer/SimpleStakeEventsViewer.d.ts +2 -0
- package/dist/neutral/simple/StakeEventsViewer/SimpleStakeEventsViewer.d.ts.map +1 -1
- package/dist/neutral/simple/StakeTotalsViewer/SimpleStakeTotalsViewer.d.ts +2 -0
- package/dist/neutral/simple/StakeTotalsViewer/SimpleStakeTotalsViewer.d.ts.map +1 -1
- package/dist/neutral/simple/StakeViewer/SimpleStakeViewer.d.ts +2 -0
- package/dist/neutral/simple/StakeViewer/SimpleStakeViewer.d.ts.map +1 -1
- package/dist/neutral/simple/TransactionViewer/SimpleTransactionViewer.d.ts +1 -0
- package/dist/neutral/simple/TransactionViewer/SimpleTransactionViewer.d.ts.map +1 -1
- package/dist/neutral/simple/accountBalance/SimpleAccountBalanceViewer.d.ts +2 -0
- package/dist/neutral/simple/accountBalance/SimpleAccountBalanceViewer.d.ts.map +1 -1
- package/dist/neutral/simple/block/SimpleBlockViewer.d.ts +2 -0
- package/dist/neutral/simple/block/SimpleBlockViewer.d.ts.map +1 -1
- package/dist/neutral/simple/blockInvalidation/SimpleBlockInvalidationViewer.d.ts +2 -0
- package/dist/neutral/simple/blockInvalidation/SimpleBlockInvalidationViewer.d.ts.map +1 -1
- package/dist/neutral/simple/blockReward/SimpleBlockRewardViewer.d.ts +2 -0
- package/dist/neutral/simple/blockReward/SimpleBlockRewardViewer.d.ts.map +1 -1
- package/dist/neutral/simple/blockValidation/SimpleBlockValidationViewer.d.ts +2 -0
- package/dist/neutral/simple/blockValidation/SimpleBlockValidationViewer.d.ts.map +1 -1
- package/dist/neutral/simple/chainContractViewer/SimpleChainContractViewer.d.ts +2 -0
- package/dist/neutral/simple/chainContractViewer/SimpleChainContractViewer.d.ts.map +1 -1
- package/dist/neutral/simple/datalake/RestDataLakeRunner.d.ts +2 -0
- package/dist/neutral/simple/datalake/RestDataLakeRunner.d.ts.map +1 -1
- package/dist/neutral/simple/datalake/RestDataLakeViewer.d.ts +2 -0
- package/dist/neutral/simple/datalake/RestDataLakeViewer.d.ts.map +1 -1
- package/dist/neutral/simple/datalake/SimpleDataLakeRunner.d.ts +2 -0
- package/dist/neutral/simple/datalake/SimpleDataLakeRunner.d.ts.map +1 -1
- package/dist/neutral/simple/datalake/SimpleDataLakeViewer.d.ts +2 -0
- package/dist/neutral/simple/datalake/SimpleDataLakeViewer.d.ts.map +1 -1
- package/dist/neutral/simple/finalization/SimpleFinalizationRunner.d.ts +2 -0
- package/dist/neutral/simple/finalization/SimpleFinalizationRunner.d.ts.map +1 -1
- package/dist/neutral/simple/finalization/SimpleFinalizationViewer.d.ts +2 -0
- package/dist/neutral/simple/finalization/SimpleFinalizationViewer.d.ts.map +1 -1
- package/dist/neutral/simple/mempool/SimpleMempoolRunner.d.ts +2 -0
- package/dist/neutral/simple/mempool/SimpleMempoolRunner.d.ts.map +1 -1
- package/dist/neutral/simple/mempool/SimpleMempoolViewer.d.ts +2 -0
- package/dist/neutral/simple/mempool/SimpleMempoolViewer.d.ts.map +1 -1
- package/dist/neutral/simple/runner/SimpleXyoRunner.d.ts +2 -0
- package/dist/neutral/simple/runner/SimpleXyoRunner.d.ts.map +1 -1
- package/dist/neutral/simple/signer/SimpleXyoSigner.d.ts +2 -0
- package/dist/neutral/simple/signer/SimpleXyoSigner.d.ts.map +1 -1
- package/dist/neutral/simple/timeSync2/SimpleTimeSyncViewer.d.ts +2 -0
- package/dist/neutral/simple/timeSync2/SimpleTimeSyncViewer.d.ts.map +1 -1
- package/dist/neutral/simple/transactionValidation/SimpleTransactionValidationViewer.d.ts +2 -0
- package/dist/neutral/simple/transactionValidation/SimpleTransactionValidationViewer.d.ts.map +1 -1
- package/dist/neutral/simple/windowedBlock/SimpleWindowedBlockViewer.d.ts +2 -0
- package/dist/neutral/simple/windowedBlock/SimpleWindowedBlockViewer.d.ts.map +1 -1
- package/dist/neutral/test/index.mjs +6 -0
- package/dist/neutral/test/index.mjs.map +2 -2
- package/package.json +9 -9
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import type { Creatable, CreatableInstance, CreatableParams, EventData, Labels, WithOptionalLabels } from '@xylabs/sdk-js';
|
|
2
2
|
import type { Provider, ProviderMoniker } from '@xyo-network/xl1-protocol-lib';
|
|
3
|
+
import type { Surface } from '../capabilities/Backing.ts';
|
|
4
|
+
import type { TransportKind } from '../config/transports/Transport.ts';
|
|
3
5
|
import type { CreatableProviderContext } from '../model/index.ts';
|
|
6
|
+
/** Connection kinds declared on creatable provider statics (transports plus wallet). */
|
|
7
|
+
export type CreatableProviderConnectionType = TransportKind | 'wallet';
|
|
4
8
|
import type { GetInstanceOptions } from './GetInstanceOptions.ts';
|
|
5
9
|
import type { LabeledCreatableProviderFactory } from './LabeledCreatableProviderFactory.ts';
|
|
6
10
|
/** Parameters for CreatableProvider. */
|
|
@@ -18,6 +22,7 @@ export type CreatableProviderInstance<TProvider extends Provider<ProviderMoniker
|
|
|
18
22
|
export type ProviderFactoryScope = 'global' | 'context' | 'local';
|
|
19
23
|
/** CreatableProviderFactory interface. */
|
|
20
24
|
export interface CreatableProviderFactory<T extends CreatableProviderInstance = CreatableProviderInstance, TDependencies extends ProviderMoniker[] = ProviderMoniker[]> extends Omit<CreatableProvider<T>, 'create' | 'createHandler' | 'paramsHandler'> {
|
|
25
|
+
readonly connectionTypes?: readonly CreatableProviderConnectionType[];
|
|
21
26
|
creatableProvider: CreatableProvider<T>;
|
|
22
27
|
defaultParams: Omit<T['params'], 'context'>;
|
|
23
28
|
readonly dependencies: TDependencies;
|
|
@@ -25,6 +30,7 @@ export interface CreatableProviderFactory<T extends CreatableProviderInstance =
|
|
|
25
30
|
providerName: string;
|
|
26
31
|
resolvedMoniker: string;
|
|
27
32
|
scope: ProviderFactoryScope;
|
|
33
|
+
readonly surface?: Surface;
|
|
28
34
|
uniqueId: symbol;
|
|
29
35
|
getInstance(this: CreatableProviderFactory<T>, params: T['params'], options?: GetInstanceOptions): Promise<T>;
|
|
30
36
|
tryGetInstance(this: CreatableProviderFactory<T>, params: T['params'], options?: GetInstanceOptions): Promise<T | undefined>;
|
|
@@ -37,9 +43,11 @@ export interface LabeledCreatableProvider<T extends CreatableProviderInstance =
|
|
|
37
43
|
export type ProviderMap<T extends ProviderMoniker = ProviderMoniker> = Partial<Record<T, CreatableProviderInstance<Provider<T>>>>;
|
|
38
44
|
/** CreatableProvider interface. */
|
|
39
45
|
export interface CreatableProvider<T extends CreatableProviderInstance = CreatableProviderInstance, TDependencies extends ProviderMoniker[] = ProviderMoniker[]> extends Creatable<T> {
|
|
46
|
+
readonly connectionTypes?: readonly CreatableProviderConnectionType[];
|
|
40
47
|
readonly defaultMoniker: ProviderMoniker;
|
|
41
48
|
readonly dependencies: TDependencies;
|
|
42
49
|
readonly monikers: ProviderMoniker[];
|
|
50
|
+
readonly surface?: Surface;
|
|
43
51
|
factory(dependencies: TDependencies, params: Omit<T['params'], 'context'>): CreatableProviderFactory<T>;
|
|
44
52
|
}
|
|
45
53
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CreatableProvider.d.ts","sourceRoot":"","sources":["../../../src/CreatableProvider/CreatableProvider.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,SAAS,EAAE,iBAAiB,EAAE,eAAe,EAC7C,SAAS,EACT,MAAM,EAAE,kBAAkB,EAC3B,MAAM,gBAAgB,CAAA;AACvB,OAAO,KAAK,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAA;AAE9E,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,mBAAmB,CAAA;
|
|
1
|
+
{"version":3,"file":"CreatableProvider.d.ts","sourceRoot":"","sources":["../../../src/CreatableProvider/CreatableProvider.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,SAAS,EAAE,iBAAiB,EAAE,eAAe,EAC7C,SAAS,EACT,MAAM,EAAE,kBAAkB,EAC3B,MAAM,gBAAgB,CAAA;AACvB,OAAO,KAAK,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAA;AAE9E,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAA;AACzD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAA;AACtE,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,mBAAmB,CAAA;AAEjE,wFAAwF;AACxF,MAAM,MAAM,+BAA+B,GAAG,aAAa,GAAG,QAAQ,CAAA;AACtE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAA;AACjE,OAAO,KAAK,EAAE,+BAA+B,EAAE,MAAM,sCAAs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E,CAAA;IACrE,QAAQ,CAAC,cAAc,EAAE,eAAe,CAAA;IACxC,QAAQ,CAAC,YAAY,EAAE,aAAa,CAAA;IACpC,QAAQ,CAAC,QAAQ,EAAE,eAAe,EAAE,CAAA;IAEpC,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAA;IAC1B,OAAO,CAAC,YAAY,EAAE,aAAa,EAAE,MAAM,EAAE,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,SAAS,CAAC,GAAG,wBAAwB,CAAC,CAAC,CAAC,CAAA;CACxG;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,SAAS,SAAS,yBAAyB,GAAG,yBAAyB,MAC/F,CAAC,SAAS,iBAAiB,CAAC,SAAS,CAAC,EAAE,aAAa,CAAC,UAI/D;AAED;;;;;GAKG;AACH,wBAAgB,wBAAwB,CAAC,SAAS,SAAS,yBAAyB,GAAG,yBAAyB,MACtG,CAAC,SAAS,wBAAwB,CAAC,SAAS,CAAC,EAAE,aAAa,CAAC,UAItE"}
|
|
@@ -1,56 +1,31 @@
|
|
|
1
1
|
import type { ProviderMoniker } from '@xyo-network/xl1-protocol-model';
|
|
2
|
-
import type {
|
|
3
|
-
import type { CreatableProviderFactory } from '../CreatableProvider/index.ts';
|
|
2
|
+
import type { CreatableProvider, CreatableProviderConnectionType } from '../CreatableProvider/CreatableProvider.ts';
|
|
4
3
|
import type { Surface } from './Backing.ts';
|
|
5
|
-
import type { CapabilityRegistryInstance } from './Capability.ts';
|
|
6
4
|
/**
|
|
7
|
-
*
|
|
8
|
-
* resolver which capability the provider satisfies, which connections it can use,
|
|
9
|
-
* and how to construct the factory at plan time.
|
|
5
|
+
* Plan-time candidate for provider resolution (used by `resolveProviders`).
|
|
10
6
|
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
7
|
+
* Metadata (`connectionTypes`, `dependencies`, `surface`, `satisfies`) is
|
|
8
|
+
* derived from `CreatableProvider` class statics via `providerCandidateFromClass`.
|
|
9
|
+
* Selection is config-only: `providerBindings` + `connections` type matching.
|
|
14
10
|
*/
|
|
15
|
-
export interface ProviderDescriptor
|
|
11
|
+
export interface ProviderDescriptor {
|
|
16
12
|
/**
|
|
17
|
-
* Connection kinds this
|
|
13
|
+
* Connection kinds this candidate supports (e.g. `lmdb`, `rpc`). Empty array
|
|
18
14
|
* means wildcard — matches any bound connection type.
|
|
19
15
|
*/
|
|
20
|
-
readonly connectionTypes: readonly
|
|
16
|
+
readonly connectionTypes: readonly CreatableProviderConnectionType[];
|
|
17
|
+
/** Implementation class selected when this candidate wins. */
|
|
18
|
+
readonly creatableProvider: CreatableProvider;
|
|
21
19
|
/**
|
|
22
20
|
* Monikers this provider resolves at register/create time. Drives plan-time
|
|
23
21
|
* transitive closure and topological ordering.
|
|
24
22
|
*/
|
|
25
23
|
readonly dependencies?: readonly ProviderMoniker[];
|
|
26
|
-
/** Globally-unique key, usually
|
|
24
|
+
/** Globally-unique key, usually the class name — used in snapshots and diagnostics. */
|
|
27
25
|
readonly id: string;
|
|
28
|
-
/** Capabilities this
|
|
26
|
+
/** Capabilities this candidate satisfies (typically `monikers` from the class). */
|
|
29
27
|
readonly satisfies: readonly ProviderMoniker[];
|
|
30
|
-
/**
|
|
31
|
-
* Which API surface this descriptor's capability is exposed under. Mirrors
|
|
32
|
-
* the corresponding `Capability.surface`; declared on the descriptor too so
|
|
33
|
-
* the resolver can filter candidates by surface without a registry lookup.
|
|
34
|
-
*/
|
|
28
|
+
/** Which API surface this capability is exposed under. */
|
|
35
29
|
readonly surface: Surface;
|
|
36
|
-
/**
|
|
37
|
-
* Build the factory args from the resolution context. Returning undefined
|
|
38
|
-
* signals "skip me at runtime" (preconditions said yes, but a missing optional
|
|
39
|
-
* resource was discovered during the build).
|
|
40
|
-
*/
|
|
41
|
-
build(ctx: TCtx): CreatableProviderFactory | undefined;
|
|
42
|
-
/**
|
|
43
|
-
* Returns true iff the provider can be constructed in this process given `ctx`.
|
|
44
|
-
* Pure & sync — must not read DB or do I/O.
|
|
45
|
-
*/
|
|
46
|
-
preconditions(ctx: TCtx): boolean;
|
|
47
|
-
}
|
|
48
|
-
/**
|
|
49
|
-
* Inputs the resolver hands to descriptors. `capabilities` is the registry
|
|
50
|
-
* the resolver may consult for diagnostics. Subtypes may extend this with
|
|
51
|
-
* live runtime resources that descriptors need at `build()` time.
|
|
52
|
-
*/
|
|
53
|
-
export interface ResolutionContext {
|
|
54
|
-
readonly capabilities: CapabilityRegistryInstance;
|
|
55
30
|
}
|
|
56
31
|
//# sourceMappingURL=Provider.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Provider.d.ts","sourceRoot":"","sources":["../../../src/capabilities/Provider.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAA;AAEtE,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"Provider.d.ts","sourceRoot":"","sources":["../../../src/capabilities/Provider.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAA;AAEtE,OAAO,KAAK,EAAE,iBAAiB,EAAE,+BAA+B,EAAE,MAAM,2CAA2C,CAAA;AACnH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AAE3C;;;;;;GAMG;AACH,MAAM,WAAW,kBAAkB;IACjC;;;OAGG;IACH,QAAQ,CAAC,eAAe,EAAE,SAAS,+BAA+B,EAAE,CAAA;IACpE,8DAA8D;IAC9D,QAAQ,CAAC,iBAAiB,EAAE,iBAAiB,CAAA;IAC7C;;;OAGG;IACH,QAAQ,CAAC,YAAY,CAAC,EAAE,SAAS,eAAe,EAAE,CAAA;IAClD,uFAAuF;IACvF,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAA;IACnB,mFAAmF;IACnF,QAAQ,CAAC,SAAS,EAAE,SAAS,eAAe,EAAE,CAAA;IAC9C,0DAA0D;IAC1D,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAA;CAC1B"}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import type { TransportKind } from '../config/transports/Transport.ts';
|
|
2
|
+
import type { CreatableProviderConnectionType } from '../CreatableProvider/CreatableProvider.ts';
|
|
2
3
|
import type { ProviderDescriptor } from './Provider.ts';
|
|
3
4
|
/**
|
|
4
5
|
* Connection types a descriptor supports. An empty array is a wildcard: the
|
|
5
6
|
* descriptor matches any bound connection type (used by in-process memory stubs).
|
|
6
7
|
*/
|
|
7
|
-
export declare function descriptorConnectionTypes(descriptor: Pick<ProviderDescriptor, 'connectionTypes'>): readonly
|
|
8
|
+
export declare function descriptorConnectionTypes(descriptor: Pick<ProviderDescriptor, 'connectionTypes'>): readonly CreatableProviderConnectionType[];
|
|
8
9
|
export declare function descriptorMatchesConnectionType(descriptor: Pick<ProviderDescriptor, 'connectionTypes'>, connectionType: TransportKind): boolean;
|
|
9
10
|
//# sourceMappingURL=connectionTypes.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"connectionTypes.d.ts","sourceRoot":"","sources":["../../../src/capabilities/connectionTypes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAA;AACtE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAA;AAEvD;;;GAGG;AACH,wBAAgB,yBAAyB,CACvC,UAAU,EAAE,IAAI,CAAC,kBAAkB,EAAE,iBAAiB,CAAC,GACtD,SAAS,
|
|
1
|
+
{"version":3,"file":"connectionTypes.d.ts","sourceRoot":"","sources":["../../../src/capabilities/connectionTypes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAA;AACtE,OAAO,KAAK,EAAE,+BAA+B,EAAE,MAAM,2CAA2C,CAAA;AAChG,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAA;AAEvD;;;GAGG;AACH,wBAAgB,yBAAyB,CACvC,UAAU,EAAE,IAAI,CAAC,kBAAkB,EAAE,iBAAiB,CAAC,GACtD,SAAS,+BAA+B,EAAE,CAE5C;AAED,wBAAgB,+BAA+B,CAC7C,UAAU,EAAE,IAAI,CAAC,kBAAkB,EAAE,iBAAiB,CAAC,EACvD,cAAc,EAAE,aAAa,GAC5B,OAAO,CAMT"}
|
|
@@ -3,7 +3,10 @@ export * from './Capability.ts';
|
|
|
3
3
|
export * from './connectionSubsetBySurface.ts';
|
|
4
4
|
export * from './connectionTypes.ts';
|
|
5
5
|
export * from './factoryBrand.ts';
|
|
6
|
+
export * from './locatorFromConfig.ts';
|
|
7
|
+
export * from './needsFromProviderBindings.ts';
|
|
6
8
|
export * from './Provider.ts';
|
|
9
|
+
export * from './providerCandidateFromClass.ts';
|
|
7
10
|
export * from './resolveProviders.ts';
|
|
8
11
|
export * from './surfaceMap.ts';
|
|
9
12
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/capabilities/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAA;AAC5B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,gCAAgC,CAAA;AAC9C,cAAc,sBAAsB,CAAA;AACpC,cAAc,mBAAmB,CAAA;AACjC,cAAc,eAAe,CAAA;AAC7B,cAAc,uBAAuB,CAAA;AACrC,cAAc,iBAAiB,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/capabilities/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAA;AAC5B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,gCAAgC,CAAA;AAC9C,cAAc,sBAAsB,CAAA;AACpC,cAAc,mBAAmB,CAAA;AACjC,cAAc,wBAAwB,CAAA;AACtC,cAAc,gCAAgC,CAAA;AAC9C,cAAc,eAAe,CAAA;AAC7B,cAAc,iCAAiC,CAAA;AAC/C,cAAc,uBAAuB,CAAA;AACrC,cAAc,iBAAiB,CAAA"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { ProviderMoniker } from '@xyo-network/xl1-protocol-model';
|
|
2
|
+
import type { Config } from '../config/index.ts';
|
|
3
|
+
import { ProviderFactoryLocator } from '../CreatableProvider/ProviderFactoryLocator.ts';
|
|
4
|
+
import type { CreatableProviderContext } from '../model/index.ts';
|
|
5
|
+
import type { ProviderDescriptor } from './Provider.ts';
|
|
6
|
+
import { type ResolutionPlan } from './resolveProviders.ts';
|
|
7
|
+
/** Options for building a locator from config-driven provider resolution. */
|
|
8
|
+
export interface LocatorFromConfigOptions {
|
|
9
|
+
readonly candidates: readonly ProviderDescriptor[];
|
|
10
|
+
readonly config: Config;
|
|
11
|
+
readonly context?: Omit<CreatableProviderContext, 'config' | 'locator'>;
|
|
12
|
+
readonly needs: ReadonlySet<ProviderMoniker>;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Resolves which provider classes to register for the given config bindings.
|
|
16
|
+
* Selection uses only `providerBindings` + `connections` — no runtime preconditions.
|
|
17
|
+
*/
|
|
18
|
+
export declare function resolveProvidersFromConfig(needs: ReadonlySet<ProviderMoniker>, candidates: readonly ProviderDescriptor[], config: Config): ResolutionPlan;
|
|
19
|
+
/**
|
|
20
|
+
* Registers factories for a resolution plan. Params are empty — implementations
|
|
21
|
+
* are expected to read their bound connection from `context.config` at runtime.
|
|
22
|
+
*/
|
|
23
|
+
export declare function registerFactoriesFromPlan(locator: ProviderFactoryLocator, plan: ResolutionPlan): void;
|
|
24
|
+
/**
|
|
25
|
+
* Builds a `ProviderFactoryLocator` from config: resolve candidates, then register
|
|
26
|
+
* winning factories. Connection profiles come from config, not factory params.
|
|
27
|
+
*/
|
|
28
|
+
export declare function locatorFromConfig(options: LocatorFromConfigOptions): ProviderFactoryLocator;
|
|
29
|
+
//# sourceMappingURL=locatorFromConfig.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"locatorFromConfig.d.ts","sourceRoot":"","sources":["../../../src/capabilities/locatorFromConfig.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAA;AAEtE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAA;AAEhD,OAAO,EAAE,sBAAsB,EAAE,MAAM,gDAAgD,CAAA;AACvF,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,mBAAmB,CAAA;AACjE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAA;AACvD,OAAO,EAAE,KAAK,cAAc,EAAoB,MAAM,uBAAuB,CAAA;AAE7E,6EAA6E;AAC7E,MAAM,WAAW,wBAAwB;IACvC,QAAQ,CAAC,UAAU,EAAE,SAAS,kBAAkB,EAAE,CAAA;IAClD,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;IACvB,QAAQ,CAAC,OAAO,CAAC,EAAE,IAAI,CAAC,wBAAwB,EAAE,QAAQ,GAAG,SAAS,CAAC,CAAA;IACvE,QAAQ,CAAC,KAAK,EAAE,WAAW,CAAC,eAAe,CAAC,CAAA;CAC7C;AAED;;;GAGG;AACH,wBAAgB,0BAA0B,CACxC,KAAK,EAAE,WAAW,CAAC,eAAe,CAAC,EACnC,UAAU,EAAE,SAAS,kBAAkB,EAAE,EACzC,MAAM,EAAE,MAAM,GACb,cAAc,CAMhB;AAED;;;GAGG;AACH,wBAAgB,yBAAyB,CACvC,OAAO,EAAE,sBAAsB,EAC/B,IAAI,EAAE,cAAc,GACnB,IAAI,CAMN;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAC/B,OAAO,EAAE,wBAAwB,GAChC,sBAAsB,CAWxB"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { ProviderMoniker } from '@xyo-network/xl1-protocol-model';
|
|
2
|
+
import type { Config } from '../config/Config.ts';
|
|
3
|
+
import type { TransportKind } from '../config/transports/Transport.ts';
|
|
4
|
+
/** Derives resolution needs from every moniker declared in `providerBindings`. */
|
|
5
|
+
export declare function needsFromProviderBindings(config: Pick<Config, 'providerBindings'>): ReadonlySet<ProviderMoniker>;
|
|
6
|
+
/** Derives needs for monikers whose bound connection matches one of the given types. */
|
|
7
|
+
export declare function needsFromConnectionTypes(config: Pick<Config, 'connections' | 'providerBindings'>, connectionTypes: readonly TransportKind[]): ReadonlySet<ProviderMoniker>;
|
|
8
|
+
//# sourceMappingURL=needsFromProviderBindings.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"needsFromProviderBindings.d.ts","sourceRoot":"","sources":["../../../src/capabilities/needsFromProviderBindings.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAA;AAEtE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAA;AACjD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAA;AAEtE,kFAAkF;AAClF,wBAAgB,yBAAyB,CACvC,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,kBAAkB,CAAC,GACvC,WAAW,CAAC,eAAe,CAAC,CAE9B;AAED,wFAAwF;AACxF,wBAAgB,wBAAwB,CACtC,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,aAAa,GAAG,kBAAkB,CAAC,EACxD,eAAe,EAAE,SAAS,aAAa,EAAE,GACxC,WAAW,CAAC,eAAe,CAAC,CAiB9B"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { CreatableProvider } from '../CreatableProvider/CreatableProvider.ts';
|
|
2
|
+
import type { ProviderDescriptor } from './Provider.ts';
|
|
3
|
+
/** Derives a resolution candidate from a `CreatableProvider` implementation class. */
|
|
4
|
+
export declare function providerCandidateFromClass(creatableProvider: CreatableProvider, id?: string): ProviderDescriptor;
|
|
5
|
+
/** Derives resolution candidates from a list of provider implementation classes. */
|
|
6
|
+
export declare function providerCandidatesFromClasses(creatableProviders: readonly CreatableProvider[]): ProviderDescriptor[];
|
|
7
|
+
//# sourceMappingURL=providerCandidateFromClass.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"providerCandidateFromClass.d.ts","sourceRoot":"","sources":["../../../src/capabilities/providerCandidateFromClass.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,2CAA2C,CAAA;AAClF,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAA;AAEvD,sFAAsF;AACtF,wBAAgB,0BAA0B,CACxC,iBAAiB,EAAE,iBAAiB,EACpC,EAAE,GAAE,MAA+B,GAClC,kBAAkB,CASpB;AAED,oFAAoF;AACpF,wBAAgB,6BAA6B,CAC3C,kBAAkB,EAAE,SAAS,iBAAiB,EAAE,GAC/C,kBAAkB,EAAE,CAEtB"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ProviderMoniker } from '@xyo-network/xl1-protocol-model';
|
|
2
2
|
import type { TransportConfig } from '../config/transports/Transport.ts';
|
|
3
|
-
import type { ProviderDescriptor
|
|
3
|
+
import type { ProviderDescriptor } from './Provider.ts';
|
|
4
4
|
export interface ResolutionPlan {
|
|
5
5
|
/** Capability moniker -> winning descriptor id (for snapshot diffing). */
|
|
6
6
|
readonly bindings: Readonly<Record<ProviderMoniker, string>>;
|
|
@@ -45,10 +45,10 @@ export interface ResolveProvidersOptions {
|
|
|
45
45
|
*
|
|
46
46
|
* 1. Fixpoint-expand monikers from selected descriptor `dependencies`.
|
|
47
47
|
* 2. Require `providerBindings[moniker].connection` for every moniker.
|
|
48
|
-
* 3. Filter candidates by bound connection type
|
|
48
|
+
* 3. Filter candidates by bound connection type.
|
|
49
49
|
* 4. Throw when zero or multiple candidates remain.
|
|
50
50
|
* 5. Toposort selected descriptors using `dependencies`.
|
|
51
51
|
*/
|
|
52
|
-
export declare function resolveProviders
|
|
52
|
+
export declare function resolveProviders(needs: ReadonlySet<ProviderMoniker>, candidates: readonly ProviderDescriptor[], options?: ResolveProvidersOptions): ResolutionPlan;
|
|
53
53
|
export {};
|
|
54
54
|
//# sourceMappingURL=resolveProviders.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolveProviders.d.ts","sourceRoot":"","sources":["../../../src/capabilities/resolveProviders.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAA;AAEtE,OAAO,KAAK,EAAE,eAAe,EAAiB,MAAM,mCAAmC,CAAA;AAEvF,OAAO,KAAK,EAAE,kBAAkB,EAAE,
|
|
1
|
+
{"version":3,"file":"resolveProviders.d.ts","sourceRoot":"","sources":["../../../src/capabilities/resolveProviders.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAA;AAEtE,OAAO,KAAK,EAAE,eAAe,EAAiB,MAAM,mCAAmC,CAAA;AAEvF,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAA;AAEvD,MAAM,WAAW,cAAc;IAC7B,0EAA0E;IAC1E,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC,MAAM,CAAC,eAAe,EAAE,MAAM,CAAC,CAAC,CAAA;IAC5D,uDAAuD;IACvD,QAAQ,CAAC,QAAQ,EAAE,SAAS,kBAAkB,EAAE,CAAA;IAChD,qEAAqE;IACrE,QAAQ,CAAC,QAAQ,EAAE,SAAS,kBAAkB,EAAE,CAAA;CACjD;AAED,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,UAAU,EAAE,kBAAkB,CAAA;IACvC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;CACxB;AAED,qBAAa,sBAAuB,SAAQ,KAAK;IAC/C,QAAQ,CAAC,OAAO,EAAE,eAAe,CAAA;IACjC,QAAQ,CAAC,OAAO,EAAE,SAA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A,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AAGzC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;
|
|
1
|
+
{"version":3,"file":"adaptLegacyConfig.d.ts","sourceRoot":"","sources":["../../../src/config/adaptLegacyConfig.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AAGzC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAmLnD;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,WAAW,CAAC,MAAM,CAAC,GAAG,MAAM,CA+CrE"}
|