File size: 2,470 Bytes
ff50694
c17ec01
 
 
 
 
 
 
85ec659
c17ec01
 
 
ff50694
 
c17ec01
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
ff50694
 
0c01887
ff50694
c17ec01
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3a793fe
c17ec01
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
APP.core.state = {
    videoUrl: null,
    videoFile: null,
    videoLoaded: false,
    useProcessedFeed: false,
    useDepthFeed: false,        // Flag for depth view (Tab 2 video)
    useFrameDepthView: false,   // Flag for first frame depth view (Tab 1)
    hasReasoned: false,
    firstFrameReady: false,     // Flag for first frame radar display
    isReasoning: false,         // Flag to prevent concurrent Reason executions

    hf: {
        // Will be properly initialized after CONFIG loads
        baseUrl: (window.API_CONFIG?.BACKEND_BASE || window.API_CONFIG?.BASE_URL || "").replace(/\/$/, "") || window.location.origin,
        detector: "auto",
        asyncJobId: null,           // Current job ID from /detect/async
        asyncPollInterval: null,    // Polling timer handle
        firstFrameUrl: null,        // First frame preview URL
        firstFrameDetections: null, // First-frame detections from backend
        statusUrl: null,            // Status polling URL
        videoUrl: null,             // Final video URL
        asyncStatus: "idle",        // "idle"|"processing"|"completed"|"failed"
        asyncProgress: null,        // Progress data from status endpoint
        queries: [],                // Mission objective used as query
        processedUrl: null,
        processedBlob: null,
        depthVideoUrl: null,        // Depth video URL
        depthFirstFrameUrl: null,   // First frame depth URL
        depthBlob: null,            // Depth video blob
        depthFirstFrameBlob: null,  // Depth first frame blob
        summary: null,
        busy: false,
        lastError: null,
        missionId: null,
        missionSpec: null,
        plan: null
    },

    detector: {
        mode: "coco",
        kind: "object",
        loaded: false,
        model: null,
        loading: false,
        cocoBlocked: false,
        hfTrackingWarned: false
    },

    tracker: {
        mode: "iou",
        tracks: [],
        nextId: 1,
        lastDetTime: 0,
        lastHFSync: 0,
        running: false,
        selectedTrackId: null,
        beamOn: false,
        lastFrameTime: 0,
        frameCount: 0
    },

    frame: {
        w: 1280,
        h: 720,
        bitmap: null
    },

    detections: [], // from Tab 1
    selectedId: null,

    intelBusy: false,

    ui: {
        cursorMode: "on",
        agentCursor: { x: 0.65, y: 0.28, vx: 0, vy: 0, visible: false, target: null, mode: "idle", t0: 0 }
    }
};