@12inch-glorysoft/dsh-ad-form 1.0.0-beta.1 → 1.0.0-beta.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.
Files changed (32) hide show
  1. package/README.md +2 -0
  2. package/dist/server/agents/plan-preset.js +17 -0
  3. package/dist/server/agents/plan-review.js +1 -1
  4. package/dist/server/agents/plan-schema.js +1 -1
  5. package/dist/server/agents/plan.js +54 -23
  6. package/dist/server/entity/retrieve.js +1 -1
  7. package/dist/server/icon/workspace.js +1 -1
  8. package/dist/server/listener/ir-change.js +1 -1
  9. package/dist/server/package.js +171 -0
  10. package/dist/server/plan/skeleton.js +1 -1
  11. package/dist/server/plugin.js +11 -1
  12. package/dist/server/prompt/guide.js +1 -1
  13. package/dist/server/tool-access.js +1 -1
  14. package/dist/server/tools/complete-task/index.js +1 -1
  15. package/dist/server/tools/confirm-plan/execute.js +1 -1
  16. package/dist/server/tools/confirm-plan/index.js +1 -1
  17. package/dist/server/tools/create-task/index.js +1 -1
  18. package/dist/server/tools/get-design-state/index.js +2 -2
  19. package/dist/server/tools/get-entity-attributes/index.js +1 -1
  20. package/dist/server/tools/get-ir/index.js +1 -1
  21. package/dist/server/tools/import-design/execute.js +1 -1
  22. package/dist/server/tools/import-design/index.js +1 -1
  23. package/dist/server/tools/run-plan-subagent/index.js +1 -1
  24. package/dist/server/tools/search-data-source/index.js +1 -1
  25. package/dist/server/tools/search-dictionary/index.js +1 -1
  26. package/dist/server/tools/search-entity/index.js +1 -1
  27. package/dist/server/tools/search-icon/index.js +1 -1
  28. package/dist/server/tools/start-new-design/index.js +1 -1
  29. package/dist/server/tools/update-ir/index.js +1 -1
  30. package/dist/server/tools/update-task/index.js +1 -1
  31. package/dist/server/tools/validate-plan/index.js +1 -1
  32. package/package.json +58 -52
package/README.md CHANGED
@@ -54,6 +54,8 @@ NODE_OPTIONS="$NODE_OPTIONS --conditions=development" dsh --profile ad-form-dev
54
54
 
55
55
  ### 发布与更新
56
56
 
