@syntrologie/runtime-sdk 2.13.0 → 2.15.0

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 (67) hide show
  1. package/README.md +1 -0
  2. package/dist/SmartCanvasElementLit.d.ts +166 -0
  3. package/dist/actions/schema.d.ts +776 -776
  4. package/dist/actions/schema.js +4 -3
  5. package/dist/actions/types.d.ts +8 -2
  6. package/dist/anchor/AnchorResolver.d.ts +1 -0
  7. package/dist/api-lit.d.ts +84 -0
  8. package/dist/apps/builtinRuntimeModules-lit.d.ts +20 -0
  9. package/dist/bootstrap-types.d.ts +10 -0
  10. package/dist/chunk-2IQ2PTLJ.js +871 -0
  11. package/dist/chunk-2IQ2PTLJ.js.map +7 -0
  12. package/dist/chunk-4HXPGXUC.js +226 -0
  13. package/dist/chunk-4HXPGXUC.js.map +7 -0
  14. package/dist/{chunk-GF364MMB.js → chunk-CVMZW3II.js} +1102 -1098
  15. package/dist/chunk-CVMZW3II.js.map +7 -0
  16. package/dist/{chunk-XDYJ64IN.js → chunk-GX7BBYX6.js} +4 -4
  17. package/dist/chunk-GX7BBYX6.js.map +7 -0
  18. package/dist/chunk-JMHRHAEL.js +18 -0
  19. package/dist/chunk-JMHRHAEL.js.map +7 -0
  20. package/dist/{chunk-L6RJMBR2.js → chunk-XVRDKBYF.js} +3 -3
  21. package/dist/components/ShadowCanvasOverlay.d.ts +1 -2
  22. package/dist/components/SyntroCanvasOverlay.d.ts +100 -0
  23. package/dist/components/SyntroDrawer.d.ts +110 -0
  24. package/dist/components/SyntroLauncher.d.ts +105 -0
  25. package/dist/components/SyntroTileCard.d.ts +74 -0
  26. package/dist/components/SyntroTileWheel.d.ts +51 -0
  27. package/dist/config/schema.d.ts +147 -136
  28. package/dist/config/schema.js +3 -2
  29. package/dist/controllers/DecisionController.d.ts +48 -0
  30. package/dist/controllers/NotificationsController.d.ts +59 -0
  31. package/dist/controllers/RuntimeController.d.ts +52 -0
  32. package/dist/controllers/RuntimeEventsController.d.ts +42 -0
  33. package/dist/controllers/ThemeController.d.ts +110 -0
  34. package/dist/controllers/index.d.ts +13 -0
  35. package/dist/decisions/schema.d.ts +47 -47
  36. package/dist/decisions/schema.js +2 -1
  37. package/dist/decisions/types.d.ts +4 -0
  38. package/dist/editorLoader.d.ts +5 -0
  39. package/dist/fetchers/experimentsFetcher.d.ts +3 -3
  40. package/dist/fetchers/mergeConfigs.d.ts +7 -7
  41. package/dist/index-lit.d.ts +40 -0
  42. package/dist/index.js +1264 -19
  43. package/dist/index.js.map +4 -4
  44. package/dist/interop/LitInReact.d.ts +27 -0
  45. package/dist/interop/ReactInLit.d.ts +42 -0
  46. package/dist/interop/index.d.ts +7 -0
  47. package/dist/metrics/sessionMetrics.d.ts +4 -0
  48. package/dist/notifications/SyntroToastStack.d.ts +43 -0
  49. package/dist/react-compat.d.ts +114 -0
  50. package/dist/react.js +6 -4
  51. package/dist/react.js.map +1 -1
  52. package/dist/smart-canvas.esm.js +856 -240
  53. package/dist/smart-canvas.esm.js.map +4 -4
  54. package/dist/smart-canvas.js +31387 -39860
  55. package/dist/smart-canvas.js.map +4 -4
  56. package/dist/smart-canvas.min.js +855 -240
  57. package/dist/smart-canvas.min.js.map +4 -4
  58. package/dist/theme/index.js +30 -0
  59. package/dist/theme/index.js.map +7 -0
  60. package/dist/version.d.ts +1 -1
  61. package/package.json +10 -1
  62. package/schema/canvas-config.schema.json +2347 -11396
  63. package/dist/chunk-BU4Z6PD7.js +0 -218
  64. package/dist/chunk-BU4Z6PD7.js.map +0 -7
  65. package/dist/chunk-GF364MMB.js.map +0 -7
  66. package/dist/chunk-XDYJ64IN.js.map +0 -7
  67. /package/dist/{chunk-L6RJMBR2.js.map → chunk-XVRDKBYF.js.map} +0 -0
