@garydevenay/emporion 0.0.1

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 (102) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +173 -0
  3. package/dist/src/cli.d.ts +7 -0
  4. package/dist/src/cli.js +2101 -0
  5. package/dist/src/cli.js.map +1 -0
  6. package/dist/src/config.d.ts +2 -0
  7. package/dist/src/config.js +41 -0
  8. package/dist/src/config.js.map +1 -0
  9. package/dist/src/demo.d.ts +1 -0
  10. package/dist/src/demo.js +140 -0
  11. package/dist/src/demo.js.map +1 -0
  12. package/dist/src/did.d.ts +13 -0
  13. package/dist/src/did.js +155 -0
  14. package/dist/src/did.js.map +1 -0
  15. package/dist/src/errors.d.ts +23 -0
  16. package/dist/src/errors.js +25 -0
  17. package/dist/src/errors.js.map +1 -0
  18. package/dist/src/handshake.d.ts +9 -0
  19. package/dist/src/handshake.js +131 -0
  20. package/dist/src/handshake.js.map +1 -0
  21. package/dist/src/identity.d.ts +17 -0
  22. package/dist/src/identity.js +105 -0
  23. package/dist/src/identity.js.map +1 -0
  24. package/dist/src/index.d.ts +5 -0
  25. package/dist/src/index.js +5 -0
  26. package/dist/src/index.js.map +1 -0
  27. package/dist/src/logger.d.ts +11 -0
  28. package/dist/src/logger.js +41 -0
  29. package/dist/src/logger.js.map +1 -0
  30. package/dist/src/persistent-agent.d.ts +2 -0
  31. package/dist/src/persistent-agent.js +24 -0
  32. package/dist/src/persistent-agent.js.map +1 -0
  33. package/dist/src/protocol/company.d.ts +36 -0
  34. package/dist/src/protocol/company.js +211 -0
  35. package/dist/src/protocol/company.js.map +1 -0
  36. package/dist/src/protocol/contracts.d.ts +119 -0
  37. package/dist/src/protocol/contracts.js +404 -0
  38. package/dist/src/protocol/contracts.js.map +1 -0
  39. package/dist/src/protocol/credential-reference.d.ts +71 -0
  40. package/dist/src/protocol/credential-reference.js +136 -0
  41. package/dist/src/protocol/credential-reference.js.map +1 -0
  42. package/dist/src/protocol/dissemination.d.ts +47 -0
  43. package/dist/src/protocol/dissemination.js +111 -0
  44. package/dist/src/protocol/dissemination.js.map +1 -0
  45. package/dist/src/protocol/envelope.d.ts +71 -0
  46. package/dist/src/protocol/envelope.js +203 -0
  47. package/dist/src/protocol/envelope.js.map +1 -0
  48. package/dist/src/protocol/identity.d.ts +18 -0
  49. package/dist/src/protocol/identity.js +143 -0
  50. package/dist/src/protocol/identity.js.map +1 -0
  51. package/dist/src/protocol/index.d.ts +22 -0
  52. package/dist/src/protocol/index.js +12 -0
  53. package/dist/src/protocol/index.js.map +1 -0
  54. package/dist/src/protocol/market.d.ts +96 -0
  55. package/dist/src/protocol/market.js +293 -0
  56. package/dist/src/protocol/market.js.map +1 -0
  57. package/dist/src/protocol/messaging.d.ts +87 -0
  58. package/dist/src/protocol/messaging.js +296 -0
  59. package/dist/src/protocol/messaging.js.map +1 -0
  60. package/dist/src/protocol/repository.d.ts +87 -0
  61. package/dist/src/protocol/repository.js +651 -0
  62. package/dist/src/protocol/repository.js.map +1 -0
  63. package/dist/src/protocol/resolution.d.ts +86 -0
  64. package/dist/src/protocol/resolution.js +305 -0
  65. package/dist/src/protocol/resolution.js.map +1 -0
  66. package/dist/src/protocol/shared.d.ts +14 -0
  67. package/dist/src/protocol/shared.js +45 -0
  68. package/dist/src/protocol/shared.js.map +1 -0
  69. package/dist/src/protocol/versioning.d.ts +21 -0
  70. package/dist/src/protocol/versioning.js +69 -0
  71. package/dist/src/protocol/versioning.js.map +1 -0
  72. package/dist/src/storage.d.ts +36 -0
  73. package/dist/src/storage.js +156 -0
  74. package/dist/src/storage.js.map +1 -0
  75. package/dist/src/topics.d.ts +3 -0
  76. package/dist/src/topics.js +27 -0
  77. package/dist/src/topics.js.map +1 -0
  78. package/dist/src/transport.d.ts +114 -0
  79. package/dist/src/transport.js +291 -0
  80. package/dist/src/transport.js.map +1 -0
  81. package/dist/src/types.d.ts +95 -0
  82. package/dist/src/types.js +2 -0
  83. package/dist/src/types.js.map +1 -0
  84. package/dist/test/cli.test.d.ts +1 -0
  85. package/dist/test/cli.test.js +122 -0
  86. package/dist/test/cli.test.js.map +1 -0
  87. package/dist/test/economy.test.d.ts +1 -0
  88. package/dist/test/economy.test.js +661 -0
  89. package/dist/test/economy.test.js.map +1 -0
  90. package/dist/test/helpers.d.ts +12 -0
  91. package/dist/test/helpers.js +57 -0
  92. package/dist/test/helpers.js.map +1 -0
  93. package/dist/test/integration.test.d.ts +1 -0
  94. package/dist/test/integration.test.js +287 -0
  95. package/dist/test/integration.test.js.map +1 -0
  96. package/dist/test/protocol.test.d.ts +1 -0
  97. package/dist/test/protocol.test.js +448 -0
  98. package/dist/test/protocol.test.js.map +1 -0
  99. package/dist/test/unit.test.d.ts +1 -0
  100. package/dist/test/unit.test.js +87 -0
  101. package/dist/test/unit.test.js.map +1 -0
  102. package/package.json +60 -0
