@getuserfeedback/protocol 1.2.0 → 1.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/flow-assignments.d.ts +20 -0
- package/dist/flow-assignments.d.ts.map +1 -1
- package/dist/flow-assignments.js +5 -0
- package/dist/host/host-event-contract.d.ts +2 -0
- package/dist/host/host-event-contract.d.ts.map +1 -1
- package/dist/host/host-event-contract.js +3 -2
- package/dist/webview-transport.d.ts +2 -0
- package/dist/webview-transport.d.ts.map +1 -1
- package/dist/webview-transport.js +4 -1
- package/package.json +2 -1
- package/src/flow-assignments.test.ts +9 -0
- package/src/flow-assignments.ts +7 -0
- package/src/host/host-event-contract.ts +5 -2
- package/src/webview-transport.ts +4 -1
|
@@ -91,6 +91,11 @@ export declare const flowAssignmentTargetingContextSchema: z.ZodMiniObject<{
|
|
|
91
91
|
environment: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
92
92
|
}, z.core.$strip>>;
|
|
93
93
|
}, z.core.$strip>>>;
|
|
94
|
+
page: z.ZodMiniOptional<z.ZodMiniObject<{
|
|
95
|
+
path: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
96
|
+
referrer: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
97
|
+
search: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
98
|
+
}, z.core.$strip>>;
|
|
94
99
|
}, z.core.$strip>;
|
|
95
100
|
export declare const flowAssignmentRecipientRequestSchema: z.ZodMiniObject<{
|
|
96
101
|
identities: z.ZodMiniDefault<z.ZodMiniArray<z.ZodMiniObject<{
|
|
@@ -175,6 +180,11 @@ export declare const flowAssignmentRecipientRequestSchema: z.ZodMiniObject<{
|
|
|
175
180
|
environment: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
176
181
|
}, z.core.$strip>>;
|
|
177
182
|
}, z.core.$strip>>>;
|
|
183
|
+
page: z.ZodMiniOptional<z.ZodMiniObject<{
|
|
184
|
+
path: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
185
|
+
referrer: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
186
|
+
search: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
187
|
+
}, z.core.$strip>>;
|
|
178
188
|
}, z.core.$strip>>;
|
|
179
189
|
at: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
|
|
180
190
|
}, z.core.$strip>;
|
|
@@ -320,6 +330,11 @@ export declare const claimPendingFlowAssignmentsRequestSchema: z.ZodMiniObject<{
|
|
|
320
330
|
environment: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
321
331
|
}, z.core.$strip>>;
|
|
322
332
|
}, z.core.$strip>>>;
|
|
333
|
+
page: z.ZodMiniOptional<z.ZodMiniObject<{
|
|
334
|
+
path: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
335
|
+
referrer: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
336
|
+
search: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
337
|
+
}, z.core.$strip>>;
|
|
323
338
|
}, z.core.$strip>>;
|
|
324
339
|
holdOwnerKey: z.ZodMiniString<string>;
|
|
325
340
|
at: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
|
|
@@ -439,6 +454,11 @@ export declare const updateFlowAssignmentLifecycleRequestSchema: z.ZodMiniObject
|
|
|
439
454
|
environment: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
440
455
|
}, z.core.$strip>>;
|
|
441
456
|
}, z.core.$strip>>>;
|
|
457
|
+
page: z.ZodMiniOptional<z.ZodMiniObject<{
|
|
458
|
+
path: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
459
|
+
referrer: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
460
|
+
search: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
461
|
+
}, z.core.$strip>>;
|
|
442
462
|
}, z.core.$strip>>;
|
|
443
463
|
flowAssignmentId: z.ZodMiniString<string>;
|
|
444
464
|
flowVersionId: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flow-assignments.d.ts","sourceRoot":"","sources":["../src/flow-assignments.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,UAAU,CAAC;AAO9B,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAE5D,MAAM,MAAM,yCAAyC,GACpD,yBAAyB,MAAM,EAAE,CAAC;AACnC,MAAM,MAAM,+BAA+B,GACxC,iBAAiB,GACjB,yCAAyC,CAAC;AAsB7C,eAAO,MAAM,0BAA0B;;;;;;;;;;EAUrC,CAAC;AAEH,eAAO,MAAM,oCAAoC
|
|
1
|
+
{"version":3,"file":"flow-assignments.d.ts","sourceRoot":"","sources":["../src/flow-assignments.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,UAAU,CAAC;AAO9B,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAE5D,MAAM,MAAM,yCAAyC,GACpD,yBAAyB,MAAM,EAAE,CAAC;AACnC,MAAM,MAAM,+BAA+B,GACxC,iBAAiB,GACjB,yCAAyC,CAAC;AAsB7C,eAAO,MAAM,0BAA0B;;;;;;;;;;EAUrC,CAAC;AAEH,eAAO,MAAM,oCAAoC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAU/C,CAAC;AAEH,eAAO,MAAM,oCAAoC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAI/C,CAAC;AAEH,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAmBrC,CAAC;AAEH,eAAO,MAAM,wCAAwC;;;;;;;;;;;;;;;;;;;;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AM,MAAM,iCAAiC,GAAG,CAAC,CAAC,MAAM,CACvD,OAAO,uCAAuC,CAC9C,CAAC;AACF,MAAM,MAAM,kCAAkC,GAAG,CAAC,CAAC,MAAM,CACxD,OAAO,wCAAwC,CAC/C,CAAC;AACF,MAAM,MAAM,oCAAoC,GAAG,CAAC,CAAC,MAAM,CAC1D,OAAO,0CAA0C,CACjD,CAAC;AACF,MAAM,MAAM,qCAAqC,GAAG,CAAC,CAAC,MAAM,CAC3D,OAAO,2CAA2C,CAClD,CAAC"}
|
package/dist/flow-assignments.js
CHANGED
|
@@ -24,6 +24,11 @@ export const flowAssignmentStatusSchema = z.enum([
|
|
|
24
24
|
export const flowAssignmentTargetingContextSchema = z.object({
|
|
25
25
|
flags: z.optional(z.array(appEventFlagSchema)),
|
|
26
26
|
capabilities: z.optional(z.array(appEventCapabilitySchema)),
|
|
27
|
+
page: z.optional(z.object({
|
|
28
|
+
path: z.optional(z.string().check(z.trim(), z.minLength(1))),
|
|
29
|
+
referrer: z.optional(z.string().check(z.trim(), z.minLength(1))),
|
|
30
|
+
search: z.optional(z.string().check(z.trim(), z.minLength(1))),
|
|
31
|
+
})),
|
|
27
32
|
});
|
|
28
33
|
export const flowAssignmentRecipientRequestSchema = z.object({
|
|
29
34
|
identities: z._default(z.array(flowAssignmentIdentitySchema), []),
|
|
@@ -21,6 +21,8 @@ export interface FlowStateChangedDetail extends FlowState {
|
|
|
21
21
|
}
|
|
22
22
|
export interface InstanceFlowStateChangedDetail extends FlowState {
|
|
23
23
|
instanceId: string;
|
|
24
|
+
/** Flow handle for the currently pinned aggregate flow, when known. */
|
|
25
|
+
flowHandleId?: string;
|
|
24
26
|
}
|
|
25
27
|
export interface OpenRequestedDetail {
|
|
26
28
|
instanceId: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"host-event-contract.d.ts","sourceRoot":"","sources":["../../src/host/host-event-contract.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,6FAA6F;AAC7F,MAAM,WAAW,SAAS;IACzB,qCAAqC;IACrC,MAAM,EAAE,OAAO,CAAC;IAChB;;;OAGG;IACH,SAAS,EAAE,OAAO,CAAC;IACnB,uCAAuC;IACvC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,wCAAwC;IACxC,MAAM,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,sBAAuB,SAAQ,SAAS;IACxD,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,8BAA+B,SAAQ,SAAS;IAChE,UAAU,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"host-event-contract.d.ts","sourceRoot":"","sources":["../../src/host/host-event-contract.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,6FAA6F;AAC7F,MAAM,WAAW,SAAS;IACzB,qCAAqC;IACrC,MAAM,EAAE,OAAO,CAAC;IAChB;;;OAGG;IACH,SAAS,EAAE,OAAO,CAAC;IACnB,uCAAuC;IACvC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,wCAAwC;IACxC,MAAM,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,sBAAuB,SAAQ,SAAS;IACxD,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,8BAA+B,SAAQ,SAAS;IAChE,UAAU,EAAE,MAAM,CAAC;IACnB,uEAAuE;IACvE,YAAY,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,mBAAmB;IACnC,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,SAAS,GAAG,WAAW,CAAC;IAChC,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,eAAe,CAAC,EAAE,OAAO,CAAC;CAC1B;AAED,eAAO,MAAM,+BAA+B,EAAE,SAAS;IACtD,OAAO;IACP,QAAQ;IACR,cAAc;IACd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C1B,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,KAAK,CAAC;IACV,KAAK,EAAE;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;CAC1C;AAED,MAAM,MAAM,oBAAoB,GAC7B,2BAA2B,GAC3B,2BAA2B,CAAC;AAE/B,wBAAgB,sBAAsB,CACrC,MAAM,EAAE,OAAO,GACb,MAAM,IAAI,oBAAoB,CAkBhC;AAED,+FAA+F;AAC/F,MAAM,MAAM,wBAAwB,GAAG;IACtC,YAAY,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF;;;GAGG;AACH,MAAM,MAAM,0BAA0B,GAAG,wBAAwB,CAAC;AAElE;;;GAGG;AACH,wBAAgB,iCAAiC,CAAC,MAAM,EAAE;IACzD,EAAE,EAAE,OAAO,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,OAAO,CAAC;CACjB,GAAG,0BAA0B,GAAG,IAAI,CAEpC;AAcD;;;;;GAKG;AACH,wBAAgB,iCAAiC,CAAC,MAAM,EAAE;IACzD,EAAE,EAAE,OAAO,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,OAAO,CAAC;CACjB,GAAG,wBAAwB,GAAG,IAAI,CAgBlC"}
|
|
@@ -34,12 +34,13 @@ export function isFlowStateChangedDetail(detail) {
|
|
|
34
34
|
export function isInstanceFlowStateChangedDetail(detail) {
|
|
35
35
|
if (!isRecord(detail))
|
|
36
36
|
return false;
|
|
37
|
-
const { instanceId, isOpen, isLoading, width, height } = detail;
|
|
37
|
+
const { instanceId, isOpen, isLoading, width, height, flowHandleId } = detail;
|
|
38
38
|
return (isNonEmptyString(instanceId) &&
|
|
39
39
|
typeof isOpen === "boolean" &&
|
|
40
40
|
typeof isLoading === "boolean" &&
|
|
41
41
|
(typeof width === "undefined" || typeof width === "number") &&
|
|
42
|
-
(typeof height === "undefined" || typeof height === "number")
|
|
42
|
+
(typeof height === "undefined" || typeof height === "number") &&
|
|
43
|
+
(typeof flowHandleId === "undefined" || isNonEmptyString(flowHandleId)));
|
|
43
44
|
}
|
|
44
45
|
export function isOpenRequestedDetail(detail) {
|
|
45
46
|
if (!isRecord(detail))
|
|
@@ -886,6 +886,7 @@ export declare const webViewTransportHostEventSchema: z.ZodMiniDiscriminatedUnio
|
|
|
886
886
|
}, z.core.$strict>, z.ZodMiniObject<{
|
|
887
887
|
name: z.ZodMiniLiteral<"instance:flow:state-changed:instance">;
|
|
888
888
|
detail: z.ZodMiniObject<{
|
|
889
|
+
flowHandleId: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
889
890
|
instanceId: z.ZodMiniString<string>;
|
|
890
891
|
isOpen: z.ZodMiniBoolean<boolean>;
|
|
891
892
|
isLoading: z.ZodMiniBoolean<boolean>;
|
|
@@ -1470,6 +1471,7 @@ export declare const webViewTransportWebMessageSchema: z.ZodMiniDiscriminatedUni
|
|
|
1470
1471
|
}, z.core.$strict>, z.ZodMiniObject<{
|
|
1471
1472
|
name: z.ZodMiniLiteral<"instance:flow:state-changed:instance">;
|
|
1472
1473
|
detail: z.ZodMiniObject<{
|
|
1474
|
+
flowHandleId: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
1473
1475
|
instanceId: z.ZodMiniString<string>;
|
|
1474
1476
|
isOpen: z.ZodMiniBoolean<boolean>;
|
|
1475
1477
|
isLoading: z.ZodMiniBoolean<boolean>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"webview-transport.d.ts","sourceRoot":"","sources":["../src/webview-transport.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,UAAU,CAAC;AAgB9B,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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ase,
|
|
46
46
|
flowHandleId: nonEmptyStringSchema,
|
|
47
47
|
});
|
|
48
|
-
const instanceFlowStateChangedDetailSchema = z.strictObject(
|
|
48
|
+
const instanceFlowStateChangedDetailSchema = z.strictObject({
|
|
49
|
+
...flowStateBase,
|
|
50
|
+
flowHandleId: z.optional(nonEmptyStringSchema),
|
|
51
|
+
});
|
|
49
52
|
const openRequestedDetailSchema = z.strictObject({
|
|
50
53
|
instanceId: nonEmptyStringSchema,
|
|
51
54
|
source: z.enum(["command", "targeting"]),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@getuserfeedback/protocol",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.3.1",
|
|
4
4
|
"description": "getuserfeedback widget protocol — host surface and (later) wire protocol",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"getuserfeedback",
|
|
@@ -119,6 +119,7 @@
|
|
|
119
119
|
"types": "bun ../../scripts/clean-build-output.ts dist tsconfig.tsbuildinfo && tsc -b tsconfig.json --emitDeclarationOnly",
|
|
120
120
|
"typecheck": "tsc -b tsconfig.json",
|
|
121
121
|
"test": "bun test --dots",
|
|
122
|
+
"test:changed": "bun test --changed=${TEST_CHANGED_BASE:-HEAD} --pass-with-no-tests --dots",
|
|
122
123
|
"pack:verify": "node ../../scripts/pack-and-verify.cjs",
|
|
123
124
|
"publish:dry-run": "node ../../scripts/publish-package.cjs . -- --dry-run",
|
|
124
125
|
"publish:npm": "node ../../scripts/publish-package.cjs ."
|
|
@@ -12,6 +12,7 @@ describe("flow assignment request contracts", () => {
|
|
|
12
12
|
context: {
|
|
13
13
|
flags: [{ key: "new_checkout", value: true }],
|
|
14
14
|
capabilities: [{ key: "checkout.drawer", source: "host-app" }],
|
|
15
|
+
page: { path: "/checkout", search: "?step=payment" },
|
|
15
16
|
},
|
|
16
17
|
});
|
|
17
18
|
|
|
@@ -23,6 +24,10 @@ describe("flow assignment request contracts", () => {
|
|
|
23
24
|
key: "checkout.drawer",
|
|
24
25
|
source: "host-app",
|
|
25
26
|
});
|
|
27
|
+
expect(result.context?.page).toEqual({
|
|
28
|
+
path: "/checkout",
|
|
29
|
+
search: "?step=payment",
|
|
30
|
+
});
|
|
26
31
|
});
|
|
27
32
|
|
|
28
33
|
it("accepts runtime targeting context for claimPending", () => {
|
|
@@ -31,12 +36,14 @@ describe("flow assignment request contracts", () => {
|
|
|
31
36
|
context: {
|
|
32
37
|
flags: [{ key: "pricing_test", value: "variant_a" }],
|
|
33
38
|
capabilities: [{ key: "billing.portal" }],
|
|
39
|
+
page: { path: "/billing" },
|
|
34
40
|
},
|
|
35
41
|
});
|
|
36
42
|
|
|
37
43
|
expect(result.identities).toEqual([]);
|
|
38
44
|
expect(result.context?.flags?.[0]?.key).toBe("pricing_test");
|
|
39
45
|
expect(result.context?.capabilities?.[0]?.key).toBe("billing.portal");
|
|
46
|
+
expect(result.context?.page?.path).toBe("/billing");
|
|
40
47
|
});
|
|
41
48
|
|
|
42
49
|
it("accepts external ID identities for recipient continuity", () => {
|
|
@@ -103,6 +110,7 @@ describe("flow assignment request contracts", () => {
|
|
|
103
110
|
context: {
|
|
104
111
|
flags: [{ key: "new_checkout", value: true }],
|
|
105
112
|
capabilities: [{ key: "checkout.drawer", source: "host-app" }],
|
|
113
|
+
page: { path: "/checkout" },
|
|
106
114
|
},
|
|
107
115
|
});
|
|
108
116
|
|
|
@@ -114,5 +122,6 @@ describe("flow assignment request contracts", () => {
|
|
|
114
122
|
key: "checkout.drawer",
|
|
115
123
|
source: "host-app",
|
|
116
124
|
});
|
|
125
|
+
expect(result.context?.page?.path).toBe("/checkout");
|
|
117
126
|
});
|
|
118
127
|
});
|
package/src/flow-assignments.ts
CHANGED
|
@@ -48,6 +48,13 @@ export const flowAssignmentStatusSchema = z.enum([
|
|
|
48
48
|
export const flowAssignmentTargetingContextSchema = z.object({
|
|
49
49
|
flags: z.optional(z.array(appEventFlagSchema)),
|
|
50
50
|
capabilities: z.optional(z.array(appEventCapabilitySchema)),
|
|
51
|
+
page: z.optional(
|
|
52
|
+
z.object({
|
|
53
|
+
path: z.optional(z.string().check(z.trim(), z.minLength(1))),
|
|
54
|
+
referrer: z.optional(z.string().check(z.trim(), z.minLength(1))),
|
|
55
|
+
search: z.optional(z.string().check(z.trim(), z.minLength(1))),
|
|
56
|
+
}),
|
|
57
|
+
),
|
|
51
58
|
});
|
|
52
59
|
|
|
53
60
|
export const flowAssignmentRecipientRequestSchema = z.object({
|
|
@@ -24,6 +24,8 @@ export interface FlowStateChangedDetail extends FlowState {
|
|
|
24
24
|
|
|
25
25
|
export interface InstanceFlowStateChangedDetail extends FlowState {
|
|
26
26
|
instanceId: string;
|
|
27
|
+
/** Flow handle for the currently pinned aggregate flow, when known. */
|
|
28
|
+
flowHandleId?: string;
|
|
27
29
|
}
|
|
28
30
|
|
|
29
31
|
export interface OpenRequestedDetail {
|
|
@@ -116,13 +118,14 @@ export function isInstanceFlowStateChangedDetail(
|
|
|
116
118
|
detail: unknown,
|
|
117
119
|
): detail is InstanceFlowStateChangedDetail {
|
|
118
120
|
if (!isRecord(detail)) return false;
|
|
119
|
-
const { instanceId, isOpen, isLoading, width, height } = detail;
|
|
121
|
+
const { instanceId, isOpen, isLoading, width, height, flowHandleId } = detail;
|
|
120
122
|
return (
|
|
121
123
|
isNonEmptyString(instanceId) &&
|
|
122
124
|
typeof isOpen === "boolean" &&
|
|
123
125
|
typeof isLoading === "boolean" &&
|
|
124
126
|
(typeof width === "undefined" || typeof width === "number") &&
|
|
125
|
-
(typeof height === "undefined" || typeof height === "number")
|
|
127
|
+
(typeof height === "undefined" || typeof height === "number") &&
|
|
128
|
+
(typeof flowHandleId === "undefined" || isNonEmptyString(flowHandleId))
|
|
126
129
|
);
|
|
127
130
|
}
|
|
128
131
|
|
package/src/webview-transport.ts
CHANGED
|
@@ -55,7 +55,10 @@ const flowStateChangedDetailSchema = z.strictObject({
|
|
|
55
55
|
flowHandleId: nonEmptyStringSchema,
|
|
56
56
|
});
|
|
57
57
|
|
|
58
|
-
const instanceFlowStateChangedDetailSchema = z.strictObject(
|
|
58
|
+
const instanceFlowStateChangedDetailSchema = z.strictObject({
|
|
59
|
+
...flowStateBase,
|
|
60
|
+
flowHandleId: z.optional(nonEmptyStringSchema),
|
|
61
|
+
});
|
|
59
62
|
|
|
60
63
|
const openRequestedDetailSchema = z.strictObject({
|
|
61
64
|
instanceId: nonEmptyStringSchema,
|