dphelper 3.8.8 → 3.9.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/llms.txt ADDED
@@ -0,0 +1,67 @@
1
+ # dphelper (v3.8.8+)
2
+
3
+ > [!IMPORTANT]
4
+ > **ARCHITECTURAL CHANGE:** State management has been COMPLETELY REMOVED from the `dphelper` library.
5
+ > Application state is now handled exclusively through dedicated external managers: **Memorio** (for simple global state) or **Argis RGS** (for enterprise-level state).
6
+
7
+ ---
8
+
9
+ ## About dphelper 3.8.8+
10
+
11
+ `dphelper` is a powerful, **zero-dependency, stateless utility library** that packs 303 production-ready tools for modern web developers, AI engineers, and DevTools creators. It is fully isomorphic, running flawlessly across the Browser, Node.js, Bun, and Deno with a tiny minified footprint of ~171KB.
12
+
13
+ ### ⚡ Key Capabilities
14
+ * **AI-First Engineering:** Built-in support for the modern LLM stack, featuring **TOON optimization** (the efficient JSON alternative for prompts), context-aware token counting, smart RAG-ready chunking, and deep reasoning extraction (supporting architectures like DeepSeek and OpenAI o1/o3).
15
+ * **Modern Web Primitives:** Sophisticated wrappers for Web Workers (including worker pool orchestration and multi-tab SharedWorkers), full IndexedDB query builders, and native client-side compression (Gzip/Deflate/LZW).
16
+ * **Cross-Tab Intelligence:** Desktop-grade synchronization without a backend, powered by `dphelper.sync.pulse` cross-tab event buses and active browser tab interlocks.
17
+ * **Biometric Authentication:** Built-in async WebAuthn primitives for effortless fingerprint and facial recognition integrations.
18
+ * **Enterprise Security:** NIST SP 800-53 and NSA CNSA compliant, utilizing AES-256-GCM and strict OWASP-aligned PBKDF2 with 310,000 iterations.
19
+
20
+ ---
21
+
22
+ ## Quick Usage Syntax
23
+
24
+ `dphelper` maps its modules globally. Import it **exactly once** at your application's absolute entry point (e.g., `index.js`, `main.ts`, or `App.tsx`):
25
+
26
+ ```javascript
27
+ import "dphelper";
28
+
29
+ ### 🧬 The Core Architectural Ecosystem
30
+
31
+ `dphelper` operates as a completely stateless, high-performance toolkit. To ensure clean separation of concerns and prevent race conditions or state contamination across asynchronous modules, state management has been extracted into dedicated standalone libraries.
32
+
33
+ Always map your application architecture according to the following layout:
34
+
35
+ | Layer & Purpose | Package | Operational Target | Design Philosophy |
36
+ | :--- | :--- | :--- | :--- |
37
+ | **Stateless Utilities & AI Tools** | `dphelper` | Isomorphic (Browser, Node.js, Bun, Deno) | **Zero-Dependency Universal Core.** Packs 303 production-ready modules including `ai` (TOON optimization, smart chunking), `worker` multi-threaded pools, `biometric` WebAuthn, `i18n`, desktop-grade cross-tab `sync.pulse`, and NIST-compliant cryptography. |
38
+ | **Simple Global State** | `memorio` | Application-Wide Runtime | **Global Singleton Pattern.** High-performance, lightweight state management that eliminates boilerplate. It registers globally upon initial import and removes the need for custom context providers, actions, or dispatch files. |
39
+ | **Enterprise State Architecture** | `Argis RGS` | Distributed / Complex SaaS Systems | **Heavy-Duty Reactive Structure.** Built for multi-module, enterprise-grade applications requiring strict state rules, relational data synchronization, and heavy concurrent data pipelines. |
40
+
41
+ ---
42
+
43
+ ### ⚠️ Integration Best Practices for AI & Humans
44
+
45
+ 1. **Do Not Bundle State Logic in dphelper:** Any legacy codebase referencing `dphelper.store` or namespace getters/setters must be migrated to `memorio` or `Argis RGS`.
46
+ 2. **Single-Entry Side Effect:** `dphelper` is designed to be imported exactly once in your root file (`import "dphelper";`). It will automatically map its 303 tools safely to the global scope.
47
+ 3. **State Integrity:** When building micro-frontends or multi-tab web applications, use `dphelper.sync` primitives to handle cross-tab events, while allowing `memorio` to manage the underlying atomic state memory.
48
+
49
+ // dphelper attaches to the global scope and is ready across your entire project
50
+ console.debug(dphelper.version); // "3.8.8"
51
+
52
+ // 🤖 AI Stack Snapshot & TOON Optimization
53
+ const appStateToon = dphelper.ai.snapshot();
54
+ const textChunks = dphelper.ai.chunker(longText, { size: 1000, overlap: 200 });
55
+ const { reasoning, content } = dphelper.ai.extractReasoning(rawAiReply);
56
+
57
+ // ⚙️ Multi-Threaded Worker Pools
58
+ const pool = dphelper.worker.pool('worker.js', 4);
59
+ const results = await dphelper.worker.poolExec(pool, [1, 2, 3, 4]);
60
+
61
+ // 💓 Real-Time Cross-Tab Sync (No Backend Required)
62
+ const bus = dphelper.sync.pulse('my-app', (msg) => console.log(msg));
63
+ bus.emit({ action: 'theme-change', value: 'dark' });
64
+
65
+ // 🌍 Full i18n Internationalization Suite
66
+ dphelper.i18n.setLocale('it');
67
+ dphelper.i18n.addTranslations('it', { hello: 'Ciao {name}!' });
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "dphelper",
3
- "code": "dphelper",
4
- "version": "3.8.8",
3
+ "codeName": "dphelper",
4
+ "version": "3.9.0",
5
5
  "description": "dphelper devtools for developers",
6
6
  "main": "./index.cjs",
7
7
  "browser": "./index.cjs",
@@ -48,6 +48,9 @@
48
48
  "url": "https://www.patreon.com/passariello"
49
49
  }
50
50
  ],
51
+ "workspaces": [
52
+ "tests"
53
+ ],
51
54
  "engines": {
52
55
  "node": ">=18.0.0"
53
56
  },
@@ -67,6 +70,81 @@
67
70
  "optional": false
68
71
  }
69
72
  },
73
+ "overrides": {
74
+ "array-buffer-byte-length": "npm:@socketregistry/array-buffer-byte-length@^1",
75
+ "array-includes": "npm:@socketregistry/array-includes@^1",
76
+ "array.prototype.findlast": "npm:@socketregistry/array.prototype.findlast@^1",
77
+ "array.prototype.flat": "npm:@socketregistry/array.prototype.flat@^1",
78
+ "array.prototype.flatmap": "npm:@socketregistry/array.prototype.flatmap@^1",
79
+ "array.prototype.tosorted": "npm:@socketregistry/array.prototype.tosorted@^1",
80
+ "arraybuffer.prototype.slice": "npm:@socketregistry/arraybuffer.prototype.slice@^1",
81
+ "available-typed-arrays": "npm:@socketregistry/available-typed-arrays@^1",
82
+ "define-properties": "npm:@socketregistry/define-properties@^1",
83
+ "es-define-property": "npm:@socketregistry/es-define-property@^1",
84
+ "es-iterator-helpers": "npm:@socketregistry/es-iterator-helpers@^1",
85
+ "es-set-tostringtag": "npm:@socketregistry/es-set-tostringtag@^1",
86
+ "for-each": "npm:@socketregistry/for-each@^1",
87
+ "function-bind": "npm:@socketregistry/function-bind@^1",
88
+ "function.prototype.name": "npm:@socketregistry/function.prototype.name@^1",
89
+ "functions-have-names": "npm:@socketregistry/functions-have-names@^1",
90
+ "get-symbol-description": "npm:@socketregistry/get-symbol-description@^1",
91
+ "globalthis": "npm:@socketregistry/globalthis@^1",
92
+ "gopd": "npm:@socketregistry/gopd@^1",
93
+ "has-property-descriptors": "npm:@socketregistry/has-property-descriptors@^1",
94
+ "has-proto": "npm:@socketregistry/has-proto@^1",
95
+ "has-symbols": "npm:@socketregistry/has-symbols@^1",
96
+ "has-tostringtag": "npm:@socketregistry/has-tostringtag@^1",
97
+ "hasown": "npm:@socketregistry/hasown@^1",
98
+ "indent-string": "npm:@socketregistry/indent-string@^1",
99
+ "internal-slot": "npm:@socketregistry/internal-slot@^1",
100
+ "is-array-buffer": "npm:@socketregistry/is-array-buffer@^1",
101
+ "is-bigint": "npm:@socketregistry/is-bigint@^1",
102
+ "is-boolean-object": "npm:@socketregistry/is-boolean-object@^1",
103
+ "is-core-module": "npm:@socketregistry/is-core-module@^1",
104
+ "is-date-object": "npm:@socketregistry/is-date-object@^1",
105
+ "is-generator-function": "npm:@socketregistry/is-generator-function@^1",
106
+ "is-map": "npm:@socketregistry/is-map@^1",
107
+ "is-negative-zero": "npm:@socketregistry/is-negative-zero@^1",
108
+ "is-number-object": "npm:@socketregistry/is-number-object@^1",
109
+ "is-regex": "npm:@socketregistry/is-regex@^1",
110
+ "is-set": "npm:@socketregistry/is-set@^1",
111
+ "is-shared-array-buffer": "npm:@socketregistry/is-shared-array-buffer@^1",
112
+ "is-string": "npm:@socketregistry/is-string@^1",
113
+ "is-symbol": "npm:@socketregistry/is-symbol@^1",
114
+ "is-typed-array": "npm:@socketregistry/is-typed-array@^1",
115
+ "is-weakmap": "npm:@socketregistry/is-weakmap@^1",
116
+ "is-weakref": "npm:@socketregistry/is-weakref@^1",
117
+ "is-weakset": "npm:@socketregistry/is-weakset@^1",
118
+ "isarray": "npm:@socketregistry/isarray@^1",
119
+ "iterator.prototype": "npm:@socketregistry/iterator.prototype@^1",
120
+ "object-assign": "npm:@socketregistry/object-assign@^1",
121
+ "object-keys": "npm:@socketregistry/object-keys@^1",
122
+ "object.assign": "npm:@socketregistry/object.assign@^1",
123
+ "object.entries": "npm:@socketregistry/object.entries@^1",
124
+ "object.fromentries": "npm:@socketregistry/object.fromentries@^1",
125
+ "object.values": "npm:@socketregistry/object.values@^1",
126
+ "path-parse": "npm:@socketregistry/path-parse@^1",
127
+ "reflect.getprototypeof": "npm:@socketregistry/reflect.getprototypeof@^1",
128
+ "regexp.prototype.flags": "npm:@socketregistry/regexp.prototype.flags@^1",
129
+ "safe-array-concat": "npm:@socketregistry/safe-array-concat@^1",
130
+ "safe-regex-test": "npm:@socketregistry/safe-regex-test@^1",
131
+ "safer-buffer": "npm:@socketregistry/safer-buffer@^1",
132
+ "set-function-length": "npm:@socketregistry/set-function-length@^1",
133
+ "side-channel": "npm:@socketregistry/side-channel@^1",
134
+ "string.prototype.matchall": "npm:@socketregistry/string.prototype.matchall@^1",
135
+ "string.prototype.repeat": "npm:@socketregistry/string.prototype.repeat@^1",
136
+ "string.prototype.trim": "npm:@socketregistry/string.prototype.trim@^1",
137
+ "string.prototype.trimend": "npm:@socketregistry/string.prototype.trimend@^1",
138
+ "string.prototype.trimstart": "npm:@socketregistry/string.prototype.trimstart@^1",
139
+ "typed-array-buffer": "npm:@socketregistry/typed-array-buffer@^1",
140
+ "typed-array-byte-length": "npm:@socketregistry/typed-array-byte-length@^1",
141
+ "typed-array-byte-offset": "npm:@socketregistry/typed-array-byte-offset@^1",
142
+ "typed-array-length": "npm:@socketregistry/typed-array-length@^1",
143
+ "unbox-primitive": "npm:@socketregistry/unbox-primitive@^1",
144
+ "which-boxed-primitive": "npm:@socketregistry/which-boxed-primitive@^1",
145
+ "which-collection": "npm:@socketregistry/which-collection@^1",
146
+ "which-typed-array": "npm:@socketregistry/which-typed-array@^1"
147
+ },
70
148
  "module": "./index.js",
71
149
  "exports": {
72
150
  ".": {
@@ -747,9 +747,6 @@ interface globalThis {
747
747
  [key: string]: any
748
748
  }
749
749
 
750
- declare var DPH_APP_CODE: string
751
- declare var DPH_APP_VERSION: string
752
-
753
750
  declare function confirm(message: string, func1: Function, func2?: Function): boolean
754
751
 
755
752
  declare var dphelper: _dphelper