@xyo-network/module-model 7.0.1 → 7.0.3

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.
Files changed (97) hide show
  1. package/dist/neutral/Config/Archiving.d.ts +1 -1
  2. package/dist/neutral/Config/Archiving.d.ts.map +1 -1
  3. package/dist/neutral/Config/Config.d.ts +3 -3
  4. package/dist/neutral/Config/Config.d.ts.map +1 -1
  5. package/dist/neutral/Config/Fields.d.ts +2 -2
  6. package/dist/neutral/Config/Fields.d.ts.map +1 -1
  7. package/dist/neutral/Config/Security.d.ts +1 -1
  8. package/dist/neutral/Config/Security.d.ts.map +1 -1
  9. package/dist/neutral/CreatableModule/CreatableModule.d.ts +2 -2
  10. package/dist/neutral/CreatableModule/CreatableModule.d.ts.map +1 -1
  11. package/dist/neutral/CreatableModule/CreatableModuleRegistry.d.ts +1 -1
  12. package/dist/neutral/CreatableModule/CreatableModuleRegistry.d.ts.map +1 -1
  13. package/dist/neutral/CreatableModule/ModuleFactory.d.ts +2 -2
  14. package/dist/neutral/CreatableModule/ModuleFactory.d.ts.map +1 -1
  15. package/dist/neutral/DetailsError.d.ts +1 -1
  16. package/dist/neutral/DetailsError.d.ts.map +1 -1
  17. package/dist/neutral/EventsModels/ModuleBusy.d.ts +1 -1
  18. package/dist/neutral/EventsModels/ModuleBusy.d.ts.map +1 -1
  19. package/dist/neutral/EventsModels/ModuleError.d.ts +1 -1
  20. package/dist/neutral/EventsModels/ModuleError.d.ts.map +1 -1
  21. package/dist/neutral/EventsModels/ModuleQueried.d.ts +2 -2
  22. package/dist/neutral/EventsModels/ModuleQueried.d.ts.map +1 -1
  23. package/dist/neutral/Job/JobQueue.d.ts +1 -1
  24. package/dist/neutral/Job/JobQueue.d.ts.map +1 -1
  25. package/dist/neutral/ModuleDescription.d.ts +1 -1
  26. package/dist/neutral/ModuleDescription.d.ts.map +1 -1
  27. package/dist/neutral/ModuleFactoryLocatorInstance.d.ts +1 -1
  28. package/dist/neutral/ModuleFactoryLocatorInstance.d.ts.map +1 -1
  29. package/dist/neutral/ModuleIdentifier.d.ts +1 -1
  30. package/dist/neutral/ModuleIdentifier.d.ts.map +1 -1
  31. package/dist/neutral/ModuleIdentifierTransformer.d.ts +1 -1
  32. package/dist/neutral/ModuleIdentifierTransformer.d.ts.map +1 -1
  33. package/dist/neutral/ModuleQueryHandlerResult.d.ts +1 -1
  34. package/dist/neutral/ModuleQueryHandlerResult.d.ts.map +1 -1
  35. package/dist/neutral/ModuleQueryResult.d.ts +1 -1
  36. package/dist/neutral/ModuleQueryResult.d.ts.map +1 -1
  37. package/dist/neutral/ModuleStatusReporter.d.ts +1 -1
  38. package/dist/neutral/ModuleStatusReporter.d.ts.map +1 -1
  39. package/dist/neutral/Payload/Address.d.ts +2 -2
  40. package/dist/neutral/Payload/Address.d.ts.map +1 -1
  41. package/dist/neutral/Payload/AddressPreviousHash.d.ts +2 -2
  42. package/dist/neutral/Payload/AddressPreviousHash.d.ts.map +1 -1
  43. package/dist/neutral/Payload/Description.d.ts +1 -1
  44. package/dist/neutral/Payload/Description.d.ts.map +1 -1
  45. package/dist/neutral/Payload/ModuleState.d.ts +2 -2
  46. package/dist/neutral/Payload/ModuleState.d.ts.map +1 -1
  47. package/dist/neutral/Queries/Manifest.d.ts +2 -2
  48. package/dist/neutral/Queries/Manifest.d.ts.map +1 -1
  49. package/dist/neutral/Queries/ModuleAddress/Query.d.ts +2 -2
  50. package/dist/neutral/Queries/ModuleAddress/Query.d.ts.map +1 -1
  51. package/dist/neutral/Queries/State.d.ts +2 -2
  52. package/dist/neutral/Queries/State.d.ts.map +1 -1
  53. package/dist/neutral/Queries/Subscribe.d.ts +2 -2
  54. package/dist/neutral/Queries/Subscribe.d.ts.map +1 -1
  55. package/dist/neutral/QueryableModule/IsQueryableModuleFactory.d.ts +1 -1
  56. package/dist/neutral/QueryableModule/IsQueryableModuleFactory.d.ts.map +1 -1
  57. package/dist/neutral/QueryableModule/QueryableModule.d.ts +1 -1
  58. package/dist/neutral/QueryableModule/QueryableModule.d.ts.map +1 -1
  59. package/dist/neutral/QueryableModule/QueryableModuleFields.d.ts +2 -2
  60. package/dist/neutral/QueryableModule/QueryableModuleFields.d.ts.map +1 -1
  61. package/dist/neutral/QueryableModule/QueryableModuleFunctions.d.ts +2 -2
  62. package/dist/neutral/QueryableModule/QueryableModuleFunctions.d.ts.map +1 -1
  63. package/dist/neutral/QueryableModule/QueryableModuleParams.d.ts +2 -2
  64. package/dist/neutral/QueryableModule/QueryableModuleParams.d.ts.map +1 -1
  65. package/dist/neutral/QueryableModule/asQueryableModule.d.ts +1 -1
  66. package/dist/neutral/QueryableModule/asQueryableModule.d.ts.map +1 -1
  67. package/dist/neutral/QueryableModule/asQueryableModuleObject.d.ts +1 -1
  68. package/dist/neutral/QueryableModule/asQueryableModuleObject.d.ts.map +1 -1
  69. package/dist/neutral/QueryableModule/isQueryableModule.d.ts +2 -2
  70. package/dist/neutral/QueryableModule/isQueryableModule.d.ts.map +1 -1
  71. package/dist/neutral/QueryableModule/isQueryableModuleObject.d.ts +1 -1
  72. package/dist/neutral/QueryableModule/isQueryableModuleObject.d.ts.map +1 -1
  73. package/dist/neutral/index.mjs +31 -31
  74. package/dist/neutral/index.mjs.map +1 -1
  75. package/dist/neutral/instance/Instance.d.ts +3 -3
  76. package/dist/neutral/instance/Instance.d.ts.map +1 -1
  77. package/dist/neutral/instance/ModuleRepository.d.ts +1 -1
  78. package/dist/neutral/instance/ModuleRepository.d.ts.map +1 -1
  79. package/dist/neutral/instance/ModuleResolver.d.ts +2 -2
  80. package/dist/neutral/instance/ModuleResolver.d.ts.map +1 -1
  81. package/dist/neutral/instance/ObjectFilter.d.ts +2 -2
  82. package/dist/neutral/instance/ObjectFilter.d.ts.map +1 -1
  83. package/dist/neutral/instance/ObjectResolver.d.ts +1 -1
  84. package/dist/neutral/instance/ObjectResolver.d.ts.map +1 -1
  85. package/dist/neutral/instance/asModuleInstance.d.ts +1 -1
  86. package/dist/neutral/instance/asModuleInstance.d.ts.map +1 -1
  87. package/dist/neutral/instance/attachable/AttachableInstance.d.ts +2 -2
  88. package/dist/neutral/instance/attachable/AttachableInstance.d.ts.map +1 -1
  89. package/dist/neutral/instance/attachable/asAttachableInstance.d.ts +1 -1
  90. package/dist/neutral/instance/attachable/asAttachableInstance.d.ts.map +1 -1
  91. package/dist/neutral/instance/attachable/isAttachableInstance.d.ts +1 -1
  92. package/dist/neutral/instance/attachable/isAttachableInstance.d.ts.map +1 -1
  93. package/dist/neutral/instance/isModuleInstance.d.ts +1 -1
  94. package/dist/neutral/instance/isModuleInstance.d.ts.map +1 -1
  95. package/dist/neutral/withModule.d.ts +1 -1
  96. package/dist/neutral/withModule.d.ts.map +1 -1
  97. package/package.json +18 -20
@@ -1,5 +1,5 @@
1
- import type { TypeCheck } from '@xylabs/sdk-js';
2
- import type { Schema } from '@xyo-network/sdk-protocol-js';
1
+ import type { TypeCheck } from '@xylabs/sdk';
2
+ import type { Schema } from '@xyo-network/sdk-protocol';
3
3
  import type { QueryableModule } from './QueryableModule.ts';
4
4
  export declare const requiredQueryableModuleQueries: Schema[];
5
5
  /** @deprecated use requiredQueryableModuleQueries instead */
@@ -1 +1 @@
1
- {"version":3,"file":"isQueryableModule.d.ts","sourceRoot":"","sources":["../../../src/QueryableModule/isQueryableModule.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAC/C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,8BAA8B,CAAA;AAK1D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAA;AAE3D,eAAO,MAAM,8BAA8B,EAAE,MAAM,EAA6B,CAAA;AAEhF,6DAA6D;AAC7D,eAAO,MAAM,qBAAqB,EAAE,MAAM,EAAmC,CAAA;AAK7E,eAAO,MAAM,iBAAiB,EAAE,SAAS,CAAC,eAAe,CAA6E,CAAA;AAEtI,gDAAgD;AAChD,eAAO,MAAM,QAAQ,EAAE,SAAS,CAAC,eAAe,CAAqB,CAAA"}
1
+ {"version":3,"file":"isQueryableModule.d.ts","sourceRoot":"","sources":["../../../src/QueryableModule/isQueryableModule.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AAC5C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAA;AAKvD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAA;AAE3D,eAAO,MAAM,8BAA8B,EAAE,MAAM,EAA6B,CAAA;AAEhF,6DAA6D;AAC7D,eAAO,MAAM,qBAAqB,EAAE,MAAM,EAAmC,CAAA;AAK7E,eAAO,MAAM,iBAAiB,EAAE,SAAS,CAAC,eAAe,CAA6E,CAAA;AAEtI,gDAAgD;AAChD,eAAO,MAAM,QAAQ,EAAE,SAAS,CAAC,eAAe,CAAqB,CAAA"}
@@ -1,4 +1,4 @@
1
- import type { ObjectTypeShape, TypeCheck } from '@xylabs/sdk-js';
1
+ import type { ObjectTypeShape, TypeCheck } from '@xylabs/sdk';
2
2
  import type { QueryableModule } from './QueryableModule.ts';
3
3
  export declare const requiredQueryableModuleShape: ObjectTypeShape;
4
4
  /** @deprecated use requiredQueryableModuleShape instead */
@@ -1 +1 @@
1
- {"version":3,"file":"isQueryableModuleObject.d.ts","sourceRoot":"","sources":["../../../src/QueryableModule/isQueryableModuleObject.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAGhE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAA;AAE3D,eAAO,MAAM,4BAA4B,EAAE,eAI1C,CAAA;AAED,2DAA2D;AAC3D,eAAO,MAAM,mBAAmB,EAAE,eAA8C,CAAA;AAIhF,eAAO,MAAM,uBAAuB,EAAE,SAAS,CAAC,eAAe,CAAgD,CAAA;AAE/G,sDAAsD;AACtD,eAAO,MAAM,cAAc,EAAE,SAAS,CAAC,eAAe,CAA2B,CAAA"}
1
+ {"version":3,"file":"isQueryableModuleObject.d.ts","sourceRoot":"","sources":["../../../src/QueryableModule/isQueryableModuleObject.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AAG7D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAA;AAE3D,eAAO,MAAM,4BAA4B,EAAE,eAI1C,CAAA;AAED,2DAA2D;AAC3D,eAAO,MAAM,mBAAmB,EAAE,eAA8C,CAAA;AAIhF,eAAO,MAAM,uBAAuB,EAAE,SAAS,CAAC,eAAe,CAAgD,CAAA;AAE/G,sDAAsD;AACtD,eAAO,MAAM,cAAc,EAAE,SAAS,CAAC,eAAe,CAA2B,CAAA"}
@@ -12,11 +12,11 @@ import {
12
12
  zodAsFactory,
13
13
  zodIsFactory,
14
14
  zodToFactory
15
- } from "@xylabs/sdk-js";
15
+ } from "@xylabs/sdk";
16
16
  import {
17
17
  asSchema,
18
18
  PayloadZod
19
- } from "@xyo-network/sdk-protocol-js";
19
+ } from "@xyo-network/sdk-protocol";
20
20
  import * as z4 from "zod/mini";
21
21
 
22
22
  // src/Config/Fields.ts
@@ -72,8 +72,8 @@ function creatableModule() {
72
72
  }
73
73
 
74
74
  // src/CreatableModule/CreatableModuleRegistry.ts
75
- import { isTruthy } from "@xylabs/sdk-js";
76
- import { asSchema as asSchema2 } from "@xyo-network/sdk-protocol-js";
75
+ import { isTruthy } from "@xylabs/sdk";
76
+ import { asSchema as asSchema2 } from "@xyo-network/sdk-protocol";
77
77
  var buildModuleFactory = (mod, labels) => {
78
78
  const factory5 = {
79
79
  // Destructure instance properties
@@ -152,7 +152,7 @@ function labeledCreatableModuleFactory() {
152
152
  }
153
153
 
154
154
  // src/CreatableModule/ModuleFactory.ts
155
- import { assertEx } from "@xylabs/sdk-js";
155
+ import { assertEx } from "@xylabs/sdk";
156
156
  var ModuleFactory = class _ModuleFactory {
157
157
  configSchemas;
158
158
  creatableModule;
@@ -199,25 +199,25 @@ var ModuleDetailsError = class extends Error {
199
199
  };
200
200
 
201
201
  // src/instance/asModuleInstance.ts
202
- import { AsObjectFactory as AsObjectFactory3 } from "@xylabs/sdk-js";
202
+ import { AsObjectFactory as AsObjectFactory3 } from "@xylabs/sdk";
203
203
 
204
204
  // src/instance/isModuleInstance.ts
205
- import { IsObjectFactory as IsObjectFactory2 } from "@xylabs/sdk-js";
205
+ import { IsObjectFactory as IsObjectFactory2 } from "@xylabs/sdk";
206
206
 
207
207
  // src/QueryableModule/asQueryableModule.ts
208
- import { AsObjectFactory as AsObjectFactory2 } from "@xylabs/sdk-js";
208
+ import { AsObjectFactory as AsObjectFactory2 } from "@xylabs/sdk";
209
209
 
210
210
  // src/Queries/Manifest.ts
211
211
  import {
212
212
  zodAsFactory as zodAsFactory2,
213
213
  zodIsFactory as zodIsFactory2,
214
214
  zodToFactory as zodToFactory2
215
- } from "@xylabs/sdk-js";
215
+ } from "@xylabs/sdk";
216
216
  import {
217
217
  asSchema as asSchema3,
218
218
  PayloadZodOfSchema,
219
219
  QueryFieldsZod
220
- } from "@xyo-network/sdk-protocol-js";
220
+ } from "@xyo-network/sdk-protocol";
221
221
  import * as z6 from "zod/mini";
222
222
  var ModuleManifestQuerySchema = asSchema3("network.xyo.query.module.manifest", true);
223
223
  var ModuleManifestQueryZod = z6.extend(PayloadZodOfSchema(ModuleManifestQuerySchema), {
@@ -233,12 +233,12 @@ import {
233
233
  zodAsFactory as zodAsFactory3,
234
234
  zodIsFactory as zodIsFactory3,
235
235
  zodToFactory as zodToFactory3
236
- } from "@xylabs/sdk-js";
236
+ } from "@xylabs/sdk";
237
237
  import {
238
238
  asSchema as asSchema4,
239
239
  PayloadZodOfSchema as PayloadZodOfSchema2,
240
240
  QueryFieldsZod as QueryFieldsZod2
241
- } from "@xyo-network/sdk-protocol-js";
241
+ } from "@xyo-network/sdk-protocol";
242
242
  import * as z7 from "zod/mini";
243
243
  var ModuleAddressQuerySchema = asSchema4("network.xyo.query.module.address", true);
244
244
  var ModuleAddressQueryZod = z7.extend(PayloadZodOfSchema2(ModuleAddressQuerySchema), { ...QueryFieldsZod2.shape });
@@ -251,12 +251,12 @@ import {
251
251
  zodAsFactory as zodAsFactory4,
252
252
  zodIsFactory as zodIsFactory4,
253
253
  zodToFactory as zodToFactory4
254
- } from "@xylabs/sdk-js";
254
+ } from "@xylabs/sdk";
255
255
  import {
256
256
  asSchema as asSchema5,
257
257
  PayloadZodOfSchema as PayloadZodOfSchema3,
258
258
  QueryFieldsZod as QueryFieldsZod3
259
- } from "@xyo-network/sdk-protocol-js";
259
+ } from "@xyo-network/sdk-protocol";
260
260
  import * as z8 from "zod/mini";
261
261
  var ModuleStateQuerySchema = asSchema5("network.xyo.query.module.state", true);
262
262
  var ModuleStateQueryZod = z8.extend(PayloadZodOfSchema3(ModuleStateQuerySchema), { ...QueryFieldsZod3.shape });
@@ -269,12 +269,12 @@ import {
269
269
  zodAsFactory as zodAsFactory5,
270
270
  zodIsFactory as zodIsFactory5,
271
271
  zodToFactory as zodToFactory5
272
- } from "@xylabs/sdk-js";
272
+ } from "@xylabs/sdk";
273
273
  import {
274
274
  asSchema as asSchema6,
275
275
  PayloadZodOfSchema as PayloadZodOfSchema4,
276
276
  QueryFieldsZod as QueryFieldsZod4
277
- } from "@xyo-network/sdk-protocol-js";
277
+ } from "@xyo-network/sdk-protocol";
278
278
  import * as z9 from "zod/mini";
279
279
  var ModuleSubscribeQuerySchema = asSchema6("network.xyo.query.module.subscribe", true);