57
+ 当前适配 DSH `0.2.1-rc.5`。
58
+
57
59
  ```bash
58
60
  pnpm login --registry=https://registry.npmjs.org/
59
61
  pnpm check # lint、格式检查、类型检查
@@ -0,0 +1,17 @@
1
+ import { PLAN_PERSONA } from "../prompt/plan.js";
2
+ import { TOOL_NAMES } from "../tools/catalog.js";
3
+ import { PERSONA_PREFIX_SECTION } from "@deepseek-ai/dsh-system-prompt";
4
+ //#region src/agents/plan-preset.ts
5
+ var PLAN_PRESET_ID = "ad-form-plan";
6
+ var name = "ad-form-plan-preset";
7
+ var inject = ["systemPrompt", "tools"];
8
+ function apply(ctx) {
9
+ ctx.systemPrompt.section({
10
+ name: PERSONA_PREFIX_SECTION,
11
+ order: ctx.systemPrompt.getSectionOrder("DEPLOYMENT_PERSONA_PREFIX"),
12
+ text: PLAN_PERSONA
13
+ });
14
+ ctx.tools.restrict({ allow: [TOOL_NAMES.getComponentSpec, TOOL_NAMES.validatePlan] });
15
+ }
16
+ //#endregion
17
+ export { PLAN_PRESET_ID, apply, inject, name };
@@ -1,6 +1,6 @@
1
- import { TOOL_NAMES } from "../tools/catalog.js";
2
1
  import { PLAN_REVIEW_LABELS } from "../plan/review-spec.js";
3
2
  import { buildPlanReviewPrompt } from "../prompt/plan.js";
3
+ import { TOOL_NAMES } from "../tools/catalog.js";
4
4
  import { VALIDATE_PLAN_SCHEMA } from "../tools/validate-plan/schema.js";
5
5
  import { injectMessageWithTool } from "../util/message.js";
6
6
  import { validateJsonSchemaValue } from "@deepseek-ai/dsh-tools";
@@ -1,5 +1,5 @@
1
- import { PLAN_SPEC } from "../plan/spec.js";
2
1
  import { PLAN_REVIEW_SPEC } from "../plan/review-spec.js";
2
+ import { PLAN_SPEC } from "../plan/spec.js";
3
3
  import { valueSchemaSpecToJsonSchema } from "@deepseek-ai/dsh-tools";
4
4
  //#region src/agents/plan-schema.ts
5
5
  var PLAN_REPLY_SPEC = {
@@ -1,34 +1,44 @@
1
- import { TOOL_NAMES } from "../tools/catalog.js";
2
- import { PLAN_PERSONA, buildPlanPrompt, buildPlanReviewEvidence } from "../prompt/plan.js";
1
+ import { buildPlanPrompt, buildPlanReviewEvidence } from "../prompt/plan.js";
2
+ import { PLAN_PRESET_ID } from "./plan-preset.js";
3
3
  import { extractText } from "./util.js";
4
4
  import { mountPlanReview } from "./plan-review.js";
5
5
  import { PLAN_REPLY_SCHEMA } from "./plan-schema.js";
6
+ import { SessionId } from "@deepseek-ai/dsh-session";
7
+ import { randomUUID } from "node:crypto";
8
+ import { addAbortListener } from "node:events";
6
9
  //#region src/agents/plan.ts
7
- /** 规划子 Agent 可见的工具白名单:允许查组件卡片与校验计划,严禁触碰 IR。 */
8
- var PLAN_SUBAGENT_TOOLS = [TOOL_NAMES.getComponentSpec, TOOL_NAMES.validatePlan];
9
- /** 在一个 one-shot 子会话中等待布局计划与复检记录。 */
10
+ /** 在独立子会话中等待布局计划与复检记录。 */
10
11
  async function runPlanSubagent(ctx, parent, signal, input, label) {
11
12
  const [prompt, reviewEvidence] = await Promise.all([buildPlanPrompt(input), buildPlanReviewEvidence(input)]);
12
- const run = await ctx.subagents.start("spawn", {
13
- label: label ?? "布局规划",
14
- persona: PLAN_PERSONA,
15
- prompt: [{
16
- type: "text",
17
- text: prompt
18
- }],
19
- parent,
20
- signal,
21
- toolFilter: { allow: [...PLAN_SUBAGENT_TOOLS] },
22
- outputSchema: PLAN_REPLY_SCHEMA
23
- });
24
- let review;
13
+ signal.throwIfAborted();
14
+ const childId = SessionId(randomUUID());
15
+ const reviewBinding = bindPlanReview(ctx, childId, reviewEvidence);
16
+ let run;
17
+ let cancellation;
25
18
  try {
26
- if (!run.localAgent) return {
19
+ run = await ctx.subagents.startActivation({
20
+ provider: "spawn",
21
+ childId,
22
+ label: label ?? "布局规划",
23
+ request: {
24
+ agentPreset: PLAN_PRESET_ID,
25
+ prompt: [{
26
+ type: "text",
27
+ text: prompt
28
+ }],
29
+ parent,
30
+ outputSchema: PLAN_REPLY_SCHEMA
31
+ },
32
+ signal,
33
+ delivery: "caller"
34
+ });
35
+ cancellation = cancelPlanOnAbort(ctx, run, signal);
36
+ const review = reviewBinding.current();
37
+ if (!review) return {
27
38
  stopReason: "error",
28
39
  reviewIssues: ["当前规划执行未提供本地子会话,无法触发布局复检;新计划未保存。"],
29
40
  text: ""
30
41
  };
31
- review = mountPlanReview(run.localAgent, reviewEvidence, PLAN_REPLY_SCHEMA);
32
42
  const result = await run.result;
33
43
  return {
34
44
  stopReason: result.stopReason,
@@ -38,12 +48,33 @@ async function runPlanSubagent(ctx, parent, signal, input, label) {
38
48
  diagnostic: result.diagnostic
39
49
  };
40
50
  } finally {
51
+ cancellation?.[Symbol.dispose]();
41
52
  try {
42
- await run.dispose();
53
+ await run?.dispose();
43
54
  } finally {
44
- review?.dispose();
55
+ reviewBinding.dispose();
45
56
  }
46
57
  }
47
58
  }
59
+ function bindPlanReview(ctx, childId, evidence) {
60
+ let review;
61
+ const unwatch = ctx.on("agent/created", ({ agent }) => {
62
+ if (agent.id === childId) review = mountPlanReview(agent, evidence, PLAN_REPLY_SCHEMA);
63
+ });
64
+ return {
65
+ current: () => review,
66
+ dispose: () => {
67
+ unwatch();
68
+ review?.dispose();
69
+ }
70
+ };
71
+ }
72
+ function cancelPlanOnAbort(ctx, run, signal) {
73
+ return addAbortListener(signal, () => {
74
+ run.dispose().catch((error) => {
75
+ ctx.logger("ad-form-agent").error("规划子会话中断清理失败:", error);
76
+ });
77
+ });
78
+ }
48
79
  //#endregion
49
- export { PLAN_SUBAGENT_TOOLS, runPlanSubagent };
80
+ export { runPlanSubagent };
@@ -1,9 +1,9 @@
1
1
  import { scanJavaSource } from "./scan.js";
2
2
  import { decodeText } from "../util/text.js";
3
3
  import { parseNulPaths } from "./rg.js";
4
+ import { readFile, stat } from "node:fs/promises";
4
5
  import { existsSync } from "node:fs";
5
6
  import { basename, dirname, isAbsolute, join, relative, resolve } from "node:path";
6
- import { readFile, stat } from "node:fs/promises";
7
7
  //#region src/entity/retrieve.ts
8
8
  /**
9
9
  * @file retrieve.ts
@@ -1,7 +1,7 @@
1
1
  import { decodeText } from "../util/text.js";
2
2
  import { parseNulPaths } from "../entity/rg.js";
3
- import { resolve } from "node:path";
4
3
  import { readFile } from "node:fs/promises";
4
+ import { resolve } from "node:path";
5
5
  //#region src/icon/workspace.ts
6
6
  /**
7
7
  * @file workspace.ts
@@ -2,8 +2,8 @@ import { __exportAll } from "../_virtual/_rolldown/runtime.js";
2
2
  import { SERVICE_NAME } from "../state/constants.js";
3
3
  import "../service.js";
4
4
  import { convertIrToXml } from "../converter/index.js";
5
- import { join, resolve } from "node:path";
6
5
  import { unlink } from "node:fs/promises";
6
+ import { join, resolve } from "node:path";
7
7
  import { ToolCallId, createUserMessage } from "@deepseek-ai/dsh-llm";
8
8
  import { randomUUID } from "node:crypto";
9
9
  //#region src/listener/ir-change.ts
@@ -0,0 +1,171 @@
1
+ //#region package.json
2
+ var name = "@12inch-glorysoft/dsh-ad-form";
3
+ var version = "1.0.0-beta.2";
4
+ var description = "DSH 表单设计插件:根据需求与参考图生成表单,支持数据源、字典及实体检索";
5
+ var keywords = [
6
+ "ad-form",
7
+ "deepseek-harness",
8
+ "dsh",
9
+ "dsh-plugin",
10
+ "form"
11
+ ];
12
+ var files = [
13
+ "dist/server",
14
+ "dist/client",
15
+ "cordis.yml"
16
+ ];
17
+ var type = "module";
18
+ var main = "./dist/server/plugin.js";
19
+ var exports = {
20
+ ".": {
21
+ "development": "./src/plugin.ts",
22
+ "default": "./dist/server/plugin.js"
23
+ },
24
+ "./client": "./dist/client/client.js",
25
+ "./plan": {
26
+ "development": "./src/agents/plan-preset.ts",
27
+ "default": "./dist/server/agents/plan-preset.js"
28
+ }
29
+ };
30
+ var publishConfig = {
31
+ "access": "public",
32
+ "registry": "https://registry.npmjs.org/"
33
+ };
34
+ var scripts = {
35
+ "dev": "pnpm run build:client && concurrently --kill-others --success first \"pnpm run build:client --watch\" \"pnpm run dev:server\"",
36
+ "dev:server": "NODE_OPTIONS=\"$NODE_OPTIONS --conditions=development\" dsh web",
37
+ "test": "vitest run",
38
+ "test:watch": "vitest",
39
+ "test:converter": "vitest run src/converter/tests",
40
+ "test:plan": "vitest run src/plan/tests",
41
+ "test:validate": "vitest run src/validate/tests",
42
+ "test:entity": "vitest run src/entity/tests",
43
+ "lint": "oxlint",
44
+ "lint:fix": "oxlint --fix",
45
+ "fmt": "oxfmt",
46
+ "fmt:check": "oxfmt --check",
47
+ "typecheck": "tsc --noEmit",
48
+ "check": "pnpm run lint && pnpm run fmt:check && pnpm run typecheck",
49
+ "build:client": "vite build --config vite.client.config.ts",
50
+ "prebuild": "pnpm run check",
51
+ "build": "pnpm run build:server && pnpm run build:client",
52
+ "build:server": "vite build --config vite.server.config.ts",
53
+ "prepack": "pnpm run build",
54
+ "prerelease:beta": "pnpm version prerelease --preid beta --no-git-tag-version --no-git-checks",
55
+ "release:beta": "pnpm publish --tag beta --no-git-checks",
56
+ "prerelease:stable": "pnpm version patch --no-git-tag-version --no-git-checks",
57
+ "release:stable": "pnpm publish --tag latest --no-git-checks"
58
+ };
59
+ var dependencies = {
60
+ "@deepseek-ai/schemastery": "~3.18.5",
61
+ "@types/lodash-es": "^4.17.12",
62
+ "@vscode/ripgrep": "^1.18.0",
63
+ "ajv": "^8.20.0",
64
+ "dayjs": "^1.11.23",
65
+ "gray-matter": "^4.0.3",
66
+ "java-parser": "^3.0.1",
67
+ "knex": "^3.3.0",
68
+ "lodash-es": "^4.18.1",
69
+ "oracledb": "^26.0.0",
70
+ "yaml": "^2.9.1",
71
+ "zod": "4.4.3"
72
+ };
73
+ var devDependencies = {
74
+ "@deepseek-ai/cordis": "~4.0.5",
75
+ "@deepseek-ai/cordis-plugin-group": "1.0.5",
76
+ "@deepseek-ai/cordis-plugin-include": "1.0.10",
77
+ "@deepseek-ai/cordis-plugin-loader": "1.0.6",
78
+ "@deepseek-ai/dsh-agent": "0.2.1-rc.5",
79
+ "@deepseek-ai/dsh-agent-preset-registry": "0.2.1-rc.5",
80
+ "@deepseek-ai/dsh-app-boot": "0.2.1-rc.5",
81
+ "@deepseek-ai/dsh-client-ui-plugin-manager": "0.2.1-rc.5",
82
+ "@deepseek-ai/dsh-client-ui-primitives": "0.2.1-rc.5",
83
+ "@deepseek-ai/dsh-client-ui-renderer": "0.2.1-rc.5",
84
+ "@deepseek-ai/dsh-client-ui-settings": "0.2.1-rc.5",
85
+ "@deepseek-ai/dsh-client-ui-slots": "0.2.1-rc.5",
86
+ "@deepseek-ai/dsh-commands": "0.2.1-rc.5",
87
+ "@deepseek-ai/dsh-config-editor": "0.2.1-rc.5",
88
+ "@deepseek-ai/dsh-llm": "0.2.1-rc.5",
89
+ "@deepseek-ai/dsh-scope": "0.2.1-rc.5",
90
+ "@deepseek-ai/dsh-session": "0.2.1-rc.5",
91
+ "@deepseek-ai/dsh-settings": "0.2.1-rc.5",
92
+ "@deepseek-ai/dsh-skill": "0.2.1-rc.5",
93
+ "@deepseek-ai/dsh-storage": "0.2.1-rc.5",
94
+ "@deepseek-ai/dsh-storage-domain": "0.2.1-rc.5",
95
+ "@deepseek-ai/dsh-storage-json": "0.2.1-rc.5",
96
+ "@deepseek-ai/dsh-subagent": "0.2.1-rc.5",
97
+ "@deepseek-ai/dsh-subprocess": "0.2.1-rc.5",
98
+ "@deepseek-ai/dsh-system-prompt": "0.2.1-rc.5",
99
+ "@deepseek-ai/dsh-tool-skill": "0.2.1-rc.5",
100
+ "@deepseek-ai/dsh-tool-todo": "0.2.1-rc.5",
101
+ "@deepseek-ai/dsh-tools": "0.2.1-rc.5",
102
+ "@deepseek-ai/dsh-user-questions": "0.2.1-rc.5",
103
+ "@types/node": "^26.6.2",
104
+ "@types/react": "18.3.31",
105
+ "@types/react-dom": "18.3.7",
106
+ "concurrently": "^10.0.6",
107
+ "oxfmt": "^0.68.0",
108
+ "oxlint": "^1.83.0",
109
+ "react": "18.3.1",
110
+ "react-dom": "18.3.1",
111
+ "tsx": "^4.23.15",
112
+ "typescript": "^5.8.3",
113
+ "vite": "^8.3.4",
114
+ "vitest": "^5.0.3"
115
+ };
116
+ var peerDependencies = {
117
+ "@deepseek-ai/cordis": "~4.0.5",
118
+ "@deepseek-ai/cordis-plugin-loader": "1.0.6",
119
+ "@deepseek-ai/dsh-agent": "0.2.1-rc.5",
120
+ "@deepseek-ai/dsh-agent-preset-registry": "0.2.1-rc.5",
121
+ "@deepseek-ai/dsh-client-ui-plugin-manager": "0.2.1-rc.5",
122
+ "@deepseek-ai/dsh-client-ui-primitives": "0.2.1-rc.5",
123
+ "@deepseek-ai/dsh-client-ui-settings": "0.2.1-rc.5",
124
+ "@deepseek-ai/dsh-client-ui-slots": "0.2.1-rc.5",
125
+ "@deepseek-ai/dsh-commands": "0.2.1-rc.5",
126
+ "@deepseek-ai/dsh-llm": "0.2.1-rc.5",
127
+ "@deepseek-ai/dsh-scope": "0.2.1-rc.5",
128
+ "@deepseek-ai/dsh-session": "0.2.1-rc.5",
129
+ "@deepseek-ai/dsh-settings": "0.2.1-rc.5",
130
+ "@deepseek-ai/dsh-skill": "0.2.1-rc.5",
131
+ "@deepseek-ai/dsh-storage-domain": "0.2.1-rc.5",
132
+ "@deepseek-ai/dsh-subagent": "0.2.1-rc.5",
133
+ "@deepseek-ai/dsh-subprocess": "0.2.1-rc.5",
134
+ "@deepseek-ai/dsh-system-prompt": "0.2.1-rc.5",
135
+ "@deepseek-ai/dsh-tool-todo": "0.2.1-rc.5",
136
+ "@deepseek-ai/dsh-tools": "0.2.1-rc.5",
137
+ "@deepseek-ai/dsh-user-questions": "0.2.1-rc.5",
138
+ "react": "18.3.1"
139
+ };
140
+ var engines = {
141
+ "node": "^22.18.0 || ^24.0.0 || >=26.0.0",
142
+ "pnpm": ">=12.3.4"
143
+ };
144
+ var dsh = {
145
+ "bundle": { "patch": "./cordis.yml" },
146
+ "client": {
147
+ "platform": "web",
148
+ "inject": ["@deepseek-ai/dsh-client-ui-settings", "@deepseek-ai/dsh-client-ui-plugin-manager"]
149
+ }
150
+ };
151
+ var package_default = {
152
+ name,
153
+ version,
154
+ description,
155
+ keywords,
156
+ license: "ISC",
157
+ author: "",
158
+ files,
159
+ type,
160
+ main,
161
+ exports,
162
+ publishConfig,
163
+ scripts,
164
+ dependencies,
165
+ devDependencies,
166
+ peerDependencies,
167
+ engines,
168
+ dsh
169
+ };
170
+ //#endregion
171
+ export { package_default as default, dependencies, description, devDependencies, dsh, engines, exports, files, keywords, main, name, peerDependencies, publishConfig, scripts, type, version };
@@ -1,6 +1,6 @@
1
+ import { isPlanLayoutType } from "../converter/types.js";
1
2
  import { getCharLength } from "../validate/util.js";
2
3
  import "../validate/ir-config.js";
3
- import { isPlanLayoutType } from "../converter/types.js";
4
4
  import { pick } from "lodash-es";
5
5
  //#region src/plan/skeleton.ts
6
6
  var createSkeleton = (plan) => {
@@ -1,3 +1,5 @@
1
+ import package_default from "./package.js";
2
+ import { PLAN_PRESET_ID } from "./agents/plan-preset.js";
1
3
  import { createDatabaseSearch } from "./util/database-search.js";
2
4
  import { service_exports } from "./service.js";
3
5
  import { runtime_exports } from "./runtime.js";
@@ -15,7 +17,8 @@ var inject = [
15
17
  "agents",
16
18
  "storageDomain",
17
19
  "commands",
18
- "skills"
20
+ "skills",
21
+ "agentPresets"
19
22
  ];
20
23
  var Config = Schema.object({ dataSource: Schema.object({
21
24
  driver: Schema.union([
@@ -41,6 +44,13 @@ async function apply(ctx, config) {
41
44
  ctx.effect(() => () => database.close());
42
45
  ctx.on("loader/volatile-update", () => database.refresh());
43
46
  await ctx.plugin(toolsPlugin, { database });
47
+ const preset = ctx.agentPresets.register({
48
+ id: PLAN_PRESET_ID,
49
+ name: "表单布局规划",
50
+ plugins: [{ name: `${package_default.name}/plan` }]
51
+ });
52
+ ctx.effect(() => async () => (await preset)());
53
+ await preset;
44
54
  await ctx.plugin(tool_access_exports);
45
55
  await ctx.plugin(design_state_exports);
46
56
  await ctx.plugin(listenersPlugin);
@@ -1,7 +1,7 @@
1
1
  import { getDesignScope, getSpecIndex } from "./context.js";
2
2
  import { renderPrompt } from "./render.js";
3
- import { z } from "zod";
4
3
  import { readFile } from "node:fs/promises";
4
+ import { z } from "zod";
5
5
  import matter from "gray-matter";
6
6
  //#region src/prompt/guide.ts
7
7
  var FORM_SKILL_NAME = "ad-form";
@@ -1,6 +1,6 @@
1
1
  import { __exportAll } from "./_virtual/_rolldown/runtime.js";
2
- import { isSubagentCaller } from "./state/session.js";
3
2
  import { FORM_TOOL_NAMES, TOOL_NAMES } from "./tools/catalog.js";
3
+ import { isSubagentCaller } from "./state/session.js";
4
4
  //#region src/tool-access.ts
5
5
  var tool_access_exports = /* @__PURE__ */ __exportAll({
6
6
  apply: () => apply,
@@ -1,7 +1,7 @@
1
1
  import { __exportAll } from "../../_virtual/_rolldown/runtime.js";
2
+ import { TOOL_NAMES } from "../catalog.js";
2
3
  import { SERVICE_NAME } from "../../state/constants.js";
3
4
  import "../../service.js";
4
- import { TOOL_NAMES } from "../catalog.js";
5
5
  import { buildCompletionCheckPrompt } from "../../prompt/completion-check.js";
6
6
  import { COMPLETE_TASK_OUTPUT_SPEC, COMPLETE_TASK_PARAM_SPEC } from "./schema.js";
7
7
  import { executeCompleteTask, renderCompleteTask } from "./execute.js";
@@ -1,5 +1,5 @@
1
- import { pickNonEmpty } from "../../util/json.js";
2
1
  import { renderPlanText } from "../../plan/build-plan.js";
2
+ import { pickNonEmpty } from "../../util/json.js";
3
3
  import { renderPlanConfirmation } from "../../plan/render-plan-confirmation.js";
4
4
  import { createSkeleton } from "../../plan/skeleton.js";
5
5
  //#region src/tools/confirm-plan/execute.ts
@@ -1,7 +1,7 @@
1
1
  import { __exportAll } from "../../_virtual/_rolldown/runtime.js";
2
+ import { TOOL_NAMES } from "../catalog.js";
2
3
  import { SERVICE_NAME } from "../../state/constants.js";
3
4
  import "../../service.js";
4
- import { TOOL_NAMES } from "../catalog.js";
5
5
  import { CONFIRM_PLAN_OUTPUT_SPEC, CONFIRM_PLAN_PARAM_SPEC } from "./schema.js";
6
6
  import { executeConfirmPlan, renderConfirmPlan } from "./execute.js";
7
7
  import { defineTool } from "@deepseek-ai/dsh-tools";
@@ -1,7 +1,7 @@
1
1
  import { __exportAll } from "../../_virtual/_rolldown/runtime.js";
2
+ import { TOOL_NAMES } from "../catalog.js";
2
3
  import { SERVICE_NAME } from "../../state/constants.js";
3
4
  import "../../service.js";
4
- import { TOOL_NAMES } from "../catalog.js";
5
5
  import { CREATE_TASK_OUTPUT_SPEC, CREATE_TASK_PARAM_SPEC } from "./schema.js";
6
6
  import { executeCreateTask, renderCreateTask } from "./execute.js";
7
7
  import { defineTool } from "@deepseek-ai/dsh-tools";
@@ -1,9 +1,9 @@
1
1
  import { __exportAll } from "../../_virtual/_rolldown/runtime.js";
2
+ import { renderPlanText } from "../../plan/build-plan.js";
3
+ import { TOOL_NAMES } from "../catalog.js";
2
4
  import { SERVICE_NAME } from "../../state/constants.js";
3
5
  import "../../service.js";
4
- import { TOOL_NAMES } from "../catalog.js";
5
6
  import { renderTaskState, taskSnapshot } from "../../state/task-view.js";
6
- import { renderPlanText } from "../../plan/build-plan.js";
7
7
  import { summarizeIr } from "../../ir/query.js";
8
8
  import { GET_DESIGN_STATE_OUTPUT_SPEC, GET_DESIGN_STATE_PARAM_SPEC } from "./schema.js";
9
9
  import { defineTool } from "@deepseek-ai/dsh-tools";
@@ -1,7 +1,7 @@
1
1
  import { __exportAll } from "../../_virtual/_rolldown/runtime.js";
2
+ import { TOOL_NAMES } from "../catalog.js";
2
3
  import { workspaceDirectory } from "../../state/session.js";
3
4
  import "../../service.js";
4
- import { TOOL_NAMES } from "../catalog.js";
5
5
  import { stripUndefinedDeep } from "../../util/json.js";
6
6
  import { createRipgrepRun } from "../../entity/rg.js";
7
7
  import { readEntityAttributes } from "../../entity/retrieve.js";
@@ -1,7 +1,7 @@
1
1
  import { __exportAll } from "../../_virtual/_rolldown/runtime.js";
2
+ import { TOOL_NAMES } from "../catalog.js";
2
3
  import { SERVICE_NAME } from "../../state/constants.js";
3
4
  import "../../service.js";
4
- import { TOOL_NAMES } from "../catalog.js";
5
5
  import { GET_CURRENT_IR_OUTPUT_SPEC, GET_CURRENT_IR_PARAM_SPEC } from "./schema.js";
6
6
  import { executeGetIr } from "./execute.js";
7
7
  import { defineTool } from "@deepseek-ai/dsh-tools";
@@ -1,7 +1,7 @@
1
1
  import { assertSchemaValid } from "../../validate/util.js";
2
2
  import { parseXmlDesign } from "../../converter/import-design.js";
3
- import { resolve } from "node:path";
4
3
  import { readFile } from "node:fs/promises";
4
+ import { resolve } from "node:path";
5
5
  //#region src/tools/import-design/execute.ts
6
6
  function renderImportDesign(_args, value) {
7
7
  return [{
@@ -1,7 +1,7 @@
1
1
  import { __exportAll } from "../../_virtual/_rolldown/runtime.js";
2
+ import { TOOL_NAMES } from "../catalog.js";
2
3
  import { SERVICE_NAME } from "../../state/constants.js";
3
4
  import "../../service.js";
4
- import { TOOL_NAMES } from "../catalog.js";
5
5
  import { IMPORT_DESIGN_OUTPUT_SPEC, IMPORT_DESIGN_PARAM_SPEC } from "./schema.js";
6
6
  import { executeImportDesign, renderImportDesign } from "./execute.js";
7
7
  import { defineTool } from "@deepseek-ai/dsh-tools";
@@ -1,7 +1,7 @@
1
1
  import { __exportAll } from "../../_virtual/_rolldown/runtime.js";
2
+ import { TOOL_NAMES } from "../catalog.js";
2
3
  import { SERVICE_NAME } from "../../state/constants.js";
3
4
  import "../../service.js";
4
- import { TOOL_NAMES } from "../catalog.js";
5
5
  import { RUN_PLAN_SUBAGENT_OUTPUT_SPEC, RUN_PLAN_SUBAGENT_PARAM_SPEC } from "./schema.js";
6
6
  import { executeRunPlanSubagent, renderRunPlanSubagent } from "./execute.js";
7
7
  import { defineTool } from "@deepseek-ai/dsh-tools";
@@ -1,6 +1,6 @@
1
1
  import { __exportAll } from "../../_virtual/_rolldown/runtime.js";
2
- import { errorText, registerDatabaseSearchTool } from "../../util/database-search.js";
3
2
  import { TOOL_NAMES } from "../catalog.js";
3
+ import { errorText, registerDatabaseSearchTool } from "../../util/database-search.js";
4
4
  import { createDataSourceRegistry, isDataSourceId } from "../../data-source/registry.js";
5
5
  import "../../data-source/index.js";
6
6
  import { clampSearchLimit } from "../../util/search-limit.js";
@@ -1,6 +1,6 @@
1
1
  import { __exportAll } from "../../_virtual/_rolldown/runtime.js";
2
- import { errorText, registerDatabaseSearchTool } from "../../util/database-search.js";
3
2
  import { TOOL_NAMES } from "../catalog.js";
3
+ import { errorText, registerDatabaseSearchTool } from "../../util/database-search.js";
4
4
  import { clampSearchLimit } from "../../util/search-limit.js";
5
5
  import { createDictionaryRegistry } from "../../dictionary/registry.js";
6
6
  import "../../dictionary/index.js";
@@ -1,7 +1,7 @@
1
1
  import { __exportAll } from "../../_virtual/_rolldown/runtime.js";
2
+ import { TOOL_NAMES } from "../catalog.js";
2
3
  import { workspaceDirectory } from "../../state/session.js";
3
4
  import "../../service.js";
4
- import { TOOL_NAMES } from "../catalog.js";
5
5
  import { stripUndefinedDeep } from "../../util/json.js";
6
6
  import { createRipgrepRun } from "../../entity/rg.js";
7
7
  import { searchEntities } from "../../entity/retrieve.js";
@@ -1,7 +1,7 @@
1
1
  import { __exportAll } from "../../_virtual/_rolldown/runtime.js";
2
+ import { TOOL_NAMES } from "../catalog.js";
2
3
  import { workspaceDirectory } from "../../state/session.js";
3
4
  import "../../service.js";
4
- import { TOOL_NAMES } from "../catalog.js";
5
5
  import { createRipgrepRun } from "../../entity/rg.js";
6
6
  import "../../entity/index.js";
7
7
  import { clampSearchLimit } from "../../util/search-limit.js";
@@ -1,7 +1,7 @@
1
1
  import { __exportAll } from "../../_virtual/_rolldown/runtime.js";
2
+ import { TOOL_NAMES } from "../catalog.js";
2
3
  import { SERVICE_NAME } from "../../state/constants.js";
3
4
  import "../../service.js";
4
- import { TOOL_NAMES } from "../catalog.js";
5
5
  import { START_NEW_DESIGN_OUTPUT_SPEC, START_NEW_DESIGN_PARAM_SPEC } from "./schema.js";
6
6
  import { defineTool } from "@deepseek-ai/dsh-tools";
7
7
  //#region src/tools/start-new-design/index.ts
@@ -1,7 +1,7 @@
1
1
  import { __exportAll } from "../../_virtual/_rolldown/runtime.js";
2
+ import { TOOL_NAMES } from "../catalog.js";
2
3
  import { SERVICE_NAME } from "../../state/constants.js";
3
4
  import "../../service.js";
4
- import { TOOL_NAMES } from "../catalog.js";
5
5
  import { UPDATE_IR_OUTPUT_SPEC, UPDATE_IR_PARAM_SPEC } from "./schema.js";
6
6
  import { executeUpdateIr, renderUpdateIr } from "./execute.js";
7
7
  import { defineTool } from "@deepseek-ai/dsh-tools";
@@ -1,7 +1,7 @@
1
1
  import { __exportAll } from "../../_virtual/_rolldown/runtime.js";
2
+ import { TOOL_NAMES } from "../catalog.js";
2
3
  import { SERVICE_NAME } from "../../state/constants.js";
3
4
  import "../../service.js";
4
- import { TOOL_NAMES } from "../catalog.js";
5
5
  import { UPDATE_TASK_OUTPUT_SPEC, UPDATE_TASK_PARAM_SPEC } from "./schema.js";
6
6
  import { executeUpdateTask, renderUpdateTask } from "./execute.js";
7
7
  import { defineTool } from "@deepseek-ai/dsh-tools";
@@ -1,6 +1,6 @@
1
1
  import { __exportAll } from "../../_virtual/_rolldown/runtime.js";
2
- import { validateIrWithSchema } from "../../validate/ir.js";
3
2
  import { TOOL_NAMES } from "../catalog.js";
3
+ import { validateIrWithSchema } from "../../validate/ir.js";
4
4
  import { createSkeleton } from "../../plan/skeleton.js";
5
5
  import { VALIDATE_PLAN_OUTPUT_SPEC, VALIDATE_PLAN_PARAM_SPEC } from "./schema.js";
6
6
  import { defineTool } from "@deepseek-ai/dsh-tools";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@12inch-glorysoft/dsh-ad-form",
3
- "version": "1.0.0-beta.1",
3
+ "version": "1.0.0-beta.2",
4
4
  "description": "DSH 表单设计插件:根据需求与参考图生成表单,支持数据源、字典及实体检索",
5
5
  "keywords": [
6
6
  "ad-form",
@@ -23,14 +23,18 @@
23
23
  "development": "./src/plugin.ts",
24
24
  "default": "./dist/server/plugin.js"
25
25
  },
26
- "./client": "./dist/client/client.js"
26
+ "./client": "./dist/client/client.js",
27
+ "./plan": {
28
+ "development": "./src/agents/plan-preset.ts",
29
+ "default": "./dist/server/agents/plan-preset.js"
30
+ }
27
31
  },
28
32
  "publishConfig": {
29
33
  "access": "public",
30
34
  "registry": "https://registry.npmjs.org/"
31
35
  },
32
36
  "dependencies": {
33
- "@deepseek-ai/schemastery": "^3.18.4",
37
+ "@deepseek-ai/schemastery": "~3.18.5",
34
38
  "@types/lodash-es": "^4.17.12",
35
39
  "@vscode/ripgrep": "^1.18.0",
36
40
  "ajv": "^8.20.0",
@@ -41,37 +45,38 @@
41
45
  "lodash-es": "^4.18.1",
42
46
  "oracledb": "^26.0.0",
43
47
  "yaml": "^2.9.1",
44
- "zod": "^4.6.4"
48
+ "zod": "4.4.3"
45
49
  },
46
50
  "devDependencies": {
47
- "@deepseek-ai/cordis": "~4.0.4",
48
- "@deepseek-ai/cordis-plugin-group": "1.0.4",
49
- "@deepseek-ai/cordis-plugin-include": "1.0.9",
50
- "@deepseek-ai/cordis-plugin-loader": "1.0.5",
51
- "@deepseek-ai/dsh-agent": "0.2.0-rc.2",
52
- "@deepseek-ai/dsh-app-boot": "0.2.0-rc.2",
53
- "@deepseek-ai/dsh-client-ui-plugin-manager": "0.2.0-rc.2",
54
- "@deepseek-ai/dsh-client-ui-primitives": "0.2.0-rc.2",
55
- "@deepseek-ai/dsh-client-ui-renderer": "0.2.0-rc.2",
56
- "@deepseek-ai/dsh-client-ui-settings": "0.2.0-rc.2",
57
- "@deepseek-ai/dsh-client-ui-slots": "0.2.0-rc.2",
58
- "@deepseek-ai/dsh-commands": "0.2.0-rc.2",
59
- "@deepseek-ai/dsh-config-editor": "0.2.0-rc.2",
60
- "@deepseek-ai/dsh-llm": "0.2.0-rc.2",
61
- "@deepseek-ai/dsh-scope": "0.2.0-rc.2",
62
- "@deepseek-ai/dsh-session": "0.2.0-rc.2",
63
- "@deepseek-ai/dsh-settings": "0.2.0-rc.2",
64
- "@deepseek-ai/dsh-skill": "0.2.0-rc.2",
65
- "@deepseek-ai/dsh-storage": "0.2.0-rc.2",
66
- "@deepseek-ai/dsh-storage-domain": "0.2.0-rc.2",
67
- "@deepseek-ai/dsh-storage-json": "0.2.0-rc.2",
68
- "@deepseek-ai/dsh-subagent": "0.2.0-rc.2",
69
- "@deepseek-ai/dsh-subprocess": "0.2.0-rc.2",
70
- "@deepseek-ai/dsh-system-prompt": "0.2.0-rc.2",
71
- "@deepseek-ai/dsh-tool-skill": "0.2.0-rc.2",
72
- "@deepseek-ai/dsh-tool-todo": "0.2.0-rc.2",
73
- "@deepseek-ai/dsh-tools": "0.2.0-rc.2",
74
- "@deepseek-ai/dsh-user-questions": "0.2.0-rc.2",
51
+ "@deepseek-ai/cordis": "~4.0.5",
52
+ "@deepseek-ai/cordis-plugin-group": "1.0.5",
53
+ "@deepseek-ai/cordis-plugin-include": "1.0.10",
54
+ "@deepseek-ai/cordis-plugin-loader": "1.0.6",
55
+ "@deepseek-ai/dsh-agent": "0.2.1-rc.5",
56
+ "@deepseek-ai/dsh-agent-preset-registry": "0.2.1-rc.5",
57
+ "@deepseek-ai/dsh-app-boot": "0.2.1-rc.5",
58
+ "@deepseek-ai/dsh-client-ui-plugin-manager": "0.2.1-rc.5",
59
+ "@deepseek-ai/dsh-client-ui-primitives": "0.2.1-rc.5",
60
+ "@deepseek-ai/dsh-client-ui-renderer": "0.2.1-rc.5",
61
+ "@deepseek-ai/dsh-client-ui-settings": "0.2.1-rc.5",
62
+ "@deepseek-ai/dsh-client-ui-slots": "0.2.1-rc.5",
63
+ "@deepseek-ai/dsh-commands": "0.2.1-rc.5",
64
+ "@deepseek-ai/dsh-config-editor": "0.2.1-rc.5",
65
+ "@deepseek-ai/dsh-llm": "0.2.1-rc.5",
66
+ "@deepseek-ai/dsh-scope": "0.2.1-rc.5",
67
+ "@deepseek-ai/dsh-session": "0.2.1-rc.5",
68
+ "@deepseek-ai/dsh-settings": "0.2.1-rc.5",
69
+ "@deepseek-ai/dsh-skill": "0.2.1-rc.5",
70
+ "@deepseek-ai/dsh-storage": "0.2.1-rc.5",
71
+ "@deepseek-ai/dsh-storage-domain": "0.2.1-rc.5",
72
+ "@deepseek-ai/dsh-storage-json": "0.2.1-rc.5",
73
+ "@deepseek-ai/dsh-subagent": "0.2.1-rc.5",
74
+ "@deepseek-ai/dsh-subprocess": "0.2.1-rc.5",
75
+ "@deepseek-ai/dsh-system-prompt": "0.2.1-rc.5",
76
+ "@deepseek-ai/dsh-tool-skill": "0.2.1-rc.5",
77
+ "@deepseek-ai/dsh-tool-todo": "0.2.1-rc.5",
78
+ "@deepseek-ai/dsh-tools": "0.2.1-rc.5",
79
+ "@deepseek-ai/dsh-user-questions": "0.2.1-rc.5",
75
80
  "@types/node": "^26.6.2",
76
81
  "@types/react": "18.3.31",
77
82
  "@types/react-dom": "18.3.7",
@@ -86,26 +91,27 @@
86
91
  "vitest": "^5.0.3"
87
92
  },
88
93
  "peerDependencies": {
89
- "@deepseek-ai/cordis": "~4.0.4",
90
- "@deepseek-ai/cordis-plugin-loader": "1.0.5",
91
- "@deepseek-ai/dsh-agent": "0.2.0-rc.2",
92
- "@deepseek-ai/dsh-client-ui-plugin-manager": "0.2.0-rc.2",
93
- "@deepseek-ai/dsh-client-ui-primitives": "0.2.0-rc.2",
94
- "@deepseek-ai/dsh-client-ui-settings": "0.2.0-rc.2",
95
- "@deepseek-ai/dsh-client-ui-slots": "0.2.0-rc.2",
96
- "@deepseek-ai/dsh-commands": "0.2.0-rc.2",
97
- "@deepseek-ai/dsh-llm": "0.2.0-rc.2",
98
- "@deepseek-ai/dsh-scope": "0.2.0-rc.2",
99
- "@deepseek-ai/dsh-session": "0.2.0-rc.2",
100
- "@deepseek-ai/dsh-settings": "0.2.0-rc.2",
101
- "@deepseek-ai/dsh-skill": "0.2.0-rc.2",
102
- "@deepseek-ai/dsh-storage-domain": "0.2.0-rc.2",
103
- "@deepseek-ai/dsh-subagent": "0.2.0-rc.2",
104
- "@deepseek-ai/dsh-subprocess": "0.2.0-rc.2",
105
- "@deepseek-ai/dsh-system-prompt": "0.2.0-rc.2",
106
- "@deepseek-ai/dsh-tool-todo": "0.2.0-rc.2",
107
- "@deepseek-ai/dsh-tools": "0.2.0-rc.2",
108
- "@deepseek-ai/dsh-user-questions": "0.2.0-rc.2",
94
+ "@deepseek-ai/cordis": "~4.0.5",
95
+ "@deepseek-ai/cordis-plugin-loader": "1.0.6",
96
+ "@deepseek-ai/dsh-agent": "0.2.1-rc.5",
97
+ "@deepseek-ai/dsh-agent-preset-registry": "0.2.1-rc.5",
98
+ "@deepseek-ai/dsh-client-ui-plugin-manager": "0.2.1-rc.5",
99
+ "@deepseek-ai/dsh-client-ui-primitives": "0.2.1-rc.5",
100
+ "@deepseek-ai/dsh-client-ui-settings": "0.2.1-rc.5",
101
+ "@deepseek-ai/dsh-client-ui-slots": "0.2.1-rc.5",
102
+ "@deepseek-ai/dsh-commands": "0.2.1-rc.5",
103
+ "@deepseek-ai/dsh-llm": "0.2.1-rc.5",
104
+ "@deepseek-ai/dsh-scope": "0.2.1-rc.5",
105
+ "@deepseek-ai/dsh-session": "0.2.1-rc.5",
106
+ "@deepseek-ai/dsh-settings": "0.2.1-rc.5",
107
+ "@deepseek-ai/dsh-skill": "0.2.1-rc.5",
108
+ "@deepseek-ai/dsh-storage-domain": "0.2.1-rc.5",
109
+ "@deepseek-ai/dsh-subagent": "0.2.1-rc.5",
110
+ "@deepseek-ai/dsh-subprocess": "0.2.1-rc.5",
111
+ "@deepseek-ai/dsh-system-prompt": "0.2.1-rc.5",
112
+ "@deepseek-ai/dsh-tool-todo": "0.2.1-rc.5",
113
+ "@deepseek-ai/dsh-tools": "0.2.1-rc.5",
114
+ "@deepseek-ai/dsh-user-questions": "0.2.1-rc.5",
109
115
  "react": "18.3.1"
110
116
  },
111
117
  "engines": {