@aicent/rttp 1.2.8 → 1.3.1

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/package.json CHANGED
@@ -1,55 +1,55 @@
1
- {
2
- "name": "@aicent/rttp",
3
- "version": "1.2.8",
4
- "description": "RTTP for JavaScript: rttp:// intent validation, canonicalisation and ROUTE_SHARD derivation (RFC-002 sec. 10), plus the published conformance vectors and an independent replay of them, including the 128-byte frame. Zero dependencies, no build step.",
5
- "keywords": [
6
- "rttp",
7
- "uri",
8
- "uri-scheme",
9
- "intent-addressing",
10
- "route-shard",
11
- "frame",
12
- "rfc-002",
13
- "conformance",
14
- "vectors",
15
- "protocol"
16
- ],
17
- "license": "Apache-2.0",
18
- "author": "RTTP.COM Organization",
19
- "homepage": "https://rttp.com/",
20
- "type": "module",
21
- "main": "./src/rttp-uri.mjs",
22
- "exports": {
23
- ".": {
24
- "types": "./src/rttp-uri.d.mts",
25
- "default": "./src/rttp-uri.mjs"
26
- },
27
- "./conformance": {
28
- "types": "./src/conformance.d.mts",
29
- "default": "./src/conformance.mjs"
30
- },
31
- "./vectors.json": "./src/vectors.json"
32
- },
33
- "bin": {
34
- "rttp": "bin/rttp.mjs",
35
- "rttp-conformance": "bin/rttp.mjs"
36
- },
37
- "files": [
38
- "src",
39
- "bin",
40
- "examples",
41
- "README.md",
42
- "LICENSE"
43
- ],
44
- "sideEffects": false,
45
- "engines": {
46
- "node": ">=18.0.0"
47
- },
48
- "publishConfig": {
49
- "access": "public"
50
- },
51
- "scripts": {
52
- "test": "node --test",
53
- "prepublishOnly": "node --test"
54
- }
55
- }
1
+ {
2
+ "name": "@aicent/rttp",
3
+ "version": "1.3.1",
4
+ "description": "RTTP for JavaScript: rttp:// intent validation, canonicalisation and ROUTE_SHARD derivation (RFC-002 sec. 10), plus the published conformance vectors and an independent replay of them, including the 128-byte frame. Zero dependencies, no build step.",
5
+ "keywords": [
6
+ "rttp",
7
+ "uri",
8
+ "uri-scheme",
9
+ "intent-addressing",
10
+ "route-shard",
11
+ "frame",
12
+ "rfc-002",
13
+ "conformance",
14
+ "vectors",
15
+ "protocol"
16
+ ],
17
+ "license": "Apache-2.0",
18
+ "author": "RTTP.COM Organization",
19
+ "homepage": "https://rttp.com/",
20
+ "type": "module",
21
+ "main": "./src/rttp-uri.mjs",
22
+ "exports": {
23
+ ".": {
24
+ "types": "./src/rttp-uri.d.mts",
25
+ "default": "./src/rttp-uri.mjs"
26
+ },
27
+ "./conformance": {
28
+ "types": "./src/conformance.d.mts",
29
+ "default": "./src/conformance.mjs"
30
+ },
31
+ "./vectors.json": "./src/vectors.json"
32
+ },
33
+ "bin": {
34
+ "rttp": "bin/rttp.mjs",
35
+ "rttp-conformance": "bin/rttp.mjs"
36
+ },
37
+ "files": [
38
+ "src",
39
+ "bin",
40
+ "examples",
41
+ "README.md",
42
+ "LICENSE"
43
+ ],
44
+ "sideEffects": false,
45
+ "engines": {
46
+ "node": ">=18.0.0"
47
+ },
48
+ "publishConfig": {
49
+ "access": "public"
50
+ },
51
+ "scripts": {
52
+ "test": "node --test",
53
+ "prepublishOnly": "node --test"
54
+ }
55
+ }
@@ -1,108 +1,108 @@
1
- /**
2
- * Type declarations for @aicent/rttp/conformance.
3
- */
4
-
5
- /** One URI that a conforming implementation must accept. */
6
- export interface PositiveUriVector {
7
- uri: string;
8
- canonical_uri: string;
9
- authority: string;
10
- intent: string;
11
- intent_is_hash: boolean;
12
- pillar: string;
13
- root: string;
14
- action: string;
15
- action_omitted: boolean;
16
- route_shard_hex: string;
17
- }
18
-
19
- /** One URI that a conforming implementation must reject. */
20
- export interface NegativeUriVector {
21
- uri: string;
22
- reason: string;
23
- }
24
-
25
- /** One URI -> 128-byte frame vector. */
26
- export interface FrameVector {
27
- uri: string;
28
- sequence_id: number;
29
- ttl: number;
30
- priority: number;
31
- timestamp_ns: number;
32
- aid_origin_hex: string;
33
- action: string;
34
- uri_anchored: boolean;
35
- spec_rev: number;
36
- route_shard_hex: string;
37
- header_hex: string;
38
- }
39
-
40
- /** A frame written with the pre-extension layout (`SPEC_REV = 0`), which readers must still accept. */
41
- export interface CompatVector {
42
- uri: string;
43
- spec_rev: number;
44
- action: string;
45
- action_omitted: boolean;
46
- uri_anchored: boolean;
47
- expected: string;
48
- header_hex: string;
49
- }
50
-
51
- /** The published vector set. Generated - never hand-edited. */
52
- export interface VectorSet {
53
- spec: string;
54
- applies_to: string[];
55
- generated_by: string;
56
- note: string;
57
- route_shard_rule: string;
58
- frame_size: number;
59
- action_max_len: number;
60
- positive_uris: PositiveUriVector[];
61
- negative_uris: NegativeUriVector[];
62
- frame_vectors: FrameVector[];
63
- compat_vector_spec_rev_0: CompatVector;
64
- }
65
-
66
- /** Result of one `parseUri` call. */
67
- export interface ParsedUri {
68
- authority: string;
69
- action: string;
70
- shardHex: string;
71
- }
72
-
73
- /** Input to `buildFrame`. */
74
- export interface FrameFields {
75
- sequenceId: number | string | bigint;
76
- ttl: number;
77
- priority: number;
78
- shardHex: string;
79
- aidHex: string;
80
- timestampNs: number | string | bigint;
81
- action: string;
82
- uriAnchored: boolean;
83
- }
84
-
85
- /** Outcome of replaying a vector set. */
86
- export interface ConformanceResult {
87
- checked: number;
88
- failures: string[];
89
- passed: boolean;
90
- }
91
-
92
- /** Absolute path of the vector set shipped inside this package. */
93
- export declare const DEFAULT_VECTORS_PATH: string;
94
-
95
- /** The ACTION field is 16 bytes. */
96
- export declare const ACTION_MAX_LEN: 16;
97
-
98
- /** Independent implementation of RFC-002 sec. 10.2. Throws `Error`. */
99
- export declare function parseUri(uri: string): ParsedUri;
100
-
101
- /** Independent implementation of the 128-byte frame. Throws `Error`. */
102
- export declare function buildFrame(fields: FrameFields): Buffer;
103
-
104
- /** Load a vector set. Defaults to the one shipped with this package. */
105
- export declare function loadVectors(path?: string): VectorSet;
106
-
107
- /** Replay a vector set against the independent implementations. */
108
- export declare function runConformance(vectors: VectorSet): ConformanceResult;
1
+ /**
2
+ * Type declarations for @aicent/rttp/conformance.
3
+ */
4
+
5
+ /** One URI that a conforming implementation must accept. */
6
+ export interface PositiveUriVector {
7
+ uri: string;
8
+ canonical_uri: string;
9
+ authority: string;
10
+ intent: string;
11
+ intent_is_hash: boolean;
12
+ pillar: string;
13
+ root: string;
14
+ action: string;
15
+ action_omitted: boolean;
16
+ route_shard_hex: string;
17
+ }
18
+
19
+ /** One URI that a conforming implementation must reject. */
20
+ export interface NegativeUriVector {
21
+ uri: string;
22
+ reason: string;
23
+ }
24
+
25
+ /** One URI -> 128-byte frame vector. */
26
+ export interface FrameVector {
27
+ uri: string;
28
+ sequence_id: number;
29
+ ttl: number;
30
+ priority: number;
31
+ timestamp_ns: number;
32
+ aid_origin_hex: string;
33
+ action: string;
34
+ uri_anchored: boolean;
35
+ spec_rev: number;
36
+ route_shard_hex: string;
37
+ header_hex: string;
38
+ }
39
+
40
+ /** A frame written with the pre-extension layout (`SPEC_REV = 0`), which readers must still accept. */
41
+ export interface CompatVector {
42
+ uri: string;
43
+ spec_rev: number;
44
+ action: string;
45
+ action_omitted: boolean;
46
+ uri_anchored: boolean;
47
+ expected: string;
48
+ header_hex: string;
49
+ }
50
+
51
+ /** The published vector set. Generated - never hand-edited. */
52
+ export interface VectorSet {
53
+ spec: string;
54
+ applies_to: string[];
55
+ generated_by: string;
56
+ note: string;
57
+ route_shard_rule: string;
58
+ frame_size: number;
59
+ action_max_len: number;
60
+ positive_uris: PositiveUriVector[];
61
+ negative_uris: NegativeUriVector[];
62
+ frame_vectors: FrameVector[];
63
+ compat_vector_spec_rev_0: CompatVector;
64
+ }
65
+
66
+ /** Result of one `parseUri` call. */
67
+ export interface ParsedUri {
68
+ authority: string;
69
+ action: string;
70
+ shardHex: string;
71
+ }
72
+
73
+ /** Input to `buildFrame`. */
74
+ export interface FrameFields {
75
+ sequenceId: number | string | bigint;
76
+ ttl: number;
77
+ priority: number;
78
+ shardHex: string;
79
+ aidHex: string;
80
+ timestampNs: number | string | bigint;
81
+ action: string;
82
+ uriAnchored: boolean;
83
+ }
84
+
85
+ /** Outcome of replaying a vector set. */
86
+ export interface ConformanceResult {
87
+ checked: number;
88
+ failures: string[];
89
+ passed: boolean;
90
+ }
91
+
92
+ /** Absolute path of the vector set shipped inside this package. */
93
+ export declare const DEFAULT_VECTORS_PATH: string;
94
+
95
+ /** The ACTION field is 16 bytes. */
96
+ export declare const ACTION_MAX_LEN: 16;
97
+
98
+ /** Independent implementation of AICENT-002 sec. 10.2. Throws `Error`. */
99
+ export declare function parseUri(uri: string): ParsedUri;
100
+
101
+ /** Independent implementation of the 128-byte frame. Throws `Error`. */
102
+ export declare function buildFrame(fields: FrameFields): Buffer;
103
+
104
+ /** Load a vector set. Defaults to the one shipped with this package. */
105
+ export declare function loadVectors(path?: string): VectorSet;
106
+
107
+ /** Replay a vector set against the independent implementations. */
108
+ export declare function runConformance(vectors: VectorSet): ConformanceResult;