@adaptware/eagles-db 0.5.64 → 0.5.68
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/client/edge.js +90 -3
- package/client/index-browser.js +87 -0
- package/client/index.d.ts +6736 -2
- package/client/index.js +90 -3
- package/client/package.json +1 -1
- package/client/schema.prisma +150 -19
- package/client/wasm.js +90 -3
- package/package.json +1 -1
- package/prisma/schema/interview.prisma +13 -0
- package/prisma/schema/migrations/20260918153000_add_is_proctored_fields/migration.sql +2 -0
- package/prisma/schema/migrations/20260925200000_proctoring_drop_stitch_cols_and_unique/migration.sql +37 -0
- package/prisma/schema/migrations/20260925210000_proctoring_drop_session_candidate_id/migration.sql +3 -0
- package/prisma/schema/proctoring.prisma +118 -0
package/package.json
CHANGED
|
@@ -52,6 +52,7 @@ model Interview {
|
|
|
52
52
|
recording_url String?
|
|
53
53
|
recording_document_id String? @unique
|
|
54
54
|
evaluation_type EvaluationType? @default(TREADSPACE_AI_ASSISTED)
|
|
55
|
+
is_proctored Boolean @default(true) @map("is_proctored")
|
|
55
56
|
ai_assistance_mode AiAssistanceMode? @default(ASSISTED)
|
|
56
57
|
interview_status InterviewStatus @default(SCHEDULED)
|
|
57
58
|
interview_platform InterviewPlatform @default(TREADSPACE)
|
|
@@ -82,6 +83,13 @@ model Interview {
|
|
|
82
83
|
/// When final human feedback was submitted.
|
|
83
84
|
evaluated_at DateTime?
|
|
84
85
|
|
|
86
|
+
/// Candidate Acceptance & DPDP Consent
|
|
87
|
+
candidate_status String? @default("INVITED")
|
|
88
|
+
dpdp_consent_given Boolean @default(false)
|
|
89
|
+
dpdp_consent_given_at DateTime?
|
|
90
|
+
candidate_responded_at DateTime?
|
|
91
|
+
decline_reason String?
|
|
92
|
+
|
|
85
93
|
/// Self-scheduling
|
|
86
94
|
reschedule_count Int @default(0)
|
|
87
95
|
last_rescheduled_at DateTime?
|
|
@@ -97,6 +105,11 @@ model Interview {
|
|
|
97
105
|
created_by String
|
|
98
106
|
updated_by String
|
|
99
107
|
is_active Boolean @default(true)
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
//interview proctoring
|
|
111
|
+
proctoringSession ProctoringSession?
|
|
112
|
+
|
|
100
113
|
// Relations
|
|
101
114
|
candidate User? @relation("CandidateInterviews", fields: [candidate_id], references: [id], onDelete: SetNull)
|
|
102
115
|
interviewer User? @relation("InterviewerInterviews", fields: [interviewer_id], references: [id], onDelete: SetNull)
|
package/prisma/schema/migrations/20260925200000_proctoring_drop_stitch_cols_and_unique/migration.sql
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
-- Dedup before unique (keep earliest row per session+index)
|
|
2
|
+
DELETE FROM "proctoring_analyses" a
|
|
3
|
+
USING "proctoring_analyses" b
|
|
4
|
+
WHERE a.session_id = b.session_id
|
|
5
|
+
AND a.chunk_index = b.chunk_index
|
|
6
|
+
AND a.created_at > b.created_at;
|
|
7
|
+
|
|
8
|
+
ALTER TABLE "proctoring_sessions"
|
|
9
|
+
DROP COLUMN IF EXISTS "full_video_key",
|
|
10
|
+
DROP COLUMN IF EXISTS "full_video_url";
|
|
11
|
+
|
|
12
|
+
ALTER TABLE "proctoring_analyses"
|
|
13
|
+
DROP COLUMN IF EXISTS "total_chunks";
|
|
14
|
+
|
|
15
|
+
DROP INDEX IF EXISTS "proctoring_analyses_session_id_chunk_index_idx";
|
|
16
|
+
|
|
17
|
+
ALTER TABLE "proctoring_analyses"
|
|
18
|
+
DROP CONSTRAINT IF EXISTS "proctoring_analyses_session_id_chunk_index_key";
|
|
19
|
+
|
|
20
|
+
ALTER TABLE "proctoring_analyses"
|
|
21
|
+
ADD CONSTRAINT "proctoring_analyses_session_id_chunk_index_key"
|
|
22
|
+
UNIQUE ("session_id", "chunk_index");
|
|
23
|
+
|
|
24
|
+
ALTER TABLE "proctoring_sessions"
|
|
25
|
+
ALTER COLUMN "face_detected_pct" DROP DEFAULT,
|
|
26
|
+
ALTER COLUMN "on_screen_gaze_pct" DROP DEFAULT;
|
|
27
|
+
|
|
28
|
+
ALTER TABLE "proctoring_sessions"
|
|
29
|
+
ALTER COLUMN "face_detected_pct" DROP NOT NULL,
|
|
30
|
+
ALTER COLUMN "on_screen_gaze_pct" DROP NOT NULL;
|
|
31
|
+
|
|
32
|
+
UPDATE "proctoring_sessions"
|
|
33
|
+
SET "face_detected_pct" = NULL, "on_screen_gaze_pct" = NULL
|
|
34
|
+
WHERE "total_duration_sec" <= 0;
|
|
35
|
+
|
|
36
|
+
ALTER TABLE "proctoring_sessions"
|
|
37
|
+
ALTER COLUMN "candidate_id" DROP NOT NULL;
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
enum RiskLevel {
|
|
2
|
+
LOW
|
|
3
|
+
MEDIUM
|
|
4
|
+
HIGH
|
|
5
|
+
CRITICAL
|
|
6
|
+
|
|
7
|
+
@@schema("public")
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
enum AnalysisStatus {
|
|
11
|
+
QUEUED
|
|
12
|
+
RUNNING
|
|
13
|
+
COMPLETED
|
|
14
|
+
FAILED
|
|
15
|
+
|
|
16
|
+
@@schema("public")
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
enum ProctoringEventType {
|
|
20
|
+
GAZE_DISRUPTION
|
|
21
|
+
OBJECT_DETECTED
|
|
22
|
+
FACE_MISSING
|
|
23
|
+
MULTIPLE_FACES
|
|
24
|
+
BROWSER_TAB_SWITCH
|
|
25
|
+
BROWSER_BLUR
|
|
26
|
+
FULLSCREEN_EXIT
|
|
27
|
+
|
|
28
|
+
@@schema("public")
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
enum ProctoringSessionStatus {
|
|
32
|
+
NOT_STARTED
|
|
33
|
+
CALIBRATING
|
|
34
|
+
CALIBRATED
|
|
35
|
+
PROCESSING
|
|
36
|
+
COMPLETED
|
|
37
|
+
FAILED
|
|
38
|
+
|
|
39
|
+
@@schema("public")
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
model ProctoringSession {
|
|
43
|
+
id String @id @default(uuid()) @map("id")
|
|
44
|
+
interviewId String @unique @map("interview_id")
|
|
45
|
+
interview Interview @relation(fields: [interviewId], references: [id], onDelete: Cascade)
|
|
46
|
+
|
|
47
|
+
// Proctoring Lifecycle & Media
|
|
48
|
+
status ProctoringSessionStatus @default(NOT_STARTED) @map("status")
|
|
49
|
+
calibrationFeatures Json? @map("calibration_features")
|
|
50
|
+
chunkCount Int @default(0) @map("chunk_count")
|
|
51
|
+
completedChunks Int @default(0) @map("completed_chunks")
|
|
52
|
+
|
|
53
|
+
// High-Level Aggregated Metrics for Downstream AI Evaluation
|
|
54
|
+
overallRisk RiskLevel @default(LOW) @map("overall_risk")
|
|
55
|
+
integrityScore Float @default(100.0) @map("integrity_score")
|
|
56
|
+
|
|
57
|
+
totalDurationSec Float @default(0.0) @map("total_duration_sec")
|
|
58
|
+
faceDetectedPct Float? @map("face_detected_pct")
|
|
59
|
+
onScreenGazePct Float? @map("on_screen_gaze_pct")
|
|
60
|
+
|
|
61
|
+
// Event Counters
|
|
62
|
+
totalGazeEvents Int @default(0) @map("total_gaze_events")
|
|
63
|
+
totalObjectEvents Int @default(0) @map("total_object_events")
|
|
64
|
+
totalFaceEvents Int @default(0) @map("total_face_events")
|
|
65
|
+
totalBrowserEvents Int @default(0) @map("total_browser_events")
|
|
66
|
+
|
|
67
|
+
createdAt DateTime @default(now()) @map("created_at")
|
|
68
|
+
updatedAt DateTime @updatedAt @map("updated_at")
|
|
69
|
+
|
|
70
|
+
analyses ProctoringAnalysis[]
|
|
71
|
+
events ProctoringEvent[]
|
|
72
|
+
|
|
73
|
+
@@map("proctoring_sessions")
|
|
74
|
+
@@schema("public")
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
model ProctoringAnalysis {
|
|
78
|
+
id String @id @default(uuid()) @map("id")
|
|
79
|
+
sessionId String @map("session_id")
|
|
80
|
+
session ProctoringSession @relation(fields: [sessionId], references: [id], onDelete: Cascade)
|
|
81
|
+
|
|
82
|
+
status AnalysisStatus @default(QUEUED)
|
|
83
|
+
|
|
84
|
+
chunkIndex Int @default(0) @map("chunk_index")
|
|
85
|
+
startTimeSec Float @default(0.0) @map("start_time_sec")
|
|
86
|
+
endTimeSec Float @default(0.0) @map("end_time_sec")
|
|
87
|
+
|
|
88
|
+
videoKey String? @map("video_key")
|
|
89
|
+
annotatedKey String? @map("annotated_key")
|
|
90
|
+
|
|
91
|
+
error String?
|
|
92
|
+
createdAt DateTime @default(now()) @map("created_at")
|
|
93
|
+
updatedAt DateTime @updatedAt @map("updated_at")
|
|
94
|
+
|
|
95
|
+
@@unique([sessionId, chunkIndex])
|
|
96
|
+
@@map("proctoring_analyses")
|
|
97
|
+
@@schema("public")
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
model ProctoringEvent {
|
|
101
|
+
id String @id @default(uuid()) @map("id")
|
|
102
|
+
sessionId String @map("session_id")
|
|
103
|
+
session ProctoringSession @relation(fields: [sessionId], references: [id], onDelete: Cascade)
|
|
104
|
+
|
|
105
|
+
eventType ProctoringEventType @map("event_type")
|
|
106
|
+
timestampSec Float @map("timestamp_sec")
|
|
107
|
+
timestampStr String @map("timestamp_str")
|
|
108
|
+
|
|
109
|
+
risk RiskLevel @default(LOW)
|
|
110
|
+
metadata Json?
|
|
111
|
+
|
|
112
|
+
createdAt DateTime @default(now()) @map("created_at")
|
|
113
|
+
|
|
114
|
+
@@index([sessionId, timestampSec])
|
|
115
|
+
@@index([sessionId, eventType])
|
|
116
|
+
@@map("proctoring_events")
|
|
117
|
+
@@schema("public")
|
|
118
|
+
}
|