@trillboards/edge-sdk 0.2.175 → 0.2.176

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 (115) hide show
  1. package/deploy/detector/README.md +6 -0
  2. package/deploy/detector/pyproject.toml +4 -1
  3. package/deploy/detector/tests/test_actor_action_wire.py +103 -0
  4. package/deploy/detector/tests/test_actor_actions.py +94 -0
  5. package/deploy/detector/tests/test_actor_checkpoint.py +99 -0
  6. package/deploy/detector/tests/test_actor_tracking.py +191 -0
  7. package/deploy/detector/tests/test_actor_tracking_wire.py +120 -0
  8. package/deploy/detector/tests/test_actor_views.py +108 -0
  9. package/deploy/detector/tests/test_compute_budget.py +28 -0
  10. package/deploy/detector/tests/test_detector_request.py +52 -0
  11. package/deploy/detector/tests/test_input_recipe.py +77 -0
  12. package/deploy/detector/tests/test_loader.py +20 -1
  13. package/deploy/detector/tests/test_pose.py +66 -0
  14. package/deploy/detector/tests/test_server.py +83 -0
  15. package/deploy/detector/tests/test_task_registry.py +74 -0
  16. package/deploy/detector/trillboards_detector/_version.py +2 -2
  17. package/deploy/detector/trillboards_detector/actor_action_contract.py +65 -0
  18. package/deploy/detector/trillboards_detector/actor_action_wire.py +189 -0
  19. package/deploy/detector/trillboards_detector/actor_actions.py +115 -0
  20. package/deploy/detector/trillboards_detector/actor_checkpoint.py +91 -0
  21. package/deploy/detector/trillboards_detector/actor_tracking.py +337 -0
  22. package/deploy/detector/trillboards_detector/actor_views.py +102 -0
  23. package/deploy/detector/trillboards_detector/cli.py +12 -2
  24. package/deploy/detector/trillboards_detector/labels.py +32 -0
  25. package/deploy/detector/trillboards_detector/loader.py +30 -4
  26. package/deploy/detector/trillboards_detector/pose.py +129 -0
  27. package/deploy/detector/trillboards_detector/registry.py +92 -7
  28. package/deploy/detector/trillboards_detector/server.py +131 -3
  29. package/deploy/detector/trillboards_detector/session.py +83 -49
  30. package/deploy/detector/trillboards_detector/tasks.py +27 -0
  31. package/deploy/detector/trillboards_detector/worker_budget.py +14 -0
  32. package/deploy/windows/README.md +1 -1
  33. package/deploy/windows/ci/test-published-install.ps1 +16 -3
  34. package/dist/ActorActionClient.d.ts +47 -0
  35. package/dist/ActorActionClient.d.ts.map +1 -0
  36. package/dist/ActorActionClient.js +187 -0
  37. package/dist/ActorActionClient.js.map +1 -0
  38. package/dist/ActorActionProducer.d.ts +17 -0
  39. package/dist/ActorActionProducer.d.ts.map +1 -0
  40. package/dist/ActorActionProducer.js +92 -0
  41. package/dist/ActorActionProducer.js.map +1 -0
  42. package/dist/ActorPerception.d.ts +65 -0
  43. package/dist/ActorPerception.d.ts.map +1 -0
  44. package/dist/ActorPerception.js +124 -0
  45. package/dist/ActorPerception.js.map +1 -0
  46. package/dist/ActorPose.d.ts +42 -0
  47. package/dist/ActorPose.d.ts.map +1 -0
  48. package/dist/ActorPose.js +62 -0
  49. package/dist/ActorPose.js.map +1 -0
  50. package/dist/ActorReview.d.ts +51 -0
  51. package/dist/ActorReview.d.ts.map +1 -0
  52. package/dist/ActorReview.js +84 -0
  53. package/dist/ActorReview.js.map +1 -0
  54. package/dist/ActorTracking.d.ts +33 -0
  55. package/dist/ActorTracking.d.ts.map +1 -0
  56. package/dist/ActorTracking.js +90 -0
  57. package/dist/ActorTracking.js.map +1 -0
  58. package/dist/ActorWindow.d.ts +56 -0
  59. package/dist/ActorWindow.d.ts.map +1 -0
  60. package/dist/ActorWindow.js +86 -0
  61. package/dist/ActorWindow.js.map +1 -0
  62. package/dist/ActorWindowContract.d.ts +5 -0
  63. package/dist/ActorWindowContract.d.ts.map +1 -0
  64. package/dist/ActorWindowContract.js +23 -0
  65. package/dist/ActorWindowContract.js.map +1 -0
  66. package/dist/AudienceAnalyzeClient.d.ts +4 -0
  67. package/dist/AudienceAnalyzeClient.d.ts.map +1 -1
  68. package/dist/AudienceAnalyzeClient.js.map +1 -1
  69. package/dist/ChannelProber.d.ts.map +1 -1
  70. package/dist/ChannelProber.js +8 -0
  71. package/dist/ChannelProber.js.map +1 -1
  72. package/dist/CloudSensingManager.d.ts +7 -0
  73. package/dist/CloudSensingManager.d.ts.map +1 -1
  74. package/dist/CloudSensingManager.js +31 -0
  75. package/dist/CloudSensingManager.js.map +1 -1
  76. package/dist/EdgeAgent.js +1 -1
  77. package/dist/LocalDetectorClient.d.ts +5 -1
  78. package/dist/LocalDetectorClient.d.ts.map +1 -1
  79. package/dist/LocalDetectorClient.js +48 -3
  80. package/dist/LocalDetectorClient.js.map +1 -1
  81. package/dist/RetainedFieldContract.d.ts +2 -1
  82. package/dist/RetainedFieldContract.d.ts.map +1 -1
  83. package/dist/RetainedFieldContract.js +17 -5
  84. package/dist/RetainedFieldContract.js.map +1 -1
  85. package/dist/RuntimeModelSelection.d.ts.map +1 -1
  86. package/dist/RuntimeModelSelection.js +63 -2
  87. package/dist/RuntimeModelSelection.js.map +1 -1
  88. package/dist/TemporalReviewClient.d.ts.map +1 -1
  89. package/dist/TemporalReviewClient.js +20 -1
  90. package/dist/TemporalReviewClient.js.map +1 -1
  91. package/dist/TemporalReviewJournal.d.ts +10 -1
  92. package/dist/TemporalReviewJournal.d.ts.map +1 -1
  93. package/dist/TemporalReviewJournal.js +42 -10
  94. package/dist/TemporalReviewJournal.js.map +1 -1
  95. package/dist/connectorUpdate.d.ts +2 -0
  96. package/dist/connectorUpdate.d.ts.map +1 -1
  97. package/dist/connectorUpdate.js +33 -7
  98. package/dist/connectorUpdate.js.map +1 -1
  99. package/dist/diagnose.d.ts +1 -1
  100. package/dist/diagnose.js +1 -1
  101. package/dist/index.d.ts +6 -0
  102. package/dist/index.d.ts.map +1 -1
  103. package/dist/index.js +12 -1
  104. package/dist/index.js.map +1 -1
  105. package/dist/localSensing.d.ts +4 -0
  106. package/dist/localSensing.d.ts.map +1 -1
  107. package/dist/localSensing.js +43 -8
  108. package/dist/localSensing.js.map +1 -1
  109. package/package.json +5 -5
  110. package/retained/RetainedCaptureClient.cjs +55 -9
  111. package/retained/__tests__/actor-perception.test.cjs +125 -0
  112. package/retained/__tests__/actor-window.test.cjs +78 -0
  113. package/retained/__tests__/runtime.test.cjs +44 -4
  114. package/retained/actor-window.cjs +62 -0
  115. package/retained/manager.cjs +14 -2
