From 2cca8fcb7d4892860a2e293a184670552330c13e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=BA=B7?= Date: Tue, 28 Jul 2026 14:56:23 +0800 Subject: [PATCH 1/3] merge --- Dockerfile | 19 +++++ .../work/review/experience-draft.json | 77 ++++++++++++++++++ .../work/review/semantic-batch.json | 81 +++++++++++++++++++ docker-compose.yml | 18 +++++ dockerignore | 8 ++ 5 files changed, 203 insertions(+) create mode 100644 Dockerfile create mode 100644 cad-experience-plugin/work/review/experience-draft.json create mode 100644 cad-experience-plugin/work/review/semantic-batch.json create mode 100644 docker-compose.yml create mode 100644 dockerignore diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..8c150ce --- /dev/null +++ b/Dockerfile @@ -0,0 +1,19 @@ +FROM node:22-bookworm-slim + +WORKDIR /app + +COPY text-to-cad ./text-to-cad + +RUN cd text-to-cad/viewer && npm install +RUN cd text-to-cad/apps/cad-agent-studio && npm install && npm run build + +ENV NODE_ENV=production +ENV HOSTNAME=0.0.0.0 +ENV PORT=3000 + +EXPOSE 3000 + +CMD ["sh", "-lc", "cd /app/text-to-cad/apps/cad-agent-studio && npm run start -- -H 0.0.0.0 -p ${PORT}"] + + + diff --git a/cad-experience-plugin/work/review/experience-draft.json b/cad-experience-plugin/work/review/experience-draft.json new file mode 100644 index 0000000..bf1dbc1 --- /dev/null +++ b/cad-experience-plugin/work/review/experience-draft.json @@ -0,0 +1,77 @@ +{ + "schema_version": "1.0", + "draft_kind": "llm_generalized_experience_proposals", + "proposals": [ + { + "id": "motif.rotational_part.coaxial_core_with_center_passage", + "kind": "feature_motif", + "scope": ["rotational_part"], + "evidence_query": { + "required_features": [ + "rotational_body", + "coaxial_cylindrical_stack", + "central_passage" + ], + "required_relations": [ + "coaxial_stack", + "dominant_axis_alignment" + ] + }, + "guidance": "Treat the rotational body, coaxial cylindrical stack, and central passage as one shared-axis core.", + "semantic_rationale": "The relationship transfers because the participating roles describe axis organization rather than a particular size.", + "check": "Confirm that the rotational body, stacked cylindrical roles, and central passage retain their intended common axis." + }, + { + "id": "motif.rotational_part.patterned_axial_mounting", + "kind": "feature_motif", + "scope": ["rotational_part"], + "evidence_query": { + "required_features": [ + "rotational_body", + "repeated_axial_hole_pattern" + ], + "required_relations": [ + "repeated_radius_group" + ] + }, + "guidance": "Represent repeated axial holes as a symmetric mounting pattern tied to the rotational body.", + "semantic_rationale": "The motif remains useful across variants because it captures repeated functional placement around a rotational form.", + "check": "Confirm that repeated axial holes remain grouped consistently around the rotational body." + }, + { + "id": "constraint.rotational_part.shared_dominant_axis", + "kind": "constraint", + "scope": ["rotational_part"], + "evidence_query": { + "required_features": [ + "rotational_body", + "coaxial_cylindrical_stack" + ], + "required_relations": [ + "dominant_axis_alignment" + ] + }, + "guidance": "Preserve the dominant axis as the organizing datum for rotational feature roles.", + "semantic_rationale": "The datum transfers because axis alignment is independent of the individual component dimensions.", + "check": "Confirm that rotational feature roles remain aligned to the same organizing datum." + }, + { + "id": "validation.rotational_part.axis_and_pattern_consistency", + "kind": "validation_rule", + "scope": ["rotational_part"], + "evidence_query": { + "required_features": [ + "central_passage", + "repeated_axial_hole_pattern" + ], + "required_relations": [ + "dominant_axis_alignment", + "repeated_radius_group" + ] + }, + "guidance": "Validate both the shared rotational axis and the grouped repeated-hole relationship before handoff.", + "semantic_rationale": "These checks protect transferable intent without relying on instance geometry.", + "check": "Confirm shared-axis alignment and repeated-hole grouping before treating the model as ready." + } + ] +} diff --git a/cad-experience-plugin/work/review/semantic-batch.json b/cad-experience-plugin/work/review/semantic-batch.json new file mode 100644 index 0000000..55f6b7d --- /dev/null +++ b/cad-experience-plugin/work/review/semantic-batch.json @@ -0,0 +1,81 @@ +{ + "schema_version": "1.0", + "batch_kind": "sanitized_cad_semantic_review", + "guardrails": { + "contains_instance_dimensions": false, + "contains_absolute_coordinates": false, + "llm_must_propose_methods_not_copy_answers": true, + "proposals_require_deterministic_evidence_verification": true + }, + "corpus_summary": { + "case_count": 2, + "family_count": 1 + }, + "cases": [ + { + "anonymous_case": "case_000001", + "family": "rotational_part", + "features": [ + "central_passage", + "coaxial_cylindrical_stack", + "multi_axis_passage", + "repeated_axial_hole_pattern", + "rotational_body" + ], + "relations": [ + "coaxial_stack", + "dominant_axis_alignment", + "repeated_radius_group" + ], + "candidate_rules": [], + "validation_targets": [], + "dimensionless_observation_roles": [] + }, + { + "anonymous_case": "case_000002", + "family": "rotational_part", + "features": [ + "central_passage", + "coaxial_cylindrical_stack", + "repeated_axial_hole_pattern", + "rotational_body" + ], + "relations": [ + "coaxial_stack", + "dominant_axis_alignment", + "repeated_radius_group" + ], + "candidate_rules": [], + "validation_targets": [], + "dimensionless_observation_roles": [] + } + ], + "existing_vocabulary": { + "promoted_ids": [], + "candidate_ids": [ + "constraint.flanged_hub_adapter.pattern_radius_consistency", + "constraint.flanged_hub_adapter.shared_dominant_axis", + "constraint.flanged_hub_adapter.transition_axis_continuity", + "motif.flanged_hub_adapter.rotational_core_with_patterned_mounting", + "validation.flanged_hub_adapter.rotational_relationships" + ] + }, + "draft_contract": { + "draft_kind": "llm_generalized_experience_proposals", + "proposal_required_fields": [ + "id", + "kind", + "scope", + "evidence_query", + "guidance", + "semantic_rationale" + ], + "allowed_kinds": [ + "feature_motif", + "constraint", + "design_rule", + "validation_rule", + "failure_repair" + ] + } +} diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..7a97c2c --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,18 @@ +services: + cad-agent-studio: + build: + context: . + dockerfile: Dockerfile + container_name: cad-agent-studio + restart: unless-stopped + environment: + NODE_ENV: production + PORT: 3000 + DEEPSEEK_API_KEY: ${DEEPSEEK_API_KEY} + ports: + - "127.0.0.1:53821:3000" + volumes: + - ./text-to-cad/models/agent-studio:/app/text-to-cad/models/agent-studio + + + diff --git a/dockerignore b/dockerignore new file mode 100644 index 0000000..b599654 --- /dev/null +++ b/dockerignore @@ -0,0 +1,8 @@ +.git +**/node_modules +**/.next +**/dist +**/.DS_Store + + + From 51bb84c378a1af8c7c3416de597870d2fe4ba3f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=BA=B7?= Date: Tue, 28 Jul 2026 15:01:24 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E4=BF=AE=E6=94=B9dockerfile?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Dockerfile | 33 +++++++++++++++++++++++++++++---- 1 file changed, 29 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index 8c150ce..f7fdc65 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,8 +2,36 @@ FROM node:22-bookworm-slim WORKDIR /app +RUN sed -i \ + -e 's|http://deb.debian.org/debian|http://mirrors.aliyun.com/debian|g' \ + -e 's|http://deb.debian.org/debian-security|http://mirrors.aliyun.com/debian-security|g' \ + /etc/apt/sources.list.d/debian.sources \ + && apt-get update \ + && apt-get install -y --no-install-recommends \ + ca-certificates \ + python3 \ + python3-pip \ + python3-venv \ + libgl1 \ + libglib2.0-0 \ + fontconfig \ + && rm -rf /var/lib/apt/lists/* + +RUN npm config set registry https://registry.npmmirror.com + +RUN python3 -m pip install \ + --break-system-packages \ + --no-cache-dir \ + -i https://pypi.tuna.tsinghua.edu.cn/simple \ + build123d + COPY text-to-cad ./text-to-cad +RUN rm -rf text-to-cad/viewer/packages/cadjs \ + && cp -R text-to-cad/packages/cadjs text-to-cad/viewer/packages/cadjs \ + && rm -rf text-to-cad/viewer/packages/implicitjs \ + && cp -R text-to-cad/packages/implicitjs text-to-cad/viewer/packages/implicitjs + RUN cd text-to-cad/viewer && npm install RUN cd text-to-cad/apps/cad-agent-studio && npm install && npm run build @@ -13,7 +41,4 @@ ENV PORT=3000 EXPOSE 3000 -CMD ["sh", "-lc", "cd /app/text-to-cad/apps/cad-agent-studio && npm run start -- -H 0.0.0.0 -p ${PORT}"] - - - +CMD ["sh", "-lc", "cd /app/text-to-cad/apps/cad-agent-studio && npm run start -- -H 0.0.0.0 -p ${PORT}"] \ No newline at end of file From 4572803e72736e91d53322cd4267cb1fe07b296d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=BA=B7?= Date: Tue, 28 Jul 2026 15:24:43 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E4=BF=AE=E6=94=B9dockerfile?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Dockerfile | 31 +++++++++++++++++++------------ cad-agent-studio/next.config.ts | 2 ++ docker-compose.yml | 10 ++++++---- 3 files changed, 27 insertions(+), 16 deletions(-) diff --git a/Dockerfile b/Dockerfile index f7fdc65..aa53c1b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,6 +2,14 @@ FROM node:22-bookworm-slim WORKDIR /app +ENV NODE_ENV=production +ENV HOSTNAME=0.0.0.0 +ENV PORT=3000 +ENV CAD_AGENT_STUDIO_ROOT=/app/cad-agent-studio +ENV CAD_ENGINE_ROOT=/app/text-to-cad +ENV CAD_AGENT_STUDIO_CONFIG=/app/cad-agent-studio/config/llm.config.yaml +ENV PYTHONPATH=/app/text-to-cad/packages/cadpy/src + RUN sed -i \ -e 's|http://deb.debian.org/debian|http://mirrors.aliyun.com/debian|g' \ -e 's|http://deb.debian.org/debian-security|http://mirrors.aliyun.com/debian-security|g' \ @@ -14,7 +22,14 @@ RUN sed -i \ python3-venv \ libgl1 \ libglib2.0-0 \ + libxrender1 \ + libxext6 \ + libsm6 \ + libice6 \ + libfontconfig1 \ fontconfig \ + fonts-dejavu-core \ + libgomp1 \ && rm -rf /var/lib/apt/lists/* RUN npm config set registry https://registry.npmmirror.com @@ -26,19 +41,11 @@ RUN python3 -m pip install \ build123d COPY text-to-cad ./text-to-cad +COPY cad-agent-studio ./cad-agent-studio -RUN rm -rf text-to-cad/viewer/packages/cadjs \ - && cp -R text-to-cad/packages/cadjs text-to-cad/viewer/packages/cadjs \ - && rm -rf text-to-cad/viewer/packages/implicitjs \ - && cp -R text-to-cad/packages/implicitjs text-to-cad/viewer/packages/implicitjs - -RUN cd text-to-cad/viewer && npm install -RUN cd text-to-cad/apps/cad-agent-studio && npm install && npm run build - -ENV NODE_ENV=production -ENV HOSTNAME=0.0.0.0 -ENV PORT=3000 +RUN cd cad-agent-studio && npm install --include=dev --no-audit --no-fund +RUN cd cad-agent-studio && npm run build EXPOSE 3000 -CMD ["sh", "-lc", "cd /app/text-to-cad/apps/cad-agent-studio && npm run start -- -H 0.0.0.0 -p ${PORT}"] \ No newline at end of file +CMD ["sh", "-lc", "cd /app/cad-agent-studio && npm run start -- -H 0.0.0.0 -p ${PORT}"] diff --git a/cad-agent-studio/next.config.ts b/cad-agent-studio/next.config.ts index dc78103..07f0500 100644 --- a/cad-agent-studio/next.config.ts +++ b/cad-agent-studio/next.config.ts @@ -9,6 +9,7 @@ const nextConfig: NextConfig = { transpilePackages: ["cadjs", "three", "three-mesh-bvh"], turbopack: { resolveAlias: { + "@": "./src", cadjs: "./src/viewer-cadjs", three: "./node_modules/three", "three/examples": "./node_modules/three/examples", @@ -21,6 +22,7 @@ const nextConfig: NextConfig = { config.resolve = config.resolve || {}; config.resolve.alias = { ...(config.resolve.alias || {}), + "@": path.join(appRoot, "src"), cadjs: cadJsSrc, three: path.join(appRoot, "node_modules", "three"), "three/examples": path.join(appRoot, "node_modules", "three", "examples"), diff --git a/docker-compose.yml b/docker-compose.yml index 7a97c2c..a70c69e 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -9,10 +9,12 @@ services: NODE_ENV: production PORT: 3000 DEEPSEEK_API_KEY: ${DEEPSEEK_API_KEY} + CAD_AGENT_STUDIO_ROOT: /app/cad-agent-studio + CAD_ENGINE_ROOT: /app/text-to-cad + CAD_AGENT_STUDIO_CONFIG: /app/cad-agent-studio/config/llm.config.yaml + PYTHONPATH: /app/text-to-cad/packages/cadpy/src ports: - "127.0.0.1:53821:3000" volumes: - - ./text-to-cad/models/agent-studio:/app/text-to-cad/models/agent-studio - - - + - ./cad-agent-studio/models/agent-studio:/app/cad-agent-studio/models/agent-studio + - ./cad-agent-studio/config/llm.config.yaml:/app/cad-agent-studio/config/llm.config.yaml:ro \ No newline at end of file