@cinchor/sdk 0.1.0

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/LICENSE ADDED
@@ -0,0 +1,23 @@
1
+ Copyright © 2026 DoneUp, Inc. All rights reserved.
2
+
3
+ PROPRIETARY AND CONFIDENTIAL
4
+
5
+ This software, including its source code, object code, and accompanying
6
+ documentation (the "Software"), is the proprietary and confidential property of
7
+ DoneUp, Inc. Upon registration of Cinchor, LLC (a wholly-owned subsidiary of
8
+ DoneUp, Inc.), all right, title, and interest in the Software will vest in
9
+ Cinchor, LLC.
10
+
11
+ No license, right, title, or interest in or to the Software is granted, whether
12
+ by implication, estoppel, or otherwise, except under a separate written
13
+ agreement executed by an authorized representative of DoneUp, Inc. (or, after
14
+ its registration, Cinchor, LLC). Absent such an agreement, you may not use,
15
+ copy, modify, merge, publish, distribute, sublicense, reproduce, reverse
16
+ engineer, or create derivative works of the Software, in whole or in part.
17
+
18
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
20
+ FOR A PARTICULAR PURPOSE, AND NONINFRINGEMENT. IN NO EVENT SHALL THE COPYRIGHT
21
+ HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES, OR OTHER LIABILITY, WHETHER IN AN
22
+ ACTION OF CONTRACT, TORT, OR OTHERWISE, ARISING FROM, OUT OF, OR IN CONNECTION
23
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,93 @@
1
+ # @cinchor/sdk
2
+
3
+ **Accountability infrastructure for autonomous agents.** Bound what an agent can do *before* it acts, and prove what it did *after* — verifiably enough for a regulator, auditor, insurer, or court.
4
+
5
+ > Auth0 for auth · Datadog for observability · Vanta for compliance → **Cinchor for agent accountability.**
6
+
7
+ You `import` a library, wrap your agent's decision and action points, and call two verbs. You do **not** "go on a blockchain" — Cinchor runs on a neutral, independently-governed substrate that makes the records externally verifiable, but you never manage it.
8
+
9
+ ```bash
10
+ npm install @cinchor/sdk
11
+ ```
12
+
13
+ ## The two verbs
14
+
15
+ - **`enforce(action)`** — authorize-or-refuse a consequential action. The substrate is the enforcement point: an out-of-scope action commits **no state change**, no matter how the agent reasons, is prompted, or is compromised.
16
+ - **`attest(decision)`** — commit a tamper-evident, independently-verifiable record of a decision and the full context behind it, bound to the policy in force at the time.
17
+
18
+ Together they convert *unbounded* irreversible harm into *bounded* irreversible harm, with a record an adversary can verify.
19
+
20
+ ## Quickstart
21
+
22
+ ```ts
23
+ import { CinchorClient, IGNIS_LOCAL } from '@cinchor/sdk';
24
+ import { Wallet } from '@omne/sdk'; // or any compatible signer
25
+
26
+ const cinchor = await CinchorClient.connect({
27
+ network: IGNIS_LOCAL,
28
+ contract: { name: 'cinchor_permissions', address: 'om1z…' }, // your deployed contract
29
+ });
30
+
31
+ // 1. A principal mints a scoped capability to an agent.
32
+ const { capabilityId } = await cinchor.mintCapability({
33
+ principal, // a Signer (the granting party)
34
+ agent: agentAddress, // om1z address of the agent
35
+ maxSpend: 100n, // spend ceiling
36
+ ttlSeconds: 3600, // expires in an hour
37
+ });
38
+
39
+ // 2. The agent enforces an action against that capability.
40
+ const outcome = await cinchor.enforce({
41
+ capability: capabilityId,
42
+ agent, // the agent Signer
43
+ amount: 40n,
44
+ });
45
+ if (!outcome.allowed) {
46
+ throw new Error(`action refused by the substrate: ${outcome.reason}`);
47
+ }
48
+
49
+ // 3. Attest a decision (provable-after).
50
+ const { attestationId } = await cinchor.attest({
51
+ capability: capabilityId,
52
+ agent,
53
+ context: { model: 'claim-triage-v3', inputs, reasoning, output },
54
+ });
55
+
56
+ // 4. Anyone can verify, without trusting the operator.
57
+ const { ok } = await cinchor.verifyAttestation({ model: 'claim-triage-v3', inputs, reasoning, output }, attestationId);
58
+ ```
59
+
60
+ ## What `enforce` returns
61
+
62
+ `enforce()` returns an `EnforcementOutcome`:
63
+
64
+ | field | meaning |
65
+ |---|---|
66
+ | `allowed` | `true` only when the substrate authorized and recorded the action |
67
+ | `code` | `EnforcementCode` — `Allowed`, `NotFound`, `Revoked`, `Expired`, `OverBudget`, `OutOfAllowlist` |
68
+ | `reason` | the human-readable label for `code` |
69
+ | `receipt` | the on-chain commit receipt |
70
+
71
+ A `record_action` receipt does not carry the contract's return code, so the verdict is classified from committed state. Classification assumes serial, single-signer use of a capability (one in-flight action at a time) — the documented integration pattern.
72
+
73
+ ## API surface
74
+
75
+ - **`CinchorClient.connect(config)`** — connect to a network + deployed contract.
76
+ - **Lifecycle:** `mintCapability`, `revoke`, `updatePolicy`, `allowCounterparty`.
77
+ - **Verbs:** `enforce`, `attest`.
78
+ - **Audit (reads, no signer):** `getCapability`, `getAttestation`, `verifyAttestation`.
79
+ - **Power users:** the underlying `CapabilityRegistry` is exposed at `client.registry`, and address/attestation utilities are exported directly.
80
+
81
+ ## Signers
82
+
83
+ Any object exposing an om1z `address` and a `signTransaction(tx, opts)` method works (structurally typed as `Signer`). The Omne SDK's `Wallet` / `WalletAccount` satisfy it. The signer's address must be funded to pay gas.
84
+
85
+ ## Substrate
86
+
87
+ Cinchor runs on Omne, an independently-governed L1 that supplies the neutral, verifiable settlement and audit layer. The chain is the substrate, not the product — the product is bounded, provable agent authority. This package depends on [`@omne/sdk`](https://www.npmjs.com/package/@omne/sdk) for signing and submission.
88
+
89
+ ## License
90
+
91
+ Proprietary and confidential. Copyright © 2026 DoneUp, Inc. All rights reserved
92
+ (to vest in Cinchor, LLC upon registration). No rights granted except under a
93
+ separate written agreement. See [LICENSE](./LICENSE).