@adventurelabs/scout-core 1.4.33 → 1.4.35
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/dist/helpers/bounding_boxes.js +0 -1
- package/dist/helpers/embeddings.d.ts +12 -0
- package/dist/helpers/embeddings.js +22 -0
- package/dist/helpers/tags.js +10 -7
- package/dist/hooks/useScoutRefresh.d.ts +2 -0
- package/dist/hooks/useScoutRefresh.js +17 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/providers/ScoutRefreshProvider.d.ts +96 -29
- package/dist/types/db.d.ts +1 -0
- package/dist/types/supabase.d.ts +101 -29
- package/package.json +1 -1
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { IWebResponseCompatible } from "../types/requests";
|
|
2
|
+
import type { IEmbeddingSearchResult } from "../types/db";
|
|
3
|
+
import { SupabaseClient } from "@supabase/supabase-js";
|
|
4
|
+
/**
|
|
5
|
+
* Semantic search over the embeddings table (embeddings_vertex_multimodal_001).
|
|
6
|
+
* Returns matching embedding row ids with event_id, artifact_id, and confidence.
|
|
7
|
+
* Use for general embedding search without coupling to events vs artifacts.
|
|
8
|
+
*/
|
|
9
|
+
export declare function server_search_embeddings_vertex_multimodal_001(query_embedding: number[], match_threshold: number, match_count: number, options?: {
|
|
10
|
+
herd_id?: number | null;
|
|
11
|
+
client?: SupabaseClient;
|
|
12
|
+
}): Promise<IWebResponseCompatible<IEmbeddingSearchResult[]>>;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use server";
|
|
2
|
+
import { newServerClient } from "../supabase/server";
|
|
3
|
+
import { IWebResponse } from "../types/requests";
|
|
4
|
+
/**
|
|
5
|
+
* Semantic search over the embeddings table (embeddings_vertex_multimodal_001).
|
|
6
|
+
* Returns matching embedding row ids with event_id, artifact_id, and confidence.
|
|
7
|
+
* Use for general embedding search without coupling to events vs artifacts.
|
|
8
|
+
*/
|
|
9
|
+
export async function server_search_embeddings_vertex_multimodal_001(query_embedding, match_threshold, match_count, options) {
|
|
10
|
+
const supabase = options?.client ?? (await newServerClient());
|
|
11
|
+
const rpcName = "search_embeddings_vertex_multimodal_001";
|
|
12
|
+
const { data, error } = await supabase.rpc(rpcName, {
|
|
13
|
+
query_embedding: JSON.stringify(query_embedding),
|
|
14
|
+
match_threshold,
|
|
15
|
+
match_count,
|
|
16
|
+
...(options?.herd_id != null && { herd_id_caller: options.herd_id }),
|
|
17
|
+
});
|
|
18
|
+
if (error) {
|
|
19
|
+
return IWebResponse.error(error.message).to_compatible();
|
|
20
|
+
}
|
|
21
|
+
return IWebResponse.success((data ?? [])).to_compatible();
|
|
22
|
+
}
|
package/dist/helpers/tags.js
CHANGED
|
@@ -403,9 +403,12 @@ export async function get_event_and_tags_by_event_id(event_id) {
|
|
|
403
403
|
is_public: data[0].is_public,
|
|
404
404
|
herd_id: deviceData.herd_id,
|
|
405
405
|
tags: (data[0].tags || []).map((tag) => {
|
|
406
|
-
const
|
|
407
|
-
const
|
|
408
|
-
const
|
|
406
|
+
const originLoc = tag.origin_location;
|
|
407
|
+
const subjectLoc = tag.subject_location;
|
|
408
|
+
const originLat = originLoc ? extractLatitude(originLoc) : null;
|
|
409
|
+
const originLon = originLoc ? extractLongitude(originLoc) : null;
|
|
410
|
+
const subjectLat = subjectLoc ? extractLatitude(subjectLoc) : null;
|
|
411
|
+
const subjectLon = subjectLoc ? extractLongitude(subjectLoc) : null;
|
|
409
412
|
return {
|
|
410
413
|
id: tag.id,
|
|
411
414
|
inserted_at: tag.inserted_at,
|
|
@@ -430,10 +433,10 @@ export async function get_event_and_tags_by_event_id(event_id) {
|
|
|
430
433
|
origin_height: tag.origin_height,
|
|
431
434
|
subject_location: tag.subject_location ?? null,
|
|
432
435
|
subject_height: tag.subject_height,
|
|
433
|
-
origin_latitude:
|
|
434
|
-
origin_longitude:
|
|
435
|
-
subject_latitude:
|
|
436
|
-
subject_longitude:
|
|
436
|
+
origin_latitude: originLat,
|
|
437
|
+
origin_longitude: originLon,
|
|
438
|
+
subject_latitude: subjectLat,
|
|
439
|
+
subject_longitude: subjectLon,
|
|
437
440
|
};
|
|
438
441
|
}),
|
|
439
442
|
earthranger_url: data[0].earthranger_url,
|
|
@@ -3,6 +3,7 @@ export interface UseScoutRefreshOptions {
|
|
|
3
3
|
onRefreshComplete?: () => void;
|
|
4
4
|
cacheFirst?: boolean;
|
|
5
5
|
cacheTtlMs?: number;
|
|
6
|
+
onlineRefetchMinIntervalMs?: number;
|
|
6
7
|
}
|
|
7
8
|
/**
|
|
8
9
|
* Hook for refreshing scout data with detailed timing measurements and cache-first loading
|
|
@@ -12,6 +13,7 @@ export interface UseScoutRefreshOptions {
|
|
|
12
13
|
* @param options.onRefreshComplete - Callback function called when refresh completes
|
|
13
14
|
* @param options.cacheFirst - Whether to load from cache first, then refresh (default: true)
|
|
14
15
|
* @param options.cacheTtlMs - Cache time-to-live in milliseconds (default: 24 hours)
|
|
16
|
+
* @param options.onlineRefetchMinIntervalMs - Min ms since last refresh before refetch on "online" (default: 60s)
|
|
15
17
|
*
|
|
16
18
|
* @returns Object containing:
|
|
17
19
|
* - handleRefresh: Function to manually trigger a refresh
|
|
@@ -15,6 +15,7 @@ import { createBrowserClient } from "@supabase/ssr";
|
|
|
15
15
|
* @param options.onRefreshComplete - Callback function called when refresh completes
|
|
16
16
|
* @param options.cacheFirst - Whether to load from cache first, then refresh (default: true)
|
|
17
17
|
* @param options.cacheTtlMs - Cache time-to-live in milliseconds (default: 24 hours)
|
|
18
|
+
* @param options.onlineRefetchMinIntervalMs - Min ms since last refresh before refetch on "online" (default: 60s)
|
|
18
19
|
*
|
|
19
20
|
* @returns Object containing:
|
|
20
21
|
* - handleRefresh: Function to manually trigger a refresh
|
|
@@ -32,10 +33,12 @@ import { createBrowserClient } from "@supabase/ssr";
|
|
|
32
33
|
*/
|
|
33
34
|
export function useScoutRefresh(options = {}) {
|
|
34
35
|
const { autoRefresh = true, onRefreshComplete, cacheFirst = true, cacheTtlMs = 24 * 60 * 60 * 1000, // 24 hours default (1 day)
|
|
36
|
+
onlineRefetchMinIntervalMs = 60 * 1000, // 1 minute
|
|
35
37
|
} = options;
|
|
36
38
|
const dispatch = useAppDispatch();
|
|
37
39
|
const store = useStore();
|
|
38
40
|
const refreshInProgressRef = useRef(false);
|
|
41
|
+
const lastQueryAtRef = useRef(0);
|
|
39
42
|
// Create Supabase client directly to avoid circular dependency
|
|
40
43
|
// Assumes Next.js environment variables (NEXT_PUBLIC_*)
|
|
41
44
|
const supabase = useMemo(() => {
|
|
@@ -306,6 +309,7 @@ export function useScoutRefresh(options = {}) {
|
|
|
306
309
|
}
|
|
307
310
|
finally {
|
|
308
311
|
refreshInProgressRef.current = false;
|
|
312
|
+
lastQueryAtRef.current = Date.now();
|
|
309
313
|
}
|
|
310
314
|
}, [
|
|
311
315
|
dispatch,
|
|
@@ -321,6 +325,19 @@ export function useScoutRefresh(options = {}) {
|
|
|
321
325
|
handleRefresh();
|
|
322
326
|
}
|
|
323
327
|
}, [autoRefresh, handleRefresh]);
|
|
328
|
+
// Full refetch when nav goes online, only if min interval since last query has passed
|
|
329
|
+
useEffect(() => {
|
|
330
|
+
if (typeof window === "undefined")
|
|
331
|
+
return;
|
|
332
|
+
const handleOnline = () => {
|
|
333
|
+
const now = Date.now();
|
|
334
|
+
if (now - lastQueryAtRef.current >= onlineRefetchMinIntervalMs) {
|
|
335
|
+
handleRefresh();
|
|
336
|
+
}
|
|
337
|
+
};
|
|
338
|
+
window.addEventListener("online", handleOnline);
|
|
339
|
+
return () => window.removeEventListener("online", handleOnline);
|
|
340
|
+
}, [handleRefresh, onlineRefetchMinIntervalMs]);
|
|
324
341
|
// Utility function to clear cache
|
|
325
342
|
const clearCache = useCallback(async () => {
|
|
326
343
|
try {
|
package/dist/index.d.ts
CHANGED
|
@@ -18,6 +18,7 @@ export * from "./helpers/connectivity";
|
|
|
18
18
|
export * from "./helpers/db";
|
|
19
19
|
export * from "./helpers/devices";
|
|
20
20
|
export * from "./helpers/email";
|
|
21
|
+
export * from "./helpers/embeddings";
|
|
21
22
|
export * from "./helpers/events";
|
|
22
23
|
export * from "./helpers/gps";
|
|
23
24
|
export * from "./helpers/herds";
|
package/dist/index.js
CHANGED
|
@@ -21,6 +21,7 @@ export * from "./helpers/connectivity";
|
|
|
21
21
|
export * from "./helpers/db";
|
|
22
22
|
export * from "./helpers/devices";
|
|
23
23
|
export * from "./helpers/email";
|
|
24
|
+
export * from "./helpers/embeddings";
|
|
24
25
|
export * from "./helpers/events";
|
|
25
26
|
export * from "./helpers/gps";
|
|
26
27
|
export * from "./helpers/herds";
|
|
@@ -51,8 +51,6 @@ export declare function useSupabase(): SupabaseClient<Database, "public", "publi
|
|
|
51
51
|
Row: {
|
|
52
52
|
created_at: string;
|
|
53
53
|
device_id: number;
|
|
54
|
-
embedding_qwen_vl_2b: string | null;
|
|
55
|
-
embedding_vertex_mm_01: string | null;
|
|
56
54
|
file_path: string;
|
|
57
55
|
file_size_bytes: number | null;
|
|
58
56
|
id: number;
|
|
@@ -66,8 +64,6 @@ export declare function useSupabase(): SupabaseClient<Database, "public", "publi
|
|
|
66
64
|
Insert: {
|
|
67
65
|
created_at?: string;
|
|
68
66
|
device_id: number;
|
|
69
|
-
embedding_qwen_vl_2b?: string | null;
|
|
70
|
-
embedding_vertex_mm_01?: string | null;
|
|
71
67
|
file_path: string;
|
|
72
68
|
file_size_bytes?: number | null;
|
|
73
69
|
id?: number;
|
|
@@ -81,8 +77,6 @@ export declare function useSupabase(): SupabaseClient<Database, "public", "publi
|
|
|
81
77
|
Update: {
|
|
82
78
|
created_at?: string;
|
|
83
79
|
device_id?: number;
|
|
84
|
-
embedding_qwen_vl_2b?: string | null;
|
|
85
|
-
embedding_vertex_mm_01?: string | null;
|
|
86
80
|
file_path?: string;
|
|
87
81
|
file_size_bytes?: number | null;
|
|
88
82
|
id?: number;
|
|
@@ -359,13 +353,86 @@ export declare function useSupabase(): SupabaseClient<Database, "public", "publi
|
|
|
359
353
|
referencedColumns: ["id"];
|
|
360
354
|
}];
|
|
361
355
|
};
|
|
356
|
+
embeddings_vertex_multimodal_001: {
|
|
357
|
+
Row: {
|
|
358
|
+
artifact_id: number | null;
|
|
359
|
+
created_at: string;
|
|
360
|
+
embedding: string;
|
|
361
|
+
event_id: number | null;
|
|
362
|
+
id: number;
|
|
363
|
+
origin_heading: number | null;
|
|
364
|
+
origin_height: number | null;
|
|
365
|
+
origin_location: unknown;
|
|
366
|
+
origin_pitch: number | null;
|
|
367
|
+
origin_roll: number | null;
|
|
368
|
+
sensor_pitch: number | null;
|
|
369
|
+
sensor_roll: number | null;
|
|
370
|
+
sensor_yaw: number | null;
|
|
371
|
+
timestamp_observation: string | null;
|
|
372
|
+
};
|
|
373
|
+
Insert: {
|
|
374
|
+
artifact_id?: number | null;
|
|
375
|
+
created_at?: string;
|
|
376
|
+
embedding: string;
|
|
377
|
+
event_id?: number | null;
|
|
378
|
+
id?: number;
|
|
379
|
+
origin_heading?: number | null;
|
|
380
|
+
origin_height?: number | null;
|
|
381
|
+
origin_location?: unknown;
|
|
382
|
+
origin_pitch?: number | null;
|
|
383
|
+
origin_roll?: number | null;
|
|
384
|
+
sensor_pitch?: number | null;
|
|
385
|
+
sensor_roll?: number | null;
|
|
386
|
+
sensor_yaw?: number | null;
|
|
387
|
+
timestamp_observation?: string | null;
|
|
388
|
+
};
|
|
389
|
+
Update: {
|
|
390
|
+
artifact_id?: number | null;
|
|
391
|
+
created_at?: string;
|
|
392
|
+
embedding?: string;
|
|
393
|
+
event_id?: number | null;
|
|
394
|
+
id?: number;
|
|
395
|
+
origin_heading?: number | null;
|
|
396
|
+
origin_height?: number | null;
|
|
397
|
+
origin_location?: unknown;
|
|
398
|
+
origin_pitch?: number | null;
|
|
399
|
+
origin_roll?: number | null;
|
|
400
|
+
sensor_pitch?: number | null;
|
|
401
|
+
sensor_roll?: number | null;
|
|
402
|
+
sensor_yaw?: number | null;
|
|
403
|
+
timestamp_observation?: string | null;
|
|
404
|
+
};
|
|
405
|
+
Relationships: [{
|
|
406
|
+
foreignKeyName: "embeddings_vertex_multimodal_001_artifact_id_fkey";
|
|
407
|
+
columns: ["artifact_id"];
|
|
408
|
+
isOneToOne: false;
|
|
409
|
+
referencedRelation: "artifacts";
|
|
410
|
+
referencedColumns: ["id"];
|
|
411
|
+
}, {
|
|
412
|
+
foreignKeyName: "embeddings_vertex_multimodal_001_event_id_fkey";
|
|
413
|
+
columns: ["event_id"];
|
|
414
|
+
isOneToOne: false;
|
|
415
|
+
referencedRelation: "events";
|
|
416
|
+
referencedColumns: ["id"];
|
|
417
|
+
}, {
|
|
418
|
+
foreignKeyName: "embeddings_vertex_multimodal_001_event_id_fkey";
|
|
419
|
+
columns: ["event_id"];
|
|
420
|
+
isOneToOne: false;
|
|
421
|
+
referencedRelation: "events_with_tags";
|
|
422
|
+
referencedColumns: ["id"];
|
|
423
|
+
}, {
|
|
424
|
+
foreignKeyName: "embeddings_vertex_multimodal_001_event_id_fkey";
|
|
425
|
+
columns: ["event_id"];
|
|
426
|
+
isOneToOne: false;
|
|
427
|
+
referencedRelation: "events_with_tags_by_session";
|
|
428
|
+
referencedColumns: ["id"];
|
|
429
|
+
}];
|
|
430
|
+
};
|
|
362
431
|
events: {
|
|
363
432
|
Row: {
|
|
364
433
|
altitude: number;
|
|
365
434
|
device_id: number;
|
|
366
435
|
earthranger_url: string | null;
|
|
367
|
-
embedding_qwen_vl_2b: string | null;
|
|
368
|
-
embedding_vertex_mm_01: string | null;
|
|
369
436
|
file_path: string | null;
|
|
370
437
|
heading: number;
|
|
371
438
|
id: number;
|
|
@@ -382,8 +449,6 @@ export declare function useSupabase(): SupabaseClient<Database, "public", "publi
|
|
|
382
449
|
altitude?: number;
|
|
383
450
|
device_id: number;
|
|
384
451
|
earthranger_url?: string | null;
|
|
385
|
-
embedding_qwen_vl_2b?: string | null;
|
|
386
|
-
embedding_vertex_mm_01?: string | null;
|
|
387
452
|
file_path?: string | null;
|
|
388
453
|
heading?: number;
|
|
389
454
|
id?: number;
|
|
@@ -400,8 +465,6 @@ export declare function useSupabase(): SupabaseClient<Database, "public", "publi
|
|
|
400
465
|
altitude?: number;
|
|
401
466
|
device_id?: number;
|
|
402
467
|
earthranger_url?: string | null;
|
|
403
|
-
embedding_qwen_vl_2b?: string | null;
|
|
404
|
-
embedding_vertex_mm_01?: string | null;
|
|
405
468
|
file_path?: string | null;
|
|
406
469
|
heading?: number;
|
|
407
470
|
id?: number;
|
|
@@ -934,7 +997,6 @@ export declare function useSupabase(): SupabaseClient<Database, "public", "publi
|
|
|
934
997
|
height: number;
|
|
935
998
|
id: number;
|
|
936
999
|
inserted_at: string;
|
|
937
|
-
location: unknown;
|
|
938
1000
|
observation_type: Database["public"]["Enums"]["tag_observation_type"];
|
|
939
1001
|
origin_heading: number | null;
|
|
940
1002
|
origin_height: number | null;
|
|
@@ -961,7 +1023,6 @@ export declare function useSupabase(): SupabaseClient<Database, "public", "publi
|
|
|
961
1023
|
height?: number;
|
|
962
1024
|
id?: number;
|
|
963
1025
|
inserted_at?: string;
|
|
964
|
-
location?: unknown;
|
|
965
1026
|
observation_type: Database["public"]["Enums"]["tag_observation_type"];
|
|
966
1027
|
origin_heading?: number | null;
|
|
967
1028
|
origin_height?: number | null;
|
|
@@ -988,7 +1049,6 @@ export declare function useSupabase(): SupabaseClient<Database, "public", "publi
|
|
|
988
1049
|
height?: number;
|
|
989
1050
|
id?: number;
|
|
990
1051
|
inserted_at?: string;
|
|
991
|
-
location?: unknown;
|
|
992
1052
|
observation_type?: Database["public"]["Enums"]["tag_observation_type"];
|
|
993
1053
|
origin_heading?: number | null;
|
|
994
1054
|
origin_height?: number | null;
|
|
@@ -1359,8 +1419,6 @@ export declare function useSupabase(): SupabaseClient<Database, "public", "publi
|
|
|
1359
1419
|
Returns: {
|
|
1360
1420
|
created_at: string;
|
|
1361
1421
|
device_id: number;
|
|
1362
|
-
embedding_qwen_vl_2b: string | null;
|
|
1363
|
-
embedding_vertex_mm_01: string | null;
|
|
1364
1422
|
file_path: string;
|
|
1365
1423
|
file_size_bytes: number | null;
|
|
1366
1424
|
id: number;
|
|
@@ -1386,8 +1444,6 @@ export declare function useSupabase(): SupabaseClient<Database, "public", "publi
|
|
|
1386
1444
|
Returns: {
|
|
1387
1445
|
created_at: string;
|
|
1388
1446
|
device_id: number;
|
|
1389
|
-
embedding_qwen_vl_2b: string | null;
|
|
1390
|
-
embedding_vertex_mm_01: string | null;
|
|
1391
1447
|
file_path: string;
|
|
1392
1448
|
file_size_bytes: number | null;
|
|
1393
1449
|
id: number;
|
|
@@ -1414,8 +1470,6 @@ export declare function useSupabase(): SupabaseClient<Database, "public", "publi
|
|
|
1414
1470
|
Returns: {
|
|
1415
1471
|
created_at: string;
|
|
1416
1472
|
device_id: number;
|
|
1417
|
-
embedding_qwen_vl_2b: string | null;
|
|
1418
|
-
embedding_vertex_mm_01: string | null;
|
|
1419
1473
|
file_path: string;
|
|
1420
1474
|
file_size_bytes: number | null;
|
|
1421
1475
|
id: number;
|
|
@@ -1442,8 +1496,6 @@ export declare function useSupabase(): SupabaseClient<Database, "public", "publi
|
|
|
1442
1496
|
Returns: {
|
|
1443
1497
|
created_at: string;
|
|
1444
1498
|
device_id: number;
|
|
1445
|
-
embedding_qwen_vl_2b: string | null;
|
|
1446
|
-
embedding_vertex_mm_01: string | null;
|
|
1447
1499
|
file_path: string;
|
|
1448
1500
|
file_size_bytes: number | null;
|
|
1449
1501
|
id: number;
|
|
@@ -1471,8 +1523,6 @@ export declare function useSupabase(): SupabaseClient<Database, "public", "publi
|
|
|
1471
1523
|
Returns: {
|
|
1472
1524
|
created_at: string;
|
|
1473
1525
|
device_id: number;
|
|
1474
|
-
embedding_qwen_vl_2b: string | null;
|
|
1475
|
-
embedding_vertex_mm_01: string | null;
|
|
1476
1526
|
file_path: string;
|
|
1477
1527
|
file_size_bytes: number | null;
|
|
1478
1528
|
id: number;
|
|
@@ -1500,8 +1550,6 @@ export declare function useSupabase(): SupabaseClient<Database, "public", "publi
|
|
|
1500
1550
|
Returns: {
|
|
1501
1551
|
created_at: string;
|
|
1502
1552
|
device_id: number;
|
|
1503
|
-
embedding_qwen_vl_2b: string | null;
|
|
1504
|
-
embedding_vertex_mm_01: string | null;
|
|
1505
1553
|
file_path: string;
|
|
1506
1554
|
file_size_bytes: number | null;
|
|
1507
1555
|
id: number;
|
|
@@ -1529,8 +1577,6 @@ export declare function useSupabase(): SupabaseClient<Database, "public", "publi
|
|
|
1529
1577
|
Returns: {
|
|
1530
1578
|
created_at: string;
|
|
1531
1579
|
device_id: number;
|
|
1532
|
-
embedding_qwen_vl_2b: string | null;
|
|
1533
|
-
embedding_vertex_mm_01: string | null;
|
|
1534
1580
|
file_path: string;
|
|
1535
1581
|
file_size_bytes: number | null;
|
|
1536
1582
|
id: number;
|
|
@@ -2006,6 +2052,21 @@ export declare function useSupabase(): SupabaseClient<Database, "public", "publi
|
|
|
2006
2052
|
Args: never;
|
|
2007
2053
|
Returns: undefined;
|
|
2008
2054
|
};
|
|
2055
|
+
search_embeddings_vertex_multimodal_001: {
|
|
2056
|
+
Args: {
|
|
2057
|
+
herd_id_caller?: number;
|
|
2058
|
+
match_count: number;
|
|
2059
|
+
match_threshold: number;
|
|
2060
|
+
query_embedding: string;
|
|
2061
|
+
};
|
|
2062
|
+
Returns: Database["public"]["CompositeTypes"]["embedding_search_result"][];
|
|
2063
|
+
SetofOptions: {
|
|
2064
|
+
from: "*";
|
|
2065
|
+
to: "embedding_search_result";
|
|
2066
|
+
isOneToOne: false;
|
|
2067
|
+
isSetofReturn: true;
|
|
2068
|
+
};
|
|
2069
|
+
};
|
|
2009
2070
|
set_herd_location: {
|
|
2010
2071
|
Args: {
|
|
2011
2072
|
p_herd_id: number;
|
|
@@ -2080,6 +2141,12 @@ export declare function useSupabase(): SupabaseClient<Database, "public", "publi
|
|
|
2080
2141
|
id: number | null;
|
|
2081
2142
|
confidence: number | null;
|
|
2082
2143
|
};
|
|
2144
|
+
embedding_search_result: {
|
|
2145
|
+
id: number | null;
|
|
2146
|
+
event_id: number | null;
|
|
2147
|
+
artifact_id: number | null;
|
|
2148
|
+
confidence: number | null;
|
|
2149
|
+
};
|
|
2083
2150
|
event_and_tags: {
|
|
2084
2151
|
id: number | null;
|
|
2085
2152
|
inserted_at: string | null;
|
package/dist/types/db.d.ts
CHANGED
|
@@ -90,6 +90,7 @@ export type IFeedItem = {
|
|
|
90
90
|
};
|
|
91
91
|
export type ISessionWithCoordinates = Database["public"]["CompositeTypes"]["session_with_coordinates"];
|
|
92
92
|
export type IConnectivityWithCoordinates = Database["public"]["CompositeTypes"]["connectivity_with_coordinates"];
|
|
93
|
+
export type IEmbeddingSearchResult = Database["public"]["CompositeTypes"]["embedding_search_result"];
|
|
93
94
|
export type IDeviceHeartbeatAnalysis = Database["public"]["CompositeTypes"]["device_heartbeat_analysis"];
|
|
94
95
|
export type IHerdUptimeSummary = Database["public"]["Functions"]["get_herd_uptime_summary"]["Returns"][0];
|
|
95
96
|
export interface IZoneWithActions extends IZone {
|
package/dist/types/supabase.d.ts
CHANGED
|
@@ -50,8 +50,6 @@ export type Database = {
|
|
|
50
50
|
Row: {
|
|
51
51
|
created_at: string;
|
|
52
52
|
device_id: number;
|
|
53
|
-
embedding_qwen_vl_2b: string | null;
|
|
54
|
-
embedding_vertex_mm_01: string | null;
|
|
55
53
|
file_path: string;
|
|
56
54
|
file_size_bytes: number | null;
|
|
57
55
|
id: number;
|
|
@@ -65,8 +63,6 @@ export type Database = {
|
|
|
65
63
|
Insert: {
|
|
66
64
|
created_at?: string;
|
|
67
65
|
device_id: number;
|
|
68
|
-
embedding_qwen_vl_2b?: string | null;
|
|
69
|
-
embedding_vertex_mm_01?: string | null;
|
|
70
66
|
file_path: string;
|
|
71
67
|
file_size_bytes?: number | null;
|
|
72
68
|
id?: number;
|
|
@@ -80,8 +76,6 @@ export type Database = {
|
|
|
80
76
|
Update: {
|
|
81
77
|
created_at?: string;
|
|
82
78
|
device_id?: number;
|
|
83
|
-
embedding_qwen_vl_2b?: string | null;
|
|
84
|
-
embedding_vertex_mm_01?: string | null;
|
|
85
79
|
file_path?: string;
|
|
86
80
|
file_size_bytes?: number | null;
|
|
87
81
|
id?: number;
|
|
@@ -374,13 +368,91 @@ export type Database = {
|
|
|
374
368
|
}
|
|
375
369
|
];
|
|
376
370
|
};
|
|
371
|
+
embeddings_vertex_multimodal_001: {
|
|
372
|
+
Row: {
|
|
373
|
+
artifact_id: number | null;
|
|
374
|
+
created_at: string;
|
|
375
|
+
embedding: string;
|
|
376
|
+
event_id: number | null;
|
|
377
|
+
id: number;
|
|
378
|
+
origin_heading: number | null;
|
|
379
|
+
origin_height: number | null;
|
|
380
|
+
origin_location: unknown;
|
|
381
|
+
origin_pitch: number | null;
|
|
382
|
+
origin_roll: number | null;
|
|
383
|
+
sensor_pitch: number | null;
|
|
384
|
+
sensor_roll: number | null;
|
|
385
|
+
sensor_yaw: number | null;
|
|
386
|
+
timestamp_observation: string | null;
|
|
387
|
+
};
|
|
388
|
+
Insert: {
|
|
389
|
+
artifact_id?: number | null;
|
|
390
|
+
created_at?: string;
|
|
391
|
+
embedding: string;
|
|
392
|
+
event_id?: number | null;
|
|
393
|
+
id?: number;
|
|
394
|
+
origin_heading?: number | null;
|
|
395
|
+
origin_height?: number | null;
|
|
396
|
+
origin_location?: unknown;
|
|
397
|
+
origin_pitch?: number | null;
|
|
398
|
+
origin_roll?: number | null;
|
|
399
|
+
sensor_pitch?: number | null;
|
|
400
|
+
sensor_roll?: number | null;
|
|
401
|
+
sensor_yaw?: number | null;
|
|
402
|
+
timestamp_observation?: string | null;
|
|
403
|
+
};
|
|
404
|
+
Update: {
|
|
405
|
+
artifact_id?: number | null;
|
|
406
|
+
created_at?: string;
|
|
407
|
+
embedding?: string;
|
|
408
|
+
event_id?: number | null;
|
|
409
|
+
id?: number;
|
|
410
|
+
origin_heading?: number | null;
|
|
411
|
+
origin_height?: number | null;
|
|
412
|
+
origin_location?: unknown;
|
|
413
|
+
origin_pitch?: number | null;
|
|
414
|
+
origin_roll?: number | null;
|
|
415
|
+
sensor_pitch?: number | null;
|
|
416
|
+
sensor_roll?: number | null;
|
|
417
|
+
sensor_yaw?: number | null;
|
|
418
|
+
timestamp_observation?: string | null;
|
|
419
|
+
};
|
|
420
|
+
Relationships: [
|
|
421
|
+
{
|
|
422
|
+
foreignKeyName: "embeddings_vertex_multimodal_001_artifact_id_fkey";
|
|
423
|
+
columns: ["artifact_id"];
|
|
424
|
+
isOneToOne: false;
|
|
425
|
+
referencedRelation: "artifacts";
|
|
426
|
+
referencedColumns: ["id"];
|
|
427
|
+
},
|
|
428
|
+
{
|
|
429
|
+
foreignKeyName: "embeddings_vertex_multimodal_001_event_id_fkey";
|
|
430
|
+
columns: ["event_id"];
|
|
431
|
+
isOneToOne: false;
|
|
432
|
+
referencedRelation: "events";
|
|
433
|
+
referencedColumns: ["id"];
|
|
434
|
+
},
|
|
435
|
+
{
|
|
436
|
+
foreignKeyName: "embeddings_vertex_multimodal_001_event_id_fkey";
|
|
437
|
+
columns: ["event_id"];
|
|
438
|
+
isOneToOne: false;
|
|
439
|
+
referencedRelation: "events_with_tags";
|
|
440
|
+
referencedColumns: ["id"];
|
|
441
|
+
},
|
|
442
|
+
{
|
|
443
|
+
foreignKeyName: "embeddings_vertex_multimodal_001_event_id_fkey";
|
|
444
|
+
columns: ["event_id"];
|
|
445
|
+
isOneToOne: false;
|
|
446
|
+
referencedRelation: "events_with_tags_by_session";
|
|
447
|
+
referencedColumns: ["id"];
|
|
448
|
+
}
|
|
449
|
+
];
|
|
450
|
+
};
|
|
377
451
|
events: {
|
|
378
452
|
Row: {
|
|
379
453
|
altitude: number;
|
|
380
454
|
device_id: number;
|
|
381
455
|
earthranger_url: string | null;
|
|
382
|
-
embedding_qwen_vl_2b: string | null;
|
|
383
|
-
embedding_vertex_mm_01: string | null;
|
|
384
456
|
file_path: string | null;
|
|
385
457
|
heading: number;
|
|
386
458
|
id: number;
|
|
@@ -397,8 +469,6 @@ export type Database = {
|
|
|
397
469
|
altitude?: number;
|
|
398
470
|
device_id: number;
|
|
399
471
|
earthranger_url?: string | null;
|
|
400
|
-
embedding_qwen_vl_2b?: string | null;
|
|
401
|
-
embedding_vertex_mm_01?: string | null;
|
|
402
472
|
file_path?: string | null;
|
|
403
473
|
heading?: number;
|
|
404
474
|
id?: number;
|
|
@@ -415,8 +485,6 @@ export type Database = {
|
|
|
415
485
|
altitude?: number;
|
|
416
486
|
device_id?: number;
|
|
417
487
|
earthranger_url?: string | null;
|
|
418
|
-
embedding_qwen_vl_2b?: string | null;
|
|
419
|
-
embedding_vertex_mm_01?: string | null;
|
|
420
488
|
file_path?: string | null;
|
|
421
489
|
heading?: number;
|
|
422
490
|
id?: number;
|
|
@@ -981,7 +1049,6 @@ export type Database = {
|
|
|
981
1049
|
height: number;
|
|
982
1050
|
id: number;
|
|
983
1051
|
inserted_at: string;
|
|
984
|
-
location: unknown;
|
|
985
1052
|
observation_type: Database["public"]["Enums"]["tag_observation_type"];
|
|
986
1053
|
origin_heading: number | null;
|
|
987
1054
|
origin_height: number | null;
|
|
@@ -1008,7 +1075,6 @@ export type Database = {
|
|
|
1008
1075
|
height?: number;
|
|
1009
1076
|
id?: number;
|
|
1010
1077
|
inserted_at?: string;
|
|
1011
|
-
location?: unknown;
|
|
1012
1078
|
observation_type: Database["public"]["Enums"]["tag_observation_type"];
|
|
1013
1079
|
origin_heading?: number | null;
|
|
1014
1080
|
origin_height?: number | null;
|
|
@@ -1035,7 +1101,6 @@ export type Database = {
|
|
|
1035
1101
|
height?: number;
|
|
1036
1102
|
id?: number;
|
|
1037
1103
|
inserted_at?: string;
|
|
1038
|
-
location?: unknown;
|
|
1039
1104
|
observation_type?: Database["public"]["Enums"]["tag_observation_type"];
|
|
1040
1105
|
origin_heading?: number | null;
|
|
1041
1106
|
origin_height?: number | null;
|
|
@@ -1426,8 +1491,6 @@ export type Database = {
|
|
|
1426
1491
|
Returns: {
|
|
1427
1492
|
created_at: string;
|
|
1428
1493
|
device_id: number;
|
|
1429
|
-
embedding_qwen_vl_2b: string | null;
|
|
1430
|
-
embedding_vertex_mm_01: string | null;
|
|
1431
1494
|
file_path: string;
|
|
1432
1495
|
file_size_bytes: number | null;
|
|
1433
1496
|
id: number;
|
|
@@ -1453,8 +1516,6 @@ export type Database = {
|
|
|
1453
1516
|
Returns: {
|
|
1454
1517
|
created_at: string;
|
|
1455
1518
|
device_id: number;
|
|
1456
|
-
embedding_qwen_vl_2b: string | null;
|
|
1457
|
-
embedding_vertex_mm_01: string | null;
|
|
1458
1519
|
file_path: string;
|
|
1459
1520
|
file_size_bytes: number | null;
|
|
1460
1521
|
id: number;
|
|
@@ -1481,8 +1542,6 @@ export type Database = {
|
|
|
1481
1542
|
Returns: {
|
|
1482
1543
|
created_at: string;
|
|
1483
1544
|
device_id: number;
|
|
1484
|
-
embedding_qwen_vl_2b: string | null;
|
|
1485
|
-
embedding_vertex_mm_01: string | null;
|
|
1486
1545
|
file_path: string;
|
|
1487
1546
|
file_size_bytes: number | null;
|
|
1488
1547
|
id: number;
|
|
@@ -1509,8 +1568,6 @@ export type Database = {
|
|
|
1509
1568
|
Returns: {
|
|
1510
1569
|
created_at: string;
|
|
1511
1570
|
device_id: number;
|
|
1512
|
-
embedding_qwen_vl_2b: string | null;
|
|
1513
|
-
embedding_vertex_mm_01: string | null;
|
|
1514
1571
|
file_path: string;
|
|
1515
1572
|
file_size_bytes: number | null;
|
|
1516
1573
|
id: number;
|
|
@@ -1538,8 +1595,6 @@ export type Database = {
|
|
|
1538
1595
|
Returns: {
|
|
1539
1596
|
created_at: string;
|
|
1540
1597
|
device_id: number;
|
|
1541
|
-
embedding_qwen_vl_2b: string | null;
|
|
1542
|
-
embedding_vertex_mm_01: string | null;
|
|
1543
1598
|
file_path: string;
|
|
1544
1599
|
file_size_bytes: number | null;
|
|
1545
1600
|
id: number;
|
|
@@ -1567,8 +1622,6 @@ export type Database = {
|
|
|
1567
1622
|
Returns: {
|
|
1568
1623
|
created_at: string;
|
|
1569
1624
|
device_id: number;
|
|
1570
|
-
embedding_qwen_vl_2b: string | null;
|
|
1571
|
-
embedding_vertex_mm_01: string | null;
|
|
1572
1625
|
file_path: string;
|
|
1573
1626
|
file_size_bytes: number | null;
|
|
1574
1627
|
id: number;
|
|
@@ -1596,8 +1649,6 @@ export type Database = {
|
|
|
1596
1649
|
Returns: {
|
|
1597
1650
|
created_at: string;
|
|
1598
1651
|
device_id: number;
|
|
1599
|
-
embedding_qwen_vl_2b: string | null;
|
|
1600
|
-
embedding_vertex_mm_01: string | null;
|
|
1601
1652
|
file_path: string;
|
|
1602
1653
|
file_size_bytes: number | null;
|
|
1603
1654
|
id: number;
|
|
@@ -2073,6 +2124,21 @@ export type Database = {
|
|
|
2073
2124
|
Args: never;
|
|
2074
2125
|
Returns: undefined;
|
|
2075
2126
|
};
|
|
2127
|
+
search_embeddings_vertex_multimodal_001: {
|
|
2128
|
+
Args: {
|
|
2129
|
+
herd_id_caller?: number;
|
|
2130
|
+
match_count: number;
|
|
2131
|
+
match_threshold: number;
|
|
2132
|
+
query_embedding: string;
|
|
2133
|
+
};
|
|
2134
|
+
Returns: Database["public"]["CompositeTypes"]["embedding_search_result"][];
|
|
2135
|
+
SetofOptions: {
|
|
2136
|
+
from: "*";
|
|
2137
|
+
to: "embedding_search_result";
|
|
2138
|
+
isOneToOne: false;
|
|
2139
|
+
isSetofReturn: true;
|
|
2140
|
+
};
|
|
2141
|
+
};
|
|
2076
2142
|
set_herd_location: {
|
|
2077
2143
|
Args: {
|
|
2078
2144
|
p_herd_id: number;
|
|
@@ -2147,6 +2213,12 @@ export type Database = {
|
|
|
2147
2213
|
id: number | null;
|
|
2148
2214
|
confidence: number | null;
|
|
2149
2215
|
};
|
|
2216
|
+
embedding_search_result: {
|
|
2217
|
+
id: number | null;
|
|
2218
|
+
event_id: number | null;
|
|
2219
|
+
artifact_id: number | null;
|
|
2220
|
+
confidence: number | null;
|
|
2221
|
+
};
|
|
2150
2222
|
event_and_tags: {
|
|
2151
2223
|
id: number | null;
|
|
2152
2224
|
inserted_at: string | null;
|