@syntrologie/adapt-content 2.3.0 → 2.4.0-canary.2
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/node_modules/@syntrologie/sdk-contracts/dist/index.d.ts +26 -0
- package/node_modules/@syntrologie/sdk-contracts/dist/index.js +13 -0
- package/node_modules/@syntrologie/sdk-contracts/dist/schemas.d.ts +1428 -0
- package/node_modules/@syntrologie/sdk-contracts/dist/schemas.js +142 -0
- package/node_modules/@syntrologie/sdk-contracts/package.json +33 -0
- package/package.json +5 -4
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @syntrologie/sdk-contracts
|
|
3
|
+
*
|
|
4
|
+
* Shared TypeScript contracts between runtime-sdk and adaptive packages.
|
|
5
|
+
* Executor types + shared Zod schemas for decision strategies and conditions.
|
|
6
|
+
*/
|
|
7
|
+
export { AnchorVisibleConditionZ, type ConditionSchema, ConditionZ, CooldownActiveConditionZ, type DecisionStrategySchema, DecisionStrategyZ, DismissedConditionZ, EventCountConditionZ, EventOccurredConditionZ, type EventScopeSchema, EventScopeZ, ExternalStrategyZ, FrequencyLimitConditionZ, ModelStrategyZ, NotifyZ, PageUrlConditionZ, RouteConditionZ, type RuleSchema, RuleStrategyZ, RuleZ, ScoreStrategyZ, SessionMetricConditionZ, StateEqualsConditionZ, ViewportConditionZ, } from './schemas.js';
|
|
8
|
+
/** Cleanup function returned by executors */
|
|
9
|
+
export type ExecutorCleanup = () => void | Promise<void>;
|
|
10
|
+
/** Update function for actions that support in-place updates */
|
|
11
|
+
export type ExecutorUpdate = (changes: Record<string, unknown>) => void | Promise<void>;
|
|
12
|
+
/** Result returned by action executors */
|
|
13
|
+
export interface ExecutorResult {
|
|
14
|
+
cleanup: ExecutorCleanup;
|
|
15
|
+
updateFn?: ExecutorUpdate;
|
|
16
|
+
}
|
|
17
|
+
/** Context passed to action executors by the runtime */
|
|
18
|
+
export interface ExecutorContext {
|
|
19
|
+
overlayRoot: HTMLElement;
|
|
20
|
+
resolveAnchor: (anchorId: string) => HTMLElement | null;
|
|
21
|
+
generateId: () => string;
|
|
22
|
+
publishEvent: (name: string, props?: Record<string, unknown>) => void;
|
|
23
|
+
adaptiveId?: string;
|
|
24
|
+
}
|
|
25
|
+
/** Executor function signature */
|
|
26
|
+
export type ActionExecutor<T = unknown> = (action: T, context: ExecutorContext) => Promise<ExecutorResult>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @syntrologie/sdk-contracts
|
|
3
|
+
*
|
|
4
|
+
* Shared TypeScript contracts between runtime-sdk and adaptive packages.
|
|
5
|
+
* Executor types + shared Zod schemas for decision strategies and conditions.
|
|
6
|
+
*/
|
|
7
|
+
export { AnchorVisibleConditionZ, ConditionZ, CooldownActiveConditionZ, DecisionStrategyZ, DismissedConditionZ, EventCountConditionZ, EventOccurredConditionZ,
|
|
8
|
+
// Shared schemas
|
|
9
|
+
EventScopeZ, ExternalStrategyZ, FrequencyLimitConditionZ, ModelStrategyZ, NotifyZ,
|
|
10
|
+
// Condition schemas
|
|
11
|
+
PageUrlConditionZ, RouteConditionZ, RuleStrategyZ,
|
|
12
|
+
// Strategy schemas
|
|
13
|
+
RuleZ, ScoreStrategyZ, SessionMetricConditionZ, StateEqualsConditionZ, ViewportConditionZ, } from './schemas.js';
|