@smthrs/kernel 1.0.0-rc.6 → 1.0.0-rc.8
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.
- package/README.md +23 -20
- package/docs/README.md +10 -8
- package/docs/api.md +2 -3
- package/docs/installation.md +8 -27
- package/docs/quickstart.md +8 -4
- package/docs/testing.md +5 -2
- package/package.json +6 -6
package/README.md
CHANGED
|
@@ -6,7 +6,7 @@ This package declares `effect` as a `^4.0.4` peer dependency. Install one
|
|
|
6
6
|
`effect` release in that range so all Smithers packages share one Effect
|
|
7
7
|
runtime.
|
|
8
8
|
|
|
9
|
-
**Documentation:** https://
|
|
9
|
+
**Documentation:** https://github.com/smithersai/smithers/tree/main/packages/smithers/flows/kernel/docs
|
|
10
10
|
|
|
11
11
|
A capability kernel for [Effect](https://effect.website) hosts. It puts a
|
|
12
12
|
permission check in front of every side effect a program can reach: the five
|
|
@@ -24,22 +24,25 @@ without ever mentioning permission.
|
|
|
24
24
|
|
|
25
25
|
## Install
|
|
26
26
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
27
|
+
```bash
|
|
28
|
+
npm install @smthrs/kernel@next effect
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
The
|
|
32
|
+
[installation page](https://github.com/smithersai/smithers/blob/main/packages/smithers/flows/kernel/docs/installation.md)
|
|
33
|
+
covers the import forms and the two test helpers.
|
|
31
34
|
|
|
32
35
|
It needs Node.js 26.4.0 or later and `effect` `^4.0.4`. It carries no
|
|
33
36
|
platform implementations of its own, so a composition that reaches a real
|
|
34
37
|
machine also adds a bundle such as
|
|
35
|
-
[`@smthrs/platform-node`](https://platform-node
|
|
38
|
+
[`@smthrs/platform-node`](https://github.com/smithersai/smithers/tree/main/packages/smithers/flows/platform-node/docs).
|
|
36
39
|
|
|
37
40
|
## Refuse an operation nobody authorized
|
|
38
41
|
|
|
39
42
|
This program composes the kernel over the deterministic host from
|
|
40
|
-
`@smthrs/testing/TestHost`.
|
|
41
|
-
|
|
42
|
-
under the workspace and says nothing about writes:
|
|
43
|
+
`@smthrs/testing/TestHost`. Install it as a development dependency with
|
|
44
|
+
`npm install --save-dev @smthrs/testing@next` before running it. The policy
|
|
45
|
+
allows reads under the workspace and says nothing about writes:
|
|
43
46
|
|
|
44
47
|
```ts
|
|
45
48
|
import { Capability, GrantStore, HostServices, Permission, Workspace } from "@smthrs/kernel"
|
|
@@ -79,7 +82,7 @@ its refusal into one and keeps the structured original on the cause, where
|
|
|
79
82
|
consent, and this store has nobody to ask. Build the store with
|
|
80
83
|
`attended: true` instead and the same write parks on a request an operator can
|
|
81
84
|
answer, then resumes the operation it was authorized for. The
|
|
82
|
-
[quickstart](https://
|
|
85
|
+
[quickstart](https://github.com/smithersai/smithers/blob/main/packages/smithers/flows/kernel/docs/quickstart.md) runs both halves.
|
|
83
86
|
|
|
84
87
|
## What a yes or no answer leaves open
|
|
85
88
|
|
|
@@ -101,7 +104,7 @@ answer, then resumes the operation it was authorized for. The
|
|
|
101
104
|
|
|
102
105
|
The root entry point exports these namespaces, and each is also importable from
|
|
103
106
|
`@smthrs/kernel/<Module>`. Every export, with its signature and its bounds, is
|
|
104
|
-
on the [API reference](https://
|
|
107
|
+
on the [API reference](https://github.com/smithersai/smithers/blob/main/packages/smithers/flows/kernel/docs/api.md).
|
|
105
108
|
|
|
106
109
|
| Namespace | What it is |
|
|
107
110
|
| --------------------- | ------------------------------------------------------------------------------------------------------------ |
|
|
@@ -126,7 +129,7 @@ on the [API reference](https://kernel.smithers.sh/reference/api/).
|
|
|
126
129
|
`ChildProcessEnvironment` builds a replacement environment from bootstrap names plus explicit declarations, withholding credential-shaped ambient values.
|
|
127
130
|
|
|
128
131
|
`Capability` and `Permission` are re-exports; their modules live in
|
|
129
|
-
[`@smthrs/capability`](https://
|
|
132
|
+
[`@smthrs/capability`](https://github.com/smithersai/smithers/tree/main/packages/smithers/flows/capability/docs).
|
|
130
133
|
|
|
131
134
|
Two test helpers ship in the package's export map, not as dev-only files:
|
|
132
135
|
`@smthrs/kernel/test/TestGrantStore` for allow, deny, and scripted grant-store
|
|
@@ -138,17 +141,17 @@ not depend back on a platform implementation.
|
|
|
138
141
|
|
|
139
142
|
## Documentation
|
|
140
143
|
|
|
141
|
-
- [Overview](https://
|
|
142
|
-
- [Quickstart](https://
|
|
143
|
-
- [Guard a host bundle](https://
|
|
144
|
-
- [Write a capability policy](https://
|
|
145
|
-
- [Decoration in place](https://
|
|
146
|
-
- [API reference](https://
|
|
147
|
-
- [Troubleshooting](https://
|
|
144
|
+
- [Overview](https://github.com/smithersai/smithers/tree/main/packages/smithers/flows/kernel/docs)
|
|
145
|
+
- [Quickstart](https://github.com/smithersai/smithers/blob/main/packages/smithers/flows/kernel/docs/quickstart.md)
|
|
146
|
+
- [Guard a host bundle](https://github.com/smithersai/smithers/blob/main/packages/smithers/flows/kernel/docs/guides/guard-a-host-bundle.md)
|
|
147
|
+
- [Write a capability policy](https://github.com/smithersai/smithers/blob/main/packages/smithers/flows/kernel/docs/guides/write-a-capability-policy.md)
|
|
148
|
+
- [Decoration in place](https://github.com/smithersai/smithers/blob/main/packages/smithers/flows/kernel/docs/concepts/decoration-in-place.md)
|
|
149
|
+
- [API reference](https://github.com/smithersai/smithers/blob/main/packages/smithers/flows/kernel/docs/api.md)
|
|
150
|
+
- [Troubleshooting](https://github.com/smithersai/smithers/blob/main/packages/smithers/flows/kernel/docs/troubleshooting.md), which lists
|
|
148
151
|
every refusal this package raises, what it means, and what to change.
|
|
149
152
|
|
|
150
153
|
`@smthrs/kernel` is one package of the Smithers durable flow engine, which
|
|
151
|
-
ships whole as [`@smthrs/flows`](https://
|
|
154
|
+
ships whole as [`@smthrs/flows`](https://github.com/smithersai/smithers/tree/main/packages/smithers/flows/docs).
|
|
152
155
|
|
|
153
156
|
## License
|
|
154
157
|
|
package/docs/README.md
CHANGED
|
@@ -43,10 +43,12 @@ around it:
|
|
|
43
43
|
|
|
44
44
|
## Install
|
|
45
45
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
46
|
+
```bash
|
|
47
|
+
npm install @smthrs/kernel@next effect
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
[Installation](./installation.md) covers the import forms and the three test
|
|
51
|
+
subpaths.
|
|
50
52
|
|
|
51
53
|
The package needs Node.js 26.4.0 or later. It carries no platform
|
|
52
54
|
implementations of its own, so a composition that reaches a real machine also
|
|
@@ -54,10 +56,10 @@ adds a bundle such as [`@smthrs/platform-node`](/api/platform-node).
|
|
|
54
56
|
|
|
55
57
|
## Refuse an operation nobody authorized
|
|
56
58
|
|
|
57
|
-
This program composes the kernel over `@smthrs/testing/TestHost`.
|
|
58
|
-
`
|
|
59
|
-
before running it. The policy allows reads under the workspace and says
|
|
60
|
-
|
|
59
|
+
This program composes the kernel over `@smthrs/testing/TestHost`. Install it
|
|
60
|
+
as a development dependency with `npm install --save-dev @smthrs/testing@next`
|
|
61
|
+
before running it. The policy allows reads under the workspace and says nothing
|
|
62
|
+
about writes:
|
|
61
63
|
|
|
62
64
|
```ts
|
|
63
65
|
import { Capability, GrantStore, HostServices, Permission, Workspace } from "@smthrs/kernel"
|
package/docs/api.md
CHANGED
|
@@ -1443,9 +1443,8 @@ Effect's platform surface.
|
|
|
1443
1443
|
|
|
1444
1444
|
## Test subpaths
|
|
1445
1445
|
|
|
1446
|
-
For a deterministic host, use `@smthrs/testing/TestHost`.
|
|
1447
|
-
`
|
|
1448
|
-
see [Testing](./testing.md).
|
|
1446
|
+
For a deterministic host, use `@smthrs/testing/TestHost`. Install it with
|
|
1447
|
+
`npm install --save-dev @smthrs/testing@next`; see [Testing](./testing.md).
|
|
1449
1448
|
|
|
1450
1449
|
### @smthrs/kernel/test/TestGrantStore
|
|
1451
1450
|
|
package/docs/installation.md
CHANGED
|
@@ -5,28 +5,13 @@ sidebar:
|
|
|
5
5
|
order: 1
|
|
6
6
|
---
|
|
7
7
|
|
|
8
|
-
##
|
|
9
|
-
|
|
10
|
-
`@smthrs/kernel` is not on npm at 1.0.0-rc.0. It ships as a member of the
|
|
11
|
-
[smithers repository](https://github.com/smithersai/smithers) workspace, so
|
|
12
|
-
using it today means working from a checkout:
|
|
8
|
+
## Install the package
|
|
13
9
|
|
|
14
10
|
```bash
|
|
15
|
-
|
|
16
|
-
cd smithers
|
|
17
|
-
pnpm install
|
|
11
|
+
npm install @smthrs/kernel@next effect
|
|
18
12
|
```
|
|
19
13
|
|
|
20
|
-
|
|
21
|
-
or one you add under `packages/`, and depends on it with a workspace specifier:
|
|
22
|
-
|
|
23
|
-
```json
|
|
24
|
-
{
|
|
25
|
-
"dependencies": {
|
|
26
|
-
"@smthrs/kernel": "workspace:*"
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
```
|
|
14
|
+
The `next` tag carries the 1.0 release candidates.
|
|
30
15
|
|
|
31
16
|
## Requirements
|
|
32
17
|
|
|
@@ -77,15 +62,11 @@ Two helpers ship for testing. They are published code, not dev-only files;
|
|
|
77
62
|
`test/contract` is Node-only because it uses Node process and
|
|
78
63
|
temporary-directory fixtures. The deterministic host bundle is published by
|
|
79
64
|
`@smthrs/testing/TestHost`; keeping it with the other test utilities avoids a
|
|
80
|
-
kernel-to-platform dependency cycle. To use that host,
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
```
|
|
84
|
-
|
|
85
|
-
"devDependencies": {
|
|
86
|
-
"@smthrs/testing": "workspace:*"
|
|
87
|
-
}
|
|
88
|
-
}
|
|
65
|
+
kernel-to-platform dependency cycle. To use that host, install it as a
|
|
66
|
+
development dependency:
|
|
67
|
+
|
|
68
|
+
```bash
|
|
69
|
+
npm install --save-dev @smthrs/testing@next
|
|
89
70
|
```
|
|
90
71
|
|
|
91
72
|
`test/contract` registers Vitest cases, so importing it requires the declared
|
package/docs/quickstart.md
CHANGED
|
@@ -17,13 +17,17 @@ request an operator resolves.
|
|
|
17
17
|
## Prerequisites
|
|
18
18
|
|
|
19
19
|
- Node.js 26.4.0 or later.
|
|
20
|
-
- A
|
|
21
|
-
|
|
22
|
-
|
|
20
|
+
- A project with the kernel and the deterministic test host installed:
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
npm install @smthrs/kernel@next effect
|
|
24
|
+
npm install --save-dev @smthrs/testing@next
|
|
25
|
+
```
|
|
26
|
+
|
|
23
27
|
- A test runner, for the second half:
|
|
24
28
|
|
|
25
29
|
```bash
|
|
26
|
-
|
|
30
|
+
npm install --save-dev @effect/vitest vitest@5.0.0
|
|
27
31
|
```
|
|
28
32
|
|
|
29
33
|
## Build the raw host
|
package/docs/testing.md
CHANGED
|
@@ -38,8 +38,11 @@ evaluation path, and it needs a `Workspace`.
|
|
|
38
38
|
|
|
39
39
|
## Run against the deterministic host
|
|
40
40
|
|
|
41
|
-
|
|
42
|
-
|
|
41
|
+
Install it as a development dependency:
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
npm install --save-dev @smthrs/testing@next
|
|
45
|
+
```
|
|
43
46
|
|
|
44
47
|
`@smthrs/testing/TestHost` is the whole host surface with every source of
|
|
45
48
|
nondeterminism pinned: a `Map`-backed filesystem, a scripted interpreter,
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@smthrs/kernel",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.0.0-rc.
|
|
4
|
+
"version": "1.0.0-rc.8",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"smthrs": {
|
|
7
7
|
"group": "engine"
|
|
@@ -295,10 +295,10 @@
|
|
|
295
295
|
"tag": "next"
|
|
296
296
|
},
|
|
297
297
|
"dependencies": {
|
|
298
|
-
"@smthrs/capability": "1.0.0-rc.
|
|
299
|
-
"@smthrs/crypto": "1.0.0-rc.
|
|
300
|
-
"@smthrs/jj": "1.0.0-rc.
|
|
301
|
-
"@smthrs/journal": "1.0.0-rc.
|
|
298
|
+
"@smthrs/capability": "1.0.0-rc.8",
|
|
299
|
+
"@smthrs/crypto": "1.0.0-rc.8",
|
|
300
|
+
"@smthrs/jj": "1.0.0-rc.8",
|
|
301
|
+
"@smthrs/journal": "1.0.0-rc.8"
|
|
302
302
|
},
|
|
303
303
|
"peerDependencies": {
|
|
304
304
|
"effect": "^4.0.4",
|
|
@@ -317,7 +317,7 @@
|
|
|
317
317
|
"@effect/platform-node": "4.0.4",
|
|
318
318
|
"@effect/vitest": "4.0.4",
|
|
319
319
|
"@eslint/js": "9.39.5",
|
|
320
|
-
"@smthrs/database": "1.0.0-rc.
|
|
320
|
+
"@smthrs/database": "1.0.0-rc.8",
|
|
321
321
|
"@types/node": "26.4.1",
|
|
322
322
|
"@vitest/coverage-v8": "5.0.0",
|
|
323
323
|
"dprint": "0.57.1",
|