280
280
  var ModuleSubscribeQueryZod = z9.extend(PayloadZodOfSchema4(ModuleSubscribeQuerySchema), {
@@ -291,10 +291,10 @@ var asModuleSubscribeQuery = zodAsFactory5(ModuleSubscribeQueryZod, "asModuleSub
291
291
  var toModuleSubscribeQuery = zodToFactory5(ModuleSubscribeQueryZod, "toModuleSubscribeQuery");
292
292
 
293
293
  // src/QueryableModule/asQueryableModuleObject.ts
294
- import { AsObjectFactory } from "@xylabs/sdk-js";
294
+ import { AsObjectFactory } from "@xylabs/sdk";
295
295
 
296
296
  // src/QueryableModule/isQueryableModuleObject.ts
297
- import { IsObjectFactory } from "@xylabs/sdk-js";
297
+ import { IsObjectFactory } from "@xylabs/sdk";
298
298
  var requiredQueryableModuleShape = {
299
299
  address: "string",
300
300
  queries: "array",
@@ -345,10 +345,10 @@ var isModuleInstance = factory3.create(requiredModuleInstanceFunctions, [isQuery
345
345
  var asModuleInstance = AsObjectFactory3.create(isModuleInstance);
346
346
 
347
347
  // src/instance/attachable/asAttachableInstance.ts
348
- import { AsObjectFactory as AsObjectFactory4 } from "@xylabs/sdk-js";
348
+ import { AsObjectFactory as AsObjectFactory4 } from "@xylabs/sdk";
349
349
 
350
350
  // src/instance/attachable/isAttachableInstance.ts
351
- import { IsObjectFactory as IsObjectFactory3 } from "@xylabs/sdk-js";
351
+ import { IsObjectFactory as IsObjectFactory3 } from "@xylabs/sdk";
352
352
  var requiredAttachableModuleInstanceFunctions = {
353
353
  downResolver: "object",
354
354
  upResolver: "object"
@@ -362,12 +362,12 @@ var isAttachableModuleInstance = factory4.create(requiredAttachableModuleInstanc
362
362
  var asAttachableModuleInstance = AsObjectFactory4.create(isAttachableModuleInstance);
363
363
 
364
364
  // src/instance/attachable/AttachableInstance.ts
365
- import { IsObjectFactory as IsObjectFactory4 } from "@xylabs/sdk-js";
365
+ import { IsObjectFactory as IsObjectFactory4 } from "@xylabs/sdk";
366
366
  var IsAttachableModuleInstanceFactory = class extends IsObjectFactory4 {
367
367
  };
368
368
 
369
369
  // src/instance/Instance.ts
370
- import { IsObjectFactory as IsObjectFactory5, toSafeJsonString } from "@xylabs/sdk-js";
370
+ import { IsObjectFactory as IsObjectFactory5, toSafeJsonString } from "@xylabs/sdk";
371
371
  var DeadModuleError = class _DeadModuleError extends Error {
372
372
  error;
373
373
  id;
@@ -450,7 +450,7 @@ var isSerializable = (value, maxDepth = 10) => {
450
450
  };
451
451
 
452
452
  // src/ModuleIdentifier.ts
453
- import { isAddress } from "@xylabs/sdk-js";
453
+ import { isAddress } from "@xylabs/sdk";
454
454
  var MODULE_PATH_SEPARATOR = ":";
455
455
  var DisallowedModuleIdentifierCharacters = {
456
456
  " ": true,
@@ -501,11 +501,11 @@ import {
501
501
  zodAsFactory as zodAsFactory6,
502
502
  zodIsFactory as zodIsFactory6,
503
503
  zodToFactory as zodToFactory6
504
- } from "@xylabs/sdk-js";
504
+ } from "@xylabs/sdk";
505
505
  import {
506
506
  asSchema as asSchema7,
507
507
  PayloadZodOfSchema as PayloadZodOfSchema5
508
- } from "@xyo-network/sdk-protocol-js";
508
+ } from "@xyo-network/sdk-protocol";
509
509
  import * as z10 from "zod/mini";
510
510
  var AddressSchema = asSchema7("network.xyo.address", true);
511
511
  var AddressChildSchema = asSchema7("network.xyo.address.child", true);
@@ -528,11 +528,11 @@ import {
528
528
  zodAsFactory as zodAsFactory7,
529
529
  zodIsFactory as zodIsFactory7,
530
530
  zodToFactory as zodToFactory7
531
- } from "@xylabs/sdk-js";
531
+ } from "@xylabs/sdk";
532
532
  import {
533
533
  asSchema as asSchema8,
534
534
  PayloadZodOfSchema as PayloadZodOfSchema6
535
- } from "@xyo-network/sdk-protocol-js";
535
+ } from "@xyo-network/sdk-protocol";
536
536
  import * as z11 from "zod/mini";
537
537
  var AddressPreviousHashSchema = asSchema8("network.xyo.address.hash.previous", true);
538
538
  var AddressPreviousHashPayloadZod = z11.extend(PayloadZodOfSchema6(AddressPreviousHashSchema), {
@@ -548,8 +548,8 @@ import {
548
548
  zodAsFactory as zodAsFactory8,
549
549
  zodIsFactory as zodIsFactory8,
550
550
  zodToFactory as zodToFactory8
551
- } from "@xylabs/sdk-js";
552
- import { asSchema as asSchema9, PayloadZodOfSchema as PayloadZodOfSchema7 } from "@xyo-network/sdk-protocol-js";
551
+ } from "@xylabs/sdk";
552
+ import { asSchema as asSchema9, PayloadZodOfSchema as PayloadZodOfSchema7 } from "@xyo-network/sdk-protocol";
553
553
  import * as z12 from "zod/mini";
554
554
  var ModuleDescriptionSchema = asSchema9("network.xyo.module.description", true);
555
555
  var ModuleDescriptionPayloadZod = z12.intersection(PayloadZodOfSchema7(ModuleDescriptionSchema), z12.custom());
@@ -562,12 +562,12 @@ import {
562
562
  zodAsFactory as zodAsFactory9,
563
563
  zodIsFactory as zodIsFactory9,
564
564
  zodToFactory as zodToFactory9
565
- } from "@xylabs/sdk-js";
565
+ } from "@xylabs/sdk";
566
566
  import {
567
567
  asSchema as asSchema10,
568
568
  isPayloadOfSchemaTypeWithSources,
569
569
  PayloadZodOfSchema as PayloadZodOfSchema8
570
- } from "@xyo-network/sdk-protocol-js";
570
+ } from "@xyo-network/sdk-protocol";
571
571
  import * as z13 from "zod/mini";
572
572
  var ModuleStateSchema = asSchema10("network.xyo.module.state", true);
573
573
  var ModuleStateZod = z13.extend(PayloadZodOfSchema8(ModuleStateSchema), { state: z13.custom() });
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/Config/Archiving.ts", "../../src/Config/Config.ts", "../../src/Config/Fields.ts", "../../src/Config/Reentrancy.ts", "../../src/Config/Security.ts", "../../src/CreatableModule/CreatableModule.ts", "../../src/CreatableModule/CreatableModuleRegistry.ts", "../../src/CreatableModule/LabeledCreatableModule.ts", "../../src/CreatableModule/LabeledCreatableModuleFactory.ts", "../../src/CreatableModule/ModuleFactory.ts", "../../src/DetailsError.ts", "../../src/instance/asModuleInstance.ts", "../../src/instance/isModuleInstance.ts", "../../src/QueryableModule/asQueryableModule.ts", "../../src/Queries/Manifest.ts", "../../src/Queries/ModuleAddress/Query.ts", "../../src/Queries/State.ts", "../../src/Queries/Subscribe.ts", "../../src/QueryableModule/asQueryableModuleObject.ts", "../../src/QueryableModule/isQueryableModuleObject.ts", "../../src/QueryableModule/IsQueryableModuleFactory.ts", "../../src/QueryableModule/isQueryableModule.ts", "../../src/instance/attachable/asAttachableInstance.ts", "../../src/instance/attachable/isAttachableInstance.ts", "../../src/instance/attachable/AttachableInstance.ts", "../../src/instance/Instance.ts", "../../src/instance/ObjectFilter.ts", "../../src/instance/ModuleFilter.ts", "../../src/instance/ObjectResolver.ts", "../../src/instance/ModuleResolver.ts", "../../src/Labels/Labels.ts", "../../src/Labels/standard/View.ts", "../../src/lib/duplicateModules.ts", "../../src/lib/serializable.ts", "../../src/ModuleIdentifier.ts", "../../src/Payload/Address.ts", "../../src/Payload/AddressPreviousHash.ts", "../../src/Payload/Description.ts", "../../src/Payload/ModuleState.ts", "../../src/withModule.ts"],
4
- "sourcesContent": ["import type { Schema } from '@xyo-network/sdk-protocol-js'\nimport * as z from 'zod/mini'\n\nimport type { ModuleIdentifier } from '../ModuleIdentifier.ts'\n\nexport const ArchivingModuleConfigZod: z.ZodMiniObject<{\n archiving: z.ZodMiniOptional<z.ZodMiniObject<{\n archivists: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniCustom<ModuleIdentifier, ModuleIdentifier>>>\n queries: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniCustom<Schema, Schema>>>\n }, z.core.$strip>>\n}, z.core.$strip> = z.object({\n archiving: z.optional(z.object({\n archivists: z.optional(z.array(z.custom<ModuleIdentifier>())),\n queries: z.optional(z.array(z.custom<Schema>())),\n })),\n})\n\nexport type ArchivingModuleConfig = z.infer<typeof ArchivingModuleConfigZod>\n", "import type { EmptyObject } from '@xylabs/sdk-js'\nimport {\n zodAsFactory, zodIsFactory, zodToFactory,\n} from '@xylabs/sdk-js'\nimport {\n asSchema, type Payload, PayloadZod, type Schema,\n} from '@xyo-network/sdk-protocol-js'\nimport * as z from 'zod/mini'\n\nimport { ArchivingModuleConfigZod } from './Archiving.ts'\nimport { ModuleConfigFieldsZod } from './Fields.ts'\nimport { ArchivingReentrancyConfigZod } from './Reentrancy.ts'\n\nexport const ModuleConfigSchema: 'network.xyo.module.config' & {\n readonly __schema: true\n} = asSchema('network.xyo.module.config', true)\nexport type ModuleConfigSchema = typeof ModuleConfigSchema\n\nexport type WithAdditional<T extends EmptyObject = EmptyObject, TAdditional extends EmptyObject = EmptyObject>\n = T & TAdditional\n\nexport const ModuleConfigZod: z.ZodMiniObject<\n & (typeof PayloadZod)['shape']\n & (typeof ModuleConfigFieldsZod)['shape']\n & (typeof ArchivingModuleConfigZod)['shape']\n & (typeof ArchivingReentrancyConfigZod)['shape'],\n z.core.$strip\n> = z.extend(PayloadZod, {\n ...ModuleConfigFieldsZod.shape,\n ...ArchivingModuleConfigZod.shape,\n ...ArchivingReentrancyConfigZod.shape,\n})\n\nexport type ModuleConfigBase = z.infer<typeof ModuleConfigZod>\n\nexport const isModuleConfig: ReturnType<typeof zodIsFactory<ModuleConfigBase>> = zodIsFactory(ModuleConfigZod)\nexport const asModuleConfig: ReturnType<typeof zodAsFactory<ModuleConfigBase>> = zodAsFactory(ModuleConfigZod, 'asModuleConfig')\nexport const toModuleConfig: ReturnType<typeof zodToFactory<ModuleConfigBase>> = zodToFactory(ModuleConfigZod, 'toModuleConfig')\n\nexport type ModuleConfig<TConfig extends EmptyObject | Payload = EmptyObject, TSchema extends Schema | void = void> = Payload<\n WithAdditional<Omit<ModuleConfigBase, 'schema'>, TConfig>,\n TSchema extends void ? TConfig extends Payload ? TConfig['schema']\n : Schema : TSchema\n>\n\nexport type AnyConfigSchema<TConfig extends Omit<ModuleConfig, 'schema'> & { schema: Schema } = Omit<ModuleConfig, 'schema'> & { schema: Schema }>\n = ModuleConfig<TConfig, Schema>\n\nexport type OptionalConfigSchema<TConfig extends AnyConfigSchema<ModuleConfig> = AnyConfigSchema<ModuleConfig>> = Omit<TConfig, 'schema'> & {\n schema?: TConfig['schema']\n}\n\nexport type AnyModuleConfig = AnyConfigSchema<ModuleConfig>\n", "import type { LogLevelValue, RetryConfig } from '@xylabs/sdk-js'\nimport type { Schema } from '@xyo-network/sdk-protocol-js'\nimport * as z from 'zod/mini'\n\nimport type { Labels } from '../Labels/index.ts'\nimport type { ModuleIdentifier, ModuleName } from '../ModuleIdentifier.ts'\nimport type { ModuleSecurityConfig } from './Security.ts'\n\nexport const ModuleConfigFieldsZod: z.ZodMiniObject<{\n allowedQueries: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniCustom<Schema, Schema>>>\n archivist: z.ZodMiniOptional<z.ZodMiniCustom<ModuleIdentifier, ModuleIdentifier>>\n labels: z.ZodMiniOptional<z.ZodMiniCustom<Labels, Labels>>\n logLevel: z.ZodMiniOptional<z.ZodMiniCustom<LogLevelValue, LogLevelValue>>\n name: z.ZodMiniOptional<z.ZodMiniCustom<ModuleName, ModuleName>>\n paging: z.ZodMiniOptional<z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniObject<{\n size: z.ZodMiniOptional<z.ZodMiniNumber<number>>\n }, z.core.$strip>>>\n retry: z.ZodMiniOptional<z.ZodMiniCustom<RetryConfig, RetryConfig>>\n security: z.ZodMiniOptional<z.ZodMiniCustom<ModuleSecurityConfig, ModuleSecurityConfig>>\n sign: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>\n storeQueries: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>\n timeBudget: z.ZodMiniOptional<z.ZodMiniNumber<number>>\n timestamp: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>\n}, z.core.$strip> = z.object({\n allowedQueries: z.optional(z.array(z.custom<Schema>())),\n archivist: z.optional(z.custom<ModuleIdentifier>()),\n labels: z.optional(z.custom<Labels>()),\n logLevel: z.optional(z.custom<LogLevelValue>()),\n name: z.optional(z.custom<ModuleName>()),\n paging: z.optional(z.record(z.string(), z.object({ size: z.optional(z.number()) }))),\n retry: z.optional(z.custom<RetryConfig>()),\n security: z.optional(z.custom<ModuleSecurityConfig>()),\n sign: z.optional(z.boolean()),\n storeQueries: z.optional(z.boolean()),\n timeBudget: z.optional(z.number()),\n timestamp: z.optional(z.boolean()),\n})\n\nexport type ModuleConfigFields = z.infer<typeof ModuleConfigFieldsZod>\n", "import * as z from 'zod/mini'\n\nexport const ArchivingReentrancyConfigZod: z.ZodMiniObject<{\n reentrancy: z.ZodMiniOptional<z.ZodMiniObject<{\n action: z.ZodMiniUnion<readonly [z.ZodMiniLiteral<'skip'>, z.ZodMiniLiteral<'wait'>]>\n scope: z.ZodMiniLiteral<'global'>\n }, z.core.$strip>>\n}, z.core.$strip> = z.object({\n reentrancy: z.optional(z.object({\n action: z.union([z.literal('skip'), z.literal('wait')]),\n scope: z.literal('global'),\n })),\n})\n\nexport type ArchivingReentrancyConfig = z.infer<typeof ArchivingReentrancyConfigZod>\n", "import type { Schema, XyoAddress } from '@xyo-network/sdk-protocol-js'\nimport * as z from 'zod/mini'\n\nexport type CosigningAddressSet = XyoAddress[]\n\nexport const ModuleSecurityConfigZod: z.ZodMiniObject<{\n allowAnonymous: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>\n allowed: z.ZodMiniOptional<z.ZodMiniRecord<z.ZodMiniCustom<Schema, Schema>, z.ZodMiniArray<z.ZodMiniCustom<XyoAddress | CosigningAddressSet, XyoAddress | CosigningAddressSet>>>>\n disallowed: z.ZodMiniOptional<z.ZodMiniRecord<z.ZodMiniCustom<Schema, Schema>, z.ZodMiniArray<z.ZodMiniCustom<XyoAddress, XyoAddress>>>>\n}, z.core.$strip> = z.object({\n allowAnonymous: z.optional(z.boolean()),\n allowed: z.optional(z.record(z.custom<Schema>(), z.array(z.custom<XyoAddress | CosigningAddressSet>()))),\n disallowed: z.optional(z.record(z.custom<Schema>(), z.array(z.custom<XyoAddress>()))),\n})\n\nexport type ModuleSecurityConfig = z.infer<typeof ModuleSecurityConfigZod>\n", "import type {\n Creatable, CreatableInstance, Logger,\n} from '@xylabs/sdk-js'\nimport type { Schema } from '@xyo-network/sdk-protocol-js'\n\nimport type { ModuleEventData } from '../EventsModels/index.ts'\nimport type { AttachableModuleInstance } from '../instance/index.ts'\nimport type { QueryableModuleParams } from '../QueryableModule/index.ts'\n\nexport interface CreatableModuleInstance<TParams extends QueryableModuleParams = QueryableModuleParams, TEventData extends ModuleEventData = ModuleEventData>\n extends CreatableInstance<TParams, TEventData>, AttachableModuleInstance<TParams, TEventData> {}\n\nexport interface CreatableModuleFactory<T extends CreatableModuleInstance = CreatableModuleInstance>\n extends Omit<CreatableModule<T>, 'create' | 'createHandler' | 'paramsHandler'> {\n creatableModule: CreatableModule<T>\n defaultParams?: Partial<T['params']>\n\n create(\n this: CreatableModuleFactory<T>,\n params?: Partial<T['params']>): Promise<T>\n}\n\nexport interface CreatableModule<T extends CreatableModuleInstance = CreatableModuleInstance> extends Creatable<T> {\n configSchemas: Schema[]\n defaultConfigSchema: Schema\n defaultLogger?: Logger\n new(key: unknown, params: Partial<T['params']>): T\n factory(params?: Partial<T['params']>): CreatableModuleFactory<T>\n}\n\n/**\n * Class annotation to be used to decorate Modules which support\n * an asynchronous creation pattern\n * @returns The decorated Module requiring it implement the members\n * of the CreatableModule as statics properties/methods\n */\nexport function creatableModule<TModule extends CreatableModuleInstance = CreatableModuleInstance>() {\n return <U extends CreatableModule<TModule>>(constructor: U): void => {\n // eslint-disable-next-line @typescript-eslint/no-unused-expressions\n constructor\n }\n}\n", "import { isTruthy } from '@xylabs/sdk-js'\nimport { asSchema, type Schema } from '@xyo-network/sdk-protocol-js'\n\nimport type { Labels } from '../Labels/index.ts'\nimport type { CreatableModuleFactory, CreatableModuleInstance } from './CreatableModule.ts'\nimport type { LabeledCreatableModuleFactory } from './LabeledCreatableModuleFactory.ts'\n\nexport type CreatableModuleRegistry = Record<Schema, (CreatableModuleFactory | LabeledCreatableModuleFactory)[] | undefined>\n\nconst buildModuleFactory = <TModule extends CreatableModuleInstance>(\n mod: CreatableModuleFactory<TModule>,\n labels?: Labels,\n): LabeledCreatableModuleFactory<TModule> => {\n const factory: LabeledCreatableModuleFactory<TModule> = {\n // Destructure instance properties\n ...mod,\n\n configSchemas: mod.configSchemas,\n // Copy static methods\n create: mod.create.bind(mod),\n\n defaultConfigSchema: mod.defaultConfigSchema,\n // Merge module & supplied labels\n labels: { ...(mod as LabeledCreatableModuleFactory).labels, ...labels },\n }\n return factory\n}\n\nexport const registerCreatableModuleFactory = <TModule extends CreatableModuleInstance>(\n registry: CreatableModuleRegistry,\n factory: CreatableModuleFactory<TModule> | LabeledCreatableModuleFactory<TModule>,\n labels?: Labels,\n /** register this as the primary factory for every schema it supports */\n primary: boolean | Schema | Schema[] = false,\n): void => {\n const primarySchemas\n = primary !== true && isTruthy(primary)\n ? Array.isArray(primary)\n ? primary\n : [primary]\n : []\n\n for (const primarySchema of primarySchemas) {\n if (!factory.configSchemas.includes(primarySchema)) {\n console.warn(`Primary schema ${String(primary)} not found in factory configSchemas`)\n }\n }\n\n const isPrimaryForSchema = (schema: Schema) => {\n switch (typeof primary) {\n case 'boolean': {\n return primary\n }\n case 'string': {\n return schema === primary\n }\n case 'object': {\n if (Array.isArray(primary)) {\n return primary.includes(schema)\n }\n }\n }\n throw new Error(`Invalid primary value: ${String(primary)}`)\n }\n\n const factoryClone: LabeledCreatableModuleFactory<TModule> = buildModuleFactory(factory, labels)\n // add the defaultConfigSchema as the first key in the registry\n registry[factory.defaultConfigSchema] = [factoryClone, ...(registry[factoryClone.defaultConfigSchema] ?? [])]\n for (const schema of factoryClone.configSchemas) {\n registry[schema] = isPrimaryForSchema(schema) ? [factoryClone, ...(registry[schema] ?? [])] : [...(registry[schema] ?? []), factoryClone]\n }\n}\n\nexport const registerCreatableModuleFactories = (\n factories: (CreatableModuleFactory | LabeledCreatableModuleFactory)[],\n registry: CreatableModuleRegistry = {},\n primary = false,\n): CreatableModuleRegistry => {\n for (const factory of factories) {\n registerCreatableModuleFactory(registry, factory, undefined, primary)\n }\n return registry\n}\n\n/** @deprecated use registerCreatableModuleFactory instead */\nexport const assignCreatableModuleRegistry = (\n target: CreatableModuleRegistry = {},\n ...sources: CreatableModuleRegistry[]\n): CreatableModuleRegistry => {\n for (const source of sources)\n for (const [schemaString, factories] of Object.entries(source)) {\n const schema = asSchema(schemaString, true)\n if (factories) {\n const existingFactories = target[schema]\n target[schema] = [...existingFactories ?? [], ...factories]\n }\n }\n\n return target\n}\n", "import type { WithOptionalLabels } from '../Labels/index.ts'\nimport type { CreatableModule, CreatableModuleInstance } from './CreatableModule.ts'\nimport type { LabeledCreatableModuleFactory } from './LabeledCreatableModuleFactory.ts'\n\nexport interface LabeledCreatableModule<T extends CreatableModuleInstance = CreatableModuleInstance> extends CreatableModule<T>, WithOptionalLabels {\n factory(params?: Partial<T['params']>): LabeledCreatableModuleFactory<T>\n}\n\n/**\n * Class annotation to be used to decorate Modules which support\n * an asynchronous creation pattern\n * @returns The decorated Module requiring it implement the members\n * of the CreatableModule as statics properties/methods\n */\nexport function labeledCreatableModule<TModule extends CreatableModuleInstance = CreatableModuleInstance>() {\n return <U extends LabeledCreatableModule<TModule>>(constructor: U): void => {\n // eslint-disable-next-line @typescript-eslint/no-unused-expressions\n constructor\n }\n}\n", "import type { WithOptionalLabels } from '../Labels/index.ts'\nimport type { CreatableModuleFactory, CreatableModuleInstance } from './CreatableModule.ts'\n\nexport type LabeledCreatableModuleFactory<T extends CreatableModuleInstance = CreatableModuleInstance> = CreatableModuleFactory<T> & WithOptionalLabels\n\nexport const hasLabels = (factory: CreatableModuleFactory | LabeledCreatableModuleFactory): factory is LabeledCreatableModuleFactory => {\n return (factory as LabeledCreatableModuleFactory).labels !== undefined\n}\n\n/**\n * Class annotation to be used to decorate Modules which support\n * an asynchronous labeled creation factory pattern\n * @returns The decorated Module requiring it implement the members\n * of the CreatableModule as statics properties/methods\n */\nexport function labeledCreatableModuleFactory<TModule extends CreatableModuleInstance = CreatableModuleInstance>() {\n return <U extends LabeledCreatableModuleFactory<TModule>>(constructor: U): void => {\n // eslint-disable-next-line @typescript-eslint/no-unused-expressions\n constructor\n }\n}\n", "import type { Logger } from '@xylabs/sdk-js'\nimport { assertEx } from '@xylabs/sdk-js'\nimport type { Schema } from '@xyo-network/sdk-protocol-js'\n\nimport type { Labels, WithOptionalLabels } from '../Labels/index.ts'\nimport type {\n CreatableModule, CreatableModuleFactory, CreatableModuleInstance,\n} from './CreatableModule.ts'\n\nexport class ModuleFactory<TModule extends CreatableModuleInstance> implements CreatableModuleFactory<TModule> {\n configSchemas: CreatableModule<TModule>['configSchemas']\n\n creatableModule: CreatableModule<TModule>\n\n defaultConfigSchema: Schema\n\n defaultLogger?: Logger\n\n defaultParams?: Partial<TModule['params']>\n\n labels?: Labels\n\n constructor(\n creatableModule: CreatableModule<TModule>,\n params?: Partial<TModule['params']>,\n labels: Labels = {},\n ) {\n this.creatableModule = creatableModule\n this.defaultParams = params\n this.configSchemas = creatableModule.configSchemas\n this.defaultConfigSchema = creatableModule.defaultConfigSchema\n assertEx(this.configSchemas.includes(this.defaultConfigSchema), () => 'defaultConfigSchema must be in configSchemas')\n this.labels = Object.assign({}, (creatableModule as WithOptionalLabels).labels ?? {}, labels ?? {})\n }\n\n static withParams<T extends CreatableModuleInstance>(\n creatableModule: CreatableModule<T>,\n params?: Partial<T['params']>,\n labels: Labels = {},\n ): ModuleFactory<T> {\n return new ModuleFactory<T>(creatableModule, params, labels)\n }\n\n create(this: CreatableModuleFactory<TModule>, params?: Partial<TModule['params']>): Promise<TModule> {\n const mergedParams: TModule['params'] = {\n ...this.defaultParams,\n ...params,\n config: {\n schema: this.creatableModule.defaultConfigSchema,\n ...this.defaultParams?.config,\n ...params?.config,\n },\n }\n return this.creatableModule.create<TModule>(mergedParams)\n }\n\n factory<T extends CreatableModuleInstance>(this: CreatableModuleFactory<T>, params?: Partial<T['params']>, labels: Labels = {}): CreatableModuleFactory<T> {\n return new ModuleFactory<T>(this.creatableModule, params, labels)\n }\n}\n", "import type { JsonValue } from '@xylabs/sdk-js'\n\nexport class ModuleDetailsError extends Error {\n details?: JsonValue\n constructor(\n message: string,\n details?: JsonValue,\n ) {\n super(message)\n this.details = details\n this.name = 'ModuleError'\n }\n}\n", "import type { AsTypeFunction } from '@xylabs/sdk-js'\nimport { AsObjectFactory } from '@xylabs/sdk-js'\n\nimport type { AnyConfigSchema, ModuleConfig } from '../Config/Config.ts'\nimport type { ModuleEventData } from '../EventsModels/ModuleEventData.ts'\nimport type { QueryableModuleParams } from '../QueryableModule/QueryableModuleParams.ts'\nimport type { ModuleInstance } from './Instance.ts'\nimport { isModuleInstance } from './isModuleInstance.ts'\n\nexport const asModuleInstance: AsTypeFunction<ModuleInstance<QueryableModuleParams<AnyConfigSchema<ModuleConfig>>, ModuleEventData<object>>> = AsObjectFactory.create(isModuleInstance)\n", "import type { ObjectTypeShape, TypeCheck } from '@xylabs/sdk-js'\nimport { IsObjectFactory } from '@xylabs/sdk-js'\n\nimport { isQueryableModule } from '../QueryableModule/index.ts'\nimport type { ModuleInstance } from './Instance.ts'\n\nexport const requiredModuleInstanceFunctions: ObjectTypeShape = {\n manifest: 'function',\n state: 'function',\n}\n\n// we do not use IsInstanceFactory here to prevent a cycle\nconst factory = new IsObjectFactory<ModuleInstance>()\n\nexport const isModuleInstance: TypeCheck<ModuleInstance> = factory.create(requiredModuleInstanceFunctions, [isQueryableModule])\n", "import type { AsTypeFunction } from '@xylabs/sdk-js'\nimport { AsObjectFactory } from '@xylabs/sdk-js'\n\nimport type { AnyConfigSchema, ModuleConfig } from '../Config/Config.ts'\nimport type { ModuleEventData } from '../EventsModels/ModuleEventData.ts'\nimport { isQueryableModule } from './isQueryableModule.ts'\nimport type { QueryableModule } from './QueryableModule.ts'\nimport type { QueryableModuleParams } from './QueryableModuleParams.ts'\n\nexport const asQueryableModule: AsTypeFunction<QueryableModule<QueryableModuleParams<AnyConfigSchema<ModuleConfig>>, ModuleEventData<object>>> = AsObjectFactory.create(isQueryableModule)\n\n/** @deprecated use asQueryableModule instead */\nexport const asModule: AsTypeFunction<QueryableModule<QueryableModuleParams<AnyConfigSchema<ModuleConfig>>, ModuleEventData<object>>> = asQueryableModule\n", "import {\n zodAsFactory, zodIsFactory, zodToFactory,\n} from '@xylabs/sdk-js'\nimport {\n asSchema, PayloadZodOfSchema, QueryFieldsZod,\n} from '@xyo-network/sdk-protocol-js'\nimport * as z from 'zod/mini'\n\nexport const ModuleManifestQuerySchema: 'network.xyo.query.module.manifest' & {\n readonly __schema: true\n} = asSchema('network.xyo.query.module.manifest', true)\nexport type ModuleManifestQuerySchema = typeof ModuleManifestQuerySchema\n\nexport const ModuleManifestQueryZod: z.ZodMiniObject<\n & { schema: z.ZodMiniLiteral<ModuleManifestQuerySchema> }\n & (typeof QueryFieldsZod)['shape']\n & { maxDepth: z.ZodMiniOptional<z.ZodMiniNumber<number>> },\n z.core.$strip\n> = z.extend(PayloadZodOfSchema(ModuleManifestQuerySchema), {\n ...QueryFieldsZod.shape,\n maxDepth: z.optional(z.number()),\n})\n\nexport type ModuleManifestQuery = z.infer<typeof ModuleManifestQueryZod>\n\nexport const isModuleManifestQuery: ReturnType<typeof zodIsFactory<ModuleManifestQuery>> = zodIsFactory(ModuleManifestQueryZod)\nexport const asModuleManifestQuery: ReturnType<typeof zodAsFactory<ModuleManifestQuery>> = zodAsFactory(ModuleManifestQueryZod, 'asModuleManifestQuery')\nexport const toModuleManifestQuery: ReturnType<typeof zodToFactory<ModuleManifestQuery>> = zodToFactory(ModuleManifestQueryZod, 'toModuleManifestQuery')\n", "import {\n zodAsFactory, zodIsFactory, zodToFactory,\n} from '@xylabs/sdk-js'\nimport {\n asSchema, PayloadZodOfSchema, QueryFieldsZod,\n} from '@xyo-network/sdk-protocol-js'\nimport * as z from 'zod/mini'\n\nexport const ModuleAddressQuerySchema: 'network.xyo.query.module.address' & {\n readonly __schema: true\n} = asSchema('network.xyo.query.module.address', true)\nexport type ModuleAddressQuerySchema = typeof ModuleAddressQuerySchema\n\nexport const ModuleAddressQueryZod: z.ZodMiniObject<\n & { schema: z.ZodMiniLiteral<ModuleAddressQuerySchema> }\n & (typeof QueryFieldsZod)['shape'],\n z.core.$strip\n> = z.extend(PayloadZodOfSchema(ModuleAddressQuerySchema), { ...QueryFieldsZod.shape })\n\nexport type ModuleAddressQuery = z.infer<typeof ModuleAddressQueryZod>\n\nexport const isModuleAddressQuery: ReturnType<typeof zodIsFactory<ModuleAddressQuery>> = zodIsFactory(ModuleAddressQueryZod)\nexport const asModuleAddressQuery: ReturnType<typeof zodAsFactory<ModuleAddressQuery>> = zodAsFactory(ModuleAddressQueryZod, 'asModuleAddressQuery')\nexport const toModuleAddressQuery: ReturnType<typeof zodToFactory<ModuleAddressQuery>> = zodToFactory(ModuleAddressQueryZod, 'toModuleAddressQuery')\n", "import {\n zodAsFactory, zodIsFactory, zodToFactory,\n} from '@xylabs/sdk-js'\nimport {\n asSchema, PayloadZodOfSchema, QueryFieldsZod,\n} from '@xyo-network/sdk-protocol-js'\nimport * as z from 'zod/mini'\n\nexport const ModuleStateQuerySchema: 'network.xyo.query.module.state' & {\n readonly __schema: true\n} = asSchema('network.xyo.query.module.state', true)\nexport type ModuleStateQuerySchema = typeof ModuleStateQuerySchema\n\nexport const ModuleStateQueryZod: z.ZodMiniObject<\n & { schema: z.ZodMiniLiteral<ModuleStateQuerySchema> }\n & (typeof QueryFieldsZod)['shape'],\n z.core.$strip\n> = z.extend(PayloadZodOfSchema(ModuleStateQuerySchema), { ...QueryFieldsZod.shape })\n\nexport type ModuleStateQuery = z.infer<typeof ModuleStateQueryZod>\n\nexport const isModuleStateQuery: ReturnType<typeof zodIsFactory<ModuleStateQuery>> = zodIsFactory(ModuleStateQueryZod)\nexport const asModuleStateQuery: ReturnType<typeof zodAsFactory<ModuleStateQuery>> = zodAsFactory(ModuleStateQueryZod, 'asModuleStateQuery')\nexport const toModuleStateQuery: ReturnType<typeof zodToFactory<ModuleStateQuery>> = zodToFactory(ModuleStateQueryZod, 'toModuleStateQuery')\n", "import {\n zodAsFactory, zodIsFactory, zodToFactory,\n} from '@xylabs/sdk-js'\nimport {\n asSchema, PayloadZodOfSchema, QueryFieldsZod, type XyoAddress,\n} from '@xyo-network/sdk-protocol-js'\nimport * as z from 'zod/mini'\n\nexport const ModuleSubscribeQuerySchema: 'network.xyo.query.module.subscribe' & {\n readonly __schema: true\n} = asSchema('network.xyo.query.module.subscribe', true)\nexport type ModuleSubscribeQuerySchema = typeof ModuleSubscribeQuerySchema\n\nexport interface ModuleSubscribeFilter {\n /** @field if specified, at least one of the schemas must be present in the boundwtness to generate a notification */\n schema?: string[]\n}\n\n// requests notification when a boundwitness is added to the modules chain that meets the filter criteria\nexport const ModuleSubscribeQueryZod: z.ZodMiniObject<\n & { schema: z.ZodMiniLiteral<ModuleSubscribeQuerySchema> }\n & Omit<(typeof QueryFieldsZod)['shape'], 'address'>\n & {\n address: z.ZodMiniCustom<XyoAddress, XyoAddress>\n filter: z.ZodMiniOptional<z.ZodMiniNullable<z.ZodMiniCustom<ModuleSubscribeFilter, ModuleSubscribeFilter>>>\n maxQueue: z.ZodMiniOptional<z.ZodMiniNumber<number>>\n },\n z.core.$strip\n> = z.extend(PayloadZodOfSchema(ModuleSubscribeQuerySchema), {\n ...QueryFieldsZod.shape,\n /** @field The address that will receive notifications */\n address: z.custom<XyoAddress>(),\n /** @field A subscribe with a null for filter is an unsubscribe */\n filter: z.optional(z.nullable(z.custom<ModuleSubscribeFilter>())),\n /** @field The maximum events queued per send [may increase frequency] */\n maxQueue: z.optional(z.number()),\n})\n\nexport type ModuleSubscribeQuery = z.infer<typeof ModuleSubscribeQueryZod>\n\nexport const isModuleSubscribeQuery: ReturnType<typeof zodIsFactory<ModuleSubscribeQuery>> = zodIsFactory(ModuleSubscribeQueryZod)\nexport const asModuleSubscribeQuery: ReturnType<typeof zodAsFactory<ModuleSubscribeQuery>> = zodAsFactory(ModuleSubscribeQueryZod, 'asModuleSubscribeQuery')\nexport const toModuleSubscribeQuery: ReturnType<typeof zodToFactory<ModuleSubscribeQuery>> = zodToFactory(ModuleSubscribeQueryZod, 'toModuleSubscribeQuery')\n", "import type { AsTypeFunction } from '@xylabs/sdk-js'\nimport { AsObjectFactory } from '@xylabs/sdk-js'\n\nimport type { AnyConfigSchema, ModuleConfig } from '../Config/Config.ts'\nimport type { ModuleEventData } from '../EventsModels/ModuleEventData.ts'\nimport { isQueryableModuleObject } from './isQueryableModuleObject.ts'\nimport type { QueryableModule } from './QueryableModule.ts'\nimport type { QueryableModuleParams } from './QueryableModuleParams.ts'\n\nexport const asQueryableModuleObject: AsTypeFunction<QueryableModule<QueryableModuleParams<AnyConfigSchema<ModuleConfig>>, ModuleEventData<object>>> = AsObjectFactory.create(isQueryableModuleObject)\n\n/** @deprecated use asQueryableModuleObject instead */\nexport const asModuleObject: AsTypeFunction<QueryableModule<QueryableModuleParams<AnyConfigSchema<ModuleConfig>>, ModuleEventData<object>>> = asQueryableModuleObject\n", "import type { ObjectTypeShape, TypeCheck } from '@xylabs/sdk-js'\nimport { IsObjectFactory } from '@xylabs/sdk-js'\n\nimport type { QueryableModule } from './QueryableModule.ts'\n\nexport const requiredQueryableModuleShape: ObjectTypeShape = {\n address: 'string',\n queries: 'array',\n query: 'function',\n}\n\n/** @deprecated use requiredQueryableModuleShape instead */\nexport const requiredModuleShape: ObjectTypeShape = requiredQueryableModuleShape\n\nconst factory = new IsObjectFactory<QueryableModule>()\n\nexport const isQueryableModuleObject: TypeCheck<QueryableModule> = factory.create(requiredQueryableModuleShape)\n\n/** @deprecated use isQueryableModuleObject instead */\nexport const isModuleObject: TypeCheck<QueryableModule> = isQueryableModuleObject\n", "import type {\n AnyNonPromise,\n AnyObject, EmptyObject, TypeCheck,\n TypeCheckConfig,\n} from '@xylabs/sdk-js'\n\nimport { asQueryableModuleObject } from './asQueryableModuleObject.ts'\nimport { isQueryableModuleObject } from './isQueryableModuleObject.ts'\nimport type { QueryableModule } from './QueryableModule.ts'\n\nexport type QueryableModuleTypeCheck<T extends QueryableModule = QueryableModule> = TypeCheck<T>\n\n/** @deprecated use QueryableModuleTypeCheck instead */\nexport type ModuleTypeCheck<T extends QueryableModule = QueryableModule> = TypeCheck<T>\n\nexport class IsQueryableModuleFactory<T extends QueryableModule = QueryableModule> {\n create(expectedQueries?: string[], additionalChecks?: TypeCheck<AnyObject | EmptyObject>[]): QueryableModuleTypeCheck<T> {\n const result = (obj: AnyNonPromise, config?: TypeCheckConfig | number): obj is T => {\n const mod = asQueryableModuleObject(obj)\n return (\n isQueryableModuleObject(mod, config)\n // eslint-disable-next-line unicorn/no-array-reduce\n && (expectedQueries?.reduce((prev, query) => prev && mod.queries.includes(query), true) ?? true)\n // perform additional checks\n // eslint-disable-next-line unicorn/no-array-reduce\n && (additionalChecks?.reduce((prev, check) => prev && check(obj, config), true) ?? true)\n )\n }\n return result\n }\n}\n\n/** @deprecated use IsQueryableModuleFactory instead */\nexport class IsModuleFactory<T extends QueryableModule = QueryableModule> extends IsQueryableModuleFactory<T> {}\n", "import type { TypeCheck } from '@xylabs/sdk-js'\nimport type { Schema } from '@xyo-network/sdk-protocol-js'\n\nimport { ModuleStateQuerySchema } from '../Queries/index.ts'\nimport { IsQueryableModuleFactory } from './IsQueryableModuleFactory.ts'\nimport { isQueryableModuleObject } from './isQueryableModuleObject.ts'\nimport type { QueryableModule } from './QueryableModule.ts'\n\nexport const requiredQueryableModuleQueries: Schema[] = [ModuleStateQuerySchema]\n\n/** @deprecated use requiredQueryableModuleQueries instead */\nexport const requiredModuleQueries: Schema[] = requiredQueryableModuleQueries\n\n// we do not use IsInstanceFactory here to prevent a cycle\nconst factory = new IsQueryableModuleFactory<QueryableModule>()\n\nexport const isQueryableModule: TypeCheck<QueryableModule> = factory.create(requiredQueryableModuleQueries, [isQueryableModuleObject])\n\n/** @deprecated use isQueryableModule instead */\nexport const isModule: TypeCheck<QueryableModule> = isQueryableModule\n", "import type { AsTypeFunction } from '@xylabs/sdk-js'\nimport { AsObjectFactory } from '@xylabs/sdk-js'\n\nimport type { AttachableModuleInstance } from './AttachableInstance.ts'\nimport { isAttachableModuleInstance } from './isAttachableInstance.ts'\n\nexport const asAttachableModuleInstance: AsTypeFunction<AttachableModuleInstance> = AsObjectFactory.create(isAttachableModuleInstance)\n", "import type { ObjectTypeShape, TypeCheck } from '@xylabs/sdk-js'\nimport { IsObjectFactory } from '@xylabs/sdk-js'\n\nimport { isModuleInstance } from '../isModuleInstance.ts'\nimport type { AttachableModuleInstance } from './AttachableInstance.ts'\n\nexport const requiredAttachableModuleInstanceFunctions: ObjectTypeShape = {\n downResolver: 'object',\n upResolver: 'object',\n}\n\n// we do not use IsInstanceFactory here to prevent a cycle\nconst factory = new IsObjectFactory<AttachableModuleInstance>()\n\nexport const isAttachableModuleInstance: TypeCheck<AttachableModuleInstance> = factory.create(requiredAttachableModuleInstanceFunctions, [\n isModuleInstance,\n])\n", "import type { CreatableInstance, TypeCheck } from '@xylabs/sdk-js'\nimport { IsObjectFactory } from '@xylabs/sdk-js'\n\nimport type { ModuleEventData } from '../../EventsModels/index.ts'\nimport type { QueryableModuleParams } from '../../QueryableModule/index.ts'\nimport type { ModuleInstance } from '../Instance.ts'\nimport type { ModuleResolverInstance } from '../ModuleResolver.ts'\n\nexport interface AttachableModuleInstance<TParams extends QueryableModuleParams = QueryableModuleParams, TEventData extends ModuleEventData = ModuleEventData>\n extends ModuleInstance<TParams, TEventData>, CreatableInstance<TParams, TEventData> {\n config: TParams['config']\n /* The resolver is a 'down' resolver. It can resolve the module or any children (if it is a node for example), that are in the module */\n readonly downResolver: ModuleResolverInstance\n\n // The resolver that gets called by children (usually only Nodes have this)\n readonly privateResolver: ModuleResolverInstance\n\n /* The resolver is a 'up' resolver. It can resolve the parent or any children of the parent */\n /* This is set by a NodeModule when attaching to the module */\n readonly upResolver: ModuleResolverInstance\n}\n\nexport type AttachableModuleInstanceTypeCheck<T extends AttachableModuleInstance = AttachableModuleInstance> = TypeCheck<T>\n\nexport class IsAttachableModuleInstanceFactory<T extends AttachableModuleInstance = AttachableModuleInstance> extends IsObjectFactory<T> {}\n", "import type {\n CreatableStatus, Promisable,\n TypeCheck,\n} from '@xylabs/sdk-js'\nimport { IsObjectFactory, toSafeJsonString } from '@xylabs/sdk-js'\nimport type { AccountInstance, XyoAddress } from '@xyo-network/sdk-protocol-js'\n\nimport type { ModuleEventData } from '../EventsModels/index.ts'\nimport type { ModuleIdentifier, ModuleName } from '../ModuleIdentifier.ts'\nimport type {\n QueryableModule, QueryableModuleFunctions,\n QueryableModuleParams,\n} from '../QueryableModule/index.ts'\nimport type { Direction } from './ObjectFilter.ts'\nimport type { ObjectResolver } from './ObjectResolver.ts'\n\nexport type ModulePipeLine = Lowercase<'one-to-one' | 'one-to-many' | 'many-to-one' | 'many-to-many'>\n\nexport type ModuleStatus = CreatableStatus | 'wrapped' | 'proxy'\n\nexport class DeadModuleError extends Error {\n error: Error | undefined\n id: ModuleIdentifier\n constructor(\n id: ModuleIdentifier,\n error: Error | undefined,\n msg = 'Dead Module Error',\n ) {\n super(`${msg} [${id}]: ${error?.message ?? toSafeJsonString(error)}`)\n this.id = id\n this.error = error\n\n // Set the prototype explicitly.\n Object.setPrototypeOf(this, DeadModuleError.prototype)\n }\n}\n\nexport interface AddressToWeakInstanceCache {\n get: (address: XyoAddress) => WeakRef<ModuleInstance> | null\n set: (address: XyoAddress, instance: WeakRef<ModuleInstance> | null) => void\n}\n\nexport interface ModuleFamilyFunctions {\n account?: AccountInstance\n addParent: (mod: ModuleInstance) => void\n addressCache?: (direction: Direction, includePrivate: boolean) => AddressToWeakInstanceCache | undefined\n modName?: ModuleName\n parents: () => Promisable<ModuleInstance[]>\n privateChildren: () => Promisable<ModuleInstance[]>\n publicChildren: () => Promisable<ModuleInstance[]>\n removeParent: (address: XyoAddress) => void\n siblings: () => Promisable<ModuleInstance[]>\n}\n\nexport interface ModuleInstance<TParams extends QueryableModuleParams = QueryableModuleParams, TEventData extends ModuleEventData = ModuleEventData>\n extends QueryableModule<TParams, TEventData>,\n ObjectResolver<ModuleInstance>,\n QueryableModuleFunctions,\n ModuleFamilyFunctions {\n readonly pipeline?: ModulePipeLine\n\n // if the module has become non-functional, such as a broken bridge connection, this will be 'dead'\n readonly status: ModuleStatus | null\n}\n\nexport type InstanceTypeCheck<T extends ModuleInstance = ModuleInstance> = TypeCheck<T>\n\nexport class IsInstanceFactory<T extends ModuleInstance = ModuleInstance> extends IsObjectFactory<T> {}\n", "import type {\n AnyObject, EmptyObject, TypeCheck,\n} from '@xylabs/sdk-js'\nimport type { XyoAddress } from '@xyo-network/sdk-protocol-js'\n\nimport type { ModuleName } from '../ModuleIdentifier.ts'\n\nexport type Direction = 'up' | 'down' | 'all'\nexport type Visibility = 'public' | 'private' | 'all'\n\nexport interface ResolveStrategy {\n maxDepth?: number\n required?: boolean | 'warn' | 'log'\n retry?: number\n timeout?: number\n}\n\nexport interface ObjectFilterOptions<T extends EmptyObject = AnyObject> extends ResolveStrategy {\n direction?: Direction\n identity?: TypeCheck<T>\n}\n\nexport interface AddressObjectFilter<T extends EmptyObject = AnyObject> extends ObjectFilterOptions<T> {\n address: XyoAddress[]\n}\n\nexport const isAddressObjectFilter = <T extends EmptyObject = AnyObject>(value: unknown): value is AddressObjectFilter<T> =>\n (value as AddressObjectFilter<T>).address !== undefined\n\nexport interface NameObjectFilter<T extends EmptyObject = AnyObject> extends ObjectFilterOptions<T> {\n name: ModuleName[]\n}\n\nexport const isNameObjectFilter = <T extends EmptyObject = AnyObject>(value: unknown): value is NameObjectFilter<T> =>\n (value as NameObjectFilter<T>).name !== undefined\n\nexport interface QueryObjectFilter<T extends EmptyObject = AnyObject> extends ObjectFilterOptions<T> {\n query: string[][]\n}\n\nexport const isQueryObjectFilter = <T extends EmptyObject = AnyObject>(value: unknown): value is QueryObjectFilter<T> =>\n (value as QueryObjectFilter<T>).query !== undefined\n\nexport type AnyObjectFilter<T extends EmptyObject = AnyObject> = Partial<AddressObjectFilter<T>>\n & Partial<NameObjectFilter<T>>\n & Partial<QueryObjectFilter<T>>\n\nexport type ObjectFilter<T extends EmptyObject> = ObjectFilterOptions<T> | AddressObjectFilter<T> | NameObjectFilter<T> | QueryObjectFilter<T>\n", "import type { ModuleInstance } from './Instance.ts'\nimport type {\n AddressObjectFilter,\n AnyObjectFilter,\n NameObjectFilter,\n ObjectFilter,\n ObjectFilterOptions,\n QueryObjectFilter,\n} from './ObjectFilter.ts'\nimport {\n isAddressObjectFilter,\n isNameObjectFilter,\n isQueryObjectFilter,\n} from './ObjectFilter.ts'\n\nexport interface ModuleFilterOptions<T extends ModuleInstance = ModuleInstance> extends ObjectFilterOptions<T> {}\n\nexport const isAddressModuleFilter: (value: unknown) => value is AddressObjectFilter<ModuleInstance> = isAddressObjectFilter<ModuleInstance>\n\nexport const isNameModuleFilter: (value: unknown) => value is NameObjectFilter<ModuleInstance> = isNameObjectFilter<ModuleInstance>\n\nexport const isQueryModuleFilter: (value: unknown) => value is QueryObjectFilter<ModuleInstance> = isQueryObjectFilter<ModuleInstance>\n\nexport type AnyModuleFilter<T extends ModuleInstance = ModuleInstance> = AnyObjectFilter<T>\n\nexport type AddressModuleFilter<T extends ModuleInstance = ModuleInstance> = AddressObjectFilter<T>\n\nexport type NameModuleFilter<T extends ModuleInstance = ModuleInstance> = NameObjectFilter<T>\n\nexport type QueryModuleFilter<T extends ModuleInstance = ModuleInstance> = QueryObjectFilter<T>\n\n/** @deprecated use ModuleIdentifier instead */\nexport type ModuleFilter<T extends ModuleInstance = ModuleInstance> = ObjectFilter<T>\n", "import type {\n AnyObject, EmptyObject, Promisable,\n} from '@xylabs/sdk-js'\n\nimport type { ModuleIdentifier } from '../ModuleIdentifier.ts'\nimport type { ObjectFilterOptions } from './ObjectFilter.ts'\n\nexport const isObjectResolver = <T extends EmptyObject = AnyObject>(value?: unknown): value is ObjectResolver<T> => {\n return typeof (value as Partial<ObjectResolver<T>>).resolve === 'function'\n}\n\nexport const ObjectResolverPriority = {\n Disabled: -1,\n VeryLow: 0,\n Low: 1,\n Normal: 2,\n High: 3,\n VeryHigh: 4,\n} as const\n\nexport type ObjectResolverPriority = typeof ObjectResolverPriority[keyof typeof ObjectResolverPriority]\n\nexport interface ObjectResolver<TResult extends EmptyObject> {\n priority: ObjectResolverPriority\n resolve<T extends TResult = TResult>(all: '*', options?: ObjectFilterOptions<T>): Promisable<T[]>\n resolve<T extends TResult = TResult>(id: ModuleIdentifier, options?: ObjectFilterOptions<T>): Promisable<T | undefined>\n resolve<T extends TResult = TResult>(\n id?: ModuleIdentifier,\n options?: ObjectFilterOptions<T>,\n ): Promisable<T | T[] | undefined>\n\n resolvePrivate<T extends TResult = TResult>(all: '*', options?: ObjectFilterOptions<T>): Promise<T[]>\n resolvePrivate<T extends TResult = TResult>(id: ModuleIdentifier, options?: ObjectFilterOptions<T>): Promise<T | undefined>\n resolvePrivate<T extends TResult = TResult>(id: ModuleIdentifier, options?: ObjectFilterOptions<T>): Promise<T | T[] | undefined>\n}\n\nexport interface ObjectResolverInstance<TResult extends EmptyObject> extends ObjectResolver<TResult> {\n addResolver: (resolver: ObjectResolverInstance<TResult>) => this\n removeResolver: (resolver: ObjectResolverInstance<TResult>) => this\n}\n", "import type { Promisable } from '@xylabs/sdk-js'\nimport type { XyoAddress } from '@xyo-network/sdk-protocol-js'\n\nimport type { ModuleIdentifier } from '../ModuleIdentifier.ts'\nimport type { ModuleInstance } from './Instance.ts'\nimport type { ObjectFilterOptions } from './ObjectFilter.ts'\nimport type { ObjectResolver } from './ObjectResolver.ts'\nimport { isObjectResolver } from './ObjectResolver.ts'\n\nexport const isModuleResolver: (value?: unknown) => value is ObjectResolver<ModuleInstance> = isObjectResolver<ModuleInstance>\n\nexport interface ModuleResolver<TResult extends ModuleInstance = ModuleInstance> extends ObjectResolver<TResult> {}\n\nexport interface ModuleNameResolver {\n readonly root: ModuleInstance\n resolveIdentifier(id: ModuleIdentifier, options?: ObjectFilterOptions): Promisable<XyoAddress | undefined>\n}\n\nexport interface ModuleResolverInstance<TResult extends ModuleInstance = ModuleInstance> extends ModuleResolver<TResult>, ModuleNameResolver {\n addResolver: (resolver: ModuleResolverInstance<TResult>) => this\n removeResolver: (resolver: ModuleResolverInstance<TResult>) => this\n}\n", "/**\n * Object used to represent labels identifying a resource.\n */\nexport type Labels = Record<string, string | undefined>\n\n/**\n * Interface for objects that have labels.\n */\nexport interface WithLabels<T extends Labels = Labels> {\n labels: T\n}\n\n/**\n * Interface for objects that have labels.\n */\nexport interface WithOptionalLabels<T extends Labels = Labels> {\n labels?: T\n}\n\n/**\n * Returns true if the source object has all the labels from the required set\n * @param source Source object to check against\n * @param required Set of labels to check for in source\n * @returns True of the source object has all the labels from the required set\n */\nexport const hasAllLabels = (source?: Labels, required?: Labels): boolean => {\n if (!required) return true\n return Object.entries(required).every(([key, value]) => {\n return Object.hasOwn(source ?? {}, key) && source?.[key] === value\n })\n}\n", "export const ModuleLimitationLabelName = 'network.xyo.module.limitation'\nexport type ModuleLimitationLabelName = typeof ModuleLimitationLabelName\n\nexport const ModuleLimitationViewLabel = { ModuleLimitationLabelName: 'view' }\n", "import type { QueryableModule } from '../QueryableModule/index.ts'\n\n/**\n * Used to filter duplicates from an array of modules\n * @example: modulesArray.filter(duplicateModules)\n * @param value Current Module\n * @param index Current Module's index\n * @param array Module Array\n * @returns True if the Module's address is the first occurrence of\n * that address in the array, false otherwise\n */\nexport const duplicateModules = (value: QueryableModule, index: number, array: QueryableModule[]): value is QueryableModule => {\n return array.findIndex(v => v.address === value.address) === index\n}\n", "export const isSerializable = (value: unknown, maxDepth = 10): boolean => {\n if (maxDepth <= 0) {\n return false\n }\n if (value === null || typeof value === 'boolean' || typeof value === 'number' || typeof value === 'string') {\n return true\n }\n\n if (Array.isArray(value)) {\n return value.every(item => isSerializable(item, maxDepth - 1))\n }\n\n if (typeof value === 'object') {\n if (value instanceof Date || value instanceof RegExp) {\n return true\n }\n\n // Check for non-serializable objects like Set and Map\n if (value instanceof Set || value instanceof Map) {\n return false\n }\n\n if (value !== null && value !== undefined) {\n return Object.values(value).every(item => isSerializable(item, maxDepth - 1))\n }\n }\n\n // Exclude functions, symbols, undefined, and BigInt explicitly\n return false\n}\n", "import type { Address } from '@xylabs/sdk-js'\nimport { isAddress } from '@xylabs/sdk-js'\n\nexport const MODULE_PATH_SEPARATOR = ':' as const\n\nexport const DisallowedModuleIdentifierCharacters = {\n ' ': true,\n '!': true,\n '\"': true,\n '#': true,\n '$': true,\n '%': true,\n '&': true,\n \"'\": true,\n '(': true,\n ')': true,\n '*': true,\n ',': true,\n '.': true,\n '/': true,\n ':': true,\n ';': true,\n '<': true,\n '=': true,\n '>': true,\n '?': true,\n '@': true,\n '[': true,\n ']': true,\n '^': true,\n '_': true,\n '{': true,\n '|': true,\n '}': true,\n '~': true,\n}\nexport type ReservedModuleIdentifierCharacter = keyof typeof DisallowedModuleIdentifierCharacters\nexport const ReservedModuleIdentifierCharacters: Set<ReservedModuleIdentifierCharacter> = new Set<ReservedModuleIdentifierCharacter>(\n Object.keys(DisallowedModuleIdentifierCharacters) as ReservedModuleIdentifierCharacter[],\n)\n\n// TODO: Use Brand, but avoid too complex error\n// export type ModuleName = Brand<string, { __moduleName: true }>\nexport type ModuleName = string\n\nexport type ModuleIdentifier\n = | ColonPair<ModuleIdentifierPart>\n | ColonPair<ColonPair<ModuleIdentifierPart>>\n | ColonPair<ColonPair<ColonPair<ModuleIdentifierPart>>>\n | ColonPair<ColonPair<ColonPair<ColonPair<ModuleIdentifierPart>>>>\n | ColonPair<ColonPair<ColonPair<ColonPair<ColonPair<ModuleIdentifierPart>>>>>\n | ColonPair<ColonPair<ColonPair<ColonPair<ColonPair<ColonPair<ModuleIdentifierPart>>>>>>\n | ColonPair<ColonPair<ColonPair<ColonPair<ColonPair<ColonPair<ColonPair<ModuleIdentifierPart>>>>>>>\n\nexport type ColonPair<T extends string> = `${T}:${T}` | T\n\nexport type ModuleIdentifierPart = Exclude<Address | ModuleName, '*'>\n\nexport const isModuleName = (value: unknown): value is ModuleName => {\n return typeof value === 'string' && !isAddress(value) && !includesReservedModuleIdentifierCharacter(value)\n}\n\nexport const includesReservedModuleIdentifierCharacter = (value: unknown): boolean => {\n return typeof value === 'string' && [...value].some(char => ReservedModuleIdentifierCharacters.has(char as ReservedModuleIdentifierCharacter))\n}\n\nexport const isModuleIdentifierPart = (value: unknown): value is ModuleIdentifierPart => {\n return isModuleName(value) || isAddress(value)\n}\n", "import {\n zodAsFactory, zodIsFactory, zodToFactory,\n} from '@xylabs/sdk-js'\nimport {\n asSchema, PayloadZodOfSchema, type XyoAddress,\n} from '@xyo-network/sdk-protocol-js'\nimport * as z from 'zod/mini'\n\nexport const AddressSchema: 'network.xyo.address' & {\n readonly __schema: true\n} = asSchema('network.xyo.address', true)\nexport type AddressSchema = typeof AddressSchema\n\nexport const AddressChildSchema: 'network.xyo.address.child' & {\n readonly __schema: true\n} = asSchema('network.xyo.address.child', true)\nexport type AddressChildSchema = typeof AddressChildSchema\n\nexport interface AddressFields {\n address: XyoAddress\n}\n\nexport const AddressPayloadZod: z.ZodMiniObject<{\n address: z.ZodMiniCustom<XyoAddress, XyoAddress>\n schema: z.ZodMiniLiteral<AddressSchema>\n}, z.core.$strip> = z.extend(PayloadZodOfSchema(AddressSchema), { address: z.custom<XyoAddress>() })\n\nexport type AddressPayload = z.infer<typeof AddressPayloadZod>\n\n/**\n * Identity function for determining if an object is an Address\n */\nexport const isAddressPayload: ReturnType<typeof zodIsFactory<AddressPayload>> = zodIsFactory(AddressPayloadZod)\nexport const asAddressPayload: ReturnType<typeof zodAsFactory<AddressPayload>> = zodAsFactory(AddressPayloadZod, 'asAddressPayload')\nexport const toAddressPayload: ReturnType<typeof zodToFactory<AddressPayload>> = zodToFactory(AddressPayloadZod, 'toAddressPayload')\n\n/** @deprecated use asAddressPayload instead */\nexport const asOptionalAddressPayload: ReturnType<typeof zodAsFactory<AddressPayload>> = asAddressPayload\n\nexport interface AddressChildFields extends AddressFields {\n /**\n * The derivation path of the child address\n */\n path?: string\n /**\n * The public address of the root of the hierarchy\n */\n root?: XyoAddress\n}\n\nexport const AddressChildPayloadZod: z.ZodMiniObject<{\n address: z.ZodMiniCustom<XyoAddress, XyoAddress>\n path: z.ZodMiniOptional<z.ZodMiniString<string>>\n root: z.ZodMiniOptional<z.ZodMiniCustom<XyoAddress, XyoAddress>>\n schema: z.ZodMiniLiteral<AddressChildSchema>\n}, z.core.$strip> = z.extend(PayloadZodOfSchema(AddressChildSchema), {\n address: z.custom<XyoAddress>(),\n path: z.optional(z.string()),\n root: z.optional(z.custom<XyoAddress>()),\n})\n\nexport type AddressChildPayload = z.infer<typeof AddressChildPayloadZod>\n\nexport const isAddressChildPayload: ReturnType<typeof zodIsFactory<AddressChildPayload>> = zodIsFactory(AddressChildPayloadZod)\nexport const asAddressChildPayload: ReturnType<typeof zodAsFactory<AddressChildPayload>> = zodAsFactory(AddressChildPayloadZod, 'asAddressChildPayload')\nexport const toAddressChildPayload: ReturnType<typeof zodToFactory<AddressChildPayload>> = zodToFactory(AddressChildPayloadZod, 'toAddressChildPayload')\n", "import {\n zodAsFactory, zodIsFactory, zodToFactory,\n} from '@xylabs/sdk-js'\nimport {\n asSchema, PayloadZodOfSchema, type XyoAddress,\n} from '@xyo-network/sdk-protocol-js'\nimport * as z from 'zod/mini'\n\nexport const AddressPreviousHashSchema: 'network.xyo.address.hash.previous' & {\n readonly __schema: true\n} = asSchema('network.xyo.address.hash.previous', true)\nexport type AddressPreviousHashSchema = typeof AddressPreviousHashSchema\n\nexport const AddressPreviousHashPayloadZod: z.ZodMiniObject<{\n address: z.ZodMiniCustom<XyoAddress, XyoAddress>\n previousHash: z.ZodMiniOptional<z.ZodMiniString<string>>\n schema: z.ZodMiniLiteral<AddressPreviousHashSchema>\n}, z.core.$strip> = z.extend(PayloadZodOfSchema(AddressPreviousHashSchema), {\n address: z.custom<XyoAddress>(),\n previousHash: z.optional(z.string()),\n})\n\nexport type AddressPreviousHashPayload = z.infer<typeof AddressPreviousHashPayloadZod>\n\nexport const isAddressPreviousHashPayload: ReturnType<typeof zodIsFactory<AddressPreviousHashPayload>> = zodIsFactory(AddressPreviousHashPayloadZod)\nexport const asAddressPreviousHashPayload: ReturnType<typeof zodAsFactory<AddressPreviousHashPayload>> = zodAsFactory(AddressPreviousHashPayloadZod, 'asAddressPreviousHashPayload')\nexport const toAddressPreviousHashPayload: ReturnType<typeof zodToFactory<AddressPreviousHashPayload>> = zodToFactory(AddressPreviousHashPayloadZod, 'toAddressPreviousHashPayload')\n", "import {\n zodAsFactory, zodIsFactory, zodToFactory,\n} from '@xylabs/sdk-js'\nimport { asSchema, PayloadZodOfSchema } from '@xyo-network/sdk-protocol-js'\nimport * as z from 'zod/mini'\n\nimport type { ModuleDescription } from '../ModuleDescription.ts'\n\nexport const ModuleDescriptionSchema: 'network.xyo.module.description' & {\n readonly __schema: true\n} = asSchema('network.xyo.module.description', true)\nexport type ModuleDescriptionSchema = typeof ModuleDescriptionSchema\n\nexport const ModuleDescriptionPayloadZod: z.ZodMiniIntersection<\n z.ZodMiniObject<{ schema: z.ZodMiniLiteral<ModuleDescriptionSchema> }, z.core.$strip>,\n z.ZodMiniCustom<ModuleDescription, ModuleDescription>\n> = z.intersection(PayloadZodOfSchema(ModuleDescriptionSchema), z.custom<ModuleDescription>())\n\nexport type ModuleDescriptionPayload = z.infer<typeof ModuleDescriptionPayloadZod>\n\nexport const isModuleDescriptionPayload: ReturnType<typeof zodIsFactory<ModuleDescriptionPayload>> = zodIsFactory(ModuleDescriptionPayloadZod)\nexport const asModuleDescriptionPayload: ReturnType<typeof zodAsFactory<ModuleDescriptionPayload>> = zodAsFactory(ModuleDescriptionPayloadZod, 'asModuleDescriptionPayload')\nexport const toModuleDescriptionPayload: ReturnType<typeof zodToFactory<ModuleDescriptionPayload>> = zodToFactory(ModuleDescriptionPayloadZod, 'toModuleDescriptionPayload')\n", "import {\n zodAsFactory, zodIsFactory, zodToFactory,\n} from '@xylabs/sdk-js'\nimport type { Payload, WithSources } from '@xyo-network/sdk-protocol-js'\nimport {\n asSchema, isPayloadOfSchemaTypeWithSources, PayloadZodOfSchema,\n} from '@xyo-network/sdk-protocol-js'\nimport * as z from 'zod/mini'\n\nexport type StateDictionary = Record<string, string | number>\nexport interface State<T extends StateDictionary = StateDictionary> {\n state: T\n}\n\nexport const ModuleStateSchema: 'network.xyo.module.state' & {\n readonly __schema: true\n} = asSchema('network.xyo.module.state', true)\nexport type ModuleStateSchema = typeof ModuleStateSchema\n\nexport const ModuleStateZod: z.ZodMiniObject<{\n schema: z.ZodMiniLiteral<ModuleStateSchema>\n state: z.ZodMiniCustom<StateDictionary, StateDictionary>\n}, z.core.$strip> = z.extend(PayloadZodOfSchema(ModuleStateSchema), { state: z.custom<StateDictionary>() })\n\nexport type ModuleState<T extends StateDictionary = StateDictionary> = Payload<State<T>, ModuleStateSchema>\n\nconst isModuleStateInternal = zodIsFactory(ModuleStateZod)\n\nexport const isModuleState = <T extends StateDictionary = StateDictionary, TInput = unknown>(payload?: TInput): payload is ModuleState<T> & TInput => isModuleStateInternal(payload)\n\nexport const isModuleStateWithSources = <T extends StateDictionary = StateDictionary,\n TInput = unknown>(payload?: TInput): payload is WithSources<ModuleState<T>> & TInput => {\n return isPayloadOfSchemaTypeWithSources<ModuleState<T>>(ModuleStateSchema)(payload)\n}\n\nexport const asModuleState: ReturnType<typeof zodAsFactory<ModuleState>> = zodAsFactory(ModuleStateZod, 'asModuleState')\nexport const toModuleState: ReturnType<typeof zodToFactory<ModuleState>> = zodToFactory(ModuleStateZod, 'toModuleState')\n\n/** @deprecated use asModuleState instead */\nexport const asOptionalModuleState: ReturnType<typeof zodAsFactory<ModuleState>> = asModuleState\n", "import type { TypeCheck } from '@xylabs/sdk-js'\n\n/** @deprecated use narrowing instead [ if(is) ] */\nexport const WithFactory = {\n create: <T extends object>(typeCheck: TypeCheck<T>) => {\n return <R>(\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n mod: any,\n\n closure: (mod: T) => R,\n ): R | undefined => {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-argument\n return typeCheck(mod) ? closure(mod) : undefined\n }\n },\n}\n"],
4
+ "sourcesContent": ["import type { Schema } from '@xyo-network/sdk-protocol'\nimport * as z from 'zod/mini'\n\nimport type { ModuleIdentifier } from '../ModuleIdentifier.ts'\n\nexport const ArchivingModuleConfigZod: z.ZodMiniObject<{\n archiving: z.ZodMiniOptional<z.ZodMiniObject<{\n archivists: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniCustom<ModuleIdentifier, ModuleIdentifier>>>\n queries: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniCustom<Schema, Schema>>>\n }, z.core.$strip>>\n}, z.core.$strip> = z.object({\n archiving: z.optional(z.object({\n archivists: z.optional(z.array(z.custom<ModuleIdentifier>())),\n queries: z.optional(z.array(z.custom<Schema>())),\n })),\n})\n\nexport type ArchivingModuleConfig = z.infer<typeof ArchivingModuleConfigZod>\n", "import type { EmptyObject } from '@xylabs/sdk'\nimport {\n zodAsFactory, zodIsFactory, zodToFactory,\n} from '@xylabs/sdk'\nimport {\n asSchema, type Payload, PayloadZod, type Schema,\n} from '@xyo-network/sdk-protocol'\nimport * as z from 'zod/mini'\n\nimport { ArchivingModuleConfigZod } from './Archiving.ts'\nimport { ModuleConfigFieldsZod } from './Fields.ts'\nimport { ArchivingReentrancyConfigZod } from './Reentrancy.ts'\n\nexport const ModuleConfigSchema: 'network.xyo.module.config' & {\n readonly __schema: true\n} = asSchema('network.xyo.module.config', true)\nexport type ModuleConfigSchema = typeof ModuleConfigSchema\n\nexport type WithAdditional<T extends EmptyObject = EmptyObject, TAdditional extends EmptyObject = EmptyObject>\n = T & TAdditional\n\nexport const ModuleConfigZod: z.ZodMiniObject<\n & (typeof PayloadZod)['shape']\n & (typeof ModuleConfigFieldsZod)['shape']\n & (typeof ArchivingModuleConfigZod)['shape']\n & (typeof ArchivingReentrancyConfigZod)['shape'],\n z.core.$strip\n> = z.extend(PayloadZod, {\n ...ModuleConfigFieldsZod.shape,\n ...ArchivingModuleConfigZod.shape,\n ...ArchivingReentrancyConfigZod.shape,\n})\n\nexport type ModuleConfigBase = z.infer<typeof ModuleConfigZod>\n\nexport const isModuleConfig: ReturnType<typeof zodIsFactory<ModuleConfigBase>> = zodIsFactory(ModuleConfigZod)\nexport const asModuleConfig: ReturnType<typeof zodAsFactory<ModuleConfigBase>> = zodAsFactory(ModuleConfigZod, 'asModuleConfig')\nexport const toModuleConfig: ReturnType<typeof zodToFactory<ModuleConfigBase>> = zodToFactory(ModuleConfigZod, 'toModuleConfig')\n\nexport type ModuleConfig<TConfig extends EmptyObject | Payload = EmptyObject, TSchema extends Schema | void = void> = Payload<\n WithAdditional<Omit<ModuleConfigBase, 'schema'>, TConfig>,\n TSchema extends void ? TConfig extends Payload ? TConfig['schema']\n : Schema : TSchema\n>\n\nexport type AnyConfigSchema<TConfig extends Omit<ModuleConfig, 'schema'> & { schema: Schema } = Omit<ModuleConfig, 'schema'> & { schema: Schema }>\n = ModuleConfig<TConfig, Schema>\n\nexport type OptionalConfigSchema<TConfig extends AnyConfigSchema<ModuleConfig> = AnyConfigSchema<ModuleConfig>> = Omit<TConfig, 'schema'> & {\n schema?: TConfig['schema']\n}\n\nexport type AnyModuleConfig = AnyConfigSchema<ModuleConfig>\n", "import type { LogLevelValue, RetryConfig } from '@xylabs/sdk'\nimport type { Schema } from '@xyo-network/sdk-protocol'\nimport * as z from 'zod/mini'\n\nimport type { Labels } from '../Labels/index.ts'\nimport type { ModuleIdentifier, ModuleName } from '../ModuleIdentifier.ts'\nimport type { ModuleSecurityConfig } from './Security.ts'\n\nexport const ModuleConfigFieldsZod: z.ZodMiniObject<{\n allowedQueries: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniCustom<Schema, Schema>>>\n archivist: z.ZodMiniOptional<z.ZodMiniCustom<ModuleIdentifier, ModuleIdentifier>>\n labels: z.ZodMiniOptional<z.ZodMiniCustom<Labels, Labels>>\n logLevel: z.ZodMiniOptional<z.ZodMiniCustom<LogLevelValue, LogLevelValue>>\n name: z.ZodMiniOptional<z.ZodMiniCustom<ModuleName, ModuleName>>\n paging: z.ZodMiniOptional<z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniObject<{\n size: z.ZodMiniOptional<z.ZodMiniNumber<number>>\n }, z.core.$strip>>>\n retry: z.ZodMiniOptional<z.ZodMiniCustom<RetryConfig, RetryConfig>>\n security: z.ZodMiniOptional<z.ZodMiniCustom<ModuleSecurityConfig, ModuleSecurityConfig>>\n sign: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>\n storeQueries: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>\n timeBudget: z.ZodMiniOptional<z.ZodMiniNumber<number>>\n timestamp: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>\n}, z.core.$strip> = z.object({\n allowedQueries: z.optional(z.array(z.custom<Schema>())),\n archivist: z.optional(z.custom<ModuleIdentifier>()),\n labels: z.optional(z.custom<Labels>()),\n logLevel: z.optional(z.custom<LogLevelValue>()),\n name: z.optional(z.custom<ModuleName>()),\n paging: z.optional(z.record(z.string(), z.object({ size: z.optional(z.number()) }))),\n retry: z.optional(z.custom<RetryConfig>()),\n security: z.optional(z.custom<ModuleSecurityConfig>()),\n sign: z.optional(z.boolean()),\n storeQueries: z.optional(z.boolean()),\n timeBudget: z.optional(z.number()),\n timestamp: z.optional(z.boolean()),\n})\n\nexport type ModuleConfigFields = z.infer<typeof ModuleConfigFieldsZod>\n", "import * as z from 'zod/mini'\n\nexport const ArchivingReentrancyConfigZod: z.ZodMiniObject<{\n reentrancy: z.ZodMiniOptional<z.ZodMiniObject<{\n action: z.ZodMiniUnion<readonly [z.ZodMiniLiteral<'skip'>, z.ZodMiniLiteral<'wait'>]>\n scope: z.ZodMiniLiteral<'global'>\n }, z.core.$strip>>\n}, z.core.$strip> = z.object({\n reentrancy: z.optional(z.object({\n action: z.union([z.literal('skip'), z.literal('wait')]),\n scope: z.literal('global'),\n })),\n})\n\nexport type ArchivingReentrancyConfig = z.infer<typeof ArchivingReentrancyConfigZod>\n", "import type { Schema, XyoAddress } from '@xyo-network/sdk-protocol'\nimport * as z from 'zod/mini'\n\nexport type CosigningAddressSet = XyoAddress[]\n\nexport const ModuleSecurityConfigZod: z.ZodMiniObject<{\n allowAnonymous: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>\n allowed: z.ZodMiniOptional<z.ZodMiniRecord<z.ZodMiniCustom<Schema, Schema>, z.ZodMiniArray<z.ZodMiniCustom<XyoAddress | CosigningAddressSet, XyoAddress | CosigningAddressSet>>>>\n disallowed: z.ZodMiniOptional<z.ZodMiniRecord<z.ZodMiniCustom<Schema, Schema>, z.ZodMiniArray<z.ZodMiniCustom<XyoAddress, XyoAddress>>>>\n}, z.core.$strip> = z.object({\n allowAnonymous: z.optional(z.boolean()),\n allowed: z.optional(z.record(z.custom<Schema>(), z.array(z.custom<XyoAddress | CosigningAddressSet>()))),\n disallowed: z.optional(z.record(z.custom<Schema>(), z.array(z.custom<XyoAddress>()))),\n})\n\nexport type ModuleSecurityConfig = z.infer<typeof ModuleSecurityConfigZod>\n", "import type {\n Creatable, CreatableInstance, Logger,\n} from '@xylabs/sdk'\nimport type { Schema } from '@xyo-network/sdk-protocol'\n\nimport type { ModuleEventData } from '../EventsModels/index.ts'\nimport type { AttachableModuleInstance } from '../instance/index.ts'\nimport type { QueryableModuleParams } from '../QueryableModule/index.ts'\n\nexport interface CreatableModuleInstance<TParams extends QueryableModuleParams = QueryableModuleParams, TEventData extends ModuleEventData = ModuleEventData>\n extends CreatableInstance<TParams, TEventData>, AttachableModuleInstance<TParams, TEventData> {}\n\nexport interface CreatableModuleFactory<T extends CreatableModuleInstance = CreatableModuleInstance>\n extends Omit<CreatableModule<T>, 'create' | 'createHandler' | 'paramsHandler'> {\n creatableModule: CreatableModule<T>\n defaultParams?: Partial<T['params']>\n\n create(\n this: CreatableModuleFactory<T>,\n params?: Partial<T['params']>): Promise<T>\n}\n\nexport interface CreatableModule<T extends CreatableModuleInstance = CreatableModuleInstance> extends Creatable<T> {\n configSchemas: Schema[]\n defaultConfigSchema: Schema\n defaultLogger?: Logger\n new(key: unknown, params: Partial<T['params']>): T\n factory(params?: Partial<T['params']>): CreatableModuleFactory<T>\n}\n\n/**\n * Class annotation to be used to decorate Modules which support\n * an asynchronous creation pattern\n * @returns The decorated Module requiring it implement the members\n * of the CreatableModule as statics properties/methods\n */\nexport function creatableModule<TModule extends CreatableModuleInstance = CreatableModuleInstance>() {\n return <U extends CreatableModule<TModule>>(constructor: U): void => {\n // eslint-disable-next-line @typescript-eslint/no-unused-expressions\n constructor\n }\n}\n", "import { isTruthy } from '@xylabs/sdk'\nimport { asSchema, type Schema } from '@xyo-network/sdk-protocol'\n\nimport type { Labels } from '../Labels/index.ts'\nimport type { CreatableModuleFactory, CreatableModuleInstance } from './CreatableModule.ts'\nimport type { LabeledCreatableModuleFactory } from './LabeledCreatableModuleFactory.ts'\n\nexport type CreatableModuleRegistry = Record<Schema, (CreatableModuleFactory | LabeledCreatableModuleFactory)[] | undefined>\n\nconst buildModuleFactory = <TModule extends CreatableModuleInstance>(\n mod: CreatableModuleFactory<TModule>,\n labels?: Labels,\n): LabeledCreatableModuleFactory<TModule> => {\n const factory: LabeledCreatableModuleFactory<TModule> = {\n // Destructure instance properties\n ...mod,\n\n configSchemas: mod.configSchemas,\n // Copy static methods\n create: mod.create.bind(mod),\n\n defaultConfigSchema: mod.defaultConfigSchema,\n // Merge module & supplied labels\n labels: { ...(mod as LabeledCreatableModuleFactory).labels, ...labels },\n }\n return factory\n}\n\nexport const registerCreatableModuleFactory = <TModule extends CreatableModuleInstance>(\n registry: CreatableModuleRegistry,\n factory: CreatableModuleFactory<TModule> | LabeledCreatableModuleFactory<TModule>,\n labels?: Labels,\n /** register this as the primary factory for every schema it supports */\n primary: boolean | Schema | Schema[] = false,\n): void => {\n const primarySchemas\n = primary !== true && isTruthy(primary)\n ? Array.isArray(primary)\n ? primary\n : [primary]\n : []\n\n for (const primarySchema of primarySchemas) {\n if (!factory.configSchemas.includes(primarySchema)) {\n console.warn(`Primary schema ${String(primary)} not found in factory configSchemas`)\n }\n }\n\n const isPrimaryForSchema = (schema: Schema) => {\n switch (typeof primary) {\n case 'boolean': {\n return primary\n }\n case 'string': {\n return schema === primary\n }\n case 'object': {\n if (Array.isArray(primary)) {\n return primary.includes(schema)\n }\n }\n }\n throw new Error(`Invalid primary value: ${String(primary)}`)\n }\n\n const factoryClone: LabeledCreatableModuleFactory<TModule> = buildModuleFactory(factory, labels)\n // add the defaultConfigSchema as the first key in the registry\n registry[factory.defaultConfigSchema] = [factoryClone, ...(registry[factoryClone.defaultConfigSchema] ?? [])]\n for (const schema of factoryClone.configSchemas) {\n registry[schema] = isPrimaryForSchema(schema) ? [factoryClone, ...(registry[schema] ?? [])] : [...(registry[schema] ?? []), factoryClone]\n }\n}\n\nexport const registerCreatableModuleFactories = (\n factories: (CreatableModuleFactory | LabeledCreatableModuleFactory)[],\n registry: CreatableModuleRegistry = {},\n primary = false,\n): CreatableModuleRegistry => {\n for (const factory of factories) {\n registerCreatableModuleFactory(registry, factory, undefined, primary)\n }\n return registry\n}\n\n/** @deprecated use registerCreatableModuleFactory instead */\nexport const assignCreatableModuleRegistry = (\n target: CreatableModuleRegistry = {},\n ...sources: CreatableModuleRegistry[]\n): CreatableModuleRegistry => {\n for (const source of sources)\n for (const [schemaString, factories] of Object.entries(source)) {\n const schema = asSchema(schemaString, true)\n if (factories) {\n const existingFactories = target[schema]\n target[schema] = [...existingFactories ?? [], ...factories]\n }\n }\n\n return target\n}\n", "import type { WithOptionalLabels } from '../Labels/index.ts'\nimport type { CreatableModule, CreatableModuleInstance } from './CreatableModule.ts'\nimport type { LabeledCreatableModuleFactory } from './LabeledCreatableModuleFactory.ts'\n\nexport interface LabeledCreatableModule<T extends CreatableModuleInstance = CreatableModuleInstance> extends CreatableModule<T>, WithOptionalLabels {\n factory(params?: Partial<T['params']>): LabeledCreatableModuleFactory<T>\n}\n\n/**\n * Class annotation to be used to decorate Modules which support\n * an asynchronous creation pattern\n * @returns The decorated Module requiring it implement the members\n * of the CreatableModule as statics properties/methods\n */\nexport function labeledCreatableModule<TModule extends CreatableModuleInstance = CreatableModuleInstance>() {\n return <U extends LabeledCreatableModule<TModule>>(constructor: U): void => {\n // eslint-disable-next-line @typescript-eslint/no-unused-expressions\n constructor\n }\n}\n", "import type { WithOptionalLabels } from '../Labels/index.ts'\nimport type { CreatableModuleFactory, CreatableModuleInstance } from './CreatableModule.ts'\n\nexport type LabeledCreatableModuleFactory<T extends CreatableModuleInstance = CreatableModuleInstance> = CreatableModuleFactory<T> & WithOptionalLabels\n\nexport const hasLabels = (factory: CreatableModuleFactory | LabeledCreatableModuleFactory): factory is LabeledCreatableModuleFactory => {\n return (factory as LabeledCreatableModuleFactory).labels !== undefined\n}\n\n/**\n * Class annotation to be used to decorate Modules which support\n * an asynchronous labeled creation factory pattern\n * @returns The decorated Module requiring it implement the members\n * of the CreatableModule as statics properties/methods\n */\nexport function labeledCreatableModuleFactory<TModule extends CreatableModuleInstance = CreatableModuleInstance>() {\n return <U extends LabeledCreatableModuleFactory<TModule>>(constructor: U): void => {\n // eslint-disable-next-line @typescript-eslint/no-unused-expressions\n constructor\n }\n}\n", "import type { Logger } from '@xylabs/sdk'\nimport { assertEx } from '@xylabs/sdk'\nimport type { Schema } from '@xyo-network/sdk-protocol'\n\nimport type { Labels, WithOptionalLabels } from '../Labels/index.ts'\nimport type {\n CreatableModule, CreatableModuleFactory, CreatableModuleInstance,\n} from './CreatableModule.ts'\n\nexport class ModuleFactory<TModule extends CreatableModuleInstance> implements CreatableModuleFactory<TModule> {\n configSchemas: CreatableModule<TModule>['configSchemas']\n\n creatableModule: CreatableModule<TModule>\n\n defaultConfigSchema: Schema\n\n defaultLogger?: Logger\n\n defaultParams?: Partial<TModule['params']>\n\n labels?: Labels\n\n constructor(\n creatableModule: CreatableModule<TModule>,\n params?: Partial<TModule['params']>,\n labels: Labels = {},\n ) {\n this.creatableModule = creatableModule\n this.defaultParams = params\n this.configSchemas = creatableModule.configSchemas\n this.defaultConfigSchema = creatableModule.defaultConfigSchema\n assertEx(this.configSchemas.includes(this.defaultConfigSchema), () => 'defaultConfigSchema must be in configSchemas')\n this.labels = Object.assign({}, (creatableModule as WithOptionalLabels).labels ?? {}, labels ?? {})\n }\n\n static withParams<T extends CreatableModuleInstance>(\n creatableModule: CreatableModule<T>,\n params?: Partial<T['params']>,\n labels: Labels = {},\n ): ModuleFactory<T> {\n return new ModuleFactory<T>(creatableModule, params, labels)\n }\n\n create(this: CreatableModuleFactory<TModule>, params?: Partial<TModule['params']>): Promise<TModule> {\n const mergedParams: TModule['params'] = {\n ...this.defaultParams,\n ...params,\n config: {\n schema: this.creatableModule.defaultConfigSchema,\n ...this.defaultParams?.config,\n ...params?.config,\n },\n }\n return this.creatableModule.create<TModule>(mergedParams)\n }\n\n factory<T extends CreatableModuleInstance>(this: CreatableModuleFactory<T>, params?: Partial<T['params']>, labels: Labels = {}): CreatableModuleFactory<T> {\n return new ModuleFactory<T>(this.creatableModule, params, labels)\n }\n}\n", "import type { JsonValue } from '@xylabs/sdk'\n\nexport class ModuleDetailsError extends Error {\n details?: JsonValue\n constructor(\n message: string,\n details?: JsonValue,\n ) {\n super(message)\n this.details = details\n this.name = 'ModuleError'\n }\n}\n", "import type { AsTypeFunction } from '@xylabs/sdk'\nimport { AsObjectFactory } from '@xylabs/sdk'\n\nimport type { AnyConfigSchema, ModuleConfig } from '../Config/Config.ts'\nimport type { ModuleEventData } from '../EventsModels/ModuleEventData.ts'\nimport type { QueryableModuleParams } from '../QueryableModule/QueryableModuleParams.ts'\nimport type { ModuleInstance } from './Instance.ts'\nimport { isModuleInstance } from './isModuleInstance.ts'\n\nexport const asModuleInstance: AsTypeFunction<ModuleInstance<QueryableModuleParams<AnyConfigSchema<ModuleConfig>>, ModuleEventData<object>>> = AsObjectFactory.create(isModuleInstance)\n", "import type { ObjectTypeShape, TypeCheck } from '@xylabs/sdk'\nimport { IsObjectFactory } from '@xylabs/sdk'\n\nimport { isQueryableModule } from '../QueryableModule/index.ts'\nimport type { ModuleInstance } from './Instance.ts'\n\nexport const requiredModuleInstanceFunctions: ObjectTypeShape = {\n manifest: 'function',\n state: 'function',\n}\n\n// we do not use IsInstanceFactory here to prevent a cycle\nconst factory = new IsObjectFactory<ModuleInstance>()\n\nexport const isModuleInstance: TypeCheck<ModuleInstance> = factory.create(requiredModuleInstanceFunctions, [isQueryableModule])\n", "import type { AsTypeFunction } from '@xylabs/sdk'\nimport { AsObjectFactory } from '@xylabs/sdk'\n\nimport type { AnyConfigSchema, ModuleConfig } from '../Config/Config.ts'\nimport type { ModuleEventData } from '../EventsModels/ModuleEventData.ts'\nimport { isQueryableModule } from './isQueryableModule.ts'\nimport type { QueryableModule } from './QueryableModule.ts'\nimport type { QueryableModuleParams } from './QueryableModuleParams.ts'\n\nexport const asQueryableModule: AsTypeFunction<QueryableModule<QueryableModuleParams<AnyConfigSchema<ModuleConfig>>, ModuleEventData<object>>> = AsObjectFactory.create(isQueryableModule)\n\n/** @deprecated use asQueryableModule instead */\nexport const asModule: AsTypeFunction<QueryableModule<QueryableModuleParams<AnyConfigSchema<ModuleConfig>>, ModuleEventData<object>>> = asQueryableModule\n", "import {\n zodAsFactory, zodIsFactory, zodToFactory,\n} from '@xylabs/sdk'\nimport {\n asSchema, PayloadZodOfSchema, QueryFieldsZod,\n} from '@xyo-network/sdk-protocol'\nimport * as z from 'zod/mini'\n\nexport const ModuleManifestQuerySchema: 'network.xyo.query.module.manifest' & {\n readonly __schema: true\n} = asSchema('network.xyo.query.module.manifest', true)\nexport type ModuleManifestQuerySchema = typeof ModuleManifestQuerySchema\n\nexport const ModuleManifestQueryZod: z.ZodMiniObject<\n & { schema: z.ZodMiniLiteral<ModuleManifestQuerySchema> }\n & (typeof QueryFieldsZod)['shape']\n & { maxDepth: z.ZodMiniOptional<z.ZodMiniNumber<number>> },\n z.core.$strip\n> = z.extend(PayloadZodOfSchema(ModuleManifestQuerySchema), {\n ...QueryFieldsZod.shape,\n maxDepth: z.optional(z.number()),\n})\n\nexport type ModuleManifestQuery = z.infer<typeof ModuleManifestQueryZod>\n\nexport const isModuleManifestQuery: ReturnType<typeof zodIsFactory<ModuleManifestQuery>> = zodIsFactory(ModuleManifestQueryZod)\nexport const asModuleManifestQuery: ReturnType<typeof zodAsFactory<ModuleManifestQuery>> = zodAsFactory(ModuleManifestQueryZod, 'asModuleManifestQuery')\nexport const toModuleManifestQuery: ReturnType<typeof zodToFactory<ModuleManifestQuery>> = zodToFactory(ModuleManifestQueryZod, 'toModuleManifestQuery')\n", "import {\n zodAsFactory, zodIsFactory, zodToFactory,\n} from '@xylabs/sdk'\nimport {\n asSchema, PayloadZodOfSchema, QueryFieldsZod,\n} from '@xyo-network/sdk-protocol'\nimport * as z from 'zod/mini'\n\nexport const ModuleAddressQuerySchema: 'network.xyo.query.module.address' & {\n readonly __schema: true\n} = asSchema('network.xyo.query.module.address', true)\nexport type ModuleAddressQuerySchema = typeof ModuleAddressQuerySchema\n\nexport const ModuleAddressQueryZod: z.ZodMiniObject<\n & { schema: z.ZodMiniLiteral<ModuleAddressQuerySchema> }\n & (typeof QueryFieldsZod)['shape'],\n z.core.$strip\n> = z.extend(PayloadZodOfSchema(ModuleAddressQuerySchema), { ...QueryFieldsZod.shape })\n\nexport type ModuleAddressQuery = z.infer<typeof ModuleAddressQueryZod>\n\nexport const isModuleAddressQuery: ReturnType<typeof zodIsFactory<ModuleAddressQuery>> = zodIsFactory(ModuleAddressQueryZod)\nexport const asModuleAddressQuery: ReturnType<typeof zodAsFactory<ModuleAddressQuery>> = zodAsFactory(ModuleAddressQueryZod, 'asModuleAddressQuery')\nexport const toModuleAddressQuery: ReturnType<typeof zodToFactory<ModuleAddressQuery>> = zodToFactory(ModuleAddressQueryZod, 'toModuleAddressQuery')\n", "import {\n zodAsFactory, zodIsFactory, zodToFactory,\n} from '@xylabs/sdk'\nimport {\n asSchema, PayloadZodOfSchema, QueryFieldsZod,\n} from '@xyo-network/sdk-protocol'\nimport * as z from 'zod/mini'\n\nexport const ModuleStateQuerySchema: 'network.xyo.query.module.state' & {\n readonly __schema: true\n} = asSchema('network.xyo.query.module.state', true)\nexport type ModuleStateQuerySchema = typeof ModuleStateQuerySchema\n\nexport const ModuleStateQueryZod: z.ZodMiniObject<\n & { schema: z.ZodMiniLiteral<ModuleStateQuerySchema> }\n & (typeof QueryFieldsZod)['shape'],\n z.core.$strip\n> = z.extend(PayloadZodOfSchema(ModuleStateQuerySchema), { ...QueryFieldsZod.shape })\n\nexport type ModuleStateQuery = z.infer<typeof ModuleStateQueryZod>\n\nexport const isModuleStateQuery: ReturnType<typeof zodIsFactory<ModuleStateQuery>> = zodIsFactory(ModuleStateQueryZod)\nexport const asModuleStateQuery: ReturnType<typeof zodAsFactory<ModuleStateQuery>> = zodAsFactory(ModuleStateQueryZod, 'asModuleStateQuery')\nexport const toModuleStateQuery: ReturnType<typeof zodToFactory<ModuleStateQuery>> = zodToFactory(ModuleStateQueryZod, 'toModuleStateQuery')\n", "import {\n zodAsFactory, zodIsFactory, zodToFactory,\n} from '@xylabs/sdk'\nimport {\n asSchema, PayloadZodOfSchema, QueryFieldsZod, type XyoAddress,\n} from '@xyo-network/sdk-protocol'\nimport * as z from 'zod/mini'\n\nexport const ModuleSubscribeQuerySchema: 'network.xyo.query.module.subscribe' & {\n readonly __schema: true\n} = asSchema('network.xyo.query.module.subscribe', true)\nexport type ModuleSubscribeQuerySchema = typeof ModuleSubscribeQuerySchema\n\nexport interface ModuleSubscribeFilter {\n /** @field if specified, at least one of the schemas must be present in the boundwtness to generate a notification */\n schema?: string[]\n}\n\n// requests notification when a boundwitness is added to the modules chain that meets the filter criteria\nexport const ModuleSubscribeQueryZod: z.ZodMiniObject<\n & { schema: z.ZodMiniLiteral<ModuleSubscribeQuerySchema> }\n & Omit<(typeof QueryFieldsZod)['shape'], 'address'>\n & {\n address: z.ZodMiniCustom<XyoAddress, XyoAddress>\n filter: z.ZodMiniOptional<z.ZodMiniNullable<z.ZodMiniCustom<ModuleSubscribeFilter, ModuleSubscribeFilter>>>\n maxQueue: z.ZodMiniOptional<z.ZodMiniNumber<number>>\n },\n z.core.$strip\n> = z.extend(PayloadZodOfSchema(ModuleSubscribeQuerySchema), {\n ...QueryFieldsZod.shape,\n /** @field The address that will receive notifications */\n address: z.custom<XyoAddress>(),\n /** @field A subscribe with a null for filter is an unsubscribe */\n filter: z.optional(z.nullable(z.custom<ModuleSubscribeFilter>())),\n /** @field The maximum events queued per send [may increase frequency] */\n maxQueue: z.optional(z.number()),\n})\n\nexport type ModuleSubscribeQuery = z.infer<typeof ModuleSubscribeQueryZod>\n\nexport const isModuleSubscribeQuery: ReturnType<typeof zodIsFactory<ModuleSubscribeQuery>> = zodIsFactory(ModuleSubscribeQueryZod)\nexport const asModuleSubscribeQuery: ReturnType<typeof zodAsFactory<ModuleSubscribeQuery>> = zodAsFactory(ModuleSubscribeQueryZod, 'asModuleSubscribeQuery')\nexport const toModuleSubscribeQuery: ReturnType<typeof zodToFactory<ModuleSubscribeQuery>> = zodToFactory(ModuleSubscribeQueryZod, 'toModuleSubscribeQuery')\n", "import type { AsTypeFunction } from '@xylabs/sdk'\nimport { AsObjectFactory } from '@xylabs/sdk'\n\nimport type { AnyConfigSchema, ModuleConfig } from '../Config/Config.ts'\nimport type { ModuleEventData } from '../EventsModels/ModuleEventData.ts'\nimport { isQueryableModuleObject } from './isQueryableModuleObject.ts'\nimport type { QueryableModule } from './QueryableModule.ts'\nimport type { QueryableModuleParams } from './QueryableModuleParams.ts'\n\nexport const asQueryableModuleObject: AsTypeFunction<QueryableModule<QueryableModuleParams<AnyConfigSchema<ModuleConfig>>, ModuleEventData<object>>> = AsObjectFactory.create(isQueryableModuleObject)\n\n/** @deprecated use asQueryableModuleObject instead */\nexport const asModuleObject: AsTypeFunction<QueryableModule<QueryableModuleParams<AnyConfigSchema<ModuleConfig>>, ModuleEventData<object>>> = asQueryableModuleObject\n", "import type { ObjectTypeShape, TypeCheck } from '@xylabs/sdk'\nimport { IsObjectFactory } from '@xylabs/sdk'\n\nimport type { QueryableModule } from './QueryableModule.ts'\n\nexport const requiredQueryableModuleShape: ObjectTypeShape = {\n address: 'string',\n queries: 'array',\n query: 'function',\n}\n\n/** @deprecated use requiredQueryableModuleShape instead */\nexport const requiredModuleShape: ObjectTypeShape = requiredQueryableModuleShape\n\nconst factory = new IsObjectFactory<QueryableModule>()\n\nexport const isQueryableModuleObject: TypeCheck<QueryableModule> = factory.create(requiredQueryableModuleShape)\n\n/** @deprecated use isQueryableModuleObject instead */\nexport const isModuleObject: TypeCheck<QueryableModule> = isQueryableModuleObject\n", "import type {\n AnyNonPromise,\n AnyObject, EmptyObject, TypeCheck,\n TypeCheckConfig,\n} from '@xylabs/sdk'\n\nimport { asQueryableModuleObject } from './asQueryableModuleObject.ts'\nimport { isQueryableModuleObject } from './isQueryableModuleObject.ts'\nimport type { QueryableModule } from './QueryableModule.ts'\n\nexport type QueryableModuleTypeCheck<T extends QueryableModule = QueryableModule> = TypeCheck<T>\n\n/** @deprecated use QueryableModuleTypeCheck instead */\nexport type ModuleTypeCheck<T extends QueryableModule = QueryableModule> = TypeCheck<T>\n\nexport class IsQueryableModuleFactory<T extends QueryableModule = QueryableModule> {\n create(expectedQueries?: string[], additionalChecks?: TypeCheck<AnyObject | EmptyObject>[]): QueryableModuleTypeCheck<T> {\n const result = (obj: AnyNonPromise, config?: TypeCheckConfig | number): obj is T => {\n const mod = asQueryableModuleObject(obj)\n return (\n isQueryableModuleObject(mod, config)\n\n && (expectedQueries?.reduce((prev, query) => prev && mod.queries.includes(query), true) ?? true)\n // perform additional checks\n\n && (additionalChecks?.reduce((prev, check) => prev && check(obj, config), true) ?? true)\n )\n }\n return result\n }\n}\n\n/** @deprecated use IsQueryableModuleFactory instead */\nexport class IsModuleFactory<T extends QueryableModule = QueryableModule> extends IsQueryableModuleFactory<T> {}\n", "import type { TypeCheck } from '@xylabs/sdk'\nimport type { Schema } from '@xyo-network/sdk-protocol'\n\nimport { ModuleStateQuerySchema } from '../Queries/index.ts'\nimport { IsQueryableModuleFactory } from './IsQueryableModuleFactory.ts'\nimport { isQueryableModuleObject } from './isQueryableModuleObject.ts'\nimport type { QueryableModule } from './QueryableModule.ts'\n\nexport const requiredQueryableModuleQueries: Schema[] = [ModuleStateQuerySchema]\n\n/** @deprecated use requiredQueryableModuleQueries instead */\nexport const requiredModuleQueries: Schema[] = requiredQueryableModuleQueries\n\n// we do not use IsInstanceFactory here to prevent a cycle\nconst factory = new IsQueryableModuleFactory<QueryableModule>()\n\nexport const isQueryableModule: TypeCheck<QueryableModule> = factory.create(requiredQueryableModuleQueries, [isQueryableModuleObject])\n\n/** @deprecated use isQueryableModule instead */\nexport const isModule: TypeCheck<QueryableModule> = isQueryableModule\n", "import type { AsTypeFunction } from '@xylabs/sdk'\nimport { AsObjectFactory } from '@xylabs/sdk'\n\nimport type { AttachableModuleInstance } from './AttachableInstance.ts'\nimport { isAttachableModuleInstance } from './isAttachableInstance.ts'\n\nexport const asAttachableModuleInstance: AsTypeFunction<AttachableModuleInstance> = AsObjectFactory.create(isAttachableModuleInstance)\n", "import type { ObjectTypeShape, TypeCheck } from '@xylabs/sdk'\nimport { IsObjectFactory } from '@xylabs/sdk'\n\nimport { isModuleInstance } from '../isModuleInstance.ts'\nimport type { AttachableModuleInstance } from './AttachableInstance.ts'\n\nexport const requiredAttachableModuleInstanceFunctions: ObjectTypeShape = {\n downResolver: 'object',\n upResolver: 'object',\n}\n\n// we do not use IsInstanceFactory here to prevent a cycle\nconst factory = new IsObjectFactory<AttachableModuleInstance>()\n\nexport const isAttachableModuleInstance: TypeCheck<AttachableModuleInstance> = factory.create(requiredAttachableModuleInstanceFunctions, [\n isModuleInstance,\n])\n", "import type { CreatableInstance, TypeCheck } from '@xylabs/sdk'\nimport { IsObjectFactory } from '@xylabs/sdk'\n\nimport type { ModuleEventData } from '../../EventsModels/index.ts'\nimport type { QueryableModuleParams } from '../../QueryableModule/index.ts'\nimport type { ModuleInstance } from '../Instance.ts'\nimport type { ModuleResolverInstance } from '../ModuleResolver.ts'\n\nexport interface AttachableModuleInstance<TParams extends QueryableModuleParams = QueryableModuleParams, TEventData extends ModuleEventData = ModuleEventData>\n extends ModuleInstance<TParams, TEventData>, CreatableInstance<TParams, TEventData> {\n config: TParams['config']\n /* The resolver is a 'down' resolver. It can resolve the module or any children (if it is a node for example), that are in the module */\n readonly downResolver: ModuleResolverInstance\n\n // The resolver that gets called by children (usually only Nodes have this)\n readonly privateResolver: ModuleResolverInstance\n\n /* The resolver is a 'up' resolver. It can resolve the parent or any children of the parent */\n /* This is set by a NodeModule when attaching to the module */\n readonly upResolver: ModuleResolverInstance\n}\n\nexport type AttachableModuleInstanceTypeCheck<T extends AttachableModuleInstance = AttachableModuleInstance> = TypeCheck<T>\n\nexport class IsAttachableModuleInstanceFactory<T extends AttachableModuleInstance = AttachableModuleInstance> extends IsObjectFactory<T> {}\n", "import type {\n CreatableStatus, Promisable,\n TypeCheck,\n} from '@xylabs/sdk'\nimport { IsObjectFactory, toSafeJsonString } from '@xylabs/sdk'\nimport type { AccountInstance, XyoAddress } from '@xyo-network/sdk-protocol'\n\nimport type { ModuleEventData } from '../EventsModels/index.ts'\nimport type { ModuleIdentifier, ModuleName } from '../ModuleIdentifier.ts'\nimport type {\n QueryableModule, QueryableModuleFunctions,\n QueryableModuleParams,\n} from '../QueryableModule/index.ts'\nimport type { Direction } from './ObjectFilter.ts'\nimport type { ObjectResolver } from './ObjectResolver.ts'\n\nexport type ModulePipeLine = Lowercase<'one-to-one' | 'one-to-many' | 'many-to-one' | 'many-to-many'>\n\nexport type ModuleStatus = CreatableStatus | 'wrapped' | 'proxy'\n\nexport class DeadModuleError extends Error {\n error: Error | undefined\n id: ModuleIdentifier\n constructor(\n id: ModuleIdentifier,\n error: Error | undefined,\n msg = 'Dead Module Error',\n ) {\n super(`${msg} [${id}]: ${error?.message ?? toSafeJsonString(error)}`)\n this.id = id\n this.error = error\n\n // Set the prototype explicitly.\n Object.setPrototypeOf(this, DeadModuleError.prototype)\n }\n}\n\nexport interface AddressToWeakInstanceCache {\n get: (address: XyoAddress) => WeakRef<ModuleInstance> | null\n set: (address: XyoAddress, instance: WeakRef<ModuleInstance> | null) => void\n}\n\nexport interface ModuleFamilyFunctions {\n account?: AccountInstance\n addParent: (mod: ModuleInstance) => void\n addressCache?: (direction: Direction, includePrivate: boolean) => AddressToWeakInstanceCache | undefined\n modName?: ModuleName\n parents: () => Promisable<ModuleInstance[]>\n privateChildren: () => Promisable<ModuleInstance[]>\n publicChildren: () => Promisable<ModuleInstance[]>\n removeParent: (address: XyoAddress) => void\n siblings: () => Promisable<ModuleInstance[]>\n}\n\nexport interface ModuleInstance<TParams extends QueryableModuleParams = QueryableModuleParams, TEventData extends ModuleEventData = ModuleEventData>\n extends QueryableModule<TParams, TEventData>,\n ObjectResolver<ModuleInstance>,\n QueryableModuleFunctions,\n ModuleFamilyFunctions {\n readonly pipeline?: ModulePipeLine\n\n // if the module has become non-functional, such as a broken bridge connection, this will be 'dead'\n readonly status: ModuleStatus | null\n}\n\nexport type InstanceTypeCheck<T extends ModuleInstance = ModuleInstance> = TypeCheck<T>\n\nexport class IsInstanceFactory<T extends ModuleInstance = ModuleInstance> extends IsObjectFactory<T> {}\n", "import type {\n AnyObject, EmptyObject, TypeCheck,\n} from '@xylabs/sdk'\nimport type { XyoAddress } from '@xyo-network/sdk-protocol'\n\nimport type { ModuleName } from '../ModuleIdentifier.ts'\n\nexport type Direction = 'up' | 'down' | 'all'\nexport type Visibility = 'public' | 'private' | 'all'\n\nexport interface ResolveStrategy {\n maxDepth?: number\n required?: boolean | 'warn' | 'log'\n retry?: number\n timeout?: number\n}\n\nexport interface ObjectFilterOptions<T extends EmptyObject = AnyObject> extends ResolveStrategy {\n direction?: Direction\n identity?: TypeCheck<T>\n}\n\nexport interface AddressObjectFilter<T extends EmptyObject = AnyObject> extends ObjectFilterOptions<T> {\n address: XyoAddress[]\n}\n\nexport const isAddressObjectFilter = <T extends EmptyObject = AnyObject>(value: unknown): value is AddressObjectFilter<T> =>\n (value as AddressObjectFilter<T>).address !== undefined\n\nexport interface NameObjectFilter<T extends EmptyObject = AnyObject> extends ObjectFilterOptions<T> {\n name: ModuleName[]\n}\n\nexport const isNameObjectFilter = <T extends EmptyObject = AnyObject>(value: unknown): value is NameObjectFilter<T> =>\n (value as NameObjectFilter<T>).name !== undefined\n\nexport interface QueryObjectFilter<T extends EmptyObject = AnyObject> extends ObjectFilterOptions<T> {\n query: string[][]\n}\n\nexport const isQueryObjectFilter = <T extends EmptyObject = AnyObject>(value: unknown): value is QueryObjectFilter<T> =>\n (value as QueryObjectFilter<T>).query !== undefined\n\nexport type AnyObjectFilter<T extends EmptyObject = AnyObject> = Partial<AddressObjectFilter<T>>\n & Partial<NameObjectFilter<T>>\n & Partial<QueryObjectFilter<T>>\n\nexport type ObjectFilter<T extends EmptyObject> = ObjectFilterOptions<T> | AddressObjectFilter<T> | NameObjectFilter<T> | QueryObjectFilter<T>\n", "import type { ModuleInstance } from './Instance.ts'\nimport type {\n AddressObjectFilter,\n AnyObjectFilter,\n NameObjectFilter,\n ObjectFilter,\n ObjectFilterOptions,\n QueryObjectFilter,\n} from './ObjectFilter.ts'\nimport {\n isAddressObjectFilter,\n isNameObjectFilter,\n isQueryObjectFilter,\n} from './ObjectFilter.ts'\n\nexport interface ModuleFilterOptions<T extends ModuleInstance = ModuleInstance> extends ObjectFilterOptions<T> {}\n\nexport const isAddressModuleFilter: (value: unknown) => value is AddressObjectFilter<ModuleInstance> = isAddressObjectFilter<ModuleInstance>\n\nexport const isNameModuleFilter: (value: unknown) => value is NameObjectFilter<ModuleInstance> = isNameObjectFilter<ModuleInstance>\n\nexport const isQueryModuleFilter: (value: unknown) => value is QueryObjectFilter<ModuleInstance> = isQueryObjectFilter<ModuleInstance>\n\nexport type AnyModuleFilter<T extends ModuleInstance = ModuleInstance> = AnyObjectFilter<T>\n\nexport type AddressModuleFilter<T extends ModuleInstance = ModuleInstance> = AddressObjectFilter<T>\n\nexport type NameModuleFilter<T extends ModuleInstance = ModuleInstance> = NameObjectFilter<T>\n\nexport type QueryModuleFilter<T extends ModuleInstance = ModuleInstance> = QueryObjectFilter<T>\n\n/** @deprecated use ModuleIdentifier instead */\nexport type ModuleFilter<T extends ModuleInstance = ModuleInstance> = ObjectFilter<T>\n", "import type {\n AnyObject, EmptyObject, Promisable,\n} from '@xylabs/sdk'\n\nimport type { ModuleIdentifier } from '../ModuleIdentifier.ts'\nimport type { ObjectFilterOptions } from './ObjectFilter.ts'\n\nexport const isObjectResolver = <T extends EmptyObject = AnyObject>(value?: unknown): value is ObjectResolver<T> => {\n return typeof (value as Partial<ObjectResolver<T>>).resolve === 'function'\n}\n\nexport const ObjectResolverPriority = {\n Disabled: -1,\n VeryLow: 0,\n Low: 1,\n Normal: 2,\n High: 3,\n VeryHigh: 4,\n} as const\n\nexport type ObjectResolverPriority = typeof ObjectResolverPriority[keyof typeof ObjectResolverPriority]\n\nexport interface ObjectResolver<TResult extends EmptyObject> {\n priority: ObjectResolverPriority\n resolve<T extends TResult = TResult>(all: '*', options?: ObjectFilterOptions<T>): Promisable<T[]>\n resolve<T extends TResult = TResult>(id: ModuleIdentifier, options?: ObjectFilterOptions<T>): Promisable<T | undefined>\n resolve<T extends TResult = TResult>(\n id?: ModuleIdentifier,\n options?: ObjectFilterOptions<T>,\n ): Promisable<T | T[] | undefined>\n\n resolvePrivate<T extends TResult = TResult>(all: '*', options?: ObjectFilterOptions<T>): Promise<T[]>\n resolvePrivate<T extends TResult = TResult>(id: ModuleIdentifier, options?: ObjectFilterOptions<T>): Promise<T | undefined>\n resolvePrivate<T extends TResult = TResult>(id: ModuleIdentifier, options?: ObjectFilterOptions<T>): Promise<T | T[] | undefined>\n}\n\nexport interface ObjectResolverInstance<TResult extends EmptyObject> extends ObjectResolver<TResult> {\n addResolver: (resolver: ObjectResolverInstance<TResult>) => this\n removeResolver: (resolver: ObjectResolverInstance<TResult>) => this\n}\n", "import type { Promisable } from '@xylabs/sdk'\nimport type { XyoAddress } from '@xyo-network/sdk-protocol'\n\nimport type { ModuleIdentifier } from '../ModuleIdentifier.ts'\nimport type { ModuleInstance } from './Instance.ts'\nimport type { ObjectFilterOptions } from './ObjectFilter.ts'\nimport type { ObjectResolver } from './ObjectResolver.ts'\nimport { isObjectResolver } from './ObjectResolver.ts'\n\nexport const isModuleResolver: (value?: unknown) => value is ObjectResolver<ModuleInstance> = isObjectResolver<ModuleInstance>\n\nexport interface ModuleResolver<TResult extends ModuleInstance = ModuleInstance> extends ObjectResolver<TResult> {}\n\nexport interface ModuleNameResolver {\n readonly root: ModuleInstance\n resolveIdentifier(id: ModuleIdentifier, options?: ObjectFilterOptions): Promisable<XyoAddress | undefined>\n}\n\nexport interface ModuleResolverInstance<TResult extends ModuleInstance = ModuleInstance> extends ModuleResolver<TResult>, ModuleNameResolver {\n addResolver: (resolver: ModuleResolverInstance<TResult>) => this\n removeResolver: (resolver: ModuleResolverInstance<TResult>) => this\n}\n", "/**\n * Object used to represent labels identifying a resource.\n */\nexport type Labels = Record<string, string | undefined>\n\n/**\n * Interface for objects that have labels.\n */\nexport interface WithLabels<T extends Labels = Labels> {\n labels: T\n}\n\n/**\n * Interface for objects that have labels.\n */\nexport interface WithOptionalLabels<T extends Labels = Labels> {\n labels?: T\n}\n\n/**\n * Returns true if the source object has all the labels from the required set\n * @param source Source object to check against\n * @param required Set of labels to check for in source\n * @returns True of the source object has all the labels from the required set\n */\nexport const hasAllLabels = (source?: Labels, required?: Labels): boolean => {\n if (!required) return true\n return Object.entries(required).every(([key, value]) => {\n return Object.hasOwn(source ?? {}, key) && source?.[key] === value\n })\n}\n", "export const ModuleLimitationLabelName = 'network.xyo.module.limitation'\nexport type ModuleLimitationLabelName = typeof ModuleLimitationLabelName\n\nexport const ModuleLimitationViewLabel = { ModuleLimitationLabelName: 'view' }\n", "import type { QueryableModule } from '../QueryableModule/index.ts'\n\n/**\n * Used to filter duplicates from an array of modules\n * @example: modulesArray.filter(duplicateModules)\n * @param value Current Module\n * @param index Current Module's index\n * @param array Module Array\n * @returns True if the Module's address is the first occurrence of\n * that address in the array, false otherwise\n */\nexport const duplicateModules = (value: QueryableModule, index: number, array: QueryableModule[]): value is QueryableModule => {\n return array.findIndex(v => v.address === value.address) === index\n}\n", "export const isSerializable = (value: unknown, maxDepth = 10): boolean => {\n if (maxDepth <= 0) {\n return false\n }\n if (value === null || typeof value === 'boolean' || typeof value === 'number' || typeof value === 'string') {\n return true\n }\n\n if (Array.isArray(value)) {\n return value.every(item => isSerializable(item, maxDepth - 1))\n }\n\n if (typeof value === 'object') {\n if (value instanceof Date || value instanceof RegExp) {\n return true\n }\n\n // Check for non-serializable objects like Set and Map\n if (value instanceof Set || value instanceof Map) {\n return false\n }\n\n if (value !== null && value !== undefined) {\n return Object.values(value).every(item => isSerializable(item, maxDepth - 1))\n }\n }\n\n // Exclude functions, symbols, undefined, and BigInt explicitly\n return false\n}\n", "import type { Address } from '@xylabs/sdk'\nimport { isAddress } from '@xylabs/sdk'\n\nexport const MODULE_PATH_SEPARATOR = ':' as const\n\nexport const DisallowedModuleIdentifierCharacters = {\n ' ': true,\n '!': true,\n '\"': true,\n '#': true,\n '$': true,\n '%': true,\n '&': true,\n \"'\": true,\n '(': true,\n ')': true,\n '*': true,\n ',': true,\n '.': true,\n '/': true,\n ':': true,\n ';': true,\n '<': true,\n '=': true,\n '>': true,\n '?': true,\n '@': true,\n '[': true,\n ']': true,\n '^': true,\n '_': true,\n '{': true,\n '|': true,\n '}': true,\n '~': true,\n}\nexport type ReservedModuleIdentifierCharacter = keyof typeof DisallowedModuleIdentifierCharacters\nexport const ReservedModuleIdentifierCharacters: Set<ReservedModuleIdentifierCharacter> = new Set<ReservedModuleIdentifierCharacter>(\n Object.keys(DisallowedModuleIdentifierCharacters) as ReservedModuleIdentifierCharacter[],\n)\n\n// TODO: Use Brand, but avoid too complex error\n// export type ModuleName = Brand<string, { __moduleName: true }>\nexport type ModuleName = string\n\nexport type ModuleIdentifier\n = | ColonPair<ModuleIdentifierPart>\n | ColonPair<ColonPair<ModuleIdentifierPart>>\n | ColonPair<ColonPair<ColonPair<ModuleIdentifierPart>>>\n | ColonPair<ColonPair<ColonPair<ColonPair<ModuleIdentifierPart>>>>\n | ColonPair<ColonPair<ColonPair<ColonPair<ColonPair<ModuleIdentifierPart>>>>>\n | ColonPair<ColonPair<ColonPair<ColonPair<ColonPair<ColonPair<ModuleIdentifierPart>>>>>>\n | ColonPair<ColonPair<ColonPair<ColonPair<ColonPair<ColonPair<ColonPair<ModuleIdentifierPart>>>>>>>\n\nexport type ColonPair<T extends string> = `${T}:${T}` | T\n\nexport type ModuleIdentifierPart = Exclude<Address | ModuleName, '*'>\n\nexport const isModuleName = (value: unknown): value is ModuleName => {\n return typeof value === 'string' && !isAddress(value) && !includesReservedModuleIdentifierCharacter(value)\n}\n\nexport const includesReservedModuleIdentifierCharacter = (value: unknown): boolean => {\n return typeof value === 'string' && [...value].some(char => ReservedModuleIdentifierCharacters.has(char as ReservedModuleIdentifierCharacter))\n}\n\nexport const isModuleIdentifierPart = (value: unknown): value is ModuleIdentifierPart => {\n return isModuleName(value) || isAddress(value)\n}\n", "import {\n zodAsFactory, zodIsFactory, zodToFactory,\n} from '@xylabs/sdk'\nimport {\n asSchema, PayloadZodOfSchema, type XyoAddress,\n} from '@xyo-network/sdk-protocol'\nimport * as z from 'zod/mini'\n\nexport const AddressSchema: 'network.xyo.address' & {\n readonly __schema: true\n} = asSchema('network.xyo.address', true)\nexport type AddressSchema = typeof AddressSchema\n\nexport const AddressChildSchema: 'network.xyo.address.child' & {\n readonly __schema: true\n} = asSchema('network.xyo.address.child', true)\nexport type AddressChildSchema = typeof AddressChildSchema\n\nexport interface AddressFields {\n address: XyoAddress\n}\n\nexport const AddressPayloadZod: z.ZodMiniObject<{\n address: z.ZodMiniCustom<XyoAddress, XyoAddress>\n schema: z.ZodMiniLiteral<AddressSchema>\n}, z.core.$strip> = z.extend(PayloadZodOfSchema(AddressSchema), { address: z.custom<XyoAddress>() })\n\nexport type AddressPayload = z.infer<typeof AddressPayloadZod>\n\n/**\n * Identity function for determining if an object is an Address\n */\nexport const isAddressPayload: ReturnType<typeof zodIsFactory<AddressPayload>> = zodIsFactory(AddressPayloadZod)\nexport const asAddressPayload: ReturnType<typeof zodAsFactory<AddressPayload>> = zodAsFactory(AddressPayloadZod, 'asAddressPayload')\nexport const toAddressPayload: ReturnType<typeof zodToFactory<AddressPayload>> = zodToFactory(AddressPayloadZod, 'toAddressPayload')\n\n/** @deprecated use asAddressPayload instead */\nexport const asOptionalAddressPayload: ReturnType<typeof zodAsFactory<AddressPayload>> = asAddressPayload\n\nexport interface AddressChildFields extends AddressFields {\n /**\n * The derivation path of the child address\n */\n path?: string\n /**\n * The public address of the root of the hierarchy\n */\n root?: XyoAddress\n}\n\nexport const AddressChildPayloadZod: z.ZodMiniObject<{\n address: z.ZodMiniCustom<XyoAddress, XyoAddress>\n path: z.ZodMiniOptional<z.ZodMiniString<string>>\n root: z.ZodMiniOptional<z.ZodMiniCustom<XyoAddress, XyoAddress>>\n schema: z.ZodMiniLiteral<AddressChildSchema>\n}, z.core.$strip> = z.extend(PayloadZodOfSchema(AddressChildSchema), {\n address: z.custom<XyoAddress>(),\n path: z.optional(z.string()),\n root: z.optional(z.custom<XyoAddress>()),\n})\n\nexport type AddressChildPayload = z.infer<typeof AddressChildPayloadZod>\n\nexport const isAddressChildPayload: ReturnType<typeof zodIsFactory<AddressChildPayload>> = zodIsFactory(AddressChildPayloadZod)\nexport const asAddressChildPayload: ReturnType<typeof zodAsFactory<AddressChildPayload>> = zodAsFactory(AddressChildPayloadZod, 'asAddressChildPayload')\nexport const toAddressChildPayload: ReturnType<typeof zodToFactory<AddressChildPayload>> = zodToFactory(AddressChildPayloadZod, 'toAddressChildPayload')\n", "import {\n zodAsFactory, zodIsFactory, zodToFactory,\n} from '@xylabs/sdk'\nimport {\n asSchema, PayloadZodOfSchema, type XyoAddress,\n} from '@xyo-network/sdk-protocol'\nimport * as z from 'zod/mini'\n\nexport const AddressPreviousHashSchema: 'network.xyo.address.hash.previous' & {\n readonly __schema: true\n} = asSchema('network.xyo.address.hash.previous', true)\nexport type AddressPreviousHashSchema = typeof AddressPreviousHashSchema\n\nexport const AddressPreviousHashPayloadZod: z.ZodMiniObject<{\n address: z.ZodMiniCustom<XyoAddress, XyoAddress>\n previousHash: z.ZodMiniOptional<z.ZodMiniString<string>>\n schema: z.ZodMiniLiteral<AddressPreviousHashSchema>\n}, z.core.$strip> = z.extend(PayloadZodOfSchema(AddressPreviousHashSchema), {\n address: z.custom<XyoAddress>(),\n previousHash: z.optional(z.string()),\n})\n\nexport type AddressPreviousHashPayload = z.infer<typeof AddressPreviousHashPayloadZod>\n\nexport const isAddressPreviousHashPayload: ReturnType<typeof zodIsFactory<AddressPreviousHashPayload>> = zodIsFactory(AddressPreviousHashPayloadZod)\nexport const asAddressPreviousHashPayload: ReturnType<typeof zodAsFactory<AddressPreviousHashPayload>> = zodAsFactory(AddressPreviousHashPayloadZod, 'asAddressPreviousHashPayload')\nexport const toAddressPreviousHashPayload: ReturnType<typeof zodToFactory<AddressPreviousHashPayload>> = zodToFactory(AddressPreviousHashPayloadZod, 'toAddressPreviousHashPayload')\n", "import {\n zodAsFactory, zodIsFactory, zodToFactory,\n} from '@xylabs/sdk'\nimport { asSchema, PayloadZodOfSchema } from '@xyo-network/sdk-protocol'\nimport * as z from 'zod/mini'\n\nimport type { ModuleDescription } from '../ModuleDescription.ts'\n\nexport const ModuleDescriptionSchema: 'network.xyo.module.description' & {\n readonly __schema: true\n} = asSchema('network.xyo.module.description', true)\nexport type ModuleDescriptionSchema = typeof ModuleDescriptionSchema\n\nexport const ModuleDescriptionPayloadZod: z.ZodMiniIntersection<\n z.ZodMiniObject<{ schema: z.ZodMiniLiteral<ModuleDescriptionSchema> }, z.core.$strip>,\n z.ZodMiniCustom<ModuleDescription, ModuleDescription>\n> = z.intersection(PayloadZodOfSchema(ModuleDescriptionSchema), z.custom<ModuleDescription>())\n\nexport type ModuleDescriptionPayload = z.infer<typeof ModuleDescriptionPayloadZod>\n\nexport const isModuleDescriptionPayload: ReturnType<typeof zodIsFactory<ModuleDescriptionPayload>> = zodIsFactory(ModuleDescriptionPayloadZod)\nexport const asModuleDescriptionPayload: ReturnType<typeof zodAsFactory<ModuleDescriptionPayload>> = zodAsFactory(ModuleDescriptionPayloadZod, 'asModuleDescriptionPayload')\nexport const toModuleDescriptionPayload: ReturnType<typeof zodToFactory<ModuleDescriptionPayload>> = zodToFactory(ModuleDescriptionPayloadZod, 'toModuleDescriptionPayload')\n", "import {\n zodAsFactory, zodIsFactory, zodToFactory,\n} from '@xylabs/sdk'\nimport type { Payload, WithSources } from '@xyo-network/sdk-protocol'\nimport {\n asSchema, isPayloadOfSchemaTypeWithSources, PayloadZodOfSchema,\n} from '@xyo-network/sdk-protocol'\nimport * as z from 'zod/mini'\n\nexport type StateDictionary = Record<string, string | number>\nexport interface State<T extends StateDictionary = StateDictionary> {\n state: T\n}\n\nexport const ModuleStateSchema: 'network.xyo.module.state' & {\n readonly __schema: true\n} = asSchema('network.xyo.module.state', true)\nexport type ModuleStateSchema = typeof ModuleStateSchema\n\nexport const ModuleStateZod: z.ZodMiniObject<{\n schema: z.ZodMiniLiteral<ModuleStateSchema>\n state: z.ZodMiniCustom<StateDictionary, StateDictionary>\n}, z.core.$strip> = z.extend(PayloadZodOfSchema(ModuleStateSchema), { state: z.custom<StateDictionary>() })\n\nexport type ModuleState<T extends StateDictionary = StateDictionary> = Payload<State<T>, ModuleStateSchema>\n\nconst isModuleStateInternal = zodIsFactory(ModuleStateZod)\n\nexport const isModuleState = <T extends StateDictionary = StateDictionary, TInput = unknown>(payload?: TInput): payload is ModuleState<T> & TInput => isModuleStateInternal(payload)\n\nexport const isModuleStateWithSources = <T extends StateDictionary = StateDictionary,\n TInput = unknown>(payload?: TInput): payload is WithSources<ModuleState<T>> & TInput => {\n return isPayloadOfSchemaTypeWithSources<ModuleState<T>>(ModuleStateSchema)(payload)\n}\n\nexport const asModuleState: ReturnType<typeof zodAsFactory<ModuleState>> = zodAsFactory(ModuleStateZod, 'asModuleState')\nexport const toModuleState: ReturnType<typeof zodToFactory<ModuleState>> = zodToFactory(ModuleStateZod, 'toModuleState')\n\n/** @deprecated use asModuleState instead */\nexport const asOptionalModuleState: ReturnType<typeof zodAsFactory<ModuleState>> = asModuleState\n", "import type { TypeCheck } from '@xylabs/sdk'\n\n/** @deprecated use narrowing instead [ if(is) ] */\nexport const WithFactory = {\n create: <T extends object>(typeCheck: TypeCheck<T>) => {\n return <R>(\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n mod: any,\n\n closure: (mod: T) => R,\n ): R | undefined => {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-argument\n return typeCheck(mod) ? closure(mod) : undefined\n }\n },\n}\n"],
5
5
  "mappings": ";AACA,YAAY,OAAO;AAIZ,IAAM,2BAKS,SAAO;AAAA,EAC3B,WAAa,WAAW,SAAO;AAAA,IAC7B,YAAc,WAAW,QAAQ,SAAyB,CAAC,CAAC;AAAA,IAC5D,SAAW,WAAW,QAAQ,SAAe,CAAC,CAAC;AAAA,EACjD,CAAC,CAAC;AACJ,CAAC;;;ACdD;AAAA,EACE;AAAA,EAAc;AAAA,EAAc;AAAA,OACvB;AACP;AAAA,EACE;AAAA,EAAwB;AAAA,OACnB;AACP,YAAYA,QAAO;;;ACLnB,YAAYC,QAAO;AAMZ,IAAM,wBAeS,UAAO;AAAA,EAC3B,gBAAkB,YAAW,SAAQ,UAAe,CAAC,CAAC;AAAA,EACtD,WAAa,YAAW,UAAyB,CAAC;AAAA,EAClD,QAAU,YAAW,UAAe,CAAC;AAAA,EACrC,UAAY,YAAW,UAAsB,CAAC;AAAA,EAC9C,MAAQ,YAAW,UAAmB,CAAC;AAAA,EACvC,QAAU,YAAW,UAAS,UAAO,GAAK,UAAO,EAAE,MAAQ,YAAW,UAAO,CAAC,EAAE,CAAC,CAAC,CAAC;AAAA,EACnF,OAAS,YAAW,UAAoB,CAAC;AAAA,EACzC,UAAY,YAAW,UAA6B,CAAC;AAAA,EACrD,MAAQ,YAAW,WAAQ,CAAC;AAAA,EAC5B,cAAgB,YAAW,WAAQ,CAAC;AAAA,EACpC,YAAc,YAAW,UAAO,CAAC;AAAA,EACjC,WAAa,YAAW,W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B,CACpB,YAAsE;AACxF,SAAO,iCAAiD,iBAAiB,EAAE,OAAO;AACpF;AAEO,IAAM,gBAA8DD,cAAa,gBAAgB,eAAe;AAChH,IAAM,gBAA8DE,cAAa,gBAAgB,eAAe;AAGhH,IAAM,wBAAsE;;;ACpC5E,IAAM,cAAc;AAAA,EACzB,QAAQ,CAAmB,cAA4B;AACrD,WAAO,CAEL,KAEA,YACkB;AAElB,aAAO,UAAU,GAAG,IAAI,QAAQ,GAAG,IAAI;AAAA,IACzC;AAAA,EACF;AACF;",
6
6
  "names": ["z", "z", "z", "z", "asSchema", "factory", "factory", "creatableModule", "AsObjectFactory", "IsObjectFactory", "AsObjectFactory", "zodAsFactory", "zodIsFactory", "zodToFactory", "asSchema", "z", "zodAsFactory", "zodIsFactory", "zodToFactory", "asSchema", "PayloadZodOfSchema", "QueryFieldsZod", "z", "zodAsFactory", "zodIsFactory", "zodToFactory", "asSchema", "PayloadZodOfSchema", "QueryFieldsZod", "z", "zodAsFactory", "zodIsFactory", "zodToFactory", "asSchema", "PayloadZodOfSchema", "QueryFieldsZod", "z", "factory", "AsObjectFactory", "factory", "IsObjectFactory", "AsObjectFactory", "AsObjectFactory", "IsObjectFactory", "factory", "IsObjectFactory", "AsObjectFactory", "IsObjectFactory", "IsObjectFactory", "array", "zodAsFactory", "zodIsFactory", "zodToFactory", "asSchema", "PayloadZodOfSchema", "z", "zodAsFactory", "zodIsFactory", "zodToFactory", "asSchema", "PayloadZodOfSchema", "z", "zodAsFactory", "zodIsFactory", "zodToFactory", "asSchema", "PayloadZodOfSchema", "z", "zodAsFactory", "zodIsFactory", "zodToFactory", "asSchema", "PayloadZodOfSchema", "z"]
7
7
  }
@@ -1,6 +1,6 @@
1
- import type { CreatableStatus, Promisable, TypeCheck } from '@xylabs/sdk-js';
2
- import { IsObjectFactory } from '@xylabs/sdk-js';
3
- import type { AccountInstance, XyoAddress } from '@xyo-network/sdk-protocol-js';
1
+ import type { CreatableStatus, Promisable, TypeCheck } from '@xylabs/sdk';
2
+ import { IsObjectFactory } from '@xylabs/sdk';
3
+ import type { AccountInstance, XyoAddress } from '@xyo-network/sdk-protocol';
4
4
  import type { ModuleEventData } from '../EventsModels/index.ts';
5
5
  import type { ModuleIdentifier, ModuleName } from '../ModuleIdentifier.ts';
6
6
  import type { QueryableModule, QueryableModuleFunctions, QueryableModuleParams } from '../QueryableModule/index.ts';
@@ -1 +1 @@
1
- {"version":3,"file":"Instance.d.ts","sourceRoot":"","sources":["../../../src/instance/Instance.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,eAAe,EAAE,UAAU,EAC3B,SAAS,EACV,MAAM,gBAAgB,CAAA;AACvB,OAAO,EAAE,eAAe,EAAoB,MAAM,gBAAgB,CAAA;AAClE,OAAO,KAAK,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAA;AAE/E,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAA;AAC/D,OAAO,KAAK,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAA;AAC1E,OAAO,KAAK,EACV,eAAe,EAAE,wBAAwB,EACzC,qBAAqB,EACtB,MAAM,6BAA6B,CAAA;AACpC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAA;AAClD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAA;AAEzD,MAAM,MAAM,cAAc,GAAG,SAAS,CAAC,YAAY,GAAG,aAAa,GAAG,aAAa,GAAG,cAAc,CAAC,CAAA;AAErG,MAAM,MAAM,YAAY,GAAG,eAAe,GAAG,SAAS,GAAG,OAAO,CAAA;AAEhE,qBAAa,eAAgB,SAAQ,KAAK;IACxC,KAAK,EAAE,KAAK,GAAG,SAAS,CAAA;IACxB,EAAE,EAAE,gBAAgB,CAAA;gBAElB,EAAE,EAAE,gBAAgB,EACpB,KAAK,EAAE,KAAK,GAAG,SAAS,EACxB,GAAG,SAAsB;CAS5B;AAED,MAA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
+ import type { XyoAddress } from '@xyo-network/sdk-protocol';
2
2
  import type { ModuleInstance } from './Instance.ts';
3
3
  import type { ModuleResolverInstance } from './ModuleResolver.ts';
4
4
  export interface ModuleRepository<T extends ModuleInstance = ModuleInstance> extends ModuleResolverInstance<T> {
@@ -1 +1 @@
1
- {"version":3,"file":"ModuleRepository.d.ts","sourceRoot":"","sources":["../../../src/instance/ModuleRepository.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAA;AAE9D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AACnD,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAA;AAEjE,MAAM,WAAW,gBAAgB,CAAC,CAAC,SAAS,cAAc,GAAG,cAAc,CAAE,SAAQ,sBAAsB,CAAC,CAAC,CAAC;IAC5G,GAAG,CAAC,GAAG,EAAE,CAAC,GAAG,IAAI,CAAA;IACjB,GAAG,CAAC,GAAG,EAAE,CAAC,EAAE,GAAG,IAAI,CAAA;IACnB,GAAG,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,EAAE,GAAG,IAAI,CAAA;IAEvB,MAAM,CAAC,OAAO,EAAE,UAAU,GAAG,MAAM,EAAE,GAAG,IAAI,CAAA;CAC7C"}
1
+ {"version":3,"file":"ModuleRepository.d.ts","sourceRoot":"","sources":["../../../src/instance/ModuleRepository.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAA;AAE3D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AACnD,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAA;AAEjE,MAAM,WAAW,gBAAgB,CAAC,CAAC,SAAS,cAAc,GAAG,cAAc,CAAE,SAAQ,sBAAsB,CAAC,CAAC,CAAC;IAC5G,GAAG,CAAC,GAAG,EAAE,CAAC,GAAG,IAAI,CAAA;IACjB,GAAG,CAAC,GAAG,EAAE,CAAC,EAAE,GAAG,IAAI,CAAA;IACnB,GAAG,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,EAAE,GAAG,IAAI,CAAA;IAEvB,MAAM,CAAC,OAAO,EAAE,UAAU,GAAG,MAAM,EAAE,GAAG,IAAI,CAAA;CAC7C"}
@@ -1,5 +1,5 @@
1
- import type { Promisable } from '@xylabs/sdk-js';
2
- import type { XyoAddress } from '@xyo-network/sdk-protocol-js';
1
+ import type { Promisable } from '@xylabs/sdk';
2
+ import type { XyoAddress } from '@xyo-network/sdk-protocol';
3
3
  import type { ModuleIdentifier } from '../ModuleIdentifier.ts';
4
4
  import type { ModuleInstance } from './Instance.ts';
5
5
  import type { ObjectFilterOptions } from './ObjectFilter.ts';