@motebit/protocol 1.2.0 → 1.3.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/dist/artifact-type.d.ts +118 -0
- package/dist/artifact-type.d.ts.map +1 -0
- package/dist/artifact-type.js +97 -0
- package/dist/artifact-type.js.map +1 -0
- package/dist/audience.d.ts +108 -0
- package/dist/audience.d.ts.map +1 -0
- package/dist/audience.js +104 -0
- package/dist/audience.js.map +1 -0
- package/dist/co-browse.d.ts +369 -0
- package/dist/co-browse.d.ts.map +1 -0
- package/dist/co-browse.js +64 -0
- package/dist/co-browse.js.map +1 -0
- package/dist/computer-use.d.ts +463 -3
- package/dist/computer-use.d.ts.map +1 -1
- package/dist/computer-use.js +40 -0
- package/dist/computer-use.js.map +1 -1
- package/dist/index.d.ts +152 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +62 -0
- package/dist/index.js.map +1 -1
- package/dist/money.d.ts +33 -0
- package/dist/money.d.ts.map +1 -0
- package/dist/money.js +41 -0
- package/dist/money.js.map +1 -0
- package/dist/perception.d.ts +308 -0
- package/dist/perception.d.ts.map +1 -0
- package/dist/perception.js +9 -0
- package/dist/perception.js.map +1 -0
- package/dist/retention-policy.d.ts +8 -1
- package/dist/retention-policy.d.ts.map +1 -1
- package/dist/retention-policy.js +18 -0
- package/dist/retention-policy.js.map +1 -1
- package/dist/sensitivity.d.ts +73 -0
- package/dist/sensitivity.d.ts.map +1 -0
- package/dist/sensitivity.js +97 -0
- package/dist/sensitivity.js.map +1 -0
- package/dist/transparency.d.ts +116 -0
- package/dist/transparency.d.ts.map +1 -0
- package/dist/transparency.js +67 -0
- package/dist/transparency.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Operator-transparency declaration — the trust-anchor primitive.
|
|
3
|
+
*
|
|
4
|
+
* The motebit relay publishes a signed declaration of its observability
|
|
5
|
+
* posture at `/.well-known/motebit-transparency.json`. The declaration
|
|
6
|
+
* commits the operator to one Ed25519 public key (`relay_public_key`)
|
|
7
|
+
* and to the operator-defined `content` payload. Verifiers pin that
|
|
8
|
+
* key as the trust anchor for every other relay-asserted artifact:
|
|
9
|
+
* content-artifact manifests on state-export endpoints, settlement
|
|
10
|
+
* receipts the operator counter-signs, federation handshakes.
|
|
11
|
+
*
|
|
12
|
+
* This module exports the binding wire types per
|
|
13
|
+
* `spec/relay-transparency-v1.md` (2b-i, the trust-anchor primitive).
|
|
14
|
+
* The operator-comparison vocabulary (Stage 2b-ii — retention/processor
|
|
15
|
+
* field standardization) is deferred until a second motebit-compatible
|
|
16
|
+
* operator forces field standardization; the `content` field stays
|
|
17
|
+
* operator-defined here and verifiers MUST NOT reject declarations on
|
|
18
|
+
* unknown `content` fields.
|
|
19
|
+
*
|
|
20
|
+
* Doctrine: `docs/doctrine/operator-transparency.md`,
|
|
21
|
+
* `docs/doctrine/nist-alignment.md` §8 "savant gap closure",
|
|
22
|
+
* `docs/doctrine/self-attesting-system.md`.
|
|
23
|
+
*
|
|
24
|
+
* Permissive floor (Apache-2.0), type-only, zero runtime deps.
|
|
25
|
+
*/
|
|
26
|
+
import type { SuiteId } from "./crypto-suite.js";
|
|
27
|
+
/**
|
|
28
|
+
* The pinned cryptosuite for transparency declarations. JCS
|
|
29
|
+
* canonicalization (RFC 8785) + Ed25519 + hex signature encoding.
|
|
30
|
+
* Matches the identity-file + credential-anchor + content-artifact
|
|
31
|
+
* family. See `SUITE_REGISTRY` in `./crypto-suite.ts`.
|
|
32
|
+
*/
|
|
33
|
+
export declare const TRANSPARENCY_SUITE: SuiteId;
|
|
34
|
+
/**
|
|
35
|
+
* Canonical memo prefix the relay emits when anchoring the
|
|
36
|
+
* declaration hash to Solana via the Memo program. Full memo shape:
|
|
37
|
+
* `motebit:transparency:v1:{hash_hex}`. Verifiers scan for this
|
|
38
|
+
* prefix at the relay's pinned anchor address. See
|
|
39
|
+
* `spec/relay-transparency-v1.md` §5.2.
|
|
40
|
+
*/
|
|
41
|
+
export declare const TRANSPARENCY_ANCHOR_MEMO_PREFIX: "motebit:transparency:v1:";
|
|
42
|
+
/**
|
|
43
|
+
* Current spec identifier. Bumps require explicit doctrine alignment
|
|
44
|
+
* + a new wire-format spec doc — the verifier MUST reject declarations
|
|
45
|
+
* with unrecognized `spec` values.
|
|
46
|
+
*/
|
|
47
|
+
export declare const TRANSPARENCY_SPEC_ID: "motebit-transparency/draft-2026-04-14";
|
|
48
|
+
/**
|
|
49
|
+
* Operator-transparency declaration — the trust-anchor envelope.
|
|
50
|
+
*
|
|
51
|
+
* Wire format (foundation law) — see `spec/relay-transparency-v1.md` §3.1
|
|
52
|
+
* for the binding shape. Field names, types, and the canonical-JSON
|
|
53
|
+
* ordering of the signed payload are protocol law. The `content` field
|
|
54
|
+
* is operator-extensible — the protocol commits to the envelope, not
|
|
55
|
+
* to the posture vocabulary inside `content`.
|
|
56
|
+
*
|
|
57
|
+
* Hash derivation: `sha256(utf8(canonicalJson({spec, declared_at,
|
|
58
|
+
* relay_id, relay_public_key, content})))` — the post-sign fields
|
|
59
|
+
* `hash`, `suite`, `signature` are NOT included in the canonical bytes.
|
|
60
|
+
* Two implementations that hash the same payload MUST produce the same
|
|
61
|
+
* hex string byte-for-byte. Per `spec/relay-transparency-v1.md` §4.
|
|
62
|
+
*/
|
|
63
|
+
export interface SignedTransparencyDeclaration {
|
|
64
|
+
/** Spec identifier — e.g. `"motebit-transparency/draft-2026-04-14"`. Bump on breaking schema changes. */
|
|
65
|
+
readonly spec: string;
|
|
66
|
+
/** Epoch milliseconds when the declaration was minted. */
|
|
67
|
+
readonly declared_at: number;
|
|
68
|
+
/** Relay's identity — same MotebitId space as agent identities. */
|
|
69
|
+
readonly relay_id: string;
|
|
70
|
+
/** Hex-encoded Ed25519 public key (32 bytes / 64 chars). */
|
|
71
|
+
readonly relay_public_key: string;
|
|
72
|
+
/**
|
|
73
|
+
* Operator-defined posture payload — retention, processors,
|
|
74
|
+
* jurisdiction, honest gaps. Opaque to the protocol. Verifiers MUST
|
|
75
|
+
* NOT reject declarations on unknown `content` fields. Cross-operator
|
|
76
|
+
* comparison vocabulary is deferred to Stage 2b-ii.
|
|
77
|
+
*/
|
|
78
|
+
readonly content: unknown;
|
|
79
|
+
/** Hex-encoded SHA-256 of the canonical-JSON of the signed payload. */
|
|
80
|
+
readonly hash: string;
|
|
81
|
+
/** Cryptosuite identifier — `motebit-jcs-ed25519-hex-v1` today. */
|
|
82
|
+
readonly suite: SuiteId;
|
|
83
|
+
/** Hex-encoded Ed25519 signature over the canonical-JSON of the signed payload. */
|
|
84
|
+
readonly signature: string;
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* The five-field signed payload — what `hash` and `signature` cover.
|
|
88
|
+
* Exposed as a type so producers can construct + canonicalize the
|
|
89
|
+
* exact bytes the verifier checks against. The post-sign fields
|
|
90
|
+
* (`hash`, `suite`, `signature`) are appended AFTER signing and are
|
|
91
|
+
* NOT part of this payload.
|
|
92
|
+
*/
|
|
93
|
+
export type TransparencySignedPayload = Pick<SignedTransparencyDeclaration, "spec" | "declared_at" | "relay_id" | "relay_public_key" | "content">;
|
|
94
|
+
/**
|
|
95
|
+
* Onchain anchor record — the verifier's view of a memo found at the
|
|
96
|
+
* relay's pinned anchor address. Returned by
|
|
97
|
+
* `@motebit/state-export-client::lookupTransparencyAnchor` on success.
|
|
98
|
+
* Per `spec/relay-transparency-v1.md` §5.
|
|
99
|
+
*/
|
|
100
|
+
export interface TransparencyAnchorRecord {
|
|
101
|
+
/** Solana transaction signature containing the anchor memo. */
|
|
102
|
+
readonly tx_hash: string;
|
|
103
|
+
/** Anchored hash (the declaration's `hash` field at time of anchoring), lowercase hex. */
|
|
104
|
+
readonly anchored_hash_hex: string;
|
|
105
|
+
/** Solana address (base58 pubkey) where the anchor lives. Pinned out-of-band by the verifier. */
|
|
106
|
+
readonly anchor_address: string;
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* Type guard — narrows `unknown` to `SignedTransparencyDeclaration`.
|
|
110
|
+
* Structural shape only; does NOT verify the signature, anchor, or
|
|
111
|
+
* succession chain. Verifiers call this before parsing then proceed
|
|
112
|
+
* through the verification algorithm in `spec/relay-transparency-v1.md`
|
|
113
|
+
* §4.1.
|
|
114
|
+
*/
|
|
115
|
+
export declare function isSignedTransparencyDeclaration(value: unknown): value is SignedTransparencyDeclaration;
|
|
116
|
+
//# sourceMappingURL=transparency.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transparency.d.ts","sourceRoot":"","sources":["../src/transparency.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAEjD;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB,EAAE,OAAsC,CAAC;AAExE;;;;;;GAMG;AACH,eAAO,MAAM,+BAA+B,EAAG,0BAAmC,CAAC;AAEnF;;;;GAIG;AACH,eAAO,MAAM,oBAAoB,EAAG,uCAAgD,CAAC;AAErF;;;;;;;;;;;;;;GAcG;AACH,MAAM,WAAW,6BAA6B;IAC5C,yGAAyG;IACzG,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,0DAA0D;IAC1D,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,mEAAmE;IACnE,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,4DAA4D;IAC5D,QAAQ,CAAC,gBAAgB,EAAE,MAAM,CAAC;IAClC;;;;;OAKG;IACH,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,uEAAuE;IACvE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,mEAAmE;IACnE,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;IACxB,mFAAmF;IACnF,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;CAC5B;AAED;;;;;;GAMG;AACH,MAAM,MAAM,yBAAyB,GAAG,IAAI,CAC1C,6BAA6B,EAC7B,MAAM,GAAG,aAAa,GAAG,UAAU,GAAG,kBAAkB,GAAG,SAAS,CACrE,CAAC;AAEF;;;;;GAKG;AACH,MAAM,WAAW,wBAAwB;IACvC,+DAA+D;IAC/D,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,0FAA0F;IAC1F,QAAQ,CAAC,iBAAiB,EAAE,MAAM,CAAC;IACnC,iGAAiG;IACjG,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;CACjC;AAED;;;;;;GAMG;AACH,wBAAgB,+BAA+B,CAC7C,KAAK,EAAE,OAAO,GACb,KAAK,IAAI,6BAA6B,CAaxC"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Operator-transparency declaration — the trust-anchor primitive.
|
|
3
|
+
*
|
|
4
|
+
* The motebit relay publishes a signed declaration of its observability
|
|
5
|
+
* posture at `/.well-known/motebit-transparency.json`. The declaration
|
|
6
|
+
* commits the operator to one Ed25519 public key (`relay_public_key`)
|
|
7
|
+
* and to the operator-defined `content` payload. Verifiers pin that
|
|
8
|
+
* key as the trust anchor for every other relay-asserted artifact:
|
|
9
|
+
* content-artifact manifests on state-export endpoints, settlement
|
|
10
|
+
* receipts the operator counter-signs, federation handshakes.
|
|
11
|
+
*
|
|
12
|
+
* This module exports the binding wire types per
|
|
13
|
+
* `spec/relay-transparency-v1.md` (2b-i, the trust-anchor primitive).
|
|
14
|
+
* The operator-comparison vocabulary (Stage 2b-ii — retention/processor
|
|
15
|
+
* field standardization) is deferred until a second motebit-compatible
|
|
16
|
+
* operator forces field standardization; the `content` field stays
|
|
17
|
+
* operator-defined here and verifiers MUST NOT reject declarations on
|
|
18
|
+
* unknown `content` fields.
|
|
19
|
+
*
|
|
20
|
+
* Doctrine: `docs/doctrine/operator-transparency.md`,
|
|
21
|
+
* `docs/doctrine/nist-alignment.md` §8 "savant gap closure",
|
|
22
|
+
* `docs/doctrine/self-attesting-system.md`.
|
|
23
|
+
*
|
|
24
|
+
* Permissive floor (Apache-2.0), type-only, zero runtime deps.
|
|
25
|
+
*/
|
|
26
|
+
/**
|
|
27
|
+
* The pinned cryptosuite for transparency declarations. JCS
|
|
28
|
+
* canonicalization (RFC 8785) + Ed25519 + hex signature encoding.
|
|
29
|
+
* Matches the identity-file + credential-anchor + content-artifact
|
|
30
|
+
* family. See `SUITE_REGISTRY` in `./crypto-suite.ts`.
|
|
31
|
+
*/
|
|
32
|
+
export const TRANSPARENCY_SUITE = "motebit-jcs-ed25519-hex-v1";
|
|
33
|
+
/**
|
|
34
|
+
* Canonical memo prefix the relay emits when anchoring the
|
|
35
|
+
* declaration hash to Solana via the Memo program. Full memo shape:
|
|
36
|
+
* `motebit:transparency:v1:{hash_hex}`. Verifiers scan for this
|
|
37
|
+
* prefix at the relay's pinned anchor address. See
|
|
38
|
+
* `spec/relay-transparency-v1.md` §5.2.
|
|
39
|
+
*/
|
|
40
|
+
export const TRANSPARENCY_ANCHOR_MEMO_PREFIX = "motebit:transparency:v1:";
|
|
41
|
+
/**
|
|
42
|
+
* Current spec identifier. Bumps require explicit doctrine alignment
|
|
43
|
+
* + a new wire-format spec doc — the verifier MUST reject declarations
|
|
44
|
+
* with unrecognized `spec` values.
|
|
45
|
+
*/
|
|
46
|
+
export const TRANSPARENCY_SPEC_ID = "motebit-transparency/draft-2026-04-14";
|
|
47
|
+
/**
|
|
48
|
+
* Type guard — narrows `unknown` to `SignedTransparencyDeclaration`.
|
|
49
|
+
* Structural shape only; does NOT verify the signature, anchor, or
|
|
50
|
+
* succession chain. Verifiers call this before parsing then proceed
|
|
51
|
+
* through the verification algorithm in `spec/relay-transparency-v1.md`
|
|
52
|
+
* §4.1.
|
|
53
|
+
*/
|
|
54
|
+
export function isSignedTransparencyDeclaration(value) {
|
|
55
|
+
if (typeof value !== "object" || value === null)
|
|
56
|
+
return false;
|
|
57
|
+
const o = value;
|
|
58
|
+
return (typeof o.spec === "string" &&
|
|
59
|
+
typeof o.declared_at === "number" &&
|
|
60
|
+
typeof o.relay_id === "string" &&
|
|
61
|
+
typeof o.relay_public_key === "string" &&
|
|
62
|
+
"content" in o &&
|
|
63
|
+
typeof o.hash === "string" &&
|
|
64
|
+
typeof o.suite === "string" &&
|
|
65
|
+
typeof o.signature === "string");
|
|
66
|
+
}
|
|
67
|
+
//# sourceMappingURL=transparency.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transparency.js","sourceRoot":"","sources":["../src/transparency.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAIH;;;;;GAKG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAY,4BAA4B,CAAC;AAExE;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,+BAA+B,GAAG,0BAAmC,CAAC;AAEnF;;;;GAIG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,uCAAgD,CAAC;AAoErF;;;;;;GAMG;AACH,MAAM,UAAU,+BAA+B,CAC7C,KAAc;IAEd,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI;QAAE,OAAO,KAAK,CAAC;IAC9D,MAAM,CAAC,GAAG,KAAgC,CAAC;IAC3C,OAAO,CACL,OAAO,CAAC,CAAC,IAAI,KAAK,QAAQ;QAC1B,OAAO,CAAC,CAAC,WAAW,KAAK,QAAQ;QACjC,OAAO,CAAC,CAAC,QAAQ,KAAK,QAAQ;QAC9B,OAAO,CAAC,CAAC,gBAAgB,KAAK,QAAQ;QACtC,SAAS,IAAI,CAAC;QACd,OAAO,CAAC,CAAC,IAAI,KAAK,QAAQ;QAC1B,OAAO,CAAC,CAAC,KAAK,KAAK,QAAQ;QAC3B,OAAO,CAAC,CAAC,SAAS,KAAK,QAAQ,CAChC,CAAC;AACJ,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@motebit/protocol",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.3.0",
|
|
4
4
|
"description": "Motebit protocol — identity, receipts, credentials, delegation, settlement, and trust algebra for sovereign AI agents. Types, semirings, routing primitives. Apache-2.0, zero dependencies.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|