cad-server 0.10.0__tar.gz

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 (252) hide show
  1. cad_server-0.10.0/LICENSE +21 -0
  2. cad_server-0.10.0/PKG-INFO +156 -0
  3. cad_server-0.10.0/README.md +130 -0
  4. cad_server-0.10.0/pyproject.toml +72 -0
  5. cad_server-0.10.0/setup.cfg +4 -0
  6. cad_server-0.10.0/src/cad_server/__init__.py +54 -0
  7. cad_server-0.10.0/src/cad_server/_internal/__init__.py +1 -0
  8. cad_server-0.10.0/src/cad_server/_internal/api.py +19 -0
  9. cad_server-0.10.0/src/cad_server/_internal/apps.py +319 -0
  10. cad_server-0.10.0/src/cad_server/_internal/attach.py +67 -0
  11. cad_server-0.10.0/src/cad_server/_internal/base.py +682 -0
  12. cad_server-0.10.0/src/cad_server/_internal/channel.py +165 -0
  13. cad_server-0.10.0/src/cad_server/_internal/cli_errors.py +91 -0
  14. cad_server-0.10.0/src/cad_server/_internal/cli_from_function.py +489 -0
  15. cad_server-0.10.0/src/cad_server/_internal/editable.py +43 -0
  16. cad_server-0.10.0/src/cad_server/_internal/engine_daemon.py +6 -0
  17. cad_server-0.10.0/src/cad_server/_internal/engine_host.py +82 -0
  18. cad_server-0.10.0/src/cad_server/_internal/engine_telemetry.py +206 -0
  19. cad_server-0.10.0/src/cad_server/_internal/extras.py +577 -0
  20. cad_server-0.10.0/src/cad_server/_internal/file_lock.py +70 -0
  21. cad_server-0.10.0/src/cad_server/_internal/installations.py +637 -0
  22. cad_server-0.10.0/src/cad_server/_internal/kernel_load_hint.py +125 -0
  23. cad_server-0.10.0/src/cad_server/_internal/launch.py +48 -0
  24. cad_server-0.10.0/src/cad_server/_internal/leftovers.py +391 -0
  25. cad_server-0.10.0/src/cad_server/_internal/picker.py +127 -0
  26. cad_server-0.10.0/src/cad_server/_internal/plugin.py +388 -0
  27. cad_server-0.10.0/src/cad_server/_internal/primitive_mesh.py +245 -0
  28. cad_server-0.10.0/src/cad_server/_internal/providers.py +2013 -0
  29. cad_server-0.10.0/src/cad_server/_internal/proxy.py +94 -0
  30. cad_server-0.10.0/src/cad_server/_internal/releases.py +211 -0
  31. cad_server-0.10.0/src/cad_server/_internal/shared_read.py +62 -0
  32. cad_server-0.10.0/src/cad_server/_internal/switch.py +304 -0
  33. cad_server-0.10.0/src/cad_server/_internal/telemetry_send.py +108 -0
  34. cad_server-0.10.0/src/cad_server/_internal/update.py +157 -0
  35. cad_server-0.10.0/src/cad_server/_runtime/mcp/THIRD_PARTY_LICENSES.txt +1895 -0
  36. cad_server-0.10.0/src/cad_server/_runtime/mcp/app.js +9 -0
  37. cad_server-0.10.0/src/cad_server/_runtime/mcp/shell.html +13 -0
  38. cad_server-0.10.0/src/cad_server/_runtime/plugin/.claude-plugin/icon.png +0 -0
  39. cad_server-0.10.0/src/cad_server/_runtime/plugin/.claude-plugin/marketplace.json +35 -0
  40. cad_server-0.10.0/src/cad_server/_runtime/plugin/.claude-plugin/plugin.json +28 -0
  41. cad_server-0.10.0/src/cad_server/_runtime/plugin/.codex-plugin/logo.png +0 -0
  42. cad_server-0.10.0/src/cad_server/_runtime/plugin/.codex-plugin/plugin.json +47 -0
  43. cad_server-0.10.0/src/cad_server/_runtime/plugin/.cursor-plugin/plugin.json +29 -0
  44. cad_server-0.10.0/src/cad_server/_runtime/plugin/LICENSE +21 -0
  45. cad_server-0.10.0/src/cad_server/_runtime/plugin/claude.mcp.json +19 -0
  46. cad_server-0.10.0/src/cad_server/_runtime/plugin/codex.mcp.json +20 -0
  47. cad_server-0.10.0/src/cad_server/_runtime/plugin/cursor.mcp.json +20 -0
  48. cad_server-0.10.0/src/cad_server/_runtime/plugin/gemini-extension.json +22 -0
  49. cad_server-0.10.0/src/cad_server/_runtime/plugin/mcp.json +21 -0
  50. cad_server-0.10.0/src/cad_server/_runtime/plugin/plugin.json +23 -0
  51. cad_server-0.10.0/src/cad_server/_runtime/plugin/skills/bambu-labs/LICENSE +21 -0
  52. cad_server-0.10.0/src/cad_server/_runtime/plugin/skills/bambu-labs/SKILL.md +67 -0
  53. cad_server-0.10.0/src/cad_server/_runtime/plugin/skills/bambu-labs/agents/openai.yaml +4 -0
  54. cad_server-0.10.0/src/cad_server/_runtime/plugin/skills/cad/LICENSE +21 -0
  55. cad_server-0.10.0/src/cad_server/_runtime/plugin/skills/cad/SKILL.md +361 -0
  56. cad_server-0.10.0/src/cad_server/_runtime/plugin/skills/cad/agents/openai.yaml +4 -0
  57. cad_server-0.10.0/src/cad_server/_runtime/plugin/skills/cad/references/animation.md +139 -0
  58. cad_server-0.10.0/src/cad_server/_runtime/plugin/skills/cad/references/build123d-modeling.md +159 -0
  59. cad_server-0.10.0/src/cad_server/_runtime/plugin/skills/cad/references/exports.md +180 -0
  60. cad_server-0.10.0/src/cad_server/_runtime/plugin/skills/cad/references/inspection-and-validation.md +340 -0
  61. cad_server-0.10.0/src/cad_server/_runtime/plugin/skills/cad/references/kinematics.md +316 -0
  62. cad_server-0.10.0/src/cad_server/_runtime/plugin/skills/cad/references/model-contract.md +380 -0
  63. cad_server-0.10.0/src/cad_server/_runtime/plugin/skills/cad/references/positioning.md +118 -0
  64. cad_server-0.10.0/src/cad_server/_runtime/plugin/skills/cad/references/project-layout.md +174 -0
  65. cad_server-0.10.0/src/cad_server/_runtime/plugin/skills/cad/references/snapshot-review.md +248 -0
  66. cad_server-0.10.0/src/cad_server/_runtime/plugin/skills/dfam-check/LICENSE +21 -0
  67. cad_server-0.10.0/src/cad_server/_runtime/plugin/skills/dfam-check/SKILL.md +106 -0
  68. cad_server-0.10.0/src/cad_server/_runtime/plugin/skills/dfam-check/agents/openai.yaml +4 -0
  69. cad_server-0.10.0/src/cad_server/_runtime/plugin/skills/dfam-check/references/process-limits.md +58 -0
  70. cad_server-0.10.0/src/cad_server/_runtime/plugin/skills/dfam-check/requirements.txt +11 -0
  71. cad_server-0.10.0/src/cad_server/_runtime/plugin/skills/dfam-check/scripts/dfam_tool.py +399 -0
  72. cad_server-0.10.0/src/cad_server/_runtime/plugin/skills/dfm/LICENSE +21 -0
  73. cad_server-0.10.0/src/cad_server/_runtime/plugin/skills/dfm/SKILL.md +105 -0
  74. cad_server-0.10.0/src/cad_server/_runtime/plugin/skills/dfm/agents/openai.yaml +4 -0
  75. cad_server-0.10.0/src/cad_server/_runtime/plugin/skills/dfm/references/cnc.md +52 -0
  76. cad_server-0.10.0/src/cad_server/_runtime/plugin/skills/dfm/references/injection-molding.md +173 -0
  77. cad_server-0.10.0/src/cad_server/_runtime/plugin/skills/dfm/references/sheet-metal.md +47 -0
  78. cad_server-0.10.0/src/cad_server/_runtime/plugin/skills/dfm/requirements.txt +10 -0
  79. cad_server-0.10.0/src/cad_server/_runtime/plugin/skills/dfm/scripts/mold_tool.py +1039 -0
  80. cad_server-0.10.0/src/cad_server/_runtime/plugin/skills/dxf/LICENSE +21 -0
  81. cad_server-0.10.0/src/cad_server/_runtime/plugin/skills/dxf/SKILL.md +358 -0
  82. cad_server-0.10.0/src/cad_server/_runtime/plugin/skills/dxf/agents/openai.yaml +4 -0
  83. cad_server-0.10.0/src/cad_server/_runtime/plugin/skills/dxf/references/generator-templates.md +187 -0
  84. cad_server-0.10.0/src/cad_server/_runtime/plugin/skills/engineering-drawing/LICENSE +21 -0
  85. cad_server-0.10.0/src/cad_server/_runtime/plugin/skills/engineering-drawing/SKILL.md +137 -0
  86. cad_server-0.10.0/src/cad_server/_runtime/plugin/skills/engineering-drawing/agents/openai.yaml +4 -0
  87. cad_server-0.10.0/src/cad_server/_runtime/plugin/skills/engineering-drawing/references/sheet-api.md +142 -0
  88. cad_server-0.10.0/src/cad_server/_runtime/plugin/skills/gcode/LICENSE +21 -0
  89. cad_server-0.10.0/src/cad_server/_runtime/plugin/skills/gcode/SKILL.md +91 -0
  90. cad_server-0.10.0/src/cad_server/_runtime/plugin/skills/gcode/agents/openai.yaml +4 -0
  91. cad_server-0.10.0/src/cad_server/_runtime/plugin/skills/gcode/scripts/orca_presets.py +134 -0
  92. cad_server-0.10.0/src/cad_server/_runtime/plugin/skills/sdf/LICENSE +21 -0
  93. cad_server-0.10.0/src/cad_server/_runtime/plugin/skills/sdf/SKILL.md +193 -0
  94. cad_server-0.10.0/src/cad_server/_runtime/plugin/skills/sdf/agents/openai.yaml +4 -0
  95. cad_server-0.10.0/src/cad_server/_runtime/plugin/skills/sdf/references/design-ledger.md +113 -0
  96. cad_server-0.10.0/src/cad_server/_runtime/plugin/skills/sdf/references/examples.md +141 -0
  97. cad_server-0.10.0/src/cad_server/_runtime/plugin/skills/sdf/references/frame-semantics.md +87 -0
  98. cad_server-0.10.0/src/cad_server/_runtime/plugin/skills/sdf/references/interoperability.md +78 -0
  99. cad_server-0.10.0/src/cad_server/_runtime/plugin/skills/sdf/references/llm-guardrails.md +107 -0
  100. cad_server-0.10.0/src/cad_server/_runtime/plugin/skills/sdf/references/sdf-workflow.md +80 -0
  101. cad_server-0.10.0/src/cad_server/_runtime/plugin/skills/sdf/references/smoke-tests.md +99 -0
  102. cad_server-0.10.0/src/cad_server/_runtime/plugin/skills/sdf/references/validation.md +161 -0
  103. cad_server-0.10.0/src/cad_server/_runtime/plugin/skills/sendcutsend/LICENSE +21 -0
  104. cad_server-0.10.0/src/cad_server/_runtime/plugin/skills/sendcutsend/SKILL.md +117 -0
  105. cad_server-0.10.0/src/cad_server/_runtime/plugin/skills/sendcutsend/agents/openai.yaml +4 -0
  106. cad_server-0.10.0/src/cad_server/_runtime/plugin/skills/sendcutsend/references/official-sources.md +40 -0
  107. cad_server-0.10.0/src/cad_server/_runtime/plugin/skills/sendcutsend/references/report-template.md +40 -0
  108. cad_server-0.10.0/src/cad_server/_runtime/plugin/skills/srdf/LICENSE +21 -0
  109. cad_server-0.10.0/src/cad_server/_runtime/plugin/skills/srdf/SKILL.md +168 -0
  110. cad_server-0.10.0/src/cad_server/_runtime/plugin/skills/srdf/agents/openai.yaml +4 -0
  111. cad_server-0.10.0/src/cad_server/_runtime/plugin/skills/srdf/references/authoring-contract.md +70 -0
  112. cad_server-0.10.0/src/cad_server/_runtime/plugin/skills/srdf/references/disabled-collisions.md +55 -0
  113. cad_server-0.10.0/src/cad_server/_runtime/plugin/skills/srdf/references/end-effectors.md +50 -0
  114. cad_server-0.10.0/src/cad_server/_runtime/plugin/skills/srdf/references/planning-ledger.md +102 -0
  115. cad_server-0.10.0/src/cad_server/_runtime/plugin/skills/srdf/references/srdf-workflow.md +38 -0
  116. cad_server-0.10.0/src/cad_server/_runtime/plugin/skills/srdf/references/validation.md +44 -0
  117. cad_server-0.10.0/src/cad_server/_runtime/plugin/skills/step-parts/LICENSE +21 -0
  118. cad_server-0.10.0/src/cad_server/_runtime/plugin/skills/step-parts/SKILL.md +68 -0
  119. cad_server-0.10.0/src/cad_server/_runtime/plugin/skills/step-parts/agents/openai.yaml +4 -0
  120. cad_server-0.10.0/src/cad_server/_runtime/plugin/skills/step-parts/references/step-parts-api.md +75 -0
  121. cad_server-0.10.0/src/cad_server/_runtime/plugin/skills/step-parts/scripts/download_step_part.py +230 -0
  122. cad_server-0.10.0/src/cad_server/_runtime/plugin/skills/urdf/LICENSE +21 -0
  123. cad_server-0.10.0/src/cad_server/_runtime/plugin/skills/urdf/SKILL.md +156 -0
  124. cad_server-0.10.0/src/cad_server/_runtime/plugin/skills/urdf/agents/openai.yaml +4 -0
  125. cad_server-0.10.0/src/cad_server/_runtime/plugin/skills/urdf/references/authoring-contract.md +167 -0
  126. cad_server-0.10.0/src/cad_server/_runtime/plugin/skills/urdf/references/design-ledger.md +112 -0
  127. cad_server-0.10.0/src/cad_server/_runtime/plugin/skills/urdf/references/frame-semantics.md +105 -0
  128. cad_server-0.10.0/src/cad_server/_runtime/plugin/skills/urdf/references/inertials.md +63 -0
  129. cad_server-0.10.0/src/cad_server/_runtime/plugin/skills/urdf/references/meshes.md +49 -0
  130. cad_server-0.10.0/src/cad_server/_runtime/plugin/skills/urdf/references/urdf-workflow.md +79 -0
  131. cad_server-0.10.0/src/cad_server/_runtime/plugin/skills/urdf/references/validation.md +67 -0
  132. cad_server-0.10.0/src/cad_server/_runtime/viewer/THIRD_PARTY_LICENSES.txt +1895 -0
  133. cad_server-0.10.0/src/cad_server/_runtime/viewer/assets/BufferGeometryUtils-BO3Ss---.js +1 -0
  134. cad_server-0.10.0/src/cad_server/_runtime/viewer/assets/DxfRenderer-CK-C88pp.js +6 -0
  135. cad_server-0.10.0/src/cad_server/_runtime/viewer/assets/GLTFLoader-C-ZwhOwN.js +1 -0
  136. cad_server-0.10.0/src/cad_server/_runtime/viewer/assets/GlbRenderer-CwtvgnsN.js +2 -0
  137. cad_server-0.10.0/src/cad_server/_runtime/viewer/assets/MeshRenderer-CtKo5N8-.js +2 -0
  138. cad_server-0.10.0/src/cad_server/_runtime/viewer/assets/RobotRenderer-D4v9vkun.js +2 -0
  139. cad_server-0.10.0/src/cad_server/_runtime/viewer/assets/STLLoader-COjUjMBk.js +1 -0
  140. cad_server-0.10.0/src/cad_server/_runtime/viewer/assets/SceneMeasure-DWhVhT3U.js +2 -0
  141. cad_server-0.10.0/src/cad_server/_runtime/viewer/assets/VirtualRows-CcpJpJrq.js +2 -0
  142. cad_server-0.10.0/src/cad_server/_runtime/viewer/assets/XbfRenderer-Cz77kpw3.js +8 -0
  143. cad_server-0.10.0/src/cad_server/_runtime/viewer/assets/entryAssets-DMPboejr.js +2 -0
  144. cad_server-0.10.0/src/cad_server/_runtime/viewer/assets/environmentMap-C2AYeUDk.js +2 -0
  145. cad_server-0.10.0/src/cad_server/_runtime/viewer/assets/favicon-DwiaIWoe.png +0 -0
  146. cad_server-0.10.0/src/cad_server/_runtime/viewer/assets/glbMeshWorker-DH0X5ko0.js +7 -0
  147. cad_server-0.10.0/src/cad_server/_runtime/viewer/assets/index-BBVuT0Je.css +2 -0
  148. cad_server-0.10.0/src/cad_server/_runtime/viewer/assets/index-KO9e-SAu.js +27 -0
  149. cad_server-0.10.0/src/cad_server/_runtime/viewer/assets/loading-OUGzZRP4.avif +0 -0
  150. cad_server-0.10.0/src/cad_server/_runtime/viewer/assets/loading-still-DWWO9OwM.webp +0 -0
  151. cad_server-0.10.0/src/cad_server/_runtime/viewer/assets/meshObjects-BHfBp4CD.js +2 -0
  152. cad_server-0.10.0/src/cad_server/_runtime/viewer/assets/meshopt_decoder-4Ef-c7zw.js +1 -0
  153. cad_server-0.10.0/src/cad_server/_runtime/viewer/assets/photographicStudio-D1RYrfjy.js +475 -0
  154. cad_server-0.10.0/src/cad_server/_runtime/viewer/assets/raycastBvhWorker-D5dKYzM6.js +6 -0
  155. cad_server-0.10.0/src/cad_server/_runtime/viewer/assets/rolldown-runtime-XKyaHtl9.js +1 -0
  156. cad_server-0.10.0/src/cad_server/_runtime/viewer/assets/sceneExplode-DP8HU56N.js +2 -0
  157. cad_server-0.10.0/src/cad_server/_runtime/viewer/assets/sceneHighlight-C5lLZODo.js +2 -0
  158. cad_server-0.10.0/src/cad_server/_runtime/viewer/assets/sharedGeometry-BsLw_hx-.js +225 -0
  159. cad_server-0.10.0/src/cad_server/_runtime/viewer/assets/stlMeshWorker-CuNjKOUV.js +1 -0
  160. cad_server-0.10.0/src/cad_server/_runtime/viewer/assets/studioEnvironment.worker-utbnN6Yk.js +4231 -0
  161. cad_server-0.10.0/src/cad_server/_runtime/viewer/assets/three.core-DdnNoxhu.js +6 -0
  162. cad_server-0.10.0/src/cad_server/_runtime/viewer/assets/toolModes-Cc3imgJQ.js +66 -0
  163. cad_server-0.10.0/src/cad_server/_runtime/viewer/assets/useSceneSelection-CqIqnfow.js +2 -0
  164. cad_server-0.10.0/src/cad_server/_runtime/viewer/assets/vendor-icons-BmP3iO1o.js +2 -0
  165. cad_server-0.10.0/src/cad_server/_runtime/viewer/assets/vendor-react-iRJfyluG.js +10 -0
  166. cad_server-0.10.0/src/cad_server/_runtime/viewer/assets/vendor-three-DStQQdKw.js +4613 -0
  167. cad_server-0.10.0/src/cad_server/_runtime/viewer/assets/vendor-ui-Cgj57w_6.js +47 -0
  168. cad_server-0.10.0/src/cad_server/_runtime/viewer/index.html +39 -0
  169. cad_server-0.10.0/src/cad_server/analytics.py +1865 -0
  170. cad_server-0.10.0/src/cad_server/assets.py +157 -0
  171. cad_server-0.10.0/src/cad_server/cli/__init__.py +277 -0
  172. cad_server-0.10.0/src/cad_server/cli/__main__.py +10 -0
  173. cad_server-0.10.0/src/cad_server/cli/delete.py +30 -0
  174. cad_server-0.10.0/src/cad_server/cli/doctor.py +570 -0
  175. cad_server-0.10.0/src/cad_server/cli/export.py +30 -0
  176. cad_server-0.10.0/src/cad_server/cli/inspect.py +30 -0
  177. cad_server-0.10.0/src/cad_server/cli/plugin.py +79 -0
  178. cad_server-0.10.0/src/cad_server/cli/run.py +105 -0
  179. cad_server-0.10.0/src/cad_server/cli/sdf_validate.py +30 -0
  180. cad_server-0.10.0/src/cad_server/cli/serve.py +30 -0
  181. cad_server-0.10.0/src/cad_server/cli/server.py +29 -0
  182. cad_server-0.10.0/src/cad_server/cli/setup.py +1054 -0
  183. cad_server-0.10.0/src/cad_server/cli/snapshot.py +30 -0
  184. cad_server-0.10.0/src/cad_server/cli/srdf_validate.py +30 -0
  185. cad_server-0.10.0/src/cad_server/cli/status.py +30 -0
  186. cad_server-0.10.0/src/cad_server/cli/stop.py +29 -0
  187. cad_server-0.10.0/src/cad_server/cli/telemetry.py +90 -0
  188. cad_server-0.10.0/src/cad_server/cli/uninstall.py +29 -0
  189. cad_server-0.10.0/src/cad_server/cli/update.py +65 -0
  190. cad_server-0.10.0/src/cad_server/cli/urdf_validate.py +83 -0
  191. cad_server-0.10.0/src/cad_server/cli/viewer.py +22 -0
  192. cad_server-0.10.0/src/cad_server/drawing_payload.py +683 -0
  193. cad_server-0.10.0/src/cad_server/engine/README.md +3131 -0
  194. cad_server-0.10.0/src/cad_server/engine/__init__.py +3 -0
  195. cad_server-0.10.0/src/cad_server/engine/__main__.py +7 -0
  196. cad_server-0.10.0/src/cad_server/engine/cache.py +391 -0
  197. cad_server-0.10.0/src/cad_server/engine/cli.py +823 -0
  198. cad_server-0.10.0/src/cad_server/engine/daemon.py +1818 -0
  199. cad_server-0.10.0/src/cad_server/engine/models.py +799 -0
  200. cad_server-0.10.0/src/cad_server/engine/registry.py +326 -0
  201. cad_server-0.10.0/src/cad_server/engine/renders.py +155 -0
  202. cad_server-0.10.0/src/cad_server/engine/services.py +79 -0
  203. cad_server-0.10.0/src/cad_server/engine/supervisor.py +1126 -0
  204. cad_server-0.10.0/src/cad_server/jobs.py +153 -0
  205. cad_server-0.10.0/src/cad_server/language.py +47 -0
  206. cad_server-0.10.0/src/cad_server/mcp/__init__.py +0 -0
  207. cad_server-0.10.0/src/cad_server/mcp/browser.py +43 -0
  208. cad_server-0.10.0/src/cad_server/mcp/host.py +60 -0
  209. cad_server-0.10.0/src/cad_server/mcp/http.py +230 -0
  210. cad_server-0.10.0/src/cad_server/mcp/operations.py +374 -0
  211. cad_server-0.10.0/src/cad_server/mcp/protocol.py +39 -0
  212. cad_server-0.10.0/src/cad_server/mcp/server.py +1157 -0
  213. cad_server-0.10.0/src/cad_server/mcp/sidebar.py +52 -0
  214. cad_server-0.10.0/src/cad_server/mcp/tunnel.py +248 -0
  215. cad_server-0.10.0/src/cad_server/mcp/ui.py +120 -0
  216. cad_server-0.10.0/src/cad_server/mcp/views.py +202 -0
  217. cad_server-0.10.0/src/cad_server/py.typed +0 -0
  218. cad_server-0.10.0/src/cad_server/robot_payload.py +1768 -0
  219. cad_server-0.10.0/src/cad_server/settings.py +83 -0
  220. cad_server-0.10.0/src/cad_server/updates.py +252 -0
  221. cad_server-0.10.0/src/cad_server/viewer/__init__.py +11 -0
  222. cad_server-0.10.0/src/cad_server/viewer/__main__.py +7 -0
  223. cad_server-0.10.0/src/cad_server/viewer/backend.py +50 -0
  224. cad_server-0.10.0/src/cad_server/viewer/browser_open.py +107 -0
  225. cad_server-0.10.0/src/cad_server/viewer/clipboard.py +28 -0
  226. cad_server-0.10.0/src/cad_server/viewer/collation.json +1 -0
  227. cad_server-0.10.0/src/cad_server/viewer/content_types.py +66 -0
  228. cad_server-0.10.0/src/cad_server/viewer/documents.py +143 -0
  229. cad_server-0.10.0/src/cad_server/viewer/drawings.py +157 -0
  230. cad_server-0.10.0/src/cad_server/viewer/encoding.py +173 -0
  231. cad_server-0.10.0/src/cad_server/viewer/engine_app.py +470 -0
  232. cad_server-0.10.0/src/cad_server/viewer/exports.py +297 -0
  233. cad_server-0.10.0/src/cad_server/viewer/folders.py +135 -0
  234. cad_server-0.10.0/src/cad_server/viewer/handler.py +365 -0
  235. cad_server-0.10.0/src/cad_server/viewer/http_app.py +1342 -0
  236. cad_server-0.10.0/src/cad_server/viewer/kinds.py +45 -0
  237. cad_server-0.10.0/src/cad_server/viewer/main.py +78 -0
  238. cad_server-0.10.0/src/cad_server/viewer/model_catalog.py +37 -0
  239. cad_server-0.10.0/src/cad_server/viewer/natural_sort.py +218 -0
  240. cad_server-0.10.0/src/cad_server/viewer/prompt_files.py +234 -0
  241. cad_server-0.10.0/src/cad_server/viewer/recents.py +254 -0
  242. cad_server-0.10.0/src/cad_server/viewer/response.py +270 -0
  243. cad_server-0.10.0/src/cad_server/viewer/reveal.py +49 -0
  244. cad_server-0.10.0/src/cad_server/viewer/robots.py +98 -0
  245. cad_server-0.10.0/src/cad_server/viewer/scanner.py +320 -0
  246. cad_server-0.10.0/src/cad_server/viewer/url_norm.py +160 -0
  247. cad_server-0.10.0/src/cad_server.egg-info/PKG-INFO +156 -0
  248. cad_server-0.10.0/src/cad_server.egg-info/SOURCES.txt +250 -0
  249. cad_server-0.10.0/src/cad_server.egg-info/dependency_links.txt +1 -0
  250. cad_server-0.10.0/src/cad_server.egg-info/entry_points.txt +2 -0
  251. cad_server-0.10.0/src/cad_server.egg-info/requires.txt +4 -0
  252. cad_server-0.10.0/src/cad_server.egg-info/top_level.txt +1 -0
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Thompson Labs LLC
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,156 @@
1
+ Metadata-Version: 2.4
2
+ Name: cad-server
3
+ Version: 0.10.0
4
+ Summary: The CAD server for text-to-cad: the device's daemon that builds, keeps and serves CAD documents, the CAD Viewer, the CAD app's MCP endpoint, and the command that runs and installs them.
5
+ Author: earthtojake
6
+ License-Expression: MIT
7
+ Project-URL: Homepage, https://github.com/earthtojake/text-to-cad
8
+ Project-URL: Repository, https://github.com/earthtojake/text-to-cad
9
+ Project-URL: Issues, https://github.com/earthtojake/text-to-cad/issues
10
+ Keywords: cad,step,glb,build123d,mcp,agent-skills
11
+ Classifier: Development Status :: 4 - Beta
12
+ Classifier: Intended Audience :: Developers
13
+ Classifier: Intended Audience :: Manufacturing
14
+ Classifier: Programming Language :: Python :: 3
15
+ Classifier: Programming Language :: Python :: 3.14
16
+ Classifier: Topic :: Multimedia :: Graphics :: 3D Modeling
17
+ Classifier: Topic :: Scientific/Engineering
18
+ Requires-Python: >=3.14
19
+ Description-Content-Type: text/markdown
20
+ License-File: LICENSE
21
+ Requires-Dist: cad==0.10.0
22
+ Requires-Dist: uv>=0.7
23
+ Requires-Dist: ezdxf
24
+ Requires-Dist: pillow
25
+ Dynamic: license-file
26
+
27
+ # cad-server
28
+
29
+ The CAD server for text-to-cad, imported as `cad_server`: the computer's one daemon that builds, keeps and
30
+ serves CAD documents; the CAD Viewer and the CAD app's MCP endpoint on its listener; the environment the
31
+ CAD kernel runs in; the installations and the one that is current; and the command that runs and
32
+ installs them all.
33
+
34
+ Models are written against the library, `cad`, which the server imports without
35
+ its CAD kernel: the kernel lives in the environment the server makes for models and its own kernel
36
+ processes, `cad[build123d]` at the server's own release.
37
+
38
+ The mechanisms its laws constrain are [`src/cad_server/engine/README.md`](src/cad_server/engine/README.md).
39
+
40
+ ## The shape of the package
41
+
42
+ ```
43
+ src/cad_server/
44
+ engine/ # the engine's server half: the daemon, its supervisor and the services it
45
+ # declares (its workers, its render processes), its registry of documents,
46
+ # the live models' book, the document cache, the verbs as commands
47
+ # (cli), and the engine's README, the mechanisms the laws constrain
48
+ cli/ # the `cad` command: a module per command, each a shell over
49
+ # the function or parser that does the work
50
+ viewer/ # the engine's HTTP application (engine_app), launcher (main), routes
51
+ # (http_app: /api/v1, its document kinds in kinds), files by
52
+ # absolute path (backend), a file's catalog row (scanner), the explorer's reads (folders), the model library
53
+ # every CAD view shares (recents), a STEP's and an .xbf's serve
54
+ # by the engine and in-process document reads (documents), a DXF's
55
+ # payload (drawings), a robot's (robots), Quick Edit's packets
56
+ # (prompt_files)
57
+ mcp/ # the engine's MCP endpoint: its JSON-RPC vocabulary (protocol),
58
+ # engine sessions (http), tools and launches (server), the agent
59
+ # operations (operations), how a host presents CAD (host), open
60
+ # views (views), sidebar views shared in memory (sidebar), the
61
+ # viewer routes in-process (tunnel), the page (ui), and the CAD
62
+ # Viewer link for a host that renders no MCP Apps (browser)
63
+ robot_payload.py # a robot description resolved for the viewer's page: its
64
+ # articulation, its visuals in rest space, the facts a person
65
+ # reads off it; held in memory
66
+ drawing_payload.py # a DXF flattened by ezdxf for the viewer's pane
67
+ jobs.py # the agent operations' and the viewer exports' admission, progress,
68
+ # waiting and cancellation
69
+ analytics.py # telemetry: usage counts and crash reports, on by default once
70
+ # a command has said so, never after a no
71
+ settings.py # the person's settings: settings.json in the state directory
72
+ language.py # the language the person chose for the CAD views
73
+ updates.py # the hourly version check, for a copy nothing else keeps current,
74
+ # and the release an update moves to
75
+ assets.py # where the bundled runtime is
76
+ _internal/ # the environment models run in (base: the installation's base,
77
+ # cad[build123d], made by uv), the launch commands (launch), the
78
+ # installations' registry, which one is current, and the proxy it
79
+ # writes (installations: ~/.local/bin/cad, which the skills run;
80
+ # written by `cad doctor`, `cad setup` and a CAD app's first
81
+ # registration), the proxy (proxy), the releases an update
82
+ # installs (releases), the update the button starts (update) and its
83
+ # switch (switch), the plugin folder every agent app is pointed at
84
+ # (plugin), the agent apps setup reads and writes (providers),
85
+ # what earlier releases left behind (leftovers), the daemon's entry
86
+ # (engine_daemon) and what it is composed of (engine_host), the
87
+ # server's observer of the engine and the telemetry sender, the
88
+ # install channel, file locks (the state folder's one lock:
89
+ # `file_lock.state`), the CLI derivation
90
+ _runtime/ # BUILT: the CAD Viewer client, the CAD app page and the agent-app
91
+ # plugin (its manifests and skills) -- produced when the wheel is
92
+ # packaged, never committed, never edited
93
+ ```
94
+
95
+ ## Commands
96
+
97
+ `cad export`, `snapshot`, `serve`, `inspect`, `status`, `stop`, `delete` and `server` are the
98
+ engine's verbs (`snapshot` draws every file the viewer opens, a DXF or a robot among them);
99
+ `cad urdf|sdf|srdf validate` the validators; `cad doctor` the setup (the installation registered,
100
+ the `cad` command written, the CAD kernel environment made, the engine started; the releases on
101
+ disk, the current one, the engine's and each app's plugin's) and what earlier releases left behind
102
+ that nothing needs, which `cad doctor --prune` removes (`_internal/leftovers.py`: engine records of
103
+ an older format, the bytecode of installations no longer registered, cache folders no record names,
104
+ the launchers earlier releases published beside the `cad` command, 0.8's `cadgen` proxy among them;
105
+ none written in the last seven days); `cad run` a program in the CAD kernel environment (the base:
106
+ `_internal/base.py`), its own folder last on its path; `cad viewer` the engine page launcher;
107
+ `cad setup`, which the install command `curl -fsSL https://texttocad.dev/install.sh | sh` runs, sets
108
+ up or updates text-to-cad in every agent app it finds, each by its own command
109
+ (`_internal/providers.py`), installs its release's folder, makes the CAD kernel environment models
110
+ run in and moves the device's engine to its release; `cad update` runs the newest release's
111
+ `cad setup`, as the update button does; `cad uninstall` takes text-to-cad out; `cad plugin` writes
112
+ the plugin folder and prints its path; and `cad telemetry` the person's answer.
113
+
114
+ The plugin every agent app gets is one folder, `plugin` in the state folder, which the server writes
115
+ from its own copy of the plugin (`_runtime/plugin`: each host's manifest, its config for the CAD app's
116
+ server, and the skills, byte for byte as they were released) with every version this distribution's
117
+ (`_internal/plugin.py`). It is written again in place -- each file renamed over, never a symlink --
118
+ at a registration of the current installation, by `cad setup` before it points the apps at it, and by
119
+ the release left current after every switch of the engine (`cad plugin --refresh`). Each app takes it
120
+ the way it takes a local plugin (`_internal/providers.py`): a local catalog that Claude Code reads in
121
+ place and Codex copies, an extension Gemini CLI links, a copy in Cursor's local plugins folder, the
122
+ skills copied by the Skills CLI for the agents without a plugin. An update writes the folder for the
123
+ new release and brings the copies along; nothing updates by itself. A model builds by running its script: `cad run model.py`, through
124
+ the `cad` command, which runs the current installation, else the one registered last
125
+ (`_internal/proxy.py`). The CAD app an agent
126
+ host starts is `cad-mcp`, of the `cad-mcp` distribution, which reaches this server.
127
+
128
+ The state folder is `cad` in the platform's place for state (`cad-state` on Windows),
129
+ the cache folder `cad` in its place for caches. On a computer an earlier release (0.8, named
130
+ cadgen) set up, `cad setup`, `cad doctor` and a registration move what this release keeps of the
131
+ earlier state folder into this one, each thing once and only where this one has none of it: the
132
+ settings, the documents' records, Recents and the setup receipt (`cad.engine.places.adopt`); the
133
+ person's telemetry no stays in the earlier folder too, for the earlier release while it is installed.
134
+ 0.8's installations' records, engine records and page token stay where 0.8 keeps them: no 0.10 engine
135
+ serves a link 0.8 printed.
136
+
137
+ Coming from 0.7: cadgen 0.7.x kept a cache store, which can hold gigabytes, in its cache folder,
138
+ `~/.cache/cadgen` (macOS and Linux; `$XDG_CACHE_HOME/cadgen` when that is set),
139
+ `%LOCALAPPDATA%\cadgen` (Windows) or the folder `CAD_CACHE_DIR` named: its `objects/` and `index/`;
140
+ and state files only 0.7 writes in its state folder (its sidebar views, its snapshot browser's lock,
141
+ its viewer's log, its Recents log). No later release reads or writes them. Whether a 0.7 is still
142
+ installed cannot be told from here (0.7 never registered itself; it lives in uv's environments and
143
+ the agent apps' plugin configs), so they retire themselves: `cad doctor` looks for them in the
144
+ folders 0.7 used (or the ones `CAD_STATE_DIR` and `CAD_CACHE_DIR` name) and says they are there, with
145
+ their size and when they were last written, and `cad doctor --prune` removes them once nothing has
146
+ written them for seven days -- a 0.7 in use writes its store at every build -- or at once with
147
+ `--all-versions`, once no 0.7 is left in any agent app.
148
+
149
+ The engine's HTTP API is `/api/v1` (`viewer/http_app.py`, its document kinds `viewer/kinds.py`; the
150
+ routes are listed in the engine README's **Wire format**): the pages are at the root, and every
151
+ route they call is under it.
152
+
153
+ The viewer exposes `POST /api/v1/local/clipboard` for explicit viewport PNG copies. It
154
+ uses the same host and custom-header gates as other mutation routes, limits
155
+ images to 20 MiB, and delegates native delivery to `viewer/clipboard.py`. It never
156
+ reads the clipboard. Unsupported desktop clipboard environments return an error.
@@ -0,0 +1,130 @@
1
+ # cad-server
2
+
3
+ The CAD server for text-to-cad, imported as `cad_server`: the computer's one daemon that builds, keeps and
4
+ serves CAD documents; the CAD Viewer and the CAD app's MCP endpoint on its listener; the environment the
5
+ CAD kernel runs in; the installations and the one that is current; and the command that runs and
6
+ installs them all.
7
+
8
+ Models are written against the library, `cad`, which the server imports without
9
+ its CAD kernel: the kernel lives in the environment the server makes for models and its own kernel
10
+ processes, `cad[build123d]` at the server's own release.
11
+
12
+ The mechanisms its laws constrain are [`src/cad_server/engine/README.md`](src/cad_server/engine/README.md).
13
+
14
+ ## The shape of the package
15
+
16
+ ```
17
+ src/cad_server/
18
+ engine/ # the engine's server half: the daemon, its supervisor and the services it
19
+ # declares (its workers, its render processes), its registry of documents,
20
+ # the live models' book, the document cache, the verbs as commands
21
+ # (cli), and the engine's README, the mechanisms the laws constrain
22
+ cli/ # the `cad` command: a module per command, each a shell over
23
+ # the function or parser that does the work
24
+ viewer/ # the engine's HTTP application (engine_app), launcher (main), routes
25
+ # (http_app: /api/v1, its document kinds in kinds), files by
26
+ # absolute path (backend), a file's catalog row (scanner), the explorer's reads (folders), the model library
27
+ # every CAD view shares (recents), a STEP's and an .xbf's serve
28
+ # by the engine and in-process document reads (documents), a DXF's
29
+ # payload (drawings), a robot's (robots), Quick Edit's packets
30
+ # (prompt_files)
31
+ mcp/ # the engine's MCP endpoint: its JSON-RPC vocabulary (protocol),
32
+ # engine sessions (http), tools and launches (server), the agent
33
+ # operations (operations), how a host presents CAD (host), open
34
+ # views (views), sidebar views shared in memory (sidebar), the
35
+ # viewer routes in-process (tunnel), the page (ui), and the CAD
36
+ # Viewer link for a host that renders no MCP Apps (browser)
37
+ robot_payload.py # a robot description resolved for the viewer's page: its
38
+ # articulation, its visuals in rest space, the facts a person
39
+ # reads off it; held in memory
40
+ drawing_payload.py # a DXF flattened by ezdxf for the viewer's pane
41
+ jobs.py # the agent operations' and the viewer exports' admission, progress,
42
+ # waiting and cancellation
43
+ analytics.py # telemetry: usage counts and crash reports, on by default once
44
+ # a command has said so, never after a no
45
+ settings.py # the person's settings: settings.json in the state directory
46
+ language.py # the language the person chose for the CAD views
47
+ updates.py # the hourly version check, for a copy nothing else keeps current,
48
+ # and the release an update moves to
49
+ assets.py # where the bundled runtime is
50
+ _internal/ # the environment models run in (base: the installation's base,
51
+ # cad[build123d], made by uv), the launch commands (launch), the
52
+ # installations' registry, which one is current, and the proxy it
53
+ # writes (installations: ~/.local/bin/cad, which the skills run;
54
+ # written by `cad doctor`, `cad setup` and a CAD app's first
55
+ # registration), the proxy (proxy), the releases an update
56
+ # installs (releases), the update the button starts (update) and its
57
+ # switch (switch), the plugin folder every agent app is pointed at
58
+ # (plugin), the agent apps setup reads and writes (providers),
59
+ # what earlier releases left behind (leftovers), the daemon's entry
60
+ # (engine_daemon) and what it is composed of (engine_host), the
61
+ # server's observer of the engine and the telemetry sender, the
62
+ # install channel, file locks (the state folder's one lock:
63
+ # `file_lock.state`), the CLI derivation
64
+ _runtime/ # BUILT: the CAD Viewer client, the CAD app page and the agent-app
65
+ # plugin (its manifests and skills) -- produced when the wheel is
66
+ # packaged, never committed, never edited
67
+ ```
68
+
69
+ ## Commands
70
+
71
+ `cad export`, `snapshot`, `serve`, `inspect`, `status`, `stop`, `delete` and `server` are the
72
+ engine's verbs (`snapshot` draws every file the viewer opens, a DXF or a robot among them);
73
+ `cad urdf|sdf|srdf validate` the validators; `cad doctor` the setup (the installation registered,
74
+ the `cad` command written, the CAD kernel environment made, the engine started; the releases on
75
+ disk, the current one, the engine's and each app's plugin's) and what earlier releases left behind
76
+ that nothing needs, which `cad doctor --prune` removes (`_internal/leftovers.py`: engine records of
77
+ an older format, the bytecode of installations no longer registered, cache folders no record names,
78
+ the launchers earlier releases published beside the `cad` command, 0.8's `cadgen` proxy among them;
79
+ none written in the last seven days); `cad run` a program in the CAD kernel environment (the base:
80
+ `_internal/base.py`), its own folder last on its path; `cad viewer` the engine page launcher;
81
+ `cad setup`, which the install command `curl -fsSL https://texttocad.dev/install.sh | sh` runs, sets
82
+ up or updates text-to-cad in every agent app it finds, each by its own command
83
+ (`_internal/providers.py`), installs its release's folder, makes the CAD kernel environment models
84
+ run in and moves the device's engine to its release; `cad update` runs the newest release's
85
+ `cad setup`, as the update button does; `cad uninstall` takes text-to-cad out; `cad plugin` writes
86
+ the plugin folder and prints its path; and `cad telemetry` the person's answer.
87
+
88
+ The plugin every agent app gets is one folder, `plugin` in the state folder, which the server writes
89
+ from its own copy of the plugin (`_runtime/plugin`: each host's manifest, its config for the CAD app's
90
+ server, and the skills, byte for byte as they were released) with every version this distribution's
91
+ (`_internal/plugin.py`). It is written again in place -- each file renamed over, never a symlink --
92
+ at a registration of the current installation, by `cad setup` before it points the apps at it, and by
93
+ the release left current after every switch of the engine (`cad plugin --refresh`). Each app takes it
94
+ the way it takes a local plugin (`_internal/providers.py`): a local catalog that Claude Code reads in
95
+ place and Codex copies, an extension Gemini CLI links, a copy in Cursor's local plugins folder, the
96
+ skills copied by the Skills CLI for the agents without a plugin. An update writes the folder for the
97
+ new release and brings the copies along; nothing updates by itself. A model builds by running its script: `cad run model.py`, through
98
+ the `cad` command, which runs the current installation, else the one registered last
99
+ (`_internal/proxy.py`). The CAD app an agent
100
+ host starts is `cad-mcp`, of the `cad-mcp` distribution, which reaches this server.
101
+
102
+ The state folder is `cad` in the platform's place for state (`cad-state` on Windows),
103
+ the cache folder `cad` in its place for caches. On a computer an earlier release (0.8, named
104
+ cadgen) set up, `cad setup`, `cad doctor` and a registration move what this release keeps of the
105
+ earlier state folder into this one, each thing once and only where this one has none of it: the
106
+ settings, the documents' records, Recents and the setup receipt (`cad.engine.places.adopt`); the
107
+ person's telemetry no stays in the earlier folder too, for the earlier release while it is installed.
108
+ 0.8's installations' records, engine records and page token stay where 0.8 keeps them: no 0.10 engine
109
+ serves a link 0.8 printed.
110
+
111
+ Coming from 0.7: cadgen 0.7.x kept a cache store, which can hold gigabytes, in its cache folder,
112
+ `~/.cache/cadgen` (macOS and Linux; `$XDG_CACHE_HOME/cadgen` when that is set),
113
+ `%LOCALAPPDATA%\cadgen` (Windows) or the folder `CAD_CACHE_DIR` named: its `objects/` and `index/`;
114
+ and state files only 0.7 writes in its state folder (its sidebar views, its snapshot browser's lock,
115
+ its viewer's log, its Recents log). No later release reads or writes them. Whether a 0.7 is still
116
+ installed cannot be told from here (0.7 never registered itself; it lives in uv's environments and
117
+ the agent apps' plugin configs), so they retire themselves: `cad doctor` looks for them in the
118
+ folders 0.7 used (or the ones `CAD_STATE_DIR` and `CAD_CACHE_DIR` name) and says they are there, with
119
+ their size and when they were last written, and `cad doctor --prune` removes them once nothing has
120
+ written them for seven days -- a 0.7 in use writes its store at every build -- or at once with
121
+ `--all-versions`, once no 0.7 is left in any agent app.
122
+
123
+ The engine's HTTP API is `/api/v1` (`viewer/http_app.py`, its document kinds `viewer/kinds.py`; the
124
+ routes are listed in the engine README's **Wire format**): the pages are at the root, and every
125
+ route they call is under it.
126
+
127
+ The viewer exposes `POST /api/v1/local/clipboard` for explicit viewport PNG copies. It
128
+ uses the same host and custom-header gates as other mutation routes, limits
129
+ images to 20 MiB, and delegates native delivery to `viewer/clipboard.py`. It never
130
+ reads the clipboard. Unsupported desktop clipboard environments return an error.
@@ -0,0 +1,72 @@
1
+ [build-system]
2
+ requires = ["setuptools>=77"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "cad-server"
7
+ version = "0.10.0"
8
+ description = "The CAD server for text-to-cad: the device's daemon that builds, keeps and serves CAD documents, the CAD Viewer, the CAD app's MCP endpoint, and the command that runs and installs them."
9
+ readme = "README.md"
10
+ license = "MIT"
11
+ license-files = ["LICENSE"]
12
+ requires-python = ">=3.14"
13
+ authors = [{ name = "earthtojake" }]
14
+ keywords = ["cad", "step", "glb", "build123d", "mcp", "agent-skills"]
15
+ classifiers = [
16
+ "Development Status :: 4 - Beta",
17
+ "Intended Audience :: Developers",
18
+ "Intended Audience :: Manufacturing",
19
+ "Programming Language :: Python :: 3",
20
+ "Programming Language :: Python :: 3.14",
21
+ "Topic :: Multimedia :: Graphics :: 3D Modeling",
22
+ "Topic :: Scientific/Engineering",
23
+ ]
24
+ # None of it imports the CAD kernel (a test holds that): the server makes the environment the kernel
25
+ # runs in (the base, `cad[build123d]` at this release) and starts its kernel processes there.
26
+ dependencies = [
27
+ # The library at this very release, without its kernel: the document model, the protocol, the
28
+ # words the verbs say. Exact: one release of the two is one product.
29
+ "cad==0.10.0",
30
+ # The server makes the environment its workers run in, and each release's an update installs, with
31
+ # uv: a dependency, so it is always there (its wheel carries the binary, `uv.find_uv_bin`), on a
32
+ # machine with no uv on PATH too.
33
+ "uv>=0.7",
34
+ # The CAD Viewer's DXF pane flattens a drawing with ezdxf in the server's own process.
35
+ "ezdxf",
36
+ # The DXF pane's raster and the Recents' previews are drawn with Pillow.
37
+ "pillow",
38
+ ]
39
+
40
+ [project.urls]
41
+ Homepage = "https://github.com/earthtojake/text-to-cad"
42
+ Repository = "https://github.com/earthtojake/text-to-cad"
43
+ Issues = "https://github.com/earthtojake/text-to-cad/issues"
44
+
45
+ [project.scripts]
46
+ cad = "cad_server.cli:main"
47
+
48
+ [tool.pyrefly]
49
+ preset = "basic"
50
+ project-includes = ["src"]
51
+ search-path = ["src", "../cad/src"]
52
+ # A checkout under an ignored folder (a `.claude/worktrees/...` worktree) would
53
+ # otherwise have src excluded by the ignore files above it and check nothing.
54
+ use-ignore-files = false
55
+
56
+ [tool.setuptools.packages.find]
57
+ where = ["src"]
58
+ include = ["cad_server", "cad_server.*"]
59
+
60
+ [tool.setuptools.package-data]
61
+ # _runtime holds what the server serves that is not Python: the CAD Viewer's built client that
62
+ # `cad viewer` serves, the CAD app page its MCP endpoint serves, and the agent-app plugin (its
63
+ # manifests and the skills) it writes into the plugin folder. It is data, not a subpackage (no
64
+ # __init__), and it is found at call time by cad_server.assets. A glob takes no dot folder, so the
65
+ # plugin's manifest folders are named. Verified by scripts/release/check-wheel-contents.sh.
66
+ cad_server = ["py.typed", "_runtime/**/*", "_runtime/plugin/.claude-plugin/*", "_runtime/plugin/.codex-plugin/*",
67
+ "_runtime/plugin/.cursor-plugin/*"]
68
+ # The viewer server's catalog ordering is ICU root collation, read from this table at
69
+ # runtime; it ships beside the code that reads it.
70
+ "cad_server.viewer" = ["collation.json"]
71
+ # The engine's README is the mechanisms the server's laws constrain.
72
+ "cad_server.engine" = ["README.md"]
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,54 @@
1
+ """The CAD server: the device's one daemon that builds, keeps and serves documents, the CAD Viewer's and
2
+ the CAD app's servers on its listener, every verb of the ``cadgen`` command, the environments its kernel
3
+ processes run in, the installations and the one that is current, and telemetry.
4
+
5
+ It imports the library's (``cad``) kernel-free modules and never the CAD kernel: the kernel lives in the
6
+ environment models run in (``_internal/base.py``). Importing it installs what the server attaches to the
7
+ library: the engine's verbs a server process runs are counted (``_internal/engine_telemetry.py``); a
8
+ model's own process, where the server is not installed, counts nothing. Each is attached as the engine's
9
+ module is imported, never sooner (``_internal/attach.py``): importing the server imports no engine.
10
+ """
11
+
12
+ from functools import cache as _cache
13
+
14
+ from cad_server._internal import attach as _attach
15
+ from cad_server._internal import engine_telemetry as _engine_telemetry
16
+
17
+ _engine_telemetry.install()
18
+ del _engine_telemetry
19
+
20
+
21
+ def _unregistered() -> str:
22
+ """What a client in a process of cad-server's own says where no installation is registered: not the
23
+ library's line, which would tell a running cad-server that cad-server is not installed, but this one's
24
+ (``cad_server._internal.installations.unregistered``)."""
25
+ from cad_server._internal.installations import unregistered
26
+
27
+ return unregistered()
28
+
29
+
30
+ def _say_unregistered(said) -> None:
31
+ said.UNREGISTERED = _unregistered
32
+
33
+
34
+ _attach.when("cad.engine.said", _say_unregistered)
35
+ del _attach
36
+
37
+ __all__ = ["__version__"]
38
+
39
+
40
+ def __getattr__(name: str):
41
+ if name == "__version__":
42
+ return _version()
43
+ raise AttributeError(f"module {__name__!r} has no attribute {name!r}")
44
+
45
+
46
+ @_cache
47
+ def _version() -> str:
48
+ """The version declared beside this very package (``cad._internal.version.declared_version``): the
49
+ source tree's pyproject for a checkout, the dist-info beside it for an install."""
50
+ import pathlib
51
+
52
+ from cad._internal.version import declared_version
53
+
54
+ return declared_version(pathlib.Path(__file__).resolve().parent, "cad-server")
@@ -0,0 +1 @@
1
+ """The server's private modules: no import stability is promised between releases."""
@@ -0,0 +1,19 @@
1
+ """api.texttocad.dev: the one service text-to-cad talks to.
2
+
3
+ Two things use it: telemetry (``cad_server/analytics.py``: ``/events`` and ``/forget``) and the hourly
4
+ version check (``cad_server/updates.py``: ``/versions``). It is ours,
5
+ so the service behind it can change without a release. ``CAD_API_URL`` points both at another
6
+ -- a local receiver -- when it is http(s).
7
+ """
8
+
9
+ from __future__ import annotations
10
+
11
+ import os
12
+
13
+ API = "https://api.texttocad.dev/v1"
14
+
15
+
16
+ def api_url() -> str:
17
+ """The service's base: ``CAD_API_URL`` when it is http(s), else ours."""
18
+ override = str(os.environ.get("CAD_API_URL") or "").strip().rstrip("/")
19
+ return override if override.startswith(("https://", "http://")) else API