@case-framework/survey-assistant 0.6.0 → 0.7.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 (94) hide show
  1. package/README.md +9 -4
  2. package/dist/{authoring-references-CW38pYzK.mjs → authoring-references-BJQ_1nMX.mjs} +2 -2
  3. package/dist/authoring-references-BJQ_1nMX.mjs.map +1 -0
  4. package/dist/capabilities-1KNnNO1_.mjs +73 -0
  5. package/dist/capabilities-1KNnNO1_.mjs.map +1 -0
  6. package/dist/capabilities-default.d.mts +1 -1
  7. package/dist/capabilities-default.d.mts.map +1 -1
  8. package/dist/capabilities-default.mjs +22 -25
  9. package/dist/capabilities-default.mjs.map +1 -1
  10. package/dist/{constants-BMGTgfjv.d.mts → constants-Be91Gay9.d.mts} +3 -3
  11. package/dist/{constants-BMGTgfjv.d.mts.map → constants-Be91Gay9.d.mts.map} +1 -1
  12. package/dist/{controller-proxy-DMTqer6T.mjs → controller-proxy-BH05e-C2.mjs} +21 -8
  13. package/dist/controller-proxy-BH05e-C2.mjs.map +1 -0
  14. package/dist/{controller-proxy-mRvez2qw.d.mts → controller-proxy-Bd0ZHBPF.d.mts} +11 -11
  15. package/dist/controller-proxy-Bd0ZHBPF.d.mts.map +1 -0
  16. package/dist/{engine-CQwOAcwK.mjs → engine-Bo85Oyj0.mjs} +2985 -2347
  17. package/dist/engine-Bo85Oyj0.mjs.map +1 -0
  18. package/dist/engine.d.mts +2 -2
  19. package/dist/engine.mjs +3 -3
  20. package/dist/{index-D6nqkz0O.d.mts → index-Tnqv-yKW.d.mts} +56 -71
  21. package/dist/index-Tnqv-yKW.d.mts.map +1 -0
  22. package/dist/index-l_EK4yK7.d.mts +404 -0
  23. package/dist/index-l_EK4yK7.d.mts.map +1 -0
  24. package/dist/{index-DvTqML-0.d.mts → index-nhrgbgO5.d.mts} +19 -5
  25. package/dist/index-nhrgbgO5.d.mts.map +1 -0
  26. package/dist/{index-B0lxsAzx.d.mts → index-x0qprHgK.d.mts} +19 -7
  27. package/dist/index-x0qprHgK.d.mts.map +1 -0
  28. package/dist/{lifecycle-BmGAIUlv.d.mts → lifecycle-Bx0aq_4S.d.mts} +7 -1
  29. package/dist/{lifecycle-BmGAIUlv.d.mts.map → lifecycle-Bx0aq_4S.d.mts.map} +1 -1
  30. package/dist/{memory-thread-repository-CjFGVNZh.mjs → memory-thread-repository-KWHQWFEW.mjs} +43 -12
  31. package/dist/memory-thread-repository-KWHQWFEW.mjs.map +1 -0
  32. package/dist/{protocol-DJUP4gc0.mjs → protocol-BhzQbx81.mjs} +66 -16
  33. package/dist/protocol-BhzQbx81.mjs.map +1 -0
  34. package/dist/protocol.d.mts +3 -3
  35. package/dist/protocol.mjs +2 -2
  36. package/dist/react-B3ybjJ-X.mjs +1620 -0
  37. package/dist/react-B3ybjJ-X.mjs.map +1 -0
  38. package/dist/react-integration.d.mts +1 -1
  39. package/dist/react-integration.mjs +1 -1
  40. package/dist/react.d.mts +3 -3
  41. package/dist/react.mjs +3 -3
  42. package/dist/references/assistant-operations.md +45 -39
  43. package/dist/references/expressions.md +28 -0
  44. package/dist/references/item-types.md +1 -1
  45. package/dist/references/localization.md +5 -4
  46. package/dist/references/rich-text-content.md +60 -27
  47. package/dist/references/source-material-surveys.md +9 -2
  48. package/dist/references/survey-data-model.md +9 -1
  49. package/dist/{request-context-BjTHNcDd.mjs → request-context-CG4SWijt.mjs} +3 -3
  50. package/dist/{request-context-BjTHNcDd.mjs.map → request-context-CG4SWijt.mjs.map} +1 -1
  51. package/dist/server-agent.d.mts +19 -8
  52. package/dist/server-agent.d.mts.map +1 -1
  53. package/dist/server-agent.mjs +7 -11
  54. package/dist/server-agent.mjs.map +1 -1
  55. package/dist/server-runtime.d.mts +19 -13
  56. package/dist/server-runtime.d.mts.map +1 -1
  57. package/dist/server-runtime.mjs +7 -2
  58. package/dist/server-runtime.mjs.map +1 -1
  59. package/dist/server-tasks.d.mts +1 -1
  60. package/dist/server-tasks.mjs +2 -2
  61. package/dist/server-tools.d.mts +1 -1
  62. package/dist/server-tools.mjs +1 -1
  63. package/dist/server.d.mts +5 -5
  64. package/dist/server.mjs +3 -3
  65. package/dist/{tasks-DxzD25Zc.d.mts → tasks-CYqrcaRO.d.mts} +4 -4
  66. package/dist/{tasks-DxzD25Zc.d.mts.map → tasks-CYqrcaRO.d.mts.map} +1 -1
  67. package/dist/{thread-handlers-AbQbt4sX.d.mts → thread-handlers-DBAaU7BA.d.mts} +6 -4
  68. package/dist/thread-handlers-DBAaU7BA.d.mts.map +1 -0
  69. package/dist/{tools-CFh35R4d.mjs → tools-BvSovehT.mjs} +431 -495
  70. package/dist/tools-BvSovehT.mjs.map +1 -0
  71. package/dist/ui.css +1 -1
  72. package/dist/ui.d.mts +5 -4
  73. package/dist/ui.d.mts.map +1 -1
  74. package/dist/ui.mjs +619 -66
  75. package/dist/ui.mjs.map +1 -1
  76. package/docs/integration.md +40 -0
  77. package/package.json +21 -19
  78. package/dist/authoring-references-CW38pYzK.mjs.map +0 -1
  79. package/dist/controller-proxy-DMTqer6T.mjs.map +0 -1
  80. package/dist/controller-proxy-mRvez2qw.d.mts.map +0 -1
  81. package/dist/engine-CQwOAcwK.mjs.map +0 -1
  82. package/dist/form-authoring-kQDgC5oz.mjs +0 -155
  83. package/dist/form-authoring-kQDgC5oz.mjs.map +0 -1
  84. package/dist/index-B0lxsAzx.d.mts.map +0 -1
  85. package/dist/index-BS-Xjk1h.d.mts +0 -224
  86. package/dist/index-BS-Xjk1h.d.mts.map +0 -1
  87. package/dist/index-D6nqkz0O.d.mts.map +0 -1
  88. package/dist/index-DvTqML-0.d.mts.map +0 -1
  89. package/dist/memory-thread-repository-CjFGVNZh.mjs.map +0 -1
  90. package/dist/protocol-DJUP4gc0.mjs.map +0 -1
  91. package/dist/react-Dqlmasrs.mjs +0 -768
  92. package/dist/react-Dqlmasrs.mjs.map +0 -1
  93. package/dist/thread-handlers-AbQbt4sX.d.mts.map +0 -1
  94. package/dist/tools-CFh35R4d.mjs.map +0 -1