@@ -1,29 +1,11 @@
1
- """The ONNX session, and the pre/post-processing that must match the reference.
2
-
3
- WHY THE PROCESSING IS TRANSCRIBED RATHER THAN IMPORTED
4
- -----------------------------------------------------
5
- The score in `docs/runbooks/cctv-detector-tier.md` (98.8/98.8 pooled, 2.1% of
6
- events lost to buy 84.7% of VLM calls) was produced by the `rfdetr` package's
7
- own `predict()`. That package pulls torch + torchvision + transformers — about
8
- 3 GB — which is not going on a shop PC to run a 128 MiB graph. So the four steps
9
- that decide whether the shipped service reproduces the measured number are
10
- transcribed here from the exact call sites, each named in the function that
11
- implements it:
12
-
13
- resize `rfdetr/detr.py` F.resize(t, [576, 576], antialias=False)
14
- normalize `rfdetr/detr.py` F.normalize(t, [0.485,0.456,0.406], [0.229,0.224,0.225])
15
- select `rfdetr/models/postprocess.py::PostProcess._select_topk`
16
- boxes `rfdetr/models/postprocess.py::PostProcess._gather_and_scale_boxes`
17
-
18
- `antialias=False` is not a detail to tidy up: the upstream comment says it
19
- matches the antialias-free bilinear resize Albumentations uses in training, and
20
- changing it changes the pixels the model was scored on. Likewise the resize is a
21
- STRETCH to a square, not a letterbox — aspect ratio is not preserved, and
22
- "fixing" that silently re-scores every box.
23
-
24
- A transcription can drift from its source. `bench/verify_against_reference.py`
25
- is the control: it runs this pipeline and the `rfdetr` package on the same image
26
- and fails on any disagreement.
1
+ """ONNX sessions with artifact-specific pixel and box contracts.
2
+
3
+ The shipped RF-DETR card was scored with Pillow RGB stretch and ImageNet
4
+ normalization. Pillow low-passes a downscale; the author\'s tensor bilinear
5
+ antialias=False path does not. Both recipes are explicit here because changing
6
+ the pixels requires re-scoring the artifact. Existing catalogue entries keep
7
+ their scored inputs. A compatible box-output layout never chooses the color
8
+ order, interpolation or normalization of a newly declared model.
27
9
  """
28
10
 
29
11
  from __future__ import annotations
@@ -31,6 +13,7 @@ from __future__ import annotations
31
13
  import io
32
14
  import hashlib
33
15
  import math
16
+ import numbers
34
17
  import threading
35
18
  import time
36
19
  from dataclasses import dataclass, field
@@ -51,7 +34,8 @@ from .decode import (
51
34
  from .detections import Detection, DetectionBatch
52
35
  from .errors import ModelContractError
53
36
  from .execution import LocalOrtSession
54
- from .labels import ModelVocabulary
37
+ from .labels import (ClassIndex, ModelVocabulary, PIL_IMAGENET_STRETCH, RGB_HALF_PIXEL_IMAGENET,
38
+ BGR_BYTES_STRETCH, YOLO_LETTERBOX, resolve_input_preprocessing)
55
39
 
56
40
  #: `rfdetr/detr.py` — ImageNet statistics, applied AFTER scaling to [0,1].
57
41
  IMAGENET_MEAN = np.array([0.485, 0.456, 0.406], dtype=np.float32).reshape(3, 1, 1)
@@ -91,7 +75,7 @@ class GraphSpec:
91
75
  #: `/health` can say which decode is running. A number nobody can attribute
92
76
  #: to a decode is the `agent_version` failure one runbook over.
93
77
  output_layout: str
94
- #: Which preprocessing this layout's artifact was exported with. Reported for
78
+ #: The artifact's declared input recipe, independent of its output layout.
95
79
  #: the same reason: the two are not interchangeable and the difference is
96
80
  #: invisible to every shape check.
97
81
  preprocessing: str
@@ -111,9 +95,8 @@ def preprocess(jpeg: bytes, width: int, height: int) -> tuple[np.ndarray, int, i
111
95
  with Image.open(io.BytesIO(jpeg)) as im:
112
96
  rgb = im.convert("RGB")
113
97
  src_w, src_h = rgb.size
114
- # BILINEAR without a prefilter == torchvision's antialias=False path.
115
- # `Image.BILINEAR` in Pillow does not low-pass on downscale, which is
116
- # the behaviour being matched. Do not "improve" this to LANCZOS.
98
+ # Preserve the Pillow low-pass recipe used by the shipped score card.
99
+ # This is distinct from tensor bilinear antialias=False below.
117
100
  resized = rgb.resize((width, height), resample=Image.BILINEAR)
118
101
  arr = np.asarray(resized, dtype=np.float32)
119
102
 
@@ -174,26 +157,56 @@ def preprocess_letterbox(jpeg: bytes, width: int, height: int):
174
157
  return blob, LetterboxGeometry(gain, pad_x, pad_y, src_w, src_h)
175
158
 
176
159
 
177
- def preprocess_for_layout(layout: str, jpeg: bytes, width: int, height: int):
178
- """Pick the transform this artifact was exported with. NOT a formatting step.
160
+ def _half_pixel_resize(rgb: np.ndarray, width: int, height: int) -> np.ndarray:
161
+ """Float RGB bilinear, half-pixel centers, no low-pass filter.
179
162
 
180
- ITS OWN FUNCTION SO IT CAN BE TESTED WITHOUT A MODEL. Inlined in
181
- `OnnxDetector.detect` it was reachable only through a real ORT session, which
182
- means only on a machine holding a 128 MiB artifact — and a mutation test
183
- proved the gap: swapping the two preprocessors left all 178 unit tests green
184
- and was caught only by the bench. A dispatch nothing can test is a dispatch
185
- that will one day be wrong in the field with every surface green, which is
186
- the failure this whole service is built against.
187
-
188
- Returns `(blob, geometry, frame_w, frame_h)`. `geometry` is None for the
189
- stretch path, where there is no padding to undo and boxes come back
190
- normalised; the YOLO decodes need it and `postprocess` does not.
163
+ Matches torchvision tensor resize with align_corners=False/antialias=False;
164
+ tested against the author's RF-DETR transform on actual decoded frames.
191
165
  """
