@disclosureos/records 1.0.0 → 1.1.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.
@@ -1,4 +1,4 @@
1
- export { A as Attribution, a as AttributionSchema, B as Brand, C as Claim, b as ClaimSchema, c as Confidence, d as ConfidenceSchema, E as EVIDENCE_REF_KINDS, e as EvidenceRefKind, O as ObservationId, f as asConfidence, g as asObservationId, h as assertConfidence, i as createEnumGuard, j as evidenceRef, k as isConfidence, l as isEvidenceRef, m as makeGuard, p as parseEvidenceRef } from '../enum-guard-DzPkp2oJ.js';
1
+ export { A as Attribution, a as AttributionSchema, B as Brand, C as Claim, b as ClaimSchema, c as Confidence, d as ConfidenceSchema, E as EVIDENCE_REF_KINDS, e as EvidenceRefKind, O as ObservationId, f as asConfidence, g as asObservationId, h as assertConfidence, i as createEnumGuard, j as evidenceRef, k as isConfidence, l as isEvidenceRef, m as isSensorRef, n as makeGuard, p as parseEvidenceRef, o as parseSensorRef, s as sensorRef } from '../enum-guard-Myp2-SoT.js';
2
2
  export { b as CONFIDENCE_LEVELS, C as ConfidenceLevel, a as ConfidenceLevelSchema, i as isConfidenceLevel } from '../confidence-level-CV3P1W5_.js';
3
3
  export { V as ValidationIssue, i as issuesFrom, v as validateWith } from '../validation-C-_QLXXf.js';
4
4
  import 'zod';
@@ -41,6 +41,20 @@ var ClaimSchema = AttributionSchema.extend({
41
41
  evidenceRefs: z.array(z.string().min(1)).optional().describe('Refs to in-record evidence justifying this claim, e.g. "media:<id>", "sensor:<id>".')
42
42
  }).describe("An attributed, evidence-backed assertion (Attribution + the evidence that justifies it).");
43
43
 
44
+ // src/shared/sensor-ref.ts
45
+ var SENSOR_REF_PATTERN = /^[a-z0-9][a-z0-9-]*:[a-z0-9][a-z0-9-]*$/;
46
+ function sensorRef(orgSlug, sensorId) {
47
+ return `${orgSlug}:${sensorId}`;
48
+ }
49
+ function isSensorRef(value) {
50
+ return typeof value === "string" && SENSOR_REF_PATTERN.test(value);
51
+ }
52
+ function parseSensorRef(value) {
53
+ if (!isSensorRef(value)) return null;
54
+ const idx = value.indexOf(":");
55
+ return { orgSlug: value.slice(0, idx), sensorId: value.slice(idx + 1) };
56
+ }
57
+
44
58
  // src/shared/validation.ts
