@olane/o-lane 0.7.12-alpha.6 → 0.7.12-alpha.61
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/src/capabilities/enums/o-capability.type-enum.d.ts +1 -0
- package/dist/src/capabilities/enums/o-capability.type-enum.d.ts.map +1 -1
- package/dist/src/capabilities/enums/o-capability.type-enum.js +1 -0
- package/dist/src/capabilities/interfaces/o-capability.config.d.ts +2 -0
- package/dist/src/capabilities/interfaces/o-capability.config.d.ts.map +1 -1
- package/dist/src/capabilities/interfaces/o-capability.result-interface.d.ts +1 -0
- package/dist/src/capabilities/interfaces/o-capability.result-interface.d.ts.map +1 -1
- package/dist/src/capabilities/o-capability.d.ts +1 -0
- package/dist/src/capabilities/o-capability.d.ts.map +1 -1
- package/dist/src/capabilities/o-capability.intelligence.d.ts.map +1 -1
- package/dist/src/capabilities/o-capability.intelligence.js +33 -8
- package/dist/src/capabilities/o-capability.js +3 -0
- package/dist/src/capabilities/o-capability.result.d.ts +2 -0
- package/dist/src/capabilities/o-capability.result.d.ts.map +1 -1
- package/dist/src/capabilities/o-capability.result.js +2 -0
- package/dist/src/capabilities/utils/result-stream-parser.d.ts +37 -0
- package/dist/src/capabilities/utils/result-stream-parser.d.ts.map +1 -0
- package/dist/src/capabilities/utils/result-stream-parser.js +90 -0
- package/dist/src/capabilities-multiple-step/interfaces/o-capability.multiple-step-config.d.ts +1 -0
- package/dist/src/capabilities-multiple-step/interfaces/o-capability.multiple-step-config.d.ts.map +1 -1
- package/dist/src/capabilities-multiple-step/o-capability.multiple-step.d.ts +2 -0
- package/dist/src/capabilities-multiple-step/o-capability.multiple-step.d.ts.map +1 -1
- package/dist/src/capabilities-multiple-step/o-capability.multiple-step.js +12 -0
- package/dist/src/capabilities-search/interfaces/o-capability.search-config.d.ts +1 -0
- package/dist/src/capabilities-search/interfaces/o-capability.search-config.d.ts.map +1 -1
- package/dist/src/capabilities-search/o-capability.search.d.ts.map +1 -1
- package/dist/src/capabilities-search/o-capability.search.js +24 -6
- package/dist/src/capabilities-task/interfaces/o-capability.task-config.d.ts +1 -0
- package/dist/src/capabilities-task/interfaces/o-capability.task-config.d.ts.map +1 -1
- package/dist/src/capabilities-task/o-capability.task.d.ts.map +1 -1
- package/dist/src/capabilities-task/o-capability.task.js +4 -0
- package/dist/src/errors/capability-errors.d.ts +71 -0
- package/dist/src/errors/capability-errors.d.ts.map +1 -0
- package/dist/src/errors/capability-errors.js +142 -0
- package/dist/src/errors/index.d.ts +5 -0
- package/dist/src/errors/index.d.ts.map +1 -0
- package/dist/src/errors/index.js +4 -0
- package/dist/src/formatters/index.d.ts +7 -0
- package/dist/src/formatters/index.d.ts.map +1 -0
- package/dist/src/formatters/index.js +6 -0
- package/dist/src/formatters/markdown-builder.d.ts +65 -0
- package/dist/src/formatters/markdown-builder.d.ts.map +1 -0
- package/dist/src/formatters/markdown-builder.js +120 -0
- package/dist/src/interfaces/o-lane.config.d.ts +2 -0
- package/dist/src/interfaces/o-lane.config.d.ts.map +1 -1
- package/dist/src/o-lane.d.ts +6 -0
- package/dist/src/o-lane.d.ts.map +1 -1
- package/dist/src/o-lane.js +142 -15
- package/dist/src/o-lane.tool.d.ts +2 -2
- package/dist/src/o-lane.tool.d.ts.map +1 -1
- package/dist/src/o-lane.tool.js +23 -6
- package/dist/src/prompts/agent.prompt.d.ts.map +1 -1
- package/dist/src/prompts/agent.prompt.js +18 -5
- package/package.json +7 -7
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"o-lane.tool.d.ts","sourceRoot":"","sources":["../../src/o-lane.tool.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"o-lane.tool.d.ts","sourceRoot":"","sources":["../../src/o-lane.tool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAuB,QAAQ,EAAa,MAAM,eAAe,CAAC;AACzE,OAAO,EACL,WAAW,EACX,SAAS,EACT,cAAc,EAEf,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAQzD,qBAAa,SAAU,SAAQ,SAAS;IACtC,OAAO,CAAC,OAAO,CAAe;gBAElB,MAAM,EAAE,WAAW;IAKzB,eAAe,CAAC,SAAS,EAAE,QAAQ,GAAG,OAAO,CAAC,gBAAgB,CAAC;IAyBrE;;;;OAIG;IACG,YAAY,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,GAAG,CAAC;IAoDzD;;;;;OAKG;IACG,YAAY,CAAC,OAAO,EAAE,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC;IA8B7C,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC;CAIhC"}
|
package/dist/src/o-lane.tool.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { oAddress } from '@olane/o-core';
|
|
2
|
-
import { oNodeTool } from '@olane/o-node';
|
|
1
|
+
import { CoreUtils, oAddress, oResponse } from '@olane/o-core';
|
|
2
|
+
import { oNodeTool, } from '@olane/o-node';
|
|
3
3
|
import { oCapabilityType } from './capabilities/index.js';
|
|
4
4
|
import { oIntent } from './intent/index.js';
|
|
5
5
|
import { oLaneContext } from './o-lane.context.js';
|
|
@@ -34,22 +34,36 @@ export class oLaneTool extends oNodeTool {
|
|
|
34
34
|
*/
|
|
35
35
|
async _tool_intent(request) {
|
|
36
36
|
this.logger.debug('Intent resolution called: ', request.params);
|
|
37
|
-
const { intent, context, streamTo } = request.params;
|
|
37
|
+
const { intent, context, streamTo, _isStreaming = false } = request.params;
|
|
38
38
|
const pc = await this.manager.createLane({
|
|
39
39
|
intent: new oIntent({ intent: intent }),
|
|
40
40
|
currentNode: this,
|
|
41
41
|
caller: this.address,
|
|
42
42
|
streamTo: streamTo ? new oAddress(streamTo) : undefined,
|
|
43
|
+
useStream: _isStreaming,
|
|
44
|
+
onChunk: _isStreaming
|
|
45
|
+
? async (chunk) => {
|
|
46
|
+
await CoreUtils.sendStreamResponse(oResponse.fromJSON(chunk), request.stream);
|
|
47
|
+
}
|
|
48
|
+
: undefined,
|
|
43
49
|
context: context
|
|
44
50
|
? new oLaneContext([
|
|
45
51
|
`[Chat History Context Begin]\n${context}\n[Chat History Context End]`,
|
|
46
52
|
])
|
|
47
53
|
: undefined,
|
|
48
54
|
});
|
|
49
|
-
const
|
|
50
|
-
|
|
51
|
-
|
|
55
|
+
const stream = request.stream;
|
|
56
|
+
// TODO: brendon experiment review
|
|
57
|
+
// stream.addEventListener('close', () => {
|
|
58
|
+
// this.logger.debug('Stream closed, cancelling lane for intent:', intent);
|
|
59
|
+
// pc.cancel();
|
|
60
|
+
// });
|
|
61
|
+
let response;
|
|
62
|
+
response = await pc.execute();
|
|
63
|
+
const completeResponse = {
|
|
52
64
|
result: response?.result,
|
|
65
|
+
humanResult: response?.humanResult, // Full human-readable formatted result (AI-generated markdown)
|
|
66
|
+
summary: response?.config?.params?.summary, // Short 1-2 sentence summary
|
|
53
67
|
error: response?.error,
|
|
54
68
|
cycles: pc.sequence.length,
|
|
55
69
|
cid: pc.cid?.toString(),
|
|
@@ -57,6 +71,9 @@ export class oLaneTool extends oNodeTool {
|
|
|
57
71
|
return s.result;
|
|
58
72
|
}),
|
|
59
73
|
};
|
|
74
|
+
await new Promise((resolve) => setTimeout(resolve, 3000)); // TODO: fix this: wait for 3 seconds to let the stream send 2 messages lol
|
|
75
|
+
console.log('completeResponse', completeResponse);
|
|
76
|
+
return completeResponse;
|
|
60
77
|
}
|
|
61
78
|
/**
|
|
62
79
|
* Replay a stored lane from storage by CID
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent.prompt.d.ts","sourceRoot":"","sources":["../../../src/prompts/agent.prompt.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,YAAY,WACf,MAAM,WACL,MAAM,gBACD,MAAM,qBACD,MAAM,
|
|
1
|
+
{"version":3,"file":"agent.prompt.d.ts","sourceRoot":"","sources":["../../../src/prompts/agent.prompt.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,YAAY,WACf,MAAM,WACL,MAAM,gBACD,MAAM,qBACD,MAAM,WA4IxB,CAAC"}
|
|
@@ -43,9 +43,15 @@ Step 5 - Use target tool address
|
|
|
43
43
|
|
|
44
44
|
Step 6 - Review the tool use results
|
|
45
45
|
1. Analyze each tool use result
|
|
46
|
-
2.
|
|
47
|
-
|
|
48
|
-
|
|
46
|
+
2. When formatting tool results for the user in a Stop Response, present as clean markdown:
|
|
47
|
+
- For general contexts, present as clean markdown:
|
|
48
|
+
* Use headings to organize different sections
|
|
49
|
+
* Use lists for multiple items
|
|
50
|
+
* Use bold for important values or labels
|
|
51
|
+
* Use code blocks for addresses (e.g., \`o://tool-address\`)
|
|
52
|
+
* Transform raw JSON into readable prose and structured lists
|
|
53
|
+
3. In the summary field, provide a 1-2 sentence overview
|
|
54
|
+
4. If it failed, clearly explain why in a user-friendly way
|
|
49
55
|
|
|
50
56
|
|
|
51
57
|
`, `
|
|
@@ -58,6 +64,7 @@ All Return Step Instructions:
|
|
|
58
64
|
3. Output the respective results using the matching output type.
|
|
59
65
|
4. Generate a reasoning key value pair for why this result was returned.
|
|
60
66
|
5. The reasoning should be no longer than 1 sentence.
|
|
67
|
+
6. The summary should be a short message used to inform the user of the result of the cycle. These updates should be insightful and concise and within 1-2 sentences.
|
|
61
68
|
6. Do not include \`\`\`json or \`\`\` in your output.
|
|
62
69
|
|
|
63
70
|
Complex Intent Results:
|
|
@@ -67,6 +74,7 @@ Complex Intent Results:
|
|
|
67
74
|
"simple intent 2",
|
|
68
75
|
"simple intent 3",
|
|
69
76
|
],
|
|
77
|
+
"summary": string,
|
|
70
78
|
"reasoning": string,
|
|
71
79
|
"type": "multiple_step",
|
|
72
80
|
}
|
|
@@ -76,6 +84,7 @@ Configure Response:
|
|
|
76
84
|
"intent": string,
|
|
77
85
|
"toolAddress": string,
|
|
78
86
|
"reasoning": string,
|
|
87
|
+
"summary": string,
|
|
79
88
|
"type": "configure",
|
|
80
89
|
}
|
|
81
90
|
|
|
@@ -89,20 +98,23 @@ Search Response:
|
|
|
89
98
|
],
|
|
90
99
|
"isExternal": boolean,
|
|
91
100
|
"reasoning": string,
|
|
101
|
+
"summary": string,
|
|
92
102
|
"type": "search",
|
|
93
103
|
}
|
|
94
104
|
|
|
95
105
|
Stop Response:
|
|
96
106
|
{
|
|
97
|
-
"result": string,
|
|
107
|
+
"result": string, // IMPORTANT: Format this as clean, readable markdown. Use headers (##, ###), lists (-, 1.), bold (**text**), and code blocks (\`code\`) to make the response easy to read. Structure tool outputs, search results, and data clearly. Focus on what the user needs to know, not raw data dumps.
|
|
98
108
|
"reasoning": string,
|
|
99
109
|
"addresses_to_index": [string], // COMMENT: If the results of a tool use include "address_to_index", list them in the "addresses_to_index" array.
|
|
110
|
+
"summary": string, // A concise 1-2 sentence summary for the user
|
|
100
111
|
"type": "stop",
|
|
101
112
|
}
|
|
102
113
|
|
|
103
114
|
Error Response:
|
|
104
115
|
{
|
|
105
116
|
"result": "string explaining the error",
|
|
117
|
+
"summary": string,
|
|
106
118
|
"reasoning": string,
|
|
107
119
|
"type": "evaluate",
|
|
108
120
|
}
|
|
@@ -112,7 +124,8 @@ Use Tool Response:
|
|
|
112
124
|
"task": {
|
|
113
125
|
"address": string,
|
|
114
126
|
"payload": { "method": string, "params": any }
|
|
115
|
-
}
|
|
127
|
+
},
|
|
128
|
+
"summary": string,
|
|
116
129
|
"type": "task",
|
|
117
130
|
}
|
|
118
131
|
[RETURN INSTRUCTIONS END]
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@olane/o-lane",
|
|
3
|
-
"version": "0.7.12-alpha.
|
|
3
|
+
"version": "0.7.12-alpha.61",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "dist/src/index.js",
|
|
6
6
|
"types": "dist/src/index.d.ts",
|
|
@@ -54,13 +54,13 @@
|
|
|
54
54
|
"typescript": "5.4.5"
|
|
55
55
|
},
|
|
56
56
|
"dependencies": {
|
|
57
|
-
"@olane/o-config": "0.7.12-alpha.
|
|
58
|
-
"@olane/o-core": "0.7.12-alpha.
|
|
59
|
-
"@olane/o-node": "0.7.12-alpha.
|
|
60
|
-
"@olane/o-protocol": "0.7.12-alpha.
|
|
61
|
-
"@olane/o-tool": "0.7.12-alpha.
|
|
57
|
+
"@olane/o-config": "0.7.12-alpha.61",
|
|
58
|
+
"@olane/o-core": "0.7.12-alpha.61",
|
|
59
|
+
"@olane/o-node": "0.7.12-alpha.61",
|
|
60
|
+
"@olane/o-protocol": "0.7.12-alpha.61",
|
|
61
|
+
"@olane/o-tool": "0.7.12-alpha.61",
|
|
62
62
|
"debug": "^4.4.1",
|
|
63
63
|
"dotenv": "^16.5.0"
|
|
64
64
|
},
|
|
65
|
-
"gitHead": "
|
|
65
|
+
"gitHead": "358c478df44b742fe83ce096d3e16bf2351815ea"
|
|
66
66
|
}
|