@olane/o-lane 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.
- package/README.md +1495 -0
- package/dist/src/capabilities/enums/o-capability.type-enum.d.ts +11 -0
- package/dist/src/capabilities/enums/o-capability.type-enum.d.ts.map +1 -0
- package/dist/src/capabilities/enums/o-capability.type-enum.js +11 -0
- package/dist/src/capabilities/index.d.ts +6 -0
- package/dist/src/capabilities/index.d.ts.map +1 -0
- package/dist/src/capabilities/index.js +5 -0
- package/dist/src/capabilities/interfaces/o-capability.config.d.ts +11 -0
- package/dist/src/capabilities/interfaces/o-capability.config.d.ts.map +1 -0
- package/dist/src/capabilities/interfaces/o-capability.config.js +1 -0
- package/dist/src/capabilities/interfaces/o-capability.intelligence-result.d.ts +5 -0
- package/dist/src/capabilities/interfaces/o-capability.intelligence-result.d.ts.map +1 -0
- package/dist/src/capabilities/interfaces/o-capability.intelligence-result.js +3 -0
- package/dist/src/capabilities/interfaces/o-capability.result-interface.d.ts +9 -0
- package/dist/src/capabilities/interfaces/o-capability.result-interface.d.ts.map +1 -0
- package/dist/src/capabilities/interfaces/o-capability.result-interface.js +1 -0
- package/dist/src/capabilities/o-capability.d.ts +16 -0
- package/dist/src/capabilities/o-capability.d.ts.map +1 -0
- package/dist/src/capabilities/o-capability.intelligence.d.ts +6 -0
- package/dist/src/capabilities/o-capability.intelligence.d.ts.map +1 -0
- package/dist/src/capabilities/o-capability.intelligence.js +40 -0
- package/dist/src/capabilities/o-capability.js +20 -0
- package/dist/src/capabilities/o-capability.result.d.ts +27 -0
- package/dist/src/capabilities/o-capability.result.d.ts.map +1 -0
- package/dist/src/capabilities/o-capability.result.js +27 -0
- package/dist/src/capabilities-all/o-capability.all.d.ts +5 -0
- package/dist/src/capabilities-all/o-capability.all.d.ts.map +1 -0
- package/dist/src/capabilities-all/o-capability.all.js +12 -0
- package/dist/src/capabilities-configure/interfaces/o-capability.configure-config.d.ts +8 -0
- package/dist/src/capabilities-configure/interfaces/o-capability.configure-config.d.ts.map +1 -0
- package/dist/src/capabilities-configure/interfaces/o-capability.configure-config.js +1 -0
- package/dist/src/capabilities-configure/o-capability.configure-result.d.ts +6 -0
- package/dist/src/capabilities-configure/o-capability.configure-result.d.ts.map +1 -0
- package/dist/src/capabilities-configure/o-capability.configure-result.js +3 -0
- package/dist/src/capabilities-configure/o-capability.configure.d.ts +16 -0
- package/dist/src/capabilities-configure/o-capability.configure.d.ts.map +1 -0
- package/dist/src/capabilities-configure/o-capability.configure.js +43 -0
- package/dist/src/capabilities-evaluate/o-capability.evaluate.d.ts +9 -0
- package/dist/src/capabilities-evaluate/o-capability.evaluate.d.ts.map +1 -0
- package/dist/src/capabilities-evaluate/o-capability.evaluate.js +15 -0
- package/dist/src/capabilities-multiple-step/interfaces/o-capability.multiple-step-config.d.ts +12 -0
- package/dist/src/capabilities-multiple-step/interfaces/o-capability.multiple-step-config.d.ts.map +1 -0
- package/dist/src/capabilities-multiple-step/interfaces/o-capability.multiple-step-config.js +1 -0
- package/dist/src/capabilities-multiple-step/o-capability.multiple-step.d.ts +14 -0
- package/dist/src/capabilities-multiple-step/o-capability.multiple-step.d.ts.map +1 -0
- package/dist/src/capabilities-multiple-step/o-capability.multiple-step.js +36 -0
- package/dist/src/capabilities-search/interfaces/o-capability.search-config.d.ts +12 -0
- package/dist/src/capabilities-search/interfaces/o-capability.search-config.d.ts.map +1 -0
- package/dist/src/capabilities-search/interfaces/o-capability.search-config.js +1 -0
- package/dist/src/capabilities-search/o-capability.search-result.d.ts +7 -0
- package/dist/src/capabilities-search/o-capability.search-result.d.ts.map +1 -0
- package/dist/src/capabilities-search/o-capability.search-result.js +8 -0
- package/dist/src/capabilities-search/o-capability.search.d.ts +27 -0
- package/dist/src/capabilities-search/o-capability.search.d.ts.map +1 -0
- package/dist/src/capabilities-search/o-capability.search.js +108 -0
- package/dist/src/capabilities-task/interfaces/o-capability.task-config.d.ts +15 -0
- package/dist/src/capabilities-task/interfaces/o-capability.task-config.d.ts.map +1 -0
- package/dist/src/capabilities-task/interfaces/o-capability.task-config.js +1 -0
- package/dist/src/capabilities-task/o-capability.task-result.d.ts +5 -0
- package/dist/src/capabilities-task/o-capability.task-result.d.ts.map +1 -0
- package/dist/src/capabilities-task/o-capability.task-result.js +3 -0
- package/dist/src/capabilities-task/o-capability.task.d.ts +20 -0
- package/dist/src/capabilities-task/o-capability.task.d.ts.map +1 -0
- package/dist/src/capabilities-task/o-capability.task.js +81 -0
- package/dist/src/enum/o-lane.status-enum.d.ts +10 -0
- package/dist/src/enum/o-lane.status-enum.d.ts.map +1 -0
- package/dist/src/enum/o-lane.status-enum.js +10 -0
- package/dist/src/index.d.ts +17 -0
- package/dist/src/index.d.ts.map +1 -0
- package/dist/src/index.js +16 -0
- package/dist/src/intent/index.d.ts +2 -0
- package/dist/src/intent/index.d.ts.map +1 -0
- package/dist/src/intent/index.js +1 -0
- package/dist/src/intent/interfaces/o-intent.config.d.ts +4 -0
- package/dist/src/intent/interfaces/o-intent.config.d.ts.map +1 -0
- package/dist/src/intent/interfaces/o-intent.config.js +1 -0
- package/dist/src/intent/o-intent.d.ts +10 -0
- package/dist/src/intent/o-intent.d.ts.map +1 -0
- package/dist/src/intent/o-intent.js +18 -0
- package/dist/src/intent-encoder/index.d.ts +2 -0
- package/dist/src/intent-encoder/index.d.ts.map +1 -0
- package/dist/src/intent-encoder/index.js +1 -0
- package/dist/src/intent-encoder/o-intent.encoder.d.ts +4 -0
- package/dist/src/intent-encoder/o-intent.encoder.d.ts.map +1 -0
- package/dist/src/intent-encoder/o-intent.encoder.js +3 -0
- package/dist/src/interfaces/configure.result.d.ts +7 -0
- package/dist/src/interfaces/configure.result.d.ts.map +1 -0
- package/dist/src/interfaces/configure.result.js +1 -0
- package/dist/src/interfaces/handshake.result.d.ts +13 -0
- package/dist/src/interfaces/handshake.result.d.ts.map +1 -0
- package/dist/src/interfaces/handshake.result.js +8 -0
- package/dist/src/interfaces/index.d.ts +8 -0
- package/dist/src/interfaces/index.d.ts.map +1 -0
- package/dist/src/interfaces/index.js +7 -0
- package/dist/src/interfaces/o-lane-query.config.d.ts +6 -0
- package/dist/src/interfaces/o-lane-query.config.d.ts.map +1 -0
- package/dist/src/interfaces/o-lane-query.config.js +1 -0
- package/dist/src/interfaces/o-lane-task.config.d.ts +10 -0
- package/dist/src/interfaces/o-lane-task.config.d.ts.map +1 -0
- package/dist/src/interfaces/o-lane-task.config.js +1 -0
- package/dist/src/interfaces/o-lane-type.enum.d.ts +8 -0
- package/dist/src/interfaces/o-lane-type.enum.d.ts.map +1 -0
- package/dist/src/interfaces/o-lane-type.enum.js +8 -0
- package/dist/src/interfaces/o-lane.config.d.ts +18 -0
- package/dist/src/interfaces/o-lane.config.d.ts.map +1 -0
- package/dist/src/interfaces/o-lane.config.js +1 -0
- package/dist/src/interfaces/o-lane.result.d.ts +6 -0
- package/dist/src/interfaces/o-lane.result.d.ts.map +1 -0
- package/dist/src/interfaces/o-lane.result.js +1 -0
- package/dist/src/manager/interfaces/o-lane.manager-config.d.ts +4 -0
- package/dist/src/manager/interfaces/o-lane.manager-config.d.ts.map +1 -0
- package/dist/src/manager/interfaces/o-lane.manager-config.js +1 -0
- package/dist/src/manager/o-lane.manager.d.ts +18 -0
- package/dist/src/manager/o-lane.manager.d.ts.map +1 -0
- package/dist/src/manager/o-lane.manager.js +50 -0
- package/dist/src/o-lane.context.d.ts +10 -0
- package/dist/src/o-lane.context.d.ts.map +1 -0
- package/dist/src/o-lane.context.js +28 -0
- package/dist/src/o-lane.d.ts +40 -0
- package/dist/src/o-lane.d.ts.map +1 -0
- package/dist/src/o-lane.js +202 -0
- package/dist/src/o-lane.tool.d.ts +16 -0
- package/dist/src/o-lane.tool.d.ts.map +1 -0
- package/dist/src/o-lane.tool.js +64 -0
- package/dist/src/prompts/agent.prompt.d.ts +2 -0
- package/dist/src/prompts/agent.prompt.d.ts.map +1 -0
- package/dist/src/prompts/agent.prompt.js +118 -0
- package/dist/src/prompts/configure.prompt.d.ts +2 -0
- package/dist/src/prompts/configure.prompt.d.ts.map +1 -0
- package/dist/src/prompts/configure.prompt.js +40 -0
- package/dist/src/prompts/custom.prompt.d.ts +2 -0
- package/dist/src/prompts/custom.prompt.d.ts.map +1 -0
- package/dist/src/prompts/custom.prompt.js +73 -0
- package/dist/src/storage/o-lane.storage.d.ts +5 -0
- package/dist/src/storage/o-lane.storage.d.ts.map +1 -0
- package/dist/src/storage/o-lane.storage.js +11 -0
- package/dist/src/utils/encoder.utils.d.ts +6 -0
- package/dist/src/utils/encoder.utils.d.ts.map +1 -0
- package/dist/src/utils/encoder.utils.js +8 -0
- package/dist/test/ai.spec.d.ts +2 -0
- package/dist/test/ai.spec.d.ts.map +1 -0
- package/dist/test/ai.spec.js +19 -0
- package/package.json +68 -0
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import { oAddress } from '@olane/o-core';
|
|
2
|
+
import { oCapability } from '../capabilities/o-capability.js';
|
|
3
|
+
import { oCapabilityType } from '../capabilities/enums/o-capability.type-enum.js';
|
|
4
|
+
import { oCapabilitySearchResult } from './o-capability.search-result.js';
|
|
5
|
+
export class oCapabilitySearch extends oCapability {
|
|
6
|
+
get type() {
|
|
7
|
+
return oCapabilityType.SEARCH;
|
|
8
|
+
}
|
|
9
|
+
static get type() {
|
|
10
|
+
return oCapabilityType.SEARCH;
|
|
11
|
+
}
|
|
12
|
+
get external() {
|
|
13
|
+
return this.config.params.isExternal;
|
|
14
|
+
}
|
|
15
|
+
get queries() {
|
|
16
|
+
return this.config.params.queries;
|
|
17
|
+
}
|
|
18
|
+
get explanation() {
|
|
19
|
+
return this.config.params.explanation;
|
|
20
|
+
}
|
|
21
|
+
async doExternalSearch(query) {
|
|
22
|
+
const response = await this.node.use(new oAddress('o://perplexity'), {
|
|
23
|
+
method: 'completion',
|
|
24
|
+
params: {
|
|
25
|
+
model: 'sonar',
|
|
26
|
+
messages: [
|
|
27
|
+
{
|
|
28
|
+
role: 'user',
|
|
29
|
+
content: query,
|
|
30
|
+
},
|
|
31
|
+
],
|
|
32
|
+
},
|
|
33
|
+
});
|
|
34
|
+
const data = response.result.data;
|
|
35
|
+
return data.message;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Search external providers.
|
|
39
|
+
*/
|
|
40
|
+
async externalSearch() {
|
|
41
|
+
const searchResults = [];
|
|
42
|
+
for (const query of this.queries) {
|
|
43
|
+
const searchResult = await this.doExternalSearch(query.query);
|
|
44
|
+
searchResults.push(searchResult);
|
|
45
|
+
}
|
|
46
|
+
let searchResultContext = `[Search Results Begin]`;
|
|
47
|
+
if (searchResults.length === 0) {
|
|
48
|
+
searchResultContext += `No more search results found!\n\n`;
|
|
49
|
+
}
|
|
50
|
+
// update the context with the search results
|
|
51
|
+
for (const searchResult of searchResults) {
|
|
52
|
+
searchResultContext += `External Search Result: ${searchResult || 'unknown'}\n\n`;
|
|
53
|
+
}
|
|
54
|
+
searchResultContext += `[Search Results End]`;
|
|
55
|
+
return new oCapabilitySearchResult({
|
|
56
|
+
result: searchResultContext,
|
|
57
|
+
type: oCapabilityType.EVALUATE,
|
|
58
|
+
config: this.config,
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
async doInternalSearch(query, limit) {
|
|
62
|
+
const response = await this.node.use(new oAddress('o://search'), {
|
|
63
|
+
method: 'vector',
|
|
64
|
+
params: {
|
|
65
|
+
query: query,
|
|
66
|
+
limit: limit || 20,
|
|
67
|
+
},
|
|
68
|
+
});
|
|
69
|
+
let searchResultContext = ``;
|
|
70
|
+
const data = response.result.data;
|
|
71
|
+
let filteredSearchResults = data;
|
|
72
|
+
if (filteredSearchResults.length === 0) {
|
|
73
|
+
searchResultContext += `No more search results found!\n\n`;
|
|
74
|
+
}
|
|
75
|
+
// update the context with the search results
|
|
76
|
+
for (const searchResult of filteredSearchResults) {
|
|
77
|
+
// internal search results
|
|
78
|
+
if (searchResult?.metadata) {
|
|
79
|
+
// add the context data
|
|
80
|
+
searchResultContext += `Tool Address: ${searchResult?.metadata?.address || 'unknown'}\nTool Data: ${searchResult?.pageContent || 'unknown'}\n\n`;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
return searchResultContext;
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Search internal providers such as the local vector store, local database, etc.
|
|
87
|
+
*/
|
|
88
|
+
async internalSearch() {
|
|
89
|
+
// find all tools that are search tools
|
|
90
|
+
let searchResultContext = `[Search Results Begin]`;
|
|
91
|
+
for (const query of this.queries) {
|
|
92
|
+
const searchResult = await this.doInternalSearch(query.query, query.limit);
|
|
93
|
+
searchResultContext += searchResult;
|
|
94
|
+
}
|
|
95
|
+
searchResultContext += `[Search Results End]`;
|
|
96
|
+
return new oCapabilitySearchResult({
|
|
97
|
+
result: searchResultContext,
|
|
98
|
+
type: oCapabilityType.EVALUATE,
|
|
99
|
+
config: this.config,
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
async run() {
|
|
103
|
+
const result = this.external
|
|
104
|
+
? await this.externalSearch()
|
|
105
|
+
: await this.internalSearch();
|
|
106
|
+
return result;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { oCapabilityConfig } from '../../capabilities/interfaces/o-capability.config.js';
|
|
2
|
+
export interface oCapabilityTaskConfig extends oCapabilityConfig {
|
|
3
|
+
params: {
|
|
4
|
+
task: {
|
|
5
|
+
address: string;
|
|
6
|
+
payload: {
|
|
7
|
+
method: string;
|
|
8
|
+
params: {
|
|
9
|
+
[key: string]: any;
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=o-capability.task-config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"o-capability.task-config.d.ts","sourceRoot":"","sources":["../../../../src/capabilities-task/interfaces/o-capability.task-config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,sDAAsD,CAAC;AAEzF,MAAM,WAAW,qBAAsB,SAAQ,iBAAiB;IAC9D,MAAM,EAAE;QACN,IAAI,EAAE;YACJ,OAAO,EAAE,MAAM,CAAC;YAChB,OAAO,EAAE;gBACP,MAAM,EAAE,MAAM,CAAC;gBACf,MAAM,EAAE;oBAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;iBAAE,CAAC;aAChC,CAAC;SACH,CAAC;KACH,CAAC;CACH"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"o-capability.task-result.d.ts","sourceRoot":"","sources":["../../../src/capabilities-task/o-capability.task-result.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,wCAAwC,CAAC;AAE3E,qBAAa,qBAAsB,SAAQ,iBAAiB;IAC1D,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { oCapability } from '../capabilities/o-capability.js';
|
|
2
|
+
import { oCapabilityTaskConfig } from './interfaces/o-capability.task-config.js';
|
|
3
|
+
import { oCapabilityType } from '../capabilities/enums/o-capability.type-enum.js';
|
|
4
|
+
import { oCapabilityTaskResult } from './o-capability.task-result.js';
|
|
5
|
+
export declare class oCapabilityTask extends oCapability {
|
|
6
|
+
config: oCapabilityTaskConfig;
|
|
7
|
+
get task(): {
|
|
8
|
+
address: string;
|
|
9
|
+
payload: {
|
|
10
|
+
method: string;
|
|
11
|
+
params: {
|
|
12
|
+
[key: string]: any;
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
get type(): oCapabilityType;
|
|
17
|
+
static get type(): oCapabilityType;
|
|
18
|
+
run(): Promise<oCapabilityTaskResult>;
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=o-capability.task.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"o-capability.task.d.ts","sourceRoot":"","sources":["../../../src/capabilities-task/o-capability.task.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAC9D,OAAO,EAAE,qBAAqB,EAAE,MAAM,0CAA0C,CAAC;AACjF,OAAO,EAAE,eAAe,EAAE,MAAM,iDAAiD,CAAC;AAClF,OAAO,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AAEtE,qBAAa,eAAgB,SAAQ,WAAW;IACvC,MAAM,EAAG,qBAAqB,CAAC;IAEtC,IAAI,IAAI;;;;;;;;MAEP;IAED,IAAI,IAAI,IAAI,eAAe,CAE1B;IAED,MAAM,KAAK,IAAI,oBAEd;IAWK,GAAG,IAAI,OAAO,CAAC,qBAAqB,CAAC;CA+D5C"}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { oAddress, oError, oErrorCodes } from '@olane/o-core';
|
|
2
|
+
import { oCapability } from '../capabilities/o-capability.js';
|
|
3
|
+
import { oCapabilityType } from '../capabilities/enums/o-capability.type-enum.js';
|
|
4
|
+
import { oCapabilityTaskResult } from './o-capability.task-result.js';
|
|
5
|
+
export class oCapabilityTask extends oCapability {
|
|
6
|
+
get task() {
|
|
7
|
+
return this.config.params.task;
|
|
8
|
+
}
|
|
9
|
+
get type() {
|
|
10
|
+
return oCapabilityType.TASK;
|
|
11
|
+
}
|
|
12
|
+
static get type() {
|
|
13
|
+
return oCapabilityType.TASK;
|
|
14
|
+
}
|
|
15
|
+
// async doConfigure(): Promise<oCapabilityTaskResult> {
|
|
16
|
+
// const c = new oCapabilityConfigure({
|
|
17
|
+
// intent: this.intent,
|
|
18
|
+
// params: {}
|
|
19
|
+
// node: this.node,
|
|
20
|
+
// });
|
|
21
|
+
// return c.run();
|
|
22
|
+
// }
|
|
23
|
+
async run() {
|
|
24
|
+
try {
|
|
25
|
+
// do MCP handshake to get the method + parameters + dependencies
|
|
26
|
+
this.logger.debug('Running task: ', this.config);
|
|
27
|
+
const { task } = this.config.params;
|
|
28
|
+
this.logger.debug('Task to do: ', task);
|
|
29
|
+
if (!task || !task.address) {
|
|
30
|
+
throw new oError(oErrorCodes.NOT_CONFIGURED, 'Failed to configure the tool use');
|
|
31
|
+
}
|
|
32
|
+
const params = task.payload?.params;
|
|
33
|
+
// params = await ObjectUtils.allKeyValues(params, async (key, val) => {
|
|
34
|
+
// let value = val;
|
|
35
|
+
// if (!oUsePlan.hasOlaneAddress(value)) {
|
|
36
|
+
// return value;
|
|
37
|
+
// }
|
|
38
|
+
// // extract the addresses & process them if LFS is needed
|
|
39
|
+
// this.logger.debug('Has olane address: ', value);
|
|
40
|
+
// const addresses = oUsePlan.extractAddresses(value);
|
|
41
|
+
// for (const address of addresses) {
|
|
42
|
+
// const largeDataResponse = await this.node.use(new oAddress(address));
|
|
43
|
+
// this.logger.debug(
|
|
44
|
+
// 'Large data response: ',
|
|
45
|
+
// largeDataResponse.result.data,
|
|
46
|
+
// );
|
|
47
|
+
// value = value.replace(
|
|
48
|
+
// address,
|
|
49
|
+
// (largeDataResponse.result.data as any)?.value || 'unknown value',
|
|
50
|
+
// );
|
|
51
|
+
// this.logger.debug('Updated the value with LFS value: ', value);
|
|
52
|
+
// }
|
|
53
|
+
// return value;
|
|
54
|
+
// });
|
|
55
|
+
const response = await this.node.use(new oAddress(task.address), {
|
|
56
|
+
method: task.payload?.method,
|
|
57
|
+
params: params,
|
|
58
|
+
});
|
|
59
|
+
return new oCapabilityTaskResult({
|
|
60
|
+
result: `Tool Address Use output: ${JSON.stringify(response.result, null, 2)}`,
|
|
61
|
+
type: oCapabilityType.EVALUATE,
|
|
62
|
+
config: this.config,
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
catch (error) {
|
|
66
|
+
this.logger.error('Error executing task capability: ', error);
|
|
67
|
+
if (error instanceof oError) {
|
|
68
|
+
return new oCapabilityTaskResult({
|
|
69
|
+
error: error.toString(),
|
|
70
|
+
type: oCapabilityType.EVALUATE,
|
|
71
|
+
config: this.config,
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
return new oCapabilityTaskResult({
|
|
75
|
+
error: error?.message || error || 'Unknown error',
|
|
76
|
+
type: oCapabilityType.EVALUATE,
|
|
77
|
+
config: this.config,
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export declare enum oLaneStatus {
|
|
2
|
+
PENDING = "pending",
|
|
3
|
+
PREFLIGHT = "preflight",
|
|
4
|
+
RUNNING = "running",
|
|
5
|
+
POSTFLIGHT = "postflight",
|
|
6
|
+
COMPLETED = "completed",
|
|
7
|
+
CANCELLED = "cancelled",
|
|
8
|
+
FAILED = "failed"
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=o-lane.status-enum.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"o-lane.status-enum.d.ts","sourceRoot":"","sources":["../../../src/enum/o-lane.status-enum.ts"],"names":[],"mappings":"AAAA,oBAAY,WAAW;IACrB,OAAO,YAAY;IACnB,SAAS,cAAc;IACvB,OAAO,YAAY;IACnB,UAAU,eAAe;IACzB,SAAS,cAAc;IACvB,SAAS,cAAc;IACvB,MAAM,WAAW;CAClB"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export var oLaneStatus;
|
|
2
|
+
(function (oLaneStatus) {
|
|
3
|
+
oLaneStatus["PENDING"] = "pending";
|
|
4
|
+
oLaneStatus["PREFLIGHT"] = "preflight";
|
|
5
|
+
oLaneStatus["RUNNING"] = "running";
|
|
6
|
+
oLaneStatus["POSTFLIGHT"] = "postflight";
|
|
7
|
+
oLaneStatus["COMPLETED"] = "completed";
|
|
8
|
+
oLaneStatus["CANCELLED"] = "cancelled";
|
|
9
|
+
oLaneStatus["FAILED"] = "failed";
|
|
10
|
+
})(oLaneStatus || (oLaneStatus = {}));
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export * from './o-lane.js';
|
|
2
|
+
export * from './interfaces/index.js';
|
|
3
|
+
export * from './manager/o-lane.manager.js';
|
|
4
|
+
export * from './o-lane.context.js';
|
|
5
|
+
export * from './o-lane.tool.js';
|
|
6
|
+
export * from './capabilities/index.js';
|
|
7
|
+
export * from './intent/index.js';
|
|
8
|
+
export * from './capabilities-all/o-capability.all.js';
|
|
9
|
+
export * from './capabilities-configure/o-capability.configure.js';
|
|
10
|
+
export * from './capabilities-evaluate/o-capability.evaluate.js';
|
|
11
|
+
export * from './capabilities-multiple-step/o-capability.multiple-step.js';
|
|
12
|
+
export * from './capabilities-search/o-capability.search.js';
|
|
13
|
+
export * from './capabilities-task/o-capability.task.js';
|
|
14
|
+
export * from './prompts/custom.prompt.js';
|
|
15
|
+
export * from './intent-encoder/index.js';
|
|
16
|
+
export * from './enum/o-lane.status-enum.js';
|
|
17
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,uBAAuB,CAAC;AACtC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,qBAAqB,CAAC;AACpC,cAAc,kBAAkB,CAAC;AACjC,cAAc,yBAAyB,CAAC;AACxC,cAAc,mBAAmB,CAAC;AAClC,cAAc,wCAAwC,CAAC;AACvD,cAAc,oDAAoD,CAAC;AACnE,cAAc,kDAAkD,CAAC;AACjE,cAAc,4DAA4D,CAAC;AAC3E,cAAc,8CAA8C,CAAC;AAC7D,cAAc,0CAA0C,CAAC;AACzD,cAAc,4BAA4B,CAAC;AAC3C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,8BAA8B,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export * from './o-lane.js';
|
|
2
|
+
export * from './interfaces/index.js';
|
|
3
|
+
export * from './manager/o-lane.manager.js';
|
|
4
|
+
export * from './o-lane.context.js';
|
|
5
|
+
export * from './o-lane.tool.js';
|
|
6
|
+
export * from './capabilities/index.js';
|
|
7
|
+
export * from './intent/index.js';
|
|
8
|
+
export * from './capabilities-all/o-capability.all.js';
|
|
9
|
+
export * from './capabilities-configure/o-capability.configure.js';
|
|
10
|
+
export * from './capabilities-evaluate/o-capability.evaluate.js';
|
|
11
|
+
export * from './capabilities-multiple-step/o-capability.multiple-step.js';
|
|
12
|
+
export * from './capabilities-search/o-capability.search.js';
|
|
13
|
+
export * from './capabilities-task/o-capability.task.js';
|
|
14
|
+
export * from './prompts/custom.prompt.js';
|
|
15
|
+
export * from './intent-encoder/index.js';
|
|
16
|
+
export * from './enum/o-lane.status-enum.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/intent/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './o-intent.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"o-intent.config.d.ts","sourceRoot":"","sources":["../../../../src/intent/interfaces/o-intent.config.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,aAAa;IAC5B,MAAM,EAAE,MAAM,CAAC;CAChB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { oObject } from '@olane/o-core';
|
|
2
|
+
import { oIntentConfig } from './interfaces/o-intent.config.js';
|
|
3
|
+
export declare class oIntent extends oObject {
|
|
4
|
+
readonly config: oIntentConfig;
|
|
5
|
+
constructor(config: oIntentConfig);
|
|
6
|
+
get value(): string;
|
|
7
|
+
toString(): string;
|
|
8
|
+
toJSON(): any;
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=o-intent.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"o-intent.d.ts","sourceRoot":"","sources":["../../../src/intent/o-intent.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,OAAO,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAEhE,qBAAa,OAAQ,SAAQ,OAAO;IACtB,QAAQ,CAAC,MAAM,EAAE,aAAa;gBAArB,MAAM,EAAE,aAAa;IAI1C,IAAI,KAAK,IAAI,MAAM,CAElB;IAED,QAAQ,IAAI,MAAM;IAIlB,MAAM,IAAI,GAAG;CAKd"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { oObject } from '@olane/o-core';
|
|
2
|
+
export class oIntent extends oObject {
|
|
3
|
+
constructor(config) {
|
|
4
|
+
super();
|
|
5
|
+
this.config = config;
|
|
6
|
+
}
|
|
7
|
+
get value() {
|
|
8
|
+
return this.config.intent;
|
|
9
|
+
}
|
|
10
|
+
toString() {
|
|
11
|
+
return this.value;
|
|
12
|
+
}
|
|
13
|
+
toJSON() {
|
|
14
|
+
return {
|
|
15
|
+
intent: this.value,
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/intent-encoder/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './o-intent.encoder.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"o-intent.encoder.d.ts","sourceRoot":"","sources":["../../../src/intent-encoder/o-intent.encoder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAExC,qBAAa,cAAe,SAAQ,OAAO;CAAG"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"configure.result.d.ts","sourceRoot":"","sources":["../../../src/interfaces/configure.result.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAEtD,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,WAAW,CAAC;IAClB,IAAI,EAAE,eAAe,CAAC,SAAS,CAAC;CACjC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { oMethod } from '@olane/o-protocol';
|
|
2
|
+
import { oCapabilityType } from '../capabilities/enums/o-capability.type-enum.js';
|
|
3
|
+
import { oCapabilityResult } from '../capabilities/o-capability.result.js';
|
|
4
|
+
export declare class oHandshakeResult extends oCapabilityResult {
|
|
5
|
+
result?: {
|
|
6
|
+
tools: string[];
|
|
7
|
+
methods: {
|
|
8
|
+
[key: string]: oMethod;
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
type: oCapabilityType;
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=handshake.result.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"handshake.result.d.ts","sourceRoot":"","sources":["../../../src/interfaces/handshake.result.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EAAE,eAAe,EAAE,MAAM,iDAAiD,CAAC;AAClF,OAAO,EAAE,iBAAiB,EAAE,MAAM,wCAAwC,CAAC;AAE3E,qBAAa,gBAAiB,SAAQ,iBAAiB;IACrD,MAAM,CAAC,EAAE;QACP,KAAK,EAAE,MAAM,EAAE,CAAC;QAChB,OAAO,EAAE;YAAE,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;SAAE,CAAC;KACrC,CAAC;IACF,IAAI,EAAE,eAAe,CAA6B;CACnD"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { oCapabilityType } from '../capabilities/enums/o-capability.type-enum.js';
|
|
2
|
+
import { oCapabilityResult } from '../capabilities/o-capability.result.js';
|
|
3
|
+
export class oHandshakeResult extends oCapabilityResult {
|
|
4
|
+
constructor() {
|
|
5
|
+
super(...arguments);
|
|
6
|
+
this.type = oCapabilityType.HANDSHAKE;
|
|
7
|
+
}
|
|
8
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export * from './o-lane.config.js';
|
|
2
|
+
export * from './o-lane.result.js';
|
|
3
|
+
export * from './o-lane-query.config.js';
|
|
4
|
+
export * from './o-lane-task.config.js';
|
|
5
|
+
export * from './configure.result.js';
|
|
6
|
+
export * from './handshake.result.js';
|
|
7
|
+
export * from './o-lane-type.enum.js';
|
|
8
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/interfaces/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AACnC,cAAc,0BAA0B,CAAC;AACzC,cAAc,yBAAyB,CAAC;AACxC,cAAc,uBAAuB,CAAC;AACtC,cAAc,uBAAuB,CAAC;AACtC,cAAc,uBAAuB,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export * from './o-lane.config.js';
|
|
2
|
+
export * from './o-lane.result.js';
|
|
3
|
+
export * from './o-lane-query.config.js';
|
|
4
|
+
export * from './o-lane-task.config.js';
|
|
5
|
+
export * from './configure.result.js';
|
|
6
|
+
export * from './handshake.result.js';
|
|
7
|
+
export * from './o-lane-type.enum.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"o-lane-query.config.d.ts","sourceRoot":"","sources":["../../../src/interfaces/o-lane-query.config.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,UAAU,GAAG,UAAU,CAAC;CACnC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"o-lane-task.config.d.ts","sourceRoot":"","sources":["../../../src/interfaces/o-lane-task.config.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,WAAW;IAC1B,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE;QACP,MAAM,EAAE,MAAM,CAAC;QACf,MAAM,EAAE;YAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;SAAE,CAAC;KAChC,CAAC;CACH"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"o-lane-type.enum.d.ts","sourceRoot":"","sources":["../../../src/interfaces/o-lane-type.enum.ts"],"names":[],"mappings":"AAAA,oBAAY,SAAS;IACnB,QAAQ,aAAa;IACrB,MAAM,WAAW;IACjB,SAAS,cAAc;IACvB,GAAG,QAAQ;IACX,KAAK,UAAU;CAChB"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { oAddress } from '@olane/o-core';
|
|
2
|
+
import { oLaneContext } from '../o-lane.context.js';
|
|
3
|
+
import { oCapability } from '../capabilities/o-capability.js';
|
|
4
|
+
import { oIntent } from '../intent/o-intent.js';
|
|
5
|
+
import { oLaneTool } from '../o-lane.tool.js';
|
|
6
|
+
export interface oLaneConfig {
|
|
7
|
+
intent: oIntent;
|
|
8
|
+
caller: oAddress;
|
|
9
|
+
context?: oLaneContext;
|
|
10
|
+
sequence?: any[];
|
|
11
|
+
streamTo?: oAddress;
|
|
12
|
+
capabilities?: oCapability[];
|
|
13
|
+
currentNode: oLaneTool;
|
|
14
|
+
extraInstructions?: string;
|
|
15
|
+
parentLaneId?: string;
|
|
16
|
+
maxCycles?: number;
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=o-lane.config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"o-lane.config.d.ts","sourceRoot":"","sources":["../../../src/interfaces/o-lane.config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAS,MAAM,eAAe,CAAC;AAChD,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAC9D,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAChD,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAE9C,MAAM,WAAW,WAAW;IAE1B,MAAM,EAAE,OAAO,CAAC;IAChB,MAAM,EAAE,QAAQ,CAAC;IAEjB,OAAO,CAAC,EAAE,YAAY,CAAC;IACvB,QAAQ,CAAC,EAAE,GAAG,EAAE,CAAC;IAEjB,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB,YAAY,CAAC,EAAE,WAAW,EAAE,CAAC;IAG7B,WAAW,EAAE,SAAS,CAAC;IACvB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"o-lane.result.d.ts","sourceRoot":"","sources":["../../../src/interfaces/o-lane.result.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAE7D,MAAM,WAAW,WAAW;IAC1B,QAAQ,EAAE,iBAAiB,EAAE,CAAC;IAC9B,MAAM,EAAE,iBAAiB,CAAC;CAC3B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"o-lane.manager-config.d.ts","sourceRoot":"","sources":["../../../../src/manager/interfaces/o-lane.manager-config.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { oObject } from '@olane/o-core';
|
|
2
|
+
import { oLaneManagerConfig } from './interfaces/o-lane.manager-config.js';
|
|
3
|
+
import { oLane } from '../o-lane.js';
|
|
4
|
+
import { oLaneConfig } from '../interfaces/o-lane.config.js';
|
|
5
|
+
export declare class oLaneManager extends oObject {
|
|
6
|
+
readonly config?: oLaneManagerConfig | undefined;
|
|
7
|
+
lanes: oLane[];
|
|
8
|
+
constructor(config?: oLaneManagerConfig | undefined);
|
|
9
|
+
get maxLanes(): number;
|
|
10
|
+
createLane(config: oLaneConfig): Promise<oLane>;
|
|
11
|
+
cleanLanes(): void;
|
|
12
|
+
cancelLane(lane: oLane): void;
|
|
13
|
+
getLane(id: string): oLane | undefined;
|
|
14
|
+
teardown(): Promise<void>;
|
|
15
|
+
get activeLanes(): oLane[];
|
|
16
|
+
get staleLanes(): oLane[];
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=o-lane.manager.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"o-lane.manager.d.ts","sourceRoot":"","sources":["../../../src/manager/o-lane.manager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAExC,OAAO,EAAE,kBAAkB,EAAE,MAAM,uCAAuC,CAAC;AAC3E,OAAO,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AACrC,OAAO,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAG7D,qBAAa,YAAa,SAAQ,OAAO;IAE3B,QAAQ,CAAC,MAAM,CAAC;IADrB,KAAK,EAAE,KAAK,EAAE,CAAM;gBACN,MAAM,CAAC,gCAAoB;IAIhD,IAAI,QAAQ,IAAI,MAAM,CAErB;IAEK,UAAU,CAAC,MAAM,EAAE,WAAW,GAAG,OAAO,CAAC,KAAK,CAAC;IAYrD,UAAU,IAAI,IAAI;IAKlB,UAAU,CAAC,IAAI,EAAE,KAAK,GAAG,IAAI;IAS7B,OAAO,CAAC,EAAE,EAAE,MAAM,GAAG,KAAK,GAAG,SAAS;IAIhC,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC;IAM/B,IAAI,WAAW,IAAI,KAAK,EAAE,CAEzB;IAED,IAAI,UAAU,IAAI,KAAK,EAAE,CAExB;CACF"}
|