@inneranimalmedia/agentsam-sdk 2.6.13 → 2.6.17

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 (1182) hide show
  1. package/AGENTSAM.md +1 -1
  2. package/LICENSE +97 -8
  3. package/LICENSING.md +30 -0
  4. package/README.md +33 -7
  5. package/apps/README.md +1 -1
  6. package/apps/cad-creator/LICENSE +97 -8
  7. package/apps/cad-creator/README.md +1 -1
  8. package/apps/cad-creator/shared/cad/package.json +1 -1
  9. package/apps/cad-creator/shared/cad/src/index.ts +2 -0
  10. package/apps/cad-creator/shared/cad/src/native-plan.ts +16 -0
  11. package/apps/cad-creator/shared/cad/src/types.ts +50 -1
  12. package/contracts/source-types.v2.json +9381 -0
  13. package/contracts/source-types.v2.schema.json +571 -0
  14. package/docs/2026-11-12-chat-work-whitelabel-scaffold.md +42 -0
  15. package/docs/DATABASE_EDITOR_REMASTER_ACCEPTANCE_20261103.md +41 -0
  16. package/docs/DOCKERIZE.md +2 -2
  17. package/docs/PRODUCT_LIFECYCLE.md +2 -2
  18. package/docs/REPO_FILE_MAP.txt +1 -1
  19. package/docs/THEME_REFINERY.md +4 -117
  20. package/docs/acceptance/AGENTSAM_DOCS_CMS_2026-11-10.md +62 -0
  21. package/docs/acceptance/AGENTSAM_SDK_LOCAL_LAUNCH_2026-11-06.md +42 -0
  22. package/docs/acceptance/AGENTSAM_SDK_PUBLIC_CMS_2026-11-10.md +35 -0
  23. package/docs/acceptance/AGENTSAM_WIDGET_UTILITIES_2026-11-06.md +34 -0
  24. package/docs/acceptance/CREATIVE_DEPARTMENT_BATCH1_2026-11-01.md +47 -0
  25. package/docs/acceptance/FINANCE_SETTINGS_CMS_WIP_2026-11-07.md +42 -0
  26. package/docs/adr/ADR-0009-widget-platform-authority.md +130 -0
  27. package/docs/adr/ADR-0010-widget-contributions-registry-persistence.md +265 -0
  28. package/docs/adr/README.md +5 -0
  29. package/docs/agent-briefs/2026-10-28-agent1-ui-product-foundation.md +132 -0
  30. package/docs/agent-briefs/2026-10-28-agent2-cms-audit.md +144 -0
  31. package/docs/agent-briefs/2026-10-28-sites-next-wave-acceptance.md +67 -0
  32. package/docs/architecture/AGENTSAM-PRODUCT-CATALOG-RELEASES-20261028.md +80 -0
  33. package/docs/architecture/AGENTSAM_ACCOUNT_FIRST_METRICS_V2_2026-10-28.md +38 -0
  34. package/docs/architecture/AGENTSAM_APPLICATION_CONTRACT.md +37 -0
  35. package/docs/architecture/AGENTSAM_WORK_IDE_LANES_2026-10-28.md +51 -0
  36. package/docs/architecture/DESIGN_WORKSPACE_BOUNDARY.md +69 -0
  37. package/docs/architecture/PLATFORM_R2_SOURCE_OF_TRUTH.md +134 -0
  38. package/docs/architecture/PROJECTS_DREAMHOUSE_METRICS_SPRINT_2026-10-28.md +34 -0
  39. package/docs/architecture/SAM_KERNEL.md +8 -2
  40. package/docs/architecture/SCHEMA_AUTHORITIES.md +87 -0
  41. package/docs/architecture/brand-presentation-context-discovery-2026-11-01.md +41 -0
  42. package/docs/architecture/studio-templates-audit-2026-11-01.md +59 -0
  43. package/docs/audits/2026-10-28-cms-platform-seam-baseline.md +86 -0
  44. package/docs/audits/2026-10-28-cms-v1-v2-side-by-side.md +53 -0
  45. package/docs/authoring/agentsam-sdk-docs-portal.json +175 -0
  46. package/docs/brand/ICONOGRAPHY-WIP-HANDOFF-20261022.md +36 -0
  47. package/docs/brand/ICONOGRAPHY_INTEGRATION_AUDIT_2026-10-28.md +39 -0
  48. package/docs/engineering/CMS_DATA_AUTHORITY_2026-11-03.md +45 -0
  49. package/docs/engineering/LOCAL_STUDIO_CMS_INSTALL_2026-11-02.md +23 -0
  50. package/docs/evidence/COPRO_CREATIVE_V1_20261030.md +22 -0
  51. package/docs/evidence/media-library-20261031/README.md +39 -0
  52. package/docs/generated/SDK_CAPABILITY_INVENTORY.md +29 -30
  53. package/docs/handoffs/COPRO_CREATIVE_V1_AGENT2.md +69 -0
  54. package/docs/media/local-intake-r2-backup.md +47 -0
  55. package/docs/operations/CLOUDFLARE-QUEUE-OBSERVABILITY.md +64 -0
  56. package/docs/operations/WIP_RECONCILIATION_2026-11-02.md +89 -0
  57. package/docs/plans/AGENTSAM_MEDIA_LIBRARY_AGENT1_MAP_20261031.md +62 -0
  58. package/docs/plans/AGENTSAM_SDK_RELEASE_PROGRAM.md +145 -0
  59. package/docs/plans/LOCAL_STUDIO_DESKTOP_RELEASE_2026-09-29.md +5 -3
  60. package/docs/plans/TOMORROW-EXTENSIVE-TODO-2026-09-26.md +1 -1
  61. package/docs/plugins.md +54 -0
  62. package/docs/primetech/CREATIVE_ENGINEERING.md +125 -0
  63. package/docs/product/PACKAGE-TAXONOMY.md +3 -12
  64. package/docs/reference/AGENTSAM-REGISTRY.generated.md +26 -25
  65. package/docs/release/NPM-TRUSTED-PUBLISHING.md +13 -0
  66. package/docs/releases/INDEPENDENT_PACKAGE_PUBLISHING.md +30 -0
  67. package/docs/roadmaps/2026-10-28-product-platform-stabilization.md +149 -0
  68. package/docs/sprints/2026-11-14-companion-media-product-preview.md +42 -0
  69. package/docs/standards/DELIVERY_CLOSURE.md +9 -1
  70. package/docs/studio/oauth-ddl-media-completion-2026-11-01.md +22 -0
  71. package/docs/studio/pwa-build-meta-agentsam-note.md +9 -0
  72. package/examples/widget-consumer/package.json +12 -0
  73. package/examples/widget-consumer/src/smoke.mjs +18 -0
  74. package/migrations/d1/0021_agentsam_product_releases.sql +94 -0
  75. package/migrations/d1/0022_agentsam_plugin_registry.sql +182 -0
  76. package/migrations/d1/0023_agentsam_plugin_install_health.sql +33 -0
  77. package/migrations/d1/0024_user_oauth_tokens_account_spine.sql +61 -0
  78. package/migrations/d1/0025_meta_model_api_service.sql +7 -0
  79. package/migrations/d1/0026_identity_github_signin_product.sql +34 -0
  80. package/migrations/d1/0027_unified_digital_products_collections.sql +72 -0
  81. package/migrations/d1/README_PORTABLE_CONTROL_PLANE.md +2 -0
  82. package/migrations/runtime/0010_agentsam_notifications.sql +86 -0
  83. package/migrations/runtime/0011_agentsam_product_releases.sql +94 -0
  84. package/native/agentsam-machine/cli/Cargo.toml +1 -1
  85. package/native/agentsam-machine/cli/LICENSE +110 -0
  86. package/native/agentsam-machine/core/Cargo.toml +1 -1
  87. package/native/agentsam-machine/core/LICENSE +110 -0
  88. package/native/agentsam-machine/core/src/lib.rs +3 -3
  89. package/package.json +73 -75
  90. package/packages/agentsam-3d-viewer/LICENSE +110 -0
  91. package/packages/agentsam-3d-viewer/README.md +58 -0
  92. package/packages/agentsam-3d-viewer/agentsam.package.json +63 -0
  93. package/packages/agentsam-3d-viewer/package.json +41 -0
  94. package/packages/agentsam-3d-viewer/src/format.d.ts +3 -0
  95. package/packages/agentsam-3d-viewer/src/format.js +24 -0
  96. package/packages/agentsam-3d-viewer/src/index.d.ts +104 -0
  97. package/packages/agentsam-3d-viewer/src/index.js +303 -0
  98. package/packages/agentsam-3d-viewer/src/occt.d.ts +12 -0
  99. package/packages/agentsam-3d-viewer/src/occt.js +54 -0
  100. package/packages/agentsam-3d-viewer/test/format.test.mjs +24 -0
  101. package/packages/agentsam-3d-viewer/test/occt.test.mjs +37 -0
  102. package/packages/agentsam-3d-viewer/test/viewport.test.mjs +128 -0
  103. package/packages/agentsam-architectural-intelligence/README.md +8 -0
  104. package/packages/agentsam-architectural-intelligence/data/materials.json +9 -0
  105. package/packages/agentsam-architectural-intelligence/data/sources.json +15 -0
  106. package/packages/agentsam-architectural-intelligence/mcp/server.mjs +80 -0
  107. package/packages/agentsam-architectural-intelligence/package.json +23 -0
  108. package/packages/agentsam-architectural-intelligence/test/reference.test.mjs +30 -0
  109. package/packages/agentsam-architectural-intelligence/test/sam-integration.test.mjs +20 -0
  110. package/packages/agentsam-brand/LICENSE +110 -0
  111. package/packages/agentsam-brand/README.md +6 -0
  112. package/packages/agentsam-brand/package.json +7 -4
  113. package/packages/agentsam-brand/src/cli/controller.js +28 -1
  114. package/packages/agentsam-brand/src/core/iconography/build.js +617 -0
  115. package/packages/agentsam-brand/src/core/iconography/render_clay.py +409 -0
  116. package/packages/agentsam-brand/src/core/preview.js +4 -0
  117. package/packages/agentsam-brand/src/core/processors/sharp.js +5 -3
  118. package/packages/agentsam-brand/src/index.js +2 -0
  119. package/packages/agentsam-cms/LICENSE +110 -0
  120. package/packages/agentsam-cms/README.md +71 -56
  121. package/packages/agentsam-cms/agentsam.package.json +23 -8
  122. package/packages/agentsam-cms/package.json +14 -3
  123. package/packages/agentsam-cms/src/account-context.js +135 -0
  124. package/packages/agentsam-cms/src/aliases.js +1 -1
  125. package/packages/agentsam-cms/src/application.js +252 -0
  126. package/packages/agentsam-cms/src/chat-storage.js +300 -0
  127. package/packages/agentsam-cms/src/contracts.js +105 -63
  128. package/packages/agentsam-cms/src/index.d.ts +84 -29
  129. package/packages/agentsam-cms/src/index.js +1 -0
  130. package/packages/agentsam-cms/src/machine.js +121 -119
  131. package/packages/agentsam-cms/src/node.d.ts +3 -7
  132. package/packages/agentsam-cms/src/node.js +8 -1
  133. package/packages/agentsam-cms/src/site-nav-defaults.js +16 -0
  134. package/packages/agentsam-cms/src/site-settings-contract.js +37 -0
  135. package/packages/agentsam-cms/test/application.test.mjs +134 -0
  136. package/packages/agentsam-cms/test/chat-storage.test.mjs +212 -0
  137. package/packages/agentsam-cms/test/standalone.test.mjs +69 -8
  138. package/packages/agentsam-cms/test/support/memory-repository.mjs +78 -0
  139. package/packages/agentsam-communications/README.md +52 -0
  140. package/packages/agentsam-communications/package.json +30 -0
  141. package/packages/agentsam-communications/src/adapters.js +78 -0
  142. package/packages/agentsam-communications/src/index.js +3 -0
  143. package/packages/agentsam-communications/src/outbox.js +56 -0
  144. package/packages/agentsam-communications/src/service.js +126 -0
  145. package/packages/agentsam-communications/test/communications.test.mjs +188 -0
  146. package/packages/agentsam-contracts/README.md +23 -0
  147. package/packages/agentsam-contracts/agentsam.package.json +2 -2
  148. package/packages/agentsam-contracts/dist/authority.d.ts +2 -1
  149. package/packages/agentsam-contracts/dist/authority.js +12 -0
  150. package/packages/agentsam-contracts/dist/design-workspace-bridge.d.ts +20 -0
  151. package/packages/agentsam-contracts/dist/design-workspace-registry.d.ts +12 -0
  152. package/packages/agentsam-contracts/dist/design-workspace-registry.js +133 -0
  153. package/packages/agentsam-contracts/dist/design-workspace.d.ts +115 -0
  154. package/packages/agentsam-contracts/dist/design-workspace.js +64 -0
  155. package/packages/agentsam-contracts/dist/index.d.ts +7 -0
  156. package/packages/agentsam-contracts/dist/index.js +580 -0
  157. package/packages/agentsam-contracts/dist/operations.d.ts +138 -0
  158. package/packages/agentsam-contracts/dist/operations.js +117 -0
  159. package/packages/agentsam-contracts/dist/resource-scope.d.ts +24 -0
  160. package/packages/agentsam-contracts/dist/resource-scope.js +25 -0
  161. package/packages/agentsam-contracts/dist/source-types.d.ts +92 -0
  162. package/packages/agentsam-contracts/dist/source-types.js +13 -0
  163. package/packages/agentsam-contracts/dist/spawn-policy.d.ts +32 -0
  164. package/packages/agentsam-contracts/dist/spawn-policy.js +27 -0
  165. package/packages/agentsam-contracts/dist/tools.d.ts +12 -5
  166. package/packages/agentsam-contracts/dist/tools.js +164 -0
  167. package/packages/agentsam-contracts/package.json +34 -4
  168. package/packages/agentsam-contracts/schemas/agent-tool-definition.v1.schema.json +78 -0
  169. package/packages/agentsam-contracts/schemas/sam-operation.v1.schema.json +159 -0
  170. package/packages/agentsam-contracts/schemas/sam-result.v1.schema.json +76 -0
  171. package/packages/agentsam-contracts/schemas/source-types.v2.json +9381 -0
  172. package/packages/agentsam-contracts/schemas/source-types.v2.schema.json +571 -0
  173. package/packages/agentsam-contracts/scripts/build.mjs +21 -5
  174. package/packages/agentsam-contracts/src/authority.ts +9 -7
  175. package/packages/agentsam-contracts/src/design-workspace-bridge.ts +99 -0
  176. package/packages/agentsam-contracts/src/design-workspace-registry.ts +130 -0
  177. package/packages/agentsam-contracts/src/design-workspace.ts +256 -0
  178. package/packages/agentsam-contracts/src/index.ts +7 -0
  179. package/packages/agentsam-contracts/src/operations.ts +229 -0
  180. package/packages/agentsam-contracts/src/resource-scope.ts +39 -0
  181. package/packages/agentsam-contracts/src/source-types.ts +92 -0
  182. package/packages/agentsam-contracts/src/spawn-policy.ts +43 -0
  183. package/packages/agentsam-contracts/src/tools.ts +145 -25
  184. package/packages/agentsam-contracts/test/contracts.test.mjs +112 -2
  185. package/packages/agentsam-contracts/test/design-workspace.test.mjs +238 -0
  186. package/packages/agentsam-contracts/test/resource-scope.test.mjs +22 -0
  187. package/packages/agentsam-contracts/test/source-types.test.mjs +31 -0
  188. package/packages/agentsam-contracts/test/spawn-policy.test.mjs +20 -0
  189. package/packages/agentsam-desktop-shell/LICENSE +110 -0
  190. package/packages/agentsam-desktop-shell/README.md +48 -13
  191. package/packages/agentsam-errors/agentsam.package.json +1 -1
  192. package/packages/agentsam-errors/package.json +2 -2
  193. package/packages/agentsam-errors/protocol/agentsam.error.v2.schema.json +1 -1
  194. package/packages/agentsam-goap/LICENSE +110 -0
  195. package/packages/agentsam-goap/package.json +4 -4
  196. package/packages/agentsam-hooks/agentsam.package.json +1 -1
  197. package/packages/agentsam-hooks/package.json +2 -2
  198. package/packages/agentsam-hooks/schema/manifest.json +1 -1
  199. package/packages/agentsam-ide/LICENSE +110 -0
  200. package/packages/agentsam-ide/README.md +88 -0
  201. package/packages/agentsam-knowledge/LICENSE +110 -0
  202. package/packages/agentsam-knowledge/package.json +3 -3
  203. package/packages/agentsam-merch/LICENSE +110 -0
  204. package/packages/agentsam-merch/README.md +59 -39
  205. package/packages/agentsam-merch/agentsam.package.json +1 -1
  206. package/packages/agentsam-merch/package.json +18 -3
  207. package/packages/agentsam-merch/profiles/completeful/dtg-back-large.json +1 -1
  208. package/packages/agentsam-merch/profiles/completeful/laser-engraving.json +1 -1
  209. package/packages/agentsam-merch/profiles/generic/embroidery-digitization.json +1 -1
  210. package/packages/agentsam-merch/schemas/collection-candidate.schema.json +1 -1
  211. package/packages/agentsam-merch/schemas/manufacturing-profile.schema.json +1 -1
  212. package/packages/agentsam-merch/src/adapters-printify.js +66 -0
  213. package/packages/agentsam-merch/src/collection-planning.d.ts +46 -0
  214. package/packages/agentsam-merch/src/collection-planning.js +135 -0
  215. package/packages/agentsam-merch/src/collection-showcase.css +34 -0
  216. package/packages/agentsam-merch/src/collection-showcase.d.ts +2 -0
  217. package/packages/agentsam-merch/src/collection-showcase.js +62 -0
  218. package/packages/agentsam-merch/src/compatibility.js +18 -1
  219. package/packages/agentsam-merch/src/geometry.js +82 -0
  220. package/packages/agentsam-merch/src/index.d.ts +33 -0
  221. package/packages/agentsam-merch/src/index.js +2 -0
  222. package/packages/agentsam-merch/src/merch-hero.css +32 -0
  223. package/packages/agentsam-merch/src/merch-hero.d.ts +5 -0
  224. package/packages/agentsam-merch/src/merch-hero.js +123 -0
  225. package/packages/agentsam-merch/src/node/index.js +1 -0
  226. package/packages/agentsam-merch/src/node/vector.js +83 -0
  227. package/packages/agentsam-merch/test/collection-planning.test.mjs +17 -0
  228. package/packages/agentsam-merch/test/collection-showcase.test.mjs +12 -0
  229. package/packages/agentsam-merch/test/geometry.test.mjs +32 -0
  230. package/packages/agentsam-merch/test/printify-adapter.test.mjs +42 -0
  231. package/packages/agentsam-merch/test/svg-normalization.test.mjs +33 -0
  232. package/packages/agentsam-nav/LICENSE +110 -0
  233. package/packages/agentsam-nav/README.md +21 -1
  234. package/packages/agentsam-nav/dist/AdminAppsDialog.d.ts +15 -0
  235. package/packages/agentsam-nav/dist/Nav.d.ts +3 -1
  236. package/packages/agentsam-nav/dist/NavProvider.d.ts +8 -1
  237. package/packages/agentsam-nav/dist/NavTrigger.d.ts +1 -1
  238. package/packages/agentsam-nav/dist/Surfaces.d.ts +16 -1
  239. package/packages/agentsam-nav/dist/browser.d.ts +18 -0
  240. package/packages/agentsam-nav/dist/browser.global.js +62 -22
  241. package/packages/agentsam-nav/dist/browser.js +7589 -6095
  242. package/packages/agentsam-nav/dist/contracts.d.ts +71 -2
  243. package/packages/agentsam-nav/dist/index.d.ts +4 -0
  244. package/packages/agentsam-nav/dist/index.js +1353 -190
  245. package/packages/agentsam-nav/dist/legacy.css +7 -4
  246. package/packages/agentsam-nav/dist/shell.css +380 -11
  247. package/packages/agentsam-nav/dist/state.d.ts +25 -0
  248. package/packages/agentsam-nav/dist/theme.css +380 -11
  249. package/packages/agentsam-nav/dist/useAdminApps.d.ts +55 -0
  250. package/packages/agentsam-nav/dist/utils.d.ts +4 -0
  251. package/packages/agentsam-nav/package.json +7 -3
  252. package/packages/agentsam-occt/.native-build/CMakeCache.txt +433 -0
  253. package/packages/agentsam-occt/.native-build/CMakeFiles/4.4.4/CMakeCXXCompiler.cmake +103 -0
  254. package/packages/agentsam-occt/.native-build/CMakeFiles/4.4.4/CMakeDetermineCompilerABI_CXX.bin +0 -0
  255. package/packages/agentsam-occt/.native-build/CMakeFiles/4.4.4/CMakeSystem.cmake +15 -0
  256. package/packages/agentsam-occt/.native-build/CMakeFiles/4.4.4/CompilerIdCXX/CMakeCXXCompilerId.cpp +954 -0
  257. package/packages/agentsam-occt/.native-build/CMakeFiles/4.4.4/CompilerIdCXX/a.out +0 -0
  258. package/packages/agentsam-occt/.native-build/CMakeFiles/4.4.4/CompilerIdCXX/apple-sdk.cpp +1 -0
  259. package/packages/agentsam-occt/.native-build/CMakeFiles/CMakeConfigureLog.yaml +2968 -0
  260. package/packages/agentsam-occt/.native-build/CMakeFiles/CMakeDirectoryInformation.cmake +16 -0
  261. package/packages/agentsam-occt/.native-build/CMakeFiles/InstallScripts.json +7 -0
  262. package/packages/agentsam-occt/.native-build/CMakeFiles/Makefile.cmake +53 -0
  263. package/packages/agentsam-occt/.native-build/CMakeFiles/Makefile2 +157 -0
  264. package/packages/agentsam-occt/.native-build/CMakeFiles/TargetDirectories.txt +4 -0
  265. package/packages/agentsam-occt/.native-build/CMakeFiles/agentsam-occt.dir/DependInfo.cmake +24 -0
  266. package/packages/agentsam-occt/.native-build/CMakeFiles/agentsam-occt.dir/build.make +146 -0
  267. package/packages/agentsam-occt/.native-build/CMakeFiles/agentsam-occt.dir/cmake_clean.cmake +13 -0
  268. package/packages/agentsam-occt/.native-build/CMakeFiles/agentsam-occt.dir/compiler_depend.internal +3152 -0
  269. package/packages/agentsam-occt/.native-build/CMakeFiles/agentsam-occt.dir/compiler_depend.make +6886 -0
  270. package/packages/agentsam-occt/.native-build/CMakeFiles/agentsam-occt.dir/compiler_depend.ts +2 -0
  271. package/packages/agentsam-occt/.native-build/CMakeFiles/agentsam-occt.dir/depend.make +2 -0
  272. package/packages/agentsam-occt/.native-build/CMakeFiles/agentsam-occt.dir/engine.cpp.o +0 -0
  273. package/packages/agentsam-occt/.native-build/CMakeFiles/agentsam-occt.dir/engine.cpp.o.d +1868 -0
  274. package/packages/agentsam-occt/.native-build/CMakeFiles/agentsam-occt.dir/flags.make +12 -0
  275. package/packages/agentsam-occt/.native-build/CMakeFiles/agentsam-occt.dir/link.txt +1 -0
  276. package/packages/agentsam-occt/.native-build/CMakeFiles/agentsam-occt.dir/main.cpp.o +0 -0
  277. package/packages/agentsam-occt/.native-build/CMakeFiles/agentsam-occt.dir/main.cpp.o.d +1279 -0
  278. package/packages/agentsam-occt/.native-build/CMakeFiles/agentsam-occt.dir/progress.make +4 -0
  279. package/packages/agentsam-occt/.native-build/CMakeFiles/agentsam-sketch-solver.dir/DependInfo.cmake +23 -0
  280. package/packages/agentsam-occt/.native-build/CMakeFiles/agentsam-sketch-solver.dir/build.make +114 -0
  281. package/packages/agentsam-occt/.native-build/CMakeFiles/agentsam-sketch-solver.dir/cmake_clean.cmake +11 -0
  282. package/packages/agentsam-occt/.native-build/CMakeFiles/agentsam-sketch-solver.dir/cmake_clean_target.cmake +3 -0
  283. package/packages/agentsam-occt/.native-build/CMakeFiles/agentsam-sketch-solver.dir/compiler_depend.internal +1256 -0
  284. package/packages/agentsam-occt/.native-build/CMakeFiles/agentsam-sketch-solver.dir/compiler_depend.make +3757 -0
  285. package/packages/agentsam-occt/.native-build/CMakeFiles/agentsam-sketch-solver.dir/compiler_depend.ts +2 -0
  286. package/packages/agentsam-occt/.native-build/CMakeFiles/agentsam-sketch-solver.dir/depend.make +2 -0
  287. package/packages/agentsam-occt/.native-build/CMakeFiles/agentsam-sketch-solver.dir/flags.make +12 -0
  288. package/packages/agentsam-occt/.native-build/CMakeFiles/agentsam-sketch-solver.dir/link.txt +2 -0
  289. package/packages/agentsam-occt/.native-build/CMakeFiles/agentsam-sketch-solver.dir/progress.make +3 -0
  290. package/packages/agentsam-occt/.native-build/CMakeFiles/agentsam-sketch-solver.dir/sketch_solver.cpp.o +0 -0
  291. package/packages/agentsam-occt/.native-build/CMakeFiles/agentsam-sketch-solver.dir/sketch_solver.cpp.o.d +1252 -0
  292. package/packages/agentsam-occt/.native-build/CMakeFiles/cmake.check_cache +1 -0
  293. package/packages/agentsam-occt/.native-build/CMakeFiles/progress.marks +1 -0
  294. package/packages/agentsam-occt/.native-build/Makefile +249 -0
  295. package/packages/agentsam-occt/.native-build/agentsam-occt +0 -0
  296. package/packages/agentsam-occt/.native-build/cmake_install.cmake +61 -0
  297. package/packages/agentsam-occt/.native-build/libagentsam-sketch-solver.a +0 -0
  298. package/packages/agentsam-occt/LICENSE +110 -0
  299. package/packages/agentsam-occt/README.md +100 -0
  300. package/packages/agentsam-occt/agentsam.package.json +60 -0
  301. package/packages/agentsam-occt/dist/browser.d.ts +32 -0
  302. package/packages/agentsam-occt/dist/browser.js +71 -0
  303. package/packages/agentsam-occt/dist/browser.js.map +1 -0
  304. package/packages/agentsam-occt/dist/index.d.ts +8 -0
  305. package/packages/agentsam-occt/dist/index.js +25 -0
  306. package/packages/agentsam-occt/dist/index.js.map +1 -0
  307. package/packages/agentsam-occt/dist/native-provider.d.mts +107 -0
  308. package/packages/agentsam-occt/dist/native-provider.mjs +177 -0
  309. package/packages/agentsam-occt/dist/native-provider.mjs.map +1 -0
  310. package/packages/agentsam-occt/dist/native-session.d.mts +8 -0
  311. package/packages/agentsam-occt/dist/native-session.mjs +64 -0
  312. package/packages/agentsam-occt/dist/native-session.mjs.map +1 -0
  313. package/packages/agentsam-occt/native/CMakeLists.txt +47 -0
  314. package/packages/agentsam-occt/native/engine.cpp +864 -0
  315. package/packages/agentsam-occt/native/engine.hpp +2 -0
  316. package/packages/agentsam-occt/native/main.cpp +123 -0
  317. package/packages/agentsam-occt/native/sketch_solver.cpp +198 -0
  318. package/packages/agentsam-occt/native/sketch_solver.hpp +5 -0
  319. package/packages/agentsam-occt/package.json +46 -0
  320. package/packages/agentsam-occt/src/browser.ts +92 -0
  321. package/packages/agentsam-occt/src/index.js +24 -0
  322. package/packages/agentsam-occt/src/native-provider.mjs +156 -0
  323. package/packages/agentsam-occt/src/native-session.d.mts +5 -0
  324. package/packages/agentsam-occt/src/native-session.mjs +35 -0
  325. package/packages/agentsam-occt/test/browser-provider.test.mjs +90 -0
  326. package/packages/agentsam-occt/test/contracts.test.mjs +32 -0
  327. package/packages/agentsam-occt/test/native-engine.test.mjs +49 -0
  328. package/packages/agentsam-occt/tsconfig.json +18 -0
  329. package/packages/agentsam-queue-control/LICENSE +110 -0
  330. package/packages/agentsam-queue-control/agentsam.package.json +1 -1
  331. package/packages/agentsam-queue-control/package.json +3 -3
  332. package/packages/agentsam-queue-control/schemas/job-envelope.schema.json +1 -1
  333. package/packages/agentsam-queue-control/src/adapters/cloudflare.js +39 -3
  334. package/packages/agentsam-queue-control/test/cloudflare-observability.test.mjs +54 -0
  335. package/packages/agentsam-rapid-rust/Cargo.toml +1 -1
  336. package/packages/agentsam-rapid-rust/LICENSE +110 -0
  337. package/packages/agentsam-repository/LICENSE +110 -0
  338. package/packages/agentsam-repository/package.json +3 -3
  339. package/packages/agentsam-site-scrape/README.md +1 -1
  340. package/packages/agentsam-site-scrape/tests/test_contract.py +1 -1
  341. package/packages/agentsam-vault/LICENSE +110 -0
  342. package/packages/agentsam-vault/package.json +3 -3
  343. package/packages/agentsam-workbench/LICENSE +110 -0
  344. package/packages/agentsam-workbench/package.json +20 -5
  345. package/packages/agentsam-workbench/src/agent/AgentRuntimeField.tsx +12 -7
  346. package/packages/agentsam-workbench/src/agent/Composer.tsx +10 -3
  347. package/packages/agentsam-workbench/src/agent/MiniAgentSam.tsx +129 -16
  348. package/packages/agentsam-workbench/src/agent/SelectionToolbar.tsx +161 -0
  349. package/packages/agentsam-workbench/src/agent/capability-catalog.ts +15 -8
  350. package/packages/agentsam-workbench/src/agent/index.ts +2 -0
  351. package/packages/agentsam-workbench/src/agent/mini-agentsam.css +18 -6
  352. package/packages/agentsam-workbench/src/agent/selection-toolbar.css +84 -0
  353. package/packages/agentsam-workbench/src/design/DesignWorkspaceFrame.tsx +209 -0
  354. package/packages/agentsam-workbench/src/design/canvas-handoff.ts +44 -0
  355. package/packages/agentsam-workbench/src/design/design-workspace.css +267 -0
  356. package/packages/agentsam-workbench/src/design/index.ts +7 -0
  357. package/packages/agentsam-workbench/src/index.ts +1 -0
  358. package/packages/agentsam-workbench/src/resources/ResourceCard.tsx +90 -0
  359. package/packages/agentsam-workbench/src/resources/index.ts +6 -0
  360. package/packages/agentsam-workbench/src/resources/resource-card.css +174 -0
  361. package/packages/agentsam-workbench/src/widgets/BuiltinWidget.tsx +6 -0
  362. package/packages/agentsam-workbench/src/widgets/CalculatorWidget.tsx +81 -0
  363. package/packages/agentsam-workbench/src/widgets/ClockWidget.tsx +66 -0
  364. package/packages/agentsam-workbench/src/widgets/QueueDepthWidget.tsx +122 -0
  365. package/packages/agentsam-workbench/src/widgets/calculator.ts +57 -0
  366. package/packages/agentsam-workbench/src/widgets/clock.ts +54 -0
  367. package/packages/agentsam-workbench/src/widgets/index.ts +5 -0
  368. package/packages/agentsam-workbench/src/widgets/registry.ts +27 -24
  369. package/packages/agentsam-workbench/src/widgets/widgets.css +31 -0
  370. package/packages/catalog/evidence/theme-scenes.json +5 -14
  371. package/packages/catalog/generated/packages.json +369 -522
  372. package/packages/catalog/src/theme-products.mjs +64 -0
  373. package/packages/connectors/cfoa/LICENSE +110 -0
  374. package/packages/connectors/cfoa/OAUTH_STORAGE_AUDIT.md +5 -0
  375. package/packages/connectors/cfoa/package.json +2 -2
  376. package/packages/connectors/cfoa/src/api-client.js +54 -8
  377. package/packages/connectors/cfoa/src/capabilities.js +41 -1
  378. package/packages/connectors/cfoa/src/credential.js +381 -48
  379. package/packages/connectors/cfoa/src/families/media.js +622 -0
  380. package/packages/connectors/cfoa/src/index.js +36 -2
  381. package/packages/connectors/cfoa/src/oauth-persist.js +231 -95
  382. package/packages/connectors/cfoa/src/routes.js +270 -34
  383. package/packages/connectors/cfoa/src/scope-catalog.js +14 -1
  384. package/packages/connectors/cfoa/tests/api-client-fetch.test.mjs +71 -0
  385. package/packages/connectors/cfoa/tests/capabilities.test.mjs +28 -3
  386. package/packages/connectors/cfoa/tests/connector.test.mjs +5 -5
  387. package/packages/connectors/cfoa/tests/cross-host-recovery.test.mjs +125 -0
  388. package/packages/connectors/cfoa/tests/media-discovery.test.mjs +260 -0
  389. package/packages/connectors/cfoa/tests/oauth-persist.test.mjs +114 -14
  390. package/packages/identity/.agentsam/features/oauth-login-portal/agentsam.feature.json +1 -1
  391. package/packages/identity/LICENSE +110 -0
  392. package/packages/identity/README.md +25 -0
  393. package/packages/identity/agentsam.package.json +1 -1
  394. package/packages/identity/migrations/apply-portable.js +1 -0
  395. package/packages/identity/migrations/sqlite/006_identity_account_security.sql +31 -0
  396. package/packages/identity/package.json +4 -2
  397. package/packages/identity/schema/agentsam.identity/manifest.json +31 -9
  398. package/packages/identity/src/adapters/account-security-store.js +236 -0
  399. package/packages/identity/src/adapters/iam-compat/index.js +13 -0
  400. package/packages/identity/src/adapters/portable-store.js +15 -0
  401. package/packages/identity/src/contracts/sign-in-options.js +10 -0
  402. package/packages/identity/src/core/account-security.js +149 -0
  403. package/packages/identity/src/frontend/auth-portal/pages/login.html +14 -2
  404. package/packages/identity/src/frontend/auth-portal/pages/signup.html +10 -4
  405. package/packages/identity/src/frontend/merchant-onboarding/store-start.css +9 -0
  406. package/packages/identity/src/frontend/merchant-onboarding/store-start.html +73 -0
  407. package/packages/identity/src/frontend/merchant-onboarding/store-start.js +166 -0
  408. package/packages/identity/src/migrations/0004_account_security.sql +24 -0
  409. package/packages/identity/src/server/merchant-onboarding.js +103 -0
  410. package/packages/identity/src/server/worker-router.js +192 -5
  411. package/packages/identity/tests/account-security.test.mjs +341 -0
  412. package/packages/identity/tests/chatgpt-provider.test.mjs +4 -2
  413. package/packages/identity/tests/lane1-packed-consumer.test.mjs +18 -4
  414. package/packages/identity/tests/merchant-onboarding-portability.test.mjs +77 -0
  415. package/packages/identity/tests/portable-identity-architecture.test.mjs +3 -3
  416. package/packages/identity/tests/preview-auth-portal.test.mjs +2 -0
  417. package/packages/identity/tests/stock-product-provenance.test.mjs +22 -0
  418. package/packages/primetech-procedures/README.md +61 -0
  419. package/packages/primetech-procedures/agentsam.package.json +63 -0
  420. package/packages/primetech-procedures/package.json +22 -0
  421. package/packages/primetech-procedures/procedures/cad.motor-bearing-end-plate/README.md +21 -0
  422. package/packages/primetech-procedures/procedures/cad.motor-bearing-end-plate/__pycache__/test_generate_toolpaths.cpython-314.pyc +0 -0
  423. package/packages/primetech-procedures/procedures/cad.motor-bearing-end-plate/build_freecad.py +514 -0
  424. package/packages/primetech-procedures/procedures/cad.motor-bearing-end-plate/finalize_bundle.py +26 -0
  425. package/packages/primetech-procedures/procedures/cad.motor-bearing-end-plate/generate_assets.py +284 -0
  426. package/packages/primetech-procedures/procedures/cad.motor-bearing-end-plate/generate_toolpaths.py +715 -0
  427. package/packages/primetech-procedures/procedures/cad.motor-bearing-end-plate/package_artifacts.py +154 -0
  428. package/packages/primetech-procedures/procedures/cad.motor-bearing-end-plate/parameters.json +51 -0
  429. package/packages/primetech-procedures/procedures/cad.motor-bearing-end-plate/procedure.json +101 -0
  430. package/packages/primetech-procedures/procedures/cad.motor-bearing-end-plate/render_preview.py +98 -0
  431. package/packages/primetech-procedures/procedures/cad.motor-bearing-end-plate/run.py +214 -0
  432. package/packages/primetech-procedures/procedures/cad.motor-bearing-end-plate/test_generate_toolpaths.py +50 -0
  433. package/packages/primetech-procedures/procedures/repo.asset.inventory/__pycache__/run.cpython-312.pyc +0 -0
  434. package/packages/primetech-procedures/procedures/repo.asset.inventory/procedure.json +65 -0
  435. package/packages/primetech-procedures/procedures/repo.asset.inventory/run.py +116 -0
  436. package/packages/primetech-procedures/procedures/repo.asset.inventory/run.sh +11 -0
  437. package/packages/primetech-procedures/profiles/PRIMETECH_PROCEDURE_ENGINEER.md +25 -0
  438. package/packages/primetech-procedures/src/index.js +547 -0
  439. package/packages/primetech-procedures/test/__pycache__/test_inventory.cpython-312.pyc +0 -0
  440. package/packages/primetech-procedures/test/procedure.test.mjs +207 -0
  441. package/packages/primetech-procedures/test/test_inventory.py +57 -0
  442. package/packages/providers/completeful/LICENSE +110 -0
  443. package/packages/providers/completeful/README.md +67 -27
  444. package/packages/providers/completeful/dist/client.d.ts +118 -0
  445. package/packages/providers/completeful/dist/client.js +221 -0
  446. package/packages/providers/completeful/dist/generated/operations.generated.d.ts +760 -0
  447. package/packages/providers/completeful/dist/generated/operations.generated.js +931 -0
  448. package/packages/providers/completeful/dist/generated/types.generated.d.ts +1173 -0
  449. package/packages/providers/completeful/dist/generated/types.generated.js +1 -0
  450. package/packages/providers/completeful/openapi/openapi.json +5320 -0
  451. package/packages/providers/completeful/package.json +34 -8
  452. package/packages/providers/completeful/scripts/generate.mjs +156 -0
  453. package/packages/providers/completeful/src/client.js +12 -162
  454. package/packages/providers/completeful/src/core/client.ts +248 -0
  455. package/packages/providers/completeful/src/core/generated/operations.generated.ts +931 -0
  456. package/packages/providers/completeful/src/core/generated/types.generated.ts +94 -0
  457. package/packages/providers/completeful/src/index.d.ts +24 -0
  458. package/packages/providers/completeful/src/index.js +3 -0
  459. package/packages/providers/completeful/test/openapi.test.mjs +70 -0
  460. package/packages/providers/completeful/test/types/consumer.ts +30 -0
  461. package/packages/providers/completeful/test/types/tsconfig.json +12 -0
  462. package/packages/providers/completeful/tsconfig.json +15 -0
  463. package/packages/theme-scenes/LICENSE +110 -0
  464. package/packages/theme-scenes/README.md +57 -2
  465. package/packages/theme-scenes/agentsam.package.json +42 -19
  466. package/packages/theme-scenes/package.json +11 -12
  467. package/packages/theme-scenes/src/cms/adapter.js +232 -0
  468. package/packages/theme-scenes/src/cms/browser.js +5 -0
  469. package/packages/theme-scenes/src/cms/index.js +22 -0
  470. package/packages/theme-scenes/src/cms/runtime.js +524 -0
  471. package/packages/theme-scenes/src/contracts/index.js +40 -0
  472. package/packages/theme-scenes/src/index.js +1 -0
  473. package/packages/theme-scenes/src/runtime/compile.js +24 -0
  474. package/packages/theme-scenes/src/scenes/index.js +3 -1
  475. package/packages/theme-scenes/src/visuals/index.js +7 -0
  476. package/packages/theme-scenes/test/cms.test.mjs +118 -0
  477. package/packages/theme-scenes/test/theme-scenes.test.mjs +52 -0
  478. package/packages/work-graph/LICENSE +110 -0
  479. package/packages/work-graph/package.json +2 -2
  480. package/protocol/README.md +2 -2
  481. package/protocol/apps/agentsam.app.v1.schema.json +1 -1
  482. package/protocol/apps/agentsam.host-install.v1.schema.json +1 -1
  483. package/protocol/assets/asset-record.v1.schema.json +1 -1
  484. package/protocol/brand/brandpack.v1.schema.json +1 -1
  485. package/protocol/cad/README.md +8 -0
  486. package/protocol/cad/blender-recipe.schema.json +1 -1
  487. package/protocol/cad/cad.project.v2.schema.json +107 -4
  488. package/protocol/canvas/knowledge-core.mjs +35 -0
  489. package/protocol/capabilities/capability-manifest.schema.json +1 -1
  490. package/protocol/capabilities/cloudflare-cpu-audit-input.schema.json +1 -1
  491. package/protocol/capabilities/cloudflare-cpu-profile-input.schema.json +1 -1
  492. package/protocol/capabilities/cloudflare-wrangler-native-input.schema.json +1 -1
  493. package/protocol/capabilities/evidence-manifest.schema.json +1 -1
  494. package/protocol/capabilities/knowledge-search-input.schema.json +1 -1
  495. package/protocol/capabilities/manifest.json +36 -1
  496. package/protocol/capabilities/repository-audit-input.schema.json +1 -1
  497. package/protocol/capabilities/repository-audit.schema.json +1 -1
  498. package/protocol/capabilities/repository-crawl-input.schema.json +1 -0
  499. package/protocol/capabilities/repository-crawl-result.schema.json +1 -0
  500. package/protocol/capabilities/repository-mine-input.schema.json +1 -0
  501. package/protocol/capabilities/repository-mine-result.schema.json +1 -0
  502. package/protocol/capabilities/repository-snapshot-input.schema.json +1 -1
  503. package/protocol/capabilities/repository-snapshot.schema.json +1 -1
  504. package/protocol/capabilities/site-index.schema.json +1 -1
  505. package/protocol/capabilities/site-scrape-evidence-manifest.schema.json +1 -1
  506. package/protocol/capabilities/site-scrape-input.schema.json +1 -1
  507. package/protocol/capabilities/site-scrape-project-authority.schema.json +1 -1
  508. package/protocol/capabilities/site-scrape-result.schema.json +1 -1
  509. package/protocol/capabilities/site-scrape-worker-job.schema.json +1 -1
  510. package/protocol/capabilities/terminal-exec-input.schema.json +1 -1
  511. package/protocol/context/context-budget.schema.json +1 -1
  512. package/protocol/context/context-item.schema.json +1 -1
  513. package/protocol/context/resolved-context-pack.schema.json +3 -3
  514. package/protocol/context/result-policy.schema.json +1 -1
  515. package/protocol/contracts/source-types.v2.json +9381 -0
  516. package/protocol/contracts/source-types.v2.schema.json +571 -0
  517. package/protocol/credentials/issue.v1.schema.json +2 -2
  518. package/protocol/database/agentsam.schema-pack.v1.schema.json +1 -1
  519. package/protocol/database/connection.v1.schema.json +1 -1
  520. package/protocol/embeddings/embedding-profile.v1.schema.json +1 -1
  521. package/protocol/errors/agentsam.error.v2.schema.json +1 -1
  522. package/protocol/errors/error-envelope.schema.json +1 -1
  523. package/protocol/errors/recovery.v1.schema.json +1 -1
  524. package/protocol/features/agentsam.feature.v1.schema.json +1 -1
  525. package/protocol/hooks/README.md +2 -0
  526. package/protocol/hooks/agentsam.hook.output.v1.schema.json +1 -1
  527. package/protocol/hooks/agentsam.hook.receipt.v1.schema.json +1 -1
  528. package/protocol/hooks/agentsam.hook.v1.schema.json +1 -1
  529. package/protocol/hooks/agentsam.hooks.config.v1.schema.json +1 -1
  530. package/protocol/knowledge/chunk.schema.json +1 -1
  531. package/protocol/knowledge/context-pack.schema.json +3 -3
  532. package/protocol/knowledge/document.schema.json +1 -1
  533. package/protocol/knowledge/index-config.schema.json +1 -1
  534. package/protocol/knowledge/ingest-receipt.schema.json +1 -1
  535. package/protocol/knowledge/repository.schema.json +1 -1
  536. package/protocol/knowledge/retrieval-hit.schema.json +1 -1
  537. package/protocol/knowledge/retrieval-query.schema.json +2 -2
  538. package/protocol/knowledge/source.schema.json +1 -1
  539. package/protocol/local-engine/benchmark.v1.schema.json +1 -1
  540. package/protocol/local-engine/engine.v1.schema.json +1 -1
  541. package/protocol/models/discovery.mjs +409 -0
  542. package/protocol/models/model-inventory-v2.schema.json +1 -1
  543. package/protocol/models/provider-model-snapshot.v1.schema.json +1 -1
  544. package/protocol/notifications/README.md +45 -0
  545. package/protocol/packages/agentsam.package-schema-registry.v1.schema.json +108 -0
  546. package/protocol/plugins/agentsam.plugin-evidence-bundle.v1.schema.json +1 -1
  547. package/protocol/plugins/agentsam.plugin-product.v1.schema.json +1 -1
  548. package/protocol/plugins/agentsam.plugin-quality-evidence.v1.schema.json +1 -1
  549. package/protocol/plugins/agentsam.plugin-quality-receipt.v1.schema.json +1 -1
  550. package/protocol/presets/catalog.json +4 -4
  551. package/protocol/product-releases/README.md +132 -0
  552. package/protocol/receipts/agentsam.receipt.v1.json +2 -2
  553. package/protocol/recon/finding-report.schema.json +1 -1
  554. package/protocol/recon/task-packet.schema.json +1 -1
  555. package/protocol/repository/repository-contract.schema.json +1 -1
  556. package/protocol/repository/repository-dependency.schema.json +1 -1
  557. package/protocol/repository/repository-identity.schema.json +1 -1
  558. package/protocol/runtime/agentsam.runtime.v1.schema.json +1 -1
  559. package/protocol/runtime/primetech-procedure.v1.schema.json +125 -0
  560. package/protocol/runtime/terminal-exec.conformance.v1.json +88 -0
  561. package/protocol/runtime/workspace-fs.conformance.v1.json +96 -0
  562. package/protocol/runtime/workspace-fs.v1.schema.json +2 -1
  563. package/protocol/sam/activity.v1.schema.json +1 -1
  564. package/protocol/sam/answer.v1.schema.json +1 -1
  565. package/protocol/sam/calibration.v1.schema.json +1 -1
  566. package/protocol/sam/decision-receipt.v1.schema.json +1 -1
  567. package/protocol/sam/evaluation.v1.schema.json +1 -1
  568. package/protocol/sam/operation.schema.json +103 -10
  569. package/protocol/sam/outcome.v1.schema.json +1 -1
  570. package/protocol/sam/question.v1.schema.json +1 -1
  571. package/protocol/sam/result.schema.json +33 -10
  572. package/protocol/sam/state.v1.schema.json +1 -1
  573. package/protocol/scoring/scorecard.v1.schema.json +1 -1
  574. package/protocol/skills/agentsam.interaction.v1.schema.json +1 -1
  575. package/protocol/skills/agentsam.skill.v1.schema.json +1 -1
  576. package/protocol/theme-refinery/product-metadata.schema.json +1 -1
  577. package/protocol/theme-refinery/reconciliation-receipt.schema.json +1 -1
  578. package/protocol/tools/agent-tool-definition.v1.schema.json +78 -0
  579. package/protocol/ui/agentsam.ui-quality.v1.schema.json +1 -1
  580. package/protocol/ui/icon.v1.schema.json +1 -1
  581. package/python/README.md +97 -21
  582. package/python/agentsam_sdk/__init__.py +5 -2
  583. package/python/agentsam_sdk/assets/__init__.py +4 -0
  584. package/python/agentsam_sdk/assets/geaux_boot.json +25 -0
  585. package/python/agentsam_sdk/assets/procedures.py +40 -0
  586. package/python/agentsam_sdk/cad/__init__.py +5 -0
  587. package/python/agentsam_sdk/cad/native.py +189 -0
  588. package/python/agentsam_sdk/cad/occt.py +96 -0
  589. package/python/agentsam_sdk/cli.py +57 -12
  590. package/python/agentsam_sdk/client.py +226 -26
  591. package/python/agentsam_sdk/data/d1_adapter.py +71 -2
  592. package/python/agentsam_sdk/diagnostics.py +44 -0
  593. package/python/agentsam_sdk/procedures/__init__.py +4 -0
  594. package/python/agentsam_sdk/procedures/client.py +75 -0
  595. package/python/agentsam_sdk/py.typed +0 -0
  596. package/python/agentsam_sdk/runtime/native.py +918 -0
  597. package/python/agentsam_sdk/terminal_art.py +85 -0
  598. package/python/agentsam_sdk/terminal_ui.py +187 -0
  599. package/python/agentsam_sdk/tui/README.md +3 -3
  600. package/python/agentsam_sdk/tui/__init__.py +1 -1
  601. package/python/agentsam_sdk/tui/bootstrap.py +2 -2
  602. package/python/agentsam_sdk/tui/demo.py +2 -2
  603. package/python/docs/gaps.md +12 -3
  604. package/python/docs/release.md +55 -0
  605. package/python/pyproject.toml +33 -6
  606. package/python/scripts/check-dist.py +65 -0
  607. package/python/tests/test_asset_procedure_api.py +66 -0
  608. package/python/tests/test_cad_native.py +73 -0
  609. package/python/tests/test_cad_occt.py +52 -0
  610. package/python/tests/test_cli_distribution.py +82 -0
  611. package/python/tests/test_d1_write_adapter.py +66 -0
  612. package/python/tests/test_native_runtime.py +298 -0
  613. package/python/tests/test_packaging.py +43 -0
  614. package/python/tests/test_procedure_client.py +80 -0
  615. package/python/tests/test_public_client.py +8 -5
  616. package/python/tests/test_terminal_art.py +36 -0
  617. package/services/cad/occt/CMakeLists.txt +7 -41
  618. package/services/cad/occt/README.md +4 -28
  619. package/services/cad/server.py +228 -9
  620. package/skills/README.md +14 -6
  621. package/skills/agentsam-arch-accessibility/SKILL.md +19 -0
  622. package/skills/agentsam-arch-accessibility/agentsam.skill.json +20 -0
  623. package/skills/agentsam-arch-assemblies/SKILL.md +20 -0
  624. package/skills/agentsam-arch-assemblies/agentsam.skill.json +20 -0
  625. package/skills/agentsam-arch-bim/SKILL.md +20 -0
  626. package/skills/agentsam-arch-bim/agentsam.skill.json +20 -0
  627. package/skills/agentsam-arch-cad/SKILL.md +19 -0
  628. package/skills/agentsam-arch-cad/agentsam.skill.json +20 -0
  629. package/skills/agentsam-arch-codes/SKILL.md +19 -0
  630. package/skills/agentsam-arch-codes/agentsam.skill.json +20 -0
  631. package/skills/agentsam-arch-coordination/SKILL.md +19 -0
  632. package/skills/agentsam-arch-coordination/agentsam.skill.json +20 -0
  633. package/skills/agentsam-arch-documents/SKILL.md +19 -0
  634. package/skills/agentsam-arch-documents/agentsam.skill.json +20 -0
  635. package/skills/agentsam-arch-geometry/SKILL.md +19 -0
  636. package/skills/agentsam-arch-geometry/agentsam.skill.json +20 -0
  637. package/skills/agentsam-arch-materials/SKILL.md +19 -0
  638. package/skills/agentsam-arch-materials/agentsam.skill.json +20 -0
  639. package/skills/agentsam-arch-orchestrate/SKILL.md +21 -0
  640. package/skills/agentsam-arch-orchestrate/agentsam.skill.json +20 -0
  641. package/skills/agentsam-arch-specifications/SKILL.md +19 -0
  642. package/skills/agentsam-arch-specifications/agentsam.skill.json +20 -0
  643. package/skills/agentsam-arch-verify/SKILL.md +20 -0
  644. package/skills/agentsam-arch-verify/agentsam.skill.json +20 -0
  645. package/skills/agentsam-canvas-creation/SKILL.md +79 -0
  646. package/skills/agentsam-canvas-creation/references/creation-journey.md +55 -0
  647. package/skills/agentsam-canvas-creation/references/fullstack-creation-checklist.md +28 -0
  648. package/skills/agentsam-canvas-creation/references/quality-and-consistency.md +39 -0
  649. package/skills/agentsam-cms-ready-creation/SKILL.md +68 -0
  650. package/skills/agentsam-cms-ready-creation/references/cms-handoff-map.md +50 -0
  651. package/skills/agentsam-cms-ready-creation/references/web-fullstack-readiness.md +38 -0
  652. package/skills/agentsam-plan-and-goap/SKILL.md +14 -1
  653. package/skills/agentsam-sdk-orientation/SKILL.md +10 -7
  654. package/skills/catalog.json +331 -0
  655. package/src/agent/capability-adapter.js +5 -2
  656. package/src/capabilities/index.js +2 -0
  657. package/src/capabilities/terminal-exec.js +16 -4
  658. package/src/capabilities/workspace-files.js +58 -2
  659. package/src/cli/command-catalog.js +24 -1
  660. package/src/cli/desktop-launch.js +107 -0
  661. package/src/cli.js +47 -12
  662. package/src/commands/app.js +2 -2
  663. package/src/commands/dockerize.js +11 -2
  664. package/src/commands/goals.js +59 -0
  665. package/src/commands/goap.js +48 -1
  666. package/src/commands/mcp.js +80 -16
  667. package/src/commands/memory.js +102 -0
  668. package/src/commands/package.js +1 -1
  669. package/src/commands/plugins.js +47 -7
  670. package/src/commands/sam.js +20 -5
  671. package/src/commands/shell.js +17 -0
  672. package/src/commands/skill.js +1 -1
  673. package/src/commands/start-local.js +29 -1
  674. package/src/indexing/ingest/style-evidence.js +10 -6
  675. package/src/lib/cad/discovery.js +6 -1
  676. package/src/lib/cad/editable-project-contract.js +6 -0
  677. package/src/lib/cad/occt-native-provider.mjs +3 -138
  678. package/src/lib/cad/project-runtime.js +17 -1
  679. package/src/lib/cad/project-tools.js +4 -4
  680. package/src/lib/cad/project-v2.d.ts +32 -4
  681. package/src/lib/cad/project-v2.js +37 -0
  682. package/src/lib/cad-docker.js +54 -18
  683. package/src/lib/deploy/local-studio.js +9 -1
  684. package/src/lib/dockerize.js +2 -2
  685. package/src/lib/scaffold/wizards/cms.js +0 -79
  686. package/src/lib/terminal-scopes.js +5 -2
  687. package/src/mcp/authority.js +26 -2
  688. package/src/mcp/browsermcp.js +28 -0
  689. package/src/mcp/client-adapters.js +22 -5
  690. package/src/mcp/client.js +33 -6
  691. package/src/models/discovery.js +1 -373
  692. package/src/models/inventory-core.d.ts +21 -0
  693. package/src/models/inventory-core.js +44 -1
  694. package/src/plugins/browsermcp.js +47 -0
  695. package/src/plugins/contracts.js +8 -0
  696. package/src/plugins/creative.js +38 -0
  697. package/src/plugins/index.js +3 -0
  698. package/src/plugins/registry.js +90 -75
  699. package/src/plugins/runtime.js +12 -3
  700. package/src/providers/factory.js +13 -0
  701. package/src/registry/generated/inventory.json +422 -536
  702. package/src/sam/client.js +1 -1
  703. package/src/sam/define.js +11 -2
  704. package/src/sam/index.js +1 -0
  705. package/src/sam/operation-packs/generated-v2/operation-pack.js +1 -1
  706. package/src/sam/operations/architectural-knowledge.js +30 -0
  707. package/src/sam/operations/artifact-render.js +1 -1
  708. package/src/sam/operations/brand-scan.js +1 -1
  709. package/src/sam/operations/codebaseindex-ingest.js +1 -1
  710. package/src/sam/operations/decision-evaluate.js +1 -1
  711. package/src/sam/operations/package-audit.js +1 -1
  712. package/src/sam/operations/planning-astar.js +1 -1
  713. package/src/sam/operations/planning-goap.js +1 -1
  714. package/src/sam/operations/repository-inspect.js +1 -1
  715. package/src/sam/operations/robotics.js +1 -1
  716. package/src/sam/packs/authoring/index.js +1 -1
  717. package/src/sam/packs/cad/http-ports.js +59 -0
  718. package/src/sam/packs/cms/node.js +1 -1
  719. package/src/sam/packs/core.js +2 -0
  720. package/src/sam/packs/evidence/store-hosted.js +89 -0
  721. package/src/sam/robotics/chess-adapter.js +8 -2
  722. package/src/sam/types.js +17 -98
  723. package/src/security/inventory.js +11 -9
  724. package/src/skills/canvas-knowledge-core.js +1 -0
  725. package/src/skills/canvas-knowledge.js +8 -0
  726. package/src/skills/index.js +2 -0
  727. package/src/tools/registry.js +9 -11
  728. package/src/ui/art/geaux_boot.json +25 -0
  729. package/src/ui/boot.js +21 -20
  730. package/src/ui/companion-art.js +40 -0
  731. package/apps/client-cms-editor/AGENTS.md +0 -17
  732. package/apps/client-cms-editor/IMPORT_PROVENANCE.json +0 -8
  733. package/apps/client-cms-editor/README.md +0 -103
  734. package/apps/client-cms-editor/agentsam.app.json +0 -74
  735. package/apps/client-cms-editor/backend/README.md +0 -5
  736. package/apps/client-cms-editor/backend/package.json +0 -37
  737. package/apps/client-cms-editor/backend/src/api/client.ts +0 -233
  738. package/apps/client-cms-editor/backend/src/index.ts +0 -6
  739. package/apps/client-cms-editor/backend/src/model.ts +0 -11
  740. package/apps/client-cms-editor/backend/src/preview/bridge.ts +0 -79
  741. package/apps/client-cms-editor/backend/src/preview/urls.ts +0 -55
  742. package/apps/client-cms-editor/backend/src/routing/cms-route.js +0 -293
  743. package/apps/client-cms-editor/backend/src/routing/index.js +0 -10
  744. package/apps/client-cms-editor/backend/src/storefront.ts +0 -52
  745. package/apps/client-cms-editor/backend/tsconfig.json +0 -20
  746. package/apps/client-cms-editor/backend/worker/index.js +0 -34
  747. package/apps/client-cms-editor/backend/wrangler.jsonc +0 -11
  748. package/apps/client-cms-editor/bin/agentsam-cms.js +0 -262
  749. package/apps/client-cms-editor/bin/agentsam-cms.mjs +0 -3
  750. package/apps/client-cms-editor/frontend/index.html +0 -12
  751. package/apps/client-cms-editor/frontend/package.json +0 -40
  752. package/apps/client-cms-editor/frontend/src/AgentSamDrawer.tsx +0 -156
  753. package/apps/client-cms-editor/frontend/src/CmsAgentSurface.tsx +0 -36
  754. package/apps/client-cms-editor/frontend/src/adapters/heuristic.ts +0 -29
  755. package/apps/client-cms-editor/frontend/src/adapters/http-authoring.test.ts +0 -161
  756. package/apps/client-cms-editor/frontend/src/adapters/http.ts +0 -871
  757. package/apps/client-cms-editor/frontend/src/adapters/memory.ts +0 -510
  758. package/apps/client-cms-editor/frontend/src/editor/CmsEditor.tsx +0 -247
  759. package/apps/client-cms-editor/frontend/src/editor/CmsEditorProvider.tsx +0 -20
  760. package/apps/client-cms-editor/frontend/src/editor/canvas/PreviewCanvas.tsx +0 -81
  761. package/apps/client-cms-editor/frontend/src/editor/composition-groups.test.ts +0 -40
  762. package/apps/client-cms-editor/frontend/src/editor/host-preview.test.tsx +0 -104
  763. package/apps/client-cms-editor/frontend/src/editor/legacy/CmsEditorPrototype.tsx +0 -1374
  764. package/apps/client-cms-editor/frontend/src/editor/useCmsEditorController.ts +0 -218
  765. package/apps/client-cms-editor/frontend/src/env.d.ts +0 -14
  766. package/apps/client-cms-editor/frontend/src/index.ts +0 -22
  767. package/apps/client-cms-editor/frontend/src/lib/agent-host.ts +0 -24
  768. package/apps/client-cms-editor/frontend/src/lib/content-safety.ts +0 -63
  769. package/apps/client-cms-editor/frontend/src/main.tsx +0 -91
  770. package/apps/client-cms-editor/frontend/src/mount.tsx +0 -113
  771. package/apps/client-cms-editor/frontend/src/styles/agentsam-drawer.css +0 -215
  772. package/apps/client-cms-editor/frontend/src/styles/cmsShell.css +0 -1739
  773. package/apps/client-cms-editor/frontend/src/styles/studio.css +0 -159
  774. package/apps/client-cms-editor/frontend/src/surfaces/CmsDashboard.tsx +0 -313
  775. package/apps/client-cms-editor/frontend/src/surfaces/CmsGuidedChatHero.tsx +0 -121
  776. package/apps/client-cms-editor/frontend/src/surfaces/CmsHubPage.tsx +0 -132
  777. package/apps/client-cms-editor/frontend/src/surfaces/CmsSiteSwitcher.tsx +0 -176
  778. package/apps/client-cms-editor/frontend/src/surfaces/index.ts +0 -5
  779. package/apps/client-cms-editor/frontend/src/surfaces/types.ts +0 -48
  780. package/apps/client-cms-editor/frontend/tsconfig.json +0 -55
  781. package/apps/client-cms-editor/frontend/vite.config.ts +0 -25
  782. package/apps/client-cms-editor/package-lock.json +0 -4671
  783. package/apps/client-cms-editor/package.json +0 -136
  784. package/apps/client-cms-editor/reference/DONOR_README.md +0 -52
  785. package/apps/client-cms-editor/reference/DONOR_package-lock.json +0 -1253
  786. package/apps/client-cms-editor/reference/DONOR_tsconfig.json +0 -15
  787. package/apps/client-cms-editor/reference/harvest/HARVEST_RECEIPT.json +0 -201
  788. package/apps/client-cms-editor/reference/harvest/PROVENANCE_HISTORY.txt +0 -10
  789. package/apps/client-cms-editor/reference/harvest/README.md +0 -8
  790. package/apps/client-cms-editor/reference/harvest/plans/ARCHIVE-INTAKE.md +0 -135
  791. package/apps/client-cms-editor/reference/harvest/plans/CHATGPT-IDENTITY-HARVEST.md +0 -83
  792. package/apps/client-cms-editor/reference/harvest/plans/CMS-EDITOR-HARVEST.md +0 -166
  793. package/apps/client-cms-editor/reference/harvest/plans/HARVEST-INDEX.md +0 -196
  794. package/apps/client-cms-editor/reference/harvest/plans/INNERANIMALS-CONTENT-001.md +0 -137
  795. package/apps/client-cms-editor/reference/harvest/plans/NO-IMPLICIT-SIDE-EFFECTS.md +0 -87
  796. package/apps/client-cms-editor/reference/harvest/plans/STOREFRONT-SURFACE-MAP.md +0 -140
  797. package/apps/client-cms-editor/reference/harvest/plans/THEME-INNERANIMALS-HARVEST.md +0 -137
  798. package/apps/client-cms-editor/reference/harvest/plans/TOOLING-LAB.md +0 -63
  799. package/apps/client-cms-editor/reference/harvest/plans/harvest-manifest.json +0 -97
  800. package/apps/client-cms-editor/reference/harvest/plans/local-cms-harvest-schema.sql +0 -328
  801. package/apps/client-cms-editor/shared/cms/package.json +0 -29
  802. package/apps/client-cms-editor/shared/cms/src/adapter.ts +0 -204
  803. package/apps/client-cms-editor/shared/cms/src/agent-context.ts +0 -37
  804. package/apps/client-cms-editor/shared/cms/src/cloudflare-bindings.ts +0 -51
  805. package/apps/client-cms-editor/shared/cms/src/editor-types.ts +0 -131
  806. package/apps/client-cms-editor/shared/cms/src/host.ts +0 -82
  807. package/apps/client-cms-editor/shared/cms/src/index.ts +0 -9
  808. package/apps/client-cms-editor/shared/cms/src/map.ts +0 -115
  809. package/apps/client-cms-editor/shared/cms/src/publication.ts +0 -24
  810. package/apps/client-cms-editor/shared/cms/src/routes.ts +0 -11
  811. package/apps/client-cms-editor/shared/cms/src/starter-pack.ts +0 -158
  812. package/apps/client-cms-editor/shared/cms/tsconfig.json +0 -12
  813. package/docs/client-cms-editor.md +0 -15
  814. package/packages/agentsam-cms/src/node-sqlite-repository.js +0 -148
  815. package/packages/agentsam-cms/src/schema/cms-local-runtime.v1.sql +0 -365
  816. package/packages/catalog/evidence/cms-runtime.json +0 -49
  817. package/packages/catalog/evidence/fnf-theme.json +0 -34
  818. package/packages/catalog/evidence/theme-cypress.json +0 -41
  819. package/packages/catalog/evidence/theme-ember.json +0 -41
  820. package/packages/catalog/evidence/theme-forge.json +0 -41
  821. package/packages/catalog/evidence/theme-grove.json +0 -41
  822. package/packages/catalog/evidence/theme-harbor.json +0 -41
  823. package/packages/catalog/evidence/theme-heuristic.json +0 -50
  824. package/packages/catalog/evidence/theme-iasf.json +0 -48
  825. package/packages/catalog/evidence/theme-resolve.json +0 -41
  826. package/packages/catalog/evidence/theme-summit.json +0 -41
  827. package/packages/catalog/evidence/theme-violet.json +0 -41
  828. package/packages/heuristic-theme/README.md +0 -25
  829. package/packages/heuristic-theme/agentsam.package.json +0 -42
  830. package/packages/heuristic-theme/contracts/README.md +0 -15
  831. package/packages/heuristic-theme/contracts/block.schema.json +0 -33
  832. package/packages/heuristic-theme/contracts/header-presets.json +0 -20
  833. package/packages/heuristic-theme/contracts/page.schema.json +0 -18
  834. package/packages/heuristic-theme/contracts/preset.schema.json +0 -18
  835. package/packages/heuristic-theme/contracts/section.schema.json +0 -83
  836. package/packages/heuristic-theme/package.json +0 -40
  837. package/packages/heuristic-theme/presets/fuel-free-time/assets.json +0 -8
  838. package/packages/heuristic-theme/presets/fuel-free-time/globals/shell.json +0 -30
  839. package/packages/heuristic-theme/presets/fuel-free-time/pages/about.json +0 -4
  840. package/packages/heuristic-theme/presets/fuel-free-time/pages/cart.json +0 -4
  841. package/packages/heuristic-theme/presets/fuel-free-time/pages/collection.json +0 -4
  842. package/packages/heuristic-theme/presets/fuel-free-time/pages/collections.json +0 -4
  843. package/packages/heuristic-theme/presets/fuel-free-time/pages/community.json +0 -4
  844. package/packages/heuristic-theme/presets/fuel-free-time/pages/home.json +0 -92
  845. package/packages/heuristic-theme/presets/fuel-free-time/pages/order-confirmation.json +0 -39
  846. package/packages/heuristic-theme/presets/fuel-free-time/pages/product.json +0 -4
  847. package/packages/heuristic-theme/presets/fuel-free-time/pages/shop.json +0 -9
  848. package/packages/heuristic-theme/presets/fuel-free-time/preset.json +0 -23
  849. package/packages/heuristic-theme/presets/fuel-free-time/tokens.json +0 -23
  850. package/packages/heuristic-theme/src/index.js +0 -2
  851. package/packages/heuristic-theme/src/registry.js +0 -36
  852. package/packages/heuristic-theme/src/theme.js +0 -41
  853. package/packages/heuristic-theme/storefront/about.html +0 -1103
  854. package/packages/heuristic-theme/storefront/assets/presets/fuel-free-time/GENERATED-ASSETS.md +0 -15
  855. package/packages/heuristic-theme/storefront/assets/presets/fuel-free-time/earned-hours-hero.webp +0 -0
  856. package/packages/heuristic-theme/storefront/assets/presets/fuel-free-time/essentials.webp +0 -0
  857. package/packages/heuristic-theme/storefront/assets/presets/fuel-free-time/masters.webp +0 -0
  858. package/packages/heuristic-theme/storefront/cart.html +0 -64
  859. package/packages/heuristic-theme/storefront/collaborate.html +0 -58
  860. package/packages/heuristic-theme/storefront/collection.html +0 -10
  861. package/packages/heuristic-theme/storefront/collections.html +0 -10
  862. package/packages/heuristic-theme/storefront/community.html +0 -921
  863. package/packages/heuristic-theme/storefront/css/content-page.css +0 -199
  864. package/packages/heuristic-theme/storefront/css/global-footer.css +0 -401
  865. package/packages/heuristic-theme/storefront/css/heuristic-theme.css +0 -81
  866. package/packages/heuristic-theme/storefront/css/page-composer.css +0 -76
  867. package/packages/heuristic-theme/storefront/css/shop-hero.css +0 -230
  868. package/packages/heuristic-theme/storefront/css/store-cart.css +0 -422
  869. package/packages/heuristic-theme/storefront/css/store-collections.css +0 -36
  870. package/packages/heuristic-theme/storefront/css/store-pdp.css +0 -459
  871. package/packages/heuristic-theme/storefront/css/store-shell.css +0 -474
  872. package/packages/heuristic-theme/storefront/css/store-shop.css +0 -117
  873. package/packages/heuristic-theme/storefront/home.html +0 -25
  874. package/packages/heuristic-theme/storefront/js/cms-hydrate.js +0 -395
  875. package/packages/heuristic-theme/storefront/js/cms-structure.js +0 -85
  876. package/packages/heuristic-theme/storefront/js/fnf-attribution.js +0 -98
  877. package/packages/heuristic-theme/storefront/js/fnf-head.js +0 -47
  878. package/packages/heuristic-theme/storefront/js/fnf-newsletter.js +0 -64
  879. package/packages/heuristic-theme/storefront/js/global-footer.js +0 -277
  880. package/packages/heuristic-theme/storefront/js/heuristic-runtime.js +0 -78
  881. package/packages/heuristic-theme/storefront/js/order-confirmation.js +0 -109
  882. package/packages/heuristic-theme/storefront/js/page-composer.js +0 -310
  883. package/packages/heuristic-theme/storefront/js/shop-hero.js +0 -85
  884. package/packages/heuristic-theme/storefront/js/store-cart.js +0 -276
  885. package/packages/heuristic-theme/storefront/js/store-catalog.js +0 -140
  886. package/packages/heuristic-theme/storefront/js/store-collections.js +0 -45
  887. package/packages/heuristic-theme/storefront/js/store-product.js +0 -287
  888. package/packages/heuristic-theme/storefront/js/store-shell.js +0 -449
  889. package/packages/heuristic-theme/storefront/order-confirmation.html +0 -30
  890. package/packages/heuristic-theme/storefront/policies.html +0 -43
  891. package/packages/heuristic-theme/storefront/product.html +0 -27
  892. package/packages/heuristic-theme/storefront/shop.html +0 -113
  893. package/packages/heuristic-theme/storefront/terms.html +0 -45
  894. package/packages/heuristic-theme/test/commerce-portability.test.mjs +0 -16
  895. package/packages/heuristic-theme/test/theme.test.mjs +0 -26
  896. package/packages/heuristic-theme/theme.json +0 -55
  897. package/packages/heuristic-theme/theme.schema.json +0 -32
  898. package/packages/theme-cypress/README.md +0 -11
  899. package/packages/theme-cypress/agentsam.package.json +0 -42
  900. package/packages/theme-cypress/package.json +0 -44
  901. package/packages/theme-cypress/prebuild.json +0 -23
  902. package/packages/theme-cypress/site/assets/generated/favicon.svg +0 -7
  903. package/packages/theme-cypress/site/assets/generated/media-044ba16613.webp +0 -0
  904. package/packages/theme-cypress/site/assets/generated/media-0a1ea6f6d9.webp +0 -0
  905. package/packages/theme-cypress/site/assets/generated/media-0c06778307.webp +0 -0
  906. package/packages/theme-cypress/site/assets/generated/media-1539ed373a.webp +0 -0
  907. package/packages/theme-cypress/site/assets/generated/media-2df479fd2d.webp +0 -0
  908. package/packages/theme-cypress/site/assets/generated/media-2e8bd0d9bc.webp +0 -0
  909. package/packages/theme-cypress/site/assets/generated/media-41d4e2643c.webp +0 -0
  910. package/packages/theme-cypress/site/assets/generated/media-46205bfde8.webp +0 -0
  911. package/packages/theme-cypress/site/assets/generated/media-50c5f3e279.webp +0 -0
  912. package/packages/theme-cypress/site/assets/generated/media-5f1467778c.webp +0 -0
  913. package/packages/theme-cypress/site/assets/generated/media-6703642b22.webp +0 -0
  914. package/packages/theme-cypress/site/assets/generated/media-87a490bc8e.webp +0 -0
  915. package/packages/theme-cypress/site/assets/generated/media-997c10ef39.webp +0 -0
  916. package/packages/theme-cypress/site/assets/generated/media-a423735c21.webp +0 -0
  917. package/packages/theme-cypress/site/assets/generated/media-c9cea5245b.webp +0 -0
  918. package/packages/theme-cypress/site/assets/generated/media-cab3c84c60.webp +0 -0
  919. package/packages/theme-cypress/site/assets/generated/media-ce06595d59.webp +0 -0
  920. package/packages/theme-cypress/site/assets/generated/media-d268905e7e.webp +0 -0
  921. package/packages/theme-cypress/site/assets/generated/media-f6711b5053.webp +0 -0
  922. package/packages/theme-cypress/site/assets/generated/media-manifest.json +0 -226
  923. package/packages/theme-cypress/site/assets/generated/social-card.webp +0 -0
  924. package/packages/theme-cypress/site/assets/generated/theme-mark-192.png +0 -0
  925. package/packages/theme-cypress/site/assets/generated/theme-mark-512.png +0 -0
  926. package/packages/theme-cypress/site/assets/generated/theme-mark.svg +0 -7
  927. package/packages/theme-cypress/site/beliefs.html +0 -175
  928. package/packages/theme-cypress/site/community.html +0 -175
  929. package/packages/theme-cypress/site/connect.html +0 -319
  930. package/packages/theme-cypress/site/donate.html +0 -106
  931. package/packages/theme-cypress/site/groups.html +0 -1352
  932. package/packages/theme-cypress/site/help.html +0 -1
  933. package/packages/theme-cypress/site/icons/clock.svg +0 -4
  934. package/packages/theme-cypress/site/icons/email.svg +0 -4
  935. package/packages/theme-cypress/site/icons/giving.svg +0 -4
  936. package/packages/theme-cypress/site/icons/home.svg +0 -4
  937. package/packages/theme-cypress/site/icons/location.svg +0 -4
  938. package/packages/theme-cypress/site/icons/media.svg +0 -4
  939. package/packages/theme-cypress/site/icons/ministries.svg +0 -6
  940. package/packages/theme-cypress/site/icons/prayer.svg +0 -5
  941. package/packages/theme-cypress/site/icons/visit.svg +0 -6
  942. package/packages/theme-cypress/site/index.html +0 -1013
  943. package/packages/theme-cypress/site/mensgroup.html +0 -477
  944. package/packages/theme-cypress/site/mission.html +0 -512
  945. package/packages/theme-cypress/site/unified-footer.css +0 -172
  946. package/packages/theme-cypress/site/unified-footer.js +0 -175
  947. package/packages/theme-cypress/site/unified-header.css +0 -226
  948. package/packages/theme-cypress/site/unified-header.js +0 -111
  949. package/packages/theme-cypress/site/womansgroup.html +0 -452
  950. package/packages/theme-cypress/src/index.js +0 -76
  951. package/packages/theme-cypress/src/node.js +0 -69
  952. package/packages/theme-cypress/test/theme.test.mjs +0 -47
  953. package/packages/theme-ember/README.md +0 -11
  954. package/packages/theme-ember/agentsam.package.json +0 -42
  955. package/packages/theme-ember/package.json +0 -44
  956. package/packages/theme-ember/prebuild.json +0 -23
  957. package/packages/theme-ember/site/about.html +0 -1840
  958. package/packages/theme-ember/site/assets/generated/favicon.svg +0 -7
  959. package/packages/theme-ember/site/assets/generated/media-1e0b1e6ee6.webp +0 -0
  960. package/packages/theme-ember/site/assets/generated/media-2371dcb426.webp +0 -0
  961. package/packages/theme-ember/site/assets/generated/media-2db4f5ff9e.webp +0 -0
  962. package/packages/theme-ember/site/assets/generated/media-4ed07a756e.webp +0 -0
  963. package/packages/theme-ember/site/assets/generated/media-58182cf167.webp +0 -0
  964. package/packages/theme-ember/site/assets/generated/media-5b8b8472ae.webp +0 -0
  965. package/packages/theme-ember/site/assets/generated/media-71f4bd16a1.webp +0 -0
  966. package/packages/theme-ember/site/assets/generated/media-7c1c8120bc.webp +0 -0
  967. package/packages/theme-ember/site/assets/generated/media-832b176433.webp +0 -0
  968. package/packages/theme-ember/site/assets/generated/media-931439701c.webp +0 -0
  969. package/packages/theme-ember/site/assets/generated/media-c2860d40d1.webp +0 -0
  970. package/packages/theme-ember/site/assets/generated/media-c56974d198.webp +0 -0
  971. package/packages/theme-ember/site/assets/generated/media-cb83a44ff4.webp +0 -0
  972. package/packages/theme-ember/site/assets/generated/media-df02ccdfcf.webp +0 -0
  973. package/packages/theme-ember/site/assets/generated/media-fab72cd344.webp +0 -0
  974. package/packages/theme-ember/site/assets/generated/media-manifest.json +0 -190
  975. package/packages/theme-ember/site/assets/generated/social-card.webp +0 -0
  976. package/packages/theme-ember/site/assets/generated/theme-mark-192.png +0 -0
  977. package/packages/theme-ember/site/assets/generated/theme-mark-512.png +0 -0
  978. package/packages/theme-ember/site/assets/generated/theme-mark.svg +0 -7
  979. package/packages/theme-ember/site/community.html +0 -1664
  980. package/packages/theme-ember/site/index.html +0 -2044
  981. package/packages/theme-ember/site/shop.html +0 -2104
  982. package/packages/theme-ember/src/index.js +0 -76
  983. package/packages/theme-ember/src/node.js +0 -69
  984. package/packages/theme-ember/test/theme.test.mjs +0 -47
  985. package/packages/theme-forge/README.md +0 -11
  986. package/packages/theme-forge/agentsam.package.json +0 -42
  987. package/packages/theme-forge/package.json +0 -44
  988. package/packages/theme-forge/prebuild.json +0 -23
  989. package/packages/theme-forge/site/apple-touch-icon.png +0 -0
  990. package/packages/theme-forge/site/assets/generated/favicon.svg +0 -7
  991. package/packages/theme-forge/site/assets/generated/media-manifest.json +0 -17
  992. package/packages/theme-forge/site/assets/generated/social-card.webp +0 -0
  993. package/packages/theme-forge/site/assets/generated/theme-mark-192.png +0 -0
  994. package/packages/theme-forge/site/assets/generated/theme-mark-512.png +0 -0
  995. package/packages/theme-forge/site/assets/generated/theme-mark.svg +0 -7
  996. package/packages/theme-forge/site/assets/index-DBOqQVsA.css +0 -1
  997. package/packages/theme-forge/site/assets/index-pXC0o9jp.js +0 -241
  998. package/packages/theme-forge/site/assets/workbox-window.prod.es5-Bd17z0YL.js +0 -2
  999. package/packages/theme-forge/site/index.html +0 -5
  1000. package/packages/theme-forge/site/manifest.webmanifest +0 -1
  1001. package/packages/theme-forge/site/pwa-192x192.png +0 -0
  1002. package/packages/theme-forge/site/pwa-512x512.png +0 -0
  1003. package/packages/theme-forge/site/sw.js +0 -107
  1004. package/packages/theme-forge/site/workbox-7e5eb42b.js +0 -3395
  1005. package/packages/theme-forge/src/index.js +0 -76
  1006. package/packages/theme-forge/src/node.js +0 -69
  1007. package/packages/theme-forge/test/theme.test.mjs +0 -47
  1008. package/packages/theme-grove/README.md +0 -11
  1009. package/packages/theme-grove/agentsam.package.json +0 -42
  1010. package/packages/theme-grove/package.json +0 -44
  1011. package/packages/theme-grove/prebuild.json +0 -23
  1012. package/packages/theme-grove/site/assets/generated/favicon.svg +0 -7
  1013. package/packages/theme-grove/site/assets/generated/media-098b13d75a.webp +0 -0
  1014. package/packages/theme-grove/site/assets/generated/media-0c064db1aa.webp +0 -0
  1015. package/packages/theme-grove/site/assets/generated/media-0fbfef655e.webp +0 -0
  1016. package/packages/theme-grove/site/assets/generated/media-14759c7460.webp +0 -0
  1017. package/packages/theme-grove/site/assets/generated/media-19b23d2a8f.webp +0 -0
  1018. package/packages/theme-grove/site/assets/generated/media-2012f04243.webp +0 -0
  1019. package/packages/theme-grove/site/assets/generated/media-23b8c5e2bb.webp +0 -0
  1020. package/packages/theme-grove/site/assets/generated/media-2bffb1a6ef.webp +0 -0
  1021. package/packages/theme-grove/site/assets/generated/media-2e1523a5b0.webp +0 -0
  1022. package/packages/theme-grove/site/assets/generated/media-31107c21f2.webp +0 -0
  1023. package/packages/theme-grove/site/assets/generated/media-31373ec865.webp +0 -0
  1024. package/packages/theme-grove/site/assets/generated/media-45e8e27542.webp +0 -0
  1025. package/packages/theme-grove/site/assets/generated/media-4aa9846fe7.webp +0 -0
  1026. package/packages/theme-grove/site/assets/generated/media-5476b24219.webp +0 -0
  1027. package/packages/theme-grove/site/assets/generated/media-7a227d3e4b.webp +0 -0
  1028. package/packages/theme-grove/site/assets/generated/media-b183eed550.webp +0 -0
  1029. package/packages/theme-grove/site/assets/generated/media-b2c650f9ab.webp +0 -0
  1030. package/packages/theme-grove/site/assets/generated/media-b5d7471694.webp +0 -0
  1031. package/packages/theme-grove/site/assets/generated/media-c86498fdb4.webp +0 -0
  1032. package/packages/theme-grove/site/assets/generated/media-ce2cfff9a1.webp +0 -0
  1033. package/packages/theme-grove/site/assets/generated/media-cf41a5f324.webp +0 -0
  1034. package/packages/theme-grove/site/assets/generated/media-ec6c01bf8d.webp +0 -0
  1035. package/packages/theme-grove/site/assets/generated/media-manifest.json +0 -267
  1036. package/packages/theme-grove/site/assets/generated/social-card.webp +0 -0
  1037. package/packages/theme-grove/site/assets/generated/theme-mark-192.png +0 -0
  1038. package/packages/theme-grove/site/assets/generated/theme-mark-512.png +0 -0
  1039. package/packages/theme-grove/site/assets/generated/theme-mark.svg +0 -7
  1040. package/packages/theme-grove/site/index.html +0 -1429
  1041. package/packages/theme-grove/site/pages/contact.html +0 -664
  1042. package/packages/theme-grove/site/pages/gallery.html +0 -216
  1043. package/packages/theme-grove/site/pages/privacy.html +0 -180
  1044. package/packages/theme-grove/site/pages/process.html +0 -592
  1045. package/packages/theme-grove/site/pages/services.html +0 -567
  1046. package/packages/theme-grove/site/pages/terms.html +0 -189
  1047. package/packages/theme-grove/site/shared/footer.css +0 -140
  1048. package/packages/theme-grove/site/shared/footer.html +0 -41
  1049. package/packages/theme-grove/src/index.js +0 -76
  1050. package/packages/theme-grove/src/node.js +0 -69
  1051. package/packages/theme-grove/test/theme.test.mjs +0 -47
  1052. package/packages/theme-harbor/README.md +0 -11
  1053. package/packages/theme-harbor/agentsam.package.json +0 -42
  1054. package/packages/theme-harbor/package.json +0 -44
  1055. package/packages/theme-harbor/prebuild.json +0 -23
  1056. package/packages/theme-harbor/site/assets/generated/favicon.svg +0 -7
  1057. package/packages/theme-harbor/site/assets/generated/media-manifest.json +0 -17
  1058. package/packages/theme-harbor/site/assets/generated/social-card.webp +0 -0
  1059. package/packages/theme-harbor/site/assets/generated/theme-mark-192.png +0 -0
  1060. package/packages/theme-harbor/site/assets/generated/theme-mark-512.png +0 -0
  1061. package/packages/theme-harbor/site/assets/generated/theme-mark.svg +0 -7
  1062. package/packages/theme-harbor/site/assets/index-D58RKkr-.js +0 -239
  1063. package/packages/theme-harbor/site/assets/index-Dd3YN9Mf.css +0 -1
  1064. package/packages/theme-harbor/site/index.html +0 -15
  1065. package/packages/theme-harbor/src/index.js +0 -76
  1066. package/packages/theme-harbor/src/node.js +0 -69
  1067. package/packages/theme-harbor/test/theme.test.mjs +0 -47
  1068. package/packages/theme-resolve/README.md +0 -11
  1069. package/packages/theme-resolve/agentsam.package.json +0 -42
  1070. package/packages/theme-resolve/package.json +0 -44
  1071. package/packages/theme-resolve/prebuild.json +0 -23
  1072. package/packages/theme-resolve/site/assets/generated/favicon.svg +0 -7
  1073. package/packages/theme-resolve/site/assets/generated/media-216610d365.webp +0 -0
  1074. package/packages/theme-resolve/site/assets/generated/media-2a9e0f623f.webp +0 -0
  1075. package/packages/theme-resolve/site/assets/generated/media-a70660bfa9.webp +0 -0
  1076. package/packages/theme-resolve/site/assets/generated/media-bc1322e813.webp +0 -0
  1077. package/packages/theme-resolve/site/assets/generated/media-ced60fcecc.webp +0 -0
  1078. package/packages/theme-resolve/site/assets/generated/media-manifest.json +0 -72
  1079. package/packages/theme-resolve/site/assets/generated/social-card.webp +0 -0
  1080. package/packages/theme-resolve/site/assets/generated/theme-mark-192.png +0 -0
  1081. package/packages/theme-resolve/site/assets/generated/theme-mark-512.png +0 -0
  1082. package/packages/theme-resolve/site/assets/generated/theme-mark.svg +0 -7
  1083. package/packages/theme-resolve/site/assets/index-BSaLpPG1.css +0 -2
  1084. package/packages/theme-resolve/site/assets/index-D8au46Z5.js +0 -17
  1085. package/packages/theme-resolve/site/index.html +0 -22
  1086. package/packages/theme-resolve/src/index.js +0 -69
  1087. package/packages/theme-resolve/src/node.js +0 -69
  1088. package/packages/theme-resolve/test/theme.test.mjs +0 -47
  1089. package/packages/theme-scenes/src/registry.js +0 -170
  1090. package/packages/theme-summit/README.md +0 -11
  1091. package/packages/theme-summit/agentsam.package.json +0 -42
  1092. package/packages/theme-summit/package.json +0 -44
  1093. package/packages/theme-summit/prebuild.json +0 -23
  1094. package/packages/theme-summit/site/adventures.html +0 -450
  1095. package/packages/theme-summit/site/assets/generated/favicon.svg +0 -7
  1096. package/packages/theme-summit/site/assets/generated/media-1e958ea679.webp +0 -0
  1097. package/packages/theme-summit/site/assets/generated/media-9d4521abba.webp +0 -0
  1098. package/packages/theme-summit/site/assets/generated/media-manifest.json +0 -39
  1099. package/packages/theme-summit/site/assets/generated/social-card.webp +0 -0
  1100. package/packages/theme-summit/site/assets/generated/theme-mark-192.png +0 -0
  1101. package/packages/theme-summit/site/assets/generated/theme-mark-512.png +0 -0
  1102. package/packages/theme-summit/site/assets/generated/theme-mark.svg +0 -7
  1103. package/packages/theme-summit/site/business-card.html +0 -315
  1104. package/packages/theme-summit/site/chatbot.js +0 -312
  1105. package/packages/theme-summit/site/gallery.html +0 -524
  1106. package/packages/theme-summit/site/i18n.js +0 -947
  1107. package/packages/theme-summit/site/icons.svg +0 -87
  1108. package/packages/theme-summit/site/index.html +0 -2415
  1109. package/packages/theme-summit/site/pages/about.html +0 -100
  1110. package/packages/theme-summit/site/pages/contact.html +0 -117
  1111. package/packages/theme-summit/site/pages/dashboard.html +0 -111
  1112. package/packages/theme-summit/site/pages/index.html +0 -129
  1113. package/packages/theme-summit/site/pages/services.html +0 -125
  1114. package/packages/theme-summit/site/shared/footer.html +0 -41
  1115. package/packages/theme-summit/site/shared/layout.js +0 -315
  1116. package/packages/theme-summit/site/shared/nav.html +0 -19
  1117. package/packages/theme-summit/site/shared/styles.css +0 -696
  1118. package/packages/theme-summit/site/theme-styles.css +0 -131
  1119. package/packages/theme-summit/site/themes.js +0 -442
  1120. package/packages/theme-summit/src/index.js +0 -76
  1121. package/packages/theme-summit/src/node.js +0 -69
  1122. package/packages/theme-summit/test/theme.test.mjs +0 -47
  1123. package/packages/theme-violet/README.md +0 -11
  1124. package/packages/theme-violet/agentsam.package.json +0 -42
  1125. package/packages/theme-violet/package.json +0 -44
  1126. package/packages/theme-violet/prebuild.json +0 -23
  1127. package/packages/theme-violet/site/assets/generated/favicon.svg +0 -7
  1128. package/packages/theme-violet/site/assets/generated/media-07b46d6457.webp +0 -0
  1129. package/packages/theme-violet/site/assets/generated/media-09d38ddffc.webp +0 -0
  1130. package/packages/theme-violet/site/assets/generated/media-254b0e2ad3.webp +0 -0
  1131. package/packages/theme-violet/site/assets/generated/media-3a1b5c0a8d.webp +0 -0
  1132. package/packages/theme-violet/site/assets/generated/media-3a78eb7d9d.webp +0 -0
  1133. package/packages/theme-violet/site/assets/generated/media-49076977d8.webp +0 -0
  1134. package/packages/theme-violet/site/assets/generated/media-6342d50dbd.webp +0 -0
  1135. package/packages/theme-violet/site/assets/generated/media-646c65381e.webp +0 -0
  1136. package/packages/theme-violet/site/assets/generated/media-7a5fb7c91a.webp +0 -0
  1137. package/packages/theme-violet/site/assets/generated/media-9bbd133220.webp +0 -0
  1138. package/packages/theme-violet/site/assets/generated/media-9e73307c2a.webp +0 -0
  1139. package/packages/theme-violet/site/assets/generated/media-af382146a0.webp +0 -0
  1140. package/packages/theme-violet/site/assets/generated/media-b2ae348b43.webp +0 -0
  1141. package/packages/theme-violet/site/assets/generated/media-b8f43a3887.webp +0 -0
  1142. package/packages/theme-violet/site/assets/generated/media-c96a3e1979.webp +0 -0
  1143. package/packages/theme-violet/site/assets/generated/media-cd07daa54a.webp +0 -0
  1144. package/packages/theme-violet/site/assets/generated/media-e03ab6b5fe.webp +0 -0
  1145. package/packages/theme-violet/site/assets/generated/media-eae4917d25.webp +0 -0
  1146. package/packages/theme-violet/site/assets/generated/media-f227ec5690.webp +0 -0
  1147. package/packages/theme-violet/site/assets/generated/media-fb57ffd474.webp +0 -0
  1148. package/packages/theme-violet/site/assets/generated/media-manifest.json +0 -245
  1149. package/packages/theme-violet/site/assets/generated/social-card.webp +0 -0
  1150. package/packages/theme-violet/site/assets/generated/theme-mark-192.png +0 -0
  1151. package/packages/theme-violet/site/assets/generated/theme-mark-512.png +0 -0
  1152. package/packages/theme-violet/site/assets/generated/theme-mark.svg +0 -7
  1153. package/packages/theme-violet/site/global/cpas-contact.css +0 -405
  1154. package/packages/theme-violet/site/global/cpas-donate-v2.css +0 -931
  1155. package/packages/theme-violet/site/global/cpas-drawer-override.css +0 -1
  1156. package/packages/theme-violet/site/global/cpas-footer.html +0 -38
  1157. package/packages/theme-violet/site/global/cpas-header.html +0 -30
  1158. package/packages/theme-violet/site/global/cpas-hero-watercolor.css +0 -275
  1159. package/packages/theme-violet/site/global/cpas-modals.js +0 -802
  1160. package/packages/theme-violet/site/global/cpas-public-surface.css +0 -982
  1161. package/packages/theme-violet/site/global/cpas-shell.css +0 -3980
  1162. package/packages/theme-violet/site/global/cpas-shell.js +0 -107
  1163. package/packages/theme-violet/site/global/cpas-shelter-hub.css +0 -326
  1164. package/packages/theme-violet/site/index.html +0 -141
  1165. package/packages/theme-violet/site/pages/about/campaigns.html +0 -28
  1166. package/packages/theme-violet/site/pages/about/cta.html +0 -25
  1167. package/packages/theme-violet/site/pages/about/hero.html +0 -46
  1168. package/packages/theme-violet/site/pages/about/paths.html +0 -24
  1169. package/packages/theme-violet/site/pages/about/why_we_exist.html +0 -28
  1170. package/packages/theme-violet/site/pages/home/campaigns.html +0 -67
  1171. package/packages/theme-violet/site/pages/home/hero.html +0 -42
  1172. package/packages/theme-violet/site/pages/home/how-it-helps.html +0 -32
  1173. package/packages/theme-violet/site/pages/home/impact-stats.html +0 -31
  1174. package/packages/theme-violet/site/pages/home/mission.html +0 -36
  1175. package/packages/theme-violet/site/pages/home/newsletter.html +0 -29
  1176. package/packages/theme-violet/site/pages/home/transport-win.html +0 -22
  1177. package/packages/theme-violet/site/pages/index.html +0 -141
  1178. package/packages/theme-violet/src/index.js +0 -76
  1179. package/packages/theme-violet/src/node.js +0 -69
  1180. package/packages/theme-violet/test/theme.test.mjs +0 -47
  1181. package/services/cad/occt/main.cpp +0 -95
  1182. /package/{apps/client-cms-editor → python}/LICENSE +0 -0
