@synopackageland/cli 0.3.10 → 0.4.1

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 (641) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +57 -9
  3. package/dist/bin.js +1 -2
  4. package/dist/build-spk/generator.d.ts +0 -3
  5. package/dist/build-spk/generator.js +138 -287
  6. package/dist/build-spk/native-lifecycle.js +0 -3
  7. package/dist/build-spk/native-payload.js +0 -1
  8. package/dist/build-spk/notices.d.ts +5 -0
  9. package/dist/build-spk/notices.js +60 -0
  10. package/dist/cli.js +178 -151
  11. package/dist/compose/analyze.d.ts +1 -2
  12. package/dist/compose/analyze.js +5 -48
  13. package/dist/contract/unsupported-types.d.ts +10 -0
  14. package/dist/contract/unsupported-types.js +49 -0
  15. package/dist/contract/validate.js +25 -2
  16. package/dist/contract/web-launch.js +0 -2
  17. package/dist/deploy/deploy.d.ts +1 -4
  18. package/dist/deploy/deploy.js +45 -156
  19. package/dist/deploy/homes-values.js +1 -1
  20. package/dist/deploy/plan.d.ts +18 -0
  21. package/dist/deploy/plan.js +54 -0
  22. package/dist/deploy/spk-version.d.ts +2 -14
  23. package/dist/deploy/spk-version.js +25 -111
  24. package/dist/dev.d.ts +1 -3
  25. package/dist/dev.js +14 -28
  26. package/dist/error-registry.js +830 -862
  27. package/dist/host/dsm-client.js +12 -272
  28. package/dist/host/dsm-port-profile.d.ts +0 -1
  29. package/dist/host/dsm-port-profile.js +0 -2
  30. package/dist/host/types.d.ts +1 -83
  31. package/dist/index.d.ts +0 -9
  32. package/dist/index.js +0 -6
  33. package/dist/info.d.ts +0 -1
  34. package/dist/info.js +3 -10
  35. package/dist/init.d.ts +15 -1
  36. package/dist/init.js +128 -12
  37. package/dist/log.js +2 -3
  38. package/dist/native/validate.js +0 -1
  39. package/dist/standalone/binary.d.ts +9 -0
  40. package/dist/standalone/binary.js +67 -0
  41. package/dist/standalone/build.d.ts +25 -0
  42. package/dist/standalone/build.js +110 -0
  43. package/dist/standalone/daemon.d.ts +23 -0
  44. package/dist/standalone/daemon.js +114 -0
  45. package/dist/standalone/dsm-window.d.ts +26 -0
  46. package/dist/standalone/dsm-window.js +291 -0
  47. package/dist/standalone/helper-inventory.d.ts +16 -0
  48. package/dist/standalone/helper-inventory.js +2 -0
  49. package/dist/standalone/helper.d.ts +21 -0
  50. package/dist/standalone/helper.js +105 -0
  51. package/dist/standalone/host-adapter.d.ts +5 -0
  52. package/dist/standalone/host-adapter.js +148 -0
  53. package/dist/standalone/host-platform.d.ts +13 -0
  54. package/dist/standalone/host-platform.js +42 -0
  55. package/dist/standalone/host-types.d.ts +49 -0
  56. package/dist/standalone/host-types.js +1 -0
  57. package/dist/standalone/i18n.d.ts +28 -0
  58. package/dist/standalone/i18n.js +161 -0
  59. package/dist/standalone/inspect-helper.d.ts +6 -0
  60. package/dist/standalone/inspect-helper.js +88 -0
  61. package/dist/standalone/inspect-spk.d.ts +23 -0
  62. package/dist/standalone/inspect-spk.js +209 -0
  63. package/dist/standalone/lifecycle-helper.d.ts +2 -0
  64. package/dist/standalone/lifecycle-helper.js +12 -0
  65. package/dist/standalone/lifecycle.d.ts +3 -0
  66. package/dist/standalone/lifecycle.js +53 -0
  67. package/dist/standalone/manifest.d.ts +73 -0
  68. package/dist/standalone/manifest.js +279 -0
  69. package/dist/standalone/reopen-events.d.ts +2 -0
  70. package/dist/standalone/reopen-events.js +28 -0
  71. package/dist/standalone/root-messages.d.ts +7 -0
  72. package/dist/standalone/root-messages.js +259 -0
  73. package/dist/standalone/root-ops.d.ts +42 -0
  74. package/dist/standalone/root-ops.js +101 -0
  75. package/dist/standalone/root-window.d.ts +36 -0
  76. package/dist/standalone/root-window.js +302 -0
  77. package/dist/standalone/spk.d.ts +23 -0
  78. package/dist/standalone/spk.js +192 -0
  79. package/dist/template-paths.d.ts +2 -0
  80. package/dist/template-paths.js +9 -0
  81. package/dist/templates/_daemon/fixture_linux_test.go +15 -0
  82. package/dist/templates/_daemon/fixture_other_test.go +7 -0
  83. package/dist/templates/_daemon/go.mod +3 -0
  84. package/dist/templates/_daemon/main.go +608 -0
  85. package/dist/templates/_daemon/main_test.go +242 -0
  86. package/dist/templates/_daemon/process_linux.go +55 -0
  87. package/dist/templates/_daemon/process_linux_test.go +161 -0
  88. package/dist/templates/_daemon/process_other.go +14 -0
  89. package/dist/templates/_daemon/testdata/child.go +41 -0
  90. package/dist/templates/_shared/GO-LICENSE +27 -0
  91. package/dist/templates/_shared/GO-PATENTS +22 -0
  92. package/dist/templates/_shared/LICENSES/TEMPLATE.txt +21 -0
  93. package/dist/templates/_shared/notice-overrides/index.json +14 -0
  94. package/dist/templates/_shared/notice-overrides/utils-0.4.2-LICENSE +21 -0
  95. package/dist/templates/_shared/notice-overrides/utils-0.5.0-LICENSE +21 -0
  96. package/dist/templates/_shared/third-party-notices.mjs +51 -0
  97. package/dist/templates/binary/synology-app.yaml +7 -0
  98. package/dist/templates/hello-files/compose.yaml +0 -1
  99. package/dist/templates/hello-web/compose.yaml +13 -10
  100. package/dist/templates/hello-web/html/app.js +1 -23
  101. package/dist/templates/hello-web/html/index.html +1 -3
  102. package/dist/templates/hello-web-page/compose.yaml +13 -10
  103. package/dist/templates/hello-web-page/html/app.js +1 -23
  104. package/dist/templates/hello-web-page/html/index.html +1 -3
  105. package/dist/templates/native-go/README.md +324 -0
  106. package/dist/templates/native-go/backend/THIRD_PARTY_NOTICES.txt +59 -0
  107. package/dist/templates/native-go/backend/cmd/app/main.go +49 -0
  108. package/dist/templates/native-go/backend/cmd/dsm-readonly-probe/main_linux.go +46 -0
  109. package/dist/templates/native-go/backend/cmd/helper/main.go +38 -0
  110. package/dist/templates/native-go/backend/go.mod +7 -0
  111. package/dist/templates/native-go/backend/go.sum +4 -0
  112. package/dist/templates/native-go/backend/internal/api/binary.go +154 -0
  113. package/dist/templates/native-go/backend/internal/api/binary_test.go +165 -0
  114. package/dist/templates/native-go/backend/internal/api/errors.go +33 -0
  115. package/dist/templates/native-go/backend/internal/api/registry.go +104 -0
  116. package/dist/templates/native-go/backend/internal/api/registry_test.go +329 -0
  117. package/dist/templates/native-go/backend/internal/api/server.go +159 -0
  118. package/dist/templates/native-go/backend/internal/app/nas_cgi_artifact_test.go +121 -0
  119. package/dist/templates/native-go/backend/internal/app/nas_refusal_test.go +46 -0
  120. package/dist/templates/native-go/backend/internal/app/root_none.go +9 -0
  121. package/dist/templates/native-go/backend/internal/app/routes.go +138 -0
  122. package/dist/templates/native-go/backend/internal/app/routes_test.go +172 -0
  123. package/dist/templates/native-go/backend/internal/dsm/auth.go +118 -0
  124. package/dist/templates/native-go/backend/internal/dsm/auth_test.go +139 -0
  125. package/dist/templates/native-go/backend/internal/dsmprobe/collector_linux.go +335 -0
  126. package/dist/templates/native-go/backend/internal/dsmprobe/collector_linux_test.go +41 -0
  127. package/dist/templates/native-go/backend/internal/dsmprobe/protocol.go +179 -0
  128. package/dist/templates/native-go/backend/internal/dsmprobe/protocol_test.go +29 -0
  129. package/dist/templates/native-go/backend/internal/helper/cohort.go +393 -0
  130. package/dist/templates/native-go/backend/internal/helper/cohort_publication.go +18 -0
  131. package/dist/templates/native-go/backend/internal/helper/cohort_publication_test.go +105 -0
  132. package/dist/templates/native-go/backend/internal/helper/cohort_test.go +372 -0
  133. package/dist/templates/native-go/backend/internal/helper/control.go +424 -0
  134. package/dist/templates/native-go/backend/internal/helper/control_test.go +250 -0
  135. package/dist/templates/native-go/backend/internal/helper/data_contract.go +242 -0
  136. package/dist/templates/native-go/backend/internal/helper/data_contract_test.go +51 -0
  137. package/dist/templates/native-go/backend/internal/helper/data_decode.go +184 -0
  138. package/dist/templates/native-go/backend/internal/helper/data_decode_pointer_test.go +30 -0
  139. package/dist/templates/native-go/backend/internal/helper/data_protocol.go +416 -0
  140. package/dist/templates/native-go/backend/internal/helper/data_protocol_test.go +449 -0
  141. package/dist/templates/native-go/backend/internal/helper/dsm_acl_linux.go +139 -0
  142. package/dist/templates/native-go/backend/internal/helper/dsm_acl_linux_test.go +121 -0
  143. package/dist/templates/native-go/backend/internal/helper/dsm_acl_syscall_linux.go +95 -0
  144. package/dist/templates/native-go/backend/internal/helper/dsm_acl_syscall_linux_test.go +56 -0
  145. package/dist/templates/native-go/backend/internal/helper/dsm_bridge_linux.go +144 -0
  146. package/dist/templates/native-go/backend/internal/helper/dsm_bridge_linux_test.go +89 -0
  147. package/dist/templates/native-go/backend/internal/helper/dsm_home_linux.go +107 -0
  148. package/dist/templates/native-go/backend/internal/helper/dsm_home_linux_test.go +82 -0
  149. package/dist/templates/native-go/backend/internal/helper/dsm_probe_transport_linux.go +151 -0
  150. package/dist/templates/native-go/backend/internal/helper/dsm_probe_transport_linux_test.go +66 -0
  151. package/dist/templates/native-go/backend/internal/helper/grant_authority.go +516 -0
  152. package/dist/templates/native-go/backend/internal/helper/grant_authority_contract.go +88 -0
  153. package/dist/templates/native-go/backend/internal/helper/grant_authority_test.go +510 -0
  154. package/dist/templates/native-go/backend/internal/helper/grant_cohort.go +389 -0
  155. package/dist/templates/native-go/backend/internal/helper/grant_cohort_test.go +239 -0
  156. package/dist/templates/native-go/backend/internal/helper/grant_delivery.go +49 -0
  157. package/dist/templates/native-go/backend/internal/helper/grant_delivery_methods.go +273 -0
  158. package/dist/templates/native-go/backend/internal/helper/grant_delivery_test.go +322 -0
  159. package/dist/templates/native-go/backend/internal/helper/grant_operation_contract.go +47 -0
  160. package/dist/templates/native-go/backend/internal/helper/grant_readonly_test.go +180 -0
  161. package/dist/templates/native-go/backend/internal/helper/grant_repository_linux.go +415 -0
  162. package/dist/templates/native-go/backend/internal/helper/grant_repository_linux_test.go +468 -0
  163. package/dist/templates/native-go/backend/internal/helper/grant_rpc.go +147 -0
  164. package/dist/templates/native-go/backend/internal/helper/grant_rpc_test.go +51 -0
  165. package/dist/templates/native-go/backend/internal/helper/grant_snapshot.go +75 -0
  166. package/dist/templates/native-go/backend/internal/helper/grant_supervisor_linux.go +134 -0
  167. package/dist/templates/native-go/backend/internal/helper/grant_supervisor_linux_test.go +254 -0
  168. package/dist/templates/native-go/backend/internal/helper/lease.go +112 -0
  169. package/dist/templates/native-go/backend/internal/helper/lease_linux.go +44 -0
  170. package/dist/templates/native-go/backend/internal/helper/lease_other.go +8 -0
  171. package/dist/templates/native-go/backend/internal/helper/lifecycle.go +234 -0
  172. package/dist/templates/native-go/backend/internal/helper/lifecycle_test.go +473 -0
  173. package/dist/templates/native-go/backend/internal/helper/managed_pilot.go +284 -0
  174. package/dist/templates/native-go/backend/internal/helper/managed_pilot_repository_linux.go +74 -0
  175. package/dist/templates/native-go/backend/internal/helper/managed_pilot_repository_linux_test.go +40 -0
  176. package/dist/templates/native-go/backend/internal/helper/managed_pilot_test.go +210 -0
  177. package/dist/templates/native-go/backend/internal/helper/nas_shipped_refusal_linux_test.go +97 -0
  178. package/dist/templates/native-go/backend/internal/helper/native_discovery.go +79 -0
  179. package/dist/templates/native-go/backend/internal/helper/native_identity.go +89 -0
  180. package/dist/templates/native-go/backend/internal/helper/native_provider.go +159 -0
  181. package/dist/templates/native-go/backend/internal/helper/native_provider_test.go +421 -0
  182. package/dist/templates/native-go/backend/internal/helper/observation.go +204 -0
  183. package/dist/templates/native-go/backend/internal/helper/observation_health_test.go +115 -0
  184. package/dist/templates/native-go/backend/internal/helper/observation_reload_budget_test.go +117 -0
  185. package/dist/templates/native-go/backend/internal/helper/observation_test.go +196 -0
  186. package/dist/templates/native-go/backend/internal/helper/observer_diagnostic.go +109 -0
  187. package/dist/templates/native-go/backend/internal/helper/observer_diagnostic_linux.go +76 -0
  188. package/dist/templates/native-go/backend/internal/helper/observer_diagnostic_linux_test.go +124 -0
  189. package/dist/templates/native-go/backend/internal/helper/observer_diagnostic_test.go +98 -0
  190. package/dist/templates/native-go/backend/internal/helper/operation_bootstrap_linux.go +193 -0
  191. package/dist/templates/native-go/backend/internal/helper/operation_credentials_linux.go +56 -0
  192. package/dist/templates/native-go/backend/internal/helper/operation_linux.go +480 -0
  193. package/dist/templates/native-go/backend/internal/helper/operation_linux_test.go +528 -0
  194. package/dist/templates/native-go/backend/internal/helper/peer_linux.go +44 -0
  195. package/dist/templates/native-go/backend/internal/helper/peer_other.go +7 -0
  196. package/dist/templates/native-go/backend/internal/helper/process_linux.go +177 -0
  197. package/dist/templates/native-go/backend/internal/helper/process_other.go +5 -0
  198. package/dist/templates/native-go/backend/internal/helper/publication_test.go +178 -0
  199. package/dist/templates/native-go/backend/internal/helper/read_stream_cohort_linux_test.go +156 -0
  200. package/dist/templates/native-go/backend/internal/helper/read_transfer.go +40 -0
  201. package/dist/templates/native-go/backend/internal/helper/read_transfer_linux.go +109 -0
  202. package/dist/templates/native-go/backend/internal/helper/read_transfer_linux_test.go +118 -0
  203. package/dist/templates/native-go/backend/internal/helper/read_transfer_test.go +177 -0
  204. package/dist/templates/native-go/backend/internal/helper/readonly.go +105 -0
  205. package/dist/templates/native-go/backend/internal/helper/readonly_admission.go +85 -0
  206. package/dist/templates/native-go/backend/internal/helper/readonly_cohort_linux_test.go +253 -0
  207. package/dist/templates/native-go/backend/internal/helper/readonly_linux_test.go +378 -0
  208. package/dist/templates/native-go/backend/internal/helper/readonly_mount_linux.go +65 -0
  209. package/dist/templates/native-go/backend/internal/helper/readonly_mount_proxy_linux.go +113 -0
  210. package/dist/templates/native-go/backend/internal/helper/readonly_operations_linux.go +168 -0
  211. package/dist/templates/native-go/backend/internal/helper/readonly_resolver_linux.go +241 -0
  212. package/dist/templates/native-go/backend/internal/helper/readonly_test.go +40 -0
  213. package/dist/templates/native-go/backend/internal/helper/relaxed_identity.go +252 -0
  214. package/dist/templates/native-go/backend/internal/helper/relaxed_identity_contract.go +105 -0
  215. package/dist/templates/native-go/backend/internal/helper/relaxed_identity_test.go +406 -0
  216. package/dist/templates/native-go/backend/internal/helper/relaxed_invalidation.go +200 -0
  217. package/dist/templates/native-go/backend/internal/helper/repair.go +132 -0
  218. package/dist/templates/native-go/backend/internal/helper/repair_test.go +271 -0
  219. package/dist/templates/native-go/backend/internal/helper/s1r_actor_acl_linux_test.go +303 -0
  220. package/dist/templates/native-go/backend/internal/helper/s1r_actor_fixture_linux_test.go +184 -0
  221. package/dist/templates/native-go/backend/internal/helper/s1r_actor_races_linux_test.go +231 -0
  222. package/dist/templates/native-go/backend/internal/helper/s1r_fixture_contract_linux_test.go +18 -0
  223. package/dist/templates/native-go/backend/internal/helper/server_linux.go +124 -0
  224. package/dist/templates/native-go/backend/internal/helper/status.go +334 -0
  225. package/dist/templates/native-go/backend/internal/helper/status_test.go +288 -0
  226. package/dist/templates/native-go/backend/internal/helper/supervision.go +107 -0
  227. package/dist/templates/native-go/backend/internal/helper/supervision_test.go +124 -0
  228. package/dist/templates/native-go/backend/internal/helper/supervisor_frame.go +76 -0
  229. package/dist/templates/native-go/backend/internal/helper/supervisor_frame_linux_test.go +69 -0
  230. package/dist/templates/native-go/backend/internal/helper/supervisor_frame_test.go +107 -0
  231. package/dist/templates/native-go/backend/internal/helper/supervisor_linux.go +363 -0
  232. package/dist/templates/native-go/backend/internal/helper/supervisor_linux_test.go +913 -0
  233. package/dist/templates/native-go/backend/internal/helper/supervisor_socket_eof_test.go +74 -0
  234. package/dist/templates/native-go/backend/internal/helper/supervisor_socket_test.go +45 -0
  235. package/dist/templates/native-go/backend/internal/helper/testdata/protocol2/create.json +23 -0
  236. package/dist/templates/native-go/backend/internal/helper/testdata/protocol2/frames.json +67 -0
  237. package/dist/templates/native-go/backend/internal/helper/testdata/protocol2/grant-store.json +52 -0
  238. package/dist/templates/native-go/backend/internal/helper/testdata/protocol2/intent.json +20 -0
  239. package/dist/templates/native-go/backend/internal/helper/testdata/protocol2/list.json +20 -0
  240. package/dist/templates/native-go/backend/internal/helper/testdata/protocol2/publish.json +20 -0
  241. package/dist/templates/native-go/backend/internal/helper/testdata/protocol2/read.json +22 -0
  242. package/dist/templates/native-go/backend/internal/helper/testdata/protocol2/stat.json +22 -0
  243. package/dist/templates/native-go/backend/internal/helper/testdata/protocol2/write-stream.json +22 -0
  244. package/dist/templates/native-go/backend/internal/helper/unit_connection.go +75 -0
  245. package/dist/templates/native-go/backend/internal/helper/unit_connection_linux_test.go +135 -0
  246. package/dist/templates/native-go/backend/internal/helper/unit_connection_test.go +133 -0
  247. package/dist/templates/native-go/backend/internal/helper/unit_frame_test.go +32 -0
  248. package/dist/templates/native-go/backend/internal/helper/unit_linux.go +364 -0
  249. package/dist/templates/native-go/backend/internal/helper/unit_linux_test.go +46 -0
  250. package/dist/templates/native-go/backend/internal/helper/unit_mechanisms_linux_test.go +217 -0
  251. package/dist/templates/native-go/backend/internal/helper/unit_padding_linux_test.go +178 -0
  252. package/dist/templates/native-go/backend/internal/helper/unit_query_linux.go +111 -0
  253. package/dist/templates/native-go/backend/internal/helper/unit_reload_linux_test.go +372 -0
  254. package/dist/templates/native-go/backend/internal/helper/unit_reload_sequence_linux_test.go +232 -0
  255. package/dist/templates/native-go/backend/internal/helper/write.go +77 -0
  256. package/dist/templates/native-go/backend/internal/helper/write_admission.go +260 -0
  257. package/dist/templates/native-go/backend/internal/helper/write_admission_test.go +135 -0
  258. package/dist/templates/native-go/backend/internal/helper/write_cohort_linux_test.go +218 -0
  259. package/dist/templates/native-go/backend/internal/helper/write_files_linux.go +202 -0
  260. package/dist/templates/native-go/backend/internal/helper/write_files_linux_test.go +199 -0
  261. package/dist/templates/native-go/backend/internal/helper/write_intent_linux.go +116 -0
  262. package/dist/templates/native-go/backend/internal/helper/write_intent_linux_test.go +74 -0
  263. package/dist/templates/native-go/backend/internal/helper/write_operation_linux.go +245 -0
  264. package/dist/templates/native-go/backend/internal/helper/write_test.go +53 -0
  265. package/dist/templates/native-go/dsm-package.yaml +58 -0
  266. package/dist/templates/native-go/gitignore +1 -0
  267. package/dist/templates/native-go/i18n/glossary.json +662 -0
  268. package/dist/templates/native-go/i18n/messages/de.json +28 -0
  269. package/dist/templates/native-go/i18n/messages/en.json +28 -0
  270. package/dist/templates/native-go/i18n/messages/es.json +28 -0
  271. package/dist/templates/native-go/i18n/messages/fr.json +28 -0
  272. package/dist/templates/native-go/i18n/messages/it.json +28 -0
  273. package/dist/templates/native-go/i18n/messages/ja.json +28 -0
  274. package/dist/templates/native-go/i18n/messages/ko.json +28 -0
  275. package/dist/templates/native-go/i18n/messages/zh-CN.json +28 -0
  276. package/dist/templates/native-go/i18n/messages/zh-TW.json +28 -0
  277. package/dist/templates/native-go/ui/app.css +35 -0
  278. package/dist/templates/native-go/ui/app.js +101 -0
  279. package/dist/templates/native-go-better-auth/backend/internal/app/identity.go +208 -0
  280. package/dist/templates/native-go-better-auth/backend/internal/app/identity_test.go +113 -0
  281. package/dist/templates/native-go-better-auth/node/app.mjs +72 -0
  282. package/dist/templates/native-go-better-auth/node/build.mjs +4 -0
  283. package/dist/templates/native-go-better-auth/node/package-lock.json +862 -0
  284. package/dist/templates/native-go-better-auth/node/package.json +1 -0
  285. package/dist/templates/native-go-better-auth/node/test/auth.test.mjs +31 -0
  286. package/dist/templates/native-go-integration/backend/internal/app/identity_none.go +6 -0
  287. package/dist/templates/native-go-integration/backend/internal/app/personal.go +203 -0
  288. package/dist/templates/native-go-integration/backend/internal/app/personal_test.go +119 -0
  289. package/dist/templates/native-go-root/backend/internal/app/root.go +107 -0
  290. package/dist/templates/native-go-root/backend/internal/app/root_test.go +124 -0
  291. package/dist/templates/native-go-root/root/whoami.sh +6 -0
  292. package/dist/templates/native-go-vue/README.md +224 -0
  293. package/dist/templates/native-go-vue/frontend/DESIGN.md +78 -0
  294. package/dist/templates/native-go-vue/frontend/package-lock.json +2410 -0
  295. package/dist/templates/native-go-vue/frontend/package.json +6 -0
  296. package/dist/templates/native-go-vue/frontend/src/App.vue +159 -0
  297. package/dist/templates/native-go-vue/frontend/src/context.ts +56 -0
  298. package/dist/templates/native-go-vue/frontend/src/main.ts +29 -0
  299. package/dist/templates/native-go-vue/frontend/src/nas/NasGrantSettings.vue +74 -0
  300. package/dist/templates/native-go-vue/frontend/src/nas/NasPathPicker.vue +106 -0
  301. package/dist/templates/native-go-vue/frontend/src/nas/NasUnavailable.vue +20 -0
  302. package/dist/templates/native-go-vue/frontend/src/nas/i18n/de.json +74 -0
  303. package/dist/templates/native-go-vue/frontend/src/nas/i18n/en.json +74 -0
  304. package/dist/templates/native-go-vue/frontend/src/nas/i18n/es.json +74 -0
  305. package/dist/templates/native-go-vue/frontend/src/nas/i18n/fr.json +74 -0
  306. package/dist/templates/native-go-vue/frontend/src/nas/i18n/it.json +74 -0
  307. package/dist/templates/native-go-vue/frontend/src/nas/i18n/ja.json +74 -0
  308. package/dist/templates/native-go-vue/frontend/src/nas/i18n/ko.json +74 -0
  309. package/dist/templates/native-go-vue/frontend/src/nas/i18n/zh-CN.json +74 -0
  310. package/dist/templates/native-go-vue/frontend/src/nas/i18n/zh-TW.json +74 -0
  311. package/dist/templates/native-go-vue/frontend/src/nas/i18n.ts +38 -0
  312. package/dist/templates/native-go-vue/frontend/src/nas/mock-provider.ts +119 -0
  313. package/dist/templates/native-go-vue/frontend/src/nas/provider.ts +59 -0
  314. package/dist/templates/native-go-vue/frontend/src/nas/use-request.ts +27 -0
  315. package/dist/templates/native-go-vue/frontend/src/style.css +31 -0
  316. package/dist/templates/native-go-vue/frontend/test/apps.test.ts +190 -0
  317. package/dist/templates/native-go-vue/frontend/test/nas-provider.test.ts +81 -0
  318. package/dist/templates/native-go-vue/frontend/test/nas-request.test.ts +21 -0
  319. package/dist/templates/native-go-vue/frontend/test/nas-ui.test.ts +261 -0
  320. package/dist/templates/native-go-vue/frontend/tsconfig.json +1 -0
  321. package/dist/templates/native-go-vue/frontend/vite.config.ts +10 -0
  322. package/dist/templates/native-go-vue/gitignore +2 -0
  323. package/dist/types.d.ts +1 -1
  324. package/dist/validate.js +11 -7
  325. package/package.json +5 -8
  326. package/schema/synology-app.schema.json +36 -37
  327. package/skills/SKILL.md +4 -48
  328. package/skills/reference/create.md +11 -83
  329. package/skills/reference/deploy.md +7 -78
  330. package/skills/reference/diagnose.md +4 -101
  331. package/skills/reference/files.md +5 -41
  332. package/skills/reference/identity.md +3 -29
  333. package/skills/reference/wrap.md +0 -2
  334. package/templates/_daemon/fixture_linux_test.go +15 -0
  335. package/templates/_daemon/fixture_other_test.go +7 -0
  336. package/templates/_daemon/go.mod +3 -0
  337. package/templates/_daemon/main.go +608 -0
  338. package/templates/_daemon/main_test.go +242 -0
  339. package/templates/_daemon/process_linux.go +55 -0
  340. package/templates/_daemon/process_linux_test.go +161 -0
  341. package/templates/_daemon/process_other.go +14 -0
  342. package/templates/_daemon/testdata/child.go +41 -0
  343. package/templates/_shared/GO-LICENSE +27 -0
  344. package/templates/_shared/GO-PATENTS +22 -0
  345. package/templates/_shared/LICENSES/TEMPLATE.txt +21 -0
  346. package/templates/_shared/notice-overrides/index.json +14 -0
  347. package/templates/_shared/notice-overrides/utils-0.4.2-LICENSE +21 -0
  348. package/templates/_shared/notice-overrides/utils-0.5.0-LICENSE +21 -0
  349. package/templates/_shared/third-party-notices.mjs +51 -0
  350. package/templates/binary/synology-app.yaml +7 -0
  351. package/templates/hello-files/compose.yaml +0 -1
  352. package/templates/hello-web/compose.yaml +13 -10
  353. package/templates/hello-web/html/app.js +1 -23
  354. package/templates/hello-web/html/index.html +1 -3
  355. package/templates/hello-web-page/compose.yaml +13 -10
  356. package/templates/hello-web-page/html/app.js +1 -23
  357. package/templates/hello-web-page/html/index.html +1 -3
  358. package/templates/native-go/README.md +324 -0
  359. package/templates/native-go/backend/THIRD_PARTY_NOTICES.txt +59 -0
  360. package/templates/native-go/backend/cmd/app/main.go +49 -0
  361. package/templates/native-go/backend/cmd/dsm-readonly-probe/main_linux.go +46 -0
  362. package/templates/native-go/backend/cmd/helper/main.go +38 -0
  363. package/templates/native-go/backend/go.mod +7 -0
  364. package/templates/native-go/backend/go.sum +4 -0
  365. package/templates/native-go/backend/internal/api/binary.go +154 -0
  366. package/templates/native-go/backend/internal/api/binary_test.go +165 -0
  367. package/templates/native-go/backend/internal/api/errors.go +33 -0
  368. package/templates/native-go/backend/internal/api/registry.go +104 -0
  369. package/templates/native-go/backend/internal/api/registry_test.go +329 -0
  370. package/templates/native-go/backend/internal/api/server.go +159 -0
  371. package/templates/native-go/backend/internal/app/nas_cgi_artifact_test.go +121 -0
  372. package/templates/native-go/backend/internal/app/nas_refusal_test.go +46 -0
  373. package/templates/native-go/backend/internal/app/root_none.go +9 -0
  374. package/templates/native-go/backend/internal/app/routes.go +138 -0
  375. package/templates/native-go/backend/internal/app/routes_test.go +172 -0
  376. package/templates/native-go/backend/internal/dsm/auth.go +118 -0
  377. package/templates/native-go/backend/internal/dsm/auth_test.go +139 -0
  378. package/templates/native-go/backend/internal/dsmprobe/collector_linux.go +335 -0
  379. package/templates/native-go/backend/internal/dsmprobe/collector_linux_test.go +41 -0
  380. package/templates/native-go/backend/internal/dsmprobe/protocol.go +179 -0
  381. package/templates/native-go/backend/internal/dsmprobe/protocol_test.go +29 -0
  382. package/templates/native-go/backend/internal/helper/cohort.go +393 -0
  383. package/templates/native-go/backend/internal/helper/cohort_publication.go +18 -0
  384. package/templates/native-go/backend/internal/helper/cohort_publication_test.go +105 -0
  385. package/templates/native-go/backend/internal/helper/cohort_test.go +372 -0
  386. package/templates/native-go/backend/internal/helper/control.go +424 -0
  387. package/templates/native-go/backend/internal/helper/control_test.go +250 -0
  388. package/templates/native-go/backend/internal/helper/data_contract.go +242 -0
  389. package/templates/native-go/backend/internal/helper/data_contract_test.go +51 -0
  390. package/templates/native-go/backend/internal/helper/data_decode.go +184 -0
  391. package/templates/native-go/backend/internal/helper/data_decode_pointer_test.go +30 -0
  392. package/templates/native-go/backend/internal/helper/data_protocol.go +416 -0
  393. package/templates/native-go/backend/internal/helper/data_protocol_test.go +449 -0
  394. package/templates/native-go/backend/internal/helper/dsm_acl_linux.go +139 -0
  395. package/templates/native-go/backend/internal/helper/dsm_acl_linux_test.go +121 -0
  396. package/templates/native-go/backend/internal/helper/dsm_acl_syscall_linux.go +95 -0
  397. package/templates/native-go/backend/internal/helper/dsm_acl_syscall_linux_test.go +56 -0
  398. package/templates/native-go/backend/internal/helper/dsm_bridge_linux.go +144 -0
  399. package/templates/native-go/backend/internal/helper/dsm_bridge_linux_test.go +89 -0
  400. package/templates/native-go/backend/internal/helper/dsm_home_linux.go +107 -0
  401. package/templates/native-go/backend/internal/helper/dsm_home_linux_test.go +82 -0
  402. package/templates/native-go/backend/internal/helper/dsm_probe_transport_linux.go +151 -0
  403. package/templates/native-go/backend/internal/helper/dsm_probe_transport_linux_test.go +66 -0
  404. package/templates/native-go/backend/internal/helper/grant_authority.go +516 -0
  405. package/templates/native-go/backend/internal/helper/grant_authority_contract.go +88 -0
  406. package/templates/native-go/backend/internal/helper/grant_authority_test.go +510 -0
  407. package/templates/native-go/backend/internal/helper/grant_cohort.go +389 -0
  408. package/templates/native-go/backend/internal/helper/grant_cohort_test.go +239 -0
  409. package/templates/native-go/backend/internal/helper/grant_delivery.go +49 -0
  410. package/templates/native-go/backend/internal/helper/grant_delivery_methods.go +273 -0
  411. package/templates/native-go/backend/internal/helper/grant_delivery_test.go +322 -0
  412. package/templates/native-go/backend/internal/helper/grant_operation_contract.go +47 -0
  413. package/templates/native-go/backend/internal/helper/grant_readonly_test.go +180 -0
  414. package/templates/native-go/backend/internal/helper/grant_repository_linux.go +415 -0
  415. package/templates/native-go/backend/internal/helper/grant_repository_linux_test.go +468 -0
  416. package/templates/native-go/backend/internal/helper/grant_rpc.go +147 -0
  417. package/templates/native-go/backend/internal/helper/grant_rpc_test.go +51 -0
  418. package/templates/native-go/backend/internal/helper/grant_snapshot.go +75 -0
  419. package/templates/native-go/backend/internal/helper/grant_supervisor_linux.go +134 -0
  420. package/templates/native-go/backend/internal/helper/grant_supervisor_linux_test.go +254 -0
  421. package/templates/native-go/backend/internal/helper/lease.go +112 -0
  422. package/templates/native-go/backend/internal/helper/lease_linux.go +44 -0
  423. package/templates/native-go/backend/internal/helper/lease_other.go +8 -0
  424. package/templates/native-go/backend/internal/helper/lifecycle.go +234 -0
  425. package/templates/native-go/backend/internal/helper/lifecycle_test.go +473 -0
  426. package/templates/native-go/backend/internal/helper/managed_pilot.go +284 -0
  427. package/templates/native-go/backend/internal/helper/managed_pilot_repository_linux.go +74 -0
  428. package/templates/native-go/backend/internal/helper/managed_pilot_repository_linux_test.go +40 -0
  429. package/templates/native-go/backend/internal/helper/managed_pilot_test.go +210 -0
  430. package/templates/native-go/backend/internal/helper/nas_shipped_refusal_linux_test.go +97 -0
  431. package/templates/native-go/backend/internal/helper/native_discovery.go +79 -0
  432. package/templates/native-go/backend/internal/helper/native_identity.go +89 -0
  433. package/templates/native-go/backend/internal/helper/native_provider.go +159 -0
  434. package/templates/native-go/backend/internal/helper/native_provider_test.go +421 -0
  435. package/templates/native-go/backend/internal/helper/observation.go +204 -0
  436. package/templates/native-go/backend/internal/helper/observation_health_test.go +115 -0
  437. package/templates/native-go/backend/internal/helper/observation_reload_budget_test.go +117 -0
  438. package/templates/native-go/backend/internal/helper/observation_test.go +196 -0
  439. package/templates/native-go/backend/internal/helper/observer_diagnostic.go +109 -0
  440. package/templates/native-go/backend/internal/helper/observer_diagnostic_linux.go +76 -0
  441. package/templates/native-go/backend/internal/helper/observer_diagnostic_linux_test.go +124 -0
  442. package/templates/native-go/backend/internal/helper/observer_diagnostic_test.go +98 -0
  443. package/templates/native-go/backend/internal/helper/operation_bootstrap_linux.go +193 -0
  444. package/templates/native-go/backend/internal/helper/operation_credentials_linux.go +56 -0
  445. package/templates/native-go/backend/internal/helper/operation_linux.go +480 -0
  446. package/templates/native-go/backend/internal/helper/operation_linux_test.go +528 -0
  447. package/templates/native-go/backend/internal/helper/peer_linux.go +44 -0
  448. package/templates/native-go/backend/internal/helper/peer_other.go +7 -0
  449. package/templates/native-go/backend/internal/helper/process_linux.go +177 -0
  450. package/templates/native-go/backend/internal/helper/process_other.go +5 -0
  451. package/templates/native-go/backend/internal/helper/publication_test.go +178 -0
  452. package/templates/native-go/backend/internal/helper/read_stream_cohort_linux_test.go +156 -0
  453. package/templates/native-go/backend/internal/helper/read_transfer.go +40 -0
  454. package/templates/native-go/backend/internal/helper/read_transfer_linux.go +109 -0
  455. package/templates/native-go/backend/internal/helper/read_transfer_linux_test.go +118 -0
  456. package/templates/native-go/backend/internal/helper/read_transfer_test.go +177 -0
  457. package/templates/native-go/backend/internal/helper/readonly.go +105 -0
  458. package/templates/native-go/backend/internal/helper/readonly_admission.go +85 -0
  459. package/templates/native-go/backend/internal/helper/readonly_cohort_linux_test.go +253 -0
  460. package/templates/native-go/backend/internal/helper/readonly_linux_test.go +378 -0
  461. package/templates/native-go/backend/internal/helper/readonly_mount_linux.go +65 -0
  462. package/templates/native-go/backend/internal/helper/readonly_mount_proxy_linux.go +113 -0
  463. package/templates/native-go/backend/internal/helper/readonly_operations_linux.go +168 -0
  464. package/templates/native-go/backend/internal/helper/readonly_resolver_linux.go +241 -0
  465. package/templates/native-go/backend/internal/helper/readonly_test.go +40 -0
  466. package/templates/native-go/backend/internal/helper/relaxed_identity.go +252 -0
  467. package/templates/native-go/backend/internal/helper/relaxed_identity_contract.go +105 -0
  468. package/templates/native-go/backend/internal/helper/relaxed_identity_test.go +406 -0
  469. package/templates/native-go/backend/internal/helper/relaxed_invalidation.go +200 -0
  470. package/templates/native-go/backend/internal/helper/repair.go +132 -0
  471. package/templates/native-go/backend/internal/helper/repair_test.go +271 -0
  472. package/templates/native-go/backend/internal/helper/s1r_actor_acl_linux_test.go +303 -0
  473. package/templates/native-go/backend/internal/helper/s1r_actor_fixture_linux_test.go +184 -0
  474. package/templates/native-go/backend/internal/helper/s1r_actor_races_linux_test.go +231 -0
  475. package/templates/native-go/backend/internal/helper/s1r_fixture_contract_linux_test.go +18 -0
  476. package/templates/native-go/backend/internal/helper/server_linux.go +124 -0
  477. package/templates/native-go/backend/internal/helper/status.go +334 -0
  478. package/templates/native-go/backend/internal/helper/status_test.go +288 -0
  479. package/templates/native-go/backend/internal/helper/supervision.go +107 -0
  480. package/templates/native-go/backend/internal/helper/supervision_test.go +124 -0
  481. package/templates/native-go/backend/internal/helper/supervisor_frame.go +76 -0
  482. package/templates/native-go/backend/internal/helper/supervisor_frame_linux_test.go +69 -0
  483. package/templates/native-go/backend/internal/helper/supervisor_frame_test.go +107 -0
  484. package/templates/native-go/backend/internal/helper/supervisor_linux.go +363 -0
  485. package/templates/native-go/backend/internal/helper/supervisor_linux_test.go +913 -0
  486. package/templates/native-go/backend/internal/helper/supervisor_socket_eof_test.go +74 -0
  487. package/templates/native-go/backend/internal/helper/supervisor_socket_test.go +45 -0
  488. package/templates/native-go/backend/internal/helper/testdata/protocol2/create.json +23 -0
  489. package/templates/native-go/backend/internal/helper/testdata/protocol2/frames.json +67 -0
  490. package/templates/native-go/backend/internal/helper/testdata/protocol2/grant-store.json +52 -0
  491. package/templates/native-go/backend/internal/helper/testdata/protocol2/intent.json +20 -0
  492. package/templates/native-go/backend/internal/helper/testdata/protocol2/list.json +20 -0
  493. package/templates/native-go/backend/internal/helper/testdata/protocol2/publish.json +20 -0
  494. package/templates/native-go/backend/internal/helper/testdata/protocol2/read.json +22 -0
  495. package/templates/native-go/backend/internal/helper/testdata/protocol2/stat.json +22 -0
  496. package/templates/native-go/backend/internal/helper/testdata/protocol2/write-stream.json +22 -0
  497. package/templates/native-go/backend/internal/helper/unit_connection.go +75 -0
  498. package/templates/native-go/backend/internal/helper/unit_connection_linux_test.go +135 -0
  499. package/templates/native-go/backend/internal/helper/unit_connection_test.go +133 -0
  500. package/templates/native-go/backend/internal/helper/unit_frame_test.go +32 -0
  501. package/templates/native-go/backend/internal/helper/unit_linux.go +364 -0
  502. package/templates/native-go/backend/internal/helper/unit_linux_test.go +46 -0
  503. package/templates/native-go/backend/internal/helper/unit_mechanisms_linux_test.go +217 -0
  504. package/templates/native-go/backend/internal/helper/unit_padding_linux_test.go +178 -0
  505. package/templates/native-go/backend/internal/helper/unit_query_linux.go +111 -0
  506. package/templates/native-go/backend/internal/helper/unit_reload_linux_test.go +372 -0
  507. package/templates/native-go/backend/internal/helper/unit_reload_sequence_linux_test.go +232 -0
  508. package/templates/native-go/backend/internal/helper/write.go +77 -0
  509. package/templates/native-go/backend/internal/helper/write_admission.go +260 -0
  510. package/templates/native-go/backend/internal/helper/write_admission_test.go +135 -0
  511. package/templates/native-go/backend/internal/helper/write_cohort_linux_test.go +218 -0
  512. package/templates/native-go/backend/internal/helper/write_files_linux.go +202 -0
  513. package/templates/native-go/backend/internal/helper/write_files_linux_test.go +199 -0
  514. package/templates/native-go/backend/internal/helper/write_intent_linux.go +116 -0
  515. package/templates/native-go/backend/internal/helper/write_intent_linux_test.go +74 -0
  516. package/templates/native-go/backend/internal/helper/write_operation_linux.go +245 -0
  517. package/templates/native-go/backend/internal/helper/write_test.go +53 -0
  518. package/templates/native-go/dsm-package.yaml +58 -0
  519. package/templates/native-go/gitignore +1 -0
  520. package/templates/native-go/i18n/glossary.json +662 -0
  521. package/templates/native-go/i18n/messages/de.json +28 -0
  522. package/templates/native-go/i18n/messages/en.json +28 -0
  523. package/templates/native-go/i18n/messages/es.json +28 -0
  524. package/templates/native-go/i18n/messages/fr.json +28 -0
  525. package/templates/native-go/i18n/messages/it.json +28 -0
  526. package/templates/native-go/i18n/messages/ja.json +28 -0
  527. package/templates/native-go/i18n/messages/ko.json +28 -0
  528. package/templates/native-go/i18n/messages/zh-CN.json +28 -0
  529. package/templates/native-go/i18n/messages/zh-TW.json +28 -0
  530. package/templates/native-go/ui/app.css +35 -0
  531. package/templates/native-go/ui/app.js +101 -0
  532. package/templates/native-go-better-auth/backend/internal/app/identity.go +208 -0
  533. package/templates/native-go-better-auth/backend/internal/app/identity_test.go +113 -0
  534. package/templates/native-go-better-auth/node/app.mjs +72 -0
  535. package/templates/native-go-better-auth/node/build.mjs +4 -0
  536. package/templates/native-go-better-auth/node/package-lock.json +862 -0
  537. package/templates/native-go-better-auth/node/package.json +1 -0
  538. package/templates/native-go-better-auth/node/test/auth.test.mjs +31 -0
  539. package/templates/native-go-integration/backend/internal/app/identity_none.go +6 -0
  540. package/templates/native-go-integration/backend/internal/app/personal.go +203 -0
  541. package/templates/native-go-integration/backend/internal/app/personal_test.go +119 -0
  542. package/templates/native-go-root/backend/internal/app/root.go +107 -0
  543. package/templates/native-go-root/backend/internal/app/root_test.go +124 -0
  544. package/templates/native-go-root/root/whoami.sh +6 -0
  545. package/templates/native-go-vue/README.md +224 -0
  546. package/templates/native-go-vue/frontend/DESIGN.md +78 -0
  547. package/templates/native-go-vue/frontend/package-lock.json +2410 -0
  548. package/templates/native-go-vue/frontend/package.json +6 -0
  549. package/templates/native-go-vue/frontend/src/App.vue +159 -0
  550. package/templates/native-go-vue/frontend/src/context.ts +56 -0
  551. package/templates/native-go-vue/frontend/src/main.ts +29 -0
  552. package/templates/native-go-vue/frontend/src/nas/NasGrantSettings.vue +74 -0
  553. package/templates/native-go-vue/frontend/src/nas/NasPathPicker.vue +106 -0
  554. package/templates/native-go-vue/frontend/src/nas/NasUnavailable.vue +20 -0
  555. package/templates/native-go-vue/frontend/src/nas/i18n/de.json +74 -0
  556. package/templates/native-go-vue/frontend/src/nas/i18n/en.json +74 -0
  557. package/templates/native-go-vue/frontend/src/nas/i18n/es.json +74 -0
  558. package/templates/native-go-vue/frontend/src/nas/i18n/fr.json +74 -0
  559. package/templates/native-go-vue/frontend/src/nas/i18n/it.json +74 -0
  560. package/templates/native-go-vue/frontend/src/nas/i18n/ja.json +74 -0
  561. package/templates/native-go-vue/frontend/src/nas/i18n/ko.json +74 -0
  562. package/templates/native-go-vue/frontend/src/nas/i18n/zh-CN.json +74 -0
  563. package/templates/native-go-vue/frontend/src/nas/i18n/zh-TW.json +74 -0
  564. package/templates/native-go-vue/frontend/src/nas/i18n.ts +38 -0
  565. package/templates/native-go-vue/frontend/src/nas/mock-provider.ts +119 -0
  566. package/templates/native-go-vue/frontend/src/nas/provider.ts +59 -0
  567. package/templates/native-go-vue/frontend/src/nas/use-request.ts +27 -0
  568. package/templates/native-go-vue/frontend/src/style.css +31 -0
  569. package/templates/native-go-vue/frontend/test/apps.test.ts +190 -0
  570. package/templates/native-go-vue/frontend/test/nas-provider.test.ts +81 -0
  571. package/templates/native-go-vue/frontend/test/nas-request.test.ts +21 -0
  572. package/templates/native-go-vue/frontend/test/nas-ui.test.ts +261 -0
  573. package/templates/native-go-vue/frontend/tsconfig.json +1 -0
  574. package/templates/native-go-vue/frontend/vite.config.ts +10 -0
  575. package/templates/native-go-vue/gitignore +2 -0
  576. package/dist/attestation/app-package.d.ts +0 -86
  577. package/dist/attestation/app-package.js +0 -206
  578. package/dist/attestation/install-on-host.d.ts +0 -14
  579. package/dist/attestation/install-on-host.js +0 -52
  580. package/dist/attestation/keyring.d.ts +0 -21
  581. package/dist/attestation/keyring.js +0 -168
  582. package/dist/attestation/platform-service.d.ts +0 -70
  583. package/dist/attestation/platform-service.js +0 -250
  584. package/dist/build-spk/broker-glue.d.ts +0 -16
  585. package/dist/build-spk/broker-glue.js +0 -40
  586. package/dist/deploy/catalog-publish.d.ts +0 -3
  587. package/dist/deploy/catalog-publish.js +0 -7
  588. package/dist/doctor.d.ts +0 -22
  589. package/dist/doctor.js +0 -822
  590. package/dist/error-collector.d.ts +0 -2
  591. package/dist/error-collector.js +0 -46
  592. package/dist/host/broker-paths.d.ts +0 -1
  593. package/dist/host/broker-paths.js +0 -1
  594. package/dist/host/broker-upgrade-preflight.d.ts +0 -61
  595. package/dist/host/broker-upgrade-preflight.js +0 -156
  596. package/dist/host/digests.d.ts +0 -5
  597. package/dist/host/digests.js +0 -63
  598. package/dist/host/fake-nas.d.ts +0 -49
  599. package/dist/host/fake-nas.js +0 -193
  600. package/dist/mock-broker/bootstrap.d.ts +0 -2
  601. package/dist/mock-broker/bootstrap.js +0 -8
  602. package/dist/mock-broker/files.d.ts +0 -60
  603. package/dist/mock-broker/files.js +0 -408
  604. package/dist/mock-broker/oidc.d.ts +0 -31
  605. package/dist/mock-broker/oidc.js +0 -161
  606. package/dist/mock-broker/path.d.ts +0 -9
  607. package/dist/mock-broker/path.js +0 -50
  608. package/dist/mock-broker/server.d.ts +0 -19
  609. package/dist/mock-broker/server.js +0 -350
  610. package/dist/publish/build-ledger.d.ts +0 -22
  611. package/dist/publish/build-ledger.js +0 -26
  612. package/dist/publish/community-path.d.ts +0 -6
  613. package/dist/publish/community-path.js +0 -41
  614. package/dist/publish/curated-release.d.ts +0 -78
  615. package/dist/publish/curated-release.js +0 -883
  616. package/dist/publish/file-build-ledger.d.ts +0 -18
  617. package/dist/publish/file-build-ledger.js +0 -268
  618. package/dist/publish/github-pr.d.ts +0 -25
  619. package/dist/publish/github-pr.js +0 -85
  620. package/dist/publish/github-repo.d.ts +0 -8
  621. package/dist/publish/github-repo.js +0 -21
  622. package/dist/publish/platform-service-release.d.ts +0 -60
  623. package/dist/publish/platform-service-release.js +0 -333
  624. package/dist/publish/preflight.d.ts +0 -24
  625. package/dist/publish/preflight.js +0 -138
  626. package/dist/publish/publish.d.ts +0 -27
  627. package/dist/publish/publish.js +0 -136
  628. package/dist/publish/sync-definition.d.ts +0 -4
  629. package/dist/publish/sync-definition.js +0 -48
  630. package/dist/release-bin.d.ts +0 -2
  631. package/dist/release-bin.js +0 -23
  632. package/dist/templates/hello-web/html/sdk.js +0 -68
  633. package/dist/templates/hello-web-page/html/sdk.js +0 -68
  634. package/dist/templates/native/synology-app.yaml +0 -7
  635. package/dist/test-host.d.ts +0 -15
  636. package/dist/test-host.js +0 -37
  637. package/templates/hello-web/html/sdk.js +0 -68
  638. package/templates/hello-web-page/html/sdk.js +0 -68
  639. package/templates/native/synology-app.yaml +0 -7
  640. /package/dist/templates/{native → binary}/native.yaml +0 -0
  641. /package/templates/{native → binary}/native.yaml +0 -0
