dsh-pre-duediligence 0.1.1 → 0.1.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.md +4 -4
- package/install.sh +1 -1
- package/lib/client.js +12 -7
- package/lib/index.js +1 -1
- package/lib/index.js.map +1 -1
- package/lib/types/left-sidebar.d.ts +1 -0
- package/package.json +1 -1
- package/skills/qcc-previsit-onepager/SKILL.md +1 -1
package/README.md
CHANGED
|
@@ -55,7 +55,7 @@ bash <(curl -fsSL https://raw.githubusercontent.com/duhu2000/dsh-pre-duediligenc
|
|
|
55
55
|
|
|
56
56
|
1. `dsh-better-sidebar@0.17.1`:提供 Session 级右侧工作台容器。
|
|
57
57
|
2. `dsh-mcp-connector@0.2.32`:提供通用 MCP 连接器与市场,通过“企查查·企业工商”完成 OAuth,并动态挂载企业、风险、知产、经营、历史和董监高 MCP。
|
|
58
|
-
3. `dsh-pre-duediligence@0.1.
|
|
58
|
+
3. `dsh-pre-duediligence@0.1.2`:提供左侧智能体入口、访前工作台、点选拼句器和完整 Skill。
|
|
59
59
|
|
|
60
60
|
安装完成后停止旧的 DSH Web 进程并重新运行:
|
|
61
61
|
|
|
@@ -70,7 +70,7 @@ dsh web
|
|
|
70
70
|
~~~bash
|
|
71
71
|
dsh plugin --profile web add dsh-better-sidebar@0.17.1 --allow-build=node-pty
|
|
72
72
|
dsh plugin --profile web add dsh-mcp-connector@0.2.32
|
|
73
|
-
dsh plugin --profile web add dsh-pre-duediligence@0.1.
|
|
73
|
+
dsh plugin --profile web add dsh-pre-duediligence@0.1.2 --allow-build=dsh-pre-duediligence
|
|
74
74
|
dsh web
|
|
75
75
|
~~~
|
|
76
76
|
|
|
@@ -84,7 +84,7 @@ Better Sidebar 必须使用 `0.17.1`;工作台依赖它的 `targetedOpen` 与
|
|
|
84
84
|
dsh plugin --profile web list --depth 0
|
|
85
85
|
~~~
|
|
86
86
|
|
|
87
|
-
应能看到 `dsh-better-sidebar@0.17.1`、`dsh-mcp-connector@0.2.32` 和 `dsh-pre-duediligence@0.1.
|
|
87
|
+
应能看到 `dsh-better-sidebar@0.17.1`、`dsh-mcp-connector@0.2.32` 和 `dsh-pre-duediligence@0.1.2`。重启 DSH 并连接“企查查·企业工商”后,在左侧菜单点击“访前尽调智能体”打开工作台;Better Sidebar 的右侧“+”菜单不会再列出该入口。点击前 DSH 首页、输入框、消息流和 Session 头部均保持原样。
|
|
88
88
|
|
|
89
89
|
### 从旧访前尽调包迁移
|
|
90
90
|
|
|
@@ -100,7 +100,7 @@ dsh plugin --profile web remove qcc-previsit-dsh
|
|
|
100
100
|
|
|
101
101
|
如果 Web profile 已安装 `qcc-dsh-mcp-oauth`,不要让它与 MCP 连接器同时管理同名企查查 Server:
|
|
102
102
|
|
|
103
|
-
1. 先安装 `dsh-mcp-connector@0.2.32` 和 `dsh-pre-duediligence@0.1.
|
|
103
|
+
1. 先安装 `dsh-mcp-connector@0.2.32` 和 `dsh-pre-duediligence@0.1.2`,完全重启 DSH。
|
|
104
104
|
2. 打开“🧩 MCP连接器”,按界面提示迁移旧企查查授权;也可以重新连接“企查查·企业工商”。
|
|
105
105
|
3. 迁移完成后停止 DSH,执行 `dsh plugin --profile web remove qcc-dsh-mcp-oauth`。
|
|
106
106
|
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.2}"
|
|
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
|
@@ -820,19 +820,24 @@ function LeftSidebarEntry(props) {
|
|
|
820
820
|
mount
|
|
821
821
|
);
|
|
822
822
|
}
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
if (
|
|
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) {
|
|
826
831
|
const workspace = ctx.workspaces?.list?.getSnapshot();
|
|
827
832
|
const workspaceId = workspace?.recentWorkspaceId ?? workspace?.items?.[0]?.workspaceId;
|
|
828
833
|
if (workspaceId === void 0) {
|
|
829
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");
|
|
830
835
|
}
|
|
831
|
-
const
|
|
832
|
-
|
|
833
|
-
if (sessionId === void 0) {
|
|
836
|
+
const create = ctx.sessions.create;
|
|
837
|
+
if (typeof create !== "function") {
|
|
834
838
|
throw new Error("\u5F53\u524D DSH \u7248\u672C\u6CA1\u6709\u53EF\u7528\u7684\u4F1A\u8BDD\u521B\u5EFA\u80FD\u529B");
|
|
835
839
|
}
|
|
840
|
+
const sessionId = await create({ workspaceId, sessionId: createPrevisitSessionId() });
|
|
836
841
|
ctx.sessions.open?.(sessionId);
|
|
837
842
|
return sessionId;
|
|
838
843
|
}
|
|
@@ -843,7 +848,7 @@ function registerLeftSidebarLauncher(ctx, service, reveal) {
|
|
|
843
848
|
order: 20,
|
|
844
849
|
inject: () => ({
|
|
845
850
|
openAgent: async () => {
|
|
846
|
-
const sessionId = await resolveSessionId(ctx
|
|
851
|
+
const sessionId = await resolveSessionId(ctx);
|
|
847
852
|
if (!openWorkbench(service, { sessionId }, reveal)) {
|
|
848
853
|
throw new Error("\u8BBF\u524D\u5C3D\u8C03\u5DE5\u4F5C\u53F0\u5F53\u524D\u4E0D\u53EF\u7528\uFF0C\u8BF7\u68C0\u67E5\u63D2\u4EF6\u914D\u7F6E");
|
|
849
854
|
}
|
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.2\",\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
|
}
|
package/package.json
CHANGED