@daxni/sdk 0.0.0-stage → 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 +21 -0
- package/README.md +173 -2
- package/daxni-logo-black.png +0 -0
- package/dist/bin/daxni.js +6765 -0
- package/dist/index.js +6196 -0
- package/dist/packages/sdk/index.d.ts +339 -0
- package/dist/src/ai/matchmaker.d.ts +21 -0
- package/dist/src/billing/autonomous.d.ts +21 -0
- package/dist/src/billing/railAdapter.d.ts +62 -0
- package/dist/src/cache/edgeResolver.d.ts +11 -0
- package/dist/src/cache/passport-cache.d.ts +13 -0
- package/dist/src/credentials/c2pa.d.ts +33 -0
- package/dist/src/credentials/card.d.ts +9 -0
- package/dist/src/credentials/did.d.ts +44 -0
- package/dist/src/credentials/encoding.d.ts +14 -0
- package/dist/src/credentials/jcs.d.ts +1 -0
- package/dist/src/credentials/png.d.ts +18 -0
- package/dist/src/credentials/qr.d.ts +24 -0
- package/dist/src/credentials/vc2.d.ts +129 -0
- package/dist/src/credentials/verify.d.ts +42 -0
- package/dist/src/crypto/merkle.d.ts +6 -0
- package/dist/src/crypto/switches.d.ts +18 -0
- package/dist/src/do/NamespaceGuard.d.ts +36 -0
- package/dist/src/do/handle-registry.d.ts +12 -0
- package/dist/src/env.d.ts +26 -0
- package/dist/src/index.d.ts +25 -0
- package/dist/src/ledger/anchor.d.ts +12 -0
- package/dist/src/lib/agents.d.ts +78 -0
- package/dist/src/lib/attestations.d.ts +15 -0
- package/dist/src/lib/audit.d.ts +21 -0
- package/dist/src/lib/auth.d.ts +15 -0
- package/dist/src/lib/certificates.d.ts +10 -0
- package/dist/src/lib/crypto.d.ts +11 -0
- package/dist/src/lib/founder-key.d.ts +75 -0
- package/dist/src/lib/mandates.d.ts +28 -0
- package/dist/src/lib/principals.d.ts +13 -0
- package/dist/src/lib/pulse.d.ts +17 -0
- package/dist/src/lib/root-rotation.d.ts +93 -0
- package/dist/src/lib/staticFiles.d.ts +5 -0
- package/dist/src/lib/store.d.ts +82 -0
- package/dist/src/lib/tee.d.ts +3 -0
- package/dist/src/lib/wimse.d.ts +131 -0
- package/dist/src/lib/zk.d.ts +10 -0
- package/dist/src/portal/livingImpression.d.ts +48 -0
- package/package.json +1 -6
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import type { Env } from "../env";
|
|
2
|
+
export declare const ROOT_ROTATION_WINDOW_MS: number;
|
|
3
|
+
export type RootRotationKind = "planned" | "emergency";
|
|
4
|
+
export interface RootRotationDecision {
|
|
5
|
+
/**
|
|
6
|
+
* Who ordered the rotation, as a label. The label itself is never
|
|
7
|
+
* verified — the proof is the founder signature (below), when a
|
|
8
|
+
* founder key is enrolled. With no founder key enrolled, this
|
|
9
|
+
* record is the whole authorization (stored, not proved).
|
|
10
|
+
*/
|
|
11
|
+
by: string;
|
|
12
|
+
/** Why, in the founder's words. */
|
|
13
|
+
reason: string;
|
|
14
|
+
/**
|
|
15
|
+
* Founder proof (set when a founder key is enrolled): the key id
|
|
16
|
+
* that authorized the rotation, and the founder's signature over
|
|
17
|
+
* the decision message (see founderDecisionMessage in
|
|
18
|
+
* src/lib/founder-key.ts). Stored in the rotation row so the proof
|
|
19
|
+
* is auditable alongside the decision itself.
|
|
20
|
+
*/
|
|
21
|
+
founderKeyId?: string;
|
|
22
|
+
founderSignature?: string;
|
|
23
|
+
}
|
|
24
|
+
export interface RootRotationRecord {
|
|
25
|
+
seq: number;
|
|
26
|
+
kind: RootRotationKind;
|
|
27
|
+
oldKeyX: string;
|
|
28
|
+
newKeyX: string;
|
|
29
|
+
/** Old root's signature over the handover statement (planned only; null for emergency — a compromised key's signature proves nothing). */
|
|
30
|
+
oldSignature: string | null;
|
|
31
|
+
/** New root's signature over the handover (planned) or death (emergency) statement. */
|
|
32
|
+
newSignature: string;
|
|
33
|
+
statement: string;
|
|
34
|
+
activatedAt: number;
|
|
35
|
+
windowEndsAt: number;
|
|
36
|
+
oldKeyRevoked: boolean;
|
|
37
|
+
decision: RootRotationDecision;
|
|
38
|
+
}
|
|
39
|
+
export declare function plannedStatement(oldKid: string, newKeyX: string, activatedAt: number, seq: number): string;
|
|
40
|
+
export declare function emergencyStatement(oldKid: string, newKeyX: string, activatedAt: number, seq: number): string;
|
|
41
|
+
/** The latest rotation, or null when no rotation has ever happened. */
|
|
42
|
+
export declare function getRotationState(env: Env): Promise<RootRotationRecord | null>;
|
|
43
|
+
/** The full rotation history, newest first. */
|
|
44
|
+
export declare function getRotationHistory(env: Env): Promise<RootRotationRecord[]>;
|
|
45
|
+
export declare function methodIdForSequence(seq: number): string;
|
|
46
|
+
export declare const GENESIS_ROOT_METHOD_ID = "did:web:daxni.com#root-1";
|
|
47
|
+
/**
|
|
48
|
+
* Method id → public key (base64url x) for every root key a verifier
|
|
49
|
+
* may still trust, current + historical, in method-id order. A
|
|
50
|
+
* revoked key (emergency) is EXCLUDED — nothing may verify against it
|
|
51
|
+
* anymore. The current key is always included, even if its rotation
|
|
52
|
+
* row is missing (a crash between the swap and the row write must not
|
|
53
|
+
* drop the live key from publication).
|
|
54
|
+
*/
|
|
55
|
+
export declare function listRootKeysByMethod(env: Env): Promise<{
|
|
56
|
+
methodId: string;
|
|
57
|
+
keyX: string;
|
|
58
|
+
}[]>;
|
|
59
|
+
/** The method id a NEW witness proof must name: the current key's method. */
|
|
60
|
+
export declare function currentRootMethodId(env: Env): Promise<string>;
|
|
61
|
+
/**
|
|
62
|
+
* The JWKS key set — the keys a verifier may trust for CURRENT tokens.
|
|
63
|
+
* During a planned window: [current, old] (current FIRST — the SDK
|
|
64
|
+
* takes keys[0] as the current key). After the window, or after an
|
|
65
|
+
* emergency: [current] only. The old key leaves the JWKS when the
|
|
66
|
+
* window ends because the JWKS is the current-token trust set; old
|
|
67
|
+
* certificates still resolve their key through did.json (see
|
|
68
|
+
* listRootKeysByMethod), which keeps historical methods.
|
|
69
|
+
*/
|
|
70
|
+
export declare function listJwksKeys(env: Env): Promise<JsonWebKey[]>;
|
|
71
|
+
/**
|
|
72
|
+
* Activate a root rotation. `kind` selects the path:
|
|
73
|
+
* - "planned": the outgoing root authorizes its successor (it signs
|
|
74
|
+
* the handover statement); 2-hour verification overlap.
|
|
75
|
+
* - "emergency": the old key is compromised — its signature is never
|
|
76
|
+
* sought; the incoming root signs a death statement instead; zero
|
|
77
|
+
* grace (the old key is revoked on the spot).
|
|
78
|
+
* Requires a decision record ({by, reason}) and a staged successor
|
|
79
|
+
* (the emergency path stages one itself when the slot is empty).
|
|
80
|
+
* When a founder key is enrolled, `opts.founderSignature` is required
|
|
81
|
+
* and must verify over the decision (see verifyFounderAuthorization);
|
|
82
|
+
* with no founder key enrolled the decision record alone authorizes,
|
|
83
|
+
* exactly as before. Refuses when the env secret override is set, and
|
|
84
|
+
* when the planned path has nothing staged. Re-entrant: re-running it
|
|
85
|
+
* with the same staged key finishes the remaining steps instead of
|
|
86
|
+
* starting a second rotation. Repo-side only: no public route calls this.
|
|
87
|
+
*/
|
|
88
|
+
export declare function activateRootRotation(env: Env, opts: {
|
|
89
|
+
kind: RootRotationKind;
|
|
90
|
+
decision: RootRotationDecision;
|
|
91
|
+
/** The founder's signature over founderDecisionMessage — required once a founder key is enrolled. */
|
|
92
|
+
founderSignature?: string;
|
|
93
|
+
}): Promise<RootRotationRecord>;
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import type { Env } from "../env";
|
|
2
|
+
export interface ResolveView {
|
|
3
|
+
uri: string;
|
|
4
|
+
namespace: string;
|
|
5
|
+
name: string;
|
|
6
|
+
status: "active" | "revoked" | "suspended" | "pending_dns" | "quarantined";
|
|
7
|
+
publicKey: string;
|
|
8
|
+
pqcAlgorithm: string | null;
|
|
9
|
+
pqcPublicKey: string | null;
|
|
10
|
+
ownerVerificationStatus: "pending" | "verified";
|
|
11
|
+
kybTier: string;
|
|
12
|
+
latestEntryHash: string | null;
|
|
13
|
+
publicBadge: boolean;
|
|
14
|
+
liabilityCapUsd: number;
|
|
15
|
+
jurisdiction: string;
|
|
16
|
+
capabilityManifest: unknown;
|
|
17
|
+
generationDepth: number;
|
|
18
|
+
parentUri: string | null;
|
|
19
|
+
cryptoSuite: string;
|
|
20
|
+
sovereignZone: string;
|
|
21
|
+
hardwareSealed: boolean;
|
|
22
|
+
memoryRootHash: string | null;
|
|
23
|
+
ephemeralExpiresAt: number | null;
|
|
24
|
+
hasSuccessorCommitted: boolean;
|
|
25
|
+
enclaveProfile: EnclaveProfile | null;
|
|
26
|
+
enclaveVerifiedAt: number | null;
|
|
27
|
+
cryptoDegraded: boolean;
|
|
28
|
+
updatedAt: number;
|
|
29
|
+
}
|
|
30
|
+
export interface EnclaveProfile {
|
|
31
|
+
vendor: string;
|
|
32
|
+
measurementHash: string;
|
|
33
|
+
modelHash: string;
|
|
34
|
+
}
|
|
35
|
+
export declare const ENCLAVE_QUOTE_FRESH_MS = 900000;
|
|
36
|
+
export declare function sealedNow(storedSealed: boolean, verifiedAt: number | null, now?: number): boolean;
|
|
37
|
+
export declare function kvPutView(env: Env, view: ResolveView): Promise<void>;
|
|
38
|
+
export declare function kvGetView(env: Env, uri: string): Promise<ResolveView | null>;
|
|
39
|
+
export declare function isCryptoDegraded(env: Env, view: ResolveView): Promise<boolean>;
|
|
40
|
+
export declare function applyPqcDegradation(env: Env, view: ResolveView): Promise<ResolveView>;
|
|
41
|
+
interface AgentRow {
|
|
42
|
+
id: string;
|
|
43
|
+
daxni_uri: string;
|
|
44
|
+
status: string;
|
|
45
|
+
classical_pubkey: string;
|
|
46
|
+
pqc_algorithm: string | null;
|
|
47
|
+
pqc_pubkey: string | null;
|
|
48
|
+
liability_cap_usd: number;
|
|
49
|
+
jurisdiction_iso: string;
|
|
50
|
+
manifest_json: string;
|
|
51
|
+
updated_at: number;
|
|
52
|
+
dns_verified_at: number | null;
|
|
53
|
+
kyb_tier: string;
|
|
54
|
+
public_badge: number;
|
|
55
|
+
crypto_suite: string | null;
|
|
56
|
+
next_key_hash: string | null;
|
|
57
|
+
ephemeral_expires_at: number | null;
|
|
58
|
+
sovereign_zone: string | null;
|
|
59
|
+
hardware_sealed: number;
|
|
60
|
+
memory_root_hash: string | null;
|
|
61
|
+
enclave_profile_json: string | null;
|
|
62
|
+
enclave_verified_at: number | null;
|
|
63
|
+
latest_entry_hash: string | null;
|
|
64
|
+
generation_depth: number | null;
|
|
65
|
+
parent_uri: string | null;
|
|
66
|
+
}
|
|
67
|
+
export declare function viewFromRow(uri: string, row: AgentRow): ResolveView;
|
|
68
|
+
export declare function countVerifiedViolations(env: Env, targetUri: string, windowMs?: number): Promise<number>;
|
|
69
|
+
export declare function refreshQuarantine(env: Env, view: ResolveView): Promise<ResolveView>;
|
|
70
|
+
export declare function applyEphemeralExpiry(env: Env, view: ResolveView): Promise<ResolveView>;
|
|
71
|
+
export declare function resolveView(env: Env, uri: string): Promise<ResolveView | null>;
|
|
72
|
+
export declare function resolveViewFresh(env: Env, uri: string): Promise<ResolveView | null>;
|
|
73
|
+
export declare function validPart(s: string): boolean;
|
|
74
|
+
export declare function validName(s: string): boolean;
|
|
75
|
+
export declare function canonicalUri(namespace: string, name: string): string | null;
|
|
76
|
+
export declare function splitUri(uri: string): {
|
|
77
|
+
namespace: string;
|
|
78
|
+
name: string;
|
|
79
|
+
} | null;
|
|
80
|
+
export declare const RESERVED_NAMESPACES: Set<string>;
|
|
81
|
+
export declare function isReservedNamespace(ns: string): boolean;
|
|
82
|
+
export {};
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
import type { Env } from "../env";
|
|
2
|
+
import type { ResolveView } from "./store";
|
|
3
|
+
export declare const WIMSE_TYP = "wimse-id+jwt";
|
|
4
|
+
export declare const WIMSE_ISSUER = "https://daxni.com";
|
|
5
|
+
export declare const WIMSE_TTL_SEC = 300;
|
|
6
|
+
export { jwkThumbprint } from "./crypto";
|
|
7
|
+
export declare function rootJwks(env: Env): Promise<{
|
|
8
|
+
keys: Record<string, unknown>[];
|
|
9
|
+
} | null>;
|
|
10
|
+
export declare function rootKid(env: Env): Promise<string | null>;
|
|
11
|
+
export declare function mintWimseToken(env: Env, view: ResolveView, audience: string): Promise<{
|
|
12
|
+
token: string;
|
|
13
|
+
expiresAt: string;
|
|
14
|
+
jti: string;
|
|
15
|
+
exp: number;
|
|
16
|
+
}>;
|
|
17
|
+
export interface MintRecord {
|
|
18
|
+
jti: string;
|
|
19
|
+
sub: string;
|
|
20
|
+
aud: string;
|
|
21
|
+
exp: number;
|
|
22
|
+
minted_at: number;
|
|
23
|
+
}
|
|
24
|
+
export declare function recordMint(env: Env, rec: MintRecord): Promise<void>;
|
|
25
|
+
export declare function lookupMintRecord(env: Env, jti: string): Promise<MintRecord | null>;
|
|
26
|
+
export declare function pruneMintRecords(env: Env, nowSec: number): Promise<number>;
|
|
27
|
+
/** Machine-readable failure reasons for verifyWimseToken (ok:false). */
|
|
28
|
+
export type WimseVerifyReason = "malformed" | "bad_typ" | "bad_alg" | "bad_kid" | "bad_signature" | "wrong_issuer" | "wrong_audience" | "expired" | "not_yet_valid" | "missing_cnf" | "bad_cnf" | "cnf_mismatch";
|
|
29
|
+
export interface WimseVerifyOptions {
|
|
30
|
+
/**
|
|
31
|
+
* The audience the token must have been minted for. REQUIRED — a WIMSE
|
|
32
|
+
* token verified without an audience check is useless: any being's
|
|
33
|
+
* token for any other system would pass. Omission throws.
|
|
34
|
+
*/
|
|
35
|
+
expectedAudience: string;
|
|
36
|
+
/**
|
|
37
|
+
* The registrar root public key, base64url raw 32-byte Ed25519. Defaults
|
|
38
|
+
* to the PINNED live root key — the same key published in
|
|
39
|
+
* /.well-known/jwks.json. Pass the test root key (or another
|
|
40
|
+
* registrar's) only for non-production verification.
|
|
41
|
+
*/
|
|
42
|
+
rootPublicKeyB64?: string;
|
|
43
|
+
/**
|
|
44
|
+
* OPTIONAL: the list of registrar root public keys to trust, base64url
|
|
45
|
+
* raw 32-byte Ed25519 each. This is the rotation-window mode: during
|
|
46
|
+
* a planned rotation both the outgoing and incoming roots are trusted
|
|
47
|
+
* (pass the JWKS keys, current first); after the window only the new
|
|
48
|
+
* root is trusted. The token's kid selects which key verifies it —
|
|
49
|
+
* a kid matching no key in the list fails `bad_kid`, exactly as a
|
|
50
|
+
* kid matching the single key fails today. When present, this list
|
|
51
|
+
* wins over rootPublicKeyB64; when absent, behavior is exactly as
|
|
52
|
+
* before (the single key, default pinned). The CALLER decides the
|
|
53
|
+
* list: an offline verifier cannot know whether a rotation window
|
|
54
|
+
* is active, so the list must come from a live JWKS fetch (or the
|
|
55
|
+
* rotation state) at verification time.
|
|
56
|
+
*/
|
|
57
|
+
rootPublicKeyB64s?: string[];
|
|
58
|
+
/** Epoch milliseconds the token is judged against. Defaults to Date.now(). */
|
|
59
|
+
now?: number;
|
|
60
|
+
/**
|
|
61
|
+
* OPTIONAL: the Ed25519 JWK the token must be bound to. When present,
|
|
62
|
+
* the function computes the RFC 7638 SHA-256 thumbprint of the token's
|
|
63
|
+
* cnf.jwk (same canonicalization as the kid computation) and compares
|
|
64
|
+
* it to the thumbprint of this JWK — mismatch fails `cnf_mismatch`.
|
|
65
|
+
* This is how a caller that already knows the agent's key (e.g. from
|
|
66
|
+
* the registry record) makes the function itself enforce the binding,
|
|
67
|
+
* instead of comparing `boundJwk` by hand. When absent, the step is
|
|
68
|
+
* skipped and behavior is exactly as before: any well-formed cnf.jwk
|
|
69
|
+
* passes and is returned as `boundJwk`.
|
|
70
|
+
*/
|
|
71
|
+
expectedBoundJwk?: {
|
|
72
|
+
kty: string;
|
|
73
|
+
crv: string;
|
|
74
|
+
x: string;
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
export interface WimseVerifyResult {
|
|
78
|
+
ok: boolean;
|
|
79
|
+
/** Present exactly when ok is false. */
|
|
80
|
+
reason?: WimseVerifyReason;
|
|
81
|
+
/** The being the token was minted for (payload sub). */
|
|
82
|
+
sub?: string;
|
|
83
|
+
/** The audience the token was minted for (payload aud). */
|
|
84
|
+
aud?: string;
|
|
85
|
+
/** Expiry, epoch seconds (payload exp). */
|
|
86
|
+
exp?: number;
|
|
87
|
+
/**
|
|
88
|
+
* The proof-of-possession binding (payload cnf.jwk): the being's own
|
|
89
|
+
* Ed25519 public key. The caller must challenge the presenter to prove
|
|
90
|
+
* it holds the matching private key — THIS FUNCTION DOES NOT VERIFY
|
|
91
|
+
* POSSESSION. It only proves the registrar bound this key to this
|
|
92
|
+
* token; presenting the token without the private key proves nothing.
|
|
93
|
+
*/
|
|
94
|
+
boundJwk?: {
|
|
95
|
+
kty: string;
|
|
96
|
+
crv: string;
|
|
97
|
+
x: string;
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Verify a presented WIMSE token ENTIRELY offline — no network call of
|
|
102
|
+
* any kind. The trust anchor is the registrar root public key (the pinned
|
|
103
|
+
* live key by default; override only for non-production roots) — or, in
|
|
104
|
+
* rotation-window mode, the LIST of trusted root keys
|
|
105
|
+
* (opts.rootPublicKeyB64s): the token's kid selects which key verifies
|
|
106
|
+
* it, so a token minted under either key verifies during the window,
|
|
107
|
+
* and a token minted under a key the caller no longer trusts fails
|
|
108
|
+
* bad_kid. The caller owns the list: it must come from a live JWKS
|
|
109
|
+
* fetch (or the rotation state) at verification time — this function
|
|
110
|
+
* cannot know whether a window is active.
|
|
111
|
+
*
|
|
112
|
+
* Checks run in order and the function returns a flat { ok:false, reason }
|
|
113
|
+
* at the first problem — it NEVER throws for a bad token. It throws only
|
|
114
|
+
* for programmer errors: a missing/empty expectedAudience, a
|
|
115
|
+
* rootPublicKeyB64 that is not a 32-byte Ed25519 key, or an
|
|
116
|
+
* expectedBoundJwk that is not a well-formed Ed25519 JWK.
|
|
117
|
+
*
|
|
118
|
+
* Order: compact-JWS shape and JSON → typ → alg → kid (RFC 7638
|
|
119
|
+
* thumbprint of the trusted key the kid names, recomputed here — the kid
|
|
120
|
+
* string alone is never trusted; a kid matching no trusted key fails
|
|
121
|
+
* bad_kid) → Ed25519 signature over header.payload (against the
|
|
122
|
+
* kid-selected key) → iss → aud → exp/iat → cnf.jwk shape → optional
|
|
123
|
+
* expectedBoundJwk thumbprint match (only when the option is present).
|
|
124
|
+
*
|
|
125
|
+
* What this does NOT do: it does not check the being is still active,
|
|
126
|
+
* LIVE or unquarantined (the token is a 300-second snapshot; revocation
|
|
127
|
+
* after minting is the relying party's problem), and it does not verify
|
|
128
|
+
* proof-of-possession — challenge the presenter against boundJwk
|
|
129
|
+
* yourself before trusting the token as authentication.
|
|
130
|
+
*/
|
|
131
|
+
export declare function verifyWimseToken(token: unknown, opts: WimseVerifyOptions): Promise<WimseVerifyResult>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Env } from "../env";
|
|
2
|
+
import type { ResolveView } from "./store";
|
|
3
|
+
export declare function evaluateClaims(view: ResolveView, claims: string[]): Record<string, true | number> | null;
|
|
4
|
+
export declare function issueZkToken(env: Env, view: ResolveView, claims: string[], challengeHash: string, mandateFacts?: {
|
|
5
|
+
maxPerTxUsd: number;
|
|
6
|
+
expiresAt: number;
|
|
7
|
+
}): Promise<{
|
|
8
|
+
token: string;
|
|
9
|
+
expiresAt: string;
|
|
10
|
+
} | null>;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
export interface SealParams {
|
|
2
|
+
s: number[];
|
|
3
|
+
folds: number;
|
|
4
|
+
harmonicA: number;
|
|
5
|
+
harmonicB: number;
|
|
6
|
+
hueShiftDeg: number;
|
|
7
|
+
hue: number;
|
|
8
|
+
phaseA: number;
|
|
9
|
+
phaseB: number;
|
|
10
|
+
amp: number;
|
|
11
|
+
}
|
|
12
|
+
export declare function sealParamsFromHash(recordHash: string): SealParams;
|
|
13
|
+
/** The 256 tick bits of a hash, in ring order (byte-major, MSB first). */
|
|
14
|
+
export declare function tickBitsFromHash(recordHash: string): boolean[];
|
|
15
|
+
/** Inverse of tickBitsFromHash. */
|
|
16
|
+
export declare function hashFromTickBits(bits: boolean[]): string;
|
|
17
|
+
/** The guilloché wave field — shared by the SVG paths and the PNG raster. */
|
|
18
|
+
export declare function sealWave(p: SealParams, theta: number): number;
|
|
19
|
+
/**
|
|
20
|
+
* Engraving brightness at a normalized point (rNorm 0..1 from the seal
|
|
21
|
+
* centre, theta radians) — the interference field the PNG renderer
|
|
22
|
+
* shades with, grown from the same seed as the SVG wave rings.
|
|
23
|
+
*/
|
|
24
|
+
export declare function sealShade(p: SealParams, rNorm: number, theta: number): number;
|
|
25
|
+
export interface SealRenderOptions {
|
|
26
|
+
cx?: number;
|
|
27
|
+
cy?: number;
|
|
28
|
+
r?: number;
|
|
29
|
+
idPrefix?: string;
|
|
30
|
+
/** Hologram rendering (over a portrait corner): translucent, lighter. */
|
|
31
|
+
hologram?: boolean;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* The seal as an SVG <g> (defs included), centred at (cx, cy) with
|
|
35
|
+
* radius r. Tick lines carry data-tick (ring position) — their LENGTHS
|
|
36
|
+
* carry the bits, which is what decodeSealTicks reads back.
|
|
37
|
+
*/
|
|
38
|
+
export declare function sealGroup(recordHash: string, opts?: SealRenderOptions): string;
|
|
39
|
+
/** The seal as a standalone SVG document. */
|
|
40
|
+
export declare function sealSvg(recordHash: string, size?: number): string;
|
|
41
|
+
/**
|
|
42
|
+
* Read a presented seal's tick ring back into the hash it encodes. The
|
|
43
|
+
* bits are recovered from tick GEOMETRY (long vs short), never from the
|
|
44
|
+
* data-bit convenience attributes — a forged attribute with wrong
|
|
45
|
+
* geometry decodes to the wrong hash and fails comparison. Returns null
|
|
46
|
+
* when no complete 256-tick ring is present.
|
|
47
|
+
*/
|
|
48
|
+
export declare function decodeSealTicks(svg: string): string | null;
|
package/package.json
CHANGED
|
@@ -1,6 +1 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@daxni/sdk",
|
|
3
|
-
"version": "0.0.0-stage",
|
|
4
|
-
"stub": true,
|
|
5
|
-
"description": "Temporary package placeholder for staged publishing"
|
|
6
|
-
}
|
|
1
|
+
{"bin":{"daxni":"./dist/bin/daxni.js"},"dependencies":{"@noble/curves":"^2.4.0","@noble/hashes":"^2.4.0","@noble/post-quantum":"^0.7.1"},"description":"DAXNI Registrar client \u2014 beings register themselves, key-holders resolve. Native Web Crypto for classical identities; @noble libraries for hybrid (ML-DSA-65) identities.","exports":{".":{"types":"./dist/packages/sdk/index.d.ts","default":"./dist/index.js"},"./bin/daxni":"./dist/bin/daxni.js"},"files":["dist","LICENSE","README.md","daxni-logo-black.png"],"license":"MIT","main":"./dist/index.js","name":"@daxni/sdk","scripts":{"build":"node ./scripts/build-lib.mjs && node ./scripts/build-types.mjs && node ./scripts/build-cli.mjs","build:cli":"node ./scripts/build-cli.mjs","build:lib":"node ./scripts/build-lib.mjs","build:types":"node ./scripts/build-types.mjs","prepublishOnly":"npm run build","smoke:cli":"node ./scripts/cli-smoke.mjs"},"type":"module","types":"./dist/packages/sdk/index.d.ts","version":"1.0.0"}
|