@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.
Files changed (143) hide show
  1. package/README.md +1495 -0
  2. package/dist/src/capabilities/enums/o-capability.type-enum.d.ts +11 -0
  3. package/dist/src/capabilities/enums/o-capability.type-enum.d.ts.map +1 -0
  4. package/dist/src/capabilities/enums/o-capability.type-enum.js +11 -0
  5. package/dist/src/capabilities/index.d.ts +6 -0
  6. package/dist/src/capabilities/index.d.ts.map +1 -0
  7. package/dist/src/capabilities/index.js +5 -0
  8. package/dist/src/capabilities/interfaces/o-capability.config.d.ts +11 -0
  9. package/dist/src/capabilities/interfaces/o-capability.config.d.ts.map +1 -0
  10. package/dist/src/capabilities/interfaces/o-capability.config.js +1 -0
  11. package/dist/src/capabilities/interfaces/o-capability.intelligence-result.d.ts +5 -0
  12. package/dist/src/capabilities/interfaces/o-capability.intelligence-result.d.ts.map +1 -0
  13. package/dist/src/capabilities/interfaces/o-capability.intelligence-result.js +3 -0
  14. package/dist/src/capabilities/interfaces/o-capability.result-interface.d.ts +9 -0
  15. package/dist/src/capabilities/interfaces/o-capability.result-interface.d.ts.map +1 -0
  16. package/dist/src/capabilities/interfaces/o-capability.result-interface.js +1 -0
  17. package/dist/src/capabilities/o-capability.d.ts +16 -0
  18. package/dist/src/capabilities/o-capability.d.ts.map +1 -0
  19. package/dist/src/capabilities/o-capability.intelligence.d.ts +6 -0
  20. package/dist/src/capabilities/o-capability.intelligence.d.ts.map +1 -0
  21. package/dist/src/capabilities/o-capability.intelligence.js +40 -0
  22. package/dist/src/capabilities/o-capability.js +20 -0
  23. package/dist/src/capabilities/o-capability.result.d.ts +27 -0
  24. package/dist/src/capabilities/o-capability.result.d.ts.map +1 -0
  25. package/dist/src/capabilities/o-capability.result.js +27 -0
  26. package/dist/src/capabilities-all/o-capability.all.d.ts +5 -0
  27. package/dist/src/capabilities-all/o-capability.all.d.ts.map +1 -0
  28. package/dist/src/capabilities-all/o-capability.all.js +12 -0
  29. package/dist/src/capabilities-configure/interfaces/o-capability.configure-config.d.ts +8 -0
  30. package/dist/src/capabilities-configure/interfaces/o-capability.configure-config.d.ts.map +1 -0
  31. package/dist/src/capabilities-configure/interfaces/o-capability.configure-config.js +1 -0
  32. package/dist/src/capabilities-configure/o-capability.configure-result.d.ts +6 -0
  33. package/dist/src/capabilities-configure/o-capability.configure-result.d.ts.map +1 -0
  34. package/dist/src/capabilities-configure/o-capability.configure-result.js +3 -0
  35. package/dist/src/capabilities-configure/o-capability.configure.d.ts +16 -0
  36. package/dist/src/capabilities-configure/o-capability.configure.d.ts.map +1 -0
  37. package/dist/src/capabilities-configure/o-capability.configure.js +43 -0
  38. package/dist/src/capabilities-evaluate/o-capability.evaluate.d.ts +9 -0
  39. package/dist/src/capabilities-evaluate/o-capability.evaluate.d.ts.map +1 -0
  40. package/dist/src/capabilities-evaluate/o-capability.evaluate.js +15 -0
  41. package/dist/src/capabilities-multiple-step/interfaces/o-capability.multiple-step-config.d.ts +12 -0
  42. package/dist/src/capabilities-multiple-step/interfaces/o-capability.multiple-step-config.d.ts.map +1 -0
  43. package/dist/src/capabilities-multiple-step/interfaces/o-capability.multiple-step-config.js +1 -0
  44. package/dist/src/capabilities-multiple-step/o-capability.multiple-step.d.ts +14 -0
  45. package/dist/src/capabilities-multiple-step/o-capability.multiple-step.d.ts.map +1 -0
  46. package/dist/src/capabilities-multiple-step/o-capability.multiple-step.js +36 -0
  47. package/dist/src/capabilities-search/interfaces/o-capability.search-config.d.ts +12 -0
  48. package/dist/src/capabilities-search/interfaces/o-capability.search-config.d.ts.map +1 -0
  49. package/dist/src/capabilities-search/interfaces/o-capability.search-config.js +1 -0
  50. package/dist/src/capabilities-search/o-capability.search-result.d.ts +7 -0
  51. package/dist/src/capabilities-search/o-capability.search-result.d.ts.map +1 -0
  52. package/dist/src/capabilities-search/o-capability.search-result.js +8 -0
  53. package/dist/src/capabilities-search/o-capability.search.d.ts +27 -0
  54. package/dist/src/capabilities-search/o-capability.search.d.ts.map +1 -0
  55. package/dist/src/capabilities-search/o-capability.search.js +108 -0
  56. package/dist/src/capabilities-task/interfaces/o-capability.task-config.d.ts +15 -0
  57. package/dist/src/capabilities-task/interfaces/o-capability.task-config.d.ts.map +1 -0
  58. package/dist/src/capabilities-task/interfaces/o-capability.task-config.js +1 -0
  59. package/dist/src/capabilities-task/o-capability.task-result.d.ts +5 -0
  60. package/dist/src/capabilities-task/o-capability.task-result.d.ts.map +1 -0
  61. package/dist/src/capabilities-task/o-capability.task-result.js +3 -0
  62. package/dist/src/capabilities-task/o-capability.task.d.ts +20 -0
  63. package/dist/src/capabilities-task/o-capability.task.d.ts.map +1 -0
  64. package/dist/src/capabilities-task/o-capability.task.js +81 -0
  65. package/dist/src/enum/o-lane.status-enum.d.ts +10 -0
  66. package/dist/src/enum/o-lane.status-enum.d.ts.map +1 -0
  67. package/dist/src/enum/o-lane.status-enum.js +10 -0
  68. package/dist/src/index.d.ts +17 -0
  69. package/dist/src/index.d.ts.map +1 -0
  70. package/dist/src/index.js +16 -0
  71. package/dist/src/intent/index.d.ts +2 -0
  72. package/dist/src/intent/index.d.ts.map +1 -0
  73. package/dist/src/intent/index.js +1 -0
  74. package/dist/src/intent/interfaces/o-intent.config.d.ts +4 -0
  75. package/dist/src/intent/interfaces/o-intent.config.d.ts.map +1 -0
  76. package/dist/src/intent/interfaces/o-intent.config.js +1 -0
  77. package/dist/src/intent/o-intent.d.ts +10 -0
  78. package/dist/src/intent/o-intent.d.ts.map +1 -0
  79. package/dist/src/intent/o-intent.js +18 -0
  80. package/dist/src/intent-encoder/index.d.ts +2 -0
  81. package/dist/src/intent-encoder/index.d.ts.map +1 -0
  82. package/dist/src/intent-encoder/index.js +1 -0
  83. package/dist/src/intent-encoder/o-intent.encoder.d.ts +4 -0
  84. package/dist/src/intent-encoder/o-intent.encoder.d.ts.map +1 -0
  85. package/dist/src/intent-encoder/o-intent.encoder.js +3 -0
  86. package/dist/src/interfaces/configure.result.d.ts +7 -0
  87. package/dist/src/interfaces/configure.result.d.ts.map +1 -0
  88. package/dist/src/interfaces/configure.result.js +1 -0
  89. package/dist/src/interfaces/handshake.result.d.ts +13 -0
  90. package/dist/src/interfaces/handshake.result.d.ts.map +1 -0
  91. package/dist/src/interfaces/handshake.result.js +8 -0
  92. package/dist/src/interfaces/index.d.ts +8 -0
  93. package/dist/src/interfaces/index.d.ts.map +1 -0
  94. package/dist/src/interfaces/index.js +7 -0
  95. package/dist/src/interfaces/o-lane-query.config.d.ts +6 -0
  96. package/dist/src/interfaces/o-lane-query.config.d.ts.map +1 -0
  97. package/dist/src/interfaces/o-lane-query.config.js +1 -0
  98. package/dist/src/interfaces/o-lane-task.config.d.ts +10 -0
  99. package/dist/src/interfaces/o-lane-task.config.d.ts.map +1 -0
  100. package/dist/src/interfaces/o-lane-task.config.js +1 -0
  101. package/dist/src/interfaces/o-lane-type.enum.d.ts +8 -0
  102. package/dist/src/interfaces/o-lane-type.enum.d.ts.map +1 -0
  103. package/dist/src/interfaces/o-lane-type.enum.js +8 -0
  104. package/dist/src/interfaces/o-lane.config.d.ts +18 -0
  105. package/dist/src/interfaces/o-lane.config.d.ts.map +1 -0
  106. package/dist/src/interfaces/o-lane.config.js +1 -0
  107. package/dist/src/interfaces/o-lane.result.d.ts +6 -0
  108. package/dist/src/interfaces/o-lane.result.d.ts.map +1 -0
  109. package/dist/src/interfaces/o-lane.result.js +1 -0
  110. package/dist/src/manager/interfaces/o-lane.manager-config.d.ts +4 -0
  111. package/dist/src/manager/interfaces/o-lane.manager-config.d.ts.map +1 -0
  112. package/dist/src/manager/interfaces/o-lane.manager-config.js +1 -0
  113. package/dist/src/manager/o-lane.manager.d.ts +18 -0
  114. package/dist/src/manager/o-lane.manager.d.ts.map +1 -0
  115. package/dist/src/manager/o-lane.manager.js +50 -0
  116. package/dist/src/o-lane.context.d.ts +10 -0
  117. package/dist/src/o-lane.context.d.ts.map +1 -0
  118. package/dist/src/o-lane.context.js +28 -0
  119. package/dist/src/o-lane.d.ts +40 -0
  120. package/dist/src/o-lane.d.ts.map +1 -0
  121. package/dist/src/o-lane.js +202 -0
  122. package/dist/src/o-lane.tool.d.ts +16 -0
  123. package/dist/src/o-lane.tool.d.ts.map +1 -0
  124. package/dist/src/o-lane.tool.js +64 -0
  125. package/dist/src/prompts/agent.prompt.d.ts +2 -0
  126. package/dist/src/prompts/agent.prompt.d.ts.map +1 -0
  127. package/dist/src/prompts/agent.prompt.js +118 -0
  128. package/dist/src/prompts/configure.prompt.d.ts +2 -0
  129. package/dist/src/prompts/configure.prompt.d.ts.map +1 -0
  130. package/dist/src/prompts/configure.prompt.js +40 -0
  131. package/dist/src/prompts/custom.prompt.d.ts +2 -0
  132. package/dist/src/prompts/custom.prompt.d.ts.map +1 -0
  133. package/dist/src/prompts/custom.prompt.js +73 -0
  134. package/dist/src/storage/o-lane.storage.d.ts +5 -0
  135. package/dist/src/storage/o-lane.storage.d.ts.map +1 -0
  136. package/dist/src/storage/o-lane.storage.js +11 -0
  137. package/dist/src/utils/encoder.utils.d.ts +6 -0
  138. package/dist/src/utils/encoder.utils.d.ts.map +1 -0
  139. package/dist/src/utils/encoder.utils.js +8 -0
  140. package/dist/test/ai.spec.d.ts +2 -0
  141. package/dist/test/ai.spec.d.ts.map +1 -0
  142. package/dist/test/ai.spec.js +19 -0
  143. 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,5 @@
1
+ import { DiskStorageConfig, DiskStorageProvider } from '@olane/o-storage';
2
+ export declare class oLaneStorage extends DiskStorageProvider {
3
+ constructor(config: DiskStorageConfig);
4
+ }
5
+ //# sourceMappingURL=o-lane.storage.d.ts.map
@@ -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,6 @@
1
+ import type { oLane } from '../o-lane.js';
2
+ export declare class oLaneEncoderUtils {
3
+ static encode(data: oLane): string;
4
+ static decode(data: string): any;
5
+ }
6
+ //# sourceMappingURL=encoder.utils.d.ts.map
@@ -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,8 @@
1
+ export class oLaneEncoderUtils {
2
+ static encode(data) {
3
+ return JSON.stringify(data);
4
+ }
5
+ static decode(data) {
6
+ return JSON.parse(data);
7
+ }
8
+ }
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=ai.spec.d.ts.map
@@ -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
+ }