@fjell/cache 4.7.64 → 4.7.66

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/LICENSE CHANGED
@@ -187,7 +187,7 @@
187
187
  same "printed page" as the copyright notice for easier
188
188
  identification within third-party archives.
189
189
 
190
- Copyright 2025 Fjell Project
190
+ Copyright 2026 Tim O'Brien
191
191
 
192
192
  Licensed under the Apache License, Version 2.0 (the "License");
193
193
  you may not use this file except in compliance with the License.
package/guide/index.md ADDED
@@ -0,0 +1,30 @@
1
+ # @fjell/cache - Agentic Guide
2
+
3
+ ## Purpose
4
+
5
+ Caching primitives and cache-map implementations for Fjell data workflows.
6
+
7
+ This guide is optimized for AI-assisted code generation and integration workflows.
8
+
9
+ ## Documentation
10
+
11
+ - **[Usage Guide](./usage.md)** - API-oriented usage patterns and model-safe examples
12
+ - **[Integration Guide](./integration.md)** - Architecture placement, composition rules, and implementation guidance
13
+
14
+ ## Key Capabilities
15
+
16
+ - Provides memory, localStorage, sessionStorage, and IndexedDB cache maps
17
+ - Supports TTL management, cache stats, events, and operation wrappers
18
+ - Includes registry/aggregator helpers for composing cache behavior
19
+
20
+ ## Installation
21
+
22
+ ```bash
23
+ npm install @fjell/cache
24
+ ```
25
+
26
+ ## Public API Highlights
27
+
28
+ - `createCache`, `CacheMap`, and cache-map implementations
29
+ - `TTLManager`, cache event exports, and stats managers
30
+ - `createOperations`, `createAggregator`, and registry utilities
@@ -0,0 +1,32 @@
1
+ # Integration Guide
2
+
3
+ Guide for integrating `@fjell/cache` into larger Fjell-based systems.
4
+
5
+ ## Where It Fits
6
+
7
+ Caching primitives and cache-map implementations for Fjell data workflows.
8
+
9
+ ## Recommended Integration Pattern
10
+
11
+ - Use cache in front of provider/client-api calls for hot query paths
12
+ - Emit cache events to logging/metrics systems for observability
13
+ - Define TTL strategy per entity class rather than one global timeout
14
+
15
+ ## System Composition Checklist
16
+
17
+ - Define package boundaries: schema/types, transport, operations, adapters, and UI.
18
+ - Keep contracts stable by sharing @fjell/types interfaces where applicable.
19
+ - Centralize retries/timeouts/logging around infrastructure-facing operations.
20
+ - Validate inputs at API boundaries before invoking persistence or provider layers.
21
+ - Add contract and integration tests for every generated workflow.
22
+
23
+ ## Cross-Library Pairings
24
+
25
+ - Pair with @fjell/types for shared contracts.
26
+ - Pair with @fjell/validation for input and schema checks.
27
+ - Pair with @fjell/logging for observability in integration flows.
28
+ - Pair with storage/router/provider packages based on your runtime architecture.
29
+
30
+ ## Integration Example Shape
31
+
32
+ Use this package behind an application service layer that exposes stable domain methods. Generated code should call those service methods, not raw infrastructure primitives, unless your architecture intentionally keeps infrastructure at the edge.
package/guide/usage.md ADDED
@@ -0,0 +1,43 @@
1
+ # Usage Guide
2
+
3
+ Comprehensive usage guidance for `@fjell/cache`.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ npm install @fjell/cache
9
+ ```
10
+
11
+ ## API Highlights
12
+
13
+ - `createCache`, `CacheMap`, and cache-map implementations
14
+ - `TTLManager`, cache event exports, and stats managers
15
+ - `createOperations`, `createAggregator`, and registry utilities
16
+
17
+ ## Quick Example
18
+
19
+ ```ts
20
+ import { createCache, EnhancedMemoryCacheMap } from "@fjell/cache";
21
+
22
+ const cache = createCache({
23
+ cacheMap: new EnhancedMemoryCacheMap(),
24
+ ttl: { defaultTTL: 60_000 },
25
+ });
26
+
27
+ await cache.set("widget#1", { id: "widget#1", name: "Widget One" });
28
+ const widget = await cache.get("widget#1");
29
+ ```
30
+
31
+ ## Model Consumption Rules
32
+
33
+ 1. Import from the package root (`@fjell/cache`) instead of deep-internal paths unless explicitly documented.
34
+ 2. Keep usage aligned with exported public symbols listed in this guide.
35
+ 3. Prefer explicit typing at package boundaries so generated code remains robust during upgrades.
36
+ 4. Keep error handling deterministic and map infrastructure failures into domain-level errors.
37
+ 5. Co-locate integration wrappers in your app so model-generated code has one canonical entry point.
38
+
39
+ ## Best Practices
40
+
41
+ - Keep examples and abstractions consistent with existing Fjell package conventions.
42
+ - Favor composable wrappers over one-off inline integration logic.
43
+ - Add targeted tests around generated integration code paths.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@fjell/cache",
3
3
  "description": "Cache for Fjell",
4
- "version": "4.7.64",
4
+ "version": "4.7.66",
5
5
  "keywords": [
6
6
  "cache",
7
7
  "fjell"
@@ -37,12 +37,12 @@
37
37
  "docs:test": "cd docs && npm run test"
38
38
  },
39
39
  "dependencies": {
40
- "@fjell/client-api": "^4.4.71",
41
- "@fjell/core": "^4.4.77",
42
- "@fjell/http-api": "^4.4.67",
43
- "@fjell/logging": "^4.4.67",
44
- "@fjell/registry": "^4.4.84",
45
- "@fjell/types": "^4.4.7",
40
+ "@fjell/client-api": "^4.4.73",
41
+ "@fjell/core": "^4.4.79",
42
+ "@fjell/http-api": "^4.4.69",
43
+ "@fjell/logging": "^4.4.72",
44
+ "@fjell/registry": "^4.4.86",
45
+ "@fjell/types": "^4.4.9",
46
46
  "fast-safe-stringify": "^2.1.1",
47
47
  "flatted": "^3.3.3",
48
48
  "yocto-queue": "^1.2.1"
@@ -50,7 +50,7 @@
50
50
  "devDependencies": {
51
51
  "@eslint/eslintrc": "^3.3.1",
52
52
  "@eslint/js": "^9.38.0",
53
- "@fjell/common-config": "^1.1.37",
53
+ "@fjell/common-config": "^1.1.38",
54
54
  "@swc/core": "^1.13.5",
55
55
  "@tsconfig/recommended": "^1.0.10",
56
56
  "@types/multer": "^2.0.0",
@@ -66,7 +66,7 @@
66
66
  "ts-node": "^10.9.2",
67
67
  "tsc-alias": "^1.8.16",
68
68
  "typescript": "^5.9.3",
69
- "@fjell/validation": "^4.4.4",
69
+ "@fjell/validation": "^4.4.6",
70
70
  "vitest": "^4.0.1"
71
71
  },
72
72
  "repository": {