@olane/o-tool-registry 0.1.0 → 0.1.2
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 +2 -67
- package/dist/apple/apple.tool.d.ts.map +1 -1
- package/dist/apple/apple.tool.js +3 -4
- package/dist/apple/index.js +1 -1
- package/dist/apple/notes.tool.d.ts +3 -67
- package/dist/apple/notes.tool.d.ts.map +1 -1
- package/dist/apple/notes.tool.js +4 -5
- package/dist/auth/index.js +0 -1
- package/dist/auth/interfaces/index.js +0 -1
- package/dist/auth/interfaces/oAuth-tokens.interface.js +0 -1
- package/dist/auth/interfaces/oAuth-user-info.interface.js +0 -1
- package/dist/auth/interfaces/oAuth.config.js +0 -1
- package/dist/auth/methods/auth.methods.js +0 -1
- package/dist/auth/oAuth.tool.js +15 -6
- package/dist/embeddings/embeddings.tool.d.ts +2 -66
- package/dist/embeddings/embeddings.tool.d.ts.map +1 -1
- package/dist/embeddings/embeddings.tool.js +3 -4
- package/dist/embeddings/huggingface-text-embeddings.tool.d.ts.map +1 -1
- package/dist/embeddings/huggingface-text-embeddings.tool.js +1 -3
- package/dist/embeddings/index.js +0 -1
- package/dist/embeddings/methods/text-embeddings.method.js +0 -1
- package/dist/embeddings/text-embeddings.tool.d.ts +3 -66
- package/dist/embeddings/text-embeddings.tool.d.ts.map +1 -1
- package/dist/embeddings/text-embeddings.tool.js +3 -4
- package/dist/index.js +0 -1
- package/dist/init.d.ts.map +1 -1
- package/dist/init.js +0 -1
- package/dist/intelligence/anthropic-intelligence.tool.d.ts +33 -67
- package/dist/intelligence/anthropic-intelligence.tool.d.ts.map +1 -1
- package/dist/intelligence/anthropic-intelligence.tool.js +39 -9
- package/dist/intelligence/gemini-intelligence.tool.d.ts +18 -67
- package/dist/intelligence/gemini-intelligence.tool.d.ts.map +1 -1
- package/dist/intelligence/gemini-intelligence.tool.js +24 -11
- package/dist/intelligence/index.js +0 -1
- package/dist/intelligence/intelligence.tool.d.ts +2 -67
- package/dist/intelligence/intelligence.tool.d.ts.map +1 -1
- package/dist/intelligence/intelligence.tool.js +10 -6
- package/dist/intelligence/methods/intelligence.methods.js +0 -1
- package/dist/intelligence/ollama-intelligence.tool.d.ts +24 -67
- package/dist/intelligence/ollama-intelligence.tool.d.ts.map +1 -1
- package/dist/intelligence/ollama-intelligence.tool.js +34 -10
- package/dist/intelligence/openai-intelligence.tool.d.ts +18 -67
- package/dist/intelligence/openai-intelligence.tool.d.ts.map +1 -1
- package/dist/intelligence/openai-intelligence.tool.js +25 -12
- package/dist/intelligence/perplexity-intelligence.tool.d.ts +18 -67
- package/dist/intelligence/perplexity-intelligence.tool.d.ts.map +1 -1
- package/dist/intelligence/perplexity-intelligence.tool.js +26 -9
- package/dist/mcp/index.js +0 -1
- package/dist/mcp/mcp-bridge.tool.d.ts +3 -67
- package/dist/mcp/mcp-bridge.tool.d.ts.map +1 -1
- package/dist/mcp/mcp-bridge.tool.js +17 -4
- package/dist/mcp/mcp.tool.d.ts +3 -68
- package/dist/mcp/mcp.tool.d.ts.map +1 -1
- package/dist/mcp/mcp.tool.js +8 -5
- package/dist/mcp/methods/mcp-bridge.methods.js +0 -1
- package/dist/nlp/index.js +0 -1
- package/dist/nlp/methods/nlp.methods.js +0 -1
- package/dist/nlp/ner.tool.d.ts +3 -67
- package/dist/nlp/ner.tool.d.ts.map +1 -1
- package/dist/nlp/ner.tool.js +3 -4
- package/dist/vector-store/index.js +0 -1
- package/dist/vector-store/langchain-memory.vector-store.tool.d.ts.map +1 -1
- package/dist/vector-store/langchain-memory.vector-store.tool.js +0 -2
- package/dist/vector-store/methods/vector-store.methods.js +0 -1
- package/dist/vector-store/vector-memory.tool.d.ts +3 -67
- package/dist/vector-store/vector-memory.tool.d.ts.map +1 -1
- package/dist/vector-store/vector-memory.tool.js +3 -4
- package/package.json +16 -22
- 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
|
@@ -1,70 +1,5 @@
|
|
|
1
|
-
import { oToolConfig } from '@olane/o-tool';
|
|
2
|
-
|
|
3
|
-
declare const AppleTool_base: (new (...args: any[]) => {
|
|
4
|
-
validateToolCall(oRequest: import("@olane/o-core").oRequest): boolean;
|
|
5
|
-
handleProtocol(address: oAddress): Promise<void>;
|
|
6
|
-
initialize(): Promise<void>;
|
|
7
|
-
use(address: oAddress, data: {
|
|
8
|
-
[key: string]: unknown;
|
|
9
|
-
}, config?: import("@olane/o-core").UseOptions): Promise<import("@olane/o-core").oResponse>;
|
|
10
|
-
handleStream(streamData: import("@olane/o-config/dist").IncomingStreamData): Promise<void>;
|
|
11
|
-
execute(req: import("@olane/o-core").oRequest, stream?: import("@olane/o-config/dist").Stream): Promise<import("@olane/o-tool").RunResult>;
|
|
12
|
-
run(request: import("@olane/o-core").oRequest, stream?: import("@olane/o-config/dist").Stream): Promise<import("@olane/o-tool").RunResult>;
|
|
13
|
-
myTools(): string[];
|
|
14
|
-
myToolParams(tool: string): Record<string, any>;
|
|
15
|
-
callMyTool(request: import("@olane/o-core").oRequest, stream?: import("@olane/o-config/dist").Stream): Promise<import("@olane/o-tool").ToolResult>;
|
|
16
|
-
index(): Promise<{
|
|
17
|
-
provider: string;
|
|
18
|
-
summary: string;
|
|
19
|
-
} | {
|
|
20
|
-
summary: string | null;
|
|
21
|
-
provider?: undefined;
|
|
22
|
-
}>;
|
|
23
|
-
_tool_index_network(request: import("@olane/o-core").oRequest): Promise<import("@olane/o-tool").ToolResult>;
|
|
24
|
-
whoami(): Promise<{
|
|
25
|
-
tools: string[];
|
|
26
|
-
description: string;
|
|
27
|
-
}>;
|
|
28
|
-
findMissingParams(methodName: string, params: any): import("@olane/o-protocol/dist").oParameter[];
|
|
29
|
-
readonly config: import("@olane/o-core").CoreConfig;
|
|
30
|
-
p2pNode: import("@olane/o-config/dist").Libp2p;
|
|
31
|
-
logger: import("@olane/o-core").Logger;
|
|
32
|
-
networkConfig: import("@olane/o-config/dist").Libp2pConfig;
|
|
33
|
-
address: oAddress;
|
|
34
|
-
readonly staticAddress: oAddress;
|
|
35
|
-
peerId: import("@olane/o-config/dist").PeerId;
|
|
36
|
-
state: import("@olane/o-core").NodeState;
|
|
37
|
-
errors: Error[];
|
|
38
|
-
connectionManager: import("@olane/o-core").oConnectionManager;
|
|
39
|
-
leaders: import("@olane/o-config/dist").Multiaddr[];
|
|
40
|
-
addressResolution: import("@olane/o-core").oAddressResolution;
|
|
41
|
-
readonly description: string;
|
|
42
|
-
dependencies: import("@olane/o-core").oDependency[];
|
|
43
|
-
methods: {
|
|
44
|
-
[key: string]: import("@olane/o-protocol/dist").oMethod;
|
|
45
|
-
};
|
|
46
|
-
successCount: number;
|
|
47
|
-
errorCount: number;
|
|
48
|
-
get type(): import("@olane/o-core").NodeType;
|
|
49
|
-
get transports(): string[];
|
|
50
|
-
get parent(): oAddress | null;
|
|
51
|
-
get parentTransports(): import("@olane/o-config/dist").Multiaddr[];
|
|
52
|
-
getTransports(address: oAddress): import("@olane/o-config/dist").Multiaddr[];
|
|
53
|
-
handleStaticAddressTranslation(addressInput: oAddress): Promise<oAddress>;
|
|
54
|
-
translateAddress(addressWithLeaderTransports: oAddress): Promise<{
|
|
55
|
-
nextHopAddress: oAddress;
|
|
56
|
-
targetAddress: oAddress;
|
|
57
|
-
}>;
|
|
58
|
-
advertiseToNetwork(): Promise<void>;
|
|
59
|
-
connectToParent(): Promise<void>;
|
|
60
|
-
register(): Promise<void>;
|
|
61
|
-
connect(nextHopAddress: oAddress, targetAddress: oAddress): Promise<import("@olane/o-core").oConnection>;
|
|
62
|
-
teardown(): Promise<void>;
|
|
63
|
-
start(): Promise<void>;
|
|
64
|
-
stop(): Promise<void>;
|
|
65
|
-
}) & typeof oVirtualNode;
|
|
66
|
-
export declare class AppleTool extends AppleTool_base {
|
|
1
|
+
import { oToolConfig, oVirtualTool } from '@olane/o-tool';
|
|
2
|
+
export declare class AppleTool extends oVirtualTool {
|
|
67
3
|
constructor(config: oToolConfig);
|
|
68
4
|
}
|
|
69
|
-
export {};
|
|
70
5
|
//# sourceMappingURL=apple.tool.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"apple.tool.d.ts","sourceRoot":"","sources":["../../src/apple/apple.tool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAS,WAAW,EAAE,
|
|
1
|
+
{"version":3,"file":"apple.tool.d.ts","sourceRoot":"","sources":["../../src/apple/apple.tool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAS,WAAW,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAGjE,qBAAa,SAAU,SAAQ,YAAY;gBAC7B,MAAM,EAAE,WAAW;CAOhC"}
|
package/dist/apple/apple.tool.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { oAddress
|
|
3
|
-
export class AppleTool extends
|
|
1
|
+
import { oVirtualTool } from '@olane/o-tool';
|
|
2
|
+
import { oAddress } from '@olane/o-core';
|
|
3
|
+
export class AppleTool extends oVirtualTool {
|
|
4
4
|
constructor(config) {
|
|
5
5
|
super({
|
|
6
6
|
...config,
|
|
@@ -9,4 +9,3 @@ export class AppleTool extends oTool(oVirtualNode) {
|
|
|
9
9
|
});
|
|
10
10
|
}
|
|
11
11
|
}
|
|
12
|
-
//# sourceMappingURL=apple.tool.js.map
|
package/dist/apple/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
@@ -1,69 +1,6 @@
|
|
|
1
|
-
import { oToolConfig } from '@olane/o-tool';
|
|
2
|
-
import {
|
|
3
|
-
declare
|
|
4
|
-
validateToolCall(oRequest: oRequest): boolean;
|
|
5
|
-
handleProtocol(address: oAddress): Promise<void>;
|
|
6
|
-
initialize(): Promise<void>;
|
|
7
|
-
use(address: oAddress, data: {
|
|
8
|
-
[key: string]: unknown;
|
|
9
|
-
}, config?: import("@olane/o-core").UseOptions): Promise<import("@olane/o-core").oResponse>;
|
|
10
|
-
handleStream(streamData: import("@olane/o-config/dist").IncomingStreamData): Promise<void>;
|
|
11
|
-
execute(req: oRequest, stream?: import("@olane/o-config/dist").Stream): Promise<import("@olane/o-tool").RunResult>;
|
|
12
|
-
run(request: oRequest, stream?: import("@olane/o-config/dist").Stream): Promise<import("@olane/o-tool").RunResult>;
|
|
13
|
-
myTools(): string[];
|
|
14
|
-
myToolParams(tool: string): Record<string, any>;
|
|
15
|
-
callMyTool(request: oRequest, stream?: import("@olane/o-config/dist").Stream): Promise<import("@olane/o-tool").ToolResult>;
|
|
16
|
-
index(): Promise<{
|
|
17
|
-
provider: string;
|
|
18
|
-
summary: string;
|
|
19
|
-
} | {
|
|
20
|
-
summary: string | null;
|
|
21
|
-
provider?: undefined;
|
|
22
|
-
}>;
|
|
23
|
-
_tool_index_network(request: oRequest): Promise<import("@olane/o-tool").ToolResult>;
|
|
24
|
-
whoami(): Promise<{
|
|
25
|
-
tools: string[];
|
|
26
|
-
description: string;
|
|
27
|
-
}>;
|
|
28
|
-
findMissingParams(methodName: string, params: any): import("@olane/o-protocol/dist").oParameter[];
|
|
29
|
-
readonly config: import("@olane/o-core").CoreConfig;
|
|
30
|
-
p2pNode: import("@olane/o-config/dist").Libp2p;
|
|
31
|
-
logger: import("@olane/o-core").Logger;
|
|
32
|
-
networkConfig: import("@olane/o-config/dist").Libp2pConfig;
|
|
33
|
-
address: oAddress;
|
|
34
|
-
readonly staticAddress: oAddress;
|
|
35
|
-
peerId: import("@olane/o-config/dist").PeerId;
|
|
36
|
-
state: import("@olane/o-core").NodeState;
|
|
37
|
-
errors: Error[];
|
|
38
|
-
connectionManager: import("@olane/o-core").oConnectionManager;
|
|
39
|
-
leaders: import("@olane/o-config/dist").Multiaddr[];
|
|
40
|
-
addressResolution: import("@olane/o-core").oAddressResolution;
|
|
41
|
-
readonly description: string;
|
|
42
|
-
dependencies: import("@olane/o-core").oDependency[];
|
|
43
|
-
methods: {
|
|
44
|
-
[key: string]: import("@olane/o-protocol/dist").oMethod;
|
|
45
|
-
};
|
|
46
|
-
successCount: number;
|
|
47
|
-
errorCount: number;
|
|
48
|
-
get type(): import("@olane/o-core").NodeType;
|
|
49
|
-
get transports(): string[];
|
|
50
|
-
get parent(): oAddress | null;
|
|
51
|
-
get parentTransports(): import("@olane/o-config/dist").Multiaddr[];
|
|
52
|
-
getTransports(address: oAddress): import("@olane/o-config/dist").Multiaddr[];
|
|
53
|
-
handleStaticAddressTranslation(addressInput: oAddress): Promise<oAddress>;
|
|
54
|
-
translateAddress(addressWithLeaderTransports: oAddress): Promise<{
|
|
55
|
-
nextHopAddress: oAddress;
|
|
56
|
-
targetAddress: oAddress;
|
|
57
|
-
}>;
|
|
58
|
-
advertiseToNetwork(): Promise<void>;
|
|
59
|
-
connectToParent(): Promise<void>;
|
|
60
|
-
register(): Promise<void>;
|
|
61
|
-
connect(nextHopAddress: oAddress, targetAddress: oAddress): Promise<import("@olane/o-core").oConnection>;
|
|
62
|
-
teardown(): Promise<void>;
|
|
63
|
-
start(): Promise<void>;
|
|
64
|
-
stop(): Promise<void>;
|
|
65
|
-
}) & typeof oVirtualNode;
|
|
66
|
-
export declare class NotesTool extends NotesTool_base {
|
|
1
|
+
import { oToolConfig, oVirtualTool } from '@olane/o-tool';
|
|
2
|
+
import { oRequest } from '@olane/o-core';
|
|
3
|
+
export declare class NotesTool extends oVirtualTool {
|
|
67
4
|
private jxaScriptPath;
|
|
68
5
|
constructor(config: oToolConfig);
|
|
69
6
|
private executeJxaScript;
|
|
@@ -74,5 +11,4 @@ export declare class NotesTool extends NotesTool_base {
|
|
|
74
11
|
_tool_get_folders(request: oRequest): Promise<any>;
|
|
75
12
|
_tool_create_folder(request: oRequest): Promise<any>;
|
|
76
13
|
}
|
|
77
|
-
export {};
|
|
78
14
|
//# sourceMappingURL=notes.tool.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notes.tool.d.ts","sourceRoot":"","sources":["../../src/apple/notes.tool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAS,WAAW,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"notes.tool.d.ts","sourceRoot":"","sources":["../../src/apple/notes.tool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAS,WAAW,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AACjE,OAAO,EAAY,QAAQ,EAAgB,MAAM,eAAe,CAAC;AAOjE,qBAAa,SAAU,SAAQ,YAAY;IACzC,OAAO,CAAC,aAAa,CAAS;gBAElB,MAAM,EAAE,WAAW;YAWjB,gBAAgB;IA0BxB,eAAe,CAAC,OAAO,EAAE,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC;IA0BhD,iBAAiB,CAAC,OAAO,EAAE,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC;IA6ClD,iBAAiB,CAAC,OAAO,EAAE,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC;IA4ClD,iBAAiB,CAAC,OAAO,EAAE,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC;IAmClD,iBAAiB,CAAC,OAAO,EAAE,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC;IA0BlD,mBAAmB,CAAC,OAAO,EAAE,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC;CAmC3D"}
|
package/dist/apple/notes.tool.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { oAddress
|
|
1
|
+
import { oVirtualTool } from '@olane/o-tool';
|
|
2
|
+
import { oAddress } from '@olane/o-core';
|
|
3
3
|
import { exec } from 'child_process';
|
|
4
4
|
import { promisify } from 'util';
|
|
5
5
|
import * as path from 'path';
|
|
6
6
|
const execAsync = promisify(exec);
|
|
7
|
-
export class NotesTool extends
|
|
8
|
-
jxaScriptPath;
|
|
7
|
+
export class NotesTool extends oVirtualTool {
|
|
9
8
|
constructor(config) {
|
|
10
9
|
super({
|
|
11
10
|
...config,
|
|
12
11
|
address: new oAddress('o://notes'),
|
|
13
12
|
description: 'Tool to interact with Apple Notes',
|
|
14
13
|
});
|
|
14
|
+
// Set the path to the JXA script
|
|
15
15
|
this.jxaScriptPath = path.join(__dirname, 'notes.jxa');
|
|
16
16
|
}
|
|
17
17
|
async executeJxaScript(command, args = []) {
|
|
@@ -213,4 +213,3 @@ export class NotesTool extends oTool(oVirtualNode) {
|
|
|
213
213
|
}
|
|
214
214
|
}
|
|
215
215
|
}
|
|
216
|
-
//# sourceMappingURL=notes.tool.js.map
|
package/dist/auth/index.js
CHANGED
package/dist/auth/oAuth.tool.js
CHANGED
|
@@ -2,8 +2,6 @@ import { oHostNodeTool } from '@olane/o-tool';
|
|
|
2
2
|
import { oAddress } from '@olane/o-core';
|
|
3
3
|
import { oauthMethods } from './methods/auth.methods';
|
|
4
4
|
export class OAuthTool extends oHostNodeTool {
|
|
5
|
-
oauthConfigs = new Map();
|
|
6
|
-
tokenStore = new Map();
|
|
7
5
|
constructor(config) {
|
|
8
6
|
super({
|
|
9
7
|
...config,
|
|
@@ -11,7 +9,10 @@ export class OAuthTool extends oHostNodeTool {
|
|
|
11
9
|
description: 'Generic OAuth client tool for custom OAuth provider services',
|
|
12
10
|
methods: oauthMethods,
|
|
13
11
|
});
|
|
12
|
+
this.oauthConfigs = new Map();
|
|
13
|
+
this.tokenStore = new Map();
|
|
14
14
|
}
|
|
15
|
+
// Tool methods
|
|
15
16
|
async _tool_configure(request) {
|
|
16
17
|
const { serviceName, ...config } = request.params;
|
|
17
18
|
if (!serviceName) {
|
|
@@ -59,17 +60,20 @@ export class OAuthTool extends oHostNodeTool {
|
|
|
59
60
|
if (state) {
|
|
60
61
|
url.searchParams.set('state', state);
|
|
61
62
|
}
|
|
63
|
+
// Add PKCE support for authorization code flow
|
|
62
64
|
if (config.responseType === 'code') {
|
|
63
65
|
const codeVerifier = this.generateCodeVerifier();
|
|
64
66
|
const codeChallenge = await this.generateCodeChallenge(codeVerifier);
|
|
65
67
|
url.searchParams.set('code_challenge', codeChallenge);
|
|
66
68
|
url.searchParams.set('code_challenge_method', 'S256');
|
|
69
|
+
// Store code verifier for later use
|
|
67
70
|
this.tokenStore.set(`${serviceName}_code_verifier`, {
|
|
68
71
|
code_verifier: codeVerifier,
|
|
69
72
|
access_token: '',
|
|
70
73
|
token_type: '',
|
|
71
74
|
});
|
|
72
75
|
}
|
|
76
|
+
// Add any additional parameters
|
|
73
77
|
if (additionalParams && typeof additionalParams === 'object') {
|
|
74
78
|
Object.entries(additionalParams).forEach(([key, value]) => {
|
|
75
79
|
if (typeof value === 'string') {
|
|
@@ -99,6 +103,7 @@ export class OAuthTool extends oHostNodeTool {
|
|
|
99
103
|
if (config.clientSecret) {
|
|
100
104
|
tokenData.client_secret = config.clientSecret;
|
|
101
105
|
}
|
|
106
|
+
// Add PKCE code verifier if available
|
|
102
107
|
const storedVerifier = this.tokenStore.get(`${serviceName}_code_verifier`);
|
|
103
108
|
if (storedVerifier?.code_verifier) {
|
|
104
109
|
tokenData.code_verifier = storedVerifier.code_verifier;
|
|
@@ -116,7 +121,8 @@ export class OAuthTool extends oHostNodeTool {
|
|
|
116
121
|
const errorText = await response.text();
|
|
117
122
|
throw new Error(`Token exchange failed: ${response.status} ${errorText}`);
|
|
118
123
|
}
|
|
119
|
-
const tokens = await response.json();
|
|
124
|
+
const tokens = (await response.json());
|
|
125
|
+
// Store tokens
|
|
120
126
|
this.tokenStore.set(`${serviceName}_tokens`, tokens);
|
|
121
127
|
this.logger.info(`Token exchange successful for service: ${serviceName}`);
|
|
122
128
|
return {
|
|
@@ -162,7 +168,8 @@ export class OAuthTool extends oHostNodeTool {
|
|
|
162
168
|
const errorText = await response.text();
|
|
163
169
|
throw new Error(`Token refresh failed: ${response.status} ${errorText}`);
|
|
164
170
|
}
|
|
165
|
-
const tokens = await response.json();
|
|
171
|
+
const tokens = (await response.json());
|
|
172
|
+
// Update stored tokens
|
|
166
173
|
const existingTokens = this.tokenStore.get(`${serviceName}_tokens`);
|
|
167
174
|
if (existingTokens) {
|
|
168
175
|
existingTokens.access_token = tokens.access_token;
|
|
@@ -211,7 +218,7 @@ export class OAuthTool extends oHostNodeTool {
|
|
|
211
218
|
const errorText = await response.text();
|
|
212
219
|
throw new Error(`User info request failed: ${response.status} ${errorText}`);
|
|
213
220
|
}
|
|
214
|
-
const userInfo = await response.json();
|
|
221
|
+
const userInfo = (await response.json());
|
|
215
222
|
return {
|
|
216
223
|
success: true,
|
|
217
224
|
serviceName,
|
|
@@ -285,6 +292,7 @@ export class OAuthTool extends oHostNodeTool {
|
|
|
285
292
|
body: new URLSearchParams(revocationData),
|
|
286
293
|
});
|
|
287
294
|
const isRevoked = response.ok;
|
|
295
|
+
// Remove tokens from storage if revoked
|
|
288
296
|
if (isRevoked) {
|
|
289
297
|
const storedTokens = this.tokenStore.get(`${serviceName}_tokens`);
|
|
290
298
|
if (storedTokens) {
|
|
@@ -378,6 +386,7 @@ export class OAuthTool extends oHostNodeTool {
|
|
|
378
386
|
};
|
|
379
387
|
}
|
|
380
388
|
else {
|
|
389
|
+
// Clear all tokens
|
|
381
390
|
for (const key of this.tokenStore.keys()) {
|
|
382
391
|
if (key.endsWith('_tokens') || key.endsWith('_code_verifier')) {
|
|
383
392
|
this.tokenStore.delete(key);
|
|
@@ -389,6 +398,7 @@ export class OAuthTool extends oHostNodeTool {
|
|
|
389
398
|
};
|
|
390
399
|
}
|
|
391
400
|
}
|
|
401
|
+
// Helper methods
|
|
392
402
|
generateCodeVerifier() {
|
|
393
403
|
const array = new Uint8Array(32);
|
|
394
404
|
crypto.getRandomValues(array);
|
|
@@ -407,4 +417,3 @@ export class OAuthTool extends oHostNodeTool {
|
|
|
407
417
|
.replace(/=/g, '');
|
|
408
418
|
}
|
|
409
419
|
}
|
|
410
|
-
//# sourceMappingURL=oAuth.tool.js.map
|
|
@@ -1,70 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { oVirtualTool } from '@olane/o-tool';
|
|
2
2
|
import { oToolConfig } from '@olane/o-tool';
|
|
3
|
-
declare
|
|
4
|
-
validateToolCall(oRequest: import("@olane/o-core").oRequest): boolean;
|
|
5
|
-
handleProtocol(address: oAddress): Promise<void>;
|
|
6
|
-
initialize(): Promise<void>;
|
|
7
|
-
use(address: oAddress, data: {
|
|
8
|
-
[key: string]: unknown;
|
|
9
|
-
}, config?: import("@olane/o-core").UseOptions): Promise<import("@olane/o-core").oResponse>;
|
|
10
|
-
handleStream(streamData: import("@olane/o-config/dist").IncomingStreamData): Promise<void>;
|
|
11
|
-
execute(req: import("@olane/o-core").oRequest, stream?: import("@olane/o-config/dist").Stream): Promise<import("@olane/o-tool").RunResult>;
|
|
12
|
-
run(request: import("@olane/o-core").oRequest, stream?: import("@olane/o-config/dist").Stream): Promise<import("@olane/o-tool").RunResult>;
|
|
13
|
-
myTools(): string[];
|
|
14
|
-
myToolParams(tool: string): Record<string, any>;
|
|
15
|
-
callMyTool(request: import("@olane/o-core").oRequest, stream?: import("@olane/o-config/dist").Stream): Promise<import("@olane/o-tool").ToolResult>;
|
|
16
|
-
index(): Promise<{
|
|
17
|
-
provider: string;
|
|
18
|
-
summary: string;
|
|
19
|
-
} | {
|
|
20
|
-
summary: string | null;
|
|
21
|
-
provider?: undefined;
|
|
22
|
-
}>;
|
|
23
|
-
_tool_index_network(request: import("@olane/o-core").oRequest): Promise<import("@olane/o-tool").ToolResult>;
|
|
24
|
-
whoami(): Promise<{
|
|
25
|
-
tools: string[];
|
|
26
|
-
description: string;
|
|
27
|
-
}>;
|
|
28
|
-
findMissingParams(methodName: string, params: any): import("@olane/o-protocol/dist").oParameter[];
|
|
29
|
-
readonly config: import("@olane/o-core").CoreConfig;
|
|
30
|
-
p2pNode: import("@olane/o-config/dist").Libp2p;
|
|
31
|
-
logger: import("@olane/o-core").Logger;
|
|
32
|
-
networkConfig: import("@olane/o-config/dist").Libp2pConfig;
|
|
33
|
-
address: oAddress;
|
|
34
|
-
readonly staticAddress: oAddress;
|
|
35
|
-
peerId: import("@olane/o-config/dist").PeerId;
|
|
36
|
-
state: import("@olane/o-core").NodeState;
|
|
37
|
-
errors: Error[];
|
|
38
|
-
connectionManager: import("@olane/o-core").oConnectionManager;
|
|
39
|
-
leaders: import("@olane/o-config/dist").Multiaddr[];
|
|
40
|
-
addressResolution: import("@olane/o-core").oAddressResolution;
|
|
41
|
-
readonly description: string;
|
|
42
|
-
dependencies: import("@olane/o-core").oDependency[];
|
|
43
|
-
methods: {
|
|
44
|
-
[key: string]: import("@olane/o-protocol/dist").oMethod;
|
|
45
|
-
};
|
|
46
|
-
successCount: number;
|
|
47
|
-
errorCount: number;
|
|
48
|
-
get type(): import("@olane/o-core").NodeType;
|
|
49
|
-
get transports(): string[];
|
|
50
|
-
get parent(): oAddress | null;
|
|
51
|
-
get parentTransports(): import("@olane/o-config/dist").Multiaddr[];
|
|
52
|
-
getTransports(address: oAddress): import("@olane/o-config/dist").Multiaddr[];
|
|
53
|
-
handleStaticAddressTranslation(addressInput: oAddress): Promise<oAddress>;
|
|
54
|
-
translateAddress(addressWithLeaderTransports: oAddress): Promise<{
|
|
55
|
-
nextHopAddress: oAddress;
|
|
56
|
-
targetAddress: oAddress;
|
|
57
|
-
}>;
|
|
58
|
-
advertiseToNetwork(): Promise<void>;
|
|
59
|
-
connectToParent(): Promise<void>;
|
|
60
|
-
register(): Promise<void>;
|
|
61
|
-
connect(nextHopAddress: oAddress, targetAddress: oAddress): Promise<import("@olane/o-core").oConnection>;
|
|
62
|
-
teardown(): Promise<void>;
|
|
63
|
-
start(): Promise<void>;
|
|
64
|
-
stop(): Promise<void>;
|
|
65
|
-
}) & typeof oVirtualNode;
|
|
66
|
-
export declare class EmbeddingsTool extends EmbeddingsTool_base {
|
|
3
|
+
export declare class EmbeddingsTool extends oVirtualTool {
|
|
67
4
|
constructor(config: oToolConfig);
|
|
68
5
|
}
|
|
69
|
-
export {};
|
|
70
6
|
//# sourceMappingURL=embeddings.tool.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"embeddings.tool.d.ts","sourceRoot":"","sources":["../../src/embeddings/embeddings.tool.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"embeddings.tool.d.ts","sourceRoot":"","sources":["../../src/embeddings/embeddings.tool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAS,YAAY,EAAE,MAAM,eAAe,CAAC;AAEpD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C,qBAAa,cAAe,SAAQ,YAAY;gBAClC,MAAM,EAAE,WAAW;CAQhC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { oAddress
|
|
3
|
-
export class EmbeddingsTool extends
|
|
1
|
+
import { oVirtualTool } from '@olane/o-tool';
|
|
2
|
+
import { oAddress } from '@olane/o-core';
|
|
3
|
+
export class EmbeddingsTool extends oVirtualTool {
|
|
4
4
|
constructor(config) {
|
|
5
5
|
super({
|
|
6
6
|
...config,
|
|
@@ -9,4 +9,3 @@ export class EmbeddingsTool extends oTool(oVirtualNode) {
|
|
|
9
9
|
});
|
|
10
10
|
}
|
|
11
11
|
}
|
|
12
|
-
//# sourceMappingURL=embeddings.tool.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"huggingface-text-embeddings.tool.d.ts","sourceRoot":"","sources":["../../src/embeddings/huggingface-text-embeddings.tool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAG5D,qBAAa,6BAA8B,SAAQ,kBAAkB;IACnE,OAAO,CAAC,KAAK,
|
|
1
|
+
{"version":3,"file":"huggingface-text-embeddings.tool.d.ts","sourceRoot":"","sources":["../../src/embeddings/huggingface-text-embeddings.tool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAG5D,qBAAa,6BAA8B,SAAQ,kBAAkB;IACnE,OAAO,CAAC,KAAK,CAAqC;IAE5C,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;IAO3B,qBAAqB,CAAC,OAAO,EAAE,QAAQ,GAAG,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC;IAM7D,iBAAiB,CAAC,OAAO,EAAE,QAAQ,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;CAM9D"}
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { TextEmbeddingsTool } from './text-embeddings.tool';
|
|
2
2
|
import { HuggingFaceTransformersEmbeddings } from '@langchain/community/embeddings/huggingface_transformers';
|
|
3
3
|
export class HuggingfaceTextEmbeddingsTool extends TextEmbeddingsTool {
|
|
4
|
-
model;
|
|
5
4
|
async initialize() {
|
|
6
5
|
await super.initialize();
|
|
7
6
|
this.model = new HuggingFaceTransformersEmbeddings({
|
|
8
|
-
model: 'Xenova/all-MiniLM-L6-v2',
|
|
7
|
+
model: 'Xenova/all-MiniLM-L6-v2', // TODO: make this configurable
|
|
9
8
|
});
|
|
10
9
|
}
|
|
11
10
|
async _tool_embed_documents(request) {
|
|
@@ -20,4 +19,3 @@ export class HuggingfaceTextEmbeddingsTool extends TextEmbeddingsTool {
|
|
|
20
19
|
return result;
|
|
21
20
|
}
|
|
22
21
|
}
|
|
23
|
-
//# sourceMappingURL=huggingface-text-embeddings.tool.js.map
|
package/dist/embeddings/index.js
CHANGED
|
@@ -1,72 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { oVirtualTool } from '@olane/o-tool';
|
|
2
|
+
import { oRequest } from '@olane/o-core';
|
|
2
3
|
import { oToolConfig } from '@olane/o-tool';
|
|
3
|
-
declare
|
|
4
|
-
validateToolCall(oRequest: oRequest): boolean;
|
|
5
|
-
handleProtocol(address: oAddress): Promise<void>;
|
|
6
|
-
initialize(): Promise<void>;
|
|
7
|
-
use(address: oAddress, data: {
|
|
8
|
-
[key: string]: unknown;
|
|
9
|
-
}, config?: import("@olane/o-core").UseOptions): Promise<import("@olane/o-core").oResponse>;
|
|
10
|
-
handleStream(streamData: import("@olane/o-config/dist").IncomingStreamData): Promise<void>;
|
|
11
|
-
execute(req: oRequest, stream?: import("@olane/o-config/dist").Stream): Promise<import("@olane/o-tool").RunResult>;
|
|
12
|
-
run(request: oRequest, stream?: import("@olane/o-config/dist").Stream): Promise<import("@olane/o-tool").RunResult>;
|
|
13
|
-
myTools(): string[];
|
|
14
|
-
myToolParams(tool: string): Record<string, any>;
|
|
15
|
-
callMyTool(request: oRequest, stream?: import("@olane/o-config/dist").Stream): Promise<import("@olane/o-tool").ToolResult>;
|
|
16
|
-
index(): Promise<{
|
|
17
|
-
provider: string;
|
|
18
|
-
summary: string;
|
|
19
|
-
} | {
|
|
20
|
-
summary: string | null;
|
|
21
|
-
provider?: undefined;
|
|
22
|
-
}>;
|
|
23
|
-
_tool_index_network(request: oRequest): Promise<import("@olane/o-tool").ToolResult>;
|
|
24
|
-
whoami(): Promise<{
|
|
25
|
-
tools: string[];
|
|
26
|
-
description: string;
|
|
27
|
-
}>;
|
|
28
|
-
findMissingParams(methodName: string, params: any): import("@olane/o-protocol/dist").oParameter[];
|
|
29
|
-
readonly config: import("@olane/o-core").CoreConfig;
|
|
30
|
-
p2pNode: import("@olane/o-config/dist").Libp2p;
|
|
31
|
-
logger: import("@olane/o-core").Logger;
|
|
32
|
-
networkConfig: import("@olane/o-config/dist").Libp2pConfig;
|
|
33
|
-
address: oAddress;
|
|
34
|
-
readonly staticAddress: oAddress;
|
|
35
|
-
peerId: import("@olane/o-config/dist").PeerId;
|
|
36
|
-
state: import("@olane/o-core").NodeState;
|
|
37
|
-
errors: Error[];
|
|
38
|
-
connectionManager: import("@olane/o-core").oConnectionManager;
|
|
39
|
-
leaders: import("@olane/o-config/dist").Multiaddr[];
|
|
40
|
-
addressResolution: import("@olane/o-core").oAddressResolution;
|
|
41
|
-
readonly description: string;
|
|
42
|
-
dependencies: import("@olane/o-core").oDependency[];
|
|
43
|
-
methods: {
|
|
44
|
-
[key: string]: import("@olane/o-protocol/dist").oMethod;
|
|
45
|
-
};
|
|
46
|
-
successCount: number;
|
|
47
|
-
errorCount: number;
|
|
48
|
-
get type(): import("@olane/o-core").NodeType;
|
|
49
|
-
get transports(): string[];
|
|
50
|
-
get parent(): oAddress | null;
|
|
51
|
-
get parentTransports(): import("@olane/o-config/dist").Multiaddr[];
|
|
52
|
-
getTransports(address: oAddress): import("@olane/o-config/dist").Multiaddr[];
|
|
53
|
-
handleStaticAddressTranslation(addressInput: oAddress): Promise<oAddress>;
|
|
54
|
-
translateAddress(addressWithLeaderTransports: oAddress): Promise<{
|
|
55
|
-
nextHopAddress: oAddress;
|
|
56
|
-
targetAddress: oAddress;
|
|
57
|
-
}>;
|
|
58
|
-
advertiseToNetwork(): Promise<void>;
|
|
59
|
-
connectToParent(): Promise<void>;
|
|
60
|
-
register(): Promise<void>;
|
|
61
|
-
connect(nextHopAddress: oAddress, targetAddress: oAddress): Promise<import("@olane/o-core").oConnection>;
|
|
62
|
-
teardown(): Promise<void>;
|
|
63
|
-
start(): Promise<void>;
|
|
64
|
-
stop(): Promise<void>;
|
|
65
|
-
}) & typeof oVirtualNode;
|
|
66
|
-
export declare abstract class TextEmbeddingsTool extends TextEmbeddingsTool_base {
|
|
4
|
+
export declare abstract class TextEmbeddingsTool extends oVirtualTool {
|
|
67
5
|
constructor(config: oToolConfig);
|
|
68
6
|
abstract _tool_embed_documents(request: oRequest): Promise<number[][]>;
|
|
69
7
|
abstract _tool_embed_query(request: oRequest): Promise<number[]>;
|
|
70
8
|
}
|
|
71
|
-
export {};
|
|
72
9
|
//# sourceMappingURL=text-embeddings.tool.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"text-embeddings.tool.d.ts","sourceRoot":"","sources":["../../src/embeddings/text-embeddings.tool.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"text-embeddings.tool.d.ts","sourceRoot":"","sources":["../../src/embeddings/text-embeddings.tool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAS,YAAY,EAAE,MAAM,eAAe,CAAC;AACpD,OAAO,EAAY,QAAQ,EAAgB,MAAM,eAAe,CAAC;AACjE,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAI5C,8BAAsB,kBAAmB,SAAQ,YAAY;gBAC/C,MAAM,EAAE,WAAW;IAS/B,QAAQ,CAAC,qBAAqB,CAAC,OAAO,EAAE,QAAQ,GAAG,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC;IACtE,QAAQ,CAAC,iBAAiB,CAAC,OAAO,EAAE,QAAQ,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;CACjE"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { oAddress
|
|
1
|
+
import { oVirtualTool } from '@olane/o-tool';
|
|
2
|
+
import { oAddress } from '@olane/o-core';
|
|
3
3
|
import { TEXT_EMBEDDINGS_PARAMS } from './methods/text-embeddings.method';
|
|
4
|
-
export class TextEmbeddingsTool extends
|
|
4
|
+
export class TextEmbeddingsTool extends oVirtualTool {
|
|
5
5
|
constructor(config) {
|
|
6
6
|
super({
|
|
7
7
|
...config,
|
|
@@ -11,4 +11,3 @@ export class TextEmbeddingsTool extends oTool(oVirtualNode) {
|
|
|
11
11
|
});
|
|
12
12
|
}
|
|
13
13
|
}
|
|
14
|
-
//# sourceMappingURL=text-embeddings.tool.js.map
|
package/dist/index.js
CHANGED
package/dist/init.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../src/init.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAOtC,eAAO,MAAM,iBAAiB,
|
|
1
|
+
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../src/init.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAOtC,eAAO,MAAM,iBAAiB,UAAW,KAAK,SA8B7C,CAAC"}
|
package/dist/init.js
CHANGED