dphelper 4.6.0 → 4.6.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/COPYRIGHT.md +6 -6
- package/FUNDING.yml +12 -12
- package/LICENSE.md +21 -21
- package/README.md +637 -397
- package/SECURITY.md +26 -26
- package/SUMMARY.md +83 -83
- package/index.cjs +1 -1
- package/index.d.ts +1 -1
- package/index.js +1 -1
- package/llms.txt +515 -73
- package/modules/ai.cjs +1 -1
- package/modules/ai.d.ts +11 -11
- package/modules/ai.js +1 -1
- package/modules/anchor.cjs +1 -1
- package/modules/anchor.d.ts +6 -6
- package/modules/anchor.js +1 -1
- package/modules/array.cjs +1 -1
- package/modules/array.d.ts +21 -21
- package/modules/array.js +1 -1
- package/modules/audio.cjs +1 -1
- package/modules/audio.d.ts +10 -10
- package/modules/audio.js +1 -1
- package/modules/avoid.cjs +1 -1
- package/modules/avoid.d.ts +2 -2
- package/modules/avoid.js +1 -1
- package/modules/biometric.cjs +1 -1
- package/modules/biometric.d.ts +14 -14
- package/modules/biometric.js +1 -1
- package/modules/browser.cjs +1 -1
- package/modules/browser.d.ts +10 -10
- package/modules/browser.js +1 -1
- package/modules/check.cjs +1 -1
- package/modules/check.d.ts +4 -4
- package/modules/check.js +1 -1
- package/modules/color.cjs +1 -1
- package/modules/color.d.ts +6 -6
- package/modules/color.js +1 -1
- package/modules/compress.cjs +1 -1
- package/modules/compress.d.ts +13 -13
- package/modules/compress.js +1 -1
- package/modules/cookie.cjs +1 -1
- package/modules/cookie.d.ts +12 -12
- package/modules/cookie.js +1 -1
- package/modules/coords.cjs +1 -1
- package/modules/coords.d.ts +8 -8
- package/modules/coords.js +1 -1
- package/modules/credits.cjs +1 -1
- package/modules/credits.d.ts +11 -11
- package/modules/credits.js +1 -1
- package/modules/date.cjs +1 -1
- package/modules/date.d.ts +25 -25
- package/modules/date.js +1 -1
- package/modules/disable.cjs +1 -1
- package/modules/disable.d.ts +8 -8
- package/modules/disable.js +1 -1
- package/modules/dispatch.cjs +1 -1
- package/modules/dispatch.d.ts +4 -4
- package/modules/dispatch.js +1 -1
- package/modules/elements.cjs +1 -1
- package/modules/elements.d.ts +3 -3
- package/modules/elements.js +1 -1
- package/modules/events.cjs +1 -1
- package/modules/events.d.ts +6 -6
- package/modules/events.js +1 -1
- package/modules/fetch.cjs +1 -1
- package/modules/fetch.d.ts +15 -15
- package/modules/fetch.js +1 -1
- package/modules/form.cjs +1 -1
- package/modules/form.d.ts +13 -13
- package/modules/form.js +1 -1
- package/modules/format.cjs +1 -1
- package/modules/format.d.ts +3 -3
- package/modules/format.js +1 -1
- package/modules/i18n.cjs +1 -1
- package/modules/i18n.d.ts +11 -11
- package/modules/i18n.js +1 -1
- package/modules/image.cjs +1 -1
- package/modules/image.d.ts +13 -13
- package/modules/image.js +1 -1
- package/modules/json.cjs +1 -1
- package/modules/json.d.ts +8 -8
- package/modules/json.js +1 -1
- package/modules/load.cjs +1 -1
- package/modules/load.d.ts +8 -8
- package/modules/load.js +1 -1
- package/modules/logging.cjs +1 -1
- package/modules/logging.d.ts +8 -8
- package/modules/logging.js +1 -1
- package/modules/math.cjs +1 -1
- package/modules/math.d.ts +13 -13
- package/modules/math.js +1 -1
- package/modules/memory.cjs +1 -1
- package/modules/memory.d.ts +3 -3
- package/modules/memory.js +1 -1
- package/modules/navigation.cjs +1 -1
- package/modules/navigation.d.ts +4 -4
- package/modules/navigation.js +1 -1
- package/modules/net.cjs +1 -1
- package/modules/net.d.ts +10 -10
- package/modules/net.js +1 -1
- package/modules/objects.cjs +1 -1
- package/modules/objects.d.ts +15 -15
- package/modules/objects.js +1 -1
- package/modules/path.cjs +1 -1
- package/modules/path.d.ts +4 -4
- package/modules/path.js +1 -1
- package/modules/promise.cjs +1 -1
- package/modules/promise.d.ts +3 -3
- package/modules/promise.js +1 -1
- package/modules/sanitize.cjs +1 -1
- package/modules/sanitize.d.ts +2 -2
- package/modules/sanitize.js +1 -1
- package/modules/screen.cjs +1 -1
- package/modules/screen.d.ts +11 -11
- package/modules/screen.js +1 -1
- package/modules/scrollbar.cjs +1 -1
- package/modules/scrollbar.d.ts +9 -9
- package/modules/scrollbar.js +1 -1
- package/modules/security.cjs +1 -1
- package/modules/security.d.ts +15 -15
- package/modules/security.js +1 -1
- package/modules/shortcut.cjs +1 -1
- package/modules/shortcut.d.ts +2 -2
- package/modules/shortcut.js +1 -1
- package/modules/socket.cjs +1 -1
- package/modules/socket.d.ts +13 -13
- package/modules/socket.js +1 -1
- package/modules/sse.cjs +1 -1
- package/modules/sse.d.ts +8 -8
- package/modules/sse.js +1 -1
- package/modules/svg.cjs +1 -1
- package/modules/svg.d.ts +12 -12
- package/modules/svg.js +1 -1
- package/modules/sync.cjs +1 -1
- package/modules/sync.d.ts +13 -13
- package/modules/sync.js +1 -1
- package/modules/system.cjs +1 -1
- package/modules/system.d.ts +2 -2
- package/modules/system.js +1 -1
- package/modules/text.cjs +1 -1
- package/modules/text.d.ts +13 -13
- package/modules/text.js +1 -1
- package/modules/timer.cjs +1 -1
- package/modules/timer.d.ts +3 -3
- package/modules/timer.js +1 -1
- package/modules/tools.cjs +1 -1
- package/modules/tools.d.ts +5 -5
- package/modules/tools.js +1 -1
- package/modules/translators.cjs +1 -1
- package/modules/translators.d.ts +2 -2
- package/modules/translators.js +1 -1
- package/modules/triggers.cjs +1 -1
- package/modules/triggers.d.ts +43 -43
- package/modules/triggers.js +1 -1
- package/modules/types.cjs +1 -1
- package/modules/types.d.ts +5 -5
- package/modules/types.js +1 -1
- package/modules/ui.cjs +1 -1
- package/modules/ui.d.ts +3 -3
- package/modules/ui.js +1 -1
- package/modules/window.cjs +1 -1
- package/modules/window.d.ts +9 -9
- package/modules/window.js +1 -1
- package/modules/worker.cjs +1 -1
- package/modules/worker.d.ts +16 -16
- package/modules/worker.js +1 -1
- package/package.json +2 -2
- package/sbom.json +10 -15
- package/types/dphelper.d.ts +546 -546
- package/types/global.d.ts +8 -8
package/SECURITY.md
CHANGED
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
# Security Policy
|
|
2
|
-
|
|
3
|
-
## Supported Versions
|
|
4
|
-
|
|
5
|
-
| Version | Supported |
|
|
6
|
-
| ------- | --------- |
|
|
7
|
-
| 3.9.x | ✅ |
|
|
8
|
-
| < 3.5 | ❌ |
|
|
9
|
-
|
|
10
|
-
## Security Standards
|
|
11
|
-
|
|
12
|
-
- **NIST SP 800-53:** 98% compliance
|
|
13
|
-
- **OWASP Top 10:** 100% compliance
|
|
14
|
-
- **Socket.dev:** 90%+ target
|
|
15
|
-
|
|
16
|
-
## Reporting a Vulnerability
|
|
17
|
-
|
|
18
|
-
Email: architecture@biglogic.ca
|
|
19
|
-
Response: Within 24 hours
|
|
20
|
-
|
|
21
|
-
## Security Features
|
|
22
|
-
|
|
23
|
-
- PBKDF2 310k iterations (OWASP 2023)
|
|
24
|
-
- AES-GCM 256-bit encryption
|
|
25
|
-
- TLS 1.2+ enforcement
|
|
26
|
-
- WebSocket wss:// only
|
|
1
|
+
# Security Policy
|
|
2
|
+
|
|
3
|
+
## Supported Versions
|
|
4
|
+
|
|
5
|
+
| Version | Supported |
|
|
6
|
+
| ------- | --------- |
|
|
7
|
+
| 3.9.x | ✅ |
|
|
8
|
+
| < 3.5 | ❌ |
|
|
9
|
+
|
|
10
|
+
## Security Standards
|
|
11
|
+
|
|
12
|
+
- **NIST SP 800-53:** 98% compliance
|
|
13
|
+
- **OWASP Top 10:** 100% compliance
|
|
14
|
+
- **Socket.dev:** 90%+ target
|
|
15
|
+
|
|
16
|
+
## Reporting a Vulnerability
|
|
17
|
+
|
|
18
|
+
Email: architecture@biglogic.ca
|
|
19
|
+
Response: Within 24 hours
|
|
20
|
+
|
|
21
|
+
## Security Features
|
|
22
|
+
|
|
23
|
+
- PBKDF2 310k iterations (OWASP 2023)
|
|
24
|
+
- AES-GCM 256-bit encryption
|
|
25
|
+
- TLS 1.2+ enforcement
|
|
26
|
+
- WebSocket wss:// only
|
|
27
27
|
- Input validation on all endpoints
|
package/SUMMARY.md
CHANGED
|
@@ -1,83 +1,83 @@
|
|
|
1
|
-
# Table of Contents
|
|
2
|
-
|
|
3
|
-
- [dpHelper](../README.md)
|
|
4
|
-
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
## Core Tools
|
|
8
|
-
|
|
9
|
-
- [ai](markdown/ai.md)
|
|
10
|
-
- [array](markdown/array.md)
|
|
11
|
-
- [browser](markdown/browser.md)
|
|
12
|
-
- [check](markdown/check.md)
|
|
13
|
-
- [date](markdown/date.md)
|
|
14
|
-
- [form](markdown/form.md)
|
|
15
|
-
- [json](markdown/json.md)
|
|
16
|
-
- [load](markdown/load.md)
|
|
17
|
-
- [navigation](markdown/navigation.md)
|
|
18
|
-
- [security](markdown/security.md)
|
|
19
|
-
- [socket](markdown/socket.md)
|
|
20
|
-
- [svg](markdown/svg.md)
|
|
21
|
-
- [markdown](markdown/markdown.md)
|
|
22
|
-
- [window](markdown/window.md)
|
|
23
|
-
|
|
24
|
-
---
|
|
25
|
-
|
|
26
|
-
## UI & DOM
|
|
27
|
-
|
|
28
|
-
- [anchor](markdown/anchor.md)
|
|
29
|
-
- [audio](markdown/audio.md)
|
|
30
|
-
- [color](markdown/color.md)
|
|
31
|
-
- [coords](markdown/coords.md)
|
|
32
|
-
- [disable](markdown/disable.md)
|
|
33
|
-
- [dispatch](markdown/dispatch.md)
|
|
34
|
-
- [element](markdown/element.md)
|
|
35
|
-
- [event](markdown/event.md)
|
|
36
|
-
- [scrollbar](markdown/scrollbar.md)
|
|
37
|
-
- [screen](markdown/screen.md)
|
|
38
|
-
- [trigger](markdown/trigger.md)
|
|
39
|
-
- [type](markdown/type.md)
|
|
40
|
-
- [types](markdown/types.md)
|
|
41
|
-
- [ui](markdown/ui.md)
|
|
42
|
-
|
|
43
|
-
---
|
|
44
|
-
|
|
45
|
-
## Data & Text
|
|
46
|
-
|
|
47
|
-
- [format](markdown/format.md)
|
|
48
|
-
- [math](markdown/math.md)
|
|
49
|
-
- [objects](markdown/objects.md)
|
|
50
|
-
- [path](markdown/path.md)
|
|
51
|
-
- [sanitize](markdown/sanitize.md)
|
|
52
|
-
- [text](markdown/text.md)
|
|
53
|
-
- [translators](markdown/translators.md)
|
|
54
|
-
|
|
55
|
-
---
|
|
56
|
-
|
|
57
|
-
## Network & Storage
|
|
58
|
-
|
|
59
|
-
- [cookie](markdown/cookie.md)
|
|
60
|
-
- [compress](markdown/compress.md)
|
|
61
|
-
- [fetch](markdown/fetch.md)
|
|
62
|
-
- [net](markdown/net.md)
|
|
63
|
-
- [sse](markdown/sse.md)
|
|
64
|
-
- [sync](markdown/sync.md)
|
|
65
|
-
|
|
66
|
-
---
|
|
67
|
-
|
|
68
|
-
## Advanced
|
|
69
|
-
|
|
70
|
-
- [avoid](markdown/avoid.md)
|
|
71
|
-
- [biometric](markdown/biometric.md)
|
|
72
|
-
- [credits](markdown/credits.md)
|
|
73
|
-
- [i18n](markdown/i18n.md)
|
|
74
|
-
- [image](markdown/image.md)
|
|
75
|
-
- [logging](markdown/logging.md)
|
|
76
|
-
- [memory](markdown/memory.md)
|
|
77
|
-
- [promise](markdown/promise.md)
|
|
78
|
-
- [shortcut](markdown/shortcut.md)
|
|
79
|
-
- [system](markdown/system.md)
|
|
80
|
-
- [terminal](markdown/terminal.md)
|
|
81
|
-
- [timer](markdown/timer.md)
|
|
82
|
-
- [triggers](markdown/triggers.md)
|
|
83
|
-
- [worker](markdown/worker.md)
|
|
1
|
+
# Table of Contents
|
|
2
|
+
|
|
3
|
+
- [dpHelper](../README.md)
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Core Tools
|
|
8
|
+
|
|
9
|
+
- [ai](markdown/ai.md)
|
|
10
|
+
- [array](markdown/array.md)
|
|
11
|
+
- [browser](markdown/browser.md)
|
|
12
|
+
- [check](markdown/check.md)
|
|
13
|
+
- [date](markdown/date.md)
|
|
14
|
+
- [form](markdown/form.md)
|
|
15
|
+
- [json](markdown/json.md)
|
|
16
|
+
- [load](markdown/load.md)
|
|
17
|
+
- [navigation](markdown/navigation.md)
|
|
18
|
+
- [security](markdown/security.md)
|
|
19
|
+
- [socket](markdown/socket.md)
|
|
20
|
+
- [svg](markdown/svg.md)
|
|
21
|
+
- [markdown](markdown/markdown.md)
|
|
22
|
+
- [window](markdown/window.md)
|
|
23
|
+
|
|
24
|
+
---
|
|
25
|
+
|
|
26
|
+
## UI & DOM
|
|
27
|
+
|
|
28
|
+
- [anchor](markdown/anchor.md)
|
|
29
|
+
- [audio](markdown/audio.md)
|
|
30
|
+
- [color](markdown/color.md)
|
|
31
|
+
- [coords](markdown/coords.md)
|
|
32
|
+
- [disable](markdown/disable.md)
|
|
33
|
+
- [dispatch](markdown/dispatch.md)
|
|
34
|
+
- [element](markdown/element.md)
|
|
35
|
+
- [event](markdown/event.md)
|
|
36
|
+
- [scrollbar](markdown/scrollbar.md)
|
|
37
|
+
- [screen](markdown/screen.md)
|
|
38
|
+
- [trigger](markdown/trigger.md)
|
|
39
|
+
- [type](markdown/type.md)
|
|
40
|
+
- [types](markdown/types.md)
|
|
41
|
+
- [ui](markdown/ui.md)
|
|
42
|
+
|
|
43
|
+
---
|
|
44
|
+
|
|
45
|
+
## Data & Text
|
|
46
|
+
|
|
47
|
+
- [format](markdown/format.md)
|
|
48
|
+
- [math](markdown/math.md)
|
|
49
|
+
- [objects](markdown/objects.md)
|
|
50
|
+
- [path](markdown/path.md)
|
|
51
|
+
- [sanitize](markdown/sanitize.md)
|
|
52
|
+
- [text](markdown/text.md)
|
|
53
|
+
- [translators](markdown/translators.md)
|
|
54
|
+
|
|
55
|
+
---
|
|
56
|
+
|
|
57
|
+
## Network & Storage
|
|
58
|
+
|
|
59
|
+
- [cookie](markdown/cookie.md)
|
|
60
|
+
- [compress](markdown/compress.md)
|
|
61
|
+
- [fetch](markdown/fetch.md)
|
|
62
|
+
- [net](markdown/net.md)
|
|
63
|
+
- [sse](markdown/sse.md)
|
|
64
|
+
- [sync](markdown/sync.md)
|
|
65
|
+
|
|
66
|
+
---
|
|
67
|
+
|
|
68
|
+
## Advanced
|
|
69
|
+
|
|
70
|
+
- [avoid](markdown/avoid.md)
|
|
71
|
+
- [biometric](markdown/biometric.md)
|
|
72
|
+
- [credits](markdown/credits.md)
|
|
73
|
+
- [i18n](markdown/i18n.md)
|
|
74
|
+
- [image](markdown/image.md)
|
|
75
|
+
- [logging](markdown/logging.md)
|
|
76
|
+
- [memory](markdown/memory.md)
|
|
77
|
+
- [promise](markdown/promise.md)
|
|
78
|
+
- [shortcut](markdown/shortcut.md)
|
|
79
|
+
- [system](markdown/system.md)
|
|
80
|
+
- [terminal](markdown/terminal.md)
|
|
81
|
+
- [timer](markdown/timer.md)
|
|
82
|
+
- [triggers](markdown/triggers.md)
|
|
83
|
+
- [worker](markdown/worker.md)
|
package/index.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
'use strict';var V={info:{title:"List",description:"Complete list of tools"},categories:["3party","system","financial","memory","numbers","time","path","file","forms","ui","other","development"]};var x={codeName:"dphelper",version:"4.6.
|
|
1
|
+
'use strict';var V={info:{title:"List",description:"Complete list of tools"},categories:["3party","system","financial","memory","numbers","time","path","file","forms","ui","other","development"]};var x={codeName:"dphelper",version:"4.6.2"};Object.defineProperty(globalThis,"dphelper",{value:new Proxy({},{}),writable:true,configurable:true,enumerable:false});Object.defineProperties(dphelper,{_list:{value:{scripts:[],sockets:[],...V},configurable:true,writable:true},version:{value:x.version,configurable:true,writable:true},isServer:{value:false,configurable:true,writable:true},isBrowser:{value:true,configurable:true,writable:true}});var P=dphelper;Object.defineProperty(P,"setProps",{value:(e,t,r)=>{Object.defineProperty(e,t.name,r||{writable:false,configurable:false,enumerable:false}),r?.lock&&Object.freeze(e[t.name]);},writable:false,configurable:false,enumerable:false});Object.defineProperty(P,"setDescription",{value:(e,t)=>{Object.defineProperties(P,{[e.name]:{value:t,writable:false,configurable:false,enumerable:false}}),Object.keys(t).map(r=>(Object.defineProperties(P[e.name],{[r]:{writable:false,configurable:false,enumerable:false}}),null)),P.setProps(P,e,{writable:false,configurable:false,enumerable:false}),P._list.scripts.push(e);}});var ue={name:"ai",active:true,subCommand:[{name:"tokenCount",version:"0.0.3",example:"dphelper.ai.tokenCount({ users: [1,2,3] })",author:"Dario Passariello",creationDate:"20260220",lastMod:"20260221",type:"function",active:true,description:"Estimate token count for LLMs. If an object is passed, it uses TOON format for calculation.",env:"both",subCommand:[]},{name:"smartSanitize",version:"0.0.2",example:"dphelper.ai.smartSanitize('My email is test@example.com')",author:"Dario Passariello & Jo",creationDate:"20260220",lastMod:"20260220",type:"function",active:true,description:"Remove PII (emails, phones, etc) from text for AI privacy",subCommand:[]},{name:"toon",version:"0.0.1",example:"dphelper.ai.toon({ users: [{id: 1, name: 'Ada'}] })",author:"TOON + Dario Passariello",creationDate:"20260221",lastMod:"20260221",type:"function",active:true,description:"Convert JSON to TOON format (Token-Oriented Object Notation)",subCommand:[]},{name:"toonToJson",version:"0.0.1",example:"dphelper.ai.toonToJson('users[1]{id,name}:\\n 1,Ada')",author:"Dario Passariello",creationDate:"20260221",lastMod:"20260221",type:"function",active:true,description:"Convert TOON format back to JSON/Object",subCommand:[]},{name:"chunker",version:"0.0.1",example:"dphelper.ai.chunker(text, { size: 1000, overlap: 200 })",author:"Dario Passariello",creationDate:"20260221",lastMod:"20260221",type:"function",active:true,description:"Split long text into chunks for RAG or AI processing.",subCommand:[]},{name:"similarity",version:"0.0.1",example:"dphelper.ai.similarity(vecA, vecB)",author:"Dario Passariello",creationDate:"20260221",lastMod:"20260221",type:"function",active:true,description:"Calculate cosine similarity between two embedding vectors.",subCommand:[]},{name:"extractReasoning",version:"0.0.1",example:"dphelper.ai.extractReasoning(aiResponse)",author:"Dario Passariello",creationDate:"20260221",lastMod:"20260221",type:"function",active:true,description:"Extract <think> tags or internal reasoning from AI responses.",subCommand:[]},{name:"prompt",version:"0.0.1",example:"dphelper.ai.prompt('Hello {{name}}', { name: 'Ada' })",author:"Dario Passariello",creationDate:"20260221",lastMod:"20260221",type:"function",active:true,description:"Simple prompt template engine with variable injection.",subCommand:[]},{name:"schema",version:"0.0.1",example:"dphelper.ai.schema({ id: 1, name: 'Ada' })",author:"Dario Passariello",creationDate:"20260221",lastMod:"20260221",type:"function",active:true,description:"Generate a TOON-style schema definition for AI instructions.",subCommand:[]},{name:"snapshot",version:"0.0.1",example:"dphelper.ai.snapshot()",author:"Dario Passariello",creationDate:"20260221",lastMod:"20260221",type:"function",active:true,description:"Capture a 'mental snapshot' of the app state (logs/globals) in TOON format for AI debugging.",env:"both",subCommand:[]}]},B=e=>e===null||typeof e!="object",H=e=>e===null?"null":typeof e=="string"?e.includes(",")||e.includes(":")||e.includes('"')||e.includes(`
|
|
2
2
|
`)||e.trim()!==e?`"${e.replace(/"/g,'\\"')}"`:e||'""':String(e),N=(e,t=0)=>{let r=" ".repeat(t);if(B(e))return H(e);if(Array.isArray(e)){if(e.length===0)return "[0]:";let n=e[0];if(!B(n)&&!Array.isArray(n)){let o=Object.keys(n),a=`[${e.length}]{${o.join(",")}}:`;for(let i of e){let s=o.map(l=>H(i[l])).join(",");a+=`
|
|
3
3
|
${r} ${s}`;}return a}else return `[${e.length}]: `+e.map(H).join(",")}else return Object.entries(e).map(([n,o])=>{let a=n.includes(" ")||n.includes(":")?`"${n}"`:n;if(!B(o)){let i=N(o,t+1);return i.startsWith("[")?`${a}${i}`:`${a}:
|
|
4
4
|
${r}${i}`}return `${a}: ${H(o)}`}).join(`
|
package/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
/// <reference path="./types/dphelper.d.ts" />
|
|
1
|
+
/// <reference path="./types/dphelper.d.ts" />
|
package/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var K={info:{title:"List",description:"Complete list of tools"},categories:["3party","system","financial","memory","numbers","time","path","file","forms","ui","other","development"]};var C={codeName:"dphelper",version:"4.6.
|
|
1
|
+
var K={info:{title:"List",description:"Complete list of tools"},categories:["3party","system","financial","memory","numbers","time","path","file","forms","ui","other","development"]};var C={codeName:"dphelper",version:"4.6.2"};Object.defineProperty(globalThis,"dphelper",{value:new Proxy({},{}),writable:true,configurable:true,enumerable:false});Object.defineProperties(dphelper,{_list:{value:{scripts:[],sockets:[],...K},configurable:true,writable:true},version:{value:C.version,configurable:true,writable:true},isServer:{value:false,configurable:true,writable:true},isBrowser:{value:true,configurable:true,writable:true}});var k=dphelper;Object.defineProperty(k,"setProps",{value:(e,t,r)=>{Object.defineProperty(e,t.name,r||{writable:false,configurable:false,enumerable:false}),r?.lock&&Object.freeze(e[t.name]);},writable:false,configurable:false,enumerable:false});Object.defineProperty(k,"setDescription",{value:(e,t)=>{Object.defineProperties(k,{[e.name]:{value:t,writable:false,configurable:false,enumerable:false}}),Object.keys(t).map(r=>(Object.defineProperties(k[e.name],{[r]:{writable:false,configurable:false,enumerable:false}}),null)),k.setProps(k,e,{writable:false,configurable:false,enumerable:false}),k._list.scripts.push(e);}});var pe={name:"ai",active:true,subCommand:[{name:"tokenCount",version:"0.0.3",example:"dphelper.ai.tokenCount({ users: [1,2,3] })",author:"Dario Passariello",creationDate:"20260220",lastMod:"20260221",type:"function",active:true,description:"Estimate token count for LLMs. If an object is passed, it uses TOON format for calculation.",env:"both",subCommand:[]},{name:"smartSanitize",version:"0.0.2",example:"dphelper.ai.smartSanitize('My email is test@example.com')",author:"Dario Passariello & Jo",creationDate:"20260220",lastMod:"20260220",type:"function",active:true,description:"Remove PII (emails, phones, etc) from text for AI privacy",subCommand:[]},{name:"toon",version:"0.0.1",example:"dphelper.ai.toon({ users: [{id: 1, name: 'Ada'}] })",author:"TOON + Dario Passariello",creationDate:"20260221",lastMod:"20260221",type:"function",active:true,description:"Convert JSON to TOON format (Token-Oriented Object Notation)",subCommand:[]},{name:"toonToJson",version:"0.0.1",example:"dphelper.ai.toonToJson('users[1]{id,name}:\\n 1,Ada')",author:"Dario Passariello",creationDate:"20260221",lastMod:"20260221",type:"function",active:true,description:"Convert TOON format back to JSON/Object",subCommand:[]},{name:"chunker",version:"0.0.1",example:"dphelper.ai.chunker(text, { size: 1000, overlap: 200 })",author:"Dario Passariello",creationDate:"20260221",lastMod:"20260221",type:"function",active:true,description:"Split long text into chunks for RAG or AI processing.",subCommand:[]},{name:"similarity",version:"0.0.1",example:"dphelper.ai.similarity(vecA, vecB)",author:"Dario Passariello",creationDate:"20260221",lastMod:"20260221",type:"function",active:true,description:"Calculate cosine similarity between two embedding vectors.",subCommand:[]},{name:"extractReasoning",version:"0.0.1",example:"dphelper.ai.extractReasoning(aiResponse)",author:"Dario Passariello",creationDate:"20260221",lastMod:"20260221",type:"function",active:true,description:"Extract <think> tags or internal reasoning from AI responses.",subCommand:[]},{name:"prompt",version:"0.0.1",example:"dphelper.ai.prompt('Hello {{name}}', { name: 'Ada' })",author:"Dario Passariello",creationDate:"20260221",lastMod:"20260221",type:"function",active:true,description:"Simple prompt template engine with variable injection.",subCommand:[]},{name:"schema",version:"0.0.1",example:"dphelper.ai.schema({ id: 1, name: 'Ada' })",author:"Dario Passariello",creationDate:"20260221",lastMod:"20260221",type:"function",active:true,description:"Generate a TOON-style schema definition for AI instructions.",subCommand:[]},{name:"snapshot",version:"0.0.1",example:"dphelper.ai.snapshot()",author:"Dario Passariello",creationDate:"20260221",lastMod:"20260221",type:"function",active:true,description:"Capture a 'mental snapshot' of the app state (logs/globals) in TOON format for AI debugging.",env:"both",subCommand:[]}]},W=e=>e===null||typeof e!="object",U=e=>e===null?"null":typeof e=="string"?e.includes(",")||e.includes(":")||e.includes('"')||e.includes(`
|
|
2
2
|
`)||e.trim()!==e?`"${e.replace(/"/g,'\\"')}"`:e||'""':String(e),$=(e,t=0)=>{let r=" ".repeat(t);if(W(e))return U(e);if(Array.isArray(e)){if(e.length===0)return "[0]:";let n=e[0];if(!W(n)&&!Array.isArray(n)){let o=Object.keys(n),a=`[${e.length}]{${o.join(",")}}:`;for(let i of e){let s=o.map(l=>U(i[l])).join(",");a+=`
|
|
3
3
|
${r} ${s}`;}return a}else return `[${e.length}]: `+e.map(U).join(",")}else return Object.entries(e).map(([n,o])=>{let a=n.includes(" ")||n.includes(":")?`"${n}"`:n;if(!W(o)){let i=$(o,t+1);return i.startsWith("[")?`${a}${i}`:`${a}:
|
|
4
4
|
${r}${i}`}return `${a}: ${U(o)}`}).join(`
|