@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.
Files changed (142) hide show
  1. package/README.md +58 -3
  2. package/dist/{attachments-B0hg3vpT.mjs → attachments-BuNni5vB.mjs} +1 -1
  3. package/dist/{attachments-B0hg3vpT.mjs.map → attachments-BuNni5vB.mjs.map} +1 -1
  4. package/dist/{authoring-references-BJQ_1nMX.mjs → authoring-references-CmwLc_C8.mjs} +49 -32
  5. package/dist/authoring-references-CmwLc_C8.mjs.map +1 -0
  6. package/dist/capabilities-D55dq-fO.mjs +582 -0
  7. package/dist/capabilities-D55dq-fO.mjs.map +1 -0
  8. package/dist/capabilities-default.d.mts +5 -12
  9. package/dist/capabilities-default.d.mts.map +1 -1
  10. package/dist/capabilities-default.mjs +2 -411
  11. package/dist/capabilities-z95e1mti.d.mts +117 -0
  12. package/dist/capabilities-z95e1mti.d.mts.map +1 -0
  13. package/dist/{constants-0UHGFcRJ.mjs → constants-Ct-vv9cu.mjs} +1 -1
  14. package/dist/{constants-0UHGFcRJ.mjs.map → constants-Ct-vv9cu.mjs.map} +1 -1
  15. package/dist/{constants-Be91Gay9.d.mts → constants-HL_klgJl.d.mts} +7 -28
  16. package/dist/constants-HL_klgJl.d.mts.map +1 -0
  17. package/dist/{controller-proxy-BH05e-C2.mjs → controller-proxy-BQ1YsVxJ.mjs} +12 -21
  18. package/dist/controller-proxy-BQ1YsVxJ.mjs.map +1 -0
  19. package/dist/controller-proxy-Cmzdr9tV.d.mts +65 -0
  20. package/dist/controller-proxy-Cmzdr9tV.d.mts.map +1 -0
  21. package/dist/default-D22AKTqE.mjs +233 -0
  22. package/dist/default-D22AKTqE.mjs.map +1 -0
  23. package/dist/{digest-SJmoYVaK.d.mts → digest-FnTTDBq2.d.mts} +2 -3
  24. package/dist/digest-FnTTDBq2.d.mts.map +1 -0
  25. package/dist/digest.d.mts +1 -1
  26. package/dist/digest.mjs.map +1 -1
  27. package/dist/engine-D950TfvC.mjs +3098 -0
  28. package/dist/engine-D950TfvC.mjs.map +1 -0
  29. package/dist/engine.d.mts +4 -3
  30. package/dist/engine.mjs +3 -3
  31. package/dist/{fair-guidance-CRYCRxQm.mjs → fair-guidance-BmO4PswW.mjs} +1 -1
  32. package/dist/{fair-guidance-CRYCRxQm.mjs.map → fair-guidance-BmO4PswW.mjs.map} +1 -1
  33. package/dist/{index-l_EK4yK7.d.mts → index-B8TLBd1G.d.mts} +18 -72
  34. package/dist/index-B8TLBd1G.d.mts.map +1 -0
  35. package/dist/index-CaX3hZmr.d.mts +23813 -0
  36. package/dist/index-CaX3hZmr.d.mts.map +1 -0
  37. package/dist/{index-x0qprHgK.d.mts → index-CeUlGkoU.d.mts} +58 -28
  38. package/dist/index-CeUlGkoU.d.mts.map +1 -0
  39. package/dist/{index-nhrgbgO5.d.mts → index-DYHdvSE8.d.mts} +347 -88
  40. package/dist/index-DYHdvSE8.d.mts.map +1 -0
  41. package/dist/lifecycle-DFzxVxpq.d.mts +54346 -0
  42. package/dist/lifecycle-DFzxVxpq.d.mts.map +1 -0
  43. package/dist/{memory-thread-repository-KWHQWFEW.mjs → memory-thread-repository-DmLadygY.mjs} +60 -30
  44. package/dist/memory-thread-repository-DmLadygY.mjs.map +1 -0
  45. package/dist/protocol-BQ7uIDYT.mjs +569 -0
  46. package/dist/protocol-BQ7uIDYT.mjs.map +1 -0
  47. package/dist/protocol.d.mts +4 -4
  48. package/dist/protocol.mjs +4 -3
  49. package/dist/{react-B3ybjJ-X.mjs → react-DybJ5pWw.mjs} +159 -46
  50. package/dist/react-DybJ5pWw.mjs.map +1 -0
  51. package/dist/react-integration.d.mts +2 -2
  52. package/dist/react-integration.mjs +2 -2
  53. package/dist/react.d.mts +3 -3
  54. package/dist/react.mjs +3 -3
  55. package/dist/references/assistant-operations.md +224 -180
  56. package/dist/references/core-rules.md +6 -3
  57. package/dist/references/element-types.md +189 -0
  58. package/dist/references/expressions.md +307 -168
  59. package/dist/references/fair-by-design.md +9 -9
  60. package/dist/references/follow-ups.md +151 -0
  61. package/dist/references/localization.md +26 -12
  62. package/dist/references/response-variables.md +38 -0
  63. package/dist/references/rich-text-content.md +22 -43
  64. package/dist/references/source-material-surveys.md +20 -24
  65. package/dist/references/survey-data-model.md +36 -102
  66. package/dist/{request-context-CG4SWijt.mjs → request-context-KVh8VjgH.mjs} +4 -10
  67. package/dist/request-context-KVh8VjgH.mjs.map +1 -0
  68. package/dist/{request-guardrails-TmgQtqp4.mjs → request-guardrails-C0ugBOp0.mjs} +6 -5
  69. package/dist/request-guardrails-C0ugBOp0.mjs.map +1 -0
  70. package/dist/server-agent.d.mts +62 -43
  71. package/dist/server-agent.d.mts.map +1 -1
  72. package/dist/server-agent.mjs +73 -40
  73. package/dist/server-agent.mjs.map +1 -1
  74. package/dist/server-runtime.d.mts +24 -42
  75. package/dist/server-runtime.d.mts.map +1 -1
  76. package/dist/server-runtime.mjs +12 -12
  77. package/dist/server-runtime.mjs.map +1 -1
  78. package/dist/server-tasks.d.mts +2 -2
  79. package/dist/server-tasks.mjs +2 -313
  80. package/dist/server-tools.d.mts +1 -1
  81. package/dist/server-tools.mjs +1 -1
  82. package/dist/server.d.mts +14 -36
  83. package/dist/server.d.mts.map +1 -1
  84. package/dist/server.mjs +5 -5
  85. package/dist/server.mjs.map +1 -1
  86. package/dist/storage-postgres.d.mts +9 -25
  87. package/dist/storage-postgres.d.mts.map +1 -1
  88. package/dist/storage-postgres.mjs +5 -4
  89. package/dist/storage-postgres.mjs.map +1 -1
  90. package/dist/tasks-Coh5N027.mjs +397 -0
  91. package/dist/tasks-Coh5N027.mjs.map +1 -0
  92. package/dist/{tasks-CYqrcaRO.d.mts → tasks-wb9M-bak.d.mts} +25 -41
  93. package/dist/tasks-wb9M-bak.d.mts.map +1 -0
  94. package/dist/thread-documents-DrHbaXqP.d.mts +119 -0
  95. package/dist/thread-documents-DrHbaXqP.d.mts.map +1 -0
  96. package/dist/{thread-handlers-DBAaU7BA.d.mts → thread-handlers-C3Iya92v.d.mts} +9 -40
  97. package/dist/thread-handlers-C3Iya92v.d.mts.map +1 -0
  98. package/dist/{tools-BvSovehT.mjs → tools-D0KBDolR.mjs} +677 -459
  99. package/dist/tools-D0KBDolR.mjs.map +1 -0
  100. package/dist/turn-survey-draft-B34lggSG.d.mts +185 -0
  101. package/dist/turn-survey-draft-B34lggSG.d.mts.map +1 -0
  102. package/dist/ui.css +1 -1
  103. package/dist/ui.d.mts +15 -54
  104. package/dist/ui.d.mts.map +1 -1
  105. package/dist/ui.mjs +203 -156
  106. package/dist/ui.mjs.map +1 -1
  107. package/docs/integration.md +11 -1
  108. package/package.json +41 -36
  109. package/dist/authoring-references-BJQ_1nMX.mjs.map +0 -1
  110. package/dist/capabilities-1KNnNO1_.mjs +0 -73
  111. package/dist/capabilities-1KNnNO1_.mjs.map +0 -1
  112. package/dist/capabilities-DVTfogjv.d.mts +0 -193
  113. package/dist/capabilities-DVTfogjv.d.mts.map +0 -1
  114. package/dist/capabilities-default.mjs.map +0 -1
  115. package/dist/constants-Be91Gay9.d.mts.map +0 -1
  116. package/dist/controller-proxy-BH05e-C2.mjs.map +0 -1
  117. package/dist/controller-proxy-Bd0ZHBPF.d.mts +0 -85
  118. package/dist/controller-proxy-Bd0ZHBPF.d.mts.map +0 -1
  119. package/dist/digest-SJmoYVaK.d.mts.map +0 -1
  120. package/dist/engine-Bo85Oyj0.mjs +0 -6723
  121. package/dist/engine-Bo85Oyj0.mjs.map +0 -1
  122. package/dist/index-Tnqv-yKW.d.mts +0 -777
  123. package/dist/index-Tnqv-yKW.d.mts.map +0 -1
  124. package/dist/index-l_EK4yK7.d.mts.map +0 -1
  125. package/dist/index-nhrgbgO5.d.mts.map +0 -1
  126. package/dist/index-x0qprHgK.d.mts.map +0 -1
  127. package/dist/lifecycle-Bx0aq_4S.d.mts +0 -529
  128. package/dist/lifecycle-Bx0aq_4S.d.mts.map +0 -1
  129. package/dist/memory-thread-repository-KWHQWFEW.mjs.map +0 -1
  130. package/dist/protocol-BhzQbx81.mjs +0 -1173
  131. package/dist/protocol-BhzQbx81.mjs.map +0 -1
  132. package/dist/react-B3ybjJ-X.mjs.map +0 -1
  133. package/dist/references/embedded-forms.md +0 -126
  134. package/dist/references/item-types.md +0 -407
  135. package/dist/request-context-CG4SWijt.mjs.map +0 -1
  136. package/dist/request-guardrails-TmgQtqp4.mjs.map +0 -1
  137. package/dist/server-tasks.mjs.map +0 -1
  138. package/dist/tasks-CYqrcaRO.d.mts.map +0 -1
  139. package/dist/thread-documents-rmd6nyX9.d.mts +0 -107
  140. package/dist/thread-documents-rmd6nyX9.d.mts.map +0 -1
  141. package/dist/thread-handlers-DBAaU7BA.d.mts.map +0 -1
  142. package/dist/tools-BvSovehT.mjs.map +0 -1
