@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.
- package/dist/{authoring-references-DbuOKerg.mjs → authoring-references-CmwLc_C8.mjs} +40 -32
- package/dist/authoring-references-CmwLc_C8.mjs.map +1 -0
- package/dist/capabilities-D55dq-fO.mjs +582 -0
- package/dist/capabilities-D55dq-fO.mjs.map +1 -0
- package/dist/capabilities-default.d.mts +4 -12
- package/dist/capabilities-default.d.mts.map +1 -1
- package/dist/capabilities-default.mjs +2 -2
- package/dist/capabilities-z95e1mti.d.mts +117 -0
- package/dist/capabilities-z95e1mti.d.mts.map +1 -0
- package/dist/{constants-B6HzpEsx.d.mts → constants-HL_klgJl.d.mts} +4 -4
- package/dist/{constants-B6HzpEsx.d.mts.map → constants-HL_klgJl.d.mts.map} +1 -1
- package/dist/{controller-proxy-DEeFl9IA.mjs → controller-proxy-BQ1YsVxJ.mjs} +4 -3
- package/dist/controller-proxy-BQ1YsVxJ.mjs.map +1 -0
- package/dist/{controller-proxy-D7uQfm5f.d.mts → controller-proxy-Cmzdr9tV.d.mts} +4 -4
- package/dist/{controller-proxy-D7uQfm5f.d.mts.map → controller-proxy-Cmzdr9tV.d.mts.map} +1 -1
- package/dist/default-D22AKTqE.mjs +233 -0
- package/dist/default-D22AKTqE.mjs.map +1 -0
- package/dist/{digest-C39WyAWG.d.mts → digest-FnTTDBq2.d.mts} +2 -2
- package/dist/digest-FnTTDBq2.d.mts.map +1 -0
- package/dist/digest.d.mts +1 -1
- package/dist/engine-D950TfvC.mjs +3098 -0
- package/dist/engine-D950TfvC.mjs.map +1 -0
- package/dist/engine.d.mts +4 -3
- package/dist/engine.mjs +3 -3
- package/dist/{index-WB5kfnz0.d.mts → index-B8TLBd1G.d.mts} +8 -6
- package/dist/index-B8TLBd1G.d.mts.map +1 -0
- package/dist/index-CaX3hZmr.d.mts +23813 -0
- package/dist/index-CaX3hZmr.d.mts.map +1 -0
- package/dist/{index-r5riv4md.d.mts → index-CeUlGkoU.d.mts} +27 -6
- package/dist/index-CeUlGkoU.d.mts.map +1 -0
- package/dist/{index-D7wT6P3t.d.mts → index-DYHdvSE8.d.mts} +83 -41
- package/dist/index-DYHdvSE8.d.mts.map +1 -0
- package/dist/lifecycle-DFzxVxpq.d.mts +54346 -0
- package/dist/lifecycle-DFzxVxpq.d.mts.map +1 -0
- package/dist/{memory-thread-repository-DAnOGIB3.mjs → memory-thread-repository-DmLadygY.mjs} +15 -9
- package/dist/{memory-thread-repository-DAnOGIB3.mjs.map → memory-thread-repository-DmLadygY.mjs.map} +1 -1
- package/dist/protocol-BQ7uIDYT.mjs +569 -0
- package/dist/protocol-BQ7uIDYT.mjs.map +1 -0
- package/dist/protocol.d.mts +4 -4
- package/dist/protocol.mjs +3 -2
- package/dist/{react-C_GY-Fsc.mjs → react-DybJ5pWw.mjs} +17 -11
- package/dist/react-DybJ5pWw.mjs.map +1 -0
- package/dist/react-integration.d.mts +1 -1
- package/dist/react-integration.mjs +1 -1
- package/dist/react.d.mts +2 -2
- package/dist/react.mjs +2 -2
- package/dist/references/assistant-operations.md +190 -215
- package/dist/references/core-rules.md +2 -2
- package/dist/references/element-types.md +189 -0
- package/dist/references/expressions.md +215 -238
- package/dist/references/follow-ups.md +151 -0
- package/dist/references/localization.md +26 -12
- package/dist/references/response-variables.md +3 -3
- package/dist/references/rich-text-content.md +22 -43
- package/dist/references/source-material-surveys.md +20 -25
- package/dist/references/survey-data-model.md +36 -117
- package/dist/{request-context-Dg4jSwN1.mjs → request-context-KVh8VjgH.mjs} +4 -4
- package/dist/request-context-KVh8VjgH.mjs.map +1 -0
- package/dist/server-agent.d.mts +28 -7
- package/dist/server-agent.d.mts.map +1 -1
- package/dist/server-agent.mjs +33 -25
- package/dist/server-agent.mjs.map +1 -1
- package/dist/server-runtime.d.mts +6 -5
- package/dist/server-runtime.d.mts.map +1 -1
- package/dist/server-runtime.mjs +3 -3
- package/dist/server-tasks.d.mts +1 -1
- package/dist/server-tasks.mjs +1 -1
- package/dist/server-tools.d.mts +1 -1
- package/dist/server-tools.mjs +1 -1
- package/dist/server.d.mts +7 -6
- package/dist/server.d.mts.map +1 -1
- package/dist/server.mjs +3 -3
- package/dist/{tasks-BZEiwgxA.mjs → tasks-Coh5N027.mjs} +16 -15
- package/dist/tasks-Coh5N027.mjs.map +1 -0
- package/dist/{tasks-B9h3LPam.d.mts → tasks-wb9M-bak.d.mts} +11 -11
- package/dist/{tasks-B9h3LPam.d.mts.map → tasks-wb9M-bak.d.mts.map} +1 -1
- package/dist/{thread-handlers-Bef0td9N.d.mts → thread-handlers-C3Iya92v.d.mts} +6 -5
- package/dist/thread-handlers-C3Iya92v.d.mts.map +1 -0
- package/dist/{tools-CEsv-WoO.mjs → tools-D0KBDolR.mjs} +435 -408
- package/dist/tools-D0KBDolR.mjs.map +1 -0
- package/dist/turn-survey-draft-B34lggSG.d.mts +185 -0
- package/dist/turn-survey-draft-B34lggSG.d.mts.map +1 -0
- package/dist/ui.d.mts +3 -3
- package/dist/ui.d.mts.map +1 -1
- package/dist/ui.mjs +35 -23
- package/dist/ui.mjs.map +1 -1
- package/package.json +7 -7
- package/dist/authoring-references-DbuOKerg.mjs.map +0 -1
- package/dist/capabilities-CmeeAjEc.d.mts +0 -192
- package/dist/capabilities-CmeeAjEc.d.mts.map +0 -1
- package/dist/capabilities-DCMA71PP.mjs +0 -58
- package/dist/capabilities-DCMA71PP.mjs.map +0 -1
- package/dist/controller-proxy-DEeFl9IA.mjs.map +0 -1
- package/dist/default-fhSon2RM.mjs +0 -760
- package/dist/default-fhSon2RM.mjs.map +0 -1
- package/dist/digest-C39WyAWG.d.mts.map +0 -1
- package/dist/engine-nXoCWYpQ.mjs +0 -6888
- package/dist/engine-nXoCWYpQ.mjs.map +0 -1
- package/dist/index-Ciq7vHIs.d.mts +0 -716
- package/dist/index-Ciq7vHIs.d.mts.map +0 -1
- package/dist/index-D7wT6P3t.d.mts.map +0 -1
- package/dist/index-WB5kfnz0.d.mts.map +0 -1
- package/dist/index-r5riv4md.d.mts.map +0 -1
- package/dist/lifecycle-Dm8u7QFh.d.mts +0 -545
- package/dist/lifecycle-Dm8u7QFh.d.mts.map +0 -1
- package/dist/protocol-CF4Bh_Ch.mjs +0 -1255
- package/dist/protocol-CF4Bh_Ch.mjs.map +0 -1
- package/dist/react-C_GY-Fsc.mjs.map +0 -1
- package/dist/references/embedded-forms.md +0 -146
- package/dist/references/item-types.md +0 -641
- package/dist/request-context-Dg4jSwN1.mjs.map +0 -1
- package/dist/tasks-BZEiwgxA.mjs.map +0 -1
- package/dist/thread-handlers-Bef0td9N.d.mts.map +0 -1
- package/dist/tools-CEsv-WoO.mjs.map +0 -1
|
@@ -1,716 +0,0 @@
|
|
|
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";
|
|
5
|
-
import { z } from "zod";
|
|
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";
|
|
8
|
-
//#region src/engine/capabilities.d.ts
|
|
9
|
-
interface AssistantCapabilityReference {
|
|
10
|
-
topic: string;
|
|
11
|
-
title?: string;
|
|
12
|
-
markdown: string;
|
|
13
|
-
}
|
|
14
|
-
interface AssistantItemInspection {
|
|
15
|
-
summary: string;
|
|
16
|
-
details?: JsonValue$1;
|
|
17
|
-
}
|
|
18
|
-
interface AssistantItemCapabilityAdapter {
|
|
19
|
-
manifest: AssistantItemTypeManifest;
|
|
20
|
-
/** Trusted server-safe core shared with the player, including response activation dependencies. */
|
|
21
|
-
itemCore?: ItemTypeRegistry[string];
|
|
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[];
|
|
31
|
-
normalizeCreate?: (item: RawSurveyItem) => RawSurveyItem;
|
|
32
|
-
requiredCreateContentKeys?: (item: RawSurveyItem) => string[];
|
|
33
|
-
validateItem?: (item: RawSurveyItem) => SurveyValidationIssue[];
|
|
34
|
-
supportsOperation?: (operation: SurveyOperation) => boolean;
|
|
35
|
-
deriveResponseSlotDefinitions?: (item: RawSurveyItem) => ResponseSlotDefinition[];
|
|
36
|
-
/** Type-only inspection adapter. Creatable response items require full definitions. */
|
|
37
|
-
deriveResponseSlots?: (item: RawSurveyItem) => Record<string, ValueType>;
|
|
38
|
-
inspectItem?: (item: RawSurveyItem) => AssistantItemInspection;
|
|
39
|
-
}
|
|
40
|
-
interface SurveyAssistantCapabilitySet {
|
|
41
|
-
manifest: SurveyAssistantCapabilityManifest;
|
|
42
|
-
byItemType: ReadonlyMap<string, AssistantItemCapabilityAdapter>;
|
|
43
|
-
}
|
|
44
|
-
declare const resolveAssistantCapabilityReference: ({ capabilities, itemType, topic }: {
|
|
45
|
-
capabilities: SurveyAssistantCapabilitySet | undefined;
|
|
46
|
-
itemType: string;
|
|
47
|
-
topic: string;
|
|
48
|
-
}) => AssistantCapabilityReference | undefined;
|
|
49
|
-
declare const inspectAssistantItem: ({ capabilities, item }: {
|
|
50
|
-
capabilities: SurveyAssistantCapabilitySet | undefined;
|
|
51
|
-
item: RawSurveyItem;
|
|
52
|
-
}) => AssistantItemInspection | undefined;
|
|
53
|
-
declare const createSurveyAssistantCapabilities: (capabilities: readonly AssistantItemCapabilityAdapter[]) => SurveyAssistantCapabilitySet;
|
|
54
|
-
declare const getDeterministicCreateItemTypes: (manifest: SurveyAssistantCapabilityManifest) => string[];
|
|
55
|
-
declare const createUnsupportedItemCapability: ({ displayName, itemType }: {
|
|
56
|
-
displayName: string;
|
|
57
|
-
itemType: string;
|
|
58
|
-
}) => AssistantItemCapabilityAdapter;
|
|
59
|
-
declare class SurveyAssistantCapabilityMismatchError extends Error {
|
|
60
|
-
readonly code = "survey-assistant-capability-mismatch";
|
|
61
|
-
constructor(message?: string);
|
|
62
|
-
}
|
|
63
|
-
declare const assertSurveyAssistantCapabilities: ({ manifest, trustedCapabilities, versionDigest }: {
|
|
64
|
-
manifest: SurveyAssistantCapabilityManifest;
|
|
65
|
-
trustedCapabilities?: SurveyAssistantCapabilitySet;
|
|
66
|
-
versionDigest: string;
|
|
67
|
-
}) => void;
|
|
68
|
-
//#endregion
|
|
69
|
-
//#region src/engine/context.d.ts
|
|
70
|
-
type SurveyAssistantResponseSlotTypes = Record<string, ValueType | undefined>;
|
|
71
|
-
interface SurveyAssistantInspectionOutlineNode {
|
|
72
|
-
itemId: string;
|
|
73
|
-
parentId?: string;
|
|
74
|
-
depth: number;
|
|
75
|
-
itemType: string;
|
|
76
|
-
editorName: string;
|
|
77
|
-
breadcrumb: string;
|
|
78
|
-
itemLabel?: string;
|
|
79
|
-
childCount: number;
|
|
80
|
-
}
|
|
81
|
-
interface SurveyAssistantInspectionFocus {
|
|
82
|
-
focusItemId: string;
|
|
83
|
-
parentItemId?: string;
|
|
84
|
-
pathItemIds: string[];
|
|
85
|
-
siblingItemIds: string[];
|
|
86
|
-
childItemIds: string[];
|
|
87
|
-
}
|
|
88
|
-
interface SurveyAssistantInspectionItemNode {
|
|
89
|
-
itemId: string;
|
|
90
|
-
itemType: string;
|
|
91
|
-
editorName: string;
|
|
92
|
-
breadcrumb: string;
|
|
93
|
-
itemLabel?: string;
|
|
94
|
-
siblingNames: string[];
|
|
95
|
-
translations: Array<{
|
|
96
|
-
locale: string;
|
|
97
|
-
contentKey: string;
|
|
98
|
-
text: string;
|
|
99
|
-
}>;
|
|
100
|
-
descendants: SurveyAssistantInspectionItemNode[];
|
|
101
|
-
}
|
|
102
|
-
interface SurveyAssistantInspectionItemEntry {
|
|
103
|
-
itemId: string;
|
|
104
|
-
itemType: string;
|
|
105
|
-
editorName: string;
|
|
106
|
-
breadcrumb: string;
|
|
107
|
-
itemLabel?: string;
|
|
108
|
-
path: string[];
|
|
109
|
-
}
|
|
110
|
-
/** Deterministic, request-local lookup data derived from the canonical document. */
|
|
111
|
-
interface SurveyAssistantInspectionIndex {
|
|
112
|
-
surveyKey?: string;
|
|
113
|
-
locales: string[];
|
|
114
|
-
/** All survey items except the structural root group. */
|
|
115
|
-
itemCount: number;
|
|
116
|
-
outline: SurveyAssistantInspectionOutlineNode[];
|
|
117
|
-
focus?: SurveyAssistantInspectionFocus;
|
|
118
|
-
focusItem?: SurveyAssistantInspectionItemNode;
|
|
119
|
-
itemIndex: SurveyAssistantInspectionItemEntry[];
|
|
120
|
-
responseSlots: string[];
|
|
121
|
-
focusItemTreeTruncated: boolean;
|
|
122
|
-
}
|
|
123
|
-
/** Request-local derived state built from one authoritative survey document. */
|
|
124
|
-
interface SurveyAssistantEngineContext {
|
|
125
|
-
document: SurveyDocumentSnapshot;
|
|
126
|
-
version: SurveyDocumentVersion;
|
|
127
|
-
survey: RawSurvey;
|
|
128
|
-
ui: SurveyDocumentSnapshot["ui"];
|
|
129
|
-
capabilities: SurveyAssistantCapabilityManifest;
|
|
130
|
-
responseSlotTypes: SurveyAssistantResponseSlotTypes;
|
|
131
|
-
responseVariables: import("@case-framework/survey-core").OwnedResponseSlotDefinition[];
|
|
132
|
-
inspection: SurveyAssistantInspectionIndex;
|
|
133
|
-
trustedCapabilities?: SurveyAssistantCapabilitySet;
|
|
134
|
-
}
|
|
135
|
-
interface CreateSurveyAssistantEngineContextOptions {
|
|
136
|
-
focusItemId?: string;
|
|
137
|
-
}
|
|
138
|
-
declare const deriveResponseSlotTypes: (survey: RawSurvey, trustedCapabilities?: SurveyAssistantCapabilitySet) => SurveyAssistantResponseSlotTypes;
|
|
139
|
-
declare const createSurveyAssistantEngineContext: (document: SurveyDocumentSnapshot, trustedCapabilities?: SurveyAssistantCapabilitySet, options?: CreateSurveyAssistantEngineContextOptions) => SurveyAssistantEngineContext;
|
|
140
|
-
//#endregion
|
|
141
|
-
//#region src/engine/expression-validation.d.ts
|
|
142
|
-
type ResponseSlotTypeLookup = Record<string, ValueType | undefined>;
|
|
143
|
-
declare const inferExpressionReturnType: (expression: JsonExpression | undefined, responseSlotTypes: ResponseSlotTypeLookup) => ValueType | undefined;
|
|
144
|
-
declare const validateExpression: ({ expression, expectedReturnType, issues, operationIndex, responseSlotTypes, scope }: {
|
|
145
|
-
expression: JsonExpression | undefined;
|
|
146
|
-
expectedReturnType?: ValueType;
|
|
147
|
-
issues: SurveyValidationIssue[];
|
|
148
|
-
operationIndex: number;
|
|
149
|
-
responseSlotTypes: ResponseSlotTypeLookup;
|
|
150
|
-
scope: string;
|
|
151
|
-
}) => void;
|
|
152
|
-
//#endregion
|
|
153
|
-
//#region src/engine/expression-reference-integrity.d.ts
|
|
154
|
-
declare const deriveSurveyExpressionResponseSlots: (survey: RawSurvey, trustedCapabilities?: SurveyAssistantCapabilitySet) => SurveyExpressionResponseSlot[];
|
|
155
|
-
declare const analyzeSurveyAssistantExpressionReferences: (survey: RawSurvey, trustedCapabilities?: SurveyAssistantCapabilitySet) => SurveyExpressionReferenceDiagnostic[];
|
|
156
|
-
declare const getSurveyAssistantExpressionDiagnosticGuidance: (diagnostic: Pick<SurveyExpressionReferenceDiagnostic, "category" | "disposition">) => string;
|
|
157
|
-
//#endregion
|
|
158
|
-
//#region src/engine/expression-mutations.d.ts
|
|
159
|
-
declare const expressionSchema: z.ZodType<JsonExpression>;
|
|
160
|
-
declare const expressionMutationSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
161
|
-
kind: z.ZodLiteral<"set-item-display-condition">;
|
|
162
|
-
itemId: z.ZodString;
|
|
163
|
-
expression: z.ZodType<JsonExpression, unknown, z.core.$ZodTypeInternals<JsonExpression, unknown>>;
|
|
164
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
165
|
-
kind: z.ZodLiteral<"clear-item-display-condition">;
|
|
166
|
-
itemId: z.ZodString;
|
|
167
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
168
|
-
kind: z.ZodLiteral<"set-component-display-condition">;
|
|
169
|
-
itemId: z.ZodString;
|
|
170
|
-
componentId: z.ZodString;
|
|
171
|
-
expression: z.ZodType<JsonExpression, unknown, z.core.$ZodTypeInternals<JsonExpression, unknown>>;
|
|
172
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
173
|
-
kind: z.ZodLiteral<"clear-component-display-condition">;
|
|
174
|
-
itemId: z.ZodString;
|
|
175
|
-
componentId: z.ZodString;
|
|
176
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
177
|
-
kind: z.ZodLiteral<"set-component-disabled-condition">;
|
|
178
|
-
itemId: z.ZodString;
|
|
179
|
-
componentId: z.ZodString;
|
|
180
|
-
expression: z.ZodType<JsonExpression, unknown, z.core.$ZodTypeInternals<JsonExpression, unknown>>;
|
|
181
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
182
|
-
kind: z.ZodLiteral<"clear-component-disabled-condition">;
|
|
183
|
-
itemId: z.ZodString;
|
|
184
|
-
componentId: z.ZodString;
|
|
185
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
186
|
-
kind: z.ZodLiteral<"set-validation-expression">;
|
|
187
|
-
itemId: z.ZodString;
|
|
188
|
-
validationKey: z.ZodString;
|
|
189
|
-
expression: z.ZodType<JsonExpression, unknown, z.core.$ZodTypeInternals<JsonExpression, unknown>>;
|
|
190
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
191
|
-
kind: z.ZodLiteral<"clear-validation-expression">;
|
|
192
|
-
itemId: z.ZodString;
|
|
193
|
-
validationKey: z.ZodString;
|
|
194
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
195
|
-
kind: z.ZodLiteral<"set-prefill">;
|
|
196
|
-
itemId: z.ZodString;
|
|
197
|
-
prefill: z.ZodObject<{
|
|
198
|
-
id: z.ZodString;
|
|
199
|
-
target: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
200
|
-
type: z.ZodLiteral<"itemResponse">;
|
|
201
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
202
|
-
type: z.ZodLiteral<"field">;
|
|
203
|
-
fieldId: z.ZodString;
|
|
204
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
205
|
-
type: z.ZodLiteral<"embeddedField">;
|
|
206
|
-
optionId: z.ZodString;
|
|
207
|
-
fieldId: z.ZodString;
|
|
208
|
-
}, z.core.$strip>], "type">;
|
|
209
|
-
when: z.ZodOptional<z.ZodType<JsonExpression, unknown, z.core.$ZodTypeInternals<JsonExpression, unknown>>>;
|
|
210
|
-
apply: z.ZodOptional<z.ZodLiteral<"ifEmpty">>;
|
|
211
|
-
source: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
212
|
-
type: z.ZodLiteral<"static">;
|
|
213
|
-
value: z.ZodType<ResponseValue, unknown, z.core.$ZodTypeInternals<ResponseValue, unknown>>;
|
|
214
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
215
|
-
type: z.ZodLiteral<"expression">;
|
|
216
|
-
expression: z.ZodType<JsonExpression, unknown, z.core.$ZodTypeInternals<JsonExpression, unknown>>;
|
|
217
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
218
|
-
type: z.ZodLiteral<"templateValue">;
|
|
219
|
-
key: z.ZodString;
|
|
220
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
221
|
-
type: z.ZodLiteral<"previousResponse">;
|
|
222
|
-
ref: z.ZodObject<{
|
|
223
|
-
surveyKey: z.ZodOptional<z.ZodString>;
|
|
224
|
-
itemId: z.ZodString;
|
|
225
|
-
target: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
226
|
-
type: z.ZodLiteral<"itemResponse">;
|
|
227
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
228
|
-
type: z.ZodLiteral<"field">;
|
|
229
|
-
fieldId: z.ZodString;
|
|
230
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
231
|
-
type: z.ZodLiteral<"embeddedField">;
|
|
232
|
-
optionId: z.ZodString;
|
|
233
|
-
fieldId: z.ZodString;
|
|
234
|
-
}, z.core.$strip>], "type">>;
|
|
235
|
-
}, z.core.$strip>;
|
|
236
|
-
ifUnsupported: z.ZodOptional<z.ZodLiteral<"skip">>;
|
|
237
|
-
}, z.core.$strip>], "type">;
|
|
238
|
-
}, z.core.$strip>;
|
|
239
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
240
|
-
kind: z.ZodLiteral<"clear-prefill">;
|
|
241
|
-
itemId: z.ZodString;
|
|
242
|
-
prefillId: z.ZodString;
|
|
243
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
244
|
-
kind: z.ZodLiteral<"set-template-value">;
|
|
245
|
-
templateKey: z.ZodString;
|
|
246
|
-
templateValue: z.ZodObject<{
|
|
247
|
-
type: z.ZodEnum<{
|
|
248
|
-
default: "default";
|
|
249
|
-
date2string: "date2string";
|
|
250
|
-
}>;
|
|
251
|
-
returnType: z.ZodEnum<{
|
|
252
|
-
string: "string";
|
|
253
|
-
number: "number";
|
|
254
|
-
boolean: "boolean";
|
|
255
|
-
date: "date";
|
|
256
|
-
reference: "reference";
|
|
257
|
-
duration: "duration";
|
|
258
|
-
"string[]": "string[]";
|
|
259
|
-
"duration[]": "duration[]";
|
|
260
|
-
"reference[]": "reference[]";
|
|
261
|
-
"number[]": "number[]";
|
|
262
|
-
"date[]": "date[]";
|
|
263
|
-
}>;
|
|
264
|
-
expression: z.ZodOptional<z.ZodType<JsonExpression, unknown, z.core.$ZodTypeInternals<JsonExpression, unknown>>>;
|
|
265
|
-
dateFormat: z.ZodOptional<z.ZodString>;
|
|
266
|
-
}, z.core.$strip>;
|
|
267
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
268
|
-
kind: z.ZodLiteral<"clear-template-value">;
|
|
269
|
-
templateKey: z.ZodString;
|
|
270
|
-
}, z.core.$strip>], "kind">;
|
|
271
|
-
type ExpressionMutation = z.infer<typeof expressionMutationSchema>;
|
|
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 }: {
|
|
282
|
-
mutation: ExpressionMutation;
|
|
283
|
-
operationIndex: number;
|
|
284
|
-
issues: SurveyValidationIssue[];
|
|
285
|
-
patches: JsonPatchOperation[];
|
|
286
|
-
responseSlotTypes: ResponseSlotTypeLookup;
|
|
287
|
-
snapshot: SurveyAssistantEngineContext;
|
|
288
|
-
}) => void;
|
|
289
|
-
//#endregion
|
|
290
|
-
//#region src/engine/inspection.d.ts
|
|
291
|
-
declare const DEFAULT_LIMIT = 12;
|
|
292
|
-
declare const MAX_LIMIT = 50;
|
|
293
|
-
declare const itemSummarySchema: z.ZodObject<{
|
|
294
|
-
itemId: z.ZodString;
|
|
295
|
-
itemType: z.ZodString;
|
|
296
|
-
editorName: z.ZodString;
|
|
297
|
-
breadcrumb: z.ZodString;
|
|
298
|
-
itemLabel: z.ZodOptional<z.ZodString>;
|
|
299
|
-
parentId: z.ZodOptional<z.ZodString>;
|
|
300
|
-
depth: z.ZodOptional<z.ZodNumber>;
|
|
301
|
-
childCount: z.ZodOptional<z.ZodNumber>;
|
|
302
|
-
path: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
303
|
-
siblingNames: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
304
|
-
}, z.core.$strip>;
|
|
305
|
-
type ItemSummary = z.infer<typeof itemSummarySchema>;
|
|
306
|
-
declare const translationEntrySchema: z.ZodObject<{
|
|
307
|
-
locale: z.ZodString;
|
|
308
|
-
contentKey: z.ZodString;
|
|
309
|
-
text: z.ZodString;
|
|
310
|
-
}, z.core.$strip>;
|
|
311
|
-
type TranslationEntry = z.infer<typeof translationEntrySchema>;
|
|
312
|
-
declare const choiceOptionDetailsSchema: z.ZodObject<{
|
|
313
|
-
position: z.ZodNumber;
|
|
314
|
-
id: z.ZodString;
|
|
315
|
-
code: z.ZodOptional<z.ZodString>;
|
|
316
|
-
labelContentKey: z.ZodString;
|
|
317
|
-
hasDisplayCondition: z.ZodOptional<z.ZodBoolean>;
|
|
318
|
-
embeddedFormItemId: z.ZodOptional<z.ZodString>;
|
|
319
|
-
embeddedFormFieldGroupCount: z.ZodOptional<z.ZodNumber>;
|
|
320
|
-
embeddedFormAuthoringMode: z.ZodOptional<z.ZodEnum<{
|
|
321
|
-
custom: "custom";
|
|
322
|
-
simple: "simple";
|
|
323
|
-
}>>;
|
|
324
|
-
embeddedFormSimpleModeValid: z.ZodOptional<z.ZodBoolean>;
|
|
325
|
-
embeddedFormTranslationPrefix: z.ZodOptional<z.ZodString>;
|
|
326
|
-
}, z.core.$strip>;
|
|
327
|
-
declare const formSelectOptionDetailsSchema: z.ZodObject<{
|
|
328
|
-
position: z.ZodNumber;
|
|
329
|
-
id: z.ZodString;
|
|
330
|
-
code: z.ZodOptional<z.ZodString>;
|
|
331
|
-
labelContentKey: z.ZodString;
|
|
332
|
-
}, z.core.$strip>;
|
|
333
|
-
declare const formFieldGroupLayoutSchema: z.ZodObject<{
|
|
334
|
-
base: z.ZodNumber;
|
|
335
|
-
xs: z.ZodNumber;
|
|
336
|
-
sm: z.ZodNumber;
|
|
337
|
-
md: z.ZodNumber;
|
|
338
|
-
xl: z.ZodNumber;
|
|
339
|
-
}, z.core.$strip>;
|
|
340
|
-
declare const formFieldDetailsSchema: z.ZodObject<{
|
|
341
|
-
position: z.ZodNumber;
|
|
342
|
-
id: z.ZodString;
|
|
343
|
-
variableName: z.ZodString;
|
|
344
|
-
type: z.ZodString;
|
|
345
|
-
responseSlotId: z.ZodString;
|
|
346
|
-
labelContentKey: z.ZodString;
|
|
347
|
-
descriptionContentKey: z.ZodString;
|
|
348
|
-
errorContentKey: z.ZodString;
|
|
349
|
-
placeholderContentKey: z.ZodOptional<z.ZodString>;
|
|
350
|
-
unitContentKey: z.ZodOptional<z.ZodString>;
|
|
351
|
-
checkedLabelContentKey: z.ZodOptional<z.ZodString>;
|
|
352
|
-
uncheckedLabelContentKey: z.ZodOptional<z.ZodString>;
|
|
353
|
-
required: z.ZodOptional<z.ZodBoolean>;
|
|
354
|
-
controllerType: z.ZodOptional<z.ZodString>;
|
|
355
|
-
validationTypes: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
356
|
-
validationMessageContentKeys: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
357
|
-
selectOptions: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
358
|
-
position: z.ZodNumber;
|
|
359
|
-
id: z.ZodString;
|
|
360
|
-
code: z.ZodOptional<z.ZodString>;
|
|
361
|
-
labelContentKey: z.ZodString;
|
|
362
|
-
}, z.core.$strip>>>;
|
|
363
|
-
}, z.core.$strip>;
|
|
364
|
-
declare const formFieldGroupDetailsSchema: z.ZodObject<{
|
|
365
|
-
position: z.ZodNumber;
|
|
366
|
-
id: z.ZodString;
|
|
367
|
-
titleContentKey: z.ZodString;
|
|
368
|
-
descriptionContentKey: z.ZodString;
|
|
369
|
-
hasDisplayCondition: z.ZodOptional<z.ZodBoolean>;
|
|
370
|
-
layout: z.ZodObject<{
|
|
371
|
-
base: z.ZodNumber;
|
|
372
|
-
xs: z.ZodNumber;
|
|
373
|
-
sm: z.ZodNumber;
|
|
374
|
-
md: z.ZodNumber;
|
|
375
|
-
xl: z.ZodNumber;
|
|
376
|
-
}, z.core.$strip>;
|
|
377
|
-
fieldCount: z.ZodNumber;
|
|
378
|
-
fields: z.ZodArray<z.ZodObject<{
|
|
379
|
-
position: z.ZodNumber;
|
|
380
|
-
id: z.ZodString;
|
|
381
|
-
variableName: z.ZodString;
|
|
382
|
-
type: z.ZodString;
|
|
383
|
-
responseSlotId: z.ZodString;
|
|
384
|
-
labelContentKey: z.ZodString;
|
|
385
|
-
descriptionContentKey: z.ZodString;
|
|
386
|
-
errorContentKey: z.ZodString;
|
|
387
|
-
placeholderContentKey: z.ZodOptional<z.ZodString>;
|
|
388
|
-
unitContentKey: z.ZodOptional<z.ZodString>;
|
|
389
|
-
checkedLabelContentKey: z.ZodOptional<z.ZodString>;
|
|
390
|
-
uncheckedLabelContentKey: z.ZodOptional<z.ZodString>;
|
|
391
|
-
required: z.ZodOptional<z.ZodBoolean>;
|
|
392
|
-
controllerType: z.ZodOptional<z.ZodString>;
|
|
393
|
-
validationTypes: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
394
|
-
validationMessageContentKeys: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
395
|
-
selectOptions: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
396
|
-
position: z.ZodNumber;
|
|
397
|
-
id: z.ZodString;
|
|
398
|
-
code: z.ZodOptional<z.ZodString>;
|
|
399
|
-
labelContentKey: z.ZodString;
|
|
400
|
-
}, z.core.$strip>>>;
|
|
401
|
-
}, z.core.$strip>>;
|
|
402
|
-
}, z.core.$strip>;
|
|
403
|
-
declare const itemConfigDetailsSchema: z.ZodObject<{
|
|
404
|
-
kind: z.ZodEnum<{
|
|
405
|
-
form: "form";
|
|
406
|
-
choice: "choice";
|
|
407
|
-
generic: "generic";
|
|
408
|
-
}>;
|
|
409
|
-
summary: z.ZodArray<z.ZodString>;
|
|
410
|
-
authoringMode: z.ZodOptional<z.ZodEnum<{
|
|
411
|
-
custom: "custom";
|
|
412
|
-
simple: "simple";
|
|
413
|
-
}>>;
|
|
414
|
-
simpleModeValid: z.ZodOptional<z.ZodBoolean>;
|
|
415
|
-
mainResponseSlotId: z.ZodOptional<z.ZodString>;
|
|
416
|
-
choiceOptions: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
417
|
-
position: z.ZodNumber;
|
|
418
|
-
id: z.ZodString;
|
|
419
|
-
code: z.ZodOptional<z.ZodString>;
|
|
420
|
-
labelContentKey: z.ZodString;
|
|
421
|
-
hasDisplayCondition: z.ZodOptional<z.ZodBoolean>;
|
|
422
|
-
embeddedFormItemId: z.ZodOptional<z.ZodString>;
|
|
423
|
-
embeddedFormFieldGroupCount: z.ZodOptional<z.ZodNumber>;
|
|
424
|
-
embeddedFormAuthoringMode: z.ZodOptional<z.ZodEnum<{
|
|
425
|
-
custom: "custom";
|
|
426
|
-
simple: "simple";
|
|
427
|
-
}>>;
|
|
428
|
-
embeddedFormSimpleModeValid: z.ZodOptional<z.ZodBoolean>;
|
|
429
|
-
embeddedFormTranslationPrefix: z.ZodOptional<z.ZodString>;
|
|
430
|
-
}, z.core.$strip>>>;
|
|
431
|
-
formFieldGroups: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
432
|
-
position: z.ZodNumber;
|
|
433
|
-
id: z.ZodString;
|
|
434
|
-
titleContentKey: z.ZodString;
|
|
435
|
-
descriptionContentKey: z.ZodString;
|
|
436
|
-
hasDisplayCondition: z.ZodOptional<z.ZodBoolean>;
|
|
437
|
-
layout: z.ZodObject<{
|
|
438
|
-
base: z.ZodNumber;
|
|
439
|
-
xs: z.ZodNumber;
|
|
440
|
-
sm: z.ZodNumber;
|
|
441
|
-
md: z.ZodNumber;
|
|
442
|
-
xl: z.ZodNumber;
|
|
443
|
-
}, z.core.$strip>;
|
|
444
|
-
fieldCount: z.ZodNumber;
|
|
445
|
-
fields: z.ZodArray<z.ZodObject<{
|
|
446
|
-
position: z.ZodNumber;
|
|
447
|
-
id: z.ZodString;
|
|
448
|
-
variableName: z.ZodString;
|
|
449
|
-
type: z.ZodString;
|
|
450
|
-
responseSlotId: z.ZodString;
|
|
451
|
-
labelContentKey: z.ZodString;
|
|
452
|
-
descriptionContentKey: z.ZodString;
|
|
453
|
-
errorContentKey: z.ZodString;
|
|
454
|
-
placeholderContentKey: z.ZodOptional<z.ZodString>;
|
|
455
|
-
unitContentKey: z.ZodOptional<z.ZodString>;
|
|
456
|
-
checkedLabelContentKey: z.ZodOptional<z.ZodString>;
|
|
457
|
-
uncheckedLabelContentKey: z.ZodOptional<z.ZodString>;
|
|
458
|
-
required: z.ZodOptional<z.ZodBoolean>;
|
|
459
|
-
controllerType: z.ZodOptional<z.ZodString>;
|
|
460
|
-
validationTypes: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
461
|
-
validationMessageContentKeys: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
462
|
-
selectOptions: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
463
|
-
position: z.ZodNumber;
|
|
464
|
-
id: z.ZodString;
|
|
465
|
-
code: z.ZodOptional<z.ZodString>;
|
|
466
|
-
labelContentKey: z.ZodString;
|
|
467
|
-
}, z.core.$strip>>>;
|
|
468
|
-
}, z.core.$strip>>;
|
|
469
|
-
}, z.core.$strip>>>;
|
|
470
|
-
listOrdering: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
471
|
-
}, z.core.$strip>;
|
|
472
|
-
type ChoiceOptionDetails = z.infer<typeof choiceOptionDetailsSchema>;
|
|
473
|
-
type FormFieldDetails = z.infer<typeof formFieldDetailsSchema>;
|
|
474
|
-
type FormFieldGroupDetails = z.infer<typeof formFieldGroupDetailsSchema>;
|
|
475
|
-
type ItemConfigDetails = z.infer<typeof itemConfigDetailsSchema>;
|
|
476
|
-
type SurveyInspectionIndex = SurveyAssistantEngineContext["inspection"];
|
|
477
|
-
type SurveyOutlineNode = SurveyInspectionIndex["outline"][number];
|
|
478
|
-
type SurveyItemIndexEntry = SurveyInspectionIndex["itemIndex"][number];
|
|
479
|
-
type SurveyFocusItemNode = NonNullable<SurveyInspectionIndex["focusItem"]>;
|
|
480
|
-
declare const normalizeText: (value: string | undefined) => string;
|
|
481
|
-
declare const clampLimit: (limit: number | undefined) => number;
|
|
482
|
-
declare const parseCursor: (cursor: string | undefined) => number;
|
|
483
|
-
declare const unique: <T>(values: T[]) => T[];
|
|
484
|
-
declare const sliceWithCursor: <T>(values: T[], input: {
|
|
485
|
-
cursor?: string;
|
|
486
|
-
limit?: number;
|
|
487
|
-
}) => {
|
|
488
|
-
items: T[];
|
|
489
|
-
nextCursor: string | undefined;
|
|
490
|
-
truncated: boolean;
|
|
491
|
-
};
|
|
492
|
-
declare const mapOutlineById: (snapshot: SurveyAssistantEngineContext) => Map<string, SurveyAssistantInspectionOutlineNode>;
|
|
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[];
|
|
496
|
-
declare const getRawSurvey: (snapshot: SurveyAssistantEngineContext) => Partial<RawSurvey>;
|
|
497
|
-
declare const getRawSurveyItems: (snapshot: SurveyAssistantEngineContext) => RawSurveyItem[];
|
|
498
|
-
declare const mapRawItemsById: (snapshot: SurveyAssistantEngineContext) => Map<string, RawSurveyItem>;
|
|
499
|
-
declare const buildSurveyTranslations: (snapshot: SurveyAssistantEngineContext) => SurveyTranslations;
|
|
500
|
-
declare const summarizeRawItem: (item: RawSurveyItem) => ItemSummary;
|
|
501
|
-
declare const buildItemTranslationEntries: (snapshot: SurveyAssistantEngineContext, itemId: string, input: {
|
|
502
|
-
locales?: string[];
|
|
503
|
-
textLimit?: number;
|
|
504
|
-
}) => TranslationEntry[];
|
|
505
|
-
declare const summarizeOutlineNode: (node: SurveyOutlineNode) => ItemSummary;
|
|
506
|
-
declare const summarizeItemIndexEntry: (entry: SurveyItemIndexEntry, outlineById: Map<string, SurveyOutlineNode>) => ItemSummary;
|
|
507
|
-
declare const summarizeItemIndexEntries: (entries: SurveyItemIndexEntry[], outlineById: Map<string, SurveyOutlineNode>) => ItemSummary[];
|
|
508
|
-
declare const buildItemConfigDetails: (rawItem: RawSurveyItem) => ItemConfigDetails | undefined;
|
|
509
|
-
declare const buildEmbeddedFormDetails: (choiceOption: ChoiceOptionDetails, embeddedForm: unknown) => ItemConfigDetails | undefined;
|
|
510
|
-
declare const buildConfigSearchText: (rawItem: RawSurveyItem) => string[];
|
|
511
|
-
declare const summarizeFocusItemNode: (node: SurveyFocusItemNode, outlineById: Map<string, SurveyOutlineNode>) => ItemSummary;
|
|
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;
|
|
515
|
-
declare const itemMatchesQuery: (item: ItemSummary, query: string) => boolean;
|
|
516
|
-
/**
|
|
517
|
-
* Direct children of `parentId` derived from the full-survey item index.
|
|
518
|
-
* This works for any item, selected or not.
|
|
519
|
-
*/
|
|
520
|
-
declare const findDirectChildrenByParentId: (entries: SurveyItemIndexEntry[], outlineById: Map<string, SurveyOutlineNode>, parentId: string) => ItemSummary[];
|
|
521
|
-
//#endregion
|
|
522
|
-
//#region src/engine/normalization.d.ts
|
|
523
|
-
type SurveyChangeNormalizationIssue = {
|
|
524
|
-
path: string;
|
|
525
|
-
message: string;
|
|
526
|
-
};
|
|
527
|
-
/**
|
|
528
|
-
* Accepts common model-authored shorthand and converts it to the strict
|
|
529
|
-
* assistant operation shape before validation. This keeps the public tool
|
|
530
|
-
* compact while making it tolerant of predictable schema-near authoring
|
|
531
|
-
* mistakes: nested raw translation maps, sibling config objects, choice
|
|
532
|
-
* optionId aliases, flat form fields, and compact rich-text blocks.
|
|
533
|
-
*/
|
|
534
|
-
declare const normalizeSurveyChangeOperations: (operations: unknown[], defaultLocale: string) => {
|
|
535
|
-
operations: unknown[];
|
|
536
|
-
issues: SurveyChangeNormalizationIssue[];
|
|
537
|
-
};
|
|
538
|
-
//#endregion
|
|
539
|
-
//#region src/engine/operation-execution.d.ts
|
|
540
|
-
/**
|
|
541
|
-
* Canonical pure executor for already-normalized, validated survey operation
|
|
542
|
-
* semantics. Raw-draft simulation uses the returned survey directly; editor
|
|
543
|
-
* adapters use it to decide domain results before recording them through the
|
|
544
|
-
* editor's normal mutation and history APIs.
|
|
545
|
-
*/
|
|
546
|
-
declare const executeSurveyOperationsOnRawSurvey: ({ operations, survey, capabilities }: {
|
|
547
|
-
operations: SurveyOperation[];
|
|
548
|
-
survey: RawSurvey;
|
|
549
|
-
capabilities?: SurveyAssistantCapabilitySet;
|
|
550
|
-
}) => RawSurvey;
|
|
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;
|
|
565
|
-
operations: SurveyOperation[];
|
|
566
|
-
snapshot: SurveyAssistantEngineContext | SurveyDocumentSnapshot | undefined;
|
|
567
|
-
}) => SurveyValidationResult;
|
|
568
|
-
declare const createSurveyChangeSet: ({ allowExpressionJsonPatches, maxOperations, operations, snapshot, summary, turnId }: {
|
|
569
|
-
allowExpressionJsonPatches?: boolean;
|
|
570
|
-
maxOperations?: number;
|
|
571
|
-
operations: SurveyOperation[];
|
|
572
|
-
snapshot: SurveyAssistantEngineContext | SurveyDocumentSnapshot | undefined;
|
|
573
|
-
summary: string;
|
|
574
|
-
turnId: string;
|
|
575
|
-
}) => SurveyChangeSet;
|
|
576
|
-
//#endregion
|
|
577
|
-
//#region src/engine/mutation-recovery.d.ts
|
|
578
|
-
type RecoveryTargetRefinement = {
|
|
579
|
-
targets: string[];
|
|
580
|
-
replacement: string;
|
|
581
|
-
};
|
|
582
|
-
//#endregion
|
|
583
|
-
//#region src/engine/turn-survey-draft.d.ts
|
|
584
|
-
declare const mutationRecoveryRouteByIssueCode: {
|
|
585
|
-
readonly "expression-patch-requires-specialized-tool": "expression";
|
|
586
|
-
};
|
|
587
|
-
type SurveyAssistantMutationRoute = (typeof mutationRecoveryRouteByIssueCode)[keyof typeof mutationRecoveryRouteByIssueCode];
|
|
588
|
-
/**
|
|
589
|
-
* Request-scoped transactional draft for one assistant response.
|
|
590
|
-
*
|
|
591
|
-
* Mutation tools submit deltas. A successful delta replaces the previous
|
|
592
|
-
* candidate with a newly validated, cumulative change set. A rejected delta
|
|
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.
|
|
596
|
-
*/
|
|
597
|
-
declare class TurnSurveyDraft {
|
|
598
|
-
#private;
|
|
599
|
-
readonly turnId: string;
|
|
600
|
-
constructor(turnId?: string);
|
|
601
|
-
initialize(context: SurveyAssistantEngineContext): void;
|
|
602
|
-
stage({ addressedTargets, allowExpressionJsonPatches, handledMutationRoutes, retryOfChangeIds, operations, snapshot, summary }: {
|
|
603
|
-
addressedTargets?: string[];
|
|
604
|
-
allowExpressionJsonPatches?: boolean;
|
|
605
|
-
handledMutationRoutes?: SurveyAssistantMutationRoute[];
|
|
606
|
-
retryOfChangeIds?: string[];
|
|
607
|
-
operations: SurveyOperation[];
|
|
608
|
-
snapshot: SurveyAssistantEngineContext | SurveyDocumentSnapshot | undefined;
|
|
609
|
-
summary: string;
|
|
610
|
-
}): SurveyChangeSet;
|
|
611
|
-
reject(candidate: SurveyChangeSet, addressedTargets?: Iterable<string>, refinements?: RecoveryTargetRefinement[]): SurveyChangeSet;
|
|
612
|
-
finalize(status: SurveyAssistantTurnFinal["status"], createdAt?: string, details?: Pick<SurveyAssistantTurnFinal, "durationMs" | "startedAt" | "terminationReason">): SurveyAssistantTurnFinal;
|
|
613
|
-
getCandidate(changeSetId: string): SurveyChangeSet | undefined;
|
|
614
|
-
get draftOperations(): readonly SurveyOperation[];
|
|
615
|
-
get context(): SurveyAssistantEngineContext | undefined;
|
|
616
|
-
get final(): SurveyAssistantTurnFinal | null;
|
|
617
|
-
}
|
|
618
|
-
//#endregion
|
|
619
|
-
//#region src/engine/task-context.d.ts
|
|
620
|
-
type SurveyAssistantTaskPurpose = "suggest-response-name" | "suggest-response-settings" | "suggest-item-label" | "translate-content";
|
|
621
|
-
interface BuildSurveyAssistantTaskContextOptions {
|
|
622
|
-
purpose: SurveyAssistantTaskPurpose;
|
|
623
|
-
capabilities?: SurveyAssistantCapabilitySet;
|
|
624
|
-
focusItemId?: string;
|
|
625
|
-
focusSlotId?: string;
|
|
626
|
-
slotIds?: readonly string[];
|
|
627
|
-
sourceLocale?: string;
|
|
628
|
-
targetLocales?: readonly string[];
|
|
629
|
-
sourceTexts?: readonly string[];
|
|
630
|
-
}
|
|
631
|
-
declare const buildSurveyAssistantTaskContext: (snapshot: SurveyDocumentSnapshot, options: BuildSurveyAssistantTaskContextOptions) => SurveyAssistantTaskContext;
|
|
632
|
-
//#endregion
|
|
633
|
-
//#region src/engine/task-result-cache.d.ts
|
|
634
|
-
interface SurveyAssistantTaskResultCacheOptions {
|
|
635
|
-
ttlMs?: number;
|
|
636
|
-
maxEntries?: number;
|
|
637
|
-
now?: () => number;
|
|
638
|
-
}
|
|
639
|
-
/** Small in-memory LRU cache for deterministic, snapshot-scoped one-shot results. */
|
|
640
|
-
declare class SurveyAssistantTaskResultCache {
|
|
641
|
-
private readonly entries;
|
|
642
|
-
private readonly ttlMs;
|
|
643
|
-
private readonly maxEntries;
|
|
644
|
-
private readonly now;
|
|
645
|
-
constructor(options?: SurveyAssistantTaskResultCacheOptions);
|
|
646
|
-
get<TResult>(key: string): TResult | undefined;
|
|
647
|
-
set<TResult>(key: string, value: TResult): void;
|
|
648
|
-
clear(): void;
|
|
649
|
-
}
|
|
650
|
-
//#endregion
|
|
651
|
-
//#region src/engine/audit.d.ts
|
|
652
|
-
type SurveyAuditSeverity = "error" | "warning" | "info";
|
|
653
|
-
type SurveyAuditCategory = "structure" | "content" | "localization" | "logic" | "responses" | "assets" | "quality";
|
|
654
|
-
interface SurveyAuditFinding {
|
|
655
|
-
code: string;
|
|
656
|
-
severity: SurveyAuditSeverity;
|
|
657
|
-
category: SurveyAuditCategory;
|
|
658
|
-
message: string;
|
|
659
|
-
itemId?: string;
|
|
660
|
-
locale?: string;
|
|
661
|
-
contentKey?: string;
|
|
662
|
-
suggestion?: string;
|
|
663
|
-
}
|
|
664
|
-
interface SurveyQualityReviewPrinciple {
|
|
665
|
-
id: string;
|
|
666
|
-
title: string;
|
|
667
|
-
prompt: string;
|
|
668
|
-
}
|
|
669
|
-
interface SurveyAuditKeyReviewEntry {
|
|
670
|
-
kind: "response-variable" | "choice-option";
|
|
671
|
-
slotId: string;
|
|
672
|
-
valueType?: string;
|
|
673
|
-
computed?: boolean;
|
|
674
|
-
itemId: string;
|
|
675
|
-
itemKey: string;
|
|
676
|
-
key: string;
|
|
677
|
-
keySource: "explicit" | "fallback-id";
|
|
678
|
-
contentKey?: string;
|
|
679
|
-
content?: string;
|
|
680
|
-
}
|
|
681
|
-
interface SurveyAuditReport {
|
|
682
|
-
summary: Record<SurveyAuditSeverity, number> & {
|
|
683
|
-
total: number;
|
|
684
|
-
};
|
|
685
|
-
findingCount: number;
|
|
686
|
-
truncated: boolean;
|
|
687
|
-
metrics: {
|
|
688
|
-
itemCount: number;
|
|
689
|
-
localeCount: number;
|
|
690
|
-
responseSlotCount: number;
|
|
691
|
-
assetCount: number;
|
|
692
|
-
itemTypes: Record<string, number>;
|
|
693
|
-
};
|
|
694
|
-
findings: SurveyAuditFinding[];
|
|
695
|
-
qualityReviewPrinciples: SurveyQualityReviewPrinciple[];
|
|
696
|
-
keyReview: {
|
|
697
|
-
sourceLocale?: string;
|
|
698
|
-
entryCount: number;
|
|
699
|
-
offset: number;
|
|
700
|
-
returnedEntryCount: number;
|
|
701
|
-
truncated: boolean;
|
|
702
|
-
entries: SurveyAuditKeyReviewEntry[];
|
|
703
|
-
note: string;
|
|
704
|
-
};
|
|
705
|
-
note: string;
|
|
706
|
-
}
|
|
707
|
-
declare const auditSurvey: (context: SurveyAssistantEngineContext, options?: {
|
|
708
|
-
sourceLocale?: string;
|
|
709
|
-
targetLocales?: string[];
|
|
710
|
-
maxFindings?: number;
|
|
711
|
-
keyReviewOffset?: number;
|
|
712
|
-
keyReviewLimit?: number;
|
|
713
|
-
}) => SurveyAuditReport;
|
|
714
|
-
//#endregion
|
|
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
|