@case-framework/survey-assistant 0.6.0 → 0.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (135) hide show
  1. package/README.md +67 -7
  2. package/dist/{attachments-B0hg3vpT.mjs → attachments-BuNni5vB.mjs} +1 -1
  3. package/dist/{attachments-B0hg3vpT.mjs.map → attachments-BuNni5vB.mjs.map} +1 -1
  4. package/dist/{authoring-references-CW38pYzK.mjs → authoring-references-DbuOKerg.mjs} +13 -4
  5. package/dist/authoring-references-DbuOKerg.mjs.map +1 -0
  6. package/dist/{capabilities-DVTfogjv.d.mts → capabilities-CmeeAjEc.d.mts} +3 -4
  7. package/dist/capabilities-CmeeAjEc.d.mts.map +1 -0
  8. package/dist/capabilities-DCMA71PP.mjs +58 -0
  9. package/dist/capabilities-DCMA71PP.mjs.map +1 -0
  10. package/dist/capabilities-default.d.mts +13 -12
  11. package/dist/capabilities-default.d.mts.map +1 -1
  12. package/dist/capabilities-default.mjs +2 -414
  13. package/dist/{constants-BMGTgfjv.d.mts → constants-B6HzpEsx.d.mts} +7 -28
  14. package/dist/constants-B6HzpEsx.d.mts.map +1 -0
  15. package/dist/{constants-0UHGFcRJ.mjs → constants-Ct-vv9cu.mjs} +1 -1
  16. package/dist/{constants-0UHGFcRJ.mjs.map → constants-Ct-vv9cu.mjs.map} +1 -1
  17. package/dist/controller-proxy-D7uQfm5f.d.mts +65 -0
  18. package/dist/controller-proxy-D7uQfm5f.d.mts.map +1 -0
  19. package/dist/{controller-proxy-DMTqer6T.mjs → controller-proxy-DEeFl9IA.mjs} +29 -26
  20. package/dist/controller-proxy-DEeFl9IA.mjs.map +1 -0
  21. package/dist/default-fhSon2RM.mjs +760 -0
  22. package/dist/default-fhSon2RM.mjs.map +1 -0
  23. package/dist/{digest-SJmoYVaK.d.mts → digest-C39WyAWG.d.mts} +2 -3
  24. package/dist/digest-C39WyAWG.d.mts.map +1 -0
  25. package/dist/digest.d.mts +1 -1
  26. package/dist/digest.mjs.map +1 -1
  27. package/dist/{engine-CQwOAcwK.mjs → engine-nXoCWYpQ.mjs} +2821 -2018
  28. package/dist/engine-nXoCWYpQ.mjs.map +1 -0
  29. package/dist/engine.d.mts +3 -3
  30. package/dist/engine.mjs +3 -3
  31. package/dist/{fair-guidance-CRYCRxQm.mjs → fair-guidance-BmO4PswW.mjs} +1 -1
  32. package/dist/{fair-guidance-CRYCRxQm.mjs.map → fair-guidance-BmO4PswW.mjs.map} +1 -1
  33. package/dist/{index-D6nqkz0O.d.mts → index-Ciq7vHIs.d.mts} +121 -197
  34. package/dist/index-Ciq7vHIs.d.mts.map +1 -0
  35. package/dist/{index-DvTqML-0.d.mts → index-D7wT6P3t.d.mts} +294 -63
  36. package/dist/index-D7wT6P3t.d.mts.map +1 -0
  37. package/dist/index-WB5kfnz0.d.mts +348 -0
  38. package/dist/index-WB5kfnz0.d.mts.map +1 -0
  39. package/dist/{index-B0lxsAzx.d.mts → index-r5riv4md.d.mts} +50 -29
  40. package/dist/index-r5riv4md.d.mts.map +1 -0
  41. package/dist/{lifecycle-BmGAIUlv.d.mts → lifecycle-Dm8u7QFh.d.mts} +40 -18
  42. package/dist/lifecycle-Dm8u7QFh.d.mts.map +1 -0
  43. package/dist/{memory-thread-repository-CjFGVNZh.mjs → memory-thread-repository-DAnOGIB3.mjs} +89 -34
  44. package/dist/memory-thread-repository-DAnOGIB3.mjs.map +1 -0
  45. package/dist/{protocol-DJUP4gc0.mjs → protocol-CF4Bh_Ch.mjs} +182 -50
  46. package/dist/protocol-CF4Bh_Ch.mjs.map +1 -0
  47. package/dist/protocol.d.mts +4 -4
  48. package/dist/protocol.mjs +3 -3
  49. package/dist/react-C_GY-Fsc.mjs +1727 -0
  50. package/dist/react-C_GY-Fsc.mjs.map +1 -0
  51. package/dist/react-integration.d.mts +2 -2
  52. package/dist/react-integration.mjs +2 -2
  53. package/dist/react.d.mts +3 -3
  54. package/dist/react.mjs +3 -3
  55. package/dist/references/assistant-operations.md +143 -68
  56. package/dist/references/core-rules.md +6 -3
  57. package/dist/references/embedded-forms.md +34 -14
  58. package/dist/references/expressions.md +238 -48
  59. package/dist/references/fair-by-design.md +9 -9
  60. package/dist/references/item-types.md +306 -72
  61. package/dist/references/localization.md +5 -4
  62. package/dist/references/response-variables.md +38 -0
  63. package/dist/references/rich-text-content.md +60 -27
  64. package/dist/references/source-material-surveys.md +13 -5
  65. package/dist/references/survey-data-model.md +32 -9
  66. package/dist/{request-context-BjTHNcDd.mjs → request-context-Dg4jSwN1.mjs} +4 -10
  67. package/dist/request-context-Dg4jSwN1.mjs.map +1 -0
  68. package/dist/{request-guardrails-TmgQtqp4.mjs → request-guardrails-C0ugBOp0.mjs} +6 -5
  69. package/dist/request-guardrails-C0ugBOp0.mjs.map +1 -0
  70. package/dist/server-agent.d.mts +53 -44
  71. package/dist/server-agent.d.mts.map +1 -1
  72. package/dist/server-agent.mjs +48 -27
  73. package/dist/server-agent.mjs.map +1 -1
  74. package/dist/server-runtime.d.mts +36 -49
  75. package/dist/server-runtime.d.mts.map +1 -1
  76. package/dist/server-runtime.mjs +17 -12
  77. package/dist/server-runtime.mjs.map +1 -1
  78. package/dist/server-tasks.d.mts +2 -2
  79. package/dist/server-tasks.mjs +2 -313
  80. package/dist/server-tools.d.mts +1 -1
  81. package/dist/server-tools.mjs +1 -1
  82. package/dist/server.d.mts +13 -36
  83. package/dist/server.d.mts.map +1 -1
  84. package/dist/server.mjs +5 -5
  85. package/dist/server.mjs.map +1 -1
  86. package/dist/storage-postgres.d.mts +9 -25
  87. package/dist/storage-postgres.d.mts.map +1 -1
  88. package/dist/storage-postgres.mjs +5 -4
  89. package/dist/storage-postgres.mjs.map +1 -1
  90. package/dist/{tasks-DxzD25Zc.d.mts → tasks-B9h3LPam.d.mts} +19 -35
  91. package/dist/tasks-B9h3LPam.d.mts.map +1 -0
  92. package/dist/tasks-BZEiwgxA.mjs +396 -0
  93. package/dist/tasks-BZEiwgxA.mjs.map +1 -0
  94. package/dist/thread-documents-DrHbaXqP.d.mts +119 -0
  95. package/dist/thread-documents-DrHbaXqP.d.mts.map +1 -0
  96. package/dist/{thread-handlers-AbQbt4sX.d.mts → thread-handlers-Bef0td9N.d.mts} +10 -40
  97. package/dist/thread-handlers-Bef0td9N.d.mts.map +1 -0
  98. package/dist/{tools-CFh35R4d.mjs → tools-CEsv-WoO.mjs} +705 -578
  99. package/dist/tools-CEsv-WoO.mjs.map +1 -0
  100. package/dist/ui.css +1 -1
  101. package/dist/ui.d.mts +17 -55
  102. package/dist/ui.d.mts.map +1 -1
  103. package/dist/ui.mjs +759 -171
  104. package/dist/ui.mjs.map +1 -1
  105. package/docs/integration.md +51 -1
  106. package/package.json +49 -42
  107. package/dist/authoring-references-CW38pYzK.mjs.map +0 -1
  108. package/dist/capabilities-DVTfogjv.d.mts.map +0 -1
  109. package/dist/capabilities-default.mjs.map +0 -1
  110. package/dist/constants-BMGTgfjv.d.mts.map +0 -1
  111. package/dist/controller-proxy-DMTqer6T.mjs.map +0 -1
  112. package/dist/controller-proxy-mRvez2qw.d.mts +0 -85
  113. package/dist/controller-proxy-mRvez2qw.d.mts.map +0 -1
  114. package/dist/digest-SJmoYVaK.d.mts.map +0 -1
  115. package/dist/engine-CQwOAcwK.mjs.map +0 -1
  116. package/dist/form-authoring-kQDgC5oz.mjs +0 -155
  117. package/dist/form-authoring-kQDgC5oz.mjs.map +0 -1
  118. package/dist/index-B0lxsAzx.d.mts.map +0 -1
  119. package/dist/index-BS-Xjk1h.d.mts +0 -224
  120. package/dist/index-BS-Xjk1h.d.mts.map +0 -1
  121. package/dist/index-D6nqkz0O.d.mts.map +0 -1
  122. package/dist/index-DvTqML-0.d.mts.map +0 -1
  123. package/dist/lifecycle-BmGAIUlv.d.mts.map +0 -1
  124. package/dist/memory-thread-repository-CjFGVNZh.mjs.map +0 -1
  125. package/dist/protocol-DJUP4gc0.mjs.map +0 -1
  126. package/dist/react-Dqlmasrs.mjs +0 -768
  127. package/dist/react-Dqlmasrs.mjs.map +0 -1
  128. package/dist/request-context-BjTHNcDd.mjs.map +0 -1
  129. package/dist/request-guardrails-TmgQtqp4.mjs.map +0 -1
  130. package/dist/server-tasks.mjs.map +0 -1
  131. package/dist/tasks-DxzD25Zc.d.mts.map +0 -1
  132. package/dist/thread-documents-rmd6nyX9.d.mts +0 -107
  133. package/dist/thread-documents-rmd6nyX9.d.mts.map +0 -1
  134. package/dist/thread-handlers-AbQbt4sX.d.mts.map +0 -1
  135. package/dist/tools-CFh35R4d.mjs.map +0 -1
