@motebit/protocol 0.8.0 → 1.0.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 +198 -18
- package/NOTICE +19 -0
- package/README.md +37 -5
- package/dist/agent-settlement-anchor.d.ts +102 -0
- package/dist/agent-settlement-anchor.d.ts.map +1 -0
- package/dist/agent-settlement-anchor.js +18 -0
- package/dist/agent-settlement-anchor.js.map +1 -0
- package/dist/computer-use.d.ts +312 -0
- package/dist/computer-use.d.ts.map +1 -0
- package/dist/computer-use.js +86 -0
- package/dist/computer-use.js.map +1 -0
- package/dist/credential-anchor.d.ts +17 -2
- package/dist/credential-anchor.d.ts.map +1 -1
- package/dist/credential-anchor.js +3 -2
- package/dist/credential-anchor.js.map +1 -1
- package/dist/crypto-suite.d.ts +100 -0
- package/dist/crypto-suite.d.ts.map +1 -0
- package/dist/crypto-suite.js +93 -0
- package/dist/crypto-suite.js.map +1 -0
- package/dist/discovery.d.ts +87 -0
- package/dist/discovery.d.ts.map +1 -0
- package/dist/discovery.js +9 -0
- package/dist/discovery.js.map +1 -0
- package/dist/dispute.d.ts +176 -0
- package/dist/dispute.d.ts.map +1 -0
- package/dist/dispute.js +9 -0
- package/dist/dispute.js.map +1 -0
- package/dist/goal-lifecycle.d.ts +129 -0
- package/dist/goal-lifecycle.d.ts.map +1 -0
- package/dist/goal-lifecycle.js +29 -0
- package/dist/goal-lifecycle.js.map +1 -0
- package/dist/index.d.ts +692 -26
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +29 -2
- package/dist/index.js.map +1 -1
- package/dist/memory-events.d.ts +140 -0
- package/dist/memory-events.d.ts.map +1 -0
- package/dist/memory-events.js +29 -0
- package/dist/memory-events.js.map +1 -0
- package/dist/migration.d.ts +180 -0
- package/dist/migration.d.ts.map +1 -0
- package/dist/migration.js +9 -0
- package/dist/migration.js.map +1 -0
- package/dist/plan-lifecycle.d.ts +147 -0
- package/dist/plan-lifecycle.d.ts.map +1 -0
- package/dist/plan-lifecycle.js +36 -0
- package/dist/plan-lifecycle.js.map +1 -0
- package/dist/semiring.d.ts +16 -0
- package/dist/semiring.d.ts.map +1 -1
- package/dist/semiring.js +21 -0
- package/dist/semiring.js.map +1 -1
- package/dist/settlement-mode.d.ts +68 -0
- package/dist/settlement-mode.d.ts.map +1 -0
- package/dist/settlement-mode.js +8 -0
- package/dist/settlement-mode.js.map +1 -0
- package/dist/tool-mode.d.ts +46 -0
- package/dist/tool-mode.d.ts.map +1 -0
- package/dist/tool-mode.js +50 -0
- package/dist/tool-mode.js.map +1 -0
- package/package.json +8 -5
- package/dist/__tests__/branded-ids.test.d.ts +0 -2
- package/dist/__tests__/branded-ids.test.d.ts.map +0 -1
- package/dist/__tests__/branded-ids.test.js +0 -70
- package/dist/__tests__/branded-ids.test.js.map +0 -1
- package/dist/__tests__/semiring-laws.test.d.ts +0 -25
- package/dist/__tests__/semiring-laws.test.d.ts.map +0 -1
- package/dist/__tests__/semiring-laws.test.js +0 -231
- package/dist/__tests__/semiring-laws.test.js.map +0 -1
- package/dist/__tests__/semiring.test.d.ts +0 -2
- package/dist/__tests__/semiring.test.d.ts.map +0 -1
- package/dist/__tests__/semiring.test.js +0 -201
- package/dist/__tests__/semiring.test.js.map +0 -1
- package/dist/__tests__/traversal.test.d.ts +0 -2
- package/dist/__tests__/traversal.test.d.ts.map +0 -1
- package/dist/__tests__/traversal.test.js +0 -331
- package/dist/__tests__/traversal.test.js.map +0 -1
- package/dist/__tests__/trust-algebra.test.d.ts +0 -2
- package/dist/__tests__/trust-algebra.test.d.ts.map +0 -1
- package/dist/__tests__/trust-algebra.test.js +0 -105
- package/dist/__tests__/trust-algebra.test.js.map +0 -1
package/LICENSE
CHANGED
|
@@ -1,26 +1,206 @@
|
|
|
1
|
-
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
2
4
|
|
|
3
|
-
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
4
6
|
|
|
5
|
-
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
7
|
+
1. Definitions.
|
|
11
8
|
|
|
12
|
-
|
|
13
|
-
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
14
11
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
22
14
|
|
|
23
|
-
"
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for describing the origin of the Work and
|
|
141
|
+
reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright 2026 Motebit, Inc.
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
|
202
|
+
|
|
203
|
+
"Motebit" is a trademark of Motebit, Inc. The Apache License grants rights to
|
|
24
204
|
this software, not to any Motebit trademarks, logos, or branding. You may not
|
|
25
205
|
use Motebit branding in a way that suggests endorsement or affiliation without
|
|
26
206
|
written permission.
|
package/NOTICE
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
Motebit
|
|
2
|
+
Copyright 2026 Motebit, Inc.
|
|
3
|
+
|
|
4
|
+
This product includes software developed at Motebit, Inc. (https://motebit.com).
|
|
5
|
+
|
|
6
|
+
The permissive-floor packages (the protocol, SDK, cryptographic primitives,
|
|
7
|
+
platform-attestation verifier leaves, scaffolding CLI, and GitHub Action) are
|
|
8
|
+
licensed under the Apache License, Version 2.0. See LICENSE files in each
|
|
9
|
+
`packages/*/` subdirectory and in `spec/` for the full license text.
|
|
10
|
+
|
|
11
|
+
The remaining packages, apps, and services are licensed under the Business
|
|
12
|
+
Source License 1.1 and convert to the Apache License, Version 2.0 four years
|
|
13
|
+
after each version's first public release. See `LICENSE` at the repository
|
|
14
|
+
root and `LICENSING.md` for the full license boundary.
|
|
15
|
+
|
|
16
|
+
"Motebit" is a trademark of Motebit, Inc. The licenses granted here cover
|
|
17
|
+
this software only, not Motebit trademarks, logos, or branding. Use of
|
|
18
|
+
Motebit branding in a way that suggests endorsement or affiliation requires
|
|
19
|
+
written permission.
|
package/README.md
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
# @motebit/protocol
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Wire-format types for the Motebit agent identity standard. Zero dependencies. Pure TypeScript.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
## Why this exists
|
|
6
6
|
|
|
7
|
-
This package
|
|
7
|
+
Motebit is an open protocol for sovereign AI agents — persistent cryptographic identity, signed execution receipts, verifiable credentials, and trust algebra. This package is the type-level contract any system needs to **interoperate** with motebits: verify an agent's identity, validate an execution receipt, issue a reputation credential, compute a trust score, settle a payment. Binding to these types instead of a BSL implementation is what makes an alternative runtime possible.
|
|
8
8
|
|
|
9
9
|
## Install
|
|
10
10
|
|
|
@@ -12,17 +12,49 @@ This package defines the types that any system needs to participate in the Moteb
|
|
|
12
12
|
npm install @motebit/protocol
|
|
13
13
|
```
|
|
14
14
|
|
|
15
|
+
## Example
|
|
16
|
+
|
|
17
|
+
```ts
|
|
18
|
+
import type { MotebitId, ExecutionReceipt, VerifiableCredential } from "@motebit/protocol";
|
|
19
|
+
import { asMotebitId, PLATFORM_FEE_RATE } from "@motebit/protocol";
|
|
20
|
+
|
|
21
|
+
// Branded IDs — compile-time guardrail against mixing ID spaces.
|
|
22
|
+
const agent: MotebitId = asMotebitId("01234567-89ab-cdef-0123-456789abcdef");
|
|
23
|
+
|
|
24
|
+
// Receipts and credentials are pure data. Pair with @motebit/crypto to
|
|
25
|
+
// sign or verify.
|
|
26
|
+
function auditsPass(receipt: ExecutionReceipt): boolean {
|
|
27
|
+
return receipt.status === "completed" && receipt.tools_used.length > 0;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
// Protocol constants.
|
|
31
|
+
const relayFee = PLATFORM_FEE_RATE; // 0.05 — the universal 5% relay fee.
|
|
32
|
+
```
|
|
33
|
+
|
|
15
34
|
## What's included
|
|
16
35
|
|
|
17
36
|
- **Branded ID types** — `MotebitId`, `DeviceId`, `GoalId`, `AllocationId`, etc.
|
|
18
|
-
- **Trust algebra** — semiring operations for delegation chain trust computation
|
|
19
37
|
- **Identity** — `MotebitIdentity`, `KeySuccessionRecord`, `DeviceRegistration`
|
|
20
38
|
- **Execution receipts** — `ExecutionReceipt` with nested delegation chains
|
|
21
39
|
- **Credentials** — W3C VC 2.0 types (`ReputationCredentialSubject`, `TrustCredentialSubject`)
|
|
22
40
|
- **Settlement** — `BudgetAllocation`, `SettlementRecord`, `PLATFORM_FEE_RATE`
|
|
41
|
+
- **Trust algebra** — semiring operations for delegation-chain trust computation
|
|
23
42
|
- **Policy** — `ToolDefinition`, `PolicyDecision`, `RiskLevel`, `SensitivityLevel`
|
|
24
43
|
- **Storage adapters** — pluggable persistence contracts for any backend
|
|
44
|
+
- **Cryptosuite registry** — `SuiteId` union for crypto-agile wire artifacts
|
|
45
|
+
|
|
46
|
+
Product-level types (state vectors, creature behavior, rendering spec) live in [`@motebit/sdk`](https://www.npmjs.com/package/@motebit/sdk), which re-exports everything here plus the product vocabulary.
|
|
47
|
+
|
|
48
|
+
## Related
|
|
49
|
+
|
|
50
|
+
- [`@motebit/sdk`](https://www.npmjs.com/package/@motebit/sdk) — superset with product types for building on Motebit
|
|
51
|
+
- [`@motebit/crypto`](https://www.npmjs.com/package/@motebit/crypto) — sign and verify every artifact this package types
|
|
52
|
+
- [`@motebit/verifier`](https://www.npmjs.com/package/@motebit/verifier) — offline third-party verifier CLI
|
|
53
|
+
- [`create-motebit`](https://www.npmjs.com/package/create-motebit) — scaffold a signed agent identity
|
|
54
|
+
- [`motebit`](https://www.npmjs.com/package/motebit) — reference runtime and operator console
|
|
25
55
|
|
|
26
56
|
## License
|
|
27
57
|
|
|
28
|
-
|
|
58
|
+
Apache-2.0 — see [LICENSE](./LICENSE).
|
|
59
|
+
|
|
60
|
+
"Motebit" is a trademark. The Apache License grants rights to this software, not to any Motebit trademarks, logos, or branding. You may not use Motebit branding in a way that suggests endorsement or affiliation without written permission.
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Per-agent settlement anchor types — motebit/agent-settlement-anchor@1.0.
|
|
3
|
+
*
|
|
4
|
+
* Permissive floor (Apache-2.0): these types define the interoperable format
|
|
5
|
+
* for per-agent settlement anchoring (the "ceiling" alongside the
|
|
6
|
+
* SettlementRecord signing "floor" in delegation-v1.md §6.4 and
|
|
7
|
+
* settlement-v1.md §3).
|
|
8
|
+
*
|
|
9
|
+
* Audience-distinct from federation settlement anchoring (relay-federation-v1.md
|
|
10
|
+
* §7.6, peer audit between relays) and credential anchoring (credential-anchor-v1.md,
|
|
11
|
+
* agent reputation portability). Same Merkle primitive, different proof endpoint
|
|
12
|
+
* and source table — see spec/agent-settlement-anchor-v1.md §9.
|
|
13
|
+
*
|
|
14
|
+
* Any implementation can produce and verify per-agent settlement anchor proofs
|
|
15
|
+
* using these types and the shared Merkle library.
|
|
16
|
+
*/
|
|
17
|
+
/**
|
|
18
|
+
* A batch of per-agent settlement leaf hashes anchored as a Merkle tree.
|
|
19
|
+
*
|
|
20
|
+
* Each leaf commits the WHOLE signed `SettlementRecord` (including the
|
|
21
|
+
* relay's signature), so reconstruction at verification time requires only
|
|
22
|
+
* the bytes the worker already holds.
|
|
23
|
+
*/
|
|
24
|
+
export interface AgentSettlementAnchorBatch {
|
|
25
|
+
/** UUID v4 batch identifier. */
|
|
26
|
+
batch_id: string;
|
|
27
|
+
/** MotebitId of the relay that created this batch. */
|
|
28
|
+
relay_id: string;
|
|
29
|
+
/** Hex-encoded SHA-256 Merkle root. */
|
|
30
|
+
merkle_root: string;
|
|
31
|
+
/** Number of settlements in this batch. */
|
|
32
|
+
leaf_count: number;
|
|
33
|
+
/** Millisecond timestamp of the earliest settlement in the batch. */
|
|
34
|
+
first_settled_at: number;
|
|
35
|
+
/** Millisecond timestamp of the latest settlement in the batch. */
|
|
36
|
+
last_settled_at: number;
|
|
37
|
+
/**
|
|
38
|
+
* Cryptosuite discriminator. Always `"motebit-jcs-ed25519-hex-v1"` —
|
|
39
|
+
* JCS canonicalization of the unsigned batch payload, Ed25519
|
|
40
|
+
* primitive, hex signature encoding, hex public-key encoding.
|
|
41
|
+
* Verifiers reject missing or unknown suite values fail-closed.
|
|
42
|
+
*/
|
|
43
|
+
suite: "motebit-jcs-ed25519-hex-v1";
|
|
44
|
+
/** Hex-encoded Ed25519 signature over the canonical batch payload. */
|
|
45
|
+
signature: string;
|
|
46
|
+
/** Onchain anchor metadata, or null if signed but not yet submitted. */
|
|
47
|
+
anchor: AgentSettlementChainAnchor | null;
|
|
48
|
+
}
|
|
49
|
+
/** Onchain anchor reference — chain-agnostic. */
|
|
50
|
+
export interface AgentSettlementChainAnchor {
|
|
51
|
+
/** Chain identifier (e.g., "eip155"). */
|
|
52
|
+
chain: string;
|
|
53
|
+
/** CAIP-2 network identifier (e.g., "eip155:8453" for Base). */
|
|
54
|
+
network: string;
|
|
55
|
+
/** Transaction hash on the target chain. */
|
|
56
|
+
tx_hash: string;
|
|
57
|
+
/** Millisecond timestamp when the anchor was confirmed. */
|
|
58
|
+
anchored_at: number;
|
|
59
|
+
}
|
|
60
|
+
/** Self-verifiable Merkle inclusion proof for a per-agent settlement in an anchored batch. */
|
|
61
|
+
export interface AgentSettlementAnchorProof {
|
|
62
|
+
/** Settlement identifier. */
|
|
63
|
+
settlement_id: string;
|
|
64
|
+
/**
|
|
65
|
+
* Hex-encoded SHA-256 hash of the canonical signed `SettlementRecord`
|
|
66
|
+
* (the worker's bytes-on-the-wire form, signature included). See
|
|
67
|
+
* spec/agent-settlement-anchor-v1.md §3.
|
|
68
|
+
*/
|
|
69
|
+
settlement_hash: string;
|
|
70
|
+
/** Batch containing this settlement. */
|
|
71
|
+
batch_id: string;
|
|
72
|
+
/** Hex-encoded Merkle root of the batch. */
|
|
73
|
+
merkle_root: string;
|
|
74
|
+
/** Number of settlements in this batch (needed for batch signature verification). */
|
|
75
|
+
leaf_count: number;
|
|
76
|
+
/** Millisecond timestamp of the earliest settlement in the batch. */
|
|
77
|
+
first_settled_at: number;
|
|
78
|
+
/** Millisecond timestamp of the latest settlement in the batch. */
|
|
79
|
+
last_settled_at: number;
|
|
80
|
+
/** Position of this settlement's leaf in the sorted array. */
|
|
81
|
+
leaf_index: number;
|
|
82
|
+
/** Hex-encoded sibling hashes for Merkle path verification. */
|
|
83
|
+
siblings: string[];
|
|
84
|
+
/** Layer sizes for odd-leaf promotion detection. */
|
|
85
|
+
layer_sizes: number[];
|
|
86
|
+
/** MotebitId of the relay that created the batch. */
|
|
87
|
+
relay_id: string;
|
|
88
|
+
/** Hex-encoded Ed25519 public key of the relay (for batch_signature verification). */
|
|
89
|
+
relay_public_key: string;
|
|
90
|
+
/**
|
|
91
|
+
* Cryptosuite discriminator for `batch_signature`. Always
|
|
92
|
+
* `"motebit-jcs-ed25519-hex-v1"` — JCS canonicalization of the batch
|
|
93
|
+
* payload, Ed25519 primitive, hex signature encoding, hex public-key
|
|
94
|
+
* encoding. Verifiers reject missing or unknown suite values fail-closed.
|
|
95
|
+
*/
|
|
96
|
+
suite: "motebit-jcs-ed25519-hex-v1";
|
|
97
|
+
/** Hex-encoded Ed25519 signature over the canonical batch payload. */
|
|
98
|
+
batch_signature: string;
|
|
99
|
+
/** Onchain anchor metadata, or null if not yet submitted. */
|
|
100
|
+
anchor: AgentSettlementChainAnchor | null;
|
|
101
|
+
}
|
|
102
|
+
//# sourceMappingURL=agent-settlement-anchor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent-settlement-anchor.d.ts","sourceRoot":"","sources":["../src/agent-settlement-anchor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAIH;;;;;;GAMG;AACH,MAAM,WAAW,0BAA0B;IACzC,gCAAgC;IAChC,QAAQ,EAAE,MAAM,CAAC;IACjB,sDAAsD;IACtD,QAAQ,EAAE,MAAM,CAAC;IACjB,uCAAuC;IACvC,WAAW,EAAE,MAAM,CAAC;IACpB,2CAA2C;IAC3C,UAAU,EAAE,MAAM,CAAC;IACnB,qEAAqE;IACrE,gBAAgB,EAAE,MAAM,CAAC;IACzB,mEAAmE;IACnE,eAAe,EAAE,MAAM,CAAC;IACxB;;;;;OAKG;IACH,KAAK,EAAE,4BAA4B,CAAC;IACpC,sEAAsE;IACtE,SAAS,EAAE,MAAM,CAAC;IAClB,wEAAwE;IACxE,MAAM,EAAE,0BAA0B,GAAG,IAAI,CAAC;CAC3C;AAED,iDAAiD;AACjD,MAAM,WAAW,0BAA0B;IACzC,yCAAyC;IACzC,KAAK,EAAE,MAAM,CAAC;IACd,gEAAgE;IAChE,OAAO,EAAE,MAAM,CAAC;IAChB,4CAA4C;IAC5C,OAAO,EAAE,MAAM,CAAC;IAChB,2DAA2D;IAC3D,WAAW,EAAE,MAAM,CAAC;CACrB;AAID,8FAA8F;AAC9F,MAAM,WAAW,0BAA0B;IACzC,6BAA6B;IAC7B,aAAa,EAAE,MAAM,CAAC;IACtB;;;;OAIG;IACH,eAAe,EAAE,MAAM,CAAC;IACxB,wCAAwC;IACxC,QAAQ,EAAE,MAAM,CAAC;IACjB,4CAA4C;IAC5C,WAAW,EAAE,MAAM,CAAC;IACpB,qFAAqF;IACrF,UAAU,EAAE,MAAM,CAAC;IACnB,qEAAqE;IACrE,gBAAgB,EAAE,MAAM,CAAC;IACzB,mEAAmE;IACnE,eAAe,EAAE,MAAM,CAAC;IACxB,8DAA8D;IAC9D,UAAU,EAAE,MAAM,CAAC;IACnB,+DAA+D;IAC/D,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,oDAAoD;IACpD,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,qDAAqD;IACrD,QAAQ,EAAE,MAAM,CAAC;IACjB,sFAAsF;IACtF,gBAAgB,EAAE,MAAM,CAAC;IACzB;;;;;OAKG;IACH,KAAK,EAAE,4BAA4B,CAAC;IACpC,sEAAsE;IACtE,eAAe,EAAE,MAAM,CAAC;IACxB,6DAA6D;IAC7D,MAAM,EAAE,0BAA0B,GAAG,IAAI,CAAC;CAC3C"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Per-agent settlement anchor types — motebit/agent-settlement-anchor@1.0.
|
|
3
|
+
*
|
|
4
|
+
* Permissive floor (Apache-2.0): these types define the interoperable format
|
|
5
|
+
* for per-agent settlement anchoring (the "ceiling" alongside the
|
|
6
|
+
* SettlementRecord signing "floor" in delegation-v1.md §6.4 and
|
|
7
|
+
* settlement-v1.md §3).
|
|
8
|
+
*
|
|
9
|
+
* Audience-distinct from federation settlement anchoring (relay-federation-v1.md
|
|
10
|
+
* §7.6, peer audit between relays) and credential anchoring (credential-anchor-v1.md,
|
|
11
|
+
* agent reputation portability). Same Merkle primitive, different proof endpoint
|
|
12
|
+
* and source table — see spec/agent-settlement-anchor-v1.md §9.
|
|
13
|
+
*
|
|
14
|
+
* Any implementation can produce and verify per-agent settlement anchor proofs
|
|
15
|
+
* using these types and the shared Merkle library.
|
|
16
|
+
*/
|
|
17
|
+
export {};
|
|
18
|
+
//# sourceMappingURL=agent-settlement-anchor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent-settlement-anchor.js","sourceRoot":"","sources":["../src/agent-settlement-anchor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG"}
|