@@ -1,871 +0,0 @@
1
- /**
2
- * HTTP CmsEditorAdapter — hosted Worker CMS authority via /api/cms/*.
3
- * Durable D1-backed persistence. Never an in-memory substitute.
4
- */
5
-
6
- import {
7
- CmsCapabilityError,
8
- type CmsAsset,
9
- type CmsEditorAdapter,
10
- type CmsPublicationSnapshot,
11
- type CmsRevision,
12
- } from '../../../shared/cms/src/adapter';
13
- import {
14
- buildCmsEditorGroups,
15
- type CmsEditorBlock,
16
- type CmsEditorPage,
17
- type CmsEditorSection,
18
- type CmsEditorSite,
19
- type CmsSiteCreateInput,
20
- type CmsSiteRecord,
21
- type CmsSiteUpdatePatch,
22
- } from '../../../shared/cms/src/editor-types';
23
-
24
- type Json = Record<string, any>;
25
-
26
- function siteQuery(siteId: string) {
27
- return `site=${encodeURIComponent(siteId)}`;
28
- }
29
-
30
- async function api<T = Json>(path: string, init: RequestInit = {}, transport: typeof fetch = fetch): Promise<T> {
31
- const headers = new Headers(init.headers || {});
32
- if (init.body && !(init.body instanceof FormData) && !headers.has('content-type')) {
33
- headers.set('content-type', 'application/json');
34
- }
35
- const response = await transport(path, {
36
- credentials: 'same-origin',
37
- cache: 'no-store',
38
- ...init,
39
- headers,
40
- });
41
- const body = (await response.json().catch(() => ({}))) as Json;
42
- if (!response.ok || body?.ok === false) {
43
- throw new Error(body?.error || body?.detail || `HTTP ${response.status}`);
44
- }
45
- return body as T;
46
- }
47
-
48
- function parseFields(raw: unknown): Record<string, any> {
49
- if (!raw) return {};
50
- if (typeof raw === 'object' && !Array.isArray(raw)) return { ...(raw as object) };
51
- if (typeof raw === 'string') {
52
- try {
53
- const parsed = JSON.parse(raw);
54
- return parsed && typeof parsed === 'object' && !Array.isArray(parsed) ? parsed : {};
55
- } catch {
56
- return {};
57
- }
58
- }
59
- return {};
60
- }
61
-
62
- function mapStatus(row: Json): CmsEditorPage['status'] {
63
- const status = String(row.status || '').toLowerCase();
64
- if (status === 'live' || status === 'published' || row.published === 1 || row.published === true) {
65
- return 'live';
66
- }
67
- if (status === 'new') return 'new';
68
- return 'draft';
69
- }
70
-
71
- function mapZone(row: Json): CmsEditorSection['zone'] {
72
- const zone = String(row.zone || row.section_zone || '').toUpperCase();
73
- if (zone === 'HEADER' || zone === 'FOOTER' || zone === 'TEMPLATE') return zone;
74
- const type = String(row.section_type || row.type || '').toLowerCase();
75
- if (type.includes('header') || type.includes('nav')) return 'HEADER';
76
- if (type.includes('footer')) return 'FOOTER';
77
- return 'BODY';
78
- }
79
-
80
- function mapBlock(row: Json, sectionId: string): CmsEditorBlock {
81
- return {
82
- id: String(row.id),
83
- sectionId,
84
- type: String(row.block_type || row.component_type || row.type || 'text'),
85
- visible: row.is_visible !== 0 && row.is_visible !== false && row.visible !== false,
86
- data: parseFields(row.block_data ?? row.component_data ?? row.data),
87
- sortOrder: Number(row.sort_order || 0) || 0,
88
- };
89
- }
90
-
91
- function mapSection(row: Json, blocks: CmsEditorBlock[] = []): CmsEditorSection {
92
- const fields = parseFields(row.section_data ?? row.data ?? row.fields);
93
- const css = parseFields(fields.css_override ?? row.css);
94
- return {
95
- id: String(row.id),
96
- name: String(row.section_name || row.name || row.section_type || 'Section'),
97
- type: String(row.section_type || row.type || 'section'),
98
- zone: mapZone(row),
99
- visible: row.is_visible !== 0 && row.is_visible !== false && row.visible !== false,
100
- color: String(fields.color || row.color || '#111115'),
101
- fields,
102
- css,
103
- blocks,
104
- };
105
- }
106
-
107
- function mapPage(row: Json, sections: CmsEditorSection[] = []): CmsEditorPage {
108
- const slugRaw = String(row.slug || row.route_path || row.path || '/').trim() || '/';
109
- const slug = slugRaw.startsWith('/') ? slugRaw : `/${slugRaw}`;
110
- return {
111
- id: String(row.id),
112
- title: String(row.title || 'Untitled'),
113
- slug,
114
- status: mapStatus(row),
115
- type: String(row.page_type || row.type || 'Interior'),
116
- parent: row.parent_id ? String(row.parent_id) : undefined,
117
- sections,
118
- metaTitle: String(row.meta_title || row.title || ''),
119
- metaDescription: String(row.meta_description || ''),
120
- };
121
- }
122
-
123
- function initialsFrom(name: string) {
124
- return (
125
- name
126
- .split(/\s+/)
127
- .filter(Boolean)
128
- .slice(0, 2)
129
- .map((part) => part[0])
130
- .join('')
131
- .toUpperCase() || 'CMS'
132
- );
133
- }
134
-
135
- function siteRecordFromBootstrap(siteId: string, boot: Json): CmsSiteRecord {
136
- const name = String(boot.tenant?.name || boot.workspace_label || siteId);
137
- return {
138
- id: siteId,
139
- name,
140
- initials: initialsFrom(name),
141
- domain: String(boot.tenant?.domain || boot.public_domain || ''),
142
- edited: 'synced',
143
- color: String(boot.tenant?.primary_color || '#1e6a6f'),
144
- theme: {
145
- cssVars: parseFields(boot.active_theme?.css_vars || {}),
146
- },
147
- schemas: boot.schemas
148
- ? {
149
- protocol_version: Number(boot.schemas.protocol_version || 1),
150
- sections: Array.isArray(boot.schemas.sections) ? boot.schemas.sections : [],
151
- blocks: Array.isArray(boot.schemas.blocks) ? boot.schemas.blocks : [],
152
- }
153
- : undefined,
154
- };
155
- }
156
-
157
- function hydratePages(boot: Json): CmsEditorPage[] {
158
- const pages = Array.isArray(boot.pages) ? boot.pages : [];
159
- const sectionsByPage = boot.sections_by_page || {};
160
- const blocksBySection = boot.blocks_by_section || boot.components_by_section || {};
161
-
162
- return pages.map((pageRow: Json) => {
163
- const sectionRows = Array.isArray(sectionsByPage[pageRow.id])
164
- ? sectionsByPage[pageRow.id]
165
- : [];
166
- const sections = sectionRows.map((sectionRow: Json) => {
167
- const blockRows = Array.isArray(blocksBySection[sectionRow.id])
168
- ? blocksBySection[sectionRow.id]
169
- : [];
170
- return mapSection(
171
- sectionRow,
172
- blockRows.map((blockRow: Json) => mapBlock(blockRow, String(sectionRow.id))),
173
- );
174
- });
175
- return mapPage(pageRow, sections);
176
- });
177
- }
178
-
179
- /**
180
- * Hosted HTTP adapter bound to Worker `/api/cms/*` for a single site id (project_slug).
181
- */
182
- export class HttpCmsAdapter implements CmsEditorAdapter {
183
- readonly temporary = false;
184
- private readonly base: string;
185
- private readonly transport: typeof fetch;
186
- private readonly knownSites: Map<string, CmsSiteRecord>;
187
-
188
- constructor(
189
- options: {
190
- base?: string;
191
- transport?: typeof fetch;
192
- sites?: Array<{ id?: string; slug?: string; name?: string; domain?: string }>;
193
- } = {},
194
- ) {
195
- this.transport = options.transport || fetch;
196
- this.base = String(options.base || '').replace(/\/$/, '');
197
- this.knownSites = new Map();
198
- for (const site of options.sites || []) {
199
- const id = String(site.id || site.slug || '').trim();
200
- if (!id) continue;
201
- const name = String(site.name || id);
202
- this.knownSites.set(id, {
203
- id,
204
- name,
205
- initials: initialsFrom(name),
206
- domain: String(site.domain || ''),
207
- edited: 'catalog',
208
- color: '#1e6a6f',
209
- });
210
- }
211
- }
212
-
213
- private api<T = Json>(path: string, init: RequestInit = {}): Promise<T> { return api<T>(path, init, this.transport); }
214
-
215
- private url(path: string) {
216
- return `${this.base}${path}`;
217
- }
218
-
219
- async listSites(): Promise<CmsSiteRecord[]> {
220
- // The authenticated Worker discovers owned projects and their CMS source.
221
- // Never silently bootstrap a particular customer, template, or default site.
222
- const catalog = await this.api<{ sites: Array<{ slug: string; name: string; domain?: string }> }>(
223
- this.url('/api/cms/sites'),
224
- );
225
- const sites = (catalog.sites || []).map((site) => {
226
- const id = String(site.slug || '').trim();
227
- const name = String(site.name || id);
228
- return {
229
- id,
230
- name,
231
- initials: initialsFrom(name),
232
- domain: String(site.domain || ''),
233
- edited: 'synced',
234
- color: '#1e6a6f',
235
- } satisfies CmsSiteRecord;
236
- });
237
- this.knownSites.clear();
238
- for (const site of sites) this.knownSites.set(site.id, site);
239
- return structuredClone(sites);
240
- }
241
-
242
- async getSite(siteId: string): Promise<CmsSiteRecord> {
243
- const boot = await this.api<Json>(this.url(`/api/cms/bootstrap?${siteQuery(siteId)}`));
244
- const record = siteRecordFromBootstrap(siteId, boot);
245
- this.knownSites.set(siteId, record);
246
- return structuredClone(record);
247
- }
248
-
249
- async createSite(_input: CmsSiteCreateInput): Promise<CmsSiteRecord> {
250
- throw new CmsCapabilityError(
251
- 'createSite',
252
- 'Hosted site creation uses the deploy wizard / projects API — not inline CMS create yet.',
253
- 'cms_capability_unsupported',
254
- );
255
- }
256
-
257
- async updateSite(siteId: string, patch: CmsSiteUpdatePatch): Promise<CmsSiteRecord> {
258
- const current = await this.getSite(siteId);
259
- if (patch.theme?.cssVars) {
260
- await this.api(this.url(`/api/cms/theme-vars?${siteQuery(siteId)}`), {
261
- method: 'PATCH',
262
- body: JSON.stringify({ project_slug: siteId, vars: patch.theme.cssVars }),
263
- });
264
- }
265
- const next = { ...current, ...patch, id: siteId, edited: 'just now' };
266
- this.knownSites.set(siteId, next);
267
- return structuredClone(next);
268
- }
269
-
270
- async deleteSite(_siteId: string): Promise<void> {
271
- throw new CmsCapabilityError('deleteSite', 'Hosted site delete is not enabled', 'cms_capability_unsupported');
272
- }
273
-
274
- async loadSite(siteId: string): Promise<CmsEditorSite> {
275
- const boot = await this.api<Json>(this.url(`/api/cms/bootstrap?${siteQuery(siteId)}`));
276
- const meta = siteRecordFromBootstrap(siteId, boot);
277
- this.knownSites.set(siteId, meta);
278
- return {
279
- ...meta,
280
- pages: hydratePages(boot),
281
- };
282
- }
283
-
284
- async listPages(siteId: string): Promise<CmsEditorPage[]> {
285
- const site = await this.loadSite(siteId);
286
- return site.pages;
287
- }
288
-
289
- async getPage(pageId: string): Promise<CmsEditorPage> {
290
- // Worker page GET requires site slug — resolve via known sites / bootstrap scan.
291
- for (const siteId of this.knownSites.keys()) {
292
- try {
293
- const body = await this.api<Json>(
294
- this.url(`/api/cms/pages/${encodeURIComponent(pageId)}?${siteQuery(siteId)}`),
295
- );
296
- const sections = Array.isArray(body.sections)
297
- ? body.sections.map((row: Json) => mapSection(row, []))
298
- : [];
299
- // Hydrate blocks via bootstrap for completeness when section list is bare.
300
- if (!sections.some((s) => s.blocks.length)) {
301
- const full = await this.loadSite(siteId);
302
- const hit = full.pages.find((p) => p.id === pageId);
303
- if (hit) return structuredClone(hit);
304
- }
305
- return mapPage(body.page || { id: pageId }, sections);
306
- } catch {
307
- // try next site
308
- }
309
- }
310
- throw new CmsCapabilityError(
311
- 'getPage',
312
- `page_not_found_or_site_not_loaded:${pageId}`,
313
- 'cms_source_not_found',
314
- );
315
- }
316
-
317
- async createPage(
318
- siteId: string,
319
- input: Partial<CmsEditorPage> & { title: string; slug: string },
320
- ): Promise<CmsEditorPage> {
321
- const slug = input.slug.replace(/^\/+/, '');
322
- const body = await this.api<Json>(this.url(`/api/cms/pages?${siteQuery(siteId)}`), {
323
- method: 'POST',
324
- body: JSON.stringify({
325
- project_id: siteId,
326
- project_slug: siteId,
327
- title: input.title || 'Untitled',
328
- slug,
329
- route_path: `/${slug}`,
330
- page_type: input.type || 'interior',
331
- status: 'draft',
332
- }),
333
- });
334
- return mapPage(body.page || body, []);
335
- }
336
-
337
- async updatePage(pageId: string, patch: Partial<CmsEditorPage>): Promise<CmsEditorPage> {
338
- const siteId = await this.findPageSiteId(pageId);
339
- const body = await this.api<Json>(
340
- this.url(`/api/cms/pages/${encodeURIComponent(pageId)}?${siteQuery(siteId)}`),
341
- {
342
- method: 'PUT',
343
- body: JSON.stringify({
344
- title: patch.title,
345
- slug: patch.slug?.replace(/^\/+/, ''),
346
- route_path: patch.slug,
347
- page_type: patch.type,
348
- status: patch.status,
349
- meta_title: patch.metaTitle,
350
- meta_description: patch.metaDescription,
351
- }),
352
- },
353
- );
354
- return mapPage(body.page || body, patch.sections || []);
355
- }
356
-
357
- async deletePage(pageId: string): Promise<void> {
358
- const siteId = await this.findPageSiteId(pageId);
359
- await this.api(this.url(`/api/cms/pages/${encodeURIComponent(pageId)}?${siteQuery(siteId)}`), {
360
- method: 'DELETE',
361
- });
362
- }
363
-
364
- async listSections(pageId: string): Promise<CmsEditorSection[]> {
365
- const page = await this.getPage(pageId);
366
- return page.sections;
367
- }
368
-
369
- async getSection(sectionId: string): Promise<CmsEditorSection> {
370
- const site = await this.loadSite(await this.guessSiteId());
371
- for (const page of site.pages) {
372
- const section = page.sections.find((s) => s.id === sectionId);
373
- if (section) return structuredClone(section);
374
- }
375
- throw new CmsCapabilityError('getSection', `section_not_found:${sectionId}`, 'cms_source_not_found');
376
- }
377
-
378
- async createSection(
379
- pageId: string,
380
- input: Partial<CmsEditorSection> & { name: string },
381
- ): Promise<CmsEditorSection> {
382
- const siteId = await this.findPageSiteId(pageId);
383
- const body = await this.api<Json>(this.url(`/api/cms/sections?${siteQuery(siteId)}`), {
384
- method: 'POST',
385
- body: JSON.stringify({
386
- page_id: pageId,
387
- section_type: input.type || 'section',
388
- section_name: input.name,
389
- section_data: input.fields || {},
390
- sort_order: 0,
391
- }),
392
- });
393
- return mapSection(body.section || body, []);
394
- }
395
-
396
- async updateSection(
397
- sectionId: string,
398
- patch: Partial<CmsEditorSection>,
399
- ): Promise<CmsEditorSection> {
400
- const siteId = await this.guessSiteId();
401
- const body = await this.api<Json>(
402
- this.url(`/api/cms/sections/${encodeURIComponent(sectionId)}?${siteQuery(siteId)}`),
403
- {
404
- method: 'PUT',
405
- body: JSON.stringify({
406
- section_name: patch.name,
407
- section_data: patch.fields,
408
- css: patch.css,
409
- is_visible: patch.visible === false ? 0 : 1,
410
- }),
411
- },
412
- );
413
- return mapSection(body.section || body, patch.blocks || []);
414
- }
415
-
416
- async deleteSection(sectionId: string): Promise<void> {
417
- const siteId = await this.guessSiteId();
418
- await this.api(this.url(`/api/cms/sections/${encodeURIComponent(sectionId)}?${siteQuery(siteId)}`), {
419
- method: 'DELETE',
420
- });
421
- }
422
-
423
- async reorderSections(pageId: string, sectionIds: string[]): Promise<void> {
424
- const siteId = await this.findPageSiteId(pageId);
425
- await this.api(this.url(`/api/cms/sections/reorder?${siteQuery(siteId)}`), {
426
- method: 'POST',
427
- body: JSON.stringify({
428
- page_id: pageId,
429
- order: sectionIds.map((id, index) => ({ id, sort_order: (index + 1) * 10 })),
430
- }),
431
- });
432
- }
433
-
434
- async setSectionVisibility(sectionId: string, visible: boolean): Promise<void> {
435
- const siteId = await this.guessSiteId();
436
- await this.api(
437
- this.url(`/api/cms/sections/${encodeURIComponent(sectionId)}/visibility?${siteQuery(siteId)}`),
438
- {
439
- method: 'POST',
440
- body: JSON.stringify({ is_visible: visible ? 1 : 0 }),
441
- },
442
- );
443
- }
444
-
445
- async listBlocks(sectionId: string): Promise<CmsEditorBlock[]> {
446
- const section = await this.getSection(sectionId);
447
- return section.blocks;
448
- }
449
-
450
- async getBlock(blockId: string): Promise<CmsEditorBlock> {
451
- const site = await this.loadSite(await this.guessSiteId());
452
- for (const page of site.pages) {
453
- for (const section of page.sections) {
454
- const block = section.blocks.find((b) => b.id === blockId);
455
- if (block) return structuredClone(block);
456
- }
457
- }
458
- throw new CmsCapabilityError('getBlock', `block_not_found:${blockId}`, 'cms_source_not_found');
459
- }
460
-
461
- async createBlock(
462
- sectionId: string,
463
- input: Partial<CmsEditorBlock> & { type: string },
464
- ): Promise<CmsEditorBlock> {
465
- const siteId = await this.guessSiteId();
466
- const body = await this.api<Json>(this.url(`/api/cms/blocks?${siteQuery(siteId)}`), {
467
- method: 'POST',
468
- body: JSON.stringify({
469
- section_id: sectionId,
470
- block_type: input.type,
471
- type: input.type,
472
- block_data: input.data || {},
473
- sort_order: input.sortOrder ?? 10,
474
- }),
475
- });
476
- return mapBlock(body.block || body.component || body, sectionId);
477
- }
478
-
479
- async updateBlock(blockId: string, patch: Partial<CmsEditorBlock>): Promise<CmsEditorBlock> {
480
- const siteId = await this.guessSiteId();
481
- const body = await this.api<Json>(
482
- this.url(`/api/cms/blocks/${encodeURIComponent(blockId)}?${siteQuery(siteId)}`),
483
- {
484
- method: 'PUT',
485
- body: JSON.stringify({
486
- block_data: patch.data,
487
- block_type: patch.type,
488
- type: patch.type,
489
- }),
490
- },
491
- );
492
- return mapBlock(body.block || body.component || { id: blockId, ...patch }, patch.sectionId || '');
493
- }
494
-
495
- async deleteBlock(blockId: string): Promise<void> {
496
- const siteId = await this.guessSiteId();
497
- await this.api(this.url(`/api/cms/blocks/${encodeURIComponent(blockId)}?${siteQuery(siteId)}`), {
498
- method: 'DELETE',
499
- });
500
- }
501
-
502
- async reorderBlocks(sectionId: string, blockIds: string[]): Promise<void> {
503
- const siteId = await this.guessSiteId();
504
- await this.api(this.url(`/api/cms/blocks/reorder?${siteQuery(siteId)}`), {
505
- method: 'POST',
506
- body: JSON.stringify({
507
- section_id: sectionId,
508
- order: blockIds.map((id, index) => ({ id, sort_order: (index + 1) * 10 })),
509
- }),
510
- });
511
- }
512
-
513
- async saveDraft(pageId: string, payload: unknown): Promise<CmsRevision> {
514
- const siteId = await this.findPageSiteId(pageId);
515
- const body = payload as { sections?: CmsEditorSection[] };
516
- const sections = Array.isArray(body?.sections) ? body.sections : [];
517
-
518
- for (const section of sections) {
519
- await this.api(this.url(`/api/cms/sections/${encodeURIComponent(section.id)}?${siteQuery(siteId)}`), {
520
- method: 'PUT',
521
- body: JSON.stringify({
522
- section_name: section.name,
523
- section_data: section.fields || {},
524
- css: section.css || {},
525
- is_visible: section.visible === false ? 0 : 1,
526
- }),
527
- });
528
- await this.setSectionVisibility(section.id, section.visible !== false);
529
-
530
- for (const block of section.blocks || []) {
531
- await this.updateBlock(block.id, {
532
- ...block,
533
- sectionId: section.id,
534
- });
535
- }
536
- await this.reorderBlocks(section.id, (section.blocks || []).map((block) => block.id));
537
- }
538
-
539
- // The page is only the route/container. Revision snapshots are composition-first:
540
- // groups -> sections -> blocks.
541
- await this.api(this.url(`/api/cms/pages/${encodeURIComponent(pageId)}?${siteQuery(siteId)}`), {
542
- method: 'PUT',
543
- body: JSON.stringify({ status: 'draft' }),
544
- });
545
-
546
- const composition = {
547
- version: 1,
548
- groups: buildCmsEditorGroups(sections),
549
- sections,
550
- };
551
- const revisionBody = await this.api<Json>(
552
- this.url(`/api/cms/pages/${encodeURIComponent(pageId)}/revisions?${siteQuery(siteId)}`),
553
- {
554
- method: 'POST',
555
- body: JSON.stringify({ kind: 'draft', snapshot: composition }),
556
- },
557
- );
558
- const revision = revisionBody.revision || revisionBody;
559
- return {
560
- id: String(revision.id),
561
- pageId: String(revision.pageId || revision.page_id || pageId),
562
- kind: revision.kind === 'publication' ? 'publication' : 'draft',
563
- createdAt: String(revision.createdAt || revision.created_at || new Date().toISOString()),
564
- label: revision.label ? String(revision.label) : undefined,
565
- snapshot: revision.snapshot,
566
- };
567
- }
568
-
569
- async getRevision(revisionId: string): Promise<CmsRevision> {
570
- if (!this.knownSites.size) await this.listSites();
571
- for (const siteId of this.knownSites.keys()) {
572
- try {
573
- const body = await this.api<Json>(
574
- this.url(`/api/cms/revisions/${encodeURIComponent(revisionId)}?${siteQuery(siteId)}`),
575
- );
576
- const revision = body.revision || body;
577
- return {
578
- id: String(revision.id),
579
- pageId: String(revision.pageId || revision.page_id),
580
- kind: revision.kind === 'publication' ? 'publication' : 'draft',
581
- createdAt: String(revision.createdAt || revision.created_at || new Date().toISOString()),
582
- label: revision.label ? String(revision.label) : undefined,
583
- snapshot: revision.snapshot,
584
- };
585
- } catch {
586
- // Revision ids are scoped to a site; try the next known site.
587
- }
588
- }
589
- throw new CmsCapabilityError('getRevision', `revision_not_found:${revisionId}`, 'cms_source_not_found');
590
- }
591
-
592
- async listRevisions(pageId: string): Promise<CmsRevision[]> {
593
- const siteId = await this.findPageSiteId(pageId);
594
- const body = await this.api<Json>(
595
- this.url(`/api/cms/pages/${encodeURIComponent(pageId)}/revisions?${siteQuery(siteId)}`),
596
- );
597
- return (body.revisions || []).map((revision: Json) => ({
598
- id: String(revision.id),
599
- pageId: String(revision.pageId || revision.page_id || pageId),
600
- kind: revision.kind === 'publication' ? 'publication' : 'draft',
601
- createdAt: String(revision.createdAt || revision.created_at || ''),
602
- label: revision.label ? String(revision.label) : undefined,
603
- }));
604
- }
605
-
606
- async restoreRevision(pageId: string, revisionId: string): Promise<CmsEditorPage> {
607
- const revision = await this.getRevision(revisionId);
608
- if (revision.pageId !== pageId) {
609
- throw new CmsCapabilityError('restoreRevision', 'revision_page_mismatch', 'cms_permission_denied');
610
- }
611
-
612
- const snapshot = (revision.snapshot || {}) as {
613
- sections?: CmsEditorSection[];
614
- groups?: unknown[];
615
- version?: number;
616
- };
617
- const desiredSections = Array.isArray(snapshot.sections) ? snapshot.sections : [];
618
- const current = await this.getPage(pageId);
619
- const currentSections = new Map(current.sections.map((section) => [section.id, section]));
620
- const desiredIds = new Set(desiredSections.map((section) => section.id));
621
- const restoredSectionIds: string[] = [];
622
-
623
- // Restore composition only. Route/page metadata is deliberately left untouched.
624
- for (const section of current.sections) {
625
- if (!desiredIds.has(section.id)) await this.deleteSection(section.id);
626
- }
627
-
628
- for (const desired of desiredSections) {
629
- const existing = currentSections.get(desired.id);
630
- let sectionId = desired.id;
631
-
632
- if (existing) {
633
- await this.updateSection(existing.id, {
634
- name: desired.name,
635
- type: desired.type,
636
- zone: desired.zone,
637
- visible: desired.visible,
638
- color: desired.color,
639
- fields: desired.fields,
640
- css: desired.css,
641
- });
642
- await this.setSectionVisibility(existing.id, desired.visible !== false);
643
- } else {
644
- const created = await this.createSection(pageId, {
645
- name: desired.name,
646
- type: desired.type,
647
- zone: desired.zone,
648
- visible: desired.visible,
649
- color: desired.color,
650
- fields: desired.fields,
651
- css: desired.css,
652
- });
653
- sectionId = created.id;
654
- }
655
-
656
- const liveSection = existing || { ...desired, id: sectionId, blocks: [] };
657
- const existingBlocks = new Map((liveSection.blocks || []).map((block) => [block.id, block]));
658
- const desiredBlockIds = new Set((desired.blocks || []).map((block) => block.id));
659
-
660
- for (const block of liveSection.blocks || []) {
661
- if (!desiredBlockIds.has(block.id)) await this.deleteBlock(block.id);
662
- }
663
-
664
- const restoredBlockIds: string[] = [];
665
- for (const desiredBlock of desired.blocks || []) {
666
- const liveBlock = existingBlocks.get(desiredBlock.id);
667
- let blockId = desiredBlock.id;
668
- if (liveBlock) {
669
- await this.updateBlock(liveBlock.id, {
670
- ...desiredBlock,
671
- sectionId,
672
- });
673
- } else {
674
- const createdBlock = await this.createBlock(sectionId, {
675
- type: desiredBlock.type,
676
- visible: desiredBlock.visible,
677
- data: desiredBlock.data,
678
- sortOrder: desiredBlock.sortOrder,
679
- });
680
- blockId = createdBlock.id;
681
- }
682
- restoredBlockIds.push(blockId);
683
- }
684
-
685
- await this.reorderBlocks(sectionId, restoredBlockIds);
686
- restoredSectionIds.push(sectionId);
687
- }
688
-
689
- await this.reorderSections(pageId, restoredSectionIds);
690
- return this.getPage(pageId);
691
- }
692
-
693
- async previewDraft(pageId: string): Promise<{ previewUrl?: string; snapshot: unknown }> {
694
- const siteId = await this.findPageSiteId(pageId);
695
- const page = await this.getPage(pageId);
696
- return {
697
- previewUrl: `/api/cms/render-page?${siteQuery(siteId)}&page_id=${encodeURIComponent(pageId)}&mode=draft`,
698
- snapshot: page,
699
- };
700
- }
701
-
702
- async publish(pageId: string): Promise<CmsPublicationSnapshot> {
703
- const siteId = await this.findPageSiteId(pageId);
704
- const body = await this.api<Json>(
705
- this.url(`/api/cms/pages/${encodeURIComponent(pageId)}/publish?${siteQuery(siteId)}`),
706
- { method: 'POST', body: JSON.stringify({}) },
707
- );
708
- const page = await this.getPage(pageId);
709
- return {
710
- publicationId: `pub_${pageId}`,
711
- route: page.slug,
712
- revision: 1,
713
- theme: 'default',
714
- sections: page.sections.map((section) => ({
715
- type: section.type,
716
- props: {
717
- ...section.fields,
718
- name: section.name,
719
- group: section.fields?.group || section.fields?.group_id,
720
- blocks: section.blocks,
721
- },
722
- })),
723
- publishedAt: new Date().toISOString(),
724
- };
725
- }
726
-
727
- async getPublishedRevision(pageId: string): Promise<CmsPublicationSnapshot | null> {
728
- try {
729
- const page = await this.getPage(pageId);
730
- if (page.status !== 'live') return null;
731
- return {
732
- publicationId: `pub_${pageId}`,
733
- route: page.slug,
734
- revision: 1,
735
- theme: 'default',
736
- sections: page.sections.map((section) => ({
737
- type: section.type,
738
- props: { ...section.fields, name: section.name, blocks: section.blocks },
739
- })),
740
- publishedAt: undefined,
741
- };
742
- } catch {
743
- return null;
744
- }
745
- }
746
-
747
- async listAssets(siteId: string): Promise<CmsAsset[]> {
748
- const body = await this.api<Json>(this.url(`/api/cms/assets?${siteQuery(siteId)}`));
749
- return (body.assets || []).map((row: Json) => ({
750
- id: String(row.id),
751
- name: String(row.original_filename || row.filename || row.id),
752
- mimeType: row.mime_type ? String(row.mime_type) : undefined,
753
- size: row.content_size_bytes != null ? Number(row.content_size_bytes) : undefined,
754
- url: row.public_url ? String(row.public_url) : undefined,
755
- key: String(row.id),
756
- }));
757
- }
758
-
759
- async getAsset(assetId: string): Promise<CmsAsset> {
760
- for (const siteId of this.knownSites.keys()) {
761
- const assets = await this.listAssets(siteId);
762
- const hit = assets.find((a) => a.id === assetId);
763
- if (hit) return hit;
764
- }
765
- throw new CmsCapabilityError('getAsset', `asset_not_found:${assetId}`, 'cms_source_not_found');
766
- }
767
-
768
- async uploadAsset(
769
- siteId: string,
770
- file: Blob,
771
- meta?: { name?: string; metadata?: Record<string, unknown> },
772
- ): Promise<CmsAsset> {
773
- const form = new FormData();
774
- const filename = meta?.name || ('name' in file && typeof file.name === 'string' ? file.name : 'asset');
775
- form.set('file', file, filename);
776
- if (meta?.name) form.set('name', meta.name);
777
- if (meta?.metadata) form.set('metadata', JSON.stringify(meta.metadata));
778
-
779
- const body = await this.api<Json>(this.url(`/api/cms/assets?${siteQuery(siteId)}`), {
780
- method: 'POST',
781
- body: form,
782
- });
783
- const row = body.asset || body;
784
- return {
785
- id: String(row.id),
786
- name: String(row.original_filename || row.filename || row.id),
787
- mimeType: row.mime_type ? String(row.mime_type) : undefined,
788
- size: row.content_size_bytes != null ? Number(row.content_size_bytes) : undefined,
789
- url: row.public_url ? String(row.public_url) : undefined,
790
- key: String(row.id),
791
- metadata: parseFields(row.metadata),
792
- };
793
- }
794
-
795
- async updateAsset(
796
- assetId: string,
797
- patch: Partial<Pick<CmsAsset, 'name' | 'metadata' | 'url' | 'key'>>,
798
- ): Promise<CmsAsset> {
799
- const siteId = await this.findAssetSiteId(assetId);
800
- const body = await this.api<Json>(
801
- this.url(`/api/cms/assets/${encodeURIComponent(assetId)}?${siteQuery(siteId)}`),
802
- {
803
- method: 'PATCH',
804
- body: JSON.stringify({
805
- name: patch.name,
806
- metadata: patch.metadata,
807
- }),
808
- },
809
- );
810
- const row = body.asset || body;
811
- return {
812
- id: String(row.id),
813
- name: String(row.original_filename || row.filename || row.id),
814
- mimeType: row.mime_type ? String(row.mime_type) : undefined,
815
- size: row.content_size_bytes != null ? Number(row.content_size_bytes) : undefined,
816
- url: row.public_url ? String(row.public_url) : undefined,
817
- key: String(row.id),
818
- metadata: parseFields(row.metadata),
819
- };
820
- }
821
-
822
- async deleteAsset(assetId: string): Promise<void> {
823
- const siteId = await this.findAssetSiteId(assetId);
824
- await this.api(
825
- this.url(`/api/cms/assets/${encodeURIComponent(assetId)}?${siteQuery(siteId)}`),
826
- { method: 'DELETE' },
827
- );
828
- }
829
-
830
- private guessSiteId() {
831
- const first = this.knownSites.keys().next().value;
832
- return first || 'agentsam-sdk';
833
- }
834
-
835
- private async findPageSiteId(pageId: string): Promise<string> {
836
- if (!this.knownSites.size) {
837
- await this.listSites();
838
- }
839
- for (const siteId of this.knownSites.keys()) {
840
- try {
841
- const site = await this.loadSite(siteId);
842
- if (site.pages.some((p) => p.id === pageId)) return siteId;
843
- } catch {
844
- // continue
845
- }
846
- }
847
- return this.guessSiteId();
848
- }
849
-
850
- private async findAssetSiteId(assetId: string): Promise<string> {
851
- if (!this.knownSites.size) {
852
- await this.listSites();
853
- }
854
- for (const siteId of this.knownSites.keys()) {
855
- try {
856
- const assets = await this.listAssets(siteId);
857
- if (assets.some((asset) => asset.id === assetId)) return siteId;
858
- } catch {
859
- // continue
860
- }
861
- }
862
- throw new CmsCapabilityError('getAsset', `asset_not_found:${assetId}`, 'cms_source_not_found');
863
- }
864
- }
865
-
866
- export function createHttpCmsAdapter(
867
- options?: ConstructorParameters<typeof HttpCmsAdapter>[0],
868
- ): HttpCmsAdapter {
869
- return new HttpCmsAdapter(options);
870
- }
871
-