@@ -73,6 +73,8 @@ roles locally:
73
73
  ```yaml
74
74
  version: 1
75
75
  activeProvider: openai
76
+ supportBundle:
77
+ enabled: true
76
78
  providers:
77
79
  openai:
78
80
  type: openai
@@ -122,6 +124,13 @@ Only the active provider's secret is required. `SURVEY_ASSISTANT_ENABLED` is an
122
124
  optional operational override; provider, model, role, memory, request-limit, and
123
125
  execution policy remains document-owned.
124
126
 
127
+ Support-bundle export is enabled by default. Set `supportBundle.enabled: false`
128
+ in the configuration document to remove the built-in panel actions and reject
129
+ package preparation or generation calls that receive the disabled config.
130
+ `SURVEY_ASSISTANT_SUPPORT_BUNDLE_ENABLED` is an optional strict boolean
131
+ operational override. Both values are resolved by the package configuration
132
+ parser.
133
+
125
134
  #### Optional experimental-identity rollout gate
126
135
 
127
136
  Importing hosts can pass `requireExperimentalIdentityOptIn: true` as a third
@@ -288,9 +297,26 @@ const assistant = useSurveyEditorAssistantIntegration({
288
297
  applyPolicy="auto"
289
298
  controller={assistant.controller}
290
299
  onSettleApply={persistAndAuditAssistantApply}
300
+ supportBundle={{
301
+ enabled: supportBundleEnabled,
302
+ hostBuildVersion: deploymentRelease,
303
+ supportEmail: "survey-support@example.org",
304
+ }}
291
305
  />;
292
306
  ```
293
307
 
308
+ Resolve `config.supportBundle.enabled` in server-only host code and pass that
309
+ boolean through the server-to-client boundary as `supportBundleEnabled`. Do not
310
+ send the complete runtime config to the browser because it contains
311
+ server-only provider credentials.
312
+
313
+ The assistant controller requires `getSnapshot()` and
314
+ `applyAssistantChanges(changes)`. The session passes all authorized change sets
315
+ in one call, including a one-element array for a single change set. Return one
316
+ result per change set with its original ID, including any failed changes; the
317
+ session settles only when every result is applied. The shared Survey Editor
318
+ provides this adapter through its normal mutation and undo/redo path.
319
+
294
320
  `applyPolicy` is required because immediate apply, review, and denial are
295
321
  material host decisions. For a real editing host, `onSettleApply` should save
296
322
  the already-applied editor state and durable audit receipts. The session remains
@@ -306,6 +332,20 @@ silently discarding a requested approval. Use `"deny"` for read-only
306
332
  deployments. These policies do not remove inspection, chat, tasks, or
307
333
  attachments.
308
334
 
335
+ Support bundles include the Survey Assistant package version automatically. Set
336
+ `supportBundle.hostBuildVersion` to the host's release tag or commit so a
337
+ customer export identifies the deployed application code as well. The optional
338
+ `supportEmail` enables the post-download email draft; it does not upload or
339
+ attach the bundle automatically. Do not expose credentials or other secrets in
340
+ these values.
341
+
342
+ When `supportBundle.enabled` is false, the package removes both the history
343
+ action and the error-state export action. Its preparation and generation APIs
344
+ also reject when passed the same disabled config. A custom export integration
345
+ must pass the resolved config to those APIs; the setting is not a browser
346
+ security boundary against arbitrary host-authored code. The size estimator
347
+ returns `0` and the mailto helper returns `undefined` for a disabled config.
348
+
309
349
  The client carries the latest unsuccessful post-generation outcome into the
310
350
  next request. This lets the model distinguish a server-validated draft from a
311
351
  change that was later rejected by the editor, declined during review, or left
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@case-framework/survey-assistant",
3
- "version": "0.6.0",
3
+ "version": "0.7.0",
4
4
  "description": "Shared protocol, engine, and runtime for the CASE survey assistant.",
