@moxxy/core 0.3.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 (332) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +125 -0
  3. package/dist/events/factory.d.ts +6 -0
  4. package/dist/events/factory.d.ts.map +1 -0
  5. package/dist/events/factory.js +14 -0
  6. package/dist/events/factory.js.map +1 -0
  7. package/dist/events/log.d.ts +92 -0
  8. package/dist/events/log.d.ts.map +1 -0
  9. package/dist/events/log.js +244 -0
  10. package/dist/events/log.js.map +1 -0
  11. package/dist/index.d.ts +40 -0
  12. package/dist/index.d.ts.map +1 -0
  13. package/dist/index.js +41 -0
  14. package/dist/index.js.map +1 -0
  15. package/dist/logger.d.ts +16 -0
  16. package/dist/logger.d.ts.map +1 -0
  17. package/dist/logger.js +27 -0
  18. package/dist/logger.js.map +1 -0
  19. package/dist/permissions/engine.d.ts +94 -0
  20. package/dist/permissions/engine.d.ts.map +1 -0
  21. package/dist/permissions/engine.js +203 -0
  22. package/dist/permissions/engine.js.map +1 -0
  23. package/dist/permissions/resolvers.d.ts +8 -0
  24. package/dist/permissions/resolvers.d.ts.map +1 -0
  25. package/dist/permissions/resolvers.js +8 -0
  26. package/dist/permissions/resolvers.js.map +1 -0
  27. package/dist/plugins/discovery.d.ts +9 -0
  28. package/dist/plugins/discovery.d.ts.map +1 -0
  29. package/dist/plugins/discovery.js +112 -0
  30. package/dist/plugins/discovery.js.map +1 -0
  31. package/dist/plugins/host-options.d.ts +72 -0
  32. package/dist/plugins/host-options.d.ts.map +1 -0
  33. package/dist/plugins/host-options.js +2 -0
  34. package/dist/plugins/host-options.js.map +1 -0
  35. package/dist/plugins/host.d.ts +53 -0
  36. package/dist/plugins/host.d.ts.map +1 -0
  37. package/dist/plugins/host.js +269 -0
  38. package/dist/plugins/host.js.map +1 -0
  39. package/dist/plugins/lifecycle.d.ts +31 -0
  40. package/dist/plugins/lifecycle.d.ts.map +1 -0
  41. package/dist/plugins/lifecycle.js +100 -0
  42. package/dist/plugins/lifecycle.js.map +1 -0
  43. package/dist/plugins/loader.d.ts +7 -0
  44. package/dist/plugins/loader.d.ts.map +1 -0
  45. package/dist/plugins/loader.js +68 -0
  46. package/dist/plugins/loader.js.map +1 -0
  47. package/dist/plugins/package-requirements.d.ts +16 -0
  48. package/dist/plugins/package-requirements.d.ts.map +1 -0
  49. package/dist/plugins/package-requirements.js +52 -0
  50. package/dist/plugins/package-requirements.js.map +1 -0
  51. package/dist/plugins/registry-kinds.d.ts +58 -0
  52. package/dist/plugins/registry-kinds.d.ts.map +1 -0
  53. package/dist/plugins/registry-kinds.js +139 -0
  54. package/dist/plugins/registry-kinds.js.map +1 -0
  55. package/dist/plugins/toposort.d.ts +24 -0
  56. package/dist/plugins/toposort.d.ts.map +1 -0
  57. package/dist/plugins/toposort.js +67 -0
  58. package/dist/plugins/toposort.js.map +1 -0
  59. package/dist/preferences.d.ts +40 -0
  60. package/dist/preferences.d.ts.map +1 -0
  61. package/dist/preferences.js +58 -0
  62. package/dist/preferences.js.map +1 -0
  63. package/dist/registries/active-backend-registry.d.ts +65 -0
  64. package/dist/registries/active-backend-registry.d.ts.map +1 -0
  65. package/dist/registries/active-backend-registry.js +108 -0
  66. package/dist/registries/active-backend-registry.js.map +1 -0
  67. package/dist/registries/active-def-registry.d.ts +59 -0
  68. package/dist/registries/active-def-registry.d.ts.map +1 -0
  69. package/dist/registries/active-def-registry.js +63 -0
  70. package/dist/registries/active-def-registry.js.map +1 -0
  71. package/dist/registries/agents.d.ts +16 -0
  72. package/dist/registries/agents.d.ts.map +1 -0
  73. package/dist/registries/agents.js +17 -0
  74. package/dist/registries/agents.js.map +1 -0
  75. package/dist/registries/cache-strategies.d.ts +12 -0
  76. package/dist/registries/cache-strategies.d.ts.map +1 -0
  77. package/dist/registries/cache-strategies.js +13 -0
  78. package/dist/registries/cache-strategies.js.map +1 -0
  79. package/dist/registries/channels.d.ts +16 -0
  80. package/dist/registries/channels.d.ts.map +1 -0
  81. package/dist/registries/channels.js +35 -0
  82. package/dist/registries/channels.js.map +1 -0
  83. package/dist/registries/commands.d.ts +29 -0
  84. package/dist/registries/commands.d.ts.map +1 -0
  85. package/dist/registries/commands.js +72 -0
  86. package/dist/registries/commands.js.map +1 -0
  87. package/dist/registries/compactors.d.ts +12 -0
  88. package/dist/registries/compactors.d.ts.map +1 -0
  89. package/dist/registries/compactors.js +13 -0
  90. package/dist/registries/compactors.js.map +1 -0
  91. package/dist/registries/def-map-registry.d.ts +33 -0
  92. package/dist/registries/def-map-registry.d.ts.map +1 -0
  93. package/dist/registries/def-map-registry.js +36 -0
  94. package/dist/registries/def-map-registry.js.map +1 -0
  95. package/dist/registries/embedders.d.ts +16 -0
  96. package/dist/registries/embedders.d.ts.map +1 -0
  97. package/dist/registries/embedders.js +17 -0
  98. package/dist/registries/embedders.js.map +1 -0
  99. package/dist/registries/isolators.d.ts +21 -0
  100. package/dist/registries/isolators.d.ts.map +1 -0
  101. package/dist/registries/isolators.js +32 -0
  102. package/dist/registries/isolators.js.map +1 -0
  103. package/dist/registries/modes.d.ts +28 -0
  104. package/dist/registries/modes.d.ts.map +1 -0
  105. package/dist/registries/modes.js +81 -0
  106. package/dist/registries/modes.js.map +1 -0
  107. package/dist/registries/providers.d.ts +44 -0
  108. package/dist/registries/providers.d.ts.map +1 -0
  109. package/dist/registries/providers.js +95 -0
  110. package/dist/registries/providers.js.map +1 -0
  111. package/dist/registries/skills.d.ts +24 -0
  112. package/dist/registries/skills.d.ts.map +1 -0
  113. package/dist/registries/skills.js +81 -0
  114. package/dist/registries/skills.js.map +1 -0
  115. package/dist/registries/surfaces.d.ts +13 -0
  116. package/dist/registries/surfaces.d.ts.map +1 -0
  117. package/dist/registries/surfaces.js +14 -0
  118. package/dist/registries/surfaces.js.map +1 -0
  119. package/dist/registries/synthesizers.d.ts +26 -0
  120. package/dist/registries/synthesizers.d.ts.map +1 -0
  121. package/dist/registries/synthesizers.js +34 -0
  122. package/dist/registries/synthesizers.js.map +1 -0
  123. package/dist/registries/tools.d.ts +49 -0
  124. package/dist/registries/tools.d.ts.map +1 -0
  125. package/dist/registries/tools.js +98 -0
  126. package/dist/registries/tools.js.map +1 -0
  127. package/dist/registries/transcribers.d.ts +17 -0
  128. package/dist/registries/transcribers.d.ts.map +1 -0
  129. package/dist/registries/transcribers.js +18 -0
  130. package/dist/registries/transcribers.js.map +1 -0
  131. package/dist/registries/tunnel-providers.d.ts +12 -0
  132. package/dist/registries/tunnel-providers.d.ts.map +1 -0
  133. package/dist/registries/tunnel-providers.js +13 -0
  134. package/dist/registries/tunnel-providers.js.map +1 -0
  135. package/dist/registries/view-renderers.d.ts +13 -0
  136. package/dist/registries/view-renderers.d.ts.map +1 -0
  137. package/dist/registries/view-renderers.js +14 -0
  138. package/dist/registries/view-renderers.js.map +1 -0
  139. package/dist/registries/workflow-executors.d.ts +13 -0
  140. package/dist/registries/workflow-executors.d.ts.map +1 -0
  141. package/dist/registries/workflow-executors.js +14 -0
  142. package/dist/registries/workflow-executors.js.map +1 -0
  143. package/dist/requirements.d.ts +59 -0
  144. package/dist/requirements.d.ts.map +1 -0
  145. package/dist/requirements.js +149 -0
  146. package/dist/requirements.js.map +1 -0
  147. package/dist/run-turn.d.ts +6 -0
  148. package/dist/run-turn.d.ts.map +1 -0
  149. package/dist/run-turn.js +141 -0
  150. package/dist/run-turn.js.map +1 -0
  151. package/dist/session-runtime.d.ts +67 -0
  152. package/dist/session-runtime.d.ts.map +1 -0
  153. package/dist/session-runtime.js +2 -0
  154. package/dist/session-runtime.js.map +1 -0
  155. package/dist/session.d.ts +203 -0
  156. package/dist/session.d.ts.map +1 -0
  157. package/dist/session.js +399 -0
  158. package/dist/session.js.map +1 -0
  159. package/dist/sessions/persistence.d.ts +184 -0
  160. package/dist/sessions/persistence.d.ts.map +1 -0
  161. package/dist/sessions/persistence.js +442 -0
  162. package/dist/sessions/persistence.js.map +1 -0
  163. package/dist/setup-agent.d.ts +91 -0
  164. package/dist/setup-agent.d.ts.map +1 -0
  165. package/dist/setup-agent.js +138 -0
  166. package/dist/setup-agent.js.map +1 -0
  167. package/dist/skills/index.d.ts +4 -0
  168. package/dist/skills/index.d.ts.map +1 -0
  169. package/dist/skills/index.js +4 -0
  170. package/dist/skills/index.js.map +1 -0
  171. package/dist/skills/loader.d.ts +16 -0
  172. package/dist/skills/loader.d.ts.map +1 -0
  173. package/dist/skills/loader.js +99 -0
  174. package/dist/skills/loader.js.map +1 -0
  175. package/dist/skills/parse.d.ts +5 -0
  176. package/dist/skills/parse.d.ts.map +1 -0
  177. package/dist/skills/parse.js +8 -0
  178. package/dist/skills/parse.js.map +1 -0
  179. package/dist/skills/synthesize-draft.d.ts +8 -0
  180. package/dist/skills/synthesize-draft.d.ts.map +1 -0
  181. package/dist/skills/synthesize-draft.js +32 -0
  182. package/dist/skills/synthesize-draft.js.map +1 -0
  183. package/dist/skills/synthesize.d.ts +33 -0
  184. package/dist/skills/synthesize.d.ts.map +1 -0
  185. package/dist/skills/synthesize.js +241 -0
  186. package/dist/skills/synthesize.js.map +1 -0
  187. package/dist/subagents/events.d.ts +20 -0
  188. package/dist/subagents/events.d.ts.map +1 -0
  189. package/dist/subagents/events.js +146 -0
  190. package/dist/subagents/events.js.map +1 -0
  191. package/dist/subagents/registry.d.ts +40 -0
  192. package/dist/subagents/registry.d.ts.map +1 -0
  193. package/dist/subagents/registry.js +42 -0
  194. package/dist/subagents/registry.js.map +1 -0
  195. package/dist/subagents/run-child.d.ts +43 -0
  196. package/dist/subagents/run-child.d.ts.map +1 -0
  197. package/dist/subagents/run-child.js +276 -0
  198. package/dist/subagents/run-child.js.map +1 -0
  199. package/dist/subagents/spawn.d.ts +8 -0
  200. package/dist/subagents/spawn.d.ts.map +1 -0
  201. package/dist/subagents/spawn.js +8 -0
  202. package/dist/subagents/spawn.js.map +1 -0
  203. package/dist/subagents/tools.d.ts +4 -0
  204. package/dist/subagents/tools.d.ts.map +1 -0
  205. package/dist/subagents/tools.js +13 -0
  206. package/dist/subagents/tools.js.map +1 -0
  207. package/dist/subagents.d.ts +3 -0
  208. package/dist/subagents.d.ts.map +1 -0
  209. package/dist/subagents.js +3 -0
  210. package/dist/subagents.js.map +1 -0
  211. package/dist/surfaces/host.d.ts +53 -0
  212. package/dist/surfaces/host.d.ts.map +1 -0
  213. package/dist/surfaces/host.js +177 -0
  214. package/dist/surfaces/host.js.map +1 -0
  215. package/dist/tunnel/localhost.d.ts +7 -0
  216. package/dist/tunnel/localhost.d.ts.map +1 -0
  217. package/dist/tunnel/localhost.js +21 -0
  218. package/dist/tunnel/localhost.js.map +1 -0
  219. package/dist/usage-stats.d.ts +42 -0
  220. package/dist/usage-stats.d.ts.map +1 -0
  221. package/dist/usage-stats.js +83 -0
  222. package/dist/usage-stats.js.map +1 -0
  223. package/dist/view/default-renderer.d.ts +7 -0
  224. package/dist/view/default-renderer.d.ts.map +1 -0
  225. package/dist/view/default-renderer.js +14 -0
  226. package/dist/view/default-renderer.js.map +1 -0
  227. package/dist/view/parse.d.ts +7 -0
  228. package/dist/view/parse.d.ts.map +1 -0
  229. package/dist/view/parse.js +479 -0
  230. package/dist/view/parse.js.map +1 -0
  231. package/package.json +61 -0
  232. package/src/events/factory.ts +27 -0
  233. package/src/events/log.test.ts +470 -0
  234. package/src/events/log.ts +256 -0
  235. package/src/index.ts +102 -0
  236. package/src/logger.ts +46 -0
  237. package/src/permissions/engine.test.ts +206 -0
  238. package/src/permissions/engine.ts +247 -0
  239. package/src/permissions/resolvers.test.ts +40 -0
  240. package/src/permissions/resolvers.ts +17 -0
  241. package/src/plugins/discovery.test.ts +115 -0
  242. package/src/plugins/discovery.ts +124 -0
  243. package/src/plugins/host-options.ts +73 -0
  244. package/src/plugins/host-view-tunnel.test.ts +86 -0
  245. package/src/plugins/host.test.ts +434 -0
  246. package/src/plugins/host.ts +327 -0
  247. package/src/plugins/lifecycle.test.ts +187 -0
  248. package/src/plugins/lifecycle.ts +136 -0
  249. package/src/plugins/loader.ts +79 -0
  250. package/src/plugins/package-requirements.ts +50 -0
  251. package/src/plugins/registry-kinds.test.ts +162 -0
  252. package/src/plugins/registry-kinds.ts +210 -0
  253. package/src/plugins/toposort.test.ts +66 -0
  254. package/src/plugins/toposort.ts +69 -0
  255. package/src/preferences.test.ts +105 -0
  256. package/src/preferences.ts +84 -0
  257. package/src/registries/active-backend-registry.ts +142 -0
  258. package/src/registries/active-def-registry.test.ts +103 -0
  259. package/src/registries/active-def-registry.ts +97 -0
  260. package/src/registries/agents.ts +18 -0
  261. package/src/registries/cache-strategies.ts +14 -0
  262. package/src/registries/channels.ts +42 -0
  263. package/src/registries/commands.test.ts +71 -0
  264. package/src/registries/commands.ts +78 -0
  265. package/src/registries/compactors.ts +14 -0
  266. package/src/registries/def-map-registry.test.ts +67 -0
  267. package/src/registries/def-map-registry.ts +59 -0
  268. package/src/registries/embedders.test.ts +54 -0
  269. package/src/registries/embedders.ts +18 -0
  270. package/src/registries/isolators.test.ts +43 -0
  271. package/src/registries/isolators.ts +38 -0
  272. package/src/registries/modes.test.ts +66 -0
  273. package/src/registries/modes.ts +80 -0
  274. package/src/registries/providers.test.ts +50 -0
  275. package/src/registries/providers.ts +97 -0
  276. package/src/registries/semantics.test.ts +117 -0
  277. package/src/registries/skills.ts +87 -0
  278. package/src/registries/surfaces.ts +18 -0
  279. package/src/registries/synthesizers.test.ts +63 -0
  280. package/src/registries/synthesizers.ts +36 -0
  281. package/src/registries/tools.test.ts +142 -0
  282. package/src/registries/tools.ts +145 -0
  283. package/src/registries/transcribers.test.ts +70 -0
  284. package/src/registries/transcribers.ts +19 -0
  285. package/src/registries/tunnel-providers.test.ts +30 -0
  286. package/src/registries/tunnel-providers.ts +14 -0
  287. package/src/registries/view-renderers.test.ts +68 -0
  288. package/src/registries/view-renderers.ts +15 -0
  289. package/src/registries/workflow-executors.test.ts +53 -0
  290. package/src/registries/workflow-executors.ts +15 -0
  291. package/src/requirements.targetinfo.test.ts +70 -0
  292. package/src/requirements.test.ts +111 -0
  293. package/src/requirements.ts +262 -0
  294. package/src/run-turn.test.ts +178 -0
  295. package/src/run-turn.ts +156 -0
  296. package/src/session-runtime.ts +75 -0
  297. package/src/session.test.ts +216 -0
  298. package/src/session.ts +491 -0
  299. package/src/sessions/persistence.flush.test.ts +100 -0
  300. package/src/sessions/persistence.ready.test.ts +91 -0
  301. package/src/sessions/persistence.test.ts +274 -0
  302. package/src/sessions/persistence.ts +498 -0
  303. package/src/setup-agent.test.ts +72 -0
  304. package/src/setup-agent.ts +189 -0
  305. package/src/skills/index.ts +14 -0
  306. package/src/skills/loader.test.ts +102 -0
  307. package/src/skills/loader.ts +114 -0
  308. package/src/skills/parse.test.ts +59 -0
  309. package/src/skills/parse.ts +11 -0
  310. package/src/skills/synthesize-draft.test.ts +79 -0
  311. package/src/skills/synthesize-draft.ts +46 -0
  312. package/src/skills/synthesize.test.ts +170 -0
  313. package/src/skills/synthesize.ts +304 -0
  314. package/src/subagents/events.test.ts +56 -0
  315. package/src/subagents/events.ts +194 -0
  316. package/src/subagents/registry.ts +62 -0
  317. package/src/subagents/run-child.test.ts +185 -0
  318. package/src/subagents/run-child.ts +425 -0
  319. package/src/subagents/spawn.ts +12 -0
  320. package/src/subagents/tools.ts +19 -0
  321. package/src/subagents.ts +2 -0
  322. package/src/surfaces/host.test.ts +330 -0
  323. package/src/surfaces/host.ts +192 -0
  324. package/src/tunnel/localhost.test.ts +22 -0
  325. package/src/tunnel/localhost.ts +21 -0
  326. package/src/usage-stats.test.ts +77 -0
  327. package/src/usage-stats.ts +119 -0
  328. package/src/view/default-renderer.test.ts +29 -0
  329. package/src/view/default-renderer.ts +14 -0
  330. package/src/view/parse-extended.test.ts +255 -0
  331. package/src/view/parse.test.ts +232 -0
  332. package/src/view/parse.ts +520 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Moxxy (moxxy.ai)
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,125 @@
1
+ # @moxxy/core
2
+
3
+ The [moxxy](https://moxxy.ai) runtime, as a library. Construct an agentic
4
+ **Session**, register the blocks you want (providers, tools, modes, compactors,
5
+ channels, …), and run turns — embed moxxy's agent loop directly in your own code
6
+ instead of going through the CLI or desktop app.
7
+
8
+ `@moxxy/core` is the **engine + the block registries**. It ships *no* built-in
9
+ LLM provider or loop strategy — those are swappable packages you register, so
10
+ nothing is welded in.
11
+
12
+ > **Just want to run an agent fast?** Use
13
+ > [`@moxxy/agent`](https://www.npmjs.com/package/@moxxy/agent) —
14
+ > `setupAgent(openaiPreset({ apiKey }))` and you're done. This package is the
15
+ > layer underneath, for when you want full control of the blocks.
16
+
17
+ ## Install
18
+
19
+ ```bash
20
+ npm i @moxxy/core @moxxy/sdk @moxxy/mode-default @moxxy/plugin-provider-openai
21
+ ```
22
+
23
+ (`@moxxy/sdk` gives you the typed contracts + `define*` factories for authoring
24
+ your own blocks.)
25
+
26
+ ## Quick start — `setupAgent`
27
+
28
+ `setupAgent` wires a Session + your blocks in one synchronous call and hands back
29
+ a small agent you destructure:
30
+
31
+ ```ts
32
+ import { setupAgent } from '@moxxy/core';
33
+ import defaultMode from '@moxxy/mode-default';
34
+ import openai from '@moxxy/plugin-provider-openai';
35
+
36
+ const { ask, stream, session } = setupAgent({
37
+ plugins: [defaultMode, openai],
38
+ provider: { name: 'openai', config: { apiKey: process.env.OPENAI_API_KEY } },
39
+ });
40
+
41
+ // `ask` → the final reply text (async):
42
+ console.log(await ask('Say hello in French.'));
43
+
44
+ // `stream` → an async generator yielding each event:
45
+ for await (const event of stream('Now in German.')) {
46
+ if (event.type === 'assistant_chunk') process.stdout.write(event.delta);
47
+ }
48
+ ```
49
+
50
+ `collect(prompt)` resolves with every event; `session` is the live Session for
51
+ anything the sugar doesn't cover.
52
+
53
+ ### Tools
54
+
55
+ ```ts
56
+ import { defineTool } from '@moxxy/sdk';
57
+ import { z } from 'zod';
58
+
59
+ const { ask, addTool } = setupAgent({ plugins: [defaultMode, openai], provider: { name: 'openai' } });
60
+
61
+ addTool(
62
+ defineTool({
63
+ name: 'get_weather',
64
+ description: 'Current weather for a city.',
65
+ inputSchema: z.object({ city: z.string() }),
66
+ handler: async ({ city }) => `It's sunny in ${city}.`,
67
+ }),
68
+ );
69
+
70
+ console.log(await ask("What's the weather in Paris?"));
71
+ ```
72
+
73
+ ### Hot-swap blocks between turns
74
+
75
+ Nothing is hardcoded — the registries *are* the enable/disable/swap mechanism,
76
+ exposed as chainable sugar (and on `agent.session` directly):
77
+
78
+ ```ts
79
+ agent.setProvider('anthropic', { apiKey: process.env.ANTHROPIC_API_KEY }); // swap LLM
80
+ agent.setMode('goal'); // swap loop strategy
81
+ agent.removeTool('get_weather');
82
+ await agent.discover(); // load npm plugins
83
+ ```
84
+
85
+ ## Under the hood (manual wiring)
86
+
87
+ `setupAgent` is sugar over the raw API, which you can use directly:
88
+
89
+ ```ts
90
+ import { Session, runTurn, autoAllowResolver } from '@moxxy/core';
91
+
92
+ const session = new Session({ cwd: process.cwd(), permissionResolver: autoAllowResolver });
93
+ session.pluginHost.registerStatic(defaultMode);
94
+ session.pluginHost.registerStatic(openai);
95
+ session.providers.setActive('openai', { apiKey: process.env.OPENAI_API_KEY });
96
+
97
+ for await (const event of runTurn(session, 'Summarise the files in this repo.')) {
98
+ // …
99
+ }
100
+ ```
101
+
102
+ ## What's in the box
103
+
104
+ `setupAgent` + `Session` + `runTurn`/`collectTurn` · the registries
105
+ (`ProviderRegistry`, `ToolRegistryImpl`, `ModeRegistry`, `CompactorRegistry`,
106
+ `CacheStrategyRegistry`, `ChannelRegistryImpl`, `EmbedderRegistry`, …) ·
107
+ `PluginHost` + plugin discovery/loading · `SessionPersistence` (save / resume) ·
108
+ the `PermissionEngine` + resolvers (`autoAllowResolver`, `denyByDefaultResolver`,
109
+ allow-list, callback) · the `EventLog` · skills · `createLogger`. The
110
+ `@moxxy/sdk` types in the public surface (`MoxxyEvent`, `Plugin`, `ToolDef`,
111
+ `PermissionResolver`, `RunTurnOptions`) are re-exported, so the API is fully
112
+ typed from a single import.
113
+
114
+ `packages/core/src/index.ts` is the curated public surface. The package is `0.x`:
115
+ the API may still change between minor versions while it settles.
116
+
117
+ ## You bring the model
118
+
119
+ `@moxxy/core` is provider-agnostic: it defines the `LLMProvider` contract (in
120
+ `@moxxy/sdk`) but bundles no vendor. Register a provider plugin (or your own)
121
+ before running a turn.
122
+
123
+ ## License
124
+
125
+ MIT
@@ -0,0 +1,6 @@
1
+ import type { EventId, EmittedEvent, MoxxyEvent, SessionId, TurnId } from '@moxxy/sdk';
2
+ export declare const newEventId: () => EventId;
3
+ export declare const newTurnId: () => TurnId;
4
+ export declare const newSessionId: () => SessionId;
5
+ export declare function materializeEvent(partial: EmittedEvent, seq: number, now?: () => number): MoxxyEvent;
6
+ //# sourceMappingURL=factory.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"factory.d.ts","sourceRoot":"","sources":["../../src/events/factory.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAEV,OAAO,EACP,YAAY,EACZ,UAAU,EACV,SAAS,EACT,MAAM,EACP,MAAM,YAAY,CAAC;AAGpB,eAAO,MAAM,UAAU,QAAO,OAA4B,CAAC;AAC3D,eAAO,MAAM,SAAS,QAAO,MAA0B,CAAC;AACxD,eAAO,MAAM,YAAY,QAAO,SAAgC,CAAC;AAEjE,wBAAgB,gBAAgB,CAC9B,OAAO,EAAE,YAAY,EACrB,GAAG,EAAE,MAAM,EACX,GAAG,GAAE,MAAM,MAAiB,GAC3B,UAAU,CAOZ"}
@@ -0,0 +1,14 @@
1
+ import { ulid } from 'ulid';
2
+ import { asEventId, asSessionId, asTurnId } from '@moxxy/sdk';
3
+ export const newEventId = () => asEventId(ulid());
4
+ export const newTurnId = () => asTurnId(ulid());
5
+ export const newSessionId = () => asSessionId(ulid());
6
+ export function materializeEvent(partial, seq, now = Date.now) {
7
+ const base = {
8
+ id: newEventId(),
9
+ seq,
10
+ ts: partial.ts ?? now(),
11
+ };
12
+ return { ...partial, ...base };
13
+ }
14
+ //# sourceMappingURL=factory.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"factory.js","sourceRoot":"","sources":["../../src/events/factory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAS5B,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAE9D,MAAM,CAAC,MAAM,UAAU,GAAG,GAAY,EAAE,CAAC,SAAS,CAAC,IAAI,EAAE,CAAC,CAAC;AAC3D,MAAM,CAAC,MAAM,SAAS,GAAG,GAAW,EAAE,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC,CAAC;AACxD,MAAM,CAAC,MAAM,YAAY,GAAG,GAAc,EAAE,CAAC,WAAW,CAAC,IAAI,EAAE,CAAC,CAAC;AAEjE,MAAM,UAAU,gBAAgB,CAC9B,OAAqB,EACrB,GAAW,EACX,MAAoB,IAAI,CAAC,GAAG;IAE5B,MAAM,IAAI,GAAyC;QACjD,EAAE,EAAE,UAAU,EAAE;QAChB,GAAG;QACH,EAAE,EAAE,OAAO,CAAC,EAAE,IAAI,GAAG,EAAE;KACxB,CAAC;IACF,OAAO,EAAE,GAAG,OAAO,EAAE,GAAG,IAAI,EAAgB,CAAC;AAC/C,CAAC"}
@@ -0,0 +1,92 @@
1
+ import type { EmittedEvent, EventLogReader, MoxxyEvent, MoxxyEventOfType, MoxxyEventType, TurnId } from '@moxxy/sdk';
2
+ export type EventListener = (event: MoxxyEvent) => void | Promise<void>;
3
+ export declare class EventLog implements EventLogReader {
4
+ private readonly events;
5
+ private readonly listeners;
6
+ private readonly clearListeners;
7
+ private readonly now;
8
+ /**
9
+ * Lazy secondary indexes so `ofType`/`byTurn` are O(matches) instead of an
10
+ * O(n) full-array `filter` per call (these back hot paths: token-accounting's
11
+ * `ofType('provider_response')`, lazy-tool gating's
12
+ * `ofType('tool_call_requested')`, and remote-session's per-turn
13
+ * `byTurn(turnId)` priming). Built lazily on first query so a cold/seeded log
14
+ * pays the one-time O(n) build only if anything ever queries it, then kept
15
+ * O(1) per append/ingest. Reset to `null` (rebuild-on-next-query) by
16
+ * `clear`/`rebase`, which mutate `events` wholesale.
17
+ *
18
+ * Each index holds the SAME event object references in their original
19
+ * append order — so a query returns an array deep-equal to the old
20
+ * `events.filter(...)` for every input.
21
+ */
22
+ private byType;
23
+ private byTurnId;
24
+ /**
25
+ * Seq of the FIRST event this log holds. 0 for an authoring log; a mirror
26
+ * primed by a partial attach replay (runner protocol v6 `replay.start`)
27
+ * rebases to the first replayed seq so `ingest`'s contiguity gate lines up
28
+ * with the runner's stream instead of expecting history we never received.
29
+ * `seq === base + index` for every held event.
30
+ */
31
+ private base;
32
+ constructor(seed?: ReadonlyArray<MoxxyEvent>, opts?: {
33
+ now?: () => number;
34
+ });
35
+ get length(): number;
36
+ /** Seq of the first held event (see {@link rebase}). */
37
+ get baseSeq(): number;
38
+ at(seq: number): MoxxyEvent | undefined;
39
+ slice(from?: number, to?: number): ReadonlyArray<MoxxyEvent>;
40
+ /** Build both secondary indexes from the current `events` array, preserving
41
+ * append order. Bucket arrays hold the original event references. */
42
+ private buildIndexes;
43
+ /** Append one event to the live indexes (no-op while they're cold). Called
44
+ * after the event is pushed to `events`, so order is preserved. */
45
+ private indexEvent;
46
+ ofType<T extends MoxxyEventType>(type: T): ReadonlyArray<MoxxyEventOfType<T>>;
47
+ byTurn(turnId: TurnId): ReadonlyArray<MoxxyEvent>;
48
+ toJSON(): ReadonlyArray<MoxxyEvent>;
49
+ append(partial: EmittedEvent): Promise<MoxxyEvent>;
50
+ subscribe(fn: EventListener): () => void;
51
+ /**
52
+ * Append an already-materialized event, preserving its `id`/`seq`/`ts`
53
+ * rather than minting new ones. This is how a thin client mirrors the
54
+ * runner's log: the server is the sole authority for event identity, so the
55
+ * mirror must keep the originals. De-dupes by `seq` (idempotent replay) and
56
+ * fires listeners fire-and-forget - a mirror has no dispatcher to await.
57
+ *
58
+ * Not for normal authoring; use {@link append} for that.
59
+ */
60
+ ingest(event: MoxxyEvent): void;
61
+ /**
62
+ * Start this (empty) log at `seq` instead of 0. A mirror primed by a
63
+ * PARTIAL attach replay (`replay: 'none'` / `{ tail }`) calls this with the
64
+ * runner's announced first seq so {@link ingest}'s contiguity gate accepts
65
+ * the stream. Only valid while empty — rebasing held events would detach
66
+ * their seqs from their indices.
67
+ */
68
+ rebase(seq: number): void;
69
+ /**
70
+ * Drop every event from the log. Used by `/new` to start a fresh
71
+ * session without rebuilding the entire Session object — the
72
+ * registries, resolvers, and active provider stay; only the
73
+ * conversation context vanishes. Per-event listeners are NOT
74
+ * notified (there's no "event removed" event in the schema), but
75
+ * {@link onClear} subscribers fire — that's how the persistence
76
+ * sidecar truncates its JSONL (so `--resume` can't resurrect wiped
77
+ * history) and how the runner broadcasts a reset to attached
78
+ * mirrors, in lockstep with the wipe.
79
+ *
80
+ * Safe to call only when no turn is in flight — callers should abort
81
+ * their AbortController and await any pending runTurn() first.
82
+ */
83
+ clear(): void;
84
+ /**
85
+ * Subscribe to {@link clear}. Fires synchronously after the events array
86
+ * empties, so a listener reading the log observes the post-wipe state.
87
+ * Returns the unsubscribe callback.
88
+ */
89
+ onClear(fn: () => void): () => void;
90
+ asReader(): EventLogReader;
91
+ }
92
+ //# sourceMappingURL=log.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"log.d.ts","sourceRoot":"","sources":["../../src/events/log.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,YAAY,EACZ,cAAc,EACd,UAAU,EACV,gBAAgB,EAChB,cAAc,EACd,MAAM,EACP,MAAM,YAAY,CAAC;AAGpB,MAAM,MAAM,aAAa,GAAG,CAAC,KAAK,EAAE,UAAU,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;AAExE,qBAAa,QAAS,YAAW,cAAc;IAC7C,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAoB;IAC3C,OAAO,CAAC,QAAQ,CAAC,SAAS,CAA4B;IACtD,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAyB;IACxD,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAe;IACnC;;;;;;;;;;;;;OAaG;IACH,OAAO,CAAC,MAAM,CAAkD;IAChE,OAAO,CAAC,QAAQ,CAA0C;IAC1D;;;;;;OAMG;IACH,OAAO,CAAC,IAAI,CAAK;gBAEL,IAAI,GAAE,aAAa,CAAC,UAAU,CAAM,EAAE,IAAI,GAAE;QAAE,GAAG,CAAC,EAAE,MAAM,MAAM,CAAA;KAAO;IAWnF,IAAI,MAAM,IAAI,MAAM,CAEnB;IAED,wDAAwD;IACxD,IAAI,OAAO,IAAI,MAAM,CAEpB;IAED,EAAE,CAAC,GAAG,EAAE,MAAM,GAAG,UAAU,GAAG,SAAS;IAMvC,KAAK,CAAC,IAAI,SAAI,EAAE,EAAE,GAAE,MAAuC,GAAG,aAAa,CAAC,UAAU,CAAC;IAMvF;yEACqE;IACrE,OAAO,CAAC,YAAY;IAepB;uEACmE;IACnE,OAAO,CAAC,UAAU;IAalB,MAAM,CAAC,CAAC,SAAS,cAAc,EAAE,IAAI,EAAE,CAAC,GAAG,aAAa,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC;IAW7E,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,aAAa,CAAC,UAAU,CAAC;IAMjD,MAAM,IAAI,aAAa,CAAC,UAAU,CAAC;IAI7B,MAAM,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,UAAU,CAAC;IAmBxD,SAAS,CAAC,EAAE,EAAE,aAAa,GAAG,MAAM,IAAI;IAKxC;;;;;;;;OAQG;IACH,MAAM,CAAC,KAAK,EAAE,UAAU,GAAG,IAAI;IA2B/B;;;;;;OAMG;IACH,MAAM,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI;IAczB;;;;;;;;;;;;;OAaG;IACH,KAAK,IAAI,IAAI;IAoBb;;;;OAIG;IACH,OAAO,CAAC,EAAE,EAAE,MAAM,IAAI,GAAG,MAAM,IAAI;IAKnC,QAAQ,IAAI,cAAc;CAG3B"}
@@ -0,0 +1,244 @@
1
+ import { materializeEvent } from './factory.js';
2
+ export class EventLog {
3
+ events = [];
4
+ listeners = new Set();
5
+ clearListeners = new Set();
6
+ now;
7
+ /**
8
+ * Lazy secondary indexes so `ofType`/`byTurn` are O(matches) instead of an
9
+ * O(n) full-array `filter` per call (these back hot paths: token-accounting's
10
+ * `ofType('provider_response')`, lazy-tool gating's
11
+ * `ofType('tool_call_requested')`, and remote-session's per-turn
12
+ * `byTurn(turnId)` priming). Built lazily on first query so a cold/seeded log
13
+ * pays the one-time O(n) build only if anything ever queries it, then kept
14
+ * O(1) per append/ingest. Reset to `null` (rebuild-on-next-query) by
15
+ * `clear`/`rebase`, which mutate `events` wholesale.
16
+ *
17
+ * Each index holds the SAME event object references in their original
18
+ * append order — so a query returns an array deep-equal to the old
19
+ * `events.filter(...)` for every input.
20
+ */
21
+ byType = null;
22
+ byTurnId = null;
23
+ /**
24
+ * Seq of the FIRST event this log holds. 0 for an authoring log; a mirror
25
+ * primed by a partial attach replay (runner protocol v6 `replay.start`)
26
+ * rebases to the first replayed seq so `ingest`'s contiguity gate lines up
27
+ * with the runner's stream instead of expecting history we never received.
28
+ * `seq === base + index` for every held event.
29
+ */
30
+ base = 0;
31
+ constructor(seed = [], opts = {}) {
32
+ this.now = opts.now ?? Date.now;
33
+ for (const e of seed)
34
+ this.events.push(e);
35
+ // Align `base` to the first seeded event so `seq === base + index` holds
36
+ // regardless of where the seed starts. Today every caller seeds a log
37
+ // re-sequenced to 0..n-1 (so this is a no-op), but a caller seeding a tail
38
+ // slice (e.g. seq 50..) would otherwise get silently wrong at()/slice()
39
+ // seq-addressing and an off-by-`base` ingest() contiguity gate.
40
+ if (seed.length > 0)
41
+ this.base = seed[0].seq;
42
+ }
43
+ get length() {
44
+ return this.events.length;
45
+ }
46
+ /** Seq of the first held event (see {@link rebase}). */
47
+ get baseSeq() {
48
+ return this.base;
49
+ }
50
+ at(seq) {
51
+ const index = seq - this.base;
52
+ if (index < 0 || index >= this.events.length)
53
+ return undefined;
54
+ return this.events[index];
55
+ }
56
+ slice(from = 0, to = this.base + this.events.length) {
57
+ // Seq-addressed, like `at`. Events below the base were never held, so a
58
+ // `from` before it just clamps to everything we have.
59
+ return this.events.slice(Math.max(0, from - this.base), Math.max(0, to - this.base));
60
+ }
61
+ /** Build both secondary indexes from the current `events` array, preserving
62
+ * append order. Bucket arrays hold the original event references. */
63
+ buildIndexes() {
64
+ const byType = new Map();
65
+ const byTurnId = new Map();
66
+ for (const e of this.events) {
67
+ let typeBucket = byType.get(e.type);
68
+ if (!typeBucket)
69
+ byType.set(e.type, (typeBucket = []));
70
+ typeBucket.push(e);
71
+ let turnBucket = byTurnId.get(e.turnId);
72
+ if (!turnBucket)
73
+ byTurnId.set(e.turnId, (turnBucket = []));
74
+ turnBucket.push(e);
75
+ }
76
+ this.byType = byType;
77
+ this.byTurnId = byTurnId;
78
+ }
79
+ /** Append one event to the live indexes (no-op while they're cold). Called
80
+ * after the event is pushed to `events`, so order is preserved. */
81
+ indexEvent(e) {
82
+ if (this.byType) {
83
+ const bucket = this.byType.get(e.type);
84
+ if (bucket)
85
+ bucket.push(e);
86
+ else
87
+ this.byType.set(e.type, [e]);
88
+ }
89
+ if (this.byTurnId) {
90
+ const bucket = this.byTurnId.get(e.turnId);
91
+ if (bucket)
92
+ bucket.push(e);
93
+ else
94
+ this.byTurnId.set(e.turnId, [e]);
95
+ }
96
+ }
97
+ ofType(type) {
98
+ if (!this.byType)
99
+ this.buildIndexes();
100
+ // The bucket already holds exactly the matching events in append order —
101
+ // identical to the old `events.filter(e => e.type === type)`. Return a copy
102
+ // so callers can't mutate the index (filter() also returned a fresh array).
103
+ const bucket = this.byType.get(type);
104
+ // Bucket holds only events whose `type === T`, so the cast is sound; route
105
+ // through `unknown` because TS can't narrow the heterogeneous union here.
106
+ return (bucket ? [...bucket] : []);
107
+ }
108
+ byTurn(turnId) {
109
+ if (!this.byTurnId)
110
+ this.buildIndexes();
111
+ const bucket = this.byTurnId.get(turnId);
112
+ return bucket ? [...bucket] : [];
113
+ }
114
+ toJSON() {
115
+ return [...this.events];
116
+ }
117
+ async append(partial) {
118
+ const event = materializeEvent(partial, this.base + this.events.length, this.now);
119
+ this.events.push(event);
120
+ this.indexEvent(event);
121
+ // Snapshot listeners so a subscribe/unsubscribe during dispatch (e.g.,
122
+ // a runTurn finishing and unsubscribing while we're still mid-fanout)
123
+ // doesn't change the iteration target.
124
+ const snapshot = [...this.listeners];
125
+ for (const fn of snapshot) {
126
+ try {
127
+ await fn(event);
128
+ }
129
+ catch {
130
+ // Listeners must not block the log; failures are non-fatal here. Hook
131
+ // failures are recorded as ErrorEvents by the dispatcher above this.
132
+ }
133
+ }
134
+ return event;
135
+ }
136
+ subscribe(fn) {
137
+ this.listeners.add(fn);
138
+ return () => this.listeners.delete(fn);
139
+ }
140
+ /**
141
+ * Append an already-materialized event, preserving its `id`/`seq`/`ts`
142
+ * rather than minting new ones. This is how a thin client mirrors the
143
+ * runner's log: the server is the sole authority for event identity, so the
144
+ * mirror must keep the originals. De-dupes by `seq` (idempotent replay) and
145
+ * fires listeners fire-and-forget - a mirror has no dispatcher to await.
146
+ *
147
+ * Not for normal authoring; use {@link append} for that.
148
+ */
149
+ ingest(event) {
150
+ // Contiguous, ordered delivery over a single socket means
151
+ // seq === base + index. Accept ONLY the next-expected seq: this drops
152
+ // duplicates (overlap between attach-replay and the live stream,
153
+ // seq < base + length) AND refuses a gap (seq > base + length) rather than
154
+ // pushing it at the wrong index, which would permanently desync `seq` from
155
+ // the array index. A gap can't happen over the reliable in-order
156
+ // transport, so refusing one is fail-safe.
157
+ if (event.seq !== this.base + this.events.length)
158
+ return;
159
+ this.events.push(event);
160
+ this.indexEvent(event);
161
+ const snapshot = [...this.listeners];
162
+ for (const fn of snapshot) {
163
+ try {
164
+ // Fire-and-forget, but attach a rejection handler: an async listener
165
+ // that rejects must be swallowed the same way append()'s awaited
166
+ // try/catch swallows it — otherwise it surfaces as an unhandled
167
+ // rejection and (under Node's default policy) can kill the process.
168
+ void Promise.resolve(fn(event)).catch(() => {
169
+ // Mirror listeners must not break ingestion.
170
+ });
171
+ }
172
+ catch {
173
+ // Mirror listeners must not break ingestion (synchronous throw).
174
+ }
175
+ }
176
+ }
177
+ /**
178
+ * Start this (empty) log at `seq` instead of 0. A mirror primed by a
179
+ * PARTIAL attach replay (`replay: 'none'` / `{ tail }`) calls this with the
180
+ * runner's announced first seq so {@link ingest}'s contiguity gate accepts
181
+ * the stream. Only valid while empty — rebasing held events would detach
182
+ * their seqs from their indices.
183
+ */
184
+ rebase(seq) {
185
+ if (this.events.length > 0) {
186
+ throw new Error(`EventLog.rebase(${seq}): log already holds ${this.events.length} events`);
187
+ }
188
+ if (!Number.isInteger(seq) || seq < 0) {
189
+ throw new Error(`EventLog.rebase(${seq}): seq must be a non-negative integer`);
190
+ }
191
+ this.base = seq;
192
+ // Rebase only runs on an empty log, so the indexes (if warm) are already
193
+ // empty — but null them to stay defensive about the events-array invariant.
194
+ this.byType = null;
195
+ this.byTurnId = null;
196
+ }
197
+ /**
198
+ * Drop every event from the log. Used by `/new` to start a fresh
199
+ * session without rebuilding the entire Session object — the
200
+ * registries, resolvers, and active provider stay; only the
201
+ * conversation context vanishes. Per-event listeners are NOT
202
+ * notified (there's no "event removed" event in the schema), but
203
+ * {@link onClear} subscribers fire — that's how the persistence
204
+ * sidecar truncates its JSONL (so `--resume` can't resurrect wiped
205
+ * history) and how the runner broadcasts a reset to attached
206
+ * mirrors, in lockstep with the wipe.
207
+ *
208
+ * Safe to call only when no turn is in flight — callers should abort
209
+ * their AbortController and await any pending runTurn() first.
210
+ */
211
+ clear() {
212
+ this.events.length = 0;
213
+ // The secondary indexes mirror `events`; drop them so the next query
214
+ // rebuilds from the now-empty array (cheap) rather than serving stale
215
+ // buckets.
216
+ this.byType = null;
217
+ this.byTurnId = null;
218
+ // A session reset restarts the authoritative stream at seq 0 — a rebased
219
+ // mirror must follow, or it would wait forever for seqs that never come.
220
+ this.base = 0;
221
+ const snapshot = [...this.clearListeners];
222
+ for (const fn of snapshot) {
223
+ try {
224
+ fn();
225
+ }
226
+ catch {
227
+ // A clear listener must not block the wipe.
228
+ }
229
+ }
230
+ }
231
+ /**
232
+ * Subscribe to {@link clear}. Fires synchronously after the events array
233
+ * empties, so a listener reading the log observes the post-wipe state.
234
+ * Returns the unsubscribe callback.
235
+ */
236
+ onClear(fn) {
237
+ this.clearListeners.add(fn);
238
+ return () => this.clearListeners.delete(fn);
239
+ }
240
+ asReader() {
241
+ return this;
242
+ }
243
+ }
244
+ //# sourceMappingURL=log.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"log.js","sourceRoot":"","sources":["../../src/events/log.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,C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AAC;QAC1C,KAAK,MAAM,EAAE,IAAI,QAAQ,EAAE,CAAC;YAC1B,IAAI,CAAC;gBACH,EAAE,EAAE,CAAC;YACP,CAAC;YAAC,MAAM,CAAC;gBACP,4CAA4C;YAC9C,CAAC;QACH,CAAC;IACH,CAAC;IAED;;;;OAIG;IACH,OAAO,CAAC,EAAc;QACpB,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QAC5B,OAAO,GAAG,EAAE,CAAC,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;IAC9C,CAAC;IAED,QAAQ;QACN,OAAO,IAAI,CAAC;IACd,CAAC;CACF"}
@@ -0,0 +1,40 @@
1
+ export { Session, type SessionOptions } from './session.js';
2
+ export { runTurn, collectTurn, type RunTurnOptions } from './run-turn.js';
3
+ export { setupAgent, type Agent, type SetupAgentOptions, type AgentPreset, } from './setup-agent.js';
4
+ export type { MoxxyEvent, Plugin, ToolDef, PermissionResolver } from '@moxxy/sdk';
5
+ export { createSubagentSpawner, clearRetainedChildren, type SubagentRuntime } from './subagents.js';
6
+ export { loadPreferences, savePreferences, preferencesPath, type MoxxyPreferences, } from './preferences.js';
7
+ export { loadUsageStats, mergeUsageStats, clearUsageStats, usageStatsPath, type UsageStatsFile, type StoredModelUsage, } from './usage-stats.js';
8
+ export { SkillRegistryImpl } from './registries/skills.js';
9
+ export { parseSkillFile, parseFrontmatter, discoverSkills, defaultUserSkillsDir, defaultProjectSkillsDir, synthesizeSkill, buildSynthesizeSkillPlugin, type SkillLoadOptions, type DiscoveredSkill, type SynthesizeOptions, type SynthesizedSkill, } from './skills/index.js';
10
+ export { EventLog, type EventListener } from './events/log.js';
11
+ export { newTurnId, newSessionId } from './events/factory.js';
12
+ export { ToolRegistryImpl, type ToolRegistry } from './registries/tools.js';
13
+ export { ProviderRegistry } from './registries/providers.js';
14
+ export { ModeRegistry } from './registries/modes.js';
15
+ export { CompactorRegistry } from './registries/compactors.js';
16
+ export { CacheStrategyRegistry } from './registries/cache-strategies.js';
17
+ export { ViewRendererRegistry } from './registries/view-renderers.js';
18
+ export { defaultViewRenderer } from './view/default-renderer.js';
19
+ export { parseView, validateDoc, countNodes } from './view/parse.js';
20
+ export { TunnelProviderRegistry } from './registries/tunnel-providers.js';
21
+ export { localhostTunnel } from './tunnel/localhost.js';
22
+ export { ChannelRegistryImpl } from './registries/channels.js';
23
+ export { AgentRegistry } from './registries/agents.js';
24
+ export { CommandRegistry } from './registries/commands.js';
25
+ export { TranscriberRegistry } from './registries/transcribers.js';
26
+ export { SynthesizerRegistry } from './registries/synthesizers.js';
27
+ export { EmbedderRegistry } from './registries/embedders.js';
28
+ export { IsolatorRegistry as ContributedIsolatorRegistry } from './registries/isolators.js';
29
+ export { RequirementRegistry, type RequirementRegistryOptions } from './requirements.js';
30
+ export { SessionPersistence, defaultSessionsDir, readIndex as readSessionIndex, restoreEvents as restoreSessionEvents, deleteSession, type SessionMeta, type SessionPersistenceOpts, } from './sessions/persistence.js';
31
+ export { PluginHost, PluginRequirementError, type PluginLoader, type PluginSkipReason, type PluginSkipRecord, type PluginSkipSource, type RegisterStaticOptions, } from './plugins/host.js';
32
+ export { HookDispatcherImpl } from './plugins/lifecycle.js';
33
+ export { discoverPlugins } from './plugins/discovery.js';
34
+ export { toposortPluginManifests, PluginCycleError } from './plugins/toposort.js';
35
+ export { readPackageMoxxyRequirements } from './plugins/package-requirements.js';
36
+ export { createPluginLoader, type JitiLoaderOptions } from './plugins/loader.js';
37
+ export { PermissionEngine, permissionPolicySchema, type PermissionPolicy, type PolicyRule, } from './permissions/engine.js';
38
+ export { autoAllowResolver, denyByDefaultResolver, createCallbackResolver, createDeferredPermissionResolver, type DeferredPermissionResolver, type DeferredPermissionResolverOptions, type PermissionPromptHandler, createAllowListResolver, } from './permissions/resolvers.js';
39
+ export { createLogger, silentLogger, type Logger, type LogLevel } from './logger.js';
40
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+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OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAC5D,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,uBAAuB,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAClF,OAAO,EAAE,4BAA4B,EAAE,MAAM,mCAAmC,CAAC;AACjF,OAAO,EAAE,kBAAkB,EAAE,KAAK,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACjF,OAAO,EACL,gBAAgB,EAChB,sBAAsB,EACtB,KAAK,gBAAgB,EACrB,KAAK,UAAU,GAChB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,iBAAiB,EACjB,qBAAqB,EACrB,sBAAsB,EACtB,gCAAgC,EAChC,KAAK,0BAA0B,EAC/B,KAAK,iCAAiC,EACtC,KAAK,uBAAuB,EAC5B,uBAAuB,GACxB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,KAAK,MAAM,EAAE,KAAK,QAAQ,EAAE,MAAM,aAAa,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,41 @@
1
+ export { Session } from './session.js';
2
+ export { runTurn, collectTurn } from './run-turn.js';
3
+ export { setupAgent, } from './setup-agent.js';
4
+ export { createSubagentSpawner, clearRetainedChildren } from './subagents.js';
5
+ export { loadPreferences, savePreferences, preferencesPath, } from './preferences.js';
6
+ export { loadUsageStats, mergeUsageStats, clearUsageStats, usageStatsPath, } from './usage-stats.js';
7
+ export { SkillRegistryImpl } from './registries/skills.js';
8
+ export { parseSkillFile, parseFrontmatter, discoverSkills, defaultUserSkillsDir, defaultProjectSkillsDir, synthesizeSkill, buildSynthesizeSkillPlugin, } from './skills/index.js';
9
+ export { EventLog } from './events/log.js';
10
+ // newEventId + materializeEvent are module-private helpers used only by
11
+ // EventLog.append; not re-exported.
12
+ export { newTurnId, newSessionId } from './events/factory.js';
13
+ export { ToolRegistryImpl } from './registries/tools.js';
14
+ export { ProviderRegistry } from './registries/providers.js';
15
+ export { ModeRegistry } from './registries/modes.js';
16
+ export { CompactorRegistry } from './registries/compactors.js';
17
+ export { CacheStrategyRegistry } from './registries/cache-strategies.js';
18
+ export { ViewRendererRegistry } from './registries/view-renderers.js';
19
+ export { defaultViewRenderer } from './view/default-renderer.js';
20
+ export { parseView, validateDoc, countNodes } from './view/parse.js';
21
+ export { TunnelProviderRegistry } from './registries/tunnel-providers.js';
22
+ export { localhostTunnel } from './tunnel/localhost.js';
23
+ export { ChannelRegistryImpl } from './registries/channels.js';
24
+ export { AgentRegistry } from './registries/agents.js';
25
+ export { CommandRegistry } from './registries/commands.js';
26
+ export { TranscriberRegistry } from './registries/transcribers.js';
27
+ export { SynthesizerRegistry } from './registries/synthesizers.js';
28
+ export { EmbedderRegistry } from './registries/embedders.js';
29
+ export { IsolatorRegistry as ContributedIsolatorRegistry } from './registries/isolators.js';
30
+ export { RequirementRegistry } from './requirements.js';
31
+ export { SessionPersistence, defaultSessionsDir, readIndex as readSessionIndex, restoreEvents as restoreSessionEvents, deleteSession, } from './sessions/persistence.js';
32
+ export { PluginHost, PluginRequirementError, } from './plugins/host.js';
33
+ export { HookDispatcherImpl } from './plugins/lifecycle.js';
34
+ export { discoverPlugins } from './plugins/discovery.js';
35
+ export { toposortPluginManifests, PluginCycleError } from './plugins/toposort.js';
36
+ export { readPackageMoxxyRequirements } from './plugins/package-requirements.js';
37
+ export { createPluginLoader } from './plugins/loader.js';
38
+ export { PermissionEngine, permissionPolicySchema, } from './permissions/engine.js';
39
+ export { autoAllowResolver, denyByDefaultResolver, createCallbackResolver, createDeferredPermissionResolver, createAllowListResolver, } from './permissions/resolvers.js';
40
+ export { createLogger, silentLogger } from './logger.js';
41
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAuB,MAAM,cAAc,CAAC;AAC5D,OAAO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<string, unknown>): void;
4
+ info(msg: string, meta?: Record<string, unknown>): void;
5
+ warn(msg: string, meta?: Record<string, unknown>): void;
6
+ error(msg: string, meta?: Record<string, unknown>): void;
7
+ child(bindings: Record<string, unknown>): Logger;
8
+ }
9
+ export interface LoggerOptions {
10
+ minLevel?: LogLevel;
11
+ sink?: (line: string) => void;
12
+ bindings?: Record<string, unknown>;
13
+ }
14
+ export declare function createLogger(opts?: LoggerOptions): Logger;
15
+ export declare const silentLogger: Logger;
16
+ //# sourceMappingURL=logger.d.ts.map