@olane/o-intelligence 0.6.13 → 0.7.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.
Files changed (31) hide show
  1. package/dist/src/anthropic-intelligence.tool.d.ts +5 -3
  2. package/dist/src/anthropic-intelligence.tool.d.ts.map +1 -1
  3. package/dist/src/anthropic-intelligence.tool.js +3 -3
  4. package/dist/src/gemini-intelligence.tool.d.ts +5 -3
  5. package/dist/src/gemini-intelligence.tool.d.ts.map +1 -1
  6. package/dist/src/gemini-intelligence.tool.js +2 -2
  7. package/dist/src/grok-intelligence.tool.d.ts +5 -3
  8. package/dist/src/grok-intelligence.tool.d.ts.map +1 -1
  9. package/dist/src/grok-intelligence.tool.js +2 -2
  10. package/dist/src/index.d.ts +1 -1
  11. package/dist/src/index.d.ts.map +1 -1
  12. package/dist/src/index.js +1 -1
  13. package/dist/src/o-intelligence.tool.d.ts +27 -0
  14. package/dist/src/o-intelligence.tool.d.ts.map +1 -0
  15. package/dist/src/o-intelligence.tool.js +276 -0
  16. package/dist/src/ollama-intelligence.tool.d.ts +5 -3
  17. package/dist/src/ollama-intelligence.tool.d.ts.map +1 -1
  18. package/dist/src/ollama-intelligence.tool.js +2 -2
  19. package/dist/src/openai-intelligence.tool.d.ts +5 -3
  20. package/dist/src/openai-intelligence.tool.d.ts.map +1 -1
  21. package/dist/src/openai-intelligence.tool.js +3 -3
  22. package/dist/src/perplexity-intelligence.tool.d.ts +5 -3
  23. package/dist/src/perplexity-intelligence.tool.d.ts.map +1 -1
  24. package/dist/src/perplexity-intelligence.tool.js +2 -2
  25. package/dist/src/router/o-intelligence.olane-resolver.d.ts +9 -0
  26. package/dist/src/router/o-intelligence.olane-resolver.d.ts.map +1 -0
  27. package/dist/src/router/o-intelligence.olane-resolver.js +40 -0
  28. package/dist/src/router/o-intelligence.resolver.d.ts +15 -0
  29. package/dist/src/router/o-intelligence.resolver.d.ts.map +1 -0
  30. package/dist/src/router/o-intelligence.resolver.js +62 -0
  31. package/package.json +6 -5
@@ -1,9 +1,11 @@
1
1
  import { oRequest } from '@olane/o-core';
