@sendevia/pi-ask-author 1.1.0 → 1.1.1
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 +1 -0
- package/dist/component.d.ts +54 -2
- package/dist/expansion.d.ts +52 -0
- package/dist/i18n.d.ts +1 -1
- package/dist/index.d.ts +7 -5
- package/dist/index.js +1 -1
- package/dist/layout.d.ts +3 -3
- package/dist/llm-texts.d.ts +74 -23
- package/dist/model.d.ts +113 -4
- package/dist/sanitize.d.ts +17 -2
- package/dist/schema.d.ts +46 -1
- package/dist/texts.d.ts +62 -22
- package/dist/view-question.d.ts +2 -0
- package/dist/view-rows.d.ts +10 -1
- package/lang/en_US.json +12 -3
- package/lang/ja_JP.json +156 -0
- package/lang/ko_KR.json +156 -0
- package/lang/zh_CN.json +10 -4
- package/package.json +1 -1
package/dist/llm-texts.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @file llm-texts.ts
|
|
3
|
-
* @description 面向大语言模型的协议文案:工具元数据、TypeBox
|
|
3
|
+
* @description 面向大语言模型的协议文案:工具元数据、TypeBox 字段描述、实时推演系统提示词与返回封套模板
|
|
4
4
|
*
|
|
5
5
|
* 核心架构特性:
|
|
6
6
|
* - 全部文案恒为英文,不参与语言切换,保证封套与工具声明的前缀缓存稳定
|
|
@@ -16,14 +16,14 @@ export declare const LLM_TEXTS: {
|
|
|
16
16
|
/** 工具调用名(LLM 协议标识,注册为 `ask_author`;不出现在作者界面) */
|
|
17
17
|
readonly name: "ask_author";
|
|
18
18
|
/** 工具说明(LLM 端英文;一句话能力概要与适用场景) */
|
|
19
|
-
readonly description: "Ask the author to
|
|
19
|
+
readonly description: "Ask the author to decide between concrete narrative options in an interactive terminal form. Handles a single question or a batch, optional draft previews, author notes, conditional questions, and live follow-up questions generated while the author answers.";
|
|
20
20
|
/** `Available tools` 区块单行条目(LLM 端英文;动词引导,无句末标点,缺省则工具不进入该区块) */
|
|
21
|
-
readonly promptSnippet: "Ask the author to
|
|
21
|
+
readonly promptSnippet: "Ask the author to pick narrative directions in a terminal form";
|
|
22
22
|
/**
|
|
23
23
|
* `Guidelines` 区块附加条目(LLM 端英文;分类标签前缀 + 行为要求)
|
|
24
24
|
* 约定:宿主把条目扁平追加进 `Guidelines` 且不加工具名前缀,故每条首词必须显式点名 `ask_author`
|
|
25
25
|
*/
|
|
26
|
-
readonly promptGuidelines: readonly ["ask_author:
|
|
26
|
+
readonly promptGuidelines: readonly ["ask_author: Use it when the author must choose a plot branch, character action, scene direction, or setting; do not ask the same question in chat first.", "ask_author: Prefer one call over several: flat mode (formTitle + question + options) for a single decision, the questions array for related decisions.", "ask_author: Write option labels as concrete actions, put consequences in description, and add preview only when a Markdown draft or storyboard helps the choice.", "ask_author: Give a short formTitle and a tabLabel for every long question title; omit fields that use defaults.", "ask_author: Add a question id only when a showIf or expansion.insert.after refers to it; showIf may only point at an earlier question's option label or answered.", 'ask_author: Pass expansion when follow-up decisions depend on the answers: declare only the first question and let the same model add questions and options on each confirmation; expansion.insert picks "follow" (default), "tail", or {"after":"question_id"}.', "ask_author: The author can multi-select, add notes, and edit drafts; confirmed drafts return as [Draft directive: ...] lines. Treat [Author Decision Cancelled] as no decision, and [Author Consultation Error] as a request to fix the arguments once."];
|
|
27
27
|
};
|
|
28
28
|
/** LLM 端 TypeBox 字段描述字典(单句浓缩英文,仅声明语义、必要性与省略规则;数量约束来自 {@link MAX_OPTIONS} / {@link MAX_QUESTIONS} 插值) */
|
|
29
29
|
readonly schema: {
|
|
@@ -32,53 +32,98 @@ export declare const LLM_TEXTS: {
|
|
|
32
32
|
/** 选项情节推演(可选;作者端渲染为「情节设定推演」预览面板) */
|
|
33
33
|
readonly optionDesc: "Consequences or rationale (optional)";
|
|
34
34
|
/** 选项草稿预览(可选;作者端渲染为「正文草稿/分镜头试撰写」预览面板) */
|
|
35
|
-
readonly optionPreview: "Markdown draft or storyboard
|
|
35
|
+
readonly optionPreview: "Markdown draft or storyboard for this option (optional)";
|
|
36
36
|
/** 选项批注占位符(可选;作者端作为选项补充说明编辑器的输入框占位文本) */
|
|
37
|
-
readonly optionCustomPlaceholder: "Placeholder for the
|
|
37
|
+
readonly optionCustomPlaceholder: "Placeholder for the author's note on this option (optional)";
|
|
38
38
|
/** 选项显示条件(可选;条件不成立时该选项不展示) */
|
|
39
|
-
readonly optionShowIf: "Show only
|
|
40
|
-
/** 题目 ID(可选;仅在后续 showIf 引用时需要) */
|
|
41
|
-
readonly questionId: "
|
|
39
|
+
readonly optionShowIf: "Show only if an earlier answer matches; array means all must hold (optional)";
|
|
40
|
+
/** 题目 ID(可选;仅在后续 showIf 或 `expansion.insert.after` 引用时需要) */
|
|
41
|
+
readonly questionId: "Id referenced by showIf and expansion.insert.after (optional)";
|
|
42
42
|
/** 题目标题(必须填写;作者端呈现为题头与总览页条目) */
|
|
43
43
|
readonly questionTitle: "Question text";
|
|
44
44
|
/** Tab 栏短标签(可选;缺省时 Tab 栏显示 `Q<序号>`,显式给出可让作者在一屏内区分多题) */
|
|
45
|
-
readonly questionTabLabel: "Short
|
|
45
|
+
readonly questionTabLabel: "Short tab label (default: Q<index>)";
|
|
46
46
|
/** 题目背景说明(可选;作者端呈现为题头下方的上下文行) */
|
|
47
|
-
readonly questionDesc: "Context
|
|
47
|
+
readonly questionDesc: "Context shown under the question (optional)";
|
|
48
48
|
/** 多选开关(可选;默认 false,开启后作者端展示多选模式标签与方框勾选指示符) */
|
|
49
49
|
readonly questionMultiSelect: "Allow multiple selections (default false)";
|
|
50
50
|
/** 最小勾选数(可选;默认 1,仅多选生效,作者端据此标注强制下限) */
|
|
51
|
-
readonly questionMinSelect: "Minimum selections (default 1)";
|
|
51
|
+
readonly questionMinSelect: "Minimum selections, multi-select only (default 1)";
|
|
52
52
|
/** 最大勾选数(可选;默认全部选项,仅多选生效,小于选项总数时作者端追加上限标注) */
|
|
53
|
-
readonly questionMaxSelect: "Maximum selections (default: all options)";
|
|
54
|
-
/** 零勾选提交开关(可选;默认 false
|
|
55
|
-
readonly questionAllowEmpty: "Allow submitting
|
|
53
|
+
readonly questionMaxSelect: "Maximum selections, multi-select only (default: all options)";
|
|
54
|
+
/** 零勾选提交开关(可选;默认 false,单选与多选均生效) */
|
|
55
|
+
readonly questionAllowEmpty: "Allow submitting without a selection (default false)";
|
|
56
56
|
/** 候选选项列表(必须填写;1~{@link MAX_OPTIONS} 项;建议 2~10 项) */
|
|
57
|
-
readonly questionOptions: "
|
|
57
|
+
readonly questionOptions: "Options (1-30, 2-10 recommended)";
|
|
58
58
|
/** 自由批注开关(可选;默认 true,开启后作者端可额外提交非选项文本) */
|
|
59
59
|
readonly questionAllowCustom: "Allow author notes (default true)";
|
|
60
60
|
/** 作者批注占位符(可选;作者端作为题目补充说明编辑器的输入框占位文本) */
|
|
61
|
-
readonly questionCustomPlaceholder: "Placeholder for the author note (optional)";
|
|
61
|
+
readonly questionCustomPlaceholder: "Placeholder for the author's note (optional)";
|
|
62
62
|
/** 题目显示条件(可选;条件不成立时该题不展示,也不计入答卷) */
|
|
63
|
-
readonly questionShowIf: "Show only
|
|
63
|
+
readonly questionShowIf: "Show only if an earlier answer matches; array means all must hold (optional)";
|
|
64
64
|
/** 显示条件引用的题目 ID(必须为本次表单中更早出现的题目) */
|
|
65
|
-
readonly conditionQuestionId: "
|
|
65
|
+
readonly conditionQuestionId: "Earlier question id";
|
|
66
66
|
/** 显示条件匹配的选项(引用题目的选项标签;作者选中该选项时条件成立) */
|
|
67
|
-
readonly conditionOption: "Option label that activates the condition";
|
|
67
|
+
readonly conditionOption: "Option label of that question that activates the condition";
|
|
68
68
|
/** 显示条件的作答存在性(缺省等价于 true;与 option 同时给出时忽略) */
|
|
69
|
-
readonly conditionAnswered: "
|
|
69
|
+
readonly conditionAnswered: "Any answer (default true) or no answer (false); ignored when option is set";
|
|
70
70
|
/** 问卷标题(必须填写;作者端呈现为卡片标题与总览页标题) */
|
|
71
71
|
readonly formTitle: "Short title for the consultation";
|
|
72
72
|
/** 问卷背景(可选;作者端呈现为问卷级上下文) */
|
|
73
73
|
readonly formDesc: "Overall context (optional)";
|
|
74
74
|
/** 批量模式题目数组(可选;1~{@link MAX_QUESTIONS} 题;与平铺单题模式互斥) */
|
|
75
|
-
readonly formQuestions: "
|
|
75
|
+
readonly formQuestions: "Questions (1-20); batch related decisions in one call";
|
|
76
76
|
/** 平铺模式的题目标题(可选;与批量模式的 `questionTitle` 同义) */
|
|
77
77
|
readonly formSingleQuestion: "Question for flat mode";
|
|
78
78
|
/** 平铺单题模式字段描述的统一区分前缀(LLM 端英文,`schema.ts` 逐字段拼接) */
|
|
79
79
|
readonly flatPrefix: "(Flat single-question mode only) ";
|
|
80
80
|
/** 平铺模式候选选项列表(可选;1~{@link MAX_OPTIONS} 项;建议 2~10 项) */
|
|
81
81
|
readonly flatQuestionOptions: "Options for flat mode (1-30, 2-10 recommended)";
|
|
82
|
+
/** 实时推演开关(可选;开启后作者确认答案时由同一模型追加题目与选项) */
|
|
83
|
+
readonly expansion: "Generate follow-up questions and options while the author answers; insert controls where they land (optional)";
|
|
84
|
+
/** 推演题目总量上限(可选;缺省为全部可用题目数) */
|
|
85
|
+
readonly expansionMaxQuestions: "Question cap including declared ones (default 20)";
|
|
86
|
+
/** 推演方向指示(可选;作为长期要求传给推演模型) */
|
|
87
|
+
readonly expansionGuidance: "Standing hint for what the expansion should probe (optional)";
|
|
88
|
+
/** 推演题目插入位置(三选一预设) */
|
|
89
|
+
readonly expansionInsert: '"follow" (default, after the answered question), "tail" (end of the form), or {"after":"question_id"} (optional)';
|
|
90
|
+
/** 自定义插入位置的锚点题目 ID */
|
|
91
|
+
readonly expansionInsertAfter: "Declared question id to insert after";
|
|
92
|
+
};
|
|
93
|
+
/**
|
|
94
|
+
* 实时推演协议(作者确认答案后由同一模型追加题目与选项;全英文,输出约束为纯 JSON)
|
|
95
|
+
*/
|
|
96
|
+
readonly expansion: {
|
|
97
|
+
/** 推演系统提示词(约束输出结构与新增范围,禁止复述既有内容) */
|
|
98
|
+
readonly systemPrompt: `You extend an interactive author decision form while the author answers it.
|
|
99
|
+
|
|
100
|
+
Input JSON: formTitle, formDescription, guidance, insert, maxAdditionalQuestions, questions (with ids), answers (selected labels and notes).
|
|
101
|
+
|
|
102
|
+
Return JSON only:
|
|
103
|
+
{"questions":[{"id":"unique_id","title":"...","description":"...","options":[{"label":"...","description":"..."}]}],"options":[{"questionId":"existing_id","options":[{"label":"..."}]}]}
|
|
104
|
+
|
|
105
|
+
Rules:
|
|
106
|
+
- Add at most maxAdditionalQuestions questions; fewer is better.
|
|
107
|
+
- New questions may also set multiSelect, minSelect, maxSelect, allowEmpty; every option needs a label.
|
|
108
|
+
- Add options to a declared question only when the answers reveal a choice it cannot express; use its id and unused labels.
|
|
109
|
+
- Give new questions unique ids and 2-6 concrete options; put consequences in description.
|
|
110
|
+
- Never repeat a declared question or a declared label.
|
|
111
|
+
- showIf takes {"questionId":"id","option":"label"} or {"questionId":"id","answered":true} and may only reference a question above the insertion point or one of your earlier new questions.
|
|
112
|
+
- Reply {"questions":[],"options":[]} when the answers already determine the next step.
|
|
113
|
+
- No prose, no code fences, no trailing commas.`;
|
|
114
|
+
/** 推演用户消息前缀(英文单行,后接 JSON 载荷) */
|
|
115
|
+
readonly userPreamble: "Extend this author decision form. Input JSON:";
|
|
116
|
+
/** 推演失败诊断(英文短句;作者界面经 `status.expansionFailed` 呈现,不直接展示原文) */
|
|
117
|
+
readonly errors: {
|
|
118
|
+
/** 当前会话没有可用模型 */
|
|
119
|
+
readonly noModel: "no model is available for live expansion";
|
|
120
|
+
/** 推演请求被中止 */
|
|
121
|
+
readonly aborted: "live expansion was aborted";
|
|
122
|
+
/** 供应商返回错误终止 */
|
|
123
|
+
readonly providerFailed: "the expansion request failed";
|
|
124
|
+
/** 回复不是可解析的 JSON 对象 */
|
|
125
|
+
readonly invalidReply: "the expansion reply was not a JSON object";
|
|
126
|
+
};
|
|
82
127
|
};
|
|
83
128
|
/**
|
|
84
129
|
* LLM 端返回封套与纠正指令模板(全英文确定性结构,提升 Prompt Cache 命中率)
|
|
@@ -109,6 +154,8 @@ export declare const LLM_TEXTS: {
|
|
|
109
154
|
readonly runtimeError: (details: string) => string;
|
|
110
155
|
/** 自适应条件引用无效(对应作者端 `status.errorInvalidCondition`) */
|
|
111
156
|
readonly invalidCondition: (details: string) => string;
|
|
157
|
+
/** 请求了实时推演但当前会话没有可用模型 */
|
|
158
|
+
readonly expansionUnavailable: "Live expansion was requested but no model is available in this session.";
|
|
112
159
|
};
|
|
113
160
|
/** 错误封套纠正指引行字典(英文单句,与 `errorReasons` 一一对应) */
|
|
114
161
|
readonly errorGuidances: {
|
|
@@ -119,7 +166,9 @@ export declare const LLM_TEXTS: {
|
|
|
119
166
|
/** `runtimeError` 的纠正指引 */
|
|
120
167
|
readonly runtimeError: "Check the arguments and retry with valid questions and options.";
|
|
121
168
|
/** `invalidCondition` 的纠正指引 */
|
|
122
|
-
readonly invalidCondition: "Reference an earlier question id plus one of its option labels, or
|
|
169
|
+
readonly invalidCondition: "Reference an earlier question id plus one of its option labels, use answered, or point expansion.insert.after at a declared question id.";
|
|
170
|
+
/** `expansionUnavailable` 的纠正指引 */
|
|
171
|
+
readonly expansionUnavailable: "Drop the expansion field and declare the questions directly, or retry in a session with a model selected.";
|
|
123
172
|
};
|
|
124
173
|
/** 自适应条件引用校验的英文诊断消息(拼入错误封套原因行) */
|
|
125
174
|
readonly adaptiveErrors: {
|
|
@@ -129,6 +178,8 @@ export declare const LLM_TEXTS: {
|
|
|
129
178
|
readonly forwardQuestion: (questionId: string) => string;
|
|
130
179
|
/** 条件引用的选项标签在目标题目中不存在 */
|
|
131
180
|
readonly unknownOption: (questionId: string, option: string) => string;
|
|
181
|
+
/** 推演插入锚点引用的题目 ID 不存在 */
|
|
182
|
+
readonly unknownInsertAnchor: (questionId: string) => string;
|
|
132
183
|
};
|
|
133
184
|
/** 空答卷封套正文(作者未作答时的英文处置指令,位于首尾标识之间) */
|
|
134
185
|
readonly envelopeEmpty: "The author submitted no answers. Use your defaults, or ask a follow-up if the decision is crucial.";
|
package/dist/model.d.ts
CHANGED
|
@@ -9,10 +9,11 @@
|
|
|
9
9
|
* - 封套语言单一:自动生成的占位题目/标签在封套编译期替换为英文占位(`Question N` / `Option N`),作者界面保留中文占位
|
|
10
10
|
* - 答卷完整性:显示中的题目即使显式跳过或仅批注提交也产出条目,多选题目恒产出条目,不存在静默消失的作答
|
|
11
11
|
* - 自适应显隐:题目与选项可声明 `showIf` 条件且仅允许引用更早题目;显隐快照按 `revision` 缓存,隐藏项的选择不计入作答与答卷
|
|
12
|
+
* - 实时推演:`pushExpansion` 按 `expansion.insert` 把新题目插到跟随位、队尾或自定义锚点之后,把新选项追加到目标题目末尾,插入与撤回都会平移后续题目的条件、作答状态与推演记录索引
|
|
12
13
|
*
|
|
13
|
-
* 依赖方向:model.ts → format.ts / schema.ts / texts.ts
|
|
14
|
+
* 依赖方向:model.ts → format.ts / layout.ts / schema.ts / texts.ts(纯函数工具、上限常量、Schema 单一类型源与文案字典,无回边);不引用 `Theme` 与 TUI 组件,渲染细节全部上移组件层
|
|
14
15
|
*/
|
|
15
|
-
import type { QuestionOption, RawParams } from "./schema.js";
|
|
16
|
+
import type { ExpansionPayload, InsertPosition, QuestionOption, RawParams } from "./schema.js";
|
|
16
17
|
/**
|
|
17
18
|
* 显示条件的归一化形态:引用的题目索引与选项索引均已解析
|
|
18
19
|
* - `option`:指定题目中某个选项当前处于选中状态
|
|
@@ -150,6 +151,22 @@ export interface MenuItem {
|
|
|
150
151
|
}
|
|
151
152
|
/** 勾选 toggle 操作语义(三个操作语义类型均不导出,由组件层消费并映射为状态栏提示) */
|
|
152
153
|
type ToggleResult = "selected" | "deselected" | "limit";
|
|
154
|
+
/** 一次推演追加的记录,作为撤回的最小单元 */
|
|
155
|
+
export interface ExpansionRecord {
|
|
156
|
+
/** 触发推演的题目索引(0-based) */
|
|
157
|
+
readonly questionIndex: number;
|
|
158
|
+
/** 触发时该题的答案签名(选中项标签按序拼接) */
|
|
159
|
+
readonly signature: string;
|
|
160
|
+
/** 追加题目在题目列表中的起始位置(即触发题目的下一题) */
|
|
161
|
+
readonly insertAt: number;
|
|
162
|
+
/** 本次插入的题目数 */
|
|
163
|
+
readonly addedQuestions: number;
|
|
164
|
+
/** 本次向既有题目追加的选项 */
|
|
165
|
+
readonly addedOptions: readonly {
|
|
166
|
+
readonly questionIndex: number;
|
|
167
|
+
readonly count: number;
|
|
168
|
+
}[];
|
|
169
|
+
}
|
|
153
170
|
/** 全选/清空操作语义 */
|
|
154
171
|
type SelectAllResult = "cleared" | "filled";
|
|
155
172
|
/** 批注保存操作语义 */
|
|
@@ -169,8 +186,14 @@ export declare class AskAuthorFormModel {
|
|
|
169
186
|
readonly formTitle: string;
|
|
170
187
|
/** 问卷全局背景阐述(可选) */
|
|
171
188
|
readonly formDescription?: string;
|
|
172
|
-
/**
|
|
173
|
-
readonly
|
|
189
|
+
/** 推演允许的题目总量上限(含初始题目) */
|
|
190
|
+
readonly expansionMaxQuestions: number;
|
|
191
|
+
/** 推演题目的插入位置预设(缺省为跟随触发题目) */
|
|
192
|
+
readonly expansionInsert: InsertPosition;
|
|
193
|
+
/** 归一化后的题目列表(推演会向末尾追加,外部只读) */
|
|
194
|
+
private readonly questionList;
|
|
195
|
+
/** 推演追加记录栈(按追加顺序;撤回时从栈顶开始) */
|
|
196
|
+
private readonly expansions;
|
|
174
197
|
/** 作答状态版本号:单调递增,作为组件层派生缓存的失效键 */
|
|
175
198
|
private revisionValue;
|
|
176
199
|
/** 各题作答状态映射(题目索引 0-based) */
|
|
@@ -182,6 +205,10 @@ export declare class AskAuthorFormModel {
|
|
|
182
205
|
* @param rawParams - 经 prepareArguments 规整的入参;`questions` 缺省或为空数组时回退单题平铺模式,`options` 亦为空则题目列表为空
|
|
183
206
|
*/
|
|
184
207
|
constructor(rawParams: RawParams);
|
|
208
|
+
/** 归一化后的题目列表(推演会插入新题目,调用方只读) */
|
|
209
|
+
get questions(): NormalizedQuestion[];
|
|
210
|
+
/** 推演题目插入位置的可读描述(供推演模型判定哪些题目位于插入点之前) */
|
|
211
|
+
get expansionInsertLabel(): string;
|
|
185
212
|
/** 当前作答状态版本号(组件层派生缓存失效键) */
|
|
186
213
|
get revision(): number;
|
|
187
214
|
/** 问卷题目总数 */
|
|
@@ -252,6 +279,88 @@ export declare class AskAuthorFormModel {
|
|
|
252
279
|
getSelectedIndex(qIndex: number): number | undefined;
|
|
253
280
|
/** 推进作答状态版本号(全部 mutation 方法的统一出口) */
|
|
254
281
|
private bumpRevision;
|
|
282
|
+
/**
|
|
283
|
+
* 获取推演追加记录快照
|
|
284
|
+
* @returns 按追加顺序排列的新数组(调用方可安全持有)
|
|
285
|
+
*/
|
|
286
|
+
getExpansions(): readonly ExpansionRecord[];
|
|
287
|
+
/**
|
|
288
|
+
* 计算指定题目的答案签名(判断该题推演结果是否仍然有效)
|
|
289
|
+
* @param qIndex - 题目顺序索引(0-based)
|
|
290
|
+
* @returns 可见选中项标签按索引升序以 `|` 拼接的签名;未作答或题目越界时为 undefined
|
|
291
|
+
*/
|
|
292
|
+
answerSignature(qIndex: number): string | undefined;
|
|
293
|
+
/**
|
|
294
|
+
* 计算推演题目的插入位置
|
|
295
|
+
* @param insert - 插入位置预设(跟随触发题目 / 队尾 / 指定题目之后)
|
|
296
|
+
* @param triggerIndex - 触发推演的题目索引(0-based,仅 `follow` 使用)
|
|
297
|
+
* @returns 插入位置(0-based;`questionList.length` 表示队尾)
|
|
298
|
+
* @throws AdaptiveConditionError 自定义锚点引用的题目不存在时抛出
|
|
299
|
+
*/
|
|
300
|
+
private resolveInsertIndex;
|
|
301
|
+
/**
|
|
302
|
+
* 写入一次推演结果(新题目按 {@link expansionInsert} 指定的位置插入,新选项追加到目标题目的选项末尾)
|
|
303
|
+
* @param input - 记录元数据与推演载荷;超出 {@link expansionMaxQuestions} 的新题目被截断
|
|
304
|
+
* @returns 本次追加记录(无实际追加时计数均为 0,记录仍入栈以标记该答案已推演)
|
|
305
|
+
* @throws AdaptiveConditionError 追加内容的条件引用未知题目、后置题目或不存在的选项时抛出(本次追加整体不生效)
|
|
306
|
+
*/
|
|
307
|
+
pushExpansion(input: {
|
|
308
|
+
questionIndex: number;
|
|
309
|
+
signature: string;
|
|
310
|
+
payload: ExpansionPayload;
|
|
311
|
+
}): ExpansionRecord;
|
|
312
|
+
/**
|
|
313
|
+
* 撤回指定题目及其后续题目的推演结果(作者改动答案后调用)
|
|
314
|
+
* @param questionIndex - 起始题目索引(0-based);触发题目不早于该索引的记录全部撤回
|
|
315
|
+
* @returns 撤回的记录数;无记录被撤回时为 0(状态与 `revision` 均不变)
|
|
316
|
+
*/
|
|
317
|
+
retractFrom(questionIndex: number): number;
|
|
318
|
+
/**
|
|
319
|
+
* 判定指定题目在确认时是否会发起实时推演
|
|
320
|
+
* 条件:表单开启推演、该题可见、题目总数未达上限,且该题尚未用当前答案推演过
|
|
321
|
+
* @param qIndex - 题目顺序索引(0-based)
|
|
322
|
+
* @param enabled - 本表单是否开启推演(由组件层持有)
|
|
323
|
+
* @returns 确认本题将发起新的推演请求时为 true
|
|
324
|
+
*/
|
|
325
|
+
canExpandOnConfirm(qIndex: number, enabled: boolean): boolean;
|
|
326
|
+
/**
|
|
327
|
+
* 归一化并在指定位置插入新题目(全部条件先校验,任一非法项抛出时整个批次不生效)
|
|
328
|
+
* @param at - 插入位置(原有索引不小于该值的题目整体后移)
|
|
329
|
+
* @param raws - 推演给出的原始题目
|
|
330
|
+
* @returns 实际插入的题目数
|
|
331
|
+
*/
|
|
332
|
+
private insertQuestions;
|
|
333
|
+
/**
|
|
334
|
+
* 把索引不小于指定值的题目引用整体平移(插入或移除题目后维持既有条件、作答状态与推演记录的指向)
|
|
335
|
+
* @param from - 起始索引(0-based)
|
|
336
|
+
* @param delta - 位移量(插入为正、移除为负)
|
|
337
|
+
*/
|
|
338
|
+
private remapQuestionIndices;
|
|
339
|
+
/**
|
|
340
|
+
* 向既有题目追加选项(全部条件先校验,任一非法项抛出时整个批次不生效)
|
|
341
|
+
* @param additions - 按题目 ID 归集的追加选项
|
|
342
|
+
* @returns 每题实际追加的选项数
|
|
343
|
+
*/
|
|
344
|
+
private appendOptions;
|
|
345
|
+
/**
|
|
346
|
+
* 回滚单条推演记录(先回滚选项追加,再移除插入的题目块)
|
|
347
|
+
* @param record - 待回滚的推演记录
|
|
348
|
+
*/
|
|
349
|
+
private rollback;
|
|
350
|
+
/**
|
|
351
|
+
* 剪除被移除选项上的选中与批注状态
|
|
352
|
+
* @param questionIndex - 题目顺序索引(0-based)
|
|
353
|
+
* @param keptCount - 保留的选项数
|
|
354
|
+
*/
|
|
355
|
+
private dropOptionsFromState;
|
|
356
|
+
/**
|
|
357
|
+
* 生成不与既有题目重复的题目 ID
|
|
358
|
+
* @param id - 推演给出的原始 ID(可为自动占位)
|
|
359
|
+
* @param index - 题目顺序索引(0-based)
|
|
360
|
+
* @param used - 已占用的 ID 集合(就地更新)
|
|
361
|
+
* @returns 未占用的题目 ID
|
|
362
|
+
*/
|
|
363
|
+
private uniqueQuestionId;
|
|
255
364
|
/**
|
|
256
365
|
* 派生指定题目的左侧菜单项列表(预设选项 + 自由补充入口 + 确认推进按钮)
|
|
257
366
|
* 菜单项标签与确认按钮明细随当前作答状态派生:多选展示已选数/下限,单选展示已选项标签、自定义方案名或「未选」
|
package/dist/sanitize.d.ts
CHANGED
|
@@ -5,14 +5,29 @@
|
|
|
5
5
|
* 核心架构特性:
|
|
6
6
|
* - 容错范围:JSON 串包裹 / `raw` 包装键 / 字段别名 / 纯字符串选项 / 空选项兜底
|
|
7
7
|
* - 白名单收敛:产物仅含 `RawParams` 声明字段(丢弃未知键),保障宿主 Schema 校验通过
|
|
8
|
+
* - 推演载荷清洗:`sanitizeExpansionPayload` 丢弃引用未知题目的选项追加、重复标签、与既有 ID 冲突的新题目与无选项题目
|
|
8
9
|
* - 防御纵深:本层做类型收敛 / 别名映射 / 结构规整 / 区间兜底,模型层再幂等兜底一次
|
|
9
10
|
*
|
|
10
|
-
* 依赖方向:sanitize.ts → format.ts / texts.ts / schema.ts
|
|
11
|
+
* 依赖方向:sanitize.ts → format.ts / layout.ts / texts.ts / schema.ts(类型);被 index / expansion / tool-card 消费
|
|
11
12
|
*/
|
|
12
|
-
import type { RawParams } from "./schema.js";
|
|
13
|
+
import type { ExpansionPayload, RawParams } from "./schema.js";
|
|
13
14
|
/**
|
|
14
15
|
* 入参防御性清洗(`prepareArguments` 钩子);容错面见文件头,各字段先收敛为本地强类型 `const` 再组装为显式白名单产物
|
|
15
16
|
* @param args - 工具调用原始入参(不可信边界)
|
|
16
17
|
* @returns 仅含 Schema 声明字段的 `RawParams` 白名单对象;输入完全不可辨识时仅返回兜底 `formTitle`
|
|
17
18
|
*/
|
|
18
19
|
export declare function sanitizeAskAuthorArgs(args: unknown): RawParams;
|
|
20
|
+
/** 推演载荷的归集上下文:表单当前已声明的题目 ID 与各题已有选项标签 */
|
|
21
|
+
export interface ExpansionContext {
|
|
22
|
+
/** 已声明的题目 ID(按题目顺序) */
|
|
23
|
+
readonly questionIds: readonly string[];
|
|
24
|
+
/** 题目 ID → 已有选项标签 */
|
|
25
|
+
readonly optionLabels: ReadonlyMap<string, readonly string[]>;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* 规整推演模型的回复载荷(不可信边界):丢弃引用未知题目的选项追加、与既有标签重复的选项以及与既有题目 ID 冲突的新题目
|
|
29
|
+
* @param value - 已解析的回复对象(非对象时视为无新增)
|
|
30
|
+
* @param context - 表单当前已声明的题目与选项标签
|
|
31
|
+
* @returns 仅含合法追加项的推演载荷;全部条目被过滤时返回空载荷(表单停止增长)
|
|
32
|
+
*/
|
|
33
|
+
export declare function sanitizeExpansionPayload(value: unknown, context: ExpansionContext): ExpansionPayload;
|
package/dist/schema.d.ts
CHANGED
|
@@ -6,8 +6,9 @@
|
|
|
6
6
|
* - 字段名称、可选性与区间约束(`minItems` / `maxItems` / `minimum`)仅在 TypeBox 定义一次,运行时类型经 `Static<typeof>` 派生
|
|
7
7
|
* - 默认值不写入 Schema:题目内字段由 `sanitize.ts` 规整时填入(`multiSelect`→false、`allowCustom`→true),模型层再按同一语义兜底
|
|
8
8
|
* - LLM 端字段描述保持单句浓缩英文(取自 `TEXTS.schema`)
|
|
9
|
+
* - 推演载荷(`ExpansionPayload` / `OptionAddition`)的接口类型也在此声明,供 sanitize / model / expansion 共用
|
|
9
10
|
*
|
|
10
|
-
* 依赖方向:schema.ts → typebox / texts.ts(上限常量与字段描述);被 sanitize / model / index 消费
|
|
11
|
+
* 依赖方向:schema.ts → typebox / layout.ts / texts.ts(上限常量与字段描述);被 sanitize / model / expansion / index 消费
|
|
11
12
|
*/
|
|
12
13
|
import { Type, type Static } from "typebox";
|
|
13
14
|
/** 显示条件参数 Schema:引用更早题目的作答状态,决定本题或本选项是否出现 */
|
|
@@ -112,12 +113,38 @@ export declare const QuestionSchema: Type.TObject<{
|
|
|
112
113
|
answered: Type.TOptional<Type.TBoolean>;
|
|
113
114
|
}>>]>>;
|
|
114
115
|
}>;
|
|
116
|
+
/** 推演题目的插入位置预设:跟随触发题目 / 排到队尾 / 指定题目之后 */
|
|
117
|
+
export declare const InsertPositionSchema: Type.TUnion<[Type.TLiteral<"follow">, Type.TLiteral<"tail">, Type.TObject<{
|
|
118
|
+
after: Type.TString;
|
|
119
|
+
}>]>;
|
|
120
|
+
/** 实时推演参数 Schema:作者确认答案后由同一模型追加题目与选项 */
|
|
121
|
+
export declare const ExpansionSchema: Type.TObject<{
|
|
122
|
+
/** 推演后的题目总量上限(含已声明的题目) */
|
|
123
|
+
maxQuestions: Type.TOptional<Type.TInteger>;
|
|
124
|
+
/** 长期生效的推演方向指示 */
|
|
125
|
+
guidance: Type.TOptional<Type.TString>;
|
|
126
|
+
/** 推演题目的插入位置(缺省为跟随触发题目) */
|
|
127
|
+
insert: Type.TOptional<Type.TUnion<[Type.TLiteral<"follow">, Type.TLiteral<"tail">, Type.TObject<{
|
|
128
|
+
after: Type.TString;
|
|
129
|
+
}>]>>;
|
|
130
|
+
}>;
|
|
115
131
|
/** `ask_author` 工具完整参数 Schema(必须填写 `formTitle`;批量问卷传递 `questions`,单题平铺传递顶层 `question` + `options`) */
|
|
116
132
|
export declare const AskAuthorParams: Type.TObject<{
|
|
117
133
|
/** 问卷总任务标题(必须填写;简明概括请示主题) */
|
|
118
134
|
formTitle: Type.TString;
|
|
119
135
|
/** 问卷全局背景或前述情境(可选;平铺单题模式下同时充当该题描述) */
|
|
120
136
|
description: Type.TOptional<Type.TString>;
|
|
137
|
+
/** 实时推演开关(可选;开启后作者每次确认答案都追加后续题目与选项) */
|
|
138
|
+
expansion: Type.TOptional<Type.TObject<{
|
|
139
|
+
/** 推演后的题目总量上限(含已声明的题目) */
|
|
140
|
+
maxQuestions: Type.TOptional<Type.TInteger>;
|
|
141
|
+
/** 长期生效的推演方向指示 */
|
|
142
|
+
guidance: Type.TOptional<Type.TString>;
|
|
143
|
+
/** 推演题目的插入位置(缺省为跟随触发题目) */
|
|
144
|
+
insert: Type.TOptional<Type.TUnion<[Type.TLiteral<"follow">, Type.TLiteral<"tail">, Type.TObject<{
|
|
145
|
+
after: Type.TString;
|
|
146
|
+
}>]>>;
|
|
147
|
+
}>>;
|
|
121
148
|
/** 关联多题批量问卷列表(可选;批量模式使用,上限 `MAX_QUESTIONS` 题) */
|
|
122
149
|
questions: Type.TOptional<Type.TArray<Type.TObject<{
|
|
123
150
|
/** 题目唯一标识符(可选;缺省由模型层按顺序生成,跨题重复由模型层去重) */
|
|
@@ -239,3 +266,21 @@ export type QuestionInput = Static<typeof QuestionSchema>;
|
|
|
239
266
|
export type VisibilityConditionInput = Static<typeof ShowIfConditionSchema>;
|
|
240
267
|
/** `showIf` 字段的运行时类型:单个条件或条件数组 */
|
|
241
268
|
export type ShowIfInput = VisibilityConditionInput | VisibilityConditionInput[];
|
|
269
|
+
/** 实时推演配置的运行时类型(由 `ExpansionSchema` 经 `Static<>` 派生) */
|
|
270
|
+
export type ExpansionConfig = Static<typeof ExpansionSchema>;
|
|
271
|
+
/** 推演题目插入位置的运行时类型:预设字符串或指定题目之后的锚点 */
|
|
272
|
+
export type InsertPosition = Static<typeof InsertPositionSchema>;
|
|
273
|
+
/** 推演向既有题目追加的一组选项 */
|
|
274
|
+
export interface OptionAddition {
|
|
275
|
+
/** 目标题目的 ID(必须是表单中已存在的题目) */
|
|
276
|
+
readonly questionId: string;
|
|
277
|
+
/** 待追加的选项(标签与既有选项不重复) */
|
|
278
|
+
readonly options: QuestionOption[];
|
|
279
|
+
}
|
|
280
|
+
/** 一次推演的产出:待追加的新题目与向既有题目追加的选项 */
|
|
281
|
+
export interface ExpansionPayload {
|
|
282
|
+
/** 追加到题目列表末尾的新题目 */
|
|
283
|
+
readonly questions: QuestionInput[];
|
|
284
|
+
/** 向既有题目追加的选项 */
|
|
285
|
+
readonly optionAdditions: OptionAddition[];
|
|
286
|
+
}
|
package/dist/texts.d.ts
CHANGED
|
@@ -37,39 +37,70 @@ export declare const TEXTS: {
|
|
|
37
37
|
/** 工具注册元数据:`name` / `description` / `promptSnippet` / `promptGuidelines` 面向 LLM(英文高信噪比),`label` 面向作者(TUI 工具行标题) */
|
|
38
38
|
readonly tool: {
|
|
39
39
|
readonly name: "ask_author";
|
|
40
|
-
readonly description: "Ask the author to
|
|
41
|
-
readonly promptSnippet: "Ask the author to
|
|
42
|
-
readonly promptGuidelines: readonly ["ask_author:
|
|
40
|
+
readonly description: "Ask the author to decide between concrete narrative options in an interactive terminal form. Handles a single question or a batch, optional draft previews, author notes, conditional questions, and live follow-up questions generated while the author answers.";
|
|
41
|
+
readonly promptSnippet: "Ask the author to pick narrative directions in a terminal form";
|
|
42
|
+
readonly promptGuidelines: readonly ["ask_author: Use it when the author must choose a plot branch, character action, scene direction, or setting; do not ask the same question in chat first.", "ask_author: Prefer one call over several: flat mode (formTitle + question + options) for a single decision, the questions array for related decisions.", "ask_author: Write option labels as concrete actions, put consequences in description, and add preview only when a Markdown draft or storyboard helps the choice.", "ask_author: Give a short formTitle and a tabLabel for every long question title; omit fields that use defaults.", "ask_author: Add a question id only when a showIf or expansion.insert.after refers to it; showIf may only point at an earlier question's option label or answered.", 'ask_author: Pass expansion when follow-up decisions depend on the answers: declare only the first question and let the same model add questions and options on each confirmation; expansion.insert picks "follow" (default), "tail", or {"after":"question_id"}.', "ask_author: The author can multi-select, add notes, and edit drafts; confirmed drafts return as [Draft directive: ...] lines. Treat [Author Decision Cancelled] as no decision, and [Author Consultation Error] as a request to fix the arguments once."];
|
|
43
43
|
readonly label: string;
|
|
44
44
|
};
|
|
45
45
|
/** LLM 端 TypeBox 字段描述字典 */
|
|
46
46
|
readonly schema: {
|
|
47
47
|
readonly optionLabel: "Concrete action or choice label";
|
|
48
48
|
readonly optionDesc: "Consequences or rationale (optional)";
|
|
49
|
-
readonly optionPreview: "Markdown draft or storyboard
|
|
50
|
-
readonly optionCustomPlaceholder: "Placeholder for the
|
|
51
|
-
readonly optionShowIf: "Show only
|
|
52
|
-
readonly questionId: "
|
|
49
|
+
readonly optionPreview: "Markdown draft or storyboard for this option (optional)";
|
|
50
|
+
readonly optionCustomPlaceholder: "Placeholder for the author's note on this option (optional)";
|
|
51
|
+
readonly optionShowIf: "Show only if an earlier answer matches; array means all must hold (optional)";
|
|
52
|
+
readonly questionId: "Id referenced by showIf and expansion.insert.after (optional)";
|
|
53
53
|
readonly questionTitle: "Question text";
|
|
54
|
-
readonly questionTabLabel: "Short
|
|
55
|
-
readonly questionDesc: "Context
|
|
54
|
+
readonly questionTabLabel: "Short tab label (default: Q<index>)";
|
|
55
|
+
readonly questionDesc: "Context shown under the question (optional)";
|
|
56
56
|
readonly questionMultiSelect: "Allow multiple selections (default false)";
|
|
57
|
-
readonly questionMinSelect: "Minimum selections (default 1)";
|
|
58
|
-
readonly questionMaxSelect: "Maximum selections (default: all options)";
|
|
59
|
-
readonly questionAllowEmpty: "Allow submitting
|
|
60
|
-
readonly questionOptions: "
|
|
57
|
+
readonly questionMinSelect: "Minimum selections, multi-select only (default 1)";
|
|
58
|
+
readonly questionMaxSelect: "Maximum selections, multi-select only (default: all options)";
|
|
59
|
+
readonly questionAllowEmpty: "Allow submitting without a selection (default false)";
|
|
60
|
+
readonly questionOptions: "Options (1-30, 2-10 recommended)";
|
|
61
61
|
readonly questionAllowCustom: "Allow author notes (default true)";
|
|
62
|
-
readonly questionCustomPlaceholder: "Placeholder for the author note (optional)";
|
|
63
|
-
readonly questionShowIf: "Show only
|
|
64
|
-
readonly conditionQuestionId: "
|
|
65
|
-
readonly conditionOption: "Option label that activates the condition";
|
|
66
|
-
readonly conditionAnswered: "
|
|
62
|
+
readonly questionCustomPlaceholder: "Placeholder for the author's note (optional)";
|
|
63
|
+
readonly questionShowIf: "Show only if an earlier answer matches; array means all must hold (optional)";
|
|
64
|
+
readonly conditionQuestionId: "Earlier question id";
|
|
65
|
+
readonly conditionOption: "Option label of that question that activates the condition";
|
|
66
|
+
readonly conditionAnswered: "Any answer (default true) or no answer (false); ignored when option is set";
|
|
67
67
|
readonly formTitle: "Short title for the consultation";
|
|
68
68
|
readonly formDesc: "Overall context (optional)";
|
|
69
|
-
readonly formQuestions: "
|
|
69
|
+
readonly formQuestions: "Questions (1-20); batch related decisions in one call";
|
|
70
70
|
readonly formSingleQuestion: "Question for flat mode";
|
|
71
71
|
readonly flatPrefix: "(Flat single-question mode only) ";
|
|
72
72
|
readonly flatQuestionOptions: "Options for flat mode (1-30, 2-10 recommended)";
|
|
73
|
+
readonly expansion: "Generate follow-up questions and options while the author answers; insert controls where they land (optional)";
|
|
74
|
+
readonly expansionMaxQuestions: "Question cap including declared ones (default 20)";
|
|
75
|
+
readonly expansionGuidance: "Standing hint for what the expansion should probe (optional)";
|
|
76
|
+
readonly expansionInsert: '"follow" (default, after the answered question), "tail" (end of the form), or {"after":"question_id"} (optional)';
|
|
77
|
+
readonly expansionInsertAfter: "Declared question id to insert after";
|
|
78
|
+
};
|
|
79
|
+
/** 实时推演协议(系统提示词、用户消息前缀与诊断文案) */
|
|
80
|
+
readonly expansion: {
|
|
81
|
+
readonly systemPrompt: `You extend an interactive author decision form while the author answers it.
|
|
82
|
+
|
|
83
|
+
Input JSON: formTitle, formDescription, guidance, insert, maxAdditionalQuestions, questions (with ids), answers (selected labels and notes).
|
|
84
|
+
|
|
85
|
+
Return JSON only:
|
|
86
|
+
{"questions":[{"id":"unique_id","title":"...","description":"...","options":[{"label":"...","description":"..."}]}],"options":[{"questionId":"existing_id","options":[{"label":"..."}]}]}
|
|
87
|
+
|
|
88
|
+
Rules:
|
|
89
|
+
- Add at most maxAdditionalQuestions questions; fewer is better.
|
|
90
|
+
- New questions may also set multiSelect, minSelect, maxSelect, allowEmpty; every option needs a label.
|
|
91
|
+
- Add options to a declared question only when the answers reveal a choice it cannot express; use its id and unused labels.
|
|
92
|
+
- Give new questions unique ids and 2-6 concrete options; put consequences in description.
|
|
93
|
+
- Never repeat a declared question or a declared label.
|
|
94
|
+
- showIf takes {"questionId":"id","option":"label"} or {"questionId":"id","answered":true} and may only reference a question above the insertion point or one of your earlier new questions.
|
|
95
|
+
- Reply {"questions":[],"options":[]} when the answers already determine the next step.
|
|
96
|
+
- No prose, no code fences, no trailing commas.`;
|
|
97
|
+
readonly userPreamble: "Extend this author decision form. Input JSON:";
|
|
98
|
+
readonly errors: {
|
|
99
|
+
readonly noModel: "no model is available for live expansion";
|
|
100
|
+
readonly aborted: "live expansion was aborted";
|
|
101
|
+
readonly providerFailed: "the expansion request failed";
|
|
102
|
+
readonly invalidReply: "the expansion reply was not a JSON object";
|
|
103
|
+
};
|
|
73
104
|
};
|
|
74
105
|
/** LLM 端返回封套与纠正指令模板 */
|
|
75
106
|
readonly markdown: {
|
|
@@ -82,17 +113,20 @@ export declare const TEXTS: {
|
|
|
82
113
|
readonly noQuestions: "No questions or options were provided.";
|
|
83
114
|
readonly runtimeError: (details: string) => string;
|
|
84
115
|
readonly invalidCondition: (details: string) => string;
|
|
116
|
+
readonly expansionUnavailable: "Live expansion was requested but no model is available in this session.";
|
|
85
117
|
};
|
|
86
118
|
readonly errorGuidances: {
|
|
87
119
|
readonly nonTui: "Use defaults, or ask the user in chat if the decision is crucial.";
|
|
88
120
|
readonly noQuestions: "Provide at least one question with concrete options.";
|
|
89
121
|
readonly runtimeError: "Check the arguments and retry with valid questions and options.";
|
|
90
|
-
readonly invalidCondition: "Reference an earlier question id plus one of its option labels, or
|
|
122
|
+
readonly invalidCondition: "Reference an earlier question id plus one of its option labels, use answered, or point expansion.insert.after at a declared question id.";
|
|
123
|
+
readonly expansionUnavailable: "Drop the expansion field and declare the questions directly, or retry in a session with a model selected.";
|
|
91
124
|
};
|
|
92
125
|
readonly adaptiveErrors: {
|
|
93
126
|
readonly unknownQuestion: (questionId: string) => string;
|
|
94
127
|
readonly forwardQuestion: (questionId: string) => string;
|
|
95
128
|
readonly unknownOption: (questionId: string, option: string) => string;
|
|
129
|
+
readonly unknownInsertAnchor: (questionId: string) => string;
|
|
96
130
|
};
|
|
97
131
|
readonly envelopeEmpty: "The author submitted no answers. Use your defaults, or ask a follow-up if the decision is crucial.";
|
|
98
132
|
readonly noSelection: "(No selection; the author skipped this question)";
|
|
@@ -124,12 +158,15 @@ export declare const TEXTS: {
|
|
|
124
158
|
/** Tab 导航栏标签文案(各题目页与答卷提交页) */
|
|
125
159
|
readonly tabs: {
|
|
126
160
|
readonly questionTab: (...args: Array<string | number>) => string;
|
|
161
|
+
readonly expansionPlaceholder: string;
|
|
127
162
|
readonly submitTab: string;
|
|
128
163
|
};
|
|
129
164
|
/** 作答视图与预览面板的结构化文案(`modeMulti` 由多选模式片段组合而成) */
|
|
130
165
|
readonly view: {
|
|
131
166
|
readonly modeSingle: string;
|
|
132
167
|
readonly conditionalBadge: string;
|
|
168
|
+
readonly expansionBadge: string;
|
|
169
|
+
readonly expansionPendingHint: string;
|
|
133
170
|
readonly modeMultiAtLeast: (...args: Array<string | number>) => string;
|
|
134
171
|
readonly modeMultiOptional: (...args: Array<string | number>) => string;
|
|
135
172
|
readonly modeMultiUnconstrained: (...args: Array<string | number>) => string;
|
|
@@ -143,13 +180,11 @@ export declare const TEXTS: {
|
|
|
143
180
|
readonly storyDraftPanelTitle: string;
|
|
144
181
|
readonly customNotePanelTitle: string;
|
|
145
182
|
readonly confirmPanelTitle: string;
|
|
146
|
-
readonly customNotePanelCurrent: string;
|
|
147
183
|
readonly previewScrollInfo: (...args: Array<string | number>) => string;
|
|
148
184
|
readonly previewNoDraft: string;
|
|
149
185
|
readonly customNotePanelTips: readonly string[];
|
|
150
186
|
readonly confirmPanelTips: readonly string[];
|
|
151
187
|
readonly sectionTitle: (...args: Array<string | number>) => string;
|
|
152
|
-
readonly fieldLabel: (...args: Array<string | number>) => string;
|
|
153
188
|
readonly italicLine: (...args: Array<string | number>) => string;
|
|
154
189
|
readonly modeMulti: typeof modeMultiLabel;
|
|
155
190
|
};
|
|
@@ -186,6 +221,11 @@ export declare const TEXTS: {
|
|
|
186
221
|
readonly errorNoQuestions: string;
|
|
187
222
|
readonly errorInvalidCondition: (...args: Array<string | number>) => string;
|
|
188
223
|
readonly errorExecutionFailed: (...args: Array<string | number>) => string;
|
|
224
|
+
readonly expansionRunning: string;
|
|
225
|
+
readonly expansionAdded: (...args: Array<string | number>) => string;
|
|
226
|
+
readonly expansionRetracted: string;
|
|
227
|
+
readonly expansionStopped: string;
|
|
228
|
+
readonly expansionFailed: (...args: Array<string | number>) => string;
|
|
189
229
|
};
|
|
190
230
|
/** 底部按键帮助行片段(经 `common.helpSeparator` 拼接;条目按按键字母序排列) */
|
|
191
231
|
readonly help: {
|
package/dist/view-question.d.ts
CHANGED
|
@@ -25,6 +25,8 @@ export interface QuestionViewState {
|
|
|
25
25
|
readonly statusMessage: string | null;
|
|
26
26
|
/** 当前题目的菜单项(由模型派生并记忆化) */
|
|
27
27
|
readonly menuItems: readonly MenuItem[];
|
|
28
|
+
/** 本题确认后是否会发起实时推演(题头展示推演标记) */
|
|
29
|
+
readonly expandable: boolean;
|
|
28
30
|
}
|
|
29
31
|
/** 预览视口观察值:渲染后回传组件,供输入路径归一化滚动位移 */
|
|
30
32
|
export interface PreviewViewport {
|