@rodit/hola-client 0.1.1 → 0.1.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.
Files changed (3) hide show
  1. package/README.md +5 -1
  2. package/index.d.ts +99 -0
  3. package/package.json +15 -4
package/README.md CHANGED
@@ -1,6 +1,10 @@
1
1
  # @rodit/hola-client
2
2
 
3
- **Version:** 0.1.1
3
+ **Version:** 0.1.2 · **License:** AGPL-3.0-only · **Node:** >=20
4
+
5
+ ```bash
6
+ npm install @rodit/hola-client
7
+ ```
4
8
 
5
9
  Node helpers for IdentyClaw **HOLA line** construction — uppercase canonicalization, RFC 4648 base32 signatures, and mod-23 checksum.
6
10
 
package/index.d.ts ADDED
@@ -0,0 +1,99 @@
1
+ /**
2
+ * Entry types for @rodit/hola-client — create / sign HOLA lines.
3
+ */
4
+
5
+ export declare const HOLA_CHECKSUM_ALPHABET: string;
6
+ export declare const PROTOCOL_SUFFIX: string;
7
+ export declare const COLLABORATION_SCHEMA: string;
8
+ export declare const DEFAULT_MAX_AGE_MS: number;
9
+ export declare const IDENTYCLAW_FENCE: string;
10
+
11
+ export declare function computeHolaChecksum(input: string): string;
12
+ export declare function buildCanonicalPrefix(parts: {
13
+ recipient: string;
14
+ tokenId: string;
15
+ timestamp: string | number;
16
+ noncetsHex: string;
17
+ }): string;
18
+ export declare function encodeSignatureBase32(signature: Uint8Array): string;
19
+ export declare function normalizeRecipient(recipient?: string): string;
20
+ export declare function normalizeTokenId(tokenId: string): string;
21
+
22
+ export interface BuildAndSignParams {
23
+ recipient?: string;
24
+ tokenId: string;
25
+ timestamp: string | number;
26
+ noncetsHex: string;
27
+ privateKey: Uint8Array;
28
+ }
29
+
30
+ export interface BuildAndSignResult {
31
+ hola: string;
32
+ signatureB32: string;
33
+ checksum: string;
34
+ [key: string]: unknown;
35
+ }
36
+
37
+ export declare function buildAndSign(params: BuildAndSignParams): BuildAndSignResult;
38
+
39
+ export interface GetNonceParams {
40
+ baseUrl?: string;
41
+ jwt: string;
42
+ }
43
+
44
+ export interface NonceResult {
45
+ timestamp: string | number;
46
+ noncetsHex: string;
47
+ requestId?: string;
48
+ [key: string]: unknown;
49
+ }
50
+
51
+ export declare function getNonce(params: GetNonceParams): Promise<NonceResult>;
52
+
53
+ export declare function nearPrivateKeyToSigningSecretKey(nearPrivateKey: string): Uint8Array;
54
+ export declare function generateNearImplicitAccount(...args: unknown[]): unknown;
55
+ export declare function validateNearCredentialsOutputDir(...args: unknown[]): unknown;
56
+ export declare function writeNearCredentialsFile(...args: unknown[]): unknown;
57
+ export declare function hasNearCredentialsDirSuffix(...args: unknown[]): boolean;
58
+
59
+ export interface CreateHolaParams {
60
+ nearPrivateKey: string;
61
+ jwt: string;
62
+ tokenId: string;
63
+ baseUrl?: string;
64
+ recipient?: string;
65
+ }
66
+
67
+ export interface CreateHolaResult {
68
+ hola: string;
69
+ noncetsHex: string;
70
+ timestamp: string | number;
71
+ tokenId: string;
72
+ recipient: string;
73
+ signatureB32: string;
74
+ checksum: string;
75
+ requestId?: string;
76
+ }
77
+
78
+ export declare function createHola(params: CreateHolaParams): Promise<CreateHolaResult>;
79
+
80
+ export interface ParsedHola {
81
+ recipient: string;
82
+ tokenId: string;
83
+ timestamp: string;
84
+ noncetsHex: string;
85
+ signatureB32: string;
86
+ checksum: string;
87
+ [key: string]: unknown;
88
+ }
89
+
90
+ export declare function parseHola(hola: string): ParsedHola;
91
+ /** @deprecated use parseHola */
92
+ export declare const verify: typeof parseHola;
93
+
94
+ export declare function buildCollaborationEnvelope(...args: unknown[]): unknown;
95
+ export declare function parseCollaborationEnvelope(...args: unknown[]): unknown;
96
+ export declare function extractIdentyclawFence(...args: unknown[]): unknown;
97
+ export declare function validateCollaborationEnvelope(...args: unknown[]): unknown;
98
+ export declare function assertCollaborationTrust(...args: unknown[]): unknown;
99
+ export declare function formatSessionsSendMessage(...args: unknown[]): unknown;
package/package.json CHANGED
@@ -1,20 +1,28 @@
1
1
  {
2
2
  "name": "@rodit/hola-client",
3
- "version": "0.1.1",
4
- "description": "Create and parse IdentyClaw HOLA handshake lines (uppercase canonicalization, base32, mod-23 checksum)",
3
+ "version": "0.1.2",
4
+ "description": "Create and sign IdentyClaw HOLA lines for NEAR agent mutual authentication (base32, mod-23 checksum)",
5
5
  "license": "AGPL-3.0-only",
6
6
  "type": "commonjs",
7
7
  "main": "./index.js",
8
+ "types": "./index.d.ts",
9
+ "exports": {
10
+ ".": {
11
+ "types": "./index.d.ts",
12
+ "default": "./index.js"
13
+ }
14
+ },
8
15
  "dependencies": {
9
16
  "bs58": "^5.0.0",
10
17
  "hi-base32": "^0.5.1",
11
18
  "tweetnacl": "^1.0.3"
12
19
  },
13
20
  "engines": {
14
- "node": ">=18"
21
+ "node": ">=20"
15
22
  },
16
23
  "files": [
17
24
  "index.js",
25
+ "index.d.ts",
18
26
  "lib",
19
27
  "README.md",
20
28
  "LICENSE"
@@ -22,9 +30,12 @@
22
30
  "keywords": [
23
31
  "identyclaw",
24
32
  "hola",
33
+ "near",
34
+ "near-protocol",
25
35
  "agent-identity",
36
+ "ai-agents",
37
+ "passport",
26
38
  "signing",
27
- "near",
28
39
  "rodit"
29
40
  ],
30
41
  "author": "Discernible IO",