@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.
Files changed (101) hide show
  1. package/CAPABILITIES.md +211 -0
  2. package/dist/api.js +7 -6
  3. package/dist/api.js.map +1 -1
  4. package/dist/bootstrap.d.ts +16 -2
  5. package/dist/bootstrap.js +63 -14
  6. package/dist/bootstrap.js.map +1 -1
  7. package/dist/context/ContextManager.d.ts +66 -0
  8. package/dist/context/ContextManager.js +268 -0
  9. package/dist/context/ContextManager.js.map +1 -0
  10. package/dist/context/index.d.ts +7 -0
  11. package/dist/context/index.js +7 -0
  12. package/dist/context/index.js.map +1 -0
  13. package/dist/context/schema.d.ts +360 -0
  14. package/dist/context/schema.js +50 -0
  15. package/dist/context/schema.js.map +1 -0
  16. package/dist/context/types.d.ts +101 -0
  17. package/dist/context/types.js +8 -0
  18. package/dist/context/types.js.map +1 -0
  19. package/dist/decisions/engine.d.ts +43 -0
  20. package/dist/decisions/engine.js +112 -0
  21. package/dist/decisions/engine.js.map +1 -0
  22. package/dist/decisions/index.d.ts +9 -0
  23. package/dist/decisions/index.js +10 -0
  24. package/dist/decisions/index.js.map +1 -0
  25. package/dist/decisions/schema.d.ts +2166 -0
  26. package/dist/decisions/schema.js +143 -0
  27. package/dist/decisions/schema.js.map +1 -0
  28. package/dist/decisions/strategies/rules.d.ts +24 -0
  29. package/dist/decisions/strategies/rules.js +152 -0
  30. package/dist/decisions/strategies/rules.js.map +1 -0
  31. package/dist/decisions/strategies/score.d.ts +10 -0
  32. package/dist/decisions/strategies/score.js +29 -0
  33. package/dist/decisions/strategies/score.js.map +1 -0
  34. package/dist/decisions/types.d.ts +242 -0
  35. package/dist/decisions/types.js +2 -0
  36. package/dist/decisions/types.js.map +1 -0
  37. package/dist/editorLoader.d.ts +10 -0
  38. package/dist/editorLoader.js +38 -0
  39. package/dist/editorLoader.js.map +1 -1
  40. package/dist/events/EventBus.d.ts +59 -0
  41. package/dist/events/EventBus.js +154 -0
  42. package/dist/events/EventBus.js.map +1 -0
  43. package/dist/events/index.d.ts +9 -0
  44. package/dist/events/index.js +10 -0
  45. package/dist/events/index.js.map +1 -0
  46. package/dist/events/normalizers/canvas.d.ts +67 -0
  47. package/dist/events/normalizers/canvas.js +116 -0
  48. package/dist/events/normalizers/canvas.js.map +1 -0
  49. package/dist/events/normalizers/posthog.d.ts +29 -0
  50. package/dist/events/normalizers/posthog.js +155 -0
  51. package/dist/events/normalizers/posthog.js.map +1 -0
  52. package/dist/events/schema.d.ts +70 -0
  53. package/dist/events/schema.js +30 -0
  54. package/dist/events/schema.js.map +1 -0
  55. package/dist/events/types.d.ts +73 -0
  56. package/dist/events/types.js +41 -0
  57. package/dist/events/types.js.map +1 -0
  58. package/dist/hooks/useShadowCanvasConfig.d.ts +5 -1
  59. package/dist/hooks/useShadowCanvasConfig.js +17 -3
  60. package/dist/hooks/useShadowCanvasConfig.js.map +1 -1
  61. package/dist/index.d.ts +6 -0
  62. package/dist/index.js +15 -0
  63. package/dist/index.js.map +1 -1
  64. package/dist/overlays/schema.d.ts +48 -48
  65. package/dist/runtime.d.ts +86 -0
  66. package/dist/runtime.js +132 -0
  67. package/dist/runtime.js.map +1 -0
  68. package/dist/smart-canvas.esm.js +11 -11
  69. package/dist/smart-canvas.esm.js.map +4 -4
  70. package/dist/smart-canvas.js +1504 -17
  71. package/dist/smart-canvas.js.map +4 -4
  72. package/dist/smart-canvas.min.js +11 -11
  73. package/dist/smart-canvas.min.js.map +4 -4
  74. package/dist/state/StateStore.d.ts +41 -0
  75. package/dist/state/StateStore.js +170 -0
  76. package/dist/state/StateStore.js.map +1 -0
  77. package/dist/state/helpers/cooldowns.d.ts +7 -0
  78. package/dist/state/helpers/cooldowns.js +31 -0
  79. package/dist/state/helpers/cooldowns.js.map +1 -0
  80. package/dist/state/helpers/dismissals.d.ts +7 -0
  81. package/dist/state/helpers/dismissals.js +34 -0
  82. package/dist/state/helpers/dismissals.js.map +1 -0
  83. package/dist/state/helpers/frequency.d.ts +8 -0
  84. package/dist/state/helpers/frequency.js +43 -0
  85. package/dist/state/helpers/frequency.js.map +1 -0
  86. package/dist/state/index.d.ts +7 -0
  87. package/dist/state/index.js +7 -0
  88. package/dist/state/index.js.map +1 -0
  89. package/dist/state/schema.d.ts +49 -0
  90. package/dist/state/schema.js +25 -0
  91. package/dist/state/schema.js.map +1 -0
  92. package/dist/state/types.d.ts +137 -0
  93. package/dist/state/types.js +9 -0
  94. package/dist/state/types.js.map +1 -0
  95. package/dist/telemetry/adapters/posthog.d.ts +1 -1
  96. package/dist/telemetry/adapters/posthog.js +1 -1
  97. package/dist/telemetry/adapters/posthog.js.map +1 -1
  98. package/dist/types.d.ts +8 -0
  99. package/package.json +2 -2
  100. package/schema/canvas-config.schema.json +205 -0
  101. package/schema/runtime-context.schema.json +131 -0
