@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
@@ -0,0 +1 @@
1
+ {"version":3,"file":"capabilities-D55dq-fO.mjs","names":["richTextImageDimensionSchema"],"sources":["../src/protocol/response-settings.ts","../src/protocol/content.ts","../src/protocol/structure.ts","../src/protocol/operations.ts","../src/protocol/capabilities.ts"],"sourcesContent":["import { stringRecord } from \"@case-framework/survey-core/schema\";\nimport { z } from \"zod\";\nimport type { ResponseNamingEdit, ResponseSettingsEdit } from \"@case-framework/survey-core/editor\";\n\nconst variableName = z\n .string()\n .regex(/^[a-z][a-z0-9]*(?:_[a-z0-9]+)*$/)\n .max(32);\nexport const responseNamingEditSchema: z.ZodType<ResponseNamingEdit> = z.union([\n z.object({ slotId: z.string().min(1), variableName }).strict(),\n z\n .object({\n elementId: z.string().min(1),\n prefix: variableName.optional(),\n rows: stringRecord(z.string(), variableName).optional(),\n columns: stringRecord(z.string(), variableName).optional(),\n })\n .strict(),\n]);\nexport const responseExportSettingsSchema = z\n .object({\n mode: z.string().min(1),\n include: z.boolean().optional(),\n categorical: z.enum([\"codes\", \"labels\", \"ids\"]).optional(),\n multiple: z.enum([\"json\", \"delimited\", \"indicators\"]).optional(),\n delimiter: z.string().optional(),\n locale: z.string().optional(),\n optionCodes: stringRecord(z.string(), z.string()).optional(),\n optionLabels: stringRecord(z.string(), z.string()).optional(),\n booleanValues: z.object({ true: z.string(), false: z.string() }).optional(),\n precision: z.number().int().nonnegative().optional(),\n durationUnit: z\n .enum([\"seconds\", \"minutes\", \"hours\", \"days\", \"weeks\", \"months\", \"years\"])\n .optional(),\n dateFormat: z.object({ pattern: z.string().min(1) }).optional(),\n maskText: z.string().optional(),\n })\n .strict();\nexport const responseSettingsEditSchema: z.ZodType<ResponseSettingsEdit> = z\n .object({\n slotId: z.string().min(1),\n optionCodes: stringRecord(z.string(), z.string().min(1)).optional(),\n exportSettings: responseExportSettingsSchema.optional(),\n })\n .strict();\nexport const responseSettingsChangesSchema = z.object({\n naming: z.array(responseNamingEditSchema).max(200),\n settings: z.array(responseSettingsEditSchema).max(200),\n});\n","import { z } from \"zod\";\nimport type { Content } from \"@case-framework/survey-core\";\nimport { jsonValueSchema, stringRecord } from \"@case-framework/survey-core/schema\";\n\nexport { jsonValueSchema };\n\nconst contentAttributesSchema = stringRecord(z.string(), jsonValueSchema);\n\nconst richTextStyleSchema = z.object({\n weight: z.enum([\"strong\", \"normal\"]).optional(),\n italic: z.enum([\"italic\", \"normal\"]).optional(),\n underline: z.enum([\"underline\", \"none\"]).optional(),\n color: z.enum([\"primary\", \"accent\", \"default\"]).optional(),\n});\n\nconst richTextTextInlineSchema = z.object({\n type: z.literal(\"text\"),\n text: z.string().max(20_000),\n style: richTextStyleSchema.optional(),\n attrs: contentAttributesSchema.optional(),\n});\n\nconst richTextTemplateInlineSchema = z.object({\n type: z.literal(\"template\"),\n key: z.string().min(1).max(240),\n style: richTextStyleSchema.optional(),\n attrs: contentAttributesSchema.optional(),\n});\n\nconst richTextLineBreakInlineSchema = z.object({\n type: z.literal(\"lineBreak\"),\n attrs: contentAttributesSchema.optional(),\n});\n\nconst richTextLinkChildInlineSchema = z.discriminatedUnion(\"type\", [\n richTextTextInlineSchema,\n richTextTemplateInlineSchema,\n richTextLineBreakInlineSchema,\n]);\n\nconst richTextLinkInlineSchema = z.object({\n type: z.literal(\"link\"),\n href: z.string().min(1).max(2000),\n target: z.string().max(120).nullable().optional(),\n rel: z.string().max(240).nullable().optional(),\n title: z.string().max(1000).nullable().optional(),\n attrs: contentAttributesSchema.optional(),\n children: z.array(richTextLinkChildInlineSchema).max(200),\n});\n\nconst richTextInlineExtensionSchema = z.object({\n type: z.literal(\"inlineExtension\"),\n name: z.string().min(1).max(120),\n attrs: contentAttributesSchema.optional(),\n});\n\nconst richTextInlineSchema = z.discriminatedUnion(\"type\", [\n richTextTextInlineSchema,\n richTextTemplateInlineSchema,\n richTextLinkInlineSchema,\n richTextLineBreakInlineSchema,\n richTextInlineExtensionSchema,\n]);\n\nconst textAlignmentSchema = z.enum([\"left\", \"center\", \"right\", \"justify\"]);\n\nconst richTextParagraphBlockSchema = z.object({\n type: z.literal(\"paragraph\"),\n children: z.array(richTextInlineSchema).max(500),\n alignment: textAlignmentSchema.optional(),\n attrs: contentAttributesSchema.optional(),\n});\n\nconst richTextHeadingBlockSchema = z.object({\n type: z.literal(\"heading\"),\n level: z.union([z.literal(1), z.literal(2)], {\n error:\n \"Heading level must be the number 1 (section heading) or 2 (subsection heading); other levels are not supported.\",\n }),\n children: z.array(richTextInlineSchema).max(500),\n alignment: textAlignmentSchema.optional(),\n attrs: contentAttributesSchema.optional(),\n});\n\nconst richTextListItemBlockSchema = z.object({\n type: z.literal(\"listItem\"),\n children: z.array(richTextParagraphBlockSchema).max(100),\n attrs: contentAttributesSchema.optional(),\n});\n\nconst richTextBulletListBlockSchema = z.object({\n type: z.literal(\"bulletList\"),\n items: z.array(richTextListItemBlockSchema).max(100),\n attrs: contentAttributesSchema.optional(),\n});\n\nconst richTextImageDimensionSchema = z.union([\n z.object({ unit: z.literal(\"px\"), value: z.number().finite().nonnegative() }),\n z.object({ unit: z.literal(\"%\"), value: z.number().finite().nonnegative() }),\n]);\n\nconst richTextImageSourceSchema = z.discriminatedUnion(\"type\", [\n z.object({ type: z.literal(\"asset\"), assetId: z.string().min(1).max(240) }),\n z.object({ type: z.literal(\"external\"), url: z.string().min(1).max(2000) }),\n]);\n\nconst richTextImageBlockSchema = z.object({\n type: z.literal(\"image\"),\n source: richTextImageSourceSchema,\n alt: z.string().max(2000).optional(),\n caption: z.array(richTextParagraphBlockSchema).max(20).optional(),\n size: z\n .object({\n width: richTextImageDimensionSchema.optional(),\n height: richTextImageDimensionSchema.optional(),\n maxWidth: richTextImageDimensionSchema.optional(),\n maxHeight: richTextImageDimensionSchema.optional(),\n })\n .optional(),\n alignment: textAlignmentSchema.optional(),\n attrs: contentAttributesSchema.optional(),\n});\n\nconst richTextInfoBoxBlockSchema = z.object({\n type: z.literal(\"infoBox\"),\n tone: z.enum([\"info\", \"warning\"]).optional(),\n title: z.array(richTextInlineSchema).max(100).optional(),\n collapsible: z.boolean().optional(),\n defaultOpen: z.boolean().optional(),\n children: z.array(richTextParagraphBlockSchema).max(100),\n attrs: contentAttributesSchema.optional(),\n});\n\nconst richTextSeparatorBlockSchema = z.object({\n type: z.literal(\"separator\"),\n attrs: contentAttributesSchema.optional(),\n});\n\nconst richTextBlockExtensionSchema = z.object({\n type: z.literal(\"blockExtension\"),\n name: z.string().min(1).max(120),\n attrs: contentAttributesSchema.optional(),\n});\n\nconst richTextBlockSchema = z.discriminatedUnion(\"type\", [\n richTextParagraphBlockSchema,\n richTextHeadingBlockSchema,\n richTextBulletListBlockSchema,\n richTextImageBlockSchema,\n richTextInfoBoxBlockSchema,\n richTextSeparatorBlockSchema,\n richTextBlockExtensionSchema,\n]);\n\nexport const surveyContentSchema: z.ZodType<Content> = z.discriminatedUnion(\"type\", [\n z.object({ type: z.literal(\"md\"), content: z.string().max(20_000) }),\n z.object({ type: z.literal(\"plain\"), content: z.string().max(20_000) }),\n z.object({\n type: z.literal(\"richText\"),\n version: z.literal(1),\n doc: z.object({\n type: z.literal(\"doc\"),\n blocks: z.array(richTextBlockSchema).max(200),\n }),\n }),\n]) as z.ZodType<Content>;\n\nexport type SurveyContent = z.infer<typeof surveyContentSchema>;\nexport type JsonValue = z.infer<typeof jsonValueSchema>;\n","import { elementShape, stringRecord } from \"@case-framework/survey-core/schema\";\nimport { z } from \"zod\";\nimport { jsonValueSchema } from \"./content\";\n/** Envelope only: executable registry definitions validate custom configuration at the receiver. */\nexport const elementTransportSchema = z.strictObject({\n ...elementShape,\n elementType: z\n .string()\n .min(1)\n .describe(\n \"Exact type from the active element registry. Load the capability schema before authoring unfamiliar configuration.\",\n ),\n config: stringRecord(z.string(), jsonValueSchema).describe(\n \"Type-specific configuration validated by the registered schema, not an arbitrary extension bag. Preserve persistent IDs and use update-response-settings for coding edits.\",\n ),\n});\n","import type { JsonPatchOperation as CoreJsonPatchOperation } from \"@case-framework/survey-core\";\nimport { z } from \"zod\";\nimport {\n createCompositionSchema,\n createFlowItemSchema,\n richTextImageDimensionSchema,\n layoutPolicySchema,\n SURVEY_LOCALIZATION_SURFACES,\n stringRecord,\n} from \"@case-framework/survey-core/schema\";\nimport { SURVEY_EDITOR_ITEM_COLORS } from \"@case-framework/survey-core/editor/colors\";\nimport { responseSettingsChangesSchema } from \"./response-settings\";\nimport { elementTransportSchema } from \"./structure\";\nimport { jsonValueSchema, surveyContentSchema } from \"./content\";\n\nconst identity = z\n .string()\n .min(1)\n .max(240)\n .describe(\"Exact persistent ID from current inspection; never a displayed label.\");\nconst locale = z\n .string()\n .trim()\n .min(1)\n .max(40)\n .describe(\n \"Actual respondent locale code, such as en, de or nl. Copy an existing code exactly; a translation in a new code introduces a new survey language.\",\n );\nconst base = {\n id: z\n .string()\n .min(1)\n .max(120)\n .optional()\n .describe(\"Optional operation tracking ID, not an item, element or response ID.\"),\n};\nconst index = z\n .number()\n .int()\n .nonnegative()\n .optional()\n .describe(\n \"Zero-based insertion position in the current target list. Omit to append; 0 inserts first. Inspect the list before specifying an index.\",\n );\nconst flowTarget = z.strictObject({\n parentItemId: identity.describe(\n \"Exact ID of the destination flow group, including the root group. Never an element or layout ID.\",\n ),\n index,\n});\nconst layoutTarget = z.strictObject({\n layoutId: identity.describe(\n \"Exact ID of an existing layout group, including one inside a section or option follow-up.\",\n ),\n index,\n});\nconst ruleTransfer = z\n .enum([\"reject\", \"move-with-targets\"])\n .optional()\n .describe(\n \"Defaults to reject if a move crosses validation-rule ownership. Explicit move-with-targets is allowed only when every target of each affected rule moves together.\",\n );\nexport const localizationRefSchema = z.discriminatedUnion(\"scope\", [\n z.strictObject({\n scope: z.literal(\"content\"),\n ownerId: identity,\n role: z.string().min(1).max(240),\n }),\n z.strictObject({\n scope: z.literal(\"survey\"),\n surface: z.enum(SURVEY_LOCALIZATION_SURFACES),\n contentKey: z.string().min(1).max(240),\n }),\n]);\nconst contentWrite = {\n locale,\n plainText: z\n .string()\n .optional()\n .describe(\n \"Unformatted respondent wording, preserved as supplied. Use exactly one of plainText or content; Markdown syntax is not rendered formatting.\",\n ),\n content: surveyContentSchema\n .nullable()\n .optional()\n .describe(\n \"Canonical localized content, or null to clear this single surface. For structured formatting load rich-text-content; do not replace sibling translations.\",\n ),\n};\nconst exactlyOneContent = (value: { plainText?: string; content?: unknown }) =>\n (value.plainText !== undefined) !== (value.content !== undefined);\nconst contentRequired = {\n message: \"Provide exactly one of plainText or content; use content: null to clear.\",\n};\nexport const ownerTranslationSchema = z\n .strictObject({ ...contentWrite, ownerId: identity, role: z.string().min(1).max(240) })\n .refine(exactlyOneContent, contentRequired);\nconst translations = z\n .array(ownerTranslationSchema)\n .max(1000)\n .optional()\n .describe(\n \"Atomic respondent wording for exact content owner IDs and declared roles, in each requested locale. Include labels for new inputs/options and preserve existing languages on duplication.\",\n );\nconst bodySchema = createCompositionSchema(elementTransportSchema);\nconst pointer = z\n .string()\n .max(1000)\n .describe(\"Exact JSON Pointer from inspection. Escape ~ as ~0 and / as ~1 within a segment.\");\nexport const jsonPatchOperationSchema: z.ZodType<CoreJsonPatchOperation> = z.discriminatedUnion(\n \"op\",\n [\n z.strictObject({ op: z.literal(\"add\"), path: pointer, value: jsonValueSchema }),\n z.strictObject({ op: z.literal(\"replace\"), path: pointer, value: jsonValueSchema }),\n z.strictObject({ op: z.literal(\"test\"), path: pointer, value: jsonValueSchema }),\n z.strictObject({ op: z.literal(\"remove\"), path: pointer }),\n z.strictObject({ op: z.literal(\"move\"), from: pointer, path: pointer }),\n z.strictObject({ op: z.literal(\"copy\"), from: pointer, path: pointer }),\n ],\n);\nconst patches = z\n .array(jsonPatchOperationSchema)\n .min(1)\n .max(100)\n .describe(\n \"Use exact inspected JSON Pointers. Parent paths must exist; add appends with /-. replace requires an existing property.\",\n );\nexport const createItemOperationSchema = z.strictObject({\n ...base,\n kind: z.literal(\"create-item\"),\n target: flowTarget,\n item: createFlowItemSchema(bodySchema).describe(\n \"Complete new flow item: content, group or page-break. A content item owns config.body.blocks with layouts/elements or sections. Create groups empty, then add children. New owned IDs must be unique survey-wide.\",\n ),\n translations,\n});\nexport const insertElementOperationSchema = z.strictObject({\n ...base,\n kind: z.literal(\"insert-element\"),\n target: layoutTarget,\n element: elementTransportSchema.describe(\n \"Complete registered element with fresh owner and slot IDs. Load this elementType capability and its canonical schema; arbitrary configuration is validated by the active registry.\",\n ),\n translations,\n});\nexport const insertPresetOperationSchema = z.strictObject({\n ...base,\n kind: z.literal(\"insert-preset\"),\n elementType: identity.describe(\n \"Exact installed element type advertised by the capability manifest, including custom elements when supported.\",\n ),\n presetId: identity.describe(\n \"Exact creation preset advertised for elementType. Never guess a preset ID; inspect the generated IDs before subsequent edits.\",\n ),\n locale,\n target: z.union([flowTarget, layoutTarget]),\n});\nexport const insertBlocksOperationSchema = z.strictObject({\n ...base,\n kind: z.literal(\"insert-blocks\"),\n bodyOwnerId: identity.describe(\n \"Exact owner of an existing composition body: content item, semantic section or follow-up trigger. This is not a layout ID.\",\n ),\n index,\n body: bodySchema.describe(\n \"New blocks to insert, not a replacement for the existing body. One section level and one option-follow-up level are enforced independently.\",\n ),\n translations,\n});\nexport const updateContentOperationSchema = z\n .strictObject({\n ...base,\n kind: z.literal(\"update-content\"),\n ref: localizationRefSchema,\n ...contentWrite,\n })\n .refine(exactlyOneContent, contentRequired);\nexport const patchElementConfigOperationSchema = z.strictObject({\n ...base,\n kind: z.literal(\"patch-element-config\"),\n elementId: identity,\n patches,\n translations,\n});\nexport const patchItemConfigOperationSchema = z.strictObject({\n ...base,\n kind: z.literal(\"patch-item-config\"),\n itemId: identity,\n patches,\n translations,\n});\nexport const updateItemLabelOperationSchema = z.strictObject({\n ...base,\n kind: z.literal(\"update-item-label\"),\n itemId: identity,\n itemLabel: z\n .string()\n .max(500)\n .describe(\n \"Internal editor label (the Add label control), never shown to respondents. Use update-content for question titles or input/option labels.\",\n ),\n});\nexport const updateItemColorOperationSchema = z.strictObject({\n ...base,\n kind: z.literal(\"update-item-color\"),\n itemId: identity,\n color: z\n .enum(SURVEY_EDITOR_ITEM_COLORS)\n .describe(\n \"Editor-only palette swatch. Does not alter participant content or imply answer meaning.\",\n ),\n});\nexport const removeItemOperationSchema = z.strictObject({\n ...base,\n kind: z.literal(\"remove-item\"),\n itemId: identity,\n includeChildren: z\n .boolean()\n .optional()\n .describe(\n \"Set true only when intentionally deleting a flow group and its complete subtree. Deletion is refused while authored references depend on removed identities.\",\n ),\n});\nexport const moveItemOperationSchema = z.strictObject({\n ...base,\n kind: z.literal(\"move-item\"),\n itemId: identity,\n target: flowTarget,\n});\nexport const reorderItemsOperationSchema = z.strictObject({\n ...base,\n kind: z.literal(\"reorder-items\"),\n parentItemId: identity,\n itemIds: z\n .array(identity)\n .max(1000)\n .describe(\"Include every existing child item ID exactly once, in the desired order.\"),\n});\nexport const moveElementOperationSchema = z.strictObject({\n ...base,\n kind: z.literal(\"move-element\"),\n elementId: identity,\n target: layoutTarget,\n ruleTransfer,\n});\nexport const moveBlockOperationSchema = z.strictObject({\n ...base,\n kind: z.literal(\"move-block\"),\n blockId: identity,\n bodyOwnerId: identity.describe(\n \"Exact owner of an existing composition body: content item, semantic section or follow-up trigger. This is not a layout ID.\",\n ),\n index,\n ruleTransfer,\n});\nexport const removeContentOperationSchema = z.strictObject({\n ...base,\n kind: z.literal(\"remove-content\"),\n ownerId: identity.describe(\n \"Exact element or block owner to remove. External references must be repaired first; this is not a request to clear its wording.\",\n ),\n});\nexport const updateLayoutOperationSchema = z.strictObject({\n ...base,\n kind: z.literal(\"update-layout\"),\n layoutId: identity,\n layout: layoutPolicySchema.describe(\n \"Complete layout policy; elements and IDs are preserved. Automatic maxColumns is a maximum and supports responsive wrapping; advanced mode supplies each breakpoint explicitly.\",\n ),\n});\nconst dimension = richTextImageDimensionSchema;\nexport const updatePlacedImageOperationSchema = z.strictObject({\n ...base,\n kind: z.literal(\"update-placed-image\"),\n ref: localizationRefSchema,\n locale,\n imageIndex: z\n .number()\n .int()\n .nonnegative()\n .describe(\n \"Zero-based image-only index within the inspected rich-text surface, not its overall block index.\",\n ),\n expectedAssetId: identity\n .optional()\n .describe(\n \"Inspected current local asset ID, used to reject a stale placement instead of editing the wrong image.\",\n ),\n changes: z.strictObject({\n source: z\n .discriminatedUnion(\"type\", [\n z.strictObject({ type: z.literal(\"asset\"), assetId: identity }),\n z.strictObject({ type: z.literal(\"external\"), url: z.string().min(1) }),\n ])\n .optional(),\n alt: z.string().nullable().optional(),\n caption: z.string().nullable().optional(),\n width: dimension.nullable().optional(),\n height: dimension.nullable().optional(),\n maxWidth: dimension.nullable().optional(),\n maxHeight: dimension.nullable().optional(),\n alignment: z.enum([\"left\", \"center\", \"right\"]).nullable().optional(),\n }),\n});\nexport const updateSurveyMetadataOperationSchema = z.strictObject({\n ...base,\n kind: z.literal(\"update-survey-metadata\"),\n values: stringRecord(z.string().min(1), z.string().nullable()).describe(\n \"Survey metadata entries to set; null deletes an entry. Unmentioned entries stay unchanged.\",\n ),\n});\nexport const updateSurveyPaginationOperationSchema = z.strictObject({\n ...base,\n kind: z.literal(\"update-survey-pagination\"),\n value: z\n .strictObject({ large: z.number().int().positive(), small: z.number().int().positive() })\n .nullable(),\n});\nexport const updateSurveyTranslationOperationSchema = z\n .strictObject({\n ...base,\n kind: z.literal(\"update-survey-translation\"),\n surface: z.enum(SURVEY_LOCALIZATION_SURFACES),\n contentKey: z.string().min(1),\n ...contentWrite,\n })\n .refine(exactlyOneContent, contentRequired);\nexport const addSurveyLocaleOperationSchema = z.strictObject({\n ...base,\n kind: z.literal(\"add-survey-locale\"),\n locale,\n});\nexport const removeSurveyLocaleOperationSchema = z.strictObject({\n ...base,\n kind: z.literal(\"remove-survey-locale\"),\n locale,\n});\nconst assetMetadata = z.strictObject({\n name: z.string().optional(),\n filename: z.string().optional(),\n alt: z.string().optional(),\n width: z.number().int().positive().optional(),\n height: z.number().int().positive().optional(),\n});\nexport const setImageAssetOperationSchema = z.strictObject({\n ...base,\n kind: z.literal(\"set-image-asset\"),\n assetId: identity,\n asset: z.strictObject({\n kind: z.literal(\"image\"),\n source: z.strictObject({\n type: z.literal(\"embedded\"),\n mediaType: z.string().regex(/^image\\//),\n encoding: z.literal(\"base64\"),\n data: z.string().min(1).max(8_000_000),\n }),\n metadata: assetMetadata.optional(),\n }),\n});\nexport const updateImageAssetMetadataOperationSchema = z.strictObject({\n ...base,\n kind: z.literal(\"update-image-asset-metadata\"),\n assetId: identity,\n metadata: z.strictObject({\n name: z.string().nullable().optional(),\n filename: z.string().nullable().optional(),\n alt: z.string().nullable().optional(),\n width: z.number().int().positive().nullable().optional(),\n height: z.number().int().positive().nullable().optional(),\n }),\n});\nexport const removeImageAssetOperationSchema = z.strictObject({\n ...base,\n kind: z.literal(\"remove-image-asset\"),\n assetId: identity,\n});\nexport const surveyPatchOperationSchema = z.strictObject({\n ...base,\n kind: z.literal(\"survey-json-patch\"),\n patches,\n});\nexport const updateResponseSettingsOperationSchema = responseSettingsChangesSchema\n .extend({ ...base, kind: z.literal(\"update-response-settings\") })\n .strict();\ninterface SurveyOperationSchemas {\n \"create-item\": typeof createItemOperationSchema;\n \"insert-element\": typeof insertElementOperationSchema;\n \"insert-preset\": typeof insertPresetOperationSchema;\n \"insert-blocks\": typeof insertBlocksOperationSchema;\n \"update-content\": typeof updateContentOperationSchema;\n \"patch-element-config\": typeof patchElementConfigOperationSchema;\n \"patch-item-config\": typeof patchItemConfigOperationSchema;\n \"update-item-label\": typeof updateItemLabelOperationSchema;\n \"update-item-color\": typeof updateItemColorOperationSchema;\n \"remove-item\": typeof removeItemOperationSchema;\n \"move-item\": typeof moveItemOperationSchema;\n \"reorder-items\": typeof reorderItemsOperationSchema;\n \"move-element\": typeof moveElementOperationSchema;\n \"move-block\": typeof moveBlockOperationSchema;\n \"remove-content\": typeof removeContentOperationSchema;\n \"update-layout\": typeof updateLayoutOperationSchema;\n \"update-placed-image\": typeof updatePlacedImageOperationSchema;\n \"update-survey-metadata\": typeof updateSurveyMetadataOperationSchema;\n \"update-survey-pagination\": typeof updateSurveyPaginationOperationSchema;\n \"update-survey-translation\": typeof updateSurveyTranslationOperationSchema;\n \"add-survey-locale\": typeof addSurveyLocaleOperationSchema;\n \"remove-survey-locale\": typeof removeSurveyLocaleOperationSchema;\n \"set-image-asset\": typeof setImageAssetOperationSchema;\n \"update-image-asset-metadata\": typeof updateImageAssetMetadataOperationSchema;\n \"remove-image-asset\": typeof removeImageAssetOperationSchema;\n \"survey-json-patch\": typeof surveyPatchOperationSchema;\n \"update-response-settings\": typeof updateResponseSettingsOperationSchema;\n}\nexport const surveyOperationSchemasByKind: SurveyOperationSchemas = {\n \"create-item\": createItemOperationSchema,\n \"insert-element\": insertElementOperationSchema,\n \"insert-preset\": insertPresetOperationSchema,\n \"insert-blocks\": insertBlocksOperationSchema,\n \"update-content\": updateContentOperationSchema,\n \"patch-element-config\": patchElementConfigOperationSchema,\n \"patch-item-config\": patchItemConfigOperationSchema,\n \"update-item-label\": updateItemLabelOperationSchema,\n \"update-item-color\": updateItemColorOperationSchema,\n \"remove-item\": removeItemOperationSchema,\n \"move-item\": moveItemOperationSchema,\n \"reorder-items\": reorderItemsOperationSchema,\n \"move-element\": moveElementOperationSchema,\n \"move-block\": moveBlockOperationSchema,\n \"remove-content\": removeContentOperationSchema,\n \"update-layout\": updateLayoutOperationSchema,\n \"update-placed-image\": updatePlacedImageOperationSchema,\n \"update-survey-metadata\": updateSurveyMetadataOperationSchema,\n \"update-survey-pagination\": updateSurveyPaginationOperationSchema,\n \"update-survey-translation\": updateSurveyTranslationOperationSchema,\n \"add-survey-locale\": addSurveyLocaleOperationSchema,\n \"remove-survey-locale\": removeSurveyLocaleOperationSchema,\n \"set-image-asset\": setImageAssetOperationSchema,\n \"update-image-asset-metadata\": updateImageAssetMetadataOperationSchema,\n \"remove-image-asset\": removeImageAssetOperationSchema,\n \"survey-json-patch\": surveyPatchOperationSchema,\n \"update-response-settings\": updateResponseSettingsOperationSchema,\n} as const;\nexport type SurveyOperation = z.infer<SurveyOperationSchemas[keyof SurveyOperationSchemas]>;\nexport const surveyOperationSchema: z.ZodType<SurveyOperation> = z.discriminatedUnion(\"kind\", [\n createItemOperationSchema,\n ...Object.values(surveyOperationSchemasByKind).filter(\n (schema) => schema !== createItemOperationSchema,\n ),\n]);\n\nexport type SurveyOperationKind = SurveyOperation[\"kind\"];\nexport const SURVEY_OPERATION_KINDS = Object.freeze(\n Object.keys(surveyOperationSchemasByKind),\n) as readonly [SurveyOperationKind, ...SurveyOperationKind[]];\nexport const surveyValidationIssueSchema = z.object({\n severity: z.enum([\"error\", \"warning\"]),\n code: z.string(),\n message: z.string(),\n operationIndex: z.number().int().nonnegative().optional(),\n operationId: z.string().optional(),\n itemId: z.string().optional(),\n});\nexport const surveyValidationResultSchema = z.object({\n valid: z.boolean(),\n issues: z.array(surveyValidationIssueSchema),\n warnings: z.array(surveyValidationIssueSchema),\n normalizedOperations: z.array(surveyOperationSchema),\n});\nexport type SurveyValidationIssue = z.infer<typeof surveyValidationIssueSchema>;\nexport type SurveyValidationResult = z.infer<typeof surveyValidationResultSchema>;\nexport type JsonPatchOperation = z.infer<typeof jsonPatchOperationSchema>;\n","import { z } from \"zod\";\nimport { SURVEY_OPERATION_KINDS } from \"./operations\";\n\nexport const assistantElementCreateModeSchema = z.enum([\n \"deterministic\",\n \"interactive-only\",\n \"unsupported\",\n]);\nexport const assistantElementAuthoringSchema = z.strictObject({\n compactHint: z.string().min(1).max(240).optional(),\n configSummary: z.string().min(1).max(1000).optional(),\n});\nexport const assistantCreationPresetSchema = z.strictObject({\n id: z.string().regex(/^[A-Za-z0-9][A-Za-z0-9._-]{0,119}$/),\n});\nexport const assistantElementTypeManifestSchema = z.strictObject({\n elementType: z.string().min(1),\n capabilityVersion: z.string().min(1),\n displayName: z.string().min(1),\n description: z.string().optional(),\n create: assistantElementCreateModeSchema,\n supportedOperations: z.array(z.enum(SURVEY_OPERATION_KINDS)),\n creationPresets: z.array(assistantCreationPresetSchema).max(100).optional(),\n referenceTopics: z.array(z.string().min(1)).optional(),\n authoring: assistantElementAuthoringSchema.optional(),\n});\nexport const surveyAssistantCapabilityManifestSchema = z.strictObject({\n digest: z.string().min(1),\n elementTypes: z.array(assistantElementTypeManifestSchema),\n});\nexport type AssistantElementCreateMode = z.infer<typeof assistantElementCreateModeSchema>;\nexport type AssistantElementAuthoring = z.infer<typeof assistantElementAuthoringSchema>;\nexport type AssistantCreationPreset = z.infer<typeof assistantCreationPresetSchema>;\nexport type AssistantElementTypeManifest = z.infer<typeof assistantElementTypeManifestSchema>;\nexport type SurveyAssistantCapabilityManifest = z.infer<\n typeof surveyAssistantCapabilityManifestSchema\n>;\n"],"mappings":";;;;AAIA,MAAM,eAAe,EAClB,OAAO,CAAC,CACR,MAAM,iCAAiC,CAAC,CACxC,IAAI,E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C,IAAI,GAAG,CAAC,CAAC,SAAS;CACjD,eAAe,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,GAAI,CAAC,CAAC,SAAS;AACtD,CAAC;AACD,MAAa,gCAAgC,EAAE,aAAa,EAC1D,IAAI,EAAE,OAAO,CAAC,CAAC,MAAM,oCAAoC,EAC3D,CAAC;AACD,MAAa,qCAAqC,EAAE,aAAa;CAC/D,aAAa,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC;CAC7B,mBAAmB,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC;CACnC,aAAa,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC;CAC7B,aAAa,EAAE,OAAO,CAAC,CAAC,SAAS;CACjC,QAAQ;CACR,qBAAqB,EAAE,MAAM,EAAE,KAAK,sBAAsB,CAAC;CAC3D,iBAAiB,EAAE,MAAM,6BAA6B,CAAC,CAAC,IAAI,GAAG,CAAC,CAAC,SAAS;CAC1E,iBAAiB,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,SAAS;CACrD,WAAW,gCAAgC,SAAS;AACtD,CAAC;AACD,MAAa,0CAA0C,EAAE,aAAa;CACpE,QAAQ,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC;CACxB,cAAc,EAAE,MAAM,kCAAkC;AAC1D,CAAC"}
@@ -1,16 +1,8 @@
1
- import { Wt as AssistantItemCapabilityAdapter, qt as SurveyAssistantCapabilitySet } from "./index-Ciq7vHIs.mjs";
1
+ import { _ as SurveyAssistantCapabilitySet, m as AssistantElementCapabilityAdapter } from "./turn-survey-draft-B34lggSG.mjs";
2
+ import "./index-CaX3hZmr.mjs";
2
3
  //#region src/capabilities/default.d.ts
