@flowrunner/cli 0.1.18 → 0.1.19-dev.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (318) hide show
  1. package/ai-docs/instructions/service-code-format/01-service-structure.md +1 -1
  2. package/ai-docs/instructions/service-code-format/02-zod-types.md +115 -7
  3. package/ai-docs/instructions/service-code-format/05-dictionaries.md +1 -1
  4. package/ai-docs/instructions/service-code-format/11-output-model.md +5 -5
  5. package/ai-docs/instructions/service-code-format/13-runtime-contracts.md +2 -3
  6. package/ai-docs/instructions/service-code-format/16-gotchas.md +30 -6
  7. package/ai-docs/instructions/service-code-format/README.md +2 -2
  8. package/dist/cli.js +944 -958
  9. package/dist/cli.js.map +4 -4
  10. package/dist/index.js +977 -988
  11. package/dist/index.js.map +4 -4
  12. package/{runtime/types/flow-extension-runner/src/v2 → dist/types/flow-extension-runner/src}/context/execution-context.d.ts +10 -2
  13. package/{runtime/types/flow-extension-runner/src/v2 → dist/types/flow-extension-runner/src}/extension.d.ts +3 -3
  14. package/dist/types/flow-extension-runner/src/global.d.ts +6 -18
  15. package/dist/types/flow-extension-runner/src/index.d.ts +39 -13
  16. package/{runtime/types/flow-extension-runner/src/v2 → dist/types/flow-extension-runner/src}/model/field-mapper.d.ts +1 -1
  17. package/dist/types/flow-extension-runner/src/{v2/model → model}/model-types.d.ts +11 -1
  18. package/dist/types/flow-extension-runner/src/{v2/model → model}/params-model.d.ts +1 -1
  19. package/dist/types/flow-extension-runner/src/{v2/params → params}/config-params.d.ts +1 -1
  20. package/{runtime/types/flow-extension-runner/src/v2 → dist/types/flow-extension-runner/src}/params/index.d.ts +2 -0
  21. package/dist/types/flow-extension-runner/src/{v2/params → params}/json/types.d.ts +2 -0
  22. package/dist/types/flow-extension-runner/src/params/schema/date-format.d.ts +80 -0
  23. package/{runtime/types/flow-extension-runner/src/v2 → dist/types/flow-extension-runner/src}/params/schema/defaults.d.ts +3 -2
  24. package/{runtime/types/flow-extension-runner/src/v2 → dist/types/flow-extension-runner/src}/params/schema/field-plan.d.ts +9 -2
  25. package/dist/types/flow-extension-runner/src/{v2/params → params}/schema/introspect.d.ts +8 -0
  26. package/{runtime/types/flow-extension-runner/src/v2 → dist/types/flow-extension-runner/src}/params/schema/messages.d.ts +1 -1
  27. package/{runtime/types/flow-extension-runner/src/v2 → dist/types/flow-extension-runner/src}/params/schema/normalize.d.ts +1 -1
  28. package/dist/types/flow-extension-runner/src/params/schema/notices.d.ts +15 -0
  29. package/dist/types/flow-extension-runner/src/{v2/params → params}/schema/parse.d.ts +1 -1
  30. package/{runtime/types/flow-extension-runner/src/v2 → dist/types/flow-extension-runner/src}/params/types.d.ts +1 -1
  31. package/{runtime/types/flow-extension-runner/src/v2 → dist/types/flow-extension-runner/src}/params/zod.d.ts +21 -0
  32. package/{runtime/types/flow-extension-runner/src/v2 → dist/types/flow-extension-runner/src}/registry.d.ts +2 -0
  33. package/dist/types/flow-extension-runner/src/{v2/types.d.ts → types.d.ts} +1 -1
  34. package/dist/types/packages/cli/src/operations/deploy/discover-services.d.ts +2 -4
  35. package/dist/types/shared/src/constants/activity-log.d.ts +248 -2
  36. package/dist/types/shared/src/constants/error-codes.d.ts +6 -0
  37. package/dist/types/shared/src/constants/index.d.ts +1 -0
  38. package/dist/types/shared/src/constants/notification-types.d.ts +309 -0
  39. package/dist/types/shared/src/constants/panic-mode.d.ts +17 -0
  40. package/dist/types/shared/src/constants/shared-extensions.d.ts +10 -0
  41. package/dist/types/shared/src/errors/index.d.ts +1 -0
  42. package/dist/types/shared/src/errors/secrets.d.ts +16 -0
  43. package/dist/types/shared/src/scheme/access-keys/dto.d.ts +35 -13
  44. package/dist/types/shared/src/scheme/api-keys/dto.d.ts +29 -4
  45. package/dist/types/shared/src/scheme/flowrunner/custom-elements.d.ts +0 -16
  46. package/dist/types/shared/src/scheme/flowrunner/index.d.ts +1 -0
  47. package/dist/types/shared/src/scheme/flowrunner/java.dto.d.ts +26 -0
  48. package/dist/types/shared/src/scheme/flowrunner/workspace-dashboard.dto.d.ts +207 -0
  49. package/dist/types/shared/src/scheme/integration-connection/dto.d.ts +22 -0
  50. package/dist/types/shared/src/scheme/notifications/dto.d.ts +10 -0
  51. package/dist/types/shared/src/scheme/notifications/rest.d.ts +20 -0
  52. package/dist/types/shared/src/scheme/remote-mcp-server/dto.d.ts +153 -29
  53. package/dist/types/shared/src/scheme/shared-extensions/base.d.ts +0 -4
  54. package/dist/types/shared/src/scheme/shared-extensions/custom-extensions.d.ts +0 -24
  55. package/dist/types/shared/src/scheme/shared-extensions/extension.d.ts +0 -18
  56. package/dist/types/shared/src/scheme/shared-extensions/flow-extensions.d.ts +0 -3
  57. package/dist/types/shared/src/scheme/shared-extensions/index.d.ts +1 -0
  58. package/dist/types/shared/src/scheme/shared-extensions/list.d.ts +0 -28
  59. package/dist/types/shared/src/scheme/shared-extensions/methods.d.ts +0 -1
  60. package/dist/types/shared/src/scheme/shared-extensions/resolve.d.ts +0 -12
  61. package/dist/types/shared/src/scheme/shared-extensions/search.d.ts +0 -8
  62. package/dist/types/shared/src/scheme/shared-extensions/usage-stats.d.ts +189 -0
  63. package/package.json +1 -4
  64. package/project-files/sandbox/files-mock.js +3 -5
  65. package/project-files/sandbox/service.js +10 -11
  66. package/runtime/index.js +794 -896
  67. package/runtime/index.js.map +4 -4
  68. package/{dist/types/flow-extension-runner/src/v2 → runtime/types/flow-extension-runner/src}/context/execution-context.d.ts +10 -2
  69. package/{dist/types/flow-extension-runner/src/v2 → runtime/types/flow-extension-runner/src}/extension.d.ts +3 -3
  70. package/runtime/types/flow-extension-runner/src/global.d.ts +6 -18
  71. package/runtime/types/flow-extension-runner/src/index.d.ts +39 -13
  72. package/{dist/types/flow-extension-runner/src/v2 → runtime/types/flow-extension-runner/src}/model/field-mapper.d.ts +1 -1
  73. package/runtime/types/flow-extension-runner/src/{v2/model → model}/model-types.d.ts +11 -1
  74. package/runtime/types/flow-extension-runner/src/{v2/model → model}/params-model.d.ts +1 -1
  75. package/runtime/types/flow-extension-runner/src/{v2/params → params}/config-params.d.ts +1 -1
  76. package/{dist/types/flow-extension-runner/src/v2 → runtime/types/flow-extension-runner/src}/params/index.d.ts +2 -0
  77. package/runtime/types/flow-extension-runner/src/{v2/params → params}/json/types.d.ts +2 -0
  78. package/runtime/types/flow-extension-runner/src/params/schema/date-format.d.ts +80 -0
  79. package/{dist/types/flow-extension-runner/src/v2 → runtime/types/flow-extension-runner/src}/params/schema/defaults.d.ts +3 -2
  80. package/{dist/types/flow-extension-runner/src/v2 → runtime/types/flow-extension-runner/src}/params/schema/field-plan.d.ts +9 -2
  81. package/runtime/types/flow-extension-runner/src/{v2/params → params}/schema/introspect.d.ts +8 -0
  82. package/{dist/types/flow-extension-runner/src/v2 → runtime/types/flow-extension-runner/src}/params/schema/messages.d.ts +1 -1
  83. package/{dist/types/flow-extension-runner/src/v2 → runtime/types/flow-extension-runner/src}/params/schema/normalize.d.ts +1 -1
  84. package/runtime/types/flow-extension-runner/src/params/schema/notices.d.ts +15 -0
  85. package/runtime/types/flow-extension-runner/src/{v2/params → params}/schema/parse.d.ts +1 -1
  86. package/{dist/types/flow-extension-runner/src/v2 → runtime/types/flow-extension-runner/src}/params/types.d.ts +1 -1
  87. package/{dist/types/flow-extension-runner/src/v2 → runtime/types/flow-extension-runner/src}/params/zod.d.ts +21 -0
  88. package/{dist/types/flow-extension-runner/src/v2 → runtime/types/flow-extension-runner/src}/registry.d.ts +2 -0
  89. package/runtime/types/flow-extension-runner/src/{v2/types.d.ts → types.d.ts} +1 -1
  90. package/runtime/types/packages/cli/src/runtime/index.d.ts +6 -5
  91. package/dist/types/flow-extension-runner/src/common/config.d.ts +0 -12
  92. package/dist/types/flow-extension-runner/src/common/context.d.ts +0 -6
  93. package/dist/types/flow-extension-runner/src/common/types.d.ts +0 -11
  94. package/dist/types/flow-extension-runner/src/v1/config.d.ts +0 -3
  95. package/dist/types/flow-extension-runner/src/v1/constants.d.ts +0 -4
  96. package/dist/types/flow-extension-runner/src/v1/index.d.ts +0 -11
  97. package/dist/types/flow-extension-runner/src/v1/namespace.d.ts +0 -9
  98. package/dist/types/flow-extension-runner/src/v1/service.d.ts +0 -29
  99. package/dist/types/flow-extension-runner/src/v1/types.d.ts +0 -13
  100. package/dist/types/flow-extension-runner/src/v2/index.d.ts +0 -39
  101. package/dist/types/jsdoc-parser/src/custom-type-defs/files.d.ts +0 -2
  102. package/dist/types/jsdoc-parser/src/index.d.ts +0 -2
  103. package/dist/types/jsdoc-parser/src/lib.d.ts +0 -42
  104. package/dist/types/jsdoc-parser/src/types.d.ts +0 -2
  105. package/runtime/types/flow-extension-runner/src/common/config.d.ts +0 -12
  106. package/runtime/types/flow-extension-runner/src/common/context.d.ts +0 -6
  107. package/runtime/types/flow-extension-runner/src/common/types.d.ts +0 -11
  108. package/runtime/types/flow-extension-runner/src/v1/config.d.ts +0 -3
  109. package/runtime/types/flow-extension-runner/src/v1/constants.d.ts +0 -4
  110. package/runtime/types/flow-extension-runner/src/v1/index.d.ts +0 -11
  111. package/runtime/types/flow-extension-runner/src/v1/namespace.d.ts +0 -9
  112. package/runtime/types/flow-extension-runner/src/v1/service.d.ts +0 -29
  113. package/runtime/types/flow-extension-runner/src/v1/types.d.ts +0 -13
  114. package/runtime/types/flow-extension-runner/src/v2/index.d.ts +0 -39
  115. package/runtime/types/jsdoc-parser/src/custom-type-defs/files.d.ts +0 -2
  116. package/runtime/types/jsdoc-parser/src/index.d.ts +0 -2
  117. package/runtime/types/jsdoc-parser/src/lib.d.ts +0 -42
  118. package/runtime/types/jsdoc-parser/src/types.d.ts +0 -2
  119. package/runtime/types/shared/src/constants/activity-log.d.ts +0 -1573
  120. package/runtime/types/shared/src/constants/ai-agent-tools.d.ts +0 -20
  121. package/runtime/types/shared/src/constants/ai.d.ts +0 -11
  122. package/runtime/types/shared/src/constants/api-keys.d.ts +0 -1
  123. package/runtime/types/shared/src/constants/app.d.ts +0 -57
  124. package/runtime/types/shared/src/constants/billing.d.ts +0 -16
  125. package/runtime/types/shared/src/constants/compliances.d.ts +0 -3
  126. package/runtime/types/shared/src/constants/data-types.d.ts +0 -26
  127. package/runtime/types/shared/src/constants/docs.d.ts +0 -6
  128. package/runtime/types/shared/src/constants/error-codes.d.ts +0 -20
  129. package/runtime/types/shared/src/constants/flow.d.ts +0 -12
  130. package/runtime/types/shared/src/constants/index.d.ts +0 -18
  131. package/runtime/types/shared/src/constants/knowledge-base.d.ts +0 -15
  132. package/runtime/types/shared/src/constants/notification-types.d.ts +0 -1234
  133. package/runtime/types/shared/src/constants/notifications.d.ts +0 -10
  134. package/runtime/types/shared/src/constants/oauth-connection-error.d.ts +0 -3
  135. package/runtime/types/shared/src/constants/patterns.d.ts +0 -28
  136. package/runtime/types/shared/src/constants/retry-policy.d.ts +0 -30
  137. package/runtime/types/shared/src/constants/severity.d.ts +0 -9
  138. package/runtime/types/shared/src/constants/shared-extensions-search.d.ts +0 -6
  139. package/runtime/types/shared/src/constants/shared-extensions.d.ts +0 -56
  140. package/runtime/types/shared/src/constants/zod.d.ts +0 -2
  141. package/runtime/types/shared/src/errors/api.d.ts +0 -15
  142. package/runtime/types/shared/src/errors/base.d.ts +0 -38
  143. package/runtime/types/shared/src/errors/common.d.ts +0 -39
  144. package/runtime/types/shared/src/errors/index.d.ts +0 -14
  145. package/runtime/types/shared/src/errors/k8s.d.ts +0 -14
  146. package/runtime/types/shared/src/errors/message.d.ts +0 -48
  147. package/runtime/types/shared/src/errors/oauth-connection.d.ts +0 -4
  148. package/runtime/types/shared/src/errors/open-search.d.ts +0 -4
  149. package/runtime/types/shared/src/errors/s3.d.ts +0 -11
  150. package/runtime/types/shared/src/extensions/zod.d.ts +0 -25
  151. package/runtime/types/shared/src/scheme/access-keys/dto.d.ts +0 -101
  152. package/runtime/types/shared/src/scheme/access-keys/index.d.ts +0 -2
  153. package/runtime/types/shared/src/scheme/account/dto.d.ts +0 -63
  154. package/runtime/types/shared/src/scheme/account/index.d.ts +0 -1
  155. package/runtime/types/shared/src/scheme/activity-log-base.d.ts +0 -35
  156. package/runtime/types/shared/src/scheme/ai-agent-tools/dto.d.ts +0 -69
  157. package/runtime/types/shared/src/scheme/ai-agent-tools/index.d.ts +0 -2
  158. package/runtime/types/shared/src/scheme/ai-agent-tools/parameters.d.ts +0 -7
  159. package/runtime/types/shared/src/scheme/ai-router/dto.d.ts +0 -23
  160. package/runtime/types/shared/src/scheme/ai-router/index.d.ts +0 -2
  161. package/runtime/types/shared/src/scheme/api-keys/dto.d.ts +0 -28
  162. package/runtime/types/shared/src/scheme/api-keys/index.d.ts +0 -2
  163. package/runtime/types/shared/src/scheme/app/index.d.ts +0 -1
  164. package/runtime/types/shared/src/scheme/app/java.dto.d.ts +0 -6
  165. package/runtime/types/shared/src/scheme/billing/index.d.ts +0 -1
  166. package/runtime/types/shared/src/scheme/billing/java.dto.d.ts +0 -181
  167. package/runtime/types/shared/src/scheme/crm/billing.d.ts +0 -149
  168. package/runtime/types/shared/src/scheme/crm/dto.d.ts +0 -218
  169. package/runtime/types/shared/src/scheme/crm/index.d.ts +0 -3
  170. package/runtime/types/shared/src/scheme/data-types/index.d.ts +0 -1
  171. package/runtime/types/shared/src/scheme/data-types/java.dto.d.ts +0 -22
  172. package/runtime/types/shared/src/scheme/dynamic-forms/dto.d.ts +0 -30
  173. package/runtime/types/shared/src/scheme/dynamic-forms/index.d.ts +0 -2
  174. package/runtime/types/shared/src/scheme/extensions/index.d.ts +0 -1
  175. package/runtime/types/shared/src/scheme/extensions/params-to-zod.d.ts +0 -14
  176. package/runtime/types/shared/src/scheme/flowrunner/custom-elements.d.ts +0 -383
  177. package/runtime/types/shared/src/scheme/flowrunner/index.d.ts +0 -3
  178. package/runtime/types/shared/src/scheme/flowrunner/java.dto.d.ts +0 -655
  179. package/runtime/types/shared/src/scheme/index.d.ts +0 -21
  180. package/runtime/types/shared/src/scheme/integration-connection/dto.d.ts +0 -135
  181. package/runtime/types/shared/src/scheme/integration-connection/index.d.ts +0 -2
  182. package/runtime/types/shared/src/scheme/knowledge-base/dto.d.ts +0 -776
  183. package/runtime/types/shared/src/scheme/knowledge-base/index.d.ts +0 -2
  184. package/runtime/types/shared/src/scheme/mcp-oauth/dto.d.ts +0 -9
  185. package/runtime/types/shared/src/scheme/mcp-oauth/index.d.ts +0 -2
  186. package/runtime/types/shared/src/scheme/notifications/dto.d.ts +0 -118
  187. package/runtime/types/shared/src/scheme/notifications/index.d.ts +0 -3
  188. package/runtime/types/shared/src/scheme/notifications/rest.d.ts +0 -162
  189. package/runtime/types/shared/src/scheme/onboarding/dto.d.ts +0 -29
  190. package/runtime/types/shared/src/scheme/onboarding/index.d.ts +0 -1
  191. package/runtime/types/shared/src/scheme/properties/account.d.ts +0 -3
  192. package/runtime/types/shared/src/scheme/properties/app.d.ts +0 -5
  193. package/runtime/types/shared/src/scheme/properties/billing.d.ts +0 -12
  194. package/runtime/types/shared/src/scheme/properties/common.d.ts +0 -2
  195. package/runtime/types/shared/src/scheme/properties/db.d.ts +0 -8
  196. package/runtime/types/shared/src/scheme/properties/flow-extensions.d.ts +0 -7
  197. package/runtime/types/shared/src/scheme/properties/index.d.ts +0 -7
  198. package/runtime/types/shared/src/scheme/remote-mcp-server/dto.d.ts +0 -278
  199. package/runtime/types/shared/src/scheme/remote-mcp-server/index.d.ts +0 -2
  200. package/runtime/types/shared/src/scheme/shared-extensions/base.d.ts +0 -62
  201. package/runtime/types/shared/src/scheme/shared-extensions/config.d.ts +0 -96
  202. package/runtime/types/shared/src/scheme/shared-extensions/custom-extensions.d.ts +0 -631
  203. package/runtime/types/shared/src/scheme/shared-extensions/extension.d.ts +0 -411
  204. package/runtime/types/shared/src/scheme/shared-extensions/flow-extensions.d.ts +0 -64
  205. package/runtime/types/shared/src/scheme/shared-extensions/index.d.ts +0 -17
  206. package/runtime/types/shared/src/scheme/shared-extensions/light.d.ts +0 -38
  207. package/runtime/types/shared/src/scheme/shared-extensions/list.d.ts +0 -250
  208. package/runtime/types/shared/src/scheme/shared-extensions/logs.d.ts +0 -21
  209. package/runtime/types/shared/src/scheme/shared-extensions/methods.d.ts +0 -112
  210. package/runtime/types/shared/src/scheme/shared-extensions/params-schema.d.ts +0 -48
  211. package/runtime/types/shared/src/scheme/shared-extensions/popular-pool.d.ts +0 -11
  212. package/runtime/types/shared/src/scheme/shared-extensions/resolve.d.ts +0 -373
  213. package/runtime/types/shared/src/scheme/shared-extensions/rest.d.ts +0 -9
  214. package/runtime/types/shared/src/scheme/shared-extensions/search.d.ts +0 -189
  215. package/runtime/types/shared/src/scheme/shared-extensions/service-identity.d.ts +0 -10
  216. package/runtime/types/shared/src/scheme/shared-extensions/service-info.d.ts +0 -16
  217. package/runtime/types/shared/src/scheme/shared-extensions/workspace-stack.d.ts +0 -44
  218. package/runtime/types/shared/src/scheme/workspace/dto.d.ts +0 -40
  219. package/runtime/types/shared/src/scheme/workspace/index.d.ts +0 -1
  220. package/runtime/types/shared/src/utils/object.d.ts +0 -8
  221. package/runtime/types/shared/src/utils/uuid.d.ts +0 -5
  222. package/runtime/types/shared/src/utils/versions.d.ts +0 -4
  223. package/dist/types/flow-extension-runner/src/{v2/actions → actions}/action-method.d.ts +0 -0
  224. package/dist/types/flow-extension-runner/src/{common/context-files.d.ts → context/files.d.ts} +0 -0
  225. package/dist/types/flow-extension-runner/src/{v2/context → context}/logger.d.ts +0 -0
  226. package/dist/types/flow-extension-runner/src/{v2/context → context}/method-input.d.ts +0 -0
  227. package/dist/types/flow-extension-runner/src/{v2/context → context}/proxies.d.ts +0 -0
  228. package/dist/types/flow-extension-runner/src/{v2/create-extension.d.ts → create-extension.d.ts} +0 -0
  229. package/dist/types/flow-extension-runner/src/{v2/crypto.d.ts → crypto.d.ts} +0 -0
  230. package/dist/types/flow-extension-runner/src/{v2/dictionaries → dictionaries}/dictionary-method.d.ts +0 -0
  231. package/dist/types/flow-extension-runner/src/{v2/dictionaries → dictionaries}/payload-schema.d.ts +0 -0
  232. package/dist/types/flow-extension-runner/src/{v2/loaders → loaders}/loader-method.d.ts +0 -0
  233. package/dist/types/flow-extension-runner/src/{v2/loaders → loaders}/loader-owner.d.ts +0 -0
  234. package/dist/types/flow-extension-runner/src/{v2/loaders → loaders}/payload-schema.d.ts +0 -0
  235. package/dist/types/flow-extension-runner/src/{v2/method.d.ts → method.d.ts} +0 -0
  236. package/dist/types/flow-extension-runner/src/{v2/model → model}/method-model.d.ts +0 -0
  237. package/dist/types/flow-extension-runner/src/{v2/oauth → oauth}/method-names.d.ts +0 -0
  238. package/dist/types/flow-extension-runner/src/{v2/oauth → oauth}/oauth2.d.ts +0 -0
  239. package/dist/types/flow-extension-runner/src/{v2/oauth → oauth}/system-params.d.ts +0 -0
  240. package/dist/types/flow-extension-runner/src/{v2/oauth → oauth}/types.d.ts +0 -0
  241. package/dist/types/flow-extension-runner/src/{common/constants.d.ts → params/config-types.d.ts} +0 -0
  242. package/{runtime/types/flow-extension-runner/src/v2 → dist/types/flow-extension-runner/src}/params/files-options.d.ts +4 -4
  243. /package/dist/types/flow-extension-runner/src/{v2/params → params}/json/checks.d.ts +0 -0
  244. /package/dist/types/flow-extension-runner/src/{v2/params → params}/json/decode.d.ts +0 -0
  245. /package/dist/types/flow-extension-runner/src/{v2/params → params}/json/encode.d.ts +0 -0
  246. /package/dist/types/flow-extension-runner/src/{v2/params → params}/json/values.d.ts +0 -0
  247. /package/dist/types/flow-extension-runner/src/{v2/params → params}/method-params.d.ts +0 -0
  248. /package/dist/types/flow-extension-runner/src/{v2/params → params}/params.d.ts +0 -0
  249. /package/dist/types/flow-extension-runner/src/{v2/params → params}/schema/assert-object-schema.d.ts +0 -0
  250. /package/dist/types/flow-extension-runner/src/{v2/params → params}/schema/assert-supported-schema.d.ts +0 -0
  251. /package/dist/types/flow-extension-runner/src/{v2/params → params}/schema/coerce.d.ts +0 -0
  252. /package/dist/types/flow-extension-runner/src/{v2/params → params}/schema/dates.d.ts +0 -0
  253. /package/dist/types/flow-extension-runner/src/{v2/params → params}/schema/dictionary-binding.d.ts +0 -0
  254. /package/dist/types/flow-extension-runner/src/{v2/params → params}/schema/labels.d.ts +0 -0
  255. /package/dist/types/flow-extension-runner/src/{v2/params → params}/widget-types.d.ts +0 -0
  256. /package/dist/types/flow-extension-runner/src/{v2/path.d.ts → path.d.ts} +0 -0
  257. /package/dist/types/flow-extension-runner/src/{v2/polling-triggers → polling-triggers}/mechanisms.d.ts +0 -0
  258. /package/dist/types/flow-extension-runner/src/{v2/polling-triggers → polling-triggers}/method-names.d.ts +0 -0
  259. /package/dist/types/flow-extension-runner/src/{v2/polling-triggers → polling-triggers}/polling-triggers.d.ts +0 -0
  260. /package/dist/types/flow-extension-runner/src/{v2/polling-triggers → polling-triggers}/system-params.d.ts +0 -0
  261. /package/dist/types/flow-extension-runner/src/{v2/polling-triggers → polling-triggers}/trigger-method.d.ts +0 -0
  262. /package/dist/types/flow-extension-runner/src/{v2/polling-triggers → polling-triggers}/types.d.ts +0 -0
  263. /package/dist/types/flow-extension-runner/src/{v2/realtime-triggers → realtime-triggers}/method-names.d.ts +0 -0
  264. /package/dist/types/flow-extension-runner/src/{v2/realtime-triggers → realtime-triggers}/realtime-setup.d.ts +0 -0
  265. /package/dist/types/flow-extension-runner/src/{v2/realtime-triggers → realtime-triggers}/system-params.d.ts +0 -0
  266. /package/dist/types/flow-extension-runner/src/{v2/realtime-triggers → realtime-triggers}/trigger-method.d.ts +0 -0
  267. /package/dist/types/flow-extension-runner/src/{v2/realtime-triggers → realtime-triggers}/types.d.ts +0 -0
  268. /package/dist/types/flow-extension-runner/src/{v2/realtime-triggers → realtime-triggers}/verify.d.ts +0 -0
  269. /package/dist/types/flow-extension-runner/src/{v2/result.d.ts → result.d.ts} +0 -0
  270. /package/dist/types/flow-extension-runner/src/{v2/system-method.d.ts → system-method.d.ts} +0 -0
  271. /package/runtime/types/flow-extension-runner/src/{v2/actions → actions}/action-method.d.ts +0 -0
  272. /package/runtime/types/flow-extension-runner/src/{common/context-files.d.ts → context/files.d.ts} +0 -0
  273. /package/runtime/types/flow-extension-runner/src/{v2/context → context}/logger.d.ts +0 -0
  274. /package/runtime/types/flow-extension-runner/src/{v2/context → context}/method-input.d.ts +0 -0
  275. /package/runtime/types/flow-extension-runner/src/{v2/context → context}/proxies.d.ts +0 -0
  276. /package/runtime/types/flow-extension-runner/src/{v2/create-extension.d.ts → create-extension.d.ts} +0 -0
  277. /package/runtime/types/flow-extension-runner/src/{v2/crypto.d.ts → crypto.d.ts} +0 -0
  278. /package/runtime/types/flow-extension-runner/src/{v2/dictionaries → dictionaries}/dictionary-method.d.ts +0 -0
  279. /package/runtime/types/flow-extension-runner/src/{v2/dictionaries → dictionaries}/payload-schema.d.ts +0 -0
  280. /package/runtime/types/flow-extension-runner/src/{v2/loaders → loaders}/loader-method.d.ts +0 -0
  281. /package/runtime/types/flow-extension-runner/src/{v2/loaders → loaders}/loader-owner.d.ts +0 -0
  282. /package/runtime/types/flow-extension-runner/src/{v2/loaders → loaders}/payload-schema.d.ts +0 -0
  283. /package/runtime/types/flow-extension-runner/src/{v2/method.d.ts → method.d.ts} +0 -0
  284. /package/runtime/types/flow-extension-runner/src/{v2/model → model}/method-model.d.ts +0 -0
  285. /package/runtime/types/flow-extension-runner/src/{v2/oauth → oauth}/method-names.d.ts +0 -0
  286. /package/runtime/types/flow-extension-runner/src/{v2/oauth → oauth}/oauth2.d.ts +0 -0
  287. /package/runtime/types/flow-extension-runner/src/{v2/oauth → oauth}/system-params.d.ts +0 -0
  288. /package/runtime/types/flow-extension-runner/src/{v2/oauth → oauth}/types.d.ts +0 -0
  289. /package/runtime/types/flow-extension-runner/src/{common/constants.d.ts → params/config-types.d.ts} +0 -0
  290. /package/{dist/types/flow-extension-runner/src/v2 → runtime/types/flow-extension-runner/src}/params/files-options.d.ts +0 -0
  291. /package/runtime/types/flow-extension-runner/src/{v2/params → params}/json/checks.d.ts +0 -0
  292. /package/runtime/types/flow-extension-runner/src/{v2/params → params}/json/decode.d.ts +0 -0
  293. /package/runtime/types/flow-extension-runner/src/{v2/params → params}/json/encode.d.ts +0 -0
  294. /package/runtime/types/flow-extension-runner/src/{v2/params → params}/json/values.d.ts +0 -0
  295. /package/runtime/types/flow-extension-runner/src/{v2/params → params}/method-params.d.ts +0 -0
  296. /package/runtime/types/flow-extension-runner/src/{v2/params → params}/params.d.ts +0 -0
  297. /package/runtime/types/flow-extension-runner/src/{v2/params → params}/schema/assert-object-schema.d.ts +0 -0
  298. /package/runtime/types/flow-extension-runner/src/{v2/params → params}/schema/assert-supported-schema.d.ts +0 -0
  299. /package/runtime/types/flow-extension-runner/src/{v2/params → params}/schema/coerce.d.ts +0 -0
  300. /package/runtime/types/flow-extension-runner/src/{v2/params → params}/schema/dates.d.ts +0 -0
  301. /package/runtime/types/flow-extension-runner/src/{v2/params → params}/schema/dictionary-binding.d.ts +0 -0
  302. /package/runtime/types/flow-extension-runner/src/{v2/params → params}/schema/labels.d.ts +0 -0
  303. /package/runtime/types/flow-extension-runner/src/{v2/params → params}/widget-types.d.ts +0 -0
  304. /package/runtime/types/flow-extension-runner/src/{v2/path.d.ts → path.d.ts} +0 -0
  305. /package/runtime/types/flow-extension-runner/src/{v2/polling-triggers → polling-triggers}/mechanisms.d.ts +0 -0
  306. /package/runtime/types/flow-extension-runner/src/{v2/polling-triggers → polling-triggers}/method-names.d.ts +0 -0
  307. /package/runtime/types/flow-extension-runner/src/{v2/polling-triggers → polling-triggers}/polling-triggers.d.ts +0 -0
  308. /package/runtime/types/flow-extension-runner/src/{v2/polling-triggers → polling-triggers}/system-params.d.ts +0 -0
  309. /package/runtime/types/flow-extension-runner/src/{v2/polling-triggers → polling-triggers}/trigger-method.d.ts +0 -0
  310. /package/runtime/types/flow-extension-runner/src/{v2/polling-triggers → polling-triggers}/types.d.ts +0 -0
  311. /package/runtime/types/flow-extension-runner/src/{v2/realtime-triggers → realtime-triggers}/method-names.d.ts +0 -0
  312. /package/runtime/types/flow-extension-runner/src/{v2/realtime-triggers → realtime-triggers}/realtime-setup.d.ts +0 -0
  313. /package/runtime/types/flow-extension-runner/src/{v2/realtime-triggers → realtime-triggers}/system-params.d.ts +0 -0
  314. /package/runtime/types/flow-extension-runner/src/{v2/realtime-triggers → realtime-triggers}/trigger-method.d.ts +0 -0
  315. /package/runtime/types/flow-extension-runner/src/{v2/realtime-triggers → realtime-triggers}/types.d.ts +0 -0
  316. /package/runtime/types/flow-extension-runner/src/{v2/realtime-triggers → realtime-triggers}/verify.d.ts +0 -0
  317. /package/runtime/types/flow-extension-runner/src/{v2/result.d.ts → result.d.ts} +0 -0
  318. /package/runtime/types/flow-extension-runner/src/{v2/system-method.d.ts → system-method.d.ts} +0 -0
