@yuku123/z-agent-component 0.1.4 → 0.1.6
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/ComponentDoc-C6MziAzI.js +562 -0
- package/dist/z-agent-component.js +2216 -2186
- package/dist/z-agent-pages.js +2334 -2533
- package/package.json +3 -3
- package/dist/echarts-BRUNUPov.js +0 -556
|
@@ -0,0 +1,562 @@
|
|
|
1
|
+
import { createRequest as _ } from "@yuku123/z-frontend-common";
|
|
2
|
+
import * as J from "echarts/core";
|
|
3
|
+
import { BarChart as ce, LineChart as ge } from "echarts/charts";
|
|
4
|
+
import { GridComponent as ue, LegendComponent as de, TitleComponent as Te, TooltipComponent as me } from "echarts/components";
|
|
5
|
+
import { CanvasRenderer as fe } from "echarts/renderers";
|
|
6
|
+
import Ae from "echarts-for-react/lib/core";
|
|
7
|
+
import Ee from "react";
|
|
8
|
+
import { ComponentDoc as Pe } from "@yuku123/z-frontend-common/ui";
|
|
9
|
+
const H = _({ baseURL: "/api", timeout: 15e3 }), R = _({ baseURL: "/api", timeout: 15e3 }), C = _({ baseURL: "/api", timeout: 15e3 });
|
|
10
|
+
function L(n) {
|
|
11
|
+
const r = function(o, p = {}) {
|
|
12
|
+
const l = { ...p };
|
|
13
|
+
return l.body !== void 0 && (l.data = l.body, delete l.body), typeof l.method == "string" && (l.method = l.method.toUpperCase()), l.url = o, n.request(l);
|
|
14
|
+
};
|
|
15
|
+
return ["get", "post", "put", "delete", "patch", "head", "request", "create", "interceptors"].forEach((o) => {
|
|
16
|
+
typeof n[o] == "function" ? r[o] = n[o].bind(n) : r[o] = n[o];
|
|
17
|
+
}), r;
|
|
18
|
+
}
|
|
19
|
+
const Se = L(H);
|
|
20
|
+
L(R);
|
|
21
|
+
L(C);
|
|
22
|
+
function De({ apiBase: n } = {}) {
|
|
23
|
+
if (n !== void 0)
|
|
24
|
+
for (const r of [H, R, C])
|
|
25
|
+
r.defaults.baseURL = n;
|
|
26
|
+
}
|
|
27
|
+
const Y = { GET: "GET", DELETE: "DELETE" }, S = {};
|
|
28
|
+
function e(n, r, a, o, p) {
|
|
29
|
+
S[n] || (S[n] = {}), S[n][r] = { verb: a, path: o, transform: p };
|
|
30
|
+
}
|
|
31
|
+
function he(n, r) {
|
|
32
|
+
let a = 0;
|
|
33
|
+
return n.replace(/\{(\w+)\}/g, () => String(r[a++] ?? ""));
|
|
34
|
+
}
|
|
35
|
+
class Oe extends Error {
|
|
36
|
+
constructor(r, a, o) {
|
|
37
|
+
super(`[apiRouter] ${r}.${a}() 未注册路由(${o}):本次没有发出任何请求。若该端点本应存在,请先在 agent/api/routes.js 里 reg('${r}', '${a}', ...)。`), this.name = "ApiRouteError", this.__missing_route = !0, this.api = r, this.method = a;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
class be extends Error {
|
|
41
|
+
constructor(r, a, o) {
|
|
42
|
+
super(`[apiRouter] ${r}.${a}() 参数形状不对:${o}`), this.name = "ApiParamError", this.__param_shape = !0, this.api = r, this.method = a;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
function ve(n, r) {
|
|
46
|
+
return r.startsWith("/ctc/ac") || r.startsWith("/ctc/authorization") || r.startsWith("/ctc/surl") ? C : r.startsWith("/auth/") ? R : Se;
|
|
47
|
+
}
|
|
48
|
+
function xe(n) {
|
|
49
|
+
const r = { data: void 0, params: void 0 };
|
|
50
|
+
if (!n.length) return r;
|
|
51
|
+
const a = n[0];
|
|
52
|
+
if (a && typeof a == "object" && !Array.isArray(a) && ("data" in a || "params" in a) ? ("data" in a && (r.data = a.data), "params" in a && (r.params = a.params)) : r.data = a, n.length > 1) {
|
|
53
|
+
const o = n[1];
|
|
54
|
+
o && typeof o == "object" && !Array.isArray(o) && ("params" in o ? r.params = o.params : "data" in o ? r.data = o.data : r.params = o);
|
|
55
|
+
}
|
|
56
|
+
return r;
|
|
57
|
+
}
|
|
58
|
+
function ke(n, r, a, o) {
|
|
59
|
+
const p = {};
|
|
60
|
+
if (n === Y.GET || n === Y.DELETE) {
|
|
61
|
+
const s = r[0];
|
|
62
|
+
if (s != null) {
|
|
63
|
+
if (typeof s != "object" || Array.isArray(s))
|
|
64
|
+
throw new be(
|
|
65
|
+
a,
|
|
66
|
+
o,
|
|
67
|
+
`GET/DELETE 端点收到标量参数 ${JSON.stringify(s)},query 参数名未知,请改用 {params:{<参数名>: 值}}`
|
|
68
|
+
);
|
|
69
|
+
p.params = "params" in s ? s.params : s;
|
|
70
|
+
}
|
|
71
|
+
return p;
|
|
72
|
+
}
|
|
73
|
+
const { data: l, params: T } = xe(r);
|
|
74
|
+
return l !== void 0 && (p.data = l), T !== void 0 && (p.params = T), p;
|
|
75
|
+
}
|
|
76
|
+
function d(n) {
|
|
77
|
+
return new Proxy({}, {
|
|
78
|
+
get: (r, a) => {
|
|
79
|
+
if (!(a === "then" || typeof a == "symbol"))
|
|
80
|
+
return a === "toJSON" || a === "constructor" || a === "toString" ? () => `[apiRouter:${n}]` : async (...o) => {
|
|
81
|
+
var l, T;
|
|
82
|
+
const p = (l = S[n]) == null ? void 0 : l[a];
|
|
83
|
+
if (!p) {
|
|
84
|
+
const s = S[n] ? "方法名未注册" : "api key 未注册", m = new Oe(n, a, s);
|
|
85
|
+
throw console.error(m.message), m;
|
|
86
|
+
}
|
|
87
|
+
try {
|
|
88
|
+
const s = he(p.path, o), m = ve(p.verb, s), v = ke(p.verb, o, n, a), A = await m.request({
|
|
89
|
+
method: p.verb,
|
|
90
|
+
url: s,
|
|
91
|
+
...v
|
|
92
|
+
});
|
|
93
|
+
return p.transform ? p.transform(A, o) : A;
|
|
94
|
+
} catch (s) {
|
|
95
|
+
if (s && s.__missing_route) throw s;
|
|
96
|
+
if (s && s.__param_shape)
|
|
97
|
+
throw console.error(s.message), s;
|
|
98
|
+
s && typeof s == "object" && (s.__api_error = !0, s.__api = n, s.__api_method = a);
|
|
99
|
+
const m = (T = s == null ? void 0 : s.response) == null ? void 0 : T.status;
|
|
100
|
+
throw console.error(
|
|
101
|
+
`[apiRouter] ${n}.${a}() 请求失败${m ? `(HTTP ${m})` : ""}:${(s == null ? void 0 : s.message) || s}`
|
|
102
|
+
), s;
|
|
103
|
+
}
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
e("llmApi", "toolTemplateList", "GET", "/z-llm/config/tool-template/list");
|
|
109
|
+
e("mcpApi", "list", "GET", "/mcp/server/list");
|
|
110
|
+
e("mcpApi", "listTools", "POST", "/mcp/server/tools/list");
|
|
111
|
+
e("mcpApi", "callTool", "POST", "/mcp/server/tools/call");
|
|
112
|
+
e("ossApi", "listBuckets", "GET", "/v1/bucket");
|
|
113
|
+
e("ossApi", "getBucketStats", "GET", "/v1/bucket/stats");
|
|
114
|
+
e("ossApi", "createBucket", "POST", "/v1/bucket");
|
|
115
|
+
e("ossApi", "deleteBucket", "DELETE", "/v1/bucket");
|
|
116
|
+
e("ossApi", "setBucketAcl", "PUT", "/v1/bucket/acl");
|
|
117
|
+
e("ossApi", "listObjects", "GET", "/v1/object");
|
|
118
|
+
e("ossApi", "presignedUrl", "GET", "/v1/object/url");
|
|
119
|
+
e("ossApi", "uploadObject", "POST", "/v1/object");
|
|
120
|
+
e("ossApi", "downloadUrl", "GET", "/v1/object/url");
|
|
121
|
+
e("ossApi", "deleteObject", "DELETE", "/v1/object");
|
|
122
|
+
e("ossApi", "copyObject", "POST", "/v1/object/copy");
|
|
123
|
+
e("ossApi", "batchDelete", "POST", "/v1/object/batch-delete");
|
|
124
|
+
e("ossApi", "createFolder", "POST", "/v1/folder");
|
|
125
|
+
e("scriptApi", "list", "GET", "/script/list");
|
|
126
|
+
e("scriptApi", "create", "POST", "/script");
|
|
127
|
+
e("scriptApi", "update", "POST", "/script/update");
|
|
128
|
+
e("scriptApi", "delete", "POST", "/script/delete");
|
|
129
|
+
e("scriptApi", "publish", "POST", "/script/publish");
|
|
130
|
+
e("scriptApi", "unpublish", "POST", "/script/unpublish");
|
|
131
|
+
e("scriptApi", "run", "POST", "/script/run");
|
|
132
|
+
e("scriptApi", "importCurl", "POST", "/script/import-curl");
|
|
133
|
+
e("scriptApi", "importOpenApi", "POST", "/script/import-openapi");
|
|
134
|
+
e("scriptApi", "previewMapping", "POST", "/script/preview-mapping");
|
|
135
|
+
e("skillApi", "page", "POST", "/skill/page");
|
|
136
|
+
e("skillApi", "categoryTree", "GET", "/skill/category/tree");
|
|
137
|
+
e("skillApi", "create", "POST", "/skill");
|
|
138
|
+
e("skillApi", "createCategory", "POST", "/skill/category");
|
|
139
|
+
e("skillApi", "deleteCategory", "POST", "/skill/category/delete");
|
|
140
|
+
e("skillApi", "getBySkillCode", "GET", "/skill/by-code");
|
|
141
|
+
e("skillApi", "install", "POST", "/skill/install");
|
|
142
|
+
e("skillApi", "stats", "GET", "/skill/stats");
|
|
143
|
+
e("skillApi", "versions", "GET", "/skill/versions");
|
|
144
|
+
e("skillApi", "downloadPackage", "GET", "/skill/download");
|
|
145
|
+
e("skillApi", "uploadPackage", "POST", "/skill/upload");
|
|
146
|
+
e("agentApi", "appPage", "POST", "/agent/app/page");
|
|
147
|
+
e("agentApi", "appGet", "GET", "/agent/app/get");
|
|
148
|
+
e("agentApi", "appCreate", "POST", "/agent/app");
|
|
149
|
+
e("agentApi", "appUpdate", "POST", "/agent/app/update");
|
|
150
|
+
e("agentApi", "appDelete", "POST", "/agent/app/delete");
|
|
151
|
+
e("agentApi", "appPublish", "POST", "/agent/app/publish");
|
|
152
|
+
e("agentApi", "appUpgrade", "POST", "/agent/app/upgrade");
|
|
153
|
+
e("agentApi", "appToggleShare", "POST", "/agent/app/toggleShare");
|
|
154
|
+
e("agentApi", "versions", "GET", "/agent/app/versions");
|
|
155
|
+
e("agentApi", "groupTree", "GET", "/agent/group/tree");
|
|
156
|
+
e("agentApi", "groupCreate", "POST", "/agent/group");
|
|
157
|
+
e("agentApi", "groupUpdate", "POST", "/agent/group/update");
|
|
158
|
+
e("agentApi", "groupDelete", "POST", "/agent/group/delete");
|
|
159
|
+
e("agentApi", "chatHistory", "GET", "/agent/chat/history");
|
|
160
|
+
e("agentApi", "chatStream", "POST", "/agent/chat/send");
|
|
161
|
+
e("agentApi", "chatClear", "POST", "/agent/chat/clear");
|
|
162
|
+
e("agentApi", "shareVerify", "GET", "/agent/share/verify");
|
|
163
|
+
e("flowApi", "list", "GET", "/agent/flow/list");
|
|
164
|
+
e("flowApi", "get", "GET", "/agent/flow/byId");
|
|
165
|
+
e("flowApi", "byFlowId", "GET", "/agent/flow/byFlowId");
|
|
166
|
+
e("flowApi", "versions", "GET", "/agent/flow/versions");
|
|
167
|
+
e("flowApi", "create", "POST", "/agent/flow/create");
|
|
168
|
+
e("flowApi", "update", "POST", "/agent/flow/update");
|
|
169
|
+
e("flowApi", "publish", "POST", "/agent/flow/publish");
|
|
170
|
+
e("flowApi", "archive", "POST", "/agent/flow/archive");
|
|
171
|
+
e("flowApi", "newVersion", "POST", "/agent/flow/newVersion");
|
|
172
|
+
e("flowApi", "delete", "POST", "/agent/flow/delete");
|
|
173
|
+
e("flowApi", "execute", "POST", "/agent/flow/execute");
|
|
174
|
+
e("flowApi", "health", "GET", "/agent/flow/health");
|
|
175
|
+
e("statsApi", "overview", "GET", "/agent/stats/overview");
|
|
176
|
+
e("statsApi", "trend", "GET", "/agent/stats/trend");
|
|
177
|
+
e("statsApi", "latency", "GET", "/agent/stats/latency");
|
|
178
|
+
e("statsApi", "byApp", "GET", "/agent/stats/by-app");
|
|
179
|
+
e("statsApi", "byUser", "GET", "/agent/stats/by-user");
|
|
180
|
+
e("statsApi", "health", "GET", "/agent/stats/health");
|
|
181
|
+
e("pluginApi", "page", "GET", "/agent/plugin/page");
|
|
182
|
+
e("pluginApi", "get", "GET", "/agent/plugin/byId");
|
|
183
|
+
e("pluginApi", "byCode", "GET", "/agent/plugin/byCode");
|
|
184
|
+
e("pluginApi", "create", "POST", "/agent/plugin/create");
|
|
185
|
+
e("pluginApi", "update", "POST", "/agent/plugin/update");
|
|
186
|
+
e("pluginApi", "status", "POST", "/agent/plugin/status");
|
|
187
|
+
e("pluginApi", "delete", "POST", "/agent/plugin/delete");
|
|
188
|
+
e("pluginApi", "execute", "POST", "/agent/plugin/execute");
|
|
189
|
+
e("pluginApi", "builtinBeans", "GET", "/agent/plugin/builtin-beans");
|
|
190
|
+
e("pluginApi", "health", "GET", "/agent/plugin/health");
|
|
191
|
+
e("triggerApi", "page", "GET", "/agent/trigger/page");
|
|
192
|
+
e("triggerApi", "get", "GET", "/agent/trigger/byId");
|
|
193
|
+
e("triggerApi", "create", "POST", "/agent/trigger/create");
|
|
194
|
+
e("triggerApi", "update", "POST", "/agent/trigger/update");
|
|
195
|
+
e("triggerApi", "status", "POST", "/agent/trigger/status");
|
|
196
|
+
e("triggerApi", "delete", "POST", "/agent/trigger/delete");
|
|
197
|
+
e("triggerApi", "fire", "POST", "/agent/trigger/fire");
|
|
198
|
+
e("triggerApi", "health", "GET", "/agent/trigger/health");
|
|
199
|
+
e("templateApi", "page", "GET", "/agent/template/page");
|
|
200
|
+
e("templateApi", "get", "GET", "/agent/template/byId");
|
|
201
|
+
e("templateApi", "hot", "GET", "/agent/template/hot");
|
|
202
|
+
e("templateApi", "create", "POST", "/agent/template/create");
|
|
203
|
+
e("templateApi", "update", "POST", "/agent/template/update");
|
|
204
|
+
e("templateApi", "status", "POST", "/agent/template/status");
|
|
205
|
+
e("templateApi", "delete", "POST", "/agent/template/delete");
|
|
206
|
+
e("templateApi", "fork", "POST", "/agent/template/fork");
|
|
207
|
+
e("templateApi", "health", "GET", "/agent/template/health");
|
|
208
|
+
e("textGenApi", "page", "GET", "/agent/textgen/page");
|
|
209
|
+
e("textGenApi", "get", "GET", "/agent/textgen/byId");
|
|
210
|
+
e("textGenApi", "results", "GET", "/agent/textgen/results");
|
|
211
|
+
e("textGenApi", "create", "POST", "/agent/textgen/create");
|
|
212
|
+
e("textGenApi", "delete", "POST", "/agent/textgen/delete");
|
|
213
|
+
e("textGenApi", "run", "POST", "/agent/textgen/run");
|
|
214
|
+
e("textGenApi", "createAndRun", "POST", "/agent/textgen/createAndRun");
|
|
215
|
+
e("textGenApi", "health", "GET", "/agent/textgen/health");
|
|
216
|
+
e("humanInputApi", "inbox", "GET", "/agent/human/inbox");
|
|
217
|
+
e("humanInputApi", "listByExecution", "GET", "/agent/human/execution");
|
|
218
|
+
e("humanInputApi", "getById", "GET", "/agent/human/byId");
|
|
219
|
+
e("humanInputApi", "getByCode", "GET", "/agent/human/by-code");
|
|
220
|
+
e("humanInputApi", "decide", "POST", "/agent/human/decide");
|
|
221
|
+
e("humanInputApi", "create", "POST", "/agent/human/create");
|
|
222
|
+
e("humanInputApi", "health", "GET", "/agent/human/health");
|
|
223
|
+
e("productApi", "page", "GET", "/v1/products");
|
|
224
|
+
e("productApi", "create", "POST", "/v1/products");
|
|
225
|
+
e("productApi", "update", "PUT", "/v1/products");
|
|
226
|
+
e("productApi", "delete", "DELETE", "/v1/products");
|
|
227
|
+
e("productApi", "publish", "POST", "/v1/products/publish");
|
|
228
|
+
e("productApi", "offline", "POST", "/v1/products/offline");
|
|
229
|
+
e("productApi", "configGet", "GET", "/v1/products/config");
|
|
230
|
+
e("productApi", "configSave", "PUT", "/v1/products/config");
|
|
231
|
+
e("sceneApi", "page", "GET", "/v1/scenes");
|
|
232
|
+
e("sceneApi", "create", "POST", "/v1/scenes");
|
|
233
|
+
e("sceneApi", "update", "PUT", "/v1/scenes");
|
|
234
|
+
e("sceneApi", "delete", "DELETE", "/v1/scenes");
|
|
235
|
+
e("sceneApi", "duplicate", "POST", "/v1/scenes/duplicate");
|
|
236
|
+
e("sceneApi", "publish", "POST", "/v1/scenes/publish");
|
|
237
|
+
e("sceneApi", "offline", "POST", "/v1/scenes/offline");
|
|
238
|
+
e("sceneApi", "execute", "POST", "/v1/scenes/execute");
|
|
239
|
+
e("sceneApi", "canvasGet", "GET", "/v1/scenes/canvas");
|
|
240
|
+
e("sceneApi", "configGet", "GET", "/v1/scenes/config");
|
|
241
|
+
e("sceneApi", "nodes", "GET", "/v1/scenes/nodes");
|
|
242
|
+
e("sceneApi", "chatHistory", "GET", "/v1/scenes/chat-history");
|
|
243
|
+
const Ue = d("agentApi"), Be = d("flowApi"), $e = d("statsApi");
|
|
244
|
+
d("pluginApi");
|
|
245
|
+
d("memoryApi");
|
|
246
|
+
d("triggerApi");
|
|
247
|
+
const qe = d("templateApi");
|
|
248
|
+
d("textGenApi");
|
|
249
|
+
d("humanInputApi");
|
|
250
|
+
const Ne = d("llmApi"), Ye = d("mcpApi"), We = d("scriptApi"), Fe = d("skillApi"), Ve = d("productApi"), Je = d("sceneApi"), He = d("ossApi");
|
|
251
|
+
var b = { exports: {} }, E = {};
|
|
252
|
+
/**
|
|
253
|
+
* @license React
|
|
254
|
+
* react-jsx-runtime.production.js
|
|
255
|
+
*
|
|
256
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
257
|
+
*
|
|
258
|
+
* This source code is licensed under the MIT license found in the
|
|
259
|
+
* LICENSE file in the root directory of this source tree.
|
|
260
|
+
*/
|
|
261
|
+
var W;
|
|
262
|
+
function Ge() {
|
|
263
|
+
if (W) return E;
|
|
264
|
+
W = 1;
|
|
265
|
+
var n = Symbol.for("react.transitional.element"), r = Symbol.for("react.fragment");
|
|
266
|
+
function a(o, p, l) {
|
|
267
|
+
var T = null;
|
|
268
|
+
if (l !== void 0 && (T = "" + l), p.key !== void 0 && (T = "" + p.key), "key" in p) {
|
|
269
|
+
l = {};
|
|
270
|
+
for (var s in p)
|
|
271
|
+
s !== "key" && (l[s] = p[s]);
|
|
272
|
+
} else l = p;
|
|
273
|
+
return p = l.ref, {
|
|
274
|
+
$$typeof: n,
|
|
275
|
+
type: o,
|
|
276
|
+
key: T,
|
|
277
|
+
ref: p !== void 0 ? p : null,
|
|
278
|
+
props: l
|
|
279
|
+
};
|
|
280
|
+
}
|
|
281
|
+
return E.Fragment = r, E.jsx = a, E.jsxs = a, E;
|
|
282
|
+
}
|
|
283
|
+
var P = {};
|
|
284
|
+
/**
|
|
285
|
+
* @license React
|
|
286
|
+
* react-jsx-runtime.development.js
|
|
287
|
+
*
|
|
288
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
289
|
+
*
|
|
290
|
+
* This source code is licensed under the MIT license found in the
|
|
291
|
+
* LICENSE file in the root directory of this source tree.
|
|
292
|
+
*/
|
|
293
|
+
var F;
|
|
294
|
+
function ye() {
|
|
295
|
+
return F || (F = 1, process.env.NODE_ENV !== "production" && (function() {
|
|
296
|
+
function n(t) {
|
|
297
|
+
if (t == null) return null;
|
|
298
|
+
if (typeof t == "function")
|
|
299
|
+
return t.$$typeof === oe ? null : t.displayName || t.name || null;
|
|
300
|
+
if (typeof t == "string") return t;
|
|
301
|
+
switch (t) {
|
|
302
|
+
case x:
|
|
303
|
+
return "Fragment";
|
|
304
|
+
case Q:
|
|
305
|
+
return "Profiler";
|
|
306
|
+
case Z:
|
|
307
|
+
return "StrictMode";
|
|
308
|
+
case ae:
|
|
309
|
+
return "Suspense";
|
|
310
|
+
case re:
|
|
311
|
+
return "SuspenseList";
|
|
312
|
+
case ie:
|
|
313
|
+
return "Activity";
|
|
314
|
+
}
|
|
315
|
+
if (typeof t == "object")
|
|
316
|
+
switch (typeof t.tag == "number" && console.error(
|
|
317
|
+
"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
|
|
318
|
+
), t.$$typeof) {
|
|
319
|
+
case X:
|
|
320
|
+
return "Portal";
|
|
321
|
+
case te:
|
|
322
|
+
return t.displayName || "Context";
|
|
323
|
+
case ee:
|
|
324
|
+
return (t._context.displayName || "Context") + ".Consumer";
|
|
325
|
+
case ne:
|
|
326
|
+
var i = t.render;
|
|
327
|
+
return t = t.displayName, t || (t = i.displayName || i.name || "", t = t !== "" ? "ForwardRef(" + t + ")" : "ForwardRef"), t;
|
|
328
|
+
case se:
|
|
329
|
+
return i = t.displayName || null, i !== null ? i : n(t.type) || "Memo";
|
|
330
|
+
case k:
|
|
331
|
+
i = t._payload, t = t._init;
|
|
332
|
+
try {
|
|
333
|
+
return n(t(i));
|
|
334
|
+
} catch {
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
return null;
|
|
338
|
+
}
|
|
339
|
+
function r(t) {
|
|
340
|
+
return "" + t;
|
|
341
|
+
}
|
|
342
|
+
function a(t) {
|
|
343
|
+
try {
|
|
344
|
+
r(t);
|
|
345
|
+
var i = !1;
|
|
346
|
+
} catch {
|
|
347
|
+
i = !0;
|
|
348
|
+
}
|
|
349
|
+
if (i) {
|
|
350
|
+
i = console;
|
|
351
|
+
var c = i.error, g = typeof Symbol == "function" && Symbol.toStringTag && t[Symbol.toStringTag] || t.constructor.name || "Object";
|
|
352
|
+
return c.call(
|
|
353
|
+
i,
|
|
354
|
+
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
|
|
355
|
+
g
|
|
356
|
+
), r(t);
|
|
357
|
+
}
|
|
358
|
+
}
|
|
359
|
+
function o(t) {
|
|
360
|
+
if (t === x) return "<>";
|
|
361
|
+
if (typeof t == "object" && t !== null && t.$$typeof === k)
|
|
362
|
+
return "<...>";
|
|
363
|
+
try {
|
|
364
|
+
var i = n(t);
|
|
365
|
+
return i ? "<" + i + ">" : "<...>";
|
|
366
|
+
} catch {
|
|
367
|
+
return "<...>";
|
|
368
|
+
}
|
|
369
|
+
}
|
|
370
|
+
function p() {
|
|
371
|
+
var t = G.A;
|
|
372
|
+
return t === null ? null : t.getOwner();
|
|
373
|
+
}
|
|
374
|
+
function l() {
|
|
375
|
+
return Error("react-stack-top-frame");
|
|
376
|
+
}
|
|
377
|
+
function T(t) {
|
|
378
|
+
if (D.call(t, "key")) {
|
|
379
|
+
var i = Object.getOwnPropertyDescriptor(t, "key").get;
|
|
380
|
+
if (i && i.isReactWarning) return !1;
|
|
381
|
+
}
|
|
382
|
+
return t.key !== void 0;
|
|
383
|
+
}
|
|
384
|
+
function s(t, i) {
|
|
385
|
+
function c() {
|
|
386
|
+
U || (U = !0, console.error(
|
|
387
|
+
"%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
|
|
388
|
+
i
|
|
389
|
+
));
|
|
390
|
+
}
|
|
391
|
+
c.isReactWarning = !0, Object.defineProperty(t, "key", {
|
|
392
|
+
get: c,
|
|
393
|
+
configurable: !0
|
|
394
|
+
});
|
|
395
|
+
}
|
|
396
|
+
function m() {
|
|
397
|
+
var t = n(this.type);
|
|
398
|
+
return B[t] || (B[t] = !0, console.error(
|
|
399
|
+
"Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
|
|
400
|
+
)), t = this.props.ref, t !== void 0 ? t : null;
|
|
401
|
+
}
|
|
402
|
+
function v(t, i, c, g, O, j) {
|
|
403
|
+
var u = c.ref;
|
|
404
|
+
return t = {
|
|
405
|
+
$$typeof: z,
|
|
406
|
+
type: t,
|
|
407
|
+
key: i,
|
|
408
|
+
props: c,
|
|
409
|
+
_owner: g
|
|
410
|
+
}, (u !== void 0 ? u : null) !== null ? Object.defineProperty(t, "ref", {
|
|
411
|
+
enumerable: !1,
|
|
412
|
+
get: m
|
|
413
|
+
}) : Object.defineProperty(t, "ref", { enumerable: !1, value: null }), t._store = {}, Object.defineProperty(t._store, "validated", {
|
|
414
|
+
configurable: !1,
|
|
415
|
+
enumerable: !1,
|
|
416
|
+
writable: !0,
|
|
417
|
+
value: 0
|
|
418
|
+
}), Object.defineProperty(t, "_debugInfo", {
|
|
419
|
+
configurable: !1,
|
|
420
|
+
enumerable: !1,
|
|
421
|
+
writable: !0,
|
|
422
|
+
value: null
|
|
423
|
+
}), Object.defineProperty(t, "_debugStack", {
|
|
424
|
+
configurable: !1,
|
|
425
|
+
enumerable: !1,
|
|
426
|
+
writable: !0,
|
|
427
|
+
value: O
|
|
428
|
+
}), Object.defineProperty(t, "_debugTask", {
|
|
429
|
+
configurable: !1,
|
|
430
|
+
enumerable: !1,
|
|
431
|
+
writable: !0,
|
|
432
|
+
value: j
|
|
433
|
+
}), Object.freeze && (Object.freeze(t.props), Object.freeze(t)), t;
|
|
434
|
+
}
|
|
435
|
+
function A(t, i, c, g, O, j) {
|
|
436
|
+
var u = i.children;
|
|
437
|
+
if (u !== void 0)
|
|
438
|
+
if (g)
|
|
439
|
+
if (pe(u)) {
|
|
440
|
+
for (g = 0; g < u.length; g++)
|
|
441
|
+
I(u[g]);
|
|
442
|
+
Object.freeze && Object.freeze(u);
|
|
443
|
+
} else
|
|
444
|
+
console.error(
|
|
445
|
+
"React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
|
|
446
|
+
);
|
|
447
|
+
else I(u);
|
|
448
|
+
if (D.call(i, "key")) {
|
|
449
|
+
u = n(t);
|
|
450
|
+
var f = Object.keys(i).filter(function(le) {
|
|
451
|
+
return le !== "key";
|
|
452
|
+
});
|
|
453
|
+
g = 0 < f.length ? "{key: someKey, " + f.join(": ..., ") + ": ...}" : "{key: someKey}", N[u + g] || (f = 0 < f.length ? "{" + f.join(": ..., ") + ": ...}" : "{}", console.error(
|
|
454
|
+
`A props object containing a "key" prop is being spread into JSX:
|
|
455
|
+
let props = %s;
|
|
456
|
+
<%s {...props} />
|
|
457
|
+
React keys must be passed directly to JSX without using spread:
|
|
458
|
+
let props = %s;
|
|
459
|
+
<%s key={someKey} {...props} />`,
|
|
460
|
+
g,
|
|
461
|
+
u,
|
|
462
|
+
f,
|
|
463
|
+
u
|
|
464
|
+
), N[u + g] = !0);
|
|
465
|
+
}
|
|
466
|
+
if (u = null, c !== void 0 && (a(c), u = "" + c), T(i) && (a(i.key), u = "" + i.key), "key" in i) {
|
|
467
|
+
c = {};
|
|
468
|
+
for (var w in i)
|
|
469
|
+
w !== "key" && (c[w] = i[w]);
|
|
470
|
+
} else c = i;
|
|
471
|
+
return u && s(
|
|
472
|
+
c,
|
|
473
|
+
typeof t == "function" ? t.displayName || t.name || "Unknown" : t
|
|
474
|
+
), v(
|
|
475
|
+
t,
|
|
476
|
+
u,
|
|
477
|
+
c,
|
|
478
|
+
p(),
|
|
479
|
+
O,
|
|
480
|
+
j
|
|
481
|
+
);
|
|
482
|
+
}
|
|
483
|
+
function I(t) {
|
|
484
|
+
M(t) ? t._store && (t._store.validated = 1) : typeof t == "object" && t !== null && t.$$typeof === k && (t._payload.status === "fulfilled" ? M(t._payload.value) && t._payload.value._store && (t._payload.value._store.validated = 1) : t._store && (t._store.validated = 1));
|
|
485
|
+
}
|
|
486
|
+
function M(t) {
|
|
487
|
+
return typeof t == "object" && t !== null && t.$$typeof === z;
|
|
488
|
+
}
|
|
489
|
+
var h = Ee, z = Symbol.for("react.transitional.element"), X = Symbol.for("react.portal"), x = Symbol.for("react.fragment"), Z = Symbol.for("react.strict_mode"), Q = Symbol.for("react.profiler"), ee = Symbol.for("react.consumer"), te = Symbol.for("react.context"), ne = Symbol.for("react.forward_ref"), ae = Symbol.for("react.suspense"), re = Symbol.for("react.suspense_list"), se = Symbol.for("react.memo"), k = Symbol.for("react.lazy"), ie = Symbol.for("react.activity"), oe = Symbol.for("react.client.reference"), G = h.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, D = Object.prototype.hasOwnProperty, pe = Array.isArray, y = console.createTask ? console.createTask : function() {
|
|
490
|
+
return null;
|
|
491
|
+
};
|
|
492
|
+
h = {
|
|
493
|
+
react_stack_bottom_frame: function(t) {
|
|
494
|
+
return t();
|
|
495
|
+
}
|
|
496
|
+
};
|
|
497
|
+
var U, B = {}, $ = h.react_stack_bottom_frame.bind(
|
|
498
|
+
h,
|
|
499
|
+
l
|
|
500
|
+
)(), q = y(o(l)), N = {};
|
|
501
|
+
P.Fragment = x, P.jsx = function(t, i, c) {
|
|
502
|
+
var g = 1e4 > G.recentlyCreatedOwnerStacks++;
|
|
503
|
+
return A(
|
|
504
|
+
t,
|
|
505
|
+
i,
|
|
506
|
+
c,
|
|
507
|
+
!1,
|
|
508
|
+
g ? Error("react-stack-top-frame") : $,
|
|
509
|
+
g ? y(o(t)) : q
|
|
510
|
+
);
|
|
511
|
+
}, P.jsxs = function(t, i, c) {
|
|
512
|
+
var g = 1e4 > G.recentlyCreatedOwnerStacks++;
|
|
513
|
+
return A(
|
|
514
|
+
t,
|
|
515
|
+
i,
|
|
516
|
+
c,
|
|
517
|
+
!0,
|
|
518
|
+
g ? Error("react-stack-top-frame") : $,
|
|
519
|
+
g ? y(o(t)) : q
|
|
520
|
+
);
|
|
521
|
+
};
|
|
522
|
+
})()), P;
|
|
523
|
+
}
|
|
524
|
+
var V;
|
|
525
|
+
function je() {
|
|
526
|
+
return V || (V = 1, process.env.NODE_ENV === "production" ? b.exports = Ge() : b.exports = ye()), b.exports;
|
|
527
|
+
}
|
|
528
|
+
var K = je();
|
|
529
|
+
J.use([
|
|
530
|
+
ce,
|
|
531
|
+
ge,
|
|
532
|
+
ue,
|
|
533
|
+
de,
|
|
534
|
+
Te,
|
|
535
|
+
me,
|
|
536
|
+
fe
|
|
537
|
+
]);
|
|
538
|
+
function Ke(n) {
|
|
539
|
+
return /* @__PURE__ */ K.jsx(Ae, { echarts: J, ...n });
|
|
540
|
+
}
|
|
541
|
+
const we = "# z-agent-component\n\nz-agent(智能体工作台)跨仓唯一前端面:把「Agent 应用 / LLM 与凭证 / MCP 工具 / OSS /\n产品与场景 / 脚本 / 技能 / 模板 / 调用追踪 / 用量统计」这一整套智能体平台页面\n收敛成一个可复用的 React 组件包,由 `z-agent-suit` 独立壳、z-team 工作台的\nSystemShell 或 z-opc 主壳挂载。\n\n- **npm 包名**:`@yuku123/z-agent-component`\n- **宿主接入**:`@yuku123/z-agent-component/pages`(manifest)与\n `@yuku123/z-agent-component`(主入口的具名页面导出),主壳可只取 `ComponentDocPage`\n- **后端**:z-agent 的 `/agent/**`、`/script/**`、`/skill/**`、`/mcp/**`、\n `/v1/products`、`/v1/scenes`、`/v1/bucket`、`/v1/object`、`/z-llm/config/**`\n- **技术栈**:React 19 + antd 6 + react-router-dom 7 + echarts 5 + @logicflow/core +\n react-markdown + vite(library mode,双入口 `.` / `./pages`)\n\n---\n\n## 一、能力概览\n\n⚠ **这个包里有两套页面树**,路由前缀与导出名都对不上,是最容易看错的地方:\n\n- **树 A:`src/agent/pages/**`** —— manifest(`menuItems` + `routes`)用的是这一套。\n- **树 B:`src/pages/**`** —— 主入口(`src/index.js`)的具名页面导出用的是这一套,\n z-team 的 `SystemShell` / z-opc 主壳引的也是这一套。\n\n两棵树里大部分页面**同名同功能**(例如 `ak/index.jsx`、`llm/model/index.jsx`),\n但它们是**两份独立文件**,改其中一份**不会**同步到另一份。\n\n### 1.1 树 A —— manifest 面(`/z-agent/*`,`src/pages-manifest.jsx`)\n\n| 页面 | 路由(相对 `/z-agent/*`) | 源文件(树 A) | 能力 |\n|------|--------------------------|----------------|------|\n| 首页 | `home` | `pages/HomePage.jsx` | 读 `userInfo` 显示登录人,按 `menuItems` 渲染功能入口卡片 |\n| 应用总览 | `overview` | `agent/pages/agent/index.jsx` | Agent 应用总览 |\n| 运行看板 | `agent/dashboard` | `agent/pages/agent/dashboard/index.jsx` | 运行指标看板 |\n| 应用编辑器 | `agent/editor` | `agent/pages/agent/editor/AgentAppEditor.jsx` | 应用编排编辑器(@logicflow) |\n| 分享页 | `agent/share` | `agent/pages/agent/share.jsx` | 应用分享与校验 |\n| 应用实例 | `agent/app` | `agent/pages/agent/app/index.jsx` | 应用实例列表 |\n| LLM 管理 | `llm` | `agent/pages/llm/index.jsx` | 模型与凭证入口 |\n| 模型管理 | `llm/model` | `agent/pages/llm/model/index.jsx` | 模型管理 |\n| 供应商 | `llm/provider` | `agent/pages/llm/provider/index.jsx` | 供应商管理 |\n| AK 管理 | `ak` | `agent/pages/ak/index.jsx` | 访问密钥管理 |\n| MCP 工具 | `mcp` | `agent/pages/mcp/index.jsx` | MCP server 与工具 |\n| OSS 浏览 | `oss` | `agent/pages/oss/BucketList.jsx` | 存储桶清单 |\n| 存储桶 | `oss/bucket` | `agent/pages/oss/BucketList.jsx` | 同上(两条路由指向同一个组件) |\n| 桶内对象 | `oss/bucket/:bucketName` | `agent/pages/oss/ObjectBrowser.jsx` | 桶内对象浏览 |\n| 产品管理 | `product` | `agent/pages/product/index.jsx` | 产品清单 |\n| 场景编排 | `product/scene` | `agent/pages/product/scene.jsx` | 场景画布与编排 |\n| 产品执行 | `product/execute` | `agent/pages/product/execute.jsx` | 产品执行 |\n| 脚本 | `script` | `agent/pages/script/index.jsx` | 脚本中心 |\n| 脚本产品化 | `script/productization` | `agent/pages/script/ScriptProductizationPage.jsx` | 脚本产品化 |\n| 技能 | `skill` | `agent/pages/skill/index.jsx` | 技能市场 |\n| 模板 | `template` | `agent/pages/template/index.jsx` | 模板市场 |\n| 调用追踪 | `trace` | `agent/pages/trace/index.jsx` | 调用链追踪 |\n| 用量统计 | `usage` | `agent/pages/usage/index.jsx` | 用量看板 |\n| 登录 | (不在菜单内) | `pages/LoginPage.jsx` | mock 登录,写 `token` / `userInfo` 后跳 `/z-agent/home` |\n| 组件文档 | `docs` | `pages/ComponentDoc.jsx` | 本文件渲染页(左侧 240px TOC + 右侧正文) |\n\n### 1.2 树 B —— 主入口具名导出面(`src/pages/**`)\n\n主入口 `src/index.js` 导出的页面组件(z-team `SystemShell` 与 z-opc 主壳按名字取):\n\n| 导出名 | 源文件(树 B) | 说明 |\n|--------|----------------|------|\n| `AgentAppPage` | `pages/agent/index.jsx` | Agent 应用页 |\n| `AgentAppList` | `pages/agent/app/index.jsx` | 应用实例列表 |\n| `AgentAppEditor` | `pages/agent/editor/AgentAppEditor.jsx` | 应用编排编辑器 |\n| `AgentSharePage` | `pages/agent/share.jsx` | 分享页 |\n| `WorkflowEditor` | `pages/agent/editor/WorkflowEditor.jsx` | 工作流编辑器(组件) |\n| `AgentDashboard` | `pages/agent/dashboard/index.jsx` | 运行看板 |\n| `AgentInstanceManager` | `pages/ai/agent-instances/index.jsx` | 多 Agent 实例管理(**只在树 B 有**) |\n| `ModelManage` | `pages/llm/index.jsx` | 模型管理 |\n| `LlmManage` | `pages/llm/LlmManage.jsx` | 模型与凭证合并单页入口(**只在树 B 有**) |\n| `LlmProvider` / `LlmModel` | `pages/llm/{provider,model}/index.jsx` | 供应商 / 模型 |\n| `AkManage` / `AkUsageDrawer` | `pages/ak/{index,AkUsageDrawer}.jsx` | AK 管理 / 用量抽屉 |\n| `McpPage` | `pages/mcp/index.jsx` | MCP 工具 |\n| `BucketList` / `ObjectBrowser` | `pages/oss/{BucketList,ObjectBrowser}.jsx` | 存储桶 / 对象浏览 |\n| `ScriptCenterPage` | `pages/script/index.jsx` | 脚本中心 |\n| `ScriptProductizationPage` | `pages/script/ScriptProductizationPage.jsx` | 脚本产品化 |\n| `ApiBridgeEditor` / `CurlImportModal` / `OpenApiImportModal` / `FieldMappingEditor` | `pages/script/*.jsx` | 脚本导入与映射编辑(组件) |\n| `SkillMarket` | `pages/skill/index.jsx` | 技能市场 |\n| `TemplateMarket` | `pages/template/index.jsx` | 模板市场 |\n| `ProductList` / `ProductScene` / `ProductExecute` | `pages/product/*.jsx` | 产品 / 场景 / 执行 |\n| `UsageDashboard` | `pages/usage/index.jsx` | 用量看板 |\n\n**两棵树的不对称**(除上表标注外):\n- `agent/pages/trace/**`(调用追踪)**只在树 A 有**,树 B 没有对应导出;\n- `pages/ai/agent-instances/**`、`pages/llm/LlmManage.jsx` **只在树 B 有**,树 A 没有。\n\n## 二、导出面\n\n```js\n// 主入口(. 桶):请求层 + 树 B 的具名页面导出\nimport {configureAgent, agentApi, flowApi, statsApi, pluginApi, memoryApi, triggerApi,\n templateApi, textGenApi, humanInputApi, llmApi, mcpApi, scriptApi, skillApi,\n productApi, sceneApi, ossApi, authRequest, ctcRequest, request,\n AgentAppPage, AgentAppList, AgentDashboard, LlmManage, McpPage, ObjectBrowser,\n ScriptCenterPage, ScriptProductizationPage, SkillMarket, BucketList,\n ComponentDocPage} from '@yuku123/z-agent-component'\n\n// 宿主组装面(./pages 桶):manifest\nimport {menuItems, routes, appMeta, HomePage, LoginPage, ComponentDocPage} from '@yuku123/z-agent-component/pages'\n```\n\n⚠ **构建入口不是 `src/pages.js`**:这个包的 vite `lib.entry` 是\n`{ 'z-agent-component': './src/index.js', 'z-agent-pages': './src/pages-manifest.jsx' }`,\n`package.json` 的 `exports['./pages']` 指向 `./dist/z-agent-pages.js`\n⇒ **`./pages` 桶的内容就是 manifest 本身**(不是 `src/pages.js`)。\n`src/pages.js` 这个文件在包里是**死代码**,没有进任何构建产物。\n⇒ 文档页只要在 manifest 里导出,就会自动出现在 `./pages` 桶里。\n\n## 三、API 端点\n\n请求实例由基座 `createRequest` 工厂创建(`src/agent/api/request.js` 与 `src/api/request.js`\n各一份,内容一致),**`baseURL` 默认 `/api`**,超时 15s。\n路由表在 `src/agent/api/routes.js`(树 A)与 `src/api/routes.js`(树 B),\n用 `reg(命名空间, 方法名, HTTP 方法, 路径)` 注册;**未注册的调用会抛 `__missing_route`**。\n\n下表路径是 `src/agent/api/routes.js` 里**实际注册**的路径(前缀 `/api` 由 baseURL 提供)。\n\n### 3.1 Agent 应用 / 工作流 / 监控 / 插件 / 触发器 / 模板 / 文本生成 / 人工干预\n\n| 方法 | 路径 | 说明 |\n|---|---|---|\n| POST | `/agent/app/page` | 应用分页 |\n| GET | `/agent/app/get` | 应用详情 |\n| POST | `/agent/app` | 新建应用 |\n| POST | `/agent/app/update` | 更新应用 |\n| POST | `/agent/app/delete` | 删除应用 |\n| POST | `/agent/app/publish` | 发布应用 |\n| POST | `/agent/app/upgrade` | 升级应用 |\n| POST | `/agent/app/toggleShare` | 切换分享 |\n| GET | `/agent/app/versions` | 版本列表 |\n| GET | `/agent/group/tree` | 分组树 |\n| POST | `/agent/group` | 新建分组 |\n| POST | `/agent/group/update` | 更新分组 |\n| POST | `/agent/group/delete` | 删除分组 |\n| GET | `/agent/chat/history` | 会话历史 |\n| POST | `/agent/chat/send` | 发送消息(流式) |\n| POST | `/agent/chat/clear` | 清空会话 |\n| GET | `/agent/share/verify` | 分享校验 |\n| GET | `/agent/flow/list` | 工作流列表 |\n| GET | `/agent/flow/byId` | 工作流详情 |\n| GET | `/agent/flow/byFlowId` | 按 flowId 取工作流 |\n| GET | `/agent/flow/versions` | 工作流版本 |\n| POST | `/agent/flow/create` | 新建工作流 |\n| POST | `/agent/flow/update` | 更新工作流 |\n| POST | `/agent/flow/publish` | 发布工作流 |\n| POST | `/agent/flow/archive` | 归档工作流 |\n| POST | `/agent/flow/newVersion` | 新建版本 |\n| POST | `/agent/flow/delete` | 删除工作流 |\n| POST | `/agent/flow/execute` | 执行工作流 |\n| GET | `/agent/flow/health` | 工作流健康 |\n| GET | `/agent/stats/overview` | 监控总览 |\n| GET | `/agent/stats/trend` | 趋势 |\n| GET | `/agent/stats/latency` | 时延 |\n| GET | `/agent/stats/by-app` | 按应用 |\n| GET | `/agent/stats/by-user` | 按用户 |\n| GET | `/agent/stats/health` | 监控健康 |\n| GET | `/agent/plugin/page` | 插件分页 |\n| GET | `/agent/plugin/byId` | 插件详情 |\n| GET | `/agent/plugin/byCode` | 按 code 取插件 |\n| POST | `/agent/plugin/create` | 新建插件 |\n| POST | `/agent/plugin/update` | 更新插件 |\n| POST | `/agent/plugin/status` | 插件状态 |\n| POST | `/agent/plugin/delete` | 删除插件 |\n| POST | `/agent/plugin/execute` | 执行插件 |\n| GET | `/agent/plugin/builtin-beans` | 内置 bean 清单 |\n| GET | `/agent/plugin/health` | 插件健康 |\n| GET | `/agent/trigger/page` | 触发器分页 |\n| GET | `/agent/trigger/byId` | 触发器详情 |\n| POST | `/agent/trigger/create` | 新建触发器 |\n| POST | `/agent/trigger/update` | 更新触发器 |\n| POST | `/agent/trigger/status` | 触发器状态 |\n| POST | `/agent/trigger/delete` | 删除触发器 |\n| POST | `/agent/trigger/fire` | 手动触发 |\n| GET | `/agent/trigger/health` | 触发器健康 |\n| GET | `/agent/template/page` | 模板分页 |\n| GET | `/agent/template/byId` | 模板详情 |\n| GET | `/agent/template/hot` | 热门模板 |\n| POST | `/agent/template/create` | 新建模板 |\n| POST | `/agent/template/update` | 更新模板 |\n| POST | `/agent/template/status` | 模板状态 |\n| POST | `/agent/template/delete` | 删除模板 |\n| POST | `/agent/template/fork` | 复刻模板 |\n| GET | `/agent/template/health` | 模板健康 |\n| GET | `/agent/textgen/page` | 文本生成器分页 |\n| GET | `/agent/textgen/byId` | 文本生成器详情 |\n| GET | `/agent/textgen/results` | 生成结果 |\n| POST | `/agent/textgen/create` | 新建 |\n| POST | `/agent/textgen/delete` | 删除 |\n| POST | `/agent/textgen/run` | 运行 |\n| POST | `/agent/textgen/createAndRun` | 建并运行 |\n| GET | `/agent/textgen/health` | 健康 |\n| GET | `/agent/human/inbox` | 人工干预收件箱 |\n| GET | `/agent/human/execution` | 按执行取 |\n| GET | `/agent/human/byId` | 按 id 取 |\n| GET | `/agent/human/by-code` | 按 code 取 |\n| POST | `/agent/human/decide` | 决策 |\n| POST | `/agent/human/create` | 新建 |\n| GET | `/agent/human/health` | 健康 |\n\n### 3.2 脚本 / 技能 / MCP / LLM 工具模板\n\n| 方法 | 路径 | 说明 |\n|---|---|---|\n| GET | `/script/list` | 脚本列表 |\n| POST | `/script` | 新建脚本 |\n| POST | `/script/update` | 更新脚本 |\n| POST | `/script/delete` | 删除脚本 |\n| POST | `/script/publish` | 发布脚本 |\n| POST | `/script/unpublish` | 下架脚本 |\n| POST | `/script/run` | 运行脚本 |\n| POST | `/script/import-curl` | curl 导入 |\n| POST | `/script/import-openapi` | OpenAPI 导入 |\n| POST | `/script/preview-mapping` | 字段映射预览 |\n| GET | `/skill/search` | 技能搜索 |\n| GET | `/skill/categories` | 技能分类 |\n| GET | `/skill/sources` | 技能来源 |\n| GET | `/skill/stats` | 技能统计 |\n| GET | `/skill/installed` | 已安装技能 |\n| GET | `/skill/detail` | 技能详情 |\n| GET | `/skill/content` | 技能内容 |\n| POST | `/skill/install` | 安装技能 |\n| DELETE | `/skill/uninstall` | 卸载技能 |\n| POST | `/skill/refresh` | 刷新技能源 |\n| GET | `/mcp/server/list` | MCP server 清单 |\n| POST | `/mcp/server/tools/list` | server 的工具清单 |\n| POST | `/mcp/server/tools/call` | 调用工具 |\n| GET | `/z-llm/config/tool-template/list` | LLM 工具模板目录 |\n\n### 3.3 产品 / 场景 / OSS\n\n| 方法 | 路径 | 说明 |\n|---|---|---|\n| GET | `/v1/products` | 产品分页 |\n| POST | `/v1/products` | 新建产品 |\n| PUT | `/v1/products` | 更新产品 |\n| DELETE | `/v1/products` | 删除产品 |\n| POST | `/v1/products/publish` | 发布产品 |\n| POST | `/v1/products/offline` | 下架产品 |\n| GET | `/v1/products/config` | 产品配置 |\n| PUT | `/v1/products/config` | 保存产品配置 |\n| GET | `/v1/scenes` | 场景分页 |\n| POST | `/v1/scenes` | 新建场景 |\n| PUT | `/v1/scenes` | 更新场景 |\n| DELETE | `/v1/scenes` | 删除场景 |\n| POST | `/v1/scenes/duplicate` | 复制场景 |\n| POST | `/v1/scenes/publish` | 发布场景 |\n| POST | `/v1/scenes/offline` | 下架场景 |\n| POST | `/v1/scenes/execute` | 执行场景 |\n| GET | `/v1/scenes/canvas` | 场景画布 |\n| GET | `/v1/scenes/config` | 场景配置 |\n| GET | `/v1/scenes/nodes` | 场景节点 |\n| GET | `/v1/scenes/chat-history` | 场景会话历史 |\n| GET | `/v1/bucket` | 存储桶列表 |\n| POST | `/v1/bucket` | 创建桶 |\n| DELETE | `/v1/bucket` | 删除桶 |\n| PUT | `/v1/bucket/acl` | 设置桶 ACL |\n| GET | `/v1/bucket/stats` | 桶统计 |\n| GET | `/v1/object` | 对象列表 |\n| POST | `/v1/object` | 上传对象 |\n| DELETE | `/v1/object` | 删除对象 |\n| POST | `/v1/object/copy` | 复制对象 |\n| POST | `/v1/object/batch-delete` | 批量删除对象 |\n| GET | `/v1/object/url` | 预签名 URL |\n| POST | `/v1/folder` | 创建目录 |\n\n### 3.4 绕过路由表的直连调用\n\n页面里还有一批**不走路由表**、直接用 umi 风格 `request(url, {method, params|data})` 打的路径。\n它们**没有 `__missing_route` 保护** —— 注册缺失时请求会原样打到后端并拿 404 / 业务错误。\n\n| 方法 | 路径 | 用在哪个页面 |\n|---|---|---|\n| GET | `/ak/list` | AK 管理(query:`akType`) |\n| POST | `/ak/create` | AK 管理 |\n| POST | `/ak/update` | AK 管理 |\n| POST | `/ak/delete` | AK 管理 |\n| POST | `/ak/toggle` | AK 管理(query:`id` / `status`) |\n| GET | `/llm-center/model/list` | 模型管理 |\n| POST | `/llm-center/model/delete` | 模型管理 |\n| GET | `/llm-center/provider/list` | 供应商 |\n| POST | `/llm-center/provider/delete` | 供应商 |\n| GET | `/llm-gateway/usage/overview` | 用量统计 |\n| GET | `/llm-gateway/usage/trend` | 用量统计 |\n| GET | `/llm-gateway/usage/records` | 用量统计 |\n| GET | `/llm-gateway/usage/by-app` | 用量统计 |\n| GET | `/llm-gateway/usage/by-user` | 用量统计 |\n\n⚠ `/llm-gateway/usage/*` 这一组与路由表注释里说的「llm-gateway 前缀在本 JVM 一条都没有」\n是同一件事:路由表把工具模板改接到了 `/api/z-llm/config/**`,但用量页仍在打\n`/api/llm-gateway/usage/*` ⇒ 本 JVM 上这五个接口预期是 404。\n\n## 四、页面说明\n\n### 4.1 首页 / 登录\n\n首页读 `localStorage.userInfo` 显示欢迎语与角色标签,再把 `menuItems`(去掉首页自身)\n渲染成入口卡片 —— 菜单加一项,首页卡片自动多一张,不用改页面代码。\n登录页当前是 mock(比对写死的管理员凭据,明文口令不在本文复述,见源码)。\n\n### 4.2 Agent 应用族(总览 / 看板 / 编辑器 / 分享 / 实例)\n\n应用是这一域的主线:应用记录里的 `tools` / `skill_codes` / `knowledge_ids` 三列\n决定它绑了哪些工具、技能与知识库(**不走 LLM 工具模板接口**)。\n编辑器用 @logicflow/core 画编排图。\n\n### 4.3 LLM 与凭证\n\n`llm` 是模型与凭证的合并入口;`llm/model` 管模型,`llm/provider` 管供应商;\n`ak` 管访问密钥(带用量抽屉)。工具模板目录读 `/z-llm/config/tool-template/list`。\n\n### 4.4 MCP 工具\n\n只读三格:server 清单 / server 的工具清单 / 调用工具。\n⚠ MCP 的写端点(create / update / delete / test)随 z-agent-mcp 一族退场,**别再往回挂**。\n\n### 4.5 OSS / 产品与场景 / 脚本 / 技能 / 模板 / 追踪 / 用量\n\n对象存储浏览(桶 → 对象)、产品与场景编排(`/v1/products` + `/v1/scenes`)、\n脚本中心(含 curl / OpenAPI 导入与字段映射预览)、技能市场、模板市场、\n调用追踪与用量看板。\n\n### 4.6 组件文档\n\n本文件。内容以 `?raw` 在编译期内联,零额外请求;左侧 240px TOC 随滚动联动。\n\n## 五、配置\n\n| 配置项 | 默认值 | 说明 |\n|---|---|---|\n| `configureAgent({apiBase})` | `'/api'` | 同时改写 `request` / `authRequest` / `ctcRequest` 三个实例的 `baseURL` |\n| 请求超时 | `15000` ms | 三个实例都是 |\n| 路由表 | `src/agent/api/routes.js` + `src/api/routes.js` | 两份内容几乎相同(树 B 的多注册 3 条 `/mcp/admin/*`) |\n| `window.__Z_GRAPH_API__` 之类环境注入 | — | 本包**不**用全局注入,只认 `configureAgent` |\n\n## 六、已知限制\n\n- ⚠ **两套页面树并存**:manifest 用 `src/agent/pages/**`,主入口导出用 `src/pages/**`。\n 同名页面是两份独立文件,改一份不影响另一份。`trace`(调用追踪)只在树 A,\n `AgentInstanceManager` 与 `LlmManage` 只在树 B。\n ⇒ 改页面前先确认改的是哪一棵。\n- ⚠ **`src/pages.js` 是死代码**:vite 的 `lib.entry` 是 `src/index.js` 与\n `src/pages-manifest.jsx`,`exports['./pages']` 指向 `./dist/z-agent-pages.js`\n ⇒ `./pages` 桶 = manifest 本身。`src/pages.js` 没进任何产物。\n- ⚠ **主壳对 `ScriptCenterPage` 做了主壳级覆盖**:z-opc 主壳的\n `src/shims/z-agent-component/index.js` 把 `ScriptCenterPage` 换成主壳自己的只读页\n (数据源 `/api/script-admin/scripts`,绕开 AK 鉴权关)。\n ⇒ 在主壳里看到的脚本清单**不是**本包这页。覆盖只发生在主壳侧,本包源码未改。\n- **脚本接口受 AK 鉴权关**:`/api/script/**` 被 `z.script.api-key.path-patterns` 钉在 AK 关里,\n 直连本包的页面会拿到 `401 {\"errorCode\":\"MISSING_API_KEY\"}`。\n- **LLM 工具模板**:旧路由表里的 `/llm-gateway/**` 四条全是 404(实测 :8888 的\n `/actuator/mappings` 里 llm-gateway 前缀一条都没有),真实前缀是 `/api/z-llm/config/**`。\n 技能目录 / 知识库目录**本 JVM 无对应端点** ⇒ 不注册,调用即抛 `__missing_route`。\n- **未注册的 API 调用会抛 `__missing_route`**(不是 404),页面要显式写\n 「本 JVM 未装配 xxx」,不能显示成「暂无可用项」。\n- **`memoryApi` 在导出列表里但路由表里没有注册**:调用它必然抛 `__missing_route`。\n- **应用绑定关系不走 LLM 工具模板接口**:由 `agentApi.appGet` / `appUpdate` 读写。\n- echarts 与 @logicflow/core 走 external(`id.startsWith('echarts/')` 等前缀判定),\n 由宿主用自己的 node_modules 解析 ⇒ 本包 dist 里没有 echarts,宿主必须自己装。\n- z-agent 已被 z-opc 主壳的 `domainRoutes.ts`、z-team 的 `SystemShell` 与\n `SmartWorkbench` 引用 ⇒ `/z-agent/docs` 在平台主壳里**可达**。\n\n## 七、变更记录\n\n| 版本 | 变更 |\n|---|---|\n| 0.1.5 | 新增组件文档页 `ComponentDocPage`(lead 008 §7):`src/DOC.md` + 基座 `ComponentDoc` 薄包装 |\n| 0.1.5 | 首版:Agent / LLM / MCP / OSS / 产品场景 / 脚本 / 技能 / 模板 / 追踪 / 用量页面集 + 双页面树 + 双路由表 |\n";
|
|
542
|
+
function Xe() {
|
|
543
|
+
return /* @__PURE__ */ K.jsx(Pe, { markdown: we, title: "组件文档 — z-agent" });
|
|
544
|
+
}
|
|
545
|
+
export {
|
|
546
|
+
Xe as C,
|
|
547
|
+
Ke as R,
|
|
548
|
+
Ue as a,
|
|
549
|
+
$e as b,
|
|
550
|
+
De as c,
|
|
551
|
+
We as d,
|
|
552
|
+
Fe as e,
|
|
553
|
+
Be as f,
|
|
554
|
+
K as j,
|
|
555
|
+
Ne as l,
|
|
556
|
+
Ye as m,
|
|
557
|
+
He as o,
|
|
558
|
+
Ve as p,
|
|
559
|
+
Je as s,
|
|
560
|
+
qe as t,
|
|
561
|
+
Se as u
|
|
562
|
+
};
|