@@ -0,0 +1,36 @@
1
+ import Hyperbee from "hyperbee";
2
+ import Hypercore from "hypercore";
3
+ import type { Logger } from "./logger.js";
4
+ import type { ReplicationDescriptor } from "./types.js";
5
+ type JsonValue = null | boolean | number | string | JsonValue[] | {
6
+ [key: string]: JsonValue;
7
+ };
8
+ export declare class TransportStorage {
9
+ private readonly store;
10
+ private readonly logger;
11
+ private readonly feedNamespace;
12
+ private readonly indexNamespace;
13
+ private readonly localDescriptors;
14
+ private readonly feeds;
15
+ private readonly indexes;
16
+ private readonly remoteFeeds;
17
+ private readonly remoteIndexes;
18
+ private constructor();
19
+ static create(dataDir: string, primaryKey: Buffer, logger: Logger): Promise<TransportStorage>;
20
+ initializeDefaults(): Promise<{
21
+ controlFeed: Hypercore<JsonValue>;
22
+ eventsFeed: Hypercore<JsonValue>;
23
+ controlDescriptor: ReplicationDescriptor;
24
+ eventsDescriptor: ReplicationDescriptor;
25
+ }>;
26
+ openFeed(name: string): Promise<Hypercore<JsonValue>>;
27
+ openIndex(name: string): Promise<Hyperbee<string, JsonValue>>;
28
+ getReplicationDescriptors(): ReplicationDescriptor[];
29
+ getLocalFeedKey(name: string): string;
30
+ trackRemoteDescriptors(descriptors: ReplicationDescriptor[]): Promise<void>;
31
+ getRemoteFeed(key: string): Hypercore<JsonValue> | undefined;
32
+ replicate(connection: NodeJS.ReadWriteStream): NodeJS.ReadWriteStream;
33
+ close(): Promise<void>;
34
+ private mustGetLocalDescriptor;
35
+ }
36
+ export {};
@@ -0,0 +1,156 @@
1
+ import { mkdir } from "node:fs/promises";
2
+ import path from "node:path";
3
+ import Corestore from "corestore";
4
+ import Hyperbee from "hyperbee";
5
+ import { StorageError } from "./errors.js";
6
+ function isNonEmptyString(value, fieldName) {
7
+ const trimmed = value.trim();
8
+ if (trimmed.length === 0) {
9
+ throw new StorageError(`${fieldName} must not be blank`);
10
+ }
11
+ return trimmed;
12
+ }
13
+ export class TransportStorage {
14
+ store;
15
+ logger;
16
+ feedNamespace;
17
+ indexNamespace;
18
+ localDescriptors = new Map();
19
+ feeds = new Map();
20
+ indexes = new Map();
21
+ remoteFeeds = new Map();
22
+ remoteIndexes = new Map();
23
+ constructor(store, logger) {
24
+ this.store = store;
25
+ this.logger = logger;
26
+ this.feedNamespace = store.namespace("feeds");
27
+ this.indexNamespace = store.namespace("indexes");
28
+ }
29
+ static async create(dataDir, primaryKey, logger) {
30
+ const storageDir = path.join(dataDir, "store");
31
+ await mkdir(storageDir, { recursive: true });
32
+ // We intentionally derive the store primary key from the persisted agent root seed
33
+ // so named cores remain stable across restarts.
34
+ const store = new Corestore(storageDir, { primaryKey, unsafe: true });
35
+ await store.ready();
36
+ return new TransportStorage(store, logger);
37
+ }
38
+ async initializeDefaults() {
39
+ const controlFeed = await this.openFeed("control");
40
+ const eventsFeed = await this.openFeed("events");
41
+ return {
42
+ controlFeed,
43
+ eventsFeed,
44
+ controlDescriptor: this.mustGetLocalDescriptor("control"),
45
+ eventsDescriptor: this.mustGetLocalDescriptor("events")
46
+ };
47
+ }
48
+ async openFeed(name) {
49
+ const normalizedName = isNonEmptyString(name, "Feed name");
50
+ const existing = this.feeds.get(normalizedName);
51
+ if (existing) {
52
+ return existing.core;
53
+ }
54
+ const core = this.feedNamespace.get({
55
+ name: normalizedName,
56
+ valueEncoding: "json"
57
+ });
58
+ await core.ready();
59
+ const descriptor = {
60
+ name: normalizedName,
61
+ key: core.key.toString("hex"),
62
+ kind: "feed"
63
+ };
64
+ this.localDescriptors.set(normalizedName, descriptor);
65
+ this.feeds.set(normalizedName, { core, descriptor });
66
+ this.logger.debug("Opened local feed", { ...descriptor });
67
+ return core;
68
+ }
69
+ async openIndex(name) {
70
+ const normalizedName = isNonEmptyString(name, "Index name");
71
+ const existing = this.indexes.get(normalizedName);
72
+ if (existing) {
73
+ return existing.bee;
74
+ }
75
+ const core = this.indexNamespace.get({
76
+ name: normalizedName
77
+ });
78
+ await core.ready();
79
+ const bee = new Hyperbee(core, {
80
+ keyEncoding: "utf-8",
81
+ valueEncoding: "json"
82
+ });
83
+ await bee.ready();
84
+ const descriptor = {
85
+ name: normalizedName,
86
+ key: core.key.toString("hex"),
87
+ kind: "index"
88
+ };
89
+ this.localDescriptors.set(normalizedName, descriptor);
90
+ this.indexes.set(normalizedName, { bee, descriptor });
91
+ this.logger.debug("Opened local index", { ...descriptor });
92
+ return bee;
93
+ }
94
+ getReplicationDescriptors() {
95
+ return [...this.localDescriptors.values()].sort((left, right) => left.name.localeCompare(right.name));
96
+ }
97
+ getLocalFeedKey(name) {
98
+ return this.mustGetLocalDescriptor(name).key;
99
+ }
100
+ async trackRemoteDescriptors(descriptors) {
101
+ for (const descriptor of descriptors) {
102
+ if (descriptor.kind === "feed") {
103
+ if (this.remoteFeeds.has(descriptor.key)) {
104
+ continue;
105
+ }
106
+ const core = this.store.get({
107
+ key: Buffer.from(descriptor.key, "hex"),
108
+ valueEncoding: "json"
109
+ });
110
+ await core.ready();
111
+ const liveDownload = core.download({ start: 0, end: -1, linear: true });
112
+ this.remoteFeeds.set(descriptor.key, { core, liveDownload });
113
+ this.logger.debug("Tracked remote feed", { ...descriptor });
114
+ continue;
115
+ }
116
+ if (this.remoteIndexes.has(descriptor.key)) {
117
+ continue;
118
+ }
119
+ const core = this.store.get({
120
+ key: Buffer.from(descriptor.key, "hex")
121
+ });
122
+ await core.ready();
123
+ const bee = new Hyperbee(core, {
124
+ keyEncoding: "utf-8",
125
+ valueEncoding: "json"
126
+ });
127
+ await bee.ready();
128
+ const liveDownload = core.download({ start: 0, end: -1, linear: true });
129
+ this.remoteIndexes.set(descriptor.key, { bee, liveDownload });
130
+ this.logger.debug("Tracked remote index", { ...descriptor });
131
+ }
132
+ }
133
+ getRemoteFeed(key) {
134
+ return this.remoteFeeds.get(key)?.core;
135
+ }
136
+ replicate(connection) {
137
+ return this.store.replicate(connection);
138
+ }
139
+ async close() {
140
+ for (const record of this.remoteFeeds.values()) {
141
+ record.liveDownload.destroy();
142
+ }
143
+ for (const record of this.remoteIndexes.values()) {
144
+ record.liveDownload.destroy();
145
+ }
146
+ await this.store.close();
147
+ }
148
+ mustGetLocalDescriptor(name) {
149
+ const descriptor = this.localDescriptors.get(name);
150
+ if (!descriptor) {
151
+ throw new StorageError(`Local descriptor not found for ${name}`);
152
+ }
153
+ return descriptor;
154
+ }
155
+ }
156
+ //# sourceMappingURL=storage.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"storage.js","sourceRoot":"","sources":["../../src/storage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACzC,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,SAAS,MAAM,WAAW,CAAC;AAClC,OAAO,QAAQ,MAAM,UAAU,CAAC;AAGhC,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AA8B3C,SAAS,gBAAgB,CAAC,KAAa,EAAE,SAAiB;IACxD,MAAM,OAAO,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC;IAC7B,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACzB,MAAM,IA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,IAAI,CAAC,CAAC;QACnD,IAAI,CAAC,UAAU,EAAE,CAAC;YAChB,MAAM,IAAI,YAAY,CAAC,kCAAkC,IAAI,EAAE,CAAC,CAAC;QACnE,CAAC;QAED,OAAO,UAAU,CAAC;IACpB,CAAC;CACF"}
@@ -0,0 +1,3 @@
1
+ import type { TopicRef } from "./types.js";
2
+ export declare function topicRefToCanonicalString(ref: TopicRef): string;
3
+ export declare function topicRefToDiscoveryKey(ref: TopicRef): Buffer;
@@ -0,0 +1,27 @@
1
+ import { createHash } from "node:crypto";
2
+ import { TopicValidationError } from "./errors.js";
3
+ function assertIdentifier(value, fieldName) {
4
+ const trimmed = value.trim();
5
+ if (trimmed.length === 0) {
6
+ throw new TopicValidationError(`${fieldName} must not be blank`);
7
+ }
8
+ if (!/^[a-zA-Z0-9:._-]+$/.test(trimmed)) {
9
+ throw new TopicValidationError(`${fieldName} contains unsupported characters`);
10
+ }
11
+ return trimmed;
12
+ }
13
+ export function topicRefToCanonicalString(ref) {
14
+ switch (ref.kind) {
15
+ case "agent":
16
+ return `agent:${assertIdentifier(ref.agentDid, "TopicRef.agentDid")}`;
17
+ case "company":
18
+ return `company:${assertIdentifier(ref.companyId, "TopicRef.companyId")}`;
19
+ case "marketplace":
20
+ return `marketplace:${assertIdentifier(ref.marketplaceId, "TopicRef.marketplaceId")}`;
21
+ }
22
+ }
23
+ export function topicRefToDiscoveryKey(ref) {
24
+ const canonical = topicRefToCanonicalString(ref);
25
+ return createHash("sha256").update(`emporion-topic:${canonical}`, "utf8").digest();
26
+ }
27
+ //# sourceMappingURL=topics.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"topics.js","sourceRoot":"","sources":["../../src/topics.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEzC,OAAO,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAGnD,SAAS,gBAAgB,CAAC,KAAa,EAAE,SAAiB;IACxD,MAAM,OAAO,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC;IAC7B,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACzB,MAAM,IAAI,oBAAoB,CAAC,GAAG,SAAS,oBAAoB,CAAC,CAAC;IACnE,CAAC;IAED,IAAI,CAAC,oBAAoB,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC;QACxC,MAAM,IAAI,oBAAoB,CAAC,GAAG,SAAS,kCAAkC,CAAC,CAAC;IACjF,CAAC;IAED,OAAO,OAAO,CAAC;AACjB,CAAC;AAED,MAAM,UAAU,yBAAyB,CAAC,GAAa;IACrD,QAAQ,GAAG,CAAC,IAAI,EAAE,CAAC;QACjB,KAAK,OAAO;YACV,OAAO,SAAS,gBAAgB,CAAC,GAAG,CAAC,QAAQ,EAAE,mBAAmB,CAAC,EAAE,CAAC;QACxE,KAAK,SAAS;YACZ,OAAO,WAAW,gBAAgB,CAAC,GAAG,CAAC,SAAS,EAAE,oBAAoB,CAAC,EAAE,CAAC;QAC5E,KAAK,aAAa;YAChB,OAAO,eAAe,gBAAgB,CAAC,GAAG,CAAC,aAAa,EAAE,wBAAwB,CAAC,EAAE,CAAC;IAC1F,CAAC;AACH,CAAC;AAED,MAAM,UAAU,sBAAsB,CAAC,GAAa;IAClD,MAAM,SAAS,GAAG,yBAAyB,CAAC,GAAG,CAAC,CAAC;IACjD,OAAO,UAAU,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,kBAAkB,SAAS,EAAE,EAAE,MAAM,CAAC,CAAC,MAAM,EAAE,CAAC;AACrF,CAAC"}
@@ -0,0 +1,114 @@
1
+ import type { AgentIdentity, PeerHello, ReplicationDescriptor, TopicJoinOptions, TopicRef, TransportConfig } from "./types.js";
2
+ export interface PeerSession {
3
+ remoteDid: string;
4
+ remoteNoisePublicKey: string;
5
+ remoteControlFeedKey: string;
6
+ source: string;
7
+ supportedProtocols: PeerHello["supportedProtocols"];
8
+ replication: ReplicationDescriptor[];
9
+ }
10
+ export declare class AgentTransport {
11
+ static create(config: TransportConfig): Promise<AgentTransport>;
12
+ readonly identity: AgentIdentity;
13
+ private readonly logger;
14
+ private readonly storage;
15
+ private readonly identityMaterial;
16
+ private readonly dht;
17
+ private readonly swarm;
18
+ private readonly config;
19
+ private readonly joinedTopics;
20
+ private readonly activeSockets;
21
+ private readonly activePeerSessions;
22
+ private started;
23
+ private stopping;
24
+ private destroyed;
25
+ private constructor();
26
+ start(): Promise<void>;
27
+ stop(): Promise<void>;
28
+ suspend(): Promise<void>;
29
+ resume(): Promise<void>;
30
+ joinTopic(ref: TopicRef, options?: TopicJoinOptions): Promise<void>;
31
+ leaveTopic(ref: TopicRef): Promise<void>;
32
+ connectToDid(did: string): Promise<void>;
33
+ connectToNoiseKey(publicKeyHex: string): Promise<void>;
34
+ openFeed(name: string): Promise<import("hypercore").default<string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | /*elided*/ any | {
35
+ [key: string]: string | number | boolean | /*elided*/ any | /*elided*/ any | null;
36
+ } | null)[] | {
37
+ [key: string]: string | number | boolean | (string | number | boolean | /*elided*/ any | /*elided*/ any | null)[] | /*elided*/ any | null;
38
+ } | null)[] | {
39
+ [key: string]: string | number | boolean | (string | number | boolean | (string | number | boolean | /*elided*/ any | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null;
40
+ } | null)[] | {
41
+ [key: string]: string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | /*elided*/ any | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null;
42
+ } | null)[] | {
43
+ [key: string]: string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | /*elided*/ any | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null;
44
+ } | null)[] | {
45
+ [key: string]: string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | /*elided*/ any | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null;
46
+ } | null)[] | {
47
+ [key: string]: string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | /*elided*/ any | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null;
48
+ } | null)[] | {
49
+ [key: string]: string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | /*elided*/ any | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null;
50
+ } | null)[] | {
51
+ [key: string]: string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | /*elided*/ any | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null;
52
+ } | null)[] | {
53
+ [key: string]: string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | /*elided*/ any | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null;
54
+ } | null)[] | {
55
+ [key: string]: string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | /*elided*/ any | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null;
56
+ } | null)[] | {
57
+ [key: string]: string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | /*elided*/ any | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null;
58
+ } | null>>;
59
+ openIndex(name: string): Promise<import("hyperbee").default<string, string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | /*elided*/ any | {
60
+ [key: string]: string | number | boolean | /*elided*/ any | /*elided*/ any | null;
61
+ } | null)[] | {
62
+ [key: string]: string | number | boolean | (string | number | boolean | /*elided*/ any | /*elided*/ any | null)[] | /*elided*/ any | null;
63
+ } | null)[] | {
64
+ [key: string]: string | number | boolean | (string | number | boolean | (string | number | boolean | /*elided*/ any | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null;
65
+ } | null)[] | {
66
+ [key: string]: string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | /*elided*/ any | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null;
67
+ } | null)[] | {
68
+ [key: string]: string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | /*elided*/ any | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null;
69
+ } | null)[] | {
70
+ [key: string]: string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | /*elided*/ any | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null;
71
+ } | null)[] | {
72
+ [key: string]: string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | /*elided*/ any | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null;
73
+ } | null)[] | {
74
+ [key: string]: string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | /*elided*/ any | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null;
75
+ } | null)[] | {
76
+ [key: string]: string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | /*elided*/ any | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null;
77
+ } | null)[] | {
78
+ [key: string]: string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | /*elided*/ any | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null;
79
+ } | null)[] | {
80
+ [key: string]: string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | /*elided*/ any | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null;
81
+ } | null)[] | {
82
+ [key: string]: string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | /*elided*/ any | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null;
83
+ } | null>>;
84
+ getPeerSessions(): ReadonlyMap<string, PeerSession>;
85
+ getRemoteFeed(key: string): import("hypercore").default<string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | /*elided*/ any | {
86
+ [key: string]: string | number | boolean | /*elided*/ any | /*elided*/ any | null;
87
+ } | null)[] | {
88
+ [key: string]: string | number | boolean | (string | number | boolean | /*elided*/ any | /*elided*/ any | null)[] | /*elided*/ any | null;
89
+ } | null)[] | {
90
+ [key: string]: string | number | boolean | (string | number | boolean | (string | number | boolean | /*elided*/ any | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null;
91
+ } | null)[] | {
92
+ [key: string]: string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | /*elided*/ any | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null;
93
+ } | null)[] | {
94
+ [key: string]: string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | /*elided*/ any | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null;
95
+ } | null)[] | {
96
+ [key: string]: string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | /*elided*/ any | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null;
97
+ } | null)[] | {
98
+ [key: string]: string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | /*elided*/ any | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null;
99
+ } | null)[] | {
100
+ [key: string]: string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | /*elided*/ any | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null;
101
+ } | null)[] | {
102
+ [key: string]: string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | /*elided*/ any | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null;
103
+ } | null)[] | {
104
+ [key: string]: string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | /*elided*/ any | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null;
105
+ } | null)[] | {
106
+ [key: string]: string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | /*elided*/ any | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null;
107
+ } | null)[] | {
108
+ [key: string]: string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | /*elided*/ any | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null;
109
+ } | null> | undefined;
110
+ private handleSocket;
111
+ private buildLocalHello;
112
+ private validateRemoteHello;
113
+ private ensureStarted;
114
+ }