@vtj/designer 0.16.2 → 0.16.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.
@@ -0,0 +1,4 @@
1
+ import { _ as f } from "./index-DeMpeVmd.js";
2
+ export {
3
+ f as default
4
+ };
@@ -19,10 +19,10 @@ import { editor as Bm } from "monaco-editor";
19
19
  * Copyright (c) 2026, VTJ.PRO All rights reserved.
20
20
  * @name @vtj/designer
21
21
  * @author CHC chenhuachun1549@dingtalk.com
22
- * @version 0.16.2
22
+ * @version 0.16.4
23
23
  * @license <a href="https://vtj.pro/license.html">MIT License</a>
24
24
  */
25
- const dr = "0.16.2", Um = {
25
+ const dr = "0.16.4", Um = {
26
26
  width: 390,
27
27
  height: 844
28
28
  }, zm = {
@@ -2523,7 +2523,7 @@ function pv(e) {
2523
2523
  },
2524
2524
  shouldNext: (b) => {
2525
2525
  const k = b.content || b.reasoning || "";
2526
- return k.includes("F:") || k.includes("R:") ? !1 : !!(b.toolCallId && (b.toolContent || b.message) || b.status === "Error" && b.message || b.status === "Failed" && b.message);
2526
+ return k.includes("F:") || k.includes("R:") ? !1 : b.toolCallId && (b.toolContent || b.message) ? !0 : b.status === "Error" || b.status === "Failed" ? b.message && !b.message.startsWith("4") && !b.message.startsWith("5") : !1;
2527
2527
  },
2528
2528
  createNextPrompt: (b) => b.toolCallId ? b.toolContent || b.message || "O: 动作执行成功" : b.status === "Error" || b.status === "Failed" ? b.toolContent || b.message || "O: 动作执行失败" : "执行计划",
2529
2529
  getCurrentVue: p,
@@ -2563,7 +2563,7 @@ async function gv(e, t) {
2563
2563
  };
2564
2564
  }
2565
2565
  async function Kl(e, t) {
2566
- const { model: n, file: o, llm: s } = e, { projectDsl: r, dsl: a, source: l, options: c } = await Zc(t);
2566
+ const { model: n, file: o, llm: s } = e, { projectDsl: r, dsl: a, source: l, options: c } = await Zc(t), d = t.toolRegistry.generateToolDescriptions();
2567
2567
  return {
2568
2568
  model: n,
2569
2569
  file: o,
@@ -2571,7 +2571,8 @@ async function Kl(e, t) {
2571
2571
  dsl: JSON.stringify(a),
2572
2572
  project: JSON.stringify(r),
2573
2573
  source: l,
2574
- llm: s ? JSON.stringify(s) : ""
2574
+ llm: s ? JSON.stringify(s) : "",
2575
+ tools: d ? JSON.stringify(d) : ""
2575
2576
  };
2576
2577
  }
2577
2578
  function mv(e) {
@@ -8964,7 +8965,7 @@ const Mw = "data:image/svg+xml,%3csvg%20width='200'%20height='200'%20xmlns='http
8964
8965
  ]));
8965
8966
  }