45
59
  function issuesFrom(error) {
46
60
  return error.issues.map((issue) => ({
@@ -82,6 +96,6 @@ function asObservationId(value) {
82
96
  return value;
83
97
  }
84
98
 
85
- export { AttributionSchema, CONFIDENCE_LEVELS, ClaimSchema, ConfidenceLevelSchema, ConfidenceSchema, EVIDENCE_REF_KINDS, asConfidence, asObservationId, assertConfidence, createEnumGuard, evidenceRef, isConfidence, isConfidenceLevel, isEvidenceRef, issuesFrom, jsonSchemaEnvelope, makeGuard, parseEvidenceRef, schemaId, validateWith };
99
+ export { AttributionSchema, CONFIDENCE_LEVELS, ClaimSchema, ConfidenceLevelSchema, ConfidenceSchema, EVIDENCE_REF_KINDS, asConfidence, asObservationId, assertConfidence, createEnumGuard, evidenceRef, isConfidence, isConfidenceLevel, isEvidenceRef, isSensorRef, issuesFrom, jsonSchemaEnvelope, makeGuard, parseEvidenceRef, parseSensorRef, schemaId, sensorRef, validateWith };
86
100
  //# sourceMappingURL=index.js.map
87
101
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/shared/confidence.ts","../../src/shared/confidence-level.ts","../../src/shared/attribution.ts","../../src/shared/claim.ts","../../src/shared/validation.ts","../../src/shared/json-schema.ts","../../src/shared/enum-guard.ts","../../src/shared/brands.ts"],"names":["z"],"mappings":";;;AAWO,IAAM,gBAAA,GAAmB,CAAA,CAC7B,MAAA,EAAO,CACP,GAAA,CAAI,CAAC,CAAA,CACL,GAAA,CAAI,CAAC,CAAA,CACL,QAAA,CAAS,iCAAiC;AAItC,SAAS,aAAa,KAAA,EAAqC;AAChE,EAAA,OAAO,OAAO,KAAA,KAAU,QAAA,IAAY,KAAA,IAAS,KAAK,KAAA,IAAS,CAAA;AAC7D;A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,OAAO,OAAA,GAAU,EAAC,GAAI,UAAA,CAAW,OAAO,KAAK,CAAA;AACtD;;;ACxBA,IAAM,iBAAA,GAAoB,8CAAA;AAC1B,IAAM,WAAA,GAAc,kCAAA;AAGb,SAAS,QAAA,CAAS,MAAA,EAAgB,IAAA,EAAc,OAAA,EAAyB;AAC9E,EAAA,OAAO,GAAG,WAAW,CAAA,CAAA,EAAI,MAAM,CAAA,CAAA,EAAI,OAAO,IAAI,IAAI,CAAA,KAAA,CAAA;AACpD;AAMO,SAAS,kBAAA,CACd,MACA,IAAA,EACyB;AACzB,EAAA,OAAO;AAAA,IACL,OAAA,EAAS,iBAAA;AAAA,IACT,KAAK,IAAA,CAAK,EAAA;AAAA,IACV,oBAAoB,IAAA,CAAK,OAAA;AAAA,IACzB,GAAG;AAAA,GACL;AACF;;;AC7BO,SAAS,gBAAkC,MAAA,EAAsB;AACtE,EAAA,MAAM,GAAA,GAAM,IAAI,GAAA,CAAY,MAAM,CAAA;AAClC,EAAA,OAAO,CAAC,KAAA,KAA+B,OAAO,UAAU,QAAA,IAAY,GAAA,CAAI,IAAI,KAAK,CAAA;AACnF;AASO,SAAS,UAAa,MAAA,EAAoB;AAC/C,EAAA,OAAO,CAAC,KAAA,KAA+B,MAAA,CAAO,SAAA,CAAU,KAAK,CAAA,CAAE,OAAA;AACjE;;;ACNO,SAAS,gBAAgB,KAAA,EAA8B;AAC5D,EAAA,OAAO,KAAA;AACT","file":"index.js","sourcesContent":["import { z } from 'zod';\nimport type { Brand } from './brands';\n\n/**\n * The single continuous confidence primitive for the whole ecosystem.\n * A normalized probability in [0,1]. Plain number in the schema (serializable);\n * the branded {@link Confidence} alias is the TS-only ergonomic layer.\n *\n * Replaces the independently-defined `confidence: number` + ad-hoc validators\n * in `@disclosureos/observables` and `@disclosureos/origins`.\n */\nexport const ConfidenceSchema = z\n .number()\n .min(0)\n .max(1)\n .describe('Normalized confidence in [0,1].');\n\nexport type Confidence = Brand<number, 'Confidence'>;\n\nexport function isConfidence(value: unknown): value is Confidence {\n return typeof value === 'number' && value >= 0 && value <= 1;\n}\n\nexport function assertConfidence(value: number, label = 'confidence'): asserts value is Confidence {\n if (!(value >= 0 && value <= 1)) {\n throw new RangeError(`${label} must be between 0 and 1, got ${value}`);\n }\n}\n\nexport function asConfidence(value: number, label = 'confidence'): Confidence {\n assertConfidence(value, label);\n return value as Confidence;\n}\n","import { z } from 'zod';\n\n/**\n * The single qualitative confidence magnitude for the ecosystem.\n * Merges the former `ConfidenceLevel` (investigation) and `CredibilityRating`\n * (testimony) — which were byte-identical — plus the inline high/medium/low\n * scales in `provenance/digital`.\n *\n * Distinct from `SourceCredibility` (trust tier), `TemporalCertainty` (time\n * precision), and `AssessmentLevel` (evidentiary tier) — those are the other\n * three orthogonal axes and are intentionally NOT merged here.\n */\nexport const ConfidenceLevelSchema = z\n .enum(['very_high', 'high', 'moderate', 'low', 'very_low', 'unassessed'])\n .describe('Qualitative confidence magnitude.');\n\nexport type ConfidenceLevel = z.infer<typeof ConfidenceLevelSchema>;\n\nexport const CONFIDENCE_LEVELS = ConfidenceLevelSchema.options;\n\nexport function isConfidenceLevel(value: unknown): value is ConfidenceLevel {\n return ConfidenceLevelSchema.safeParse(value).success;\n}\n","import { z } from 'zod';\n\n/**\n * Shared \"who evaluated this, when, and why\" mixin.\n *\n * Replaces the divergent metadata that observables (`assessedAt`/`assessedBy`/\n * `notes`) and origins (`assignedAt`/`assignedBy`/`reasoning`) each invented.\n * Any human/agent judgement surface composes these fields rather than\n * re-declaring its own.\n */\nexport const AttributionSchema = z\n .object({\n evaluatedAt: z.iso\n .datetime()\n .optional()\n .describe('When this judgement was made (ISO 8601 datetime).'),\n evaluatedBy: z\n .string()\n .optional()\n .describe('Who made this judgement — a person, agency, or agent identifier.'),\n rationale: z\n .string()\n .optional()\n .describe(\"Why this judgement was reached — the evaluator's stated reasoning.\"),\n })\n .describe('Who evaluated this, when, and why.');\n\nexport type Attribution = z.infer<typeof AttributionSchema>;\n","import { z } from 'zod';\nimport { AttributionSchema } from './attribution';\n\n/**\n * Kinds of in-record evidence an `evidenceRef` can point at. Each maps to a\n * collection on the `Observation`:\n * - `media` → `Observation.media[].id` / `featuredMedia.id`\n * - `sensor` → `Observation.sensorEvidence.sensors[].id`\n * - `physical` → `Observation.physicalEvidence[].id` (extension slot)\n * - `testimony` → `Observation.testimony[].statementId` (extension slot)\n */\nexport const EVIDENCE_REF_KINDS = ['media', 'sensor', 'physical', 'testimony'] as const;\nexport type EvidenceRefKind = (typeof EVIDENCE_REF_KINDS)[number];\n\nconst EVIDENCE_REF_PATTERN = new RegExp(`^(${EVIDENCE_REF_KINDS.join('|')}):.+$`);\n\n/**\n * Build a typed evidence reference string, e.g. `evidenceRef('media', 'm1')`\n * → `\"media:m1\"`. Keep refs as plain strings in the schema so they remain\n * portable to JSON Schema; the `<kind>:<id>` convention is enforced by\n * {@link isEvidenceRef} and produced by this helper.\n */\nexport function evidenceRef(kind: EvidenceRefKind, id: string): string {\n return `${kind}:${id}`;\n}\n\n/** True if `value` matches the `<kind>:<id>` evidence-ref convention. */\nexport function isEvidenceRef(value: unknown): value is string {\n return typeof value === 'string' && EVIDENCE_REF_PATTERN.test(value);\n}\n\n/** Split an evidence ref into its `{ kind, id }` parts, or `null` if malformed. */\nexport function parseEvidenceRef(value: string): { kind: EvidenceRefKind; id: string } | null {\n if (!isEvidenceRef(value)) return null;\n const idx = value.indexOf(':');\n return { kind: value.slice(0, idx) as EvidenceRefKind, id: value.slice(idx + 1) };\n}\n\n/**\n * A `Claim` is the teachable unit of judgement in DisclosureOS: an\n * {@link AttributionSchema | Attribution} (who evaluated this, when, why) plus\n * the in-record evidence that justifies it. Every evaluative slot\n * (`observableAssessments`, `origin`) is a *list* of claims so the framework can\n * represent the contested verdicts that define UAP data. Opinion/endorsement\n * lives in the scoring layer, never here.\n */\nexport const ClaimSchema = AttributionSchema.extend({\n evidenceRefs: z\n .array(z.string().min(1))\n .optional()\n .describe('Refs to in-record evidence justifying this claim, e.g. \"media:<id>\", \"sensor:<id>\".'),\n}).describe('An attributed, evidence-backed assertion (Attribution + the evidence that justifies it).');\n\nexport type Claim = z.infer<typeof ClaimSchema>;\n","import type { ZodError } from 'zod';\n\n/**\n * A single, flat validation problem. Shared by the hand-rolled\n * `validateObservation` and the schema-driven path so every package speaks one\n * issue shape (`{ path, message }`).\n */\nexport interface ValidationIssue {\n path: string;\n message: string;\n}\n\n/**\n * Map a `ZodError` into the ecosystem's flat issue shape. Lets schema-based\n * validation and the legacy hand-rolled validator return identical structures.\n */\nexport function issuesFrom(error: ZodError): ValidationIssue[] {\n return error.issues.map((issue) => ({\n path: issue.path.map((segment) => String(segment)).join('.'),\n message: issue.message,\n }));\n}\n\n/**\n * Validate a value against any Zod schema and return the flat issue list (empty\n * when valid) — the ecosystem's single validation contract, so the per-package\n * `validateX` functions don't each re-write `safeParse` + `issuesFrom`.\n *\n * Typed STRUCTURALLY (just needs `.safeParse`) so it stays free of Zod's\n * cross-package version brand when called from `observables`/`origins`.\n */\nexport function validateWith(\n schema: { safeParse(value: unknown): { success: true } | { success: false; error: ZodError } },\n value: unknown,\n): ValidationIssue[] {\n const result = schema.safeParse(value);\n return result.success ? [] : issuesFrom(result.error);\n}\n","/**\n * Shared JSON-Schema emission helpers.\n *\n * Every DisclosureOS package emits a committed, versioned JSON Schema artifact\n * wrapped in the same draft + `$id` + version envelope. These helpers own that\n * envelope so the four `schema.ts` files don't each copy it.\n *\n * They take/return PLAIN DATA only (objects + strings) — never a Zod schema —\n * so they stay free of Zod's cross-package version brand. The\n * `z.toJSONSchema(..., { target: 'draft-2020-12' })` call stays inside each\n * package, operating on its own Zod instance.\n */\n\nconst JSON_SCHEMA_DRAFT = 'https://json-schema.org/draft/2020-12/schema' as const;\nconst SCHEMA_HOST = 'https://os.disclosure.org/schema' as const;\n\n/** Build the canonical, versioned `$id` URL for a DisclosureOS schema artifact. */\nexport function schemaId(domain: string, file: string, version: string): string {\n return `${SCHEMA_HOST}/${domain}/${version}/${file}.json`;\n}\n\n/**\n * Wrap an emitted JSON-Schema body in the standard draft + `$id` + version\n * envelope. `body` is the output of `z.toJSONSchema(...)`.\n */\nexport function jsonSchemaEnvelope(\n body: Record<string, unknown>,\n meta: { id: string; version: string },\n): Record<string, unknown> {\n return {\n $schema: JSON_SCHEMA_DRAFT,\n $id: meta.id,\n 'x-schema-version': meta.version,\n ...body,\n };\n}\n","/**\n * One canonical enum-guard factory for the whole ecosystem.\n *\n * Replaces the three byte-identical private copies that lived in\n * `records/guards`, `observables/guards`, and `origins/guards`.\n */\nexport function createEnumGuard<T extends string>(values: readonly T[]) {\n const set = new Set<string>(values);\n return (value: unknown): value is T => typeof value === 'string' && set.has(value);\n}\n\nimport type { ZodType } from 'zod';\n\n/**\n * Schema-derived type guard. Replaces hand-maintained `createEnumGuard(ARRAY)`\n * calls once a Zod schema is the source of truth — `makeGuard(XSchema)` narrows\n * to the schema's inferred type with no parallel value array to drift.\n */\nexport function makeGuard<T>(schema: ZodType<T>) {\n return (value: unknown): value is T => schema.safeParse(value).success;\n}\n","/**\n * Nominal \"branded\" types — TS-only ergonomics that never touch the emitted\n * JSON Schema (Phase 0 confirmed brands are safe but we keep them out of the\n * schema layer for composition clarity). A branded value is the base type at\n * runtime; the brand only constrains assignment at compile time.\n */\n\ndeclare const __brand: unique symbol;\n\nexport type Brand<T, B extends string> = T & { readonly [__brand]: B };\n\n/** Validated UUID/identifier for an `Observation`. */\nexport type ObservationId = Brand<string, 'ObservationId'>;\n\nexport function asObservationId(value: string): ObservationId {\n return value as ObservationId;\n}\n"]}
1
+ {"version":3,"sources":["../../src/shared/confidence.ts","../../src/shared/confidence-level.ts","../../src/shared/attribution.ts","../../src/shared/claim.ts","../../src/shared/sensor-ref.ts","../../src/shared/validation.ts","../../src/shared/json-schema.ts","../../src/shared/enum-guard.ts","../../src/shared/brands.ts"],"names":["z"],"mappings":";;;AAWO,IAAM,gBAAA,GAAmB,CAAA,CAC7B,MAAA,EAAO,CACP,GAAA,C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,CAAK,EAAA;AAAA,IACV,oBAAoB,IAAA,CAAK,OAAA;AAAA,IACzB,GAAG;AAAA,GACL;AACF;;;AC7BO,SAAS,gBAAkC,MAAA,EAAsB;AACtE,EAAA,MAAM,GAAA,GAAM,IAAI,GAAA,CAAY,MAAM,CAAA;AAClC,EAAA,OAAO,CAAC,KAAA,KAA+B,OAAO,UAAU,QAAA,IAAY,GAAA,CAAI,IAAI,KAAK,CAAA;AACnF;AASO,SAAS,UAAa,MAAA,EAAoB;AAC/C,EAAA,OAAO,CAAC,KAAA,KAA+B,MAAA,CAAO,SAAA,CAAU,KAAK,CAAA,CAAE,OAAA;AACjE;;;ACNO,SAAS,gBAAgB,KAAA,EAA8B;AAC5D,EAAA,OAAO,KAAA;AACT","file":"index.js","sourcesContent":["import { z } from 'zod';\nimport type { Brand } from './brands';\n\n/**\n * The single continuous confidence primitive for the whole ecosystem.\n * A normalized probability in [0,1]. Plain number in the schema (serializable);\n * the branded {@link Confidence} alias is the TS-only ergonomic layer.\n *\n * Replaces the independently-defined `confidence: number` + ad-hoc validators\n * in `@disclosureos/observables` and `@disclosureos/origins`.\n */\nexport const ConfidenceSchema = z\n .number()\n .min(0)\n .max(1)\n .describe('Normalized confidence in [0,1].');\n\nexport type Confidence = Brand<number, 'Confidence'>;\n\nexport function isConfidence(value: unknown): value is Confidence {\n return typeof value === 'number' && value >= 0 && value <= 1;\n}\n\nexport function assertConfidence(value: number, label = 'confidence'): asserts value is Confidence {\n if (!(value >= 0 && value <= 1)) {\n throw new RangeError(`${label} must be between 0 and 1, got ${value}`);\n }\n}\n\nexport function asConfidence(value: number, label = 'confidence'): Confidence {\n assertConfidence(value, label);\n return value as Confidence;\n}\n","import { z } from 'zod';\n\n/**\n * The single qualitative confidence magnitude for the ecosystem.\n * Merges the former `ConfidenceLevel` (investigation) and `CredibilityRating`\n * (testimony) — which were byte-identical — plus the inline high/medium/low\n * scales in `provenance/digital`.\n *\n * Distinct from `SourceCredibility` (trust tier), `TemporalCertainty` (time\n * precision), and `AssessmentLevel` (evidentiary tier) — those are the other\n * three orthogonal axes and are intentionally NOT merged here.\n */\nexport const ConfidenceLevelSchema = z\n .enum(['very_high', 'high', 'moderate', 'low', 'very_low', 'unassessed'])\n .describe('Qualitative confidence magnitude.');\n\nexport type ConfidenceLevel = z.infer<typeof ConfidenceLevelSchema>;\n\nexport const CONFIDENCE_LEVELS = ConfidenceLevelSchema.options;\n\nexport function isConfidenceLevel(value: unknown): value is ConfidenceLevel {\n return ConfidenceLevelSchema.safeParse(value).success;\n}\n","import { z } from 'zod';\n\n/**\n * Shared \"who evaluated this, when, and why\" mixin.\n *\n * Replaces the divergent metadata that observables (`assessedAt`/`assessedBy`/\n * `notes`) and origins (`assignedAt`/`assignedBy`/`reasoning`) each invented.\n * Any human/agent judgement surface composes these fields rather than\n * re-declaring its own.\n */\nexport const AttributionSchema = z\n .object({\n evaluatedAt: z.iso\n .datetime()\n .optional()\n .describe('When this judgement was made (ISO 8601 datetime).'),\n evaluatedBy: z\n .string()\n .optional()\n .describe('Who made this judgement — a person, agency, or agent identifier.'),\n rationale: z\n .string()\n .optional()\n .describe(\"Why this judgement was reached — the evaluator's stated reasoning.\"),\n })\n .describe('Who evaluated this, when, and why.');\n\nexport type Attribution = z.infer<typeof AttributionSchema>;\n","import { z } from 'zod';\nimport { AttributionSchema } from './attribution';\n\n/**\n * Kinds of in-record evidence an `evidenceRef` can point at. Each maps to a\n * collection on the `Observation`:\n * - `media` → `Observation.media[].id` / `featuredMedia.id`\n * - `sensor` → `Observation.sensorEvidence.sensors[].id`\n * - `physical` → `Observation.physicalEvidence[].id` (extension slot)\n * - `testimony` → `Observation.testimony[].statementId` (extension slot)\n */\nexport const EVIDENCE_REF_KINDS = ['media', 'sensor', 'physical', 'testimony'] as const;\nexport type EvidenceRefKind = (typeof EVIDENCE_REF_KINDS)[number];\n\nconst EVIDENCE_REF_PATTERN = new RegExp(`^(${EVIDENCE_REF_KINDS.join('|')}):.+$`);\n\n/**\n * Build a typed evidence reference string, e.g. `evidenceRef('media', 'm1')`\n * → `\"media:m1\"`. Keep refs as plain strings in the schema so they remain\n * portable to JSON Schema; the `<kind>:<id>` convention is enforced by\n * {@link isEvidenceRef} and produced by this helper.\n */\nexport function evidenceRef(kind: EvidenceRefKind, id: string): string {\n return `${kind}:${id}`;\n}\n\n/** True if `value` matches the `<kind>:<id>` evidence-ref convention. */\nexport function isEvidenceRef(value: unknown): value is string {\n return typeof value === 'string' && EVIDENCE_REF_PATTERN.test(value);\n}\n\n/** Split an evidence ref into its `{ kind, id }` parts, or `null` if malformed. */\nexport function parseEvidenceRef(value: string): { kind: EvidenceRefKind; id: string } | null {\n if (!isEvidenceRef(value)) return null;\n const idx = value.indexOf(':');\n return { kind: value.slice(0, idx) as EvidenceRefKind, id: value.slice(idx + 1) };\n}\n\n/**\n * A `Claim` is the teachable unit of judgement in DisclosureOS: an\n * {@link AttributionSchema | Attribution} (who evaluated this, when, why) plus\n * the in-record evidence that justifies it. Every evaluative slot\n * (`observableAssessments`, `origin`) is a *list* of claims so the framework can\n * represent the contested verdicts that define UAP data. Opinion/endorsement\n * lives in the scoring layer, never here.\n */\nexport const ClaimSchema = AttributionSchema.extend({\n evidenceRefs: z\n .array(z.string().min(1))\n .optional()\n .describe('Refs to in-record evidence justifying this claim, e.g. \"media:<id>\", \"sensor:<id>\".'),\n}).describe('An attributed, evidence-backed assertion (Attribution + the evidence that justifies it).');\n\nexport type Claim = z.infer<typeof ClaimSchema>;\n","/**\n * Sensor references link a `SensorReading` to a published sensor-manifest entry\n * (`@disclosureos/instruments`): `\"<org-slug>:<sensor-id>\"`, e.g.\n * `\"eldaeon:dionysus-passive-radar\"`. Refs stay plain strings in the schema so\n * they remain portable to JSON Schema; the convention is enforced by\n * {@link isSensorRef} and produced by {@link sensorRef} — the same pattern as\n * `Claim.evidenceRefs`.\n *\n * Unlike an `evidenceRef` (which points *inward* at evidence carried by the\n * observation), a sensor ref points *outward* at an instrument catalog another\n * organization publishes.\n */\n\nconst SENSOR_REF_PATTERN = /^[a-z0-9][a-z0-9-]*:[a-z0-9][a-z0-9-]*$/;\n\n/** Build a sensor reference string, e.g. `sensorRef('eldaeon', 'dionysus-passive-radar')`. */\nexport function sensorRef(orgSlug: string, sensorId: string): string {\n return `${orgSlug}:${sensorId}`;\n}\n\n/** True if `value` matches the `<org-slug>:<sensor-id>` sensor-ref convention. */\nexport function isSensorRef(value: unknown): value is string {\n return typeof value === 'string' && SENSOR_REF_PATTERN.test(value);\n}\n\n/** Split a sensor ref into its `{ orgSlug, sensorId }` parts, or `null` if malformed. */\nexport function parseSensorRef(value: string): { orgSlug: string; sensorId: string } | null {\n if (!isSensorRef(value)) return null;\n const idx = value.indexOf(':');\n return { orgSlug: value.slice(0, idx), sensorId: value.slice(idx + 1) };\n}\n","import type { ZodError } from 'zod';\n\n/**\n * A single, flat validation problem. Shared by the hand-rolled\n * `validateObservation` and the schema-driven path so every package speaks one\n * issue shape (`{ path, message }`).\n */\nexport interface ValidationIssue {\n path: string;\n message: string;\n}\n\n/**\n * Map a `ZodError` into the ecosystem's flat issue shape. Lets schema-based\n * validation and the legacy hand-rolled validator return identical structures.\n */\nexport function issuesFrom(error: ZodError): ValidationIssue[] {\n return error.issues.map((issue) => ({\n path: issue.path.map((segment) => String(segment)).join('.'),\n message: issue.message,\n }));\n}\n\n/**\n * Validate a value against any Zod schema and return the flat issue list (empty\n * when valid) — the ecosystem's single validation contract, so the per-package\n * `validateX` functions don't each re-write `safeParse` + `issuesFrom`.\n *\n * Typed STRUCTURALLY (just needs `.safeParse`) so it stays free of Zod's\n * cross-package version brand when called from `observables`/`origins`.\n */\nexport function validateWith(\n schema: { safeParse(value: unknown): { success: true } | { success: false; error: ZodError } },\n value: unknown,\n): ValidationIssue[] {\n const result = schema.safeParse(value);\n return result.success ? [] : issuesFrom(result.error);\n}\n","/**\n * Shared JSON-Schema emission helpers.\n *\n * Every DisclosureOS package emits a committed, versioned JSON Schema artifact\n * wrapped in the same draft + `$id` + version envelope. These helpers own that\n * envelope so the four `schema.ts` files don't each copy it.\n *\n * They take/return PLAIN DATA only (objects + strings) — never a Zod schema —\n * so they stay free of Zod's cross-package version brand. The\n * `z.toJSONSchema(..., { target: 'draft-2020-12' })` call stays inside each\n * package, operating on its own Zod instance.\n */\n\nconst JSON_SCHEMA_DRAFT = 'https://json-schema.org/draft/2020-12/schema' as const;\nconst SCHEMA_HOST = 'https://os.disclosure.org/schema' as const;\n\n/** Build the canonical, versioned `$id` URL for a DisclosureOS schema artifact. */\nexport function schemaId(domain: string, file: string, version: string): string {\n return `${SCHEMA_HOST}/${domain}/${version}/${file}.json`;\n}\n\n/**\n * Wrap an emitted JSON-Schema body in the standard draft + `$id` + version\n * envelope. `body` is the output of `z.toJSONSchema(...)`.\n */\nexport function jsonSchemaEnvelope(\n body: Record<string, unknown>,\n meta: { id: string; version: string },\n): Record<string, unknown> {\n return {\n $schema: JSON_SCHEMA_DRAFT,\n $id: meta.id,\n 'x-schema-version': meta.version,\n ...body,\n };\n}\n","/**\n * One canonical enum-guard factory for the whole ecosystem.\n *\n * Replaces the three byte-identical private copies that lived in\n * `records/guards`, `observables/guards`, and `origins/guards`.\n */\nexport function createEnumGuard<T extends string>(values: readonly T[]) {\n const set = new Set<string>(values);\n return (value: unknown): value is T => typeof value === 'string' && set.has(value);\n}\n\nimport type { ZodType } from 'zod';\n\n/**\n * Schema-derived type guard. Replaces hand-maintained `createEnumGuard(ARRAY)`\n * calls once a Zod schema is the source of truth — `makeGuard(XSchema)` narrows\n * to the schema's inferred type with no parallel value array to drift.\n */\nexport function makeGuard<T>(schema: ZodType<T>) {\n return (value: unknown): value is T => schema.safeParse(value).success;\n}\n","/**\n * Nominal \"branded\" types — TS-only ergonomics that never touch the emitted\n * JSON Schema (Phase 0 confirmed brands are safe but we keep them out of the\n * schema layer for composition clarity). A branded value is the base type at\n * runtime; the brand only constrains assignment at compile time.\n */\n\ndeclare const __brand: unique symbol;\n\nexport type Brand<T, B extends string> = T & { readonly [__brand]: B };\n\n/** Validated UUID/identifier for an `Observation`. */\nexport type ObservationId = Brand<string, 'ObservationId'>;\n\nexport function asObservationId(value: string): ObservationId {\n return value as ObservationId;\n}\n"]}
@@ -23,6 +23,13 @@ declare const DetectionMethodSchema: z.ZodEnum<{
23
23
  lidar: "lidar";
24
24
  spectroscopic: "spectroscopic";
25
25
  radio_frequency: "radio_frequency";
26
+ particle: "particle";
27
+ gnss: "gnss";
28
+ time_reference: "time_reference";
29
+ chemical: "chemical";
30
+ inertial: "inertial";
31
+ physiological: "physiological";
32
+ pressure: "pressure";
26
33
  multiple: "multiple";
27
34
  }>;
28
35
  type DetectionMethod = z.infer<typeof DetectionMethodSchema>;
@@ -43,6 +50,24 @@ declare const SensorTypeSchema: z.ZodEnum<{
43
50
  security_camera: "security_camera";
44
51
  dashcam: "dashcam";
45
52
  phone_camera: "phone_camera";
53
+ infrasonic_sensor: "infrasonic_sensor";
54
+ ultrasonic_sensor: "ultrasonic_sensor";
55
+ adsb_receiver: "adsb_receiver";
56
+ rf_spectrum_analyzer: "rf_spectrum_analyzer";
57
+ passive_radar: "passive_radar";
58
+ particle_detector: "particle_detector";
59
+ atomic_clock: "atomic_clock";
60
+ gnss_receiver: "gnss_receiver";
61
+ fluxgate_magnetometer: "fluxgate_magnetometer";
62
+ air_quality_sensor: "air_quality_sensor";
63
+ barometer: "barometer";
64
+ lightning_detector: "lightning_detector";
65
+ imu: "imu";
66
+ eeg: "eeg";
67
+ gsr: "gsr";
68
+ pulse_oximeter: "pulse_oximeter";
69
+ pupillometer: "pupillometer";
70
+ hardware_rng: "hardware_rng";
46
71
  }>;
47
72
  type SensorType = z.infer<typeof SensorTypeSchema>;
48
73
  declare const SensorReadingSchema: z.ZodObject<{
@@ -64,6 +89,24 @@ declare const SensorReadingSchema: z.ZodObject<{
64
89
  security_camera: "security_camera";
65
90
  dashcam: "dashcam";
66
91
  phone_camera: "phone_camera";
92
+ infrasonic_sensor: "infrasonic_sensor";
93
+ ultrasonic_sensor: "ultrasonic_sensor";
94
+ adsb_receiver: "adsb_receiver";
95
+ rf_spectrum_analyzer: "rf_spectrum_analyzer";
96
+ passive_radar: "passive_radar";
97
+ particle_detector: "particle_detector";
98
+ atomic_clock: "atomic_clock";
99
+ gnss_receiver: "gnss_receiver";
100
+ fluxgate_magnetometer: "fluxgate_magnetometer";
101
+ air_quality_sensor: "air_quality_sensor";
102
+ barometer: "barometer";
103
+ lightning_detector: "lightning_detector";
104
+ imu: "imu";
105
+ eeg: "eeg";
106
+ gsr: "gsr";
107
+ pulse_oximeter: "pulse_oximeter";
108
+ pupillometer: "pupillometer";
109
+ hardware_rng: "hardware_rng";
67
110
  }>;
68
111
  detectionMethod: z.ZodEnum<{
69
112
  unknown: "unknown";
@@ -88,8 +131,16 @@ declare const SensorReadingSchema: z.ZodObject<{
88
131
  lidar: "lidar";
89
132
  spectroscopic: "spectroscopic";
90
133
  radio_frequency: "radio_frequency";
134
+ particle: "particle";
135
+ gnss: "gnss";
136
+ time_reference: "time_reference";
137
+ chemical: "chemical";
138
+ inertial: "inertial";
139
+ physiological: "physiological";
140
+ pressure: "pressure";
91
141
  multiple: "multiple";
92
142
  }>;
143
+ sensorRef: z.ZodOptional<z.ZodString>;
93
144
  platform: z.ZodOptional<z.ZodString>;
94
145
  operator: z.ZodOptional<z.ZodString>;
95
146
  timestamp: z.ZodOptional<z.ZodString>;
@@ -120,6 +171,24 @@ declare const SensorEvidenceDataSchema: z.ZodObject<{
120
171
  security_camera: "security_camera";
121
172
  dashcam: "dashcam";
122
173
  phone_camera: "phone_camera";
174
+ infrasonic_sensor: "infrasonic_sensor";
175
+ ultrasonic_sensor: "ultrasonic_sensor";
176
+ adsb_receiver: "adsb_receiver";
177
+ rf_spectrum_analyzer: "rf_spectrum_analyzer";
178
+ passive_radar: "passive_radar";
179
+ particle_detector: "particle_detector";
180
+ atomic_clock: "atomic_clock";
181
+ gnss_receiver: "gnss_receiver";
182
+ fluxgate_magnetometer: "fluxgate_magnetometer";
183
+ air_quality_sensor: "air_quality_sensor";
184
+ barometer: "barometer";
185
+ lightning_detector: "lightning_detector";
186
+ imu: "imu";
187
+ eeg: "eeg";
188
+ gsr: "gsr";
189
+ pulse_oximeter: "pulse_oximeter";
190
+ pupillometer: "pupillometer";
191
+ hardware_rng: "hardware_rng";
123
192
  }>;
124
193
  detectionMethod: z.ZodEnum<{
125
194
  unknown: "unknown";
@@ -144,8 +213,16 @@ declare const SensorEvidenceDataSchema: z.ZodObject<{
144
213
  lidar: "lidar";
145
214
  spectroscopic: "spectroscopic";
146
215
  radio_frequency: "radio_frequency";
216
+ particle: "particle";
217
+ gnss: "gnss";
218
+ time_reference: "time_reference";
219
+ chemical: "chemical";
220
+ inertial: "inertial";
221
+ physiological: "physiological";
222
+ pressure: "pressure";
147
223
  multiple: "multiple";
148
224
  }>;
225
+ sensorRef: z.ZodOptional<z.ZodString>;
149
226
  platform: z.ZodOptional<z.ZodString>;
150
227
  operator: z.ZodOptional<z.ZodString>;
151
228
  timestamp: z.ZodOptional<z.ZodString>;
@@ -22,6 +22,13 @@ var DetectionMethodSchema = z.enum([
22
22
  "lidar",
23
23
  "spectroscopic",
24
24
  "radio_frequency",
25
+ "particle",
26
+ "gnss",
27
+ "time_reference",
28
+ "chemical",
29
+ "inertial",
30
+ "physiological",
31
+ "pressure",
25
32
  "multiple",
26
33
  "other",
27
34
  "unknown"
@@ -42,12 +49,33 @@ var SensorTypeSchema = z.enum([
42
49
  "security_camera",
43
50
  "dashcam",
44
51
  "phone_camera",
52
+ "infrasonic_sensor",
53
+ "ultrasonic_sensor",
54
+ "adsb_receiver",
55
+ "rf_spectrum_analyzer",
56
+ "passive_radar",
57
+ "particle_detector",
58
+ "atomic_clock",
59
+ "gnss_receiver",
60
+ "fluxgate_magnetometer",
61
+ "air_quality_sensor",
62
+ "barometer",
63
+ "lightning_detector",
64
+ "imu",
65
+ "eeg",
66
+ "gsr",
67
+ "pulse_oximeter",
68
+ "pupillometer",
69
+ "hardware_rng",
45
70
  "other"
46
71
  ]).describe("Class of sensor that produced a reading.");
47
72
  var SensorReadingSchema = z.object({
48
73
  id: z.string().min(1).describe('Stable id, addressable by a claim `evidenceRef` ("sensor:<id>").'),
49
74
  sensorType: SensorTypeSchema,
50
75
  detectionMethod: DetectionMethodSchema,
76
+ sensorRef: z.string().optional().describe(
77
+ 'Reference to a published sensor-manifest entry ("<org-slug>:<sensor-id>", e.g. "eldaeon:dionysus-passive-radar") carrying the instrument\u2019s full spec, timing, and calibration provenance.'
78
+ ),
51
79
  platform: z.string().optional().describe('Platform carrying the sensor (e.g. "USS Princeton", "F/A-18F").'),
52
80
  operator: z.string().optional().describe("Person or unit operating the sensor."),
53
81
  timestamp: z.string().optional().describe("When the reading was recorded (ISO timestamp)."),
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/source/sensor/types.ts"],"names":[],"mappings":";;;AAEO,IAAM,qBAAA,GAAwB,EAClC,IAAA,CAAK;AAAA,EACJ,eAAA;AAAA,EACA,iBAAA;AAAA,EACA,eAAA;AAAA,EACA,oBAAA;AAAA,EACA,eAAA;AAAA,EACA,gBAAA;AAAA,EACA,iBAAA;AAAA,EACA,eAAA;AAAA,EACA,mBAAA;AAAA,EACA,cAAA;AAAA,EACA,eAAA;AAAA,EACA,iBAAA;AAAA,EACA,oBAAA;AAAA,EACA,cAAA;AAAA,EACA,YAAA;AAAA,EACA,UAAA;AAAA,EACA,SAAA;AAAA,EACA,OAAA;AAAA,EACA,eAAA;AAAA,EACA,iBAAA;AAAA,EACA,UAAA;AAAA,EACA,OAAA;AAAA,EACA;AACF,CAAC,CAAA,CACA,SAAS,mCAAmC;AAIxC,IAAM,gBAAA,GAAmB,EAC7B,IAAA,CAAK;AAAA,EACJ,gBAAA;AAAA,EACA,gBAAA;AAAA,EACA,gBAAA;AAAA,EACA,iBAAA;AAAA,EACA,cAAA;AAAA,EACA,MAAA;AAAA,EACA,WAAA;AAAA,EACA,WAAA;AAAA,EACA,OAAA;AAAA,EACA,wBA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BAAmB,CAAA;AAAA,EACpC,wBAAwB,CAAA,CACrB,OAAA,GACA,QAAA,EAAS,CACT,SAAS,2DAA2D,CAAA;AAAA,EACvE,mBAAA,EAAqB,CAAA,CAClB,IAAA,CAAK,CAAC,aAAa,UAAA,EAAY,WAAA,EAAa,YAAA,EAAc,SAAS,CAAC,CAAA,CACpE,QAAA,EAAS,CACT,SAAS,+CAA+C,CAAA;AAAA,EAC3D,SAAA,EAAW,CAAA,CACR,KAAA,CAAM,CAAA,CAAE,MAAA,EAAQ,CAAA,CAChB,QAAA,EAAS,CACT,QAAA,CAAS,qFAAqF;AACnG,CAAC,CAAA,CACA,KAAK,EAAE,EAAA,EAAI,sBAAsB,CAAA,CACjC,SAAS,0EAA0E","file":"index.js","sourcesContent":["import { z } from 'zod';\n\nexport const DetectionMethodSchema = z\n .enum([\n 'radar_primary',\n 'radar_secondary',\n 'radar_doppler',\n 'radar_phased_array',\n 'infrared_flir',\n 'infrared_other',\n 'electro_optical',\n 'visual_camera',\n 'satellite_imagery',\n 'sonar_active',\n 'sonar_passive',\n 'electromagnetic',\n 'radiation_detector',\n 'magnetometer',\n 'gravimeter',\n 'acoustic',\n 'seismic',\n 'lidar',\n 'spectroscopic',\n 'radio_frequency',\n 'multiple',\n 'other',\n 'unknown',\n ])\n .describe('How a sensor detected the object.');\n\nexport type DetectionMethod = z.infer<typeof DetectionMethodSchema>;\n\nexport const SensorTypeSchema = z\n .enum([\n 'military_radar',\n 'civilian_radar',\n 'airborne_radar',\n 'shipborne_radar',\n 'ground_radar',\n 'flir',\n 'eo_sensor',\n 'satellite',\n 'sonar',\n 'electromagnetic_sensor',\n 'radiation_sensor',\n 'civilian_camera',\n 'security_camera',\n 'dashcam',\n 'phone_camera',\n 'other',\n ])\n .describe('Class of sensor that produced a reading.');\n\nexport type SensorType = z.infer<typeof SensorTypeSchema>;\n\nexport const SensorReadingSchema = z\n .object({\n id: z.string().min(1).describe('Stable id, addressable by a claim `evidenceRef` (\"sensor:<id>\").'),\n sensorType: SensorTypeSchema,\n detectionMethod: DetectionMethodSchema,\n platform: z\n .string()\n .optional()\n .describe('Platform carrying the sensor (e.g. \"USS Princeton\", \"F/A-18F\").'),\n operator: z.string().optional().describe('Person or unit operating the sensor.'),\n timestamp: z.string().optional().describe('When the reading was recorded (ISO timestamp).'),\n duration: z.number().optional().describe('How long the sensor held contact, in seconds.'),\n rawDataAvailable: z.boolean().optional().describe('Whether the raw sensor data still exists and is obtainable.'),\n calibrated: z.boolean().optional().describe('Whether the sensor was calibrated at the time of the reading.'),\n readings: z\n .record(z.string(), z.unknown())\n .optional()\n .describe('Sensor-specific measured values, keyed by measurement name.'),\n notes: z.string().optional().describe('Free-text context about the reading.'),\n })\n .meta({ id: 'SensorReading' })\n .describe('A single sensor reading and its provenance.');\n\nexport type SensorReading = z.infer<typeof SensorReadingSchema>;\n\nexport const SensorEvidenceDataSchema = z\n .object({\n sensors: z.array(SensorReadingSchema),\n multiSensorCorrelation: z\n .boolean()\n .optional()\n .describe('Whether independent sensors corroborated the same object.'),\n dataRetentionStatus: z\n .enum(['available', 'archived', 'destroyed', 'classified', 'unknown'])\n .optional()\n .describe('Current status of the underlying sensor data.'),\n anomalies: z\n .array(z.string())\n .optional()\n .describe('Anomalies in the sensor data itself (e.g. \"jamming indications\", \"signal dropout\").'),\n })\n .meta({ id: 'SensorEvidenceData' })\n .describe('Instrument-recorded evidence for an observation (radar, FLIR, EO, etc.).');\n\nexport type SensorEvidenceData = z.infer<typeof SensorEvidenceDataSchema>;\n"]}
1
+ {"version":3,"sources":["../../../src/source/sensor/types.ts"],"names":[],"mappings":";;;AAEO,IAAM,qBAAA,GAAwB,EAClC,IAAA,CAAK;AAAA,EACJ,eAAA;AAAA,EACA,iBAAA;AAAA,EACA,eAAA;AAAA,EACA,oBAAA;AAAA,EACA,eAAA;AAAA,EACA,gBAAA;AAAA,EACA,iBAAA;AAAA,EACA,eAAA;AAAA,EACA,mBAAA;AAAA,EACA,cAAA;AAAA,EACA,eA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;AAAA,EAC3D,SAAA,EAAW,CAAA,CACR,KAAA,CAAM,CAAA,CAAE,MAAA,EAAQ,CAAA,CAChB,QAAA,EAAS,CACT,QAAA,CAAS,qFAAqF;AACnG,CAAC,CAAA,CACA,KAAK,EAAE,EAAA,EAAI,sBAAsB,CAAA,CACjC,SAAS,0EAA0E","file":"index.js","sourcesContent":["import { z } from 'zod';\n\nexport const DetectionMethodSchema = z\n .enum([\n 'radar_primary',\n 'radar_secondary',\n 'radar_doppler',\n 'radar_phased_array',\n 'infrared_flir',\n 'infrared_other',\n 'electro_optical',\n 'visual_camera',\n 'satellite_imagery',\n 'sonar_active',\n 'sonar_passive',\n 'electromagnetic',\n 'radiation_detector',\n 'magnetometer',\n 'gravimeter',\n 'acoustic',\n 'seismic',\n 'lidar',\n 'spectroscopic',\n 'radio_frequency',\n 'particle',\n 'gnss',\n 'time_reference',\n 'chemical',\n 'inertial',\n 'physiological',\n 'pressure',\n 'multiple',\n 'other',\n 'unknown',\n ])\n .describe('How a sensor detected the object.');\n\nexport type DetectionMethod = z.infer<typeof DetectionMethodSchema>;\n\nexport const SensorTypeSchema = z\n .enum([\n 'military_radar',\n 'civilian_radar',\n 'airborne_radar',\n 'shipborne_radar',\n 'ground_radar',\n 'flir',\n 'eo_sensor',\n 'satellite',\n 'sonar',\n 'electromagnetic_sensor',\n 'radiation_sensor',\n 'civilian_camera',\n 'security_camera',\n 'dashcam',\n 'phone_camera',\n 'infrasonic_sensor',\n 'ultrasonic_sensor',\n 'adsb_receiver',\n 'rf_spectrum_analyzer',\n 'passive_radar',\n 'particle_detector',\n 'atomic_clock',\n 'gnss_receiver',\n 'fluxgate_magnetometer',\n 'air_quality_sensor',\n 'barometer',\n 'lightning_detector',\n 'imu',\n 'eeg',\n 'gsr',\n 'pulse_oximeter',\n 'pupillometer',\n 'hardware_rng',\n 'other',\n ])\n .describe('Class of sensor that produced a reading.');\n\nexport type SensorType = z.infer<typeof SensorTypeSchema>;\n\nexport const SensorReadingSchema = z\n .object({\n id: z.string().min(1).describe('Stable id, addressable by a claim `evidenceRef` (\"sensor:<id>\").'),\n sensorType: SensorTypeSchema,\n detectionMethod: DetectionMethodSchema,\n sensorRef: z\n .string()\n .optional()\n .describe(\n 'Reference to a published sensor-manifest entry (\"<org-slug>:<sensor-id>\", e.g. \"eldaeon:dionysus-passive-radar\") carrying the instrument\\u2019s full spec, timing, and calibration provenance.',\n ),\n platform: z\n .string()\n .optional()\n .describe('Platform carrying the sensor (e.g. \"USS Princeton\", \"F/A-18F\").'),\n operator: z.string().optional().describe('Person or unit operating the sensor.'),\n timestamp: z.string().optional().describe('When the reading was recorded (ISO timestamp).'),\n duration: z.number().optional().describe('How long the sensor held contact, in seconds.'),\n rawDataAvailable: z.boolean().optional().describe('Whether the raw sensor data still exists and is obtainable.'),\n calibrated: z.boolean().optional().describe('Whether the sensor was calibrated at the time of the reading.'),\n readings: z\n .record(z.string(), z.unknown())\n .optional()\n .describe('Sensor-specific measured values, keyed by measurement name.'),\n notes: z.string().optional().describe('Free-text context about the reading.'),\n })\n .meta({ id: 'SensorReading' })\n .describe('A single sensor reading and its provenance.');\n\nexport type SensorReading = z.infer<typeof SensorReadingSchema>;\n\nexport const SensorEvidenceDataSchema = z\n .object({\n sensors: z.array(SensorReadingSchema),\n multiSensorCorrelation: z\n .boolean()\n .optional()\n .describe('Whether independent sensors corroborated the same object.'),\n dataRetentionStatus: z\n .enum(['available', 'archived', 'destroyed', 'classified', 'unknown'])\n .optional()\n .describe('Current status of the underlying sensor data.'),\n anomalies: z\n .array(z.string())\n .optional()\n .describe('Anomalies in the sensor data itself (e.g. \"jamming indications\", \"signal dropout\").'),\n })\n .meta({ id: 'SensorEvidenceData' })\n .describe('Instrument-recorded evidence for an observation (radar, FLIR, EO, etc.).');\n\nexport type SensorEvidenceData = z.infer<typeof SensorEvidenceDataSchema>;\n"]}
@@ -644,6 +644,24 @@ declare const ObservationSchema: z.ZodObject<{
644
644
  security_camera: "security_camera";
645
645
  dashcam: "dashcam";
646
646
  phone_camera: "phone_camera";
647
+ infrasonic_sensor: "infrasonic_sensor";
648
+ ultrasonic_sensor: "ultrasonic_sensor";
649
+ adsb_receiver: "adsb_receiver";
650
+ rf_spectrum_analyzer: "rf_spectrum_analyzer";
651
+ passive_radar: "passive_radar";
652
+ particle_detector: "particle_detector";
653
+ atomic_clock: "atomic_clock";
654
+ gnss_receiver: "gnss_receiver";
655
+ fluxgate_magnetometer: "fluxgate_magnetometer";
656
+ air_quality_sensor: "air_quality_sensor";
657
+ barometer: "barometer";
658
+ lightning_detector: "lightning_detector";
659
+ imu: "imu";
660
+ eeg: "eeg";
661
+ gsr: "gsr";
662
+ pulse_oximeter: "pulse_oximeter";
663
+ pupillometer: "pupillometer";
664
+ hardware_rng: "hardware_rng";
647
665
  }>;
648
666
  detectionMethod: z.ZodEnum<{
649
667
  unknown: "unknown";
@@ -668,8 +686,16 @@ declare const ObservationSchema: z.ZodObject<{
668
686
  lidar: "lidar";
669
687
  spectroscopic: "spectroscopic";
670
688
  radio_frequency: "radio_frequency";
689
+ particle: "particle";
690
+ gnss: "gnss";
691
+ time_reference: "time_reference";
692
+ chemical: "chemical";
693
+ inertial: "inertial";
694
+ physiological: "physiological";
695
+ pressure: "pressure";
671
696
  multiple: "multiple";
672
697
  }>;
698
+ sensorRef: z.ZodOptional<z.ZodString>;
673
699
  platform: z.ZodOptional<z.ZodString>;
674
700
  operator: z.ZodOptional<z.ZodString>;
675
701
  timestamp: z.ZodOptional<z.ZodString>;
@@ -239,6 +239,13 @@ var DetectionMethodSchema = z.enum([
239
239
  "lidar",
240
240
  "spectroscopic",
241
241
  "radio_frequency",
242
+ "particle",
243
+ "gnss",
244
+ "time_reference",
245
+ "chemical",
246
+ "inertial",
247
+ "physiological",
248
+ "pressure",
242
249
  "multiple",
243
250
  "other",
244
251
  "unknown"
@@ -259,12 +266,33 @@ var SensorTypeSchema = z.enum([
259
266
  "security_camera",
260
267
  "dashcam",
261
268
  "phone_camera",
269
+ "infrasonic_sensor",
270
+ "ultrasonic_sensor",
271
+ "adsb_receiver",
272
+ "rf_spectrum_analyzer",
273
+ "passive_radar",
274
+ "particle_detector",
275
+ "atomic_clock",
276
+ "gnss_receiver",
277
+ "fluxgate_magnetometer",
278
+ "air_quality_sensor",
279
+ "barometer",
280
+ "lightning_detector",
281
+ "imu",
282
+ "eeg",
283
+ "gsr",
284
+ "pulse_oximeter",
285
+ "pupillometer",
286
+ "hardware_rng",
262
287
  "other"
263
288
  ]).describe("Class of sensor that produced a reading.");
264
289
  var SensorReadingSchema = z.object({
265
290
  id: z.string().min(1).describe('Stable id, addressable by a claim `evidenceRef` ("sensor:<id>").'),
266
291
  sensorType: SensorTypeSchema,
267
292
  detectionMethod: DetectionMethodSchema,
293
+ sensorRef: z.string().optional().describe(
294
+ 'Reference to a published sensor-manifest entry ("<org-slug>:<sensor-id>", e.g. "eldaeon:dionysus-passive-radar") carrying the instrument\u2019s full spec, timing, and calibration provenance.'
295
+ ),
268
296
  platform: z.string().optional().describe('Platform carrying the sensor (e.g. "USS Princeton", "F/A-18F").'),
269
297
  operator: z.string().optional().describe("Person or unit operating the sensor."),
270
298
  timestamp: z.string().optional().describe("When the reading was recorded (ISO timestamp)."),