@olane/o-core 0.1.0

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 (353) hide show
  1. package/README.md +199 -0
  2. package/dist/core/core.node.d.ts +61 -0
  3. package/dist/core/core.node.d.ts.map +1 -0
  4. package/dist/core/core.node.js +262 -0
  5. package/dist/core/core.node.js.map +1 -0
  6. package/dist/core/defaults/config.d.ts +4 -0
  7. package/dist/core/defaults/config.d.ts.map +1 -0
  8. package/dist/core/defaults/config.js +6 -0
  9. package/dist/core/defaults/config.js.map +1 -0
  10. package/dist/core/defaults/index.d.ts +2 -0
  11. package/dist/core/defaults/index.d.ts.map +1 -0
  12. package/dist/core/defaults/index.js +2 -0
  13. package/dist/core/defaults/index.js.map +1 -0
  14. package/dist/core/index.d.ts +10 -0
  15. package/dist/core/index.d.ts.map +1 -0
  16. package/dist/core/index.js +10 -0
  17. package/dist/core/index.js.map +1 -0
  18. package/dist/core/interfaces/connection-manager.config.d.ts +7 -0
  19. package/dist/core/interfaces/connection-manager.config.d.ts.map +1 -0
  20. package/dist/core/interfaces/connection-manager.config.js +2 -0
  21. package/dist/core/interfaces/connection-manager.config.js.map +1 -0
  22. package/dist/core/interfaces/connection-send-params.interface.d.ts +7 -0
  23. package/dist/core/interfaces/connection-send-params.interface.d.ts.map +1 -0
  24. package/dist/core/interfaces/connection-send-params.interface.js +2 -0
  25. package/dist/core/interfaces/connection-send-params.interface.js.map +1 -0
  26. package/dist/core/interfaces/core-config.interface.d.ts +23 -0
  27. package/dist/core/interfaces/core-config.interface.d.ts.map +1 -0
  28. package/dist/core/interfaces/core-config.interface.js +2 -0
  29. package/dist/core/interfaces/core-config.interface.js.map +1 -0
  30. package/dist/core/interfaces/index.d.ts +6 -0
  31. package/dist/core/interfaces/index.d.ts.map +1 -0
  32. package/dist/core/interfaces/index.js +6 -0
  33. package/dist/core/interfaces/index.js.map +1 -0
  34. package/dist/core/interfaces/node-type.enum.d.ts +10 -0
  35. package/dist/core/interfaces/node-type.enum.d.ts.map +1 -0
  36. package/dist/core/interfaces/node-type.enum.js +11 -0
  37. package/dist/core/interfaces/node-type.enum.js.map +1 -0
  38. package/dist/core/interfaces/restricted-addresses.enum.d.ts +13 -0
  39. package/dist/core/interfaces/restricted-addresses.enum.d.ts.map +1 -0
  40. package/dist/core/interfaces/restricted-addresses.enum.js +19 -0
  41. package/dist/core/interfaces/restricted-addresses.enum.js.map +1 -0
  42. package/dist/core/interfaces/state.enum.d.ts +8 -0
  43. package/dist/core/interfaces/state.enum.d.ts.map +1 -0
  44. package/dist/core/interfaces/state.enum.js +9 -0
  45. package/dist/core/interfaces/state.enum.js.map +1 -0
  46. package/dist/core/interfaces/use-options.interface.d.ts +6 -0
  47. package/dist/core/interfaces/use-options.interface.d.ts.map +1 -0
  48. package/dist/core/interfaces/use-options.interface.js +2 -0
  49. package/dist/core/interfaces/use-options.interface.js.map +1 -0
  50. package/dist/core/lib/index.d.ts +8 -0
  51. package/dist/core/lib/index.d.ts.map +1 -0
  52. package/dist/core/lib/index.js +8 -0
  53. package/dist/core/lib/index.js.map +1 -0
  54. package/dist/core/lib/o-address-resolution.d.ts +9 -0
  55. package/dist/core/lib/o-address-resolution.d.ts.map +1 -0
  56. package/dist/core/lib/o-address-resolution.js +20 -0
  57. package/dist/core/lib/o-address-resolution.js.map +1 -0
  58. package/dist/core/lib/o-address-resolver.d.ts +17 -0
  59. package/dist/core/lib/o-address-resolver.d.ts.map +1 -0
  60. package/dist/core/lib/o-address-resolver.js +38 -0
  61. package/dist/core/lib/o-address-resolver.js.map +1 -0
  62. package/dist/core/lib/o-connection-manager.d.ts +17 -0
  63. package/dist/core/lib/o-connection-manager.d.ts.map +1 -0
  64. package/dist/core/lib/o-connection-manager.js +47 -0
  65. package/dist/core/lib/o-connection-manager.js.map +1 -0
  66. package/dist/core/lib/o-connection.d.ts +27 -0
  67. package/dist/core/lib/o-connection.d.ts.map +1 -0
  68. package/dist/core/lib/o-connection.js +74 -0
  69. package/dist/core/lib/o-connection.js.map +1 -0
  70. package/dist/core/lib/o-request.d.ts +17 -0
  71. package/dist/core/lib/o-request.d.ts.map +1 -0
  72. package/dist/core/lib/o-request.js +31 -0
  73. package/dist/core/lib/o-request.js.map +1 -0
  74. package/dist/core/lib/o-response.d.ts +12 -0
  75. package/dist/core/lib/o-response.d.ts.map +1 -0
  76. package/dist/core/lib/o-response.js +22 -0
  77. package/dist/core/lib/o-response.js.map +1 -0
  78. package/dist/core/lib/resolvers/anything.resolver.d.ts +8 -0
  79. package/dist/core/lib/resolvers/anything.resolver.d.ts.map +1 -0
  80. package/dist/core/lib/resolvers/anything.resolver.js +13 -0
  81. package/dist/core/lib/resolvers/anything.resolver.js.map +1 -0
  82. package/dist/core/lib/resolvers/index.d.ts +5 -0
  83. package/dist/core/lib/resolvers/index.d.ts.map +1 -0
  84. package/dist/core/lib/resolvers/index.js +5 -0
  85. package/dist/core/lib/resolvers/index.js.map +1 -0
  86. package/dist/core/lib/resolvers/method.resolver.d.ts +8 -0
  87. package/dist/core/lib/resolvers/method.resolver.d.ts.map +1 -0
  88. package/dist/core/lib/resolvers/method.resolver.js +19 -0
  89. package/dist/core/lib/resolvers/method.resolver.js.map +1 -0
  90. package/dist/core/lib/resolvers/next-hop.resolver.d.ts +10 -0
  91. package/dist/core/lib/resolvers/next-hop.resolver.d.ts.map +1 -0
  92. package/dist/core/lib/resolvers/next-hop.resolver.js +50 -0
  93. package/dist/core/lib/resolvers/next-hop.resolver.js.map +1 -0
  94. package/dist/core/lib/resolvers/storage.resolver.d.ts +6 -0
  95. package/dist/core/lib/resolvers/storage.resolver.d.ts.map +1 -0
  96. package/dist/core/lib/resolvers/storage.resolver.js +11 -0
  97. package/dist/core/lib/resolvers/storage.resolver.js.map +1 -0
  98. package/dist/core/o-address.d.ts +20 -0
  99. package/dist/core/o-address.d.ts.map +1 -0
  100. package/dist/core/o-address.js +50 -0
  101. package/dist/core/o-address.js.map +1 -0
  102. package/dist/core/o-dependency.d.ts +9 -0
  103. package/dist/core/o-dependency.d.ts.map +1 -0
  104. package/dist/core/o-dependency.js +18 -0
  105. package/dist/core/o-dependency.js.map +1 -0
  106. package/dist/core/o-parameter.d.ts +13 -0
  107. package/dist/core/o-parameter.d.ts.map +1 -0
  108. package/dist/core/o-parameter.js +28 -0
  109. package/dist/core/o-parameter.js.map +1 -0
  110. package/dist/core/utils/core.utils.d.ts +15 -0
  111. package/dist/core/utils/core.utils.d.ts.map +1 -0
  112. package/dist/core/utils/core.utils.js +52 -0
  113. package/dist/core/utils/core.utils.js.map +1 -0
  114. package/dist/core/utils/index.d.ts +4 -0
  115. package/dist/core/utils/index.d.ts.map +1 -0
  116. package/dist/core/utils/index.js +4 -0
  117. package/dist/core/utils/index.js.map +1 -0
  118. package/dist/core/utils/logger.d.ts +11 -0
  119. package/dist/core/utils/logger.d.ts.map +1 -0
  120. package/dist/core/utils/logger.js +26 -0
  121. package/dist/core/utils/logger.js.map +1 -0
  122. package/dist/core/utils/network.utils.d.ts +10 -0
  123. package/dist/core/utils/network.utils.d.ts.map +1 -0
  124. package/dist/core/utils/network.utils.js +31 -0
  125. package/dist/core/utils/network.utils.js.map +1 -0
  126. package/dist/error/enums/codes.error.d.ts +16 -0
  127. package/dist/error/enums/codes.error.d.ts.map +1 -0
  128. package/dist/error/enums/codes.error.js +17 -0
  129. package/dist/error/enums/codes.error.js.map +1 -0
  130. package/dist/error/index.d.ts +3 -0
  131. package/dist/error/index.d.ts.map +1 -0
  132. package/dist/error/index.js +3 -0
  133. package/dist/error/index.js.map +1 -0
  134. package/dist/error/tool.error.d.ts +17 -0
  135. package/dist/error/tool.error.d.ts.map +1 -0
  136. package/dist/error/tool.error.js +19 -0
  137. package/dist/error/tool.error.js.map +1 -0
  138. package/dist/index.d.ts +7 -0
  139. package/dist/index.d.ts.map +1 -0
  140. package/dist/index.js +7 -0
  141. package/dist/index.js.map +1 -0
  142. package/dist/node/index.d.ts +4 -0
  143. package/dist/node/index.d.ts.map +1 -0
  144. package/dist/node/index.js +4 -0
  145. package/dist/node/index.js.map +1 -0
  146. package/dist/node/lib/local-search.lib.d.ts +6 -0
  147. package/dist/node/lib/local-search.lib.d.ts.map +1 -0
  148. package/dist/node/lib/local-search.lib.js +7 -0
  149. package/dist/node/lib/local-search.lib.js.map +1 -0
  150. package/dist/node/lib/network-activity.lib.d.ts +12 -0
  151. package/dist/node/lib/network-activity.lib.d.ts.map +1 -0
  152. package/dist/node/lib/network-activity.lib.js +32 -0
  153. package/dist/node/lib/network-activity.lib.js.map +1 -0
  154. package/dist/node/node.d.ts +31 -0
  155. package/dist/node/node.d.ts.map +1 -0
  156. package/dist/node/node.js +233 -0
  157. package/dist/node/node.js.map +1 -0
  158. package/dist/node-host/host.node.d.ts +6 -0
  159. package/dist/node-host/host.node.d.ts.map +1 -0
  160. package/dist/node-host/host.node.js +16 -0
  161. package/dist/node-host/host.node.js.map +1 -0
  162. package/dist/node-host/index.d.ts +2 -0
  163. package/dist/node-host/index.d.ts.map +1 -0
  164. package/dist/node-host/index.js +2 -0
  165. package/dist/node-host/index.js.map +1 -0
  166. package/dist/node-virtual/index.d.ts +2 -0
  167. package/dist/node-virtual/index.d.ts.map +1 -0
  168. package/dist/node-virtual/index.js +2 -0
  169. package/dist/node-virtual/index.js.map +1 -0
  170. package/dist/node-virtual/virtual.node.d.ts +5 -0
  171. package/dist/node-virtual/virtual.node.d.ts.map +1 -0
  172. package/dist/node-virtual/virtual.node.js +8 -0
  173. package/dist/node-virtual/virtual.node.js.map +1 -0
  174. package/dist/plan/agent.plan.d.ts +16 -0
  175. package/dist/plan/agent.plan.d.ts.map +1 -0
  176. package/dist/plan/agent.plan.js +140 -0
  177. package/dist/plan/agent.plan.js.map +1 -0
  178. package/dist/plan/configure/configure.plan.d.ts +8 -0
  179. package/dist/plan/configure/configure.plan.d.ts.map +1 -0
  180. package/dist/plan/configure/configure.plan.js +13 -0
  181. package/dist/plan/configure/configure.plan.js.map +1 -0
  182. package/dist/plan/error/error.plan.d.ts +11 -0
  183. package/dist/plan/error/error.plan.d.ts.map +1 -0
  184. package/dist/plan/error/error.plan.js +22 -0
  185. package/dist/plan/error/error.plan.js.map +1 -0
  186. package/dist/plan/index.d.ts +5 -0
  187. package/dist/plan/index.d.ts.map +1 -0
  188. package/dist/plan/index.js +5 -0
  189. package/dist/plan/index.js.map +1 -0
  190. package/dist/plan/interfaces/plan-config.interface.d.ts +14 -0
  191. package/dist/plan/interfaces/plan-config.interface.d.ts.map +1 -0
  192. package/dist/plan/interfaces/plan-config.interface.js +2 -0
  193. package/dist/plan/interfaces/plan-config.interface.js.map +1 -0
  194. package/dist/plan/interfaces/plan-result.interface.d.ts +6 -0
  195. package/dist/plan/interfaces/plan-result.interface.d.ts.map +1 -0
  196. package/dist/plan/interfaces/plan-result.interface.js +2 -0
  197. package/dist/plan/interfaces/plan-result.interface.js.map +1 -0
  198. package/dist/plan/interfaces/plan-type.enum.d.ts +7 -0
  199. package/dist/plan/interfaces/plan-type.enum.d.ts.map +1 -0
  200. package/dist/plan/interfaces/plan-type.enum.js +8 -0
  201. package/dist/plan/interfaces/plan-type.enum.js.map +1 -0
  202. package/dist/plan/interfaces/plan.result.d.ts +15 -0
  203. package/dist/plan/interfaces/plan.result.d.ts.map +1 -0
  204. package/dist/plan/interfaces/plan.result.js +2 -0
  205. package/dist/plan/interfaces/plan.result.js.map +1 -0
  206. package/dist/plan/interfaces/query.config.d.ts +6 -0
  207. package/dist/plan/interfaces/query.config.d.ts.map +1 -0
  208. package/dist/plan/interfaces/query.config.js +2 -0
  209. package/dist/plan/interfaces/query.config.js.map +1 -0
  210. package/dist/plan/interfaces/task.config.d.ts +10 -0
  211. package/dist/plan/interfaces/task.config.d.ts.map +1 -0
  212. package/dist/plan/interfaces/task.config.js +2 -0
  213. package/dist/plan/interfaces/task.config.js.map +1 -0
  214. package/dist/plan/o-plan.d.ts +34 -0
  215. package/dist/plan/o-plan.d.ts.map +1 -0
  216. package/dist/plan/o-plan.js +182 -0
  217. package/dist/plan/o-plan.js.map +1 -0
  218. package/dist/plan/plan.context.d.ts +10 -0
  219. package/dist/plan/plan.context.d.ts.map +1 -0
  220. package/dist/plan/plan.context.js +29 -0
  221. package/dist/plan/plan.context.js.map +1 -0
  222. package/dist/plan/prompts/agent.prompt.d.ts +2 -0
  223. package/dist/plan/prompts/agent.prompt.d.ts.map +1 -0
  224. package/dist/plan/prompts/agent.prompt.js +95 -0
  225. package/dist/plan/prompts/agent.prompt.js.map +1 -0
  226. package/dist/plan/prompts/configure.prompt.d.ts +2 -0
  227. package/dist/plan/prompts/configure.prompt.d.ts.map +1 -0
  228. package/dist/plan/prompts/configure.prompt.js +56 -0
  229. package/dist/plan/prompts/configure.prompt.js.map +1 -0
  230. package/dist/plan/prompts/custom.prompt.d.ts +2 -0
  231. package/dist/plan/prompts/custom.prompt.d.ts.map +1 -0
  232. package/dist/plan/prompts/custom.prompt.js +56 -0
  233. package/dist/plan/prompts/custom.prompt.js.map +1 -0
  234. package/dist/plan/prompts/error.prompt.d.ts +2 -0
  235. package/dist/plan/prompts/error.prompt.d.ts.map +1 -0
  236. package/dist/plan/prompts/error.prompt.js +40 -0
  237. package/dist/plan/prompts/error.prompt.js.map +1 -0
  238. package/dist/plan/prompts/search.prompt.d.ts +2 -0
  239. package/dist/plan/prompts/search.prompt.d.ts.map +1 -0
  240. package/dist/plan/prompts/search.prompt.js +44 -0
  241. package/dist/plan/prompts/search.prompt.js.map +1 -0
  242. package/dist/plan/search/prompts/search-analysis.prompt.d.ts +2 -0
  243. package/dist/plan/search/prompts/search-analysis.prompt.d.ts.map +1 -0
  244. package/dist/plan/search/prompts/search-analysis.prompt.js +15 -0
  245. package/dist/plan/search/prompts/search-analysis.prompt.js.map +1 -0
  246. package/dist/plan/search/search.plan.d.ts +15 -0
  247. package/dist/plan/search/search.plan.d.ts.map +1 -0
  248. package/dist/plan/search/search.plan.js +36 -0
  249. package/dist/plan/search/search.plan.js.map +1 -0
  250. package/dist/plan/use/index.d.ts +2 -0
  251. package/dist/plan/use/index.d.ts.map +1 -0
  252. package/dist/plan/use/index.js +2 -0
  253. package/dist/plan/use/index.js.map +1 -0
  254. package/dist/plan/use/use.plan.d.ts +10 -0
  255. package/dist/plan/use/use.plan.d.ts.map +1 -0
  256. package/dist/plan/use/use.plan.js +58 -0
  257. package/dist/plan/use/use.plan.js.map +1 -0
  258. package/dist/src/core/core.node.d.ts +62 -0
  259. package/dist/src/core/core.node.d.ts.map +1 -0
  260. package/dist/src/core/core.node.js +262 -0
  261. package/dist/src/core/core.node.js.map +1 -0
  262. package/dist/src/core/index.d.ts +10 -0
  263. package/dist/src/core/index.d.ts.map +1 -0
  264. package/dist/src/core/interfaces/core-config.interface.d.ts +23 -0
  265. package/dist/src/core/interfaces/core-config.interface.d.ts.map +1 -0
  266. package/dist/src/core/interfaces/core-config.interface.js +2 -0
  267. package/dist/src/core/interfaces/core-config.interface.js.map +1 -0
  268. package/dist/src/core/interfaces/index.d.ts +6 -0
  269. package/dist/src/core/interfaces/index.d.ts.map +1 -0
  270. package/dist/src/core/lib/index.d.ts +8 -0
  271. package/dist/src/core/lib/index.d.ts.map +1 -0
  272. package/dist/src/core/lib/o-address-resolution.d.ts +9 -0
  273. package/dist/src/core/lib/o-address-resolution.d.ts.map +1 -0
  274. package/dist/src/core/lib/o-address-resolver.d.ts +17 -0
  275. package/dist/src/core/lib/o-address-resolver.d.ts.map +1 -0
  276. package/dist/src/core/lib/o-connection-manager.d.ts +17 -0
  277. package/dist/src/core/lib/o-connection-manager.d.ts.map +1 -0
  278. package/dist/src/core/lib/o-connection.d.ts +28 -0
  279. package/dist/src/core/lib/o-connection.d.ts.map +1 -0
  280. package/dist/src/core/lib/o-connection.js +86 -0
  281. package/dist/src/core/lib/o-connection.js.map +1 -0
  282. package/dist/src/core/lib/o-request.d.ts +17 -0
  283. package/dist/src/core/lib/o-request.d.ts.map +1 -0
  284. package/dist/src/core/lib/o-request.js +31 -0
  285. package/dist/src/core/lib/o-request.js.map +1 -0
  286. package/dist/src/core/lib/o-response.d.ts +12 -0
  287. package/dist/src/core/lib/o-response.d.ts.map +1 -0
  288. package/dist/src/core/lib/o-response.js +22 -0
  289. package/dist/src/core/lib/o-response.js.map +1 -0
  290. package/dist/src/core/lib/resolvers/anything.resolver.d.ts +8 -0
  291. package/dist/src/core/lib/resolvers/anything.resolver.d.ts.map +1 -0
  292. package/dist/src/core/lib/resolvers/index.d.ts +5 -0
  293. package/dist/src/core/lib/resolvers/index.d.ts.map +1 -0
  294. package/dist/src/core/lib/resolvers/method.resolver.d.ts +8 -0
  295. package/dist/src/core/lib/resolvers/method.resolver.d.ts.map +1 -0
  296. package/dist/src/core/lib/resolvers/next-hop.resolver.d.ts +10 -0
  297. package/dist/src/core/lib/resolvers/next-hop.resolver.d.ts.map +1 -0
  298. package/dist/src/core/lib/resolvers/storage.resolver.d.ts +6 -0
  299. package/dist/src/core/lib/resolvers/storage.resolver.d.ts.map +1 -0
  300. package/dist/src/core/o-address.d.ts +20 -0
  301. package/dist/src/core/o-address.d.ts.map +1 -0
  302. package/dist/src/core/o-dependency.d.ts +9 -0
  303. package/dist/src/core/o-dependency.d.ts.map +1 -0
  304. package/dist/src/core/o-dependency.js +18 -0
  305. package/dist/src/core/o-dependency.js.map +1 -0
  306. package/dist/src/core/o-parameter.d.ts +13 -0
  307. package/dist/src/core/o-parameter.d.ts.map +1 -0
  308. package/dist/src/core/o-parameter.js +28 -0
  309. package/dist/src/core/o-parameter.js.map +1 -0
  310. package/dist/src/core/utils/core.utils.d.ts +15 -0
  311. package/dist/src/core/utils/core.utils.d.ts.map +1 -0
  312. package/dist/src/core/utils/index.d.ts +4 -0
  313. package/dist/src/core/utils/index.d.ts.map +1 -0
  314. package/dist/src/core/utils/network.utils.d.ts +10 -0
  315. package/dist/src/core/utils/network.utils.d.ts.map +1 -0
  316. package/dist/src/index.d.ts +7 -0
  317. package/dist/src/index.d.ts.map +1 -0
  318. package/dist/src/node/index.d.ts +4 -0
  319. package/dist/src/node/index.d.ts.map +1 -0
  320. package/dist/src/node/lib/local-search.lib.d.ts +6 -0
  321. package/dist/src/node/lib/local-search.lib.d.ts.map +1 -0
  322. package/dist/src/node/lib/network-activity.lib.d.ts +12 -0
  323. package/dist/src/node/lib/network-activity.lib.d.ts.map +1 -0
  324. package/dist/src/node/node.d.ts +28 -0
  325. package/dist/src/node/node.d.ts.map +1 -0
  326. package/dist/src/node-host/host.node.d.ts +6 -0
  327. package/dist/src/node-host/host.node.d.ts.map +1 -0
  328. package/dist/src/node-host/index.d.ts +2 -0
  329. package/dist/src/node-host/index.d.ts.map +1 -0
  330. package/dist/src/node-virtual/index.d.ts +2 -0
  331. package/dist/src/node-virtual/index.d.ts.map +1 -0
  332. package/dist/src/node-virtual/virtual.node.d.ts +5 -0
  333. package/dist/src/node-virtual/virtual.node.d.ts.map +1 -0
  334. package/dist/src/plan/agent.plan.d.ts +15 -0
  335. package/dist/src/plan/agent.plan.d.ts.map +1 -0
  336. package/dist/src/plan/error/error.plan.d.ts +11 -0
  337. package/dist/src/plan/error/error.plan.d.ts.map +1 -0
  338. package/dist/src/plan/index.d.ts +5 -0
  339. package/dist/src/plan/index.d.ts.map +1 -0
  340. package/dist/src/plan/interfaces/plan-config.interface.d.ts +14 -0
  341. package/dist/src/plan/interfaces/plan-config.interface.d.ts.map +1 -0
  342. package/dist/src/plan/interfaces/plan-result.interface.d.ts +6 -0
  343. package/dist/src/plan/interfaces/plan-result.interface.d.ts.map +1 -0
  344. package/dist/src/plan/o-plan.d.ts +33 -0
  345. package/dist/src/plan/o-plan.d.ts.map +1 -0
  346. package/dist/src/plan/search/search.plan.d.ts +11 -0
  347. package/dist/src/plan/search/search.plan.d.ts.map +1 -0
  348. package/dist/src/plan/use/index.d.ts +2 -0
  349. package/dist/src/plan/use/index.d.ts.map +1 -0
  350. package/dist/src/plan/use/use.plan.d.ts +10 -0
  351. package/dist/src/plan/use/use.plan.d.ts.map +1 -0
  352. package/dist/tsconfig.tsbuildinfo +1 -0
  353. package/package.json +84 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plan.context.d.ts","sourceRoot":"","sources":["../../src/plan/plan.context.ts"],"names":[],"mappings":"AAAA,qBAAa,YAAY;IACvB,OAAO,CAAC,OAAO,CAAgB;gBACnB,OAAO,EAAE,GAAG;IAIxB,GAAG,CAAC,KAAK,EAAE,MAAM;IAIjB,MAAM,CAAC,QAAQ,EAAE,MAAM,EAAE;IAUzB,KAAK;IAIL,MAAM;IAIN,QAAQ;CAGT"}
