@case-framework/survey-assistant 0.7.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/README.md +58 -3
- package/dist/{attachments-B0hg3vpT.mjs → attachments-BuNni5vB.mjs} +1 -1
- package/dist/{attachments-B0hg3vpT.mjs.map → attachments-BuNni5vB.mjs.map} +1 -1
- package/dist/{authoring-references-BJQ_1nMX.mjs → authoring-references-CmwLc_C8.mjs} +49 -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 +5 -12
- package/dist/capabilities-default.d.mts.map +1 -1
- package/dist/capabilities-default.mjs +2 -411
- package/dist/capabilities-z95e1mti.d.mts +117 -0
- package/dist/capabilities-z95e1mti.d.mts.map +1 -0
- package/dist/{constants-0UHGFcRJ.mjs → constants-Ct-vv9cu.mjs} +1 -1
- package/dist/{constants-0UHGFcRJ.mjs.map → constants-Ct-vv9cu.mjs.map} +1 -1
- package/dist/{constants-Be91Gay9.d.mts → constants-HL_klgJl.d.mts} +7 -28
- package/dist/constants-HL_klgJl.d.mts.map +1 -0
- package/dist/{controller-proxy-BH05e-C2.mjs → controller-proxy-BQ1YsVxJ.mjs} +12 -21
- package/dist/controller-proxy-BQ1YsVxJ.mjs.map +1 -0
- package/dist/controller-proxy-Cmzdr9tV.d.mts +65 -0
- package/dist/controller-proxy-Cmzdr9tV.d.mts.map +1 -0
- package/dist/default-D22AKTqE.mjs +233 -0
- package/dist/default-D22AKTqE.mjs.map +1 -0
- package/dist/{digest-SJmoYVaK.d.mts → digest-FnTTDBq2.d.mts} +2 -3
- package/dist/digest-FnTTDBq2.d.mts.map +1 -0
- package/dist/digest.d.mts +1 -1
- package/dist/digest.mjs.map +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/{fair-guidance-CRYCRxQm.mjs → fair-guidance-BmO4PswW.mjs} +1 -1
- package/dist/{fair-guidance-CRYCRxQm.mjs.map → fair-guidance-BmO4PswW.mjs.map} +1 -1
- package/dist/{index-l_EK4yK7.d.mts → index-B8TLBd1G.d.mts} +18 -72
- 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-x0qprHgK.d.mts → index-CeUlGkoU.d.mts} +58 -28
- package/dist/index-CeUlGkoU.d.mts.map +1 -0
- package/dist/{index-nhrgbgO5.d.mts → index-DYHdvSE8.d.mts} +347 -88
- 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-KWHQWFEW.mjs → memory-thread-repository-DmLadygY.mjs} +60 -30
- package/dist/memory-thread-repository-DmLadygY.mjs.map +1 -0
- 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 +4 -3
- package/dist/{react-B3ybjJ-X.mjs → react-DybJ5pWw.mjs} +159 -46
- package/dist/react-DybJ5pWw.mjs.map +1 -0
- package/dist/react-integration.d.mts +2 -2
- package/dist/react-integration.mjs +2 -2
- package/dist/react.d.mts +3 -3
- package/dist/react.mjs +3 -3
- package/dist/references/assistant-operations.md +224 -180
- package/dist/references/core-rules.md +6 -3
- package/dist/references/element-types.md +189 -0
- package/dist/references/expressions.md +307 -168
- package/dist/references/fair-by-design.md +9 -9
- package/dist/references/follow-ups.md +151 -0
- package/dist/references/localization.md +26 -12
- package/dist/references/response-variables.md +38 -0
- package/dist/references/rich-text-content.md +22 -43
- package/dist/references/source-material-surveys.md +20 -24
- package/dist/references/survey-data-model.md +36 -102
- package/dist/{request-context-CG4SWijt.mjs → request-context-KVh8VjgH.mjs} +4 -10
- package/dist/request-context-KVh8VjgH.mjs.map +1 -0
- package/dist/{request-guardrails-TmgQtqp4.mjs → request-guardrails-C0ugBOp0.mjs} +6 -5
- package/dist/request-guardrails-C0ugBOp0.mjs.map +1 -0
- package/dist/server-agent.d.mts +62 -43
- package/dist/server-agent.d.mts.map +1 -1
- package/dist/server-agent.mjs +73 -40
- package/dist/server-agent.mjs.map +1 -1
- package/dist/server-runtime.d.mts +24 -42
- package/dist/server-runtime.d.mts.map +1 -1
- package/dist/server-runtime.mjs +12 -12
- package/dist/server-runtime.mjs.map +1 -1
- package/dist/server-tasks.d.mts +2 -2
- package/dist/server-tasks.mjs +2 -313
- package/dist/server-tools.d.mts +1 -1
- package/dist/server-tools.mjs +1 -1
- package/dist/server.d.mts +14 -36
- package/dist/server.d.mts.map +1 -1
- package/dist/server.mjs +5 -5
- package/dist/server.mjs.map +1 -1
- package/dist/storage-postgres.d.mts +9 -25
- package/dist/storage-postgres.d.mts.map +1 -1
- package/dist/storage-postgres.mjs +5 -4
- package/dist/storage-postgres.mjs.map +1 -1
- package/dist/tasks-Coh5N027.mjs +397 -0
- package/dist/tasks-Coh5N027.mjs.map +1 -0
- package/dist/{tasks-CYqrcaRO.d.mts → tasks-wb9M-bak.d.mts} +25 -41
- package/dist/tasks-wb9M-bak.d.mts.map +1 -0
- package/dist/thread-documents-DrHbaXqP.d.mts +119 -0
- package/dist/thread-documents-DrHbaXqP.d.mts.map +1 -0
- package/dist/{thread-handlers-DBAaU7BA.d.mts → thread-handlers-C3Iya92v.d.mts} +9 -40
- package/dist/thread-handlers-C3Iya92v.d.mts.map +1 -0
- package/dist/{tools-BvSovehT.mjs → tools-D0KBDolR.mjs} +677 -459
- 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.css +1 -1
- package/dist/ui.d.mts +15 -54
- package/dist/ui.d.mts.map +1 -1
- package/dist/ui.mjs +203 -156
- package/dist/ui.mjs.map +1 -1
- package/docs/integration.md +11 -1
- package/package.json +41 -36
- package/dist/authoring-references-BJQ_1nMX.mjs.map +0 -1
- package/dist/capabilities-1KNnNO1_.mjs +0 -73
- package/dist/capabilities-1KNnNO1_.mjs.map +0 -1
- package/dist/capabilities-DVTfogjv.d.mts +0 -193
- package/dist/capabilities-DVTfogjv.d.mts.map +0 -1
- package/dist/capabilities-default.mjs.map +0 -1
- package/dist/constants-Be91Gay9.d.mts.map +0 -1
- package/dist/controller-proxy-BH05e-C2.mjs.map +0 -1
- package/dist/controller-proxy-Bd0ZHBPF.d.mts +0 -85
- package/dist/controller-proxy-Bd0ZHBPF.d.mts.map +0 -1
- package/dist/digest-SJmoYVaK.d.mts.map +0 -1
- package/dist/engine-Bo85Oyj0.mjs +0 -6723
- package/dist/engine-Bo85Oyj0.mjs.map +0 -1
- package/dist/index-Tnqv-yKW.d.mts +0 -777
- package/dist/index-Tnqv-yKW.d.mts.map +0 -1
- package/dist/index-l_EK4yK7.d.mts.map +0 -1
- package/dist/index-nhrgbgO5.d.mts.map +0 -1
- package/dist/index-x0qprHgK.d.mts.map +0 -1
- package/dist/lifecycle-Bx0aq_4S.d.mts +0 -529
- package/dist/lifecycle-Bx0aq_4S.d.mts.map +0 -1
- package/dist/memory-thread-repository-KWHQWFEW.mjs.map +0 -1
- package/dist/protocol-BhzQbx81.mjs +0 -1173
- package/dist/protocol-BhzQbx81.mjs.map +0 -1
- package/dist/react-B3ybjJ-X.mjs.map +0 -1
- package/dist/references/embedded-forms.md +0 -126
- package/dist/references/item-types.md +0 -407
- package/dist/request-context-CG4SWijt.mjs.map +0 -1
- package/dist/request-guardrails-TmgQtqp4.mjs.map +0 -1
- package/dist/server-tasks.mjs.map +0 -1
- package/dist/tasks-CYqrcaRO.d.mts.map +0 -1
- package/dist/thread-documents-rmd6nyX9.d.mts +0 -107
- package/dist/thread-documents-rmd6nyX9.d.mts.map +0 -1
- package/dist/thread-handlers-DBAaU7BA.d.mts.map +0 -1
- package/dist/tools-BvSovehT.mjs.map +0 -1
|
@@ -1,777 +0,0 @@
|
|
|
1
|
-
import { i as AssistantItemTypeManifest, o as SurveyAssistantCapabilityManifest } from "./capabilities-DVTfogjv.mjs";
|
|
2
|
-
import { p as SurveyAssistantTaskContext } from "./index-nhrgbgO5.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-Bx0aq_4S.mjs";
|
|
4
|
-
import { z } from "zod";
|
|
5
|
-
import { Content, JsonExpression, JsonPatchOperation, RawSurvey, RawSurveyItem, ResponseValue, SurveyExpressionReferenceDiagnostic, SurveyExpressionResponseSlot, SurveyTranslations, ValueType } from "@case-framework/survey-core";
|
|
6
|
-
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
|
|
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
|
-
references?: AssistantCapabilityReference[];
|
|
21
|
-
normalizeCreate?: (item: RawSurveyItem) => RawSurveyItem;
|
|
22
|
-
validateItem?: (item: RawSurveyItem) => SurveyValidationIssue[];
|
|
23
|
-
supportsOperation?: (operation: SurveyOperation) => boolean;
|
|
24
|
-
deriveResponseSlots?: (item: RawSurveyItem) => Record<string, ValueType>;
|
|
25
|
-
inspectItem?: (item: RawSurveyItem) => AssistantItemInspection;
|
|
26
|
-
}
|
|
27
|
-
interface SurveyAssistantCapabilitySet {
|
|
28
|
-
manifest: SurveyAssistantCapabilityManifest;
|
|
29
|
-
byItemType: ReadonlyMap<string, AssistantItemCapabilityAdapter>;
|
|
30
|
-
}
|
|
31
|
-
declare const resolveAssistantCapabilityReference: ({
|
|
32
|
-
capabilities,
|
|
33
|
-
itemType,
|
|
34
|
-
topic
|
|
35
|
-
}: {
|
|
36
|
-
capabilities: SurveyAssistantCapabilitySet | undefined;
|
|
37
|
-
itemType: string;
|
|
38
|
-
topic: string;
|
|
39
|
-
}) => AssistantCapabilityReference | undefined;
|
|
40
|
-
declare const inspectAssistantItem: ({
|
|
41
|
-
capabilities,
|
|
42
|
-
item
|
|
43
|
-
}: {
|
|
44
|
-
capabilities: SurveyAssistantCapabilitySet | undefined;
|
|
45
|
-
item: RawSurveyItem;
|
|
46
|
-
}) => AssistantItemInspection | undefined;
|
|
47
|
-
type AssistantItemCreationResolution = {
|
|
48
|
-
kind: "deterministic";
|
|
49
|
-
} | {
|
|
50
|
-
kind: "ui-intent";
|
|
51
|
-
intent: {
|
|
52
|
-
kind: "open-create-item";
|
|
53
|
-
itemType: string;
|
|
54
|
-
parentItemId?: string;
|
|
55
|
-
};
|
|
56
|
-
} | {
|
|
57
|
-
kind: "unsupported";
|
|
58
|
-
reason: string;
|
|
59
|
-
};
|
|
60
|
-
declare const createSurveyAssistantCapabilities: (capabilities: readonly AssistantItemCapabilityAdapter[]) => SurveyAssistantCapabilitySet;
|
|
61
|
-
declare const getDeterministicCreateItemTypes: (manifest: SurveyAssistantCapabilityManifest) => string[];
|
|
62
|
-
declare const resolveAssistantItemCreation: ({
|
|
63
|
-
itemType,
|
|
64
|
-
manifest,
|
|
65
|
-
parentItemId
|
|
66
|
-
}: {
|
|
67
|
-
itemType: string;
|
|
68
|
-
manifest: SurveyAssistantCapabilityManifest;
|
|
69
|
-
parentItemId?: string;
|
|
70
|
-
}) => AssistantItemCreationResolution;
|
|
71
|
-
declare const createUnsupportedItemCapability: ({
|
|
72
|
-
displayName,
|
|
73
|
-
itemType
|
|
74
|
-
}: {
|
|
75
|
-
displayName: string;
|
|
76
|
-
itemType: string;
|
|
77
|
-
}) => AssistantItemCapabilityAdapter;
|
|
78
|
-
declare class SurveyAssistantCapabilityMismatchError extends Error {
|
|
79
|
-
readonly code = "survey-assistant-capability-mismatch";
|
|
80
|
-
constructor(message?: string);
|
|
81
|
-
}
|
|
82
|
-
declare const assertSurveyAssistantCapabilities: ({
|
|
83
|
-
manifest,
|
|
84
|
-
trustedCapabilities,
|
|
85
|
-
versionDigest
|
|
86
|
-
}: {
|
|
87
|
-
manifest: SurveyAssistantCapabilityManifest;
|
|
88
|
-
trustedCapabilities?: SurveyAssistantCapabilitySet;
|
|
89
|
-
versionDigest: string;
|
|
90
|
-
}) => void;
|
|
91
|
-
//#endregion
|
|
92
|
-
//#region src/engine/context.d.ts
|
|
93
|
-
type SurveyAssistantResponseSlotTypes = Record<string, ValueType | undefined>;
|
|
94
|
-
interface SurveyAssistantInspectionOutlineNode {
|
|
95
|
-
itemId: string;
|
|
96
|
-
parentId?: string;
|
|
97
|
-
depth: number;
|
|
98
|
-
itemType: string;
|
|
99
|
-
key: string;
|
|
100
|
-
fullKey: string;
|
|
101
|
-
itemLabel?: string;
|
|
102
|
-
childCount: number;
|
|
103
|
-
}
|
|
104
|
-
interface SurveyAssistantInspectionFocus {
|
|
105
|
-
focusItemId: string;
|
|
106
|
-
parentItemId?: string;
|
|
107
|
-
pathItemIds: string[];
|
|
108
|
-
siblingItemIds: string[];
|
|
109
|
-
childItemIds: string[];
|
|
110
|
-
}
|
|
111
|
-
interface SurveyAssistantInspectionItemNode {
|
|
112
|
-
itemId: string;
|
|
113
|
-
itemType: string;
|
|
114
|
-
itemKey: string;
|
|
115
|
-
fullKey: string;
|
|
116
|
-
itemLabel?: string;
|
|
117
|
-
siblingKeys: string[];
|
|
118
|
-
translations: Array<{
|
|
119
|
-
locale: string;
|
|
120
|
-
contentKey: string;
|
|
121
|
-
text: string;
|
|
122
|
-
}>;
|
|
123
|
-
descendants: SurveyAssistantInspectionItemNode[];
|
|
124
|
-
}
|
|
125
|
-
interface SurveyAssistantInspectionKeyEntry {
|
|
126
|
-
itemId: string;
|
|
127
|
-
itemType: string;
|
|
128
|
-
key: string;
|
|
129
|
-
fullKey: string;
|
|
130
|
-
itemLabel?: string;
|
|
131
|
-
path: string[];
|
|
132
|
-
}
|
|
133
|
-
/** Deterministic, request-local lookup data derived from the canonical document. */
|
|
134
|
-
interface SurveyAssistantInspectionIndex {
|
|
135
|
-
surveyKey?: string;
|
|
136
|
-
locales: string[];
|
|
137
|
-
/** All survey items except the structural root group. */
|
|
138
|
-
itemCount: number;
|
|
139
|
-
outline: SurveyAssistantInspectionOutlineNode[];
|
|
140
|
-
focus?: SurveyAssistantInspectionFocus;
|
|
141
|
-
focusItem?: SurveyAssistantInspectionItemNode;
|
|
142
|
-
keyIndex: SurveyAssistantInspectionKeyEntry[];
|
|
143
|
-
responseSlots: string[];
|
|
144
|
-
focusItemTreeTruncated: boolean;
|
|
145
|
-
}
|
|
146
|
-
/** Request-local derived state built from one authoritative survey document. */
|
|
147
|
-
interface SurveyAssistantEngineContext {
|
|
148
|
-
document: SurveyDocumentSnapshot;
|
|
149
|
-
version: SurveyDocumentVersion;
|
|
150
|
-
survey: RawSurvey;
|
|
151
|
-
ui: SurveyDocumentSnapshot["ui"];
|
|
152
|
-
capabilities: SurveyAssistantCapabilityManifest;
|
|
153
|
-
responseSlotTypes: SurveyAssistantResponseSlotTypes;
|
|
154
|
-
inspection: SurveyAssistantInspectionIndex;
|
|
155
|
-
trustedCapabilities?: SurveyAssistantCapabilitySet;
|
|
156
|
-
}
|
|
157
|
-
interface CreateSurveyAssistantEngineContextOptions {
|
|
158
|
-
focusItemId?: string;
|
|
159
|
-
}
|
|
160
|
-
declare const deriveResponseSlotTypes: (survey: RawSurvey, trustedCapabilities?: SurveyAssistantCapabilitySet) => SurveyAssistantResponseSlotTypes;
|
|
161
|
-
declare const createSurveyAssistantEngineContext: (document: SurveyDocumentSnapshot, trustedCapabilities?: SurveyAssistantCapabilitySet, options?: CreateSurveyAssistantEngineContextOptions) => SurveyAssistantEngineContext;
|
|
162
|
-
//#endregion
|
|
163
|
-
//#region src/engine/expression-validation.d.ts
|
|
164
|
-
type ResponseSlotTypeLookup = Record<string, ValueType | undefined>;
|
|
165
|
-
declare const inferExpressionReturnType: (expression: JsonExpression | undefined, responseSlotTypes: ResponseSlotTypeLookup) => ValueType | undefined;
|
|
166
|
-
declare const validateExpression: ({
|
|
167
|
-
expression,
|
|
168
|
-
expectedReturnType,
|
|
169
|
-
issues,
|
|
170
|
-
operationIndex,
|
|
171
|
-
responseSlotTypes,
|
|
172
|
-
scope
|
|
173
|
-
}: {
|
|
174
|
-
expression: JsonExpression | undefined;
|
|
175
|
-
expectedReturnType?: ValueType;
|
|
176
|
-
issues: SurveyValidationIssue[];
|
|
177
|
-
operationIndex: number;
|
|
178
|
-
responseSlotTypes: ResponseSlotTypeLookup;
|
|
179
|
-
scope: string;
|
|
180
|
-
}) => void;
|
|
181
|
-
//#endregion
|
|
182
|
-
//#region src/engine/expression-reference-integrity.d.ts
|
|
183
|
-
declare const deriveSurveyExpressionResponseSlots: (survey: RawSurvey, trustedCapabilities?: SurveyAssistantCapabilitySet) => SurveyExpressionResponseSlot[];
|
|
184
|
-
declare const analyzeSurveyAssistantExpressionReferences: (survey: RawSurvey, trustedCapabilities?: SurveyAssistantCapabilitySet) => SurveyExpressionReferenceDiagnostic[];
|
|
185
|
-
declare const getSurveyAssistantExpressionDiagnosticGuidance: (diagnostic: Pick<SurveyExpressionReferenceDiagnostic, "category" | "disposition">) => string;
|
|
186
|
-
//#endregion
|
|
187
|
-
//#region src/engine/expression-mutations.d.ts
|
|
188
|
-
declare const expressionSchema: z.ZodType<JsonExpression>;
|
|
189
|
-
declare const expressionMutationSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
190
|
-
kind: z.ZodLiteral<"set-item-display-condition">;
|
|
191
|
-
itemId: z.ZodString;
|
|
192
|
-
expression: z.ZodType<JsonExpression, unknown, z.core.$ZodTypeInternals<JsonExpression, unknown>>;
|
|
193
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
194
|
-
kind: z.ZodLiteral<"clear-item-display-condition">;
|
|
195
|
-
itemId: z.ZodString;
|
|
196
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
197
|
-
kind: z.ZodLiteral<"set-component-display-condition">;
|
|
198
|
-
itemId: z.ZodString;
|
|
199
|
-
componentId: z.ZodString;
|
|
200
|
-
expression: z.ZodType<JsonExpression, unknown, z.core.$ZodTypeInternals<JsonExpression, unknown>>;
|
|
201
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
202
|
-
kind: z.ZodLiteral<"clear-component-display-condition">;
|
|
203
|
-
itemId: z.ZodString;
|
|
204
|
-
componentId: z.ZodString;
|
|
205
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
206
|
-
kind: z.ZodLiteral<"set-component-disabled-condition">;
|
|
207
|
-
itemId: z.ZodString;
|
|
208
|
-
componentId: z.ZodString;
|
|
209
|
-
expression: z.ZodType<JsonExpression, unknown, z.core.$ZodTypeInternals<JsonExpression, unknown>>;
|
|
210
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
211
|
-
kind: z.ZodLiteral<"clear-component-disabled-condition">;
|
|
212
|
-
itemId: z.ZodString;
|
|
213
|
-
componentId: z.ZodString;
|
|
214
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
215
|
-
kind: z.ZodLiteral<"set-validation-expression">;
|
|
216
|
-
itemId: z.ZodString;
|
|
217
|
-
validationKey: z.ZodString;
|
|
218
|
-
expression: z.ZodType<JsonExpression, unknown, z.core.$ZodTypeInternals<JsonExpression, unknown>>;
|
|
219
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
220
|
-
kind: z.ZodLiteral<"clear-validation-expression">;
|
|
221
|
-
itemId: z.ZodString;
|
|
222
|
-
validationKey: z.ZodString;
|
|
223
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
224
|
-
kind: z.ZodLiteral<"set-prefill">;
|
|
225
|
-
itemId: z.ZodString;
|
|
226
|
-
prefill: z.ZodObject<{
|
|
227
|
-
id: z.ZodString;
|
|
228
|
-
target: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
229
|
-
type: z.ZodLiteral<"itemResponse">;
|
|
230
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
231
|
-
type: z.ZodLiteral<"field">;
|
|
232
|
-
fieldId: z.ZodString;
|
|
233
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
234
|
-
type: z.ZodLiteral<"embeddedField">;
|
|
235
|
-
optionId: z.ZodString;
|
|
236
|
-
fieldId: z.ZodString;
|
|
237
|
-
}, z.core.$strip>], "type">;
|
|
238
|
-
when: z.ZodOptional<z.ZodType<JsonExpression, unknown, z.core.$ZodTypeInternals<JsonExpression, unknown>>>;
|
|
239
|
-
apply: z.ZodOptional<z.ZodLiteral<"ifEmpty">>;
|
|
240
|
-
source: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
241
|
-
type: z.ZodLiteral<"static">;
|
|
242
|
-
value: z.ZodType<ResponseValue, unknown, z.core.$ZodTypeInternals<ResponseValue, unknown>>;
|
|
243
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
244
|
-
type: z.ZodLiteral<"expression">;
|
|
245
|
-
expression: z.ZodType<JsonExpression, unknown, z.core.$ZodTypeInternals<JsonExpression, unknown>>;
|
|
246
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
247
|
-
type: z.ZodLiteral<"templateValue">;
|
|
248
|
-
key: z.ZodString;
|
|
249
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
250
|
-
type: z.ZodLiteral<"previousResponse">;
|
|
251
|
-
ref: z.ZodObject<{
|
|
252
|
-
surveyKey: z.ZodOptional<z.ZodString>;
|
|
253
|
-
itemId: z.ZodString;
|
|
254
|
-
target: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
255
|
-
type: z.ZodLiteral<"itemResponse">;
|
|
256
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
257
|
-
type: z.ZodLiteral<"field">;
|
|
258
|
-
fieldId: z.ZodString;
|
|
259
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
260
|
-
type: z.ZodLiteral<"embeddedField">;
|
|
261
|
-
optionId: z.ZodString;
|
|
262
|
-
fieldId: z.ZodString;
|
|
263
|
-
}, z.core.$strip>], "type">>;
|
|
264
|
-
}, z.core.$strip>;
|
|
265
|
-
ifUnsupported: z.ZodOptional<z.ZodLiteral<"skip">>;
|
|
266
|
-
}, z.core.$strip>], "type">;
|
|
267
|
-
}, z.core.$strip>;
|
|
268
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
269
|
-
kind: z.ZodLiteral<"clear-prefill">;
|
|
270
|
-
itemId: z.ZodString;
|
|
271
|
-
prefillId: z.ZodString;
|
|
272
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
273
|
-
kind: z.ZodLiteral<"set-template-value">;
|
|
274
|
-
templateKey: z.ZodString;
|
|
275
|
-
templateValue: z.ZodObject<{
|
|
276
|
-
type: z.ZodEnum<{
|
|
277
|
-
default: "default";
|
|
278
|
-
date2string: "date2string";
|
|
279
|
-
}>;
|
|
280
|
-
returnType: z.ZodEnum<{
|
|
281
|
-
string: "string";
|
|
282
|
-
number: "number";
|
|
283
|
-
boolean: "boolean";
|
|
284
|
-
date: "date";
|
|
285
|
-
reference: "reference";
|
|
286
|
-
duration: "duration";
|
|
287
|
-
"string[]": "string[]";
|
|
288
|
-
"duration[]": "duration[]";
|
|
289
|
-
"reference[]": "reference[]";
|
|
290
|
-
"number[]": "number[]";
|
|
291
|
-
"date[]": "date[]";
|
|
292
|
-
}>;
|
|
293
|
-
expression: z.ZodOptional<z.ZodType<JsonExpression, unknown, z.core.$ZodTypeInternals<JsonExpression, unknown>>>;
|
|
294
|
-
dateFormat: z.ZodOptional<z.ZodString>;
|
|
295
|
-
}, z.core.$strip>;
|
|
296
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
297
|
-
kind: z.ZodLiteral<"clear-template-value">;
|
|
298
|
-
templateKey: z.ZodString;
|
|
299
|
-
}, z.core.$strip>], "kind">;
|
|
300
|
-
type ExpressionMutation = z.infer<typeof expressionMutationSchema>;
|
|
301
|
-
/** Compile an expression delta in order, without mutating the accepted turn draft.
|
|
302
|
-
* Expression mutations cannot change item structure or response slots, so the
|
|
303
|
-
* immutable indexes remain valid while each mutation reads the preceding result.
|
|
304
|
-
* The caller validates and stages the complete delta atomically.
|
|
305
|
-
*/
|
|
306
|
-
declare const buildExpressionMutationBatch: (mutations: ExpressionMutation[], snapshot: SurveyAssistantEngineContext) => {
|
|
307
|
-
issues: SurveyValidationIssue[];
|
|
308
|
-
patches: JsonPatchOperation[];
|
|
309
|
-
};
|
|
310
|
-
declare const buildExpressionMutationPatches: ({
|
|
311
|
-
mutation,
|
|
312
|
-
operationIndex,
|
|
313
|
-
issues,
|
|
314
|
-
patches,
|
|
315
|
-
responseSlotTypes,
|
|
316
|
-
snapshot
|
|
317
|
-
}: {
|
|
318
|
-
mutation: ExpressionMutation;
|
|
319
|
-
operationIndex: number;
|
|
320
|
-
issues: SurveyValidationIssue[];
|
|
321
|
-
patches: JsonPatchOperation[];
|
|
322
|
-
responseSlotTypes: ResponseSlotTypeLookup;
|
|
323
|
-
snapshot: SurveyAssistantEngineContext;
|
|
324
|
-
}) => void;
|
|
325
|
-
//#endregion
|
|
326
|
-
//#region src/engine/inspection.d.ts
|
|
327
|
-
declare const DEFAULT_LIMIT = 12;
|
|
328
|
-
declare const MAX_LIMIT = 50;
|
|
329
|
-
declare const itemSummarySchema: z.ZodObject<{
|
|
330
|
-
itemId: z.ZodString;
|
|
331
|
-
itemType: z.ZodString;
|
|
332
|
-
key: z.ZodString;
|
|
333
|
-
fullKey: z.ZodString;
|
|
334
|
-
itemLabel: z.ZodOptional<z.ZodString>;
|
|
335
|
-
parentId: z.ZodOptional<z.ZodString>;
|
|
336
|
-
depth: z.ZodOptional<z.ZodNumber>;
|
|
337
|
-
childCount: z.ZodOptional<z.ZodNumber>;
|
|
338
|
-
path: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
339
|
-
siblingKeys: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
340
|
-
}, z.core.$strip>;
|
|
341
|
-
type ItemSummary = z.infer<typeof itemSummarySchema>;
|
|
342
|
-
declare const translationEntrySchema: z.ZodObject<{
|
|
343
|
-
locale: z.ZodString;
|
|
344
|
-
contentKey: z.ZodString;
|
|
345
|
-
text: z.ZodString;
|
|
346
|
-
}, z.core.$strip>;
|
|
347
|
-
type TranslationEntry = z.infer<typeof translationEntrySchema>;
|
|
348
|
-
declare const choiceOptionDetailsSchema: z.ZodObject<{
|
|
349
|
-
position: z.ZodNumber;
|
|
350
|
-
id: z.ZodString;
|
|
351
|
-
key: z.ZodOptional<z.ZodString>;
|
|
352
|
-
labelContentKey: z.ZodString;
|
|
353
|
-
hasDisplayCondition: z.ZodOptional<z.ZodBoolean>;
|
|
354
|
-
embeddedFormItemId: z.ZodOptional<z.ZodString>;
|
|
355
|
-
embeddedFormFieldGroupCount: z.ZodOptional<z.ZodNumber>;
|
|
356
|
-
embeddedFormAuthoringMode: z.ZodOptional<z.ZodEnum<{
|
|
357
|
-
custom: "custom";
|
|
358
|
-
simple: "simple";
|
|
359
|
-
}>>;
|
|
360
|
-
embeddedFormSimpleModeValid: z.ZodOptional<z.ZodBoolean>;
|
|
361
|
-
embeddedFormTranslationPrefix: z.ZodOptional<z.ZodString>;
|
|
362
|
-
embeddedFormResponseSlotPrefix: z.ZodOptional<z.ZodString>;
|
|
363
|
-
}, z.core.$strip>;
|
|
364
|
-
declare const formSelectOptionDetailsSchema: z.ZodObject<{
|
|
365
|
-
position: z.ZodNumber;
|
|
366
|
-
id: z.ZodString;
|
|
367
|
-
value: z.ZodOptional<z.ZodString>;
|
|
368
|
-
labelContentKey: z.ZodString;
|
|
369
|
-
}, z.core.$strip>;
|
|
370
|
-
declare const formFieldGroupLayoutSchema: 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
|
-
declare const formFieldDetailsSchema: z.ZodObject<{
|
|
378
|
-
position: z.ZodNumber;
|
|
379
|
-
id: z.ZodString;
|
|
380
|
-
key: z.ZodString;
|
|
381
|
-
type: z.ZodString;
|
|
382
|
-
responseSlotId: z.ZodString;
|
|
383
|
-
labelContentKey: z.ZodString;
|
|
384
|
-
descriptionContentKey: z.ZodString;
|
|
385
|
-
errorContentKey: z.ZodString;
|
|
386
|
-
placeholderContentKey: z.ZodOptional<z.ZodString>;
|
|
387
|
-
unitContentKey: z.ZodOptional<z.ZodString>;
|
|
388
|
-
checkedLabelContentKey: z.ZodOptional<z.ZodString>;
|
|
389
|
-
uncheckedLabelContentKey: z.ZodOptional<z.ZodString>;
|
|
390
|
-
required: z.ZodOptional<z.ZodBoolean>;
|
|
391
|
-
controllerType: z.ZodOptional<z.ZodString>;
|
|
392
|
-
validationTypes: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
393
|
-
validationMessageContentKeys: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
394
|
-
selectOptions: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
395
|
-
position: z.ZodNumber;
|
|
396
|
-
id: z.ZodString;
|
|
397
|
-
value: z.ZodOptional<z.ZodString>;
|
|
398
|
-
labelContentKey: z.ZodString;
|
|
399
|
-
}, z.core.$strip>>>;
|
|
400
|
-
}, z.core.$strip>;
|
|
401
|
-
declare const formFieldGroupDetailsSchema: z.ZodObject<{
|
|
402
|
-
position: z.ZodNumber;
|
|
403
|
-
id: z.ZodString;
|
|
404
|
-
titleContentKey: z.ZodString;
|
|
405
|
-
descriptionContentKey: z.ZodString;
|
|
406
|
-
hasDisplayCondition: z.ZodOptional<z.ZodBoolean>;
|
|
407
|
-
layout: z.ZodObject<{
|
|
408
|
-
base: z.ZodNumber;
|
|
409
|
-
xs: z.ZodNumber;
|
|
410
|
-
sm: z.ZodNumber;
|
|
411
|
-
md: z.ZodNumber;
|
|
412
|
-
xl: z.ZodNumber;
|
|
413
|
-
}, z.core.$strip>;
|
|
414
|
-
fieldCount: z.ZodNumber;
|
|
415
|
-
fields: z.ZodArray<z.ZodObject<{
|
|
416
|
-
position: z.ZodNumber;
|
|
417
|
-
id: z.ZodString;
|
|
418
|
-
key: z.ZodString;
|
|
419
|
-
type: z.ZodString;
|
|
420
|
-
responseSlotId: z.ZodString;
|
|
421
|
-
labelContentKey: z.ZodString;
|
|
422
|
-
descriptionContentKey: z.ZodString;
|
|
423
|
-
errorContentKey: z.ZodString;
|
|
424
|
-
placeholderContentKey: z.ZodOptional<z.ZodString>;
|
|
425
|
-
unitContentKey: z.ZodOptional<z.ZodString>;
|
|
426
|
-
checkedLabelContentKey: z.ZodOptional<z.ZodString>;
|
|
427
|
-
uncheckedLabelContentKey: z.ZodOptional<z.ZodString>;
|
|
428
|
-
required: z.ZodOptional<z.ZodBoolean>;
|
|
429
|
-
controllerType: z.ZodOptional<z.ZodString>;
|
|
430
|
-
validationTypes: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
431
|
-
validationMessageContentKeys: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
432
|
-
selectOptions: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
433
|
-
position: z.ZodNumber;
|
|
434
|
-
id: z.ZodString;
|
|
435
|
-
value: z.ZodOptional<z.ZodString>;
|
|
436
|
-
labelContentKey: z.ZodString;
|
|
437
|
-
}, z.core.$strip>>>;
|
|
438
|
-
}, z.core.$strip>>;
|
|
439
|
-
}, z.core.$strip>;
|
|
440
|
-
declare const itemConfigDetailsSchema: z.ZodObject<{
|
|
441
|
-
kind: z.ZodEnum<{
|
|
442
|
-
choice: "choice";
|
|
443
|
-
form: "form";
|
|
444
|
-
generic: "generic";
|
|
445
|
-
}>;
|
|
446
|
-
summary: z.ZodArray<z.ZodString>;
|
|
447
|
-
authoringMode: z.ZodOptional<z.ZodEnum<{
|
|
448
|
-
custom: "custom";
|
|
449
|
-
simple: "simple";
|
|
450
|
-
}>>;
|
|
451
|
-
simpleModeValid: z.ZodOptional<z.ZodBoolean>;
|
|
452
|
-
mainResponseSlotId: z.ZodOptional<z.ZodString>;
|
|
453
|
-
choiceOptions: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
454
|
-
position: z.ZodNumber;
|
|
455
|
-
id: z.ZodString;
|
|
456
|
-
key: z.ZodOptional<z.ZodString>;
|
|
457
|
-
labelContentKey: z.ZodString;
|
|
458
|
-
hasDisplayCondition: z.ZodOptional<z.ZodBoolean>;
|
|
459
|
-
embeddedFormItemId: z.ZodOptional<z.ZodString>;
|
|
460
|
-
embeddedFormFieldGroupCount: z.ZodOptional<z.ZodNumber>;
|
|
461
|
-
embeddedFormAuthoringMode: z.ZodOptional<z.ZodEnum<{
|
|
462
|
-
custom: "custom";
|
|
463
|
-
simple: "simple";
|
|
464
|
-
}>>;
|
|
465
|
-
embeddedFormSimpleModeValid: z.ZodOptional<z.ZodBoolean>;
|
|
466
|
-
embeddedFormTranslationPrefix: z.ZodOptional<z.ZodString>;
|
|
467
|
-
embeddedFormResponseSlotPrefix: z.ZodOptional<z.ZodString>;
|
|
468
|
-
}, z.core.$strip>>>;
|
|
469
|
-
formFieldGroups: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
470
|
-
position: z.ZodNumber;
|
|
471
|
-
id: z.ZodString;
|
|
472
|
-
titleContentKey: z.ZodString;
|
|
473
|
-
descriptionContentKey: z.ZodString;
|
|
474
|
-
hasDisplayCondition: z.ZodOptional<z.ZodBoolean>;
|
|
475
|
-
layout: z.ZodObject<{
|
|
476
|
-
base: z.ZodNumber;
|
|
477
|
-
xs: z.ZodNumber;
|
|
478
|
-
sm: z.ZodNumber;
|
|
479
|
-
md: z.ZodNumber;
|
|
480
|
-
xl: z.ZodNumber;
|
|
481
|
-
}, z.core.$strip>;
|
|
482
|
-
fieldCount: z.ZodNumber;
|
|
483
|
-
fields: z.ZodArray<z.ZodObject<{
|
|
484
|
-
position: z.ZodNumber;
|
|
485
|
-
id: z.ZodString;
|
|
486
|
-
key: z.ZodString;
|
|
487
|
-
type: z.ZodString;
|
|
488
|
-
responseSlotId: z.ZodString;
|
|
489
|
-
labelContentKey: z.ZodString;
|
|
490
|
-
descriptionContentKey: z.ZodString;
|
|
491
|
-
errorContentKey: z.ZodString;
|
|
492
|
-
placeholderContentKey: z.ZodOptional<z.ZodString>;
|
|
493
|
-
unitContentKey: z.ZodOptional<z.ZodString>;
|
|
494
|
-
checkedLabelContentKey: z.ZodOptional<z.ZodString>;
|
|
495
|
-
uncheckedLabelContentKey: z.ZodOptional<z.ZodString>;
|
|
496
|
-
required: z.ZodOptional<z.ZodBoolean>;
|
|
497
|
-
controllerType: z.ZodOptional<z.ZodString>;
|
|
498
|
-
validationTypes: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
499
|
-
validationMessageContentKeys: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
500
|
-
selectOptions: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
501
|
-
position: z.ZodNumber;
|
|
502
|
-
id: z.ZodString;
|
|
503
|
-
value: z.ZodOptional<z.ZodString>;
|
|
504
|
-
labelContentKey: z.ZodString;
|
|
505
|
-
}, z.core.$strip>>>;
|
|
506
|
-
}, z.core.$strip>>;
|
|
507
|
-
}, z.core.$strip>>>;
|
|
508
|
-
listOrdering: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
509
|
-
}, z.core.$strip>;
|
|
510
|
-
type ChoiceOptionDetails = z.infer<typeof choiceOptionDetailsSchema>;
|
|
511
|
-
type FormFieldDetails = z.infer<typeof formFieldDetailsSchema>;
|
|
512
|
-
type FormFieldGroupDetails = z.infer<typeof formFieldGroupDetailsSchema>;
|
|
513
|
-
type ItemConfigDetails = z.infer<typeof itemConfigDetailsSchema>;
|
|
514
|
-
type SurveyInspectionIndex = SurveyAssistantEngineContext["inspection"];
|
|
515
|
-
type SurveyOutlineNode = SurveyInspectionIndex["outline"][number];
|
|
516
|
-
type SurveyKeyIndexEntry = SurveyInspectionIndex["keyIndex"][number];
|
|
517
|
-
type SurveyFocusItemNode = NonNullable<SurveyInspectionIndex["focusItem"]>;
|
|
518
|
-
declare const normalizeText: (value: string | undefined) => string;
|
|
519
|
-
declare const clampLimit: (limit: number | undefined) => number;
|
|
520
|
-
declare const parseCursor: (cursor: string | undefined) => number;
|
|
521
|
-
declare const unique: <T>(values: T[]) => T[];
|
|
522
|
-
declare const sliceWithCursor: <T>(values: T[], input: {
|
|
523
|
-
cursor?: string;
|
|
524
|
-
limit?: number;
|
|
525
|
-
}) => {
|
|
526
|
-
items: T[];
|
|
527
|
-
nextCursor: string | undefined;
|
|
528
|
-
truncated: boolean;
|
|
529
|
-
};
|
|
530
|
-
declare const mapOutlineById: (snapshot: SurveyAssistantEngineContext) => Map<string, SurveyAssistantInspectionOutlineNode>;
|
|
531
|
-
declare const mapKeyIndexById: (snapshot: SurveyAssistantEngineContext) => Map<string, SurveyAssistantInspectionKeyEntry>;
|
|
532
|
-
/** The full-survey key index, regardless of the (possibly focus-scoped) outline. */
|
|
533
|
-
declare const getKeyIndexEntries: (snapshot: SurveyAssistantEngineContext) => SurveyKeyIndexEntry[];
|
|
534
|
-
declare const getRawSurvey: (snapshot: SurveyAssistantEngineContext) => Partial<RawSurvey>;
|
|
535
|
-
declare const getRawSurveyItems: (snapshot: SurveyAssistantEngineContext) => RawSurveyItem[];
|
|
536
|
-
declare const mapRawItemsById: (snapshot: SurveyAssistantEngineContext) => Map<string, RawSurveyItem>;
|
|
537
|
-
declare const buildSurveyTranslations: (snapshot: SurveyAssistantEngineContext) => SurveyTranslations;
|
|
538
|
-
declare const summarizeRawItem: (item: RawSurveyItem) => ItemSummary;
|
|
539
|
-
declare const buildItemTranslationEntries: (snapshot: SurveyAssistantEngineContext, itemId: string, input: {
|
|
540
|
-
locales?: string[];
|
|
541
|
-
textLimit?: number;
|
|
542
|
-
}) => TranslationEntry[];
|
|
543
|
-
declare const summarizeOutlineNode: (node: SurveyOutlineNode) => ItemSummary;
|
|
544
|
-
declare const summarizeKeyIndexEntry: (entry: SurveyKeyIndexEntry, outlineById: Map<string, SurveyOutlineNode>) => ItemSummary;
|
|
545
|
-
declare const summarizeKeyIndexEntries: (entries: SurveyKeyIndexEntry[], outlineById: Map<string, SurveyOutlineNode>) => ItemSummary[];
|
|
546
|
-
declare const buildItemConfigDetails: (rawItem: RawSurveyItem) => ItemConfigDetails | undefined;
|
|
547
|
-
declare const buildEmbeddedFormDetails: (choiceOption: ChoiceOptionDetails, embeddedForm: unknown) => ItemConfigDetails | undefined;
|
|
548
|
-
declare const buildConfigSearchText: (rawItem: RawSurveyItem) => string[];
|
|
549
|
-
declare const summarizeFocusItemNode: (node: SurveyFocusItemNode, outlineById: Map<string, SurveyOutlineNode>) => ItemSummary;
|
|
550
|
-
declare const summarizeItemById: (itemId: string, indexById: Map<string, SurveyKeyIndexEntry>, outlineById: Map<string, SurveyOutlineNode>) => ItemSummary | undefined;
|
|
551
|
-
/**
|
|
552
|
-
* Resolve an item by internal itemId, or fall back to matching on `key` /
|
|
553
|
-
* `fullKey`. Model-facing text (outline rows, fullKey paths) only ever shows
|
|
554
|
-
* key/fullKey, not the internal itemId, so models often pass a key like
|
|
555
|
-
* "info_1" where an itemId is expected — this keeps that usage working.
|
|
556
|
-
*/
|
|
557
|
-
declare const resolveItemSummary: (identifier: string, indexById: Map<string, SurveyKeyIndexEntry>, outlineById: Map<string, SurveyOutlineNode>) => ItemSummary | undefined;
|
|
558
|
-
declare const itemMatchesQuery: (item: ItemSummary, query: string) => boolean;
|
|
559
|
-
/**
|
|
560
|
-
* Direct children of `parentFullKey` derived from the full-survey key index.
|
|
561
|
-
* This works for any item, selected or not.
|
|
562
|
-
*/
|
|
563
|
-
declare const findDirectChildrenByFullKey: (entries: SurveyKeyIndexEntry[], outlineById: Map<string, SurveyOutlineNode>, parentFullKey: string) => ItemSummary[];
|
|
564
|
-
//#endregion
|
|
565
|
-
//#region src/engine/normalization.d.ts
|
|
566
|
-
type SurveyChangeNormalizationIssue = {
|
|
567
|
-
path: string;
|
|
568
|
-
message: string;
|
|
569
|
-
};
|
|
570
|
-
/**
|
|
571
|
-
* Accepts common model-authored shorthand and converts it to the strict
|
|
572
|
-
* assistant operation shape before validation. This keeps the public tool
|
|
573
|
-
* compact while making it tolerant of predictable schema-near authoring
|
|
574
|
-
* mistakes: nested raw translation maps, sibling config objects, choice
|
|
575
|
-
* optionId aliases, flat form fields, and compact rich-text blocks.
|
|
576
|
-
*/
|
|
577
|
-
declare const normalizeSurveyChangeOperations: (operations: unknown[], defaultLocale: string) => {
|
|
578
|
-
operations: unknown[];
|
|
579
|
-
issues: SurveyChangeNormalizationIssue[];
|
|
580
|
-
};
|
|
581
|
-
//#endregion
|
|
582
|
-
//#region src/engine/operation-execution.d.ts
|
|
583
|
-
/**
|
|
584
|
-
* Canonical pure executor for already-normalized, validated survey operation
|
|
585
|
-
* semantics. Raw-draft simulation uses the returned survey directly; editor
|
|
586
|
-
* adapters use it to decide domain results before recording them through the
|
|
587
|
-
* editor's normal mutation and history APIs.
|
|
588
|
-
*/
|
|
589
|
-
declare const executeSurveyOperationsOnRawSurvey: ({
|
|
590
|
-
operations,
|
|
591
|
-
survey
|
|
592
|
-
}: {
|
|
593
|
-
operations: SurveyOperation[];
|
|
594
|
-
survey: RawSurvey;
|
|
595
|
-
}) => RawSurvey;
|
|
596
|
-
/** @deprecated Prefer `executeSurveyOperationsOnRawSurvey` for new integrations. */
|
|
597
|
-
declare const applyValidatedSurveyOperationsToDraft: ({
|
|
598
|
-
operations,
|
|
599
|
-
survey
|
|
600
|
-
}: {
|
|
601
|
-
operations: SurveyOperation[];
|
|
602
|
-
survey: RawSurvey;
|
|
603
|
-
}) => RawSurvey;
|
|
604
|
-
//#endregion
|
|
605
|
-
//#region src/engine/operations.d.ts
|
|
606
|
-
declare const MAX_SURVEY_ASSISTANT_OPERATIONS_PER_PROPOSAL = 200;
|
|
607
|
-
declare const MAX_SURVEY_ASSISTANT_OPERATIONS_PER_TURN_DRAFT = 1000;
|
|
608
|
-
declare const buildSurveyDocumentVersion: (snapshot: SurveyAssistantEngineContext | SurveyDocumentSnapshot) => SurveyDocumentVersion;
|
|
609
|
-
declare const validateSurveyOperations: ({
|
|
610
|
-
allowExpressionJsonPatches,
|
|
611
|
-
maxOperations,
|
|
612
|
-
operations,
|
|
613
|
-
snapshot: snapshotInput
|
|
614
|
-
}: {
|
|
615
|
-
allowExpressionJsonPatches?: boolean;
|
|
616
|
-
maxOperations?: number;
|
|
617
|
-
operations: SurveyOperation[];
|
|
618
|
-
snapshot: SurveyAssistantEngineContext | SurveyDocumentSnapshot | undefined;
|
|
619
|
-
}) => SurveyValidationResult;
|
|
620
|
-
declare const createSurveyChangeSet: ({
|
|
621
|
-
allowExpressionJsonPatches,
|
|
622
|
-
maxOperations,
|
|
623
|
-
operations,
|
|
624
|
-
snapshot,
|
|
625
|
-
summary,
|
|
626
|
-
turnId
|
|
627
|
-
}: {
|
|
628
|
-
allowExpressionJsonPatches?: boolean;
|
|
629
|
-
maxOperations?: number;
|
|
630
|
-
operations: SurveyOperation[];
|
|
631
|
-
snapshot: SurveyAssistantEngineContext | SurveyDocumentSnapshot | undefined;
|
|
632
|
-
summary: string;
|
|
633
|
-
turnId: string;
|
|
634
|
-
}) => SurveyChangeSet;
|
|
635
|
-
//#endregion
|
|
636
|
-
//#region src/engine/mutation-recovery.d.ts
|
|
637
|
-
type RecoveryTargetRefinement = {
|
|
638
|
-
targets: string[];
|
|
639
|
-
replacement: string;
|
|
640
|
-
};
|
|
641
|
-
//#endregion
|
|
642
|
-
//#region src/engine/turn-survey-draft.d.ts
|
|
643
|
-
declare const mutationRecoveryRouteByIssueCode: {
|
|
644
|
-
readonly "expression-patch-requires-specialized-tool": "expression";
|
|
645
|
-
};
|
|
646
|
-
type SurveyAssistantMutationRoute = (typeof mutationRecoveryRouteByIssueCode)[keyof typeof mutationRecoveryRouteByIssueCode];
|
|
647
|
-
/**
|
|
648
|
-
* Request-scoped transactional draft for one assistant response.
|
|
649
|
-
*
|
|
650
|
-
* Mutation tools submit deltas. A successful delta replaces the previous
|
|
651
|
-
* candidate with a newly validated, cumulative change set. A rejected delta
|
|
652
|
-
* leaves the accepted draft intact and blocks authorization until all of its
|
|
653
|
-
* operation/surface obligations have been repaired. Only the latest cumulative
|
|
654
|
-
* candidate can be authorized.
|
|
655
|
-
*/
|
|
656
|
-
declare class TurnSurveyDraft {
|
|
657
|
-
#private;
|
|
658
|
-
readonly turnId: string;
|
|
659
|
-
constructor(turnId?: `${string}-${string}-${string}-${string}-${string}`);
|
|
660
|
-
initialize(context: SurveyAssistantEngineContext): void;
|
|
661
|
-
stage({
|
|
662
|
-
addressedTargets,
|
|
663
|
-
allowExpressionJsonPatches,
|
|
664
|
-
handledMutationRoutes,
|
|
665
|
-
retryOfChangeIds,
|
|
666
|
-
operations,
|
|
667
|
-
snapshot,
|
|
668
|
-
summary
|
|
669
|
-
}: {
|
|
670
|
-
addressedTargets?: string[];
|
|
671
|
-
allowExpressionJsonPatches?: boolean;
|
|
672
|
-
handledMutationRoutes?: SurveyAssistantMutationRoute[];
|
|
673
|
-
retryOfChangeIds?: string[];
|
|
674
|
-
operations: SurveyOperation[];
|
|
675
|
-
snapshot: SurveyAssistantEngineContext | SurveyDocumentSnapshot | undefined;
|
|
676
|
-
summary: string;
|
|
677
|
-
}): SurveyChangeSet;
|
|
678
|
-
reject(candidate: SurveyChangeSet, addressedTargets?: Iterable<string>, refinements?: RecoveryTargetRefinement[]): SurveyChangeSet;
|
|
679
|
-
finalize(status: SurveyAssistantTurnFinal["status"], createdAt?: string, details?: Pick<SurveyAssistantTurnFinal, "durationMs" | "startedAt" | "terminationReason">): SurveyAssistantTurnFinal;
|
|
680
|
-
getCandidate(changeSetId: string): SurveyChangeSet | undefined;
|
|
681
|
-
get draftOperations(): readonly SurveyOperation[];
|
|
682
|
-
get context(): SurveyAssistantEngineContext | undefined;
|
|
683
|
-
get final(): SurveyAssistantTurnFinal | null;
|
|
684
|
-
}
|
|
685
|
-
//#endregion
|
|
686
|
-
//#region src/engine/task-context.d.ts
|
|
687
|
-
type SurveyAssistantTaskPurpose = "suggest-item-key" | "suggest-item-label" | "translate-content";
|
|
688
|
-
interface BuildSurveyAssistantTaskContextOptions {
|
|
689
|
-
purpose: SurveyAssistantTaskPurpose;
|
|
690
|
-
focusItemId?: string;
|
|
691
|
-
sourceLocale?: string;
|
|
692
|
-
targetLocales?: readonly string[];
|
|
693
|
-
sourceTexts?: readonly string[];
|
|
694
|
-
}
|
|
695
|
-
declare const buildSurveyAssistantTaskContext: (snapshot: SurveyDocumentSnapshot, options: BuildSurveyAssistantTaskContextOptions) => SurveyAssistantTaskContext;
|
|
696
|
-
//#endregion
|
|
697
|
-
//#region src/engine/task-result-cache.d.ts
|
|
698
|
-
interface SurveyAssistantTaskResultCacheOptions {
|
|
699
|
-
ttlMs?: number;
|
|
700
|
-
maxEntries?: number;
|
|
701
|
-
now?: () => number;
|
|
702
|
-
}
|
|
703
|
-
/** Small in-memory LRU cache for deterministic, snapshot-scoped one-shot results. */
|
|
704
|
-
declare class SurveyAssistantTaskResultCache {
|
|
705
|
-
private readonly entries;
|
|
706
|
-
private readonly ttlMs;
|
|
707
|
-
private readonly maxEntries;
|
|
708
|
-
private readonly now;
|
|
709
|
-
constructor(options?: SurveyAssistantTaskResultCacheOptions);
|
|
710
|
-
get<TResult>(key: string): TResult | undefined;
|
|
711
|
-
set<TResult>(key: string, value: TResult): void;
|
|
712
|
-
clear(): void;
|
|
713
|
-
}
|
|
714
|
-
//#endregion
|
|
715
|
-
//#region src/engine/audit.d.ts
|
|
716
|
-
type SurveyAuditSeverity = "error" | "warning" | "info";
|
|
717
|
-
type SurveyAuditCategory = "structure" | "content" | "localization" | "logic" | "responses" | "assets" | "quality";
|
|
718
|
-
interface SurveyAuditFinding {
|
|
719
|
-
code: string;
|
|
720
|
-
severity: SurveyAuditSeverity;
|
|
721
|
-
category: SurveyAuditCategory;
|
|
722
|
-
message: string;
|
|
723
|
-
itemId?: string;
|
|
724
|
-
locale?: string;
|
|
725
|
-
contentKey?: string;
|
|
726
|
-
suggestion?: string;
|
|
727
|
-
}
|
|
728
|
-
interface SurveyQualityReviewPrinciple {
|
|
729
|
-
id: string;
|
|
730
|
-
title: string;
|
|
731
|
-
prompt: string;
|
|
732
|
-
}
|
|
733
|
-
interface SurveyAuditKeyReviewEntry {
|
|
734
|
-
kind: "item" | "choice-option" | "form-field";
|
|
735
|
-
itemId: string;
|
|
736
|
-
itemKey: string;
|
|
737
|
-
key: string;
|
|
738
|
-
keySource: "explicit" | "fallback-id";
|
|
739
|
-
contentKey?: string;
|
|
740
|
-
content?: string;
|
|
741
|
-
}
|
|
742
|
-
interface SurveyAuditReport {
|
|
743
|
-
summary: Record<SurveyAuditSeverity, number> & {
|
|
744
|
-
total: number;
|
|
745
|
-
};
|
|
746
|
-
findingCount: number;
|
|
747
|
-
truncated: boolean;
|
|
748
|
-
metrics: {
|
|
749
|
-
itemCount: number;
|
|
750
|
-
localeCount: number;
|
|
751
|
-
responseSlotCount: number;
|
|
752
|
-
assetCount: number;
|
|
753
|
-
itemTypes: Record<string, number>;
|
|
754
|
-
};
|
|
755
|
-
findings: SurveyAuditFinding[];
|
|
756
|
-
qualityReviewPrinciples: SurveyQualityReviewPrinciple[];
|
|
757
|
-
keyReview: {
|
|
758
|
-
sourceLocale?: string;
|
|
759
|
-
entryCount: number;
|
|
760
|
-
offset: number;
|
|
761
|
-
returnedEntryCount: number;
|
|
762
|
-
truncated: boolean;
|
|
763
|
-
entries: SurveyAuditKeyReviewEntry[];
|
|
764
|
-
note: string;
|
|
765
|
-
};
|
|
766
|
-
note: string;
|
|
767
|
-
}
|
|
768
|
-
declare const auditSurvey: (context: SurveyAssistantEngineContext, options?: {
|
|
769
|
-
sourceLocale?: string;
|
|
770
|
-
targetLocales?: string[];
|
|
771
|
-
maxFindings?: number;
|
|
772
|
-
keyReviewOffset?: number;
|
|
773
|
-
keyReviewLimit?: number;
|
|
774
|
-
}) => SurveyAuditReport;
|
|
775
|
-
//#endregion
|
|
776
|
-
export { formSelectOptionDetailsSchema as $, resolveAssistantCapabilityReference as $t, ChoiceOptionDetails as A, inferExpressionReturnType as At, SurveyOutlineNode as B, createSurveyAssistantEngineContext as Bt, MAX_SURVEY_ASSISTANT_OPERATIONS_PER_TURN_DRAFT as C, buildExpressionMutationPatches as Ct, applyValidatedSurveyOperationsToDraft as D, deriveSurveyExpressionResponseSlots as Dt, validateSurveyOperations as E, analyzeSurveyAssistantExpressionReferences as Et, ItemSummary as F, SurveyAssistantInspectionIndex as Ft, buildItemTranslationEntries as G, AssistantItemInspection as Gt, buildConfigSearchText as H, AssistantCapabilityReference as Ht, MAX_LIMIT as I, SurveyAssistantInspectionItemNode as It, clampLimit as J, assertSurveyAssistantCapabilities as Jt, buildSurveyTranslations as K, SurveyAssistantCapabilityMismatchError as Kt, SurveyFocusItemNode as L, SurveyAssistantInspectionKeyEntry as Lt, FormFieldDetails as M, CreateSurveyAssistantEngineContextOptions as Mt, FormFieldGroupDetails as N, SurveyAssistantEngineContext as Nt, executeSurveyOperationsOnRawSurvey as O, getSurveyAssistantExpressionDiagnosticGuidance as Ot, ItemConfigDetails as P, SurveyAssistantInspectionFocus as Pt, formFieldGroupLayoutSchema as Q, inspectAssistantItem as Qt, SurveyInspectionIndex as R, SurveyAssistantInspectionOutlineNode as Rt, MAX_SURVEY_ASSISTANT_OPERATIONS_PER_PROPOSAL as S, buildExpressionMutationBatch as St, createSurveyChangeSet as T, expressionSchema as Tt, buildEmbeddedFormDetails as U, AssistantItemCapabilityAdapter as Ut, TranslationEntry as V, deriveResponseSlotTypes as Vt, buildItemConfigDetails as W, AssistantItemCreationResolution as Wt, formFieldDetailsSchema as X, createUnsupportedItemCapability as Xt, findDirectChildrenByFullKey as Y, createSurveyAssistantCapabilities as Yt, formFieldGroupDetailsSchema as Z, getDeterministicCreateItemTypes as Zt, BuildSurveyAssistantTaskContextOptions as _, summarizeOutlineNode as _t, isValidSimpleFormConfig$1 as a, itemSummarySchema as at, SurveyAssistantMutationRoute as b, unique as bt, SurveyAuditCategory as c, mapRawItemsById as ct, SurveyAuditReport as d, resolveItemSummary as dt, resolveAssistantItemCreation as en, getKeyIndexEntries as et, SurveyAuditSeverity as f, sliceWithCursor as ft, SurveyAssistantTaskResultCacheOptions as g, summarizeKeyIndexEntry as gt, SurveyAssistantTaskResultCache as h, summarizeKeyIndexEntries as ht, isCompatibleSimpleFieldUpsert$1 as i, itemMatchesQuery as it, DEFAULT_LIMIT as j, validateExpression as jt, normalizeSurveyChangeOperations as k, ResponseSlotTypeLookup as kt, SurveyAuditFinding as l, normalizeText as lt, auditSurvey as m, summarizeItemById as mt, getFormAuthoringMode$1 as n, getRawSurveyItems as nt, normalizeFormAuthoringConfig$1 as o, mapKeyIndexById as ot, SurveyQualityReviewPrinciple as p, summarizeFocusItemNode as pt, choiceOptionDetailsSchema as q, SurveyAssistantCapabilitySet as qt, hasSingleFormField as r, itemConfigDetailsSchema as rt, transitionFormAuthoringMode$1 as s, mapOutlineById as st, FormAuthoringMode as t, getRawSurvey as tt, SurveyAuditKeyReviewEntry as u, parseCursor as ut, SurveyAssistantTaskPurpose as v, summarizeRawItem as vt, buildSurveyDocumentVersion as w, expressionMutationSchema as wt, TurnSurveyDraft as x, ExpressionMutation as xt, buildSurveyAssistantTaskContext as y, translationEntrySchema as yt, SurveyKeyIndexEntry as z, SurveyAssistantResponseSlotTypes as zt };
|
|
777
|
-
//# sourceMappingURL=index-Tnqv-yKW.d.mts.map
|