@olane/o-tools-common 0.6.3 → 0.6.4
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/package.json +5 -5
- package/dist/agent/agents.tool.d.ts +0 -10
- package/dist/agent/agents.tool.d.ts.map +0 -1
- package/dist/agent/agents.tool.js +0 -20
- package/dist/agent/ai-agent.tool.d.ts +0 -6
- package/dist/agent/ai-agent.tool.d.ts.map +0 -1
- package/dist/agent/ai-agent.tool.js +0 -10
- package/dist/agent/base-agent.tool.d.ts +0 -11
- package/dist/agent/base-agent.tool.d.ts.map +0 -1
- package/dist/agent/base-agent.tool.js +0 -30
- package/dist/agent/human-agent.tool.d.ts +0 -6
- package/dist/agent/human-agent.tool.d.ts.map +0 -1
- package/dist/agent/human-agent.tool.js +0 -10
- package/dist/agent/index.d.ts +0 -5
- package/dist/agent/index.d.ts.map +0 -1
- package/dist/agent/index.js +0 -4
- package/dist/agent/interfaces/agent.config.d.ts +0 -6
- package/dist/agent/interfaces/agent.config.d.ts.map +0 -1
- package/dist/agent/interfaces/agent.config.js +0 -1
- package/dist/agent/methods/agent.methods.d.ts +0 -5
- package/dist/agent/methods/agent.methods.d.ts.map +0 -1
- package/dist/agent/methods/agent.methods.js +0 -30
- package/dist/leader/index.d.ts +0 -2
- package/dist/leader/index.d.ts.map +0 -1
- package/dist/leader/index.js +0 -1
- package/dist/leader/leader.node.d.ts +0 -10
- package/dist/leader/leader.node.d.ts.map +0 -1
- package/dist/leader/leader.node.js +0 -63
- package/dist/leader/methods/start.method.d.ts +0 -3
- package/dist/leader/methods/start.method.d.ts.map +0 -1
- package/dist/leader/methods/start.method.js +0 -21
- package/dist/plan/methods/plan.methods.d.ts +0 -5
- package/dist/plan/methods/plan.methods.d.ts.map +0 -1
- package/dist/plan/methods/plan.methods.js +0 -8
- package/dist/registry/index.d.ts +0 -3
- package/dist/registry/index.d.ts.map +0 -1
- package/dist/registry/index.js +0 -2
- package/dist/registry/interfaces/search.interface.d.ts +0 -6
- package/dist/registry/interfaces/search.interface.d.ts.map +0 -1
- package/dist/registry/interfaces/search.interface.js +0 -1
- package/dist/registry/methods/registry.methods.d.ts +0 -5
- package/dist/registry/methods/registry.methods.d.ts.map +0 -1
- package/dist/registry/methods/registry.methods.js +0 -74
- package/dist/registry/registry-memory.tool.d.ts +0 -9
- package/dist/registry/registry-memory.tool.d.ts.map +0 -1
- package/dist/registry/registry-memory.tool.js +0 -51
- package/dist/registry/registry.tool.d.ts +0 -13
- package/dist/registry/registry.tool.d.ts.map +0 -1
- package/dist/registry/registry.tool.js +0 -15
- package/dist/setup/index.d.ts +0 -3
- package/dist/setup/index.d.ts.map +0 -1
- package/dist/setup/index.js +0 -2
- package/dist/setup/methods/setup.method.d.ts +0 -5
- package/dist/setup/methods/setup.method.d.ts.map +0 -1
- package/dist/setup/methods/setup.method.js +0 -16
- package/dist/setup/setup.tool.d.ts +0 -11
- package/dist/setup/setup.tool.d.ts.map +0 -1
- package/dist/setup/setup.tool.js +0 -52
- package/dist/storage/index.d.ts +0 -8
- package/dist/storage/index.d.ts.map +0 -1
- package/dist/storage/index.js +0 -7
- package/dist/storage/interfaces/get-data.response.d.ts +0 -4
- package/dist/storage/interfaces/get-data.response.d.ts.map +0 -1
- package/dist/storage/interfaces/get-data.response.js +0 -1
- package/dist/storage/interfaces/index.d.ts +0 -2
- package/dist/storage/interfaces/index.d.ts.map +0 -1
- package/dist/storage/interfaces/index.js +0 -1
- package/dist/storage/methods/storage.methods.d.ts +0 -5
- package/dist/storage/methods/storage.methods.d.ts.map +0 -1
- package/dist/storage/methods/storage.methods.js +0 -65
- package/dist/storage/placeholder.tool.d.ts +0 -6
- package/dist/storage/placeholder.tool.d.ts.map +0 -1
- package/dist/storage/placeholder.tool.js +0 -10
- package/dist/storage/providers/dht-storage-provider.tool.d.ts +0 -12
- package/dist/storage/providers/dht-storage-provider.tool.d.ts.map +0 -1
- package/dist/storage/providers/dht-storage-provider.tool.js +0 -25
- package/dist/storage/providers/disk-storage-provider.tool.d.ts +0 -45
- package/dist/storage/providers/disk-storage-provider.tool.d.ts.map +0 -1
- package/dist/storage/providers/disk-storage-provider.tool.js +0 -134
- package/dist/storage/providers/encrypted-storage-provider.tool.d.ts +0 -1
- package/dist/storage/providers/encrypted-storage-provider.tool.d.ts.map +0 -1
- package/dist/storage/providers/encrypted-storage-provider.tool.js +0 -63
- package/dist/storage/providers/memory-storage-provider.tool.d.ts +0 -32
- package/dist/storage/providers/memory-storage-provider.tool.d.ts.map +0 -1
- package/dist/storage/providers/memory-storage-provider.tool.js +0 -65
- package/dist/storage/providers/secure-storage-provider.tool.d.ts +0 -25
- package/dist/storage/providers/secure-storage-provider.tool.d.ts.map +0 -1
- package/dist/storage/providers/secure-storage-provider.tool.js +0 -72
- package/dist/storage/providers/storage-provider.tool.d.ts +0 -11
- package/dist/storage/providers/storage-provider.tool.d.ts.map +0 -1
- package/dist/storage/providers/storage-provider.tool.js +0 -24
- package/dist/storage/storage.tool.d.ts +0 -12
- package/dist/storage/storage.tool.d.ts.map +0 -1
- package/dist/storage/storage.tool.js +0 -46
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@olane/o-tools-common",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.4",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -52,12 +52,12 @@
|
|
|
52
52
|
"typescript": "5.4.5"
|
|
53
53
|
},
|
|
54
54
|
"peerDependencies": {
|
|
55
|
-
"@olane/o-config": "^0.6.
|
|
56
|
-
"@olane/o-core": "^0.6.
|
|
55
|
+
"@olane/o-config": "^0.6.4",
|
|
56
|
+
"@olane/o-core": "^0.6.4",
|
|
57
57
|
"@olane/o-leader": "^0.6.2",
|
|
58
|
-
"@olane/o-protocol": "^0.6.
|
|
58
|
+
"@olane/o-protocol": "^0.6.4",
|
|
59
59
|
"@olane/o-storage": "^0.6.2",
|
|
60
|
-
"@olane/o-tool": "^0.6.
|
|
60
|
+
"@olane/o-tool": "^0.6.4"
|
|
61
61
|
},
|
|
62
62
|
"dependencies": {
|
|
63
63
|
"debug": "^4.4.1",
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { oToolConfig, oVirtualTool, ToolResult } from '@olane/o-tool';
|
|
2
|
-
import { oRequest } from '@olane/o-core';
|
|
3
|
-
export declare class AgentsTool extends oVirtualTool {
|
|
4
|
-
private roundRobinIndex;
|
|
5
|
-
constructor(config: oToolConfig);
|
|
6
|
-
_tool_get_agents(request: oRequest): Promise<ToolResult>;
|
|
7
|
-
_tool_get_agent(request: oRequest): Promise<ToolResult>;
|
|
8
|
-
_tool_get_agent_by_id(request: oRequest): Promise<ToolResult>;
|
|
9
|
-
}
|
|
10
|
-
//# sourceMappingURL=agents.tool.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"agents.tool.d.ts","sourceRoot":"","sources":["../../src/agent/agents.tool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AACtE,OAAO,EAAY,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEnD,qBAAa,UAAW,SAAQ,YAAY;IAC1C,OAAO,CAAC,eAAe,CAAK;gBAEhB,MAAM,EAAE,WAAW;IAOzB,gBAAgB,CAAC,OAAO,EAAE,QAAQ,GAAG,OAAO,CAAC,UAAU,CAAC;IAIxD,eAAe,CAAC,OAAO,EAAE,QAAQ,GAAG,OAAO,CAAC,UAAU,CAAC;IAIvD,qBAAqB,CAAC,OAAO,EAAE,QAAQ,GAAG,OAAO,CAAC,UAAU,CAAC;CAGpE"}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { oVirtualTool } from '@olane/o-tool';
|
|
2
|
-
import { oAddress } from '@olane/o-core';
|
|
3
|
-
export class AgentsTool extends oVirtualTool {
|
|
4
|
-
constructor(config) {
|
|
5
|
-
super({
|
|
6
|
-
...config,
|
|
7
|
-
address: new oAddress('o://agents'),
|
|
8
|
-
});
|
|
9
|
-
this.roundRobinIndex = 0;
|
|
10
|
-
}
|
|
11
|
-
async _tool_get_agents(request) {
|
|
12
|
-
throw new Error('Not implemented');
|
|
13
|
-
}
|
|
14
|
-
async _tool_get_agent(request) {
|
|
15
|
-
throw new Error('Not implemented');
|
|
16
|
-
}
|
|
17
|
-
async _tool_get_agent_by_id(request) {
|
|
18
|
-
throw new Error('Not implemented');
|
|
19
|
-
}
|
|
20
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ai-agent.tool.d.ts","sourceRoot":"","sources":["../../src/agent/ai-agent.tool.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAE5D,qBAAa,YAAa,SAAQ,UAAU;gBAC9B,MAAM,EAAE,YAAY;CAMjC"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { oVirtualTool, ToolResult } from '@olane/o-tool';
|
|
2
|
-
import { oRequest } from '@olane/o-core';
|
|
3
|
-
import { oAgentConfig } from './interfaces/agent.config.js';
|
|
4
|
-
export declare abstract class oAgentTool extends oVirtualTool {
|
|
5
|
-
protected respond: (intent: string) => Promise<string>;
|
|
6
|
-
protected answer: (intent: string) => Promise<string>;
|
|
7
|
-
constructor(config: oAgentConfig);
|
|
8
|
-
_tool_intent(request: oRequest): Promise<ToolResult>;
|
|
9
|
-
_tool_question(request: oRequest): Promise<ToolResult>;
|
|
10
|
-
}
|
|
11
|
-
//# sourceMappingURL=base-agent.tool.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"base-agent.tool.d.ts","sourceRoot":"","sources":["../../src/agent/base-agent.tool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AACzD,OAAO,EAAY,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEnD,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAE5D,8BAAsB,UAAW,SAAQ,YAAY;IACnD,SAAS,CAAC,OAAO,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;IACvD,SAAS,CAAC,MAAM,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;gBAE1C,MAAM,EAAE,YAAY;IAU1B,YAAY,CAAC,OAAO,EAAE,QAAQ,GAAG,OAAO,CAAC,UAAU,CAAC;IAWpD,cAAc,CAAC,OAAO,EAAE,QAAQ,GAAG,OAAO,CAAC,UAAU,CAAC;CAU7D"}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { oVirtualTool } from '@olane/o-tool';
|
|
2
|
-
import { oAddress } from '@olane/o-core';
|
|
3
|
-
import { AGENT_METHODS } from './methods/agent.methods.js';
|
|
4
|
-
export class oAgentTool extends oVirtualTool {
|
|
5
|
-
constructor(config) {
|
|
6
|
-
super({
|
|
7
|
-
...config,
|
|
8
|
-
address: config?.address || new oAddress('o://agent'),
|
|
9
|
-
methods: AGENT_METHODS,
|
|
10
|
-
});
|
|
11
|
-
this.respond = config.respond;
|
|
12
|
-
this.answer = config.answer;
|
|
13
|
-
}
|
|
14
|
-
async _tool_intent(request) {
|
|
15
|
-
const { intent, context } = request.params;
|
|
16
|
-
const response = await this.respond(intent);
|
|
17
|
-
return {
|
|
18
|
-
success: true,
|
|
19
|
-
resolution: response,
|
|
20
|
-
};
|
|
21
|
-
}
|
|
22
|
-
async _tool_question(request) {
|
|
23
|
-
const { question } = request.params;
|
|
24
|
-
const response = await this.answer(question);
|
|
25
|
-
return {
|
|
26
|
-
success: true,
|
|
27
|
-
answer: response,
|
|
28
|
-
};
|
|
29
|
-
}
|
|
30
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"human-agent.tool.d.ts","sourceRoot":"","sources":["../../src/agent/human-agent.tool.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAE5D,qBAAa,eAAgB,SAAQ,UAAU;gBACjC,MAAM,EAAE,YAAY;CAMjC"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { oAddress } from '@olane/o-core';
|
|
2
|
-
import { oAgentTool } from './base-agent.tool.js';
|
|
3
|
-
export class oHumanAgentTool extends oAgentTool {
|
|
4
|
-
constructor(config) {
|
|
5
|
-
super({
|
|
6
|
-
...config,
|
|
7
|
-
address: config.address || new oAddress('o://human'),
|
|
8
|
-
});
|
|
9
|
-
}
|
|
10
|
-
}
|
package/dist/agent/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/agent/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC;AACrC,cAAc,uBAAuB,CAAC;AACtC,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC"}
|
package/dist/agent/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"agent.config.d.ts","sourceRoot":"","sources":["../../../src/agent/interfaces/agent.config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C,MAAM,WAAW,YAAa,SAAQ,UAAU;IAC9C,OAAO,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;IAC7C,MAAM,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;CAC7C"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"agent.methods.d.ts","sourceRoot":"","sources":["../../../src/agent/methods/agent.methods.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAE5C,eAAO,MAAM,aAAa,EAAE;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;CA6BnD,CAAC"}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
export const AGENT_METHODS = {
|
|
2
|
-
intent: {
|
|
3
|
-
name: 'intent',
|
|
4
|
-
description: 'Agent handler for resolving an intent.',
|
|
5
|
-
parameters: [
|
|
6
|
-
{
|
|
7
|
-
name: 'intent',
|
|
8
|
-
type: 'string',
|
|
9
|
-
value: 'string',
|
|
10
|
-
description: 'The intent to resolve.',
|
|
11
|
-
required: true,
|
|
12
|
-
},
|
|
13
|
-
],
|
|
14
|
-
dependencies: [],
|
|
15
|
-
},
|
|
16
|
-
question_answer: {
|
|
17
|
-
name: 'question_answer',
|
|
18
|
-
description: 'Agent handler for answering a question.',
|
|
19
|
-
parameters: [
|
|
20
|
-
{
|
|
21
|
-
name: 'question',
|
|
22
|
-
type: 'string',
|
|
23
|
-
value: 'string',
|
|
24
|
-
description: 'The question to answer.',
|
|
25
|
-
required: true,
|
|
26
|
-
},
|
|
27
|
-
],
|
|
28
|
-
dependencies: [],
|
|
29
|
-
},
|
|
30
|
-
};
|
package/dist/leader/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/leader/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC"}
|
package/dist/leader/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './leader.node.js';
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { oRequest } from '@olane/o-core';
|
|
2
|
-
import { oServerTool, oToolConfig } from '@olane/o-tool';
|
|
3
|
-
export declare class oLeaderNode extends oServerTool {
|
|
4
|
-
constructor(config: oToolConfig);
|
|
5
|
-
validateJoinRequest(request: oRequest): Promise<any>;
|
|
6
|
-
_tool_join_network(request: oRequest): Promise<any>;
|
|
7
|
-
_tool_save_plan(request: oRequest): Promise<any>;
|
|
8
|
-
_tool_index_network(request: oRequest): Promise<any>;
|
|
9
|
-
}
|
|
10
|
-
//# sourceMappingURL=leader.node.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"leader.node.d.ts","sourceRoot":"","sources":["../../src/leader/leader.node.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,QAAQ,EAET,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAGzD,qBAAa,WAAY,SAAQ,WAAW;gBAC9B,MAAM,EAAE,WAAW;IAWzB,mBAAmB,CAAC,OAAO,EAAE,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC;IAIpD,kBAAkB,CAAC,OAAO,EAAE,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC;IAuBnD,eAAe,CAAC,OAAO,EAAE,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC;IAUhD,mBAAmB,CAAC,OAAO,EAAE,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC;CA2B3D"}
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
import { LEADER_ADRESS, NodeType, oAddress, } from '@olane/o-core';
|
|
2
|
-
import { oServerTool } from '@olane/o-tool';
|
|
3
|
-
import { START_METHOD } from './methods/start.method.js';
|
|
4
|
-
export class oLeaderNode extends oServerTool {
|
|
5
|
-
constructor(config) {
|
|
6
|
-
super({
|
|
7
|
-
...config,
|
|
8
|
-
address: new oAddress(LEADER_ADRESS),
|
|
9
|
-
type: NodeType.LEADER,
|
|
10
|
-
methods: {
|
|
11
|
-
start: START_METHOD,
|
|
12
|
-
},
|
|
13
|
-
});
|
|
14
|
-
}
|
|
15
|
-
async validateJoinRequest(request) {
|
|
16
|
-
return true;
|
|
17
|
-
}
|
|
18
|
-
async _tool_join_network(request) {
|
|
19
|
-
const { caller, parent, transports } = request.params;
|
|
20
|
-
this.logger.debug('Joining network: ' + caller);
|
|
21
|
-
if (!caller || !parent || !transports) {
|
|
22
|
-
throw new Error('Invalid parameters provided, cannot join network');
|
|
23
|
-
}
|
|
24
|
-
await this.validateJoinRequest(request);
|
|
25
|
-
await this.use(new oAddress(parent), {
|
|
26
|
-
method: 'add_child',
|
|
27
|
-
params: {
|
|
28
|
-
address: caller,
|
|
29
|
-
transports: transports,
|
|
30
|
-
},
|
|
31
|
-
});
|
|
32
|
-
return {
|
|
33
|
-
message: 'Network joined!',
|
|
34
|
-
};
|
|
35
|
-
}
|
|
36
|
-
async _tool_save_plan(request) {
|
|
37
|
-
const { plan } = request.params;
|
|
38
|
-
this.logger.debug('Adding plan to network: ' + plan);
|
|
39
|
-
if (!this.config.networkName) {
|
|
40
|
-
this.logger.warn('No network name provided, cannot update config');
|
|
41
|
-
return;
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
async _tool_index_network(request) {
|
|
45
|
-
// paginate through all the registered nodes and index them
|
|
46
|
-
const nodes = await this.use(new oAddress('o://leader/register'), {
|
|
47
|
-
method: 'find_all',
|
|
48
|
-
params: {},
|
|
49
|
-
});
|
|
50
|
-
const nodesArray = nodes.result.data;
|
|
51
|
-
for (let i = 0; i < nodesArray.length; i++) {
|
|
52
|
-
// first let's get the node's tools
|
|
53
|
-
const node = nodesArray[i];
|
|
54
|
-
const { result } = await this.use(new oAddress(node.address), {
|
|
55
|
-
method: 'index_network',
|
|
56
|
-
params: {},
|
|
57
|
-
});
|
|
58
|
-
}
|
|
59
|
-
return {
|
|
60
|
-
message: 'Network indexed!',
|
|
61
|
-
};
|
|
62
|
-
}
|
|
63
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"start.method.d.ts","sourceRoot":"","sources":["../../../src/leader/methods/start.method.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAE5C,eAAO,MAAM,YAAY,EAAE,OAoB1B,CAAC"}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
export const START_METHOD = {
|
|
2
|
-
name: 'intent',
|
|
3
|
-
description: 'Resolve the intent of the task',
|
|
4
|
-
dependencies: [],
|
|
5
|
-
parameters: [
|
|
6
|
-
{
|
|
7
|
-
name: 'intent',
|
|
8
|
-
type: 'string',
|
|
9
|
-
value: 'string',
|
|
10
|
-
description: 'The intent of the task',
|
|
11
|
-
required: true,
|
|
12
|
-
},
|
|
13
|
-
{
|
|
14
|
-
name: 'context',
|
|
15
|
-
type: 'string',
|
|
16
|
-
value: 'string',
|
|
17
|
-
description: 'The user input to the task',
|
|
18
|
-
required: false,
|
|
19
|
-
},
|
|
20
|
-
],
|
|
21
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"plan.methods.d.ts","sourceRoot":"","sources":["../../../src/plan/methods/plan.methods.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAE5C,eAAO,MAAM,UAAU,EAAE;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;CAOhD,CAAC"}
|
package/dist/registry/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/registry/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,2BAA2B,CAAC"}
|
package/dist/registry/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"search.interface.d.ts","sourceRoot":"","sources":["../../../src/registry/interfaces/search.interface.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,qBAAqB;IACpC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;IACrB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"registry.methods.d.ts","sourceRoot":"","sources":["../../../src/registry/methods/registry.methods.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAE5C,eAAO,MAAM,eAAe,EAAE;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;CAyErD,CAAC"}
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
export const REGISTRY_PARAMS = {
|
|
2
|
-
commit: {
|
|
3
|
-
name: 'commit',
|
|
4
|
-
description: 'Commit a node to the registry',
|
|
5
|
-
dependencies: [],
|
|
6
|
-
parameters: [
|
|
7
|
-
{
|
|
8
|
-
name: 'peerId',
|
|
9
|
-
type: 'string',
|
|
10
|
-
value: 'string',
|
|
11
|
-
description: 'The peerId to commit',
|
|
12
|
-
required: true,
|
|
13
|
-
},
|
|
14
|
-
{
|
|
15
|
-
name: 'address',
|
|
16
|
-
type: 'string',
|
|
17
|
-
value: 'string',
|
|
18
|
-
description: 'The address to commit',
|
|
19
|
-
},
|
|
20
|
-
{
|
|
21
|
-
name: 'protocols',
|
|
22
|
-
type: 'array',
|
|
23
|
-
value: 'string[]',
|
|
24
|
-
description: 'The protocols to commit',
|
|
25
|
-
},
|
|
26
|
-
{
|
|
27
|
-
name: 'transports',
|
|
28
|
-
type: 'array',
|
|
29
|
-
value: 'string[]',
|
|
30
|
-
description: 'The transports to commit',
|
|
31
|
-
},
|
|
32
|
-
{
|
|
33
|
-
name: 'staticAddress',
|
|
34
|
-
type: 'string',
|
|
35
|
-
value: 'string',
|
|
36
|
-
description: 'The static address to commit',
|
|
37
|
-
},
|
|
38
|
-
],
|
|
39
|
-
},
|
|
40
|
-
search: {
|
|
41
|
-
name: 'search',
|
|
42
|
-
description: 'Search for a node in the registry using simple query logic.',
|
|
43
|
-
dependencies: [],
|
|
44
|
-
parameters: [
|
|
45
|
-
{
|
|
46
|
-
name: 'staticAddress',
|
|
47
|
-
type: 'string',
|
|
48
|
-
value: 'string',
|
|
49
|
-
description: 'The static address to search for',
|
|
50
|
-
required: false,
|
|
51
|
-
},
|
|
52
|
-
{
|
|
53
|
-
name: 'protocols',
|
|
54
|
-
type: 'array',
|
|
55
|
-
value: 'string[]',
|
|
56
|
-
description: 'The protocols to search for',
|
|
57
|
-
required: false,
|
|
58
|
-
},
|
|
59
|
-
{
|
|
60
|
-
name: 'address',
|
|
61
|
-
type: 'string',
|
|
62
|
-
value: 'string',
|
|
63
|
-
description: 'The address to search for',
|
|
64
|
-
required: false,
|
|
65
|
-
},
|
|
66
|
-
],
|
|
67
|
-
},
|
|
68
|
-
find_all: {
|
|
69
|
-
name: 'find_all',
|
|
70
|
-
description: 'Find all nodes in the registry',
|
|
71
|
-
dependencies: [],
|
|
72
|
-
parameters: [],
|
|
73
|
-
},
|
|
74
|
-
};
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { RegistryTool } from './registry.tool.js';
|
|
2
|
-
import { oRequest } from '@olane/o-core';
|
|
3
|
-
export declare class RegistryMemoryTool extends RegistryTool {
|
|
4
|
-
_tool_commit(request: oRequest): Promise<any>;
|
|
5
|
-
_tool_find_all(request: oRequest): Promise<any>;
|
|
6
|
-
_tool_search(request: oRequest): Promise<any>;
|
|
7
|
-
_tool_remove(request: oRequest): Promise<any>;
|
|
8
|
-
}
|
|
9
|
-
//# sourceMappingURL=registry-memory.tool.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"registry-memory.tool.d.ts","sourceRoot":"","sources":["../../src/registry/registry-memory.tool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAElD,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAGzC,qBAAa,kBAAmB,SAAQ,YAAY;IAC5C,YAAY,CAAC,OAAO,EAAE,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC;IAuB7C,cAAc,CAAC,OAAO,EAAE,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC;IAI/C,YAAY,CAAC,OAAO,EAAE,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC;IA8B7C,YAAY,CAAC,OAAO,EAAE,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC;CAOpD"}
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import { RegistryTool } from './registry.tool.js';
|
|
2
|
-
export class RegistryMemoryTool extends RegistryTool {
|
|
3
|
-
async _tool_commit(request) {
|
|
4
|
-
const params = request.params;
|
|
5
|
-
this.logger.debug('Committing registration: ', params?.address, 'With num protocols: ', params?.protocols?.length);
|
|
6
|
-
// TODO: Implement TTL
|
|
7
|
-
this.registry.set(params.peerId, params);
|
|
8
|
-
if (params.protocols) {
|
|
9
|
-
params.protocols.forEach((protocol) => {
|
|
10
|
-
this.protocolMapping.set(protocol, [
|
|
11
|
-
...(this.protocolMapping.get(protocol) || []),
|
|
12
|
-
params.peerId,
|
|
13
|
-
]);
|
|
14
|
-
});
|
|
15
|
-
}
|
|
16
|
-
return {
|
|
17
|
-
success: true,
|
|
18
|
-
};
|
|
19
|
-
}
|
|
20
|
-
async _tool_find_all(request) {
|
|
21
|
-
return Array.from(this.registry.values());
|
|
22
|
-
}
|
|
23
|
-
async _tool_search(request) {
|
|
24
|
-
const params = request.params;
|
|
25
|
-
// iterate over the registry and find all the nodes that match the protocols
|
|
26
|
-
let result = [];
|
|
27
|
-
if (params.protocols) {
|
|
28
|
-
result = result.concat(Array.from(this.registry.values()).filter((node) => {
|
|
29
|
-
return params.protocols?.every((protocol) => node.protocols.includes(protocol));
|
|
30
|
-
}));
|
|
31
|
-
}
|
|
32
|
-
if (params.address) {
|
|
33
|
-
result = result.concat(Array.from(this.registry.values()).filter((node) => {
|
|
34
|
-
return node.address === params.address;
|
|
35
|
-
}));
|
|
36
|
-
}
|
|
37
|
-
if (params.staticAddress) {
|
|
38
|
-
result = result.concat(Array.from(this.registry.values()).filter((node) => {
|
|
39
|
-
return node.staticAddress === params.staticAddress;
|
|
40
|
-
}));
|
|
41
|
-
}
|
|
42
|
-
return result;
|
|
43
|
-
}
|
|
44
|
-
async _tool_remove(request) {
|
|
45
|
-
const params = request.params;
|
|
46
|
-
this.registry.delete(params.peerId);
|
|
47
|
-
return {
|
|
48
|
-
success: true,
|
|
49
|
-
};
|
|
50
|
-
}
|
|
51
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { oToolConfig, oVirtualTool, ToolResult } from '@olane/o-tool';
|
|
2
|
-
import { oRegistrationParams } from '@olane/o-protocol';
|
|
3
|
-
import { oRequest } from '@olane/o-core';
|
|
4
|
-
export declare abstract class RegistryTool extends oVirtualTool {
|
|
5
|
-
protected readonly registry: Map<string, oRegistrationParams>;
|
|
6
|
-
protected readonly protocolMapping: Map<string, string[]>;
|
|
7
|
-
constructor(config: oToolConfig);
|
|
8
|
-
abstract _tool_commit(request: oRequest): Promise<ToolResult>;
|
|
9
|
-
abstract _tool_search(request: oRequest): Promise<ToolResult>;
|
|
10
|
-
abstract _tool_find_all(request: oRequest): Promise<ToolResult>;
|
|
11
|
-
abstract _tool_remove(request: oRequest): Promise<ToolResult>;
|
|
12
|
-
}
|
|
13
|
-
//# sourceMappingURL=registry.tool.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"registry.tool.d.ts","sourceRoot":"","sources":["../../src/registry/registry.tool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AACtE,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,EAAY,QAAQ,EAAE,MAAM,eAAe,CAAC;AAGnD,8BAAsB,YAAa,SAAQ,YAAY;IACrD,SAAS,CAAC,QAAQ,CAAC,QAAQ,EAAE,GAAG,CAAC,MAAM,EAAE,mBAAmB,CAAC,CAAa;IAC1E,SAAS,CAAC,QAAQ,CAAC,eAAe,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAa;gBAE1D,MAAM,EAAE,WAAW;IAS/B,QAAQ,CAAC,YAAY,CAAC,OAAO,EAAE,QAAQ,GAAG,OAAO,CAAC,UAAU,CAAC;IAC7D,QAAQ,CAAC,YAAY,CAAC,OAAO,EAAE,QAAQ,GAAG,OAAO,CAAC,UAAU,CAAC;IAC7D,QAAQ,CAAC,cAAc,CAAC,OAAO,EAAE,QAAQ,GAAG,OAAO,CAAC,UAAU,CAAC;IAC/D,QAAQ,CAAC,YAAY,CAAC,OAAO,EAAE,QAAQ,GAAG,OAAO,CAAC,UAAU,CAAC;CAC9D"}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { oVirtualTool } from '@olane/o-tool';
|
|
2
|
-
import { oAddress } from '@olane/o-core';
|
|
3
|
-
import { REGISTRY_PARAMS } from './methods/registry.methods.js';
|
|
4
|
-
export class RegistryTool extends oVirtualTool {
|
|
5
|
-
constructor(config) {
|
|
6
|
-
super({
|
|
7
|
-
...config,
|
|
8
|
-
address: new oAddress('o://register'),
|
|
9
|
-
methods: REGISTRY_PARAMS,
|
|
10
|
-
description: 'Network registry of tools and their respective addresses',
|
|
11
|
-
});
|
|
12
|
-
this.registry = new Map();
|
|
13
|
-
this.protocolMapping = new Map();
|
|
14
|
-
}
|
|
15
|
-
}
|
package/dist/setup/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/setup/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,2BAA2B,CAAC"}
|
package/dist/setup/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"setup.method.d.ts","sourceRoot":"","sources":["../../../src/setup/methods/setup.method.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAE5C,eAAO,MAAM,aAAa,EAAE;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;CAenD,CAAC"}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
export const SETUP_METHODS = {
|
|
2
|
-
validate: {
|
|
3
|
-
name: 'validate',
|
|
4
|
-
description: 'Validate the setup of the tool',
|
|
5
|
-
dependencies: [],
|
|
6
|
-
parameters: [
|
|
7
|
-
{
|
|
8
|
-
name: 'address',
|
|
9
|
-
type: 'string',
|
|
10
|
-
value: 'string',
|
|
11
|
-
description: 'The address of the tool to validate',
|
|
12
|
-
required: false,
|
|
13
|
-
},
|
|
14
|
-
],
|
|
15
|
-
},
|
|
16
|
-
};
|