@case-framework/survey-assistant 0.4.0 → 0.6.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 +8 -0
- package/dist/attachments-B0hg3vpT.mjs +11 -0
- package/dist/attachments-B0hg3vpT.mjs.map +1 -0
- package/dist/authoring-references-CW38pYzK.mjs +115 -0
- package/dist/authoring-references-CW38pYzK.mjs.map +1 -0
- package/dist/{capabilities-CnsVuJ1k.d.mts → capabilities-DVTfogjv.d.mts} +1 -1
- package/dist/{capabilities-CnsVuJ1k.d.mts.map → capabilities-DVTfogjv.d.mts.map} +1 -1
- package/dist/capabilities-default.d.mts +1 -1
- package/dist/capabilities-default.d.mts.map +1 -1
- package/dist/capabilities-default.mjs +39 -9
- package/dist/capabilities-default.mjs.map +1 -1
- package/dist/{constants-CFUWrRtl.mjs → constants-0UHGFcRJ.mjs} +1 -1
- package/dist/{constants-CFUWrRtl.mjs.map → constants-0UHGFcRJ.mjs.map} +1 -1
- package/dist/{constants-k1b_evIb.d.mts → constants-BMGTgfjv.d.mts} +4 -4
- package/dist/{constants-k1b_evIb.d.mts.map → constants-BMGTgfjv.d.mts.map} +1 -1
- package/dist/{controller-proxy-jWIPOZAv.mjs → controller-proxy-DMTqer6T.mjs} +1 -1
- package/dist/{controller-proxy-jWIPOZAv.mjs.map → controller-proxy-DMTqer6T.mjs.map} +1 -1
- package/dist/{controller-proxy-quQjtA7j.d.mts → controller-proxy-mRvez2qw.d.mts} +3 -3
- package/dist/{controller-proxy-quQjtA7j.d.mts.map → controller-proxy-mRvez2qw.d.mts.map} +1 -1
- package/dist/{digest-Dyjch_sC.d.mts → digest-SJmoYVaK.d.mts} +2 -2
- package/dist/{digest-Dyjch_sC.d.mts.map → digest-SJmoYVaK.d.mts.map} +1 -1
- package/dist/digest.d.mts +1 -1
- package/dist/{engine-BvfUx_Jx.mjs → engine-CQwOAcwK.mjs} +167 -24
- package/dist/engine-CQwOAcwK.mjs.map +1 -0
- package/dist/engine.d.mts +3 -3
- package/dist/engine.mjs +3 -3
- package/dist/{fair-guidance-CEdJYccK.mjs → fair-guidance-CRYCRxQm.mjs} +1 -1
- package/dist/{fair-guidance-CEdJYccK.mjs.map → fair-guidance-CRYCRxQm.mjs.map} +1 -1
- package/dist/{form-authoring-BQh40yDb.mjs → form-authoring-kQDgC5oz.mjs} +1 -1
- package/dist/{form-authoring-BQh40yDb.mjs.map → form-authoring-kQDgC5oz.mjs.map} +1 -1
- package/dist/{index-biZnRl-h.d.mts → index-B0lxsAzx.d.mts} +10 -6
- package/dist/index-B0lxsAzx.d.mts.map +1 -0
- package/dist/{index-BDp6S7r9.d.mts → index-BS-Xjk1h.d.mts} +4 -4
- package/dist/{index-BDp6S7r9.d.mts.map → index-BS-Xjk1h.d.mts.map} +1 -1
- package/dist/{index-r8HVcn5b.d.mts → index-D6nqkz0O.d.mts} +49 -8
- package/dist/{index-r8HVcn5b.d.mts.map → index-D6nqkz0O.d.mts.map} +1 -1
- package/dist/{index-8x1Eqlnz.d.mts → index-DvTqML-0.d.mts} +10 -5
- package/dist/index-DvTqML-0.d.mts.map +1 -0
- package/dist/{lifecycle-DWv5CiSu.d.mts → lifecycle-BmGAIUlv.d.mts} +2 -2
- package/dist/{lifecycle-DWv5CiSu.d.mts.map → lifecycle-BmGAIUlv.d.mts.map} +1 -1
- package/dist/{memory-thread-repository-xBZOog_q.mjs → memory-thread-repository-CjFGVNZh.mjs} +44 -13
- package/dist/{memory-thread-repository-xBZOog_q.mjs.map → memory-thread-repository-CjFGVNZh.mjs.map} +1 -1
- package/dist/protocol.d.mts +4 -4
- package/dist/protocol.mjs +2 -1
- package/dist/{react-CY6N7lVi.mjs → react-Dqlmasrs.mjs} +2 -2
- package/dist/{react-CY6N7lVi.mjs.map → react-Dqlmasrs.mjs.map} +1 -1
- package/dist/react-integration.d.mts +1 -1
- package/dist/react-integration.mjs +1 -1
- package/dist/react.d.mts +2 -2
- package/dist/react.mjs +2 -2
- package/dist/{request-context-DixY5DYu.mjs → request-context-BjTHNcDd.mjs} +2 -2
- package/dist/{request-context-DixY5DYu.mjs.map → request-context-BjTHNcDd.mjs.map} +1 -1
- package/dist/{request-guardrails-h4t6u8mP.mjs → request-guardrails-TmgQtqp4.mjs} +5 -12
- package/dist/request-guardrails-TmgQtqp4.mjs.map +1 -0
- package/dist/server-agent.d.mts +9 -7
- package/dist/server-agent.d.mts.map +1 -1
- package/dist/server-agent.mjs +8 -6
- package/dist/server-agent.mjs.map +1 -1
- package/dist/server-runtime.d.mts +28 -14
- package/dist/server-runtime.d.mts.map +1 -1
- package/dist/server-runtime.mjs +47 -8
- package/dist/server-runtime.mjs.map +1 -1
- package/dist/server-tasks.d.mts +1 -1
- package/dist/server-tasks.mjs +4 -4
- package/dist/server-tools.d.mts +1 -1
- package/dist/server-tools.mjs +1 -1
- package/dist/server.d.mts +7 -7
- package/dist/server.mjs +6 -6
- package/dist/storage-postgres.d.mts +1 -1
- package/dist/storage-postgres.mjs +4 -1
- package/dist/storage-postgres.mjs.map +1 -1
- package/dist/{tasks-BWmTMXoK.d.mts → tasks-DxzD25Zc.d.mts} +16 -4
- package/dist/tasks-DxzD25Zc.d.mts.map +1 -0
- package/dist/{thread-documents-Dvo6XS7o.d.mts → thread-documents-rmd6nyX9.d.mts} +1 -1
- package/dist/{thread-documents-Dvo6XS7o.d.mts.map → thread-documents-rmd6nyX9.d.mts.map} +1 -1
- package/dist/{thread-handlers-D8gkLfU6.d.mts → thread-handlers-AbQbt4sX.d.mts} +13 -6
- package/dist/{thread-handlers-D8gkLfU6.d.mts.map → thread-handlers-AbQbt4sX.d.mts.map} +1 -1
- package/dist/{tools-TXI8bfzZ.mjs → tools-CFh35R4d.mjs} +14 -6
- package/dist/tools-CFh35R4d.mjs.map +1 -0
- package/dist/ui.css +1 -1
- package/dist/ui.d.mts +3 -3
- package/dist/ui.d.mts.map +1 -1
- package/dist/ui.mjs +198 -83
- package/dist/ui.mjs.map +1 -1
- package/docs/integration.md +37 -3
- package/package.json +2 -2
- package/dist/authoring-references-yyYC4Ydi.mjs +0 -98
- package/dist/authoring-references-yyYC4Ydi.mjs.map +0 -1
- package/dist/engine-BvfUx_Jx.mjs.map +0 -1
- package/dist/index-8x1Eqlnz.d.mts.map +0 -1
- package/dist/index-biZnRl-h.d.mts.map +0 -1
- package/dist/request-guardrails-h4t6u8mP.mjs.map +0 -1
- package/dist/tasks-BWmTMXoK.d.mts.map +0 -1
- package/dist/tools-TXI8bfzZ.mjs.map +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { c as SurveyAssistantSuggestItemKeyInput, d as SurveyAssistantSuggestItemLabelResult, l as SurveyAssistantSuggestItemKeyResult, m as SurveyAssistantTaskInvocationMode, p as SurveyAssistantTaskContext, u as SurveyAssistantSuggestItemLabelInput, v as SurveyAssistantTranslateContentInput, y as SurveyAssistantTranslateContentResult } from "./index-
|
|
2
|
-
import { a as SurveyAssistantModelSelection, n as SURVEY_ASSISTANT_TASK_AGENT_ID, o as SurveyAssistantRequestContext } from "./constants-
|
|
1
|
+
import { c as SurveyAssistantSuggestItemKeyInput, d as SurveyAssistantSuggestItemLabelResult, l as SurveyAssistantSuggestItemKeyResult, m as SurveyAssistantTaskInvocationMode, p as SurveyAssistantTaskContext, u as SurveyAssistantSuggestItemLabelInput, v as SurveyAssistantTranslateContentInput, y as SurveyAssistantTranslateContentResult } from "./index-DvTqML-0.mjs";
|
|
2
|
+
import { a as SurveyAssistantModelSelection, n as SURVEY_ASSISTANT_TASK_AGENT_ID, o as SurveyAssistantRequestContext } from "./constants-BMGTgfjv.mjs";
|
|
3
3
|
import { z } from "zod";
|
|
4
4
|
import { RequestContext } from "@mastra/core/request-context";
|
|
5
5
|
import * as _$_mastra_core_agent0 from "@mastra/core/agent";
|
|
@@ -12,48 +12,60 @@ declare const surveyAuthoringReferences: {
|
|
|
12
12
|
readonly "core-rules": {
|
|
13
13
|
readonly title: "Core authoring rules";
|
|
14
14
|
readonly content: string;
|
|
15
|
+
readonly loadWhen: "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.";
|
|
15
16
|
};
|
|
16
17
|
readonly "survey-data-model": {
|
|
17
18
|
readonly title: "Survey data model";
|
|
18
19
|
readonly content: string;
|
|
20
|
+
readonly loadWhen: "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.";
|
|
19
21
|
};
|
|
20
22
|
readonly "source-material-surveys": {
|
|
21
23
|
readonly title: "Source-material survey implementation";
|
|
22
24
|
readonly content: string;
|
|
25
|
+
readonly loadWhen: "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.";
|
|
23
26
|
};
|
|
24
27
|
readonly localization: {
|
|
25
28
|
readonly title: "Survey localization";
|
|
26
29
|
readonly content: string;
|
|
30
|
+
readonly loadWhen: "Load before adding, removing, translating, or assessing a survey locale, including requests for localization completeness or locale lifecycle changes.";
|
|
27
31
|
};
|
|
28
32
|
readonly "rich-text-content": {
|
|
29
33
|
readonly title: "Rich text content";
|
|
30
34
|
readonly content: string;
|
|
35
|
+
readonly loadWhen: "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.";
|
|
31
36
|
};
|
|
32
37
|
readonly "item-types": {
|
|
33
38
|
readonly title: "Item types";
|
|
34
39
|
readonly content: string;
|
|
40
|
+
readonly loadWhen: "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.";
|
|
35
41
|
};
|
|
36
42
|
readonly "embedded-forms": {
|
|
37
43
|
readonly title: "Choice option embedded forms";
|
|
38
44
|
readonly content: string;
|
|
45
|
+
readonly loadWhen: "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.";
|
|
39
46
|
};
|
|
40
47
|
readonly expressions: {
|
|
41
48
|
readonly title: "Expressions";
|
|
42
49
|
readonly content: string;
|
|
50
|
+
readonly loadWhen: "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.";
|
|
43
51
|
};
|
|
44
52
|
readonly "assistant-operations": {
|
|
45
53
|
readonly title: "Assistant operations";
|
|
46
54
|
readonly content: string;
|
|
55
|
+
readonly loadWhen: "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.";
|
|
47
56
|
};
|
|
48
57
|
readonly "fair-by-design": {
|
|
49
58
|
readonly title: "FAIR-by-design survey authoring";
|
|
50
59
|
readonly content: string;
|
|
60
|
+
readonly loadWhen: "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.";
|
|
51
61
|
};
|
|
52
62
|
readonly "survey-quality": {
|
|
53
63
|
readonly title: "Survey quality review";
|
|
54
64
|
readonly content: string;
|
|
65
|
+
readonly loadWhen: "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.";
|
|
55
66
|
};
|
|
56
67
|
};
|
|
68
|
+
declare const formatSurveyAuthoringReferenceRoutingInstructions: () => string;
|
|
57
69
|
//#endregion
|
|
58
70
|
//#region src/server/tasks.d.ts
|
|
59
71
|
type SurveyAssistantTaskAgentConfig = AgentConfig<typeof SURVEY_ASSISTANT_TASK_AGENT_ID, Record<string, never>, undefined, SurveyAssistantRequestContext>;
|
|
@@ -140,5 +152,5 @@ declare const createSurveyAssistantTaskHandler: ({
|
|
|
140
152
|
resolveModel
|
|
141
153
|
}: CreateSurveyAssistantTaskHandlerOptions) => (request: Request) => Promise<Response>;
|
|
142
154
|
//#endregion
|
|
143
|
-
export { SurveyAssistantTaskAuthorizationInput as a, createSurveyAssistantTaskAgent as c, runSurveyAssistantSuggestItemLabelTask as d, runSurveyAssistantTask as f,
|
|
144
|
-
//# sourceMappingURL=tasks-
|
|
155
|
+
export { surveyAuthoringReferences as _, SurveyAssistantTaskAuthorizationInput as a, createSurveyAssistantTaskAgent as c, runSurveyAssistantSuggestItemLabelTask as d, runSurveyAssistantTask as f, surveyAuthoringReferenceTopics as g, formatSurveyAuthoringReferenceRoutingInstructions as h, RunSurveyAssistantTaskOptions as i, createSurveyAssistantTaskHandler as l, SurveyAuthoringReferenceTopic as m, CreateSurveyAssistantTaskHandlerOptions as n, SurveyAssistantTaskAuthorizedIdentity as o, runSurveyAssistantTranslateContentTask as p, RunSurveyAssistantBuiltInTaskOptions as r, SurveyAssistantTaskModelResolutionInput as s, CreateSurveyAssistantTaskAgentOptions as t, runSurveyAssistantSuggestItemKeyTask as u };
|
|
156
|
+
//# sourceMappingURL=tasks-DxzD25Zc.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tasks-DxzD25Zc.d.mts","names":[],"sources":["../src/server/authoring-references.ts","../src/server/tasks.ts"],"mappings":";;;;;;;;cAMa,8BAAA;AAAA,KAcD,6BAAA,WAAwC,8BAAA;AAAA,cAmCvC,yBAAA;EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAqEA,iDAAA;;;KCjGR,8BAAA,GAAiC,WAAA,QAC7B,8BAAA,EACP,MAAA,4BAEA,6BAAA;AAAA,UAGe,qCAAA;EACf,KAAA,EAAO,8BAAA;AAAA;AAAA,cAGI,8BAAA;EAAkC;AAAA,GAAW,qCAAA,KAAqC,KAAA,gCAAA,MAAA,4BAAA,6BAAA,EAAA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AAAA;AAAA,UAGe,uCAAA;EACf,KAAA,EACI,IAAA,CAAK,KAAA,uBACE,IAAA,CAAK,KAAA,gBAAqB,OAAA,CAAQ,IAAA,CAAK,KAAA;EAClD,SAAA,CACE,KAAA,EAAO,qCAAA,GACN,qCAAA,GAAwC,OAAA,CAAQ,qCAAA;EACnD,iBAAA,EAAmB,OAAA,EAAS,OAAA,mBAA0B,OAAA;EACtD,SAAA,EAAW,OAAA,EAAS,OAAA,aAAoB,OAAA;EACxC,qBAAA;EACA,aAAA;EACA,aAAA,EAAe,KAAA;IACb,UAAA;IACA,QAAA,EAAU,qCAAA;IACV,MAAA;IACA,MAAA;EAAA;EAEF,eAAA,GAAkB,qBAAA;EAClB,YAAA,EACE,KAAA,EAAO,uCAAA,GAEL,6BAAA,sBAGA,OAAA,CAAQ,6BAAA;AAAA;AAAA,cAmCD,gCAAA;EAAoC,KAAA;EAAA,SAAA;EAAA,iBAAA;EAAA,SAAA;EAAA,qBAAA;EAAA,aAAA;EAAA,aAAA;EAAA,eAAA;EAAA;AAAA,GAU9C,uCAAA,MAWa,OAAA,EAAS,OAAA,KAAU,OAAA,CAAQ,QAAA"}
|
|
@@ -104,4 +104,4 @@ declare const loadSurveyAssistantDocuments: ({
|
|
|
104
104
|
}) => Promise<SurveyAssistantModelAttachment[]>;
|
|
105
105
|
//#endregion
|
|
106
106
|
export { SurveyAssistantThreadDocumentRepository as a, loadSurveyAssistantThreadAttachments as c, replaceCurrentSurveyAssistantAttachmentsWithReferences as d, SurveyAssistantThreadDocumentContent as i, registerSurveyAssistantThreadAttachments as l, SurveyAssistantModelAttachment as n, getSurveyAssistantReplayableDocuments as o, SurveyAssistantThreadDocument as r, loadSurveyAssistantDocuments as s, SurveyAssistantAttachmentAccess as t, removeHistoricalSurveyAssistantAttachments as u };
|
|
107
|
-
//# sourceMappingURL=thread-documents-
|
|
107
|
+
//# sourceMappingURL=thread-documents-rmd6nyX9.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"thread-documents-
|
|
1
|
+
{"version":3,"file":"thread-documents-rmd6nyX9.d.mts","names":[],"sources":["../src/server/thread-documents.ts"],"mappings":";;;;UAOiB,6BAAA;EACf,EAAA;EACA,IAAA;EACA,SAAA;EACA,KAAA;EACA,WAAA;EACA,SAAA;AAAA;AAAA,UAGe,oCAAA,SAA6C,6BAAA;EAC5D,IAAA;AAAA;AAAA,UAGe,8BAAA;EACf,QAAA;EACA,SAAA;EACA,IAAA;EACA,WAAA;AAAA;AAAA,UAGe,+BAAA;EACf,SAAA,EAAW,6BAAA;EAXP;EAaJ,kBAAA;EACA,mBAAA,EAAqB,8BAAA;EACrB,IAAA,CAAK,WAAA,aAAwB,OAAA,CAAQ,8BAAA;AAAA;AAAA,UAGtB,uCAAA;EACf,GAAA,CAAI,KAAA;IACF,UAAA;IACA,QAAA;IACA,IAAA;IACA,SAAA;IACA,IAAA;IACA,KAAA;EAAA,IACE,OAAA,CAAQ,6BAAA;EACZ,IAAA,CAAK,KAAA;IAAS,UAAA;IAAoB,QAAA;EAAA,IAAqB,OAAA,CAAQ,6BAAA;EAC/D,IAAA,CAAK,KAAA;IACH,UAAA;IACA,QAAA;IACA,UAAA;EAAA,IACE,OAAA,CAAQ,oCAAA;EACZ,YAAA,CAAa,KAAA;IAAS,UAAA;IAAoB,QAAA;EAAA,IAAqB,OAAA;AAAA;;;;AAfjE;;cA4Da,sDAAA;EAA0D,SAAA;EAAA;AAAA;EAIrE,SAAA,EAAW,6BAAA;EACX,QAAA,EAAU,SAAA;AAAA,MACR,SAAA;AAAA,cA2BS,wCAAA;EAAkD,QAAA;EAAA,UAAA;EAAA,UAAA;EAAA;AAAA;EAM7D,QAAA,EAAU,SAAA;EACV,UAAA,EAAY,uCAAA;EACZ,UAAA;EACA,QAAA;AAAA,MACD,OAAA,CAAA,6BAAA;AAAA,cAkCY,0CAAA,GAA8C,QAAA,EAAU,SAAA,OAAW,SAAA,UAAF,IAAA,CAAE,WAAA,EAAA,IAAA,CAAA,OAAA;;;;;cAanE,qCAAA,GACX,SAAA,EAAW,6BAAA,IACX,kBAAA,EAAoB,WAAA,aAAmB,6BAAA;AAAA,cAG5B,oCAAA;EAA8C,kBAAA;EAAA,SAAA;EAAA,UAAA;EAAA,UAAA;EAAA;AAAA;EAOzD,kBAAA,GAAqB,WAAA;EACrB,SAAA,EAAW,6BAAA;EACX,UAAA,EAAY,uCAAA;EACZ,UAAA;EACA,QAAA;AAAA,MACE,OAAA,CAAQ,8BAAA;AAAA,cAWC,4BAAA;EAAsC,SAAA;EAAA,UAAA;EAAA,UAAA;EAAA;AAAA;EAMjD,SAAA,EAAW,6BAAA;EACX,UAAA,EAAY,uCAAA;EACZ,UAAA;EACA,QAAA;AAAA,MACE,OAAA,CAAQ,8BAAA"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { p as SurveyAssistantTurnTerminationReason } from "./lifecycle-
|
|
2
|
-
import {
|
|
3
|
-
import { a as SurveyAssistantThreadDocumentRepository } from "./thread-documents-
|
|
4
|
-
import { a as SurveyAssistantModelSelection, i as SurveyAssistantIdentityContext } from "./constants-
|
|
1
|
+
import { p as SurveyAssistantTurnTerminationReason } from "./lifecycle-BmGAIUlv.mjs";
|
|
2
|
+
import { Gt as SurveyAssistantCapabilitySet } from "./index-D6nqkz0O.mjs";
|
|
3
|
+
import { a as SurveyAssistantThreadDocumentRepository } from "./thread-documents-rmd6nyX9.mjs";
|
|
4
|
+
import { a as SurveyAssistantModelSelection, i as SurveyAssistantIdentityContext } from "./constants-BMGTgfjv.mjs";
|
|
5
5
|
import { UIMessage } from "ai";
|
|
6
6
|
import { AgentExecutionOptions } from "@mastra/core/agent";
|
|
7
7
|
import { Mastra } from "@mastra/core/mastra";
|
|
@@ -109,8 +109,14 @@ interface SurveyAssistantThreadIdentity {
|
|
|
109
109
|
}
|
|
110
110
|
interface CreateSurveyAssistantThreadHandlersOptions {
|
|
111
111
|
authorize(request: Request): SurveyAssistantThreadIdentity | Promise<SurveyAssistantThreadIdentity>;
|
|
112
|
+
onError?(error: unknown, context: SurveyAssistantThreadErrorContext): void;
|
|
112
113
|
repository: SurveyAssistantThreadRepository;
|
|
113
114
|
}
|
|
115
|
+
interface SurveyAssistantThreadErrorContext {
|
|
116
|
+
operation: "create" | "delete" | "list" | "read" | "update";
|
|
117
|
+
request: Request;
|
|
118
|
+
threadId?: string;
|
|
119
|
+
}
|
|
114
120
|
interface SurveyAssistantStoredThread {
|
|
115
121
|
id: string;
|
|
116
122
|
title?: string;
|
|
@@ -145,6 +151,7 @@ interface SurveyAssistantThreadRepository {
|
|
|
145
151
|
}
|
|
146
152
|
declare const createSurveyAssistantThreadHandlers: ({
|
|
147
153
|
authorize,
|
|
154
|
+
onError,
|
|
148
155
|
repository
|
|
149
156
|
}: CreateSurveyAssistantThreadHandlersOptions) => {
|
|
150
157
|
create: (request: Request) => Promise<Response>;
|
|
@@ -154,5 +161,5 @@ declare const createSurveyAssistantThreadHandlers: ({
|
|
|
154
161
|
update: (request: Request, threadId: string) => Promise<Response>;
|
|
155
162
|
};
|
|
156
163
|
//#endregion
|
|
157
|
-
export {
|
|
158
|
-
//# sourceMappingURL=thread-handlers-
|
|
164
|
+
export { readSurveyAssistantRequestJson as A, SURVEY_ASSISTANT_MAX_ATTACHMENT_NAME_CHARS as C, SURVEY_ASSISTANT_MAX_TOTAL_ATTACHMENT_BYTES as D, SURVEY_ASSISTANT_MAX_TEXT_PART_CHARS as E, SurveyAssistantRequestError as O, SURVEY_ASSISTANT_MAX_ATTACHMENT_BYTES as S, SURVEY_ASSISTANT_MAX_REQUEST_BYTES as T, describeSurveyAssistantStreamError as _, SurveyAssistantThreadRepository as a, SURVEY_ASSISTANT_DEFAULT_REQUEST_LIMITS as b, SurveyAssistantAuthorizationInput as c, SurveyAssistantChatHandlerOptions as d, SurveyAssistantModelResolutionInput as f, createSurveyAssistantChatHandler as g, SurveyAssistantTurnMetrics as h, SurveyAssistantThreadIdentity as i, validateSurveyAssistantMessages as j, SurveyAssistantRequestLimits as k, SurveyAssistantAuthorize as l, SurveyAssistantStreamErrorContext as m, SurveyAssistantStoredThread as n, createSurveyAssistantThreadHandlers as o, SurveyAssistantResolveModel as p, SurveyAssistantThreadErrorContext as r, SurveyAssistantAuthorizationError as s, CreateSurveyAssistantThreadHandlersOptions as t, SurveyAssistantAuthorizedIdentity as u, formatSurveyAssistantStreamError as v, SURVEY_ASSISTANT_MAX_MESSAGES as w, SURVEY_ASSISTANT_MAX_ATTACHMENTS as x, SURVEY_ASSISTANT_ACCEPTED_ATTACHMENT_TYPES as y };
|
|
165
|
+
//# sourceMappingURL=thread-handlers-AbQbt4sX.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"thread-handlers-
|
|
1
|
+
{"version":3,"file":"thread-handlers-AbQbt4sX.d.mts","names":[],"sources":["../src/server/request-guardrails.ts","../src/server/handler.ts","../src/server/thread-handlers.ts"],"mappings":";;;;;;;;;cAGa,kCAAA;AAAA,cACA,6BAAA;AAAA,cACA,gCAAA;AAAA,cACA,qCAAA;AAAA,cACA,2CAAA;AAAA,cACA,oCAAA;AAAA,cACA,0CAAA;AAAA,cAEA,0CAAA,EAA0C,GAAA;AAAA,UAItC,4BAAA;EACf,uBAAA,EAAyB,WAAA;EACzB,kBAAA;EACA,sBAAA;EACA,cAAA;EACA,WAAA;EACA,eAAA;EACA,gBAAA;EACA,uBAAA;AAAA;AAAA,cAGW,uCAAA,EAAyC,4BAAA;AAAA,cAWzC,2BAAA,SAAoC,KAAA;EAAA,SACtC,MAAA;cAEG,OAAA,UAAiB,MAAA;AAAA;AAAA,cA8ClB,+BAAA,GACX,KAAA,WACA,MAAA,GAAQ,4BAAA,KACP,SAAA;AAAA,cAmFU,8BAAA,GACX,OAAA,EAAS,OAAA,EACT,eAAA,cACC,OAAA;;;KCvHE,eAAA,GAAkB,qBAAA;AAAA,UAeN,iCAAA;EACf,OAAA,EAAS,OAAA;EACT,mBAAA;EACA,iBAAA;EACA,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EAAA;AAAA,GAIjD,0CAAA;oBAyB8B,OAAA,KAAO,OAAA,CAAA,QAAA;oBAoFD,OAAA,EAAO,QAAA,aAAkB,OAAA,CAAA,QAAA;kBA5GjC,OAAA,KAAO,OAAA,CAAA,QAAA;kBA+CP,OAAA,EAAO,QAAA,aAAkB,OAAA,CAAA,QAAA;oBAmBvB,OAAA,EAAO,QAAA,aAAkB,OAAA,CAAA,QAAA;AAAA"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { X as SURVEY_OPERATION_KINDS, bt as surveyOperationSchemasByKind, f as surveyChangeSetSchema, q as assistantItemTypeManifestSchema, yt as surveyOperationSchema } from "./protocol-DJUP4gc0.mjs";
|
|
2
|
-
import { d as getDeterministicCreateItemTypes, f as inspectAssistantItem, p as resolveAssistantCapabilityReference } from "./form-authoring-
|
|
3
|
-
import { A as
|
|
4
|
-
import { r as getSurveyAssistantEngineContext, s as requireSurveyAssistantTurnState } from "./request-context-
|
|
5
|
-
import {
|
|
2
|
+
import { d as getDeterministicCreateItemTypes, f as inspectAssistantItem, p as resolveAssistantCapabilityReference } from "./form-authoring-kQDgC5oz.mjs";
|
|
3
|
+
import { A as getKeyIndexEntries, F as itemSummarySchema, G as summarizeKeyIndexEntries, H as sliceWithCursor, I as mapKeyIndexById, J as summarizeRawItem, L as mapOutlineById, M as getRawSurveyItems, N as itemConfigDetailsSchema, P as itemMatchesQuery, R as mapRawItemsById, T as findDirectChildrenByFullKey, U as summarizeFocusItemNode, V as resolveItemSummary, W as summarizeItemById, X as unique, Y as translationEntrySchema, Z as analyzeSurveyAssistantExpressionReferences, b as buildItemConfigDetails, f as normalizeSurveyChangeOperations, i as auditSurvey, j as getRawSurvey, l as createSurveyChangeSet, m as expressionMutationSchema, p as buildExpressionMutationPatches, q as summarizeOutlineNode, v as buildConfigSearchText, w as clampLimit, x as buildItemTranslationEntries, y as buildEmbeddedFormDetails, z as normalizeText } from "./engine-CQwOAcwK.mjs";
|
|
4
|
+
import { r as getSurveyAssistantEngineContext, s as requireSurveyAssistantTurnState } from "./request-context-BjTHNcDd.mjs";
|
|
5
|
+
import { a as surveyAuthoringReferences, i as surveyAuthoringReferenceTopics, r as getBuiltInItemTypeAuthoringReference, t as builtInSurveyAuthoringItemTypes } from "./authoring-references-CW38pYzK.mjs";
|
|
6
6
|
import { z } from "zod";
|
|
7
7
|
import { JsonPatchError, SURVEY_EDITOR_ITEM_COLORS, encodeJsonPointerSegment, getAssetUsagesFromContent, getContentPlainText, getValueAtJsonPointer } from "@case-framework/survey-core";
|
|
8
8
|
import { randomUUID } from "node:crypto";
|
|
@@ -683,6 +683,8 @@ const surveyExpressionTool = createTool({
|
|
|
683
683
|
};
|
|
684
684
|
const event = turnDraft.stage({
|
|
685
685
|
addressedTargets,
|
|
686
|
+
allowExpressionJsonPatches: true,
|
|
687
|
+
handledMutationRoutes: ["expression"],
|
|
686
688
|
operations: [operation],
|
|
687
689
|
snapshot,
|
|
688
690
|
summary: prepareInput.summary
|
|
@@ -2156,6 +2158,8 @@ const inputSchema$1 = z.object({
|
|
|
2156
2158
|
sourceLocale: z.string().min(1).optional().describe("Locale treated as the source when checking translation completeness."),
|
|
2157
2159
|
targetLocales: z.array(z.string().min(1)).max(20).optional(),
|
|
2158
2160
|
maxFindings: z.number().int().min(1).max(300).default(120).optional(),
|
|
2161
|
+
keyReviewOffset: z.number().int().nonnegative().default(0).optional().describe("Zero-based offset for the qualitative key/content review evidence."),
|
|
2162
|
+
keyReviewLimit: z.number().int().min(1).max(50).default(30).optional().describe("Number of item, choice-option, and form-field key/content pairs to return."),
|
|
2159
2163
|
reason: z.string().max(500).optional()
|
|
2160
2164
|
});
|
|
2161
2165
|
const outputSchema = z.object({
|
|
@@ -2203,13 +2207,17 @@ const formatAuditForModel = (output) => {
|
|
|
2203
2207
|
return `- ${finding.code}${location ? ` (${location})` : ""}: ${previewAuditMessage(finding.message)}`;
|
|
2204
2208
|
}).join("\n")}` : void 0,
|
|
2205
2209
|
report.qualityReviewPrinciples.length > 0 ? `Qualitative review rubric:\n${report.qualityReviewPrinciples.map((principle) => `- ${principle.id}: ${principle.prompt}`).join("\n")}` : void 0,
|
|
2210
|
+
report.keyReview.entries.length > 0 ? `Key/content review evidence (${report.keyReview.offset + 1}-${report.keyReview.offset + report.keyReview.returnedEntryCount} of ${report.keyReview.entryCount}, source locale ${report.keyReview.sourceLocale ?? "unavailable"}${report.keyReview.truncated ? "; more pages available" : ""}):\n${report.keyReview.entries.map((entry) => {
|
|
2211
|
+
const content = entry.content ? `; current content=${JSON.stringify(previewAuditMessage(entry.content))}` : "; current content unavailable";
|
|
2212
|
+
return `- ${entry.kind} item=${entry.itemId} itemKey=${JSON.stringify(entry.itemKey)} key=${JSON.stringify(entry.key)} (${entry.keySource})${entry.contentKey ? ` contentKey=${entry.contentKey}` : ""}${content}`;
|
|
2213
|
+
}).join("\n")}\n${report.keyReview.note}` : `Key/content review evidence: none returned (${report.keyReview.entryCount} total entries).`,
|
|
2206
2214
|
report.note,
|
|
2207
2215
|
"This audit checks the current survey deterministically. It does not compare the draft with an attached source document, so a clean audit does not establish source fidelity or completeness."
|
|
2208
2216
|
].filter((line) => Boolean(line)).join("\n\n");
|
|
2209
2217
|
};
|
|
2210
2218
|
const surveyAuditTool = createTool({
|
|
2211
2219
|
id: TOOL_ID$1,
|
|
2212
|
-
description: "Audit the current survey for deterministic structural, content, localization, expression-reference, response, and asset issues, and return a
|
|
2220
|
+
description: "Audit the current survey for deterministic structural, content, localization, expression-reference, response, and asset issues, and return a questionnaire-quality rubric plus paged key/content evidence for qualitative consistency review. This is read-only and is not psychometric validation.",
|
|
2213
2221
|
inputSchema: inputSchema$1,
|
|
2214
2222
|
outputSchema,
|
|
2215
2223
|
mcp: { annotations: {
|
|
@@ -2434,4 +2442,4 @@ const surveyAssistantTools = Object.freeze({
|
|
|
2434
2442
|
//#endregion
|
|
2435
2443
|
export { surveyAuditTool as i, surveyAssistantTools as n, surveyAssetTool as r, SURVEY_ASSISTANT_TOOL_IDS as t };
|
|
2436
2444
|
|
|
2437
|
-
//# sourceMappingURL=tools-
|
|
2445
|
+
//# sourceMappingURL=tools-CFh35R4d.mjs.map
|