@xyo-network/os-runtime 5.0.12 → 6.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (55) hide show
  1. package/dist/neutral/index.mjs +96 -63
  2. package/dist/neutral/index.mjs.map +1 -1
  3. package/dist/node/index.mjs +96 -63
  4. package/dist/node/index.mjs.map +1 -1
  5. package/dist/node/scripts/xyos/index.mjs +65 -46
  6. package/dist/node/scripts/xyos/index.mjs.map +1 -1
  7. package/dist/types/DappCallerBase.d.ts +4 -52
  8. package/dist/types/DappCallerBase.d.ts.map +1 -1
  9. package/dist/types/OsCallerBase.d.ts +5 -61
  10. package/dist/types/OsCallerBase.d.ts.map +1 -1
  11. package/dist/types/XyOs.d.ts +2 -18
  12. package/dist/types/XyOs.d.ts.map +1 -1
  13. package/dist/types/XyOsBase.d.ts +2 -2
  14. package/dist/types/XyOsBase.d.ts.map +1 -1
  15. package/dist/types/XyOsDapp.d.ts +2 -18
  16. package/dist/types/XyOsDapp.d.ts.map +1 -1
  17. package/dist/types/access/RunningAccessDappCache.d.ts +1 -9
  18. package/dist/types/access/RunningAccessDappCache.d.ts.map +1 -1
  19. package/dist/types/access/interfaces/registered-names/helpers/AccessNodeQueries.d.ts +1 -9
  20. package/dist/types/access/interfaces/registered-names/helpers/AccessNodeQueries.d.ts.map +1 -1
  21. package/dist/types/access/interfaces/registered-names/helpers/resource/AbstractXnsCaller.d.ts +3 -35
  22. package/dist/types/access/interfaces/registered-names/helpers/resource/AbstractXnsCaller.d.ts.map +1 -1
  23. package/dist/types/adapter/Base.d.ts +3 -11
  24. package/dist/types/adapter/Base.d.ts.map +1 -1
  25. package/dist/types/adapter/Network.d.ts +1 -9
  26. package/dist/types/adapter/Network.d.ts.map +1 -1
  27. package/dist/types/adapter/Settings.d.ts +1 -9
  28. package/dist/types/adapter/Settings.d.ts.map +1 -1
  29. package/dist/types/classes/settings/CallerBase.d.ts +2 -26
  30. package/dist/types/classes/settings/CallerBase.d.ts.map +1 -1
  31. package/dist/types/event/bus/Connection.d.ts +2 -2
  32. package/dist/types/event/bus/Connection.d.ts.map +1 -1
  33. package/dist/types/event/bus/EventBus.d.ts +1 -9
  34. package/dist/types/event/bus/EventBus.d.ts.map +1 -1
  35. package/dist/types/lib/isPayload.d.ts +1 -4
  36. package/dist/types/lib/isPayload.d.ts.map +1 -1
  37. package/dist/types/stack/Base.d.ts +2 -2
  38. package/dist/types/stack/Base.d.ts.map +1 -1
  39. package/dist/types/stack/OsPubSubNetworkStack.d.ts +2 -18
  40. package/dist/types/stack/OsPubSubNetworkStack.d.ts.map +1 -1
  41. package/package.json +50 -52
  42. package/src/DappCallerBase.ts +4 -4
  43. package/src/OsCallerBase.ts +5 -5
  44. package/src/PubSubBridgeCaller.ts +1 -1
  45. package/src/XyOsBase.ts +2 -2
  46. package/src/access/Caller.ts +1 -1
  47. package/src/access/interfaces/registered-names/helpers/AccessNodeQueries.ts +2 -2
  48. package/src/access/interfaces/registered-names/helpers/resource/AbstractXnsCaller.ts +3 -3
  49. package/src/adapter/Base.ts +4 -4
  50. package/src/classes/settings/CallerBase.ts +2 -2
  51. package/src/dapp/context/creator/createDappContext.ts +1 -1
  52. package/src/event/bus/Connection.ts +2 -2
  53. package/src/event/bus/EventBus.ts +1 -0
  54. package/src/loadOsNode.ts +2 -2
  55. package/src/stack/Base.ts +3 -3
@@ -2,8 +2,5 @@ import type { Payload, Schema } from '@xyo-network/payload-model';
2
2
  export declare const isObject: (x: unknown) => x is Record<string | symbol | number, unknown>;
3
3
  export declare const isAnyPayload: (obj: unknown) => obj is Payload;
4
4
  export declare const isPayload: <T extends Payload>(schema: Schema[]) => (obj: unknown) => obj is T;
5
- export declare const asPayload: <T extends Payload>(schema: Schema[]) => {
6
- <TType extends T>(value: import("@xylabs/promise").AnyNonPromise, config?: import("@xylabs/object").TypeCheckConfig): TType | undefined;
7
- <TType extends T>(value: import("@xylabs/promise").AnyNonPromise, assert: import("@xylabs/object").StringOrAlertFunction<T>, config?: import("@xylabs/object").TypeCheckConfig): TType;
8
- };
5
+ export declare const asPayload: <T extends Payload>(schema: Schema[]) => import("@xylabs/object").AsTypeFunction<T>;
9
6
  //# sourceMappingURL=isPayload.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"isPayload.d.ts","sourceRoot":"","sources":["../../../src/lib/isPayload.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAA;AAEjE,eAAO,MAAM,QAAQ,GAAI,GAAG,OAAO,KAAG,CAAC,IAAI,MAAM,CAAC,MAAM,GAAG,MAAM,GAAG,MAAM,EAAE,OAAO,CAElF,CAAA;AAED,eAAO,MAAM,YAAY,GAAI,KAAK,OAAO,KAAG,GAAG,IAAI,OAKlD,CAAA;AAED,eAAO,MAAM,SAAS,GACjB,CAAC,SAAS,OAAO,EAAE,QAAQ,MAAM,EAAE,MACnC,KAAK,OAAO,KAAG,GAAG,IAAI,CAKtB,CAAA;AAEL,eAAO,MAAM,SAAS,GAAI,CAAC,SAAS,OAAO,EAAE,QAAQ,MAAM,EAAE;;;CAAiD,CAAA"}
