@aipanel/dsh-plugin 1.3.8 → 1.3.10
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/dist/index.js +39 -19
- package/package.json +11 -11
package/dist/index.js
CHANGED
|
@@ -7,6 +7,8 @@ import { randomUUID } from "node:crypto";
|
|
|
7
7
|
var LOG_PREFIX = "[vite-plugin-aipanel]";
|
|
8
8
|
var CONTEXT_API_PATH = "/__aipanel_context__";
|
|
9
9
|
var HOST_EVENTS_API_PATH = "/__aipanel_host_events__";
|
|
10
|
+
var DEPENDENCY_DIR_NAME = "node_modules";
|
|
11
|
+
var DEPENDENCY_SOURCE_NOTE = `\u4F9D\u8D56\u5305\u5185\u6587\u4EF6\uFF08${DEPENDENCY_DIR_NAME}\uFF09\uFF1A\u901A\u5E38\u4E0D\u5E94\u76F4\u63A5\u4FEE\u6539\uFF0C\u9875\u9762\u884C\u4E3A\u8BF7\u6539\u9879\u76EE\u5185\u6E90\u7801`;
|
|
10
12
|
var EXT_BROADCAST = {
|
|
11
13
|
PAGE_CONTEXT: "PAGE_CONTEXT",
|
|
12
14
|
THEME_CHANGE: "THEME_CHANGE",
|
|
@@ -20,6 +22,8 @@ var EXT_MSG = {
|
|
|
20
22
|
REQUEST_PAGE_CONTEXT: "REQUEST_PAGE_CONTEXT",
|
|
21
23
|
SELECTION_START: "SELECTION_START",
|
|
22
24
|
SELECTION_STOP: "SELECTION_STOP",
|
|
25
|
+
/** Side Panel → 目标 Tab:请目标页定位某个已选节点(跳回其页面并呼吸高亮) */
|
|
26
|
+
LOCATE_NODE: "LOCATE_NODE",
|
|
23
27
|
CS_QUERY_WINDOW: "__CS_QUERY_WINDOW__",
|
|
24
28
|
/** Side Panel → Background:立即轮询一次并回传当前服务信息 */
|
|
25
29
|
FORCE_POLL: "FORCE_POLL"
|
|
@@ -39,6 +43,35 @@ var VUE_DEVTOOLS_TIMELINE_INCLUDES = [
|
|
|
39
43
|
var DEFAULT_TIMELINE_INCLUDE = VUE_DEVTOOLS_TIMELINE_INCLUDE.SLOW;
|
|
40
44
|
var MUTATING_TOOLS = /* @__PURE__ */ new Set(["write", "edit", "apply_patch"]);
|
|
41
45
|
|
|
46
|
+
// ../../core/es/common/utils.mjs
|
|
47
|
+
function normalizePathSeparators(filePath) {
|
|
48
|
+
return filePath.replace(/\\/g, "/");
|
|
49
|
+
}
|
|
50
|
+
function fileNameOf(filePath) {
|
|
51
|
+
const normalized = normalizePathSeparators(filePath);
|
|
52
|
+
return normalized.slice(normalized.lastIndexOf("/") + 1);
|
|
53
|
+
}
|
|
54
|
+
function isDependencyPath(filePath) {
|
|
55
|
+
return normalizePathSeparators(filePath).split("/").includes(DEPENDENCY_DIR_NAME);
|
|
56
|
+
}
|
|
57
|
+
function formatSourceLocation(filePath, line, column) {
|
|
58
|
+
if (!line) return filePath;
|
|
59
|
+
return column ? `${filePath}:${line}:${column}` : `${filePath}:${line}`;
|
|
60
|
+
}
|
|
61
|
+
var NODE_MENTION_RE = /@节点\[(n[0-9a-z]+)\]/g;
|
|
62
|
+
function parseNodeMentions(text) {
|
|
63
|
+
const out = [];
|
|
64
|
+
const seen = /* @__PURE__ */ new Set();
|
|
65
|
+
for (const m of text.matchAll(NODE_MENTION_RE)) {
|
|
66
|
+
const id = m[1];
|
|
67
|
+
if (!seen.has(id)) {
|
|
68
|
+
seen.add(id);
|
|
69
|
+
out.push(id);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
return out;
|
|
73
|
+
}
|
|
74
|
+
|
|
42
75
|
// ../../core/es/common/diagnostics.mjs
|
|
43
76
|
var COMMAND_CHECK_TIMEOUT_MS = 6e4;
|
|
44
77
|
var SOURCE_EXTENSIONS = [
|
|
@@ -54,7 +87,7 @@ var SOURCE_EXTENSIONS = [
|
|
|
54
87
|
];
|
|
55
88
|
function matchesExtensions(filePath, extensions) {
|
|
56
89
|
if (!extensions?.length) return true;
|
|
57
|
-
const base = filePath
|
|
90
|
+
const base = fileNameOf(filePath);
|
|
58
91
|
const dot = base.lastIndexOf(".");
|
|
59
92
|
if (dot <= 0) return false;
|
|
60
93
|
return extensions.includes(base.slice(dot).toLowerCase());
|
|
@@ -398,7 +431,7 @@ function getCallerInfo(depth = 3) {
|
|
|
398
431
|
const match = targetLine.match(/at\s+(?:(.+?)\s+\()?(.+?):(\d+):(\d+)\)?/);
|
|
399
432
|
if (!match) return "";
|
|
400
433
|
const [, funcName, filePath, line] = match;
|
|
401
|
-
const fileName = filePath
|
|
434
|
+
const fileName = fileNameOf(filePath) || filePath;
|
|
402
435
|
const func = funcName || "<anonymous>";
|
|
403
436
|
return `${fileName}:${line} ${func}`;
|
|
404
437
|
}
|
|
@@ -1425,21 +1458,6 @@ ${body}` : body);
|
|
|
1425
1458
|
return blocks.join("\n\n");
|
|
1426
1459
|
}
|
|
1427
1460
|
|
|
1428
|
-
// ../../core/es/common/utils.mjs
|
|
1429
|
-
var NODE_MENTION_RE = /@节点\[(n[0-9a-z]+)\]/g;
|
|
1430
|
-
function parseNodeMentions(text) {
|
|
1431
|
-
const out = [];
|
|
1432
|
-
const seen = /* @__PURE__ */ new Set();
|
|
1433
|
-
for (const m of text.matchAll(NODE_MENTION_RE)) {
|
|
1434
|
-
const id = m[1];
|
|
1435
|
-
if (!seen.has(id)) {
|
|
1436
|
-
seen.add(id);
|
|
1437
|
-
out.push(id);
|
|
1438
|
-
}
|
|
1439
|
-
}
|
|
1440
|
-
return out;
|
|
1441
|
-
}
|
|
1442
|
-
|
|
1443
1461
|
// dsh-plugin/src/events-relay.ts
|
|
1444
1462
|
var log3 = createNodeLogger("DshEventRelay");
|
|
1445
1463
|
var FLUSH_DELAY_MS = 120;
|
|
@@ -1662,8 +1680,10 @@ var inject = ["tools"];
|
|
|
1662
1680
|
var log4 = createNodeLogger("DshPlugin");
|
|
1663
1681
|
function buildNodeContext(e) {
|
|
1664
1682
|
const lines = [`\u8282\u70B9 ID\uFF1A${e.id ?? ""}`];
|
|
1665
|
-
|
|
1666
|
-
|
|
1683
|
+
if (e.filePath) {
|
|
1684
|
+
lines.push(`\u6E90\u7801\u6587\u4EF6\u8DEF\u5F84\uFF1A${formatSourceLocation(e.filePath, e.line, e.column)}`);
|
|
1685
|
+
if (isDependencyPath(e.filePath)) lines.push(`\u6E90\u7801\u5F52\u5C5E\uFF1A${DEPENDENCY_SOURCE_NOTE}`);
|
|
1686
|
+
}
|
|
1667
1687
|
if (e.description) lines.push(`DOM \u5143\u7D20\u9009\u62E9\u5668\uFF1A${e.description}`);
|
|
1668
1688
|
if (e.innerText) {
|
|
1669
1689
|
const text = e.innerText.slice(0, 20).replace(/\r?\n/g, "\\n");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aipanel/dsh-plugin",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.10",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "AIPanel for DeepSeek Harness (dsh):注入审查工具 run_diagnostics、编辑后自动诊断。",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -16,17 +16,17 @@
|
|
|
16
16
|
"vue-tsc": "^3.3.9"
|
|
17
17
|
},
|
|
18
18
|
"devDependencies": {
|
|
19
|
-
"@aipanel/core": "1.3.
|
|
19
|
+
"@aipanel/core": "1.3.10",
|
|
20
20
|
"@deepseek-ai/cordis": "~4.0.4",
|
|
21
|
-
"@deepseek-ai/dsh-agent": "^0.
|
|
22
|
-
"@deepseek-ai/dsh-llm": "^0.
|
|
23
|
-
"@deepseek-ai/dsh-session": "^0.
|
|
24
|
-
"@deepseek-ai/dsh-session-title": "^0.
|
|
25
|
-
"@deepseek-ai/dsh-settings": "^0.
|
|
26
|
-
"@deepseek-ai/dsh-tools": "^0.
|
|
27
|
-
"@deepseek-ai/dsh-user-approval": "^0.
|
|
28
|
-
"@deepseek-ai/dsh-user-questions": "^0.
|
|
29
|
-
"@deepseek-ai/dsh-util-values": "^0.
|
|
21
|
+
"@deepseek-ai/dsh-agent": "^0.2.0-rc.1",
|
|
22
|
+
"@deepseek-ai/dsh-llm": "^0.2.0-rc.1",
|
|
23
|
+
"@deepseek-ai/dsh-session": "^0.2.0-rc.1",
|
|
24
|
+
"@deepseek-ai/dsh-session-title": "^0.2.0-rc.1",
|
|
25
|
+
"@deepseek-ai/dsh-settings": "^0.2.0-rc.1",
|
|
26
|
+
"@deepseek-ai/dsh-tools": "^0.2.0-rc.1",
|
|
27
|
+
"@deepseek-ai/dsh-user-approval": "^0.2.0-rc.1",
|
|
28
|
+
"@deepseek-ai/dsh-user-questions": "^0.2.0-rc.1",
|
|
29
|
+
"@deepseek-ai/dsh-util-values": "^0.2.0-rc.1",
|
|
30
30
|
"esbuild": "^0.25.0"
|
|
31
31
|
},
|
|
32
32
|
"scripts": {
|