vite-plugin-aipanel 1.3.1 → 1.3.3
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.
|
@@ -20,4 +20,12 @@ export declare const SANITIZE_PLACEHOLDERS: readonly ["__undefined__", "[Functio
|
|
|
20
20
|
export declare function sanitizeValue(value: unknown, depth?: number): unknown;
|
|
21
21
|
/** 裁剪 InspectorState[],去掉 Vue 内部数据和噪音类型 */
|
|
22
22
|
export declare function sanitizeState(state: InspectorState[]): Record<string, unknown>;
|
|
23
|
+
/**
|
|
24
|
+
* JSON 序列化:函数/符号/bigint/undefined 换成可读占位,并处理循环引用。
|
|
25
|
+
*
|
|
26
|
+
* 判环用**当前路径上的祖先链**,而不是"见过的所有对象":
|
|
27
|
+
* 同一对象被多处引用是合法结构(DAG)——例如路由记录会被顶层数组与嵌套 children 同时引用
|
|
28
|
+
* (实测 `routes[0].meta === routes[6].children[0].meta` 且不是环)。seen-anywhere 会把它误标成
|
|
29
|
+
* `[Circular Reference]`,agent 读到假值、还以为数据真有环。真环仍标该占位;共享对象**重复输出**而不是被吞掉。
|
|
30
|
+
*/
|
|
23
31
|
export declare function safeStringify(obj: unknown): string;
|
|
@@ -79,11 +79,13 @@ function sanitizeState(state) {
|
|
|
79
79
|
return result;
|
|
80
80
|
}
|
|
81
81
|
function safeStringify(obj) {
|
|
82
|
-
const
|
|
83
|
-
return JSON.stringify(obj, (_key, value)
|
|
82
|
+
const ancestors = [];
|
|
83
|
+
return JSON.stringify(obj, function replacer(_key, value) {
|
|
84
84
|
if (typeof value === "object" && value !== null) {
|
|
85
|
-
|
|
86
|
-
|
|
85
|
+
while (ancestors.length > 0 && ancestors[ancestors.length - 1] !== this) ancestors.pop();
|
|
86
|
+
if (ancestors.includes(value)) return "[Circular Reference]";
|
|
87
|
+
ancestors.push(value);
|
|
88
|
+
return value;
|
|
87
89
|
}
|
|
88
90
|
if (typeof value === "function") return "[Function]";
|
|
89
91
|
if (typeof value === "symbol") return value.toString();
|
|
@@ -105,11 +105,13 @@ function sanitizeState(state) {
|
|
|
105
105
|
return result;
|
|
106
106
|
}
|
|
107
107
|
function safeStringify(obj) {
|
|
108
|
-
const
|
|
109
|
-
return JSON.stringify(obj, (_key, value)
|
|
108
|
+
const ancestors = [];
|
|
109
|
+
return JSON.stringify(obj, function replacer(_key, value) {
|
|
110
110
|
if (typeof value === "object" && value !== null) {
|
|
111
|
-
|
|
112
|
-
|
|
111
|
+
while (ancestors.length > 0 && ancestors[ancestors.length - 1] !== this) ancestors.pop();
|
|
112
|
+
if (ancestors.includes(value)) return "[Circular Reference]";
|
|
113
|
+
ancestors.push(value);
|
|
114
|
+
return value;
|
|
113
115
|
}
|
|
114
116
|
if (typeof value === "function") return "[Function]";
|
|
115
117
|
if (typeof value === "symbol") return value.toString();
|
|
@@ -20,4 +20,12 @@ export declare const SANITIZE_PLACEHOLDERS: readonly ["__undefined__", "[Functio
|
|
|
20
20
|
export declare function sanitizeValue(value: unknown, depth?: number): unknown;
|
|
21
21
|
/** 裁剪 InspectorState[],去掉 Vue 内部数据和噪音类型 */
|
|
22
22
|
export declare function sanitizeState(state: InspectorState[]): Record<string, unknown>;
|
|
23
|
+
/**
|
|
24
|
+
* JSON 序列化:函数/符号/bigint/undefined 换成可读占位,并处理循环引用。
|
|
25
|
+
*
|
|
26
|
+
* 判环用**当前路径上的祖先链**,而不是"见过的所有对象":
|
|
27
|
+
* 同一对象被多处引用是合法结构(DAG)——例如路由记录会被顶层数组与嵌套 children 同时引用
|
|
28
|
+
* (实测 `routes[0].meta === routes[6].children[0].meta` 且不是环)。seen-anywhere 会把它误标成
|
|
29
|
+
* `[Circular Reference]`,agent 读到假值、还以为数据真有环。真环仍标该占位;共享对象**重复输出**而不是被吞掉。
|
|
30
|
+
*/
|
|
23
31
|
export declare function safeStringify(obj: unknown): string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vite-plugin-aipanel",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.3",
|
|
4
4
|
"description": "Embed OpenCode Web UI in your Vite dev server for real-time code modification and preview",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "lib/index.cjs",
|
|
@@ -35,8 +35,8 @@
|
|
|
35
35
|
"author": "",
|
|
36
36
|
"license": "MIT",
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@aipanel/core": "1.3.
|
|
39
|
-
"@aipanel/provider-opencode": "1.3.
|
|
38
|
+
"@aipanel/core": "1.3.3",
|
|
39
|
+
"@aipanel/provider-opencode": "1.3.3",
|
|
40
40
|
"@code-inspector/core": "^2.0.9",
|
|
41
41
|
"@vue/devtools-kit": "^8.0.0",
|
|
42
42
|
"@vue/language-server": "^3.3.7",
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"unplugin-vue-inspector": "^3.0.0"
|
|
48
48
|
},
|
|
49
49
|
"peerDependencies": {
|
|
50
|
-
"@aipanel/provider-deepseek": "1.3.
|
|
50
|
+
"@aipanel/provider-deepseek": "1.3.3",
|
|
51
51
|
"vite": ">=5.0.0"
|
|
52
52
|
},
|
|
53
53
|
"peerDependenciesMeta": {
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
}
|
|
57
57
|
},
|
|
58
58
|
"devDependencies": {
|
|
59
|
-
"@aipanel/client": "1.3.
|
|
59
|
+
"@aipanel/client": "1.3.3",
|
|
60
60
|
"@types/picomatch": "^4.0.0",
|
|
61
61
|
"sharp": "^0.34.5"
|
|
62
62
|
},
|