@jcy2387/dsh-conversation-ui 0.1.3-alpha.2 → 0.1.6-alpha.2
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.en.md +5 -3
- package/README.md +5 -3
- package/lib/client.js +363 -369
- package/lib/client.js.map +1 -1
- package/package.json +40 -38
- package/src/client/ConversationCard.module.css +18 -33
- package/src/client/ConversationCard.tsx +81 -94
- package/src/client/DeliverablesCard.tsx +7 -1
- package/src/client/index.ts +15 -17
package/lib/client.js
CHANGED
|
@@ -438,50 +438,50 @@ window.__ModuleLoader__.load({
|
|
|
438
438
|
tag.textContent = css$2;
|
|
439
439
|
}
|
|
440
440
|
var TypewriterAssistantNodeView_module_css_default = {
|
|
441
|
-
"turnFoldButton": "Sp5wgW_turnFoldButton",
|
|
442
|
-
"think": "Sp5wgW_think",
|
|
443
|
-
"dsh-turn-waiting-shimmer": "Sp5wgW_dsh-turn-waiting-shimmer",
|
|
444
|
-
"toolGroupAnchor": "Sp5wgW_toolGroupAnchor",
|
|
445
441
|
"disclosureTrailing": "Sp5wgW_disclosureTrailing",
|
|
442
|
+
"toolGroupHeader": "Sp5wgW_toolGroupHeader",
|
|
446
443
|
"dsh-codex-stream-enter": "Sp5wgW_dsh-codex-stream-enter",
|
|
447
|
-
"
|
|
448
|
-
"
|
|
449
|
-
"toolGroupHeaderLabel": "Sp5wgW_toolGroupHeaderLabel",
|
|
450
|
-
"turnPrelude": "Sp5wgW_turnPrelude",
|
|
451
|
-
"thinkChevron": "Sp5wgW_thinkChevron",
|
|
452
|
-
"turnWaiting": "Sp5wgW_turnWaiting",
|
|
453
|
-
"disclosureTitle": "Sp5wgW_disclosureTitle",
|
|
454
|
-
"follow": "Sp5wgW_follow",
|
|
444
|
+
"disclosureRoot": "Sp5wgW_disclosureRoot",
|
|
445
|
+
"turnFoldButton": "Sp5wgW_turnFoldButton",
|
|
455
446
|
"disclosureLeading": "Sp5wgW_disclosureLeading",
|
|
456
|
-
"toolGroupHeaderChevron": "Sp5wgW_toolGroupHeaderChevron",
|
|
457
|
-
"turnFoldLabel": "Sp5wgW_turnFoldLabel",
|
|
458
|
-
"toolSemanticIcon": "Sp5wgW_toolSemanticIcon",
|
|
459
|
-
"thinkSummary": "Sp5wgW_thinkSummary",
|
|
460
447
|
"disclosureContent": "Sp5wgW_disclosureContent",
|
|
448
|
+
"turnFoldLabel": "Sp5wgW_turnFoldLabel",
|
|
449
|
+
"thinkBody": "Sp5wgW_thinkBody",
|
|
450
|
+
"reasoningText": "Sp5wgW_reasoningText",
|
|
461
451
|
"streamSemanticIcon": "Sp5wgW_streamSemanticIcon",
|
|
462
|
-
"eventRow": "Sp5wgW_eventRow",
|
|
463
|
-
"markdownFlow": "Sp5wgW_markdownFlow",
|
|
464
|
-
"body": "Sp5wgW_body",
|
|
465
452
|
"thinkRow": "Sp5wgW_thinkRow",
|
|
466
|
-
"
|
|
467
|
-
"
|
|
468
|
-
"
|
|
453
|
+
"toolGroupHeaderLabel": "Sp5wgW_toolGroupHeaderLabel",
|
|
454
|
+
"root": "Sp5wgW_root",
|
|
455
|
+
"think": "Sp5wgW_think",
|
|
456
|
+
"dsh-conversation-ui-think-sweep": "Sp5wgW_dsh-conversation-ui-think-sweep",
|
|
457
|
+
"thinkChevron": "Sp5wgW_thinkChevron",
|
|
458
|
+
"turnPrelude": "Sp5wgW_turnPrelude",
|
|
469
459
|
"visuallyHidden": "Sp5wgW_visuallyHidden",
|
|
460
|
+
"toolSemanticIcon": "Sp5wgW_toolSemanticIcon",
|
|
461
|
+
"toolGroupHeaderIcon": "Sp5wgW_toolGroupHeaderIcon",
|
|
462
|
+
"toolGroupHeaderGlyph": "Sp5wgW_toolGroupHeaderGlyph",
|
|
470
463
|
"reasoningSummary": "Sp5wgW_reasoningSummary",
|
|
471
|
-
"
|
|
472
|
-
"
|
|
473
|
-
"
|
|
474
|
-
"
|
|
464
|
+
"turnWaiting": "Sp5wgW_turnWaiting",
|
|
465
|
+
"thinkLeading": "Sp5wgW_thinkLeading",
|
|
466
|
+
"thinkSeparator": "Sp5wgW_thinkSeparator",
|
|
467
|
+
"thinkSummary": "Sp5wgW_thinkSummary",
|
|
475
468
|
"stopped": "Sp5wgW_stopped",
|
|
476
|
-
"
|
|
477
|
-
"
|
|
469
|
+
"eventRow": "Sp5wgW_eventRow",
|
|
470
|
+
"turnFoldRow": "Sp5wgW_turnFoldRow",
|
|
471
|
+
"toolGroupAnchor": "Sp5wgW_toolGroupAnchor",
|
|
472
|
+
"markdownFlow": "Sp5wgW_markdownFlow",
|
|
473
|
+
"nestedToolSemanticIcon": "Sp5wgW_nestedToolSemanticIcon",
|
|
474
|
+
"body": "Sp5wgW_body",
|
|
475
|
+
"dsh-turn-waiting-shimmer": "Sp5wgW_dsh-turn-waiting-shimmer",
|
|
478
476
|
"disclosureRow": "Sp5wgW_disclosureRow",
|
|
479
|
-
"
|
|
477
|
+
"reasoningDisclosure": "Sp5wgW_reasoningDisclosure",
|
|
478
|
+
"toolGroupHeaderChevron": "Sp5wgW_toolGroupHeaderChevron",
|
|
480
479
|
"toolGroupFrame": "Sp5wgW_toolGroupFrame",
|
|
480
|
+
"editStats": "Sp5wgW_editStats",
|
|
481
|
+
"toolGroupContent": "Sp5wgW_toolGroupContent",
|
|
481
482
|
"thinkTitle": "Sp5wgW_thinkTitle",
|
|
482
|
-
"
|
|
483
|
-
"
|
|
484
|
-
"toolGroupHeaderIcon": "Sp5wgW_toolGroupHeaderIcon"
|
|
483
|
+
"disclosureTitle": "Sp5wgW_disclosureTitle",
|
|
484
|
+
"follow": "Sp5wgW_follow"
|
|
485
485
|
};
|
|
486
486
|
//#endregion
|
|
487
487
|
//#region src/client/FollowHost.tsx
|
|
@@ -2022,7 +2022,7 @@ window.__ModuleLoader__.load({
|
|
|
2022
2022
|
}
|
|
2023
2023
|
//#endregion
|
|
2024
2024
|
//#region \0dsh-css:/home/runner/work/dsh-codex-suite/dsh-codex-suite/packages/conversation-ui/src/client/ConversationCard.module.css.mjs
|
|
2025
|
-
const css$1 = ".XFnqVW_card{border:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-layer-3);border-radius:12px;flex-direction:column;list-style:none;transition:border-color .16s,background .16s;display:flex}.XFnqVW_card:hover{border-color:var(--dsw-alias-label-dimmed)}.XFnqVW_cardOpen{border-color:var(--dsw-alias-label-dimmed);background:var(--dsw-alias-bg-layer-2)}.XFnqVW_header{
|
|
2025
|
+
const css$1 = ".XFnqVW_card{border:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-layer-3);border-radius:12px;flex-direction:column;min-width:0;list-style:none;transition:border-color .16s,background .16s;display:flex}.XFnqVW_card:hover{border-color:var(--dsw-alias-label-dimmed)}.XFnqVW_cardOpen{border-color:var(--dsw-alias-label-dimmed);background:var(--dsw-alias-bg-layer-2)}.XFnqVW_header{flex-wrap:wrap;align-items:flex-start;gap:12px;padding:14px 16px;display:flex}.XFnqVW_headText{overflow-wrap:anywhere;flex-direction:column;flex:16rem;gap:4px;min-width:0;display:flex}.XFnqVW_name{color:var(--dsw-alias-label-primary);font-size:15px;font-weight:600;line-height:1.4}.XFnqVW_description{color:var(--dsw-alias-label-tertiary);font-size:13px;line-height:1.5}.XFnqVW_metadata{flex-wrap:wrap;align-items:center;gap:8px;min-width:0;max-width:100%;display:flex}.XFnqVW_version{overflow-wrap:anywhere;min-width:0;max-width:100%;color:var(--dsw-alias-label-tertiary);font-size:12px;line-height:1.5}.XFnqVW_pending{background:var(--dsw-alias-bg-module-platform);color:var(--dsw-alias-label-secondary);white-space:nowrap;border-radius:999px;flex:none;padding:1px 8px;font-size:11px;font-weight:500;line-height:17px}.XFnqVW_body{border-top:1px solid var(--dsw-alias-border-l2);flex-direction:column;margin:0 16px;padding-bottom:8px;display:flex}.XFnqVW_readOnly{color:var(--dsw-alias-label-tertiary);margin:12px 0 0;font-size:12px;line-height:1.5}.XFnqVW_field{flex-direction:column;gap:6px;padding:12px 0;display:flex}.XFnqVW_fieldHead{justify-content:space-between;align-items:center;gap:8px;display:flex}.XFnqVW_label{min-width:0;color:var(--dsw-alias-label-primary);flex:1;font-size:13px;font-weight:500;line-height:1.5}.XFnqVW_toggle{width:16px;height:16px;accent-color:var(--dsw-alias-brand-primary);cursor:pointer}.XFnqVW_toggle:disabled{cursor:default}.XFnqVW_toggle:focus-visible{outline:2px solid var(--dsw-alias-brand-primary);outline-offset:2px}.XFnqVW_hint{color:var(--dsw-alias-label-tertiary);margin:0;font-size:12px;line-height:1.5}.XFnqVW_failure{justify-content:space-between;align-items:center;gap:12px;padding:12px 0;display:flex}.XFnqVW_updateRow{border-top:1px solid var(--dsw-alias-border-l2);justify-content:space-between;align-items:center;gap:12px;padding:12px 0;display:flex}.XFnqVW_updateCopy{flex-direction:column;gap:4px;min-width:0;display:flex}.XFnqVW_footer{border-top:1px solid var(--dsw-alias-border-l2);justify-content:flex-end;align-items:center;gap:8px;padding:12px 0 4px;display:flex}.XFnqVW_failed{min-width:0;color:var(--dsw-alias-label-error);flex:1;margin:0;font-size:12px;line-height:1.5}.XFnqVW_save,.XFnqVW_discard,.XFnqVW_update{appearance:none;font:inherit;cursor:pointer;border:1px solid #0000;border-radius:8px;padding:5px 14px;font-size:13px;line-height:1.5}.XFnqVW_save{background:var(--dsw-alias-label-primary);color:var(--dsw-alias-bg-layer-3)}.XFnqVW_discard{border-color:var(--dsw-alias-border-l2);color:var(--dsw-alias-label-secondary);background:0 0}.XFnqVW_discard:hover:not(:disabled),.XFnqVW_update:hover:not(:disabled){border-color:var(--dsw-alias-label-dimmed);color:var(--dsw-alias-label-primary)}.XFnqVW_update{border-color:var(--dsw-alias-border-l2);color:var(--dsw-alias-label-secondary);background:0 0;flex:none;align-items:center;gap:6px;display:inline-flex}.XFnqVW_discard:disabled,.XFnqVW_save:disabled,.XFnqVW_update:disabled{opacity:.4;cursor:default}.XFnqVW_discard:focus-visible,.XFnqVW_save:focus-visible,.XFnqVW_update:focus-visible{outline:2px solid var(--dsw-alias-brand-primary);outline-offset:1px}";
|
|
2026
2026
|
const tagId$1 = "@jcy2387/dsh-conversation-ui/ConversationCard.module.css";
|
|
2027
2027
|
if (typeof document !== "undefined") {
|
|
2028
2028
|
let tag = document.querySelector("style[data-plugin-css=" + JSON.stringify(tagId$1) + "]");
|
|
@@ -2035,78 +2035,64 @@ window.__ModuleLoader__.load({
|
|
|
2035
2035
|
tag.textContent = css$1;
|
|
2036
2036
|
}
|
|
2037
2037
|
var ConversationCard_module_css_default = {
|
|
2038
|
-
"
|
|
2039
|
-
"
|
|
2038
|
+
"toggle": "XFnqVW_toggle",
|
|
2039
|
+
"header": "XFnqVW_header",
|
|
2040
|
+
"card": "XFnqVW_card",
|
|
2041
|
+
"failure": "XFnqVW_failure",
|
|
2042
|
+
"name": "XFnqVW_name",
|
|
2040
2043
|
"readOnly": "XFnqVW_readOnly",
|
|
2041
|
-
"failed": "XFnqVW_failed",
|
|
2042
2044
|
"footer": "XFnqVW_footer",
|
|
2043
|
-
"
|
|
2044
|
-
"
|
|
2045
|
+
"failed": "XFnqVW_failed",
|
|
2046
|
+
"updateCopy": "XFnqVW_updateCopy",
|
|
2045
2047
|
"update": "XFnqVW_update",
|
|
2046
|
-
"cardOpen": "XFnqVW_cardOpen",
|
|
2047
|
-
"card": "XFnqVW_card",
|
|
2048
|
-
"failure": "XFnqVW_failure",
|
|
2049
|
-
"label": "XFnqVW_label",
|
|
2050
2048
|
"discard": "XFnqVW_discard",
|
|
2051
|
-
"updateCopy": "XFnqVW_updateCopy",
|
|
2052
|
-
"field": "XFnqVW_field",
|
|
2053
|
-
"chevronOpen": "XFnqVW_chevronOpen",
|
|
2054
|
-
"header": "XFnqVW_header",
|
|
2055
|
-
"fieldHead": "XFnqVW_fieldHead",
|
|
2056
2049
|
"version": "XFnqVW_version",
|
|
2057
|
-
"description": "XFnqVW_description",
|
|
2058
|
-
"headText": "XFnqVW_headText",
|
|
2059
|
-
"body": "XFnqVW_body",
|
|
2060
2050
|
"pending": "XFnqVW_pending",
|
|
2061
|
-
"
|
|
2062
|
-
"
|
|
2051
|
+
"save": "XFnqVW_save",
|
|
2052
|
+
"hint": "XFnqVW_hint",
|
|
2053
|
+
"fieldHead": "XFnqVW_fieldHead",
|
|
2054
|
+
"label": "XFnqVW_label",
|
|
2055
|
+
"body": "XFnqVW_body",
|
|
2056
|
+
"field": "XFnqVW_field",
|
|
2057
|
+
"cardOpen": "XFnqVW_cardOpen",
|
|
2058
|
+
"description": "XFnqVW_description",
|
|
2059
|
+
"metadata": "XFnqVW_metadata",
|
|
2060
|
+
"updateRow": "XFnqVW_updateRow",
|
|
2061
|
+
"headText": "XFnqVW_headText"
|
|
2063
2062
|
};
|
|
2064
2063
|
//#endregion
|
|
2065
2064
|
//#region src/client/ConversationCard.tsx
|
|
2066
|
-
/**
|
|
2067
|
-
* The conversation-ui plugin configuration card, rendered inside the Web
|
|
2068
|
-
* Settings "plugin configuration" page. One toggle, staged until the user
|
|
2069
|
-
* saves — the same shape as the Host-shipped cards, hand-drawn because the
|
|
2070
|
-
* Host cards' chrome is not exported for reuse.
|
|
2071
|
-
*/
|
|
2072
2065
|
/** Render the conversation-ui card independently of the core settings namespace allowlist. */
|
|
2073
2066
|
function ConversationCard(props) {
|
|
2074
2067
|
const { t } = props;
|
|
2075
|
-
const [open, setOpen] = (0, react.useState)(false);
|
|
2076
2068
|
const state = props.useConversationUiCard((snapshot) => snapshot);
|
|
2077
2069
|
const blocked = !state.dirty || state.saving || state.status !== "ready";
|
|
2078
2070
|
const versionLabel = state.version === void 0 ? null : t(state.installation === "development" ? "developmentVersion" : "version").replace("{version}", state.version);
|
|
2079
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("
|
|
2080
|
-
className:
|
|
2081
|
-
|
|
2082
|
-
|
|
2071
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("section", {
|
|
2072
|
+
className: `${ConversationCard_module_css_default.card} ${ConversationCard_module_css_default.cardOpen}`,
|
|
2073
|
+
"aria-label": t("title"),
|
|
2074
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
2083
2075
|
className: ConversationCard_module_css_default.header,
|
|
2084
|
-
"
|
|
2085
|
-
|
|
2086
|
-
|
|
2087
|
-
|
|
2088
|
-
|
|
2089
|
-
/* @__PURE__ */ (0, react_jsx_runtime.
|
|
2090
|
-
className: ConversationCard_module_css_default.
|
|
2091
|
-
children:
|
|
2092
|
-
|
|
2093
|
-
|
|
2094
|
-
|
|
2095
|
-
|
|
2096
|
-
children: t("description")
|
|
2097
|
-
})]
|
|
2098
|
-
}),
|
|
2099
|
-
versionLabel === null ? null : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
2076
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
2077
|
+
className: ConversationCard_module_css_default.headText,
|
|
2078
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
2079
|
+
className: ConversationCard_module_css_default.name,
|
|
2080
|
+
children: t("title")
|
|
2081
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
2082
|
+
className: ConversationCard_module_css_default.description,
|
|
2083
|
+
children: t("description")
|
|
2084
|
+
})]
|
|
2085
|
+
}), versionLabel === null && !state.dirty ? null : /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
2086
|
+
className: ConversationCard_module_css_default.metadata,
|
|
2087
|
+
children: [versionLabel === null ? null : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
2100
2088
|
className: ConversationCard_module_css_default.version,
|
|
2101
2089
|
children: versionLabel
|
|
2102
|
-
}),
|
|
2103
|
-
state.dirty ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
2090
|
+
}), state.dirty ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
2104
2091
|
className: ConversationCard_module_css_default.pending,
|
|
2105
2092
|
children: t("unsaved")
|
|
2106
|
-
}) : null
|
|
2107
|
-
|
|
2108
|
-
|
|
2109
|
-
}), open ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
2093
|
+
}) : null]
|
|
2094
|
+
})]
|
|
2095
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
2110
2096
|
className: ConversationCard_module_css_default.body,
|
|
2111
2097
|
children: [
|
|
2112
2098
|
state.status === "loading" ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
@@ -2208,7 +2194,7 @@ window.__ModuleLoader__.load({
|
|
|
2208
2194
|
})
|
|
2209
2195
|
] }) : null
|
|
2210
2196
|
]
|
|
2211
|
-
})
|
|
2197
|
+
})]
|
|
2212
2198
|
});
|
|
2213
2199
|
}
|
|
2214
2200
|
//#endregion
|
|
@@ -2766,7 +2752,7 @@ window.__ModuleLoader__.load({
|
|
|
2766
2752
|
immer.createDraft.bind(immer);
|
|
2767
2753
|
immer.finishDraft.bind(immer);
|
|
2768
2754
|
//#endregion
|
|
2769
|
-
//#region ../../node_modules/.pnpm/@deepseek-ai+dsh-client-store@0.1.
|
|
2755
|
+
//#region ../../node_modules/.pnpm/@deepseek-ai+dsh-client-store@0.1.6-alpha.2_@deepseek-ai+cordis@4.0.2/node_modules/@deepseek-ai/dsh-client-store/lib/index.js
|
|
2770
2756
|
/**
|
|
2771
2757
|
* React-free snapshot store engine (zustand vanilla + immer + subscribeWithSelector +
|
|
2772
2758
|
* rafFlush middleware + opt-in persist + dev freeze) plus the declarative
|
|
@@ -3011,290 +2997,80 @@ window.__ModuleLoader__.load({
|
|
|
3011
2997
|
}
|
|
3012
2998
|
};
|
|
3013
2999
|
//#endregion
|
|
3014
|
-
//#region
|
|
3015
|
-
|
|
3016
|
-
const
|
|
3017
|
-
|
|
3018
|
-
|
|
3019
|
-
|
|
3020
|
-
|
|
3021
|
-
|
|
3022
|
-
|
|
3023
|
-
|
|
3024
|
-
|
|
3025
|
-
|
|
3026
|
-
|
|
3027
|
-
|
|
3028
|
-
|
|
3029
|
-
|
|
3030
|
-
"headerIcon": "sLyncq_headerIcon",
|
|
3031
|
-
"stats": "sLyncq_stats",
|
|
3032
|
-
"item": "sLyncq_item",
|
|
3033
|
-
"parentPath": "sLyncq_parentPath",
|
|
3034
|
-
"more": "sLyncq_more",
|
|
3035
|
-
"header": "sLyncq_header",
|
|
3036
|
-
"added": "sLyncq_added",
|
|
3037
|
-
"title": "sLyncq_title",
|
|
3038
|
-
"fileName": "sLyncq_fileName",
|
|
3039
|
-
"list": "sLyncq_list",
|
|
3040
|
-
"root": "sLyncq_root",
|
|
3041
|
-
"websitePath": "sLyncq_websitePath",
|
|
3042
|
-
"external": "sLyncq_external",
|
|
3043
|
-
"filePath": "sLyncq_filePath",
|
|
3044
|
-
"removed": "sLyncq_removed",
|
|
3045
|
-
"subtitle": "sLyncq_subtitle"
|
|
3046
|
-
};
|
|
3047
|
-
//#endregion
|
|
3048
|
-
//#region src/client/DeliverablesCard.tsx
|
|
3049
|
-
function isWebsite(entry) {
|
|
3050
|
-
return entry.kind === "website" || /^https?:\/\//i.test(entry.path);
|
|
3000
|
+
//#region ../../node_modules/.pnpm/@deepseek-ai+dsh-session@0.1.6-alpha.2_@deepseek-ai+cordis@4.0.2_@deepseek-ai+dsh-scope_e8f480814f38eceaf8ec6e1cc62b6d01/node_modules/@deepseek-ai/dsh-session/lib/types/surface.js
|
|
3001
|
+
/** Runtime counterpart of the message-producing event union. */
|
|
3002
|
+
const SURFACE_EVENT_TYPES = /* @__PURE__ */ new Set([
|
|
3003
|
+
"system/message",
|
|
3004
|
+
"user/message",
|
|
3005
|
+
"assistant/message",
|
|
3006
|
+
"tool/result"
|
|
3007
|
+
]);
|
|
3008
|
+
/**
|
|
3009
|
+
* Narrow an event to a surface-eligible event carrying its required marker.
|
|
3010
|
+
* @param event - event to test.
|
|
3011
|
+
* @returns true when both the type and marker identify a surface event.
|
|
3012
|
+
*/
|
|
3013
|
+
function isSurfaceEvent(event) {
|
|
3014
|
+
if (!SURFACE_EVENT_TYPES.has(event.type)) return false;
|
|
3015
|
+
return event.surfaceOp !== void 0;
|
|
3051
3016
|
}
|
|
3052
|
-
|
|
3053
|
-
|
|
3017
|
+
/**
|
|
3018
|
+
* Narrow an event to an append-origin surface event: one that entered the
|
|
3019
|
+
* surface at its own log position and was never itself a replacement copy.
|
|
3020
|
+
*
|
|
3021
|
+
* The model-visible surface deliberately shadows replaced ranges, so it is the
|
|
3022
|
+
* wrong source for a human transcript — a landed replacement would erase
|
|
3023
|
+
* conversation the user already saw. Append-origin events are that transcript's
|
|
3024
|
+
* durable source material; replacement copies stay model-only.
|
|
3025
|
+
* @param event - event to test.
|
|
3026
|
+
* @returns true when the event appended to the surface tail.
|
|
3027
|
+
*/
|
|
3028
|
+
function isAppendSurfaceEvent(event) {
|
|
3029
|
+
return isSurfaceEvent(event) && event.surfaceOp === "append";
|
|
3054
3030
|
}
|
|
3055
|
-
|
|
3056
|
-
|
|
3057
|
-
|
|
3058
|
-
|
|
3059
|
-
|
|
3060
|
-
};
|
|
3061
|
-
return {
|
|
3062
|
-
parent: path.slice(0, separator + 1),
|
|
3063
|
-
name: path.slice(separator + 1)
|
|
3064
|
-
};
|
|
3031
|
+
//#endregion
|
|
3032
|
+
//#region src/client/deliverables.ts
|
|
3033
|
+
const DELIVERABLES_DATA_KEY = "dsh-conversation-ui-deliverables";
|
|
3034
|
+
function record$1(value) {
|
|
3035
|
+
return value !== null && typeof value === "object" ? value : void 0;
|
|
3065
3036
|
}
|
|
3066
|
-
function
|
|
3067
|
-
|
|
3068
|
-
if (entries.every((entry) => !isWebsite(entry))) return "文件";
|
|
3069
|
-
return "产物";
|
|
3037
|
+
function stringValue(value) {
|
|
3038
|
+
return typeof value === "string" && value.trim() !== "" ? value.trim() : void 0;
|
|
3070
3039
|
}
|
|
3071
|
-
function
|
|
3072
|
-
const
|
|
3073
|
-
|
|
3074
|
-
|
|
3075
|
-
|
|
3076
|
-
return `已交付 ${entries.length} 项产物`;
|
|
3040
|
+
function diffLines(value) {
|
|
3041
|
+
const text = stringValue(value);
|
|
3042
|
+
if (text === void 0) return 0;
|
|
3043
|
+
const body = text.endsWith("\n") ? text.slice(0, -1) : text.endsWith("\\n") ? text.slice(0, -2) : text;
|
|
3044
|
+
return body === "" ? 0 : body.split(/\r?\n|\\n/).length;
|
|
3077
3045
|
}
|
|
3078
|
-
function
|
|
3079
|
-
|
|
3080
|
-
|
|
3081
|
-
|
|
3082
|
-
|
|
3083
|
-
|
|
3084
|
-
const match = /\+(\d+)\s+-\s*(\d+)/.exec(element.textContent ?? "");
|
|
3085
|
-
if (path === null || match === null) continue;
|
|
3086
|
-
result.set(path, {
|
|
3087
|
-
added: Number(match[1]),
|
|
3088
|
-
removed: Number(match[2])
|
|
3089
|
-
});
|
|
3046
|
+
function jsonArgs(argsRaw) {
|
|
3047
|
+
if (argsRaw === void 0) return {};
|
|
3048
|
+
try {
|
|
3049
|
+
return record$1(JSON.parse(argsRaw)) ?? {};
|
|
3050
|
+
} catch {
|
|
3051
|
+
return {};
|
|
3090
3052
|
}
|
|
3091
|
-
return result;
|
|
3092
3053
|
}
|
|
3093
|
-
/**
|
|
3094
|
-
|
|
3095
|
-
|
|
3096
|
-
|
|
3097
|
-
|
|
3098
|
-
|
|
3099
|
-
|
|
3100
|
-
|
|
3101
|
-
|
|
3102
|
-
|
|
3103
|
-
|
|
3104
|
-
|
|
3105
|
-
|
|
3106
|
-
|
|
3107
|
-
|
|
3108
|
-
|
|
3109
|
-
|
|
3110
|
-
|
|
3111
|
-
|
|
3112
|
-
|
|
3113
|
-
className: DeliverablesCard_module_css_default.root,
|
|
3114
|
-
"data-stream-deliverables-card": true,
|
|
3115
|
-
"data-stream-deliverables-count": entries.length,
|
|
3116
|
-
children: [
|
|
3117
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
3118
|
-
className: DeliverablesCard_module_css_default.header,
|
|
3119
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
3120
|
-
className: DeliverablesCard_module_css_default.headerIcon,
|
|
3121
|
-
"aria-hidden": true,
|
|
3122
|
-
children: hasFiles ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconProjectAddOutline16, { size: 20 }) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconGlobeOutline14, { size: 20 })
|
|
3123
|
-
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
3124
|
-
className: DeliverablesCard_module_css_default.heading,
|
|
3125
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("strong", {
|
|
3126
|
-
className: DeliverablesCard_module_css_default.title,
|
|
3127
|
-
children: summary
|
|
3128
|
-
}), hasFiles ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
3129
|
-
type: "button",
|
|
3130
|
-
className: DeliverablesCard_module_css_default.subtitle,
|
|
3131
|
-
onClick: () => {
|
|
3132
|
-
setExpanded(true);
|
|
3133
|
-
},
|
|
3134
|
-
children: "查看更改 ↗"
|
|
3135
|
-
}) : firstWebsite !== void 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
3136
|
-
type: "button",
|
|
3137
|
-
className: DeliverablesCard_module_css_default.subtitle,
|
|
3138
|
-
onClick: () => {
|
|
3139
|
-
openWebsite(firstWebsite.path);
|
|
3140
|
-
},
|
|
3141
|
-
children: "打开网站 ↗"
|
|
3142
|
-
}) : null]
|
|
3143
|
-
})]
|
|
3144
|
-
}),
|
|
3145
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
3146
|
-
className: DeliverablesCard_module_css_default.list,
|
|
3147
|
-
children: visible.map((entry) => {
|
|
3148
|
-
const website = isWebsite(entry);
|
|
3149
|
-
const parts = pathParts(entry.path);
|
|
3150
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
|
|
3151
|
-
type: "button",
|
|
3152
|
-
className: DeliverablesCard_module_css_default.item,
|
|
3153
|
-
title: entry.path,
|
|
3154
|
-
onClick: () => {
|
|
3155
|
-
website ? openWebsite(entry.path) : openFile(entry.path);
|
|
3156
|
-
},
|
|
3157
|
-
children: [
|
|
3158
|
-
website ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
3159
|
-
className: DeliverablesCard_module_css_default.websitePath,
|
|
3160
|
-
children: entry.path
|
|
3161
|
-
}) : /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
3162
|
-
className: DeliverablesCard_module_css_default.filePath,
|
|
3163
|
-
children: [parts.parent !== "" && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
3164
|
-
className: DeliverablesCard_module_css_default.parentPath,
|
|
3165
|
-
children: parts.parent
|
|
3166
|
-
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
3167
|
-
className: DeliverablesCard_module_css_default.fileName,
|
|
3168
|
-
children: parts.name || entry.path
|
|
3169
|
-
})]
|
|
3170
|
-
}),
|
|
3171
|
-
!website && (entry.added > 0 || entry.removed > 0) && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
3172
|
-
className: DeliverablesCard_module_css_default.stats,
|
|
3173
|
-
children: [entry.added > 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
3174
|
-
className: DeliverablesCard_module_css_default.added,
|
|
3175
|
-
children: ["+", entry.added]
|
|
3176
|
-
}), entry.removed > 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
3177
|
-
className: DeliverablesCard_module_css_default.removed,
|
|
3178
|
-
children: ["-", entry.removed]
|
|
3179
|
-
})]
|
|
3180
|
-
}),
|
|
3181
|
-
website && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
3182
|
-
className: DeliverablesCard_module_css_default.external,
|
|
3183
|
-
"aria-hidden": true,
|
|
3184
|
-
children: "↗"
|
|
3185
|
-
})
|
|
3186
|
-
]
|
|
3187
|
-
}, `${entry.kind}:${entry.path}`);
|
|
3188
|
-
})
|
|
3189
|
-
}),
|
|
3190
|
-
hidden > 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
|
|
3191
|
-
type: "button",
|
|
3192
|
-
className: DeliverablesCard_module_css_default.more,
|
|
3193
|
-
onClick: () => {
|
|
3194
|
-
setExpanded(true);
|
|
3195
|
-
},
|
|
3196
|
-
children: [
|
|
3197
|
-
"再显示 ",
|
|
3198
|
-
hidden,
|
|
3199
|
-
" 个",
|
|
3200
|
-
hiddenKindLabel(entries.slice(visible.length)),
|
|
3201
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
3202
|
-
className: DeliverablesCard_module_css_default.moreIcon,
|
|
3203
|
-
"aria-hidden": true,
|
|
3204
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconChevronDownOutline14, {})
|
|
3205
|
-
})
|
|
3206
|
-
]
|
|
3207
|
-
}),
|
|
3208
|
-
expanded && entries.length > 3 && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
|
|
3209
|
-
type: "button",
|
|
3210
|
-
className: DeliverablesCard_module_css_default.more,
|
|
3211
|
-
onClick: () => {
|
|
3212
|
-
setExpanded(false);
|
|
3213
|
-
},
|
|
3214
|
-
children: ["收起 ", /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
3215
|
-
className: DeliverablesCard_module_css_default.moreIcon,
|
|
3216
|
-
"aria-hidden": true,
|
|
3217
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconChevronUpOutline14, {})
|
|
3218
|
-
})]
|
|
3219
|
-
})
|
|
3220
|
-
]
|
|
3221
|
-
});
|
|
3222
|
-
}
|
|
3223
|
-
//#endregion
|
|
3224
|
-
//#region ../../node_modules/.pnpm/@deepseek-ai+dsh-session@0.1.5-alpha.2_@deepseek-ai+cordis@4.0.2_@deepseek-ai+dsh-scope_437c3b82b6665a32ae6d8808253b3bcd/node_modules/@deepseek-ai/dsh-session/lib/types/surface.js
|
|
3225
|
-
/** Runtime counterpart of the message-producing event union. */
|
|
3226
|
-
const SURFACE_EVENT_TYPES = /* @__PURE__ */ new Set([
|
|
3227
|
-
"system/message",
|
|
3228
|
-
"user/message",
|
|
3229
|
-
"assistant/message",
|
|
3230
|
-
"tool/result"
|
|
3231
|
-
]);
|
|
3232
|
-
/**
|
|
3233
|
-
* Narrow an event to a surface-eligible event carrying its required marker.
|
|
3234
|
-
* @param event - event to test.
|
|
3235
|
-
* @returns true when both the type and marker identify a surface event.
|
|
3236
|
-
*/
|
|
3237
|
-
function isSurfaceEvent(event) {
|
|
3238
|
-
if (!SURFACE_EVENT_TYPES.has(event.type)) return false;
|
|
3239
|
-
return event.surfaceOp !== void 0;
|
|
3240
|
-
}
|
|
3241
|
-
/**
|
|
3242
|
-
* Narrow an event to an append-origin surface event: one that entered the
|
|
3243
|
-
* surface at its own log position and was never itself a replacement copy.
|
|
3244
|
-
*
|
|
3245
|
-
* The model-visible surface deliberately shadows replaced ranges, so it is the
|
|
3246
|
-
* wrong source for a human transcript — a landed replacement would erase
|
|
3247
|
-
* conversation the user already saw. Append-origin events are that transcript's
|
|
3248
|
-
* durable source material; replacement copies stay model-only.
|
|
3249
|
-
* @param event - event to test.
|
|
3250
|
-
* @returns true when the event appended to the surface tail.
|
|
3251
|
-
*/
|
|
3252
|
-
function isAppendSurfaceEvent(event) {
|
|
3253
|
-
return isSurfaceEvent(event) && event.surfaceOp === "append";
|
|
3254
|
-
}
|
|
3255
|
-
//#endregion
|
|
3256
|
-
//#region src/client/deliverables.ts
|
|
3257
|
-
const DELIVERABLES_DATA_KEY = "dsh-conversation-ui-deliverables";
|
|
3258
|
-
function record$1(value) {
|
|
3259
|
-
return value !== null && typeof value === "object" ? value : void 0;
|
|
3260
|
-
}
|
|
3261
|
-
function stringValue(value) {
|
|
3262
|
-
return typeof value === "string" && value.trim() !== "" ? value.trim() : void 0;
|
|
3263
|
-
}
|
|
3264
|
-
function diffLines(value) {
|
|
3265
|
-
const text = stringValue(value);
|
|
3266
|
-
if (text === void 0) return 0;
|
|
3267
|
-
const body = text.endsWith("\n") ? text.slice(0, -1) : text.endsWith("\\n") ? text.slice(0, -2) : text;
|
|
3268
|
-
return body === "" ? 0 : body.split(/\r?\n|\\n/).length;
|
|
3269
|
-
}
|
|
3270
|
-
function jsonArgs(argsRaw) {
|
|
3271
|
-
if (argsRaw === void 0) return {};
|
|
3272
|
-
try {
|
|
3273
|
-
return record$1(JSON.parse(argsRaw)) ?? {};
|
|
3274
|
-
} catch {
|
|
3275
|
-
return {};
|
|
3276
|
-
}
|
|
3277
|
-
}
|
|
3278
|
-
/**
|
|
3279
|
-
* Entries carried by a tool result's opaque `meta` payload. First-party file
|
|
3280
|
-
* tools publish applied diffs there (`{ diffs: [{ path, oldText, newText }] }`),
|
|
3281
|
-
* the same payload the native diff-card derivation reads.
|
|
3282
|
-
*/
|
|
3283
|
-
function metaEntries(meta) {
|
|
3284
|
-
const object = record$1(meta);
|
|
3285
|
-
if (object === void 0) return [];
|
|
3286
|
-
const diffs = Array.isArray(object.diffs) ? object.diffs : [];
|
|
3287
|
-
if (diffs.length === 0) return [];
|
|
3288
|
-
return diffs.flatMap((diff) => {
|
|
3289
|
-
const item = record$1(diff);
|
|
3290
|
-
const path = stringValue(item?.path);
|
|
3291
|
-
if (path === void 0) return [];
|
|
3292
|
-
return [{
|
|
3293
|
-
path,
|
|
3294
|
-
added: diffLines(item?.newText),
|
|
3295
|
-
removed: diffLines(item?.oldText),
|
|
3296
|
-
kind: "file"
|
|
3297
|
-
}];
|
|
3054
|
+
/**
|
|
3055
|
+
* Entries carried by a tool result's opaque `meta` payload. First-party file
|
|
3056
|
+
* tools publish applied diffs there (`{ diffs: [{ path, oldText, newText }] }`),
|
|
3057
|
+
* the same payload the native diff-card derivation reads.
|
|
3058
|
+
*/
|
|
3059
|
+
function metaEntries(meta) {
|
|
3060
|
+
const object = record$1(meta);
|
|
3061
|
+
if (object === void 0) return [];
|
|
3062
|
+
const diffs = Array.isArray(object.diffs) ? object.diffs : [];
|
|
3063
|
+
if (diffs.length === 0) return [];
|
|
3064
|
+
return diffs.flatMap((diff) => {
|
|
3065
|
+
const item = record$1(diff);
|
|
3066
|
+
const path = stringValue(item?.path);
|
|
3067
|
+
if (path === void 0) return [];
|
|
3068
|
+
return [{
|
|
3069
|
+
path,
|
|
3070
|
+
added: diffLines(item?.newText),
|
|
3071
|
+
removed: diffLines(item?.oldText),
|
|
3072
|
+
kind: "file"
|
|
3073
|
+
}];
|
|
3298
3074
|
});
|
|
3299
3075
|
}
|
|
3300
3076
|
function mutationPath(name, argsRaw) {
|
|
@@ -3488,6 +3264,224 @@ window.__ModuleLoader__.load({
|
|
|
3488
3264
|
return nativeEntries.length === 0 ? null : nativeEntries;
|
|
3489
3265
|
}
|
|
3490
3266
|
//#endregion
|
|
3267
|
+
//#region \0dsh-css:/home/runner/work/dsh-codex-suite/dsh-codex-suite/packages/conversation-ui/src/client/DeliverablesCard.module.css.mjs
|
|
3268
|
+
const css = "[data-turn-tail]:has([data-stream-deliverables-card])>:has([data-produced-files-row]){display:none!important}.sLyncq_root{border:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-primary);color:var(--dsw-alias-label-secondary);box-sizing:border-box;border-radius:12px;flex-direction:column;gap:0;margin-top:16px;padding:12px 12px 10px;font-size:14px;line-height:22px;display:flex}.sLyncq_header{border-bottom:1px solid var(--dsw-alias-border-l2);align-items:flex-start;gap:12px;min-width:0;padding:4px 8px 12px;display:flex}.sLyncq_headerIcon{background:var(--dsw-alias-interactive-bg-hover);width:40px;height:40px;color:var(--dsw-alias-label-secondary);border-radius:10px;flex:none;justify-content:center;align-items:center;display:inline-flex}.sLyncq_heading{flex-direction:column;gap:1px;min-width:0;display:flex}.sLyncq_title{color:var(--dsw-alias-label-primary);font-size:16px;font-weight:600;line-height:24px}.sLyncq_subtitle{color:var(--dsw-alias-label-tertiary);font:inherit;text-align:start;cursor:pointer;background:0 0;border:0;margin:0;padding:0;font-size:14px;line-height:20px}.sLyncq_subtitle:hover{color:var(--dsw-alias-label-secondary);text-decoration:underline}.sLyncq_list{flex-direction:column;min-width:0;padding:10px 8px 0;display:flex}.sLyncq_item{width:100%;min-width:0;min-height:28px;color:inherit;font:inherit;text-align:start;cursor:pointer;background:0 0;border:0;border-radius:5px;align-items:center;gap:0;margin:0;padding:2px 0;line-height:22px;display:flex}.sLyncq_item:hover{color:var(--dsw-alias-label-primary)}.sLyncq_item:focus-visible,.sLyncq_more:focus-visible,.sLyncq_subtitle:focus-visible{outline:2px solid var(--dsw-alias-border-l3);outline-offset:1px}.sLyncq_filePath,.sLyncq_websitePath{white-space:nowrap;flex:auto;min-width:0;display:flex;overflow:hidden}.sLyncq_parentPath{min-width:0;color:var(--dsw-alias-label-tertiary);text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.sLyncq_fileName{color:var(--dsw-alias-label-secondary);flex:none}.sLyncq_websitePath{color:var(--dsw-alias-label-secondary);text-overflow:ellipsis;overflow:hidden}.sLyncq_stats{white-space:nowrap;flex:none;gap:6px;margin-inline-start:8px;font-size:13px;line-height:22px;display:inline-flex}.sLyncq_added{color:var(--dsw-alias-label-success,#2f9e44)}.sLyncq_removed{color:var(--dsw-alias-label-danger,#d94841)}.sLyncq_external{color:var(--dsw-alias-label-tertiary);flex:none}.sLyncq_more{color:var(--dsw-alias-label-secondary);font:inherit;cursor:pointer;background:0 0;border:0;align-self:flex-start;align-items:center;gap:5px;margin:8px 8px 0;padding:0;line-height:22px;display:inline-flex}.sLyncq_more:hover{color:var(--dsw-alias-label-primary)}.sLyncq_moreIcon{flex:none;justify-content:center;align-items:center;width:14px;height:14px;display:inline-flex}";
|
|
3269
|
+
const tagId = "@jcy2387/dsh-conversation-ui/DeliverablesCard.module.css";
|
|
3270
|
+
if (typeof document !== "undefined") {
|
|
3271
|
+
let tag = document.querySelector("style[data-plugin-css=" + JSON.stringify(tagId) + "]");
|
|
3272
|
+
if (tag === null) {
|
|
3273
|
+
tag = document.createElement("style");
|
|
3274
|
+
tag.dataset.plugin = "@jcy2387/dsh-conversation-ui";
|
|
3275
|
+
tag.dataset.pluginCss = tagId;
|
|
3276
|
+
document.head.appendChild(tag);
|
|
3277
|
+
}
|
|
3278
|
+
tag.textContent = css;
|
|
3279
|
+
}
|
|
3280
|
+
var DeliverablesCard_module_css_default = {
|
|
3281
|
+
"websitePath": "sLyncq_websitePath",
|
|
3282
|
+
"heading": "sLyncq_heading",
|
|
3283
|
+
"fileName": "sLyncq_fileName",
|
|
3284
|
+
"stats": "sLyncq_stats",
|
|
3285
|
+
"root": "sLyncq_root",
|
|
3286
|
+
"parentPath": "sLyncq_parentPath",
|
|
3287
|
+
"filePath": "sLyncq_filePath",
|
|
3288
|
+
"more": "sLyncq_more",
|
|
3289
|
+
"removed": "sLyncq_removed",
|
|
3290
|
+
"list": "sLyncq_list",
|
|
3291
|
+
"subtitle": "sLyncq_subtitle",
|
|
3292
|
+
"headerIcon": "sLyncq_headerIcon",
|
|
3293
|
+
"item": "sLyncq_item",
|
|
3294
|
+
"title": "sLyncq_title",
|
|
3295
|
+
"header": "sLyncq_header",
|
|
3296
|
+
"moreIcon": "sLyncq_moreIcon",
|
|
3297
|
+
"added": "sLyncq_added",
|
|
3298
|
+
"external": "sLyncq_external"
|
|
3299
|
+
};
|
|
3300
|
+
//#endregion
|
|
3301
|
+
//#region src/client/DeliverablesCard.tsx
|
|
3302
|
+
function isWebsite(entry) {
|
|
3303
|
+
return entry.kind === "website" || /^https?:\/\//i.test(entry.path);
|
|
3304
|
+
}
|
|
3305
|
+
function openWebsite(path) {
|
|
3306
|
+
if (typeof window !== "undefined") window.open(path, "_blank", "noopener,noreferrer");
|
|
3307
|
+
}
|
|
3308
|
+
function pathParts(path) {
|
|
3309
|
+
const separator = Math.max(path.lastIndexOf("/"), path.lastIndexOf("\\"));
|
|
3310
|
+
if (separator < 0) return {
|
|
3311
|
+
parent: "",
|
|
3312
|
+
name: path
|
|
3313
|
+
};
|
|
3314
|
+
return {
|
|
3315
|
+
parent: path.slice(0, separator + 1),
|
|
3316
|
+
name: path.slice(separator + 1)
|
|
3317
|
+
};
|
|
3318
|
+
}
|
|
3319
|
+
function hiddenKindLabel(entries) {
|
|
3320
|
+
if (entries.every(isWebsite)) return "网站";
|
|
3321
|
+
if (entries.every((entry) => !isWebsite(entry))) return "文件";
|
|
3322
|
+
return "产物";
|
|
3323
|
+
}
|
|
3324
|
+
function countLabel(entries) {
|
|
3325
|
+
const files = entries.filter((entry) => !isWebsite(entry)).length;
|
|
3326
|
+
const websites = entries.length - files;
|
|
3327
|
+
if (files > 0 && websites === 0) return `已编辑 ${files} 个文件`;
|
|
3328
|
+
if (files === 0) return `交付 ${websites} 个网站`;
|
|
3329
|
+
return `已交付 ${entries.length} 项产物`;
|
|
3330
|
+
}
|
|
3331
|
+
function collectEditStats(turn) {
|
|
3332
|
+
const result = /* @__PURE__ */ new Map();
|
|
3333
|
+
if (typeof document === "undefined") return result;
|
|
3334
|
+
for (const element of document.querySelectorAll("[data-stream-edit-stats]")) {
|
|
3335
|
+
if (element.closest("[data-stream-turn]")?.getAttribute("data-stream-turn") !== String(turn)) continue;
|
|
3336
|
+
const path = element.getAttribute("data-stream-edit-file");
|
|
3337
|
+
const match = /\+(\d+)\s+-\s*(\d+)/.exec(element.textContent ?? "");
|
|
3338
|
+
if (path === null || match === null) continue;
|
|
3339
|
+
result.set(path, {
|
|
3340
|
+
added: Number(match[1]),
|
|
3341
|
+
removed: Number(match[2])
|
|
3342
|
+
});
|
|
3343
|
+
}
|
|
3344
|
+
return result;
|
|
3345
|
+
}
|
|
3346
|
+
/** Render this list contribution only when its Turn has delivered files or websites. */
|
|
3347
|
+
function DeliverablesTail(props) {
|
|
3348
|
+
const matched = selectDeliverables(props);
|
|
3349
|
+
return matched === null ? null : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(DeliverablesCard, {
|
|
3350
|
+
...props,
|
|
3351
|
+
matched
|
|
3352
|
+
});
|
|
3353
|
+
}
|
|
3354
|
+
/** Codex-style turn-tail card for edited files and deployed websites. */
|
|
3355
|
+
function DeliverablesCard({ matched, turn, openFile }) {
|
|
3356
|
+
const [expanded, setExpanded] = (0, react.useState)(false);
|
|
3357
|
+
const [domStats, setDomStats] = (0, react.useState)(() => /* @__PURE__ */ new Map());
|
|
3358
|
+
(0, react.useLayoutEffect)(() => {
|
|
3359
|
+
setDomStats(collectEditStats(turn.turn));
|
|
3360
|
+
}, [turn.turn, matched]);
|
|
3361
|
+
const entries = matched.map((entry) => {
|
|
3362
|
+
const stats = domStats.get(entry.path);
|
|
3363
|
+
return stats === void 0 || entry.added > 0 || entry.removed > 0 ? entry : {
|
|
3364
|
+
...entry,
|
|
3365
|
+
...stats
|
|
3366
|
+
};
|
|
3367
|
+
});
|
|
3368
|
+
const visible = expanded ? entries : entries.slice(0, 3);
|
|
3369
|
+
const hidden = entries.length - visible.length;
|
|
3370
|
+
const summary = countLabel(entries);
|
|
3371
|
+
const hasFiles = entries.some((entry) => !isWebsite(entry));
|
|
3372
|
+
const firstWebsite = entries.find(isWebsite);
|
|
3373
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("section", {
|
|
3374
|
+
className: DeliverablesCard_module_css_default.root,
|
|
3375
|
+
"data-stream-deliverables-card": true,
|
|
3376
|
+
"data-stream-deliverables-count": entries.length,
|
|
3377
|
+
children: [
|
|
3378
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
3379
|
+
className: DeliverablesCard_module_css_default.header,
|
|
3380
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
3381
|
+
className: DeliverablesCard_module_css_default.headerIcon,
|
|
3382
|
+
"aria-hidden": true,
|
|
3383
|
+
children: hasFiles ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconProjectAddOutline16, { size: 20 }) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconGlobeOutline14, { size: 20 })
|
|
3384
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
3385
|
+
className: DeliverablesCard_module_css_default.heading,
|
|
3386
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("strong", {
|
|
3387
|
+
className: DeliverablesCard_module_css_default.title,
|
|
3388
|
+
children: summary
|
|
3389
|
+
}), hasFiles ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
3390
|
+
type: "button",
|
|
3391
|
+
className: DeliverablesCard_module_css_default.subtitle,
|
|
3392
|
+
onClick: () => {
|
|
3393
|
+
setExpanded(true);
|
|
3394
|
+
},
|
|
3395
|
+
children: "查看更改 ↗"
|
|
3396
|
+
}) : firstWebsite !== void 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
3397
|
+
type: "button",
|
|
3398
|
+
className: DeliverablesCard_module_css_default.subtitle,
|
|
3399
|
+
onClick: () => {
|
|
3400
|
+
openWebsite(firstWebsite.path);
|
|
3401
|
+
},
|
|
3402
|
+
children: "打开网站 ↗"
|
|
3403
|
+
}) : null]
|
|
3404
|
+
})]
|
|
3405
|
+
}),
|
|
3406
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
3407
|
+
className: DeliverablesCard_module_css_default.list,
|
|
3408
|
+
children: visible.map((entry) => {
|
|
3409
|
+
const website = isWebsite(entry);
|
|
3410
|
+
const parts = pathParts(entry.path);
|
|
3411
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
|
|
3412
|
+
type: "button",
|
|
3413
|
+
className: DeliverablesCard_module_css_default.item,
|
|
3414
|
+
title: entry.path,
|
|
3415
|
+
onClick: () => {
|
|
3416
|
+
website ? openWebsite(entry.path) : openFile(entry.path);
|
|
3417
|
+
},
|
|
3418
|
+
children: [
|
|
3419
|
+
website ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
3420
|
+
className: DeliverablesCard_module_css_default.websitePath,
|
|
3421
|
+
children: entry.path
|
|
3422
|
+
}) : /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
3423
|
+
className: DeliverablesCard_module_css_default.filePath,
|
|
3424
|
+
children: [parts.parent !== "" && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
3425
|
+
className: DeliverablesCard_module_css_default.parentPath,
|
|
3426
|
+
children: parts.parent
|
|
3427
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
3428
|
+
className: DeliverablesCard_module_css_default.fileName,
|
|
3429
|
+
children: parts.name || entry.path
|
|
3430
|
+
})]
|
|
3431
|
+
}),
|
|
3432
|
+
!website && (entry.added > 0 || entry.removed > 0) && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
3433
|
+
className: DeliverablesCard_module_css_default.stats,
|
|
3434
|
+
children: [entry.added > 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
3435
|
+
className: DeliverablesCard_module_css_default.added,
|
|
3436
|
+
children: ["+", entry.added]
|
|
3437
|
+
}), entry.removed > 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
3438
|
+
className: DeliverablesCard_module_css_default.removed,
|
|
3439
|
+
children: ["-", entry.removed]
|
|
3440
|
+
})]
|
|
3441
|
+
}),
|
|
3442
|
+
website && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
3443
|
+
className: DeliverablesCard_module_css_default.external,
|
|
3444
|
+
"aria-hidden": true,
|
|
3445
|
+
children: "↗"
|
|
3446
|
+
})
|
|
3447
|
+
]
|
|
3448
|
+
}, `${entry.kind}:${entry.path}`);
|
|
3449
|
+
})
|
|
3450
|
+
}),
|
|
3451
|
+
hidden > 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
|
|
3452
|
+
type: "button",
|
|
3453
|
+
className: DeliverablesCard_module_css_default.more,
|
|
3454
|
+
onClick: () => {
|
|
3455
|
+
setExpanded(true);
|
|
3456
|
+
},
|
|
3457
|
+
children: [
|
|
3458
|
+
"再显示 ",
|
|
3459
|
+
hidden,
|
|
3460
|
+
" 个",
|
|
3461
|
+
hiddenKindLabel(entries.slice(visible.length)),
|
|
3462
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
3463
|
+
className: DeliverablesCard_module_css_default.moreIcon,
|
|
3464
|
+
"aria-hidden": true,
|
|
3465
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconChevronDownOutline14, {})
|
|
3466
|
+
})
|
|
3467
|
+
]
|
|
3468
|
+
}),
|
|
3469
|
+
expanded && entries.length > 3 && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
|
|
3470
|
+
type: "button",
|
|
3471
|
+
className: DeliverablesCard_module_css_default.more,
|
|
3472
|
+
onClick: () => {
|
|
3473
|
+
setExpanded(false);
|
|
3474
|
+
},
|
|
3475
|
+
children: ["收起 ", /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
3476
|
+
className: DeliverablesCard_module_css_default.moreIcon,
|
|
3477
|
+
"aria-hidden": true,
|
|
3478
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconChevronUpOutline14, {})
|
|
3479
|
+
})]
|
|
3480
|
+
})
|
|
3481
|
+
]
|
|
3482
|
+
});
|
|
3483
|
+
}
|
|
3484
|
+
//#endregion
|
|
3491
3485
|
//#region src/settings-api.ts
|
|
3492
3486
|
/** Shared wire vocabulary for the plugin-owned settings RPC channel. */
|
|
3493
3487
|
/** Dedicated, loopback-only RPC channel registered by the Host half. */
|
|
@@ -3755,10 +3749,10 @@ window.__ModuleLoader__.load({
|
|
|
3755
3749
|
ctx.slots.inject("conversation.view", () => wrapNativeChatView(ctx));
|
|
3756
3750
|
ctx.slots.inject("conversation.chat.turnTail", () => ctx.slots.register({
|
|
3757
3751
|
name: "conversation.chat.turnTail",
|
|
3752
|
+
id: "@jcy2387/dsh-conversation-ui",
|
|
3758
3753
|
priority: -100,
|
|
3759
|
-
select: selectDeliverables,
|
|
3760
3754
|
registrant: "dsh-conversation-ui"
|
|
3761
|
-
},
|
|
3755
|
+
}, DeliverablesTail));
|
|
3762
3756
|
ctx.inject(["uiConversation"], (deliverablesCtx) => {
|
|
3763
3757
|
return deliverablesCtx.uiConversation.events.register(deliverablesDefinition);
|
|
3764
3758
|
});
|
|
@@ -3774,9 +3768,9 @@ window.__ModuleLoader__.load({
|
|
|
3774
3768
|
zh,
|
|
3775
3769
|
en
|
|
3776
3770
|
}), "dsh-conversation-ui: settings dictionaries");
|
|
3777
|
-
settingsCtx.slots.inject("
|
|
3778
|
-
name: "
|
|
3779
|
-
key:
|
|
3771
|
+
for (const bundle of ["@jcy2387/dsh-conversation-ui", "@jcy2387/dsh-suite"]) settingsCtx.slots.inject("plugins.bundle.config", () => settingsCtx.slots.register({
|
|
3772
|
+
name: "plugins.bundle.config",
|
|
3773
|
+
key: bundle,
|
|
3780
3774
|
locale: NS,
|
|
3781
3775
|
inject: () => card.inject()
|
|
3782
3776
|
}, ConversationCard));
|