1
+ {"version":3,"file":"isPayload.d.ts","sourceRoot":"","sources":["../../../src/lib/isPayload.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAA;AAEjE,eAAO,MAAM,QAAQ,GAAI,GAAG,OAAO,KAAG,CAAC,IAAI,MAAM,CAAC,MAAM,GAAG,MAAM,GAAG,MAAM,EAAE,OAAO,CAElF,CAAA;AAED,eAAO,MAAM,YAAY,GAAI,KAAK,OAAO,KAAG,GAAG,IAAI,OAKlD,CAAA;AAED,eAAO,MAAM,SAAS,GACjB,CAAC,SAAS,OAAO,EAAE,QAAQ,MAAM,EAAE,MACnC,KAAK,OAAO,KAAG,GAAG,IAAI,CAKtB,CAAA;AAEL,eAAO,MAAM,SAAS,GAAI,CAAC,SAAS,OAAO,EAAE,QAAQ,MAAM,EAAE,+CAAiD,CAAA"}
@@ -1,5 +1,5 @@
1
1
  import type { BaseParams } from '@xylabs/base';
2
- import { ModuleBaseEmitter } from '@xyo-network/module-event-emitter';
2
+ import { BaseEmitter } from '@xylabs/events';
3
3
  import type { ModuleIdentifier } from '@xyo-network/module-model';
4
4
  import type { AttachableNodeInstance } from '@xyo-network/node-model';
5
5
  import type { AdapterSetCreator, NodeAdapter, StackBaseEvents, StackInitializer, XyOsContext } from '@xyo-network/os-model';
@@ -8,7 +8,7 @@ import type { AdapterSetCreator, NodeAdapter, StackBaseEvents, StackInitializer,
8
8
  *
9
9
  * Listens for changes in adapter connections, update the stack node, and emits events when the stack is ready
10
10
  */
11
- export declare class StackBase extends ModuleBaseEmitter<BaseParams, StackBaseEvents> implements StackInitializer {
11
+ export declare class StackBase extends BaseEmitter<BaseParams, StackBaseEvents> implements StackInitializer {
12
12
  initialized: boolean;
13
13
  private _adapterSet;
14
14
  private _context;
@@ -1 +1 @@
1
- {"version":3,"file":"Base.d.ts","sourceRoot":"","sources":["../../../src/stack/Base.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AAG9C,OAAO,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAA;AACrE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAA;AAEjE,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAA;AAErE,OAAO,KAAK,EACV,iBAAiB,EAAE,WAAW,EAAyB,eAAe,EAAE,gBAAgB,EAAE,WAAW,EACtG,MAAM,uBAAuB,CAAA;AAE9B;;;;GAIG;AACH,qBAAa,SAAU,SAAQ,iBAAiB,CAAC,UAAU,EAAE,eAAe,CAAE,YAAW,gBAAgB;IAEvG,WAAW,UAAQ;IAGnB,OAAO,CAAC,WAAW,CAAe;IAElC,OAAO,CAAC,QAAQ,CAAa;IAG7B,OAAO,CAAC,MAAM,CAAoC;IAGlD,OAAO,CAAC,kBAAkB,CAAkB;IAG5C,OAAO,CAAC,gBAAgB,CAA+B;IAIvD,OAAO,CAAC,SAAS,CAKT;gBAEI,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,gBAAgB;IAOpG,IAAI,UAAU,IAAI,WAAW,EAAE,CAE9B;IAED,IAAI,OAAO,IAAI,WAAW,CAEzB;IAED,IAAI,KAAK,IAAI,sBAAsB,CAElC;IAED,IAAI,iBAAiB,IAAI,gBAAgB,CAExC;IAED,UAAU;IA2BV;;OAEG;IACH,IAAI;IASJ;;;;;OAKG;YACW,kBAAkB;IAahC,OAAO,CAAC,WAAW;YAQL,YAAY;YAKZ,iBAAiB;YAcjB,yBAAyB;CAYxC"}
1
+ {"version":3,"file":"Base.d.ts","sourceRoot":"","sources":["../../../src/stack/Base.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AAC9C,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;AAG5C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAA;AAEjE,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAA;AAErE,OAAO,KAAK,EACV,iBAAiB,EAAE,WAAW,EAAyB,eAAe,EAAE,gBAAgB,EAAE,WAAW,EACtG,MAAM,uBAAuB,CAAA;AAE9B;;;;GAIG;AACH,qBAAa,SAAU,SAAQ,WAAW,CAAC,UAAU,EAAE,eAAe,CAAE,YAAW,gBAAgB;IAEjG,WAAW,UAAQ;IAGnB,OAAO,CAAC,WAAW,CAAe;IAElC,OAAO,CAAC,QAAQ,CAAa;IAG7B,OAAO,CAAC,MAAM,CAAoC;IAGlD,OAAO,CAAC,kBAAkB,CAAkB;IAG5C,OAAO,CAAC,gBAAgB,CAA+B;IAIvD,OAAO,CAAC,SAAS,CAKT;gBAEI,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,gBAAgB;IAOpG,IAAI,UAAU,IAAI,WAAW,EAAE,CAE9B;IAED,IAAI,OAAO,IAAI,WAAW,CAEzB;IAED,IAAI,KAAK,IAAI,sBAAsB,CAElC;IAED,IAAI,iBAAiB,IAAI,gBAAgB,CAExC;IAED,UAAU;IA2BV;;OAEG;IACH,IAAI;IASJ;;;;;OAKG;YACW,kBAAkB;IAahC,OAAO,CAAC,WAAW;YAQL,YAAY;YAKZ,iBAAiB;YAcjB,yBAAyB;CAYxC"}
@@ -6,24 +6,8 @@ export declare class OsPubSubNetworkStack extends StackBase {
6
6
  protected _exposedNodeOuter: NodeInstance | undefined;
7
7
  private busConnection;
8
8
  constructor(context: XyOsContext, adapters: AdapterSetCreator);
9
- get exposedNode(): NodeInstance<import("@xylabs/base").BaseParamsFields & {
10
- account?: import("@xyo-network/account-model").AccountInstance | "random";
11
- addToResolvers?: boolean;
12
- additionalSigners?: import("@xyo-network/account-model").AccountInstance[];
13
- allowNameResolution?: boolean;
14
- config: import("@xyo-network/module-model").AnyConfigSchema<import("@xyo-network/node-model").NodeConfig>;
15
- ephemeralQueryAccountEnabled?: boolean;
16
- moduleIdentifierTransformers?: import("@xyo-network/module-model").ModuleIdentifierTransformer[];
17
- } & import("@xyo-network/module-model").ModuleChildrenParams, import("@xyo-network/node-model").NodeModuleEventData> | undefined;
18
- get exposedNodeOuter(): NodeInstance<import("@xylabs/base").BaseParamsFields & {
19
- account?: import("@xyo-network/account-model").AccountInstance | "random";
20
- addToResolvers?: boolean;
21
- additionalSigners?: import("@xyo-network/account-model").AccountInstance[];
22
- allowNameResolution?: boolean;
23
- config: import("@xyo-network/module-model").AnyConfigSchema<import("@xyo-network/node-model").NodeConfig>;
24
- ephemeralQueryAccountEnabled?: boolean;
25
- moduleIdentifierTransformers?: import("@xyo-network/module-model").ModuleIdentifierTransformer[];
26
- } & import("@xyo-network/module-model").ModuleChildrenParams, import("@xyo-network/node-model").NodeModuleEventData> | undefined;
9
+ get exposedNode(): NodeInstance<import("@xyo-network/node-model").NodeParams<import("@xyo-network/module-model").AnyConfigSchema<import("@xyo-network/node-model").NodeConfig>>, import("@xyo-network/node-model").NodeModuleEventData> | undefined;
10
+ get exposedNodeOuter(): NodeInstance<import("@xyo-network/node-model").NodeParams<import("@xyo-network/module-model").AnyConfigSchema<import("@xyo-network/node-model").NodeConfig>>, import("@xyo-network/node-model").NodeModuleEventData> | undefined;
27
11
  initialize(): void;
28
12
  stop(): void;
29
13
  }
@@ -1 +1 @@
1
- {"version":3,"file":"OsPubSubNetworkStack.d.ts","sourceRoot":"","sources":["../../../src/stack/OsPubSubNetworkStack.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAA;AAE3D,OAAO,KAAK,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AAM3E,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAA;AAErC,qBAAa,oBAAqB,SAAQ,SAAS;IACjD,SAAS,CAAC,YAAY,EAAE,YAAY,GAAG,SAAS,CAAA;IAChD,SAAS,CAAC,iBAAiB,EAAE,YAAY,GAAG,SAAS,CAAA;IAErD,OAAO,CAAC,aAAa,CAA6D;gBAEtE,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,iBAAiB;IAI7D,IAAI,WAAW;;;;;;;;qIAEd;IAED,IAAI,gBAAgB;;;;;;;;qIAEnB;IAEQ,UAAU;IAgCV,IAAI;CAQd"}
1
+ {"version":3,"file":"OsPubSubNetworkStack.d.ts","sourceRoot":"","sources":["../../../src/stack/OsPubSubNetworkStack.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAA;AAE3D,OAAO,KAAK,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AAM3E,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAA;AAErC,qBAAa,oBAAqB,SAAQ,SAAS;IACjD,SAAS,CAAC,YAAY,EAAE,YAAY,GAAG,SAAS,CAAA;IAChD,SAAS,CAAC,iBAAiB,EAAE,YAAY,GAAG,SAAS,CAAA;IAErD,OAAO,CAAC,aAAa,CAA6D;gBAEtE,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,iBAAiB;IAI7D,IAAI,WAAW,qOAEd;IAED,IAAI,gBAAgB,qOAEnB;IAEQ,UAAU;IAgCV,IAAI;CAQd"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xyo-network/os-runtime",
3
- "version": "5.0.12",
3
+ "version": "6.0.0",
4
4
  "description": "Primary SDK for using XYO Protocol 2.0",
5
5
  "homepage": "https://xyo.network",
6
6
  "bugs": {
@@ -35,66 +35,64 @@
35
35
  "xyos": "./scripts/xyos.mjs"
36
36
  },
37
37
  "dependencies": {
38
- "@xylabs/array": "^4.9.18",
39
- "@xylabs/assert": "^4.9.18",
40
- "@xylabs/base": "^4.9.18",
41
- "@xylabs/events": "^4.9.18",
42
- "@xylabs/forget": "^4.9.18",
43
- "@xylabs/hex": "^4.9.18",
44
- "@xylabs/object": "^4.9.18",
45
- "@xylabs/promise": "^4.9.18",
46
- "@xyo-network/account-model": "^3.15.10",
47
- "@xyo-network/archivist": "^3.15.10",
48
- "@xyo-network/archivist-indexeddb": "^3.15.10",
49
- "@xyo-network/archivist-memory": "^3.15.10",
50
- "@xyo-network/archivist-model": "^3.15.10",
51
- "@xyo-network/bios": "^5.0.12",
52
- "@xyo-network/bridge-model": "^3.15.10",
53
- "@xyo-network/diviner-abstract": "^3.15.10",
54
- "@xyo-network/diviner-model": "^3.15.10",
55
- "@xyo-network/diviner-payload-generic": "^3.15.10",
56
- "@xyo-network/diviner-payload-indexeddb": "^3.15.10",
57
- "@xyo-network/diviner-payload-model": "^3.15.10",
58
- "@xyo-network/diviner-temporal-indexing-model": "^3.15.10",
59
- "@xyo-network/kernel": "^5.0.12",
60
- "@xyo-network/kernel-model": "^5.0.12",
61
- "@xyo-network/manifest": "^3.15.10",
62
- "@xyo-network/manifest-wrapper": "^3.15.10",
63
- "@xyo-network/module-event-emitter": "^3.15.10",
64
- "@xyo-network/module-events": "^3.15.10",
65
- "@xyo-network/module-factory-locator": "^3.15.10",
66
- "@xyo-network/module-model": "^3.15.10",
67
- "@xyo-network/module-resolver": "^3.15.10",
68
- "@xyo-network/node-model": "^3.15.10",
69
- "@xyo-network/os-model": "^5.0.12",
70
- "@xyo-network/payload-builder": "^3.15.10",
71
- "@xyo-network/payload-model": "^3.15.10",
72
- "@xyo-network/storage-model": "^5.0.12",
73
- "@xyo-network/wallet": "^3.15.10",
74
- "@xyo-network/wallet-model": "^3.15.10",
38
+ "@xylabs/array": "^4.12.31",
39
+ "@xylabs/assert": "^4.12.31",
40
+ "@xylabs/base": "^4.12.31",
41
+ "@xylabs/events": "^4.12.31",
42
+ "@xylabs/forget": "^4.12.31",
43
+ "@xylabs/hex": "^4.12.31",
44
+ "@xylabs/object": "^4.12.31",
45
+ "@xylabs/promise": "^4.12.31",
46
+ "@xyo-network/account-model": "^4.0.1",
47
+ "@xyo-network/archivist": "^4.0.1",
48
+ "@xyo-network/archivist-indexeddb": "^4.0.1",
49
+ "@xyo-network/archivist-memory": "^4.0.1",
50
+ "@xyo-network/archivist-model": "^4.0.1",
51
+ "@xyo-network/bios": "^6.0.0",
52
+ "@xyo-network/bridge-model": "^4.0.1",
53
+ "@xyo-network/diviner-abstract": "^4.0.1",
54
+ "@xyo-network/diviner-model": "^4.0.1",
55
+ "@xyo-network/diviner-payload-generic": "^4.0.1",
56
+ "@xyo-network/diviner-payload-indexeddb": "^4.0.1",
57
+ "@xyo-network/diviner-payload-model": "^4.0.1",
58
+ "@xyo-network/diviner-temporal-indexing-model": "^4.0.1",
59
+ "@xyo-network/kernel": "^6.0.0",
60
+ "@xyo-network/kernel-model": "^6.0.0",
61
+ "@xyo-network/manifest": "^4.0.1",
62
+ "@xyo-network/manifest-wrapper": "^4.0.1",
63
+ "@xyo-network/module-factory-locator": "^4.0.1",
64
+ "@xyo-network/module-model": "^4.0.1",
65
+ "@xyo-network/module-resolver": "^4.0.1",
66
+ "@xyo-network/node-model": "^4.0.1",
67
+ "@xyo-network/os-model": "^6.0.0",
68
+ "@xyo-network/payload-builder": "^4.0.1",
69
+ "@xyo-network/payload-model": "^4.0.1",
70
+ "@xyo-network/storage-model": "^6.0.0",
71
+ "@xyo-network/wallet": "^4.0.1",
72
+ "@xyo-network/wallet-model": "^4.0.1",
75
73
  "async-mutex": "^0.5.0",
76
- "ethers": "^6.14.0",
74
+ "chalk": "^5.4.1",
75
+ "cosmiconfig": "^9.0.0",
76
+ "cosmiconfig-typescript-loader": "^6.1.0",
77
+ "ethers": "^6.15.0",
77
78
  "semver": "^7.7.2",
78
- "uuid": "^11.1.0"
79
+ "terminal-kit": "^3.1.2",
80
+ "uuid": "^11.1.0",
81
+ "yargs": "^18.0.0"
79
82
  },
80
83
  "devDependencies": {
81
- "@types/node": "^22.15.18",
84
+ "@types/node": "^24.0.10",
82
85
  "@types/semver": "^7.7.0",
83
86
  "@types/terminal-kit": "^2.5.7",
84
87
  "@types/uuid": "^10.0.0",
85
88
  "@types/yargs": "^17.0.33",
86
- "@xylabs/ts-scripts-yarn3": "^6.5.6",
87
- "@xylabs/tsconfig": "^6.5.6",
88
- "@xyo-network/archivist-memory": "^3.15.10",
89
- "@xyo-network/bios-model": "^5.0.12",
90
- "@xyo-network/bios-nodejs": "^5.0.12",
91
- "chalk": "^5.4.1",
92
- "cosmiconfig": "^9.0.0",
93
- "cosmiconfig-typescript-loader": "^6.1.0",
94
- "terminal-kit": "^3.1.2",
89
+ "@xylabs/ts-scripts-yarn3": "^6.5.12",
90
+ "@xylabs/tsconfig": "^6.5.12",
91
+ "@xyo-network/archivist-memory": "^4.0.1",
92
+ "@xyo-network/bios-model": "^6.0.0",
93
+ "@xyo-network/bios-nodejs": "^6.0.0",
95
94
  "typescript": "^5.8.3",
96
- "vitest": "^3.1.3",
97
- "yargs": "^17.7.2"
95
+ "vitest": "^3.2.4"
98
96
  },
99
97
  "publishConfig": {
100
98
  "access": "public"
@@ -19,7 +19,7 @@ export class DappCallerBase {
19
19
  await this.context.root.resolve(DappArchivistModuleName),
20
20
  () => `${DappArchivistModuleName} not found [${toJsonString(this.context.root.publicChildren())}]`,
21
21
  )
22
- return asArchivistInstance(mod, () => `${DappArchivistModuleName} is not an archivist`)
22
+ return asArchivistInstance(mod, () => `${DappArchivistModuleName} is not an archivist`, { required: true })
23
23
  }
24
24
 
25
25
  /**
@@ -30,7 +30,7 @@ export class DappCallerBase {
30
30
  await this.context.root.resolve(DappArchivistPayloadDivinerModuleName),
31
31
  () => `${DappArchivistPayloadDivinerModuleName} not found`,
32
32
  )
33
- return asDivinerInstance(mod, () => `${DappArchivistPayloadDivinerModuleName} is not a diviner`)
33
+ return asDivinerInstance(mod, () => `${DappArchivistPayloadDivinerModuleName} is not a diviner`, { required: true })
34
34
  }
35
35
 
36
36
  /**
@@ -38,7 +38,7 @@ export class DappCallerBase {
38
38
  */
39
39
  async getDappIntentArchivist() {
40
40
  const mod = assertEx(await this.context.root.resolve(IntentArchivistModuleName), () => `${IntentArchivistModuleName} not found`)
41
- return asArchivistInstance(mod, () => `${IntentArchivistModuleName} is not an archivist`)
41
+ return asArchivistInstance(mod, () => `${IntentArchivistModuleName} is not an archivist`, { required: true })
42
42
  }
43
43
 
44
44
  // Get the IntentArchivistPayloadDiviner
@@ -47,6 +47,6 @@ export class DappCallerBase {
47
47
  await this.context.root.resolve(IntentArchivistPayloadDivinerModuleName),
48
48
  () => `${IntentArchivistPayloadDivinerModuleName} not found`,
49
49
  )
50
- return asDivinerInstance(mod, () => `${IntentArchivistPayloadDivinerModuleName} is not a diviner`)
50
+ return asDivinerInstance(mod, () => `${IntentArchivistPayloadDivinerModuleName} is not a diviner`, { required: true })
51
51
  }
52
52
  }
@@ -14,7 +14,7 @@ export class OsCallerBase {
14
14
  // Get the dapps archivist
15
15
  async getDappsArchivist() {
16
16
  const mod = assertEx(await this.context.root.resolve(DappsArchivistModuleName), () => `${DappsArchivistModuleName} not found`)
17
- return asArchivistInstance(mod, () => `${DappsArchivistModuleName} is not an archivist`)
17
+ return asArchivistInstance(mod, () => `${DappsArchivistModuleName} is not an archivist`, { required: true })
18
18
  }
19
19
 
20
20
  // Get the dapps archivist development
@@ -23,7 +23,7 @@ export class OsCallerBase {
23
23
  await this.context.root.resolve(DappsArchivistDevelopmentModuleName),
24
24
  () => `${DappsArchivistDevelopmentModuleName} not found`,
25
25
  )
26
- return asArchivistInstance(mod, () => `${DappsArchivistDevelopmentModuleName} is not an archivist`)
26
+ return asArchivistInstance(mod, () => `${DappsArchivistDevelopmentModuleName} is not an archivist`, { required: true })
27
27
  }
28
28
 
29
29
  // Get the dapps archivist payload diviner
@@ -32,7 +32,7 @@ export class OsCallerBase {
32
32
  await this.context.root.resolve(DappsArchivistPayloadDivinerModuleName),
33
33
  () => `${DappsArchivistPayloadDivinerModuleName} not found`,
34
34
  )
35
- return asDivinerInstance(mod, () => `${DappsArchivistPayloadDivinerModuleName} is not a diviner`)
35
+ return asDivinerInstance(mod, () => `${DappsArchivistPayloadDivinerModuleName} is not a diviner`, { required: true })
36
36
  }
37
37
 
38
38
  // Get the dapps archivist payload diviner development
@@ -41,7 +41,7 @@ export class OsCallerBase {
41
41
  await this.context.root.resolve(DappsArchivistPayloadDevelopmentDivinerModuleName),
42
42
  () => `${DappsArchivistPayloadDevelopmentDivinerModuleName} not found`,
43
43
  )
44
- return asDivinerInstance(mod, () => `${DappsArchivistPayloadDevelopmentDivinerModuleName} is not a diviner`)
44
+ return asDivinerInstance(mod, () => `${DappsArchivistPayloadDevelopmentDivinerModuleName} is not a diviner`, { required: true })
45
45
  }
46
46
 
47
47
  // Get the registered dapp interfaces archivist
@@ -50,6 +50,6 @@ export class OsCallerBase {
50
50
  await this.context.root.resolve(RegisteredDappInterfacesArchivistModuleName),
51
51
  () => `${RegisteredDappInterfacesArchivistModuleName} not found`,
52
52
  )
53
- return asArchivistInstance(mod, () => `${RegisteredDappInterfacesArchivistModuleName} is not an archivist`)
53
+ return asArchivistInstance(mod, () => `${RegisteredDappInterfacesArchivistModuleName} is not an archivist`, { required: true })
54
54
  }
55
55
  }
@@ -25,6 +25,6 @@ export class PubSubBridgeCaller {
25
25
 
26
26
  private async getPubSubBridge() {
27
27
  const mod = assertEx(await this.node.resolve(BridgedPubSubModuleName), () => `${BridgedPubSubModuleName} not found`)
28
- return asBridgeInstance(mod, () => `${BridgedPubSubModuleName} is not a bridge`)
28
+ return asBridgeInstance(mod, () => `${BridgedPubSubModuleName} is not a bridge`, { required: true })
29
29
  }
30
30
  }
package/src/XyOsBase.ts CHANGED
@@ -1,10 +1,10 @@
1
1
  import { assertEx } from '@xylabs/assert'
2
2
  import type { BaseParams } from '@xylabs/base'
3
+ import { BaseEmitter } from '@xylabs/events'
3
4
  import type { JsonObject } from '@xylabs/object'
4
5
  import type { Promisable } from '@xylabs/promise'
5
6
  import type { KernelExternal } from '@xyo-network/kernel-model'
6
7
  import type { PackageManifest } from '@xyo-network/manifest'
7
- import { ModuleBaseEmitter } from '@xyo-network/module-event-emitter'
8
8
  import { ModuleFactoryLocator } from '@xyo-network/module-factory-locator'
9
9
  import type { NodeInstance } from '@xyo-network/node-model'
10
10
  import type {
@@ -22,7 +22,7 @@ export interface XyOsContextParams<TManifest extends PackageManifest = PackageMa
22
22
  signerPaths?: WalletKindSignerPaths
23
23
  }
24
24
 
25
- export class XyOsContextBase<TParams extends XyOsContextParams | void = void> extends ModuleBaseEmitter<
25
+ export class XyOsContextBase<TParams extends XyOsContextParams | void = void> extends BaseEmitter<
26
26
  TParams extends XyOsContextParams ? TParams : XyOsContextParams
27
27
  > {
28
28
  protected _bootMutex = new Mutex()
@@ -55,7 +55,7 @@ export class DappAccessCaller extends OsCallerBase implements PostRegistrationHa
55
55
  private async cacheAccessNode(dappAccessor: RegisteredDappAccess, context: XyOsContext) {
56
56
  const accessNodeId = dappAccessor.rootModuleId
57
57
  const accessNodeModule = assertEx(await context.root.resolve(accessNodeId), () => 'Access Node Module not found')
58
- const accessNode = asNodeInstance(accessNodeModule, () => 'Access Node Module is not a NodeInstance')
58
+ const accessNode = asNodeInstance(accessNodeModule, () => 'Access Node Module is not a NodeInstance', { required: true })
59
59
 
60
60
  RunningDappAccessCache.set(dappAccessor.registeringDappId, accessNode)
61
61
  }
@@ -36,7 +36,7 @@ export class AccessNodeQueries {
36
36
  private async getArchivistFromDappNode() {
37
37
  const archivistPath = this.accessRequest?.destinationArchivist || 'DappArchivist'
38
38
  const mod = assertEx(await this.xyOsContext.root.resolve(archivistPath), () => `Unable to find archivist at ${archivistPath}`)
39
- return asArchivistInstance(mod, () => `Module at ${archivistPath} is not an archivist`)
39
+ return asArchivistInstance(mod, () => `Module at ${archivistPath} is not an archivist`, { required: true })
40
40
  }
41
41
 
42
42
  private async getPayloadsFromAccessNode() {
@@ -55,6 +55,6 @@ export class AccessNodeQueries {
55
55
  await this.nameServiceNamesAccessNode.resolve('PublicXnsArchivist'),
56
56
  () => 'Unable to find archivist at PublicXnsArchivist',
57
57
  )
58
- return asArchivistInstance(archivist, () => 'PublicXnsArchivist is not an archivist')
58
+ return asArchivistInstance(archivist, () => 'PublicXnsArchivist is not an archivist', { required: true })
59
59
  }
60
60
  }
@@ -15,7 +15,7 @@ export abstract class AbstractXnsCaller {
15
15
  async getXnsArchivist(pathPrefix?: string) {
16
16
  const fullyQualifiedPath = pathPrefix ? `${pathPrefix}:${XnsArchivistModuleName}` : XnsArchivistModuleName
17
17
  const mod = assertEx(await this.context.root.resolve(fullyQualifiedPath), () => `${fullyQualifiedPath} not found`)
18
- return asArchivistInstance(mod, () => `${fullyQualifiedPath} is not an archivist`)
18
+ return asArchivistInstance(mod, () => `${fullyQualifiedPath} is not an archivist`, { required: true })
19
19
  }
20
20
 
21
21
  /**
@@ -24,7 +24,7 @@ export abstract class AbstractXnsCaller {
24
24
  async getXnsArchivistPayloadDiviner(pathPrefix?: string) {
25
25
  const fullyQualifiedPath = pathPrefix ? `${pathPrefix}:${XnsArchivistPayloadDivinerModuleName}` : XnsArchivistPayloadDivinerModuleName
26
26
  const mod = assertEx(await this.context.root.resolve(fullyQualifiedPath), () => `${fullyQualifiedPath} not found`)
27
- return asDivinerInstance(mod, () => `${fullyQualifiedPath} is not an diviner`)
27
+ return asDivinerInstance(mod, () => `${fullyQualifiedPath} is not an diviner`, { required: true })
28
28
  }
29
29
 
30
30
  /**
@@ -33,6 +33,6 @@ export abstract class AbstractXnsCaller {
33
33
  async getXnsRegistrationsArchivist(pathPrefix?: string) {
34
34
  const fullyQualifiedPath = pathPrefix ? `${pathPrefix}:${XnsRegistrationsArchivistModuleName}` : XnsRegistrationsArchivistModuleName
35
35
  const mod = assertEx(await this.context.root.resolve(fullyQualifiedPath), () => `${fullyQualifiedPath} not found`)
36
- return asArchivistInstance(mod, () => `${fullyQualifiedPath} is not an archivist`)
36
+ return asArchivistInstance(mod, () => `${fullyQualifiedPath} is not an archivist`, { required: true })
37
37
  }
38
38
  }
@@ -1,10 +1,10 @@
1
1
  import { assertEx } from '@xylabs/assert'
2
2
  import type { BaseParams } from '@xylabs/base'
3
+ import { BaseEmitter } from '@xylabs/events'
3
4
  import { forget } from '@xylabs/forget'
4
5
  import type { ArchivistModuleEventData } from '@xyo-network/archivist'
5
6
  import { asArchivistInstance } from '@xyo-network/archivist'
6
7
  import type { KernelExternal } from '@xyo-network/kernel-model'
7
- import { ModuleBaseEmitter } from '@xyo-network/module-event-emitter'
8
8
  import { asAttachableNodeInstance } from '@xyo-network/node-model'
9
9
  import type { NodeAdapter, NodeAdapterBaseEvents } from '@xyo-network/os-model'
10
10
  import type { Payload } from '@xyo-network/payload-model'
@@ -16,7 +16,7 @@ type ModuleEventPayload = {
16
16
  schema: 'network.xyo.kernel.module.event'
17
17
  }
18
18
 
19
- export class NodeAdapterBase extends ModuleBaseEmitter<BaseParams, NodeAdapterBaseEvents> implements NodeAdapter {
19
+ export class NodeAdapterBase extends BaseEmitter<BaseParams, NodeAdapterBaseEvents> implements NodeAdapter {
20
20
  initialized = false
21
21
 
22
22
  private _id: string = ''
@@ -78,14 +78,14 @@ export class NodeAdapterBase extends ModuleBaseEmitter<BaseParams, NodeAdapterBa
78
78
 
79
79
  private async getEventsArchivist() {
80
80
  const mod = assertEx(await (await this.kernel.getNode()).resolve('KernelNode:ModuleEvents'), () => 'KernelNode:ModuleEvents not found')
81
- return asArchivistInstance(mod, () => `${mod.id} is not an archivist`)
81
+ return asArchivistInstance(mod, () => `${mod.id} is not an archivist`, { required: true })
82
82
  }
83
83
 
84
84
  private validateAndReturnDriver() {
85
85
  const mod = this.kernel.initialized[this.driverName]
86
86
  if (mod) {
87
87
  // confirm expected shape
88
- const node = asAttachableNodeInstance(mod, () => `${mod.id} is not a node`)
88
+ const node = asAttachableNodeInstance(mod, () => `${mod.id} is not a node`, { required: true })
89
89
 
90
90
  // set the initialized flag
91
91
  this.initialized = true
@@ -11,7 +11,7 @@ export class OsSettingsCallerBase {
11
11
 
12
12
  async getOsSettingsArchivist() {
13
13
  const mod = assertEx(await this.context.root.resolve(OsSettingsArchivistModuleName), () => `${OsSettingsArchivistModuleName} not found`)
14
- return asArchivistInstance(mod, () => `${OsSettingsArchivistModuleName} is not an archivist`)
14
+ return asArchivistInstance(mod, () => `${OsSettingsArchivistModuleName} is not an archivist`, { required: true })
15
15
  }
16
16
 
17
17
  async getOsSettingsPayloadDiviner() {
@@ -19,6 +19,6 @@ export class OsSettingsCallerBase {
19
19
  await this.context.root.resolve(OsSettingsArchivistPayloadDivinerModuleName),
20
20
  () => `${OsSettingsArchivistPayloadDivinerModuleName} not found`,
21
21
  )
22
- return asDivinerInstance(mod, () => `${OsSettingsArchivistPayloadDivinerModuleName} is not a diviner`)
22
+ return asDivinerInstance(mod, () => `${OsSettingsArchivistPayloadDivinerModuleName} is not a diviner`, { required: true })
23
23
  }
24
24
  }
@@ -14,7 +14,7 @@ const GenericPayloadDivinerTags = { 'network.xyo.generic.payload.diviner': 'Gene
14
14
 
15
15
  const resolveLocator = (existingLocator?: ModuleFactoryLocatorInstance): ModuleFactoryLocatorInstance => {
16
16
  const locator = existingLocator ?? new ModuleFactoryLocator()
17
- locator.register(GenericPayloadDiviner, GenericPayloadDivinerTags)
17
+ locator.register(GenericPayloadDiviner.factory(), GenericPayloadDivinerTags)
18
18
  return locator
19
19
  }
20
20
 
@@ -1,7 +1,7 @@
1
1
  import { assertEx } from '@xylabs/assert'
2
2
  import type { BaseParams } from '@xylabs/base'
3
3
  import type { EventData } from '@xylabs/events'
4
- import { ModuleBaseEmitter } from '@xyo-network/module-event-emitter'
4
+ import { BaseEmitter } from '@xylabs/events'
5
5
  import type {
6
6
  EventBusConnectionInterface, EventBusConnectionRequest, EventBusConnectionType,
7
7
  } from '@xyo-network/os-model'
@@ -11,7 +11,7 @@ import type {
11
11
  * @param {EventBusConnectionRequest} request
12
12
  */
13
13
  export class EventBusConnection<TEventData extends EventData = EventData>
14
- extends ModuleBaseEmitter<BaseParams, TEventData>
14
+ extends BaseEmitter<BaseParams, TEventData>
15
15
  implements EventBusConnectionInterface<TEventData> {
16
16
  _id?: string
17
17
  description?: string
@@ -44,6 +44,7 @@ export class EventBus implements EventBusInterface {
44
44
  return asArchivistInstance(
45
45
  assertEx(this._archivist, () => 'Archivist not found. Did you forget to call start()?'),
46
46
  'not a valid archivist instance',
47
+ { required: true },
47
48
  )
48
49
  }
49
50
 
package/src/loadOsNode.ts CHANGED
@@ -14,8 +14,8 @@ const OS_NODE_PATH = "1'"
14
14
 
15
15
  const getDefaultOsNodeLocator = (): ModuleFactoryLocator => {
16
16
  const locator = new ModuleFactoryLocator()
17
- locator.register(IndexedDbArchivist, { 'network.xyo.archivist.persistence.scope': 'device' })
18
- locator.register(IndexedDbPayloadDiviner, { 'network.xyo.archivist.persistence.scope': 'device' })
17
+ locator.register(IndexedDbArchivist.factory(), { 'network.xyo.archivist.persistence.scope': 'device' })
18
+ locator.register(IndexedDbPayloadDiviner.factory(), { 'network.xyo.archivist.persistence.scope': 'device' })
19
19
  return locator
20
20
  }
21
21
 
package/src/stack/Base.ts CHANGED
@@ -1,8 +1,8 @@
1
1
  import { assertEx } from '@xylabs/assert'
2
2
  import type { BaseParams } from '@xylabs/base'
3
+ import { BaseEmitter } from '@xylabs/events'
3
4
  import { forget } from '@xylabs/forget'
4
5
  import type { Promisable } from '@xylabs/promise'
5
- import { ModuleBaseEmitter } from '@xyo-network/module-event-emitter'
6
6
  import type { ModuleIdentifier } from '@xyo-network/module-model'
7
7
  import { isModuleInstance } from '@xyo-network/module-model'
8
8
  import type { AttachableNodeInstance } from '@xyo-network/node-model'
@@ -16,7 +16,7 @@ import type {
16
16
  *
17
17
  * Listens for changes in adapter connections, update the stack node, and emits events when the stack is ready
18
18
  */
19
- export class StackBase extends ModuleBaseEmitter<BaseParams, StackBaseEvents> implements StackInitializer {
19
+ export class StackBase extends BaseEmitter<BaseParams, StackBaseEvents> implements StackInitializer {
20
20
  // flag to check that all adapters are initialized
21
21
  initialized = false
22
22
 
@@ -134,7 +134,7 @@ export class StackBase extends ModuleBaseEmitter<BaseParams, StackBaseEvents> im
134
134
 
135
135
  private async getStackNode() {
136
136
  const mod = assertEx(await this.context.root.resolve(this.stackNodeModuleId), () => `${this.stackNodeModuleId} not found`)
137
- return asAttachableNodeInstance(mod, () => `${this.stackNodeModuleId} not a NodeInstance`)
137
+ return asAttachableNodeInstance(mod, () => `${this.stackNodeModuleId} not a NodeInstance`, { required: true })
138
138
  }
139
139
 
140
140
  private async handleDriverReady(node: AttachableNodeInstance) {