acrylblends 0.8.1 → 0.9.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 (235) hide show
  1. package/dist/index.d.ts +2 -0
  2. package/dist/index.js +83 -7
  3. package/dist/index.js.map +1 -1
  4. package/lib/audit-BXnYsLge.d.ts +58 -0
  5. package/lib/cell-ChU41DZD.d.ts +32 -0
  6. package/lib/client-modules-CLvWOjbd.js +267 -0
  7. package/lib/connection-ZLEso7XL.d.ts +25 -0
  8. package/lib/conninfo.d.ts +1 -23
  9. package/lib/cordis/db-sqlite.d.ts +56 -0
  10. package/lib/cordis/db-sqlite.js +58 -0
  11. package/lib/cordis/db.d.ts +8 -0
  12. package/lib/cordis/db.js +1 -0
  13. package/lib/cordis/door.d.ts +159 -0
  14. package/lib/cordis/door.js +757 -0
  15. package/lib/cordis/inspect.d.ts +77 -0
  16. package/lib/cordis/inspect.js +149 -0
  17. package/lib/cordis/kv-db.d.ts +16 -0
  18. package/lib/cordis/kv-db.js +18 -0
  19. package/lib/cordis/kv-json.d.ts +16 -0
  20. package/lib/cordis/kv-json.js +44 -0
  21. package/lib/cordis/kv.d.ts +8 -0
  22. package/lib/cordis/kv.js +1 -0
  23. package/lib/cordis/node-server.d.ts +45 -0
  24. package/lib/cordis/node-server.js +93 -0
  25. package/lib/cordis/router-http.d.ts +56 -0
  26. package/lib/cordis/router-http.js +117 -0
  27. package/lib/cordis/router.d.ts +8 -0
  28. package/lib/cordis/router.js +7 -0
  29. package/lib/cordis/state/react.d.ts +6 -0
  30. package/lib/cordis/state/react.js +11 -0
  31. package/lib/cordis/state.d.ts +33 -0
  32. package/lib/cordis/state.js +163 -0
  33. package/lib/core-CaY8XDZ6.js +19 -0
  34. package/lib/database-DBHdwefi.d.ts +44 -0
  35. package/lib/db/conformance.d.ts +11 -0
  36. package/lib/db/conformance.js +267 -0
  37. package/lib/db/sqlite.d.ts +1 -1
  38. package/lib/db/sqlite.js +1 -196
  39. package/lib/db.d.ts +2 -1
  40. package/lib/{src-0hI7M7cN.js → deprecated-BP4fPt38.js} +0 -17
  41. package/lib/door/host.d.ts +24 -0
  42. package/lib/door/host.js +2 -0
  43. package/lib/door/page.d.ts +105 -0
  44. package/lib/door/page.js +1030 -0
  45. package/lib/door/protocol.d.ts +2 -0
  46. package/lib/door/protocol.js +197 -0
  47. package/lib/error-t4N2js2I.d.ts +8 -0
  48. package/lib/etag-DaKMOjty.js +135 -0
  49. package/lib/etag.js +1 -134
  50. package/lib/helpers-CvTauQT5.js +5 -0
  51. package/lib/http-exception-kpGJkmpi.d.ts +57 -0
  52. package/lib/http-exception.d.ts +1 -56
  53. package/lib/{index-BLTYsyc1.d.ts → index-BnGgRKTv.d.ts} +3 -39
  54. package/lib/index-BqVQkTnu.d.ts +98 -0
  55. package/lib/index-Dmst2QCQ.d.ts +44 -0
  56. package/lib/index.d.ts +1 -1
  57. package/lib/index.js +2 -1
  58. package/lib/jwk-LkzeoaU8.js +117 -0
  59. package/lib/jwk.js +1 -116
  60. package/lib/jwt-CskdhEW9.js +115 -0
  61. package/lib/jwt.js +2 -114
  62. package/lib/kv/conformance.d.ts +13 -0
  63. package/lib/kv/conformance.js +301 -0
  64. package/lib/kv/db.d.ts +2 -2
  65. package/lib/kv/json.d.ts +1 -1
  66. package/lib/kv-9f-AlRKN.d.ts +39 -0
  67. package/lib/kv.d.ts +2 -1
  68. package/lib/language-D9a4zqvn.js +198 -0
  69. package/lib/language.js +1 -197
  70. package/lib/middleware-CPQ8himN.js +12 -0
  71. package/lib/node-server/serve-static.d.ts +0 -1
  72. package/lib/node-server/serve-static.js +1 -1
  73. package/lib/node-server.d.ts +1 -7
  74. package/lib/node-server.js +3 -1586
  75. package/lib/open-CMhnJODn.js +197 -0
  76. package/lib/protocol-BizVt4J6.d.ts +144 -0
  77. package/lib/request-id-CKVvHOO1.js +34 -0
  78. package/lib/request-id.js +1 -33
  79. package/lib/secure-headers-mP3j6Hm6.js +163 -0
  80. package/lib/secure-headers.js +1 -162
  81. package/lib/{serve-static-B849HlX2.js → serve-static-3uo_9rjF.js} +1 -4
  82. package/lib/server-DvgMGtzo.js +1323 -0
  83. package/lib/snapshot-text-D3NspDyT.js +338 -0
  84. package/lib/src-CwABFr6r.js +328 -0
  85. package/lib/timeout.d.ts +1 -1
  86. package/lib/timing-Cky7C1Jf.js +183 -0
  87. package/lib/timing.js +1 -182
  88. package/package.json +89 -1
  89. package/plugins/acryl-db/plugin.json +6 -1
  90. package/plugins/acryl-db-sqlite/plugin.json +4 -0
  91. package/plugins/acryl-db-sqlite/src/facade/node.ts +1 -1
  92. package/plugins/acryl-db-sqlite/src/index.ts +2 -2
  93. package/plugins/acryl-db-sqlite/src/open.ts +2 -2
  94. package/plugins/acryl-door/plugin.json +4 -1
  95. package/plugins/acryl-door/src/host/http.ts +2 -2
  96. package/plugins/acryl-door/src/host/mcp-routes.ts +1 -1
  97. package/plugins/acryl-door/src/host/operator-routes.ts +1 -1
  98. package/plugins/acryl-door/src/host/page-routes.ts +3 -3
  99. package/plugins/acryl-door/src/index.ts +2 -2
  100. package/plugins/acryl-inspect/plugin.json +4 -1
  101. package/plugins/acryl-inspect/src/service.ts +2 -2
  102. package/plugins/acryl-kv/plugin.json +6 -1
  103. package/plugins/acryl-kv-db/plugin.json +4 -0
  104. package/plugins/acryl-kv-db/src/index.ts +1 -1
  105. package/plugins/acryl-kv-db/src/open.ts +3 -3
  106. package/plugins/acryl-kv-json/plugin.json +4 -0
  107. package/plugins/acryl-kv-json/src/index.ts +1 -1
  108. package/plugins/acryl-kv-json/src/open.ts +2 -2
  109. package/plugins/acryl-node-server/plugin.json +5 -1
  110. package/plugins/acryl-node-server/src/adapter/conninfo.ts +1 -1
  111. package/plugins/acryl-node-server/src/adapter/early-hints.ts +1 -1
  112. package/plugins/acryl-node-server/src/adapter/serve-static.ts +2 -2
  113. package/plugins/acryl-node-server/src/adapter/websocket.ts +2 -2
  114. package/plugins/acryl-node-server/src/client-modules.ts +2 -2
  115. package/plugins/acryl-node-server/src/index.ts +1 -1
  116. package/plugins/acryl-router/plugin.json +11 -1
  117. package/plugins/acryl-router/src/connection.d.ts +25 -0
  118. package/plugins/acryl-router/src/core/app-base.d.ts +215 -0
  119. package/plugins/acryl-router/src/core/app.d.ts +19 -0
  120. package/plugins/acryl-router/src/core/client/client.d.ts +4 -0
  121. package/plugins/acryl-router/src/core/client/fetch-result-please.d.ts +35 -0
  122. package/plugins/acryl-router/src/core/client/index.d.ts +7 -0
  123. package/plugins/acryl-router/src/core/client/types.d.ts +229 -0
  124. package/plugins/acryl-router/src/core/client/utils.d.ts +18 -0
  125. package/plugins/acryl-router/src/core/compose.d.ts +14 -0
  126. package/plugins/acryl-router/src/core/context.d.ts +443 -0
  127. package/plugins/acryl-router/src/core/helper/accepts/accepts.d.ts +30 -0
  128. package/plugins/acryl-router/src/core/helper/accepts/index.d.ts +5 -0
  129. package/plugins/acryl-router/src/core/helper/conninfo/index.d.ts +5 -0
  130. package/plugins/acryl-router/src/core/helper/conninfo/types.d.ts +36 -0
  131. package/plugins/acryl-router/src/core/helper/cookie/index.d.ts +25 -0
  132. package/plugins/acryl-router/src/core/helper/css/common.d.ts +59 -0
  133. package/plugins/acryl-router/src/core/helper/css/index.d.ts +80 -0
  134. package/plugins/acryl-router/src/core/helper/dev/index.d.ts +20 -0
  135. package/plugins/acryl-router/src/core/helper/factory/index.d.ts +82 -0
  136. package/plugins/acryl-router/src/core/helper/html/index.d.ts +8 -0
  137. package/plugins/acryl-router/src/core/helper/proxy/index.d.ts +73 -0
  138. package/plugins/acryl-router/src/core/helper/route/index.d.ts +75 -0
  139. package/plugins/acryl-router/src/core/helper/ssg/index.d.ts +7 -0
  140. package/plugins/acryl-router/src/core/helper/ssg/middleware.d.ts +44 -0
  141. package/plugins/acryl-router/src/core/helper/ssg/plugins.d.ts +27 -0
  142. package/plugins/acryl-router/src/core/helper/ssg/ssg.d.ts +91 -0
  143. package/plugins/acryl-router/src/core/helper/ssg/utils.d.ts +16 -0
  144. package/plugins/acryl-router/src/core/helper/streaming/index.d.ts +8 -0
  145. package/plugins/acryl-router/src/core/helper/streaming/sse.d.ts +13 -0
  146. package/plugins/acryl-router/src/core/helper/streaming/stream.d.ts +3 -0
  147. package/plugins/acryl-router/src/core/helper/streaming/text.d.ts +3 -0
  148. package/plugins/acryl-router/src/core/helper/streaming/utils.d.ts +1 -0
  149. package/plugins/acryl-router/src/core/helper/testing/index.d.ts +13 -0
  150. package/plugins/acryl-router/src/core/helper/websocket/index.d.ts +70 -0
  151. package/plugins/acryl-router/src/core/http-exception.d.ts +58 -0
  152. package/plugins/acryl-router/src/core/index.d.ts +37 -0
  153. package/plugins/acryl-router/src/core/jsx/base.d.ts +61 -0
  154. package/plugins/acryl-router/src/core/jsx/children.d.ts +9 -0
  155. package/plugins/acryl-router/src/core/jsx/components.d.ts +15 -0
  156. package/plugins/acryl-router/src/core/jsx/constants.d.ts +6 -0
  157. package/plugins/acryl-router/src/core/jsx/context.d.ts +51 -0
  158. package/plugins/acryl-router/src/core/jsx/dom/components.d.ts +10 -0
  159. package/plugins/acryl-router/src/core/jsx/dom/context.d.ts +3 -0
  160. package/plugins/acryl-router/src/core/jsx/dom/css.d.ts +83 -0
  161. package/plugins/acryl-router/src/core/jsx/dom/hooks/index.d.ts +39 -0
  162. package/plugins/acryl-router/src/core/jsx/dom/intrinsic-element/components.d.ts +16 -0
  163. package/plugins/acryl-router/src/core/jsx/dom/jsx-dev-runtime.d.ts +8 -0
  164. package/plugins/acryl-router/src/core/jsx/dom/jsx-runtime.d.ts +7 -0
  165. package/plugins/acryl-router/src/core/jsx/dom/render.d.ts +73 -0
  166. package/plugins/acryl-router/src/core/jsx/dom/utils.d.ts +1 -0
  167. package/plugins/acryl-router/src/core/jsx/hooks/index.d.ts +47 -0
  168. package/plugins/acryl-router/src/core/jsx/index.d.ts +76 -0
  169. package/plugins/acryl-router/src/core/jsx/intrinsic-element/common.d.ts +6 -0
  170. package/plugins/acryl-router/src/core/jsx/intrinsic-element/components.d.ts +13 -0
  171. package/plugins/acryl-router/src/core/jsx/intrinsic-elements.d.ts +735 -0
  172. package/plugins/acryl-router/src/core/jsx/streaming.d.ts +36 -0
  173. package/plugins/acryl-router/src/core/jsx/types.d.ts +36 -0
  174. package/plugins/acryl-router/src/core/jsx/utils.d.ts +4 -0
  175. package/plugins/acryl-router/src/core/request/constants.d.ts +1 -0
  176. package/plugins/acryl-router/src/core/request.d.ts +306 -0
  177. package/plugins/acryl-router/src/core/router/reg-exp-router/index.d.ts +6 -0
  178. package/plugins/acryl-router/src/core/router/reg-exp-router/matcher.d.ts +7 -0
  179. package/plugins/acryl-router/src/core/router/reg-exp-router/node.d.ts +13 -0
  180. package/plugins/acryl-router/src/core/router/reg-exp-router/prepared-router.d.ts +17 -0
  181. package/plugins/acryl-router/src/core/router/reg-exp-router/router.d.ts +11 -0
  182. package/plugins/acryl-router/src/core/router/reg-exp-router/trie.d.ts +8 -0
  183. package/plugins/acryl-router/src/core/router/smart-router/index.d.ts +5 -0
  184. package/plugins/acryl-router/src/core/router/smart-router/router.d.ts +11 -0
  185. package/plugins/acryl-router/src/core/router/trie-router/index.d.ts +5 -0
  186. package/plugins/acryl-router/src/core/router/trie-router/node.d.ts +6 -0
  187. package/plugins/acryl-router/src/core/router/trie-router/router.d.ts +7 -0
  188. package/plugins/acryl-router/src/core/router/utils.d.ts +1 -0
  189. package/plugins/acryl-router/src/core/router.d.ts +97 -0
  190. package/plugins/acryl-router/src/core/types.d.ts +573 -0
  191. package/plugins/acryl-router/src/core/utils/accept.d.ts +6 -0
  192. package/plugins/acryl-router/src/core/utils/body.d.ts +79 -0
  193. package/plugins/acryl-router/src/core/utils/buffer.d.ts +17 -0
  194. package/plugins/acryl-router/src/core/utils/color.d.ts +21 -0
  195. package/plugins/acryl-router/src/core/utils/concurrent.d.ts +11 -0
  196. package/plugins/acryl-router/src/core/utils/constants.d.ts +4 -0
  197. package/plugins/acryl-router/src/core/utils/cookie.d.ts +41 -0
  198. package/plugins/acryl-router/src/core/utils/crypto.d.ts +15 -0
  199. package/plugins/acryl-router/src/core/utils/handler.d.ts +6 -0
  200. package/plugins/acryl-router/src/core/utils/headers.d.ts +8 -0
  201. package/plugins/acryl-router/src/core/utils/html.d.ts +44 -0
  202. package/plugins/acryl-router/src/core/utils/http-status.d.ts +32 -0
  203. package/plugins/acryl-router/src/core/utils/mime.d.ts +70 -0
  204. package/plugins/acryl-router/src/core/utils/stream.d.ts +31 -0
  205. package/plugins/acryl-router/src/core/utils/types.d.ts +128 -0
  206. package/plugins/acryl-router/src/core/utils/url.d.ts +44 -0
  207. package/plugins/acryl-router/src/core/validator/index.d.ts +7 -0
  208. package/plugins/acryl-router/src/core/validator/utils.d.ts +29 -0
  209. package/plugins/acryl-router/src/core/validator/validator.d.ts +16 -0
  210. package/plugins/acryl-router/src/helpers/index.d.ts +17 -0
  211. package/plugins/acryl-router/src/helpers/schema-validator.d.ts +54 -0
  212. package/plugins/acryl-router-http/plugin.json +4 -1
  213. package/plugins/acryl-router-http/src/index.ts +1 -1
  214. package/plugins/acryl-state/plugin.json +5 -1
  215. package/plugins/acryl-state/src/service.ts +3 -3
  216. package/plugins/tsconfig.json +32 -20
  217. package/docs/framework/UPSTREAM.md +0 -3
  218. package/docs/framework/upstream.json +0 -9
  219. package/lib/index-D4FAsBZu.d.ts +0 -85
  220. package/plugins/acryl-db/upstream.json +0 -18
  221. package/plugins/acryl-db-sqlite/upstream.json +0 -21
  222. package/plugins/acryl-door/upstream.json +0 -28
  223. package/plugins/acryl-inspect/upstream.json +0 -18
  224. package/plugins/acryl-kv/upstream.json +0 -18
  225. package/plugins/acryl-kv-db/upstream.json +0 -21
  226. package/plugins/acryl-kv-json/upstream.json +0 -22
  227. package/plugins/acryl-node-server/upstream.json +0 -21
  228. package/plugins/acryl-router/upstream.json +0 -20
  229. package/plugins/acryl-router-http/upstream.json +0 -22
  230. package/plugins/acryl-state/NOTICE +0 -30
  231. package/plugins/acryl-state/upstream.json +0 -22
  232. package/plugins/desktop/upstream.json +0 -12
  233. package/plugins/desktop-web/upstream.json +0 -12
  234. package/templates/todo/upstream.json +0 -12
  235. /package/lib/{index-CTy4N7ng.d.ts → deprecated-CTy4N7ng.d.ts} +0 -0
