@trillboards/edge-core 0.1.0 → 0.2.1

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.
Files changed (3) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +93 -0
  3. package/package.json +18 -3
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024-2026 Trillboards, Inc.
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,93 @@
1
+ # @trillboards/edge-core
2
+
3
+ > **Core runtime for Trillboards Edge AI SDK.** Device identity, Socket.io connectivity, configuration, signal buffering, health monitoring, and auto-recovery for DOOH/CTV devices.
4
+
5
+ ## Install
6
+
7
+ ```bash
8
+ npm install @trillboards/edge-core
9
+ ```
10
+
11
+ ## What This Does
12
+
13
+ Provides the foundational infrastructure that all other `@trillboards/edge-*` packages depend on:
14
+
15
+ - **Device Identity** — generates stable device fingerprints and session IDs from hardware characteristics
16
+ - **Socket.io Manager** — real-time connection to Trillboards API with auto-reconnection and telemetry emission
17
+ - **Signal Buffer** — SQLite-backed offline queue that caches audience metrics when connectivity drops
18
+ - **Health Registry** — tracks 6 subsystems (socket, player, camera, microphone, ML pipeline, memory)
19
+ - **Recovery Ladder** — 6-level auto-recovery from reconnect through service restart to rollback
20
+ - **Capability Tiers** — classifies devices into TIER_1 through TIER_4 based on RAM and NPU availability
21
+ - **Sensing Config** — deserializes 70+ sensing parameters for audience measurement tuning
22
+
23
+ ## Usage
24
+
25
+ ```typescript
26
+ import {
27
+ DeviceIdentity,
28
+ SocketManager,
29
+ SignalBuffer,
30
+ SubsystemHealthRegistry,
31
+ SensingConfig,
32
+ computeTier,
33
+ classifyObservationSignal
34
+ } from '@trillboards/edge-core';
35
+
36
+ // Device identity
37
+ const identity = new DeviceIdentity();
38
+ const fingerprint = await identity.getFingerprint();
39
+
40
+ // Capability detection
41
+ const tier = computeTier({ ramMB: 4096, hasNPU: false });
42
+ // → TIER_2
43
+
44
+ // Socket.io connectivity
45
+ const socket = new SocketManager({
46
+ url: 'https://api.trillboards.com',
47
+ deviceToken: 'your-token'
48
+ });
49
+ await socket.connect();
50
+
51
+ // Offline-resilient signal buffering
52
+ const buffer = new SignalBuffer({ dataDir: './data' });
53
+ await buffer.push({ type: 'audience_metrics', payload: { faceCount: 3 } });
54
+
55
+ // Signal classification
56
+ const signal = classifyObservationSignal(rawPayload);
57
+ // → { family: 'SCREEN_AUDIENCE', evidenceGrade: 'FACE_BACKED', ... }
58
+ ```
59
+
60
+ ## Subsystem Health Monitoring
61
+
62
+ ```typescript
63
+ const health = new SubsystemHealthRegistry();
64
+
65
+ health.update('camera', 'healthy');
66
+ health.update('ml_pipeline', 'degraded');
67
+
68
+ const report = health.getReport();
69
+ // → { camera: 'healthy', ml_pipeline: 'degraded', ... }
70
+ ```
71
+
72
+ ## Capability Matrix
73
+
74
+ ```typescript
75
+ import { getCapabilityMatrix } from '@trillboards/edge-core';
76
+
77
+ const matrix = getCapabilityMatrix(tier);
78
+ // → { models: ['blazeface'], inferenceHz: 2, resolution: 320, ... }
79
+ ```
80
+
81
+ ## Key Types
82
+
83
+ - `PlatformAdapter` — interface for platform-specific adapters (Linux, Windows)
84
+ - `CameraProvider` — interface for camera capture implementations
85
+ - `AudioProvider` — interface for audio capture implementations
86
+ - `AudienceMetricsPayload` — structured audience measurement data
87
+ - `VASResult` — Viewability Attention Score output
88
+ - `DetectedFace` — face detection result with bounding box, age, gender, emotion
89
+ - `EdgeQualityReport` — inference quality telemetry
90
+
91
+ ## License
92
+
93
+ MIT
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trillboards/edge-core",
3
- "version": "0.1.0",
3
+ "version": "0.2.1",
4
4
  "description": "Core identity, heartbeat, Socket.io, config, and signal buffer for Trillboards Edge AI SDK",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -24,8 +24,9 @@
24
24
  "ts-jest": "^29.1.0",
25
25
  "typescript": "~5.3.0"
26
26
  },
27
- "files": ["dist"],
28
- "license": "UNLICENSED",
27
+ "files": ["dist", "LICENSE", "README.md"],
28
+ "author": "Trillboards <engineering@trillboards.com>",
29
+ "license": "MIT",
29
30
  "publishConfig": {
30
31
  "access": "public"
31
32
  },
@@ -34,6 +35,20 @@
34
35
  "url": "https://github.com/trillboards/packages.git",
35
36
  "directory": "trillboards-edge-sdk/packages/edge-core"
36
37
  },
38
+ "keywords": [
39
+ "edge-ai",
40
+ "dooh",
41
+ "audience-sensing",
42
+ "iot",
43
+ "digital-signage",
44
+ "heartbeat",
45
+ "socket-io",
46
+ "device-identity",
47
+ "ctv",
48
+ "signal-buffer",
49
+ "trillboards",
50
+ "ai-agent"
51
+ ],
37
52
  "engines": {
38
53
  "node": ">=18.0.0"
39
54
  }