@smthrs/kernel 0.0.0-stage → 1.0.0-rc.4

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 (267) hide show
  1. package/CHANGELOG.md +206 -0
  2. package/LICENSE +21 -0
  3. package/README.md +154 -2
  4. package/dist/cjs/CapabilitySet.d.ts +6 -0
  5. package/dist/cjs/CapabilitySet.d.ts.map +1 -0
  6. package/dist/cjs/CapabilitySet.js +19 -0
  7. package/dist/cjs/CapabilitySet.js.map +7 -0
  8. package/dist/cjs/ChildProcessEnvironment.d.ts +60 -0
  9. package/dist/cjs/ChildProcessEnvironment.d.ts.map +1 -0
  10. package/dist/cjs/ChildProcessEnvironment.js +61 -0
  11. package/dist/cjs/ChildProcessEnvironment.js.map +7 -0
  12. package/dist/cjs/ChildProcessSpawner.d.ts +100 -0
  13. package/dist/cjs/ChildProcessSpawner.d.ts.map +1 -0
  14. package/dist/cjs/ChildProcessSpawner.js +291 -0
  15. package/dist/cjs/ChildProcessSpawner.js.map +7 -0
  16. package/dist/cjs/CommandLine.d.ts +173 -0
  17. package/dist/cjs/CommandLine.d.ts.map +1 -0
  18. package/dist/cjs/CommandLine.js +54 -0
  19. package/dist/cjs/CommandLine.js.map +7 -0
  20. package/dist/cjs/ContainedSpawner.d.ts +135 -0
  21. package/dist/cjs/ContainedSpawner.d.ts.map +1 -0
  22. package/dist/cjs/ContainedSpawner.js +141 -0
  23. package/dist/cjs/ContainedSpawner.js.map +7 -0
  24. package/dist/cjs/FileSystem.d.ts +452 -0
  25. package/dist/cjs/FileSystem.d.ts.map +1 -0
  26. package/dist/cjs/FileSystem.js +890 -0
  27. package/dist/cjs/FileSystem.js.map +7 -0
  28. package/dist/cjs/FileSystemBatch.d.ts +94 -0
  29. package/dist/cjs/FileSystemBatch.d.ts.map +1 -0
  30. package/dist/cjs/FileSystemBatch.js +31 -0
  31. package/dist/cjs/FileSystemBatch.js.map +7 -0
  32. package/dist/cjs/GrantEvent.d.ts +240 -0
  33. package/dist/cjs/GrantEvent.d.ts.map +1 -0
  34. package/dist/cjs/GrantEvent.js +115 -0
  35. package/dist/cjs/GrantEvent.js.map +7 -0
  36. package/dist/cjs/GrantStore.d.ts +270 -0
  37. package/dist/cjs/GrantStore.d.ts.map +1 -0
  38. package/dist/cjs/GrantStore.js +857 -0
  39. package/dist/cjs/GrantStore.js.map +7 -0
  40. package/dist/cjs/HostError.d.ts +36 -0
  41. package/dist/cjs/HostError.d.ts.map +1 -0
  42. package/dist/cjs/HostError.js +17 -0
  43. package/dist/cjs/HostError.js.map +7 -0
  44. package/dist/cjs/HostServices.d.ts +101 -0
  45. package/dist/cjs/HostServices.d.ts.map +1 -0
  46. package/dist/cjs/HostServices.js +66 -0
  47. package/dist/cjs/HostServices.js.map +7 -0
  48. package/dist/cjs/HttpClient.d.ts +177 -0
  49. package/dist/cjs/HttpClient.d.ts.map +1 -0
  50. package/dist/cjs/HttpClient.js +217 -0
  51. package/dist/cjs/HttpClient.js.map +7 -0
  52. package/dist/cjs/Jj.d.ts +67 -0
  53. package/dist/cjs/Jj.d.ts.map +1 -0
  54. package/dist/cjs/Jj.js +118 -0
  55. package/dist/cjs/Jj.js.map +7 -0
  56. package/dist/cjs/JournalGrantStore.d.ts +65 -0
  57. package/dist/cjs/JournalGrantStore.d.ts.map +1 -0
  58. package/dist/cjs/JournalGrantStore.js +354 -0
  59. package/dist/cjs/JournalGrantStore.js.map +7 -0
  60. package/dist/cjs/Path.d.ts +37 -0
  61. package/dist/cjs/Path.d.ts.map +1 -0
  62. package/dist/cjs/Path.js +46 -0
  63. package/dist/cjs/Path.js.map +7 -0
  64. package/dist/cjs/ProcessConfinement.d.ts +55 -0
  65. package/dist/cjs/ProcessConfinement.d.ts.map +1 -0
  66. package/dist/cjs/ProcessConfinement.js +94 -0
  67. package/dist/cjs/ProcessConfinement.js.map +7 -0
  68. package/dist/cjs/ProcessLedger.d.ts +260 -0
  69. package/dist/cjs/ProcessLedger.d.ts.map +1 -0
  70. package/dist/cjs/ProcessLedger.js +190 -0
  71. package/dist/cjs/ProcessLedger.js.map +7 -0
  72. package/dist/cjs/Rooted.d.ts +53 -0
  73. package/dist/cjs/Rooted.d.ts.map +1 -0
  74. package/dist/cjs/Rooted.js +101 -0
  75. package/dist/cjs/Rooted.js.map +7 -0
  76. package/dist/cjs/Unreachable.d.ts +27 -0
  77. package/dist/cjs/Unreachable.d.ts.map +1 -0
  78. package/dist/cjs/Unreachable.js +43 -0
  79. package/dist/cjs/Unreachable.js.map +7 -0
  80. package/dist/cjs/Workspace.d.ts +62 -0
  81. package/dist/cjs/Workspace.d.ts.map +1 -0
  82. package/dist/cjs/Workspace.js +35 -0
  83. package/dist/cjs/Workspace.js.map +7 -0
  84. package/dist/cjs/index.d.ts +161 -0
  85. package/dist/cjs/index.d.ts.map +1 -0
  86. package/dist/cjs/index.js +73 -0
  87. package/dist/cjs/index.js.map +7 -0
  88. package/dist/cjs/internal/Containment.d.ts +24 -0
  89. package/dist/cjs/internal/Containment.d.ts.map +1 -0
  90. package/dist/cjs/internal/Containment.js +30 -0
  91. package/dist/cjs/internal/Containment.js.map +7 -0
  92. package/dist/cjs/internal/Pipeline.d.ts +18 -0
  93. package/dist/cjs/internal/Pipeline.d.ts.map +1 -0
  94. package/dist/cjs/internal/Pipeline.js +90 -0
  95. package/dist/cjs/internal/Pipeline.js.map +7 -0
  96. package/dist/cjs/internal/makeCapability.d.ts +16 -0
  97. package/dist/cjs/internal/makeCapability.d.ts.map +1 -0
  98. package/dist/cjs/internal/makeCapability.js +44 -0
  99. package/dist/cjs/internal/makeCapability.js.map +7 -0
  100. package/dist/cjs/package.json +1 -0
  101. package/dist/cjs/test/FileSystemBatchContract.d.ts +15 -0
  102. package/dist/cjs/test/FileSystemBatchContract.d.ts.map +1 -0
  103. package/dist/cjs/test/FileSystemBatchContract.js +76 -0
  104. package/dist/cjs/test/FileSystemBatchContract.js.map +7 -0
  105. package/dist/cjs/test/HostContract.d.ts +225 -0
  106. package/dist/cjs/test/HostContract.d.ts.map +1 -0
  107. package/dist/cjs/test/HostContract.js +489 -0
  108. package/dist/cjs/test/HostContract.js.map +7 -0
  109. package/dist/cjs/test/TestGrantStore.d.ts +31 -0
  110. package/dist/cjs/test/TestGrantStore.d.ts.map +1 -0
  111. package/dist/cjs/test/TestGrantStore.js +65 -0
  112. package/dist/cjs/test/TestGrantStore.js.map +7 -0
  113. package/dist/esm/CapabilitySet.d.ts +6 -0
  114. package/dist/esm/CapabilitySet.d.ts.map +1 -0
  115. package/dist/esm/CapabilitySet.js +6 -0
  116. package/dist/esm/CapabilitySet.js.map +1 -0
  117. package/dist/esm/ChildProcessEnvironment.d.ts +60 -0
  118. package/dist/esm/ChildProcessEnvironment.d.ts.map +1 -0
  119. package/dist/esm/ChildProcessEnvironment.js +91 -0
  120. package/dist/esm/ChildProcessEnvironment.js.map +1 -0
  121. package/dist/esm/ChildProcessSpawner.d.ts +100 -0
  122. package/dist/esm/ChildProcessSpawner.d.ts.map +1 -0
  123. package/dist/esm/ChildProcessSpawner.js +342 -0
  124. package/dist/esm/ChildProcessSpawner.js.map +1 -0
  125. package/dist/esm/CommandLine.d.ts +173 -0
  126. package/dist/esm/CommandLine.d.ts.map +1 -0
  127. package/dist/esm/CommandLine.js +195 -0
  128. package/dist/esm/CommandLine.js.map +1 -0
  129. package/dist/esm/ContainedSpawner.d.ts +135 -0
  130. package/dist/esm/ContainedSpawner.d.ts.map +1 -0
  131. package/dist/esm/ContainedSpawner.js +180 -0
  132. package/dist/esm/ContainedSpawner.js.map +1 -0
  133. package/dist/esm/FileSystem.d.ts +452 -0
  134. package/dist/esm/FileSystem.d.ts.map +1 -0
  135. package/dist/esm/FileSystem.js +989 -0
  136. package/dist/esm/FileSystem.js.map +1 -0
  137. package/dist/esm/FileSystemBatch.d.ts +94 -0
  138. package/dist/esm/FileSystemBatch.d.ts.map +1 -0
  139. package/dist/esm/FileSystemBatch.js +26 -0
  140. package/dist/esm/FileSystemBatch.js.map +1 -0
  141. package/dist/esm/GrantEvent.d.ts +240 -0
  142. package/dist/esm/GrantEvent.d.ts.map +1 -0
  143. package/dist/esm/GrantEvent.js +155 -0
  144. package/dist/esm/GrantEvent.js.map +1 -0
  145. package/dist/esm/GrantStore.d.ts +270 -0
  146. package/dist/esm/GrantStore.d.ts.map +1 -0
  147. package/dist/esm/GrantStore.js +951 -0
  148. package/dist/esm/GrantStore.js.map +1 -0
  149. package/dist/esm/HostError.d.ts +36 -0
  150. package/dist/esm/HostError.d.ts.map +1 -0
  151. package/dist/esm/HostError.js +20 -0
  152. package/dist/esm/HostError.js.map +1 -0
  153. package/dist/esm/HostServices.d.ts +101 -0
  154. package/dist/esm/HostServices.d.ts.map +1 -0
  155. package/dist/esm/HostServices.js +76 -0
  156. package/dist/esm/HostServices.js.map +1 -0
  157. package/dist/esm/HttpClient.d.ts +177 -0
  158. package/dist/esm/HttpClient.d.ts.map +1 -0
  159. package/dist/esm/HttpClient.js +299 -0
  160. package/dist/esm/HttpClient.js.map +1 -0
  161. package/dist/esm/Jj.d.ts +67 -0
  162. package/dist/esm/Jj.d.ts.map +1 -0
  163. package/dist/esm/Jj.js +111 -0
  164. package/dist/esm/Jj.js.map +1 -0
  165. package/dist/esm/JournalGrantStore.d.ts +65 -0
  166. package/dist/esm/JournalGrantStore.d.ts.map +1 -0
  167. package/dist/esm/JournalGrantStore.js +350 -0
  168. package/dist/esm/JournalGrantStore.js.map +1 -0
  169. package/dist/esm/Path.d.ts +37 -0
  170. package/dist/esm/Path.d.ts.map +1 -0
  171. package/dist/esm/Path.js +34 -0
  172. package/dist/esm/Path.js.map +1 -0
  173. package/dist/esm/ProcessConfinement.d.ts +55 -0
  174. package/dist/esm/ProcessConfinement.d.ts.map +1 -0
  175. package/dist/esm/ProcessConfinement.js +106 -0
  176. package/dist/esm/ProcessConfinement.js.map +1 -0
  177. package/dist/esm/ProcessLedger.d.ts +260 -0
  178. package/dist/esm/ProcessLedger.d.ts.map +1 -0
  179. package/dist/esm/ProcessLedger.js +283 -0
  180. package/dist/esm/ProcessLedger.js.map +1 -0
  181. package/dist/esm/Rooted.d.ts +53 -0
  182. package/dist/esm/Rooted.d.ts.map +1 -0
  183. package/dist/esm/Rooted.js +104 -0
  184. package/dist/esm/Rooted.js.map +1 -0
  185. package/dist/esm/Unreachable.d.ts +27 -0
  186. package/dist/esm/Unreachable.d.ts.map +1 -0
  187. package/dist/esm/Unreachable.js +26 -0
  188. package/dist/esm/Unreachable.js.map +1 -0
  189. package/dist/esm/Workspace.d.ts +62 -0
  190. package/dist/esm/Workspace.d.ts.map +1 -0
  191. package/dist/esm/Workspace.js +51 -0
  192. package/dist/esm/Workspace.js.map +1 -0
  193. package/dist/esm/index.d.ts +161 -0
  194. package/dist/esm/index.d.ts.map +1 -0
  195. package/dist/esm/index.js +151 -0
  196. package/dist/esm/index.js.map +1 -0
  197. package/dist/esm/internal/Containment.d.ts +24 -0
  198. package/dist/esm/internal/Containment.d.ts.map +1 -0
  199. package/dist/esm/internal/Containment.js +27 -0
  200. package/dist/esm/internal/Containment.js.map +1 -0
  201. package/dist/esm/internal/Pipeline.d.ts +18 -0
  202. package/dist/esm/internal/Pipeline.d.ts.map +1 -0
  203. package/dist/esm/internal/Pipeline.js +68 -0
  204. package/dist/esm/internal/Pipeline.js.map +1 -0
  205. package/dist/esm/internal/makeCapability.d.ts +16 -0
  206. package/dist/esm/internal/makeCapability.d.ts.map +1 -0
  207. package/dist/esm/internal/makeCapability.js +22 -0
  208. package/dist/esm/internal/makeCapability.js.map +1 -0
  209. package/dist/esm/test/FileSystemBatchContract.d.ts +15 -0
  210. package/dist/esm/test/FileSystemBatchContract.d.ts.map +1 -0
  211. package/dist/esm/test/FileSystemBatchContract.js +57 -0
  212. package/dist/esm/test/FileSystemBatchContract.js.map +1 -0
  213. package/dist/esm/test/HostContract.d.ts +225 -0
  214. package/dist/esm/test/HostContract.d.ts.map +1 -0
  215. package/dist/esm/test/HostContract.js +460 -0
  216. package/dist/esm/test/HostContract.js.map +1 -0
  217. package/dist/esm/test/TestGrantStore.d.ts +31 -0
  218. package/dist/esm/test/TestGrantStore.d.ts.map +1 -0
  219. package/dist/esm/test/TestGrantStore.js +57 -0
  220. package/dist/esm/test/TestGrantStore.js.map +1 -0
  221. package/docs/README.md +162 -0
  222. package/docs/api.md +1532 -0
  223. package/docs/concepts/decoration-in-place.md +117 -0
  224. package/docs/concepts/filesystem-batches.md +58 -0
  225. package/docs/concepts/filesystem-confinement.md +168 -0
  226. package/docs/concepts/grant-decisions.md +181 -0
  227. package/docs/concepts/process-containment.md +155 -0
  228. package/docs/contract.md +14 -0
  229. package/docs/guides/adapt-a-new-host-platform.md +148 -0
  230. package/docs/guides/answer-permission-requests.md +151 -0
  231. package/docs/guides/authorize-network-and-model-calls.md +118 -0
  232. package/docs/guides/contain-spawned-processes.md +118 -0
  233. package/docs/guides/guard-a-host-bundle.md +109 -0
  234. package/docs/guides/persist-grants-across-restarts.md +135 -0
  235. package/docs/guides/write-a-capability-policy.md +159 -0
  236. package/docs/installation.md +115 -0
  237. package/docs/quickstart.md +182 -0
  238. package/docs/testing.md +108 -0
  239. package/docs/troubleshooting.md +281 -0
  240. package/package.json +344 -3
  241. package/src/CapabilitySet.ts +6 -0
  242. package/src/ChildProcessEnvironment.ts +98 -0
  243. package/src/ChildProcessSpawner.ts +414 -0
  244. package/src/CommandLine.ts +250 -0
  245. package/src/ContainedSpawner.ts +284 -0
  246. package/src/FileSystem.ts +1655 -0
  247. package/src/FileSystemBatch.ts +90 -0
  248. package/src/GrantEvent.ts +174 -0
  249. package/src/GrantStore.ts +1345 -0
  250. package/src/HostError.ts +37 -0
  251. package/src/HostServices.ts +133 -0
  252. package/src/HttpClient.ts +406 -0
  253. package/src/Jj.ts +159 -0
  254. package/src/JournalGrantStore.ts +461 -0
  255. package/src/Path.ts +47 -0
  256. package/src/ProcessConfinement.ts +156 -0
  257. package/src/ProcessLedger.ts +423 -0
  258. package/src/Rooted.ts +128 -0
  259. package/src/Unreachable.ts +30 -0
  260. package/src/Workspace.ts +65 -0
  261. package/src/index.ts +181 -0
  262. package/src/internal/Containment.ts +37 -0
  263. package/src/internal/Pipeline.ts +85 -0
  264. package/src/internal/makeCapability.ts +26 -0
  265. package/src/test/FileSystemBatchContract.ts +59 -0
  266. package/src/test/HostContract.ts +785 -0
  267. package/src/test/TestGrantStore.ts +73 -0
