@case-framework/survey-assistant 0.8.0 → 0.9.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.
Files changed (114) hide show
  1. package/dist/{authoring-references-DbuOKerg.mjs → authoring-references-CmwLc_C8.mjs} +40 -32
  2. package/dist/authoring-references-CmwLc_C8.mjs.map +1 -0
  3. package/dist/capabilities-D55dq-fO.mjs +582 -0
  4. package/dist/capabilities-D55dq-fO.mjs.map +1 -0
  5. package/dist/capabilities-default.d.mts +4 -12
  6. package/dist/capabilities-default.d.mts.map +1 -1
  7. package/dist/capabilities-default.mjs +2 -2
  8. package/dist/capabilities-z95e1mti.d.mts +117 -0
  9. package/dist/capabilities-z95e1mti.d.mts.map +1 -0
  10. package/dist/{constants-B6HzpEsx.d.mts → constants-HL_klgJl.d.mts} +4 -4
  11. package/dist/{constants-B6HzpEsx.d.mts.map → constants-HL_klgJl.d.mts.map} +1 -1
  12. package/dist/{controller-proxy-DEeFl9IA.mjs → controller-proxy-BQ1YsVxJ.mjs} +4 -3
  13. package/dist/controller-proxy-BQ1YsVxJ.mjs.map +1 -0
  14. package/dist/{controller-proxy-D7uQfm5f.d.mts → controller-proxy-Cmzdr9tV.d.mts} +4 -4
  15. package/dist/{controller-proxy-D7uQfm5f.d.mts.map → controller-proxy-Cmzdr9tV.d.mts.map} +1 -1
  16. package/dist/default-D22AKTqE.mjs +233 -0
  17. package/dist/default-D22AKTqE.mjs.map +1 -0
  18. package/dist/{digest-C39WyAWG.d.mts → digest-FnTTDBq2.d.mts} +2 -2
  19. package/dist/digest-FnTTDBq2.d.mts.map +1 -0
  20. package/dist/digest.d.mts +1 -1
  21. package/dist/engine-D950TfvC.mjs +3098 -0
  22. package/dist/engine-D950TfvC.mjs.map +1 -0
  23. package/dist/engine.d.mts +4 -3
  24. package/dist/engine.mjs +3 -3
  25. package/dist/{index-WB5kfnz0.d.mts → index-B8TLBd1G.d.mts} +8 -6
  26. package/dist/index-B8TLBd1G.d.mts.map +1 -0
  27. package/dist/index-CaX3hZmr.d.mts +23813 -0
  28. package/dist/index-CaX3hZmr.d.mts.map +1 -0
  29. package/dist/{index-r5riv4md.d.mts → index-CeUlGkoU.d.mts} +27 -6
  30. package/dist/index-CeUlGkoU.d.mts.map +1 -0
  31. package/dist/{index-D7wT6P3t.d.mts → index-DYHdvSE8.d.mts} +83 -41
  32. package/dist/index-DYHdvSE8.d.mts.map +1 -0
  33. package/dist/lifecycle-DFzxVxpq.d.mts +54346 -0
  34. package/dist/lifecycle-DFzxVxpq.d.mts.map +1 -0
  35. package/dist/{memory-thread-repository-DAnOGIB3.mjs → memory-thread-repository-DmLadygY.mjs} +15 -9
  36. package/dist/{memory-thread-repository-DAnOGIB3.mjs.map → memory-thread-repository-DmLadygY.mjs.map} +1 -1
  37. package/dist/protocol-BQ7uIDYT.mjs +569 -0
  38. package/dist/protocol-BQ7uIDYT.mjs.map +1 -0
  39. package/dist/protocol.d.mts +4 -4
  40. package/dist/protocol.mjs +3 -2
  41. package/dist/{react-C_GY-Fsc.mjs → react-DybJ5pWw.mjs} +17 -11
  42. package/dist/react-DybJ5pWw.mjs.map +1 -0
  43. package/dist/react-integration.d.mts +1 -1
  44. package/dist/react-integration.mjs +1 -1
  45. package/dist/react.d.mts +2 -2
  46. package/dist/react.mjs +2 -2
  47. package/dist/references/assistant-operations.md +190 -215
  48. package/dist/references/core-rules.md +2 -2
  49. package/dist/references/element-types.md +189 -0
  50. package/dist/references/expressions.md +215 -238
  51. package/dist/references/follow-ups.md +151 -0
  52. package/dist/references/localization.md +26 -12
  53. package/dist/references/response-variables.md +3 -3
  54. package/dist/references/rich-text-content.md +22 -43
  55. package/dist/references/source-material-surveys.md +20 -25
  56. package/dist/references/survey-data-model.md +36 -117
  57. package/dist/{request-context-Dg4jSwN1.mjs → request-context-KVh8VjgH.mjs} +4 -4
  58. package/dist/request-context-KVh8VjgH.mjs.map +1 -0
  59. package/dist/server-agent.d.mts +28 -7
  60. package/dist/server-agent.d.mts.map +1 -1
  61. package/dist/server-agent.mjs +33 -25
  62. package/dist/server-agent.mjs.map +1 -1
  63. package/dist/server-runtime.d.mts +6 -5
  64. package/dist/server-runtime.d.mts.map +1 -1
  65. package/dist/server-runtime.mjs +3 -3
  66. package/dist/server-tasks.d.mts +1 -1
  67. package/dist/server-tasks.mjs +1 -1
  68. package/dist/server-tools.d.mts +1 -1
  69. package/dist/server-tools.mjs +1 -1
  70. package/dist/server.d.mts +7 -6
  71. package/dist/server.d.mts.map +1 -1
  72. package/dist/server.mjs +3 -3
  73. package/dist/{tasks-BZEiwgxA.mjs → tasks-Coh5N027.mjs} +16 -15
  74. package/dist/tasks-Coh5N027.mjs.map +1 -0
  75. package/dist/{tasks-B9h3LPam.d.mts → tasks-wb9M-bak.d.mts} +11 -11
  76. package/dist/{tasks-B9h3LPam.d.mts.map → tasks-wb9M-bak.d.mts.map} +1 -1
  77. package/dist/{thread-handlers-Bef0td9N.d.mts → thread-handlers-C3Iya92v.d.mts} +6 -5
  78. package/dist/thread-handlers-C3Iya92v.d.mts.map +1 -0
  79. package/dist/{tools-CEsv-WoO.mjs → tools-D0KBDolR.mjs} +435 -408
  80. package/dist/tools-D0KBDolR.mjs.map +1 -0
  81. package/dist/turn-survey-draft-B34lggSG.d.mts +185 -0
  82. package/dist/turn-survey-draft-B34lggSG.d.mts.map +1 -0
  83. package/dist/ui.d.mts +3 -3
  84. package/dist/ui.d.mts.map +1 -1
  85. package/dist/ui.mjs +35 -23
  86. package/dist/ui.mjs.map +1 -1
  87. package/package.json +7 -7
  88. package/dist/authoring-references-DbuOKerg.mjs.map +0 -1
  89. package/dist/capabilities-CmeeAjEc.d.mts +0 -192
  90. package/dist/capabilities-CmeeAjEc.d.mts.map +0 -1
  91. package/dist/capabilities-DCMA71PP.mjs +0 -58
  92. package/dist/capabilities-DCMA71PP.mjs.map +0 -1
  93. package/dist/controller-proxy-DEeFl9IA.mjs.map +0 -1
  94. package/dist/default-fhSon2RM.mjs +0 -760
  95. package/dist/default-fhSon2RM.mjs.map +0 -1
  96. package/dist/digest-C39WyAWG.d.mts.map +0 -1
  97. package/dist/engine-nXoCWYpQ.mjs +0 -6888
  98. package/dist/engine-nXoCWYpQ.mjs.map +0 -1
  99. package/dist/index-Ciq7vHIs.d.mts +0 -716
  100. package/dist/index-Ciq7vHIs.d.mts.map +0 -1
  101. package/dist/index-D7wT6P3t.d.mts.map +0 -1
  102. package/dist/index-WB5kfnz0.d.mts.map +0 -1
  103. package/dist/index-r5riv4md.d.mts.map +0 -1
  104. package/dist/lifecycle-Dm8u7QFh.d.mts +0 -545
  105. package/dist/lifecycle-Dm8u7QFh.d.mts.map +0 -1
  106. package/dist/protocol-CF4Bh_Ch.mjs +0 -1255
  107. package/dist/protocol-CF4Bh_Ch.mjs.map +0 -1
  108. package/dist/react-C_GY-Fsc.mjs.map +0 -1
  109. package/dist/references/embedded-forms.md +0 -146
  110. package/dist/references/item-types.md +0 -641
  111. package/dist/request-context-Dg4jSwN1.mjs.map +0 -1
  112. package/dist/tasks-BZEiwgxA.mjs.map +0 -1
  113. package/dist/thread-handlers-Bef0td9N.d.mts.map +0 -1
  114. package/dist/tools-CEsv-WoO.mjs.map +0 -1