@@ -1,9 +1,10 @@
1
- import { i as AssistantItemTypeManifest, o as SurveyAssistantCapabilityManifest } from "./capabilities-DVTfogjv.mjs";
2
- import { p as SurveyAssistantTaskContext } from "./index-DvTqML-0.mjs";
3
- import { Ct as SurveyDocumentSnapshot, F as SurveyValidationIssue, I as SurveyValidationResult, N as SurveyOperation, Pt as JsonValue$1, f as SurveyAssistantTurnFinal, h as SurveyChangeSet, wt as SurveyDocumentVersion } from "./lifecycle-BmGAIUlv.mjs";
1
+ import { i as AssistantItemTypeManifest, o as SurveyAssistantCapabilityManifest } from "./capabilities-CmeeAjEc.mjs";
2
+ import "./digest-C39WyAWG.mjs";
3
+ import { h as SurveyAssistantTaskContext } from "./index-D7wT6P3t.mjs";
4
+ import { F as SurveyValidationIssue, I as SurveyValidationResult, Mt as JsonValue$1, N as SurveyOperation, St as SurveyDocumentVersion, f as SurveyAssistantTurnFinal, h as SurveyChangeSet, xt as SurveyDocumentSnapshot } from "./lifecycle-Dm8u7QFh.mjs";
4
5
  import { z } from "zod";
5
- import { JsonExpression, JsonPatchOperation, RawSurvey, RawSurveyItem, ResponseValue, SurveyExpressionReferenceDiagnostic, SurveyExpressionResponseSlot, SurveyTranslations, ValueType } from "@case-framework/survey-core";
6
-
6
+ import { Content, ItemTypeRegistry, JsonExpression, JsonPatchOperation, RawSurvey, RawSurveyItem, ResponseSlotDefinition, ResponseValue, SurveyExpressionReferenceDiagnostic, SurveyExpressionResponseSlot, SurveyTranslations, ValueType } from "@case-framework/survey-core";
7
+ import { FormAuthoringMode, getFormAuthoringMode as getFormAuthoringMode$1, hasSingleFormField, isCompatibleSimpleFieldUpsert as isCompatibleSimpleFieldUpsert$1, isValidSimpleFormConfig as isValidSimpleFormConfig$1, normalizeFormAuthoringConfig as normalizeFormAuthoringConfig$1, transitionFormAuthoringMode as transitionFormAuthoringMode$1 } from "@case-framework/survey-items/form";
7
8
  //#region src/engine/capabilities.d.ts
