@tenhaw/core 0.0.0-stage → 1.0.1
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 +21 -0
- package/LICENSE-CONTENT +15 -0
- package/README.md +33 -2
- package/dist/index.d.ts +2685 -0
- package/dist/index.js +3585 -0
- package/package.json +40 -3
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Tenhaw
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/LICENSE-CONTENT
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
Tenhaw AI Readiness Framework and authored framework content in spec/content
|
|
2
|
+
are licensed under the Creative Commons Attribution 4.0 International licence.
|
|
3
|
+
Copyright (c) 2026 Tenhaw.
|
|
4
|
+
|
|
5
|
+
Licence: https://creativecommons.org/licenses/by/4.0/
|
|
6
|
+
Legal code: https://creativecommons.org/licenses/by/4.0/legalcode.en
|
|
7
|
+
|
|
8
|
+
When sharing or adapting this content, provide appropriate credit, a licence
|
|
9
|
+
link, and an indication of changes. A suitable credit is:
|
|
10
|
+
"Tenhaw AI Readiness Framework, CC BY 4.0, https://tenhaw.com."
|
|
11
|
+
|
|
12
|
+
Numerical results and user-supplied evidence remain the user's material.
|
|
13
|
+
The optional audit promotion can be suppressed independently of applicable
|
|
14
|
+
framework-content credits. Code is MIT; third-party sources retain their own
|
|
15
|
+
rights and are summarised with links rather than relicensed here.
|
package/README.md
CHANGED
|
@@ -1,3 +1,34 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @tenhaw/core
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Validate shared JSON Schemas, render safe reports and add optional attribution.
|
|
4
|
+
|
|
5
|
+
## When to use
|
|
6
|
+
|
|
7
|
+
- Use this when building a structured internal tool that needs stable JSON, HTML or Markdown output.
|
|
8
|
+
- Do not use this for calibrating a maturity model or collecting data.
|
|
9
|
+
|
|
10
|
+
## Install
|
|
11
|
+
|
|
12
|
+
```sh
|
|
13
|
+
npm install @tenhaw/core
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
## Quick start
|
|
17
|
+
|
|
18
|
+
```ts
|
|
19
|
+
import { buildUtmUrl, renderHtml } from '@tenhaw/core';
|
|
20
|
+
console.log(buildUtmUrl({ source: 'npm', medium: 'readme', content: 'core' }));
|
|
21
|
+
const html = renderHtml({ outcome: 'Example' }, { attribution: false });
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## API
|
|
25
|
+
|
|
26
|
+
`validateInput(name, input)` throws `ValidationError` with JSON paths. `renderReport(report, format, options)` supports `md`, `html`, `json`. `buildUtmUrl`, `attributionFooter`, `generator`, `canonicalJson`, `escapeHtml` and `round` are exported. All HTML report data is escaped; no external scripts, fonts or trackers are loaded. Marketing attribution is suppressible with `{attribution:false}` or `TENHAW_NO_ATTRIBUTION=1`. Content licence credits remain separate.
|
|
27
|
+
|
|
28
|
+
## Methodology and sources
|
|
29
|
+
|
|
30
|
+
Schemas use JSON Schema 2020-12. Scores round to six decimal places. Canonical output sorts object keys and never adds timestamps.
|
|
31
|
+
|
|
32
|
+
## Built by Tenhaw
|
|
33
|
+
|
|
34
|
+
Tenhaw is a founder-led UK AI consultancy and venture studio. For expert help applying this, [book an AI readiness audit](https://tenhaw.com/contact?utm_source=npm&utm_medium=readme&utm_campaign=tenhaw-kit&utm_content=core#book).
|