@@ -1,130 +1,64 @@
1
- # Survey Data Model
1
+ # Survey data model
2
2
 
3
- ## RawSurvey
3
+ The current survey format is schema version **3**. The trusted installed registry supplies every element schema; inspect the current draft and focused operation contracts before constructing payloads. There are no legacy question wrappers or form modes.
4
4
 
5
- A survey JSON object has this shape:
5
+ ## Survey and flow
6
+
7
+ Keep `$schema` and `schemaVersion` unchanged. A survey has `surveyItems`, exactly one root `group`, and optional `maxItemsPerPage`, `metadata`, `templateValues`, `assets`, `translations` and `defaultLocale` (the source language; must be a `translations` key). Flow items are `content`, `group`, or `page-break`. Groups order child item IDs in `config.items`; they may shuffle children. A page break has empty config. Use `reorder-items` with the complete child list or `move-item` with an inspected destination.
8
+
9
+ Minimal survey document (for understanding the format, not for replacing an existing survey):
6
10
 
7
11
  ```json
8
12
  {
9
13
  "$schema": "https://github.com/case-framework/case-survey-toolkit/packages/survey-core/schemas/survey-schema.json",
10
- "maxItemsPerPage": { "large": 1, "small": 1 },
11
- "surveyItems": [],
12
- "assets": {},
13
- "metadata": {},
14
- "templateValues": {},
14
+ "schemaVersion": 3,
15
+ "surveyItems": [
16
+ {
17
+ "id": "root",
18
+ "itemType": "group",
19
+ "config": { "isRoot": true, "items": [], "shuffleItems": false }
20
+ }
21
+ ],
15
22
  "translations": {}
16
23
  }
17
24
  ```
18
25
 
19
- Required fields:
20
-
21
- - `$schema`: keep the current schema string; never remove or edit it.
22
- - `surveyItems`: array of raw survey items.
23
-
24
- Optional fields:
25
-
26
- - `maxItemsPerPage`: object with numeric `large` and `small` page-size limits.
27
- - `metadata`: survey-level string map.
28
- - `templateValues`: reusable expression values; see expressions.md.
29
- - `assets`: image assets keyed by asset id.
30
- - `translations`: locale-keyed translated content.
31
-
32
- ## RawSurveyItem
33
-
34
- Minimal item shape:
35
-
36
- ```json
37
- {
38
- "id": "stable-unique-id",
39
- "key": "coding_key",
40
- "itemType": "choiceItem"
41
- }
42
- ```
26
+ `surveyItems` is a flat list. Flow nesting is represented by the ordered child IDs in groups, not nested item objects. Every non-root item belongs to exactly one group. By contrast, elements, layouts, sections and follow-up bodies are nested directly inside their containing content item. Flow parent IDs and composition layout/body destinations are different kinds of targets; inspect the intended destination before editing.
43
27
 
44
- Conventions:
28
+ A content item has optional localized title, subtitle and footer, and `config.body`. It may contain one element (the common case) or several. An element preset inserted into the survey creates a content item containing that element; inserting into a layout adds it to that item. This is the same element definition, with no simple/custom mode transition.
45
29
 
46
- - `id` is globally unique and is the durable reference used by groups, translations, response slots, expressions, and patches.
47
- - `key` is the coding key shown in fullKey paths. Sibling keys must be unique and use letters, numbers, underscores, or hyphens.
48
- - `itemType` must exist in the current editor registry.
30
+ ## Composition
49
31
 
50
- Identifier rules apply to every built-in and custom item type:
32
+ A body is `{ "blocks": [...] }`. Each block is either:
51
33
 
52
- - Keep inspected identifiers byte-for-byte exact when displaying, explaining, comparing, or
53
- reusing them. Do not replace separators, split camelCase, change capitalization, or substitute
54
- visible labels.
55
- - Choose new ids and keys for stable data roles, not the current wording or position. Avoid names
56
- such as `question_about_apples` or suffixes such as `q1`; labels and question text can change
57
- without changing durable identities.
58
- - Do not silently derive one configured identifier from another. If a required identifier is
59
- omitted and a typed operation generates it, inspect the result before using it in another
60
- reference.
61
- - Custom item response slots come from that item's registered capability. Preserve their exact
62
- slot ids just like built-in slots.
34
+ - A layout: `{ "kind": "layout", "id": "layout-id", "layout": { "mode": "automatic", "maxColumns": 2 }, "elements": [...] }`.
35
+ - A semantic section: `{ "kind": "section", "id": "section-id", "body": { "blocks": [...] } }`.
63
36
 
64
- Optional fields:
37
+ Sections take the full width and structure the body vertically. A section cannot sit in a layout alongside elements, nor contain another section. Its title may be empty while drafting but should be supplied for a useful semantic grouping. Follow-up bodies may also contain sections. No follow-up may contain another follow-up, including through sections or custom elements.
65
38
 
66
- - `metadata`: string map. `metadata.itemLabel` is the internal editor label, not respondent-visible text. `metadata.editorItemColor` stores the editor item color as a hex string such as `#0369a1`.
67
- - `config`: item-type-specific configuration. Many item types need config; simple structural/content items can be sparse.
68
- - `validations`: map of validation key to `JsonExpression`.
69
- - `displayConditions`: item/root and component display expressions.
70
- - `disabledConditions`: component disabled expressions.
71
- - `prefills`: configured prefill rules; see expressions.md.
39
+ Layout columns align across rows. Automatic `maxColumns` is an upper bound: available space, minimum element widths and full-width controls determine the actual count. Advanced mode specifies `columns` at `base`, `xs`, `sm`, `md`, and `xl`; use it only for deliberate breakpoint requirements. Elements may set `placement.width` to `auto` or `full` and `placement.minWidthRem`. Radio and checkbox lists, matrices, information and consent require a full row. Dropdowns can share a row and cannot own inline follow-ups.
72
40
 
