@lynn123411/dsh-ask-user-grilling 0.6.4 → 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.
- package/README.md +28 -24
- package/assets/icon.svg +5 -0
- package/cordis.patch.yml +1 -1
- package/lib/client.js +352 -196
- package/lib/client.js.map +3 -3
- package/lib/index.js +90 -131
- package/lib/index.js.map +3 -3
- package/locale/en.json +6 -0
- package/locale/zh.json +6 -0
- package/package.json +11 -10
package/lib/client.js
CHANGED
|
@@ -25,32 +25,41 @@ __export(index_exports, {
|
|
|
25
25
|
});
|
|
26
26
|
module.exports = __toCommonJS(index_exports);
|
|
27
27
|
|
|
28
|
-
// src/client/
|
|
28
|
+
// src/client/GrillingFormRow.jsx
|
|
29
29
|
var import_react = require("react");
|
|
30
30
|
var import_dsh_client_ui_primitives = require("@deepseek-ai/dsh-client-ui-primitives");
|
|
31
31
|
|
|
32
|
-
// src/
|
|
33
|
-
var
|
|
34
|
-
var
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
function
|
|
41
|
-
|
|
32
|
+
// src/recommendation.js
|
|
33
|
+
var MARKER = "recommended|\u63A8\u8350";
|
|
34
|
+
var BRACKETED_MARKER = `[\uFF08(\u3010\\[]\\s*(?:${MARKER})\\s*[\uFF09)\u3011\\]]`;
|
|
35
|
+
var SEPARATOR = "\uFF1B;\uFF0C,\u3001:\uFF1A\\-\u2014";
|
|
36
|
+
var TRAILING_PUNCTUATION = "\u3002.\uFF01!\uFF1F?\uFF1B;\uFF0C,\u3001~\uFF5E\\s";
|
|
37
|
+
var BRACKETED_SUFFIX = new RegExp(`[\\s]*[${SEPARATOR}]?\\s*${BRACKETED_MARKER}[${TRAILING_PUNCTUATION}]*$`, "i");
|
|
38
|
+
var BARE_SUFFIX = new RegExp(`[\\s]*[${SEPARATOR}]\\s*(?:${MARKER})[${TRAILING_PUNCTUATION}]*$`, "i");
|
|
39
|
+
var RECOMMENDED_LABEL_SUFFIX = "\uFF08\u63A8\u8350\uFF09";
|
|
40
|
+
function stripRecommendationMarker(text) {
|
|
41
|
+
if (typeof text !== "string") return { text, found: false };
|
|
42
|
+
const match = BRACKETED_SUFFIX.exec(text) ?? BARE_SUFFIX.exec(text);
|
|
43
|
+
if (match === null) return { text, found: false };
|
|
44
|
+
return { text: text.slice(0, match.index).replace(/\s+$/, ""), found: true };
|
|
42
45
|
}
|
|
43
|
-
function
|
|
44
|
-
const
|
|
45
|
-
const
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
return
|
|
46
|
+
function normalizeOption(option) {
|
|
47
|
+
const label = stripRecommendationMarker(option.label);
|
|
48
|
+
const description = option.description === void 0 ? void 0 : stripRecommendationMarker(option.description);
|
|
49
|
+
const recommended = option.recommended === true || label.found || description !== void 0 && description.found;
|
|
50
|
+
const cleanLabel = label.text;
|
|
51
|
+
return {
|
|
52
|
+
originalLabel: option.label,
|
|
53
|
+
label: recommended ? `${cleanLabel}${RECOMMENDED_LABEL_SUFFIX}` : cleanLabel,
|
|
54
|
+
cleanLabel,
|
|
55
|
+
description: description === void 0 ? void 0 : description.text,
|
|
56
|
+
recommended
|
|
57
|
+
};
|
|
49
58
|
}
|
|
50
59
|
|
|
51
|
-
// src/
|
|
52
|
-
var
|
|
53
|
-
var
|
|
60
|
+
// src/form-model.js
|
|
61
|
+
var IMPORT_BLOCK_START = "\u3010\u76D8\u95EE\u4F5C\u7B54\u3011";
|
|
62
|
+
var IMPORT_BLOCK_END = "\u3010/\u76D8\u95EE\u4F5C\u7B54\u3011";
|
|
54
63
|
function isRecord(value) {
|
|
55
64
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
56
65
|
}
|
|
@@ -65,6 +74,21 @@ function parseJson(text) {
|
|
|
65
74
|
function stringList(value) {
|
|
66
75
|
return Array.isArray(value) ? value.filter((item) => typeof item === "string") : [];
|
|
67
76
|
}
|
|
77
|
+
function isBlank(value) {
|
|
78
|
+
return typeof value !== "string" || value.trim() === "";
|
|
79
|
+
}
|
|
80
|
+
function mergeNumberIntoHeader(number, header) {
|
|
81
|
+
const num = isBlank(number) ? void 0 : number;
|
|
82
|
+
const head = isBlank(header) ? void 0 : header;
|
|
83
|
+
if (num === void 0) return head ?? "";
|
|
84
|
+
if (head === void 0) return num;
|
|
85
|
+
return head.startsWith(num) ? head : `${num} \xB7 ${head}`;
|
|
86
|
+
}
|
|
87
|
+
function titleOf(question) {
|
|
88
|
+
if (!isBlank(question.header)) return question.header;
|
|
89
|
+
if (!isBlank(question.question)) return question.question;
|
|
90
|
+
return question.id;
|
|
91
|
+
}
|
|
68
92
|
function readQuestions(argsRaw) {
|
|
69
93
|
const parsed = parseJson(argsRaw);
|
|
70
94
|
if (!isRecord(parsed) || !Array.isArray(parsed.questions)) return [];
|
|
@@ -73,13 +97,23 @@ function readQuestions(argsRaw) {
|
|
|
73
97
|
for (const question of parsed.questions) {
|
|
74
98
|
if (!isRecord(question) || typeof question.id !== "string" || ids.has(question.id)) return [];
|
|
75
99
|
ids.add(question.id);
|
|
100
|
+
const options = (Array.isArray(question.options) ? question.options : []).filter((option) => isRecord(option)).map((option) => {
|
|
101
|
+
const normalized = normalizeOption(option);
|
|
102
|
+
return {
|
|
103
|
+
// 界面按 label 认选项(宿主已保证同题内唯一),显示用 cleanLabel、徽标另画,
|
|
104
|
+
// 导入文本也用 cleanLabel:模型写的推荐标记不会跟着用户的消息发回去。
|
|
105
|
+
label: normalized.label,
|
|
106
|
+
displayLabel: normalized.cleanLabel,
|
|
107
|
+
description: normalized.description,
|
|
108
|
+
recommended: normalized.recommended
|
|
109
|
+
};
|
|
110
|
+
});
|
|
76
111
|
questions.push({
|
|
77
112
|
id: question.id,
|
|
78
113
|
header: mergeNumberIntoHeader(question.number, question.header),
|
|
79
114
|
question: typeof question.question === "string" ? question.question : "",
|
|
80
115
|
detail: isBlank(question.detail) ? void 0 : question.detail,
|
|
81
|
-
|
|
82
|
-
supplement: false
|
|
116
|
+
options
|
|
83
117
|
});
|
|
84
118
|
}
|
|
85
119
|
return questions;
|
|
@@ -91,126 +125,205 @@ function readResult(resultText) {
|
|
|
91
125
|
return {
|
|
92
126
|
rejected: true,
|
|
93
127
|
violations: stringList(parsed.violations),
|
|
94
|
-
error: typeof parsed.error === "string" ? parsed.error : void 0
|
|
95
|
-
answers: []
|
|
128
|
+
error: typeof parsed.error === "string" ? parsed.error : void 0
|
|
96
129
|
};
|
|
97
130
|
}
|
|
98
|
-
if (
|
|
99
|
-
|
|
100
|
-
for (const entry of parsed.answers) {
|
|
101
|
-
if (!isRecord(entry) || typeof entry.id !== "string") return void 0;
|
|
102
|
-
answers.push({
|
|
103
|
-
id: entry.id,
|
|
104
|
-
selected: stringList(entry.selected),
|
|
105
|
-
custom: typeof entry.custom === "string" ? entry.custom : void 0
|
|
106
|
-
});
|
|
107
|
-
}
|
|
108
|
-
return { rejected: false, violations: [], error: void 0, answers };
|
|
131
|
+
if (parsed.pending === true) return { rejected: false, violations: [], error: void 0 };
|
|
132
|
+
return void 0;
|
|
109
133
|
}
|
|
110
|
-
function
|
|
134
|
+
function readFormModel({ argsRaw, resultText, failed = false }) {
|
|
111
135
|
const questions = readQuestions(argsRaw);
|
|
112
|
-
const known = new Set(questions.map((question) => question.id));
|
|
113
136
|
const result = readResult(resultText);
|
|
114
137
|
let state;
|
|
115
|
-
if (
|
|
116
|
-
else if (errorCode === INTERRUPTED_CODE) state = "interrupted";
|
|
117
|
-
else if (result !== void 0) state = result.rejected ? "rejected" : "answered";
|
|
138
|
+
if (result !== void 0) state = result.rejected ? "rejected" : "form";
|
|
118
139
|
else if (failed) state = "error";
|
|
119
140
|
else if (typeof resultText === "string" && resultText !== "") state = "error";
|
|
120
141
|
else state = "running";
|
|
121
|
-
if (state === "answered") {
|
|
122
|
-
for (const answer of result.answers) {
|
|
123
|
-
const lines = [
|
|
124
|
-
...answer.selected,
|
|
125
|
-
...answer.custom === void 0 || answer.custom === "" ? [] : [answer.custom]
|
|
126
|
-
];
|
|
127
|
-
const entry = questions.find((question) => question.id === answer.id);
|
|
128
|
-
if (entry !== void 0) {
|
|
129
|
-
entry.answers = lines;
|
|
130
|
-
continue;
|
|
131
|
-
}
|
|
132
|
-
const supplement = answer.id === ROUND_END_QUESTION.id;
|
|
133
|
-
questions.push({
|
|
134
|
-
id: answer.id,
|
|
135
|
-
header: supplement ? ROUND_END_QUESTION.header : "",
|
|
136
|
-
question: supplement ? ROUND_END_QUESTION.question : answer.id,
|
|
137
|
-
detail: void 0,
|
|
138
|
-
answers: lines,
|
|
139
|
-
supplement: true
|
|
140
|
-
});
|
|
141
|
-
}
|
|
142
|
-
} else if ((state === "running" || state === "cancelled" || state === "interrupted") && questions.length > 0) {
|
|
143
|
-
if (!known.has(ROUND_END_QUESTION.id)) {
|
|
144
|
-
questions.push({
|
|
145
|
-
id: ROUND_END_QUESTION.id,
|
|
146
|
-
header: ROUND_END_QUESTION.header,
|
|
147
|
-
question: ROUND_END_QUESTION.question,
|
|
148
|
-
detail: void 0,
|
|
149
|
-
answers: [],
|
|
150
|
-
supplement: true
|
|
151
|
-
});
|
|
152
|
-
}
|
|
153
|
-
}
|
|
154
|
-
return finish(state, questions, result);
|
|
155
|
-
}
|
|
156
|
-
function finish(state, questions, result) {
|
|
157
142
|
return {
|
|
158
143
|
state,
|
|
159
144
|
questions,
|
|
160
|
-
answered: questions.filter((question) => question.answers.length > 0).length,
|
|
161
|
-
total: questions.length,
|
|
162
145
|
violations: result === void 0 ? [] : result.violations,
|
|
163
146
|
error: result === void 0 ? void 0 : result.error
|
|
164
147
|
};
|
|
165
148
|
}
|
|
149
|
+
function sanitizeAnswers(value) {
|
|
150
|
+
if (!isRecord(value)) return {};
|
|
151
|
+
const answers = {};
|
|
152
|
+
for (const [id, answer] of Object.entries(value)) {
|
|
153
|
+
if (!isRecord(answer)) continue;
|
|
154
|
+
const shaped = Array.isArray(answer.selected) || typeof answer.custom === "string";
|
|
155
|
+
const selected = stringList(answer.selected);
|
|
156
|
+
const custom = typeof answer.custom === "string" ? answer.custom : "";
|
|
157
|
+
if (!shaped && selected.length === 0 && custom === "") continue;
|
|
158
|
+
answers[id] = { selected, custom };
|
|
159
|
+
}
|
|
160
|
+
return answers;
|
|
161
|
+
}
|
|
162
|
+
function answerParts(question, answer) {
|
|
163
|
+
if (!isRecord(answer)) return { selected: [], custom: "" };
|
|
164
|
+
const shown = new Map(question.options.map((option) => [option.label, option.displayLabel]));
|
|
165
|
+
return {
|
|
166
|
+
selected: stringList(answer.selected).map((label) => shown.get(label) ?? label),
|
|
167
|
+
custom: typeof answer.custom === "string" ? answer.custom.trim() : ""
|
|
168
|
+
};
|
|
169
|
+
}
|
|
170
|
+
function answerLines(question, answer) {
|
|
171
|
+
const { selected, custom } = answerParts(question, answer);
|
|
172
|
+
return [...selected, ...custom === "" ? [] : [custom]];
|
|
173
|
+
}
|
|
174
|
+
function applyRecommendedDefaults(questions, answers) {
|
|
175
|
+
const merged = { ...isRecord(answers) ? answers : {} };
|
|
176
|
+
for (const question of questions) {
|
|
177
|
+
if (merged[question.id] !== void 0) continue;
|
|
178
|
+
const selected = question.options.filter((option) => option.recommended).map((option) => option.label);
|
|
179
|
+
if (selected.length > 0) merged[question.id] = { selected, custom: "" };
|
|
180
|
+
}
|
|
181
|
+
return merged;
|
|
182
|
+
}
|
|
183
|
+
function importBody(questions, answers) {
|
|
184
|
+
const lines = [];
|
|
185
|
+
for (const question of questions) {
|
|
186
|
+
const answer = answerLines(question, answers[question.id]);
|
|
187
|
+
if (answer.length === 0) continue;
|
|
188
|
+
lines.push(`${titleOf(question)}\uFF1A${answer.join("\u3001")}`);
|
|
189
|
+
}
|
|
190
|
+
return lines.join("\n");
|
|
191
|
+
}
|
|
192
|
+
function findImportBlock(draft) {
|
|
193
|
+
if (typeof draft !== "string") return void 0;
|
|
194
|
+
const start = draft.indexOf(IMPORT_BLOCK_START);
|
|
195
|
+
if (start === -1) return void 0;
|
|
196
|
+
const stop = draft.indexOf(IMPORT_BLOCK_END, start + IMPORT_BLOCK_START.length);
|
|
197
|
+
if (stop === -1) return void 0;
|
|
198
|
+
return { start, end: stop + IMPORT_BLOCK_END.length };
|
|
199
|
+
}
|
|
200
|
+
function blockTextOf(body) {
|
|
201
|
+
return `${IMPORT_BLOCK_START}
|
|
202
|
+
${body}
|
|
203
|
+
${IMPORT_BLOCK_END}`;
|
|
204
|
+
}
|
|
205
|
+
function applyImport(draft, body) {
|
|
206
|
+
const text = typeof draft === "string" ? draft : "";
|
|
207
|
+
if (body === "") return text;
|
|
208
|
+
const block = blockTextOf(body);
|
|
209
|
+
const current = findImportBlock(text);
|
|
210
|
+
if (current !== void 0) return text.slice(0, current.start) + block + text.slice(current.end);
|
|
211
|
+
return text === "" ? block : `${block}
|
|
166
212
|
|
|
167
|
-
|
|
213
|
+
${text}`;
|
|
214
|
+
}
|
|
215
|
+
function importStale(draft, body) {
|
|
216
|
+
if (body === "") return false;
|
|
217
|
+
const current = findImportBlock(draft);
|
|
218
|
+
if (current === void 0) return true;
|
|
219
|
+
const inner = draft.slice(current.start + IMPORT_BLOCK_START.length, current.end - IMPORT_BLOCK_END.length);
|
|
220
|
+
return inner.replace(/^\n/, "").replace(/\n$/, "") !== body;
|
|
221
|
+
}
|
|
222
|
+
function isReadOnlyAfter(nodes, callId) {
|
|
223
|
+
if (!Array.isArray(nodes)) return false;
|
|
224
|
+
const mine = nodes.find((node) => isRecord(node) && node.callId === callId);
|
|
225
|
+
if (mine === void 0 || typeof mine.seq !== "number") return false;
|
|
226
|
+
return nodes.some((node) => isRecord(node) && (node.kind === "user" || node.kind === "steering") && typeof node.seq === "number" && node.seq > mine.seq);
|
|
227
|
+
}
|
|
228
|
+
function formStorageKey(sessionId) {
|
|
229
|
+
const scope = typeof sessionId === "string" && sessionId !== "" ? sessionId : "unknown-session";
|
|
230
|
+
return `dsh-grilling-form.${scope}`;
|
|
231
|
+
}
|
|
232
|
+
function readStorage(storage, key) {
|
|
233
|
+
if (storage === void 0 || storage === null || typeof storage.getItem !== "function") return {};
|
|
234
|
+
try {
|
|
235
|
+
const parsed = parseJson(storage.getItem(key));
|
|
236
|
+
return isRecord(parsed) ? parsed : {};
|
|
237
|
+
} catch {
|
|
238
|
+
return {};
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
function readStoredForm(storage, key, callId) {
|
|
242
|
+
const all = readStorage(storage, key);
|
|
243
|
+
return sanitizeAnswers(all[callId]);
|
|
244
|
+
}
|
|
245
|
+
function writeStoredForm(storage, key, callId, answers) {
|
|
246
|
+
if (storage === void 0 || storage === null || typeof storage.setItem !== "function") return;
|
|
247
|
+
const all = readStorage(storage, key);
|
|
248
|
+
try {
|
|
249
|
+
storage.setItem(key, JSON.stringify({ ...all, [callId]: sanitizeAnswers(answers) }));
|
|
250
|
+
} catch {
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
// src/client/GrillingFormRow.jsx
|
|
168
255
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
169
|
-
function
|
|
170
|
-
|
|
171
|
-
|
|
256
|
+
function GrillingFormRow({
|
|
257
|
+
block,
|
|
258
|
+
toolName,
|
|
259
|
+
callId,
|
|
260
|
+
sessionId,
|
|
261
|
+
t,
|
|
262
|
+
inspect,
|
|
263
|
+
inputActions,
|
|
264
|
+
useInput,
|
|
265
|
+
useConversation
|
|
266
|
+
}) {
|
|
172
267
|
const settled = "kind" in block;
|
|
173
268
|
const argsRaw = (settled ? block.call?.argsRaw : block.argsRaw) ?? "";
|
|
174
269
|
const resultText = settled ? firstText(block.content) : void 0;
|
|
175
|
-
const model =
|
|
176
|
-
argsRaw,
|
|
177
|
-
resultText,
|
|
178
|
-
errorCode: settled ? block.error?.code : void 0,
|
|
179
|
-
failed: settled && block.isError === true
|
|
180
|
-
});
|
|
270
|
+
const model = readFormModel({ argsRaw, resultText, failed: settled && block.isError === true });
|
|
181
271
|
const failure = settled && block.isError === true ? failureText(resultText, block.error) : void 0;
|
|
182
|
-
const
|
|
183
|
-
const
|
|
184
|
-
const
|
|
185
|
-
|
|
186
|
-
|
|
272
|
+
const draft = useInput((state) => state.draft);
|
|
273
|
+
const chat = useConversation((snapshot) => snapshot.views.get("chat"));
|
|
274
|
+
const readOnly = isReadOnlyAfter(chat?.legacy?.nodes, callId);
|
|
275
|
+
const storageKey = formStorageKey(sessionId);
|
|
276
|
+
const readForm = () => readStoredForm(storageOf(), storageKey, callId);
|
|
277
|
+
const writeForm = (next) => writeStoredForm(storageOf(), storageKey, callId, next);
|
|
278
|
+
const [storedAnswers, setStoredAnswers] = (0, import_react.useState)(readForm);
|
|
279
|
+
const answers = applyRecommendedDefaults(model.questions, storedAnswers);
|
|
280
|
+
const interactive = model.state === "form" && !readOnly;
|
|
281
|
+
const body = importBody(model.questions, answers);
|
|
282
|
+
const canImport = interactive && body !== "";
|
|
283
|
+
const stale = canImport && importStale(draft, body);
|
|
284
|
+
const answered = model.questions.filter((question) => answerLines(question, answers[question.id]).length > 0).length;
|
|
285
|
+
const setAnswer = (id, next) => {
|
|
286
|
+
const merged = { ...storedAnswers, [id]: next };
|
|
287
|
+
setStoredAnswers(merged);
|
|
288
|
+
writeForm(merged);
|
|
289
|
+
};
|
|
290
|
+
const toggleOption = (question, label) => {
|
|
291
|
+
const answer = answers[question.id] ?? { selected: [], custom: "" };
|
|
292
|
+
const selected = answer.selected.includes(label) ? answer.selected.filter((item) => item !== label) : [...answer.selected, label];
|
|
293
|
+
setAnswer(question.id, { ...answer, selected });
|
|
294
|
+
};
|
|
295
|
+
const writeCustom = (question, custom) => {
|
|
296
|
+
const answer = answers[question.id] ?? { selected: [], custom: "" };
|
|
297
|
+
setAnswer(question.id, { ...answer, custom });
|
|
298
|
+
};
|
|
299
|
+
const onImport = () => {
|
|
300
|
+
if (!canImport) return;
|
|
301
|
+
inputActions.setDraft(applyImport(draft, body));
|
|
302
|
+
};
|
|
303
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "dsg-root", "data-tool": toolName, "data-state": model.state, "data-readonly": readOnly ? "true" : void 0, children: [
|
|
187
304
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
188
|
-
|
|
305
|
+
FormBody,
|
|
189
306
|
{
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
] }),
|
|
205
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "dsg-bodyWrap", children: [
|
|
206
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(CardBody, { model, argsRaw, resultText, failure, t }),
|
|
207
|
-
inspect === void 0 ? null : /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("button", { type: "button", className: "dsg-inspectButton", onClick: inspect, children: [
|
|
208
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dsh_client_ui_primitives.IconInspectOutlineRegular, {}),
|
|
209
|
-
t("row.inspect")
|
|
210
|
-
] })
|
|
211
|
-
] })
|
|
307
|
+
model,
|
|
308
|
+
failure,
|
|
309
|
+
argsRaw,
|
|
310
|
+
resultText,
|
|
311
|
+
answers,
|
|
312
|
+
answered,
|
|
313
|
+
interactive,
|
|
314
|
+
readOnly,
|
|
315
|
+
stale,
|
|
316
|
+
canImport,
|
|
317
|
+
t,
|
|
318
|
+
onToggleOption: toggleOption,
|
|
319
|
+
onCustom: writeCustom,
|
|
320
|
+
onImport
|
|
212
321
|
}
|
|
213
|
-
)
|
|
322
|
+
),
|
|
323
|
+
inspect === void 0 ? null : /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("button", { type: "button", className: "dsg-inspectButton", onClick: inspect, children: [
|
|
324
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dsh_client_ui_primitives.IconInspectOutlineRegular, {}),
|
|
325
|
+
t("row.inspect")
|
|
326
|
+
] })
|
|
214
327
|
] });
|
|
215
328
|
}
|
|
216
329
|
function firstText(content) {
|
|
@@ -223,80 +336,123 @@ function failureText(resultText, error) {
|
|
|
223
336
|
const parts = [error?.name, error?.code].filter((part) => typeof part === "string" && part !== "");
|
|
224
337
|
return parts.length === 0 ? void 0 : parts.join(": ");
|
|
225
338
|
}
|
|
226
|
-
function
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
function statusLabel(state, t) {
|
|
232
|
-
switch (state) {
|
|
233
|
-
case "running":
|
|
234
|
-
return t("row.waiting");
|
|
235
|
-
case "error":
|
|
236
|
-
return t("row.failed");
|
|
237
|
-
case "cancelled":
|
|
238
|
-
return t("row.cancelled");
|
|
239
|
-
case "interrupted":
|
|
240
|
-
return t("row.interrupted");
|
|
241
|
-
default:
|
|
242
|
-
return null;
|
|
243
|
-
}
|
|
244
|
-
}
|
|
245
|
-
function summaryFor(model, t) {
|
|
246
|
-
switch (model.state) {
|
|
247
|
-
case "running":
|
|
248
|
-
return t("row.waiting");
|
|
249
|
-
case "answered":
|
|
250
|
-
return t("row.answered", { answered: model.answered, total: model.total });
|
|
251
|
-
case "rejected":
|
|
252
|
-
return t("row.rejected");
|
|
253
|
-
case "cancelled":
|
|
254
|
-
return t("row.cancelled");
|
|
255
|
-
case "interrupted":
|
|
256
|
-
return t("row.interrupted");
|
|
257
|
-
default:
|
|
258
|
-
return t("row.failed");
|
|
339
|
+
function storageOf() {
|
|
340
|
+
try {
|
|
341
|
+
return globalThis.localStorage;
|
|
342
|
+
} catch {
|
|
343
|
+
return void 0;
|
|
259
344
|
}
|
|
260
345
|
}
|
|
261
|
-
function
|
|
346
|
+
function FormBody({
|
|
347
|
+
model,
|
|
348
|
+
failure,
|
|
349
|
+
argsRaw,
|
|
350
|
+
resultText,
|
|
351
|
+
answers,
|
|
352
|
+
answered,
|
|
353
|
+
interactive,
|
|
354
|
+
readOnly,
|
|
355
|
+
stale,
|
|
356
|
+
canImport,
|
|
357
|
+
t,
|
|
358
|
+
onToggleOption,
|
|
359
|
+
onCustom,
|
|
360
|
+
onImport
|
|
361
|
+
}) {
|
|
262
362
|
if (model.state === "rejected") {
|
|
263
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "dsg-
|
|
363
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "dsg-form", role: "group", "aria-label": t("row.violations"), children: [
|
|
264
364
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "dsg-verdict", children: model.error ?? t("row.rejected") }),
|
|
265
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("ul", { className: "dsg-violations", children: model.violations.map((violation, index) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)("li", { children: violation }, String(index))) })
|
|
266
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(QuestionEntries, { questions: model.questions, showAnswers: false, t })
|
|
365
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("ul", { className: "dsg-violations", children: model.violations.map((violation, index) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)("li", { children: violation }, String(index))) })
|
|
267
366
|
] });
|
|
268
367
|
}
|
|
269
368
|
if (model.questions.length === 0) {
|
|
270
369
|
const raw = model.state === "running" ? argsRaw : resultText;
|
|
271
370
|
return raw === void 0 || raw === "" ? null : /* @__PURE__ */ (0, import_jsx_runtime.jsx)("pre", { className: "dsg-raw", children: raw });
|
|
272
371
|
}
|
|
273
|
-
if (model.state === "cancelled" || model.state === "interrupted") {
|
|
274
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "dsg-card", children: [
|
|
275
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "dsg-verdict", children: model.state === "cancelled" ? t("row.cancelledDetail") : t("row.interruptedDetail") }),
|
|
276
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(QuestionEntries, { questions: model.questions, showAnswers: false, t })
|
|
277
|
-
] });
|
|
278
|
-
}
|
|
279
372
|
if (model.state === "error") {
|
|
280
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "dsg-
|
|
281
|
-
|
|
282
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
373
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "dsg-form", children: [
|
|
374
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "dsg-failure", children: failure ?? t("row.failed") }),
|
|
375
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(QuestionList, { questions: model.questions, answers, interactive: false, readOnly: false, t, onToggleOption, onCustom })
|
|
283
376
|
] });
|
|
284
377
|
}
|
|
285
|
-
|
|
378
|
+
const live = model.state === "form";
|
|
379
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "dsg-form", children: [
|
|
380
|
+
live ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "dsg-progress", children: t("row.progress", { total: model.questions.length, answered }) }) : null,
|
|
381
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
382
|
+
QuestionList,
|
|
383
|
+
{
|
|
384
|
+
questions: model.questions,
|
|
385
|
+
answers,
|
|
386
|
+
interactive,
|
|
387
|
+
readOnly,
|
|
388
|
+
t,
|
|
389
|
+
onToggleOption,
|
|
390
|
+
onCustom
|
|
391
|
+
}
|
|
392
|
+
),
|
|
393
|
+
!live ? null : readOnly ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "dsg-closed", children: t("row.closed") }) : /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "dsg-footer", children: [
|
|
394
|
+
stale ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "dsg-reminder", children: t("row.reminder") }) : null,
|
|
395
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
396
|
+
import_dsh_client_ui_primitives.Button,
|
|
397
|
+
{
|
|
398
|
+
className: "dsg-import",
|
|
399
|
+
variant: "outline",
|
|
400
|
+
size: "sm",
|
|
401
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dsh_client_ui_primitives.IconDownloadOutlineRegular, {}),
|
|
402
|
+
disabled: !canImport,
|
|
403
|
+
onClick: onImport,
|
|
404
|
+
children: t("row.import")
|
|
405
|
+
}
|
|
406
|
+
)
|
|
407
|
+
] })
|
|
408
|
+
] });
|
|
286
409
|
}
|
|
287
|
-
function
|
|
410
|
+
function QuestionList({ questions, answers, interactive, readOnly, t, onToggleOption, onCustom }) {
|
|
288
411
|
const labels = (0, import_react.useMemo)(() => markdownLabels(t), [t]);
|
|
289
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("
|
|
290
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("
|
|
412
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "dsg-list", children: questions.map((question) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "dsg-item", children: [
|
|
413
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "dsg-question", children: [
|
|
291
414
|
question.header === "" ? null : /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "dsg-header", children: question.header }),
|
|
292
415
|
question.question
|
|
293
416
|
] }),
|
|
294
417
|
question.detail === void 0 ? null : /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "dsg-detail", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dsh_client_ui_primitives.MarkdownText, { text: question.detail, labels }) }),
|
|
295
|
-
|
|
418
|
+
interactive ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(OptionList, { question, answer: answers[question.id], t, onToggleOption, onCustom }) : null,
|
|
419
|
+
readOnly ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(AnswerLine, { question, answer: answers[question.id], t }) : null
|
|
296
420
|
] }, question.id)) });
|
|
297
421
|
}
|
|
298
|
-
function
|
|
299
|
-
|
|
422
|
+
function OptionList({ question, answer, t, onToggleOption, onCustom }) {
|
|
423
|
+
const selected = answer?.selected ?? [];
|
|
424
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "dsg-options", children: [
|
|
425
|
+
question.options.map((option) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "dsg-optionRow", children: [
|
|
426
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "dsg-optionMain", children: [
|
|
427
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
428
|
+
import_dsh_client_ui_primitives.Checkbox,
|
|
429
|
+
{
|
|
430
|
+
className: "dsg-option",
|
|
431
|
+
checked: selected.includes(option.label),
|
|
432
|
+
label: option.displayLabel,
|
|
433
|
+
onChange: () => onToggleOption(question, option.label)
|
|
434
|
+
}
|
|
435
|
+
),
|
|
436
|
+
option.recommended ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dsh_client_ui_primitives.Tag, { tone: "info", className: "dsg-badge", children: t("row.recommended") }) : null
|
|
437
|
+
] }),
|
|
438
|
+
option.description === void 0 ? null : /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "dsg-optionDescription", children: option.description })
|
|
439
|
+
] }, option.label)),
|
|
440
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
441
|
+
"textarea",
|
|
442
|
+
{
|
|
443
|
+
className: "dsg-custom",
|
|
444
|
+
rows: 2,
|
|
445
|
+
value: answer?.custom ?? "",
|
|
446
|
+
placeholder: t("row.customPlaceholder"),
|
|
447
|
+
"aria-label": `${t("row.customLabel")}\uFF1A${question.question}`,
|
|
448
|
+
onChange: (event) => onCustom(question, event.target.value)
|
|
449
|
+
}
|
|
450
|
+
)
|
|
451
|
+
] });
|
|
452
|
+
}
|
|
453
|
+
function AnswerLine({ question, answer, t }) {
|
|
454
|
+
const lines = answerLines(question, answer);
|
|
455
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "dsg-answer", children: lines.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "dsg-skipped", children: t("row.unanswered") }) : lines.map((line, index) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "dsg-answerLine", children: line }, `${question.id}-${String(index)}`)) });
|
|
300
456
|
}
|
|
301
457
|
function markdownLabels(t) {
|
|
302
458
|
return {
|
|
@@ -305,40 +461,40 @@ function markdownLabels(t) {
|
|
|
305
461
|
};
|
|
306
462
|
}
|
|
307
463
|
|
|
308
|
-
// src/client/
|
|
309
|
-
var
|
|
464
|
+
// src/client/GrillingFormRow.css
|
|
465
|
+
var GrillingFormRow_default = "/* grilling_form \u7684 transcript \u8868\u5355\u3002\n *\n * \u6545\u610F**\u6CA1\u6709\u5361\u7247**\uFF1A\u4E0D\u753B\u6298\u53E0\u884C\uFF0C\u4E5F\u4E0D\u5957\u8FB9\u6846\u3001\u80CC\u666F\u3001\u5185\u8FB9\u8DDD\u4E0E\u5185\u90E8\u6EDA\u52A8\u2014\u2014\u9898\u76EE\u3001\u9009\u9879\u3001\u6309\u94AE\u8DDF\n * \u4E0A\u4E0B\u6587\u540C\u5904\u4E00\u5C42\uFF0C\u6574\u8F6E\u7684\u8FDB\u5EA6\u7F29\u6210\u9876\u4E0A\u7684\u4E00\u884C\u5C0F\u7070\u5B57\u3002\u6240\u4EE5\u8FD9\u91CC\u9664\u4E86\u90A3\u6761\u5C0F\u7070\u5B57\u4E0E\u81EA\u586B\u6846\u7684\u8F93\u5165\u6846\uFF0C\n * \u6CA1\u6709\u4EFB\u4F55\u5BB9\u5668\u7EA7\u7684\u7EBF\u6216\u5E95\u8272\uFF1B\u5B57\u53F7\u3001\u884C\u9AD8\u3001\u989C\u8272\u7167\u6284\u5B98\u65B9 @deepseek-ai/dsh-client-ui-tool \u7684\n * ToolRow / AskQuestionCard\uFF0C\u907F\u514D\u540C\u4E00\u9875\u51FA\u73B0\u4E24\u5957\u89C6\u89C9\u3002 */\n\n.dsg-root {\n display: flex;\n flex-direction: column;\n gap: 6px;\n margin: 4px 0;\n}\n\n.dsg-form {\n display: flex;\n flex-direction: column;\n gap: 16px;\n}\n\n.dsg-progress {\n margin: 0;\n font-size: var(--dsh-content-font-size-secondary, 13px);\n line-height: calc(20px + var(--dsh-content-font-delta, 0px));\n color: var(--dsw-alias-label-tertiary);\n}\n\n.dsg-list {\n display: flex;\n flex-direction: column;\n gap: 16px;\n}\n\n.dsg-item {\n display: flex;\n flex-direction: column;\n gap: 4px;\n min-width: 0;\n}\n\n.dsg-question,\n.dsg-answer,\n.dsg-verdict {\n white-space: pre-wrap;\n overflow-wrap: anywhere;\n font-size: var(--dsh-content-font-size, 14px);\n line-height: calc(24px + var(--dsh-content-font-delta, 0px));\n}\n\n.dsg-question {\n color: var(--dsw-alias-label-primary);\n}\n\n.dsg-answer,\n.dsg-verdict {\n color: var(--dsw-alias-label-primary);\n}\n\n.dsg-failure {\n margin: 0;\n white-space: pre-wrap;\n overflow-wrap: anywhere;\n font-size: var(--dsh-content-font-size, 14px);\n line-height: calc(24px + var(--dsh-content-font-delta, 0px));\n color: var(--dsw-alias-state-error-primary);\n}\n\n.dsg-answerLine {\n display: block;\n}\n\n.dsg-skipped {\n color: var(--dsw-alias-label-tertiary);\n}\n\n.dsg-header {\n display: block;\n font-size: var(--dsh-content-font-size-secondary, 13px);\n color: var(--dsw-alias-label-caption);\n}\n\n.dsg-detail {\n margin: 2px 0 0;\n font-size: var(--dsh-content-font-size-secondary, 13px);\n color: var(--dsw-alias-label-secondary);\n}\n\n.dsg-options {\n display: flex;\n flex-direction: column;\n gap: 6px;\n margin-top: 4px;\n}\n\n.dsg-optionRow {\n display: flex;\n flex-direction: column;\n gap: 2px;\n min-width: 0;\n}\n\n.dsg-optionMain {\n display: flex;\n align-items: center;\n gap: 8px;\n min-width: 0;\n}\n\n.dsg-option {\n min-width: 0;\n font-size: var(--dsh-content-font-size, 14px);\n line-height: calc(24px + var(--dsh-content-font-delta, 0px));\n color: var(--dsw-alias-label-primary);\n}\n\n.dsg-badge {\n flex: none;\n}\n\n.dsg-optionDescription {\n margin: 0 0 0 24px;\n font-size: var(--dsh-content-font-size-secondary, 13px);\n line-height: calc(20px + var(--dsh-content-font-delta, 0px));\n color: var(--dsw-alias-label-tertiary);\n}\n\n/* \u591A\u884C\u81EA\u586B\uFF1Aui-primitives \u6CA1\u6709\u591A\u884C\u8F93\u5165\u63A7\u4EF6\uFF0C\u5B98\u65B9\u90A3\u5F20\u7B54\u9898\u5361\u4E5F\u662F\u81EA\u5DF1\u753B\u7684 textarea\u3002 */\n.dsg-custom {\n box-sizing: border-box;\n width: 100%;\n min-height: 56px;\n margin-top: 2px;\n padding: 6px 10px;\n resize: vertical;\n border: 0.5px solid var(--dsw-alias-border-l4);\n border-radius: 8px;\n background: var(--dsw-alias-bg-base);\n color: var(--dsw-alias-label-primary);\n font: inherit;\n font-size: var(--dsh-content-font-size, 14px);\n line-height: calc(24px + var(--dsh-content-font-delta, 0px));\n}\n\n.dsg-custom::placeholder {\n color: var(--dsw-alias-label-caption);\n}\n\n.dsg-custom:focus-visible {\n outline: 2px solid var(--dsw-alias-state-business-primary);\n outline-offset: 1px;\n}\n\n.dsg-footer {\n display: flex;\n flex-direction: column;\n align-items: flex-end;\n gap: 6px;\n}\n\n.dsg-import {\n flex: none;\n}\n\n.dsg-reminder,\n.dsg-closed {\n margin: 0;\n align-self: stretch;\n font-size: var(--dsh-content-font-size-secondary, 13px);\n line-height: calc(20px + var(--dsh-content-font-delta, 0px));\n color: var(--dsw-alias-state-warning-primary, var(--dsw-alias-label-secondary));\n}\n\n.dsg-closed {\n color: var(--dsw-alias-label-tertiary);\n}\n\n.dsg-violations {\n display: flex;\n flex-direction: column;\n gap: 8px;\n margin: 0;\n padding-left: 20px;\n font-size: var(--dsh-content-font-size, 14px);\n line-height: calc(24px + var(--dsh-content-font-delta, 0px));\n color: var(--dsw-alias-state-error-primary);\n}\n\n.dsg-raw {\n max-height: 360px;\n margin: 0;\n padding: 12px 16px;\n overflow: auto;\n border: 0.5px solid var(--dsw-alias-border-l1);\n border-radius: 12px;\n background: var(--dsw-alias-markdown-code-block);\n font: var(--dsw-font-markdown-code-block-small);\n white-space: pre-wrap;\n overflow-wrap: anywhere;\n color: var(--dsw-alias-label-secondary);\n}\n\n.dsg-inspectButton {\n display: inline-flex;\n align-self: flex-start;\n align-items: center;\n gap: 4px;\n padding: 2px 8px;\n border: 0.5px solid var(--dsw-alias-border-l4);\n border-radius: 999px;\n corner-shape: round;\n background: var(--dsw-alias-bg-base);\n color: var(--dsw-alias-label-secondary);\n font-size: 11px;\n line-height: 16px;\n opacity: 0;\n cursor: pointer;\n transition: opacity 100ms ease;\n}\n\n.dsg-root:hover .dsg-inspectButton,\n.dsg-inspectButton:focus-visible {\n opacity: 1;\n}\n\n.dsg-inspectButton:hover {\n background: var(--dsw-alias-interactive-bg-hover-solid);\n color: var(--dsw-alias-label-primary);\n}\n\n@media (prefers-reduced-motion: reduce) {\n .dsg-inspectButton {\n transition: none;\n }\n}\n";
|
|
310
466
|
|
|
311
467
|
// src/client/locales.js
|
|
312
|
-
var NS = "
|
|
468
|
+
var NS = "grillingForm";
|
|
313
469
|
var zh = {
|
|
314
|
-
"row.
|
|
315
|
-
"row.
|
|
316
|
-
"row.answered": "{answered}/{total} \u5DF2\u56DE\u7B54",
|
|
317
|
-
"row.skipped": "\u672A\u56DE\u7B54",
|
|
470
|
+
"row.progress": "\u8FD9\u4E00\u8F6E {total} \u9898 \xB7 \u5DF2\u586B {answered}",
|
|
471
|
+
"row.closed": "\u672C\u8F6E\u5DF2\u8FC7\uFF0C\u4EC5\u4F9B\u67E5\u770B",
|
|
318
472
|
"row.rejected": "\u5165\u53C2\u88AB\u62D2\u7EDD",
|
|
319
|
-
"row.cancelled": "\u5DF2\u53D6\u6D88",
|
|
320
|
-
"row.cancelledDetail": "\u672C\u8F6E\u5DF2\u53D6\u6D88\uFF0C\u672A\u63D0\u4EA4\u56DE\u7B54\u3002",
|
|
321
|
-
"row.interrupted": "\u5DF2\u4E2D\u65AD",
|
|
322
|
-
"row.interruptedDetail": "\u672C\u8F6E\u5DF2\u4E2D\u65AD\uFF0C\u672A\u63D0\u4EA4\u56DE\u7B54\u3002",
|
|
323
|
-
"row.failed": "\u8C03\u7528\u5931\u8D25",
|
|
324
473
|
"row.violations": "\u6821\u9A8C\u5931\u8D25",
|
|
474
|
+
"row.failed": "\u8C03\u7528\u5931\u8D25",
|
|
475
|
+
"row.unanswered": "\u672A\u4F5C\u7B54",
|
|
476
|
+
"row.recommended": "\u63A8\u8350",
|
|
477
|
+
"row.customLabel": "\u81EA\u586B",
|
|
478
|
+
"row.customPlaceholder": "\u9009\u9879\u4E0D\u591F\u7528\u7684\u8BDD\uFF0C\u5728\u8FD9\u91CC\u81EA\u5DF1\u5199\u4E00\u6BB5",
|
|
479
|
+
"row.import": "\u5BFC\u5165\u8F93\u5165\u6846",
|
|
480
|
+
"row.reminder": "\u8868\u5355\u91CC\u586B\u4E86\u4E1C\u897F\uFF0C\u8FD8\u6CA1\u5BFC\u5165\u8F93\u5165\u6846",
|
|
325
481
|
"row.inspect": "\u67E5\u770B",
|
|
326
482
|
"copy": "\u590D\u5236",
|
|
327
483
|
"copied": "\u5DF2\u590D\u5236",
|
|
328
484
|
"markdown.footnotes": "\u811A\u6CE8"
|
|
329
485
|
};
|
|
330
486
|
var en = {
|
|
331
|
-
"row.
|
|
332
|
-
"row.
|
|
333
|
-
"row.
|
|
334
|
-
"row.skipped": "Not answered",
|
|
335
|
-
"row.rejected": "Rejected before asking",
|
|
336
|
-
"row.cancelled": "cancelled",
|
|
337
|
-
"row.cancelledDetail": "This round was cancelled before answers were submitted.",
|
|
338
|
-
"row.interrupted": "interrupted",
|
|
339
|
-
"row.interruptedDetail": "This round was interrupted before answers were submitted.",
|
|
340
|
-
"row.failed": "Tool call failed",
|
|
487
|
+
"row.progress": "{total} question(s) this round \xB7 {answered} filled",
|
|
488
|
+
"row.closed": "This round is over; the form is read-only",
|
|
489
|
+
"row.rejected": "Rejected before showing",
|
|
341
490
|
"row.violations": "Rejected input",
|
|
491
|
+
"row.failed": "Tool call failed",
|
|
492
|
+
"row.unanswered": "Not answered",
|
|
493
|
+
"row.recommended": "Recommended",
|
|
494
|
+
"row.customLabel": "Your own answer",
|
|
495
|
+
"row.customPlaceholder": "Write your own answer here if the options do not cover it",
|
|
496
|
+
"row.import": "Import to composer",
|
|
497
|
+
"row.reminder": "This form has content that is not in the composer yet",
|
|
342
498
|
"row.inspect": "Inspect",
|
|
343
499
|
"copy": "Copy",
|
|
344
500
|
"copied": "Copied",
|
|
@@ -347,7 +503,7 @@ var en = {
|
|
|
347
503
|
|
|
348
504
|
// src/client/index.js
|
|
349
505
|
var PACKAGE_ID = "@lynn123411/dsh-ask-user-grilling";
|
|
350
|
-
var CSS_TAG = `${PACKAGE_ID}/
|
|
506
|
+
var CSS_TAG = `${PACKAGE_ID}/GrillingFormRow.css`;
|
|
351
507
|
var inject = ["locale", "slots"];
|
|
352
508
|
function injectStyles() {
|
|
353
509
|
if (typeof document === "undefined") return;
|
|
@@ -358,16 +514,16 @@ function injectStyles() {
|
|
|
358
514
|
tag.dataset.pluginCss = CSS_TAG;
|
|
359
515
|
document.head.appendChild(tag);
|
|
360
516
|
}
|
|
361
|
-
tag.textContent =
|
|
517
|
+
tag.textContent = GrillingFormRow_default;
|
|
362
518
|
}
|
|
363
519
|
function apply(ctx) {
|
|
364
520
|
injectStyles();
|
|
365
521
|
ctx.effect(() => ctx.locale.register(NS, { zh, en }), "dsh-ask-user-grilling: dictionaries");
|
|
366
522
|
ctx.slots.inject("tool.call.toolview", () => ctx.slots.register({
|
|
367
523
|
name: "tool.call.toolview",
|
|
368
|
-
key: "
|
|
524
|
+
key: "grilling_form",
|
|
369
525
|
locale: NS
|
|
370
|
-
},
|
|
526
|
+
}, GrillingFormRow));
|
|
371
527
|
}
|
|
372
528
|
return module.exports; } });
|
|
373
529
|
//# sourceMappingURL=client.js.map
|