@@ -0,0 +1,29 @@
1
+ export class oPlanContext {
2
+ context = [];
3
+ constructor(context) {
4
+ this.context = context;
5
+ }
6
+ add(value) {
7
+ this.context.push(value);
8
+ }
9
+ addAll(contexts) {
10
+ try {
11
+ for (const context of contexts) {
12
+ this.context.push(context);
13
+ }
14
+ }
15
+ catch (e) {
16
+ console.error('Error adding contexts: ', e);
17
+ }
18
+ }
19
+ clear() {
20
+ this.context = [];
21
+ }
22
+ toJSON() {
23
+ return this.context;
24
+ }
25
+ toString() {
26
+ return '\n\n' + this.context.join('\n') + '\n\n';
27
+ }
28
+ }
29
+ //# sourceMappingURL=plan.context.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plan.context.js","sourceRoot":"","sources":["../../src/plan/plan.context.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,YAAY;IACf,OAAO,GAAa,EAAE,CAAC;IAC/B,YAAY,OAAY;QACtB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IACzB,CAAC;IAED,GAAG,CAAC,KAAa;QACf,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAC3B,CAAC;IAED,MAAM,CAAC,QAAkB;QACvB,IAAI,CAAC;YACH,KAAK,MAAM,OAAO,IAAI,QAAQ,EAAE,CAAC;gBAC/B,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;YAC7B,CAAC;QACH,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;YACX,OAAO,CAAC,KAAK,CAAC,yBAAyB,EAAE,CAAC,CAAC,CAAC;QAC9C,CAAC;IACH,CAAC;IAED,KAAK;QACH,IAAI,CAAC,OAAO,GAAG,EAAE,CAAC;IACpB,CAAC;IAED,MAAM;QACJ,OAAO,IAAI,CAAC,OAAO,CAAC;IACtB,CAAC;IAED,QAAQ;QACN,OAAO,MAAM,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC;IACnD,CAAC;CACF"}
@@ -0,0 +1,2 @@
1
+ export declare const AGENT_PROMPT: (intent: string, context: string, agentHistory: string) => string;
2
+ //# sourceMappingURL=agent.prompt.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agent.prompt.d.ts","sourceRoot":"","sources":["../../../src/plan/prompts/agent.prompt.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,YAAY,GACvB,QAAQ,MAAM,EACd,SAAS,MAAM,EACf,cAAc,MAAM,WAoGnB,CAAC"}
@@ -0,0 +1,95 @@
1
+ import { CUSTOM_AGENT_PROMPT } from './custom.prompt';
2
+ export const AGENT_PROMPT = (intent, context, agentHistory) => CUSTOM_AGENT_PROMPT(intent, context, agentHistory, `
3
+ Every Step Instructions:
4
+ 1. Review the provided user intent and context
5
+ 2. If you can complete the user intent, return the answer using the "Return Instructions" steps
6
+ 3. If you experience an error trying to use a tool more than 2 times, stop here and follow the "Return Instructions" steps to indicate the error.
7
+ 3. Review the current step number and perform the instructions associated with that step.
8
+ 4. Start with step 1
9
+
10
+ Step 1 - Evaluate the intent
11
+ 1. A complex step means there are multiple actions required to complete the user's intent
12
+ 2. If the intent is not-complex, continue to step 2
13
+ 3. If the intent is complex, break it up into a list of simple concise intents. Stop here and follow the "Return Instructions" steps
14
+
15
+ Step 2 - Search for tools and context
16
+ 1. If all entities and tool addresses are known within the user intent, continue to step 3
17
+ 2. Review the user's intent, the current node's functionality, rules and context
18
+ 3. If there are unknown tool addresses or entities within the user intent, generate search queries to resolve the unknown entities.
19
+ 4. Search queries can be internal or external. If they are internal, they should be vector database queries. If they are external, they should be concise queries to internet search providers. Stop here and follow the "Return Instructions" steps
20
+
21
+ Step 3 - Filter Search Results
22
+ 1. If all search results are relevant to the user intent resolution, continue to step 4.
23
+ 2. Filter the search results for information that may contain supporting data or tooling that can help complete the user intent.
24
+ 3. If you do not see anything that can help you. Generate empty search results. stop here and follow the "Return Instructions" steps.
25
+
26
+ Step 4 - Use tools
27
+ 1. Review the discovered tools and their addresses
28
+ 2. If a tool use has failed in a past cycle, stop here and follow the "Return Instructions" steps to indicate the error.
29
+ 3. Using this filtered tool list, follow "Return Instructions" steps to return a series of addresses and respective intents to align with the current user intent resolution goal
30
+
31
+ Step 5 - Review the tool use results
32
+ 1. Analyze each tool use result
33
+ 2. Summarize the result of each tool use in 1 concise sentence
34
+ 3. In the summary, clearly mention if it succeeded or failed
35
+ 4. If it failed, make sure to include why it failed
36
+ `, `
37
+ These are the types of cycle results: "Complex Intent Results", "Search Results", "Use Tool Results", "Answer Results", "Error Results".
38
+
39
+ All Return Step Instructions:
40
+ 1. Determine what type of results we have
41
+ 2. Output the respective results using the matching output type.
42
+ 3. Generate a reasoning statement for why this result was returned.
43
+ 4. Do not include \`\`\`json or \`\`\` in your output.
44
+
45
+ Complex Intent Results:
46
+ {
47
+ "intents": [
48
+ "simple intent 1",
49
+ "simple intent 2",
50
+ "simple intent 3",
51
+ ],
52
+ "reasoning": string,
53
+ "type": "complex-intent",
54
+ }
55
+
56
+ Use Tool Results:
57
+ {
58
+ "tasks": [
59
+ {
60
+ "address": "string",
61
+ "intent": "string",
62
+ },
63
+ ],
64
+ "reasoning": string,
65
+ "type": "task",
66
+ }
67
+
68
+ Search Results:
69
+ {
70
+ "queries": [
71
+ {
72
+ "query": "key terms to search for",
73
+ "provider": "internal" | "external",
74
+ }
75
+ ],
76
+ "reasoning": string,
77
+ "type": "search",
78
+ }
79
+
80
+ Answer Results:
81
+ {
82
+ "result": string,
83
+ "reasoning": string,
84
+ "type": "result",
85
+ }
86
+
87
+ Error Results:
88
+ {
89
+ "error": string,
90
+ "reasoning": string,
91
+ "type": "error",
92
+ }
93
+
94
+ `);
95
+ //# sourceMappingURL=agent.prompt.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agent.prompt.js","sourceRoot":"","sources":["../../../src/plan/prompts/agent.prompt.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAEtD,MAAM,CAAC,MAAM,YAAY,GAAG,CAC1B,MAAc,EACd,OAAe,EACf,YAAoB,EACpB,EAAE,CACF,mBAAmB,CACjB,MAAM,EACN,OAAO,EACP,YAAY,EACZ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCD,EACC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0DD,CACA,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare const CONFIGURE_PROMPT: (intent: string, context: string, agentHistory: string) => string;
2
+ //# sourceMappingURL=configure.prompt.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"configure.prompt.d.ts","sourceRoot":"","sources":["../../../src/plan/prompts/configure.prompt.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,gBAAgB,GAC3B,QAAQ,MAAM,EACd,SAAS,MAAM,EACf,cAAc,MAAM,WA6DnB,CAAC"}
@@ -0,0 +1,56 @@
1
+ import { CUSTOM_AGENT_PROMPT } from './custom.prompt';
2
+ export const CONFIGURE_PROMPT = (intent, context, agentHistory) => CUSTOM_AGENT_PROMPT(intent, context, agentHistory, `
3
+ Every Step Instructions:
4
+ 1. Review the provided user intent and context
5
+ 2. If you can complete the user intent, return the answer using the "Return Instructions" steps
6
+ 3. If you experience an error trying to use a tool more than 2 times, stop here and follow the "Return Instructions" steps to indicate the error.
7
+ 3. Review the current step number and perform the instructions associated with that step.
8
+ 4. Start with step 1
9
+
10
+ Step 1 - Evaluate the intent
11
+ 1. A complex step means there are multiple actions required to complete the user's intent
12
+ 2. If the intent is not-complex, continue to step 2
13
+ 3. If the intent is complex, break it up into a list of simple concise intents. Stop here and follow the "Return Instructions" steps
14
+
15
+ Step 2 - Handshake
16
+ 1. If this is not a handshake request, continue to step 3
17
+ 2. Method options are listed in the [Method Options Begin] section.
18
+ 3. Method metadata context is listed in the [Method Metadata Begin] section.
19
+ 4. Review the method information and select the best method to resolve the user's intent.
20
+ 5. If you have enough information to complete the handshake, follow the "Return Instructions" steps to return the "handshake results" do not return "Use Tool Results".
21
+ 6. Continue to step 3
22
+
23
+ `, `
24
+ These are the types of cycle results: "Answer Results", "Handshake Results", "Error Results".
25
+
26
+ All Return Step Instructions:
27
+ 1. Determine what type of results we have
28
+ 2. Output the respective results using the matching output type.
29
+ 3. Generate a reasoning statement for why this result was returned.
30
+ 4. Do not include \`\`\`json or \`\`\` in your output.
31
+
32
+ Handshake Results:
33
+ {
34
+ "handshake": {
35
+ "address": string,
36
+ "payload": { "method": string, "params": any }
37
+ },
38
+ "type": "handshake",
39
+ }
40
+
41
+ Answer Results:
42
+ {
43
+ "result": string,
44
+ "reasoning": string,
45
+ "type": "result",
46
+ }
47
+
48
+ Error Results:
49
+ {
50
+ "error": string,
51
+ "reasoning": string,
52
+ "type": "error",
53
+ }
54
+
55
+ `);
56
+ //# sourceMappingURL=configure.prompt.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"configure.prompt.js","sourceRoot":"","sources":["../../../src/plan/prompts/configure.prompt.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAEtD,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAC9B,MAAc,EACd,OAAe,EACf,YAAoB,EACpB,EAAE,CACF,mBAAmB,CACjB,MAAM,EACN,OAAO,EACP,YAAY,EACZ;;;;;;;;;;;;;;;;;;;;;GAqBD,EACC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAgCC,CACF,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare const CUSTOM_AGENT_PROMPT: (intent: string, context: string, agentHistory: string, cycleInstructions: string, outputInstructions: string) => string;
2
+ //# sourceMappingURL=custom.prompt.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"custom.prompt.d.ts","sourceRoot":"","sources":["../../../src/plan/prompts/custom.prompt.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,mBAAmB,GAC9B,QAAQ,MAAM,EACd,SAAS,MAAM,EACf,cAAc,MAAM,EACpB,mBAAmB,MAAM,EACzB,oBAAoB,MAAM,WAuD3B,CAAC"}
@@ -0,0 +1,56 @@
1
+ export const CUSTOM_AGENT_PROMPT = (intent, context, agentHistory, cycleInstructions, outputInstructions) => `
2
+ You are an AI agent that resolves user intent within the "olane" hierarchical network of tools and returns JSON formatted results.
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. Use Search Results
11
+ 5. Use tools
12
+ 6. Review the results
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 is contained within that sub-section of the network graph
19
+ [Intents End]
20
+
21
+ [Network Context Begin]
22
+ - Every network has a root node with child nodes beneath it
23
+ - Network nodes contain tools to enable AI Agents to interface with everything (services, people, data, agents, etc)
24
+ - Everything in the network has an address to enable olane to access it
25
+ - Each node knows only about itself and the nodes below it
26
+ [Network Context End]
27
+
28
+ [Address Rules Begin]
29
+ - Only use tool addresses that appear in search results
30
+ - A tool address is a string that starts with "o://"
31
+ - URL addresses are not tool addresses
32
+ - Tool addresses are used to access the tool's functionality
33
+ [Address Rules End]
34
+
35
+ [Cycle Instructions Begin]
36
+ ${cycleInstructions}
37
+ [Cycle Instructions End]
38
+
39
+ [Cycle Return Instructions Begin]
40
+ ${outputInstructions}
41
+ [Cycle Return Instructions End]
42
+
43
+ [User Intent Begin]
44
+ ${intent}
45
+ [User Intent End]
46
+
47
+ [Additional Context Begin]
48
+ ${context}
49
+ [Additional Context End]
50
+
51
+ [Previous Cycle Results Begin]
52
+ ${agentHistory}
53
+ [Previous Cycle Results End]
54
+
55
+ `;
56
+ //# sourceMappingURL=custom.prompt.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"custom.prompt.js","sourceRoot":"","sources":["../../../src/plan/prompts/custom.prompt.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,mBAAmB,GAAG,CACjC,MAAc,EACd,OAAe,EACf,YAAoB,EACpB,iBAAyB,EACzB,kBAA0B,EAC1B,EAAE,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAmCH,iBAAiB;;;;EAIjB,kBAAkB;;;;EAIlB,MAAM;;;;EAIN,OAAO;;;;EAIP,YAAY;;;CAGb,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare const ERROR_PROMPT: (error: any, agentHistory: string) => string;
2
+ //# sourceMappingURL=error.prompt.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"error.prompt.d.ts","sourceRoot":"","sources":["../../../src/plan/prompts/error.prompt.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,YAAY,GAAI,OAAO,GAAG,EAAE,cAAc,MAAM,WAsC5D,CAAC"}
@@ -0,0 +1,40 @@
1
+ export const ERROR_PROMPT = (error, agentHistory) => `
2
+ You are an AI agent that helps the user fix an error.
3
+
4
+ General Information:
5
+ - You have access to tools that are interconnected through a p2p network.
6
+ - You have access to a knowledge vector database tool that can provide information about tools and general knowledge.
7
+ - Network addresses are used to access tools.
8
+ - Other networks may be accessible through the network address resolution system.
9
+ - Context from searching across networks is added to the "Additional Context" section.
10
+ - The state of solving the user's intent is logged in the "Agent State" section.
11
+
12
+ Error: ${JSON.stringify(error, null, 2)}
13
+
14
+ Rules:
15
+ 1. Do not explain the reasoning process, just return the output.
16
+ 2. Do not include \`\`\`json or \`\`\` in your output.
17
+
18
+ Steps:
19
+ 1. Review the error and determine the cause.
20
+ 2. Check the agentic state history to see if there was a better choice that could have been made to prevent this error.
21
+ 3. Review the method options to see if there was a better method that could have been used to prevent this error.
22
+ 4. Review the method metadata to see if the error is due to a missing method or parameter.
23
+ 5. If you can fix the error, provide a solution.
24
+ 6. If you cannot fix the error, create a human readable explanation on how to solve the error.
25
+ 5. The explanation should summarize the intent and explain why it failed concisely.
26
+
27
+ Error Output Format:
28
+ {
29
+ "error": {
30
+ "message": string,
31
+ "solution": string,
32
+ "explanation": string,
33
+ },
34
+ "type": "error",
35
+ }
36
+
37
+ [Agentic State]
38
+ ${agentHistory}
39
+ `;
40
+ //# sourceMappingURL=error.prompt.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"error.prompt.js","sourceRoot":"","sources":["../../../src/plan/prompts/error.prompt.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,KAAU,EAAE,YAAoB,EAAE,EAAE,CAAC;;;;;;;;;;;SAWzD,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;EA0BrC,YAAY;CACb,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare const SEARCH_PROMPT: (intent: string, context: string) => string;
2
+ //# sourceMappingURL=search.prompt.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"search.prompt.d.ts","sourceRoot":"","sources":["../../../src/plan/prompts/search.prompt.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,aAAa,GAAI,QAAQ,MAAM,EAAE,SAAS,MAAM,WA0C5D,CAAC"}
@@ -0,0 +1,44 @@
1
+ export const SEARCH_PROMPT = (intent, context) => `
2
+ You are a helpful assistant that searches for unknown entities in the user's input or returns a tool address that helps complete the user's task.
3
+
4
+ All entities are hosted within a network of p2p nodes and are tools, data, or other items.
5
+ The p2p nodes and their contained data are accessible via the network address resolution system.
6
+
7
+ All entity data is stored within a vector database that can be queried for more information.
8
+
9
+ User Input: ${intent}
10
+
11
+ Rules:
12
+ 1. Do not explain the reasoning process, just return the output.
13
+ 2. Your output should be a search query or the tool address to use to answer the user's input.
14
+ 3. Do not include \`\`\`json or \`\`\` in your output.
15
+
16
+ Steps:
17
+ 1. If you know a tool that can help with the user's input, return it in the format of a task output.
18
+ 2. Create a list of unknown entities mentioned in the user's input.
19
+ 3. Generate a vector db query for each unknown entity.
20
+ 4. Do not return a tool address unless you have seen it in the context.
21
+
22
+ Task Output Format:
23
+ {
24
+ "task": {
25
+ "address": string,
26
+ },
27
+ "type": "task",
28
+ }
29
+
30
+ Search Output Format:
31
+ {
32
+ "queries": [
33
+ {
34
+ "query": string,
35
+ "explanation": string,
36
+ }
37
+ ],
38
+ "type": "search",
39
+ }
40
+
41
+ Additional Context: ${context}
42
+
43
+ `;
44
+ //# sourceMappingURL=search.prompt.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"search.prompt.js","sourceRoot":"","sources":["../../../src/plan/prompts/search.prompt.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,MAAc,EAAE,OAAe,EAAE,EAAE,CAAC;;;;;;;;cAQpD,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;sBAgCE,OAAO;;CAE5B,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare const SEARCH_ANALYSIS_PROMPT: (intent: string, results: any[]) => string;
2
+ //# sourceMappingURL=search-analysis.prompt.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"search-analysis.prompt.d.ts","sourceRoot":"","sources":["../../../../src/plan/search/prompts/search-analysis.prompt.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,sBAAsB,GAAI,QAAQ,MAAM,EAAE,SAAS,GAAG,EAAE,WAapE,CAAC"}
@@ -0,0 +1,15 @@
1
+ export const SEARCH_ANALYSIS_PROMPT = (intent, results) => {
2
+ return `
3
+ You are a helpful assistant that analyzes search results to complete the user intent.
4
+
5
+ Steps:
6
+ 1. If you have all of the information you need to complete the user intent, return the results.
7
+ 2. If you do not have all the information you need, create a list of missing information.
8
+ 3. For each piece of missing information, create a query to refine your search.
9
+ 4. Return the list of queries and associated missing information.
10
+
11
+ User Intent: ${intent}
12
+ Search Results: ${results}
13
+ `;
14
+ };
15
+ //# sourceMappingURL=search-analysis.prompt.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"search-analysis.prompt.js","sourceRoot":"","sources":["../../../../src/plan/search/prompts/search-analysis.prompt.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,MAAc,EAAE,OAAc,EAAE,EAAE;IACvE,OAAO;;;;;;;;;mBASU,MAAM;sBACH,OAAO;GAC1B,CAAC;AACJ,CAAC,CAAC"}
@@ -0,0 +1,15 @@
1
+ import { oPlanConfig } from '../interfaces/plan-config.interface';
2
+ import { oPlanResult } from '../interfaces/plan.result';
3
+ import { oPlan } from '../o-plan';
4
+ export declare class oSearchPlan extends oPlan {
5
+ private query;
6
+ private external;
7
+ constructor(config: oPlanConfig & {
8
+ query: string;
9
+ external: boolean;
10
+ });
11
+ private externalSearch;
12
+ private internalSearch;
13
+ run(): Promise<oPlanResult>;
14
+ }
15
+ //# sourceMappingURL=search.plan.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"search.plan.d.ts","sourceRoot":"","sources":["../../../src/plan/search/search.plan.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,qCAAqC,CAAC;AAClE,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACxD,OAAO,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AAElC,qBAAa,WAAY,SAAQ,KAAK;IACpC,OAAO,CAAC,KAAK,CAAS;IACtB,OAAO,CAAC,QAAQ,CAAU;gBACd,MAAM,EAAE,WAAW,GAAG;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,OAAO,CAAA;KAAE;YASxD,cAAc;YAiBd,cAAc;IAatB,GAAG,IAAI,OAAO,CAAC,WAAW,CAAC;CAOlC"}
@@ -0,0 +1,36 @@
1
+ import { oAddress } from '../../core';
2
+ import { oPlan } from '../o-plan';
3
+ export class oSearchPlan extends oPlan {
4
+ query;
5
+ external;
6
+ constructor(config) {
7
+ super(config);
8
+ this.query = config.query;
9
+ this.external = config.external;
10
+ }
11
+ async externalSearch() {
12
+ return {
13
+ result: [],
14
+ type: 'result',
15
+ };
16
+ }
17
+ async internalSearch() {
18
+ const response = await this.node.use(new oAddress('o://search'), {
19
+ method: 'vector',
20
+ params: {
21
+ query: this.query,
22
+ },
23
+ });
24
+ return {
25
+ result: response.result.data,
26
+ type: 'result',
27
+ };
28
+ }
29
+ async run() {
30
+ const result = this.external
31
+ ? await this.externalSearch()
32
+ : await this.internalSearch();
33
+ return result;
34
+ }
35
+ }
36
+ //# sourceMappingURL=search.plan.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"search.plan.js","sourceRoot":"","sources":["../../../src/plan/search/search.plan.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAGtC,OAAO,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AAElC,MAAM,OAAO,WAAY,SAAQ,KAAK;IAC5B,KAAK,CAAS;IACd,QAAQ,CAAU;IAC1B,YAAY,MAA0D;QACpE,KAAK,CAAC,MAAM,CAAC,CAAC;QACd,IAAI,CAAC,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC;QAC1B,IAAI,CAAC,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC;IAClC,CAAC;IAKO,KAAK,CAAC,cAAc;QAC1B,OAAO;YACL,MAAM,EAAE,EAAE;YACV,IAAI,EAAE,QAAQ;SACf,CAAC;IAQJ,CAAC;IAKO,KAAK,CAAC,cAAc;QAC1B,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,QAAQ,CAAC,YAAY,CAAC,EAAE;YAC/D,MAAM,EAAE,QAAQ;YAChB,MAAM,EAAE;gBACN,KAAK,EAAE,IAAI,CAAC,KAAK;aAClB;SACF,CAAC,CAAC;QACH,OAAO;YACL,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,IAAI;YAC5B,IAAI,EAAE,QAAQ;SACf,CAAC;IACJ,CAAC;IAED,KAAK,CAAC,GAAG;QACP,MAAM,MAAM,GAAG,IAAI,CAAC,QAAQ;YAC1B,CAAC,CAAC,MAAM,IAAI,CAAC,cAAc,EAAE;YAC7B,CAAC,CAAC,MAAM,IAAI,CAAC,cAAc,EAAE,CAAC;QAEhC,OAAO,MAAM,CAAC;IAChB,CAAC;CACF"}
@@ -0,0 +1,2 @@
1
+ export * from './use.plan';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plan/use/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC"}
@@ -0,0 +1,2 @@
1
+ export * from './use.plan';
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/plan/use/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC"}
@@ -0,0 +1,10 @@
1
+ import { oDependency, oResponse } from '../../core';
2
+ import { oPlan } from '../o-plan';
3
+ import { oPlanType } from '../interfaces/plan-type.enum';
4
+ import { oPlanResult } from '../interfaces/plan.result';
5
+ export declare class oUsePlan extends oPlan {
6
+ type(): oPlanType;
7
+ handleDependencies(dependencies: oDependency[]): Promise<oResponse[]>;
8
+ run(): Promise<oPlanResult>;
9
+ }
10
+ //# sourceMappingURL=use.plan.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use.plan.d.ts","sourceRoot":"","sources":["../../../src/plan/use/use.plan.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,WAAW,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAC9D,OAAO,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AACzD,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAOxD,qBAAa,QAAS,SAAQ,KAAK;IACjC,IAAI;IAIE,kBAAkB,CAAC,YAAY,EAAE,WAAW,EAAE,GAAG,OAAO,CAAC,SAAS,EAAE,CAAC;IAUrE,GAAG,IAAI,OAAO,CAAC,WAAW,CAAC;CAuDlC"}
@@ -0,0 +1,58 @@
1
+ import { oAddress } from '../../core';
2
+ import { oPlan } from '../o-plan';
3
+ import { oPlanType } from '../interfaces/plan-type.enum';
4
+ import { oToolError } from '../../error';
5
+ import { oToolErrorCodes } from '../../error/enums/codes.error';
6
+ export class oUsePlan extends oPlan {
7
+ type() {
8
+ return oPlanType.USE;
9
+ }
10
+ async handleDependencies(dependencies) {
11
+ const response = [];
12
+ for (const dependency of dependencies) {
13
+ const result = await this.node.use(new oAddress(dependency.address), {});
14
+ response.push(result);
15
+ }
16
+ return response;
17
+ }
18
+ async run() {
19
+ this.logger.debug('Running...');
20
+ if (!this.config.receiver) {
21
+ throw new Error('Receiver is required');
22
+ }
23
+ const handshakeResponse = await this.node.use(this.config.receiver, {
24
+ method: 'handshake',
25
+ params: {
26
+ intent: this.config.intent,
27
+ },
28
+ });
29
+ this.logger.debug('Handshake response: ', handshakeResponse);
30
+ const data = handshakeResponse.result.data;
31
+ this.logger.debug('Handshake data: ', data);
32
+ const { handshake, error } = data;
33
+ if (error) {
34
+ return error;
35
+ }
36
+ if (!handshake) {
37
+ throw new oToolError(oToolErrorCodes.TOOL_ERROR, 'Failed to configure the tool use');
38
+ }
39
+ const response = await this.node.use(this.config.receiver, {
40
+ method: handshake.payload?.method,
41
+ params: handshake.payload?.params,
42
+ });
43
+ this.logger.debug('Use response: ', response);
44
+ if (response.result.error) {
45
+ return {
46
+ error: {
47
+ ...response.result.error,
48
+ },
49
+ type: 'error',
50
+ };
51
+ }
52
+ return {
53
+ result: response.result,
54
+ type: 'result',
55
+ };
56
+ }
57
+ }
58
+ //# sourceMappingURL=use.plan.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use.plan.js","sourceRoot":"","sources":["../../../src/plan/use/use.plan.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAA0B,MAAM,YAAY,CAAC;AAC9D,OAAO,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAEzD,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAKhE,MAAM,OAAO,QAAS,SAAQ,KAAK;IACjC,IAAI;QACF,OAAO,SAAS,CAAC,GAAG,CAAC;IACvB,CAAC;IAED,KAAK,CAAC,kBAAkB,CAAC,YAA2B;QAClD,MAAM,QAAQ,GAAgB,EAAE,CAAC;QACjC,KAAK,MAAM,UAAU,IAAI,YAAY,EAAE,CAAC;YAEtC,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,QAAQ,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE,EAAE,CAAC,CAAC;YACzE,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QACxB,CAAC;QACD,OAAO,QAAQ,CAAC;IAClB,CAAC;IAED,KAAK,CAAC,GAAG;QACP,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC;QAChC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,EAAE,CAAC;YAC1B,MAAM,IAAI,KAAK,CAAC,sBAAsB,CAAC,CAAC;QAC1C,CAAC;QAGD,MAAM,iBAAiB,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,EAAE;YAClE,MAAM,EAAE,WAAW;YACnB,MAAM,EAAE;gBACN,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,MAAM;aAO3B;SACF,CAAC,CAAC;QAEH,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,sBAAsB,EAAE,iBAAiB,CAAC,CAAC;QAC7D,MAAM,IAAI,GAAG,iBAAiB,CAAC,MAAM,CAAC,IAAW,CAAC;QAClD,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,kBAAkB,EAAE,IAAI,CAAC,CAAC;QAC5C,MAAM,EAAE,SAAS,EAAE,KAAK,EAAE,GAAQ,IAAI,CAAC;QACvC,IAAI,KAAK,EAAE,CAAC;YACV,OAAO,KAAK,CAAC;QACf,CAAC;QACD,IAAI,CAAC,SAAS,EAAE,CAAC;YACf,MAAM,IAAI,UAAU,CAClB,eAAe,CAAC,UAAU,EAC1B,kCAAkC,CACnC,CAAC;QACJ,CAAC;QACD,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,EAAE;YACzD,MAAM,EAAE,SAAS,CAAC,OAAO,EAAE,MAAM;YACjC,MAAM,EAAE,SAAS,CAAC,OAAO,EAAE,MAAM;SAClC,CAAC,CAAC;QACH,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,gBAAgB,EAAE,QAAQ,CAAC,CAAC;QAE9C,IAAI,QAAQ,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC;YAC1B,OAAO;gBACL,KAAK,EAAE;oBACL,GAAG,QAAQ,CAAC,MAAM,CAAC,KAAK;iBAGzB;gBACD,IAAI,EAAE,OAAO;aACd,CAAC;QACJ,CAAC;QAED,OAAO;YACL,MAAM,EAAE,QAAQ,CAAC,MAAM;YACvB,IAAI,EAAE,QAAQ;SACf,CAAC;IACJ,CAAC;CACF"}
@@ -0,0 +1,62 @@
1
+ import { Libp2p, Libp2pConfig, Multiaddr, PeerId } from '@olane/o-config';
2
+ import { CoreConfig } from './interfaces/core-config.interface';
3
+ import { NodeState } from './interfaces/state.enum';
4
+ import { oAddress } from './o-address';
5
+ import { Logger } from './utils/logger';
6
+ import { NodeType } from './interfaces/node-type.enum';
7
+ import { oConnectionManager } from './lib/o-connection-manager';
8
+ import { oResponse } from './lib/o-response';
9
+ import { oConnection } from './lib/o-connection';
10
+ import { oMethod } from '@olane/o-protocol';
11
+ import { oAddressResolution } from './lib/o-address-resolution';
12
+ import { oDependency } from './o-dependency';
13
+ import { UseOptions } from './interfaces/use-options.interface';
14
+ export declare abstract class oCoreNode {
15
+ readonly config: CoreConfig;
16
+ p2pNode: Libp2p;
17
+ logger: Logger;
18
+ networkConfig: Libp2pConfig;
19
+ address: oAddress;
20
+ readonly staticAddress: oAddress;
21
+ peerId: PeerId;
22
+ state: NodeState;
23
+ errors: Error[];
24
+ connectionManager: oConnectionManager;
25
+ leaders: Multiaddr[];
26
+ parentAddress: oAddress;
27
+ addressResolution: oAddressResolution;
28
+ readonly description: string;
29
+ dependencies: oDependency[];
30
+ methods: {
31
+ [key: string]: oMethod;
32
+ };
33
+ successCount: number;
34
+ errorCount: number;
35
+ constructor(config: CoreConfig);
36
+ get type(): NodeType;
37
+ get transports(): string[];
38
+ initialize(): Promise<void>;
39
+ whoami(): Promise<any>;
40
+ get parent(): oAddress | null;
41
+ get parentTransports(): Multiaddr[];
42
+ getTransports(address: oAddress): Multiaddr[];
43
+ handleStaticAddressTranslation(addressInput: oAddress): Promise<oAddress>;
44
+ translateAddress(addressWithLeaderTransports: oAddress): Promise<{
45
+ nextHopAddress: oAddress;
46
+ targetAddress: oAddress;
47
+ }>;
48
+ use(addressWithLeaderTransports: oAddress, data: {
49
+ method?: string;
50
+ params?: {
51
+ [key: string]: any;
52
+ };
53
+ }, config?: UseOptions): Promise<oResponse>;
54
+ advertiseToNetwork(): Promise<void>;
55
+ connectToParent(): Promise<void>;
56
+ register(): Promise<void>;
57
+ connect(nextHopAddress: oAddress, targetAddress: oAddress): Promise<oConnection>;
58
+ teardown(): Promise<void>;
59
+ start(): Promise<void>;
60
+ stop(): Promise<void>;
61
+ }
62
+ //# sourceMappingURL=core.node.d.ts.map