8
9
  interface AssistantCapabilityReference {
9
10
  topic: string;
@@ -16,10 +17,23 @@ interface AssistantItemInspection {
16
17
  }
17
18
  interface AssistantItemCapabilityAdapter {
18
19
  manifest: AssistantItemTypeManifest;
20
+ /** Trusted server-safe core shared with the player, including response activation dependencies. */
21
+ itemCore?: ItemTypeRegistry[string];
19
22
  references?: AssistantCapabilityReference[];
23
+ configurationSchema?: z.ZodType;
24
+ materializePreset?: (presetId: string, locale: string) => {
25
+ config: RawSurveyItem["config"];
26
+ translations: NonNullable<Extract<SurveyOperation, {
27
+ kind: "create-item";
28
+ }>["translations"]>;
29
+ };
30
+ validContentKeys?: (item: RawSurveyItem) => string[];
20
31
  normalizeCreate?: (item: RawSurveyItem) => RawSurveyItem;
32
+ requiredCreateContentKeys?: (item: RawSurveyItem) => string[];
21
33
  validateItem?: (item: RawSurveyItem) => SurveyValidationIssue[];
22
34
  supportsOperation?: (operation: SurveyOperation) => boolean;
35
+ deriveResponseSlotDefinitions?: (item: RawSurveyItem) => ResponseSlotDefinition[];
36
+ /** Type-only inspection adapter. Creatable response items require full definitions. */
23
37
  deriveResponseSlots?: (item: RawSurveyItem) => Record<string, ValueType>;
24
38
  inspectItem?: (item: RawSurveyItem) => AssistantItemInspection;
25
39
  }
@@ -27,50 +41,18 @@ interface SurveyAssistantCapabilitySet {
27
41
  manifest: SurveyAssistantCapabilityManifest;
28
42
  byItemType: ReadonlyMap<string, AssistantItemCapabilityAdapter>;
29
43
  }
30
- declare const resolveAssistantCapabilityReference: ({
31
- capabilities,
32
- itemType,
33
- topic
34
- }: {
44
+ declare const resolveAssistantCapabilityReference: ({ capabilities, itemType, topic }: {
35
45
  capabilities: SurveyAssistantCapabilitySet | undefined;
36
46
  itemType: string;
37
47
  topic: string;
38
48
  }) => AssistantCapabilityReference | undefined;
39
- declare const inspectAssistantItem: ({
40
- capabilities,
41
- item
42
- }: {
49
+ declare const inspectAssistantItem: ({ capabilities, item }: {
43
50
  capabilities: SurveyAssistantCapabilitySet | undefined;
44
51
  item: RawSurveyItem;
45
52
  }) => AssistantItemInspection | undefined;
46
- type AssistantItemCreationResolution = {
47
- kind: "deterministic";
48
- } | {
49
- kind: "ui-intent";
50
- intent: {
51
- kind: "open-create-item";
52
- itemType: string;
53
- parentItemId?: string;
54
- };
55
- } | {
56
- kind: "unsupported";
57
- reason: string;
58
- };
59
53
  declare const createSurveyAssistantCapabilities: (capabilities: readonly AssistantItemCapabilityAdapter[]) => SurveyAssistantCapabilitySet;
60
54
  declare const getDeterministicCreateItemTypes: (manifest: SurveyAssistantCapabilityManifest) => string[];
61
- declare const resolveAssistantItemCreation: ({
62
- itemType,
63
- manifest,
64
- parentItemId
65
- }: {
66
- itemType: string;
67
- manifest: SurveyAssistantCapabilityManifest;
68
- parentItemId?: string;
69
- }) => AssistantItemCreationResolution;
70
- declare const createUnsupportedItemCapability: ({
71
- displayName,
72
- itemType
73
- }: {
55
+ declare const createUnsupportedItemCapability: ({ displayName, itemType }: {
74
56
  displayName: string;
75
57
  itemType: string;
76
58
  }) => AssistantItemCapabilityAdapter;
@@ -78,11 +60,7 @@ declare class SurveyAssistantCapabilityMismatchError extends Error {
78
60
  readonly code = "survey-assistant-capability-mismatch";
79
61
  constructor(message?: string);
80
62
  }
81
- declare const assertSurveyAssistantCapabilities: ({
82
- manifest,
83
- trustedCapabilities,
84
- versionDigest
85
- }: {
63
+ declare const assertSurveyAssistantCapabilities: ({ manifest, trustedCapabilities, versionDigest }: {
86
64
  manifest: SurveyAssistantCapabilityManifest;
87
65
  trustedCapabilities?: SurveyAssistantCapabilitySet;
88
66
  versionDigest: string;
@@ -95,8 +73,8 @@ interface SurveyAssistantInspectionOutlineNode {
95
73
  parentId?: string;
96
74
  depth: number;
97
75
  itemType: string;
98
- key: string;
99
- fullKey: string;
76
+ editorName: string;
77
+ breadcrumb: string;
100
78
  itemLabel?: string;
101
79
  childCount: number;
102
80
  }
@@ -110,10 +88,10 @@ interface SurveyAssistantInspectionFocus {
110
88
  interface SurveyAssistantInspectionItemNode {
111
89
  itemId: string;
112
90
  itemType: string;
113
- itemKey: string;
114
- fullKey: string;
91
+ editorName: string;
92
+ breadcrumb: string;
115
93
  itemLabel?: string;
116
- siblingKeys: string[];
94
+ siblingNames: string[];
117
95
  translations: Array<{
118
96
  locale: string;
119
97
  contentKey: string;
@@ -121,11 +99,11 @@ interface SurveyAssistantInspectionItemNode {
121
99
  }>;
122
100
  descendants: SurveyAssistantInspectionItemNode[];
123
101
  }
124
- interface SurveyAssistantInspectionKeyEntry {
102
+ interface SurveyAssistantInspectionItemEntry {
125
103
  itemId: string;
126
104
  itemType: string;
127
- key: string;
128
- fullKey: string;
105
+ editorName: string;
106
+ breadcrumb: string;
129
107
  itemLabel?: string;
130
108
  path: string[];
131
109
  }
@@ -138,7 +116,7 @@ interface SurveyAssistantInspectionIndex {
138
116
  outline: SurveyAssistantInspectionOutlineNode[];
139
117
  focus?: SurveyAssistantInspectionFocus;
140
118
  focusItem?: SurveyAssistantInspectionItemNode;
141
- keyIndex: SurveyAssistantInspectionKeyEntry[];
119
+ itemIndex: SurveyAssistantInspectionItemEntry[];
142
120
  responseSlots: string[];
143
121
  focusItemTreeTruncated: boolean;
144
122
  }
@@ -150,6 +128,7 @@ interface SurveyAssistantEngineContext {
150
128
  ui: SurveyDocumentSnapshot["ui"];
151
129
  capabilities: SurveyAssistantCapabilityManifest;
152
130
  responseSlotTypes: SurveyAssistantResponseSlotTypes;
131
+ responseVariables: import("@case-framework/survey-core").OwnedResponseSlotDefinition[];
153
132
  inspection: SurveyAssistantInspectionIndex;
154
133
  trustedCapabilities?: SurveyAssistantCapabilitySet;
155
134
  }
@@ -162,14 +141,7 @@ declare const createSurveyAssistantEngineContext: (document: SurveyDocumentSnaps
162
141
  //#region src/engine/expression-validation.d.ts
163
142
  type ResponseSlotTypeLookup = Record<string, ValueType | undefined>;
164
143
  declare const inferExpressionReturnType: (expression: JsonExpression | undefined, responseSlotTypes: ResponseSlotTypeLookup) => ValueType | undefined;
165
- declare const validateExpression: ({
166
- expression,
167
- expectedReturnType,
168
- issues,
169
- operationIndex,
170
- responseSlotTypes,
171
- scope
172
- }: {
144
+ declare const validateExpression: ({ expression, expectedReturnType, issues, operationIndex, responseSlotTypes, scope }: {
173
145
  expression: JsonExpression | undefined;
174
146
  expectedReturnType?: ValueType;
175
147
  issues: SurveyValidationIssue[];
@@ -181,6 +153,7 @@ declare const validateExpression: ({
181
153
  //#region src/engine/expression-reference-integrity.d.ts
182
154
  declare const deriveSurveyExpressionResponseSlots: (survey: RawSurvey, trustedCapabilities?: SurveyAssistantCapabilitySet) => SurveyExpressionResponseSlot[];
183
155
  declare const analyzeSurveyAssistantExpressionReferences: (survey: RawSurvey, trustedCapabilities?: SurveyAssistantCapabilitySet) => SurveyExpressionReferenceDiagnostic[];
156
+ declare const getSurveyAssistantExpressionDiagnosticGuidance: (diagnostic: Pick<SurveyExpressionReferenceDiagnostic, "category" | "disposition">) => string;
184
157
  //#endregion
185
158
  //#region src/engine/expression-mutations.d.ts
186
159
  declare const expressionSchema: z.ZodType<JsonExpression>;
@@ -296,14 +269,16 @@ declare const expressionMutationSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
296
269
  templateKey: z.ZodString;
297
270
  }, z.core.$strip>], "kind">;
298
271
  type ExpressionMutation = z.infer<typeof expressionMutationSchema>;
299
- declare const buildExpressionMutationPatches: ({
300
- mutation,
301
- operationIndex,
302
- issues,
303
- patches,
304
- responseSlotTypes,
305
- snapshot
306
- }: {
272
+ /** Compile an expression delta in order, without mutating the accepted turn draft.
273
+ * Expression mutations cannot change item structure or response slots, so the
274
+ * immutable indexes remain valid while each mutation reads the preceding result.
275
+ * The caller validates and stages the complete delta atomically.
276
+ */
277
+ declare const buildExpressionMutationBatch: (mutations: ExpressionMutation[], snapshot: SurveyAssistantEngineContext) => {
278
+ issues: SurveyValidationIssue[];
279
+ patches: JsonPatchOperation[];
280
+ };
281
+ declare const buildExpressionMutationPatches: ({ mutation, operationIndex, issues, patches, responseSlotTypes, snapshot }: {
307
282
  mutation: ExpressionMutation;
308
283
  operationIndex: number;
309
284
  issues: SurveyValidationIssue[];
@@ -318,14 +293,14 @@ declare const MAX_LIMIT = 50;
318
293
  declare const itemSummarySchema: z.ZodObject<{
319
294
  itemId: z.ZodString;
320
295
  itemType: z.ZodString;
321
- key: z.ZodString;
322
- fullKey: z.ZodString;
296
+ editorName: z.ZodString;
297
+ breadcrumb: z.ZodString;
323
298
  itemLabel: z.ZodOptional<z.ZodString>;
324
299
  parentId: z.ZodOptional<z.ZodString>;
325
300
  depth: z.ZodOptional<z.ZodNumber>;
326
301
  childCount: z.ZodOptional<z.ZodNumber>;
327
302
  path: z.ZodOptional<z.ZodArray<z.ZodString>>;
328
- siblingKeys: z.ZodOptional<z.ZodArray<z.ZodString>>;
303
+ siblingNames: z.ZodOptional<z.ZodArray<z.ZodString>>;
329
304
  }, z.core.$strip>;
330
305
  type ItemSummary = z.infer<typeof itemSummarySchema>;
331
306
  declare const translationEntrySchema: z.ZodObject<{
@@ -337,7 +312,7 @@ type TranslationEntry = z.infer<typeof translationEntrySchema>;
337
312
  declare const choiceOptionDetailsSchema: z.ZodObject<{
338
313
  position: z.ZodNumber;
339
314
  id: z.ZodString;
340
- key: z.ZodOptional<z.ZodString>;
315
+ code: z.ZodOptional<z.ZodString>;
341
316
  labelContentKey: z.ZodString;
342
317
  hasDisplayCondition: z.ZodOptional<z.ZodBoolean>;
343
318
  embeddedFormItemId: z.ZodOptional<z.ZodString>;
@@ -348,12 +323,11 @@ declare const choiceOptionDetailsSchema: z.ZodObject<{
348
323
  }>>;
349
324
  embeddedFormSimpleModeValid: z.ZodOptional<z.ZodBoolean>;
350
325
  embeddedFormTranslationPrefix: z.ZodOptional<z.ZodString>;
351
- embeddedFormResponseSlotPrefix: z.ZodOptional<z.ZodString>;
352
326
  }, z.core.$strip>;
353
327
  declare const formSelectOptionDetailsSchema: z.ZodObject<{
354
328
  position: z.ZodNumber;
355
329
  id: z.ZodString;
356
- value: z.ZodOptional<z.ZodString>;
330
+ code: z.ZodOptional<z.ZodString>;
357
331
  labelContentKey: z.ZodString;
358
332
  }, z.core.$strip>;
359
333
  declare const formFieldGroupLayoutSchema: z.ZodObject<{
@@ -366,7 +340,7 @@ declare const formFieldGroupLayoutSchema: z.ZodObject<{
366
340
  declare const formFieldDetailsSchema: z.ZodObject<{
367
341
  position: z.ZodNumber;
368
342
  id: z.ZodString;
369
- key: z.ZodString;
343
+ variableName: z.ZodString;
370
344
  type: z.ZodString;
371
345
  responseSlotId: z.ZodString;
372
346
  labelContentKey: z.ZodString;
@@ -383,7 +357,7 @@ declare const formFieldDetailsSchema: z.ZodObject<{
383
357
  selectOptions: z.ZodOptional<z.ZodArray<z.ZodObject<{
384
358
  position: z.ZodNumber;
385
359
  id: z.ZodString;
386
- value: z.ZodOptional<z.ZodString>;
360
+ code: z.ZodOptional<z.ZodString>;
387
361
  labelContentKey: z.ZodString;
388
362
  }, z.core.$strip>>>;
389
363
  }, z.core.$strip>;
@@ -404,7 +378,7 @@ declare const formFieldGroupDetailsSchema: z.ZodObject<{
404
378
  fields: z.ZodArray<z.ZodObject<{
405
379
  position: z.ZodNumber;
406
380
  id: z.ZodString;
407
- key: z.ZodString;
381
+ variableName: z.ZodString;
408
382
  type: z.ZodString;
409
383
  responseSlotId: z.ZodString;
410
384
  labelContentKey: z.ZodString;
@@ -421,15 +395,15 @@ declare const formFieldGroupDetailsSchema: z.ZodObject<{
421
395
  selectOptions: z.ZodOptional<z.ZodArray<z.ZodObject<{
422
396
  position: z.ZodNumber;
423
397
  id: z.ZodString;
424
- value: z.ZodOptional<z.ZodString>;
398
+ code: z.ZodOptional<z.ZodString>;
425
399
  labelContentKey: z.ZodString;
426
400
  }, z.core.$strip>>>;
427
401
  }, z.core.$strip>>;
428
402
  }, z.core.$strip>;
429
403
  declare const itemConfigDetailsSchema: z.ZodObject<{
430
404
  kind: z.ZodEnum<{
431
- choice: "choice";
432
405
  form: "form";
406
+ choice: "choice";
433
407
  generic: "generic";
434
408
  }>;
435
409
  summary: z.ZodArray<z.ZodString>;
@@ -442,7 +416,7 @@ declare const itemConfigDetailsSchema: z.ZodObject<{
442
416
  choiceOptions: z.ZodOptional<z.ZodArray<z.ZodObject<{
443
417
  position: z.ZodNumber;
444
418
  id: z.ZodString;
445
- key: z.ZodOptional<z.ZodString>;
419
+ code: z.ZodOptional<z.ZodString>;
446
420
  labelContentKey: z.ZodString;
447
421
  hasDisplayCondition: z.ZodOptional<z.ZodBoolean>;
448
422
  embeddedFormItemId: z.ZodOptional<z.ZodString>;
@@ -453,7 +427,6 @@ declare const itemConfigDetailsSchema: z.ZodObject<{
453
427
  }>>;
454
428
  embeddedFormSimpleModeValid: z.ZodOptional<z.ZodBoolean>;
455
429
  embeddedFormTranslationPrefix: z.ZodOptional<z.ZodString>;
456
- embeddedFormResponseSlotPrefix: z.ZodOptional<z.ZodString>;
457
430
  }, z.core.$strip>>>;
458
431
  formFieldGroups: z.ZodOptional<z.ZodArray<z.ZodObject<{
459
432
  position: z.ZodNumber;
@@ -472,7 +445,7 @@ declare const itemConfigDetailsSchema: z.ZodObject<{
472
445
  fields: z.ZodArray<z.ZodObject<{
473
446
  position: z.ZodNumber;
474
447
  id: z.ZodString;
475
- key: z.ZodString;
448
+ variableName: z.ZodString;
476
449
  type: z.ZodString;
477
450
  responseSlotId: z.ZodString;
478
451
  labelContentKey: z.ZodString;
@@ -489,7 +462,7 @@ declare const itemConfigDetailsSchema: z.ZodObject<{
489
462
  selectOptions: z.ZodOptional<z.ZodArray<z.ZodObject<{
490
463
  position: z.ZodNumber;
491
464
  id: z.ZodString;
492
- value: z.ZodOptional<z.ZodString>;
465
+ code: z.ZodOptional<z.ZodString>;
493
466
  labelContentKey: z.ZodString;
494
467
  }, z.core.$strip>>>;
495
468
  }, z.core.$strip>>;
@@ -502,7 +475,7 @@ type FormFieldGroupDetails = z.infer<typeof formFieldGroupDetailsSchema>;
502
475
  type ItemConfigDetails = z.infer<typeof itemConfigDetailsSchema>;
503
476
  type SurveyInspectionIndex = SurveyAssistantEngineContext["inspection"];
504
477
  type SurveyOutlineNode = SurveyInspectionIndex["outline"][number];
505
- type SurveyKeyIndexEntry = SurveyInspectionIndex["keyIndex"][number];
478
+ type SurveyItemIndexEntry = SurveyInspectionIndex["itemIndex"][number];
506
479
  type SurveyFocusItemNode = NonNullable<SurveyInspectionIndex["focusItem"]>;
507
480
  declare const normalizeText: (value: string | undefined) => string;
508
481
  declare const clampLimit: (limit: number | undefined) => number;
@@ -517,9 +490,9 @@ declare const sliceWithCursor: <T>(values: T[], input: {
517
490
  truncated: boolean;
518
491
  };
519
492
  declare const mapOutlineById: (snapshot: SurveyAssistantEngineContext) => Map<string, SurveyAssistantInspectionOutlineNode>;
520
- declare const mapKeyIndexById: (snapshot: SurveyAssistantEngineContext) => Map<string, SurveyAssistantInspectionKeyEntry>;
521
- /** The full-survey key index, regardless of the (possibly focus-scoped) outline. */
522
- declare const getKeyIndexEntries: (snapshot: SurveyAssistantEngineContext) => SurveyKeyIndexEntry[];
493
+ declare const mapItemIndexById: (snapshot: SurveyAssistantEngineContext) => Map<string, SurveyAssistantInspectionItemEntry>;
494
+ /** The full-survey item index, regardless of the (possibly focus-scoped) outline. */
495
+ declare const getItemIndexEntries: (snapshot: SurveyAssistantEngineContext) => SurveyItemIndexEntry[];
523
496
  declare const getRawSurvey: (snapshot: SurveyAssistantEngineContext) => Partial<RawSurvey>;
524
497
  declare const getRawSurveyItems: (snapshot: SurveyAssistantEngineContext) => RawSurveyItem[];
525
498
  declare const mapRawItemsById: (snapshot: SurveyAssistantEngineContext) => Map<string, RawSurveyItem>;
@@ -530,81 +503,69 @@ declare const buildItemTranslationEntries: (snapshot: SurveyAssistantEngineConte
530
503
  textLimit?: number;
531
504
  }) => TranslationEntry[];
532
505
  declare const summarizeOutlineNode: (node: SurveyOutlineNode) => ItemSummary;
533
- declare const summarizeKeyIndexEntry: (entry: SurveyKeyIndexEntry, outlineById: Map<string, SurveyOutlineNode>) => ItemSummary;
534
- declare const summarizeKeyIndexEntries: (entries: SurveyKeyIndexEntry[], outlineById: Map<string, SurveyOutlineNode>) => ItemSummary[];
506
+ declare const summarizeItemIndexEntry: (entry: SurveyItemIndexEntry, outlineById: Map<string, SurveyOutlineNode>) => ItemSummary;
507
+ declare const summarizeItemIndexEntries: (entries: SurveyItemIndexEntry[], outlineById: Map<string, SurveyOutlineNode>) => ItemSummary[];
535
508
  declare const buildItemConfigDetails: (rawItem: RawSurveyItem) => ItemConfigDetails | undefined;
536
509
  declare const buildEmbeddedFormDetails: (choiceOption: ChoiceOptionDetails, embeddedForm: unknown) => ItemConfigDetails | undefined;
537
510
  declare const buildConfigSearchText: (rawItem: RawSurveyItem) => string[];
538
511
  declare const summarizeFocusItemNode: (node: SurveyFocusItemNode, outlineById: Map<string, SurveyOutlineNode>) => ItemSummary;
539
- declare const summarizeItemById: (itemId: string, indexById: Map<string, SurveyKeyIndexEntry>, outlineById: Map<string, SurveyOutlineNode>) => ItemSummary | undefined;
540
- /**
541
- * Resolve an item by internal itemId, or fall back to matching on `key` /
542
- * `fullKey`. Model-facing text (outline rows, fullKey paths) only ever shows
543
- * key/fullKey, not the internal itemId, so models often pass a key like
544
- * "info_1" where an itemId is expected — this keeps that usage working.
545
- */
546
- declare const resolveItemSummary: (identifier: string, indexById: Map<string, SurveyKeyIndexEntry>, outlineById: Map<string, SurveyOutlineNode>) => ItemSummary | undefined;
512
+ declare const summarizeItemById: (itemId: string, indexById: Map<string, SurveyItemIndexEntry>, outlineById: Map<string, SurveyOutlineNode>) => ItemSummary | undefined;
513
+ /** Resolve only persistent item IDs. Search can discover names and breadcrumbs. */
514
+ declare const resolveItemSummary: (identifier: string, indexById: Map<string, SurveyItemIndexEntry>, outlineById: Map<string, SurveyOutlineNode>) => ItemSummary | undefined;
547
515
  declare const itemMatchesQuery: (item: ItemSummary, query: string) => boolean;
548
516
  /**
549
- * Direct children of `parentFullKey` derived from the full-survey key index.
517
+ * Direct children of `parentId` derived from the full-survey item index.
550
518
  * This works for any item, selected or not.
551
519
  */
552
- declare const findDirectChildrenByFullKey: (entries: SurveyKeyIndexEntry[], outlineById: Map<string, SurveyOutlineNode>, parentFullKey: string) => ItemSummary[];
520
+ declare const findDirectChildrenByParentId: (entries: SurveyItemIndexEntry[], outlineById: Map<string, SurveyOutlineNode>, parentId: string) => ItemSummary[];
553
521
  //#endregion
554
522
  //#region src/engine/normalization.d.ts
523
+ type SurveyChangeNormalizationIssue = {
524
+ path: string;
525
+ message: string;
526
+ };
555
527
  /**
556
528
  * Accepts common model-authored shorthand and converts it to the strict
557
529
  * assistant operation shape before validation. This keeps the public tool
558
530
  * compact while making it tolerant of predictable schema-near authoring
559
531
  * mistakes: nested raw translation maps, sibling config objects, choice
560
- * optionId aliases, and flat form fields.
532
+ * optionId aliases, flat form fields, and compact rich-text blocks.
561
533
  */
562
- declare const normalizeSurveyChangeOperations: (operations: unknown[], defaultLocale: string) => unknown[];
534
+ declare const normalizeSurveyChangeOperations: (operations: unknown[], defaultLocale: string) => {
535
+ operations: unknown[];
536
+ issues: SurveyChangeNormalizationIssue[];
537
+ };
563
538
  //#endregion
564
- //#region src/engine/operations.d.ts
565
- declare const MAX_SURVEY_ASSISTANT_OPERATIONS_PER_PROPOSAL = 200;
566
- declare const MAX_SURVEY_ASSISTANT_OPERATIONS_PER_TURN_DRAFT = 1000;
567
- declare const buildSurveyDocumentVersion: (snapshot: SurveyAssistantEngineContext | SurveyDocumentSnapshot) => SurveyDocumentVersion;
568
- declare const validateSurveyOperations: ({
569
- allowExpressionJsonPatches,
570
- maxOperations,
571
- operations,
572
- snapshot: snapshotInput
573
- }: {
574
- allowExpressionJsonPatches?: boolean;
575
- maxOperations?: number;
576
- operations: SurveyOperation[];
577
- snapshot: SurveyAssistantEngineContext | SurveyDocumentSnapshot | undefined;
578
- }) => SurveyValidationResult;
539
+ //#region src/engine/operation-execution.d.ts
579
540
  /**
580
541
  * Canonical pure executor for already-normalized, validated survey operation
581
542
  * semantics. Raw-draft simulation uses the returned survey directly; editor
582
543
  * adapters use it to decide domain results before recording them through the
583
544
  * editor's normal mutation and history APIs.
584
545
  */
585
- declare const executeSurveyOperationsOnRawSurvey: ({
586
- operations,
587
- survey: inputSurvey
588
- }: {
546
+ declare const executeSurveyOperationsOnRawSurvey: ({ operations, survey, capabilities }: {
589
547
  operations: SurveyOperation[];
590
548
  survey: RawSurvey;
549
+ capabilities?: SurveyAssistantCapabilitySet;
591
550
  }) => RawSurvey;
592
- /** @deprecated Prefer `executeSurveyOperationsOnRawSurvey` for new integrations. */
593
- declare const applyValidatedSurveyOperationsToDraft: ({
594
- operations,
595
- survey: inputSurvey
596
- }: {
551
+ //#endregion
552
+ //#region src/engine/operations.d.ts
553
+ declare const MAX_SURVEY_ASSISTANT_OPERATIONS_PER_PROPOSAL = 200;
554
+ declare const MAX_SURVEY_ASSISTANT_OPERATIONS_PER_TURN_DRAFT = 1000;
555
+ declare const validateSurveyTreeStructure: (survey: RawSurvey, operationId?: string, availableItemTypes?: ReadonlySet<string>) => SurveyValidationIssue[];
556
+ /** Preserve existing defects without accepting changed or additional violations. */
557
+ declare const findIntroducedSurveyStructureIssues: ({ before, after }: {
558
+ before: readonly SurveyValidationIssue[];
559
+ after: readonly SurveyValidationIssue[];
560
+ }) => SurveyValidationIssue[];
561
+ declare const buildSurveyDocumentVersion: (snapshot: SurveyAssistantEngineContext | SurveyDocumentSnapshot) => SurveyDocumentVersion;
562
+ declare const validateSurveyOperations: ({ allowExpressionJsonPatches, maxOperations, operations, snapshot: snapshotInput }: {
563
+ allowExpressionJsonPatches?: boolean;
564
+ maxOperations?: number;
597
565
  operations: SurveyOperation[];
598
- survey: RawSurvey;
599
- }) => RawSurvey;
600
- declare const createSurveyChangeSet: ({
601
- allowExpressionJsonPatches,
602
- maxOperations,
603
- operations,
604
- snapshot,
605
- summary,
606
- turnId
607
- }: {
566
+ snapshot: SurveyAssistantEngineContext | SurveyDocumentSnapshot | undefined;
567
+ }) => SurveyValidationResult;
568
+ declare const createSurveyChangeSet: ({ allowExpressionJsonPatches, maxOperations, operations, snapshot, summary, turnId }: {
608
569
  allowExpressionJsonPatches?: boolean;
609
570
  maxOperations?: number;
610
571
  operations: SurveyOperation[];
@@ -613,6 +574,12 @@ declare const createSurveyChangeSet: ({
613
574
  turnId: string;
614
575
  }) => SurveyChangeSet;
615
576
  //#endregion
577
+ //#region src/engine/mutation-recovery.d.ts
578
+ type RecoveryTargetRefinement = {
579
+ targets: string[];
580
+ replacement: string;
581
+ };
582
+ //#endregion
616
583
  //#region src/engine/turn-survey-draft.d.ts
617
584
  declare const mutationRecoveryRouteByIssueCode: {
618
585
  readonly "expression-patch-requires-specialized-tool": "expression";
@@ -623,30 +590,25 @@ type SurveyAssistantMutationRoute = (typeof mutationRecoveryRouteByIssueCode)[ke
623
590
  *
624
591
  * Mutation tools submit deltas. A successful delta replaces the previous
625
592
  * candidate with a newly validated, cumulative change set. A rejected delta
626
- * leaves the accepted draft intact and blocks authorization until a later
627
- * delta validates. Only the latest cumulative candidate can be authorized.
593
+ * leaves the accepted draft intact and blocks authorization until all of its
594
+ * operation/surface obligations have been repaired. Only the latest cumulative
595
+ * candidate can be authorized.
628
596
  */
629
597
  declare class TurnSurveyDraft {
630
598
  #private;
631
599
  readonly turnId: string;
632
- constructor(turnId?: `${string}-${string}-${string}-${string}-${string}`);
600
+ constructor(turnId?: string);
633
601
  initialize(context: SurveyAssistantEngineContext): void;
634
- stage({
635
- addressedTargets,
636
- allowExpressionJsonPatches,
637
- handledMutationRoutes,
638
- operations,
639
- snapshot,
640
- summary
641
- }: {
602
+ stage({ addressedTargets, allowExpressionJsonPatches, handledMutationRoutes, retryOfChangeIds, operations, snapshot, summary }: {
642
603
  addressedTargets?: string[];
643
604
  allowExpressionJsonPatches?: boolean;
644
605
  handledMutationRoutes?: SurveyAssistantMutationRoute[];
606
+ retryOfChangeIds?: string[];
645
607
  operations: SurveyOperation[];
646
608
  snapshot: SurveyAssistantEngineContext | SurveyDocumentSnapshot | undefined;
647
609
  summary: string;
648
610
  }): SurveyChangeSet;
649
- reject(candidate: SurveyChangeSet, addressedTargets?: Iterable<string>): SurveyChangeSet;
611
+ reject(candidate: SurveyChangeSet, addressedTargets?: Iterable<string>, refinements?: RecoveryTargetRefinement[]): SurveyChangeSet;
650
612
  finalize(status: SurveyAssistantTurnFinal["status"], createdAt?: string, details?: Pick<SurveyAssistantTurnFinal, "durationMs" | "startedAt" | "terminationReason">): SurveyAssistantTurnFinal;
651
613
  getCandidate(changeSetId: string): SurveyChangeSet | undefined;
652
614
  get draftOperations(): readonly SurveyOperation[];
@@ -655,10 +617,13 @@ declare class TurnSurveyDraft {
655
617
  }
656
618
  //#endregion
657
619
  //#region src/engine/task-context.d.ts
658
- type SurveyAssistantTaskPurpose = "suggest-item-key" | "suggest-item-label" | "translate-content";
620
+ type SurveyAssistantTaskPurpose = "suggest-response-name" | "suggest-response-settings" | "suggest-item-label" | "translate-content";
659
621
  interface BuildSurveyAssistantTaskContextOptions {
660
622
  purpose: SurveyAssistantTaskPurpose;
623
+ capabilities?: SurveyAssistantCapabilitySet;
661
624
  focusItemId?: string;
625
+ focusSlotId?: string;
626
+ slotIds?: readonly string[];
662
627
  sourceLocale?: string;
663
628
  targetLocales?: readonly string[];
664
629
  sourceTexts?: readonly string[];
@@ -683,50 +648,6 @@ declare class SurveyAssistantTaskResultCache {
683
648
  clear(): void;
684
649
  }
685
650
  //#endregion
686
- //#region src/engine/form-authoring.d.ts
687
- type FormAuthoringMode = "simple" | "custom";
688
- declare const getFormAuthoringMode: (config: unknown) => FormAuthoringMode;
689
- declare const hasSingleFormField: (config: unknown) => boolean;
690
- declare const isValidSimpleFormConfig: (config: unknown) => boolean;
691
- /**
692
- * Canonicalizes the editor-facing mode without modifying groups, fields, or translations.
693
- * Missing modes and malformed simple forms become custom; valid simple forms stay simple.
694
- */
695
- declare const normalizeFormAuthoringConfig: (config: unknown) => Record<string, unknown> | undefined;
696
- /**
697
- * Returns true only for an in-place edit of the existing sole field that the
698
- * simple editor can still represent. Adding, moving, retyping, or exposing
699
- * hidden field configuration is structural and must promote the form.
700
- */
701
- declare const isCompatibleSimpleFieldUpsert: ({
702
- config,
703
- field,
704
- groupId,
705
- index
706
- }: {
707
- config: unknown;
708
- field: Record<string, unknown> & {
709
- id: string;
710
- key: string;
711
- type: string;
712
- };
713
- groupId: string;
714
- index?: number;
715
- }) => boolean;
716
- /**
717
- * Structural form operations are a one-way transition out of simple mode unless the caller has
718
- * proved that the same sole field remains compatible with the simple editor.
719
- */
720
- declare const transitionFormAuthoringMode: ({
721
- config,
722
- fieldGroups,
723
- preserveSimpleMode
724
- }: {
725
- config: Record<string, unknown>;
726
- fieldGroups: Record<string, unknown>[];
727
- preserveSimpleMode?: boolean;
728
- }) => Record<string, unknown>;
729
- //#endregion
730
651
  //#region src/engine/audit.d.ts
731
652
  type SurveyAuditSeverity = "error" | "warning" | "info";
732
653
  type SurveyAuditCategory = "structure" | "content" | "localization" | "logic" | "responses" | "assets" | "quality";
@@ -746,7 +667,10 @@ interface SurveyQualityReviewPrinciple {
746
667
  prompt: string;
747
668
  }
748
669
  interface SurveyAuditKeyReviewEntry {
749
- kind: "item" | "choice-option" | "form-field";
670
+ kind: "response-variable" | "choice-option";
671
+ slotId: string;
672
+ valueType?: string;
673
+ computed?: boolean;
750
674
  itemId: string;
751
675
  itemKey: string;
752
676
  key: string;
@@ -788,5 +712,5 @@ declare const auditSurvey: (context: SurveyAssistantEngineContext, options?: {
788
712
  keyReviewLimit?: number;
789
713
  }) => SurveyAuditReport;
790
714
  //#endregion
791
- export { formSelectOptionDetailsSchema as $, ChoiceOptionDetails as A, CreateSurveyAssistantEngineContextOptions as At, SurveyOutlineNode as B, AssistantCapabilityReference as Bt, MAX_SURVEY_ASSISTANT_OPERATIONS_PER_TURN_DRAFT as C, expressionMutationSchema as Ct, executeSurveyOperationsOnRawSurvey as D, ResponseSlotTypeLookup as Dt, createSurveyChangeSet as E, deriveSurveyExpressionResponseSlots as Et, ItemSummary as F, SurveyAssistantInspectionKeyEntry as Ft, buildItemTranslationEntries as G, SurveyAssistantCapabilitySet as Gt, buildConfigSearchText as H, AssistantItemCreationResolution as Ht, MAX_LIMIT as I, SurveyAssistantInspectionOutlineNode as It, clampLimit as J, createUnsupportedItemCapability as Jt, buildSurveyTranslations as K, assertSurveyAssistantCapabilities as Kt, SurveyFocusItemNode as L, SurveyAssistantResponseSlotTypes as Lt, FormFieldDetails as M, SurveyAssistantInspectionFocus as Mt, FormFieldGroupDetails as N, SurveyAssistantInspectionIndex as Nt, validateSurveyOperations as O, inferExpressionReturnType as Ot, ItemConfigDetails as P, SurveyAssistantInspectionItemNode as Pt, formFieldGroupLayoutSchema as Q, resolveAssistantItemCreation as Qt, SurveyInspectionIndex as R, createSurveyAssistantEngineContext as Rt, MAX_SURVEY_ASSISTANT_OPERATIONS_PER_PROPOSAL as S, buildExpressionMutationPatches as St, buildSurveyDocumentVersion as T, analyzeSurveyAssistantExpressionReferences as Tt, buildEmbeddedFormDetails as U, AssistantItemInspection as Ut, TranslationEntry as V, AssistantItemCapabilityAdapter as Vt, buildItemConfigDetails as W, SurveyAssistantCapabilityMismatchError as Wt, formFieldDetailsSchema as X, inspectAssistantItem as Xt, findDirectChildrenByFullKey as Y, getDeterministicCreateItemTypes as Yt, formFieldGroupDetailsSchema as Z, resolveAssistantCapabilityReference as Zt, BuildSurveyAssistantTaskContextOptions as _, summarizeOutlineNode as _t, SurveyAuditSeverity as a, itemSummarySchema as at, SurveyAssistantMutationRoute as b, unique as bt, FormAuthoringMode as c, mapRawItemsById as ct, isCompatibleSimpleFieldUpsert as d, resolveItemSummary as dt, getKeyIndexEntries as et, isValidSimpleFormConfig as f, sliceWithCursor as ft, SurveyAssistantTaskResultCacheOptions as g, summarizeKeyIndexEntry as gt, SurveyAssistantTaskResultCache as h, summarizeKeyIndexEntries as ht, SurveyAuditReport as i, itemMatchesQuery as it, DEFAULT_LIMIT as j, SurveyAssistantEngineContext as jt, normalizeSurveyChangeOperations as k, validateExpression as kt, getFormAuthoringMode as l, normalizeText as lt, transitionFormAuthoringMode as m, summarizeItemById as mt, SurveyAuditFinding as n, getRawSurveyItems as nt, SurveyQualityReviewPrinciple as o, mapKeyIndexById as ot, normalizeFormAuthoringConfig as p, summarizeFocusItemNode as pt, choiceOptionDetailsSchema as q, createSurveyAssistantCapabilities as qt, SurveyAuditKeyReviewEntry as r, itemConfigDetailsSchema as rt, auditSurvey as s, mapOutlineById as st, SurveyAuditCategory as t, getRawSurvey as tt, hasSingleFormField as u, parseCursor as ut, SurveyAssistantTaskPurpose as v, summarizeRawItem as vt, applyValidatedSurveyOperationsToDraft as w, expressionSchema as wt, TurnSurveyDraft as x, ExpressionMutation as xt, buildSurveyAssistantTaskContext as y, translationEntrySchema as yt, SurveyKeyIndexEntry as z, deriveResponseSlotTypes as zt };
792
- //# sourceMappingURL=index-D6nqkz0O.d.mts.map
715
+ export { formFieldGroupLayoutSchema as $, resolveAssistantCapabilityReference as $t, normalizeSurveyChangeOperations as A, ResponseSlotTypeLookup as At, SurveyItemIndexEntry as B, SurveyAssistantResponseSlotTypes as Bt, MAX_SURVEY_ASSISTANT_OPERATIONS_PER_TURN_DRAFT as C, buildExpressionMutationBatch as Ct, validateSurveyOperations as D, analyzeSurveyAssistantExpressionReferences as Dt, findIntroducedSurveyStructureIssues as E, expressionSchema as Et, ItemConfigDetails as F, SurveyAssistantInspectionFocus as Ft, buildItemConfigDetails as G, AssistantItemInspection as Gt, TranslationEntry as H, deriveResponseSlotTypes as Ht, ItemSummary as I, SurveyAssistantInspectionIndex as It, choiceOptionDetailsSchema as J, assertSurveyAssistantCapabilities as Jt, buildItemTranslationEntries as K, SurveyAssistantCapabilityMismatchError as Kt, MAX_LIMIT as L, SurveyAssistantInspectionItemEntry as Lt, DEFAULT_LIMIT as M, validateExpression as Mt, FormFieldDetails as N, CreateSurveyAssistantEngineContextOptions as Nt, validateSurveyTreeStructure as O, deriveSurveyExpressionResponseSlots as Ot, FormFieldGroupDetails as P, SurveyAssistantEngineContext as Pt, formFieldGroupDetailsSchema as Q, inspectAssistantItem as Qt, SurveyFocusItemNode as R, SurveyAssistantInspectionItemNode as Rt, MAX_SURVEY_ASSISTANT_OPERATIONS_PER_PROPOSAL as S, ExpressionMutation as St, createSurveyChangeSet as T, expressionMutationSchema as Tt, buildConfigSearchText as U, AssistantCapabilityReference as Ut, SurveyOutlineNode as V, createSurveyAssistantEngineContext as Vt, buildEmbeddedFormDetails as W, AssistantItemCapabilityAdapter as Wt, findDirectChildrenByParentId as X, createUnsupportedItemCapability as Xt, clampLimit as Y, createSurveyAssistantCapabilities as Yt, formFieldDetailsSchema as Z, getDeterministicCreateItemTypes as Zt, BuildSurveyAssistantTaskContextOptions as _, summarizeItemIndexEntry as _t, isValidSimpleFormConfig$1 as a, itemMatchesQuery as at, SurveyAssistantMutationRoute as b, translationEntrySchema as bt, SurveyAuditCategory as c, mapOutlineById as ct, SurveyAuditReport as d, parseCursor as dt, formSelectOptionDetailsSchema as et, SurveyAuditSeverity as f, resolveItemSummary as ft, SurveyAssistantTaskResultCacheOptions as g, summarizeItemIndexEntries as gt, SurveyAssistantTaskResultCache as h, summarizeItemById as ht, isCompatibleSimpleFieldUpsert$1 as i, itemConfigDetailsSchema as it, ChoiceOptionDetails as j, inferExpressionReturnType as jt, executeSurveyOperationsOnRawSurvey as k, getSurveyAssistantExpressionDiagnosticGuidance as kt, SurveyAuditFinding as l, mapRawItemsById as lt, auditSurvey as m, summarizeFocusItemNode as mt, getFormAuthoringMode$1 as n, getRawSurvey as nt, normalizeFormAuthoringConfig$1 as o, itemSummarySchema as ot, SurveyQualityReviewPrinciple as p, sliceWithCursor as pt, buildSurveyTranslations as q, SurveyAssistantCapabilitySet as qt, hasSingleFormField as r, getRawSurveyItems as rt, transitionFormAuthoringMode$1 as s, mapItemIndexById as st, FormAuthoringMode as t, getItemIndexEntries as tt, SurveyAuditKeyReviewEntry as u, normalizeText as ut, SurveyAssistantTaskPurpose as v, summarizeOutlineNode as vt, buildSurveyDocumentVersion as w, buildExpressionMutationPatches as wt, TurnSurveyDraft as x, unique as xt, buildSurveyAssistantTaskContext as y, summarizeRawItem as yt, SurveyInspectionIndex as z, SurveyAssistantInspectionOutlineNode as zt };
716
+ //# sourceMappingURL=index-Ciq7vHIs.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index-Ciq7vHIs.d.mts","names":[],"sources":["../src/engine/capabilities.ts","../src/engine/context.ts","../src/engine/expression-validation.ts","../src/engine/expression-reference-integrity.ts","../src/engine/expression-mutations.ts","../src/engine/inspection.ts","../src/engine/normalization.ts","../src/engine/operation-execution.ts","../src/engine/operations.ts","../src/engine/mutation-recovery.ts","../src/engine/turn-survey-draft.ts","../src/engine/task-context.ts","../src/engine/task-result-cache.ts","../src/engine/audit.ts"],"mappings":";;;;;;;;UAiBiB;EACf;EACA;EACA;;UAGe;EACf;EACA,UAAU;;UAGK;EACf,UAAU;;EAEV,WAAW;EACX,aAAa;EACb,sBAAsB,EAAE;EACxB,qBACE,kBACA;IAEA,QAAQ;IACR,cAAc,YAAY,QAAQ;MAAmB;;;EAEvD,oBAAoB,MAAM;EAC1B,mBAAmB,MAAM,kBAAkB;EAC3C,6BAA6B,MAAM;EACnC,gBAAgB,MAAM,kBAAkB;EACxC,qBAAqB,WAAW;EAChC,iCAAiC,MAAM,kBAAkB;;EAEzD,uBAAuB,MAAM,kBAAkB,eAAe;EAC9D,eAAe,MAAM,kBAAkB;;UAGxB;EACf,UAAU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