8966
8967
  }), Ye = pp({
8967
- loader: () => import("./Editor-Dg-l8kts.js"),
8968
+ loader: () => import("./Editor-BOsZIM15.js"),
8968
8969
  loadingComponent: H({
8969
8970
  render() {
8970
8971
  return eo("div", "正在拼命加载...");
@@ -29377,7 +29378,21 @@ ${m}${y}`;
29377
29378
  })
29378
29379
  }, PA = {
29379
29380
  name: "createPage",
29380
- description: "在当前项目新建页面, 有层级的页面,需先创建父级,如先创建目录或布局类型的页面",
29381
+ description: `在当前项目新建页面。有层级的页面,需先创建父级,例如如先创建目录或布局类型的页面。示例:
29382
+ \`\`\`json
29383
+ {
29384
+ "action": "createPage",
29385
+ "parameters": [
29386
+ {
29387
+ "name": "Dashboard",
29388
+ "title": "仪表盘",
29389
+ "icon": "DataAnalysis"
29390
+ },
29391
+ "2gqoc7vp"
29392
+ ]
29393
+ }
29394
+ \`\`\`
29395
+ `,
29381
29396
  parameters: [
29382
29397
  {
29383
29398
  name: "page",
@@ -29420,7 +29435,11 @@ ${m}${y}`;
29420
29435
  }
29421
29436
  ],
29422
29437
  createHandler: ({ project: e, config: t }) => async (n, o) => {
29423
- const s = await e.createPage(
29438
+ if (typeof n != "object")
29439
+ throw new Error(
29440
+ "调用 createPage 工具参数错误,第一个参数要求是 PageFile 对象"
29441
+ );
29442
+ const s = o || n.parentId, r = await e.createPage(
29424
29443
  Object.assign(
29425
29444
  {
29426
29445
  cache: !1,
@@ -29438,16 +29457,16 @@ ${m}${y}`;
29438
29457
  },
29439
29458
  n
29440
29459
  ),
29441
- o
29460
+ s
29442
29461
  );
29443
- s.dir || (e.active(s), await Ie(t.activeDelayMs));
29444
- const { name: r, title: a, layout: l, dir: c } = n;
29445
- return s ? {
29446
- name: r,
29447
- title: a,
29448
- layout: l,
29449
- dir: c,
29450
- id: s.id
29462
+ r.dir || (e.active(r), await Ie(t.activeDelayMs));
29463
+ const { name: a, title: l, layout: c, dir: d } = n;
29464
+ return r ? {
29465
+ name: a,
29466
+ title: l,
29467
+ layout: c,
29468
+ dir: d,
29469
+ id: r.id
29451
29470
  } : null;
29452
29471
  }
29453
29472
  }, MA = {
@@ -29484,6 +29503,10 @@ ${m}${y}`;
29484
29503
  }
29485
29504
  ],
29486
29505
  createHandler: ({ project: e, config: t }) => async (n) => {
29506
+ if (typeof n != "object")
29507
+ throw new Error(
29508
+ "调用 updatePage 工具参数错误,第一个参数要求是 PageFile 对象"
29509
+ );
29487
29510
  const o = e.updatePage(n);
29488
29511
  if (await Ie(t.activeDelayMs), o) {
29489
29512
  const { name: s, title: r, layout: a, dir: l, id: c } = o;
@@ -29557,6 +29580,10 @@ ${m}${y}`;
29557
29580
  }
29558
29581
  ],
29559
29582
  createHandler: ({ project: e, config: t }) => async (n) => {
29583
+ if (typeof n != "object")
29584
+ throw new Error(
29585
+ "调用 createBlock 工具参数错误,第一个参数要求是 BlockFile 对象"
29586
+ );
29560
29587
  const o = await e.createBlock(n);
29561
29588
  e.active(o), await Ie(t.activeDelayMs);
29562
29589
  const { name: s, title: r } = n;
package/dist/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { A as e, a as E, b as t, c as r, d as n, C as i, D as S, e as _, E as o, f as I, g as T, h as O, G as l, H as d, i as p, j as g, K as V, M as R, k as A, l as D, N, m as P, O as L, P as M, n as c, R as K, o as m, p as u, q as Y, S as b, r as B, s as G, t as U, u as W, v as y, w as F, x as f, y as k, z as w, T as x, B as C, F as H, V as X, I as J, J as Z, L as h, Q as j, U as v, W as z, X as q, Y as Q, Z as $, $ as aa, a0 as sa, a1 as ea, a2 as Ea, a3 as ta, a4 as ra, a5 as na, a6 as ia, a7 as Sa, a8 as _a, a9 as oa, aa as Ia, ab as Ta, ac as Oa, ad as la, ae as da, af as pa, ag as ga, ah as Va, ai as Ra, aj as Aa, ak as Da, al as Na, am as Pa, an as La } from "./index-Cg42XFn5.js";
1
+ import { A as e, a as E, b as t, c as r, d as n, C as i, D as S, e as _, E as o, f as I, g as T, h as O, G as l, H as d, i as p, j as g, K as V, M as R, k as A, l as D, N, m as P, O as L, P as M, n as c, R as K, o as m, p as u, q as Y, S as b, r as B, s as G, t as U, u as W, v as y, w as F, x as f, y as k, z as w, T as x, B as C, F as H, V as X, I as J, J as Z, L as h, Q as j, U as v, W as z, X as q, Y as Q, Z as $, $ as aa, a0 as sa, a1 as ea, a2 as Ea, a3 as ta, a4 as ra, a5 as na, a6 as ia, a7 as Sa, a8 as _a, a9 as oa, aa as Ia, ab as Ta, ac as Oa, ad as la, ae as da, af as pa, ag as ga, ah as Va, ai as Ra, aj as Aa, ak as Da, al as Na, am as Pa, an as La } from "./index-DeMpeVmd.js";
2
2
  export {
3
3
  e as API_METHOD_TYPES,
4
4
  E as ActionMenu,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@vtj/designer",
3
3
  "private": false,
4
- "version": "0.16.2",
4
+ "version": "0.16.4",
5
5
  "type": "module",
6
6
  "keywords": [
7
7
  "低代码引擎",
@@ -29,12 +29,12 @@
29
29
  "marked": "~17.0.1",
30
30
  "mockjs": "~1.1.0",
31
31
  "monaco-editor": "~0.55.0",
32
- "@vtj/core": "~0.16.2",
33
- "@vtj/ui": "~0.16.2",
34
- "@vtj/renderer": "~0.16.2",
35
- "@vtj/uni": "~0.16.2",
36
- "@vtj/utils": "~0.16.2",
37
- "@vtj/icons": "~0.16.2"
32
+ "@vtj/core": "~0.16.4",
33
+ "@vtj/renderer": "~0.16.4",
34
+ "@vtj/icons": "~0.16.4",
35
+ "@vtj/ui": "~0.16.4",
36
+ "@vtj/uni": "~0.16.4",
37
+ "@vtj/utils": "~0.16.4"
38
38
  },
39
39
  "devDependencies": {
40
40
  "@types/mockjs": "~1.0.10",
@@ -9,7 +9,7 @@ export declare function useAgent(config: AgentConfig): {
9
9
  parseOutput: (content: string, flag?: string) => ParseResult | null;
10
10
  callTool: (tool: ToolCall) => Promise<string>;
11
11
  processOutput: (chat: AIChat) => Promise<AIChat>;
12
- shouldNext: (chat: AIChat) => boolean;
12
+ shouldNext: (chat: AIChat) => boolean | "";
13
13
  createNextPrompt: (chat: AIChat) => string;
14
14
  getCurrentVue: () => Promise<string>;
15
15
  convertVueToDsl: (chat: AIChat) => Promise< BlockSchema | undefined>;
@@ -2,7 +2,7 @@
2
2
  * Copyright (c) 2026, VTJ.PRO All rights reserved.
3
3
  * @name @vtj/designer
4
4
  * @author CHC chenhuachun1549@dingtalk.com
5
- * @version 0.16.1
5
+ * @version 0.16.3
6
6
  * @license <a href="https://vtj.pro/license.html">MIT License</a>
7
7
  */
8
- export declare const version = "0.16.1";
8
+ export declare const version = "0.16.3";
@@ -1,4 +0,0 @@
1
- import { _ as f } from "./index-Cg42XFn5.js";
2
- export {
3
- f as default
4
- };