@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
package/package.json CHANGED
@@ -1,6 +1,347 @@
1
1
  {
2
2
  "name": "@smthrs/kernel",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
3
+ "type": "module",
4
+ "version": "1.0.0-rc.4",
5
+ "license": "MIT",
6
+ "smthrs": {
7
+ "group": "engine"
8
+ },
9
+ "description": "Capability kernel: effect tiers, monotone capability sets, grant store, and permission-decorating layers over the Host services",
10
+ "homepage": "https://github.com/smithersai/smithers",
11
+ "repository": {
12
+ "type": "git",
13
+ "url": "https://github.com/smithersai/smithers.git",
14
+ "directory": "packages/smithers/flows/kernel"
15
+ },
16
+ "bugs": {
17
+ "url": "https://github.com/smithersai/smithers/issues"
18
+ },
19
+ "tags": [
20
+ "typescript",
21
+ "effect",
22
+ "flow",
23
+ "capabilities"
24
+ ],
25
+ "keywords": [
26
+ "typescript",
27
+ "effect",
28
+ "flow",
29
+ "capabilities"
30
+ ],
31
+ "engines": {
32
+ "node": ">=26.4.0"
33
+ },
34
+ "sideEffects": [],
35
+ "exports": {
36
+ "./package.json": "./package.json",
37
+ ".": {
38
+ "import": {
39
+ "types": "./dist/esm/index.d.ts",
40
+ "default": "./dist/esm/index.js"
41
+ },
42
+ "require": {
43
+ "types": "./dist/cjs/index.d.ts",
44
+ "default": "./dist/cjs/index.js"
45
+ }
46
+ },
47
+ "./test/contract": {
48
+ "import": {
49
+ "types": "./dist/esm/test/HostContract.d.ts",
50
+ "default": "./dist/esm/test/HostContract.js"
51
+ },
52
+ "require": {
53
+ "types": "./dist/cjs/test/HostContract.d.ts",
54
+ "default": "./dist/cjs/test/HostContract.js"
55
+ }
56
+ },
57
+ "./internal/*": null,
58
+ "./*/index": null,
59
+ "./CapabilitySet": {
60
+ "import": {
61
+ "types": "./dist/esm/CapabilitySet.d.ts",
62
+ "default": "./dist/esm/CapabilitySet.js"
63
+ },
64
+ "require": {
65
+ "types": "./dist/cjs/CapabilitySet.d.ts",
66
+ "default": "./dist/cjs/CapabilitySet.js"
67
+ }
68
+ },
69
+ "./ChildProcessSpawner": {
70
+ "import": {
71
+ "types": "./dist/esm/ChildProcessSpawner.d.ts",
72
+ "default": "./dist/esm/ChildProcessSpawner.js"
73
+ },
74
+ "require": {
75
+ "types": "./dist/cjs/ChildProcessSpawner.d.ts",
76
+ "default": "./dist/cjs/ChildProcessSpawner.js"
77
+ }
78
+ },
79
+ "./CommandLine": {
80
+ "import": {
81
+ "types": "./dist/esm/CommandLine.d.ts",
82
+ "default": "./dist/esm/CommandLine.js"
83
+ },
84
+ "require": {
85
+ "types": "./dist/cjs/CommandLine.d.ts",
86
+ "default": "./dist/cjs/CommandLine.js"
87
+ }
88
+ },
89
+ "./ContainedSpawner": {
90
+ "import": {
91
+ "types": "./dist/esm/ContainedSpawner.d.ts",
92
+ "default": "./dist/esm/ContainedSpawner.js"
93
+ },
94
+ "require": {
95
+ "types": "./dist/cjs/ContainedSpawner.d.ts",
96
+ "default": "./dist/cjs/ContainedSpawner.js"
97
+ }
98
+ },
99
+ "./FileSystem": {
100
+ "import": {
101
+ "types": "./dist/esm/FileSystem.d.ts",
102
+ "default": "./dist/esm/FileSystem.js"
103
+ },
104
+ "require": {
105
+ "types": "./dist/cjs/FileSystem.d.ts",
106
+ "default": "./dist/cjs/FileSystem.js"
107
+ }
108
+ },
109
+ "./GrantEvent": {
110
+ "import": {
111
+ "types": "./dist/esm/GrantEvent.d.ts",
112
+ "default": "./dist/esm/GrantEvent.js"
113
+ },
114
+ "require": {
115
+ "types": "./dist/cjs/GrantEvent.d.ts",
116
+ "default": "./dist/cjs/GrantEvent.js"
117
+ }
118
+ },
119
+ "./GrantStore": {
120
+ "import": {
121
+ "types": "./dist/esm/GrantStore.d.ts",
122
+ "default": "./dist/esm/GrantStore.js"
123
+ },
124
+ "require": {
125
+ "types": "./dist/cjs/GrantStore.d.ts",
126
+ "default": "./dist/cjs/GrantStore.js"
127
+ }
128
+ },
129
+ "./HostError": {
130
+ "import": {
131
+ "types": "./dist/esm/HostError.d.ts",
132
+ "default": "./dist/esm/HostError.js"
133
+ },
134
+ "require": {
135
+ "types": "./dist/cjs/HostError.d.ts",
136
+ "default": "./dist/cjs/HostError.js"
137
+ }
138
+ },
139
+ "./HostServices": {
140
+ "import": {
141
+ "types": "./dist/esm/HostServices.d.ts",
142
+ "default": "./dist/esm/HostServices.js"
143
+ },
144
+ "require": {
145
+ "types": "./dist/cjs/HostServices.d.ts",
146
+ "default": "./dist/cjs/HostServices.js"
147
+ }
148
+ },
149
+ "./HttpClient": {
150
+ "import": {
151
+ "types": "./dist/esm/HttpClient.d.ts",
152
+ "default": "./dist/esm/HttpClient.js"
153
+ },
154
+ "require": {
155
+ "types": "./dist/cjs/HttpClient.d.ts",
156
+ "default": "./dist/cjs/HttpClient.js"
157
+ }
158
+ },
159
+ "./Jj": {
160
+ "import": {
161
+ "types": "./dist/esm/Jj.d.ts",
162
+ "default": "./dist/esm/Jj.js"
163
+ },
164
+ "require": {
165
+ "types": "./dist/cjs/Jj.d.ts",
166
+ "default": "./dist/cjs/Jj.js"
167
+ }
168
+ },
169
+ "./JournalGrantStore": {
170
+ "import": {
171
+ "types": "./dist/esm/JournalGrantStore.d.ts",
172
+ "default": "./dist/esm/JournalGrantStore.js"
173
+ },
174
+ "require": {
175
+ "types": "./dist/cjs/JournalGrantStore.d.ts",
176
+ "default": "./dist/cjs/JournalGrantStore.js"
177
+ }
178
+ },
179
+ "./Path": {
180
+ "import": {
181
+ "types": "./dist/esm/Path.d.ts",
182
+ "default": "./dist/esm/Path.js"
183
+ },
184
+ "require": {
185
+ "types": "./dist/cjs/Path.d.ts",
186
+ "default": "./dist/cjs/Path.js"
187
+ }
188
+ },
189
+ "./ProcessLedger": {
190
+ "import": {
191
+ "types": "./dist/esm/ProcessLedger.d.ts",
192
+ "default": "./dist/esm/ProcessLedger.js"
193
+ },
194
+ "require": {
195
+ "types": "./dist/cjs/ProcessLedger.d.ts",
196
+ "default": "./dist/cjs/ProcessLedger.js"
197
+ }
198
+ },
199
+ "./Rooted": {
200
+ "import": {
201
+ "types": "./dist/esm/Rooted.d.ts",
202
+ "default": "./dist/esm/Rooted.js"
203
+ },
204
+ "require": {
205
+ "types": "./dist/cjs/Rooted.d.ts",
206
+ "default": "./dist/cjs/Rooted.js"
207
+ }
208
+ },
209
+ "./Workspace": {
210
+ "import": {
211
+ "types": "./dist/esm/Workspace.d.ts",
212
+ "default": "./dist/esm/Workspace.js"
213
+ },
214
+ "require": {
215
+ "types": "./dist/cjs/Workspace.d.ts",
216
+ "default": "./dist/cjs/Workspace.js"
217
+ }
218
+ },
219
+ "./index": {
220
+ "import": {
221
+ "types": "./dist/esm/index.d.ts",
222
+ "default": "./dist/esm/index.js"
223
+ },
224
+ "require": {
225
+ "types": "./dist/cjs/index.d.ts",
226
+ "default": "./dist/cjs/index.js"
227
+ }
228
+ },
229
+ "./test/HostContract": {
230
+ "import": {
231
+ "types": "./dist/esm/test/HostContract.d.ts",
232
+ "default": "./dist/esm/test/HostContract.js"
233
+ },
234
+ "require": {
235
+ "types": "./dist/cjs/test/HostContract.d.ts",
236
+ "default": "./dist/cjs/test/HostContract.js"
237
+ }
238
+ },
239
+ "./test/TestGrantStore": {
240
+ "import": {
241
+ "types": "./dist/esm/test/TestGrantStore.d.ts",
242
+ "default": "./dist/esm/test/TestGrantStore.js"
243
+ },
244
+ "require": {
245
+ "types": "./dist/cjs/test/TestGrantStore.d.ts",
246
+ "default": "./dist/cjs/test/TestGrantStore.js"
247
+ }
248
+ },
249
+ "./ChildProcessEnvironment": {
250
+ "import": {
251
+ "types": "./dist/esm/ChildProcessEnvironment.d.ts",
252
+ "default": "./dist/esm/ChildProcessEnvironment.js"
253
+ },
254
+ "require": {
255
+ "types": "./dist/cjs/ChildProcessEnvironment.d.ts",
256
+ "default": "./dist/cjs/ChildProcessEnvironment.js"
257
+ }
258
+ },
259
+ "./ProcessConfinement": {
260
+ "import": {
261
+ "types": "./dist/esm/ProcessConfinement.d.ts",
262
+ "default": "./dist/esm/ProcessConfinement.js"
263
+ },
264
+ "require": {
265
+ "types": "./dist/cjs/ProcessConfinement.d.ts",
266
+ "default": "./dist/cjs/ProcessConfinement.js"
267
+ }
268
+ },
269
+ "./Unreachable": {
270
+ "import": {
271
+ "types": "./dist/esm/Unreachable.d.ts",
272
+ "default": "./dist/esm/Unreachable.js"
273
+ },
274
+ "require": {
275
+ "types": "./dist/cjs/Unreachable.d.ts",
276
+ "default": "./dist/cjs/Unreachable.js"
277
+ }
278
+ }
279
+ },
280
+ "files": [
281
+ "src/**/*.ts",
282
+ "dist/**/*.js",
283
+ "dist/**/*.js.map",
284
+ "dist/**/*.d.ts",
285
+ "dist/**/*.d.ts.map",
286
+ "dist/**/package.json",
287
+ "LICENSE",
288
+ "README.md",
289
+ "CHANGELOG.md",
290
+ "docs/"
291
+ ],
292
+ "publishConfig": {
293
+ "access": "public",
294
+ "provenance": true,
295
+ "tag": "next"
296
+ },
297
+ "dependencies": {
298
+ "@smthrs/capability": "1.0.0-rc.4",
299
+ "@smthrs/crypto": "1.0.0-rc.4",
300
+ "@smthrs/jj": "1.0.0-rc.4",
301
+ "@smthrs/journal": "1.0.0-rc.4"
302
+ },
303
+ "peerDependencies": {
304
+ "@effect/vitest": "4.0.0-rc.115",
305
+ "effect": "4.0.0-rc.115",
306
+ "vitest": "5.0.0"
307
+ },
308
+ "peerDependenciesMeta": {
309
+ "@effect/vitest": {
310
+ "optional": true
311
+ },
312
+ "vitest": {
313
+ "optional": true
314
+ }
315
+ },
316
+ "devDependencies": {
317
+ "@effect/language-service": "0.87.2",
318
+ "@effect/platform-node": "4.0.0-rc.115",
319
+ "@effect/vitest": "4.0.0-rc.115",
320
+ "@eslint/js": "9.39.5",
321
+ "@smthrs/database": "1.0.0-rc.4",
322
+ "@types/node": "26.4.1",
323
+ "@vitest/coverage-v8": "5.0.0",
324
+ "dprint": "0.57.1",
325
+ "effect": "4.0.0-rc.115",
326
+ "esbuild": "0.28.2",
327
+ "eslint": "9.39.5",
328
+ "eslint-import-resolver-typescript": "4.4.5",
329
+ "eslint-plugin-import": "2.32.0",
330
+ "eslint-plugin-jsdoc": "64.3.4",
331
+ "eslint-plugin-unicorn": "65.0.0",
332
+ "madge": "8.0.0",
333
+ "typescript": "5.9.3",
334
+ "typescript-eslint": "8.69.0",
335
+ "vitest": "5.0.0",
336
+ "fast-check": "4.9.0"
337
+ },
338
+ "scripts": {
339
+ "lint": "eslint src --max-warnings=0 && dprint check",
340
+ "format": "dprint fmt",
341
+ "build": "node scripts/build.mjs",
342
+ "check": "tsc -b tsconfig.json && tsc -p tsconfig.test.json --noEmit",
343
+ "circular": "node scripts/circular.mjs",
344
+ "test": "vitest",
345
+ "coverage": "vitest --coverage"
346
+ }
6
347
  }