3
- export declare const rootItemAssistantCapability: AssistantItemCapabilityAdapter;
4
- export declare const groupItemAssistantCapability: AssistantItemCapabilityAdapter;
5
- export declare const pageBreakItemAssistantCapability: AssistantItemCapabilityAdapter;
6
- export declare const infoItemAssistantCapability: AssistantItemCapabilityAdapter;
7
- export declare const choiceItemAssistantCapability: AssistantItemCapabilityAdapter;
8
- export declare const formItemAssistantCapability: AssistantItemCapabilityAdapter;
9
- export declare const consentItemAssistantCapability: AssistantItemCapabilityAdapter;
10
- export declare const choiceMatrixAssistantCapability: AssistantItemCapabilityAdapter;
11
- export declare const formMatrixAssistantCapability: AssistantItemCapabilityAdapter;
12
- export declare const defaultSurveyAssistantCapabilities: readonly [AssistantItemCapabilityAdapter, AssistantItemCapabilityAdapter, AssistantItemCapabilityAdapter, AssistantItemCapabilityAdapter, AssistantItemCapabilityAdapter, AssistantItemCapabilityAdapter, AssistantItemCapabilityAdapter, AssistantItemCapabilityAdapter, AssistantItemCapabilityAdapter];
4
+ export declare const defaultSurveyAssistantCapabilities: AssistantElementCapabilityAdapter[];
13
5
  export declare const defaultSurveyAssistantCapabilitySet: SurveyAssistantCapabilitySet;
