dsh-pre-duediligence 0.1.2 → 0.1.4
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/CHANGELOG.md +9 -0
- package/README.md +6 -4
- package/install.sh +1 -1
- package/lib/client.js +269 -197
- package/lib/index.js +1 -1
- package/lib/index.js.map +1 -1
- package/lib/types/left-sidebar.d.ts +5 -8
- package/lib/types/previsit-home.d.ts +10 -0
- package/lib/types/previsit-session.d.ts +29 -0
- package/package.json +2 -1
- package/skills/qcc-previsit-onepager/SKILL.md +1 -1
package/CHANGELOG.md
ADDED
package/README.md
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
# dsh-pre-duediligence
|
|
2
2
|
|
|
3
|
+
当前版本:**0.1.4**。修复智能体入口打开失败,新增仅属于访前尽调会话的中文产品首页,支持跨插件切换后自动展开右侧工作台。详见 [更新日志](CHANGELOG.md)。
|
|
4
|
+
|
|
3
5
|
面向 DeepSeek Harness 的 Session 级访前尽调智能体。业务人员从左侧菜单进入,在会话级工作台定义一次拜访;Agent 调用企查查五类 MCP,使用机会与风险双引擎完成经营状态识别、假设与反证、风险核验,最终交付可追溯的访前尽调报告。
|
|
4
6
|
|
|
5
7
|
## 功能概览
|
|
@@ -55,7 +57,7 @@ bash <(curl -fsSL https://raw.githubusercontent.com/duhu2000/dsh-pre-duediligenc
|
|
|
55
57
|
|
|
56
58
|
1. `dsh-better-sidebar@0.17.1`:提供 Session 级右侧工作台容器。
|
|
57
59
|
2. `dsh-mcp-connector@0.2.32`:提供通用 MCP 连接器与市场,通过“企查查·企业工商”完成 OAuth,并动态挂载企业、风险、知产、经营、历史和董监高 MCP。
|
|
58
|
-
3. `dsh-pre-duediligence@0.1.
|
|
60
|
+
3. `dsh-pre-duediligence@0.1.4`:提供左侧智能体入口、访前工作台、点选拼句器和完整 Skill。
|
|
59
61
|
|
|
60
62
|
安装完成后停止旧的 DSH Web 进程并重新运行:
|
|
61
63
|
|
|
@@ -70,7 +72,7 @@ dsh web
|
|
|
70
72
|
~~~bash
|
|
71
73
|
dsh plugin --profile web add dsh-better-sidebar@0.17.1 --allow-build=node-pty
|
|
72
74
|
dsh plugin --profile web add dsh-mcp-connector@0.2.32
|
|
73
|
-
dsh plugin --profile web add dsh-pre-duediligence@0.1.
|
|
75
|
+
dsh plugin --profile web add dsh-pre-duediligence@0.1.4 --allow-build=dsh-pre-duediligence
|
|
74
76
|
dsh web
|
|
75
77
|
~~~
|
|
76
78
|
|
|
@@ -84,7 +86,7 @@ Better Sidebar 必须使用 `0.17.1`;工作台依赖它的 `targetedOpen` 与
|
|
|
84
86
|
dsh plugin --profile web list --depth 0
|
|
85
87
|
~~~
|
|
86
88
|
|
|
87
|
-
应能看到 `dsh-better-sidebar@0.17.1`、`dsh-mcp-connector@0.2.32` 和 `dsh-pre-duediligence@0.1.
|
|
89
|
+
应能看到 `dsh-better-sidebar@0.17.1`、`dsh-mcp-connector@0.2.32` 和 `dsh-pre-duediligence@0.1.4`。重启 DSH 并连接“企查查·企业工商”后,在左侧菜单点击“访前尽调智能体”打开工作台;Better Sidebar 的右侧“+”菜单不会再列出该入口。点击前 DSH 首页、输入框、消息流和 Session 头部均保持原样。
|
|
88
90
|
|
|
89
91
|
### 从旧访前尽调包迁移
|
|
90
92
|
|
|
@@ -100,7 +102,7 @@ dsh plugin --profile web remove qcc-previsit-dsh
|
|
|
100
102
|
|
|
101
103
|
如果 Web profile 已安装 `qcc-dsh-mcp-oauth`,不要让它与 MCP 连接器同时管理同名企查查 Server:
|
|
102
104
|
|
|
103
|
-
1. 先安装 `dsh-mcp-connector@0.2.32` 和 `dsh-pre-duediligence@0.1.
|
|
105
|
+
1. 先安装 `dsh-mcp-connector@0.2.32` 和 `dsh-pre-duediligence@0.1.4`,完全重启 DSH。
|
|
104
106
|
2. 打开“🧩 MCP连接器”,按界面提示迁移旧企查查授权;也可以重新连接“企查查·企业工商”。
|
|
105
107
|
3. 迁移完成后停止 DSH,执行 `dsh plugin --profile web remove qcc-dsh-mcp-oauth`。
|
|
106
108
|
4. 再次启动 DSH,在“已安装”中确认企查查连接健康,然后执行一次真实企业查询。
|
package/install.sh
CHANGED
|
@@ -5,7 +5,7 @@ set -euo pipefail
|
|
|
5
5
|
readonly PROFILE_NAME="${DSH_PROFILE:-web}"
|
|
6
6
|
readonly BETTER_SIDEBAR_SPEC="dsh-better-sidebar@0.17.1"
|
|
7
7
|
readonly MCP_CONNECTOR_SPEC="dsh-mcp-connector@0.2.32"
|
|
8
|
-
readonly PREVISIT_SPEC="${DSH_PRE_DUEDILIGENCE_SPEC:-dsh-pre-duediligence@0.1.
|
|
8
|
+
readonly PREVISIT_SPEC="${DSH_PRE_DUEDILIGENCE_SPEC:-dsh-pre-duediligence@0.1.4}"
|
|
9
9
|
readonly LEGACY_PREVISIT_NAME="qcc-previsit-dsh"
|
|
10
10
|
readonly LEGACY_QCC_OAUTH_NAME="qcc-dsh-mcp-oauth"
|
|
11
11
|
|
package/lib/client.js
CHANGED
|
@@ -39,7 +39,7 @@ __export(client_exports, {
|
|
|
39
39
|
module.exports = __toCommonJS(client_exports);
|
|
40
40
|
|
|
41
41
|
// src/workbench-v2.tsx
|
|
42
|
-
var
|
|
42
|
+
var import_react5 = require("react");
|
|
43
43
|
|
|
44
44
|
// src/previsit-dock.tsx
|
|
45
45
|
var import_react = require("react");
|
|
@@ -722,9 +722,7 @@ function openWorkbench(service, scope, reveal) {
|
|
|
722
722
|
return false;
|
|
723
723
|
}
|
|
724
724
|
service.openTab({ type: PREVISIT_WORKBENCH_TAB_ID }, scope);
|
|
725
|
-
|
|
726
|
-
reveal.request(scope.sessionId);
|
|
727
|
-
}
|
|
725
|
+
reveal.request(scope.sessionId);
|
|
728
726
|
return true;
|
|
729
727
|
}
|
|
730
728
|
|
|
@@ -732,6 +730,31 @@ function openWorkbench(service, scope, reveal) {
|
|
|
732
730
|
var import_dsh_client_ui_primitives = require("@deepseek-ai/dsh-client-ui-primitives");
|
|
733
731
|
var import_react3 = require("react");
|
|
734
732
|
var import_react_dom2 = require("react-dom");
|
|
733
|
+
|
|
734
|
+
// src/previsit-session.ts
|
|
735
|
+
var PREVISIT_SESSION_ID_PREFIX = "session-dsh-pre-duediligence-";
|
|
736
|
+
function isPrevisitSession(sessionId) {
|
|
737
|
+
return /^session-dsh-pre-duediligence-[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/iu.test(sessionId);
|
|
738
|
+
}
|
|
739
|
+
async function createPrevisitSession(ctx) {
|
|
740
|
+
const workspace = ctx.workspaces?.list?.getSnapshot();
|
|
741
|
+
const current = ctx.sessions.list?.getSnapshot().current;
|
|
742
|
+
const items = workspace?.items ?? [];
|
|
743
|
+
const cwd = items.find((item) => current !== void 0 && item.sessionIds?.includes(current))?.path ?? items.find((item) => item.workspaceId === workspace?.recentWorkspaceId)?.path ?? items[0]?.path;
|
|
744
|
+
if (!cwd) throw new Error("\u8BF7\u5148\u9009\u62E9\u4E00\u4E2A\u5DE5\u4F5C\u7A7A\u95F4\uFF0C\u518D\u6253\u5F00\u8BBF\u524D\u5C3D\u8C03\u667A\u80FD\u4F53");
|
|
745
|
+
if (typeof ctx.sessions.create !== "function" || typeof ctx.sessions.open !== "function") {
|
|
746
|
+
throw new Error("\u5F53\u524D DSH \u7248\u672C\u6CA1\u6709\u53EF\u7528\u7684\u4F1A\u8BDD\u521B\u5EFA\u80FD\u529B");
|
|
747
|
+
}
|
|
748
|
+
if (typeof globalThis.crypto?.randomUUID !== "function") {
|
|
749
|
+
throw new Error("\u5F53\u524D\u6D4F\u89C8\u5668\u4E0D\u652F\u6301\u5B89\u5168\u4F1A\u8BDD\u6807\u8BC6\u751F\u6210\uFF0C\u8BF7\u4F7F\u7528\u6700\u65B0\u7248\u6D4F\u89C8\u5668");
|
|
750
|
+
}
|
|
751
|
+
const requested = PREVISIT_SESSION_ID_PREFIX + globalThis.crypto.randomUUID();
|
|
752
|
+
const created = await ctx.sessions.create({ cwd, sessionId: requested });
|
|
753
|
+
if (created !== requested) throw new Error("\u8BBF\u524D\u5C3D\u8C03\u4F1A\u8BDD\u6807\u8BC6\u4E0D\u5339\u914D\uFF0C\u8BF7\u91CD\u8BD5");
|
|
754
|
+
return created;
|
|
755
|
+
}
|
|
756
|
+
|
|
757
|
+
// src/left-sidebar.tsx
|
|
735
758
|
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
736
759
|
var WORKSPACES_SLOT_SELECTOR = '[data-slot="sidebar.workspaces"]';
|
|
737
760
|
var LAUNCHER_MOUNT_SELECTOR = '[data-previsit-launcher-mount="true"]';
|
|
@@ -820,27 +843,6 @@ function LeftSidebarEntry(props) {
|
|
|
820
843
|
mount
|
|
821
844
|
);
|
|
822
845
|
}
|
|
823
|
-
var PREVISIT_SESSION_ID_PREFIX = "session-dsh-pre-duediligence-";
|
|
824
|
-
function createPrevisitSessionId() {
|
|
825
|
-
if (typeof globalThis.crypto?.randomUUID !== "function") {
|
|
826
|
-
throw new Error("\u5F53\u524D\u6D4F\u89C8\u5668\u4E0D\u652F\u6301\u5B89\u5168\u4F1A\u8BDD\u6807\u8BC6\u751F\u6210\uFF0C\u8BF7\u4F7F\u7528\u6700\u65B0\u7248\u6D4F\u89C8\u5668");
|
|
827
|
-
}
|
|
828
|
-
return `${PREVISIT_SESSION_ID_PREFIX}${globalThis.crypto.randomUUID()}`;
|
|
829
|
-
}
|
|
830
|
-
async function resolveSessionId(ctx) {
|
|
831
|
-
const workspace = ctx.workspaces?.list?.getSnapshot();
|
|
832
|
-
const workspaceId = workspace?.recentWorkspaceId ?? workspace?.items?.[0]?.workspaceId;
|
|
833
|
-
if (workspaceId === void 0) {
|
|
834
|
-
throw new Error("\u8BF7\u5148\u9009\u62E9\u4E00\u4E2A\u5DE5\u4F5C\u7A7A\u95F4\uFF0C\u518D\u6253\u5F00\u8BBF\u524D\u5C3D\u8C03\u667A\u80FD\u4F53");
|
|
835
|
-
}
|
|
836
|
-
const create = ctx.sessions.create;
|
|
837
|
-
if (typeof create !== "function") {
|
|
838
|
-
throw new Error("\u5F53\u524D DSH \u7248\u672C\u6CA1\u6709\u53EF\u7528\u7684\u4F1A\u8BDD\u521B\u5EFA\u80FD\u529B");
|
|
839
|
-
}
|
|
840
|
-
const sessionId = await create({ workspaceId, sessionId: createPrevisitSessionId() });
|
|
841
|
-
ctx.sessions.open?.(sessionId);
|
|
842
|
-
return sessionId;
|
|
843
|
-
}
|
|
844
846
|
function registerLeftSidebarLauncher(ctx, service, reveal) {
|
|
845
847
|
ctx.slots.inject("sidebar.footer.action", () => ctx.slots.register({
|
|
846
848
|
name: "sidebar.footer.action",
|
|
@@ -848,15 +850,75 @@ function registerLeftSidebarLauncher(ctx, service, reveal) {
|
|
|
848
850
|
order: 20,
|
|
849
851
|
inject: () => ({
|
|
850
852
|
openAgent: async () => {
|
|
851
|
-
|
|
853
|
+
assertBetterSidebar(service);
|
|
854
|
+
if (!service.isTabEnabled(PREVISIT_WORKBENCH_TAB_ID)) {
|
|
855
|
+
throw new Error("\u8BBF\u524D\u5C3D\u8C03\u5DE5\u4F5C\u53F0\u5F53\u524D\u4E0D\u53EF\u7528\uFF0C\u8BF7\u68C0\u67E5\u63D2\u4EF6\u914D\u7F6E");
|
|
856
|
+
}
|
|
857
|
+
const sessionId = await createPrevisitSession(ctx);
|
|
852
858
|
if (!openWorkbench(service, { sessionId }, reveal)) {
|
|
853
859
|
throw new Error("\u8BBF\u524D\u5C3D\u8C03\u5DE5\u4F5C\u53F0\u5F53\u524D\u4E0D\u53EF\u7528\uFF0C\u8BF7\u68C0\u67E5\u63D2\u4EF6\u914D\u7F6E");
|
|
854
860
|
}
|
|
861
|
+
ctx.sessions.open?.(sessionId);
|
|
855
862
|
}
|
|
856
863
|
})
|
|
857
864
|
}, LeftSidebarEntry));
|
|
858
865
|
}
|
|
859
866
|
|
|
867
|
+
// src/previsit-home.tsx
|
|
868
|
+
var import_react4 = require("react");
|
|
869
|
+
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
870
|
+
function setPrevisitHeadline(anchor) {
|
|
871
|
+
const hero = anchor.closest('[data-phase="hero"]');
|
|
872
|
+
const title = hero?.querySelector('[class*="headlineText"]');
|
|
873
|
+
if (!title) return () => {
|
|
874
|
+
};
|
|
875
|
+
const original = title.textContent;
|
|
876
|
+
const label = "\u8BBF\u524D\u5C3D\u8C03\u667A\u80FD\u4F53";
|
|
877
|
+
title.textContent = label;
|
|
878
|
+
return () => {
|
|
879
|
+
if (title.textContent === label) title.textContent = original;
|
|
880
|
+
};
|
|
881
|
+
}
|
|
882
|
+
function PrevisitHome({ sessionId, useSession, openWorkbench: openWorkbench2 }) {
|
|
883
|
+
const blank = useSession((state) => state.composerPhase === "blank");
|
|
884
|
+
const enabled = blank && isPrevisitSession(sessionId);
|
|
885
|
+
const anchor = (0, import_react4.useRef)(null);
|
|
886
|
+
(0, import_react4.useEffect)(() => {
|
|
887
|
+
if (!enabled || !anchor.current) return;
|
|
888
|
+
return setPrevisitHeadline(anchor.current);
|
|
889
|
+
}, [enabled, sessionId]);
|
|
890
|
+
if (!enabled) return null;
|
|
891
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
|
|
892
|
+
"section",
|
|
893
|
+
{
|
|
894
|
+
ref: anchor,
|
|
895
|
+
"data-previsit-home": sessionId,
|
|
896
|
+
"aria-label": "\u8BBF\u524D\u5C3D\u8C03\u4EA7\u54C1\u4ECB\u7ECD",
|
|
897
|
+
style: { width: "100%", boxSizing: "border-box", marginBottom: 16, padding: 20, border: "1px solid var(--color-border, #dce4ec)", borderRadius: 16 },
|
|
898
|
+
children: [
|
|
899
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("h2", { style: { margin: "0 0 10px", fontSize: 20 }, children: "\u8BBF\u524D\u5C3D\u8C03\u667A\u80FD\u4F53" }),
|
|
900
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("p", { style: { margin: "0 0 16px", lineHeight: 1.7 }, children: "\u62DC\u8BBF\u524D\u770B\u6E05\u4F01\u4E1A\u7ECF\u8425\u3001\u5408\u4F5C\u673A\u4F1A\u4E0E\u98CE\u9669\uFF0C\u5F62\u6210\u53EF\u8FFD\u6EAF\u7684\u5C3D\u8C03\u7B80\u62A5\u548C\u6C9F\u901A\u63D0\u7EB2\u3002" }),
|
|
901
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("ol", { "aria-label": "\u8BBF\u524D\u5C3D\u8C03\u6D41\u7A0B", style: { display: "flex", flexWrap: "wrap", gap: 24, paddingLeft: 24, lineHeight: 1.8 }, children: [
|
|
902
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("li", { children: "\u5C3D\u8C03\u8BBE\u5B9A" }),
|
|
903
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("li", { children: "\u7ECF\u8425\u7814\u5224" }),
|
|
904
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("li", { children: "\u98CE\u9669\u6838\u67E5" }),
|
|
905
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("li", { children: "\u5C3D\u8C03\u62A5\u544A" })
|
|
906
|
+
] }),
|
|
907
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("p", { style: { fontSize: 13, lineHeight: 1.7 }, children: "\u5728\u53F3\u4FA7\u586B\u5199\u76EE\u6807\u4F01\u4E1A\u3001\u62DC\u8BBF\u89D2\u8272\u548C\u5173\u6CE8\u8303\u56F4\uFF0C\u786E\u8BA4\u540E\u5F00\u59CB\u5C3D\u8C03\u3002\u4F01\u67E5\u67E5\u8FDE\u63A5\u53CA\u989D\u5EA6\u4F7F\u7528\u4F60\u81EA\u5DF1\u7684\u8D26\u53F7\u3002" }),
|
|
908
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
909
|
+
"button",
|
|
910
|
+
{
|
|
911
|
+
type: "button",
|
|
912
|
+
onClick: openWorkbench2,
|
|
913
|
+
style: { cursor: "pointer", borderRadius: 8, border: "1px solid #176b68", background: "#176b68", color: "#fff", padding: "10px 18px" },
|
|
914
|
+
children: "\u6253\u5F00\u5C3D\u8C03\u8BBE\u5B9A"
|
|
915
|
+
}
|
|
916
|
+
)
|
|
917
|
+
]
|
|
918
|
+
}
|
|
919
|
+
);
|
|
920
|
+
}
|
|
921
|
+
|
|
860
922
|
// src/workbench-state.ts
|
|
861
923
|
var PREVISIT_PHASES = ["prepare", "opportunity", "risk", "delivery"];
|
|
862
924
|
function hasTool(toolNames, fragments) {
|
|
@@ -1134,7 +1196,7 @@ function riskSteps(events, insights, finished) {
|
|
|
1134
1196
|
}
|
|
1135
1197
|
|
|
1136
1198
|
// src/workbench-v2.tsx
|
|
1137
|
-
var
|
|
1199
|
+
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
1138
1200
|
var inject = ["slots", "sessions", "workspaces", "conversation", "betterSidebar"];
|
|
1139
1201
|
var STYLE_ID = "dsh-pre-duediligence-workbench";
|
|
1140
1202
|
var PHASE_LABELS = {
|
|
@@ -1160,40 +1222,40 @@ var EMPTY_RUNTIME = {
|
|
|
1160
1222
|
};
|
|
1161
1223
|
function Icon({ name }) {
|
|
1162
1224
|
const paths = {
|
|
1163
|
-
briefcase: /* @__PURE__ */ (0,
|
|
1164
|
-
/* @__PURE__ */ (0,
|
|
1165
|
-
/* @__PURE__ */ (0,
|
|
1225
|
+
briefcase: /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_jsx_runtime4.Fragment, { children: [
|
|
1226
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("rect", { x: "3", y: "7", width: "18", height: "12", rx: "2" }),
|
|
1227
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("path", { d: "M8 7V5h8v2M3 12h18M10 12v2h4v-2" })
|
|
1166
1228
|
] }),
|
|
1167
|
-
prepare: /* @__PURE__ */ (0,
|
|
1168
|
-
/* @__PURE__ */ (0,
|
|
1169
|
-
/* @__PURE__ */ (0,
|
|
1229
|
+
prepare: /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_jsx_runtime4.Fragment, { children: [
|
|
1230
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("path", { d: "M5 4h14v16H5z" }),
|
|
1231
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("path", { d: "M8 8h8M8 12h8M8 16h5" })
|
|
1170
1232
|
] }),
|
|
1171
|
-
opportunity: /* @__PURE__ */ (0,
|
|
1172
|
-
/* @__PURE__ */ (0,
|
|
1173
|
-
/* @__PURE__ */ (0,
|
|
1233
|
+
opportunity: /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_jsx_runtime4.Fragment, { children: [
|
|
1234
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("circle", { cx: "10.5", cy: "10.5", r: "5.5" }),
|
|
1235
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("path", { d: "m15 15 4 4M10.5 7v7M7 10.5h7" })
|
|
1174
1236
|
] }),
|
|
1175
|
-
risk: /* @__PURE__ */ (0,
|
|
1176
|
-
/* @__PURE__ */ (0,
|
|
1177
|
-
/* @__PURE__ */ (0,
|
|
1237
|
+
risk: /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_jsx_runtime4.Fragment, { children: [
|
|
1238
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("path", { d: "M12 3 3.5 7v5c0 4.6 3.1 7.5 8.5 9 5.4-1.5 8.5-4.4 8.5-9V7z" }),
|
|
1239
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("path", { d: "M12 8v5M12 17h.01" })
|
|
1178
1240
|
] }),
|
|
1179
|
-
delivery: /* @__PURE__ */ (0,
|
|
1180
|
-
/* @__PURE__ */ (0,
|
|
1181
|
-
/* @__PURE__ */ (0,
|
|
1241
|
+
delivery: /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_jsx_runtime4.Fragment, { children: [
|
|
1242
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("path", { d: "M6 3h8l4 4v14H6z" }),
|
|
1243
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("path", { d: "M14 3v5h5M9 13h6M9 17h6" })
|
|
1182
1244
|
] }),
|
|
1183
|
-
clock: /* @__PURE__ */ (0,
|
|
1184
|
-
/* @__PURE__ */ (0,
|
|
1185
|
-
/* @__PURE__ */ (0,
|
|
1245
|
+
clock: /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_jsx_runtime4.Fragment, { children: [
|
|
1246
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("circle", { cx: "12", cy: "12", r: "9" }),
|
|
1247
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("path", { d: "M12 7v5l3 2" })
|
|
1186
1248
|
] }),
|
|
1187
|
-
check: /* @__PURE__ */ (0,
|
|
1188
|
-
/* @__PURE__ */ (0,
|
|
1189
|
-
/* @__PURE__ */ (0,
|
|
1249
|
+
check: /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_jsx_runtime4.Fragment, { children: [
|
|
1250
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("circle", { cx: "12", cy: "12", r: "9" }),
|
|
1251
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("path", { d: "m8 12 2.5 2.5L16 9" })
|
|
1190
1252
|
] }),
|
|
1191
|
-
warning: /* @__PURE__ */ (0,
|
|
1192
|
-
/* @__PURE__ */ (0,
|
|
1193
|
-
/* @__PURE__ */ (0,
|
|
1253
|
+
warning: /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_jsx_runtime4.Fragment, { children: [
|
|
1254
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("path", { d: "M12 3 2.8 20h18.4z" }),
|
|
1255
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("path", { d: "M12 9v4M12 17h.01" })
|
|
1194
1256
|
] })
|
|
1195
1257
|
};
|
|
1196
|
-
return /* @__PURE__ */ (0,
|
|
1258
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("svg", { className: "qccPwIcon", viewBox: "0 0 24 24", "aria-hidden": "true", children: paths[name] });
|
|
1197
1259
|
}
|
|
1198
1260
|
function collectRuntime(snapshot, baseline) {
|
|
1199
1261
|
const toolNames = /* @__PURE__ */ new Set();
|
|
@@ -1215,11 +1277,11 @@ function collectRuntime(snapshot, baseline) {
|
|
|
1215
1277
|
}
|
|
1216
1278
|
function Feedback(props) {
|
|
1217
1279
|
const icon = props.tone === "success" ? "check" : props.tone === "error" ? "warning" : "clock";
|
|
1218
|
-
return /* @__PURE__ */ (0,
|
|
1219
|
-
/* @__PURE__ */ (0,
|
|
1220
|
-
/* @__PURE__ */ (0,
|
|
1221
|
-
/* @__PURE__ */ (0,
|
|
1222
|
-
/* @__PURE__ */ (0,
|
|
1280
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "qccPwFeedback", "data-tone": props.tone, role: props.tone === "error" ? "alert" : "status", children: [
|
|
1281
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "qccPwFeedbackIcon", children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Icon, { name: icon }) }),
|
|
1282
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { children: [
|
|
1283
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("strong", { children: props.title }),
|
|
1284
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("p", { children: props.children })
|
|
1223
1285
|
] })
|
|
1224
1286
|
] });
|
|
1225
1287
|
}
|
|
@@ -1232,51 +1294,51 @@ function SetupPanel(props) {
|
|
|
1232
1294
|
start: props.start,
|
|
1233
1295
|
onStarted: props.onStarted
|
|
1234
1296
|
});
|
|
1235
|
-
return /* @__PURE__ */ (0,
|
|
1236
|
-
/* @__PURE__ */ (0,
|
|
1237
|
-
/* @__PURE__ */ (0,
|
|
1238
|
-
/* @__PURE__ */ (0,
|
|
1239
|
-
/* @__PURE__ */ (0,
|
|
1297
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("section", { className: "qccPwPanel", children: [
|
|
1298
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("header", { className: "qccPwPageHeading", children: [
|
|
1299
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { children: [
|
|
1300
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("p", { className: "qccPwEyebrow", children: "PREVISIT" }),
|
|
1301
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("h2", { children: "\u5C3D\u8C03\u8BBE\u5B9A" })
|
|
1240
1302
|
] }),
|
|
1241
|
-
props.task === void 0 ? null : /* @__PURE__ */ (0,
|
|
1303
|
+
props.task === void 0 ? null : /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "qccPwTaskId", children: props.task.id })
|
|
1242
1304
|
] }),
|
|
1243
|
-
/* @__PURE__ */ (0,
|
|
1244
|
-
props.task === void 0 ? null : /* @__PURE__ */ (0,
|
|
1245
|
-
/* @__PURE__ */ (0,
|
|
1246
|
-
/* @__PURE__ */ (0,
|
|
1305
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: "qccPwCard qccPwSetupCard", children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(PrevisitFields, { actions, idPrefix: `qccPw-${props.sessionId}` }) }),
|
|
1306
|
+
props.task === void 0 ? null : /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "qccPwCard", children: [
|
|
1307
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: "qccPwCardHeader", children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("h3", { children: "\u5DF2\u53D1\u9001\u7684\u4EFB\u52A1" }) }) }),
|
|
1308
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("pre", { className: "qccPwPrompt", children: props.task.prompt })
|
|
1247
1309
|
] })
|
|
1248
1310
|
] });
|
|
1249
1311
|
}
|
|
1250
1312
|
function Steps(props) {
|
|
1251
|
-
return /* @__PURE__ */ (0,
|
|
1252
|
-
/* @__PURE__ */ (0,
|
|
1253
|
-
/* @__PURE__ */ (0,
|
|
1254
|
-
/* @__PURE__ */ (0,
|
|
1255
|
-
step.note === void 0 ? null : /* @__PURE__ */ (0,
|
|
1313
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("ol", { className: "qccPwSteps", children: props.steps.map((step, index) => /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("li", { className: "qccPwStep", "data-state": step.state, children: [
|
|
1314
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "qccPwStepDot", children: step.state === "done" ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Icon, { name: "check" }) : index + 1 }),
|
|
1315
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("span", { className: "qccPwStepCopy", children: [
|
|
1316
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("b", { children: step.label }),
|
|
1317
|
+
step.note === void 0 ? null : /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("small", { children: step.note })
|
|
1256
1318
|
] })
|
|
1257
1319
|
] }, step.label)) });
|
|
1258
1320
|
}
|
|
1259
1321
|
function Dimensions(props) {
|
|
1260
1322
|
const done = props.items.filter((d) => d.status === "done").length;
|
|
1261
|
-
return /* @__PURE__ */ (0,
|
|
1262
|
-
/* @__PURE__ */ (0,
|
|
1263
|
-
/* @__PURE__ */ (0,
|
|
1264
|
-
done === 0 ? null : /* @__PURE__ */ (0,
|
|
1323
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "qccPwCard", children: [
|
|
1324
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "qccPwCardHeader", children: [
|
|
1325
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("h3", { children: props.title }) }),
|
|
1326
|
+
done === 0 ? null : /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("span", { className: "qccPwMode", children: [
|
|
1265
1327
|
done,
|
|
1266
1328
|
" \u9879"
|
|
1267
1329
|
] })
|
|
1268
1330
|
] }),
|
|
1269
|
-
props.items.length === 0 ? /* @__PURE__ */ (0,
|
|
1331
|
+
props.items.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("p", { className: "qccPwEmpty", children: props.empty }) : /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: "qccPwDims", children: props.items.map((item) => /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "qccPwDim", "data-status": item.status, children: item.label }, item.label)) })
|
|
1270
1332
|
] });
|
|
1271
1333
|
}
|
|
1272
1334
|
function StagePanel(props) {
|
|
1273
|
-
return /* @__PURE__ */ (0,
|
|
1274
|
-
/* @__PURE__ */ (0,
|
|
1275
|
-
/* @__PURE__ */ (0,
|
|
1276
|
-
/* @__PURE__ */ (0,
|
|
1277
|
-
/* @__PURE__ */ (0,
|
|
1335
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("section", { className: "qccPwPanel", children: [
|
|
1336
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("header", { className: "qccPwPageHeading", children: [
|
|
1337
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { children: [
|
|
1338
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("p", { className: "qccPwEyebrow", children: props.eyebrow }),
|
|
1339
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("h2", { children: props.title })
|
|
1278
1340
|
] }),
|
|
1279
|
-
props.task === void 0 ? null : /* @__PURE__ */ (0,
|
|
1341
|
+
props.task === void 0 ? null : /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "qccPwTaskId", children: props.task.id })
|
|
1280
1342
|
] }),
|
|
1281
1343
|
props.children
|
|
1282
1344
|
] });
|
|
@@ -1288,36 +1350,36 @@ function OpportunityPanel(props) {
|
|
|
1288
1350
|
const steps = opportunitySteps(props.events, insights, finished);
|
|
1289
1351
|
const dims = opportunityDimensions(props.events);
|
|
1290
1352
|
const concluded = insights.state !== null || insights.stateUndetermined;
|
|
1291
|
-
return /* @__PURE__ */ (0,
|
|
1292
|
-
/* @__PURE__ */ (0,
|
|
1293
|
-
/* @__PURE__ */ (0,
|
|
1294
|
-
/* @__PURE__ */ (0,
|
|
1295
|
-
/* @__PURE__ */ (0,
|
|
1296
|
-
/* @__PURE__ */ (0,
|
|
1297
|
-
insights.confidence === null ? null : /* @__PURE__ */ (0,
|
|
1353
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(StagePanel, { eyebrow: "OPPORTUNITY", title: "\u7ECF\u8425\u7814\u5224", task: props.task, children: [
|
|
1354
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Steps, { steps }),
|
|
1355
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Dimensions, { title: "\u5DF2\u53D6\u5F97", items: dims, empty: running ? "\u6B63\u5728\u5EFA\u7ACB\u4E3B\u4F53\u4E0E\u4FE1\u53F7\u96C6\u2026" : "\u5C3D\u8C03\u5F00\u59CB\u540E\u663E\u793A\u53D6\u5F97\u7684\u7EF4\u5EA6" }),
|
|
1356
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "qccPwCard", children: [
|
|
1357
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "qccPwCardHeader", children: [
|
|
1358
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("h3", { children: "\u7ECF\u8425\u72B6\u6001" }) }),
|
|
1359
|
+
insights.confidence === null ? null : /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("span", { className: "qccPwMode", children: [
|
|
1298
1360
|
"\u7F6E\u4FE1\u5EA6 ",
|
|
1299
1361
|
insights.confidence
|
|
1300
1362
|
] })
|
|
1301
1363
|
] }),
|
|
1302
|
-
/* @__PURE__ */ (0,
|
|
1303
|
-
insights.stateUndetermined ? /* @__PURE__ */ (0,
|
|
1304
|
-
insights.industryLink === null ? null : /* @__PURE__ */ (0,
|
|
1364
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: "qccPwStateStrip", "data-concluded": concluded, children: BUSINESS_STATES.map((state) => /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "qccPwState", "data-hit": insights.state === state, children: state }, state)) }),
|
|
1365
|
+
insights.stateUndetermined ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("p", { className: "qccPwNote", children: "\u72B6\u6001\u672A\u5B9A\uFF1A\u516C\u5F00\u8BC1\u636E\u4E0D\u8DB3\uFF0C\u672C\u6B21\u964D\u7EA7\u4E3A\u6E05\u5355\u5F0F\u7B80\u62A5\u3002" }) : null,
|
|
1366
|
+
insights.industryLink === null ? null : /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("p", { className: "qccPwNote", children: [
|
|
1305
1367
|
"\u4EA7\u4E1A\u94FE\u73AF\u8282\uFF1A",
|
|
1306
1368
|
insights.industryLink
|
|
1307
1369
|
] })
|
|
1308
1370
|
] }),
|
|
1309
|
-
/* @__PURE__ */ (0,
|
|
1310
|
-
/* @__PURE__ */ (0,
|
|
1311
|
-
/* @__PURE__ */ (0,
|
|
1312
|
-
insights.hypotheses.length === 0 ? null : /* @__PURE__ */ (0,
|
|
1371
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "qccPwCard", children: [
|
|
1372
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "qccPwCardHeader", children: [
|
|
1373
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("h3", { children: "\u4E1A\u52A1\u5047\u8BBE" }) }),
|
|
1374
|
+
insights.hypotheses.length === 0 ? null : /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("span", { className: "qccPwMode", children: [
|
|
1313
1375
|
insights.hypotheses.length,
|
|
1314
1376
|
" \u6761"
|
|
1315
1377
|
] })
|
|
1316
1378
|
] }),
|
|
1317
|
-
insights.hypotheses.length === 0 ? /* @__PURE__ */ (0,
|
|
1318
|
-
/* @__PURE__ */ (0,
|
|
1319
|
-
/* @__PURE__ */ (0,
|
|
1320
|
-
/* @__PURE__ */ (0,
|
|
1379
|
+
insights.hypotheses.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("p", { className: "qccPwEmpty", children: finished ? insights.stateUndetermined ? "\u72B6\u6001\u672A\u5B9A\uFF0C\u672A\u751F\u6210\u5047\u8BBE\uFF1B\u76F8\u5173\u672A\u77E5\u5DF2\u8F6C\u5165\u73B0\u573A\u5FC5\u95EE" : insights.found ? "\u62A5\u544A\u4E2D\u672A\u8BC6\u522B\u51FA\u5047\u8BBE" : "\u62A5\u544A\u672A\u6355\u83B7" : running ? "\u72B6\u6001\u5224\u5B9A\u540E\u751F\u6210" : "\u5C3D\u8C03\u5F00\u59CB\u540E\u663E\u793A" }) : /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("ol", { className: "qccPwHypos", children: insights.hypotheses.map((h) => /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("li", { children: [
|
|
1380
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "qccPwPri", "data-p": h.priority, children: h.priority }),
|
|
1381
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("b", { children: h.id }),
|
|
1382
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { children: h.text })
|
|
1321
1383
|
] }, h.id)) })
|
|
1322
1384
|
] })
|
|
1323
1385
|
] });
|
|
@@ -1330,49 +1392,49 @@ function RiskPanel(props) {
|
|
|
1330
1392
|
const dims = riskDimensions(props.events);
|
|
1331
1393
|
const real = (level) => insights.risks.filter((r) => r.level === level && !/^(无|—|-|暂无|本次.*未发现)/.test(r.text));
|
|
1332
1394
|
const judged = insights.sections.includes("\u7EA2\u7EBF\u63D0\u793A");
|
|
1333
|
-
return /* @__PURE__ */ (0,
|
|
1334
|
-
/* @__PURE__ */ (0,
|
|
1335
|
-
/* @__PURE__ */ (0,
|
|
1336
|
-
/* @__PURE__ */ (0,
|
|
1337
|
-
/* @__PURE__ */ (0,
|
|
1338
|
-
!judged ? /* @__PURE__ */ (0,
|
|
1395
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(StagePanel, { eyebrow: "RISK", title: "\u98CE\u9669\u6838\u67E5", task: props.task, children: [
|
|
1396
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Steps, { steps }),
|
|
1397
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Dimensions, { title: "\u5DF2\u6838\u67E5", items: dims, empty: running ? "\u7B49\u5F85\u98CE\u9669\u626B\u63CF\u2026" : "\u5C3D\u8C03\u5F00\u59CB\u540E\u663E\u793A\u6838\u67E5\u7684\u7EF4\u5EA6" }),
|
|
1398
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "qccPwCard", children: [
|
|
1399
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: "qccPwCardHeader", children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("h3", { children: "\u98CE\u9669\u5206\u7EA7" }) }) }),
|
|
1400
|
+
!judged ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("p", { className: "qccPwEmpty", children: running ? "\u626B\u63CF\u4E0E\u4E0B\u94BB\u540E\u7ED9\u51FA\u5206\u7EA7" : finished ? "\u62A5\u544A\u672A\u6355\u83B7" : "\u5C3D\u8C03\u5F00\u59CB\u540E\u663E\u793A" }) : insights.riskNoRecord && insights.risks.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("p", { className: "qccPwNote", children: "\u4F01\u4E1A\u81EA\u8EAB\u98CE\u9669\u626B\u63CF\u672A\u53D1\u73B0\u516C\u5F00\u8BB0\u5F55\uFF1B\u8FD9\u4E0D\u7B49\u4E8E\u4E0D\u5B58\u5728\u5176\u4ED6\u98CE\u9669\u3002" }) : /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: "qccPwRiskTiles", children: ["\u7EA2\u7EBF", "\u5173\u6CE8", "\u4FE1\u606F"].map((level) => {
|
|
1339
1401
|
const items = real(level);
|
|
1340
|
-
return /* @__PURE__ */ (0,
|
|
1341
|
-
/* @__PURE__ */ (0,
|
|
1342
|
-
/* @__PURE__ */ (0,
|
|
1343
|
-
/* @__PURE__ */ (0,
|
|
1402
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "qccPwRiskTile", "data-level": level, "data-empty": items.length === 0, children: [
|
|
1403
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "qccPwRiskTileTop", children: [
|
|
1404
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("b", { children: level }),
|
|
1405
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("strong", { children: items.length })
|
|
1344
1406
|
] }),
|
|
1345
|
-
/* @__PURE__ */ (0,
|
|
1407
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("p", { children: items[0]?.text ?? "\u672C\u6B21\u672A\u53D1\u73B0" })
|
|
1346
1408
|
] }, level);
|
|
1347
1409
|
}) })
|
|
1348
1410
|
] })
|
|
1349
1411
|
] });
|
|
1350
1412
|
}
|
|
1351
1413
|
function ReportViewer(props) {
|
|
1352
|
-
const ref = (0,
|
|
1414
|
+
const ref = (0, import_react5.useRef)(null);
|
|
1353
1415
|
const fit = () => {
|
|
1354
1416
|
const el = ref.current;
|
|
1355
1417
|
const h = el?.contentDocument?.documentElement?.scrollHeight;
|
|
1356
1418
|
if (el !== null && h !== void 0 && h > 0) el.style.height = `${h + 8}px`;
|
|
1357
1419
|
};
|
|
1358
|
-
(0,
|
|
1420
|
+
(0, import_react5.useEffect)(() => {
|
|
1359
1421
|
fit();
|
|
1360
1422
|
}, [props.html]);
|
|
1361
1423
|
const embedded = props.html.replace("</head>", "<style>body{background:#fff}.sheet{margin:0;border:0;border-radius:0;box-shadow:none}.hero{padding:18px 20px 16px}.body{padding:6px 20px 20px}</style></head>");
|
|
1362
|
-
return /* @__PURE__ */ (0,
|
|
1424
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("iframe", { ref, className: "qccPwReportFrame", title: "\u5C3D\u8C03\u62A5\u544A", sandbox: "allow-same-origin", srcDoc: embedded, onLoad: fit });
|
|
1363
1425
|
}
|
|
1364
1426
|
function DeliveryPanel(props) {
|
|
1365
1427
|
const ready = props.status === "ready";
|
|
1366
1428
|
if (props.reportHtml !== null) {
|
|
1367
|
-
return /* @__PURE__ */ (0,
|
|
1368
|
-
/* @__PURE__ */ (0,
|
|
1369
|
-
/* @__PURE__ */ (0,
|
|
1370
|
-
/* @__PURE__ */ (0,
|
|
1371
|
-
/* @__PURE__ */ (0,
|
|
1429
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("section", { className: "qccPwPanel", children: [
|
|
1430
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("header", { className: "qccPwPageHeading", children: [
|
|
1431
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { children: [
|
|
1432
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("p", { className: "qccPwEyebrow", children: "REPORT" }),
|
|
1433
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("h2", { children: "\u5C3D\u8C03\u62A5\u544A" })
|
|
1372
1434
|
] }),
|
|
1373
|
-
props.task === void 0 ? null : /* @__PURE__ */ (0,
|
|
1435
|
+
props.task === void 0 ? null : /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "qccPwTaskId", children: props.task.id })
|
|
1374
1436
|
] }),
|
|
1375
|
-
/* @__PURE__ */ (0,
|
|
1437
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: "qccPwCard qccPwReportCard", children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(ReportViewer, { html: props.reportHtml }) })
|
|
1376
1438
|
] });
|
|
1377
1439
|
}
|
|
1378
1440
|
const deliverables = [
|
|
@@ -1385,46 +1447,46 @@ function DeliveryPanel(props) {
|
|
|
1385
1447
|
["\u2466", "\u89E6\u8FBE\u5F00\u573A", "\u6765\u6E90\u3001\u5F52\u5C5E\u3001\u7528\u9014\u4E0E\u5F00\u573A\u767D"],
|
|
1386
1448
|
["\u2467", "\u8986\u76D6\u8BF4\u660E", "\u5DF2\u67E5\u3001\u672A\u67E5\u3001\u5931\u8D25\u4E0E\u8BC1\u636E\u5C42\u7EA7"]
|
|
1387
1449
|
];
|
|
1388
|
-
return /* @__PURE__ */ (0,
|
|
1389
|
-
/* @__PURE__ */ (0,
|
|
1390
|
-
/* @__PURE__ */ (0,
|
|
1391
|
-
/* @__PURE__ */ (0,
|
|
1392
|
-
/* @__PURE__ */ (0,
|
|
1393
|
-
/* @__PURE__ */ (0,
|
|
1450
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("section", { className: "qccPwPanel", children: [
|
|
1451
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("header", { className: "qccPwPageHeading", children: [
|
|
1452
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { children: [
|
|
1453
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("p", { className: "qccPwEyebrow", children: "REPORT" }),
|
|
1454
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("h2", { children: "\u5C3D\u8C03\u62A5\u544A" }),
|
|
1455
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("p", { children: "\u4E0D\u662F\u8D44\u6599\u5806\u780C\uFF0C\u53EA\u56DE\u7B54\u56DB\u4EF6\u4E8B\uFF1A\u53BB\u4E0D\u53BB\u3001\u89C1\u8C01\u3001\u804A\u4EC0\u4E48\u3001\u4EC0\u4E48\u4E0D\u80FD\u78B0\u3002" })
|
|
1394
1456
|
] }),
|
|
1395
|
-
props.task === void 0 ? null : /* @__PURE__ */ (0,
|
|
1457
|
+
props.task === void 0 ? null : /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "qccPwTaskId", children: props.task.id })
|
|
1396
1458
|
] }),
|
|
1397
|
-
props.task === void 0 ? props.cardCaptured ? /* @__PURE__ */ (0,
|
|
1398
|
-
/* @__PURE__ */ (0,
|
|
1399
|
-
/* @__PURE__ */ (0,
|
|
1400
|
-
/* @__PURE__ */ (0,
|
|
1401
|
-
/* @__PURE__ */ (0,
|
|
1459
|
+
props.task === void 0 ? props.cardCaptured ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Feedback, { tone: "success", title: "\u62A5\u544A\u53EF\u4E0B\u8F7D", children: "\u5F53\u524D\u4F1A\u8BDD\u4E2D\u5DF2\u6709\u5C3D\u8C03\u62A5\u544A\uFF0C\u53EF\u76F4\u63A5\u4E0B\u8F7D\uFF1B\u65B0\u7684\u5C3D\u8C03\u5C06\u91CD\u65B0\u8BA1\u6570\u3002" }) : /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Feedback, { tone: "notice", title: "\u7B49\u5F85\u8BBE\u5B9A", children: "\u5B8C\u6210\u5C3D\u8C03\u8BBE\u5B9A\u540E\uFF0C\u62A5\u544A\u7ED3\u6784\u4E0E\u6267\u884C\u8FDB\u5EA6\u4F1A\u663E\u793A\u5728\u8FD9\u91CC\u3002" }) : ready ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Feedback, { tone: "success", title: "\u62A5\u544A\u5DF2\u751F\u6210", children: "\u6267\u884C\u5DF2\u7ED3\u675F\u3002\u53EF\u4E0B\u8F7D\u62A5\u544A\uFF0C\u6216\u56DE\u5230\u4F1A\u8BDD\u67E5\u770B\u5B8C\u6574\u5185\u5BB9\u4E0E\u4E8B\u5B9E\u5F15\u7528\u3002" }) : props.status === "failed" ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Feedback, { tone: "error", title: "\u672C\u6B21\u5C3D\u8C03\u672A\u5B8C\u6574\u5B8C\u6210", children: "\u8BF7\u56DE\u5230\u4F1A\u8BDD\u67E5\u770B\u9519\u8BEF\uFF1B\u5DF2\u53D6\u5F97\u4E8B\u5B9E\u4ECD\u53EF\u4FDD\u7559\uFF0C\u5931\u8D25\u7EF4\u5EA6\u4E0D\u5F97\u5199\u6210\u96F6\u8BB0\u5F55\u3002" }) : /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Feedback, { tone: "notice", title: props.status === "running" ? "\u6B63\u5728\u751F\u6210\u62A5\u544A" : "\u7B49\u5F85\u5F00\u59CB", children: props.status === "running" && !props.cardCaptured ? "\u4F1A\u8BDD\u82E5\u505C\u5728\u5019\u9009\u4E3B\u4F53\u786E\u8BA4\uFF0C\u8BF7\u5148\u5728\u4F1A\u8BDD\u4E2D\u9009\u5B9A\u4F01\u4E1A\uFF1B\u62A5\u544A\u751F\u6210\u540E\u300C\u4E0B\u8F7D\u62A5\u544A\u300D\u624D\u53EF\u70B9\u3002" : "\u5B8C\u6210\u7ECF\u8425\u4E0E\u98CE\u9669\u4E24\u6761\u7EBF\u540E\uFF0C\u5C06\u81EA\u52A8\u5207\u6362\u5230\u672C\u9875\u3002" }),
|
|
1460
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "qccPwCard", children: [
|
|
1461
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: "qccPwCardHeader", children: /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { children: [
|
|
1462
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("h3", { children: "\u62A5\u544A\u7ED3\u6784" }),
|
|
1463
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("p", { children: "\u56FA\u5B9A\u516B\u6BB5\uFF0C\u53EF\u538B\u7F29\u6216\u5C55\u5F00\uFF1B\u4E8B\u5B9E\u3001\u63A8\u7406\u3001\u95EE\u9898\u548C\u8986\u76D6\u8FB9\u754C\u4E0D\u6DF7\u5199\u3002" })
|
|
1402
1464
|
] }) }),
|
|
1403
|
-
/* @__PURE__ */ (0,
|
|
1404
|
-
/* @__PURE__ */ (0,
|
|
1405
|
-
/* @__PURE__ */ (0,
|
|
1406
|
-
/* @__PURE__ */ (0,
|
|
1407
|
-
/* @__PURE__ */ (0,
|
|
1465
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: "qccPwDeliverables", children: deliverables.map(([number, title, detail]) => /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "qccPwDeliverable", children: [
|
|
1466
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { children: number }),
|
|
1467
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { children: [
|
|
1468
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("b", { children: title }),
|
|
1469
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("small", { children: detail })
|
|
1408
1470
|
] })
|
|
1409
1471
|
] }, number)) })
|
|
1410
1472
|
] }),
|
|
1411
|
-
/* @__PURE__ */ (0,
|
|
1412
|
-
/* @__PURE__ */ (0,
|
|
1413
|
-
/* @__PURE__ */ (0,
|
|
1414
|
-
/* @__PURE__ */ (0,
|
|
1473
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "qccPwCard", children: [
|
|
1474
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: "qccPwCardHeader", children: /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { children: [
|
|
1475
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("h3", { children: "\u6267\u884C\u8986\u76D6" }),
|
|
1476
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("p", { children: "\u8FD9\u662F\u5DE5\u4F5C\u53F0\u4ECE\u5F53\u524D Session \u8BFB\u53D6\u7684\u771F\u5B9E\u6267\u884C\u4E8B\u4EF6\uFF0C\u4E0D\u662F\u5B8C\u6574\u6027\u8BC4\u5206\u3002" })
|
|
1415
1477
|
] }) }),
|
|
1416
|
-
/* @__PURE__ */ (0,
|
|
1417
|
-
/* @__PURE__ */ (0,
|
|
1418
|
-
/* @__PURE__ */ (0,
|
|
1419
|
-
/* @__PURE__ */ (0,
|
|
1478
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "qccPwCoverage", children: [
|
|
1479
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "qccPwMetric", children: [
|
|
1480
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("strong", { children: props.toolCount }),
|
|
1481
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { children: "\u5DF2\u8BC6\u522B\u5DE5\u5177\u8C03\u7528" })
|
|
1420
1482
|
] }),
|
|
1421
|
-
/* @__PURE__ */ (0,
|
|
1422
|
-
/* @__PURE__ */ (0,
|
|
1423
|
-
/* @__PURE__ */ (0,
|
|
1483
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "qccPwMetric", children: [
|
|
1484
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("strong", { children: props.failedToolCount }),
|
|
1485
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { children: "\u5DE5\u5177\u9519\u8BEF" })
|
|
1424
1486
|
] }),
|
|
1425
|
-
/* @__PURE__ */ (0,
|
|
1426
|
-
/* @__PURE__ */ (0,
|
|
1427
|
-
/* @__PURE__ */ (0,
|
|
1487
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "qccPwMetric", children: [
|
|
1488
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("strong", { children: ready ? "4/4" : "\u2014" }),
|
|
1489
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { children: "\u4E1A\u52A1\u9636\u6BB5" })
|
|
1428
1490
|
] })
|
|
1429
1491
|
] })
|
|
1430
1492
|
] })
|
|
@@ -1461,20 +1523,20 @@ function extractCardFromDom() {
|
|
|
1461
1523
|
}
|
|
1462
1524
|
function PrevisitWorkbenchTab(props) {
|
|
1463
1525
|
const sessionId = props.scope.sessionId;
|
|
1464
|
-
const shared = (0,
|
|
1526
|
+
const shared = (0, import_react5.useSyncExternalStore)(props.shared.subscribe, () => props.shared.get(sessionId));
|
|
1465
1527
|
const task = shared.task;
|
|
1466
1528
|
const setTask = (fn) => props.shared.update(sessionId, (s) => ({ ...s, task: fn(s.task) }));
|
|
1467
|
-
const [phase, setPhase] = (0,
|
|
1468
|
-
const [runtime, setRuntime] = (0,
|
|
1469
|
-
const [completedTaskId, setCompletedTaskId] = (0,
|
|
1470
|
-
const [cardText, setCardText] = (0,
|
|
1471
|
-
const [downloadNote, setDownloadNote] = (0,
|
|
1529
|
+
const [phase, setPhase] = (0, import_react5.useState)("prepare");
|
|
1530
|
+
const [runtime, setRuntime] = (0, import_react5.useState)(EMPTY_RUNTIME);
|
|
1531
|
+
const [completedTaskId, setCompletedTaskId] = (0, import_react5.useState)();
|
|
1532
|
+
const [cardText, setCardText] = (0, import_react5.useState)(null);
|
|
1533
|
+
const [downloadNote, setDownloadNote] = (0, import_react5.useState)();
|
|
1472
1534
|
useWorkbenchReveal(props.reveal, props);
|
|
1473
|
-
(0,
|
|
1535
|
+
(0, import_react5.useInsertionEffect)(() => {
|
|
1474
1536
|
if (!props.visible) return;
|
|
1475
1537
|
return installStyles();
|
|
1476
1538
|
}, [props.visible]);
|
|
1477
|
-
(0,
|
|
1539
|
+
(0, import_react5.useEffect)(() => {
|
|
1478
1540
|
const face = props.ctx.sessions.binding?.(sessionId)?.session;
|
|
1479
1541
|
if (face === void 0) {
|
|
1480
1542
|
return;
|
|
@@ -1516,14 +1578,14 @@ function PrevisitWorkbenchTab(props) {
|
|
|
1516
1578
|
};
|
|
1517
1579
|
const status = deriveWorkbenchStatus(progressInput);
|
|
1518
1580
|
const phaseStates = derivePhaseStates(progressInput);
|
|
1519
|
-
const insights = (0,
|
|
1520
|
-
const reportHtml = (0,
|
|
1581
|
+
const insights = (0, import_react5.useMemo)(() => parseCardInsights(cardText), [cardText]);
|
|
1582
|
+
const reportHtml = (0, import_react5.useMemo)(() => {
|
|
1521
1583
|
if (cardText !== null) return buildPrevisitReportHtml(cardText);
|
|
1522
1584
|
if (status !== "ready" && task === void 0) return null;
|
|
1523
1585
|
const dom = extractCardFromDom();
|
|
1524
1586
|
return dom === null ? null : buildPrevisitReportFromRenderedHtml(dom.html, dom.text);
|
|
1525
1587
|
}, [cardText, status, phase, runtime.toolEvents.length]);
|
|
1526
|
-
(0,
|
|
1588
|
+
(0, import_react5.useEffect)(() => {
|
|
1527
1589
|
if (status !== "ready" && status !== "failed" || task === void 0 || completedTaskId === task.id) {
|
|
1528
1590
|
return;
|
|
1529
1591
|
}
|
|
@@ -1565,53 +1627,53 @@ function PrevisitWorkbenchTab(props) {
|
|
|
1565
1627
|
a.remove();
|
|
1566
1628
|
setTimeout(() => URL.revokeObjectURL(url), 0);
|
|
1567
1629
|
};
|
|
1568
|
-
if (!props.visible) return /* @__PURE__ */ (0,
|
|
1569
|
-
return /* @__PURE__ */ (0,
|
|
1570
|
-
/* @__PURE__ */ (0,
|
|
1571
|
-
/* @__PURE__ */ (0,
|
|
1572
|
-
/* @__PURE__ */ (0,
|
|
1573
|
-
/* @__PURE__ */ (0,
|
|
1574
|
-
/* @__PURE__ */ (0,
|
|
1575
|
-
/* @__PURE__ */ (0,
|
|
1576
|
-
/* @__PURE__ */ (0,
|
|
1630
|
+
if (!props.visible) return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_jsx_runtime4.Fragment, {});
|
|
1631
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("section", { className: "qccPwShell", "aria-label": "\u8BBF\u524D\u5C3D\u8C03\u5DE5\u4F5C\u53F0", "data-status": status, children: [
|
|
1632
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("header", { className: "qccPwHeader", children: [
|
|
1633
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "qccPwBrand", children: [
|
|
1634
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "qccPwBrandIcon", children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Icon, { name: "briefcase" }) }),
|
|
1635
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "qccPwBrandCopy", children: [
|
|
1636
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "qccPwTitleRow", children: [
|
|
1637
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("h1", { className: "qccPwTitle", children: "\u8BBF\u524D\u5C3D\u8C03\u5DE5\u4F5C\u53F0" }),
|
|
1638
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "qccPwLiveDot", "data-status": status })
|
|
1577
1639
|
] }),
|
|
1578
|
-
/* @__PURE__ */ (0,
|
|
1640
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("p", { className: "qccPwSubtitle", children: "\u4F01\u67E5\u67E5\u4E8B\u5B9E\u9A71\u52A8 \xB7 \u673A\u4F1A\u4E0E\u98CE\u9669\u53CC\u5F15\u64CE" })
|
|
1579
1641
|
] })
|
|
1580
1642
|
] }),
|
|
1581
|
-
/* @__PURE__ */ (0,
|
|
1582
|
-
/* @__PURE__ */ (0,
|
|
1583
|
-
/* @__PURE__ */ (0,
|
|
1643
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "qccPwMeta", children: [
|
|
1644
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "qccPwStatus", "data-status": status, children: STATUS_LABELS[status] }),
|
|
1645
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("span", { className: "qccPwSession", children: [
|
|
1584
1646
|
"\u5F53\u524D Session \xB7 ",
|
|
1585
1647
|
sessionId.slice(0, 12)
|
|
1586
1648
|
] })
|
|
1587
1649
|
] })
|
|
1588
1650
|
] }),
|
|
1589
|
-
/* @__PURE__ */ (0,
|
|
1651
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("nav", { className: "qccPwStages", "aria-label": "\u8BBF\u524D\u4EFB\u52A1\u9636\u6BB5", children: PREVISIT_PHASES.map((current) => {
|
|
1590
1652
|
const phaseState = phaseStates.find((item) => item.id === current);
|
|
1591
|
-
return /* @__PURE__ */ (0,
|
|
1592
|
-
/* @__PURE__ */ (0,
|
|
1593
|
-
/* @__PURE__ */ (0,
|
|
1594
|
-
/* @__PURE__ */ (0,
|
|
1595
|
-
/* @__PURE__ */ (0,
|
|
1653
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("button", { type: "button", className: "qccPwStage", "data-selected": phase === current, "data-progress": phaseState?.progress ?? "idle", onClick: () => setPhase(current), children: [
|
|
1654
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "qccPwStageIcon", children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Icon, { name: current }) }),
|
|
1655
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("span", { className: "qccPwStageCopy", children: [
|
|
1656
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("strong", { children: PHASE_LABELS[current].label }),
|
|
1657
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("small", { children: PHASE_LABELS[current].description })
|
|
1596
1658
|
] })
|
|
1597
1659
|
] }, current);
|
|
1598
1660
|
}) }),
|
|
1599
|
-
/* @__PURE__ */ (0,
|
|
1600
|
-
phase === "prepare" ? /* @__PURE__ */ (0,
|
|
1601
|
-
phase === "opportunity" ? /* @__PURE__ */ (0,
|
|
1602
|
-
phase === "risk" ? /* @__PURE__ */ (0,
|
|
1603
|
-
phase === "delivery" ? /* @__PURE__ */ (0,
|
|
1661
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "qccPwBody", children: [
|
|
1662
|
+
phase === "prepare" ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(SetupPanel, { sessionId, store: props.shared, task, start: (prompt) => props.startPrompt(sessionId, prompt), onStarted: () => setPhase("opportunity") }) : null,
|
|
1663
|
+
phase === "opportunity" ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(OpportunityPanel, { task, status, events: runtime.toolEvents, insights }) : null,
|
|
1664
|
+
phase === "risk" ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(RiskPanel, { task, status, events: runtime.toolEvents, insights }) : null,
|
|
1665
|
+
phase === "delivery" ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(DeliveryPanel, { task, status, toolCount: runtime.toolNames.length, failedToolCount: runtime.failedToolCount, cardCaptured: cardText !== null, reportHtml }) : null
|
|
1604
1666
|
] }),
|
|
1605
|
-
/* @__PURE__ */ (0,
|
|
1606
|
-
/* @__PURE__ */ (0,
|
|
1607
|
-
/* @__PURE__ */ (0,
|
|
1608
|
-
phase !== "prepare" && task !== void 0 ? /* @__PURE__ */ (0,
|
|
1609
|
-
phase === "delivery" ? /* @__PURE__ */ (0,
|
|
1667
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("footer", { className: "qccPwFooter", children: [
|
|
1668
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "qccPwFooterHint", "data-tone": downloadNote === void 0 ? void 0 : "error", children: downloadNote !== void 0 ? downloadNote : phase === "prepare" ? "" : "\u5DE5\u4F5C\u53F0\u7ED1\u5B9A\u5F53\u524D\u4F1A\u8BDD\uFF0C\u4F01\u4E1A\u4E8B\u5B9E\u4E0E\u5B8C\u6574\u62A5\u544A\u4FDD\u7559\u5728\u4F1A\u8BDD\u4E2D\u3002" }),
|
|
1669
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "qccPwFooterActions", children: [
|
|
1670
|
+
phase !== "prepare" && task !== void 0 ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("button", { type: "button", className: "qccPwSecondary", onClick: newTask, children: "\u65B0\u7684\u5C3D\u8C03" }) : null,
|
|
1671
|
+
phase === "delivery" ? /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("button", { type: "button", className: "qccPwPrimary", title: "\u4E0B\u8F7D\u4E3A HTML \u6587\u4EF6\uFF0C\u53EF\u76F4\u63A5\u6253\u5F00\u6216\u6253\u5370", onClick: downloadReport, children: [
|
|
1610
1672
|
"\u4E0B\u8F7D\u62A5\u544A",
|
|
1611
|
-
/* @__PURE__ */ (0,
|
|
1612
|
-
] }) : phase !== "prepare" ? /* @__PURE__ */ (0,
|
|
1673
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { children: "\u2193" })
|
|
1674
|
+
] }) : phase !== "prepare" ? /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("button", { type: "button", className: "qccPwPrimary", onClick: returnToConversation, children: [
|
|
1613
1675
|
"\u8FD4\u56DE\u4F1A\u8BDD",
|
|
1614
|
-
/* @__PURE__ */ (0,
|
|
1676
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { children: "\u2192" })
|
|
1615
1677
|
] }) : null
|
|
1616
1678
|
] })
|
|
1617
1679
|
] })
|
|
@@ -1640,10 +1702,20 @@ function apply(ctx) {
|
|
|
1640
1702
|
return baseline;
|
|
1641
1703
|
};
|
|
1642
1704
|
ctx.effect(
|
|
1643
|
-
() => registerWorkbenchTab(service, (props) => /* @__PURE__ */ (0,
|
|
1705
|
+
() => registerWorkbenchTab(service, (props) => /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(PrevisitWorkbenchTab, { ...props, ctx, shared, reveal, startPrompt })),
|
|
1644
1706
|
"dsh-pre-duediligence: hidden workbench tab"
|
|
1645
1707
|
);
|
|
1646
1708
|
registerLeftSidebarLauncher(ctx, service, reveal);
|
|
1709
|
+
ctx.slots.inject("conversation.input.dock", () => ctx.slots.register({
|
|
1710
|
+
name: "conversation.input.dock",
|
|
1711
|
+
id: "dsh-pre-duediligence:home",
|
|
1712
|
+
order: 110,
|
|
1713
|
+
inject: (sessionId) => ({
|
|
1714
|
+
openWorkbench: () => {
|
|
1715
|
+
openWorkbench(service, { sessionId }, reveal);
|
|
1716
|
+
}
|
|
1717
|
+
})
|
|
1718
|
+
}, PrevisitHome));
|
|
1647
1719
|
}
|
|
1648
1720
|
|
|
1649
1721
|
return module.exports;
|
package/lib/index.js
CHANGED
package/lib/index.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/index.ts", "../src/skill-file.ts"],
|
|
4
|
-
"sourcesContent": ["import { readFileSync } from \"node:fs\"\nimport { fileURLToPath } from \"node:url\"\n\nimport { parseSkillFile } from \"./skill-file.js\"\n\nexport const inject = [\"skills\"] as const\n\nexport const SKILL_NAME = \"qcc-previsit-onepager\"\nexport const SKILL_DESCRIPTION =\n \"\u8C03\u7528\u4F01\u67E5\u67E5\u4E94\u7C7B MCP \u6267\u884C\u4F01\u4E1A\u8BBF\u524D\u5C3D\u8C03\uFF0C\u4EE5\u673A\u4F1A\u4E0E\u98CE\u9669\u53CC\u5F15\u64CE\u8BC6\u522B\u7ECF\u8425\u72B6\u6001\u3001\u5EFA\u7ACB\u5E76\u53CD\u8BC1\u4E1A\u52A1\u5047\u8BBE\uFF0C\u4EA4\u4ED8\u53EF\u8FFD\u6EAF\u7684\u8BBF\u524D\u5C3D\u8C03\u62A5\u544A\u3002\"\n\ntype SkillRegistration = {\n name: string\n description: string\n whenToUse: string\n content: string\n source: \"bundled\"\n resourceBase: {\n kind: \"directory\"\n path: string\n }\n metadata: Readonly<Record<string, unknown>>\n}\n\nexport type HostContext = {\n skills: {\n register(skill: SkillRegistration): () => void\n }\n}\n\nexport function loadBundledSkill(): SkillRegistration {\n const skillDirectoryUrl = new URL(\"../skills/qcc-previsit-onepager/\", import.meta.url)\n const skillSource = readFileSync(new URL(\"SKILL.md\", skillDirectoryUrl), \"utf8\")\n const { content } = parseSkillFile(skillSource)\n\n return {\n name: SKILL_NAME,\n description: SKILL_DESCRIPTION,\n whenToUse: \"\u7528\u6237\u8981\u6C42\u51C6\u5907\u5BA2\u6237\u62DC\u8BBF\u3001\u8BBF\u524D\u5C3D\u8C03\u3001\u4E00\u9875\u7EB8\u7B80\u62A5\u3001\u6388\u4FE1\u9762\u8C08\u3001\u5546\u52A1\u8C08\u5224\u3001\u7B7E\u7EA6\u6838\u67E5\u3001\u590D\u8BBF\u66F4\u65B0\u3001\u89E6\u8FBE\u8DEF\u5F84\u6216\u5F53\u9762\u63D0\u95EE\u6E05\u5355\u65F6\u4F7F\u7528\u3002\",\n content,\n source: \"bundled\",\n resourceBase: {\n kind: \"directory\",\n path: fileURLToPath(skillDirectoryUrl),\n },\n metadata: {\n author: \"QCC\",\n version: \"0.1.
|
|
4
|
+
"sourcesContent": ["import { readFileSync } from \"node:fs\"\nimport { fileURLToPath } from \"node:url\"\n\nimport { parseSkillFile } from \"./skill-file.js\"\n\nexport const inject = [\"skills\"] as const\n\nexport const SKILL_NAME = \"qcc-previsit-onepager\"\nexport const SKILL_DESCRIPTION =\n \"\u8C03\u7528\u4F01\u67E5\u67E5\u4E94\u7C7B MCP \u6267\u884C\u4F01\u4E1A\u8BBF\u524D\u5C3D\u8C03\uFF0C\u4EE5\u673A\u4F1A\u4E0E\u98CE\u9669\u53CC\u5F15\u64CE\u8BC6\u522B\u7ECF\u8425\u72B6\u6001\u3001\u5EFA\u7ACB\u5E76\u53CD\u8BC1\u4E1A\u52A1\u5047\u8BBE\uFF0C\u4EA4\u4ED8\u53EF\u8FFD\u6EAF\u7684\u8BBF\u524D\u5C3D\u8C03\u62A5\u544A\u3002\"\n\ntype SkillRegistration = {\n name: string\n description: string\n whenToUse: string\n content: string\n source: \"bundled\"\n resourceBase: {\n kind: \"directory\"\n path: string\n }\n metadata: Readonly<Record<string, unknown>>\n}\n\nexport type HostContext = {\n skills: {\n register(skill: SkillRegistration): () => void\n }\n}\n\nexport function loadBundledSkill(): SkillRegistration {\n const skillDirectoryUrl = new URL(\"../skills/qcc-previsit-onepager/\", import.meta.url)\n const skillSource = readFileSync(new URL(\"SKILL.md\", skillDirectoryUrl), \"utf8\")\n const { content } = parseSkillFile(skillSource)\n\n return {\n name: SKILL_NAME,\n description: SKILL_DESCRIPTION,\n whenToUse: \"\u7528\u6237\u8981\u6C42\u51C6\u5907\u5BA2\u6237\u62DC\u8BBF\u3001\u8BBF\u524D\u5C3D\u8C03\u3001\u4E00\u9875\u7EB8\u7B80\u62A5\u3001\u6388\u4FE1\u9762\u8C08\u3001\u5546\u52A1\u8C08\u5224\u3001\u7B7E\u7EA6\u6838\u67E5\u3001\u590D\u8BBF\u66F4\u65B0\u3001\u89E6\u8FBE\u8DEF\u5F84\u6216\u5F53\u9762\u63D0\u95EE\u6E05\u5355\u65F6\u4F7F\u7528\u3002\",\n content,\n source: \"bundled\",\n resourceBase: {\n kind: \"directory\",\n path: fileURLToPath(skillDirectoryUrl),\n },\n metadata: {\n author: \"QCC\",\n version: \"0.1.4\",\n industry: \"enterprise-services\",\n mcpServers: [\"qcc-company\", \"qcc-risk\", \"qcc-ipr\", \"qcc-operation\", \"qcc-executive\"],\n },\n }\n}\n\nexport function apply(ctx: HostContext): void {\n ctx.skills.register(loadBundledSkill())\n}\n", "export type ParsedSkillFile = {\n content: string\n frontmatter: string | null\n}\n\nexport function parseSkillFile(source: string): ParsedSkillFile {\n const normalized = source.replaceAll(\"\\r\\n\", \"\\n\")\n\n if (!normalized.startsWith(\"---\\n\")) {\n return { content: normalized.trim(), frontmatter: null }\n }\n\n const closingMarker = normalized.indexOf(\"\\n---\\n\", 4)\n\n if (closingMarker === -1) {\n throw new Error(\"SKILL.md \u7684 YAML frontmatter \u7F3A\u5C11\u7ED3\u675F\u6807\u8BB0\")\n }\n\n return {\n frontmatter: normalized.slice(4, closingMarker).trim(),\n content: normalized.slice(closingMarker + 5).trim(),\n }\n}\n"],
|
|
5
5
|
"mappings": ";AAAA,SAAS,oBAAoB;AAC7B,SAAS,qBAAqB;;;ACIvB,SAAS,eAAe,QAAiC;AAC9D,QAAM,aAAa,OAAO,WAAW,QAAQ,IAAI;AAEjD,MAAI,CAAC,WAAW,WAAW,OAAO,GAAG;AACnC,WAAO,EAAE,SAAS,WAAW,KAAK,GAAG,aAAa,KAAK;AAAA,EACzD;AAEA,QAAM,gBAAgB,WAAW,QAAQ,WAAW,CAAC;AAErD,MAAI,kBAAkB,IAAI;AACxB,UAAM,IAAI,MAAM,uEAAoC;AAAA,EACtD;AAEA,SAAO;AAAA,IACL,aAAa,WAAW,MAAM,GAAG,aAAa,EAAE,KAAK;AAAA,IACrD,SAAS,WAAW,MAAM,gBAAgB,CAAC,EAAE,KAAK;AAAA,EACpD;AACF;;;ADjBO,IAAM,SAAS,CAAC,QAAQ;AAExB,IAAM,aAAa;AACnB,IAAM,oBACX;AAqBK,SAAS,mBAAsC;AACpD,QAAM,oBAAoB,IAAI,IAAI,oCAAoC,YAAY,GAAG;AACrF,QAAM,cAAc,aAAa,IAAI,IAAI,YAAY,iBAAiB,GAAG,MAAM;AAC/E,QAAM,EAAE,QAAQ,IAAI,eAAe,WAAW;AAE9C,SAAO;AAAA,IACL,MAAM;AAAA,IACN,aAAa;AAAA,IACb,WAAW;AAAA,IACX;AAAA,IACA,QAAQ;AAAA,IACR,cAAc;AAAA,MACZ,MAAM;AAAA,MACN,MAAM,cAAc,iBAAiB;AAAA,IACvC;AAAA,IACA,UAAU;AAAA,MACR,QAAQ;AAAA,MACR,SAAS;AAAA,MACT,UAAU;AAAA,MACV,YAAY,CAAC,eAAe,YAAY,WAAW,iBAAiB,eAAe;AAAA,IACrF;AAAA,EACF;AACF;AAEO,SAAS,MAAM,KAAwB;AAC5C,MAAI,OAAO,SAAS,iBAAiB,CAAC;AACxC;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -5,18 +5,19 @@ type SnapshotStore<T> = {
|
|
|
5
5
|
type WorkspaceSnapshot = {
|
|
6
6
|
items?: Array<{
|
|
7
7
|
workspaceId: string;
|
|
8
|
+
path?: string;
|
|
8
9
|
sessionIds?: string[];
|
|
9
10
|
}>;
|
|
10
11
|
recentWorkspaceId?: string;
|
|
11
12
|
};
|
|
12
13
|
type SlotsService = {
|
|
13
14
|
inject(name: string, setup: () => void | (() => void)): unknown;
|
|
14
|
-
register(descriptor: {
|
|
15
|
+
register<Props extends object>(descriptor: {
|
|
15
16
|
name: string;
|
|
16
17
|
id: string;
|
|
17
18
|
order?: number;
|
|
18
|
-
inject?: () => Record<string, unknown>;
|
|
19
|
-
}, component: (props:
|
|
19
|
+
inject?: (sessionId: string) => Record<string, unknown>;
|
|
20
|
+
}, component: (props: Props) => JSX.Element | null): () => void;
|
|
20
21
|
};
|
|
21
22
|
export type LeftSidebarHost = {
|
|
22
23
|
slots: SlotsService;
|
|
@@ -25,7 +26,7 @@ export type LeftSidebarHost = {
|
|
|
25
26
|
current?: string;
|
|
26
27
|
}>;
|
|
27
28
|
create?(options: {
|
|
28
|
-
|
|
29
|
+
cwd: string;
|
|
29
30
|
sessionId: string;
|
|
30
31
|
}): Promise<string>;
|
|
31
32
|
open?(sessionId: string): void;
|
|
@@ -36,9 +37,5 @@ export type LeftSidebarHost = {
|
|
|
36
37
|
};
|
|
37
38
|
get?(name: string): unknown;
|
|
38
39
|
};
|
|
39
|
-
type LeftSidebarEntryProps = {
|
|
40
|
-
wide?: boolean;
|
|
41
|
-
openAgent?: () => Promise<void>;
|
|
42
|
-
};
|
|
43
40
|
export declare function registerLeftSidebarLauncher(ctx: LeftSidebarHost, service: BetterSidebarService, reveal: RevealController): void;
|
|
44
41
|
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export type PrevisitHomeProps = {
|
|
2
|
+
sessionId: string;
|
|
3
|
+
useSession<T>(selector: (state: {
|
|
4
|
+
composerPhase: string;
|
|
5
|
+
}) => T): T;
|
|
6
|
+
openWorkbench?: () => void;
|
|
7
|
+
};
|
|
8
|
+
/** Local, reversible title bridge. No global locale mutation or observer. */
|
|
9
|
+
export declare function setPrevisitHeadline(anchor: HTMLElement): () => void;
|
|
10
|
+
export declare function PrevisitHome({ sessionId, useSession, openWorkbench }: PrevisitHomeProps): JSX.Element | null;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export declare const PREVISIT_SESSION_ID_PREFIX = "session-dsh-pre-duediligence-";
|
|
2
|
+
export declare function isPrevisitSession(sessionId: string): boolean;
|
|
3
|
+
export type PrevisitSessionHost = {
|
|
4
|
+
sessions: {
|
|
5
|
+
list?: {
|
|
6
|
+
getSnapshot(): {
|
|
7
|
+
current?: string;
|
|
8
|
+
};
|
|
9
|
+
};
|
|
10
|
+
create?(options: {
|
|
11
|
+
cwd: string;
|
|
12
|
+
sessionId: string;
|
|
13
|
+
}): Promise<string>;
|
|
14
|
+
open?(sessionId: string): void;
|
|
15
|
+
};
|
|
16
|
+
workspaces?: {
|
|
17
|
+
list?: {
|
|
18
|
+
getSnapshot(): {
|
|
19
|
+
items?: Array<{
|
|
20
|
+
workspaceId: string;
|
|
21
|
+
path?: string;
|
|
22
|
+
sessionIds?: string[];
|
|
23
|
+
}>;
|
|
24
|
+
recentWorkspaceId?: string;
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
export declare function createPrevisitSession(ctx: PrevisitSessionHost): Promise<string>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-pre-duediligence",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.4",
|
|
4
4
|
"description": "Session 级 DeepSeek Harness 访前尽调工作台,使用企查查 MCP 生成可追溯的访前尽调报告。",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -35,6 +35,7 @@
|
|
|
35
35
|
"install.sh",
|
|
36
36
|
"cordis.patch.yml",
|
|
37
37
|
"README.md",
|
|
38
|
+
"CHANGELOG.md",
|
|
38
39
|
"THIRD_PARTY_NOTICES.md",
|
|
39
40
|
"LICENSE"
|
|
40
41
|
],
|