@olane/o-tool-registry 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/apple/apple.tool.d.ts +16 -16
- package/dist/apple/apple.tool.d.ts.map +1 -1
- package/dist/apple/apple.tool.js +8 -5
- package/dist/apple/index.d.ts +1 -0
- package/dist/apple/index.js +2 -1
- package/dist/apple/notes.tool.d.ts +16 -16
- package/dist/apple/notes.tool.d.ts.map +1 -1
- package/dist/apple/notes.tool.js +36 -9
- package/dist/auth/index.js +19 -4
- package/dist/auth/interfaces/index.js +19 -4
- package/dist/auth/interfaces/oAuth-tokens.interface.js +2 -2
- package/dist/auth/interfaces/oAuth-user-info.interface.js +2 -2
- package/dist/auth/interfaces/oAuth.config.js +2 -2
- package/dist/auth/methods/auth.methods.js +4 -2
- package/dist/auth/oAuth.tool.js +23 -10
- package/dist/embeddings/embeddings.tool.d.ts +16 -16
- package/dist/embeddings/embeddings.tool.d.ts.map +1 -1
- package/dist/embeddings/embeddings.tool.js +8 -5
- package/dist/embeddings/huggingface-text-embeddings.tool.d.ts.map +1 -1
- package/dist/embeddings/huggingface-text-embeddings.tool.js +9 -6
- package/dist/embeddings/index.js +19 -4
- package/dist/embeddings/methods/text-embeddings.method.js +4 -2
- package/dist/embeddings/text-embeddings.tool.d.ts +16 -16
- package/dist/embeddings/text-embeddings.tool.d.ts.map +1 -1
- package/dist/embeddings/text-embeddings.tool.js +10 -7
- package/dist/index.js +22 -7
- package/dist/init.d.ts.map +1 -1
- package/dist/init.js +15 -12
- package/dist/intelligence/anthropic-intelligence.tool.d.ts +46 -16
- package/dist/intelligence/anthropic-intelligence.tool.d.ts.map +1 -1
- package/dist/intelligence/anthropic-intelligence.tool.js +45 -11
- package/dist/intelligence/gemini-intelligence.tool.d.ts +31 -16
- package/dist/intelligence/gemini-intelligence.tool.d.ts.map +1 -1
- package/dist/intelligence/gemini-intelligence.tool.js +31 -11
- package/dist/intelligence/index.js +21 -6
- package/dist/intelligence/intelligence.tool.d.ts +16 -16
- package/dist/intelligence/intelligence.tool.d.ts.map +1 -1
- package/dist/intelligence/intelligence.tool.js +26 -18
- package/dist/intelligence/methods/intelligence.methods.js +4 -2
- package/dist/intelligence/ollama-intelligence.tool.d.ts +37 -16
- package/dist/intelligence/ollama-intelligence.tool.d.ts.map +1 -1
- package/dist/intelligence/ollama-intelligence.tool.js +39 -11
- package/dist/intelligence/openai-intelligence.tool.d.ts +31 -16
- package/dist/intelligence/openai-intelligence.tool.d.ts.map +1 -1
- package/dist/intelligence/openai-intelligence.tool.js +32 -11
- package/dist/intelligence/perplexity-intelligence.tool.d.ts +31 -16
- package/dist/intelligence/perplexity-intelligence.tool.d.ts.map +1 -1
- package/dist/intelligence/perplexity-intelligence.tool.js +33 -11
- package/dist/mcp/index.js +18 -3
- package/dist/mcp/mcp-bridge.tool.d.ts +16 -16
- package/dist/mcp/mcp-bridge.tool.d.ts.map +1 -1
- package/dist/mcp/mcp-bridge.tool.js +36 -19
- package/dist/mcp/mcp.tool.d.ts +14 -14
- package/dist/mcp/mcp.tool.d.ts.map +1 -1
- package/dist/mcp/mcp.tool.js +15 -7
- package/dist/mcp/methods/mcp-bridge.methods.js +4 -2
- package/dist/nlp/index.js +17 -2
- package/dist/nlp/methods/nlp.methods.js +4 -2
- package/dist/nlp/ner.tool.d.ts +16 -16
- package/dist/nlp/ner.tool.d.ts.map +1 -1
- package/dist/nlp/ner.tool.js +11 -8
- package/dist/vector-store/index.js +18 -3
- package/dist/vector-store/langchain-memory.vector-store.tool.d.ts.map +1 -1
- package/dist/vector-store/langchain-memory.vector-store.tool.js +13 -10
- package/dist/vector-store/methods/vector-store.methods.js +4 -2
- package/dist/vector-store/vector-memory.tool.d.ts +16 -16
- package/dist/vector-store/vector-memory.tool.d.ts.map +1 -1
- package/dist/vector-store/vector-memory.tool.js +10 -7
- package/package.json +14 -21
- package/dist/apple/apple.tool.js.map +0 -1
- package/dist/apple/index.js.map +0 -1
- package/dist/apple/notes.tool.js.map +0 -1
- package/dist/auth/index.js.map +0 -1
- package/dist/auth/interfaces/index.js.map +0 -1
- package/dist/auth/interfaces/oAuth-tokens.interface.js.map +0 -1
- package/dist/auth/interfaces/oAuth-user-info.interface.js.map +0 -1
- package/dist/auth/interfaces/oAuth.config.js.map +0 -1
- package/dist/auth/methods/auth.methods.js.map +0 -1
- package/dist/auth/oAuth.tool.js.map +0 -1
- package/dist/embeddings/embeddings.tool.js.map +0 -1
- package/dist/embeddings/huggingface-text-embeddings.tool.js.map +0 -1
- package/dist/embeddings/index.js.map +0 -1
- package/dist/embeddings/methods/text-embeddings.method.js.map +0 -1
- package/dist/embeddings/text-embeddings.tool.js.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/init.js.map +0 -1
- package/dist/intelligence/anthropic-intelligence.tool.js.map +0 -1
- package/dist/intelligence/gemini-intelligence.tool.js.map +0 -1
- package/dist/intelligence/index.js.map +0 -1
- package/dist/intelligence/intelligence.tool.js.map +0 -1
- package/dist/intelligence/methods/intelligence.methods.js.map +0 -1
- package/dist/intelligence/ollama-intelligence.tool.js.map +0 -1
- package/dist/intelligence/openai-intelligence.tool.js.map +0 -1
- package/dist/intelligence/perplexity-intelligence.tool.js.map +0 -1
- package/dist/mcp/index.js.map +0 -1
- package/dist/mcp/mcp-bridge.tool.js.map +0 -1
- package/dist/mcp/mcp.tool.js.map +0 -1
- package/dist/mcp/methods/mcp-bridge.methods.js.map +0 -1
- package/dist/nlp/index.js.map +0 -1
- package/dist/nlp/methods/nlp.methods.js.map +0 -1
- package/dist/nlp/ner.tool.js.map +0 -1
- package/dist/tsconfig.tsbuildinfo +0 -1
- package/dist/vector-store/index.js.map +0 -1
- package/dist/vector-store/langchain-memory.vector-store.tool.js.map +0 -1
- package/dist/vector-store/methods/vector-store.methods.js.map +0 -1
- package/dist/vector-store/vector-memory.tool.js.map +0 -1
|
@@ -6,13 +6,13 @@ declare const OpenAIIntelligenceTool_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: oRequest, stream?: import("@
|
|
12
|
-
run(request: 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: oRequest, stream?: import("@libp2p/interface", { with: { "resolution-mode": "import" } }).Stream | undefined): Promise<import("@olane/o-tool").RunResult>;
|
|
12
|
+
run(request: 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: oRequest, stream?: import("@
|
|
15
|
+
callMyTool(request: oRequest, stream?: import("@libp2p/interface", { with: { "resolution-mode": "import" } }).Stream | undefined): Promise<ToolResult>;
|
|
16
16
|
index(): Promise<{
|
|
17
17
|
provider: string;
|
|
18
18
|
summary: string;
|
|
@@ -25,31 +25,31 @@ declare const OpenAIIntelligenceTool_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;
|
|
@@ -69,10 +69,25 @@ export declare class OpenAIIntelligenceTool extends OpenAIIntelligenceTool_base
|
|
|
69
69
|
private defaultModel;
|
|
70
70
|
private organization?;
|
|
71
71
|
constructor(config: oToolConfig);
|
|
72
|
+
/**
|
|
73
|
+
* Chat completion with OpenAI
|
|
74
|
+
*/
|
|
72
75
|
_tool_completion(request: oRequest): Promise<ToolResult>;
|
|
76
|
+
/**
|
|
77
|
+
* Generate text with OpenAI
|
|
78
|
+
*/
|
|
73
79
|
_tool_generate(request: oRequest): Promise<ToolResult>;
|
|
80
|
+
/**
|
|
81
|
+
* List available models
|
|
82
|
+
*/
|
|
74
83
|
_tool_list_models(request: oRequest): Promise<ToolResult>;
|
|
84
|
+
/**
|
|
85
|
+
* Get model information
|
|
86
|
+
*/
|
|
75
87
|
_tool_model_info(request: oRequest): Promise<ToolResult>;
|
|
88
|
+
/**
|
|
89
|
+
* Check OpenAI API status
|
|
90
|
+
*/
|
|
76
91
|
_tool_status(request: oRequest): Promise<ToolResult>;
|
|
77
92
|
}
|
|
78
93
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"openai-intelligence.tool.d.ts","sourceRoot":"","sources":["../../src/intelligence/openai-intelligence.tool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AACjE,OAAO,EAAS,WAAW,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC
|
|
1
|
+
{"version":3,"file":"openai-intelligence.tool.d.ts","sourceRoot":"","sources":["../../src/intelligence/openai-intelligence.tool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AACjE,OAAO,EAAS,WAAW,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoH/D,qBAAa,sBAAuB,SAAQ,2BAAmB;IAC7D,OAAO,CAAC,MAAM,CAAU;IACxB,OAAO,CAAC,OAAO,CAAU;IACzB,OAAO,CAAC,YAAY,CAAU;IAC9B,OAAO,CAAC,YAAY,CAAC,CAAS;gBAElB,MAAM,EAAE,WAAW;IAU/B;;OAEG;IACG,gBAAgB,CAAC,OAAO,EAAE,QAAQ,GAAG,OAAO,CAAC,UAAU,CAAC;IAoE9D;;OAEG;IACG,cAAc,CAAC,OAAO,EAAE,QAAQ,GAAG,OAAO,CAAC,UAAU,CAAC;IAmE5D;;OAEG;IACG,iBAAiB,CAAC,OAAO,EAAE,QAAQ,GAAG,OAAO,CAAC,UAAU,CAAC;IA6C/D;;OAEG;IACG,gBAAgB,CAAC,OAAO,EAAE,QAAQ,GAAG,OAAO,CAAC,UAAU,CAAC;IA+C9D;;OAEG;IACG,YAAY,CAAC,OAAO,EAAE,QAAQ,GAAG,OAAO,CAAC,UAAU,CAAC;CAoC3D"}
|
|
@@ -1,7 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.OpenAIIntelligenceTool = void 0;
|
|
4
|
+
const o_core_1 = require("@olane/o-core");
|
|
5
|
+
const o_tool_1 = require("@olane/o-tool");
|
|
6
|
+
const intelligence_methods_1 = require("./methods/intelligence.methods");
|
|
7
|
+
class OpenAIIntelligenceTool extends (0, o_tool_1.oTool)(o_core_1.oVirtualNode) {
|
|
5
8
|
apiKey;
|
|
6
9
|
baseUrl;
|
|
7
10
|
defaultModel;
|
|
@@ -9,12 +12,15 @@ export class OpenAIIntelligenceTool extends oTool(oVirtualNode) {
|
|
|
9
12
|
constructor(config) {
|
|
10
13
|
super({
|
|
11
14
|
...config,
|
|
12
|
-
address: new oAddress('o://openai'),
|
|
15
|
+
address: new o_core_1.oAddress('o://openai'),
|
|
13
16
|
description: "Open AI's suite of intelligence models.",
|
|
14
|
-
methods: INTELLIGENCE_PARAMS,
|
|
17
|
+
methods: intelligence_methods_1.INTELLIGENCE_PARAMS,
|
|
15
18
|
dependencies: [],
|
|
16
19
|
});
|
|
17
20
|
}
|
|
21
|
+
/**
|
|
22
|
+
* Chat completion with OpenAI
|
|
23
|
+
*/
|
|
18
24
|
async _tool_completion(request) {
|
|
19
25
|
try {
|
|
20
26
|
const params = request.params;
|
|
@@ -56,7 +62,7 @@ export class OpenAIIntelligenceTool extends oTool(oVirtualNode) {
|
|
|
56
62
|
error: `OpenAI API error: ${response.status} - ${errorText}`,
|
|
57
63
|
};
|
|
58
64
|
}
|
|
59
|
-
const result = await response.json();
|
|
65
|
+
const result = (await response.json());
|
|
60
66
|
return {
|
|
61
67
|
success: true,
|
|
62
68
|
response: result.choices[0]?.message?.content || '',
|
|
@@ -73,6 +79,9 @@ export class OpenAIIntelligenceTool extends oTool(oVirtualNode) {
|
|
|
73
79
|
};
|
|
74
80
|
}
|
|
75
81
|
}
|
|
82
|
+
/**
|
|
83
|
+
* Generate text with OpenAI
|
|
84
|
+
*/
|
|
76
85
|
async _tool_generate(request) {
|
|
77
86
|
try {
|
|
78
87
|
const params = request.params;
|
|
@@ -99,6 +108,9 @@ export class OpenAIIntelligenceTool extends oTool(oVirtualNode) {
|
|
|
99
108
|
'Content-Type': 'application/json',
|
|
100
109
|
Authorization: `Bearer ${this.apiKey}`,
|
|
101
110
|
};
|
|
111
|
+
// if (this.organization) {
|
|
112
|
+
// headers['OpenAI-Organization'] = this.organization;
|
|
113
|
+
// }
|
|
102
114
|
const response = await fetch(`${this.baseUrl}/completions`, {
|
|
103
115
|
method: 'POST',
|
|
104
116
|
headers,
|
|
@@ -111,7 +123,7 @@ export class OpenAIIntelligenceTool extends oTool(oVirtualNode) {
|
|
|
111
123
|
error: `OpenAI API error: ${response.status} - ${errorText}`,
|
|
112
124
|
};
|
|
113
125
|
}
|
|
114
|
-
const result = await response.json();
|
|
126
|
+
const result = (await response.json());
|
|
115
127
|
return {
|
|
116
128
|
success: true,
|
|
117
129
|
response: result.choices[0]?.text || '',
|
|
@@ -127,6 +139,9 @@ export class OpenAIIntelligenceTool extends oTool(oVirtualNode) {
|
|
|
127
139
|
};
|
|
128
140
|
}
|
|
129
141
|
}
|
|
142
|
+
/**
|
|
143
|
+
* List available models
|
|
144
|
+
*/
|
|
130
145
|
async _tool_list_models(request) {
|
|
131
146
|
try {
|
|
132
147
|
if (!this.apiKey) {
|
|
@@ -152,7 +167,7 @@ export class OpenAIIntelligenceTool extends oTool(oVirtualNode) {
|
|
|
152
167
|
error: `OpenAI API error: ${response.status} - ${errorText}`,
|
|
153
168
|
};
|
|
154
169
|
}
|
|
155
|
-
const result = await response.json();
|
|
170
|
+
const result = (await response.json());
|
|
156
171
|
return {
|
|
157
172
|
success: true,
|
|
158
173
|
models: result.data,
|
|
@@ -165,6 +180,9 @@ export class OpenAIIntelligenceTool extends oTool(oVirtualNode) {
|
|
|
165
180
|
};
|
|
166
181
|
}
|
|
167
182
|
}
|
|
183
|
+
/**
|
|
184
|
+
* Get model information
|
|
185
|
+
*/
|
|
168
186
|
async _tool_model_info(request) {
|
|
169
187
|
try {
|
|
170
188
|
const params = request.params;
|
|
@@ -192,7 +210,7 @@ export class OpenAIIntelligenceTool extends oTool(oVirtualNode) {
|
|
|
192
210
|
error: `OpenAI API error: ${response.status} - ${errorText}`,
|
|
193
211
|
};
|
|
194
212
|
}
|
|
195
|
-
const result = await response.json();
|
|
213
|
+
const result = (await response.json());
|
|
196
214
|
return {
|
|
197
215
|
success: true,
|
|
198
216
|
model_info: result,
|
|
@@ -205,6 +223,9 @@ export class OpenAIIntelligenceTool extends oTool(oVirtualNode) {
|
|
|
205
223
|
};
|
|
206
224
|
}
|
|
207
225
|
}
|
|
226
|
+
/**
|
|
227
|
+
* Check OpenAI API status
|
|
228
|
+
*/
|
|
208
229
|
async _tool_status(request) {
|
|
209
230
|
try {
|
|
210
231
|
if (!this.apiKey) {
|
|
@@ -239,4 +260,4 @@ export class OpenAIIntelligenceTool extends oTool(oVirtualNode) {
|
|
|
239
260
|
}
|
|
240
261
|
}
|
|
241
262
|
}
|
|
242
|
-
|
|
263
|
+
exports.OpenAIIntelligenceTool = OpenAIIntelligenceTool;
|
|
@@ -6,13 +6,13 @@ declare const PerplexityIntelligenceTool_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: oRequest, stream?: import("@
|
|
12
|
-
run(request: 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: oRequest, stream?: import("@libp2p/interface", { with: { "resolution-mode": "import" } }).Stream | undefined): Promise<import("@olane/o-tool").RunResult>;
|
|
12
|
+
run(request: 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: oRequest, stream?: import("@
|
|
15
|
+
callMyTool(request: oRequest, stream?: import("@libp2p/interface", { with: { "resolution-mode": "import" } }).Stream | undefined): Promise<ToolResult>;
|
|
16
16
|
index(): Promise<{
|
|
17
17
|
provider: string;
|
|
18
18
|
summary: string;
|
|
@@ -25,31 +25,31 @@ declare const PerplexityIntelligenceTool_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;
|
|
@@ -66,10 +66,25 @@ declare const PerplexityIntelligenceTool_base: (new (...args: any[]) => {
|
|
|
66
66
|
export declare class PerplexityIntelligenceTool extends PerplexityIntelligenceTool_base {
|
|
67
67
|
private defaultModel;
|
|
68
68
|
constructor(config: oToolConfig);
|
|
69
|
+
/**
|
|
70
|
+
* Chat completion with Perplexity
|
|
71
|
+
*/
|
|
69
72
|
_tool_completion(request: oRequest): Promise<ToolResult>;
|
|
73
|
+
/**
|
|
74
|
+
* Generate text with Perplexity (alias for completion)
|
|
75
|
+
*/
|
|
70
76
|
_tool_generate(request: oRequest): Promise<ToolResult>;
|
|
77
|
+
/**
|
|
78
|
+
* List available models
|
|
79
|
+
*/
|
|
71
80
|
_tool_list_models(request: oRequest): Promise<ToolResult>;
|
|
81
|
+
/**
|
|
82
|
+
* Search with Perplexity
|
|
83
|
+
*/
|
|
72
84
|
_tool_search(request: oRequest): Promise<ToolResult>;
|
|
85
|
+
/**
|
|
86
|
+
* Check Perplexity API status
|
|
87
|
+
*/
|
|
73
88
|
_tool_status(request: oRequest): Promise<ToolResult>;
|
|
74
89
|
}
|
|
75
90
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"perplexity-intelligence.tool.d.ts","sourceRoot":"","sources":["../../src/intelligence/perplexity-intelligence.tool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AACjE,OAAO,EAAS,WAAW,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC
|
|
1
|
+
{"version":3,"file":"perplexity-intelligence.tool.d.ts","sourceRoot":"","sources":["../../src/intelligence/perplexity-intelligence.tool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AACjE,OAAO,EAAS,WAAW,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqF/D,qBAAa,0BAA2B,SAAQ,+BAAmB;IACjE,OAAO,CAAC,YAAY,CAAU;gBAElB,MAAM,EAAE,WAAW;IAU/B;;OAEG;IACG,gBAAgB,CAAC,OAAO,EAAE,QAAQ,GAAG,OAAO,CAAC,UAAU,CAAC;IA+F9D;;OAEG;IACG,cAAc,CAAC,OAAO,EAAE,QAAQ,GAAG,OAAO,CAAC,UAAU,CAAC;IAuG5D;;OAEG;IACG,iBAAiB,CAAC,OAAO,EAAE,QAAQ,GAAG,OAAO,CAAC,UAAU,CAAC;IAyC/D;;OAEG;IACG,YAAY,CAAC,OAAO,EAAE,QAAQ,GAAG,OAAO,CAAC,UAAU,CAAC;IA6E1D;;OAEG;IACG,YAAY,CAAC,OAAO,EAAE,QAAQ,GAAG,OAAO,CAAC,UAAU,CAAC;CAgC3D"}
|
|
@@ -1,17 +1,23 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PerplexityIntelligenceTool = void 0;
|
|
4
|
+
const o_core_1 = require("@olane/o-core");
|
|
5
|
+
const o_tool_1 = require("@olane/o-tool");
|
|
6
|
+
const intelligence_methods_1 = require("./methods/intelligence.methods");
|
|
7
|
+
class PerplexityIntelligenceTool extends (0, o_tool_1.oTool)(o_core_1.oVirtualNode) {
|
|
5
8
|
defaultModel;
|
|
6
9
|
constructor(config) {
|
|
7
10
|
super({
|
|
8
11
|
...config,
|
|
9
|
-
address: new oAddress('o://perplexity'),
|
|
12
|
+
address: new o_core_1.oAddress('o://perplexity'),
|
|
10
13
|
description: 'Intelligence tool using Perplexity LLM suite of models',
|
|
11
|
-
methods: INTELLIGENCE_PARAMS,
|
|
14
|
+
methods: intelligence_methods_1.INTELLIGENCE_PARAMS,
|
|
12
15
|
dependencies: [],
|
|
13
16
|
});
|
|
14
17
|
}
|
|
18
|
+
/**
|
|
19
|
+
* Chat completion with Perplexity
|
|
20
|
+
*/
|
|
15
21
|
async _tool_completion(request) {
|
|
16
22
|
try {
|
|
17
23
|
const params = request.params;
|
|
@@ -33,6 +39,7 @@ export class PerplexityIntelligenceTool extends oTool(oVirtualNode) {
|
|
|
33
39
|
messages: messages,
|
|
34
40
|
stream: false,
|
|
35
41
|
};
|
|
42
|
+
// Add optional parameters if provided
|
|
36
43
|
if (max_tokens !== undefined)
|
|
37
44
|
chatRequest.max_tokens = max_tokens;
|
|
38
45
|
if (temperature !== undefined)
|
|
@@ -68,7 +75,7 @@ export class PerplexityIntelligenceTool extends oTool(oVirtualNode) {
|
|
|
68
75
|
error: `Perplexity API error: ${response.status} - ${errorText}`,
|
|
69
76
|
};
|
|
70
77
|
}
|
|
71
|
-
const result = await response.json();
|
|
78
|
+
const result = (await response.json());
|
|
72
79
|
return {
|
|
73
80
|
success: true,
|
|
74
81
|
response: result.choices[0]?.message?.content || '',
|
|
@@ -84,6 +91,9 @@ export class PerplexityIntelligenceTool extends oTool(oVirtualNode) {
|
|
|
84
91
|
};
|
|
85
92
|
}
|
|
86
93
|
}
|
|
94
|
+
/**
|
|
95
|
+
* Generate text with Perplexity (alias for completion)
|
|
96
|
+
*/
|
|
87
97
|
async _tool_generate(request) {
|
|
88
98
|
try {
|
|
89
99
|
const params = request.params;
|
|
@@ -100,6 +110,7 @@ export class PerplexityIntelligenceTool extends oTool(oVirtualNode) {
|
|
|
100
110
|
error: 'Perplexity API key is required',
|
|
101
111
|
};
|
|
102
112
|
}
|
|
113
|
+
// Convert prompt to messages format
|
|
103
114
|
const messages = [];
|
|
104
115
|
if (system) {
|
|
105
116
|
messages.push({ role: 'system', content: system });
|
|
@@ -110,6 +121,7 @@ export class PerplexityIntelligenceTool extends oTool(oVirtualNode) {
|
|
|
110
121
|
messages,
|
|
111
122
|
stream: false,
|
|
112
123
|
};
|
|
124
|
+
// Add optional parameters if provided
|
|
113
125
|
if (max_tokens !== undefined)
|
|
114
126
|
chatRequest.max_tokens = max_tokens;
|
|
115
127
|
if (temperature !== undefined)
|
|
@@ -145,7 +157,7 @@ export class PerplexityIntelligenceTool extends oTool(oVirtualNode) {
|
|
|
145
157
|
error: `Perplexity API error: ${response.status} - ${errorText}`,
|
|
146
158
|
};
|
|
147
159
|
}
|
|
148
|
-
const result = await response.json();
|
|
160
|
+
const result = (await response.json());
|
|
149
161
|
return {
|
|
150
162
|
success: true,
|
|
151
163
|
response: result.choices[0]?.message?.content || '',
|
|
@@ -161,6 +173,9 @@ export class PerplexityIntelligenceTool extends oTool(oVirtualNode) {
|
|
|
161
173
|
};
|
|
162
174
|
}
|
|
163
175
|
}
|
|
176
|
+
/**
|
|
177
|
+
* List available models
|
|
178
|
+
*/
|
|
164
179
|
async _tool_list_models(request) {
|
|
165
180
|
try {
|
|
166
181
|
const params = request.params;
|
|
@@ -184,7 +199,7 @@ export class PerplexityIntelligenceTool extends oTool(oVirtualNode) {
|
|
|
184
199
|
error: `Perplexity API error: ${response.status} - ${errorText}`,
|
|
185
200
|
};
|
|
186
201
|
}
|
|
187
|
-
const result = await response.json();
|
|
202
|
+
const result = (await response.json());
|
|
188
203
|
return {
|
|
189
204
|
success: true,
|
|
190
205
|
models: result.data,
|
|
@@ -197,6 +212,9 @@ export class PerplexityIntelligenceTool extends oTool(oVirtualNode) {
|
|
|
197
212
|
};
|
|
198
213
|
}
|
|
199
214
|
}
|
|
215
|
+
/**
|
|
216
|
+
* Search with Perplexity
|
|
217
|
+
*/
|
|
200
218
|
async _tool_search(request) {
|
|
201
219
|
try {
|
|
202
220
|
const params = request.params;
|
|
@@ -216,6 +234,7 @@ export class PerplexityIntelligenceTool extends oTool(oVirtualNode) {
|
|
|
216
234
|
const searchRequest = {
|
|
217
235
|
query: query,
|
|
218
236
|
};
|
|
237
|
+
// Add optional parameters if provided
|
|
219
238
|
if (search_domain !== undefined)
|
|
220
239
|
searchRequest.search_domain = search_domain;
|
|
221
240
|
if (include_domains !== undefined)
|
|
@@ -241,7 +260,7 @@ export class PerplexityIntelligenceTool extends oTool(oVirtualNode) {
|
|
|
241
260
|
error: `Perplexity API error: ${response.status} - ${errorText}`,
|
|
242
261
|
};
|
|
243
262
|
}
|
|
244
|
-
const result = await response.json();
|
|
263
|
+
const result = (await response.json());
|
|
245
264
|
return {
|
|
246
265
|
success: true,
|
|
247
266
|
response: result.choices[0]?.message?.content || '',
|
|
@@ -257,6 +276,9 @@ export class PerplexityIntelligenceTool extends oTool(oVirtualNode) {
|
|
|
257
276
|
};
|
|
258
277
|
}
|
|
259
278
|
}
|
|
279
|
+
/**
|
|
280
|
+
* Check Perplexity API status
|
|
281
|
+
*/
|
|
260
282
|
async _tool_status(request) {
|
|
261
283
|
try {
|
|
262
284
|
const params = request.params;
|
|
@@ -289,4 +311,4 @@ export class PerplexityIntelligenceTool extends oTool(oVirtualNode) {
|
|
|
289
311
|
}
|
|
290
312
|
}
|
|
291
313
|
}
|
|
292
|
-
|
|
314
|
+
exports.PerplexityIntelligenceTool = PerplexityIntelligenceTool;
|
package/dist/mcp/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("./mcp-bridge.tool"), exports);
|
|
18
|
+
__exportStar(require("./mcp.tool"), exports);
|
|
@@ -8,13 +8,13 @@ declare const McpBridgeTool_base: (new (...args: any[]) => {
|
|
|
8
8
|
initialize(): Promise<void>;
|
|
9
9
|
use(address: oAddress, data: {
|
|
10
10
|
[key: string]: unknown;
|
|
11
|
-
}, config?: import("@olane/o-core").UseOptions): Promise<import("@olane/o-core").oResponse>;
|
|
12
|
-
handleStream(streamData: import("@
|
|
13
|
-
execute(req: oRequest, stream?: import("@
|
|
14
|
-
run(request: oRequest, stream?: import("@
|
|
11
|
+
}, config?: import("@olane/o-core").UseOptions | undefined): Promise<import("@olane/o-core").oResponse>;
|
|
12
|
+
handleStream(streamData: import("@libp2p/interface", { with: { "resolution-mode": "import" } }).IncomingStreamData): Promise<void>;
|
|
13
|
+
execute(req: oRequest, stream?: import("@libp2p/interface", { with: { "resolution-mode": "import" } }).Stream | undefined): Promise<import("@olane/o-tool").RunResult>;
|
|
14
|
+
run(request: oRequest, stream?: import("@libp2p/interface", { with: { "resolution-mode": "import" } }).Stream | undefined): Promise<import("@olane/o-tool").RunResult>;
|
|
15
15
|
myTools(): string[];
|
|
16
16
|
myToolParams(tool: string): Record<string, any>;
|
|
17
|
-
callMyTool(request: oRequest, stream?: import("@
|
|
17
|
+
callMyTool(request: oRequest, stream?: import("@libp2p/interface", { with: { "resolution-mode": "import" } }).Stream | undefined): Promise<ToolResult>;
|
|
18
18
|
index(): Promise<{
|
|
19
19
|
provider: string;
|
|
20
20
|
summary: string;
|
|
@@ -27,31 +27,31 @@ declare const McpBridgeTool_base: (new (...args: any[]) => {
|
|
|
27
27
|
tools: string[];
|
|
28
28
|
description: string;
|
|
29
29
|
}>;
|
|
30
|
-
findMissingParams(methodName: string, params: any): import("@olane/o-protocol
|
|
30
|
+
findMissingParams(methodName: string, params: any): import("@olane/o-protocol").oParameter[];
|
|
31
31
|
readonly config: import("@olane/o-core").CoreConfig;
|
|
32
|
-
p2pNode: import("@
|
|
32
|
+
p2pNode: import("libp2p", { with: { "resolution-mode": "import" } }).Libp2p<import("@libp2p/interface", { with: { "resolution-mode": "import" } }).ServiceMap>;
|
|
33
33
|
logger: import("@olane/o-core").Logger;
|
|
34
|
-
networkConfig: import("@olane/o-config
|
|
34
|
+
networkConfig: import("@olane/o-config").Libp2pConfig;
|
|
35
35
|
address: oAddress;
|
|
36
36
|
readonly staticAddress: oAddress;
|
|
37
|
-
peerId: import("@
|
|
37
|
+
peerId: import("@libp2p/interface-peer-id", { with: { "resolution-mode": "import" } }).PeerId;
|
|
38
38
|
state: import("@olane/o-core").NodeState;
|
|
39
39
|
errors: Error[];
|
|
40
40
|
connectionManager: import("@olane/o-core").oConnectionManager;
|
|
41
|
-
leaders: import("@
|
|
41
|
+
leaders: import("@multiformats/multiaddr", { with: { "resolution-mode": "import" } }).Multiaddr[];
|
|
42
42
|
addressResolution: import("@olane/o-core").oAddressResolution;
|
|
43
43
|
readonly description: string;
|
|
44
44
|
dependencies: oDependency[];
|
|
45
45
|
methods: {
|
|
46
|
-
[key: string]: import("@olane/o-protocol
|
|
46
|
+
[key: string]: import("@olane/o-protocol").oMethod;
|
|
47
47
|
};
|
|
48
48
|
successCount: number;
|
|
49
49
|
errorCount: number;
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
getTransports(address: oAddress): import("@
|
|
50
|
+
readonly type: import("@olane/o-core").NodeType;
|
|
51
|
+
readonly transports: string[];
|
|
52
|
+
readonly parent: oAddress | null;
|
|
53
|
+
readonly parentTransports: import("@multiformats/multiaddr", { with: { "resolution-mode": "import" } }).Multiaddr[];
|
|
54
|
+
getTransports(address: oAddress): import("@multiformats/multiaddr", { with: { "resolution-mode": "import" } }).Multiaddr[];
|
|
55
55
|
handleStaticAddressTranslation(addressInput: oAddress): Promise<oAddress>;
|
|
56
56
|
translateAddress(addressWithLeaderTransports: oAddress): Promise<{
|
|
57
57
|
nextHopAddress: oAddress;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mcp-bridge.tool.d.ts","sourceRoot":"","sources":["../../src/mcp/mcp-bridge.tool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAS,WAAW,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC/D,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAC9E,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AAEnE,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC
|
|
1
|
+
{"version":3,"file":"mcp-bridge.tool.d.ts","sourceRoot":"","sources":["../../src/mcp/mcp-bridge.tool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAS,WAAW,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC/D,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAC9E,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AAEnE,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIrC,qBAAa,aAAc,SAAQ,kBAAmB;gBACxC,MAAM,EAAE,WAAW;IASzB,uBAAuB,CAAC,OAAO,EAAE,QAAQ,GAAG,OAAO,CAAC,UAAU,CAAC;IAiC/D,oCAAoC,CACxC,OAAO,EAAE,QAAQ,GAChB,OAAO,CAAC,UAAU,CAAC;IAmDhB,sBAAsB,CAAC,OAAO,EAAE,QAAQ,GAAG,OAAO,CAAC,UAAU,CAAC;IA+B9D,aAAa,CACjB,SAAS,EAAE,MAAM,EACjB,GAAG,EAAE,MAAM,EACX,IAAI,CAAC,EAAE,MAAM,GACZ,OAAO,CAAC,OAAO,CAAC;CA4BpB"}
|