@@ -31,9 +31,10 @@ import {
31
31
  WaitZ,
32
32
  WidgetConfigZ,
33
33
  coreActionStepSchemas
34
- } from "../chunk-L6RJMBR2.js";
35
- import "../chunk-XDYJ64IN.js";
36
- import "../chunk-BU4Z6PD7.js";
34
+ } from "../chunk-XVRDKBYF.js";
35
+ import "../chunk-GX7BBYX6.js";
36
+ import "../chunk-4HXPGXUC.js";
37
+ import "../chunk-JMHRHAEL.js";
37
38
  export {
38
39
  AddClassZ,
39
40
  AnchorIdZ,
@@ -341,6 +341,12 @@ export interface ActionEngineOptions {
341
341
  accumulator?: {
342
342
  subscribe: (cb: () => void) => () => void;
343
343
  };
344
+ sessionMetrics?: {
345
+ subscribe: (cb: () => void) => () => void;
346
+ };
347
+ events?: {
348
+ subscribe: (cb: () => void) => () => void;
349
+ };
344
350
  };
345
351
  }
346
352
  /** The ActionEngine interface */
@@ -353,8 +359,8 @@ export interface ActionEngine {
353
359
  validate: (action: ActionStep) => ValidationResult;
354
360
  /** Get all currently active actions */
355
361
  getActive: () => ActiveAction[];
356
- /** Clean up all active actions and resources */
357
- destroy: () => void;
362
+ /** Clean up all active actions and resources. Awaits async cleanup (animated reverts). */
363
+ destroy: () => Promise<void>;
358
364
  }
359
365
  /** Renderable content types for surfaces */
