ts-util-core 2.0.5 → 2.0.6
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/README.md +7 -7
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
</p>
|
|
4
4
|
|
|
5
5
|
<p align="center">
|
|
6
|
-
<strong>One
|
|
6
|
+
<strong>One unified framework. Same guardrails. Whether it's your team or your AI Agents writing the code.</strong>
|
|
7
7
|
</p>
|
|
8
8
|
|
|
9
9
|
<p align="center">
|
|
@@ -39,7 +39,7 @@ Code review catches some of it. **Architecture catches all of it.**
|
|
|
39
39
|
|
|
40
40
|
## 2. How It Works
|
|
41
41
|
|
|
42
|
-
TS-Util wraps AJAX, VIEW, validation, formatting, and messaging into **a single enforced
|
|
42
|
+
TS-Util wraps AJAX, VIEW, validation, formatting, and messaging into **a single enforced framework**. When anyone — human or AI — calls `AJAX.request()`, the following happens automatically:
|
|
43
43
|
|
|
44
44
|
```
|
|
45
45
|
AJAX.request({ url, form })
|
|
@@ -61,7 +61,7 @@ await AJAX.request({
|
|
|
61
61
|
});
|
|
62
62
|
|
|
63
63
|
// Everything else — validation, loading state, error events,
|
|
64
|
-
// data serialization — is handled by the
|
|
64
|
+
// data serialization — is handled by the framework.
|
|
65
65
|
```
|
|
66
66
|
|
|
67
67
|
The same principle applies to `VIEW.load()` — every dynamically loaded HTML fragment automatically goes through constraint binding, input formatting, and custom hook execution. No manual initialization. No "forgetting" to set up validation on new content.
|
|
@@ -86,7 +86,7 @@ await VIEW.load(container, { url: '/api/partial-view' });
|
|
|
86
86
|
| Code review debates on style | Architecture enforces the style |
|
|
87
87
|
|
|
88
88
|
- **Eliminates divergence**: Engineers learn one API — no debates over implementation details.
|
|
89
|
-
- **Enforces consistency**: Every request passes through the same
|
|
89
|
+
- **Enforces consistency**: Every request passes through the same framework, ensuring loading overlays aren't missed and validation isn't skipped.
|
|
90
90
|
- **Reduces onboarding cost**: A new team member reads one `AJAX.request()` example and is ready to go, instead of deciphering ten scattered patterns.
|
|
91
91
|
|
|
92
92
|
### For AI Agents
|
|
@@ -95,14 +95,14 @@ await VIEW.load(container, { url: '/api/partial-view' });
|
|
|
95
95
|
|--------|-------|
|
|
96
96
|
| Agent expands 15 lines of fetch + validation + error handling | Agent emits 1 line: `AJAX.request({ url, form })` |
|
|
97
97
|
| Context window burned on boilerplate | Tokens preserved for business logic |
|
|
98
|
-
| Different Agents produce different patterns | All Agents produce identical
|
|
99
|
-
| Must audit every Agent's output for missing steps |
|
|
98
|
+
| Different Agents produce different patterns | All Agents produce identical framework calls |
|
|
99
|
+
| Must audit every Agent's output for missing steps | Framework guarantees completeness — **guardrail by design** |
|
|
100
100
|
| Agent "forgets" loading overlay | Impossible — architecture enforces it |
|
|
101
101
|
|
|
102
102
|
When multiple AI Agents co-produce code, this abstraction layer becomes even more critical:
|
|
103
103
|
|
|
104
104
|
- **Token efficiency**: An Agent only needs to emit `AJAX.request({ url, form })` — one line — instead of expanding the full `fetch` + validation + error handling + loading logic every time. Context window is AI's most precious resource; saving tokens means preserving quality.
|
|
105
|
-
- **Predictable behavior**: Code generated by different Agents flows through the same
|
|
105
|
+
- **Predictable behavior**: Code generated by different Agents flows through the same framework, guaranteeing consistent results. You don't need to audit whether each Agent correctly implemented the loading overlay.
|
|
106
106
|
- **Guardrail effect**: The abstraction layer itself acts as a guardrail. An Agent cannot "forget" to validate a form because `AJAX.request()` does it automatically. Discipline is enforced by architecture, not memory.
|
|
107
107
|
|
|
108
108
|
### The Core Insight
|