2
- import { oToolConfig, oVirtualTool, ToolResult } from '@olane/o-tool';
3
- export declare class AnthropicIntelligenceTool extends oVirtualTool {
2
+ import { ToolResult } from '@olane/o-tool';
3
+ import { oLaneTool } from '@olane/o-lane';
4
+ import { oNodeToolConfig } from '@olane/o-node';
5
+ export declare class AnthropicIntelligenceTool extends oLaneTool {
4
6
  private defaultModel;
5
7
  private apiKey;
6
- constructor(config: oToolConfig);
8
+ constructor(config: oNodeToolConfig);
7
9
  /**
8
10
  * Chat completion with Anthropic
9
11
  */
@@ -1 +1 @@
1
- {"version":3,"file":"anthropic-intelligence.tool.d.ts","sourceRoot":"","sources":["../../src/anthropic-intelligence.tool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,QAAQ,EAAE,MAAM,eAAe,CAAC;AACnD,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAmGtE,qBAAa,yBAA0B,SAAQ,YAAY;IACzD,OAAO,CAAC,YAAY,CAA8B;IAClD,OAAO,CAAC,MAAM,CAA+C;gBAEjD,MAAM,EAAE,WAAW;IAW/B;;OAEG;IACG,gBAAgB,CAAC,OAAO,EAAE,QAAQ,GAAG,OAAO,CAAC,UAAU,CAAC;IAqE9D;;OAEG;IACG,cAAc,CAAC,OAAO,EAAE,QAAQ,GAAG,OAAO,CAAC,UAAU,CAAC;IA+E5D;;OAEG;IACG,iBAAiB,CAAC,OAAO,EAAE,QAAQ,GAAG,OAAO,CAAC,UAAU,CAAC;IA4C/D;;OAEG;IACG,gBAAgB,CAAC,OAAO,EAAE,QAAQ,GAAG,OAAO,CAAC,UAAU,CAAC;IAoD9D;;OAEG;IACG,YAAY,CAAC,OAAO,EAAE,QAAQ,GAAG,OAAO,CAAC,UAAU,CAAC;IAwC1D;;OAEG;IACH,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IA+GlB;;OAEG;IACH,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IA6DhB;;OAEG;IACH,mBAAmB;;;;IAOnB;;OAEG;IACH,kBAAkB;;;;;;;;;;IAalB;;OAEG;IACH,cAAc;;;;CAMf"}
@@ -1,7 +1,7 @@
1
1
  import { oAddress } from '@olane/o-core';
2
- import { oVirtualTool } from '@olane/o-tool';
3
2
  import { LLM_PARAMS } from './methods/llm.methods.js';
4
- export class AnthropicIntelligenceTool extends oVirtualTool {
3
+ import { oLaneTool } from '@olane/o-lane';
4
+ export class AnthropicIntelligenceTool extends oLaneTool {
5
5
  constructor(config) {
6
6
  super({
7
7
  ...config,
@@ -11,7 +11,7 @@ export class AnthropicIntelligenceTool extends oVirtualTool {
11
11
  methods: LLM_PARAMS,
12
12
  dependencies: [],
13
13
  });
14
- this.defaultModel = 'claude-sonnet-4-20250514';
14
+ this.defaultModel = 'claude-sonnet-4-5-20250929';
15
15
  this.apiKey = process.env.ANTHROPIC_API_KEY || '';
16
16
  }
17
17
  /**
@@ -1,10 +1,12 @@
1
1
  import { oRequest } from '@olane/o-core';
2
- import { oToolConfig, oVirtualTool, ToolResult } from '@olane/o-tool';
3
- export declare class GeminiIntelligenceTool extends oVirtualTool {
2
+ import { ToolResult } from '@olane/o-tool';
3
+ import { oLaneTool } from '@olane/o-lane';
4
+ import { oNodeToolConfig } from '@olane/o-node';
5
+ export declare class GeminiIntelligenceTool extends oLaneTool {
4
6
  private apiKey;
5
7
  private baseUrl;
6
8
  private defaultModel;
7
- constructor(config: oToolConfig);
9
+ constructor(config: oNodeToolConfig);
8
10
  /**
9
11
  * Chat completion with Gemini
10
12
  */
@@ -1 +1 @@
1
- {"version":3,"file":"gemini-intelligence.tool.d.ts","sourceRoot":"","sources":["../../src/gemini-intelligence.tool.ts"],"names":[],"mappings":"AAAA,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OAEG;IACG,cAAc,CAAC,OAAO,EAAE,QAAQ,GAAG,OAAO,CAAC,UAAU,CAAC;IAmF5D;;OAEG;IACG,iBAAiB,CAAC,OAAO,EAAE,QAAQ,GAAG,OAAO,CAAC,UAAU,CAAC;IA0C/D;;OAEG;IACG,gBAAgB,CAAC,OAAO,EAAE,QAAQ,GAAG,OAAO,CAAC,UAAU,CAAC;IA4C9D;;OAEG;IACG,YAAY,CAAC,OAAO,EAAE,QAAQ,GAAG,OAAO,CAAC,UAAU,CAAC;CAiC3D"}
@@ -1,7 +1,7 @@
1
1
  import { oAddress } from '@olane/o-core';
2
- import { oVirtualTool } from '@olane/o-tool';
3
2
  import { LLM_PARAMS } from './methods/llm.methods.js';
4
- export class GeminiIntelligenceTool extends oVirtualTool {
3
+ import { oLaneTool } from '@olane/o-lane';
4
+ export class GeminiIntelligenceTool extends oLaneTool {
5
5
  constructor(config) {
6
6
  super({
7
7
  ...config,
@@ -1,10 +1,12 @@
1
1
  import { oRequest } from '@olane/o-core';
2
- import { oToolConfig, oVirtualTool, ToolResult } from '@olane/o-tool';
3
- export declare class GrokIntelligenceTool extends oVirtualTool {
2
+ import { ToolResult } from '@olane/o-tool';
3
+ import { oLaneTool } from '@olane/o-lane';
4
+ import { oNodeToolConfig } from '@olane/o-node';
5
+ export declare class GrokIntelligenceTool extends oLaneTool {
4
6
  private baseUrl;
5
7
  private defaultModel;
6
8
  private apiKey;
7
- constructor(config: oToolConfig);
9
+ constructor(config: oNodeToolConfig);
8
10
  _tool_completion(request: oRequest): Promise<ToolResult>;
9
11
  _tool_generate(request: oRequest): Promise<ToolResult>;
10
12
  _tool_list_models(request: oRequest): Promise<ToolResult>;
@@ -1 +1 @@
1
- {"version":3,"file":"grok-intelligence.tool.d.ts","sourceRoot":"","sources":["../../src/grok-intelligence.tool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,QAAQ,EAAE,MAAM,eAAe,CAAC;AACnD,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE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OAAO,EAAE,QAAQ,GAAG,OAAO,CAAC,UAAU,CAAC;IAgCxD,YAAY,CAAC,OAAO,EAAE,QAAQ,GAAG,OAAO,CAAC,UAAU,CAAC;CA+B3D"}
@@ -1,7 +1,7 @@
1
1
  import { oAddress } from '@olane/o-core';
2
- import { oVirtualTool } from '@olane/o-tool';
3
2
  import { LLM_PARAMS } from './methods/llm.methods.js';
4
- export class GrokIntelligenceTool extends oVirtualTool {
3
+ import { oLaneTool } from '@olane/o-lane';
4
+ export class GrokIntelligenceTool extends oLaneTool {
5
5
  constructor(config) {
6
6
  super({
7
7
  ...config,
@@ -3,5 +3,5 @@ export * from './openai-intelligence.tool.js';
3
3
  export * from './anthropic-intelligence.tool.js';
4
4
  export * from './gemini-intelligence.tool.js';
5
5
  export * from './grok-intelligence.tool.js';
6
- export * from './intelligence.tool.js';
6
+ export * from './o-intelligence.tool.js';
7
7
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,+BAA+B,CAAC;AAC9C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,kCAAkC,CAAC;AACjD,cAAc,+BAA+B,CAAC;AAC9C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,wBAAwB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,+BAA+B,CAAC;AAC9C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,kCAAkC,CAAC;AACjD,cAAc,+BAA+B,CAAC;AAC9C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,0BAA0B,CAAC"}
package/dist/src/index.js CHANGED
@@ -3,4 +3,4 @@ export * from './openai-intelligence.tool.js';
3
3
  export * from './anthropic-intelligence.tool.js';
4
4
  export * from './gemini-intelligence.tool.js';
5
5
  export * from './grok-intelligence.tool.js';
6
- export * from './intelligence.tool.js';
6
+ export * from './o-intelligence.tool.js';
@@ -0,0 +1,27 @@
1
+ import { oAddress } from '@olane/o-core';
2
+ import { ToolResult } from '@olane/o-tool';
3
+ import { LLMProviders } from './enums/llm-providers.enum.js';
4
+ import { ConfigureRequest } from './interfaces/configure.request.js';
5
+ import { PromptRequest } from './interfaces/prompt.request.js';
6
+ import { oLaneTool } from '@olane/o-lane';
7
+ import { oNodeToolConfig } from '@olane/o-node';
8
+ export declare class IntelligenceTool extends oLaneTool {
9
+ private roundRobinIndex;
10
+ constructor(config: oNodeToolConfig);
11
+ getSecureValue(key: string): Promise<string | null>;
12
+ getModelProvider(): Promise<{
13
+ provider: LLMProviders;
14
+ }>;
15
+ getProviderApiKey(provider: LLMProviders): Promise<{
16
+ apiKey: string;
17
+ }>;
18
+ chooseIntelligence(request: PromptRequest): Promise<{
19
+ choice: oAddress;
20
+ apiKey: string;
21
+ options: any;
22
+ }>;
23
+ _tool_configure(request: ConfigureRequest): Promise<ToolResult>;
24
+ _tool_prompt(request: PromptRequest): Promise<ToolResult>;
25
+ initialize(): Promise<void>;
26
+ }
27
+ //# sourceMappingURL=o-intelligence.tool.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"o-intelligence.tool.d.ts","sourceRoot":"","sources":["../../src/o-intelligence.tool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAa,MAAM,eAAe,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAQ3C,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAC7D,OAAO,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AAGrE,OAAO,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAC/D,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC1C,OAAO,EAAe,eAAe,EAAE,MAAM,eAAe,CAAC;AAE7D,qBAAa,gBAAiB,SAAQ,SAAS;IAC7C,OAAO,CAAC,eAAe,CAAK;gBAChB,MAAM,EAAE,eAAe;IAuB7B,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC;IAmBnD,gBAAgB,IAAI,OAAO,CAAC;QAAE,QAAQ,EAAE,YAAY,CAAA;KAAE,CAAC;IA6DvD,iBAAiB,CAAC,QAAQ,EAAE,YAAY,GAAG,OAAO,CAAC;QAAE,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;IAsEtE,kBAAkB,CAAC,OAAO,EAAE,aAAa,GAAG,OAAO,CAAC;QACxD,MAAM,EAAE,QAAQ,CAAC;QACjB,MAAM,EAAE,MAAM,CAAC;QACf,OAAO,EAAE,GAAG,CAAC;KACd,CAAC;IAWI,eAAe,CAAC,OAAO,EAAE,gBAAgB,GAAG,OAAO,CAAC,UAAU,CAAC;IA6C/D,YAAY,CAAC,OAAO,EAAE,aAAa,GAAG,OAAO,CAAC,UAAU,CAAC;IAqBzD,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;CAwClC"}
@@ -0,0 +1,276 @@
1
+ import { oAddress } from '@olane/o-core';
2
+ import { AnthropicIntelligenceTool } from './anthropic-intelligence.tool.js';
3
+ import { OpenAIIntelligenceTool } from './openai-intelligence.tool.js';
4
+ import { OllamaIntelligenceTool } from './ollama-intelligence.tool.js';
5
+ import { PerplexityIntelligenceTool } from './perplexity-intelligence.tool.js';
6
+ import { GrokIntelligenceTool } from './grok-intelligence.tool.js';
7
+ import { INTELLIGENCE_PARAMS } from './methods/intelligence.methods.js';
8
+ import { IntelligenceStorageKeys } from './enums/intelligence-storage-keys.enum.js';
9
+ import { LLMProviders } from './enums/llm-providers.enum.js';
10
+ import { oLaneTool } from '@olane/o-lane';
11
+ export class IntelligenceTool extends oLaneTool {
12
+ constructor(config) {
13
+ super({
14
+ ...config,
15
+ address: new oAddress('o://intelligence'),
16
+ methods: INTELLIGENCE_PARAMS,
17
+ description: config.description ||
18
+ 'Tool to help route LLM requests to the best intelligence tool',
19
+ dependencies: [
20
+ {
21
+ address: 'o://setup',
22
+ parameters: [
23
+ {
24
+ name: 'intelligence',
25
+ type: 'string',
26
+ description: 'The intelligence tool to use',
27
+ },
28
+ ],
29
+ },
30
+ ],
31
+ });
32
+ this.roundRobinIndex = 0;
33
+ }
34
+ async getSecureValue(key) {
35
+ try {
36
+ const response = await this.use(new oAddress('o://secure'), {
37
+ method: 'get',
38
+ params: {
39
+ key: key,
40
+ },
41
+ });
42
+ const payload = response.result.data;
43
+ if (payload && payload.value) {
44
+ return payload.value;
45
+ }
46
+ return null;
47
+ }
48
+ catch (error) {
49
+ this.logger.error('Error getting secure value: ', error);
50
+ return null;
51
+ }
52
+ }
53
+ async getModelProvider() {
54
+ // check ENV vars for override
55
+ if (process.env.MODEL_PROVIDER_CHOICE) {
56
+ if (Object.values(LLMProviders).includes(process.env.MODEL_PROVIDER_CHOICE)) {
57
+ return {
58
+ provider: process.env.MODEL_PROVIDER_CHOICE,
59
+ };
60
+ }
61
+ throw new Error('Invalid model provider choice, please set the MODEL_PROVIDER_CHOICE environment variable to a valid model provider');
62
+ }
63
+ let model = LLMProviders.ANTHROPIC;
64
+ // check secure storage for preference
65
+ const modelProviderStored = await this.getSecureValue(IntelligenceStorageKeys.MODEL_PROVIDER_PREFERENCE);
66
+ if (modelProviderStored) {
67
+ model = modelProviderStored;
68
+ return {
69
+ provider: model,
70
+ };
71
+ }
72
+ // no preference found, ask the human
73
+ this.logger.info('Asking human for model selection...');
74
+ try {
75
+ const modelResponse = await this.use(new oAddress('o://human'), {
76
+ method: 'question',
77
+ params: {
78
+ question: 'Which AI model do you want to use? (anthropic, openai, ollama, perplexity, grok)',
79
+ },
80
+ });
81
+ // process the human response
82
+ const { answer: modelHuman } = modelResponse.result.data;
83
+ model = modelHuman.toLowerCase();
84
+ await this.use(new oAddress('o://secure'), {
85
+ method: 'put',
86
+ params: {
87
+ key: IntelligenceStorageKeys.MODEL_PROVIDER_PREFERENCE,
88
+ value: model,
89
+ },
90
+ });
91
+ }
92
+ catch (error) {
93
+ this.logger.warn('Defaulting to anthropic');
94
+ model = LLMProviders.ANTHROPIC;
95
+ }
96
+ return {
97
+ provider: model,
98
+ };
99
+ }
100
+ async getProviderApiKey(provider) {
101
+ // leverage the ENV vars first
102
+ const ENV_KEYS = [
103
+ {
104
+ key: process.env.ANTHROPIC_API_KEY,
105
+ address: 'o://anthropic',
106
+ name: 'anthropic',
107
+ },
108
+ {
109
+ key: process.env.OPENAI_API_KEY,
110
+ address: 'o://openai',
111
+ name: 'openai',
112
+ },
113
+ {
114
+ key: process.env.SONAR_API_KEY,
115
+ address: 'o://sonar',
116
+ name: 'sonar',
117
+ },
118
+ {
119
+ key: process.env.GEMINI_API_KEY,
120
+ address: 'o://gemini',
121
+ name: 'gemini',
122
+ },
123
+ {
124
+ key: process.env.GROK_API_KEY,
125
+ address: 'o://grok',
126
+ name: 'grok',
127
+ },
128
+ ];
129
+ const modelEnvConfig = ENV_KEYS.find((key) => key.name === provider);
130
+ if (modelEnvConfig && !!modelEnvConfig.key) {
131
+ return {
132
+ apiKey: modelEnvConfig.key,
133
+ };
134
+ }
135
+ let apiKey = '';
136
+ // check secure storage 2nd
137
+ const apiKeyStored = await this.getSecureValue(`${provider}-${IntelligenceStorageKeys.API_KEY_SUFFIX}`);
138
+ if (apiKeyStored) {
139
+ return {
140
+ apiKey: apiKeyStored,
141
+ };
142
+ }
143
+ // no preference found, ask the human
144
+ this.logger.info('Asking human for API key...');
145
+ const keyResponse = await this.use(new oAddress('o://human'), {
146
+ method: 'question',
147
+ params: {
148
+ question: `What is the API key for the ${provider} model?`,
149
+ },
150
+ });
151
+ // process the human response
152
+ const { answer: key } = keyResponse.result.data;
153
+ apiKey = key;
154
+ await this.use(new oAddress('o://secure'), {
155
+ method: 'put',
156
+ params: {
157
+ key: `${provider}-${IntelligenceStorageKeys.API_KEY_SUFFIX}`,
158
+ value: key,
159
+ },
160
+ });
161
+ return {
162
+ apiKey: apiKey,
163
+ };
164
+ }
165
+ async chooseIntelligence(request) {
166
+ // check to see if anthropic key is in vault
167
+ const { provider } = await this.getModelProvider();
168
+ const { apiKey } = await this.getProviderApiKey(provider);
169
+ return {
170
+ choice: new oAddress(`o://${provider}`),
171
+ apiKey,
172
+ options: {},
173
+ };
174
+ }
175
+ async _tool_configure(request) {
176
+ const { modelProvider, hostingProvider, accessToken, address } = request.params;
177
+ if (hostingProvider) {
178
+ await this.use(new oAddress('o://secure'), {
179
+ method: 'put',
180
+ params: {
181
+ key: `${IntelligenceStorageKeys.HOSTING_PROVIDER_PREFERENCE}`,
182
+ value: hostingProvider,
183
+ },
184
+ });
185
+ }
186
+ if (accessToken) {
187
+ await this.use(new oAddress('o://secure'), {
188
+ method: 'put',
189
+ params: {
190
+ key: `${IntelligenceStorageKeys.ACCESS_TOKEN}`,
191
+ value: accessToken,
192
+ },
193
+ });
194
+ }
195
+ if (address) {
196
+ await this.use(new oAddress('o://secure'), {
197
+ method: 'put',
198
+ params: {
199
+ key: `${IntelligenceStorageKeys.OLANE_ADDRESS}`,
200
+ value: address,
201
+ },
202
+ });
203
+ }
204
+ if (modelProvider) {
205
+ await this.use(new oAddress('o://secure'), {
206
+ method: 'put',
207
+ params: {
208
+ key: `${IntelligenceStorageKeys.MODEL_PROVIDER_PREFERENCE}`,
209
+ value: modelProvider,
210
+ },
211
+ });
212
+ }
213
+ return {
214
+ success: true,
215
+ };
216
+ }
217
+ // we cannot wrap this tool use in a plan because it is a core dependency in all planning
218
+ async _tool_prompt(request) {
219
+ const { prompt } = request.params;
220
+ const intelligence = await this.chooseIntelligence(request);
221
+ this.logger.debug('Using intelligence: ', intelligence.choice.toString());
222
+ const child = this.hierarchyManager.getChild(intelligence.choice);
223
+ const response = await this.useChild(child || intelligence.choice, {
224
+ method: 'completion',
225
+ params: {
226
+ apiKey: intelligence.apiKey,
227
+ messages: [
228
+ {
229
+ role: 'user',
230
+ content: prompt,
231
+ },
232
+ ],
233
+ },
234
+ });
235
+ return response.result.data;
236
+ }
237
+ async initialize() {
238
+ await super.initialize();
239
+ const config = this.config;
240
+ const anthropicTool = new AnthropicIntelligenceTool({
241
+ ...config,
242
+ parent: this.address,
243
+ leader: this.leader,
244
+ });
245
+ await anthropicTool.start();
246
+ this.addChildNode(anthropicTool);
247
+ const openaiTool = new OpenAIIntelligenceTool({
248
+ ...config,
249
+ parent: this.address,
250
+ leader: this.leader,
251
+ });
252
+ await openaiTool.start();
253
+ this.addChildNode(openaiTool);
254
+ const ollamaTool = new OllamaIntelligenceTool({
255
+ ...config,
256
+ parent: this.address,
257
+ leader: this.leader,
258
+ });
259
+ await ollamaTool.start();
260
+ this.addChildNode(ollamaTool);
261
+ const perplexityTool = new PerplexityIntelligenceTool({
262
+ ...config,
263
+ parent: this.address,
264
+ leader: this.leader,
265
+ });
266
+ await perplexityTool.start();
267
+ this.addChildNode(perplexityTool);
268
+ const grokTool = new GrokIntelligenceTool({
269
+ ...config,
270
+ parent: this.address,
271
+ leader: this.leader,
272
+ });
273
+ await grokTool.start();
274
+ this.addChildNode(grokTool);
275
+ }
276
+ }
@@ -1,9 +1,11 @@
1
1
  import { oRequest } from '@olane/o-core';
2
- import { oToolConfig, oVirtualTool, ToolResult } from '@olane/o-tool';
3
- export declare class OllamaIntelligenceTool extends oVirtualTool {
2
+ import { ToolResult } from '@olane/o-tool';
3
+ import { oLaneTool } from '@olane/o-lane';
4
+ import { oNodeToolConfig } from '@olane/o-node';
5
+ export declare class OllamaIntelligenceTool extends oLaneTool {
4
6
  static defaultModel: string;
5
7
  static defaultUrl: string;
6
- constructor(config: oToolConfig);
8
+ constructor(config: oNodeToolConfig);
7
9
  /**
8
10
  * Chat completion with Ollama
9
11
  */
@@ -1 +1 @@
1
- {"version":3,"file":"ollama-intelligence.tool.d.ts","sourceRoot":"","sources":["../../src/ollama-intelligence.tool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,QAAQ,EAAgB,MAAM,eAAe,CAAC;AACjE,OAAO,EAAS,WAAW,EAAE,YAAY,EAAE,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C,UAAU,CAAC;IA4D9D;;OAEG;IACG,cAAc,CAAC,OAAO,EAAE,QAAQ,GAAG,OAAO,CAAC,UAAU,CAAC;IAgE5D;;OAEG;IACG,iBAAiB,CAAC,OAAO,EAAE,QAAQ,GAAG,OAAO,CAAC,UAAU,CAAC;IAmC/D;;OAEG;IACG,gBAAgB,CAAC,OAAO,EAAE,QAAQ,GAAG,OAAO,CAAC,UAAU,CAAC;IAiE9D;;OAEG;IACG,kBAAkB,CAAC,OAAO,EAAE,QAAQ,GAAG,OAAO,CAAC,UAAU,CAAC;IA6ChE;;OAEG;IACG,gBAAgB,CAAC,OAAO,EAAE,QAAQ,GAAG,OAAO,CAAC,UAAU,CAAC;IAwC9D;;OAEG;IACG,YAAY,CAAC,OAAO,EAAE,QAAQ,GAAG,OAAO,CAAC,UAAU,CAAC;CAyB3D"}
@@ -1,7 +1,7 @@
1
1
  import { oAddress } from '@olane/o-core';
2
- import { oVirtualTool } from '@olane/o-tool';
3
2
  import { LLM_PARAMS } from './methods/llm.methods.js';
4
- export class OllamaIntelligenceTool extends oVirtualTool {
3
+ import { oLaneTool } from '@olane/o-lane';
4
+ export class OllamaIntelligenceTool extends oLaneTool {
5
5
  constructor(config) {
6
6
  super({
7
7
  ...config,
@@ -1,11 +1,13 @@
1
1
  import { oRequest } from '@olane/o-core';
2
- import { oToolConfig, oVirtualTool, ToolResult } from '@olane/o-tool';
3
- export declare class OpenAIIntelligenceTool extends oVirtualTool {
2
+ import { ToolResult } from '@olane/o-tool';
3
+ import { oLaneTool } from '@olane/o-lane';
4
+ import { oNodeToolConfig } from '@olane/o-node';
5
+ export declare class OpenAIIntelligenceTool extends oLaneTool {
4
6
  private baseUrl;
5
7
  private defaultModel;
6
8
  private organization?;
7
9
  private apiKey;
8
- constructor(config: oToolConfig);
10
+ constructor(config: oNodeToolConfig);
9
11
  /**
10
12
  * Chat completion with OpenAI
11
13
  */
@@ -1 +1 @@
1
- {"version":3,"file":"openai-intelligence.tool.d.ts","sourceRoot":"","sources":["../../src/openai-intelligence.tool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,QAAQ,EAAE,MAAM,eAAe,CAAC;AACnD,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAoHtE,qBAAa,sBAAuB,SAAQ,YAAY;IACtD,OAAO,CAAC,OAAO,CAAuC;IACtD,OAAO,CAAC,YAAY,CAAwB;IAC5C,OAAO,CAAC,YAAY,CAAC,CAAS;IAC9B,OAAO,CAAC,MAAM,CAA4C;gBAE9C,MAAM,EAAE,WAAW;IAU/B;;OAEG;IACG,gBAAgB,CAAC,OAAO,EAAE,QAAQ,GAAG,OAAO,CAAC,UAAU,CAAC;IAyE9D;;OAEG;IACG,cAAc,CAAC,OAAO,EAAE,QAAQ,GAAG,OAAO,CAAC,UAAU,CAAC;IAwE5D;;OAEG;IACG,iBAAiB,CAAC,OAAO,EAAE,QAAQ,GAAG,OAAO,CAAC,UAAU,CAAC;IAgD/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;CAuC3D"}
1
+ {"version":3,"file":"openai-intelligence.tool.d.ts","sourceRoot":"","sources":["../../src/openai-intelligence.tool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,QAAQ,EAAE,MAAM,eAAe,CAAC;AACnD,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC1C,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAmHhD,qBAAa,sBAAuB,SAAQ,SAAS;IACnD,OAAO,CAAC,OAAO,CAAuC;IACtD,OAAO,CAAC,YAAY,CAAmB;IACvC,OAAO,CAAC,YAAY,CAAC,CAAS;IAC9B,OAAO,CAAC,MAAM,CAA4C;gBAE9C,MAAM,EAAE,eAAe;IAUnC;;OAEG;IACG,gBAAgB,CAAC,OAAO,EAAE,QAAQ,GAAG,OAAO,CAAC,UAAU,CAAC;IAyE9D;;OAEG;IACG,cAAc,CAAC,OAAO,EAAE,QAAQ,GAAG,OAAO,CAAC,UAAU,CAAC;IAwE5D;;OAEG;IACG,iBAAiB,CAAC,OAAO,EAAE,QAAQ,GAAG,OAAO,CAAC,UAAU,CAAC;IAgD/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;CAuC3D"}
@@ -1,7 +1,7 @@
1
1
  import { oAddress } from '@olane/o-core';
2
- import { oVirtualTool } from '@olane/o-tool';
3
2
  import { LLM_PARAMS } from './methods/llm.methods.js';
4
- export class OpenAIIntelligenceTool extends oVirtualTool {
3
+ import { oLaneTool } from '@olane/o-lane';
4
+ export class OpenAIIntelligenceTool extends oLaneTool {
5
5
  constructor(config) {
6
6
  super({
7
7
  ...config,
@@ -11,7 +11,7 @@ export class OpenAIIntelligenceTool extends oVirtualTool {
11
11
  dependencies: [],
12
12
  });
13
13
  this.baseUrl = 'https://api.openai.com/v1';
14
- this.defaultModel = 'gpt-5-mini';
14
+ this.defaultModel = 'gpt-5';
15
15
  this.apiKey = process.env.OPENAI_API_KEY || '';
16
16
  }
17
17
  /**
@@ -1,9 +1,11 @@
1
1
  import { oRequest } from '@olane/o-core';
2
- import { oToolConfig, oVirtualTool, ToolResult } from '@olane/o-tool';
3
- export declare class PerplexityIntelligenceTool extends oVirtualTool {
2
+ import { ToolResult } from '@olane/o-tool';
3
+ import { oLaneTool } from '@olane/o-lane';
4
+ import { oNodeToolConfig } from '@olane/o-node';
5
+ export declare class PerplexityIntelligenceTool extends oLaneTool {
4
6
  private defaultModel;
5
7
  private defaultApiKey;
6
- constructor(config: oToolConfig);
8
+ constructor(config: oNodeToolConfig);
7
9
  /**
8
10
  * Chat completion with Perplexity
9
11
  */
@@ -1 +1 @@
1
- {"version":3,"file":"perplexity-intelligence.tool.d.ts","sourceRoot":"","sources":["../../src/perplexity-intelligence.tool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,QAAQ,EAAE,MAAM,eAAe,CAAC;AACnD,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAqFtE,qBAAa,0BAA2B,SAAQ,YAAY;IAC1D,OAAO,CAAC,YAAY,CAAmB;IACvC,OAAO,CAAC,aAAa,CAA2C;gBAEpD,MAAM,EAAE,WAAW;IAW/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
+ {"version":3,"file":"perplexity-intelligence.tool.d.ts","sourceRoot":"","sources":["../../src/perplexity-intelligence.tool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,QAAQ,EAAE,MAAM,eAAe,CAAC;AACnD,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC1C,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAoFhD,qBAAa,0BAA2B,SAAQ,SAAS;IACvD,OAAO,CAAC,YAAY,CAAmB;IACvC,OAAO,CAAC,aAAa,CAA2C;gBAEpD,MAAM,EAAE,eAAe;IAWnC;;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,7 +1,7 @@
1
1
  import { oAddress } from '@olane/o-core';
2
- import { oVirtualTool } from '@olane/o-tool';
3
2
  import { LLM_PARAMS } from './methods/llm.methods.js';
4
- export class PerplexityIntelligenceTool extends oVirtualTool {
3
+ import { oLaneTool } from '@olane/o-lane';
4
+ export class PerplexityIntelligenceTool extends oLaneTool {
5
5
  constructor(config) {
6
6
  super({
7
7
  ...config,
@@ -0,0 +1,9 @@
1
+ import { oAddress, oTransport, ResolveRequest, RouteResponse } from '@olane/o-core';
2
+ import { oIntelligenceResolver } from './o-intelligence.resolver';
3
+ export declare class oIntelligenceOlaneResolver extends oIntelligenceResolver {
4
+ protected readonly address: oAddress;
5
+ constructor(address: oAddress);
6
+ get customTransports(): oTransport[];
7
+ resolve(resolveRequest: ResolveRequest): Promise<RouteResponse>;
8
+ }
9
+ //# sourceMappingURL=o-intelligence.olane-resolver.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"o-intelligence.olane-resolver.d.ts","sourceRoot":"","sources":["../../../src/router/o-intelligence.olane-resolver.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAER,UAAU,EACV,cAAc,EACd,aAAa,EACd,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAIlE,qBAAa,0BAA2B,SAAQ,qBAAqB;IACvD,SAAS,CAAC,QAAQ,CAAC,OAAO,EAAE,QAAQ;gBAAjB,OAAO,EAAE,QAAQ;IAIhD,IAAI,gBAAgB,IAAI,UAAU,EAAE,CAEnC;IAEK,OAAO,CAAC,cAAc,EAAE,cAAc,GAAG,OAAO,CAAC,aAAa,CAAC;CAkCtE"}
@@ -0,0 +1,40 @@
1
+ import { oAddress, oCustomTransport, } from '@olane/o-core';
2
+ import { oIntelligenceResolver } from './o-intelligence.resolver';
3
+ import { HostModelProvider } from '../enums/host-model-provider.enum';
4
+ import { oNodeTransport } from '@olane/o-node/dist/src/router/o-node.transport';
5
+ export class oIntelligenceOlaneResolver extends oIntelligenceResolver {
6
+ constructor(address) {
7
+ super(address);
8
+ this.address = address;
9
+ }
10
+ get customTransports() {
11
+ return [new oCustomTransport('/intelligence/olane')];
12
+ }
13
+ async resolve(resolveRequest) {
14
+ const { address, node, request, targetAddress } = resolveRequest;
15
+ if (!request) {
16
+ return {
17
+ nextHopAddress: address,
18
+ targetAddress: targetAddress,
19
+ requestOverride: request,
20
+ };
21
+ }
22
+ const { provider: hostingProvider, options, modelProvider, } = await this.getHostingProvider(node);
23
+ // forward to olane
24
+ if (hostingProvider === HostModelProvider.OLANE) {
25
+ const nextAddress = new oAddress(options.address + '/' + modelProvider, [
26
+ new oNodeTransport(process.env.OLANE_ADDRESS || '/dns4/leader.olane.com/tcp/4000/tls/ws'),
27
+ ]);
28
+ return {
29
+ nextHopAddress: nextAddress,
30
+ targetAddress: targetAddress,
31
+ requestOverride: request,
32
+ };
33
+ }
34
+ return {
35
+ nextHopAddress: address,
36
+ targetAddress: targetAddress,
37
+ requestOverride: request,
38
+ };
39
+ }
40
+ }
@@ -0,0 +1,15 @@
1
+ import { oAddress, oAddressResolver, oCore, oTransport } from '@olane/o-core';
2
+ import { LLMProviders } from '../enums/llm-providers.enum';
3
+ import { HostModelProvider } from '../enums/host-model-provider.enum';
4
+ export declare abstract class oIntelligenceResolver extends oAddressResolver {
5
+ protected readonly address: oAddress;
6
+ constructor(address: oAddress);
7
+ get customTransports(): oTransport[];
8
+ getSecureValue(node: oCore, key: string): Promise<string | null>;
9
+ getHostingProvider(node: oCore): Promise<{
10
+ modelProvider: LLMProviders;
11
+ provider: HostModelProvider;
12
+ options: any;
13
+ }>;
14
+ }
15
+ //# sourceMappingURL=o-intelligence.resolver.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"o-intelligence.resolver.d.ts","sourceRoot":"","sources":["../../../src/router/o-intelligence.resolver.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EACR,gBAAgB,EAChB,KAAK,EAEL,UAAU,EAEX,MAAM,eAAe,CAAC;AAGvB,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAC3D,OAAO,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AAEtE,8BAAsB,qBAAsB,SAAQ,gBAAgB;IACtD,SAAS,CAAC,QAAQ,CAAC,OAAO,EAAE,QAAQ;gBAAjB,OAAO,EAAE,QAAQ;IAIhD,IAAI,gBAAgB,IAAI,UAAU,EAAE,CAEnC;IAEK,cAAc,CAAC,IAAI,EAAE,KAAK,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC;IAmBhE,kBAAkB,CAAC,IAAI,EAAE,KAAK,GAAG,OAAO,CAAC;QAC7C,aAAa,EAAE,YAAY,CAAC;QAC5B,QAAQ,EAAE,iBAAiB,CAAC;QAC5B,OAAO,EAAE,GAAG,CAAC;KACd,CAAC;CA0CH"}
@@ -0,0 +1,62 @@
1
+ import { oAddress, oAddressResolver, oCustomTransport, } from '@olane/o-core';
2
+ import { IntelligenceStorageKeys } from '../enums/intelligence-storage-keys.enum';
3
+ import { LLMProviders } from '../enums/llm-providers.enum';
4
+ import { HostModelProvider } from '../enums/host-model-provider.enum';
5
+ export class oIntelligenceResolver extends oAddressResolver {
6
+ constructor(address) {
7
+ super(address);
8
+ this.address = address;
9
+ }
10
+ get customTransports() {
11
+ return [new oCustomTransport('/intelligence')];
12
+ }
13
+ async getSecureValue(node, key) {
14
+ try {
15
+ const response = await node.use(new oAddress('o://secure'), {
16
+ method: 'get',
17
+ params: {
18
+ key: key,
19
+ },
20
+ });
21
+ const payload = response.result.data;
22
+ if (payload && payload.value) {
23
+ return payload.value;
24
+ }
25
+ return null;
26
+ }
27
+ catch (error) {
28
+ this.logger.error('Error getting secure value: ', error);
29
+ return null;
30
+ }
31
+ }
32
+ async getHostingProvider(node) {
33
+ let provider = HostModelProvider.LOCAL;
34
+ const hostingProviderStored = await this.getSecureValue(node, IntelligenceStorageKeys.HOSTING_PROVIDER_PREFERENCE);
35
+ if (hostingProviderStored) {
36
+ provider = hostingProviderStored;
37
+ }
38
+ let token = null;
39
+ const accessTokenStored = await this.getSecureValue(node, IntelligenceStorageKeys.ACCESS_TOKEN);
40
+ if (accessTokenStored) {
41
+ token = accessTokenStored;
42
+ }
43
+ const addressStored = await this.getSecureValue(node, IntelligenceStorageKeys.OLANE_ADDRESS);
44
+ let address = 'o://leader/auth/intelligence';
45
+ if (addressStored) {
46
+ address = addressStored;
47
+ }
48
+ const modelProviderStored = await this.getSecureValue(node, IntelligenceStorageKeys.MODEL_PROVIDER_PREFERENCE);
49
+ let modelProvider = modelProviderStored;
50
+ if (!modelProvider) {
51
+ modelProvider = LLMProviders.ANTHROPIC;
52
+ }
53
+ return {
54
+ provider: provider,
55
+ modelProvider: modelProvider,
56
+ options: {
57
+ token: token,
58
+ address: address,
59
+ },
60
+ };
61
+ }
62
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@olane/o-intelligence",
3
- "version": "0.6.13",
3
+ "version": "0.7.1",
4
4
  "type": "module",
5
5
  "main": "dist/src/index.js",
6
6
  "types": "dist/src/index.d.ts",
@@ -56,10 +56,11 @@
56
56
  "typescript": "5.4.5"
57
57
  },
58
58
  "peerDependencies": {
59
- "@olane/o-config": "^0.6.12",
60
- "@olane/o-core": "^0.6.12",
61
- "@olane/o-protocol": "^0.6.12",
62
- "@olane/o-tool": "^0.6.12"
59
+ "@olane/o-config": "^0.7.0",
60
+ "@olane/o-core": "^0.7.0",
61
+ "@olane/o-protocol": "^0.7.0",
62
+ "@olane/o-tool": "^0.7.0",
63
+ "@olane/o-lane": "^0.7.0"
63
64
  },
64
65
  "dependencies": {
65
66
  "debug": "^4.4.1",