@get-bb/plugin-sdk 0.5.31 → 0.6.9
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 +8 -4
- package/bundled-types/bb-plugin-sdk-app.d.ts +434 -253
- package/bundled-types/bb-plugin-sdk-internal-composer-handle.d.ts +457 -0
- package/bundled-types/bb-plugin-sdk-internal-host-policy.d.ts +26 -9
- package/bundled-types/bb-plugin-sdk-provider-bridge-acp.d.ts +2 -2
- package/bundled-types/bb-plugin-sdk-provider-bridge-testing.d.ts +9 -12
- package/bundled-types/bb-plugin-sdk-provider-bridge.d.ts +11 -10
- package/bundled-types/bb-plugin-sdk-testing-app.d.ts +32 -10
- package/bundled-types/bb-plugin-sdk-testing.d.ts +9 -4
- package/bundled-types/bb-plugin-sdk.d.ts +469 -261
- package/dist/app.js +2 -0
- package/dist/internal/composer-customization-validation.js +37 -27
- package/dist/internal/composer-handle.js +531 -0
- package/dist/internal/host-policy.js +0 -1
- package/dist/internal/plugin-app-collector.js +42 -27
- package/dist/provider-bridge-acp.js +14 -60
- package/dist/provider-bridge-testing.js +12 -61
- package/dist/provider-bridge.js +12 -55
- package/dist/testing/app.js +801 -139
- package/dist/testing/index.js +6 -3
- package/package.json +8 -2
|
@@ -95,6 +95,30 @@ function parseContributionArray(kind, value, onRejected, parse) {
|
|
|
95
95
|
}
|
|
96
96
|
return parsed;
|
|
97
97
|
}
|
|
98
|
+
function parseMenuItem(entryKind, value) {
|
|
99
|
+
const entry = value;
|
|
100
|
+
const id = requireSlotId(entryKind, entry?.id);
|
|
101
|
+
const icon = requireOptionalString(entryKind, "icon", entry?.icon);
|
|
102
|
+
const description = requireOptionalString(
|
|
103
|
+
entryKind,
|
|
104
|
+
"description",
|
|
105
|
+
entry?.description
|
|
106
|
+
);
|
|
107
|
+
const disabled = entry?.disabled;
|
|
108
|
+
if (disabled !== void 0 && typeof disabled !== "boolean" && typeof disabled !== "function") {
|
|
109
|
+
throw new Error(
|
|
110
|
+
`${entryKind}: "disabled" must be a boolean or function when set`
|
|
111
|
+
);
|
|
112
|
+
}
|
|
113
|
+
return {
|
|
114
|
+
id,
|
|
115
|
+
label: requireNonEmptyString(entryKind, "label", entry?.label),
|
|
116
|
+
...icon !== void 0 ? { icon } : {},
|
|
117
|
+
...description !== void 0 ? { description } : {},
|
|
118
|
+
...disabled !== void 0 ? { disabled } : {},
|
|
119
|
+
run: requireFunction(entryKind, "run", entry?.run)
|
|
120
|
+
};
|
|
121
|
+
}
|
|
98
122
|
function parseRegions(kind, registration, onRejected) {
|
|
99
123
|
const actions = parseContributionArray(`${kind}.actions`, registration.actions, onRejected, (entryKind, value) => {
|
|
100
124
|
const entry = value;
|
|
@@ -122,32 +146,13 @@ function parseRegions(kind, registration, onRejected) {
|
|
|
122
146
|
`${kind}.plusMenu`,
|
|
123
147
|
registration.plusMenu,
|
|
124
148
|
onRejected,
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
entry?.description
|
|
133
|
-
);
|
|
134
|
-
const disabled = entry?.disabled;
|
|
135
|
-
if (disabled !== void 0 && typeof disabled !== "boolean" && typeof disabled !== "function") {
|
|
136
|
-
throw new Error(
|
|
137
|
-
`${entryKind}: "disabled" must be a boolean or function when set`
|
|
138
|
-
);
|
|
139
|
-
}
|
|
140
|
-
return {
|
|
141
|
-
id,
|
|
142
|
-
label: requireNonEmptyString(entryKind, "label", entry?.label),
|
|
143
|
-
...icon !== void 0 ? { icon } : {},
|
|
144
|
-
...description !== void 0 ? { description } : {},
|
|
145
|
-
...disabled !== void 0 ? {
|
|
146
|
-
disabled
|
|
147
|
-
} : {},
|
|
148
|
-
run: requireFunction(entryKind, "run", entry?.run)
|
|
149
|
-
};
|
|
150
|
-
}
|
|
149
|
+
parseMenuItem
|
|
150
|
+
);
|
|
151
|
+
const sendMenu = parseContributionArray(
|
|
152
|
+
`${kind}.sendMenu`,
|
|
153
|
+
registration.sendMenu,
|
|
154
|
+
onRejected,
|
|
155
|
+
parseMenuItem
|
|
151
156
|
);
|
|
152
157
|
let richText;
|
|
153
158
|
if (registration.richText !== void 0) {
|
|
@@ -190,6 +195,7 @@ function parseRegions(kind, registration, onRejected) {
|
|
|
190
195
|
...actions !== void 0 ? { actions } : {},
|
|
191
196
|
...banners !== void 0 ? { banners } : {},
|
|
192
197
|
...plusMenu !== void 0 ? { plusMenu } : {},
|
|
198
|
+
...sendMenu !== void 0 ? { sendMenu } : {},
|
|
193
199
|
...richText !== void 0 ? { richText } : {}
|
|
194
200
|
};
|
|
195
201
|
}
|
|
@@ -214,7 +220,11 @@ function collectComposerCustomization(registration, seenIds, onRejected) {
|
|
|
214
220
|
requireUniqueId(kind, seenIds, id);
|
|
215
221
|
return {
|
|
216
222
|
id,
|
|
217
|
-
...scopes !== void 0 ? {
|
|
223
|
+
...scopes !== void 0 ? {
|
|
224
|
+
scopes: scopes.filter(
|
|
225
|
+
(scope) => scope !== "side-chat"
|
|
226
|
+
)
|
|
227
|
+
} : {},
|
|
218
228
|
...parseRegions(`${kind}(${id})`, raw ?? {}, onRejected)
|
|
219
229
|
};
|
|
220
230
|
} catch (error) {
|
|
@@ -532,7 +542,12 @@ function collectPluginAppRegistrations(definition, onComposerCustomizationReject
|
|
|
532
542
|
"description",
|
|
533
543
|
registration.description
|
|
534
544
|
);
|
|
545
|
+
const page = registration.experimental_page;
|
|
546
|
+
if (page !== void 0 && page !== "mobile") {
|
|
547
|
+
throw new Error(`${kind}: experimental_page must be "mobile"`);
|
|
548
|
+
}
|
|
535
549
|
collected.settingsSections.push({
|
|
550
|
+
...page !== void 0 ? { experimental_page: page } : {},
|
|
536
551
|
id,
|
|
537
552
|
...title !== void 0 ? { title } : {},
|
|
538
553
|
...description !== void 0 ? { description } : {},
|
|
@@ -1826,25 +1826,7 @@ var turnRequestRejectedEventDataSchema = z13.object({
|
|
|
1826
1826
|
var systemErrorEventDataSchema = z13.object({
|
|
1827
1827
|
code: z13.string().optional(),
|
|
1828
1828
|
message: z13.string(),
|
|
1829
|
-
detail: z13.string().optional()
|
|
1830
|
-
reconnectAttempt: z13.number().int().positive().optional(),
|
|
1831
|
-
reconnectTotal: z13.number().int().positive().optional()
|
|
1832
|
-
}).superRefine((value, ctx) => {
|
|
1833
|
-
const hasReconnectAttempt = value.reconnectAttempt !== void 0;
|
|
1834
|
-
const hasReconnectTotal = value.reconnectTotal !== void 0;
|
|
1835
|
-
if (hasReconnectAttempt !== hasReconnectTotal) {
|
|
1836
|
-
ctx.addIssue({
|
|
1837
|
-
code: z13.ZodIssueCode.custom,
|
|
1838
|
-
message: "system/error reconnectAttempt and reconnectTotal must be provided together"
|
|
1839
|
-
});
|
|
1840
|
-
return;
|
|
1841
|
-
}
|
|
1842
|
-
if (value.reconnectAttempt !== void 0 && value.reconnectTotal !== void 0 && value.reconnectAttempt > value.reconnectTotal) {
|
|
1843
|
-
ctx.addIssue({
|
|
1844
|
-
code: z13.ZodIssueCode.custom,
|
|
1845
|
-
message: "system/error reconnectAttempt cannot be greater than reconnectTotal"
|
|
1846
|
-
});
|
|
1847
|
-
}
|
|
1829
|
+
detail: z13.string().optional()
|
|
1848
1830
|
});
|
|
1849
1831
|
var ownershipChangeOperationActionValues = [
|
|
1850
1832
|
"assign",
|
|
@@ -2755,46 +2737,20 @@ var unscopedSystemEventSchema = z16.discriminatedUnion("type", [
|
|
|
2755
2737
|
}).merge(systemProviderTurnWatchdogEventDataSchema)
|
|
2756
2738
|
]);
|
|
2757
2739
|
var systemEventSchema = unscopedSystemEventSchema.and(scopedEventDataSchema);
|
|
2758
|
-
var
|
|
2759
|
-
|
|
2760
|
-
|
|
2761
|
-
|
|
2762
|
-
|
|
2763
|
-
if (!
|
|
2764
|
-
return;
|
|
2765
|
-
}
|
|
2766
|
-
if (Object.hasOwn(value, legacyClientRequestKey)) {
|
|
2767
|
-
ctx.addIssue({
|
|
2768
|
-
code: z16.ZodIssueCode.custom,
|
|
2769
|
-
message: "legacy request sequence field is no longer accepted",
|
|
2770
|
-
path: [legacyClientRequestKey]
|
|
2771
|
-
});
|
|
2772
|
-
}
|
|
2773
|
-
const item = value.item;
|
|
2774
|
-
if (isEventPropertyBag(item) && item.type === "userMessage" && Object.hasOwn(item, legacyClientRequestKey)) {
|
|
2740
|
+
var threadEventSchema = z16.union([providerEventSchema, systemEventSchema]).superRefine((event, ctx) => {
|
|
2741
|
+
const result = validateThreadEventScope({
|
|
2742
|
+
type: event.type,
|
|
2743
|
+
scope: event.scope
|
|
2744
|
+
});
|
|
2745
|
+
if (!result.valid) {
|
|
2775
2746
|
ctx.addIssue({
|
|
2776
2747
|
code: z16.ZodIssueCode.custom,
|
|
2777
|
-
message:
|
|
2778
|
-
path: ["
|
|
2748
|
+
message: result.message ?? "Invalid thread event scope",
|
|
2749
|
+
path: ["scope"]
|
|
2779
2750
|
});
|
|
2751
|
+
return;
|
|
2780
2752
|
}
|
|
2781
2753
|
});
|
|
2782
|
-
var threadEventSchema = rejectLegacyClientRequestSequenceSchema.pipe(
|
|
2783
|
-
z16.union([providerEventSchema, systemEventSchema]).superRefine((event, ctx) => {
|
|
2784
|
-
const result = validateThreadEventScope({
|
|
2785
|
-
type: event.type,
|
|
2786
|
-
scope: event.scope
|
|
2787
|
-
});
|
|
2788
|
-
if (!result.valid) {
|
|
2789
|
-
ctx.addIssue({
|
|
2790
|
-
code: z16.ZodIssueCode.custom,
|
|
2791
|
-
message: result.message ?? "Invalid thread event scope",
|
|
2792
|
-
path: ["scope"]
|
|
2793
|
-
});
|
|
2794
|
-
return;
|
|
2795
|
-
}
|
|
2796
|
-
})
|
|
2797
|
-
);
|
|
2798
2754
|
var threadEventTypeValues = [
|
|
2799
2755
|
...providerEventTypeValues,
|
|
2800
2756
|
...systemEventTypeValues
|
|
@@ -3083,7 +3039,8 @@ var providerMaintenanceParamsSchema = z22.object({
|
|
|
3083
3039
|
}).passthrough();
|
|
3084
3040
|
var providerInstallationRequirementSchema = z22.enum(["thread_rewind"]);
|
|
3085
3041
|
var providerInstallationStatusParamsSchema = providerMaintenanceParamsSchema.extend({
|
|
3086
|
-
requirement: providerInstallationRequirementSchema.optional()
|
|
3042
|
+
requirement: providerInstallationRequirementSchema.optional(),
|
|
3043
|
+
checkUpdates: z22.boolean().default(true)
|
|
3087
3044
|
});
|
|
3088
3045
|
var providerHealthSchema = z22.object({
|
|
3089
3046
|
status: z22.enum([
|
|
@@ -4590,9 +4547,7 @@ var acpInitializeResultSchema = z35.object({
|
|
|
4590
4547
|
fork: z35.object({}).passthrough().nullable().optional()
|
|
4591
4548
|
}).passthrough().optional(),
|
|
4592
4549
|
promptCapabilities: z35.object({
|
|
4593
|
-
image: z35.boolean().optional()
|
|
4594
|
-
audio: z35.boolean().optional(),
|
|
4595
|
-
embeddedContext: z35.boolean().optional()
|
|
4550
|
+
image: z35.boolean().optional()
|
|
4596
4551
|
}).passthrough().optional()
|
|
4597
4552
|
}).passthrough().optional(),
|
|
4598
4553
|
authMethods: z35.array(z35.object({ id: z35.string() }).passthrough()).optional()
|
|
@@ -4816,7 +4771,6 @@ var ACP_COMPACTION_COMPLETED_METHOD = "acp/compaction/completed";
|
|
|
4816
4771
|
var ACP_UPDATE_METHOD = "acp/update";
|
|
4817
4772
|
var ACP_FS_WRITE_METHOD = "acp/fs/write";
|
|
4818
4773
|
var ACP_WARNING_METHOD = "acp/warning";
|
|
4819
|
-
var ACP_BRIDGE_NO_ACTIVE_TURN_ERROR_CODE = -32001;
|
|
4820
4774
|
var acpTurnStartedNotificationParamsSchema = z36.object({
|
|
4821
4775
|
threadId: z36.string().min(1)
|
|
4822
4776
|
}).passthrough();
|
|
@@ -10459,7 +10413,7 @@ async function handleRequest2(request) {
|
|
|
10459
10413
|
}
|
|
10460
10414
|
if (session.activePromptKind !== "turn") {
|
|
10461
10415
|
const message = "No active turn to steer";
|
|
10462
|
-
sendError(request.id,
|
|
10416
|
+
sendError(request.id, BRIDGE_JSON_RPC_ERRORS.NO_ACTIVE_TURN, message, {
|
|
10463
10417
|
recovery: { kind: "staleTurn", message, retryable: false }
|
|
10464
10418
|
});
|
|
10465
10419
|
return;
|
|
@@ -915,25 +915,7 @@ var turnRequestRejectedEventDataSchema = z11.object({
|
|
|
915
915
|
var systemErrorEventDataSchema = z11.object({
|
|
916
916
|
code: z11.string().optional(),
|
|
917
917
|
message: z11.string(),
|
|
918
|
-
detail: z11.string().optional()
|
|
919
|
-
reconnectAttempt: z11.number().int().positive().optional(),
|
|
920
|
-
reconnectTotal: z11.number().int().positive().optional()
|
|
921
|
-
}).superRefine((value, ctx) => {
|
|
922
|
-
const hasReconnectAttempt = value.reconnectAttempt !== void 0;
|
|
923
|
-
const hasReconnectTotal = value.reconnectTotal !== void 0;
|
|
924
|
-
if (hasReconnectAttempt !== hasReconnectTotal) {
|
|
925
|
-
ctx.addIssue({
|
|
926
|
-
code: z11.ZodIssueCode.custom,
|
|
927
|
-
message: "system/error reconnectAttempt and reconnectTotal must be provided together"
|
|
928
|
-
});
|
|
929
|
-
return;
|
|
930
|
-
}
|
|
931
|
-
if (value.reconnectAttempt !== void 0 && value.reconnectTotal !== void 0 && value.reconnectAttempt > value.reconnectTotal) {
|
|
932
|
-
ctx.addIssue({
|
|
933
|
-
code: z11.ZodIssueCode.custom,
|
|
934
|
-
message: "system/error reconnectAttempt cannot be greater than reconnectTotal"
|
|
935
|
-
});
|
|
936
|
-
}
|
|
918
|
+
detail: z11.string().optional()
|
|
937
919
|
});
|
|
938
920
|
var ownershipChangeOperationActionValues = [
|
|
939
921
|
"assign",
|
|
@@ -1853,46 +1835,20 @@ var unscopedSystemEventSchema = z14.discriminatedUnion("type", [
|
|
|
1853
1835
|
}).merge(systemProviderTurnWatchdogEventDataSchema)
|
|
1854
1836
|
]);
|
|
1855
1837
|
var systemEventSchema = unscopedSystemEventSchema.and(scopedEventDataSchema);
|
|
1856
|
-
var
|
|
1857
|
-
|
|
1858
|
-
|
|
1859
|
-
|
|
1860
|
-
|
|
1861
|
-
if (!
|
|
1862
|
-
return;
|
|
1863
|
-
}
|
|
1864
|
-
if (Object.hasOwn(value, legacyClientRequestKey)) {
|
|
1865
|
-
ctx.addIssue({
|
|
1866
|
-
code: z14.ZodIssueCode.custom,
|
|
1867
|
-
message: "legacy request sequence field is no longer accepted",
|
|
1868
|
-
path: [legacyClientRequestKey]
|
|
1869
|
-
});
|
|
1870
|
-
}
|
|
1871
|
-
const item = value.item;
|
|
1872
|
-
if (isEventPropertyBag(item) && item.type === "userMessage" && Object.hasOwn(item, legacyClientRequestKey)) {
|
|
1838
|
+
var threadEventSchema = z14.union([providerEventSchema, systemEventSchema]).superRefine((event, ctx) => {
|
|
1839
|
+
const result2 = validateThreadEventScope({
|
|
1840
|
+
type: event.type,
|
|
1841
|
+
scope: event.scope
|
|
1842
|
+
});
|
|
1843
|
+
if (!result2.valid) {
|
|
1873
1844
|
ctx.addIssue({
|
|
1874
1845
|
code: z14.ZodIssueCode.custom,
|
|
1875
|
-
message:
|
|
1876
|
-
path: ["
|
|
1846
|
+
message: result2.message ?? "Invalid thread event scope",
|
|
1847
|
+
path: ["scope"]
|
|
1877
1848
|
});
|
|
1849
|
+
return;
|
|
1878
1850
|
}
|
|
1879
1851
|
});
|
|
1880
|
-
var threadEventSchema = rejectLegacyClientRequestSequenceSchema.pipe(
|
|
1881
|
-
z14.union([providerEventSchema, systemEventSchema]).superRefine((event, ctx) => {
|
|
1882
|
-
const result2 = validateThreadEventScope({
|
|
1883
|
-
type: event.type,
|
|
1884
|
-
scope: event.scope
|
|
1885
|
-
});
|
|
1886
|
-
if (!result2.valid) {
|
|
1887
|
-
ctx.addIssue({
|
|
1888
|
-
code: z14.ZodIssueCode.custom,
|
|
1889
|
-
message: result2.message ?? "Invalid thread event scope",
|
|
1890
|
-
path: ["scope"]
|
|
1891
|
-
});
|
|
1892
|
-
return;
|
|
1893
|
-
}
|
|
1894
|
-
})
|
|
1895
|
-
);
|
|
1896
1852
|
function isThreadEventWithItem(event) {
|
|
1897
1853
|
switch (event.type) {
|
|
1898
1854
|
case "item/started":
|
|
@@ -4251,11 +4207,6 @@ function assembleCapturedThreadEvents(messages, providerId = "pi") {
|
|
|
4251
4207
|
const collector = createBridgeDeltaEventCollector(providerId);
|
|
4252
4208
|
return messages.flatMap((message) => collector.assembleMessage(message));
|
|
4253
4209
|
}
|
|
4254
|
-
function toConformanceMessages() {
|
|
4255
|
-
throw new Error(
|
|
4256
|
-
"experimental_toConformanceMessages was removed: experimental_runBridgeConformance assembles thread/delta itself. Hand it a transport whose takeMessages returns the raw captured messages (CapturedBridgeJsonRpcOutput.takeMessages) and pass the bridge's providerId."
|
|
4257
|
-
);
|
|
4258
|
-
}
|
|
4259
4210
|
|
|
4260
4211
|
// ../provider-bridge-protocol/src/conformance/client.ts
|
|
4261
4212
|
import { z as z20 } from "zod";
|
|
@@ -4435,7 +4386,8 @@ var providerMaintenanceParamsSchema = z23.object({
|
|
|
4435
4386
|
}).passthrough();
|
|
4436
4387
|
var providerInstallationRequirementSchema = z23.enum(["thread_rewind"]);
|
|
4437
4388
|
var providerInstallationStatusParamsSchema = providerMaintenanceParamsSchema.extend({
|
|
4438
|
-
requirement: providerInstallationRequirementSchema.optional()
|
|
4389
|
+
requirement: providerInstallationRequirementSchema.optional(),
|
|
4390
|
+
checkUpdates: z23.boolean().default(true)
|
|
4439
4391
|
});
|
|
4440
4392
|
var providerHealthSchema = z23.object({
|
|
4441
4393
|
status: z23.enum([
|
|
@@ -7166,6 +7118,5 @@ export {
|
|
|
7166
7118
|
rerecordCurrentBridgeLane as experimental_rerecordCurrentBridgeLane,
|
|
7167
7119
|
resolveProviderBridgeLaunch as experimental_resolveProviderBridgeLaunch,
|
|
7168
7120
|
runBridgeConformance as experimental_runBridgeConformance,
|
|
7169
|
-
toConformanceMessages as experimental_toConformanceMessages,
|
|
7170
7121
|
withCurrentBridgeLane as experimental_withCurrentBridgeLane
|
|
7171
7122
|
};
|
package/dist/provider-bridge.js
CHANGED
|
@@ -2353,25 +2353,7 @@ var turnRequestRejectedEventDataSchema = z15.object({
|
|
|
2353
2353
|
var systemErrorEventDataSchema = z15.object({
|
|
2354
2354
|
code: z15.string().optional(),
|
|
2355
2355
|
message: z15.string(),
|
|
2356
|
-
detail: z15.string().optional()
|
|
2357
|
-
reconnectAttempt: z15.number().int().positive().optional(),
|
|
2358
|
-
reconnectTotal: z15.number().int().positive().optional()
|
|
2359
|
-
}).superRefine((value, ctx) => {
|
|
2360
|
-
const hasReconnectAttempt = value.reconnectAttempt !== void 0;
|
|
2361
|
-
const hasReconnectTotal = value.reconnectTotal !== void 0;
|
|
2362
|
-
if (hasReconnectAttempt !== hasReconnectTotal) {
|
|
2363
|
-
ctx.addIssue({
|
|
2364
|
-
code: z15.ZodIssueCode.custom,
|
|
2365
|
-
message: "system/error reconnectAttempt and reconnectTotal must be provided together"
|
|
2366
|
-
});
|
|
2367
|
-
return;
|
|
2368
|
-
}
|
|
2369
|
-
if (value.reconnectAttempt !== void 0 && value.reconnectTotal !== void 0 && value.reconnectAttempt > value.reconnectTotal) {
|
|
2370
|
-
ctx.addIssue({
|
|
2371
|
-
code: z15.ZodIssueCode.custom,
|
|
2372
|
-
message: "system/error reconnectAttempt cannot be greater than reconnectTotal"
|
|
2373
|
-
});
|
|
2374
|
-
}
|
|
2356
|
+
detail: z15.string().optional()
|
|
2375
2357
|
});
|
|
2376
2358
|
var ownershipChangeOperationActionValues = [
|
|
2377
2359
|
"assign",
|
|
@@ -3282,46 +3264,20 @@ var unscopedSystemEventSchema = z18.discriminatedUnion("type", [
|
|
|
3282
3264
|
}).merge(systemProviderTurnWatchdogEventDataSchema)
|
|
3283
3265
|
]);
|
|
3284
3266
|
var systemEventSchema = unscopedSystemEventSchema.and(scopedEventDataSchema);
|
|
3285
|
-
var
|
|
3286
|
-
|
|
3287
|
-
|
|
3288
|
-
|
|
3289
|
-
|
|
3290
|
-
if (!
|
|
3291
|
-
return;
|
|
3292
|
-
}
|
|
3293
|
-
if (Object.hasOwn(value, legacyClientRequestKey)) {
|
|
3294
|
-
ctx.addIssue({
|
|
3295
|
-
code: z18.ZodIssueCode.custom,
|
|
3296
|
-
message: "legacy request sequence field is no longer accepted",
|
|
3297
|
-
path: [legacyClientRequestKey]
|
|
3298
|
-
});
|
|
3299
|
-
}
|
|
3300
|
-
const item = value.item;
|
|
3301
|
-
if (isEventPropertyBag(item) && item.type === "userMessage" && Object.hasOwn(item, legacyClientRequestKey)) {
|
|
3267
|
+
var threadEventSchema = z18.union([providerEventSchema, systemEventSchema]).superRefine((event, ctx) => {
|
|
3268
|
+
const result = validateThreadEventScope({
|
|
3269
|
+
type: event.type,
|
|
3270
|
+
scope: event.scope
|
|
3271
|
+
});
|
|
3272
|
+
if (!result.valid) {
|
|
3302
3273
|
ctx.addIssue({
|
|
3303
3274
|
code: z18.ZodIssueCode.custom,
|
|
3304
|
-
message:
|
|
3305
|
-
path: ["
|
|
3275
|
+
message: result.message ?? "Invalid thread event scope",
|
|
3276
|
+
path: ["scope"]
|
|
3306
3277
|
});
|
|
3278
|
+
return;
|
|
3307
3279
|
}
|
|
3308
3280
|
});
|
|
3309
|
-
var threadEventSchema = rejectLegacyClientRequestSequenceSchema.pipe(
|
|
3310
|
-
z18.union([providerEventSchema, systemEventSchema]).superRefine((event, ctx) => {
|
|
3311
|
-
const result = validateThreadEventScope({
|
|
3312
|
-
type: event.type,
|
|
3313
|
-
scope: event.scope
|
|
3314
|
-
});
|
|
3315
|
-
if (!result.valid) {
|
|
3316
|
-
ctx.addIssue({
|
|
3317
|
-
code: z18.ZodIssueCode.custom,
|
|
3318
|
-
message: result.message ?? "Invalid thread event scope",
|
|
3319
|
-
path: ["scope"]
|
|
3320
|
-
});
|
|
3321
|
-
return;
|
|
3322
|
-
}
|
|
3323
|
-
})
|
|
3324
|
-
);
|
|
3325
3281
|
var threadEventTypeValues = [
|
|
3326
3282
|
...providerEventTypeValues,
|
|
3327
3283
|
...systemEventTypeValues
|
|
@@ -4147,7 +4103,8 @@ var providerMaintenanceParamsSchema = z30.object({
|
|
|
4147
4103
|
}).passthrough();
|
|
4148
4104
|
var providerInstallationRequirementSchema = z30.enum(["thread_rewind"]);
|
|
4149
4105
|
var providerInstallationStatusParamsSchema = providerMaintenanceParamsSchema.extend({
|
|
4150
|
-
requirement: providerInstallationRequirementSchema.optional()
|
|
4106
|
+
requirement: providerInstallationRequirementSchema.optional(),
|
|
4107
|
+
checkUpdates: z30.boolean().default(true)
|
|
4151
4108
|
});
|
|
4152
4109
|
var providerHealthSchema = z30.object({
|
|
4153
4110
|
status: z30.enum([
|