@olane/o-core 0.6.12 → 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 (257) hide show
  1. package/README.md +490 -140
  2. package/dist/src/connection/index.d.ts +8 -0
  3. package/dist/src/connection/index.d.ts.map +1 -0
  4. package/dist/src/connection/index.js +7 -0
  5. package/dist/src/connection/interfaces/connection-manager.config.d.ts +3 -0
  6. package/dist/src/connection/interfaces/connection-manager.config.d.ts.map +1 -0
  7. package/dist/src/{core → connection}/interfaces/connection-send-params.interface.d.ts +1 -0
  8. package/dist/src/connection/interfaces/connection-send-params.interface.d.ts.map +1 -0
  9. package/dist/src/connection/interfaces/connection.config.d.ts +7 -0
  10. package/dist/src/connection/interfaces/connection.config.d.ts.map +1 -0
  11. package/dist/src/connection/interfaces/index.d.ts +5 -0
  12. package/dist/src/connection/interfaces/index.d.ts.map +1 -0
  13. package/dist/src/connection/interfaces/index.js +4 -0
  14. package/dist/src/connection/interfaces/request-state.enum.d.ts +7 -0
  15. package/dist/src/connection/interfaces/request-state.enum.d.ts.map +1 -0
  16. package/dist/src/connection/interfaces/request-state.enum.js +7 -0
  17. package/dist/src/connection/o-connection-manager.d.ts +19 -0
  18. package/dist/src/connection/o-connection-manager.d.ts.map +1 -0
  19. package/dist/src/connection/o-connection-manager.js +27 -0
  20. package/dist/src/connection/o-connection.d.ts +20 -0
  21. package/dist/src/connection/o-connection.d.ts.map +1 -0
  22. package/dist/src/connection/o-connection.js +45 -0
  23. package/dist/src/{core/lib → connection}/o-request.d.ts +5 -1
  24. package/dist/src/connection/o-request.d.ts.map +1 -0
  25. package/dist/src/{core/lib → connection}/o-request.js +8 -1
  26. package/dist/src/connection/o-response.d.ts.map +1 -0
  27. package/dist/src/core/defaults/config.d.ts +1 -1
  28. package/dist/src/core/defaults/config.d.ts.map +1 -1
  29. package/dist/src/core/defaults/config.js +1 -1
  30. package/dist/src/core/graceful-shutdown.d.ts +1 -1
  31. package/dist/src/core/graceful-shutdown.d.ts.map +1 -1
  32. package/dist/src/core/graceful-shutdown.js +1 -1
  33. package/dist/src/core/index.d.ts +3 -5
  34. package/dist/src/core/index.d.ts.map +1 -1
  35. package/dist/src/core/index.js +3 -5
  36. package/dist/src/core/interfaces/index.d.ts +1 -2
  37. package/dist/src/core/interfaces/index.d.ts.map +1 -1
  38. package/dist/src/core/interfaces/index.js +1 -2
  39. package/dist/src/core/interfaces/{core-config.interface.d.ts → o-core.config.d.ts} +4 -5
  40. package/dist/src/core/interfaces/o-core.config.d.ts.map +1 -0
  41. package/dist/src/core/interfaces/o-core.interface.d.ts +18 -0
  42. package/dist/src/core/interfaces/o-core.interface.d.ts.map +1 -0
  43. package/dist/src/core/lib/index.d.ts +3 -7
  44. package/dist/src/core/lib/index.d.ts.map +1 -1
  45. package/dist/src/core/lib/index.js +3 -7
  46. package/dist/src/core/lib/o-hierarchy.manager.d.ts +24 -0
  47. package/dist/src/core/lib/o-hierarchy.manager.d.ts.map +1 -0
  48. package/dist/src/core/lib/o-hierarchy.manager.js +57 -0
  49. package/dist/src/core/lib/o-metrics.d.ts +5 -0
  50. package/dist/src/core/lib/o-metrics.d.ts.map +1 -0
  51. package/dist/src/core/lib/o-metrics.js +6 -0
  52. package/dist/src/core/lib/o-request.manager.d.ts +10 -0
  53. package/dist/src/core/lib/o-request.manager.d.ts.map +1 -0
  54. package/dist/src/core/lib/o-request.manager.js +18 -0
  55. package/dist/src/core/o-core.d.ts +190 -0
  56. package/dist/src/core/o-core.d.ts.map +1 -0
  57. package/dist/src/core/o-core.js +334 -0
  58. package/dist/src/core/o-object.d.ts +7 -0
  59. package/dist/src/core/o-object.d.ts.map +1 -0
  60. package/dist/src/core/o-object.js +10 -0
  61. package/dist/src/error/enums/codes.error.d.ts +16 -14
  62. package/dist/src/error/enums/codes.error.d.ts.map +1 -1
  63. package/dist/src/error/enums/codes.error.js +18 -16
  64. package/dist/src/error/index.d.ts +1 -1
  65. package/dist/src/error/index.d.ts.map +1 -1
  66. package/dist/src/error/index.js +1 -1
  67. package/dist/src/error/interfaces/o-error.interface.d.ts +6 -0
  68. package/dist/src/error/interfaces/o-error.interface.d.ts.map +1 -0
  69. package/dist/src/error/o-error.d.ts +15 -0
  70. package/dist/src/error/o-error.d.ts.map +1 -0
  71. package/dist/src/error/{tool.error.js → o-error.js} +4 -4
  72. package/dist/src/index.d.ts +3 -3
  73. package/dist/src/index.d.ts.map +1 -1
  74. package/dist/src/index.js +3 -3
  75. package/dist/src/router/enums/restricted-addresses.enum.d.ts +8 -0
  76. package/dist/src/router/enums/restricted-addresses.enum.d.ts.map +1 -0
  77. package/dist/src/router/enums/restricted-addresses.enum.js +13 -0
  78. package/dist/src/router/index.d.ts +9 -0
  79. package/dist/src/router/index.d.ts.map +1 -0
  80. package/dist/src/router/index.js +8 -0
  81. package/dist/src/router/interfaces/resolve.request.d.ts +10 -0
  82. package/dist/src/router/interfaces/resolve.request.d.ts.map +1 -0
  83. package/dist/src/router/interfaces/route.response.d.ts +8 -0
  84. package/dist/src/router/interfaces/route.response.d.ts.map +1 -0
  85. package/dist/src/router/o-address-resolution.d.ts +12 -0
  86. package/dist/src/router/o-address-resolution.d.ts.map +1 -0
  87. package/dist/src/router/o-address-resolution.js +42 -0
  88. package/dist/src/router/o-address-resolver.d.ts +14 -0
  89. package/dist/src/router/o-address-resolver.d.ts.map +1 -0
  90. package/dist/src/router/o-address-resolver.js +19 -0
  91. package/dist/src/router/o-address.d.ts +29 -0
  92. package/dist/src/router/o-address.d.ts.map +1 -0
  93. package/dist/src/router/o-address.js +95 -0
  94. package/dist/src/router/o-request.router.d.ts +18 -0
  95. package/dist/src/router/o-request.router.d.ts.map +1 -0
  96. package/dist/src/router/o-request.router.js +12 -0
  97. package/dist/src/router/o-router.d.ts +19 -0
  98. package/dist/src/router/o-router.d.ts.map +1 -0
  99. package/dist/src/router/o-router.js +14 -0
  100. package/dist/src/transports/custom.transport.d.ts +6 -0
  101. package/dist/src/transports/custom.transport.d.ts.map +1 -0
  102. package/dist/src/transports/custom.transport.js +10 -0
  103. package/dist/src/transports/index.d.ts +4 -0
  104. package/dist/src/transports/index.d.ts.map +1 -0
  105. package/dist/src/transports/index.js +3 -0
  106. package/dist/src/transports/interfaces/transport-type.enum.d.ts +5 -0
  107. package/dist/src/transports/interfaces/transport-type.enum.d.ts.map +1 -0
  108. package/dist/src/transports/interfaces/transport-type.enum.js +5 -0
  109. package/dist/src/transports/o-transport.d.ts +10 -0
  110. package/dist/src/transports/o-transport.d.ts.map +1 -0
  111. package/dist/src/transports/o-transport.js +16 -0
  112. package/dist/src/{core/utils → utils}/core.utils.d.ts +4 -3
  113. package/dist/src/utils/core.utils.d.ts.map +1 -0
  114. package/dist/src/{core/utils → utils}/core.utils.js +17 -2
  115. package/dist/src/utils/index.d.ts +2 -0
  116. package/dist/src/utils/index.d.ts.map +1 -1
  117. package/dist/src/utils/index.js +2 -0
  118. package/dist/src/{core/utils → utils}/logger.d.ts +1 -0
  119. package/dist/src/utils/logger.d.ts.map +1 -0
  120. package/dist/src/{core/utils → utils}/logger.js +4 -1
  121. package/dist/test/server/in-process.spec.js +2 -14
  122. package/package.json +2 -3
  123. package/dist/src/core/core.node.d.ts +0 -75
  124. package/dist/src/core/core.node.d.ts.map +0 -1
  125. package/dist/src/core/core.node.js +0 -302
  126. package/dist/src/core/interfaces/connection-manager.config.d.ts +0 -7
  127. package/dist/src/core/interfaces/connection-manager.config.d.ts.map +0 -1
  128. package/dist/src/core/interfaces/connection-send-params.interface.d.ts.map +0 -1
  129. package/dist/src/core/interfaces/core-config.interface.d.ts.map +0 -1
  130. package/dist/src/core/interfaces/restricted-addresses.enum.d.ts +0 -13
  131. package/dist/src/core/interfaces/restricted-addresses.enum.d.ts.map +0 -1
  132. package/dist/src/core/interfaces/restricted-addresses.enum.js +0 -18
  133. package/dist/src/core/lib/o-address-resolution.d.ts +0 -9
  134. package/dist/src/core/lib/o-address-resolution.d.ts.map +0 -1
  135. package/dist/src/core/lib/o-address-resolution.js +0 -24
  136. package/dist/src/core/lib/o-address-resolver.d.ts +0 -17
  137. package/dist/src/core/lib/o-address-resolver.d.ts.map +0 -1
  138. package/dist/src/core/lib/o-address-resolver.js +0 -36
  139. package/dist/src/core/lib/o-connection-manager.d.ts +0 -22
  140. package/dist/src/core/lib/o-connection-manager.d.ts.map +0 -1
  141. package/dist/src/core/lib/o-connection-manager.js +0 -65
  142. package/dist/src/core/lib/o-connection.d.ts +0 -27
  143. package/dist/src/core/lib/o-connection.d.ts.map +0 -1
  144. package/dist/src/core/lib/o-connection.js +0 -84
  145. package/dist/src/core/lib/o-request.d.ts.map +0 -1
  146. package/dist/src/core/lib/o-response.d.ts.map +0 -1
  147. package/dist/src/core/lib/resolvers/anything.resolver.d.ts +0 -8
  148. package/dist/src/core/lib/resolvers/anything.resolver.d.ts.map +0 -1
  149. package/dist/src/core/lib/resolvers/anything.resolver.js +0 -15
  150. package/dist/src/core/lib/resolvers/index.d.ts +0 -5
  151. package/dist/src/core/lib/resolvers/index.d.ts.map +0 -1
  152. package/dist/src/core/lib/resolvers/index.js +0 -4
  153. package/dist/src/core/lib/resolvers/method.resolver.d.ts +0 -8
  154. package/dist/src/core/lib/resolvers/method.resolver.d.ts.map +0 -1
  155. package/dist/src/core/lib/resolvers/method.resolver.js +0 -18
  156. package/dist/src/core/lib/resolvers/next-hop.resolver.d.ts +0 -10
  157. package/dist/src/core/lib/resolvers/next-hop.resolver.d.ts.map +0 -1
  158. package/dist/src/core/lib/resolvers/next-hop.resolver.js +0 -59
  159. package/dist/src/core/lib/resolvers/storage.resolver.d.ts +0 -6
  160. package/dist/src/core/lib/resolvers/storage.resolver.d.ts.map +0 -1
  161. package/dist/src/core/lib/resolvers/storage.resolver.js +0 -10
  162. package/dist/src/core/o-address.d.ts +0 -20
  163. package/dist/src/core/o-address.d.ts.map +0 -1
  164. package/dist/src/core/o-address.js +0 -47
  165. package/dist/src/core/utils/core.utils.d.ts.map +0 -1
  166. package/dist/src/core/utils/index.d.ts +0 -4
  167. package/dist/src/core/utils/index.d.ts.map +0 -1
  168. package/dist/src/core/utils/index.js +0 -3
  169. package/dist/src/core/utils/logger.d.ts.map +0 -1
  170. package/dist/src/core/utils/network.utils.d.ts +0 -16
  171. package/dist/src/core/utils/network.utils.d.ts.map +0 -1
  172. package/dist/src/core/utils/network.utils.js +0 -35
  173. package/dist/src/error/tool.error.d.ts +0 -19
  174. package/dist/src/error/tool.error.d.ts.map +0 -1
  175. package/dist/src/node/index.d.ts +0 -4
  176. package/dist/src/node/index.d.ts.map +0 -1
  177. package/dist/src/node/index.js +0 -3
  178. package/dist/src/node/interfaces/route.request.d.ts +0 -14
  179. package/dist/src/node/interfaces/route.request.d.ts.map +0 -1
  180. package/dist/src/node/lib/local-search.lib.d.ts +0 -6
  181. package/dist/src/node/lib/local-search.lib.d.ts.map +0 -1
  182. package/dist/src/node/lib/local-search.lib.js +0 -10
  183. package/dist/src/node/lib/network-activity.lib.d.ts +0 -12
  184. package/dist/src/node/lib/network-activity.lib.d.ts.map +0 -1
  185. package/dist/src/node/lib/network-activity.lib.js +0 -29
  186. package/dist/src/node/node.d.ts +0 -45
  187. package/dist/src/node/node.d.ts.map +0 -1
  188. package/dist/src/node/node.js +0 -346
  189. package/dist/src/node-virtual/index.d.ts +0 -2
  190. package/dist/src/node-virtual/index.d.ts.map +0 -1
  191. package/dist/src/node-virtual/index.js +0 -1
  192. package/dist/src/node-virtual/virtual.node.d.ts +0 -10
  193. package/dist/src/node-virtual/virtual.node.d.ts.map +0 -1
  194. package/dist/src/node-virtual/virtual.node.js +0 -12
  195. package/dist/src/plan/agent.plan.d.ts +0 -28
  196. package/dist/src/plan/agent.plan.d.ts.map +0 -1
  197. package/dist/src/plan/agent.plan.js +0 -184
  198. package/dist/src/plan/index.d.ts +0 -5
  199. package/dist/src/plan/index.d.ts.map +0 -1
  200. package/dist/src/plan/index.js +0 -4
  201. package/dist/src/plan/interfaces/configure.result.d.ts +0 -6
  202. package/dist/src/plan/interfaces/configure.result.d.ts.map +0 -1
  203. package/dist/src/plan/interfaces/handshake.result.d.ts +0 -14
  204. package/dist/src/plan/interfaces/handshake.result.d.ts.map +0 -1
  205. package/dist/src/plan/interfaces/plan-config.interface.d.ts +0 -14
  206. package/dist/src/plan/interfaces/plan-config.interface.d.ts.map +0 -1
  207. package/dist/src/plan/interfaces/plan-result.interface.d.ts +0 -6
  208. package/dist/src/plan/interfaces/plan-result.interface.d.ts.map +0 -1
  209. package/dist/src/plan/interfaces/plan-type.enum.d.ts +0 -8
  210. package/dist/src/plan/interfaces/plan-type.enum.d.ts.map +0 -1
  211. package/dist/src/plan/interfaces/plan-type.enum.js +0 -8
  212. package/dist/src/plan/interfaces/plan.result.d.ts +0 -15
  213. package/dist/src/plan/interfaces/plan.result.d.ts.map +0 -1
  214. package/dist/src/plan/interfaces/plan.result.js +0 -1
  215. package/dist/src/plan/interfaces/query.config.d.ts +0 -6
  216. package/dist/src/plan/interfaces/query.config.d.ts.map +0 -1
  217. package/dist/src/plan/interfaces/query.config.js +0 -1
  218. package/dist/src/plan/interfaces/task.config.d.ts +0 -10
  219. package/dist/src/plan/interfaces/task.config.d.ts.map +0 -1
  220. package/dist/src/plan/interfaces/task.config.js +0 -1
  221. package/dist/src/plan/o-plan.d.ts +0 -36
  222. package/dist/src/plan/o-plan.d.ts.map +0 -1
  223. package/dist/src/plan/o-plan.js +0 -190
  224. package/dist/src/plan/plan.context.d.ts +0 -10
  225. package/dist/src/plan/plan.context.d.ts.map +0 -1
  226. package/dist/src/plan/plan.context.js +0 -28
  227. package/dist/src/plan/prompts/agent.prompt.d.ts +0 -2
  228. package/dist/src/plan/prompts/agent.prompt.d.ts.map +0 -1
  229. package/dist/src/plan/prompts/agent.prompt.js +0 -111
  230. package/dist/src/plan/prompts/configure.prompt.d.ts +0 -2
  231. package/dist/src/plan/prompts/configure.prompt.d.ts.map +0 -1
  232. package/dist/src/plan/prompts/configure.prompt.js +0 -40
  233. package/dist/src/plan/prompts/custom.prompt.d.ts +0 -2
  234. package/dist/src/plan/prompts/custom.prompt.d.ts.map +0 -1
  235. package/dist/src/plan/prompts/custom.prompt.js +0 -80
  236. package/dist/src/plan/search/prompts/search-analysis.prompt.d.ts +0 -2
  237. package/dist/src/plan/search/prompts/search-analysis.prompt.d.ts.map +0 -1
  238. package/dist/src/plan/search/prompts/search-analysis.prompt.js +0 -14
  239. package/dist/src/plan/search/search.plan.d.ts +0 -21
  240. package/dist/src/plan/search/search.plan.d.ts.map +0 -1
  241. package/dist/src/plan/search/search.plan.js +0 -53
  242. package/dist/src/plan/use/index.d.ts +0 -2
  243. package/dist/src/plan/use/index.d.ts.map +0 -1
  244. package/dist/src/plan/use/index.js +0 -1
  245. package/dist/src/plan/use/use.plan.d.ts +0 -16
  246. package/dist/src/plan/use/use.plan.d.ts.map +0 -1
  247. package/dist/src/plan/use/use.plan.js +0 -149
  248. /package/dist/src/{core → connection}/interfaces/connection-manager.config.js +0 -0
  249. /package/dist/src/{core → connection}/interfaces/connection-send-params.interface.js +0 -0
  250. /package/dist/src/{core/interfaces/core-config.interface.js → connection/interfaces/connection.config.js} +0 -0
  251. /package/dist/src/{core/lib → connection}/o-response.d.ts +0 -0
  252. /package/dist/src/{core/lib → connection}/o-response.js +0 -0
  253. /package/dist/src/{node/interfaces/route.request.js → core/interfaces/o-core.config.js} +0 -0
  254. /package/dist/src/{plan/interfaces/configure.result.js → core/interfaces/o-core.interface.js} +0 -0
  255. /package/dist/src/{plan/interfaces/handshake.result.js → error/interfaces/o-error.interface.js} +0 -0
  256. /package/dist/src/{plan/interfaces/plan-config.interface.js → router/interfaces/resolve.request.js} +0 -0
  257. /package/dist/src/{plan/interfaces/plan-result.interface.js → router/interfaces/route.response.js} +0 -0
