@disclosureos/records 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/CHANGELOG.md +20 -0
- package/LICENSE +21 -0
- package/README.md +121 -0
- package/dist/attachment-Hrg8uHuf.d.ts +23 -0
- package/dist/confidence-level-CV3P1W5_.d.ts +25 -0
- package/dist/constants/index.d.ts +28 -0
- package/dist/constants/index.js +885 -0
- package/dist/constants/index.js.map +1 -0
- package/dist/credibility-CcQ0MUfQ.d.ts +14 -0
- package/dist/digital-ADBJTqSi.d.ts +278 -0
- package/dist/domains-CjIFZGBh.d.ts +330 -0
- package/dist/enum-guard-DzPkp2oJ.d.ts +101 -0
- package/dist/extensions/document/index.d.ts +47 -0
- package/dist/extensions/document/index.js +31 -0
- package/dist/extensions/document/index.js.map +1 -0
- package/dist/extensions/identifiers/index.d.ts +139 -0
- package/dist/extensions/identifiers/index.js +47 -0
- package/dist/extensions/identifiers/index.js.map +1 -0
- package/dist/extensions/physical/index.d.ts +84 -0
- package/dist/extensions/physical/index.js +84 -0
- package/dist/extensions/physical/index.js.map +1 -0
- package/dist/extensions/provenance/index.d.ts +153 -0
- package/dist/extensions/provenance/index.js +120 -0
- package/dist/extensions/provenance/index.js.map +1 -0
- package/dist/extensions/testimony/index.d.ts +400 -0
- package/dist/extensions/testimony/index.js +203 -0
- package/dist/extensions/testimony/index.js.map +1 -0
- package/dist/factories/index.d.ts +31 -0
- package/dist/factories/index.js +905 -0
- package/dist/factories/index.js.map +1 -0
- package/dist/formatters/index.d.ts +18 -0
- package/dist/formatters/index.js +156 -0
- package/dist/formatters/index.js.map +1 -0
- package/dist/geo/index.d.ts +16 -0
- package/dist/geo/index.js +146 -0
- package/dist/geo/index.js.map +1 -0
- package/dist/guards/index.d.ts +74 -0
- package/dist/guards/index.js +892 -0
- package/dist/guards/index.js.map +1 -0
- package/dist/index.d.ts +42 -0
- package/dist/index.js +1350 -0
- package/dist/index.js.map +1 -0
- package/dist/labels/index.d.ts +33 -0
- package/dist/labels/index.js +181 -0
- package/dist/labels/index.js.map +1 -0
- package/dist/location-56xtMNtC.d.ts +408 -0
- package/dist/media/index.d.ts +3 -0
- package/dist/media/index.js +21 -0
- package/dist/media/index.js.map +1 -0
- package/dist/observation/index.d.ts +7 -0
- package/dist/observation/index.js +865 -0
- package/dist/observation/index.js.map +1 -0
- package/dist/shared/index.d.ts +29 -0
- package/dist/shared/index.js +87 -0
- package/dist/shared/index.js.map +1 -0
- package/dist/source/index.d.ts +51 -0
- package/dist/source/index.js +45 -0
- package/dist/source/index.js.map +1 -0
- package/dist/source/sensor/index.d.ts +170 -0
- package/dist/source/sensor/index.js +69 -0
- package/dist/source/sensor/index.js.map +1 -0
- package/dist/temporal/index.d.ts +20 -0
- package/dist/temporal/index.js +78 -0
- package/dist/temporal/index.js.map +1 -0
- package/dist/temporal-data-t8Mzu8Ui.d.ts +148 -0
- package/dist/time-of-day-DLDBwTrn.d.ts +165 -0
- package/dist/types-CzNfaip-.d.ts +1267 -0
- package/dist/types-DH_-SdHj.d.ts +11 -0
- package/dist/types-clxXEQOH.d.ts +27 -0
- package/dist/validation-C-_QLXXf.d.ts +34 -0
- package/dist/validators/index.d.ts +15 -0
- package/dist/validators/index.js +895 -0
- package/dist/validators/index.js.map +1 -0
- package/package.json +146 -0
- package/schema/records.schema.json +2538 -0
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
// src/extensions/identifiers/external.ts
|
|
4
|
+
var IdentifierSystemSchema = z.enum([
|
|
5
|
+
"nuforc",
|
|
6
|
+
"mufon",
|
|
7
|
+
"geipan",
|
|
8
|
+
"cufos",
|
|
9
|
+
"nicap",
|
|
10
|
+
"bluebook",
|
|
11
|
+
"nara",
|
|
12
|
+
"foia",
|
|
13
|
+
"aaro",
|
|
14
|
+
"congress",
|
|
15
|
+
"doi",
|
|
16
|
+
"arxiv",
|
|
17
|
+
"orcid",
|
|
18
|
+
"pubmed",
|
|
19
|
+
"isbn",
|
|
20
|
+
"issn",
|
|
21
|
+
"youtube",
|
|
22
|
+
"vimeo",
|
|
23
|
+
"internet_archive",
|
|
24
|
+
"wayback",
|
|
25
|
+
"url",
|
|
26
|
+
"uri",
|
|
27
|
+
"custom"
|
|
28
|
+
]).describe("External identifier namespace (reporting centers, archives, academic registries, media hosts).");
|
|
29
|
+
var ExternalIdentifierSchema = z.object({
|
|
30
|
+
system: IdentifierSystemSchema,
|
|
31
|
+
systemName: z.string().optional().describe('Display name of the system, required when `system` is "custom".'),
|
|
32
|
+
value: z.string().describe("The identifier value within the external system (e.g. a case number)."),
|
|
33
|
+
url: z.string().optional().describe("Direct link to the record in the external system."),
|
|
34
|
+
verified: z.boolean().optional().describe("Whether the identifier has been confirmed to point at this observation."),
|
|
35
|
+
verifiedDate: z.string().optional().describe("When the identifier was last verified (ISO date)."),
|
|
36
|
+
accessible: z.boolean().optional().describe("Whether the external record is currently reachable."),
|
|
37
|
+
accessCheckedDate: z.string().optional().describe("When accessibility was last checked (ISO date)."),
|
|
38
|
+
notes: z.string().optional().describe("Free-text context about the cross-reference.")
|
|
39
|
+
}).meta({ id: "ExternalIdentifier" }).describe("A reference to this observation in an external system or archive.");
|
|
40
|
+
var CrossReferencesSchema = z.object({
|
|
41
|
+
primary: ExternalIdentifierSchema.optional(),
|
|
42
|
+
identifiers: z.array(ExternalIdentifierSchema)
|
|
43
|
+
}).meta({ id: "CrossReferences" }).describe("External identifiers cross-referencing this observation, with an optional primary.");
|
|
44
|
+
|
|
45
|
+
export { CrossReferencesSchema, ExternalIdentifierSchema, IdentifierSystemSchema };
|
|
46
|
+
//# sourceMappingURL=index.js.map
|
|
47
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/extensions/identifiers/external.ts"],"names":[],"mappings":";;;AAEO,IAAM,sBAAA,GAAyB,EACnC,IAAA,CAAK;AAAA,EACJ,QAAA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,CAAO;AAAA,EACN,OAAA,EAAS,yBAAyB,QAAA,EAAS;AAAA,EAC3C,WAAA,EAAa,CAAA,CAAE,KAAA,CAAM,wBAAwB;AAC/C,CAAC,CAAA,CACA,KAAK,EAAE,EAAA,EAAI,mBAAmB,CAAA,CAC9B,SAAS,oFAAoF","file":"index.js","sourcesContent":["import { z } from 'zod';\n\nexport const IdentifierSystemSchema = z\n .enum([\n 'nuforc',\n 'mufon',\n 'geipan',\n 'cufos',\n 'nicap',\n 'bluebook',\n 'nara',\n 'foia',\n 'aaro',\n 'congress',\n 'doi',\n 'arxiv',\n 'orcid',\n 'pubmed',\n 'isbn',\n 'issn',\n 'youtube',\n 'vimeo',\n 'internet_archive',\n 'wayback',\n 'url',\n 'uri',\n 'custom',\n ])\n .describe('External identifier namespace (reporting centers, archives, academic registries, media hosts).');\n\nexport type IdentifierSystem = z.infer<typeof IdentifierSystemSchema>;\n\nexport const ExternalIdentifierSchema = z\n .object({\n system: IdentifierSystemSchema,\n systemName: z\n .string()\n .optional()\n .describe('Display name of the system, required when `system` is \"custom\".'),\n value: z.string().describe('The identifier value within the external system (e.g. a case number).'),\n url: z.string().optional().describe('Direct link to the record in the external system.'),\n verified: z.boolean().optional().describe('Whether the identifier has been confirmed to point at this observation.'),\n verifiedDate: z.string().optional().describe('When the identifier was last verified (ISO date).'),\n accessible: z.boolean().optional().describe('Whether the external record is currently reachable.'),\n accessCheckedDate: z.string().optional().describe('When accessibility was last checked (ISO date).'),\n notes: z.string().optional().describe('Free-text context about the cross-reference.'),\n })\n .meta({ id: 'ExternalIdentifier' })\n .describe('A reference to this observation in an external system or archive.');\n\nexport type ExternalIdentifier = z.infer<typeof ExternalIdentifierSchema>;\n\nexport const CrossReferencesSchema = z\n .object({\n primary: ExternalIdentifierSchema.optional(),\n identifiers: z.array(ExternalIdentifierSchema),\n })\n .meta({ id: 'CrossReferences' })\n .describe('External identifiers cross-referencing this observation, with an optional primary.');\n\nexport type CrossReferences = z.infer<typeof CrossReferencesSchema>;\n"]}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
declare const EvidenceTypeSchema: z.ZodEnum<{
|
|
4
|
+
other: "other";
|
|
5
|
+
video: "video";
|
|
6
|
+
material_sample: "material_sample";
|
|
7
|
+
ground_trace: "ground_trace";
|
|
8
|
+
radiation_reading: "radiation_reading";
|
|
9
|
+
electromagnetic_recording: "electromagnetic_recording";
|
|
10
|
+
photographic: "photographic";
|
|
11
|
+
audio_recording: "audio_recording";
|
|
12
|
+
biological_sample: "biological_sample";
|
|
13
|
+
implant: "implant";
|
|
14
|
+
debris: "debris";
|
|
15
|
+
soil_sample: "soil_sample";
|
|
16
|
+
water_sample: "water_sample";
|
|
17
|
+
vegetation_sample: "vegetation_sample";
|
|
18
|
+
impression: "impression";
|
|
19
|
+
burn_mark: "burn_mark";
|
|
20
|
+
}>;
|
|
21
|
+
type EvidenceType = z.infer<typeof EvidenceTypeSchema>;
|
|
22
|
+
declare const EvidenceQualitySchema: z.ZodEnum<{
|
|
23
|
+
unknown: "unknown";
|
|
24
|
+
laboratory_grade: "laboratory_grade";
|
|
25
|
+
field_collected: "field_collected";
|
|
26
|
+
uncontrolled: "uncontrolled";
|
|
27
|
+
degraded: "degraded";
|
|
28
|
+
contaminated: "contaminated";
|
|
29
|
+
}>;
|
|
30
|
+
type EvidenceQuality = z.infer<typeof EvidenceQualitySchema>;
|
|
31
|
+
declare const PhysicalEvidenceItemSchema: z.ZodObject<{
|
|
32
|
+
id: z.ZodString;
|
|
33
|
+
type: z.ZodEnum<{
|
|
34
|
+
other: "other";
|
|
35
|
+
video: "video";
|
|
36
|
+
material_sample: "material_sample";
|
|
37
|
+
ground_trace: "ground_trace";
|
|
38
|
+
radiation_reading: "radiation_reading";
|
|
39
|
+
electromagnetic_recording: "electromagnetic_recording";
|
|
40
|
+
photographic: "photographic";
|
|
41
|
+
audio_recording: "audio_recording";
|
|
42
|
+
biological_sample: "biological_sample";
|
|
43
|
+
implant: "implant";
|
|
44
|
+
debris: "debris";
|
|
45
|
+
soil_sample: "soil_sample";
|
|
46
|
+
water_sample: "water_sample";
|
|
47
|
+
vegetation_sample: "vegetation_sample";
|
|
48
|
+
impression: "impression";
|
|
49
|
+
burn_mark: "burn_mark";
|
|
50
|
+
}>;
|
|
51
|
+
quality: z.ZodEnum<{
|
|
52
|
+
unknown: "unknown";
|
|
53
|
+
laboratory_grade: "laboratory_grade";
|
|
54
|
+
field_collected: "field_collected";
|
|
55
|
+
uncontrolled: "uncontrolled";
|
|
56
|
+
degraded: "degraded";
|
|
57
|
+
contaminated: "contaminated";
|
|
58
|
+
}>;
|
|
59
|
+
description: z.ZodOptional<z.ZodString>;
|
|
60
|
+
collectionDate: z.ZodOptional<z.ZodString>;
|
|
61
|
+
collectionMethod: z.ZodOptional<z.ZodString>;
|
|
62
|
+
collectorName: z.ZodOptional<z.ZodString>;
|
|
63
|
+
collectorOrganization: z.ZodOptional<z.ZodString>;
|
|
64
|
+
storageLocation: z.ZodOptional<z.ZodString>;
|
|
65
|
+
chainOfCustody: z.ZodOptional<z.ZodEnum<{
|
|
66
|
+
unknown: "unknown";
|
|
67
|
+
destroyed: "destroyed";
|
|
68
|
+
classified: "classified";
|
|
69
|
+
verified: "verified";
|
|
70
|
+
partial: "partial";
|
|
71
|
+
unverified: "unverified";
|
|
72
|
+
government_held: "government_held";
|
|
73
|
+
private_held: "private_held";
|
|
74
|
+
lost: "lost";
|
|
75
|
+
}>>;
|
|
76
|
+
analysisPerformed: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
77
|
+
analysisResults: z.ZodOptional<z.ZodString>;
|
|
78
|
+
photographed: z.ZodOptional<z.ZodBoolean>;
|
|
79
|
+
labReport: z.ZodOptional<z.ZodBoolean>;
|
|
80
|
+
notes: z.ZodOptional<z.ZodString>;
|
|
81
|
+
}, z.core.$strip>;
|
|
82
|
+
type PhysicalEvidenceItem = z.infer<typeof PhysicalEvidenceItemSchema>;
|
|
83
|
+
|
|
84
|
+
export { type EvidenceQuality, EvidenceQualitySchema, type EvidenceType, EvidenceTypeSchema, type PhysicalEvidenceItem, PhysicalEvidenceItemSchema };
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
// src/extensions/physical/types.ts
|
|
4
|
+
var ChainOfCustodySchema = z.enum([
|
|
5
|
+
"verified",
|
|
6
|
+
"partial",
|
|
7
|
+
"unverified",
|
|
8
|
+
"government_held",
|
|
9
|
+
"private_held",
|
|
10
|
+
"lost",
|
|
11
|
+
"destroyed",
|
|
12
|
+
"classified",
|
|
13
|
+
"unknown"
|
|
14
|
+
]).describe("Custody status of an evidence item.");
|
|
15
|
+
var CustodyActionSchema = z.enum([
|
|
16
|
+
"creation",
|
|
17
|
+
"collection",
|
|
18
|
+
"transfer",
|
|
19
|
+
"storage",
|
|
20
|
+
"analysis",
|
|
21
|
+
"release",
|
|
22
|
+
"classification",
|
|
23
|
+
"destruction",
|
|
24
|
+
"loss",
|
|
25
|
+
"recovery",
|
|
26
|
+
"other"
|
|
27
|
+
]).describe("An action recorded in a chain-of-custody entry.");
|
|
28
|
+
var CustodyEntrySchema = z.object({
|
|
29
|
+
entryId: z.string().describe("Stable unique identifier for this custody entry."),
|
|
30
|
+
date: z.string().describe("When the custody event occurred (ISO date)."),
|
|
31
|
+
action: CustodyActionSchema,
|
|
32
|
+
from: z.string().optional().describe("Party that held the evidence before this event."),
|
|
33
|
+
to: z.string().optional().describe("Party that held the evidence after this event."),
|
|
34
|
+
location: z.string().optional().describe("Where the custody event took place."),
|
|
35
|
+
reference: z.string().optional().describe("Document or record substantiating the event (e.g. transfer receipt, log entry)."),
|
|
36
|
+
notes: z.string().optional().describe("Free-text context about the event.")
|
|
37
|
+
}).meta({ id: "CustodyEntry" }).describe("A single custody event for an evidence item.");
|
|
38
|
+
z.object({
|
|
39
|
+
evidenceId: z.string().describe("Identifier of the evidence item this custody history belongs to."),
|
|
40
|
+
status: ChainOfCustodySchema,
|
|
41
|
+
entries: z.array(CustodyEntrySchema)
|
|
42
|
+
}).meta({ id: "ChainOfCustodyRecord" }).describe("The full custody history for a piece of evidence.");
|
|
43
|
+
|
|
44
|
+
// src/extensions/physical/types.ts
|
|
45
|
+
var EvidenceTypeSchema = z.enum([
|
|
46
|
+
"material_sample",
|
|
47
|
+
"ground_trace",
|
|
48
|
+
"radiation_reading",
|
|
49
|
+
"electromagnetic_recording",
|
|
50
|
+
"photographic",
|
|
51
|
+
"video",
|
|
52
|
+
"audio_recording",
|
|
53
|
+
"biological_sample",
|
|
54
|
+
"implant",
|
|
55
|
+
"debris",
|
|
56
|
+
"soil_sample",
|
|
57
|
+
"water_sample",
|
|
58
|
+
"vegetation_sample",
|
|
59
|
+
"impression",
|
|
60
|
+
"burn_mark",
|
|
61
|
+
"other"
|
|
62
|
+
]).describe("Kind of physical evidence collected.");
|
|
63
|
+
var EvidenceQualitySchema = z.enum(["laboratory_grade", "field_collected", "uncontrolled", "degraded", "contaminated", "unknown"]).describe("Collection/handling quality of a physical evidence item.");
|
|
64
|
+
var PhysicalEvidenceItemSchema = z.object({
|
|
65
|
+
id: z.string().describe('Stable id, addressable by a claim `evidenceRef` ("physical:<id>").'),
|
|
66
|
+
type: EvidenceTypeSchema,
|
|
67
|
+
quality: EvidenceQualitySchema,
|
|
68
|
+
description: z.string().optional().describe("What the evidence item is and what makes it notable."),
|
|
69
|
+
collectionDate: z.string().optional().describe("When the evidence was collected (ISO date)."),
|
|
70
|
+
collectionMethod: z.string().optional().describe('How the evidence was collected (e.g. "sterile swab", "soil core sample").'),
|
|
71
|
+
collectorName: z.string().optional().describe("Person who collected the evidence."),
|
|
72
|
+
collectorOrganization: z.string().optional().describe("Organization the collector represents."),
|
|
73
|
+
storageLocation: z.string().optional().describe("Where the evidence is currently stored."),
|
|
74
|
+
chainOfCustody: ChainOfCustodySchema.optional(),
|
|
75
|
+
analysisPerformed: z.array(z.string()).optional().describe('Analyses run on the evidence (e.g. "isotopic analysis", "spectroscopy").'),
|
|
76
|
+
analysisResults: z.string().optional().describe("Summary of what the analyses found."),
|
|
77
|
+
photographed: z.boolean().optional().describe("Whether the evidence was photographed in situ or in the lab."),
|
|
78
|
+
labReport: z.boolean().optional().describe("Whether a formal laboratory report exists."),
|
|
79
|
+
notes: z.string().optional().describe("Free-text context about the evidence item.")
|
|
80
|
+
}).meta({ id: "PhysicalEvidenceItem" }).describe("A physical artifact associated with an observation and its handling record.");
|
|
81
|
+
|
|
82
|
+
export { EvidenceQualitySchema, EvidenceTypeSchema, PhysicalEvidenceItemSchema };
|
|
83
|
+
//# sourceMappingURL=index.js.map
|
|
84
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/extensions/provenance/custody.ts","../../../src/extensions/physical/types.ts"],"names":["z"],"mappings":";;;AAEO,IAAM,oBAAA,GAAuB,EACjC,IAAA,CAAK;AAAA,EACJ,UAAA;AAAA,EACA,SAAA;AAAA,EACA,YAAA;AAAA,EACA,iBAAA;AAAA,EACA,cAAA;AAAA,EACA,MAAA;AAAA,EACA,WAAA;AAAA,EACA,YAAA;AAAA,EACA;AACF,CAAC,CAAA,CACA,SAAS,qCAAqC,CAAA;AAI1C,IAAM,mBAAA,GAAsB,EAChC,IAAA,CAAK;AAAA,EACJ,UAAA;AAAA,EACA,YAAA;AAAA,EACA,UAAA;AAAA,EACA,SAAA;AAAA,EACA,UAAA;AAAA,EACA,SAAA;AAAA,EACA,gBAAA;AAAA,EACA,aAAA;AAAA,EACA,MAAA;AAAA,EACA,UAAA;AAAA,EACA;AACF,CAAC,CAAA,CACA,SAAS,iDAAiD,CAAA;AAItD,IAAM,kBAAA,GAAqB,EAC/B,MAAA,CAAO;AAAA,EACN,OAAA,EAAS,CAAA,CAAE,MAAA,EAAO,CAAE,SAAS,kDAAkD,CAAA;AAAA,EAC/E,IAAA,EAAM,CAAA,CAAE,MAAA,EAAO,C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AAA,EACvF,OAAOA,CAAAA,CAAE,MAAA,GAAS,QAAA,EAAS,CAAE,SAAS,4CAA4C;AACpF,CAAC,CAAA,CACA,KAAK,EAAE,EAAA,EAAI,wBAAwB,CAAA,CACnC,SAAS,6EAA6E","file":"index.js","sourcesContent":["import { z } from 'zod';\n\nexport const ChainOfCustodySchema = z\n .enum([\n 'verified',\n 'partial',\n 'unverified',\n 'government_held',\n 'private_held',\n 'lost',\n 'destroyed',\n 'classified',\n 'unknown',\n ])\n .describe('Custody status of an evidence item.');\n\nexport type ChainOfCustody = z.infer<typeof ChainOfCustodySchema>;\n\nexport const CustodyActionSchema = z\n .enum([\n 'creation',\n 'collection',\n 'transfer',\n 'storage',\n 'analysis',\n 'release',\n 'classification',\n 'destruction',\n 'loss',\n 'recovery',\n 'other',\n ])\n .describe('An action recorded in a chain-of-custody entry.');\n\nexport type CustodyAction = z.infer<typeof CustodyActionSchema>;\n\nexport const CustodyEntrySchema = z\n .object({\n entryId: z.string().describe('Stable unique identifier for this custody entry.'),\n date: z.string().describe('When the custody event occurred (ISO date).'),\n action: CustodyActionSchema,\n from: z.string().optional().describe('Party that held the evidence before this event.'),\n to: z.string().optional().describe('Party that held the evidence after this event.'),\n location: z.string().optional().describe('Where the custody event took place.'),\n reference: z\n .string()\n .optional()\n .describe('Document or record substantiating the event (e.g. transfer receipt, log entry).'),\n notes: z.string().optional().describe('Free-text context about the event.'),\n })\n .meta({ id: 'CustodyEntry' })\n .describe('A single custody event for an evidence item.');\n\nexport type CustodyEntry = z.infer<typeof CustodyEntrySchema>;\n\nexport const ChainOfCustodyRecordSchema = z\n .object({\n evidenceId: z.string().describe('Identifier of the evidence item this custody history belongs to.'),\n status: ChainOfCustodySchema,\n entries: z.array(CustodyEntrySchema),\n })\n .meta({ id: 'ChainOfCustodyRecord' })\n .describe('The full custody history for a piece of evidence.');\n\nexport type ChainOfCustodyRecord = z.infer<typeof ChainOfCustodyRecordSchema>;\n","import { z } from 'zod';\nimport { ChainOfCustodySchema } from '../provenance/custody';\n\nexport const EvidenceTypeSchema = z\n .enum([\n 'material_sample',\n 'ground_trace',\n 'radiation_reading',\n 'electromagnetic_recording',\n 'photographic',\n 'video',\n 'audio_recording',\n 'biological_sample',\n 'implant',\n 'debris',\n 'soil_sample',\n 'water_sample',\n 'vegetation_sample',\n 'impression',\n 'burn_mark',\n 'other',\n ])\n .describe('Kind of physical evidence collected.');\n\nexport type EvidenceType = z.infer<typeof EvidenceTypeSchema>;\n\nexport const EvidenceQualitySchema = z\n .enum(['laboratory_grade', 'field_collected', 'uncontrolled', 'degraded', 'contaminated', 'unknown'])\n .describe('Collection/handling quality of a physical evidence item.');\n\nexport type EvidenceQuality = z.infer<typeof EvidenceQualitySchema>;\n\nexport const PhysicalEvidenceItemSchema = z\n .object({\n id: z.string().describe('Stable id, addressable by a claim `evidenceRef` (\"physical:<id>\").'),\n type: EvidenceTypeSchema,\n quality: EvidenceQualitySchema,\n description: z.string().optional().describe('What the evidence item is and what makes it notable.'),\n collectionDate: z.string().optional().describe('When the evidence was collected (ISO date).'),\n collectionMethod: z\n .string()\n .optional()\n .describe('How the evidence was collected (e.g. \"sterile swab\", \"soil core sample\").'),\n collectorName: z.string().optional().describe('Person who collected the evidence.'),\n collectorOrganization: z.string().optional().describe('Organization the collector represents.'),\n storageLocation: z.string().optional().describe('Where the evidence is currently stored.'),\n chainOfCustody: ChainOfCustodySchema.optional(),\n analysisPerformed: z\n .array(z.string())\n .optional()\n .describe('Analyses run on the evidence (e.g. \"isotopic analysis\", \"spectroscopy\").'),\n analysisResults: z.string().optional().describe('Summary of what the analyses found.'),\n photographed: z.boolean().optional().describe('Whether the evidence was photographed in situ or in the lab.'),\n labReport: z.boolean().optional().describe('Whether a formal laboratory report exists.'),\n notes: z.string().optional().describe('Free-text context about the evidence item.'),\n })\n .meta({ id: 'PhysicalEvidenceItem' })\n .describe('A physical artifact associated with an observation and its handling record.');\n\nexport type PhysicalEvidenceItem = z.infer<typeof PhysicalEvidenceItemSchema>;\n"]}
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export { C as CaptureMetadata, a as CaptureMetadataSchema, b as ChainOfCustody, c as ChainOfCustodyRecord, d as ChainOfCustodyRecordSchema, e as ChainOfCustodySchema, f as CustodyAction, g as CustodyActionSchema, h as CustodyEntry, i as CustodyEntrySchema, D as DigitalProvenance, j as DigitalProvenanceSchema, F as FileHash, k as FileHashSchema, H as HashAlgorithm, l as HashAlgorithmSchema, T as ThirdPartyVerification, m as ThirdPartyVerificationSchema, V as VerificationMethod, n as VerificationMethodSchema, o as VerificationResult, p as VerificationResultSchema } from '../../digital-ADBJTqSi.js';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Payload of the optional `Observation.provenance` slot — the forensic/custody
|
|
6
|
+
* trail for a record: high-level custody status, the full custody chain, and the
|
|
7
|
+
* digital authenticity record. All optional; attach only what applies.
|
|
8
|
+
*/
|
|
9
|
+
declare const ProvenanceSchema: z.ZodObject<{
|
|
10
|
+
custodyStatus: z.ZodOptional<z.ZodEnum<{
|
|
11
|
+
unknown: "unknown";
|
|
12
|
+
destroyed: "destroyed";
|
|
13
|
+
classified: "classified";
|
|
14
|
+
verified: "verified";
|
|
15
|
+
partial: "partial";
|
|
16
|
+
unverified: "unverified";
|
|
17
|
+
government_held: "government_held";
|
|
18
|
+
private_held: "private_held";
|
|
19
|
+
lost: "lost";
|
|
20
|
+
}>>;
|
|
21
|
+
custody: z.ZodOptional<z.ZodObject<{
|
|
22
|
+
evidenceId: z.ZodString;
|
|
23
|
+
status: z.ZodEnum<{
|
|
24
|
+
unknown: "unknown";
|
|
25
|
+
destroyed: "destroyed";
|
|
26
|
+
classified: "classified";
|
|
27
|
+
verified: "verified";
|
|
28
|
+
partial: "partial";
|
|
29
|
+
unverified: "unverified";
|
|
30
|
+
government_held: "government_held";
|
|
31
|
+
private_held: "private_held";
|
|
32
|
+
lost: "lost";
|
|
33
|
+
}>;
|
|
34
|
+
entries: z.ZodArray<z.ZodObject<{
|
|
35
|
+
entryId: z.ZodString;
|
|
36
|
+
date: z.ZodString;
|
|
37
|
+
action: z.ZodEnum<{
|
|
38
|
+
other: "other";
|
|
39
|
+
creation: "creation";
|
|
40
|
+
collection: "collection";
|
|
41
|
+
transfer: "transfer";
|
|
42
|
+
storage: "storage";
|
|
43
|
+
analysis: "analysis";
|
|
44
|
+
release: "release";
|
|
45
|
+
classification: "classification";
|
|
46
|
+
destruction: "destruction";
|
|
47
|
+
loss: "loss";
|
|
48
|
+
recovery: "recovery";
|
|
49
|
+
}>;
|
|
50
|
+
from: z.ZodOptional<z.ZodString>;
|
|
51
|
+
to: z.ZodOptional<z.ZodString>;
|
|
52
|
+
location: z.ZodOptional<z.ZodString>;
|
|
53
|
+
reference: z.ZodOptional<z.ZodString>;
|
|
54
|
+
notes: z.ZodOptional<z.ZodString>;
|
|
55
|
+
}, z.core.$strip>>;
|
|
56
|
+
}, z.core.$strip>>;
|
|
57
|
+
digital: z.ZodOptional<z.ZodObject<{
|
|
58
|
+
hash: z.ZodOptional<z.ZodObject<{
|
|
59
|
+
algorithm: z.ZodEnum<{
|
|
60
|
+
sha256: "sha256";
|
|
61
|
+
sha512: "sha512";
|
|
62
|
+
sha1: "sha1";
|
|
63
|
+
md5: "md5";
|
|
64
|
+
}>;
|
|
65
|
+
value: z.ZodString;
|
|
66
|
+
}, z.core.$strip>>;
|
|
67
|
+
additionalHashes: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
68
|
+
algorithm: z.ZodEnum<{
|
|
69
|
+
sha256: "sha256";
|
|
70
|
+
sha512: "sha512";
|
|
71
|
+
sha1: "sha1";
|
|
72
|
+
md5: "md5";
|
|
73
|
+
}>;
|
|
74
|
+
value: z.ZodString;
|
|
75
|
+
}, z.core.$strip>>>;
|
|
76
|
+
captureMetadata: z.ZodOptional<z.ZodObject<{
|
|
77
|
+
device: z.ZodOptional<z.ZodString>;
|
|
78
|
+
manufacturer: z.ZodOptional<z.ZodString>;
|
|
79
|
+
model: z.ZodOptional<z.ZodString>;
|
|
80
|
+
software: z.ZodOptional<z.ZodString>;
|
|
81
|
+
originalFilename: z.ZodOptional<z.ZodString>;
|
|
82
|
+
originalCreationDate: z.ZodOptional<z.ZodString>;
|
|
83
|
+
gpsCoordinates: z.ZodOptional<z.ZodObject<{
|
|
84
|
+
latitude: z.ZodNumber;
|
|
85
|
+
longitude: z.ZodNumber;
|
|
86
|
+
altitude: z.ZodOptional<z.ZodNumber>;
|
|
87
|
+
}, z.core.$strip>>;
|
|
88
|
+
metadataPreserved: z.ZodOptional<z.ZodBoolean>;
|
|
89
|
+
metadataStripped: z.ZodOptional<z.ZodBoolean>;
|
|
90
|
+
strippedReason: z.ZodOptional<z.ZodString>;
|
|
91
|
+
}, z.core.$strip>>;
|
|
92
|
+
verifications: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
93
|
+
verifier: z.ZodString;
|
|
94
|
+
organization: z.ZodOptional<z.ZodString>;
|
|
95
|
+
credentials: z.ZodOptional<z.ZodString>;
|
|
96
|
+
date: z.ZodString;
|
|
97
|
+
method: z.ZodEnum<{
|
|
98
|
+
other: "other";
|
|
99
|
+
metadata_analysis: "metadata_analysis";
|
|
100
|
+
forensic_analysis: "forensic_analysis";
|
|
101
|
+
hash_verification: "hash_verification";
|
|
102
|
+
chain_of_custody: "chain_of_custody";
|
|
103
|
+
source_confirmation: "source_confirmation";
|
|
104
|
+
expert_review: "expert_review";
|
|
105
|
+
ai_analysis: "ai_analysis";
|
|
106
|
+
}>;
|
|
107
|
+
methodDescription: z.ZodOptional<z.ZodString>;
|
|
108
|
+
result: z.ZodEnum<{
|
|
109
|
+
unknown: "unknown";
|
|
110
|
+
authentic: "authentic";
|
|
111
|
+
likely_authentic: "likely_authentic";
|
|
112
|
+
inconclusive: "inconclusive";
|
|
113
|
+
likely_manipulated: "likely_manipulated";
|
|
114
|
+
manipulated: "manipulated";
|
|
115
|
+
ai_generated: "ai_generated";
|
|
116
|
+
deepfake: "deepfake";
|
|
117
|
+
composite: "composite";
|
|
118
|
+
}>;
|
|
119
|
+
confidence: z.ZodOptional<z.ZodEnum<{
|
|
120
|
+
high: "high";
|
|
121
|
+
medium: "medium";
|
|
122
|
+
low: "low";
|
|
123
|
+
}>>;
|
|
124
|
+
findings: z.ZodOptional<z.ZodString>;
|
|
125
|
+
reportUrl: z.ZodOptional<z.ZodString>;
|
|
126
|
+
}, z.core.$strip>>>;
|
|
127
|
+
provenanceChain: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
128
|
+
manipulationDetected: z.ZodOptional<z.ZodBoolean>;
|
|
129
|
+
manipulationDescription: z.ZodOptional<z.ZodString>;
|
|
130
|
+
authenticityAssessment: z.ZodOptional<z.ZodEnum<{
|
|
131
|
+
unknown: "unknown";
|
|
132
|
+
authentic: "authentic";
|
|
133
|
+
likely_authentic: "likely_authentic";
|
|
134
|
+
inconclusive: "inconclusive";
|
|
135
|
+
likely_manipulated: "likely_manipulated";
|
|
136
|
+
manipulated: "manipulated";
|
|
137
|
+
ai_generated: "ai_generated";
|
|
138
|
+
deepfake: "deepfake";
|
|
139
|
+
composite: "composite";
|
|
140
|
+
}>>;
|
|
141
|
+
authenticityConfidence: z.ZodOptional<z.ZodEnum<{
|
|
142
|
+
high: "high";
|
|
143
|
+
medium: "medium";
|
|
144
|
+
low: "low";
|
|
145
|
+
unassessed: "unassessed";
|
|
146
|
+
}>>;
|
|
147
|
+
lastUpdated: z.ZodOptional<z.ZodString>;
|
|
148
|
+
notes: z.ZodOptional<z.ZodString>;
|
|
149
|
+
}, z.core.$strip>>;
|
|
150
|
+
}, z.core.$strip>;
|
|
151
|
+
type Provenance = z.infer<typeof ProvenanceSchema>;
|
|
152
|
+
|
|
153
|
+
export { type Provenance, ProvenanceSchema };
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
// src/extensions/provenance/index.ts
|
|
4
|
+
var ChainOfCustodySchema = z.enum([
|
|
5
|
+
"verified",
|
|
6
|
+
"partial",
|
|
7
|
+
"unverified",
|
|
8
|
+
"government_held",
|
|
9
|
+
"private_held",
|
|
10
|
+
"lost",
|
|
11
|
+
"destroyed",
|
|
12
|
+
"classified",
|
|
13
|
+
"unknown"
|
|
14
|
+
]).describe("Custody status of an evidence item.");
|
|
15
|
+
var CustodyActionSchema = z.enum([
|
|
16
|
+
"creation",
|
|
17
|
+
"collection",
|
|
18
|
+
"transfer",
|
|
19
|
+
"storage",
|
|
20
|
+
"analysis",
|
|
21
|
+
"release",
|
|
22
|
+
"classification",
|
|
23
|
+
"destruction",
|
|
24
|
+
"loss",
|
|
25
|
+
"recovery",
|
|
26
|
+
"other"
|
|
27
|
+
]).describe("An action recorded in a chain-of-custody entry.");
|
|
28
|
+
var CustodyEntrySchema = z.object({
|
|
29
|
+
entryId: z.string().describe("Stable unique identifier for this custody entry."),
|
|
30
|
+
date: z.string().describe("When the custody event occurred (ISO date)."),
|
|
31
|
+
action: CustodyActionSchema,
|
|
32
|
+
from: z.string().optional().describe("Party that held the evidence before this event."),
|
|
33
|
+
to: z.string().optional().describe("Party that held the evidence after this event."),
|
|
34
|
+
location: z.string().optional().describe("Where the custody event took place."),
|
|
35
|
+
reference: z.string().optional().describe("Document or record substantiating the event (e.g. transfer receipt, log entry)."),
|
|
36
|
+
notes: z.string().optional().describe("Free-text context about the event.")
|
|
37
|
+
}).meta({ id: "CustodyEntry" }).describe("A single custody event for an evidence item.");
|
|
38
|
+
var ChainOfCustodyRecordSchema = z.object({
|
|
39
|
+
evidenceId: z.string().describe("Identifier of the evidence item this custody history belongs to."),
|
|
40
|
+
status: ChainOfCustodySchema,
|
|
41
|
+
entries: z.array(CustodyEntrySchema)
|
|
42
|
+
}).meta({ id: "ChainOfCustodyRecord" }).describe("The full custody history for a piece of evidence.");
|
|
43
|
+
var HashAlgorithmSchema = z.enum(["sha256", "sha512", "sha1", "md5"]).describe("Cryptographic hash algorithm used to fingerprint a file.");
|
|
44
|
+
var FileHashSchema = z.object({
|
|
45
|
+
algorithm: HashAlgorithmSchema,
|
|
46
|
+
value: z.string().describe("Hex-encoded hash digest of the file contents.")
|
|
47
|
+
}).meta({ id: "FileHash" }).describe("A content hash of a file.");
|
|
48
|
+
var VerificationMethodSchema = z.enum([
|
|
49
|
+
"metadata_analysis",
|
|
50
|
+
"forensic_analysis",
|
|
51
|
+
"hash_verification",
|
|
52
|
+
"chain_of_custody",
|
|
53
|
+
"source_confirmation",
|
|
54
|
+
"expert_review",
|
|
55
|
+
"ai_analysis",
|
|
56
|
+
"other"
|
|
57
|
+
]).describe("Method used to verify media authenticity.");
|
|
58
|
+
var VerificationResultSchema = z.enum([
|
|
59
|
+
"authentic",
|
|
60
|
+
"likely_authentic",
|
|
61
|
+
"inconclusive",
|
|
62
|
+
"likely_manipulated",
|
|
63
|
+
"manipulated",
|
|
64
|
+
"ai_generated",
|
|
65
|
+
"deepfake",
|
|
66
|
+
"composite",
|
|
67
|
+
"unknown"
|
|
68
|
+
]).describe("Outcome of an authenticity verification.");
|
|
69
|
+
var ThirdPartyVerificationSchema = z.object({
|
|
70
|
+
verifier: z.string().describe("Name of the person who performed the verification."),
|
|
71
|
+
organization: z.string().optional().describe("Organization the verifier represents."),
|
|
72
|
+
credentials: z.string().optional().describe('Verifier\u2019s relevant qualifications (e.g. "certified forensic video analyst").'),
|
|
73
|
+
date: z.string().describe("When the verification was performed (ISO date)."),
|
|
74
|
+
method: VerificationMethodSchema,
|
|
75
|
+
methodDescription: z.string().optional().describe("Fuller description of how the verification was performed."),
|
|
76
|
+
result: VerificationResultSchema,
|
|
77
|
+
confidence: z.enum(["high", "medium", "low"]).optional().describe("Verifier\u2019s confidence in their own result."),
|
|
78
|
+
findings: z.string().optional().describe("Summary of what the verification found."),
|
|
79
|
+
reportUrl: z.string().optional().describe("Link to the full verification report.")
|
|
80
|
+
}).meta({ id: "ThirdPartyVerification" }).describe("An independent authenticity assessment of media or a document.");
|
|
81
|
+
var CaptureMetadataSchema = z.object({
|
|
82
|
+
device: z.string().optional().describe('Capture device as recorded in metadata (e.g. "iPhone 14 Pro").'),
|
|
83
|
+
manufacturer: z.string().optional().describe("Device manufacturer from metadata."),
|
|
84
|
+
model: z.string().optional().describe("Device model from metadata."),
|
|
85
|
+
software: z.string().optional().describe("Software that produced or processed the file."),
|
|
86
|
+
originalFilename: z.string().optional().describe("Filename as originally captured, before any renaming."),
|
|
87
|
+
originalCreationDate: z.string().optional().describe("Creation timestamp embedded in the file metadata."),
|
|
88
|
+
gpsCoordinates: z.object({
|
|
89
|
+
latitude: z.number(),
|
|
90
|
+
longitude: z.number(),
|
|
91
|
+
altitude: z.number().optional()
|
|
92
|
+
}).optional().describe("GPS position embedded in the file metadata."),
|
|
93
|
+
metadataPreserved: z.boolean().optional().describe("Whether the original metadata survives intact."),
|
|
94
|
+
metadataStripped: z.boolean().optional().describe("Whether metadata was removed at some point."),
|
|
95
|
+
strippedReason: z.string().optional().describe('Why metadata was stripped (e.g. "platform re-encoding", "privacy redaction").')
|
|
96
|
+
}).meta({ id: "CaptureMetadata" }).describe("Capture/EXIF-style metadata extracted from a media file.");
|
|
97
|
+
var DigitalProvenanceSchema = z.object({
|
|
98
|
+
hash: FileHashSchema.optional(),
|
|
99
|
+
additionalHashes: z.array(FileHashSchema).optional(),
|
|
100
|
+
captureMetadata: CaptureMetadataSchema.optional(),
|
|
101
|
+
verifications: z.array(ThirdPartyVerificationSchema).optional(),
|
|
102
|
+
provenanceChain: z.array(z.string()).optional().describe('Ordered hops the file took from capture to here (e.g. "witness phone \u2192 NYT \u2192 public release").'),
|
|
103
|
+
manipulationDetected: z.boolean().optional().describe("Whether any analysis found evidence of manipulation."),
|
|
104
|
+
manipulationDescription: z.string().optional().describe("What manipulation was found, if any."),
|
|
105
|
+
authenticityAssessment: VerificationResultSchema.optional(),
|
|
106
|
+
authenticityConfidence: z.enum(["high", "medium", "low", "unassessed"]).optional().describe("Overall confidence in the authenticity assessment."),
|
|
107
|
+
lastUpdated: z.string().optional().describe("When this provenance record was last updated (ISO timestamp)."),
|
|
108
|
+
notes: z.string().optional().describe("Free-text context about the provenance trail.")
|
|
109
|
+
}).meta({ id: "DigitalProvenance" }).describe("Digital authenticity trail for media: hashes, capture metadata, and verifications.");
|
|
110
|
+
|
|
111
|
+
// src/extensions/provenance/index.ts
|
|
112
|
+
var ProvenanceSchema = z.object({
|
|
113
|
+
custodyStatus: ChainOfCustodySchema.optional(),
|
|
114
|
+
custody: ChainOfCustodyRecordSchema.optional(),
|
|
115
|
+
digital: DigitalProvenanceSchema.optional()
|
|
116
|
+
}).meta({ id: "Provenance" }).describe("Forensic provenance for an observation: custody status/chain and digital authenticity.");
|
|
117
|
+
|
|
118
|
+
export { CaptureMetadataSchema, ChainOfCustodyRecordSchema, ChainOfCustodySchema, CustodyActionSchema, CustodyEntrySchema, DigitalProvenanceSchema, FileHashSchema, HashAlgorithmSchema, ProvenanceSchema, ThirdPartyVerificationSchema, VerificationMethodSchema, VerificationResultSchema };
|
|
119
|
+
//# sourceMappingURL=index.js.map
|
|
120
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/extensions/provenance/custody.ts","../../../src/extensions/provenance/digital.ts","../../../src/extensions/provenance/index.ts"],"names":["z"],"mappings":";;;AAEO,IAAM,oBAAA,GAAuB,EACjC,IAAA,CAAK;AAAA,EACJ,UAAA;AAAA,EACA,SAAA;AAAA,EACA,YAAA;AAAA,EACA,iBAAA;AAAA,EACA,cAAA;AAAA,EACA,MAAA;AAAA,EACA,WAAA;AAAA,EACA,YAAA;AAAA,EACA;AACF,CAAC,CAAA,CACA,SAAS,qCAAqC;AAI1C,IAAM,mBAAA,GAAsB,EAChC,IAAA,CAAK;AAAA,EACJ,UAAA;AAAA,EACA,YAAA;AAAA,EACA,UAAA;AAAA,EACA,SAAA;AAAA,EACA,UAAA;AAAA,EACA,SAAA;AAAA,EACA,gBAAA;AAAA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A,CACA,KAAK,EAAE,EAAA,EAAI,qBAAqB,CAAA,CAChC,SAAS,oFAAoF;;;AClFzF,IAAM,gBAAA,GAAmBA,EAC7B,MAAA,CAAO;AAAA,EACN,aAAA,EAAe,qBAAqB,QAAA,EAAS;AAAA,EAC7C,OAAA,EAAS,2BAA2B,QAAA,EAAS;AAAA,EAC7C,OAAA,EAAS,wBAAwB,QAAA;AACnC,CAAC,CAAA,CACA,KAAK,EAAE,EAAA,EAAI,cAAc,CAAA,CACzB,SAAS,wFAAwF","file":"index.js","sourcesContent":["import { z } from 'zod';\n\nexport const ChainOfCustodySchema = z\n .enum([\n 'verified',\n 'partial',\n 'unverified',\n 'government_held',\n 'private_held',\n 'lost',\n 'destroyed',\n 'classified',\n 'unknown',\n ])\n .describe('Custody status of an evidence item.');\n\nexport type ChainOfCustody = z.infer<typeof ChainOfCustodySchema>;\n\nexport const CustodyActionSchema = z\n .enum([\n 'creation',\n 'collection',\n 'transfer',\n 'storage',\n 'analysis',\n 'release',\n 'classification',\n 'destruction',\n 'loss',\n 'recovery',\n 'other',\n ])\n .describe('An action recorded in a chain-of-custody entry.');\n\nexport type CustodyAction = z.infer<typeof CustodyActionSchema>;\n\nexport const CustodyEntrySchema = z\n .object({\n entryId: z.string().describe('Stable unique identifier for this custody entry.'),\n date: z.string().describe('When the custody event occurred (ISO date).'),\n action: CustodyActionSchema,\n from: z.string().optional().describe('Party that held the evidence before this event.'),\n to: z.string().optional().describe('Party that held the evidence after this event.'),\n location: z.string().optional().describe('Where the custody event took place.'),\n reference: z\n .string()\n .optional()\n .describe('Document or record substantiating the event (e.g. transfer receipt, log entry).'),\n notes: z.string().optional().describe('Free-text context about the event.'),\n })\n .meta({ id: 'CustodyEntry' })\n .describe('A single custody event for an evidence item.');\n\nexport type CustodyEntry = z.infer<typeof CustodyEntrySchema>;\n\nexport const ChainOfCustodyRecordSchema = z\n .object({\n evidenceId: z.string().describe('Identifier of the evidence item this custody history belongs to.'),\n status: ChainOfCustodySchema,\n entries: z.array(CustodyEntrySchema),\n })\n .meta({ id: 'ChainOfCustodyRecord' })\n .describe('The full custody history for a piece of evidence.');\n\nexport type ChainOfCustodyRecord = z.infer<typeof ChainOfCustodyRecordSchema>;\n","import { z } from 'zod';\n\nexport const HashAlgorithmSchema = z\n .enum(['sha256', 'sha512', 'sha1', 'md5'])\n .describe('Cryptographic hash algorithm used to fingerprint a file.');\n\nexport type HashAlgorithm = z.infer<typeof HashAlgorithmSchema>;\n\nexport const FileHashSchema = z\n .object({\n algorithm: HashAlgorithmSchema,\n value: z.string().describe('Hex-encoded hash digest of the file contents.'),\n })\n .meta({ id: 'FileHash' })\n .describe('A content hash of a file.');\n\nexport type FileHash = z.infer<typeof FileHashSchema>;\n\nexport const VerificationMethodSchema = z\n .enum([\n 'metadata_analysis',\n 'forensic_analysis',\n 'hash_verification',\n 'chain_of_custody',\n 'source_confirmation',\n 'expert_review',\n 'ai_analysis',\n 'other',\n ])\n .describe('Method used to verify media authenticity.');\n\nexport type VerificationMethod = z.infer<typeof VerificationMethodSchema>;\n\nexport const VerificationResultSchema = z\n .enum([\n 'authentic',\n 'likely_authentic',\n 'inconclusive',\n 'likely_manipulated',\n 'manipulated',\n 'ai_generated',\n 'deepfake',\n 'composite',\n 'unknown',\n ])\n .describe('Outcome of an authenticity verification.');\n\nexport type VerificationResult = z.infer<typeof VerificationResultSchema>;\n\nexport const ThirdPartyVerificationSchema = z\n .object({\n verifier: z.string().describe('Name of the person who performed the verification.'),\n organization: z.string().optional().describe('Organization the verifier represents.'),\n credentials: z\n .string()\n .optional()\n .describe('Verifier\\u2019s relevant qualifications (e.g. \"certified forensic video analyst\").'),\n date: z.string().describe('When the verification was performed (ISO date).'),\n method: VerificationMethodSchema,\n methodDescription: z.string().optional().describe('Fuller description of how the verification was performed.'),\n result: VerificationResultSchema,\n confidence: z\n .enum(['high', 'medium', 'low'])\n .optional()\n .describe('Verifier\\u2019s confidence in their own result.'),\n findings: z.string().optional().describe('Summary of what the verification found.'),\n reportUrl: z.string().optional().describe('Link to the full verification report.'),\n })\n .meta({ id: 'ThirdPartyVerification' })\n .describe('An independent authenticity assessment of media or a document.');\n\nexport type ThirdPartyVerification = z.infer<typeof ThirdPartyVerificationSchema>;\n\nexport const CaptureMetadataSchema = z\n .object({\n device: z.string().optional().describe('Capture device as recorded in metadata (e.g. \"iPhone 14 Pro\").'),\n manufacturer: z.string().optional().describe('Device manufacturer from metadata.'),\n model: z.string().optional().describe('Device model from metadata.'),\n software: z.string().optional().describe('Software that produced or processed the file.'),\n originalFilename: z.string().optional().describe('Filename as originally captured, before any renaming.'),\n originalCreationDate: z.string().optional().describe('Creation timestamp embedded in the file metadata.'),\n gpsCoordinates: z\n .object({\n latitude: z.number(),\n longitude: z.number(),\n altitude: z.number().optional(),\n })\n .optional()\n .describe('GPS position embedded in the file metadata.'),\n metadataPreserved: z.boolean().optional().describe('Whether the original metadata survives intact.'),\n metadataStripped: z.boolean().optional().describe('Whether metadata was removed at some point.'),\n strippedReason: z\n .string()\n .optional()\n .describe('Why metadata was stripped (e.g. \"platform re-encoding\", \"privacy redaction\").'),\n })\n .meta({ id: 'CaptureMetadata' })\n .describe('Capture/EXIF-style metadata extracted from a media file.');\n\nexport type CaptureMetadata = z.infer<typeof CaptureMetadataSchema>;\n\nexport const DigitalProvenanceSchema = z\n .object({\n hash: FileHashSchema.optional(),\n additionalHashes: z.array(FileHashSchema).optional(),\n captureMetadata: CaptureMetadataSchema.optional(),\n verifications: z.array(ThirdPartyVerificationSchema).optional(),\n provenanceChain: z\n .array(z.string())\n .optional()\n .describe('Ordered hops the file took from capture to here (e.g. \"witness phone → NYT → public release\").'),\n manipulationDetected: z.boolean().optional().describe('Whether any analysis found evidence of manipulation.'),\n manipulationDescription: z.string().optional().describe('What manipulation was found, if any.'),\n authenticityAssessment: VerificationResultSchema.optional(),\n authenticityConfidence: z\n .enum(['high', 'medium', 'low', 'unassessed'])\n .optional()\n .describe('Overall confidence in the authenticity assessment.'),\n lastUpdated: z.string().optional().describe('When this provenance record was last updated (ISO timestamp).'),\n notes: z.string().optional().describe('Free-text context about the provenance trail.'),\n })\n .meta({ id: 'DigitalProvenance' })\n .describe('Digital authenticity trail for media: hashes, capture metadata, and verifications.');\n\nexport type DigitalProvenance = z.infer<typeof DigitalProvenanceSchema>;\n","import { z } from 'zod';\nimport { ChainOfCustodyRecordSchema, ChainOfCustodySchema } from './custody';\nimport { DigitalProvenanceSchema } from './digital';\n\nexport {\n ChainOfCustodySchema,\n CustodyActionSchema,\n CustodyEntrySchema,\n ChainOfCustodyRecordSchema,\n} from './custody';\nexport type {\n ChainOfCustody,\n CustodyAction,\n CustodyEntry,\n ChainOfCustodyRecord,\n} from './custody';\nexport {\n HashAlgorithmSchema,\n FileHashSchema,\n ThirdPartyVerificationSchema,\n VerificationMethodSchema,\n VerificationResultSchema,\n CaptureMetadataSchema,\n DigitalProvenanceSchema,\n} from './digital';\nexport type {\n HashAlgorithm,\n FileHash,\n ThirdPartyVerification,\n VerificationMethod,\n VerificationResult,\n CaptureMetadata,\n DigitalProvenance,\n} from './digital';\n\n/**\n * Payload of the optional `Observation.provenance` slot — the forensic/custody\n * trail for a record: high-level custody status, the full custody chain, and the\n * digital authenticity record. All optional; attach only what applies.\n */\nexport const ProvenanceSchema = z\n .object({\n custodyStatus: ChainOfCustodySchema.optional(),\n custody: ChainOfCustodyRecordSchema.optional(),\n digital: DigitalProvenanceSchema.optional(),\n })\n .meta({ id: 'Provenance' })\n .describe('Forensic provenance for an observation: custody status/chain and digital authenticity.');\n\nexport type Provenance = z.infer<typeof ProvenanceSchema>;\n"]}
|