@affectively/aeon-pages-runtime 0.3.1 → 0.5.1

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.
@@ -34,6 +34,7 @@
34
34
  */
35
35
  import { type ReactNode, type FC } from 'react';
36
36
  import type { ESIConfig, ESIDirective, ESIModel, ESIProcessor, ESIResult, UserContext } from './types';
37
+ import { ESIStructured, ESIIf, ESIShow, ESIHide, ESIWhen, ESIUnless, ESIMatch, ESICase, ESIDefault, ESIFirst, ESITierGate, ESIEmotionGate, ESITimeGate, ESIForEach, ESISelect, ESIABTest, ESIClamp, ESIScore, ESICollaborative, ESIReflect, ESIOptimize, ESIAuto } from './esi-control-react';
37
38
  interface ESIContextValue {
38
39
  processor: ESIProcessor;
39
40
  userContext: UserContext | null;
@@ -192,7 +193,9 @@ export declare function useESIInfer(options?: UseESIInferOptions): {
192
193
  * Global ESI State type (matches ESIState from context-extractor)
193
194
  */
194
195
  export interface GlobalESIState {
195
- userTier: 'free' | 'starter' | 'pro' | 'enterprise';
196
+ userTier: 'free' | 'starter' | 'pro' | 'enterprise' | 'admin';
197
+ /** Admin flag - bypasses ALL tier restrictions */
198
+ isAdmin?: boolean;
196
199
  emotionState?: {
197
200
  primary: string;
198
201
  valence: number;
@@ -266,6 +269,11 @@ export declare function useGlobalESIState(): GlobalESIState;
266
269
  * ```
267
270
  */
268
271
  export declare function useESIFeature(feature: keyof GlobalESIState['features']): boolean;
272
+ /**
273
+ * Hook to check if current user is an admin
274
+ * Admins bypass ALL tier restrictions
275
+ */
276
+ export declare function useIsAdmin(): boolean;
269
277
  /**
270
278
  * Hook to get user tier
271
279
  *
@@ -283,6 +291,24 @@ export declare function useESIFeature(feature: keyof GlobalESIState['features'])
283
291
  * ```
284
292
  */
285
293
  export declare function useESITier(): GlobalESIState['userTier'];
294
+ /**
295
+ * Hook to check if user meets minimum tier requirement
296
+ * Admins bypass ALL tier restrictions
297
+ *
298
+ * @example
299
+ * ```tsx
300
+ * function ProFeature() {
301
+ * const hasPro = useMeetsTierRequirement('pro');
302
+ *
303
+ * if (!hasPro) {
304
+ * return <UpgradePrompt tier="pro" />;
305
+ * }
306
+ *
307
+ * return <ProFeatureContent />;
308
+ * }
309
+ * ```
310
+ */
311
+ export declare function useMeetsTierRequirement(requiredTier: GlobalESIState['userTier']): boolean;
286
312
  /**
287
313
  * Hook to get current emotion state
288
314
  *
@@ -327,5 +353,33 @@ export declare const ESI: {
327
353
  Embed: FC<ESIEmbedProps>;
328
354
  Emotion: FC<ESIEmotionProps>;
329
355
  Vision: FC<ESIVisionProps>;
356
+ Structured: typeof ESIStructured;
357
+ If: typeof ESIIf;
358
+ Show: typeof ESIShow;
359
+ Hide: typeof ESIHide;
360
+ When: typeof ESIWhen;
361
+ Unless: typeof ESIUnless;
362
+ Match: typeof ESIMatch;
363
+ Case: typeof ESICase;
364
+ Default: typeof ESIDefault;
365
+ First: typeof ESIFirst;
366
+ TierGate: typeof ESITierGate;
367
+ EmotionGate: typeof ESIEmotionGate;
368
+ TimeGate: typeof ESITimeGate;
369
+ ForEach: typeof ESIForEach;
370
+ Select: typeof ESISelect;
371
+ ABTest: typeof ESIABTest;
372
+ Clamp: typeof ESIClamp;
373
+ Score: typeof ESIScore;
374
+ Collaborative: typeof ESICollaborative;
375
+ Reflect: typeof ESIReflect;
376
+ Optimize: typeof ESIOptimize;
377
+ Auto: typeof ESIAuto;
378
+ Markdown: FC<import("./esi-format-react").ESIMarkdownProps>;
379
+ Latex: FC<import("./esi-format-react").ESILatexProps>;
380
+ Json: FC<import("./esi-format-react").ESIJsonProps>;
381
+ Plaintext: FC<import("./esi-format-react").ESIPlaintextProps>;
382
+ Code: FC<import("./esi-format-react").ESICodeProps>;
383
+ Semantic: FC<import("./esi-format-react").ESISemanticProps>;
330
384
  };
331
385
  export default ESI;
@@ -20,7 +20,7 @@ export { SpeculationManager, supportsSpeculationRules, supportsLinkPrefetch, aut
20
20
  export type { SpeculationOptions, SpeculationState, } from './speculation';
21
21
  export { parseWithSchema, generateSchemaPrompt, createControlProcessor, esiIf, esiMatch, } from './esi-control';
22
22
  export type { ESICondition, ESIIfDirective, ESIMatchDirective, ESIControlResult, ESISchemaParams, ESISchemaResult, ESIControlProcessor, } from './esi-control';
23
- export { ESIControl, ESIStructured, ESIIf, ESIMatch, ESICase, ESIDefault, ESICollaborative, ESIReflect, ESIOptimize, ESIAuto, } from './esi-control-react';
24
- export type { ESIStructuredProps, ESIIfProps, ESIMatchProps, ESICaseProps, ESIDefaultProps, ESICollaborativeProps, ESIReflectProps, ESIOptimizeProps, ESIAutoProps, OptimizeMeta, } from './esi-control-react';
23
+ export { ESIControl, ESIStructured, ESIIf, ESIShow, ESIHide, ESIWhen, ESIUnless, ESIMatch, ESICase, ESIDefault, ESIFirst, ESITierGate, ESIEmotionGate, ESITimeGate, ESIForEach, ESISelect, ESIABTest, ESIClamp, ESIScore, ESICollaborative, ESIReflect, ESIOptimize, ESIAuto, } from './esi-control-react';
24
+ export type { ESIStructuredProps, ESIIfProps, ESIShowProps, ESIHideProps, ESIWhenProps, ESIUnlessProps, ESIMatchProps, ESICaseProps, ESIDefaultProps, ESIFirstProps, ESITierGateProps, ESIEmotionGateProps, ESITimeGateProps, ESIForEachProps, ESISelectProps, ESIABTestProps, ESIClampProps, ESIScoreProps, ESICollaborativeProps, ESIReflectProps, ESIOptimizeProps, ESIAutoProps, OptimizeMeta, } from './esi-control-react';
25
25
  export { esiContext, esiCyrano, esiHalo, evaluateTrigger, createExhaustEntry, getToolSuggestions, CYRANO_TOOL_SUGGESTIONS, } from './esi-cyrano';
26
26
  export type { SessionContext, EmotionContext, BehaviorContext, EnvironmentContext, BiometricContext, CyranoWhisperConfig, CyranoIntent, CyranoTone, CyranoTrigger, HaloInsightConfig, HaloObservation, HaloAction, ChatExhaustType, ChatExhaustEntry, ESIWhisperResult, } from './esi-cyrano';