SDK reference
Every export of @neurologyca/capture 0.45.0 and @neurologyca/capture-server 0.20.1, by entry, with its signature and the page that explains it.
On this page
- @neurologyca/capture
- Functions
- Classes
- Interfaces
- Types
- Constants
- Re-exports
- @neurologyca/capture/record
- Functions
- Classes
- Interfaces
- Types
- Constants
- @neurologyca/capture/helpers
- Functions
- Interfaces
- Types
- @neurologyca/capture/replay
- Functions
- Classes
- Interfaces
- Types
- Constants
- @neurologyca/capture-server
- Functions
- Classes
- Interfaces
- Types
- Constants
- @neurologyca/capture-server/node
- Functions
- Interfaces
Generated from the published types of @neurologyca/capture 0.45.0 and @neurologyca/capture-server 0.20.1. Each export has its signature and, when there is one, the page that explains it. This page is generated with npm run docs:gen; do not edit it by hand.
@neurologyca/capture
Section titled “@neurologyca/capture”Functions
Section titled “Functions”abandonUpload· function · Deferred (server-side)
declare function abandonUpload(captureId: string, opts: AbandonUploadOptions): Promise<void>;captureCacheStatus· function · On-device (real time)
declare function captureCacheStatus(opts?: CaptureCacheStatusOptions): Promise<PrepareCacheStatus>;classifyMediaError· function · Steps and marking
declare function classifyMediaError(e: unknown, env?: { isSecureContext?: boolean; hasMediaDevices?: boolean; }): MediaProblem | null;consumeSse· function · On-device (real time)
declare function consumeSse(body: ReadableStream<Uint8Array>, onEvent: (event: string, data: unknown) => void): Promise<void>;createGazeTracker· function · no guide
declare function createGazeTracker(opts?: GazeTrackerOptions): GazeTracker;createProtocolClient· function · On-device (real time)
declare function createProtocolClient(config: ProtocolClientConfig): ProtocolClientHandle;createRecordingClient· function · Deferred (server-side)
declare function createRecordingClient(config: RecordingClientConfig): RecordingClientHandle;defineTenantConfig· function · On-device (real time)
declare function defineTenantConfig(config: TenantConfig): TenantConfig;describeStep· function · Steps and marking
declare function describeStep(step: PlanStep, opts?: { lang?: string; }): StepFacts;forgetTranscriptionVeto· function · On-device (real time)
declare function forgetTranscriptionVeto(kodec: VideoVetoTarget): Promise<unknown | null>;guardUnload· function · Steps and marking
declare function guardUnload(isUnsafe?: () => boolean): () => void;keepScreenOn· function · Steps and marking
declare function keepScreenOn(): Promise<{ supported: boolean; release(): void; }>;listPendingRecordings· function · Deferred (server-side)
declare function listPendingRecordings(opts?: ListPendingRecordingsOptions): Promise<RecordingResult[]>;makeKodecStt· function · On-device (real time)
declare function makeKodecStt(host: KodecSttHost, opts?: KodecSttOptions): (cfg: TranscribeConfig) => SttProvider;normalizeSource· function · On-device (real time)
declare function normalizeSource(src: MediaStream | HTMLVideoElement | CaptureSource): CaptureSource;prepareCapture· function · On-device (real time)
declare function prepareCapture(opts: PrepareCaptureOptions): Promise<PrepareResult>;readScoreIndex· function · HCIs and results
declare function readScoreIndex(structured: unknown, key?: ScoreIndexKey, opts?: ReadScoreIndexOptions): ScoreIndex | null;readTranscriptionVeto· function · On-device (real time)
declare function readTranscriptionVeto(kodec: VideoVetoTarget): Promise<{ veto: unknown | null; learned: unknown; }>;resolveTaxonomy· function · On-device (real time)
declare function resolveTaxonomy(config: TenantConfig, mechanicName?: string): Taxonomy2;startOrAsk· function · Steps and marking
declare function startOrAsk<T>(start: (discardPending: boolean) => Promise<T>, ask: (holder: PositionHolder | null) => Promise<boolean>): Promise<T | null>;sttBlockerOf· function · On-device (real time)
declare function sttBlockerOf(e: unknown): SttBlocker | undefined;uploadRecording· function · Deferred (server-side)
declare function uploadRecording(rec: RecordingResult, opts: UploadRecordingOptions): Promise<UploadRecordingResult>;urlTokenProvider· function · On-device (real time)
declare function urlTokenProvider(tokenUrl: string, opts?: { method?: 'GET' | 'POST'; timeoutMs?: number; credentials?: RequestCredentials; }): TokenProvider;validateManifest· function · Deferred (server-side)
declare function validateManifest(m: RecordingManifest, opts?: { durationMs?: number | null; }): string[];waitForPortraitOrientation· function · Steps and marking
declare function waitForPortraitOrientation(opts?: { handheld?: boolean; signal?: AbortSignal; }): Promise<{ handheld: boolean | null; waited: boolean; }>;
Classes
Section titled “Classes”AnalysisFailedError· class · Errors, warnings and retries
declare class AnalysisFailedError extends ProtocolUsageErrorBaselineIncompleteError· class · Errors, warnings and retries
declare class BaselineIncompleteError extends ProtocolUsageErrorBaselineRequestError· class · Errors, warnings and retries
declare class BaselineRequestError extends ProtocolUsageErrorCadenceError· class · Errors, warnings and retries
declare class CadenceError extends ProtocolUsageErrorCaptureAbortedError· class · Errors, warnings and retries
declare class CaptureAbortedError extends ProtocolUsageErrorCaptureIdInUseError· class · Errors, warnings and retries
declare class CaptureIdInUseError extends ProtocolUsageErrorCaptureStartError· class · Errors, warnings and retries
declare class CaptureStartError extends ProtocolUsageErrorEmptyStepError· class · Errors, warnings and retries
declare class EmptyStepError extends ProtocolUsageErrorFlowUnsupportedError· class · Errors, warnings and retries
declare class FlowUnsupportedError extends ProtocolUsageErrorHttpError· class · Errors, warnings and retries
declare class HttpError extends ErrorKodecFrameSource· class · On-device (real time)
declare class KodecFrameSource implements FrameSourceKodecSttRefused· class · On-device (real time)
declare class KodecSttRefused extends ErrorMediaUnknownError· class · Errors, warnings and retries
declare class MediaUnknownError extends ProtocolUsageErrorPlanIncompleteError· class · Errors, warnings and retries
declare class PlanIncompleteError extends ProtocolUsageErrorPrepareError· class · Errors, warnings and retries
declare class PrepareError extends ProtocolUsageErrorProtocolConflictError· class · Errors, warnings and retries
declare class ProtocolConflictError extends Error implements ProtocolErrorProtocolUsageError· class · Errors, warnings and retries
declare abstract class ProtocolUsageError extends ErrorRecorderUnsupportedError· class · Errors, warnings and retries
declare class RecorderUnsupportedError extends ProtocolUsageErrorRecordingLostError· class · Errors, warnings and retries
declare class RecordingLostError extends ProtocolUsageErrorSessionDirtyError· class · Errors, warnings and retries
declare class SessionDirtyError extends ProtocolUsageErrorSessionInvalidError· class · Errors, warnings and retries
declare class SessionInvalidError extends ProtocolUsageErrorStepDurationError· class · Errors, warnings and retries
declare class StepDurationError extends ProtocolUsageErrorStepSequenceError· class · Errors, warnings and retries
declare class StepSequenceError extends ProtocolUsageErrorStorageFullError· class · Errors, warnings and retries
declare class StorageFullError extends ProtocolUsageErrorTaxonomyInvalidError· class · Errors, warnings and retries
declare class TaxonomyInvalidError extends ProtocolUsageErrorUnknownOptionError· class · Errors, warnings and retries
declare class UnknownOptionError extends ProtocolUsageErrorUploadRecordingError· class · Errors, warnings and retries
declare class UploadRecordingError extends Error
Interfaces
Section titled “Interfaces”AbandonUploadOptions· interface · Deferred (server-side)
interface AbandonUploadOptions
members:credentials·headers·signal·urlAnalyzeAnswer· interface · Errors, warnings and retries
interface AnalyzeAnswer
members:fromCache·inProgress·interpretation·raw·retryAfterMsBackendFrame· interface · On-device (real time)
interface BackendFrame
members:audio·blendshapes·body·clientTsMs·featuresMeta·gaze·hands·headPose·landmarks·mediaTimeMs·rppgBaseline2Info· interface · Baseline
interface Baseline2Info
members:expiryDays·isValid·lastUpdatedAtBaselineCaptureOpts· interface · Baseline
interface BaselineCaptureOpts
members:durationMs·onProgress·onStarted·signal·source·userIdBaselineCaptureResult· interface · Baseline
interface BaselineCaptureResult
members:complete·framesReceived·framesReceivedWithoutFeaturesMeta·framesSent·framesSentWithoutFeaturesMeta·framesWithoutPose·missingOrders·packets·packetsExpected·packetsReceivedBaselineProgress· interface · Baseline
interface BaselineProgress
members:elapsedMs·fraction·totalMsCalibrateOptions· interface · no guide
interface CalibrateOptions
members:managedBySdk·onNotice·onTarget·points·signalCalibrationReport· interface · no guide
interface CalibrationReport
members:attempts·centered·endedAt·gainY·offset·ok·points·quality·reason·repeatedFor·samples·startedAt·warningsCalibrationTarget· interface · no guide
interface CalibrationTarget
members:index·phase·total·x·yCaptureOutcome· interface · HCIs and results
interface CaptureOutcome
members:frameCount·hcis·hcisByStep·interpretation·status·structuredCaptureProtocolOpts· interface · On-device (real time)
interface CaptureProtocolOpts
members:captureId·dangerouslyIgnoreCadence·discardPending·gaze·interpretation·mediaClock·onStarted·protocolMechanicId·signal·sleepBand·source·taxonomy·transcribe·triggerAnalysis·userProtocolIdCaptureQualitySummary· interface · HCIs and results
interface CaptureQualitySummary
members:capture·delegate·droppedTotal·fps·maxFps·minFps·windowsChannelSelection· interface · On-device (real time)
interface ChannelSelection
members:audio·body·hands·pulseConflictDetail· interface · Errors, warnings and retries
interface ConflictDetail
members:captureId·capturedAt·earliestAt·expected·expired·goToPosition·hint·holder·latestAnalysedAt·raw·reason·ruleDeviceCheck· interface · On-device (real time)
interface DeviceCheck
members:id·measured·reason·statusEngineToken· interface · On-device (real time)
interface EngineToken
members:expiresAt·tokenFrameClockStats· interface · On-device (real time)
interface FrameClockStats
members:head·iqr·max·mean·min·n·overflow·p25·p50·p75·saturated·slopeMsPerSec·tail·underflowFrameGaze· interface · no guide
interface FrameGaze
members:isFixating·point·region·spread·stimulusFrameSource· interface · On-device (real time)
interface FrameSource
members:kodecSessionId·ownsLoadClock·start·stopFrameSourceCallbacks· interface · On-device (real time)
interface FrameSourceCallbacks
members:onCameraReady·onCodecError·onCodecEvent·onFrame·onLandmarks·onLive·onSignals·onStarted·onTranscriptionCutGazeFrame· interface · no guide
interface GazeFrame
members:clientTsMs·featuresMeta·headPose·landmarksGazePoint· interface · no guide
interface GazePoint
members:x·yGazeSample· interface · no guide
interface GazeSample
members:fixating·point·region·spread·tMsGazeTracker· interface · no guide
interface GazeTracker
members:calibrate·calibrated·forFrame·history·last·push·recalibrate·setGlasses·setStimulusGazeTrackerOptions· interface · no guide
interface GazeTrackerOptions
members:glasses·now·onGazeKodecSttHost· interface · On-device (real time)
interface KodecSttHost
members:kodec·mediaStreamKodecSttOptions· interface · On-device (real time)
interface KodecSttOptions
members:awaitVideoProof·canTranscribe·enable·flushTimeoutMs·limitsKodecSttTarget· interface · On-device (real time)
interface KodecSttTarget
members:captureQuality·disableLocalTranscription·enableLocalTranscription·flushLocalTranscription·models·pauseLocalTranscription·resumeLocalTranscription·sessionSpeech·takeTranscriptDelta·transcriptionCutBy·transcriptionLoad·transcriptionStatsKodecTuning· interface · On-device (real time)
interface KodecTuning
members:capture·delegate·faceModel·handModel·poseModel·visionUrl·wasmUrlListPendingRecordingsOptions· interface · Deferred (server-side)
interface ListPendingRecordingsOptions
members:onWarningLiveSignal· interface · On-device (real time)
interface LiveSignal
members:clientTsMs·headPoseManifestStep· interface · Steps and marking
interface ManifestStep
members:endMediaMs·endedBy·mediaPid·order·startMediaMs·typeModeDecision· interface · On-device (real time)
interface ModeDecision
members:by·mode·probeFps·reasonModelDownload· interface · On-device (real time)
interface ModelDownload
members:files·filesDone·loadedBytes·totalBytes·totalKnownModelSelection· interface · On-device (real time)
interface ModelSelection
members:body·handsPlanStep· interface · Steps and marking
interface PlanStep
members:category·delivery·description·expectsSpeech·maxTimeSeconds·media·minTimeSeconds·optional·order·phases·presentationSeconds·rounds·targetConstellationHciId·typePositionHolder· interface · On-device (real time)
interface PositionHolder
members:captureId·capturedAt·deferred·finished·receivingPackets·recordingEndedAtPositionState· interface · On-device (real time)
interface PositionState
members:completed·mechanicName·position·protocolMechanicIdPrepareCacheStatus· interface · On-device (real time)
interface PrepareCacheStatus
members:faceModel·speechWeights·sttLibrary·sttRuntime·visionRuntimePrepareCaptureOptions· interface · On-device (real time)
interface PrepareCaptureOptions
members:kodec·level·models·onStartupStage·onWarning·prepare·signal·startup·tenant·throwOnFailure·transcribePrepareOptions· interface · On-device (real time)
interface PrepareOptions
members:level·models·signal·throwOnFailure·timeoutsPrepareResult· interface · On-device (real time)
interface PrepareResult
members:cache·capture·cutBy·device·estimatedSpeechMs·face·level·messageKey·outcome·partialReason·report·stages·transcription·transcriptionGate·userMessagePreparedBlock· interface · On-device (real time)
interface PreparedBlock
members:face·faceReloaded·level·origin·prepareId·speechProtocolClientConfig· interface · On-device (real time)
interface ProtocolClientConfig
members:analyzeTimeoutMs·baseUrl·batchMs·channels·correlationId·credentials·fps·getToken·keepPrepared·kodec·makeStt·mode·models·onCodecEvent·onError·onInterpretation·onInterpretationDetails·onLandmarks·onLive·onProgress·onRecording·onReport·onResult·onSignals·onStartupStage·onStatus·onTranscript·onWarning·outcomeDeadlineMs·query·recording·requestTimeoutMs·sleepBand·startup·stepDurations·taxonomy·tenant·transcribe·transcribeStepsProtocolClientHandle· interface · On-device (real time)
interface ProtocolClientHandle
members:analyze·cacheStatus·captureBaseline·captureProtocol·correlationPrefix·getBaselineInfo·getProtocolState·prepare·release·retrieveResultsProtocolError· interface · Errors, warnings and retries
interface ProtocolError
members:code·conflict·message·reason·recoverable·stepOrderProtocolInterpretationDetailsEvent· interface · HCIs and results
interface ProtocolInterpretationDetailsEvent
members:metadata·protocolMechanicId·raw·structured·userProtocolIdProtocolInterpretationEvent· interface · HCIs and results
interface ProtocolInterpretationEvent
members:fromCache·interpretation·metadata·protocolMechanicId·raw·structured·userProtocolIdProtocolPlan· interface · Steps and marking
interface ProtocolPlan
members:flowMode·mechanicName·position·steps·timeBetweenSessionsSecondsProtocolProgressEvent· interface · On-device (real time)
interface ProtocolProgressEvent
members:phase·routeProtocolResultEvent· interface · HCIs and results
interface ProtocolResultEvent
members:frameCount·hcis·hcisByStep·protocolMechanicId·raw·userProtocolIdProtocolSessionHandle· interface · On-device (real time)
interface ProtocolSessionHandle
members:abort·captureId·correlationId·plan·step·stepTiming·stopProtocolState· interface · On-device (real time)
interface ProtocolState
members:asOf·availability·baselineWarning·next·positions·progressProtocolStatusEvent· interface · On-device (real time)
interface ProtocolStatusEvent
members:status·stepOrderProtocolStepHandle· interface · Steps and marking
interface ProtocolStepHandle
members:end·run·startProtocolWarningEvent· interface · Errors, warnings and retries
interface ProtocolWarningEvent
members:blocker·captureId·code·cut·fields·hci·message·messageKey·part·reason·stage·stepOrder·subStage·userMessageReadScoreIndexOptions· interface · HCIs and results
interface ReadScoreIndexOptions
members:onWarning·onWarningRecalibrateOptions· interface · no guide
interface RecalibrateOptions
members:correct·onTarget·points·signalRecalibrationPoint· interface · no guide
interface RecalibrationPoint
members:deviation·dx·dy·measured·samples·targetRecalibrationReport· interface · no guide
interface RecalibrationReport
members:corrected·endedAt·glasses·meanDeviation·offsetAfter·offsetBefore·points·startedAtRecordingClientConfig· interface · Deferred (server-side)
interface RecordingClientConfig
members:analyzeTimeoutMs·baseUrl·credentials·getToken·onError·onRecording·onStartupStage·onWarning·recording·requestTimeoutMs·startup·stepDurations·taxonomy·tenantRecordingClientHandle· interface · Deferred (server-side)
interface RecordingClientHandle
members:analyze·captureProtocol·getBaselineInfo·getProtocolState·prepare·release·retrieveResultsRecordingManifest· interface · Deferred (server-side)
interface RecordingManifest
members:audioGaps·captureId·client·hidden·interpreted·orientation·orientationChanges·prerollMs·protocolMechanicId·recorder·recordingStartedAtMs·recordingStartedAtPrecisionMs·serverClockSkewMs·steps·stimulus·stopMediaMs·triggerAnalysis·userProtocolId·version·videoGapsRecordingOptions· interface · Deferred (server-side)
interface RecordingOptions
members:handheld·maxFps·postrollMs·prerollMs·reserve·videoBitsPerSecondRecordingPrepareOptions· interface · Deferred (server-side)
interface RecordingPrepareOptions
members:signal·throwOnFailure·timeoutsRecordingResult· interface · Deferred (server-side)
interface RecordingResult
members:blob·manifest·release·storageRecordingSessionHandle· interface · Deferred (server-side)
interface RecordingSessionHandle extends Omit<ProtocolSessionHandle, 'stop'>
members:result·stop·trackStimulus·abort·captureId·correlationId·plan·step·stepTiming·stopReplayReport· interface · Processing service
interface ReplayReport
members:cost·origin·outsideSteps·steps·transcriptionScoreIndex· interface · HCIs and results
interface ScoreIndex
members:band·degradedSignals·indicatorsUsed·label·status·value·band·degradedSignals·indicatorsUsed·label·status·valueSessionAttempt· interface · On-device (real time)
interface SessionAttempt
members:captureId·createdAt·statusSessionReport· interface · HCIs and results
interface SessionReport
members:alignmentMisses·cancel·captureId·captureQuality·clock·codecErrors·correlationId·endedBy·finalGapWaitMs·framesBeforeFirstPacket·hiddenMs·interpretationMode·interpretationSource·kodecSessionId·modelDownload·replay·speech·startup·steps·streamDropsDuringWait·transcription·transcriptionLoad·transcriptionSetup·triggerAnalysisSourceOpts· interface · On-device (real time)
interface SourceOpts
members:audio·channels·gaze·kodec·mediaClock·modelsSpeechSlice· interface · On-device (real time)
interface SpeechSlice
members:endMs·language·spokenMs·startMs·step·sttModel·textStartupOptions· interface · On-device (real time)
interface StartupOptions
members:includeUserAgent·locale·messages·report·timeoutsStartupReport· interface · On-device (real time)
interface StartupReport
members:at·capture·context·cutBy·device·estimatedSpeechMs·kept·kind·kodecVersion·learned·level·mode·outcome·partialReason·prepared·schema·sdkVersion·seq·stages·startupId·totalMs·transcription·transcriptionGate·uaVersionToken·userAgentStartupReportOptions· interface · On-device (real time)
interface StartupReportOptions
members:context·on·urlStartupStageEvent· interface · On-device (real time)
interface StartupStageEvent
members:blocker·bytes·bytesPerSec·kind·messageKey·ms·parent·pending·reason·source·stage·startupId·status·total·userMessageStartupStageRecord· interface · On-device (real time)
interface StartupStageRecord
members:blocker·bytes·ms·parent·pending·reason·source·stage·status·totalStartupTimeoutGroup· interface · On-device (real time)
interface StartupTimeoutGroup
members:stallMs·totalMsStepFacts· interface · Steps and marking
interface StepFacts
members:assets·bands·deliveryMode·expectsSpeech·maxSeconds·minSeconds·optional·order·phases·responseClock·rounds·text·texts·type·unknownStepMedia· interface · Steps and marking
interface StepMedia
members:body·kind·location·pidStepPhase· interface · Steps and marking
interface StepPhase
members:mediaPid·order·phase·secondsStepRunOpts· interface · Steps and marking
interface StepRunOpts extends StepStartOpts
members:durationMs·mediaPidStepStartOpts· interface · Steps and marking
interface StepStartOpts
members:mediaPidStepTiming· interface · Steps and marking
interface StepTiming
members:elapsedMs·maxMs·maxReached·minMs·minReached·order·remainingMsStepTranscription· interface · On-device (real time)
interface StepTranscription
members:cutsMaxLength·discarded·discardedAntiStuckMs·discardedMs·emitted·order·recoveredMs·retriedSplit·spokenMs·transcribed·typeStimulusSample· interface · Steps and marking
interface StimulusSample
members:atMediaMs·event·stimulusTimeMsSttDelta· interface · On-device (real time)
interface SttDelta
members:endMs·items·spokenMs·startMs·textSttDiagnostics· interface · On-device (real time)
interface SttDiagnostics
members:confidenceFilter·confidenceMeasured·confidenceUnmeasurable·cutBy·discardedAnnotationOnly·discardedBySilero·discardedEmpty·discardedLowConfidence·discardedRepetitionLoop·emitted·inferenceErrors·lostOnClose·modelLoad·pending·recoveredMs·retriedSplit·usesWorker·vad·workerBlockedByCsp·workerFailedBecauseSttProvider· interface · On-device (real time)
interface SttProvider
members:diagnostics·dispose·flush·ownsLoadClock·pause·result·resume·start·stop·takeDeltaSttResult· interface · On-device (real time)
interface SttResult
members:accuracy·endMs·language·list·spokenMs·startMs·textSttUtterance· interface · On-device (real time)
interface SttUtterance
members:avgLogprob·closedBy·endMs·final·lang·latencyMs·retried·silero·spokenMs·startMs·text·utteranceSeqSttWord· interface · On-device (real time)
interface SttWord
members:timestamp·wordTaxonomy2· interface · On-device (real time)
interface Taxonomy2
members:contextId·hciId·situationId·subcontextIdTenantConfig· interface · On-device (real time)
interface TenantConfig
members:batchMs·engineBaseUrl·fps·taxonomy·transcribe·transcribeStepsTranscribeConfig· interface · On-device (real time)
interface TranscribeConfig
members:allowWasmWorker·device·diarization·dtype·language·minAvgLogprob·model·progress·repetitionLoop·selfHost·sileroVad·transformers·vadTranscriptEvent· interface · On-device (real time)
interface TranscriptEvent
members:endMs·items·spokenMs·startMs·stepOrder·textTranscriptionSetup· interface · On-device (real time)
interface TranscriptionSetup
members:artifact·backend·deviceFellBackFrom·diarization·dtype·language·languageSource·model·modelReason·provisionalVetoLifted·sileroReady·usesWorkerUploadRecordingOptions· interface · Deferred (server-side)
interface UploadRecordingOptions
members:credentials·headers·onProgress·onWarning·retries·signal·urlUploadRecordingResult· interface · Deferred (server-side)
interface UploadRecordingResult
members:captureId·released·sizeVideoVetoTarget· interface · On-device (real time)
interface VideoVetoTarget
members:forgetMemoryLimit·forgetVideoVeto·learnedState
Availability· type · On-device (real time)
type Availability = { canCapture: true; } | { canCapture: false; reason: 'cadence'; availableAt: Date; } | { canCapture: false; reason: 'cadence-unknown'; } | { canCapture: false; reason: 'dirty'; since: Date; } | { canCapture: false; reason: 'complete'; };CacheState· type · On-device (real time)
type CacheState = 'cached' | 'not-cached' | 'unknown';CalibrationNotice· type · no guide
type CalibrationNotice = { kind: 'instructions'; } | { kind: 'repeat'; reasons: CalibrationWarning[]; attempt: number; };CalibrationWarning· type · no guide
type CalibrationWarning = 'low-frame-rate' | 'weak-vertical-signal' | 'glasses' | 'head-moved';CaptureCacheStatusOptions· type · On-device (real time)
type CaptureCacheStatusOptions = Omit<PrepareCaptureOptions, 'level' | 'prepare' | 'signal' | 'throwOnFailure'>;CaptureSource· type · On-device (real time)
type CaptureSource = { type: 'webcam'; } | { type: 'video'; el: HTMLVideoElement; } | { type: 'stream'; stream: MediaStream; } | { type: 'frames'; };CaptureStartReason· type · Errors, warnings and retries
type CaptureStartReason = 'timeout' | 'error' | 'paused' | 'metadata';CaptureStartStage· type · Errors, warnings and retries
type CaptureStartStage = 'camera' | 'face-model' | 'first-frame' | 'source';CaptureStartSubStage· type · Errors, warnings and retries
type CaptureStartSubStage = 'vision-runtime' | 'face-asset' | 'vision-create';ConflictReason· type · Errors, warnings and retries
type ConflictReason = (typeof CONFLICT_REASONS)[number];ConflictRule· type · Errors, warnings and retries
type ConflictRule = 'date_window' | 'time_of_day' | 'spacing' | 'start_order' | 'start_weekday';ConflictWarning· type · Errors, warnings and retries
type ConflictWarning = (typeof CONFLICT_WARNINGS)[number];DeviceCheckId· type · On-device (real time)
type DeviceCheckId = 'secure-context' | 'get-user-media' | 'capture-route' | 'webgpu-adapter' | 'jspi' | 'wasm-simd' | 'audio-worklet' | 'storage-persisted' | 'media-recorder-mp4' | 'indexeddb' | 'storage-quota';HciMeans· type · HCIs and results
type HciMeans = Record<string, number>;InterpretationMode· type · On-device (real time)
type InterpretationMode = 'engine' | 'stream';InterpretationSource· type · HCIs and results
type InterpretationSource = 'sse' | 'analyze-cache' | 'analyze-generated' | 'analyze' | 'stream';MediaProblem· type · Steps and marking
type MediaProblem = 'denied' | 'no-device' | 'in-use' | 'constraints' | 'insecure-context' | 'no-frames' | 'recorder-unsupported' | 'model-load';PartialReason· type · On-device (real time)
type PartialReason = 'speech-timeout' | 'speech-error' | 'speech-unavailable' | 'speech-not-prepared' | 'speech-gate-timeout';PrepareErrorReason· type · Errors, warnings and retries
type PrepareErrorReason = 'failed' | 'aborted' | 'capture-in-progress';PrepareLevel· type · On-device (real time)
type PrepareLevel = 'memory' | 'cache';PreparedOrigin· type · On-device (real time)
type PreparedOrigin = 'prepare' | 'previous-session';PreparedPartUse· type · On-device (real time)
type PreparedPartUse = 'adopted' | 'stale' | 'unused' | 'not-prepared';ProtocolErrorCode· type · Errors, warnings and retries
type ProtocolErrorCode = 'E_HTTP' | 'E_RESULTS_TIMEOUT' | 'E_RESULTS_EMPTY' | 'E_INTERPRETATION_TIMEOUT' | 'E_ANALYSIS_IN_PROGRESS' | 'E_PROCESSING' | 'E_FRAMES_DISCARDED' | 'E_UPLOAD_FAILED' | 'E_STEP_LOST' | 'E_CAPTURE_LOST' | 'E_RECORDING_LOST' | 'E_AXES_MISSING' | 'E_NARRATIVE_REJECTED' | 'E_TAXONOMY_REJECTED' | 'E_TENANT_UNKNOWN' | 'E_ANALYSIS_FAILED' | 'E_CONFLICT';ProtocolStatus· type · On-device (real time)
type ProtocolStatus = 'authenticating' | 'streaming-open' | 'capturing' | 'transcribing' | 'step-started' | 'step-complete' | 'processing' | 'results-ready' | 'interpretation-ready' | 'complete' | 'timeout' | 'cancelled' | 'invalidated';ScoreIndexKey· type · HCIs and results
type ScoreIndexKey = 'wellness_index' | (string & {});ScoreIndexStatus· type · HCIs and results
type ScoreIndexStatus = 'ok' | 'degraded' | 'not_shown';StartupFailReason· type · On-device (real time)
type StartupFailReason = 'timeout' | 'network' | 'aborted' | 'refused' | 'unsupported' | 'error';StartupLocale· type · On-device (real time)
type StartupLocale = 'es' | 'en';StartupMessageKey· type · On-device (real time)
type StartupMessageKey = 'startup.preparing' | 'face-model.running' | 'face-model.cached' | 'speech.running' | 'speech.stalled' | 'speech.timeout' | 'speech.unavailable' | 'face-model.stalled' | 'face-model.timeout' | 'face-model.error' | 'first-frame.timeout' | 'first-frame.timeout-media' | 'first-frame.face-reload-failed' | 'camera.timeout' | 'capture.aborted' | 'startup.ready' | 'prepare.speech-timeout' | 'prepare.speech-error' | 'prepare.aborted' | 'prepare.record-unsupported';StartupOutcome· type · On-device (real time)
type StartupOutcome = 'ready' | 'partial' | 'failed' | 'aborted' | 'unfinished';StartupStage· type · On-device (real time)
type StartupStage = 'engine-setup' | 'device' | 'camera' | 'face-model' | 'first-frame' | 'speech' | 'engine-session';StartupStagePending· type · On-device (real time)
type StartupStagePending = 'provisional-video-veto' | 'another-load';StartupStageStatus· type · On-device (real time)
type StartupStageStatus = 'pending' | 'running' | 'stalled' | 'done' | 'failed' | 'skipped';StartupSubStage· type · On-device (real time)
type StartupSubStage = 'vision-runtime' | 'face-asset' | 'vision-create' | 'stt-library' | 'stt-weights' | 'stt-runtime' | 'stt-session' | 'vad';StepDelivery· type · On-device (real time)
type StepDelivery = { response_clock?: string; mode?: string; } & Record<string, unknown>;StepDurationsMode· type · Steps and marking
type StepDurationsMode = 'warn' | 'enforce' | 'off';StimulusElement· type · no guide
type StimulusElement = HTMLVideoElement | HTMLImageElement;SttBlocker· type · On-device (real time)
type SttBlocker = (typeof STT_BLOCKERS)[number];SttSileroMeasure· type · On-device (real time)
type SttSileroMeasure = { windows: number; voiced?: number; ratio: number | null; mean: number | null; max: number | null; accepted: boolean; } | { error: string; };TokenProvider· type · On-device (real time)
type TokenProvider = () => Promise<EngineToken>;TranscriptionCut· type · On-device (real time)
type TranscriptionCut = unknown;UploadRecordingErrorCode· type · Errors, warnings and retries
type UploadRecordingErrorCode = 'E_UPLOAD_NETWORK' | 'E_UPLOAD_NOT_NOTIFIED' | 'E_UPLOAD_AUTH' | 'E_UPLOAD_REJECTED' | 'E_UPLOAD_CONFLICT' | 'E_UPLOAD_TOO_LARGE' | 'E_UPLOAD_LOCAL_UNREADABLE' | 'E_UPLOAD_PROTOCOL' | 'E_UPLOAD_ABORTED';
Constants
Section titled “Constants”CONFLICT_REASONS· const · Errors, warnings and retries
declare const CONFLICT_REASONS: readonly ["SESSION_ABANDONED", "POSITION_ALREADY_COMPLETED", "MECHANIC_EXPIRED", "MECHANIC_NOT_YET_AVAILABLE", "MUST_START_AT_FIRST_POSITION", "PROTOCOL_DEPRECATED", "POSITION_RESERVED", "CAPTURE_DISCARDED", "CAPTURE_OUT_OF_ORDER", "PROTOCOL_NOT_ANALYSED", "CAPTURE_CANCELLED"];CONFLICT_WARNINGS· const · Errors, warnings and retries
declare const CONFLICT_WARNINGS: readonly ["conflict.unknown-reason", "conflict.ambiguous-goto", "conflict.earliestAt-assumed-utc"];DEFAULT_CALIBRATION_POINTS· const · no guide
declare const DEFAULT_CALIBRATION_POINTS: GazePoint[];DEFAULT_RECALIBRATION_POINTS· const · no guide
declare const DEFAULT_RECALIBRATION_POINTS: GazePoint[];FORWARDED_CODEC_EVENTS· const · On-device (real time)
declare const FORWARDED_CODEC_EVENTS: readonly string[];STARTUP_MESSAGES· const · On-device (real time)
declare const STARTUP_MESSAGES: Readonly<Record<StartupLocale, Readonly<Record<StartupMessageKey, string>>>>;STARTUP_MESSAGE_KEYS· const · On-device (real time)
declare const STARTUP_MESSAGE_KEYS: readonly StartupMessageKey[];STARTUP_STAGES· const · On-device (real time)
declare const STARTUP_STAGES: readonly StartupStage[];STARTUP_SUB_STAGES· const · On-device (real time)
declare const STARTUP_SUB_STAGES: readonly StartupSubStage[];STT_BLOCKERS· const · On-device (real time)
declare const STT_BLOCKERS: readonly ["no-webgpu", "ladder-exhausted", "video-cost-veto", "no-memory-to-learn", "dtype-required"];
Re-exports
Section titled “Re-exports”FeatureMeta· re-exported from@neurologyca/kodecLiveLandmarks· re-exported from@neurologyca/kodecLiveSignals· re-exported from@neurologyca/kodeckodec· re-exported from@neurologyca/kodec
@neurologyca/capture/record
Section titled “@neurologyca/capture/record”Functions
Section titled “Functions”abandonUpload· function · Deferred (server-side)
declare function abandonUpload(captureId: string, opts: AbandonUploadOptions): Promise<void>;createRecordingClient· function · Deferred (server-side)
declare function createRecordingClient(config: RecordingClientConfig): RecordingClientHandle;defineTenantConfig· function · On-device (real time)
declare function defineTenantConfig(config: TenantConfig): TenantConfig;describeStep· function · Steps and marking
declare function describeStep(step: PlanStep, opts?: { lang?: string; }): StepFacts;listPendingRecordings· function · Deferred (server-side)
declare function listPendingRecordings(opts?: ListPendingRecordingsOptions): Promise<RecordingResult[]>;uploadRecording· function · Deferred (server-side)
declare function uploadRecording(rec: RecordingResult, opts: UploadRecordingOptions): Promise<UploadRecordingResult>;urlTokenProvider· function · On-device (real time)
declare function urlTokenProvider(tokenUrl: string, opts?: { method?: 'GET' | 'POST'; timeoutMs?: number; credentials?: RequestCredentials; }): TokenProvider;validateManifest· function · Deferred (server-side)
declare function validateManifest(m: RecordingManifest, opts?: { durationMs?: number | null; }): string[];
Classes
Section titled “Classes”AnalysisFailedError· class · Errors, warnings and retries
declare class AnalysisFailedError extends ProtocolUsageErrorCadenceError· class · Errors, warnings and retries
declare class CadenceError extends ProtocolUsageErrorCaptureAbortedError· class · Errors, warnings and retries
declare class CaptureAbortedError extends ProtocolUsageErrorCaptureIdInUseError· class · Errors, warnings and retries
declare class CaptureIdInUseError extends ProtocolUsageErrorCaptureStartError· class · Errors, warnings and retries
declare class CaptureStartError extends ProtocolUsageErrorFlowUnsupportedError· class · Errors, warnings and retries
declare class FlowUnsupportedError extends ProtocolUsageErrorHttpError· class · Errors, warnings and retries
declare class HttpError extends ErrorMediaUnknownError· class · Errors, warnings and retries
declare class MediaUnknownError extends ProtocolUsageErrorPlanIncompleteError· class · Errors, warnings and retries
declare class PlanIncompleteError extends ProtocolUsageErrorPrepareError· class · Errors, warnings and retries
declare class PrepareError extends ProtocolUsageErrorProtocolConflictError· class · Errors, warnings and retries
declare class ProtocolConflictError extends Error implements ProtocolErrorProtocolUsageError· class · Errors, warnings and retries
declare abstract class ProtocolUsageError extends ErrorRecorderUnsupportedError· class · Errors, warnings and retries
declare class RecorderUnsupportedError extends ProtocolUsageErrorRecordingLostError· class · Errors, warnings and retries
declare class RecordingLostError extends ProtocolUsageErrorSessionDirtyError· class · Errors, warnings and retries
declare class SessionDirtyError extends ProtocolUsageErrorStepDurationError· class · Errors, warnings and retries
declare class StepDurationError extends ProtocolUsageErrorStepSequenceError· class · Errors, warnings and retries
declare class StepSequenceError extends ProtocolUsageErrorStorageFullError· class · Errors, warnings and retries
declare class StorageFullError extends ProtocolUsageErrorTaxonomyInvalidError· class · Errors, warnings and retries
declare class TaxonomyInvalidError extends ProtocolUsageErrorUnknownOptionError· class · Errors, warnings and retries
declare class UnknownOptionError extends ProtocolUsageErrorUploadRecordingError· class · Errors, warnings and retries
declare class UploadRecordingError extends Error
Interfaces
Section titled “Interfaces”AbandonUploadOptions· interface · Deferred (server-side)
interface AbandonUploadOptions
members:credentials·headers·signal·urlAnalyzeAnswer· interface · Errors, warnings and retries
interface AnalyzeAnswer
members:fromCache·inProgress·interpretation·raw·retryAfterMsBaseline2Info· interface · Baseline
interface Baseline2Info
members:expiryDays·isValid·lastUpdatedAtCalibrateOptions· interface · no guide
interface CalibrateOptions
members:managedBySdk·onNotice·onTarget·points·signalCalibrationReport· interface · no guide
interface CalibrationReport
members:attempts·centered·endedAt·gainY·offset·ok·points·quality·reason·repeatedFor·samples·startedAt·warningsCalibrationTarget· interface · no guide
interface CalibrationTarget
members:index·phase·total·x·yCaptureOutcome· interface · HCIs and results
interface CaptureOutcome
members:frameCount·hcis·hcisByStep·interpretation·status·structuredCaptureProtocolOpts· interface · On-device (real time)
interface CaptureProtocolOpts
members:captureId·dangerouslyIgnoreCadence·discardPending·gaze·interpretation·mediaClock·onStarted·protocolMechanicId·signal·sleepBand·source·taxonomy·transcribe·triggerAnalysis·userProtocolIdConflictDetail· interface · Errors, warnings and retries
interface ConflictDetail
members:captureId·capturedAt·earliestAt·expected·expired·goToPosition·hint·holder·latestAnalysedAt·raw·reason·ruleDeviceCheck· interface · On-device (real time)
interface DeviceCheck
members:id·measured·reason·statusEngineToken· interface · On-device (real time)
interface EngineToken
members:expiresAt·tokenFrameGaze· interface · no guide
interface FrameGaze
members:isFixating·point·region·spread·stimulusGazeFrame· interface · no guide
interface GazeFrame
members:clientTsMs·featuresMeta·headPose·landmarksGazePoint· interface · no guide
interface GazePoint
members:x·yGazeSample· interface · no guide
interface GazeSample
members:fixating·point·region·spread·tMsGazeTracker· interface · no guide
interface GazeTracker
members:calibrate·calibrated·forFrame·history·last·push·recalibrate·setGlasses·setStimulusListPendingRecordingsOptions· interface · Deferred (server-side)
interface ListPendingRecordingsOptions
members:onWarningManifestStep· interface · Steps and marking
interface ManifestStep
members:endMediaMs·endedBy·mediaPid·order·startMediaMs·typeModeDecision· interface · On-device (real time)
interface ModeDecision
members:by·mode·probeFps·reasonPlanStep· interface · Steps and marking
interface PlanStep
members:category·delivery·description·expectsSpeech·maxTimeSeconds·media·minTimeSeconds·optional·order·phases·presentationSeconds·rounds·targetConstellationHciId·typePositionHolder· interface · On-device (real time)
interface PositionHolder
members:captureId·capturedAt·deferred·finished·receivingPackets·recordingEndedAtPositionState· interface · On-device (real time)
interface PositionState
members:completed·mechanicName·position·protocolMechanicIdPrepareCacheStatus· interface · On-device (real time)
interface PrepareCacheStatus
members:faceModel·speechWeights·sttLibrary·sttRuntime·visionRuntimePrepareResult· interface · On-device (real time)
interface PrepareResult
members:cache·capture·cutBy·device·estimatedSpeechMs·face·level·messageKey·outcome·partialReason·report·stages·transcription·transcriptionGate·userMessagePreparedBlock· interface · On-device (real time)
interface PreparedBlock
members:face·faceReloaded·level·origin·prepareId·speechProtocolError· interface · Errors, warnings and retries
interface ProtocolError
members:code·conflict·message·reason·recoverable·stepOrderProtocolPlan· interface · Steps and marking
interface ProtocolPlan
members:flowMode·mechanicName·position·steps·timeBetweenSessionsSecondsProtocolSessionHandle· interface · On-device (real time)
interface ProtocolSessionHandle
members:abort·captureId·correlationId·plan·step·stepTiming·stopProtocolState· interface · On-device (real time)
interface ProtocolState
members:asOf·availability·baselineWarning·next·positions·progressProtocolStepHandle· interface · Steps and marking
interface ProtocolStepHandle
members:end·run·startProtocolWarningEvent· interface · Errors, warnings and retries
interface ProtocolWarningEvent
members:blocker·captureId·code·cut·fields·hci·message·messageKey·part·reason·stage·stepOrder·subStage·userMessageRecalibrateOptions· interface · no guide
interface RecalibrateOptions
members:correct·onTarget·points·signalRecalibrationPoint· interface · no guide
interface RecalibrationPoint
members:deviation·dx·dy·measured·samples·targetRecalibrationReport· interface · no guide
interface RecalibrationReport
members:corrected·endedAt·glasses·meanDeviation·offsetAfter·offsetBefore·points·startedAtRecordingClientConfig· interface · Deferred (server-side)
interface RecordingClientConfig
members:analyzeTimeoutMs·baseUrl·credentials·getToken·onError·onRecording·onStartupStage·onWarning·recording·requestTimeoutMs·startup·stepDurations·taxonomy·tenantRecordingClientHandle· interface · Deferred (server-side)
interface RecordingClientHandle
members:analyze·captureProtocol·getBaselineInfo·getProtocolState·prepare·release·retrieveResultsRecordingManifest· interface · Deferred (server-side)
interface RecordingManifest
members:audioGaps·captureId·client·hidden·interpreted·orientation·orientationChanges·prerollMs·protocolMechanicId·recorder·recordingStartedAtMs·recordingStartedAtPrecisionMs·serverClockSkewMs·steps·stimulus·stopMediaMs·triggerAnalysis·userProtocolId·version·videoGapsRecordingOptions· interface · Deferred (server-side)
interface RecordingOptions
members:handheld·maxFps·postrollMs·prerollMs·reserve·videoBitsPerSecondRecordingPrepareOptions· interface · Deferred (server-side)
interface RecordingPrepareOptions
members:signal·throwOnFailure·timeoutsRecordingResult· interface · Deferred (server-side)
interface RecordingResult
members:blob·manifest·release·storageRecordingSessionHandle· interface · Deferred (server-side)
interface RecordingSessionHandle extends Omit<ProtocolSessionHandle, 'stop'>
members:result·stop·trackStimulus·abort·captureId·correlationId·plan·step·stepTiming·stopStartupOptions· interface · On-device (real time)
interface StartupOptions
members:includeUserAgent·locale·messages·report·timeoutsStartupReport· interface · On-device (real time)
interface StartupReport
members:at·capture·context·cutBy·device·estimatedSpeechMs·kept·kind·kodecVersion·learned·level·mode·outcome·partialReason·prepared·schema·sdkVersion·seq·stages·startupId·totalMs·transcription·transcriptionGate·uaVersionToken·userAgentStartupReportOptions· interface · On-device (real time)
interface StartupReportOptions
members:context·on·urlStartupStageEvent· interface · On-device (real time)
interface StartupStageEvent
members:blocker·bytes·bytesPerSec·kind·messageKey·ms·parent·pending·reason·source·stage·startupId·status·total·userMessageStartupStageRecord· interface · On-device (real time)
interface StartupStageRecord
members:blocker·bytes·ms·parent·pending·reason·source·stage·status·totalStartupTimeoutGroup· interface · On-device (real time)
interface StartupTimeoutGroup
members:stallMs·totalMsStepFacts· interface · Steps and marking
interface StepFacts
members:assets·bands·deliveryMode·expectsSpeech·maxSeconds·minSeconds·optional·order·phases·responseClock·rounds·text·texts·type·unknownStepMedia· interface · Steps and marking
interface StepMedia
members:body·kind·location·pidStepPhase· interface · Steps and marking
interface StepPhase
members:mediaPid·order·phase·secondsStepRunOpts· interface · Steps and marking
interface StepRunOpts extends StepStartOpts
members:durationMs·mediaPidStepStartOpts· interface · Steps and marking
interface StepStartOpts
members:mediaPidStepTiming· interface · Steps and marking
interface StepTiming
members:elapsedMs·maxMs·maxReached·minMs·minReached·order·remainingMsStimulusSample· interface · Steps and marking
interface StimulusSample
members:atMediaMs·event·stimulusTimeMsTaxonomy2· interface · On-device (real time)
interface Taxonomy2
members:contextId·hciId·situationId·subcontextIdTenantConfig· interface · On-device (real time)
interface TenantConfig
members:batchMs·engineBaseUrl·fps·taxonomy·transcribe·transcribeStepsTranscribeConfig· interface · On-device (real time)
interface TranscribeConfig
members:allowWasmWorker·device·diarization·dtype·language·minAvgLogprob·model·progress·repetitionLoop·selfHost·sileroVad·transformers·vadUploadRecordingOptions· interface · Deferred (server-side)
interface UploadRecordingOptions
members:credentials·headers·onProgress·onWarning·retries·signal·urlUploadRecordingResult· interface · Deferred (server-side)
interface UploadRecordingResult
members:captureId·released·size
Availability· type · On-device (real time)
type Availability = { canCapture: true; } | { canCapture: false; reason: 'cadence'; availableAt: Date; } | { canCapture: false; reason: 'cadence-unknown'; } | { canCapture: false; reason: 'dirty'; since: Date; } | { canCapture: false; reason: 'complete'; };CacheState· type · On-device (real time)
type CacheState = 'cached' | 'not-cached' | 'unknown';CalibrationNotice· type · no guide
type CalibrationNotice = { kind: 'instructions'; } | { kind: 'repeat'; reasons: CalibrationWarning[]; attempt: number; };CalibrationWarning· type · no guide
type CalibrationWarning = 'low-frame-rate' | 'weak-vertical-signal' | 'glasses' | 'head-moved';CaptureSource· type · On-device (real time)
type CaptureSource = { type: 'webcam'; } | { type: 'video'; el: HTMLVideoElement; } | { type: 'stream'; stream: MediaStream; } | { type: 'frames'; };CaptureStartReason· type · Errors, warnings and retries
type CaptureStartReason = 'timeout' | 'error' | 'paused' | 'metadata';CaptureStartStage· type · Errors, warnings and retries
type CaptureStartStage = 'camera' | 'face-model' | 'first-frame' | 'source';CaptureStartSubStage· type · Errors, warnings and retries
type CaptureStartSubStage = 'vision-runtime' | 'face-asset' | 'vision-create';ConflictReason· type · Errors, warnings and retries
type ConflictReason = (typeof CONFLICT_REASONS)[number];ConflictRule· type · Errors, warnings and retries
type ConflictRule = 'date_window' | 'time_of_day' | 'spacing' | 'start_order' | 'start_weekday';ConflictWarning· type · Errors, warnings and retries
type ConflictWarning = (typeof CONFLICT_WARNINGS)[number];DeviceCheckId· type · On-device (real time)
type DeviceCheckId = 'secure-context' | 'get-user-media' | 'capture-route' | 'webgpu-adapter' | 'jspi' | 'wasm-simd' | 'audio-worklet' | 'storage-persisted' | 'media-recorder-mp4' | 'indexeddb' | 'storage-quota';HciMeans· type · HCIs and results
type HciMeans = Record<string, number>;InterpretationMode· type · On-device (real time)
type InterpretationMode = 'engine' | 'stream';PartialReason· type · On-device (real time)
type PartialReason = 'speech-timeout' | 'speech-error' | 'speech-unavailable' | 'speech-not-prepared' | 'speech-gate-timeout';PrepareErrorReason· type · Errors, warnings and retries
type PrepareErrorReason = 'failed' | 'aborted' | 'capture-in-progress';PrepareLevel· type · On-device (real time)
type PrepareLevel = 'memory' | 'cache';PreparedOrigin· type · On-device (real time)
type PreparedOrigin = 'prepare' | 'previous-session';PreparedPartUse· type · On-device (real time)
type PreparedPartUse = 'adopted' | 'stale' | 'unused' | 'not-prepared';ProtocolErrorCode· type · Errors, warnings and retries
type ProtocolErrorCode = 'E_HTTP' | 'E_RESULTS_TIMEOUT' | 'E_RESULTS_EMPTY' | 'E_INTERPRETATION_TIMEOUT' | 'E_ANALYSIS_IN_PROGRESS' | 'E_PROCESSING' | 'E_FRAMES_DISCARDED' | 'E_UPLOAD_FAILED' | 'E_STEP_LOST' | 'E_CAPTURE_LOST' | 'E_RECORDING_LOST' | 'E_AXES_MISSING' | 'E_NARRATIVE_REJECTED' | 'E_TAXONOMY_REJECTED' | 'E_TENANT_UNKNOWN' | 'E_ANALYSIS_FAILED' | 'E_CONFLICT';StartupFailReason· type · On-device (real time)
type StartupFailReason = 'timeout' | 'network' | 'aborted' | 'refused' | 'unsupported' | 'error';StartupLocale· type · On-device (real time)
type StartupLocale = 'es' | 'en';StartupMessageKey· type · On-device (real time)
type StartupMessageKey = 'startup.preparing' | 'face-model.running' | 'face-model.cached' | 'speech.running' | 'speech.stalled' | 'speech.timeout' | 'speech.unavailable' | 'face-model.stalled' | 'face-model.timeout' | 'face-model.error' | 'first-frame.timeout' | 'first-frame.timeout-media' | 'first-frame.face-reload-failed' | 'camera.timeout' | 'capture.aborted' | 'startup.ready' | 'prepare.speech-timeout' | 'prepare.speech-error' | 'prepare.aborted' | 'prepare.record-unsupported';StartupOutcome· type · On-device (real time)
type StartupOutcome = 'ready' | 'partial' | 'failed' | 'aborted' | 'unfinished';StartupStage· type · On-device (real time)
type StartupStage = 'engine-setup' | 'device' | 'camera' | 'face-model' | 'first-frame' | 'speech' | 'engine-session';StartupStagePending· type · On-device (real time)
type StartupStagePending = 'provisional-video-veto' | 'another-load';StartupStageStatus· type · On-device (real time)
type StartupStageStatus = 'pending' | 'running' | 'stalled' | 'done' | 'failed' | 'skipped';StartupSubStage· type · On-device (real time)
type StartupSubStage = 'vision-runtime' | 'face-asset' | 'vision-create' | 'stt-library' | 'stt-weights' | 'stt-runtime' | 'stt-session' | 'vad';StepDelivery· type · On-device (real time)
type StepDelivery = { response_clock?: string; mode?: string; } & Record<string, unknown>;StepDurationsMode· type · Steps and marking
type StepDurationsMode = 'warn' | 'enforce' | 'off';StimulusElement· type · no guide
type StimulusElement = HTMLVideoElement | HTMLImageElement;SttBlocker· type · On-device (real time)
type SttBlocker = (typeof STT_BLOCKERS)[number];TokenProvider· type · On-device (real time)
type TokenProvider = () => Promise<EngineToken>;UploadRecordingErrorCode· type · Errors, warnings and retries
type UploadRecordingErrorCode = 'E_UPLOAD_NETWORK' | 'E_UPLOAD_NOT_NOTIFIED' | 'E_UPLOAD_AUTH' | 'E_UPLOAD_REJECTED' | 'E_UPLOAD_CONFLICT' | 'E_UPLOAD_TOO_LARGE' | 'E_UPLOAD_LOCAL_UNREADABLE' | 'E_UPLOAD_PROTOCOL' | 'E_UPLOAD_ABORTED';
Constants
Section titled “Constants”CONFLICT_REASONS· const · Errors, warnings and retries
declare const CONFLICT_REASONS: readonly ["SESSION_ABANDONED", "POSITION_ALREADY_COMPLETED", "MECHANIC_EXPIRED", "MECHANIC_NOT_YET_AVAILABLE", "MUST_START_AT_FIRST_POSITION", "PROTOCOL_DEPRECATED", "POSITION_RESERVED", "CAPTURE_DISCARDED", "CAPTURE_OUT_OF_ORDER", "PROTOCOL_NOT_ANALYSED", "CAPTURE_CANCELLED"];CONFLICT_WARNINGS· const · Errors, warnings and retries
declare const CONFLICT_WARNINGS: readonly ["conflict.unknown-reason", "conflict.ambiguous-goto", "conflict.earliestAt-assumed-utc"];STARTUP_MESSAGES· const · On-device (real time)
declare const STARTUP_MESSAGES: Readonly<Record<StartupLocale, Readonly<Record<StartupMessageKey, string>>>>;STARTUP_MESSAGE_KEYS· const · On-device (real time)
declare const STARTUP_MESSAGE_KEYS: readonly StartupMessageKey[];STARTUP_STAGES· const · On-device (real time)
declare const STARTUP_STAGES: readonly StartupStage[];STARTUP_SUB_STAGES· const · On-device (real time)
declare const STARTUP_SUB_STAGES: readonly StartupSubStage[];
@neurologyca/capture/helpers
Section titled “@neurologyca/capture/helpers”Functions
Section titled “Functions”classifyMediaError· function · Steps and marking
declare function classifyMediaError(e: unknown, env?: { isSecureContext?: boolean; hasMediaDevices?: boolean; }): MediaProblem | null;guardUnload· function · Steps and marking
declare function guardUnload(isUnsafe?: () => boolean): () => void;keepScreenOn· function · Steps and marking
declare function keepScreenOn(): Promise<{ supported: boolean; release(): void; }>;readScoreIndex· function · HCIs and results
declare function readScoreIndex(structured: unknown, key?: ScoreIndexKey, opts?: ReadScoreIndexOptions): ScoreIndex | null;startOrAsk· function · Steps and marking
declare function startOrAsk<T>(start: (discardPending: boolean) => Promise<T>, ask: (holder: PositionHolder | null) => Promise<boolean>): Promise<T | null>;waitForPortraitOrientation· function · Steps and marking
declare function waitForPortraitOrientation(opts?: { handheld?: boolean; signal?: AbortSignal; }): Promise<{ handheld: boolean | null; waited: boolean; }>;
Interfaces
Section titled “Interfaces”PositionHolder· interface · On-device (real time)
interface PositionHolder
members:captureId·capturedAt·deferred·finished·receivingPackets·recordingEndedAtReadScoreIndexOptions· interface · HCIs and results
interface ReadScoreIndexOptions
members:onWarning·onWarningScoreIndex· interface · HCIs and results
interface ScoreIndex
members:band·degradedSignals·indicatorsUsed·label·status·value·band·degradedSignals·indicatorsUsed·label·status·value
MediaProblem· type · Steps and marking
type MediaProblem = 'denied' | 'no-device' | 'in-use' | 'constraints' | 'insecure-context' | 'no-frames' | 'recorder-unsupported' | 'model-load';ScoreIndexKey· type · HCIs and results
type ScoreIndexKey = 'wellness_index' | (string & {});ScoreIndexStatus· type · HCIs and results
type ScoreIndexStatus = 'ok' | 'degraded' | 'not_shown';
@neurologyca/capture/replay
Section titled “@neurologyca/capture/replay”Functions
Section titled “Functions”releaseOwnReservation· function · Processing service
declare function releaseOwnReservation(c: ReleaseOwnReservationConfig, t: ReleaseOwnReservationTarget): Promise<ReleaseOwnReservationResult>;replayRecording· function · Processing service
declare function replayRecording(config: ReplayConfig, input: ReplayInput): Promise<ReplayResult>;urlTokenProvider· function · On-device (real time)
declare function urlTokenProvider(tokenUrl: string, opts?: { method?: 'GET' | 'POST'; timeoutMs?: number; credentials?: RequestCredentials; }): TokenProvider;validateManifest· function · Deferred (server-side)
declare function validateManifest(m: RecordingManifest, opts?: { durationMs?: number | null; }): string[];
Classes
Section titled “Classes”AlreadyProcessedError· class · Errors, warnings and retries
declare class AlreadyProcessedError extends ReplayErrorCaptureDiscardedError· class · Errors, warnings and retries
declare class CaptureDiscardedError extends ReplayErrorCaptureOutOfOrderError· class · Errors, warnings and retries
declare class CaptureOutOfOrderError extends ReplayErrorEmptyStepError· class · Errors, warnings and retries
declare class EmptyStepError extends ProtocolUsageErrorFlowUnsupportedError· class · Errors, warnings and retries
declare class FlowUnsupportedError extends ProtocolUsageErrorFrameRotatedError· class · Errors, warnings and retries
declare class FrameRotatedError extends ReplayErrorFramesEndedEarlyError· class · Errors, warnings and retries
declare class FramesEndedEarlyError extends ReplayErrorFramesOutOfOrderError· class · Errors, warnings and retries
declare class FramesOutOfOrderError extends ReplayErrorHttpError· class · Errors, warnings and retries
declare class HttpError extends ErrorKodecFailedError· class · Errors, warnings and retries
declare class KodecFailedError extends ReplayErrorManifestInvalidError· class · Errors, warnings and retries
declare class ManifestInvalidError extends ReplayErrorMediaUnknownError· class · Errors, warnings and retries
declare class MediaUnknownError extends ProtocolUsageErrorNoFacePrerollError· class · Errors, warnings and retries
declare class NoFacePrerollError extends ReplayErrorOwnAttemptProcessingError· class · Errors, warnings and retries
declare class OwnAttemptProcessingError extends ReplayErrorPositionBusyError· class · Errors, warnings and retries
declare class PositionBusyError extends ReplayErrorProtocolConflictError· class · Errors, warnings and retries
declare class ProtocolConflictError extends Error implements ProtocolErrorProtocolUsageError· class · Errors, warnings and retries
declare abstract class ProtocolUsageError extends ErrorReplayAbortedError· class · Errors, warnings and retries
declare class ReplayAbortedError extends ReplayErrorReplayError· class · Errors, warnings and retries
declare abstract class ReplayError extends ProtocolUsageErrorReplayPipelineError· class · Errors, warnings and retries
declare class ReplayPipelineError extends ReplayErrorSessionDirtyError· class · Errors, warnings and retries
declare class SessionDirtyError extends ProtocolUsageErrorSessionInvalidError· class · Errors, warnings and retries
declare class SessionInvalidError extends ProtocolUsageErrorStepSequenceError· class · Errors, warnings and retries
declare class StepSequenceError extends ProtocolUsageErrorTaxonomyInvalidError· class · Errors, warnings and retries
declare class TaxonomyInvalidError extends ProtocolUsageErrorUnknownOptionError· class · Errors, warnings and retries
declare class UnknownOptionError extends ProtocolUsageErrorUserBlockedError· class · Errors, warnings and retries
declare class UserBlockedError extends ReplayErrorUserGoneError· class · Errors, warnings and retries
declare class UserGoneError extends ReplayError
Interfaces
Section titled “Interfaces”CaptureQualitySummary· interface · HCIs and results
interface CaptureQualitySummary
members:capture·delegate·droppedTotal·fps·maxFps·minFps·windowsConflictDetail· interface · Errors, warnings and retries
interface ConflictDetail
members:captureId·capturedAt·earliestAt·expected·expired·goToPosition·hint·holder·latestAnalysedAt·raw·reason·ruleDeviceCheck· interface · On-device (real time)
interface DeviceCheck
members:id·measured·reason·statusEngineToken· interface · On-device (real time)
interface EngineToken
members:expiresAt·tokenFrameClockStats· interface · On-device (real time)
interface FrameClockStats
members:head·iqr·max·mean·min·n·overflow·p25·p50·p75·saturated·slopeMsPerSec·tail·underflowManifestStep· interface · Steps and marking
interface ManifestStep
members:endMediaMs·endedBy·mediaPid·order·startMediaMs·typeModeDecision· interface · On-device (real time)
interface ModeDecision
members:by·mode·probeFps·reasonModelDownload· interface · On-device (real time)
interface ModelDownload
members:files·filesDone·loadedBytes·totalBytes·totalKnownOwnReleaseError· interface · Errors, warnings and retries
interface OwnReleaseError
members:code·messagePositionHolder· interface · On-device (real time)
interface PositionHolder
members:captureId·capturedAt·deferred·finished·receivingPackets·recordingEndedAtPreparedBlock· interface · On-device (real time)
interface PreparedBlock
members:face·faceReloaded·level·origin·prepareId·speechProtocolError· interface · Errors, warnings and retries
interface ProtocolError
members:code·conflict·message·reason·recoverable·stepOrderProtocolResultEvent· interface · HCIs and results
interface ProtocolResultEvent
members:frameCount·hcis·hcisByStep·protocolMechanicId·raw·userProtocolIdProtocolWarningEvent· interface · Errors, warnings and retries
interface ProtocolWarningEvent
members:blocker·captureId·code·cut·fields·hci·message·messageKey·part·reason·stage·stepOrder·subStage·userMessageRecordingManifest· interface · Deferred (server-side)
interface RecordingManifest
members:audioGaps·captureId·client·hidden·interpreted·orientation·orientationChanges·prerollMs·protocolMechanicId·recorder·recordingStartedAtMs·recordingStartedAtPrecisionMs·serverClockSkewMs·steps·stimulus·stopMediaMs·triggerAnalysis·userProtocolId·version·videoGapsReleaseOwnReservationConfig· interface · Processing service
interface ReleaseOwnReservationConfig
members:engineBaseUrl·getTokenReleaseOwnReservationResult· interface · Processing service
interface ReleaseOwnReservationResult
members:error·reason·releasedReleaseOwnReservationTarget· interface · Processing service
interface ReleaseOwnReservationTarget
members:captureId·protocolMechanicId·userProtocolIdReplayConfig· interface · Processing service
interface ReplayConfig
members:awaitInterpretation·engineBaseUrl·getToken·onError·onWarning·outcomeDeadlineMs·stepDeadlineMs·sttFlushDeadlineMs·taxonomy·tokenUrl·transcribeStepsReplayInput· interface · Processing service
interface ReplayInput
members:durationMs·frames·kodec·manifest·ptsOffsetMs·signal·transcriptReplayKodecOptions· interface · Processing service
interface ReplayKodecOptions
members:delegate·faceModel·visionUrl·wasmUrlReplayReport· interface · Processing service
interface ReplayReport
members:cost·origin·outsideSteps·steps·transcriptionReplayResult· interface · Processing service
interface ReplayResult
members:captureId·report·resultsReplaySegment· interface · Processing service
interface ReplaySegment
members:endMs·startMs·textReplayTranscript· interface · Processing service
interface ReplayTranscript
members:language·model·segmentsSessionReport· interface · HCIs and results
interface SessionReport
members:alignmentMisses·cancel·captureId·captureQuality·clock·codecErrors·correlationId·endedBy·finalGapWaitMs·framesBeforeFirstPacket·hiddenMs·interpretationMode·interpretationSource·kodecSessionId·modelDownload·replay·speech·startup·steps·streamDropsDuringWait·transcription·transcriptionLoad·transcriptionSetup·triggerAnalysisSpeechSlice· interface · On-device (real time)
interface SpeechSlice
members:endMs·language·spokenMs·startMs·step·sttModel·textStartupReport· interface · On-device (real time)
interface StartupReport
members:at·capture·context·cutBy·device·estimatedSpeechMs·kept·kind·kodecVersion·learned·level·mode·outcome·partialReason·prepared·schema·sdkVersion·seq·stages·startupId·totalMs·transcription·transcriptionGate·uaVersionToken·userAgentStartupStageRecord· interface · On-device (real time)
interface StartupStageRecord
members:blocker·bytes·ms·parent·pending·reason·source·stage·status·totalStepTranscription· interface · On-device (real time)
interface StepTranscription
members:cutsMaxLength·discarded·discardedAntiStuckMs·discardedMs·emitted·order·recoveredMs·retriedSplit·spokenMs·transcribed·typeStimulusSample· interface · Steps and marking
interface StimulusSample
members:atMediaMs·event·stimulusTimeMsTaxonomy2· interface · On-device (real time)
interface Taxonomy2
members:contextId·hciId·situationId·subcontextIdTranscriptionSetup· interface · On-device (real time)
interface TranscriptionSetup
members:artifact·backend·deviceFellBackFrom·diarization·dtype·language·languageSource·model·modelReason·provisionalVetoLifted·sileroReady·usesWorker
ConflictReason· type · Errors, warnings and retries
type ConflictReason = (typeof CONFLICT_REASONS)[number];ConflictRule· type · Errors, warnings and retries
type ConflictRule = 'date_window' | 'time_of_day' | 'spacing' | 'start_order' | 'start_weekday';ConflictWarning· type · Errors, warnings and retries
type ConflictWarning = (typeof CONFLICT_WARNINGS)[number];DeviceCheckId· type · On-device (real time)
type DeviceCheckId = 'secure-context' | 'get-user-media' | 'capture-route' | 'webgpu-adapter' | 'jspi' | 'wasm-simd' | 'audio-worklet' | 'storage-persisted' | 'media-recorder-mp4' | 'indexeddb' | 'storage-quota';HciMeans· type · HCIs and results
type HciMeans = Record<string, number>;InterpretationMode· type · On-device (real time)
type InterpretationMode = 'engine' | 'stream';InterpretationSource· type · HCIs and results
type InterpretationSource = 'sse' | 'analyze-cache' | 'analyze-generated' | 'analyze' | 'stream';OwnReleaseReason· type · Errors, warnings and retries
type OwnReleaseReason = 'cancelled' | 'nothing-open' | 'not-ours' | 'not-sending' | 'check-failed' | 'cancel-failed';PartialReason· type · On-device (real time)
type PartialReason = 'speech-timeout' | 'speech-error' | 'speech-unavailable' | 'speech-not-prepared' | 'speech-gate-timeout';PrepareLevel· type · On-device (real time)
type PrepareLevel = 'memory' | 'cache';PreparedOrigin· type · On-device (real time)
type PreparedOrigin = 'prepare' | 'previous-session';PreparedPartUse· type · On-device (real time)
type PreparedPartUse = 'adopted' | 'stale' | 'unused' | 'not-prepared';ProtocolErrorCode· type · Errors, warnings and retries
type ProtocolErrorCode = 'E_HTTP' | 'E_RESULTS_TIMEOUT' | 'E_RESULTS_EMPTY' | 'E_INTERPRETATION_TIMEOUT' | 'E_ANALYSIS_IN_PROGRESS' | 'E_PROCESSING' | 'E_FRAMES_DISCARDED' | 'E_UPLOAD_FAILED' | 'E_STEP_LOST' | 'E_CAPTURE_LOST' | 'E_RECORDING_LOST' | 'E_AXES_MISSING' | 'E_NARRATIVE_REJECTED' | 'E_TAXONOMY_REJECTED' | 'E_TENANT_UNKNOWN' | 'E_ANALYSIS_FAILED' | 'E_CONFLICT';StartupFailReason· type · On-device (real time)
type StartupFailReason = 'timeout' | 'network' | 'aborted' | 'refused' | 'unsupported' | 'error';StartupMessageKey· type · On-device (real time)
type StartupMessageKey = 'startup.preparing' | 'face-model.running' | 'face-model.cached' | 'speech.running' | 'speech.stalled' | 'speech.timeout' | 'speech.unavailable' | 'face-model.stalled' | 'face-model.timeout' | 'face-model.error' | 'first-frame.timeout' | 'first-frame.timeout-media' | 'first-frame.face-reload-failed' | 'camera.timeout' | 'capture.aborted' | 'startup.ready' | 'prepare.speech-timeout' | 'prepare.speech-error' | 'prepare.aborted' | 'prepare.record-unsupported';StartupOutcome· type · On-device (real time)
type StartupOutcome = 'ready' | 'partial' | 'failed' | 'aborted' | 'unfinished';StartupStage· type · On-device (real time)
type StartupStage = 'engine-setup' | 'device' | 'camera' | 'face-model' | 'first-frame' | 'speech' | 'engine-session';StartupStagePending· type · On-device (real time)
type StartupStagePending = 'provisional-video-veto' | 'another-load';StartupStageStatus· type · On-device (real time)
type StartupStageStatus = 'pending' | 'running' | 'stalled' | 'done' | 'failed' | 'skipped';StartupSubStage· type · On-device (real time)
type StartupSubStage = 'vision-runtime' | 'face-asset' | 'vision-create' | 'stt-library' | 'stt-weights' | 'stt-runtime' | 'stt-session' | 'vad';SttBlocker· type · On-device (real time)
type SttBlocker = (typeof STT_BLOCKERS)[number];TokenProvider· type · On-device (real time)
type TokenProvider = () => Promise<EngineToken>;TranscriptionCut· type · On-device (real time)
type TranscriptionCut = unknown;
Constants
Section titled “Constants”CONFLICT_REASONS· const · Errors, warnings and retries
declare const CONFLICT_REASONS: readonly ["SESSION_ABANDONED", "POSITION_ALREADY_COMPLETED", "MECHANIC_EXPIRED", "MECHANIC_NOT_YET_AVAILABLE", "MUST_START_AT_FIRST_POSITION", "PROTOCOL_DEPRECATED", "POSITION_RESERVED", "CAPTURE_DISCARDED", "CAPTURE_OUT_OF_ORDER", "PROTOCOL_NOT_ANALYSED", "CAPTURE_CANCELLED"];CONFLICT_WARNINGS· const · Errors, warnings and retries
declare const CONFLICT_WARNINGS: readonly ["conflict.unknown-reason", "conflict.ambiguous-goto", "conflict.earliestAt-assumed-utc"];REPLAY_MAX_BUFFERED· const · Processing service
declare const REPLAY_MAX_BUFFERED = 600;REPLAY_OUTCOME_DEADLINE_MS· const · Processing service
declare const REPLAY_OUTCOME_DEADLINE_MS = 600000;REPLAY_STEP_DEADLINE_MS· const · Processing service
declare const REPLAY_STEP_DEADLINE_MS = 150000;STT_BLOCKERS· const · On-device (real time)
declare const STT_BLOCKERS: readonly ["no-webgpu", "ladder-exhausted", "video-cost-veto", "no-memory-to-learn", "dtype-required"];
@neurologyca/capture-server
Section titled “@neurologyca/capture-server”Functions
Section titled “Functions”analyze· function · Results in your backend
declare function analyze(http: Http, ref: Pick<AnalysisRef, 'userProtocolId' | 'protocolMechanicId'>, opts?: AnalyzeOptions): Promise<AnalyzeResult>;analyzeForAudiences· function · Results in your backend
declare function analyzeForAudiences(http: Http, ref: AnalysisRef, audiences: readonly [string, ...string[]], opts?: AnalyzeForAudiencesOptions): Promise<AudienceReading[]>;assertServerEnvironment· function · Your backend
declare function assertServerEnvironment(): void;buildTenantKit· function · no guide
declare function buildTenantKit(http: Http, protocolPid: string, opts: BuildTenantKitOptions): Promise<TenantKit>;createEngineAdmin· function · Results in your backend
declare function createEngineAdmin(opts: CreateEngineAdminOptions): { createUser: (input: CreateUserInput) => Promise<AppUser>; updateUser: (externalId: string, input: UpdateUserInput) => Promise<void>; listUsers: (listOpts?: ListUsersOptions) => Promise<ListUsersResult>; deleteUser: (externalId: string) => Promise<DeleteUserResult>; listProtocolLibrary: () => Promise<ProtocolSummary[]>; enrol: (externalId: string, protocolPid: string, enrolOpts?: EnrolOptions) => Promise<{ userProtocolId: string; status: string; }>; listEnrolments: (externalId: string) => Promise<Enrolment[]>; getNextPosition: (userProtocolId: string) => Promise<NextPosition | null>; getResults: (ref: Pick<AnalysisRef, "userProtocolId" | "protocolMechanicId">) => Promise<GetResultsResult>; getProtocolResults: (ref: Pick<AnalysisRef, "userProtocolId">) => Promise<GetProtocolResultsResult>; listSessions: (ref: Pick<AnalysisRef, "userProtocolId" | "protocolMechanicId">) => Promise<unknown[]>; analyze: (ref: Pick<AnalysisRef, "userProtocolId" | "protocolMechanicId">, analyzeOpts?: AnalyzeOptions) => Promise<AnalyzeResult>; analyzeForAudiences: (ref: AnalysisRef, audiences: readonly [string, ...string[]], forOpts?: AnalyzeForAudiencesOptions) => Promise<AudienceReading[]>; buildTenantKit: (protocolPid: string, kitOpts?: Omit<BuildTenantKitOptions, "engineBase">) => Promise<TenantKit>; };createEngineProxy· function · Your backend
declare function createEngineProxy(opts: CreateEngineProxyOptions): (req: Request) => Promise<Response>;createEnrolmentHandler· function · no guide
declare function createEnrolmentHandler(opts: CreateEnrolmentHandlerOptions): (req: Request) => Promise<Response>;createHttp· function · Your backend
declare function createHttp(opts: { baseUrl: string; apiKey: string; cache?: TokenCache; tokens?: TokenSource; fetch?: typeof fetch; }): { request(method: string, path: string, body?: unknown, reqOpts?: RequestOptions): Promise<unknown>; };createProcessorClient· function · Processing service
declare function createProcessorClient(opts: CreateProcessorClientOptions): ProcessorClient;createProcessorTokenHandler· function · Processing service
declare function createProcessorTokenHandler(opts: CreateProcessorTokenHandlerOptions): (req: Request) => Promise<Response>;createStartupReportReceiver· function · Your backend
declare function createStartupReportReceiver(opts: CreateStartupReportReceiverOptions): StartupReportReceiver;createTokenHandler· function · Your backend
declare function createTokenHandler(opts: CreateTokenHandlerOptions): (req: Request) => Promise<Response>;createTokenSource· function · Your backend
declare function createTokenSource(opts: CreateTokenSourceOptions): TokenSource;createUploadReceiver· function · Your backend
declare function createUploadReceiver(opts: CreateUploadReceiverOptions): UploadReceiver;createUser· function · Results in your backend
declare function createUser(http: Http, input: CreateUserInput): Promise<AppUser>;createWebhookHandler· function · Processing service
declare function createWebhookHandler(opts: CreateWebhookHandlerOptions): (req: Request) => Promise<Response>;deleteUser· function · Results in your backend
declare function deleteUser(http: Http, externalId: string): Promise<DeleteUserResult>;enrol· function · Results in your backend
declare function enrol(http: Http, externalId: string, protocolPid: string, opts?: EnrolOptions): Promise<{ userProtocolId: string; status: string; protocolNotice?: unknown; }>;getNextPosition· function · Results in your backend
declare function getNextPosition(http: Http, userProtocolId: string): Promise<NextPosition | null>;getProtocolResults· function · Results in your backend
declare function getProtocolResults(http: Http, ref: Pick<AnalysisRef, 'userProtocolId'>): Promise<GetProtocolResultsResult>;getResults· function · Results in your backend
declare function getResults(http: Http, ref: Pick<AnalysisRef, 'userProtocolId' | 'protocolMechanicId'>): Promise<GetResultsResult>;listEnrolments· function · Results in your backend
declare function listEnrolments(http: Http, externalId: string): Promise<Enrolment[]>;listProtocolLibrary· function · Results in your backend
declare function listProtocolLibrary(http: Http): Promise<ProtocolSummary[]>;listSessions· function · Results in your backend
declare function listSessions(http: Http, ref: Pick<AnalysisRef, 'userProtocolId' | 'protocolMechanicId'>): Promise<unknown[]>;listUsers· function · Results in your backend
declare function listUsers(http: Http, opts?: ListUsersOptions): Promise<ListUsersResult>;memoryNonceStore· function · Processing service
declare function memoryNonceStore(ttlMs?: number): NonceStore;ownsAll· function · Your backend
declare function ownsAll(route: EngineRoute, checks: { userProtocol: (userProtocolId: string, protocolMechanicId: string | null) => Promise<boolean>; user: (userId: string) => Promise<boolean>; }): Promise<boolean>;proxyTimeoutMs· function · Your backend
declare function proxyTimeoutMs(spec: EngineRouteSpec): number | null;readScoreIndex· function · HCIs and results
declare function readScoreIndex(structured: unknown, key?: ScoreIndexKey, opts?: ReadScoreIndexOptions): ScoreIndex | null;updateUser· function · Results in your backend
declare function updateUser(http: Http, externalId: string, input: UpdateUserInput): Promise<void>;validateNarrative· function · no guide
declare function validateNarrative(n: NarrativeInput): NarrativeValidation;verifyProcessorSignature· function · Processing service
declare function verifyProcessorSignature(headers: Headers, rawBody: Uint8Array, secret: string, nonces: NonceStore, now: number, purpose: ProcessorPurpose): Promise<SignatureVerdict>;
Classes
Section titled “Classes”EngineAdminError· class · Errors, warnings and retries
declare class EngineAdminError extends ErrorOnCompleteTimeoutError· class · Errors, warnings and retries
declare class OnCompleteTimeoutError extends ErrorProcessorError· class · Errors, warnings and retries
declare class ProcessorError extends ErrorUploadBusyError· class · Errors, warnings and retries
declare class UploadBusyError extends ErrorUploadStateError· class · Errors, warnings and retries
declare class UploadStateError extends ErrorUploadStorageError· class · Errors, warnings and retries
declare class UploadStorageError extends Error
Interfaces
Section titled “Interfaces”AnalysisRef· interface · Results in your backend
interface AnalysisRef
members:protocolMechanicId·userProtocolIdAnalyzeForAudiencesOptions· interface · Results in your backend
interface AnalyzeForAudiencesOptions
members:correlationId·onWarningAnalyzeOptions· interface · Results in your backend
interface AnalyzeOptions
members:audience·correlationId·onWarning·reAnalyzeAnalyzeResult· interface · Results in your backend
interface AnalyzeResult
members:audienceEvidence·audienceRequested·fromCache·inProgress·interpretation·keptPrevious·metadata·raw·reAnalyzed·retryAfterMs·structuredAppUser· interface · Results in your backend
interface AppUser
members:audience·createdAt·externalId·name·narrative·role·timezoneAudienceReading· interface · Results in your backend
interface AudienceReading
members:audience·fromCache·inProgress·interpretation·metadata·retryAfterMsBuildTenantKitOptions· interface · no guide
interface BuildTenantKitOptions
members:engineBase·onWarning·proxyPathCorsOptions· interface · Your backend
interface CorsOptions
members:credentials·headers·originsCreateEngineAdminOptions· interface · Results in your backend
interface CreateEngineAdminOptions
members:apiKey·baseUrl·cache·fetch·onWarning·tokensCreateEngineProxyOptions· interface · Your backend
interface CreateEngineProxyOptions
members:authorize·baseUrl·cors·fetch·maxBodyBytes·mountPath·onError·tokensCreateEnrolmentHandlerOptions· interface · no guide
interface CreateEnrolmentHandlerOptions
members:admin·getSessionUser·rateLimitCreateProcessorClientOptions· interface · Processing service
interface CreateProcessorClientOptions
members:apiKey·fetch·timeoutMs·urlCreateProcessorTokenHandlerOptions· interface · Processing service
interface CreateProcessorTokenHandlerOptions
members:authorize·captureToken·nonces·onError·secret·tokensCreateStartupReportReceiverOptions· interface · Your backend
interface CreateStartupReportReceiverOptions
members:allowedOrigins·authorize·clientKey·maxBodyBytes·maxBytes·maxPerClientPerMinute·maxPerMinute·now·onError·retentionMs·storageCreateTokenHandlerOptions· interface · Your backend
interface CreateTokenHandlerOptions
members:authorize·onError·tokensCreateTokenSourceOptions· interface · Your backend
interface CreateTokenSourceOptions
members:apiKey·baseUrl·cache·fetch·mintTimeoutMs·refreshMarginMsCreateUploadReceiverOptions· interface · Your backend
interface CreateUploadReceiverOptions
members:abandonedAfterMs·authorize·busyRetryAfterSec·checkManifest·checkManifestTimeoutMs·cors·leaseMs·lockWaitMs·maxBytes·maxOpenPerSubject·mountPath·notifyRetryAfterSec·onComplete·onCompleteTimeoutMs·onError·storage·tombstoneTtlMs·urlSecretCreateUserInput· interface · Results in your backend
interface CreateUserInput
members:allowNonUuidExternalId·audience·externalId·name·narrative·role·timezoneCreateWebhookHandlerOptions· interface · Processing service
interface CreateWebhookHandlerOptions
members:nonces·onError·onEvent·secretDeleteUserResult· interface · Results in your backend
interface DeleteUserResult
members:counts·deleted·tenantPidEngineAdmin· interface · Results in your backend
type EngineAdmin = ReturnType<typeof createEngineAdmin>;EngineRoute· interface · Your backend
interface EngineRoute
members:method·name·protocolMechanicId·userId·userProtocolIdEngineRouteSpec· interface · Your backend
interface EngineRouteSpec
members:body·idsFrom·method·name·stream·templateEnrolOptions· interface · Results in your backend
interface EnrolOptions
members:onWarningEnrolment· interface · Results in your backend
interface Enrolment
members:createdAt·progressPct·protocol·sessionsCompleted·status·totalSessions·userProtocolIdGetProtocolResultsResult· interface · Results in your backend
interface GetProtocolResultsResult
members:mechanicsGetResultsResult· interface · Results in your backend
interface GetResultsResult
members:aggResults·rawResults·speechHandlerErrorContext· interface · Your backend
interface HandlerErrorContext
members:captureId·piece·routeKitGap· interface · no guide
interface KitGap
members:candidates·field·whyListUsersOptions· interface · Results in your backend
interface ListUsersOptions
members:limitListUsersResult· interface · Results in your backend
interface ListUsersResult
members:total·usersListedUser· interface · Results in your backend
interface ListedUser
members:audience·blocked·blockedAt·createdAt·createdBy·externalId·name·protocolsAssigned·role·timezoneMechanicResults· interface · Results in your backend
interface MechanicResults extends GetResultsResult
members:order·protocolMechanicId·aggResults·rawResults·speechNarrativeInput· interface · Your backend
interface NarrativeInput
members:depth·language·voiceNextPosition· interface · Results in your backend
interface NextPosition
members:mechanicName·order·protocolMechanicId·userProtocolIdNonceStore· interface · Processing service
interface NonceStore
members:seenProcessorCallOptions· interface · Processing service
interface ProcessorCallOptions
members:signalProcessorClient· interface · Processing service
interface ProcessorClient
members:getJob·retry·submitProcessorJob· interface · Processing service
interface ProcessorJob
members:attempt·captureId·errorCode·errorMessage·interimWebhook·interpretation·jobId·outcome·processor·report·retryable·status·waits·webhookProcessorJobTaxonomy· interface · Processing service
interface ProcessorJobTaxonomy
members:contextId·hciId·subcontextIdProcessorSubmit· interface · Processing service
interface ProcessorSubmit
members:engineBaseUrl·interimWebhook·language·manifest·taxonomy·tokenUrl·transcribeSteps·videoUrl·webhookUrlProcessorTokenRequest· interface · Processing service
interface ProcessorTokenRequest
members:captureId·jobId·protocolMechanicId·userProtocolIdProcessorWebhookDelivery· interface · Processing service
interface ProcessorWebhookDelivery
members:attempts·statusProcessorWebhookEvent· interface · Processing service
interface ProcessorWebhookEvent
members:captureId·deliveryId·errorCode·errorMessage·interpretation·jobId·outcome·processor·report·retryable·statusProtocolSummary· interface · Results in your backend
interface ProtocolSummary
members:group·interpreted·name·objective·pid·positions·statusReadScoreIndexOptions· interface · HCIs and results
interface ReadScoreIndexOptions
members:onWarning·onWarningScoreIndex· interface · HCIs and results
interface ScoreIndex
members:band·degradedSignals·indicatorsUsed·label·status·value·band·degradedSignals·indicatorsUsed·label·status·valueStartupReportReceiver· interface · Your backend
interface StartupReportReceiver
members:handler·read·sweepStartupReportRecord· interface · Your backend
interface StartupReportRecord
members:receivedAt·report·unvalidatedStartupReportStorage· interface · Your backend
interface StartupReportStorage
members:append·bytes·read·sweepStepSpeech· interface · Results in your backend
interface StepSpeech
members:questionText·transcriptTenantConfigShape· interface · no guide
interface TenantConfigShape
members:batchMs·engineBaseUrl·fps·taxonomy·transcribe·transcribeStepsTenantKit· interface · no guide
interface TenantKit
members:config·env·kind·notices·pendingTokenCache· interface · Your backend
interface TokenCache
members:get·setTokenSource· interface · Your backend
interface TokenSource
members:get·invalidateUpdateUserInput· interface · Results in your backend
interface UpdateUserInput
members:audience·name·narrative·role·timezoneUploadLease· interface · Your backend
interface UploadLease
members:release·renew·tokenUploadReceiver· interface · Your backend
interface UploadReceiver
members:handler·manifest·markNotified·mediaHandler·notify·pendingNotifications·remove·signedUrl·sweepUploadState· interface · Your backend
interface UploadState
members:bytes·committed·manifest·mimeType·notified·owner·size·touchedAtUploadStorage· interface · Your backend
interface UploadStorage
members:append·commit·create·get·lease·list·markNotified·partBytes·presign·read·remove·sweepUploadTombstone· interface · Your backend
interface UploadTombstone
members:expiresAt·removedAt
AdminErrorCode· type · Errors, warnings and retries
type AdminErrorCode = 'E_ROLE_UNKNOWN' | 'E_NARRATIVE_INVALID' | 'E_PROTOCOL_DRAFT' | 'E_PROTOCOL_UNKNOWN' | 'E_USER_EXISTS' | 'E_USER_UNKNOWN' | 'E_RATE_LIMITED' | 'E_ENGINE_HTTP' | 'E_MINT_TIMEOUT' | 'E_USER_BLOCKED' | 'E_CREDENTIAL_FORBIDDEN' | 'E_PROTOCOL_BASELINE' | 'E_CONTEXT_NOT_ASSIGNED' | 'E_USER_AMBIGUOUS' | 'E_PROTOCOL_STATE_CHANGED' | 'E_KIT_NO_CONTEXT' | 'E_KIT_TAXONOMY_UNREADABLE' | 'E_AUDIENCE_KEPT_PREVIOUS' | 'E_AUDIENCE_INVALID' | 'E_PROTOCOL_DEPRECATED' | 'E_CATALOGUE_NO_PID';EngineRouteName· type · Your backend
type EngineRouteName = 'protocol' | 'plan' | 'sessions' | 'baseline-get' | 'baseline-post' | 'stream' | 'context' | 'query' | 'frames' | 'results' | 'analyze-stream' | 'analyze' | 'cancel';HandlerErrorHook· type · Your backend
type HandlerErrorHook = (error: unknown, context: HandlerErrorContext) => void;NarrativeValidation· type · no guide
type NarrativeValidation = { ok: true; } | { ok: false; field: string; got: string; allowed: string[]; };ProcessorInterpretation· type · Processing service
type ProcessorInterpretation = 'ready' | 'degraded' | 'failed' | 'timeout' | 'unknown' | 'not-requested';ProcessorJobStatus· type · Processing service
type ProcessorJobStatus = 'queued' | 'downloading' | 'preparing' | 'transcribing' | 'replaying' | 'waiting' | 'interpreting' | 'succeeded' | 'failed';ProcessorPurpose· type · Processing service
type ProcessorPurpose = 'webhook' | 'token';ProcessorWebhookStatus· type · Processing service
type ProcessorWebhookStatus = 'none' | 'pending' | 'delivered' | 'failed';ProxyCors· type · Your backend
type ProxyCors = CorsOptions;ScoreIndexKey· type · HCIs and results
type ScoreIndexKey = 'wellness_index' | (string & {});ScoreIndexStatus· type · HCIs and results
type ScoreIndexStatus = 'ok' | 'degraded' | 'not_shown';SignatureVerdict· type · Processing service
type SignatureVerdict = { ok: true; } | { ok: false; reason: 'missing' | 'malformed' | 'stale' | 'bad-signature' | 'replayed'; };SpeechByStep· type · Results in your backend
type SpeechByStep = Record<string, StepSpeech>;UploadAppendResult· type · Your backend
type UploadAppendResult = { ok: true; bytes: number; } | { ok: false; bytes: number | null; };UploadCreateResult· type · Your backend
type UploadCreateResult = { ok: true; state: UploadState; } | { ok: false; reason: 'exists' | 'quota'; state?: UploadState | UploadTombstone; };UploadInit· type · Your backend
type UploadInit = Omit<UploadState, 'bytes' | 'committed' | 'notified' | 'touchedAt'>;UploadStateCode· type · Your backend
type UploadStateCode = 'E_NOT_FOUND' | 'E_UPLOAD_GONE' | 'E_NOT_COMMITTED';
Constants
Section titled “Constants”ANALYZE_TIMEOUT_MS· const · Results in your backend
declare const ANALYZE_TIMEOUT_MS = 300000;CLOCK_TOLERANCE_MS· const · Processing service
declare const CLOCK_TOLERANCE_MS = 300000;DEFAULT_NARRATIVE· const · Your backend
declare const DEFAULT_NARRATIVE: { readonly voice: "third"; readonly depth: "professional"; readonly language: "en"; };ENGINE_ROUTES· const · Your backend
declare const ENGINE_ROUTES: readonly EngineRouteSpec[];MEASUREMENT_CONTEXT_ID· const · no guide
declare const MEASUREMENT_CONTEXT_ID = "measurement";NONCE_TTL_MS· const · Processing service
declare const NONCE_TTL_MS = 600000;PROCESSOR_ERROR_BODY_MAX_BYTES· const · Processing service
declare const PROCESSOR_ERROR_BODY_MAX_BYTES: number;PROCESSOR_TIMEOUT_MS· const · Processing service
declare const PROCESSOR_TIMEOUT_MS = 30000;PROXY_TIMEOUT_MS· const · Your backend
declare const PROXY_TIMEOUT_MS = 120000;TOKEN_BODY_MAX· const · Your backend
declare const TOKEN_BODY_MAX: number;TOKEN_CACHE_TIMEOUT_MS· const · Your backend
declare const TOKEN_CACHE_TIMEOUT_MS = 2000;TOKEN_MINT_TIMEOUT_MS· const · Your backend
declare const TOKEN_MINT_TIMEOUT_MS = 20000;WEBHOOK_BODY_MAX· const · Processing service
declare const WEBHOOK_BODY_MAX: number;
@neurologyca/capture-server/node
Section titled “@neurologyca/capture-server/node”Functions
Section titled “Functions”localDiskStartupReports· function · Your backend
declare function localDiskStartupReports(opts: LocalDiskStartupReportsOptions): StartupReportStorage;localDiskStorage· function · Your backend
declare function localDiskStorage(opts: LocalDiskStorageOptions): UploadStorage;toNodeListener· function · Your backend
declare function toNodeListener(handler: (req: Request) => Promise<Response>): (req: IncomingMessage, res: ServerResponse, next?: (err?: unknown) => void) => void;
Interfaces
Section titled “Interfaces”LocalDiskStartupReportsOptions· interface · Your backend
interface LocalDiskStartupReportsOptions
members:dir·maxFileBytesLocalDiskStorageOptions· interface · Your backend
interface LocalDiskStorageOptions
members:dir·partBytes