@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,452 @@
1
+ /**
2
+ * Permission-aware filesystem operations.
3
+ *
4
+ * There is no kernel `FileSystem` interface and no kernel `FileSystem` tag.
5
+ * Effect owns both, and its tag fixes the error channel to `PlatformError`, so
6
+ * this module is only the middleware: a `Layer` over Effect's own tag that
7
+ * reads the raw service out of context and returns a guarded one in its place.
8
+ * Permission failures are projected into `PlatformError` by
9
+ * `Permission.toPlatformError`, which keeps the structured kernel failure on
10
+ * the error's `cause`.
11
+ *
12
+ * Governing design:
13
+ * `docs/specs/Concepts/Permission Kernel.md`,
14
+ * `docs/specs/Concepts/Effect Taxonomy.md`, and
15
+ * `docs/specs/Concepts/Host Adapters.md`.
16
+ *
17
+ * @since 1.0.0-rc.0
18
+ */
19
+ import { Effect, FileSystem as EffectFileSystem, Layer, Path as EffectPath, PlatformError, Result, Schema } from "effect";
20
+ import * as Batch from "./FileSystemBatch.ts";
21
+ import { GrantStore } from "./GrantStore.ts";
22
+ import { Workspace } from "./Workspace.ts";
23
+ export * from "./FileSystemBatch.ts";
24
+ /**
25
+ * The directory name that stands in for the host's system temporary directory
26
+ * in a capability resource. `makeTempFile` and friends called without an
27
+ * explicit `directory` are checked against this name resolved one level above
28
+ * the workspace root, so an implicit system-temp write names a resource that
29
+ * is always outside the workspace envelope and is never confusable with a real
30
+ * workspace path.
31
+ *
32
+ * @since 1.0.0-rc.0
33
+ * @category models
34
+ */
35
+ export declare const systemTemporaryDirectoryName = "<system-temp>";
36
+ /**
37
+ * Host-private extension used for race-free, descriptor-relative filesystem
38
+ * operations. A plain path-based `FileSystem` cannot provide confinement: an
39
+ * attacker can replace any checked component before the delegate resolves it.
40
+ * Platform adapters opt in only when they can pin a root handle and reject
41
+ * symlinks while traversing from it. Hosts without this extension fail closed.
42
+ *
43
+ * @since 1.0.0-rc.0
44
+ * @category security
45
+ */
46
+ export declare const AtomicFileSystemTypeId: unique symbol;
47
+ /** The pinned root every atomic request is resolved against.
48
+ *
49
+ * The guarded layer fills these in at the boundary from the composed
50
+ * workspace, so a caller that builds a request leaves them out.
51
+ *
52
+ * @since 1.0.0-rc.0
53
+ * @category security
54
+ */
55
+ export interface AtomicRoot {
56
+ readonly boundaryRoot?: string | undefined;
57
+ readonly logicalRoot?: string | undefined;
58
+ readonly rootIdentity?: string | undefined;
59
+ }
60
+ /** A serializable operation executed relative to a pinned filesystem root.
61
+ *
62
+ * One member per operation, discriminated by `operation`, so a request cannot
63
+ * omit an operand its operation needs — a `rename` carries both endpoints or
64
+ * does not compile — and an adapter cannot quietly leave an operation
65
+ * unimplemented. Every member is the same flat JSON object the helper protocol
66
+ * already framed, so the wire shape is unchanged.
67
+ *
68
+ * @since 1.0.0-rc.0
69
+ * @category security
70
+ */
71
+ export type AtomicRequest = (AtomicRoot & {
72
+ readonly operation: "exists";
73
+ readonly path: string;
74
+ }) | (AtomicRoot & {
75
+ readonly operation: "chmod";
76
+ readonly path: string;
77
+ readonly options: {
78
+ readonly mode: number;
79
+ };
80
+ }) | (AtomicRoot & {
81
+ readonly operation: "chown";
82
+ readonly path: string;
83
+ readonly options: {
84
+ readonly uid: number;
85
+ readonly gid: number;
86
+ };
87
+ }) | (AtomicRoot & {
88
+ readonly operation: "glob";
89
+ readonly pattern: string;
90
+ readonly root: string;
91
+ readonly options?: {
92
+ readonly exclude?: ReadonlyArray<string> | undefined;
93
+ } | undefined;
94
+ }) | (AtomicRoot & {
95
+ readonly operation: "makeDirectory";
96
+ readonly path: string;
97
+ readonly options?: {
98
+ readonly recursive?: boolean | undefined;
99
+ readonly mode?: number | undefined;
100
+ } | undefined;
101
+ }) | (AtomicRoot & {
102
+ readonly operation: "readDirectory";
103
+ readonly path: string;
104
+ readonly options?: {
105
+ readonly recursive?: boolean | undefined;
106
+ } | undefined;
107
+ }) | (AtomicRoot & {
108
+ readonly operation: "readFile";
109
+ readonly path: string;
110
+ }) | (AtomicRoot & {
111
+ readonly operation: "readFileString";
112
+ readonly path: string;
113
+ readonly encoding?: string | undefined;
114
+ }) | (AtomicRoot & {
115
+ readonly operation: "readLink";
116
+ readonly path: string;
117
+ }) | (AtomicRoot & {
118
+ readonly operation: "realPath";
119
+ readonly path: string;
120
+ }) | (AtomicRoot & {
121
+ readonly operation: "resolve";
122
+ readonly path: string;
123
+ }) | (AtomicRoot & {
124
+ readonly operation: "remove";
125
+ readonly path: string;
126
+ readonly options?: {
127
+ readonly recursive?: boolean | undefined;
128
+ readonly force?: boolean | undefined;
129
+ } | undefined;
130
+ }) | (AtomicRoot & {
131
+ readonly operation: "rename";
132
+ readonly from: string;
133
+ readonly to: string;
134
+ }) | (AtomicRoot & {
135
+ readonly operation: "stat";
136
+ readonly path: string;
137
+ }) | (AtomicRoot & {
138
+ readonly operation: "writeFile";
139
+ readonly path: string;
140
+ /** Base64 of the bytes, bounded by the host's `contentLimit`. */
141
+ readonly data: string;
142
+ readonly options?: {
143
+ readonly flag?: EffectFileSystem.OpenFlag | undefined;
144
+ readonly mode?: number | undefined;
145
+ } | undefined;
146
+ }) | (AtomicRoot & {
147
+ readonly operation: "writeFileString";
148
+ readonly path: string;
149
+ readonly data: string;
150
+ readonly options?: {
151
+ readonly flag?: EffectFileSystem.OpenFlag | undefined;
152
+ readonly mode?: number | undefined;
153
+ } | undefined;
154
+ }) | (AtomicRoot & {
155
+ readonly operation: "batch";
156
+ readonly requests: ReadonlyArray<AtomicBatchRequest>;
157
+ });
158
+ /** Where a no-follow executor's `resolve` walk stopped.
159
+ *
160
+ * `path` is the canonical path the walk reached below the pinned root, in
161
+ * on-disk spelling for every existing component. When `target` is `null`,
162
+ * `path` is the whole request, with a missing component and its descendants
163
+ * kept as requested. Otherwise `path` names the first link or reparse point
164
+ * on the way and `target` is its text, which the executor read without
165
+ * opening what it names.
166
+ *
167
+ * @since 1.0.0-rc.1
168
+ * @category security
169
+ */
170
+ export interface Resolution {
171
+ readonly path: string;
172
+ readonly target: string | null;
173
+ }
174
+ /** One member of an executor batch: a public read, or authorization's `resolve`.
175
+ *
176
+ * @since 1.0.0-rc.1
177
+ * @category security
178
+ */
179
+ export type AtomicBatchRequest = Batch.BatchRequest | {
180
+ readonly operation: "resolve";
181
+ readonly path: string;
182
+ };
183
+ /** One member's value in an executor batch.
184
+ *
185
+ * @since 1.0.0-rc.1
186
+ * @category security
187
+ */
188
+ export type AtomicBatchValue = Batch.BatchValue | {
189
+ readonly operation: "resolve";
190
+ readonly resolution: Resolution;
191
+ };
192
+ /** An executor batch's answer: {@link Batch.BatchResponse} over {@link AtomicBatchValue}.
193
+ *
194
+ * @since 1.0.0-rc.1
195
+ * @category security
196
+ */
197
+ export interface AtomicBatchResponse {
198
+ readonly rootIdentity: string;
199
+ readonly entries: ReadonlyArray<{
200
+ readonly index: number;
201
+ readonly path: string;
202
+ readonly result: Result.Result<AtomicBatchValue, PlatformError.PlatformError>;
203
+ }>;
204
+ }
205
+ /** The value each atomic operation resolves to.
206
+ *
207
+ * The executor no longer takes the result type from its caller: an operation
208
+ * names its own result here, so a host that answers a `stat` with a boolean is
209
+ * a compile error rather than a decode that succeeds and reads wrong.
210
+ *
211
+ * @since 1.0.0-rc.0
212
+ * @category security
213
+ */
214
+ export interface AtomicResults {
215
+ readonly exists: boolean;
216
+ readonly chmod: void;
217
+ readonly chown: void;
218
+ readonly glob: Array<string>;
219
+ readonly makeDirectory: void;
220
+ readonly readDirectory: Array<string>;
221
+ readonly readFile: Uint8Array;
222
+ readonly readFileString: string;
223
+ readonly readLink: string;
224
+ readonly realPath: string;
225
+ readonly resolve: Resolution;
226
+ readonly remove: void;
227
+ readonly rename: void;
228
+ readonly stat: EffectFileSystem.File.Info;
229
+ readonly writeFile: void;
230
+ readonly writeFileString: void;
231
+ readonly batch: AtomicBatchResponse;
232
+ }
233
+ /** The result of one request, read from the operation it names.
234
+ *
235
+ * @since 1.0.0-rc.0
236
+ * @category security
237
+ */
238
+ export type AtomicResult<R extends AtomicRequest> = AtomicResults[R["operation"]];
239
+ /** One typed implementation per operation.
240
+ *
241
+ * A record of this type receives each operation's own request and returns that
242
+ * operation's own result, and a record missing an operation does not compile,
243
+ * which is the exhaustiveness a `string` operation could not give an adapter.
244
+ *
245
+ * @since 1.0.0-rc.0
246
+ * @category security
247
+ */
248
+ export type AtomicHandlers = {
249
+ readonly [K in keyof AtomicResults]: (request: Extract<AtomicRequest, {
250
+ readonly operation: K;
251
+ }>) => Effect.Effect<AtomicResults[K], PlatformError.PlatformError>;
252
+ };
253
+ /** Trusted host extension implementing atomic path resolution and operation.
254
+ *
255
+ * @since 1.0.0-rc.0
256
+ * @category security
257
+ */
258
+ export interface AtomicFileSystem {
259
+ /**
260
+ * The executor refuses symlinks and hard links during every handle-relative
261
+ * operation. Authorization still resolves the on-disk path spelling, but
262
+ * does not need a separate hard-link stat before invoking the executor.
263
+ */
264
+ readonly noFollowAuthorization?: true | undefined;
265
+ /** Exact composition-time identity when native file IDs exceed numeric precision. */
266
+ readonly identifyRoot?: ((path: string) => Effect.Effect<string, PlatformError.PlatformError>) | undefined;
267
+ readonly execute: <R extends AtomicRequest>(request: R) => Effect.Effect<AtomicResult<R>, PlatformError.PlatformError>;
268
+ /**
269
+ * A filesystem already confined by an enforceable process/filesystem
270
+ * boundary (for example an in-memory browser volume). Methods not expressible
271
+ * as one descriptor-relative request may delegate only through this surface.
272
+ */
273
+ readonly isolated?: EffectFileSystem.FileSystem | undefined;
274
+ /** Advertised only by executors implementing the bounded batch protocol. */
275
+ readonly batchLimits?: {
276
+ readonly size: number;
277
+ readonly response: number;
278
+ } | undefined;
279
+ /**
280
+ * Advertised byte ceiling for one serialized `writeFile` payload. The kernel
281
+ * refuses a larger payload with a typed `BadArgument` before base64-encoding
282
+ * it, so an executor that frames requests across a serialized host boundary
283
+ * never asks its runtime for a string it cannot represent. Hosts delegating
284
+ * through `isolated` receive the bytes directly and advertise nothing.
285
+ */
286
+ readonly contentLimit?: number | undefined;
287
+ }
288
+ /** An Effect filesystem carrying the atomic host extension.
289
+ *
290
+ * @since 1.0.0-rc.0
291
+ * @category security
292
+ */
293
+ export type AtomicHostFileSystem = EffectFileSystem.FileSystem & {
294
+ readonly [AtomicFileSystemTypeId]: AtomicFileSystem;
295
+ };
296
+ /** Attaches a trusted platform's descriptor-relative executor to its service.
297
+ *
298
+ * The executor is attached to the supplied object, so a later attachment over
299
+ * the same service replaces this one. A host attaches exactly once at its
300
+ * boundary; a caller that deliberately layers over an existing executor must
301
+ * read it first and delegate to it, which is what makes replacement its own
302
+ * decision rather than an accident.
303
+ *
304
+ * @since 1.0.0-rc.0
305
+ * @category security
306
+ */
307
+ export declare const withAtomicFileSystem: (fileSystem: EffectFileSystem.FileSystem, atomic: AtomicFileSystem) => AtomicHostFileSystem;
308
+ /**
309
+ * Why a filesystem composition or guarded batch refused.
310
+ *
311
+ * @since 1.0.0-rc.0
312
+ * @category models
313
+ */
314
+ export declare const FileSystemFaultCode: Schema.Literals<readonly ["executor_already_present", "isolated_operation_unsupported", "workspace_identity_changed"]>;
315
+ /**
316
+ * The stable code of a {@link FileSystemFault}.
317
+ *
318
+ * @since 1.0.0-rc.0
319
+ * @category models
320
+ */
321
+ export type FileSystemFaultCode = typeof FileSystemFaultCode.Type;
322
+ declare const FileSystemFault_base: Schema.Class<FileSystemFault, Schema.TaggedStruct<"@smthrs/kernel/FileSystemFault", {
323
+ readonly code: Schema.Literals<readonly ["executor_already_present", "isolated_operation_unsupported", "workspace_identity_changed"]>;
324
+ readonly message: Schema.String;
325
+ }>, import("effect/Cause").YieldableError>;
326
+ /**
327
+ * A broken filesystem composition or a workspace whose descriptor identity
328
+ * changed. `withIsolatedFileSystem` throws `executor_already_present`; an
329
+ * attested volume reaching an operation it never advertises dies with
330
+ * `isolated_operation_unsupported` (a bug); a batch whose root no longer names
331
+ * the authorized descriptor is the `cause` of a `Busy` `PlatformError` with
332
+ * `workspace_identity_changed`.
333
+ *
334
+ * @since 1.0.0-rc.0
335
+ * @category errors
336
+ */
337
+ export declare class FileSystemFault extends FileSystemFault_base {
338
+ readonly name = "FileSystemFault";
339
+ }
340
+ /**
341
+ * Attests that a host filesystem is already isolated as a whole. Intended for
342
+ * browser/test volumes whose implementation cannot address the host
343
+ * filesystem at all; native path-based adapters must not use this shortcut.
344
+ *
345
+ * The attestation is refused for a filesystem that already carries a
346
+ * descriptor-relative executor. That executor is the stronger guarantee, and
347
+ * replacing it with a path-delegating one would route `access`, `copy`,
348
+ * `chmod`, `link`, `symlink`, `open`, `watch`, `sink`, `stream`, and every
349
+ * `makeTemp*` back through pathnames after the capability check: the exact
350
+ * symlink-swap window this module exists to close. The refusal is a throw at
351
+ * composition time, so a host cannot be assembled that way.
352
+ *
353
+ * @since 1.0.0-rc.0
354
+ * @category security
355
+ */
356
+ export declare const withIsolatedFileSystem: (fileSystem: EffectFileSystem.FileSystem) => AtomicHostFileSystem;
357
+ /**
358
+ * Whether {@link confined} can build a view over this filesystem: it carries a
359
+ * descriptor-relative executor, or a whole-filesystem isolation attestation.
360
+ * A plain path-based host answers `false`.
361
+ *
362
+ * @since 1.0.0-rc.1
363
+ * @category security
364
+ */
365
+ export declare const isConfinable: (fileSystem: EffectFileSystem.FileSystem) => boolean;
366
+ /**
367
+ * The logical root a filesystem is already confined to: a {@link confined}
368
+ * view's pinned root, or the guarded {@link layer} service's workspace root.
369
+ * `undefined` for any other filesystem, including a host that is merely
370
+ * confinable. Machinery that shares a filesystem with its caller confines to
371
+ * this root, so its paths resolve exactly where the caller's do.
372
+ *
373
+ * @since 1.0.0-rc.1
374
+ * @category security
375
+ */
376
+ export declare const confinedRoot: (fileSystem: EffectFileSystem.FileSystem) => string | undefined;
377
+ /**
378
+ * Fails with the typed `PermissionDenied` refusal unless {@link confined} can
379
+ * build a view over this filesystem. Composition-time check for layers that
380
+ * pin their root later, when it is known to exist.
381
+ *
382
+ * @since 1.0.0-rc.1
383
+ * @category security
384
+ */
385
+ export declare const requireConfinable: (fileSystem: EffectFileSystem.FileSystem, root: string) => Effect.Effect<void, PlatformError.PlatformError>;
386
+ /**
387
+ * A filesystem view confined to `root` without capability checks: engine
388
+ * machinery that must not ask a grant store for its own bookkeeping, but must
389
+ * still never be redirected outside the workspace.
390
+ *
391
+ * Every operation is one descriptor-relative request against the root pinned
392
+ * here (its canonical path and `device:inode` identity), resolved by the host
393
+ * helper with `O_NOFOLLOW` at each component, so there is no window between a
394
+ * check and a write for a symlink to be swapped into. A symlink anywhere on the
395
+ * path, a hard-linked file, `..` traversal, or a root whose identity changed is
396
+ * refused by the host, never followed. The requests are exactly the ones the
397
+ * guarded {@link layer} sends, minus the grant check.
398
+ *
399
+ * A host carrying a whole-filesystem isolation attestation
400
+ * ({@link withIsolatedFileSystem}) is returned as it is: its attestation is
401
+ * the boundary. So is the guarded {@link layer}'s own service when it is
402
+ * rooted at the same workspace, since each of its path operations is already
403
+ * one such request. A plain path-based host is refused with `PermissionDenied`, so
404
+ * there is no path-based fallback that claims confinement. Operations that
405
+ * cannot be expressed as one atomic request (`open`, `stream`, `sink`, `copy`,
406
+ * `link`, `symlink`, `watch`, `truncate`, `utimes`, `access`, and every
407
+ * `makeTemp*`) fail with the same refusal.
408
+ *
409
+ * The root must exist when the view is built.
410
+ *
411
+ * @since 1.0.0-rc.1
412
+ * @category security
413
+ */
414
+ export declare const confined: (fileSystem: EffectFileSystem.FileSystem, root: string) => Effect.Effect<EffectFileSystem.FileSystem, PlatformError.PlatformError, EffectPath.Path>;
415
+ /**
416
+ * Resolves a path through every existing ancestor and maps paths inside the
417
+ * canonical workspace back to the stable logical workspace root. Existing
418
+ * symlinks therefore cannot turn an inside-workspace grant into outside
419
+ * authority, while capability resources remain stable when the root itself is
420
+ * a symlink. The host's `realPath` must return the on-disk spelling of existing
421
+ * components, including on case-insensitive volumes. Native Node hosts use
422
+ * the promise-based `realpath`, which uses the native implementation.
423
+ *
424
+ * @category security
425
+ * @since 1.0.0-rc.0
426
+ */
427
+ export declare const canonicalResource: (fileSystem: EffectFileSystem.FileSystem, path: EffectPath.Path, workspaceRoot: string, value: string) => Effect.Effect<string, PlatformError.PlatformError>;
428
+ /**
429
+ * Decorates Effect's filesystem service in place with workspace-normalized
430
+ * capability checks. Every host resolves canonical path spelling before the
431
+ * capability check and again after every grant decision. Descriptor-relative
432
+ * executors enforce hard-link refusal themselves; other hosts also run the
433
+ * hard-link guard here. A decision can
434
+ * suspend (an attended request, a journal-backed store), and an operation
435
+ * whose path no longer names the resource that was authorized is refused
436
+ * rather than performed. Open file handles bind their authorization to the
437
+ * `device:inode` identity fstat'd at open time and refuse any operation once
438
+ * the authorized path names a different resource.
439
+ *
440
+ * The layer provides the tag it also requires: compose it over a host
441
+ * filesystem layer with `Layer.provide` and every consumer of
442
+ * `FileSystem.FileSystem` — including one that never heard of the kernel —
443
+ * resolves the guarded implementation. A denied request surfaces as a
444
+ * `PlatformError` whose reason is `PermissionDenied` and whose `cause` is the
445
+ * kernel's own `PermissionRequired`, `PermissionDenied`, or `GrantStoreError`;
446
+ * `Permission.fromPlatformError` reads it back.
447
+ *
448
+ * @category layers
449
+ * @since 1.0.0-rc.0
450
+ */
451
+ export declare const layer: Layer.Layer<EffectFileSystem.FileSystem, PlatformError.PlatformError, EffectFileSystem.FileSystem | EffectPath.Path | Workspace | GrantStore>;
452
+ //# sourceMappingURL=FileSystem.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FileSystem.d.ts","sourceRoot":"","sources":["../../src/FileSystem.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAGH,OAAO,EACL,MAAM,EAEN,UAAU,IAAI,gBAAgB,EAC9B,KAAK,EAEL,IAAI,IAAI,UAAU,EAClB,aAAa,EACb,MAAM,EACN,MAAM,EAGP,MAAM,QAAQ,CAA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