192
- if layout == RFDETR_DETS_LABELS:
166
+ src_h, src_w = rgb.shape[:2]
167
+ ys = np.clip((np.arange(height, dtype=np.float32) + .5) * (src_h / height) - .5, 0, src_h - 1)
168
+ xs = np.clip((np.arange(width, dtype=np.float32) + .5) * (src_w / width) - .5, 0, src_w - 1)
169
+ y0 = ys.astype(np.int64); x0 = xs.astype(np.int64)
170
+ y1 = np.minimum(y0 + 1, src_h - 1); x1 = np.minimum(x0 + 1, src_w - 1)
171
+ dy = (ys - y0.astype(np.float32))[:, None, None]
172
+ dx = (xs - x0.astype(np.float32))[None, :, None]
173
+ upper = rgb[y0[:, None], x0[None, :]] * (1 - dx) + rgb[y0[:, None], x1[None, :]] * dx
174
+ lower = rgb[y1[:, None], x0[None, :]] * (1 - dx) + rgb[y1[:, None], x1[None, :]] * dx
175
+ return upper * (1 - dy) + lower * dy
176
+
177
+
178
+ def preprocess_for_layout(layout: str, jpeg: bytes, width: int, height: int, *,
179
+ input_preprocessing: "str | None" = None):
180
+ """Return this model's pixels and the geometry consumed by its box decode.
181
+
182
+ Omitted recipes retain existing scored artifacts. New recipes are declared
183
+ by ModelVocabulary and checked before loading; unknown/incompatible inputs
184
+ cannot silently fall through to another model's transform.
185
+ """
186
+ try:
187
+ recipe = resolve_input_preprocessing(layout, input_preprocessing)
188
+ except ValueError as exc:
189
+ raise ModelContractError(str(exc)) from exc
190
+ if recipe == YOLO_LETTERBOX:
191
+ blob, geometry = preprocess_letterbox(jpeg, width, height)
192
+ return blob, geometry, geometry.frame_w, geometry.frame_h
193
+ if recipe == PIL_IMAGENET_STRETCH:
193
194
  blob, frame_w, frame_h = preprocess(jpeg, width, height)
194
195
  return blob, None, frame_w, frame_h
195
- blob, geometry = preprocess_letterbox(jpeg, width, height)
196
- return blob, geometry, geometry.frame_w, geometry.frame_h
196
+ with Image.open(io.BytesIO(jpeg)) as im:
197
+ rgb = np.asarray(im.convert("RGB"))
198
+ frame_w, frame_h = im.size
199
+ if recipe == BGR_BYTES_STRETCH:
200
+ import cv2
201
+ bgr = cv2.resize(rgb[:, :, ::-1], (width, height), interpolation=cv2.INTER_LINEAR)
202
+ blob = bgr.transpose(2, 0, 1).astype(np.float32)[None, ...]
203
+ elif recipe == RGB_HALF_PIXEL_IMAGENET:
204
+ rgb01 = rgb.astype(np.float32) / np.float32(255)
205
+ chw = _half_pixel_resize(rgb01, width, height).transpose(2, 0, 1)
206
+ blob = ((chw - IMAGENET_MEAN) / IMAGENET_STD)[None, ...]
207
+ else: # resolve_input_preprocessing closes this set.
208
+ raise ModelContractError(f"unsupported input preprocessing {recipe!r}")
209
+ return np.ascontiguousarray(blob), None, frame_w, frame_h
197
210
 
198
211
 