73
- ## Tree Structure
41
+ An element has `kind: "element"`, `id`, `elementType`, and registered `config`, plus optional `visibility`, `disabled`, `placement`, `exportSettings` and `prefills`. Conditions also belong directly to applicable structural owners, including items, sections and options. No condition means visible/enabled. Inspect declared owners before editing a condition.
74
42
 
75
- There must be exactly one root group:
43
+ ## Identity and content
76
44
 
77
- ```json
78
- {
79
- "itemType": "group",
80
- "config": { "isRoot": true, "items": [], "shuffleItems": false }
81
- }
82
- ```
45
+ IDs are survey-wide stable identities, independent of labels, layout, position, variable names and export codes. Preserve inspected identifiers byte-for-byte. Never infer an ID from a name or humanize it when reusing it. Duplicate editor names are legal. Choose fresh IDs for new owners and slots; preserve them when moving or translating. Custom slots come from the installed definition, not naming guesses.
83
46
 
84
- Groups order children by id in `config.items`. To reorder survey items, patch the parent group item at `/surveyItems/<groupIndex>/config/items`.
47
+ - Items have no `key`. Inspection resolves `editorName` and `breadcrumb` for discovery; neither is an identity. Mutations take exact IDs.
48
+ - Choose new IDs and variable names for stable data roles, not current wording or position. Avoid names such as `question_about_apples` or positional suffixes such as `q1`: labels and order can change without changing durable identities.
49
+ - Do not silently derive one configured identifier from another. When a preset or typed operation generates IDs, inspect its result before using them in another reference.
50
+ - Custom element response slots come from that element's registered capability. Preserve their exact slot IDs just like built-in slots; do not assume that an element ID is also its slot ID.
85
51
 
86
- ## Translations And Content
52
+ Element settings and prefills are keyed by its declared slot IDs. Cross-input validation rules live in the content item's `config.validationRules` and target slots in that item. A cross-item move must respect the explicit rule-transfer contract; do not detach referenced targets through raw patches.
87
53
 
88
- Visible text is stored under translations, not usually in item config:
54
+ Respondent content lives at `translations[locale].content[ownerId][role]`. Owners include the item, section, element, option, row, column and validation rule, as declared by their schemas. A move does not relocate translation keys. Use exact localization refs from inspection:
89
55
 
90
56
  ```json
91
- {
92
- "translations": {
93
- "en": {
94
- "itemTranslations": {
95
- "<itemId>": {
96
- "title": { "type": "md", "content": "Question text" }
97
- }
98
- },
99
- "surveyCardContent": {},
100
- "navigationContent": {},
101
- "validationMessages": {}
102
- }
103
- }
104
- }
57
+ { "scope": "content", "ownerId": "option-other", "role": "label" }
105
58
  ```
106
59
 
107
- Content values may be:
108
-
109
- - `{ "type": "md", "content": "Text" }`
110
- - `{ "type": "plain", "content": "Plain text" }`
111
- - `{ "type": "richText", "version": 1, "doc": { "type": "doc", "blocks": [...] } }`
112
-
113
- Important:
114
-
115
- - `md` and `plain` content are rendered as plain text with line breaks. Markdown syntax such as `# Heading`, `**bold**`, or `- item` is not parsed into formatting.
116
- - For unformatted text, use typed translation operations with `plainText`.
117
- - For formatted content on a surface documented as rendering rich text, use typed translation operations. The model-facing `richTextBlocks` shorthand normalizes to canonical richText `content` wherever the typed translation accepts structured `content`, but structural acceptance alone does not guarantee formatted rendering. See rich-text-content.md.
118
- - If the user asks for another language or the source material is clearly in another language, write respondent-visible translations under that locale code. A translation operation may introduce a missing locale; do not store Dutch, German, French, etc. text under `en` just because `en` exists.
119
-
120
- Common item content keys:
60
+ The item roles are `title`, `subtitle`, `footer`; section roles are `title`, `description`. Element and component roles come from capabilities. Survey wording uses `{ "scope": "survey", "surface": "navigationContent", "contentKey": "..." }`; inspect existing or declared keys.
121
61
 
122
- - `title`: question title or group/page title.
123
- - `subtitle`: question subtitle.
124
- - `topContent`: content before the response controls.
125
- - `bottomContent`: content after the response controls.
126
- - `cardFooter`: footer inside the question card.
127
- - `content`: info item body.
62
+ Content is plain text (`plain` or `md`, both rendered without Markdown parsing) or canonical `richText`. Use `update-content` with a ref, locale and exactly one of `plainText` or `content`; `content: null` clears a surface. Rich-text shorthand is normalized before validation. See rich-text-content for supported formatting. Never replace a translation container to edit a leaf, and never put target-language text under the wrong locale.
128
63
 
129
- JSON Patch paths are relative to the survey document root. Do not prefix paths with `/survey`.
130
- Escape JSON Pointer segments: `/` becomes `~1`, `~` becomes `~0`.
64
+ Item `metadata.itemLabel` and `metadata.editorItemColor` are editor-only. Coding names are also separate from respondent translations. JSON Pointer paths are rooted at the survey, without `/survey`; escape `~` as `~0` and `/` as `~1`. Inspect paths instead of guessing array indexes.
@@ -1,6 +1,6 @@
1
- import { H as surveyDocumentVersionSchema, o as surveyAssistantApplyOutcomeSchema, z as surveyAssistantSnapshotPayloadSchema } from "./protocol-BhzQbx81.mjs";
2
- import { pt as createSurveyAssistantEngineContext } from "./engine-Bo85Oyj0.mjs";
3
- import { defaultSurveyAssistantCapabilitySet } from "./capabilities-default.mjs";
1
+ import { G as surveyDocumentVersionSchema, H as surveyAssistantSnapshotPayloadSchema, o as surveyAssistantApplyOutcomeSchema } from "./protocol-BQ7uIDYT.mjs";
2
+ import { et as createSurveyAssistantEngineContext } from "./engine-D950TfvC.mjs";
3
+ import { n as defaultSurveyAssistantCapabilitySet } from "./default-D22AKTqE.mjs";
4
4
  import { MASTRA_RESOURCE_ID_KEY, MASTRA_THREAD_ID_KEY, RequestContext } from "@mastra/core/request-context";
5
5
  //#region src/server/request-context.ts
