@affectively/aeon-pages 1.3.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.
- package/CHANGELOG.md +112 -0
- package/README.md +625 -0
- package/examples/basic/aeon.config.ts +39 -0
- package/examples/basic/components/Cursor.tsx +86 -0
- package/examples/basic/components/OfflineIndicator.tsx +103 -0
- package/examples/basic/components/PresenceBar.tsx +77 -0
- package/examples/basic/package.json +20 -0
- package/examples/basic/pages/index.tsx +80 -0
- package/package.json +101 -0
- package/packages/analytics/README.md +309 -0
- package/packages/analytics/build.ts +35 -0
- package/packages/analytics/package.json +50 -0
- package/packages/analytics/src/click-tracker.ts +368 -0
- package/packages/analytics/src/context-bridge.ts +319 -0
- package/packages/analytics/src/data-layer.ts +302 -0
- package/packages/analytics/src/gtm-loader.ts +239 -0
- package/packages/analytics/src/index.ts +230 -0
- package/packages/analytics/src/merkle-tree.ts +489 -0
- package/packages/analytics/src/provider.tsx +300 -0
- package/packages/analytics/src/types.ts +320 -0
- package/packages/analytics/src/use-analytics.ts +296 -0
- package/packages/analytics/tsconfig.json +19 -0
- package/packages/benchmarks/src/benchmark.test.ts +691 -0
- package/packages/cli/dist/index.js +61899 -0
- package/packages/cli/package.json +43 -0
- package/packages/cli/src/commands/build.test.ts +682 -0
- package/packages/cli/src/commands/build.ts +890 -0
- package/packages/cli/src/commands/dev.ts +473 -0
- package/packages/cli/src/commands/init.ts +409 -0
- package/packages/cli/src/commands/start.ts +297 -0
- package/packages/cli/src/index.ts +105 -0
- package/packages/directives/src/use-aeon.ts +272 -0
- package/packages/mcp-server/package.json +51 -0
- package/packages/mcp-server/src/index.ts +178 -0
- package/packages/mcp-server/src/resources.ts +346 -0
- package/packages/mcp-server/src/tools/index.ts +36 -0
- package/packages/mcp-server/src/tools/navigation.ts +545 -0
- package/packages/mcp-server/tsconfig.json +21 -0
- package/packages/react/package.json +40 -0
- package/packages/react/src/Link.tsx +388 -0
- package/packages/react/src/components/InstallPrompt.tsx +286 -0
- package/packages/react/src/components/OfflineDiagnostics.tsx +677 -0
- package/packages/react/src/components/PushNotifications.tsx +453 -0
- package/packages/react/src/hooks/useAeonNavigation.ts +219 -0
- package/packages/react/src/hooks/useConflicts.ts +277 -0
- package/packages/react/src/hooks/useNetworkState.ts +209 -0
- package/packages/react/src/hooks/usePilotNavigation.ts +254 -0
- package/packages/react/src/hooks/useServiceWorker.ts +278 -0
- package/packages/react/src/hooks.ts +195 -0
- package/packages/react/src/index.ts +151 -0
- package/packages/react/src/provider.tsx +467 -0
- package/packages/react/tsconfig.json +19 -0
- package/packages/runtime/README.md +399 -0
- package/packages/runtime/build.ts +48 -0
- package/packages/runtime/package.json +71 -0
- package/packages/runtime/schema.sql +40 -0
- package/packages/runtime/src/api-routes.ts +465 -0
- package/packages/runtime/src/benchmark.ts +171 -0
- package/packages/runtime/src/cache.ts +479 -0
- package/packages/runtime/src/durable-object.ts +1341 -0
- package/packages/runtime/src/index.ts +360 -0
- package/packages/runtime/src/navigation.test.ts +421 -0
- package/packages/runtime/src/navigation.ts +422 -0
- package/packages/runtime/src/nextjs-adapter.ts +272 -0
- package/packages/runtime/src/offline/encrypted-queue.test.ts +607 -0
- package/packages/runtime/src/offline/encrypted-queue.ts +478 -0
- package/packages/runtime/src/offline/encryption.test.ts +412 -0
- package/packages/runtime/src/offline/encryption.ts +397 -0
- package/packages/runtime/src/offline/types.ts +465 -0
- package/packages/runtime/src/predictor.ts +371 -0
- package/packages/runtime/src/registry.ts +351 -0
- package/packages/runtime/src/router/context-extractor.ts +661 -0
- package/packages/runtime/src/router/esi-control-react.tsx +2053 -0
- package/packages/runtime/src/router/esi-control.ts +541 -0
- package/packages/runtime/src/router/esi-cyrano.ts +779 -0
- package/packages/runtime/src/router/esi-format-react.tsx +1744 -0
- package/packages/runtime/src/router/esi-react.tsx +1065 -0
- package/packages/runtime/src/router/esi-translate-observer.ts +476 -0
- package/packages/runtime/src/router/esi-translate-react.tsx +556 -0
- package/packages/runtime/src/router/esi-translate.ts +503 -0
- package/packages/runtime/src/router/esi.ts +666 -0
- package/packages/runtime/src/router/heuristic-adapter.test.ts +295 -0
- package/packages/runtime/src/router/heuristic-adapter.ts +557 -0
- package/packages/runtime/src/router/index.ts +298 -0
- package/packages/runtime/src/router/merkle-capability.ts +473 -0
- package/packages/runtime/src/router/speculation.ts +451 -0
- package/packages/runtime/src/router/types.ts +630 -0
- package/packages/runtime/src/router.test.ts +470 -0
- package/packages/runtime/src/router.ts +302 -0
- package/packages/runtime/src/server.ts +481 -0
- package/packages/runtime/src/service-worker-push.ts +319 -0
- package/packages/runtime/src/service-worker.ts +553 -0
- package/packages/runtime/src/skeleton-hydrate.ts +237 -0
- package/packages/runtime/src/speculation.test.ts +389 -0
- package/packages/runtime/src/speculation.ts +486 -0
- package/packages/runtime/src/storage.test.ts +1297 -0
- package/packages/runtime/src/storage.ts +1048 -0
- package/packages/runtime/src/sync/conflict-resolver.test.ts +528 -0
- package/packages/runtime/src/sync/conflict-resolver.ts +565 -0
- package/packages/runtime/src/sync/coordinator.test.ts +608 -0
- package/packages/runtime/src/sync/coordinator.ts +596 -0
- package/packages/runtime/src/tree-compiler.ts +295 -0
- package/packages/runtime/src/types.ts +728 -0
- package/packages/runtime/src/worker.ts +327 -0
- package/packages/runtime/tsconfig.json +20 -0
- package/packages/runtime/wasm/aeon_pages_runtime.d.ts +504 -0
- package/packages/runtime/wasm/aeon_pages_runtime.js +1657 -0
- package/packages/runtime/wasm/aeon_pages_runtime_bg.wasm +0 -0
- package/packages/runtime/wasm/aeon_pages_runtime_bg.wasm.d.ts +196 -0
- package/packages/runtime/wasm/package.json +21 -0
- package/packages/runtime/wrangler.toml +41 -0
- package/packages/runtime-wasm/Cargo.lock +436 -0
- package/packages/runtime-wasm/Cargo.toml +29 -0
- package/packages/runtime-wasm/pkg/aeon_pages_runtime.d.ts +480 -0
- package/packages/runtime-wasm/pkg/aeon_pages_runtime.js +1568 -0
- package/packages/runtime-wasm/pkg/aeon_pages_runtime_bg.wasm +0 -0
- package/packages/runtime-wasm/pkg/aeon_pages_runtime_bg.wasm.d.ts +192 -0
- package/packages/runtime-wasm/pkg/package.json +21 -0
- package/packages/runtime-wasm/src/hydrate.rs +352 -0
- package/packages/runtime-wasm/src/lib.rs +191 -0
- package/packages/runtime-wasm/src/render.rs +629 -0
- package/packages/runtime-wasm/src/router.rs +298 -0
- package/packages/runtime-wasm/src/skeleton.rs +430 -0
- package/rfcs/RFC-001-ZERO-DEPENDENCY-RENDERING.md +1446 -0
|
@@ -0,0 +1,298 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Aeon Router - Personalized Routing System
|
|
3
|
+
*
|
|
4
|
+
* The website comes to the person - adaptive routing with:
|
|
5
|
+
* - User context signals (emotion, tier, preferences)
|
|
6
|
+
* - Speculative prefetching
|
|
7
|
+
* - Edge Side Inference (ESI)
|
|
8
|
+
* - Pluggable adapters (heuristic, AI, hybrid)
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
// Core types
|
|
12
|
+
export type {
|
|
13
|
+
// User Context
|
|
14
|
+
EmotionState,
|
|
15
|
+
Viewport,
|
|
16
|
+
ConnectionType,
|
|
17
|
+
UserTier,
|
|
18
|
+
UserContext,
|
|
19
|
+
|
|
20
|
+
// Route Decision
|
|
21
|
+
ThemeMode,
|
|
22
|
+
LayoutDensity,
|
|
23
|
+
LayoutType,
|
|
24
|
+
SkeletonHints,
|
|
25
|
+
RouteDecision,
|
|
26
|
+
|
|
27
|
+
// Component Tree
|
|
28
|
+
ComponentNode,
|
|
29
|
+
ComponentTree,
|
|
30
|
+
ComponentTreeSchema,
|
|
31
|
+
|
|
32
|
+
// Router Adapter
|
|
33
|
+
RouterAdapter,
|
|
34
|
+
|
|
35
|
+
// Configuration
|
|
36
|
+
AIRouterConfig,
|
|
37
|
+
SpeculationConfig,
|
|
38
|
+
PersonalizationConfig,
|
|
39
|
+
RouterConfig,
|
|
40
|
+
RouterConfigWithESI,
|
|
41
|
+
|
|
42
|
+
// ESI Types
|
|
43
|
+
ESIModel,
|
|
44
|
+
ESIContentType,
|
|
45
|
+
ESIParams,
|
|
46
|
+
ESIContent,
|
|
47
|
+
ESIDirective,
|
|
48
|
+
ESIResult,
|
|
49
|
+
ESIProcessor,
|
|
50
|
+
ESIConfig,
|
|
51
|
+
|
|
52
|
+
// Translation Types
|
|
53
|
+
TranslationResult,
|
|
54
|
+
TranslationProviderConfig,
|
|
55
|
+
SupportedLanguageCode,
|
|
56
|
+
} from './types';
|
|
57
|
+
|
|
58
|
+
// Default configs
|
|
59
|
+
export { DEFAULT_ROUTER_CONFIG, DEFAULT_ESI_CONFIG } from './types';
|
|
60
|
+
|
|
61
|
+
// ESI Processor
|
|
62
|
+
export {
|
|
63
|
+
EdgeWorkersESIProcessor,
|
|
64
|
+
esiInfer,
|
|
65
|
+
esiEmbed,
|
|
66
|
+
esiEmotion,
|
|
67
|
+
esiVision,
|
|
68
|
+
esiWithContext,
|
|
69
|
+
} from './esi';
|
|
70
|
+
|
|
71
|
+
// ESI Translation
|
|
72
|
+
export {
|
|
73
|
+
esiTranslate,
|
|
74
|
+
generateTranslationCacheKey,
|
|
75
|
+
getCachedTranslation,
|
|
76
|
+
setCachedTranslation,
|
|
77
|
+
clearTranslationCache,
|
|
78
|
+
readHeadTranslationConfig,
|
|
79
|
+
normalizeLanguageCode,
|
|
80
|
+
getLanguageName,
|
|
81
|
+
getSupportedLanguages,
|
|
82
|
+
detectTargetLanguage,
|
|
83
|
+
translateWithAIGateway,
|
|
84
|
+
} from './esi-translate';
|
|
85
|
+
|
|
86
|
+
// ESI React Components
|
|
87
|
+
export {
|
|
88
|
+
ESI,
|
|
89
|
+
ESIProvider,
|
|
90
|
+
ESIInfer,
|
|
91
|
+
ESIEmbed,
|
|
92
|
+
ESIEmotion,
|
|
93
|
+
ESIVision,
|
|
94
|
+
useESI,
|
|
95
|
+
useESIInfer,
|
|
96
|
+
// Global ESI State hooks (consume window.__AEON_ESI_STATE__)
|
|
97
|
+
useGlobalESIState,
|
|
98
|
+
useESIFeature,
|
|
99
|
+
useESITier,
|
|
100
|
+
useESIEmotionState,
|
|
101
|
+
useESIPreferences,
|
|
102
|
+
updateGlobalESIState,
|
|
103
|
+
// Edge-ready navigation hook (no Next.js dependency)
|
|
104
|
+
useNavigation,
|
|
105
|
+
} from './esi-react';
|
|
106
|
+
export type {
|
|
107
|
+
ESIProviderProps,
|
|
108
|
+
ESIInferProps,
|
|
109
|
+
ESIEmbedProps,
|
|
110
|
+
ESIEmotionProps,
|
|
111
|
+
ESIVisionProps,
|
|
112
|
+
UseESIInferOptions,
|
|
113
|
+
GlobalESIState,
|
|
114
|
+
NavigationRouter,
|
|
115
|
+
} from './esi-react';
|
|
116
|
+
|
|
117
|
+
// ESI Translation React Components
|
|
118
|
+
export {
|
|
119
|
+
ESITranslate,
|
|
120
|
+
TranslationProvider,
|
|
121
|
+
TranslationContext,
|
|
122
|
+
useTranslation,
|
|
123
|
+
useTranslationOptional,
|
|
124
|
+
} from './esi-translate-react';
|
|
125
|
+
export type {
|
|
126
|
+
ESITranslateProps,
|
|
127
|
+
TranslationProviderProps,
|
|
128
|
+
TranslationContextValue,
|
|
129
|
+
} from './esi-translate-react';
|
|
130
|
+
|
|
131
|
+
// ESI Translation Observer
|
|
132
|
+
export {
|
|
133
|
+
TranslationObserver,
|
|
134
|
+
useTranslationObserver,
|
|
135
|
+
initTranslationObserver,
|
|
136
|
+
} from './esi-translate-observer';
|
|
137
|
+
export type { TranslationObserverConfig } from './esi-translate-observer';
|
|
138
|
+
|
|
139
|
+
// Adapters
|
|
140
|
+
export { HeuristicAdapter } from './heuristic-adapter';
|
|
141
|
+
export type {
|
|
142
|
+
HeuristicAdapterConfig,
|
|
143
|
+
TierFeatures,
|
|
144
|
+
SignalProcessor,
|
|
145
|
+
} from './heuristic-adapter';
|
|
146
|
+
|
|
147
|
+
// Context Extraction
|
|
148
|
+
export {
|
|
149
|
+
extractUserContext,
|
|
150
|
+
createContextMiddleware,
|
|
151
|
+
setContextCookies,
|
|
152
|
+
addSpeculationHeaders,
|
|
153
|
+
// ESI State Serialization
|
|
154
|
+
serializeToESIState,
|
|
155
|
+
generateESIStateScript,
|
|
156
|
+
generateESIStateScriptFromContext,
|
|
157
|
+
} from './context-extractor';
|
|
158
|
+
export type { ContextExtractorOptions, ESIState } from './context-extractor';
|
|
159
|
+
|
|
160
|
+
// Speculation (client-side prefetching)
|
|
161
|
+
export {
|
|
162
|
+
SpeculationManager,
|
|
163
|
+
supportsSpeculationRules,
|
|
164
|
+
supportsLinkPrefetch,
|
|
165
|
+
autoInitSpeculation,
|
|
166
|
+
createSpeculationHook,
|
|
167
|
+
} from './speculation';
|
|
168
|
+
export type { SpeculationOptions, SpeculationState } from './speculation';
|
|
169
|
+
|
|
170
|
+
// ESI Control Language
|
|
171
|
+
export {
|
|
172
|
+
parseWithSchema,
|
|
173
|
+
generateSchemaPrompt,
|
|
174
|
+
createControlProcessor,
|
|
175
|
+
esiIf,
|
|
176
|
+
esiMatch,
|
|
177
|
+
} from './esi-control';
|
|
178
|
+
export type {
|
|
179
|
+
ESICondition,
|
|
180
|
+
ESIIfDirective,
|
|
181
|
+
ESIMatchDirective,
|
|
182
|
+
ESIControlResult,
|
|
183
|
+
ESISchemaParams,
|
|
184
|
+
ESISchemaResult,
|
|
185
|
+
ESIControlProcessor,
|
|
186
|
+
} from './esi-control';
|
|
187
|
+
|
|
188
|
+
// ESI Control React Components
|
|
189
|
+
export {
|
|
190
|
+
ESIControl,
|
|
191
|
+
// Core
|
|
192
|
+
ESIStructured,
|
|
193
|
+
// Conditionals
|
|
194
|
+
ESIIf,
|
|
195
|
+
ESIShow,
|
|
196
|
+
ESIHide,
|
|
197
|
+
ESIWhen,
|
|
198
|
+
ESIUnless,
|
|
199
|
+
// Pattern Matching
|
|
200
|
+
ESIMatch,
|
|
201
|
+
ESICase,
|
|
202
|
+
ESIDefault,
|
|
203
|
+
ESIFirst,
|
|
204
|
+
// Gates
|
|
205
|
+
ESITierGate,
|
|
206
|
+
ESIEmotionGate,
|
|
207
|
+
ESITimeGate,
|
|
208
|
+
// Iteration & Selection
|
|
209
|
+
ESIForEach,
|
|
210
|
+
ESISelect,
|
|
211
|
+
ESIABTest,
|
|
212
|
+
// Numeric
|
|
213
|
+
ESIClamp,
|
|
214
|
+
ESIScore,
|
|
215
|
+
// Advanced
|
|
216
|
+
ESICollaborative,
|
|
217
|
+
ESIReflect,
|
|
218
|
+
ESIOptimize,
|
|
219
|
+
ESIAuto,
|
|
220
|
+
} from './esi-control-react';
|
|
221
|
+
export type {
|
|
222
|
+
ESIStructuredProps,
|
|
223
|
+
ESIIfProps,
|
|
224
|
+
ESIShowProps,
|
|
225
|
+
ESIHideProps,
|
|
226
|
+
ESIWhenProps,
|
|
227
|
+
ESIUnlessProps,
|
|
228
|
+
ESIMatchProps,
|
|
229
|
+
ESICaseProps,
|
|
230
|
+
ESIDefaultProps,
|
|
231
|
+
ESIFirstProps,
|
|
232
|
+
ESITierGateProps,
|
|
233
|
+
ESIEmotionGateProps,
|
|
234
|
+
ESITimeGateProps,
|
|
235
|
+
ESIForEachProps,
|
|
236
|
+
ESISelectProps,
|
|
237
|
+
ESIABTestProps,
|
|
238
|
+
ESIClampProps,
|
|
239
|
+
ESIScoreProps,
|
|
240
|
+
ESICollaborativeProps,
|
|
241
|
+
ESIReflectProps,
|
|
242
|
+
ESIOptimizeProps,
|
|
243
|
+
ESIAutoProps,
|
|
244
|
+
OptimizeMeta,
|
|
245
|
+
} from './esi-control-react';
|
|
246
|
+
|
|
247
|
+
// ESI Cyrano Whisper Channel
|
|
248
|
+
export {
|
|
249
|
+
esiContext,
|
|
250
|
+
esiCyrano,
|
|
251
|
+
esiHalo,
|
|
252
|
+
evaluateTrigger,
|
|
253
|
+
createExhaustEntry,
|
|
254
|
+
getToolSuggestions,
|
|
255
|
+
CYRANO_TOOL_SUGGESTIONS,
|
|
256
|
+
} from './esi-cyrano';
|
|
257
|
+
export type {
|
|
258
|
+
SessionContext,
|
|
259
|
+
EmotionContext,
|
|
260
|
+
BehaviorContext,
|
|
261
|
+
EnvironmentContext,
|
|
262
|
+
BiometricContext,
|
|
263
|
+
CyranoWhisperConfig,
|
|
264
|
+
CyranoIntent,
|
|
265
|
+
CyranoTone,
|
|
266
|
+
CyranoTrigger,
|
|
267
|
+
HaloInsightConfig,
|
|
268
|
+
HaloObservation,
|
|
269
|
+
HaloAction,
|
|
270
|
+
ChatExhaustType,
|
|
271
|
+
ChatExhaustEntry,
|
|
272
|
+
ESIWhisperResult,
|
|
273
|
+
} from './esi-cyrano';
|
|
274
|
+
|
|
275
|
+
// Merkle-Based UCAN Capability Verification
|
|
276
|
+
export {
|
|
277
|
+
// Resource parsing
|
|
278
|
+
parseResource,
|
|
279
|
+
formatResource,
|
|
280
|
+
// Capability matching
|
|
281
|
+
capabilityGrantsAccess,
|
|
282
|
+
// Verifier creation
|
|
283
|
+
createNodeCapabilityVerifier,
|
|
284
|
+
// Capability creation helpers
|
|
285
|
+
createNodeReadCapability,
|
|
286
|
+
createNodeWriteCapability,
|
|
287
|
+
createTreeCapability,
|
|
288
|
+
createPathCapability,
|
|
289
|
+
createWildcardNodeCapability,
|
|
290
|
+
// Access control helpers
|
|
291
|
+
checkNodeAccess,
|
|
292
|
+
filterAccessibleNodes,
|
|
293
|
+
getMostSpecificCapability,
|
|
294
|
+
} from './merkle-capability';
|
|
295
|
+
export type {
|
|
296
|
+
NodeCapabilityVerifier,
|
|
297
|
+
NodeVerifierOptions,
|
|
298
|
+
} from './merkle-capability';
|