package/README.md CHANGED
@@ -1,194 +1,544 @@
1
- <p align="center">
2
- <img src="/docs/assets/logo-white.png" width="120" alt="Olane Logo">
3
- </p>
1
+ # @olane/o-core
4
2
 
5
- ## Olane Superintelligent network infrastructure
3
+ The kernel layer of Olane OS - an agentic operating system where AI agents are the users, and you build tool nodes as applications.
6
4
 
7
- *Try Self-hosted Version:*
8
- Open-sourced with Apache 2.0 license *maintained by olane labs and the OSS community*
5
+ [![npm version](https://badge.fury.io/js/%40olane%2Fo-core.svg)](https://www.npmjs.com/package/@olane/o-core)
6
+ [![License: ISC](https://img.shields.io/badge/License-ISC-blue.svg)](https://opensource.org/licenses/ISC)
9
7
 
10
- **Request Hosted Version:**
11
- [Join waitlist](https://olane.com)
8
+ ## What is o-core?
12
9
 
13
- **Benefits of running everything on a personal and private superintelligent network**
10
+ **o-core** is the **kernel layer** of Olane OS - the foundational runtime for building tool nodes that AI agents use. Think of it as the Linux kernel: it defines how processes work (lifecycle, IPC, addressing, routing) but doesn't implement specific transport layers.
14
11
 
15
- - Infrastructure *that **thinks***
16
- - Infrastructure *that **self-improves***
17
- - Infrastructure *that **communicates with anything**
18
- (Humans, AI agents, protocols like HTTP, TCP, A2A, MCP, APIs, Tools, etc.)*
19
- - Infrastructure *that's **owned by you** and is **device & system agnostic***
20
- - Infrastructure *that’s **zero trust, quantum-encrypted, with continuous MFA enabled***
12
+ ### The Three-Layer Model
21
13
 
22
- ## Olane Overview
14
+ ```
15
+ AI Agents (LLMs) → use → Tool Nodes (you build) → run on → Olane OS (o-core)
16
+ ```
23
17
 
24
- **Olane** is a peer-to-peer, secure, hierarchical AI network designed to organize data, resources, tools, and intelligent processes.
18
+ - **AI Agents (Users)**: GPT-4, Claude, etc. - the intelligent users
19
+ - **Tool Nodes (Applications)**: Domain-specific capabilities you build
20
+ - **o-core (OS Kernel)**: The runtime infrastructure that makes it all work
25
21
 
26
- Within an olane network, AI agents can perform long-running tasks using sensitive tooling inside a dedicated, private, and secure sandboxed environment.
22
+ This is **NOT** a network framework or API library - it's the abstract operating system layer that makes inter-process communication (IPC), resource addressing, and hierarchical organization possible.
27
23
 
28
- **Key Concepts**
24
+ ## Key Features
29
25
 
30
- 1. **o:// o-protocol**
31
-
32
- The `o://` protocol enables seamless communication and coordination across agents, tools, and networks.
33
-
34
- 2. **o-networks**
35
-
36
- Olane networks (`o-network`) transform every tool, data point, or intelligent action into a resolvable [o-address](https://github.com/olane-labs/o-protocol-private) — for example:
37
-
38
- `o://my-o-network/mcp/send email to client`
26
+ - 🏗️ **Tool Node Runtime**: Base infrastructure for creating tool node processes that agents use
27
+ - 📍 **Hierarchical Addressing**: `o://` protocol for filesystem-like tool node addressing
28
+ - 🔀 **Intelligent Routing**: Automatic request routing through tool node hierarchies
29
+ - 🔌 **Transport-Agnostic**: Abstract layer - works with any communication layer (libp2p, HTTP, custom)
30
+ - 🌳 **Hierarchy Management**: Built-in parent-child relationships between tool nodes
31
+ - 🔄 **Lifecycle Management**: Complete process state management and graceful shutdown
32
+ - 📊 **Observable**: Built-in metrics, logging, and request tracking
33
+ - 🛡️ **Fault-Tolerant**: Error handling, graceful degradation, and automatic cleanup
39
34
 
40
- More on [olane hierarchical organization](/docs/NETWORK_HIERARCHY.md) and why it is the [future of AI infrastructure](/docs/FUTURE_AI_INFRA.md).
41
-
42
- 3. **Interconnected Intelligence**
43
-
44
- o-addresses can be shared across networks, enabling secure, intelligent communication and knowledge sharing between organizations or agents:
35
+ ## Installation
36
+
37
+ ```bash
38
+ npm install @olane/o-core @olane/o-protocol
39
+ ```
40
+
41
+ ## Quick Start
42
+
43
+ ### Creating Your First Tool Node
44
+
45
+ ```typescript
46
+ import { oCore, oAddress, NodeType, NodeState } from '@olane/o-core';
47
+ import { oRequest, oResponse } from '@olane/o-core';
48
+
49
+ // Extend oCore to create your tool node
50
+ class MyToolNode extends oCore {
51
+ constructor(address: string) {
52
+ super({
53
+ address: new oAddress(address),
54
+ type: NodeType.AGENT, // Type remains AGENT for now (legacy naming)
55
+ description: 'My first tool node',
56
+ methods: {
57
+ greet: {
58
+ name: 'greet',
59
+ description: 'Greets the user',
60
+ parameters: {
61
+ name: { type: 'string', required: true }
62
+ }
63
+ }
64
+ }
65
+ });
66
+ }
67
+
68
+ // Implement required abstract methods
69
+ async execute(request: oRequest): Promise<any> {
70
+ const { method, params } = request;
45
71
 
46
- `o://share "o://my-network/mcp/send email" with my company's o-network`
72
+ if (method === 'greet') {
73
+ return { message: `Hello, ${params.name}!` };
74
+ }
47
75
 
48
- ![simple o-network diagram](/docs/assets/simple-network.png)
76
+ throw new Error(`Unknown method: ${method}`);
77
+ }
78
+
79
+ configureTransports(): any[] {
80
+ // Configure your transport layer (libp2p, HTTP, etc.)
81
+ return [];
82
+ }
83
+
84
+ async connect(nextHop: oAddress, target: oAddress) {
85
+ // Implement connection logic
86
+ return this.connectionManager.connect({ nextHop, target });
87
+ }
88
+
89
+ initializeRouter(): void {
90
+ // Initialize routing logic
91
+ this.router = new MyRouter();
92
+ }
93
+
94
+ async register(): Promise<void> {
95
+ // Register with parent or leader node
96
+ console.log('Tool node registered');
97
+ }
98
+
99
+ async unregister(): Promise<void> {
100
+ // Cleanup registration
101
+ console.log('Tool node unregistered');
102
+ }
103
+ }
104
+
105
+ // Create and start your tool node
106
+ const toolNode = new MyToolNode('o://company/customer-service');
107
+ await toolNode.start();
108
+
109
+ // AI agents can now use this tool node via its o:// address
110
+ const response = await toolNode.use(
111
+ new oAddress('o://company/customer-service'),
112
+ {
113
+ method: 'greet',
114
+ params: { name: 'Alice' }
115
+ }
116
+ );
117
+
118
+ console.log(response.result); // { message: "Hello, Alice!" }
119
+
120
+ // Stop the tool node gracefully
121
+ await toolNode.stop();
122
+ ```
49
123
 
50
- ## **Get started**
124
+ ### Tool Node Communication (IPC)
51
125
 
52
- Building on olane is easy, this section will quickly teach you how to:
126
+ ```typescript
127
+ // Tool Node A can communicate with Tool Node B using o:// addresses
128
+ const salesTool = new MyToolNode('o://company/sales');
129
+ const analyticsTool = new MyToolNode('o://company/analytics');
53
130
 
54
- 1. [Create your own network](#create-a-network)
55
- 2. [Use your own network](#use-your-network)
56
- 1. Build and Personalize
57
- 2. Monitor and Track
58
- 3. [Connect with other networks](#learning)
59
- 1. Access knowledge skills
60
- 2. Share knowledge skills
61
- 3. Communicate across bridges
62
- 4. Checkout out our [start building](/docs/START_BUILDING.md) page for more advanced topics and use cases
131
+ await salesTool.start();
132
+ await analyticsTool.start();
63
133
 
64
- ## **INSTALL 🎉**
134
+ // Sales tool calls analytics tool (inter-process communication)
135
+ const result = await salesTool.use(
136
+ new oAddress('o://company/analytics'),
137
+ {
138
+ method: 'analyze',
139
+ params: { data: salesData }
140
+ }
141
+ );
142
+ ```
65
143
 
66
- **Create your intelligent network 🌐**
144
+ ### Hierarchical Organization
67
145
 
68
- Follow these steps to create and start your olane network called `my-network`.
146
+ ```typescript
147
+ // Create a parent-child hierarchy of tool nodes
148
+ const parent = new MyToolNode('o://company');
149
+ const child1 = new MyToolNode('o://company/sales');
150
+ const child2 = new MyToolNode('o://company/marketing');
69
151
 
70
- ```bash
71
- # install the cli tool
72
- # clone the cli repo
73
- npm install -g @olane/o-cli
152
+ await parent.start();
153
+ await child1.start();
154
+ await child2.start();
74
155
 
75
- # create your first network
76
- olane create -p 4444 my-network
156
+ // Register children with parent
157
+ parent.addChildNode(child1);
158
+ parent.addChildNode(child2);
77
159
 
78
- # start your network
79
- olane start -d my-network
160
+ // Child tool nodes automatically inherit context from parent
161
+ // Routing happens automatically through the hierarchy
80
162
  ```
81
163
 
82
- *About your intelligent network:*
83
- *Every network comes out of the box with [tools](https://github.com/olane-labs/o-network-private/blob/main) 
164
+ ## Core Concepts
84
165
 
85
- >Network needs Node.js v20+ to run [update node.js tutorial](/docs/UPDATE_NODEJS.md)
166
+ ### Tool Node Lifecycle States
86
167
 
87
- > Congrats!!
88
- Here’s what you just unlocked
89
- Play Video
90
- >
168
+ Tool nodes (processes) transition through the following states:
91
169
 
92
- ## RUN 🏃
170
+ - `STOPPED` - Initial state, tool node is not running
171
+ - `STARTING` - Tool node is initializing
172
+ - `RUNNING` - Tool node is active and processing requests
173
+ - `STOPPING` - Tool node is shutting down gracefully
174
+ - `ERROR` - Tool node encountered an error
93
175
 
94
- **Use your intelligent network**
176
+ ```typescript
177
+ console.log(toolNode.state); // NodeState.RUNNING
95
178
 
96
- 1. Join your network ➕
97
- ```bash
98
- olane chat my-network
179
+ await toolNode.stop();
180
+ console.log(toolNode.state); // NodeState.STOPPED
99
181
  ```
100
- - Not only can *you* talk to your network, but your network can talk to you now
101
- 2. Talk to your network via "intent" (resolution) 🗣️
102
182
 
103
- ```bash
104
- # a secure network connection is created
105
- # Add new functionality like an MCP server
106
- > Add linear to my network
107
- .....Searching for linear context
108
- .....OAuth access is required, continue to login? (You will need browser access)
109
- .....Confirmed login success, creating a new node at location "o://my-network/mcp/linear"
110
- .....44 New skills discovered through this node!
111
- .....Intent success. Result: Network node added! Knowledge captured at o://plan/12345678910
112
- .....Your network "my-network" will now analyze linear to understand more about it and how you use it.
183
+ ### The o:// Protocol
184
+
185
+ Addresses in Olane OS follow a hierarchical filesystem-like pattern:
186
+
187
+ ```typescript
188
+ // Hierarchical addresses
189
+ const address1 = new oAddress('o://company/finance/accounting');
190
+ const address2 = new oAddress('o://users/alice/inbox');
191
+
192
+ // Address operations
193
+ console.log(address1.paths); // "company/finance/accounting"
194
+ console.log(address1.root); // "o://company"
195
+ console.log(address1.validate()); // true
196
+
197
+ // Static vs dynamic addresses
198
+ const staticAddr = address1.toStaticAddress();
199
+ console.log(staticAddr.toString()); // "o://accounting"
200
+ ```
201
+
202
+ **📖 For complete details on address resolution, routing algorithms, and custom resolvers, see the [Router System documentation](./src/router/README.md).**
203
+
204
+ ### Request/Response Pattern
205
+
206
+ All inter-process communication (IPC) follows a request/response pattern using JSON-RPC 2.0:
207
+
208
+ ```typescript
209
+ // Making a request from one tool node to another
210
+ const response: oResponse = await toolNode.use(
211
+ new oAddress('o://target/toolnode'),
212
+ {
213
+ method: 'processData',
214
+ params: { key: 'value' },
215
+ id: 'unique-request-id'
216
+ }
217
+ );
218
+
219
+ // Handling errors
220
+ try {
221
+ const response = await toolNode.use(targetAddress, requestData);
222
+ console.log(response.result);
223
+ } catch (error) {
224
+ if (error instanceof oError) {
225
+ console.error(`Error ${error.code}: ${error.message}`);
226
+ }
227
+ }
228
+ ```
229
+
230
+ **📖 Learn more about JSON-RPC messaging, request states, and connection lifecycle in the [Connection System documentation](./src/connection/README.md).**
231
+
232
+ ### Metrics and Observability
233
+
234
+ Every tool node tracks metrics automatically:
235
+
236
+ ```typescript
237
+ // Access tool node metrics
238
+ console.log(toolNode.metrics.successCount);
239
+ console.log(toolNode.metrics.errorCount);
240
+
241
+ // Built-in logging
242
+ toolNode.logger.debug('Debug message');
243
+ toolNode.logger.info('Info message');
244
+ toolNode.logger.warn('Warning message');
245
+ toolNode.logger.error('Error message');
246
+ ```
247
+
248
+ ## Architecture
249
+
250
+ ### Abstract Base Class
251
+
252
+ `oCore` is an abstract base class that provides:
253
+
254
+ - **Lifecycle Management**: `start()`, `stop()`, `initialize()`, `teardown()`
255
+ - **Communication**: `use()`, `use()`, `connect()`
256
+ - **Routing**: `router`, `initializeRouter()`
257
+ - **Hierarchy**: `addChildNode()`, `removeChildNode()`, `hierarchyManager`
258
+ - **State Management**: `state`, `NodeState` enum
259
+ - **Observability**: `metrics`, `logger`, `requestManager`
260
+
261
+ ### Key Components
262
+
263
+ #### 1. Router System (oAddress & oRouter)
264
+ Hierarchical addressing and intelligent routing for tool nodes
265
+
266
+ ```typescript
267
+ const addr = new oAddress('o://domain/subdomain/resource');
268
+ addr.validate(); // Check if address is valid
269
+ addr.toStaticAddress(); // Convert to static address
270
+ addr.toCID(); // Convert to Content ID
271
+
272
+ // Router determines the next hop in the network
273
+ const { nextHopAddress, targetAddress } = await router.translate(
274
+ address,
275
+ node
276
+ );
277
+ ```
278
+
279
+ **📚 [View detailed Router System documentation →](./src/router/README.md)**
280
+
281
+ #### 2. Connection System (oConnection & oConnectionManager)
282
+ Inter-Process Communication (IPC) layer for tool-node-to-tool-node messaging
283
+
284
+ ```typescript
285
+ // Connections are cached and reused
286
+ const connection = await connectionManager.connect({
287
+ nextHop: nextHopAddress,
288
+ target: targetAddress
289
+ });
290
+
291
+ // Send data over the connection
292
+ const response = await connection.send({
293
+ address: 'o://target/service',
294
+ payload: { key: 'value' }
295
+ });
296
+ ```
113
297
 
114
- # Assess your network's understanding of the data and tooling it contains
115
- > Who am I?
116
- .....Searching "my-network" for context
117
- .....Analyzing "my-network" context
118
- .....Summarizing
119
- .....You are a software engineer with a passion for anime. Your daily routine revolves around a mixture of client projects....
298
+ **📚 [View detailed Connection System documentation →](./src/connection/README.md)**
120
299
 
121
- # Assign jobs to your network (*coming soon)
122
- > Update me on the S&P 500 through Warren Buffet's perspective every morning
123
- when the markets open
300
+ #### 3. oHierarchyManager
301
+ Manages parent-child relationships between tool nodes
124
302
 
125
- -----teach your network with policies----
303
+ ```typescript
304
+ toolNode.hierarchyManager.addChild(childAddress);
305
+ toolNode.hierarchyManager.removeChild(childAddress);
306
+ console.log(toolNode.hierarchyManager.children);
307
+ ```
308
+
309
+ ## Advanced Usage
310
+
311
+ ### Custom Transport & Connection Implementation
312
+
313
+ ```typescript
314
+ import { oTransport, TransportType, oConnection, oConnectionConfig } from '@olane/o-core';
315
+
316
+ class MyCustomTransport extends oTransport {
317
+ constructor() {
318
+ super(TransportType.CUSTOM);
319
+ }
320
+
321
+ async send(data: any): Promise<any> {
322
+ // Implement your transport logic (HTTP, WebSocket, etc.)
323
+ }
324
+ }
325
+
326
+ // Custom connection implementation
327
+ class MyConnection extends oConnection {
328
+ async transmit(request: oRequest): Promise<oResponse> {
329
+ // Implement your connection logic
330
+ const response = await fetch(this.nextHopAddress.toString(), {
331
+ method: 'POST',
332
+ body: request.toString()
333
+ });
334
+ return new oResponse(await response.json());
335
+ }
336
+ }
337
+
338
+ class MyToolNode extends oCore {
339
+ configureTransports(): any[] {
340
+ return [new MyCustomTransport()];
341
+ }
342
+ }
343
+ ```
344
+
345
+ **📖 For connection pooling, retry logic, middleware, and transport-specific implementations, see the [Connection System documentation](./src/connection/README.md).**
346
+
347
+ ### Custom Router Implementation
348
+
349
+ ```typescript
350
+ import { oRouter, RouteResponse } from '@olane/o-core';
351
+
352
+ class MyRouter extends oRouter {
353
+ async translate(address: oAddress, node: oCore): Promise<RouteResponse> {
354
+ // Implement custom routing logic
355
+ return {
356
+ nextHopAddress: calculatedNextHop,
357
+ targetAddress: address
358
+ };
359
+ }
360
+
361
+ isInternal(address: oAddress, node: oCore): boolean {
362
+ // Determine if address is internal to this node
363
+ return address.root === node.address.root;
364
+ }
365
+
366
+ async route(request: oRouterRequest, node: oCore): Promise<RouteResponse> {
367
+ // Handle routing requests
368
+ }
369
+ }
370
+ ```
371
+
372
+ **📖 For advanced routing patterns, custom resolvers, and hierarchical routing strategies, see the [Router System documentation](./src/router/README.md).**
373
+
374
+ ### Error Handling
375
+
376
+ ```typescript
377
+ import { oError, oErrorCodes } from '@olane/o-core';
378
+
379
+ // In your execute method
380
+ async execute(request: oRequest): Promise<any> {
381
+ if (!isValid(request.params)) {
382
+ throw new oError(
383
+ oErrorCodes.INVALID_PARAMS,
384
+ 'Invalid parameters provided'
385
+ );
386
+ }
387
+
388
+ try {
389
+ return await processRequest(request);
390
+ } catch (error) {
391
+ throw new oError(
392
+ oErrorCodes.EXECUTION_ERROR,
393
+ error.message
394
+ );
395
+ }
396
+ }
397
+ ```
398
+
399
+ ### Graceful Shutdown
400
+
401
+ ```typescript
402
+ import { setupGracefulShutdown } from '@olane/o-core';
403
+
404
+ const toolNode = new MyToolNode('o://my/toolnode');
405
+ await toolNode.start();
406
+
407
+ // Setup graceful shutdown handlers
408
+ setupGracefulShutdown(async () => {
409
+ console.log('Shutting down gracefully...');
410
+ await toolNode.stop();
411
+ });
412
+
413
+ // Tool node will automatically stop on SIGINT/SIGTERM
414
+ ```
415
+
416
+ ## API Reference
417
+
418
+ ### oCore Class
419
+
420
+ Abstract base class for building tool nodes.
421
+
422
+ #### Properties
423
+ - `address: oAddress` - The tool node's hierarchical address
424
+ - `state: NodeState` - Current lifecycle state
425
+ - `metrics: oMetrics` - Performance and usage metrics
426
+ - `hierarchyManager: oHierarchyManager` - Manages child nodes
427
+ - `router: oRouter` - Routing logic
428
+ - `connectionManager: oConnectionManager` - Connection pooling
126
429
 
127
- > Policy creation intent: "Whenever someone tries to join my network, ask me first"
128
- ....Confirmed, I will make sure to follow this policy (undo?)
129
- > Policy creation intent: "When trying to send a message to someone, first check my contact list for their phone number"
130
- > "Whenever I chat with Dillon, use slack and use the appropriate slack thread"
131
- ...Thinking, can you confirm which Dillon? (Dillon Morgan or Dillon Johnson)
430
+ #### Methods
431
+ - `async start(): Promise<void>` - Start the tool node
432
+ - `async stop(): Promise<void>` - Stop the tool node gracefully
433
+ - `async use(address, data?): Promise<oResponse>` - Communicate with another tool node (IPC)
434
+ - `async execute(request): Promise<any>` - Execute a request (abstract - you implement this)
435
+ - `addChildNode(node): void` - Add a child tool node
436
+ - `removeChildNode(node): void` - Remove a child tool node
437
+ - `async whoami(): Promise<any>` - Get tool node information
438
+
439
+ ### oAddress Class
440
+
441
+ #### Methods
442
+ - `validate(): boolean` - Validate address format
443
+ - `toStaticAddress(): oAddress` - Convert to static address
444
+ - `toString(): string` - Get string representation
445
+ - `equals(other): boolean` - Compare addresses
446
+ - `async toCID(): Promise<CID>` - Convert to Content ID
447
+
448
+ ### oError Class
449
+
450
+ #### Constructor
451
+ ```typescript
452
+ new oError(code: oErrorCodes, message: string, data?: any)
132
453
  ```
133
454
 
134
- **When running your intelligent network:**
135
- - Your network self-heals and learns to become deterministic & stateful (read advance mode)
136
- - Add policies to your network to customize (read policy to learn more)
137
- - Pro tip: Visualize your network with the [cli tool](/docs/CLI.md)
455
+ #### Methods
456
+ - `toJSON(): object` - Serialize error
457
+ - `static fromJSON(json): oError` - Deserialize error
138
458
 
139
- > Magic moments we personally love
140
- running on olane
141
- Play video
142
- >
459
+ ## Testing
143
460
 
144
- ## **NETWORK TO NETWORK 🛜**
461
+ ```bash
462
+ # Run tests
463
+ npm test
145
464
 
146
- **Connect to other intelligent networks 🧠**
465
+ # Run tests in Node.js
466
+ npm run test:node
147
467
 
148
- 1. Collaboration leads to super intelligence (think hive mind / AI-social network)
149
- 2. Simple share anything via “o-addresses” (think AI-telepathy)
468
+ # Run tests in browser
469
+ npm run test:browser
470
+ ```
471
+
472
+ ## Development
150
473
 
151
474
  ```bash
152
- # request to join network
153
- # olane request to join public-intelligent-network
154
- olane connect o://my-network --to=o://olane
155
- ....Connected!
156
- ....Discovered 232 skills, do you want to remember these?[y/n]
157
- ....Your network shares 31 o-addresses, would you like to collaborate with olane to help with intents involving these addresses in the future?
475
+ # Install dependencies
476
+ npm install
477
+
478
+ # Build the package
479
+ npm run build
158
480
 
159
- # network requests accepted
160
- # Request or contribute knowledge to connected networks
161
- # Share my knowledge of how to connect to MCPs
162
- # Share my compute resources for projects that align with my personal beliefs
163
- # Request knowledge for creating 3D DNA structures
481
+ # Run in development mode
482
+ npm run dev
164
483
 
165
- # Collaborate with networks to solve challenging problems
166
- > Create a non-hardware product that solves one key aspect of world hunger for
167
- under $10
484
+ # Lint the code
485
+ npm run lint
168
486
  ```
169
487
 
170
- **When communicating with other intelligent networks:**
171
- - Your networks are building shared intelligence
172
- - How to register with olane to enable human readable network name
173
- - If you want to connect directly to another network that is not verified with olane, simply share the transport with the other network [What is a transport](url)
488
+ ## Use Cases
174
489
 
175
- > Does this feel like ASI to you?
176
- We think so
177
- Play video
178
- >
490
+ o-core enables you to:
179
491
 
180
- > **P2P Network Connection**: to connect directly to another network via the p2p functionality, simply share the network leader node transport with your intended collaborator. To learn more, read about [direct networking](/docs/DIRECT_NETWORKING.md)
492
+ 1. **Build Specialized Tool Nodes** with unique o:// addresses and capabilities
493
+ 2. **Create Hierarchical Tool Networks** that AI agents discover and use
494
+ 3. **Route Requests Intelligently** through tool node hierarchies
495
+ 4. **Manage Tool Node Lifecycles** with automatic cleanup and error handling
496
+ 5. **Share Knowledge and Capabilities** across tool networks through addressable resources
181
497
 
182
- ## Enjoy growing your AI network ❤️
498
+ ## What o-core is NOT
183
499
 
184
- ---
500
+ - ❌ **Not a network framework** - It's the OS kernel for tool nodes
501
+ - ❌ **Not an orchestration tool** - It enables emergent coordination, not explicit workflows
502
+ - ❌ **Not a REST API** - It's a runtime for inter-process communication (IPC)
503
+ - ❌ **Not a complete solution** - It's an abstract foundation; use o-node for production
504
+ - ❌ **Not what you use directly** - Extend it or use higher-level packages (o-node, o-tool, o-lane)
505
+
506
+ ## Related Packages
507
+
508
+ - `@olane/o-protocol` - Protocol definitions and types
509
+ - `@olane/o-node` - Complete node implementation (extends o-core)
510
+ - `@olane/o-tool` - Tool system for agent capabilities
511
+ - `@olane/o-storage` - Storage layer for agent state
512
+ - `@olane/o-network-cli` - CLI for managing agent networks
185
513
 
186
- **Stay connected**
514
+ ## Component Documentation
187
515
 
188
- 1. **Shoutout Feed!**
189
- 2. Join our private olane groupchat
190
- 3. Subscribe to ASI newsletter & podcast
191
- 4. Follow the olane story
192
- 5. Join the team
193
- 6. Share olane with your friends (we greatly appreciate it!)
516
+ For in-depth documentation on specific o-core components, see:
517
+
518
+ - **[Router System](./src/router/README.md)** - Deep dive into the `o://` protocol, address resolution, routing logic, and custom resolvers
519
+ - **[Connection System](./src/connection/README.md)** - Complete guide to IPC, JSON-RPC messaging, connection pooling, and transport implementations
520
+
521
+ ## Documentation
522
+
523
+ - [Full Documentation](https://olane.com/docs)
524
+ - [Quickstart Guide](https://olane.com/docs/quickstart)
525
+ - [Architecture Overview](https://olane.com/docs/architecture/overview)
526
+ - [API Reference](https://olane.com/docs/api)
527
+
528
+ ## Support
529
+
530
+ - [GitHub Issues](https://github.com/olane-labs/olane/issues)
531
+ - [Community Forum](https://olane.com/community)
532
+ - [Email Support](mailto:support@olane.com)
533
+
534
+ ## Contributing
535
+
536
+ We welcome contributions! Please see our [Contributing Guide](../../CONTRIBUTING.md) for details.
537
+
538
+ ## License
539
+
540
+ ISC © Olane Inc.
541
+
542
+ ---
194
543
 
544
+ **Part of the Olane OS ecosystem** - An agentic operating system where AI agents are the users and you build tool nodes as applications.