@@ -0,0 +1,77 @@
1
+ import { Context, Service } from "@deepseek-ai/cordis";
2
+
3
+ //#region ../../plugins/acryl-inspect/src/report.d.ts
4
+ /**
5
+ * The per-plugin contract, read from the running system (spec 046, M4). Cordis already knows a plugin's name, its state, the
6
+ * services it requires (`inject`) and a labeled tree of everything it registered (`getEffects()`), so there is no second
7
+ * declaration to keep in step with the code. The only convention is the label: an effect says what it is, prefixed by its
8
+ * owner (`acryl-router: GET /a`). Pure functions over a structural view of a fiber, so they are testable without Cordis.
9
+ */
10
+ /** The plugin states Cordis defines, by their numeric values (`FiberState`). */
11
+ declare const STATE_NAMES: readonly ["PENDING", "LOADING", "ACTIVE", "FAILED", "DISPOSED", "UNLOADING"];
12
+ type FiberStateName = typeof STATE_NAMES[number];
13
+ interface EffectLabel {
14
+ readonly label: string;
15
+ readonly children: readonly EffectLabel[];
16
+ }
17
+ /** The slice of a Cordis fiber this module reads. */
18
+ interface FiberView {
19
+ readonly state: number;
20
+ readonly inject: Readonly<Record<string, unknown>>;
21
+ readonly runtime: {
22
+ readonly name?: string | undefined;
23
+ } | null;
24
+ /** The context the fiber was loaded from; its own `fiber` is the owning plugin when this fiber is an inline `ctx.inject(...)` callback. */
25
+ readonly parent?: {
26
+ readonly fiber?: FiberView | undefined;
27
+ } | undefined;
28
+ getEffects(): readonly EffectLabel[];
29
+ }
30
+ interface RouteReport {
31
+ readonly method: string;
32
+ readonly path: string;
33
+ }
34
+ interface PluginReport {
35
+ readonly name: string;
36
+ readonly state: FiberStateName;
37
+ /** Services the plugin waits for before it starts. */
38
+ readonly requires: readonly string[];
39
+ /** Services it provides. */
40
+ readonly provides: readonly string[];
41
+ /** Paths it mounted an app under on the router. */
42
+ readonly mounts: readonly string[];
43
+ /** What those mounts serve; middleware and `all` routes show as method `ALL`, the way the core keeps them. */
44
+ readonly routes: readonly RouteReport[];
45
+ /** Every other labeled registration (event listeners, timers, commands, tools). */
46
+ readonly other: readonly string[];
47
+ /** How many registrations disappear when it unloads: all of them. */
48
+ readonly removedOnUnload: number;
49
+ }
50
+ declare function stateName(state: number): FiberStateName;
51
+ /** Describe one fiber, counting the registrations of the unnamed inline callbacks it owns (`adopted`) as its own. */
52
+ declare function reportFiber(fiber: FiberView, adopted?: readonly FiberView[]): PluginReport;
53
+ /** A short, human explanation of one plugin: what it needs, what it adds, and what happens when it unloads. */
54
+ declare function explain(report: PluginReport): string;
55
+ /** One block per plugin, in registration order. */
56
+ declare function renderReports(reports: readonly PluginReport[]): string;
57
+ //#endregion
58
+ //#region ../../plugins/acryl-inspect/src/service.d.ts
59
+ declare module '@deepseek-ai/cordis' {
60
+ interface Context {
61
+ inspect: Inspect;
62
+ }
63
+ }
64
+ /** Stable Cordis plugin name, equal to the package name and the Loader row id. */
65
+ declare const name = "acryl-inspect";
66
+ declare class Inspect extends Service {
67
+ constructor(ctx: Context);
68
+ /** A report for every live plugin instance, in registry order. */
69
+ plugins(): PluginReport[];
70
+ /** The text explanation of the plugin called `pluginName`, or `undefined` when none is registered. */
71
+ explain(pluginName: string): string | undefined;
72
+ /** The whole system as text. */
73
+ render(): string;
74
+ }
75
+ declare function apply(ctx: Context): void;
76
+ //#endregion
77
+ export { type EffectLabel, type FiberStateName, type FiberView, Inspect, type PluginReport, type RouteReport, apply, explain, name, renderReports, reportFiber, stateName };
@@ -0,0 +1,149 @@
1
+ import { t as Acryl } from "../app-BM0rTCp7.js";
2
+ import { loopbackOnly } from "../loopback-only.js";
3
+ import "../src-CwABFr6r.js";
4
+ import "../middleware-CPQ8himN.js";
5
+ import { Service } from "@deepseek-ai/cordis";
6
+ //#region ../../plugins/acryl-inspect/src/report.ts
7
+ /**
8
+ * The per-plugin contract, read from the running system (spec 046, M4). Cordis already knows a plugin's name, its state, the
9
+ * services it requires (`inject`) and a labeled tree of everything it registered (`getEffects()`), so there is no second
10
+ * declaration to keep in step with the code. The only convention is the label: an effect says what it is, prefixed by its
11
+ * owner (`acryl-router: GET /a`). Pure functions over a structural view of a fiber, so they are testable without Cordis.
12
+ */
13
+ /** The plugin states Cordis defines, by their numeric values (`FiberState`). */
14
+ const STATE_NAMES = [
15
+ "PENDING",
16
+ "LOADING",
17
+ "ACTIVE",
18
+ "FAILED",
19
+ "DISPOSED",
20
+ "UNLOADING"
21
+ ];
22
+ const PROVIDE = /^ctx\.provide\("(.+)"\)$/;
23
+ const MOUNT = /^acryl-router: route (\S+)$/;
24
+ const SERVES = /^acryl-router: serves ([A-Z]+) (\S+)$/;
25
+ function flatten(effects) {
26
+ return effects.flatMap((effect) => [effect.label, ...flatten(effect.children)]);
27
+ }
28
+ /** A mount's children name the routes it serves; they describe that one registration and are not registrations of their own. */
29
+ function routeOf(label) {
30
+ const served = SERVES.exec(label);
31
+ return served?.[1] !== void 0 && served[2] !== void 0 ? {
32
+ method: served[1],
33
+ path: served[2]
34
+ } : void 0;
35
+ }
36
+ function stateName(state) {
37
+ return STATE_NAMES[state] ?? "FAILED";
38
+ }
39
+ const isNamed = (fiber) => (fiber.runtime?.name ?? "") !== "";
40
+ /** The named plugin a fiber belongs to: itself, or for an unnamed inline callback (`ctx.inject([...], inner => ...)`) the nearest named ancestor. */
41
+ function ownerOf(fiber) {
42
+ let current = fiber;
43
+ while (!isNamed(current)) {
44
+ const parent = current.parent?.fiber;
45
+ if (parent === void 0 || parent === current) return fiber;
46
+ current = parent;
47
+ }
48
+ return current;
49
+ }
50
+ /** Describe one fiber, counting the registrations of the unnamed inline callbacks it owns (`adopted`) as its own. */
51
+ function reportFiber(fiber, adopted = []) {
52
+ const provides = [];
53
+ const mounts = [];
54
+ const routes = [];
55
+ const other = [];
56
+ const labels = [fiber, ...adopted].flatMap((source) => flatten(source.getEffects()));
57
+ let registrations = 0;
58
+ for (const label of labels) {
59
+ const provided = PROVIDE.exec(label);
60
+ const mount = MOUNT.exec(label);
61
+ const route = routeOf(label);
62
+ if (route !== void 0) {
63
+ routes.push(route);
64
+ continue;
65
+ }
66
+ registrations += 1;
67
+ if (provided?.[1] !== void 0) provides.push(provided[1]);
68
+ else if (mount?.[1] !== void 0) mounts.push(mount[1]);
69
+ else other.push(label);
70
+ }
71
+ return {
72
+ name: isNamed(fiber) ? fiber.runtime?.name ?? "anonymous" : "anonymous",
73
+ state: stateName(fiber.state),
74
+ requires: Object.keys(fiber.inject).sort(),
75
+ provides: provides.sort(),
76
+ mounts,
77
+ routes,
78
+ other,
79
+ removedOnUnload: registrations
80
+ };
81
+ }
82
+ const list = (items) => items.length === 0 ? "nothing" : items.join(", ");
83
+ /** A short, human explanation of one plugin: what it needs, what it adds, and what happens when it unloads. */
84
+ function explain(report) {
85
+ const lines = [
86
+ `${report.name} (${report.state})`,
87
+ ` needs: ${list(report.requires)}`,
88
+ ` provides: ${list(report.provides)}`,
89
+ ` routes: ${list(report.routes.map((route) => `${route.method} ${route.path}`))}`,
90
+ ` mounts: ${report.mounts.length === 0 ? "nothing" : report.mounts.join(", ")}`
91
+ ];
92
+ if (report.other.length > 0) lines.push(` also: ${report.other.join("; ")}`);
93
+ lines.push(report.state === "PENDING" ? ` waiting: it starts when ${list(report.requires)} ${report.requires.length === 1 ? "is" : "are"} available` : ` unloading: removes ${String(report.removedOnUnload)} registration${report.removedOnUnload === 1 ? "" : "s"} and nothing else`);
94
+ return lines.join("\n");
95
+ }
96
+ /** One block per plugin, in registration order. */
97
+ function renderReports(reports) {
98
+ return reports.map(explain).join("\n\n");
99
+ }
100
+ //#endregion
101
+ //#region ../../plugins/acryl-inspect/src/service.ts
102
+ /**
103
+ * The ACRYL inspector (`ctx.inspect`): what every running plugin requires, provides and registers, read from the live
104
+ * registry. It owns no state and registers nothing of its own beyond an optional read-only pair of router routes, which are
105
+ * reachable in process unless some plugin mounts their prefix over HTTP.
106
+ */
107
+ /** Stable Cordis plugin name, equal to the package name and the Loader row id. */
108
+ const name = "acryl-inspect";
109
+ var Inspect = class extends Service {
110
+ constructor(ctx) {
111
+ super(ctx, "inspect");
112
+ }
113
+ /** A report for every live plugin instance, in registry order. */
114
+ plugins() {
115
+ const fibers = [...this.ctx.registry.values()].flatMap((runtime) => [...runtime.fibers]);
116
+ const adopted = /* @__PURE__ */ new Map();
117
+ const owners = [];
118
+ for (const fiber of fibers) {
119
+ const owner = ownerOf(fiber);
120
+ if (owner === fiber) owners.push(fiber);
121
+ else adopted.set(owner, [...adopted.get(owner) ?? [], fiber]);
122
+ }
123
+ return owners.map((fiber) => reportFiber(fiber, adopted.get(fiber) ?? []));
124
+ }
125
+ /** The text explanation of the plugin called `pluginName`, or `undefined` when none is registered. */
126
+ explain(pluginName) {
127
+ const found = this.plugins().filter((report) => report.name === pluginName);
128
+ return found.length === 0 ? void 0 : found.map(explain).join("\n\n");
129
+ }
130
+ /** The whole system as text. */
131
+ render() {
132
+ return renderReports(this.plugins());
133
+ }
134
+ };
135
+ function apply(ctx) {
136
+ const inspect = new Inspect(ctx);
137
+ ctx.inject(["router"], (inner) => {
138
+ const api = new Acryl().use(loopbackOnly({ inProcess: "allow" })).get("/plugins", (c) => c.json(inspect.plugins())).get("/plugins/:name", (c) => {
139
+ const text = inspect.explain(c.req.param("name"));
140
+ return text === void 0 ? c.json({ error: "no such plugin" }, 404) : c.text(text);
141
+ });
142
+ inner.router.route("/api/inspect", api);
143
+ inner.inject(["routerHttp"], (http) => {
144
+ http.routerHttp.mount("/api/inspect");
145
+ });
146
+ });
147
+ }
148
+ //#endregion
149
+ export { Inspect, apply, explain, name, renderReports, reportFiber, stateName };
@@ -0,0 +1,16 @@
1
+ import { KvOnDbOptions, kvOnDb } from "../kv/db.js";
2
+ import { Context } from "@deepseek-ai/cordis";
3
+ import z from "@deepseek-ai/schemastery";
4
+
5
+ //#region ../../plugins/acryl-kv-db/src/index.d.ts
6
+ /** Stable Cordis plugin name, equal to the package name and the Loader row id. */
7
+ declare const name = "acryl-kv-db";
8
+ /** The service this plugin needs: Cordis starts it only while a `db` provider is active. */
9
+ declare const inject: string[];
10
+ interface Config {
11
+ table?: string;
12
+ }
13
+ declare const Config: z<Config>;
14
+ declare function apply(ctx: Context, rawConfig?: Config): Promise<void>;
15
+ //#endregion
16
+ export { Config, type KvOnDbOptions, apply, inject, kvOnDb, name };
@@ -0,0 +1,18 @@
1
+ import "../src-DRFVEQQb.js";
2
+ import { kvOnDb } from "../kv/db.js";
3
+ import z from "@deepseek-ai/schemastery";
4
+ //#region ../../plugins/acryl-kv-db/src/index.ts
5
+ /** Stable Cordis plugin name, equal to the package name and the Loader row id. */
6
+ const name = "acryl-kv-db";
7
+ /** The service this plugin needs: Cordis starts it only while a `db` provider is active. */
8
+ const inject = ["db"];
9
+ const Config = z.object({ table: z.string().description("The table that holds the documents. Defaults to kv.") });
10
+ async function apply(ctx, rawConfig = {}) {
11
+ const config = Config(rawConfig);
12
+ const kv = kvOnDb(ctx.get("db"), config.table === void 0 ? {} : { table: config.table });
13
+ await ctx.effect(async function* () {
14
+ yield ctx.reflect.provide("kv", kv);
15
+ }, "acryl-kv-db");
16
+ }
17
+ //#endregion
18
+ export { Config, apply, inject, kvOnDb, name };
@@ -0,0 +1,16 @@
1
+ import { OpenKvOptions, openKv } from "../kv/json.js";
2
+ import { Context } from "@deepseek-ai/cordis";
3
+ import z from "@deepseek-ai/schemastery";
4
+
5
+ //#region ../../plugins/acryl-kv-json/src/index.d.ts
6
+ /** Stable Cordis plugin name, equal to the package name and the Loader row id. */
7
+ declare const name = "acryl-kv-json";
8
+ interface Config {
9
+ path?: string;
10
+ }
11
+ declare const Config: z<Config>;
12
+ /** The file name used in the app home when `path` is not configured. */
13
+ declare const DEFAULT_FILE = "kv.json";
14
+ declare function apply(ctx: Context, rawConfig?: Config): Promise<void>;
15
+ //#endregion
16
+ export { Config, DEFAULT_FILE, type OpenKvOptions, apply, name, openKv };
@@ -0,0 +1,44 @@
1
+ import "../src-DRFVEQQb.js";
2
+ import { openKv } from "../kv/json.js";
3
+ import { dirname, isAbsolute, join, resolve } from "node:path";
4
+ import { fileURLToPath } from "node:url";
5
+ import z from "@deepseek-ai/schemastery";
6
+ //#region ../../plugins/acryl-kv-json/src/index.ts
7
+ /**
8
+ * The JSON-file provider of the `kv` port (spec 049 slice 3): one file, rewritten atomically on every write, opened with the plain
9
+ * `openKv` and provided as `kv` by this Cordis plugin. App plugins declare `inject: ['kv']` and import types from `acryl-kv` only, so
10
+ * replacing this row with `acryl-kv-db` does not touch them.
11
+ *
12
+ * Unloading withdraws `kv` first, so consumers stop calling, and then closes the store: the close waits for the writes in flight.
13
+ */
14
+ /** Stable Cordis plugin name, equal to the package name and the Loader row id. */
15
+ const name = "acryl-kv-json";
16
+ function isAppHome(value) {
17
+ return typeof value === "object" && value !== null && "home" in value && typeof value.home === "string";
18
+ }
19
+ const Config = z.object({ path: z.string().description("The JSON file, absolute or relative to the app. Defaults to kv.json in the ACRYL app home; required where there is none.") });
20
+ /** The file name used in the app home when `path` is not configured. */
21
+ const DEFAULT_FILE = "kv.json";
22
+ /** A configured path as a file path: absolute as given, relative to the Loader's base URL (the app) otherwise. */
23
+ function resolveFromApp(ctx, path) {
24
+ if (path.startsWith("file:")) return fileURLToPath(path);
25
+ if (isAbsolute(path)) return path;
26
+ const base = ctx.baseUrl;
27
+ if (base === void 0 || !base.startsWith("file:")) throw new Error(`acryl-kv-json: path ${JSON.stringify(path)} is relative, but this app has no file base URL to resolve it from; give an absolute path`);
28
+ return resolve(base.endsWith("/") ? fileURLToPath(base) : dirname(fileURLToPath(base)), path);
29
+ }
30
+ async function apply(ctx, rawConfig = {}) {
31
+ const config = Config(rawConfig);
32
+ const appInstance = ctx.get("appInstance");
33
+ let file;
34
+ if (config.path !== void 0) file = resolveFromApp(ctx, config.path);
35
+ else if (isAppHome(appInstance)) file = join(appInstance.home, DEFAULT_FILE);
36
+ else throw new Error("acryl-kv-json: no file path; set `path` in this row's config (there is no ACRYL app home to default to)");
37
+ await ctx.effect(async function* () {
38
+ const opened = await openKv({ path: file });
39
+ yield () => opened.close();
40
+ yield ctx.reflect.provide("kv", opened.kv);
41
+ }, `acryl-kv-json: ${file}`);
42
+ }
43
+ //#endregion
44
+ export { Config, DEFAULT_FILE, apply, name, openKv };
@@ -0,0 +1,8 @@
1
+ import { n as Kv } from "../kv-9f-AlRKN.js";
2
+
3
+ //#region ../../plugins/acryl-kv/src/cordis.d.ts
4
+ declare module '@deepseek-ai/cordis' {
5
+ interface Context {
6
+ kv: Kv;
7
+ }
8
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,45 @@
1
+ import { t as RequestError } from "../error-t4N2js2I.js";
2
+ import { ServeStaticOptions, serveStatic } from "../node-server/serve-static.js";
3
+ import { Context, Service } from "@deepseek-ai/cordis";
4
+ import z from "@deepseek-ai/schemastery";
5
+
6
+ //#region ../../plugins/acryl-node-server/src/index.d.ts
7
+ /** Stable Cordis plugin name, equal to the package name and the Loader row id. */
8
+ declare const name = "acryl-node-server";
9
+ declare const inject: string[];
10
+ interface Config {
11
+ hostname: string;
12
+ port: number;
13
+ scan: number;
14
+ }
15
+ /** Every field has a default, so a caller passes only what it changes: `ctx.plugin(plugin, { ... })` takes the partial shape. */
16
+ declare const Config: z<Partial<Config>, Config>;
17
+ declare module '@deepseek-ai/cordis' {
18
+ interface Context {
19
+ nodeServer: NodeServer;
20
+ }
21
+ }
22
+ declare class NodeServer extends Service {
23
+ readonly hostname: string;
24
+ readonly config: Config;
25
+ private readonly server;
26
+ private bound;
27
+ constructor(ctx: Context, config: Config);
28
+ /** The port in use, 0 before the server listens. */
29
+ get port(): number;
30
+ /** The address clients use. */
31
+ get url(): string;
32
+ /** Bind, scanning past taken ports. */
33
+ listen(): Promise<void>;
34
+ }
35
+ /**
36
+ * Whether a failed bind means "this port, try the next one". A port another socket holds answers `EADDRINUSE` everywhere. On Windows a port
37
+ * inside a range the system reserves (Hyper-V, WSL and Docker exclude ranges, `netsh interface ipv4 show excludedportrange`) answers
38
+ * `EACCES`, which is a property of that port too; elsewhere `EACCES` means the process may not bind low ports at all, so moving on would
39
+ * only hide the reason.
40
+ */
41
+ declare function isPortUnavailable(error: unknown, platform?: NodeJS.Platform): boolean;
42
+ /** Loads once the server listens, so a plugin that injects `nodeServer` can rely on `url`. A failure to bind fails the plugin. */
43
+ declare function apply(ctx: Context, config?: Partial<Config>): Promise<void>;
44
+ //#endregion
45
+ export { Config, NodeServer, RequestError, type ServeStaticOptions, apply, inject, isPortUnavailable, name, serveStatic };
@@ -0,0 +1,93 @@
1
+ import { a as Request, o as RequestError, t as createAdaptorServer } from "../server-DvgMGtzo.js";
2
+ import { t as serveStatic } from "../serve-static-3uo_9rjF.js";
3
+ import { Service } from "@deepseek-ai/cordis";
4
+ import z from "@deepseek-ai/schemastery";
5
+ //#region ../../plugins/acryl-node-server/src/index.ts
6
+ /** Stable Cordis plugin name, equal to the package name and the Loader row id. */
7
+ const name = "acryl-node-server";
8
+ const inject = ["router"];
9
+ /** Every field has a default, so a caller passes only what it changes: `ctx.plugin(plugin, { ... })` takes the partial shape. */
10
+ const Config = z.object({
11
+ hostname: z.string().default("127.0.0.1").description("Address to bind. Loopback by default; binding elsewhere exposes the app to the network."),
12
+ port: z.number().min(0).max(65535).default(0).description("Port to listen on; 0 lets the system choose. A taken port is followed by the next free one."),
13
+ scan: z.number().min(0).default(20).description("How many further ports to try when the configured one is taken.")
14
+ });
15
+ var NodeServer = class extends Service {
16
+ hostname;
17
+ config;
18
+ server;
19
+ bound = 0;
20
+ constructor(ctx, config) {
21
+ super(ctx, "nodeServer");
22
+ this.config = config;
23
+ this.hostname = config.hostname;
24
+ const router = ctx.router;
25
+ this.server = createAdaptorServer({
26
+ fetch: (request, { incoming }) => router.fetch(new Request(request), {
27
+ remoteAddress: incoming.socket.remoteAddress,
28
+ localPort: incoming.socket.localPort
29
+ }),
30
+ hostname: config.hostname,
31
+ overrideGlobalObjects: false
32
+ });
33
+ ctx.effect(() => async () => {
34
+ this.server.closeAllConnections();
35
+ if (this.server.listening) await new Promise((resolve) => {
36
+ this.server.close(() => {
37
+ resolve();
38
+ });
39
+ });
40
+ }, "acryl-node-server: close listener and open connections");
41
+ }
42
+ /** The port in use, 0 before the server listens. */
43
+ get port() {
44
+ return this.bound;
45
+ }
46
+ /** The address clients use. */
47
+ get url() {
48
+ return `http://${this.hostname.includes(":") ? `[${this.hostname}]` : this.hostname}:${String(this.bound)}`;
49
+ }
50
+ /** Bind, scanning past taken ports. */
51
+ async listen() {
52
+ const { port, scan, hostname } = this.config;
53
+ const last = port === 0 ? 0 : Math.min(65535, port + scan);
54
+ for (let candidate = port; candidate <= last; candidate += 1) try {
55
+ await new Promise((resolve, reject) => {
56
+ const onError = (error) => {
57
+ reject(error);
58
+ };
59
+ this.server.once("error", onError);
60
+ this.server.listen(candidate, hostname, () => {
61
+ this.server.off("error", onError);
62
+ resolve();
63
+ });
64
+ });
65
+ this.bound = this.server.address().port;
66
+ return;
67
+ } catch (error) {
68
+ if (!isPortUnavailable(error)) throw error;
69
+ }
70
+ throw new Error(`acryl-node-server: no free port from ${String(port)} to ${String(last)} on ${hostname}`);
71
+ }
72
+ };
73
+ /**
74
+ * Whether a failed bind means "this port, try the next one". A port another socket holds answers `EADDRINUSE` everywhere. On Windows a port
75
+ * inside a range the system reserves (Hyper-V, WSL and Docker exclude ranges, `netsh interface ipv4 show excludedportrange`) answers
76
+ * `EACCES`, which is a property of that port too; elsewhere `EACCES` means the process may not bind low ports at all, so moving on would
77
+ * only hide the reason.
78
+ */
79
+ function isPortUnavailable(error, platform = process.platform) {
80
+ const code = error?.code;
81
+ return code === "EADDRINUSE" || platform === "win32" && code === "EACCES";
82
+ }
83
+ /** Loads once the server listens, so a plugin that injects `nodeServer` can rely on `url`. A failure to bind fails the plugin. */
84
+ async function apply(ctx, config = {}) {
85
+ await new NodeServer(ctx, {
86
+ hostname: "127.0.0.1",
87
+ port: 0,
88
+ scan: 20,
89
+ ...config
90
+ }).listen();
91
+ }
92
+ //#endregion
93
+ export { Config, NodeServer, RequestError, apply, inject, isPortUnavailable, name, serveStatic };
@@ -0,0 +1,56 @@
1
+ import { i as RouterHttpService } from "../index-BqVQkTnu.js";
2
+ import { IncomingMessage, ServerResponse } from "node:http";
3
+ import { Context, Service } from "@deepseek-ai/cordis";
4
+
5
+ //#region ../../plugins/acryl-router-http/src/serve.d.ts
6
+ /** The slice of the router this adapter needs; `acryl-router`'s `Router` satisfies it. */
7
+ interface FetchRouter {
8
+ fetch(request: Request, connection?: {
9
+ readonly remoteAddress?: string | undefined;
10
+ readonly localPort?: number | undefined;
11
+ }): Promise<Response>;
12
+ }
13
+ /**
14
+ * Serve one node request through the router and write the result. The request's abort signal fires when the client
15
+ * disconnects before the response finished; the socket's peer address and local port travel as connection info, never in the request.
16
+ */
17
+ declare function serve(router: FetchRouter, req: IncomingMessage, res: ServerResponse): Promise<void>;
18
+ //#endregion
19
+ //#region ../../plugins/acryl-router-http/src/bridge.d.ts
20
+ /** Build the Web `Request` for an incoming message. The body, when the method has one, is streamed, not buffered. */
21
+ declare function toRequest(req: IncomingMessage, signal: AbortSignal): Request;
22
+ /**
23
+ * Write a Web `Response` to the node response: status, headers (repeated `set-cookie` kept separate) and the streamed body.
24
+ * A client that disconnects mid-stream ends the copy quietly; the caller's abort signal is what stops the handler.
25
+ */
26
+ declare function sendResponse(res: ServerResponse, response: Response, method: string): Promise<void>;
27
+ //#endregion
28
+ //#region ../../plugins/acryl-router-http/src/index.d.ts
29
+ /** Stable Cordis plugin name, equal to the package name and the Loader row id. */
30
+ declare const name = "acryl-router-http";
31
+ /** Hard requirements: both services must exist, otherwise this plugin stays PENDING. */
32
+ declare const inject: string[];
33
+ /**
34
+ * The slice of the DSH `webServer` this adapter uses, as its own port: a prefix claim that returns its remover. The service
35
+ * is read by name, so this package imports nothing from the DeepSeek Harness (the layout gate keeps that count falling).
36
+ */
37
+ interface WebServerPort {
38
+ register(route: {
39
+ readonly kind: 'prefix';
40
+ readonly path: string;
41
+ readonly handler: (req: IncomingMessage, res: ServerResponse) => void | Promise<void>;
42
+ }): () => void;
43
+ }
44
+ declare class RouterHttp extends Service implements RouterHttpService {
45
+ private readonly router;
46
+ private readonly web;
47
+ constructor(ctx: Context);
48
+ /**
49
+ * Serve `prefix` and everything below it through the router. Returns a remover; the mount also goes away when the
50
+ * calling plugin unloads. A prefix another route already claims throws, as the webServer treats it as misconfiguration.
51
+ */
52
+ mount(prefix: string): () => void;
53
+ }
54
+ declare function apply(ctx: Context): void;
55
+ //#endregion
56
+ export { type FetchRouter, RouterHttp, WebServerPort, apply, inject, name, sendResponse, serve, toRequest };
@@ -0,0 +1,117 @@
1
+ import { pipeline } from "node:stream/promises";
2
+ import { Readable } from "node:stream";
3
+ import { Service } from "@deepseek-ai/cordis";
4
+ //#region ../../plugins/acryl-router-http/src/bridge.ts
5
+ const FALLBACK_ORIGIN = "http://localhost";
6
+ /** Build the Web `Request` for an incoming message. The body, when the method has one, is streamed, not buffered. */
7
+ function toRequest(req, signal) {
8
+ let url;
9
+ try {
10
+ url = new URL(req.url ?? "/", `http://${req.headers.host ?? "localhost"}`);
11
+ } catch {
12
+ url = new URL(req.url ?? "/", FALLBACK_ORIGIN);
13
+ }
14
+ const headers = new Headers();
15
+ for (const [key, value] of Object.entries(req.headers)) {
16
+ if (value === void 0) continue;
17
+ if (Array.isArray(value)) for (const item of value) headers.append(key, item);
18
+ else headers.set(key, value);
19
+ }
20
+ const method = (req.method ?? "GET").toUpperCase();
21
+ if (method === "GET" || method === "HEAD") return new Request(url, {
22
+ method,
23
+ headers,
24
+ signal
25
+ });
26
+ const init = {
27
+ method,
28
+ headers,
29
+ signal,
30
+ body: Readable.toWeb(req),
31
+ duplex: "half"
32
+ };
33
+ return new Request(url, init);
34
+ }
35
+ /**
36
+ * Write a Web `Response` to the node response: status, headers (repeated `set-cookie` kept separate) and the streamed body.
37
+ * A client that disconnects mid-stream ends the copy quietly; the caller's abort signal is what stops the handler.
38
+ */
39
+ async function sendResponse(res, response, method) {
40
+ const headers = {};
41
+ response.headers.forEach((value, key) => {
42
+ if (key !== "set-cookie") headers[key] = value;
43
+ });
44
+ const cookies = response.headers.getSetCookie();
45
+ if (cookies.length > 0) headers["set-cookie"] = cookies;
46
+ res.writeHead(response.status, headers);
47
+ res.flushHeaders();
48
+ if (response.body === null || method === "HEAD") {
49
+ res.end();
50
+ return;
51
+ }
52
+ try {
53
+ await pipeline(Readable.fromWeb(response.body), res);
54
+ } catch {
55
+ if (!res.writableEnded) res.destroy();
56
+ }
57
+ }
58
+ //#endregion
59
+ //#region ../../plugins/acryl-router-http/src/serve.ts
60
+ /**
61
+ * Serve one node request through the router and write the result. The request's abort signal fires when the client
62
+ * disconnects before the response finished; the socket's peer address and local port travel as connection info, never in the request.
63
+ */
64
+ async function serve(router, req, res) {
65
+ const controller = new AbortController();
66
+ res.once("close", () => {
67
+ if (!res.writableFinished) controller.abort();
68
+ });
69
+ const method = (req.method ?? "GET").toUpperCase();
70
+ let response;
71
+ try {
72
+ response = await router.fetch(toRequest(req, controller.signal), {
73
+ remoteAddress: req.socket.remoteAddress,
74
+ localPort: req.socket.localPort
75
+ });
76
+ } catch {
77
+ response = new Response("Internal Server Error", { status: 500 });
78
+ }
79
+ await sendResponse(res, response, method);
80
+ }
81
+ //#endregion
82
+ //#region ../../plugins/acryl-router-http/src/index.ts
83
+ /** Stable Cordis plugin name, equal to the package name and the Loader row id. */
84
+ const name = "acryl-router-http";
85
+ /** Hard requirements: both services must exist, otherwise this plugin stays PENDING. */
86
+ const inject = ["router", "webServer"];
87
+ const PREFIX_PATTERN = /^\/[A-Za-z0-9._~\-/]*[A-Za-z0-9._~-]$/;
88
+ var RouterHttp = class extends Service {
89
+ router;
90
+ web;
91
+ constructor(ctx) {
92
+ super(ctx, "routerHttp");
93
+ this.router = ctx.router;
94
+ this.web = ctx.get("webServer");
95
+ }
96
+ /**
97
+ * Serve `prefix` and everything below it through the router. Returns a remover; the mount also goes away when the
98
+ * calling plugin unloads. A prefix another route already claims throws, as the webServer treats it as misconfiguration.
99
+ */
100
+ mount(prefix) {
101
+ if (!PREFIX_PATTERN.test(prefix)) throw new TypeError(`acryl-router-http: "${prefix}" is not a mountable path prefix`);
102
+ const remove = this.web.register({
103
+ kind: "prefix",
104
+ path: prefix,
105
+ handler: (req, res) => serve(this.router, req, res)
106
+ });
107
+ this.ctx.effect(() => () => {
108
+ remove();
109
+ }, `acryl-router-http: mount ${prefix}`);
110
+ return remove;
111
+ }
112
+ };
113
+ function apply(ctx) {
114
+ new RouterHttp(ctx);
115
+ }
116
+ //#endregion
117
+ export { RouterHttp, apply, inject, name, sendResponse, serve, toRequest };
@@ -0,0 +1,8 @@
1
+ import { B as NotFoundHandler, L as MiddlewareHandler, O as Handler, Q as ValidationTargets, V as NotFoundResponse, X as ToSchema, Y as Schema, Z as TypedResponse, a as ExecutionContext, j as Input, n as ContextRenderer, r as ContextVariableMap, s as AcrylRequest, t as Context, v as Env, y as ErrorHandler, z as Next } from "../context-DS3fYyG-.js";
2
+ import { c as StatusCode, n as ContentfulStatusCode } from "../http-status-DaAwGAFL.js";
3
+ import { a as getConnInfo, i as connectionOf, n as RouterBindings, r as RouterEnv, t as ConnectionInfo } from "../connection-ZLEso7XL.js";
4
+ import { t as Acryl } from "../app-D8riatvv.js";
5
+ import { n as AppRequest, t as App } from "../deprecated-CTy4N7ng.js";
6
+ import { a as TrailingSlash, i as RouterHttpService, n as MountableApp, o as apply, r as Router, s as name, t as Config } from "../index-BqVQkTnu.js";
7
+ import { t as HTTPException } from "../http-exception-kpGJkmpi.js";
8
+ export { Acryl, type AcrylRequest, App, type AppRequest, Config, type ConnectionInfo, type ContentfulStatusCode, Context, type ContextRenderer, type ContextVariableMap, type Env, type ErrorHandler, type ExecutionContext, HTTPException, type Handler, type Input, type MiddlewareHandler, type MountableApp, type Next, type NotFoundHandler, type NotFoundResponse, Router, type RouterBindings, type RouterEnv, type RouterHttpService, type Schema, type StatusCode, type ToSchema, type TrailingSlash, type TypedResponse, type ValidationTargets, apply, connectionOf, getConnInfo, name };