@@ -0,0 +1,50 @@
1
+ /**
2
+ * Zod schemas for RuntimeContext validation.
3
+ */
4
+ import { z } from "zod";
5
+ export const PageContextZ = z.object({
6
+ url: z.string(),
7
+ routeId: z.string().optional(),
8
+ title: z.string().optional(),
9
+ locale: z.string().optional(),
10
+ });
11
+ export const PageHistoryEntryZ = z.object({
12
+ url: z.string(),
13
+ ts: z.number(),
14
+ });
15
+ export const SessionContextZ = z.object({
16
+ sessionId: z.string(),
17
+ startTs: z.number(),
18
+ pageHistory: z.array(PageHistoryEntryZ).optional(),
19
+ });
20
+ export const ViewportContextZ = z.object({
21
+ width: z.number(),
22
+ height: z.number(),
23
+ });
24
+ export const BoundingBoxZ = z.object({
25
+ x: z.number(),
26
+ y: z.number(),
27
+ w: z.number(),
28
+ h: z.number(),
29
+ });
30
+ export const AnchorStateZ = z.object({
31
+ anchorId: z.string(),
32
+ present: z.boolean(),
33
+ visible: z.boolean().optional(),
34
+ boundingBox: BoundingBoxZ.optional(),
35
+ });
36
+ export const AugmentationZ = z.record(z.union([z.number(), z.string(), z.boolean(), z.undefined()]));
37
+ export const RuntimeContextZ = z.object({
38
+ page: PageContextZ,
39
+ session: SessionContextZ,
40
+ viewport: ViewportContextZ,
41
+ anchors: z.array(AnchorStateZ).optional(),
42
+ augmented: AugmentationZ.optional(),
43
+ });
44
+ /**
45
+ * Validate a RuntimeContext object.
46
+ */
47
+ export function validateRuntimeContext(data) {
48
+ return RuntimeContextZ.safeParse(data);
49
+ }
50
+ //# sourceMappingURL=schema.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema.js","sourceRoot":"","sources":["../../src/context/schema.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,CAAC,MAAM,CAAC;IACnC,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE;IACf,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC9B,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC5B,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CAC9B,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,CAAC,MAAM,CAAC;IACxC,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE;IACf,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE;CACf,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,CAAC,MAAM,CAAC;IACtC,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE;IACrB,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE;IACnB,WAAW,EAAE,CAAC,CAAC,KAAK,CAAC,iBAAiB,CAAC,CAAC,QAAQ,EAAE;CACnD,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,CAAC,MAAM,CAAC;IACvC,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE;IACjB,MAAM,EAAE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* The RuntimeContext represents the current state of the page, session, viewport,
5
+ * and other environmental factors that can be used for adaptive decision-making.
6
+ */
7
+ /**
8
+ * Page context - information about the current page.
9
+ */
10
+ export interface PageContext {
11
+ /** Current page URL */
12
+ url: string;
13
+ /** Matched route pattern from RoutesConfig (e.g., "/products/:id") */
14
+ routeId?: string;
15
+ /** Document title */
16
+ title?: string;
17
+ /** Page locale (e.g., "en-US") */
18
+ locale?: string;
19
+ }
20
+ /**
21
+ * Page history entry for session tracking.
22
+ */
23
+ export interface PageHistoryEntry {
24
+ /** Page URL */
25
+ url: string;
26
+ /** Timestamp when page was visited */
27
+ ts: number;
28
+ }
29
+ /**
30
+ * Session context - information about the current session.
31
+ */
32
+ export interface SessionContext {
33
+ /** Unique session ID (from PostHog) */
34
+ sessionId: string;
35
+ /** Session start timestamp */
36
+ startTs: number;
37
+ /** Page history within this session */
38
+ pageHistory?: PageHistoryEntry[];
39
+ }
40
+ /**
41
+ * Viewport context - information about the viewport size.
42
+ */
43
+ export interface ViewportContext {
44
+ /** Viewport width in pixels */
45
+ width: number;
46
+ /** Viewport height in pixels */
47
+ height: number;
48
+ }
49
+ /**
50
+ * Bounding box for anchor elements.
51
+ */
52
+ export interface BoundingBox {
53
+ x: number;
54
+ y: number;
55
+ w: number;
56
+ h: number;
57
+ }
58
+ /**
59
+ * Anchor state - tracks visibility and position of anchored elements.
60
+ */
61
+ export interface AnchorState {
62
+ /** Anchor element ID */
63
+ anchorId: string;
64
+ /** Whether the element is present in the DOM */
65
+ present: boolean;
66
+ /** Whether the element is visible in the viewport */
67
+ visible?: boolean;
68
+ /** Element's bounding box (when visible) */
69
+ boundingBox?: BoundingBox;
70
+ }
71
+ /**
72
+ * Augmentation data from ML models (Phase 3).
73
+ * Placeholder for future implementation.
74
+ */
75
+ export interface Augmentation {
76
+ /** Augmentation confidence scores by field name */
77
+ [field: string]: number | string | boolean | undefined;
78
+ }
79
+ /**
80
+ * The complete runtime context available to adaptives.
81
+ */
82
+ export interface RuntimeContext {
83
+ /** Current page information */
84
+ page: PageContext;
85
+ /** Current session information */
86
+ session: SessionContext;
87
+ /** Current viewport size */
88
+ viewport: ViewportContext;
89
+ /** Tracked anchor element states (optional) */
90
+ anchors?: AnchorState[];
91
+ /** ML-derived augmentation data (Phase 3) */
92
+ augmented?: Augmentation;
93
+ }
94
+ /**
95
+ * Callback for context changes.
96
+ */
97
+ export type ContextChangeCallback = (context: RuntimeContext, previousContext: RuntimeContext) => void;
98
+ /**
99
+ * Unsubscribe function returned by subscribe().
100
+ */
101
+ export type Unsubscribe = () => void;
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Runtime Context Types
3
+ *
4
+ * The RuntimeContext represents the current state of the page, session, viewport,
5
+ * and other environmental factors that can be used for adaptive decision-making.
6
+ */
7
+ export {};
8
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/context/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG"}
@@ -0,0 +1,43 @@
1
+ /**
2
+ * Decision Engine
3
+ *
4
+ * The central evaluation engine for DecisionStrategy objects.
5
+ * Routes strategies to their appropriate evaluators.
6
+ */
7
+ import type { DecisionStrategy, DecisionResult } from "./types";
8
+ import type { RuntimeContext } from "../context/types";
9
+ import type { StateStore } from "../state/StateStore";
10
+ import type { EventBus } from "../events/EventBus";
11
+ import type { SessionMetricTracker } from "../metrics/sessionMetrics";
12
+ /**
13
+ * Options for the decision engine evaluate function.
14
+ */
15
+ export interface EvaluateOptions {
16
+ /** State store for dismissal/cooldown/frequency checks */
17
+ state?: StateStore;
18
+ /** Event bus for event_occurred checks */
19
+ events?: EventBus;
20
+ /** Session metric tracker for session_metric checks */
21
+ sessionMetrics?: SessionMetricTracker;
22
+ }
23
+ /**
24
+ * Evaluate a DecisionStrategy against the current context.
25
+ *
26
+ * @param strategy - The decision strategy to evaluate
27
+ * @param context - The runtime context
28
+ * @param options - Additional evaluation options
29
+ * @returns The decision result
30
+ */
31
+ export declare function evaluate<T>(strategy: DecisionStrategy<T>, context: RuntimeContext, options?: EvaluateOptions): Promise<DecisionResult<T>>;
32
+ /**
33
+ * Synchronous version of evaluate for simple strategies.
34
+ * Use this when you know the strategy doesn't require async operations.
35
+ */
36
+ export declare function evaluateSync<T>(strategy: DecisionStrategy<T>, context: RuntimeContext, options?: EvaluateOptions): DecisionResult<T>;
37
+ /**
38
+ * Create a decision engine with pre-bound options.
39
+ */
40
+ export declare function createDecisionEngine(options: EvaluateOptions): {
41
+ evaluate: <T>(strategy: DecisionStrategy<T>, context: RuntimeContext) => Promise<DecisionResult<T>>;
42
+ evaluateSync: <T>(strategy: DecisionStrategy<T>, context: RuntimeContext) => DecisionResult<T>;
43
+ };
@@ -0,0 +1,112 @@
1
+ import { evaluateRuleStrategy } from "./strategies/rules";
2
+ import { evaluateScoreStrategy } from "./strategies/score";
3
+ /**
4
+ * Create an EvaluationContext from runtime components.
5
+ */
6
+ function createEvaluationContext(context, options) {
7
+ const { state, events, sessionMetrics } = options;
8
+ return {
9
+ context,
10
+ state: state
11
+ ? {
12
+ isDismissed: (key) => state.dismissals.isDismissed(key),
13
+ isCooldownActive: (key) => state.cooldowns.isActive(key),
14
+ getFrequencyCount: (key) => state.frequency.count(key),
15
+ getSessionMetric: (key) => { var _a; return (_a = sessionMetrics === null || sessionMetrics === void 0 ? void 0 : sessionMetrics.get(key)) !== null && _a !== void 0 ? _a : 0; },
16
+ }
17
+ : undefined,
18
+ events: events
19
+ ? {
20
+ hasRecentEvent: (eventName, withinMs) => events.hasRecentEvent(eventName, withinMs),
21
+ }
22
+ : undefined,
23
+ };
24
+ }
25
+ /**
26
+ * Evaluate a DecisionStrategy against the current context.
27
+ *
28
+ * @param strategy - The decision strategy to evaluate
29
+ * @param context - The runtime context
30
+ * @param options - Additional evaluation options
31
+ * @returns The decision result
32
+ */
33
+ export async function evaluate(strategy, context, options = {}) {
34
+ const evalContext = createEvaluationContext(context, options);
35
+ switch (strategy.type) {
36
+ case "rules":
37
+ return evaluateRuleStrategy(strategy, evalContext);
38
+ case "score":
39
+ return evaluateScoreStrategy(strategy, evalContext);
40
+ case "model":
41
+ // Phase 3: Model-based strategy
42
+ // For now, return default
43
+ return {
44
+ value: strategy.default,
45
+ isFallback: true,
46
+ matchInfo: {
47
+ strategyType: "model",
48
+ },
49
+ };
50
+ case "external":
51
+ // Phase 3: External strategy
52
+ // For now, return default
53
+ return {
54
+ value: strategy.default,
55
+ isFallback: true,
56
+ matchInfo: {
57
+ strategyType: "external",
58
+ },
59
+ };
60
+ default:
61
+ // Unknown strategy type
62
+ console.warn("[DecisionEngine] Unknown strategy type:", strategy.type);
63
+ return {
64
+ value: undefined,
65
+ isFallback: true,
66
+ matchInfo: {
67
+ strategyType: strategy.type,
68
+ },
69
+ };
70
+ }
71
+ }
72
+ /**
73
+ * Synchronous version of evaluate for simple strategies.
74
+ * Use this when you know the strategy doesn't require async operations.
75
+ */
76
+ export function evaluateSync(strategy, context, options = {}) {
77
+ const evalContext = createEvaluationContext(context, options);
78
+ switch (strategy.type) {
79
+ case "rules":
80
+ return evaluateRuleStrategy(strategy, evalContext);
81
+ case "score":
82
+ return evaluateScoreStrategy(strategy, evalContext);
83
+ case "model":
84
+ case "external":
85
+ // These require async, return default
86
+ return {
87
+ value: strategy.default,
88
+ isFallback: true,
89
+ matchInfo: {
90
+ strategyType: strategy.type,
91
+ },
92
+ };
93
+ default:
94
+ return {
95
+ value: undefined,
96
+ isFallback: true,
97
+ matchInfo: {
98
+ strategyType: strategy.type,
99
+ },
100
+ };
101
+ }
102
+ }
103
+ /**
104
+ * Create a decision engine with pre-bound options.
105
+ */
106
+ export function createDecisionEngine(options) {
107
+ return {
108
+ evaluate: (strategy, context) => evaluate(strategy, context, options),
109
+ evaluateSync: (strategy, context) => evaluateSync(strategy, context, options),
110
+ };
111
+ }
112
+ //# sourceMappingURL=engine.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"engine.js","sourceRoot":"","sources":["../../src/decisions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AAU,EAAE,IAAI;gBAChB,SAAS,EAAE;oBACT,YAAY,EAAE,QAAQ,CAAC,IAAI;iBAC5B;aACF,CAAC;QAEJ;YACE,OAAO;gBACL,KAAK,EAAE,SAAc;gBACrB,UAAU,EAAE,IAAI;gBAChB,SAAS,EAAE;oBACT,YAAY,EAAG,QAAgB,CAAC,IAAI;iBACrC;aACF,CAAC;IACN,CAAC;AACH,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,oBAAoB,CAAC,OAAwB;IAC3D,OAAO;QACL,QAAQ,EAAE,CAAI,QAA6B,EAAE,OAAuB,EAAE,EAAE,CACtE,QAAQ,CAAC,QAAQ,EAAE,OAAO,EAAE,OAAO,CAAC;QACtC,YAAY,EAAE,CAAI,QAA6B,EAAE,OAAuB,EAAE,EAAE,CAC1E,YAAY,CAAC,QAAQ,EAAE,OAAO,EAAE,OAAO,CAAC;KAC3C,CAAC;AACJ,CAAC"}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Decisions module exports.
3
+ */
4
+ export * from "./types";
5
+ export * from "./schema";
6
+ export { evaluate, evaluateSync, createDecisionEngine } from "./engine";
7
+ export type { EvaluateOptions } from "./engine";
8
+ export { evaluateCondition, evaluateRule, evaluateRuleStrategy } from "./strategies/rules";
9
+ export { evaluateScoreStrategy } from "./strategies/score";
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Decisions module exports.
3
+ */
4
+ export * from "./types";
5
+ export * from "./schema";
6
+ export { evaluate, evaluateSync, createDecisionEngine } from "./engine";
7
+ // Strategy evaluators (for advanced use)
8
+ export { evaluateCondition, evaluateRule, evaluateRuleStrategy } from "./strategies/rules";
9
+ export { evaluateScoreStrategy } from "./strategies/score";
10
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/decisions/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAGxE,yCAAyC;AACzC,OAAO,EAAE,iBAAiB,EAAE,YAAY,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAC3F,OAAO,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC"}