199
212
  def postprocess(
@@ -330,6 +343,24 @@ def _sigmoid(x: np.ndarray) -> np.ndarray:
330
343
  return out
331
344
 
332
345
 
346
+
347
+ def _checked_detector_request(min_confidence, wanted, class_index):
348
+ """Use the HTTP class authority for artifact-local callers too.
349
+
350
+ A misspelled class or NaN threshold must never become a valid empty scene.
351
+ """
352
+ if (isinstance(min_confidence, bool) or not isinstance(min_confidence, numbers.Real)
353
+ or not math.isfinite(min_confidence) or not 0<=min_confidence<=1):
354
+ raise ModelContractError("min_confidence must be a finite number between 0 and 1")
355
+ if wanted is None:
356
+ return float(min_confidence), None
357
+ if not isinstance(wanted, (set, frozenset)) or any(not isinstance(name,str) for name in wanted):
358
+ raise ModelContractError("requested classes must be a set of class names")
359
+ canonical, unknown=class_index.resolve(sorted(wanted))
360
+ if unknown:
361
+ raise ModelContractError(f"requested classes are not declared by this artifact: {unknown!r}")
362
+ return float(min_confidence), canonical
363
+
333
364
  class OnnxDetector:
334
365
  """One ORT session, one inference at a time.
335
366
 
@@ -355,6 +386,7 @@ class OnnxDetector:
355
386
  ):
356
387
  self.model_path = model_path
357
388
  self.vocabulary = vocabulary
389
+ self._class_index = ClassIndex((vocabulary,))
358
390
  self.model_name = vocabulary.model_name
359
391
  self._lock = threading.Lock()
360
392
 
@@ -388,10 +420,12 @@ class OnnxDetector:
388
420
  the graph by `_read_graph_spec`, so by the time a frame arrives there is
389
421
  no decision left to get wrong.
390
422
  """
423
+ min_confidence, wanted = _checked_detector_request(min_confidence, wanted, self._class_index)
391
424
  started = time.perf_counter()
392
425
  layout = self.spec.output_layout
393
426
  blob, geometry, frame_w, frame_h = preprocess_for_layout(
394
- layout, jpeg, self.spec.width, self.spec.height
427
+ layout, jpeg, self.spec.width, self.spec.height,
428
+ input_preprocessing=self.spec.preprocessing,
395
429
  )
396
430
 
397
431
  with self._lock:
@@ -496,7 +530,7 @@ def _read_graph_spec(
496
530
  input_name=inputs[0].name,
497
531
  output_names=output_names,
498
532
  output_layout=layout,
499
- preprocessing=PREPROCESSING_BY_LAYOUT[layout],
533
+ preprocessing=vocabulary.input_preprocessing,
500
534
  height=int(height),
501
535
  width=int(width),
502
536
  num_queries=num_queries,
@@ -0,0 +1,27 @@
1
+ """Typed non-box contracts. Presence does not grant detection classes."""
2
+ from .registry import TaskModelContract
3
+ from .actor_action_contract import ActorActionModelContract,ActorActionOutput,ActorActionWindowContract,CONTACT_PREPROCESSING
4
+
5
+ RTMPOSE_MODEL_ID = "rtmpose_m_body7"
6
+ RTMPOSE_SHA256 = "5c0a4bf67953e6d2ac43ce15e77dc9d5d354ae18430a47d2c5963a7bc5683e3c"
7
+ RTMPOSE_PREPROCESSING = "rtmpose_rgb_affine_192x256_padding1.25_simcc2_min_axis_v1"
8
+ # CPU4, 2,774 real CCTV person poses: total process RSS 279,965,696 B,
9
+ # baseline 80,568,320 B. Budget 320 MiB includes process overhead and headroom.
10
+ RTMPOSE_BODY7 = TaskModelContract(
11
+ RTMPOSE_MODEL_ID, "pose_coco17", RTMPOSE_SHA256, 320 * 1024**2, RTMPOSE_PREPROCESSING)
12
+ # Development artifact only. This native capability grants no website field
13
+ # ownership or accuracy qualification; the API must select a qualified model.
14
+ PHONE_ACTION_E3 = ActorActionModelContract(
15
+ "phone_use_x3d_contact_e3_20261027","actor_actions",
16
+ "7b48d48a4e8df9e90d92dfcd22acbbed7450d2fd6e985ee616f3d392d17388f1",
17
+ 512*1024**2,CONTACT_PREPROCESSING,
18
+ outputs=(ActorActionOutput("phone_use",-6.035277843475342,12.99853229522705),),
19
+ window=ActorActionWindowContract(),requires_pose=True)
20
+ # Development artifacts are exercised through explicit test catalogues only.
21
+ # Adding one to this default catalogue requires independent qualification.
22
+ BUILTIN_TASK_MODELS = (RTMPOSE_BODY7,)
23
+
24
+ COCO17 = ("nose", "left_eye", "right_eye", "left_ear", "right_ear",
25
+ "left_shoulder", "right_shoulder", "left_elbow", "right_elbow",
26
+ "left_wrist", "right_wrist", "left_hip", "right_hip",
27
+ "left_knee", "right_knee", "left_ankle", "right_ankle")
@@ -0,0 +1,14 @@
1
+ """Keep small tracking/geometry BLAS work inside the native service's budget.
2
+
3
+ Configure before importing numerical frameworks. ONNX inference keeps its own
4
+ explicit --threads/backend policy; these pools do not accelerate 8x8 Kalman
5
+ updates and otherwise multiply the number of workers on a shared camera box.
6
+ """
7
+ import os
8
+
9
+ NUMERIC_WORKER_ENV = ("OPENBLAS_NUM_THREADS", "MKL_NUM_THREADS", "BLIS_NUM_THREADS",
10
+ "VECLIB_MAXIMUM_THREADS", "NUMEXPR_NUM_THREADS")
11
+
12
+ def configure_numeric_workers():
13
+ for key in NUMERIC_WORKER_ENV:
14
+ os.environ[key] = "1"
@@ -71,7 +71,7 @@ uninstall. The wrapper launch proof remains separate. JSON and logs are retained
71
71
  without uploading the installer or model again.
72
72
 
73
73
  To verify the public download afterward, dispatch release-connector-windows.yml
74
- with dry_run=true and verify_published_release set to the exact live version.
74
+ with dry_run=true and verify_published_release set to the exact listed version. The public channel keeps a mature release at its root for older updaters and lists immutable newer releases in releaseHistory; the harness selects the requested listed release.
75
75
  That mode uses the existing real-model E2E job and skips build/publication. The
76
76
  same full-install harness validates the public manifest, package hash and both
77
77
  trusted signatures before installation. It refuses laptop, client-PC and
@@ -158,15 +158,28 @@ try {
158
158
  $manifest = Get-Content -LiteralPath $ManifestPath -Raw | ConvertFrom-Json
159
159
  $receipt.artifactSource = 'signed-build-candidate'
160
160
  } else {
161
- $manifest = Invoke-RestMethod -Uri 'https://screen.trillboards.com/connector/trillboards-connector-windows.version.json' -Headers @{ 'Cache-Control' = 'no-cache' } -TimeoutSec 30
161
+ $publication = Invoke-RestMethod -Uri 'https://screen.trillboards.com/connector/trillboards-connector-windows.version.json' -Headers @{ 'Cache-Control' = 'no-cache' } -TimeoutSec 30
162
+ $entries = @($publication)
163
+ if ($publication.PSObject.Properties.Name -contains 'releaseHistory') {
164
+ if (@($publication.releaseHistory).Count -gt 24) { throw 'Public release history exceeds its bound' }
165
+ $entries += @($publication.releaseHistory)
166
+ }
167
+ $matches = @($entries | Where-Object { $_.connectorVersion -eq $ExpectedVersion })
168
+ if ($matches.Count -lt 1) { throw 'The requested version is not in the current authoritative public release channel' }
169
+ $manifest = $matches[0]
162
170
  $receipt.artifactSource = 'public-download'
163
171
  }
164
172
  if ($manifest.platform -ne 'windows-x64' -or $manifest.connectorVersion -ne $ExpectedVersion -or
165
173
  $manifest.gitSha -notmatch '^[0-9a-f]{40}$' -or $manifest.sha256 -notmatch '^[0-9a-f]{64}$' -or
166
- $manifest.sizeBytes -lt 2GB -or $manifest.sizeBytes -gt 4GB -or
167
- $manifest.downloadUrl -ne 'https://screen.trillboards.com/connector/SenseAnythingConnector.exe') {
174
+ $manifest.sizeBytes -lt 2GB -or $manifest.sizeBytes -gt 4GB) {
168
175
  throw 'The live public manifest does not identify the expected complete customer package'
169
176
  }
177
+ $immutableUrl = 'https://screen.trillboards.com/connector/releases/windows/' +
178
+ $manifest.connectorVersion + '/' + $manifest.gitSha + '/' + $manifest.sha256 + '/SenseAnythingConnector.exe'
179
+ if ($manifest.downloadUrl -ne $immutableUrl -and
180
+ $manifest.downloadUrl -ne 'https://screen.trillboards.com/connector/SenseAnythingConnector.exe') {
181
+ throw 'Public customer package is not at its validated immutable or legacy download address'
182
+ }
170
183
  $manifest | ConvertTo-Json -Depth 8 | Set-Content -LiteralPath (Join-Path $root 'public-manifest.json')
171
184
  $receipt.artifactGitSha = $manifest.gitSha; $receipt.phase = 'download'
172
185
  if ($localCandidate) {
@@ -0,0 +1,47 @@
1
+ import { type DetectorHttpPoster } from './LocalDetectorClient';
2
+ import { type ActorWindow } from './ActorWindow';
3
+ import { type ActorWindowContract } from './ActorWindowContract';
4
+ import { type ActorActionReading } from './ActorReview';
5
+ import type { TemporalActorIdentity } from './TemporalReviewJournal';
6
+ export interface ActorActionTask {
7
+ model: {
8
+ modelId: string;
9
+ sha256: string;
10
+ };
11
+ fields: string[];
12
+ window: ActorWindowContract;
13
+ }
14
+ export interface ActorActionRun {
15
+ version: 1;
16
+ modelId: string;
17
+ modelSha256: string;
18
+ preprocessing: string;
19
+ fields: string[];
20
+ results: Array<{
21
+ windowSha256: string;
22
+ actor: TemporalActorIdentity;
23
+ fields: Record<string, ActorActionReading>;
24
+ scores: Record<string, number | null>;
25
+ }>;
26
+ inferenceMs: number;
27
+ windows: Array<{
28
+ sha256: string;
29
+ proofSource: string;
30
+ }>;
31
+ sha256: string;
32
+ }
33
+ /** A retry consumes the exact saved action/window proofs without rerunning inference. */
34
+ export declare function validateActorActionRun(value: unknown, taskValue: ActorActionTask, windows: ActorWindow[]): ActorActionRun;
35
+ /** Selected native action execution. The archive owns history, scheduling and retry. */
36
+ export declare class ActorActionClient {
37
+ private readonly endpoint;
38
+ private readonly timeoutMs;
39
+ private readonly poster;
40
+ constructor(options?: {
41
+ baseUrl?: string;
42
+ timeoutMs?: number;
43
+ poster?: DetectorHttpPoster;
44
+ });
45
+ classify(taskValue: ActorActionTask, windows: ActorWindow[]): Promise<ActorActionRun>;
46
+ }
47
+ //# sourceMappingURL=ActorActionClient.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ActorActionClient.d.ts","sourceRoot":"","sources":["../src/ActorActionClient.ts"],"names":[],"mappings":"AACA,OAAO,EAA6C,KAAK,kBAAkB,EAAC,MAAM,uBAAuB,CAAC;AAE1G,OAAO,EAAwB,KAAK,WAAW,EAAC,MAAM,eAAe,CAAC;AACtE,OAAO,EAA0B,KAAK,mBAAmB,EAAC,MAAM,uBAAuB,CAAC;AACxF,OAAO,EAAyB,KAAK,kBAAkB,EAAC,MAAM,eAAe,CAAC;AAE9E,OAAO,KAAK,EAAC,qBAAqB,EAAC,MAAM,yBAAyB,CAAC;AAEnE,MAAM,WAAW,eAAe;IAC9B,KAAK,EAAC;QAAC,OAAO,EAAC,MAAM,CAAC;QAAA,MAAM,EAAC,MAAM,CAAA;KAAC,CAAC;IAAA,MAAM,EAAC,MAAM,EAAE,CAAC;IAAA,MAAM,EAAC,mBAAmB,CAAC;CACjF;AACD,MAAM,WAAW,cAAc;IAC7B,OAAO,EAAC,CAAC,CAAC;IAAA,OAAO,EAAC,MAAM,CAAC;IAAA,WAAW,EAAC,MAAM,CAAC;IAAA,aAAa,EAAC,MAAM,CAAC;IAAA,MAAM,EAAC,MAAM,EAAE,CAAC;IACjF,OAAO,EAAC,KAAK,CAAC;QAAC,YAAY,EAAC,MAAM,CAAC;QAAA,KAAK,EAAC,qBAAqB,CAAC;QAAA,MAAM,EAAC,MAAM,CAAC,MAAM,EAAC,kBAAkB,CAAC,CAAC;QACtG,MAAM,EAAC,MAAM,CAAC,MAAM,EAAC,MAAM,GAAC,IAAI,CAAC,CAAA;KAAC,CAAC,CAAC;IACtC,WAAW,EAAC,MAAM,CAAC;IAAA,OAAO,EAAC,KAAK,CAAC;QAAC,MAAM,EAAC,MAAM,CAAC;QAAA,WAAW,EAAC,MAAM,CAAA;KAAC,CAAC,CAAC;IAAA,MAAM,EAAC,MAAM,CAAC;CACpF;AA+ED,yFAAyF;AACzF,wBAAgB,sBAAsB,CAAC,KAAK,EAAC,OAAO,EAAC,SAAS,EAAC,eAAe,EAAC,OAAO,EAAC,WAAW,EAAE,GAAE,cAAc,CAOnH;AAED,wFAAwF;AACxF,qBAAa,iBAAiB;IAC5B,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAQ;IACjC,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAQ;IAClC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAoB;gBAC/B,OAAO,GAAC;QAAC,OAAO,CAAC,EAAC,MAAM,CAAC;QAAA,SAAS,CAAC,EAAC,MAAM,CAAC;QAAA,MAAM,CAAC,EAAC,kBAAkB,CAAA;KAAI;IAU/E,QAAQ,CAAC,SAAS,EAAC,eAAe,EAAC,OAAO,EAAC,WAAW,EAAE,GAAE,OAAO,CAAC,cAAc,CAAC;CAwCxF"}
@@ -0,0 +1,187 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ActorActionClient = void 0;
4
+ exports.validateActorActionRun = validateActorActionRun;
5
+ const crypto_1 = require("crypto");
6
+ const LocalDetectorClient_1 = require("./LocalDetectorClient");
7
+ const ActorTracking_1 = require("./ActorTracking");
8
+ const ActorWindow_1 = require("./ActorWindow");
9
+ const ActorWindowContract_1 = require("./ActorWindowContract");
10
+ const ActorReview_1 = require("./ActorReview");
11
+ const jpegFrameSize_1 = require("./jpegFrameSize");
12
+ const MAX_BODY = 32 * 1024 * 1024, MAX_WINDOWS = 32, MAX_IMAGES = 256;
13
+ const plain = (v) => !!v && typeof v === 'object' && !Array.isArray(v);
14
+ const keys = (v, want) => plain(v) && Object.keys(v).sort().join(',') === want;
15
+ const sha = (v) => typeof v === 'string' && /^[a-f0-9]{64}$/.test(v);
16
+ const id = (v) => typeof v === 'string' && /^[A-Za-z0-9][A-Za-z0-9_.-]{0,127}$/.test(v);
17
+ const finite = (v) => typeof v === 'number' && Number.isFinite(v);
18
+ const fieldKeys = (v, fields) => plain(v) && Object.keys(v).sort().join(',') === [...fields].sort().join(',');
19
+ function taskContract(value) {
20
+ if (!keys(value, 'fields,model,window') || !keys(value.model, 'modelId,sha256') || !id(value.model.modelId) || !sha(value.model.sha256)
21
+ || !Array.isArray(value.fields) || !value.fields.length || value.fields.length > 16
22
+ || value.fields.some(f => typeof f !== 'string' || !/^[a-z][a-z0-9_]{0,127}$/.test(f))
23
+ || new Set(value.fields).size !== value.fields.length)
24
+ throw Error('Invalid selected actor action task');
25
+ return { model: { ...value.model }, fields: [...value.fields], window: (0, ActorWindowContract_1.parseActorWindowContract)(value.window) };
26
+ }
27
+ function windowProofs(task, windows) {
28
+ if (!Array.isArray(windows) || windows.length > 256)
29
+ throw Error('Invalid bounded actor action windows');
30
+ const actors = new Set();
31
+ let anchor;
32
+ return windows.map(w => {
33
+ if (!keys(w, 'actor,contextSha256,contract,currentCapturedAtMs,currentFrameId,observedFrames,policySha256,samples,sha256,sourceId,usable,version')
34
+ || w.version !== 1 || !sha(w.sha256) || (0, ActorTracking_1.actorProofHash)((0, ActorWindowContract_1.parseActorWindowContract)(w.contract)) !== (0, ActorTracking_1.actorProofHash)(task.window)
35
+ || !Array.isArray(w.samples) || w.samples.length !== task.window.frames || !Number.isSafeInteger(w.observedFrames)
36
+ || w.observedFrames !== w.samples.filter(s => s.state === 'observed').length
37
+ || w.usable !== (w.observedFrames >= task.window.minObservedFrames)
38
+ || !id(w.sourceId) || !id(w.currentFrameId) || !sha(w.contextSha256) || !sha(w.policySha256)
39
+ || !Number.isSafeInteger(w.currentCapturedAtMs) || w.currentCapturedAtMs < 0)
40
+ throw Error('Invalid original actor action window');
41
+ const actor = (0, ActorTracking_1.validateActorIdentity)(w.actor, w.actor.cameraId);
42
+ const who = (0, ActorTracking_1.actorProofHash)(actor), at = (0, ActorTracking_1.actorProofHash)([actor.cameraId, actor.epoch, w.sourceId, w.contextSha256,
43
+ w.policySha256, w.currentFrameId, w.currentCapturedAtMs]);
44
+ if (actors.has(who) || anchor !== undefined && anchor !== at)
45
+ throw Error('Duplicate or unrelated physical actor action window');
46
+ actors.add(who);
47
+ anchor = at;
48
+ for (const sample of w.samples) {
49
+ if (sample.state === 'unobservable')
50
+ continue;
51
+ const size = (0, jpegFrameSize_1.readJpegFrameSize)(sample.jpeg);
52
+ if (!Buffer.isBuffer(sample.jpeg) || !sample.jpeg.length || sample.jpeg.length > 16 * 1024 * 1024
53
+ || !size || size.width * size.height > 16777216 || (0, ActorTracking_1.actorProofHash)(sample.actor) !== who)
54
+ throw Error('Invalid original actor action pixels or association');
55
+ }
56
+ const last = w.samples[w.samples.length - 1];
57
+ if (last.state !== 'observed' || last.frameId !== w.currentFrameId || last.capturedAtMs !== w.currentCapturedAtMs)
58
+ throw Error('Actor action window lost its original anchor');
59
+ const { sha256, ...unsigned } = w, proofSource = (0, ActorWindow_1.actorWindowProofSource)(unsigned);
60
+ if (Buffer.byteLength(proofSource) > 1024 * 1024 || (0, crypto_1.createHash)('sha256').update(proofSource, 'utf8').digest('hex') !== sha256)
61
+ throw Error('Actor action original window proof changed');
62
+ return { sha256, proofSource };
63
+ });
64
+ }
65
+ function response(value, task, windows) {
66
+ const v = value;
67
+ if (!keys(v, 'fields,inferenceMs,modelId,modelSha256,preprocessing,results,version') || v.version !== 1
68
+ || v.modelId !== task.model.modelId || v.modelSha256 !== task.model.sha256
69
+ || typeof v.preprocessing !== 'string' || !/^[A-Za-z0-9_.-]{1,128}$/.test(v.preprocessing)
70
+ || !Array.isArray(v.fields) || v.fields.length !== task.fields.length || new Set(v.fields).size !== v.fields.length
71
+ || v.fields.some((field) => !task.fields.includes(field))
72
+ || !finite(v.inferenceMs) || v.inferenceMs < 0
73
+ || !Array.isArray(v.results) || v.results.length !== windows.length)
74
+ throw Error('Invalid selected actor action runtime proof');
75
+ const pending = new Map(windows.map(w => [w.sha256, w]));
76
+ const results = v.results.map((r) => {
77
+ const w = pending.get(r?.windowSha256);
78
+ if (!keys(r, 'actor,fields,scores,windowSha256') || !w || (0, ActorTracking_1.actorProofHash)(r.actor) !== (0, ActorTracking_1.actorProofHash)(w.actor)
79
+ || !fieldKeys(r.fields, task.fields) || !fieldKeys(r.scores, task.fields))
80
+ throw Error('Incomplete or changed physical actor action response');
81
+ pending.delete(r.windowSha256);
82
+ const fields = {}, scores = {};
83
+ for (const field of task.fields) {
84
+ const reading = (0, ActorReview_1.parseActorActionReading)(r.fields[field]), score = r.scores[field];
85
+ if ((score !== null && !finite(score)) || (reading.state !== 'unobservable' && score === null)
86
+ || reading.state === 'unobservable' && reading.reason === 'model_uncertain' && score === null
87
+ || !w.usable && (reading.state !== 'unobservable' || reading.reason !== 'insufficient_history'))
88
+ throw Error('Actor action score or coverage does not support its reading');
89
+ fields[field] = reading;
90
+ scores[field] = score;
91
+ }
92
+ return { windowSha256: w.sha256, actor: { ...w.actor }, fields, scores };
93
+ });
94
+ if (pending.size)
95
+ throw Error('Omitted physical actor action result');
96
+ return { version: 1, modelId: task.model.modelId, modelSha256: task.model.sha256,
97
+ preprocessing: v.preprocessing, fields: [...task.fields], results, inferenceMs: v.inferenceMs };
98
+ }
99
+ /** A retry consumes the exact saved action/window proofs without rerunning inference. */
100
+ function validateActorActionRun(value, taskValue, windows) {
101
+ const task = taskContract(taskValue), proofs = windowProofs(task, windows), v = value;
102
+ if (!keys(v, 'fields,inferenceMs,modelId,modelSha256,preprocessing,results,sha256,version,windows') || !sha(v.sha256)
103
+ || (0, ActorTracking_1.actorProofHash)(v.windows) !== (0, ActorTracking_1.actorProofHash)(proofs))
104
+ throw Error('Saved actor action window proofs changed');
105
+ const { sha256, windows: stored, ...raw } = v;
106
+ if ((0, ActorTracking_1.actorProofHash)({ ...raw, windows: stored }) !== sha256)
107
+ throw Error('Saved actor action runtime proof changed');
108
+ return { ...response(raw, task, windows), windows: proofs, sha256 };
109
+ }
110
+ /** Selected native action execution. The archive owns history, scheduling and retry. */
111
+ class ActorActionClient {
112
+ constructor(options = {}) {
113
+ const base = new URL(options.baseUrl ?? 'http://127.0.0.1:' + LocalDetectorClient_1.DEFAULT_DETECTOR_PORT);
114
+ if (base.protocol !== 'http:' || !['127.0.0.1', 'localhost', '[::1]'].includes(base.hostname)
115
+ || base.username || base.password || base.pathname !== '/' || base.search || base.hash)
116
+ throw Error('Actor action service requires its local detector address');
117
+ this.endpoint = base.origin + '/actor-actions';
118
+ this.timeoutMs = options.timeoutMs ?? 30000;
119
+ if (!Number.isSafeInteger(this.timeoutMs) || this.timeoutMs < 1 || this.timeoutMs > 600000)
120
+ throw Error('Invalid bounded actor action deadline');
121
+ this.poster = options.poster ?? LocalDetectorClient_1.defaultDetectorPoster;
122
+ }
123
+ async classify(taskValue, windows) {
124
+ const task = taskContract(taskValue), proofs = windowProofs(task, windows);
125
+ const baseBytes = Buffer.byteLength(JSON.stringify({ version: 1, model: task.model, fields: task.fields, windows: [], images: [] }));
126
+ const chunks = [];
127
+ let chunk = { indices: [], images: new Map(), bytes: baseBytes };
128
+ for (let index = 0; index < windows.length; index++) {
129
+ const originals = new Map();
130
+ for (const s of windows[index].samples)
131
+ if (s.state === 'observed')
132
+ originals.set(s.imageSha256, s.jpeg);
133
+ const proofBytes = Buffer.byteLength(JSON.stringify(proofs[index]));
134
+ const imageBytes = (imageSha, bytes) => Buffer.byteLength(JSON.stringify({ sha256: imageSha, jpeg: '' })) + 4 * Math.ceil(bytes.length / 3);
135
+ const alone = baseBytes + proofBytes + [...originals].reduce((total, [imageSha, bytes], i) => total + imageBytes(imageSha, bytes) + (i ? 1 : 0), 0);
136
+ if (alone > MAX_BODY || originals.size > MAX_IMAGES)
137
+ throw Error('Actor action window exceeds bounded local request; evidence retained');
138
+ const additional = () => {
139
+ let bytes = proofBytes + (chunk.indices.length ? 1 : 0), count = chunk.images.size;
140
+ for (const [imageSha, original] of originals)
141
+ if (!chunk.images.has(imageSha)) {
142
+ bytes += imageBytes(imageSha, original) + (count ? 1 : 0);
143
+ count++;
144
+ }
145
+ return { bytes, count };
146
+ };
147
+ let extra = additional();
148
+ if (chunk.indices.length && (chunk.indices.length >= MAX_WINDOWS || extra.count > MAX_IMAGES || chunk.bytes + extra.bytes > MAX_BODY)) {
149
+ chunks.push(chunk);
150
+ chunk = { indices: [], images: new Map(), bytes: baseBytes };
151
+ extra = additional();
152
+ }
153
+ chunk.indices.push(index);
154
+ chunk.bytes += extra.bytes;
155
+ for (const [imageSha, original] of originals)
156
+ chunk.images.set(imageSha, original);
157
+ }
158
+ if (chunk.indices.length || !chunks.length)
159
+ chunks.push(chunk);
160
+ let result;
161
+ for (const part of chunks) {
162
+ const body = JSON.stringify({ version: 1, model: task.model, fields: task.fields, windows: part.indices.map(i => proofs[i]),
163
+ images: [...part.images].map(([sha256, jpeg]) => ({ sha256, jpeg: jpeg.toString('base64') })) });
164
+ if (Buffer.byteLength(body) !== part.bytes || part.bytes > MAX_BODY)
165
+ throw Error('Actor action request budget changed');
166
+ const reply = await this.poster(this.endpoint, { method: 'POST', headers: { 'Content-Type': 'application/json',
167
+ 'Content-Length': String(Buffer.byteLength(body)), Accept: 'application/json' }, timeoutMs: this.timeoutMs }, body);
168
+ if (reply.statusCode < 200 || reply.statusCode >= 300)
169
+ throw Error('Selected actor action service failed: ' + reply.statusCode);
170
+ if (reply.body.length > 1024 * 1024)
171
+ throw Error('Unbounded actor action response');
172
+ const current = response(JSON.parse(reply.body), task, part.indices.map(i => windows[i]));
173
+ if (result) {
174
+ if (result.preprocessing !== current.preprocessing)
175
+ throw Error('Actor action contract changed between batches');
176
+ result.results.push(...current.results);
177
+ result.inferenceMs += current.inferenceMs;
178
+ }
179
+ else
180
+ result = current;
181
+ }
182
+ const unsigned = { ...result, windows: proofs };
183
+ return { ...unsigned, sha256: (0, ActorTracking_1.actorProofHash)(unsigned) };
184
+ }
185
+ }
186
+ exports.ActorActionClient = ActorActionClient;
187
+ //# sourceMappingURL=ActorActionClient.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ActorActionClient.js","sourceRoot":"","sources":["../src/ActorActionClient.ts"],"names":[],"mappings":";;;AAiGA,wDAOC;AAxGD,mCAAkC;AAClC,+DAA0G;AAC1G,mDAAqE;AACrE,+CAAsE;AACtE,+DAAwF;AACxF,+CAA8E;AAC9E,mDAAkD;AAYlD,MAAM,QAAQ,GAAC,EAAE,GAAC,IAAI,GAAC,IAAI,EAAC,WAAW,GAAC,EAAE,EAAC,UAAU,GAAC,GAAG,CAAC;AAC1D,MAAM,KAAK,GAAC,CAAC,CAAS,EAAyB,EAAE,CAAA,CAAC,CAAC,CAAC,IAAE,OAAO,CAAC,KAAG,QAAQ,IAAE,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;AAC7F,MAAM,IAAI,GAAC,CAAC,CAAS,EAAC,IAAW,EAAC,EAAE,CAAA,KAAK,CAAC,CAAC,CAAC,IAAE,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,KAAG,IAAI,CAAC;AACrF,MAAM,GAAG,GAAC,CAAC,CAAS,EAAC,EAAE,CAAA,OAAO,CAAC,KAAG,QAAQ,IAAE,gBAAgB,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AACrE,MAAM,EAAE,GAAC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view } from './ActorReview';
3
+ import type { AudienceAnalyzeRequest } from './AudienceAnalyzeClient';
4
+ import type { ModelSelection } from './RuntimeModelSelection';
5
+ export interface ActorActionProduction {
6
+ actorReview: ActorReview;
7
+ actorActionRuns: ActorActionRun[];
8
+ actorPerceptionSha256: string;
9
+ }
10
+ export declare const hasSelectedActorActions: (selection: ModelSelection | null) => boolean;
11
+ /** The selected action consumes original physical tracks; it owns no capture or delivery queue. */
12
+ export declare class ActorActionProducer {
13
+ private readonly runtime;
14
+ constructor(runtime: ActorActionClient);
15
+ produce(request: AudienceAnalyzeRequest, selection: ModelSelection | null, cached?: Partial<ActorActionProduction>): Promise<ActorActionProduction | null>;
16
+ }
17
+ //# sourceMappingURL=ActorActionProducer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ActorActionProducer.d.ts","sourceRoot":"","sources":["../src/ActorActionProducer.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,iBAAiB,EAAwB,KAAK,cAAc,EAAsB,MAAM,qBAAqB,CAAC;AAEtH,OAAO,EAAkB,KAAK,WAAW,EAA+C,MAAM,eAAe,CAAC;AAG9G,OAAO,KAAK,EAAC,sBAAsB,EAAC,MAAM,yBAAyB,CAAC;AACpE,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,yBAAyB,CAAC;AAG5D,MAAM,WAAW,qBAAqB;IACpC,WAAW,EAAC,WAAW,CAAC;IAAA,eAAe,EAAC,cAAc,EAAE,CAAC;IAAA,qBAAqB,EAAC,MAAM,CAAC;CACvF;AACD,eAAO,MAAM,uBAAuB,GAAE,WAAU,cAAc,GAAC,IAAI,KAAE,OACH,CAAC;AAEnE,mGAAmG;AACnG,qBAAa,mBAAmB;IAClB,OAAO,CAAC,QAAQ,CAAC,OAAO;gBAAP,OAAO,EAAC,iBAAiB;IAChD,OAAO,CAAC,OAAO,EAAC,sBAAsB,EAAC,SAAS,EAAC,cAAc,GAAC,IAAI,EACxE,MAAM,CAAC,EAAC,OAAO,CAAC,qBAAqB,CAAC,GAAE,OAAO,CAAC,qBAAqB,GAAC,IAAI,CAAC;CAiE9E"}