@@ -0,0 +1,51 @@
1
+ /**
2
+ * The workspace root used to make filesystem capability resources stable.
3
+ *
4
+ * It lives beside the closed host list rather than in a platform package: a
5
+ * workspace root is a policy decision the kernel needs before it can name a
6
+ * filesystem capability, not something a platform can answer.
7
+ *
8
+ * Governing design:
9
+ * `docs/specs/Concepts/Effect Taxonomy.md` and
10
+ * `docs/specs/Concepts/Permission Kernel.md`.
11
+ *
12
+ * @since 1.0.0-rc.0
13
+ */
14
+ import { Context, Layer } from "effect";
15
+ /**
16
+ * The workspace-root service tag.
17
+ *
18
+ * @category services
19
+ * @since 1.0.0-rc.0
20
+ */
21
+ export class Workspace extends Context.Service()("@smthrs/kernel/Workspace") {
22
+ }
23
+ /**
24
+ * Constructs workspace-root configuration.
25
+ *
26
+ * @category constructors
27
+ * @since 1.0.0-rc.0
28
+ */
29
+ export const make = (root) => Workspace.of({ root });
30
+ /**
31
+ * Provides a workspace root.
32
+ *
33
+ * @category layers
34
+ * @since 1.0.0-rc.0
35
+ */
36
+ export const layer = (root) => Layer.succeed(Workspace, make(root));
37
+ /**
38
+ * Constructs a relative workspace-root stub for tests.
39
+ *
40
+ * @category constructors
41
+ * @since 1.0.0-rc.0
42
+ */
43
+ export const makeNoop = make(".");
44
+ /**
45
+ * Provides a relative workspace-root stub for tests.
46
+ *
47
+ * @category layers
48
+ * @since 1.0.0-rc.0
49
+ */
50
+ export const layerNoop = Layer.succeed(Workspace, makeNoop);
51
+ //# sourceMappingURL=Workspace.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Workspace.js","sourceRoot":"","sources":["../../src/Workspace.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAA;AAYvC;;;;;GAKG;AACH,MAAM,OAAO,SAAU,SAAQ,OAAO,CAAC,OAAO,EAAsB,CAAC,0BAA0B,CAAC;CAAG;AAEnG;;;;;GAKG;AACH,MAAM,CAAC,MAAM,IAAI,GAAG,CAAC,IAAY,EAAW,EAAE,CAAC,SAAS,CAAC,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,CAAA;AAErE;;;;;GAKG;AACH,MAAM,CAAC,MAAM,KAAK,GAAG,CAAC,IAAY,EAA0B,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,SAAS,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,CAAA;AAEnG;;;;;GAKG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAY,IAAI,CAAC,GAAG,CAAC,CAAA;AAE1C;;;;;GAKG;AACH,MAAM,CAAC,MAAM,SAAS,GAA2B,KAAK,CAAC,OAAO,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAA","sourcesContent":["/**\n * The workspace root used to make filesystem capability resources stable.\n *\n * It lives beside the closed host list rather than in a platform package: a\n * workspace root is a policy decision the kernel needs before it can name a\n * filesystem capability, not something a platform can answer.\n *\n * Governing design:\n * `docs/specs/Concepts/Effect Taxonomy.md` and\n * `docs/specs/Concepts/Permission Kernel.md`.\n *\n * @since 1.0.0-rc.0\n */\n\nimport { Context, Layer } from \"effect\"\n\n/**\n * Workspace-root configuration.\n *\n * @category models\n * @since 1.0.0-rc.0\n */\nexport interface Service {\n readonly root: string\n}\n\n/**\n * The workspace-root service tag.\n *\n * @category services\n * @since 1.0.0-rc.0\n */\nexport class Workspace extends Context.Service<Workspace, Service>()(\"@smthrs/kernel/Workspace\") {}\n\n/**\n * Constructs workspace-root configuration.\n *\n * @category constructors\n * @since 1.0.0-rc.0\n */\nexport const make = (root: string): Service => Workspace.of({ root })\n\n/**\n * Provides a workspace root.\n *\n * @category layers\n * @since 1.0.0-rc.0\n */\nexport const layer = (root: string): Layer.Layer<Workspace> => Layer.succeed(Workspace, make(root))\n\n/**\n * Constructs a relative workspace-root stub for tests.\n *\n * @category constructors\n * @since 1.0.0-rc.0\n */\nexport const makeNoop: Service = make(\".\")\n\n/**\n * Provides a relative workspace-root stub for tests.\n *\n * @category layers\n * @since 1.0.0-rc.0\n */\nexport const layerNoop: Layer.Layer<Workspace> = Layer.succeed(Workspace, makeNoop)\n"]}
@@ -0,0 +1,161 @@
1
+ /**
2
+ * Capability enforcement at the Host boundary.
3
+ *
4
+ * Every slot of the closed Host surface is decorated in place: a middleware
5
+ * `Layer` over the very tag a platform adapter provides, checking a capability
6
+ * against a `GrantStore` before it delegates. There is no second, protected
7
+ * tag, so code that never heard of the kernel is guarded the moment the layer
8
+ * is composed over its host.
9
+ *
10
+ * @since 1.0.0-rc.0
11
+ */
12
+ /**
13
+ * Capability values, patterns, matching, and effect tiers.
14
+ *
15
+ * @category namespace exports
16
+ * @since 1.0.0-rc.0
17
+ */
18
+ export * as Capability from "@smthrs/capability/Capability";
19
+ /**
20
+ * Monotone ambient authority and intersection.
21
+ *
22
+ * @category namespace exports
23
+ * @since 1.0.0-rc.0
24
+ */
25
+ export * as CapabilitySet from "./CapabilitySet.ts";
26
+ /**
27
+ * The `proc:spawn` middleware over Effect's own `ChildProcessSpawner` tag.
28
+ *
29
+ * @category namespace exports
30
+ * @since 1.0.0-rc.0
31
+ */
32
+ export * as ChildProcessSpawner from "./ChildProcessSpawner.ts";
33
+ /**
34
+ * Least-authority child-process environment construction.
35
+ *
36
+ * @category namespace exports
37
+ * @since 1.0.0-rc.0
38
+ */
39
+ export * as ChildProcessEnvironment from "./ChildProcessEnvironment.ts";
40
+ /**
41
+ * Process containment middleware over Effect's own `ChildProcessSpawner` tag.
42
+ *
43
+ * @category namespace exports
44
+ * @since 1.0.0-rc.0
45
+ */
46
+ export * as ContainedSpawner from "./ContainedSpawner.ts";
47
+ /**
48
+ * Rendering `ChildProcess` commands back to command lines.
49
+ *
50
+ * @category namespace exports
51
+ * @since 1.0.0-rc.0
52
+ */
53
+ export * as CommandLine from "./CommandLine.ts";
54
+ /**
55
+ * The `fs:read`/`fs:write` middleware over Effect's own `FileSystem` tag.
56
+ *
57
+ * @category namespace exports
58
+ * @since 1.0.0-rc.0
59
+ */
60
+ export * as FileSystem from "./FileSystem.ts";
61
+ /**
62
+ * Durable grant decision schemas.
63
+ *
64
+ * @category namespace exports
65
+ * @since 1.0.0-rc.0
66
+ */
67
+ export * as GrantEvent from "./GrantEvent.ts";
68
+ /**
69
+ * Attended and unattended grant-store services.
70
+ *
71
+ * @category namespace exports
72
+ * @since 1.0.0-rc.0
73
+ */
74
+ export * as GrantStore from "./GrantStore.ts";
75
+ /**
76
+ * The union of failures the closed Host surface is allowed to produce.
77
+ *
78
+ * A type, not a namespace: process execution now fails with Effect's own
79
+ * `PlatformError`, so nothing is left here to construct.
80
+ *
81
+ * @category models
82
+ * @since 1.0.0-rc.0
83
+ */
84
+ export type { HostError } from "./HostError.ts";
85
+ /**
86
+ * The closed protected Host service layer.
87
+ *
88
+ * @category namespace exports
89
+ * @since 1.0.0-rc.0
90
+ */
91
+ export * as HostServices from "./HostServices.ts";
92
+ /**
93
+ * The `net:get`/`net:post`/`model:call` middleware over Effect's own
94
+ * `HttpClient` tag.
95
+ *
96
+ * @category namespace exports
97
+ * @since 1.0.0-rc.0
98
+ */
99
+ export * as HttpClient from "./HttpClient.ts";
100
+ /**
101
+ * The jj capability middleware over `@smthrs/jj`'s own `Jj` tag.
102
+ *
103
+ * @category namespace exports
104
+ * @since 1.0.0-rc.0
105
+ */
106
+ export * as Jj from "./Jj.ts";
107
+ /**
108
+ * Journal-backed grant persistence.
109
+ *
110
+ * @category namespace exports
111
+ * @since 1.0.0-rc.0
112
+ */
113
+ export * as JournalGrantStore from "./JournalGrantStore.ts";
114
+ /**
115
+ * The explicit pure path-service decision.
116
+ *
117
+ * @category namespace exports
118
+ * @since 1.0.0-rc.0
119
+ */
120
+ export * as Path from "./Path.ts";
121
+ /**
122
+ * Typed permission errors and policy rules.
123
+ *
124
+ * @category namespace exports
125
+ * @since 1.0.0-rc.0
126
+ */
127
+ export * as Permission from "@smthrs/capability/Permission";
128
+ /**
129
+ * The host's durable record of the processes it started.
130
+ *
131
+ * @category namespace exports
132
+ * @since 1.0.0-rc.0
133
+ */
134
+ export * as ProcessLedger from "./ProcessLedger.ts";
135
+ /**
136
+ * Filesystem, path and process services bound to one root directory.
137
+ *
138
+ * @category namespace exports
139
+ * @since 1.0.0
140
+ */
141
+ export * as Rooted from "./Rooted.ts";
142
+ /**
143
+ * The shared workspace-root service.
144
+ *
145
+ * @category namespace exports
146
+ * @since 1.0.0-rc.0
147
+ */
148
+ export * as Workspace from "./Workspace.ts";
149
+ /** Host process confinement.
150
+ * @category namespace exports
151
+ * @since 1.0.0-rc.1
152
+ */
153
+ export * as ProcessConfinement from "./ProcessConfinement.ts";
154
+ /**
155
+ * Typed connectivity failures and host command exit classification.
156
+ *
157
+ * @category namespace exports
158
+ * @since 1.0.0
159
+ */
160
+ export * as Unreachable from "./Unreachable.ts";
161
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH;;;;;GAKG;AACH,OAAO,KAAK,UAAU,MAAM,+BAA+B,CAAA;AAE3D;;;;;GAKG;AACH,OAAO,KAAK,aAAa,MAAM,oBAAoB,CAAA;AAEnD;;;;;GAKG;AACH,OAAO,KAAK,mBAAmB,MAAM,0BAA0B,CAAA;AAE/D;;;;;GAKG;AACH,OAAO,KAAK,uBAAuB,MAAM,8BAA8B,CAAA;AAEvE;;;;;GAKG;AACH,OAAO,KAAK,gBAAgB,MAAM,uBAAuB,CAAA;AAEzD;;;;;GAKG;AACH,OAAO,KAAK,WAAW,MAAM,kBAAkB,CAAA;AAE/C;;;;;GAKG;AACH,OAAO,KAAK,UAAU,MAAM,iBAAiB,CAAA;AAE7C;;;;;GAKG;AACH,OAAO,KAAK,UAAU,MAAM,iBAAiB,CAAA;AAE7C;;;;;GAKG;AACH,OAAO,KAAK,UAAU,MAAM,iBAAiB,CAAA;AAE7C;;;;;;;;GAQG;AACH,YAAY,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAE/C;;;;;GAKG;AACH,OAAO,KAAK,YAAY,MAAM,mBAAmB,CAAA;AAEjD;;;;;;GAMG;AACH,OAAO,KAAK,UAAU,MAAM,iBAAiB,CAAA;AAE7C;;;;;GAKG;AACH,OAAO,KAAK,EAAE,MAAM,SAAS,CAAA;AAE7B;;;;;GAKG;AACH,OAAO,KAAK,iBAAiB,MAAM,wBAAwB,CAAA;AAE3D;;;;;GAKG;AACH,OAAO,KAAK,IAAI,MAAM,WAAW,CAAA;AAEjC;;;;;GAKG;AACH,OAAO,KAAK,UAAU,MAAM,+BAA+B,CAAA;AAE3D;;;;;GAKG;AACH,OAAO,KAAK,aAAa,MAAM,oBAAoB,CAAA;AAEnD;;;;;GAKG;AACH,OAAO,KAAK,MAAM,MAAM,aAAa,CAAA;AAErC;;;;;GAKG;AACH,OAAO,KAAK,SAAS,MAAM,gBAAgB,CAAA;AAE3C;;;GAGG;AACH,OAAO,KAAK,kBAAkB,MAAM,yBAAyB,CAAA;AAE7D;;;;;GAKG;AACH,OAAO,KAAK,WAAW,MAAM,kBAAkB,CAAA"}
@@ -0,0 +1,151 @@
1
+ /**
2
+ * Capability enforcement at the Host boundary.
3
+ *
4
+ * Every slot of the closed Host surface is decorated in place: a middleware
5
+ * `Layer` over the very tag a platform adapter provides, checking a capability
6
+ * against a `GrantStore` before it delegates. There is no second, protected
7
+ * tag, so code that never heard of the kernel is guarded the moment the layer
8
+ * is composed over its host.
9
+ *
10
+ * @since 1.0.0-rc.0
11
+ */
12
+ /**
13
+ * Capability values, patterns, matching, and effect tiers.
14
+ *
15
+ * @category namespace exports
16
+ * @since 1.0.0-rc.0
17
+ */
18
+ export * as Capability from "@smthrs/capability/Capability";
19
+ /**
20
+ * Monotone ambient authority and intersection.
21
+ *
22
+ * @category namespace exports
23
+ * @since 1.0.0-rc.0
24
+ */
25
+ export * as CapabilitySet from "./CapabilitySet.js";
26
+ /**
27
+ * The `proc:spawn` middleware over Effect's own `ChildProcessSpawner` tag.
28
+ *
29
+ * @category namespace exports
30
+ * @since 1.0.0-rc.0
31
+ */
32
+ export * as ChildProcessSpawner from "./ChildProcessSpawner.js";
33
+ /**
34
+ * Least-authority child-process environment construction.
35
+ *
36
+ * @category namespace exports
37
+ * @since 1.0.0-rc.0
38
+ */
39
+ export * as ChildProcessEnvironment from "./ChildProcessEnvironment.js";
40
+ /**
41
+ * Process containment middleware over Effect's own `ChildProcessSpawner` tag.
42
+ *
43
+ * @category namespace exports
44
+ * @since 1.0.0-rc.0
45
+ */
46
+ export * as ContainedSpawner from "./ContainedSpawner.js";
47
+ /**
48
+ * Rendering `ChildProcess` commands back to command lines.
49
+ *
50
+ * @category namespace exports
51
+ * @since 1.0.0-rc.0
52
+ */
53
+ export * as CommandLine from "./CommandLine.js";
54
+ /**
55
+ * The `fs:read`/`fs:write` middleware over Effect's own `FileSystem` tag.
56
+ *
57
+ * @category namespace exports
58
+ * @since 1.0.0-rc.0
59
+ */
60
+ export * as FileSystem from "./FileSystem.js";
61
+ /**
62
+ * Durable grant decision schemas.
63
+ *
64
+ * @category namespace exports
65
+ * @since 1.0.0-rc.0
66
+ */
67
+ export * as GrantEvent from "./GrantEvent.js";
68
+ /**
69
+ * Attended and unattended grant-store services.
70
+ *
71
+ * @category namespace exports
72
+ * @since 1.0.0-rc.0
73
+ */
74
+ export * as GrantStore from "./GrantStore.js";
75
+ /**
76
+ * The closed protected Host service layer.
77
+ *
78
+ * @category namespace exports
79
+ * @since 1.0.0-rc.0
80
+ */
81
+ export * as HostServices from "./HostServices.js";
82
+ /**
83
+ * The `net:get`/`net:post`/`model:call` middleware over Effect's own
84
+ * `HttpClient` tag.
85
+ *
86
+ * @category namespace exports
87
+ * @since 1.0.0-rc.0
88
+ */
89
+ export * as HttpClient from "./HttpClient.js";
90
+ /**
91
+ * The jj capability middleware over `@smthrs/jj`'s own `Jj` tag.
92
+ *
93
+ * @category namespace exports
94
+ * @since 1.0.0-rc.0
95
+ */
96
+ export * as Jj from "./Jj.js";
97
+ /**
98
+ * Journal-backed grant persistence.
99
+ *
100
+ * @category namespace exports
101
+ * @since 1.0.0-rc.0
102
+ */
103
+ export * as JournalGrantStore from "./JournalGrantStore.js";
104
+ /**
105
+ * The explicit pure path-service decision.
106
+ *
107
+ * @category namespace exports
108
+ * @since 1.0.0-rc.0
109
+ */
110
+ export * as Path from "./Path.js";
111
+ /**
112
+ * Typed permission errors and policy rules.
113
+ *
114
+ * @category namespace exports
115
+ * @since 1.0.0-rc.0
116
+ */
117
+ export * as Permission from "@smthrs/capability/Permission";
118
+ /**
119
+ * The host's durable record of the processes it started.
120
+ *
121
+ * @category namespace exports
122
+ * @since 1.0.0-rc.0
123
+ */
124
+ export * as ProcessLedger from "./ProcessLedger.js";
125
+ /**
126
+ * Filesystem, path and process services bound to one root directory.
127
+ *
128
+ * @category namespace exports
129
+ * @since 1.0.0
130
+ */
131
+ export * as Rooted from "./Rooted.js";
132
+ /**
133
+ * The shared workspace-root service.
134
+ *
135
+ * @category namespace exports
136
+ * @since 1.0.0-rc.0
137
+ */
138
+ export * as Workspace from "./Workspace.js";
139
+ /** Host process confinement.
140
+ * @category namespace exports
141
+ * @since 1.0.0-rc.1
142
+ */
143
+ export * as ProcessConfinement from "./ProcessConfinement.js";
144
+ /**
145
+ * Typed connectivity failures and host command exit classification.
146
+ *
147
+ * @category namespace exports
148
+ * @since 1.0.0
149
+ */
150
+ export * as Unreachable from "./Unreachable.js";
151
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":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MAAM,kBAAkB,CAAA","sourcesContent":["/**\n * Capability enforcement at the Host boundary.\n *\n * Every slot of the closed Host surface is decorated in place: a middleware\n * `Layer` over the very tag a platform adapter provides, checking a capability\n * against a `GrantStore` before it delegates. There is no second, protected\n * tag, so code that never heard of the kernel is guarded the moment the layer\n * is composed over its host.\n *\n * @since 1.0.0-rc.0\n */\n\n/**\n * Capability values, patterns, matching, and effect tiers.\n *\n * @category namespace exports\n * @since 1.0.0-rc.0\n */\nexport * as Capability from \"@smthrs/capability/Capability\"\n\n/**\n * Monotone ambient authority and intersection.\n *\n * @category namespace exports\n * @since 1.0.0-rc.0\n */\nexport * as CapabilitySet from \"./CapabilitySet.ts\"\n\n/**\n * The `proc:spawn` middleware over Effect's own `ChildProcessSpawner` tag.\n *\n * @category namespace exports\n * @since 1.0.0-rc.0\n */\nexport * as ChildProcessSpawner from \"./ChildProcessSpawner.ts\"\n\n/**\n * Least-authority child-process environment construction.\n *\n * @category namespace exports\n * @since 1.0.0-rc.0\n */\nexport * as ChildProcessEnvironment from \"./ChildProcessEnvironment.ts\"\n\n/**\n * Process containment middleware over Effect's own `ChildProcessSpawner` tag.\n *\n * @category namespace exports\n * @since 1.0.0-rc.0\n */\nexport * as ContainedSpawner from \"./ContainedSpawner.ts\"\n\n/**\n * Rendering `ChildProcess` commands back to command lines.\n *\n * @category namespace exports\n * @since 1.0.0-rc.0\n */\nexport * as CommandLine from \"./CommandLine.ts\"\n\n/**\n * The `fs:read`/`fs:write` middleware over Effect's own `FileSystem` tag.\n *\n * @category namespace exports\n * @since 1.0.0-rc.0\n */\nexport * as FileSystem from \"./FileSystem.ts\"\n\n/**\n * Durable grant decision schemas.\n *\n * @category namespace exports\n * @since 1.0.0-rc.0\n */\nexport * as GrantEvent from \"./GrantEvent.ts\"\n\n/**\n * Attended and unattended grant-store services.\n *\n * @category namespace exports\n * @since 1.0.0-rc.0\n */\nexport * as GrantStore from \"./GrantStore.ts\"\n\n/**\n * The union of failures the closed Host surface is allowed to produce.\n *\n * A type, not a namespace: process execution now fails with Effect's own\n * `PlatformError`, so nothing is left here to construct.\n *\n * @category models\n * @since 1.0.0-rc.0\n */\nexport type { HostError } from \"./HostError.ts\"\n\n/**\n * The closed protected Host service layer.\n *\n * @category namespace exports\n * @since 1.0.0-rc.0\n */\nexport * as HostServices from \"./HostServices.ts\"\n\n/**\n * The `net:get`/`net:post`/`model:call` middleware over Effect's own\n * `HttpClient` tag.\n *\n * @category namespace exports\n * @since 1.0.0-rc.0\n */\nexport * as HttpClient from \"./HttpClient.ts\"\n\n/**\n * The jj capability middleware over `@smthrs/jj`'s own `Jj` tag.\n *\n * @category namespace exports\n * @since 1.0.0-rc.0\n */\nexport * as Jj from \"./Jj.ts\"\n\n/**\n * Journal-backed grant persistence.\n *\n * @category namespace exports\n * @since 1.0.0-rc.0\n */\nexport * as JournalGrantStore from \"./JournalGrantStore.ts\"\n\n/**\n * The explicit pure path-service decision.\n *\n * @category namespace exports\n * @since 1.0.0-rc.0\n */\nexport * as Path from \"./Path.ts\"\n\n/**\n * Typed permission errors and policy rules.\n *\n * @category namespace exports\n * @since 1.0.0-rc.0\n */\nexport * as Permission from \"@smthrs/capability/Permission\"\n\n/**\n * The host's durable record of the processes it started.\n *\n * @category namespace exports\n * @since 1.0.0-rc.0\n */\nexport * as ProcessLedger from \"./ProcessLedger.ts\"\n\n/**\n * Filesystem, path and process services bound to one root directory.\n *\n * @category namespace exports\n * @since 1.0.0\n */\nexport * as Rooted from \"./Rooted.ts\"\n\n/**\n * The shared workspace-root service.\n *\n * @category namespace exports\n * @since 1.0.0-rc.0\n */\nexport * as Workspace from \"./Workspace.ts\"\n\n/** Host process confinement.\n * @category namespace exports\n * @since 1.0.0-rc.1\n */\nexport * as ProcessConfinement from \"./ProcessConfinement.ts\"\n\n/**\n * Typed connectivity failures and host command exit classification.\n *\n * @category namespace exports\n * @since 1.0.0\n */\nexport * as Unreachable from \"./Unreachable.ts\"\n"]}
@@ -0,0 +1,24 @@
1
+ /**
2
+ * Trusted composition metadata shared by contained and permission-aware spawners.
3
+ * @since 1.0.0
4
+ */
5
+ import type { ChildProcessSpawner } from "effect/unstable/process/ChildProcessSpawner";
6
+ /**
7
+ * Reads only an own data property, without invoking an accessor.
8
+ * @private
9
+ * @since 1.0.0
10
+ */
11
+ export declare const isContained: (spawner: ChildProcessSpawner["Service"]) => boolean;
12
+ /**
13
+ * Marks a newly constructed service without copying through object spreads.
14
+ * @private
15
+ * @since 1.0.0
16
+ */
17
+ export declare const mark: (spawner: ChildProcessSpawner["Service"]) => ChildProcessSpawner["Service"];
18
+ /**
19
+ * Preserves the declaration on a wrapper that delegates its process lifetime.
20
+ * @private
21
+ * @since 1.0.0
22
+ */
23
+ export declare const inherit: (source: ChildProcessSpawner["Service"], wrapper: ChildProcessSpawner["Service"]) => ChildProcessSpawner["Service"];
24
+ //# sourceMappingURL=Containment.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Containment.d.ts","sourceRoot":"","sources":["../../../src/internal/Containment.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,6CAA6C,CAAA;AAOtF;;;;GAIG;AACH,eAAO,MAAM,WAAW,GAAI,SAAS,mBAAmB,CAAC,SAAS,CAAC,KAAG,OACP,CAAA;AAE/D;;;;GAIG;AACH,eAAO,MAAM,IAAI,GAAI,SAAS,mBAAmB,CAAC,SAAS,CAAC,KAAG,mBAAmB,CAAC,SAAS,CACmB,CAAA;AAE/G;;;;GAIG;AACH,eAAO,MAAM,OAAO,GAClB,QAAQ,mBAAmB,CAAC,SAAS,CAAC,EACtC,SAAS,mBAAmB,CAAC,SAAS,CAAC,KACtC,mBAAmB,CAAC,SAAS,CAAkD,CAAA"}
@@ -0,0 +1,27 @@
1
+ /**
2
+ * Trusted composition metadata shared by contained and permission-aware spawners.
3
+ * @since 1.0.0
4
+ */
5
+ // The registry key also works when a service crosses the ESM/CJS projections.
6
+ // This declares a trusted lifecycle contract; it cannot prove a supplied
7
+ // lifecycle is honest or turn process containment into a security sandbox.
8
+ const key = Symbol.for("@smthrs/kernel/ContainedSpawner/Lifecycle/v1");
9
+ /**
10
+ * Reads only an own data property, without invoking an accessor.
11
+ * @private
12
+ * @since 1.0.0
13
+ */
14
+ export const isContained = (spawner) => Object.getOwnPropertyDescriptor(spawner, key)?.value === true;
15
+ /**
16
+ * Marks a newly constructed service without copying through object spreads.
17
+ * @private
18
+ * @since 1.0.0
19
+ */
20
+ export const mark = (spawner) => Object.defineProperty(spawner, key, { value: true, enumerable: false, writable: false, configurable: false });
21
+ /**
22
+ * Preserves the declaration on a wrapper that delegates its process lifetime.
23
+ * @private
24
+ * @since 1.0.0
25
+ */
26
+ export const inherit = (source, wrapper) => isContained(source) ? mark(wrapper) : wrapper;
27
+ //# sourceMappingURL=Containment.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Containment.js","sourceRoot":"","sources":["../../../src/internal/Containment.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,8EAA8E;AAC9E,yEAAyE;AACzE,2EAA2E;AAC3E,MAAM,GAAG,GAAG,MAAM,CAAC,GAAG,CAAC,8CAA8C,CAAC,CAAA;AAEtE;;;;GAIG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,OAAuC,EAAW,EAAE,CAC9E,MAAM,CAAC,wBAAwB,CAAC,OAAO,EAAE,GAAG,CAAC,EAAE,KAAK,KAAK,IAAI,CAAA;AAE/D;;;;GAIG;AACH,MAAM,CAAC,MAAM,IAAI,GAAG,CAAC,OAAuC,EAAkC,EAAE,CAC9F,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,GAAG,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,YAAY,EAAE,KAAK,EAAE,CAAC,CAAA;AAE/G;;;;GAIG;AACH,MAAM,CAAC,MAAM,OAAO,GAAG,CACrB,MAAsC,EACtC,OAAuC,EACP,EAAE,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,OAAO,CAAA","sourcesContent":["/**\n * Trusted composition metadata shared by contained and permission-aware spawners.\n * @since 1.0.0\n */\n\nimport type { ChildProcessSpawner } from \"effect/unstable/process/ChildProcessSpawner\"\n\n// The registry key also works when a service crosses the ESM/CJS projections.\n// This declares a trusted lifecycle contract; it cannot prove a supplied\n// lifecycle is honest or turn process containment into a security sandbox.\nconst key = Symbol.for(\"@smthrs/kernel/ContainedSpawner/Lifecycle/v1\")\n\n/**\n * Reads only an own data property, without invoking an accessor.\n * @private\n * @since 1.0.0\n */\nexport const isContained = (spawner: ChildProcessSpawner[\"Service\"]): boolean =>\n Object.getOwnPropertyDescriptor(spawner, key)?.value === true\n\n/**\n * Marks a newly constructed service without copying through object spreads.\n * @private\n * @since 1.0.0\n */\nexport const mark = (spawner: ChildProcessSpawner[\"Service\"]): ChildProcessSpawner[\"Service\"] =>\n Object.defineProperty(spawner, key, { value: true, enumerable: false, writable: false, configurable: false })\n\n/**\n * Preserves the declaration on a wrapper that delegates its process lifetime.\n * @private\n * @since 1.0.0\n */\nexport const inherit = (\n source: ChildProcessSpawner[\"Service\"],\n wrapper: ChildProcessSpawner[\"Service\"]\n): ChildProcessSpawner[\"Service\"] => isContained(source) ? mark(wrapper) : wrapper\n"]}
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Pipeline wiring around a per-process spawner, so every leg has its own lifecycle.
3
+ * @since 1.0.0
4
+ */
5
+ import * as Effect from "effect/Effect";
6
+ import type * as PlatformError from "effect/PlatformError";
7
+ import type * as Scope from "effect/Scope";
8
+ import * as ChildProcess from "effect/unstable/process/ChildProcess";
9
+ import { type ChildProcessHandle } from "effect/unstable/process/ChildProcessSpawner";
10
+ type Spawn = (command: ChildProcess.StandardCommand) => Effect.Effect<ChildProcessHandle, PlatformError.PlatformError, Scope.Scope>;
11
+ /**
12
+ * Preserve Effect's rightmost output/status and reverse-order kill/reref semantics.
13
+ * @private
14
+ * @since 1.0.0
15
+ */
16
+ export declare const spawn: (command: ChildProcess.Command, standard: Spawn) => Effect.Effect<ChildProcessHandle, PlatformError.PlatformError, Scope.Scope>;
17
+ export {};
18
+ //# sourceMappingURL=Pipeline.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Pipeline.d.ts","sourceRoot":"","sources":["../../../src/internal/Pipeline.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AAEvC,OAAO,KAAK,KAAK,aAAa,MAAM,sBAAsB,CAAA;AAC1D,OAAO,KAAK,KAAK,KAAK,MAAM,cAAc,CAAA;AAE1C,OAAO,KAAK,YAAY,MAAM,sCAAsC,CAAA;AACpE,OAAO,EAAE,KAAK,kBAAkB,EAAc,MAAM,6CAA6C,CAAA;AAEjG,KAAK,KAAK,GAAG,CACX,OAAO,EAAE,YAAY,CAAC,eAAe,KAClC,MAAM,CAAC,MAAM,CAAC,kBAAkB,EAAE,aAAa,CAAC,aAAa,EAAE,KAAK,CAAC,KAAK,CAAC,CAAA;AAsChF;;;;GAIG;AACH,eAAO,MAAM,KAAK,GAChB,SAAS,YAAY,CAAC,OAAO,EAC7B,UAAU,KAAK,KACd,MAAM,CAAC,MAAM,CAAC,kBAAkB,EAAE,aAAa,CAAC,aAAa,EAAE,KAAK,CAAC,KAAK,CAuBzE,CAAA"}
@@ -0,0 +1,68 @@
1
+ /**
2
+ * Pipeline wiring around a per-process spawner, so every leg has its own lifecycle.
3
+ * @since 1.0.0
4
+ */
5
+ import * as Effect from "effect/Effect";
6
+ import * as Exit from "effect/Exit";
7
+ import * as Stream from "effect/Stream";
8
+ import * as ChildProcess from "effect/unstable/process/ChildProcess";
9
+ import { makeHandle } from "effect/unstable/process/ChildProcessSpawner";
10
+ const source = (handle, from) => {
11
+ if (from === "stderr")
12
+ return handle.stderr;
13
+ if (from === "all")
14
+ return handle.all;
15
+ const fd = from === undefined ? undefined : ChildProcess.parseFdName(from);
16
+ return fd === undefined ? handle.stdout : handle.getOutputFd(fd);
17
+ };
18
+ /** An edge feeds the first process of its destination, including a nested pipeline. */
19
+ const withInput = (command, stream, to) => {
20
+ if (command._tag === "PipedCommand") {
21
+ return ChildProcess.pipeTo(withInput(command.left, stream, to), command.right, command.options);
22
+ }
23
+ const fd = to === undefined ? undefined : ChildProcess.parseFdName(to);
24
+ if (fd !== undefined) {
25
+ return ChildProcess.make(command.command, command.args, {
26
+ ...command.options,
27
+ additionalFds: {
28
+ ...command.options.additionalFds,
29
+ [ChildProcess.fdName(fd)]: { type: "input", stream }
30
+ }
31
+ });
32
+ }
33
+ const stdin = command.options.stdin;
34
+ return ChildProcess.make(command.command, command.args, {
35
+ ...command.options,
36
+ stdin: {
37
+ ...(typeof stdin === "object" && !Stream.isStream(stdin) ? stdin : {}),
38
+ stream
39
+ }
40
+ });
41
+ };
42
+ /**
43
+ * Preserve Effect's rightmost output/status and reverse-order kill/reref semantics.
44
+ * @private
45
+ * @since 1.0.0
46
+ */
47
+ export const spawn = (command, standard) => Effect.gen(function* () {
48
+ if (command._tag === "StandardCommand")
49
+ return yield* standard(command);
50
+ const left = yield* spawn(command.left, standard);
51
+ const right = yield* spawn(withInput(command.right, source(left, command.options.from), command.options.to), standard);
52
+ return makeHandle({
53
+ ...right,
54
+ kill: (options) => Effect.gen(function* () {
55
+ const rightExit = yield* Effect.exit(right.kill(options));
56
+ const leftExit = yield* Effect.exit(left.kill(options));
57
+ if (Exit.isFailure(rightExit))
58
+ return yield* Effect.failCause(rightExit.cause);
59
+ return yield* leftExit;
60
+ }),
61
+ unref: Effect.gen(function* () {
62
+ const leftReref = yield* left.unref;
63
+ const rightReref = yield* right.unref;
64
+ return Effect.andThen(rightReref, leftReref);
65
+ })
66
+ });
67
+ });
68
+ //# sourceMappingURL=Pipeline.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Pipeline.js","sourceR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AC,EAChF,QAAQ,CACT,CAAA;IACD,OAAO,UAAU,CAAC;QAChB,GAAG,KAAK;QACR,IAAI,EAAE,CAAC,OAAO,EAAE,EAAE,CAChB,MAAM,CAAC,GAAG,CAAC,QAAQ,CAAC;YAClB,MAAM,SAAS,GAAG,KAAK,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAA;YACzD,MAAM,QAAQ,GAAG,KAAK,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAA;YACvD,IAAI,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC;gBAAE,OAAO,KAAK,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,SAAS,CAAC,KAAK,CAAC,CAAA;YAC9E,OAAO,KAAK,CAAC,CAAC,QAAQ,CAAA;QACxB,CAAC,CAAC;QACJ,KAAK,EAAE,MAAM,CAAC,GAAG,CAAC,QAAQ,CAAC;YACzB,MAAM,SAAS,GAAG,KAAK,CAAC,CAAC,IAAI,CAAC,KAAK,CAAA;YACnC,MAAM,UAAU,GAAG,KAAK,CAAC,CAAC,KAAK,CAAC,KAAK,CAAA;YACrC,OAAO,MAAM,CAAC,OAAO,CAAC,UAAU,EAAE,SAAS,CAAC,CAAA;QAC9C,CAAC,CAAC;KACH,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA","sourcesContent":["/**\n * Pipeline wiring around a per-process spawner, so every leg has its own lifecycle.\n * @since 1.0.0\n */\n\nimport * as Effect from \"effect/Effect\"\nimport * as Exit from \"effect/Exit\"\nimport type * as PlatformError from \"effect/PlatformError\"\nimport type * as Scope from \"effect/Scope\"\nimport * as Stream from \"effect/Stream\"\nimport * as ChildProcess from \"effect/unstable/process/ChildProcess\"\nimport { type ChildProcessHandle, makeHandle } from \"effect/unstable/process/ChildProcessSpawner\"\n\ntype Spawn = (\n command: ChildProcess.StandardCommand\n) => Effect.Effect<ChildProcessHandle, PlatformError.PlatformError, Scope.Scope>\n\nconst source = (handle: ChildProcessHandle, from: ChildProcess.PipeFromOption | undefined) => {\n if (from === \"stderr\") return handle.stderr\n if (from === \"all\") return handle.all\n const fd = from === undefined ? undefined : ChildProcess.parseFdName(from)\n return fd === undefined ? handle.stdout : handle.getOutputFd(fd)\n}\n\n/** An edge feeds the first process of its destination, including a nested pipeline. */\nconst withInput = (\n command: ChildProcess.Command,\n stream: Stream.Stream<Uint8Array, PlatformError.PlatformError>,\n to: ChildProcess.PipeToOption | undefined\n): ChildProcess.Command => {\n if (command._tag === \"PipedCommand\") {\n return ChildProcess.pipeTo(withInput(command.left, stream, to), command.right, command.options)\n }\n const fd = to === undefined ? undefined : ChildProcess.parseFdName(to)\n if (fd !== undefined) {\n return ChildProcess.make(command.command, command.args, {\n ...command.options,\n additionalFds: {\n ...command.options.additionalFds,\n [ChildProcess.fdName(fd)]: { type: \"input\", stream }\n }\n })\n }\n const stdin = command.options.stdin\n return ChildProcess.make(command.command, command.args, {\n ...command.options,\n stdin: {\n ...(typeof stdin === \"object\" && !Stream.isStream(stdin) ? stdin : {}),\n stream\n }\n })\n}\n\n/**\n * Preserve Effect's rightmost output/status and reverse-order kill/reref semantics.\n * @private\n * @since 1.0.0\n */\nexport const spawn = (\n command: ChildProcess.Command,\n standard: Spawn\n): Effect.Effect<ChildProcessHandle, PlatformError.PlatformError, Scope.Scope> =>\n Effect.gen(function*() {\n if (command._tag === \"StandardCommand\") return yield* standard(command)\n const left = yield* spawn(command.left, standard)\n const right = yield* spawn(\n withInput(command.right, source(left, command.options.from), command.options.to),\n standard\n )\n return makeHandle({\n ...right,\n kill: (options) =>\n Effect.gen(function*() {\n const rightExit = yield* Effect.exit(right.kill(options))\n const leftExit = yield* Effect.exit(left.kill(options))\n if (Exit.isFailure(rightExit)) return yield* Effect.failCause(rightExit.cause)\n return yield* leftExit\n }),\n unref: Effect.gen(function*() {\n const leftReref = yield* left.unref\n const rightReref = yield* right.unref\n return Effect.andThen(rightReref, leftReref)\n })\n })\n })\n"]}
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Typed capability construction for host decorators.
3
+ *
4
+ * @since 1.0.0-rc.0
5
+ */
6
+ import * as Capability from "@smthrs/capability/Capability";
7
+ import { GrantStoreError } from "@smthrs/capability/Permission";
8
+ import { Effect } from "effect";
9
+ /**
10
+ * Constructs decorator requests without leaking schema failures as defects.
11
+ *
12
+ * @category constructors
13
+ * @since 1.0.0-rc.0
14
+ */
15
+ export declare const makeCapability: (action: Capability.Action, resource: string) => Effect.Effect<Capability.Capability, GrantStoreError, never>;
16
+ //# sourceMappingURL=makeCapability.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"makeCapability.d.ts","sourceRoot":"","sources":["../../../src/internal/makeCapability.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,UAAU,MAAM,+BAA+B,CAAA;AAC3D,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAA;AAC/D,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAE/B;;;;;GAKG;AACH,eAAO,MAAM,cAAc,GAAI,QAAQ,UAAU,CAAC,MAAM,EAAE,UAAU,MAAM,iEAStE,CAAA"}
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Typed capability construction for host decorators.
3
+ *
4
+ * @since 1.0.0-rc.0
5
+ */
6
+ import * as Capability from "@smthrs/capability/Capability";
7
+ import { GrantStoreError } from "@smthrs/capability/Permission";
8
+ import { Effect } from "effect";
9
+ /**
10
+ * Constructs decorator requests without leaking schema failures as defects.
11
+ *
12
+ * @category constructors
13
+ * @since 1.0.0-rc.0
14
+ */
15
+ export const makeCapability = (action, resource) => Effect.try({
16
+ try: () => Capability.make(action, resource),
17
+ catch: () => new GrantStoreError({
18
+ code: "invalid_resolution",
19
+ message: `capability requires a valid action and a resource within maximumCapabilityResourceLength (${Capability.maxResourceLength} UTF-16 code units)`
20
+ })
21
+ });
22
+ //# sourceMappingURL=makeCapability.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"makeCapability.js","sourceRoot":"","sources":["../../../src/internal/makeCapability.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,UAAU,MAAM,+BAA+B,CAAA;AAC3D,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAA;AAC/D,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAE/B;;;;;GAKG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,MAAyB,EAAE,QAAgB,EAAE,EAAE,CAC5E,MAAM,CAAC,GAAG,CAAC;IACT,GAAG,EAAE,GAAG,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,MAAM,EAAE,QAAQ,CAAC;IAC5C,KAAK,EAAE,GAAG,EAAE,CACV,IAAI,eAAe,CAAC;QAClB,IAAI,EAAE,oBAAoB;QAC1B,OAAO,EACL,6FAA6F,UAAU,CAAC,iBAAiB,qBAAqB;KACjJ,CAAC;CACL,CAAC,CAAA","sourcesContent":["/**\n * Typed capability construction for host decorators.\n *\n * @since 1.0.0-rc.0\n */\n\nimport * as Capability from \"@smthrs/capability/Capability\"\nimport { GrantStoreError } from \"@smthrs/capability/Permission\"\nimport { Effect } from \"effect\"\n\n/**\n * Constructs decorator requests without leaking schema failures as defects.\n *\n * @category constructors\n * @since 1.0.0-rc.0\n */\nexport const makeCapability = (action: Capability.Action, resource: string) =>\n Effect.try({\n try: () => Capability.make(action, resource),\n catch: () =>\n new GrantStoreError({\n code: \"invalid_resolution\",\n message:\n `capability requires a valid action and a resource within maximumCapabilityResourceLength (${Capability.maxResourceLength} UTF-16 code units)`\n })\n })\n"]}
@@ -0,0 +1,15 @@
1
+ /**
2
+ * The optional atomic batch portion of the shared host contract.
3
+ *
4
+ * @since 1.0.0
5
+ */
6
+ import { Effect, type FileSystem, Path } from "effect";
7
+ /**
8
+ * Exercises every advertised batch implementation over the host contract's
9
+ * fresh `source.txt` fixture. Isolated volumes may omit this optimization.
10
+ *
11
+ * @since 1.0.0
12
+ * @category testing
13
+ */
14
+ export declare const check: (fs: FileSystem.FileSystem, root: string) => Effect.Effect<void, import("effect/PlatformError").PlatformError, Path.Path>;
15
+ //# sourceMappingURL=FileSystemBatchContract.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FileSystemBatchContract.d.ts","sourceRoot":"","sources":["../../../src/test/FileSystemBatchContract.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAAE,MAAM,EAAE,KAAK,UAAU,EAAU,IAAI,EAAU,MAAM,QAAQ,CAAA;AAGtE;;;;;;GAMG;AACH,eAAO,MAAM,KAAK,GAAI,IAAI,UAAU,CAAC,UAAU,EAAE,MAAM,MAAM,iFAyCzD,CAAA"}