aec-agent 1.0.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 (574) hide show
  1. package/README.md +1 -0
  2. package/dist/agent-core.d.ts +81 -0
  3. package/dist/agent-core.d.ts.map +1 -0
  4. package/dist/agent-core.js +168 -0
  5. package/dist/agent-core.js.map +1 -0
  6. package/dist/components/artifact-hub/agent-artifact-view.d.ts +31 -0
  7. package/dist/components/artifact-hub/agent-artifact-view.d.ts.map +1 -0
  8. package/dist/components/artifact-hub/agent-artifact-view.js +264 -0
  9. package/dist/components/artifact-hub/agent-artifact-view.js.map +1 -0
  10. package/dist/components/artifact-hub/artifact-hub.d.ts +25 -0
  11. package/dist/components/artifact-hub/artifact-hub.d.ts.map +1 -0
  12. package/dist/components/artifact-hub/artifact-hub.js +39 -0
  13. package/dist/components/artifact-hub/artifact-hub.js.map +1 -0
  14. package/dist/components/artifact-hub/types/artifact.d.ts +158 -0
  15. package/dist/components/artifact-hub/types/artifact.d.ts.map +1 -0
  16. package/dist/components/artifact-hub/types/artifact.js +14 -0
  17. package/dist/components/artifact-hub/types/artifact.js.map +1 -0
  18. package/dist/components/event-handler/event-dispatcher.d.ts +17 -0
  19. package/dist/components/event-handler/event-dispatcher.d.ts.map +1 -0
  20. package/dist/components/event-handler/event-dispatcher.js +47 -0
  21. package/dist/components/event-handler/event-dispatcher.js.map +1 -0
  22. package/dist/components/event-handler/events.d.ts +154 -0
  23. package/dist/components/event-handler/events.d.ts.map +1 -0
  24. package/dist/components/event-handler/events.js +28 -0
  25. package/dist/components/event-handler/events.js.map +1 -0
  26. package/dist/components/event-handler/types.d.ts +10 -0
  27. package/dist/components/event-handler/types.d.ts.map +1 -0
  28. package/dist/components/event-handler/types.js +2 -0
  29. package/dist/components/event-handler/types.js.map +1 -0
  30. package/dist/components/llm-provider-hub/llm-provider-hub.d.ts +14 -0
  31. package/dist/components/llm-provider-hub/llm-provider-hub.d.ts.map +1 -0
  32. package/dist/components/llm-provider-hub/llm-provider-hub.js +34 -0
  33. package/dist/components/llm-provider-hub/llm-provider-hub.js.map +1 -0
  34. package/dist/components/llm-provider-hub/providers/anthropic-provider.d.ts +22 -0
  35. package/dist/components/llm-provider-hub/providers/anthropic-provider.d.ts.map +1 -0
  36. package/dist/components/llm-provider-hub/providers/anthropic-provider.js +249 -0
  37. package/dist/components/llm-provider-hub/providers/anthropic-provider.js.map +1 -0
  38. package/dist/components/llm-provider-hub/providers/bedrock-provider.d.ts +28 -0
  39. package/dist/components/llm-provider-hub/providers/bedrock-provider.d.ts.map +1 -0
  40. package/dist/components/llm-provider-hub/providers/bedrock-provider.js +345 -0
  41. package/dist/components/llm-provider-hub/providers/bedrock-provider.js.map +1 -0
  42. package/dist/components/llm-provider-hub/providers/model-info-mappers.d.ts +6 -0
  43. package/dist/components/llm-provider-hub/providers/model-info-mappers.d.ts.map +1 -0
  44. package/dist/components/llm-provider-hub/providers/model-info-mappers.js +267 -0
  45. package/dist/components/llm-provider-hub/providers/model-info-mappers.js.map +1 -0
  46. package/dist/components/llm-provider-hub/providers/openai-compatible-provider.d.ts +24 -0
  47. package/dist/components/llm-provider-hub/providers/openai-compatible-provider.d.ts.map +1 -0
  48. package/dist/components/llm-provider-hub/providers/openai-compatible-provider.js +243 -0
  49. package/dist/components/llm-provider-hub/providers/openai-compatible-provider.js.map +1 -0
  50. package/dist/components/llm-provider-hub/providers/openai-subscription-provider.d.ts +29 -0
  51. package/dist/components/llm-provider-hub/providers/openai-subscription-provider.d.ts.map +1 -0
  52. package/dist/components/llm-provider-hub/providers/openai-subscription-provider.js +299 -0
  53. package/dist/components/llm-provider-hub/providers/openai-subscription-provider.js.map +1 -0
  54. package/dist/components/llm-provider-hub/providers/registry.d.ts +6 -0
  55. package/dist/components/llm-provider-hub/providers/registry.d.ts.map +1 -0
  56. package/dist/components/llm-provider-hub/providers/registry.js +33 -0
  57. package/dist/components/llm-provider-hub/providers/registry.js.map +1 -0
  58. package/dist/components/llm-provider-hub/providers/types.d.ts +29 -0
  59. package/dist/components/llm-provider-hub/providers/types.d.ts.map +1 -0
  60. package/dist/components/llm-provider-hub/providers/types.js +2 -0
  61. package/dist/components/llm-provider-hub/providers/types.js.map +1 -0
  62. package/dist/components/llm-provider-hub/types.d.ts +84 -0
  63. package/dist/components/llm-provider-hub/types.d.ts.map +1 -0
  64. package/dist/components/llm-provider-hub/types.js +6 -0
  65. package/dist/components/llm-provider-hub/types.js.map +1 -0
  66. package/dist/components/multi-agent-orchestration/agent/agent-loop/agent-loop.d.ts +85 -0
  67. package/dist/components/multi-agent-orchestration/agent/agent-loop/agent-loop.d.ts.map +1 -0
  68. package/dist/components/multi-agent-orchestration/agent/agent-loop/agent-loop.js +500 -0
  69. package/dist/components/multi-agent-orchestration/agent/agent-loop/agent-loop.js.map +1 -0
  70. package/dist/components/multi-agent-orchestration/agent/agent-loop/components/abort.d.ts +29 -0
  71. package/dist/components/multi-agent-orchestration/agent/agent-loop/components/abort.d.ts.map +1 -0
  72. package/dist/components/multi-agent-orchestration/agent/agent-loop/components/abort.js +98 -0
  73. package/dist/components/multi-agent-orchestration/agent/agent-loop/components/abort.js.map +1 -0
  74. package/dist/components/multi-agent-orchestration/agent/agent-loop/components/compactor.d.ts +16 -0
  75. package/dist/components/multi-agent-orchestration/agent/agent-loop/components/compactor.d.ts.map +1 -0
  76. package/dist/components/multi-agent-orchestration/agent/agent-loop/components/compactor.js +116 -0
  77. package/dist/components/multi-agent-orchestration/agent/agent-loop/components/compactor.js.map +1 -0
  78. package/dist/components/multi-agent-orchestration/agent/agent-loop/components/compactor.types.d.ts +41 -0
  79. package/dist/components/multi-agent-orchestration/agent/agent-loop/components/compactor.types.d.ts.map +1 -0
  80. package/dist/components/multi-agent-orchestration/agent/agent-loop/components/compactor.types.js +2 -0
  81. package/dist/components/multi-agent-orchestration/agent/agent-loop/components/compactor.types.js.map +1 -0
  82. package/dist/components/multi-agent-orchestration/agent/agent-loop/components/counter.d.ts +69 -0
  83. package/dist/components/multi-agent-orchestration/agent/agent-loop/components/counter.d.ts.map +1 -0
  84. package/dist/components/multi-agent-orchestration/agent/agent-loop/components/counter.js +147 -0
  85. package/dist/components/multi-agent-orchestration/agent/agent-loop/components/counter.js.map +1 -0
  86. package/dist/components/multi-agent-orchestration/agent/agent-loop/components/harness-executor.d.ts +55 -0
  87. package/dist/components/multi-agent-orchestration/agent/agent-loop/components/harness-executor.d.ts.map +1 -0
  88. package/dist/components/multi-agent-orchestration/agent/agent-loop/components/harness-executor.js +406 -0
  89. package/dist/components/multi-agent-orchestration/agent/agent-loop/components/harness-executor.js.map +1 -0
  90. package/dist/components/multi-agent-orchestration/agent/agent-loop/components/run-trace.d.ts +19 -0
  91. package/dist/components/multi-agent-orchestration/agent/agent-loop/components/run-trace.d.ts.map +1 -0
  92. package/dist/components/multi-agent-orchestration/agent/agent-loop/components/run-trace.js +28 -0
  93. package/dist/components/multi-agent-orchestration/agent/agent-loop/components/run-trace.js.map +1 -0
  94. package/dist/components/multi-agent-orchestration/agent/agent-loop/components/summarizer.d.ts +17 -0
  95. package/dist/components/multi-agent-orchestration/agent/agent-loop/components/summarizer.d.ts.map +1 -0
  96. package/dist/components/multi-agent-orchestration/agent/agent-loop/components/summarizer.js +55 -0
  97. package/dist/components/multi-agent-orchestration/agent/agent-loop/components/summarizer.js.map +1 -0
  98. package/dist/components/multi-agent-orchestration/agent/agent-loop/components/summarizer.types.d.ts +3 -0
  99. package/dist/components/multi-agent-orchestration/agent/agent-loop/components/summarizer.types.d.ts.map +1 -0
  100. package/dist/components/multi-agent-orchestration/agent/agent-loop/components/summarizer.types.js +2 -0
  101. package/dist/components/multi-agent-orchestration/agent/agent-loop/components/summarizer.types.js.map +1 -0
  102. package/dist/components/multi-agent-orchestration/agent/agent-loop/components/tool-pairing.d.ts +20 -0
  103. package/dist/components/multi-agent-orchestration/agent/agent-loop/components/tool-pairing.d.ts.map +1 -0
  104. package/dist/components/multi-agent-orchestration/agent/agent-loop/components/tool-pairing.js +56 -0
  105. package/dist/components/multi-agent-orchestration/agent/agent-loop/components/tool-pairing.js.map +1 -0
  106. package/dist/components/multi-agent-orchestration/agent/agent-loop/functions/llm-input.d.ts +23 -0
  107. package/dist/components/multi-agent-orchestration/agent/agent-loop/functions/llm-input.d.ts.map +1 -0
  108. package/dist/components/multi-agent-orchestration/agent/agent-loop/functions/llm-input.js +127 -0
  109. package/dist/components/multi-agent-orchestration/agent/agent-loop/functions/llm-input.js.map +1 -0
  110. package/dist/components/multi-agent-orchestration/agent/agent-loop/functions/memory-recall.d.ts +9 -0
  111. package/dist/components/multi-agent-orchestration/agent/agent-loop/functions/memory-recall.d.ts.map +1 -0
  112. package/dist/components/multi-agent-orchestration/agent/agent-loop/functions/memory-recall.js +40 -0
  113. package/dist/components/multi-agent-orchestration/agent/agent-loop/functions/memory-recall.js.map +1 -0
  114. package/dist/components/multi-agent-orchestration/agent/agent-loop/types.d.ts +135 -0
  115. package/dist/components/multi-agent-orchestration/agent/agent-loop/types.d.ts.map +1 -0
  116. package/dist/components/multi-agent-orchestration/agent/agent-loop/types.js +31 -0
  117. package/dist/components/multi-agent-orchestration/agent/agent-loop/types.js.map +1 -0
  118. package/dist/components/multi-agent-orchestration/agent/agent.d.ts +93 -0
  119. package/dist/components/multi-agent-orchestration/agent/agent.d.ts.map +1 -0
  120. package/dist/components/multi-agent-orchestration/agent/agent.js +223 -0
  121. package/dist/components/multi-agent-orchestration/agent/agent.js.map +1 -0
  122. package/dist/components/multi-agent-orchestration/agent/artifact-manager/artifact-manager.d.ts +18 -0
  123. package/dist/components/multi-agent-orchestration/agent/artifact-manager/artifact-manager.d.ts.map +1 -0
  124. package/dist/components/multi-agent-orchestration/agent/artifact-manager/artifact-manager.js +20 -0
  125. package/dist/components/multi-agent-orchestration/agent/artifact-manager/artifact-manager.js.map +1 -0
  126. package/dist/components/multi-agent-orchestration/agent/channel-manager/channel-manager.d.ts +6 -0
  127. package/dist/components/multi-agent-orchestration/agent/channel-manager/channel-manager.d.ts.map +1 -0
  128. package/dist/components/multi-agent-orchestration/agent/channel-manager/channel-manager.js +6 -0
  129. package/dist/components/multi-agent-orchestration/agent/channel-manager/channel-manager.js.map +1 -0
  130. package/dist/components/multi-agent-orchestration/agent/context-manager/context-manager.d.ts +22 -0
  131. package/dist/components/multi-agent-orchestration/agent/context-manager/context-manager.d.ts.map +1 -0
  132. package/dist/components/multi-agent-orchestration/agent/context-manager/context-manager.js +52 -0
  133. package/dist/components/multi-agent-orchestration/agent/context-manager/context-manager.js.map +1 -0
  134. package/dist/components/multi-agent-orchestration/agent/context-manager/types.d.ts +13 -0
  135. package/dist/components/multi-agent-orchestration/agent/context-manager/types.d.ts.map +1 -0
  136. package/dist/components/multi-agent-orchestration/agent/context-manager/types.js +2 -0
  137. package/dist/components/multi-agent-orchestration/agent/context-manager/types.js.map +1 -0
  138. package/dist/components/multi-agent-orchestration/agent/conversation-manager/conversation-manager.d.ts +25 -0
  139. package/dist/components/multi-agent-orchestration/agent/conversation-manager/conversation-manager.d.ts.map +1 -0
  140. package/dist/components/multi-agent-orchestration/agent/conversation-manager/conversation-manager.js +74 -0
  141. package/dist/components/multi-agent-orchestration/agent/conversation-manager/conversation-manager.js.map +1 -0
  142. package/dist/components/multi-agent-orchestration/agent/memory-system/components/consolidation-scheduler.d.ts +57 -0
  143. package/dist/components/multi-agent-orchestration/agent/memory-system/components/consolidation-scheduler.d.ts.map +1 -0
  144. package/dist/components/multi-agent-orchestration/agent/memory-system/components/consolidation-scheduler.js +185 -0
  145. package/dist/components/multi-agent-orchestration/agent/memory-system/components/consolidation-scheduler.js.map +1 -0
  146. package/dist/components/multi-agent-orchestration/agent/memory-system/components/dreaming.d.ts +38 -0
  147. package/dist/components/multi-agent-orchestration/agent/memory-system/components/dreaming.d.ts.map +1 -0
  148. package/dist/components/multi-agent-orchestration/agent/memory-system/components/dreaming.js +89 -0
  149. package/dist/components/multi-agent-orchestration/agent/memory-system/components/dreaming.js.map +1 -0
  150. package/dist/components/multi-agent-orchestration/agent/memory-system/components/indexing.d.ts +30 -0
  151. package/dist/components/multi-agent-orchestration/agent/memory-system/components/indexing.d.ts.map +1 -0
  152. package/dist/components/multi-agent-orchestration/agent/memory-system/components/indexing.js +91 -0
  153. package/dist/components/multi-agent-orchestration/agent/memory-system/components/indexing.js.map +1 -0
  154. package/dist/components/multi-agent-orchestration/agent/memory-system/components/learning.d.ts +3 -0
  155. package/dist/components/multi-agent-orchestration/agent/memory-system/components/learning.d.ts.map +1 -0
  156. package/dist/components/multi-agent-orchestration/agent/memory-system/components/learning.js +3 -0
  157. package/dist/components/multi-agent-orchestration/agent/memory-system/components/learning.js.map +1 -0
  158. package/dist/components/multi-agent-orchestration/agent/memory-system/components/memory.d.ts +22 -0
  159. package/dist/components/multi-agent-orchestration/agent/memory-system/components/memory.d.ts.map +1 -0
  160. package/dist/components/multi-agent-orchestration/agent/memory-system/components/memory.js +196 -0
  161. package/dist/components/multi-agent-orchestration/agent/memory-system/components/memory.js.map +1 -0
  162. package/dist/components/multi-agent-orchestration/agent/memory-system/components/retrieval.d.ts +17 -0
  163. package/dist/components/multi-agent-orchestration/agent/memory-system/components/retrieval.d.ts.map +1 -0
  164. package/dist/components/multi-agent-orchestration/agent/memory-system/components/retrieval.js +114 -0
  165. package/dist/components/multi-agent-orchestration/agent/memory-system/components/retrieval.js.map +1 -0
  166. package/dist/components/multi-agent-orchestration/agent/memory-system/memory-system.d.ts +89 -0
  167. package/dist/components/multi-agent-orchestration/agent/memory-system/memory-system.d.ts.map +1 -0
  168. package/dist/components/multi-agent-orchestration/agent/memory-system/memory-system.js +178 -0
  169. package/dist/components/multi-agent-orchestration/agent/memory-system/memory-system.js.map +1 -0
  170. package/dist/components/multi-agent-orchestration/agent/memory-system/types/config.d.ts +29 -0
  171. package/dist/components/multi-agent-orchestration/agent/memory-system/types/config.d.ts.map +1 -0
  172. package/dist/components/multi-agent-orchestration/agent/memory-system/types/config.js +2 -0
  173. package/dist/components/multi-agent-orchestration/agent/memory-system/types/config.js.map +1 -0
  174. package/dist/components/multi-agent-orchestration/agent/memory-system/types/pipeline.d.ts +33 -0
  175. package/dist/components/multi-agent-orchestration/agent/memory-system/types/pipeline.d.ts.map +1 -0
  176. package/dist/components/multi-agent-orchestration/agent/memory-system/types/pipeline.js +2 -0
  177. package/dist/components/multi-agent-orchestration/agent/memory-system/types/pipeline.js.map +1 -0
  178. package/dist/components/multi-agent-orchestration/agent/memory-system/types/record.d.ts +27 -0
  179. package/dist/components/multi-agent-orchestration/agent/memory-system/types/record.d.ts.map +1 -0
  180. package/dist/components/multi-agent-orchestration/agent/memory-system/types/record.js +5 -0
  181. package/dist/components/multi-agent-orchestration/agent/memory-system/types/record.js.map +1 -0
  182. package/dist/components/multi-agent-orchestration/agent/model-manager/model-manager.d.ts +39 -0
  183. package/dist/components/multi-agent-orchestration/agent/model-manager/model-manager.d.ts.map +1 -0
  184. package/dist/components/multi-agent-orchestration/agent/model-manager/model-manager.js +70 -0
  185. package/dist/components/multi-agent-orchestration/agent/model-manager/model-manager.js.map +1 -0
  186. package/dist/components/multi-agent-orchestration/agent/sandbox-manager/sandbox-manager.d.ts +43 -0
  187. package/dist/components/multi-agent-orchestration/agent/sandbox-manager/sandbox-manager.d.ts.map +1 -0
  188. package/dist/components/multi-agent-orchestration/agent/sandbox-manager/sandbox-manager.js +126 -0
  189. package/dist/components/multi-agent-orchestration/agent/sandbox-manager/sandbox-manager.js.map +1 -0
  190. package/dist/components/multi-agent-orchestration/agent/scheduled-job-manager/scheduled-job-manager.d.ts +38 -0
  191. package/dist/components/multi-agent-orchestration/agent/scheduled-job-manager/scheduled-job-manager.d.ts.map +1 -0
  192. package/dist/components/multi-agent-orchestration/agent/scheduled-job-manager/scheduled-job-manager.js +155 -0
  193. package/dist/components/multi-agent-orchestration/agent/scheduled-job-manager/scheduled-job-manager.js.map +1 -0
  194. package/dist/components/multi-agent-orchestration/agent/scheduled-job-manager/types.d.ts +27 -0
  195. package/dist/components/multi-agent-orchestration/agent/scheduled-job-manager/types.d.ts.map +1 -0
  196. package/dist/components/multi-agent-orchestration/agent/scheduled-job-manager/types.js +2 -0
  197. package/dist/components/multi-agent-orchestration/agent/scheduled-job-manager/types.js.map +1 -0
  198. package/dist/components/multi-agent-orchestration/agent/skill-manager/skill-index.d.ts +6 -0
  199. package/dist/components/multi-agent-orchestration/agent/skill-manager/skill-index.d.ts.map +1 -0
  200. package/dist/components/multi-agent-orchestration/agent/skill-manager/skill-index.js +43 -0
  201. package/dist/components/multi-agent-orchestration/agent/skill-manager/skill-index.js.map +1 -0
  202. package/dist/components/multi-agent-orchestration/agent/skill-manager/skill-manager.d.ts +56 -0
  203. package/dist/components/multi-agent-orchestration/agent/skill-manager/skill-manager.d.ts.map +1 -0
  204. package/dist/components/multi-agent-orchestration/agent/skill-manager/skill-manager.js +107 -0
  205. package/dist/components/multi-agent-orchestration/agent/skill-manager/skill-manager.js.map +1 -0
  206. package/dist/components/multi-agent-orchestration/agent/tool-manager/tool-manager.d.ts +20 -0
  207. package/dist/components/multi-agent-orchestration/agent/tool-manager/tool-manager.d.ts.map +1 -0
  208. package/dist/components/multi-agent-orchestration/agent/tool-manager/tool-manager.js +28 -0
  209. package/dist/components/multi-agent-orchestration/agent/tool-manager/tool-manager.js.map +1 -0
  210. package/dist/components/multi-agent-orchestration/agent/types.d.ts +44 -0
  211. package/dist/components/multi-agent-orchestration/agent/types.d.ts.map +1 -0
  212. package/dist/components/multi-agent-orchestration/agent/types.js +2 -0
  213. package/dist/components/multi-agent-orchestration/agent/types.js.map +1 -0
  214. package/dist/components/multi-agent-orchestration/multi-agent-orchestration.d.ts +23 -0
  215. package/dist/components/multi-agent-orchestration/multi-agent-orchestration.d.ts.map +1 -0
  216. package/dist/components/multi-agent-orchestration/multi-agent-orchestration.js +42 -0
  217. package/dist/components/multi-agent-orchestration/multi-agent-orchestration.js.map +1 -0
  218. package/dist/components/persistence-hub/default-stores/memory-agent-store.d.ts +10 -0
  219. package/dist/components/persistence-hub/default-stores/memory-agent-store.d.ts.map +1 -0
  220. package/dist/components/persistence-hub/default-stores/memory-agent-store.js +16 -0
  221. package/dist/components/persistence-hub/default-stores/memory-agent-store.js.map +1 -0
  222. package/dist/components/persistence-hub/default-stores/memory-artifact-store.d.ts +16 -0
  223. package/dist/components/persistence-hub/default-stores/memory-artifact-store.d.ts.map +1 -0
  224. package/dist/components/persistence-hub/default-stores/memory-artifact-store.js +70 -0
  225. package/dist/components/persistence-hub/default-stores/memory-artifact-store.js.map +1 -0
  226. package/dist/components/persistence-hub/default-stores/memory-memory-store.d.ts +12 -0
  227. package/dist/components/persistence-hub/default-stores/memory-memory-store.d.ts.map +1 -0
  228. package/dist/components/persistence-hub/default-stores/memory-memory-store.js +51 -0
  229. package/dist/components/persistence-hub/default-stores/memory-memory-store.js.map +1 -0
  230. package/dist/components/persistence-hub/default-stores/memory-message-store.d.ts +12 -0
  231. package/dist/components/persistence-hub/default-stores/memory-message-store.d.ts.map +1 -0
  232. package/dist/components/persistence-hub/default-stores/memory-message-store.js +33 -0
  233. package/dist/components/persistence-hub/default-stores/memory-message-store.js.map +1 -0
  234. package/dist/components/persistence-hub/default-stores/memory-provider-store.d.ts +9 -0
  235. package/dist/components/persistence-hub/default-stores/memory-provider-store.d.ts.map +1 -0
  236. package/dist/components/persistence-hub/default-stores/memory-provider-store.js +16 -0
  237. package/dist/components/persistence-hub/default-stores/memory-provider-store.js.map +1 -0
  238. package/dist/components/persistence-hub/default-stores/memory-session-store.d.ts +12 -0
  239. package/dist/components/persistence-hub/default-stores/memory-session-store.d.ts.map +1 -0
  240. package/dist/components/persistence-hub/default-stores/memory-session-store.js +42 -0
  241. package/dist/components/persistence-hub/default-stores/memory-session-store.js.map +1 -0
  242. package/dist/components/persistence-hub/default-stores/memory-skill-store.d.ts +9 -0
  243. package/dist/components/persistence-hub/default-stores/memory-skill-store.d.ts.map +1 -0
  244. package/dist/components/persistence-hub/default-stores/memory-skill-store.js +20 -0
  245. package/dist/components/persistence-hub/default-stores/memory-skill-store.js.map +1 -0
  246. package/dist/components/persistence-hub/persistence-hub.d.ts +34 -0
  247. package/dist/components/persistence-hub/persistence-hub.d.ts.map +1 -0
  248. package/dist/components/persistence-hub/persistence-hub.js +37 -0
  249. package/dist/components/persistence-hub/persistence-hub.js.map +1 -0
  250. package/dist/components/persistence-hub/types/agent-store.d.ts +8 -0
  251. package/dist/components/persistence-hub/types/agent-store.d.ts.map +1 -0
  252. package/dist/components/persistence-hub/types/agent-store.js +2 -0
  253. package/dist/components/persistence-hub/types/agent-store.js.map +1 -0
  254. package/dist/components/persistence-hub/types/artifact-store.d.ts +33 -0
  255. package/dist/components/persistence-hub/types/artifact-store.d.ts.map +1 -0
  256. package/dist/components/persistence-hub/types/artifact-store.js +2 -0
  257. package/dist/components/persistence-hub/types/artifact-store.js.map +1 -0
  258. package/dist/components/persistence-hub/types/memory-store.d.ts +23 -0
  259. package/dist/components/persistence-hub/types/memory-store.d.ts.map +1 -0
  260. package/dist/components/persistence-hub/types/memory-store.js +2 -0
  261. package/dist/components/persistence-hub/types/memory-store.js.map +1 -0
  262. package/dist/components/persistence-hub/types/message-store.d.ts +27 -0
  263. package/dist/components/persistence-hub/types/message-store.d.ts.map +1 -0
  264. package/dist/components/persistence-hub/types/message-store.js +2 -0
  265. package/dist/components/persistence-hub/types/message-store.js.map +1 -0
  266. package/dist/components/persistence-hub/types/provider-store.d.ts +28 -0
  267. package/dist/components/persistence-hub/types/provider-store.d.ts.map +1 -0
  268. package/dist/components/persistence-hub/types/provider-store.js +5 -0
  269. package/dist/components/persistence-hub/types/provider-store.js.map +1 -0
  270. package/dist/components/persistence-hub/types/session-store.d.ts +15 -0
  271. package/dist/components/persistence-hub/types/session-store.d.ts.map +1 -0
  272. package/dist/components/persistence-hub/types/session-store.js +2 -0
  273. package/dist/components/persistence-hub/types/session-store.js.map +1 -0
  274. package/dist/components/persistence-hub/types/skill-store.d.ts +22 -0
  275. package/dist/components/persistence-hub/types/skill-store.d.ts.map +1 -0
  276. package/dist/components/persistence-hub/types/skill-store.js +2 -0
  277. package/dist/components/persistence-hub/types/skill-store.js.map +1 -0
  278. package/dist/components/sandbox-hub/approval-policy.d.ts +12 -0
  279. package/dist/components/sandbox-hub/approval-policy.d.ts.map +1 -0
  280. package/dist/components/sandbox-hub/approval-policy.js +11 -0
  281. package/dist/components/sandbox-hub/approval-policy.js.map +1 -0
  282. package/dist/components/sandbox-hub/docker/aec-sandbox-image.d.ts +3 -0
  283. package/dist/components/sandbox-hub/docker/aec-sandbox-image.d.ts.map +1 -0
  284. package/dist/components/sandbox-hub/docker/aec-sandbox-image.js +31 -0
  285. package/dist/components/sandbox-hub/docker/aec-sandbox-image.js.map +1 -0
  286. package/dist/components/sandbox-hub/docker/docker-cli.d.ts +32 -0
  287. package/dist/components/sandbox-hub/docker/docker-cli.d.ts.map +1 -0
  288. package/dist/components/sandbox-hub/docker/docker-cli.js +83 -0
  289. package/dist/components/sandbox-hub/docker/docker-cli.js.map +1 -0
  290. package/dist/components/sandbox-hub/docker/docker-sandbox-provider.d.ts +70 -0
  291. package/dist/components/sandbox-hub/docker/docker-sandbox-provider.d.ts.map +1 -0
  292. package/dist/components/sandbox-hub/docker/docker-sandbox-provider.js +166 -0
  293. package/dist/components/sandbox-hub/docker/docker-sandbox-provider.js.map +1 -0
  294. package/dist/components/sandbox-hub/docker/docker-sandbox.d.ts +51 -0
  295. package/dist/components/sandbox-hub/docker/docker-sandbox.d.ts.map +1 -0
  296. package/dist/components/sandbox-hub/docker/docker-sandbox.js +584 -0
  297. package/dist/components/sandbox-hub/docker/docker-sandbox.js.map +1 -0
  298. package/dist/components/sandbox-hub/docker/sandbox-helper.d.ts +4 -0
  299. package/dist/components/sandbox-hub/docker/sandbox-helper.d.ts.map +1 -0
  300. package/dist/components/sandbox-hub/docker/sandbox-helper.js +442 -0
  301. package/dist/components/sandbox-hub/docker/sandbox-helper.js.map +1 -0
  302. package/dist/components/sandbox-hub/docker/types.d.ts +26 -0
  303. package/dist/components/sandbox-hub/docker/types.d.ts.map +1 -0
  304. package/dist/components/sandbox-hub/docker/types.js +2 -0
  305. package/dist/components/sandbox-hub/docker/types.js.map +1 -0
  306. package/dist/components/sandbox-hub/host/host-sandbox-provider.d.ts +34 -0
  307. package/dist/components/sandbox-hub/host/host-sandbox-provider.d.ts.map +1 -0
  308. package/dist/components/sandbox-hub/host/host-sandbox-provider.js +81 -0
  309. package/dist/components/sandbox-hub/host/host-sandbox-provider.js.map +1 -0
  310. package/dist/components/sandbox-hub/host/host-sandbox.d.ts +22 -0
  311. package/dist/components/sandbox-hub/host/host-sandbox.d.ts.map +1 -0
  312. package/dist/components/sandbox-hub/host/host-sandbox.js +508 -0
  313. package/dist/components/sandbox-hub/host/host-sandbox.js.map +1 -0
  314. package/dist/components/sandbox-hub/logical-path.d.ts +28 -0
  315. package/dist/components/sandbox-hub/logical-path.d.ts.map +1 -0
  316. package/dist/components/sandbox-hub/logical-path.js +73 -0
  317. package/dist/components/sandbox-hub/logical-path.js.map +1 -0
  318. package/dist/components/sandbox-hub/sandbox-hub.d.ts +69 -0
  319. package/dist/components/sandbox-hub/sandbox-hub.d.ts.map +1 -0
  320. package/dist/components/sandbox-hub/sandbox-hub.js +216 -0
  321. package/dist/components/sandbox-hub/sandbox-hub.js.map +1 -0
  322. package/dist/components/sandbox-hub/traced-sandbox.d.ts +15 -0
  323. package/dist/components/sandbox-hub/traced-sandbox.d.ts.map +1 -0
  324. package/dist/components/sandbox-hub/traced-sandbox.js +69 -0
  325. package/dist/components/sandbox-hub/traced-sandbox.js.map +1 -0
  326. package/dist/components/sandbox-hub/types/policy.d.ts +40 -0
  327. package/dist/components/sandbox-hub/types/policy.d.ts.map +1 -0
  328. package/dist/components/sandbox-hub/types/policy.js +2 -0
  329. package/dist/components/sandbox-hub/types/policy.js.map +1 -0
  330. package/dist/components/sandbox-hub/types/provider.d.ts +40 -0
  331. package/dist/components/sandbox-hub/types/provider.d.ts.map +1 -0
  332. package/dist/components/sandbox-hub/types/provider.js +2 -0
  333. package/dist/components/sandbox-hub/types/provider.js.map +1 -0
  334. package/dist/components/sandbox-hub/types/sandbox.d.ts +185 -0
  335. package/dist/components/sandbox-hub/types/sandbox.d.ts.map +1 -0
  336. package/dist/components/sandbox-hub/types/sandbox.js +15 -0
  337. package/dist/components/sandbox-hub/types/sandbox.js.map +1 -0
  338. package/dist/components/skill-hub/built-in-skills/essential-skills.d.ts +5 -0
  339. package/dist/components/skill-hub/built-in-skills/essential-skills.d.ts.map +1 -0
  340. package/dist/components/skill-hub/built-in-skills/essential-skills.js +10 -0
  341. package/dist/components/skill-hub/built-in-skills/essential-skills.js.map +1 -0
  342. package/dist/components/skill-hub/built-in-skills/plan.d.ts +3 -0
  343. package/dist/components/skill-hub/built-in-skills/plan.d.ts.map +1 -0
  344. package/dist/components/skill-hub/built-in-skills/plan.js +33 -0
  345. package/dist/components/skill-hub/built-in-skills/plan.js.map +1 -0
  346. package/dist/components/skill-hub/built-in-skills/skill-creator.d.ts +3 -0
  347. package/dist/components/skill-hub/built-in-skills/skill-creator.d.ts.map +1 -0
  348. package/dist/components/skill-hub/built-in-skills/skill-creator.js +186 -0
  349. package/dist/components/skill-hub/built-in-skills/skill-creator.js.map +1 -0
  350. package/dist/components/skill-hub/built-in-skills/web-research.d.ts +3 -0
  351. package/dist/components/skill-hub/built-in-skills/web-research.d.ts.map +1 -0
  352. package/dist/components/skill-hub/built-in-skills/web-research.js +35 -0
  353. package/dist/components/skill-hub/built-in-skills/web-research.js.map +1 -0
  354. package/dist/components/skill-hub/skill-format.d.ts +40 -0
  355. package/dist/components/skill-hub/skill-format.d.ts.map +1 -0
  356. package/dist/components/skill-hub/skill-format.js +378 -0
  357. package/dist/components/skill-hub/skill-format.js.map +1 -0
  358. package/dist/components/skill-hub/skill-hub.d.ts +45 -0
  359. package/dist/components/skill-hub/skill-hub.d.ts.map +1 -0
  360. package/dist/components/skill-hub/skill-hub.js +173 -0
  361. package/dist/components/skill-hub/skill-hub.js.map +1 -0
  362. package/dist/components/skill-hub/types/agent-skills.d.ts +20 -0
  363. package/dist/components/skill-hub/types/agent-skills.d.ts.map +1 -0
  364. package/dist/components/skill-hub/types/agent-skills.js +2 -0
  365. package/dist/components/skill-hub/types/agent-skills.js.map +1 -0
  366. package/dist/components/skill-hub/types/skill.d.ts +55 -0
  367. package/dist/components/skill-hub/types/skill.d.ts.map +1 -0
  368. package/dist/components/skill-hub/types/skill.js +11 -0
  369. package/dist/components/skill-hub/types/skill.js.map +1 -0
  370. package/dist/components/tool-hub/built-in-tools/artifacts/artifact-helpers.d.ts +52 -0
  371. package/dist/components/tool-hub/built-in-tools/artifacts/artifact-helpers.d.ts.map +1 -0
  372. package/dist/components/tool-hub/built-in-tools/artifacts/artifact-helpers.js +143 -0
  373. package/dist/components/tool-hub/built-in-tools/artifacts/artifact-helpers.js.map +1 -0
  374. package/dist/components/tool-hub/built-in-tools/artifacts/create-artifact-tools.d.ts +7 -0
  375. package/dist/components/tool-hub/built-in-tools/artifacts/create-artifact-tools.d.ts.map +1 -0
  376. package/dist/components/tool-hub/built-in-tools/artifacts/create-artifact-tools.js +18 -0
  377. package/dist/components/tool-hub/built-in-tools/artifacts/create-artifact-tools.js.map +1 -0
  378. package/dist/components/tool-hub/built-in-tools/artifacts/list-artifacts-tool.d.ts +16 -0
  379. package/dist/components/tool-hub/built-in-tools/artifacts/list-artifacts-tool.d.ts.map +1 -0
  380. package/dist/components/tool-hub/built-in-tools/artifacts/list-artifacts-tool.js +69 -0
  381. package/dist/components/tool-hub/built-in-tools/artifacts/list-artifacts-tool.js.map +1 -0
  382. package/dist/components/tool-hub/built-in-tools/artifacts/read-artifact-tool.d.ts +16 -0
  383. package/dist/components/tool-hub/built-in-tools/artifacts/read-artifact-tool.d.ts.map +1 -0
  384. package/dist/components/tool-hub/built-in-tools/artifacts/read-artifact-tool.js +79 -0
  385. package/dist/components/tool-hub/built-in-tools/artifacts/read-artifact-tool.js.map +1 -0
  386. package/dist/components/tool-hub/built-in-tools/artifacts/save-artifact-tool.d.ts +16 -0
  387. package/dist/components/tool-hub/built-in-tools/artifacts/save-artifact-tool.d.ts.map +1 -0
  388. package/dist/components/tool-hub/built-in-tools/artifacts/save-artifact-tool.js +105 -0
  389. package/dist/components/tool-hub/built-in-tools/artifacts/save-artifact-tool.js.map +1 -0
  390. package/dist/components/tool-hub/built-in-tools/artifacts/types.d.ts +11 -0
  391. package/dist/components/tool-hub/built-in-tools/artifacts/types.d.ts.map +1 -0
  392. package/dist/components/tool-hub/built-in-tools/artifacts/types.js +8 -0
  393. package/dist/components/tool-hub/built-in-tools/artifacts/types.js.map +1 -0
  394. package/dist/components/tool-hub/built-in-tools/artifacts/update-artifact-tool.d.ts +17 -0
  395. package/dist/components/tool-hub/built-in-tools/artifacts/update-artifact-tool.d.ts.map +1 -0
  396. package/dist/components/tool-hub/built-in-tools/artifacts/update-artifact-tool.js +100 -0
  397. package/dist/components/tool-hub/built-in-tools/artifacts/update-artifact-tool.js.map +1 -0
  398. package/dist/components/tool-hub/built-in-tools/interaction/clarify-tool.d.ts +16 -0
  399. package/dist/components/tool-hub/built-in-tools/interaction/clarify-tool.d.ts.map +1 -0
  400. package/dist/components/tool-hub/built-in-tools/interaction/clarify-tool.js +94 -0
  401. package/dist/components/tool-hub/built-in-tools/interaction/clarify-tool.js.map +1 -0
  402. package/dist/components/tool-hub/built-in-tools/skills/skill-manage-tool.d.ts +22 -0
  403. package/dist/components/tool-hub/built-in-tools/skills/skill-manage-tool.d.ts.map +1 -0
  404. package/dist/components/tool-hub/built-in-tools/skills/skill-manage-tool.js +226 -0
  405. package/dist/components/tool-hub/built-in-tools/skills/skill-manage-tool.js.map +1 -0
  406. package/dist/components/tool-hub/built-in-tools/skills/skill-view-tool.d.ts +18 -0
  407. package/dist/components/tool-hub/built-in-tools/skills/skill-view-tool.d.ts.map +1 -0
  408. package/dist/components/tool-hub/built-in-tools/skills/skill-view-tool.js +86 -0
  409. package/dist/components/tool-hub/built-in-tools/skills/skill-view-tool.js.map +1 -0
  410. package/dist/components/tool-hub/built-in-tools/skills/skill-workspace.d.ts +26 -0
  411. package/dist/components/tool-hub/built-in-tools/skills/skill-workspace.d.ts.map +1 -0
  412. package/dist/components/tool-hub/built-in-tools/skills/skill-workspace.js +93 -0
  413. package/dist/components/tool-hub/built-in-tools/skills/skill-workspace.js.map +1 -0
  414. package/dist/components/tool-hub/built-in-tools/web/duckduckgo-search-provider.d.ts +28 -0
  415. package/dist/components/tool-hub/built-in-tools/web/duckduckgo-search-provider.d.ts.map +1 -0
  416. package/dist/components/tool-hub/built-in-tools/web/duckduckgo-search-provider.js +116 -0
  417. package/dist/components/tool-hub/built-in-tools/web/duckduckgo-search-provider.js.map +1 -0
  418. package/dist/components/tool-hub/built-in-tools/web/html-to-text.d.ts +14 -0
  419. package/dist/components/tool-hub/built-in-tools/web/html-to-text.d.ts.map +1 -0
  420. package/dist/components/tool-hub/built-in-tools/web/html-to-text.js +158 -0
  421. package/dist/components/tool-hub/built-in-tools/web/html-to-text.js.map +1 -0
  422. package/dist/components/tool-hub/built-in-tools/web/network-guard.d.ts +21 -0
  423. package/dist/components/tool-hub/built-in-tools/web/network-guard.d.ts.map +1 -0
  424. package/dist/components/tool-hub/built-in-tools/web/network-guard.js +106 -0
  425. package/dist/components/tool-hub/built-in-tools/web/network-guard.js.map +1 -0
  426. package/dist/components/tool-hub/built-in-tools/web/types.d.ts +23 -0
  427. package/dist/components/tool-hub/built-in-tools/web/types.d.ts.map +1 -0
  428. package/dist/components/tool-hub/built-in-tools/web/types.js +5 -0
  429. package/dist/components/tool-hub/built-in-tools/web/types.js.map +1 -0
  430. package/dist/components/tool-hub/built-in-tools/web/web-extract-tool.d.ts +37 -0
  431. package/dist/components/tool-hub/built-in-tools/web/web-extract-tool.d.ts.map +1 -0
  432. package/dist/components/tool-hub/built-in-tools/web/web-extract-tool.js +206 -0
  433. package/dist/components/tool-hub/built-in-tools/web/web-extract-tool.js.map +1 -0
  434. package/dist/components/tool-hub/built-in-tools/web/web-search-tool.d.ts +25 -0
  435. package/dist/components/tool-hub/built-in-tools/web/web-search-tool.d.ts.map +1 -0
  436. package/dist/components/tool-hub/built-in-tools/web/web-search-tool.js +82 -0
  437. package/dist/components/tool-hub/built-in-tools/web/web-search-tool.js.map +1 -0
  438. package/dist/components/tool-hub/built-in-tools/workspace/create-workspace-tools.d.ts +7 -0
  439. package/dist/components/tool-hub/built-in-tools/workspace/create-workspace-tools.d.ts.map +1 -0
  440. package/dist/components/tool-hub/built-in-tools/workspace/create-workspace-tools.js +24 -0
  441. package/dist/components/tool-hub/built-in-tools/workspace/create-workspace-tools.js.map +1 -0
  442. package/dist/components/tool-hub/built-in-tools/workspace/edit-file-tool.d.ts +15 -0
  443. package/dist/components/tool-hub/built-in-tools/workspace/edit-file-tool.d.ts.map +1 -0
  444. package/dist/components/tool-hub/built-in-tools/workspace/edit-file-tool.js +103 -0
  445. package/dist/components/tool-hub/built-in-tools/workspace/edit-file-tool.js.map +1 -0
  446. package/dist/components/tool-hub/built-in-tools/workspace/list-files-tool.d.ts +12 -0
  447. package/dist/components/tool-hub/built-in-tools/workspace/list-files-tool.d.ts.map +1 -0
  448. package/dist/components/tool-hub/built-in-tools/workspace/list-files-tool.js +53 -0
  449. package/dist/components/tool-hub/built-in-tools/workspace/list-files-tool.js.map +1 -0
  450. package/dist/components/tool-hub/built-in-tools/workspace/read-file-tool.d.ts +15 -0
  451. package/dist/components/tool-hub/built-in-tools/workspace/read-file-tool.d.ts.map +1 -0
  452. package/dist/components/tool-hub/built-in-tools/workspace/read-file-tool.js +71 -0
  453. package/dist/components/tool-hub/built-in-tools/workspace/read-file-tool.js.map +1 -0
  454. package/dist/components/tool-hub/built-in-tools/workspace/run-code-tool.d.ts +16 -0
  455. package/dist/components/tool-hub/built-in-tools/workspace/run-code-tool.d.ts.map +1 -0
  456. package/dist/components/tool-hub/built-in-tools/workspace/run-code-tool.js +72 -0
  457. package/dist/components/tool-hub/built-in-tools/workspace/run-code-tool.js.map +1 -0
  458. package/dist/components/tool-hub/built-in-tools/workspace/search-files-tool.d.ts +12 -0
  459. package/dist/components/tool-hub/built-in-tools/workspace/search-files-tool.d.ts.map +1 -0
  460. package/dist/components/tool-hub/built-in-tools/workspace/search-files-tool.js +64 -0
  461. package/dist/components/tool-hub/built-in-tools/workspace/search-files-tool.js.map +1 -0
  462. package/dist/components/tool-hub/built-in-tools/workspace/terminal-tool.d.ts +19 -0
  463. package/dist/components/tool-hub/built-in-tools/workspace/terminal-tool.d.ts.map +1 -0
  464. package/dist/components/tool-hub/built-in-tools/workspace/terminal-tool.js +111 -0
  465. package/dist/components/tool-hub/built-in-tools/workspace/terminal-tool.js.map +1 -0
  466. package/dist/components/tool-hub/built-in-tools/workspace/types.d.ts +16 -0
  467. package/dist/components/tool-hub/built-in-tools/workspace/types.d.ts.map +1 -0
  468. package/dist/components/tool-hub/built-in-tools/workspace/types.js +8 -0
  469. package/dist/components/tool-hub/built-in-tools/workspace/types.js.map +1 -0
  470. package/dist/components/tool-hub/built-in-tools/workspace/workspace-helpers.d.ts +29 -0
  471. package/dist/components/tool-hub/built-in-tools/workspace/workspace-helpers.d.ts.map +1 -0
  472. package/dist/components/tool-hub/built-in-tools/workspace/workspace-helpers.js +128 -0
  473. package/dist/components/tool-hub/built-in-tools/workspace/workspace-helpers.js.map +1 -0
  474. package/dist/components/tool-hub/built-in-tools/workspace/write-file-tool.d.ts +17 -0
  475. package/dist/components/tool-hub/built-in-tools/workspace/write-file-tool.d.ts.map +1 -0
  476. package/dist/components/tool-hub/built-in-tools/workspace/write-file-tool.js +61 -0
  477. package/dist/components/tool-hub/built-in-tools/workspace/write-file-tool.js.map +1 -0
  478. package/dist/components/tool-hub/policies/default-tool-policy.d.ts +17 -0
  479. package/dist/components/tool-hub/policies/default-tool-policy.d.ts.map +1 -0
  480. package/dist/components/tool-hub/policies/default-tool-policy.js +99 -0
  481. package/dist/components/tool-hub/policies/default-tool-policy.js.map +1 -0
  482. package/dist/components/tool-hub/tool-hub.d.ts +28 -0
  483. package/dist/components/tool-hub/tool-hub.d.ts.map +1 -0
  484. package/dist/components/tool-hub/tool-hub.js +49 -0
  485. package/dist/components/tool-hub/tool-hub.js.map +1 -0
  486. package/dist/components/tool-hub/types.d.ts +138 -0
  487. package/dist/components/tool-hub/types.d.ts.map +1 -0
  488. package/dist/components/tool-hub/types.js +2 -0
  489. package/dist/components/tool-hub/types.js.map +1 -0
  490. package/dist/components/trace-service/console-trace-sink.d.ts +9 -0
  491. package/dist/components/trace-service/console-trace-sink.d.ts.map +1 -0
  492. package/dist/components/trace-service/console-trace-sink.js +35 -0
  493. package/dist/components/trace-service/console-trace-sink.js.map +1 -0
  494. package/dist/components/trace-service/trace-service.d.ts +25 -0
  495. package/dist/components/trace-service/trace-service.d.ts.map +1 -0
  496. package/dist/components/trace-service/trace-service.js +288 -0
  497. package/dist/components/trace-service/trace-service.js.map +1 -0
  498. package/dist/components/trace-service/types/sink.d.ts +7 -0
  499. package/dist/components/trace-service/types/sink.d.ts.map +1 -0
  500. package/dist/components/trace-service/types/sink.js +5 -0
  501. package/dist/components/trace-service/types/sink.js.map +1 -0
  502. package/dist/components/trace-service/types/span.d.ts +31 -0
  503. package/dist/components/trace-service/types/span.d.ts.map +1 -0
  504. package/dist/components/trace-service/types/span.js +5 -0
  505. package/dist/components/trace-service/types/span.js.map +1 -0
  506. package/dist/create-agent.d.ts +5 -0
  507. package/dist/create-agent.d.ts.map +1 -0
  508. package/dist/create-agent.js +57 -0
  509. package/dist/create-agent.js.map +1 -0
  510. package/dist/index.d.ts +110 -0
  511. package/dist/index.d.ts.map +1 -0
  512. package/dist/index.js +73 -0
  513. package/dist/index.js.map +1 -0
  514. package/dist/kernel/errors/artifact-error.d.ts +23 -0
  515. package/dist/kernel/errors/artifact-error.d.ts.map +1 -0
  516. package/dist/kernel/errors/artifact-error.js +22 -0
  517. package/dist/kernel/errors/artifact-error.js.map +1 -0
  518. package/dist/kernel/errors/model-error.d.ts +7 -0
  519. package/dist/kernel/errors/model-error.d.ts.map +1 -0
  520. package/dist/kernel/errors/model-error.js +10 -0
  521. package/dist/kernel/errors/model-error.js.map +1 -0
  522. package/dist/kernel/errors/policy-error.d.ts +8 -0
  523. package/dist/kernel/errors/policy-error.d.ts.map +1 -0
  524. package/dist/kernel/errors/policy-error.js +12 -0
  525. package/dist/kernel/errors/policy-error.js.map +1 -0
  526. package/dist/kernel/errors/sandbox-error.d.ts +35 -0
  527. package/dist/kernel/errors/sandbox-error.d.ts.map +1 -0
  528. package/dist/kernel/errors/sandbox-error.js +26 -0
  529. package/dist/kernel/errors/sandbox-error.js.map +1 -0
  530. package/dist/kernel/errors/sdk-error.d.ts +9 -0
  531. package/dist/kernel/errors/sdk-error.d.ts.map +1 -0
  532. package/dist/kernel/errors/sdk-error.js +13 -0
  533. package/dist/kernel/errors/sdk-error.js.map +1 -0
  534. package/dist/kernel/errors/session-error.d.ts +7 -0
  535. package/dist/kernel/errors/session-error.d.ts.map +1 -0
  536. package/dist/kernel/errors/session-error.js +10 -0
  537. package/dist/kernel/errors/session-error.js.map +1 -0
  538. package/dist/kernel/errors/skill-error.d.ts +14 -0
  539. package/dist/kernel/errors/skill-error.d.ts.map +1 -0
  540. package/dist/kernel/errors/skill-error.js +12 -0
  541. package/dist/kernel/errors/skill-error.js.map +1 -0
  542. package/dist/kernel/errors/tool-error.d.ts +8 -0
  543. package/dist/kernel/errors/tool-error.d.ts.map +1 -0
  544. package/dist/kernel/errors/tool-error.js +12 -0
  545. package/dist/kernel/errors/tool-error.js.map +1 -0
  546. package/dist/kernel/interfaces/kernel.d.ts +23 -0
  547. package/dist/kernel/interfaces/kernel.d.ts.map +1 -0
  548. package/dist/kernel/interfaces/kernel.js +2 -0
  549. package/dist/kernel/interfaces/kernel.js.map +1 -0
  550. package/dist/kernel/interfaces/plugin.d.ts +7 -0
  551. package/dist/kernel/interfaces/plugin.d.ts.map +1 -0
  552. package/dist/kernel/interfaces/plugin.js +5 -0
  553. package/dist/kernel/interfaces/plugin.js.map +1 -0
  554. package/dist/kernel/types.d.ts +103 -0
  555. package/dist/kernel/types.d.ts.map +1 -0
  556. package/dist/kernel/types.js +2 -0
  557. package/dist/kernel/types.js.map +1 -0
  558. package/dist/testing/in-memory-sandbox.d.ts +66 -0
  559. package/dist/testing/in-memory-sandbox.d.ts.map +1 -0
  560. package/dist/testing/in-memory-sandbox.js +507 -0
  561. package/dist/testing/in-memory-sandbox.js.map +1 -0
  562. package/dist/testing/mock-llm-model-provider.d.ts +14 -0
  563. package/dist/testing/mock-llm-model-provider.d.ts.map +1 -0
  564. package/dist/testing/mock-llm-model-provider.js +30 -0
  565. package/dist/testing/mock-llm-model-provider.js.map +1 -0
  566. package/dist/testing/mock-session-store.d.ts +17 -0
  567. package/dist/testing/mock-session-store.d.ts.map +1 -0
  568. package/dist/testing/mock-session-store.js +49 -0
  569. package/dist/testing/mock-session-store.js.map +1 -0
  570. package/dist/testing/mock-tools.d.ts +38 -0
  571. package/dist/testing/mock-tools.d.ts.map +1 -0
  572. package/dist/testing/mock-tools.js +130 -0
  573. package/dist/testing/mock-tools.js.map +1 -0
  574. package/package.json +55 -0
