@contractspec/lib.personalization 6.0.6 → 6.0.10
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 +58 -19
- package/dist/browser/index.js +1 -1
- package/dist/browser/tracker.js +1 -1
- package/dist/index.d.ts +4 -4
- package/dist/index.js +1 -1
- package/dist/node/index.js +1 -1
- package/dist/node/tracker.js +1 -1
- package/dist/tracker.js +1 -1
- package/package.json +11 -11
package/README.md
CHANGED
|
@@ -1,40 +1,79 @@
|
|
|
1
1
|
# @contractspec/lib.personalization
|
|
2
2
|
|
|
3
|
-
Website: https://contractspec.io
|
|
3
|
+
Website: https://contractspec.io
|
|
4
4
|
|
|
5
|
+
**Behavior tracking, analysis, and adaptation helpers for ContractSpec personalization.**
|
|
5
6
|
|
|
6
|
-
|
|
7
|
+
## What It Provides
|
|
7
8
|
|
|
8
|
-
|
|
9
|
+
- **Layer**: lib.
|
|
10
|
+
- **Consumers**: bundles, example apps.
|
|
11
|
+
- `src/docs/` contains docblocks and documentation-facing exports.
|
|
12
|
+
- Related ContractSpec packages include `@contractspec/lib.bus`, `@contractspec/lib.contracts-spec`, `@contractspec/lib.knowledge`, `@contractspec/lib.overlay-engine`, `@contractspec/lib.schema`, `@contractspec/lib.surface-runtime`, ...
|
|
13
|
+
- `src/docs/` contains docblocks and documentation-facing exports.
|
|
9
14
|
|
|
10
|
-
|
|
11
|
-
- `store` – store abstractions plus an in-memory implementation.
|
|
12
|
-
- `analyzer` – stateless analyzers that convert usage data into insights.
|
|
13
|
-
- `adapter` – bridges insights into OverlaySpecs or WorkflowComposer extensions.
|
|
14
|
-
|
|
15
|
-
See `docs/tech/personalization/behavior-tracking.md` for full usage notes.
|
|
16
|
-
|
|
17
|
-
## Bundle spec / surface-runtime alignment
|
|
18
|
-
|
|
19
|
-
When using `@contractspec/lib.surface-runtime`, the types in `./preference-dimensions` are the canonical source for preference resolution:
|
|
20
|
-
|
|
21
|
-
- **`PreferenceDimensions`** — 7-dimension model (guidance, density, dataDepth, control, media, pace, narrative)
|
|
22
|
-
- **`BundlePreferenceAdapter`** — Interface for resolving and persisting preferences; surface-runtime's `resolvePreferenceProfile` consumes adapters implementing this interface
|
|
23
|
-
- **`ResolvedPreferenceProfile`** — Canonical values with source attribution; aligns with surface-runtime's adaptation output
|
|
24
|
-
|
|
25
|
-
Pass a `BundlePreferenceAdapter` implementation to `resolveBundle` options when integrating personalization with surface-runtime.
|
|
15
|
+
## Installation
|
|
26
16
|
|
|
17
|
+
`npm install @contractspec/lib.personalization`
|
|
27
18
|
|
|
19
|
+
or
|
|
28
20
|
|
|
21
|
+
`bun add @contractspec/lib.personalization`
|
|
29
22
|
|
|
23
|
+
## Usage
|
|
30
24
|
|
|
25
|
+
Import the root entrypoint from `@contractspec/lib.personalization`, or choose a documented subpath when you only need one part of the package surface.
|
|
31
26
|
|
|
27
|
+
## Architecture
|
|
32
28
|
|
|
29
|
+
- `src/adapter.ts` is part of the package's public or composition surface.
|
|
30
|
+
- `src/analyzer.ts` is part of the package's public or composition surface.
|
|
31
|
+
- `src/docs/` contains docblocks and documentation-facing exports.
|
|
32
|
+
- `src/index.ts` is the root public barrel and package entrypoint.
|
|
33
|
+
- `src/preference-dimensions.ts` is part of the package's public or composition surface.
|
|
34
|
+
- `src/store.ts` is part of the package's public or composition surface.
|
|
35
|
+
- `src/tracker.ts` is part of the package's public or composition surface.
|
|
36
|
+
- `src/types.ts` is shared public type definitions.
|
|
33
37
|
|
|
38
|
+
## Public Entry Points
|
|
34
39
|
|
|
40
|
+
- Export `.` resolves through `./src/index.ts`.
|
|
41
|
+
- Export `./adapter` resolves through `./src/adapter.ts`.
|
|
42
|
+
- Export `./analyzer` resolves through `./src/analyzer.ts`.
|
|
43
|
+
- Export `./docs` resolves through `./src/docs/index.ts`.
|
|
44
|
+
- Export `./docs/behavior-tracking.docblock` resolves through `./src/docs/behavior-tracking.docblock.ts`.
|
|
45
|
+
- Export `./docs/overlay-engine.docblock` resolves through `./src/docs/overlay-engine.docblock.ts`.
|
|
46
|
+
- Export `./docs/workflow-composition.docblock` resolves through `./src/docs/workflow-composition.docblock.ts`.
|
|
47
|
+
- Export `./preference-dimensions` resolves through `./src/preference-dimensions.ts`.
|
|
48
|
+
- Export `./store` resolves through `./src/store.ts`.
|
|
49
|
+
- Export `./tracker` resolves through `./src/tracker.ts`.
|
|
50
|
+
- The package publishes 11 total export subpaths; keep docs aligned with `package.json`.
|
|
35
51
|
|
|
52
|
+
## Local Commands
|
|
36
53
|
|
|
54
|
+
- `bun run dev` — contractspec-bun-build dev
|
|
55
|
+
- `bun run build` — bun run prebuild && bun run build:bundle && bun run build:types
|
|
56
|
+
- `bun run test` — bun test --pass-with-no-tests
|
|
57
|
+
- `bun run lint` — bun lint:fix
|
|
58
|
+
- `bun run lint:check` — biome check .
|
|
59
|
+
- `bun run lint:fix` — biome check --write --unsafe --only=nursery/useSortedClasses . && biome check --write .
|
|
60
|
+
- `bun run typecheck` — tsc --noEmit
|
|
61
|
+
- `bun run publish:pkg` — bun publish --tolerate-republish --ignore-scripts --verbose
|
|
62
|
+
- `bun run publish:pkg:canary` — bun publish:pkg --tag canary
|
|
63
|
+
- `bun run clean` — rimraf dist .turbo
|
|
64
|
+
- `bun run build:bundle` — contractspec-bun-build transpile
|
|
65
|
+
- `bun run build:types` — contractspec-bun-build types
|
|
66
|
+
- `bun run prebuild` — contractspec-bun-build prebuild
|
|
37
67
|
|
|
68
|
+
## Recent Updates
|
|
38
69
|
|
|
70
|
+
- Replace eslint+prettier by biomejs to optimize speed.
|
|
71
|
+
- Vercel AI SDK parity + surface-runtime i18n and bundle alignment.
|
|
72
|
+
- Bundle spec alignment, i18n support, PM workbench pilot.
|
|
73
|
+
- Upgrade dependencies.
|
|
39
74
|
|
|
75
|
+
## Notes
|
|
40
76
|
|
|
77
|
+
- Tracker interface is the adapter boundary — implementation details must not leak.
|
|
78
|
+
- Behavior data schema must stay backward-compatible; older events must remain parseable.
|
|
79
|
+
- Depends on bus, overlay-engine, and knowledge — coordinate cross-lib changes.
|
package/dist/browser/index.js
CHANGED
package/dist/browser/tracker.js
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export * from './types';
|
|
2
|
-
export * from './store';
|
|
3
|
-
export * from './tracker';
|
|
4
|
-
export * from './analyzer';
|
|
5
1
|
export * from './adapter';
|
|
2
|
+
export * from './analyzer';
|
|
6
3
|
export * from './preference-dimensions';
|
|
4
|
+
export * from './store';
|
|
5
|
+
export * from './tracker';
|
|
6
|
+
export * from './types';
|
|
7
7
|
import './docs';
|
package/dist/index.js
CHANGED
package/dist/node/index.js
CHANGED
package/dist/node/tracker.js
CHANGED
package/dist/tracker.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@contractspec/lib.personalization",
|
|
3
|
-
"version": "6.0.
|
|
3
|
+
"version": "6.0.10",
|
|
4
4
|
"description": "Behavior tracking, analysis, and adaptation helpers for ContractSpec personalization.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"contractspec",
|
|
@@ -25,23 +25,23 @@
|
|
|
25
25
|
"dev": "contractspec-bun-build dev",
|
|
26
26
|
"clean": "rimraf dist .turbo",
|
|
27
27
|
"lint": "bun lint:fix",
|
|
28
|
-
"lint:fix": "
|
|
29
|
-
"lint:check": "
|
|
28
|
+
"lint:fix": "biome check --write --unsafe --only=nursery/useSortedClasses . && biome check --write .",
|
|
29
|
+
"lint:check": "biome check .",
|
|
30
30
|
"test": "bun test --pass-with-no-tests",
|
|
31
31
|
"prebuild": "contractspec-bun-build prebuild",
|
|
32
32
|
"typecheck": "tsc --noEmit"
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@contractspec/lib.bus": "3.7.
|
|
36
|
-
"@contractspec/lib.schema": "3.7.
|
|
37
|
-
"@contractspec/lib.contracts-spec": "
|
|
38
|
-
"@contractspec/lib.knowledge": "3.7.
|
|
39
|
-
"@contractspec/lib.overlay-engine": "3.7.
|
|
35
|
+
"@contractspec/lib.bus": "3.7.10",
|
|
36
|
+
"@contractspec/lib.schema": "3.7.8",
|
|
37
|
+
"@contractspec/lib.contracts-spec": "4.1.2",
|
|
38
|
+
"@contractspec/lib.knowledge": "3.7.10",
|
|
39
|
+
"@contractspec/lib.overlay-engine": "3.7.10",
|
|
40
40
|
"@opentelemetry/api": "^1.9.0"
|
|
41
41
|
},
|
|
42
42
|
"peerDependencies": {
|
|
43
43
|
"@opentelemetry/api": "^1.9.0",
|
|
44
|
-
"@contractspec/lib.surface-runtime": "0.5.
|
|
44
|
+
"@contractspec/lib.surface-runtime": "0.5.10"
|
|
45
45
|
},
|
|
46
46
|
"peerDependenciesMeta": {
|
|
47
47
|
"@contractspec/lib.surface-runtime": {
|
|
@@ -49,9 +49,9 @@
|
|
|
49
49
|
}
|
|
50
50
|
},
|
|
51
51
|
"devDependencies": {
|
|
52
|
-
"@contractspec/tool.typescript": "3.7.
|
|
52
|
+
"@contractspec/tool.typescript": "3.7.8",
|
|
53
53
|
"typescript": "^5.9.3",
|
|
54
|
-
"@contractspec/tool.bun": "3.7.
|
|
54
|
+
"@contractspec/tool.bun": "3.7.8"
|
|
55
55
|
},
|
|
56
56
|
"exports": {
|
|
57
57
|
".": {
|