360
366
  export type RenderableContent = {
@@ -11,6 +11,7 @@ export interface AnchorResolverOptions {
11
11
  export interface AnchorResolver {
12
12
  resolve(selector: string): HTMLElement | null;
13
13
  waitFor(selector: string, timeoutMs?: number): Promise<HTMLElement>;
14
+ /** One-shot: fires callback once when element appears, then auto-removes the watcher. */
14
15
  onAppear(selector: string, cb: (el: HTMLElement) => void): () => void;
15
16
  pendingCount(): number;
16
17
  destroy(): void;
@@ -0,0 +1,84 @@
1
+ /**
2
+ * SmartCanvas API (Lit variant)
3
+ *
4
+ * Entry point for the SmartCanvas SDK using LitElement instead of React.
5
+ * Creates and manages the canvas element, handles configuration, and
6
+ * coordinates between the ActionEngine and UI.
7
+ *
8
+ * The public API (SmartCanvasHandle, SmartCanvasConfig, createSmartCanvas)
9
+ * is identical to api.tsx — only the internal mounting uses mountLitApp()
10
+ * instead of mountReactApp().
11
+ */
12
+ import type { ExperimentClient } from './experiments/types';
13
+ import type { OverlayRecipeFetcher } from './overlays/fetcher';
14
+ import type { ActionHandler, AppearanceConfig, RenderProps } from './render/types';
15
+ import type { SmartCanvasRuntime } from './runtime';
16
+ import { type SmartCanvasElementLit } from './SmartCanvasElementLit';
17
+ import type { TelemetryClient } from './telemetry/types';
18
+ import type { CanvasThemeConfig } from './theme';
19
+ import type { CanvasConfigFetcher, CanvasConfigResponse } from './types';
20
+ export interface SmartCanvasIntegrations {
21
+ experiments?: ExperimentClient;
22
+ telemetry?: TelemetryClient;
23
+ }
24
+ export interface SmartCanvasConfig {
25
+ target?: HTMLElement;
26
+ defaultOpen?: boolean;
27
+ tokens?: Record<string, string>;
28
+ fetcher?: CanvasConfigFetcher;
29
+ configUri?: string;
30
+ configUriFeatureKey?: string;
31
+ fetchCredentials?: RequestCredentials;
32
+ overlayFetcher?: OverlayRecipeFetcher;
33
+ overlayConfigUri?: string;
34
+ overlayConfigFeatureKey?: string;
35
+ overlayFetchCredentials?: RequestCredentials;
36
+ pollIntervalMs?: number;
37
+ integrations?: SmartCanvasIntegrations;
38
+ antiFlicker?: boolean | {
39
+ timeout?: number;
40
+ className?: string;
41
+ };
42
+ editorUrl?: string;
43
+ /**
44
+ * v2 Runtime instance.
45
+ * Required for action execution. If not provided, actions will not be applied.
46
+ */
47
+ runtime?: SmartCanvasRuntime;
48
+ appearance?: AppearanceConfig;
49
+ renderProps?: RenderProps;
50
+ actionHandlers?: ActionHandler;
51
+ /** Workspace-level theme for 3-layer inheritance (defaults → workspace → config) */
52
+ workspaceTheme?: CanvasThemeConfig;
53
+ }
54
+ /**
55
+ * Handle for interacting with a SmartCanvas instance.
56
+ */
57
+ export interface SmartCanvasHandle {
58
+ el: SmartCanvasElementLit;
59
+ open(): void;
60
+ close(): void;
61
+ destroy(): void;
62
+ setTokens(tokens: Record<string, string>): void;
63
+ /**
64
+ * Get the current config.
65
+ */
66
+ getConfig(): Promise<CanvasConfigResponse>;
67
+ /**
68
+ * Enable or disable the canvas.
69
+ * When disabled, all actions are reverted.
70
+ */
71
+ setEnabled(enabled: boolean): Promise<void>;
72
+ setOverrideFetcher(fetcher: CanvasConfigFetcher): void;
73
+ registerTelemetryProperties(properties: Record<string, unknown>): void;
74
+ getSessionId(): string | undefined;
75
+ startSessionRecording(): void;
76
+ /** Track a custom event. Returns true if telemetry is available and event was sent. */
77
+ track(eventName: string, properties?: Record<string, unknown>): boolean;
78
+ /**
79
+ * v2 Runtime instance for context, events, state, and decisions.
80
+ */
81
+ runtime?: SmartCanvasRuntime;
82
+ }
83
+ export declare const createSmartCanvas: (config?: SmartCanvasConfig) => Promise<SmartCanvasHandle>;
84
+ export { getAntiFlickerSnippet } from './antiFlicker';
@@ -0,0 +1,20 @@
1
+ export declare const builtinAdaptiveManifestsLit: {
2
+ id: any;
3
+ version: any;
4
+ name: any;
5
+ description: any;
6
+ runtime: {
7
+ actions: any;
8
+ widgets: any;
9
+ notifyWatchers: any;
10
+ events: any;
11
+ };
12
+ editor: undefined;
13
+ metadata: {
14
+ isBuiltIn: boolean;
15
+ };
16
+ }[];
17
+ export declare function registerBuiltinRuntimeModulesLit(registry: {
18
+ has: (id: string) => boolean;
19
+ register: (manifest: any) => void;
20
+ }): void;
@@ -56,6 +56,16 @@ export interface SyntroInitOptions {
56
56
  * @default false
57
57
  */
58
58
  testMode?: boolean;
59
+ /**
60
+ * App-provided signal values set at init time. Merged into SDK attributes
61
+ * alongside auto-collected browser/geo signals for local flag evaluation.
62
+ *
63
+ * Use this when the host environment (MCP server, agent, etc.) provides
64
+ * signal values that the SDK can't auto-collect from the browser.
65
+ *
66
+ * Tracked as a discrete PostHog event (app_signals_init) on init.
67
+ */
68
+ appSignalsInit?: Record<string, string>;
59
69
  }
60
70
  export interface SyntroInitResult {
61
71
  /**