@@ -0,0 +1,508 @@
1
+ import { spawn, spawnSync } from "node:child_process";
2
+ import { createHash } from "node:crypto";
3
+ import { promises as fs } from "node:fs";
4
+ import * as path from "node:path";
5
+ import { posix } from "node:path";
6
+ import { SandboxError } from "../../../kernel/errors/sandbox-error.js";
7
+ import { agentLayout, AGENTS_DIR, isWithinRoots, resolveLogicalPath, WORKSPACE_ROOT } from "../logical-path.js";
8
+ // ---------------------------------------------------------------------------
9
+ // Host sandbox — a real folder on the server machine, Claude Code-style.
10
+ //
11
+ // logical /workspace/... → <base>/... (base = <root>/<agentId> for own,
12
+ // <root>/.shared for the shared one)
13
+ //
14
+ // NOT isolated: file operations are confined to the agent's roots (logical checks
15
+ // plus a real-path check after symlinks), but commands run as the server's user
16
+ // with full access to the machine. That is why traits.isolated is false — the
17
+ // approval policy then asks the user before writes and commands.
18
+ // ---------------------------------------------------------------------------
19
+ const SEARCH_MAX_FILE_BYTES = 8 * 1024 * 1024;
20
+ const SEARCH_TIME_BUDGET_MS = 30_000;
21
+ /** Folders search never descends into — huge and never what the model is looking for. */
22
+ const SEARCH_SKIP_DIRS = new Set([".git", "node_modules"]);
23
+ /** Whole-file reads above this fail — readFile hashes the whole file. */
24
+ const MAX_FILE_BYTES = 64 * 1024 * 1024;
25
+ const WINDOWS = process.platform === "win32";
26
+ /** Server variables a command gets besides the ones it asks for — just enough for programs to start. */
27
+ const PASSTHROUGH_ENV = WINDOWS
28
+ ? ["SystemRoot", "windir", "ComSpec", "PATHEXT", "PATH", "Path", "TEMP", "TMP", "USERPROFILE", "APPDATA", "LOCALAPPDATA", "ProgramFiles", "ProgramData", "NUMBER_OF_PROCESSORS", "PROCESSOR_ARCHITECTURE"]
29
+ : ["PATH", "HOME", "LANG", "TMPDIR", "USER", "SHELL"];
30
+ const ALL_CAPABILITIES = ["fs.read", "fs.write", "fs.search", "exec", "exec.shell"];
31
+ const sha256 = (data) => createHash("sha256").update(data).digest("hex");
32
+ const byteLength = (text) => Buffer.byteLength(text, "utf8");
33
+ function sliceBytes(text, maxBytes) {
34
+ const buf = Buffer.from(text, "utf8");
35
+ return buf.length <= maxBytes ? text : buf.subarray(0, maxBytes).toString("utf8");
36
+ }
37
+ function clamp(value, fallback, max) {
38
+ if (typeof value !== "number" || !Number.isFinite(value) || value <= 0)
39
+ return Math.min(fallback, max);
40
+ return Math.min(Math.floor(value), max);
41
+ }
42
+ function globToRegExp(glob) {
43
+ const escaped = glob.replace(/[.+^${}()|[\]\\]/g, "\\$&").replace(/\*/g, ".*").replace(/\?/g, ".");
44
+ return new RegExp(`^${escaped}$`, WINDOWS ? "i" : "");
45
+ }
46
+ function entryType(st) {
47
+ if (st.isSymbolicLink())
48
+ return "symlink";
49
+ if (st.isDirectory())
50
+ return "directory";
51
+ if (st.isFile())
52
+ return "file";
53
+ return "other";
54
+ }
55
+ /** Host paths compare case-insensitively on Windows. */
56
+ function hostWithin(child, parent) {
57
+ const c = WINDOWS ? child.toLowerCase() : child;
58
+ const p = WINDOWS ? parent.toLowerCase() : parent;
59
+ return c === p || c.startsWith(p.endsWith(path.sep) ? p : p + path.sep);
60
+ }
61
+ function fsError(error, label, sandboxId) {
62
+ if (error instanceof SandboxError)
63
+ return error;
64
+ const code = error?.code;
65
+ const map = {
66
+ ENOENT: ["not_found", "does not exist"],
67
+ ENOTDIR: ["invalid_path", "a parent is not a directory"],
68
+ EISDIR: ["invalid_path", "is a directory"],
69
+ ELOOP: ["invalid_path", "too many symlinks"],
70
+ ENAMETOOLONG: ["invalid_path", "name too long"],
71
+ EACCES: ["policy_denied", "permission denied"],
72
+ EPERM: ["policy_denied", "permission denied"],
73
+ EROFS: ["policy_denied", "read-only file system"],
74
+ ENOSPC: ["too_large", "no space left on the disk"],
75
+ };
76
+ const hit = code ? map[code] : undefined;
77
+ if (hit)
78
+ return new SandboxError(`"${label}" ${hit[1]}`, hit[0], sandboxId);
79
+ const message = error instanceof Error ? error.message : String(error);
80
+ return new SandboxError(`"${label}": ${message}`, "environment_unavailable", sandboxId);
81
+ }
82
+ /** Kill a command and everything it started. */
83
+ function killTree(child) {
84
+ if (child.pid === undefined || child.exitCode !== null)
85
+ return;
86
+ try {
87
+ if (WINDOWS)
88
+ spawnSync("taskkill", ["/pid", String(child.pid), "/T", "/F"], { windowsHide: true });
89
+ else
90
+ process.kill(-child.pid, "SIGKILL");
91
+ }
92
+ catch {
93
+ child.kill("SIGKILL");
94
+ }
95
+ }
96
+ export class HostSandbox {
97
+ id;
98
+ traits;
99
+ limits;
100
+ base;
101
+ capabilities = new Set(ALL_CAPABILITIES);
102
+ disposed = false;
103
+ constructor(id, traits, limits,
104
+ /** Host folder that logical /workspace maps to. */
105
+ base) {
106
+ this.id = id;
107
+ this.traits = traits;
108
+ this.limits = limits;
109
+ this.base = base;
110
+ }
111
+ /** Logical path (already checked against roots) → host path. */
112
+ toHost(logical) {
113
+ const rel = posix.relative(WORKSPACE_ROOT, logical);
114
+ return rel ? path.join(this.base, ...rel.split("/")) : this.base;
115
+ }
116
+ async forAgent(agentId) {
117
+ if (this.disposed)
118
+ throw new SandboxError(`Sandbox "${this.id}" was disposed`, "environment_unavailable", this.id);
119
+ const { workingDir, roots } = agentLayout(this.traits.tenancy, agentId);
120
+ try {
121
+ await fs.mkdir(this.toHost(workingDir), { recursive: true });
122
+ }
123
+ catch (error) {
124
+ throw fsError(error, workingDir, this.id);
125
+ }
126
+ return new HostSandboxView(this, workingDir, roots);
127
+ }
128
+ async health() {
129
+ if (this.disposed)
130
+ return "unavailable";
131
+ return fs.stat(this.base).then((st) => (st.isDirectory() ? "ready" : "unavailable"), () => "unavailable");
132
+ }
133
+ async removeAgentData(agentId) {
134
+ await fs.rm(this.toHost(`${AGENTS_DIR}/${agentId}`), { recursive: true, force: true });
135
+ }
136
+ async dispose(opts) {
137
+ this.disposed = true;
138
+ if (opts?.removeData)
139
+ await fs.rm(this.base, { recursive: true, force: true });
140
+ }
141
+ }
142
+ class HostSandboxView {
143
+ managed;
144
+ workingDir;
145
+ roots;
146
+ id;
147
+ traits;
148
+ capabilities;
149
+ limits;
150
+ constructor(managed, workingDir, roots) {
151
+ this.managed = managed;
152
+ this.workingDir = workingDir;
153
+ this.roots = roots;
154
+ this.id = managed.id;
155
+ this.traits = managed.traits;
156
+ this.capabilities = managed.capabilities;
157
+ this.limits = managed.limits;
158
+ }
159
+ // ── Guards ──
160
+ fail(message, code) {
161
+ throw new SandboxError(message, code, this.id);
162
+ }
163
+ begin(capability, opts) {
164
+ if (this.managed.disposed)
165
+ this.fail(`Sandbox "${this.id}" was disposed`, "environment_unavailable");
166
+ if (!this.capabilities.has(capability))
167
+ this.fail(`This sandbox does not support ${capability}`, "capability_unsupported");
168
+ if (opts?.signal?.aborted)
169
+ this.fail("Operation cancelled", "cancelled");
170
+ }
171
+ /**
172
+ * Logical path → { logical, host }. Checked twice: the logical path against the roots,
173
+ * then the REAL host location (after symlinks, through missing tails) against the
174
+ * real host folders of those roots.
175
+ */
176
+ async resolve(input) {
177
+ const logical = resolveLogicalPath(input, this.workingDir, this.roots, this.id);
178
+ const host = this.managed.toHost(logical);
179
+ const real = await realPathThroughMissing(host);
180
+ const allowed = await Promise.all(this.roots.map((root) => realPathThroughMissing(this.managed.toHost(root))));
181
+ if (!allowed.some((root) => hostWithin(real, root))) {
182
+ this.fail(`"${input}" resolves through a symlink to a location outside the workspace`, "path_escape");
183
+ }
184
+ return { logical, host: real };
185
+ }
186
+ /** Host path (inside the base) → logical path, for listing and search results. */
187
+ toLogical(host, fallback) {
188
+ const rel = path.relative(this.managed.base, host);
189
+ if (rel.startsWith("..") || path.isAbsolute(rel))
190
+ return fallback;
191
+ const logical = rel ? posix.join(WORKSPACE_ROOT, ...rel.split(path.sep)) : WORKSPACE_ROOT;
192
+ return isWithinRoots(logical, this.roots) ? logical : fallback;
193
+ }
194
+ // ── Files ──
195
+ async readFile(input, opts) {
196
+ this.begin("fs.read", opts);
197
+ const { logical, host } = await this.resolve(input);
198
+ let st;
199
+ try {
200
+ st = await fs.stat(host);
201
+ }
202
+ catch (error) {
203
+ throw fsError(error, input, this.id);
204
+ }
205
+ if (!st.isFile())
206
+ this.fail(`"${input}" is a ${entryType(st)}, not a file`, "invalid_path");
207
+ if (st.size > MAX_FILE_BYTES)
208
+ this.fail(`"${input}" is ${st.size} bytes — too large to read`, "too_large");
209
+ const raw = await fs.readFile(host).catch((error) => { throw fsError(error, input, this.id); });
210
+ const whole = raw.toString("utf8");
211
+ let content = whole;
212
+ let truncated = false;
213
+ if (opts?.startLine !== undefined || opts?.endLine !== undefined) {
214
+ const lines = content.split("\n");
215
+ const start = Math.max(1, opts.startLine ?? 1);
216
+ const end = Math.min(lines.length, opts.endLine ?? lines.length);
217
+ content = lines.slice(start - 1, end).join("\n");
218
+ truncated = start > 1 || end < lines.length;
219
+ }
220
+ const maxBytes = clamp(opts?.maxBytes, this.limits.maxReadBytes, this.limits.maxReadBytes);
221
+ if (byteLength(content) > maxBytes) {
222
+ content = sliceBytes(content, maxBytes);
223
+ truncated = true;
224
+ }
225
+ return { path: logical, content, size: raw.length, truncated, sha256: sha256(raw) };
226
+ }
227
+ async writeFile(input, content, opts) {
228
+ this.begin("fs.write", opts);
229
+ if (typeof content !== "string")
230
+ this.fail("Content must be a string", "invalid_argument");
231
+ const bytes = byteLength(content);
232
+ if (bytes > this.limits.maxWriteBytes) {
233
+ this.fail(`Content is ${bytes} bytes (limit ${this.limits.maxWriteBytes})`, "too_large");
234
+ }
235
+ const { logical, host } = await this.resolve(input);
236
+ const existing = await fs.lstat(host).catch(() => null);
237
+ if (existing && !existing.isFile())
238
+ this.fail(`"${input}" is a ${entryType(existing)}`, "invalid_path");
239
+ if (opts?.expectedSha256 !== undefined) {
240
+ const current = existing ? sha256(await fs.readFile(host)) : null;
241
+ if (current !== opts.expectedSha256)
242
+ this.fail(`"${input}" changed since it was read (hash mismatch)`, "conflict");
243
+ }
244
+ const parent = path.dirname(host);
245
+ const parentStat = await fs.stat(parent).catch(() => null);
246
+ if (!parentStat) {
247
+ if (opts?.createDirs === false)
248
+ this.fail(`Directory "${posix.dirname(logical)}" does not exist`, "not_found");
249
+ await fs.mkdir(parent, { recursive: true }).catch((error) => { throw fsError(error, input, this.id); });
250
+ }
251
+ else if (!parentStat.isDirectory()) {
252
+ this.fail(`"${posix.dirname(logical)}" is not a directory`, "invalid_path");
253
+ }
254
+ await fs.writeFile(host, content, "utf8").catch((error) => { throw fsError(error, input, this.id); });
255
+ return { path: logical, bytes, sha256: sha256(content), created: !existing };
256
+ }
257
+ async stat(input, opts) {
258
+ this.begin("fs.read", opts);
259
+ const { logical, host } = await this.resolve(input);
260
+ const st = await fs.stat(host).catch(() => null);
261
+ if (!st)
262
+ return null;
263
+ return { path: logical, type: entryType(st), size: st.isFile() ? st.size : 0, modifiedAt: st.mtimeMs };
264
+ }
265
+ async list(input, opts) {
266
+ this.begin("fs.read", opts);
267
+ const { logical, host } = await this.resolve(input);
268
+ const st = await fs.stat(host).catch((error) => { throw fsError(error, input, this.id); });
269
+ if (!st.isDirectory())
270
+ this.fail(`"${input}" is not a directory`, "invalid_path");
271
+ const max = clamp(opts?.maxEntries, this.limits.maxListEntries, this.limits.maxListEntries);
272
+ const entries = [];
273
+ let truncated = false;
274
+ const walk = async (dirHost, dirLogical) => {
275
+ const children = (await fs.readdir(dirHost, { withFileTypes: true }).catch(() => []))
276
+ .sort((a, b) => a.name.localeCompare(b.name));
277
+ for (const child of children) {
278
+ if (!opts?.includeHidden && child.name.startsWith("."))
279
+ continue;
280
+ if (entries.length >= max) {
281
+ truncated = true;
282
+ return;
283
+ }
284
+ const childHost = path.join(dirHost, child.name);
285
+ const childLogical = posix.join(dirLogical, child.name);
286
+ const type = entryType(child);
287
+ const size = type === "file" ? (await fs.lstat(childHost).catch(() => null))?.size ?? 0 : 0;
288
+ entries.push({ path: childLogical, name: child.name, type, size });
289
+ // Symlinks are listed, never followed.
290
+ if (opts?.recursive && type === "directory")
291
+ await walk(childHost, childLogical);
292
+ if (truncated)
293
+ return;
294
+ }
295
+ };
296
+ await walk(host, logical);
297
+ return { entries, truncated };
298
+ }
299
+ async search(query, opts) {
300
+ this.begin("fs.search", opts);
301
+ if (typeof query.pattern !== "string" || query.pattern === "")
302
+ this.fail("Search pattern must be a non-empty string", "invalid_argument");
303
+ const { logical: baseLogical, host: baseHost } = await this.resolve(query.path ?? this.workingDir);
304
+ const max = clamp(query.maxMatches, this.limits.maxSearchMatches, this.limits.maxSearchMatches);
305
+ let matcher;
306
+ if (query.literal === false) {
307
+ let re;
308
+ try {
309
+ re = new RegExp(query.pattern, query.caseSensitive === false ? "i" : "");
310
+ }
311
+ catch (error) {
312
+ this.fail(`Invalid regular expression: ${error instanceof Error ? error.message : String(error)}`, "invalid_argument");
313
+ }
314
+ matcher = (line) => re.test(line);
315
+ }
316
+ else {
317
+ const needle = query.caseSensitive === false ? query.pattern.toLowerCase() : query.pattern;
318
+ matcher = (line) => (query.caseSensitive === false ? line.toLowerCase() : line).includes(needle);
319
+ }
320
+ const nameFilter = query.glob ? globToRegExp(query.glob) : null;
321
+ const deadline = Date.now() + SEARCH_TIME_BUDGET_MS;
322
+ const matches = [];
323
+ const scanFile = async (fileHost, fileLogical) => {
324
+ if (nameFilter && !nameFilter.test(path.basename(fileHost)))
325
+ return false;
326
+ const st = await fs.stat(fileHost).catch(() => null);
327
+ if (!st || !st.isFile() || st.size > SEARCH_MAX_FILE_BYTES)
328
+ return false;
329
+ const raw = await fs.readFile(fileHost).catch(() => null);
330
+ if (!raw || raw.includes(0))
331
+ return false; // unreadable or binary
332
+ const lines = raw.toString("utf8").split("\n");
333
+ for (let i = 0; i < lines.length; i++) {
334
+ if (!matcher(lines[i]))
335
+ continue;
336
+ if (matches.length >= max)
337
+ return true;
338
+ matches.push({ path: fileLogical, line: i + 1, text: lines[i] });
339
+ }
340
+ return false;
341
+ };
342
+ const walk = async (dirHost, dirLogical) => {
343
+ const children = (await fs.readdir(dirHost, { withFileTypes: true }).catch(() => []))
344
+ .sort((a, b) => a.name.localeCompare(b.name));
345
+ for (const child of children) {
346
+ if (opts?.signal?.aborted)
347
+ this.fail("Operation cancelled", "cancelled");
348
+ if (Date.now() > deadline)
349
+ return true;
350
+ const childHost = path.join(dirHost, child.name);
351
+ const childLogical = posix.join(dirLogical, child.name);
352
+ // Symlinks are never followed (they could lead outside the roots).
353
+ if (child.isDirectory()) {
354
+ if (!SEARCH_SKIP_DIRS.has(child.name) && (await walk(childHost, childLogical)))
355
+ return true;
356
+ }
357
+ else if (child.isFile() && (await scanFile(childHost, childLogical))) {
358
+ return true;
359
+ }
360
+ }
361
+ return false;
362
+ };
363
+ const baseStat = await fs.stat(baseHost).catch((error) => { throw fsError(error, query.path ?? ".", this.id); });
364
+ const truncated = baseStat.isDirectory()
365
+ ? await walk(baseHost, baseLogical)
366
+ : await scanFile(baseHost, this.toLogical(baseHost, baseLogical));
367
+ return { matches, truncated };
368
+ }
369
+ // ── Commands ──
370
+ async exec(request, opts) {
371
+ if (this.managed.disposed)
372
+ this.fail(`Sandbox "${this.id}" was disposed`, "environment_unavailable");
373
+ if (!this.capabilities.has("exec"))
374
+ this.fail("This sandbox does not support exec", "capability_unsupported");
375
+ if (request.shell && !this.capabilities.has("exec.shell"))
376
+ this.fail("This sandbox does not support shell commands", "capability_unsupported");
377
+ if (!Array.isArray(request.command) || request.command.length === 0 || typeof request.command[0] !== "string") {
378
+ this.fail("command must be a non-empty argv array", "invalid_argument");
379
+ }
380
+ if (!(request.timeoutMs > 0) || !(request.maxOutputBytes > 0)) {
381
+ this.fail("timeoutMs and maxOutputBytes must be positive", "invalid_argument");
382
+ }
383
+ const { host: cwd } = await this.resolve(request.cwd ?? this.workingDir);
384
+ const cwdStat = await fs.stat(cwd).catch(() => null);
385
+ if (!cwdStat)
386
+ this.fail(`Working directory "${request.cwd}" does not exist`, "not_found");
387
+ if (!cwdStat.isDirectory())
388
+ this.fail(`"${request.cwd}" is not a directory`, "invalid_path");
389
+ const env = {};
390
+ for (const key of PASSTHROUGH_ENV) {
391
+ const value = process.env[key];
392
+ if (value !== undefined)
393
+ env[key] = value;
394
+ }
395
+ Object.assign(env, request.env);
396
+ const timeoutMs = Math.min(request.timeoutMs, this.limits.maxExecTimeoutMs);
397
+ const maxOutput = Math.min(request.maxOutputBytes, this.limits.maxExecOutputBytes);
398
+ const started = Date.now();
399
+ const result = {
400
+ exitCode: null, stdout: "", stderr: "", truncated: false, timedOut: false, cancelled: false, durationMs: 0,
401
+ };
402
+ const [program, ...args] = request.command;
403
+ let child;
404
+ try {
405
+ child = request.shell
406
+ ? spawn(request.command.join(" "), { cwd, env, shell: true, windowsHide: true, detached: !WINDOWS })
407
+ : spawn(program, args, { cwd, env, shell: false, windowsHide: true, detached: !WINDOWS });
408
+ }
409
+ catch (error) {
410
+ this.fail(`Could not start "${program}": ${error instanceof Error ? error.message : String(error)}`, "invalid_argument");
411
+ }
412
+ let killed = false;
413
+ const stop = () => {
414
+ if (killed)
415
+ return;
416
+ killed = true;
417
+ killTree(child);
418
+ };
419
+ const timer = setTimeout(() => {
420
+ result.timedOut = true;
421
+ stop();
422
+ }, timeoutMs);
423
+ const onAbort = () => {
424
+ result.cancelled = true;
425
+ stop();
426
+ };
427
+ if (opts?.signal?.aborted)
428
+ onAbort();
429
+ else
430
+ opts?.signal?.addEventListener("abort", onAbort, { once: true });
431
+ let written = 0;
432
+ const out = (stream) => (data) => {
433
+ if (killed)
434
+ return;
435
+ const text = data.toString("utf8");
436
+ const room = maxOutput - written;
437
+ const piece = byteLength(text) > room ? sliceBytes(text, room) : text;
438
+ written += byteLength(piece);
439
+ result[stream] += piece;
440
+ if (piece)
441
+ opts?.onOutput?.({ stream, data: piece });
442
+ if (piece !== text) {
443
+ result.truncated = true;
444
+ stop();
445
+ }
446
+ };
447
+ child.stdout?.on("data", out("stdout"));
448
+ child.stderr?.on("data", out("stderr"));
449
+ child.stdin?.on("error", () => { });
450
+ child.stdin?.end(request.stdin ?? "");
451
+ try {
452
+ const code = await new Promise((resolve, reject) => {
453
+ child.once("error", reject);
454
+ child.once("close", (exitCode) => resolve(exitCode));
455
+ });
456
+ if (!killed)
457
+ result.exitCode = code;
458
+ }
459
+ catch (error) {
460
+ const code = error.code;
461
+ if (code === "ENOENT") {
462
+ // Like a shell: an unknown program is exit 127, not an exception.
463
+ result.stderr += `${program}: command not found\n`;
464
+ result.exitCode = 127;
465
+ }
466
+ else {
467
+ this.fail(`Could not start "${program}": ${error instanceof Error ? error.message : String(error)}`, "environment_unavailable");
468
+ }
469
+ }
470
+ finally {
471
+ clearTimeout(timer);
472
+ opts?.signal?.removeEventListener("abort", onAbort);
473
+ }
474
+ result.durationMs = Date.now() - started;
475
+ return result;
476
+ }
477
+ }
478
+ /**
479
+ * realpath() that also works for paths that do not exist yet: resolve the deepest
480
+ * existing ancestor, then append the missing tail — so a write through a symlinked
481
+ * parent is checked where it would really land.
482
+ */
483
+ async function realPathThroughMissing(target) {
484
+ const tail = [];
485
+ let current = path.resolve(target);
486
+ let hops = 0;
487
+ for (;;) {
488
+ try {
489
+ const real = await fs.realpath(current);
490
+ return tail.length ? path.join(real, ...tail.reverse()) : real;
491
+ }
492
+ catch {
493
+ // A dangling symlink: follow it to where a write would really land.
494
+ const link = await fs.lstat(current).catch(() => null);
495
+ if (link?.isSymbolicLink() && ++hops <= 40) {
496
+ const to = await fs.readlink(current);
497
+ current = path.resolve(path.dirname(current), to);
498
+ continue;
499
+ }
500
+ const parent = path.dirname(current);
501
+ if (parent === current)
502
+ return path.resolve(target);
503
+ tail.push(path.basename(current));
504
+ current = parent;
505
+ }
506
+ }
507
+ }
508
+ //# sourceMappingURL=host-sandbox.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"host-sandbox.js","sourceRoot":"","sources":["../../../../src/components/sandbox-hub/host/host-sandbox.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAEtD,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,QAAQ,IAAI,EAAE,EAAE,MAAM,SAAS,CAAC;AAEzC,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,YAAY,EAAE,MAAM,yCAAyC,CAAC;AAEvE,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,aAAa,EAAE,kBAAkB,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAwBhH,8EAA8E;AAC9E,yEAAyE;AACzE,EAAE;AACF,8EAA8E;AAC9E,gFAAgF;AAChF,EAAE;AACF,kFAAkF;AAClF,gFAAgF;AAChF,8EAA8E;AAC9E,iEAAiE;AACjE,8EAA8E;AAE9E,MAAM,qBAAqB,GAAG,CAAC,GAAG,IAAI,GAAG,IAAI,CAAC;AAC9C,MAAM,qBAAqB,GAAG,MAAM,CAAC;AACrC,yFAAyF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AAC,OAAO,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;QACjE,CAAC;QAAC,MAAM,CAAC;YACP,oEAAoE;YACpE,MAAM,IAAI,GAAG,MAAM,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,CAAC;YACvD,IAAI,IAAI,EAAE,cAAc,EAAE,IAAI,EAAE,IAAI,IAAI,EAAE,EAAE,CAAC;gBAC3C,MAAM,EAAE,GAAG,MAAM,EAAE,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;gBACtC,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,EAAE,CAAC,CAAC;gBAClD,SAAS;YACX,CAAC;YACD,MAAM,MAAM,GAAG,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;YACrC,IAAI,MAAM,KAAK,OAAO;gBAAE,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;YACpD,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC;YAClC,OAAO,GAAG,MAAM,CAAC;QACnB,CAAC;IACH,CAAC;AACH,CAAC"}
@@ -0,0 +1,28 @@
1
+ import type { SandboxTraits } from "./types/sandbox.js";
2
+ export declare const WORKSPACE_ROOT = "/workspace";
3
+ export declare const AGENTS_DIR = "/workspace/agents";
4
+ /** Agent ids become folder names — only plain identifiers are accepted. */
5
+ export declare function assertSafeAgentId(agentId: string): void;
6
+ /**
7
+ * Default layout for an agent's view of a sandbox:
8
+ * - shared tenancy: works in /workspace/agents/<id>, may also use /workspace/shared
9
+ * (other agents' folders are off-limits to file operations — accident prevention,
10
+ * not a security boundary: exec in a shared container can still reach them)
11
+ * - own tenancy: the whole /workspace belongs to the agent
12
+ */
13
+ export declare function agentLayout(tenancy: SandboxTraits["tenancy"], agentId: string): {
14
+ workingDir: string;
15
+ roots: string[];
16
+ };
17
+ export declare function isWithinRoots(path: string, roots: readonly string[]): boolean;
18
+ /**
19
+ * Validator to make sure tool execute in a right place,
20
+ * in somecase tool may execute with wrong sandbox path, this validator will help to prevent that
21
+ * @param input
22
+ * @param workingDir
23
+ * @param roots
24
+ * @param sandboxId
25
+ * @returns
26
+ */
27
+ export declare function resolveLogicalPath(input: string, workingDir: string, roots: readonly string[], sandboxId?: string): string;
28
+ //# sourceMappingURL=logical-path.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logical-path.d.ts","sourceRoot":"","sources":["../../../src/components/sandbox-hub/logical-path.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAcxD,eAAO,MAAM,cAAc,eAAe,CAAC;AAG3C,eAAO,MAAM,UAAU,sBAA6B,CAAC;AAIrD,2EAA2E;AAC3E,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAIvD;AAED;;;;;;GAMG;AACH,wBAAgB,WAAW,CACzB,OAAO,EAAE,aAAa,CAAC,SAAS,CAAC,EACjC,OAAO,EAAE,MAAM,GACd;IAAE,UAAU,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,EAAE,CAAA;CAAE,CAMzC;AAED,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,MAAM,EAAE,GAAG,OAAO,CAE7E;AAED;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,CAChC,KAAK,EAAE,MAAM,EACb,UAAU,EAAE,MAAM,EAClB,KAAK,EAAE,SAAS,MAAM,EAAE,EACxB,SAAS,CAAC,EAAE,MAAM,GACjB,MAAM,CA6BR"}
@@ -0,0 +1,73 @@
1
+ import { posix } from "node:path";
2
+ import { SandboxError } from "../../kernel/errors/sandbox-error.js";
3
+ // ---------------------------------------------------------------------------
4
+ // Logical paths — the POSIX paths tools use inside every sandbox.
5
+ //
6
+ // /workspace/
7
+ // shared/ ← every agent of the shared sandbox (collaboration space)
8
+ // agents/<agentId>/ ← one agent's default working directory
9
+ //
10
+ // Providers resolve every incoming path through resolveLogicalPath() before
11
+ // mapping it to real storage, then re-check the REAL location (after symlinks)
12
+ // with isWithinRoots() — both layers are needed to stop escapes.
13
+ // ---------------------------------------------------------------------------
14
+ export const WORKSPACE_ROOT = "/workspace";
15
+ //will skip it for now, each agent has it own folder is enough
16
+ // export const SHARED_DIR = `${WORKSPACE_ROOT}/shared`;
17
+ export const AGENTS_DIR = `${WORKSPACE_ROOT}/agents`;
18
+ const SAFE_AGENT_ID = /^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$/;
19
+ /** Agent ids become folder names — only plain identifiers are accepted. */
20
+ export function assertSafeAgentId(agentId) {
21
+ if (!SAFE_AGENT_ID.test(agentId) || agentId.includes("..")) {
22
+ throw new SandboxError(`Agent id "${agentId}" cannot be used as a sandbox folder name`, "policy_denied");
23
+ }
24
+ }
25
+ /**
26
+ * Default layout for an agent's view of a sandbox:
27
+ * - shared tenancy: works in /workspace/agents/<id>, may also use /workspace/shared
28
+ * (other agents' folders are off-limits to file operations — accident prevention,
29
+ * not a security boundary: exec in a shared container can still reach them)
30
+ * - own tenancy: the whole /workspace belongs to the agent
31
+ */
32
+ export function agentLayout(tenancy, agentId) {
33
+ if (tenancy === "own")
34
+ return { workingDir: WORKSPACE_ROOT, roots: [WORKSPACE_ROOT] };
35
+ assertSafeAgentId(agentId);
36
+ const own = `${AGENTS_DIR}/${agentId}`;
37
+ // return { workingDir: own, roots: [own, SHARED_DIR] };
38
+ return { workingDir: own, roots: [own] };
39
+ }
40
+ export function isWithinRoots(path, roots) {
41
+ return roots.some((root) => path === root || path.startsWith(root === "/" ? "/" : `${root}/`));
42
+ }
43
+ /**
44
+ * Validator to make sure tool execute in a right place,
45
+ * in somecase tool may execute with wrong sandbox path, this validator will help to prevent that
46
+ * @param input
47
+ * @param workingDir
48
+ * @param roots
49
+ * @param sandboxId
50
+ * @returns
51
+ */
52
+ export function resolveLogicalPath(input, workingDir, roots, sandboxId) {
53
+ if (typeof input !== "string") {
54
+ throw new SandboxError("Path must be a string", "invalid_path", sandboxId);
55
+ }
56
+ if (input.includes("\0")) {
57
+ throw new SandboxError("Path contains a NUL byte", "invalid_path", sandboxId);
58
+ }
59
+ // Windows-style separators are normalised so "src\\a.ts" means "src/a.ts".
60
+ const slashed = input.trim().replace(/\\/g, "/");
61
+ if (/^[A-Za-z]:(\/|$)/.test(slashed) || slashed.startsWith("//")) {
62
+ throw new SandboxError(`"${input}" is a host path — use a workspace path like "src/app.ts" or "${WORKSPACE_ROOT}/shared/file"`, "path_escape", sandboxId);
63
+ }
64
+ const joined = slashed === "" || slashed === "." ? workingDir : slashed.startsWith("/") ? slashed : posix.join(workingDir, slashed);
65
+ let normalized = posix.normalize(joined);
66
+ if (normalized.length > 1 && normalized.endsWith("/"))
67
+ normalized = normalized.slice(0, -1);
68
+ if (!isWithinRoots(normalized, roots)) {
69
+ throw new SandboxError(`"${input}" is outside the workspace this agent may use (${roots.join(", ")})`, "path_escape", sandboxId);
70
+ }
71
+ return normalized;
72
+ }
73
+ //# sourceMappingURL=logical-path.js.map