@fide.work/fcp 0.0.1-alpha.0 → 0.0.1-alpha.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.
- package/dist/experimental/broadcasting/registry.d.ts +1 -1
- package/dist/experimental/merkle/tree.d.ts +5 -5
- package/dist/experimental/merkle/tree.js +5 -5
- package/dist/fide-id/buildFideIdFromParts.d.ts +2 -0
- package/dist/fide-id/buildFideIdFromParts.js +36 -0
- package/dist/fide-id/calculateFideId.d.ts +11 -7
- package/dist/fide-id/calculateFideId.js +13 -21
- package/dist/fide-id/calculateStatementFideId.d.ts +0 -20
- package/dist/fide-id/calculateStatementFideId.js +11 -25
- package/dist/fide-id/constants.d.ts +222 -12
- package/dist/fide-id/constants.js +251 -23
- package/dist/fide-id/index.d.ts +5 -3
- package/dist/fide-id/index.js +4 -2
- package/dist/fide-id/parseFideId.d.ts +24 -0
- package/dist/fide-id/parseFideId.js +63 -0
- package/dist/fide-id/statementRawIdentifier.d.ts +2 -0
- package/dist/fide-id/statementRawIdentifier.js +13 -0
- package/dist/fide-id/types.d.ts +17 -10
- package/dist/fide-id/utils.d.ts +6 -28
- package/dist/fide-id/utils.js +6 -61
- package/dist/index.d.ts +4 -4
- package/dist/index.js +3 -3
- package/dist/statement/assertStatementFideIdsPolicy.d.ts +1 -0
- package/dist/statement/assertStatementFideIdsPolicy.js +22 -0
- package/dist/statement/assertStatementInputPolicy.d.ts +5 -0
- package/dist/statement/assertStatementInputPolicy.js +50 -0
- package/dist/statement/build.d.ts +2 -75
- package/dist/statement/build.js +8 -9
- package/dist/statement/index.d.ts +2 -1
- package/dist/statement/index.js +1 -1
- package/dist/statement/normalizeRawIdentifier.d.ts +7 -0
- package/dist/statement/normalizeRawIdentifier.js +68 -0
- package/dist/statement/policy.js +8 -8
- package/dist/statement/types.d.ts +73 -0
- package/dist/statement/types.js +1 -0
- package/dist/statement/utils.d.ts +10 -0
- package/dist/statement/utils.js +42 -0
- package/package.json +15 -14
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* like `simple-git` or `isomorphic-git`.
|
|
9
9
|
*/
|
|
10
10
|
import type { AttestationResult } from "../attestation/index.js";
|
|
11
|
-
import type { Statement } from "../../statement/
|
|
11
|
+
import type { Statement } from "../../statement/types.js";
|
|
12
12
|
/**
|
|
13
13
|
* Statement object in lean JSONL format
|
|
14
14
|
* Uses short keys for efficiency: s/sr, p/pr, o/or
|
|
@@ -42,13 +42,13 @@ export interface MerkleTreeResult {
|
|
|
42
42
|
* @example
|
|
43
43
|
* ```ts
|
|
44
44
|
* const result = await buildMerkleTree([
|
|
45
|
-
* 'did:fide:
|
|
46
|
-
* 'did:fide:
|
|
47
|
-
* 'did:fide:
|
|
45
|
+
* 'did:fide:0x0000abc...',
|
|
46
|
+
* 'did:fide:0x0000def...',
|
|
47
|
+
* 'did:fide:0x0000ghi...'
|
|
48
48
|
* ]);
|
|
49
49
|
*
|
|
50
50
|
* console.log('Root:', result.root);
|
|
51
|
-
* console.log('Proof for first leaf:', result.proofs.get('did:fide:
|
|
51
|
+
* console.log('Proof for first leaf:', result.proofs.get('did:fide:0x0000abc...'));
|
|
52
52
|
* ```
|
|
53
53
|
*/
|
|
54
54
|
export declare function buildMerkleTree(leaves: string[]): Promise<MerkleTreeResult>;
|
|
@@ -63,7 +63,7 @@ export declare function buildMerkleTree(leaves: string[]): Promise<MerkleTreeRes
|
|
|
63
63
|
* @example
|
|
64
64
|
* ```ts
|
|
65
65
|
* const isValid = await verifyMerkleProof(
|
|
66
|
-
* 'did:fide:
|
|
66
|
+
* 'did:fide:0x0000abc...',
|
|
67
67
|
* proof,
|
|
68
68
|
* root
|
|
69
69
|
* );
|
|
@@ -57,13 +57,13 @@ function normalizeLeaf(fideId) {
|
|
|
57
57
|
* @example
|
|
58
58
|
* ```ts
|
|
59
59
|
* const result = await buildMerkleTree([
|
|
60
|
-
* 'did:fide:
|
|
61
|
-
* 'did:fide:
|
|
62
|
-
* 'did:fide:
|
|
60
|
+
* 'did:fide:0x0000abc...',
|
|
61
|
+
* 'did:fide:0x0000def...',
|
|
62
|
+
* 'did:fide:0x0000ghi...'
|
|
63
63
|
* ]);
|
|
64
64
|
*
|
|
65
65
|
* console.log('Root:', result.root);
|
|
66
|
-
* console.log('Proof for first leaf:', result.proofs.get('did:fide:
|
|
66
|
+
* console.log('Proof for first leaf:', result.proofs.get('did:fide:0x0000abc...'));
|
|
67
67
|
* ```
|
|
68
68
|
*/
|
|
69
69
|
export async function buildMerkleTree(leaves) {
|
|
@@ -134,7 +134,7 @@ export async function buildMerkleTree(leaves) {
|
|
|
134
134
|
* @example
|
|
135
135
|
* ```ts
|
|
136
136
|
* const isValid = await verifyMerkleProof(
|
|
137
|
-
* 'did:fide:
|
|
137
|
+
* 'did:fide:0x0000abc...',
|
|
138
138
|
* proof,
|
|
139
139
|
* root
|
|
140
140
|
* );
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Build a Fide ID from type code, source code, and fingerprint (no hashing).
|
|
3
|
+
*
|
|
4
|
+
* Use when you already have the fingerprint (e.g. from a database) and need to
|
|
5
|
+
* reconstruct the full Fide ID. For computing a new Fide ID from a raw identifier,
|
|
6
|
+
* use `calculateFideId` instead.
|
|
7
|
+
*
|
|
8
|
+
* @param typeChar Entity type code (2 hex chars, e.g. "10" for Person).
|
|
9
|
+
* @param sourceChar Source type code (2 hex chars, e.g. "20" for NetworkResource).
|
|
10
|
+
* @param fingerprint Content hash fingerprint (36 hex chars).
|
|
11
|
+
* @returns The constructed Fide ID: `did:fide:0x{typeChar}{sourceChar}{fingerprint}`
|
|
12
|
+
* @throws TypeError if any argument is not a string
|
|
13
|
+
* @throws Error if format is invalid (wrong lengths or non-hex)
|
|
14
|
+
*/
|
|
15
|
+
import { FIDE_ID_PREFIX, FIDE_ID_FINGERPRINT_LENGTH } from "./constants.js";
|
|
16
|
+
export function buildFideIdFromParts(typeChar, sourceChar, fingerprint) {
|
|
17
|
+
if (typeof typeChar !== "string") {
|
|
18
|
+
throw new TypeError(`Invalid typeChar: expected string, got ${typeof typeChar}`);
|
|
19
|
+
}
|
|
20
|
+
if (typeof sourceChar !== "string") {
|
|
21
|
+
throw new TypeError(`Invalid sourceChar: expected string, got ${typeof sourceChar}`);
|
|
22
|
+
}
|
|
23
|
+
if (typeof fingerprint !== "string") {
|
|
24
|
+
throw new TypeError(`Invalid fingerprint: expected string, got ${typeof fingerprint}`);
|
|
25
|
+
}
|
|
26
|
+
if (typeChar.length !== 2 || !/^[0-9a-f]{2}$/i.test(typeChar)) {
|
|
27
|
+
throw new Error(`Invalid typeChar: expected 2 hex chars, got "${typeChar}"`);
|
|
28
|
+
}
|
|
29
|
+
if (sourceChar.length !== 2 || !/^[0-9a-f]{2}$/i.test(sourceChar)) {
|
|
30
|
+
throw new Error(`Invalid sourceChar: expected 2 hex chars, got "${sourceChar}"`);
|
|
31
|
+
}
|
|
32
|
+
if (fingerprint.length !== FIDE_ID_FINGERPRINT_LENGTH || !/^[0-9a-f]{36}$/i.test(fingerprint)) {
|
|
33
|
+
throw new Error(`Invalid fingerprint: expected 36 hex chars, got ${fingerprint.length} chars`);
|
|
34
|
+
}
|
|
35
|
+
return `${FIDE_ID_PREFIX}${typeChar}${sourceChar}${fingerprint}`;
|
|
36
|
+
}
|
|
@@ -3,19 +3,23 @@ import type { FideEntityType } from "./types.js";
|
|
|
3
3
|
export { FIDE_ENTITY_TYPE_MAP };
|
|
4
4
|
export type { FideEntityType };
|
|
5
5
|
/**
|
|
6
|
-
*
|
|
6
|
+
* Core primitive: calculate a Fide ID from type codes and raw identifier.
|
|
7
7
|
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
8
|
+
* Deterministic SHA-256 hash of the raw identifier (UTF-8), then constructs
|
|
9
|
+
* `did:fide:0x` + 2 hex (type) + 2 hex (source) + first 36 hex of hash = 40 hex total.
|
|
10
10
|
*
|
|
11
11
|
* @param entityType The entity type.
|
|
12
12
|
* @param sourceEntityType The source entity type.
|
|
13
|
-
* @param rawIdentifier The raw identifier string to hash.
|
|
13
|
+
* @param rawIdentifier The raw identifier string to hash (UTF-8 encoded).
|
|
14
14
|
* @paramDefault entityType Person
|
|
15
|
-
* @paramDefault sourceEntityType
|
|
15
|
+
* @paramDefault sourceEntityType NetworkResource
|
|
16
16
|
* @paramDefault rawIdentifier https://x.com/alice
|
|
17
|
-
* @returns Promise resolving to the calculated Fide ID with format `did:fide:0x{
|
|
17
|
+
* @returns Promise resolving to the calculated Fide ID with format `did:fide:0x{typeCode}{sourceCode}{fingerprint}`
|
|
18
18
|
* @throws TypeError if rawIdentifier is not a string
|
|
19
|
-
* @throws Error if entityType or sourceEntityType are invalid
|
|
19
|
+
* @throws Error if entityType or sourceEntityType are invalid
|
|
20
|
+
* @remarks
|
|
21
|
+
* Intentionally non-enforcing: no canonicalization, no guessing. Callers must canonicalize
|
|
22
|
+
* raw identifiers per protocol rules before calling (e.g. URL normalization, RFC 8785 for
|
|
23
|
+
* statement payloads). Use helpers like `calculateStatementFideId` for opinionated workflows.
|
|
20
24
|
*/
|
|
21
25
|
export declare function calculateFideId(entityType: FideEntityType, sourceEntityType: FideEntityType, rawIdentifier: string): Promise<`did:fide:0x${string}`>;
|
|
@@ -1,39 +1,31 @@
|
|
|
1
1
|
import { FIDE_ENTITY_TYPE_MAP } from "./constants.js";
|
|
2
|
+
import { getSubtleCrypto } from "./utils.js";
|
|
2
3
|
// Re-export for backward compatibility
|
|
3
4
|
export { FIDE_ENTITY_TYPE_MAP };
|
|
4
|
-
async function getSubtleCrypto() {
|
|
5
|
-
if (globalThis.crypto?.subtle) {
|
|
6
|
-
return globalThis.crypto.subtle;
|
|
7
|
-
}
|
|
8
|
-
const { webcrypto } = await import("node:crypto");
|
|
9
|
-
return webcrypto.subtle;
|
|
10
|
-
}
|
|
11
5
|
/**
|
|
12
|
-
*
|
|
6
|
+
* Core primitive: calculate a Fide ID from type codes and raw identifier.
|
|
13
7
|
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
8
|
+
* Deterministic SHA-256 hash of the raw identifier (UTF-8), then constructs
|
|
9
|
+
* `did:fide:0x` + 2 hex (type) + 2 hex (source) + first 36 hex of hash = 40 hex total.
|
|
16
10
|
*
|
|
17
11
|
* @param entityType The entity type.
|
|
18
12
|
* @param sourceEntityType The source entity type.
|
|
19
|
-
* @param rawIdentifier The raw identifier string to hash.
|
|
13
|
+
* @param rawIdentifier The raw identifier string to hash (UTF-8 encoded).
|
|
20
14
|
* @paramDefault entityType Person
|
|
21
|
-
* @paramDefault sourceEntityType
|
|
15
|
+
* @paramDefault sourceEntityType NetworkResource
|
|
22
16
|
* @paramDefault rawIdentifier https://x.com/alice
|
|
23
|
-
* @returns Promise resolving to the calculated Fide ID with format `did:fide:0x{
|
|
17
|
+
* @returns Promise resolving to the calculated Fide ID with format `did:fide:0x{typeCode}{sourceCode}{fingerprint}`
|
|
24
18
|
* @throws TypeError if rawIdentifier is not a string
|
|
25
|
-
* @throws Error if entityType or sourceEntityType are invalid
|
|
19
|
+
* @throws Error if entityType or sourceEntityType are invalid
|
|
20
|
+
* @remarks
|
|
21
|
+
* Intentionally non-enforcing: no canonicalization, no guessing. Callers must canonicalize
|
|
22
|
+
* raw identifiers per protocol rules before calling (e.g. URL normalization, RFC 8785 for
|
|
23
|
+
* statement payloads). Use helpers like `calculateStatementFideId` for opinionated workflows.
|
|
26
24
|
*/
|
|
27
25
|
export async function calculateFideId(entityType, sourceEntityType, rawIdentifier) {
|
|
28
26
|
if (typeof rawIdentifier !== "string") {
|
|
29
27
|
throw new TypeError(`Invalid rawIdentifier: expected string, got ${typeof rawIdentifier}`);
|
|
30
28
|
}
|
|
31
|
-
if (entityType === "Statement" && sourceEntityType !== "Statement") {
|
|
32
|
-
throw new Error(`Protocol entity ${entityType} must be self-sourced. Expected source type: ${entityType}, got: ${sourceEntityType}`);
|
|
33
|
-
}
|
|
34
|
-
if (sourceEntityType === "Statement" && entityType !== "Statement") {
|
|
35
|
-
throw new Error(`Invalid Statement source for ${entityType}: protocol disallows 0xX0 (Statement-derived) IDs for non-Statement entities. Use a concrete source (e.g. Product, Organization) instead.`);
|
|
36
|
-
}
|
|
37
29
|
const entityTypeCode = FIDE_ENTITY_TYPE_MAP[entityType];
|
|
38
30
|
if (!entityTypeCode) {
|
|
39
31
|
throw new Error(`Invalid entityType: ${String(entityType)}`);
|
|
@@ -48,6 +40,6 @@ export async function calculateFideId(entityType, sourceEntityType, rawIdentifie
|
|
|
48
40
|
const hashHex = Array.from(new Uint8Array(digest))
|
|
49
41
|
.map((byte) => byte.toString(16).padStart(2, "0"))
|
|
50
42
|
.join("");
|
|
51
|
-
const fingerprint = hashHex.slice(
|
|
43
|
+
const fingerprint = hashHex.slice(0, 36);
|
|
52
44
|
return `did:fide:0x${entityTypeCode}${sourceEntityTypeCode}${fingerprint}`;
|
|
53
45
|
}
|
|
@@ -1,21 +1 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Calculate a Fide ID for a Statement from its RDF triple components.
|
|
3
|
-
*
|
|
4
|
-
* Creates a statement Fide ID by hashing a canonical JSON representation of the subject-predicate-object triple.
|
|
5
|
-
* The resulting Fide ID always has type and source both set to Statement (0x00...).
|
|
6
|
-
*
|
|
7
|
-
* @param subjectFideId The Fide ID reference (format: did:fide:0x... or 0x...)
|
|
8
|
-
* @param predicateFideId The Fide ID reference (format: did:fide:0x... or 0x...)
|
|
9
|
-
* @param objectFideId The Fide ID reference (format: did:fide:0x... or 0x...)
|
|
10
|
-
* @paramDefault subjectFideId did:fide:0x152f02f1d1c1e62b2e569e11818420c1968be3d9
|
|
11
|
-
* @paramDefault predicateFideId did:fide:0x6524b049fa7069dd318c44531214a955c3f1fa37
|
|
12
|
-
* @paramDefault objectFideId did:fide:0x66a023246354ad7e064b1e4e009ec8a0699a3043
|
|
13
|
-
* @returns Promise resolving to the calculated statement Fide ID with format `did:fide:0x00{fingerprint}`
|
|
14
|
-
* @throws TypeError if any Fide ID is not a string
|
|
15
|
-
* @throws Error if any Fide ID format is invalid or not in canonical form
|
|
16
|
-
* @remarks
|
|
17
|
-
* This function only validates Fide ID format and canonicalizes triple hashing.
|
|
18
|
-
* It does not enforce statement role policy (for example allowed predicate entity/source combos).
|
|
19
|
-
* Role policy checks are enforced by `createStatement`.
|
|
20
|
-
*/
|
|
21
1
|
export declare function calculateStatementFideId(subjectFideId: string, predicateFideId: string, objectFideId: string): Promise<`did:fide:0x${string}`>;
|
|
@@ -1,38 +1,24 @@
|
|
|
1
|
-
import { calculateFideId } from "./calculateFideId.js";
|
|
2
|
-
function assertFideId(value) {
|
|
3
|
-
if (typeof value !== "string") {
|
|
4
|
-
throw new TypeError(`Invalid Fide ID: expected string, got ${typeof value}`);
|
|
5
|
-
}
|
|
6
|
-
if (/^did:fide:0x[0-9a-f]{40}$/.test(value)) {
|
|
7
|
-
return value;
|
|
8
|
-
}
|
|
9
|
-
throw new Error(`Invalid Fide ID format: ${value}. Expected full Fide ID (e.g., did:fide:0x...)`);
|
|
10
|
-
}
|
|
11
1
|
/**
|
|
12
2
|
* Calculate a Fide ID for a Statement from its RDF triple components.
|
|
13
3
|
*
|
|
14
|
-
* Creates a statement Fide ID by hashing
|
|
15
|
-
*
|
|
4
|
+
* Creates a statement Fide ID by hashing the raw identifier: concatenation of
|
|
5
|
+
* subject, predicate, and object Fide IDs in that order, separated by ASCII `|`.
|
|
6
|
+
* No whitespace. This helper always returns the self-sourced Statement form (Target/Source = `0000`).
|
|
16
7
|
*
|
|
17
|
-
* @param subjectFideId The Fide ID
|
|
18
|
-
* @param predicateFideId The Fide ID
|
|
19
|
-
* @param objectFideId The Fide ID
|
|
20
|
-
* @
|
|
21
|
-
* @paramDefault predicateFideId did:fide:0x6524b049fa7069dd318c44531214a955c3f1fa37
|
|
22
|
-
* @paramDefault objectFideId did:fide:0x66a023246354ad7e064b1e4e009ec8a0699a3043
|
|
23
|
-
* @returns Promise resolving to the calculated statement Fide ID with format `did:fide:0x00{fingerprint}`
|
|
8
|
+
* @param subjectFideId The subject Fide ID (full format: `did:fide:0x` + 40 hex chars).
|
|
9
|
+
* @param predicateFideId The predicate Fide ID (full format: `did:fide:0x` + 40 hex chars).
|
|
10
|
+
* @param objectFideId The object Fide ID (full format: `did:fide:0x` + 40 hex chars).
|
|
11
|
+
* @returns Promise resolving to the calculated statement Fide ID with format `did:fide:0x0000{fingerprint}`
|
|
24
12
|
* @throws TypeError if any Fide ID is not a string
|
|
25
13
|
* @throws Error if any Fide ID format is invalid or not in canonical form
|
|
26
14
|
* @remarks
|
|
27
15
|
* This function only validates Fide ID format and canonicalizes triple hashing.
|
|
28
16
|
* It does not enforce statement role policy (for example allowed predicate entity/source combos).
|
|
29
17
|
* Role policy checks are enforced by `createStatement`.
|
|
18
|
+
* For non-self-sourced statement IDs (for example `0020`), use `calculateFideId` directly.
|
|
30
19
|
*/
|
|
20
|
+
import { calculateFideId } from "./calculateFideId.js";
|
|
21
|
+
import { statementRawIdentifier } from "./statementRawIdentifier.js";
|
|
31
22
|
export async function calculateStatementFideId(subjectFideId, predicateFideId, objectFideId) {
|
|
32
|
-
|
|
33
|
-
o: assertFideId(objectFideId),
|
|
34
|
-
p: assertFideId(predicateFideId),
|
|
35
|
-
s: assertFideId(subjectFideId)
|
|
36
|
-
});
|
|
37
|
-
return calculateFideId("Statement", "Statement", rawIdentifier);
|
|
23
|
+
return calculateFideId("Statement", "Statement", statementRawIdentifier(subjectFideId, predicateFideId, objectFideId));
|
|
38
24
|
}
|
|
@@ -2,20 +2,230 @@
|
|
|
2
2
|
* FCP SDK Constants
|
|
3
3
|
* Central location for all protocol constants
|
|
4
4
|
*/
|
|
5
|
+
export declare const FCP_PROTOCOL_ID: "FCP";
|
|
6
|
+
export declare const FCP_PROTOCOL_GENERATION: "1";
|
|
7
|
+
export declare const FCP_SPEC_DATE: "2026-02-18";
|
|
5
8
|
/**
|
|
6
9
|
* Entity Type Map
|
|
7
|
-
* Maps FCP entity type names to their
|
|
10
|
+
* Maps FCP entity type names to their two-character hex codes.
|
|
8
11
|
* Used as both Part 1 (Entity Type) and Part 2 (Identifier Source) in Fide IDs.
|
|
12
|
+
*
|
|
13
|
+
* @pattern Multi-facet identity: A single thing often has multiple IDs. Link via Statements:
|
|
14
|
+
* - NetworkResource ↔ (represents/delivers) ↔ CreativeWork
|
|
15
|
+
* - PhysicalObject ↔ (embodies) ↔ CreativeWork
|
|
9
16
|
*/
|
|
10
17
|
export declare const FIDE_ENTITY_TYPE_MAP: {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
18
|
+
/**
|
|
19
|
+
* The atomic unit of the graph. An objective record of a Subject-Predicate-Object assertion.
|
|
20
|
+
*
|
|
21
|
+
* @layer Protocol
|
|
22
|
+
* @standard rdf:Statement
|
|
23
|
+
* @standardFit Exact
|
|
24
|
+
* @litmus Not a verified fact; verification is application-level. Not what it represents.
|
|
25
|
+
*/
|
|
26
|
+
readonly Statement: "00";
|
|
27
|
+
/**
|
|
28
|
+
* A person (alive, dead, undead, or fictional).
|
|
29
|
+
*
|
|
30
|
+
* @layer Agents
|
|
31
|
+
* @standard schema:Person
|
|
32
|
+
* @standardFit Exact
|
|
33
|
+
* @litmus Not an account or organization.
|
|
34
|
+
*/
|
|
35
|
+
readonly Person: "10";
|
|
36
|
+
/**
|
|
37
|
+
* A structured collective of people or agents that acts as a unit.
|
|
38
|
+
*
|
|
39
|
+
* @layer Agents
|
|
40
|
+
* @standard org:Organization
|
|
41
|
+
* @standardFit Exact
|
|
42
|
+
* @litmus Not a single person or software. Not a query-defined group (e.g. alumni by year); create only when the group itself needs to act.
|
|
43
|
+
*/
|
|
44
|
+
readonly Organization: "11";
|
|
45
|
+
/**
|
|
46
|
+
* A running process that acts as an independent actor: bot, AI agent, smart contract. Can hold keys and sign.
|
|
47
|
+
*
|
|
48
|
+
* @layer Agents
|
|
49
|
+
* @standard schema:SoftwareApplication + prov:SoftwareAgent
|
|
50
|
+
* @standardFit Close
|
|
51
|
+
* @litmus Not a person or organization. Not static passive code (use CreativeWork for repos, images, logic).
|
|
52
|
+
*/
|
|
53
|
+
readonly SoftwareAgent: "12";
|
|
54
|
+
/**
|
|
55
|
+
* Identity primarily by addressability/resolution (URL, URI, CID, etc.), regardless of authorship.
|
|
56
|
+
* Retrieved/resolved as content or endpoint. A NetworkResource often represents or delivers a CreativeWork.
|
|
57
|
+
*
|
|
58
|
+
* @layer Network Anchors
|
|
59
|
+
* @standard schema:WebPage + schema:WebSite + schema:EntryPoint
|
|
60
|
+
* @standardFit Broad
|
|
61
|
+
* @litmus Not a subset or account. Not an inhabitable spatial context (use Place).
|
|
62
|
+
*/
|
|
63
|
+
readonly NetworkResource: "20";
|
|
64
|
+
/**
|
|
65
|
+
* An authority-based account principal (e.g., an email address or a specific GitHub, Google, or Mastodon user ID).
|
|
66
|
+
* The identity exists by the permission of a host system's database.
|
|
67
|
+
*
|
|
68
|
+
* @layer Network Anchors
|
|
69
|
+
* @standard schema:OnlineAccount
|
|
70
|
+
* @standardFit Close
|
|
71
|
+
* @litmus Authenticated by a host authority's database, not purely by mathematics.
|
|
72
|
+
*/
|
|
73
|
+
readonly PlatformAccount: "21";
|
|
74
|
+
/**
|
|
75
|
+
* A math-based account principal (e.g., an EVM address, Bitcoin wallet, or did:key).
|
|
76
|
+
* The identity exists mathematically and is authenticated via mathematical signature keys.
|
|
77
|
+
*
|
|
78
|
+
* @layer Network Anchors
|
|
79
|
+
* @standard sec:PublicKey + sec:publicKeyMultibase
|
|
80
|
+
* @standardFit Close
|
|
81
|
+
* @litmus Authenticated via mathematical signature keys, independent of a host authority.
|
|
82
|
+
*/
|
|
83
|
+
readonly CryptographicAccount: "22";
|
|
84
|
+
/**
|
|
85
|
+
* The most generic kind of creative work, including books, movies, photographs, software programs, etc.
|
|
86
|
+
* Non-expressive digital artifacts (binaries, model weights, dataset snapshots) are CreativeWork with refinement via Statements (artifactKind, mediaType, generatedBy, derivedFrom).
|
|
87
|
+
*
|
|
88
|
+
* @layer Knowledge
|
|
89
|
+
* @standard schema:CreativeWork
|
|
90
|
+
* @standardFit Exact
|
|
91
|
+
* @litmus Not a raw value or formal concept. Not a running agent instance (use SoftwareAgent). Not a resource where location is primary identifier (use NetworkResource).
|
|
92
|
+
*/
|
|
93
|
+
readonly CreativeWork: "30";
|
|
94
|
+
/**
|
|
95
|
+
* A formal concept, word, topic, category, or abstract idea defined in a taxonomy.
|
|
96
|
+
*
|
|
97
|
+
* @layer Knowledge
|
|
98
|
+
* @standard schema:DefinedTerm
|
|
99
|
+
* @standardFit Close
|
|
100
|
+
* @litmus Not a plain raw value.
|
|
101
|
+
*/
|
|
102
|
+
readonly Concept: "31";
|
|
103
|
+
/**
|
|
104
|
+
* A spatial context that can contain presence, co-location, and interaction. Includes physical locations and persistent virtual environments (e.g., a concert venue, a Discord server or channel, a Zoom room, a VRChat instance). Physicality/virtuality is asserted via Statements, not the base type.
|
|
105
|
+
*
|
|
106
|
+
* @layer Spacetime
|
|
107
|
+
* @standard schema:Place + schema:VirtualLocation
|
|
108
|
+
* @standardFit Broad
|
|
109
|
+
* @litmus Not a happening or a physical artifact. Can an Actor have presence there? Is its identity a spatial address rather than a document location or account?
|
|
110
|
+
*/
|
|
111
|
+
readonly Place: "40";
|
|
112
|
+
/**
|
|
113
|
+
* An occurrence or happening bounded in time. Can be observed/aggregated; may be caused by Actions, systems, or nature. Occurs at a Place (physical or virtual).
|
|
114
|
+
*
|
|
115
|
+
* @layer Spacetime
|
|
116
|
+
* @standard schema:Event
|
|
117
|
+
* @standardFit Exact
|
|
118
|
+
* @litmus Not a specific exertion of agency (Action).
|
|
119
|
+
*/
|
|
120
|
+
readonly Event: "41";
|
|
121
|
+
/**
|
|
122
|
+
* A discrete assertion or commitment attributable to an Agent. Often produces or records a change (e.g., a transaction, API call, signature). Can be linked to Events via Statements (causes, records, resultsIn).
|
|
123
|
+
*
|
|
124
|
+
* @layer Spacetime
|
|
125
|
+
* @standard schema:Action + prov:Activity
|
|
126
|
+
* @standardFit Close
|
|
127
|
+
* @litmus Not a broad temporal happening (Event); must be driven by an Agent.
|
|
128
|
+
*/
|
|
129
|
+
readonly Action: "42";
|
|
130
|
+
/**
|
|
131
|
+
* A tangible, inanimate physical object (e.g., hardware, vehicle, physical document, natural object). Physical only. Use Statements (madeBy, manufactured=true) if man-made vs natural matters.
|
|
132
|
+
*
|
|
133
|
+
* @layer Spacetime
|
|
134
|
+
* @standard schema:Product + schema:Thing
|
|
135
|
+
* @standardFit Close
|
|
136
|
+
* @litmus Not a location (where). Not a digital artifact (use CreativeWork).
|
|
137
|
+
*/
|
|
138
|
+
readonly PhysicalObject: "43";
|
|
139
|
+
/**
|
|
140
|
+
* A plain text sequence of characters.
|
|
141
|
+
*
|
|
142
|
+
* @layer Literals
|
|
143
|
+
* @standard rdf:Literal + xsd:string
|
|
144
|
+
* @standardFit Exact
|
|
145
|
+
* @litmus Not a Concept.
|
|
146
|
+
*/
|
|
147
|
+
readonly TextLiteral: "a0";
|
|
148
|
+
/**
|
|
149
|
+
* A whole number.
|
|
150
|
+
*
|
|
151
|
+
* @layer Literals
|
|
152
|
+
* @standard rdf:Literal + xsd:integer
|
|
153
|
+
* @standardFit Exact
|
|
154
|
+
* @litmus Not a decimal or string.
|
|
155
|
+
*/
|
|
156
|
+
readonly IntegerLiteral: "a1";
|
|
157
|
+
/**
|
|
158
|
+
* A decimal or floating-point number.
|
|
159
|
+
*
|
|
160
|
+
* @layer Literals
|
|
161
|
+
* @standard rdf:Literal + xsd:decimal
|
|
162
|
+
* @standardFit Exact
|
|
163
|
+
* @litmus Not an integer.
|
|
164
|
+
*/
|
|
165
|
+
readonly DecimalLiteral: "a2";
|
|
166
|
+
/**
|
|
167
|
+
* A true or false value.
|
|
168
|
+
*
|
|
169
|
+
* @layer Literals
|
|
170
|
+
* @standard rdf:Literal + xsd:boolean
|
|
171
|
+
* @standardFit Exact
|
|
172
|
+
* @litmus Not a number or string.
|
|
173
|
+
*/
|
|
174
|
+
readonly BoolLiteral: "a3";
|
|
175
|
+
/**
|
|
176
|
+
* A calendar date (YYYY-MM-DD formatted according to ISO 8601).
|
|
177
|
+
*
|
|
178
|
+
* @layer Literals
|
|
179
|
+
* @standard rdf:Literal + xsd:date
|
|
180
|
+
* @standardFit Exact
|
|
181
|
+
* @litmus Not a datetime or time.
|
|
182
|
+
*/
|
|
183
|
+
readonly DateLiteral: "a4";
|
|
184
|
+
/**
|
|
185
|
+
* A time of day (formatted according to ISO 8601, represented in UTC).
|
|
186
|
+
*
|
|
187
|
+
* @layer Literals
|
|
188
|
+
* @standard rdf:Literal + xsd:time
|
|
189
|
+
* @standardFit Exact
|
|
190
|
+
* @litmus Not a date or datetime.
|
|
191
|
+
*/
|
|
192
|
+
readonly TimeLiteral: "a5";
|
|
193
|
+
/**
|
|
194
|
+
* A specific point in time (ISO 8601 formatted, UTC normalized).
|
|
195
|
+
*
|
|
196
|
+
* @layer Literals
|
|
197
|
+
* @standard rdf:Literal + xsd:dateTime
|
|
198
|
+
* @standardFit Exact
|
|
199
|
+
* @litmus Not a date or time alone.
|
|
200
|
+
*/
|
|
201
|
+
readonly DateTimeLiteral: "a6";
|
|
202
|
+
/**
|
|
203
|
+
* A calculated amount of elapsed time (ISO 8601 duration format).
|
|
204
|
+
*
|
|
205
|
+
* @layer Literals
|
|
206
|
+
* @standard rdf:Literal + xsd:duration
|
|
207
|
+
* @standardFit Exact
|
|
208
|
+
* @litmus Not a datetime.
|
|
209
|
+
*/
|
|
210
|
+
readonly DurationLiteral: "a7";
|
|
211
|
+
/**
|
|
212
|
+
* A formalized Uniform Resource Identifier string (RFC 3986).
|
|
213
|
+
*
|
|
214
|
+
* @layer Literals
|
|
215
|
+
* @standard rdf:Literal + xsd:anyURI
|
|
216
|
+
* @standardFit Exact
|
|
217
|
+
* @litmus Not plain text.
|
|
218
|
+
*/
|
|
219
|
+
readonly URILiteral: "a8";
|
|
220
|
+
/**
|
|
221
|
+
* A structured JSON object represented in canonical string form (RFC 8785).
|
|
222
|
+
*
|
|
223
|
+
* @layer Literals
|
|
224
|
+
* @standard rdf:Literal + rdf:JSON
|
|
225
|
+
* @standardFit Exact
|
|
226
|
+
* @litmus Not a string.
|
|
227
|
+
*/
|
|
228
|
+
readonly JSONLiteral: "a9";
|
|
19
229
|
};
|
|
20
230
|
/**
|
|
21
231
|
* Reverse lookup: character code to entity type name
|
|
@@ -28,7 +238,7 @@ export declare const FIDE_CHAR_TO_ENTITY_TYPE: Record<string, keyof typeof FIDE_
|
|
|
28
238
|
export declare const FIDE_ID_PREFIX: "did:fide:0x";
|
|
29
239
|
/**
|
|
30
240
|
* Fide ID Length (excluding prefix)
|
|
31
|
-
* 40 hex characters:
|
|
241
|
+
* 40 hex characters: 2 (type) + 2 (source) + 36 (fingerprint)
|
|
32
242
|
*/
|
|
33
243
|
export declare const FIDE_ID_HEX_LENGTH = 40;
|
|
34
244
|
/**
|
|
@@ -38,6 +248,6 @@ export declare const FIDE_ID_HEX_LENGTH = 40;
|
|
|
38
248
|
export declare const FIDE_ID_LENGTH: number;
|
|
39
249
|
/**
|
|
40
250
|
* Fingerprint Length
|
|
41
|
-
*
|
|
251
|
+
* First 36 hex characters (18 bytes) of SHA-256 hash
|
|
42
252
|
*/
|
|
43
|
-
export declare const FIDE_ID_FINGERPRINT_LENGTH =
|
|
253
|
+
export declare const FIDE_ID_FINGERPRINT_LENGTH = 36;
|