14
- export declare const getDefaultSurveyAssistantCapability: (itemType: string) => AssistantItemCapabilityAdapter | undefined;
6
+ export declare const getDefaultSurveyAssistantCapability: (elementType: string) => AssistantElementCapabilityAdapter | undefined;
15
7
  //#endregion
16
8
  //# sourceMappingURL=capabilities-default.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"capabilities-default.d.mts","names":[],"sources":["../src/capabilities/default.ts"],"mappings":";;qBAuMa,6BAA6B;qBAY7B,8BAA8B;qBAsB9B,kCAAkC;qBAsBlC,6BAA6B;qBA6B7B,+BAA+B;qBAsG/B,6BAA6B;qBA4D7B,gCAAgC;qBAkMhC,iCAA+B;qBAC/B,+BAA6B;qBAE7B,8CAAkC,gCAAA,gCAAA,gCAAA,gCAAA,gCAAA,gCAAA,gCAAA,gCAAA;qBAYlC,qCAAA;qBAIA,sCACX,qBACC"}
1
+ {"version":3,"file":"capabilities-default.d.mts","names":[],"sources":["../src/capabilities/default.ts"],"mappings":";;;qBAwMa,oCAAkC;qBAGlC,qCAAA;qBAIA,sCAAuC,wBAAmB"}
@@ -1,2 +1,2 @@
1
- import { a as defaultSurveyAssistantCapabilitySet, c as getDefaultSurveyAssistantCapability, d as pageBreakItemAssistantCapability, f as rootItemAssistantCapability, i as defaultSurveyAssistantCapabilities, l as groupItemAssistantCapability, n as choiceMatrixAssistantCapability, o as formItemAssistantCapability, r as consentItemAssistantCapability, s as formMatrixAssistantCapability, t as choiceItemAssistantCapability, u as infoItemAssistantCapability } from "./default-fhSon2RM.mjs";
2
- export { choiceItemAssistantCapability, choiceMatrixAssistantCapability, consentItemAssistantCapability, defaultSurveyAssistantCapabilities, defaultSurveyAssistantCapabilitySet, formItemAssistantCapability, formMatrixAssistantCapability, getDefaultSurveyAssistantCapability, groupItemAssistantCapability, infoItemAssistantCapability, pageBreakItemAssistantCapability, rootItemAssistantCapability };
1
+ import { n as defaultSurveyAssistantCapabilitySet, r as getDefaultSurveyAssistantCapability, t as defaultSurveyAssistantCapabilities } from "./default-D22AKTqE.mjs";
2
+ export { defaultSurveyAssistantCapabilities, defaultSurveyAssistantCapabilitySet, getDefaultSurveyAssistantCapability };
@@ -0,0 +1,117 @@
1
+ import { z } from "zod";
2
+ //#region src/protocol/capabilities.d.ts
3
+ declare const assistantElementCreateModeSchema: z.ZodEnum<{
4
+ deterministic: "deterministic";
5
+ "interactive-only": "interactive-only";
6
+ unsupported: "unsupported";
7
+ }>;
8
+ declare const assistantElementAuthoringSchema: z.ZodObject<{
9
+ compactHint: z.ZodOptional<z.ZodString>;
10
+ configSummary: z.ZodOptional<z.ZodString>;
11
+ }, z.core.$strict>;
12
+ declare const assistantElementTypeManifestSchema: z.ZodObject<{
13
+ elementType: z.ZodString;
14
+ capabilityVersion: z.ZodString;
15
+ displayName: z.ZodString;
16
+ description: z.ZodOptional<z.ZodString>;
17
+ create: z.ZodEnum<{
18
+ deterministic: "deterministic";
19
+ "interactive-only": "interactive-only";
20
+ unsupported: "unsupported";
21
+ }>;
22
+ supportedOperations: z.ZodArray<z.ZodEnum<{
23
+ "create-item": "create-item";
24
+ "insert-element": "insert-element";
25
+ "insert-preset": "insert-preset";
26
+ "insert-blocks": "insert-blocks";
27
+ "update-content": "update-content";
28
+ "patch-element-config": "patch-element-config";
29
+ "patch-item-config": "patch-item-config";
30
+ "update-item-label": "update-item-label";
31
+ "update-item-color": "update-item-color";
32
+ "remove-item": "remove-item";
33
+ "move-item": "move-item";
34
+ "reorder-items": "reorder-items";
35
+ "move-element": "move-element";
36
+ "move-block": "move-block";
37
+ "remove-content": "remove-content";
38
+ "update-layout": "update-layout";
39
+ "update-placed-image": "update-placed-image";
40
+ "update-survey-metadata": "update-survey-metadata";
41
+ "update-survey-pagination": "update-survey-pagination";
42
+ "update-survey-translation": "update-survey-translation";
43
+ "add-survey-locale": "add-survey-locale";
44
+ "remove-survey-locale": "remove-survey-locale";
45
+ "set-image-asset": "set-image-asset";
46
+ "update-image-asset-metadata": "update-image-asset-metadata";
47
+ "remove-image-asset": "remove-image-asset";
48
+ "survey-json-patch": "survey-json-patch";
49
+ "update-response-settings": "update-response-settings";
50
+ }>>;
51
+ creationPresets: z.ZodOptional<z.ZodArray<z.ZodObject<{
52
+ id: z.ZodString;
53
+ }, z.core.$strict>>>;
54
+ referenceTopics: z.ZodOptional<z.ZodArray<z.ZodString>>;
55
+ authoring: z.ZodOptional<z.ZodObject<{
56
+ compactHint: z.ZodOptional<z.ZodString>;
57
+ configSummary: z.ZodOptional<z.ZodString>;
58
+ }, z.core.$strict>>;
59
+ }, z.core.$strict>;
60
+ declare const surveyAssistantCapabilityManifestSchema: z.ZodObject<{
61
+ digest: z.ZodString;
62
+ elementTypes: z.ZodArray<z.ZodObject<{
63
+ elementType: z.ZodString;
64
+ capabilityVersion: z.ZodString;
65
+ displayName: z.ZodString;
66
+ description: z.ZodOptional<z.ZodString>;
67
+ create: z.ZodEnum<{
68
+ deterministic: "deterministic";
69
+ "interactive-only": "interactive-only";
70
+ unsupported: "unsupported";
71
+ }>;
72
+ supportedOperations: z.ZodArray<z.ZodEnum<{
73
+ "create-item": "create-item";
74
+ "insert-element": "insert-element";
75
+ "insert-preset": "insert-preset";
76
+ "insert-blocks": "insert-blocks";
77
+ "update-content": "update-content";
78
+ "patch-element-config": "patch-element-config";
79
+ "patch-item-config": "patch-item-config";
80
+ "update-item-label": "update-item-label";
81
+ "update-item-color": "update-item-color";
82
+ "remove-item": "remove-item";
83
+ "move-item": "move-item";
84
+ "reorder-items": "reorder-items";
85
+ "move-element": "move-element";
86
+ "move-block": "move-block";
87
+ "remove-content": "remove-content";
88
+ "update-layout": "update-layout";
89
+ "update-placed-image": "update-placed-image";
90
+ "update-survey-metadata": "update-survey-metadata";
91
+ "update-survey-pagination": "update-survey-pagination";
92
+ "update-survey-translation": "update-survey-translation";
93
+ "add-survey-locale": "add-survey-locale";
94
+ "remove-survey-locale": "remove-survey-locale";
95
+ "set-image-asset": "set-image-asset";
96
+ "update-image-asset-metadata": "update-image-asset-metadata";
97
+ "remove-image-asset": "remove-image-asset";
98
+ "survey-json-patch": "survey-json-patch";
99
+ "update-response-settings": "update-response-settings";
100
+ }>>;
101
+ creationPresets: z.ZodOptional<z.ZodArray<z.ZodObject<{
102
+ id: z.ZodString;
103
+ }, z.core.$strict>>>;
104
+ referenceTopics: z.ZodOptional<z.ZodArray<z.ZodString>>;
105
+ authoring: z.ZodOptional<z.ZodObject<{
106
+ compactHint: z.ZodOptional<z.ZodString>;
107
+ configSummary: z.ZodOptional<z.ZodString>;
108
+ }, z.core.$strict>>;
109
+ }, z.core.$strict>>;
110
+ }, z.core.$strict>;
111
+ type AssistantElementCreateMode = z.infer<typeof assistantElementCreateModeSchema>;
112
+ type AssistantElementAuthoring = z.infer<typeof assistantElementAuthoringSchema>;
113
+ type AssistantElementTypeManifest = z.infer<typeof assistantElementTypeManifestSchema>;
114
+ type SurveyAssistantCapabilityManifest = z.infer<typeof surveyAssistantCapabilityManifestSchema>;
115
+ //#endregion
116
+ export { assistantElementAuthoringSchema as a, surveyAssistantCapabilityManifestSchema as c, SurveyAssistantCapabilityManifest as i, AssistantElementCreateMode as n, assistantElementCreateModeSchema as o, AssistantElementTypeManifest as r, assistantElementTypeManifestSchema as s, AssistantElementAuthoring as t };
117
+ //# sourceMappingURL=capabilities-z95e1mti.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"capabilities-z95e1mti.d.mts","names":[],"sources":["../src/protocol/capabilities.ts"],"mappings":";;cAGa,kCAAgC,EAAA;;;;;cAKhC,iCAA+B,EAAA;;;GAG1C,EAAA,KAAA;cAIW,oCAAkC,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAU7C,EAAA,KAAA;cACW,yCAAuC,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAGlD,EAAA,KAAA;KACU,6BAA6B,EAAE,aAAa;KAC5C,4BAA4B,EAAE,aAAa;KAE3C,+BAA+B,EAAE,aAAa;KAC9C,oCAAoC,EAAE,aACzC"}
@@ -1,6 +1,6 @@
1
- import "./index-D7wT6P3t.mjs";
2
- import { St as SurveyDocumentVersion, o as SurveyAssistantApplyOutcome, xt as SurveyDocumentSnapshot } from "./lifecycle-Dm8u7QFh.mjs";
3
- import { Pt as SurveyAssistantEngineContext, qt as SurveyAssistantCapabilitySet, x as TurnSurveyDraft } from "./index-Ciq7vHIs.mjs";
1
+ import "./index-DYHdvSE8.mjs";
2
+ import { Ct as SurveyDocumentVersion, St as SurveyDocumentSnapshot, o as SurveyAssistantApplyOutcome } from "./lifecycle-DFzxVxpq.mjs";
3
+ import { _ as SurveyAssistantCapabilitySet, i as SurveyAssistantEngineContext, n as TurnSurveyDraft } from "./turn-survey-draft-B34lggSG.mjs";
4
4
  import { r as SurveyAssistantModelAttachment, t as SurveyAssistantAttachmentAccess } from "./thread-documents-DrHbaXqP.mjs";
