@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/cli.js CHANGED
@@ -8877,11 +8877,11 @@ var require_mime_types = __commonJS({
8877
8877
  }
8878
8878
  return exts[0];
8879
8879
  }
8880
- function lookup(path23) {
8881
- if (!path23 || typeof path23 !== "string") {
8880
+ function lookup(path22) {
8881
+ if (!path22 || typeof path22 !== "string") {
8882
8882
  return false;
8883
8883
  }
8884
- var extension2 = extname("x." + path23).toLowerCase().substr(1);
8884
+ var extension2 = extname("x." + path22).toLowerCase().substr(1);
8885
8885
  if (!extension2) {
8886
8886
  return false;
8887
8887
  }
@@ -10044,11 +10044,11 @@ var require_form_data = __commonJS({
10044
10044
  "use strict";
10045
10045
  var CombinedStream = require_combined_stream();
10046
10046
  var util = require("util");
10047
- var path23 = require("path");
10047
+ var path22 = require("path");
10048
10048
  var http2 = require("http");
10049
10049
  var https = require("https");
10050
10050
  var parseUrl = require("url").parse;
10051
- var fs20 = require("fs");
10051
+ var fs19 = require("fs");
10052
10052
  var crypto3 = require("crypto");
10053
10053
  var mime = require_mime_types();
10054
10054
  var asynckit = require_asynckit();
@@ -10118,7 +10118,7 @@ var require_form_data = __commonJS({
10118
10118
  if (value.end != null && value.end !== Infinity && value.start != null) {
10119
10119
  callback(null, value.end + 1 - (value.start ? value.start : 0));
10120
10120
  } else {
10121
- fs20.stat(value.path, function(err, stat) {
10121
+ fs19.stat(value.path, function(err, stat) {
10122
10122
  var fileSize;
10123
10123
  if (err) {
10124
10124
  callback(err);
@@ -10176,11 +10176,11 @@ var require_form_data = __commonJS({
10176
10176
  FormData2.prototype._getContentDisposition = function(value, options) {
10177
10177
  var filename, contentDisposition;
10178
10178
  if (typeof options.filepath === "string") {
10179
- filename = path23.normalize(options.filepath).replace(/\\/g, "/");
10179
+ filename = path22.normalize(options.filepath).replace(/\\/g, "/");
10180
10180
  } else if (options.filename || value && (value.name || value.path)) {
10181
- filename = path23.basename(options.filename || value && (value.name || value.path));
10181
+ filename = path22.basename(options.filename || value && (value.name || value.path));
10182
10182
  } else if (value && value.readable && hasOwn(value, "httpVersion")) {
10183
- filename = path23.basename(value.client._httpMessage.path || "");
10183
+ filename = path22.basename(value.client._httpMessage.path || "");
10184
10184
  }
10185
10185
  if (filename) {
10186
10186
  contentDisposition = 'filename="' + escapeHeaderParam(filename) + '"';
@@ -10431,15 +10431,15 @@ var require_utils = __commonJS({
10431
10431
  }
10432
10432
  return uriComponent;
10433
10433
  }
10434
- function encodePath(path23) {
10435
- return path23.split("/").map(ensureComponentEncoding).join("/");
10434
+ function encodePath(path22) {
10435
+ return path22.split("/").map(ensureComponentEncoding).join("/");
10436
10436
  }
10437
- function ensureEncoding(path23) {
10437
+ function ensureEncoding(path22) {
10438
10438
  try {
10439
- var url = new URL(path23);
10440
- return url.origin + encodePath(normalizeTrailingSlashInPath(path23, url)) + url.search;
10439
+ var url = new URL(path22);
10440
+ return url.origin + encodePath(normalizeTrailingSlashInPath(path22, url)) + url.search;
10441
10441
  } catch (_unused) {
10442
- return encodePath(path23);
10442
+ return encodePath(path22);
10443
10443
  }
10444
10444
  }
10445
10445
  function normalizeTrailingSlashInPath(originPath, _ref) {
@@ -10794,15 +10794,15 @@ var require_client_node = __commonJS({
10794
10794
  exports2.sendNodeAPIRequest = sendNodeAPIRequest;
10795
10795
  var _utils = require_utils();
10796
10796
  var _error = require_error();
10797
- function sendNodeAPIRequest(path23, method, headers, body, encoding, timeout, withCredentials, tlsOptions) {
10797
+ function sendNodeAPIRequest(path22, method, headers, body, encoding, timeout, withCredentials, tlsOptions) {
10798
10798
  return new Promise(function(resolve, reject) {
10799
- var u = require("url").parse(path23);
10799
+ var u = require("url").parse(path22);
10800
10800
  var form = (0, _utils.isFormData)(body) && body;
10801
10801
  var https = u.protocol === "https:";
10802
10802
  var options = {
10803
10803
  host: u.hostname,
10804
10804
  port: u.port || (https ? 443 : 80),
10805
- path: (0, _utils.normalizeTrailingSlashInPath)(path23, u) + (u.search || ""),
10805
+ path: (0, _utils.normalizeTrailingSlashInPath)(path22, u) + (u.search || ""),
10806
10806
  method,
10807
10807
  headers,
10808
10808
  timeout
@@ -11210,12 +11210,12 @@ var require_request = __commonJS({
11210
11210
  var Request = exports2.Request = /* @__PURE__ */ (function(_EventEmitter) {
11211
11211
  _inherits(Request2, _EventEmitter);
11212
11212
  var _super = _createSuper(Request2);
11213
- function Request2(path23, method, body) {
11213
+ function Request2(path22, method, body) {
11214
11214
  var _this;
11215
11215
  _classCallCheck(this, Request2);
11216
11216
  _this = _super.call(this);
11217
11217
  _this.method = method;
11218
- _this.path = (0, _utils.ensureEncoding)(path23);
11218
+ _this.path = (0, _utils.ensureEncoding)(path22);
11219
11219
  _this.body = body;
11220
11220
  _this.unwrap = true;
11221
11221
  _this.raw = false;
@@ -11444,10 +11444,10 @@ var require_request = __commonJS({
11444
11444
  value: function send(body) {
11445
11445
  var _this2 = this;
11446
11446
  this.emit(REQUEST_EVENT, this);
11447
- var path23 = this.path;
11447
+ var path22 = this.path;
11448
11448
  var queryString = qs.stringify(this.queryParams);
11449
11449
  if (queryString) {
11450
- path23 += "?" + queryString;
11450
+ path22 += "?" + queryString;
11451
11451
  }
11452
11452
  if (!(0, _utils.isFormData)(body) && (0, _utils.isWebFormData)(body)) {
11453
11453
  body = toRequestFormData(body);
@@ -11464,11 +11464,11 @@ var require_request = __commonJS({
11464
11464
  return _this2.unwrap ? res.body : res;
11465
11465
  };
11466
11466
  if (Request2.verbose) {
11467
- console.log(this.method.toUpperCase(), decodeURIComponent(path23), body, this.headers);
11467
+ console.log(this.method.toUpperCase(), decodeURIComponent(path22), body, this.headers);
11468
11468
  }
11469
11469
  var withCredentials = typeof this.withCredentials === "boolean" ? this.withCredentials : Request2.withCredentials;
11470
11470
  var syncError = new Error();
11471
- var request = Request2.send(path23, this.method.toUpperCase(), this.headers, body, this.encoding, this.timeout, withCredentials, this.tlsOptions).then(function(res) {
11471
+ var request = Request2.send(path22, this.method.toUpperCase(), this.headers, body, this.encoding, this.timeout, withCredentials, this.tlsOptions).then(function(res) {
11472
11472
  return parseBody(res, _this2.raw);
11473
11473
  }).then(function(res) {
11474
11474
  return ensureRawBody(res, _this2.raw);
@@ -11577,14 +11577,14 @@ var require_client_browser = __commonJS({
11577
11577
  });
11578
11578
  exports2.sendXmlHttpRequest = sendXmlHttpRequest;
11579
11579
  var _request2 = require_request();
11580
- function sendXmlHttpRequest(path23, method, headers, body, encoding, timeout, withCredentials) {
11580
+ function sendXmlHttpRequest(path22, method, headers, body, encoding, timeout, withCredentials) {
11581
11581
  return new Promise(function sendRequest(resolve, reject) {
11582
11582
  var request = new _request2.Request.XMLHttpRequest();
11583
11583
  request.timeout = timeout;
11584
11584
  if (!encoding) {
11585
11585
  request.responseType = "arraybuffer";
11586
11586
  }
11587
- request.open(method.toUpperCase(), path23, true);
11587
+ request.open(method.toUpperCase(), path22, true);
11588
11588
  if (typeof withCredentials === "boolean") {
11589
11589
  request.withCredentials = withCredentials;
11590
11590
  }
@@ -11657,16 +11657,16 @@ var require_lib = __commonJS({
11657
11657
  }
11658
11658
  });
11659
11659
  _request.Request.XMLHttpRequest = typeof XMLHttpRequest !== "undefined" ? XMLHttpRequest : void 0;
11660
- _request.Request.send = function(path23, method, headers, body, encoding, timeout, withCredentials, tlsOptions) {
11660
+ _request.Request.send = function(path22, method, headers, body, encoding, timeout, withCredentials, tlsOptions) {
11661
11661
  var sender = typeof _request.Request.XMLHttpRequest !== "undefined" ? _clientBrowser.sendXmlHttpRequest : _clientNode.sendNodeAPIRequest;
11662
- return sender(path23, method, headers, body, encoding, timeout, withCredentials, tlsOptions);
11662
+ return sender(path22, method, headers, body, encoding, timeout, withCredentials, tlsOptions);
11663
11663
  };
11664
11664
  _request.Request.verbose = false;
11665
11665
  _request.Request.withCredentials = false;
11666
11666
  _request.Request.methods = ["get", "post", "put", "patch", "delete", "head", "options"];
11667
11667
  _request.Request.methods.forEach(function(method) {
11668
- _request.Request[method] = function(path23, body) {
11669
- return new _request.Request(path23, method, body);
11668
+ _request.Request[method] = function(path22, body) {
11669
+ return new _request.Request(path22, method, body);
11670
11670
  };
11671
11671
  });
11672
11672
  exports2 = module2.exports = _request.Request;
@@ -12007,25 +12007,25 @@ var require_utils2 = __commonJS({
12007
12007
  }
12008
12008
  mkdirSync(folder);
12009
12009
  };
12010
- Utils.prototype.writeFileTo = function(path23, content, overwrite, attr) {
12010
+ Utils.prototype.writeFileTo = function(path22, content, overwrite, attr) {
12011
12011
  const self = this;
12012
- if (self.fs.existsSync(path23)) {
12012
+ if (self.fs.existsSync(path22)) {
12013
12013
  if (!overwrite) return false;
12014
- var stat = self.fs.statSync(path23);
12014
+ var stat = self.fs.statSync(path22);
12015
12015
  if (stat.isDirectory()) {
12016
12016
  return false;
12017
12017
  }
12018
12018
  }
12019
- var folder = pth.dirname(path23);
12019
+ var folder = pth.dirname(path22);
12020
12020
  if (!self.fs.existsSync(folder)) {
12021
12021
  self.makeDir(folder);
12022
12022
  }
12023
12023
  var fd;
12024
12024
  try {
12025
- fd = self.fs.openSync(path23, "w", 438);
12025
+ fd = self.fs.openSync(path22, "w", 438);
12026
12026
  } catch (e) {
12027
- self.fs.chmodSync(path23, 438);
12028
- fd = self.fs.openSync(path23, "w", 438);
12027
+ self.fs.chmodSync(path22, 438);
12028
+ fd = self.fs.openSync(path22, "w", 438);
12029
12029
  }
12030
12030
  if (fd) {
12031
12031
  try {
@@ -12034,22 +12034,22 @@ var require_utils2 = __commonJS({
12034
12034
  self.fs.closeSync(fd);
12035
12035
  }
12036
12036
  }
12037
- self.fs.chmodSync(path23, attr || 438);
12037
+ self.fs.chmodSync(path22, attr || 438);
12038
12038
  return true;
12039
12039
  };
12040
- Utils.prototype.writeFileToAsync = function(path23, content, overwrite, attr, callback) {
12040
+ Utils.prototype.writeFileToAsync = function(path22, content, overwrite, attr, callback) {
12041
12041
  if (typeof attr === "function") {
12042
12042
  callback = attr;
12043
12043
  attr = void 0;
12044
12044
  }
12045
12045
  const self = this;
12046
- self.fs.exists(path23, function(exist) {
12046
+ self.fs.exists(path22, function(exist) {
12047
12047
  if (exist && !overwrite) return callback(false);
12048
- self.fs.stat(path23, function(err, stat) {
12048
+ self.fs.stat(path22, function(err, stat) {
12049
12049
  if (exist && stat && stat.isDirectory()) {
12050
12050
  return callback(false);
12051
12051
  }
12052
- var folder = pth.dirname(path23);
12052
+ var folder = pth.dirname(path22);
12053
12053
  self.fs.exists(folder, function(exists) {
12054
12054
  if (!exists) {
12055
12055
  try {
@@ -12062,16 +12062,16 @@ var require_utils2 = __commonJS({
12062
12062
  self.fs.write(fd, content, 0, content.length, 0, function(writeErr) {
12063
12063
  self.fs.close(fd, function() {
12064
12064
  if (writeErr) return callback(false);
12065
- self.fs.chmod(path23, attr || 438, function() {
12065
+ self.fs.chmod(path22, attr || 438, function() {
12066
12066
  callback(true);
12067
12067
  });
12068
12068
  });
12069
12069
  });
12070
12070
  };
12071
- self.fs.open(path23, "w", 438, function(err2, fd) {
12071
+ self.fs.open(path22, "w", 438, function(err2, fd) {
12072
12072
  if (err2) {
12073
- self.fs.chmod(path23, 438, function() {
12074
- self.fs.open(path23, "w", 438, function(retryErr, fd2) {
12073
+ self.fs.chmod(path22, 438, function() {
12074
+ self.fs.open(path22, "w", 438, function(retryErr, fd2) {
12075
12075
  if (retryErr || !fd2) return callback(false);
12076
12076
  writeToFd(fd2);
12077
12077
  });
@@ -12107,10 +12107,10 @@ var require_utils2 = __commonJS({
12107
12107
  if (stat.isSymbolicLink()) throw Errors.FILE_IN_THE_WAY(`"${cur}"`);
12108
12108
  }
12109
12109
  };
12110
- Utils.prototype.findFiles = function(path23) {
12110
+ Utils.prototype.findFiles = function(path22) {
12111
12111
  const self = this;
12112
12112
  const canLstat = typeof self.fs.lstatSync === "function";
12113
- const rootReal = self.fs.realpathSync(path23);
12113
+ const rootReal = self.fs.realpathSync(path22);
12114
12114
  function escapesRoot(p) {
12115
12115
  if (!canLstat) return false;
12116
12116
  if (!self.fs.lstatSync(p).isSymbolicLink()) return false;
@@ -12129,23 +12129,23 @@ var require_utils2 = __commonJS({
12129
12129
  }
12130
12130
  let files = [];
12131
12131
  self.fs.readdirSync(dir).forEach(function(file) {
12132
- const path24 = pth.join(dir, file);
12133
- if (escapesRoot(path24)) return;
12134
- const stat = self.fs.statSync(path24);
12135
- if (!pattern || pattern.test(path24)) {
12136
- files.push(pth.normalize(path24) + (stat.isDirectory() ? self.sep : ""));
12132
+ const path23 = pth.join(dir, file);
12133
+ if (escapesRoot(path23)) return;
12134
+ const stat = self.fs.statSync(path23);
12135
+ if (!pattern || pattern.test(path23)) {
12136
+ files.push(pth.normalize(path23) + (stat.isDirectory() ? self.sep : ""));
12137
12137
  }
12138
12138
  if (stat.isDirectory() && recursive) {
12139
- const realDir = self.fs.realpathSync(path24);
12139
+ const realDir = self.fs.realpathSync(path23);
12140
12140
  if (!visited.has(realDir)) {
12141
12141
  visited.add(realDir);
12142
- files = files.concat(findSync(path24, pattern, recursive, visited));
12142
+ files = files.concat(findSync(path23, pattern, recursive, visited));
12143
12143
  }
12144
12144
  }
12145
12145
  });
12146
12146
  return files;
12147
12147
  }
12148
- return findSync(path23, void 0, true, /* @__PURE__ */ new Set([rootReal]));
12148
+ return findSync(path22, void 0, true, /* @__PURE__ */ new Set([rootReal]));
12149
12149
  };
12150
12150
  Utils.prototype.findFilesAsync = function(dir, cb) {
12151
12151
  const self = this;
@@ -12242,14 +12242,14 @@ var require_utils2 = __commonJS({
12242
12242
  return "UNSUPPORTED (" + method + ")";
12243
12243
  }
12244
12244
  };
12245
- Utils.canonical = function(path23) {
12246
- if (!path23) return "";
12247
- const safeSuffix = pth.posix.normalize("/" + path23.split("\\").join("/"));
12245
+ Utils.canonical = function(path22) {
12246
+ if (!path22) return "";
12247
+ const safeSuffix = pth.posix.normalize("/" + path22.split("\\").join("/"));
12248
12248
  return pth.join(".", safeSuffix);
12249
12249
  };
12250
- Utils.zipnamefix = function(path23) {
12251
- if (!path23) return "";
12252
- const safeSuffix = pth.posix.normalize("/" + path23.split("\\").join("/"));
12250
+ Utils.zipnamefix = function(path22) {
12251
+ if (!path22) return "";
12252
+ const safeSuffix = pth.posix.normalize("/" + path22.split("\\").join("/"));
12253
12253
  return pth.posix.join(".", safeSuffix);
12254
12254
  };
12255
12255
  Utils.findLast = function(arr, callback) {
@@ -12266,9 +12266,9 @@ var require_utils2 = __commonJS({
12266
12266
  prefix = pth.resolve(pth.normalize(prefix));
12267
12267
  var parts = name.split("/");
12268
12268
  for (var i = 0, l = parts.length; i < l; i++) {
12269
- var path23 = pth.normalize(pth.join(prefix, parts.slice(i, l).join(pth.sep)));
12270
- if (path23 === prefix || path23.startsWith(prefix + pth.sep)) {
12271
- return path23;
12269
+ var path22 = pth.normalize(pth.join(prefix, parts.slice(i, l).join(pth.sep)));
12270
+ if (path22 === prefix || path22.startsWith(prefix + pth.sep)) {
12271
+ return path22;
12272
12272
  }
12273
12273
  }
12274
12274
  return pth.normalize(pth.join(prefix, pth.basename(name)));
@@ -12318,8 +12318,8 @@ var require_utils2 = __commonJS({
12318
12318
  var require_fattr = __commonJS({
12319
12319
  "node_modules/adm-zip/util/fattr.js"(exports2, module2) {
12320
12320
  var pth = require("path");
12321
- module2.exports = function(path23, { fs: fs20 }) {
12322
- var _path = path23 || "", _obj = newAttr(), _stat = null;
12321
+ module2.exports = function(path22, { fs: fs19 }) {
12322
+ var _path = path22 || "", _obj = newAttr(), _stat = null;
12323
12323
  function newAttr() {
12324
12324
  return {
12325
12325
  directory: false,
@@ -12330,8 +12330,8 @@ var require_fattr = __commonJS({
12330
12330
  atime: 0
12331
12331
  };
12332
12332
  }
12333
- if (_path && fs20.existsSync(_path)) {
12334
- _stat = fs20.statSync(_path);
12333
+ if (_path && fs19.existsSync(_path)) {
12334
+ _stat = fs19.statSync(_path);
12335
12335
  _obj.directory = _stat.isDirectory();
12336
12336
  _obj.mtime = _stat.mtime;
12337
12337
  _obj.atime = _stat.atime;
@@ -14508,7 +14508,7 @@ var require_package = __commonJS({
14508
14508
  "package.json"(exports2, module2) {
14509
14509
  module2.exports = {
14510
14510
  name: "@flowrunner/cli",
14511
- version: "0.1.18",
14511
+ version: "0.1.19-dev.2",
14512
14512
  publishConfig: {
14513
14513
  access: "public"
14514
14514
  },
@@ -14545,14 +14545,11 @@ var require_package = __commonJS({
14545
14545
  "adm-zip": "^0.6.1",
14546
14546
  archiver: "^7.0.0",
14547
14547
  commander: "^12.0.0",
14548
- jsdoc: "^4.0.0",
14549
- requizzle: "^0.2.4",
14550
14548
  zod: "^4.6.2"
14551
14549
  },
14552
14550
  devDependencies: {
14553
14551
  "@asteasolutions/zod-to-openapi": "^8.4.0",
14554
14552
  "@flowrunner/flow-extension-runner": "*",
14555
- "@flowrunner/jsdoc-parser": "*",
14556
14553
  "@types/adm-zip": "^0.5.7",
14557
14554
  "@types/archiver": "^6.0.0",
14558
14555
  esbuild: "^0.28.2",
@@ -15505,12 +15502,12 @@ async function downloadRemoteService(credentials, serviceId) {
15505
15502
  }
15506
15503
 
15507
15504
  // src/operations/deploy/index.ts
15508
- var import_fs12 = __toESM(require("fs"));
15509
- var import_path17 = __toESM(require("path"));
15505
+ var import_fs11 = __toESM(require("fs"));
15506
+ var import_path16 = __toESM(require("path"));
15510
15507
 
15511
15508
  // src/operations/deploy/discover-services.ts
15512
- var import_fs9 = __toESM(require("fs"));
15513
- var import_path13 = __toESM(require("path"));
15509
+ var import_fs8 = __toESM(require("fs"));
15510
+ var import_path12 = __toESM(require("path"));
15514
15511
 
15515
15512
  // ../../flow-extension-runner/src/namespace.ts
15516
15513
  var import_backendless_request2 = __toESM(require_lib());
@@ -15555,9 +15552,9 @@ var FlowExtensionErrorCodes = {
15555
15552
  DUPLICATE_ITEM_ID: "FR_EXT_DUPLICATE_ITEM_ID",
15556
15553
  // No v2 extension registered for the given serviceId after requiring the module.
15557
15554
  EXTENSION_NOT_REGISTERED: "FR_EXT_NOT_REGISTERED",
15558
- // A declared config value is missing or the wrong shape (see v2/schema/normalize).
15555
+ // A declared config value is missing or the wrong shape (see params/schema/normalize).
15559
15556
  INVALID_CONFIG: "FR_EXT_INVALID_CONFIG",
15560
- // A schema slot that must be a z.object was declared as something else (see v2/schema/assert-object-schema).
15557
+ // A schema slot that must be a z.object was declared as something else (see params/schema/assert-object-schema).
15561
15558
  INVALID_SCHEMA: "FR_EXT_INVALID_SCHEMA",
15562
15559
  // A polling trigger declared zero or multiple mechanisms, or is missing its fetch.
15563
15560
  INVALID_TRIGGER_CONFIG: "FR_EXT_INVALID_TRIGGER_CONFIG",
@@ -15652,7 +15649,7 @@ var InvalidConfigError = class extends FlowExtensionError {
15652
15649
  };
15653
15650
  var InvalidSchemaError = class extends FlowExtensionError {
15654
15651
  // `message` is composed by the guard, which knows how to describe what was received and what to do
15655
- // about it (see v2/schema/assert-object-schema.ts).
15652
+ // about it (see params/schema/assert-object-schema.ts).
15656
15653
  constructor(message, details) {
15657
15654
  super(FlowExtensionErrorCodes.INVALID_SCHEMA, 400, message, details);
15658
15655
  }
@@ -15704,12 +15701,12 @@ var InvalidDictionaryOutputScheme = class extends FlowExtensionError {
15704
15701
  }
15705
15702
  };
15706
15703
 
15707
- // ../../flow-extension-runner/src/v2/loaders/loader-owner.ts
15704
+ // ../../flow-extension-runner/src/loaders/loader-owner.ts
15708
15705
  var sampleResultLoaderName = (ownerId) => `${ownerId}_SampleResultLoader`;
15709
15706
  var dynamicParamsLoaderName = (ownerId) => `${ownerId}_DynamicParams`;
15710
15707
  var dynamicPropsLoaderName = (ownerId, field) => `${ownerId}_${field}_DynamicProps`;
15711
15708
 
15712
- // ../../flow-extension-runner/src/v2/params/schema/assert-object-schema.ts
15709
+ // ../../flow-extension-runner/src/params/schema/assert-object-schema.ts
15713
15710
  var WRAPPERS = /* @__PURE__ */ new Set(["optional", "nullable", "nullish", "default", "prefault"]);
15714
15711
  var typeOf = (value) => value?._zod?.def?.type;
15715
15712
  function describe(value) {
@@ -15758,40 +15755,7 @@ function assertObjectSchema(scheme, source) {
15758
15755
  );
15759
15756
  }
15760
15757
 
15761
- // ../../flow-extension-runner/src/v2/params/schema/dictionary-binding.ts
15762
- var DictionaryScope = class _DictionaryScope {
15763
- constructor(top, visible) {
15764
- this.top = top;
15765
- this.visible = visible;
15766
- }
15767
- static {
15768
- this.ROOT = new _DictionaryScope(null, /* @__PURE__ */ new Set());
15769
- }
15770
- enter(names) {
15771
- if (!this.top) {
15772
- const top = new Set(names);
15773
- return new _DictionaryScope(top, top);
15774
- }
15775
- return new _DictionaryScope(this.top, /* @__PURE__ */ new Set([...this.top, ...names]));
15776
- }
15777
- };
15778
- function resolveDependsOn(binding, scope2) {
15779
- const aliases = binding.criteriaAliases ?? {};
15780
- let clash;
15781
- const dependsOn = binding.dependsOn.map((key) => {
15782
- const visible = [key, ...aliases[key] ?? []].filter((name) => scope2.visible.has(name));
15783
- if (visible.length > 1 && !clash) {
15784
- clash = { key, names: visible };
15785
- }
15786
- return visible[0] ?? key;
15787
- });
15788
- return clash ? { dependsOn, clash } : { dependsOn };
15789
- }
15790
- function publishedBinding(binding, scope2) {
15791
- return { id: binding.id, dependsOn: resolveDependsOn(binding, scope2).dependsOn };
15792
- }
15793
-
15794
- // ../../flow-extension-runner/src/v2/params/widget-types.ts
15758
+ // ../../flow-extension-runner/src/params/widget-types.ts
15795
15759
  var FlowExtensionParamGroupTypes = {
15796
15760
  FILE_UPLOAD_OPTIONS: "FILE_UPLOAD_OPTIONS",
15797
15761
  FILE_LIST_OPTIONS: "FILE_LIST_OPTIONS",
@@ -15809,14 +15773,16 @@ var FlowExtensionParamWidgetTypes = {
15809
15773
  ...FlowExtensionParamGroupTypes,
15810
15774
  // legacy — no zod declaration produces these. They reach the console only from a legacy JSDoc-format
15811
15775
  // service, which writes `uiComponent` by hand. Kept because the console still renders them for an
15812
- // already-installed extension.
15776
+ // already-installed extension. `DATE_TIME_PICKER` / `TIME_PICKER` are also published, with
15777
+ // `valueKind: 'string'` and `format`, by `z.iso.datetime({ local: true })` / `z.iso.time()` (FR-3920) —
15778
+ // without `valueKind` they are the legacy tokens, storing epoch millis.
15813
15779
  NUMERIC: "NUMERIC",
15814
15780
  CHECKBOX: "CHECKBOX",
15815
15781
  DATE_TIME_PICKER: "DATE_TIME_PICKER",
15816
15782
  TIME_PICKER: "TIME_PICKER"
15817
15783
  };
15818
15784
 
15819
- // ../../flow-extension-runner/src/v2/params/schema/introspect.ts
15785
+ // ../../flow-extension-runner/src/params/schema/introspect.ts
15820
15786
  var OPTIONAL_WRAPPERS = /* @__PURE__ */ new Set(["optional", "nullable", "nullish"]);
15821
15787
  var DEFAULT_WRAPPERS = /* @__PURE__ */ new Set(["default", "prefault"]);
15822
15788
  var TRANSPARENT_WRAPPERS = /* @__PURE__ */ new Set(["readonly", "pipe", "lazy"]);
@@ -15902,6 +15868,12 @@ function literalType(core) {
15902
15868
  const [kind] = [...kinds];
15903
15869
  return kinds.size === 1 && LITERAL_KINDS.has(kind) ? kind : void 0;
15904
15870
  }
15871
+ function hasBlankBranch(ins) {
15872
+ return !!ins.branches?.some((branch) => {
15873
+ const { core, coreType } = inspect(branch);
15874
+ return coreType === "literal" && (core._zod?.def?.values ?? []).includes("");
15875
+ });
15876
+ }
15905
15877
  function deriveWidget(ins) {
15906
15878
  const { coreType, core, meta } = ins;
15907
15879
  switch (coreType) {
@@ -15909,7 +15881,7 @@ function deriveWidget(ins) {
15909
15881
  if (meta.frWidget === FlowExtensionParamWidgetTypes.MULTI_LINE_TEXT) {
15910
15882
  return { paramType: "STRING", uiComponent: { type: FlowExtensionParamWidgetTypes.MULTI_LINE_TEXT } };
15911
15883
  }
15912
- return { paramType: "STRING" };
15884
+ return dateStringWidget(ins) ?? { paramType: "STRING" };
15913
15885
  case "number":
15914
15886
  case "bigint":
15915
15887
  return { paramType: "NUMBER", uiComponent: { type: FlowExtensionParamWidgetTypes.NUMERIC_STEPPER } };
@@ -15952,12 +15924,400 @@ function deriveWidget(ins) {
15952
15924
  return { paramType: "STRING" };
15953
15925
  }
15954
15926
  }
15927
+ var DATE_STRING_WIDGETS = {
15928
+ date: FlowExtensionParamWidgetTypes.DATE_PICKER,
15929
+ datetime: FlowExtensionParamWidgetTypes.DATE_TIME_PICKER,
15930
+ time: FlowExtensionParamWidgetTypes.TIME_PICKER
15931
+ };
15932
+ function dateStringWidget(ins) {
15933
+ const kind = dateStringKind(ins);
15934
+ return kind ? { paramType: "STRING", uiComponent: { type: DATE_STRING_WIDGETS[kind], valueKind: "string", format: patternOf(ins, kind) } } : void 0;
15935
+ }
15955
15936
  function shapeEntries(schema) {
15956
15937
  const shape = schema?.shape;
15957
15938
  return shape && typeof shape === "object" ? Object.entries(shape) : [];
15958
15939
  }
15959
15940
 
15960
- // ../../flow-extension-runner/src/v2/params/schema/assert-supported-schema.ts
15941
+ // ../../flow-extension-runner/src/params/schema/date-format.ts
15942
+ var ISO_PATTERNS = {
15943
+ date: "yyyy-MM-dd",
15944
+ datetime: "yyyy-MM-dd'T'HH:mm",
15945
+ time: "HH:mm"
15946
+ };
15947
+ var DATE_STRINGS_ACCEPT_TIMESTAMPS = true;
15948
+ function dateStringKind(ins) {
15949
+ if (ins.coreType !== "string") {
15950
+ return void 0;
15951
+ }
15952
+ const def = ins.core?._zod?.def;
15953
+ if (def?.format === "date" || def?.format === "time") {
15954
+ return def.format;
15955
+ }
15956
+ return def?.format === "datetime" && def.local ? "datetime" : void 0;
15957
+ }
15958
+ var patternOf = (ins, kind) => ins.meta.frDateFormat ?? ISO_PATTERNS[kind];
15959
+ var TOKENS = ["yyyy", "yy", "MM", "M", "dd", "d", "HH", "H", "hh", "h", "mm", "ss", "a"];
15960
+ var SPEC = {
15961
+ yyyy: { part: "year", width: 4 },
15962
+ yy: { part: "year", width: 2 },
15963
+ MM: { part: "month", width: 2 },
15964
+ M: { part: "month" },
15965
+ dd: { part: "day", width: 2 },
15966
+ d: { part: "day" },
15967
+ HH: { part: "hour", width: 2 },
15968
+ H: { part: "hour" },
15969
+ hh: { part: "hour", width: 2 },
15970
+ h: { part: "hour" },
15971
+ mm: { part: "minute", width: 2 },
15972
+ ss: { part: "second", width: 2 },
15973
+ a: { part: "meridiem" }
15974
+ };
15975
+ var DATE_PARTS = /* @__PURE__ */ new Set(["year", "month", "day"]);
15976
+ var TIME_PARTS = /* @__PURE__ */ new Set(["hour", "minute", "second", "meridiem"]);
15977
+ var DateFormatError = class extends Error {
15978
+ };
15979
+ var LOOK_ALIKES = {
15980
+ YYYY: "yyyy",
15981
+ YY: "yy",
15982
+ DD: "dd",
15983
+ D: "d",
15984
+ S: "ss",
15985
+ A: "a"
15986
+ };
15987
+ function tokenize(pattern, kind) {
15988
+ const tokens = [];
15989
+ let index = 0;
15990
+ while (index < pattern.length) {
15991
+ const char = pattern[index];
15992
+ if (char === "'") {
15993
+ const end = pattern.indexOf("'", index + 1);
15994
+ if (end < 0) {
15995
+ throw new DateFormatError("has an unclosed quote \u2014 literal text is written between two single quotes");
15996
+ }
15997
+ tokens.push({ literal: end === index + 1 ? "'" : pattern.slice(index + 1, end) });
15998
+ index = end + 1;
15999
+ continue;
16000
+ }
16001
+ if (!/[A-Za-z]/.test(char)) {
16002
+ tokens.push({ literal: char });
16003
+ index++;
16004
+ continue;
16005
+ }
16006
+ const run = /^([A-Za-z])\1*/.exec(pattern.slice(index))?.[0];
16007
+ const known = TOKENS.find((token) => run.startsWith(token) && token.length === run.length);
16008
+ if (!known) {
16009
+ const hint3 = LOOK_ALIKES[run] ? ` (did you mean \`${suggest(pattern, kind)}\`?)` : "";
16010
+ throw new DateFormatError(
16011
+ `uses \`${run}\`, which is not a supported token${hint3}. Supported: yyyy yy MM M dd d HH H hh h mm ss a, and literal text in single quotes`
16012
+ );
16013
+ }
16014
+ tokens.push({ token: known });
16015
+ index += run.length;
16016
+ }
16017
+ return tokens;
16018
+ }
16019
+ function suggest(pattern, kind) {
16020
+ let fixed = pattern;
16021
+ for (const [wrong, right] of Object.entries(LOOK_ALIKES)) {
16022
+ fixed = fixed.replace(new RegExp(`(?<![A-Za-z])${wrong}(?![A-Za-z])`, "g"), right);
16023
+ }
16024
+ if (kind === "date") {
16025
+ fixed = fixed.replace(/mm/g, "MM");
16026
+ }
16027
+ return fixed;
16028
+ }
16029
+ var parsedPatterns = /* @__PURE__ */ new Map();
16030
+ function compilePattern(pattern, kind) {
16031
+ const key = `${kind}|${pattern}`;
16032
+ const cached2 = parsedPatterns.get(key);
16033
+ if (cached2) {
16034
+ return cached2;
16035
+ }
16036
+ if (typeof pattern !== "string" || !pattern.trim()) {
16037
+ throw new DateFormatError("needs a pattern, e.g. `dd/MM/yyyy`");
16038
+ }
16039
+ const tokens = tokenize(pattern, kind);
16040
+ const names = tokens.flatMap((token) => "token" in token ? [token.token] : []);
16041
+ const parts = names.map((name) => SPEC[name].part);
16042
+ const has = (part) => parts.includes(part);
16043
+ const repeated = parts.find((part, index) => parts.indexOf(part) !== index);
16044
+ if (repeated) {
16045
+ throw new DateFormatError(`names the ${repeated === "meridiem" ? "AM/PM" : repeated} twice`);
16046
+ }
16047
+ if (kind === "date" && names.includes("mm") && !has("hour")) {
16048
+ throw new DateFormatError(`uses \`mm\`, which is minutes \u2014 did you mean \`${suggest(pattern, kind)}\`?`);
16049
+ }
16050
+ if (kind === "date" && parts.some((part) => TIME_PARTS.has(part))) {
16051
+ throw new DateFormatError("has a time of day, which a date has not \u2014 declare `z.iso.datetime({ local: true })`");
16052
+ }
16053
+ if (kind === "time" && parts.some((part) => DATE_PARTS.has(part))) {
16054
+ throw new DateFormatError("has a date, which a time has not \u2014 declare `z.iso.datetime({ local: true })`");
16055
+ }
16056
+ const missing = [
16057
+ ...kind !== "time" ? [["year", "yyyy"], ["month", "MM"], ["day", "dd"]] : [],
16058
+ ...kind !== "date" ? [["hour", "HH"], ["minute", "mm"]] : []
16059
+ ].filter(([part]) => !has(part)).map(([, token]) => `\`${token}\``);
16060
+ if (missing.length) {
16061
+ throw new DateFormatError(`is missing ${missing.join(", ")} \u2014 every part of a ${describeKind(kind)} must be in it`);
16062
+ }
16063
+ if ((names.includes("HH") || names.includes("H")) && names.includes("a")) {
16064
+ throw new DateFormatError(
16065
+ "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"
16066
+ );
16067
+ }
16068
+ if ((names.includes("hh") || names.includes("h")) && !names.includes("a")) {
16069
+ throw new DateFormatError(
16070
+ "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"
16071
+ );
16072
+ }
16073
+ parsedPatterns.set(key, tokens);
16074
+ return tokens;
16075
+ }
16076
+ var describeKind = (kind) => kind === "date" ? "date" : kind === "time" ? "time" : "date and time";
16077
+ var pad = (value, width) => String(value).padStart(width, "0");
16078
+ function formatParts(parts, pattern, kind) {
16079
+ return compilePattern(pattern, kind).map((token) => {
16080
+ if ("literal" in token) {
16081
+ return token.literal;
16082
+ }
16083
+ const hour = parts.hour ?? 0;
16084
+ switch (token.token) {
16085
+ case "yyyy":
16086
+ return pad(parts.year ?? 0, 4);
16087
+ case "yy":
16088
+ return pad((parts.year ?? 0) % 100, 2);
16089
+ case "MM":
16090
+ return pad(parts.month ?? 0, 2);
16091
+ case "M":
16092
+ return String(parts.month ?? 0);
16093
+ case "dd":
16094
+ return pad(parts.day ?? 0, 2);
16095
+ case "d":
16096
+ return String(parts.day ?? 0);
16097
+ case "HH":
16098
+ return pad(hour, 2);
16099
+ case "H":
16100
+ return String(hour);
16101
+ case "hh":
16102
+ return pad(hour % 12 || 12, 2);
16103
+ case "h":
16104
+ return String(hour % 12 || 12);
16105
+ case "mm":
16106
+ return pad(parts.minute ?? 0, 2);
16107
+ case "ss":
16108
+ return pad(parts.second ?? 0, 2);
16109
+ case "a":
16110
+ return hour < 12 ? "AM" : "PM";
16111
+ }
16112
+ }).join("");
16113
+ }
16114
+ var escapeRegex = (text2) => text2.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
16115
+ function parseInPattern(text2, pattern, kind) {
16116
+ const tokens = compilePattern(pattern, kind);
16117
+ const order = [];
16118
+ const source = tokens.map((token) => {
16119
+ if ("literal" in token) {
16120
+ return escapeRegex(token.literal);
16121
+ }
16122
+ order.push(token.token);
16123
+ if (token.token === "a") {
16124
+ return "(AM|PM)";
16125
+ }
16126
+ const { width } = SPEC[token.token];
16127
+ return width ? `(\\d{${width}})` : "(\\d{1,2})";
16128
+ }).join("");
16129
+ const match = new RegExp(`^${source}$`).exec(text2);
16130
+ if (!match) {
16131
+ return void 0;
16132
+ }
16133
+ const parts = {};
16134
+ let meridiem;
16135
+ order.forEach((name, index) => {
16136
+ const raw = match[index + 1];
16137
+ if (name === "a") {
16138
+ meridiem = raw;
16139
+ return;
16140
+ }
16141
+ const value = Number(raw);
16142
+ switch (name) {
16143
+ // date-fns' two-digit year rule against its reference year 2000: 00–49 → 20xx, 50–99 → 19xx.
16144
+ case "yy":
16145
+ parts.year = value < 50 ? 2e3 + value : 1900 + value;
16146
+ break;
16147
+ case "hh":
16148
+ case "h":
16149
+ parts.hour = value;
16150
+ break;
16151
+ default:
16152
+ parts[SPEC[name].part] = value;
16153
+ }
16154
+ });
16155
+ if (meridiem) {
16156
+ if (parts.hour === void 0 || parts.hour < 1 || parts.hour > 12) {
16157
+ return void 0;
16158
+ }
16159
+ parts.hour = parts.hour % 12 + (meridiem === "PM" ? 12 : 0);
16160
+ }
16161
+ const complete = completeParts(parts, kind);
16162
+ return complete && formatParts(complete, pattern, kind) === text2 ? complete : void 0;
16163
+ }
16164
+ function completeParts(parts, kind) {
16165
+ const { year, month, day, hour, minute, second } = parts;
16166
+ if (kind !== "time" && !isRealDate(year, month, day)) {
16167
+ return void 0;
16168
+ }
16169
+ if (kind !== "date" && !isRealTime(hour, minute, second)) {
16170
+ return void 0;
16171
+ }
16172
+ return kind === "date" ? { year, month, day } : kind === "time" ? { hour, minute, ...second !== void 0 ? { second } : {} } : { year, month, day, hour, minute, ...second !== void 0 ? { second } : {} };
16173
+ }
16174
+ function isRealDate(year, month, day) {
16175
+ if (year === void 0 || month === void 0 || day === void 0 || month < 1 || month > 12 || day < 1) {
16176
+ return false;
16177
+ }
16178
+ const leap = year % 4 === 0 && year % 100 !== 0 || year % 400 === 0;
16179
+ const days = [31, leap ? 29 : 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31][month - 1];
16180
+ return day <= days;
16181
+ }
16182
+ 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);
16183
+ var ISO_DATE = /^(\d{4})-(\d{2})-(\d{2})$/;
16184
+ var ISO_DATE_TIME = /^(\d{4})-(\d{2})-(\d{2})[T ](\d{2}):(\d{2})(?::(\d{2})(?:\.\d+)?)?(?:Z|[+-]\d{2}(?::?\d{2})?)?$/i;
16185
+ var ISO_TIME = /^(\d{2}):(\d{2})(?::(\d{2})(?:\.\d+)?)?(?:Z|[+-]\d{2}(?::?\d{2})?)?$/i;
16186
+ function parseIso(text2, kind) {
16187
+ const dateTime = ISO_DATE_TIME.exec(text2);
16188
+ if (dateTime) {
16189
+ const [, year, month, day, hour, minute, second] = dateTime.map(Number);
16190
+ return completeParts({ year, month, day, hour, minute, ...dateTime[6] ? { second } : {} }, kind);
16191
+ }
16192
+ const date = ISO_DATE.exec(text2);
16193
+ if (date) {
16194
+ return kind === "date" ? completeParts({ year: +date[1], month: +date[2], day: +date[3] }, kind) : void 0;
16195
+ }
16196
+ const time = ISO_TIME.exec(text2);
16197
+ if (time && kind === "time") {
16198
+ return completeParts({ hour: +time[1], minute: +time[2], ...time[3] ? { second: +time[3] } : {} }, kind);
16199
+ }
16200
+ return void 0;
16201
+ }
16202
+ function toCanonical(parts, kind) {
16203
+ const seconds = parts.second !== void 0 ? `:${pad(parts.second, 2)}` : "";
16204
+ const date = `${pad(parts.year ?? 0, 4)}-${pad(parts.month ?? 0, 2)}-${pad(parts.day ?? 0, 2)}`;
16205
+ const time = `${pad(parts.hour ?? 0, 2)}:${pad(parts.minute ?? 0, 2)}${seconds}`;
16206
+ return kind === "date" ? date : kind === "time" ? time : `${date}T${time}`;
16207
+ }
16208
+ function canonicalToPattern(canonical, ins, kind) {
16209
+ const pattern = ins.meta.frDateFormat;
16210
+ if (!pattern) {
16211
+ return canonical;
16212
+ }
16213
+ const parts = parseIso(canonical, kind);
16214
+ return parts ? formatParts(parts, pattern, kind) : canonical;
16215
+ }
16216
+ var MIN_TIMESTAMP_DIGITS = 13;
16217
+ function digitOnlyLength(pattern, kind) {
16218
+ const example = formatParts(EXAMPLE, pattern, kind);
16219
+ return /^\d+$/.test(example) ? example.length : void 0;
16220
+ }
16221
+ function isTimestamp(value, pattern, kind) {
16222
+ if (typeof value === "number") {
16223
+ return Number.isFinite(value);
16224
+ }
16225
+ if (typeof value !== "string") {
16226
+ return false;
16227
+ }
16228
+ const text2 = value.trim();
16229
+ return new RegExp(`^\\d{${MIN_TIMESTAMP_DIGITS},}$`).test(text2) && digitOnlyLength(pattern, kind) !== text2.length;
16230
+ }
16231
+ function timestampParts(value, kind) {
16232
+ const date = new Date(Number(value));
16233
+ if (Number.isNaN(date.getTime())) {
16234
+ return void 0;
16235
+ }
16236
+ const second = date.getSeconds();
16237
+ return completeParts({
16238
+ year: date.getFullYear(),
16239
+ month: date.getMonth() + 1,
16240
+ day: date.getDate(),
16241
+ hour: date.getHours(),
16242
+ minute: date.getMinutes(),
16243
+ ...second ? { second } : {}
16244
+ }, kind);
16245
+ }
16246
+ function toDateString(value, ins, kind) {
16247
+ const pattern = ins.meta.frDateFormat;
16248
+ const text2 = typeof value === "string" ? value.trim() : typeof value === "number" && Number.isInteger(value) && value >= 0 ? String(value) : void 0;
16249
+ if (text2 !== void 0) {
16250
+ const parts = (pattern ? parseInPattern(text2, pattern, kind) : void 0) ?? (typeof value === "string" ? parseIso(text2, kind) : void 0);
16251
+ if (parts) {
16252
+ return { canonical: toCanonical(parts, kind) };
16253
+ }
16254
+ }
16255
+ if (DATE_STRINGS_ACCEPT_TIMESTAMPS && isTimestamp(value, patternOf(ins, kind), kind)) {
16256
+ const parts = timestampParts(value, kind);
16257
+ return parts ? { canonical: toCanonical(parts, kind), fromTimestamp: true } : {};
16258
+ }
16259
+ return {};
16260
+ }
16261
+ var EXAMPLE = { year: 2024, month: 1, day: 31, hour: 13, minute: 45, second: 30 };
16262
+ function expectedDateString(ins, kind) {
16263
+ const pattern = patternOf(ins, kind);
16264
+ const shown = ins.meta.frDateFormat ? pattern : pattern.replace(/'T'/, "T");
16265
+ const example = formatParts(EXAMPLE, pattern, kind);
16266
+ return `${kind === "date" ? "a date" : kind === "time" ? "a time" : "a date and time"} in ${shown}, e.g. ${example}`;
16267
+ }
16268
+ function hasDateFormat(schema, seen = /* @__PURE__ */ new Set()) {
16269
+ if (!schema || seen.has(schema)) {
16270
+ return false;
16271
+ }
16272
+ seen.add(schema);
16273
+ const ins = inspect(schema);
16274
+ if (ins.meta.frDateFormat && dateStringKind(ins)) {
16275
+ return true;
16276
+ }
16277
+ const def = ins.core?._zod?.def ?? {};
16278
+ const children = [
16279
+ ...shapeEntries(ins.core).map(([, child]) => child),
16280
+ ...def.element ? [def.element] : [],
16281
+ ...def.valueType ? [def.valueType] : [],
16282
+ ...ins.branches ?? []
16283
+ ];
16284
+ return children.some((child) => hasDateFormat(child, seen));
16285
+ }
16286
+
16287
+ // ../../flow-extension-runner/src/params/schema/dictionary-binding.ts
16288
+ var DictionaryScope = class _DictionaryScope {
16289
+ constructor(top, visible) {
16290
+ this.top = top;
16291
+ this.visible = visible;
16292
+ }
16293
+ static {
16294
+ this.ROOT = new _DictionaryScope(null, /* @__PURE__ */ new Set());
16295
+ }
16296
+ enter(names) {
16297
+ if (!this.top) {
16298
+ const top = new Set(names);
16299
+ return new _DictionaryScope(top, top);
16300
+ }
16301
+ return new _DictionaryScope(this.top, /* @__PURE__ */ new Set([...this.top, ...names]));
16302
+ }
16303
+ };
16304
+ function resolveDependsOn(binding, scope2) {
16305
+ const aliases = binding.criteriaAliases ?? {};
16306
+ let clash;
16307
+ const dependsOn = binding.dependsOn.map((key) => {
16308
+ const visible = [key, ...aliases[key] ?? []].filter((name) => scope2.visible.has(name));
16309
+ if (visible.length > 1 && !clash) {
16310
+ clash = { key, names: visible };
16311
+ }
16312
+ return visible[0] ?? key;
16313
+ });
16314
+ return clash ? { dependsOn, clash } : { dependsOn };
16315
+ }
16316
+ function publishedBinding(binding, scope2) {
16317
+ return { id: binding.id, dependsOn: resolveDependsOn(binding, scope2).dependsOn };
16318
+ }
16319
+
16320
+ // ../../flow-extension-runner/src/params/schema/assert-supported-schema.ts
15961
16321
  var GUARDED_KINDS = /* @__PURE__ */ new Set(["action", "dictionary", "polling trigger", "realtime trigger", "extension"]);
15962
16322
  var SUPPORTED_TYPES = /* @__PURE__ */ new Set([
15963
16323
  "string",
@@ -15978,31 +16338,31 @@ var SUPPORTED_TYPES = /* @__PURE__ */ new Set([
15978
16338
  ]);
15979
16339
  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()";
15980
16340
  var MODIFIER_SPELLING = ".optional(), .nullable(), .nullish(), .default(v), .prefault(v), .readonly(), .nonoptional(), .pipe(\u2026)/.transform(\u2026) and z.lazy(\u2026)";
15981
- function subjectOf(source, path23) {
16341
+ function subjectOf(source, path22) {
15982
16342
  const kind = source.kind ?? "extension";
15983
16343
  const subject = source.itemId ? `${kind} "${source.itemId}": ` : "";
15984
- return `${subject}\`${path23}\``;
16344
+ return `${subject}\`${path22}\``;
15985
16345
  }
15986
- function refuse(message, source, path23, received) {
16346
+ function refuse(message, source, path22, received) {
15987
16347
  throw new InvalidSchemaError(
15988
16348
  `[flow-extension:${source.serviceId}] ${message}`,
15989
- { serviceId: source.serviceId, kind: source.kind ?? "extension", itemId: source.itemId, slot: source.slot, path: path23, received }
16349
+ { serviceId: source.serviceId, kind: source.kind ?? "extension", itemId: source.itemId, slot: source.slot, path: path22, received }
15990
16350
  );
15991
16351
  }
15992
- function refuseCatch(source, path23) {
16352
+ function refuseCatch(source, path22) {
15993
16353
  refuse(
15994
- `${subjectOf(source, path23)} 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.`,
16354
+ `${subjectOf(source, path22)} 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.`,
15995
16355
  source,
15996
- path23,
16356
+ path22,
15997
16357
  "catch"
15998
16358
  );
15999
16359
  }
16000
- function refuseType(source, path23, type) {
16360
+ function refuseType(source, path22, type) {
16001
16361
  const received = type ? `z.${type}()` : "a value that is not a zod schema";
16002
16362
  refuse(
16003
- `${subjectOf(source, path23)} 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}.`,
16363
+ `${subjectOf(source, path22)} 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}.`,
16004
16364
  source,
16005
- path23,
16365
+ path22,
16006
16366
  type ?? "unknown"
16007
16367
  );
16008
16368
  }
@@ -16018,7 +16378,7 @@ function isLooseObject(schema) {
16018
16378
  function isDynamicPropsSlot(source, topLevel) {
16019
16379
  return topLevel && source.kind === "action" && source.slot === "params";
16020
16380
  }
16021
- function assertDynamicProps(schema, name, siblings, source, path23) {
16381
+ function assertDynamicProps(schema, name, siblings, source, path22) {
16022
16382
  const ins = inspect(schema);
16023
16383
  const spec = ins.meta.frDynamicProps;
16024
16384
  if (!spec) {
@@ -16029,49 +16389,49 @@ function assertDynamicProps(schema, name, siblings, source, path23) {
16029
16389
  }
16030
16390
  if (typeof spec.execute !== "function") {
16031
16391
  refuse(
16032
- `${subjectOf(source, path23)}: \`.dynamicProps()\` needs an \`execute\` function that returns the loaded fields.`,
16392
+ `${subjectOf(source, path22)}: \`.dynamicProps()\` needs an \`execute\` function that returns the loaded fields.`,
16033
16393
  source,
16034
- path23,
16394
+ path22,
16035
16395
  typeof spec.execute
16036
16396
  );
16037
16397
  }
16038
16398
  if (spec.dependsOn !== void 0 && (!Array.isArray(spec.dependsOn) || spec.dependsOn.some((item) => typeof item !== "string"))) {
16039
16399
  refuse(
16040
- `${subjectOf(source, path23)}: \`.dynamicProps()\` \`dependsOn\` must be an array of param names.`,
16400
+ `${subjectOf(source, path22)}: \`.dynamicProps()\` \`dependsOn\` must be an array of param names.`,
16041
16401
  source,
16042
- path23,
16402
+ path22,
16043
16403
  "dependsOn"
16044
16404
  );
16045
16405
  }
16046
16406
  for (const dependency of spec.dependsOn ?? []) {
16047
16407
  if (dependency === name || !siblings.includes(dependency)) {
16048
16408
  refuse(
16049
- `${subjectOf(source, path23)}: \`.dynamicProps()\` depends on "${dependency}", which is not another param of this action. Name its sibling params: ${siblings.filter((sibling) => sibling !== name).join(", ") || "none"}.`,
16409
+ `${subjectOf(source, path22)}: \`.dynamicProps()\` depends on "${dependency}", which is not another param of this action. Name its sibling params: ${siblings.filter((sibling) => sibling !== name).join(", ") || "none"}.`,
16050
16410
  source,
16051
- path23,
16411
+ path22,
16052
16412
  dependency
16053
16413
  );
16054
16414
  }
16055
16415
  }
16056
16416
  if (ins.meta.frDictionary) {
16057
16417
  refuse(
16058
- `${subjectOf(source, path23)} 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.`,
16418
+ `${subjectOf(source, path22)} 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.`,
16059
16419
  source,
16060
- path23,
16420
+ path22,
16061
16421
  "dictionary"
16062
16422
  );
16063
16423
  }
16064
16424
  const element = ins.resolvedType === "array" ? ins.core?._zod?.def?.element : void 0;
16065
16425
  if (!isLooseObject(schema) && !isLooseObject(element)) {
16066
16426
  refuse(
16067
- `${subjectOf(source, path23)}: \`.dynamicProps()\` needs a loose object \u2014 the loaded fields are not declared, so a plain \`z.object()\` would strip them. ${DYNAMIC_PROPS_FIX}`,
16427
+ `${subjectOf(source, path22)}: \`.dynamicProps()\` needs a loose object \u2014 the loaded fields are not declared, so a plain \`z.object()\` would strip them. ${DYNAMIC_PROPS_FIX}`,
16068
16428
  source,
16069
- path23,
16429
+ path22,
16070
16430
  ins.resolvedType ?? "unknown"
16071
16431
  );
16072
16432
  }
16073
16433
  }
16074
- function assertDictionaryBinding(schema, source, path23, scope2) {
16434
+ function assertDictionaryBinding(schema, source, path22, scope2) {
16075
16435
  const binding = inspect(schema).meta.frDictionary;
16076
16436
  if (!binding) {
16077
16437
  return;
@@ -16079,14 +16439,56 @@ function assertDictionaryBinding(schema, source, path23, scope2) {
16079
16439
  const { clash } = resolveDependsOn(binding, scope2);
16080
16440
  if (clash) {
16081
16441
  refuse(
16082
- `${subjectOf(source, path23)} 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.`,
16442
+ `${subjectOf(source, path22)} 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.`,
16083
16443
  source,
16084
- path23,
16444
+ path22,
16085
16445
  clash.names.join(", ")
16086
16446
  );
16087
16447
  }
16088
16448
  }
16089
- function assertField(schema, source, path23, seen, scope2, topLevel = false) {
16449
+ function assertDateString(schema, source, path22) {
16450
+ const ins = inspect(schema);
16451
+ const pattern = ins.meta.frDateFormat;
16452
+ const kind = dateStringKind(ins);
16453
+ if (pattern !== void 0 && !kind) {
16454
+ const format = ins.core?._zod?.def?.format;
16455
+ const zoned = ins.coreType === "string" && format === "datetime";
16456
+ refuse(
16457
+ `${subjectOf(source, path22)} 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.`,
16458
+ source,
16459
+ path22,
16460
+ zoned ? "datetime" : ins.resolvedType ?? "unknown"
16461
+ );
16462
+ }
16463
+ if (!kind) {
16464
+ return;
16465
+ }
16466
+ if (pattern !== void 0) {
16467
+ try {
16468
+ compilePattern(pattern, kind);
16469
+ } catch (error) {
16470
+ if (error instanceof DateFormatError) {
16471
+ refuse(`${subjectOf(source, path22)}: \`.dateFormat('${pattern}')\` ${error.message}.`, source, path22, pattern);
16472
+ }
16473
+ throw error;
16474
+ }
16475
+ }
16476
+ const fallback = ins.defaultValue;
16477
+ if (fallback === void 0 || fallback === null) {
16478
+ return;
16479
+ }
16480
+ const written = patternOf(ins, kind);
16481
+ const fits = typeof fallback === "string" && (pattern !== void 0 ? !!parseInPattern(fallback, pattern, kind) : ((parts) => !!parts && toCanonical(parts, kind) === fallback)(parseIso(fallback, kind)));
16482
+ if (!fits) {
16483
+ refuse(
16484
+ `${subjectOf(source, path22)} 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.`,
16485
+ source,
16486
+ path22,
16487
+ String(fallback)
16488
+ );
16489
+ }
16490
+ }
16491
+ function assertField(schema, source, path22, seen, scope2, topLevel = false) {
16090
16492
  if (!schema || seen.has(schema)) {
16091
16493
  return;
16092
16494
  }
@@ -16094,34 +16496,35 @@ function assertField(schema, source, path23, seen, scope2, topLevel = false) {
16094
16496
  const ins = inspect(schema);
16095
16497
  if (ins.meta.frDynamicProps && !isDynamicPropsSlot(source, topLevel)) {
16096
16498
  refuse(
16097
- `${subjectOf(source, path23)} 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.`,
16499
+ `${subjectOf(source, path22)} 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.`,
16098
16500
  source,
16099
- path23,
16501
+ path22,
16100
16502
  "dynamicProps"
16101
16503
  );
16102
16504
  }
16103
16505
  if (ins.resolvedType === "catch") {
16104
- refuseCatch(source, path23);
16506
+ refuseCatch(source, path22);
16105
16507
  }
16106
- assertDictionaryBinding(schema, source, path23, scope2);
16508
+ assertDictionaryBinding(schema, source, path22, scope2);
16509
+ assertDateString(schema, source, path22);
16107
16510
  if (!ins.resolvedType || !SUPPORTED_TYPES.has(ins.resolvedType)) {
16108
- refuseType(source, path23, ins.resolvedType);
16511
+ refuseType(source, path22, ins.resolvedType);
16109
16512
  }
16110
16513
  if (ins.branches) {
16111
- ins.branches.forEach((branch, index) => assertField(branch, source, `${path23}|branch ${index + 1}`, seen, scope2));
16514
+ ins.branches.forEach((branch, index) => assertField(branch, source, `${path22}|branch ${index + 1}`, seen, scope2));
16112
16515
  }
16113
16516
  const def = ins.core._zod?.def ?? {};
16114
16517
  if (ins.resolvedType === "array") {
16115
- assertField(def.element, source, `${path23}[]`, seen, scope2);
16518
+ assertField(def.element, source, `${path22}[]`, seen, scope2);
16116
16519
  }
16117
16520
  if (ins.resolvedType === "record") {
16118
- assertField(def.valueType, source, `${path23}{}`, seen, scope2);
16521
+ assertField(def.valueType, source, `${path22}{}`, seen, scope2);
16119
16522
  }
16120
16523
  if (ins.resolvedType === "object") {
16121
16524
  const properties = shapeEntries(ins.core);
16122
16525
  const inner = scope2.enter(properties.map(([name]) => name));
16123
16526
  for (const [name, property] of properties) {
16124
- assertField(property, source, `${path23}.${name}`, seen, inner);
16527
+ assertField(property, source, `${path22}.${name}`, seen, inner);
16125
16528
  }
16126
16529
  }
16127
16530
  }
@@ -16142,7 +16545,7 @@ function assertSupportedSchema(scheme, source) {
16142
16545
  }
16143
16546
  }
16144
16547
 
16145
- // ../../flow-extension-runner/src/v2/params/schema/dates.ts
16548
+ // ../../flow-extension-runner/src/params/schema/dates.ts
16146
16549
  var DATE_ONLY = /^\d{4}-\d{2}-\d{2}$/;
16147
16550
  var HAS_TIME = /^(\d{4}-\d{2}-\d{2})[T ](.+)$/;
16148
16551
  var ZONE = /(Z|[+-]\d{2}:?\d{2})$/;
@@ -16221,7 +16624,7 @@ function hasPassThroughDate(schema, inspectSchema, entriesOf) {
16221
16624
  return children.some((child) => hasPassThroughDate(child, inspectSchema, entriesOf));
16222
16625
  }
16223
16626
 
16224
- // ../../flow-extension-runner/src/v2/params/schema/labels.ts
16627
+ // ../../flow-extension-runner/src/params/schema/labels.ts
16225
16628
  var ACRONYMS = /* @__PURE__ */ new Set([
16226
16629
  "id",
16227
16630
  "url",
@@ -16255,7 +16658,7 @@ function humanizeKey(name) {
16255
16658
  }
16256
16659
  var labelOf = (name, schema) => inspect(schema).meta.title || humanizeKey(name) || name;
16257
16660
 
16258
- // ../../flow-extension-runner/src/v2/params/schema/field-plan.ts
16661
+ // ../../flow-extension-runner/src/params/schema/field-plan.ts
16259
16662
  function declaredAbsence(schema) {
16260
16663
  let current = schema;
16261
16664
  let acceptsUndefined = false;
@@ -16354,16 +16757,46 @@ function planField(name, schema) {
16354
16757
  label: labelOf(name, schema),
16355
16758
  coreType: ins.coreType,
16356
16759
  isUnion: !!ins.branches,
16760
+ blankBranch: hasBlankBranch(ins),
16357
16761
  absence,
16358
16762
  absorbsBlank,
16359
16763
  keepsEmpty,
16360
16764
  blankIsValue,
16361
16765
  passThroughDate: passesDateThrough(ins),
16362
- restoresDates: hasPassThroughDate(schema, inspect, shapeEntries)
16766
+ restoresDates: hasPassThroughDate(schema, inspect, shapeEntries),
16767
+ dateString: dateStringKind(ins),
16768
+ formatsDates: hasDateFormat(schema)
16363
16769
  };
16364
16770
  }
16365
16771
 
16366
- // ../../flow-extension-runner/src/v2/params/schema/coerce.ts
16772
+ // ../../flow-extension-runner/src/params/schema/notices.ts
16773
+ var sink;
16774
+ var currentField;
16775
+ function collectNotices(fn) {
16776
+ const outer = sink;
16777
+ const notices = [];
16778
+ sink = notices;
16779
+ try {
16780
+ return { result: fn(), notices };
16781
+ } finally {
16782
+ sink = outer;
16783
+ outer?.push(...notices);
16784
+ }
16785
+ }
16786
+ function withinField(field, fn) {
16787
+ const outer = currentField;
16788
+ currentField = field;
16789
+ try {
16790
+ return fn();
16791
+ } finally {
16792
+ currentField = outer;
16793
+ }
16794
+ }
16795
+ function notice(entry) {
16796
+ sink?.push({ field: currentField, ...entry });
16797
+ }
16798
+
16799
+ // ../../flow-extension-runner/src/params/schema/coerce.ts
16367
16800
  var ok = (value) => ({ ok: true, value });
16368
16801
  var fail2 = (expected) => ({ ok: false, expected });
16369
16802
  var TRUE = /* @__PURE__ */ new Set(["true", "1", "yes", "y", "t", "on", "checked", "enabled", "enable", "active"]);
@@ -16534,6 +16967,21 @@ function coerceLeaf(value, ins) {
16534
16967
  if (ins.branches) {
16535
16968
  return ok(coerceUnion(value, ins.branches));
16536
16969
  }
16970
+ const kind = dateStringKind(ins);
16971
+ if (kind) {
16972
+ const { canonical, fromTimestamp } = toDateString(value, ins, kind);
16973
+ if (canonical === void 0) {
16974
+ return fail2(expectedDateString(ins, kind));
16975
+ }
16976
+ if (fromTimestamp) {
16977
+ notice({
16978
+ message: "a timestamp was converted to a date string in the server time zone (FR-3920 lenient period)",
16979
+ value,
16980
+ converted: canonical
16981
+ });
16982
+ }
16983
+ return ok(canonical);
16984
+ }
16537
16985
  const format = formatOf(ins);
16538
16986
  if (ins.coreType === "string" && isConvertibleIso(format)) {
16539
16987
  const iso = toIso(value, format);
@@ -16562,12 +17010,12 @@ function isBlank(value, ins, schema) {
16562
17010
  return false;
16563
17011
  }
16564
17012
  if (ins.branches) {
16565
- return true;
17013
+ return !hasBlankBranch(ins) || absenceOf(schema).absorbsBlank;
16566
17014
  }
16567
17015
  if (absenceOf(schema).blankIsValue) {
16568
17016
  return absenceOf(schema).absorbsBlank;
16569
17017
  }
16570
- return ins.coreType !== "string" || absenceOf(schema).absorbsBlank;
17018
+ return ins.coreType !== "string" || !!dateStringKind(ins) || absenceOf(schema).absorbsBlank;
16571
17019
  }
16572
17020
  function absentAs(schema, value) {
16573
17021
  const { absence } = absenceOf(schema);
@@ -16580,7 +17028,7 @@ function absentAs(schema, value) {
16580
17028
  return absence === "null" ? null : void 0;
16581
17029
  }
16582
17030
 
16583
- // ../../flow-extension-runner/src/v2/params/schema/defaults.ts
17031
+ // ../../flow-extension-runner/src/params/schema/defaults.ts
16584
17032
  var WIDGET_DESCRIPTIONS = {
16585
17033
  [FlowExtensionParamWidgetTypes.MULTI_LINE_TEXT]: "Expects text; line breaks are allowed"
16586
17034
  };
@@ -16617,7 +17065,7 @@ var FORMAT_DESCRIPTIONS = {
16617
17065
  cidrv6: "Expects an IPv6 range, e.g. 2001:db8::/32"
16618
17066
  };
16619
17067
 
16620
- // ../../flow-extension-runner/src/v2/params/schema/messages.ts
17068
+ // ../../flow-extension-runner/src/params/schema/messages.ts
16621
17069
  var EXPECTED = {
16622
17070
  string: "a string",
16623
17071
  number: "a number",
@@ -16631,6 +17079,72 @@ var EXPECTED = {
16631
17079
  record: "an object"
16632
17080
  };
16633
17081
  var requiredMessage = (plan2) => `\xAB${plan2.label}\xBB is required`;
17082
+ var oneOf = (values) => `one of: ${values.map(String).join(", ")}`;
17083
+ var formatPhrase = (format) => {
17084
+ const described = FORMAT_DESCRIPTIONS[format ?? ""];
17085
+ return described?.replace(/^Expects (.*?), e\.g\. (.*)$/, "$1 (e.g. $2)").replace(/^Expects /, "");
17086
+ };
17087
+ var distinct = (phrases) => [...new Set(phrases.filter((phrase) => !!phrase))];
17088
+ function unionPhrases(union, value) {
17089
+ return distinct((inspect(union).branches ?? []).map((branch) => {
17090
+ try {
17091
+ const result = branch.safeParse(value);
17092
+ return branchPhrase(branch, result.error?.issues[0]);
17093
+ } catch {
17094
+ return void 0;
17095
+ }
17096
+ }));
17097
+ }
17098
+ function remainingIssue(branch, value) {
17099
+ if (!branch) {
17100
+ return void 0;
17101
+ }
17102
+ try {
17103
+ const result = branch.safeParse(coerceDeep(value, branch));
17104
+ return result.success ? void 0 : result.error?.issues[0];
17105
+ } catch {
17106
+ return void 0;
17107
+ }
17108
+ }
17109
+ function branchPhrase(branch, issue) {
17110
+ if (!branch || !issue) {
17111
+ return void 0;
17112
+ }
17113
+ const ins = inspect(branch);
17114
+ const values = ins.core._zod?.def?.values ?? [];
17115
+ if (ins.coreType === "literal" && values.length === 1 && values[0] === "") {
17116
+ return void 0;
17117
+ }
17118
+ const dateKind = dateStringKind(ins);
17119
+ if (dateKind) {
17120
+ return expectedDateString(ins, dateKind);
17121
+ }
17122
+ switch (issue.code) {
17123
+ case "invalid_type":
17124
+ return EXPECTED[issue.expected ?? ""] ?? issue.expected;
17125
+ case "invalid_value":
17126
+ return oneOf(issue.values ?? values);
17127
+ case "invalid_format":
17128
+ return formatPhrase(issue.format);
17129
+ // A bound has no short phrase ("a number of at least 10"); the branch still names its type.
17130
+ case "too_small":
17131
+ case "too_big":
17132
+ return EXPECTED[ins.coreType === "literal" ? literalType(ins.core) ?? "" : ins.coreType];
17133
+ default:
17134
+ return void 0;
17135
+ }
17136
+ }
17137
+ function unionIssue(plan2, issue, union, unionValue, fieldValue) {
17138
+ const branches = union ? inspect(union).branches : void 0;
17139
+ const errors = issue.errors ?? [];
17140
+ const deepIndex = errors.findIndex((branchIssues) => branchIssues.some((branchIssue) => (branchIssue.path ?? []).length));
17141
+ if (deepIndex >= 0) {
17142
+ const deep = remainingIssue(branches?.[deepIndex], unionValue) ?? errors[deepIndex].find((branchIssue) => (branchIssue.path ?? []).length);
17143
+ return toFieldIssue(plan2, { ...deep, path: [...issue.path ?? [], ...deep.path ?? []] }, fieldValue);
17144
+ }
17145
+ const phrases = distinct(errors.map((branchIssues, index) => branchPhrase(branches?.[index], branchIssues[0])));
17146
+ return phrases.length ? { path: "", code: "invalid_union", message: `must be ${phrases.join(", or ")}` } : void 0;
17147
+ }
16634
17148
  var invalidTypeMessage = (plan2, expected) => `\xAB${plan2.label}\xBB must be ${EXPECTED[expected] ?? expected}`;
16635
17149
  var isIndex = (segment) => /^\d+$/.test(segment);
16636
17150
  function resolveTarget(plan2, segments, fieldValue) {
@@ -16639,6 +17153,8 @@ function resolveTarget(plan2, segments, fieldValue) {
16639
17153
  let label = plan2.label;
16640
17154
  let found = true;
16641
17155
  for (const segment of segments) {
17156
+ const branch = schema && inspect(schema).branches?.find((candidate) => isIndex(segment) ? inspect(candidate).coreType === "array" : shapeEntries(inspect(candidate).core).some(([name]) => name === segment));
17157
+ schema = branch ?? schema;
16642
17158
  const core = schema ? inspect(schema).core : void 0;
16643
17159
  const coreType = core ? inspect(schema).coreType : void 0;
16644
17160
  value = value == null ? void 0 : value[segment];
@@ -16655,7 +17171,7 @@ function resolveTarget(plan2, segments, fieldValue) {
16655
17171
  schema = nested[1];
16656
17172
  label = labelOf(segment, schema);
16657
17173
  }
16658
- return { label, value, found };
17174
+ return { label, value, found, schema: found ? schema : void 0 };
16659
17175
  }
16660
17176
  function bound(value, plan2) {
16661
17177
  if (plan2.coreType !== "date" || typeof value !== "number") {
@@ -16670,36 +17186,55 @@ function isAuthored(issue) {
16670
17186
  }
16671
17187
  function toFieldIssue(plan2, issue, fieldValue) {
16672
17188
  const segments = (issue.path ?? []).map(String).filter(Boolean);
16673
- const path23 = segments.length ? `${plan2.name}.${segments.join(".")}` : plan2.name;
17189
+ const path22 = segments.length ? `${plan2.name}.${segments.join(".")}` : plan2.name;
16674
17190
  const code = issue.code ?? "custom";
16675
17191
  const target = resolveTarget(plan2, segments, fieldValue);
16676
17192
  const named = { ...plan2, label: target.label };
16677
17193
  if (isAuthored(issue)) {
16678
- return { path: path23, code, message: issue.message };
17194
+ return { path: path22, code, message: issue.message };
17195
+ }
17196
+ if (code === "invalid_format" && target.schema && inspect(target.schema).branches) {
17197
+ const combined = unionPhrases(target.schema, target.value);
17198
+ if (combined.length > 1) {
17199
+ return { path: path22, code: "invalid_union", message: `\xAB${target.label}\xBB must be ${combined.join(", or ")}` };
17200
+ }
17201
+ }
17202
+ const dateKind = target.schema ? dateStringKind(inspect(target.schema)) : void 0;
17203
+ const dateMissing = target.value == null || target.value === "";
17204
+ if (dateKind && (code === "invalid_type" || code === "invalid_format")) {
17205
+ return dateMissing ? { path: path22, code, message: requiredMessage(named) } : { path: path22, code, message: invalidTypeMessage(named, expectedDateString(inspect(target.schema), dateKind)) };
16679
17206
  }
16680
17207
  if (code === "invalid_type") {
16681
17208
  const received = issue.received;
16682
17209
  const absent = segments.length ? target.found && target.value == null : received === "undefined" || received === "null" || issue.expected === void 0;
16683
- return absent ? { path: path23, code, message: requiredMessage(named) } : { path: path23, code, message: invalidTypeMessage(named, issue.expected ?? "") };
17210
+ return absent ? { path: path22, code, message: requiredMessage(named) } : { path: path22, code, message: invalidTypeMessage(named, issue.expected ?? "") };
16684
17211
  }
16685
17212
  if (code === "too_small") {
16686
- return { path: path23, code, message: `\xAB${target.label}\xBB must be at least ${bound(issue.minimum, plan2)}` };
17213
+ return { path: path22, code, message: `\xAB${target.label}\xBB must be at least ${bound(issue.minimum, plan2)}` };
16687
17214
  }
16688
17215
  if (code === "too_big") {
16689
- return { path: path23, code, message: `\xAB${target.label}\xBB must be at most ${bound(issue.maximum, plan2)}` };
17216
+ return { path: path22, code, message: `\xAB${target.label}\xBB must be at most ${bound(issue.maximum, plan2)}` };
16690
17217
  }
16691
17218
  if (code === "invalid_value") {
16692
- const values = (issue.values ?? []).map(String);
16693
- return { path: path23, code, message: `\xAB${target.label}\xBB must be one of: ${values.join(", ")}` };
17219
+ return { path: path22, code, message: `\xAB${target.label}\xBB must be ${oneOf(issue.values ?? [])}` };
16694
17220
  }
16695
17221
  if (code === "invalid_format") {
16696
17222
  const described = FORMAT_DESCRIPTIONS[issue.format ?? ""];
16697
- return described ? { path: path23, code, message: `\xAB${target.label}\xBB is invalid \u2014 ${described.replace(/^Expects /, "expects ")}` } : { path: path23, code, message: `\xAB${target.label}\xBB has an invalid format` };
17223
+ return described ? { path: path22, code, message: `\xAB${target.label}\xBB is invalid \u2014 ${described.replace(/^Expects /, "expects ")}` } : { path: path22, code, message: `\xAB${target.label}\xBB has an invalid format` };
16698
17224
  }
16699
- return { path: path23, code, message: `\xAB${target.label}\xBB is invalid` };
17225
+ if (code === "invalid_union") {
17226
+ if (segments.length && target.found && target.value == null) {
17227
+ return { path: path22, code, message: requiredMessage(named) };
17228
+ }
17229
+ const combined = unionIssue(plan2, issue, target.schema, target.value, fieldValue);
17230
+ if (combined) {
17231
+ return combined.path ? combined : { path: path22, code, message: `\xAB${target.label}\xBB ${combined.message}` };
17232
+ }
17233
+ }
17234
+ return { path: path22, code, message: `\xAB${target.label}\xBB is invalid` };
16700
17235
  }
16701
17236
 
16702
- // ../../flow-extension-runner/src/v2/params/schema/normalize.ts
17237
+ // ../../flow-extension-runner/src/params/schema/normalize.ts
16703
17238
  var resolved2 = (value) => ({ value, present: true, issues: [] });
16704
17239
  var rejected = (issues) => ({ present: false, issues });
16705
17240
  function isAbsent(value, plan2) {
@@ -16716,12 +17251,12 @@ function isAbsent(value, plan2) {
16716
17251
  return false;
16717
17252
  }
16718
17253
  if (plan2.isUnion) {
16719
- return true;
17254
+ return !plan2.blankBranch || plan2.absorbsBlank;
16720
17255
  }
16721
17256
  if (plan2.blankIsValue) {
16722
17257
  return plan2.absorbsBlank;
16723
17258
  }
16724
- return plan2.coreType !== "string" || plan2.absorbsBlank;
17259
+ return plan2.coreType !== "string" || !!plan2.dateString || plan2.absorbsBlank;
16725
17260
  }
16726
17261
  function normalizeAbsence(value, plan2) {
16727
17262
  if (plan2.absence === "required") {
@@ -16760,7 +17295,7 @@ function normalizeField(value, plan2) {
16760
17295
  return restore(validate(coerced.value, plan2), value, plan2);
16761
17296
  }
16762
17297
  function restore(result, original, plan2) {
16763
- if (!plan2.restoresDates || !result.present || result.issues.length) {
17298
+ if (!(plan2.restoresDates || plan2.formatsDates) || !result.present || result.issues.length) {
16764
17299
  return result;
16765
17300
  }
16766
17301
  if (plan2.passThroughDate) {
@@ -16780,6 +17315,10 @@ function restoreDeep(output, original, schema) {
16780
17315
  const branch = ins.branches.find((option) => accepts(option, output));
16781
17316
  return branch ? restoreDeep(output, original, branch) : output;
16782
17317
  }
17318
+ const kind = dateStringKind(ins);
17319
+ if (kind) {
17320
+ return typeof output === "string" && original !== "" ? canonicalToPattern(output, ins, kind) : output;
17321
+ }
16783
17322
  const element = ins.core?._zod?.def?.element;
16784
17323
  if (ins.coreType === "array" && element && Array.isArray(output) && Array.isArray(original)) {
16785
17324
  return output.map((item, index) => restoreDeep(item, original[index], element));
@@ -16803,7 +17342,7 @@ function restoreDeep(output, original, schema) {
16803
17342
  }
16804
17343
  var isPlain = (value) => !!value && typeof value === "object" && !Array.isArray(value);
16805
17344
 
16806
- // ../../flow-extension-runner/src/v2/params/schema/parse.ts
17345
+ // ../../flow-extension-runner/src/params/schema/parse.ts
16807
17346
  var EXPECTED2 = {
16808
17347
  string: "a string",
16809
17348
  number: "a number",
@@ -16813,10 +17352,10 @@ var EXPECTED2 = {
16813
17352
  };
16814
17353
  function toIssues(error, param) {
16815
17354
  return (error?.issues ?? []).map((issue) => {
16816
- const path23 = (issue.path ?? []).map(String).join(".");
17355
+ const path22 = (issue.path ?? []).map(String).join(".");
16817
17356
  const expected = issue.expected;
16818
- const restated = param && !path23 && issue.code === "invalid_type" && expected ? `\xAB${param}\xBB must be ${EXPECTED2[expected] ?? expected}` : void 0;
16819
- return { path: path23, message: restated ?? issue.message ?? "invalid value", code: issue.code };
17357
+ const restated = param && !path22 && issue.code === "invalid_type" && expected ? `\xAB${param}\xBB must be ${EXPECTED2[expected] ?? expected}` : void 0;
17358
+ return { path: path22, message: restated ?? issue.message ?? "invalid value", code: issue.code };
16820
17359
  });
16821
17360
  }
16822
17361
  function parseSchema(schema, value, fail3, param) {
@@ -16830,7 +17369,7 @@ function parseSchema(schema, value, fail3, param) {
16830
17369
  return result.data;
16831
17370
  }
16832
17371
 
16833
- // ../../flow-extension-runner/src/v2/params/params.ts
17372
+ // ../../flow-extension-runner/src/params/params.ts
16834
17373
  var Params = class {
16835
17374
  constructor(scheme, source = {}) {
16836
17375
  this.source = source;
@@ -16869,7 +17408,7 @@ var Params = class {
16869
17408
  const values = {};
16870
17409
  const issues = [];
16871
17410
  for (const plan2 of this.plans()) {
16872
- const result = normalizeField(source[plan2.name], plan2);
17411
+ const result = withinField(plan2.name, () => normalizeField(source[plan2.name], plan2));
16873
17412
  if (result.issues.length) {
16874
17413
  issues.push(...result.issues);
16875
17414
  } else if (result.present) {
@@ -16885,7 +17424,7 @@ var Params = class {
16885
17424
  }
16886
17425
  };
16887
17426
 
16888
- // ../../flow-extension-runner/src/v2/params/config-params.ts
17427
+ // ../../flow-extension-runner/src/params/config-params.ts
16889
17428
  var ConfigParams = class _ConfigParams extends Params {
16890
17429
  static of(scheme, source = {}) {
16891
17430
  return new _ConfigParams(scheme, source);
@@ -16908,7 +17447,7 @@ var ConfigParams = class _ConfigParams extends Params {
16908
17447
  }
16909
17448
  };
16910
17449
 
16911
- // ../../flow-extension-runner/src/v2/params/method-params.ts
17450
+ // ../../flow-extension-runner/src/params/method-params.ts
16912
17451
  var MethodParams = class _MethodParams extends Params {
16913
17452
  static of(scheme, source = {}) {
16914
17453
  return new _MethodParams(scheme, source);
@@ -16934,10 +17473,10 @@ var MethodParams = class _MethodParams extends Params {
16934
17473
  }
16935
17474
  };
16936
17475
 
16937
- // ../../flow-extension-runner/src/v2/params/zod.ts
17476
+ // ../../flow-extension-runner/src/params/zod.ts
16938
17477
  var import_zod3 = require("zod");
16939
17478
 
16940
- // ../../flow-extension-runner/src/v2/params/files-options.ts
17479
+ // ../../flow-extension-runner/src/params/files-options.ts
16941
17480
  var import_zod2 = require("zod");
16942
17481
  var SCOPE_VALUES = ["WORKSPACE", "FLOW", "EXECUTION"];
16943
17482
  var scope = () => import_zod2.z.enum(SCOPE_VALUES).label("Scope").describe("Storage scope: WORKSPACE (shared across flows), FLOW (this flow only), EXECUTION (this run only)").default("FLOW");
@@ -16993,7 +17532,7 @@ function filesDeleteOptions(include) {
16993
17532
  return group("filesDeleteOptions", FlowExtensionParamWidgetTypes.FILE_DELETE_OPTIONS, DELETE_FIELDS, include);
16994
17533
  }
16995
17534
 
16996
- // ../../flow-extension-runner/src/v2/params/zod.ts
17535
+ // ../../flow-extension-runner/src/params/zod.ts
16997
17536
  var extended = false;
16998
17537
  function extendPrototype() {
16999
17538
  if (extended) {
@@ -17024,6 +17563,9 @@ function extendPrototype() {
17024
17563
  }
17025
17564
  return this.meta({ frDictionary: binding });
17026
17565
  };
17566
+ proto.dateFormat = function dateFormat(pattern) {
17567
+ return this.meta({ frDateFormat: pattern });
17568
+ };
17027
17569
  proto.labels = function labels(byValue) {
17028
17570
  return this.meta({ frLabels: byValue });
17029
17571
  };
@@ -17061,7 +17603,7 @@ Object.defineProperties(namespace, {
17061
17603
  });
17062
17604
  var z2 = namespace;
17063
17605
 
17064
- // ../../flow-extension-runner/src/v2/params/json/values.ts
17606
+ // ../../flow-extension-runner/src/params/json/values.ts
17065
17607
  function toJsonValue(value) {
17066
17608
  if (typeof value === "bigint") {
17067
17609
  return { $bigint: value.toString() };
@@ -17078,7 +17620,7 @@ function toJsonValue(value) {
17078
17620
  return value;
17079
17621
  }
17080
17622
 
17081
- // ../../flow-extension-runner/src/v2/params/json/checks.ts
17623
+ // ../../flow-extension-runner/src/params/json/checks.ts
17082
17624
  var defOf = (check) => check?._zod?.def ?? {};
17083
17625
  function messageOf(source) {
17084
17626
  const { error } = source;
@@ -17157,10 +17699,10 @@ function encodeChecks(core) {
17157
17699
  return { checks, unsupported };
17158
17700
  }
17159
17701
 
17160
- // ../../flow-extension-runner/src/v2/params/json/types.ts
17702
+ // ../../flow-extension-runner/src/params/json/types.ts
17161
17703
  var SCHEMA_JSON_VERSION = 1;
17162
17704
 
17163
- // ../../flow-extension-runner/src/v2/params/json/decode.ts
17705
+ // ../../flow-extension-runner/src/params/json/decode.ts
17164
17706
  var FORMAT_FACTORIES = {
17165
17707
  url: z2.url,
17166
17708
  email: z2.email,
@@ -17190,7 +17732,7 @@ var FORMAT_FACTORIES = {
17190
17732
  duration: z2.iso?.duration
17191
17733
  };
17192
17734
 
17193
- // ../../flow-extension-runner/src/v2/params/json/encode.ts
17735
+ // ../../flow-extension-runner/src/params/json/encode.ts
17194
17736
  var FIELD_TYPES = /* @__PURE__ */ new Set([
17195
17737
  "string",
17196
17738
  "number",
@@ -17322,6 +17864,7 @@ function encodeField(name, schema, seen = /* @__PURE__ */ new Set(), loaderId, s
17322
17864
  name,
17323
17865
  type,
17324
17866
  ...format ? { format } : {},
17867
+ ...format === "datetime" && core?._zod?.def?.local ? { local: true } : {},
17325
17868
  ...optional ? { optional: true } : {},
17326
17869
  ...nullable ? { nullable: true } : {},
17327
17870
  ...hasDefault ? { default: toJsonValue(defaultValue) } : {},
@@ -17357,7 +17900,7 @@ function encodeParams(scheme, options = {}) {
17357
17900
  };
17358
17901
  }
17359
17902
 
17360
- // ../../flow-extension-runner/src/v2/context/method-input.ts
17903
+ // ../../flow-extension-runner/src/context/method-input.ts
17361
17904
  var MethodInput = class {
17362
17905
  constructor(serviceId, methodName, data = {}) {
17363
17906
  this.serviceId = serviceId;
@@ -17415,7 +17958,7 @@ var MethodInput = class {
17415
17958
  }
17416
17959
  };
17417
17960
 
17418
- // ../../flow-extension-runner/src/v2/method.ts
17961
+ // ../../flow-extension-runner/src/method.ts
17419
17962
  var ExtensionMethod = class {
17420
17963
  constructor(extension) {
17421
17964
  this.extension = extension;
@@ -17444,7 +17987,7 @@ var ExtensionMethod = class {
17444
17987
  }
17445
17988
  };
17446
17989
 
17447
- // ../../flow-extension-runner/src/common/constants.ts
17990
+ // ../../flow-extension-runner/src/params/config-types.ts
17448
17991
  var ServiceConfigItemTypes = {
17449
17992
  STRING: "string",
17450
17993
  BOOL: "bool",
@@ -17453,7 +17996,7 @@ var ServiceConfigItemTypes = {
17453
17996
  TEXT: "text"
17454
17997
  };
17455
17998
 
17456
- // ../../flow-extension-runner/src/v2/model/field-mapper.ts
17999
+ // ../../flow-extension-runner/src/model/field-mapper.ts
17457
18000
  var descriptionOf = (schema) => inspect(schema).meta.description || "";
17458
18001
  var isRequired = (schema) => absenceOf(schema).absence === "required";
17459
18002
  var isParamGroup = (ins) => ins.coreType === "object" && !!ins.meta.frWidget;
@@ -17560,7 +18103,7 @@ function fieldToConfigItem(name, schema) {
17560
18103
  };
17561
18104
  }
17562
18105
 
17563
- // ../../flow-extension-runner/src/v2/model/method-model.ts
18106
+ // ../../flow-extension-runner/src/model/method-model.ts
17564
18107
  function opaqueParam(name, type = "OBJECT") {
17565
18108
  return { name, required: false, description: "", type };
17566
18109
  }
@@ -17582,7 +18125,7 @@ function argsFromParams(params) {
17582
18125
  return args;
17583
18126
  }
17584
18127
 
17585
- // ../../flow-extension-runner/src/v2/model/params-model.ts
18128
+ // ../../flow-extension-runner/src/model/params-model.ts
17586
18129
  function toBodyParams(params) {
17587
18130
  const scope2 = DictionaryScope.ROOT.enter(params.keys());
17588
18131
  return params.fields().map(([name, schema]) => fieldToParam(name, schema, { scope: scope2 }));
@@ -17601,7 +18144,7 @@ function toConfigItems(config) {
17601
18144
  return config.fields().map(([name, schema]) => fieldToConfigItem(name, schema));
17602
18145
  }
17603
18146
 
17604
- // ../../flow-extension-runner/src/v2/result.ts
18147
+ // ../../flow-extension-runner/src/result.ts
17605
18148
  function inferReturnType(value) {
17606
18149
  if (Array.isArray(value)) {
17607
18150
  return "LIST";
@@ -17669,7 +18212,7 @@ var ResultSpec = class _ResultSpec {
17669
18212
  }
17670
18213
  };
17671
18214
 
17672
- // ../../flow-extension-runner/src/v2/actions/action-method.ts
18215
+ // ../../flow-extension-runner/src/actions/action-method.ts
17673
18216
  var ActionMethod = class extends ExtensionMethod {
17674
18217
  constructor(extension, props) {
17675
18218
  super(extension);
@@ -17795,7 +18338,7 @@ var ActionMethod = class extends ExtensionMethod {
17795
18338
  }
17796
18339
  };
17797
18340
 
17798
- // ../../flow-extension-runner/src/common/context-files.ts
18341
+ // ../../flow-extension-runner/src/context/files.ts
17799
18342
  var import_backendless_request = __toESM(require_lib());
17800
18343
  var FileScope = {
17801
18344
  WORKSPACE: "WORKSPACE",
@@ -17803,7 +18346,7 @@ var FileScope = {
17803
18346
  EXECUTION: "EXECUTION"
17804
18347
  };
17805
18348
 
17806
- // ../../flow-extension-runner/src/v2/context/logger.ts
18349
+ // ../../flow-extension-runner/src/context/logger.ts
17807
18350
  var defaultLogger = {
17808
18351
  debug: () => {
17809
18352
  },
@@ -17813,7 +18356,7 @@ var defaultLogger = {
17813
18356
  error: (...args) => console.error(...args)
17814
18357
  };
17815
18358
 
17816
- // ../../flow-extension-runner/src/v2/context/proxies.ts
18359
+ // ../../flow-extension-runner/src/context/proxies.ts
17817
18360
  function createThrowingProxy(feature, hint3) {
17818
18361
  const fail3 = () => {
17819
18362
  throw new FeatureNotEnabledError(feature, hint3);
@@ -17833,7 +18376,7 @@ function createThrowingProxy(feature, hint3) {
17833
18376
  );
17834
18377
  }
17835
18378
 
17836
- // ../../flow-extension-runner/src/v2/context/execution-context.ts
18379
+ // ../../flow-extension-runner/src/context/execution-context.ts
17837
18380
  var ExecutionContext = class _ExecutionContext {
17838
18381
  #extension;
17839
18382
  #options;
@@ -17849,8 +18392,23 @@ var ExecutionContext = class _ExecutionContext {
17849
18392
  get logger() {
17850
18393
  return this.#options.logger ?? defaultLogger;
17851
18394
  }
18395
+ get invocation() {
18396
+ return this.#options.invocation ?? {};
18397
+ }
17852
18398
  get config() {
17853
- this.#config ??= this.#extension.config.resolve(this.#options.configs);
18399
+ if (!this.#config) {
18400
+ const { result, notices } = collectNotices(() => this.#extension.config.resolve(this.#options.configs));
18401
+ for (const { message, field, value, converted } of notices) {
18402
+ this.logger.warn(`[flow-extension:${this.#extension.id}] config item "${field ?? "?"}": ${message}`, {
18403
+ serviceId: this.#extension.id,
18404
+ configItem: field,
18405
+ value,
18406
+ converted,
18407
+ ...this.invocation
18408
+ });
18409
+ }
18410
+ this.#config = result;
18411
+ }
17854
18412
  return this.#config;
17855
18413
  }
17856
18414
  // The header access token plus its deserialized composite payload — or a throwing proxy when the
@@ -17920,14 +18478,14 @@ var ExecutionContext = class _ExecutionContext {
17920
18478
  }
17921
18479
  };
17922
18480
 
17923
- // ../../flow-extension-runner/src/v2/dictionaries/payload-schema.ts
18481
+ // ../../flow-extension-runner/src/dictionaries/payload-schema.ts
17924
18482
  var DictionaryPayloadSchema = z2.looseObject({
17925
18483
  search: z2.string().optional(),
17926
18484
  cursor: z2.union([z2.string(), z2.number()]).nullish(),
17927
18485
  criteria: z2.record(z2.string(), z2.unknown()).optional()
17928
18486
  });
17929
18487
 
17930
- // ../../flow-extension-runner/src/v2/dictionaries/dictionary-method.ts
18488
+ // ../../flow-extension-runner/src/dictionaries/dictionary-method.ts
17931
18489
  var isBlank2 = (value) => value === void 0 || value === null || value === "";
17932
18490
  var DictionaryMethod = class extends ExtensionMethod {
17933
18491
  constructor(extension, props) {
@@ -18072,7 +18630,7 @@ var DictionaryMethod = class extends ExtensionMethod {
18072
18630
  };
18073
18631
  }
18074
18632
  // Describe the full payload shape so the method advertises a complete, labelled input scheme (nested
18075
- // props inline their own labels — mirroring the v1 jsdoc-parser layout).
18633
+ // props inline their own labels — mirroring the layout the v1 JSDoc parser established).
18076
18634
  #payloadParam() {
18077
18635
  const properties = [
18078
18636
  { name: "search", required: false, description: "Optional search string to filter results.", type: "STRING", label: "Search" },
@@ -18098,12 +18656,12 @@ var DictionaryMethod = class extends ExtensionMethod {
18098
18656
  }
18099
18657
  };
18100
18658
 
18101
- // ../../flow-extension-runner/src/v2/loaders/payload-schema.ts
18659
+ // ../../flow-extension-runner/src/loaders/payload-schema.ts
18102
18660
  var LoaderPayloadSchema = z2.looseObject({
18103
18661
  criteria: z2.record(z2.string(), z2.unknown()).optional()
18104
18662
  });
18105
18663
 
18106
- // ../../flow-extension-runner/src/v2/loaders/loader-method.ts
18664
+ // ../../flow-extension-runner/src/loaders/loader-method.ts
18107
18665
  var LoaderMethod = class extends ExtensionMethod {
18108
18666
  constructor(extension, owner) {
18109
18667
  super(extension);
@@ -18257,17 +18815,17 @@ var DynamicPropsLoaderMethod = class extends ParamsLoaderMethod {
18257
18815
  }
18258
18816
  };
18259
18817
 
18260
- // ../../flow-extension-runner/src/v2/oauth/oauth2.ts
18818
+ // ../../flow-extension-runner/src/oauth/oauth2.ts
18261
18819
  var import_crypto = __toESM(require("crypto"));
18262
18820
 
18263
- // ../../flow-extension-runner/src/v2/oauth/method-names.ts
18821
+ // ../../flow-extension-runner/src/oauth/method-names.ts
18264
18822
  var OAUTH_SYSTEM_METHODS = {
18265
18823
  CONNECTION_URL: "getOAuth2ConnectionURL",
18266
18824
  EXECUTE_CALLBACK: "executeCallback",
18267
18825
  REFRESH_TOKEN: "refreshToken"
18268
18826
  };
18269
18827
 
18270
- // ../../flow-extension-runner/src/v2/oauth/system-params.ts
18828
+ // ../../flow-extension-runner/src/oauth/system-params.ts
18271
18829
  var OAuthCallbackObjectSchema = z2.looseObject({
18272
18830
  code: z2.string().optional(),
18273
18831
  redirectURI: z2.string().optional(),
@@ -18276,7 +18834,7 @@ var OAuthCallbackObjectSchema = z2.looseObject({
18276
18834
  });
18277
18835
  var RefreshTokenSchema = z2.string().min(1);
18278
18836
 
18279
- // ../../flow-extension-runner/src/v2/oauth/oauth2.ts
18837
+ // ../../flow-extension-runner/src/oauth/oauth2.ts
18280
18838
  var OAuth2 = class {
18281
18839
  constructor(extension, props) {
18282
18840
  this.extension = extension;
@@ -18421,10 +18979,10 @@ function userDataOf(token) {
18421
18979
  return token && typeof token === "object" ? token.userData : void 0;
18422
18980
  }
18423
18981
 
18424
- // ../../flow-extension-runner/src/v2/polling-triggers/method-names.ts
18982
+ // ../../flow-extension-runner/src/polling-triggers/method-names.ts
18425
18983
  var POLLING_SYSTEM_METHOD = "handleTriggerPollingForEvent";
18426
18984
 
18427
- // ../../flow-extension-runner/src/v2/polling-triggers/system-params.ts
18985
+ // ../../flow-extension-runner/src/polling-triggers/system-params.ts
18428
18986
  var PollingInvocationSchema = z2.looseObject({
18429
18987
  eventName: z2.string().min(1),
18430
18988
  // The trigger instance's configured params — validated against the trigger's own schema separately.
@@ -18434,7 +18992,7 @@ var PollingInvocationSchema = z2.looseObject({
18434
18992
  connectionId: z2.string().nullish()
18435
18993
  });
18436
18994
 
18437
- // ../../flow-extension-runner/src/v2/polling-triggers/polling-triggers.ts
18995
+ // ../../flow-extension-runner/src/polling-triggers/polling-triggers.ts
18438
18996
  var PollingTriggers = class {
18439
18997
  constructor(extension) {
18440
18998
  this.extension = extension;
@@ -18473,15 +19031,15 @@ var PollingTriggers = class {
18473
19031
  }
18474
19032
  };
18475
19033
 
18476
- // ../../flow-extension-runner/src/v2/path.ts
18477
- function getPath(source, path23) {
18478
- return path23.split(".").reduce(
19034
+ // ../../flow-extension-runner/src/path.ts
19035
+ function getPath(source, path22) {
19036
+ return path22.split(".").reduce(
18479
19037
  (acc, key) => acc == null ? acc : acc[key],
18480
19038
  source
18481
19039
  );
18482
19040
  }
18483
19041
 
18484
- // ../../flow-extension-runner/src/v2/polling-triggers/mechanisms.ts
19042
+ // ../../flow-extension-runner/src/polling-triggers/mechanisms.ts
18485
19043
  var PollingMechanism = class {
18486
19044
  /**
18487
19045
  * Pick the strategy an author declared, rejecting the combinations that cannot work. Runs at REGISTRATION
@@ -18615,7 +19173,7 @@ var WatermarkMechanism = class extends FetchingMechanism {
18615
19173
  }
18616
19174
  };
18617
19175
 
18618
- // ../../flow-extension-runner/src/v2/polling-triggers/trigger-method.ts
19176
+ // ../../flow-extension-runner/src/polling-triggers/trigger-method.ts
18619
19177
  var PollingTriggerMethod = class extends ExtensionMethod {
18620
19178
  constructor(extension, props) {
18621
19179
  super(extension);
@@ -18685,7 +19243,7 @@ var PollingTriggerMethod = class extends ExtensionMethod {
18685
19243
  }
18686
19244
  };
18687
19245
 
18688
- // ../../flow-extension-runner/src/v2/realtime-triggers/method-names.ts
19246
+ // ../../flow-extension-runner/src/realtime-triggers/method-names.ts
18689
19247
  var REALTIME_SYSTEM_METHODS = {
18690
19248
  UPSERT: "handleTriggerUpsertWebhook",
18691
19249
  RESOLVE: "handleTriggerResolveEvents",
@@ -18694,7 +19252,7 @@ var REALTIME_SYSTEM_METHODS = {
18694
19252
  REFRESH: "handleTriggerRefreshWebhook"
18695
19253
  };
18696
19254
 
18697
- // ../../flow-extension-runner/src/v2/realtime-triggers/system-params.ts
19255
+ // ../../flow-extension-runner/src/realtime-triggers/system-params.ts
18698
19256
  var anyRecord = () => z2.record(z2.string(), z2.unknown());
18699
19257
  var SubscriptionEventSchema = z2.looseObject({
18700
19258
  name: z2.string().min(1),
@@ -18730,7 +19288,7 @@ var RealtimeSelectInvocationSchema = z2.looseObject({
18730
19288
  })).default([])
18731
19289
  });
18732
19290
 
18733
- // ../../flow-extension-runner/src/v2/realtime-triggers/verify.ts
19291
+ // ../../flow-extension-runner/src/realtime-triggers/verify.ts
18734
19292
  function verifyDeclarative(verify, rawBody, headers, config, webhookData) {
18735
19293
  const secret = verify.secret(config, { webhookData });
18736
19294
  if (!secret) {
@@ -18753,7 +19311,7 @@ function verifyDeclarative(verify, rawBody, headers, config, webhookData) {
18753
19311
  return true;
18754
19312
  }
18755
19313
 
18756
- // ../../flow-extension-runner/src/v2/realtime-triggers/realtime-setup.ts
19314
+ // ../../flow-extension-runner/src/realtime-triggers/realtime-setup.ts
18757
19315
  function readExtract(extract, body) {
18758
19316
  if (typeof extract === "function") {
18759
19317
  return extract({ requestBody: body });
@@ -19049,7 +19607,7 @@ var RealtimeSetup = class {
19049
19607
  }
19050
19608
  };
19051
19609
 
19052
- // ../../flow-extension-runner/src/v2/realtime-triggers/trigger-method.ts
19610
+ // ../../flow-extension-runner/src/realtime-triggers/trigger-method.ts
19053
19611
  function isFilled(value) {
19054
19612
  return value != null && value !== "";
19055
19613
  }
@@ -19145,12 +19703,12 @@ var RealtimeTriggerMethod = class extends ExtensionMethod {
19145
19703
  if (typeof match === "function") {
19146
19704
  return !!await match({ params, providerEventData, webhookData });
19147
19705
  }
19148
- for (const [paramKey, path23] of Object.entries(match)) {
19706
+ for (const [paramKey, path22] of Object.entries(match)) {
19149
19707
  const paramValue = params[paramKey];
19150
19708
  if (!isFilled(paramValue)) {
19151
19709
  continue;
19152
19710
  }
19153
- if (`${paramValue}` !== `${getPath(providerEventData, path23)}`) {
19711
+ if (`${paramValue}` !== `${getPath(providerEventData, path22)}`) {
19154
19712
  return false;
19155
19713
  }
19156
19714
  }
@@ -19186,7 +19744,7 @@ var RealtimeTriggerMethod = class extends ExtensionMethod {
19186
19744
  }
19187
19745
  };
19188
19746
 
19189
- // ../../flow-extension-runner/src/v2/system-method.ts
19747
+ // ../../flow-extension-runner/src/system-method.ts
19190
19748
  var SystemMethod = class extends ExtensionMethod {
19191
19749
  constructor(extension, spec) {
19192
19750
  super(extension);
@@ -19243,7 +19801,7 @@ var SystemMethod = class extends ExtensionMethod {
19243
19801
  }
19244
19802
  };
19245
19803
 
19246
- // ../../flow-extension-runner/src/v2/extension.ts
19804
+ // ../../flow-extension-runner/src/extension.ts
19247
19805
  var Extension = class {
19248
19806
  #props;
19249
19807
  #config;
@@ -19364,7 +19922,23 @@ var Extension = class {
19364
19922
  // generated loader, SYSTEM seam — arrives here through the same three steps.
19365
19923
  async run(methodName, methodData, ctx) {
19366
19924
  const method = this.getMethod(methodName);
19367
- return method.execute(method.validate(methodData ?? {}), ctx);
19925
+ const { result: input, notices } = collectNotices(() => method.validate(methodData ?? {}));
19926
+ this.#reportNotices(notices, methodName, ctx);
19927
+ return method.execute(input, ctx);
19928
+ }
19929
+ // One warning per value the pipeline accepted only under a temporary rule — today a timestamp converted for
19930
+ // a date-string field (FR-3920 lenient period). Named well enough to find the flow still holding one.
19931
+ #reportNotices(notices, methodName, ctx) {
19932
+ for (const { message, field, value, converted } of notices) {
19933
+ ctx.logger.warn(`[flow-extension:${this.id}] ${methodName}: param "${field ?? "?"}": ${message}`, {
19934
+ serviceId: this.id,
19935
+ method: methodName,
19936
+ param: field,
19937
+ value,
19938
+ converted,
19939
+ ...ctx.invocation
19940
+ });
19941
+ }
19368
19942
  }
19369
19943
  // ── output model ────────────────────────────────────────────────────────────
19370
19944
  toConfigItems() {
@@ -19383,8 +19957,8 @@ var Extension = class {
19383
19957
  };
19384
19958
  }
19385
19959
  /**
19386
- * The published model — the v2 analogue of jsdoc-parser's `parseJsDocToServiceJson`, and the same
19387
- * `{ serviceInfo, methodsMap }` shape the console consumes for a v1 service.
19960
+ * The published model — the `{ serviceInfo, methodsMap }` shape the console consumes, the same one the
19961
+ * removed v1 JSDoc parser produced.
19388
19962
  *
19389
19963
  * Every method describes itself, so this is one pass with no per-kind branches: what a service publishes
19390
19964
  * is exactly what it registered.
@@ -19397,8 +19971,6 @@ var Extension = class {
19397
19971
  }
19398
19972
  }
19399
19973
  return {
19400
- runnerVersion: "v2",
19401
- //TODO: temp
19402
19974
  serviceInfo: this.toServiceInfo(),
19403
19975
  methodsMap,
19404
19976
  configSchema: encodeParams(this.config.scheme)
@@ -19438,7 +20010,7 @@ var Extension = class {
19438
20010
  }
19439
20011
  };
19440
20012
 
19441
- // ../../flow-extension-runner/src/v2/registry.ts
20013
+ // ../../flow-extension-runner/src/registry.ts
19442
20014
  var ExtensionRegistry = class {
19443
20015
  #extensions = /* @__PURE__ */ new Map();
19444
20016
  register(extension) {
@@ -19458,15 +20030,19 @@ var ExtensionRegistry = class {
19458
20030
  * which imports it.
19459
20031
  */
19460
20032
  load(id, entryPointPath) {
19461
- if (!this.get(id)) {
19462
- require(entryPointPath);
19463
- }
19464
- const extension = this.get(id);
20033
+ const extension = this.tryLoad(id, entryPointPath);
19465
20034
  if (!extension) {
19466
20035
  throw new ExtensionNotRegisteredError(id, entryPointPath);
19467
20036
  }
19468
20037
  return extension;
19469
20038
  }
20039
+ /** As `load`, but `undefined` instead of throwing when the module registers no extension under `id`. */
20040
+ tryLoad(id, entryPointPath) {
20041
+ if (!this.get(id)) {
20042
+ require(entryPointPath);
20043
+ }
20044
+ return this.get(id);
20045
+ }
19470
20046
  // Test-only: clear the registry between isolated cases.
19471
20047
  reset() {
19472
20048
  this.#extensions.clear();
@@ -19477,7 +20053,7 @@ function getExtension(id) {
19477
20053
  return registry.get(id);
19478
20054
  }
19479
20055
 
19480
- // ../../flow-extension-runner/src/v2/create-extension.ts
20056
+ // ../../flow-extension-runner/src/create-extension.ts
19481
20057
  function createExtension(props) {
19482
20058
  const extension = new Extension(props);
19483
20059
  const api = {
@@ -19505,7 +20081,7 @@ function createExtension(props) {
19505
20081
  return api;
19506
20082
  }
19507
20083
 
19508
- // ../../flow-extension-runner/src/v2/crypto.ts
20084
+ // ../../flow-extension-runner/src/crypto.ts
19509
20085
  var import_crypto2 = __toESM(require("crypto"));
19510
20086
  var crypto2 = {
19511
20087
  hmac(algo, key, data, encoding = "hex") {
@@ -19541,689 +20117,99 @@ var flowrunnerRuntime = {
19541
20117
  z: z2,
19542
20118
  crypto: crypto2,
19543
20119
  createExtension,
19544
- getExtension,
19545
- ServerCode: null
20120
+ getExtension
19546
20121
  };
19547
20122
  global.Flowrunner = flowrunnerRuntime;
19548
20123
 
19549
- // ../../flow-extension-runner/src/common/config.ts
19550
- var ConfigValueAdapters = {
19551
- [ServiceConfigItemTypes.BOOL]: {
19552
- deserialize: (value) => typeof value === "string" ? value === "true" : !!value,
19553
- isEmpty: (value) => typeof value !== "boolean"
19554
- },
19555
- default: {
19556
- deserialize: (value) => value,
19557
- isEmpty: (value) => !value
19558
- }
19559
- };
19560
-
19561
- // ../../flow-extension-runner/src/v1/config.ts
19562
- function normalizeConfigItems(sourceConfigItems) {
19563
- return sourceConfigItems?.map((item) => ({
19564
- name: item.name,
19565
- type: item.type || ServiceConfigItemTypes.STRING,
19566
- shared: !!item.shared,
19567
- required: !!item.required,
19568
- description: item.description || item.hint || "",
19569
- label: item.label || item.displayName || item.name,
19570
- defaultValue: item.defaultValue,
19571
- options: item.options || []
19572
- })) || [];
19573
- }
19574
-
19575
- // ../../flow-extension-runner/src/v1/namespace.ts
19576
- var services = /* @__PURE__ */ new Map();
19577
- function createFlowrunnerSandboxV1(serviceId, cb) {
19578
- global.Flowrunner.ServerCode = {
19579
- addService(ServiceClass, sourceConfigItems) {
19580
- services.set(serviceId, {
19581
- ServiceClass,
19582
- configItems: normalizeConfigItems(sourceConfigItems)
19583
- });
19584
- },
19585
- ConfigItems: {
19586
- TYPES: ServiceConfigItemTypes
19587
- }
19588
- };
19589
- try {
19590
- cb();
19591
- } finally {
19592
- global.Flowrunner.ServerCode = null;
19593
- }
19594
- return services.get(serviceId);
19595
- }
19596
-
19597
- // ../../flow-extension-runner/src/v1/service.ts
19598
- function requireService(serviceId, serviceEntryPointPath) {
19599
- const registered = createFlowrunnerSandboxV1(serviceId, () => {
19600
- require(serviceEntryPointPath);
19601
- });
19602
- if (!registered?.ServiceClass) {
19603
- throw new Error(`There is no registered ServiceClass serviceEntryPointPath="${serviceEntryPointPath}"`);
19604
- }
19605
- return registered;
19606
- }
20124
+ // ../../flow-extension-runner/src/index.ts
19607
20125
  function getServiceConfigs(serviceId, serviceEntryPointPath) {
19608
- const { configItems } = requireService(serviceId, serviceEntryPointPath);
19609
- return configItems;
19610
- }
19611
-
19612
- // ../../flow-extension-runner/src/v2/index.ts
19613
- function getServiceConfigs2(serviceId, serviceEntryPointPath) {
19614
20126
  return registry.load(serviceId, serviceEntryPointPath).toConfigItems();
19615
20127
  }
19616
20128
  function buildServiceDefinition(serviceId, serviceEntryPointPath) {
19617
- return registry.load(serviceId, serviceEntryPointPath).toDefinition();
19618
- }
19619
-
19620
- // ../../flow-extension-runner/src/index.ts
19621
- function detectVersion(serviceId, serviceEntryPointPath) {
19622
- createFlowrunnerSandboxV1(serviceId, () => {
19623
- require(serviceEntryPointPath);
19624
- });
19625
- return getExtension(serviceId) ? "v2" : "v1";
19626
- }
19627
- function getServiceConfigs3(serviceId, serviceEntryPointPath) {
19628
- return detectVersion(serviceId, serviceEntryPointPath) === "v2" ? getServiceConfigs2(serviceId, serviceEntryPointPath) : getServiceConfigs(serviceId, serviceEntryPointPath);
19629
- }
19630
- function buildServiceDefinition2(serviceId, serviceEntryPointPath) {
19631
- return detectVersion(serviceId, serviceEntryPointPath) === "v2" ? buildServiceDefinition(serviceId, serviceEntryPointPath) : null;
19632
- }
19633
-
19634
- // ../../jsdoc-parser/src/custom-type-defs/files.ts
19635
- var SCOPE_FIELD = {
19636
- name: "scope",
19637
- type: "String",
19638
- required: false,
19639
- label: "Scope",
19640
- description: "Storage scope: WORKSPACE (shared across flows), FLOW (this flow only), EXECUTION (this run only)",
19641
- uiComponent: { type: "DROPDOWN", options: { values: ["WORKSPACE", "FLOW", "EXECUTION"] } },
19642
- defaultValue: "FLOW"
19643
- };
19644
- var filesTypeDefs = {
19645
- FilesUploadOptions: [
19646
- SCOPE_FIELD,
19647
- {
19648
- name: "filename",
19649
- type: "String",
19650
- required: false,
19651
- label: "Filename",
19652
- description: "Custom filename (defaults to the original name if omitted)",
19653
- uiComponent: { type: "SINGLE_LINE_TEXT" }
19654
- },
19655
- {
19656
- name: "ttl",
19657
- type: "Number",
19658
- required: false,
19659
- label: "URL TTL (seconds)",
19660
- description: "How long the download URL remains valid",
19661
- uiComponent: { type: "NUMERIC" }
19662
- },
19663
- {
19664
- name: "objectTtl",
19665
- type: "Number",
19666
- required: false,
19667
- label: "File TTL (seconds)",
19668
- description: "How long the file is kept in storage (omit for permanent storage)",
19669
- uiComponent: { type: "NUMERIC" }
19670
- },
19671
- {
19672
- name: "overwrite",
19673
- type: "Boolean",
19674
- required: false,
19675
- label: "Overwrite existing",
19676
- description: "Replace the file if one with the same name already exists",
19677
- uiComponent: { type: "TOGGLE" }
19678
- },
19679
- {
19680
- name: "generateUrl",
19681
- type: "Boolean",
19682
- required: false,
19683
- label: "Generate download URL",
19684
- description: "Include a pre-signed download URL in the response",
19685
- uiComponent: { type: "TOGGLE" },
19686
- defaultValue: true
19687
- }
19688
- ],
19689
- FilesListOptions: [
19690
- SCOPE_FIELD,
19691
- {
19692
- name: "limit",
19693
- type: "Number",
19694
- required: false,
19695
- label: "Limit",
19696
- description: "Maximum number of files to return",
19697
- uiComponent: { type: "NUMERIC" }
19698
- },
19699
- {
19700
- name: "ttl",
19701
- type: "Number",
19702
- required: false,
19703
- label: "URL TTL (seconds)",
19704
- description: "How long the download URLs remain valid",
19705
- uiComponent: { type: "NUMERIC" }
19706
- },
19707
- {
19708
- name: "generateUrl",
19709
- type: "Boolean",
19710
- required: false,
19711
- label: "Generate download URLs",
19712
- description: "Include pre-signed download URLs in the response",
19713
- uiComponent: { type: "TOGGLE" },
19714
- defaultValue: true
19715
- },
19716
- {
19717
- name: "cursor",
19718
- type: "String",
19719
- required: false,
19720
- label: "Cursor",
19721
- description: "Pagination cursor from a previous response",
19722
- uiComponent: { type: "SINGLE_LINE_TEXT" }
19723
- }
19724
- ],
19725
- FilesGetOptions: [
19726
- SCOPE_FIELD,
19727
- {
19728
- name: "ttl",
19729
- type: "Number",
19730
- required: false,
19731
- label: "URL TTL (seconds)",
19732
- description: "How long the download URL remains valid",
19733
- uiComponent: { type: "NUMERIC" }
19734
- },
19735
- {
19736
- name: "generateUrl",
19737
- type: "Boolean",
19738
- required: false,
19739
- label: "Generate download URL",
19740
- description: "Include a pre-signed download URL in the response",
19741
- uiComponent: { type: "TOGGLE" },
19742
- defaultValue: true
19743
- }
19744
- ],
19745
- FilesDeleteOptions: [
19746
- SCOPE_FIELD
19747
- ]
19748
- };
19749
-
19750
- // ../../jsdoc-parser/src/lib.ts
19751
- var import_fs8 = __toESM(require("fs"));
19752
- var import_path12 = __toESM(require("path"));
19753
- function resolveJSDocPath() {
19754
- const jsDocHolders = require.resolve.paths("jsdoc/lib") || [];
19755
- const jsDocPaths = jsDocHolders.map((p) => import_path12.default.join(p, "jsdoc/lib"));
19756
- for (let i = 0; i < jsDocPaths.length; i++) {
19757
- if (import_fs8.default.existsSync(jsDocPaths[i])) {
19758
- return jsDocPaths[i];
19759
- }
19760
- }
19761
- throw new Error("Can not resolve path to JSDoc module.");
19762
- }
19763
- var jsdocPath = resolveJSDocPath();
19764
- var jsdocModulePath = (mod) => import_path12.default.join(jsdocPath, ...mod.split("/"));
19765
- var _jsdocRequire;
19766
- var jsdocRequire = (modulePath) => {
19767
- if (!_jsdocRequire) {
19768
- _jsdocRequire = require("requizzle")({
19769
- infect: true,
19770
- requirePaths: { before: [jsdocPath] }
19771
- });
19772
- const Config = _jsdocRequire(jsdocModulePath("jsdoc/config"));
19773
- const env = _jsdocRequire(jsdocModulePath("jsdoc/env"));
19774
- env.conf = new Config().get();
19775
- }
19776
- return _jsdocRequire(jsdocModulePath(modulePath));
19777
- };
19778
- function parseJSDoc(filePath) {
19779
- const parser = jsdocRequire("jsdoc/src/parser").createParser();
19780
- const handlers = jsdocRequire("jsdoc/src/handlers");
19781
- handlers.attachTo(parser);
19782
- return parser.parse([filePath]);
19783
- }
19784
-
19785
- // ../../jsdoc-parser/src/index.ts
19786
- var customTypeDef = {
19787
- FilesUploadOptions: filesTypeDefs.FilesUploadOptions,
19788
- FilesListOptions: filesTypeDefs.FilesListOptions,
19789
- FilesGetOptions: filesTypeDefs.FilesGetOptions,
19790
- FilesDeleteOptions: filesTypeDefs.FilesDeleteOptions
19791
- };
19792
- function findServiceClassName(doclets) {
19793
- const withIntegration = doclets.find((d) => {
19794
- if (d.kind === "class" && d.tags) {
19795
- return d.tags.find((t) => t.originalTitle === "integrationName");
19796
- }
19797
- });
19798
- if (withIntegration) {
19799
- return withIntegration.name;
19800
- }
19801
- return null;
19802
- }
19803
- function parseJSDocs(filePath) {
19804
- const doclets = parseJSDoc(filePath);
19805
- const className = findServiceClassName(doclets);
19806
- let serviceInfo = null;
19807
- const methods = [];
19808
- const typedefsMap = {};
19809
- doclets.forEach((d) => {
19810
- if (d.kind === "class" && d.name === className) {
19811
- serviceInfo = composeServiceInfo(d);
19812
- } else if (d.kind === "function" && d.memberof === className && d.scope === "instance") {
19813
- methods.push(composeMethod(d));
19814
- } else if (d.kind === "typedef") {
19815
- const typedefParams = collectTypedef(d);
19816
- if (typedefParams) {
19817
- typedefsMap[d.name] = typedefParams;
19818
- }
19819
- }
19820
- });
19821
- return {
19822
- serviceInfo,
19823
- methods,
19824
- // Extension-defined typedefs override built-ins so authors can customise if needed
19825
- typedefsMap: { ...customTypeDef, ...typedefsMap }
19826
- };
19827
- }
19828
- var ServiceInfoTagsProcessors = {
19829
- integrationName: (serviceInfo, tagValue) => {
19830
- serviceInfo.integrationName = tagValue || void 0;
19831
- },
19832
- integrationIcon: (serviceInfo, tagValue) => {
19833
- serviceInfo.integrationIcon = tagValue || null;
19834
- },
19835
- requireOAuth: (serviceInfo) => {
19836
- serviceInfo.requireOAuth = true;
19837
- },
19838
- integrationTriggersScope: (serviceInfo, tagValue) => {
19839
- serviceInfo.integrationTriggersScope = tagValue || null;
19840
- }
19841
- };
19842
- function composeServiceInfo(d) {
19843
- const serviceInfo = {
19844
- serviceClassName: d.name,
19845
- integrationName: d.name,
19846
- integrationIcon: null,
19847
- requireOAuth: void 0,
19848
- integrationTriggersScope: null
19849
- };
19850
- iterateTags(d.tags, (tagName, tagValue) => {
19851
- if (ServiceInfoTagsProcessors[tagName]) {
19852
- ServiceInfoTagsProcessors[tagName](serviceInfo, tagValue);
19853
- }
19854
- });
19855
- return serviceInfo;
19856
- }
19857
- function iterateTags(tags, cb) {
19858
- if (tags) {
19859
- tags.forEach((tag) => {
19860
- const title = tag.originalTitle;
19861
- const value = tag.value || tag.text || "";
19862
- cb(title, value, tag);
19863
- });
19864
- }
19865
- }
19866
- var MethodTagsProcessors = {
19867
- paramDef: (methodInfo, tagValue) => {
19868
- if (tagValue) {
19869
- const parsedValue = parseJSON(tagValue);
19870
- if (parsedValue) {
19871
- methodInfo.paramDefs.push(parsedValue);
19872
- }
19873
- }
19874
- },
19875
- route: (methodInfo, tagValue) => {
19876
- if (tagValue) {
19877
- methodInfo.route = tagValue;
19878
- }
19879
- },
19880
- registerAs: (methodInfo, tagValue) => {
19881
- if (tagValue) {
19882
- methodInfo.registerAs = tagValue;
19883
- }
19884
- },
19885
- operationName: (methodInfo, tagValue) => {
19886
- if (tagValue) {
19887
- methodInfo.operationName = tagValue;
19888
- }
19889
- },
19890
- customIcon: (methodInfo, tagValue) => {
19891
- if (tagValue) {
19892
- methodInfo.customIcon = tagValue;
19893
- }
19894
- },
19895
- category: (methodInfo, tagValue) => {
19896
- if (tagValue) {
19897
- methodInfo.category = tagValue;
19898
- }
19899
- },
19900
- description: (methodInfo, tagValue) => {
19901
- if (tagValue) {
19902
- methodInfo.description = tagValue;
19903
- }
19904
- },
19905
- appearanceColor: (methodInfo, tagValue) => {
19906
- if (tagValue) {
19907
- const colors = extractColors(tagValue);
19908
- methodInfo.colorStart = colors.colorStart;
19909
- methodInfo.colorEnd = colors.colorEnd;
19910
- }
19911
- },
19912
- private: (methodInfo) => {
19913
- methodInfo.private = true;
19914
- },
19915
- sampleResult: (methodInfo, tagValue) => {
19916
- if (tagValue) {
19917
- methodInfo.sampleResult = parseJSON(tagValue);
19918
- }
19919
- },
19920
- sampleResultLoader: (methodInfo, tagValue) => {
19921
- if (tagValue) {
19922
- methodInfo.sampleResultLoader = parseJSON(tagValue);
19923
- }
19924
- }
19925
- };
19926
- function composeMethod(m) {
19927
- const methodInfo = {
19928
- name: m.name,
19929
- description: m.description || "",
19930
- returnType: mapReturnType(m.returns?.[0].type?.names?.[0]),
19931
- registerAs: "",
19932
- colorStart: "",
19933
- colorEnd: "",
19934
- private: m.access === "private",
19935
- operationName: m.name,
19936
- customIcon: "",
19937
- category: "",
19938
- sampleResult: null,
19939
- sampleResultLoader: null,
19940
- routeStr: "",
19941
- paramDefs: []
19942
- };
19943
- if (m.params) {
19944
- m.params.forEach((p) => {
19945
- methodInfo.paramDefs.push({
19946
- name: p.name,
19947
- type: p.type?.names?.[0] || "String",
19948
- required: !p.optional
19949
- });
19950
- });
19951
- }
19952
- iterateTags(m.tags, (tagName, tagValue) => {
19953
- if (MethodTagsProcessors[tagName]) {
19954
- MethodTagsProcessors[tagName](methodInfo, tagValue);
19955
- }
19956
- });
19957
- return methodInfo;
19958
- }
19959
- var PRIMITIVES = ["String", "Object", "Boolean", "Number"];
19960
- var ParamTypesMap = {
19961
- String: "STRING",
19962
- Object: "OBJECT",
19963
- Boolean: "BOOLEAN",
19964
- Number: "NUMBER"
19965
- };
19966
- function mapParamType(type) {
19967
- if (!type) {
19968
- return "STRING";
19969
- }
19970
- if (type.startsWith("Array")) {
19971
- return "LIST";
19972
- }
19973
- return ParamTypesMap[type] || "STRING";
19974
- }
19975
- function mapReturnType(type) {
19976
- if (type) {
19977
- if (type === "Array" || type.startsWith("Array.") || type.startsWith("Array<")) return "LIST";
19978
- if (type === "Object") return "OBJECT";
19979
- if (type === "String") return "STRING";
19980
- }
19981
- return "VOID";
19982
- }
19983
- function collectTypedef(d) {
19984
- const defs = [];
19985
- iterateTags(d.tags, (title, value) => {
19986
- if (title === "paramDef") {
19987
- const parsedValue = parseJSON(value);
19988
- if (parsedValue) {
19989
- defs.push(parsedValue);
19990
- }
19991
- }
19992
- });
19993
- if (d.properties) {
19994
- d.properties.forEach((property) => {
19995
- const type = property?.type?.names?.[0];
19996
- defs.push({
19997
- name: property.name,
19998
- required: !property.optional,
19999
- description: property.description,
20000
- type
20001
- });
20002
- });
20003
- }
20004
- if (defs.length > 0) {
20005
- return defs;
20006
- }
20007
- }
20008
- function buildParam(paramDef, typedefsMap, nested = false) {
20009
- const isCustomType = !nested && paramDef.type && !PRIMITIVES.includes(paramDef.type) && !paramDef.type.startsWith("Array");
20010
- let properties;
20011
- if (isCustomType && typedefsMap[paramDef.type]) {
20012
- let subDefs = typedefsMap[paramDef.type];
20013
- if (paramDef.include?.length) {
20014
- const includeSet = new Set(paramDef.include);
20015
- subDefs = subDefs.filter((sd) => includeSet.has(sd.name));
20016
- }
20017
- if (subDefs.length > 0) {
20018
- properties = subDefs.map((sp) => buildParam(sp, typedefsMap, true));
20019
- }
20020
- }
20021
- const param = {
20022
- name: paramDef.name,
20023
- required: paramDef.required || false,
20024
- description: paramDef.description || "",
20025
- type: isCustomType ? "OBJECT" : mapParamType(paramDef.type)
20026
- };
20027
- if (nested) {
20028
- if (paramDef.label !== void 0) {
20029
- param.label = paramDef.label;
20030
- }
20031
- if (paramDef.uiComponent !== void 0) {
20032
- param.uiComponent = paramDef.uiComponent;
20033
- }
20034
- if (paramDef.dependsOn !== void 0) {
20035
- param.dependsOn = paramDef.dependsOn;
20036
- }
20037
- if (paramDef.dictionary !== void 0) {
20038
- param.dictionary = paramDef.dictionary;
20039
- }
20040
- if (paramDef.defaultValue !== void 0) {
20041
- param.defaultValue = paramDef.defaultValue;
20042
- }
20043
- }
20044
- if (properties && properties.length > 0) {
20045
- param.properties = properties;
20046
- }
20047
- if (param.type === "LIST") {
20048
- param.items = { type: "OBJECT" };
20049
- }
20050
- return param;
20051
- }
20052
- function buildMetaInfoArgs(paramDefs, typedefsMap) {
20053
- const args = {};
20054
- for (const pd of paramDefs) {
20055
- const isCustomType = pd.type && !PRIMITIVES.includes(pd.type) && !pd.type.startsWith("Array");
20056
- if (isCustomType && typedefsMap[pd.type]) {
20057
- const entry2 = {};
20058
- if (pd.label) entry2.label = pd.label;
20059
- args[pd.name] = entry2;
20060
- continue;
20061
- }
20062
- const entry = {};
20063
- if (pd.label) entry.label = pd.label;
20064
- if (pd.dictionary) entry.dictionary = pd.dictionary;
20065
- if (pd.dependsOn && pd.dependsOn.length > 0) entry.dependsOn = pd.dependsOn;
20066
- if (pd.uiComponent) entry.uiComponent = pd.uiComponent;
20067
- args[pd.name] = entry;
20068
- }
20069
- return args;
20070
- }
20071
- function extractColors(colorStr) {
20072
- if (!colorStr) {
20073
- return { colorStart: "", colorEnd: "" };
20074
- }
20075
- const colors = colorStr.split(/[,\s]+/).map((c) => c.trim()).filter(Boolean);
20076
- return {
20077
- colorStart: colors[0] || "",
20078
- colorEnd: colors[1] || colors[0] || ""
20079
- };
20080
- }
20081
- function parseJSON(str) {
20082
- try {
20083
- return JSON.parse(str);
20084
- } catch {
20085
- return null;
20086
- }
20087
- }
20088
- function parseJsDocToServiceJson(entryPoint) {
20089
- const { serviceInfo, methods, typedefsMap } = parseJSDocs(entryPoint);
20090
- const methodsMap = {};
20091
- for (const method of methods) {
20092
- if (method.private) {
20093
- continue;
20094
- }
20095
- const {
20096
- name,
20097
- route,
20098
- registerAs,
20099
- colorStart,
20100
- colorEnd,
20101
- operationName,
20102
- customIcon,
20103
- category,
20104
- description,
20105
- sampleResult,
20106
- sampleResultLoader,
20107
- paramDefs,
20108
- returnType
20109
- } = method;
20110
- const isSystem = registerAs === "SYSTEM";
20111
- const httpMethod = route ? route.split(/\s+/)[0].toUpperCase() : name.startsWith("get") ? "GET" : "POST";
20112
- const isQueryPlacement = httpMethod === "GET";
20113
- const params = paramDefs.map((pd) => buildParam(pd, typedefsMap));
20114
- const queryParams = isQueryPlacement ? params : [];
20115
- const bodyParams = isQueryPlacement ? [] : params;
20116
- const metaInfoArgs = paramDefs.length > 0 ? buildMetaInfoArgs(paramDefs, typedefsMap) : {};
20117
- methodsMap[name] = {
20118
- colorStart,
20119
- colorEnd,
20120
- queryParams,
20121
- // todo remove me
20122
- bodyParams,
20123
- customIcon: isSystem ? void 0 : customIcon,
20124
- registerAs,
20125
- category,
20126
- metaInfo: {
20127
- args: metaInfoArgs,
20128
- sampleResult: isSystem ? void 0 : sampleResult,
20129
- sampleResultLoader: isSystem ? void 0 : sampleResultLoader
20130
- },
20131
- returnType,
20132
- description,
20133
- operationName,
20134
- name
20135
- };
20136
- }
20137
- return {
20138
- runnerVersion: "v1",
20139
- //TODO: temp
20140
- methodsMap,
20141
- serviceInfo
20142
- };
20129
+ return registry.tryLoad(serviceId, serviceEntryPointPath)?.toDefinition() ?? null;
20143
20130
  }
20144
20131
 
20145
20132
  // src/operations/deploy/discover-services.ts
20146
20133
  function discoverServices(projectRoot = process.cwd()) {
20147
- const servicesDir = import_path13.default.resolve(projectRoot, "services");
20148
- if (!import_fs9.default.existsSync(servicesDir)) {
20134
+ const servicesDir = import_path12.default.resolve(projectRoot, "services");
20135
+ if (!import_fs8.default.existsSync(servicesDir)) {
20149
20136
  return { services: [], skipped: [] };
20150
20137
  }
20151
- const serviceIds = import_fs9.default.readdirSync(servicesDir, { withFileTypes: true }).filter((file) => file.isDirectory()).map((file) => file.name);
20152
- const services2 = [];
20138
+ const serviceIds = import_fs8.default.readdirSync(servicesDir, { withFileTypes: true }).filter((file) => file.isDirectory()).map((file) => file.name);
20139
+ const services = [];
20153
20140
  const skipped = [];
20154
20141
  for (const serviceId of serviceIds) {
20155
- const serviceDir = import_path13.default.resolve(servicesDir, serviceId);
20156
- const serviceDISTEntryPoint = import_path13.default.resolve(serviceDir, "./dist/index.js");
20157
- const serviceSRCEntryPoint = import_path13.default.resolve(serviceDir, "./src/index.js");
20142
+ const serviceDir = import_path12.default.resolve(servicesDir, serviceId);
20143
+ const serviceDISTEntryPoint = import_path12.default.resolve(serviceDir, "./dist/index.js");
20144
+ const serviceSRCEntryPoint = import_path12.default.resolve(serviceDir, "./src/index.js");
20158
20145
  let serviceFilePath = null;
20159
20146
  try {
20160
- if (import_fs9.default.existsSync(serviceDISTEntryPoint)) {
20147
+ if (import_fs8.default.existsSync(serviceDISTEntryPoint)) {
20161
20148
  serviceFilePath = serviceDISTEntryPoint;
20162
- } else if (import_fs9.default.existsSync(serviceSRCEntryPoint)) {
20149
+ } else if (import_fs8.default.existsSync(serviceSRCEntryPoint)) {
20163
20150
  serviceFilePath = serviceSRCEntryPoint;
20164
20151
  }
20165
20152
  if (!serviceFilePath) {
20166
20153
  skipped.push({ serviceId, reason: "it has neither a dist/index.js nor a src/index.js" });
20167
20154
  continue;
20168
20155
  }
20169
- const v2Definition = buildServiceDefinition2(serviceId, serviceFilePath);
20170
- const { methodsMap, serviceInfo } = v2Definition ?? parseJsDocToServiceJson(serviceFilePath);
20171
- if (!serviceInfo || !v2Definition && !serviceInfo.serviceClassName) {
20172
- skipped.push({ serviceId, reason: "its entry point does not define a service" });
20156
+ const definition = buildServiceDefinition(serviceId, serviceFilePath);
20157
+ if (!definition?.serviceInfo) {
20158
+ skipped.push({ serviceId, reason: "its entry point does not define a service with createExtension" });
20173
20159
  continue;
20174
20160
  }
20161
+ const { methodsMap, serviceInfo } = definition;
20175
20162
  let configDescriptions = [];
20176
20163
  try {
20177
- configDescriptions = getServiceConfigs3(serviceId, serviceFilePath);
20164
+ configDescriptions = getServiceConfigs(serviceId, serviceFilePath);
20178
20165
  } catch (error) {
20179
20166
  skipped.push({
20180
20167
  serviceId,
20181
20168
  reason: `its config items could not be read (${error.message}) \u2014 deployed without them`
20182
20169
  });
20183
20170
  }
20184
- services2.push({
20171
+ services.push({
20185
20172
  // Relative to the service, because the deployed archive's root IS the service.
20186
- serviceFilePath: import_path13.default.relative(serviceDir, serviceFilePath),
20173
+ serviceFilePath: import_path12.default.relative(serviceDir, serviceFilePath),
20187
20174
  serviceId,
20188
20175
  serviceInfo,
20189
20176
  methodsMap,
20190
20177
  configDescriptions,
20191
- // v2 only. The console renders a v2 config dialog from the schema itself rather than from the
20178
+ // The console renders the config dialog from the schema itself rather than from the
20192
20179
  // `configDescriptions` projection, so both travel: the schema for the new path, the projection for
20193
20180
  // every consumer that predates it.
20194
- runnerVersion: v2Definition ? "v2" : "v1",
20195
- configSchema: v2Definition?.configSchema ?? null
20181
+ configSchema: definition.configSchema ?? null
20196
20182
  });
20197
20183
  } catch (error) {
20198
20184
  skipped.push({ serviceId, reason: error.message });
20199
20185
  }
20200
20186
  }
20201
- return { services: services2, skipped };
20187
+ return { services, skipped };
20202
20188
  }
20203
20189
 
20204
20190
  // src/operations/deploy/hash.ts
20205
20191
  var import_crypto4 = require("crypto");
20206
- var import_fs10 = __toESM(require("fs"));
20207
- var import_path14 = __toESM(require("path"));
20192
+ var import_fs9 = __toESM(require("fs"));
20193
+ var import_path13 = __toESM(require("path"));
20208
20194
  async function computeServiceHash(projectRoot, serviceId) {
20209
20195
  const hash = (0, import_crypto4.createHash)("sha256");
20210
- const serviceDir = import_path14.default.resolve(projectRoot, "services", serviceId);
20196
+ const serviceDir = import_path13.default.resolve(projectRoot, "services", serviceId);
20211
20197
  const files = [];
20212
20198
  collectFiles(serviceDir, "", files);
20213
20199
  files.sort();
20214
20200
  for (const file of files) {
20215
20201
  hash.update(file);
20216
- hash.update(import_fs10.default.readFileSync(import_path14.default.resolve(serviceDir, file)));
20202
+ hash.update(import_fs9.default.readFileSync(import_path13.default.resolve(serviceDir, file)));
20217
20203
  }
20218
20204
  return hash.digest("hex");
20219
20205
  }
20220
20206
  function collectFiles(serviceDir, relativeDir, files) {
20221
- const entries = import_fs10.default.readdirSync(import_path14.default.resolve(serviceDir, relativeDir), { withFileTypes: true });
20207
+ const entries = import_fs9.default.readdirSync(import_path13.default.resolve(serviceDir, relativeDir), { withFileTypes: true });
20222
20208
  for (const entry of entries) {
20223
20209
  if (HASH_EXCLUDED_FOLDERS.includes(entry.name)) {
20224
20210
  continue;
20225
20211
  }
20226
- const relativePath = relativeDir ? import_path14.default.join(relativeDir, entry.name) : entry.name;
20212
+ const relativePath = relativeDir ? import_path13.default.join(relativeDir, entry.name) : entry.name;
20227
20213
  if (!entry.isSymbolicLink()) {
20228
20214
  if (entry.isDirectory()) {
20229
20215
  collectFiles(serviceDir, relativePath, files);
@@ -20235,14 +20221,14 @@ function collectFiles(serviceDir, relativeDir, files) {
20235
20221
  }
20236
20222
 
20237
20223
  // src/operations/deploy/public-files.ts
20238
- var import_fs11 = __toESM(require("fs"));
20239
- var import_path15 = __toESM(require("path"));
20240
- function collectPublicFiles(services2, projectRoot = process.cwd()) {
20224
+ var import_fs10 = __toESM(require("fs"));
20225
+ var import_path14 = __toESM(require("path"));
20226
+ function collectPublicFiles(services, projectRoot = process.cwd()) {
20241
20227
  const files = [];
20242
20228
  const missing = [];
20243
- for (const service of services2) {
20244
- const servicePublicDir = import_path15.default.resolve(projectRoot, "services", service.serviceId, "public");
20245
- if (!import_fs11.default.existsSync(servicePublicDir)) {
20229
+ for (const service of services) {
20230
+ const servicePublicDir = import_path14.default.resolve(projectRoot, "services", service.serviceId, "public");
20231
+ if (!import_fs10.default.existsSync(servicePublicDir)) {
20246
20232
  continue;
20247
20233
  }
20248
20234
  const iconPath = service.serviceInfo.integrationIcon;
@@ -20250,18 +20236,18 @@ function collectPublicFiles(services2, projectRoot = process.cwd()) {
20250
20236
  continue;
20251
20237
  }
20252
20238
  const relativePath = iconPath.replace(/^\//, "");
20253
- const fullPath = import_path15.default.resolve(servicePublicDir, relativePath);
20254
- if (!fullPath.startsWith(servicePublicDir + import_path15.default.sep)) {
20239
+ const fullPath = import_path14.default.resolve(servicePublicDir, relativePath);
20240
+ if (!fullPath.startsWith(servicePublicDir + import_path14.default.sep)) {
20255
20241
  continue;
20256
20242
  }
20257
- if (!import_fs11.default.existsSync(fullPath)) {
20243
+ if (!import_fs10.default.existsSync(fullPath)) {
20258
20244
  missing.push({ serviceId: service.serviceId, relativePath });
20259
20245
  continue;
20260
20246
  }
20261
20247
  files.push({
20262
20248
  relativePath,
20263
20249
  serviceId: service.serviceId,
20264
- buffer: import_fs11.default.readFileSync(fullPath)
20250
+ buffer: import_fs10.default.readFileSync(fullPath)
20265
20251
  });
20266
20252
  }
20267
20253
  return { files, missing };
@@ -20287,7 +20273,7 @@ function selectServices(available, selection = {}) {
20287
20273
 
20288
20274
  // src/operations/deploy/zip.ts
20289
20275
  var import_archiver = __toESM(require("archiver"));
20290
- var import_path16 = __toESM(require("path"));
20276
+ var import_path15 = __toESM(require("path"));
20291
20277
  async function createServiceZip(definition, projectRoot, serviceId) {
20292
20278
  return new Promise((resolve, reject) => {
20293
20279
  const archive = (0, import_archiver.default)("zip", { zlib: { level: 9 } });
@@ -20295,7 +20281,7 @@ async function createServiceZip(definition, projectRoot, serviceId) {
20295
20281
  archive.on("data", (chunk) => chunks.push(chunk));
20296
20282
  archive.on("end", () => resolve(Buffer.concat(chunks)));
20297
20283
  archive.on("error", reject);
20298
- archive.directory(`${import_path16.default.resolve(projectRoot, "services", serviceId)}/`, "package");
20284
+ archive.directory(`${import_path15.default.resolve(projectRoot, "services", serviceId)}/`, "package");
20299
20285
  archive.append(JSON.stringify(definition, null, 2), { name: "definition.json" });
20300
20286
  archive.finalize();
20301
20287
  });
@@ -20328,7 +20314,7 @@ async function deploy(options = {}) {
20328
20314
  const { serverUrl, workspaceId, workspaceName, deployToken } = await resolveAuth(projectRoot, options.onAuthRequired);
20329
20315
  const credentials = { serverUrl, workspaceId, deployToken };
20330
20316
  const workspace = { workspaceId, workspaceName };
20331
- if (!import_fs12.default.existsSync(import_path17.default.resolve(projectRoot, "services"))) {
20317
+ if (!import_fs11.default.existsSync(import_path16.default.resolve(projectRoot, "services"))) {
20332
20318
  throw new NoServicesDirectoryError();
20333
20319
  }
20334
20320
  emit({ type: "connecting", serverUrl, workspace });
@@ -20462,7 +20448,7 @@ var ERROR_HTML = (error) => `<!DOCTYPE html>
20462
20448
  </body></html>`;
20463
20449
 
20464
20450
  // src/server/routes/callback.ts
20465
- function callbackRoute(path23 = "/callback") {
20451
+ function callbackRoute(path22 = "/callback") {
20466
20452
  let resolveCode = null;
20467
20453
  let rejectCode = null;
20468
20454
  const respond = (route2, html) => {
@@ -20471,7 +20457,7 @@ function callbackRoute(path23 = "/callback") {
20471
20457
  };
20472
20458
  const route = {
20473
20459
  method: "GET",
20474
- path: path23,
20460
+ path: path22,
20475
20461
  handle: (context) => {
20476
20462
  const code = context.url.searchParams.get("code");
20477
20463
  const error = context.url.searchParams.get("error");
@@ -20629,7 +20615,7 @@ async function waitForEnter(message) {
20629
20615
  }
20630
20616
 
20631
20617
  // src/cli/reporter.ts
20632
- var import_path18 = __toESM(require("path"));
20618
+ var import_path17 = __toESM(require("path"));
20633
20619
 
20634
20620
  // src/utils/server-name.ts
20635
20621
  var CLUSTER_LABELS = {
@@ -20650,7 +20636,7 @@ var SEGMENT_WORDING = {
20650
20636
  unchanged: "The FlowRunner instructions block was already up to date"
20651
20637
  };
20652
20638
  function readablePath(fullPath) {
20653
- const relative = import_path18.default.relative(process.cwd(), fullPath);
20639
+ const relative = import_path17.default.relative(process.cwd(), fullPath);
20654
20640
  return !relative || relative.startsWith("..") ? fullPath : relative;
20655
20641
  }
20656
20642
  var STATUS_WORDING = {
@@ -20800,7 +20786,7 @@ function reportInitClaude(event) {
20800
20786
  return;
20801
20787
  }
20802
20788
  case "segment":
20803
- section(` ${SEGMENT_WORDING[event.outcome]} in ${import_path18.default.basename(event.file)}.`);
20789
+ section(` ${SEGMENT_WORDING[event.outcome]} in ${import_path17.default.basename(event.file)}.`);
20804
20790
  return;
20805
20791
  case "warning":
20806
20792
  sayWarning(` ${event.message}`);
@@ -21270,32 +21256,32 @@ async function createServiceCommand(templateId, options = {}) {
21270
21256
  }
21271
21257
 
21272
21258
  // src/cli/commands/init.ts
21273
- var import_path22 = __toESM(require("path"));
21259
+ var import_path21 = __toESM(require("path"));
21274
21260
 
21275
21261
  // src/operations/init/index.ts
21276
21262
  var import_child_process = require("child_process");
21277
- var import_fs14 = __toESM(require("fs"));
21278
- var import_path20 = __toESM(require("path"));
21279
-
21280
- // src/operations/init/testing.ts
21281
21263
  var import_fs13 = __toESM(require("fs"));
21282
21264
  var import_path19 = __toESM(require("path"));
21265
+
21266
+ // src/operations/init/testing.ts
21267
+ var import_fs12 = __toESM(require("fs"));
21268
+ var import_path18 = __toESM(require("path"));
21283
21269
  function testingFilesDirectory() {
21284
- return import_path19.default.join(packageRoot(), PROJECT_FILES_DIRECTORY);
21270
+ return import_path18.default.join(packageRoot(), PROJECT_FILES_DIRECTORY);
21285
21271
  }
21286
21272
  function writeTestingFiles(projectRoot) {
21287
21273
  const source = testingFilesDirectory();
21288
21274
  const created = [];
21289
21275
  const skipped = [];
21290
21276
  for (const file of TESTING_FILES) {
21291
- const target = import_path19.default.join(projectRoot, file);
21292
- if (import_fs13.default.existsSync(target)) {
21277
+ const target = import_path18.default.join(projectRoot, file);
21278
+ if (import_fs12.default.existsSync(target)) {
21293
21279
  skipped.push(file);
21294
21280
  continue;
21295
21281
  }
21296
- const contents = import_fs13.default.readFileSync(import_path19.default.join(source, file));
21297
- import_fs13.default.mkdirSync(import_path19.default.dirname(target), { recursive: true });
21298
- import_fs13.default.writeFileSync(target, contents);
21282
+ const contents = import_fs12.default.readFileSync(import_path18.default.join(source, file));
21283
+ import_fs12.default.mkdirSync(import_path18.default.dirname(target), { recursive: true });
21284
+ import_fs12.default.writeFileSync(target, contents);
21299
21285
  created.push(file);
21300
21286
  }
21301
21287
  return { created, skipped };
@@ -21306,10 +21292,10 @@ var GITIGNORE_ENTRIES = ["node_modules/", `${TOKEN_DIR}/`, ...TEST_GITIGNORE_ENT
21306
21292
  var CLI_PACKAGE = "@flowrunner/cli";
21307
21293
  var CLI_PACKAGE_NAMES = [CLI_PACKAGE, "flowrunner-cli"];
21308
21294
  function cliVersion() {
21309
- return JSON.parse(import_fs14.default.readFileSync(import_path20.default.join(packageRoot(), "package.json"), "utf-8")).version;
21295
+ return JSON.parse(import_fs13.default.readFileSync(import_path19.default.join(packageRoot(), "package.json"), "utf-8")).version;
21310
21296
  }
21311
21297
  function packageNameFrom(directory) {
21312
- const name = import_path20.default.basename(import_path20.default.resolve(directory)).toLowerCase().replace(/[^a-z0-9._-]+/g, "-").replace(/^[._-]+|[-._]+$/g, "");
21298
+ const name = import_path19.default.basename(import_path19.default.resolve(directory)).toLowerCase().replace(/[^a-z0-9._-]+/g, "-").replace(/^[._-]+|[-._]+$/g, "");
21313
21299
  return name || "flowrunner-extensions";
21314
21300
  }
21315
21301
  function addMissing(section2, additions, placeholders = {}) {
@@ -21323,11 +21309,11 @@ function addMissing(section2, additions, placeholders = {}) {
21323
21309
  return changed;
21324
21310
  }
21325
21311
  function writePackageJson(projectRoot, tests) {
21326
- const fullPath = import_path20.default.join(projectRoot, "package.json");
21312
+ const fullPath = import_path19.default.join(projectRoot, "package.json");
21327
21313
  const version2 = cliVersion();
21328
21314
  const devDependencies = { [CLI_PACKAGE]: version2, ...tests ? TEST_DEV_DEPENDENCIES : {} };
21329
21315
  const scripts = { deploy: "flowrunner deploy --all", ...tests ? TEST_SCRIPTS : {} };
21330
- if (!import_fs14.default.existsSync(fullPath)) {
21316
+ if (!import_fs13.default.existsSync(fullPath)) {
21331
21317
  const manifest2 = {
21332
21318
  name: packageNameFrom(projectRoot),
21333
21319
  version: "0.0.1",
@@ -21336,10 +21322,10 @@ function writePackageJson(projectRoot, tests) {
21336
21322
  scripts,
21337
21323
  devDependencies
21338
21324
  };
21339
- import_fs14.default.writeFileSync(fullPath, JSON.stringify(manifest2, null, 2) + "\n", "utf-8");
21325
+ import_fs13.default.writeFileSync(fullPath, JSON.stringify(manifest2, null, 2) + "\n", "utf-8");
21340
21326
  return "created";
21341
21327
  }
21342
- const manifest = JSON.parse(import_fs14.default.readFileSync(fullPath, "utf-8"));
21328
+ const manifest = JSON.parse(import_fs13.default.readFileSync(fullPath, "utf-8"));
21343
21329
  const alreadyDeclared = CLI_PACKAGE_NAMES.some((name) => manifest.dependencies?.[name] || manifest.devDependencies?.[name]);
21344
21330
  const additions = alreadyDeclared ? Object.fromEntries(Object.entries(devDependencies).filter(([name]) => name !== CLI_PACKAGE)) : devDependencies;
21345
21331
  manifest.devDependencies ??= {};
@@ -21351,22 +21337,22 @@ function writePackageJson(projectRoot, tests) {
21351
21337
  if (!changed) {
21352
21338
  return "skipped";
21353
21339
  }
21354
- import_fs14.default.writeFileSync(fullPath, JSON.stringify(manifest, null, 2) + "\n", "utf-8");
21340
+ import_fs13.default.writeFileSync(fullPath, JSON.stringify(manifest, null, 2) + "\n", "utf-8");
21355
21341
  return "updated";
21356
21342
  }
21357
21343
  function writeGitignore(projectRoot) {
21358
- const fullPath = import_path20.default.join(projectRoot, ".gitignore");
21359
- if (!import_fs14.default.existsSync(fullPath)) {
21360
- import_fs14.default.writeFileSync(fullPath, GITIGNORE_ENTRIES.join("\n") + "\n", "utf-8");
21344
+ const fullPath = import_path19.default.join(projectRoot, ".gitignore");
21345
+ if (!import_fs13.default.existsSync(fullPath)) {
21346
+ import_fs13.default.writeFileSync(fullPath, GITIGNORE_ENTRIES.join("\n") + "\n", "utf-8");
21361
21347
  return "created";
21362
21348
  }
21363
- const content = import_fs14.default.readFileSync(fullPath, "utf-8");
21349
+ const content = import_fs13.default.readFileSync(fullPath, "utf-8");
21364
21350
  const lines = content.split("\n").map((line) => line.trim());
21365
21351
  const missing = GITIGNORE_ENTRIES.filter((entry) => !lines.includes(entry) && !lines.includes(entry.replace(/\/$/, "")));
21366
21352
  if (missing.length === 0) {
21367
21353
  return "skipped";
21368
21354
  }
21369
- import_fs14.default.appendFileSync(fullPath, `${content.endsWith("\n") ? "" : "\n"}${missing.join("\n")}
21355
+ import_fs13.default.appendFileSync(fullPath, `${content.endsWith("\n") ? "" : "\n"}${missing.join("\n")}
21370
21356
  `);
21371
21357
  return "updated";
21372
21358
  }
@@ -21414,11 +21400,11 @@ The authoring reference the CLI ships lives in
21414
21400
  \`.flowrunner/token\` is the deploy token and must not.
21415
21401
  `;
21416
21402
  function writeReadme(projectRoot) {
21417
- const fullPath = import_path20.default.join(projectRoot, "README.md");
21418
- if (import_fs14.default.existsSync(fullPath)) {
21403
+ const fullPath = import_path19.default.join(projectRoot, "README.md");
21404
+ if (import_fs13.default.existsSync(fullPath)) {
21419
21405
  return "skipped";
21420
21406
  }
21421
- import_fs14.default.writeFileSync(fullPath, README(packageNameFrom(projectRoot)), "utf-8");
21407
+ import_fs13.default.writeFileSync(fullPath, README(packageNameFrom(projectRoot)), "utf-8");
21422
21408
  return "created";
21423
21409
  }
21424
21410
  var JSCONFIG = {
@@ -21430,11 +21416,11 @@ var JSCONFIG = {
21430
21416
  include: ["services/*/src/**/*.js"]
21431
21417
  };
21432
21418
  function writeJsconfig(projectRoot) {
21433
- const fullPath = import_path20.default.join(projectRoot, "jsconfig.json");
21434
- if (import_fs14.default.existsSync(fullPath)) {
21419
+ const fullPath = import_path19.default.join(projectRoot, "jsconfig.json");
21420
+ if (import_fs13.default.existsSync(fullPath)) {
21435
21421
  return "skipped";
21436
21422
  }
21437
- import_fs14.default.writeFileSync(fullPath, JSON.stringify(JSCONFIG, null, 2) + "\n", "utf-8");
21423
+ import_fs13.default.writeFileSync(fullPath, JSON.stringify(JSCONFIG, null, 2) + "\n", "utf-8");
21438
21424
  return "created";
21439
21425
  }
21440
21426
  function git(projectRoot, args) {
@@ -21485,13 +21471,13 @@ function npmInstall(projectRoot, warn) {
21485
21471
  }
21486
21472
  }
21487
21473
  function describeTarget(projectRoot) {
21488
- if (!import_fs14.default.existsSync(projectRoot)) {
21474
+ if (!import_fs13.default.existsSync(projectRoot)) {
21489
21475
  return { projectRoot, lines: ["a new directory"], defaultYes: true };
21490
21476
  }
21491
- if (!import_fs14.default.statSync(projectRoot).isDirectory()) {
21477
+ if (!import_fs13.default.statSync(projectRoot).isDirectory()) {
21492
21478
  return { projectRoot, lines: ["not a directory"], defaultYes: false };
21493
21479
  }
21494
- const entries = import_fs14.default.readdirSync(projectRoot).filter((entry) => entry !== ".git");
21480
+ const entries = import_fs13.default.readdirSync(projectRoot).filter((entry) => entry !== ".git");
21495
21481
  if (entries.length === 0) {
21496
21482
  return { projectRoot, lines: ["an empty directory"], defaultYes: true };
21497
21483
  }
@@ -21508,7 +21494,7 @@ function describeTarget(projectRoot) {
21508
21494
  return { projectRoot, lines, defaultYes: false };
21509
21495
  }
21510
21496
  async function init(options = {}) {
21511
- const projectRoot = import_path20.default.resolve(options.cwd ?? ".");
21497
+ const projectRoot = import_path19.default.resolve(options.cwd ?? ".");
21512
21498
  const emit = emitter(options);
21513
21499
  const warn = (message) => emit({ type: "warning", message });
21514
21500
  const template = options.template ? resolveTemplateId(options.template) : null;
@@ -21535,10 +21521,10 @@ async function init(options = {}) {
21535
21521
  committed: false
21536
21522
  };
21537
21523
  }
21538
- if (!import_fs14.default.existsSync(projectRoot)) {
21539
- import_fs14.default.mkdirSync(projectRoot, { recursive: true });
21524
+ if (!import_fs13.default.existsSync(projectRoot)) {
21525
+ import_fs13.default.mkdirSync(projectRoot, { recursive: true });
21540
21526
  }
21541
- if (!import_fs14.default.statSync(projectRoot).isDirectory()) {
21527
+ if (!import_fs13.default.statSync(projectRoot).isDirectory()) {
21542
21528
  throw new PromptAbortedError(`${projectRoot} is not a directory.`);
21543
21529
  }
21544
21530
  const created = [];
@@ -21580,10 +21566,10 @@ async function init(options = {}) {
21580
21566
 
21581
21567
  // src/cli/offer-global-install.ts
21582
21568
  var import_child_process2 = require("child_process");
21583
- var import_fs15 = __toESM(require("fs"));
21584
- var import_path21 = __toESM(require("path"));
21569
+ var import_fs14 = __toESM(require("fs"));
21570
+ var import_path20 = __toESM(require("path"));
21585
21571
  function runningVersion() {
21586
- return JSON.parse(import_fs15.default.readFileSync(import_path21.default.join(packageRoot(), "package.json"), "utf-8")).version;
21572
+ return JSON.parse(import_fs14.default.readFileSync(import_path20.default.join(packageRoot(), "package.json"), "utf-8")).version;
21587
21573
  }
21588
21574
  async function offerGlobalInstall() {
21589
21575
  if (!process.stdin.isTTY || hasGlobalInstall()) {
@@ -21634,7 +21620,7 @@ async function initCommand(templateId, options = {}) {
21634
21620
  if (result.cancelled) {
21635
21621
  return;
21636
21622
  }
21637
- const relative = import_path22.default.relative(process.cwd(), result.projectRoot);
21623
+ const relative = import_path21.default.relative(process.cwd(), result.projectRoot);
21638
21624
  const where = !relative || relative.startsWith("..") ? result.projectRoot : relative;
21639
21625
  const step = (index2, text2) => say(` ${index2}. ${text2}`);
21640
21626
  const option = (text2) => say(` ${text2}`);
@@ -21670,8 +21656,8 @@ async function initCommand(templateId, options = {}) {
21670
21656
  }
21671
21657
 
21672
21658
  // src/operations/init-claude/index.ts
21673
- var import_fs16 = __toESM(require("fs"));
21674
- var import_path23 = __toESM(require("path"));
21659
+ var import_fs15 = __toESM(require("fs"));
21660
+ var import_path22 = __toESM(require("path"));
21675
21661
 
21676
21662
  // src/operations/init-claude/segment.ts
21677
21663
  var BEGIN_MARKER = "<!-- flowrunner-cli:ai:start -->";
@@ -21706,16 +21692,16 @@ function mergeSegment(current, segment, file) {
21706
21692
 
21707
21693
  // src/operations/init-claude/index.ts
21708
21694
  function providerDirectory(provider = CLAUDE_PROVIDER) {
21709
- return import_path23.default.join(packageRoot(), AI_PROVIDERS_DIRECTORY, provider);
21695
+ return import_path22.default.join(packageRoot(), AI_PROVIDERS_DIRECTORY, provider);
21710
21696
  }
21711
21697
  function packedAgents(directory) {
21712
- if (!import_fs16.default.existsSync(directory)) {
21698
+ if (!import_fs15.default.existsSync(directory)) {
21713
21699
  return [];
21714
21700
  }
21715
- return import_fs16.default.readdirSync(directory, { withFileTypes: true }).filter((entry) => entry.isFile() && entry.name.endsWith(".md")).map((entry) => entry.name).sort();
21701
+ return import_fs15.default.readdirSync(directory, { withFileTypes: true }).filter((entry) => entry.isFile() && entry.name.endsWith(".md")).map((entry) => entry.name).sort();
21716
21702
  }
21717
21703
  function writeAgents(sourceDirectory, projectRoot, layout) {
21718
- const directory = import_path23.default.join(projectRoot, layout.agentsDirectory);
21704
+ const directory = import_path22.default.join(projectRoot, layout.agentsDirectory);
21719
21705
  const agents = packedAgents(sourceDirectory);
21720
21706
  const created = [];
21721
21707
  const updated = [];
@@ -21725,59 +21711,59 @@ function writeAgents(sourceDirectory, projectRoot, layout) {
21725
21711
  warnings.push(`The installed CLI ships no agent definitions in ${PROVIDER_AGENTS_DIRECTORY}/ \u2014 none were written.`);
21726
21712
  return { directory, created, updated, unchanged, warnings };
21727
21713
  }
21728
- import_fs16.default.mkdirSync(directory, { recursive: true });
21714
+ import_fs15.default.mkdirSync(directory, { recursive: true });
21729
21715
  for (const agent of agents) {
21730
- const contents = import_fs16.default.readFileSync(import_path23.default.join(sourceDirectory, agent), "utf-8");
21731
- const target = import_path23.default.join(directory, agent);
21716
+ const contents = import_fs15.default.readFileSync(import_path22.default.join(sourceDirectory, agent), "utf-8");
21717
+ const target = import_path22.default.join(directory, agent);
21732
21718
  if (contents.length === 0) {
21733
21719
  warnings.push(`${agent} is empty in the installed CLI \u2014 written as an empty file.`);
21734
21720
  }
21735
- if (!import_fs16.default.existsSync(target)) {
21736
- import_fs16.default.writeFileSync(target, contents, "utf-8");
21721
+ if (!import_fs15.default.existsSync(target)) {
21722
+ import_fs15.default.writeFileSync(target, contents, "utf-8");
21737
21723
  created.push(agent);
21738
21724
  continue;
21739
21725
  }
21740
- if (import_fs16.default.readFileSync(target, "utf-8") === contents) {
21726
+ if (import_fs15.default.readFileSync(target, "utf-8") === contents) {
21741
21727
  unchanged.push(agent);
21742
21728
  continue;
21743
21729
  }
21744
- import_fs16.default.writeFileSync(target, contents, "utf-8");
21730
+ import_fs15.default.writeFileSync(target, contents, "utf-8");
21745
21731
  updated.push(agent);
21746
21732
  }
21747
21733
  return { directory, created, updated, unchanged, warnings };
21748
21734
  }
21749
21735
  function writeSegment(sourceDirectory, projectRoot, layout) {
21750
- const file = import_path23.default.join(projectRoot, layout.instructionsFile);
21751
- const source = import_path23.default.join(sourceDirectory, ORCHESTRATOR_SEGMENT_FILE);
21736
+ const file = import_path22.default.join(projectRoot, layout.instructionsFile);
21737
+ const source = import_path22.default.join(sourceDirectory, ORCHESTRATOR_SEGMENT_FILE);
21752
21738
  const warnings = [];
21753
- if (!import_fs16.default.existsSync(source)) {
21739
+ if (!import_fs15.default.existsSync(source)) {
21754
21740
  warnings.push(`The installed CLI ships no ${ORCHESTRATOR_SEGMENT_FILE} \u2014 ${layout.instructionsFile} was left alone.`);
21755
21741
  return { file, outcome: "unchanged", warnings };
21756
21742
  }
21757
- const segment = import_fs16.default.readFileSync(source, "utf-8");
21743
+ const segment = import_fs15.default.readFileSync(source, "utf-8");
21758
21744
  if (segment.trim().length === 0) {
21759
21745
  warnings.push(`${ORCHESTRATOR_SEGMENT_FILE} is empty in the installed CLI \u2014 the marked block is empty.`);
21760
21746
  }
21761
- const current = import_fs16.default.existsSync(file) ? import_fs16.default.readFileSync(file, "utf-8") : null;
21747
+ const current = import_fs15.default.existsSync(file) ? import_fs15.default.readFileSync(file, "utf-8") : null;
21762
21748
  const merged = mergeSegment(current, segment, layout.instructionsFile);
21763
21749
  if (merged.outcome !== "unchanged") {
21764
- import_fs16.default.writeFileSync(file, merged.contents, "utf-8");
21750
+ import_fs15.default.writeFileSync(file, merged.contents, "utf-8");
21765
21751
  }
21766
21752
  return { file, outcome: merged.outcome, warnings };
21767
21753
  }
21768
21754
  async function initClaude(options = {}) {
21769
- const projectRoot = import_path23.default.resolve(options.cwd ?? ".");
21755
+ const projectRoot = import_path22.default.resolve(options.cwd ?? ".");
21770
21756
  const emit = emitter(options);
21771
21757
  const warnAll = (messages) => messages.forEach((message) => emit({ type: "warning", message }));
21772
21758
  const layout = PROVIDERS[CLAUDE_PROVIDER];
21773
21759
  const sourceDirectory = providerDirectory(layout.id);
21774
- if (!import_fs16.default.existsSync(sourceDirectory)) {
21775
- throw new AiDocsMissingError(import_path23.default.join(AI_PROVIDERS_DIRECTORY, CLAUDE_PROVIDER));
21760
+ if (!import_fs15.default.existsSync(sourceDirectory)) {
21761
+ throw new AiDocsMissingError(import_path22.default.join(AI_PROVIDERS_DIRECTORY, CLAUDE_PROVIDER));
21776
21762
  }
21777
- if (!import_fs16.default.existsSync(projectRoot)) {
21778
- import_fs16.default.mkdirSync(projectRoot, { recursive: true });
21763
+ if (!import_fs15.default.existsSync(projectRoot)) {
21764
+ import_fs15.default.mkdirSync(projectRoot, { recursive: true });
21779
21765
  }
21780
- const agents = writeAgents(import_path23.default.join(sourceDirectory, PROVIDER_AGENTS_DIRECTORY), projectRoot, layout);
21766
+ const agents = writeAgents(import_path22.default.join(sourceDirectory, PROVIDER_AGENTS_DIRECTORY), projectRoot, layout);
21781
21767
  emit({
21782
21768
  type: "agents",
21783
21769
  directory: agents.directory,
@@ -21851,12 +21837,12 @@ async function logoutCommand() {
21851
21837
 
21852
21838
  // src/operations/pull/index.ts
21853
21839
  var import_adm_zip = __toESM(require_adm_zip());
21854
- var import_fs18 = __toESM(require("fs"));
21855
- var import_path25 = __toESM(require("path"));
21856
-
21857
- // src/operations/pull/extract.ts
21858
21840
  var import_fs17 = __toESM(require("fs"));
21859
21841
  var import_path24 = __toESM(require("path"));
21842
+
21843
+ // src/operations/pull/extract.ts
21844
+ var import_fs16 = __toESM(require("fs"));
21845
+ var import_path23 = __toESM(require("path"));
21860
21846
  var PACKAGE_PREFIX = "package/";
21861
21847
  var SAFE_SERVICE_ID = /^[A-Za-z0-9][A-Za-z0-9._-]*$/;
21862
21848
  function isSafeServiceId(serviceId) {
@@ -21875,12 +21861,12 @@ function extractService(archive, directory) {
21875
21861
  let written = 0;
21876
21862
  for (const entry of serviceEntries(archive)) {
21877
21863
  const relativePath = entry.entryName.slice(PACKAGE_PREFIX.length);
21878
- const target = import_path24.default.resolve(directory, relativePath);
21879
- if (target !== directory && !target.startsWith(directory + import_path24.default.sep)) {
21864
+ const target = import_path23.default.resolve(directory, relativePath);
21865
+ if (target !== directory && !target.startsWith(directory + import_path23.default.sep)) {
21880
21866
  continue;
21881
21867
  }
21882
- import_fs17.default.mkdirSync(import_path24.default.dirname(target), { recursive: true });
21883
- import_fs17.default.writeFileSync(target, entry.getData());
21868
+ import_fs16.default.mkdirSync(import_path23.default.dirname(target), { recursive: true });
21869
+ import_fs16.default.writeFileSync(target, entry.getData());
21884
21870
  written++;
21885
21871
  }
21886
21872
  return written;
@@ -21900,7 +21886,7 @@ function declaredDependencies(archive) {
21900
21886
 
21901
21887
  // src/operations/pull/index.ts
21902
21888
  async function localState(projectRoot, service) {
21903
- if (!import_fs18.default.existsSync(import_path25.default.resolve(projectRoot, "services", service.serviceId))) {
21889
+ if (!import_fs17.default.existsSync(import_path24.default.resolve(projectRoot, "services", service.serviceId))) {
21904
21890
  return "absent";
21905
21891
  }
21906
21892
  try {
@@ -21945,7 +21931,7 @@ async function pull(options = {}) {
21945
21931
  emit({ type: "skipped", serviceId: service.serviceId, reason });
21946
21932
  continue;
21947
21933
  }
21948
- const directory = import_path25.default.resolve(projectRoot, "services", service.serviceId);
21934
+ const directory = import_path24.default.resolve(projectRoot, "services", service.serviceId);
21949
21935
  const state = await localState(projectRoot, service);
21950
21936
  if (state === "same") {
21951
21937
  upToDate.push({
@@ -21966,7 +21952,7 @@ async function pull(options = {}) {
21966
21952
  const zipBuffer = await guard(() => downloadRemoteService(credentials, service.serviceId));
21967
21953
  const archive = new import_adm_zip.default(zipBuffer);
21968
21954
  if (exists) {
21969
- import_fs18.default.rmSync(directory, { recursive: true, force: true });
21955
+ import_fs17.default.rmSync(directory, { recursive: true, force: true });
21970
21956
  }
21971
21957
  const files = extractService(archive, directory);
21972
21958
  const dependencies = declaredDependencies(archive);
@@ -22066,10 +22052,10 @@ async function pickServices2(available) {
22066
22052
  }
22067
22053
 
22068
22054
  // src/operations/use-server.ts
22069
- var import_fs19 = __toESM(require("fs"));
22055
+ var import_fs18 = __toESM(require("fs"));
22070
22056
  function useServer(target, options = {}) {
22071
22057
  const projectRoot = options.cwd ?? process.cwd();
22072
- if (!import_fs19.default.existsSync(configPath(projectRoot))) {
22058
+ if (!import_fs18.default.existsSync(configPath(projectRoot))) {
22073
22059
  throw new NotAProjectError();
22074
22060
  }
22075
22061
  const serverUrl = resolveServerTarget(target);