@max-null/dsh-node-appearance 0.6.0 → 0.7.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 +42 -11
- package/docs/shots/Turn/346/221/230/350/246/201/346/235/241-/346/224/266/350/265/267.png +0 -0
- package/docs/shots//347/233/256/346/240/207/350/257/246/346/203/205-/345/210/206/346/235/241/346/212/230/350/241/214.png +0 -0
- package/docs/shots//347/273/204/345/244/264/347/235/200/350/211/262-/345/261/225/345/274/200.png +0 -0
- package/docs/shots//347/273/204/345/244/264/347/235/200/350/211/262-/346/224/266/350/265/267.png +0 -0
- package/docs/shots//350/247/246/345/217/221/345/215/241-/345/261/225/345/274/200.png +0 -0
- package/docs/shots//350/247/246/345/217/221/345/215/241-/346/224/266/350/265/267.png +0 -0
- package/lib/client.js +590 -82
- package/lib/client.js.map +1 -1
- package/lib/index.js +2 -0
- package/lib/types/client/goal-detail.d.ts.map +1 -1
- package/lib/types/client/index.d.ts.map +1 -1
- package/lib/types/client/objective.d.ts +19 -0
- package/lib/types/client/objective.d.ts.map +1 -0
- package/lib/types/client/palette.d.ts +20 -3
- package/lib/types/client/palette.d.ts.map +1 -1
- package/lib/types/client/settings-card.d.ts.map +1 -1
- package/lib/types/client/trigger-card.d.ts +20 -0
- package/lib/types/client/trigger-card.d.ts.map +1 -0
- package/lib/types/client/trigger-model.d.ts +135 -0
- package/lib/types/client/trigger-model.d.ts.map +1 -0
- package/lib/types/index.d.ts +5 -0
- package/lib/types/index.d.ts.map +1 -1
- package/package.json +7 -7
package/lib/client.js
CHANGED
|
@@ -31,6 +31,7 @@ window.__ModuleLoader__.load({
|
|
|
31
31
|
command: "#f97316",
|
|
32
32
|
thinking: "#c4b5fd",
|
|
33
33
|
context: "#8a9bb5",
|
|
34
|
+
summary: "#94a3b8",
|
|
34
35
|
steering: "#14b8a6",
|
|
35
36
|
other: "#64748b"
|
|
36
37
|
};
|
|
@@ -84,6 +85,30 @@ window.__ModuleLoader__.load({
|
|
|
84
85
|
ask: ["ask_user_question"],
|
|
85
86
|
other: []
|
|
86
87
|
};
|
|
88
|
+
/**
|
|
89
|
+
* Process activity → the category whose color paints a collapsed group header.
|
|
90
|
+
*
|
|
91
|
+
* The mapping lands on categories the plugin already ships, so group headers
|
|
92
|
+
* reuse the configured palette and add no settings field. It is deliberately
|
|
93
|
+
* the same classification the expanded member rows get: `search` here means
|
|
94
|
+
* code search (`grep`/`glob`, a `file` category tool), not `web_search`.
|
|
95
|
+
*/
|
|
96
|
+
const PROCESS_ACTIVITIES = {
|
|
97
|
+
thinking: "thinking",
|
|
98
|
+
read: "file",
|
|
99
|
+
readImage: "file",
|
|
100
|
+
search: "file",
|
|
101
|
+
edit: "file",
|
|
102
|
+
write: "file",
|
|
103
|
+
commands: "execute",
|
|
104
|
+
code: "execute",
|
|
105
|
+
webSearch: "search",
|
|
106
|
+
webFetch: "search",
|
|
107
|
+
subagents: "agent",
|
|
108
|
+
plan: "task",
|
|
109
|
+
questions: "ask",
|
|
110
|
+
tools: "other"
|
|
111
|
+
};
|
|
87
112
|
/** Selector matching every tool row inside a tool-call node. */
|
|
88
113
|
const TOOL_ROW = "[data-chat-flow-kind=\"tool-call\"] [data-tool]";
|
|
89
114
|
/** The ToolRow root itself (carries data-variant; the wrapper callRow does not). */
|
|
@@ -97,9 +122,54 @@ window.__ModuleLoader__.load({
|
|
|
97
122
|
/** Selector of a settled tool-result row (rc.8: tool results render as their own row). */
|
|
98
123
|
const TOOL_RESULT_ROW = "[data-chat-flow-kind=\"tool-result\"]";
|
|
99
124
|
/**
|
|
100
|
-
*
|
|
125
|
+
* Selector of a **collapsed** Turn-level summary bar — the outermost fold
|
|
126
|
+
* ("已完成工作 · 用时 35 秒" / "深度求索中,用时 N"). One Turn's members sit
|
|
127
|
+
* under it, each painting itself.
|
|
128
|
+
*
|
|
129
|
+
* `data-open` is present exactly while those members are expanded, so
|
|
130
|
+
* `:not([data-open])` is the folded state. Both kernel 0.1.7-rc.2 and
|
|
131
|
+
* 0.2.0-rc.1 publish it on the same button; 0.2.0 moved the running label to
|
|
132
|
+
* `RunningStatus` (`data-chat-running`) but left this node's attributes alone.
|
|
133
|
+
*
|
|
134
|
+
* Deliberately NOT in {@link ACCENTED_ROWS}: the kernel renders this one as a
|
|
135
|
+
* full-width section divider (`padding: 0` over a bottom hairline), not as a
|
|
136
|
+
* block row. An inset rail lands flush against the label and reads as a stray
|
|
137
|
+
* vertical stroke, and the 3px `padding-left` that keeps the rail off the text
|
|
138
|
+
* pushes the whole bar out of line with every other row. It takes the accent on
|
|
139
|
+
* that existing hairline instead, plus the same 8% wash.
|
|
140
|
+
*/
|
|
141
|
+
const TURN_SUMMARY = "[data-turn-process]:not([data-open])";
|
|
142
|
+
/**
|
|
143
|
+
* Selector of a collapsed step-process group header — the one-line summary the
|
|
144
|
+
* kernel folds a run of tool calls into ("已读取文件并执行了命令").
|
|
145
|
+
*
|
|
146
|
+
* Collapsed only: while the group is open its member rows carry their own
|
|
147
|
+
* category colors, and painting the header too would stack two colored layers.
|
|
148
|
+
* The `aria-expanded` attribute is the header button's own disclosure state.
|
|
149
|
+
*
|
|
150
|
+
* `activity` narrows the selector to one published value. Narrowing does NOT
|
|
151
|
+
* raise specificity: `[attr]` and `[attr="value"]` each count as exactly one
|
|
152
|
+
* attribute selector. The general form must therefore be declared first and the
|
|
153
|
+
* per-activity forms after it — `buildCss` does that, and the palette spec
|
|
154
|
+
* guards the order. Same mechanism, same trap, as the unlisted-tool fallback.
|
|
155
|
+
* @param activity - one published activity, or undefined for the general form.
|
|
156
|
+
* @returns a CSS attribute selector for the collapsed process-group header.
|
|
157
|
+
*/
|
|
158
|
+
function collapsedProcessHeader(activity) {
|
|
159
|
+
return `[data-step-process] [data-process-activity${activity === void 0 ? "" : `="${activity}"`}][aria-expanded="false"]`;
|
|
160
|
+
}
|
|
161
|
+
/**
|
|
162
|
+
* The same header while expanded: no paint, and no `--ncolor-accent` read. It
|
|
163
|
+
* exists only to hold the paint rule's 3px `padding-left`, so opening a group
|
|
164
|
+
* does not shift its header sideways.
|
|
165
|
+
*/
|
|
166
|
+
const PROCESS_HEADER_OPEN = "[data-step-process] [data-process-activity][aria-expanded=\"true\"]";
|
|
167
|
+
/**
|
|
168
|
+
* The rows that carry the accent rail + wash: the ToolRow root (not its wrapper
|
|
101
169
|
* callRow — both carry data-tool, only the inner row carries data-variant),
|
|
102
|
-
* command nodes, Think rows, injected-context rows,
|
|
170
|
+
* command nodes, Think rows, injected-context rows, tool-result rows, and a
|
|
171
|
+
* collapsed step-process group header. The collapsed Turn summary bar is
|
|
172
|
+
* deliberately absent — see {@link TURN_SUMMARY}.
|
|
103
173
|
* User input rows are excluded — right-alignment already
|
|
104
174
|
* distinguishes them (2026-08-20 用户反馈);steering rows 也走独立规则
|
|
105
175
|
* (见 buildCss:在 userStack 层做 wash,不涂整行 rail)。
|
|
@@ -111,7 +181,8 @@ window.__ModuleLoader__.load({
|
|
|
111
181
|
COMMAND_ROW,
|
|
112
182
|
THINK_ROW,
|
|
113
183
|
CONTEXT_ROW,
|
|
114
|
-
TOOL_RESULT_ROW
|
|
184
|
+
TOOL_RESULT_ROW,
|
|
185
|
+
collapsedProcessHeader()
|
|
115
186
|
].join(",\n");
|
|
116
187
|
/**
|
|
117
188
|
* Accept a configured CSS color (hex, color functions) or reject it so an
|
|
@@ -167,10 +238,19 @@ window.__ModuleLoader__.load({
|
|
|
167
238
|
lines.push(`${THINK_ROW} { --ncolor-accent: ${colors.thinking}; }`);
|
|
168
239
|
lines.push(`${CONTEXT_ROW} { --ncolor-accent: ${colors.context}; }`);
|
|
169
240
|
lines.push(`${TOOL_RESULT_ROW} { --ncolor-accent: ${colors.file}; }`);
|
|
241
|
+
lines.push(`${TURN_SUMMARY} { --ncolor-accent: ${colors.summary}; }`);
|
|
242
|
+
lines.push(`${collapsedProcessHeader()} { --ncolor-accent: ${colors.other}; }`);
|
|
243
|
+
for (const activity of Object.keys(PROCESS_ACTIVITIES)) lines.push(`${collapsedProcessHeader(activity)} { --ncolor-accent: ${colors[PROCESS_ACTIVITIES[activity]]}; }`);
|
|
170
244
|
lines.push(`${ACCENTED_ROWS} {
|
|
171
245
|
box-shadow: inset 3px 0 0 var(--ncolor-accent);
|
|
172
246
|
background-color: color-mix(in srgb, var(--ncolor-accent) 8%, transparent);
|
|
173
247
|
padding-left: 3px;
|
|
248
|
+
}`);
|
|
249
|
+
lines.push(`${collapsedProcessHeader()} { padding-left: 8px; }`);
|
|
250
|
+
lines.push(`${PROCESS_HEADER_OPEN} { padding-left: 8px; }`);
|
|
251
|
+
lines.push(`${TURN_SUMMARY} {
|
|
252
|
+
border-bottom-color: var(--ncolor-accent);
|
|
253
|
+
background-color: color-mix(in srgb, var(--ncolor-accent) 8%, transparent);
|
|
174
254
|
}`);
|
|
175
255
|
lines.push(`[data-chat-flow-kind="steering"] [data-actions-reveal] > :first-child {
|
|
176
256
|
position: relative;
|
|
@@ -196,45 +276,45 @@ window.__ModuleLoader__.load({
|
|
|
196
276
|
}
|
|
197
277
|
//#endregion
|
|
198
278
|
//#region \0dsh-css:H:\MaxNull\WorkStation\max-null-plugins\dsh-node-appearance\src\client\card.module.css.mjs
|
|
199
|
-
const css$
|
|
200
|
-
const tagId$
|
|
201
|
-
if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=" + JSON.stringify(tagId$
|
|
279
|
+
const css$4 = ".CDqThG_card{border:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-layer-3);border-radius:12px;list-style:none;transition:border-color .16s,background .16s}.CDqThG_card:hover{border-color:var(--dsw-alias-label-dimmed)}.CDqThG_cardOpen{background:var(--dsw-alias-bg-layer-2);border-color:var(--dsw-alias-label-dimmed)}.CDqThG_header{appearance:none;width:100%;font:inherit;color:inherit;text-align:left;cursor:pointer;background:0 0;border:0;border-radius:12px;align-items:center;gap:12px;padding:14px 16px;display:flex}.CDqThG_header:focus-visible{outline:2px solid var(--dsw-alias-brand-primary);outline-offset:-2px}.CDqThG_headText{flex-direction:column;flex:1;gap:4px;min-width:0;display:flex}.CDqThG_name{color:var(--dsw-alias-label-primary);font-size:15px;font-weight:600;line-height:1.4}.CDqThG_description{color:var(--dsw-alias-label-tertiary);font-size:13px;line-height:1.5}.CDqThG_chevron{color:var(--dsw-alias-label-tertiary);flex:none;transition:transform .16s}.CDqThG_chevronOpen{transform:rotate(180deg)}.CDqThG_body{border-top:1px solid var(--dsw-alias-border-l2);margin:0 16px;padding-bottom:8px}.CDqThG_readOnly,.CDqThG_statusLine{color:var(--dsw-alias-label-tertiary);margin:12px 0 0;font-size:12px;line-height:1.5}.CDqThG_disabled{opacity:.55;pointer-events:none}.CDqThG_footer{border-top:1px solid var(--dsw-alias-border-l2);justify-content:flex-end;align-items:center;gap:8px;padding:16px 0 4px;display:flex}.CDqThG_reset{appearance:none;border:1px solid var(--dsw-alias-border-l2);font:inherit;cursor:pointer;color:var(--dsw-alias-label-secondary);background:0 0;border-radius:8px;padding:5px 14px;font-size:13px;line-height:1.5}.CDqThG_reset:hover:not(:disabled){color:var(--dsw-alias-label-primary);border-color:var(--dsw-alias-label-dimmed)}.CDqThG_resetConfirm{border-color:var(--dsw-alias-state-error-primary);color:var(--dsw-alias-state-error-primary)}.CDqThG_reset:disabled{opacity:.4;cursor:default}.CDqThG_reset:focus-visible{outline:2px solid var(--dsw-alias-brand-primary);outline-offset:1px}.CDqThG_row{border-top:1px solid var(--dsw-alias-border-l2);align-items:center;gap:10px;margin-top:10px;padding:10px 0 4px;display:flex;position:relative}.CDqThG_row:first-child{border-top:none;margin-top:4px}.CDqThG_rowLabel{min-width:0;color:var(--dsw-alias-label-primary);flex-direction:column;flex:1;gap:2px;font-size:13px;font-weight:500;line-height:1.5;display:flex}.CDqThG_rowHint{color:var(--dsw-alias-label-tertiary);font-size:12px;font-weight:400;line-height:1.5}.CDqThG_colorInput{border:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-layer-3);cursor:pointer;border-radius:8px;flex:none;width:34px;height:28px;padding:2px}.CDqThG_colorValue{width:64px;color:var(--dsw-alias-label-tertiary);font-variant-numeric:tabular-nums;flex:none;font-size:12px;line-height:1.5}.CDqThG_sectionTitle{color:var(--dsw-alias-label-primary);margin:14px 0 0;font-size:13px;font-weight:600;line-height:1.5}.CDqThG_toolName{min-width:0;color:var(--dsw-alias-label-primary);text-overflow:ellipsis;white-space:nowrap;flex:1;font-size:13px;line-height:1.5;overflow:hidden}.CDqThG_removeButton{appearance:none;border:1px solid var(--dsw-alias-border-l2);font:inherit;cursor:pointer;color:var(--dsw-alias-label-secondary);background:0 0;border-radius:8px;flex:none;padding:3px 10px;font-size:12px;line-height:1.5}.CDqThG_removeButton:hover{color:var(--dsw-alias-label-primary);border-color:var(--dsw-alias-label-dimmed)}.CDqThG_addRow{align-items:center;gap:8px;margin-top:10px;margin-bottom:12px;display:flex}.CDqThG_toolInput{border:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-layer-3);min-width:0;height:34px;font:inherit;color:var(--dsw-alias-label-primary);border-radius:8px;flex:1;padding:0 12px;font-size:13px;line-height:1.5}.CDqThG_toolInput:focus-visible{border-color:var(--dsw-alias-brand-primary);outline:none}.CDqThG_toolInput::placeholder{color:var(--dsw-alias-label-tertiary)}.CDqThG_addButton{appearance:none;font:inherit;cursor:pointer;background:var(--dsw-alias-label-primary);color:var(--dsw-alias-bg-layer-3);border:1px solid #0000;border-radius:8px;flex:none;padding:5px 14px;font-size:13px;line-height:1.5}.CDqThG_addButton:disabled{opacity:.4;cursor:default}.CDqThG_switch{cursor:pointer;background:var(--dsw-alias-border-l4,#00000029);border:none;border-radius:11px;flex:none;width:40px;height:22px;padding:0;transition:background .15s}.CDqThG_switch.CDqThG_on{background:var(--dsw-alias-state-business-primary,#4fc3f7)}.CDqThG_knob{pointer-events:none;background:#fff;border-radius:8px;width:16px;height:16px;margin-left:2px;transition:margin-left .15s;display:block}.CDqThG_switch.CDqThG_on .CDqThG_knob{margin-left:22px}";
|
|
280
|
+
const tagId$4 = "@max-null/dsh-node-appearance/card.module.css";
|
|
281
|
+
if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=" + JSON.stringify(tagId$4) + "]") === null) {
|
|
202
282
|
const tag = document.createElement("style");
|
|
203
283
|
tag.dataset.plugin = "@max-null/dsh-node-appearance";
|
|
204
|
-
tag.dataset.pluginCss = tagId$
|
|
205
|
-
tag.textContent = css$
|
|
284
|
+
tag.dataset.pluginCss = tagId$4;
|
|
285
|
+
tag.textContent = css$4;
|
|
206
286
|
document.head.appendChild(tag);
|
|
207
287
|
}
|
|
208
288
|
var card_module_css_default = {
|
|
209
|
-
"readOnly": "CDqThG_readOnly",
|
|
210
|
-
"body": "CDqThG_body",
|
|
211
|
-
"rowHint": "CDqThG_rowHint",
|
|
212
|
-
"addRow": "CDqThG_addRow",
|
|
213
|
-
"toolInput": "CDqThG_toolInput",
|
|
214
|
-
"reset": "CDqThG_reset",
|
|
215
|
-
"chevron": "CDqThG_chevron",
|
|
216
289
|
"toolName": "CDqThG_toolName",
|
|
217
|
-
"
|
|
290
|
+
"on": "CDqThG_on",
|
|
291
|
+
"description": "CDqThG_description",
|
|
218
292
|
"card": "CDqThG_card",
|
|
219
|
-
"
|
|
220
|
-
"
|
|
221
|
-
"
|
|
293
|
+
"headText": "CDqThG_headText",
|
|
294
|
+
"colorValue": "CDqThG_colorValue",
|
|
295
|
+
"addButton": "CDqThG_addButton",
|
|
296
|
+
"removeButton": "CDqThG_removeButton",
|
|
297
|
+
"knob": "CDqThG_knob",
|
|
298
|
+
"sectionTitle": "CDqThG_sectionTitle",
|
|
222
299
|
"name": "CDqThG_name",
|
|
300
|
+
"addRow": "CDqThG_addRow",
|
|
301
|
+
"chevronOpen": "CDqThG_chevronOpen",
|
|
223
302
|
"row": "CDqThG_row",
|
|
224
|
-
"
|
|
225
|
-
"
|
|
226
|
-
"
|
|
303
|
+
"body": "CDqThG_body",
|
|
304
|
+
"header": "CDqThG_header",
|
|
305
|
+
"readOnly": "CDqThG_readOnly",
|
|
306
|
+
"reset": "CDqThG_reset",
|
|
307
|
+
"disabled": "CDqThG_disabled",
|
|
308
|
+
"toolInput": "CDqThG_toolInput",
|
|
309
|
+
"rowLabel": "CDqThG_rowLabel",
|
|
227
310
|
"cardOpen": "CDqThG_cardOpen",
|
|
228
|
-
"description": "CDqThG_description",
|
|
229
311
|
"statusLine": "CDqThG_statusLine",
|
|
230
|
-
"knob": "CDqThG_knob",
|
|
231
|
-
"colorValue": "CDqThG_colorValue",
|
|
232
312
|
"colorInput": "CDqThG_colorInput",
|
|
313
|
+
"rowHint": "CDqThG_rowHint",
|
|
233
314
|
"switch": "CDqThG_switch",
|
|
234
|
-
"
|
|
235
|
-
"
|
|
236
|
-
"
|
|
237
|
-
"header": "CDqThG_header"
|
|
315
|
+
"chevron": "CDqThG_chevron",
|
|
316
|
+
"resetConfirm": "CDqThG_resetConfirm",
|
|
317
|
+
"footer": "CDqThG_footer"
|
|
238
318
|
};
|
|
239
319
|
//#endregion
|
|
240
320
|
//#region src/client/settings-card.tsx
|
|
@@ -263,6 +343,7 @@ window.__ModuleLoader__.load({
|
|
|
263
343
|
command: "指令节点",
|
|
264
344
|
thinking: "思考过程",
|
|
265
345
|
context: "上下文注入",
|
|
346
|
+
summary: "工作摘要",
|
|
266
347
|
steering: "模型引导",
|
|
267
348
|
other: "其他工具"
|
|
268
349
|
};
|
|
@@ -630,42 +711,42 @@ window.__ModuleLoader__.load({
|
|
|
630
711
|
}
|
|
631
712
|
//#endregion
|
|
632
713
|
//#region \0dsh-css:H:\MaxNull\WorkStation\max-null-plugins\dsh-node-appearance\src\client\ask-card.module.css.mjs
|
|
633
|
-
const css$
|
|
634
|
-
const tagId$
|
|
635
|
-
if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=" + JSON.stringify(tagId$
|
|
714
|
+
const css$3 = ".ylzLDa_root{--ask-accent:var(--ncolor-accent,#65a30d);flex-direction:column;display:flex}.ylzLDa_row{position:relative;overflow:hidden}.ylzLDa_root[data-state=running] .ylzLDa_row:after{content:\"\";background:linear-gradient(90deg, transparent 0%, color-mix(in srgb, var(--dsw-alias-bg-base) 60%, transparent) 55%, transparent 100%);pointer-events:none;width:300px;animation:2.6s ease-out infinite ylzLDa_ask-row-sweep;position:absolute;top:0;bottom:0;left:0}@keyframes ylzLDa_ask-row-sweep{0%{left:-300px}90%,to{left:100%}}.ylzLDa_leading{flex-shrink:0}.ylzLDa_chevron{color:var(--dsw-alias-label-secondary)}.ylzLDa_title{font-weight:400}.ylzLDa_sep{background:var(--dsw-alias-label-caption);border-radius:1px;flex:none;width:2px;height:2px;margin:0 8px}.ylzLDa_summary{text-overflow:ellipsis;white-space:nowrap;min-width:0;font-size:var(--dsh-content-font-size-secondary,13px);line-height:calc(24px + var(--dsh-content-font-delta,0px));color:var(--dsw-alias-label-tertiary);flex:auto;overflow:hidden}.ylzLDa_bodyWrap{flex-direction:column;display:flex}.ylzLDa_card{border:1px solid color-mix(in srgb, var(--ask-accent) 34%, transparent);background:color-mix(in srgb, var(--ask-accent) 6%, var(--dsw-alias-bg-base));border-radius:12px;flex-direction:column;gap:14px;margin:4px 0 4px 4px;padding:14px 16px;display:flex}.ylzLDa_item{flex-direction:column;gap:8px;min-width:0;display:flex}.ylzLDa_header{color:var(--ask-accent);font-size:var(--dsh-content-font-size-secondary,13px);font-weight:500;line-height:calc(20px + var(--dsh-content-font-delta,0px))}.ylzLDa_question{color:var(--dsw-alias-label-primary);font-size:var(--dsh-content-font-size,14px);line-height:calc(22px + var(--dsh-content-font-delta,0px));white-space:pre-wrap;overflow-wrap:anywhere}.ylzLDa_detail{color:var(--dsw-alias-label-tertiary);font-size:var(--dsh-content-font-size-secondary,13px);line-height:calc(20px + var(--dsh-content-font-delta,0px));white-space:pre-wrap;overflow-wrap:anywhere}.ylzLDa_verdict{color:var(--dsw-alias-label-tertiary);font-size:var(--dsh-content-font-size-secondary,13px);line-height:calc(20px + var(--dsh-content-font-delta,0px));margin:0}.ylzLDa_options{flex-direction:column;gap:6px;display:flex}.ylzLDa_option{border:1px solid var(--dsw-alias-border-l3);background:var(--dsw-alias-bg-layer-1);color:var(--dsw-alias-label-secondary);font-size:var(--dsh-content-font-size,14px);line-height:calc(22px + var(--dsh-content-font-delta,0px));border-radius:8px;align-items:flex-start;gap:8px;padding:9px 12px;display:flex}.ylzLDa_option[data-chosen]{border-color:var(--ask-accent);background:color-mix(in srgb, var(--ask-accent) 14%, transparent);color:var(--ask-accent);font-weight:500}.ylzLDa_marker{width:16px;height:calc(22px + var(--dsh-content-font-delta,0px));flex:none;justify-content:center;align-items:center;display:inline-flex}.ylzLDa_optionText{flex-direction:column;gap:2px;min-width:0;display:flex}.ylzLDa_label{overflow-wrap:anywhere}.ylzLDa_desc{color:inherit;opacity:.72;font-size:var(--dsh-content-font-size-secondary,13px);font-weight:400;line-height:calc(20px + var(--dsh-content-font-delta,0px));overflow-wrap:anywhere}.ylzLDa_answers{flex-direction:column;gap:2px;display:flex}.ylzLDa_answerLine{color:var(--dsw-alias-label-primary);font-size:var(--dsh-content-font-size,14px);line-height:calc(22px + var(--dsh-content-font-delta,0px));white-space:pre-wrap;overflow-wrap:anywhere}.ylzLDa_answersEmpty{color:var(--dsw-alias-label-tertiary);font-size:var(--dsh-content-font-size,14px);line-height:calc(22px + var(--dsh-content-font-delta,0px))}.ylzLDa_fallback{white-space:pre-wrap;overflow-wrap:anywhere;font:var(--dsw-font-xs-13);color:var(--dsw-alias-label-tertiary);margin:4px 0 4px 4px}.ylzLDa_inspectButton{border:.5px solid var(--dsw-alias-border-l3);corner-shape:round;background:var(--dsw-alias-bg-base);color:var(--dsw-alias-label-secondary);cursor:pointer;opacity:0;border-radius:999px;align-self:flex-start;align-items:center;gap:4px;margin:4px 0 2px 4px;padding:2px 8px;font-size:11px;line-height:16px;transition:opacity .1s;display:inline-flex}.ylzLDa_root:hover .ylzLDa_inspectButton,.ylzLDa_inspectButton:focus-visible{opacity:1}.ylzLDa_inspectButton:hover{background:var(--dsw-alias-interactive-bg-hover-solid);color:var(--dsw-alias-label-primary)}";
|
|
715
|
+
const tagId$3 = "@max-null/dsh-node-appearance/ask-card.module.css";
|
|
716
|
+
if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=" + JSON.stringify(tagId$3) + "]") === null) {
|
|
636
717
|
const tag = document.createElement("style");
|
|
637
718
|
tag.dataset.plugin = "@max-null/dsh-node-appearance";
|
|
638
|
-
tag.dataset.pluginCss = tagId$
|
|
639
|
-
tag.textContent = css$
|
|
719
|
+
tag.dataset.pluginCss = tagId$3;
|
|
720
|
+
tag.textContent = css$3;
|
|
640
721
|
document.head.appendChild(tag);
|
|
641
722
|
}
|
|
642
723
|
var ask_card_module_css_default = {
|
|
643
|
-
"question": "ylzLDa_question",
|
|
644
|
-
"optionText": "ylzLDa_optionText",
|
|
645
|
-
"ask-row-sweep": "ylzLDa_ask-row-sweep",
|
|
646
724
|
"summary": "ylzLDa_summary",
|
|
647
|
-
"
|
|
725
|
+
"answerLine": "ylzLDa_answerLine",
|
|
648
726
|
"header": "ylzLDa_header",
|
|
727
|
+
"title": "ylzLDa_title",
|
|
728
|
+
"optionText": "ylzLDa_optionText",
|
|
729
|
+
"ask-row-sweep": "ylzLDa_ask-row-sweep",
|
|
649
730
|
"row": "ylzLDa_row",
|
|
650
|
-
"
|
|
731
|
+
"item": "ylzLDa_item",
|
|
651
732
|
"detail": "ylzLDa_detail",
|
|
652
|
-
"
|
|
653
|
-
"bodyWrap": "ylzLDa_bodyWrap",
|
|
654
|
-
"sep": "ylzLDa_sep",
|
|
655
|
-
"leading": "ylzLDa_leading",
|
|
733
|
+
"verdict": "ylzLDa_verdict",
|
|
656
734
|
"option": "ylzLDa_option",
|
|
657
|
-
"desc": "ylzLDa_desc",
|
|
658
|
-
"answers": "ylzLDa_answers",
|
|
659
|
-
"answersEmpty": "ylzLDa_answersEmpty",
|
|
660
|
-
"card": "ylzLDa_card",
|
|
661
735
|
"chevron": "ylzLDa_chevron",
|
|
662
|
-
"title": "ylzLDa_title",
|
|
663
736
|
"root": "ylzLDa_root",
|
|
737
|
+
"answersEmpty": "ylzLDa_answersEmpty",
|
|
738
|
+
"answers": "ylzLDa_answers",
|
|
664
739
|
"fallback": "ylzLDa_fallback",
|
|
665
|
-
"
|
|
666
|
-
"
|
|
740
|
+
"question": "ylzLDa_question",
|
|
741
|
+
"desc": "ylzLDa_desc",
|
|
742
|
+
"card": "ylzLDa_card",
|
|
743
|
+
"sep": "ylzLDa_sep",
|
|
667
744
|
"marker": "ylzLDa_marker",
|
|
668
|
-
"
|
|
745
|
+
"label": "ylzLDa_label",
|
|
746
|
+
"inspectButton": "ylzLDa_inspectButton",
|
|
747
|
+
"bodyWrap": "ylzLDa_bodyWrap",
|
|
748
|
+
"options": "ylzLDa_options",
|
|
749
|
+
"leading": "ylzLDa_leading"
|
|
669
750
|
};
|
|
670
751
|
//#endregion
|
|
671
752
|
//#region src/client/ask-card.tsx
|
|
@@ -919,35 +1000,35 @@ window.__ModuleLoader__.load({
|
|
|
919
1000
|
}
|
|
920
1001
|
//#endregion
|
|
921
1002
|
//#region \0dsh-css:H:\MaxNull\WorkStation\max-null-plugins\dsh-node-appearance\src\client\deliverable-row.module.css.mjs
|
|
922
|
-
const css$
|
|
923
|
-
const tagId$
|
|
924
|
-
if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=" + JSON.stringify(tagId$
|
|
1003
|
+
const css$2 = "._8xFzxq_root{--deliverable-accent:var(--ncolor-accent,#06b6d4);flex-direction:column;display:flex}._8xFzxq_row{position:relative;overflow:hidden}._8xFzxq_root[data-state=running] ._8xFzxq_row:after{content:\"\";background:linear-gradient(90deg, transparent 0%, color-mix(in srgb, var(--dsw-alias-bg-base) 60%, transparent) 55%, transparent 100%);pointer-events:none;width:300px;animation:2.6s ease-out infinite _8xFzxq_deliverable-row-sweep;position:absolute;top:0;bottom:0;left:0}@keyframes _8xFzxq_deliverable-row-sweep{0%{left:-300px}90%,to{left:100%}}._8xFzxq_leading{flex-shrink:0}._8xFzxq_chevron{color:var(--dsw-alias-label-secondary)}._8xFzxq_title{font-weight:400}._8xFzxq_sep{background:var(--dsw-alias-label-caption);border-radius:1px;flex:none;width:2px;height:2px;margin:0 8px}._8xFzxq_summary{min-width:0;font-size:var(--dsh-content-font-size-secondary,13px);line-height:calc(24px + var(--dsh-content-font-delta,0px));color:var(--dsw-alias-label-tertiary);flex:auto;align-items:center;gap:8px;display:flex;overflow:hidden}._8xFzxq_state{color:var(--dsw-alias-label-secondary);flex:none}._8xFzxq_paths{text-overflow:ellipsis;white-space:nowrap;min-width:0;overflow:hidden}._8xFzxq_bodyWrap{flex-direction:column;padding:2px 0 2px 4px;display:flex}._8xFzxq_files{flex-direction:column;gap:4px;margin:4px 0 0;padding:0;list-style:none;display:flex}._8xFzxq_file{align-items:center;gap:8px;min-width:0;display:flex}._8xFzxq_ext{box-sizing:border-box;background:color-mix(in srgb, var(--deliverable-accent) 14%, transparent);width:38px;color:var(--deliverable-accent);letter-spacing:.04em;text-align:center;border-radius:4px;flex:none;padding:1px 4px;font-size:10px;font-weight:600;line-height:16px}._8xFzxq_name{color:var(--dsw-alias-label-primary);font-size:var(--dsh-content-font-size,14px);line-height:calc(20px + var(--dsh-content-font-delta,0px));overflow-wrap:anywhere;flex:none}._8xFzxq_path{text-overflow:ellipsis;white-space:nowrap;min-width:0;color:var(--dsw-alias-label-tertiary);font-size:var(--dsh-content-font-size-secondary,13px);line-height:calc(20px + var(--dsh-content-font-delta,0px));flex:auto;overflow:hidden}._8xFzxq_meta{color:var(--dsw-alias-label-tertiary);font-size:var(--dsh-content-font-size-secondary,13px);line-height:calc(20px + var(--dsh-content-font-delta,0px));margin-top:10px}._8xFzxq_output{background:var(--dsw-alias-bg-layer-1);color:var(--dsw-alias-label-secondary);white-space:pre-wrap;overflow-wrap:anywhere;border-radius:8px;margin:8px 0 0;padding:12px;font-size:12px}._8xFzxq_inspectButton{border:.5px solid var(--dsw-alias-border-l3);corner-shape:round;background:var(--dsw-alias-bg-base);color:var(--dsw-alias-label-secondary);cursor:pointer;opacity:0;border-radius:999px;align-self:flex-start;align-items:center;gap:4px;margin:8px 0 2px;padding:2px 8px;font-size:11px;line-height:16px;transition:opacity .1s;display:inline-flex}._8xFzxq_root:hover ._8xFzxq_inspectButton,._8xFzxq_inspectButton:focus-visible{opacity:1}._8xFzxq_inspectButton:hover{background:var(--dsw-alias-interactive-bg-hover-solid);color:var(--dsw-alias-label-primary)}";
|
|
1004
|
+
const tagId$2 = "@max-null/dsh-node-appearance/deliverable-row.module.css";
|
|
1005
|
+
if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=" + JSON.stringify(tagId$2) + "]") === null) {
|
|
925
1006
|
const tag = document.createElement("style");
|
|
926
1007
|
tag.dataset.plugin = "@max-null/dsh-node-appearance";
|
|
927
|
-
tag.dataset.pluginCss = tagId$
|
|
928
|
-
tag.textContent = css$
|
|
1008
|
+
tag.dataset.pluginCss = tagId$2;
|
|
1009
|
+
tag.textContent = css$2;
|
|
929
1010
|
document.head.appendChild(tag);
|
|
930
1011
|
}
|
|
931
1012
|
var deliverable_row_module_css_default = {
|
|
1013
|
+
"summary": "_8xFzxq_summary",
|
|
932
1014
|
"title": "_8xFzxq_title",
|
|
933
|
-
"
|
|
934
|
-
"deliverable-row-sweep": "_8xFzxq_deliverable-row-sweep",
|
|
935
|
-
"files": "_8xFzxq_files",
|
|
1015
|
+
"paths": "_8xFzxq_paths",
|
|
936
1016
|
"state": "_8xFzxq_state",
|
|
937
|
-
"
|
|
938
|
-
"output": "_8xFzxq_output",
|
|
1017
|
+
"files": "_8xFzxq_files",
|
|
939
1018
|
"row": "_8xFzxq_row",
|
|
940
|
-
"meta": "_8xFzxq_meta",
|
|
941
|
-
"inspectButton": "_8xFzxq_inspectButton",
|
|
942
|
-
"paths": "_8xFzxq_paths",
|
|
943
|
-
"chevron": "_8xFzxq_chevron",
|
|
944
1019
|
"leading": "_8xFzxq_leading",
|
|
1020
|
+
"deliverable-row-sweep": "_8xFzxq_deliverable-row-sweep",
|
|
1021
|
+
"sep": "_8xFzxq_sep",
|
|
1022
|
+
"bodyWrap": "_8xFzxq_bodyWrap",
|
|
945
1023
|
"name": "_8xFzxq_name",
|
|
946
|
-
"
|
|
947
|
-
"summary": "_8xFzxq_summary",
|
|
1024
|
+
"chevron": "_8xFzxq_chevron",
|
|
948
1025
|
"path": "_8xFzxq_path",
|
|
1026
|
+
"output": "_8xFzxq_output",
|
|
1027
|
+
"ext": "_8xFzxq_ext",
|
|
949
1028
|
"root": "_8xFzxq_root",
|
|
950
|
-
"
|
|
1029
|
+
"file": "_8xFzxq_file",
|
|
1030
|
+
"meta": "_8xFzxq_meta",
|
|
1031
|
+
"inspectButton": "_8xFzxq_inspectButton"
|
|
951
1032
|
};
|
|
952
1033
|
//#endregion
|
|
953
1034
|
//#region src/client/deliverable-row.tsx
|
|
@@ -1073,29 +1154,54 @@ window.__ModuleLoader__.load({
|
|
|
1073
1154
|
});
|
|
1074
1155
|
}
|
|
1075
1156
|
//#endregion
|
|
1157
|
+
//#region src/client/objective.ts
|
|
1158
|
+
/**
|
|
1159
|
+
* 目标文本的**展示层**折行。
|
|
1160
|
+
*
|
|
1161
|
+
* 目标常常是一整段长句,里面用 `①` `②` `③` 这类圈号列出条目 —— 数据里没有
|
|
1162
|
+
* 换行,于是读起来就是一大坨(截图上那段 200 多字的目标就是如此)。这里只在
|
|
1163
|
+
* 渲染前插换行:**不改动任何会话数据**,卡片拿到的仍是原文,复制出去也还是原文。
|
|
1164
|
+
*
|
|
1165
|
+
* 判据刻意取得简单:只认 Unicode 的圈号 `U+2460`–`U+2473`(`①`–`⑳`),在它
|
|
1166
|
+
* 前面断行。中文语境里圈号基本只作列表项标记,「句中偶然出现圈号」的代价是
|
|
1167
|
+
* 多折一行;反过来若加上「前导必须是分号/句号」之类的条件,遇到 `③ 源码…`
|
|
1168
|
+
* 紧跟在没有标点的分条后就漏断了 —— 两害相权,取简单那条。
|
|
1169
|
+
*/
|
|
1170
|
+
/** 圈号 `①`–`⑳` 在 Unicode 里是连续区段。 */
|
|
1171
|
+
const CIRCLED_NUMBER = /[ \t]*(?=[\u2460-\u2473])/g;
|
|
1172
|
+
/**
|
|
1173
|
+
* 把目标的编号分条拆成多行。
|
|
1174
|
+
* @param text - 目标原文。
|
|
1175
|
+
* @returns 分条处带换行的文本;没有圈号时**逐字返回原串**。
|
|
1176
|
+
*/
|
|
1177
|
+
function objectiveLines(text) {
|
|
1178
|
+
if (!/[\u2460-\u2473]/.test(text)) return text;
|
|
1179
|
+
return text.replace(CIRCLED_NUMBER, "\n").replace(/\n{2,}/g, "\n").replace(/^\n+/, "");
|
|
1180
|
+
}
|
|
1181
|
+
//#endregion
|
|
1076
1182
|
//#region \0dsh-css:H:\MaxNull\WorkStation\max-null-plugins\dsh-node-appearance\src\client\goal-detail.module.css.mjs
|
|
1077
|
-
const css = ".WyWU3a_root{box-sizing:border-box;width:calc(100% - var(--dsh-composer-side-clearance) - var(--dsh-composer-side-clearance) - var(--dsh-composer-dock-inset) - var(--dsh-composer-dock-inset) - var(--dsh-composer-dock-inset) - var(--dsh-composer-dock-inset));max-width:calc(var(--dsh-composer-card-max-width) - var(--dsh-composer-dock-inset) - var(--dsh-composer-dock-inset) - var(--dsh-composer-dock-inset) - var(--dsh-composer-dock-inset));border:.5px solid var(--dsw-alias-border-l1);background:var(--dsw-specific-tip);--dsh-scrollbar-thumb:var(--dsw-alias-scrollbar-bg-l2);--dsh-scrollbar-thumb-hover:var(--dsw-alias-scrollbar-hover-l2);border-top-color:#0000;border-radius:0 0 12px 12px;flex:none;margin:-6px auto 0;overflow:hidden}[data-goal-bar]>div:first-child{border-bottom-color:#0000;border-bottom-right-radius:0;border-bottom-left-radius:0}.WyWU3a_body{flex-direction:column;gap:8px;padding:6px 12px;display:flex}.WyWU3a_header{text-align:left;cursor:pointer;background:0 0;border:none;align-items:center;gap:10px;width:100%;padding:0;display:flex}.WyWU3a_lead{color:var(--dsw-alias-label-tertiary);flex:none;place-items:center;display:grid}.WyWU3a_title{color:var(--dsw-alias-label-primary);flex:none;font-size:13px;font-weight:500;line-height:24px}.WyWU3a_summary{min-width:0;color:var(--dsw-alias-label-tertiary);text-overflow:ellipsis;white-space:nowrap;flex:auto;font-size:13px;line-height:20px;overflow:hidden}.WyWU3a_chevron{color:var(--dsw-alias-label-tertiary);flex:none;place-items:center;display:grid}.WyWU3a_detail{flex-direction:column;gap:6px;max-height:180px;margin:0;display:flex;overflow-y:auto}.WyWU3a_row{grid-template-columns:max-content 1fr;align-items:baseline;column-gap:10px;margin:0;display:grid}.WyWU3a_key{color:var(--dsw-alias-label-caption);font-size:13px;line-height:20px}.WyWU3a_value{min-width:0;color:var(--dsw-alias-label-secondary);white-space:pre-wrap;overflow-wrap:anywhere;margin:0;font-size:13px;line-height:20px}.WyWU3a_code{font-family:var(--ds-font-family-code);color:var(--dsw-alias-label-caption);font-size:11px}.WyWU3a_value>.WyWU3a_code:not(:first-child){margin-left:8px}";
|
|
1078
|
-
const tagId = "@max-null/dsh-node-appearance/goal-detail.module.css";
|
|
1079
|
-
if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=" + JSON.stringify(tagId) + "]") === null) {
|
|
1183
|
+
const css$1 = ".WyWU3a_root{box-sizing:border-box;width:calc(100% - var(--dsh-composer-side-clearance) - var(--dsh-composer-side-clearance) - var(--dsh-composer-dock-inset) - var(--dsh-composer-dock-inset) - var(--dsh-composer-dock-inset) - var(--dsh-composer-dock-inset));max-width:calc(var(--dsh-composer-card-max-width) - var(--dsh-composer-dock-inset) - var(--dsh-composer-dock-inset) - var(--dsh-composer-dock-inset) - var(--dsh-composer-dock-inset));border:.5px solid var(--dsw-alias-border-l1);background:var(--dsw-specific-tip);--dsh-scrollbar-thumb:var(--dsw-alias-scrollbar-bg-l2);--dsh-scrollbar-thumb-hover:var(--dsw-alias-scrollbar-hover-l2);border-top-color:#0000;border-radius:0 0 12px 12px;flex:none;margin:-6px auto 0;overflow:hidden}[data-goal-bar]>div:first-child{border-bottom-color:#0000;border-bottom-right-radius:0;border-bottom-left-radius:0}.WyWU3a_body{flex-direction:column;gap:8px;padding:6px 12px;display:flex}.WyWU3a_header{text-align:left;cursor:pointer;background:0 0;border:none;align-items:center;gap:10px;width:100%;padding:0;display:flex}.WyWU3a_lead{color:var(--dsw-alias-label-tertiary);flex:none;place-items:center;display:grid}.WyWU3a_title{color:var(--dsw-alias-label-primary);flex:none;font-size:13px;font-weight:500;line-height:24px}.WyWU3a_summary{min-width:0;color:var(--dsw-alias-label-tertiary);text-overflow:ellipsis;white-space:nowrap;flex:auto;font-size:13px;line-height:20px;overflow:hidden}.WyWU3a_chevron{color:var(--dsw-alias-label-tertiary);flex:none;place-items:center;display:grid}.WyWU3a_detail{flex-direction:column;gap:6px;max-height:180px;margin:0;display:flex;overflow-y:auto}.WyWU3a_row{grid-template-columns:max-content 1fr;align-items:baseline;column-gap:10px;margin:0;display:grid}.WyWU3a_key{color:var(--dsw-alias-label-caption);font-size:13px;line-height:20px}.WyWU3a_value{min-width:0;color:var(--dsw-alias-label-secondary);white-space:pre-wrap;overflow-wrap:anywhere;margin:0;font-size:13px;line-height:20px}.WyWU3a_code{font-family:var(--ds-font-family-code);color:var(--dsw-alias-label-caption);font-size:11px}.WyWU3a_value>.WyWU3a_code:not(:first-child){margin-left:8px}";
|
|
1184
|
+
const tagId$1 = "@max-null/dsh-node-appearance/goal-detail.module.css";
|
|
1185
|
+
if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=" + JSON.stringify(tagId$1) + "]") === null) {
|
|
1080
1186
|
const tag = document.createElement("style");
|
|
1081
1187
|
tag.dataset.plugin = "@max-null/dsh-node-appearance";
|
|
1082
|
-
tag.dataset.pluginCss = tagId;
|
|
1083
|
-
tag.textContent = css;
|
|
1188
|
+
tag.dataset.pluginCss = tagId$1;
|
|
1189
|
+
tag.textContent = css$1;
|
|
1084
1190
|
document.head.appendChild(tag);
|
|
1085
1191
|
}
|
|
1086
1192
|
var goal_detail_module_css_default = {
|
|
1087
|
-
"
|
|
1193
|
+
"summary": "WyWU3a_summary",
|
|
1194
|
+
"lead": "WyWU3a_lead",
|
|
1195
|
+
"body": "WyWU3a_body",
|
|
1196
|
+
"row": "WyWU3a_row",
|
|
1088
1197
|
"value": "WyWU3a_value",
|
|
1089
1198
|
"code": "WyWU3a_code",
|
|
1090
1199
|
"chevron": "WyWU3a_chevron",
|
|
1091
|
-
"body": "WyWU3a_body",
|
|
1092
|
-
"lead": "WyWU3a_lead",
|
|
1093
|
-
"root": "WyWU3a_root",
|
|
1094
|
-
"header": "WyWU3a_header",
|
|
1095
|
-
"detail": "WyWU3a_detail",
|
|
1096
|
-
"row": "WyWU3a_row",
|
|
1097
1200
|
"key": "WyWU3a_key",
|
|
1098
|
-
"
|
|
1201
|
+
"title": "WyWU3a_title",
|
|
1202
|
+
"header": "WyWU3a_header",
|
|
1203
|
+
"root": "WyWU3a_root",
|
|
1204
|
+
"detail": "WyWU3a_detail"
|
|
1099
1205
|
};
|
|
1100
1206
|
//#endregion
|
|
1101
1207
|
//#region src/client/goal-detail.tsx
|
|
@@ -1193,7 +1299,7 @@ window.__ModuleLoader__.load({
|
|
|
1193
1299
|
children: [
|
|
1194
1300
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(Row, {
|
|
1195
1301
|
label: "目标",
|
|
1196
|
-
children: goal.objective
|
|
1302
|
+
children: objectiveLines(goal.objective)
|
|
1197
1303
|
}),
|
|
1198
1304
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(Row, {
|
|
1199
1305
|
label: "阶段",
|
|
@@ -1219,6 +1325,402 @@ window.__ModuleLoader__.load({
|
|
|
1219
1325
|
});
|
|
1220
1326
|
}
|
|
1221
1327
|
//#endregion
|
|
1328
|
+
//#region src/client/trigger-model.ts
|
|
1329
|
+
/**
|
|
1330
|
+
* 拆开内容块:文本与未知块各成一段。
|
|
1331
|
+
* @param content - 持久化的内容块数组。
|
|
1332
|
+
* @returns 分段结果;不是数组时返回 null(调用方走等价外壳)。
|
|
1333
|
+
*/
|
|
1334
|
+
function contentRuns(content) {
|
|
1335
|
+
if (!Array.isArray(content)) return null;
|
|
1336
|
+
const runs = [];
|
|
1337
|
+
for (const block of content) {
|
|
1338
|
+
const text = textBlock(block);
|
|
1339
|
+
runs.push(text === null ? {
|
|
1340
|
+
kind: "block",
|
|
1341
|
+
block
|
|
1342
|
+
} : {
|
|
1343
|
+
kind: "text",
|
|
1344
|
+
text
|
|
1345
|
+
});
|
|
1346
|
+
}
|
|
1347
|
+
return runs;
|
|
1348
|
+
}
|
|
1349
|
+
/** 一个块是不是文本块;是则给出文本。 */
|
|
1350
|
+
function textBlock(block) {
|
|
1351
|
+
if (typeof block !== "object" || block === null) return null;
|
|
1352
|
+
const candidate = block;
|
|
1353
|
+
return candidate.type === "text" && typeof candidate.text === "string" ? candidate.text : null;
|
|
1354
|
+
}
|
|
1355
|
+
/**
|
|
1356
|
+
* 全部内容都是文本块时把它们拼起来。
|
|
1357
|
+
*
|
|
1358
|
+
* 目标轮次的提示词是**单个**文本块,所以拼起来就能直接拿去解析。出现任何
|
|
1359
|
+
* 非文本块即返回 null —— 那种内容本卡不负责解释,交给等价外壳按块渲染。
|
|
1360
|
+
* @param content - 持久化的内容块数组。
|
|
1361
|
+
* @returns 拼接后的文本,或 null。
|
|
1362
|
+
*/
|
|
1363
|
+
function plainText(content) {
|
|
1364
|
+
const runs = contentRuns(content);
|
|
1365
|
+
if (runs === null) return null;
|
|
1366
|
+
let text = "";
|
|
1367
|
+
for (const run of runs) {
|
|
1368
|
+
if (run.kind !== "text") return null;
|
|
1369
|
+
text += run.text;
|
|
1370
|
+
}
|
|
1371
|
+
return text;
|
|
1372
|
+
}
|
|
1373
|
+
/** 记下的一段来源,读成对象。 */
|
|
1374
|
+
function sourceRecord(source) {
|
|
1375
|
+
return typeof source === "object" && source !== null ? source : {};
|
|
1376
|
+
}
|
|
1377
|
+
/** 读一个字符串字段,非字符串当空串。 */
|
|
1378
|
+
function textField(source, key) {
|
|
1379
|
+
const value = source[key];
|
|
1380
|
+
return typeof value === "string" ? value : "";
|
|
1381
|
+
}
|
|
1382
|
+
/**
|
|
1383
|
+
* 由来源标注判断该显示成什么 —— 逐条复刻官方 `turn-trigger.ts` 的 switch。
|
|
1384
|
+
*
|
|
1385
|
+
* 未识别的来源保留「收到执行请求」这一默认,**不假装知道**它的身份或结果
|
|
1386
|
+
* (官方注释:Custom sources remain visible without attributing unrecorded
|
|
1387
|
+
* identity or success)。
|
|
1388
|
+
* @param source - 持久化的来源标注。
|
|
1389
|
+
* @returns 标题 key 与图标。
|
|
1390
|
+
*/
|
|
1391
|
+
function turnTriggerDetails(source) {
|
|
1392
|
+
const record = sourceRecord(source);
|
|
1393
|
+
switch (textField(record, "kind")) {
|
|
1394
|
+
case "goal": return {
|
|
1395
|
+
titleKey: "message.trigger.goal",
|
|
1396
|
+
icon: "goal"
|
|
1397
|
+
};
|
|
1398
|
+
case "agent-message": return {
|
|
1399
|
+
titleKey: "message.trigger.agent",
|
|
1400
|
+
icon: "agent"
|
|
1401
|
+
};
|
|
1402
|
+
case "team-message": return {
|
|
1403
|
+
titleKey: "message.trigger.team",
|
|
1404
|
+
icon: "team"
|
|
1405
|
+
};
|
|
1406
|
+
case "subagent-settled": return {
|
|
1407
|
+
titleKey: "message.trigger.subagent",
|
|
1408
|
+
icon: "subagent"
|
|
1409
|
+
};
|
|
1410
|
+
case "webhook": return textField(record, "provider") === "github" ? {
|
|
1411
|
+
titleKey: "message.trigger.github",
|
|
1412
|
+
icon: "github"
|
|
1413
|
+
} : {
|
|
1414
|
+
titleKey: "message.trigger.webhook",
|
|
1415
|
+
icon: "webhook"
|
|
1416
|
+
};
|
|
1417
|
+
case "schedule": return {
|
|
1418
|
+
titleKey: "message.trigger.schedule",
|
|
1419
|
+
icon: "schedule"
|
|
1420
|
+
};
|
|
1421
|
+
case "tool-jobs": return {
|
|
1422
|
+
titleKey: "message.trigger.job",
|
|
1423
|
+
icon: "job"
|
|
1424
|
+
};
|
|
1425
|
+
case "cordis-host-runner": return {
|
|
1426
|
+
titleKey: "message.trigger.plugin",
|
|
1427
|
+
icon: "plugin"
|
|
1428
|
+
};
|
|
1429
|
+
default: return {
|
|
1430
|
+
titleKey: "message.trigger.request",
|
|
1431
|
+
icon: "request"
|
|
1432
|
+
};
|
|
1433
|
+
}
|
|
1434
|
+
}
|
|
1435
|
+
/**
|
|
1436
|
+
* 目标轮次提示词的骨架。锚定整串:开头、`Objective:` 行、`Round:` 行、
|
|
1437
|
+
* 结尾的闭合标签缺一不可。
|
|
1438
|
+
*
|
|
1439
|
+
* `(\d+)\/(\d+)` 顺带挡住上限缺失的情形(内核在 `maxGoalRounds` 未设时会
|
|
1440
|
+
* 写出 `Round: 1/undefined`),那种文本会解析失败并整卡回退。
|
|
1441
|
+
*/
|
|
1442
|
+
const GOAL_ROUND = /^<goal_round>\nObjective: (.*)\nRound: (\d+)\/(\d+)\n\n([\s\S]*)\n<\/goal_round>$/;
|
|
1443
|
+
/**
|
|
1444
|
+
* 解析一段目标轮次提示词;结构不符即整体放弃。
|
|
1445
|
+
* @param text - 内容拼接后的文本。
|
|
1446
|
+
* @returns 还原后的字段,或 null。
|
|
1447
|
+
*/
|
|
1448
|
+
function parseGoalRound(text) {
|
|
1449
|
+
const matched = GOAL_ROUND.exec(text);
|
|
1450
|
+
if (matched === null) return null;
|
|
1451
|
+
const [, encoded, round, maxRounds, instruction] = matched;
|
|
1452
|
+
if (encoded === void 0 || round === void 0 || maxRounds === void 0 || instruction === void 0) return null;
|
|
1453
|
+
let objective;
|
|
1454
|
+
try {
|
|
1455
|
+
objective = JSON.parse(encoded);
|
|
1456
|
+
} catch {
|
|
1457
|
+
return null;
|
|
1458
|
+
}
|
|
1459
|
+
if (typeof objective !== "string") return null;
|
|
1460
|
+
return {
|
|
1461
|
+
objective,
|
|
1462
|
+
round: Number(round),
|
|
1463
|
+
maxRounds: Number(maxRounds),
|
|
1464
|
+
instruction
|
|
1465
|
+
};
|
|
1466
|
+
}
|
|
1467
|
+
/**
|
|
1468
|
+
* 来源里记录的轮次号。
|
|
1469
|
+
*
|
|
1470
|
+
* 它是**结构化事实**,比提示词文本可靠 —— 两者不一致时以它为准(解析成功但
|
|
1471
|
+
* 来源缺失的情况也存在,例如旧记录,那时回落到文本里的数字)。
|
|
1472
|
+
*/
|
|
1473
|
+
function roundFromSource(source) {
|
|
1474
|
+
const record = sourceRecord(source);
|
|
1475
|
+
if (textField(record, "kind") !== "goal") return null;
|
|
1476
|
+
const round = record.round;
|
|
1477
|
+
return typeof round === "number" && Number.isInteger(round) && round > 0 ? round : null;
|
|
1478
|
+
}
|
|
1479
|
+
/**
|
|
1480
|
+
* 取一条消息的目标轮次,供卡片决定用哪种展开体。
|
|
1481
|
+
* @param node - 触发节点的时间、内容与来源。
|
|
1482
|
+
* @returns 字段齐备的目标轮次,或 null(调用方渲染等价外壳)。
|
|
1483
|
+
*/
|
|
1484
|
+
function goalRoundOf(node) {
|
|
1485
|
+
const text = plainText(node.content);
|
|
1486
|
+
if (text === null) return null;
|
|
1487
|
+
const parsed = parseGoalRound(text);
|
|
1488
|
+
if (parsed === null) return null;
|
|
1489
|
+
const fromSource = roundFromSource(node.source);
|
|
1490
|
+
return fromSource === null ? parsed : {
|
|
1491
|
+
...parsed,
|
|
1492
|
+
round: fromSource
|
|
1493
|
+
};
|
|
1494
|
+
}
|
|
1495
|
+
/** 两位补零。 */
|
|
1496
|
+
function pad2(value) {
|
|
1497
|
+
return String(value).padStart(2, "0");
|
|
1498
|
+
}
|
|
1499
|
+
/**
|
|
1500
|
+
* 紧凑的本地时间戳 —— 复刻 ui-chat 的 `formatMessageClock`。
|
|
1501
|
+
*
|
|
1502
|
+
* 跨插件不能 import 它的值(client bundle 的 purity gate 禁止 feature plugin
|
|
1503
|
+
* 之间做运行时 import),所以这份实现与它同源:同一天只给 `HH:mm`,同年补上
|
|
1504
|
+
* `clock.md` 的日期模板,跨年用 `clock.ymd`。日期模板仍从调用方的 locale
|
|
1505
|
+
* seat 取,插件不自带文案。
|
|
1506
|
+
* @param time - 记录时间(Unix epoch ms)。
|
|
1507
|
+
* @param t - 提供 `clock.md` / `clock.ymd` 模板的翻译席位。
|
|
1508
|
+
* @param now - 判定「今天 / 今年」的参照时刻。
|
|
1509
|
+
* @returns 与官方卡片一致的时钟串。
|
|
1510
|
+
*/
|
|
1511
|
+
function formatClock(time, t, now = Date.now()) {
|
|
1512
|
+
const date = new Date(time);
|
|
1513
|
+
const reference = new Date(now);
|
|
1514
|
+
const clock = `${pad2(date.getHours())}:${pad2(date.getMinutes())}`;
|
|
1515
|
+
if (date.getFullYear() === reference.getFullYear() && date.getMonth() === reference.getMonth() && date.getDate() === reference.getDate()) return clock;
|
|
1516
|
+
const params = {
|
|
1517
|
+
y: date.getFullYear(),
|
|
1518
|
+
m: date.getMonth() + 1,
|
|
1519
|
+
d: date.getDate()
|
|
1520
|
+
};
|
|
1521
|
+
return `${date.getFullYear() === reference.getFullYear() ? t("clock.md", params) : t("clock.ymd", params)} ${clock}`;
|
|
1522
|
+
}
|
|
1523
|
+
//#endregion
|
|
1524
|
+
//#region \0dsh-css:H:\MaxNull\WorkStation\max-null-plugins\dsh-node-appearance\src\client\trigger-card.module.css.mjs
|
|
1525
|
+
const css = ".MMrk2q_root{border:.5px solid var(--dsw-alias-border-l1);border-radius:var(--dsw-radius-xl);background:var(--dsw-alias-markdown-code-block);min-width:0;transition:background-color .1s}.MMrk2q_root:hover{background:var(--dsw-alias-interactive-bg-hover)}.MMrk2q_header{width:100%;color:var(--dsw-alias-label-primary);font:inherit;text-align:left;cursor:pointer;background:0 0;border:0;align-items:center;gap:10px;padding:12px 16px;display:flex}.MMrk2q_icon{color:var(--dsw-alias-label-tertiary);flex:none;display:inline-flex}.MMrk2q_title{font:var(--dsw-font-xs-13);flex:none}.MMrk2q_round{background:var(--dsw-alias-interactive-bg-hover);color:var(--dsw-alias-label-secondary);font:var(--dsw-font-xxs-12);font-variant-numeric:tabular-nums;border-radius:999px;flex:none;padding:1px 7px}.MMrk2q_time{color:var(--dsw-alias-label-caption);font:var(--dsw-font-xxs-12);flex:none;margin-left:auto}.MMrk2q_chevron,.MMrk2q_openChevron{color:var(--dsw-alias-label-tertiary);flex:none}.MMrk2q_openChevron{transform:rotate(180deg)}.MMrk2q_body{padding:0 16px 12px 40px}.MMrk2q_explanation{color:var(--dsw-alias-label-secondary);font:var(--dsw-font-xxs-12);margin:8px 0}.MMrk2q_content{white-space:pre-wrap;overflow-wrap:anywhere;max-height:240px;font:var(--dsw-font-xxs-12);overflow:auto}.MMrk2q_text{white-space:pre-wrap;overflow-wrap:anywhere;font:var(--dsw-font-xxs-12);margin:0}.MMrk2q_detail{margin-top:10px}.MMrk2q_pair{margin:0}.MMrk2q_key{color:var(--dsw-alias-label-caption);font:var(--dsw-font-xxs-12);margin:0 0 3px}.MMrk2q_value{color:var(--dsw-alias-label-primary);font:var(--dsw-font-xs-13);white-space:pre-wrap;overflow-wrap:anywhere;margin:0 0 12px;line-height:1.6}.MMrk2q_instruction{background:var(--dsw-alias-markdown-code-block);border-radius:6px}.MMrk2q_instructionSummary{color:var(--dsw-alias-label-secondary);font:var(--dsw-font-xxs-12);cursor:pointer;padding:6px 10px}.MMrk2q_instructionText{max-height:200px;color:var(--dsw-alias-label-tertiary);font:var(--dsw-font-xxs-12);white-space:pre-wrap;overflow-wrap:anywhere;margin:0;padding:0 10px 8px;overflow:auto}@media (prefers-reduced-motion:reduce){.MMrk2q_root{transition:none}}";
|
|
1526
|
+
const tagId = "@max-null/dsh-node-appearance/trigger-card.module.css";
|
|
1527
|
+
if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=" + JSON.stringify(tagId) + "]") === null) {
|
|
1528
|
+
const tag = document.createElement("style");
|
|
1529
|
+
tag.dataset.plugin = "@max-null/dsh-node-appearance";
|
|
1530
|
+
tag.dataset.pluginCss = tagId;
|
|
1531
|
+
tag.textContent = css;
|
|
1532
|
+
document.head.appendChild(tag);
|
|
1533
|
+
}
|
|
1534
|
+
var trigger_card_module_css_default = {
|
|
1535
|
+
"openChevron": "MMrk2q_openChevron",
|
|
1536
|
+
"content": "MMrk2q_content",
|
|
1537
|
+
"text": "MMrk2q_text",
|
|
1538
|
+
"root": "MMrk2q_root",
|
|
1539
|
+
"pair": "MMrk2q_pair",
|
|
1540
|
+
"title": "MMrk2q_title",
|
|
1541
|
+
"explanation": "MMrk2q_explanation",
|
|
1542
|
+
"round": "MMrk2q_round",
|
|
1543
|
+
"value": "MMrk2q_value",
|
|
1544
|
+
"instruction": "MMrk2q_instruction",
|
|
1545
|
+
"icon": "MMrk2q_icon",
|
|
1546
|
+
"key": "MMrk2q_key",
|
|
1547
|
+
"instructionSummary": "MMrk2q_instructionSummary",
|
|
1548
|
+
"instructionText": "MMrk2q_instructionText",
|
|
1549
|
+
"body": "MMrk2q_body",
|
|
1550
|
+
"detail": "MMrk2q_detail",
|
|
1551
|
+
"header": "MMrk2q_header",
|
|
1552
|
+
"chevron": "MMrk2q_chevron",
|
|
1553
|
+
"time": "MMrk2q_time"
|
|
1554
|
+
};
|
|
1555
|
+
//#endregion
|
|
1556
|
+
//#region src/client/trigger-card.tsx
|
|
1557
|
+
/**
|
|
1558
|
+
* 触发通知卡:接管 `conversation.chat.node` 的 `turn-trigger` key。
|
|
1559
|
+
*
|
|
1560
|
+
* 官方 `TurnTriggerNodeView` 是「图标 + 标题 + 时间 + chevron」的折叠条,
|
|
1561
|
+
* 展开体把模型看到的那段文本原样交给 `NoticeBody`(→ `<pre>`)。对目标轮次
|
|
1562
|
+
* 来说,那段文本是**提示词原文**(`<goal_round>` / `Objective:` / `Round:`),
|
|
1563
|
+
* 骨架对人不构成信息却占满展开区。
|
|
1564
|
+
*
|
|
1565
|
+
* 本组件保留官方全部信息与交互(折叠、时间、explanation、原文可查),另加:
|
|
1566
|
+
* ① 折叠头补**轮次徽标**(收起态即可读到走到第几轮);
|
|
1567
|
+
* ② 目标轮次的展开体改为字段化(目标 / 模型收到的指令),标签与转义消失;
|
|
1568
|
+
* ③ 其余触发来源按官方同构渲染(见下)。
|
|
1569
|
+
*
|
|
1570
|
+
* ## 接管是全 key 的
|
|
1571
|
+
*
|
|
1572
|
+
* `conversation.chat.node` 是 keyed cell,`priority` 最低者渲染 —— 注册
|
|
1573
|
+
* `turn-trigger` 的 `priority: -1` 会让**全部**触发来源都走本组件,这正是
|
|
1574
|
+
* 官方 `turnTriggerDetails` 被逐条复刻到 `trigger-model.ts` 的原因。判别只
|
|
1575
|
+
* 认 `source.kind`,不认标题文本。
|
|
1576
|
+
*
|
|
1577
|
+
* 代价:官方对该面板的后续改进会被遮蔽(0.2.0 就把 `schedule` 的图标从
|
|
1578
|
+
* `IconAlarmClockOutlineRegular` 换成了 `IconClockOutlineRegular`),今后要
|
|
1579
|
+
* 手动跟进。与 `ask_user_question`、`present` 两处接管同一性质。
|
|
1580
|
+
*
|
|
1581
|
+
* 全部派生在 `trigger-model.ts` 里,本文件只做 JSX。
|
|
1582
|
+
*/
|
|
1583
|
+
/** 与官方 `TurnTriggerNodeView` 逐项相同的图标映射(`schedule` 用 0.2.0 的选择,两版内核都导出它)。 */
|
|
1584
|
+
const TRIGGER_ICONS = {
|
|
1585
|
+
request: _deepseek_ai_dsh_client_ui_primitives.IconContextInjectionOutlineRegular,
|
|
1586
|
+
goal: _deepseek_ai_dsh_client_ui_primitives.IconGoalOutlineRegular,
|
|
1587
|
+
agent: _deepseek_ai_dsh_client_ui_primitives.IconPaperPlaneOutlineRegular,
|
|
1588
|
+
team: _deepseek_ai_dsh_client_ui_primitives.IconAgentPresetOutlineRegular,
|
|
1589
|
+
subagent: _deepseek_ai_dsh_client_ui_primitives.IconAgentPresetOutlineRegular,
|
|
1590
|
+
github: _deepseek_ai_dsh_client_ui_primitives.IconBranchOutlineRegular,
|
|
1591
|
+
webhook: _deepseek_ai_dsh_client_ui_primitives.IconGlobeOutlineRegular,
|
|
1592
|
+
schedule: _deepseek_ai_dsh_client_ui_primitives.IconClockOutlineRegular,
|
|
1593
|
+
job: _deepseek_ai_dsh_client_ui_primitives.IconQueueOutlineRegular,
|
|
1594
|
+
plugin: _deepseek_ai_dsh_client_ui_primitives.IconCordisPluginOutlineRegular
|
|
1595
|
+
};
|
|
1596
|
+
/**
|
|
1597
|
+
* 轮次徽标。文案是插件自有 —— chat 字典里没有「第 N / M 轮」这样的 key,
|
|
1598
|
+
* 与交付行的折叠摘要直写中文同一取径。
|
|
1599
|
+
* @param props - 已还原的轮次字段。
|
|
1600
|
+
* @returns 徽标。
|
|
1601
|
+
*/
|
|
1602
|
+
function RoundBadge({ goal }) {
|
|
1603
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
1604
|
+
className: trigger_card_module_css_default.round,
|
|
1605
|
+
children: `第 ${String(goal.round)} / ${String(goal.maxRounds)} 轮`
|
|
1606
|
+
});
|
|
1607
|
+
}
|
|
1608
|
+
/**
|
|
1609
|
+
* 目标轮次的展开体:字段化,标签与转义都不再出现。
|
|
1610
|
+
*
|
|
1611
|
+
* 指令段独立成一节并默认收起 —— 它是给模型的执行要求,对人是噪音,但**不该
|
|
1612
|
+
* 销毁**(它解释了模型这一轮为什么会这么干),所以保留可查性而不是删掉。
|
|
1613
|
+
* @param props - 已还原的轮次字段。
|
|
1614
|
+
* @returns 两节字段。
|
|
1615
|
+
*/
|
|
1616
|
+
function GoalRoundBody({ goal }) {
|
|
1617
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1618
|
+
className: trigger_card_module_css_default.detail,
|
|
1619
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("dl", {
|
|
1620
|
+
className: trigger_card_module_css_default.pair,
|
|
1621
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("dt", {
|
|
1622
|
+
className: trigger_card_module_css_default.key,
|
|
1623
|
+
children: "目标"
|
|
1624
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("dd", {
|
|
1625
|
+
className: trigger_card_module_css_default.value,
|
|
1626
|
+
"data-trigger-objective": true,
|
|
1627
|
+
children: objectiveLines(goal.objective)
|
|
1628
|
+
})]
|
|
1629
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("details", {
|
|
1630
|
+
className: trigger_card_module_css_default.instruction,
|
|
1631
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("summary", {
|
|
1632
|
+
className: trigger_card_module_css_default.instructionSummary,
|
|
1633
|
+
children: "模型收到的指令"
|
|
1634
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("pre", {
|
|
1635
|
+
className: trigger_card_module_css_default.instructionText,
|
|
1636
|
+
children: goal.instruction
|
|
1637
|
+
})]
|
|
1638
|
+
})]
|
|
1639
|
+
});
|
|
1640
|
+
}
|
|
1641
|
+
/**
|
|
1642
|
+
* 非目标轮次的展开体:与官方 `NoticeBody` 同构 —— 文本按真实换行显示,
|
|
1643
|
+
* 本版本不认识的块单独渲染而不是消失。
|
|
1644
|
+
* @param props - 内容分段与翻译席位。
|
|
1645
|
+
* @returns 原文块。
|
|
1646
|
+
*/
|
|
1647
|
+
function PlainBody({ runs, t }) {
|
|
1648
|
+
return runs.map((run, index) => run.kind === "text" ? run.text !== "" && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("pre", {
|
|
1649
|
+
className: trigger_card_module_css_default.text,
|
|
1650
|
+
"data-context-text": true,
|
|
1651
|
+
children: run.text
|
|
1652
|
+
}, index) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.JsonBlock, {
|
|
1653
|
+
label: t("message.unknownBlock"),
|
|
1654
|
+
payload: run.block,
|
|
1655
|
+
truncatedLabel: (total) => t("json.truncated", { total })
|
|
1656
|
+
}, index));
|
|
1657
|
+
}
|
|
1658
|
+
/**
|
|
1659
|
+
* 渲染一张触发通知卡。
|
|
1660
|
+
* @param props - 节点数据与翻译席位(注册时声明 `chat` 命名空间)。
|
|
1661
|
+
* @returns 折叠卡;收起的展开体由内容形态决定。
|
|
1662
|
+
*/
|
|
1663
|
+
function TriggerCard({ node, t }) {
|
|
1664
|
+
const [open, setOpen] = (0, react.useState)(false);
|
|
1665
|
+
const bodyId = (0, react.useId)();
|
|
1666
|
+
const data = node.data;
|
|
1667
|
+
const details = turnTriggerDetails(data.source);
|
|
1668
|
+
const TriggerIcon = TRIGGER_ICONS[details.icon];
|
|
1669
|
+
const goal = goalRoundOf(data);
|
|
1670
|
+
const runs = contentRuns(data.content);
|
|
1671
|
+
const time = formatClock(data.time, t);
|
|
1672
|
+
const instant = new Date(data.time);
|
|
1673
|
+
const stamp = Number.isNaN(instant.getTime()) ? void 0 : instant.toISOString();
|
|
1674
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("section", {
|
|
1675
|
+
className: trigger_card_module_css_default.root,
|
|
1676
|
+
"data-turn-trigger": true,
|
|
1677
|
+
"data-trigger-card": true,
|
|
1678
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
|
|
1679
|
+
className: trigger_card_module_css_default.header,
|
|
1680
|
+
type: "button",
|
|
1681
|
+
"aria-expanded": open,
|
|
1682
|
+
"aria-controls": bodyId,
|
|
1683
|
+
onClick: () => {
|
|
1684
|
+
setOpen(!open);
|
|
1685
|
+
},
|
|
1686
|
+
children: [
|
|
1687
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
1688
|
+
className: trigger_card_module_css_default.icon,
|
|
1689
|
+
"aria-hidden": true,
|
|
1690
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TriggerIcon, { size: 14 })
|
|
1691
|
+
}),
|
|
1692
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
1693
|
+
className: trigger_card_module_css_default.title,
|
|
1694
|
+
children: t(details.titleKey)
|
|
1695
|
+
}),
|
|
1696
|
+
goal !== null && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(RoundBadge, { goal }),
|
|
1697
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("time", {
|
|
1698
|
+
className: trigger_card_module_css_default.time,
|
|
1699
|
+
dateTime: stamp,
|
|
1700
|
+
children: time
|
|
1701
|
+
}),
|
|
1702
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconChevronDownOutlineRegular, {
|
|
1703
|
+
size: 12,
|
|
1704
|
+
className: open ? trigger_card_module_css_default.openChevron : trigger_card_module_css_default.chevron
|
|
1705
|
+
})
|
|
1706
|
+
]
|
|
1707
|
+
}), open && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1708
|
+
id: bodyId,
|
|
1709
|
+
className: trigger_card_module_css_default.body,
|
|
1710
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
1711
|
+
className: trigger_card_module_css_default.explanation,
|
|
1712
|
+
children: t("message.trigger.explanation")
|
|
1713
|
+
}), goal !== null ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(GoalRoundBody, { goal }) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
1714
|
+
className: trigger_card_module_css_default.content,
|
|
1715
|
+
children: runs !== null && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(PlainBody, {
|
|
1716
|
+
runs,
|
|
1717
|
+
t
|
|
1718
|
+
})
|
|
1719
|
+
})]
|
|
1720
|
+
})]
|
|
1721
|
+
});
|
|
1722
|
+
}
|
|
1723
|
+
//#endregion
|
|
1222
1724
|
//#region src/client/index.ts
|
|
1223
1725
|
const inject = [
|
|
1224
1726
|
"slots",
|
|
@@ -1325,6 +1827,12 @@ window.__ModuleLoader__.load({
|
|
|
1325
1827
|
id: "max-null/goal-detail",
|
|
1326
1828
|
order: 11
|
|
1327
1829
|
}, GoalDetail));
|
|
1830
|
+
ctx.slots.inject("conversation.chat.node", () => ctx.slots.register({
|
|
1831
|
+
name: "conversation.chat.node",
|
|
1832
|
+
key: "turn-trigger",
|
|
1833
|
+
priority: -1,
|
|
1834
|
+
locale: "chat"
|
|
1835
|
+
}, TriggerCard));
|
|
1328
1836
|
}
|
|
1329
1837
|
//#endregion
|
|
1330
1838
|
exports.apply = apply;
|