@klickd/core 3.0.1 → 4.0.0-preview.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/README.md +39 -2
- package/dist/index.cjs +6 -2
- package/dist/index.d.cts +6 -1
- package/dist/index.d.ts +6 -1
- package/dist/index.js +6 -2
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -4,9 +4,11 @@ Official JavaScript/TypeScript library for reading and writing `.klickd` portabl
|
|
|
4
4
|
|
|
5
5
|
**One soul. Any model. Any body.**
|
|
6
6
|
|
|
7
|
+
Official page for the open `.klickd` format → **[klickd.app/klickdskill](https://klickd.app/klickdskill)**
|
|
8
|
+
|
|
7
9
|
[](https://www.npmjs.com/package/@klickd/core)
|
|
8
10
|
[](https://creativecommons.org/publicdomain/zero/1.0/)
|
|
9
|
-
[](https://doi.org/10.5281/zenodo.20320480)
|
|
10
12
|
|
|
11
13
|
---
|
|
12
14
|
|
|
@@ -76,6 +78,40 @@ const payload = await loadKlickd(fileBytes, {
|
|
|
76
78
|
|
|
77
79
|
---
|
|
78
80
|
|
|
81
|
+
## `.klickd` v4 preview fields (additive, non-GA)
|
|
82
|
+
|
|
83
|
+
This library currently targets the **v3** envelope and is **stable at v3.5.1**.
|
|
84
|
+
The v4 preview track (`v4.0.0-preview.1`, NOT GA) introduces additive payload
|
|
85
|
+
fields such as `profile_kind`, `media_profile`, `verification_gates`,
|
|
86
|
+
`claim_sources`, `verification_artifacts`, `migration`, and `context_cost`.
|
|
87
|
+
|
|
88
|
+
These fields are **preserved verbatim** on round-trip — `loadKlickd` returns
|
|
89
|
+
the raw decrypted JSON object and `saveKlickd` re-encrypts it without
|
|
90
|
+
filtering unknown keys. The `KlickdPayload` type carries an open
|
|
91
|
+
`[key: string]: unknown` index signature so v4 preview fields type-check as
|
|
92
|
+
additive properties. Strict v4 validation, migrations, and business-logic
|
|
93
|
+
helpers are intentionally **not** implemented yet.
|
|
94
|
+
|
|
95
|
+
```typescript
|
|
96
|
+
const v4PreviewPayload: KlickdPayload = {
|
|
97
|
+
payload_schema_version: '4.0.0-preview.1',
|
|
98
|
+
domain_schema_version: '1.0.0',
|
|
99
|
+
profile_kind: 'learner',
|
|
100
|
+
verification_gates: { public_post: 'confirm' },
|
|
101
|
+
// ... any additional v4 preview fields are preserved on save/load
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
const recovered = await loadKlickd(
|
|
105
|
+
await saveKlickd(v4PreviewPayload, { passphrase: 'my-passphrase' }),
|
|
106
|
+
{ passphrase: 'my-passphrase' },
|
|
107
|
+
);
|
|
108
|
+
// recovered deep-equals v4PreviewPayload
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
See `SPEC.md §33` and `examples/v4-preview/` for preview-track details.
|
|
112
|
+
|
|
113
|
+
---
|
|
114
|
+
|
|
79
115
|
## Cryptographic specification (v3.0)
|
|
80
116
|
|
|
81
117
|
| Parameter | Value |
|
|
@@ -105,9 +141,10 @@ const payload = await loadKlickd(fileBytes, {
|
|
|
105
141
|
|
|
106
142
|
## Links
|
|
107
143
|
|
|
144
|
+
- Format page: [klickd.app/klickdskill](https://klickd.app/klickdskill)
|
|
108
145
|
- Specification: [SPEC.md](https://github.com/Davincc77/klickdskill/blob/main/SPEC.md)
|
|
109
146
|
- Repository: [github.com/Davincc77/klickdskill](https://github.com/Davincc77/klickdskill)
|
|
110
|
-
- DOI: [10.5281/zenodo.20262530](https://doi.org/10.5281/zenodo.20262530)
|
|
147
|
+
- DOI: [10.5281/zenodo.20320480](https://doi.org/10.5281/zenodo.20320480) (v3.5) · concept DOI (all versions): [10.5281/zenodo.20262530](https://doi.org/10.5281/zenodo.20262530)
|
|
111
148
|
- Homepage: [klickd.app](https://klickd.app)
|
|
112
149
|
|
|
113
150
|
---
|
package/dist/index.cjs
CHANGED
|
@@ -275,10 +275,14 @@ async function loadKlickd(input, options = {}) {
|
|
|
275
275
|
);
|
|
276
276
|
}
|
|
277
277
|
const cipherName = envelope.cipher.name;
|
|
278
|
-
if (cipherName
|
|
278
|
+
if (cipherName === "aes-256-gcm") {
|
|
279
|
+
console.warn(
|
|
280
|
+
"KLICKD_W_DEPRECATED: cipher.name='aes-256-gcm' (lowercase) is legacy; canonical is 'AES-256-GCM'. Re-encode to upgrade."
|
|
281
|
+
);
|
|
282
|
+
} else if (cipherName !== "AES-256-GCM") {
|
|
279
283
|
throw new KlickdError(
|
|
280
284
|
"KLICKD_E_FORMAT",
|
|
281
|
-
`Unsupported cipher: ${cipherName}. Only AES-256-GCM is supported in v3.0.`,
|
|
285
|
+
`Unsupported cipher: ${cipherName}. Only AES-256-GCM is supported in v3.0 (legacy 'aes-256-gcm' also accepted).`,
|
|
282
286
|
HTTP_STATUS["KLICKD_E_FORMAT"]
|
|
283
287
|
);
|
|
284
288
|
}
|
package/dist/index.d.cts
CHANGED
|
@@ -75,7 +75,12 @@ interface KlickdPayload {
|
|
|
75
75
|
domain_schema_version: string;
|
|
76
76
|
identity?: KlickdIdentity;
|
|
77
77
|
agent_instructions?: string;
|
|
78
|
-
|
|
78
|
+
/**
|
|
79
|
+
* Advisory user-preference briefing. Canonical type = string (SPEC.md §22.6,
|
|
80
|
+
* max 32,768 bytes UTF-8). Object form retained for backward compatibility
|
|
81
|
+
* with pre-v3.4 files; new producers SHOULD emit the string form.
|
|
82
|
+
*/
|
|
83
|
+
user_preferences?: string | Record<string, unknown>;
|
|
79
84
|
context?: KlickdContext;
|
|
80
85
|
knowledge?: KlickdKnowledge;
|
|
81
86
|
memory?: KlickdMemoryEntry[];
|
package/dist/index.d.ts
CHANGED
|
@@ -75,7 +75,12 @@ interface KlickdPayload {
|
|
|
75
75
|
domain_schema_version: string;
|
|
76
76
|
identity?: KlickdIdentity;
|
|
77
77
|
agent_instructions?: string;
|
|
78
|
-
|
|
78
|
+
/**
|
|
79
|
+
* Advisory user-preference briefing. Canonical type = string (SPEC.md §22.6,
|
|
80
|
+
* max 32,768 bytes UTF-8). Object form retained for backward compatibility
|
|
81
|
+
* with pre-v3.4 files; new producers SHOULD emit the string form.
|
|
82
|
+
*/
|
|
83
|
+
user_preferences?: string | Record<string, unknown>;
|
|
79
84
|
context?: KlickdContext;
|
|
80
85
|
knowledge?: KlickdKnowledge;
|
|
81
86
|
memory?: KlickdMemoryEntry[];
|
package/dist/index.js
CHANGED
|
@@ -236,10 +236,14 @@ async function loadKlickd(input, options = {}) {
|
|
|
236
236
|
);
|
|
237
237
|
}
|
|
238
238
|
const cipherName = envelope.cipher.name;
|
|
239
|
-
if (cipherName
|
|
239
|
+
if (cipherName === "aes-256-gcm") {
|
|
240
|
+
console.warn(
|
|
241
|
+
"KLICKD_W_DEPRECATED: cipher.name='aes-256-gcm' (lowercase) is legacy; canonical is 'AES-256-GCM'. Re-encode to upgrade."
|
|
242
|
+
);
|
|
243
|
+
} else if (cipherName !== "AES-256-GCM") {
|
|
240
244
|
throw new KlickdError(
|
|
241
245
|
"KLICKD_E_FORMAT",
|
|
242
|
-
`Unsupported cipher: ${cipherName}. Only AES-256-GCM is supported in v3.0.`,
|
|
246
|
+
`Unsupported cipher: ${cipherName}. Only AES-256-GCM is supported in v3.0 (legacy 'aes-256-gcm' also accepted).`,
|
|
243
247
|
HTTP_STATUS["KLICKD_E_FORMAT"]
|
|
244
248
|
);
|
|
245
249
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@klickd/core",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "4.0.0-preview.1",
|
|
4
4
|
"description": "Official JavaScript/TypeScript library for reading and writing .klickd portable AI context files",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"klickd",
|
|
@@ -22,9 +22,9 @@
|
|
|
22
22
|
"types": "./dist/index.d.ts",
|
|
23
23
|
"exports": {
|
|
24
24
|
".": {
|
|
25
|
+
"types": "./dist/index.d.ts",
|
|
25
26
|
"import": "./dist/index.js",
|
|
26
|
-
"require": "./dist/index.cjs"
|
|
27
|
-
"types": "./dist/index.d.ts"
|
|
27
|
+
"require": "./dist/index.cjs"
|
|
28
28
|
}
|
|
29
29
|
},
|
|
30
30
|
"files": [
|