5
5
  "license": "ISC",
6
6
  "files": [
@@ -85,9 +85,12 @@
85
85
  "./package.json": "./package.json"
86
86
  },
87
87
  "dependencies": {
88
+ "@case-framework/survey-items": "0.1.0",
89
+ "@case-framework/ui-localization": "0.2.1",
88
90
  "@radix-ui/react-use-controllable-state": "^1.2.3",
89
91
  "class-variance-authority": "^0.7.1",
90
92
  "clsx": "^2.1.1",
93
+ "fflate": "^0.8.3",
91
94
  "lucide-react": "^1.11.0",
92
95
  "motion": "^12.42.2",
93
96
  "radix-ui": "^1.6.7",
@@ -96,22 +99,22 @@
96
99
  "tailwind-merge": "^3.5.0",
97
100
  "tw-animate-css": "^1.4.0",
98
101
  "use-stick-to-bottom": "^1.1.6",
99
- "zod": "^4.4.3",
100
- "@case-framework/ui-localization": "0.2.1"
102
+ "zod": "^4.4.3"
101
103
  },
102
104
  "devDependencies": {
103
- "@ai-sdk/react": "^4.0.55",
105
+ "@ai-sdk/react": "^4.0.81",
106
+ "@case-framework/survey-core": "0.7.0",
104
107
  "@jest/globals": "30.3.0",
105
- "@mastra/ai-sdk": "^1.7.1",
106
- "@mastra/core": "^1.56.0",
107
- "@mastra/memory": "^1.25.0",
108
- "@mastra/pg": "^1.19.0",
108
+ "@mastra/ai-sdk": "^1.9.1",
109
+ "@mastra/core": "^1.61.0",
110
+ "@mastra/memory": "^1.27.0",
111
+ "@mastra/pg": "^1.21.1",
109
112
  "@tailwindcss/vite": "^4.3.2",
110
113
  "@types/jest": "^30.0.0",
111
114
  "@types/node": "^25.6.0",
112
115
  "@types/react": "^19.2.18",
113
116
  "@types/react-test-renderer": "19.1.0",
114
- "ai": "^7.0.52",
117
+ "ai": "^7.0.78",
115
118
  "jest": "^30.3.0",
116
119
  "react": "~19.2.8",
117
120
  "react-dom": "~19.2.8",
@@ -119,19 +122,18 @@
119
122
  "ts-jest": "^29.4.9",
120
123
  "tsdown": "^0.21.10",
121
124
  "typescript": "^6.0.3",
122
- "vite": "^8.0.10",
123
- "@case-framework/survey-core": "0.6.2"
125
+ "vite": "^8.0.10"
124
126
  },
125
127
  "peerDependencies": {
126
- "@ai-sdk/react": "^4.0.55",
127
- "@mastra/ai-sdk": "^1.7.1",
128
- "@mastra/core": "^1.56.0",
129
- "@mastra/memory": "^1.25.0",
130
- "@mastra/pg": "^1.19.0",
131
- "ai": "^7.0.52",
128
+ "@ai-sdk/react": "^4.0.81",
129
+ "@case-framework/survey-core": "^0.7.0",
130
+ "@mastra/ai-sdk": "^1.9.1",
131
+ "@mastra/core": "^1.61.0",
132
+ "@mastra/memory": "^1.27.0",
133
+ "@mastra/pg": "^1.21.1",
134
+ "ai": "^7.0.78",
132
135
  "react": ">=19.2.0",
133
- "react-dom": ">=19.2.0",
134
- "@case-framework/survey-core": "^0.6.2"
136
+ "react-dom": ">=19.2.0"
135
137
  },
