@contractspec/example.personalization 3.7.17 → 3.7.18
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/.turbo/turbo-build.log +33 -33
- package/CHANGELOG.md +14 -0
- package/dist/behavior-tracking.js +1 -44
- package/dist/browser/behavior-tracking.js +1 -44
- package/dist/browser/docs/index.js +2 -33
- package/dist/browser/docs/personalization.docblock.js +2 -33
- package/dist/browser/example.js +1 -33
- package/dist/browser/index.js +2 -365
- package/dist/browser/overlay-customization.js +1 -53
- package/dist/browser/personalization.experiment.js +1 -62
- package/dist/browser/personalization.feature.js +1 -22
- package/dist/browser/personalization.theme.js +1 -64
- package/dist/browser/workflow-extension.js +1 -60
- package/dist/docs/index.js +2 -33
- package/dist/docs/personalization.docblock.js +2 -33
- package/dist/example.js +1 -33
- package/dist/index.js +2 -365
- package/dist/node/behavior-tracking.js +1 -44
- package/dist/node/docs/index.js +2 -33
- package/dist/node/docs/personalization.docblock.js +2 -33
- package/dist/node/example.js +1 -33
- package/dist/node/index.js +2 -365
- package/dist/node/overlay-customization.js +1 -53
- package/dist/node/personalization.experiment.js +1 -62
- package/dist/node/personalization.feature.js +1 -22
- package/dist/node/personalization.theme.js +1 -64
- package/dist/node/workflow-extension.js +1 -60
- package/dist/overlay-customization.js +1 -53
- package/dist/personalization.experiment.js +1 -62
- package/dist/personalization.feature.js +1 -22
- package/dist/personalization.theme.js +1 -64
- package/dist/workflow-extension.js +1 -60
- package/package.json +8 -8
package/.turbo/turbo-build.log
CHANGED
|
@@ -2,45 +2,45 @@ $ contractspec-bun-build prebuild
|
|
|
2
2
|
$ bun run build:bundle && bun run build:types
|
|
3
3
|
$ contractspec-bun-build transpile
|
|
4
4
|
[contractspec-bun-build] transpile target=bun root=src entries=10 noBundle=false
|
|
5
|
-
Bundled 10 modules in
|
|
5
|
+
Bundled 10 modules in 16ms
|
|
6
6
|
|
|
7
|
-
./behavior-tracking.js
|
|
8
|
-
./index.js
|
|
9
|
-
./personalization.theme.js
|
|
10
|
-
./workflow-extension.js 1.
|
|
11
|
-
docs/index.js 1.
|
|
12
|
-
docs/personalization.docblock.js 1.
|
|
13
|
-
./example.js 0.
|
|
14
|
-
./overlay-customization.js 1.
|
|
15
|
-
./personalization.experiment.js 1.
|
|
16
|
-
./personalization.feature.js 0.
|
|
7
|
+
./behavior-tracking.js 0.95 KB (entry point)
|
|
8
|
+
./index.js 7.59 KB (entry point)
|
|
9
|
+
./personalization.theme.js 0.88 KB (entry point)
|
|
10
|
+
./workflow-extension.js 1.1 KB (entry point)
|
|
11
|
+
docs/index.js 1.29 KB (entry point)
|
|
12
|
+
docs/personalization.docblock.js 1.29 KB (entry point)
|
|
13
|
+
./example.js 0.75 KB (entry point)
|
|
14
|
+
./overlay-customization.js 1.0 KB (entry point)
|
|
15
|
+
./personalization.experiment.js 1.15 KB (entry point)
|
|
16
|
+
./personalization.feature.js 0.55 KB (entry point)
|
|
17
17
|
|
|
18
18
|
[contractspec-bun-build] transpile target=node root=src entries=10 noBundle=false
|
|
19
|
-
Bundled 10 modules in
|
|
19
|
+
Bundled 10 modules in 33ms
|
|
20
20
|
|
|
21
|
-
./behavior-tracking.js
|
|
22
|
-
./index.js
|
|
23
|
-
./personalization.theme.js
|
|
24
|
-
./workflow-extension.js 1.
|
|
25
|
-
docs/index.js 1.
|
|
26
|
-
docs/personalization.docblock.js 1.
|
|
27
|
-
./example.js 0.
|
|
28
|
-
./overlay-customization.js 1.
|
|
29
|
-
./personalization.experiment.js 1.
|
|
30
|
-
./personalization.feature.js 0.
|
|
21
|
+
./behavior-tracking.js 0.94 KB (entry point)
|
|
22
|
+
./index.js 7.58 KB (entry point)
|
|
23
|
+
./personalization.theme.js 0.87 KB (entry point)
|
|
24
|
+
./workflow-extension.js 1.1 KB (entry point)
|
|
25
|
+
docs/index.js 1.28 KB (entry point)
|
|
26
|
+
docs/personalization.docblock.js 1.28 KB (entry point)
|
|
27
|
+
./example.js 0.74 KB (entry point)
|
|
28
|
+
./overlay-customization.js 1.0 KB (entry point)
|
|
29
|
+
./personalization.experiment.js 1.14 KB (entry point)
|
|
30
|
+
./personalization.feature.js 0.55 KB (entry point)
|
|
31
31
|
|
|
32
32
|
[contractspec-bun-build] transpile target=browser root=src entries=10 noBundle=false
|
|
33
|
-
Bundled 10 modules in
|
|
33
|
+
Bundled 10 modules in 19ms
|
|
34
34
|
|
|
35
|
-
./behavior-tracking.js
|
|
36
|
-
./index.js
|
|
37
|
-
./personalization.theme.js
|
|
38
|
-
./workflow-extension.js 1.
|
|
39
|
-
docs/index.js 1.
|
|
40
|
-
docs/personalization.docblock.js 1.
|
|
41
|
-
./example.js 0.
|
|
42
|
-
./overlay-customization.js 1.
|
|
43
|
-
./personalization.experiment.js 1.
|
|
44
|
-
./personalization.feature.js 0.
|
|
35
|
+
./behavior-tracking.js 0.94 KB (entry point)
|
|
36
|
+
./index.js 7.58 KB (entry point)
|
|
37
|
+
./personalization.theme.js 0.87 KB (entry point)
|
|
38
|
+
./workflow-extension.js 1.1 KB (entry point)
|
|
39
|
+
docs/index.js 1.28 KB (entry point)
|
|
40
|
+
docs/personalization.docblock.js 1.28 KB (entry point)
|
|
41
|
+
./example.js 0.74 KB (entry point)
|
|
42
|
+
./overlay-customization.js 1.0 KB (entry point)
|
|
43
|
+
./personalization.experiment.js 1.14 KB (entry point)
|
|
44
|
+
./personalization.feature.js 0.55 KB (entry point)
|
|
45
45
|
|
|
46
46
|
$ contractspec-bun-build types
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# @contractspec/example.personalization
|
|
2
2
|
|
|
3
|
+
## 3.7.18
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- chore: auto-bump internal dependents
|
|
8
|
+
- Updated dependencies because of chore: auto-bump internal dependents
|
|
9
|
+
- Updated dependencies because of Introduce the Builder v3 control plane as a governed authoring layer over external execution providers.
|
|
10
|
+
- Updated dependencies because of Implement ContractSpec Connect as a first-class spec, runtime, and CLI workflow.
|
|
11
|
+
- @contractspec/lib.overlay-engine@3.7.18
|
|
12
|
+
- @contractspec/lib.personalization@6.0.18
|
|
13
|
+
- @contractspec/lib.workflow-composer@3.7.18
|
|
14
|
+
- @contractspec/lib.contracts-spec@5.2.0
|
|
15
|
+
- @contractspec/lib.logger@3.7.13
|
|
16
|
+
|
|
3
17
|
## 3.7.17
|
|
4
18
|
|
|
5
19
|
### Patch Changes
|
|
@@ -1,45 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
|
|
3
|
-
import { Logger, LogLevel } from "@contractspec/lib.logger";
|
|
4
|
-
import { BehaviorAnalyzer } from "@contractspec/lib.personalization/analyzer";
|
|
5
|
-
import { InMemoryBehaviorStore } from "@contractspec/lib.personalization/store";
|
|
6
|
-
import { createBehaviorTracker } from "@contractspec/lib.personalization/tracker";
|
|
7
|
-
var logger = new Logger({
|
|
8
|
-
level: LogLevel.INFO,
|
|
9
|
-
environment: "production",
|
|
10
|
-
enableColors: false
|
|
11
|
-
});
|
|
12
|
-
async function runBehaviorTrackingExample() {
|
|
13
|
-
const store = new InMemoryBehaviorStore;
|
|
14
|
-
const tracker = createBehaviorTracker({
|
|
15
|
-
store,
|
|
16
|
-
context: {
|
|
17
|
-
tenantId: "acme",
|
|
18
|
-
userId: "user-123"
|
|
19
|
-
}
|
|
20
|
-
});
|
|
21
|
-
tracker.trackFieldAccess({
|
|
22
|
-
operation: "billing.createOrder",
|
|
23
|
-
field: "internalNotes"
|
|
24
|
-
});
|
|
25
|
-
tracker.trackFieldAccess({
|
|
26
|
-
operation: "billing.createOrder",
|
|
27
|
-
field: "customerReference"
|
|
28
|
-
});
|
|
29
|
-
tracker.trackFeatureUsage({ feature: "workflow-editor", action: "opened" });
|
|
30
|
-
tracker.trackWorkflowStep({
|
|
31
|
-
workflow: "invoice-approval",
|
|
32
|
-
step: "review",
|
|
33
|
-
status: "entered"
|
|
34
|
-
});
|
|
35
|
-
await tracker.flush();
|
|
36
|
-
const analyzer = new BehaviorAnalyzer(store);
|
|
37
|
-
const insights = await analyzer.analyze({
|
|
38
|
-
tenantId: "acme",
|
|
39
|
-
userId: "user-123"
|
|
40
|
-
});
|
|
41
|
-
logger.info("Behavior insights computed", { insights });
|
|
42
|
-
}
|
|
43
|
-
export {
|
|
44
|
-
runBehaviorTrackingExample
|
|
45
|
-
};
|
|
2
|
+
import{Logger as q,LogLevel as u}from"@contractspec/lib.logger";import{BehaviorAnalyzer as w}from"@contractspec/lib.personalization/analyzer";import{InMemoryBehaviorStore as x}from"@contractspec/lib.personalization/store";import{createBehaviorTracker as C}from"@contractspec/lib.personalization/tracker";var D=new q({level:u.INFO,environment:"production",enableColors:!1});async function K(){let f=new x,d=C({store:f,context:{tenantId:"acme",userId:"user-123"}});d.trackFieldAccess({operation:"billing.createOrder",field:"internalNotes"}),d.trackFieldAccess({operation:"billing.createOrder",field:"customerReference"}),d.trackFeatureUsage({feature:"workflow-editor",action:"opened"}),d.trackWorkflowStep({workflow:"invoice-approval",step:"review",status:"entered"}),await d.flush();let j=await new w(f).analyze({tenantId:"acme",userId:"user-123"});D.info("Behavior insights computed",{insights:j})}export{K as runBehaviorTrackingExample};
|
|
@@ -1,44 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import { Logger, LogLevel } from "@contractspec/lib.logger";
|
|
3
|
-
import { BehaviorAnalyzer } from "@contractspec/lib.personalization/analyzer";
|
|
4
|
-
import { InMemoryBehaviorStore } from "@contractspec/lib.personalization/store";
|
|
5
|
-
import { createBehaviorTracker } from "@contractspec/lib.personalization/tracker";
|
|
6
|
-
var logger = new Logger({
|
|
7
|
-
level: LogLevel.INFO,
|
|
8
|
-
environment: "production",
|
|
9
|
-
enableColors: false
|
|
10
|
-
});
|
|
11
|
-
async function runBehaviorTrackingExample() {
|
|
12
|
-
const store = new InMemoryBehaviorStore;
|
|
13
|
-
const tracker = createBehaviorTracker({
|
|
14
|
-
store,
|
|
15
|
-
context: {
|
|
16
|
-
tenantId: "acme",
|
|
17
|
-
userId: "user-123"
|
|
18
|
-
}
|
|
19
|
-
});
|
|
20
|
-
tracker.trackFieldAccess({
|
|
21
|
-
operation: "billing.createOrder",
|
|
22
|
-
field: "internalNotes"
|
|
23
|
-
});
|
|
24
|
-
tracker.trackFieldAccess({
|
|
25
|
-
operation: "billing.createOrder",
|
|
26
|
-
field: "customerReference"
|
|
27
|
-
});
|
|
28
|
-
tracker.trackFeatureUsage({ feature: "workflow-editor", action: "opened" });
|
|
29
|
-
tracker.trackWorkflowStep({
|
|
30
|
-
workflow: "invoice-approval",
|
|
31
|
-
step: "review",
|
|
32
|
-
status: "entered"
|
|
33
|
-
});
|
|
34
|
-
await tracker.flush();
|
|
35
|
-
const analyzer = new BehaviorAnalyzer(store);
|
|
36
|
-
const insights = await analyzer.analyze({
|
|
37
|
-
tenantId: "acme",
|
|
38
|
-
userId: "user-123"
|
|
39
|
-
});
|
|
40
|
-
logger.info("Behavior insights computed", { insights });
|
|
41
|
-
}
|
|
42
|
-
export {
|
|
43
|
-
runBehaviorTrackingExample
|
|
44
|
-
};
|
|
1
|
+
import{Logger as q,LogLevel as u}from"@contractspec/lib.logger";import{BehaviorAnalyzer as w}from"@contractspec/lib.personalization/analyzer";import{InMemoryBehaviorStore as x}from"@contractspec/lib.personalization/store";import{createBehaviorTracker as C}from"@contractspec/lib.personalization/tracker";var D=new q({level:u.INFO,environment:"production",enableColors:!1});async function K(){let f=new x,d=C({store:f,context:{tenantId:"acme",userId:"user-123"}});d.trackFieldAccess({operation:"billing.createOrder",field:"internalNotes"}),d.trackFieldAccess({operation:"billing.createOrder",field:"customerReference"}),d.trackFeatureUsage({feature:"workflow-editor",action:"opened"}),d.trackWorkflowStep({workflow:"invoice-approval",step:"review",status:"entered"}),await d.flush();let j=await new w(f).analyze({tenantId:"acme",userId:"user-123"});D.info("Behavior insights computed",{insights:j})}export{K as runBehaviorTrackingExample};
|
|
@@ -1,15 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
import { registerDocBlocks } from "@contractspec/lib.contracts-spec/docs";
|
|
3
|
-
var blocks = [
|
|
4
|
-
{
|
|
5
|
-
id: "docs.examples.personalization",
|
|
6
|
-
title: "Personalization Patterns (example)",
|
|
7
|
-
summary: "Behavior tracking, overlay-driven UI tweaks, and tenant workflow extension patterns.",
|
|
8
|
-
kind: "reference",
|
|
9
|
-
visibility: "public",
|
|
10
|
-
route: "/docs/examples/personalization",
|
|
11
|
-
tags: ["personalization", "overlays", "workflows", "example"],
|
|
12
|
-
body: `## Includes
|
|
1
|
+
import{registerDocBlocks as m}from"@contractspec/lib.contracts-spec/docs";var f=[{id:"docs.examples.personalization",title:"Personalization Patterns (example)",summary:"Behavior tracking, overlay-driven UI tweaks, and tenant workflow extension patterns.",kind:"reference",visibility:"public",route:"/docs/examples/personalization",tags:["personalization","overlays","workflows","example"],body:`## Includes
|
|
13
2
|
- Behavior tracking + insight analysis.
|
|
14
3
|
- Overlay customization (hide fields, rename labels).
|
|
15
4
|
- Workflow extension (inject tenant-specific steps).
|
|
@@ -17,24 +6,4 @@ var blocks = [
|
|
|
17
6
|
## Guardrails
|
|
18
7
|
- Keep tracking events structured and non-PII.
|
|
19
8
|
- Keep overlays signed and scoped.
|
|
20
|
-
- Keep workflow composition deterministic.`
|
|
21
|
-
},
|
|
22
|
-
{
|
|
23
|
-
id: "docs.examples.personalization.usage",
|
|
24
|
-
title: "Personalization — Usage",
|
|
25
|
-
summary: "How to run the small examples and swap adapters.",
|
|
26
|
-
kind: "usage",
|
|
27
|
-
visibility: "public",
|
|
28
|
-
route: "/docs/examples/personalization/usage",
|
|
29
|
-
tags: ["personalization", "usage"],
|
|
30
|
-
body: `## Usage
|
|
31
|
-
- Call \`runBehaviorTrackingExample()\` for insights.
|
|
32
|
-
- Call \`runOverlayCustomizationExample()\` to apply overlays.
|
|
33
|
-
- Call \`composeTenantWorkflowExample()\` and \`logTenantWorkflowSteps()\` to inspect steps.
|
|
34
|
-
|
|
35
|
-
## Notes
|
|
36
|
-
- Replace in-memory stores with app-layer storage.
|
|
37
|
-
- Keep PII out of logs and markdown outputs.`
|
|
38
|
-
}
|
|
39
|
-
];
|
|
40
|
-
registerDocBlocks(blocks);
|
|
9
|
+
- Keep workflow composition deterministic.`},{id:"docs.examples.personalization.usage",title:"Personalization — Usage",summary:"How to run the small examples and swap adapters.",kind:"usage",visibility:"public",route:"/docs/examples/personalization/usage",tags:["personalization","usage"],body:"## Usage\n- Call `runBehaviorTrackingExample()` for insights.\n- Call `runOverlayCustomizationExample()` to apply overlays.\n- Call `composeTenantWorkflowExample()` and `logTenantWorkflowSteps()` to inspect steps.\n\n## Notes\n- Replace in-memory stores with app-layer storage.\n- Keep PII out of logs and markdown outputs."}];m(f);
|
|
@@ -1,15 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
import { registerDocBlocks } from "@contractspec/lib.contracts-spec/docs";
|
|
3
|
-
var blocks = [
|
|
4
|
-
{
|
|
5
|
-
id: "docs.examples.personalization",
|
|
6
|
-
title: "Personalization Patterns (example)",
|
|
7
|
-
summary: "Behavior tracking, overlay-driven UI tweaks, and tenant workflow extension patterns.",
|
|
8
|
-
kind: "reference",
|
|
9
|
-
visibility: "public",
|
|
10
|
-
route: "/docs/examples/personalization",
|
|
11
|
-
tags: ["personalization", "overlays", "workflows", "example"],
|
|
12
|
-
body: `## Includes
|
|
1
|
+
import{registerDocBlocks as f}from"@contractspec/lib.contracts-spec/docs";var h=[{id:"docs.examples.personalization",title:"Personalization Patterns (example)",summary:"Behavior tracking, overlay-driven UI tweaks, and tenant workflow extension patterns.",kind:"reference",visibility:"public",route:"/docs/examples/personalization",tags:["personalization","overlays","workflows","example"],body:`## Includes
|
|
13
2
|
- Behavior tracking + insight analysis.
|
|
14
3
|
- Overlay customization (hide fields, rename labels).
|
|
15
4
|
- Workflow extension (inject tenant-specific steps).
|
|
@@ -17,24 +6,4 @@ var blocks = [
|
|
|
17
6
|
## Guardrails
|
|
18
7
|
- Keep tracking events structured and non-PII.
|
|
19
8
|
- Keep overlays signed and scoped.
|
|
20
|
-
- Keep workflow composition deterministic.`
|
|
21
|
-
},
|
|
22
|
-
{
|
|
23
|
-
id: "docs.examples.personalization.usage",
|
|
24
|
-
title: "Personalization — Usage",
|
|
25
|
-
summary: "How to run the small examples and swap adapters.",
|
|
26
|
-
kind: "usage",
|
|
27
|
-
visibility: "public",
|
|
28
|
-
route: "/docs/examples/personalization/usage",
|
|
29
|
-
tags: ["personalization", "usage"],
|
|
30
|
-
body: `## Usage
|
|
31
|
-
- Call \`runBehaviorTrackingExample()\` for insights.
|
|
32
|
-
- Call \`runOverlayCustomizationExample()\` to apply overlays.
|
|
33
|
-
- Call \`composeTenantWorkflowExample()\` and \`logTenantWorkflowSteps()\` to inspect steps.
|
|
34
|
-
|
|
35
|
-
## Notes
|
|
36
|
-
- Replace in-memory stores with app-layer storage.
|
|
37
|
-
- Keep PII out of logs and markdown outputs.`
|
|
38
|
-
}
|
|
39
|
-
];
|
|
40
|
-
registerDocBlocks(blocks);
|
|
9
|
+
- Keep workflow composition deterministic.`},{id:"docs.examples.personalization.usage",title:"Personalization — Usage",summary:"How to run the small examples and swap adapters.",kind:"usage",visibility:"public",route:"/docs/examples/personalization/usage",tags:["personalization","usage"],body:"## Usage\n- Call `runBehaviorTrackingExample()` for insights.\n- Call `runOverlayCustomizationExample()` to apply overlays.\n- Call `composeTenantWorkflowExample()` and `logTenantWorkflowSteps()` to inspect steps.\n\n## Notes\n- Replace in-memory stores with app-layer storage.\n- Keep PII out of logs and markdown outputs."}];f(h);
|
package/dist/browser/example.js
CHANGED
|
@@ -1,33 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import { defineExample } from "@contractspec/lib.contracts-spec";
|
|
3
|
-
var example = defineExample({
|
|
4
|
-
meta: {
|
|
5
|
-
key: "personalization",
|
|
6
|
-
version: "1.0.0",
|
|
7
|
-
title: "Personalization Patterns",
|
|
8
|
-
description: "Small examples for behavior tracking, overlay-based UI customization, and tenant workflow extension.",
|
|
9
|
-
kind: "library",
|
|
10
|
-
visibility: "public",
|
|
11
|
-
stability: "experimental",
|
|
12
|
-
owners: ["@platform.core"],
|
|
13
|
-
tags: ["personalization", "overlays", "behavior", "workflows"]
|
|
14
|
-
},
|
|
15
|
-
docs: {
|
|
16
|
-
rootDocId: "docs.examples.personalization",
|
|
17
|
-
usageDocId: "docs.examples.personalization.usage"
|
|
18
|
-
},
|
|
19
|
-
entrypoints: {
|
|
20
|
-
packageName: "@contractspec/example.personalization",
|
|
21
|
-
docs: "./docs"
|
|
22
|
-
},
|
|
23
|
-
surfaces: {
|
|
24
|
-
templates: true,
|
|
25
|
-
sandbox: { enabled: true, modes: ["markdown", "specs"] },
|
|
26
|
-
studio: { enabled: true, installable: true },
|
|
27
|
-
mcp: { enabled: true }
|
|
28
|
-
}
|
|
29
|
-
});
|
|
30
|
-
var example_default = example;
|
|
31
|
-
export {
|
|
32
|
-
example_default as default
|
|
33
|
-
};
|
|
1
|
+
import{defineExample as g}from"@contractspec/lib.contracts-spec";var h=g({meta:{key:"personalization",version:"1.0.0",title:"Personalization Patterns",description:"Small examples for behavior tracking, overlay-based UI customization, and tenant workflow extension.",kind:"library",visibility:"public",stability:"experimental",owners:["@platform.core"],tags:["personalization","overlays","behavior","workflows"]},docs:{rootDocId:"docs.examples.personalization",usageDocId:"docs.examples.personalization.usage"},entrypoints:{packageName:"@contractspec/example.personalization",docs:"./docs"},surfaces:{templates:!0,sandbox:{enabled:!0,modes:["markdown","specs"]},studio:{enabled:!0,installable:!0},mcp:{enabled:!0}}}),q=h;export{q as default};
|