@getuserfeedback/protocol 3.0.14 → 3.1.0
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/dist/attention-policy.d.ts +15 -0
- package/dist/attention-policy.d.ts.map +1 -1
- package/dist/attention-policy.js +7 -1
- package/dist/core-command-envelope.d.ts +40 -2
- package/dist/core-command-envelope.d.ts.map +1 -1
- package/dist/core-commands.d.ts +40 -2
- package/dist/core-commands.d.ts.map +1 -1
- package/dist/core-commands.js +46 -6
- package/dist/flow-display.d.ts +15 -0
- package/dist/flow-display.d.ts.map +1 -1
- package/dist/flow-display.js +3 -2
- package/dist/host/lazy-handle-client.d.ts.map +1 -1
- package/dist/host/lazy-handle-client.js +5 -5
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/instance-feedback.d.ts +40 -0
- package/dist/instance-feedback.d.ts.map +1 -0
- package/dist/instance-feedback.js +49 -0
- package/package.json +7 -1
- package/src/attention-policy.ts +11 -1
- package/src/core-commands.ts +55 -6
- package/src/flow-display.test.ts +67 -0
- package/src/flow-display.ts +3 -1
- package/src/host/lazy-handle-client.ts +6 -5
- package/src/index.ts +10 -0
- package/src/instance-feedback.test.ts +86 -0
- package/src/instance-feedback.ts +83 -0
- package/src/protocol-root.test.ts +1 -0
|
@@ -9,7 +9,22 @@ export declare const attentionExclusiveSurfaceStrategySchema: z.ZodMiniEnum<{
|
|
|
9
9
|
export declare const attentionBlockedBroadcastStrategySchema: z.ZodMiniEnum<{
|
|
10
10
|
queue: "queue";
|
|
11
11
|
}>;
|
|
12
|
+
export declare const legacyAttentionPolicyConfigSchema: z.ZodMiniObject<{
|
|
13
|
+
version: z.ZodMiniString<string>;
|
|
14
|
+
source: z.ZodMiniEnum<{
|
|
15
|
+
default: "default";
|
|
16
|
+
custom: "custom";
|
|
17
|
+
}>;
|
|
18
|
+
recentFlowCooldownMs: z.ZodMiniNumber<number>;
|
|
19
|
+
exclusiveSurfaceStrategy: z.ZodMiniEnum<{
|
|
20
|
+
queue: "queue";
|
|
21
|
+
}>;
|
|
22
|
+
blockedBroadcastStrategy: z.ZodMiniEnum<{
|
|
23
|
+
queue: "queue";
|
|
24
|
+
}>;
|
|
25
|
+
}, z.core.$strict>;
|
|
12
26
|
export declare const attentionPolicyConfigSchema: z.ZodMiniObject<{
|
|
27
|
+
recentInAppCooldownMs: z.ZodMiniDefault<z.ZodMiniNumber<number>>;
|
|
13
28
|
version: z.ZodMiniString<string>;
|
|
14
29
|
source: z.ZodMiniEnum<{
|
|
15
30
|
default: "default";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"attention-policy.d.ts","sourceRoot":"","sources":["../src/attention-policy.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,UAAU,CAAC;AAE9B,eAAO,MAAM,2BAA2B;;;EAAgC,CAAC;AAEzE,eAAO,MAAM,uCAAuC;;EAAoB,CAAC;AAEzE,eAAO,MAAM,uCAAuC;;EAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"attention-policy.d.ts","sourceRoot":"","sources":["../src/attention-policy.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,UAAU,CAAC;AAE9B,eAAO,MAAM,2BAA2B;;;EAAgC,CAAC;AAEzE,eAAO,MAAM,uCAAuC;;EAAoB,CAAC;AAEzE,eAAO,MAAM,uCAAuC;;EAAoB,CAAC;AAUzE,eAAO,MAAM,iCAAiC;;;;;;;;;;;;;kBAE7C,CAAC;AAEF,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;kBAGtC,CAAC;AAEH,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,MAAM,CAC3C,OAAO,2BAA2B,CAClC,CAAC;AAEF,eAAO,MAAM,+BAA+B,EAAE,qBAO7C,CAAC"}
|
package/dist/attention-policy.js
CHANGED
|
@@ -2,17 +2,23 @@ import * as z from "zod/mini";
|
|
|
2
2
|
export const attentionPolicySourceSchema = z.enum(["default", "custom"]);
|
|
3
3
|
export const attentionExclusiveSurfaceStrategySchema = z.enum(["queue"]);
|
|
4
4
|
export const attentionBlockedBroadcastStrategySchema = z.enum(["queue"]);
|
|
5
|
-
|
|
5
|
+
const legacyAttentionPolicyConfigFields = {
|
|
6
6
|
version: z.string().check(z.trim(), z.minLength(1)),
|
|
7
7
|
source: attentionPolicySourceSchema,
|
|
8
8
|
recentFlowCooldownMs: z.number().check(z.positive()),
|
|
9
9
|
exclusiveSurfaceStrategy: attentionExclusiveSurfaceStrategySchema,
|
|
10
10
|
blockedBroadcastStrategy: attentionBlockedBroadcastStrategySchema,
|
|
11
|
+
};
|
|
12
|
+
export const legacyAttentionPolicyConfigSchema = z.strictObject(legacyAttentionPolicyConfigFields);
|
|
13
|
+
export const attentionPolicyConfigSchema = z.strictObject({
|
|
14
|
+
...legacyAttentionPolicyConfigFields,
|
|
15
|
+
recentInAppCooldownMs: z._default(z.number().check(z.nonnegative()), 0),
|
|
11
16
|
});
|
|
12
17
|
export const DEFAULT_ATTENTION_POLICY_CONFIG = {
|
|
13
18
|
version: "attention-policy-default-v1",
|
|
14
19
|
source: "default",
|
|
15
20
|
recentFlowCooldownMs: 5 * 60 * 1000,
|
|
21
|
+
recentInAppCooldownMs: 0,
|
|
16
22
|
exclusiveSurfaceStrategy: "queue",
|
|
17
23
|
blockedBroadcastStrategy: "queue",
|
|
18
24
|
};
|
|
@@ -42,7 +42,7 @@ export declare const coreCommandEnvelopeSchema: z.ZodMiniObject<{
|
|
|
42
42
|
}, z.core.$strip>>;
|
|
43
43
|
notes: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
44
44
|
}, z.core.$strip>>;
|
|
45
|
-
command: z.ZodMiniUnion<readonly [z.
|
|
45
|
+
command: z.ZodMiniUnion<readonly [z.ZodMiniUnion<readonly [z.ZodMiniUnion<readonly [z.ZodMiniObject<{
|
|
46
46
|
kind: z.ZodMiniLiteral<"open">;
|
|
47
47
|
flowId: z.ZodMiniString<string>;
|
|
48
48
|
flowHandleId: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
@@ -51,15 +51,53 @@ export declare const coreCommandEnvelopeSchema: z.ZodMiniObject<{
|
|
|
51
51
|
}, z.core.$strict>>;
|
|
52
52
|
hideCloseButton: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>;
|
|
53
53
|
}, z.core.$strict>, z.ZodMiniObject<{
|
|
54
|
+
kind: z.ZodMiniLiteral<"open">;
|
|
55
|
+
flow: z.ZodMiniObject<{
|
|
56
|
+
definition: z.ZodMiniUnknown;
|
|
57
|
+
theme: z.ZodMiniOptional<z.ZodMiniObject<{
|
|
58
|
+
css: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
59
|
+
themeRuntimeArtifactId: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
60
|
+
themeVersionId: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
61
|
+
}, z.core.$strict>>;
|
|
62
|
+
}, z.core.$strict>;
|
|
63
|
+
flowHandleId: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
64
|
+
metadata: z.ZodMiniOptional<z.ZodMiniObject<{
|
|
65
|
+
tags: z.ZodMiniOptional<z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>>;
|
|
66
|
+
}, z.core.$strict>>;
|
|
67
|
+
hideCloseButton: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>;
|
|
68
|
+
}, z.core.$strict>]>, z.ZodMiniUnion<readonly [z.ZodMiniObject<{
|
|
54
69
|
kind: z.ZodMiniLiteral<"prefetch">;
|
|
55
70
|
flowId: z.ZodMiniString<string>;
|
|
56
71
|
flowHandleId: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
57
72
|
}, z.core.$strict>, z.ZodMiniObject<{
|
|
73
|
+
kind: z.ZodMiniLiteral<"prefetch">;
|
|
74
|
+
flow: z.ZodMiniObject<{
|
|
75
|
+
definition: z.ZodMiniUnknown;
|
|
76
|
+
theme: z.ZodMiniOptional<z.ZodMiniObject<{
|
|
77
|
+
css: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
78
|
+
themeRuntimeArtifactId: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
79
|
+
themeVersionId: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
80
|
+
}, z.core.$strict>>;
|
|
81
|
+
}, z.core.$strict>;
|
|
82
|
+
flowHandleId: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
83
|
+
}, z.core.$strict>]>, z.ZodMiniUnion<readonly [z.ZodMiniObject<{
|
|
58
84
|
kind: z.ZodMiniLiteral<"prerender">;
|
|
59
85
|
flowId: z.ZodMiniString<string>;
|
|
60
86
|
flowHandleId: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
61
87
|
hideCloseButton: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>;
|
|
62
88
|
}, z.core.$strict>, z.ZodMiniObject<{
|
|
89
|
+
kind: z.ZodMiniLiteral<"prerender">;
|
|
90
|
+
flow: z.ZodMiniObject<{
|
|
91
|
+
definition: z.ZodMiniUnknown;
|
|
92
|
+
theme: z.ZodMiniOptional<z.ZodMiniObject<{
|
|
93
|
+
css: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
94
|
+
themeRuntimeArtifactId: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
95
|
+
themeVersionId: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
96
|
+
}, z.core.$strict>>;
|
|
97
|
+
}, z.core.$strict>;
|
|
98
|
+
flowHandleId: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
99
|
+
hideCloseButton: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>;
|
|
100
|
+
}, z.core.$strict>]>, z.ZodMiniObject<{
|
|
63
101
|
kind: z.ZodMiniLiteral<"hostContextUpdated">;
|
|
64
102
|
context: z.ZodMiniObject<{
|
|
65
103
|
url: z.ZodMiniString<string>;
|
|
@@ -346,7 +384,7 @@ export declare const coreCommandEnvelopeSchema: z.ZodMiniObject<{
|
|
|
346
384
|
debug: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>;
|
|
347
385
|
}, z.core.$strip>;
|
|
348
386
|
}, z.core.$strip>;
|
|
349
|
-
}, z.core.$strip>]
|
|
387
|
+
}, z.core.$strip>]>, z.ZodMiniUnion<readonly [z.ZodMiniObject<{
|
|
350
388
|
kind: z.ZodMiniLiteral<"identify">;
|
|
351
389
|
traits: z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniUnknown>;
|
|
352
390
|
options: z.ZodMiniOptional<z.ZodMiniObject<{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"core-command-envelope.d.ts","sourceRoot":"","sources":["../src/core-command-envelope.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,UAAU,CAAC;AAC9B,OAAO,EAAE,KAAK,UAAU,EAAoB,MAAM,kBAAkB,CAAC;AAOrE,sEAAsE;AACtE,eAAO,MAAM,yBAAyB
|
|
1
|
+
{"version":3,"file":"core-command-envelope.d.ts","sourceRoot":"","sources":["../src/core-command-envelope.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,UAAU,CAAC;AAC9B,OAAO,EAAE,KAAK,UAAU,EAAoB,MAAM,kBAAkB,CAAC;AAOrE,sEAAsE;AACtE,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAOpC,CAAC;AAEH,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAE7E,wEAAwE;AACxE,MAAM,MAAM,cAAc,GAAG;IAC5B,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,cAAc,EAAE,MAAM,CAAC;IACvB,UAAU,CAAC,EAAE,UAAU,CAAC;CACxB,CAAC"}
|
package/dist/core-commands.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as z from "zod/mini";
|
|
2
|
-
export declare const coreCommandPayloadSchema: z.ZodMiniUnion<readonly [z.
|
|
2
|
+
export declare const coreCommandPayloadSchema: z.ZodMiniUnion<readonly [z.ZodMiniUnion<readonly [z.ZodMiniUnion<readonly [z.ZodMiniObject<{
|
|
3
3
|
kind: z.ZodMiniLiteral<"open">;
|
|
4
4
|
flowId: z.ZodMiniString<string>;
|
|
5
5
|
flowHandleId: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
@@ -8,15 +8,53 @@ export declare const coreCommandPayloadSchema: z.ZodMiniUnion<readonly [z.ZodMin
|
|
|
8
8
|
}, z.core.$strict>>;
|
|
9
9
|
hideCloseButton: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>;
|
|
10
10
|
}, z.core.$strict>, z.ZodMiniObject<{
|
|
11
|
+
kind: z.ZodMiniLiteral<"open">;
|
|
12
|
+
flow: z.ZodMiniObject<{
|
|
13
|
+
definition: z.ZodMiniUnknown;
|
|
14
|
+
theme: z.ZodMiniOptional<z.ZodMiniObject<{
|
|
15
|
+
css: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
16
|
+
themeRuntimeArtifactId: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
17
|
+
themeVersionId: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
18
|
+
}, z.core.$strict>>;
|
|
19
|
+
}, z.core.$strict>;
|
|
20
|
+
flowHandleId: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
21
|
+
metadata: z.ZodMiniOptional<z.ZodMiniObject<{
|
|
22
|
+
tags: z.ZodMiniOptional<z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>>;
|
|
23
|
+
}, z.core.$strict>>;
|
|
24
|
+
hideCloseButton: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>;
|
|
25
|
+
}, z.core.$strict>]>, z.ZodMiniUnion<readonly [z.ZodMiniObject<{
|
|
11
26
|
kind: z.ZodMiniLiteral<"prefetch">;
|
|
12
27
|
flowId: z.ZodMiniString<string>;
|
|
13
28
|
flowHandleId: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
14
29
|
}, z.core.$strict>, z.ZodMiniObject<{
|
|
30
|
+
kind: z.ZodMiniLiteral<"prefetch">;
|
|
31
|
+
flow: z.ZodMiniObject<{
|
|
32
|
+
definition: z.ZodMiniUnknown;
|
|
33
|
+
theme: z.ZodMiniOptional<z.ZodMiniObject<{
|
|
34
|
+
css: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
35
|
+
themeRuntimeArtifactId: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
36
|
+
themeVersionId: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
37
|
+
}, z.core.$strict>>;
|
|
38
|
+
}, z.core.$strict>;
|
|
39
|
+
flowHandleId: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
40
|
+
}, z.core.$strict>]>, z.ZodMiniUnion<readonly [z.ZodMiniObject<{
|
|
15
41
|
kind: z.ZodMiniLiteral<"prerender">;
|
|
16
42
|
flowId: z.ZodMiniString<string>;
|
|
17
43
|
flowHandleId: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
18
44
|
hideCloseButton: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>;
|
|
19
45
|
}, z.core.$strict>, z.ZodMiniObject<{
|
|
46
|
+
kind: z.ZodMiniLiteral<"prerender">;
|
|
47
|
+
flow: z.ZodMiniObject<{
|
|
48
|
+
definition: z.ZodMiniUnknown;
|
|
49
|
+
theme: z.ZodMiniOptional<z.ZodMiniObject<{
|
|
50
|
+
css: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
51
|
+
themeRuntimeArtifactId: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
52
|
+
themeVersionId: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
53
|
+
}, z.core.$strict>>;
|
|
54
|
+
}, z.core.$strict>;
|
|
55
|
+
flowHandleId: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
56
|
+
hideCloseButton: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>;
|
|
57
|
+
}, z.core.$strict>]>, z.ZodMiniObject<{
|
|
20
58
|
kind: z.ZodMiniLiteral<"hostContextUpdated">;
|
|
21
59
|
context: z.ZodMiniObject<{
|
|
22
60
|
url: z.ZodMiniString<string>;
|
|
@@ -303,7 +341,7 @@ export declare const coreCommandPayloadSchema: z.ZodMiniUnion<readonly [z.ZodMin
|
|
|
303
341
|
debug: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>;
|
|
304
342
|
}, z.core.$strip>;
|
|
305
343
|
}, z.core.$strip>;
|
|
306
|
-
}, z.core.$strip>]
|
|
344
|
+
}, z.core.$strip>]>, z.ZodMiniUnion<readonly [z.ZodMiniObject<{
|
|
307
345
|
kind: z.ZodMiniLiteral<"identify">;
|
|
308
346
|
traits: z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniUnknown>;
|
|
309
347
|
options: z.ZodMiniOptional<z.ZodMiniObject<{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"core-commands.d.ts","sourceRoot":"","sources":["../src/core-commands.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"core-commands.d.ts","sourceRoot":"","sources":["../src/core-commands.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,UAAU,CAAC;AA8M9B,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAInC,CAAC;AAEH,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,wBAAwB,CAAC,CAAC"}
|
package/dist/core-commands.js
CHANGED
|
@@ -41,19 +41,56 @@ const prefetchPayloadSchema = z.strictObject({
|
|
|
41
41
|
flowId: flowIdSchema,
|
|
42
42
|
flowHandleId: z.optional(flowHandleIdSchema),
|
|
43
43
|
});
|
|
44
|
-
const
|
|
44
|
+
const inlineFlowThemeSchema = z.strictObject({
|
|
45
|
+
css: z.optional(z.string()),
|
|
46
|
+
themeRuntimeArtifactId: z.optional(z.string().check(z.trim(), z.minLength(1))),
|
|
47
|
+
themeVersionId: z.optional(z.string().check(z.trim(), z.minLength(1))),
|
|
48
|
+
});
|
|
49
|
+
const inlineFlowSchema = z.strictObject({
|
|
50
|
+
definition: z.unknown().check(z.check((ctx) => {
|
|
51
|
+
if (ctx.value !== undefined) {
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
54
|
+
ctx.issues.push({
|
|
55
|
+
code: "custom",
|
|
56
|
+
input: ctx.value,
|
|
57
|
+
message: "Inline flow definition is required.",
|
|
58
|
+
continue: false,
|
|
59
|
+
});
|
|
60
|
+
})),
|
|
61
|
+
theme: z.optional(inlineFlowThemeSchema),
|
|
62
|
+
});
|
|
63
|
+
const prefetchInlinePayloadSchema = z.strictObject({
|
|
64
|
+
kind: z.literal("prefetch"),
|
|
65
|
+
flow: inlineFlowSchema,
|
|
66
|
+
flowHandleId: z.optional(flowHandleIdSchema),
|
|
67
|
+
});
|
|
68
|
+
const openPersistedCorePayloadSchema = z.strictObject({
|
|
45
69
|
kind: z.literal("open"),
|
|
46
70
|
flowId: flowIdSchema,
|
|
47
71
|
flowHandleId: z.optional(flowHandleIdSchema),
|
|
48
72
|
metadata: z.optional(responseMetadataInputSchema),
|
|
49
73
|
hideCloseButton: z.optional(z.boolean()),
|
|
50
74
|
});
|
|
51
|
-
const
|
|
75
|
+
const openInlineCorePayloadSchema = z.strictObject({
|
|
76
|
+
kind: z.literal("open"),
|
|
77
|
+
flow: inlineFlowSchema,
|
|
78
|
+
flowHandleId: z.optional(flowHandleIdSchema),
|
|
79
|
+
metadata: z.optional(responseMetadataInputSchema),
|
|
80
|
+
hideCloseButton: z.optional(z.boolean()),
|
|
81
|
+
});
|
|
82
|
+
const prerenderPersistedCorePayloadSchema = z.strictObject({
|
|
52
83
|
kind: z.literal("prerender"),
|
|
53
84
|
flowId: flowIdSchema,
|
|
54
85
|
flowHandleId: z.optional(flowHandleIdSchema),
|
|
55
86
|
hideCloseButton: z.optional(z.boolean()),
|
|
56
87
|
});
|
|
88
|
+
const prerenderInlineCorePayloadSchema = z.strictObject({
|
|
89
|
+
kind: z.literal("prerender"),
|
|
90
|
+
flow: inlineFlowSchema,
|
|
91
|
+
flowHandleId: z.optional(flowHandleIdSchema),
|
|
92
|
+
hideCloseButton: z.optional(z.boolean()),
|
|
93
|
+
});
|
|
57
94
|
const closeCorePayloadSchema = z.object({
|
|
58
95
|
kind: z.literal("close"),
|
|
59
96
|
flowHandleId: z.optional(flowHandleIdSchema),
|
|
@@ -108,10 +145,13 @@ const initCorePayloadSchema = z.strictObject({
|
|
|
108
145
|
const resetPayloadSchema = z.object({
|
|
109
146
|
kind: z.literal("reset"),
|
|
110
147
|
});
|
|
111
|
-
const coreCommandPayloadWithoutIdentifySchema = z.
|
|
112
|
-
|
|
113
|
-
prefetchPayloadSchema,
|
|
114
|
-
|
|
148
|
+
const coreCommandPayloadWithoutIdentifySchema = z.union([
|
|
149
|
+
z.union([openPersistedCorePayloadSchema, openInlineCorePayloadSchema]),
|
|
150
|
+
z.union([prefetchPayloadSchema, prefetchInlinePayloadSchema]),
|
|
151
|
+
z.union([
|
|
152
|
+
prerenderPersistedCorePayloadSchema,
|
|
153
|
+
prerenderInlineCorePayloadSchema,
|
|
154
|
+
]),
|
|
115
155
|
hostContextUpdatedPayloadSchema,
|
|
116
156
|
hostSignalPayloadSchema,
|
|
117
157
|
setTargetingPlanPayloadSchema,
|
package/dist/flow-display.d.ts
CHANGED
|
@@ -214,6 +214,21 @@ export declare const flowDisplaySyncResponseSchema: z.ZodMiniObject<{
|
|
|
214
214
|
queue: "queue";
|
|
215
215
|
}>;
|
|
216
216
|
}, z.core.$strict>>;
|
|
217
|
+
attentionPolicyV2: z.ZodMiniOptional<z.ZodMiniObject<{
|
|
218
|
+
recentInAppCooldownMs: z.ZodMiniDefault<z.ZodMiniNumber<number>>;
|
|
219
|
+
version: z.ZodMiniString<string>;
|
|
220
|
+
source: z.ZodMiniEnum<{
|
|
221
|
+
default: "default";
|
|
222
|
+
custom: "custom";
|
|
223
|
+
}>;
|
|
224
|
+
recentFlowCooldownMs: z.ZodMiniNumber<number>;
|
|
225
|
+
exclusiveSurfaceStrategy: z.ZodMiniEnum<{
|
|
226
|
+
queue: "queue";
|
|
227
|
+
}>;
|
|
228
|
+
blockedBroadcastStrategy: z.ZodMiniEnum<{
|
|
229
|
+
queue: "queue";
|
|
230
|
+
}>;
|
|
231
|
+
}, z.core.$strict>>;
|
|
217
232
|
assignments: z.ZodMiniObject<{
|
|
218
233
|
claimed: z.ZodMiniArray<z.ZodMiniObject<{
|
|
219
234
|
flowAssignmentId: z.ZodMiniString<string>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flow-display.d.ts","sourceRoot":"","sources":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ACtC,CAAC;AACF,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,MAAM,CAC3C,OAAO,2BAA2B,CAClC,CAAC;AACF,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,MAAM,CAC5C,OAAO,4BAA4B,CACnC,CAAC;AACF,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,MAAM,CAC7C,OAAO,6BAA6B,CACpC,CAAC;AACF,MAAM,MAAM,gCAAgC,GAAG,qBAAqB,CAAC"}
|
package/dist/flow-display.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as z from "zod/mini";
|
|
2
|
-
import { attentionPolicyConfigSchema, } from "./attention-policy.js";
|
|
2
|
+
import { attentionPolicyConfigSchema, legacyAttentionPolicyConfigSchema, } from "./attention-policy.js";
|
|
3
3
|
import { flowAssignmentIdentitySchema, flowAssignmentRecordSchema, flowAssignmentTargetingContextSchema, } from "./flow-assignments.js";
|
|
4
4
|
export const runtimeDisplayEligibilitySchema = z.object({
|
|
5
5
|
requiredCapabilities: z._default(z.array(z.string().check(z.trim(), z.minLength(1))), []),
|
|
@@ -56,7 +56,8 @@ export const flowDisplaySyncRequestSchema = z.object({
|
|
|
56
56
|
});
|
|
57
57
|
export const flowDisplaySyncResponseSchema = z.object({
|
|
58
58
|
fetchedAt: z.string(),
|
|
59
|
-
attentionPolicy: z.optional(
|
|
59
|
+
attentionPolicy: z.optional(legacyAttentionPolicyConfigSchema),
|
|
60
|
+
attentionPolicyV2: z.optional(attentionPolicyConfigSchema),
|
|
60
61
|
assignments: z.object({
|
|
61
62
|
claimed: z.array(flowAssignmentRecordSchema),
|
|
62
63
|
}),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lazy-handle-client.d.ts","sourceRoot":"","sources":["../../src/host/lazy-handle-client.ts"],"names":[],"mappings":"AAAA,KAAK,UAAU,CAAC,SAAS,SAAS,MAAM,IAAI,CAAC,QAAQ,EAAE,SAAS,KAAK,IAAI,CA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MAAM,EAAE,WAAW,EAC3E,OAAO,EAAE,oCAAoC,CAAC,SAAS,EAAE,WAAW,CAAC,GACnE,gBAAgB,CAAC,SAAS,EAAE,WAAW,EAAE,cAAc,CAAC,CAAC;AAC5D,wBAAgB,sBAAsB,CACrC,SAAS,SAAS,MAAM,EACxB,WAAW,EACX,MAAM,SAAS,MAAM,EAErB,OAAO,EAAE,mCAAmC,CAAC,SAAS,EAAE,WAAW,EAAE,MAAM,CAAC,GAC1E,gBAAgB,CAAC,SAAS,EAAE,WAAW,EAAE,MAAM,CAAC,CAAC"}
|
|
@@ -11,7 +11,7 @@ const DEFAULT_LIFECYCLE_STAGES = {
|
|
|
11
11
|
const createLazyHandleClientWithStages = (input) => {
|
|
12
12
|
let handleId;
|
|
13
13
|
let tail = Promise.resolve();
|
|
14
|
-
let
|
|
14
|
+
let queuedCommandCount = 0;
|
|
15
15
|
let epoch = 0;
|
|
16
16
|
const { stages } = input;
|
|
17
17
|
let stage = input.initialStage ?? stages.uninitialized;
|
|
@@ -53,12 +53,12 @@ const createLazyHandleClientWithStages = (input) => {
|
|
|
53
53
|
}
|
|
54
54
|
return settlement;
|
|
55
55
|
};
|
|
56
|
-
const run =
|
|
57
|
-
|
|
56
|
+
const run = queuedCommandCount === 0 ? execute() : tail.then(execute, execute);
|
|
57
|
+
queuedCommandCount += 1;
|
|
58
58
|
tail = run.then(() => {
|
|
59
|
-
|
|
59
|
+
queuedCommandCount -= 1;
|
|
60
60
|
}, () => {
|
|
61
|
-
|
|
61
|
+
queuedCommandCount -= 1;
|
|
62
62
|
});
|
|
63
63
|
return run;
|
|
64
64
|
};
|
package/dist/index.d.ts
CHANGED
|
@@ -9,6 +9,7 @@ export { ErrorCategory, ErrorCategorySchema, ErrorEventSchema, ProtocolError, }
|
|
|
9
9
|
export { type ClaimPendingFlowAssignmentsRequest, type ClaimPendingFlowAssignmentsResponse, claimPendingFlowAssignmentsRequestSchema, claimPendingFlowAssignmentsResponseSchema, type FlowAssignmentExternalIdIdentityTypeValue, type FlowAssignmentIdentityTypeValue, type FlowAssignmentRecipientRequest, type FlowAssignmentRecord, type FlowAssignmentStatus, type FlowAssignmentTargetingContext, flowAssignmentRecipientRequestSchema, flowAssignmentRecordSchema, flowAssignmentStatusSchema, flowAssignmentTargetingContextSchema, type ListPendingFlowAssignmentsResponse, listPendingFlowAssignmentsResponseSchema, nullableUpdateFlowAssignmentLifecycleResponseSchema, type ReleaseFlowAssignmentClaimRequest, type ReleaseFlowAssignmentClaimResponse, releaseFlowAssignmentClaimRequestSchema, releaseFlowAssignmentClaimResponseSchema, type UpdateFlowAssignmentLifecycleRequest, type UpdateFlowAssignmentLifecycleResponse, updateFlowAssignmentLifecycleRequestSchema, updateFlowAssignmentLifecycleResponseSchema, } from "./flow-assignments.js";
|
|
10
10
|
export { type FlowDisplaySyncRequest, type FlowDisplaySyncResponse, flowDisplaySyncRequestSchema, flowDisplaySyncResponseSchema, type RuntimeDisplayAttentionPolicy, type RuntimeDisplayBroadcastOpportunity, type RuntimeDisplayBroadcasts, type RuntimeDisplayEligibility, type RuntimeDisplayTrigger, runtimeDisplayAttentionPolicySchema, runtimeDisplayBroadcastOpportunitySchema, runtimeDisplayBroadcastsSchema, runtimeDisplayEligibilitySchema, runtimeDisplayTriggerSchema, } from "./flow-display.js";
|
|
11
11
|
export { buildIdentityTypeGuidanceMessage, getIdentityTypeSuggestion, IDENTITY_TYPE_VALUES, type IdentityTypeValue, isIdentityTypeValue, type StandardIdentityTypeValue, } from "./identity-type.js";
|
|
12
|
+
export { type CaptureInstanceFeedbackRequest, type CaptureInstanceFeedbackResponse, captureInstanceFeedbackRequestSchema, captureInstanceFeedbackResponseSchema, type InstanceFeedbackDataType, type InstanceFeedbackValence, instanceFeedbackDataTypeSchema, instanceFeedbackValenceSchema, } from "./instance-feedback.js";
|
|
12
13
|
export { type PreviewConnectionPairRequest, type PreviewConnectionPairResponse, previewConnectionPairRequestSchema, previewConnectionPairResponseSchema, } from "./preview-connection.js";
|
|
13
14
|
export { PREVIEW_PAIRING_TRANSPORT_SOURCE, type PreviewPairingHostAck, type PreviewPairingHostRequest, type PreviewPairingHostResult, previewPairingHostAckSchema, previewPairingHostRequestSchema, previewPairingHostResultSchema, } from "./preview-pairing-transport.js";
|
|
14
15
|
export { isPublicGrantScope, type PublicGrantScope, publicGrantScopeIdSchema, } from "./public-grant-scope.js";
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,KAAK,kBAAkB,EACvB,KAAK,kBAAkB,EACvB,KAAK,YAAY,EACjB,KAAK,iBAAiB,EACtB,KAAK,eAAe,EACpB,KAAK,kBAAkB,EACvB,kBAAkB,EAClB,wBAAwB,EACxB,qBAAqB,EACrB,2BAA2B,EAC3B,wBAAwB,EACxB,0BAA0B,EAC1B,kBAAkB,EAClB,2BAA2B,EAC3B,sBAAsB,EACtB,0BAA0B,EAC1B,qBAAqB,EACrB,0BAA0B,EAC1B,wBAAwB,EACxB,yBAAyB,EACzB,mBAAmB,EACnB,2BAA2B,GAC3B,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACN,KAAK,qBAAqB,EAC1B,uCAAuC,EACvC,uCAAuC,EACvC,2BAA2B,EAC3B,2BAA2B,EAC3B,+BAA+B,GAC/B,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACN,KAAK,UAAU,EACf,gBAAgB,GAChB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACN,KAAK,cAAc,EACnB,KAAK,mBAAmB,EACxB,yBAAyB,GACzB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EACN,KAAK,kBAAkB,EACvB,wBAAwB,GACxB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,sCAAsC,EAAE,MAAM,eAAe,CAAC;AACvE,YAAY,EAAE,UAAU,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AACjE,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,EACvB,KAAK,uBAAuB,EAC5B,6BAA6B,EAC7B,4BAA4B,EAC5B,sBAAsB,EACtB,wBAAwB,EACxB,wBAAwB,EACxB,KAAK,gBAAgB,EACrB,gBAAgB,EAChB,KAAK,gBAAgB,EACrB,sBAAsB,EACtB,KAAK,2BAA2B,EAChC,iCAAiC,EACjC,KAAK,mBAAmB,EACxB,2BAA2B,EAC3B,KAAK,WAAW,EAChB,KAAK,wBAAwB,EAC7B,yBAAyB,EACzB,iBAAiB,EACjB,8BAA8B,EAC9B,KAAK,oBAAoB,EACzB,0BAA0B,GAC1B,MAAM,oBAAoB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -8,6 +8,7 @@ export { ErrorCategory, ErrorCategorySchema, ErrorEventSchema, ProtocolError, }
|
|
|
8
8
|
export { claimPendingFlowAssignmentsRequestSchema, claimPendingFlowAssignmentsResponseSchema, flowAssignmentRecipientRequestSchema, flowAssignmentRecordSchema, flowAssignmentStatusSchema, flowAssignmentTargetingContextSchema, listPendingFlowAssignmentsResponseSchema, nullableUpdateFlowAssignmentLifecycleResponseSchema, releaseFlowAssignmentClaimRequestSchema, releaseFlowAssignmentClaimResponseSchema, updateFlowAssignmentLifecycleRequestSchema, updateFlowAssignmentLifecycleResponseSchema, } from "./flow-assignments.js";
|
|
9
9
|
export { flowDisplaySyncRequestSchema, flowDisplaySyncResponseSchema, runtimeDisplayAttentionPolicySchema, runtimeDisplayBroadcastOpportunitySchema, runtimeDisplayBroadcastsSchema, runtimeDisplayEligibilitySchema, runtimeDisplayTriggerSchema, } from "./flow-display.js";
|
|
10
10
|
export { buildIdentityTypeGuidanceMessage, getIdentityTypeSuggestion, IDENTITY_TYPE_VALUES, isIdentityTypeValue, } from "./identity-type.js";
|
|
11
|
+
export { captureInstanceFeedbackRequestSchema, captureInstanceFeedbackResponseSchema, instanceFeedbackDataTypeSchema, instanceFeedbackValenceSchema, } from "./instance-feedback.js";
|
|
11
12
|
export { previewConnectionPairRequestSchema, previewConnectionPairResponseSchema, } from "./preview-connection.js";
|
|
12
13
|
export { PREVIEW_PAIRING_TRANSPORT_SOURCE, previewPairingHostAckSchema, previewPairingHostRequestSchema, previewPairingHostResultSchema, } from "./preview-pairing-transport.js";
|
|
13
14
|
export { isPublicGrantScope, publicGrantScopeIdSchema, } from "./public-grant-scope.js";
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import * as z from "zod/mini";
|
|
2
|
+
export declare const instanceFeedbackDataTypeSchema: z.ZodMiniEnum<{
|
|
3
|
+
boolean: "boolean";
|
|
4
|
+
categorical: "categorical";
|
|
5
|
+
numeric: "numeric";
|
|
6
|
+
}>;
|
|
7
|
+
export declare const instanceFeedbackValenceSchema: z.ZodMiniEnum<{
|
|
8
|
+
positive: "positive";
|
|
9
|
+
negative: "negative";
|
|
10
|
+
neutral: "neutral";
|
|
11
|
+
}>;
|
|
12
|
+
export declare const captureInstanceFeedbackRequestSchema: z.ZodMiniObject<{
|
|
13
|
+
targetBindingToken: z.ZodMiniString<string>;
|
|
14
|
+
capturedAt: z.ZodMiniString<string>;
|
|
15
|
+
comment: z.ZodMiniOptional<z.ZodMiniNullable<z.ZodMiniString<string>>>;
|
|
16
|
+
dataType: z.ZodMiniEnum<{
|
|
17
|
+
boolean: "boolean";
|
|
18
|
+
categorical: "categorical";
|
|
19
|
+
numeric: "numeric";
|
|
20
|
+
}>;
|
|
21
|
+
label: z.ZodMiniOptional<z.ZodMiniNullable<z.ZodMiniString<string>>>;
|
|
22
|
+
name: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
23
|
+
reasonCategories: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
|
|
24
|
+
scoreValue: z.ZodMiniOptional<z.ZodMiniNullable<z.ZodMiniNumber<number>>>;
|
|
25
|
+
valence: z.ZodMiniEnum<{
|
|
26
|
+
positive: "positive";
|
|
27
|
+
negative: "negative";
|
|
28
|
+
neutral: "neutral";
|
|
29
|
+
}>;
|
|
30
|
+
}, z.core.$strip>;
|
|
31
|
+
export declare const captureInstanceFeedbackResponseSchema: z.ZodMiniObject<{
|
|
32
|
+
capturedAt: z.ZodMiniString<string>;
|
|
33
|
+
evaluationId: z.ZodMiniString<string>;
|
|
34
|
+
status: z.ZodMiniLiteral<"accepted">;
|
|
35
|
+
}, z.core.$strip>;
|
|
36
|
+
export type InstanceFeedbackDataType = z.output<typeof instanceFeedbackDataTypeSchema>;
|
|
37
|
+
export type InstanceFeedbackValence = z.output<typeof instanceFeedbackValenceSchema>;
|
|
38
|
+
export type CaptureInstanceFeedbackRequest = z.output<typeof captureInstanceFeedbackRequestSchema>;
|
|
39
|
+
export type CaptureInstanceFeedbackResponse = z.output<typeof captureInstanceFeedbackResponseSchema>;
|
|
40
|
+
//# sourceMappingURL=instance-feedback.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"instance-feedback.d.ts","sourceRoot":"","sources":["../src/instance-feedback.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,UAAU,CAAC;AAyB9B,eAAO,MAAM,8BAA8B;;;;EAIzC,CAAC;AAEH,eAAO,MAAM,6BAA6B;;;;EAIxC,CAAC;AAEH,eAAO,MAAM,oCAAoC;;;;;;;;;;;;;;;;;;iBA0B/C,CAAC;AAEH,eAAO,MAAM,qCAAqC;;;;iBAIhD,CAAC;AAEH,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,MAAM,CAC9C,OAAO,8BAA8B,CACrC,CAAC;AACF,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,MAAM,CAC7C,OAAO,6BAA6B,CACpC,CAAC;AACF,MAAM,MAAM,8BAA8B,GAAG,CAAC,CAAC,MAAM,CACpD,OAAO,oCAAoC,CAC3C,CAAC;AACF,MAAM,MAAM,+BAA+B,GAAG,CAAC,CAAC,MAAM,CACrD,OAAO,qCAAqC,CAC5C,CAAC"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import * as z from "zod/mini";
|
|
2
|
+
const maxCaptureRequestCommentLength = 64 * 1024;
|
|
3
|
+
const maxReasonCategoryCount = 20;
|
|
4
|
+
const maxTargetBindingTokenLength = 4096;
|
|
5
|
+
const canonicalUtcTimestampLength = "2026-07-01T12:00:00.000Z".length;
|
|
6
|
+
const canonicalUtcTimestampPattern = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}Z$/u;
|
|
7
|
+
const isCanonicalUtcTimestamp = (value) => {
|
|
8
|
+
if (value.length !== canonicalUtcTimestampLength ||
|
|
9
|
+
!canonicalUtcTimestampPattern.test(value)) {
|
|
10
|
+
return false;
|
|
11
|
+
}
|
|
12
|
+
const date = new Date(value);
|
|
13
|
+
return !Number.isNaN(date.getTime()) && date.toISOString() === value;
|
|
14
|
+
};
|
|
15
|
+
const finiteNumberSchema = z.number().check(z.refine(Number.isFinite, {
|
|
16
|
+
message: "Expected a finite number.",
|
|
17
|
+
}));
|
|
18
|
+
export const instanceFeedbackDataTypeSchema = z.enum([
|
|
19
|
+
"boolean",
|
|
20
|
+
"categorical",
|
|
21
|
+
"numeric",
|
|
22
|
+
]);
|
|
23
|
+
export const instanceFeedbackValenceSchema = z.enum([
|
|
24
|
+
"positive",
|
|
25
|
+
"negative",
|
|
26
|
+
"neutral",
|
|
27
|
+
]);
|
|
28
|
+
export const captureInstanceFeedbackRequestSchema = z.object({
|
|
29
|
+
targetBindingToken: z
|
|
30
|
+
.string()
|
|
31
|
+
.check(z.trim(), z.minLength(1), z.maxLength(maxTargetBindingTokenLength)),
|
|
32
|
+
capturedAt: z.string().check(z.trim(), z.minLength(1), z.refine(isCanonicalUtcTimestamp, {
|
|
33
|
+
message: "capturedAt must be a canonical UTC timestamp.",
|
|
34
|
+
})),
|
|
35
|
+
comment: z.optional(z.nullable(z.string().check(z.maxLength(maxCaptureRequestCommentLength)))),
|
|
36
|
+
dataType: instanceFeedbackDataTypeSchema,
|
|
37
|
+
label: z.optional(z.nullable(z.string().check(z.maxLength(255)))),
|
|
38
|
+
name: z.optional(z.string().check(z.trim(), z.minLength(1), z.maxLength(255))),
|
|
39
|
+
reasonCategories: z.optional(z
|
|
40
|
+
.array(z.string().check(z.trim(), z.minLength(1), z.maxLength(128)))
|
|
41
|
+
.check(z.maxLength(maxReasonCategoryCount))),
|
|
42
|
+
scoreValue: z.optional(z.nullable(finiteNumberSchema)),
|
|
43
|
+
valence: instanceFeedbackValenceSchema,
|
|
44
|
+
});
|
|
45
|
+
export const captureInstanceFeedbackResponseSchema = z.object({
|
|
46
|
+
capturedAt: z.string(),
|
|
47
|
+
evaluationId: z.string().check(z.trim(), z.minLength(1)),
|
|
48
|
+
status: z.literal("accepted"),
|
|
49
|
+
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@getuserfeedback/protocol",
|
|
3
|
-
"version": "3.0
|
|
3
|
+
"version": "3.1.0",
|
|
4
4
|
"description": "getuserfeedback widget protocol — host surface and (later) wire protocol",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"getuserfeedback",
|
|
@@ -124,6 +124,12 @@
|
|
|
124
124
|
"import": "./dist/flow-display.js",
|
|
125
125
|
"default": "./dist/flow-display.js"
|
|
126
126
|
},
|
|
127
|
+
"./instance-feedback": {
|
|
128
|
+
"types": "./dist/instance-feedback.d.ts",
|
|
129
|
+
"bun": "./src/instance-feedback.ts",
|
|
130
|
+
"import": "./dist/instance-feedback.js",
|
|
131
|
+
"default": "./dist/instance-feedback.js"
|
|
132
|
+
},
|
|
127
133
|
"./trpc-envelope": {
|
|
128
134
|
"types": "./dist/trpc-envelope.d.ts",
|
|
129
135
|
"bun": "./src/trpc-envelope.ts",
|
package/src/attention-policy.ts
CHANGED
|
@@ -6,12 +6,21 @@ export const attentionExclusiveSurfaceStrategySchema = z.enum(["queue"]);
|
|
|
6
6
|
|
|
7
7
|
export const attentionBlockedBroadcastStrategySchema = z.enum(["queue"]);
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
const legacyAttentionPolicyConfigFields = {
|
|
10
10
|
version: z.string().check(z.trim(), z.minLength(1)),
|
|
11
11
|
source: attentionPolicySourceSchema,
|
|
12
12
|
recentFlowCooldownMs: z.number().check(z.positive()),
|
|
13
13
|
exclusiveSurfaceStrategy: attentionExclusiveSurfaceStrategySchema,
|
|
14
14
|
blockedBroadcastStrategy: attentionBlockedBroadcastStrategySchema,
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
export const legacyAttentionPolicyConfigSchema = z.strictObject(
|
|
18
|
+
legacyAttentionPolicyConfigFields,
|
|
19
|
+
);
|
|
20
|
+
|
|
21
|
+
export const attentionPolicyConfigSchema = z.strictObject({
|
|
22
|
+
...legacyAttentionPolicyConfigFields,
|
|
23
|
+
recentInAppCooldownMs: z._default(z.number().check(z.nonnegative()), 0),
|
|
15
24
|
});
|
|
16
25
|
|
|
17
26
|
export type AttentionPolicyConfig = z.output<
|
|
@@ -22,6 +31,7 @@ export const DEFAULT_ATTENTION_POLICY_CONFIG: AttentionPolicyConfig = {
|
|
|
22
31
|
version: "attention-policy-default-v1",
|
|
23
32
|
source: "default",
|
|
24
33
|
recentFlowCooldownMs: 5 * 60 * 1000,
|
|
34
|
+
recentInAppCooldownMs: 0,
|
|
25
35
|
exclusiveSurfaceStrategy: "queue",
|
|
26
36
|
blockedBroadcastStrategy: "queue",
|
|
27
37
|
};
|
package/src/core-commands.ts
CHANGED
|
@@ -58,7 +58,38 @@ const prefetchPayloadSchema = z.strictObject({
|
|
|
58
58
|
flowHandleId: z.optional(flowHandleIdSchema),
|
|
59
59
|
});
|
|
60
60
|
|
|
61
|
-
const
|
|
61
|
+
const inlineFlowThemeSchema = z.strictObject({
|
|
62
|
+
css: z.optional(z.string()),
|
|
63
|
+
themeRuntimeArtifactId: z.optional(
|
|
64
|
+
z.string().check(z.trim(), z.minLength(1)),
|
|
65
|
+
),
|
|
66
|
+
themeVersionId: z.optional(z.string().check(z.trim(), z.minLength(1))),
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
const inlineFlowSchema = z.strictObject({
|
|
70
|
+
definition: z.unknown().check(
|
|
71
|
+
z.check((ctx) => {
|
|
72
|
+
if (ctx.value !== undefined) {
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
ctx.issues.push({
|
|
76
|
+
code: "custom",
|
|
77
|
+
input: ctx.value,
|
|
78
|
+
message: "Inline flow definition is required.",
|
|
79
|
+
continue: false,
|
|
80
|
+
});
|
|
81
|
+
}),
|
|
82
|
+
),
|
|
83
|
+
theme: z.optional(inlineFlowThemeSchema),
|
|
84
|
+
});
|
|
85
|
+
|
|
86
|
+
const prefetchInlinePayloadSchema = z.strictObject({
|
|
87
|
+
kind: z.literal("prefetch"),
|
|
88
|
+
flow: inlineFlowSchema,
|
|
89
|
+
flowHandleId: z.optional(flowHandleIdSchema),
|
|
90
|
+
});
|
|
91
|
+
|
|
92
|
+
const openPersistedCorePayloadSchema = z.strictObject({
|
|
62
93
|
kind: z.literal("open"),
|
|
63
94
|
flowId: flowIdSchema,
|
|
64
95
|
flowHandleId: z.optional(flowHandleIdSchema),
|
|
@@ -66,13 +97,28 @@ const openCorePayloadSchema = z.strictObject({
|
|
|
66
97
|
hideCloseButton: z.optional(z.boolean()),
|
|
67
98
|
});
|
|
68
99
|
|
|
69
|
-
const
|
|
100
|
+
const openInlineCorePayloadSchema = z.strictObject({
|
|
101
|
+
kind: z.literal("open"),
|
|
102
|
+
flow: inlineFlowSchema,
|
|
103
|
+
flowHandleId: z.optional(flowHandleIdSchema),
|
|
104
|
+
metadata: z.optional(responseMetadataInputSchema),
|
|
105
|
+
hideCloseButton: z.optional(z.boolean()),
|
|
106
|
+
});
|
|
107
|
+
|
|
108
|
+
const prerenderPersistedCorePayloadSchema = z.strictObject({
|
|
70
109
|
kind: z.literal("prerender"),
|
|
71
110
|
flowId: flowIdSchema,
|
|
72
111
|
flowHandleId: z.optional(flowHandleIdSchema),
|
|
73
112
|
hideCloseButton: z.optional(z.boolean()),
|
|
74
113
|
});
|
|
75
114
|
|
|
115
|
+
const prerenderInlineCorePayloadSchema = z.strictObject({
|
|
116
|
+
kind: z.literal("prerender"),
|
|
117
|
+
flow: inlineFlowSchema,
|
|
118
|
+
flowHandleId: z.optional(flowHandleIdSchema),
|
|
119
|
+
hideCloseButton: z.optional(z.boolean()),
|
|
120
|
+
});
|
|
121
|
+
|
|
76
122
|
const closeCorePayloadSchema = z.object({
|
|
77
123
|
kind: z.literal("close"),
|
|
78
124
|
flowHandleId: z.optional(flowHandleIdSchema),
|
|
@@ -140,10 +186,13 @@ const resetPayloadSchema = z.object({
|
|
|
140
186
|
kind: z.literal("reset"),
|
|
141
187
|
});
|
|
142
188
|
|
|
143
|
-
const coreCommandPayloadWithoutIdentifySchema = z.
|
|
144
|
-
|
|
145
|
-
prefetchPayloadSchema,
|
|
146
|
-
|
|
189
|
+
const coreCommandPayloadWithoutIdentifySchema = z.union([
|
|
190
|
+
z.union([openPersistedCorePayloadSchema, openInlineCorePayloadSchema]),
|
|
191
|
+
z.union([prefetchPayloadSchema, prefetchInlinePayloadSchema]),
|
|
192
|
+
z.union([
|
|
193
|
+
prerenderPersistedCorePayloadSchema,
|
|
194
|
+
prerenderInlineCorePayloadSchema,
|
|
195
|
+
]),
|
|
147
196
|
hostContextUpdatedPayloadSchema,
|
|
148
197
|
hostSignalPayloadSchema,
|
|
149
198
|
setTargetingPlanPayloadSchema,
|
package/src/flow-display.test.ts
CHANGED
|
@@ -55,6 +55,73 @@ describe("flow display sync contracts", () => {
|
|
|
55
55
|
expect(result.attentionPolicy).toBeUndefined();
|
|
56
56
|
});
|
|
57
57
|
|
|
58
|
+
it("keeps the legacy attention policy response shape backward compatible", () => {
|
|
59
|
+
const result = flowDisplaySyncResponseSchema.parse({
|
|
60
|
+
fetchedAt: "2026-06-18T00:00:00.000Z",
|
|
61
|
+
attentionPolicy: {
|
|
62
|
+
version: "attention-policy-organization-override-v1",
|
|
63
|
+
source: "custom",
|
|
64
|
+
recentFlowCooldownMs: 45_000,
|
|
65
|
+
exclusiveSurfaceStrategy: "queue",
|
|
66
|
+
blockedBroadcastStrategy: "queue",
|
|
67
|
+
},
|
|
68
|
+
attentionPolicyV2: {
|
|
69
|
+
version: "attention-policy-organization-override-v1",
|
|
70
|
+
source: "custom",
|
|
71
|
+
recentFlowCooldownMs: 45_000,
|
|
72
|
+
recentInAppCooldownMs: 60_000,
|
|
73
|
+
exclusiveSurfaceStrategy: "queue",
|
|
74
|
+
blockedBroadcastStrategy: "queue",
|
|
75
|
+
},
|
|
76
|
+
assignments: {
|
|
77
|
+
claimed: [],
|
|
78
|
+
},
|
|
79
|
+
broadcasts: {
|
|
80
|
+
version: "empty",
|
|
81
|
+
opportunities: [],
|
|
82
|
+
},
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
expect(result.attentionPolicy).toEqual({
|
|
86
|
+
version: "attention-policy-organization-override-v1",
|
|
87
|
+
source: "custom",
|
|
88
|
+
recentFlowCooldownMs: 45_000,
|
|
89
|
+
exclusiveSurfaceStrategy: "queue",
|
|
90
|
+
blockedBroadcastStrategy: "queue",
|
|
91
|
+
});
|
|
92
|
+
expect(result.attentionPolicyV2).toEqual({
|
|
93
|
+
version: "attention-policy-organization-override-v1",
|
|
94
|
+
source: "custom",
|
|
95
|
+
recentFlowCooldownMs: 45_000,
|
|
96
|
+
recentInAppCooldownMs: 60_000,
|
|
97
|
+
exclusiveSurfaceStrategy: "queue",
|
|
98
|
+
blockedBroadcastStrategy: "queue",
|
|
99
|
+
});
|
|
100
|
+
});
|
|
101
|
+
|
|
102
|
+
it("rejects new attention policy fields on the legacy response field", () => {
|
|
103
|
+
expect(() =>
|
|
104
|
+
flowDisplaySyncResponseSchema.parse({
|
|
105
|
+
fetchedAt: "2026-06-18T00:00:00.000Z",
|
|
106
|
+
attentionPolicy: {
|
|
107
|
+
version: "attention-policy-organization-override-v1",
|
|
108
|
+
source: "custom",
|
|
109
|
+
recentFlowCooldownMs: 45_000,
|
|
110
|
+
recentInAppCooldownMs: 60_000,
|
|
111
|
+
exclusiveSurfaceStrategy: "queue",
|
|
112
|
+
blockedBroadcastStrategy: "queue",
|
|
113
|
+
},
|
|
114
|
+
assignments: {
|
|
115
|
+
claimed: [],
|
|
116
|
+
},
|
|
117
|
+
broadcasts: {
|
|
118
|
+
version: "empty",
|
|
119
|
+
opportunities: [],
|
|
120
|
+
},
|
|
121
|
+
}),
|
|
122
|
+
).toThrow();
|
|
123
|
+
});
|
|
124
|
+
|
|
58
125
|
it("accepts runtime broadcast opportunities", () => {
|
|
59
126
|
const result = flowDisplaySyncResponseSchema.parse({
|
|
60
127
|
fetchedAt: "2026-06-18T00:00:00.000Z",
|
package/src/flow-display.ts
CHANGED
|
@@ -3,6 +3,7 @@ import * as z from "zod/mini";
|
|
|
3
3
|
import {
|
|
4
4
|
type AttentionPolicyConfig,
|
|
5
5
|
attentionPolicyConfigSchema,
|
|
6
|
+
legacyAttentionPolicyConfigSchema,
|
|
6
7
|
} from "./attention-policy.js";
|
|
7
8
|
import {
|
|
8
9
|
flowAssignmentIdentitySchema,
|
|
@@ -86,7 +87,8 @@ export const flowDisplaySyncRequestSchema = z.object({
|
|
|
86
87
|
|
|
87
88
|
export const flowDisplaySyncResponseSchema = z.object({
|
|
88
89
|
fetchedAt: z.string(),
|
|
89
|
-
attentionPolicy: z.optional(
|
|
90
|
+
attentionPolicy: z.optional(legacyAttentionPolicyConfigSchema),
|
|
91
|
+
attentionPolicyV2: z.optional(attentionPolicyConfigSchema),
|
|
90
92
|
assignments: z.object({
|
|
91
93
|
claimed: z.array(flowAssignmentRecordSchema),
|
|
92
94
|
}),
|
|
@@ -77,7 +77,7 @@ const createLazyHandleClientWithStages = <
|
|
|
77
77
|
}): LazyHandleClient<THandleId, TSettlement, TStage> => {
|
|
78
78
|
let handleId: THandleId | undefined;
|
|
79
79
|
let tail = Promise.resolve();
|
|
80
|
-
let
|
|
80
|
+
let queuedCommandCount = 0;
|
|
81
81
|
let epoch = 0;
|
|
82
82
|
const { stages } = input;
|
|
83
83
|
let stage = input.initialStage ?? stages.uninitialized;
|
|
@@ -127,14 +127,15 @@ const createLazyHandleClientWithStages = <
|
|
|
127
127
|
return settlement;
|
|
128
128
|
};
|
|
129
129
|
|
|
130
|
-
const run =
|
|
131
|
-
|
|
130
|
+
const run =
|
|
131
|
+
queuedCommandCount === 0 ? execute() : tail.then(execute, execute);
|
|
132
|
+
queuedCommandCount += 1;
|
|
132
133
|
tail = run.then(
|
|
133
134
|
() => {
|
|
134
|
-
|
|
135
|
+
queuedCommandCount -= 1;
|
|
135
136
|
},
|
|
136
137
|
() => {
|
|
137
|
-
|
|
138
|
+
queuedCommandCount -= 1;
|
|
138
139
|
},
|
|
139
140
|
);
|
|
140
141
|
return run;
|
package/src/index.ts
CHANGED
|
@@ -102,6 +102,16 @@ export {
|
|
|
102
102
|
isIdentityTypeValue,
|
|
103
103
|
type StandardIdentityTypeValue,
|
|
104
104
|
} from "./identity-type.js";
|
|
105
|
+
export {
|
|
106
|
+
type CaptureInstanceFeedbackRequest,
|
|
107
|
+
type CaptureInstanceFeedbackResponse,
|
|
108
|
+
captureInstanceFeedbackRequestSchema,
|
|
109
|
+
captureInstanceFeedbackResponseSchema,
|
|
110
|
+
type InstanceFeedbackDataType,
|
|
111
|
+
type InstanceFeedbackValence,
|
|
112
|
+
instanceFeedbackDataTypeSchema,
|
|
113
|
+
instanceFeedbackValenceSchema,
|
|
114
|
+
} from "./instance-feedback.js";
|
|
105
115
|
export {
|
|
106
116
|
type PreviewConnectionPairRequest,
|
|
107
117
|
type PreviewConnectionPairResponse,
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { describe, expect, it } from "bun:test";
|
|
2
|
+
|
|
3
|
+
import { captureInstanceFeedbackRequestSchema } from "./instance-feedback";
|
|
4
|
+
|
|
5
|
+
const validCaptureRequest = {
|
|
6
|
+
capturedAt: "2026-07-01T12:00:00.000Z",
|
|
7
|
+
dataType: "boolean",
|
|
8
|
+
scoreValue: 1,
|
|
9
|
+
targetBindingToken: "binding-token",
|
|
10
|
+
valence: "positive",
|
|
11
|
+
} as const;
|
|
12
|
+
|
|
13
|
+
describe("captureInstanceFeedbackRequestSchema", () => {
|
|
14
|
+
it("accepts canonical millisecond UTC capture timestamps", () => {
|
|
15
|
+
expect(
|
|
16
|
+
captureInstanceFeedbackRequestSchema.safeParse(validCaptureRequest)
|
|
17
|
+
.success,
|
|
18
|
+
).toBe(true);
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
it("rejects non-canonical capture timestamps", () => {
|
|
22
|
+
expect(
|
|
23
|
+
captureInstanceFeedbackRequestSchema.safeParse({
|
|
24
|
+
...validCaptureRequest,
|
|
25
|
+
capturedAt: "2026-07-01T12:00:00Z",
|
|
26
|
+
}).success,
|
|
27
|
+
).toBe(false);
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
it("rejects impossible capture timestamps", () => {
|
|
31
|
+
expect(
|
|
32
|
+
captureInstanceFeedbackRequestSchema.safeParse({
|
|
33
|
+
...validCaptureRequest,
|
|
34
|
+
capturedAt: "2026-02-31T00:00:00.000Z",
|
|
35
|
+
}).success,
|
|
36
|
+
).toBe(false);
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
it("rejects oversized capture timestamps", () => {
|
|
40
|
+
expect(
|
|
41
|
+
captureInstanceFeedbackRequestSchema.safeParse({
|
|
42
|
+
...validCaptureRequest,
|
|
43
|
+
capturedAt: `${"2".repeat(4096)}Z`,
|
|
44
|
+
}).success,
|
|
45
|
+
).toBe(false);
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
it("caps target binding tokens before verification", () => {
|
|
49
|
+
expect(
|
|
50
|
+
captureInstanceFeedbackRequestSchema.safeParse({
|
|
51
|
+
...validCaptureRequest,
|
|
52
|
+
targetBindingToken: "x".repeat(4097),
|
|
53
|
+
}).success,
|
|
54
|
+
).toBe(false);
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
it("caps reason categories at the capture boundary limit", () => {
|
|
58
|
+
expect(
|
|
59
|
+
captureInstanceFeedbackRequestSchema.safeParse({
|
|
60
|
+
...validCaptureRequest,
|
|
61
|
+
reasonCategories: Array.from(
|
|
62
|
+
{ length: 21 },
|
|
63
|
+
(_, index) => `reason-${index}`,
|
|
64
|
+
),
|
|
65
|
+
}).success,
|
|
66
|
+
).toBe(false);
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
it("caps comments at the public capture body budget", () => {
|
|
70
|
+
expect(
|
|
71
|
+
captureInstanceFeedbackRequestSchema.safeParse({
|
|
72
|
+
...validCaptureRequest,
|
|
73
|
+
comment: "x".repeat(64 * 1024 + 1),
|
|
74
|
+
}).success,
|
|
75
|
+
).toBe(false);
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
it("rejects non-finite score values", () => {
|
|
79
|
+
expect(
|
|
80
|
+
captureInstanceFeedbackRequestSchema.safeParse({
|
|
81
|
+
...validCaptureRequest,
|
|
82
|
+
scoreValue: Number.POSITIVE_INFINITY,
|
|
83
|
+
}).success,
|
|
84
|
+
).toBe(false);
|
|
85
|
+
});
|
|
86
|
+
});
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import * as z from "zod/mini";
|
|
2
|
+
|
|
3
|
+
const maxCaptureRequestCommentLength = 64 * 1024;
|
|
4
|
+
const maxReasonCategoryCount = 20;
|
|
5
|
+
const maxTargetBindingTokenLength = 4096;
|
|
6
|
+
const canonicalUtcTimestampLength = "2026-07-01T12:00:00.000Z".length;
|
|
7
|
+
const canonicalUtcTimestampPattern =
|
|
8
|
+
/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}Z$/u;
|
|
9
|
+
const isCanonicalUtcTimestamp = (value: string) => {
|
|
10
|
+
if (
|
|
11
|
+
value.length !== canonicalUtcTimestampLength ||
|
|
12
|
+
!canonicalUtcTimestampPattern.test(value)
|
|
13
|
+
) {
|
|
14
|
+
return false;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
const date = new Date(value);
|
|
18
|
+
return !Number.isNaN(date.getTime()) && date.toISOString() === value;
|
|
19
|
+
};
|
|
20
|
+
const finiteNumberSchema = z.number().check(
|
|
21
|
+
z.refine(Number.isFinite, {
|
|
22
|
+
message: "Expected a finite number.",
|
|
23
|
+
}),
|
|
24
|
+
);
|
|
25
|
+
|
|
26
|
+
export const instanceFeedbackDataTypeSchema = z.enum([
|
|
27
|
+
"boolean",
|
|
28
|
+
"categorical",
|
|
29
|
+
"numeric",
|
|
30
|
+
]);
|
|
31
|
+
|
|
32
|
+
export const instanceFeedbackValenceSchema = z.enum([
|
|
33
|
+
"positive",
|
|
34
|
+
"negative",
|
|
35
|
+
"neutral",
|
|
36
|
+
]);
|
|
37
|
+
|
|
38
|
+
export const captureInstanceFeedbackRequestSchema = z.object({
|
|
39
|
+
targetBindingToken: z
|
|
40
|
+
.string()
|
|
41
|
+
.check(z.trim(), z.minLength(1), z.maxLength(maxTargetBindingTokenLength)),
|
|
42
|
+
capturedAt: z.string().check(
|
|
43
|
+
z.trim(),
|
|
44
|
+
z.minLength(1),
|
|
45
|
+
z.refine(isCanonicalUtcTimestamp, {
|
|
46
|
+
message: "capturedAt must be a canonical UTC timestamp.",
|
|
47
|
+
}),
|
|
48
|
+
),
|
|
49
|
+
comment: z.optional(
|
|
50
|
+
z.nullable(z.string().check(z.maxLength(maxCaptureRequestCommentLength))),
|
|
51
|
+
),
|
|
52
|
+
dataType: instanceFeedbackDataTypeSchema,
|
|
53
|
+
label: z.optional(z.nullable(z.string().check(z.maxLength(255)))),
|
|
54
|
+
name: z.optional(
|
|
55
|
+
z.string().check(z.trim(), z.minLength(1), z.maxLength(255)),
|
|
56
|
+
),
|
|
57
|
+
reasonCategories: z.optional(
|
|
58
|
+
z
|
|
59
|
+
.array(z.string().check(z.trim(), z.minLength(1), z.maxLength(128)))
|
|
60
|
+
.check(z.maxLength(maxReasonCategoryCount)),
|
|
61
|
+
),
|
|
62
|
+
scoreValue: z.optional(z.nullable(finiteNumberSchema)),
|
|
63
|
+
valence: instanceFeedbackValenceSchema,
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
export const captureInstanceFeedbackResponseSchema = z.object({
|
|
67
|
+
capturedAt: z.string(),
|
|
68
|
+
evaluationId: z.string().check(z.trim(), z.minLength(1)),
|
|
69
|
+
status: z.literal("accepted"),
|
|
70
|
+
});
|
|
71
|
+
|
|
72
|
+
export type InstanceFeedbackDataType = z.output<
|
|
73
|
+
typeof instanceFeedbackDataTypeSchema
|
|
74
|
+
>;
|
|
75
|
+
export type InstanceFeedbackValence = z.output<
|
|
76
|
+
typeof instanceFeedbackValenceSchema
|
|
77
|
+
>;
|
|
78
|
+
export type CaptureInstanceFeedbackRequest = z.output<
|
|
79
|
+
typeof captureInstanceFeedbackRequestSchema
|
|
80
|
+
>;
|
|
81
|
+
export type CaptureInstanceFeedbackResponse = z.output<
|
|
82
|
+
typeof captureInstanceFeedbackResponseSchema
|
|
83
|
+
>;
|
|
@@ -63,6 +63,7 @@ describe("@getuserfeedback/protocol root contract", () => {
|
|
|
63
63
|
version: "attention-policy-default-v1",
|
|
64
64
|
source: "default",
|
|
65
65
|
recentFlowCooldownMs: 5 * 60 * 1000,
|
|
66
|
+
recentInAppCooldownMs: 0,
|
|
66
67
|
exclusiveSurfaceStrategy: "queue",
|
|
67
68
|
blockedBroadcastStrategy: "queue",
|
|
68
69
|
});
|