@case-framework/survey-assistant 0.7.0 → 0.8.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/README.md +58 -3
- package/dist/{attachments-B0hg3vpT.mjs → attachments-BuNni5vB.mjs} +1 -1
- package/dist/{attachments-B0hg3vpT.mjs.map → attachments-BuNni5vB.mjs.map} +1 -1
- package/dist/{authoring-references-BJQ_1nMX.mjs → authoring-references-DbuOKerg.mjs} +12 -3
- package/dist/authoring-references-DbuOKerg.mjs.map +1 -0
- package/dist/{capabilities-DVTfogjv.d.mts → capabilities-CmeeAjEc.d.mts} +3 -4
- package/dist/capabilities-CmeeAjEc.d.mts.map +1 -0
- package/dist/{capabilities-1KNnNO1_.mjs → capabilities-DCMA71PP.mjs} +4 -19
- package/dist/capabilities-DCMA71PP.mjs.map +1 -0
- package/dist/capabilities-default.d.mts +13 -12
- package/dist/capabilities-default.d.mts.map +1 -1
- package/dist/capabilities-default.mjs +2 -411
- package/dist/{constants-Be91Gay9.d.mts → constants-B6HzpEsx.d.mts} +7 -28
- package/dist/constants-B6HzpEsx.d.mts.map +1 -0
- package/dist/{constants-0UHGFcRJ.mjs → constants-Ct-vv9cu.mjs} +1 -1
- package/dist/{constants-0UHGFcRJ.mjs.map → constants-Ct-vv9cu.mjs.map} +1 -1
- package/dist/controller-proxy-D7uQfm5f.d.mts +65 -0
- package/dist/controller-proxy-D7uQfm5f.d.mts.map +1 -0
- package/dist/{controller-proxy-BH05e-C2.mjs → controller-proxy-DEeFl9IA.mjs} +10 -20
- package/dist/controller-proxy-DEeFl9IA.mjs.map +1 -0
- package/dist/default-fhSon2RM.mjs +760 -0
- package/dist/default-fhSon2RM.mjs.map +1 -0
- package/dist/{digest-SJmoYVaK.d.mts → digest-C39WyAWG.d.mts} +2 -3
- package/dist/digest-C39WyAWG.d.mts.map +1 -0
- package/dist/digest.d.mts +1 -1
- package/dist/digest.mjs.map +1 -1
- package/dist/{engine-Bo85Oyj0.mjs → engine-nXoCWYpQ.mjs} +755 -590
- package/dist/engine-nXoCWYpQ.mjs.map +1 -0
- package/dist/engine.d.mts +3 -3
- package/dist/engine.mjs +3 -3
- package/dist/{fair-guidance-CRYCRxQm.mjs → fair-guidance-BmO4PswW.mjs} +1 -1
- package/dist/{fair-guidance-CRYCRxQm.mjs.map → fair-guidance-BmO4PswW.mjs.map} +1 -1
- package/dist/{index-Tnqv-yKW.d.mts → index-Ciq7vHIs.d.mts} +80 -141
- package/dist/index-Ciq7vHIs.d.mts.map +1 -0
- package/dist/{index-nhrgbgO5.d.mts → index-D7wT6P3t.d.mts} +277 -60
- package/dist/index-D7wT6P3t.d.mts.map +1 -0
- package/dist/{index-l_EK4yK7.d.mts → index-WB5kfnz0.d.mts} +15 -71
- package/dist/index-WB5kfnz0.d.mts.map +1 -0
- package/dist/{index-x0qprHgK.d.mts → index-r5riv4md.d.mts} +33 -24
- package/dist/index-r5riv4md.d.mts.map +1 -0
- package/dist/{lifecycle-Bx0aq_4S.d.mts → lifecycle-Dm8u7QFh.d.mts} +34 -18
- package/dist/lifecycle-Dm8u7QFh.d.mts.map +1 -0
- package/dist/{memory-thread-repository-KWHQWFEW.mjs → memory-thread-repository-DAnOGIB3.mjs} +51 -27
- package/dist/memory-thread-repository-DAnOGIB3.mjs.map +1 -0
- package/dist/{protocol-BhzQbx81.mjs → protocol-CF4Bh_Ch.mjs} +118 -36
- package/dist/protocol-CF4Bh_Ch.mjs.map +1 -0
- package/dist/protocol.d.mts +4 -4
- package/dist/protocol.mjs +3 -3
- package/dist/{react-B3ybjJ-X.mjs → react-C_GY-Fsc.mjs} +146 -39
- package/dist/react-C_GY-Fsc.mjs.map +1 -0
- package/dist/react-integration.d.mts +2 -2
- package/dist/react-integration.mjs +2 -2
- package/dist/react.d.mts +3 -3
- package/dist/react.mjs +3 -3
- package/dist/references/assistant-operations.md +100 -31
- package/dist/references/core-rules.md +6 -3
- package/dist/references/embedded-forms.md +34 -14
- package/dist/references/expressions.md +220 -58
- package/dist/references/fair-by-design.md +9 -9
- package/dist/references/item-types.md +305 -71
- package/dist/references/response-variables.md +38 -0
- package/dist/references/source-material-surveys.md +4 -3
- package/dist/references/survey-data-model.md +23 -8
- package/dist/{request-context-CG4SWijt.mjs → request-context-Dg4jSwN1.mjs} +4 -10
- package/dist/request-context-Dg4jSwN1.mjs.map +1 -0
- package/dist/{request-guardrails-TmgQtqp4.mjs → request-guardrails-C0ugBOp0.mjs} +6 -5
- package/dist/request-guardrails-C0ugBOp0.mjs.map +1 -0
- package/dist/server-agent.d.mts +37 -39
- package/dist/server-agent.d.mts.map +1 -1
- package/dist/server-agent.mjs +45 -20
- package/dist/server-agent.mjs.map +1 -1
- package/dist/server-runtime.d.mts +23 -42
- package/dist/server-runtime.d.mts.map +1 -1
- package/dist/server-runtime.mjs +12 -12
- package/dist/server-runtime.mjs.map +1 -1
- package/dist/server-tasks.d.mts +2 -2
- package/dist/server-tasks.mjs +2 -313
- package/dist/server-tools.d.mts +1 -1
- package/dist/server-tools.mjs +1 -1
- package/dist/server.d.mts +13 -36
- package/dist/server.d.mts.map +1 -1
- package/dist/server.mjs +5 -5
- package/dist/server.mjs.map +1 -1
- package/dist/storage-postgres.d.mts +9 -25
- package/dist/storage-postgres.d.mts.map +1 -1
- package/dist/storage-postgres.mjs +5 -4
- package/dist/storage-postgres.mjs.map +1 -1
- package/dist/{tasks-CYqrcaRO.d.mts → tasks-B9h3LPam.d.mts} +18 -34
- package/dist/tasks-B9h3LPam.d.mts.map +1 -0
- package/dist/tasks-BZEiwgxA.mjs +396 -0
- package/dist/tasks-BZEiwgxA.mjs.map +1 -0
- package/dist/thread-documents-DrHbaXqP.d.mts +119 -0
- package/dist/thread-documents-DrHbaXqP.d.mts.map +1 -0
- package/dist/{thread-handlers-DBAaU7BA.d.mts → thread-handlers-Bef0td9N.d.mts} +8 -40
- package/dist/thread-handlers-Bef0td9N.d.mts.map +1 -0
- package/dist/{tools-BvSovehT.mjs → tools-CEsv-WoO.mjs} +296 -105
- package/dist/tools-CEsv-WoO.mjs.map +1 -0
- package/dist/ui.css +1 -1
- package/dist/ui.d.mts +15 -54
- package/dist/ui.d.mts.map +1 -1
- package/dist/ui.mjs +172 -137
- package/dist/ui.mjs.map +1 -1
- package/docs/integration.md +11 -1
- package/package.json +40 -35
- package/dist/authoring-references-BJQ_1nMX.mjs.map +0 -1
- package/dist/capabilities-1KNnNO1_.mjs.map +0 -1
- package/dist/capabilities-DVTfogjv.d.mts.map +0 -1
- package/dist/capabilities-default.mjs.map +0 -1
- package/dist/constants-Be91Gay9.d.mts.map +0 -1
- package/dist/controller-proxy-BH05e-C2.mjs.map +0 -1
- package/dist/controller-proxy-Bd0ZHBPF.d.mts +0 -85
- package/dist/controller-proxy-Bd0ZHBPF.d.mts.map +0 -1
- package/dist/digest-SJmoYVaK.d.mts.map +0 -1
- package/dist/engine-Bo85Oyj0.mjs.map +0 -1
- package/dist/index-Tnqv-yKW.d.mts.map +0 -1
- package/dist/index-l_EK4yK7.d.mts.map +0 -1
- package/dist/index-nhrgbgO5.d.mts.map +0 -1
- package/dist/index-x0qprHgK.d.mts.map +0 -1
- package/dist/lifecycle-Bx0aq_4S.d.mts.map +0 -1
- package/dist/memory-thread-repository-KWHQWFEW.mjs.map +0 -1
- package/dist/protocol-BhzQbx81.mjs.map +0 -1
- package/dist/react-B3ybjJ-X.mjs.map +0 -1
- package/dist/request-context-CG4SWijt.mjs.map +0 -1
- package/dist/request-guardrails-TmgQtqp4.mjs.map +0 -1
- package/dist/server-tasks.mjs.map +0 -1
- package/dist/tasks-CYqrcaRO.d.mts.map +0 -1
- package/dist/thread-documents-rmd6nyX9.d.mts +0 -107
- package/dist/thread-documents-rmd6nyX9.d.mts.map +0 -1
- package/dist/thread-handlers-DBAaU7BA.d.mts.map +0 -1
- package/dist/tools-BvSovehT.mjs.map +0 -1
|
@@ -79,6 +79,61 @@ const parseSurveyAssistantError = (value) => {
|
|
|
79
79
|
};
|
|
80
80
|
};
|
|
81
81
|
//#endregion
|
|
82
|
+
//#region src/protocol/response-settings.ts
|
|
83
|
+
const variableName = z.string().regex(/^[a-z][a-z0-9]*(?:_[a-z0-9]+)*$/).max(32);
|
|
84
|
+
const responseNamingEditSchema = z.union([z.object({
|
|
85
|
+
slotId: z.string().min(1),
|
|
86
|
+
variableName
|
|
87
|
+
}).strict(), z.object({
|
|
88
|
+
primitiveId: z.string().min(1),
|
|
89
|
+
prefix: variableName.optional(),
|
|
90
|
+
rows: z.record(z.string(), variableName).optional(),
|
|
91
|
+
columns: z.record(z.string(), variableName).optional()
|
|
92
|
+
}).strict()]);
|
|
93
|
+
const responseExportSettingsSchema = z.object({
|
|
94
|
+
mode: z.string().min(1),
|
|
95
|
+
include: z.boolean().optional(),
|
|
96
|
+
categorical: z.enum([
|
|
97
|
+
"codes",
|
|
98
|
+
"labels",
|
|
99
|
+
"ids"
|
|
100
|
+
]).optional(),
|
|
101
|
+
multiple: z.enum([
|
|
102
|
+
"json",
|
|
103
|
+
"delimited",
|
|
104
|
+
"indicators"
|
|
105
|
+
]).optional(),
|
|
106
|
+
delimiter: z.string().optional(),
|
|
107
|
+
locale: z.string().optional(),
|
|
108
|
+
optionCodes: z.record(z.string(), z.string()).optional(),
|
|
109
|
+
optionLabels: z.record(z.string(), z.string()).optional(),
|
|
110
|
+
booleanValues: z.object({
|
|
111
|
+
true: z.string(),
|
|
112
|
+
false: z.string()
|
|
113
|
+
}).optional(),
|
|
114
|
+
precision: z.number().int().nonnegative().optional(),
|
|
115
|
+
durationUnit: z.enum([
|
|
116
|
+
"seconds",
|
|
117
|
+
"minutes",
|
|
118
|
+
"hours",
|
|
119
|
+
"days",
|
|
120
|
+
"weeks",
|
|
121
|
+
"months",
|
|
122
|
+
"years"
|
|
123
|
+
]).optional(),
|
|
124
|
+
dateFormat: z.object({ pattern: z.string().min(1) }).optional(),
|
|
125
|
+
maskChar: z.string().optional()
|
|
126
|
+
}).strict();
|
|
127
|
+
const responseSettingsEditSchema = z.object({
|
|
128
|
+
slotId: z.string().min(1),
|
|
129
|
+
optionCodes: z.record(z.string(), z.string().min(1)).optional(),
|
|
130
|
+
exportSettings: responseExportSettingsSchema.optional()
|
|
131
|
+
}).strict();
|
|
132
|
+
const responseSettingsChangesSchema = z.object({
|
|
133
|
+
naming: z.array(responseNamingEditSchema).max(200),
|
|
134
|
+
settings: z.array(responseSettingsEditSchema).max(200)
|
|
135
|
+
});
|
|
136
|
+
//#endregion
|
|
82
137
|
//#region src/protocol/content.ts
|
|
83
138
|
const jsonValueSchema = z.lazy(() => z.union([
|
|
84
139
|
z.string(),
|
|
@@ -246,8 +301,7 @@ const surveyContentSchema = z.discriminatedUnion("type", [
|
|
|
246
301
|
//#endregion
|
|
247
302
|
//#region src/protocol/operations.ts
|
|
248
303
|
const operationIdSchema = z.string().min(1).max(120).optional().describe("Optional client/model supplied id for correlating validation issues.");
|
|
249
|
-
const itemIdentifierSchema = z.string().min(1).max(240).describe("
|
|
250
|
-
const itemKeySchema = z.string().min(1).max(120).describe("New item key. It must be unique among siblings.");
|
|
304
|
+
const itemIdentifierSchema = z.string().min(1).max(240).describe("Exact stable survey item ID. Inspect editor names and breadcrumbs to discover the ID.");
|
|
251
305
|
const itemTranslationSchema = z.object({
|
|
252
306
|
locale: z.string().min(1).max(40),
|
|
253
307
|
contentKey: z.string().min(1).max(240).describe("Item translation content key, for example \"label\" or \"content\"."),
|
|
@@ -256,12 +310,11 @@ const itemTranslationSchema = z.object({
|
|
|
256
310
|
}).refine((translation) => translation.plainText !== void 0 !== (translation.content !== void 0), { message: "Provide exactly one of plainText or content for a translation." });
|
|
257
311
|
const choiceOptionInputSchema = z.object({
|
|
258
312
|
id: z.string().min(1).max(120).optional().describe("Optional stable option id. If omitted, the validator derives a unique id."),
|
|
259
|
-
|
|
313
|
+
code: z.string().min(1).max(120).optional().describe("Optional export code. If omitted, the validator derives a unique code."),
|
|
260
314
|
label: z.string().min(1).max(1e3).describe("Respondent-visible option label as a plain string. Do not pass a translation object here; add-choice-option creates the matching translation in its locale.")
|
|
261
315
|
});
|
|
262
316
|
const rawSurveyItemForCreateSchema = z.object({
|
|
263
317
|
id: z.string().min(1).max(120).optional(),
|
|
264
|
-
key: itemKeySchema,
|
|
265
318
|
itemType: z.string().min(1).max(120),
|
|
266
319
|
metadata: z.record(z.string(), z.string()).optional(),
|
|
267
320
|
config: z.unknown().optional().describe("Optional item-type config. For choiceItem, provide response options as config.options, for example [{ \"label\": \"Fuji\" }, { \"label\": \"Gala\" }]. Use config.maxSelection: 1 for single choice, null for unlimited multiple choice / select-all-that-apply, or a number greater than 1 for capped multiple choice. Put an inline embeddedForm directly on a new choice option; default an eligible one-field embeddedForm to authoringMode \"simple\" and use \"custom\" for blank or structured follow-ups. For formItem, use authoringMode \"simple\" only with one field group containing one field; use \"custom\" for blank or multi-field forms. The validator converts option labels into options.<optionId>.label translations."),
|
|
@@ -306,18 +359,13 @@ const createItemOperationSchema = z.object({
|
|
|
306
359
|
id: operationIdSchema,
|
|
307
360
|
kind: z.literal("create-item"),
|
|
308
361
|
target: z.object({
|
|
309
|
-
parentItemId: z.string().max(240).describe("
|
|
310
|
-
index: z.number().int().min(0).optional()
|
|
362
|
+
parentItemId: z.string().max(240).describe("Exact parent group item ID. Use the inspected root group ID for top-level items."),
|
|
363
|
+
index: z.number().int().min(0).optional().describe("Zero-based insertion index in the parent group. Omit to append; use 0 to insert first.")
|
|
311
364
|
}),
|
|
312
365
|
item: rawSurveyItemForCreateSchema,
|
|
366
|
+
presetId: z.string().min(1).max(120).optional().describe("Server-supported toolbox preset ID declared by the item capability. Materializes its configuration and translations; explicit item.config fields override defaults. Supply the remaining required content specified by the capability."),
|
|
313
367
|
translations: z.array(itemTranslationSchema).optional().describe("Operation-level item translations for visible content, for example [{ \"locale\": \"en\", \"contentKey\": \"title\", \"plainText\": \"Question text\" }]. Put this property inside the create-item operation beside target and item, never beside the survey_change operations array. For formatted content, the model interface accepts documented richTextBlocks shorthand and normalizes it to canonical content before validation. Form select/dropdown option labels must be translations at fields.<fieldId>.options.<optionId>.label.")
|
|
314
368
|
});
|
|
315
|
-
const updateItemKeyOperationSchema = z.object({
|
|
316
|
-
id: operationIdSchema,
|
|
317
|
-
kind: z.literal("update-item-key"),
|
|
318
|
-
itemId: itemIdentifierSchema,
|
|
319
|
-
key: itemKeySchema
|
|
320
|
-
});
|
|
321
369
|
const updateItemLabelOperationSchema = z.object({
|
|
322
370
|
id: operationIdSchema,
|
|
323
371
|
kind: z.literal("update-item-label"),
|
|
@@ -380,6 +428,7 @@ const patchItemConfigOperationSchema = z.object({
|
|
|
380
428
|
id: operationIdSchema,
|
|
381
429
|
kind: z.literal("patch-item-config"),
|
|
382
430
|
itemId: itemIdentifierSchema,
|
|
431
|
+
translations: z.array(itemTranslationSchema).max(200).optional().describe("Translations belonging to this configuration edit, applied atomically with it. Use the content keys declared by the item capability."),
|
|
383
432
|
patches: z.array(jsonPatchOperationSchema).min(1).max(100).describe("JSON Patch operations relative to this item's config root, for example [{ \"op\": \"replace\", \"path\": \"/max\", \"value\": 7 }]. Inspect the item first and do not include /surveyItems/<index>/config in these paths.")
|
|
384
433
|
});
|
|
385
434
|
const formTargetSchema = z.object({
|
|
@@ -389,7 +438,7 @@ const formTargetSchema = z.object({
|
|
|
389
438
|
const formTranslationsSchema = z.array(itemTranslationSchema).max(100).optional().describe("Translations written atomically with this form structure change. Put this property inside the form operation object, never beside the survey_change operations array. Content keys are relative to the form; embedded-form prefixes are added automatically.");
|
|
390
439
|
const formFieldInputSchema = z.object({
|
|
391
440
|
id: z.string().min(1).max(120),
|
|
392
|
-
|
|
441
|
+
variableName: z.string().min(1).max(32),
|
|
393
442
|
type: z.enum([
|
|
394
443
|
"input",
|
|
395
444
|
"textarea",
|
|
@@ -488,7 +537,7 @@ const updateChoiceOptionLabelOperationSchema = z.object({
|
|
|
488
537
|
id: operationIdSchema,
|
|
489
538
|
kind: z.literal("update-choice-option-label"),
|
|
490
539
|
itemId: itemIdentifierSchema,
|
|
491
|
-
optionId: z.string().min(1).max(240).describe("
|
|
540
|
+
optionId: z.string().min(1).max(240).describe("Exact persistent choice option ID; discover it through inspection."),
|
|
492
541
|
locale: z.string().min(1).max(40).optional(),
|
|
493
542
|
label: z.string().min(1).max(1e3).describe("New respondent-visible option label.")
|
|
494
543
|
});
|
|
@@ -496,13 +545,13 @@ const removeChoiceOptionOperationSchema = z.object({
|
|
|
496
545
|
id: operationIdSchema,
|
|
497
546
|
kind: z.literal("remove-choice-option"),
|
|
498
547
|
itemId: itemIdentifierSchema,
|
|
499
|
-
optionId: z.string().min(1).max(240).describe("
|
|
548
|
+
optionId: z.string().min(1).max(240).describe("Exact persistent choice option ID; discover it through inspection.")
|
|
500
549
|
});
|
|
501
550
|
const reorderChoiceOptionsOperationSchema = z.object({
|
|
502
551
|
id: operationIdSchema,
|
|
503
552
|
kind: z.literal("reorder-choice-options"),
|
|
504
553
|
itemId: itemIdentifierSchema,
|
|
505
|
-
optionIds: z.array(z.string().min(1).max(240)).min(1).max(100).describe("Complete desired order of existing choice options
|
|
554
|
+
optionIds: z.array(z.string().min(1).max(240)).min(1).max(100).describe("Complete desired order of existing choice options, using their exact persistent option IDs.")
|
|
506
555
|
});
|
|
507
556
|
const removeItemOperationSchema = z.object({
|
|
508
557
|
id: operationIdSchema,
|
|
@@ -516,7 +565,7 @@ const moveItemOperationSchema = z.object({
|
|
|
516
565
|
itemId: itemIdentifierSchema,
|
|
517
566
|
target: z.object({
|
|
518
567
|
parentItemId: itemIdentifierSchema,
|
|
519
|
-
index: z.number().int().min(0).optional()
|
|
568
|
+
index: z.number().int().min(0).optional().describe("Zero-based insertion index in the parent group. Omit to append; use 0 to insert first.")
|
|
520
569
|
}).describe("A different parent group and optional insertion index. Omit unchanged placements; use reorder-items for sibling order within the current parent.")
|
|
521
570
|
});
|
|
522
571
|
const reorderItemsOperationSchema = z.object({
|
|
@@ -610,7 +659,10 @@ const surveyPatchOperationSchema = z.object({
|
|
|
610
659
|
const asDiscriminable = (schema) => schema;
|
|
611
660
|
const surveyOperationSchemasByKind = {
|
|
612
661
|
"create-item": createItemOperationSchema,
|
|
613
|
-
"update-
|
|
662
|
+
"update-response-settings": responseSettingsChangesSchema.extend({
|
|
663
|
+
id: operationIdSchema,
|
|
664
|
+
kind: z.literal("update-response-settings")
|
|
665
|
+
}),
|
|
614
666
|
"update-item-label": updateItemLabelOperationSchema,
|
|
615
667
|
"update-item-color": updateItemColorOperationSchema,
|
|
616
668
|
"update-item-translation": updateItemTranslationOperationSchema,
|
|
@@ -660,7 +712,6 @@ const surveyValidationResultSchema = z.object({
|
|
|
660
712
|
const SURVEY_OPERATION_KINDS = Object.freeze(Object.keys(surveyOperationSchemasByKind));
|
|
661
713
|
const surveyJsonPatchOperationSchema = jsonPatchOperationSchema;
|
|
662
714
|
const surveyAssistantCreateItemOperationSchema = createItemOperationSchema;
|
|
663
|
-
const surveyAssistantUpdateItemKeyOperationSchema = updateItemKeyOperationSchema;
|
|
664
715
|
const surveyAssistantUpdateItemLabelOperationSchema = updateItemLabelOperationSchema;
|
|
665
716
|
const surveyAssistantUpdateItemColorOperationSchema = updateItemColorOperationSchema;
|
|
666
717
|
const surveyAssistantUpdateItemTranslationOperationSchema = updateItemTranslationOperationSchema;
|
|
@@ -737,9 +788,11 @@ const surveyEditorUIContextSchema = z.object({
|
|
|
737
788
|
"item-editor",
|
|
738
789
|
"preview-mode",
|
|
739
790
|
"translation-mode",
|
|
740
|
-
"asset-manager"
|
|
791
|
+
"asset-manager",
|
|
792
|
+
"response-data"
|
|
741
793
|
]),
|
|
742
794
|
selectedItemId: z.string().optional(),
|
|
795
|
+
responseSlotId: z.string().optional(),
|
|
743
796
|
selectedLocale: z.string().min(1),
|
|
744
797
|
focusItemId: z.string().optional(),
|
|
745
798
|
recentItemIds: z.array(z.string()).max(10).optional(),
|
|
@@ -773,12 +826,12 @@ const surveyEditorUIContextSchema = z.object({
|
|
|
773
826
|
});
|
|
774
827
|
const rawSurveyItemSchema = z.object({
|
|
775
828
|
id: z.string().min(1),
|
|
776
|
-
key: z.string().min(1),
|
|
777
829
|
itemType: z.string().min(1)
|
|
778
830
|
}).passthrough();
|
|
779
831
|
const rawSurveyTranslationsSchema = z.record(z.string(), z.object({ itemTranslations: z.record(z.string(), z.record(z.string(), surveyContentSchema)).optional() }).passthrough());
|
|
780
832
|
const rawSurveyDocumentSchema = z.object({
|
|
781
833
|
$schema: z.string().min(1),
|
|
834
|
+
schemaVersion: z.literal(2),
|
|
782
835
|
surveyItems: z.array(rawSurveyItemSchema).min(1),
|
|
783
836
|
translations: rawSurveyTranslationsSchema.optional()
|
|
784
837
|
}).passthrough();
|
|
@@ -834,14 +887,15 @@ const surveyAssistantKeySuggestionSchema = surveyAssistantSuggestedTextSchema.ex
|
|
|
834
887
|
category: surveyAssistantKeySuggestionCategorySchema,
|
|
835
888
|
rationale: z.string().optional()
|
|
836
889
|
});
|
|
837
|
-
const
|
|
890
|
+
const surveyAssistantSuggestResponseNameInputSchema = z.object({
|
|
838
891
|
itemId: z.string().min(1),
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
892
|
+
slotId: z.string().min(1),
|
|
893
|
+
draftName: z.string(),
|
|
894
|
+
currentName: z.string(),
|
|
895
|
+
existingNames: z.array(z.string()),
|
|
842
896
|
maxSuggestions: z.number().int().positive().optional()
|
|
843
897
|
});
|
|
844
|
-
const
|
|
898
|
+
const surveyAssistantSuggestResponseNameResultSchema = z.object({ suggestions: z.array(surveyAssistantKeySuggestionSchema) });
|
|
845
899
|
const surveyAssistantSuggestItemLabelInputSchema = z.object({
|
|
846
900
|
itemId: z.string().min(1),
|
|
847
901
|
draftLabel: z.string(),
|
|
@@ -863,8 +917,8 @@ const surveyAssistantTranslateContentInputSchema = z.object({
|
|
|
863
917
|
const surveyAssistantTranslateContentResultSchema = z.object({ translations: z.record(z.string(), z.record(z.string(), z.string())) });
|
|
864
918
|
const surveyAssistantTaskItemSummarySchema = z.object({
|
|
865
919
|
id: z.string().min(1),
|
|
866
|
-
|
|
867
|
-
|
|
920
|
+
editorName: z.string(),
|
|
921
|
+
breadcrumb: z.string(),
|
|
868
922
|
itemType: z.string().min(1),
|
|
869
923
|
itemLabel: z.string().optional(),
|
|
870
924
|
visibleText: z.array(z.object({
|
|
@@ -874,6 +928,11 @@ const surveyAssistantTaskItemSummarySchema = z.object({
|
|
|
874
928
|
})),
|
|
875
929
|
visibleTextTruncated: z.boolean()
|
|
876
930
|
});
|
|
931
|
+
const surveyAssistantSuggestResponseSettingsInputSchema = z.object({
|
|
932
|
+
slotIds: z.array(z.string().min(1)).min(1).max(200),
|
|
933
|
+
category: surveyAssistantKeySuggestionCategorySchema.default("fair")
|
|
934
|
+
});
|
|
935
|
+
const surveyAssistantSuggestResponseSettingsResultSchema = responseSettingsChangesSchema;
|
|
877
936
|
const namingRelationshipSchema = z.enum([
|
|
878
937
|
"sibling",
|
|
879
938
|
"same-type",
|
|
@@ -891,11 +950,14 @@ const surveyAssistantTaskContextSchema = z.object({
|
|
|
891
950
|
itemCount: z.number().int().nonnegative(),
|
|
892
951
|
selectedLocale: z.string().min(1)
|
|
893
952
|
}),
|
|
953
|
+
responseVariables: z.array(z.record(z.string(), z.unknown())).optional(),
|
|
954
|
+
existingVariableNames: z.array(z.string()).optional(),
|
|
955
|
+
responseOwners: z.array(z.record(z.string(), z.unknown())).optional(),
|
|
894
956
|
focus: z.object({
|
|
895
957
|
item: surveyAssistantTaskItemSummarySchema,
|
|
896
958
|
parent: surveyAssistantTaskItemSummarySchema.optional(),
|
|
897
959
|
ancestorPath: z.array(surveyAssistantTaskItemSummarySchema),
|
|
898
|
-
|
|
960
|
+
siblingNames: z.array(z.string()),
|
|
899
961
|
siblingItems: z.array(surveyAssistantTaskItemSummarySchema),
|
|
900
962
|
siblingItemCount: z.number().int().nonnegative(),
|
|
901
963
|
siblingItemsTruncated: z.boolean(),
|
|
@@ -942,8 +1004,13 @@ const taskRequestBase = {
|
|
|
942
1004
|
const surveyAssistantTaskRequestSchema = z.discriminatedUnion("taskId", [
|
|
943
1005
|
z.object({
|
|
944
1006
|
...taskRequestBase,
|
|
945
|
-
taskId: z.literal("suggest-
|
|
946
|
-
input:
|
|
1007
|
+
taskId: z.literal("suggest-response-settings"),
|
|
1008
|
+
input: surveyAssistantSuggestResponseSettingsInputSchema
|
|
1009
|
+
}),
|
|
1010
|
+
z.object({
|
|
1011
|
+
...taskRequestBase,
|
|
1012
|
+
taskId: z.literal("suggest-response-name"),
|
|
1013
|
+
input: surveyAssistantSuggestResponseNameInputSchema
|
|
947
1014
|
}),
|
|
948
1015
|
z.object({
|
|
949
1016
|
...taskRequestBase,
|
|
@@ -1020,9 +1087,23 @@ const surveyChangeSetSchema = z.object({
|
|
|
1020
1087
|
touchedItems: z.array(z.object({
|
|
1021
1088
|
itemId: z.string().min(1),
|
|
1022
1089
|
itemType: z.string().min(1),
|
|
1023
|
-
|
|
1024
|
-
|
|
1090
|
+
editorName: z.string().min(1),
|
|
1091
|
+
breadcrumb: z.string().min(1),
|
|
1025
1092
|
itemLabel: z.string().optional(),
|
|
1093
|
+
placement: z.object({
|
|
1094
|
+
parentItemId: z.string().min(1),
|
|
1095
|
+
index: z.number().int().nonnegative(),
|
|
1096
|
+
siblingCount: z.number().int().nonnegative(),
|
|
1097
|
+
previousItemId: z.string().min(1).optional(),
|
|
1098
|
+
nextItemId: z.string().min(1).optional(),
|
|
1099
|
+
shuffled: z.boolean()
|
|
1100
|
+
}).optional(),
|
|
1101
|
+
childOrder: z.object({
|
|
1102
|
+
itemIds: z.array(z.string().min(1)).max(16),
|
|
1103
|
+
total: z.number().int().nonnegative(),
|
|
1104
|
+
truncated: z.boolean(),
|
|
1105
|
+
shuffled: z.boolean()
|
|
1106
|
+
}).optional(),
|
|
1026
1107
|
translationCount: z.number().int().nonnegative(),
|
|
1027
1108
|
translations: z.array(z.object({
|
|
1028
1109
|
locale: z.string().min(1),
|
|
@@ -1032,7 +1113,8 @@ const surveyChangeSetSchema = z.object({
|
|
|
1032
1113
|
truncated: z.boolean()
|
|
1033
1114
|
})).max(12),
|
|
1034
1115
|
responseSlotCount: z.number().int().nonnegative(),
|
|
1035
|
-
responseSlots: z.array(z.string().min(1)).max(12)
|
|
1116
|
+
responseSlots: z.array(z.string().min(1)).max(12),
|
|
1117
|
+
responseVariables: z.array(z.unknown()).max(12).optional()
|
|
1036
1118
|
})).max(6),
|
|
1037
1119
|
truncated: z.boolean()
|
|
1038
1120
|
}).optional(),
|
|
@@ -1168,6 +1250,6 @@ const applyReceiptSchema = z.object({
|
|
|
1168
1250
|
});
|
|
1169
1251
|
const surveyAssistantDraftChangeEventSchema = surveyChangeSetSchema;
|
|
1170
1252
|
//#endregion
|
|
1171
|
-
export {
|
|
1253
|
+
export { addChoiceOptionOperationSchema as $, surveyAssistantTranslateContentResultSchema as A, surveyContentSchema as At, surveyAssistantProtocolVersionSchema as B, MAX_USER_ERROR_MESSAGE_LENGTH as Bt, surveyAssistantSuggestedTextSchema as C, surveyValidationIssueSchema as Ct, surveyAssistantTaskRequestSchema as D, updateItemLabelOperationSchema as Dt, surveyAssistantTaskItemSummarySchema as E, updateItemColorOperationSchema as Et, surveyAssistantThreadTranscriptSchema as F, isSurveyAssistantErrorRetryable as Ft, surveyEditorUIContextSchema as G, surveyAssistantSnapshotSchema as H, isSurveyAssistantSensitiveMetadataKey as Ht, updateSurveyAssistantThreadInputSchema as I, parseSurveyAssistantError as It, assistantItemCreateModeSchema as J, assistantContentSurfaceSchema as K, SURVEY_ASSISTANT_PROTOCOL_VERSION as L, serializeSurveyAssistantError as Lt, createSurveyAssistantThreadInputSchema as M, responseNamingEditSchema as Mt, surveyAssistantThreadListSchema as N, responseSettingsChangesSchema as Nt, surveyAssistantTranslateContentEntrySchema as O, updateItemTranslationOperationSchema as Ot, surveyAssistantThreadSchema as P, responseSettingsEditSchema as Pt, SURVEY_OPERATION_KINDS as Q, rawSurveyDocumentSchema as R, surveyAssistantErrorCodeSchema as Rt, surveyAssistantSuggestResponseSettingsResultSchema as S, surveyPatchOperationSchema as St, surveyAssistantTaskInvocationModeSchema as T, updateChoiceOptionLabelOperationSchema as Tt, surveyDocumentSnapshotSchema as U, redactSurveyAssistantDiagnosticSecrets as Ut, surveyAssistantSnapshotPayloadSchema as V, getSurveyAssistantEmbeddedBinaryMarker as Vt, surveyDocumentVersionSchema as W, sanitizeSurveyAssistantDiagnosticText as Wt, assistantResponseSlotSchema as X, assistantItemTypeManifestSchema as Y, surveyAssistantCapabilityManifestSchema as Z, surveyAssistantSuggestItemLabelInputSchema as _, surveyAssistantValidationIssueSchema as _t, surveyApplyStatusSchema as a, reorderChoiceOptionsOperationSchema as at, surveyAssistantSuggestResponseNameResultSchema as b, surveyOperationSchema as bt, surveyAssistantDraftChangeEventSchema as c, surveyAssistantOperationSchema as ct, surveyBatchApplyResultSchema as d, surveyAssistantReorderChoiceOptionsOperationSchema as dt, createItemOperationSchema as et, surveyChangeSetSchema as f, surveyAssistantSurveyJsonPatchOperationSchema as ft, surveyAssistantKeySuggestionSchema as g, surveyAssistantUpdateItemTranslationOperationSchema as gt, surveyAssistantKeySuggestionCategorySchema as h, surveyAssistantUpdateItemLabelOperationSchema as ht, surveyApplyResultSchema as i, removeItemOperationSchema as it, SURVEY_ASSISTANT_ATTACHMENT_PART_TYPE as j, responseExportSettingsSchema as jt, surveyAssistantTranslateContentInputSchema as k, jsonValueSchema as kt, surveyAssistantTurnFinalSchema as l, surveyAssistantRemoveChoiceOptionOperationSchema as lt, surveyAssistantModelOptionSchema as m, surveyAssistantUpdateItemColorOperationSchema as mt, SURVEY_ASSISTANT_TURN_FINAL_PART_TYPE as n, patchItemConfigOperationSchema as nt, surveyAssistantApplyOutcomeSchema as o, surveyAssistantAddChoiceOptionOperationSchema as ot, surveyAssistantModelCatalogSchema as p, surveyAssistantUpdateChoiceOptionLabelOperationSchema as pt, assistantItemAuthoringSchema as q, applyReceiptSchema as r, removeChoiceOptionOperationSchema as rt, surveyAssistantApplyPolicySchema as s, surveyAssistantCreateItemOperationSchema as st, SURVEY_ASSISTANT_TURN_FINAL_DATA_NAME as t, jsonPatchOperationSchema as tt, surveyAssistantTurnTerminationReasonSchema as u, surveyAssistantRemoveItemOperationSchema as ut, surveyAssistantSuggestItemLabelResultSchema as v, surveyAssistantValidationResultSchema as vt, surveyAssistantTaskContextSchema as w, surveyValidationResultSchema as wt, surveyAssistantSuggestResponseSettingsInputSchema as x, surveyOperationSchemasByKind as xt, surveyAssistantSuggestResponseNameInputSchema as y, surveyJsonPatchOperationSchema as yt, surveyAssistantDraftChangePreconditionSchema as z, surveyAssistantErrorInfoSchema as zt };
|
|
1172
1254
|
|
|
1173
|
-
//# sourceMappingURL=protocol-
|
|
1255
|
+
//# sourceMappingURL=protocol-CF4Bh_Ch.mjs.map
|