open-agents-nexus 0.1.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.
- package/ARCHITECTURE.md +2104 -0
- package/LICENSE +28 -0
- package/README.md +198 -0
- package/dist/chat/index.d.ts +24 -0
- package/dist/chat/index.js +56 -0
- package/dist/chat/index.js.map +1 -0
- package/dist/chat/messages.d.ts +28 -0
- package/dist/chat/messages.js +33 -0
- package/dist/chat/messages.js.map +1 -0
- package/dist/chat/room.d.ts +49 -0
- package/dist/chat/room.js +123 -0
- package/dist/chat/room.js.map +1 -0
- package/dist/cli.d.ts +8 -0
- package/dist/cli.js +222 -0
- package/dist/cli.js.map +1 -0
- package/dist/config.d.ts +22 -0
- package/dist/config.js +19 -0
- package/dist/config.js.map +1 -0
- package/dist/dht/index.d.ts +16 -0
- package/dist/dht/index.js +33 -0
- package/dist/dht/index.js.map +1 -0
- package/dist/dht/registry.d.ts +24 -0
- package/dist/dht/registry.js +103 -0
- package/dist/dht/registry.js.map +1 -0
- package/dist/discovery.d.ts +43 -0
- package/dist/discovery.js +70 -0
- package/dist/discovery.js.map +1 -0
- package/dist/identity/index.d.ts +34 -0
- package/dist/identity/index.js +46 -0
- package/dist/identity/index.js.map +1 -0
- package/dist/identity/keys.d.ts +26 -0
- package/dist/identity/keys.js +49 -0
- package/dist/identity/keys.js.map +1 -0
- package/dist/index.d.ts +83 -0
- package/dist/index.js +299 -0
- package/dist/index.js.map +1 -0
- package/dist/logger.d.ts +8 -0
- package/dist/logger.js +32 -0
- package/dist/logger.js.map +1 -0
- package/dist/node.d.ts +47 -0
- package/dist/node.js +136 -0
- package/dist/node.js.map +1 -0
- package/dist/protocol/index.d.ts +11 -0
- package/dist/protocol/index.js +66 -0
- package/dist/protocol/index.js.map +1 -0
- package/dist/protocol/types.d.ts +197 -0
- package/dist/protocol/types.js +18 -0
- package/dist/protocol/types.js.map +1 -0
- package/dist/signaling/onboarding.d.ts +10 -0
- package/dist/signaling/onboarding.js +40 -0
- package/dist/signaling/onboarding.js.map +1 -0
- package/dist/signaling/server.d.ts +35 -0
- package/dist/signaling/server.js +140 -0
- package/dist/signaling/server.js.map +1 -0
- package/dist/storage/index.d.ts +31 -0
- package/dist/storage/index.js +103 -0
- package/dist/storage/index.js.map +1 -0
- package/dist/storage/mirror.d.ts +9 -0
- package/dist/storage/mirror.js +24 -0
- package/dist/storage/mirror.js.map +1 -0
- package/dist/storage/pin.d.ts +8 -0
- package/dist/storage/pin.js +42 -0
- package/dist/storage/pin.js.map +1 -0
- package/dist/storage/propagation.d.ts +32 -0
- package/dist/storage/propagation.js +89 -0
- package/dist/storage/propagation.js.map +1 -0
- package/package.json +122 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"server.js","sourceRoot":"","sources":["../../src/signaling/server.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,YAAY,EAA0D,MAAM,WAAW,CAAC;AACjG,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAG5C,MAAM,GAAG,GAAG,YAAY,CAAC,WAAW,CAAC,CAAC;AAOtC,MAAM,OAAO,eAAe;IAClB,MAAM,GAAkB,IAAI,CAAC;IAC7B,IAAI,CAAS;IACb,IAAI,CAAS;IAErB,8CAA8C;IACtC,cAAc,GAAa,EAAE,CAAC;IAC9B,UAAU,GAAe,EAAE,CAAC;IAC5B,SAAS,GAAG,CAAC,CAAC;IACd,SAAS,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;IAE/B,YAAY,OAA+B;QACzC,IAAI,CAAC,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;QACzB,IAAI,CAAC,IAAI,GAAG,OAAO,CAAC,IAAI,IAAI,SAAS,CAAC;IACxC,CAAC;IAED,KAAK,CAAC,KAAK;QACT,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;YACrC,IAAI,CAAC,MAAM,GAAG,YAAY,CAAC,CA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SAAS,CAAC,IAAI,CAAC,CAAC,CAAC;IAChC,CAAC;IAEO,OAAO,CAAC,GAAmB;QACjC,GAAG,CAAC,SAAS,CAAC,GAAG,EAAE,EAAE,cAAc,EAAE,kBAAkB,EAAE,CAAC,CAAC;QAC3D,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,KAAK,EAAE,WAAW,EAAE,CAAC,CAAC,CAAC;IAClD,CAAC;CACF"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* IPFS/Helia storage layer
|
|
3
|
+
*
|
|
4
|
+
* Provides content-addressed storage using Helia (IPFS in JS).
|
|
5
|
+
* Supports storing and retrieving files, JSON, strings, and DAG structures.
|
|
6
|
+
*/
|
|
7
|
+
import { PinManager } from './pin.js';
|
|
8
|
+
import { MirrorManager } from './mirror.js';
|
|
9
|
+
import { ContentPropagation } from './propagation.js';
|
|
10
|
+
export declare class StorageManager {
|
|
11
|
+
private helia;
|
|
12
|
+
private jsonStore;
|
|
13
|
+
private stringStore;
|
|
14
|
+
private dagJsonStore;
|
|
15
|
+
readonly pins: PinManager;
|
|
16
|
+
readonly mirrors: MirrorManager;
|
|
17
|
+
readonly propagation: ContentPropagation;
|
|
18
|
+
constructor();
|
|
19
|
+
start(libp2pNode: any): Promise<void>;
|
|
20
|
+
stop(): Promise<void>;
|
|
21
|
+
storeJSON(data: unknown): Promise<string>;
|
|
22
|
+
retrieveJSON(cidString: string): Promise<unknown>;
|
|
23
|
+
storeString(data: string): Promise<string>;
|
|
24
|
+
retrieveString(cidString: string): Promise<string>;
|
|
25
|
+
storeDAG(data: unknown): Promise<string>;
|
|
26
|
+
retrieveDAG(cidString: string): Promise<unknown>;
|
|
27
|
+
get isStarted(): boolean;
|
|
28
|
+
}
|
|
29
|
+
export { PinManager } from './pin.js';
|
|
30
|
+
export { MirrorManager } from './mirror.js';
|
|
31
|
+
export { ContentPropagation } from './propagation.js';
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* IPFS/Helia storage layer
|
|
3
|
+
*
|
|
4
|
+
* Provides content-addressed storage using Helia (IPFS in JS).
|
|
5
|
+
* Supports storing and retrieving files, JSON, strings, and DAG structures.
|
|
6
|
+
*/
|
|
7
|
+
import { createHelia } from 'helia';
|
|
8
|
+
import { json } from '@helia/json';
|
|
9
|
+
import { strings } from '@helia/strings';
|
|
10
|
+
import { dagJson } from '@helia/dag-json';
|
|
11
|
+
import { PinManager } from './pin.js';
|
|
12
|
+
import { MirrorManager } from './mirror.js';
|
|
13
|
+
import { ContentPropagation } from './propagation.js';
|
|
14
|
+
import { createLogger } from '../logger.js';
|
|
15
|
+
const log = createLogger('storage');
|
|
16
|
+
export class StorageManager {
|
|
17
|
+
helia = null;
|
|
18
|
+
jsonStore = null;
|
|
19
|
+
stringStore = null;
|
|
20
|
+
dagJsonStore = null;
|
|
21
|
+
pins;
|
|
22
|
+
mirrors;
|
|
23
|
+
propagation;
|
|
24
|
+
constructor() {
|
|
25
|
+
// PinManager and MirrorManager will be initialized when helia starts
|
|
26
|
+
this.pins = null;
|
|
27
|
+
this.mirrors = null;
|
|
28
|
+
this.propagation = new ContentPropagation();
|
|
29
|
+
}
|
|
30
|
+
async start(libp2pNode) {
|
|
31
|
+
// Create Helia node using the existing libp2p node
|
|
32
|
+
this.helia = await createHelia({
|
|
33
|
+
libp2p: libp2pNode,
|
|
34
|
+
});
|
|
35
|
+
this.jsonStore = json(this.helia);
|
|
36
|
+
this.stringStore = strings(this.helia);
|
|
37
|
+
this.dagJsonStore = dagJson(this.helia);
|
|
38
|
+
this.pins = new PinManager(this.helia);
|
|
39
|
+
this.mirrors = new MirrorManager(this.helia);
|
|
40
|
+
// Wire the pin callback so ContentPropagation can auto-pin via PinManager
|
|
41
|
+
this.propagation.setPinCallback((cid) => this.pins.pin(cid));
|
|
42
|
+
log.info('Storage manager started');
|
|
43
|
+
}
|
|
44
|
+
async stop() {
|
|
45
|
+
if (this.helia) {
|
|
46
|
+
await this.helia.stop();
|
|
47
|
+
this.helia = null;
|
|
48
|
+
log.info('Storage manager stopped');
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
// Store a JSON object, returns CID string
|
|
52
|
+
async storeJSON(data) {
|
|
53
|
+
if (!this.jsonStore)
|
|
54
|
+
throw new Error('Storage not started');
|
|
55
|
+
const cid = await this.jsonStore.add(data);
|
|
56
|
+
return cid.toString();
|
|
57
|
+
}
|
|
58
|
+
// Retrieve a JSON object by CID string
|
|
59
|
+
async retrieveJSON(cidString) {
|
|
60
|
+
if (!this.jsonStore)
|
|
61
|
+
throw new Error('Storage not started');
|
|
62
|
+
const { CID } = await import('multiformats/cid');
|
|
63
|
+
const cid = CID.parse(cidString);
|
|
64
|
+
return this.jsonStore.get(cid);
|
|
65
|
+
}
|
|
66
|
+
// Store a string, returns CID string
|
|
67
|
+
async storeString(data) {
|
|
68
|
+
if (!this.stringStore)
|
|
69
|
+
throw new Error('Storage not started');
|
|
70
|
+
const cid = await this.stringStore.add(data);
|
|
71
|
+
return cid.toString();
|
|
72
|
+
}
|
|
73
|
+
// Retrieve a string by CID string
|
|
74
|
+
async retrieveString(cidString) {
|
|
75
|
+
if (!this.stringStore)
|
|
76
|
+
throw new Error('Storage not started');
|
|
77
|
+
const { CID } = await import('multiformats/cid');
|
|
78
|
+
const cid = CID.parse(cidString);
|
|
79
|
+
return this.stringStore.get(cid);
|
|
80
|
+
}
|
|
81
|
+
// Store a DAG-JSON object (supports CID links), returns CID string
|
|
82
|
+
async storeDAG(data) {
|
|
83
|
+
if (!this.dagJsonStore)
|
|
84
|
+
throw new Error('Storage not started');
|
|
85
|
+
const cid = await this.dagJsonStore.add(data);
|
|
86
|
+
return cid.toString();
|
|
87
|
+
}
|
|
88
|
+
// Retrieve a DAG-JSON object by CID string
|
|
89
|
+
async retrieveDAG(cidString) {
|
|
90
|
+
if (!this.dagJsonStore)
|
|
91
|
+
throw new Error('Storage not started');
|
|
92
|
+
const { CID } = await import('multiformats/cid');
|
|
93
|
+
const cid = CID.parse(cidString);
|
|
94
|
+
return this.dagJsonStore.get(cid);
|
|
95
|
+
}
|
|
96
|
+
get isStarted() {
|
|
97
|
+
return this.helia !== null;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
export { PinManager } from './pin.js';
|
|
101
|
+
export { MirrorManager } from './mirror.js';
|
|
102
|
+
export { ContentPropagation } from './propagation.js';
|
|
103
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/storage/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AACpC,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AACnC,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AACtC,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAE5C,MAAM,GAAG,GAAG,YAAY,CAAC,SAAS,CAAC,CAAC;AAEpC,MAAM,OAAO,cAAc;IACjB,KAAK,GAAQ,IAAI,CAAC;IAClB,SAAS,GAAQ,IAAI,CAAC;IACtB,WAAW,GAAQ,IAAI,CAAC;IACxB,YAAY,GAAQ,IAAI,CAAC;IACxB,IAAI,CAAa;IACjB,OAAO,CAAgB;IACvB,WAAW,CAAqB;IAEzC;QACE,qEAAqE;QACrE,IAAI,CAAC,IAAI,GAAG,IAAW,CAAC;QACxB,IAAI,CAAC,OAAO,GAAG,IAAW,CAAC;QAC3B,IAAI,CAAC,WAAW,GAAG,IAAI,kBAAkB,EAAE,CAA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AC,CAAC;QAC9C,OAAO,GAAG,CAAC,QAAQ,EAAE,CAAC;IACxB,CAAC;IAED,2CAA2C;IAC3C,KAAK,CAAC,WAAW,CAAC,SAAiB;QACjC,IAAI,CAAC,IAAI,CAAC,YAAY;YAAE,MAAM,IAAI,KAAK,CAAC,qBAAqB,CAAC,CAAC;QAC/D,MAAM,EAAE,GAAG,EAAE,GAAG,MAAM,MAAM,CAAC,kBAAkB,CAAC,CAAC;QACjD,MAAM,GAAG,GAAG,GAAG,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;QACjC,OAAO,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IACpC,CAAC;IAED,IAAI,SAAS;QACX,OAAO,IAAI,CAAC,KAAK,KAAK,IAAI,CAAC;IAC7B,CAAC;CACF;AAED,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AACtC,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare class MirrorManager {
|
|
2
|
+
private mirroredRooms;
|
|
3
|
+
private helia;
|
|
4
|
+
constructor(helia: any);
|
|
5
|
+
mirrorRoom(roomId: string): Promise<void>;
|
|
6
|
+
stopMirroring(roomId: string): Promise<void>;
|
|
7
|
+
getMirroredRooms(): string[];
|
|
8
|
+
isMirroring(roomId: string): boolean;
|
|
9
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { createLogger } from '../logger.js';
|
|
2
|
+
const log = createLogger('storage:mirror');
|
|
3
|
+
export class MirrorManager {
|
|
4
|
+
mirroredRooms = new Set();
|
|
5
|
+
helia;
|
|
6
|
+
constructor(helia) {
|
|
7
|
+
this.helia = helia;
|
|
8
|
+
}
|
|
9
|
+
async mirrorRoom(roomId) {
|
|
10
|
+
this.mirroredRooms.add(roomId);
|
|
11
|
+
log.info(`Started mirroring room: ${roomId}`);
|
|
12
|
+
}
|
|
13
|
+
async stopMirroring(roomId) {
|
|
14
|
+
this.mirroredRooms.delete(roomId);
|
|
15
|
+
log.info(`Stopped mirroring room: ${roomId}`);
|
|
16
|
+
}
|
|
17
|
+
getMirroredRooms() {
|
|
18
|
+
return Array.from(this.mirroredRooms);
|
|
19
|
+
}
|
|
20
|
+
isMirroring(roomId) {
|
|
21
|
+
return this.mirroredRooms.has(roomId);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=mirror.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mirror.js","sourceRoot":"","sources":["../../src/storage/mirror.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAE5C,MAAM,GAAG,GAAG,YAAY,CAAC,gBAAgB,CAAC,CAAC;AAE3C,MAAM,OAAO,aAAa;IAChB,aAAa,GAAG,IAAI,GAAG,EAAU,CAAC;IAClC,KAAK,CAAM;IAEnB,YAAY,KAAU;QACpB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACrB,CAAC;IAED,KAAK,CAAC,UAAU,CAAC,MAAc;QAC7B,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;QAC/B,GAAG,CAAC,IAAI,CAAC,2BAA2B,MAAM,EAAE,CAAC,CAAC;IAChD,CAAC;IAED,KAAK,CAAC,aAAa,CAAC,MAAc;QAChC,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;QAClC,GAAG,CAAC,IAAI,CAAC,2BAA2B,MAAM,EAAE,CAAC,CAAC;IAChD,CAAC;IAED,gBAAgB;QACd,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;IACxC,CAAC;IAED,WAAW,CAAC,MAAc;QACxB,OAAO,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;IACxC,CAAC;CACF"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { createLogger } from '../logger.js';
|
|
2
|
+
const log = createLogger('storage:pin');
|
|
3
|
+
export class PinManager {
|
|
4
|
+
helia;
|
|
5
|
+
pinnedCids = new Set();
|
|
6
|
+
constructor(helia) {
|
|
7
|
+
this.helia = helia;
|
|
8
|
+
}
|
|
9
|
+
async pin(cidString) {
|
|
10
|
+
try {
|
|
11
|
+
const { CID } = await import('multiformats/cid');
|
|
12
|
+
const cid = CID.parse(cidString);
|
|
13
|
+
for await (const _ of this.helia.pins.add(cid)) {
|
|
14
|
+
// drain
|
|
15
|
+
}
|
|
16
|
+
this.pinnedCids.add(cidString);
|
|
17
|
+
log.info(`Pinned: ${cidString}`);
|
|
18
|
+
}
|
|
19
|
+
catch (err) {
|
|
20
|
+
log.error(`Failed to pin ${cidString}: ${err}`);
|
|
21
|
+
throw err;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
async unpin(cidString) {
|
|
25
|
+
try {
|
|
26
|
+
const { CID } = await import('multiformats/cid');
|
|
27
|
+
const cid = CID.parse(cidString);
|
|
28
|
+
for await (const _ of this.helia.pins.rm(cid)) {
|
|
29
|
+
// drain
|
|
30
|
+
}
|
|
31
|
+
this.pinnedCids.delete(cidString);
|
|
32
|
+
log.info(`Unpinned: ${cidString}`);
|
|
33
|
+
}
|
|
34
|
+
catch (err) {
|
|
35
|
+
log.error(`Failed to unpin ${cidString}: ${err}`);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
getPinnedCids() {
|
|
39
|
+
return Array.from(this.pinnedCids);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
//# sourceMappingURL=pin.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pin.js","sourceRoot":"","sources":["../../src/storage/pin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAE5C,MAAM,GAA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CAAC,aAAa,SAAS,EAAE,CAAC,CAAC;QACrC,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,GAAG,CAAC,KAAK,CAAC,mBAAmB,SAAS,KAAK,GAAG,EAAE,CAAC,CAAC;QACpD,CAAC;IACH,CAAC;IAED,aAAa;QACX,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;IACrC,CAAC;CACF"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Viral content propagation — automatic pinning of received content
|
|
3
|
+
*
|
|
4
|
+
* When Agent A receives content from Agent B (a chat message referencing CIDs,
|
|
5
|
+
* or content retrieved from the network), Agent A automatically pins those CIDs.
|
|
6
|
+
* This creates organic growth in content redundancy: popular content gets pinned
|
|
7
|
+
* by more agents proportional to how widely it is shared.
|
|
8
|
+
*/
|
|
9
|
+
export interface PropagationStats {
|
|
10
|
+
totalPinned: number;
|
|
11
|
+
pinnedFromOthers: number;
|
|
12
|
+
pinnedByOthers: number;
|
|
13
|
+
cidPopularity: Map<string, number>;
|
|
14
|
+
}
|
|
15
|
+
export declare class ContentPropagation {
|
|
16
|
+
private localPins;
|
|
17
|
+
private cidSources;
|
|
18
|
+
private autopinEnabled;
|
|
19
|
+
private pinCallback;
|
|
20
|
+
constructor();
|
|
21
|
+
setPinCallback(cb: (cid: string) => Promise<void>): void;
|
|
22
|
+
setAutopin(enabled: boolean): void;
|
|
23
|
+
onContentReceived(cids: string[], sourcePeerId: string): Promise<void>;
|
|
24
|
+
trackLocalContent(cid: string): void;
|
|
25
|
+
getPopularity(cid: string): number;
|
|
26
|
+
getStats(): {
|
|
27
|
+
totalPinned: number;
|
|
28
|
+
pinnedFromOthers: number;
|
|
29
|
+
trackedCids: number;
|
|
30
|
+
};
|
|
31
|
+
getLocalPins(): string[];
|
|
32
|
+
}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Viral content propagation — automatic pinning of received content
|
|
3
|
+
*
|
|
4
|
+
* When Agent A receives content from Agent B (a chat message referencing CIDs,
|
|
5
|
+
* or content retrieved from the network), Agent A automatically pins those CIDs.
|
|
6
|
+
* This creates organic growth in content redundancy: popular content gets pinned
|
|
7
|
+
* by more agents proportional to how widely it is shared.
|
|
8
|
+
*/
|
|
9
|
+
import { createLogger } from '../logger.js';
|
|
10
|
+
const log = createLogger('storage:propagation');
|
|
11
|
+
export class ContentPropagation {
|
|
12
|
+
localPins = new Set();
|
|
13
|
+
cidSources = new Map(); // CID -> set of peerIds that have it
|
|
14
|
+
autopinEnabled = true;
|
|
15
|
+
pinCallback = null;
|
|
16
|
+
constructor() { }
|
|
17
|
+
// Set the callback that actually pins content (connected to StorageManager)
|
|
18
|
+
setPinCallback(cb) {
|
|
19
|
+
this.pinCallback = cb;
|
|
20
|
+
}
|
|
21
|
+
// Enable/disable automatic pinning of received content
|
|
22
|
+
setAutopin(enabled) {
|
|
23
|
+
this.autopinEnabled = enabled;
|
|
24
|
+
log.info(`Autopin ${enabled ? 'enabled' : 'disabled'}`);
|
|
25
|
+
}
|
|
26
|
+
// Called when we receive a message that references CIDs.
|
|
27
|
+
// This is the viral mechanism: seeing content = pinning content.
|
|
28
|
+
async onContentReceived(cids, sourcePeerId) {
|
|
29
|
+
if (!this.autopinEnabled || !this.pinCallback) {
|
|
30
|
+
// Even when disabled, track sources so we know what is popular
|
|
31
|
+
if (cids.length > 0) {
|
|
32
|
+
for (const cid of cids) {
|
|
33
|
+
if (!this.cidSources.has(cid)) {
|
|
34
|
+
this.cidSources.set(cid, new Set());
|
|
35
|
+
}
|
|
36
|
+
this.cidSources.get(cid).add(sourcePeerId);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
for (const cid of cids) {
|
|
42
|
+
// Track who has this content
|
|
43
|
+
if (!this.cidSources.has(cid)) {
|
|
44
|
+
this.cidSources.set(cid, new Set());
|
|
45
|
+
}
|
|
46
|
+
this.cidSources.get(cid).add(sourcePeerId);
|
|
47
|
+
// Auto-pin if we haven't already
|
|
48
|
+
if (!this.localPins.has(cid)) {
|
|
49
|
+
try {
|
|
50
|
+
await this.pinCallback(cid);
|
|
51
|
+
this.localPins.add(cid);
|
|
52
|
+
log.info(`Auto-pinned ${cid} (from ${sourcePeerId.slice(0, 12)}...)`);
|
|
53
|
+
}
|
|
54
|
+
catch (err) {
|
|
55
|
+
log.debug(`Failed to auto-pin ${cid}: ${err}`);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
// Called when we store our own content locally
|
|
61
|
+
trackLocalContent(cid) {
|
|
62
|
+
this.localPins.add(cid);
|
|
63
|
+
}
|
|
64
|
+
// Get popularity of a CID (number of known pinners: local + peers)
|
|
65
|
+
getPopularity(cid) {
|
|
66
|
+
const sources = this.cidSources.get(cid);
|
|
67
|
+
let count = sources?.size ?? 0;
|
|
68
|
+
if (this.localPins.has(cid))
|
|
69
|
+
count++;
|
|
70
|
+
return count;
|
|
71
|
+
}
|
|
72
|
+
// Get aggregate stats
|
|
73
|
+
getStats() {
|
|
74
|
+
const pinnedFromOthers = Array.from(this.localPins).filter(cid => {
|
|
75
|
+
const sources = this.cidSources.get(cid);
|
|
76
|
+
return sources && sources.size > 0;
|
|
77
|
+
}).length;
|
|
78
|
+
return {
|
|
79
|
+
totalPinned: this.localPins.size,
|
|
80
|
+
pinnedFromOthers,
|
|
81
|
+
trackedCids: this.cidSources.size,
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
// Get all locally pinned CIDs
|
|
85
|
+
getLocalPins() {
|
|
86
|
+
return Array.from(this.localPins);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
//# sourceMappingURL=propagation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"propagation.js","sourceRoot":"","sources":["../../src/storage/propagation.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AA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,sBAAsB;IACtB,QAAQ;QACN,MAAM,gBAAgB,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE;YAC/D,MAAM,OAAO,GAAG,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;YACzC,OAAO,OAAO,IAAI,OAAO,CAAC,IAAI,GAAG,CAAC,CAAC;QACrC,CAAC,CAAC,CAAC,MAAM,CAAC;QAEV,OAAO;YACL,WAAW,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI;YAChC,gBAAgB;YAChB,WAAW,EAAE,IAAI,CAAC,UAAU,CAAC,IAAI;SAClC,CAAC;IACJ,CAAC;IAED,8BAA8B;IAC9B,YAAY;QACV,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IACpC,CAAC;CACF"}
|
package/package.json
ADDED
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "open-agents-nexus",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Zero-config decentralized agent-to-agent communication. Agents npm install, connect, and talk — no servers, no accounts, no surveillance. Built on libp2p + IPFS with encrypted P2P mesh networking, viral content pinning, and automatic peer discovery.",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
7
|
+
"type": "module",
|
|
8
|
+
"bin": {
|
|
9
|
+
"nexus": "./dist/cli.js",
|
|
10
|
+
"open-agents-nexus": "./dist/cli.js"
|
|
11
|
+
},
|
|
12
|
+
"exports": {
|
|
13
|
+
".": {
|
|
14
|
+
"import": "./dist/index.js",
|
|
15
|
+
"types": "./dist/index.d.ts"
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
"files": [
|
|
19
|
+
"dist/**/*.js",
|
|
20
|
+
"dist/**/*.d.ts",
|
|
21
|
+
"dist/**/*.js.map",
|
|
22
|
+
"!dist/**/__tests__/**",
|
|
23
|
+
"!dist/**/*.test.*",
|
|
24
|
+
"LICENSE",
|
|
25
|
+
"README.md",
|
|
26
|
+
"ARCHITECTURE.md"
|
|
27
|
+
],
|
|
28
|
+
"scripts": {
|
|
29
|
+
"dev": "node --import tsx src/index.ts",
|
|
30
|
+
"build": "tsc",
|
|
31
|
+
"start": "node dist/index.js",
|
|
32
|
+
"test": "vitest run",
|
|
33
|
+
"test:watch": "vitest",
|
|
34
|
+
"lint": "tsc --noEmit",
|
|
35
|
+
"prepublishOnly": "npm run build"
|
|
36
|
+
},
|
|
37
|
+
"engines": {
|
|
38
|
+
"node": ">=20.0.0"
|
|
39
|
+
},
|
|
40
|
+
"repository": {
|
|
41
|
+
"type": "git",
|
|
42
|
+
"url": "git+https://github.com/robit-man/openagents.nexus.git"
|
|
43
|
+
},
|
|
44
|
+
"keywords": [
|
|
45
|
+
"agent",
|
|
46
|
+
"agents",
|
|
47
|
+
"ai-agent",
|
|
48
|
+
"autonomous-agent",
|
|
49
|
+
"multi-agent",
|
|
50
|
+
"agent-communication",
|
|
51
|
+
"agent-framework",
|
|
52
|
+
"agent-protocol",
|
|
53
|
+
"agent-to-agent",
|
|
54
|
+
"agentic",
|
|
55
|
+
"decentralized",
|
|
56
|
+
"p2p",
|
|
57
|
+
"peer-to-peer",
|
|
58
|
+
"distributed",
|
|
59
|
+
"mesh-network",
|
|
60
|
+
"libp2p",
|
|
61
|
+
"ipfs",
|
|
62
|
+
"helia",
|
|
63
|
+
"dht",
|
|
64
|
+
"kademlia",
|
|
65
|
+
"gossipsub",
|
|
66
|
+
"pubsub",
|
|
67
|
+
"chat",
|
|
68
|
+
"real-time",
|
|
69
|
+
"encrypted",
|
|
70
|
+
"e2e-encryption",
|
|
71
|
+
"noise-protocol",
|
|
72
|
+
"privacy",
|
|
73
|
+
"zero-config",
|
|
74
|
+
"nat-traversal",
|
|
75
|
+
"circuit-relay",
|
|
76
|
+
"content-addressed",
|
|
77
|
+
"content-pinning",
|
|
78
|
+
"openagents",
|
|
79
|
+
"nexus",
|
|
80
|
+
"no-server",
|
|
81
|
+
"serverless",
|
|
82
|
+
"self-sovereign",
|
|
83
|
+
"web3",
|
|
84
|
+
"mcp",
|
|
85
|
+
"tool-use",
|
|
86
|
+
"llm",
|
|
87
|
+
"swarm",
|
|
88
|
+
"collaborative-agents"
|
|
89
|
+
],
|
|
90
|
+
"author": "",
|
|
91
|
+
"license": "AGPL-3.0",
|
|
92
|
+
"bugs": {
|
|
93
|
+
"url": "https://github.com/robit-man/openagents.nexus/issues"
|
|
94
|
+
},
|
|
95
|
+
"homepage": "https://github.com/robit-man/openagents.nexus#readme",
|
|
96
|
+
"dependencies": {
|
|
97
|
+
"@chainsafe/libp2p-noise": "^17.0.0",
|
|
98
|
+
"@chainsafe/libp2p-yamux": "^8.0.1",
|
|
99
|
+
"@helia/dag-json": "^5.0.7",
|
|
100
|
+
"@helia/json": "^5.0.7",
|
|
101
|
+
"@helia/strings": "^5.0.7",
|
|
102
|
+
"@helia/unixfs": "^7.0.4",
|
|
103
|
+
"@libp2p/bootstrap": "^12.0.14",
|
|
104
|
+
"@libp2p/circuit-relay-v2": "^4.1.6",
|
|
105
|
+
"@libp2p/gossipsub": "^15.0.15",
|
|
106
|
+
"@libp2p/identify": "^4.0.13",
|
|
107
|
+
"@libp2p/kad-dht": "^16.1.6",
|
|
108
|
+
"@libp2p/mdns": "^12.0.14",
|
|
109
|
+
"@libp2p/pubsub-peer-discovery": "^12.0.0",
|
|
110
|
+
"@libp2p/tcp": "^11.0.13",
|
|
111
|
+
"@libp2p/webrtc": "^6.0.14",
|
|
112
|
+
"@libp2p/websockets": "^10.1.6",
|
|
113
|
+
"helia": "^6.0.21",
|
|
114
|
+
"libp2p": "^3.1.6"
|
|
115
|
+
},
|
|
116
|
+
"devDependencies": {
|
|
117
|
+
"@types/node": "^25.5.0",
|
|
118
|
+
"tsx": "^4.21.0",
|
|
119
|
+
"typescript": "^5.9.3",
|
|
120
|
+
"vitest": "^4.1.0"
|
|
121
|
+
}
|
|
122
|
+
}
|