@@ -180,7 +180,7 @@ function hasBuildStanza(compose) {
180
180
  }
181
181
  return Object.values(compose.services).some((service) => "build" in service && service.build !== undefined);
182
182
  }
183
- const HEADLESS_BROKER_FALLBACK_REASONS = new Set([
183
+ const HEADLESS_UNSUPPORTED_REASONS = new Set([
184
184
  "HAS_COMPOSE_SECRETS_OR_CONFIGS",
185
185
  "HAS_BUILD_STANZA",
186
186
  "HAS_PRIVILEGED_CAPABILITY",
@@ -204,7 +204,7 @@ export function classifyComposeRoute(contract, parsed, composeFile = "compose.ya
204
204
  const hasHeadlessUnsupportedParameter = collectInstallParameters(contract).some(({ param }) => !HEADLESS_PACKAGE_ONLY_PARAMETER_TYPES.has(String(param.type)));
205
205
  const headlessPackageOnly = eligibility.headless &&
206
206
  !hasHeadlessUnsupportedParameter &&
207
- !eligibility.reasons.some((reason) => HEADLESS_BROKER_FALLBACK_REASONS.has(reason));
207
+ !eligibility.reasons.some((reason) => HEADLESS_UNSUPPORTED_REASONS.has(reason));
208
208
  const localRoute = contract.adminport !== undefined || headlessPackageOnly;
209
209
  const rejectErrors = localRoute
210
210
  ? collectRouteRejectErrors(contract, parsed, composeFile)
@@ -225,27 +225,11 @@ export function classifyComposeRoute(contract, parsed, composeFile = "compose.ya
225
225
  if (eligibility.eligible) {
226
226
  return { route: "static-zero-config", eligibility, errors: [] };
227
227
  }
228
- // Keep the route decision in one place. build-spk must not independently
229
- // reinterpret an ineligible Compose as D1: only a route with a resolved
230
- // published adminport or an eligible headless Compose, plus at least one
231
- // declared install parameter (or oidc_compat declaration), has a package-only materializer.
232
- // Every other buildable fallback is Broker.
233
228
  if ((eligibility.adminport !== undefined || headlessPackageOnly) &&
234
- (collectInstallParameters(contract).length > 0 || hasBrokerManagedOidc(contract))) {
229
+ (collectInstallParameters(contract).length > 0 || hasInterpolation(parsed.compose))) {
235
230
  return { route: "dynamic", eligibility, errors: [] };
236
231
  }
237
- return { route: "broker-installer", eligibility, errors: [] };
238
- }
239
- export function brokerInstallerRouteWarning(compose, composeFile = "compose.yaml") {
240
- const path = findDynamicComposePath(compose) ?? "services";
241
- return makeError("CURATED_BROKER_ROUTE_FORBIDDEN", composeSpanForPath(compose, composeFile, path), "此 Compose 會落到 Broker installer 路線;rootless Broker 不支援 Container Manager,無法作為 Curated production runtime。", "請改成零設定 resource-worker:使用 ./html bind 與預先 build 的 image;將 ${SYNOPKG_PKGVAR} 等平台 bind 改成 named volume,或改用 D1 dynamic route 的 string/boolean install 參數。", "warning");
242
- }
243
- function hasImmutableServiceImages(compose) {
244
- const services = compose.services;
245
- if (!services || Object.keys(services).length === 0) {
246
- return false;
247
- }
248
- return Object.values(services).every((service) => typeof service.image === "string" && /@sha256:[a-f0-9]{64}$/.test(service.image.trim()));
232
+ return { route: "reject", eligibility, errors: [makeError("COMPOSE_ROUTE_UNSUPPORTED", composeSpanForPath(parsed.compose, composeFile, "services"), `DSM resource worker cannot manage this Compose: ${eligibility.reasons.join(", ")}`, "Use prebuilt images, supported install parameters and DSM docker-project resources.")] };
249
233
  }
250
234
  function collectRouteRejectErrors(contract, parsed, composeFile) {
251
235
  const { compose } = parsed;
@@ -318,14 +302,10 @@ function collectDynamicRouteError(contract, parsed, composeFile) {
318
302
  param.type !== "shared_folder" &&
319
303
  param.type !== "dsm_user" &&
320
304
  param.type !== "posix_all_shares"));
321
- const brokerOidcInterpolationNames = hasBrokerManagedOidc(contract)
322
- ? BROKER_OIDC_INTERPOLATION_VARS
323
- : [];
324
305
  const supportedInterpolationNames = new Set([
325
306
  ...supportedParamNames,
326
307
  ...dsmUserDerivedNames,
327
308
  ...PLATFORM_BIND_VARS,
328
- ...brokerOidcInterpolationNames,
329
309
  ]);
330
310
  const interpolations = collectComposeInterpolations(compose);
331
311
  const hasComposeInterpolation = hasInterpolation(compose);
@@ -364,7 +344,7 @@ function collectDynamicRouteError(contract, parsed, composeFile) {
364
344
  : "請只使用 ${NAME} 形式,並在 synology-app.yaml 的 install 宣告對應的 string 或 boolean parameter。";
365
345
  return makeError("COMPOSE_DYNAMIC_ROUTE_UNSUPPORTED", composeSpanForPath(compose, composeFile, path), "Compose dynamic route 含有不在 D1/D2 白名單內的輸入(" +
366
346
  reasonText +
367
- ");這條 route 會拒收,不會靜默落回 Broker fallback。", undeclaredName
347
+ ");這條 route 會拒收,不會靜默改用其他執行方式。", undeclaredName
368
348
  ? interpolationSuggestion
369
349
  : `${interpolationSuggestion} secret/config 因 DSM worker 不讀 docker-compose.override.yml 而拒收,請移除後重新執行 validate。`);
370
350
  }
@@ -504,9 +484,6 @@ export function validateComposeSecurity(compose, composeFile, options) {
504
484
  ? route.errors.filter((error) => !HOST_BIND_ERROR_CODES.has(error.code))
505
485
  : [];
506
486
  errors.push(...routeErrors);
507
- if (route?.route === "broker-installer" && hasImmutableServiceImages(compose)) {
508
- errors.push(brokerInstallerRouteWarning(compose, composeFile));
509
- }
510
487
  const routeErrorKeys = new Set(routeErrors.map(validationErrorKey));
511
488
  if (!compose.services) {
512
489
  return errors;
@@ -613,26 +590,6 @@ function isForbiddenSocketMount(source) {
613
590
  * ${NAME} must be declared in contract.install as string or boolean.
614
591
  */
615
592
  const PLATFORM_BIND_VARS = new Set(["SYNOPKG_PKGVAR", "SYNO_APP_SECRETS_DIR"]);
616
- /**
617
- * Broker-managed OIDC compatibility injects these two names at install time.
618
- * They are allowed only for an explicitly declared oidc_compat legacy route;
619
- * the D1 package-only materializer does not write them.
620
- */
621
- const BROKER_OIDC_INTERPOLATION_VARS = new Set([
622
- "SYNOPKGLAND_OIDC_ISSUER",
623
- "SYNOPKGLAND_OIDC_CLIENT_ID",
624
- "SYNOPKGLAND_OIDC_ISSUER_HOST",
625
- ]);
626
- function hasBrokerManagedOidc(contract) {
627
- if (!contract.integration || typeof contract.integration !== "object") {
628
- return false;
629
- }
630
- const identity = contract.integration.identity;
631
- if (!identity || typeof identity !== "object") {
632
- return false;
633
- }
634
- return Boolean(identity.oidc_compat);
635
- }
636
593
  const INTERPOLATED_SOURCE = /^\$\{([A-Z0-9_]+)\}(.*)$/;
637
594
  const VALID_SUFFIX_SEGMENT = /^[A-Za-z0-9._-]+$/;
638
595
  function collectNamedVolumeNames(compose) {
@@ -0,0 +1,10 @@
1
+ import type { AppContract } from "../types.js";
2
+ /** Stable gate code for an install type that only the CLI can materialize. */
3
+ export declare const POSIX_ALL_SHARES_LISTING_UNSUPPORTED_CODE: "CONTRACT_POSIX_ALL_SHARES_LISTING_UNSUPPORTED";
4
+ export interface UnsupportedInstallType {
5
+ name: string;
6
+ type: string;
7
+ code: string;
8
+ }
9
+ export declare function findUnsupportedInstallTypes(contract: AppContract): UnsupportedInstallType[];
10
+ export declare function findListingUnsupportedInstallTypes(contract: AppContract): UnsupportedInstallType[];
@@ -0,0 +1,49 @@
1
+ import { collectInstallParameters } from "./load.js";
2
+ /**
3
+ * Install parameter types that the schema still accepts but that have no working
4
+ * install path on the live package-only route.
5
+ *
6
+ * Measured on vt-nas 2026-08-27: both end in DSM broken/150 with no Container
7
+ * Manager project, while a no-parameter control package installed fine on the
8
+ * same NAS. `secret` renders its password field and fails; `homes` renders no
9
+ * input at all. `validate` reports these as warnings so build-spk keeps working
10
+ * for fixtures that declare them incidentally -- the refusal belongs at the two
11
+ * gates that actually put an App somewhere: deploy and publish.
12
+ */
13
+ const UNSUPPORTED_INSTALL_TYPES = new Map([
14
+ ["secret", "CONTRACT_SECRET_UNSUPPORTED"],
15
+ ["homes", "CONTRACT_HOMES_UNSUPPORTED"],
16
+ ]);
17
+ /** Stable gate code for an install type that only the CLI can materialize. */
18
+ export const POSIX_ALL_SHARES_LISTING_UNSUPPORTED_CODE = "CONTRACT_POSIX_ALL_SHARES_LISTING_UNSUPPORTED";
19
+ /**
20
+ * Install parameter types that work through `synopkgland deploy` but cannot
21
+ * honor their declared Share scope through Package Center or a curated
22
+ * listing. Keep this separate from UNSUPPORTED_INSTALL_TYPES: deploy must
23
+ * continue to resolve these values from the NAS administrator session.
24
+ */
25
+ const LISTING_UNSUPPORTED_INSTALL_TYPES = new Map([
26
+ ["posix_all_shares", POSIX_ALL_SHARES_LISTING_UNSUPPORTED_CODE],
27
+ ]);
28
+ export function findUnsupportedInstallTypes(contract) {
29
+ const found = [];
30
+ for (const { name, param } of collectInstallParameters(contract)) {
31
+ const type = typeof param.type === "string" ? param.type : "";
32
+ const code = UNSUPPORTED_INSTALL_TYPES.get(type);
33
+ if (code) {
34
+ found.push({ name, type, code });
35
+ }
36
+ }
37
+ return found;
38
+ }
39
+ export function findListingUnsupportedInstallTypes(contract) {
40
+ const found = [];
41
+ for (const { name, param } of collectInstallParameters(contract)) {
42
+ const type = typeof param.type === "string" ? param.type : "";
43
+ const code = LISTING_UNSUPPORTED_INSTALL_TYPES.get(type);
44
+ if (code) {
45
+ found.push({ name, type, code });
46
+ }
47
+ }
48
+ return found;
49
+ }
@@ -6,6 +6,7 @@ import { validateContractSchema } from "./schema-validate.js";
6
6
  import { isWebLaunchMode, readWebIntegration } from "./web-launch.js";
7
7
  import { loadCompose } from "../compose/analyze.js";
8
8
  import { collectPosixAllSharesParameters, isPosixAllSharesType, validatePosixAllSharesSources, } from "./posix-all-shares.js";
9
+ import { getErrorCode } from "../error-registry.js";
9
10
  import { FORMAL_PACKAGE_IDENTITY_MAX_LENGTH, PACKAGE_IDENTITY_MAX_LENGTH, } from "../deploy/identity-shared.js";
10
11
  /** DSM 7.4 Package Center rejects a longer package identity outright. */
11
12
  const DSM_PACKAGE_IDENTITY_MAX = 32;
@@ -113,6 +114,28 @@ function validateInstallParameters(parsed, contractFile) {
113
114
  errors.push(makeError("INSTALL_STRING_INVALID", contractSpan(contractFile, pos.line, pos.column, `${basePath}.default`), `Install Parameter「${name}」的字串值不合法。`, "請移除控制字元與 ${ 插值語法。"));
114
115
  }
115
116
  }
117
+ // A45/A46: both types are in the schema enum but neither has a working
118
+ // install path on the live package-only route -- measured on vt-nas as DSM
119
+ // broken/150 with no Container Manager project, against a no-parameter
120
+ // control that installed fine. Refusing here is what makes the failure
121
+ // honest: `homes` used to validate, build a valid SPK, and only break at
122
+ // install time, telling the author nothing.
123
+ if (type === "secret" || type === "homes") {
124
+ const pos = getValuePosition(doc, ["install", name, "type"]) ??
125
+ getValuePosition(doc, ["install", name]) ??
126
+ { line: 1, column: 1 };
127
+ const code = type === "secret" ? "CONTRACT_SECRET_UNSUPPORTED" : "CONTRACT_HOMES_UNSUPPORTED";
128
+ const entry = getErrorCode(code);
129
+ // A warning here, a hard refusal in deploy/publish. Making validate itself
130
+ // fail would also fail build-spk, and several existing fixtures declare
131
+ // these types only incidentally while testing wizard copy, permissions and
132
+ // script generation -- turning those red would cost real coverage for no
133
+ // extra safety. Nothing unshippable can reach a NAS or the community repo,
134
+ // because both gates refuse; the author still learns at validate time.
135
+ errors.push(makeError(code, contractSpan(contractFile, pos.line, pos.column, `${basePath}.type`), `Install Parameter「${name}」的 type: ${type} 目前沒有可用的安裝路徑,經 Package Center 安裝會以 DSM broken/150 結束;deploy 與 publish 會拒絕。`, entry?.suggestion ?? "請改用其他 install parameter type。", "warning"));
136
+ // Deliberately no `continue`: the type-specific checks below still apply.
137
+ // Skipping them once silently dropped CONTRACT_HOMES_PATH_FORBIDDEN.
138
+ }
116
139
  if (type === "homes") {
117
140
  const configuredPath = Object.entries(param).find(([key, value]) => key !== "type" &&
118
141
  (key === "default" || (typeof value === "string" && isPhysicalHostPath(value))));
@@ -123,7 +146,7 @@ function validateInstallParameters(parsed, contractFile) {
123
146
  const pos = getValuePosition(doc, ["install", name, field]) ??
124
147
  getValuePosition(doc, ["install", name]) ??
125
148
  { line: 1, column: 1 };
126
- errors.push(makeError("CONTRACT_HOMES_PATH_FORBIDDEN", contractSpan(contractFile, pos.line, pos.column, `${basePath}.${field}`), `homes Install Parameter「${name}」不得在契約欄位「${field}」指定 NAS 實體路徑或預設值。`, `請保留 install.${name}.type: homes,Compose 只引用 \${${name}};由 glue/Broker 在安裝時依這台 NAS 的 User Home 設定解析路徑。`));
149
+ errors.push(makeError("CONTRACT_HOMES_PATH_FORBIDDEN", contractSpan(contractFile, pos.line, pos.column, `${basePath}.${field}`), `homes Install Parameter「${name}」不得在契約欄位「${field}」指定 NAS 實體路徑或預設值。`, `請保留 install.${name}.type: homes,Compose 只引用 \${${name}};由套件 在安裝時依這台 NAS 的 User Home 設定解析路徑。`));
127
150
  }
128
151
  if (isPosixAllSharesType(type)) {
129
152
  const configuredValue = Object.entries(param).find(([key, value]) => key !== "type" && (key === "default" || value !== undefined));
@@ -132,7 +155,7 @@ function validateInstallParameters(parsed, contractFile) {
132
155
  const pos = getValuePosition(doc, ["install", name, field]) ??
133
156
  getValuePosition(doc, ["install", name]) ??
134
157
  { line: 1, column: 1 };
135
- errors.push(makeError("CONTRACT_POSIX_ALL_SHARES_VALUE_FORBIDDEN", contractSpan(contractFile, pos.line, pos.column, `${basePath}.${field}`), `POSIX all-shares Install Parameter「${name}」不得指定 default 或 NAS 實體路徑;Share 清單只在安裝時由 Broker 透過 DSM API snapshot。`, `請只保留 install.${name}.type: posix_all_shares,Compose 使用 \${${name}} 作為完整 volume source。`));
158
+ errors.push(makeError("CONTRACT_POSIX_ALL_SHARES_VALUE_FORBIDDEN", contractSpan(contractFile, pos.line, pos.column, `${basePath}.${field}`), `POSIX all-shares Install Parameter「${name}」不得指定 default 或 NAS 實體路徑;Share 清單只在安裝時由 CLI 透過 DSM API 取得快照。`, `請只保留 install.${name}.type: posix_all_shares,Compose 使用 \${${name}} 作為完整 volume source。`));
136
159
  }
137
160
  }
138
161
  }
@@ -81,8 +81,6 @@ export function renderWebStationResource(contract) {
81
81
  const alias = webStationAlias(String(contract.package));
82
82
  const launch = resolvedWebLaunch(contract);
83
83
  // DSM synowebapi crashes on type=reverse_proxy. Package acquire of reverse_proxy
84
- // also creates a preserve portal that Broker cannot rebind (error 1300).
85
- // Static + alias matches Broker; cookie strip / proxy_pass live in nginx user.conf.
86
84
  const service = {
87
85
  service: webStationServiceName(alias),
88
86
  display_name: String(contract.displayname ?? contract.package),
@@ -2,16 +2,13 @@ import type { NativeArchFamily } from "../build-spk/dsm-arch.js";
2
2
  import type { ProjectRoot } from "../discovery.js";
3
3
  import type { NasHost } from "../host/types.js";
4
4
  import { resolveDeploySpkVersion } from "./spk-version.js";
5
- import type { PublishSpkResult } from "@synopackageland/package-source/publish-spk";
6
5
  export interface DeployProjectOptions {
7
6
  project: ProjectRoot;
8
7
  /** native App only: which target to build. Omitted means "ask the NAS". */
9
8
  archFamily?: NativeArchFamily;
10
9
  host: NasHost;
11
10
  dev?: boolean;
12
- replaceCurated?: boolean;
13
11
  spkVersionResolver?: typeof resolveDeploySpkVersion;
14
- catalogPublish?: (spkPath: string) => Promise<PublishSpkResult>;
15
12
  shareValues?: Record<string, string>;
16
13
  runAsValues?: Record<string, string>;
17
14
  paramValues?: Record<string, string>;
@@ -23,7 +20,7 @@ export interface DeployProjectResult {
23
20
  packageId?: string;
24
21
  spkPath?: string;
25
22
  openUrl?: string;
26
- catalogVersion?: string;
23
+ version?: string;
27
24
  /** Non-blocking pre-flight remarks, e.g. a read-only Shared Folder grant. */
28
25
  notes?: string[];
29
26
  }
@@ -1,10 +1,9 @@
1
1
  import { buildSpk } from "../build-spk/generator.js";
2
2
  import { existsSync } from "node:fs";
3
3
  import { loadContract } from "../contract/load.js";
4
- import { digestProjectBundle, digestProjectContract } from "../host/digests.js";
4
+ import { findUnsupportedInstallTypes } from "../contract/unsupported-types.js";
5
5
  import { appOriginFromContract } from "../host/open-url.js";
6
6
  import { validateProject } from "../validate.js";
7
- import { publishBuiltSpk, packageSourceOrigin } from "./catalog-publish.js";
8
7
  import { resolveDeployIdentity, PACKAGE_IDENTITY_MAX_LENGTH } from "./identity.js";
9
8
  import { resolveDeploySpkVersion } from "./spk-version.js";
10
9
  import { resolveSharedFolderExtraValues, sharedFolderParameterNames } from "./share-values.js";
@@ -12,45 +11,26 @@ import { resolveDsmUserExtraValues, dsmUserParameterNames } from "./run-as-value
12
11
  import { runSharePermissionPreflight } from "./share-permission-preflight.js";
13
12
  import { homesParameterNames, resolveHomesExtraValues } from "./homes-values.js";
14
13
  import { resolveInstallParameterExtraValues } from "./param-values.js";
15
- import { CURATED_BUILD_OFFSET } from "@synopackageland/package-source/index-manifest";
16
14
  import { loadCompose } from "../compose/analyze.js";
17
15
  import { runPortPreflight } from "./port-preflight.js";
18
- const CURATED_DEPLOY_REFUSED_MESSAGE = "此 NAS 已持有 Curated App Package Attestation。請改用 --dev,或使用 --replace-curated 明確降級。";
19
16
  const POSIX_ALL_SHARES_LOOKUP_FAILED = "DEPLOY_POSIX_ALL_SHARES_LOOKUP_FAILED";
20
- function brokerCapabilitiesFromContract(project) {
21
- const contract = loadContract(project.contractPath).contract;
22
- const capabilities = ["identity"];
23
- const integration = contract.integration;
24
- if (integration?.files) {
25
- capabilities.push("files");
26
- }
27
- return capabilities;
28
- }
29
- function versionBuildIsCurated(version) {
30
- if (!version) {
31
- return false;
32
- }
33
- const match = /-(\d+)$/.exec(version);
34
- if (!match) {
35
- return false;
36
- }
37
- const build = Number(match[1]);
38
- return Number.isSafeInteger(build) && build >= CURATED_BUILD_OFFSET;
39
- }
40
- async function detectCuratedInstall(host, packageId) {
41
- let brokerRecord = false;
42
- try {
43
- brokerRecord = (await host.getAttestationInfo(packageId)).attestationKind === "app-package";
44
- }
45
- catch {
46
- // requestAttestation below remains the authoritative error path when the Broker info probe is unavailable.
47
- }
48
- return {
49
- brokerRecord,
50
- installedVersion: await host.getInstalledPackageVersion?.(packageId),
51
- };
52
- }
53
17
  export async function deployProject(options) {
18
+ const contract = loadContract(options.project.contractPath).contract;
19
+ // A45/A46: refuse before anything is built or uploaded. validate only warns,
20
+ // so this is the gate that keeps an uninstallable App off a NAS.
21
+ const unsupported = findUnsupportedInstallTypes(contract);
22
+ if (unsupported.length > 0) {
23
+ const first = unsupported[0];
24
+ return {
25
+ ok: false,
26
+ code: first.code,
27
+ message: `Install Parameter「${first.name}」的 type: ${first.type} 目前沒有可用的安裝路徑,` +
28
+ "Package Center 安裝會以 DSM broken/150 結束,因此 deploy 拒絕部署。" +
29
+ (first.type === "homes"
30
+ ? "若需要管理員選定的資料夾,請改用 type: shared_folder。"
31
+ : "請改用 type: string,或讓 App 自行從 ${SYNO_APP_SECRETS_DIR} 讀檔。"),
32
+ };
33
+ }
54
34
  const validation = validateProject(options.project);
55
35
  if (!validation.ok) {
56
36
  return { ok: false, code: "VALIDATION_FAILED", message: validation.errors.map((e) => e.code).join(", ") };
@@ -63,14 +43,8 @@ export async function deployProject(options) {
63
43
  message: `最終 Package Identity「${identity.packageId}」長度 ${identity.packageId.length} 超過 DSM 上限 ${PACKAGE_IDENTITY_MAX_LENGTH} 字元。`,
64
44
  };
65
45
  }
66
- const curatedInstall = identity.developmentInstance
67
- ? undefined
68
- : await detectCuratedInstall(options.host, identity.packageId);
69
- const hasCuratedInstall = curatedInstall?.brokerRecord === true || versionBuildIsCurated(curatedInstall?.installedVersion);
70
- if (hasCuratedInstall && !options.replaceCurated) {
71
- return { ok: false, code: "CURATED_DEPLOY_REFUSED", message: CURATED_DEPLOY_REFUSED_MESSAGE };
72
- }
73
- const contract = loadContract(options.project.contractPath).contract;
46
+ const packageInstalled = await options.host.isPackageInstalled(identity.packageId);
47
+ const explicitParamNames = new Set(Object.keys(options.paramValues ?? {}));
74
48
  const paramValues = { ...(options.paramValues ?? {}) };
75
49
  const posixAllSharesNames = Object.entries(contract.install ?? {})
76
50
  .filter(([, parameter]) => parameter?.type === "posix_all_shares")
@@ -111,18 +85,16 @@ export async function deployProject(options) {
111
85
  return { ok: false, code: homesResolved.code, message: homesResolved.message };
112
86
  }
113
87
  const shareResolved = await resolveSharedFolderExtraValues({
114
- requiredKeys: sharedFolderParameterNames(contract),
88
+ requiredKeys: sharedFolderParameterNames(contract).filter((key) => !packageInstalled || options.shareValues?.[key] !== undefined),
115
89
  provided: options.shareValues ?? {},
116
- existingEnv: (await options.host.getInstalledProjectEnv?.(identity.packageId)) ?? {},
117
90
  lookup: async (logicalName) => options.host.resolveSharePath?.(logicalName),
118
91
  });
119
92
  if (!shareResolved.ok) {
120
93
  return { ok: false, code: shareResolved.code, message: shareResolved.message };
121
94
  }
122
95
  const runAsResolved = resolveDsmUserExtraValues({
123
- requiredKeys: dsmUserParameterNames(contract),
96
+ requiredKeys: dsmUserParameterNames(contract).filter((key) => !packageInstalled || options.runAsValues?.[key] !== undefined),
124
97
  provided: options.runAsValues ?? {},
125
- existingEnv: (await options.host.getInstalledProjectEnv?.(identity.packageId)) ?? {},
126
98
  });
127
99
  if (!runAsResolved.ok) {
128
100
  return { ok: false, code: runAsResolved.code, message: runAsResolved.message };
@@ -161,70 +133,29 @@ export async function deployProject(options) {
161
133
  ...shareResolved.extraValues,
162
134
  ...runAsResolved.extraValues,
163
135
  };
164
- const contractDigest = digestProjectContract(options.project);
165
- const bundleDigest = digestProjectBundle(options.project);
166
- if (hasCuratedInstall && options.replaceCurated) {
167
- const installed = await options.host.isPackageInstalled(identity.packageId);
168
- if (installed) {
169
- console.warn("警告:--replace-curated 會移除 Curated 安裝,但會保留 App Data。");
170
- if (!options.host.uninstallPackage) {
171
- return {
172
- ok: false,
173
- code: "CATALOG_INSTALL_FAILED",
174
- message: "此 NAS Host 不支援保留 App Data 的 Curated replacement uninstall。",
175
- };
136
+ // The upgrade wizard deliberately ignores auto-filled Share controls unless
137
+ // the administrator opted into a change. Keep the CLI's explicit upgrade
138
+ // flags equivalent to checking those controls.
139
+ if (packageInstalled) {
140
+ for (const name of sharedFolderParameterNames(contract)) {
141
+ if ((options.shareValues?.[name] ?? "").trim() !== "") {
142
+ extraValues[`CHANGE_${name}`] = "true";
176
143
  }
177
- try {
178
- await options.host.uninstallPackage(identity.packageId);
179
- }
180
- catch (error) {
181
- return {
182
- ok: false,
183
- code: "CATALOG_INSTALL_FAILED",
184
- message: error instanceof Error ? error.message : String(error),
185
- };
144
+ }
145
+ for (const name of posixAllSharesNames) {
146
+ if (explicitParamNames.has(name) && (paramValues[name] ?? "").trim() !== "") {
147
+ extraValues[`CHANGE_${name}`] = "true";
186
148
  }
187
149
  }
188
150
  }
189
- let attestationResult;
190
- try {
191
- attestationResult = await options.host.requestAttestation({
192
- packageIdentity: identity.packageId,
193
- contractDigest,
194
- bundleDigest,
195
- capabilities: brokerCapabilitiesFromContract(options.project),
196
- allowCuratedDowngrade: options.replaceCurated,
197
- });
198
- }
199
- catch (error) {
200
- const code = error.code ?? "ATTESTATION_FAILED";
201
- return {
202
- ok: false,
203
- code,
204
- message: code === "CURATED_DEPLOY_REFUSED"
205
- ? CURATED_DEPLOY_REFUSED_MESSAGE
206
- : error instanceof Error
207
- ? error.message
208
- : String(error),
209
- };
210
- }
211
151
  const resolveSpkVersion = options.spkVersionResolver ?? resolveDeploySpkVersion;
212
152
  let spkVersion;
213
153
  try {
214
154
  spkVersion = await resolveSpkVersion(options.project, options.host, identity.packageId);
215
155
  }
216
156
  catch (error) {
217
- const code = error.code;
218
- if (code === "DEPLOY_PERSONAL_BUILD_EXHAUSTED" ||
219
- code === "PERSONAL_BUILD_EXHAUSTED" ||
220
- code === "DEPLOY_VERSION_NOT_ASCENDING") {
221
- return {
222
- ok: false,
223
- code: code === "DEPLOY_VERSION_NOT_ASCENDING" ? code : "DEPLOY_PERSONAL_BUILD_EXHAUSTED",
224
- message: error instanceof Error ? error.message : String(error),
225
- };
226
- }
227
- throw error;
157
+ return { ok: false, code: "DEPLOY_VERSION_INVALID",
158
+ message: error instanceof Error ? error.message : String(error) };
228
159
  }
229
160
  let archFamily = options.archFamily;
230
161
  if (archFamily === undefined && options.project.nativePath && existsSync(options.project.nativePath)) {
@@ -243,67 +174,25 @@ export async function deployProject(options) {
243
174
  displayname: identity.displayname,
244
175
  spkVersion,
245
176
  archFamily,
246
- embeddedAttestationToken: attestationResult.token,
247
177
  });
248
178
  if (!build.ok || !build.outputPath) {
249
179
  return { ok: false, code: "BUILD_SPK_FAILED", message: build.errors.join(", ") };
250
180
  }
251
- let catalogVersion = spkVersion;
252
- const publishToCatalog = options.catalogPublish ?? publishBuiltSpk;
253
- if (options.host.installationId === "live-nas" && !identity.developmentInstance) {
254
- try {
255
- const published = await publishToCatalog(build.outputPath);
256
- catalogVersion = published.version;
257
- }
258
- catch (error) {
259
- return {
260
- ok: false,
261
- code: "CATALOG_PUBLISH_FAILED",
262
- message: error instanceof Error ? error.message : String(error),
263
- };
264
- }
265
- }
266
181
  try {
267
- if (identity.developmentInstance) {
268
- if (!options.host.installFromLocalSpk) {
269
- return {
270
- ok: false,
271
- code: "LOCAL_SPK_INSTALL_UNSUPPORTED",
272
- message: "Development deploy requires installFromLocalSpk on the host adapter.",
273
- };
274
- }
275
- await options.host.installFromLocalSpk({
276
- packageId: identity.packageId,
277
- version: catalogVersion,
278
- spkPath: build.outputPath,
279
- extraValues,
280
- });
281
- }
282
- else {
283
- if (options.host.ensurePackageSource) {
284
- await options.host.ensurePackageSource(packageSourceOrigin());
285
- }
286
- await options.host.installFromCatalog({
287
- packageId: identity.packageId,
288
- version: catalogVersion,
289
- extraValues,
290
- });
291
- }
182
+ await options.host.installFromLocalSpk({
183
+ packageId: identity.packageId,
184
+ version: spkVersion,
185
+ spkPath: build.outputPath,
186
+ extraValues,
187
+ });
292
188
  }
293
189
  catch (error) {
294
- return {
295
- ok: false,
296
- code: "CATALOG_INSTALL_FAILED",
297
- message: error instanceof Error ? error.message : String(error),
298
- };
190
+ return { ok: false, code: "LOCAL_SPK_INSTALL_FAILED",
191
+ message: error instanceof Error ? error.message : String(error) };
299
192
  }
300
- const info = await options.host.getAttestationInfo(identity.packageId);
301
193
  return {
302
- ok: true,
303
- packageId: identity.packageId,
304
- spkPath: build.outputPath,
305
- openUrl: info.openUrl ?? appOriginFromContract(options.host.dsmOrigin, contract),
306
- catalogVersion,
307
- notes: sharePermission.notes.length > 0 ? sharePermission.notes : undefined,
194
+ ok: true, packageId: identity.packageId, spkPath: build.outputPath,
195
+ openUrl: appOriginFromContract(options.host.dsmOrigin, contract),
196
+ version: spkVersion, notes: sharePermission.notes,
308
197
  };
309
198
  }
@@ -19,7 +19,7 @@ export async function resolveHomesExtraValues(input) {
19
19
  return {
20
20
  ok: false,
21
21
  code: "HOMES_NOT_ENABLED",
22
- message: "這台 NAS 未啟用 DSM User Home,或 Broker 無法解析 user home 路徑;無法安裝需要 homes 的 App。請在 DSM 啟用 User Home 後重試。",
22
+ message: "這台 NAS 未啟用 DSM User Home,或 DSM API 無法解析 user home 路徑;無法安裝需要 homes 的 App。請在 DSM 啟用 User Home 後重試。",
23
23
  };
24
24
  }
25
25
  return {
@@ -0,0 +1,18 @@
1
+ import type { NativeArchFamily } from "../build-spk/dsm-arch.js";
2
+ import type { NasHost } from "../host/types.js";
3
+ export interface DeploymentPlan {
4
+ root: string;
5
+ kind: "native-go" | "binary" | "container";
6
+ packageId: string;
7
+ version: string;
8
+ arch?: NativeArchFamily;
9
+ privilege: "none" | "root";
10
+ transport: "dsm-local-spk";
11
+ notes: string[];
12
+ }
13
+ /** Purely local planning: no credentials, network, build or installation. */
14
+ export declare function planDeployment(root: string, options?: {
15
+ arch?: NativeArchFamily;
16
+ dev?: boolean;
17
+ }): DeploymentPlan;
18
+ export declare function deployStandalone(plan: DeploymentPlan, host: NasHost): Promise<string>;
@@ -0,0 +1,54 @@
1
+ import { existsSync } from "node:fs";
2
+ import { join } from "node:path";
3
+ import { findProjectRoot } from "../discovery.js";
4
+ import { loadContract } from "../contract/load.js";
5
+ import { validateProject } from "../validate.js";
6
+ import { findStandaloneRoot, loadStandaloneManifest } from "../standalone/manifest.js";
7
+ import { buildStandalone } from "../standalone/build.js";
8
+ import { resolveDeployIdentity } from "./identity.js";
9
+ import { nextDeployVersion } from "./spk-version.js";
10
+ /** Purely local planning: no credentials, network, build or installation. */
11
+ export function planDeployment(root, options = {}) {
12
+ const standalone = findStandaloneRoot(root);
13
+ if (standalone) {
14
+ const loaded = loadStandaloneManifest(standalone);
15
+ if (!loaded.ok)
16
+ throw new Error(loaded.errors.map(e => `${e.code}: ${e.message}`).join("\n"));
17
+ const m = loaded.manifest;
18
+ if (options.dev)
19
+ throw new Error('--dev is not supported for native-go; choose a distinct package name at init');
20
+ if (options.arch && !m.arches.includes(options.arch))
21
+ throw new Error(`Architecture not declared: ${options.arch}`);
22
+ return { root: standalone, kind: "native-go", packageId: m.package, version: m.spkVersion,
23
+ arch: options.arch, privilege: m.privilege, transport: "dsm-local-spk",
24
+ notes: m.privilege === "root" ? ['Approve root tasks in DSM after installation; changed task text requires fresh approval. Remove tasks before uninstall.'] : [] };
25
+ }
26
+ const project = findProjectRoot(root);
27
+ if (!project)
28
+ throw new Error('No dsm-package.yaml or synology-app.yaml found');
29
+ const validation = validateProject(project);
30
+ if (!validation.ok)
31
+ throw new Error(validation.errors.map(e => `${e.code}: ${e.message}`).join("\n"));
32
+ const contract = loadContract(project.contractPath).contract;
33
+ const identity = resolveDeployIdentity(project, { dev: options.dev });
34
+ return { root: project.root, kind: existsSync(join(project.root, 'native.yaml')) ? 'binary' : 'container',
35
+ packageId: identity.packageId, version: nextDeployVersion(String(contract.version)),
36
+ arch: options.arch, privilege: 'none', transport: 'dsm-local-spk',
37
+ notes: ['DSM resolves target architecture and installed version during deployment. Container bind access uses the configured process user.'] };
38
+ }
39
+ export async function deployStandalone(plan, host) {
40
+ if (plan.kind !== 'native-go')
41
+ throw new Error('Expected native-go deployment plan');
42
+ const arch = plan.arch ?? await host.getArchFamily?.();
43
+ if (!arch)
44
+ throw new Error('Cannot determine NAS architecture; specify --arch');
45
+ const installed = await host.getInstalledPackageVersion?.(plan.packageId);
46
+ if (installed && nextDeployVersion(plan.version, installed) !== plan.version) {
47
+ throw new Error(`Increase dsm-package.yaml version/build above installed ${installed}`);
48
+ }
49
+ const { outputs } = await buildStandalone({ root: plan.root, arches: [arch] });
50
+ if (outputs.length !== 1)
51
+ throw new Error('Expected one SPK');
52
+ await host.installFromLocalSpk({ packageId: plan.packageId, version: plan.version, spkPath: outputs[0] });
53
+ return outputs[0];
54
+ }
@@ -1,17 +1,5 @@
1
1
  import type { ProjectRoot } from "../discovery.js";
2
2
  import type { NasHost } from "../host/types.js";
3
- export declare class DeployPersonalBuildExhaustedError extends Error {
4
- readonly code = "DEPLOY_PERSONAL_BUILD_EXHAUSTED";
5
- constructor();
6
- }
7
- export declare class DeployVersionNotAscendingError extends Error {
8
- readonly code = "DEPLOY_VERSION_NOT_ASCENDING";
9
- constructor(contractVersion: string, proposedVersion: string, existingVersion: string);
10
- }
11
- export interface DeployVersionCandidates {
12
- installed?: string;
13
- feed?: string;
14
- }
15
- export declare function resolvePersonalDeploySpkVersion(contractVersion: string, candidates?: DeployVersionCandidates): string;
3
+ /** Increment the installed build only for the same application version. */
4
+ export declare function nextDeployVersion(version: string, installed?: string): string;
16
5
  export declare function resolveDeploySpkVersion(project: ProjectRoot, host: NasHost, packageId: string): Promise<string>;
17
- export declare function publishDeploySpk(spkPath: string): Promise<string>;