@syntrologie/runtime-sdk 0.2.19 → 0.2.21
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/CAPABILITIES.md +211 -0
- package/dist/api.js +7 -6
- package/dist/api.js.map +1 -1
- package/dist/bootstrap.d.ts +16 -2
- package/dist/bootstrap.js +63 -14
- package/dist/bootstrap.js.map +1 -1
- package/dist/context/ContextManager.d.ts +66 -0
- package/dist/context/ContextManager.js +268 -0
- package/dist/context/ContextManager.js.map +1 -0
- package/dist/context/index.d.ts +7 -0
- package/dist/context/index.js +7 -0
- package/dist/context/index.js.map +1 -0
- package/dist/context/schema.d.ts +360 -0
- package/dist/context/schema.js +50 -0
- package/dist/context/schema.js.map +1 -0
- package/dist/context/types.d.ts +101 -0
- package/dist/context/types.js +8 -0
- package/dist/context/types.js.map +1 -0
- package/dist/decisions/engine.d.ts +43 -0
- package/dist/decisions/engine.js +112 -0
- package/dist/decisions/engine.js.map +1 -0
- package/dist/decisions/index.d.ts +9 -0
- package/dist/decisions/index.js +10 -0
- package/dist/decisions/index.js.map +1 -0
- package/dist/decisions/schema.d.ts +2166 -0
- package/dist/decisions/schema.js +143 -0
- package/dist/decisions/schema.js.map +1 -0
- package/dist/decisions/strategies/rules.d.ts +24 -0
- package/dist/decisions/strategies/rules.js +152 -0
- package/dist/decisions/strategies/rules.js.map +1 -0
- package/dist/decisions/strategies/score.d.ts +10 -0
- package/dist/decisions/strategies/score.js +29 -0
- package/dist/decisions/strategies/score.js.map +1 -0
- package/dist/decisions/types.d.ts +242 -0
- package/dist/decisions/types.js +2 -0
- package/dist/decisions/types.js.map +1 -0
- package/dist/editorLoader.d.ts +10 -0
- package/dist/editorLoader.js +38 -0
- package/dist/editorLoader.js.map +1 -1
- package/dist/events/EventBus.d.ts +59 -0
- package/dist/events/EventBus.js +154 -0
- package/dist/events/EventBus.js.map +1 -0
- package/dist/events/index.d.ts +9 -0
- package/dist/events/index.js +10 -0
- package/dist/events/index.js.map +1 -0
- package/dist/events/normalizers/canvas.d.ts +67 -0
- package/dist/events/normalizers/canvas.js +116 -0
- package/dist/events/normalizers/canvas.js.map +1 -0
- package/dist/events/normalizers/posthog.d.ts +29 -0
- package/dist/events/normalizers/posthog.js +155 -0
- package/dist/events/normalizers/posthog.js.map +1 -0
- package/dist/events/schema.d.ts +70 -0
- package/dist/events/schema.js +30 -0
- package/dist/events/schema.js.map +1 -0
- package/dist/events/types.d.ts +73 -0
- package/dist/events/types.js +41 -0
- package/dist/events/types.js.map +1 -0
- package/dist/hooks/useShadowCanvasConfig.d.ts +5 -1
- package/dist/hooks/useShadowCanvasConfig.js +17 -3
- package/dist/hooks/useShadowCanvasConfig.js.map +1 -1
- package/dist/index.d.ts +6 -0
- package/dist/index.js +15 -0
- package/dist/index.js.map +1 -1
- package/dist/overlays/schema.d.ts +48 -48
- package/dist/runtime.d.ts +86 -0
- package/dist/runtime.js +132 -0
- package/dist/runtime.js.map +1 -0
- package/dist/smart-canvas.esm.js +11 -11
- package/dist/smart-canvas.esm.js.map +4 -4
- package/dist/smart-canvas.js +1504 -17
- package/dist/smart-canvas.js.map +4 -4
- package/dist/smart-canvas.min.js +11 -11
- package/dist/smart-canvas.min.js.map +4 -4
- package/dist/state/StateStore.d.ts +41 -0
- package/dist/state/StateStore.js +170 -0
- package/dist/state/StateStore.js.map +1 -0
- package/dist/state/helpers/cooldowns.d.ts +7 -0
- package/dist/state/helpers/cooldowns.js +31 -0
- package/dist/state/helpers/cooldowns.js.map +1 -0
- package/dist/state/helpers/dismissals.d.ts +7 -0
- package/dist/state/helpers/dismissals.js +34 -0
- package/dist/state/helpers/dismissals.js.map +1 -0
- package/dist/state/helpers/frequency.d.ts +8 -0
- package/dist/state/helpers/frequency.js +43 -0
- package/dist/state/helpers/frequency.js.map +1 -0
- package/dist/state/index.d.ts +7 -0
- package/dist/state/index.js +7 -0
- package/dist/state/index.js.map +1 -0
- package/dist/state/schema.d.ts +49 -0
- package/dist/state/schema.js +25 -0
- package/dist/state/schema.js.map +1 -0
- package/dist/state/types.d.ts +137 -0
- package/dist/state/types.js +9 -0
- package/dist/state/types.js.map +1 -0
- package/dist/telemetry/adapters/posthog.d.ts +1 -1
- package/dist/telemetry/adapters/posthog.js +1 -1
- package/dist/telemetry/adapters/posthog.js.map +1 -1
- package/dist/types.d.ts +8 -0
- package/package.json +2 -2
- package/schema/canvas-config.schema.json +205 -0
- package/schema/runtime-context.schema.json +131 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"posthog.js","sourceRoot":"","sources":["../../../src/telemetry/adapters/posthog.ts"],"names":[],"mappings":"AAOA,OAAO,OAAO,MAAM,YAAY,CAAC;AAiEjC;;GAEG;AACH,MAAM,OAAO,cAAc;IAIzB,YAA6B,UAAiC,EAAE;;QAAnC,YAAO,GAAP,OAAO,CAA4B;QAC9D,IAAI,CAAC,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;QAC7B,IAAI,CAAC,oBAAoB,GAAG,OAAO,CAAC,oBAAoB,CAAC;QAEzD,IAAI,CAAC,IAAI,CAAC,MAAM,IAAI,OAAO,MAAM,KAAK,WAAW,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC;YACpE,IAAI,CAAC,MAAM,GAAG,OAAO,CAAC;YAEtB,uEAAuE;YACvE,mEAAmE;YACnE,MAAM,kBAAkB,GAAG,MAAA,OAAO,CAAC,kBAAkB,mCAAI,IAAI,CAAC;YAE9D,8DAA8D;YAC9D,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE;gBAC/B,QAAQ,EAAE,MAAA,OAAO,CAAC,OAAO,mCAAI,
|
|
1
|
+
{"version":3,"file":"posthog.js","sourceRoot":"","sources":["../../../src/telemetry/adapters/posthog.ts"],"names":[],"mappings":"AAOA,OAAO,OAAO,MAAM,YAAY,CAAC;AAiEjC;;GAEG;AACH,MAAM,OAAO,cAAc;IAIzB,YAA6B,UAAiC,EAAE;;QAAnC,Y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CAAC,EAAE,aAAa,aAAb,aAAa,cAAb,aAAa,GAAI,aAAa,WAAW,EAAE;YACjE,CAAC,GAAG,kBAAkB,KAAK,CAAC,EAAE,WAAW;SAC1C,CAAC,CAAC;QAEH,yDAAyD;QACzD,IAAI,CAAC,KAAK,CAAC,qBAAqB,EAAE;YAChC,eAAe,EAAE,aAAa;YAC9B,wBAAwB,EAAE,WAAW;YACrC,0BAA0B,EAAE,aAAa,aAAb,aAAa,cAAb,aAAa,GAAI,aAAa,WAAW,EAAE;SACxE,CAAC,CAAC;IACL,CAAC;IAED,mBAAmB,CAAC,UAAmC;;QACrD,8CAA8C;QAC9C,MAAA,IAAI,CAAC,MAAM,0CAAE,OAAO,CAAC,MAAM,EAAE,EAAE,IAAI,EAAE,UAAU,EAAE,CAAC,CAAC;IACrD,CAAC;IAED,uBAAuB,CAAC,UAAmC;;QACzD,0DAA0D;QAC1D,MAAA,IAAI,CAAC,MAAM,0CAAE,OAAO,CAAC,MAAM,EAAE,EAAE,SAAS,EAAE,UAAU,EAAE,CAAC,CAAC;IAC1D,CAAC;IAED,aAAa;;QACX,0DAA0D;QAC1D,8DAA8D;QAC9D,OAAO,MAAA,MAAC,IAAI,CAAC,MAAc,0CAAE,eAAe,kDAAI,CAAC;IACnD,CAAC;CACF;AAED;;GAEG;AACH,MAAM,UAAU,mBAAmB,CACjC,UAAiC,EAAE;IAEnC,OAAO,IAAI,cAAc,CAAC,OAAO,CAAC,CAAC;AACrC,CAAC"}
|
package/dist/types.d.ts
CHANGED
|
@@ -261,6 +261,7 @@ export interface TileStyle {
|
|
|
261
261
|
}
|
|
262
262
|
/**
|
|
263
263
|
* Experiment targeting for A/B tests
|
|
264
|
+
* @deprecated Use ActivationConfig with DecisionStrategy instead
|
|
264
265
|
*/
|
|
265
266
|
export interface TileExperiment {
|
|
266
267
|
featureKey?: string;
|
|
@@ -268,6 +269,7 @@ export interface TileExperiment {
|
|
|
268
269
|
variationValue?: string | number | boolean;
|
|
269
270
|
predicate?: (value: unknown) => boolean;
|
|
270
271
|
}
|
|
272
|
+
export type { ActivationConfig, RouteFilter, DecisionStrategy } from "./decisions/types";
|
|
271
273
|
/**
|
|
272
274
|
* Full tile configuration
|
|
273
275
|
*/
|
|
@@ -283,8 +285,14 @@ export interface TileConfig {
|
|
|
283
285
|
defaultExpanded?: boolean;
|
|
284
286
|
content: TileContent;
|
|
285
287
|
style?: TileStyle;
|
|
288
|
+
/** @deprecated Use activation.strategy instead */
|
|
286
289
|
experiment?: TileExperiment;
|
|
287
290
|
analyticsKey?: string;
|
|
291
|
+
/**
|
|
292
|
+
* Activation configuration for conditional rendering.
|
|
293
|
+
* Replaces the experiment field with more flexible context-aware decisions.
|
|
294
|
+
*/
|
|
295
|
+
activation?: import("./decisions/types").ActivationConfig;
|
|
288
296
|
}
|
|
289
297
|
import type { Patch } from "./hostPatcher/core/types";
|
|
290
298
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@syntrologie/runtime-sdk",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.21",
|
|
4
4
|
"description": "Syntrologie Runtime SDK for web experimentation and analytics",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"private": false,
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
"react-dom": ">=18.0.0"
|
|
60
60
|
},
|
|
61
61
|
"devDependencies": {
|
|
62
|
-
"@types/node": "^25.0.
|
|
62
|
+
"@types/node": "^25.0.9",
|
|
63
63
|
"@types/react": "~18.3.0",
|
|
64
64
|
"@types/react-dom": "~18.3.0",
|
|
65
65
|
"esbuild": "~0.25.0",
|
|
@@ -98,6 +98,7 @@
|
|
|
98
98
|
},
|
|
99
99
|
"experiment": {
|
|
100
100
|
"type": "object",
|
|
101
|
+
"description": "DEPRECATED: Use activation.strategy instead",
|
|
101
102
|
"properties": {
|
|
102
103
|
"featureKey": { "type": "string" },
|
|
103
104
|
"variationId": { "type": "number" },
|
|
@@ -106,6 +107,10 @@
|
|
|
106
107
|
},
|
|
107
108
|
"additionalProperties": true
|
|
108
109
|
},
|
|
110
|
+
"activation": {
|
|
111
|
+
"$ref": "#/$defs/activationConfig",
|
|
112
|
+
"description": "v2 activation config for conditional rendering"
|
|
113
|
+
},
|
|
109
114
|
"analyticsKey": { "type": "string" }
|
|
110
115
|
},
|
|
111
116
|
"additionalProperties": false
|
|
@@ -333,6 +338,206 @@
|
|
|
333
338
|
}
|
|
334
339
|
},
|
|
335
340
|
"additionalProperties": false
|
|
341
|
+
},
|
|
342
|
+
"activationConfig": {
|
|
343
|
+
"type": "object",
|
|
344
|
+
"description": "v2 activation configuration for conditional tile rendering",
|
|
345
|
+
"properties": {
|
|
346
|
+
"routes": { "$ref": "#/$defs/routeFilter" },
|
|
347
|
+
"strategy": { "$ref": "#/$defs/decisionStrategy" }
|
|
348
|
+
},
|
|
349
|
+
"additionalProperties": false
|
|
350
|
+
},
|
|
351
|
+
"routeFilter": {
|
|
352
|
+
"type": "object",
|
|
353
|
+
"properties": {
|
|
354
|
+
"include": {
|
|
355
|
+
"type": "array",
|
|
356
|
+
"items": { "type": "string" },
|
|
357
|
+
"description": "Routes where the tile should appear"
|
|
358
|
+
},
|
|
359
|
+
"exclude": {
|
|
360
|
+
"type": "array",
|
|
361
|
+
"items": { "type": "string" },
|
|
362
|
+
"description": "Routes where the tile should NOT appear"
|
|
363
|
+
}
|
|
364
|
+
},
|
|
365
|
+
"additionalProperties": false
|
|
366
|
+
},
|
|
367
|
+
"decisionStrategy": {
|
|
368
|
+
"oneOf": [
|
|
369
|
+
{ "$ref": "#/$defs/ruleStrategy" },
|
|
370
|
+
{ "$ref": "#/$defs/scoreStrategy" },
|
|
371
|
+
{ "$ref": "#/$defs/modelStrategy" },
|
|
372
|
+
{ "$ref": "#/$defs/externalStrategy" }
|
|
373
|
+
]
|
|
374
|
+
},
|
|
375
|
+
"ruleStrategy": {
|
|
376
|
+
"type": "object",
|
|
377
|
+
"required": ["type", "rules", "default"],
|
|
378
|
+
"properties": {
|
|
379
|
+
"type": { "const": "rules" },
|
|
380
|
+
"rules": {
|
|
381
|
+
"type": "array",
|
|
382
|
+
"items": { "$ref": "#/$defs/rule" }
|
|
383
|
+
},
|
|
384
|
+
"default": {}
|
|
385
|
+
},
|
|
386
|
+
"additionalProperties": false
|
|
387
|
+
},
|
|
388
|
+
"scoreStrategy": {
|
|
389
|
+
"type": "object",
|
|
390
|
+
"required": ["type", "field", "threshold", "above", "below"],
|
|
391
|
+
"properties": {
|
|
392
|
+
"type": { "const": "score" },
|
|
393
|
+
"field": { "type": "string" },
|
|
394
|
+
"threshold": { "type": "number" },
|
|
395
|
+
"above": {},
|
|
396
|
+
"below": {}
|
|
397
|
+
},
|
|
398
|
+
"additionalProperties": false
|
|
399
|
+
},
|
|
400
|
+
"modelStrategy": {
|
|
401
|
+
"type": "object",
|
|
402
|
+
"required": ["type", "modelId", "inputs", "outputMapping", "default"],
|
|
403
|
+
"properties": {
|
|
404
|
+
"type": { "const": "model" },
|
|
405
|
+
"modelId": { "type": "string" },
|
|
406
|
+
"inputs": { "type": "array", "items": { "type": "string" } },
|
|
407
|
+
"outputMapping": { "type": "object" },
|
|
408
|
+
"default": {}
|
|
409
|
+
},
|
|
410
|
+
"additionalProperties": false
|
|
411
|
+
},
|
|
412
|
+
"externalStrategy": {
|
|
413
|
+
"type": "object",
|
|
414
|
+
"required": ["type", "endpoint", "default"],
|
|
415
|
+
"properties": {
|
|
416
|
+
"type": { "const": "external" },
|
|
417
|
+
"endpoint": { "type": "string" },
|
|
418
|
+
"method": { "enum": ["GET", "POST"] },
|
|
419
|
+
"default": {},
|
|
420
|
+
"timeoutMs": { "type": "number" }
|
|
421
|
+
},
|
|
422
|
+
"additionalProperties": false
|
|
423
|
+
},
|
|
424
|
+
"rule": {
|
|
425
|
+
"type": "object",
|
|
426
|
+
"required": ["conditions", "value"],
|
|
427
|
+
"properties": {
|
|
428
|
+
"conditions": {
|
|
429
|
+
"type": "array",
|
|
430
|
+
"items": { "$ref": "#/$defs/condition" }
|
|
431
|
+
},
|
|
432
|
+
"value": {}
|
|
433
|
+
},
|
|
434
|
+
"additionalProperties": false
|
|
435
|
+
},
|
|
436
|
+
"condition": {
|
|
437
|
+
"oneOf": [
|
|
438
|
+
{
|
|
439
|
+
"type": "object",
|
|
440
|
+
"required": ["type", "url"],
|
|
441
|
+
"properties": {
|
|
442
|
+
"type": { "const": "page_url" },
|
|
443
|
+
"url": { "type": "string" }
|
|
444
|
+
},
|
|
445
|
+
"additionalProperties": false
|
|
446
|
+
},
|
|
447
|
+
{
|
|
448
|
+
"type": "object",
|
|
449
|
+
"required": ["type", "routeId"],
|
|
450
|
+
"properties": {
|
|
451
|
+
"type": { "const": "route" },
|
|
452
|
+
"routeId": { "type": "string" }
|
|
453
|
+
},
|
|
454
|
+
"additionalProperties": false
|
|
455
|
+
},
|
|
456
|
+
{
|
|
457
|
+
"type": "object",
|
|
458
|
+
"required": ["type", "anchorId", "state"],
|
|
459
|
+
"properties": {
|
|
460
|
+
"type": { "const": "anchor_visible" },
|
|
461
|
+
"anchorId": { "type": "string" },
|
|
462
|
+
"state": { "enum": ["visible", "present", "absent"] }
|
|
463
|
+
},
|
|
464
|
+
"additionalProperties": false
|
|
465
|
+
},
|
|
466
|
+
{
|
|
467
|
+
"type": "object",
|
|
468
|
+
"required": ["type", "eventName"],
|
|
469
|
+
"properties": {
|
|
470
|
+
"type": { "const": "event_occurred" },
|
|
471
|
+
"eventName": { "type": "string" },
|
|
472
|
+
"withinMs": { "type": "number" }
|
|
473
|
+
},
|
|
474
|
+
"additionalProperties": false
|
|
475
|
+
},
|
|
476
|
+
{
|
|
477
|
+
"type": "object",
|
|
478
|
+
"required": ["type", "key"],
|
|
479
|
+
"properties": {
|
|
480
|
+
"type": { "const": "state_equals" },
|
|
481
|
+
"key": { "type": "string" },
|
|
482
|
+
"value": {}
|
|
483
|
+
},
|
|
484
|
+
"additionalProperties": false
|
|
485
|
+
},
|
|
486
|
+
{
|
|
487
|
+
"type": "object",
|
|
488
|
+
"required": ["type"],
|
|
489
|
+
"properties": {
|
|
490
|
+
"type": { "const": "viewport" },
|
|
491
|
+
"minWidth": { "type": "number" },
|
|
492
|
+
"maxWidth": { "type": "number" },
|
|
493
|
+
"minHeight": { "type": "number" },
|
|
494
|
+
"maxHeight": { "type": "number" }
|
|
495
|
+
},
|
|
496
|
+
"additionalProperties": false
|
|
497
|
+
},
|
|
498
|
+
{
|
|
499
|
+
"type": "object",
|
|
500
|
+
"required": ["type", "key", "operator", "threshold"],
|
|
501
|
+
"properties": {
|
|
502
|
+
"type": { "const": "session_metric" },
|
|
503
|
+
"key": { "type": "string" },
|
|
504
|
+
"operator": { "enum": ["gte", "lte", "eq", "gt", "lt"] },
|
|
505
|
+
"threshold": { "type": "number" }
|
|
506
|
+
},
|
|
507
|
+
"additionalProperties": false
|
|
508
|
+
},
|
|
509
|
+
{
|
|
510
|
+
"type": "object",
|
|
511
|
+
"required": ["type", "key"],
|
|
512
|
+
"properties": {
|
|
513
|
+
"type": { "const": "dismissed" },
|
|
514
|
+
"key": { "type": "string" },
|
|
515
|
+
"inverted": { "type": "boolean" }
|
|
516
|
+
},
|
|
517
|
+
"additionalProperties": false
|
|
518
|
+
},
|
|
519
|
+
{
|
|
520
|
+
"type": "object",
|
|
521
|
+
"required": ["type", "key"],
|
|
522
|
+
"properties": {
|
|
523
|
+
"type": { "const": "cooldown_active" },
|
|
524
|
+
"key": { "type": "string" },
|
|
525
|
+
"inverted": { "type": "boolean" }
|
|
526
|
+
},
|
|
527
|
+
"additionalProperties": false
|
|
528
|
+
},
|
|
529
|
+
{
|
|
530
|
+
"type": "object",
|
|
531
|
+
"required": ["type", "key", "limit"],
|
|
532
|
+
"properties": {
|
|
533
|
+
"type": { "const": "frequency_limit" },
|
|
534
|
+
"key": { "type": "string" },
|
|
535
|
+
"limit": { "type": "number" },
|
|
536
|
+
"inverted": { "type": "boolean" }
|
|
537
|
+
},
|
|
538
|
+
"additionalProperties": false
|
|
539
|
+
}
|
|
540
|
+
]
|
|
336
541
|
}
|
|
337
542
|
}
|
|
338
543
|
}
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://syntropyforge.com/schemas/runtime-context.json",
|
|
4
|
+
"title": "Runtime Context",
|
|
5
|
+
"description": "The complete runtime context available to adaptives for decision-making",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"required": ["page", "session", "viewport"],
|
|
8
|
+
"properties": {
|
|
9
|
+
"page": {
|
|
10
|
+
"type": "object",
|
|
11
|
+
"description": "Current page information",
|
|
12
|
+
"required": ["url"],
|
|
13
|
+
"properties": {
|
|
14
|
+
"url": {
|
|
15
|
+
"type": "string",
|
|
16
|
+
"description": "Current page URL"
|
|
17
|
+
},
|
|
18
|
+
"routeId": {
|
|
19
|
+
"type": "string",
|
|
20
|
+
"description": "Matched route pattern from RoutesConfig"
|
|
21
|
+
},
|
|
22
|
+
"title": {
|
|
23
|
+
"type": "string",
|
|
24
|
+
"description": "Document title"
|
|
25
|
+
},
|
|
26
|
+
"locale": {
|
|
27
|
+
"type": "string",
|
|
28
|
+
"description": "Page locale (e.g., 'en-US')"
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
"additionalProperties": false
|
|
32
|
+
},
|
|
33
|
+
"session": {
|
|
34
|
+
"type": "object",
|
|
35
|
+
"description": "Current session information",
|
|
36
|
+
"required": ["sessionId", "startTs"],
|
|
37
|
+
"properties": {
|
|
38
|
+
"sessionId": {
|
|
39
|
+
"type": "string",
|
|
40
|
+
"description": "Unique session ID (from PostHog)"
|
|
41
|
+
},
|
|
42
|
+
"startTs": {
|
|
43
|
+
"type": "number",
|
|
44
|
+
"description": "Session start timestamp (ms since epoch)"
|
|
45
|
+
},
|
|
46
|
+
"pageHistory": {
|
|
47
|
+
"type": "array",
|
|
48
|
+
"description": "Page history within this session",
|
|
49
|
+
"items": {
|
|
50
|
+
"type": "object",
|
|
51
|
+
"required": ["url", "ts"],
|
|
52
|
+
"properties": {
|
|
53
|
+
"url": {
|
|
54
|
+
"type": "string",
|
|
55
|
+
"description": "Page URL"
|
|
56
|
+
},
|
|
57
|
+
"ts": {
|
|
58
|
+
"type": "number",
|
|
59
|
+
"description": "Timestamp when page was visited"
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
"additionalProperties": false
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
},
|
|
66
|
+
"additionalProperties": false
|
|
67
|
+
},
|
|
68
|
+
"viewport": {
|
|
69
|
+
"type": "object",
|
|
70
|
+
"description": "Current viewport size",
|
|
71
|
+
"required": ["width", "height"],
|
|
72
|
+
"properties": {
|
|
73
|
+
"width": {
|
|
74
|
+
"type": "number",
|
|
75
|
+
"description": "Viewport width in pixels"
|
|
76
|
+
},
|
|
77
|
+
"height": {
|
|
78
|
+
"type": "number",
|
|
79
|
+
"description": "Viewport height in pixels"
|
|
80
|
+
}
|
|
81
|
+
},
|
|
82
|
+
"additionalProperties": false
|
|
83
|
+
},
|
|
84
|
+
"anchors": {
|
|
85
|
+
"type": "array",
|
|
86
|
+
"description": "Tracked anchor element states",
|
|
87
|
+
"items": {
|
|
88
|
+
"type": "object",
|
|
89
|
+
"required": ["anchorId", "present"],
|
|
90
|
+
"properties": {
|
|
91
|
+
"anchorId": {
|
|
92
|
+
"type": "string",
|
|
93
|
+
"description": "Anchor element ID"
|
|
94
|
+
},
|
|
95
|
+
"present": {
|
|
96
|
+
"type": "boolean",
|
|
97
|
+
"description": "Whether the element is present in the DOM"
|
|
98
|
+
},
|
|
99
|
+
"visible": {
|
|
100
|
+
"type": "boolean",
|
|
101
|
+
"description": "Whether the element is visible in the viewport"
|
|
102
|
+
},
|
|
103
|
+
"boundingBox": {
|
|
104
|
+
"type": "object",
|
|
105
|
+
"description": "Element's bounding box",
|
|
106
|
+
"properties": {
|
|
107
|
+
"x": { "type": "number" },
|
|
108
|
+
"y": { "type": "number" },
|
|
109
|
+
"w": { "type": "number" },
|
|
110
|
+
"h": { "type": "number" }
|
|
111
|
+
},
|
|
112
|
+
"additionalProperties": false
|
|
113
|
+
}
|
|
114
|
+
},
|
|
115
|
+
"additionalProperties": false
|
|
116
|
+
}
|
|
117
|
+
},
|
|
118
|
+
"augmented": {
|
|
119
|
+
"type": "object",
|
|
120
|
+
"description": "ML-derived augmentation data (Phase 3)",
|
|
121
|
+
"additionalProperties": {
|
|
122
|
+
"oneOf": [
|
|
123
|
+
{ "type": "number" },
|
|
124
|
+
{ "type": "string" },
|
|
125
|
+
{ "type": "boolean" }
|
|
126
|
+
]
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
},
|
|
130
|
+
"additionalProperties": false
|
|
131
|
+
}
|