5
5
  import { RequestContext } from "@mastra/core/request-context";
6
6
  import { AgentExecutionOptions } from "@mastra/core/agent";
@@ -78,4 +78,4 @@ declare const SURVEY_ASSISTANT_AGENT_ID = "survey-assistant-agent";
78
78
  declare const SURVEY_ASSISTANT_TASK_AGENT_ID = "survey-assistant-task-agent";
79
79
  //#endregion
80
80
  export { SurveyAssistantModelSelection as a, deriveSurveyAssistantDocumentTransition as c, parseSurveyAssistantSnapshot as d, requireSurveyAssistantTurnState as f, SurveyAssistantIdentityContext as i, parseSurveyAssistantPreviousApplyOutcome as l, SURVEY_ASSISTANT_TASK_AGENT_ID as n, SurveyAssistantRequestContext as o, SurveyAssistantDocumentTransition as r, buildSurveyAssistantRequestContext as s, SURVEY_ASSISTANT_AGENT_ID as t, parseSurveyAssistantPreviousSettledVersion as u };
81
- //# sourceMappingURL=constants-B6HzpEsx.d.mts.map
81
+ //# sourceMappingURL=constants-HL_klgJl.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"constants-B6HzpEsx.d.mts","names":[],"sources":["../src/server/request-context.ts","../src/server/constants.ts"],"mappings":";;;;;;;;UA2BiB;EACf;EACA;EACA;EACA;;UAGe;EACf;EACA,gBAAgB;EAChB;EACA,kBAAkB;;KAGR;EACN;;EAEA;EACA;EACA;;EAGA;EACA;EACA;EACA;;EAGA;EACA;EACA;EACA;EACA,iBAAiB;EACjB;;UAGW;EACf;EACA,WAAW;EACX,UAAU;EACV;EACA;EACA,qBAAqB;EACrB,gBAAgB;EAChB,mBAAmB;EACnB,mBAAmB;EACnB,iBAAiB;EACjB,uBAAuB;;cAGZ,+BAAgC,mBAAiB;cAQjD,6CACX,mBACC;cAQU,2CACX,mBACC;cAQU,4CAA2C,SAAA;EAItD,SAAS;EACT,UAAU;MACR;cAqDS,uCAAsC,WAAA,UAAA,UAAA,wBAAA,qBAAA,kBAAA,kBAAA,gBAAA;EAWjD,WAAW;EACX,UAAU;EACV,UAAU;EACV,yBAAyB;EACzB,sBAAsB;EACtB,mBAAmB;EACnB,mBAAmB;EACnB,iBAAiB;EACjB,uBAAuB;MACrB,eAAe;cAiDN,kCACX,gBAAgB,eAAe;;;;;;cC1OpB;cACA"}
1
+ {"version":3,"file":"constants-HL_klgJl.d.mts","names":[],"sources":["../src/server/request-context.ts","../src/server/constants.ts"],"mappings":";;;;;;;;UA2BiB;EACf;EACA;EACA;EACA;;UAGe;EACf;EACA,gBAAgB;EAChB;EACA,kBAAkB;;KAGR;EACN;;EAEA;EACA;EACA;;EAGA;EACA;EACA;EACA;;EAGA;EACA;EACA;EACA;EACA,iBAAiB;EACjB;;UAGW;EACf;EACA,WAAW;EACX,UAAU;EACV;EACA;EACA,qBAAqB;EACrB,gBAAgB;EAChB,mBAAmB;EACnB,mBAAmB;EACnB,iBAAiB;EACjB,uBAAuB;;cAGZ,+BAAgC,mBAAiB;cAQjD,6CACX,mBACC;cAQU,2CACX,mBACC;cAQU,4CAA2C,SAAA;EAItD,SAAS;EACT,UAAU;MACR;cAqDS,uCAAsC,WAAA,UAAA,UAAA,wBAAA,qBAAA,kBAAA,kBAAA,gBAAA;EAWjD,WAAW;EACX,UAAU;EACV,UAAU;EACV,yBAAyB;EACzB,sBAAsB;EACtB,mBAAmB;EACnB,mBAAmB;EACnB,iBAAiB;EACjB,uBAAuB;MACrB,eAAe;cAiDN,kCACX,gBAAgB,eAAe;;;;;;cC1OpB;cACA"}
@@ -1,4 +1,4 @@
1
- import { A as surveyAssistantTranslateContentResultSchema, Ft as isSurveyAssistantErrorRetryable, It as parseSurveyAssistantError, S as surveyAssistantSuggestResponseSettingsResultSchema, b as surveyAssistantSuggestResponseNameResultSchema, v as surveyAssistantSuggestItemLabelResultSchema } from "./protocol-CF4Bh_Ch.mjs";
1
+ import { A as surveyAssistantTranslateContentResultSchema, J as isSurveyAssistantErrorRetryable, S as surveyAssistantSuggestResponseSettingsResultSchema, Y as parseSurveyAssistantError, b as surveyAssistantSuggestResponseNameResultSchema, v as surveyAssistantSuggestItemLabelResultSchema } from "./protocol-BQ7uIDYT.mjs";
2
2
  //#region src/react/client-error.ts
