@agenticprimitives/situations 0.0.0-alpha.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/LICENSE +21 -0
- package/README.md +3 -0
- package/dist/canonical.d.ts +34 -0
- package/dist/canonical.d.ts.map +1 -0
- package/dist/canonical.js +146 -0
- package/dist/canonical.js.map +1 -0
- package/dist/hash.d.ts +4 -0
- package/dist/hash.d.ts.map +1 -0
- package/dist/hash.js +5 -0
- package/dist/hash.js.map +1 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +8 -0
- package/dist/index.js.map +1 -0
- package/dist/types.d.ts +51 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +2 -0
- package/dist/types.js.map +1 -0
- package/dist/validate.d.ts +18 -0
- package/dist/validate.d.ts.map +1 -0
- package/dist/validate.js +69 -0
- package/dist/validate.js.map +1 -0
- package/package.json +47 -0
- package/spec.md +1 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Agentic Trust Labs
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
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:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
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.
|
package/README.md
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* RFC 8785 JSON Canonicalization Scheme (JCS) — deterministic JSON serialisation
|
|
3
|
+
* for cross-stack hash equality (TS ↔ Solidity ↔ Java/Go verifiers).
|
|
4
|
+
*
|
|
5
|
+
* The substrate's `credentialHash` is `keccak256(jcsCanonicalize(vc-without-proof))`.
|
|
6
|
+
* Every package that needs to recompute the hash MUST go through this helper.
|
|
7
|
+
*
|
|
8
|
+
* RFC 8785 rules:
|
|
9
|
+
* - UTF-8 strings, NFC normalisation (browsers ship NFC already)
|
|
10
|
+
* - Object keys sorted by UTF-16 code unit (== lexicographic in BMP)
|
|
11
|
+
* - No insignificant whitespace
|
|
12
|
+
* - Numbers as the shortest IEEE 754 round-trip representation
|
|
13
|
+
* - Booleans `true` / `false` / `null` lowercase
|
|
14
|
+
* - Strings JSON-escape U+0000..U+001F, U+0022, U+005C only; emit other code points as-is
|
|
15
|
+
*
|
|
16
|
+
* This implementation is intentionally narrow: substrate VCs use a constrained
|
|
17
|
+
* subset of JSON (string / number / boolean / null / object / array). We do not
|
|
18
|
+
* handle BigInt or Date — callers must serialise those upstream.
|
|
19
|
+
*/
|
|
20
|
+
export declare class JcsError extends Error {
|
|
21
|
+
readonly path: string;
|
|
22
|
+
constructor(message: string, path: string);
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Canonicalize a JSON-compatible value per RFC 8785.
|
|
26
|
+
* Returns the canonical string (UTF-8 text; callers wrap with `utf8ToBytes` to hash).
|
|
27
|
+
*/
|
|
28
|
+
export declare function jcsCanonicalize(value: unknown, path?: string): string;
|
|
29
|
+
/**
|
|
30
|
+
* Compute the canonical hash of a value: `keccak256(jcsCanonicalize(value))`.
|
|
31
|
+
* Returns the 32-byte hex hash.
|
|
32
|
+
*/
|
|
33
|
+
export declare function canonicalHash(value: unknown): `0x${string}`;
|
|
34
|
+
//# sourceMappingURL=canonical.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"canonical.d.ts","sourceRoot":"","sources":["../src/canonical.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAKH,qBAAa,QAAS,SAAQ,KAAK;IACJ,QAAQ,CAAC,IAAI,EAAE,MAAM;gBAAtC,OAAO,EAAE,MAAM,EAAW,IAAI,EAAE,MAAM;CAGnD;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,OAAO,EAAE,IAAI,GAAE,MAAY,GAAG,MAAM,CA2B1E;AAkED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,MAAM,EAAE,CAK3D"}
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* RFC 8785 JSON Canonicalization Scheme (JCS) — deterministic JSON serialisation
|
|
3
|
+
* for cross-stack hash equality (TS ↔ Solidity ↔ Java/Go verifiers).
|
|
4
|
+
*
|
|
5
|
+
* The substrate's `credentialHash` is `keccak256(jcsCanonicalize(vc-without-proof))`.
|
|
6
|
+
* Every package that needs to recompute the hash MUST go through this helper.
|
|
7
|
+
*
|
|
8
|
+
* RFC 8785 rules:
|
|
9
|
+
* - UTF-8 strings, NFC normalisation (browsers ship NFC already)
|
|
10
|
+
* - Object keys sorted by UTF-16 code unit (== lexicographic in BMP)
|
|
11
|
+
* - No insignificant whitespace
|
|
12
|
+
* - Numbers as the shortest IEEE 754 round-trip representation
|
|
13
|
+
* - Booleans `true` / `false` / `null` lowercase
|
|
14
|
+
* - Strings JSON-escape U+0000..U+001F, U+0022, U+005C only; emit other code points as-is
|
|
15
|
+
*
|
|
16
|
+
* This implementation is intentionally narrow: substrate VCs use a constrained
|
|
17
|
+
* subset of JSON (string / number / boolean / null / object / array). We do not
|
|
18
|
+
* handle BigInt or Date — callers must serialise those upstream.
|
|
19
|
+
*/
|
|
20
|
+
import { keccak_256 } from '@noble/hashes/sha3.js';
|
|
21
|
+
import { utf8ToBytes } from '@noble/hashes/utils.js';
|
|
22
|
+
export class JcsError extends Error {
|
|
23
|
+
path;
|
|
24
|
+
constructor(message, path) {
|
|
25
|
+
super(`[JCS] ${message} at ${path}`);
|
|
26
|
+
this.path = path;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Canonicalize a JSON-compatible value per RFC 8785.
|
|
31
|
+
* Returns the canonical string (UTF-8 text; callers wrap with `utf8ToBytes` to hash).
|
|
32
|
+
*/
|
|
33
|
+
export function jcsCanonicalize(value, path = '$') {
|
|
34
|
+
if (value === null)
|
|
35
|
+
return 'null';
|
|
36
|
+
if (value === undefined) {
|
|
37
|
+
throw new JcsError('undefined is not JSON', path);
|
|
38
|
+
}
|
|
39
|
+
switch (typeof value) {
|
|
40
|
+
case 'boolean':
|
|
41
|
+
return value ? 'true' : 'false';
|
|
42
|
+
case 'string':
|
|
43
|
+
return serializeString(value);
|
|
44
|
+
case 'number':
|
|
45
|
+
return serializeNumber(value, path);
|
|
46
|
+
case 'object': {
|
|
47
|
+
if (Array.isArray(value)) {
|
|
48
|
+
const items = value.map((v, i) => jcsCanonicalize(v, `${path}[${i}]`));
|
|
49
|
+
return `[${items.join(',')}]`;
|
|
50
|
+
}
|
|
51
|
+
// Plain object
|
|
52
|
+
const entries = Object.entries(value)
|
|
53
|
+
.filter(([, v]) => v !== undefined)
|
|
54
|
+
.sort(([a], [b]) => sortByCodeUnit(a, b));
|
|
55
|
+
const items = entries.map(([k, v]) => `${serializeString(k)}:${jcsCanonicalize(v, `${path}.${k}`)}`);
|
|
56
|
+
return `{${items.join(',')}}`;
|
|
57
|
+
}
|
|
58
|
+
default:
|
|
59
|
+
throw new JcsError(`unsupported JSON type: ${typeof value}`, path);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
/** UTF-16 code unit comparison — exactly what RFC 8785 §3.2.3 requires. */
|
|
63
|
+
function sortByCodeUnit(a, b) {
|
|
64
|
+
const len = Math.min(a.length, b.length);
|
|
65
|
+
for (let i = 0; i < len; i++) {
|
|
66
|
+
const av = a.charCodeAt(i);
|
|
67
|
+
const bv = b.charCodeAt(i);
|
|
68
|
+
if (av !== bv)
|
|
69
|
+
return av - bv;
|
|
70
|
+
}
|
|
71
|
+
return a.length - b.length;
|
|
72
|
+
}
|
|
73
|
+
/** RFC 8259 string serialisation with JCS-compatible escaping (RFC 8785 §3.2.2.2). */
|
|
74
|
+
function serializeString(s) {
|
|
75
|
+
let out = '"';
|
|
76
|
+
for (let i = 0; i < s.length; i++) {
|
|
77
|
+
const code = s.charCodeAt(i);
|
|
78
|
+
if (code === 0x22) {
|
|
79
|
+
out += '\\"';
|
|
80
|
+
}
|
|
81
|
+
else if (code === 0x5c) {
|
|
82
|
+
out += '\\\\';
|
|
83
|
+
}
|
|
84
|
+
else if (code < 0x20) {
|
|
85
|
+
// Control characters
|
|
86
|
+
switch (code) {
|
|
87
|
+
case 0x08:
|
|
88
|
+
out += '\\b';
|
|
89
|
+
break;
|
|
90
|
+
case 0x09:
|
|
91
|
+
out += '\\t';
|
|
92
|
+
break;
|
|
93
|
+
case 0x0a:
|
|
94
|
+
out += '\\n';
|
|
95
|
+
break;
|
|
96
|
+
case 0x0c:
|
|
97
|
+
out += '\\f';
|
|
98
|
+
break;
|
|
99
|
+
case 0x0d:
|
|
100
|
+
out += '\\r';
|
|
101
|
+
break;
|
|
102
|
+
default:
|
|
103
|
+
out += `\\u${code.toString(16).padStart(4, '0')}`;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
else {
|
|
107
|
+
out += s[i];
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
out += '"';
|
|
111
|
+
return out;
|
|
112
|
+
}
|
|
113
|
+
/** RFC 8785 §3.2.2.3 — shortest round-tripping IEEE 754 representation. */
|
|
114
|
+
function serializeNumber(n, path) {
|
|
115
|
+
if (!Number.isFinite(n)) {
|
|
116
|
+
throw new JcsError(`non-finite number (${n})`, path);
|
|
117
|
+
}
|
|
118
|
+
if (Object.is(n, -0))
|
|
119
|
+
return '0';
|
|
120
|
+
if (n === 0)
|
|
121
|
+
return '0';
|
|
122
|
+
if (Number.isInteger(n) && Math.abs(n) < 1e21) {
|
|
123
|
+
return n.toString();
|
|
124
|
+
}
|
|
125
|
+
// Browsers + Node give us the shortest round-trip via `toString()`
|
|
126
|
+
// (per ECMA-262 §6.1.6.1.13). RFC 8785 expects the ES round-trip form.
|
|
127
|
+
return n.toString();
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* Compute the canonical hash of a value: `keccak256(jcsCanonicalize(value))`.
|
|
131
|
+
* Returns the 32-byte hex hash.
|
|
132
|
+
*/
|
|
133
|
+
export function canonicalHash(value) {
|
|
134
|
+
const canonical = jcsCanonicalize(value);
|
|
135
|
+
const bytes = utf8ToBytes(canonical);
|
|
136
|
+
const digest = keccak_256(bytes);
|
|
137
|
+
return `0x${bytesToHex(digest)}`;
|
|
138
|
+
}
|
|
139
|
+
function bytesToHex(b) {
|
|
140
|
+
let s = '';
|
|
141
|
+
for (const v of b) {
|
|
142
|
+
s += v.toString(16).padStart(2, '0');
|
|
143
|
+
}
|
|
144
|
+
return s;
|
|
145
|
+
}
|
|
146
|
+
//# sourceMappingURL=canonical.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"canonical.js","sourceRoot":"","sources":["../src/canonical.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,EAAE,UA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-0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hash.js","sourceRoot":"","sources":["../src/hash.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAE/C,MAAM,UAAU,eAAe,CAAC,CAAc;IAC5C,OAAO,aAAa,CAAC,CAAC,CAAU,CAAC;AACnC,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare const PACKAGE_NAME = "@agenticprimitives/situations";
|
|
2
|
+
export declare const PACKAGE_STATUS = "w2-situation-v2";
|
|
3
|
+
export declare const SPEC_REF = "specs/324-unified-agent-organization-and-interaction-ontology.md";
|
|
4
|
+
export type { DescriptionRef, EntityRef, RoleBindingV1, SituationEvidenceRef, SituationId, SituationValidity, SituationVaultRef, SituationV2, } from './types.js';
|
|
5
|
+
export { SituationValidationError, assertDescriptionRef, assertEntityRef, assertRoleBindings, buildSituationV2, validateSituationV2, } from './validate.js';
|
|
6
|
+
export { jcsCanonicalize, canonicalHash, JcsError } from './canonical.js';
|
|
7
|
+
export { hashSituationV2 } from './hash.js';
|
|
8
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,YAAY,kCAAkC,CAAC;AAC5D,eAAO,MAAM,cAAc,oBAAoB,CAAC;AAChD,eAAO,MAAM,QAAQ,qEAAqE,CAAC;AAE3F,YAAY,EACV,cAAc,EACd,SAAS,EACT,aAAa,EACb,oBAAoB,EACpB,WAAW,EACX,iBAAiB,EACjB,iBAAiB,EACjB,WAAW,GACZ,MAAM,YAAY,CAAC;AAEpB,OAAO,EACL,wBAAwB,EACxB,oBAAoB,EACpB,eAAe,EACf,kBAAkB,EAClB,gBAAgB,EAChB,mBAAmB,GACpB,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1E,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
// @agenticprimitives/situations — substrate Situation primitive (spec 324 W2).
|
|
2
|
+
export const PACKAGE_NAME = '@agenticprimitives/situations';
|
|
3
|
+
export const PACKAGE_STATUS = 'w2-situation-v2';
|
|
4
|
+
export const SPEC_REF = 'specs/324-unified-agent-organization-and-interaction-ontology.md';
|
|
5
|
+
export { SituationValidationError, assertDescriptionRef, assertEntityRef, assertRoleBindings, buildSituationV2, validateSituationV2, } from './validate.js';
|
|
6
|
+
export { jcsCanonicalize, canonicalHash, JcsError } from './canonical.js';
|
|
7
|
+
export { hashSituationV2 } from './hash.js';
|
|
8
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAE/E,MAAM,CAAC,MAAM,YAAY,GAAG,+BAA+B,CAAC;AAC5D,MAAM,CAAC,MAAM,cAAc,GAAG,iBAAiB,CAAC;AAChD,MAAM,CAAC,MAAM,QAAQ,GAAG,kEAAkE,CAAC;AAa3F,OAAO,EACL,wBAAwB,EACxB,oBAAoB,EACpB,eAAe,EACf,kBAAkB,EAClB,gBAAgB,EAChB,mBAAmB,GACpB,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1E,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC"}
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import type { CanonicalAgentId, Hex32 } from '@agenticprimitives/types';
|
|
2
|
+
/** Ontology IRI of a Description / SHACL shape (e.g. `aporg:OrganizationMembership`). */
|
|
3
|
+
export type DescriptionRef = `${string}:${string}`;
|
|
4
|
+
export type SituationId = `sit_${string}`;
|
|
5
|
+
/** Minimal vault record pointer — situations stays transport-agnostic (no vault import). */
|
|
6
|
+
export interface SituationVaultRef {
|
|
7
|
+
recordKey: string;
|
|
8
|
+
owner?: string;
|
|
9
|
+
revision?: number;
|
|
10
|
+
}
|
|
11
|
+
export type EntityRef = {
|
|
12
|
+
kind: 'agent';
|
|
13
|
+
id: CanonicalAgentId;
|
|
14
|
+
} | {
|
|
15
|
+
kind: 'situation';
|
|
16
|
+
id: SituationId;
|
|
17
|
+
hash?: Hex32;
|
|
18
|
+
} | {
|
|
19
|
+
kind: 'resource';
|
|
20
|
+
iri: string;
|
|
21
|
+
hash?: Hex32;
|
|
22
|
+
} | {
|
|
23
|
+
kind: 'artifact';
|
|
24
|
+
ref: SituationVaultRef;
|
|
25
|
+
hash: Hex32;
|
|
26
|
+
};
|
|
27
|
+
export interface RoleBindingV1 {
|
|
28
|
+
/** Ontology IRI, such as `aporg:memberAgent`. */
|
|
29
|
+
role: DescriptionRef;
|
|
30
|
+
fillers: EntityRef[];
|
|
31
|
+
}
|
|
32
|
+
export interface SituationEvidenceRef {
|
|
33
|
+
id: string;
|
|
34
|
+
hash?: Hex32;
|
|
35
|
+
type: string;
|
|
36
|
+
}
|
|
37
|
+
export interface SituationValidity {
|
|
38
|
+
validFrom: string;
|
|
39
|
+
validUntil?: string;
|
|
40
|
+
}
|
|
41
|
+
export interface SituationV2<TBody extends Record<string, unknown> = Record<string, unknown>> {
|
|
42
|
+
version: 'ap.situation.v2';
|
|
43
|
+
id: SituationId;
|
|
44
|
+
description: DescriptionRef;
|
|
45
|
+
roleBindings: RoleBindingV1[];
|
|
46
|
+
status?: string;
|
|
47
|
+
validity?: SituationValidity;
|
|
48
|
+
evidenceRefs?: SituationEvidenceRef[];
|
|
49
|
+
body: TBody;
|
|
50
|
+
}
|
|
51
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|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,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IAC1F,OAAO,EAAE,iBAAiB,CAAC;IAC3B,EAAE,EAAE,WAAW,CAAC;IAChB,WAAW,EAAE,cAAc,CAAC;IAC5B,YAAY,EAAE,aAAa,EAAE,CAAC;IAC9B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,iBAAiB,CAAC;IAC7B,YAAY,CAAC,EAAE,oBAAoB,EAAE,CAAC;IACtC,IAAI,EAAE,KAAK,CAAC;CACb"}
|
package/dist/types.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { DescriptionRef, EntityRef, RoleBindingV1, SituationV2 } from './types.js';
|
|
2
|
+
export declare class SituationValidationError extends Error {
|
|
3
|
+
constructor(message: string);
|
|
4
|
+
}
|
|
5
|
+
export declare function assertDescriptionRef(ref: string): asserts ref is DescriptionRef;
|
|
6
|
+
export declare function assertEntityRef(ref: EntityRef): void;
|
|
7
|
+
export declare function assertRoleBindings(bindings: RoleBindingV1[]): void;
|
|
8
|
+
export declare function validateSituationV2<TBody extends Record<string, unknown>>(s: SituationV2<TBody>): SituationV2<TBody>;
|
|
9
|
+
export declare function buildSituationV2<TBody extends Record<string, unknown>>(args: {
|
|
10
|
+
id: SituationV2<TBody>['id'];
|
|
11
|
+
description: DescriptionRef;
|
|
12
|
+
roleBindings: RoleBindingV1[];
|
|
13
|
+
body: TBody;
|
|
14
|
+
status?: string;
|
|
15
|
+
validity?: SituationV2<TBody>['validity'];
|
|
16
|
+
evidenceRefs?: SituationV2<TBody>['evidenceRefs'];
|
|
17
|
+
}): SituationV2<TBody>;
|
|
18
|
+
//# sourceMappingURL=validate.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3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A-Za-z0-9_-]*$/;
|
|
3
|
+
export class SituationValidationError extends Error {
|
|
4
|
+
constructor(message) {
|
|
5
|
+
super(`[situations] ${message}`);
|
|
6
|
+
this.name = 'SituationValidationError';
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
export function assertDescriptionRef(ref) {
|
|
10
|
+
if (!DESC_REF.test(ref)) {
|
|
11
|
+
throw new SituationValidationError(`invalid DescriptionRef '${ref}'`);
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
export function assertEntityRef(ref) {
|
|
15
|
+
switch (ref.kind) {
|
|
16
|
+
case 'agent':
|
|
17
|
+
if (!ref.id?.includes(':'))
|
|
18
|
+
throw new SituationValidationError('agent filler requires CanonicalAgentId');
|
|
19
|
+
return;
|
|
20
|
+
case 'situation':
|
|
21
|
+
if (!SIT_ID.test(ref.id))
|
|
22
|
+
throw new SituationValidationError(`invalid situation id '${ref.id}'`);
|
|
23
|
+
return;
|
|
24
|
+
case 'resource':
|
|
25
|
+
if (!ref.iri)
|
|
26
|
+
throw new SituationValidationError('resource filler requires iri');
|
|
27
|
+
return;
|
|
28
|
+
case 'artifact':
|
|
29
|
+
if (!ref.ref?.recordKey || !ref.hash) {
|
|
30
|
+
throw new SituationValidationError('artifact filler requires ref.recordKey and hash');
|
|
31
|
+
}
|
|
32
|
+
return;
|
|
33
|
+
default:
|
|
34
|
+
throw new SituationValidationError('unknown EntityRef kind');
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
export function assertRoleBindings(bindings) {
|
|
38
|
+
for (const b of bindings) {
|
|
39
|
+
assertDescriptionRef(b.role);
|
|
40
|
+
if (!b.fillers?.length) {
|
|
41
|
+
throw new SituationValidationError(`role '${b.role}' requires at least one filler`);
|
|
42
|
+
}
|
|
43
|
+
for (const f of b.fillers)
|
|
44
|
+
assertEntityRef(f);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
export function validateSituationV2(s) {
|
|
48
|
+
if (s.version !== 'ap.situation.v2') {
|
|
49
|
+
throw new SituationValidationError(`expected version ap.situation.v2, got ${String(s.version)}`);
|
|
50
|
+
}
|
|
51
|
+
if (!SIT_ID.test(s.id))
|
|
52
|
+
throw new SituationValidationError(`invalid situation id '${s.id}'`);
|
|
53
|
+
assertDescriptionRef(s.description);
|
|
54
|
+
assertRoleBindings(s.roleBindings ?? []);
|
|
55
|
+
return s;
|
|
56
|
+
}
|
|
57
|
+
export function buildSituationV2(args) {
|
|
58
|
+
return validateSituationV2({
|
|
59
|
+
version: 'ap.situation.v2',
|
|
60
|
+
id: args.id,
|
|
61
|
+
description: args.description,
|
|
62
|
+
roleBindings: args.roleBindings,
|
|
63
|
+
body: args.body,
|
|
64
|
+
status: args.status,
|
|
65
|
+
validity: args.validity,
|
|
66
|
+
evidenceRefs: args.evidenceRefs,
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
//# sourceMappingURL=validate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validate.js","sourceRoot":"","sources":["../src/validate.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,GAAG,sBAAsB,CAAC;AACtC,MAAM,QAAQ,GAAG,0CAA0C,CAAC;AAE5D,MAAM,OAAO,wBAAyB,SAAQ,KAAK;IACjD,YAAY,OAAe;QACzB,KAAK,CAAC,gBAAgB,OAAO,EAAE,CAAC,CAAC;QACjC,IAAI,CAAC,IAAI,GAAG,0BAA0B,CAAC;IACzC,CAAC;CACF;AAED,MAAM,UAAU,oBAAoB,CAAC,GAAW;IAC9C,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC;QACxB,MAAM,IAAI,wBAAwB,CAAC,2BAA2B,GAAG,GAAG,CAAC,CAAC;IACxE,CAAC;AACH,CAAC;AAED,MAAM,UAAU,eAAe,CAAC,GAAc;IAC5C,QAAQ,GAAG,CAAC,IAAI,EAAE,CAAC;QACjB,KAAK,OAAO;YACV,IAAI,CAAC,GAAG,CAAC,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AC,CAAC;IACnG,CAAC;IACD,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC;QAAE,MAAM,IAAI,wBAAwB,CAAC,yBAAyB,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;IAC7F,oBAAoB,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC;IACpC,kBAAkB,CAAC,CAAC,CAAC,YAAY,IAAI,EAAE,CAAC,CAAC;IACzC,OAAO,CAAC,CAAC;AACX,CAAC;AAED,MAAM,UAAU,gBAAgB,CAAwC,IAQvE;IACC,OAAO,mBAAmB,CAAC;QACzB,OAAO,EAAE,iBAAiB;QAC1B,EAAE,EAAE,IAAI,CAAC,EAAE;QACX,WAAW,EAAE,IAAI,CAAC,WAAW;QAC7B,YAAY,EAAE,IAAI,CAAC,YAAY;QAC/B,IAAI,EAAE,IAAI,CAAC,IAAI;QACf,MAAM,EAAE,IAAI,CAAC,MAAM;QACnB,QAAQ,EAAE,IAAI,CAAC,QAAQ;QACvB,YAAY,EAAE,IAAI,CAAC,YAAY;KAChC,CAAC,CAAC;AACL,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@agenticprimitives/situations",
|
|
3
|
+
"version": "0.0.0-alpha.1",
|
|
4
|
+
"description": "Substrate Situation primitive (SituationV2, RoleBinding, EntityRef) — spec 324 W2.",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "git+https://github.com/agentictrustlabs/agenticprimitives.git",
|
|
9
|
+
"directory": "packages/situations"
|
|
10
|
+
},
|
|
11
|
+
"type": "module",
|
|
12
|
+
"main": "./dist/index.js",
|
|
13
|
+
"types": "./dist/index.d.ts",
|
|
14
|
+
"exports": {
|
|
15
|
+
".": {
|
|
16
|
+
"types": "./dist/index.d.ts",
|
|
17
|
+
"import": "./dist/index.js"
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
"files": [
|
|
21
|
+
"LICENSE",
|
|
22
|
+
"dist",
|
|
23
|
+
"spec.md",
|
|
24
|
+
"README.md"
|
|
25
|
+
],
|
|
26
|
+
"publishConfig": {
|
|
27
|
+
"access": "public"
|
|
28
|
+
},
|
|
29
|
+
"dependencies": {
|
|
30
|
+
"@noble/hashes": "^2.2.0",
|
|
31
|
+
"@agenticprimitives/types": "1.0.0-alpha.17"
|
|
32
|
+
},
|
|
33
|
+
"devDependencies": {
|
|
34
|
+
"vitest": "^4.1.8"
|
|
35
|
+
},
|
|
36
|
+
"keywords": [
|
|
37
|
+
"agentic",
|
|
38
|
+
"situation",
|
|
39
|
+
"ontology"
|
|
40
|
+
],
|
|
41
|
+
"scripts": {
|
|
42
|
+
"build": "tsc -p tsconfig.build.json",
|
|
43
|
+
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
44
|
+
"test": "vitest run",
|
|
45
|
+
"clean": "rm -rf dist"
|
|
46
|
+
}
|
|
47
|
+
}
|
package/spec.md
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
See [spec 324](../../specs/324-unified-agent-organization-and-interaction-ontology.md) §5 (Wave 2).
|