@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,73 @@
|
|
|
1
|
+
export const CUSTOM_AGENT_PROMPT = (intent, context, agentHistory, cycleInstructions, outputInstructions, extraInstructions) => `
|
|
2
|
+
You are an AI agent that either resolves the user intent or chooses the next step in a JSON formatted response that helps resolve the user intent.
|
|
3
|
+
|
|
4
|
+
You are in a secure environment and are allowed to operate with secure information such as api keys and other sensitive data.
|
|
5
|
+
|
|
6
|
+
You resolve user intents by "cycling" through the following steps:
|
|
7
|
+
1. Evaluate the intent
|
|
8
|
+
2. Answer the intent if possible
|
|
9
|
+
3. Search for tools and context
|
|
10
|
+
4. Configure the tool use
|
|
11
|
+
5. Use tools
|
|
12
|
+
6. Go back to step 2
|
|
13
|
+
|
|
14
|
+
[Intent Context Begin]
|
|
15
|
+
- An intent is a user request
|
|
16
|
+
- Intents are usually actions or queries
|
|
17
|
+
- User intents can start at any node
|
|
18
|
+
- User intents are resolved using the tools and data that are contained within that sub-section of the olane OS graph
|
|
19
|
+
[Intents Context End]
|
|
20
|
+
|
|
21
|
+
[Olane OS Graph Context Begin]
|
|
22
|
+
- Every Olane OS graph has a root node with child nodes beneath it
|
|
23
|
+
- Olane OS graph nodes contain tools to enable AI Agents to interface with everything (services, people, data, agents, etc)
|
|
24
|
+
- Everything in the Olane OS graph has an address to enable olane to access it
|
|
25
|
+
- Each node knows only about itself and the nodes below it
|
|
26
|
+
[Olane OS Graph Context End]
|
|
27
|
+
|
|
28
|
+
[Tool Use Rules Begin]
|
|
29
|
+
- If you are using a tool that requires authentication, search for tool methods that give insights about the logged in user before using any other methods
|
|
30
|
+
- When using a tool to create a resource, ensure that you have the proper access to the resource before using any other methods
|
|
31
|
+
[Tool Use Rules End]
|
|
32
|
+
|
|
33
|
+
[Address Rules Begin]
|
|
34
|
+
- Only use tool addresses that appear in search results, user intents, or previous cycle results
|
|
35
|
+
- Do not make up tool addresses
|
|
36
|
+
- A tool address is a string that starts with "o://"
|
|
37
|
+
- URL addresses are not tool addresses
|
|
38
|
+
- Tool addresses are used to access the tool's functionality
|
|
39
|
+
[Address Rules End]
|
|
40
|
+
|
|
41
|
+
[URL Address Rules Begin]
|
|
42
|
+
- HTTP/HTTPS URL addresses are not olane tool addresses
|
|
43
|
+
- When an address is provided in a user intent, get and analyze the contents of the address before assuming to know how to use it
|
|
44
|
+
[URL Address Rules End]
|
|
45
|
+
|
|
46
|
+
[Extra Instructions Begin]
|
|
47
|
+
${extraInstructions}
|
|
48
|
+
[Extra Instructions End]
|
|
49
|
+
|
|
50
|
+
[Cycle Instructions Begin]
|
|
51
|
+
${cycleInstructions}
|
|
52
|
+
[Cycle Instructions End]
|
|
53
|
+
|
|
54
|
+
[Cycle Return Instructions Begin]
|
|
55
|
+
GLOBAL RETURN INSTRUCTIONS:
|
|
56
|
+
1. Do not include \`\`\`json or \`\`\` in your output.
|
|
57
|
+
2. Only return the JSON object, do not include any other text.
|
|
58
|
+
${outputInstructions}
|
|
59
|
+
[Cycle Return Instructions End]
|
|
60
|
+
|
|
61
|
+
[User Intent Begin]
|
|
62
|
+
${intent}
|
|
63
|
+
[User Intent End]
|
|
64
|
+
|
|
65
|
+
[Additional Context Begin]
|
|
66
|
+
${context}
|
|
67
|
+
[Additional Context End]
|
|
68
|
+
|
|
69
|
+
[Previous Cycle Results Begin]
|
|
70
|
+
${agentHistory}
|
|
71
|
+
[Previous Cycle Results End]
|
|
72
|
+
|
|
73
|
+
`;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"o-lane.storage.d.ts","sourceRoot":"","sources":["../../../src/storage/o-lane.storage.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAE1E,qBAAa,YAAa,SAAQ,mBAAmB;gBACvC,MAAM,EAAE,iBAAiB;CAOtC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { oAddress } from '@olane/o-core';
|
|
2
|
+
import { DiskStorageProvider } from '@olane/o-storage';
|
|
3
|
+
export class oLaneStorage extends DiskStorageProvider {
|
|
4
|
+
constructor(config) {
|
|
5
|
+
super({
|
|
6
|
+
...config,
|
|
7
|
+
address: oAddress.lane(),
|
|
8
|
+
description: 'Disk storage provider',
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"encoder.utils.d.ts","sourceRoot":"","sources":["../../../src/utils/encoder.utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAE1C,qBAAa,iBAAiB;IAC5B,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,KAAK,GAAG,MAAM;IAIlC,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,GAAG;CAGjC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ai.spec.d.ts","sourceRoot":"","sources":["../../test/ai.spec.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { NodeState, oAddress } from '@olane/o-core';
|
|
2
|
+
import { expect } from 'chai';
|
|
3
|
+
import { oLaneTool } from '../src/o-lane.tool.js';
|
|
4
|
+
describe('in-process @memory', () => {
|
|
5
|
+
it('should be able to start a single node with no leader', async () => {
|
|
6
|
+
const node = new oLaneTool({
|
|
7
|
+
address: new oAddress('o://test'),
|
|
8
|
+
leader: null,
|
|
9
|
+
parent: null,
|
|
10
|
+
});
|
|
11
|
+
await node.start();
|
|
12
|
+
expect(node.state).to.equal(NodeState.RUNNING);
|
|
13
|
+
const transports = node.transports;
|
|
14
|
+
// expect(transports.length).to.equal(1);
|
|
15
|
+
// expect(transports[0].toString()).to.contain('/memory');
|
|
16
|
+
await node.stop();
|
|
17
|
+
expect(node.state).to.equal(NodeState.STOPPED);
|
|
18
|
+
});
|
|
19
|
+
});
|
package/package.json
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@olane/o-lane",
|
|
3
|
+
"version": "0.7.1",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"main": "dist/src/index.js",
|
|
6
|
+
"types": "dist/src/index.d.ts",
|
|
7
|
+
"exports": {
|
|
8
|
+
".": {
|
|
9
|
+
"types": "./dist/src/index.d.ts",
|
|
10
|
+
"default": "./dist/src/index.js"
|
|
11
|
+
}
|
|
12
|
+
},
|
|
13
|
+
"files": [
|
|
14
|
+
"dist/**/*",
|
|
15
|
+
"README.md",
|
|
16
|
+
"LICENSE"
|
|
17
|
+
],
|
|
18
|
+
"scripts": {
|
|
19
|
+
"test": "aegir test",
|
|
20
|
+
"test:node": "aegir test -t node",
|
|
21
|
+
"test:browser": "aegir test -t browser",
|
|
22
|
+
"dev": "DEBUG=o-protocol:* npx tsx src/tests/index.ts",
|
|
23
|
+
"build": "rm -rf dist && tsc",
|
|
24
|
+
"deep:clean": "rm -rf node_modules && rm package-lock.json",
|
|
25
|
+
"start:prod": "node dist/index.js",
|
|
26
|
+
"prepublishOnly": "npm run build",
|
|
27
|
+
"update:lib": "npm install @olane/o-core@latest",
|
|
28
|
+
"update:peers": "npm install @olane/o-core@latest @olane/o-config@latest @olane/o-protocol@latest @olane/o-tool@latest --save-peer",
|
|
29
|
+
"lint": "eslint src/**/*.ts"
|
|
30
|
+
},
|
|
31
|
+
"repository": {
|
|
32
|
+
"type": "git",
|
|
33
|
+
"url": "git+https://github.com/olane-labs/olane.git"
|
|
34
|
+
},
|
|
35
|
+
"author": "oLane Inc.",
|
|
36
|
+
"license": "ISC",
|
|
37
|
+
"description": "oLane path tool to help capture agentic processes",
|
|
38
|
+
"devDependencies": {
|
|
39
|
+
"@eslint/eslintrc": "^3.3.1",
|
|
40
|
+
"@eslint/js": "^9.29.0",
|
|
41
|
+
"@tsconfig/node20": "^20.1.6",
|
|
42
|
+
"@types/jest": "^30.0.0",
|
|
43
|
+
"@typescript-eslint/eslint-plugin": "^8.34.1",
|
|
44
|
+
"@typescript-eslint/parser": "^8.34.1",
|
|
45
|
+
"aegir": "^47.0.21",
|
|
46
|
+
"eslint": "^9.29.0",
|
|
47
|
+
"eslint-config-prettier": "^10.1.6",
|
|
48
|
+
"eslint-plugin-prettier": "^5.5.0",
|
|
49
|
+
"globals": "^16.2.0",
|
|
50
|
+
"jest": "^30.0.0",
|
|
51
|
+
"prettier": "^3.5.3",
|
|
52
|
+
"ts-jest": "^29.4.0",
|
|
53
|
+
"ts-node": "^10.9.2",
|
|
54
|
+
"tsconfig-paths": "^4.2.0",
|
|
55
|
+
"tsx": "^4.20.3",
|
|
56
|
+
"typescript": "5.4.5"
|
|
57
|
+
},
|
|
58
|
+
"peerDependencies": {
|
|
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
|
+
},
|
|
64
|
+
"dependencies": {
|
|
65
|
+
"debug": "^4.4.1",
|
|
66
|
+
"dotenv": "^16.5.0"
|
|
67
|
+
}
|
|
68
|
+
}
|