6
6
  const parseSurveyAssistantSnapshot = (value) => {
@@ -44,14 +44,9 @@ const deriveSurveyAssistantDocumentTransition = ({ current, previous }) => {
44
44
  };
45
45
  const buildSurveyAssistantRequestContext = ({ turnDraft, identity, snapshot, previousSettledVersion = null, trustedCapabilities = defaultSurveyAssistantCapabilitySet, attachmentAccess, modelAttachments = [], modelSelection, previousApplyOutcome }) => {
46
46
  const requestContext = new RequestContext();
47
- requestContext.set("invocation", { kind: "chat" });
48
47
  requestContext.set("turnId", turnDraft.turnId);
49
48
  requestContext.set("turnDraft", turnDraft);
50
49
  requestContext.set("identity", identity);
51
- if (identity.authority === "authenticated-host") {
52
- requestContext.set("authenticatedResourceId", identity.resourceId);
53
- requestContext.set("authorizedThreadId", identity.threadId);
54
- }
55
50
  requestContext.set(MASTRA_RESOURCE_ID_KEY, identity.resourceId);
56
51
  requestContext.set(MASTRA_THREAD_ID_KEY, identity.threadId);
57
52
  const documentTransition = deriveSurveyAssistantDocumentTransition({
@@ -66,7 +61,6 @@ const buildSurveyAssistantRequestContext = ({ turnDraft, identity, snapshot, pre
66
61
  if (!snapshot) return requestContext;
67
62
  const engineContext = createSurveyAssistantEngineContext(snapshot, trustedCapabilities);
68
63
  turnDraft.initialize(engineContext);
69
- requestContext.set("documentSnapshot", snapshot);
70
64
  requestContext.set("engineContext", engineContext);
71
65
  return requestContext;
72
66
  };
@@ -88,4 +82,4 @@ const requireSurveyAssistantTurnState = (requestContext) => {
88
82
  //#endregion
89
83
  export { parseSurveyAssistantPreviousSettledVersion as a, parseSurveyAssistantPreviousApplyOutcome as i, deriveSurveyAssistantDocumentTransition as n, parseSurveyAssistantSnapshot as o, getSurveyAssistantEngineContext as r, requireSurveyAssistantTurnState as s, buildSurveyAssistantRequestContext as t };
90
84
 
91
- //# sourceMappingURL=request-context-CG4SWijt.mjs.map
85
+ //# sourceMappingURL=request-context-KVh8VjgH.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"request-context-KVh8VjgH.mjs","names":[],"sources":["../src/server/request-context.ts"],"sourcesContent":["import {\n MASTRA_RESOURCE_ID_KEY,\n MASTRA_THREAD_ID_KEY,\n RequestContext,\n} from \"@mastra/core/request-context\";\nimport type { OpenAICompatibleConfig } from \"@mastra/core/llm\";\nimport type { AgentExecutionOptions } from \"@mastra/core/agent\";\nimport {\n surveyAssistantSnapshotPayloadSchema,\n surveyAssistantApplyOutcomeSchema,\n surveyDocumentVersionSchema,\n type SurveyAssistantApplyOutcome,\n type SurveyDocumentSnapshot,\n type SurveyDocumentVersion,\n} from \"../protocol\";\nimport {\n createSurveyAssistantEngineContext,\n type SurveyAssistantEngineContext,\n} from \"../engine/context\";\nimport type { TurnSurveyDraft } from \"../engine/turn-survey-draft\";\nimport type { SurveyAssistantCapabilitySet } from \"../engine/capabilities\";\nimport { defaultSurveyAssistantCapabilitySet } from \"../capabilities/default\";\nimport type {\n SurveyAssistantAttachmentAccess,\n SurveyAssistantModelAttachment,\n} from \"./thread-documents\";\n\nexport interface SurveyAssistantIdentityContext {\n authority: \"experimental-client-request\" | \"authenticated-host\";\n resourceId: string;\n surveyId?: string;\n threadId: string;\n}\n\nexport interface SurveyAssistantModelSelection {\n id: string;\n model: string | OpenAICompatibleConfig;\n providerName?: string;\n providerOptions?: AgentExecutionOptions[\"providerOptions\"];\n}\n\nexport type SurveyAssistantDocumentTransition =\n | { status: \"no-baseline\" }\n | {\n status: \"session-changed\";\n previousHistoryIndex: number;\n currentHistoryIndex: number;\n }\n | {\n status: \"unchanged\";\n previousHistoryIndex: number;\n currentHistoryIndex: number;\n capabilitiesChanged: boolean;\n }\n | {\n status: \"changed\";\n previousHistoryIndex: number;\n currentHistoryIndex: number;\n historyDirection: \"backward\" | \"forward\" | \"same-index\";\n recordedSources: Array<\"user\" | \"system\" | \"assistant\">;\n capabilitiesChanged: boolean;\n };\n\nexport interface SurveyAssistantRequestContext {\n turnId: string;\n turnDraft: TurnSurveyDraft;\n identity: SurveyAssistantIdentityContext;\n mastra__resourceId?: string;\n mastra__threadId?: string;\n documentTransition?: SurveyAssistantDocumentTransition;\n engineContext?: SurveyAssistantEngineContext;\n modelAttachments?: SurveyAssistantModelAttachment[];\n attachmentAccess?: SurveyAssistantAttachmentAccess;\n modelSelection?: SurveyAssistantModelSelection;\n previousApplyOutcome?: SurveyAssistantApplyOutcome;\n}\n\nexport const parseSurveyAssistantSnapshot = (value: unknown): SurveyDocumentSnapshot | null => {\n if (value === undefined || value === null) {\n return null;\n }\n\n return surveyAssistantSnapshotPayloadSchema.parse(value);\n};\n\nexport const parseSurveyAssistantPreviousSettledVersion = (\n value: unknown,\n): SurveyDocumentVersion | null => {\n if (value === undefined || value === null) {\n return null;\n }\n\n return surveyDocumentVersionSchema.parse(value);\n};\n\nexport const parseSurveyAssistantPreviousApplyOutcome = (\n value: unknown,\n): SurveyAssistantApplyOutcome | null => {\n if (value === undefined || value === null) {\n return null;\n }\n\n return surveyAssistantApplyOutcomeSchema.parse(value);\n};\n\nexport const deriveSurveyAssistantDocumentTransition = ({\n current,\n previous,\n}: {\n current: SurveyDocumentSnapshot | null;\n previous: SurveyDocumentVersion | null;\n}): SurveyAssistantDocumentTransition | undefined => {\n if (!current) return undefined;\n if (!previous) return { status: \"no-baseline\" };\n\n const previousHistoryIndex = previous.historyIndex;\n const currentHistoryIndex = current.version.historyIndex;\n if (previous.sessionId !== current.version.sessionId) {\n return {\n status: \"session-changed\",\n previousHistoryIndex,\n currentHistoryIndex,\n };\n }\n\n const capabilitiesChanged = previous.capabilityDigest !== current.version.capabilityDigest;\n if (previous.contentHash === current.version.contentHash) {\n return {\n status: \"unchanged\",\n previousHistoryIndex,\n currentHistoryIndex,\n capabilitiesChanged,\n };\n }\n\n const historyDirection =\n currentHistoryIndex > previousHistoryIndex\n ? \"forward\"\n : currentHistoryIndex < previousHistoryIndex\n ? \"backward\"\n : \"same-index\";\n const recordedSources =\n historyDirection === \"forward\"\n ? [\n ...new Set(\n (current.ui.history?.recent ?? [])\n .filter(\n (entry) => entry.index > previousHistoryIndex && entry.index <= currentHistoryIndex,\n )\n .flatMap((entry) => (entry.source ? [entry.source] : [])),\n ),\n ]\n : [];\n\n return {\n status: \"changed\",\n previousHistoryIndex,\n currentHistoryIndex,\n historyDirection,\n recordedSources,\n capabilitiesChanged,\n };\n};\n\nexport const buildSurveyAssistantRequestContext = ({\n turnDraft,\n identity,\n snapshot,\n previousSettledVersion = null,\n trustedCapabilities = defaultSurveyAssistantCapabilitySet,\n attachmentAccess,\n modelAttachments = [],\n modelSelection,\n previousApplyOutcome,\n}: {\n turnDraft: TurnSurveyDraft;\n identity: SurveyAssistantIdentityContext;\n snapshot: SurveyDocumentSnapshot | null;\n previousSettledVersion?: SurveyDocumentVersion | null;\n trustedCapabilities?: SurveyAssistantCapabilitySet;\n attachmentAccess?: SurveyAssistantAttachmentAccess;\n modelAttachments?: SurveyAssistantModelAttachment[];\n modelSelection?: SurveyAssistantModelSelection;\n previousApplyOutcome?: SurveyAssistantApplyOutcome | null;\n}): RequestContext<SurveyAssistantRequestContext> => {\n const requestContext = new RequestContext<SurveyAssistantRequestContext>();\n\n requestContext.set(\"turnId\", turnDraft.turnId);\n requestContext.set(\"turnDraft\", turnDraft);\n requestContext.set(\"identity\", identity);\n requestContext.set(MASTRA_RESOURCE_ID_KEY, identity.resourceId);\n requestContext.set(MASTRA_THREAD_ID_KEY, identity.threadId);\n const documentTransition = deriveSurveyAssistantDocumentTransition({\n current: snapshot,\n previous: previousSettledVersion,\n });\n if (documentTransition) {\n requestContext.set(\"documentTransition\", documentTransition);\n }\n if (attachmentAccess && attachmentAccess.documents.length > 0) {\n requestContext.set(\"attachmentAccess\", attachmentAccess);\n }\n if (modelAttachments.length > 0) {\n requestContext.set(\"modelAttachments\", modelAttachments);\n }\n if (modelSelection) {\n requestContext.set(\"modelSelection\", modelSelection);\n }\n if (previousApplyOutcome) {\n requestContext.set(\"previousApplyOutcome\", previousApplyOutcome);\n }\n\n if (!snapshot) {\n return requestContext;\n }\n\n const engineContext = createSurveyAssistantEngineContext(snapshot, trustedCapabilities);\n turnDraft.initialize(engineContext);\n requestContext.set(\"engineContext\", engineContext);\n\n return requestContext;\n};\n\n/**\n * Returns the materialized request-local survey state. The immutable\n * engineContext remains available as the turn baseline, while every tool uses\n * this accessor so successful same-turn mutations are immediately visible.\n */\nexport const getSurveyAssistantEngineContext = (\n requestContext: RequestContext<SurveyAssistantRequestContext> | undefined,\n): SurveyAssistantEngineContext | undefined =>\n requestContext?.get(\"turnDraft\")?.context ?? requestContext?.get(\"engineContext\");\n\nexport const requireSurveyAssistantTurnState = (\n requestContext: RequestContext<SurveyAssistantRequestContext> | undefined,\n) => {\n const turnId = requestContext?.get(\"turnId\");\n const turnDraft = requestContext?.get(\"turnDraft\");\n if (!turnId || !turnDraft || turnDraft.turnId !== turnId) {\n throw new Error(\"Survey assistant turn context is unavailable or inconsistent.\");\n }\n\n return { turnId, turnDraft };\n};\n"],"mappings":";;;;;AA6EA,MAAa,gCAAgC,UAAkD;CAC7F,IAAI,UAAU,KAAA,KAAa,UAAU,MACnC,OAAO;CAGT,OAAO,qCAAqC,MAAM,KAAK;AACzD;AAEA,MAAa,8CACX,UACiC;CACjC,IAAI,UAAU,KAAA,KAAa,UAAU,MACnC,OAAO;CAGT,OAAO,4BAA4B,MAAM,KAAK;AAChD;AAEA,MAAa,4CACX,UACuC;CACvC,IAAI,UAAU,KAAA,KAAa,UAAU,MACnC,OAAO;CAGT,OAAO,kCAAkC,MAAM,KAAK;AACtD;AAEA,MAAa,2CAA2C,EACtD,SACA,eAImD;CACnD,IAAI,CAAC,SAAS,OAAO,KAAA;CACrB,IAAI,CAAC,UAAU,OAAO,EAAE,QAAQ,c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,eAAe,IAAI,kBAAkB,cAAc;CAErD,IAAI,sBACF,eAAe,IAAI,wBAAwB,oBAAoB;CAGjE,IAAI,CAAC,UACH,OAAO;CAGT,MAAM,gBAAgB,mCAAmC,UAAU,mBAAmB;CACtF,UAAU,WAAW,aAAa;CAClC,eAAe,IAAI,iBAAiB,aAAa;CAEjD,OAAO;AACT;;;;;;AAOA,MAAa,mCACX,mBAEA,gBAAgB,IAAI,WAAW,CAAC,EAAE,WAAW,gBAAgB,IAAI,eAAe;AAElF,MAAa,mCACX,mBACG;CACH,MAAM,SAAS,gBAAgB,IAAI,QAAQ;CAC3C,MAAM,YAAY,gBAAgB,IAAI,WAAW;CACjD,IAAI,CAAC,UAAU,CAAC,aAAa,UAAU,WAAW,QAChD,MAAM,IAAI,MAAM,+DAA+D;CAGjF,OAAO;EAAE;EAAQ;CAAU;AAC7B"}
@@ -1,10 +1,10 @@
1
- import { t as SURVEY_ASSISTANT_ATTACHMENT_MEDIA_TYPES } from "./attachments-B0hg3vpT.mjs";
1
+ import { t as SURVEY_ASSISTANT_ATTACHMENT_MEDIA_TYPES } from "./attachments-BuNni5vB.mjs";
2
2
  //#region src/server/request-guardrails.ts
3
- const SURVEY_ASSISTANT_MAX_REQUEST_BYTES = 20 * 1024 * 1024;
3
+ const SURVEY_ASSISTANT_MAX_REQUEST_BYTES = 20971520;
4
4
  const SURVEY_ASSISTANT_MAX_MESSAGES = 32;
5
5
  const SURVEY_ASSISTANT_MAX_ATTACHMENTS = 4;
6
- const SURVEY_ASSISTANT_MAX_ATTACHMENT_BYTES = 5 * 1024 * 1024;
7
- const SURVEY_ASSISTANT_MAX_TOTAL_ATTACHMENT_BYTES = 12 * 1024 * 1024;
6
+ const SURVEY_ASSISTANT_MAX_ATTACHMENT_BYTES = 5242880;
7
+ const SURVEY_ASSISTANT_MAX_TOTAL_ATTACHMENT_BYTES = 12582912;
8
8
  const SURVEY_ASSISTANT_MAX_TEXT_PART_CHARS = 64e3;
9
9
  const SURVEY_ASSISTANT_MAX_ATTACHMENT_NAME_CHARS = 255;
10
10
  const SURVEY_ASSISTANT_ACCEPTED_ATTACHMENT_TYPES = new Set(SURVEY_ASSISTANT_ATTACHMENT_MEDIA_TYPES);
@@ -66,6 +66,7 @@ const validateSurveyAssistantMessages = (value, limits = SURVEY_ASSISTANT_DEFAUL
66
66
  let totalAttachmentBytes = 0;
67
67
  for (const message of value) {
68
68
  if (!message || typeof message !== "object" || !Array.isArray(message.parts)) throw new SurveyAssistantRequestError("The survey assistant messages are malformed.");
69
+ if (typeof message.id !== "string" || !message.id.trim() || message.id.length > 512) throw new SurveyAssistantRequestError("The survey assistant message id is invalid.");
69
70
  for (const part of message.parts) {
70
71
  if (!part || typeof part !== "object" || typeof part.type !== "string") throw new SurveyAssistantRequestError("A survey assistant message part is malformed.");
71
72
  if (part.type === "text") {
@@ -119,4 +120,4 @@ const readSurveyAssistantRequestJson = async (request, maxRequestBytes = SURVEY_
119
120
  //#endregion
120
121
  export { SURVEY_ASSISTANT_MAX_ATTACHMENT_NAME_CHARS as a, SURVEY_ASSISTANT_MAX_TEXT_PART_CHARS as c, readSurveyAssistantRequestJson as d, validateSurveyAssistantMessages as f, SURVEY_ASSISTANT_MAX_ATTACHMENT_BYTES as i, SURVEY_ASSISTANT_MAX_TOTAL_ATTACHMENT_BYTES as l, SURVEY_ASSISTANT_DEFAULT_REQUEST_LIMITS as n, SURVEY_ASSISTANT_MAX_MESSAGES as o, SURVEY_ASSISTANT_MAX_ATTACHMENTS as r, SURVEY_ASSISTANT_MAX_REQUEST_BYTES as s, SURVEY_ASSISTANT_ACCEPTED_ATTACHMENT_TYPES as t, SurveyAssistantRequestError as u };
121
122
 
122
- //# sourceMappingURL=request-guardrails-TmgQtqp4.mjs.map
123
+ //# sourceMappingURL=request-guardrails-C0ugBOp0.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"request-guardrails-C0ugBOp0.mjs","names":[],"sources":["../src/server/request-guardrails.ts"],"sourcesContent":["import type { UIMessage } from \"ai\";\nimport { SURVEY_ASSISTANT_ATTACHMENT_MEDIA_TYPES } from \"../protocol/attachments\";\n\nexport const SURVEY_ASSISTANT_MAX_REQUEST_BYTES = 20 * 1024 * 1024;\nexport const SURVEY_ASSISTANT_MAX_MESSAGES = 32;\nexport const SURVEY_ASSISTANT_MAX_ATTACHMENTS = 4;\nexport const SURVEY_ASSISTANT_MAX_ATTACHMENT_BYTES = 5 * 1024 * 1024;\nexport const SURVEY_ASSISTANT_MAX_TOTAL_ATTACHMENT_BYTES = 12 * 1024 * 1024;\nexport const SURVEY_ASSISTANT_MAX_TEXT_PART_CHARS = 64_000;\nexport const SURVEY_ASSISTANT_MAX_ATTACHMENT_NAME_CHARS = 255;\n\nexport const SURVEY_ASSISTANT_ACCEPTED_ATTACHMENT_TYPES = new Set<string>(\n SURVEY_ASSISTANT_ATTACHMENT_MEDIA_TYPES,\n);\n\nexport interface SurveyAssistantRequestLimits {\n acceptedAttachmentTypes: ReadonlySet<string>;\n maxAttachmentBytes: number;\n maxAttachmentNameChars: number;\n maxAttachments: number;\n maxMessages: number;\n maxRequestBytes: number;\n maxTextPartChars: number;\n maxTotalAttachmentBytes: number;\n}\n\nexport const SURVEY_ASSISTANT_DEFAULT_REQUEST_LIMITS: SurveyAssistantRequestLimits = Object.freeze({\n acceptedAttachmentTypes: SURVEY_ASSISTANT_ACCEPTED_ATTACHMENT_TYPES,\n maxAttachmentBytes: SURVEY_ASSISTANT_MAX_ATTACHMENT_BYTES,\n maxAttachmentNameChars: SURVEY_ASSISTANT_MAX_ATTACHMENT_NAME_CHARS,\n maxAttachments: SURVEY_ASSISTANT_MAX_ATTACHMENTS,\n maxMessages: SURVEY_ASSISTANT_MAX_MESSAGES,\n maxRequestBytes: SURVEY_ASSISTANT_MAX_REQUEST_BYTES,\n maxTextPartChars: SURVEY_ASSISTANT_MAX_TEXT_PART_CHARS,\n maxTotalAttachmentBytes: SURVEY_ASSISTANT_MAX_TOTAL_ATTACHMENT_BYTES,\n});\n\nexport class SurveyAssistantRequestError extends Error {\n readonly status: number;\n\n constructor(message: string, status = 400) {\n super(message);\n this.name = \"SurveyAssistantRequestError\";\n this.status = status;\n }\n}\n\nconst attachmentSignatures: Record<string, (bytes: Uint8Array) => boolean> = {\n \"application/pdf\": (bytes) =>\n bytes[0] === 0x25 && bytes[1] === 0x50 && bytes[2] === 0x44 && bytes[3] === 0x46,\n \"image/jpeg\": (bytes) => bytes[0] === 0xff && bytes[1] === 0xd8 && bytes[2] === 0xff,\n \"image/png\": (bytes) =>\n [0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a].every(\n (value, index) => bytes[index] === value,\n ),\n};\n\nconst decodeBase64Prefix = (payload: string) => {\n try {\n const binary = atob(payload.slice(0, 24));\n return Uint8Array.from(binary, (character) => character.charCodeAt(0));\n } catch {\n throw new SurveyAssistantRequestError(\"The survey assistant attachment is malformed.\");\n }\n};\n\nconst getDataUrlBytes = (url: string, expectedMediaType: string): number => {\n const match = /^data:([^;,]+);base64,([A-Za-z0-9+/]*={0,2})$/.exec(url);\n if (!match) {\n throw new SurveyAssistantRequestError(\"Attachments must be base64 data URLs.\");\n }\n if (match[1]?.toLowerCase() !== expectedMediaType.toLowerCase()) {\n throw new SurveyAssistantRequestError(\"Attachment media type does not match its data URL.\");\n }\n\n const payload = match[2] ?? \"\";\n const signatureMatches = attachmentSignatures[expectedMediaType.toLowerCase()];\n if (signatureMatches && !signatureMatches(decodeBase64Prefix(payload))) {\n throw new SurveyAssistantRequestError(\n \"Attachment content does not match its declared media type.\",\n );\n }\n const padding = payload.endsWith(\"==\") ? 2 : payload.endsWith(\"=\") ? 1 : 0;\n return Math.max(0, Math.floor((payload.length * 3) / 4) - padding);\n};\n\nexport const validateSurveyAssistantMessages = (\n value: unknown,\n limits: SurveyAssistantRequestLimits = SURVEY_ASSISTANT_DEFAULT_REQUEST_LIMITS,\n): UIMessage[] => {\n if (!Array.isArray(value) || value.length === 0) {\n throw new SurveyAssistantRequestError(\"A survey assistant message is required.\");\n }\n if (value.length > limits.maxMessages) {\n throw new SurveyAssistantRequestError(\n \"The survey assistant request contains too many messages.\",\n );\n }\n if (value.length !== 1 || value[0]?.role !== \"user\") {\n throw new SurveyAssistantRequestError(\n \"The survey assistant request must contain only the current user message.\",\n );\n }\n\n let attachmentCount = 0;\n let totalAttachmentBytes = 0;\n for (const message of value) {\n if (!message || typeof message !== \"object\" || !Array.isArray(message.parts)) {\n throw new SurveyAssistantRequestError(\"The survey assistant messages are malformed.\");\n }\n if (typeof message.id !== \"string\" || !message.id.trim() || message.id.length > 512) {\n throw new SurveyAssistantRequestError(\"The survey assistant message id is invalid.\");\n }\n\n for (const part of message.parts) {\n if (!part || typeof part !== \"object\" || typeof part.type !== \"string\") {\n throw new SurveyAssistantRequestError(\"A survey assistant message part is malformed.\");\n }\n if (part.type === \"text\") {\n if (typeof part.text !== \"string\") {\n throw new SurveyAssistantRequestError(\"A survey assistant text part is malformed.\");\n }\n if (part.text.length > limits.maxTextPartChars) {\n throw new SurveyAssistantRequestError(\"A survey assistant message is too long.\");\n }\n continue;\n }\n if (part.type !== \"file\") {\n throw new SurveyAssistantRequestError(\n \"The survey assistant message part is not supported.\",\n );\n }\n\n attachmentCount += 1;\n if (attachmentCount > limits.maxAttachments) {\n throw new SurveyAssistantRequestError(\n \"The survey assistant request has too many attachments.\",\n );\n }\n if (\n typeof part.mediaType !== \"string\" ||\n !limits.acceptedAttachmentTypes.has(part.mediaType.toLowerCase())\n ) {\n throw new SurveyAssistantRequestError(\n \"The survey assistant attachment type is not supported. Upload a PDF, PNG, or JPEG file.\",\n );\n }\n if (typeof part.url !== \"string\") {\n throw new SurveyAssistantRequestError(\"The survey assistant attachment is malformed.\");\n }\n if (\n part.filename !== undefined &&\n (typeof part.filename !== \"string\" ||\n part.filename.length > limits.maxAttachmentNameChars ||\n /[\\u0000-\\u001f\\u007f]/.test(part.filename))\n ) {\n throw new SurveyAssistantRequestError(\"The survey assistant attachment name is invalid.\");\n }\n\n const bytes = getDataUrlBytes(part.url, part.mediaType);\n if (bytes > limits.maxAttachmentBytes) {\n throw new SurveyAssistantRequestError(\"A survey assistant attachment is too large.\");\n }\n totalAttachmentBytes += bytes;\n if (totalAttachmentBytes > limits.maxTotalAttachmentBytes) {\n throw new SurveyAssistantRequestError(\n \"The survey assistant attachments are too large in total.\",\n );\n }\n }\n }\n\n return value as UIMessage[];\n};\n\nexport const readSurveyAssistantRequestJson = async (\n request: Request,\n maxRequestBytes = SURVEY_ASSISTANT_MAX_REQUEST_BYTES,\n): Promise<unknown> => {\n const declaredLength = Number(request.headers.get(\"content-length\"));\n if (Number.isFinite(declaredLength) && declaredLength > maxRequestBytes) {\n throw new SurveyAssistantRequestError(\"The survey assistant request is too large.\", 413);\n }\n\n const reader = request.body?.getReader();\n const chunks: Uint8Array[] = [];\n let totalBytes = 0;\n if (reader) {\n while (true) {\n const { done, value } = await reader.read();\n if (done) break;\n totalBytes += value.byteLength;\n if (totalBytes > maxRequestBytes) {\n await reader.cancel();\n throw new SurveyAssistantRequestError(\"The survey assistant request is too large.\", 413);\n }\n chunks.push(value);\n }\n }\n const bytes = new Uint8Array(totalBytes);\n let offset = 0;\n for (const chunk of chunks) {\n bytes.set(chunk, offset);\n offset += chunk.byteLength;\n }\n const text = new TextDecoder().decode(bytes);\n\n try {\n return JSON.parse(text) as unknown;\n } catch {\n throw new SurveyAssistantRequestError(\"The survey assistant request is not valid JSON.\");\n }\n};\n"],"mappings":";;AAGA,MAAa,qCAAqC;AAClD,MAAa,gCAAgC;AAC7C,MAAa,mCAAmC;AAChD,MAAa,wCAAwC;AACrD,MAAa,8CAA8C;AAC3D,MAAa,uCAAuC;AACpD,MAAa,6CAA6C;AAE1D,MAAa,6CAA6C,IAAI,IAC5D,uCACF;AAaA,MAAa,0CAAwE,OAAO,OAAO;CACjG,yBAAyB;CACzB,oBAAoB;CACpB,wBAAA;CACA,gBAAA;CACA,aAAA;CACA,iBAAiB;CACjB,kBAAkB;C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js";
2
- import { o as SurveyAssistantRequestContext, t as SURVEY_ASSISTANT_AGENT_ID } from "./constants-Be91Gay9.mjs";
3
- import { n as surveyAssistantTools } from "./index-x0qprHgK.mjs";
4
- import * as _$_mastra_core_agent0 from "@mastra/core/agent";
1
+ import { g as SurveyChangeSetShape } from "./lifecycle-DFzxVxpq.mjs";
2
+ import { o as SurveyAssistantRequestContext, t as SURVEY_ASSISTANT_AGENT_ID } from "./constants-HL_klgJl.mjs";
3
+ import { n as surveyAssistantTools } from "./index-CeUlGkoU.mjs";
5
4
  import { Agent, AgentConfig } from "@mastra/core/agent";
6
5
  import { Memory } from "@mastra/memory";
7
- import * as _$_mastra_core_tools0 from "@mastra/core/tools";
8
6
  import { InputProcessor } from "@mastra/core/processors";
9
-
10
7
  //#region src/server/agent.d.ts
11
- declare const surveyAssistantThreadAttachmentProcessor: InputProcessor;
8
+ export declare const surveyAssistantThreadAttachmentProcessor: InputProcessor;
12
9
  type SurveyAssistantAgentConfig = AgentConfig<typeof SURVEY_ASSISTANT_AGENT_ID, typeof surveyAssistantTools, undefined, SurveyAssistantRequestContext>;
13
10
  type SurveyAssistantMemoryOptions = NonNullable<NonNullable<ConstructorParameters<typeof Memory>[0]>["options"]>;
14
- type SurveyAssistantObservationalMemoryOptions = Exclude<SurveyAssistantMemoryOptions["observationalMemory"], boolean | undefined>;
11
+ export type SurveyAssistantObservationalMemoryOptions = Exclude<SurveyAssistantMemoryOptions["observationalMemory"], boolean | undefined>;
15
12
  type SurveyAssistantObservationalMemoryOptionsInput = Partial<Omit<SurveyAssistantObservationalMemoryOptions, "model">> & {
16
13
  model: NonNullable<SurveyAssistantObservationalMemoryOptions["model"]>;
17
14
  };
18
- declare const SURVEY_ASSISTANT_OBSERVATIONAL_MEMORY_DEFAULTS: {
15
+ export declare const SURVEY_ASSISTANT_OBSERVATIONAL_MEMORY_DEFAULTS: {
19
16
  readonly messageTokens: 48000;
20
17
  readonly observationTokens: 80000;
21
18
  readonly previousObserverTokens: 24000;
22
19
  };
23
- declare const createSurveyAssistantObservationalMemoryOptions: ({
24
- model,
25
- observation,
26
- reflection,
27
- ...overrides
28
- }: SurveyAssistantObservationalMemoryOptionsInput) => SurveyAssistantObservationalMemoryOptions;
29
- interface CreateSurveyAssistantAgentOptions {
20
+ export declare const createSurveyAssistantObservationalMemoryOptions: ({ model, observation, reflection, ...overrides }: SurveyAssistantObservationalMemoryOptionsInput) => SurveyAssistantObservationalMemoryOptions;
21
+ export interface CreateSurveyAssistantAgentOptions {
30
22
  model: SurveyAssistantAgentConfig["model"];
31
23
  memory?: SurveyAssistantAgentConfig["memory"];
32
24
  observationalMemory?: SurveyAssistantObservationalMemoryOptions | false;
33
25
  }
34
- declare const createSurveyAssistantAgent: ({
35
- memory,
36
- model,
37
- observationalMemory
38
- }: CreateSurveyAssistantAgentOptions) => Agent<"survey-assistant-agent", Readonly<{
39
- survey_inspect: _$_mastra_core_tools0.Tool<{
40
- action: "current-context" | "search-items" | "item-details" | "localization" | "assets" | "expression-diagnostics" | "raw-json";
26
+ export declare const createSurveyAssistantAgent: ({ memory, model, observationalMemory }: CreateSurveyAssistantAgentOptions) => Agent<"survey-assistant-agent", Readonly<{
27
+ survey_inspect: import("@mastra/core/tools").Tool<{
28
+ action: "localization" | "current-context" | "search-items" | "item-details" | "assets" | "expression-diagnostics" | "raw-json";
41
29
  reason?: string | undefined;
42
30
  scopes?: ("summary" | "selected-item" | "outline" | "response-slots" | "ui-context" | "history")[] | undefined;
43
31
  query?: string | undefined;
32
+ itemTypes?: ("content" | "group" | "page-break")[] | undefined;
33
+ elementTypes?: string[] | undefined;
34
+ locales?: string[] | undefined;
44
35
  sourceLocale?: string | undefined;
45
36
  targetLocale?: string | undefined;
37
+ localizationRefs?: ({
38
+ scope: "content";
39
+ ownerId: string;
40
+ role: string;
41
+ } | {
42
+ scope: "survey";
43
+ surface: "surveyCardContent" | "navigationContent" | "validationMessages";
44
+ contentKey: string;
45
+ })[] | undefined;
46
46
  missingOnly?: boolean | undefined;
47
47
  itemRef?: string | undefined;
48
48
  cursor?: string | undefined;
@@ -54,19 +54,19 @@ declare const createSurveyAssistantAgent: ({
54
54
  limit?: number | undefined;
55
55
  }, {
56
56
  ok: boolean;
57
- action: "current-context" | "search-items" | "item-details" | "localization" | "assets" | "expression-diagnostics" | "raw-json";
57
+ action: "localization" | "current-context" | "search-items" | "item-details" | "assets" | "expression-diagnostics" | "raw-json";
58
58
  modelSummary: string;
59
59
  reason?: string | undefined;
60
60
  result?: unknown;
61
- }, unknown, unknown, _$_mastra_core_tools0.ToolExecutionContext<unknown, unknown, unknown>, "survey_inspect", unknown>;
62
- survey_change: _$_mastra_core_tools0.Tool<{
61
+ }, unknown, unknown, import("@mastra/core/tools").ToolExecutionContext<unknown, unknown, unknown>, "survey_inspect", unknown>;
62
+ survey_change: import("@mastra/core/tools").Tool<{
63
63
  summary: string;
64
64
  operations: unknown[];
65
65
  retryOfChangeIds?: string[] | undefined;
66
- }, SurveyChangeSetShape, unknown, unknown, _$_mastra_core_tools0.ToolExecutionContext<unknown, unknown, unknown>, "survey_change", unknown>;
67
- survey_authoring_reference: _$_mastra_core_tools0.Tool<{
66
+ }, SurveyChangeSetShape, unknown, unknown, import("@mastra/core/tools").ToolExecutionContext<unknown, unknown, unknown>, "survey_change", unknown>;
67
+ survey_authoring_reference: import("@mastra/core/tools").Tool<{
68
68
  topic: string;
69
- itemType?: string | undefined;
69
+ elementType?: string | undefined;
70
70
  operationKind?: string | undefined;
71
71
  detail?: "full" | "compact" | undefined;
72
72
  reason?: string | undefined;
@@ -75,11 +75,11 @@ declare const createSurveyAssistantAgent: ({
75
75
  topic: string;
76
76
  title: string;
77
77
  content: string;
78
- itemType?: string | undefined;
78
+ elementType?: string | undefined;
79
79
  operationKind?: string | undefined;
80
80
  detail?: "full" | "compact" | undefined;
81
- }, unknown, unknown, _$_mastra_core_tools0.ToolExecutionContext<unknown, unknown, unknown>, "survey_authoring_reference", unknown>;
82
- survey_expression: _$_mastra_core_tools0.Tool<{
81
+ }, unknown, unknown, import("@mastra/core/tools").ToolExecutionContext<unknown, unknown, unknown>, "survey_authoring_reference", unknown>;
82
+ survey_expression: import("@mastra/core/tools").Tool<{
83
83
  action: "context" | "prepare";
84
84
  retryOfChangeIds?: string[] | undefined;
85
85
  reason?: string | undefined;
@@ -95,23 +95,37 @@ declare const createSurveyAssistantAgent: ({
95
95
  modelSummary: string;
96
96
  listOrdering: Record<string, string>;
97
97
  responseSlots: {
98
- ref: string;
98
+ ref: {
99
+ slotId: string;
100
+ method: "get" | "isDefined";
101
+ };
99
102
  valueType?: string | undefined;
103
+ variableName?: string | undefined;
104
+ itemId?: string | undefined;
100
105
  }[];
101
106
  nextCursor?: string | undefined;
102
107
  totalResponseSlots?: number | undefined;
103
108
  surveyResponseSlotCount?: number | undefined;
104
109
  totalExpressionLocations?: number | undefined;
110
+ totalStateTargets?: number | undefined;
111
+ stateTargets?: {
112
+ targetRef: {
113
+ ownerId: string;
114
+ };
115
+ state: "disabled";
116
+ itemId: string;
117
+ kind: string;
118
+ }[] | undefined;
105
119
  unresolvedItemIds?: string[] | undefined;
106
120
  expressionLocations?: {
107
121
  itemId: string;
108
- key: string;
122
+ editorName: string;
109
123
  itemType: string;
110
124
  rawIndex: number;
111
125
  locations: string[];
112
126
  }[] | undefined;
113
- }, unknown, unknown, _$_mastra_core_tools0.ToolExecutionContext<unknown, unknown, unknown>, "survey_expression", unknown>;
114
- survey_attachment: _$_mastra_core_tools0.Tool<{
127
+ }, unknown, unknown, import("@mastra/core/tools").ToolExecutionContext<unknown, unknown, unknown>, "survey_expression", unknown>;
128
+ survey_attachment: import("@mastra/core/tools").Tool<{
115
129
  documentIds?: string[] | undefined;
116
130
  documentRequests?: {
117
131
  documentId: string;
@@ -132,9 +146,15 @@ declare const createSurveyAssistantAgent: ({
132
146
  } | undefined;
133
147
  focus?: string | undefined;
134
148
  }[];
149
+ unavailable?: {
150
+ id: string;
151
+ reason: "not-listed" | "content-unavailable" | "attachment-limit";
152
+ filename?: string | undefined;
153
+ mediaType?: string | undefined;
154
+ }[] | undefined;
135
155
  warnings?: string[] | undefined;
136
- }, unknown, unknown, _$_mastra_core_tools0.ToolExecutionContext<unknown, unknown, unknown>, "survey_attachment", unknown>;
137
- survey_audit: _$_mastra_core_tools0.Tool<{
156
+ }, unknown, unknown, import("@mastra/core/tools").ToolExecutionContext<unknown, unknown, unknown>, "survey_attachment", unknown>;
157
+ survey_audit: import("@mastra/core/tools").Tool<{
138
158
  sourceLocale?: string | undefined;
139
159
  targetLocales?: string[] | undefined;
140
160
  maxFindings?: number | undefined;
@@ -145,8 +165,8 @@ declare const createSurveyAssistantAgent: ({
145
165
  ok: boolean;
146
166
  reason?: string | undefined;
147
167
  report?: unknown;
148
- }, unknown, unknown, _$_mastra_core_tools0.ToolExecutionContext<unknown, unknown, unknown>, "survey_audit", unknown>;
149
- survey_asset: _$_mastra_core_tools0.Tool<{
168
+ }, unknown, unknown, import("@mastra/core/tools").ToolExecutionContext<unknown, unknown, unknown>, "survey_audit", unknown>;
169
+ survey_asset: import("@mastra/core/tools").Tool<{
150
170
  action: "import-attachment" | "update-metadata" | "remove";
151
171
  summary: string;
152
172
  retryOfChangeIds?: string[] | undefined;
@@ -155,8 +175,7 @@ declare const createSurveyAssistantAgent: ({
155
175
  name?: string | null | undefined;
156
176
  filename?: string | null | undefined;
157
177
  alt?: string | null | undefined;
158
- }, SurveyChangeSetShape, unknown, unknown, _$_mastra_core_tools0.ToolExecutionContext<unknown, unknown, unknown>, "survey_asset", unknown>;
159
- }>, undefined, SurveyAssistantRequestContext, _$_mastra_core_agent0.AgentEditorConfig | undefined>;
178
+ }, SurveyChangeSetShape, unknown, unknown, import("@mastra/core/tools").ToolExecutionContext<unknown, unknown, unknown>, "survey_asset", unknown>;
179
+ }>, undefined, SurveyAssistantRequestContext, import("@mastra/core/agent").AgentEditorConfig | undefined>;
160
180
  //#endregion
161
- export { CreateSurveyAssistantAgentOptions, SURVEY_ASSISTANT_OBSERVATIONAL_MEMORY_DEFAULTS, SurveyAssistantObservationalMemoryOptions, createSurveyAssistantAgent, createSurveyAssistantObservationalMemoryOptions, surveyAssistantThreadAttachmentProcessor };
162
181
  //# sourceMappingURL=server-agent.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"server-agent.d.mts","names":[],"sources":["../src/server/agent.ts"],"mappings":";;;;;;;;;;cAyBa,wCAAA,EAA0C,cAAA;AAAA,KA0SlD,0BAAA,GAA6B,WAAA,QACzB,yBAAA,SACA,oBAAA,aAEP,6BAAA;AAAA,KAGG,4BAAA,GAA+B,WAAA,CAClC,WAAA,CAAY,qBAAA,QAA6B,MAAA;AAAA,KA8E/B,yCAAA,GAA4C,OAAA,CACtD,4BAAA;AAAA,KAIG,8CAAA,GAAiD,OAAA,CACpD,IAAA,CAAK,yCAAA;EAEL,KAAA,EAAO,WAAA,CAAY,yCAAA;AAAA;AAAA,cAGR,8CAAA;EAAA;;;;cAMA,+CAAA;EAAmD,KAAA;EAAA,WAAA;EAAA,UAAA;EAAA,GAAA;AAAA,GAK7D,8CAAA,KAAiD,yCAAA;AAAA,UAkCnC,iCAAA;EACf,KAAA,EAAO,0BAAA;EACP,MAAA,GAAS,0BAAA;EACT,mBAAA,GAAsB,yCAAA;AAAA;AAAA,cAGX,0BAAA;EAA8B,MAAA;EAAA,KAAA;EAAA;AAAA,GAIxC,iCAAA,KAAiC,KAAA,2BAAA,QAAA;;;;;;;;;;;;;;;;;;;;;;;uBAAA,qBAAA,CAAA,oBAAA"}
1
+ {"version":3,"file":"server-agent.d.mts","names":[],"sources":["../src/server/agent.ts"],"mappings":";;;;;;;qBAyBa,0CAA0C;KA8VlD,6BAA6B,mBACzB,kCACA,iCAEP;KAGG,+BAA+B,YAClC,YAAY,6BAA6B;YA8E/B,4CAA4C,QACtD;KAIG,iDAAiD,QACpD,KAAK;EAEL,OAAO,YAAY;;qBAGR;;;;;qBAMA,oDAAmD,OAAA,aAAA,eAAA,aAK7D,mDAAiD;iBAkCnC;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