136
138
  "peerDependenciesMeta": {
137
139
  "@mastra/ai-sdk": {
@@ -1 +0,0 @@
1
- {"version":3,"file":"authoring-references-CW38pYzK.mjs","names":[],"sources":["../../../node_modules/.pnpm/tsdown@0.21.10_synckit@0.11.13_typescript@6.0.3/node_modules/tsdown/esm-shims.js","../src/server/authoring-references.ts"],"sourcesContent":["// Shim globals in esm bundle\nimport path from 'node:path'\nimport { fileURLToPath } from 'node:url'\n\nconst getFilename = () => fileURLToPath(import.meta.url)\nconst getDirname = () => path.dirname(getFilename())\n\nexport const __dirname = /* @__PURE__ */ getDirname()\nexport const __filename = /* @__PURE__ */ getFilename()\n","import { readFileSync } from \"node:fs\";\nimport { resolve } from \"node:path\";\n\nconst loadReference = (fileName: string) =>\n readFileSync(resolve(__dirname, \"references\", fileName), \"utf8\").trim();\n\nexport const surveyAuthoringReferenceTopics = [\n \"core-rules\",\n \"survey-data-model\",\n \"source-material-surveys\",\n \"localization\",\n \"rich-text-content\",\n \"item-types\",\n \"embedded-forms\",\n \"expressions\",\n \"assistant-operations\",\n \"fair-by-design\",\n \"survey-quality\",\n] as const;\n\nexport type SurveyAuthoringReferenceTopic = (typeof surveyAuthoringReferenceTopics)[number];\n\ntype SurveyAuthoringReferenceEntry = {\n title: string;\n content: string;\n loadWhen: string;\n};\n\nconst ITEM_TYPE_SECTION_HEADINGS: Readonly<Record<string, string>> = {\n group: \"group\",\n \"page-break\": \"page-break\",\n infoItem: \"infoItem\",\n choiceItem: \"choiceItem\",\n formItem: \"formItem\",\n};\n\nexport const builtInSurveyAuthoringItemTypes = Object.freeze(\n Object.keys(ITEM_TYPE_SECTION_HEADINGS),\n);\n\nconst extractLevelTwoSection = (markdown: string, heading: string): string | undefined => {\n const lines = markdown.split(\"\\n\");\n const sectionStart = lines.findIndex((line) => line.trim() === `## ${heading}`);\n if (sectionStart < 0) {\n return undefined;\n }\n\n const nextSectionOffset = lines\n .slice(sectionStart + 1)\n .findIndex((line) => line.startsWith(\"## \"));\n const sectionEnd = nextSectionOffset < 0 ? lines.length : sectionStart + 1 + nextSectionOffset;\n\n return lines.slice(sectionStart, sectionEnd).join(\"\\n\").trim();\n};\n\nexport const surveyAuthoringReferences = {\n \"core-rules\": {\n title: \"Core authoring rules\",\n content: loadReference(\"core-rules.md\"),\n loadWhen:\n \"Load when the task depends on canonical tool choice, validation/apply semantics, identifier handling, or another cross-cutting authoring rule that the current turn has not already established.\",\n },\n \"survey-data-model\": {\n title: \"Survey data model\",\n content: loadReference(\"survey-data-model.md\"),\n loadWhen:\n \"Load before reasoning about raw survey storage, hierarchy, ids, translation maps, assets, template values, or any direct survey-json-patch path whose exact location has not already been inspected and documented in the current turn.\",\n },\n \"source-material-surveys\": {\n title: \"Source-material survey implementation\",\n content: loadReference(\"source-material-surveys.md\"),\n loadWhen:\n \"Load before implementing or adapting a questionnaire, document, image, or other supplied source material so completeness, respondent-input mapping, language, and digital adaptation rules are available before the first mutation.\",\n },\n localization: {\n title: \"Survey localization\",\n content: loadReference(\"localization.md\"),\n loadWhen:\n \"Load before adding, removing, translating, or assessing a survey locale, including requests for localization completeness or locale lifecycle changes.\",\n },\n \"rich-text-content\": {\n title: \"Rich text content\",\n content: loadReference(\"rich-text-content.md\"),\n loadWhen:\n \"Load before authoring or changing meaningful formatting, links, images, headings, lists, info boxes, separators, footnotes, or existing structured rich-text content; do not load it for ordinary unformatted plain text.\",\n },\n \"item-types\": {\n title: \"Item types\",\n content: loadReference(\"item-types.md\"),\n loadWhen:\n \"Load with itemType before creating or changing an item when its configuration, response behavior, or content surfaces are not already fully specified by the current capability and focused operation contract; omit itemType only for a genuine cross-type comparison.\",\n },\n \"embedded-forms\": {\n title: \"Choice option embedded forms\",\n content: loadReference(\"embedded-forms.md\"),\n loadWhen:\n 'Load before creating or changing a choice-option follow-up or embedded form, including \"Other, specify\", option-specific inputs, embedded field groups, or embedded-form layout and translations.',\n },\n expressions: {\n title: \"Expressions\",\n content: loadReference(\"expressions.md\"),\n loadWhen:\n \"Load before the first survey_expression prepare call for expression, condition, validation-expression, prefill, or template-value work unless the exact relevant JsonExpression and mutation shapes were already supplied by a current-turn authoring reference. survey_expression context supplies currently available runtime references and value types, but it does not replace the grammar reference. Expressions are not assumed to be survey-response-only; use the references and variable sources supported by the current runtime and reference.\",\n },\n \"assistant-operations\": {\n title: \"Assistant operations\",\n content: loadReference(\"assistant-operations.md\"),\n loadWhen:\n \"Load with operationKind before the first survey_change call when the exact canonical fields of that operation are not already present in the current turn; add itemType when item-specific configuration or capability guidance is needed. Prefer compact detail and use full only for protocol debugging.\",\n },\n \"fair-by-design\": {\n title: \"FAIR-by-design survey authoring\",\n content: loadReference(\"fair-by-design.md\"),\n loadWhen:\n \"Load before advising or editing when FAIR, interoperability, harmonization, cross-study reuse, stable coding, value sets, missingness semantics, metadata, provenance, versioning, standard instruments, controlled vocabularies, or machine-readable export is material; do not impose it on ordinary authoring.\",\n },\n \"survey-quality\": {\n title: \"Survey quality review\",\n content: loadReference(\"survey-quality.md\"),\n loadWhen:\n \"Load before a substantive questionnaire-quality critique, wording or flow review, respondent-burden assessment, or recommendations about measurement quality; it is not required for a purely technical defect check.\",\n },\n} as const satisfies Record<SurveyAuthoringReferenceTopic, SurveyAuthoringReferenceEntry>;\n\nexport const formatSurveyAuthoringReferenceRoutingInstructions = (): string =>\n [\n \"Authoring-reference routing rules:\",\n \"Load a relevant focused reference before the first affected mutation or substantive advice, not after guessing a payload or learning through validator failures. Do not reload a reference when its exact relevant contract is already present in the current turn. References define stable authoring conventions and payload grammar; current survey state and currently available runtime references still come from inspection and context tools.\",\n \"For installed capability-specific references, use the capability manifest's advertised reference topics. Load a relevant topic with itemType before changing unfamiliar capability configuration or behavior.\",\n ...surveyAuthoringReferenceTopics.map(\n (topic) => `- ${topic}: ${surveyAuthoringReferences[topic].loadWhen}`,\n ),\n ].join(\"\\n\");\n\nexport const getBuiltInItemTypeAuthoringReference = (\n itemType: string,\n): { title: string; content: string } | undefined => {\n const heading = ITEM_TYPE_SECTION_HEADINGS[itemType];\n if (!heading) {\n return undefined;\n }\n\n const content = extractLevelTwoSection(surveyAuthoringReferences[\"item-types\"].content, heading);\n return content ? { title: `${heading} item type`, content } : undefined;\n};\n"],"x_google_ignoreList":[0],"mappings":";;;;AAIA,MAAM,oBAAoB,cAAc,OAAO,KAAK,IAAI;AACxD,MAAM,mBAAmB,KAAK,QAAQ,aAAa,CAAC;AAEpD,MAAa,YAA4B,4BAAY;;;ACJrD,MAAM,iBAAiB,aACrB,aAAa,QAAQ,WAAW,cAAc,SAAS,EAAE,OAAO,CAAC,MAAM;AAEzE,MAAa,iCAAiC;CAC5C;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACD;AAUD,MAAM,6BAA+D;CACnE,OAAO;CACP,cAAc;CACd,UAAU;CACV,YAAY;CACZ,UAAU;CACX;AAED,MAAa,kCAAkC,OAAO,OACpD,OAAO,KAAK,2BAA2B,CACxC;AAED,MAAM,0BAA0B,UAAkB,YAAwC;CACxF,MAAM,QAAQ,SAAS,MAAM,KAAK;CAClC,MAAM,eAAe,MAAM,WAAW,SAAS,KAAK,MAAM,KAAK,MAAM,UAAU;AAC/E,KAAI,eAAe,EACjB;CAGF,MAAM,oBAAoB,MACvB,MAAM,eAAe,EAAE,CACvB,WAAW,SAAS,KAAK,WAAW,MAAM,CAAC;CAC9C,MAAM,aAAa,oBAAoB,IAAI,MAAM,SAAS,eAAe,IAAI;AAE7E,QAAO,MAAM,MAAM,cAAc,WAAW,CAAC,KAAK,KAAK,CAAC,MAAM;;AAGhE,MAAa,4BAA4B;CACvC,cAAc;EACZ,OAAO;EACP,SAAS,cAAc,gBAAgB;EACvC,UACE;EACH;CACD,qBAAqB;EACnB,OAAO;EACP,SAAS,cAAc,uBAAuB;EAC9C,UACE;EACH;CACD,2BAA2B;EACzB,OAAO;EACP,SAAS,cAAc,6BAA6B;EACpD,UACE;EACH;CACD,cAAc;EACZ,OAAO;EACP,SAAS,cAAc,kBAAkB;EACzC,UACE;EACH;CACD,qBAAqB;EACnB,OAAO;EACP,SAAS,cAAc,uBAAuB;EAC9C,UACE;EACH;CACD,cAAc;EACZ,OAAO;EACP,SAAS,cAAc,gBAAgB;EACvC,UACE;EACH;CACD,kBAAkB;EAChB,OAAO;EACP,SAAS,cAAc,oBAAoB;EAC3C,UACE;EACH;CACD,aAAa;EACX,OAAO;EACP,SAAS,cAAc,iBAAiB;EACxC,UACE;EACH;CACD,wBAAwB;EACtB,OAAO;EACP,SAAS,cAAc,0BAA0B;EACjD,UACE;EACH;CACD,kBAAkB;EAChB,OAAO;EACP,SAAS,cAAc,oBAAoB;EAC3C,UACE;EACH;CACD,kBAAkB;EAChB,OAAO;EACP,SAAS,cAAc,oBAAoB;EAC3C,UACE;EACH;CACF;AAED,MAAa,0DACX;CACE;CACA;CACA;CACA,GAAG,+BAA+B,KAC/B,UAAU,KAAK,MAAM,IAAI,0BAA0B,OAAO,WAC5D;CACF,CAAC,KAAK,KAAK;AAEd,MAAa,wCACX,aACmD;CACnD,MAAM,UAAU,2BAA2B;AAC3C,KAAI,CAAC,QACH;CAGF,MAAM,UAAU,uBAAuB,0BAA0B,cAAc,SAAS,QAAQ;AAChG,QAAO,UAAU;EAAE,OAAO,GAAG,QAAQ;EAAa;EAAS,GAAG,KAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"controller-proxy-DMTqer6T.mjs","names":[],"sources":["../src/react/client-error.ts","../src/react/thread-launcher.ts","../src/react/task-client.ts","../src/react/controller-proxy.ts"],"sourcesContent":["import { parseSurveyAssistantError, type SurveyAssistantErrorCode } from \"../protocol\";\n\nexport class SurveyAssistantClientError extends Error {\n readonly code: SurveyAssistantErrorCode;\n readonly retryable: boolean;\n\n constructor(code: SurveyAssistantErrorCode, message: string, retryable = false) {\n super(message);\n this.name = \"SurveyAssistantClientError\";\n this.code = code;\n this.retryable = retryable;\n }\n}\n\nexport const readSurveyAssistantJson = async (\n response: Response,\n fallback = \"The assistant request could not be completed.\",\n) => {\n if (!response.ok) {\n const responseText = await response.text().catch(() => \"\");\n let body: unknown;\n try {\n body = responseText ? JSON.parse(responseText) : undefined;\n } catch {\n body = undefined;\n }\n const detail =\n typeof body === \"object\" &&\n body !== null &&\n \"error\" in body &&\n typeof body.error === \"string\"\n ? body.error\n : responseText.trim() || fallback;\n const parsed = parseSurveyAssistantError(\n typeof body === \"object\" &&\n body !== null &&\n \"code\" in body &&\n typeof body.code === \"string\"\n ? { code: body.code, detail }\n : detail,\n );\n const explicitRetryable =\n typeof body === \"object\" &&\n body !== null &&\n \"retryable\" in body &&\n typeof body.retryable === \"boolean\"\n ? body.retryable\n : undefined;\n const retryable =\n explicitRetryable ??\n (parsed.code === \"rate_limited\" ||\n ((parsed.code === \"request_failed\" || parsed.code === \"attachment_unavailable\") &&\n response.status >= 500));\n throw new SurveyAssistantClientError(parsed.code, parsed.detail ?? detail, retryable);\n }\n return response.json().catch(() => ({}));\n};\n","import type {\n SurveyAssistantSnapshot,\n SurveyAssistantThread,\n SurveyEditorUIContext,\n} from \"../protocol\";\nimport type { FileUIPart } from \"ai\";\n\nexport type SurveyAssistantLaunchUIContext = Partial<Omit<SurveyEditorUIContext, \"history\">>;\n\nexport interface SurveyAssistantThreadLaunch {\n /** User-visible prompt submitted as the first message in the new thread. */\n prompt: string;\n files?: FileUIPart[];\n /** Optional model used for the opening assistant turn. */\n modelId?: string;\n /** Optional manual thread title. The prompt-derived automatic title is used by default. */\n title?: string;\n /** Turn-local editor context merged into the snapshot captured when the prompt is submitted. */\n uiContext?: SurveyAssistantLaunchUIContext;\n}\n\nexport interface SurveyAssistantThreadLauncher {\n /**\n * Creates a new thread and submits its first prompt when a connected panel is ready.\n * Calls made before the panel mounts are queued.\n */\n startThread(input: SurveyAssistantThreadLaunch): Promise<SurveyAssistantThread>;\n}\n\ntype LaunchHandler = (input: SurveyAssistantThreadLaunch) => Promise<SurveyAssistantThread>;\n\ninterface PendingLaunch {\n input: SurveyAssistantThreadLaunch;\n reject(error: unknown): void;\n resolve(thread: SurveyAssistantThread): void;\n}\n\ninterface LauncherState {\n handler: LaunchHandler | null;\n pending: PendingLaunch[];\n draining: boolean;\n}\n\nconst launcherStates = new WeakMap<SurveyAssistantThreadLauncher, LauncherState>();\n\nexport const applySurveyAssistantLaunchUIContext = (\n snapshot: SurveyAssistantSnapshot | null,\n uiContext: SurveyAssistantLaunchUIContext | undefined,\n): SurveyAssistantSnapshot | null =>\n snapshot && uiContext\n ? {\n ...snapshot,\n ui: {\n ...snapshot.ui,\n ...uiContext,\n },\n }\n : snapshot;\n\nconst getLauncherState = (launcher: SurveyAssistantThreadLauncher) => {\n const state = launcherStates.get(launcher);\n if (!state) {\n throw new Error(\n \"The survey assistant thread launcher was not created by createSurveyAssistantThreadLauncher.\",\n );\n }\n return state;\n};\n\nconst drainPendingLaunches = async (state: LauncherState) => {\n if (state.draining) return;\n state.draining = true;\n try {\n while (state.handler && state.pending.length > 0) {\n const pending = state.pending.shift();\n if (!pending) continue;\n try {\n pending.resolve(await state.handler(pending.input));\n } catch (error) {\n pending.reject(error);\n }\n }\n } finally {\n state.draining = false;\n }\n};\n\nexport const createSurveyAssistantThreadLauncher = (): SurveyAssistantThreadLauncher => {\n const state: LauncherState = { handler: null, pending: [], draining: false };\n const launcher: SurveyAssistantThreadLauncher = {\n startThread(input) {\n const prompt = input.prompt.trim();\n if (!prompt && (input.files?.length ?? 0) === 0) {\n return Promise.reject(new Error(\"A survey assistant prompt or attachment is required.\"));\n }\n\n return new Promise((resolve, reject) => {\n state.pending.push({\n input: {\n ...input,\n prompt,\n ...(input.files ? { files: [...input.files] } : {}),\n ...(input.modelId ? { modelId: input.modelId.trim() } : {}),\n ...(input.title ? { title: input.title.trim() } : {}),\n },\n reject,\n resolve,\n });\n void drainPendingLaunches(state);\n });\n },\n };\n launcherStates.set(launcher, state);\n return launcher;\n};\n\nexport const connectSurveyAssistantThreadLauncher = (\n launcher: SurveyAssistantThreadLauncher,\n handler: LaunchHandler,\n) => {\n const state = getLauncherState(launcher);\n if (state.handler && state.handler !== handler) {\n throw new Error(\"A survey assistant thread launcher can only control one mounted panel.\");\n }\n state.handler = handler;\n void drainPendingLaunches(state);\n\n return () => {\n if (state.handler === handler) state.handler = null;\n };\n};\n","import {\n surveyAssistantSuggestItemKeyResultSchema,\n surveyAssistantSuggestItemLabelResultSchema,\n surveyAssistantTranslateContentResultSchema,\n type SurveyAssistantSuggestItemKeyInput,\n type SurveyAssistantSuggestItemKeyResult,\n type SurveyAssistantSuggestItemLabelInput,\n type SurveyAssistantSuggestItemLabelResult,\n type SurveyAssistantTaskContext,\n type SurveyAssistantTaskInvocationMode,\n type SurveyAssistantTranslateContentInput,\n type SurveyAssistantTranslateContentResult,\n} from \"../protocol\";\nimport { readSurveyAssistantJson } from \"./client-error\";\n\nexport interface SurveyAssistantTaskClientOptions {\n api?: string;\n getModelId?: () => string | undefined;\n resourceId?: string;\n surveyId?: string;\n}\n\nexport interface SurveyAssistantTaskExecutionOptions {\n mode?: SurveyAssistantTaskInvocationMode;\n modelId?: string;\n signal?: AbortSignal;\n}\n\nexport interface SurveyAssistantTaskClient {\n suggestItemKey(\n input: SurveyAssistantSuggestItemKeyInput,\n context: SurveyAssistantTaskContext,\n options?: SurveyAssistantTaskExecutionOptions,\n ): Promise<SurveyAssistantSuggestItemKeyResult>;\n suggestItemLabel(\n input: SurveyAssistantSuggestItemLabelInput,\n context: SurveyAssistantTaskContext,\n options?: SurveyAssistantTaskExecutionOptions,\n ): Promise<SurveyAssistantSuggestItemLabelResult>;\n translateContent(\n input: SurveyAssistantTranslateContentInput,\n context: SurveyAssistantTaskContext,\n options?: SurveyAssistantTaskExecutionOptions,\n ): Promise<SurveyAssistantTranslateContentResult>;\n}\n\nexport interface SurveyAssistantTaskExecutorRequestOptions {\n mode?: SurveyAssistantTaskInvocationMode;\n signal?: AbortSignal;\n}\n\nexport interface SurveyAssistantTaskExecutorCacheContext {\n cacheScope?: string;\n}\n\nexport interface SurveyAssistantTaskExecutor {\n suggestItemKey(\n input: SurveyAssistantSuggestItemKeyInput,\n context: SurveyAssistantTaskContext,\n options?: SurveyAssistantTaskExecutorRequestOptions,\n cache?: SurveyAssistantTaskExecutorCacheContext,\n ): Promise<SurveyAssistantSuggestItemKeyResult>;\n suggestItemLabel(\n input: SurveyAssistantSuggestItemLabelInput,\n context: SurveyAssistantTaskContext,\n options?: SurveyAssistantTaskExecutorRequestOptions,\n cache?: SurveyAssistantTaskExecutorCacheContext,\n ): Promise<SurveyAssistantSuggestItemLabelResult>;\n translateContent(\n input: SurveyAssistantTranslateContentInput,\n context: SurveyAssistantTaskContext,\n options?: SurveyAssistantTaskExecutorRequestOptions,\n cache?: SurveyAssistantTaskExecutorCacheContext,\n ): Promise<SurveyAssistantTranslateContentResult>;\n}\n\nexport const createSurveyAssistantTaskClient = ({\n api = \"/api/survey-assistant/tasks\",\n getModelId,\n resourceId,\n surveyId,\n}: SurveyAssistantTaskClientOptions = {}): SurveyAssistantTaskClient => {\n const run = async (\n taskId: \"suggest-item-key\" | \"suggest-item-label\" | \"translate-content\",\n input: unknown,\n context: SurveyAssistantTaskContext,\n options?: SurveyAssistantTaskExecutionOptions,\n ) => {\n const modelId = options?.modelId ?? getModelId?.();\n return readSurveyAssistantJson(\n await fetch(api, {\n body: JSON.stringify({\n taskId,\n input,\n context,\n ...(options?.mode ? { mode: options.mode } : {}),\n ...(modelId ? { modelId } : {}),\n ...(resourceId ? { resourceId } : {}),\n ...(surveyId ? { surveyId } : {}),\n }),\n headers: { \"content-type\": \"application/json\" },\n method: \"POST\",\n signal: options?.signal,\n }),\n \"The survey assistant task could not be completed.\",\n );\n };\n\n return {\n async suggestItemKey(input, context, options) {\n return surveyAssistantSuggestItemKeyResultSchema.parse(\n await run(\"suggest-item-key\", input, context, options),\n );\n },\n async suggestItemLabel(input, context, options) {\n return surveyAssistantSuggestItemLabelResultSchema.parse(\n await run(\"suggest-item-label\", input, context, options),\n );\n },\n async translateContent(input, context, options) {\n return surveyAssistantTranslateContentResultSchema.parse(\n await run(\"translate-content\", input, context, options),\n );\n },\n };\n};\n\nexport const createSurveyAssistantTaskExecutor = (\n options: SurveyAssistantTaskClientOptions = {},\n): SurveyAssistantTaskExecutor => {\n const client = createSurveyAssistantTaskClient(options);\n const executionOptions = (\n request?: SurveyAssistantTaskExecutorRequestOptions,\n cache?: SurveyAssistantTaskExecutorCacheContext,\n ): SurveyAssistantTaskExecutionOptions => ({\n mode: request?.mode,\n modelId: cache?.cacheScope,\n signal: request?.signal,\n });\n\n return {\n suggestItemKey: (input, context, request, cache) =>\n client.suggestItemKey(input, context, executionOptions(request, cache)),\n suggestItemLabel: (input, context, request, cache) =>\n client.suggestItemLabel(input, context, executionOptions(request, cache)),\n translateContent: (input, context, request, cache) =>\n client.translateContent(input, context, executionOptions(request, cache)),\n };\n};\n","import type { SurveyApplyResult, SurveyBatchApplyResult, SurveyChangeSet } from \"../protocol\";\nimport type { SurveyAssistantController } from \"./controller\";\n\nexport interface CreateSurveyAssistantControllerProxyOptions {\n notReadyMessage?: string;\n}\n\nexport interface SurveyAssistantControllerBridge {\n controller: SurveyAssistantController;\n setController(controller: SurveyAssistantController | null | undefined): void;\n}\n\nconst failedResult = (change: SurveyChangeSet, message: string): SurveyApplyResult => ({\n status: \"failed\",\n changeId: change.id,\n summary: change.summary,\n message,\n appliedOperations: 0,\n});\n\nexport const createSurveyAssistantControllerProxy = (\n getController: () => SurveyAssistantController | null | undefined,\n {\n notReadyMessage = \"The survey editor is not ready.\",\n }: CreateSurveyAssistantControllerProxyOptions = {},\n): SurveyAssistantController => ({\n getSnapshot: () => getController()?.getSnapshot() ?? null,\n applyAssistantChange: (change) =>\n getController()?.applyAssistantChange?.(change) ?? failedResult(change, notReadyMessage),\n applyAssistantChanges: (changes): SurveyBatchApplyResult =>\n getController()?.applyAssistantChanges?.(changes) ?? {\n results: changes.map((change) => failedResult(change, notReadyMessage)),\n },\n});\n\nexport const createSurveyAssistantControllerBridge = (\n options?: CreateSurveyAssistantControllerProxyOptions,\n): SurveyAssistantControllerBridge => {\n let currentController: SurveyAssistantController | null | undefined;\n return {\n controller: createSurveyAssistantControllerProxy(() => currentController, options),\n setController(controller) {\n currentController = controller;\n },\n };\n};\n"],"mappings":";;AAEA,IAAa,6BAAb,cAAgD,MAAM;CACpD;CACA;CAEA,YAAY,MAAgC,SAAiB,YAAY,OAAO;AAC9E,QAAM,QAAQ;AACd,OAAK,OAAO;AACZ,OAAK,OAAO;AACZ,OAAK,YAAY;;;AAIrB,MAAa,0BAA0B,OACrC,UACA,WAAW,oDACR;AACH,KAAI,CAAC,SAAS,IAAI;EAChB,MAAM,eAAe,MAAM,SAAS,MAAM,CAAC,YAAY,GAAG;EAC1D,IAAI;AACJ,MAAI;AACF,UAAO,eAAe,KAAK,MAAM,aAAa,GAAG,KAAA;UAC3C;AACN,UAAO,KAAA;;EAET,MAAM,SACJ,OAAO,SAAS,YAChB,SAAS,QACT,WAAW,QACX,OAAO,KAAK,UAAU,WAClB,KAAK,QACL,aAAa,MAAM,IAAI;EAC7B,MAAM,SAAS,0BACb,OAAO,SAAS,YACd,SAAS,QACT,UAAU,QACV,OAAO,KAAK,SAAS,WACnB;GAAE,MAAM,KAAK;GAAM;GAAQ,GAC3B,OACL;EAQD,MAAM,aANJ,OAAO,SAAS,YAChB,SAAS,QACT,eAAe,QACf,OAAO,KAAK,cAAc,YACtB,KAAK,YACL,KAAA,OAGH,OAAO,SAAS,mBACb,OAAO,SAAS,oBAAoB,OAAO,SAAS,6BACpD,SAAS,UAAU;AACzB,QAAM,IAAI,2BAA2B,OAAO,MAAM,OAAO,UAAU,QAAQ,UAAU;;AAEvF,QAAO,SAAS,MAAM,CAAC,aAAa,EAAE,EAAE;;;;ACZ1C,MAAM,iCAAiB,IAAI,SAAuD;AAElF,MAAa,uCACX,UACA,cAEA,YAAY,YACR;CACE,GAAG;CACH,IAAI;EACF,GAAG,SAAS;EACZ,GAAG;EACJ;CACF,GACD;AAEN,MAAM,oBAAoB,aAA4C;CACpE,MAAM,QAAQ,eAAe,IAAI,SAAS;AAC1C,KAAI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AO,iBAAiB,OAAO,SAAS,iBAAiB,SAAS,MAAM,CAAC;EAC3E,mBAAmB,OAAO,SAAS,SAAS,UAC1C,OAAO,iBAAiB,OAAO,SAAS,iBAAiB,SAAS,MAAM,CAAC;EAC5E;;;;ACvIH,MAAM,gBAAgB,QAAyB,aAAwC;CACrF,QAAQ;CACR,UAAU,OAAO;CACjB,SAAS,OAAO;CAChB;CACA,mBAAmB;CACpB;AAED,MAAa,wCACX,eACA,EACE,kBAAkB,sCAC6B,EAAE,MACpB;CAC/B,mBAAmB,eAAe,EAAE,aAAa,IAAI;CACrD,uBAAuB,WACrB,eAAe,EAAE,uBAAuB,OAAO,IAAI,aAAa,QAAQ,gBAAgB;CAC1F,wBAAwB,YACtB,eAAe,EAAE,wBAAwB,QAAQ,IAAI,EACnD,SAAS,QAAQ,KAAK,WAAW,aAAa,QAAQ,gBAAgB,CAAC,EACxE;CACJ;AAED,MAAa,yCACX,YACoC;CACpC,IAAI;AACJ,QAAO;EACL,YAAY,2CAA2C,mBAAmB,QAAQ;EAClF,cAAc,YAAY;AACxB,uBAAoB;;EAEvB"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"controller-proxy-mRvez2qw.d.mts","names":[],"sources":["../src/react/thread-launcher.ts","../src/react/task-client.ts","../src/react/controller.ts","../src/react/controller-proxy.ts"],"mappings":";;;;;KAOY,8BAAA,GAAiC,OAAA,CAAQ,IAAA,CAAK,qBAAA;AAAA,UAEzC,2BAAA;;EAEf,MAAA;EACA,KAAA,GAAQ,UAAA;;EAER,OAAA;EAPmD;EASnD,KAAA;EATkD;EAWlD,SAAA,GAAY,8BAAA;AAAA;AAAA,UAGG,6BAAA;EAdyC;;;AAE1D;EAiBE,WAAA,CAAY,KAAA,EAAO,2BAAA,GAA8B,OAAA,CAAQ,qBAAA;AAAA;AAAA,cA6D9C,mCAAA,QAA0C,6BAAA;;;UCxEtC,gCAAA;EACf,GAAA;EACA,UAAA;EACA,UAAA;EACA,QAAA;AAAA;AAAA,UAG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