@gradial/aci 0.1.52-rc.16 → 0.1.52-rc.21
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 +4 -4
- package/dist/astro/preview.js +2 -17
- package/dist/audience-data-models.d.ts +193 -16
- package/dist/audience-data-models.js +47 -2
- package/dist/collect/batcher.d.ts +6 -5
- package/dist/collect/batcher.js +6 -5
- package/dist/edge/expression-capabilities.v1.d.ts +106 -0
- package/dist/edge/expression-capabilities.v1.js +165 -0
- package/dist/internal/domain/edge/identity.js +1 -1
- package/dist/internal/domain/edge/mimic_token.js +1 -2
- package/dist/internal/domain/edge/personalization-core.d.ts +14 -4
- package/dist/internal/domain/edge/personalization-core.js +472 -54
- package/dist/internal/domain/edge/record/codec.d.ts +5 -2
- package/dist/internal/domain/edge/record/codec.js +83 -10
- package/dist/internal/domain/edge/resolve.js +13 -2
- package/dist/internal/domain/edge/testdata/flat_only_validator_v1.d.ts +10 -0
- package/dist/internal/domain/edge/testdata/flat_only_validator_v1.js +253 -0
- package/dist/internal/domain/edge/types.d.ts +36 -9
- package/dist/internal/domain/edge/types.js +3 -3
- package/dist/mimic/core.d.ts +0 -32
- package/dist/mimic/core.js +12 -108
- package/dist/next/vercel-edge-projection-v1.d.ts +0 -9
- package/dist/next/vercel-edge-projection-v1.js +9 -545
- package/dist/preview/core.d.ts +1 -0
- package/dist/preview/core.js +27 -0
- package/dist/react/VideoPlayer.d.ts +1 -1
- package/dist/react/index.d.ts +1 -1
- package/package.json +16 -7
- package/templates/common/.agents/skills/aci/SKILL.md +6 -0
- package/templates/common/.agents/skills/dam-delivery/SKILL.md +228 -0
- package/templates/common/.agents/skills/dam-delivery/references/parameter-contract.md +107 -0
- package/templates/common/.agents/skills/dam-delivery/references/permalink-grammar.md +131 -0
- package/dist/edge/personalization-core.d.ts +0 -35
- package/dist/edge/personalization-core.js +0 -483
- package/dist/next/collect-route.d.ts +0 -25
- package/dist/next/collect-route.js +0 -479
- package/dist/next/envelope-digest.d.ts +0 -21
- package/dist/next/envelope-digest.js +0 -58
- package/dist/next/personalization-host.d.ts +0 -138
- package/dist/next/personalization-host.js +0 -280
- package/dist/next/root-layout.d.ts +0 -4
- package/dist/next/root-layout.js +0 -5
- package/dist/next/vercel-collect-sdk-route.d.ts +0 -27
- package/dist/next/vercel-collect-sdk-route.js +0 -181
- package/dist/next/vercel-personalization.d.ts +0 -4
- package/dist/next/vercel-personalization.js +0 -4
- package/dist/next/vercel-s3-personalization.d.ts +0 -80
- package/dist/next/vercel-s3-personalization.js +0 -571
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
// GENERATED by scripts/generate-expression-capabilities.go — DO NOT EDIT.
|
|
2
|
+
// Regenerate: make expression-capabilities
|
|
3
|
+
//
|
|
4
|
+
// The published capability discovery schema for the personalization
|
|
5
|
+
// expression contract (ADR 0038), generated from the Go vocabulary tables
|
|
6
|
+
// and drift-gated in CI against the canonical JSON artifact at
|
|
7
|
+
// internal/domain/personalization/expression/schema/.
|
|
8
|
+
export const expressionCapabilities = {
|
|
9
|
+
"schemaVersion": 1,
|
|
10
|
+
"contract": "personalization-expression",
|
|
11
|
+
"maxConditions": 64,
|
|
12
|
+
"maxDepth": 5,
|
|
13
|
+
"maxInValues": 32,
|
|
14
|
+
"grammars": {
|
|
15
|
+
"number": "^-?(0|[1-9][0-9]*)(\\.[0-9]+)?([eE][+-]?[0-9]+)?$",
|
|
16
|
+
"timestamp": "^(\\d{4})-(\\d{2})-(\\d{2})T(\\d{2}):(\\d{2}):(\\d{2})(\\.\\d{1,9})?(Z|[+-]\\d{2}:\\d{2})$"
|
|
17
|
+
},
|
|
18
|
+
"operators": [
|
|
19
|
+
{
|
|
20
|
+
"name": "equals",
|
|
21
|
+
"operand": "scalar",
|
|
22
|
+
"compact": "eq"
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
"name": "contains",
|
|
26
|
+
"operand": "scalar",
|
|
27
|
+
"compact": "ct"
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
"name": "startsWith",
|
|
31
|
+
"operand": "scalar",
|
|
32
|
+
"compact": "sw"
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
"name": "exists",
|
|
36
|
+
"operand": "optionalBoolean",
|
|
37
|
+
"compact": "ex"
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
"name": "greaterThan",
|
|
41
|
+
"operand": "number",
|
|
42
|
+
"compact": "gt"
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
"name": "greaterThanOrEqual",
|
|
46
|
+
"operand": "number",
|
|
47
|
+
"compact": "ge"
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
"name": "lessThan",
|
|
51
|
+
"operand": "number",
|
|
52
|
+
"compact": "lt"
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
"name": "lessThanOrEqual",
|
|
56
|
+
"operand": "number",
|
|
57
|
+
"compact": "le"
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
"name": "before",
|
|
61
|
+
"operand": "timestamp",
|
|
62
|
+
"compact": "bf"
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
"name": "after",
|
|
66
|
+
"operand": "timestamp",
|
|
67
|
+
"compact": "af"
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
"name": "between",
|
|
71
|
+
"operand": "range",
|
|
72
|
+
"compact": "bt",
|
|
73
|
+
"range": {
|
|
74
|
+
"memberTypes": [
|
|
75
|
+
"number",
|
|
76
|
+
"timestamp"
|
|
77
|
+
],
|
|
78
|
+
"homogeneous": true,
|
|
79
|
+
"inclusive": true
|
|
80
|
+
}
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
"name": "in",
|
|
84
|
+
"operand": "scalarList",
|
|
85
|
+
"compact": "in",
|
|
86
|
+
"maxValues": 32
|
|
87
|
+
}
|
|
88
|
+
],
|
|
89
|
+
"scopes": [
|
|
90
|
+
{
|
|
91
|
+
"scope": "request",
|
|
92
|
+
"allowsEmpty": false,
|
|
93
|
+
"fields": [
|
|
94
|
+
{
|
|
95
|
+
"field": "referrer"
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
"field": "query.*"
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
"field": "header.*"
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
"field": "cookie.*"
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
"field": "geo.*"
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
"field": "utm.*"
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
"field": "device.class",
|
|
114
|
+
"operators": [
|
|
115
|
+
"equals",
|
|
116
|
+
"in",
|
|
117
|
+
"exists"
|
|
118
|
+
],
|
|
119
|
+
"values": [
|
|
120
|
+
"desktop",
|
|
121
|
+
"mobile",
|
|
122
|
+
"tablet",
|
|
123
|
+
"unknown"
|
|
124
|
+
]
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
"field": "time.now",
|
|
128
|
+
"operators": [
|
|
129
|
+
"before",
|
|
130
|
+
"after",
|
|
131
|
+
"between",
|
|
132
|
+
"exists"
|
|
133
|
+
],
|
|
134
|
+
"instant": true
|
|
135
|
+
},
|
|
136
|
+
{
|
|
137
|
+
"field": "audience.memberships",
|
|
138
|
+
"operators": [
|
|
139
|
+
"equals",
|
|
140
|
+
"in",
|
|
141
|
+
"exists"
|
|
142
|
+
]
|
|
143
|
+
}
|
|
144
|
+
]
|
|
145
|
+
},
|
|
146
|
+
{
|
|
147
|
+
"scope": "event",
|
|
148
|
+
"allowsEmpty": true,
|
|
149
|
+
"fields": [
|
|
150
|
+
{
|
|
151
|
+
"field": "referrer"
|
|
152
|
+
},
|
|
153
|
+
{
|
|
154
|
+
"field": "page.path"
|
|
155
|
+
},
|
|
156
|
+
{
|
|
157
|
+
"field": "properties.*"
|
|
158
|
+
},
|
|
159
|
+
{
|
|
160
|
+
"field": "utm.*"
|
|
161
|
+
}
|
|
162
|
+
]
|
|
163
|
+
}
|
|
164
|
+
]
|
|
165
|
+
};
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
// - Cookie mutation helpers
|
|
9
9
|
//
|
|
10
10
|
// Shared by every static edge adapter; this logic has no SDK host wrapper.
|
|
11
|
-
// internal/domain/audience/runtime/
|
|
11
|
+
// internal/domain/audience/runtime/collect.ts imports from here as well.
|
|
12
12
|
const encoder = new TextEncoder();
|
|
13
13
|
const decoder = new TextDecoder();
|
|
14
14
|
// ── Constants ──
|
|
@@ -3,8 +3,7 @@
|
|
|
3
3
|
// Same HS256 envelope and signing key as preview; the scope claim makes the
|
|
4
4
|
// tokens non-interchangeable (D-6). This validator is the twin of
|
|
5
5
|
// internal/domain/edge/routing/mimic.go, pinned by the shared vector file
|
|
6
|
-
// (internal/domain/edge/routing/testdata/mimic_token_vectors.json)
|
|
7
|
-
// mirror for framework hosts is packages/sdk/src/mimic/core.ts.
|
|
6
|
+
// (internal/domain/edge/routing/testdata/mimic_token_vectors.json).
|
|
8
7
|
export const MIMIC_MAX_MEMBERSHIPS = 32;
|
|
9
8
|
export const MIMIC_MAX_TOKEN_BYTES = 2048;
|
|
10
9
|
export async function validateMimicToken(token, signingKey, siteId) {
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import type { PersonalizationRequestContext, PersonalizationClaims,
|
|
2
|
-
export declare function selectPersonalizationVariant(request: PersonalizationRequestContext, route: PersonalizationRoute | null, claims: PersonalizationClaims | null, experiments?: Record<string, PersonalizationExperiment>, identity?: PersonalizationIdentity): PersonalizationVariant | null;
|
|
1
|
+
import type { PersonalizationRequestContext, PersonalizationClaims, PersonalizationRoute, PersonalizationExperiment, PersonalizationIdentity, PersonalizationDecision, ClassificationData, Classification, EdgeRouteEntry } from './types.js';
|
|
3
2
|
export declare function resolvePersonalizationDecision(request: PersonalizationRequestContext, route: PersonalizationRoute | null, claims: PersonalizationClaims | null, experiments?: Record<string, PersonalizationExperiment>, identity?: PersonalizationIdentity): PersonalizationDecision;
|
|
4
3
|
export type ExpressionFactStatus = 'present' | 'absent' | 'unavailable';
|
|
5
4
|
export interface ExpressionFact {
|
|
@@ -23,6 +22,7 @@ export interface ExpressionLeafTrace {
|
|
|
23
22
|
reason: 'matched' | 'not_matched' | 'absent' | 'unavailable';
|
|
24
23
|
}
|
|
25
24
|
export interface ExpressionGroupTrace {
|
|
25
|
+
path: string;
|
|
26
26
|
group: 'all' | 'any';
|
|
27
27
|
total: number;
|
|
28
28
|
matched: number;
|
|
@@ -43,6 +43,9 @@ export declare function evaluateRequestExpression(rule: {
|
|
|
43
43
|
all?: unknown[];
|
|
44
44
|
any?: unknown[];
|
|
45
45
|
}, resolve: (field: string) => ExpressionFact): RequestExpressionResult;
|
|
46
|
+
export declare const EXPRESSION_OPERATORS: string[];
|
|
47
|
+
export declare const EXPRESSION_NUMBER_GRAMMAR: RegExp;
|
|
48
|
+
export declare const EXPRESSION_TIMESTAMP_GRAMMAR: RegExp;
|
|
46
49
|
/**
|
|
47
50
|
* Phase 1: Classify the visitor against all release-level rules.
|
|
48
51
|
*
|
|
@@ -60,13 +63,20 @@ export declare function classify(ctx: PersonalizationRequestContext, data: Class
|
|
|
60
63
|
* Phase 2: Decide the winning variant for a specific route.
|
|
61
64
|
*
|
|
62
65
|
* Uses the classification from Phase 1 for cheap set-membership lookups.
|
|
63
|
-
*
|
|
66
|
+
* Audience/segment rules were already evaluated in Phase 1; the one rule
|
|
67
|
+
* evaluated here is an experiment arm variant's own rule, because the arm
|
|
68
|
+
* assignment is candidacy, not entitlement (ADR 0040).
|
|
64
69
|
*
|
|
65
70
|
* @param record The route entry (path, dispatch, variants)
|
|
66
71
|
* @param classification The visitor's classification from Phase 1
|
|
72
|
+
* @param ctx The request context (signal facts + rejection sink)
|
|
73
|
+
* @param claims The verified claims the caller already holds — the
|
|
74
|
+
* same object passed to classify() — so an arm variant's
|
|
75
|
+
* audience.memberships rule resolves identically to the
|
|
76
|
+
* resolver path and fails closed without it (ADR 0039).
|
|
67
77
|
* @returns The decision — winning variant + experiment assignment, or nulls
|
|
68
78
|
*/
|
|
69
|
-
export declare function decide(record: EdgeRouteEntry, classification: Classification, ctx: PersonalizationRequestContext): PersonalizationDecision;
|
|
79
|
+
export declare function decide(record: EdgeRouteEntry, classification: Classification, ctx: PersonalizationRequestContext, claims?: PersonalizationClaims | null): PersonalizationDecision;
|
|
70
80
|
export declare const DEVICE_CLASSES: string[];
|
|
71
81
|
/**
|
|
72
82
|
* Classifies the request's device class from its own headers. Returns '' when
|