3
3
  var SurveyAssistantClientError = class extends Error {
4
4
  code;
@@ -42,10 +42,11 @@ const readSurveyAssistantJson = async (response, fallback = "The assistant reque
42
42
  //#endregion
43
43
  //#region src/react/thread-launcher.ts
44
44
  const launcherStates = /* @__PURE__ */ new WeakMap();
45
- const applySurveyAssistantLaunchUIContext = (snapshot, uiContext) => snapshot && uiContext ? {
45
+ const applySurveyAssistantLaunchUIContext = (snapshot, uiContext, threadTask) => snapshot && (uiContext || threadTask) ? {
46
46
  ...snapshot,
47
47
  ui: {
48
48
  ...snapshot.ui,
49
+ ...threadTask ? { task: threadTask } : {},
49
50
  ...uiContext
50
51
  }
51
52
  } : snapshot;
@@ -171,4 +172,4 @@ const createSurveyAssistantControllerBridge = (options) => {
171
172
  //#endregion
172
173
  export { connectSurveyAssistantThreadLauncher as a, readSurveyAssistantJson as c, applySurveyAssistantLaunchUIContext as i, createSurveyAssistantControllerProxy as n, createSurveyAssistantThreadLauncher as o, createSurveyAssistantTaskClient as r, SurveyAssistantClientError as s, createSurveyAssistantControllerBridge as t };
173
174
 
174
- //# sourceMappingURL=controller-proxy-DEeFl9IA.mjs.map
175
+ //# sourceMappingURL=controller-proxy-BQ1YsVxJ.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"controller-proxy-BQ1YsVxJ.mjs","names":[],"sources":["../src/react/client-error.ts","../src/react/thread-launcher.ts","../src/react/task-client.ts","../src/react/controller-proxy.ts"],"sourcesContent":["import {\n isSurveyAssistantErrorRetryable,\n parseSurveyAssistantError,\n type SurveyAssistantErrorCode,\n type SurveyAssistantErrorInfo,\n} from \"../protocol\";\n\nexport class SurveyAssistantClientError extends Error {\n readonly code: SurveyAssistantErrorCode;\n readonly retryable: boolean;\n readonly upstreamStatus?: number;\n readonly providerRequestId?: string;\n readonly providerMessage?: string;\n\n constructor(\n code: SurveyAssistantErrorCode,\n message: string,\n retryable = false,\n diagnostics: Pick<\n SurveyAssistantErrorInfo,\n \"providerMessage\" | \"providerRequestId\" | \"upstreamStatus\"\n > = {},\n ) {\n super(message);\n this.name = \"SurveyAssistantClientError\";\n this.code = code;\n this.retryable = retryable;\n this.upstreamStatus = diagnostics.upstreamStatus;\n this.providerRequestId = diagnostics.providerRequestId;\n this.providerMessage = diagnostics.providerMessage;\n }\n}\n\nexport const readSurveyAssistantJson = async (\n response: Response,\n fallback = \"The assistant request could not be completed.\",\n) => {\n if (!response.ok) {\n const responseText = await response.text().catch(() => \"\");\n let body: unknown;\n try {\n body = responseText ? JSON.parse(responseText) : undefined;\n } catch {\n body = undefined;\n }\n const detail =\n typeof body === \"object\" && body !== null && \"error\" in body && typeof body.error === \"string\"\n ? body.error\n : responseText.trim() || fallback;\n const parsed = parseSurveyAssistantError(\n typeof body === \"object\" && body !== null && \"code\" in body && typeof body.code === \"string\"\n ? {\n code: body.code,\n detail,\n retryable:\n \"retryable\" in body && typeof body.retryable === \"boolean\"\n ? body.retryable\n : undefined,\n upstreamStatus:\n \"upstreamStatus\" in body && typeof body.upstreamStatus === \"number\"\n ? body.upstreamStatus\n : undefined,\n providerRequestId:\n \"providerRequestId\" in body && typeof body.providerRequestId === \"string\"\n ? body.providerRequestId\n : undefined,\n providerMessage:\n \"providerMessage\" in body && typeof body.providerMessage === \"string\"\n ? body.providerMessage\n : undefined,\n }\n : detail,\n );\n const retryable = isSurveyAssistantErrorRetryable(parsed, response.status);\n throw new SurveyAssistantClientError(parsed.code, parsed.detail ?? detail, retryable, parsed);\n }\n return response.json().catch(() => ({}));\n};\n","import type {\n SurveyAssistantSnapshot,\n SurveyAssistantThread,\n SurveyEditorUIContext,\n SurveyEditorUITask,\n} from \"../protocol\";\nimport type { FileUIPart } from \"ai\";\n\nexport type SurveyAssistantLaunchUIContext = Partial<Omit<SurveyEditorUIContext, \"history\">>;\n\nexport interface SurveyAssistantThreadLaunch {\n /** User-visible prompt submitted as the first message in the new thread. */\n prompt: string;\n files?: FileUIPart[];\n /** Optional model used for the opening assistant turn. */\n modelId?: string;\n /** Optional manual thread title. The prompt-derived automatic title is used by default. */\n title?: string;\n /** Opening-turn context. Its task is also persisted on the created thread. */\n uiContext?: SurveyAssistantLaunchUIContext;\n}\n\nexport interface SurveyAssistantThreadLauncher {\n /**\n * Creates a new thread and submits its first prompt when a connected panel is ready.\n * Calls made before the panel mounts are queued.\n */\n startThread(input: SurveyAssistantThreadLaunch): Promise<SurveyAssistantThread>;\n}\n\ntype LaunchHandler = (input: SurveyAssistantThreadLaunch) => Promise<SurveyAssistantThread>;\n\ninterface PendingLaunch {\n input: SurveyAssistantThreadLaunch;\n reject(error: unknown): void;\n resolve(thread: SurveyAssistantThread): void;\n}\n\ninterface LauncherState {\n handler: LaunchHandler | null;\n pending: PendingLaunch[];\n draining: boolean;\n}\n\nconst launcherStates = new WeakMap<SurveyAssistantThreadLauncher, LauncherState>();\n\nexport const applySurveyAssistantLaunchUIContext = (\n snapshot: SurveyAssistantSnapshot | null,\n uiContext: SurveyAssistantLaunchUIContext | undefined,\n threadTask?: SurveyEditorUITask,\n): SurveyAssistantSnapshot | null =>\n snapshot && (uiContext || threadTask)\n ? {\n ...snapshot,\n ui: {\n ...snapshot.ui,\n ...(threadTask ? { task: threadTask } : {}),\n ...uiContext,\n },\n }\n : snapshot;\n\nconst getLauncherState = (launcher: SurveyAssistantThreadLauncher) => {\n const state = launcherStates.get(launcher);\n if (!state) {\n throw new Error(\n \"The survey assistant thread launcher was not created by createSurveyAssistantThreadLauncher.\",\n );\n }\n return state;\n};\n\nconst drainPendingLaunches = async (state: LauncherState) => {\n if (state.draining) return;\n state.draining = true;\n try {\n while (state.handler && state.pending.length > 0) {\n const pending = state.pending.shift();\n if (!pending) continue;\n try {\n pending.resolve(await state.handler(pending.input));\n } catch (error) {\n pending.reject(error);\n }\n }\n } finally {\n state.draining = false;\n }\n};\n\nexport const createSurveyAssistantThreadLauncher = (): SurveyAssistantThreadLauncher => {\n const state: LauncherState = { handler: null, pending: [], draining: false };\n const launcher: SurveyAssistantThreadLauncher = {\n startThread(input) {\n const prompt = input.prompt.trim();\n if (!prompt && (input.files?.length ?? 0) === 0) {\n return Promise.reject(new Error(\"A survey assistant prompt or attachment is required.\"));\n }\n\n return new Promise((resolve, reject) => {\n state.pending.push({\n input: {\n ...input,\n prompt,\n ...(input.files ? { files: [...input.files] } : {}),\n ...(input.modelId ? { modelId: input.modelId.trim() } : {}),\n ...(input.title ? { title: input.title.trim() } : {}),\n },\n reject,\n resolve,\n });\n void drainPendingLaunches(state);\n });\n },\n };\n launcherStates.set(launcher, state);\n return launcher;\n};\n\nexport const connectSurveyAssistantThreadLauncher = (\n launcher: SurveyAssistantThreadLauncher,\n handler: LaunchHandler,\n) => {\n const state = getLauncherState(launcher);\n if (state.handler && state.handler !== handler) {\n throw new Error(\"A survey assistant thread launcher can only control one mounted panel.\");\n }\n state.handler = handler;\n void drainPendingLaunches(state);\n\n return () => {\n if (state.handler === handler) state.handler = null;\n };\n};\n","import {\n surveyAssistantSuggestResponseSettingsResultSchema,\n type SurveyAssistantSuggestResponseSettingsInput,\n type SurveyAssistantSuggestResponseSettingsResult,\n} from \"../protocol/tasks\";\nimport {\n surveyAssistantSuggestResponseNameResultSchema,\n surveyAssistantSuggestItemLabelResultSchema,\n surveyAssistantTranslateContentResultSchema,\n type SurveyAssistantSuggestResponseNameInput,\n type SurveyAssistantSuggestResponseNameResult,\n type SurveyAssistantSuggestItemLabelInput,\n type SurveyAssistantSuggestItemLabelResult,\n type SurveyAssistantTaskContext,\n type SurveyAssistantTaskInvocationMode,\n type SurveyAssistantTranslateContentInput,\n type SurveyAssistantTranslateContentResult,\n} from \"../protocol\";\nimport { readSurveyAssistantJson } from \"./client-error\";\n\nexport interface SurveyAssistantTaskClientOptions {\n api?: string;\n resourceId?: string;\n surveyId?: string;\n}\n\nexport interface SurveyAssistantTaskExecutionOptions {\n mode?: SurveyAssistantTaskInvocationMode;\n modelId?: string;\n signal?: AbortSignal;\n}\n\nexport interface SurveyAssistantTaskClient {\n suggestResponseSettings(\n input: SurveyAssistantSuggestResponseSettingsInput,\n context: SurveyAssistantTaskContext,\n options?: SurveyAssistantTaskExecutionOptions,\n ): Promise<SurveyAssistantSuggestResponseSettingsResult>;\n suggestResponseName(\n input: SurveyAssistantSuggestResponseNameInput,\n context: SurveyAssistantTaskContext,\n options?: SurveyAssistantTaskExecutionOptions,\n ): Promise<SurveyAssistantSuggestResponseNameResult>;\n suggestItemLabel(\n input: SurveyAssistantSuggestItemLabelInput,\n context: SurveyAssistantTaskContext,\n options?: SurveyAssistantTaskExecutionOptions,\n ): Promise<SurveyAssistantSuggestItemLabelResult>;\n translateContent(\n input: SurveyAssistantTranslateContentInput,\n context: SurveyAssistantTaskContext,\n options?: SurveyAssistantTaskExecutionOptions,\n ): Promise<SurveyAssistantTranslateContentResult>;\n}\n\nexport const createSurveyAssistantTaskClient = ({\n api = \"/api/survey-assistant/tasks\",\n resourceId,\n surveyId,\n}: SurveyAssistantTaskClientOptions = {}): SurveyAssistantTaskClient => {\n const run = async (\n taskId:\n | \"suggest-response-settings\"\n | \"suggest-response-name\"\n | \"suggest-item-label\"\n | \"translate-content\",\n input: unknown,\n context: SurveyAssistantTaskContext,\n options?: SurveyAssistantTaskExecutionOptions,\n ) => {\n const modelId = options?.modelId;\n return readSurveyAssistantJson(\n await fetch(api, {\n body: JSON.stringify({\n taskId,\n input,\n context,\n ...(options?.mode ? { mode: options.mode } : {}),\n ...(modelId ? { modelId } : {}),\n ...(resourceId ? { resourceId } : {}),\n ...(surveyId ? { surveyId } : {}),\n }),\n headers: { \"content-type\": \"application/json\" },\n method: \"POST\",\n signal: options?.signal,\n }),\n \"The survey assistant task could not be completed.\",\n );\n };\n\n return {\n async suggestResponseSettings(input, context, options) {\n return surveyAssistantSuggestResponseSettingsResultSchema.parse(\n await run(\"suggest-response-settings\", input, context, options),\n );\n },\n async suggestResponseName(input, context, options) {\n return surveyAssistantSuggestResponseNameResultSchema.parse(\n await run(\"suggest-response-name\", input, context, options),\n );\n },\n async suggestItemLabel(input, context, options) {\n return surveyAssistantSuggestItemLabelResultSchema.parse(\n await run(\"suggest-item-label\", input, context, options),\n );\n },\n async translateContent(input, context, options) {\n return surveyAssistantTranslateContentResultSchema.parse(\n await run(\"translate-content\", input, context, options),\n );\n },\n };\n};\n","import type { SurveyApplyResult, SurveyBatchApplyResult, SurveyChangeSet } from \"../protocol\";\nimport type { SurveyAssistantController } from \"./controller\";\n\nexport interface CreateSurveyAssistantControllerProxyOptions {\n notReadyMessage?: string;\n}\n\nexport interface SurveyAssistantControllerBridge {\n controller: SurveyAssistantController;\n setController(controller: SurveyAssistantController | null | undefined): void;\n}\n\nconst failedResult = (change: SurveyChangeSet, message: string): SurveyApplyResult => ({\n status: \"failed\",\n changeId: change.id,\n summary: change.summary,\n message,\n appliedOperations: 0,\n});\n\nexport const createSurveyAssistantControllerProxy = (\n getController: () => SurveyAssistantController | null | undefined,\n {\n notReadyMessage = \"The survey editor is not ready.\",\n }: CreateSurveyAssistantControllerProxyOptions = {},\n): SurveyAssistantController => ({\n getSnapshot: () => getController()?.getSnapshot() ?? null,\n applyAssistantChanges: (changes): SurveyBatchApplyResult => {\n const controller = getController();\n if (!controller) {\n return { results: changes.map((change) => failedResult(change, notReadyMessage)) };\n }\n return controller.applyAssistantChanges(changes);\n },\n});\n\nexport const createSurveyAssistantControllerBridge = (\n options?: CreateSurveyAssistantControllerProxyOptions,\n): SurveyAssistantControllerBridge => {\n let currentController: SurveyAssistantController | null | undefined;\n return {\n controller: createSurveyAssistantControllerProxy(() => currentController, options),\n setController(controller) {\n currentController = controller;\n },\n };\n};\n"],"mappings":";;AAOA,IAAa,6BAAb,cAAgD,MAAM;CACpD;CACA;CACA;CACA;CACA;CAEA,YACE,MACA,SACA,YAAY,OACZ,cAGI,CAAC,GACL;EACA,MAAM,OAAO;EACb,KAAK,OAAO;EACZ,KAAK,OAAO;EACZ,KAAK,YAAY;EACjB,KAAK,iBAAiB,YAAY;EAClC,KAAK,oBAAoB,YAAY;EACrC,KAAK,kBAAkB,YAAY;CACrC;AACF;AAEA,MAAa,0BAA0B,OACrC,UACA,WAAW,oDACR;CACH,IAAI,CAAC,SA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ACrD,wBAAwB,YAAoC;EAC1D,MAAM,aAAa,cAAc;EACjC,IAAI,CAAC,YACH,OAAO,EAAE,SAAS,QAAQ,KAAK,WAAW,aAAa,QAAQ,eAAe,CAAC,EAAE;EAEnF,OAAO,WAAW,sBAAsB,OAAO;CACjD;AACF;AAEA,MAAa,yCACX,YACoC;CACpC,IAAI;CACJ,OAAO;EACL,YAAY,2CAA2C,mBAAmB,OAAO;EACjF,cAAc,YAAY;GACxB,oBAAoB;EACtB;CACF;AACF"}
@@ -1,5 +1,5 @@
1
- import { G as SurveyAssistantThread, b as SurveyAssistantTranslateContentInput, c as SurveyAssistantSuggestItemLabelInput, d as SurveyAssistantSuggestResponseNameResult, f as SurveyAssistantSuggestResponseSettingsInput, g as SurveyAssistantTaskInvocationMode, h as SurveyAssistantTaskContext, l as SurveyAssistantSuggestItemLabelResult, p as SurveyAssistantSuggestResponseSettingsResult, u as SurveyAssistantSuggestResponseNameInput, x as SurveyAssistantTranslateContentResult } from "./index-D7wT6P3t.mjs";
2
- import { Ct as SurveyEditorUIContext, h as SurveyChangeSet, m as SurveyBatchApplyResult, yt as SurveyAssistantSnapshot } from "./lifecycle-Dm8u7QFh.mjs";
1
+ import { G as SurveyAssistantThread, b as SurveyAssistantTranslateContentInput, c as SurveyAssistantSuggestItemLabelInput, d as SurveyAssistantSuggestResponseNameResult, f as SurveyAssistantSuggestResponseSettingsInput, g as SurveyAssistantTaskInvocationMode, h as SurveyAssistantTaskContext, l as SurveyAssistantSuggestItemLabelResult, p as SurveyAssistantSuggestResponseSettingsResult, u as SurveyAssistantSuggestResponseNameInput, x as SurveyAssistantTranslateContentResult } from "./index-DYHdvSE8.mjs";
2
+ import { bt as SurveyAssistantSnapshot, h as SurveyChangeSet, m as SurveyBatchApplyResult, wt as SurveyEditorUIContext } from "./lifecycle-DFzxVxpq.mjs";
3
3
  import { FileUIPart } from "ai";
4
4
  //#region src/react/thread-launcher.d.ts
5
5
  type SurveyAssistantLaunchUIContext = Partial<Omit<SurveyEditorUIContext, "history">>;
@@ -11,7 +11,7 @@ interface SurveyAssistantThreadLaunch {
11
11
  modelId?: string;
12
12
  /** Optional manual thread title. The prompt-derived automatic title is used by default. */
13
13
  title?: string;
14
- /** Turn-local editor context merged into the snapshot captured when the prompt is submitted. */
14
+ /** Opening-turn context. Its task is also persisted on the created thread. */
15
15
  uiContext?: SurveyAssistantLaunchUIContext;
16
16
  }
17
17
  interface SurveyAssistantThreadLauncher {
@@ -62,4 +62,4 @@ declare const createSurveyAssistantControllerProxy: (getController: () => Survey
62
62
  declare const createSurveyAssistantControllerBridge: (options?: CreateSurveyAssistantControllerProxyOptions) => SurveyAssistantControllerBridge;
63
63
  //#endregion
64
64
  export { SurveyAssistantTaskClient as a, createSurveyAssistantTaskClient as c, SurveyAssistantThreadLaunch as d, SurveyAssistantThreadLauncher as f, createSurveyAssistantControllerProxy as i, SurveyAssistantController as l, SurveyAssistantControllerBridge as n, SurveyAssistantTaskClientOptions as o, createSurveyAssistantThreadLauncher as p, createSurveyAssistantControllerBridge as r, SurveyAssistantTaskExecutionOptions as s, CreateSurveyAssistantControllerProxyOptions as t, SurveyAssistantLaunchUIContext as u };
65
- //# sourceMappingURL=controller-proxy-D7uQfm5f.d.mts.map
65
+ //# sourceMappingURL=controller-proxy-Cmzdr9tV.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"controller-proxy-D7uQfm5f.d.mts","names":[],"sources":["../src/react/thread-launcher.ts","../src/react/controller.ts","../src/react/task-client.ts","../src/react/controller-proxy.ts"],"mappings":";;;;KAOY,iCAAiC,QAAQ,KAAK;UAEzC;;EAEf;EACA,QAAQ;;EAER;;EAEA;;EAEA,YAAY;;UAGG;;;;;EAKf,YAAY,OAAO,8BAA8B,QAAQ;;cA6D9C,2CAA0C;;;UCrFtC;;EAEf,eAAe;;EAEf,sBAAsB,SAAS,oBAAoB;;;;UCcpC;EACf;EACA;EACA;;UAGe;EACf,OAAO;EACP;EACA,SAAS;;UAGM;EACf,wBACE,OAAO,6CACP,SAAS,4BACT,UAAU,sCACT,QAAQ;EACX,oBACE,OAAO,yCACP,SAAS,4BACT,UAAU,sCACT,QAAQ;EACX,iBACE,OAAO,sCACP,SAAS,4BACT,UAAU,sCACT,QAAQ;EACX,iBACE,OAAO,sCACP,SAAS,4BACT,UAAU,sCACT,QAAQ;;cAGA,oCAAmC,KAAA,YAAA,aAI7C,qCAAwC;;;UCxD1B;EACf;;UAGe;EACf,YAAY;EACZ,cAAc,YAAY;;cAWf,uCACX,qBAAqB,gDACrB,oBAEG,gDACF;cAWU,wCACX,UAAU,gDACT"}
1
+ {"version":3,"file":"controller-proxy-Cmzdr9tV.d.mts","names":[],"sources":["../src/react/thread-launcher.ts","../src/react/controller.ts","../src/react/task-client.ts","../src/react/controller-proxy.ts"],"mappings":";;;;KAQY,iCAAiC,QAAQ,KAAK;UAEzC;;EAEf;EACA,QAAQ;;EAER;;EAEA;;EAEA,YAAY;;UAGG;;;;;EAKf,YAAY,OAAO,8BAA8B,QAAQ;;cA+D9C,2CAA0C;;;UCxFtC;;EAEf,eAAe;;EAEf,sBAAsB,SAAS,oBAAoB;;;;UCcpC;EACf;EACA;EACA;;UAGe;EACf,OAAO;EACP;EACA,SAAS;;UAGM;EACf,wBACE,OAAO,6CACP,SAAS,4BACT,UAAU,sCACT,QAAQ;EACX,oBACE,OAAO,yCACP,SAAS,4BACT,UAAU,sCACT,QAAQ;EACX,iBACE,OAAO,sCACP,SAAS,4BACT,UAAU,sCACT,QAAQ;EACX,iBACE,OAAO,sCACP,SAAS,4BACT,UAAU,sCACT,QAAQ;;cAGA,oCAAmC,KAAA,YAAA,aAI7C,qCAAwC;;;UCxD1B;EACf;;UAGe;EACf,YAAY;EACZ,cAAc,YAAY;;cAWf,uCACX,qBAAqB,gDACrB,oBAEG,gDACF;cAWU,wCACX,UAAU,gDACT"}