@olane/o-tools-common 0.1.0 → 0.1.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.
- package/dist/agent/agents.tool.d.ts +16 -17
- package/dist/agent/agents.tool.js +8 -5
- package/dist/agent/ai-agent.tool.d.ts +0 -1
- package/dist/agent/ai-agent.tool.js +8 -5
- package/dist/agent/base-agent.tool.d.ts +16 -17
- package/dist/agent/base-agent.tool.js +10 -7
- package/dist/agent/human-agent.tool.d.ts +0 -1
- package/dist/agent/human-agent.tool.js +8 -5
- package/dist/agent/index.d.ts +0 -1
- package/dist/agent/index.js +20 -5
- package/dist/agent/interfaces/agent.config.d.ts +0 -1
- package/dist/agent/interfaces/agent.config.js +2 -2
- package/dist/agent/methods/agent.methods.d.ts +0 -1
- package/dist/agent/methods/agent.methods.js +4 -2
- package/dist/index.d.ts +0 -1
- package/dist/index.js +23 -8
- package/dist/init.d.ts +1 -2
- package/dist/init.js +19 -16
- package/dist/plan/disk-plan-storage.tool.d.ts +1 -96
- package/dist/plan/disk-plan-storage.tool.js +7 -4
- package/dist/plan/index.d.ts +0 -1
- package/dist/plan/index.js +18 -3
- package/dist/plan/memory-plan-storage.tool.d.ts +1 -96
- package/dist/plan/memory-plan-storage.tool.js +7 -4
- package/dist/plan/methods/plan.methods.d.ts +0 -1
- package/dist/plan/methods/plan.methods.js +4 -2
- package/dist/plan/plan-storage.tool.d.ts +1 -98
- package/dist/plan/plan-storage.tool.js +30 -4
- package/dist/plan/resolvers/index.d.ts +0 -1
- package/dist/plan/resolvers/index.js +17 -2
- package/dist/plan/resolvers/plan.resolver.d.ts +0 -1
- package/dist/plan/resolvers/plan.resolver.js +6 -3
- package/dist/registry/index.d.ts +0 -1
- package/dist/registry/index.js +18 -3
- package/dist/registry/interfaces/search.interface.d.ts +0 -1
- package/dist/registry/interfaces/search.interface.js +2 -2
- package/dist/registry/methods/registry.methods.d.ts +0 -1
- package/dist/registry/methods/registry.methods.js +4 -2
- package/dist/registry/registry-memory.tool.d.ts +0 -1
- package/dist/registry/registry-memory.tool.js +8 -3
- package/dist/registry/registry.tool.d.ts +14 -15
- package/dist/registry/registry.tool.js +10 -7
- package/dist/search/index.d.ts +1 -1
- package/dist/search/index.js +2 -1
- package/dist/search/parameters/search.parameters.d.ts +0 -1
- package/dist/search/parameters/search.parameters.js +4 -2
- package/dist/search/search.tool.d.ts +16 -17
- package/dist/search/search.tool.js +14 -8
- package/dist/setup/index.d.ts +0 -1
- package/dist/setup/index.js +18 -3
- package/dist/setup/methods/setup.method.d.ts +0 -1
- package/dist/setup/methods/setup.method.js +4 -2
- package/dist/setup/setup.tool.d.ts +16 -17
- package/dist/setup/setup.tool.js +15 -8
- package/dist/storage/delete.tool.d.ts +16 -17
- package/dist/storage/delete.tool.js +8 -5
- package/dist/storage/get.tool.d.ts +16 -17
- package/dist/storage/get.tool.js +8 -5
- package/dist/storage/has.tool.d.ts +16 -17
- package/dist/storage/has.tool.js +8 -5
- package/dist/storage/index.d.ts +0 -1
- package/dist/storage/index.js +25 -10
- package/dist/storage/interfaces/get-data.response.d.ts +0 -1
- package/dist/storage/interfaces/get-data.response.js +2 -2
- package/dist/storage/interfaces/index.d.ts +0 -1
- package/dist/storage/interfaces/index.js +17 -2
- package/dist/storage/methods/storage.methods.d.ts +0 -1
- package/dist/storage/methods/storage.methods.js +4 -2
- package/dist/storage/providers/dht-storage-provider.tool.d.ts +0 -1
- package/dist/storage/providers/dht-storage-provider.tool.js +10 -7
- package/dist/storage/providers/disk-storage-provider.tool.d.ts +25 -1
- package/dist/storage/providers/disk-storage-provider.tool.js +52 -17
- package/dist/storage/providers/encrypted-storage-provider.tool.d.ts +1 -1
- package/dist/storage/providers/encrypted-storage-provider.tool.js +64 -1
- package/dist/storage/providers/memory-storage-provider.tool.d.ts +19 -1
- package/dist/storage/providers/memory-storage-provider.tool.js +29 -7
- package/dist/storage/providers/storage-provider.tool.d.ts +16 -17
- package/dist/storage/providers/storage-provider.tool.js +11 -5
- package/dist/storage/put.tool.d.ts +16 -17
- package/dist/storage/put.tool.js +8 -5
- package/dist/storage/storage.tool.d.ts +0 -1
- package/dist/storage/storage.tool.js +15 -11
- package/dist/vault/index.d.ts +0 -1
- package/dist/vault/index.js +17 -2
- package/dist/vault/lib/encryption.d.ts +24 -1
- package/dist/vault/lib/encryption.js +47 -9
- package/dist/vault/methods/vault.methods.d.ts +0 -1
- package/dist/vault/methods/vault.methods.js +4 -2
- package/dist/vault/vault.tool.d.ts +16 -17
- package/dist/vault/vault.tool.js +12 -9
- package/package.json +11 -18
- package/dist/agent/agents.tool.d.ts.map +0 -1
- package/dist/agent/agents.tool.js.map +0 -1
- package/dist/agent/ai-agent.tool.d.ts.map +0 -1
- package/dist/agent/ai-agent.tool.js.map +0 -1
- package/dist/agent/base-agent.tool.d.ts.map +0 -1
- package/dist/agent/base-agent.tool.js.map +0 -1
- package/dist/agent/human-agent.tool.d.ts.map +0 -1
- package/dist/agent/human-agent.tool.js.map +0 -1
- package/dist/agent/index.d.ts.map +0 -1
- package/dist/agent/index.js.map +0 -1
- package/dist/agent/interfaces/agent.config.d.ts.map +0 -1
- package/dist/agent/interfaces/agent.config.js.map +0 -1
- package/dist/agent/methods/agent.methods.d.ts.map +0 -1
- package/dist/agent/methods/agent.methods.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/init.d.ts.map +0 -1
- package/dist/init.js.map +0 -1
- package/dist/plan/disk-plan-storage.tool.d.ts.map +0 -1
- package/dist/plan/disk-plan-storage.tool.js.map +0 -1
- package/dist/plan/index.d.ts.map +0 -1
- package/dist/plan/index.js.map +0 -1
- package/dist/plan/memory-plan-storage.tool.d.ts.map +0 -1
- package/dist/plan/memory-plan-storage.tool.js.map +0 -1
- package/dist/plan/methods/plan.methods.d.ts.map +0 -1
- package/dist/plan/methods/plan.methods.js.map +0 -1
- package/dist/plan/plan-storage.tool.d.ts.map +0 -1
- package/dist/plan/plan-storage.tool.js.map +0 -1
- package/dist/plan/resolvers/index.d.ts.map +0 -1
- package/dist/plan/resolvers/index.js.map +0 -1
- package/dist/plan/resolvers/plan.resolver.d.ts.map +0 -1
- package/dist/plan/resolvers/plan.resolver.js.map +0 -1
- package/dist/registry/index.d.ts.map +0 -1
- package/dist/registry/index.js.map +0 -1
- package/dist/registry/interfaces/search.interface.d.ts.map +0 -1
- package/dist/registry/interfaces/search.interface.js.map +0 -1
- package/dist/registry/methods/registry.methods.d.ts.map +0 -1
- package/dist/registry/methods/registry.methods.js.map +0 -1
- package/dist/registry/registry-memory.tool.d.ts.map +0 -1
- package/dist/registry/registry-memory.tool.js.map +0 -1
- package/dist/registry/registry.tool.d.ts.map +0 -1
- package/dist/registry/registry.tool.js.map +0 -1
- package/dist/search/index.d.ts.map +0 -1
- package/dist/search/index.js.map +0 -1
- package/dist/search/parameters/search.parameters.d.ts.map +0 -1
- package/dist/search/parameters/search.parameters.js.map +0 -1
- package/dist/search/search.tool.d.ts.map +0 -1
- package/dist/search/search.tool.js.map +0 -1
- package/dist/setup/index.d.ts.map +0 -1
- package/dist/setup/index.js.map +0 -1
- package/dist/setup/methods/setup.method.d.ts.map +0 -1
- package/dist/setup/methods/setup.method.js.map +0 -1
- package/dist/setup/setup.tool.d.ts.map +0 -1
- package/dist/setup/setup.tool.js.map +0 -1
- package/dist/storage/delete.tool.d.ts.map +0 -1
- package/dist/storage/delete.tool.js.map +0 -1
- package/dist/storage/get.tool.d.ts.map +0 -1
- package/dist/storage/get.tool.js.map +0 -1
- package/dist/storage/has.tool.d.ts.map +0 -1
- package/dist/storage/has.tool.js.map +0 -1
- package/dist/storage/index.d.ts.map +0 -1
- package/dist/storage/index.js.map +0 -1
- package/dist/storage/interfaces/get-data.response.d.ts.map +0 -1
- package/dist/storage/interfaces/get-data.response.js.map +0 -1
- package/dist/storage/interfaces/index.d.ts.map +0 -1
- package/dist/storage/interfaces/index.js.map +0 -1
- package/dist/storage/methods/storage.methods.d.ts.map +0 -1
- package/dist/storage/methods/storage.methods.js.map +0 -1
- package/dist/storage/providers/dht-storage-provider.tool.d.ts.map +0 -1
- package/dist/storage/providers/dht-storage-provider.tool.js.map +0 -1
- package/dist/storage/providers/disk-storage-provider.tool.d.ts.map +0 -1
- package/dist/storage/providers/disk-storage-provider.tool.js.map +0 -1
- package/dist/storage/providers/encrypted-storage-provider.tool.d.ts.map +0 -1
- package/dist/storage/providers/encrypted-storage-provider.tool.js.map +0 -1
- package/dist/storage/providers/memory-storage-provider.tool.d.ts.map +0 -1
- package/dist/storage/providers/memory-storage-provider.tool.js.map +0 -1
- package/dist/storage/providers/storage-provider.tool.d.ts.map +0 -1
- package/dist/storage/providers/storage-provider.tool.js.map +0 -1
- package/dist/storage/put.tool.d.ts.map +0 -1
- package/dist/storage/put.tool.js.map +0 -1
- package/dist/storage/storage.tool.d.ts.map +0 -1
- package/dist/storage/storage.tool.js.map +0 -1
- package/dist/tsconfig.tsbuildinfo +0 -1
- package/dist/vault/index.d.ts.map +0 -1
- package/dist/vault/index.js.map +0 -1
- package/dist/vault/lib/encryption.d.ts.map +0 -1
- package/dist/vault/lib/encryption.js.map +0 -1
- package/dist/vault/methods/vault.methods.d.ts.map +0 -1
- package/dist/vault/methods/vault.methods.js.map +0 -1
- package/dist/vault/vault.tool.d.ts.map +0 -1
- package/dist/vault/vault.tool.js.map +0 -1
|
@@ -1,19 +1,25 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SearchTool = void 0;
|
|
4
|
+
const o_tool_1 = require("@olane/o-tool");
|
|
5
|
+
const o_core_1 = require("@olane/o-core");
|
|
6
|
+
const search_parameters_1 = require("./parameters/search.parameters");
|
|
7
|
+
class SearchTool extends (0, o_tool_1.oTool)(o_core_1.oVirtualNode) {
|
|
5
8
|
constructor(config) {
|
|
6
9
|
super({
|
|
7
10
|
...config,
|
|
8
|
-
address: new oAddress('o://search'),
|
|
9
|
-
methods: SEARCH_PARAMS,
|
|
11
|
+
address: new o_core_1.oAddress('o://search'),
|
|
12
|
+
methods: search_parameters_1.SEARCH_PARAMS,
|
|
10
13
|
description: 'Tool to search for any information in the network',
|
|
11
14
|
});
|
|
12
15
|
}
|
|
13
16
|
async _tool_vector(request) {
|
|
14
17
|
const { query } = request.params;
|
|
18
|
+
// let's search our available providers to resolve the task
|
|
19
|
+
// first search local providers
|
|
15
20
|
this.logger.debug('Searching network with terms: ', query);
|
|
16
|
-
|
|
21
|
+
// TODO: how can we improve this?
|
|
22
|
+
const response = await this.use(new o_core_1.oAddress('o://vector-store'), {
|
|
17
23
|
method: 'search_similar',
|
|
18
24
|
params: {
|
|
19
25
|
query: query,
|
|
@@ -23,4 +29,4 @@ export class SearchTool extends oTool(oVirtualNode) {
|
|
|
23
29
|
return response.result.data;
|
|
24
30
|
}
|
|
25
31
|
}
|
|
26
|
-
|
|
32
|
+
exports.SearchTool = SearchTool;
|
package/dist/setup/index.d.ts
CHANGED
package/dist/setup/index.js
CHANGED
|
@@ -1,3 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./setup.tool"), exports);
|
|
18
|
+
__exportStar(require("./methods/setup.method"), exports);
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SETUP_METHODS = void 0;
|
|
4
|
+
exports.SETUP_METHODS = {
|
|
2
5
|
validate: {
|
|
3
6
|
name: 'validate',
|
|
4
7
|
description: 'Validate the setup of the tool',
|
|
@@ -14,4 +17,3 @@ export const SETUP_METHODS = {
|
|
|
14
17
|
],
|
|
15
18
|
},
|
|
16
19
|
};
|
|
17
|
-
//# sourceMappingURL=setup.method.js.map
|
|
@@ -7,13 +7,13 @@ declare const SetupTool_base: (new (...args: any[]) => {
|
|
|
7
7
|
initialize(): Promise<void>;
|
|
8
8
|
use(address: oAddress, data: {
|
|
9
9
|
[key: string]: unknown;
|
|
10
|
-
}, config?: import("@olane/o-core").UseOptions): Promise<import("@olane/o-core").oResponse>;
|
|
11
|
-
handleStream(streamData: import("@
|
|
12
|
-
execute(req: oRequest, stream?: import("@
|
|
13
|
-
run(request: oRequest, stream?: import("@
|
|
10
|
+
}, config?: import("@olane/o-core").UseOptions | undefined): Promise<import("@olane/o-core").oResponse>;
|
|
11
|
+
handleStream(streamData: import("@libp2p/interface", { with: { "resolution-mode": "import" } }).IncomingStreamData): Promise<void>;
|
|
12
|
+
execute(req: oRequest, stream?: import("@libp2p/interface", { with: { "resolution-mode": "import" } }).Stream | undefined): Promise<import("@olane/o-tool").RunResult>;
|
|
13
|
+
run(request: oRequest, stream?: import("@libp2p/interface", { with: { "resolution-mode": "import" } }).Stream | undefined): Promise<import("@olane/o-tool").RunResult>;
|
|
14
14
|
myTools(): string[];
|
|
15
15
|
myToolParams(tool: string): Record<string, any>;
|
|
16
|
-
callMyTool(request: oRequest, stream?: import("@
|
|
16
|
+
callMyTool(request: oRequest, stream?: import("@libp2p/interface", { with: { "resolution-mode": "import" } }).Stream | undefined): Promise<ToolResult>;
|
|
17
17
|
index(): Promise<{
|
|
18
18
|
provider: string;
|
|
19
19
|
summary: string;
|
|
@@ -26,31 +26,31 @@ declare const SetupTool_base: (new (...args: any[]) => {
|
|
|
26
26
|
tools: string[];
|
|
27
27
|
description: string;
|
|
28
28
|
}>;
|
|
29
|
-
findMissingParams(methodName: string, params: any): import("@olane/o-protocol
|
|
29
|
+
findMissingParams(methodName: string, params: any): import("@olane/o-protocol").oParameter[];
|
|
30
30
|
readonly config: import("@olane/o-core").CoreConfig;
|
|
31
|
-
p2pNode: import("@
|
|
31
|
+
p2pNode: import("libp2p", { with: { "resolution-mode": "import" } }).Libp2p<import("@libp2p/interface", { with: { "resolution-mode": "import" } }).ServiceMap>;
|
|
32
32
|
logger: import("@olane/o-core").Logger;
|
|
33
|
-
networkConfig: import("@olane/o-config
|
|
33
|
+
networkConfig: import("@olane/o-config").Libp2pConfig;
|
|
34
34
|
address: oAddress;
|
|
35
35
|
readonly staticAddress: oAddress;
|
|
36
|
-
peerId: import("@
|
|
36
|
+
peerId: import("@libp2p/interface-peer-id", { with: { "resolution-mode": "import" } }).PeerId;
|
|
37
37
|
state: import("@olane/o-core").NodeState;
|
|
38
38
|
errors: Error[];
|
|
39
39
|
connectionManager: import("@olane/o-core").oConnectionManager;
|
|
40
|
-
leaders: import("@
|
|
40
|
+
leaders: import("@multiformats/multiaddr", { with: { "resolution-mode": "import" } }).Multiaddr[];
|
|
41
41
|
addressResolution: import("@olane/o-core").oAddressResolution;
|
|
42
42
|
readonly description: string;
|
|
43
43
|
dependencies: import("@olane/o-core").oDependency[];
|
|
44
44
|
methods: {
|
|
45
|
-
[key: string]: import("@olane/o-protocol
|
|
45
|
+
[key: string]: import("@olane/o-protocol").oMethod;
|
|
46
46
|
};
|
|
47
47
|
successCount: number;
|
|
48
48
|
errorCount: number;
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
getTransports(address: oAddress): import("@
|
|
49
|
+
readonly type: import("@olane/o-core").NodeType;
|
|
50
|
+
readonly transports: string[];
|
|
51
|
+
readonly parent: oAddress | null;
|
|
52
|
+
readonly parentTransports: import("@multiformats/multiaddr", { with: { "resolution-mode": "import" } }).Multiaddr[];
|
|
53
|
+
getTransports(address: oAddress): import("@multiformats/multiaddr", { with: { "resolution-mode": "import" } }).Multiaddr[];
|
|
54
54
|
handleStaticAddressTranslation(addressInput: oAddress): Promise<oAddress>;
|
|
55
55
|
translateAddress(addressWithLeaderTransports: oAddress): Promise<{
|
|
56
56
|
nextHopAddress: oAddress;
|
|
@@ -72,4 +72,3 @@ export declare class SetupTool extends SetupTool_base {
|
|
|
72
72
|
_tool_store_parameters(request: oRequest): Promise<ToolResult>;
|
|
73
73
|
}
|
|
74
74
|
export {};
|
|
75
|
-
//# sourceMappingURL=setup.tool.d.ts.map
|
package/dist/setup/setup.tool.js
CHANGED
|
@@ -1,16 +1,20 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SetupTool = void 0;
|
|
4
|
+
const o_tool_1 = require("@olane/o-tool");
|
|
5
|
+
const o_core_1 = require("@olane/o-core");
|
|
6
|
+
const setup_method_1 = require("./methods/setup.method");
|
|
7
|
+
class SetupTool extends (0, o_tool_1.oTool)(o_core_1.oVirtualNode) {
|
|
5
8
|
constructor(config) {
|
|
6
9
|
super({
|
|
7
10
|
...config,
|
|
8
|
-
address: new oAddress('o://setup'),
|
|
9
|
-
methods: SETUP_METHODS,
|
|
11
|
+
address: new o_core_1.oAddress('o://setup'),
|
|
12
|
+
methods: setup_method_1.SETUP_METHODS,
|
|
10
13
|
description: 'Tool to help configure default tools on the network',
|
|
11
14
|
});
|
|
12
15
|
}
|
|
13
16
|
async validateTool(address, method) {
|
|
17
|
+
// we want to validate a specific tool
|
|
14
18
|
const tool = await this.use(address, {
|
|
15
19
|
method: method,
|
|
16
20
|
params: {},
|
|
@@ -20,6 +24,7 @@ export class SetupTool extends oTool(oVirtualNode) {
|
|
|
20
24
|
};
|
|
21
25
|
}
|
|
22
26
|
async validateAllTools() {
|
|
27
|
+
// we want to validate all common tools on the network
|
|
23
28
|
return {
|
|
24
29
|
result: null,
|
|
25
30
|
};
|
|
@@ -28,9 +33,11 @@ export class SetupTool extends oTool(oVirtualNode) {
|
|
|
28
33
|
const params = request.params;
|
|
29
34
|
const { address } = params;
|
|
30
35
|
if (!address) {
|
|
36
|
+
// we want to validate all common tools on the network
|
|
31
37
|
}
|
|
32
38
|
else {
|
|
33
|
-
|
|
39
|
+
// let's validate a specific tool
|
|
40
|
+
const tool = await this.validateTool(new o_core_1.oAddress('o://intelligence'), 'completion');
|
|
34
41
|
console.log('Validation result: ', tool?.result?.details?.parameters);
|
|
35
42
|
return tool?.result?.details?.parameters;
|
|
36
43
|
}
|
|
@@ -46,4 +53,4 @@ export class SetupTool extends oTool(oVirtualNode) {
|
|
|
46
53
|
};
|
|
47
54
|
}
|
|
48
55
|
}
|
|
49
|
-
|
|
56
|
+
exports.SetupTool = SetupTool;
|
|
@@ -6,13 +6,13 @@ declare const DeleteTool_base: (new (...args: any[]) => {
|
|
|
6
6
|
initialize(): Promise<void>;
|
|
7
7
|
use(address: oAddress, data: {
|
|
8
8
|
[key: string]: unknown;
|
|
9
|
-
}, config?: import("@olane/o-core").UseOptions): Promise<import("@olane/o-core").oResponse>;
|
|
10
|
-
handleStream(streamData: import("@
|
|
11
|
-
execute(req: import("@olane/o-core").oRequest, stream?: import("@
|
|
12
|
-
run(request: import("@olane/o-core").oRequest, stream?: import("@
|
|
9
|
+
}, config?: import("@olane/o-core").UseOptions | undefined): Promise<import("@olane/o-core").oResponse>;
|
|
10
|
+
handleStream(streamData: import("@libp2p/interface", { with: { "resolution-mode": "import" } }).IncomingStreamData): Promise<void>;
|
|
11
|
+
execute(req: import("@olane/o-core").oRequest, stream?: import("@libp2p/interface", { with: { "resolution-mode": "import" } }).Stream | undefined): Promise<import("@olane/o-tool").RunResult>;
|
|
12
|
+
run(request: import("@olane/o-core").oRequest, stream?: import("@libp2p/interface", { with: { "resolution-mode": "import" } }).Stream | undefined): Promise<import("@olane/o-tool").RunResult>;
|
|
13
13
|
myTools(): string[];
|
|
14
14
|
myToolParams(tool: string): Record<string, any>;
|
|
15
|
-
callMyTool(request: import("@olane/o-core").oRequest, stream?: import("@
|
|
15
|
+
callMyTool(request: import("@olane/o-core").oRequest, stream?: import("@libp2p/interface", { with: { "resolution-mode": "import" } }).Stream | undefined): Promise<import("@olane/o-tool").ToolResult>;
|
|
16
16
|
index(): Promise<{
|
|
17
17
|
provider: string;
|
|
18
18
|
summary: string;
|
|
@@ -25,31 +25,31 @@ declare const DeleteTool_base: (new (...args: any[]) => {
|
|
|
25
25
|
tools: string[];
|
|
26
26
|
description: string;
|
|
27
27
|
}>;
|
|
28
|
-
findMissingParams(methodName: string, params: any): import("@olane/o-protocol
|
|
28
|
+
findMissingParams(methodName: string, params: any): import("@olane/o-protocol").oParameter[];
|
|
29
29
|
readonly config: import("@olane/o-core").CoreConfig;
|
|
30
|
-
p2pNode: import("@
|
|
30
|
+
p2pNode: import("libp2p", { with: { "resolution-mode": "import" } }).Libp2p<import("@libp2p/interface", { with: { "resolution-mode": "import" } }).ServiceMap>;
|
|
31
31
|
logger: import("@olane/o-core").Logger;
|
|
32
|
-
networkConfig: import("@olane/o-config
|
|
32
|
+
networkConfig: import("@olane/o-config").Libp2pConfig;
|
|
33
33
|
address: oAddress;
|
|
34
34
|
readonly staticAddress: oAddress;
|
|
35
|
-
peerId: import("@
|
|
35
|
+
peerId: import("@libp2p/interface-peer-id", { with: { "resolution-mode": "import" } }).PeerId;
|
|
36
36
|
state: import("@olane/o-core").NodeState;
|
|
37
37
|
errors: Error[];
|
|
38
38
|
connectionManager: import("@olane/o-core").oConnectionManager;
|
|
39
|
-
leaders: import("@
|
|
39
|
+
leaders: import("@multiformats/multiaddr", { with: { "resolution-mode": "import" } }).Multiaddr[];
|
|
40
40
|
addressResolution: import("@olane/o-core").oAddressResolution;
|
|
41
41
|
readonly description: string;
|
|
42
42
|
dependencies: oDependency[];
|
|
43
43
|
methods: {
|
|
44
|
-
[key: string]: import("@olane/o-protocol
|
|
44
|
+
[key: string]: import("@olane/o-protocol").oMethod;
|
|
45
45
|
};
|
|
46
46
|
successCount: number;
|
|
47
47
|
errorCount: number;
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
getTransports(address: oAddress): import("@
|
|
48
|
+
readonly type: import("@olane/o-core").NodeType;
|
|
49
|
+
readonly transports: string[];
|
|
50
|
+
readonly parent: oAddress | null;
|
|
51
|
+
readonly parentTransports: import("@multiformats/multiaddr", { with: { "resolution-mode": "import" } }).Multiaddr[];
|
|
52
|
+
getTransports(address: oAddress): import("@multiformats/multiaddr", { with: { "resolution-mode": "import" } }).Multiaddr[];
|
|
53
53
|
handleStaticAddressTranslation(addressInput: oAddress): Promise<oAddress>;
|
|
54
54
|
translateAddress(addressWithLeaderTransports: oAddress): Promise<{
|
|
55
55
|
nextHopAddress: oAddress;
|
|
@@ -67,4 +67,3 @@ export declare class DeleteTool extends DeleteTool_base {
|
|
|
67
67
|
constructor(config: oToolConfig);
|
|
68
68
|
}
|
|
69
69
|
export {};
|
|
70
|
-
//# sourceMappingURL=delete.tool.d.ts.map
|
|
@@ -1,11 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DeleteTool = void 0;
|
|
4
|
+
const o_tool_1 = require("@olane/o-tool");
|
|
5
|
+
const o_core_1 = require("@olane/o-core");
|
|
6
|
+
class DeleteTool extends (0, o_tool_1.oTool)(o_core_1.oVirtualNode) {
|
|
4
7
|
constructor(config) {
|
|
5
8
|
super({
|
|
6
9
|
...config,
|
|
7
|
-
address: new oAddress('o://delete'),
|
|
10
|
+
address: new o_core_1.oAddress('o://delete'),
|
|
8
11
|
});
|
|
9
12
|
}
|
|
10
13
|
}
|
|
11
|
-
|
|
14
|
+
exports.DeleteTool = DeleteTool;
|
|
@@ -6,13 +6,13 @@ declare const GetTool_base: (new (...args: any[]) => {
|
|
|
6
6
|
initialize(): Promise<void>;
|
|
7
7
|
use(address: oAddress, data: {
|
|
8
8
|
[key: string]: unknown;
|
|
9
|
-
}, config?: import("@olane/o-core").UseOptions): Promise<import("@olane/o-core").oResponse>;
|
|
10
|
-
handleStream(streamData: import("@
|
|
11
|
-
execute(req: import("@olane/o-core").oRequest, stream?: import("@
|
|
12
|
-
run(request: import("@olane/o-core").oRequest, stream?: import("@
|
|
9
|
+
}, config?: import("@olane/o-core").UseOptions | undefined): Promise<import("@olane/o-core").oResponse>;
|
|
10
|
+
handleStream(streamData: import("@libp2p/interface", { with: { "resolution-mode": "import" } }).IncomingStreamData): Promise<void>;
|
|
11
|
+
execute(req: import("@olane/o-core").oRequest, stream?: import("@libp2p/interface", { with: { "resolution-mode": "import" } }).Stream | undefined): Promise<import("@olane/o-tool").RunResult>;
|
|
12
|
+
run(request: import("@olane/o-core").oRequest, stream?: import("@libp2p/interface", { with: { "resolution-mode": "import" } }).Stream | undefined): Promise<import("@olane/o-tool").RunResult>;
|
|
13
13
|
myTools(): string[];
|
|
14
14
|
myToolParams(tool: string): Record<string, any>;
|
|
15
|
-
callMyTool(request: import("@olane/o-core").oRequest, stream?: import("@
|
|
15
|
+
callMyTool(request: import("@olane/o-core").oRequest, stream?: import("@libp2p/interface", { with: { "resolution-mode": "import" } }).Stream | undefined): Promise<import("@olane/o-tool").ToolResult>;
|
|
16
16
|
index(): Promise<{
|
|
17
17
|
provider: string;
|
|
18
18
|
summary: string;
|
|
@@ -25,31 +25,31 @@ declare const GetTool_base: (new (...args: any[]) => {
|
|
|
25
25
|
tools: string[];
|
|
26
26
|
description: string;
|
|
27
27
|
}>;
|
|
28
|
-
findMissingParams(methodName: string, params: any): import("@olane/o-protocol
|
|
28
|
+
findMissingParams(methodName: string, params: any): import("@olane/o-protocol").oParameter[];
|
|
29
29
|
readonly config: import("@olane/o-core").CoreConfig;
|
|
30
|
-
p2pNode: import("@
|
|
30
|
+
p2pNode: import("libp2p", { with: { "resolution-mode": "import" } }).Libp2p<import("@libp2p/interface", { with: { "resolution-mode": "import" } }).ServiceMap>;
|
|
31
31
|
logger: import("@olane/o-core").Logger;
|
|
32
|
-
networkConfig: import("@olane/o-config
|
|
32
|
+
networkConfig: import("@olane/o-config").Libp2pConfig;
|
|
33
33
|
address: oAddress;
|
|
34
34
|
readonly staticAddress: oAddress;
|
|
35
|
-
peerId: import("@
|
|
35
|
+
peerId: import("@libp2p/interface-peer-id", { with: { "resolution-mode": "import" } }).PeerId;
|
|
36
36
|
state: import("@olane/o-core").NodeState;
|
|
37
37
|
errors: Error[];
|
|
38
38
|
connectionManager: import("@olane/o-core").oConnectionManager;
|
|
39
|
-
leaders: import("@
|
|
39
|
+
leaders: import("@multiformats/multiaddr", { with: { "resolution-mode": "import" } }).Multiaddr[];
|
|
40
40
|
addressResolution: import("@olane/o-core").oAddressResolution;
|
|
41
41
|
readonly description: string;
|
|
42
42
|
dependencies: import("@olane/o-core").oDependency[];
|
|
43
43
|
methods: {
|
|
44
|
-
[key: string]: import("@olane/o-protocol
|
|
44
|
+
[key: string]: import("@olane/o-protocol").oMethod;
|
|
45
45
|
};
|
|
46
46
|
successCount: number;
|
|
47
47
|
errorCount: number;
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
getTransports(address: oAddress): import("@
|
|
48
|
+
readonly type: import("@olane/o-core").NodeType;
|
|
49
|
+
readonly transports: string[];
|
|
50
|
+
readonly parent: oAddress | null;
|
|
51
|
+
readonly parentTransports: import("@multiformats/multiaddr", { with: { "resolution-mode": "import" } }).Multiaddr[];
|
|
52
|
+
getTransports(address: oAddress): import("@multiformats/multiaddr", { with: { "resolution-mode": "import" } }).Multiaddr[];
|
|
53
53
|
handleStaticAddressTranslation(addressInput: oAddress): Promise<oAddress>;
|
|
54
54
|
translateAddress(addressWithLeaderTransports: oAddress): Promise<{
|
|
55
55
|
nextHopAddress: oAddress;
|
|
@@ -67,4 +67,3 @@ export declare class GetTool extends GetTool_base {
|
|
|
67
67
|
constructor(config: oToolConfig);
|
|
68
68
|
}
|
|
69
69
|
export {};
|
|
70
|
-
//# sourceMappingURL=get.tool.d.ts.map
|
package/dist/storage/get.tool.js
CHANGED
|
@@ -1,11 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GetTool = void 0;
|
|
4
|
+
const o_tool_1 = require("@olane/o-tool");
|
|
5
|
+
const o_core_1 = require("@olane/o-core");
|
|
6
|
+
class GetTool extends (0, o_tool_1.oTool)(o_core_1.oVirtualNode) {
|
|
4
7
|
constructor(config) {
|
|
5
8
|
super({
|
|
6
9
|
...config,
|
|
7
|
-
address: new oAddress('o://get'),
|
|
10
|
+
address: new o_core_1.oAddress('o://get'),
|
|
8
11
|
});
|
|
9
12
|
}
|
|
10
13
|
}
|
|
11
|
-
|
|
14
|
+
exports.GetTool = GetTool;
|
|
@@ -6,13 +6,13 @@ declare const HasTool_base: (new (...args: any[]) => {
|
|
|
6
6
|
initialize(): Promise<void>;
|
|
7
7
|
use(address: oAddress, data: {
|
|
8
8
|
[key: string]: unknown;
|
|
9
|
-
}, config?: import("@olane/o-core").UseOptions): Promise<import("@olane/o-core").oResponse>;
|
|
10
|
-
handleStream(streamData: import("@
|
|
11
|
-
execute(req: import("@olane/o-core").oRequest, stream?: import("@
|
|
12
|
-
run(request: import("@olane/o-core").oRequest, stream?: import("@
|
|
9
|
+
}, config?: import("@olane/o-core").UseOptions | undefined): Promise<import("@olane/o-core").oResponse>;
|
|
10
|
+
handleStream(streamData: import("@libp2p/interface", { with: { "resolution-mode": "import" } }).IncomingStreamData): Promise<void>;
|
|
11
|
+
execute(req: import("@olane/o-core").oRequest, stream?: import("@libp2p/interface", { with: { "resolution-mode": "import" } }).Stream | undefined): Promise<import("@olane/o-tool").RunResult>;
|
|
12
|
+
run(request: import("@olane/o-core").oRequest, stream?: import("@libp2p/interface", { with: { "resolution-mode": "import" } }).Stream | undefined): Promise<import("@olane/o-tool").RunResult>;
|
|
13
13
|
myTools(): string[];
|
|
14
14
|
myToolParams(tool: string): Record<string, any>;
|
|
15
|
-
callMyTool(request: import("@olane/o-core").oRequest, stream?: import("@
|
|
15
|
+
callMyTool(request: import("@olane/o-core").oRequest, stream?: import("@libp2p/interface", { with: { "resolution-mode": "import" } }).Stream | undefined): Promise<import("@olane/o-tool").ToolResult>;
|
|
16
16
|
index(): Promise<{
|
|
17
17
|
provider: string;
|
|
18
18
|
summary: string;
|
|
@@ -25,31 +25,31 @@ declare const HasTool_base: (new (...args: any[]) => {
|
|
|
25
25
|
tools: string[];
|
|
26
26
|
description: string;
|
|
27
27
|
}>;
|
|
28
|
-
findMissingParams(methodName: string, params: any): import("@olane/o-protocol
|
|
28
|
+
findMissingParams(methodName: string, params: any): import("@olane/o-protocol").oParameter[];
|
|
29
29
|
readonly config: import("@olane/o-core").CoreConfig;
|
|
30
|
-
p2pNode: import("@
|
|
30
|
+
p2pNode: import("libp2p", { with: { "resolution-mode": "import" } }).Libp2p<import("@libp2p/interface", { with: { "resolution-mode": "import" } }).ServiceMap>;
|
|
31
31
|
logger: import("@olane/o-core").Logger;
|
|
32
|
-
networkConfig: import("@olane/o-config
|
|
32
|
+
networkConfig: import("@olane/o-config").Libp2pConfig;
|
|
33
33
|
address: oAddress;
|
|
34
34
|
readonly staticAddress: oAddress;
|
|
35
|
-
peerId: import("@
|
|
35
|
+
peerId: import("@libp2p/interface-peer-id", { with: { "resolution-mode": "import" } }).PeerId;
|
|
36
36
|
state: import("@olane/o-core").NodeState;
|
|
37
37
|
errors: Error[];
|
|
38
38
|
connectionManager: import("@olane/o-core").oConnectionManager;
|
|
39
|
-
leaders: import("@
|
|
39
|
+
leaders: import("@multiformats/multiaddr", { with: { "resolution-mode": "import" } }).Multiaddr[];
|
|
40
40
|
addressResolution: import("@olane/o-core").oAddressResolution;
|
|
41
41
|
readonly description: string;
|
|
42
42
|
dependencies: oDependency[];
|
|
43
43
|
methods: {
|
|
44
|
-
[key: string]: import("@olane/o-protocol
|
|
44
|
+
[key: string]: import("@olane/o-protocol").oMethod;
|
|
45
45
|
};
|
|
46
46
|
successCount: number;
|
|
47
47
|
errorCount: number;
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
getTransports(address: oAddress): import("@
|
|
48
|
+
readonly type: import("@olane/o-core").NodeType;
|
|
49
|
+
readonly transports: string[];
|
|
50
|
+
readonly parent: oAddress | null;
|
|
51
|
+
readonly parentTransports: import("@multiformats/multiaddr", { with: { "resolution-mode": "import" } }).Multiaddr[];
|
|
52
|
+
getTransports(address: oAddress): import("@multiformats/multiaddr", { with: { "resolution-mode": "import" } }).Multiaddr[];
|
|
53
53
|
handleStaticAddressTranslation(addressInput: oAddress): Promise<oAddress>;
|
|
54
54
|
translateAddress(addressWithLeaderTransports: oAddress): Promise<{
|
|
55
55
|
nextHopAddress: oAddress;
|
|
@@ -67,4 +67,3 @@ export declare class HasTool extends HasTool_base {
|
|
|
67
67
|
constructor(config: oToolConfig);
|
|
68
68
|
}
|
|
69
69
|
export {};
|
|
70
|
-
//# sourceMappingURL=has.tool.d.ts.map
|
package/dist/storage/has.tool.js
CHANGED
|
@@ -1,11 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.HasTool = void 0;
|
|
4
|
+
const o_tool_1 = require("@olane/o-tool");
|
|
5
|
+
const o_core_1 = require("@olane/o-core");
|
|
6
|
+
class HasTool extends (0, o_tool_1.oTool)(o_core_1.oVirtualNode) {
|
|
4
7
|
constructor(config) {
|
|
5
8
|
super({
|
|
6
9
|
...config,
|
|
7
|
-
address: new oAddress('o://has'),
|
|
10
|
+
address: new o_core_1.oAddress('o://has'),
|
|
8
11
|
});
|
|
9
12
|
}
|
|
10
13
|
}
|
|
11
|
-
|
|
14
|
+
exports.HasTool = HasTool;
|
package/dist/storage/index.d.ts
CHANGED
package/dist/storage/index.js
CHANGED
|
@@ -1,10 +1,25 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./storage.tool"), exports);
|
|
18
|
+
__exportStar(require("./providers/memory-storage-provider.tool"), exports);
|
|
19
|
+
__exportStar(require("./providers/disk-storage-provider.tool"), exports);
|
|
20
|
+
__exportStar(require("./providers/storage-provider.tool"), exports);
|
|
21
|
+
__exportStar(require("./put.tool"), exports);
|
|
22
|
+
__exportStar(require("./get.tool"), exports);
|
|
23
|
+
__exportStar(require("./delete.tool"), exports);
|
|
24
|
+
__exportStar(require("./has.tool"), exports);
|
|
25
|
+
__exportStar(require("./interfaces"), exports);
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@@ -1,2 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./get-data.response"), exports);
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.STORAGE_PARAMS = void 0;
|
|
4
|
+
exports.STORAGE_PARAMS = {
|
|
2
5
|
put: {
|
|
3
6
|
name: 'put',
|
|
4
7
|
description: 'Store data on disk',
|
|
@@ -63,4 +66,3 @@ export const STORAGE_PARAMS = {
|
|
|
63
66
|
],
|
|
64
67
|
},
|
|
65
68
|
};
|
|
66
|
-
//# sourceMappingURL=storage.methods.js.map
|
|
@@ -1,12 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DhtStorageProvider = void 0;
|
|
4
|
+
const storage_provider_tool_1 = require("./storage-provider.tool");
|
|
5
|
+
const o_core_1 = require("@olane/o-core");
|
|
6
|
+
const storage_methods_1 = require("../methods/storage.methods");
|
|
7
|
+
class DhtStorageProvider extends storage_provider_tool_1.StorageProviderTool {
|
|
5
8
|
constructor(config) {
|
|
6
9
|
super({
|
|
7
10
|
...config,
|
|
8
|
-
address: new oAddress('o://dht'),
|
|
9
|
-
methods: STORAGE_PARAMS,
|
|
11
|
+
address: new o_core_1.oAddress('o://dht'),
|
|
12
|
+
methods: storage_methods_1.STORAGE_PARAMS,
|
|
10
13
|
});
|
|
11
14
|
}
|
|
12
15
|
async _tool_put(request) {
|
|
@@ -22,4 +25,4 @@ export class DhtStorageProvider extends StorageProviderTool {
|
|
|
22
25
|
throw new Error('Not implemented');
|
|
23
26
|
}
|
|
24
27
|
}
|
|
25
|
-
|
|
28
|
+
exports.DhtStorageProvider = DhtStorageProvider;
|