@decidio/sdk 0.2.0 → 0.2.2
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 +27 -3
- package/package.json +4 -3
package/README.md
CHANGED
|
@@ -144,6 +144,17 @@ evidence is yours, not ours. To also prove *who* issued it, pin your workspace's
|
|
|
144
144
|
record verify panel — or simply read it off the `receipt` command's output, which prints your
|
|
145
145
|
workspace's issuer DID from the authenticated response so you never have to hunt for it).
|
|
146
146
|
|
|
147
|
+
**What VALID means — and what it does not.** A pinned `VALID` proves the receipt's bytes were
|
|
148
|
+
sealed by your workspace's issuer and are unaltered since. It does **not** prove the approved
|
|
149
|
+
action ran. Execution is confirmed *after* the seal, and a sealed record is immutable, so the
|
|
150
|
+
receipt's own `authority.result` and `confirmation.status` are a snapshot taken at seal time — a
|
|
151
|
+
receipt for an approved-but-never-executed action verifies `VALID`, correctly. The verifier now
|
|
152
|
+
prints those fields under `as sealed`, plus a note saying exactly this, so the distinction is on
|
|
153
|
+
screen rather than left to inference. The check is **cryptographic, not semantic**: it does not
|
|
154
|
+
evaluate business rules, timestamp plausibility, revocation, or whether a later record superseded
|
|
155
|
+
this one. For current execution status, ask the issuer (`npx @decidio/sdk receipt <decisionId>`
|
|
156
|
+
reports the live evidence tier).
|
|
157
|
+
|
|
147
158
|
One receipt proves itself. Pass several files and their **ordering** is verified too — in
|
|
148
159
|
**seal order** (each receipt's `prevHash` links to its predecessor's `contentHash`), which is
|
|
149
160
|
the order decisions were *sealed*, not the order of their displayed decision numbers (two
|
|
@@ -255,8 +266,21 @@ catch (e) { console.log(e.name); } // DecidioSuspendedError — expected, not
|
|
|
255
266
|
```
|
|
256
267
|
|
|
257
268
|
Run `node --env-file=.env agent.mjs`, then `node --env-file=.env submit.mjs` once, approve from
|
|
258
|
-
another terminal, and the running worker executes it.
|
|
259
|
-
|
|
269
|
+
another terminal, and the running worker executes it.
|
|
270
|
+
|
|
271
|
+
To see recovery, the approval has to be waiting while nothing is running — so submit a **second**
|
|
272
|
+
request with the worker stopped:
|
|
273
|
+
|
|
274
|
+
1. Stop the worker (Ctrl-C).
|
|
275
|
+
2. `node --env-file=.env submit.mjs` again — it parks; nothing is running to pick it up.
|
|
276
|
+
3. Approve it from the other terminal. It stays parked, approved and unexecuted.
|
|
277
|
+
4. Start the worker again: it executes that request exactly once, and restarting created no
|
|
278
|
+
duplicate.
|
|
279
|
+
|
|
280
|
+
Step 2 is the one that is easy to skip: by the time you restart, the first request has already
|
|
281
|
+
executed, so without a second submission there is nothing left to approve.
|
|
282
|
+
|
|
283
|
+
**If you can't declare the name at wrap time** (a dynamic
|
|
260
284
|
`describe`), register the raw function explicitly at startup instead —
|
|
261
285
|
`guard.register("payInvoice", payInvoiceRaw)` — before calling `guard.worker()`. Without one of
|
|
262
286
|
those two, a cold worker has an empty registry and reports `no_handler` (the parked action is
|
|
@@ -421,7 +445,7 @@ for engines you don't. Each adapter's shipped `.d.ts` header documents its wirin
|
|
|
421
445
|
- `doctor` — config, connectivity, and what your current token can do
|
|
422
446
|
- `approvals [--mine] [--json]` / `approvals approve|reject <id> [reason]` — the human side, from your terminal (the list is workspace-wide; `--mine` narrows it to this directory's agent)
|
|
423
447
|
- `receipt <id>` — download a sealed decision's Authority Receipt to a `.json` file
|
|
424
|
-
- `verify [--issuer <did>] <file>...` — verify receipts offline (the canonical verifier; the standalone `@decidio/verify` package is the same implementation, for auditors who want zero Decidio dependency — the sdk
|
|
448
|
+
- `verify [--issuer <did>] <file>...` — verify receipts offline (the canonical verifier; the standalone `@decidio/verify` package is the same implementation, for auditors who want zero Decidio dependency — the sdk depends on the verifier released alongside it, at the same version). Unknown flags are refused, never ignored. Fully offline AND fully decoupled: it touches no network and reads no `.env` — a receipt verifies identically from an empty directory.
|
|
425
449
|
- `tokens list [--mine]` / `tokens revoke <jti>` — see and kill agent tokens (values are never re-shown; the jti is the revocation handle). Each row carries its status — `active`, `expired`, or `REVOKED <date>` — so the list confirms the revocations it performs; re-revoking is an honest no-op (exit 1). The list is workspace-wide (a shared workspace shows every member's agents); `--mine` narrows to this directory's agent
|
|
426
450
|
- `quickstart cleanup` — revoke the tour's token and delete its local credentials. What stays, honestly: sealed records (permanent by design) and the agent's registration row (inert without key or token; server-side deregistration is on the roadmap)
|
|
427
451
|
- `dev [--target URL]` — local relay for the resume webhook (operator setups)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@decidio/sdk",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.2",
|
|
4
4
|
"description": "One-line approval gate for AI-agent actions. Wrap a risky tool call with guard.protect(); Decidio's policy engine decides proceed | route | block, a human approves routed actions, and every outcome is sealed as a verifiable Authority Receipt.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"type": "module",
|
|
@@ -33,7 +33,8 @@
|
|
|
33
33
|
"./openai": {
|
|
34
34
|
"types": "./dist/adapters/openai.d.ts",
|
|
35
35
|
"default": "./dist/adapters/openai.js"
|
|
36
|
-
}
|
|
36
|
+
},
|
|
37
|
+
"./package.json": "./package.json"
|
|
37
38
|
},
|
|
38
39
|
"files": [
|
|
39
40
|
"dist",
|
|
@@ -86,7 +87,7 @@
|
|
|
86
87
|
"prepublishOnly": "npm run typecheck && npm run build"
|
|
87
88
|
},
|
|
88
89
|
"dependencies": {
|
|
89
|
-
"@decidio/verify": "0.
|
|
90
|
+
"@decidio/verify": "0.2.2"
|
|
90
91
|
},
|
|
91
92
|
"author": "OmniTwin Technologies Inc.",
|
|
92
93
|
"bugs": {
|