@@ -0,0 +1,6 @@
1
+ /**
2
+ * The shared monotone authority implementation used by declarations and guards.
3
+ * @since 1.0.0
4
+ */
5
+
6
+ export * from "@smthrs/capability/CapabilitySet"
@@ -0,0 +1,98 @@
1
+ /**
2
+ * Least-authority environment construction for child processes.
3
+ *
4
+ * @since 1.0.0-rc.0
5
+ */
6
+
7
+ /**
8
+ * Credential-bearing field names shared with the model request boundary.
9
+ *
10
+ * `token`, `key` (optionally followed by a separated `id`), and `pat` are
11
+ * anchored to complete or separator-delimited suffixes so names such as
12
+ * `TOKEN_COUNT` and `KEYBOARD` remain ordinary diagnostics. Keeping this rule
13
+ * below the model and process layers gives request validation and child
14
+ * spawning one definition of a sensitive name.
15
+ *
16
+ * @category constants
17
+ * @since 1.0.0-rc.0
18
+ */
19
+ export const credentialNamePattern =
20
+ /authorization|api[-_]?key|access[-_]?token|refresh[-_]?token|id[-_]?token|auth[-_]?token|api[-_]?token|session[-_]?token|bearer|(?:^|[-_])token$|(?:^|[-_])key(?:[-_]id)?$|(?:^|[-_])pat$|secret|credential|password|passphrase|passwd|signature|x-amz-signature|cookie|set[-_]?cookie|chatgpt[-_]?account[-_]?id/i
21
+
22
+ /**
23
+ * Reports whether a field name conventionally carries credentials.
24
+ *
25
+ * @category predicates
26
+ * @since 1.0.0-rc.0
27
+ */
28
+ export const isCredentialName = (name: string): boolean => credentialNamePattern.test(name)
29
+
30
+ /**
31
+ * Ambient variables a child may inherit for executable lookup, identity,
32
+ * locale, terminal behavior, temporary files, and its shell.
33
+ *
34
+ * Locale category variables are admitted separately by their `LC_` prefix.
35
+ *
36
+ * @category constants
37
+ * @since 1.0.0-rc.0
38
+ */
39
+ export const inheritedNames: ReadonlyArray<string> = Object.freeze([
40
+ "PATH",
41
+ "HOME",
42
+ "USER",
43
+ "LANG",
44
+ "TERM",
45
+ "TMPDIR",
46
+ "SHELL"
47
+ ])
48
+
49
+ const inherited = new Set(inheritedNames)
50
+
51
+ /**
52
+ * Reports whether a variable belongs to the bootstrap set {@link make}
53
+ * inherits: one of {@link inheritedNames} or a locale `LC_` category,
54
+ * compared case-insensitively.
55
+ *
56
+ * @category predicates
57
+ * @since 1.0.0-rc.1
58
+ */
59
+ export const isInheritedName = (name: string): boolean => {
60
+ const canonical = name.toUpperCase()
61
+ return inherited.has(canonical) || canonical.startsWith("LC_")
62
+ }
63
+
64
+ const remove = (environment: Record<string, string>, name: string): void => {
65
+ const canonical = name.toUpperCase()
66
+ for (const present of Object.keys(environment)) {
67
+ if (present.toUpperCase() === canonical) delete environment[present]
68
+ }
69
+ }
70
+
71
+ /**
72
+ * Selects the bootstrap allowlist from an ambient environment and overlays
73
+ * caller-declared names.
74
+ *
75
+ * Sensitive-looking ambient names are withheld even if a future bootstrap
76
+ * list grows to include one. A caller declaration is applied last because it
77
+ * is the explicit authority for that child; an `undefined` declaration
78
+ * removes an inherited name. The returned null-prototype record is always
79
+ * suitable as a replacement environment and never asks the spawner to merge
80
+ * the rest of the host process environment.
81
+ *
82
+ * @category constructors
83
+ * @since 1.0.0-rc.0
84
+ */
85
+ export const make = (
86
+ ambient: Readonly<Record<string, string | undefined>>,
87
+ declared: Readonly<Record<string, string | undefined>> = {}
88
+ ): Record<string, string> => {
89
+ const environment = Object.create(null) as Record<string, string>
90
+ for (const [name, value] of Object.entries(ambient)) {
91
+ if (value !== undefined && isInheritedName(name) && !isCredentialName(name)) environment[name] = value
92
+ }
93
+ for (const [name, value] of Object.entries(declared)) {
94
+ remove(environment, name)
95
+ if (value !== undefined) environment[name] = value
96
+ }
97
+ return environment
98
+ }