package/dist/index.js CHANGED
@@ -8881,11 +8881,11 @@ var require_mime_types = __commonJS({
8881
8881
  }
8882
8882
  return exts[0];
8883
8883
  }
8884
- function lookup(path19) {
8885
- if (!path19 || typeof path19 !== "string") {
8884
+ function lookup(path18) {
8885
+ if (!path18 || typeof path18 !== "string") {
8886
8886
  return false;
8887
8887
  }
8888
- var extension2 = extname("x." + path19).toLowerCase().substr(1);
8888
+ var extension2 = extname("x." + path18).toLowerCase().substr(1);
8889
8889
  if (!extension2) {
8890
8890
  return false;
8891
8891
  }
@@ -10048,11 +10048,11 @@ var require_form_data = __commonJS({
10048
10048
  "use strict";
10049
10049
  var CombinedStream = require_combined_stream();
10050
10050
  var util = require("util");
10051
- var path19 = require("path");
10051
+ var path18 = require("path");
10052
10052
  var http2 = require("http");
10053
10053
  var https = require("https");
10054
10054
  var parseUrl = require("url").parse;
10055
- var fs18 = require("fs");
10055
+ var fs17 = require("fs");
10056
10056
  var crypto3 = require("crypto");
10057
10057
  var mime = require_mime_types();
10058
10058
  var asynckit = require_asynckit();
@@ -10122,7 +10122,7 @@ var require_form_data = __commonJS({
10122
10122
  if (value.end != null && value.end !== Infinity && value.start != null) {
10123
10123
  callback(null, value.end + 1 - (value.start ? value.start : 0));
10124
10124
  } else {
10125
- fs18.stat(value.path, function(err, stat) {
10125
+ fs17.stat(value.path, function(err, stat) {
10126
10126
  var fileSize;
10127
10127
  if (err) {
10128
10128
  callback(err);
@@ -10180,11 +10180,11 @@ var require_form_data = __commonJS({
10180
10180
  FormData2.prototype._getContentDisposition = function(value, options) {
10181
10181
  var filename, contentDisposition;
10182
10182
  if (typeof options.filepath === "string") {
10183
- filename = path19.normalize(options.filepath).replace(/\\/g, "/");
10183
+ filename = path18.normalize(options.filepath).replace(/\\/g, "/");
10184
10184
  } else if (options.filename || value && (value.name || value.path)) {
10185
- filename = path19.basename(options.filename || value && (value.name || value.path));
10185
+ filename = path18.basename(options.filename || value && (value.name || value.path));
10186
10186
  } else if (value && value.readable && hasOwn(value, "httpVersion")) {
10187
- filename = path19.basename(value.client._httpMessage.path || "");
10187
+ filename = path18.basename(value.client._httpMessage.path || "");
10188
10188
  }
10189
10189
  if (filename) {
10190
10190
  contentDisposition = 'filename="' + escapeHeaderParam(filename) + '"';
@@ -10435,15 +10435,15 @@ var require_utils = __commonJS({
10435
10435
  }
10436
10436
  return uriComponent;
10437
10437
  }
10438
- function encodePath(path19) {
10439
- return path19.split("/").map(ensureComponentEncoding).join("/");
10438
+ function encodePath(path18) {
10439
+ return path18.split("/").map(ensureComponentEncoding).join("/");
10440
10440
  }
10441
- function ensureEncoding(path19) {
10441
+ function ensureEncoding(path18) {
10442
10442
  try {
10443
- var url = new URL(path19);
10444
- return url.origin + encodePath(normalizeTrailingSlashInPath(path19, url)) + url.search;
10443
+ var url = new URL(path18);
10444
+ return url.origin + encodePath(normalizeTrailingSlashInPath(path18, url)) + url.search;
10445
10445
  } catch (_unused) {
10446
- return encodePath(path19);
10446
+ return encodePath(path18);
10447
10447
  }
10448
10448
  }
10449
10449
  function normalizeTrailingSlashInPath(originPath, _ref) {
@@ -10798,15 +10798,15 @@ var require_client_node = __commonJS({
10798
10798
  exports2.sendNodeAPIRequest = sendNodeAPIRequest;
10799
10799
  var _utils = require_utils();
10800
10800
  var _error = require_error();
10801
- function sendNodeAPIRequest(path19, method, headers, body, encoding, timeout, withCredentials, tlsOptions) {
10801
+ function sendNodeAPIRequest(path18, method, headers, body, encoding, timeout, withCredentials, tlsOptions) {
10802
10802
  return new Promise(function(resolve, reject) {
10803
- var u = require("url").parse(path19);
10803
+ var u = require("url").parse(path18);
10804
10804
  var form = (0, _utils.isFormData)(body) && body;
10805
10805
  var https = u.protocol === "https:";
10806
10806
  var options = {
10807
10807
  host: u.hostname,
10808
10808
  port: u.port || (https ? 443 : 80),
10809
- path: (0, _utils.normalizeTrailingSlashInPath)(path19, u) + (u.search || ""),
10809
+ path: (0, _utils.normalizeTrailingSlashInPath)(path18, u) + (u.search || ""),
10810
10810
  method,
10811
10811
  headers,
10812
10812
  timeout
@@ -11214,12 +11214,12 @@ var require_request = __commonJS({
11214
11214
  var Request = exports2.Request = /* @__PURE__ */ (function(_EventEmitter) {
11215
11215
  _inherits(Request2, _EventEmitter);
11216
11216
  var _super = _createSuper(Request2);
11217
- function Request2(path19, method, body) {
11217
+ function Request2(path18, method, body) {
11218
11218
  var _this;
11219
11219
  _classCallCheck(this, Request2);
11220
11220
  _this = _super.call(this);
11221
11221
  _this.method = method;
11222
- _this.path = (0, _utils.ensureEncoding)(path19);
11222
+ _this.path = (0, _utils.ensureEncoding)(path18);
11223
11223
  _this.body = body;
11224
11224
  _this.unwrap = true;
11225
11225
  _this.raw = false;
@@ -11448,10 +11448,10 @@ var require_request = __commonJS({
11448
11448
  value: function send(body) {
11449
11449
  var _this2 = this;
11450
11450
  this.emit(REQUEST_EVENT, this);
11451
- var path19 = this.path;
11451
+ var path18 = this.path;
11452
11452
  var queryString = qs.stringify(this.queryParams);
11453
11453
  if (queryString) {
11454
- path19 += "?" + queryString;
11454
+ path18 += "?" + queryString;
11455
11455
  }
11456
11456
  if (!(0, _utils.isFormData)(body) && (0, _utils.isWebFormData)(body)) {
11457
11457
  body = toRequestFormData(body);
@@ -11468,11 +11468,11 @@ var require_request = __commonJS({
11468
11468
  return _this2.unwrap ? res.body : res;
11469
11469
  };
11470
11470
  if (Request2.verbose) {
11471
- console.log(this.method.toUpperCase(), decodeURIComponent(path19), body, this.headers);
11471
+ console.log(this.method.toUpperCase(), decodeURIComponent(path18), body, this.headers);
11472
11472
  }
11473
11473
  var withCredentials = typeof this.withCredentials === "boolean" ? this.withCredentials : Request2.withCredentials;
11474
11474
  var syncError = new Error();
11475
- var request = Request2.send(path19, this.method.toUpperCase(), this.headers, body, this.encoding, this.timeout, withCredentials, this.tlsOptions).then(function(res) {
11475
+ var request = Request2.send(path18, this.method.toUpperCase(), this.headers, body, this.encoding, this.timeout, withCredentials, this.tlsOptions).then(function(res) {
11476
11476
  return parseBody(res, _this2.raw);
11477
11477
  }).then(function(res) {
11478
11478
  return ensureRawBody(res, _this2.raw);
@@ -11581,14 +11581,14 @@ var require_client_browser = __commonJS({
11581
11581
  });
11582
11582
  exports2.sendXmlHttpRequest = sendXmlHttpRequest;
11583
11583
  var _request2 = require_request();
11584
- function sendXmlHttpRequest(path19, method, headers, body, encoding, timeout, withCredentials) {
11584
+ function sendXmlHttpRequest(path18, method, headers, body, encoding, timeout, withCredentials) {
11585
11585
  return new Promise(function sendRequest(resolve, reject) {
11586
11586
  var request = new _request2.Request.XMLHttpRequest();
11587
11587
  request.timeout = timeout;
11588
11588
  if (!encoding) {
11589
11589
  request.responseType = "arraybuffer";
11590
11590
  }
11591
- request.open(method.toUpperCase(), path19, true);
11591
+ request.open(method.toUpperCase(), path18, true);
11592
11592
  if (typeof withCredentials === "boolean") {
11593
11593
  request.withCredentials = withCredentials;
11594
11594
  }
@@ -11661,16 +11661,16 @@ var require_lib = __commonJS({
11661
11661
  }
11662
11662
  });
11663
11663
  _request.Request.XMLHttpRequest = typeof XMLHttpRequest !== "undefined" ? XMLHttpRequest : void 0;
11664
- _request.Request.send = function(path19, method, headers, body, encoding, timeout, withCredentials, tlsOptions) {
11664
+ _request.Request.send = function(path18, method, headers, body, encoding, timeout, withCredentials, tlsOptions) {
11665
11665
  var sender = typeof _request.Request.XMLHttpRequest !== "undefined" ? _clientBrowser.sendXmlHttpRequest : _clientNode.sendNodeAPIRequest;
11666
- return sender(path19, method, headers, body, encoding, timeout, withCredentials, tlsOptions);
11666
+ return sender(path18, method, headers, body, encoding, timeout, withCredentials, tlsOptions);
11667
11667
  };
11668
11668
  _request.Request.verbose = false;
11669
11669
  _request.Request.withCredentials = false;
11670
11670
  _request.Request.methods = ["get", "post", "put", "patch", "delete", "head", "options"];
11671
11671
  _request.Request.methods.forEach(function(method) {
11672
- _request.Request[method] = function(path19, body) {
11673
- return new _request.Request(path19, method, body);
11672
+ _request.Request[method] = function(path18, body) {
11673
+ return new _request.Request(path18, method, body);
11674
11674
  };
11675
11675
  });
11676
11676
  exports2 = module2.exports = _request.Request;
@@ -12011,25 +12011,25 @@ var require_utils2 = __commonJS({
12011
12011
  }
12012
12012
  mkdirSync(folder);
12013
12013
  };
12014
- Utils.prototype.writeFileTo = function(path19, content, overwrite, attr) {
12014
+ Utils.prototype.writeFileTo = function(path18, content, overwrite, attr) {
12015
12015
  const self = this;
12016
- if (self.fs.existsSync(path19)) {
12016
+ if (self.fs.existsSync(path18)) {
12017
12017
  if (!overwrite) return false;
12018
- var stat = self.fs.statSync(path19);
12018
+ var stat = self.fs.statSync(path18);
12019
12019
  if (stat.isDirectory()) {
12020
12020
  return false;
12021
12021
  }
12022
12022
  }
12023
- var folder = pth.dirname(path19);
12023
+ var folder = pth.dirname(path18);
12024
12024
  if (!self.fs.existsSync(folder)) {
12025
12025
  self.makeDir(folder);
12026
12026
  }
12027
12027
  var fd;
12028
12028
  try {
12029
- fd = self.fs.openSync(path19, "w", 438);
12029
+ fd = self.fs.openSync(path18, "w", 438);
12030
12030
  } catch (e) {
12031
- self.fs.chmodSync(path19, 438);
12032
- fd = self.fs.openSync(path19, "w", 438);
12031
+ self.fs.chmodSync(path18, 438);
12032
+ fd = self.fs.openSync(path18, "w", 438);
12033
12033
  }
12034
12034
  if (fd) {
12035
12035
  try {
@@ -12038,22 +12038,22 @@ var require_utils2 = __commonJS({
12038
12038
  self.fs.closeSync(fd);
12039
12039
  }
12040
12040
  }
12041
- self.fs.chmodSync(path19, attr || 438);
12041
+ self.fs.chmodSync(path18, attr || 438);
12042
12042
  return true;
12043
12043
  };
12044
- Utils.prototype.writeFileToAsync = function(path19, content, overwrite, attr, callback) {
12044
+ Utils.prototype.writeFileToAsync = function(path18, content, overwrite, attr, callback) {
12045
12045
  if (typeof attr === "function") {
12046
12046
  callback = attr;
12047
12047
  attr = void 0;
12048
12048
  }
12049
12049
  const self = this;
12050
- self.fs.exists(path19, function(exist) {
12050
+ self.fs.exists(path18, function(exist) {
12051
12051
  if (exist && !overwrite) return callback(false);
12052
- self.fs.stat(path19, function(err, stat) {
12052
+ self.fs.stat(path18, function(err, stat) {
12053
12053
  if (exist && stat && stat.isDirectory()) {
12054
12054
  return callback(false);
12055
12055
  }
12056
- var folder = pth.dirname(path19);
12056
+ var folder = pth.dirname(path18);
12057
12057
  self.fs.exists(folder, function(exists) {
12058
12058
  if (!exists) {
12059
12059
  try {
@@ -12066,16 +12066,16 @@ var require_utils2 = __commonJS({
12066
12066
  self.fs.write(fd, content, 0, content.length, 0, function(writeErr) {
12067
12067
  self.fs.close(fd, function() {
12068
12068
  if (writeErr) return callback(false);
12069
- self.fs.chmod(path19, attr || 438, function() {
12069
+ self.fs.chmod(path18, attr || 438, function() {
12070
12070
  callback(true);
12071
12071
  });
12072
12072
  });
12073
12073
  });
12074
12074
  };
12075
- self.fs.open(path19, "w", 438, function(err2, fd) {
12075
+ self.fs.open(path18, "w", 438, function(err2, fd) {
12076
12076
  if (err2) {
12077
- self.fs.chmod(path19, 438, function() {
12078
- self.fs.open(path19, "w", 438, function(retryErr, fd2) {
12077
+ self.fs.chmod(path18, 438, function() {
12078
+ self.fs.open(path18, "w", 438, function(retryErr, fd2) {
12079
12079
  if (retryErr || !fd2) return callback(false);
12080
12080
  writeToFd(fd2);
12081
12081
  });
@@ -12111,10 +12111,10 @@ var require_utils2 = __commonJS({
12111
12111
  if (stat.isSymbolicLink()) throw Errors.FILE_IN_THE_WAY(`"${cur}"`);
12112
12112
  }
12113
12113
  };
12114
- Utils.prototype.findFiles = function(path19) {
12114
+ Utils.prototype.findFiles = function(path18) {
12115
12115
  const self = this;
12116
12116
  const canLstat = typeof self.fs.lstatSync === "function";
12117
- const rootReal = self.fs.realpathSync(path19);
12117
+ const rootReal = self.fs.realpathSync(path18);
12118
12118
  function escapesRoot(p) {
12119
12119
  if (!canLstat) return false;
12120
12120
  if (!self.fs.lstatSync(p).isSymbolicLink()) return false;
@@ -12133,23 +12133,23 @@ var require_utils2 = __commonJS({
12133
12133
  }
12134
12134
  let files = [];
12135
12135
  self.fs.readdirSync(dir).forEach(function(file) {
12136
- const path20 = pth.join(dir, file);
12137
- if (escapesRoot(path20)) return;
12138
- const stat = self.fs.statSync(path20);
12139
- if (!pattern || pattern.test(path20)) {
12140
- files.push(pth.normalize(path20) + (stat.isDirectory() ? self.sep : ""));
12136
+ const path19 = pth.join(dir, file);
12137
+ if (escapesRoot(path19)) return;
12138
+ const stat = self.fs.statSync(path19);
12139
+ if (!pattern || pattern.test(path19)) {
12140
+ files.push(pth.normalize(path19) + (stat.isDirectory() ? self.sep : ""));
12141
12141
  }
12142
12142
  if (stat.isDirectory() && recursive) {
12143
- const realDir = self.fs.realpathSync(path20);
12143
+ const realDir = self.fs.realpathSync(path19);
12144
12144
  if (!visited.has(realDir)) {
12145
12145
  visited.add(realDir);
12146
- files = files.concat(findSync(path20, pattern, recursive, visited));
12146
+ files = files.concat(findSync(path19, pattern, recursive, visited));
12147
12147
  }
12148
12148
  }
12149
12149
  });
12150
12150
  return files;
12151
12151
  }
12152
- return findSync(path19, void 0, true, /* @__PURE__ */ new Set([rootReal]));
12152
+ return findSync(path18, void 0, true, /* @__PURE__ */ new Set([rootReal]));
12153
12153
  };
12154
12154
  Utils.prototype.findFilesAsync = function(dir, cb) {
12155
12155
  const self = this;
@@ -12246,14 +12246,14 @@ var require_utils2 = __commonJS({
12246
12246
  return "UNSUPPORTED (" + method + ")";
12247
12247
  }
12248
12248
  };
12249
- Utils.canonical = function(path19) {
12250
- if (!path19) return "";
12251
- const safeSuffix = pth.posix.normalize("/" + path19.split("\\").join("/"));
12249
+ Utils.canonical = function(path18) {
12250
+ if (!path18) return "";
12251
+ const safeSuffix = pth.posix.normalize("/" + path18.split("\\").join("/"));
12252
12252
  return pth.join(".", safeSuffix);
12253
12253
  };
12254
- Utils.zipnamefix = function(path19) {
12255
- if (!path19) return "";
12256
- const safeSuffix = pth.posix.normalize("/" + path19.split("\\").join("/"));
12254
+ Utils.zipnamefix = function(path18) {
12255
+ if (!path18) return "";
12256
+ const safeSuffix = pth.posix.normalize("/" + path18.split("\\").join("/"));
12257
12257
  return pth.posix.join(".", safeSuffix);
12258
12258
  };
12259
12259
  Utils.findLast = function(arr, callback) {
@@ -12270,9 +12270,9 @@ var require_utils2 = __commonJS({
12270
12270
  prefix = pth.resolve(pth.normalize(prefix));
12271
12271
  var parts = name.split("/");
12272
12272
  for (var i = 0, l = parts.length; i < l; i++) {
12273
- var path19 = pth.normalize(pth.join(prefix, parts.slice(i, l).join(pth.sep)));
12274
- if (path19 === prefix || path19.startsWith(prefix + pth.sep)) {
12275
- return path19;
12273
+ var path18 = pth.normalize(pth.join(prefix, parts.slice(i, l).join(pth.sep)));
12274
+ if (path18 === prefix || path18.startsWith(prefix + pth.sep)) {
12275
+ return path18;
12276
12276
  }
12277
12277
  }
12278
12278
  return pth.normalize(pth.join(prefix, pth.basename(name)));
@@ -12322,8 +12322,8 @@ var require_utils2 = __commonJS({
12322
12322
  var require_fattr = __commonJS({
12323
12323
  "node_modules/adm-zip/util/fattr.js"(exports2, module2) {
12324
12324
  var pth = require("path");
12325
- module2.exports = function(path19, { fs: fs18 }) {
12326
- var _path = path19 || "", _obj = newAttr(), _stat = null;
12325
+ module2.exports = function(path18, { fs: fs17 }) {
12326
+ var _path = path18 || "", _obj = newAttr(), _stat = null;
12327
12327
  function newAttr() {
12328
12328
  return {
12329
12329
  directory: false,
@@ -12334,8 +12334,8 @@ var require_fattr = __commonJS({
12334
12334
  atime: 0
12335
12335
  };
12336
12336
  }
12337
- if (_path && fs18.existsSync(_path)) {
12338
- _stat = fs18.statSync(_path);
12337
+ if (_path && fs17.existsSync(_path)) {
12338
+ _stat = fs17.statSync(_path);
12339
12339
  _obj.directory = _stat.isDirectory();
12340
12340
  _obj.mtime = _stat.mtime;
12341
12341
  _obj.atime = _stat.atime;
@@ -14790,8 +14790,8 @@ var HttpError = class extends CliError {
14790
14790
  };
14791
14791
 
14792
14792
  // src/operations/deploy/index.ts
14793
- var import_fs7 = __toESM(require("fs"));
14794
- var import_path11 = __toESM(require("path"));
14793
+ var import_fs6 = __toESM(require("fs"));
14794
+ var import_path10 = __toESM(require("path"));
14795
14795
 
14796
14796
  // src/api/console-client.ts
14797
14797
  function authorizeUrl({ serverUrl, callbackUrl, workspaceId }) {
@@ -14990,8 +14990,8 @@ function emitter(options) {
14990
14990
  }
14991
14991
 
14992
14992
  // src/operations/deploy/discover-services.ts
14993
- var import_fs4 = __toESM(require("fs"));
14994
- var import_path7 = __toESM(require("path"));
14993
+ var import_fs3 = __toESM(require("fs"));
14994
+ var import_path6 = __toESM(require("path"));
14995
14995
 
14996
14996
  // ../../flow-extension-runner/src/namespace.ts
14997
14997
  var import_backendless_request2 = __toESM(require_lib());
@@ -15036,9 +15036,9 @@ var FlowExtensionErrorCodes = {
15036
15036
  DUPLICATE_ITEM_ID: "FR_EXT_DUPLICATE_ITEM_ID",
15037
15037
  // No v2 extension registered for the given serviceId after requiring the module.
15038
15038
  EXTENSION_NOT_REGISTERED: "FR_EXT_NOT_REGISTERED",
15039
- // A declared config value is missing or the wrong shape (see v2/schema/normalize).
15039
+ // A declared config value is missing or the wrong shape (see params/schema/normalize).
15040
15040
  INVALID_CONFIG: "FR_EXT_INVALID_CONFIG",
15041
- // A schema slot that must be a z.object was declared as something else (see v2/schema/assert-object-schema).
15041
+ // A schema slot that must be a z.object was declared as something else (see params/schema/assert-object-schema).
15042
15042
  INVALID_SCHEMA: "FR_EXT_INVALID_SCHEMA",
15043
15043
  // A polling trigger declared zero or multiple mechanisms, or is missing its fetch.
15044
15044
  INVALID_TRIGGER_CONFIG: "FR_EXT_INVALID_TRIGGER_CONFIG",
@@ -15133,7 +15133,7 @@ var InvalidConfigError = class extends FlowExtensionError {
15133
15133
  };
15134
15134
  var InvalidSchemaError = class extends FlowExtensionError {
15135
15135
  // `message` is composed by the guard, which knows how to describe what was received and what to do
15136
- // about it (see v2/schema/assert-object-schema.ts).
15136
+ // about it (see params/schema/assert-object-schema.ts).
15137
15137
  constructor(message, details) {
15138
15138
  super(FlowExtensionErrorCodes.INVALID_SCHEMA, 400, message, details);
15139
15139
  }
@@ -15185,12 +15185,12 @@ var InvalidDictionaryOutputScheme = class extends FlowExtensionError {
15185
15185
  }
15186
15186
  };
15187
15187
 
15188
- // ../../flow-extension-runner/src/v2/loaders/loader-owner.ts
15188
+ // ../../flow-extension-runner/src/loaders/loader-owner.ts
15189
15189
  var sampleResultLoaderName = (ownerId) => `${ownerId}_SampleResultLoader`;
15190
15190
  var dynamicParamsLoaderName = (ownerId) => `${ownerId}_DynamicParams`;
15191
15191
  var dynamicPropsLoaderName = (ownerId, field) => `${ownerId}_${field}_DynamicProps`;
15192
15192
 
15193
- // ../../flow-extension-runner/src/v2/params/schema/assert-object-schema.ts
15193
+ // ../../flow-extension-runner/src/params/schema/assert-object-schema.ts
15194
15194
  var WRAPPERS = /* @__PURE__ */ new Set(["optional", "nullable", "nullish", "default", "prefault"]);
15195
15195
  var typeOf = (value) => value?._zod?.def?.type;
15196
15196
  function describe(value) {
@@ -15239,40 +15239,7 @@ function assertObjectSchema(scheme, source) {
15239
15239
  );
15240
15240
  }
15241
15241
 
15242
- // ../../flow-extension-runner/src/v2/params/schema/dictionary-binding.ts
15243
- var DictionaryScope = class _DictionaryScope {
15244
- constructor(top, visible) {
15245
- this.top = top;
15246
- this.visible = visible;
15247
- }
15248
- static {
15249
- this.ROOT = new _DictionaryScope(null, /* @__PURE__ */ new Set());
15250
- }
15251
- enter(names) {
15252
- if (!this.top) {
15253
- const top = new Set(names);
15254
- return new _DictionaryScope(top, top);
15255
- }
15256
- return new _DictionaryScope(this.top, /* @__PURE__ */ new Set([...this.top, ...names]));
15257
- }
15258
- };
15259
- function resolveDependsOn(binding, scope2) {
15260
- const aliases = binding.criteriaAliases ?? {};
15261
- let clash;
15262
- const dependsOn = binding.dependsOn.map((key) => {
15263
- const visible = [key, ...aliases[key] ?? []].filter((name) => scope2.visible.has(name));
15264
- if (visible.length > 1 && !clash) {
15265
- clash = { key, names: visible };
15266
- }
15267
- return visible[0] ?? key;
15268
- });
15269
- return clash ? { dependsOn, clash } : { dependsOn };
15270
- }
15271
- function publishedBinding(binding, scope2) {
15272
- return { id: binding.id, dependsOn: resolveDependsOn(binding, scope2).dependsOn };
15273
- }
15274
-
15275
- // ../../flow-extension-runner/src/v2/params/widget-types.ts
15242
+ // ../../flow-extension-runner/src/params/widget-types.ts
15276
15243
  var FlowExtensionParamGroupTypes = {
15277
15244
  FILE_UPLOAD_OPTIONS: "FILE_UPLOAD_OPTIONS",
15278
15245
  FILE_LIST_OPTIONS: "FILE_LIST_OPTIONS",
@@ -15290,14 +15257,16 @@ var FlowExtensionParamWidgetTypes = {
15290
15257
  ...FlowExtensionParamGroupTypes,
15291
15258
  // legacy — no zod declaration produces these. They reach the console only from a legacy JSDoc-format
15292
15259
  // service, which writes `uiComponent` by hand. Kept because the console still renders them for an
15293
- // already-installed extension.
15260
+ // already-installed extension. `DATE_TIME_PICKER` / `TIME_PICKER` are also published, with
15261
+ // `valueKind: 'string'` and `format`, by `z.iso.datetime({ local: true })` / `z.iso.time()` (FR-3920) —
15262
+ // without `valueKind` they are the legacy tokens, storing epoch millis.
15294
15263
  NUMERIC: "NUMERIC",
15295
15264
  CHECKBOX: "CHECKBOX",
15296
15265
  DATE_TIME_PICKER: "DATE_TIME_PICKER",
15297
15266
  TIME_PICKER: "TIME_PICKER"
15298
15267
  };
15299
15268
 
15300
- // ../../flow-extension-runner/src/v2/params/schema/introspect.ts
15269
+ // ../../flow-extension-runner/src/params/schema/introspect.ts
15301
15270
  var OPTIONAL_WRAPPERS = /* @__PURE__ */ new Set(["optional", "nullable", "nullish"]);
15302
15271
  var DEFAULT_WRAPPERS = /* @__PURE__ */ new Set(["default", "prefault"]);
15303
15272
  var TRANSPARENT_WRAPPERS = /* @__PURE__ */ new Set(["readonly", "pipe", "lazy"]);
@@ -15383,6 +15352,12 @@ function literalType(core) {
15383
15352
  const [kind] = [...kinds];
15384
15353
  return kinds.size === 1 && LITERAL_KINDS.has(kind) ? kind : void 0;
15385
15354
  }
15355
+ function hasBlankBranch(ins) {
15356
+ return !!ins.branches?.some((branch) => {
15357
+ const { core, coreType } = inspect(branch);
15358
+ return coreType === "literal" && (core._zod?.def?.values ?? []).includes("");
15359
+ });
15360
+ }
15386
15361
  function deriveWidget(ins) {
15387
15362
  const { coreType, core, meta } = ins;
15388
15363
  switch (coreType) {
@@ -15390,7 +15365,7 @@ function deriveWidget(ins) {
15390
15365
  if (meta.frWidget === FlowExtensionParamWidgetTypes.MULTI_LINE_TEXT) {
15391
15366
  return { paramType: "STRING", uiComponent: { type: FlowExtensionParamWidgetTypes.MULTI_LINE_TEXT } };
15392
15367
  }
15393
- return { paramType: "STRING" };
15368
+ return dateStringWidget(ins) ?? { paramType: "STRING" };
15394
15369
  case "number":
15395
15370
  case "bigint":
15396
15371
  return { paramType: "NUMBER", uiComponent: { type: FlowExtensionParamWidgetTypes.NUMERIC_STEPPER } };
@@ -15433,12 +15408,400 @@ function deriveWidget(ins) {
15433
15408
  return { paramType: "STRING" };
15434
15409
  }
15435
15410
  }
15411
+ var DATE_STRING_WIDGETS = {
15412
+ date: FlowExtensionParamWidgetTypes.DATE_PICKER,
15413
+ datetime: FlowExtensionParamWidgetTypes.DATE_TIME_PICKER,
15414
+ time: FlowExtensionParamWidgetTypes.TIME_PICKER
15415
+ };
15416
+ function dateStringWidget(ins) {
15417
+ const kind = dateStringKind(ins);
15418
+ return kind ? { paramType: "STRING", uiComponent: { type: DATE_STRING_WIDGETS[kind], valueKind: "string", format: patternOf(ins, kind) } } : void 0;
15419
+ }
15436
15420
  function shapeEntries(schema) {
15437
15421
  const shape = schema?.shape;
15438
15422
  return shape && typeof shape === "object" ? Object.entries(shape) : [];
15439
15423
  }
15440
15424
 
15441
- // ../../flow-extension-runner/src/v2/params/schema/assert-supported-schema.ts
15425
+ // ../../flow-extension-runner/src/params/schema/date-format.ts
15426
+ var ISO_PATTERNS = {
15427
+ date: "yyyy-MM-dd",
15428
+ datetime: "yyyy-MM-dd'T'HH:mm",
15429
+ time: "HH:mm"
15430
+ };
15431
+ var DATE_STRINGS_ACCEPT_TIMESTAMPS = true;
15432
+ function dateStringKind(ins) {
15433
+ if (ins.coreType !== "string") {
15434
+ return void 0;
15435
+ }
15436
+ const def = ins.core?._zod?.def;
15437
+ if (def?.format === "date" || def?.format === "time") {
15438
+ return def.format;
15439
+ }
15440
+ return def?.format === "datetime" && def.local ? "datetime" : void 0;
15441
+ }
15442
+ var patternOf = (ins, kind) => ins.meta.frDateFormat ?? ISO_PATTERNS[kind];
15443
+ var TOKENS = ["yyyy", "yy", "MM", "M", "dd", "d", "HH", "H", "hh", "h", "mm", "ss", "a"];
15444
+ var SPEC = {
15445
+ yyyy: { part: "year", width: 4 },
15446
+ yy: { part: "year", width: 2 },
15447
+ MM: { part: "month", width: 2 },
15448
+ M: { part: "month" },
15449
+ dd: { part: "day", width: 2 },
15450
+ d: { part: "day" },
15451
+ HH: { part: "hour", width: 2 },
15452
+ H: { part: "hour" },
15453
+ hh: { part: "hour", width: 2 },
15454
+ h: { part: "hour" },
15455
+ mm: { part: "minute", width: 2 },
15456
+ ss: { part: "second", width: 2 },
15457
+ a: { part: "meridiem" }
15458
+ };
15459
+ var DATE_PARTS = /* @__PURE__ */ new Set(["year", "month", "day"]);
15460
+ var TIME_PARTS = /* @__PURE__ */ new Set(["hour", "minute", "second", "meridiem"]);
15461
+ var DateFormatError = class extends Error {
15462
+ };
15463
+ var LOOK_ALIKES = {
15464
+ YYYY: "yyyy",
15465
+ YY: "yy",
15466
+ DD: "dd",
15467
+ D: "d",
15468
+ S: "ss",
15469
+ A: "a"
15470
+ };
15471
+ function tokenize(pattern, kind) {
15472
+ const tokens = [];
15473
+ let index = 0;
15474
+ while (index < pattern.length) {
15475
+ const char = pattern[index];
15476
+ if (char === "'") {
15477
+ const end = pattern.indexOf("'", index + 1);
15478
+ if (end < 0) {
15479
+ throw new DateFormatError("has an unclosed quote \u2014 literal text is written between two single quotes");
15480
+ }
15481
+ tokens.push({ literal: end === index + 1 ? "'" : pattern.slice(index + 1, end) });
15482
+ index = end + 1;
15483
+ continue;
15484
+ }
15485
+ if (!/[A-Za-z]/.test(char)) {
15486
+ tokens.push({ literal: char });
15487
+ index++;
15488
+ continue;
15489
+ }
15490
+ const run = /^([A-Za-z])\1*/.exec(pattern.slice(index))?.[0];
15491
+ const known = TOKENS.find((token) => run.startsWith(token) && token.length === run.length);
15492
+ if (!known) {
15493
+ const hint2 = LOOK_ALIKES[run] ? ` (did you mean \`${suggest(pattern, kind)}\`?)` : "";
15494
+ throw new DateFormatError(
15495
+ `uses \`${run}\`, which is not a supported token${hint2}. Supported: yyyy yy MM M dd d HH H hh h mm ss a, and literal text in single quotes`
15496
+ );
15497
+ }
15498
+ tokens.push({ token: known });
15499
+ index += run.length;
15500
+ }
15501
+ return tokens;
15502
+ }
15503
+ function suggest(pattern, kind) {
15504
+ let fixed = pattern;
15505
+ for (const [wrong, right] of Object.entries(LOOK_ALIKES)) {
15506
+ fixed = fixed.replace(new RegExp(`(?<![A-Za-z])${wrong}(?![A-Za-z])`, "g"), right);
15507
+ }
15508
+ if (kind === "date") {
15509
+ fixed = fixed.replace(/mm/g, "MM");
15510
+ }
15511
+ return fixed;
15512
+ }
15513
+ var parsedPatterns = /* @__PURE__ */ new Map();
15514
+ function compilePattern(pattern, kind) {
15515
+ const key = `${kind}|${pattern}`;
15516
+ const cached2 = parsedPatterns.get(key);
15517
+ if (cached2) {
15518
+ return cached2;
15519
+ }
15520
+ if (typeof pattern !== "string" || !pattern.trim()) {
15521
+ throw new DateFormatError("needs a pattern, e.g. `dd/MM/yyyy`");
15522
+ }
15523
+ const tokens = tokenize(pattern, kind);
15524
+ const names = tokens.flatMap((token) => "token" in token ? [token.token] : []);
15525
+ const parts = names.map((name) => SPEC[name].part);
15526
+ const has = (part) => parts.includes(part);
15527
+ const repeated = parts.find((part, index) => parts.indexOf(part) !== index);
15528
+ if (repeated) {
15529
+ throw new DateFormatError(`names the ${repeated === "meridiem" ? "AM/PM" : repeated} twice`);
15530
+ }
15531
+ if (kind === "date" && names.includes("mm") && !has("hour")) {
15532
+ throw new DateFormatError(`uses \`mm\`, which is minutes \u2014 did you mean \`${suggest(pattern, kind)}\`?`);
15533
+ }
15534
+ if (kind === "date" && parts.some((part) => TIME_PARTS.has(part))) {
15535
+ throw new DateFormatError("has a time of day, which a date has not \u2014 declare `z.iso.datetime({ local: true })`");
15536
+ }
15537
+ if (kind === "time" && parts.some((part) => DATE_PARTS.has(part))) {
15538
+ throw new DateFormatError("has a date, which a time has not \u2014 declare `z.iso.datetime({ local: true })`");
15539
+ }
15540
+ const missing = [
15541
+ ...kind !== "time" ? [["year", "yyyy"], ["month", "MM"], ["day", "dd"]] : [],
15542
+ ...kind !== "date" ? [["hour", "HH"], ["minute", "mm"]] : []
15543
+ ].filter(([part]) => !has(part)).map(([, token]) => `\`${token}\``);
15544
+ if (missing.length) {
15545
+ throw new DateFormatError(`is missing ${missing.join(", ")} \u2014 every part of a ${describeKind(kind)} must be in it`);
15546
+ }
15547
+ if ((names.includes("HH") || names.includes("H")) && names.includes("a")) {
15548
+ throw new DateFormatError(
15549
+ "uses a 24-hour clock (`HH` / `H`) with `a` \u2014 13:45 would be written `13:45 PM`, which cannot be read back. Use `hh` / `h` with `a`, or `HH` without it"
15550
+ );
15551
+ }
15552
+ if ((names.includes("hh") || names.includes("h")) && !names.includes("a")) {
15553
+ throw new DateFormatError(
15554
+ "uses a 12-hour clock (`hh` / `h`) without `a` \u2014 without AM/PM the value cannot be read back. Add `a`, or use `HH` for a 24-hour clock"
15555
+ );
15556
+ }
15557
+ parsedPatterns.set(key, tokens);
15558
+ return tokens;
15559
+ }
15560
+ var describeKind = (kind) => kind === "date" ? "date" : kind === "time" ? "time" : "date and time";
15561
+ var pad = (value, width) => String(value).padStart(width, "0");
15562
+ function formatParts(parts, pattern, kind) {
15563
+ return compilePattern(pattern, kind).map((token) => {
15564
+ if ("literal" in token) {
15565
+ return token.literal;
15566
+ }
15567
+ const hour = parts.hour ?? 0;
15568
+ switch (token.token) {
15569
+ case "yyyy":
15570
+ return pad(parts.year ?? 0, 4);
15571
+ case "yy":
15572
+ return pad((parts.year ?? 0) % 100, 2);
15573
+ case "MM":
15574
+ return pad(parts.month ?? 0, 2);
15575
+ case "M":
15576
+ return String(parts.month ?? 0);
15577
+ case "dd":
15578
+ return pad(parts.day ?? 0, 2);
15579
+ case "d":
15580
+ return String(parts.day ?? 0);
15581
+ case "HH":
15582
+ return pad(hour, 2);
15583
+ case "H":
15584
+ return String(hour);
15585
+ case "hh":
15586
+ return pad(hour % 12 || 12, 2);
15587
+ case "h":
15588
+ return String(hour % 12 || 12);
15589
+ case "mm":
15590
+ return pad(parts.minute ?? 0, 2);
15591
+ case "ss":
15592
+ return pad(parts.second ?? 0, 2);
15593
+ case "a":
15594
+ return hour < 12 ? "AM" : "PM";
15595
+ }
15596
+ }).join("");
15597
+ }
15598
+ var escapeRegex = (text2) => text2.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
15599
+ function parseInPattern(text2, pattern, kind) {
15600
+ const tokens = compilePattern(pattern, kind);
15601
+ const order = [];
15602
+ const source = tokens.map((token) => {
15603
+ if ("literal" in token) {
15604
+ return escapeRegex(token.literal);
15605
+ }
15606
+ order.push(token.token);
15607
+ if (token.token === "a") {
15608
+ return "(AM|PM)";
15609
+ }
15610
+ const { width } = SPEC[token.token];
15611
+ return width ? `(\\d{${width}})` : "(\\d{1,2})";
15612
+ }).join("");
15613
+ const match = new RegExp(`^${source}$`).exec(text2);
15614
+ if (!match) {
15615
+ return void 0;
15616
+ }
15617
+ const parts = {};
15618
+ let meridiem;
15619
+ order.forEach((name, index) => {
15620
+ const raw = match[index + 1];
15621
+ if (name === "a") {
15622
+ meridiem = raw;
15623
+ return;
15624
+ }
15625
+ const value = Number(raw);
15626
+ switch (name) {
15627
+ // date-fns' two-digit year rule against its reference year 2000: 00–49 → 20xx, 50–99 → 19xx.
15628
+ case "yy":
15629
+ parts.year = value < 50 ? 2e3 + value : 1900 + value;
15630
+ break;
15631
+ case "hh":
15632
+ case "h":
15633
+ parts.hour = value;
15634
+ break;
15635
+ default:
15636
+ parts[SPEC[name].part] = value;
15637
+ }
15638
+ });
15639
+ if (meridiem) {
15640
+ if (parts.hour === void 0 || parts.hour < 1 || parts.hour > 12) {
15641
+ return void 0;
15642
+ }
15643
+ parts.hour = parts.hour % 12 + (meridiem === "PM" ? 12 : 0);
15644
+ }
15645
+ const complete = completeParts(parts, kind);
15646
+ return complete && formatParts(complete, pattern, kind) === text2 ? complete : void 0;
15647
+ }
15648
+ function completeParts(parts, kind) {
15649
+ const { year, month, day, hour, minute, second } = parts;
15650
+ if (kind !== "time" && !isRealDate(year, month, day)) {
15651
+ return void 0;
15652
+ }
15653
+ if (kind !== "date" && !isRealTime(hour, minute, second)) {
15654
+ return void 0;
15655
+ }
15656
+ return kind === "date" ? { year, month, day } : kind === "time" ? { hour, minute, ...second !== void 0 ? { second } : {} } : { year, month, day, hour, minute, ...second !== void 0 ? { second } : {} };
15657
+ }
15658
+ function isRealDate(year, month, day) {
15659
+ if (year === void 0 || month === void 0 || day === void 0 || month < 1 || month > 12 || day < 1) {
15660
+ return false;
15661
+ }
15662
+ const leap = year % 4 === 0 && year % 100 !== 0 || year % 400 === 0;
15663
+ const days = [31, leap ? 29 : 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31][month - 1];
15664
+ return day <= days;
15665
+ }
15666
+ var isRealTime = (hour, minute, second) => hour !== void 0 && minute !== void 0 && hour >= 0 && hour <= 23 && minute >= 0 && minute <= 59 && (second === void 0 || second >= 0 && second <= 59);
15667
+ var ISO_DATE = /^(\d{4})-(\d{2})-(\d{2})$/;
15668
+ var ISO_DATE_TIME = /^(\d{4})-(\d{2})-(\d{2})[T ](\d{2}):(\d{2})(?::(\d{2})(?:\.\d+)?)?(?:Z|[+-]\d{2}(?::?\d{2})?)?$/i;
15669
+ var ISO_TIME = /^(\d{2}):(\d{2})(?::(\d{2})(?:\.\d+)?)?(?:Z|[+-]\d{2}(?::?\d{2})?)?$/i;
15670
+ function parseIso(text2, kind) {
15671
+ const dateTime = ISO_DATE_TIME.exec(text2);
15672
+ if (dateTime) {
15673
+ const [, year, month, day, hour, minute, second] = dateTime.map(Number);
15674
+ return completeParts({ year, month, day, hour, minute, ...dateTime[6] ? { second } : {} }, kind);
15675
+ }
15676
+ const date = ISO_DATE.exec(text2);
15677
+ if (date) {
15678
+ return kind === "date" ? completeParts({ year: +date[1], month: +date[2], day: +date[3] }, kind) : void 0;
15679
+ }
15680
+ const time = ISO_TIME.exec(text2);
15681
+ if (time && kind === "time") {
15682
+ return completeParts({ hour: +time[1], minute: +time[2], ...time[3] ? { second: +time[3] } : {} }, kind);
15683
+ }
15684
+ return void 0;
15685
+ }
15686
+ function toCanonical(parts, kind) {
15687
+ const seconds = parts.second !== void 0 ? `:${pad(parts.second, 2)}` : "";
15688
+ const date = `${pad(parts.year ?? 0, 4)}-${pad(parts.month ?? 0, 2)}-${pad(parts.day ?? 0, 2)}`;
15689
+ const time = `${pad(parts.hour ?? 0, 2)}:${pad(parts.minute ?? 0, 2)}${seconds}`;
15690
+ return kind === "date" ? date : kind === "time" ? time : `${date}T${time}`;
15691
+ }
15692
+ function canonicalToPattern(canonical, ins, kind) {
15693
+ const pattern = ins.meta.frDateFormat;
15694
+ if (!pattern) {
15695
+ return canonical;
15696
+ }
15697
+ const parts = parseIso(canonical, kind);
15698
+ return parts ? formatParts(parts, pattern, kind) : canonical;
15699
+ }
15700
+ var MIN_TIMESTAMP_DIGITS = 13;
15701
+ function digitOnlyLength(pattern, kind) {
15702
+ const example = formatParts(EXAMPLE, pattern, kind);
15703
+ return /^\d+$/.test(example) ? example.length : void 0;
15704
+ }
15705
+ function isTimestamp(value, pattern, kind) {
15706
+ if (typeof value === "number") {
15707
+ return Number.isFinite(value);
15708
+ }
15709
+ if (typeof value !== "string") {
15710
+ return false;
15711
+ }
15712
+ const text2 = value.trim();
15713
+ return new RegExp(`^\\d{${MIN_TIMESTAMP_DIGITS},}$`).test(text2) && digitOnlyLength(pattern, kind) !== text2.length;
15714
+ }
15715
+ function timestampParts(value, kind) {
15716
+ const date = new Date(Number(value));
15717
+ if (Number.isNaN(date.getTime())) {
15718
+ return void 0;
15719
+ }
15720
+ const second = date.getSeconds();
15721
+ return completeParts({
15722
+ year: date.getFullYear(),
15723
+ month: date.getMonth() + 1,
15724
+ day: date.getDate(),
15725
+ hour: date.getHours(),
15726
+ minute: date.getMinutes(),
15727
+ ...second ? { second } : {}
15728
+ }, kind);
15729
+ }
15730
+ function toDateString(value, ins, kind) {
15731
+ const pattern = ins.meta.frDateFormat;
15732
+ const text2 = typeof value === "string" ? value.trim() : typeof value === "number" && Number.isInteger(value) && value >= 0 ? String(value) : void 0;
15733
+ if (text2 !== void 0) {
15734
+ const parts = (pattern ? parseInPattern(text2, pattern, kind) : void 0) ?? (typeof value === "string" ? parseIso(text2, kind) : void 0);
15735
+ if (parts) {
15736
+ return { canonical: toCanonical(parts, kind) };
15737
+ }
15738
+ }
15739
+ if (DATE_STRINGS_ACCEPT_TIMESTAMPS && isTimestamp(value, patternOf(ins, kind), kind)) {
15740
+ const parts = timestampParts(value, kind);
15741
+ return parts ? { canonical: toCanonical(parts, kind), fromTimestamp: true } : {};
15742
+ }
15743
+ return {};
15744
+ }
15745
+ var EXAMPLE = { year: 2024, month: 1, day: 31, hour: 13, minute: 45, second: 30 };
15746
+ function expectedDateString(ins, kind) {
15747
+ const pattern = patternOf(ins, kind);
15748
+ const shown = ins.meta.frDateFormat ? pattern : pattern.replace(/'T'/, "T");
15749
+ const example = formatParts(EXAMPLE, pattern, kind);
15750
+ return `${kind === "date" ? "a date" : kind === "time" ? "a time" : "a date and time"} in ${shown}, e.g. ${example}`;
15751
+ }
15752
+ function hasDateFormat(schema, seen = /* @__PURE__ */ new Set()) {
15753
+ if (!schema || seen.has(schema)) {
15754
+ return false;
15755
+ }
15756
+ seen.add(schema);
15757
+ const ins = inspect(schema);
15758
+ if (ins.meta.frDateFormat && dateStringKind(ins)) {
15759
+ return true;
15760
+ }
15761
+ const def = ins.core?._zod?.def ?? {};
15762
+ const children = [
15763
+ ...shapeEntries(ins.core).map(([, child]) => child),
15764
+ ...def.element ? [def.element] : [],
15765
+ ...def.valueType ? [def.valueType] : [],
15766
+ ...ins.branches ?? []
15767
+ ];
15768
+ return children.some((child) => hasDateFormat(child, seen));
15769
+ }
15770
+
15771
+ // ../../flow-extension-runner/src/params/schema/dictionary-binding.ts
15772
+ var DictionaryScope = class _DictionaryScope {
15773
+ constructor(top, visible) {
15774
+ this.top = top;
15775
+ this.visible = visible;
15776
+ }
15777
+ static {
15778
+ this.ROOT = new _DictionaryScope(null, /* @__PURE__ */ new Set());
15779
+ }
15780
+ enter(names) {
15781
+ if (!this.top) {
15782
+ const top = new Set(names);
15783
+ return new _DictionaryScope(top, top);
15784
+ }
15785
+ return new _DictionaryScope(this.top, /* @__PURE__ */ new Set([...this.top, ...names]));
15786
+ }
15787
+ };
15788
+ function resolveDependsOn(binding, scope2) {
15789
+ const aliases = binding.criteriaAliases ?? {};
15790
+ let clash;
15791
+ const dependsOn = binding.dependsOn.map((key) => {
15792
+ const visible = [key, ...aliases[key] ?? []].filter((name) => scope2.visible.has(name));
15793
+ if (visible.length > 1 && !clash) {
15794
+ clash = { key, names: visible };
15795
+ }
15796
+ return visible[0] ?? key;
15797
+ });
15798
+ return clash ? { dependsOn, clash } : { dependsOn };
15799
+ }
15800
+ function publishedBinding(binding, scope2) {
15801
+ return { id: binding.id, dependsOn: resolveDependsOn(binding, scope2).dependsOn };
15802
+ }
15803
+
15804
+ // ../../flow-extension-runner/src/params/schema/assert-supported-schema.ts
15442
15805
  var GUARDED_KINDS = /* @__PURE__ */ new Set(["action", "dictionary", "polling trigger", "realtime trigger", "extension"]);
15443
15806
  var SUPPORTED_TYPES = /* @__PURE__ */ new Set([
15444
15807
  "string",
@@ -15459,31 +15822,31 @@ var SUPPORTED_TYPES = /* @__PURE__ */ new Set([
15459
15822
  ]);
15460
15823
  var SUPPORTED_SPELLING = "z.string(), z.number(), z.bigint(), z.boolean(), z.date(), z.enum([\u2026]), z.literal(\u2026), z.object({ \u2026 }), z.array(\u2026), z.record(\u2026), z.union([\u2026]), z.null(), z.any(), z.unknown()";
15461
15824
  var MODIFIER_SPELLING = ".optional(), .nullable(), .nullish(), .default(v), .prefault(v), .readonly(), .nonoptional(), .pipe(\u2026)/.transform(\u2026) and z.lazy(\u2026)";
15462
- function subjectOf(source, path19) {
15825
+ function subjectOf(source, path18) {
15463
15826
  const kind = source.kind ?? "extension";
15464
15827
  const subject = source.itemId ? `${kind} "${source.itemId}": ` : "";
15465
- return `${subject}\`${path19}\``;
15828
+ return `${subject}\`${path18}\``;
15466
15829
  }
15467
- function refuse(message, source, path19, received) {
15830
+ function refuse(message, source, path18, received) {
15468
15831
  throw new InvalidSchemaError(
15469
15832
  `[flow-extension:${source.serviceId}] ${message}`,
15470
- { serviceId: source.serviceId, kind: source.kind ?? "extension", itemId: source.itemId, slot: source.slot, path: path19, received }
15833
+ { serviceId: source.serviceId, kind: source.kind ?? "extension", itemId: source.itemId, slot: source.slot, path: path18, received }
15471
15834
  );
15472
15835
  }
15473
- function refuseCatch(source, path19) {
15836
+ function refuseCatch(source, path18) {
15474
15837
  refuse(
15475
- `${subjectOf(source, path19)} uses \`.catch(\u2026)\`, which a parameter may not: it replaces an invalid value with the fallback instead of reporting it, and drops the field out of type coercion. Use \`.default(v)\` \u2014 same fallback when the value is absent, and a supplied-but-invalid one still fails.`,
15838
+ `${subjectOf(source, path18)} uses \`.catch(\u2026)\`, which a parameter may not: it replaces an invalid value with the fallback instead of reporting it, and drops the field out of type coercion. Use \`.default(v)\` \u2014 same fallback when the value is absent, and a supplied-but-invalid one still fails.`,
15476
15839
  source,
15477
- path19,
15840
+ path18,
15478
15841
  "catch"
15479
15842
  );
15480
15843
  }
15481
- function refuseType(source, path19, type) {
15844
+ function refuseType(source, path18, type) {
15482
15845
  const received = type ? `z.${type}()` : "a value that is not a zod schema";
15483
15846
  refuse(
15484
- `${subjectOf(source, path19)} declares ${received}, which the runtime cannot publish as a parameter \u2014 it has no widget, no published type and no coercion for it. Supported: ${SUPPORTED_SPELLING}; each may carry ${MODIFIER_SPELLING}.`,
15847
+ `${subjectOf(source, path18)} declares ${received}, which the runtime cannot publish as a parameter \u2014 it has no widget, no published type and no coercion for it. Supported: ${SUPPORTED_SPELLING}; each may carry ${MODIFIER_SPELLING}.`,
15485
15848
  source,
15486
- path19,
15849
+ path18,
15487
15850
  type ?? "unknown"
15488
15851
  );
15489
15852
  }
@@ -15499,7 +15862,7 @@ function isLooseObject(schema) {
15499
15862
  function isDynamicPropsSlot(source, topLevel) {
15500
15863
  return topLevel && source.kind === "action" && source.slot === "params";
15501
15864
  }
15502
- function assertDynamicProps(schema, name, siblings, source, path19) {
15865
+ function assertDynamicProps(schema, name, siblings, source, path18) {
15503
15866
  const ins = inspect(schema);
15504
15867
  const spec = ins.meta.frDynamicProps;
15505
15868
  if (!spec) {
@@ -15510,49 +15873,49 @@ function assertDynamicProps(schema, name, siblings, source, path19) {
15510
15873
  }
15511
15874
  if (typeof spec.execute !== "function") {
15512
15875
  refuse(
15513
- `${subjectOf(source, path19)}: \`.dynamicProps()\` needs an \`execute\` function that returns the loaded fields.`,
15876
+ `${subjectOf(source, path18)}: \`.dynamicProps()\` needs an \`execute\` function that returns the loaded fields.`,
15514
15877
  source,
15515
- path19,
15878
+ path18,
15516
15879
  typeof spec.execute
15517
15880
  );
15518
15881
  }
15519
15882
  if (spec.dependsOn !== void 0 && (!Array.isArray(spec.dependsOn) || spec.dependsOn.some((item) => typeof item !== "string"))) {
15520
15883
  refuse(
15521
- `${subjectOf(source, path19)}: \`.dynamicProps()\` \`dependsOn\` must be an array of param names.`,
15884
+ `${subjectOf(source, path18)}: \`.dynamicProps()\` \`dependsOn\` must be an array of param names.`,
15522
15885
  source,
15523
- path19,
15886
+ path18,
15524
15887
  "dependsOn"
15525
15888
  );
15526
15889
  }
15527
15890
  for (const dependency of spec.dependsOn ?? []) {
15528
15891
  if (dependency === name || !siblings.includes(dependency)) {
15529
15892
  refuse(
15530
- `${subjectOf(source, path19)}: \`.dynamicProps()\` depends on "${dependency}", which is not another param of this action. Name its sibling params: ${siblings.filter((sibling) => sibling !== name).join(", ") || "none"}.`,
15893
+ `${subjectOf(source, path18)}: \`.dynamicProps()\` depends on "${dependency}", which is not another param of this action. Name its sibling params: ${siblings.filter((sibling) => sibling !== name).join(", ") || "none"}.`,
15531
15894
  source,
15532
- path19,
15895
+ path18,
15533
15896
  dependency
15534
15897
  );
15535
15898
  }
15536
15899
  }
15537
15900
  if (ins.meta.frDictionary) {
15538
15901
  refuse(
15539
- `${subjectOf(source, path19)} declares both \`.dynamicProps()\` and \`.dictionary()\`. A dictionary offers values for one field; dynamic props load the fields inside an object \u2014 use one or the other.`,
15902
+ `${subjectOf(source, path18)} declares both \`.dynamicProps()\` and \`.dictionary()\`. A dictionary offers values for one field; dynamic props load the fields inside an object \u2014 use one or the other.`,
15540
15903
  source,
15541
- path19,
15904
+ path18,
15542
15905
  "dictionary"
15543
15906
  );
15544
15907
  }
15545
15908
  const element = ins.resolvedType === "array" ? ins.core?._zod?.def?.element : void 0;
15546
15909
  if (!isLooseObject(schema) && !isLooseObject(element)) {
15547
15910
  refuse(
15548
- `${subjectOf(source, path19)}: \`.dynamicProps()\` needs a loose object \u2014 the loaded fields are not declared, so a plain \`z.object()\` would strip them. ${DYNAMIC_PROPS_FIX}`,
15911
+ `${subjectOf(source, path18)}: \`.dynamicProps()\` needs a loose object \u2014 the loaded fields are not declared, so a plain \`z.object()\` would strip them. ${DYNAMIC_PROPS_FIX}`,
15549
15912
  source,
15550
- path19,
15913
+ path18,
15551
15914
  ins.resolvedType ?? "unknown"
15552
15915
  );
15553
15916
  }
15554
15917
  }
15555
- function assertDictionaryBinding(schema, source, path19, scope2) {
15918
+ function assertDictionaryBinding(schema, source, path18, scope2) {
15556
15919
  const binding = inspect(schema).meta.frDictionary;
15557
15920
  if (!binding) {
15558
15921
  return;
@@ -15560,14 +15923,56 @@ function assertDictionaryBinding(schema, source, path19, scope2) {
15560
15923
  const { clash } = resolveDependsOn(binding, scope2);
15561
15924
  if (clash) {
15562
15925
  refuse(
15563
- `${subjectOf(source, path19)} uses dictionary "${binding.id}", whose criteria "${clash.key}" can come from ${clash.names.map((name) => `"${name}"`).join(" or ")} \u2014 and this field can see all of them, so the dictionary cannot tell which one is meant. Rename one of the params, or bind this field to a dictionary without that alias.`,
15926
+ `${subjectOf(source, path18)} uses dictionary "${binding.id}", whose criteria "${clash.key}" can come from ${clash.names.map((name) => `"${name}"`).join(" or ")} \u2014 and this field can see all of them, so the dictionary cannot tell which one is meant. Rename one of the params, or bind this field to a dictionary without that alias.`,
15564
15927
  source,
15565
- path19,
15928
+ path18,
15566
15929
  clash.names.join(", ")
15567
15930
  );
15568
15931
  }
15569
15932
  }
15570
- function assertField(schema, source, path19, seen, scope2, topLevel = false) {
15933
+ function assertDateString(schema, source, path18) {
15934
+ const ins = inspect(schema);
15935
+ const pattern = ins.meta.frDateFormat;
15936
+ const kind = dateStringKind(ins);
15937
+ if (pattern !== void 0 && !kind) {
15938
+ const format = ins.core?._zod?.def?.format;
15939
+ const zoned = ins.coreType === "string" && format === "datetime";
15940
+ refuse(
15941
+ `${subjectOf(source, path18)} uses \`.dateFormat()\` on ${zoned ? "z.iso.datetime() with a zone \u2014 an instant, not a wall clock" : "a type that is not a date string"}. Only z.iso.date(), z.iso.datetime({ local: true }) and z.iso.time() take a format.`,
15942
+ source,
15943
+ path18,
15944
+ zoned ? "datetime" : ins.resolvedType ?? "unknown"
15945
+ );
15946
+ }
15947
+ if (!kind) {
15948
+ return;
15949
+ }
15950
+ if (pattern !== void 0) {
15951
+ try {
15952
+ compilePattern(pattern, kind);
15953
+ } catch (error) {
15954
+ if (error instanceof DateFormatError) {
15955
+ refuse(`${subjectOf(source, path18)}: \`.dateFormat('${pattern}')\` ${error.message}.`, source, path18, pattern);
15956
+ }
15957
+ throw error;
15958
+ }
15959
+ }
15960
+ const fallback = ins.defaultValue;
15961
+ if (fallback === void 0 || fallback === null) {
15962
+ return;
15963
+ }
15964
+ const written = patternOf(ins, kind);
15965
+ const fits = typeof fallback === "string" && (pattern !== void 0 ? !!parseInPattern(fallback, pattern, kind) : ((parts) => !!parts && toCanonical(parts, kind) === fallback)(parseIso(fallback, kind)));
15966
+ if (!fits) {
15967
+ refuse(
15968
+ `${subjectOf(source, path18)} has the default ${JSON.stringify(fallback)}, which is not written in ${written.replace(/'T'/, "T")} \u2014 a default is handed to \`execute\` as written, so write it in the field's own format.`,
15969
+ source,
15970
+ path18,
15971
+ String(fallback)
15972
+ );
15973
+ }
15974
+ }
15975
+ function assertField(schema, source, path18, seen, scope2, topLevel = false) {
15571
15976
  if (!schema || seen.has(schema)) {
15572
15977
  return;
15573
15978
  }
@@ -15575,34 +15980,35 @@ function assertField(schema, source, path19, seen, scope2, topLevel = false) {
15575
15980
  const ins = inspect(schema);
15576
15981
  if (ins.meta.frDynamicProps && !isDynamicPropsSlot(source, topLevel)) {
15577
15982
  refuse(
15578
- `${subjectOf(source, path19)} uses \`.dynamicProps()\`, which is supported on top-level action params only. For a list of objects, put it on the array rather than on its element.`,
15983
+ `${subjectOf(source, path18)} uses \`.dynamicProps()\`, which is supported on top-level action params only. For a list of objects, put it on the array rather than on its element.`,
15579
15984
  source,
15580
- path19,
15985
+ path18,
15581
15986
  "dynamicProps"
15582
15987
  );
15583
15988
  }
15584
15989
  if (ins.resolvedType === "catch") {
15585
- refuseCatch(source, path19);
15990
+ refuseCatch(source, path18);
15586
15991
  }
15587
- assertDictionaryBinding(schema, source, path19, scope2);
15992
+ assertDictionaryBinding(schema, source, path18, scope2);
15993
+ assertDateString(schema, source, path18);
15588
15994
  if (!ins.resolvedType || !SUPPORTED_TYPES.has(ins.resolvedType)) {
15589
- refuseType(source, path19, ins.resolvedType);
15995
+ refuseType(source, path18, ins.resolvedType);
15590
15996
  }
15591
15997
  if (ins.branches) {
15592
- ins.branches.forEach((branch, index) => assertField(branch, source, `${path19}|branch ${index + 1}`, seen, scope2));
15998
+ ins.branches.forEach((branch, index) => assertField(branch, source, `${path18}|branch ${index + 1}`, seen, scope2));
15593
15999
  }
15594
16000
  const def = ins.core._zod?.def ?? {};
15595
16001
  if (ins.resolvedType === "array") {
15596
- assertField(def.element, source, `${path19}[]`, seen, scope2);
16002
+ assertField(def.element, source, `${path18}[]`, seen, scope2);
15597
16003
  }
15598
16004
  if (ins.resolvedType === "record") {
15599
- assertField(def.valueType, source, `${path19}{}`, seen, scope2);
16005
+ assertField(def.valueType, source, `${path18}{}`, seen, scope2);
15600
16006
  }
15601
16007
  if (ins.resolvedType === "object") {
15602
16008
  const properties = shapeEntries(ins.core);
15603
16009
  const inner = scope2.enter(properties.map(([name]) => name));
15604
16010
  for (const [name, property] of properties) {
15605
- assertField(property, source, `${path19}.${name}`, seen, inner);
16011
+ assertField(property, source, `${path18}.${name}`, seen, inner);
15606
16012
  }
15607
16013
  }
15608
16014
  }
@@ -15623,7 +16029,7 @@ function assertSupportedSchema(scheme, source) {
15623
16029
  }
15624
16030
  }
15625
16031
 
15626
- // ../../flow-extension-runner/src/v2/params/schema/dates.ts
16032
+ // ../../flow-extension-runner/src/params/schema/dates.ts
15627
16033
  var DATE_ONLY = /^\d{4}-\d{2}-\d{2}$/;
15628
16034
  var HAS_TIME = /^(\d{4}-\d{2}-\d{2})[T ](.+)$/;
15629
16035
  var ZONE = /(Z|[+-]\d{2}:?\d{2})$/;
@@ -15702,7 +16108,7 @@ function hasPassThroughDate(schema, inspectSchema, entriesOf) {
15702
16108
  return children.some((child) => hasPassThroughDate(child, inspectSchema, entriesOf));
15703
16109
  }
15704
16110
 
15705
- // ../../flow-extension-runner/src/v2/params/schema/labels.ts
16111
+ // ../../flow-extension-runner/src/params/schema/labels.ts
15706
16112
  var ACRONYMS = /* @__PURE__ */ new Set([
15707
16113
  "id",
15708
16114
  "url",
@@ -15736,7 +16142,7 @@ function humanizeKey(name) {
15736
16142
  }
15737
16143
  var labelOf = (name, schema) => inspect(schema).meta.title || humanizeKey(name) || name;
15738
16144
 
15739
- // ../../flow-extension-runner/src/v2/params/schema/field-plan.ts
16145
+ // ../../flow-extension-runner/src/params/schema/field-plan.ts
15740
16146
  function declaredAbsence(schema) {
15741
16147
  let current = schema;
15742
16148
  let acceptsUndefined = false;
@@ -15835,16 +16241,46 @@ function planField(name, schema) {
15835
16241
  label: labelOf(name, schema),
15836
16242
  coreType: ins.coreType,
15837
16243
  isUnion: !!ins.branches,
16244
+ blankBranch: hasBlankBranch(ins),
15838
16245
  absence,
15839
16246
  absorbsBlank,
15840
16247
  keepsEmpty,
15841
16248
  blankIsValue,
15842
16249
  passThroughDate: passesDateThrough(ins),
15843
- restoresDates: hasPassThroughDate(schema, inspect, shapeEntries)
16250
+ restoresDates: hasPassThroughDate(schema, inspect, shapeEntries),
16251
+ dateString: dateStringKind(ins),
16252
+ formatsDates: hasDateFormat(schema)
15844
16253
  };
15845
16254
  }
15846
16255
 
15847
- // ../../flow-extension-runner/src/v2/params/schema/coerce.ts
16256
+ // ../../flow-extension-runner/src/params/schema/notices.ts
16257
+ var sink;
16258
+ var currentField;
16259
+ function collectNotices(fn) {
16260
+ const outer = sink;
16261
+ const notices = [];
16262
+ sink = notices;
16263
+ try {
16264
+ return { result: fn(), notices };
16265
+ } finally {
16266
+ sink = outer;
16267
+ outer?.push(...notices);
16268
+ }
16269
+ }
16270
+ function withinField(field, fn) {
16271
+ const outer = currentField;
16272
+ currentField = field;
16273
+ try {
16274
+ return fn();
16275
+ } finally {
16276
+ currentField = outer;
16277
+ }
16278
+ }
16279
+ function notice(entry) {
16280
+ sink?.push({ field: currentField, ...entry });
16281
+ }
16282
+
16283
+ // ../../flow-extension-runner/src/params/schema/coerce.ts
15848
16284
  var ok = (value) => ({ ok: true, value });
15849
16285
  var fail = (expected) => ({ ok: false, expected });
15850
16286
  var TRUE = /* @__PURE__ */ new Set(["true", "1", "yes", "y", "t", "on", "checked", "enabled", "enable", "active"]);
@@ -16015,6 +16451,21 @@ function coerceLeaf(value, ins) {
16015
16451
  if (ins.branches) {
16016
16452
  return ok(coerceUnion(value, ins.branches));
16017
16453
  }
16454
+ const kind = dateStringKind(ins);
16455
+ if (kind) {
16456
+ const { canonical, fromTimestamp } = toDateString(value, ins, kind);
16457
+ if (canonical === void 0) {
16458
+ return fail(expectedDateString(ins, kind));
16459
+ }
16460
+ if (fromTimestamp) {
16461
+ notice({
16462
+ message: "a timestamp was converted to a date string in the server time zone (FR-3920 lenient period)",
16463
+ value,
16464
+ converted: canonical
16465
+ });
16466
+ }
16467
+ return ok(canonical);
16468
+ }
16018
16469
  const format = formatOf(ins);
16019
16470
  if (ins.coreType === "string" && isConvertibleIso(format)) {
16020
16471
  const iso = toIso(value, format);
@@ -16043,12 +16494,12 @@ function isBlank(value, ins, schema) {
16043
16494
  return false;
16044
16495
  }
16045
16496
  if (ins.branches) {
16046
- return true;
16497
+ return !hasBlankBranch(ins) || absenceOf(schema).absorbsBlank;
16047
16498
  }
16048
16499
  if (absenceOf(schema).blankIsValue) {
16049
16500
  return absenceOf(schema).absorbsBlank;
16050
16501
  }
16051
- return ins.coreType !== "string" || absenceOf(schema).absorbsBlank;
16502
+ return ins.coreType !== "string" || !!dateStringKind(ins) || absenceOf(schema).absorbsBlank;
16052
16503
  }
16053
16504
  function absentAs(schema, value) {
16054
16505
  const { absence } = absenceOf(schema);
@@ -16061,7 +16512,7 @@ function absentAs(schema, value) {
16061
16512
  return absence === "null" ? null : void 0;
16062
16513
  }
16063
16514
 
16064
- // ../../flow-extension-runner/src/v2/params/schema/defaults.ts
16515
+ // ../../flow-extension-runner/src/params/schema/defaults.ts
16065
16516
  var WIDGET_DESCRIPTIONS = {
16066
16517
  [FlowExtensionParamWidgetTypes.MULTI_LINE_TEXT]: "Expects text; line breaks are allowed"
16067
16518
  };
@@ -16098,7 +16549,7 @@ var FORMAT_DESCRIPTIONS = {
16098
16549
  cidrv6: "Expects an IPv6 range, e.g. 2001:db8::/32"
16099
16550
  };
16100
16551
 
16101
- // ../../flow-extension-runner/src/v2/params/schema/messages.ts
16552
+ // ../../flow-extension-runner/src/params/schema/messages.ts
16102
16553
  var EXPECTED = {
16103
16554
  string: "a string",
16104
16555
  number: "a number",
@@ -16112,6 +16563,72 @@ var EXPECTED = {
16112
16563
  record: "an object"
16113
16564
  };
16114
16565
  var requiredMessage = (plan2) => `\xAB${plan2.label}\xBB is required`;
16566
+ var oneOf = (values) => `one of: ${values.map(String).join(", ")}`;
16567
+ var formatPhrase = (format) => {
16568
+ const described = FORMAT_DESCRIPTIONS[format ?? ""];
16569
+ return described?.replace(/^Expects (.*?), e\.g\. (.*)$/, "$1 (e.g. $2)").replace(/^Expects /, "");
16570
+ };
16571
+ var distinct = (phrases) => [...new Set(phrases.filter((phrase) => !!phrase))];
16572
+ function unionPhrases(union, value) {
16573
+ return distinct((inspect(union).branches ?? []).map((branch) => {
16574
+ try {
16575
+ const result = branch.safeParse(value);
16576
+ return branchPhrase(branch, result.error?.issues[0]);
16577
+ } catch {
16578
+ return void 0;
16579
+ }
16580
+ }));
16581
+ }
16582
+ function remainingIssue(branch, value) {
16583
+ if (!branch) {
16584
+ return void 0;
16585
+ }
16586
+ try {
16587
+ const result = branch.safeParse(coerceDeep(value, branch));
16588
+ return result.success ? void 0 : result.error?.issues[0];
16589
+ } catch {
16590
+ return void 0;
16591
+ }
16592
+ }
16593
+ function branchPhrase(branch, issue) {
16594
+ if (!branch || !issue) {
16595
+ return void 0;
16596
+ }
16597
+ const ins = inspect(branch);
16598
+ const values = ins.core._zod?.def?.values ?? [];
16599
+ if (ins.coreType === "literal" && values.length === 1 && values[0] === "") {
16600
+ return void 0;
16601
+ }
16602
+ const dateKind = dateStringKind(ins);
16603
+ if (dateKind) {
16604
+ return expectedDateString(ins, dateKind);
16605
+ }
16606
+ switch (issue.code) {
16607
+ case "invalid_type":
16608
+ return EXPECTED[issue.expected ?? ""] ?? issue.expected;
16609
+ case "invalid_value":
16610
+ return oneOf(issue.values ?? values);
16611
+ case "invalid_format":
16612
+ return formatPhrase(issue.format);
16613
+ // A bound has no short phrase ("a number of at least 10"); the branch still names its type.
16614
+ case "too_small":
16615
+ case "too_big":
16616
+ return EXPECTED[ins.coreType === "literal" ? literalType(ins.core) ?? "" : ins.coreType];
16617
+ default:
16618
+ return void 0;
16619
+ }
16620
+ }
16621
+ function unionIssue(plan2, issue, union, unionValue, fieldValue) {
16622
+ const branches = union ? inspect(union).branches : void 0;
16623
+ const errors = issue.errors ?? [];
16624
+ const deepIndex = errors.findIndex((branchIssues) => branchIssues.some((branchIssue) => (branchIssue.path ?? []).length));
16625
+ if (deepIndex >= 0) {
16626
+ const deep = remainingIssue(branches?.[deepIndex], unionValue) ?? errors[deepIndex].find((branchIssue) => (branchIssue.path ?? []).length);
16627
+ return toFieldIssue(plan2, { ...deep, path: [...issue.path ?? [], ...deep.path ?? []] }, fieldValue);
16628
+ }
16629
+ const phrases = distinct(errors.map((branchIssues, index) => branchPhrase(branches?.[index], branchIssues[0])));
16630
+ return phrases.length ? { path: "", code: "invalid_union", message: `must be ${phrases.join(", or ")}` } : void 0;
16631
+ }
16115
16632
  var invalidTypeMessage = (plan2, expected) => `\xAB${plan2.label}\xBB must be ${EXPECTED[expected] ?? expected}`;
16116
16633
  var isIndex = (segment) => /^\d+$/.test(segment);
16117
16634
  function resolveTarget(plan2, segments, fieldValue) {
@@ -16120,6 +16637,8 @@ function resolveTarget(plan2, segments, fieldValue) {
16120
16637
  let label = plan2.label;
16121
16638
  let found = true;
16122
16639
  for (const segment of segments) {
16640
+ const branch = schema && inspect(schema).branches?.find((candidate) => isIndex(segment) ? inspect(candidate).coreType === "array" : shapeEntries(inspect(candidate).core).some(([name]) => name === segment));
16641
+ schema = branch ?? schema;
16123
16642
  const core = schema ? inspect(schema).core : void 0;
16124
16643
  const coreType = core ? inspect(schema).coreType : void 0;
16125
16644
  value = value == null ? void 0 : value[segment];
@@ -16136,7 +16655,7 @@ function resolveTarget(plan2, segments, fieldValue) {
16136
16655
  schema = nested[1];
16137
16656
  label = labelOf(segment, schema);
16138
16657
  }
16139
- return { label, value, found };
16658
+ return { label, value, found, schema: found ? schema : void 0 };
16140
16659
  }
16141
16660
  function bound(value, plan2) {
16142
16661
  if (plan2.coreType !== "date" || typeof value !== "number") {
@@ -16151,36 +16670,55 @@ function isAuthored(issue) {
16151
16670
  }
16152
16671
  function toFieldIssue(plan2, issue, fieldValue) {
16153
16672
  const segments = (issue.path ?? []).map(String).filter(Boolean);
16154
- const path19 = segments.length ? `${plan2.name}.${segments.join(".")}` : plan2.name;
16673
+ const path18 = segments.length ? `${plan2.name}.${segments.join(".")}` : plan2.name;
16155
16674
  const code = issue.code ?? "custom";
16156
16675
  const target = resolveTarget(plan2, segments, fieldValue);
16157
16676
  const named = { ...plan2, label: target.label };
16158
16677
  if (isAuthored(issue)) {
16159
- return { path: path19, code, message: issue.message };
16678
+ return { path: path18, code, message: issue.message };
16679
+ }
16680
+ if (code === "invalid_format" && target.schema && inspect(target.schema).branches) {
16681
+ const combined = unionPhrases(target.schema, target.value);
16682
+ if (combined.length > 1) {
16683
+ return { path: path18, code: "invalid_union", message: `\xAB${target.label}\xBB must be ${combined.join(", or ")}` };
16684
+ }
16685
+ }
16686
+ const dateKind = target.schema ? dateStringKind(inspect(target.schema)) : void 0;
16687
+ const dateMissing = target.value == null || target.value === "";
16688
+ if (dateKind && (code === "invalid_type" || code === "invalid_format")) {
16689
+ return dateMissing ? { path: path18, code, message: requiredMessage(named) } : { path: path18, code, message: invalidTypeMessage(named, expectedDateString(inspect(target.schema), dateKind)) };
16160
16690
  }
16161
16691
  if (code === "invalid_type") {
16162
16692
  const received = issue.received;
16163
16693
  const absent = segments.length ? target.found && target.value == null : received === "undefined" || received === "null" || issue.expected === void 0;
16164
- return absent ? { path: path19, code, message: requiredMessage(named) } : { path: path19, code, message: invalidTypeMessage(named, issue.expected ?? "") };
16694
+ return absent ? { path: path18, code, message: requiredMessage(named) } : { path: path18, code, message: invalidTypeMessage(named, issue.expected ?? "") };
16165
16695
  }
16166
16696
  if (code === "too_small") {
16167
- return { path: path19, code, message: `\xAB${target.label}\xBB must be at least ${bound(issue.minimum, plan2)}` };
16697
+ return { path: path18, code, message: `\xAB${target.label}\xBB must be at least ${bound(issue.minimum, plan2)}` };
16168
16698
  }
16169
16699
  if (code === "too_big") {
16170
- return { path: path19, code, message: `\xAB${target.label}\xBB must be at most ${bound(issue.maximum, plan2)}` };
16700
+ return { path: path18, code, message: `\xAB${target.label}\xBB must be at most ${bound(issue.maximum, plan2)}` };
16171
16701
  }
16172
16702
  if (code === "invalid_value") {
16173
- const values = (issue.values ?? []).map(String);
16174
- return { path: path19, code, message: `\xAB${target.label}\xBB must be one of: ${values.join(", ")}` };
16703
+ return { path: path18, code, message: `\xAB${target.label}\xBB must be ${oneOf(issue.values ?? [])}` };
16175
16704
  }
16176
16705
  if (code === "invalid_format") {
16177
16706
  const described = FORMAT_DESCRIPTIONS[issue.format ?? ""];
16178
- return described ? { path: path19, code, message: `\xAB${target.label}\xBB is invalid \u2014 ${described.replace(/^Expects /, "expects ")}` } : { path: path19, code, message: `\xAB${target.label}\xBB has an invalid format` };
16707
+ return described ? { path: path18, code, message: `\xAB${target.label}\xBB is invalid \u2014 ${described.replace(/^Expects /, "expects ")}` } : { path: path18, code, message: `\xAB${target.label}\xBB has an invalid format` };
16179
16708
  }
16180
- return { path: path19, code, message: `\xAB${target.label}\xBB is invalid` };
16709
+ if (code === "invalid_union") {
16710
+ if (segments.length && target.found && target.value == null) {
16711
+ return { path: path18, code, message: requiredMessage(named) };
16712
+ }
16713
+ const combined = unionIssue(plan2, issue, target.schema, target.value, fieldValue);
16714
+ if (combined) {
16715
+ return combined.path ? combined : { path: path18, code, message: `\xAB${target.label}\xBB ${combined.message}` };
16716
+ }
16717
+ }
16718
+ return { path: path18, code, message: `\xAB${target.label}\xBB is invalid` };
16181
16719
  }
16182
16720
 
16183
- // ../../flow-extension-runner/src/v2/params/schema/normalize.ts
16721
+ // ../../flow-extension-runner/src/params/schema/normalize.ts
16184
16722
  var resolved = (value) => ({ value, present: true, issues: [] });
16185
16723
  var rejected = (issues) => ({ present: false, issues });
16186
16724
  function isAbsent(value, plan2) {
@@ -16197,12 +16735,12 @@ function isAbsent(value, plan2) {
16197
16735
  return false;
16198
16736
  }
16199
16737
  if (plan2.isUnion) {
16200
- return true;
16738
+ return !plan2.blankBranch || plan2.absorbsBlank;
16201
16739
  }
16202
16740
  if (plan2.blankIsValue) {
16203
16741
  return plan2.absorbsBlank;
16204
16742
  }
16205
- return plan2.coreType !== "string" || plan2.absorbsBlank;
16743
+ return plan2.coreType !== "string" || !!plan2.dateString || plan2.absorbsBlank;
16206
16744
  }
16207
16745
  function normalizeAbsence(value, plan2) {
16208
16746
  if (plan2.absence === "required") {
@@ -16241,7 +16779,7 @@ function normalizeField(value, plan2) {
16241
16779
  return restore(validate(coerced.value, plan2), value, plan2);
16242
16780
  }
16243
16781
  function restore(result, original, plan2) {
16244
- if (!plan2.restoresDates || !result.present || result.issues.length) {
16782
+ if (!(plan2.restoresDates || plan2.formatsDates) || !result.present || result.issues.length) {
16245
16783
  return result;
16246
16784
  }
16247
16785
  if (plan2.passThroughDate) {
@@ -16261,6 +16799,10 @@ function restoreDeep(output, original, schema) {
16261
16799
  const branch = ins.branches.find((option) => accepts(option, output));
16262
16800
  return branch ? restoreDeep(output, original, branch) : output;
16263
16801
  }
16802
+ const kind = dateStringKind(ins);
16803
+ if (kind) {
16804
+ return typeof output === "string" && original !== "" ? canonicalToPattern(output, ins, kind) : output;
16805
+ }
16264
16806
  const element = ins.core?._zod?.def?.element;
16265
16807
  if (ins.coreType === "array" && element && Array.isArray(output) && Array.isArray(original)) {
16266
16808
  return output.map((item, index) => restoreDeep(item, original[index], element));
@@ -16284,7 +16826,7 @@ function restoreDeep(output, original, schema) {
16284
16826
  }
16285
16827
  var isPlain = (value) => !!value && typeof value === "object" && !Array.isArray(value);
16286
16828
 
16287
- // ../../flow-extension-runner/src/v2/params/schema/parse.ts
16829
+ // ../../flow-extension-runner/src/params/schema/parse.ts
16288
16830
  var EXPECTED2 = {
16289
16831
  string: "a string",
16290
16832
  number: "a number",
@@ -16294,10 +16836,10 @@ var EXPECTED2 = {
16294
16836
  };
16295
16837
  function toIssues(error, param) {
16296
16838
  return (error?.issues ?? []).map((issue) => {
16297
- const path19 = (issue.path ?? []).map(String).join(".");
16839
+ const path18 = (issue.path ?? []).map(String).join(".");
16298
16840
  const expected = issue.expected;
16299
- const restated = param && !path19 && issue.code === "invalid_type" && expected ? `\xAB${param}\xBB must be ${EXPECTED2[expected] ?? expected}` : void 0;
16300
- return { path: path19, message: restated ?? issue.message ?? "invalid value", code: issue.code };
16841
+ const restated = param && !path18 && issue.code === "invalid_type" && expected ? `\xAB${param}\xBB must be ${EXPECTED2[expected] ?? expected}` : void 0;
16842
+ return { path: path18, message: restated ?? issue.message ?? "invalid value", code: issue.code };
16301
16843
  });
16302
16844
  }
16303
16845
  function parseSchema(schema, value, fail2, param) {
@@ -16311,7 +16853,7 @@ function parseSchema(schema, value, fail2, param) {
16311
16853
  return result.data;
16312
16854
  }
16313
16855
 
16314
- // ../../flow-extension-runner/src/v2/params/params.ts
16856
+ // ../../flow-extension-runner/src/params/params.ts
16315
16857
  var Params = class {
16316
16858
  constructor(scheme, source = {}) {
16317
16859
  this.source = source;
@@ -16350,7 +16892,7 @@ var Params = class {
16350
16892
  const values = {};
16351
16893
  const issues = [];
16352
16894
  for (const plan2 of this.plans()) {
16353
- const result = normalizeField(source[plan2.name], plan2);
16895
+ const result = withinField(plan2.name, () => normalizeField(source[plan2.name], plan2));
16354
16896
  if (result.issues.length) {
16355
16897
  issues.push(...result.issues);
16356
16898
  } else if (result.present) {
@@ -16366,7 +16908,7 @@ var Params = class {
16366
16908
  }
16367
16909
  };
16368
16910
 
16369
- // ../../flow-extension-runner/src/v2/params/config-params.ts
16911
+ // ../../flow-extension-runner/src/params/config-params.ts
16370
16912
  var ConfigParams = class _ConfigParams extends Params {
16371
16913
  static of(scheme, source = {}) {
16372
16914
  return new _ConfigParams(scheme, source);
@@ -16389,7 +16931,7 @@ var ConfigParams = class _ConfigParams extends Params {
16389
16931
  }
16390
16932
  };
16391
16933
 
16392
- // ../../flow-extension-runner/src/v2/params/method-params.ts
16934
+ // ../../flow-extension-runner/src/params/method-params.ts
16393
16935
  var MethodParams = class _MethodParams extends Params {
16394
16936
  static of(scheme, source = {}) {
16395
16937
  return new _MethodParams(scheme, source);
@@ -16415,10 +16957,10 @@ var MethodParams = class _MethodParams extends Params {
16415
16957
  }
16416
16958
  };
16417
16959
 
16418
- // ../../flow-extension-runner/src/v2/params/zod.ts
16960
+ // ../../flow-extension-runner/src/params/zod.ts
16419
16961
  var import_zod2 = require("zod");
16420
16962
 
16421
- // ../../flow-extension-runner/src/v2/params/files-options.ts
16963
+ // ../../flow-extension-runner/src/params/files-options.ts
16422
16964
  var import_zod = require("zod");
16423
16965
  var SCOPE_VALUES = ["WORKSPACE", "FLOW", "EXECUTION"];
16424
16966
  var scope = () => import_zod.z.enum(SCOPE_VALUES).label("Scope").describe("Storage scope: WORKSPACE (shared across flows), FLOW (this flow only), EXECUTION (this run only)").default("FLOW");
@@ -16474,7 +17016,7 @@ function filesDeleteOptions(include) {
16474
17016
  return group("filesDeleteOptions", FlowExtensionParamWidgetTypes.FILE_DELETE_OPTIONS, DELETE_FIELDS, include);
16475
17017
  }
16476
17018
 
16477
- // ../../flow-extension-runner/src/v2/params/zod.ts
17019
+ // ../../flow-extension-runner/src/params/zod.ts
16478
17020
  var extended = false;
16479
17021
  function extendPrototype() {
16480
17022
  if (extended) {
@@ -16505,6 +17047,9 @@ function extendPrototype() {
16505
17047
  }
16506
17048
  return this.meta({ frDictionary: binding });
16507
17049
  };
17050
+ proto.dateFormat = function dateFormat(pattern) {
17051
+ return this.meta({ frDateFormat: pattern });
17052
+ };
16508
17053
  proto.labels = function labels(byValue) {
16509
17054
  return this.meta({ frLabels: byValue });
16510
17055
  };
@@ -16542,7 +17087,7 @@ Object.defineProperties(namespace, {
16542
17087
  });
16543
17088
  var z = namespace;
16544
17089
 
16545
- // ../../flow-extension-runner/src/v2/params/json/values.ts
17090
+ // ../../flow-extension-runner/src/params/json/values.ts
16546
17091
  function toJsonValue(value) {
16547
17092
  if (typeof value === "bigint") {
16548
17093
  return { $bigint: value.toString() };
@@ -16559,7 +17104,7 @@ function toJsonValue(value) {
16559
17104
  return value;
16560
17105
  }
16561
17106
 
16562
- // ../../flow-extension-runner/src/v2/params/json/checks.ts
17107
+ // ../../flow-extension-runner/src/params/json/checks.ts
16563
17108
  var defOf = (check) => check?._zod?.def ?? {};
16564
17109
  function messageOf(source) {
16565
17110
  const { error } = source;
@@ -16638,10 +17183,10 @@ function encodeChecks(core) {
16638
17183
  return { checks, unsupported };
16639
17184
  }
16640
17185
 
16641
- // ../../flow-extension-runner/src/v2/params/json/types.ts
17186
+ // ../../flow-extension-runner/src/params/json/types.ts
16642
17187
  var SCHEMA_JSON_VERSION = 1;
16643
17188
 
16644
- // ../../flow-extension-runner/src/v2/params/json/decode.ts
17189
+ // ../../flow-extension-runner/src/params/json/decode.ts
16645
17190
  var FORMAT_FACTORIES = {
16646
17191
  url: z.url,
16647
17192
  email: z.email,
@@ -16671,7 +17216,7 @@ var FORMAT_FACTORIES = {
16671
17216
  duration: z.iso?.duration
16672
17217
  };
16673
17218
 
16674
- // ../../flow-extension-runner/src/v2/params/json/encode.ts
17219
+ // ../../flow-extension-runner/src/params/json/encode.ts
16675
17220
  var FIELD_TYPES = /* @__PURE__ */ new Set([
16676
17221
  "string",
16677
17222
  "number",
@@ -16803,6 +17348,7 @@ function encodeField(name, schema, seen = /* @__PURE__ */ new Set(), loaderId, s
16803
17348
  name,
16804
17349
  type,
16805
17350
  ...format ? { format } : {},
17351
+ ...format === "datetime" && core?._zod?.def?.local ? { local: true } : {},
16806
17352
  ...optional ? { optional: true } : {},
16807
17353
  ...nullable ? { nullable: true } : {},
16808
17354
  ...hasDefault ? { default: toJsonValue(defaultValue) } : {},
@@ -16838,7 +17384,7 @@ function encodeParams(scheme, options = {}) {
16838
17384
  };
16839
17385
  }
16840
17386
 
16841
- // ../../flow-extension-runner/src/v2/context/method-input.ts
17387
+ // ../../flow-extension-runner/src/context/method-input.ts
16842
17388
  var MethodInput = class {
16843
17389
  constructor(serviceId, methodName, data = {}) {
16844
17390
  this.serviceId = serviceId;
@@ -16896,7 +17442,7 @@ var MethodInput = class {
16896
17442
  }
16897
17443
  };
16898
17444
 
16899
- // ../../flow-extension-runner/src/v2/method.ts
17445
+ // ../../flow-extension-runner/src/method.ts
16900
17446
  var ExtensionMethod = class {
16901
17447
  constructor(extension) {
16902
17448
  this.extension = extension;
@@ -16925,7 +17471,7 @@ var ExtensionMethod = class {
16925
17471
  }
16926
17472
  };
16927
17473
 
16928
- // ../../flow-extension-runner/src/common/constants.ts
17474
+ // ../../flow-extension-runner/src/params/config-types.ts
16929
17475
  var ServiceConfigItemTypes = {
16930
17476
  STRING: "string",
16931
17477
  BOOL: "bool",
@@ -16934,7 +17480,7 @@ var ServiceConfigItemTypes = {
16934
17480
  TEXT: "text"
16935
17481
  };
16936
17482
 
16937
- // ../../flow-extension-runner/src/v2/model/field-mapper.ts
17483
+ // ../../flow-extension-runner/src/model/field-mapper.ts
16938
17484
  var descriptionOf = (schema) => inspect(schema).meta.description || "";
16939
17485
  var isRequired = (schema) => absenceOf(schema).absence === "required";
16940
17486
  var isParamGroup = (ins) => ins.coreType === "object" && !!ins.meta.frWidget;
@@ -17041,7 +17587,7 @@ function fieldToConfigItem(name, schema) {
17041
17587
  };
17042
17588
  }
17043
17589
 
17044
- // ../../flow-extension-runner/src/v2/model/method-model.ts
17590
+ // ../../flow-extension-runner/src/model/method-model.ts
17045
17591
  function opaqueParam(name, type = "OBJECT") {
17046
17592
  return { name, required: false, description: "", type };
17047
17593
  }
@@ -17063,7 +17609,7 @@ function argsFromParams(params) {
17063
17609
  return args;
17064
17610
  }
17065
17611
 
17066
- // ../../flow-extension-runner/src/v2/model/params-model.ts
17612
+ // ../../flow-extension-runner/src/model/params-model.ts
17067
17613
  function toBodyParams(params) {
17068
17614
  const scope2 = DictionaryScope.ROOT.enter(params.keys());
17069
17615
  return params.fields().map(([name, schema]) => fieldToParam(name, schema, { scope: scope2 }));
@@ -17082,7 +17628,7 @@ function toConfigItems(config) {
17082
17628
  return config.fields().map(([name, schema]) => fieldToConfigItem(name, schema));
17083
17629
  }
17084
17630
 
17085
- // ../../flow-extension-runner/src/v2/result.ts
17631
+ // ../../flow-extension-runner/src/result.ts
17086
17632
  function inferReturnType(value) {
17087
17633
  if (Array.isArray(value)) {
17088
17634
  return "LIST";
@@ -17150,7 +17696,7 @@ var ResultSpec = class _ResultSpec {
17150
17696
  }
17151
17697
  };
17152
17698
 
17153
- // ../../flow-extension-runner/src/v2/actions/action-method.ts
17699
+ // ../../flow-extension-runner/src/actions/action-method.ts
17154
17700
  var ActionMethod = class extends ExtensionMethod {
17155
17701
  constructor(extension, props) {
17156
17702
  super(extension);
@@ -17276,7 +17822,7 @@ var ActionMethod = class extends ExtensionMethod {
17276
17822
  }
17277
17823
  };
17278
17824
 
17279
- // ../../flow-extension-runner/src/common/context-files.ts
17825
+ // ../../flow-extension-runner/src/context/files.ts
17280
17826
  var import_backendless_request = __toESM(require_lib());
17281
17827
  var FileScope = {
17282
17828
  WORKSPACE: "WORKSPACE",
@@ -17284,7 +17830,7 @@ var FileScope = {
17284
17830
  EXECUTION: "EXECUTION"
17285
17831
  };
17286
17832
 
17287
- // ../../flow-extension-runner/src/v2/context/logger.ts
17833
+ // ../../flow-extension-runner/src/context/logger.ts
17288
17834
  var defaultLogger = {
17289
17835
  debug: () => {
17290
17836
  },
@@ -17294,7 +17840,7 @@ var defaultLogger = {
17294
17840
  error: (...args) => console.error(...args)
17295
17841
  };
17296
17842
 
17297
- // ../../flow-extension-runner/src/v2/context/proxies.ts
17843
+ // ../../flow-extension-runner/src/context/proxies.ts
17298
17844
  function createThrowingProxy(feature, hint2) {
17299
17845
  const fail2 = () => {
17300
17846
  throw new FeatureNotEnabledError(feature, hint2);
@@ -17314,7 +17860,7 @@ function createThrowingProxy(feature, hint2) {
17314
17860
  );
17315
17861
  }
17316
17862
 
17317
- // ../../flow-extension-runner/src/v2/context/execution-context.ts
17863
+ // ../../flow-extension-runner/src/context/execution-context.ts
17318
17864
  var ExecutionContext = class _ExecutionContext {
17319
17865
  #extension;
17320
17866
  #options;
@@ -17330,8 +17876,23 @@ var ExecutionContext = class _ExecutionContext {
17330
17876
  get logger() {
17331
17877
  return this.#options.logger ?? defaultLogger;
17332
17878
  }
17879
+ get invocation() {
17880
+ return this.#options.invocation ?? {};
17881
+ }
17333
17882
  get config() {
17334
- this.#config ??= this.#extension.config.resolve(this.#options.configs);
17883
+ if (!this.#config) {
17884
+ const { result, notices } = collectNotices(() => this.#extension.config.resolve(this.#options.configs));
17885
+ for (const { message, field, value, converted } of notices) {
17886
+ this.logger.warn(`[flow-extension:${this.#extension.id}] config item "${field ?? "?"}": ${message}`, {
17887
+ serviceId: this.#extension.id,
17888
+ configItem: field,
17889
+ value,
17890
+ converted,
17891
+ ...this.invocation
17892
+ });
17893
+ }
17894
+ this.#config = result;
17895
+ }
17335
17896
  return this.#config;
17336
17897
  }
17337
17898
  // The header access token plus its deserialized composite payload — or a throwing proxy when the
@@ -17401,14 +17962,14 @@ var ExecutionContext = class _ExecutionContext {
17401
17962
  }
17402
17963
  };
17403
17964
 
17404
- // ../../flow-extension-runner/src/v2/dictionaries/payload-schema.ts
17965
+ // ../../flow-extension-runner/src/dictionaries/payload-schema.ts
17405
17966
  var DictionaryPayloadSchema = z.looseObject({
17406
17967
  search: z.string().optional(),
17407
17968
  cursor: z.union([z.string(), z.number()]).nullish(),
17408
17969
  criteria: z.record(z.string(), z.unknown()).optional()
17409
17970
  });
17410
17971
 
17411
- // ../../flow-extension-runner/src/v2/dictionaries/dictionary-method.ts
17972
+ // ../../flow-extension-runner/src/dictionaries/dictionary-method.ts
17412
17973
  var isBlank2 = (value) => value === void 0 || value === null || value === "";
17413
17974
  var DictionaryMethod = class extends ExtensionMethod {
17414
17975
  constructor(extension, props) {
@@ -17553,7 +18114,7 @@ var DictionaryMethod = class extends ExtensionMethod {
17553
18114
  };
17554
18115
  }
17555
18116
  // Describe the full payload shape so the method advertises a complete, labelled input scheme (nested
17556
- // props inline their own labels — mirroring the v1 jsdoc-parser layout).
18117
+ // props inline their own labels — mirroring the layout the v1 JSDoc parser established).
17557
18118
  #payloadParam() {
17558
18119
  const properties = [
17559
18120
  { name: "search", required: false, description: "Optional search string to filter results.", type: "STRING", label: "Search" },
@@ -17579,12 +18140,12 @@ var DictionaryMethod = class extends ExtensionMethod {
17579
18140
  }
17580
18141
  };
17581
18142
 
17582
- // ../../flow-extension-runner/src/v2/loaders/payload-schema.ts
18143
+ // ../../flow-extension-runner/src/loaders/payload-schema.ts
17583
18144
  var LoaderPayloadSchema = z.looseObject({
17584
18145
  criteria: z.record(z.string(), z.unknown()).optional()
17585
18146
  });
17586
18147
 
17587
- // ../../flow-extension-runner/src/v2/loaders/loader-method.ts
18148
+ // ../../flow-extension-runner/src/loaders/loader-method.ts
17588
18149
  var LoaderMethod = class extends ExtensionMethod {
17589
18150
  constructor(extension, owner) {
17590
18151
  super(extension);
@@ -17738,17 +18299,17 @@ var DynamicPropsLoaderMethod = class extends ParamsLoaderMethod {
17738
18299
  }
17739
18300
  };
17740
18301
 
17741
- // ../../flow-extension-runner/src/v2/oauth/oauth2.ts
18302
+ // ../../flow-extension-runner/src/oauth/oauth2.ts
17742
18303
  var import_crypto = __toESM(require("crypto"));
17743
18304
 
17744
- // ../../flow-extension-runner/src/v2/oauth/method-names.ts
18305
+ // ../../flow-extension-runner/src/oauth/method-names.ts
17745
18306
  var OAUTH_SYSTEM_METHODS = {
17746
18307
  CONNECTION_URL: "getOAuth2ConnectionURL",
17747
18308
  EXECUTE_CALLBACK: "executeCallback",
17748
18309
  REFRESH_TOKEN: "refreshToken"
17749
18310
  };
17750
18311
 
17751
- // ../../flow-extension-runner/src/v2/oauth/system-params.ts
18312
+ // ../../flow-extension-runner/src/oauth/system-params.ts
17752
18313
  var OAuthCallbackObjectSchema = z.looseObject({
17753
18314
  code: z.string().optional(),
17754
18315
  redirectURI: z.string().optional(),
@@ -17757,7 +18318,7 @@ var OAuthCallbackObjectSchema = z.looseObject({
17757
18318
  });
17758
18319
  var RefreshTokenSchema = z.string().min(1);
17759
18320
 
17760
- // ../../flow-extension-runner/src/v2/oauth/oauth2.ts
18321
+ // ../../flow-extension-runner/src/oauth/oauth2.ts
17761
18322
  var OAuth2 = class {
17762
18323
  constructor(extension, props) {
17763
18324
  this.extension = extension;
@@ -17902,10 +18463,10 @@ function userDataOf(token) {
17902
18463
  return token && typeof token === "object" ? token.userData : void 0;
17903
18464
  }
17904
18465
 
17905
- // ../../flow-extension-runner/src/v2/polling-triggers/method-names.ts
18466
+ // ../../flow-extension-runner/src/polling-triggers/method-names.ts
17906
18467
  var POLLING_SYSTEM_METHOD = "handleTriggerPollingForEvent";
17907
18468
 
17908
- // ../../flow-extension-runner/src/v2/polling-triggers/system-params.ts
18469
+ // ../../flow-extension-runner/src/polling-triggers/system-params.ts
17909
18470
  var PollingInvocationSchema = z.looseObject({
17910
18471
  eventName: z.string().min(1),
17911
18472
  // The trigger instance's configured params — validated against the trigger's own schema separately.
@@ -17915,7 +18476,7 @@ var PollingInvocationSchema = z.looseObject({
17915
18476
  connectionId: z.string().nullish()
17916
18477
  });
17917
18478
 
17918
- // ../../flow-extension-runner/src/v2/polling-triggers/polling-triggers.ts
18479
+ // ../../flow-extension-runner/src/polling-triggers/polling-triggers.ts
17919
18480
  var PollingTriggers = class {
17920
18481
  constructor(extension) {
17921
18482
  this.extension = extension;
@@ -17954,15 +18515,15 @@ var PollingTriggers = class {
17954
18515
  }
17955
18516
  };
17956
18517
 
17957
- // ../../flow-extension-runner/src/v2/path.ts
17958
- function getPath(source, path19) {
17959
- return path19.split(".").reduce(
18518
+ // ../../flow-extension-runner/src/path.ts
18519
+ function getPath(source, path18) {
18520
+ return path18.split(".").reduce(
17960
18521
  (acc, key) => acc == null ? acc : acc[key],
17961
18522
  source
17962
18523
  );
17963
18524
  }
17964
18525
 
17965
- // ../../flow-extension-runner/src/v2/polling-triggers/mechanisms.ts
18526
+ // ../../flow-extension-runner/src/polling-triggers/mechanisms.ts
17966
18527
  var PollingMechanism = class {
17967
18528
  /**
17968
18529
  * Pick the strategy an author declared, rejecting the combinations that cannot work. Runs at REGISTRATION
@@ -18096,7 +18657,7 @@ var WatermarkMechanism = class extends FetchingMechanism {
18096
18657
  }
18097
18658
  };
18098
18659
 
18099
- // ../../flow-extension-runner/src/v2/polling-triggers/trigger-method.ts
18660
+ // ../../flow-extension-runner/src/polling-triggers/trigger-method.ts
18100
18661
  var PollingTriggerMethod = class extends ExtensionMethod {
18101
18662
  constructor(extension, props) {
18102
18663
  super(extension);
@@ -18166,7 +18727,7 @@ var PollingTriggerMethod = class extends ExtensionMethod {
18166
18727
  }
18167
18728
  };
18168
18729
 
18169
- // ../../flow-extension-runner/src/v2/realtime-triggers/method-names.ts
18730
+ // ../../flow-extension-runner/src/realtime-triggers/method-names.ts
18170
18731
  var REALTIME_SYSTEM_METHODS = {
18171
18732
  UPSERT: "handleTriggerUpsertWebhook",
18172
18733
  RESOLVE: "handleTriggerResolveEvents",
@@ -18175,7 +18736,7 @@ var REALTIME_SYSTEM_METHODS = {
18175
18736
  REFRESH: "handleTriggerRefreshWebhook"
18176
18737
  };
18177
18738
 
18178
- // ../../flow-extension-runner/src/v2/realtime-triggers/system-params.ts
18739
+ // ../../flow-extension-runner/src/realtime-triggers/system-params.ts
18179
18740
  var anyRecord = () => z.record(z.string(), z.unknown());
18180
18741
  var SubscriptionEventSchema = z.looseObject({
18181
18742
  name: z.string().min(1),
@@ -18211,7 +18772,7 @@ var RealtimeSelectInvocationSchema = z.looseObject({
18211
18772
  })).default([])
18212
18773
  });
18213
18774
 
18214
- // ../../flow-extension-runner/src/v2/realtime-triggers/verify.ts
18775
+ // ../../flow-extension-runner/src/realtime-triggers/verify.ts
18215
18776
  function verifyDeclarative(verify, rawBody, headers, config, webhookData) {
18216
18777
  const secret = verify.secret(config, { webhookData });
18217
18778
  if (!secret) {
@@ -18234,7 +18795,7 @@ function verifyDeclarative(verify, rawBody, headers, config, webhookData) {
18234
18795
  return true;
18235
18796
  }
18236
18797
 
18237
- // ../../flow-extension-runner/src/v2/realtime-triggers/realtime-setup.ts
18798
+ // ../../flow-extension-runner/src/realtime-triggers/realtime-setup.ts
18238
18799
  function readExtract(extract, body) {
18239
18800
  if (typeof extract === "function") {
18240
18801
  return extract({ requestBody: body });
@@ -18530,7 +19091,7 @@ var RealtimeSetup = class {
18530
19091
  }
18531
19092
  };
18532
19093
 
18533
- // ../../flow-extension-runner/src/v2/realtime-triggers/trigger-method.ts
19094
+ // ../../flow-extension-runner/src/realtime-triggers/trigger-method.ts
18534
19095
  function isFilled(value) {
18535
19096
  return value != null && value !== "";
18536
19097
  }
@@ -18626,12 +19187,12 @@ var RealtimeTriggerMethod = class extends ExtensionMethod {
18626
19187
  if (typeof match === "function") {
18627
19188
  return !!await match({ params, providerEventData, webhookData });
18628
19189
  }
18629
- for (const [paramKey, path19] of Object.entries(match)) {
19190
+ for (const [paramKey, path18] of Object.entries(match)) {
18630
19191
  const paramValue = params[paramKey];
18631
19192
  if (!isFilled(paramValue)) {
18632
19193
  continue;
18633
19194
  }
18634
- if (`${paramValue}` !== `${getPath(providerEventData, path19)}`) {
19195
+ if (`${paramValue}` !== `${getPath(providerEventData, path18)}`) {
18635
19196
  return false;
18636
19197
  }
18637
19198
  }
@@ -18667,7 +19228,7 @@ var RealtimeTriggerMethod = class extends ExtensionMethod {
18667
19228
  }
18668
19229
  };
18669
19230
 
18670
- // ../../flow-extension-runner/src/v2/system-method.ts
19231
+ // ../../flow-extension-runner/src/system-method.ts
18671
19232
  var SystemMethod = class extends ExtensionMethod {
18672
19233
  constructor(extension, spec) {
18673
19234
  super(extension);
@@ -18724,7 +19285,7 @@ var SystemMethod = class extends ExtensionMethod {
18724
19285
  }
18725
19286
  };
18726
19287
 
18727
- // ../../flow-extension-runner/src/v2/extension.ts
19288
+ // ../../flow-extension-runner/src/extension.ts
18728
19289
  var Extension = class {
18729
19290
  #props;
18730
19291
  #config;
@@ -18845,7 +19406,23 @@ var Extension = class {
18845
19406
  // generated loader, SYSTEM seam — arrives here through the same three steps.
18846
19407
  async run(methodName, methodData, ctx) {
18847
19408
  const method = this.getMethod(methodName);
18848
- return method.execute(method.validate(methodData ?? {}), ctx);
19409
+ const { result: input, notices } = collectNotices(() => method.validate(methodData ?? {}));
19410
+ this.#reportNotices(notices, methodName, ctx);
19411
+ return method.execute(input, ctx);
19412
+ }
19413
+ // One warning per value the pipeline accepted only under a temporary rule — today a timestamp converted for
19414
+ // a date-string field (FR-3920 lenient period). Named well enough to find the flow still holding one.
19415
+ #reportNotices(notices, methodName, ctx) {
19416
+ for (const { message, field, value, converted } of notices) {
19417
+ ctx.logger.warn(`[flow-extension:${this.id}] ${methodName}: param "${field ?? "?"}": ${message}`, {
19418
+ serviceId: this.id,
19419
+ method: methodName,
19420
+ param: field,
19421
+ value,
19422
+ converted,
19423
+ ...ctx.invocation
19424
+ });
19425
+ }
18849
19426
  }
18850
19427
  // ── output model ────────────────────────────────────────────────────────────
18851
19428
  toConfigItems() {
@@ -18864,8 +19441,8 @@ var Extension = class {
18864
19441
  };
18865
19442
  }
18866
19443
  /**
18867
- * The published model — the v2 analogue of jsdoc-parser's `parseJsDocToServiceJson`, and the same
18868
- * `{ serviceInfo, methodsMap }` shape the console consumes for a v1 service.
19444
+ * The published model — the `{ serviceInfo, methodsMap }` shape the console consumes, the same one the
19445
+ * removed v1 JSDoc parser produced.
18869
19446
  *
18870
19447
  * Every method describes itself, so this is one pass with no per-kind branches: what a service publishes
18871
19448
  * is exactly what it registered.
@@ -18878,8 +19455,6 @@ var Extension = class {
18878
19455
  }
18879
19456
  }
18880
19457
  return {
18881
- runnerVersion: "v2",
18882
- //TODO: temp
18883
19458
  serviceInfo: this.toServiceInfo(),
18884
19459
  methodsMap,
18885
19460
  configSchema: encodeParams(this.config.scheme)
@@ -18919,7 +19494,7 @@ var Extension = class {
18919
19494
  }
18920
19495
  };
18921
19496
 
18922
- // ../../flow-extension-runner/src/v2/registry.ts
19497
+ // ../../flow-extension-runner/src/registry.ts
18923
19498
  var ExtensionRegistry = class {
18924
19499
  #extensions = /* @__PURE__ */ new Map();
18925
19500
  register(extension) {
@@ -18939,15 +19514,19 @@ var ExtensionRegistry = class {
18939
19514
  * which imports it.
18940
19515
  */
18941
19516
  load(id, entryPointPath) {
18942
- if (!this.get(id)) {
18943
- require(entryPointPath);
18944
- }
18945
- const extension = this.get(id);
19517
+ const extension = this.tryLoad(id, entryPointPath);
18946
19518
  if (!extension) {
18947
19519
  throw new ExtensionNotRegisteredError(id, entryPointPath);
18948
19520
  }
18949
19521
  return extension;
18950
19522
  }
19523
+ /** As `load`, but `undefined` instead of throwing when the module registers no extension under `id`. */
19524
+ tryLoad(id, entryPointPath) {
19525
+ if (!this.get(id)) {
19526
+ require(entryPointPath);
19527
+ }
19528
+ return this.get(id);
19529
+ }
18951
19530
  // Test-only: clear the registry between isolated cases.
18952
19531
  reset() {
18953
19532
  this.#extensions.clear();
@@ -18958,7 +19537,7 @@ function getExtension(id) {
18958
19537
  return registry.get(id);
18959
19538
  }
18960
19539
 
18961
- // ../../flow-extension-runner/src/v2/create-extension.ts
19540
+ // ../../flow-extension-runner/src/create-extension.ts
18962
19541
  function createExtension(props) {
18963
19542
  const extension = new Extension(props);
18964
19543
  const api = {
@@ -18986,7 +19565,7 @@ function createExtension(props) {
18986
19565
  return api;
18987
19566
  }
18988
19567
 
18989
- // ../../flow-extension-runner/src/v2/crypto.ts
19568
+ // ../../flow-extension-runner/src/crypto.ts
18990
19569
  var import_crypto2 = __toESM(require("crypto"));
18991
19570
  var crypto2 = {
18992
19571
  hmac(algo, key, data, encoding = "hex") {
@@ -19022,689 +19601,99 @@ var flowrunnerRuntime = {
19022
19601
  z,
19023
19602
  crypto: crypto2,
19024
19603
  createExtension,
19025
- getExtension,
19026
- ServerCode: null
19604
+ getExtension
19027
19605
  };
19028
19606
  global.Flowrunner = flowrunnerRuntime;
19029
19607
 
19030
- // ../../flow-extension-runner/src/common/config.ts
19031
- var ConfigValueAdapters = {
19032
- [ServiceConfigItemTypes.BOOL]: {
19033
- deserialize: (value) => typeof value === "string" ? value === "true" : !!value,
19034
- isEmpty: (value) => typeof value !== "boolean"
19035
- },
19036
- default: {
19037
- deserialize: (value) => value,
19038
- isEmpty: (value) => !value
19039
- }
19040
- };
19041
-
19042
- // ../../flow-extension-runner/src/v1/config.ts
19043
- function normalizeConfigItems(sourceConfigItems) {
19044
- return sourceConfigItems?.map((item) => ({
19045
- name: item.name,
19046
- type: item.type || ServiceConfigItemTypes.STRING,
19047
- shared: !!item.shared,
19048
- required: !!item.required,
19049
- description: item.description || item.hint || "",
19050
- label: item.label || item.displayName || item.name,
19051
- defaultValue: item.defaultValue,
19052
- options: item.options || []
19053
- })) || [];
19054
- }
19055
-
19056
- // ../../flow-extension-runner/src/v1/namespace.ts
19057
- var services = /* @__PURE__ */ new Map();
19058
- function createFlowrunnerSandboxV1(serviceId, cb) {
19059
- global.Flowrunner.ServerCode = {
19060
- addService(ServiceClass, sourceConfigItems) {
19061
- services.set(serviceId, {
19062
- ServiceClass,
19063
- configItems: normalizeConfigItems(sourceConfigItems)
19064
- });
19065
- },
19066
- ConfigItems: {
19067
- TYPES: ServiceConfigItemTypes
19068
- }
19069
- };
19070
- try {
19071
- cb();
19072
- } finally {
19073
- global.Flowrunner.ServerCode = null;
19074
- }
19075
- return services.get(serviceId);
19076
- }
19077
-
19078
- // ../../flow-extension-runner/src/v1/service.ts
19079
- function requireService(serviceId, serviceEntryPointPath) {
19080
- const registered = createFlowrunnerSandboxV1(serviceId, () => {
19081
- require(serviceEntryPointPath);
19082
- });
19083
- if (!registered?.ServiceClass) {
19084
- throw new Error(`There is no registered ServiceClass serviceEntryPointPath="${serviceEntryPointPath}"`);
19085
- }
19086
- return registered;
19087
- }
19608
+ // ../../flow-extension-runner/src/index.ts
19088
19609
  function getServiceConfigs(serviceId, serviceEntryPointPath) {
19089
- const { configItems } = requireService(serviceId, serviceEntryPointPath);
19090
- return configItems;
19091
- }
19092
-
19093
- // ../../flow-extension-runner/src/v2/index.ts
19094
- function getServiceConfigs2(serviceId, serviceEntryPointPath) {
19095
19610
  return registry.load(serviceId, serviceEntryPointPath).toConfigItems();
19096
19611
  }
19097
19612
  function buildServiceDefinition(serviceId, serviceEntryPointPath) {
19098
- return registry.load(serviceId, serviceEntryPointPath).toDefinition();
19099
- }
19100
-
19101
- // ../../flow-extension-runner/src/index.ts
19102
- function detectVersion(serviceId, serviceEntryPointPath) {
19103
- createFlowrunnerSandboxV1(serviceId, () => {
19104
- require(serviceEntryPointPath);
19105
- });
19106
- return getExtension(serviceId) ? "v2" : "v1";
19107
- }
19108
- function getServiceConfigs3(serviceId, serviceEntryPointPath) {
19109
- return detectVersion(serviceId, serviceEntryPointPath) === "v2" ? getServiceConfigs2(serviceId, serviceEntryPointPath) : getServiceConfigs(serviceId, serviceEntryPointPath);
19110
- }
19111
- function buildServiceDefinition2(serviceId, serviceEntryPointPath) {
19112
- return detectVersion(serviceId, serviceEntryPointPath) === "v2" ? buildServiceDefinition(serviceId, serviceEntryPointPath) : null;
19113
- }
19114
-
19115
- // ../../jsdoc-parser/src/custom-type-defs/files.ts
19116
- var SCOPE_FIELD = {
19117
- name: "scope",
19118
- type: "String",
19119
- required: false,
19120
- label: "Scope",
19121
- description: "Storage scope: WORKSPACE (shared across flows), FLOW (this flow only), EXECUTION (this run only)",
19122
- uiComponent: { type: "DROPDOWN", options: { values: ["WORKSPACE", "FLOW", "EXECUTION"] } },
19123
- defaultValue: "FLOW"
19124
- };
19125
- var filesTypeDefs = {
19126
- FilesUploadOptions: [
19127
- SCOPE_FIELD,
19128
- {
19129
- name: "filename",
19130
- type: "String",
19131
- required: false,
19132
- label: "Filename",
19133
- description: "Custom filename (defaults to the original name if omitted)",
19134
- uiComponent: { type: "SINGLE_LINE_TEXT" }
19135
- },
19136
- {
19137
- name: "ttl",
19138
- type: "Number",
19139
- required: false,
19140
- label: "URL TTL (seconds)",
19141
- description: "How long the download URL remains valid",
19142
- uiComponent: { type: "NUMERIC" }
19143
- },
19144
- {
19145
- name: "objectTtl",
19146
- type: "Number",
19147
- required: false,
19148
- label: "File TTL (seconds)",
19149
- description: "How long the file is kept in storage (omit for permanent storage)",
19150
- uiComponent: { type: "NUMERIC" }
19151
- },
19152
- {
19153
- name: "overwrite",
19154
- type: "Boolean",
19155
- required: false,
19156
- label: "Overwrite existing",
19157
- description: "Replace the file if one with the same name already exists",
19158
- uiComponent: { type: "TOGGLE" }
19159
- },
19160
- {
19161
- name: "generateUrl",
19162
- type: "Boolean",
19163
- required: false,
19164
- label: "Generate download URL",
19165
- description: "Include a pre-signed download URL in the response",
19166
- uiComponent: { type: "TOGGLE" },
19167
- defaultValue: true
19168
- }
19169
- ],
19170
- FilesListOptions: [
19171
- SCOPE_FIELD,
19172
- {
19173
- name: "limit",
19174
- type: "Number",
19175
- required: false,
19176
- label: "Limit",
19177
- description: "Maximum number of files to return",
19178
- uiComponent: { type: "NUMERIC" }
19179
- },
19180
- {
19181
- name: "ttl",
19182
- type: "Number",
19183
- required: false,
19184
- label: "URL TTL (seconds)",
19185
- description: "How long the download URLs remain valid",
19186
- uiComponent: { type: "NUMERIC" }
19187
- },
19188
- {
19189
- name: "generateUrl",
19190
- type: "Boolean",
19191
- required: false,
19192
- label: "Generate download URLs",
19193
- description: "Include pre-signed download URLs in the response",
19194
- uiComponent: { type: "TOGGLE" },
19195
- defaultValue: true
19196
- },
19197
- {
19198
- name: "cursor",
19199
- type: "String",
19200
- required: false,
19201
- label: "Cursor",
19202
- description: "Pagination cursor from a previous response",
19203
- uiComponent: { type: "SINGLE_LINE_TEXT" }
19204
- }
19205
- ],
19206
- FilesGetOptions: [
19207
- SCOPE_FIELD,
19208
- {
19209
- name: "ttl",
19210
- type: "Number",
19211
- required: false,
19212
- label: "URL TTL (seconds)",
19213
- description: "How long the download URL remains valid",
19214
- uiComponent: { type: "NUMERIC" }
19215
- },
19216
- {
19217
- name: "generateUrl",
19218
- type: "Boolean",
19219
- required: false,
19220
- label: "Generate download URL",
19221
- description: "Include a pre-signed download URL in the response",
19222
- uiComponent: { type: "TOGGLE" },
19223
- defaultValue: true
19224
- }
19225
- ],
19226
- FilesDeleteOptions: [
19227
- SCOPE_FIELD
19228
- ]
19229
- };
19230
-
19231
- // ../../jsdoc-parser/src/lib.ts
19232
- var import_fs3 = __toESM(require("fs"));
19233
- var import_path6 = __toESM(require("path"));
19234
- function resolveJSDocPath() {
19235
- const jsDocHolders = require.resolve.paths("jsdoc/lib") || [];
19236
- const jsDocPaths = jsDocHolders.map((p) => import_path6.default.join(p, "jsdoc/lib"));
19237
- for (let i = 0; i < jsDocPaths.length; i++) {
19238
- if (import_fs3.default.existsSync(jsDocPaths[i])) {
19239
- return jsDocPaths[i];
19240
- }
19241
- }
19242
- throw new Error("Can not resolve path to JSDoc module.");
19243
- }
19244
- var jsdocPath = resolveJSDocPath();
19245
- var jsdocModulePath = (mod) => import_path6.default.join(jsdocPath, ...mod.split("/"));
19246
- var _jsdocRequire;
19247
- var jsdocRequire = (modulePath) => {
19248
- if (!_jsdocRequire) {
19249
- _jsdocRequire = require("requizzle")({
19250
- infect: true,
19251
- requirePaths: { before: [jsdocPath] }
19252
- });
19253
- const Config = _jsdocRequire(jsdocModulePath("jsdoc/config"));
19254
- const env = _jsdocRequire(jsdocModulePath("jsdoc/env"));
19255
- env.conf = new Config().get();
19256
- }
19257
- return _jsdocRequire(jsdocModulePath(modulePath));
19258
- };
19259
- function parseJSDoc(filePath) {
19260
- const parser = jsdocRequire("jsdoc/src/parser").createParser();
19261
- const handlers = jsdocRequire("jsdoc/src/handlers");
19262
- handlers.attachTo(parser);
19263
- return parser.parse([filePath]);
19264
- }
19265
-
19266
- // ../../jsdoc-parser/src/index.ts
19267
- var customTypeDef = {
19268
- FilesUploadOptions: filesTypeDefs.FilesUploadOptions,
19269
- FilesListOptions: filesTypeDefs.FilesListOptions,
19270
- FilesGetOptions: filesTypeDefs.FilesGetOptions,
19271
- FilesDeleteOptions: filesTypeDefs.FilesDeleteOptions
19272
- };
19273
- function findServiceClassName(doclets) {
19274
- const withIntegration = doclets.find((d) => {
19275
- if (d.kind === "class" && d.tags) {
19276
- return d.tags.find((t) => t.originalTitle === "integrationName");
19277
- }
19278
- });
19279
- if (withIntegration) {
19280
- return withIntegration.name;
19281
- }
19282
- return null;
19283
- }
19284
- function parseJSDocs(filePath) {
19285
- const doclets = parseJSDoc(filePath);
19286
- const className = findServiceClassName(doclets);
19287
- let serviceInfo = null;
19288
- const methods = [];
19289
- const typedefsMap = {};
19290
- doclets.forEach((d) => {
19291
- if (d.kind === "class" && d.name === className) {
19292
- serviceInfo = composeServiceInfo(d);
19293
- } else if (d.kind === "function" && d.memberof === className && d.scope === "instance") {
19294
- methods.push(composeMethod(d));
19295
- } else if (d.kind === "typedef") {
19296
- const typedefParams = collectTypedef(d);
19297
- if (typedefParams) {
19298
- typedefsMap[d.name] = typedefParams;
19299
- }
19300
- }
19301
- });
19302
- return {
19303
- serviceInfo,
19304
- methods,
19305
- // Extension-defined typedefs override built-ins so authors can customise if needed
19306
- typedefsMap: { ...customTypeDef, ...typedefsMap }
19307
- };
19308
- }
19309
- var ServiceInfoTagsProcessors = {
19310
- integrationName: (serviceInfo, tagValue) => {
19311
- serviceInfo.integrationName = tagValue || void 0;
19312
- },
19313
- integrationIcon: (serviceInfo, tagValue) => {
19314
- serviceInfo.integrationIcon = tagValue || null;
19315
- },
19316
- requireOAuth: (serviceInfo) => {
19317
- serviceInfo.requireOAuth = true;
19318
- },
19319
- integrationTriggersScope: (serviceInfo, tagValue) => {
19320
- serviceInfo.integrationTriggersScope = tagValue || null;
19321
- }
19322
- };
19323
- function composeServiceInfo(d) {
19324
- const serviceInfo = {
19325
- serviceClassName: d.name,
19326
- integrationName: d.name,
19327
- integrationIcon: null,
19328
- requireOAuth: void 0,
19329
- integrationTriggersScope: null
19330
- };
19331
- iterateTags(d.tags, (tagName, tagValue) => {
19332
- if (ServiceInfoTagsProcessors[tagName]) {
19333
- ServiceInfoTagsProcessors[tagName](serviceInfo, tagValue);
19334
- }
19335
- });
19336
- return serviceInfo;
19337
- }
19338
- function iterateTags(tags, cb) {
19339
- if (tags) {
19340
- tags.forEach((tag) => {
19341
- const title = tag.originalTitle;
19342
- const value = tag.value || tag.text || "";
19343
- cb(title, value, tag);
19344
- });
19345
- }
19346
- }
19347
- var MethodTagsProcessors = {
19348
- paramDef: (methodInfo, tagValue) => {
19349
- if (tagValue) {
19350
- const parsedValue = parseJSON(tagValue);
19351
- if (parsedValue) {
19352
- methodInfo.paramDefs.push(parsedValue);
19353
- }
19354
- }
19355
- },
19356
- route: (methodInfo, tagValue) => {
19357
- if (tagValue) {
19358
- methodInfo.route = tagValue;
19359
- }
19360
- },
19361
- registerAs: (methodInfo, tagValue) => {
19362
- if (tagValue) {
19363
- methodInfo.registerAs = tagValue;
19364
- }
19365
- },
19366
- operationName: (methodInfo, tagValue) => {
19367
- if (tagValue) {
19368
- methodInfo.operationName = tagValue;
19369
- }
19370
- },
19371
- customIcon: (methodInfo, tagValue) => {
19372
- if (tagValue) {
19373
- methodInfo.customIcon = tagValue;
19374
- }
19375
- },
19376
- category: (methodInfo, tagValue) => {
19377
- if (tagValue) {
19378
- methodInfo.category = tagValue;
19379
- }
19380
- },
19381
- description: (methodInfo, tagValue) => {
19382
- if (tagValue) {
19383
- methodInfo.description = tagValue;
19384
- }
19385
- },
19386
- appearanceColor: (methodInfo, tagValue) => {
19387
- if (tagValue) {
19388
- const colors = extractColors(tagValue);
19389
- methodInfo.colorStart = colors.colorStart;
19390
- methodInfo.colorEnd = colors.colorEnd;
19391
- }
19392
- },
19393
- private: (methodInfo) => {
19394
- methodInfo.private = true;
19395
- },
19396
- sampleResult: (methodInfo, tagValue) => {
19397
- if (tagValue) {
19398
- methodInfo.sampleResult = parseJSON(tagValue);
19399
- }
19400
- },
19401
- sampleResultLoader: (methodInfo, tagValue) => {
19402
- if (tagValue) {
19403
- methodInfo.sampleResultLoader = parseJSON(tagValue);
19404
- }
19405
- }
19406
- };
19407
- function composeMethod(m) {
19408
- const methodInfo = {
19409
- name: m.name,
19410
- description: m.description || "",
19411
- returnType: mapReturnType(m.returns?.[0].type?.names?.[0]),
19412
- registerAs: "",
19413
- colorStart: "",
19414
- colorEnd: "",
19415
- private: m.access === "private",
19416
- operationName: m.name,
19417
- customIcon: "",
19418
- category: "",
19419
- sampleResult: null,
19420
- sampleResultLoader: null,
19421
- routeStr: "",
19422
- paramDefs: []
19423
- };
19424
- if (m.params) {
19425
- m.params.forEach((p) => {
19426
- methodInfo.paramDefs.push({
19427
- name: p.name,
19428
- type: p.type?.names?.[0] || "String",
19429
- required: !p.optional
19430
- });
19431
- });
19432
- }
19433
- iterateTags(m.tags, (tagName, tagValue) => {
19434
- if (MethodTagsProcessors[tagName]) {
19435
- MethodTagsProcessors[tagName](methodInfo, tagValue);
19436
- }
19437
- });
19438
- return methodInfo;
19439
- }
19440
- var PRIMITIVES = ["String", "Object", "Boolean", "Number"];
19441
- var ParamTypesMap = {
19442
- String: "STRING",
19443
- Object: "OBJECT",
19444
- Boolean: "BOOLEAN",
19445
- Number: "NUMBER"
19446
- };
19447
- function mapParamType(type) {
19448
- if (!type) {
19449
- return "STRING";
19450
- }
19451
- if (type.startsWith("Array")) {
19452
- return "LIST";
19453
- }
19454
- return ParamTypesMap[type] || "STRING";
19455
- }
19456
- function mapReturnType(type) {
19457
- if (type) {
19458
- if (type === "Array" || type.startsWith("Array.") || type.startsWith("Array<")) return "LIST";
19459
- if (type === "Object") return "OBJECT";
19460
- if (type === "String") return "STRING";
19461
- }
19462
- return "VOID";
19463
- }
19464
- function collectTypedef(d) {
19465
- const defs = [];
19466
- iterateTags(d.tags, (title, value) => {
19467
- if (title === "paramDef") {
19468
- const parsedValue = parseJSON(value);
19469
- if (parsedValue) {
19470
- defs.push(parsedValue);
19471
- }
19472
- }
19473
- });
19474
- if (d.properties) {
19475
- d.properties.forEach((property) => {
19476
- const type = property?.type?.names?.[0];
19477
- defs.push({
19478
- name: property.name,
19479
- required: !property.optional,
19480
- description: property.description,
19481
- type
19482
- });
19483
- });
19484
- }
19485
- if (defs.length > 0) {
19486
- return defs;
19487
- }
19488
- }
19489
- function buildParam(paramDef, typedefsMap, nested = false) {
19490
- const isCustomType = !nested && paramDef.type && !PRIMITIVES.includes(paramDef.type) && !paramDef.type.startsWith("Array");
19491
- let properties;
19492
- if (isCustomType && typedefsMap[paramDef.type]) {
19493
- let subDefs = typedefsMap[paramDef.type];
19494
- if (paramDef.include?.length) {
19495
- const includeSet = new Set(paramDef.include);
19496
- subDefs = subDefs.filter((sd) => includeSet.has(sd.name));
19497
- }
19498
- if (subDefs.length > 0) {
19499
- properties = subDefs.map((sp) => buildParam(sp, typedefsMap, true));
19500
- }
19501
- }
19502
- const param = {
19503
- name: paramDef.name,
19504
- required: paramDef.required || false,
19505
- description: paramDef.description || "",
19506
- type: isCustomType ? "OBJECT" : mapParamType(paramDef.type)
19507
- };
19508
- if (nested) {
19509
- if (paramDef.label !== void 0) {
19510
- param.label = paramDef.label;
19511
- }
19512
- if (paramDef.uiComponent !== void 0) {
19513
- param.uiComponent = paramDef.uiComponent;
19514
- }
19515
- if (paramDef.dependsOn !== void 0) {
19516
- param.dependsOn = paramDef.dependsOn;
19517
- }
19518
- if (paramDef.dictionary !== void 0) {
19519
- param.dictionary = paramDef.dictionary;
19520
- }
19521
- if (paramDef.defaultValue !== void 0) {
19522
- param.defaultValue = paramDef.defaultValue;
19523
- }
19524
- }
19525
- if (properties && properties.length > 0) {
19526
- param.properties = properties;
19527
- }
19528
- if (param.type === "LIST") {
19529
- param.items = { type: "OBJECT" };
19530
- }
19531
- return param;
19532
- }
19533
- function buildMetaInfoArgs(paramDefs, typedefsMap) {
19534
- const args = {};
19535
- for (const pd of paramDefs) {
19536
- const isCustomType = pd.type && !PRIMITIVES.includes(pd.type) && !pd.type.startsWith("Array");
19537
- if (isCustomType && typedefsMap[pd.type]) {
19538
- const entry2 = {};
19539
- if (pd.label) entry2.label = pd.label;
19540
- args[pd.name] = entry2;
19541
- continue;
19542
- }
19543
- const entry = {};
19544
- if (pd.label) entry.label = pd.label;
19545
- if (pd.dictionary) entry.dictionary = pd.dictionary;
19546
- if (pd.dependsOn && pd.dependsOn.length > 0) entry.dependsOn = pd.dependsOn;
19547
- if (pd.uiComponent) entry.uiComponent = pd.uiComponent;
19548
- args[pd.name] = entry;
19549
- }
19550
- return args;
19551
- }
19552
- function extractColors(colorStr) {
19553
- if (!colorStr) {
19554
- return { colorStart: "", colorEnd: "" };
19555
- }
19556
- const colors = colorStr.split(/[,\s]+/).map((c) => c.trim()).filter(Boolean);
19557
- return {
19558
- colorStart: colors[0] || "",
19559
- colorEnd: colors[1] || colors[0] || ""
19560
- };
19561
- }
19562
- function parseJSON(str) {
19563
- try {
19564
- return JSON.parse(str);
19565
- } catch {
19566
- return null;
19567
- }
19568
- }
19569
- function parseJsDocToServiceJson(entryPoint) {
19570
- const { serviceInfo, methods, typedefsMap } = parseJSDocs(entryPoint);
19571
- const methodsMap = {};
19572
- for (const method of methods) {
19573
- if (method.private) {
19574
- continue;
19575
- }
19576
- const {
19577
- name,
19578
- route,
19579
- registerAs,
19580
- colorStart,
19581
- colorEnd,
19582
- operationName,
19583
- customIcon,
19584
- category,
19585
- description,
19586
- sampleResult,
19587
- sampleResultLoader,
19588
- paramDefs,
19589
- returnType
19590
- } = method;
19591
- const isSystem = registerAs === "SYSTEM";
19592
- const httpMethod = route ? route.split(/\s+/)[0].toUpperCase() : name.startsWith("get") ? "GET" : "POST";
19593
- const isQueryPlacement = httpMethod === "GET";
19594
- const params = paramDefs.map((pd) => buildParam(pd, typedefsMap));
19595
- const queryParams = isQueryPlacement ? params : [];
19596
- const bodyParams = isQueryPlacement ? [] : params;
19597
- const metaInfoArgs = paramDefs.length > 0 ? buildMetaInfoArgs(paramDefs, typedefsMap) : {};
19598
- methodsMap[name] = {
19599
- colorStart,
19600
- colorEnd,
19601
- queryParams,
19602
- // todo remove me
19603
- bodyParams,
19604
- customIcon: isSystem ? void 0 : customIcon,
19605
- registerAs,
19606
- category,
19607
- metaInfo: {
19608
- args: metaInfoArgs,
19609
- sampleResult: isSystem ? void 0 : sampleResult,
19610
- sampleResultLoader: isSystem ? void 0 : sampleResultLoader
19611
- },
19612
- returnType,
19613
- description,
19614
- operationName,
19615
- name
19616
- };
19617
- }
19618
- return {
19619
- runnerVersion: "v1",
19620
- //TODO: temp
19621
- methodsMap,
19622
- serviceInfo
19623
- };
19613
+ return registry.tryLoad(serviceId, serviceEntryPointPath)?.toDefinition() ?? null;
19624
19614
  }
19625
19615
 
19626
19616
  // src/operations/deploy/discover-services.ts
19627
19617
  function discoverServices(projectRoot = process.cwd()) {
19628
- const servicesDir = import_path7.default.resolve(projectRoot, "services");
19629
- if (!import_fs4.default.existsSync(servicesDir)) {
19618
+ const servicesDir = import_path6.default.resolve(projectRoot, "services");
19619
+ if (!import_fs3.default.existsSync(servicesDir)) {
19630
19620
  return { services: [], skipped: [] };
19631
19621
  }
19632
- const serviceIds = import_fs4.default.readdirSync(servicesDir, { withFileTypes: true }).filter((file) => file.isDirectory()).map((file) => file.name);
19633
- const services2 = [];
19622
+ const serviceIds = import_fs3.default.readdirSync(servicesDir, { withFileTypes: true }).filter((file) => file.isDirectory()).map((file) => file.name);
19623
+ const services = [];
19634
19624
  const skipped = [];
19635
19625
  for (const serviceId of serviceIds) {
19636
- const serviceDir = import_path7.default.resolve(servicesDir, serviceId);
19637
- const serviceDISTEntryPoint = import_path7.default.resolve(serviceDir, "./dist/index.js");
19638
- const serviceSRCEntryPoint = import_path7.default.resolve(serviceDir, "./src/index.js");
19626
+ const serviceDir = import_path6.default.resolve(servicesDir, serviceId);
19627
+ const serviceDISTEntryPoint = import_path6.default.resolve(serviceDir, "./dist/index.js");
19628
+ const serviceSRCEntryPoint = import_path6.default.resolve(serviceDir, "./src/index.js");
19639
19629
  let serviceFilePath = null;
19640
19630
  try {
19641
- if (import_fs4.default.existsSync(serviceDISTEntryPoint)) {
19631
+ if (import_fs3.default.existsSync(serviceDISTEntryPoint)) {
19642
19632
  serviceFilePath = serviceDISTEntryPoint;
19643
- } else if (import_fs4.default.existsSync(serviceSRCEntryPoint)) {
19633
+ } else if (import_fs3.default.existsSync(serviceSRCEntryPoint)) {
19644
19634
  serviceFilePath = serviceSRCEntryPoint;
19645
19635
  }
19646
19636
  if (!serviceFilePath) {
19647
19637
  skipped.push({ serviceId, reason: "it has neither a dist/index.js nor a src/index.js" });
19648
19638
  continue;
19649
19639
  }
19650
- const v2Definition = buildServiceDefinition2(serviceId, serviceFilePath);
19651
- const { methodsMap, serviceInfo } = v2Definition ?? parseJsDocToServiceJson(serviceFilePath);
19652
- if (!serviceInfo || !v2Definition && !serviceInfo.serviceClassName) {
19653
- skipped.push({ serviceId, reason: "its entry point does not define a service" });
19640
+ const definition = buildServiceDefinition(serviceId, serviceFilePath);
19641
+ if (!definition?.serviceInfo) {
19642
+ skipped.push({ serviceId, reason: "its entry point does not define a service with createExtension" });
19654
19643
  continue;
19655
19644
  }
19645
+ const { methodsMap, serviceInfo } = definition;
19656
19646
  let configDescriptions = [];
19657
19647
  try {
19658
- configDescriptions = getServiceConfigs3(serviceId, serviceFilePath);
19648
+ configDescriptions = getServiceConfigs(serviceId, serviceFilePath);
19659
19649
  } catch (error) {
19660
19650
  skipped.push({
19661
19651
  serviceId,
19662
19652
  reason: `its config items could not be read (${error.message}) \u2014 deployed without them`
19663
19653
  });
19664
19654
  }
19665
- services2.push({
19655
+ services.push({
19666
19656
  // Relative to the service, because the deployed archive's root IS the service.
19667
- serviceFilePath: import_path7.default.relative(serviceDir, serviceFilePath),
19657
+ serviceFilePath: import_path6.default.relative(serviceDir, serviceFilePath),
19668
19658
  serviceId,
19669
19659
  serviceInfo,
19670
19660
  methodsMap,
19671
19661
  configDescriptions,
19672
- // v2 only. The console renders a v2 config dialog from the schema itself rather than from the
19662
+ // The console renders the config dialog from the schema itself rather than from the
19673
19663
  // `configDescriptions` projection, so both travel: the schema for the new path, the projection for
19674
19664
  // every consumer that predates it.
19675
- runnerVersion: v2Definition ? "v2" : "v1",
19676
- configSchema: v2Definition?.configSchema ?? null
19665
+ configSchema: definition.configSchema ?? null
19677
19666
  });
19678
19667
  } catch (error) {
19679
19668
  skipped.push({ serviceId, reason: error.message });
19680
19669
  }
19681
19670
  }
19682
- return { services: services2, skipped };
19671
+ return { services, skipped };
19683
19672
  }
19684
19673
 
19685
19674
  // src/operations/deploy/hash.ts
19686
19675
  var import_crypto4 = require("crypto");
19687
- var import_fs5 = __toESM(require("fs"));
19688
- var import_path8 = __toESM(require("path"));
19676
+ var import_fs4 = __toESM(require("fs"));
19677
+ var import_path7 = __toESM(require("path"));
19689
19678
  async function computeServiceHash(projectRoot, serviceId) {
19690
19679
  const hash = (0, import_crypto4.createHash)("sha256");
19691
- const serviceDir = import_path8.default.resolve(projectRoot, "services", serviceId);
19680
+ const serviceDir = import_path7.default.resolve(projectRoot, "services", serviceId);
19692
19681
  const files = [];
19693
19682
  collectFiles(serviceDir, "", files);
19694
19683
  files.sort();
19695
19684
  for (const file of files) {
19696
19685
  hash.update(file);
19697
- hash.update(import_fs5.default.readFileSync(import_path8.default.resolve(serviceDir, file)));
19686
+ hash.update(import_fs4.default.readFileSync(import_path7.default.resolve(serviceDir, file)));
19698
19687
  }
19699
19688
  return hash.digest("hex");
19700
19689
  }
19701
19690
  function collectFiles(serviceDir, relativeDir, files) {
19702
- const entries = import_fs5.default.readdirSync(import_path8.default.resolve(serviceDir, relativeDir), { withFileTypes: true });
19691
+ const entries = import_fs4.default.readdirSync(import_path7.default.resolve(serviceDir, relativeDir), { withFileTypes: true });
19703
19692
  for (const entry of entries) {
19704
19693
  if (HASH_EXCLUDED_FOLDERS.includes(entry.name)) {
19705
19694
  continue;
19706
19695
  }
19707
- const relativePath = relativeDir ? import_path8.default.join(relativeDir, entry.name) : entry.name;
19696
+ const relativePath = relativeDir ? import_path7.default.join(relativeDir, entry.name) : entry.name;
19708
19697
  if (!entry.isSymbolicLink()) {
19709
19698
  if (entry.isDirectory()) {
19710
19699
  collectFiles(serviceDir, relativePath, files);
@@ -19716,14 +19705,14 @@ function collectFiles(serviceDir, relativeDir, files) {
19716
19705
  }
19717
19706
 
19718
19707
  // src/operations/deploy/public-files.ts
19719
- var import_fs6 = __toESM(require("fs"));
19720
- var import_path9 = __toESM(require("path"));
19721
- function collectPublicFiles(services2, projectRoot = process.cwd()) {
19708
+ var import_fs5 = __toESM(require("fs"));
19709
+ var import_path8 = __toESM(require("path"));
19710
+ function collectPublicFiles(services, projectRoot = process.cwd()) {
19722
19711
  const files = [];
19723
19712
  const missing = [];
19724
- for (const service of services2) {
19725
- const servicePublicDir = import_path9.default.resolve(projectRoot, "services", service.serviceId, "public");
19726
- if (!import_fs6.default.existsSync(servicePublicDir)) {
19713
+ for (const service of services) {
19714
+ const servicePublicDir = import_path8.default.resolve(projectRoot, "services", service.serviceId, "public");
19715
+ if (!import_fs5.default.existsSync(servicePublicDir)) {
19727
19716
  continue;
19728
19717
  }
19729
19718
  const iconPath = service.serviceInfo.integrationIcon;
@@ -19731,18 +19720,18 @@ function collectPublicFiles(services2, projectRoot = process.cwd()) {
19731
19720
  continue;
19732
19721
  }
19733
19722
  const relativePath = iconPath.replace(/^\//, "");
19734
- const fullPath = import_path9.default.resolve(servicePublicDir, relativePath);
19735
- if (!fullPath.startsWith(servicePublicDir + import_path9.default.sep)) {
19723
+ const fullPath = import_path8.default.resolve(servicePublicDir, relativePath);
19724
+ if (!fullPath.startsWith(servicePublicDir + import_path8.default.sep)) {
19736
19725
  continue;
19737
19726
  }
19738
- if (!import_fs6.default.existsSync(fullPath)) {
19727
+ if (!import_fs5.default.existsSync(fullPath)) {
19739
19728
  missing.push({ serviceId: service.serviceId, relativePath });
19740
19729
  continue;
19741
19730
  }
19742
19731
  files.push({
19743
19732
  relativePath,
19744
19733
  serviceId: service.serviceId,
19745
- buffer: import_fs6.default.readFileSync(fullPath)
19734
+ buffer: import_fs5.default.readFileSync(fullPath)
19746
19735
  });
19747
19736
  }
19748
19737
  return { files, missing };
@@ -19768,7 +19757,7 @@ function selectServices(available, selection = {}) {
19768
19757
 
19769
19758
  // src/operations/deploy/zip.ts
19770
19759
  var import_archiver = __toESM(require("archiver"));
19771
- var import_path10 = __toESM(require("path"));
19760
+ var import_path9 = __toESM(require("path"));
19772
19761
  async function createServiceZip(definition, projectRoot, serviceId) {
19773
19762
  return new Promise((resolve, reject) => {
19774
19763
  const archive = (0, import_archiver.default)("zip", { zlib: { level: 9 } });
@@ -19776,7 +19765,7 @@ async function createServiceZip(definition, projectRoot, serviceId) {
19776
19765
  archive.on("data", (chunk) => chunks.push(chunk));
19777
19766
  archive.on("end", () => resolve(Buffer.concat(chunks)));
19778
19767
  archive.on("error", reject);
19779
- archive.directory(`${import_path10.default.resolve(projectRoot, "services", serviceId)}/`, "package");
19768
+ archive.directory(`${import_path9.default.resolve(projectRoot, "services", serviceId)}/`, "package");
19780
19769
  archive.append(JSON.stringify(definition, null, 2), { name: "definition.json" });
19781
19770
  archive.finalize();
19782
19771
  });
@@ -19809,7 +19798,7 @@ async function deploy(options = {}) {
19809
19798
  const { serverUrl, workspaceId, workspaceName, deployToken } = await resolveAuth(projectRoot, options.onAuthRequired);
19810
19799
  const credentials = { serverUrl, workspaceId, deployToken };
19811
19800
  const workspace = { workspaceId, workspaceName };
19812
- if (!import_fs7.default.existsSync(import_path11.default.resolve(projectRoot, "services"))) {
19801
+ if (!import_fs6.default.existsSync(import_path10.default.resolve(projectRoot, "services"))) {
19813
19802
  throw new NoServicesDirectoryError();
19814
19803
  }
19815
19804
  emit({ type: "connecting", serverUrl, workspace });
@@ -19886,27 +19875,27 @@ async function guarded(call) {
19886
19875
 
19887
19876
  // src/operations/init/index.ts
19888
19877
  var import_child_process = require("child_process");
19889
- var import_fs13 = __toESM(require("fs"));
19890
- var import_path18 = __toESM(require("path"));
19878
+ var import_fs12 = __toESM(require("fs"));
19879
+ var import_path17 = __toESM(require("path"));
19891
19880
 
19892
19881
  // src/templates/package-root.ts
19893
- var import_fs8 = __toESM(require("fs"));
19894
- var import_path12 = __toESM(require("path"));
19882
+ var import_fs7 = __toESM(require("fs"));
19883
+ var import_path11 = __toESM(require("path"));
19895
19884
  var PACKAGE_NAMES = ["@flowrunner/cli", "flowrunner-cli"];
19896
19885
  var cached = null;
19897
19886
  function findPackageRoot() {
19898
19887
  let dir = __dirname;
19899
19888
  while (true) {
19900
- const manifest = import_path12.default.join(dir, "package.json");
19901
- if (import_fs8.default.existsSync(manifest)) {
19889
+ const manifest = import_path11.default.join(dir, "package.json");
19890
+ if (import_fs7.default.existsSync(manifest)) {
19902
19891
  try {
19903
- if (PACKAGE_NAMES.includes(JSON.parse(import_fs8.default.readFileSync(manifest, "utf-8")).name)) {
19892
+ if (PACKAGE_NAMES.includes(JSON.parse(import_fs7.default.readFileSync(manifest, "utf-8")).name)) {
19904
19893
  return dir;
19905
19894
  }
19906
19895
  } catch {
19907
19896
  }
19908
19897
  }
19909
- const parent = import_path12.default.dirname(dir);
19898
+ const parent = import_path11.default.dirname(dir);
19910
19899
  if (parent === dir) {
19911
19900
  throw new Error(`Could not locate the "${PACKAGE_NAMES[0]}" package root above ${__dirname}`);
19912
19901
  }
@@ -19918,7 +19907,7 @@ function packageRoot() {
19918
19907
  return cached;
19919
19908
  }
19920
19909
  function templatesRoot() {
19921
- return import_path12.default.join(packageRoot(), "templates");
19910
+ return import_path11.default.join(packageRoot(), "templates");
19922
19911
  }
19923
19912
 
19924
19913
  // src/utils/invocation.ts
@@ -19946,24 +19935,24 @@ function resolveServerTarget(target) {
19946
19935
  }
19947
19936
 
19948
19937
  // src/operations/init/create-service.ts
19949
- var import_path16 = __toESM(require("path"));
19938
+ var import_path15 = __toESM(require("path"));
19950
19939
 
19951
19940
  // src/templates/registry.ts
19952
- var import_fs10 = __toESM(require("fs"));
19953
- var import_path14 = __toESM(require("path"));
19941
+ var import_fs9 = __toESM(require("fs"));
19942
+ var import_path13 = __toESM(require("path"));
19954
19943
 
19955
19944
  // src/templates/manifest.ts
19956
- var import_fs9 = __toESM(require("fs"));
19945
+ var import_fs8 = __toESM(require("fs"));
19957
19946
  var import_zod5 = require("zod");
19958
19947
 
19959
19948
  // src/templates/paths.ts
19960
- var import_path13 = __toESM(require("path"));
19949
+ var import_path12 = __toESM(require("path"));
19961
19950
  var SERVICES_DIRECTORY = "services";
19962
19951
  function servicesDirectory(projectRoot = process.cwd()) {
19963
- return import_path13.default.join(projectRoot, SERVICES_DIRECTORY);
19952
+ return import_path12.default.join(projectRoot, SERVICES_DIRECTORY);
19964
19953
  }
19965
19954
  function serviceDirectory(serviceId, projectRoot = process.cwd()) {
19966
- return import_path13.default.join(servicesDirectory(projectRoot), serviceId);
19955
+ return import_path12.default.join(servicesDirectory(projectRoot), serviceId);
19967
19956
  }
19968
19957
 
19969
19958
  // src/templates/manifest.ts
@@ -19973,7 +19962,7 @@ function toServiceId(value) {
19973
19962
  }
19974
19963
  function availableServiceId(id, projectRoot) {
19975
19964
  let candidate = id;
19976
- for (let suffix = 2; import_fs9.default.existsSync(serviceDirectory(candidate, projectRoot)); suffix++) {
19965
+ for (let suffix = 2; import_fs8.default.existsSync(serviceDirectory(candidate, projectRoot)); suffix++) {
19977
19966
  candidate = `${id}-${suffix}`;
19978
19967
  }
19979
19968
  return candidate;
@@ -19985,7 +19974,7 @@ var VALIDATORS = {
19985
19974
  if (!SERVICE_ID_PATTERN.test(value)) {
19986
19975
  return "must start with a lowercase letter and contain only lowercase letters, digits and dashes \u2014 it becomes the folder name and the service id, which is frozen once deployed";
19987
19976
  }
19988
- if (import_fs9.default.existsSync(serviceDirectory(value, context.projectRoot))) {
19977
+ if (import_fs8.default.existsSync(serviceDirectory(value, context.projectRoot))) {
19989
19978
  return `is already taken \u2014 services/${value} exists in this project`;
19990
19979
  }
19991
19980
  return null;
@@ -20056,10 +20045,10 @@ var MANIFEST_FILE = "template.json";
20056
20045
  var DEFAULT_TEMPLATE_ID = "demo-todo-list";
20057
20046
  var DEFAULT_TEMPLATE_ALIAS = "demo";
20058
20047
  function loadTemplate(directory) {
20059
- const manifestPath = import_path14.default.join(directory, MANIFEST_FILE);
20048
+ const manifestPath = import_path13.default.join(directory, MANIFEST_FILE);
20060
20049
  let raw;
20061
20050
  try {
20062
- raw = JSON.parse(import_fs10.default.readFileSync(manifestPath, "utf-8"));
20051
+ raw = JSON.parse(import_fs9.default.readFileSync(manifestPath, "utf-8"));
20063
20052
  } catch (error) {
20064
20053
  throw new Error(`Template manifest ${manifestPath} is not readable JSON: ${error.message}`);
20065
20054
  }
@@ -20070,7 +20059,7 @@ function loadTemplate(directory) {
20070
20059
  ${issues}`);
20071
20060
  }
20072
20061
  const manifest = parsed.data;
20073
- if (manifest.id !== import_path14.default.basename(directory)) {
20062
+ if (manifest.id !== import_path13.default.basename(directory)) {
20074
20063
  throw new Error(`Template in ${directory} declares id "${manifest.id}" \u2014 it must match the folder name`);
20075
20064
  }
20076
20065
  for (const prompt of manifest.prompts) {
@@ -20078,17 +20067,17 @@ ${issues}`);
20078
20067
  throw new Error(`Template "${manifest.id}" prompt "${prompt.name}" defaults to "${prompt.default}", which is not one of its options (${prompt.options.map((option) => option.value).join(", ")})`);
20079
20068
  }
20080
20069
  }
20081
- const filesRoot = import_path14.default.join(directory, "files");
20070
+ const filesRoot = import_path13.default.join(directory, "files");
20082
20071
  for (const file of manifest.files) {
20083
- const source = import_path14.default.resolve(filesRoot, file.from);
20084
- if (!source.startsWith(filesRoot + import_path14.default.sep)) {
20072
+ const source = import_path13.default.resolve(filesRoot, file.from);
20073
+ if (!source.startsWith(filesRoot + import_path13.default.sep)) {
20085
20074
  throw new Error(`Template "${manifest.id}" declares a source outside files/: ${file.from}`);
20086
20075
  }
20087
- if (!import_fs10.default.existsSync(source)) {
20076
+ if (!import_fs9.default.existsSync(source)) {
20088
20077
  throw new Error(`Template "${manifest.id}" declares a missing source file: files/${file.from}`);
20089
20078
  }
20090
- const destination = import_path14.default.normalize(file.to);
20091
- if (import_path14.default.isAbsolute(destination) || destination.split(/[\\/]/).includes("..")) {
20079
+ const destination = import_path13.default.normalize(file.to);
20080
+ if (import_path13.default.isAbsolute(destination) || destination.split(/[\\/]/).includes("..")) {
20092
20081
  throw new Error(`Template "${manifest.id}" declares a destination outside the service folder: ${file.to}`);
20093
20082
  }
20094
20083
  const gate = file.when && (manifest.prompts.some((prompt) => prompt.type === "boolean" && prompt.name === file.when) || typeof manifest.values[file.when] === "boolean");
@@ -20100,10 +20089,10 @@ ${issues}`);
20100
20089
  }
20101
20090
  function listTemplates() {
20102
20091
  const root = templatesRoot();
20103
- if (!import_fs10.default.existsSync(root)) {
20092
+ if (!import_fs9.default.existsSync(root)) {
20104
20093
  return [];
20105
20094
  }
20106
- const templates = import_fs10.default.readdirSync(root, { withFileTypes: true }).filter((entry) => entry.isDirectory() && import_fs10.default.existsSync(import_path14.default.join(root, entry.name, MANIFEST_FILE))).map((entry) => loadTemplate(import_path14.default.join(root, entry.name)));
20095
+ const templates = import_fs9.default.readdirSync(root, { withFileTypes: true }).filter((entry) => entry.isDirectory() && import_fs9.default.existsSync(import_path13.default.join(root, entry.name, MANIFEST_FILE))).map((entry) => loadTemplate(import_path13.default.join(root, entry.name)));
20107
20096
  if (templates.length > 0 && !templates.some((template) => template.isDefault)) {
20108
20097
  throw new Error(`DEFAULT_TEMPLATE_ID is "${DEFAULT_TEMPLATE_ID}", but no template with that id is bundled`);
20109
20098
  }
@@ -20122,8 +20111,8 @@ function findTemplate(id) {
20122
20111
  }
20123
20112
 
20124
20113
  // src/templates/scaffold.ts
20125
- var import_fs11 = __toESM(require("fs"));
20126
- var import_path15 = __toESM(require("path"));
20114
+ var import_fs10 = __toESM(require("fs"));
20115
+ var import_path14 = __toESM(require("path"));
20127
20116
 
20128
20117
  // src/templates/render.ts
20129
20118
  var PLACEHOLDER = /\{\{\s*([a-zA-Z0-9_]+)\s*(?:\|\s*([a-zA-Z0-9_]+)\s*)?\}\}/g;
@@ -20191,19 +20180,19 @@ function render(source, answers, origin) {
20191
20180
  // src/templates/scaffold.ts
20192
20181
  var BINARY_EXTENSIONS = /* @__PURE__ */ new Set([".png", ".jpg", ".jpeg", ".gif", ".webp", ".ico", ".zip", ".woff", ".woff2"]);
20193
20182
  function renderTemplate(template, answers) {
20194
- const filesRoot = import_path15.default.join(template.directory, "files");
20183
+ const filesRoot = import_path14.default.join(template.directory, "files");
20195
20184
  const rendered = [];
20196
20185
  for (const file of template.manifest.files) {
20197
20186
  if (file.when && !answers[file.when]) {
20198
20187
  continue;
20199
20188
  }
20200
- const source = import_path15.default.join(filesRoot, file.from);
20189
+ const source = import_path14.default.join(filesRoot, file.from);
20201
20190
  const relativePath = render(file.to, answers, `destination of ${file.from}`);
20202
- if (BINARY_EXTENSIONS.has(import_path15.default.extname(file.from).toLowerCase())) {
20203
- rendered.push({ relativePath, contents: import_fs11.default.readFileSync(source) });
20191
+ if (BINARY_EXTENSIONS.has(import_path14.default.extname(file.from).toLowerCase())) {
20192
+ rendered.push({ relativePath, contents: import_fs10.default.readFileSync(source) });
20204
20193
  continue;
20205
20194
  }
20206
- const contents = render(import_fs11.default.readFileSync(source, "utf-8"), answers, `${template.manifest.id}/files/${file.from}`);
20195
+ const contents = render(import_fs10.default.readFileSync(source, "utf-8"), answers, `${template.manifest.id}/files/${file.from}`);
20207
20196
  rendered.push({ relativePath, contents: Buffer.from(contents, "utf-8") });
20208
20197
  }
20209
20198
  return rendered;
@@ -20212,20 +20201,20 @@ function scaffoldService(template, answers, serviceId, projectRoot = process.cwd
20212
20201
  const files = renderTemplate(template, answers);
20213
20202
  const servicesRoot = servicesDirectory(projectRoot);
20214
20203
  const serviceDirectory2 = serviceDirectory(serviceId, projectRoot);
20215
- if (import_fs11.default.existsSync(serviceDirectory2)) {
20204
+ if (import_fs10.default.existsSync(serviceDirectory2)) {
20216
20205
  throw new Error(`services/${serviceId} already exists \u2014 pick another service id, or remove it first.`);
20217
20206
  }
20218
20207
  for (const file of files) {
20219
- const target = import_path15.default.resolve(serviceDirectory2, file.relativePath);
20220
- if (target !== serviceDirectory2 && !target.startsWith(serviceDirectory2 + import_path15.default.sep)) {
20208
+ const target = import_path14.default.resolve(serviceDirectory2, file.relativePath);
20209
+ if (target !== serviceDirectory2 && !target.startsWith(serviceDirectory2 + import_path14.default.sep)) {
20221
20210
  throw new Error(`Template "${template.manifest.id}" resolved a path outside the service folder: ${file.relativePath}`);
20222
20211
  }
20223
20212
  }
20224
- const createdServicesDirectory = !import_fs11.default.existsSync(servicesRoot);
20213
+ const createdServicesDirectory = !import_fs10.default.existsSync(servicesRoot);
20225
20214
  for (const file of files) {
20226
- const target = import_path15.default.join(serviceDirectory2, file.relativePath);
20227
- import_fs11.default.mkdirSync(import_path15.default.dirname(target), { recursive: true });
20228
- import_fs11.default.writeFileSync(target, file.contents);
20215
+ const target = import_path14.default.join(serviceDirectory2, file.relativePath);
20216
+ import_fs10.default.mkdirSync(import_path14.default.dirname(target), { recursive: true });
20217
+ import_fs10.default.writeFileSync(target, file.contents);
20229
20218
  }
20230
20219
  return { serviceDirectory: serviceDirectory2, files, createdServicesDirectory };
20231
20220
  }
@@ -20378,7 +20367,7 @@ async function scaffoldFromTemplate(template, options = {}, projectRoot = option
20378
20367
  });
20379
20368
  const serviceId = String(answers.id);
20380
20369
  const { serviceDirectory: serviceDirectory2, files, createdServicesDirectory } = scaffoldService(template, answers, serviceId, projectRoot);
20381
- const relativePath = import_path16.default.relative(projectRoot, serviceDirectory2) || serviceDirectory2;
20370
+ const relativePath = import_path15.default.relative(projectRoot, serviceDirectory2) || serviceDirectory2;
20382
20371
  const written = files.map((file) => file.relativePath);
20383
20372
  if (createdServicesDirectory) {
20384
20373
  emit({ type: "created-services-directory" });
@@ -20391,24 +20380,24 @@ async function createService(templateId, options = {}) {
20391
20380
  }
20392
20381
 
20393
20382
  // src/operations/init/testing.ts
20394
- var import_fs12 = __toESM(require("fs"));
20395
- var import_path17 = __toESM(require("path"));
20383
+ var import_fs11 = __toESM(require("fs"));
20384
+ var import_path16 = __toESM(require("path"));
20396
20385
  function testingFilesDirectory() {
20397
- return import_path17.default.join(packageRoot(), PROJECT_FILES_DIRECTORY);
20386
+ return import_path16.default.join(packageRoot(), PROJECT_FILES_DIRECTORY);
20398
20387
  }
20399
20388
  function writeTestingFiles(projectRoot) {
20400
20389
  const source = testingFilesDirectory();
20401
20390
  const created = [];
20402
20391
  const skipped = [];
20403
20392
  for (const file of TESTING_FILES) {
20404
- const target = import_path17.default.join(projectRoot, file);
20405
- if (import_fs12.default.existsSync(target)) {
20393
+ const target = import_path16.default.join(projectRoot, file);
20394
+ if (import_fs11.default.existsSync(target)) {
20406
20395
  skipped.push(file);
20407
20396
  continue;
20408
20397
  }
20409
- const contents = import_fs12.default.readFileSync(import_path17.default.join(source, file));
20410
- import_fs12.default.mkdirSync(import_path17.default.dirname(target), { recursive: true });
20411
- import_fs12.default.writeFileSync(target, contents);
20398
+ const contents = import_fs11.default.readFileSync(import_path16.default.join(source, file));
20399
+ import_fs11.default.mkdirSync(import_path16.default.dirname(target), { recursive: true });
20400
+ import_fs11.default.writeFileSync(target, contents);
20412
20401
  created.push(file);
20413
20402
  }
20414
20403
  return { created, skipped };
@@ -20419,10 +20408,10 @@ var GITIGNORE_ENTRIES = ["node_modules/", `${TOKEN_DIR}/`, ...TEST_GITIGNORE_ENT
20419
20408
  var CLI_PACKAGE = "@flowrunner/cli";
20420
20409
  var CLI_PACKAGE_NAMES = [CLI_PACKAGE, "flowrunner-cli"];
20421
20410
  function cliVersion() {
20422
- return JSON.parse(import_fs13.default.readFileSync(import_path18.default.join(packageRoot(), "package.json"), "utf-8")).version;
20411
+ return JSON.parse(import_fs12.default.readFileSync(import_path17.default.join(packageRoot(), "package.json"), "utf-8")).version;
20423
20412
  }
20424
20413
  function packageNameFrom(directory) {
20425
- const name = import_path18.default.basename(import_path18.default.resolve(directory)).toLowerCase().replace(/[^a-z0-9._-]+/g, "-").replace(/^[._-]+|[-._]+$/g, "");
20414
+ const name = import_path17.default.basename(import_path17.default.resolve(directory)).toLowerCase().replace(/[^a-z0-9._-]+/g, "-").replace(/^[._-]+|[-._]+$/g, "");
20426
20415
  return name || "flowrunner-extensions";
20427
20416
  }
20428
20417
  function addMissing(section, additions, placeholders = {}) {
@@ -20436,11 +20425,11 @@ function addMissing(section, additions, placeholders = {}) {
20436
20425
  return changed;
20437
20426
  }
20438
20427
  function writePackageJson(projectRoot, tests) {
20439
- const fullPath = import_path18.default.join(projectRoot, "package.json");
20428
+ const fullPath = import_path17.default.join(projectRoot, "package.json");
20440
20429
  const version = cliVersion();
20441
20430
  const devDependencies = { [CLI_PACKAGE]: version, ...tests ? TEST_DEV_DEPENDENCIES : {} };
20442
20431
  const scripts = { deploy: "flowrunner deploy --all", ...tests ? TEST_SCRIPTS : {} };
20443
- if (!import_fs13.default.existsSync(fullPath)) {
20432
+ if (!import_fs12.default.existsSync(fullPath)) {
20444
20433
  const manifest2 = {
20445
20434
  name: packageNameFrom(projectRoot),
20446
20435
  version: "0.0.1",
@@ -20449,10 +20438,10 @@ function writePackageJson(projectRoot, tests) {
20449
20438
  scripts,
20450
20439
  devDependencies
20451
20440
  };
20452
- import_fs13.default.writeFileSync(fullPath, JSON.stringify(manifest2, null, 2) + "\n", "utf-8");
20441
+ import_fs12.default.writeFileSync(fullPath, JSON.stringify(manifest2, null, 2) + "\n", "utf-8");
20453
20442
  return "created";
20454
20443
  }
20455
- const manifest = JSON.parse(import_fs13.default.readFileSync(fullPath, "utf-8"));
20444
+ const manifest = JSON.parse(import_fs12.default.readFileSync(fullPath, "utf-8"));
20456
20445
  const alreadyDeclared = CLI_PACKAGE_NAMES.some((name) => manifest.dependencies?.[name] || manifest.devDependencies?.[name]);
20457
20446
  const additions = alreadyDeclared ? Object.fromEntries(Object.entries(devDependencies).filter(([name]) => name !== CLI_PACKAGE)) : devDependencies;
20458
20447
  manifest.devDependencies ??= {};
@@ -20464,22 +20453,22 @@ function writePackageJson(projectRoot, tests) {
20464
20453
  if (!changed) {
20465
20454
  return "skipped";
20466
20455
  }
20467
- import_fs13.default.writeFileSync(fullPath, JSON.stringify(manifest, null, 2) + "\n", "utf-8");
20456
+ import_fs12.default.writeFileSync(fullPath, JSON.stringify(manifest, null, 2) + "\n", "utf-8");
20468
20457
  return "updated";
20469
20458
  }
20470
20459
  function writeGitignore(projectRoot) {
20471
- const fullPath = import_path18.default.join(projectRoot, ".gitignore");
20472
- if (!import_fs13.default.existsSync(fullPath)) {
20473
- import_fs13.default.writeFileSync(fullPath, GITIGNORE_ENTRIES.join("\n") + "\n", "utf-8");
20460
+ const fullPath = import_path17.default.join(projectRoot, ".gitignore");
20461
+ if (!import_fs12.default.existsSync(fullPath)) {
20462
+ import_fs12.default.writeFileSync(fullPath, GITIGNORE_ENTRIES.join("\n") + "\n", "utf-8");
20474
20463
  return "created";
20475
20464
  }
20476
- const content = import_fs13.default.readFileSync(fullPath, "utf-8");
20465
+ const content = import_fs12.default.readFileSync(fullPath, "utf-8");
20477
20466
  const lines = content.split("\n").map((line) => line.trim());
20478
20467
  const missing = GITIGNORE_ENTRIES.filter((entry) => !lines.includes(entry) && !lines.includes(entry.replace(/\/$/, "")));
20479
20468
  if (missing.length === 0) {
20480
20469
  return "skipped";
20481
20470
  }
20482
- import_fs13.default.appendFileSync(fullPath, `${content.endsWith("\n") ? "" : "\n"}${missing.join("\n")}
20471
+ import_fs12.default.appendFileSync(fullPath, `${content.endsWith("\n") ? "" : "\n"}${missing.join("\n")}
20483
20472
  `);
20484
20473
  return "updated";
20485
20474
  }
@@ -20527,11 +20516,11 @@ The authoring reference the CLI ships lives in
20527
20516
  \`.flowrunner/token\` is the deploy token and must not.
20528
20517
  `;
20529
20518
  function writeReadme(projectRoot) {
20530
- const fullPath = import_path18.default.join(projectRoot, "README.md");
20531
- if (import_fs13.default.existsSync(fullPath)) {
20519
+ const fullPath = import_path17.default.join(projectRoot, "README.md");
20520
+ if (import_fs12.default.existsSync(fullPath)) {
20532
20521
  return "skipped";
20533
20522
  }
20534
- import_fs13.default.writeFileSync(fullPath, README(packageNameFrom(projectRoot)), "utf-8");
20523
+ import_fs12.default.writeFileSync(fullPath, README(packageNameFrom(projectRoot)), "utf-8");
20535
20524
  return "created";
20536
20525
  }
20537
20526
  var JSCONFIG = {
@@ -20543,11 +20532,11 @@ var JSCONFIG = {
20543
20532
  include: ["services/*/src/**/*.js"]
20544
20533
  };
20545
20534
  function writeJsconfig(projectRoot) {
20546
- const fullPath = import_path18.default.join(projectRoot, "jsconfig.json");
20547
- if (import_fs13.default.existsSync(fullPath)) {
20535
+ const fullPath = import_path17.default.join(projectRoot, "jsconfig.json");
20536
+ if (import_fs12.default.existsSync(fullPath)) {
20548
20537
  return "skipped";
20549
20538
  }
20550
- import_fs13.default.writeFileSync(fullPath, JSON.stringify(JSCONFIG, null, 2) + "\n", "utf-8");
20539
+ import_fs12.default.writeFileSync(fullPath, JSON.stringify(JSCONFIG, null, 2) + "\n", "utf-8");
20551
20540
  return "created";
20552
20541
  }
20553
20542
  function git(projectRoot, args) {
@@ -20598,13 +20587,13 @@ function npmInstall(projectRoot, warn) {
20598
20587
  }
20599
20588
  }
20600
20589
  function describeTarget(projectRoot) {
20601
- if (!import_fs13.default.existsSync(projectRoot)) {
20590
+ if (!import_fs12.default.existsSync(projectRoot)) {
20602
20591
  return { projectRoot, lines: ["a new directory"], defaultYes: true };
20603
20592
  }
20604
- if (!import_fs13.default.statSync(projectRoot).isDirectory()) {
20593
+ if (!import_fs12.default.statSync(projectRoot).isDirectory()) {
20605
20594
  return { projectRoot, lines: ["not a directory"], defaultYes: false };
20606
20595
  }
20607
- const entries = import_fs13.default.readdirSync(projectRoot).filter((entry) => entry !== ".git");
20596
+ const entries = import_fs12.default.readdirSync(projectRoot).filter((entry) => entry !== ".git");
20608
20597
  if (entries.length === 0) {
20609
20598
  return { projectRoot, lines: ["an empty directory"], defaultYes: true };
20610
20599
  }
@@ -20621,7 +20610,7 @@ function describeTarget(projectRoot) {
20621
20610
  return { projectRoot, lines, defaultYes: false };
20622
20611
  }
20623
20612
  async function init(options = {}) {
20624
- const projectRoot = import_path18.default.resolve(options.cwd ?? ".");
20613
+ const projectRoot = import_path17.default.resolve(options.cwd ?? ".");
20625
20614
  const emit = emitter(options);
20626
20615
  const warn = (message) => emit({ type: "warning", message });
20627
20616
  const template = options.template ? resolveTemplateId(options.template) : null;
@@ -20648,10 +20637,10 @@ async function init(options = {}) {
20648
20637
  committed: false
20649
20638
  };
20650
20639
  }
20651
- if (!import_fs13.default.existsSync(projectRoot)) {
20652
- import_fs13.default.mkdirSync(projectRoot, { recursive: true });
20640
+ if (!import_fs12.default.existsSync(projectRoot)) {
20641
+ import_fs12.default.mkdirSync(projectRoot, { recursive: true });
20653
20642
  }
20654
- if (!import_fs13.default.statSync(projectRoot).isDirectory()) {
20643
+ if (!import_fs12.default.statSync(projectRoot).isDirectory()) {
20655
20644
  throw new PromptAbortedError(`${projectRoot} is not a directory.`);
20656
20645
  }
20657
20646
  const created = [];
@@ -20692,8 +20681,8 @@ async function init(options = {}) {
20692
20681
  }
20693
20682
 
20694
20683
  // src/operations/init-claude/index.ts
20695
- var import_fs14 = __toESM(require("fs"));
20696
- var import_path19 = __toESM(require("path"));
20684
+ var import_fs13 = __toESM(require("fs"));
20685
+ var import_path18 = __toESM(require("path"));
20697
20686
 
20698
20687
  // src/operations/init-claude/segment.ts
20699
20688
  var BEGIN_MARKER = "<!-- flowrunner-cli:ai:start -->";
@@ -20728,16 +20717,16 @@ function mergeSegment(current, segment, file) {
20728
20717
 
20729
20718
  // src/operations/init-claude/index.ts
20730
20719
  function providerDirectory(provider = CLAUDE_PROVIDER) {
20731
- return import_path19.default.join(packageRoot(), AI_PROVIDERS_DIRECTORY, provider);
20720
+ return import_path18.default.join(packageRoot(), AI_PROVIDERS_DIRECTORY, provider);
20732
20721
  }
20733
20722
  function packedAgents(directory) {
20734
- if (!import_fs14.default.existsSync(directory)) {
20723
+ if (!import_fs13.default.existsSync(directory)) {
20735
20724
  return [];
20736
20725
  }
20737
- return import_fs14.default.readdirSync(directory, { withFileTypes: true }).filter((entry) => entry.isFile() && entry.name.endsWith(".md")).map((entry) => entry.name).sort();
20726
+ return import_fs13.default.readdirSync(directory, { withFileTypes: true }).filter((entry) => entry.isFile() && entry.name.endsWith(".md")).map((entry) => entry.name).sort();
20738
20727
  }
20739
20728
  function writeAgents(sourceDirectory, projectRoot, layout) {
20740
- const directory = import_path19.default.join(projectRoot, layout.agentsDirectory);
20729
+ const directory = import_path18.default.join(projectRoot, layout.agentsDirectory);
20741
20730
  const agents = packedAgents(sourceDirectory);
20742
20731
  const created = [];
20743
20732
  const updated = [];
@@ -20747,59 +20736,59 @@ function writeAgents(sourceDirectory, projectRoot, layout) {
20747
20736
  warnings.push(`The installed CLI ships no agent definitions in ${PROVIDER_AGENTS_DIRECTORY}/ \u2014 none were written.`);
20748
20737
  return { directory, created, updated, unchanged, warnings };
20749
20738
  }
20750
- import_fs14.default.mkdirSync(directory, { recursive: true });
20739
+ import_fs13.default.mkdirSync(directory, { recursive: true });
20751
20740
  for (const agent of agents) {
20752
- const contents = import_fs14.default.readFileSync(import_path19.default.join(sourceDirectory, agent), "utf-8");
20753
- const target = import_path19.default.join(directory, agent);
20741
+ const contents = import_fs13.default.readFileSync(import_path18.default.join(sourceDirectory, agent), "utf-8");
20742
+ const target = import_path18.default.join(directory, agent);
20754
20743
  if (contents.length === 0) {
20755
20744
  warnings.push(`${agent} is empty in the installed CLI \u2014 written as an empty file.`);
20756
20745
  }
20757
- if (!import_fs14.default.existsSync(target)) {
20758
- import_fs14.default.writeFileSync(target, contents, "utf-8");
20746
+ if (!import_fs13.default.existsSync(target)) {
20747
+ import_fs13.default.writeFileSync(target, contents, "utf-8");
20759
20748
  created.push(agent);
20760
20749
  continue;
20761
20750
  }
20762
- if (import_fs14.default.readFileSync(target, "utf-8") === contents) {
20751
+ if (import_fs13.default.readFileSync(target, "utf-8") === contents) {
20763
20752
  unchanged.push(agent);
20764
20753
  continue;
20765
20754
  }
20766
- import_fs14.default.writeFileSync(target, contents, "utf-8");
20755
+ import_fs13.default.writeFileSync(target, contents, "utf-8");
20767
20756
  updated.push(agent);
20768
20757
  }
20769
20758
  return { directory, created, updated, unchanged, warnings };
20770
20759
  }
20771
20760
  function writeSegment(sourceDirectory, projectRoot, layout) {
20772
- const file = import_path19.default.join(projectRoot, layout.instructionsFile);
20773
- const source = import_path19.default.join(sourceDirectory, ORCHESTRATOR_SEGMENT_FILE);
20761
+ const file = import_path18.default.join(projectRoot, layout.instructionsFile);
20762
+ const source = import_path18.default.join(sourceDirectory, ORCHESTRATOR_SEGMENT_FILE);
20774
20763
  const warnings = [];
20775
- if (!import_fs14.default.existsSync(source)) {
20764
+ if (!import_fs13.default.existsSync(source)) {
20776
20765
  warnings.push(`The installed CLI ships no ${ORCHESTRATOR_SEGMENT_FILE} \u2014 ${layout.instructionsFile} was left alone.`);
20777
20766
  return { file, outcome: "unchanged", warnings };
20778
20767
  }
20779
- const segment = import_fs14.default.readFileSync(source, "utf-8");
20768
+ const segment = import_fs13.default.readFileSync(source, "utf-8");
20780
20769
  if (segment.trim().length === 0) {
20781
20770
  warnings.push(`${ORCHESTRATOR_SEGMENT_FILE} is empty in the installed CLI \u2014 the marked block is empty.`);
20782
20771
  }
20783
- const current = import_fs14.default.existsSync(file) ? import_fs14.default.readFileSync(file, "utf-8") : null;
20772
+ const current = import_fs13.default.existsSync(file) ? import_fs13.default.readFileSync(file, "utf-8") : null;
20784
20773
  const merged = mergeSegment(current, segment, layout.instructionsFile);
20785
20774
  if (merged.outcome !== "unchanged") {
20786
- import_fs14.default.writeFileSync(file, merged.contents, "utf-8");
20775
+ import_fs13.default.writeFileSync(file, merged.contents, "utf-8");
20787
20776
  }
20788
20777
  return { file, outcome: merged.outcome, warnings };
20789
20778
  }
20790
20779
  async function initClaude(options = {}) {
20791
- const projectRoot = import_path19.default.resolve(options.cwd ?? ".");
20780
+ const projectRoot = import_path18.default.resolve(options.cwd ?? ".");
20792
20781
  const emit = emitter(options);
20793
20782
  const warnAll = (messages) => messages.forEach((message) => emit({ type: "warning", message }));
20794
20783
  const layout = PROVIDERS[CLAUDE_PROVIDER];
20795
20784
  const sourceDirectory = providerDirectory(layout.id);
20796
- if (!import_fs14.default.existsSync(sourceDirectory)) {
20797
- throw new AiDocsMissingError(import_path19.default.join(AI_PROVIDERS_DIRECTORY, CLAUDE_PROVIDER));
20785
+ if (!import_fs13.default.existsSync(sourceDirectory)) {
20786
+ throw new AiDocsMissingError(import_path18.default.join(AI_PROVIDERS_DIRECTORY, CLAUDE_PROVIDER));
20798
20787
  }
20799
- if (!import_fs14.default.existsSync(projectRoot)) {
20800
- import_fs14.default.mkdirSync(projectRoot, { recursive: true });
20788
+ if (!import_fs13.default.existsSync(projectRoot)) {
20789
+ import_fs13.default.mkdirSync(projectRoot, { recursive: true });
20801
20790
  }
20802
- const agents = writeAgents(import_path19.default.join(sourceDirectory, PROVIDER_AGENTS_DIRECTORY), projectRoot, layout);
20791
+ const agents = writeAgents(import_path18.default.join(sourceDirectory, PROVIDER_AGENTS_DIRECTORY), projectRoot, layout);
20803
20792
  emit({
20804
20793
  type: "agents",
20805
20794
  directory: agents.directory,
@@ -20863,7 +20852,7 @@ var ERROR_HTML = (error) => `<!DOCTYPE html>
20863
20852
  </body></html>`;
20864
20853
 
20865
20854
  // src/server/routes/callback.ts
20866
- function callbackRoute(path19 = "/callback") {
20855
+ function callbackRoute(path18 = "/callback") {
20867
20856
  let resolveCode = null;
20868
20857
  let rejectCode = null;
20869
20858
  const respond = (route2, html) => {
@@ -20872,7 +20861,7 @@ function callbackRoute(path19 = "/callback") {
20872
20861
  };
20873
20862
  const route = {
20874
20863
  method: "GET",
20875
- path: path19,
20864
+ path: path18,
20876
20865
  handle: (context) => {
20877
20866
  const code = context.url.searchParams.get("code");
20878
20867
  const error = context.url.searchParams.get("error");
@@ -20996,12 +20985,12 @@ async function logout(options = {}) {
20996
20985
 
20997
20986
  // src/operations/pull/index.ts
20998
20987
  var import_adm_zip = __toESM(require_adm_zip());
20999
- var import_fs16 = __toESM(require("fs"));
21000
- var import_path21 = __toESM(require("path"));
21001
-
21002
- // src/operations/pull/extract.ts
21003
20988
  var import_fs15 = __toESM(require("fs"));
21004
20989
  var import_path20 = __toESM(require("path"));
20990
+
20991
+ // src/operations/pull/extract.ts
20992
+ var import_fs14 = __toESM(require("fs"));
20993
+ var import_path19 = __toESM(require("path"));
21005
20994
  var PACKAGE_PREFIX = "package/";
21006
20995
  var SAFE_SERVICE_ID = /^[A-Za-z0-9][A-Za-z0-9._-]*$/;
21007
20996
  function isSafeServiceId(serviceId) {
@@ -21020,12 +21009,12 @@ function extractService(archive, directory) {
21020
21009
  let written = 0;
21021
21010
  for (const entry of serviceEntries(archive)) {
21022
21011
  const relativePath = entry.entryName.slice(PACKAGE_PREFIX.length);
21023
- const target = import_path20.default.resolve(directory, relativePath);
21024
- if (target !== directory && !target.startsWith(directory + import_path20.default.sep)) {
21012
+ const target = import_path19.default.resolve(directory, relativePath);
21013
+ if (target !== directory && !target.startsWith(directory + import_path19.default.sep)) {
21025
21014
  continue;
21026
21015
  }
21027
- import_fs15.default.mkdirSync(import_path20.default.dirname(target), { recursive: true });
21028
- import_fs15.default.writeFileSync(target, entry.getData());
21016
+ import_fs14.default.mkdirSync(import_path19.default.dirname(target), { recursive: true });
21017
+ import_fs14.default.writeFileSync(target, entry.getData());
21029
21018
  written++;
21030
21019
  }
21031
21020
  return written;
@@ -21045,7 +21034,7 @@ function declaredDependencies(archive) {
21045
21034
 
21046
21035
  // src/operations/pull/index.ts
21047
21036
  async function localState(projectRoot, service) {
21048
- if (!import_fs16.default.existsSync(import_path21.default.resolve(projectRoot, "services", service.serviceId))) {
21037
+ if (!import_fs15.default.existsSync(import_path20.default.resolve(projectRoot, "services", service.serviceId))) {
21049
21038
  return "absent";
21050
21039
  }
21051
21040
  try {
@@ -21090,7 +21079,7 @@ async function pull(options = {}) {
21090
21079
  emit({ type: "skipped", serviceId: service.serviceId, reason });
21091
21080
  continue;
21092
21081
  }
21093
- const directory = import_path21.default.resolve(projectRoot, "services", service.serviceId);
21082
+ const directory = import_path20.default.resolve(projectRoot, "services", service.serviceId);
21094
21083
  const state = await localState(projectRoot, service);
21095
21084
  if (state === "same") {
21096
21085
  upToDate.push({
@@ -21111,7 +21100,7 @@ async function pull(options = {}) {
21111
21100
  const zipBuffer = await guard(() => downloadRemoteService(credentials, service.serviceId));
21112
21101
  const archive = new import_adm_zip.default(zipBuffer);
21113
21102
  if (exists) {
21114
- import_fs16.default.rmSync(directory, { recursive: true, force: true });
21103
+ import_fs15.default.rmSync(directory, { recursive: true, force: true });
21115
21104
  }
21116
21105
  const files = extractService(archive, directory);
21117
21106
  const dependencies = declaredDependencies(archive);
@@ -21168,10 +21157,10 @@ async function guard(call) {
21168
21157
  }
21169
21158
 
21170
21159
  // src/operations/use-server.ts
21171
- var import_fs17 = __toESM(require("fs"));
21160
+ var import_fs16 = __toESM(require("fs"));
21172
21161
  function useServer(target, options = {}) {
21173
21162
  const projectRoot = options.cwd ?? process.cwd();
21174
- if (!import_fs17.default.existsSync(configPath(projectRoot))) {
21163
+ if (!import_fs16.default.existsSync(configPath(projectRoot))) {
21175
21164
  throw new NotAProjectError();
21176
21165
  }
21177
21166
  const serverUrl = resolveServerTarget(target);