@trillboards/edge-sdk 0.2.190 → 0.2.191

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.
@@ -249,10 +249,10 @@ class ShimTest(unittest.TestCase):
249
249
  Engine()
250
250
  self.assertEqual(calls[2], {})
251
251
 
252
- def _native_http(self, low_memory=False):
252
+ def _native_http(self, low_memory=False, images=None):
253
253
  shim = self._load(TRILLBOARDS_LITERTLM_SHIM="1")
254
254
  events = []
255
- images = [b"area", b"person"]
255
+ images = [b"area", b"person"] if images is None else images
256
256
  hashes = [hashlib.sha256(b).hexdigest() for b in images]
257
257
  class Engine:
258
258
  def __init__(self, **kwargs):
@@ -295,6 +295,12 @@ class ShimTest(unittest.TestCase):
295
295
  handler.do_POST()
296
296
  return handler, events, output, hashes
297
297
 
298
+ def test_single_creative_keyframe_has_native_consumption_proof(self):
299
+ handler, events, output, hashes = self._native_http(images=[b"creative keyframe"])
300
+ self.assertEqual(len(output), 1)
301
+ self.assertEqual(output[0]["nativeImageInputs"], {"version": 1, "sha256": hashes})
302
+ self.assertNotIn(("error", 400), events)
303
+
298
304
  def test_native_http_receipt_is_outside_model_text_and_capacity_reuses_one_engine(self):
299
305
  handler, events, output, hashes = self._native_http()
300
306
  self.assertEqual(events[:3], [("allocate", 1), ("release", 1), ("allocate", 5)])
@@ -269,7 +269,7 @@ def _apply_model_snapshot(engine_cls):
269
269
  if images is not None:
270
270
  # The public option used by the saved-frame comparison. No larger
271
271
  # engine is allocated on ordinary single-image/off-switch starts.
272
- kwargs['max_num_images'] = 5
272
+ kwargs['max_num_images'] = 5 if len(images['expected']) > 1 else 1
273
273
  path = kwargs.get('model_path', args[0] if args else None)
274
274
  if path is None: # lightweight contract-test engines have no artifact
275
275
  result = original(self, *args, **kwargs)
@@ -334,7 +334,7 @@ def apply_runtime_handler(module):
334
334
  return
335
335
  raw_images = self.headers.get('X-Trillboards-Image-Sha256')
336
336
  images = raw_images.split(',') if raw_images is not None else None
337
- if images is not None and (expected is None or not 2 <= len(images) <= 5
337
+ if images is not None and (expected is None or not 1 <= len(images) <= 5
338
338
  or any(not re.fullmatch(r'[a-f0-9]{64}', value) for value in images)):
339
339
  self.send_error(400, 'invalid pinned native image request')
340
340
  return
@@ -351,7 +351,7 @@ def apply_runtime_handler(module):
351
351
  if images is not None:
352
352
  server = getattr(self, 'server', None)
353
353
  previous = getattr(server, 'litert_lm_engine', None)
354
- if previous is not None and getattr(previous, '_trillboards_image_capacity', 1) < 5:
354
+ if previous is not None and getattr(previous, '_trillboards_image_capacity', 1) < len(images['expected']):
355
355
  # The pinned CLI's HTTPServer is serial. Release its previous
356
356
  # engine BEFORE allocating the larger one; no duplicate model.
357
357
  previous.__exit__(None, None, None)
package/dist/EdgeAgent.js CHANGED
@@ -44,7 +44,7 @@ const edge_ads_1 = require("@trillboards/edge-ads");
44
44
  const CommandRouter_1 = require("./CommandRouter");
45
45
  const config_1 = require("./config");
46
46
  const dataDir_1 = require("./dataDir");
47
- const SDK_VERSION = '0.2.190';
47
+ const SDK_VERSION = '0.2.191';
48
48
  class EdgeAgent extends events_1.EventEmitter {
49
49
  constructor(config, deps) {
50
50
  super();
@@ -31,7 +31,7 @@ export interface DiagnosticReport {
31
31
  skipped: number;
32
32
  };
33
33
  }
34
- declare const SDK_VERSION = "0.2.190";
34
+ declare const SDK_VERSION = "0.2.191";
35
35
  declare function checkNodeVersion(): CheckResult;
36
36
  declare function checkPlatform(): CheckResult;
37
37
  declare function checkMemory(): CheckResult;
package/dist/diagnose.js CHANGED
@@ -63,7 +63,7 @@ const localNetworkAccess_1 = require("./localNetworkAccess");
63
63
  // ---------------------------------------------------------------------------
64
64
  // SDK version — mirrors package.json; kept in sync by CI
65
65
  // ---------------------------------------------------------------------------
66
- const SDK_VERSION = '0.2.190';
66
+ const SDK_VERSION = '0.2.191';
67
67
  exports._SDK_VERSION = SDK_VERSION;
68
68
  // ---------------------------------------------------------------------------
69
69
  // ANSI helpers (no external deps)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trillboards/edge-sdk",
3
- "version": "0.2.190",
3
+ "version": "0.2.191",
4
4
  "description": "Composable cross-platform Edge AI SDK for audience sensing on DOOH/CTV devices",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",