Pilot programme targeting Q3 2026. Register your interest now.Pilot EOI
UPAS
Interfaces

Interfaces Reference

Data formats and interfaces used in UPAS (prototype)

Prototype Documentation: These interfaces represent the intended design. Implementation details may evolve during development.

This document describes the core data structures and interfaces planned for UPAS.

Procedure Pack

The primary data structure for bundled guidance content:

interface ProcedurePack {
  /** Unique identifier for the pack */
  id: string;
  
  /** Semantic version (e.g., "3.2.1") */
  version: string;
  
  /** Publishing organisation */
  publisher: string;
  
  /** ISO 8601 publication timestamp */
  publishedAt: string;
  
  /** Content domain (e.g., "emergency-response", "wash") */
  domain: string;
  
  /** ISO 639-1 locale code (e.g., "en", "fr") */
  locale: string;
  
  /** SHA-256 hash of the pack contents */
  integrity: string;
  
  /** Included documents */
  documents: Document[];
  
  /** Embeddings for semantic search (optional) */
  embeddings?: EmbeddingIndex;
}

Document

Individual documents within a procedure pack:

interface Document {
  /** Unique identifier within the pack */
  id: string;
  
  /** Human-readable title */
  title: string;
  
  /** Document type */
  type: "sop" | "checklist" | "form" | "reference" | "guidance";
  
  /** ISO 8601 effective date */
  effectiveDate: string;
  
  /** Plain text or markdown content */
  content: string;
  
  /** SHA-256 hash of the document content */
  hash: string;
  
  /** Optional metadata */
  metadata?: DocumentMetadata;
}

interface DocumentMetadata {
  /** Keywords for search */
  keywords?: string[];
  
  /** Applicable roles */
  roles?: string[];
  
  /** Supersedes document ID */
  supersedes?: string;
  
  /** Review date */
  reviewDate?: string;
}

Query Request

Structure for querying guidance:

interface QueryRequest {
  /** Natural language question */
  question: string;
  
  /** Optional context for role-specific guidance */
  context?: QueryContext;
  
  /** Maximum results to return */
  limit?: number;
}

interface QueryContext {
  /** Responder role (e.g., "field-medic", "logistics") */
  role?: string;
  
  /** Operation type (e.g., "flood", "earthquake") */
  operation?: string;
  
  /** Additional context key-value pairs */
  [key: string]: string | undefined;
}

Query Response

Structure for guidance responses:

interface QueryResponse {
  /** Stepwise actions to follow */
  steps: string[];
  
  /** Summary of the guidance */
  summary?: string;
  
  /** Source document information */
  source: SourceReference;
  
  /** Full provenance metadata */
  provenance: Provenance;
  
  /** Related documents (optional) */
  related?: SourceReference[];
}

interface SourceReference {
  /** Document ID */
  documentId: string;
  
  /** Document title */
  title: string;
  
  /** Specific section (optional) */
  section?: string;
}

interface Provenance {
  /** Pack publisher */
  publisher: string;
  
  /** Pack version */
  version: string;
  
  /** Document effective date */
  effectiveDate: string;
  
  /** Document integrity hash */
  hash: string;
  
  /** Query timestamp */
  queriedAt: string;
}

Runtime Status

Structure for runtime health information:

interface RuntimeStatus {
  /** Current runtime mode */
  runtime: "webgpu" | "wasm" | "none";
  
  /** Model load status */
  modelStatus: "loading" | "ready" | "error" | "unavailable";
  
  /** Model identifier */
  modelId?: string;
  
  /** Load progress (0-1) */
  loadProgress?: number;
  
  /** Error message if applicable */
  error?: string;
}

Cache Status

Structure for cache health information:

interface CacheStatus {
  /** Cache name */
  name: string;
  
  /** Number of cached entries */
  entryCount: number;
  
  /** Total size in bytes */
  sizeBytes: number;
  
  /** Last update timestamp */
  lastUpdated: string;
  
  /** Cached pack versions */
  packs: PackCacheEntry[];
}

interface PackCacheEntry {
  /** Pack ID */
  id: string;
  
  /** Cached version */
  version: string;
  
  /** Cache timestamp */
  cachedAt: string;
  
  /** Size in bytes */
  sizeBytes: number;
}

Sync Manifest

Structure for update synchronisation:

interface SyncManifest {
  /** Manifest version */
  manifestVersion: string;
  
  /** Available pack releases */
  releases: PackRelease[];
  
  /** Manifest generation timestamp */
  generatedAt: string;
}

interface PackRelease {
  /** Pack ID */
  id: string;
  
  /** Available version */
  version: string;
  
  /** Download URL */
  url: string;
  
  /** File size in bytes */
  sizeBytes: number;
  
  /** Integrity hash */
  integrity: string;
  
  /** Release notes (optional) */
  releaseNotes?: string;
}

Next Steps