@@ -1 +0,0 @@
1
- {"version":3,"file":"default-fhSon2RM.mjs","names":[],"sources":["../src/capabilities/matrix-contracts.ts","../src/capabilities/default.ts"],"sourcesContent":["import { z } from \"zod\";\nimport { RESPONSE_VARIABLE_NAME_MAX_LENGTH } from \"@case-framework/survey-core\";\nimport type { ChoiceMatrixConfig } from \"@case-framework/survey-items/choice-matrix\";\nimport { jsonValueSchema } from \"../protocol/content\";\n\nconst id = z.string().regex(/^[a-zA-Z0-9_-]+$/);\nconst name = z\n .string()\n .max(RESPONSE_VARIABLE_NAME_MAX_LENGTH)\n .regex(/^[a-z][a-z0-9]*(?:_[a-z0-9]+)*$/)\n .describe(\n `Lowercase snake_case coding component. The complete derived response name, including prefix, row/column separators and score/sum suffixes, must also fit ${RESPONSE_VARIABLE_NAME_MAX_LENGTH} characters. Keep components short; IDs and labels are independent.`,\n );\nconst layout = z.enum([\"automatic\", \"stacked\", \"matrix\"]);\nconst nonScoring = z\n .strictObject({ id, code: z.string().optional() })\n .describe(\n \"One option object, never an array. No score: this answer is excluded from row scores and the sum. Its label is <id>.label, without options or trailingNonScoring prefixes.\",\n );\nexport const choiceMatrixConfigSchema = z.strictObject({\n id,\n prefix: name,\n sumSlotId: id,\n rows: z.array(\n z.strictObject({ id, scoreSlotId: id, rowName: name, required: z.boolean().optional() }),\n ),\n options: z.array(\n z.strictObject({ id, code: z.string().optional(), score: z.number().optional() }),\n ),\n leadingNonScoring: nonScoring.optional(),\n trailingNonScoring: nonScoring.optional(),\n layout,\n bipolar: z.boolean().optional(),\n rowLabelPosition: z.enum([\"beside\", \"above\"]).optional(),\n stackingBreakpoint: z.number().positive().optional(),\n}) satisfies z.ZodType<ChoiceMatrixConfig>;\n\nconst validation = z.strictObject({\n id,\n type: z.enum([\n \"integer\",\n \"min\",\n \"max\",\n \"minLength\",\n \"maxLength\",\n \"pattern\",\n \"minDate\",\n \"maxDate\",\n \"mustBeTrue\",\n ]),\n value: z.union([z.number(), z.string()]).optional(),\n valueExpression: jsonValueSchema\n .optional()\n .describe(\"Canonical date-valued expression for a date bound; load expressions guidance.\"),\n message: z.string().optional(),\n});\nconst rules = { required: z.boolean().optional(), validations: z.array(validation) };\nexport const formMatrixFieldSchema = z.discriminatedUnion(\"type\", [\n z.strictObject({ type: z.literal(\"text\"), ...rules, multiline: z.boolean().optional() }),\n z.strictObject({\n type: z.literal(\"number\"),\n ...rules,\n step: z.number().positive().optional(),\n unit: z.string().optional(),\n }),\n z.strictObject({\n type: z.literal(\"date\"),\n ...rules,\n mode: z.enum([\"year\", \"year-month\", \"year-month-day\"]),\n }),\n z.strictObject({\n type: z.literal(\"dropdown\"),\n ...rules,\n options: z.array(z.strictObject({ id, code: z.string().min(1) })),\n }),\n z.strictObject({\n type: z.literal(\"boolean\"),\n ...rules,\n arrangement: z.enum([\"horizontal\", \"vertical\"]).optional(),\n }),\n z.strictObject({ type: z.literal(\"static\") }),\n z.strictObject({ type: z.literal(\"empty\") }),\n]);\nconst width = z.discriminatedUnion(\"mode\", [\n z.strictObject({ mode: z.literal(\"default\") }),\n z.strictObject({ mode: z.literal(\"fixed\"), pixels: z.number().min(48) }),\n z.strictObject({ mode: z.literal(\"fit\"), minPixels: z.number().min(48).optional() }),\n]);\nexport const formMatrixConfigSchema = z.strictObject({\n id,\n prefix: name,\n rows: z.array(z.strictObject({ id, rowName: name })),\n columns: z.array(\n z.strictObject({ id, columnName: name, field: formMatrixFieldSchema, width: width.optional() }),\n ),\n cells: z.array(\n z.strictObject({ id, rowId: id, columnId: id, override: formMatrixFieldSchema.optional() }),\n ),\n layout,\n stackingBreakpoint: z.number().positive().optional(),\n rowLabelWidth: width.optional(),\n});\nexport const getMatrixConfigSchema = (itemType: string) =>\n itemType === \"choiceMatrix\"\n ? choiceMatrixConfigSchema\n : itemType === \"formMatrix\"\n ? formMatrixConfigSchema\n : undefined;\n","import { getMatrixConfigSchema } from \"./matrix-contracts\";\nimport {\n getChoiceResponseSlotDefinitions,\n normalizeChoiceItemConfig,\n} from \"@case-framework/survey-items/choice\";\nimport {\n getFormResponseSlotDefinitions,\n normalizeFormItemConfig,\n} from \"@case-framework/survey-items/form\";\nimport { createConsentItemConfig } from \"@case-framework/survey-items/consent\";\nimport {\n ChoiceMatrixCore,\n createChoiceMatrixConfig,\n createChoiceMatrixPreset,\n getChoiceMatrixTranslationKeys,\n normalizeChoiceMatrixConfig,\n getChoiceMatrixConfigIssues,\n} from \"@case-framework/survey-items/choice-matrix\";\nimport {\n FormMatrixCore,\n createFormMatrixConfig,\n getFormMatrixTranslationKeys,\n normalizeFormMatrixConfig,\n getFormMatrixConfigIssues,\n} from \"@case-framework/survey-items/form-matrix\";\nimport type { AssistantContentSurface, AssistantItemTypeManifest } from \"../protocol\";\nimport { type RawSurveyItem } from \"@case-framework/survey-core\";\nimport {\n getConsentItemConfigIssues,\n getConsentResponseSlotDefinitions,\n normalizeConsentItemConfig,\n} from \"@case-framework/survey-items/consent\";\nimport { createChoiceItemConfig } from \"@case-framework/survey-items/choice\";\nimport {\n createSurveyAssistantCapabilities,\n type AssistantItemCapabilityAdapter,\n type AssistantItemInspection,\n} from \"../engine/capabilities\";\nimport {\n createFormItemConfig,\n isValidSimpleFormConfig,\n normalizeFormAuthoringConfig,\n} from \"@case-framework/survey-items/form\";\n\nconst COMMON_OPERATIONS = [\n \"create-item\",\n \"update-response-settings\",\n \"update-item-label\",\n \"update-item-color\",\n \"update-item-translation\",\n \"update-placed-image\",\n \"patch-item-config\",\n \"remove-item\",\n \"move-item\",\n \"survey-json-patch\",\n] satisfies AssistantItemTypeManifest[\"supportedOperations\"];\n\nconst QUESTION_CONTENT_SURFACES: AssistantContentSurface[] = [\n {\n key: \"title\",\n role: \"primary\",\n format: \"rich\",\n requiredOnCreate: true,\n aliases: [\"content\", \"label\", \"prompt\", \"question\", \"text\"],\n },\n {\n key: \"subtitle\",\n role: \"secondary\",\n format: \"rich\",\n aliases: [\"subheading\", \"subtext\"],\n },\n {\n key: \"topContent\",\n role: \"secondary\",\n format: \"rich\",\n aliases: [\"preContent\", \"preResponse\"],\n },\n {\n key: \"bottomContent\",\n role: \"secondary\",\n format: \"rich\",\n aliases: [\"postContent\", \"postResponse\"],\n },\n {\n key: \"cardFooter\",\n role: \"secondary\",\n format: \"rich\",\n aliases: [\"footer\"],\n },\n];\n\nconst FIELD_CONTENT_SURFACES: AssistantContentSurface[] = [\n \"label\",\n \"description\",\n \"error\",\n \"placeholder\",\n \"unit\",\n \"checkedLabel\",\n \"uncheckedLabel\",\n].map((key) => ({\n key: `fields.<fieldId>.${key}`,\n role: key === \"error\" ? \"validation\" : \"field\",\n format: \"rich\",\n pattern: true,\n}));\n\nconst createManifest = (\n manifest: Omit<AssistantItemTypeManifest, \"capabilityVersion\">,\n): AssistantItemTypeManifest => ({ capabilityVersion: \"2\", ...manifest });\n\nconst STRUCTURE_REFERENCE = {\n topic: \"item-types\",\n markdown:\n \"Groups are containers. Create a group without child ids, then create or move children through separate operations. Page breaks are standalone structural boundaries.\",\n};\nconst QUESTION_REFERENCE = {\n topic: \"item-types\",\n markdown:\n \"Question titles and supporting text are translations. Configuration stores response behavior; respondent-visible option and field labels use the declared dynamic content surfaces.\",\n};\n\nconst isRecord = (value: unknown): value is Record<string, unknown> =>\n typeof value === \"object\" && value !== null && !Array.isArray(value);\n\nconst withMaterializedConfig = (\n item: RawSurveyItem,\n defaults: Record<string, unknown>,\n): RawSurveyItem => ({\n ...item,\n config: {\n ...defaults,\n ...(isRecord(item.config) ? item.config : {}),\n },\n});\n\nconst materializeGroupCreate = (item: RawSurveyItem): RawSurveyItem =>\n withMaterializedConfig(item, { items: [], shuffleItems: false });\n\nconst materializeEmptyConfigCreate = (item: RawSurveyItem): RawSurveyItem =>\n withMaterializedConfig(item, {});\n\nconst materializeChoiceCreate = (item: RawSurveyItem): RawSurveyItem => {\n const config = isRecord(item.config) ? item.config : {};\n const defaults = createChoiceItemConfig(item.id);\n\n return normalizeEmbeddedFormAuthoringModes({\n ...item,\n config: {\n ...defaults,\n ...config,\n id: typeof config.id === \"string\" && config.id ? config.id : item.id,\n maxSelection: \"maxSelection\" in config ? config.maxSelection : defaults.maxSelection,\n shuffleOptions: \"shuffleOptions\" in config ? config.shuffleOptions : defaults.shuffleOptions,\n options: Array.isArray(config.options) ? config.options : defaults.options,\n },\n });\n};\n\nconst materializeFormCreate = (item: RawSurveyItem): RawSurveyItem => ({\n ...item,\n config: normalizeFormAuthoringConfig({\n ...createFormItemConfig(item.id),\n ...(isRecord(item.config) ? item.config : {}),\n }),\n});\n\nconst normalizeEmbeddedFormAuthoringModes = (item: RawSurveyItem): RawSurveyItem => {\n if (!isRecord(item.config) || !Array.isArray(item.config.options)) {\n return item;\n }\n\n return {\n ...item,\n config: {\n ...item.config,\n options: item.config.options.map((option) => {\n if (!isRecord(option) || !isRecord(option.embeddedForm)) {\n return option;\n }\n return {\n ...option,\n embeddedForm: normalizeFormAuthoringConfig(option.embeddedForm),\n };\n }),\n },\n };\n};\n\nconst getSimpleFormValidationIssues = (config: unknown, subject: string) =>\n isValidSimpleFormConfig(config)\n ? []\n : [\n {\n severity: \"error\" as const,\n code: \"invalid-simple-form-structure\",\n message: `${subject} with authoringMode \"simple\" must contain one single-column field group without group display behavior and exactly one supported field whose controller type matches the field type. Use authoringMode \"custom\" for any other structure.`,\n },\n ];\n\nexport const rootItemAssistantCapability: AssistantItemCapabilityAdapter = {\n manifest: createManifest({\n itemType: \"root\",\n displayName: \"Survey root\",\n description: \"The existing root container. A second root cannot be created.\",\n create: \"unsupported\",\n supportedOperations: [\"update-item-label\", \"update-item-color\"],\n contentSurfaces: [],\n referenceTopics: [\"survey-data-model\", \"item-types\"],\n }),\n};\n\nexport const groupItemAssistantCapability: AssistantItemCapabilityAdapter = {\n manifest: createManifest({\n itemType: \"group\",\n displayName: \"Group\",\n description: \"A structural container whose children are created as separate items.\",\n defaultItemKeyPrefix: \"group\",\n create: \"deterministic\",\n supportedOperations: [...COMMON_OPERATIONS, \"reorder-items\"],\n contentSurfaces: [\n {\n key: \"title\",\n role: \"primary\",\n format: \"rich\",\n aliases: [\"content\", \"label\", \"name\", \"text\"],\n },\n ],\n referenceTopics: [\"survey-data-model\", \"item-types\"],\n }),\n references: [STRUCTURE_REFERENCE],\n normalizeCreate: materializeGroupCreate,\n};\n\nexport const pageBreakItemAssistantCapability: AssistantItemCapabilityAdapter = {\n manifest: createManifest({\n itemType: \"page-break\",\n displayName: \"Page break\",\n description: \"A structural page boundary.\",\n defaultItemKeyPrefix: \"page\",\n create: \"deterministic\",\n supportedOperations: COMMON_OPERATIONS,\n contentSurfaces: [\n {\n key: \"title\",\n role: \"primary\",\n format: \"rich\",\n aliases: [\"content\", \"label\", \"name\", \"text\"],\n },\n ],\n referenceTopics: [\"survey-data-model\", \"item-types\"],\n }),\n references: [STRUCTURE_REFERENCE],\n normalizeCreate: materializeEmptyConfigCreate,\n};\n\nexport const infoItemAssistantCapability: AssistantItemCapabilityAdapter = {\n manifest: createManifest({\n itemType: \"infoItem\",\n displayName: \"Info\",\n description: \"Display-only formatted content without a response slot.\",\n defaultItemKeyPrefix: \"info\",\n create: \"deterministic\",\n supportedOperations: COMMON_OPERATIONS,\n contentSurfaces: [\n {\n key: \"content\",\n role: \"primary\",\n format: \"rich\",\n requiredOnCreate: true,\n aliases: [\"body\", \"label\", \"prompt\", \"question\", \"text\", \"title\"],\n },\n ],\n referenceTopics: [\"item-types\", \"rich-text-content\"],\n }),\n references: [\n {\n topic: \"rich-text-content\",\n markdown:\n \"Info content uses the rich `content` surface. Markdown strings are not parsed; send structured rich text when formatting matters.\",\n },\n ],\n normalizeCreate: materializeEmptyConfigCreate,\n};\n\nexport const choiceItemAssistantCapability: AssistantItemCapabilityAdapter = {\n manifest: createManifest({\n itemType: \"choiceItem\",\n displayName: \"Choice question\",\n description: \"A single- or multiple-choice question with optional embedded forms.\",\n defaultItemKeyPrefix: \"choice\",\n create: \"deterministic\",\n supportedOperations: [\n ...COMMON_OPERATIONS,\n \"add-choice-option\",\n \"update-choice-option-label\",\n \"remove-choice-option\",\n \"reorder-choice-options\",\n \"upsert-form-field-group\",\n \"remove-form-field-group\",\n \"reorder-form-field-groups\",\n \"upsert-form-field\",\n \"remove-form-field\",\n \"move-form-field\",\n \"set-embedded-form\",\n \"remove-embedded-form\",\n ],\n contentSurfaces: [\n ...QUESTION_CONTENT_SURFACES,\n {\n key: \"options.<optionId>.label\",\n role: \"option\",\n format: \"rich\",\n pattern: true,\n },\n ...FIELD_CONTENT_SURFACES.map((surface) => ({\n ...surface,\n key: `embeddedForms.<optionId>.${surface.key}`,\n })),\n {\n key: \"embeddedForms.<optionId>.fields.<fieldId>.options.<optionId>.label\",\n role: \"option\",\n format: \"rich\",\n pattern: true,\n },\n {\n key: \"embeddedForms.<optionId>.fields.<fieldId>.validations.<validationId>.message\",\n role: \"validation\",\n format: \"rich\",\n pattern: true,\n },\n {\n key: \"embeddedForms.<optionId>.fieldGroups.<groupId>.title\",\n role: \"field\",\n format: \"rich\",\n pattern: true,\n },\n {\n key: \"embeddedForms.<optionId>.fieldGroups.<groupId>.description\",\n role: \"field\",\n format: \"rich\",\n pattern: true,\n },\n ],\n responseSlots: [{ key: \"<responseId>\", valueType: \"reference|referenceArray\" }],\n referenceTopics: [\n \"item-types\",\n \"embedded-forms\",\n \"localization\",\n \"expressions\",\n \"rich-text-content\",\n ],\n authoring: {\n compactHint:\n \"presets choice.single=maxSelection 1; choice.multiple=maxSelection null; embedded one supported field=simple; embedded blank/structured=custom\",\n configSummary:\n \"Config stores id, maxSelection, shuffleOptions, and options. Put every initial option and inline embeddedForm in create-item config; choice option operations edit only choice items already present in the live snapshot. Default an eligible one-field embedded form to authoringMode simple; use custom for blank or structured follow-ups. Embedded field content uses embeddedForms.<choiceOption.id> (case-sensitive), never the option code or embeddedForm ID. Form layout values are column counts 1-4; one column makes a lone field full width.\",\n },\n }),\n references: [QUESTION_REFERENCE],\n normalizeCreate: materializeChoiceCreate,\n validateItem: (item) => {\n if (!isRecord(item.config) || !Array.isArray(item.config.options)) {\n return [];\n }\n const ids = item.config.options.filter(isRecord).map((option) => option.id);\n return [\n ...(new Set(ids).size === ids.length\n ? []\n : [\n {\n severity: \"error\" as const,\n code: \"duplicate-option-id\",\n message: \"Choice option IDs must be unique within the choice.\",\n },\n ]),\n ...item.config.options.flatMap((option) =>\n isRecord(option) && isRecord(option.embeddedForm)\n ? getSimpleFormValidationIssues(option.embeddedForm, \"An embedded form\")\n : [],\n ),\n ];\n },\n deriveResponseSlotDefinitions: (item) =>\n getChoiceResponseSlotDefinitions(normalizeChoiceItemConfig(item.config, item.id)),\n};\n\nexport const formItemAssistantCapability: AssistantItemCapabilityAdapter = {\n manifest: createManifest({\n itemType: \"formItem\",\n displayName: \"Form\",\n description: \"A form with groups, typed fields, validations, and select options.\",\n defaultItemKeyPrefix: \"form\",\n create: \"deterministic\",\n supportedOperations: [\n ...COMMON_OPERATIONS,\n \"upsert-form-field-group\",\n \"remove-form-field-group\",\n \"reorder-form-field-groups\",\n \"upsert-form-field\",\n \"remove-form-field\",\n \"move-form-field\",\n ],\n contentSurfaces: [\n ...QUESTION_CONTENT_SURFACES,\n {\n key: \"fieldGroups.<groupId>.title\",\n role: \"field\",\n format: \"rich\",\n pattern: true,\n },\n {\n key: \"fieldGroups.<groupId>.description\",\n role: \"field\",\n format: \"rich\",\n pattern: true,\n },\n ...FIELD_CONTENT_SURFACES,\n {\n key: \"fields.<fieldId>.options.<optionId>.label\",\n role: \"option\",\n format: \"rich\",\n pattern: true,\n },\n {\n key: \"fields.<fieldId>.validations.<validationId>.message\",\n role: \"validation\",\n format: \"rich\",\n pattern: true,\n },\n ],\n responseSlots: [{ key: \"<field.id>\", valueType: \"field-dependent\" }],\n referenceTopics: [\"item-types\", \"localization\", \"expressions\", \"rich-text-content\"],\n authoring: {\n compactHint:\n \"presets form.text=input|form.long-text=textarea|form.number=number|form.slider=slider|form.dropdown=select|form.date=datepicker|form.switch=switch; form.blank=custom\",\n configSummary:\n 'Config stores authoringMode and fieldGroups with typed fields. Use authoringMode \"simple\" only for exactly one internal group with exactly one field: text=input, long text=textarea, number=number, slider=slider, dropdown=select, date=datepicker, switch=switch. Use \"custom\" for blank or multi-field forms. Structural changes are a one-way transition to custom. The controller type must match the field type; full date uses datepicker/year-month-day. Layout values are column counts 1-4, not spans.',\n },\n }),\n references: [QUESTION_REFERENCE],\n normalizeCreate: materializeFormCreate,\n validateItem: (item) => getSimpleFormValidationIssues(item.config, \"A formItem\"),\n deriveResponseSlotDefinitions: (item) =>\n getFormResponseSlotDefinitions(normalizeFormItemConfig(item.config, item.id)),\n};\n\nexport const consentItemAssistantCapability: AssistantItemCapabilityAdapter = {\n manifest: createManifest({\n itemType: \"consentItem\",\n displayName: \"Consent\",\n description:\n \"An explicit agreement or refusal for one permission, with inline or dialog information.\",\n defaultItemKeyPrefix: \"consent\",\n create: \"deterministic\",\n supportedOperations: COMMON_OPERATIONS,\n contentSurfaces: [\n { key: \"title\", role: \"primary\", format: \"rich\", requiredOnCreate: true },\n { key: \"subtitle\", role: \"secondary\", format: \"rich\" },\n { key: \"consentTitle\", role: \"secondary\", format: \"rich\" },\n { key: \"consentSubtitle\", role: \"secondary\", format: \"rich\" },\n { key: \"consentBody\", role: \"secondary\", format: \"rich\", requiredOnCreate: true },\n { key: \"acceptLabel\", role: \"secondary\", format: \"plain\" },\n { key: \"declineLabel\", role: \"secondary\", format: \"plain\" },\n { key: \"unansweredLabel\", role: \"secondary\", format: \"plain\" },\n { key: \"acceptedLabel\", role: \"secondary\", format: \"plain\" },\n { key: \"declinedLabel\", role: \"secondary\", format: \"plain\" },\n { key: \"reviewLabel\", role: \"secondary\", format: \"plain\" },\n { key: \"changeLabel\", role: \"secondary\", format: \"plain\" },\n ],\n responseSlots: [{ key: \"<config.slotId>\", valueType: \"boolean\" }],\n referenceTopics: [\"item-types\", \"expressions\", \"localization\", \"rich-text-content\"],\n authoring: {\n compactHint:\n \"consent.default; inherits title/subtitle. consentTitle overrides title; subtitleMode=inherit|custom|none, custom uses consentSubtitle. consentBody=actual terms. Preserve terms; otherwise draft and report gaps.\",\n configSummary:\n \"Config: presentation=inline|dialog (default inline); subtitleMode=inherit|custom|none (default inherit, all locales). Required question title and consentBody; optional subtitle. Consent inherits headings without repeating them locally; dialog shows both. Rich consentTitle overrides title per locale; empty inherits. custom uses rich consentSubtitle; empty stays absent. none hides only the consent subtitle. Question subtitle stays visible. Body contains actual terms, not a document description; avoid repeated headings. Preserve supplied terms. Otherwise draft proactively and report assumptions/gaps afterward. Plain acceptLabel/declineLabel, unansweredLabel/acceptedLabel/declinedLabel, reviewLabel/changeLabel override UI defaults. Generic close/fallback messages use host localization. accepted: true=agree, false=decline, absent=unanswered. Standard prefills apply. Dependent display conditions retain hidden answers in-session but omit submission. No required setting/navigation enforcement.\",\n },\n }),\n references: [\n {\n topic: \"item-types\",\n markdown:\n \"Consent records a boolean decision in the persistent config.slotId. Inspect its slot ID and use a structured responseVariable reference with method get: eq with true means agreement, false means refusal; method isDefined tests either decision. Unanswered is not refusal. Set a display condition on dependent items or groups to hide them; this retains existing session answers but omits hidden items from submission. Use the standard item-level prefills contract for existing responses; config has no required setting or effects list. Use info for documents without a decision.\",\n },\n ],\n normalizeCreate: (item) => ({\n ...item,\n config: { ...createConsentItemConfig(), ...(isRecord(item.config) ? item.config : {}) },\n }),\n validateItem: (item) =>\n getConsentItemConfigIssues(item.config).map((message) => ({\n severity: \"error\" as const,\n code: \"invalid-consent-item\",\n message,\n })),\n deriveResponseSlotDefinitions: (item) =>\n getConsentResponseSlotDefinitions(normalizeConsentItemConfig(item.config)),\n inspectItem: (item): AssistantItemInspection => {\n const issues = getConsentItemConfigIssues(item.config);\n if (issues.length)\n return { summary: \"Consent configuration needs repair.\", details: { issues } };\n const config = normalizeConsentItemConfig(item.config);\n return {\n summary: `Consent: ${config.presentation} information; one agreement or refusal.`,\n details: {\n presentation: config.presentation,\n subtitleMode: config.subtitleMode,\n responseSlot: config.slotId,\n },\n };\n },\n};\n\nconst matrixCapability = (\n itemType: \"choiceMatrix\" | \"formMatrix\",\n): AssistantItemCapabilityAdapter => {\n const choice = itemType === \"choiceMatrix\";\n return {\n manifest: createManifest({\n itemType,\n displayName: choice ? \"Choice matrix\" : \"Form matrix\",\n create: \"deterministic\",\n supportedOperations: COMMON_OPERATIONS,\n contentSurfaces: [\n ...QUESTION_CONTENT_SURFACES,\n ...[\n \"label\",\n \"message\",\n \"description\",\n \"placeholder\",\n \"unit\",\n \"startLabel\",\n \"endLabel\",\n \"yesLabel\",\n \"noLabel\",\n \"content\",\n ].map((key) => ({\n key: `<componentId>.${key}`,\n role: \"field\" as const,\n format: \"rich\" as const,\n pattern: true,\n })),\n ],\n referenceTopics: [\"item-types\", \"expressions\", \"response-variables\"],\n authoring: {\n compactHint: choice\n ? \"create-item presetId: choiceMatrix.yesNo (Yes/No), choiceMatrix.fivePoint (5-point), choiceMatrix.sevenPoint (7-point), choiceMatrix.bipolarFive (5-point bipolar). Non-scoring: ONE object {id,code?}, label <id>.label.\"\n : \"Form matrix: column field defaults; cell overrides. Add/remove rows or columns AND their cells in one patch. Load item-types for exact fields, validation, content inheritance and layout.\",\n configSummary: choice\n ? \"Config: id, prefix, sumSlotId, rows [{id,scoreSlotId,rowName,required?}], options [{id,code,score?}], layout automatic|stacked|matrix. IDs persist; codes and scores are separate. Optional leadingNonScoring/trailingNonScoring. Translate <rowId>.label and <optionId>.label; bipolar endpoints <config.id>.startLabel/endLabel. Inspect declared stored and computed slots; never construct score IDs.\"\n : \"Config: id, prefix, rows [{id,rowName}], columns [{id,columnName,field}], cells [{id,rowId,columnId,override?}], layout automatic|stacked|matrix. Include every row/column cell. Field types text, number, date (mode year|year-month|year-month-day), dropdown (options [{id,code}]), boolean, static, empty. Translate <componentId>.label. Cell IDs are response IDs; variable names derive from prefix/row/column. No individual cell names or headers.\",\n },\n }),\n configurationSchema: getMatrixConfigSchema(itemType),\n materializePreset: choice\n ? (presetId, locale) => {\n const presets = {\n \"choiceMatrix.yesNo\": \"yesNo\",\n \"choiceMatrix.fivePoint\": \"fivePoint\",\n \"choiceMatrix.sevenPoint\": \"sevenPoint\",\n \"choiceMatrix.bipolarFive\": \"bipolarFive\",\n } as const;\n if (!Object.hasOwn(presets, presetId))\n throw new Error(`Unknown choice matrix preset: ${presetId}`);\n const preset = createChoiceMatrixPreset(\n presets[presetId as keyof typeof presets],\n locale,\n );\n // User-authored rows remain explicit: toolbox placeholder rows have no labels.\n return {\n config: { ...preset.config, rows: [] },\n translations: Object.entries(preset.translations.getAllForLocale(locale) ?? {}).map(\n ([contentKey, content]) => ({ locale, contentKey, content }),\n ),\n };\n }\n : undefined,\n normalizeCreate: (item) => ({\n ...item,\n config: {\n ...(choice ? createChoiceMatrixConfig() : createFormMatrixConfig()),\n ...(isRecord(item.config) ? item.config : {}),\n },\n }),\n requiredCreateContentKeys: (item) => {\n if (choice) {\n const config = normalizeChoiceMatrixConfig(item.config);\n return [\n ...config.rows,\n ...config.options,\n ...[config.leadingNonScoring, config.trailingNonScoring].filter(\n (entry): entry is NonNullable<typeof entry> => !!entry,\n ),\n ].map((entry) => `${entry.id}.label`);\n }\n const config = normalizeFormMatrixConfig(item.config);\n const fields = [\n ...config.columns.map((column) => column.field),\n ...config.cells.flatMap((cell) => (cell.override ? [cell.override] : [])),\n ];\n return [\n ...config.rows,\n ...config.columns,\n ...fields.flatMap((field) => (field.type === \"dropdown\" ? field.options : [])),\n ].map((entry) => `${entry.id}.label`);\n },\n validContentKeys: (item) => [\n ...QUESTION_CONTENT_SURFACES.map((surface) => surface.key),\n ...(choice\n ? getChoiceMatrixTranslationKeys(normalizeChoiceMatrixConfig(item.config))\n : getFormMatrixTranslationKeys(normalizeFormMatrixConfig(item.config))),\n ],\n validateItem: (item) => {\n const result = getMatrixConfigSchema(itemType)!.safeParse(item.config);\n if (!result.success)\n return result.error.issues.map((issue) => ({\n severity: \"error\" as const,\n code: \"invalid-matrix\",\n message: `config.${issue.path.join(\".\") || \"(root)\"}: ${issue.message}`,\n }));\n try {\n return (\n choice\n ? getChoiceMatrixConfigIssues(normalizeChoiceMatrixConfig(item.config))\n : getFormMatrixConfigIssues(normalizeFormMatrixConfig(item.config))\n ).map((message) => ({ severity: \"error\" as const, code: \"invalid-matrix\", message }));\n } catch (error) {\n return [{ severity: \"error\", code: \"invalid-matrix\", message: String(error) }];\n }\n },\n deriveResponseSlotDefinitions: (item) =>\n (choice ? new ChoiceMatrixCore(item) : new FormMatrixCore(item)).getResponseSlotDefinitions(),\n inspectItem: (item) => ({\n summary: choice\n ? \"Choice matrix with categorical row answers and declared computed scores.\"\n : \"Form matrix with independent cell answers.\",\n details: JSON.parse(JSON.stringify(item.config)),\n }),\n };\n};\nexport const choiceMatrixAssistantCapability = matrixCapability(\"choiceMatrix\");\nexport const formMatrixAssistantCapability = matrixCapability(\"formMatrix\");\n\nexport const defaultSurveyAssistantCapabilities = [\n rootItemAssistantCapability,\n groupItemAssistantCapability,\n pageBreakItemAssistantCapability,\n infoItemAssistantCapability,\n choiceItemAssistantCapability,\n formItemAssistantCapability,\n consentItemAssistantCapability,\n choiceMatrixAssistantCapability,\n formMatrixAssistantCapability,\n] as const;\n\nexport const defaultSurveyAssistantCapabilitySet = createSurveyAssistantCapabilities(\n defaultSurveyAssistantCapabilities,\n);\n\nexport const getDefaultSurveyAssistantCapability = (\n itemType: string,\n): AssistantItemCapabilityAdapter | undefined =>\n defaultSurveyAssistantCapabilitySet.byItemType.get(itemType);\n"],"mappings":";;;;;;;;;;AAKA,MAAM,KAAK,EAAE,OAAO,CAAC,CAAC,MAAM,kBAAkB;AAC9C,MAAM,OAAO,EACV,OAAO,CAAC,CACR,IAAI,iCAAiC,CAAC,CACtC,MAAM,iCAAiC,CAAC,CACxC,SACC,4JAA4J,kCAAkC,oEAChM;AACF,MAAM,SAAS,EAAE,KAAK;CAAC;CAAa;CAAW;AAAQ,CAAC;AACxD,MAAM,aAAa,EAChB,aAAa;CAAE;CAAI,MAAM,EAAE,OAAO,CAAC,CAAC,SAAS;AAAE,CAAC,CAAC,CACjD,SACC,4KACF;AACF,MAAa,2BAA2B,EAAE,aAAa;CACrD;CACA,QAAQ;CACR,WAAW;CACX,MAAM,EAAE,MACN,EAAE,aAAa;EAAE;EAAI,aAAa;EAAI,SAAS;EAAM,UAAU,EAAE,QAAQ,CAAC,CAAC,SAAS;CAAE,CAAC,CACzF;CACA,SAAS,EAAE,MACT,EAAE,aAAa;EAAE;EAAI,MAAM,EAAE,OAAO,CAAC,CAAC,SAAS;EAAG,OAAO,EAAE,OAAO,CAAC,CAAC,SAAS;CAAE,CAAC,CAClF;CACA,mBAAmB,WAAW,SAAS;CACvC,oBAAoB,WAAW,SAAS;CACxC;CACA,SAAS,EAAE,QAAQ,CAAC,CAAC,SAAS;CAC9B,kBAAkB,EAAE,KAAK,CAAC,UAAU,OAAO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