@fungi.computer/approvals 0.2.4 → 0.2.5
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 +52 -10
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,21 +1,24 @@
|
|
|
1
1
|
# Approvals
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
Approvals keeps a record of each action an AI agent wants to take that needs a
|
|
4
|
+
person's OK, so any screen can show it and an approved action runs exactly once.
|
|
5
|
+
|
|
6
|
+
```mermaid
|
|
7
|
+
flowchart LR
|
|
8
|
+
Agent[Agent proposes a write] --> Ledger[Approvals ledger]
|
|
9
|
+
Ledger --> Person[A member answers]
|
|
10
|
+
Person --> Ledger
|
|
11
|
+
Ledger -->|rechecks authority| Host[Your host runs the operation]
|
|
12
|
+
```
|
|
6
13
|
|
|
7
|
-
##
|
|
14
|
+
## Quick start
|
|
15
|
+
|
|
16
|
+
Install it:
|
|
8
17
|
|
|
9
18
|
```sh
|
|
10
19
|
npm install @fungi.computer/approvals @fungi.computer/watchdog
|
|
11
20
|
```
|
|
12
21
|
|
|
13
|
-
Approvals ships ESM and TypeScript declarations from its root entrypoint. The
|
|
14
|
-
example below uses Node.js 24's native SQLite adapter from Watchdog. Your host
|
|
15
|
-
owns the database, requester identity, current grants and dispatch.
|
|
16
|
-
|
|
17
|
-
## Quick start
|
|
18
|
-
|
|
19
22
|
Stage a proposed write without executing it. This disposable in-memory example
|
|
20
23
|
prints `pending`; use a persistent, host-owned database for real requests.
|
|
21
24
|
|
|
@@ -59,6 +62,45 @@ the same operation. `request` stages a record and records the home's
|
|
|
59
62
|
auto-approve decision without dispatching. `submit` additionally applies a newly
|
|
60
63
|
policy-approved request inline through the authority recheck.
|
|
61
64
|
|
|
65
|
+
## Common tasks
|
|
66
|
+
|
|
67
|
+
### Stage a write for approval
|
|
68
|
+
|
|
69
|
+
`request` stages the record without running it. See the Quick start.
|
|
70
|
+
|
|
71
|
+
### Answer a request and apply it
|
|
72
|
+
|
|
73
|
+
Pass `answer` a freshly resolved member and the expected revision, then supply
|
|
74
|
+
an apply host. See Examples.
|
|
75
|
+
|
|
76
|
+
### Turn on auto-approve
|
|
77
|
+
|
|
78
|
+
Auto-approve matches a module and access class. Read how the host reads it in
|
|
79
|
+
[Host admission policy read](#host-admission-policy-read).
|
|
80
|
+
|
|
81
|
+
### Attach screenshots for the reviewer
|
|
82
|
+
|
|
83
|
+
A record can carry up to four image descriptors. See
|
|
84
|
+
[Capability-attached visual evidence](#capability-attached-visual-evidence).
|
|
85
|
+
|
|
86
|
+
## Reference
|
|
87
|
+
|
|
88
|
+
### Overview
|
|
89
|
+
|
|
90
|
+
One durable approval record, many renderers. Mycelium owns operation admission;
|
|
91
|
+
this package owns the decision lifecycle beside it. Team storage on the Hub and
|
|
92
|
+
the Oyster host supply the homes. Bonsai is not a ledger home.
|
|
93
|
+
|
|
94
|
+
## Install
|
|
95
|
+
|
|
96
|
+
```sh
|
|
97
|
+
npm install @fungi.computer/approvals @fungi.computer/watchdog
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
Approvals ships ESM and TypeScript declarations from its root entrypoint. The
|
|
101
|
+
example below uses Node.js 24's native SQLite adapter from Watchdog. Your host
|
|
102
|
+
owns the database, requester identity, current grants and dispatch.
|
|
103
|
+
|
|
62
104
|
## Examples
|
|
63
105
|
|
|
64
106
|
The home example stages one pending write using native SQLite. The packed
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fungi.computer/approvals",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.5",
|
|
4
4
|
"author": "Levi <levi@technomancy.dev>",
|
|
5
5
|
"description": "Durable principal-bound approval records and auto-approve policy",
|
|
6
6
|
"type": "module",
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
],
|
|
21
21
|
"dependencies": {
|
|
22
22
|
"effect": "4.0.2",
|
|
23
|
-
"@fungi.computer/watchdog": "0.1.
|
|
23
|
+
"@fungi.computer/watchdog": "0.1.5"
|
|
24
24
|
},
|
|
25
25
|
"devDependencies": {
|
|
26
26
|
"@types/node": "24.13.3",
|