@flowrunner/cli 0.1.19-dev.1 → 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 (316) hide show
  1. package/ai-docs/instructions/service-code-format/01-service-structure.md +1 -1
  2. package/ai-docs/instructions/service-code-format/05-dictionaries.md +1 -1
  3. package/ai-docs/instructions/service-code-format/11-output-model.md +2 -5
  4. package/ai-docs/instructions/service-code-format/13-runtime-contracts.md +2 -3
  5. package/ai-docs/instructions/service-code-format/README.md +2 -2
  6. package/dist/cli.js +335 -926
  7. package/dist/cli.js.map +4 -4
  8. package/dist/index.js +368 -956
  9. package/dist/index.js.map +4 -4
  10. package/{runtime/types/flow-extension-runner/src/v2 → dist/types/flow-extension-runner/src}/context/execution-context.d.ts +2 -2
  11. package/{runtime/types/flow-extension-runner/src/v2 → dist/types/flow-extension-runner/src}/extension.d.ts +3 -3
  12. package/dist/types/flow-extension-runner/src/global.d.ts +6 -18
  13. package/dist/types/flow-extension-runner/src/index.d.ts +39 -13
  14. package/dist/types/flow-extension-runner/src/{v2/model → model}/field-mapper.d.ts +1 -1
  15. package/dist/types/flow-extension-runner/src/{v2/model → model}/model-types.d.ts +11 -1
  16. package/dist/types/flow-extension-runner/src/{v2/model → model}/params-model.d.ts +1 -1
  17. package/dist/types/flow-extension-runner/src/{v2/params → params}/config-params.d.ts +1 -1
  18. package/{runtime/types/flow-extension-runner/src/v2 → dist/types/flow-extension-runner/src}/params/schema/messages.d.ts +1 -1
  19. package/{runtime/types/flow-extension-runner/src/v2 → dist/types/flow-extension-runner/src}/params/schema/normalize.d.ts +1 -1
  20. package/dist/types/flow-extension-runner/src/{v2/params → params}/schema/parse.d.ts +1 -1
  21. package/dist/types/flow-extension-runner/src/{v2/params → params}/types.d.ts +1 -1
  22. package/{runtime/types/flow-extension-runner/src/v2 → dist/types/flow-extension-runner/src}/registry.d.ts +2 -0
  23. package/dist/types/flow-extension-runner/src/{v2/types.d.ts → types.d.ts} +1 -1
  24. package/dist/types/packages/cli/src/operations/deploy/discover-services.d.ts +2 -4
  25. package/dist/types/shared/src/constants/activity-log.d.ts +248 -2
  26. package/dist/types/shared/src/constants/error-codes.d.ts +6 -0
  27. package/dist/types/shared/src/constants/index.d.ts +1 -0
  28. package/dist/types/shared/src/constants/notification-types.d.ts +309 -0
  29. package/dist/types/shared/src/constants/panic-mode.d.ts +17 -0
  30. package/dist/types/shared/src/constants/shared-extensions.d.ts +10 -0
  31. package/dist/types/shared/src/errors/index.d.ts +1 -0
  32. package/dist/types/shared/src/errors/secrets.d.ts +16 -0
  33. package/dist/types/shared/src/scheme/access-keys/dto.d.ts +35 -13
  34. package/dist/types/shared/src/scheme/api-keys/dto.d.ts +29 -4
  35. package/dist/types/shared/src/scheme/flowrunner/custom-elements.d.ts +0 -16
  36. package/dist/types/shared/src/scheme/flowrunner/index.d.ts +1 -0
  37. package/dist/types/shared/src/scheme/flowrunner/java.dto.d.ts +26 -0
  38. package/dist/types/shared/src/scheme/flowrunner/workspace-dashboard.dto.d.ts +207 -0
  39. package/dist/types/shared/src/scheme/integration-connection/dto.d.ts +22 -0
  40. package/dist/types/shared/src/scheme/notifications/dto.d.ts +10 -0
  41. package/dist/types/shared/src/scheme/notifications/rest.d.ts +20 -0
  42. package/dist/types/shared/src/scheme/remote-mcp-server/dto.d.ts +153 -29
  43. package/dist/types/shared/src/scheme/shared-extensions/base.d.ts +0 -4
  44. package/dist/types/shared/src/scheme/shared-extensions/custom-extensions.d.ts +0 -24
  45. package/dist/types/shared/src/scheme/shared-extensions/extension.d.ts +0 -18
  46. package/dist/types/shared/src/scheme/shared-extensions/flow-extensions.d.ts +0 -3
  47. package/dist/types/shared/src/scheme/shared-extensions/index.d.ts +1 -0
  48. package/dist/types/shared/src/scheme/shared-extensions/list.d.ts +0 -28
  49. package/dist/types/shared/src/scheme/shared-extensions/methods.d.ts +0 -1
  50. package/dist/types/shared/src/scheme/shared-extensions/resolve.d.ts +0 -12
  51. package/dist/types/shared/src/scheme/shared-extensions/search.d.ts +0 -8
  52. package/dist/types/shared/src/scheme/shared-extensions/usage-stats.d.ts +189 -0
  53. package/package.json +1 -4
  54. package/project-files/sandbox/files-mock.js +3 -5
  55. package/project-files/sandbox/service.js +10 -11
  56. package/runtime/index.js +178 -863
  57. package/runtime/index.js.map +4 -4
  58. package/{dist/types/flow-extension-runner/src/v2 → runtime/types/flow-extension-runner/src}/context/execution-context.d.ts +2 -2
  59. package/{dist/types/flow-extension-runner/src/v2 → runtime/types/flow-extension-runner/src}/extension.d.ts +3 -3
  60. package/runtime/types/flow-extension-runner/src/global.d.ts +6 -18
  61. package/runtime/types/flow-extension-runner/src/index.d.ts +39 -13
  62. package/runtime/types/flow-extension-runner/src/{v2/model → model}/field-mapper.d.ts +1 -1
  63. package/runtime/types/flow-extension-runner/src/{v2/model → model}/model-types.d.ts +11 -1
  64. package/runtime/types/flow-extension-runner/src/{v2/model → model}/params-model.d.ts +1 -1
  65. package/runtime/types/flow-extension-runner/src/{v2/params → params}/config-params.d.ts +1 -1
  66. package/{dist/types/flow-extension-runner/src/v2 → runtime/types/flow-extension-runner/src}/params/schema/messages.d.ts +1 -1
  67. package/{dist/types/flow-extension-runner/src/v2 → runtime/types/flow-extension-runner/src}/params/schema/normalize.d.ts +1 -1
  68. package/runtime/types/flow-extension-runner/src/{v2/params → params}/schema/parse.d.ts +1 -1
  69. package/runtime/types/flow-extension-runner/src/{v2/params → params}/types.d.ts +1 -1
  70. package/{dist/types/flow-extension-runner/src/v2 → runtime/types/flow-extension-runner/src}/registry.d.ts +2 -0
  71. package/runtime/types/flow-extension-runner/src/{v2/types.d.ts → types.d.ts} +1 -1
  72. package/runtime/types/packages/cli/src/runtime/index.d.ts +6 -5
  73. package/dist/types/flow-extension-runner/src/common/config.d.ts +0 -12
  74. package/dist/types/flow-extension-runner/src/common/context.d.ts +0 -6
  75. package/dist/types/flow-extension-runner/src/common/types.d.ts +0 -11
  76. package/dist/types/flow-extension-runner/src/v1/config.d.ts +0 -3
  77. package/dist/types/flow-extension-runner/src/v1/constants.d.ts +0 -4
  78. package/dist/types/flow-extension-runner/src/v1/index.d.ts +0 -11
  79. package/dist/types/flow-extension-runner/src/v1/namespace.d.ts +0 -9
  80. package/dist/types/flow-extension-runner/src/v1/service.d.ts +0 -29
  81. package/dist/types/flow-extension-runner/src/v1/types.d.ts +0 -13
  82. package/dist/types/flow-extension-runner/src/v2/index.d.ts +0 -39
  83. package/dist/types/jsdoc-parser/src/custom-type-defs/files.d.ts +0 -2
  84. package/dist/types/jsdoc-parser/src/index.d.ts +0 -2
  85. package/dist/types/jsdoc-parser/src/lib.d.ts +0 -42
  86. package/dist/types/jsdoc-parser/src/types.d.ts +0 -2
  87. package/runtime/types/flow-extension-runner/src/common/config.d.ts +0 -12
  88. package/runtime/types/flow-extension-runner/src/common/context.d.ts +0 -6
  89. package/runtime/types/flow-extension-runner/src/common/types.d.ts +0 -11
  90. package/runtime/types/flow-extension-runner/src/v1/config.d.ts +0 -3
  91. package/runtime/types/flow-extension-runner/src/v1/constants.d.ts +0 -4
  92. package/runtime/types/flow-extension-runner/src/v1/index.d.ts +0 -11
  93. package/runtime/types/flow-extension-runner/src/v1/namespace.d.ts +0 -9
  94. package/runtime/types/flow-extension-runner/src/v1/service.d.ts +0 -29
  95. package/runtime/types/flow-extension-runner/src/v1/types.d.ts +0 -13
  96. package/runtime/types/flow-extension-runner/src/v2/index.d.ts +0 -39
  97. package/runtime/types/jsdoc-parser/src/custom-type-defs/files.d.ts +0 -2
  98. package/runtime/types/jsdoc-parser/src/index.d.ts +0 -2
  99. package/runtime/types/jsdoc-parser/src/lib.d.ts +0 -42
  100. package/runtime/types/jsdoc-parser/src/types.d.ts +0 -2
  101. package/runtime/types/shared/src/constants/activity-log.d.ts +0 -1573
  102. package/runtime/types/shared/src/constants/ai-agent-tools.d.ts +0 -20
  103. package/runtime/types/shared/src/constants/ai.d.ts +0 -11
  104. package/runtime/types/shared/src/constants/api-keys.d.ts +0 -1
  105. package/runtime/types/shared/src/constants/app.d.ts +0 -57
  106. package/runtime/types/shared/src/constants/billing.d.ts +0 -16
  107. package/runtime/types/shared/src/constants/compliances.d.ts +0 -3
  108. package/runtime/types/shared/src/constants/data-types.d.ts +0 -26
  109. package/runtime/types/shared/src/constants/docs.d.ts +0 -6
  110. package/runtime/types/shared/src/constants/error-codes.d.ts +0 -20
  111. package/runtime/types/shared/src/constants/flow.d.ts +0 -12
  112. package/runtime/types/shared/src/constants/index.d.ts +0 -18
  113. package/runtime/types/shared/src/constants/knowledge-base.d.ts +0 -15
  114. package/runtime/types/shared/src/constants/notification-types.d.ts +0 -1234
  115. package/runtime/types/shared/src/constants/notifications.d.ts +0 -10
  116. package/runtime/types/shared/src/constants/oauth-connection-error.d.ts +0 -3
  117. package/runtime/types/shared/src/constants/patterns.d.ts +0 -28
  118. package/runtime/types/shared/src/constants/retry-policy.d.ts +0 -30
  119. package/runtime/types/shared/src/constants/severity.d.ts +0 -9
  120. package/runtime/types/shared/src/constants/shared-extensions-search.d.ts +0 -6
  121. package/runtime/types/shared/src/constants/shared-extensions.d.ts +0 -56
  122. package/runtime/types/shared/src/constants/zod.d.ts +0 -2
  123. package/runtime/types/shared/src/errors/api.d.ts +0 -15
  124. package/runtime/types/shared/src/errors/base.d.ts +0 -38
  125. package/runtime/types/shared/src/errors/common.d.ts +0 -39
  126. package/runtime/types/shared/src/errors/index.d.ts +0 -14
  127. package/runtime/types/shared/src/errors/k8s.d.ts +0 -14
  128. package/runtime/types/shared/src/errors/message.d.ts +0 -48
  129. package/runtime/types/shared/src/errors/oauth-connection.d.ts +0 -4
  130. package/runtime/types/shared/src/errors/open-search.d.ts +0 -4
  131. package/runtime/types/shared/src/errors/s3.d.ts +0 -11
  132. package/runtime/types/shared/src/extensions/zod.d.ts +0 -25
  133. package/runtime/types/shared/src/scheme/access-keys/dto.d.ts +0 -101
  134. package/runtime/types/shared/src/scheme/access-keys/index.d.ts +0 -2
  135. package/runtime/types/shared/src/scheme/account/dto.d.ts +0 -63
  136. package/runtime/types/shared/src/scheme/account/index.d.ts +0 -1
  137. package/runtime/types/shared/src/scheme/activity-log-base.d.ts +0 -35
  138. package/runtime/types/shared/src/scheme/ai-agent-tools/dto.d.ts +0 -69
  139. package/runtime/types/shared/src/scheme/ai-agent-tools/index.d.ts +0 -2
  140. package/runtime/types/shared/src/scheme/ai-agent-tools/parameters.d.ts +0 -7
  141. package/runtime/types/shared/src/scheme/ai-router/dto.d.ts +0 -23
  142. package/runtime/types/shared/src/scheme/ai-router/index.d.ts +0 -2
  143. package/runtime/types/shared/src/scheme/api-keys/dto.d.ts +0 -28
  144. package/runtime/types/shared/src/scheme/api-keys/index.d.ts +0 -2
  145. package/runtime/types/shared/src/scheme/app/index.d.ts +0 -1
  146. package/runtime/types/shared/src/scheme/app/java.dto.d.ts +0 -6
  147. package/runtime/types/shared/src/scheme/billing/index.d.ts +0 -1
  148. package/runtime/types/shared/src/scheme/billing/java.dto.d.ts +0 -181
  149. package/runtime/types/shared/src/scheme/crm/billing.d.ts +0 -149
  150. package/runtime/types/shared/src/scheme/crm/dto.d.ts +0 -218
  151. package/runtime/types/shared/src/scheme/crm/index.d.ts +0 -3
  152. package/runtime/types/shared/src/scheme/data-types/index.d.ts +0 -1
  153. package/runtime/types/shared/src/scheme/data-types/java.dto.d.ts +0 -22
  154. package/runtime/types/shared/src/scheme/dynamic-forms/dto.d.ts +0 -30
  155. package/runtime/types/shared/src/scheme/dynamic-forms/index.d.ts +0 -2
  156. package/runtime/types/shared/src/scheme/extensions/index.d.ts +0 -1
  157. package/runtime/types/shared/src/scheme/extensions/params-to-zod.d.ts +0 -14
  158. package/runtime/types/shared/src/scheme/flowrunner/custom-elements.d.ts +0 -383
  159. package/runtime/types/shared/src/scheme/flowrunner/index.d.ts +0 -3
  160. package/runtime/types/shared/src/scheme/flowrunner/java.dto.d.ts +0 -655
  161. package/runtime/types/shared/src/scheme/index.d.ts +0 -21
  162. package/runtime/types/shared/src/scheme/integration-connection/dto.d.ts +0 -135
  163. package/runtime/types/shared/src/scheme/integration-connection/index.d.ts +0 -2
  164. package/runtime/types/shared/src/scheme/knowledge-base/dto.d.ts +0 -776
  165. package/runtime/types/shared/src/scheme/knowledge-base/index.d.ts +0 -2
  166. package/runtime/types/shared/src/scheme/mcp-oauth/dto.d.ts +0 -9
  167. package/runtime/types/shared/src/scheme/mcp-oauth/index.d.ts +0 -2
  168. package/runtime/types/shared/src/scheme/notifications/dto.d.ts +0 -118
  169. package/runtime/types/shared/src/scheme/notifications/index.d.ts +0 -3
  170. package/runtime/types/shared/src/scheme/notifications/rest.d.ts +0 -162
  171. package/runtime/types/shared/src/scheme/onboarding/dto.d.ts +0 -29
  172. package/runtime/types/shared/src/scheme/onboarding/index.d.ts +0 -1
  173. package/runtime/types/shared/src/scheme/properties/account.d.ts +0 -3
  174. package/runtime/types/shared/src/scheme/properties/app.d.ts +0 -5
  175. package/runtime/types/shared/src/scheme/properties/billing.d.ts +0 -12
  176. package/runtime/types/shared/src/scheme/properties/common.d.ts +0 -2
  177. package/runtime/types/shared/src/scheme/properties/db.d.ts +0 -8
  178. package/runtime/types/shared/src/scheme/properties/flow-extensions.d.ts +0 -7
  179. package/runtime/types/shared/src/scheme/properties/index.d.ts +0 -7
  180. package/runtime/types/shared/src/scheme/remote-mcp-server/dto.d.ts +0 -278
  181. package/runtime/types/shared/src/scheme/remote-mcp-server/index.d.ts +0 -2
  182. package/runtime/types/shared/src/scheme/shared-extensions/base.d.ts +0 -62
  183. package/runtime/types/shared/src/scheme/shared-extensions/config.d.ts +0 -96
  184. package/runtime/types/shared/src/scheme/shared-extensions/custom-extensions.d.ts +0 -631
  185. package/runtime/types/shared/src/scheme/shared-extensions/extension.d.ts +0 -411
  186. package/runtime/types/shared/src/scheme/shared-extensions/flow-extensions.d.ts +0 -64
  187. package/runtime/types/shared/src/scheme/shared-extensions/index.d.ts +0 -17
  188. package/runtime/types/shared/src/scheme/shared-extensions/light.d.ts +0 -38
  189. package/runtime/types/shared/src/scheme/shared-extensions/list.d.ts +0 -250
  190. package/runtime/types/shared/src/scheme/shared-extensions/logs.d.ts +0 -21
  191. package/runtime/types/shared/src/scheme/shared-extensions/methods.d.ts +0 -112
  192. package/runtime/types/shared/src/scheme/shared-extensions/params-schema.d.ts +0 -48
  193. package/runtime/types/shared/src/scheme/shared-extensions/popular-pool.d.ts +0 -11
  194. package/runtime/types/shared/src/scheme/shared-extensions/resolve.d.ts +0 -373
  195. package/runtime/types/shared/src/scheme/shared-extensions/rest.d.ts +0 -9
  196. package/runtime/types/shared/src/scheme/shared-extensions/search.d.ts +0 -189
  197. package/runtime/types/shared/src/scheme/shared-extensions/service-identity.d.ts +0 -10
  198. package/runtime/types/shared/src/scheme/shared-extensions/service-info.d.ts +0 -16
  199. package/runtime/types/shared/src/scheme/shared-extensions/workspace-stack.d.ts +0 -44
  200. package/runtime/types/shared/src/scheme/workspace/dto.d.ts +0 -40
  201. package/runtime/types/shared/src/scheme/workspace/index.d.ts +0 -1
  202. package/runtime/types/shared/src/utils/object.d.ts +0 -8
  203. package/runtime/types/shared/src/utils/uuid.d.ts +0 -5
  204. package/runtime/types/shared/src/utils/versions.d.ts +0 -4
  205. package/dist/types/flow-extension-runner/src/{v2/actions → actions}/action-method.d.ts +0 -0
  206. package/dist/types/flow-extension-runner/src/{common/context-files.d.ts → context/files.d.ts} +0 -0
  207. package/dist/types/flow-extension-runner/src/{v2/context → context}/logger.d.ts +0 -0
  208. package/dist/types/flow-extension-runner/src/{v2/context → context}/method-input.d.ts +0 -0
  209. package/dist/types/flow-extension-runner/src/{v2/context → context}/proxies.d.ts +0 -0
  210. package/dist/types/flow-extension-runner/src/{v2/create-extension.d.ts → create-extension.d.ts} +0 -0
  211. package/dist/types/flow-extension-runner/src/{v2/crypto.d.ts → crypto.d.ts} +0 -0
  212. package/dist/types/flow-extension-runner/src/{v2/dictionaries → dictionaries}/dictionary-method.d.ts +0 -0
  213. package/dist/types/flow-extension-runner/src/{v2/dictionaries → dictionaries}/payload-schema.d.ts +0 -0
  214. package/dist/types/flow-extension-runner/src/{v2/loaders → loaders}/loader-method.d.ts +0 -0
  215. package/dist/types/flow-extension-runner/src/{v2/loaders → loaders}/loader-owner.d.ts +0 -0
  216. package/dist/types/flow-extension-runner/src/{v2/loaders → loaders}/payload-schema.d.ts +0 -0
  217. package/dist/types/flow-extension-runner/src/{v2/method.d.ts → method.d.ts} +0 -0
  218. package/dist/types/flow-extension-runner/src/{v2/model → model}/method-model.d.ts +0 -0
  219. package/dist/types/flow-extension-runner/src/{v2/oauth → oauth}/method-names.d.ts +0 -0
  220. package/dist/types/flow-extension-runner/src/{v2/oauth → oauth}/oauth2.d.ts +0 -0
  221. package/dist/types/flow-extension-runner/src/{v2/oauth → oauth}/system-params.d.ts +0 -0
  222. package/dist/types/flow-extension-runner/src/{v2/oauth → oauth}/types.d.ts +0 -0
  223. package/dist/types/flow-extension-runner/src/{common/constants.d.ts → params/config-types.d.ts} +0 -0
  224. package/{runtime/types/flow-extension-runner/src/v2 → dist/types/flow-extension-runner/src}/params/files-options.d.ts +4 -4
  225. /package/dist/types/flow-extension-runner/src/{v2/params → params}/index.d.ts +0 -0
  226. /package/dist/types/flow-extension-runner/src/{v2/params → params}/json/checks.d.ts +0 -0
  227. /package/dist/types/flow-extension-runner/src/{v2/params → params}/json/decode.d.ts +0 -0
  228. /package/dist/types/flow-extension-runner/src/{v2/params → params}/json/encode.d.ts +0 -0
  229. /package/dist/types/flow-extension-runner/src/{v2/params → params}/json/types.d.ts +0 -0
  230. /package/dist/types/flow-extension-runner/src/{v2/params → params}/json/values.d.ts +0 -0
  231. /package/dist/types/flow-extension-runner/src/{v2/params → params}/method-params.d.ts +0 -0
  232. /package/dist/types/flow-extension-runner/src/{v2/params → params}/params.d.ts +0 -0
  233. /package/dist/types/flow-extension-runner/src/{v2/params → params}/schema/assert-object-schema.d.ts +0 -0
  234. /package/dist/types/flow-extension-runner/src/{v2/params → params}/schema/assert-supported-schema.d.ts +0 -0
  235. /package/dist/types/flow-extension-runner/src/{v2/params → params}/schema/coerce.d.ts +0 -0
  236. /package/dist/types/flow-extension-runner/src/{v2/params → params}/schema/date-format.d.ts +0 -0
  237. /package/dist/types/flow-extension-runner/src/{v2/params → params}/schema/dates.d.ts +0 -0
  238. /package/dist/types/flow-extension-runner/src/{v2/params → params}/schema/defaults.d.ts +0 -0
  239. /package/dist/types/flow-extension-runner/src/{v2/params → params}/schema/dictionary-binding.d.ts +0 -0
  240. /package/dist/types/flow-extension-runner/src/{v2/params → params}/schema/field-plan.d.ts +0 -0
  241. /package/dist/types/flow-extension-runner/src/{v2/params → params}/schema/introspect.d.ts +0 -0
  242. /package/dist/types/flow-extension-runner/src/{v2/params → params}/schema/labels.d.ts +0 -0
  243. /package/dist/types/flow-extension-runner/src/{v2/params → params}/schema/notices.d.ts +0 -0
  244. /package/dist/types/flow-extension-runner/src/{v2/params → params}/widget-types.d.ts +0 -0
  245. /package/dist/types/flow-extension-runner/src/{v2/params → params}/zod.d.ts +0 -0
  246. /package/dist/types/flow-extension-runner/src/{v2/path.d.ts → path.d.ts} +0 -0
  247. /package/dist/types/flow-extension-runner/src/{v2/polling-triggers → polling-triggers}/mechanisms.d.ts +0 -0
  248. /package/dist/types/flow-extension-runner/src/{v2/polling-triggers → polling-triggers}/method-names.d.ts +0 -0
  249. /package/dist/types/flow-extension-runner/src/{v2/polling-triggers → polling-triggers}/polling-triggers.d.ts +0 -0
  250. /package/dist/types/flow-extension-runner/src/{v2/polling-triggers → polling-triggers}/system-params.d.ts +0 -0
  251. /package/dist/types/flow-extension-runner/src/{v2/polling-triggers → polling-triggers}/trigger-method.d.ts +0 -0
  252. /package/dist/types/flow-extension-runner/src/{v2/polling-triggers → polling-triggers}/types.d.ts +0 -0
  253. /package/dist/types/flow-extension-runner/src/{v2/realtime-triggers → realtime-triggers}/method-names.d.ts +0 -0
  254. /package/dist/types/flow-extension-runner/src/{v2/realtime-triggers → realtime-triggers}/realtime-setup.d.ts +0 -0
  255. /package/dist/types/flow-extension-runner/src/{v2/realtime-triggers → realtime-triggers}/system-params.d.ts +0 -0
  256. /package/dist/types/flow-extension-runner/src/{v2/realtime-triggers → realtime-triggers}/trigger-method.d.ts +0 -0
  257. /package/dist/types/flow-extension-runner/src/{v2/realtime-triggers → realtime-triggers}/types.d.ts +0 -0
  258. /package/dist/types/flow-extension-runner/src/{v2/realtime-triggers → realtime-triggers}/verify.d.ts +0 -0
  259. /package/dist/types/flow-extension-runner/src/{v2/result.d.ts → result.d.ts} +0 -0
  260. /package/dist/types/flow-extension-runner/src/{v2/system-method.d.ts → system-method.d.ts} +0 -0
  261. /package/runtime/types/flow-extension-runner/src/{v2/actions → actions}/action-method.d.ts +0 -0
  262. /package/runtime/types/flow-extension-runner/src/{common/context-files.d.ts → context/files.d.ts} +0 -0
  263. /package/runtime/types/flow-extension-runner/src/{v2/context → context}/logger.d.ts +0 -0
  264. /package/runtime/types/flow-extension-runner/src/{v2/context → context}/method-input.d.ts +0 -0
  265. /package/runtime/types/flow-extension-runner/src/{v2/context → context}/proxies.d.ts +0 -0
  266. /package/runtime/types/flow-extension-runner/src/{v2/create-extension.d.ts → create-extension.d.ts} +0 -0
  267. /package/runtime/types/flow-extension-runner/src/{v2/crypto.d.ts → crypto.d.ts} +0 -0
  268. /package/runtime/types/flow-extension-runner/src/{v2/dictionaries → dictionaries}/dictionary-method.d.ts +0 -0
  269. /package/runtime/types/flow-extension-runner/src/{v2/dictionaries → dictionaries}/payload-schema.d.ts +0 -0
  270. /package/runtime/types/flow-extension-runner/src/{v2/loaders → loaders}/loader-method.d.ts +0 -0
  271. /package/runtime/types/flow-extension-runner/src/{v2/loaders → loaders}/loader-owner.d.ts +0 -0
  272. /package/runtime/types/flow-extension-runner/src/{v2/loaders → loaders}/payload-schema.d.ts +0 -0
  273. /package/runtime/types/flow-extension-runner/src/{v2/method.d.ts → method.d.ts} +0 -0
  274. /package/runtime/types/flow-extension-runner/src/{v2/model → model}/method-model.d.ts +0 -0
  275. /package/runtime/types/flow-extension-runner/src/{v2/oauth → oauth}/method-names.d.ts +0 -0
  276. /package/runtime/types/flow-extension-runner/src/{v2/oauth → oauth}/oauth2.d.ts +0 -0
  277. /package/runtime/types/flow-extension-runner/src/{v2/oauth → oauth}/system-params.d.ts +0 -0
  278. /package/runtime/types/flow-extension-runner/src/{v2/oauth → oauth}/types.d.ts +0 -0
  279. /package/runtime/types/flow-extension-runner/src/{common/constants.d.ts → params/config-types.d.ts} +0 -0
  280. /package/{dist/types/flow-extension-runner/src/v2 → runtime/types/flow-extension-runner/src}/params/files-options.d.ts +0 -0
  281. /package/runtime/types/flow-extension-runner/src/{v2/params → params}/index.d.ts +0 -0
  282. /package/runtime/types/flow-extension-runner/src/{v2/params → params}/json/checks.d.ts +0 -0
  283. /package/runtime/types/flow-extension-runner/src/{v2/params → params}/json/decode.d.ts +0 -0
  284. /package/runtime/types/flow-extension-runner/src/{v2/params → params}/json/encode.d.ts +0 -0
  285. /package/runtime/types/flow-extension-runner/src/{v2/params → params}/json/types.d.ts +0 -0
  286. /package/runtime/types/flow-extension-runner/src/{v2/params → params}/json/values.d.ts +0 -0
  287. /package/runtime/types/flow-extension-runner/src/{v2/params → params}/method-params.d.ts +0 -0
  288. /package/runtime/types/flow-extension-runner/src/{v2/params → params}/params.d.ts +0 -0
  289. /package/runtime/types/flow-extension-runner/src/{v2/params → params}/schema/assert-object-schema.d.ts +0 -0
  290. /package/runtime/types/flow-extension-runner/src/{v2/params → params}/schema/assert-supported-schema.d.ts +0 -0
  291. /package/runtime/types/flow-extension-runner/src/{v2/params → params}/schema/coerce.d.ts +0 -0
  292. /package/runtime/types/flow-extension-runner/src/{v2/params → params}/schema/date-format.d.ts +0 -0
  293. /package/runtime/types/flow-extension-runner/src/{v2/params → params}/schema/dates.d.ts +0 -0
  294. /package/runtime/types/flow-extension-runner/src/{v2/params → params}/schema/defaults.d.ts +0 -0
  295. /package/runtime/types/flow-extension-runner/src/{v2/params → params}/schema/dictionary-binding.d.ts +0 -0
  296. /package/runtime/types/flow-extension-runner/src/{v2/params → params}/schema/field-plan.d.ts +0 -0
  297. /package/runtime/types/flow-extension-runner/src/{v2/params → params}/schema/introspect.d.ts +0 -0
  298. /package/runtime/types/flow-extension-runner/src/{v2/params → params}/schema/labels.d.ts +0 -0
  299. /package/runtime/types/flow-extension-runner/src/{v2/params → params}/schema/notices.d.ts +0 -0
  300. /package/runtime/types/flow-extension-runner/src/{v2/params → params}/widget-types.d.ts +0 -0
  301. /package/runtime/types/flow-extension-runner/src/{v2/params → params}/zod.d.ts +0 -0
  302. /package/runtime/types/flow-extension-runner/src/{v2/path.d.ts → path.d.ts} +0 -0
  303. /package/runtime/types/flow-extension-runner/src/{v2/polling-triggers → polling-triggers}/mechanisms.d.ts +0 -0
  304. /package/runtime/types/flow-extension-runner/src/{v2/polling-triggers → polling-triggers}/method-names.d.ts +0 -0
  305. /package/runtime/types/flow-extension-runner/src/{v2/polling-triggers → polling-triggers}/polling-triggers.d.ts +0 -0
  306. /package/runtime/types/flow-extension-runner/src/{v2/polling-triggers → polling-triggers}/system-params.d.ts +0 -0
  307. /package/runtime/types/flow-extension-runner/src/{v2/polling-triggers → polling-triggers}/trigger-method.d.ts +0 -0
  308. /package/runtime/types/flow-extension-runner/src/{v2/polling-triggers → polling-triggers}/types.d.ts +0 -0
  309. /package/runtime/types/flow-extension-runner/src/{v2/realtime-triggers → realtime-triggers}/method-names.d.ts +0 -0
  310. /package/runtime/types/flow-extension-runner/src/{v2/realtime-triggers → realtime-triggers}/realtime-setup.d.ts +0 -0
  311. /package/runtime/types/flow-extension-runner/src/{v2/realtime-triggers → realtime-triggers}/system-params.d.ts +0 -0
  312. /package/runtime/types/flow-extension-runner/src/{v2/realtime-triggers → realtime-triggers}/trigger-method.d.ts +0 -0
  313. /package/runtime/types/flow-extension-runner/src/{v2/realtime-triggers → realtime-triggers}/types.d.ts +0 -0
  314. /package/runtime/types/flow-extension-runner/src/{v2/realtime-triggers → realtime-triggers}/verify.d.ts +0 -0
  315. /package/runtime/types/flow-extension-runner/src/{v2/result.d.ts → result.d.ts} +0 -0
  316. /package/runtime/types/flow-extension-runner/src/{v2/system-method.d.ts → system-method.d.ts} +0 -0
package/dist/index.js CHANGED
@@ -8881,11 +8881,11 @@ var require_mime_types = __commonJS({
8881
8881
  }
8882
8882
  return exts[0];
8883
8883
  }
8884
- function lookup(path19) {
8885
- if (!path19 || typeof path19 !== "string") {
8884
+ function lookup(path18) {
8885
+ if (!path18 || typeof path18 !== "string") {
8886
8886
  return false;
8887
8887
  }
8888
- var extension2 = extname("x." + path19).toLowerCase().substr(1);
8888
+ var extension2 = extname("x." + path18).toLowerCase().substr(1);
8889
8889
  if (!extension2) {
8890
8890
  return false;
8891
8891
  }
@@ -10048,11 +10048,11 @@ var require_form_data = __commonJS({
10048
10048
  "use strict";
10049
10049
  var CombinedStream = require_combined_stream();
10050
10050
  var util = require("util");
10051
- var path19 = require("path");
10051
+ var path18 = require("path");
10052
10052
  var http2 = require("http");
10053
10053
  var https = require("https");
10054
10054
  var parseUrl = require("url").parse;
10055
- var fs18 = require("fs");
10055
+ var fs17 = require("fs");
10056
10056
  var crypto3 = require("crypto");
10057
10057
  var mime = require_mime_types();
10058
10058
  var asynckit = require_asynckit();
@@ -10122,7 +10122,7 @@ var require_form_data = __commonJS({
10122
10122
  if (value.end != null && value.end !== Infinity && value.start != null) {
10123
10123
  callback(null, value.end + 1 - (value.start ? value.start : 0));
10124
10124
  } else {
10125
- fs18.stat(value.path, function(err, stat) {
10125
+ fs17.stat(value.path, function(err, stat) {
10126
10126
  var fileSize;
10127
10127
  if (err) {
10128
10128
  callback(err);
@@ -10180,11 +10180,11 @@ var require_form_data = __commonJS({
10180
10180
  FormData2.prototype._getContentDisposition = function(value, options) {
10181
10181
  var filename, contentDisposition;
10182
10182
  if (typeof options.filepath === "string") {
10183
- filename = path19.normalize(options.filepath).replace(/\\/g, "/");
10183
+ filename = path18.normalize(options.filepath).replace(/\\/g, "/");
10184
10184
  } else if (options.filename || value && (value.name || value.path)) {
10185
- filename = path19.basename(options.filename || value && (value.name || value.path));
10185
+ filename = path18.basename(options.filename || value && (value.name || value.path));
10186
10186
  } else if (value && value.readable && hasOwn(value, "httpVersion")) {
10187
- filename = path19.basename(value.client._httpMessage.path || "");
10187
+ filename = path18.basename(value.client._httpMessage.path || "");
10188
10188
  }
10189
10189
  if (filename) {
10190
10190
  contentDisposition = 'filename="' + escapeHeaderParam(filename) + '"';
@@ -10435,15 +10435,15 @@ var require_utils = __commonJS({
10435
10435
  }
10436
10436
  return uriComponent;
10437
10437
  }
10438
- function encodePath(path19) {
10439
- return path19.split("/").map(ensureComponentEncoding).join("/");
10438
+ function encodePath(path18) {
10439
+ return path18.split("/").map(ensureComponentEncoding).join("/");
10440
10440
  }
10441
- function ensureEncoding(path19) {
10441
+ function ensureEncoding(path18) {
10442
10442
  try {
10443
- var url = new URL(path19);
10444
- return url.origin + encodePath(normalizeTrailingSlashInPath(path19, url)) + url.search;
10443
+ var url = new URL(path18);
10444
+ return url.origin + encodePath(normalizeTrailingSlashInPath(path18, url)) + url.search;
10445
10445
  } catch (_unused) {
10446
- return encodePath(path19);
10446
+ return encodePath(path18);
10447
10447
  }
10448
10448
  }
10449
10449
  function normalizeTrailingSlashInPath(originPath, _ref) {
@@ -10798,15 +10798,15 @@ var require_client_node = __commonJS({
10798
10798
  exports2.sendNodeAPIRequest = sendNodeAPIRequest;
10799
10799
  var _utils = require_utils();
10800
10800
  var _error = require_error();
10801
- function sendNodeAPIRequest(path19, method, headers, body, encoding, timeout, withCredentials, tlsOptions) {
10801
+ function sendNodeAPIRequest(path18, method, headers, body, encoding, timeout, withCredentials, tlsOptions) {
10802
10802
  return new Promise(function(resolve, reject) {
10803
- var u = require("url").parse(path19);
10803
+ var u = require("url").parse(path18);
10804
10804
  var form = (0, _utils.isFormData)(body) && body;
10805
10805
  var https = u.protocol === "https:";
10806
10806
  var options = {
10807
10807
  host: u.hostname,
10808
10808
  port: u.port || (https ? 443 : 80),
10809
- path: (0, _utils.normalizeTrailingSlashInPath)(path19, u) + (u.search || ""),
10809
+ path: (0, _utils.normalizeTrailingSlashInPath)(path18, u) + (u.search || ""),
10810
10810
  method,
10811
10811
  headers,
10812
10812
  timeout
@@ -11214,12 +11214,12 @@ var require_request = __commonJS({
11214
11214
  var Request = exports2.Request = /* @__PURE__ */ (function(_EventEmitter) {
11215
11215
  _inherits(Request2, _EventEmitter);
11216
11216
  var _super = _createSuper(Request2);
11217
- function Request2(path19, method, body) {
11217
+ function Request2(path18, method, body) {
11218
11218
  var _this;
11219
11219
  _classCallCheck(this, Request2);
11220
11220
  _this = _super.call(this);
11221
11221
  _this.method = method;
11222
- _this.path = (0, _utils.ensureEncoding)(path19);
11222
+ _this.path = (0, _utils.ensureEncoding)(path18);
11223
11223
  _this.body = body;
11224
11224
  _this.unwrap = true;
11225
11225
  _this.raw = false;
@@ -11448,10 +11448,10 @@ var require_request = __commonJS({
11448
11448
  value: function send(body) {
11449
11449
  var _this2 = this;
11450
11450
  this.emit(REQUEST_EVENT, this);
11451
- var path19 = this.path;
11451
+ var path18 = this.path;
11452
11452
  var queryString = qs.stringify(this.queryParams);
11453
11453
  if (queryString) {
11454
- path19 += "?" + queryString;
11454
+ path18 += "?" + queryString;
11455
11455
  }
11456
11456
  if (!(0, _utils.isFormData)(body) && (0, _utils.isWebFormData)(body)) {
11457
11457
  body = toRequestFormData(body);
@@ -11468,11 +11468,11 @@ var require_request = __commonJS({
11468
11468
  return _this2.unwrap ? res.body : res;
11469
11469
  };
11470
11470
  if (Request2.verbose) {
11471
- console.log(this.method.toUpperCase(), decodeURIComponent(path19), body, this.headers);
11471
+ console.log(this.method.toUpperCase(), decodeURIComponent(path18), body, this.headers);
11472
11472
  }
11473
11473
  var withCredentials = typeof this.withCredentials === "boolean" ? this.withCredentials : Request2.withCredentials;
11474
11474
  var syncError = new Error();
11475
- var request = Request2.send(path19, this.method.toUpperCase(), this.headers, body, this.encoding, this.timeout, withCredentials, this.tlsOptions).then(function(res) {
11475
+ var request = Request2.send(path18, this.method.toUpperCase(), this.headers, body, this.encoding, this.timeout, withCredentials, this.tlsOptions).then(function(res) {
11476
11476
  return parseBody(res, _this2.raw);
11477
11477
  }).then(function(res) {
11478
11478
  return ensureRawBody(res, _this2.raw);
@@ -11581,14 +11581,14 @@ var require_client_browser = __commonJS({
11581
11581
  });
11582
11582
  exports2.sendXmlHttpRequest = sendXmlHttpRequest;
11583
11583
  var _request2 = require_request();
11584
- function sendXmlHttpRequest(path19, method, headers, body, encoding, timeout, withCredentials) {
11584
+ function sendXmlHttpRequest(path18, method, headers, body, encoding, timeout, withCredentials) {
11585
11585
  return new Promise(function sendRequest(resolve, reject) {
11586
11586
  var request = new _request2.Request.XMLHttpRequest();
11587
11587
  request.timeout = timeout;
11588
11588
  if (!encoding) {
11589
11589
  request.responseType = "arraybuffer";
11590
11590
  }
11591
- request.open(method.toUpperCase(), path19, true);
11591
+ request.open(method.toUpperCase(), path18, true);
11592
11592
  if (typeof withCredentials === "boolean") {
11593
11593
  request.withCredentials = withCredentials;
11594
11594
  }
@@ -11661,16 +11661,16 @@ var require_lib = __commonJS({
11661
11661
  }
11662
11662
  });
11663
11663
  _request.Request.XMLHttpRequest = typeof XMLHttpRequest !== "undefined" ? XMLHttpRequest : void 0;
11664
- _request.Request.send = function(path19, method, headers, body, encoding, timeout, withCredentials, tlsOptions) {
11664
+ _request.Request.send = function(path18, method, headers, body, encoding, timeout, withCredentials, tlsOptions) {
11665
11665
  var sender = typeof _request.Request.XMLHttpRequest !== "undefined" ? _clientBrowser.sendXmlHttpRequest : _clientNode.sendNodeAPIRequest;
11666
- return sender(path19, method, headers, body, encoding, timeout, withCredentials, tlsOptions);
11666
+ return sender(path18, method, headers, body, encoding, timeout, withCredentials, tlsOptions);
11667
11667
  };
11668
11668
  _request.Request.verbose = false;
11669
11669
  _request.Request.withCredentials = false;
11670
11670
  _request.Request.methods = ["get", "post", "put", "patch", "delete", "head", "options"];
11671
11671
  _request.Request.methods.forEach(function(method) {
11672
- _request.Request[method] = function(path19, body) {
11673
- return new _request.Request(path19, method, body);
11672
+ _request.Request[method] = function(path18, body) {
11673
+ return new _request.Request(path18, method, body);
11674
11674
  };
11675
11675
  });
11676
11676
  exports2 = module2.exports = _request.Request;
@@ -12011,25 +12011,25 @@ var require_utils2 = __commonJS({
12011
12011
  }
12012
12012
  mkdirSync(folder);
12013
12013
  };
12014
- Utils.prototype.writeFileTo = function(path19, content, overwrite, attr) {
12014
+ Utils.prototype.writeFileTo = function(path18, content, overwrite, attr) {
12015
12015
  const self = this;
12016
- if (self.fs.existsSync(path19)) {
12016
+ if (self.fs.existsSync(path18)) {
12017
12017
  if (!overwrite) return false;
12018
- var stat = self.fs.statSync(path19);
12018
+ var stat = self.fs.statSync(path18);
12019
12019
  if (stat.isDirectory()) {
12020
12020
  return false;
12021
12021
  }
12022
12022
  }
12023
- var folder = pth.dirname(path19);
12023
+ var folder = pth.dirname(path18);
12024
12024
  if (!self.fs.existsSync(folder)) {
12025
12025
  self.makeDir(folder);
12026
12026
  }
12027
12027
  var fd;
12028
12028
  try {
12029
- fd = self.fs.openSync(path19, "w", 438);
12029
+ fd = self.fs.openSync(path18, "w", 438);
12030
12030
  } catch (e) {
12031
- self.fs.chmodSync(path19, 438);
12032
- fd = self.fs.openSync(path19, "w", 438);
12031
+ self.fs.chmodSync(path18, 438);
12032
+ fd = self.fs.openSync(path18, "w", 438);
12033
12033
  }
12034
12034
  if (fd) {
12035
12035
  try {
@@ -12038,22 +12038,22 @@ var require_utils2 = __commonJS({
12038
12038
  self.fs.closeSync(fd);
12039
12039
  }
12040
12040
  }
12041
- self.fs.chmodSync(path19, attr || 438);
12041
+ self.fs.chmodSync(path18, attr || 438);
12042
12042
  return true;
12043
12043
  };
12044
- Utils.prototype.writeFileToAsync = function(path19, content, overwrite, attr, callback) {
12044
+ Utils.prototype.writeFileToAsync = function(path18, content, overwrite, attr, callback) {
12045
12045
  if (typeof attr === "function") {
12046
12046
  callback = attr;
12047
12047
  attr = void 0;
12048
12048
  }
12049
12049
  const self = this;
12050
- self.fs.exists(path19, function(exist) {
12050
+ self.fs.exists(path18, function(exist) {
12051
12051
  if (exist && !overwrite) return callback(false);
12052
- self.fs.stat(path19, function(err, stat) {
12052
+ self.fs.stat(path18, function(err, stat) {
12053
12053
  if (exist && stat && stat.isDirectory()) {
12054
12054
  return callback(false);
12055
12055
  }
12056
- var folder = pth.dirname(path19);
12056
+ var folder = pth.dirname(path18);
12057
12057
  self.fs.exists(folder, function(exists) {
12058
12058
  if (!exists) {
12059
12059
  try {
@@ -12066,16 +12066,16 @@ var require_utils2 = __commonJS({
12066
12066
  self.fs.write(fd, content, 0, content.length, 0, function(writeErr) {
12067
12067
  self.fs.close(fd, function() {
12068
12068
  if (writeErr) return callback(false);
12069
- self.fs.chmod(path19, attr || 438, function() {
12069
+ self.fs.chmod(path18, attr || 438, function() {
12070
12070
  callback(true);
12071
12071
  });
12072
12072
  });
12073
12073
  });
12074
12074
  };
12075
- self.fs.open(path19, "w", 438, function(err2, fd) {
12075
+ self.fs.open(path18, "w", 438, function(err2, fd) {
12076
12076
  if (err2) {
12077
- self.fs.chmod(path19, 438, function() {
12078
- self.fs.open(path19, "w", 438, function(retryErr, fd2) {
12077
+ self.fs.chmod(path18, 438, function() {
12078
+ self.fs.open(path18, "w", 438, function(retryErr, fd2) {
12079
12079
  if (retryErr || !fd2) return callback(false);
12080
12080
  writeToFd(fd2);
12081
12081
  });
@@ -12111,10 +12111,10 @@ var require_utils2 = __commonJS({
12111
12111
  if (stat.isSymbolicLink()) throw Errors.FILE_IN_THE_WAY(`"${cur}"`);
12112
12112
  }
12113
12113
  };
12114
- Utils.prototype.findFiles = function(path19) {
12114
+ Utils.prototype.findFiles = function(path18) {
12115
12115
  const self = this;
12116
12116
  const canLstat = typeof self.fs.lstatSync === "function";
12117
- const rootReal = self.fs.realpathSync(path19);
12117
+ const rootReal = self.fs.realpathSync(path18);
12118
12118
  function escapesRoot(p) {
12119
12119
  if (!canLstat) return false;
12120
12120
  if (!self.fs.lstatSync(p).isSymbolicLink()) return false;
@@ -12133,23 +12133,23 @@ var require_utils2 = __commonJS({
12133
12133
  }
12134
12134
  let files = [];
12135
12135
  self.fs.readdirSync(dir).forEach(function(file) {
12136
- const path20 = pth.join(dir, file);
12137
- if (escapesRoot(path20)) return;
12138
- const stat = self.fs.statSync(path20);
12139
- if (!pattern || pattern.test(path20)) {
12140
- files.push(pth.normalize(path20) + (stat.isDirectory() ? self.sep : ""));
12136
+ const path19 = pth.join(dir, file);
12137
+ if (escapesRoot(path19)) return;
12138
+ const stat = self.fs.statSync(path19);
12139
+ if (!pattern || pattern.test(path19)) {
12140
+ files.push(pth.normalize(path19) + (stat.isDirectory() ? self.sep : ""));
12141
12141
  }
12142
12142
  if (stat.isDirectory() && recursive) {
12143
- const realDir = self.fs.realpathSync(path20);
12143
+ const realDir = self.fs.realpathSync(path19);
12144
12144
  if (!visited.has(realDir)) {
12145
12145
  visited.add(realDir);
12146
- files = files.concat(findSync(path20, pattern, recursive, visited));
12146
+ files = files.concat(findSync(path19, pattern, recursive, visited));
12147
12147
  }
12148
12148
  }
12149
12149
  });
12150
12150
  return files;
12151
12151
  }
12152
- return findSync(path19, void 0, true, /* @__PURE__ */ new Set([rootReal]));
12152
+ return findSync(path18, void 0, true, /* @__PURE__ */ new Set([rootReal]));
12153
12153
  };
12154
12154
  Utils.prototype.findFilesAsync = function(dir, cb) {
12155
12155
  const self = this;
@@ -12246,14 +12246,14 @@ var require_utils2 = __commonJS({
12246
12246
  return "UNSUPPORTED (" + method + ")";
12247
12247
  }
12248
12248
  };
12249
- Utils.canonical = function(path19) {
12250
- if (!path19) return "";
12251
- const safeSuffix = pth.posix.normalize("/" + path19.split("\\").join("/"));
12249
+ Utils.canonical = function(path18) {
12250
+ if (!path18) return "";
12251
+ const safeSuffix = pth.posix.normalize("/" + path18.split("\\").join("/"));
12252
12252
  return pth.join(".", safeSuffix);
12253
12253
  };
12254
- Utils.zipnamefix = function(path19) {
12255
- if (!path19) return "";
12256
- const safeSuffix = pth.posix.normalize("/" + path19.split("\\").join("/"));
12254
+ Utils.zipnamefix = function(path18) {
12255
+ if (!path18) return "";
12256
+ const safeSuffix = pth.posix.normalize("/" + path18.split("\\").join("/"));
12257
12257
  return pth.posix.join(".", safeSuffix);
12258
12258
  };
12259
12259
  Utils.findLast = function(arr, callback) {
@@ -12270,9 +12270,9 @@ var require_utils2 = __commonJS({
12270
12270
  prefix = pth.resolve(pth.normalize(prefix));
12271
12271
  var parts = name.split("/");
12272
12272
  for (var i = 0, l = parts.length; i < l; i++) {
12273
- var path19 = pth.normalize(pth.join(prefix, parts.slice(i, l).join(pth.sep)));
12274
- if (path19 === prefix || path19.startsWith(prefix + pth.sep)) {
12275
- return path19;
12273
+ var path18 = pth.normalize(pth.join(prefix, parts.slice(i, l).join(pth.sep)));
12274
+ if (path18 === prefix || path18.startsWith(prefix + pth.sep)) {
12275
+ return path18;
12276
12276
  }
12277
12277
  }
12278
12278
  return pth.normalize(pth.join(prefix, pth.basename(name)));
@@ -12322,8 +12322,8 @@ var require_utils2 = __commonJS({
12322
12322
  var require_fattr = __commonJS({
12323
12323
  "node_modules/adm-zip/util/fattr.js"(exports2, module2) {
12324
12324
  var pth = require("path");
12325
- module2.exports = function(path19, { fs: fs18 }) {
12326
- var _path = path19 || "", _obj = newAttr(), _stat = null;
12325
+ module2.exports = function(path18, { fs: fs17 }) {
12326
+ var _path = path18 || "", _obj = newAttr(), _stat = null;
12327
12327
  function newAttr() {
12328
12328
  return {
12329
12329
  directory: false,
@@ -12334,8 +12334,8 @@ var require_fattr = __commonJS({
12334
12334
  atime: 0
12335
12335
  };
12336
12336
  }
12337
- if (_path && fs18.existsSync(_path)) {
12338
- _stat = fs18.statSync(_path);
12337
+ if (_path && fs17.existsSync(_path)) {
12338
+ _stat = fs17.statSync(_path);
12339
12339
  _obj.directory = _stat.isDirectory();
12340
12340
  _obj.mtime = _stat.mtime;
12341
12341
  _obj.atime = _stat.atime;
@@ -14790,8 +14790,8 @@ var HttpError = class extends CliError {
14790
14790
  };
14791
14791
 
14792
14792
  // src/operations/deploy/index.ts
14793
- var import_fs7 = __toESM(require("fs"));
14794
- var import_path11 = __toESM(require("path"));
14793
+ var import_fs6 = __toESM(require("fs"));
14794
+ var import_path10 = __toESM(require("path"));
14795
14795
 
14796
14796
  // src/api/console-client.ts
14797
14797
  function authorizeUrl({ serverUrl, callbackUrl, workspaceId }) {
@@ -14990,8 +14990,8 @@ function emitter(options) {
14990
14990
  }
14991
14991
 
14992
14992
  // src/operations/deploy/discover-services.ts
14993
- var import_fs4 = __toESM(require("fs"));
14994
- var import_path7 = __toESM(require("path"));
14993
+ var import_fs3 = __toESM(require("fs"));
14994
+ var import_path6 = __toESM(require("path"));
14995
14995
 
14996
14996
  // ../../flow-extension-runner/src/namespace.ts
14997
14997
  var import_backendless_request2 = __toESM(require_lib());
@@ -15036,9 +15036,9 @@ var FlowExtensionErrorCodes = {
15036
15036
  DUPLICATE_ITEM_ID: "FR_EXT_DUPLICATE_ITEM_ID",
15037
15037
  // No v2 extension registered for the given serviceId after requiring the module.
15038
15038
  EXTENSION_NOT_REGISTERED: "FR_EXT_NOT_REGISTERED",
15039
- // A declared config value is missing or the wrong shape (see v2/schema/normalize).
15039
+ // A declared config value is missing or the wrong shape (see params/schema/normalize).
15040
15040
  INVALID_CONFIG: "FR_EXT_INVALID_CONFIG",
15041
- // A schema slot that must be a z.object was declared as something else (see v2/schema/assert-object-schema).
15041
+ // A schema slot that must be a z.object was declared as something else (see params/schema/assert-object-schema).
15042
15042
  INVALID_SCHEMA: "FR_EXT_INVALID_SCHEMA",
15043
15043
  // A polling trigger declared zero or multiple mechanisms, or is missing its fetch.
15044
15044
  INVALID_TRIGGER_CONFIG: "FR_EXT_INVALID_TRIGGER_CONFIG",
@@ -15133,7 +15133,7 @@ var InvalidConfigError = class extends FlowExtensionError {
15133
15133
  };
15134
15134
  var InvalidSchemaError = class extends FlowExtensionError {
15135
15135
  // `message` is composed by the guard, which knows how to describe what was received and what to do
15136
- // about it (see v2/schema/assert-object-schema.ts).
15136
+ // about it (see params/schema/assert-object-schema.ts).
15137
15137
  constructor(message, details) {
15138
15138
  super(FlowExtensionErrorCodes.INVALID_SCHEMA, 400, message, details);
15139
15139
  }
@@ -15185,12 +15185,12 @@ var InvalidDictionaryOutputScheme = class extends FlowExtensionError {
15185
15185
  }
15186
15186
  };
15187
15187
 
15188
- // ../../flow-extension-runner/src/v2/loaders/loader-owner.ts
15188
+ // ../../flow-extension-runner/src/loaders/loader-owner.ts
15189
15189
  var sampleResultLoaderName = (ownerId) => `${ownerId}_SampleResultLoader`;
15190
15190
  var dynamicParamsLoaderName = (ownerId) => `${ownerId}_DynamicParams`;
15191
15191
  var dynamicPropsLoaderName = (ownerId, field) => `${ownerId}_${field}_DynamicProps`;
15192
15192
 
15193
- // ../../flow-extension-runner/src/v2/params/schema/assert-object-schema.ts
15193
+ // ../../flow-extension-runner/src/params/schema/assert-object-schema.ts
15194
15194
  var WRAPPERS = /* @__PURE__ */ new Set(["optional", "nullable", "nullish", "default", "prefault"]);
15195
15195
  var typeOf = (value) => value?._zod?.def?.type;
15196
15196
  function describe(value) {
@@ -15239,7 +15239,7 @@ function assertObjectSchema(scheme, source) {
15239
15239
  );
15240
15240
  }
15241
15241
 
15242
- // ../../flow-extension-runner/src/v2/params/widget-types.ts
15242
+ // ../../flow-extension-runner/src/params/widget-types.ts
15243
15243
  var FlowExtensionParamGroupTypes = {
15244
15244
  FILE_UPLOAD_OPTIONS: "FILE_UPLOAD_OPTIONS",
15245
15245
  FILE_LIST_OPTIONS: "FILE_LIST_OPTIONS",
@@ -15266,7 +15266,7 @@ var FlowExtensionParamWidgetTypes = {
15266
15266
  TIME_PICKER: "TIME_PICKER"
15267
15267
  };
15268
15268
 
15269
- // ../../flow-extension-runner/src/v2/params/schema/introspect.ts
15269
+ // ../../flow-extension-runner/src/params/schema/introspect.ts
15270
15270
  var OPTIONAL_WRAPPERS = /* @__PURE__ */ new Set(["optional", "nullable", "nullish"]);
15271
15271
  var DEFAULT_WRAPPERS = /* @__PURE__ */ new Set(["default", "prefault"]);
15272
15272
  var TRANSPARENT_WRAPPERS = /* @__PURE__ */ new Set(["readonly", "pipe", "lazy"]);
@@ -15422,7 +15422,7 @@ function shapeEntries(schema) {
15422
15422
  return shape && typeof shape === "object" ? Object.entries(shape) : [];
15423
15423
  }
15424
15424
 
15425
- // ../../flow-extension-runner/src/v2/params/schema/date-format.ts
15425
+ // ../../flow-extension-runner/src/params/schema/date-format.ts
15426
15426
  var ISO_PATTERNS = {
15427
15427
  date: "yyyy-MM-dd",
15428
15428
  datetime: "yyyy-MM-dd'T'HH:mm",
@@ -15768,7 +15768,7 @@ function hasDateFormat(schema, seen = /* @__PURE__ */ new Set()) {
15768
15768
  return children.some((child) => hasDateFormat(child, seen));
15769
15769
  }
15770
15770
 
15771
- // ../../flow-extension-runner/src/v2/params/schema/dictionary-binding.ts
15771
+ // ../../flow-extension-runner/src/params/schema/dictionary-binding.ts
15772
15772
  var DictionaryScope = class _DictionaryScope {
15773
15773
  constructor(top, visible) {
15774
15774
  this.top = top;
@@ -15801,7 +15801,7 @@ function publishedBinding(binding, scope2) {
15801
15801
  return { id: binding.id, dependsOn: resolveDependsOn(binding, scope2).dependsOn };
15802
15802
  }
15803
15803
 
15804
- // ../../flow-extension-runner/src/v2/params/schema/assert-supported-schema.ts
15804
+ // ../../flow-extension-runner/src/params/schema/assert-supported-schema.ts
15805
15805
  var GUARDED_KINDS = /* @__PURE__ */ new Set(["action", "dictionary", "polling trigger", "realtime trigger", "extension"]);
15806
15806
  var SUPPORTED_TYPES = /* @__PURE__ */ new Set([
15807
15807
  "string",
@@ -15822,31 +15822,31 @@ var SUPPORTED_TYPES = /* @__PURE__ */ new Set([
15822
15822
  ]);
15823
15823
  var SUPPORTED_SPELLING = "z.string(), z.number(), z.bigint(), z.boolean(), z.date(), z.enum([\u2026]), z.literal(\u2026), z.object({ \u2026 }), z.array(\u2026), z.record(\u2026), z.union([\u2026]), z.null(), z.any(), z.unknown()";
15824
15824
  var MODIFIER_SPELLING = ".optional(), .nullable(), .nullish(), .default(v), .prefault(v), .readonly(), .nonoptional(), .pipe(\u2026)/.transform(\u2026) and z.lazy(\u2026)";
15825
- function subjectOf(source, path19) {
15825
+ function subjectOf(source, path18) {
15826
15826
  const kind = source.kind ?? "extension";
15827
15827
  const subject = source.itemId ? `${kind} "${source.itemId}": ` : "";
15828
- return `${subject}\`${path19}\``;
15828
+ return `${subject}\`${path18}\``;
15829
15829
  }
15830
- function refuse(message, source, path19, received) {
15830
+ function refuse(message, source, path18, received) {
15831
15831
  throw new InvalidSchemaError(
15832
15832
  `[flow-extension:${source.serviceId}] ${message}`,
15833
- { serviceId: source.serviceId, kind: source.kind ?? "extension", itemId: source.itemId, slot: source.slot, path: path19, received }
15833
+ { serviceId: source.serviceId, kind: source.kind ?? "extension", itemId: source.itemId, slot: source.slot, path: path18, received }
15834
15834
  );
15835
15835
  }
15836
- function refuseCatch(source, path19) {
15836
+ function refuseCatch(source, path18) {
15837
15837
  refuse(
15838
- `${subjectOf(source, path19)} uses \`.catch(\u2026)\`, which a parameter may not: it replaces an invalid value with the fallback instead of reporting it, and drops the field out of type coercion. Use \`.default(v)\` \u2014 same fallback when the value is absent, and a supplied-but-invalid one still fails.`,
15838
+ `${subjectOf(source, path18)} uses \`.catch(\u2026)\`, which a parameter may not: it replaces an invalid value with the fallback instead of reporting it, and drops the field out of type coercion. Use \`.default(v)\` \u2014 same fallback when the value is absent, and a supplied-but-invalid one still fails.`,
15839
15839
  source,
15840
- path19,
15840
+ path18,
15841
15841
  "catch"
15842
15842
  );
15843
15843
  }
15844
- function refuseType(source, path19, type) {
15844
+ function refuseType(source, path18, type) {
15845
15845
  const received = type ? `z.${type}()` : "a value that is not a zod schema";
15846
15846
  refuse(
15847
- `${subjectOf(source, path19)} declares ${received}, which the runtime cannot publish as a parameter \u2014 it has no widget, no published type and no coercion for it. Supported: ${SUPPORTED_SPELLING}; each may carry ${MODIFIER_SPELLING}.`,
15847
+ `${subjectOf(source, path18)} declares ${received}, which the runtime cannot publish as a parameter \u2014 it has no widget, no published type and no coercion for it. Supported: ${SUPPORTED_SPELLING}; each may carry ${MODIFIER_SPELLING}.`,
15848
15848
  source,
15849
- path19,
15849
+ path18,
15850
15850
  type ?? "unknown"
15851
15851
  );
15852
15852
  }
@@ -15862,7 +15862,7 @@ function isLooseObject(schema) {
15862
15862
  function isDynamicPropsSlot(source, topLevel) {
15863
15863
  return topLevel && source.kind === "action" && source.slot === "params";
15864
15864
  }
15865
- function assertDynamicProps(schema, name, siblings, source, path19) {
15865
+ function assertDynamicProps(schema, name, siblings, source, path18) {
15866
15866
  const ins = inspect(schema);
15867
15867
  const spec = ins.meta.frDynamicProps;
15868
15868
  if (!spec) {
@@ -15873,49 +15873,49 @@ function assertDynamicProps(schema, name, siblings, source, path19) {
15873
15873
  }
15874
15874
  if (typeof spec.execute !== "function") {
15875
15875
  refuse(
15876
- `${subjectOf(source, path19)}: \`.dynamicProps()\` needs an \`execute\` function that returns the loaded fields.`,
15876
+ `${subjectOf(source, path18)}: \`.dynamicProps()\` needs an \`execute\` function that returns the loaded fields.`,
15877
15877
  source,
15878
- path19,
15878
+ path18,
15879
15879
  typeof spec.execute
15880
15880
  );
15881
15881
  }
15882
15882
  if (spec.dependsOn !== void 0 && (!Array.isArray(spec.dependsOn) || spec.dependsOn.some((item) => typeof item !== "string"))) {
15883
15883
  refuse(
15884
- `${subjectOf(source, path19)}: \`.dynamicProps()\` \`dependsOn\` must be an array of param names.`,
15884
+ `${subjectOf(source, path18)}: \`.dynamicProps()\` \`dependsOn\` must be an array of param names.`,
15885
15885
  source,
15886
- path19,
15886
+ path18,
15887
15887
  "dependsOn"
15888
15888
  );
15889
15889
  }
15890
15890
  for (const dependency of spec.dependsOn ?? []) {
15891
15891
  if (dependency === name || !siblings.includes(dependency)) {
15892
15892
  refuse(
15893
- `${subjectOf(source, path19)}: \`.dynamicProps()\` depends on "${dependency}", which is not another param of this action. Name its sibling params: ${siblings.filter((sibling) => sibling !== name).join(", ") || "none"}.`,
15893
+ `${subjectOf(source, path18)}: \`.dynamicProps()\` depends on "${dependency}", which is not another param of this action. Name its sibling params: ${siblings.filter((sibling) => sibling !== name).join(", ") || "none"}.`,
15894
15894
  source,
15895
- path19,
15895
+ path18,
15896
15896
  dependency
15897
15897
  );
15898
15898
  }
15899
15899
  }
15900
15900
  if (ins.meta.frDictionary) {
15901
15901
  refuse(
15902
- `${subjectOf(source, path19)} declares both \`.dynamicProps()\` and \`.dictionary()\`. A dictionary offers values for one field; dynamic props load the fields inside an object \u2014 use one or the other.`,
15902
+ `${subjectOf(source, path18)} declares both \`.dynamicProps()\` and \`.dictionary()\`. A dictionary offers values for one field; dynamic props load the fields inside an object \u2014 use one or the other.`,
15903
15903
  source,
15904
- path19,
15904
+ path18,
15905
15905
  "dictionary"
15906
15906
  );
15907
15907
  }
15908
15908
  const element = ins.resolvedType === "array" ? ins.core?._zod?.def?.element : void 0;
15909
15909
  if (!isLooseObject(schema) && !isLooseObject(element)) {
15910
15910
  refuse(
15911
- `${subjectOf(source, path19)}: \`.dynamicProps()\` needs a loose object \u2014 the loaded fields are not declared, so a plain \`z.object()\` would strip them. ${DYNAMIC_PROPS_FIX}`,
15911
+ `${subjectOf(source, path18)}: \`.dynamicProps()\` needs a loose object \u2014 the loaded fields are not declared, so a plain \`z.object()\` would strip them. ${DYNAMIC_PROPS_FIX}`,
15912
15912
  source,
15913
- path19,
15913
+ path18,
15914
15914
  ins.resolvedType ?? "unknown"
15915
15915
  );
15916
15916
  }
15917
15917
  }
15918
- function assertDictionaryBinding(schema, source, path19, scope2) {
15918
+ function assertDictionaryBinding(schema, source, path18, scope2) {
15919
15919
  const binding = inspect(schema).meta.frDictionary;
15920
15920
  if (!binding) {
15921
15921
  return;
@@ -15923,14 +15923,14 @@ function assertDictionaryBinding(schema, source, path19, scope2) {
15923
15923
  const { clash } = resolveDependsOn(binding, scope2);
15924
15924
  if (clash) {
15925
15925
  refuse(
15926
- `${subjectOf(source, path19)} uses dictionary "${binding.id}", whose criteria "${clash.key}" can come from ${clash.names.map((name) => `"${name}"`).join(" or ")} \u2014 and this field can see all of them, so the dictionary cannot tell which one is meant. Rename one of the params, or bind this field to a dictionary without that alias.`,
15926
+ `${subjectOf(source, path18)} uses dictionary "${binding.id}", whose criteria "${clash.key}" can come from ${clash.names.map((name) => `"${name}"`).join(" or ")} \u2014 and this field can see all of them, so the dictionary cannot tell which one is meant. Rename one of the params, or bind this field to a dictionary without that alias.`,
15927
15927
  source,
15928
- path19,
15928
+ path18,
15929
15929
  clash.names.join(", ")
15930
15930
  );
15931
15931
  }
15932
15932
  }
15933
- function assertDateString(schema, source, path19) {
15933
+ function assertDateString(schema, source, path18) {
15934
15934
  const ins = inspect(schema);
15935
15935
  const pattern = ins.meta.frDateFormat;
15936
15936
  const kind = dateStringKind(ins);
@@ -15938,9 +15938,9 @@ function assertDateString(schema, source, path19) {
15938
15938
  const format = ins.core?._zod?.def?.format;
15939
15939
  const zoned = ins.coreType === "string" && format === "datetime";
15940
15940
  refuse(
15941
- `${subjectOf(source, path19)} 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.`,
15941
+ `${subjectOf(source, path18)} uses \`.dateFormat()\` on ${zoned ? "z.iso.datetime() with a zone \u2014 an instant, not a wall clock" : "a type that is not a date string"}. Only z.iso.date(), z.iso.datetime({ local: true }) and z.iso.time() take a format.`,
15942
15942
  source,
15943
- path19,
15943
+ path18,
15944
15944
  zoned ? "datetime" : ins.resolvedType ?? "unknown"
15945
15945
  );
15946
15946
  }
@@ -15952,7 +15952,7 @@ function assertDateString(schema, source, path19) {
15952
15952
  compilePattern(pattern, kind);
15953
15953
  } catch (error) {
15954
15954
  if (error instanceof DateFormatError) {
15955
- refuse(`${subjectOf(source, path19)}: \`.dateFormat('${pattern}')\` ${error.message}.`, source, path19, pattern);
15955
+ refuse(`${subjectOf(source, path18)}: \`.dateFormat('${pattern}')\` ${error.message}.`, source, path18, pattern);
15956
15956
  }
15957
15957
  throw error;
15958
15958
  }
@@ -15965,14 +15965,14 @@ function assertDateString(schema, source, path19) {
15965
15965
  const fits = typeof fallback === "string" && (pattern !== void 0 ? !!parseInPattern(fallback, pattern, kind) : ((parts) => !!parts && toCanonical(parts, kind) === fallback)(parseIso(fallback, kind)));
15966
15966
  if (!fits) {
15967
15967
  refuse(
15968
- `${subjectOf(source, path19)} 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.`,
15968
+ `${subjectOf(source, path18)} has the default ${JSON.stringify(fallback)}, which is not written in ${written.replace(/'T'/, "T")} \u2014 a default is handed to \`execute\` as written, so write it in the field's own format.`,
15969
15969
  source,
15970
- path19,
15970
+ path18,
15971
15971
  String(fallback)
15972
15972
  );
15973
15973
  }
15974
15974
  }
15975
- function assertField(schema, source, path19, seen, scope2, topLevel = false) {
15975
+ function assertField(schema, source, path18, seen, scope2, topLevel = false) {
15976
15976
  if (!schema || seen.has(schema)) {
15977
15977
  return;
15978
15978
  }
@@ -15980,35 +15980,35 @@ function assertField(schema, source, path19, seen, scope2, topLevel = false) {
15980
15980
  const ins = inspect(schema);
15981
15981
  if (ins.meta.frDynamicProps && !isDynamicPropsSlot(source, topLevel)) {
15982
15982
  refuse(
15983
- `${subjectOf(source, path19)} uses \`.dynamicProps()\`, which is supported on top-level action params only. For a list of objects, put it on the array rather than on its element.`,
15983
+ `${subjectOf(source, path18)} uses \`.dynamicProps()\`, which is supported on top-level action params only. For a list of objects, put it on the array rather than on its element.`,
15984
15984
  source,
15985
- path19,
15985
+ path18,
15986
15986
  "dynamicProps"
15987
15987
  );
15988
15988
  }
15989
15989
  if (ins.resolvedType === "catch") {
15990
- refuseCatch(source, path19);
15990
+ refuseCatch(source, path18);
15991
15991
  }
15992
- assertDictionaryBinding(schema, source, path19, scope2);
15993
- assertDateString(schema, source, path19);
15992
+ assertDictionaryBinding(schema, source, path18, scope2);
15993
+ assertDateString(schema, source, path18);
15994
15994
  if (!ins.resolvedType || !SUPPORTED_TYPES.has(ins.resolvedType)) {
15995
- refuseType(source, path19, ins.resolvedType);
15995
+ refuseType(source, path18, ins.resolvedType);
15996
15996
  }
15997
15997
  if (ins.branches) {
15998
- ins.branches.forEach((branch, index) => assertField(branch, source, `${path19}|branch ${index + 1}`, seen, scope2));
15998
+ ins.branches.forEach((branch, index) => assertField(branch, source, `${path18}|branch ${index + 1}`, seen, scope2));
15999
15999
  }
16000
16000
  const def = ins.core._zod?.def ?? {};
16001
16001
  if (ins.resolvedType === "array") {
16002
- assertField(def.element, source, `${path19}[]`, seen, scope2);
16002
+ assertField(def.element, source, `${path18}[]`, seen, scope2);
16003
16003
  }
16004
16004
  if (ins.resolvedType === "record") {
16005
- assertField(def.valueType, source, `${path19}{}`, seen, scope2);
16005
+ assertField(def.valueType, source, `${path18}{}`, seen, scope2);
16006
16006
  }
16007
16007
  if (ins.resolvedType === "object") {
16008
16008
  const properties = shapeEntries(ins.core);
16009
16009
  const inner = scope2.enter(properties.map(([name]) => name));
16010
16010
  for (const [name, property] of properties) {
16011
- assertField(property, source, `${path19}.${name}`, seen, inner);
16011
+ assertField(property, source, `${path18}.${name}`, seen, inner);
16012
16012
  }
16013
16013
  }
16014
16014
  }
@@ -16029,7 +16029,7 @@ function assertSupportedSchema(scheme, source) {
16029
16029
  }
16030
16030
  }
16031
16031
 
16032
- // ../../flow-extension-runner/src/v2/params/schema/dates.ts
16032
+ // ../../flow-extension-runner/src/params/schema/dates.ts
16033
16033
  var DATE_ONLY = /^\d{4}-\d{2}-\d{2}$/;
16034
16034
  var HAS_TIME = /^(\d{4}-\d{2}-\d{2})[T ](.+)$/;
16035
16035
  var ZONE = /(Z|[+-]\d{2}:?\d{2})$/;
@@ -16108,7 +16108,7 @@ function hasPassThroughDate(schema, inspectSchema, entriesOf) {
16108
16108
  return children.some((child) => hasPassThroughDate(child, inspectSchema, entriesOf));
16109
16109
  }
16110
16110
 
16111
- // ../../flow-extension-runner/src/v2/params/schema/labels.ts
16111
+ // ../../flow-extension-runner/src/params/schema/labels.ts
16112
16112
  var ACRONYMS = /* @__PURE__ */ new Set([
16113
16113
  "id",
16114
16114
  "url",
@@ -16142,7 +16142,7 @@ function humanizeKey(name) {
16142
16142
  }
16143
16143
  var labelOf = (name, schema) => inspect(schema).meta.title || humanizeKey(name) || name;
16144
16144
 
16145
- // ../../flow-extension-runner/src/v2/params/schema/field-plan.ts
16145
+ // ../../flow-extension-runner/src/params/schema/field-plan.ts
16146
16146
  function declaredAbsence(schema) {
16147
16147
  let current = schema;
16148
16148
  let acceptsUndefined = false;
@@ -16253,7 +16253,7 @@ function planField(name, schema) {
16253
16253
  };
16254
16254
  }
16255
16255
 
16256
- // ../../flow-extension-runner/src/v2/params/schema/notices.ts
16256
+ // ../../flow-extension-runner/src/params/schema/notices.ts
16257
16257
  var sink;
16258
16258
  var currentField;
16259
16259
  function collectNotices(fn) {
@@ -16280,7 +16280,7 @@ function notice(entry) {
16280
16280
  sink?.push({ field: currentField, ...entry });
16281
16281
  }
16282
16282
 
16283
- // ../../flow-extension-runner/src/v2/params/schema/coerce.ts
16283
+ // ../../flow-extension-runner/src/params/schema/coerce.ts
16284
16284
  var ok = (value) => ({ ok: true, value });
16285
16285
  var fail = (expected) => ({ ok: false, expected });
16286
16286
  var TRUE = /* @__PURE__ */ new Set(["true", "1", "yes", "y", "t", "on", "checked", "enabled", "enable", "active"]);
@@ -16512,7 +16512,7 @@ function absentAs(schema, value) {
16512
16512
  return absence === "null" ? null : void 0;
16513
16513
  }
16514
16514
 
16515
- // ../../flow-extension-runner/src/v2/params/schema/defaults.ts
16515
+ // ../../flow-extension-runner/src/params/schema/defaults.ts
16516
16516
  var WIDGET_DESCRIPTIONS = {
16517
16517
  [FlowExtensionParamWidgetTypes.MULTI_LINE_TEXT]: "Expects text; line breaks are allowed"
16518
16518
  };
@@ -16549,7 +16549,7 @@ var FORMAT_DESCRIPTIONS = {
16549
16549
  cidrv6: "Expects an IPv6 range, e.g. 2001:db8::/32"
16550
16550
  };
16551
16551
 
16552
- // ../../flow-extension-runner/src/v2/params/schema/messages.ts
16552
+ // ../../flow-extension-runner/src/params/schema/messages.ts
16553
16553
  var EXPECTED = {
16554
16554
  string: "a string",
16555
16555
  number: "a number",
@@ -16670,55 +16670,55 @@ function isAuthored(issue) {
16670
16670
  }
16671
16671
  function toFieldIssue(plan2, issue, fieldValue) {
16672
16672
  const segments = (issue.path ?? []).map(String).filter(Boolean);
16673
- const path19 = segments.length ? `${plan2.name}.${segments.join(".")}` : plan2.name;
16673
+ const path18 = segments.length ? `${plan2.name}.${segments.join(".")}` : plan2.name;
16674
16674
  const code = issue.code ?? "custom";
16675
16675
  const target = resolveTarget(plan2, segments, fieldValue);
16676
16676
  const named = { ...plan2, label: target.label };
16677
16677
  if (isAuthored(issue)) {
16678
- return { path: path19, code, message: issue.message };
16678
+ return { path: path18, code, message: issue.message };
16679
16679
  }
16680
16680
  if (code === "invalid_format" && target.schema && inspect(target.schema).branches) {
16681
16681
  const combined = unionPhrases(target.schema, target.value);
16682
16682
  if (combined.length > 1) {
16683
- return { path: path19, code: "invalid_union", message: `\xAB${target.label}\xBB must be ${combined.join(", or ")}` };
16683
+ return { path: path18, code: "invalid_union", message: `\xAB${target.label}\xBB must be ${combined.join(", or ")}` };
16684
16684
  }
16685
16685
  }
16686
16686
  const dateKind = target.schema ? dateStringKind(inspect(target.schema)) : void 0;
16687
16687
  const dateMissing = target.value == null || target.value === "";
16688
16688
  if (dateKind && (code === "invalid_type" || code === "invalid_format")) {
16689
- return dateMissing ? { path: path19, code, message: requiredMessage(named) } : { path: path19, code, message: invalidTypeMessage(named, expectedDateString(inspect(target.schema), dateKind)) };
16689
+ return dateMissing ? { path: path18, code, message: requiredMessage(named) } : { path: path18, code, message: invalidTypeMessage(named, expectedDateString(inspect(target.schema), dateKind)) };
16690
16690
  }
16691
16691
  if (code === "invalid_type") {
16692
16692
  const received = issue.received;
16693
16693
  const absent = segments.length ? target.found && target.value == null : received === "undefined" || received === "null" || issue.expected === void 0;
16694
- return absent ? { path: path19, code, message: requiredMessage(named) } : { path: path19, code, message: invalidTypeMessage(named, issue.expected ?? "") };
16694
+ return absent ? { path: path18, code, message: requiredMessage(named) } : { path: path18, code, message: invalidTypeMessage(named, issue.expected ?? "") };
16695
16695
  }
16696
16696
  if (code === "too_small") {
16697
- return { path: path19, code, message: `\xAB${target.label}\xBB must be at least ${bound(issue.minimum, plan2)}` };
16697
+ return { path: path18, code, message: `\xAB${target.label}\xBB must be at least ${bound(issue.minimum, plan2)}` };
16698
16698
  }
16699
16699
  if (code === "too_big") {
16700
- return { path: path19, code, message: `\xAB${target.label}\xBB must be at most ${bound(issue.maximum, plan2)}` };
16700
+ return { path: path18, code, message: `\xAB${target.label}\xBB must be at most ${bound(issue.maximum, plan2)}` };
16701
16701
  }
16702
16702
  if (code === "invalid_value") {
16703
- return { path: path19, code, message: `\xAB${target.label}\xBB must be ${oneOf(issue.values ?? [])}` };
16703
+ return { path: path18, code, message: `\xAB${target.label}\xBB must be ${oneOf(issue.values ?? [])}` };
16704
16704
  }
16705
16705
  if (code === "invalid_format") {
16706
16706
  const described = FORMAT_DESCRIPTIONS[issue.format ?? ""];
16707
- return described ? { path: path19, code, message: `\xAB${target.label}\xBB is invalid \u2014 ${described.replace(/^Expects /, "expects ")}` } : { path: path19, code, message: `\xAB${target.label}\xBB has an invalid format` };
16707
+ return described ? { path: path18, code, message: `\xAB${target.label}\xBB is invalid \u2014 ${described.replace(/^Expects /, "expects ")}` } : { path: path18, code, message: `\xAB${target.label}\xBB has an invalid format` };
16708
16708
  }
16709
16709
  if (code === "invalid_union") {
16710
16710
  if (segments.length && target.found && target.value == null) {
16711
- return { path: path19, code, message: requiredMessage(named) };
16711
+ return { path: path18, code, message: requiredMessage(named) };
16712
16712
  }
16713
16713
  const combined = unionIssue(plan2, issue, target.schema, target.value, fieldValue);
16714
16714
  if (combined) {
16715
- return combined.path ? combined : { path: path19, code, message: `\xAB${target.label}\xBB ${combined.message}` };
16715
+ return combined.path ? combined : { path: path18, code, message: `\xAB${target.label}\xBB ${combined.message}` };
16716
16716
  }
16717
16717
  }
16718
- return { path: path19, code, message: `\xAB${target.label}\xBB is invalid` };
16718
+ return { path: path18, code, message: `\xAB${target.label}\xBB is invalid` };
16719
16719
  }
16720
16720
 
16721
- // ../../flow-extension-runner/src/v2/params/schema/normalize.ts
16721
+ // ../../flow-extension-runner/src/params/schema/normalize.ts
16722
16722
  var resolved = (value) => ({ value, present: true, issues: [] });
16723
16723
  var rejected = (issues) => ({ present: false, issues });
16724
16724
  function isAbsent(value, plan2) {
@@ -16826,7 +16826,7 @@ function restoreDeep(output, original, schema) {
16826
16826
  }
16827
16827
  var isPlain = (value) => !!value && typeof value === "object" && !Array.isArray(value);
16828
16828
 
16829
- // ../../flow-extension-runner/src/v2/params/schema/parse.ts
16829
+ // ../../flow-extension-runner/src/params/schema/parse.ts
16830
16830
  var EXPECTED2 = {
16831
16831
  string: "a string",
16832
16832
  number: "a number",
@@ -16836,10 +16836,10 @@ var EXPECTED2 = {
16836
16836
  };
16837
16837
  function toIssues(error, param) {
16838
16838
  return (error?.issues ?? []).map((issue) => {
16839
- const path19 = (issue.path ?? []).map(String).join(".");
16839
+ const path18 = (issue.path ?? []).map(String).join(".");
16840
16840
  const expected = issue.expected;
16841
- const restated = param && !path19 && issue.code === "invalid_type" && expected ? `\xAB${param}\xBB must be ${EXPECTED2[expected] ?? expected}` : void 0;
16842
- return { path: path19, message: restated ?? issue.message ?? "invalid value", code: issue.code };
16841
+ const restated = param && !path18 && issue.code === "invalid_type" && expected ? `\xAB${param}\xBB must be ${EXPECTED2[expected] ?? expected}` : void 0;
16842
+ return { path: path18, message: restated ?? issue.message ?? "invalid value", code: issue.code };
16843
16843
  });
16844
16844
  }
16845
16845
  function parseSchema(schema, value, fail2, param) {
@@ -16853,7 +16853,7 @@ function parseSchema(schema, value, fail2, param) {
16853
16853
  return result.data;
16854
16854
  }
16855
16855
 
16856
- // ../../flow-extension-runner/src/v2/params/params.ts
16856
+ // ../../flow-extension-runner/src/params/params.ts
16857
16857
  var Params = class {
16858
16858
  constructor(scheme, source = {}) {
16859
16859
  this.source = source;
@@ -16908,7 +16908,7 @@ var Params = class {
16908
16908
  }
16909
16909
  };
16910
16910
 
16911
- // ../../flow-extension-runner/src/v2/params/config-params.ts
16911
+ // ../../flow-extension-runner/src/params/config-params.ts
16912
16912
  var ConfigParams = class _ConfigParams extends Params {
16913
16913
  static of(scheme, source = {}) {
16914
16914
  return new _ConfigParams(scheme, source);
@@ -16931,7 +16931,7 @@ var ConfigParams = class _ConfigParams extends Params {
16931
16931
  }
16932
16932
  };
16933
16933
 
16934
- // ../../flow-extension-runner/src/v2/params/method-params.ts
16934
+ // ../../flow-extension-runner/src/params/method-params.ts
16935
16935
  var MethodParams = class _MethodParams extends Params {
16936
16936
  static of(scheme, source = {}) {
16937
16937
  return new _MethodParams(scheme, source);
@@ -16957,10 +16957,10 @@ var MethodParams = class _MethodParams extends Params {
16957
16957
  }
16958
16958
  };
16959
16959
 
16960
- // ../../flow-extension-runner/src/v2/params/zod.ts
16960
+ // ../../flow-extension-runner/src/params/zod.ts
16961
16961
  var import_zod2 = require("zod");
16962
16962
 
16963
- // ../../flow-extension-runner/src/v2/params/files-options.ts
16963
+ // ../../flow-extension-runner/src/params/files-options.ts
16964
16964
  var import_zod = require("zod");
16965
16965
  var SCOPE_VALUES = ["WORKSPACE", "FLOW", "EXECUTION"];
16966
16966
  var scope = () => import_zod.z.enum(SCOPE_VALUES).label("Scope").describe("Storage scope: WORKSPACE (shared across flows), FLOW (this flow only), EXECUTION (this run only)").default("FLOW");
@@ -17016,7 +17016,7 @@ function filesDeleteOptions(include) {
17016
17016
  return group("filesDeleteOptions", FlowExtensionParamWidgetTypes.FILE_DELETE_OPTIONS, DELETE_FIELDS, include);
17017
17017
  }
17018
17018
 
17019
- // ../../flow-extension-runner/src/v2/params/zod.ts
17019
+ // ../../flow-extension-runner/src/params/zod.ts
17020
17020
  var extended = false;
17021
17021
  function extendPrototype() {
17022
17022
  if (extended) {
@@ -17087,7 +17087,7 @@ Object.defineProperties(namespace, {
17087
17087
  });
17088
17088
  var z = namespace;
17089
17089
 
17090
- // ../../flow-extension-runner/src/v2/params/json/values.ts
17090
+ // ../../flow-extension-runner/src/params/json/values.ts
17091
17091
  function toJsonValue(value) {
17092
17092
  if (typeof value === "bigint") {
17093
17093
  return { $bigint: value.toString() };
@@ -17104,7 +17104,7 @@ function toJsonValue(value) {
17104
17104
  return value;
17105
17105
  }
17106
17106
 
17107
- // ../../flow-extension-runner/src/v2/params/json/checks.ts
17107
+ // ../../flow-extension-runner/src/params/json/checks.ts
17108
17108
  var defOf = (check) => check?._zod?.def ?? {};
17109
17109
  function messageOf(source) {
17110
17110
  const { error } = source;
@@ -17183,10 +17183,10 @@ function encodeChecks(core) {
17183
17183
  return { checks, unsupported };
17184
17184
  }
17185
17185
 
17186
- // ../../flow-extension-runner/src/v2/params/json/types.ts
17186
+ // ../../flow-extension-runner/src/params/json/types.ts
17187
17187
  var SCHEMA_JSON_VERSION = 1;
17188
17188
 
17189
- // ../../flow-extension-runner/src/v2/params/json/decode.ts
17189
+ // ../../flow-extension-runner/src/params/json/decode.ts
17190
17190
  var FORMAT_FACTORIES = {
17191
17191
  url: z.url,
17192
17192
  email: z.email,
@@ -17216,7 +17216,7 @@ var FORMAT_FACTORIES = {
17216
17216
  duration: z.iso?.duration
17217
17217
  };
17218
17218
 
17219
- // ../../flow-extension-runner/src/v2/params/json/encode.ts
17219
+ // ../../flow-extension-runner/src/params/json/encode.ts
17220
17220
  var FIELD_TYPES = /* @__PURE__ */ new Set([
17221
17221
  "string",
17222
17222
  "number",
@@ -17384,7 +17384,7 @@ function encodeParams(scheme, options = {}) {
17384
17384
  };
17385
17385
  }
17386
17386
 
17387
- // ../../flow-extension-runner/src/v2/context/method-input.ts
17387
+ // ../../flow-extension-runner/src/context/method-input.ts
17388
17388
  var MethodInput = class {
17389
17389
  constructor(serviceId, methodName, data = {}) {
17390
17390
  this.serviceId = serviceId;
@@ -17442,7 +17442,7 @@ var MethodInput = class {
17442
17442
  }
17443
17443
  };
17444
17444
 
17445
- // ../../flow-extension-runner/src/v2/method.ts
17445
+ // ../../flow-extension-runner/src/method.ts
17446
17446
  var ExtensionMethod = class {
17447
17447
  constructor(extension) {
17448
17448
  this.extension = extension;
@@ -17471,7 +17471,7 @@ var ExtensionMethod = class {
17471
17471
  }
17472
17472
  };
17473
17473
 
17474
- // ../../flow-extension-runner/src/common/constants.ts
17474
+ // ../../flow-extension-runner/src/params/config-types.ts
17475
17475
  var ServiceConfigItemTypes = {
17476
17476
  STRING: "string",
17477
17477
  BOOL: "bool",
@@ -17480,7 +17480,7 @@ var ServiceConfigItemTypes = {
17480
17480
  TEXT: "text"
17481
17481
  };
17482
17482
 
17483
- // ../../flow-extension-runner/src/v2/model/field-mapper.ts
17483
+ // ../../flow-extension-runner/src/model/field-mapper.ts
17484
17484
  var descriptionOf = (schema) => inspect(schema).meta.description || "";
17485
17485
  var isRequired = (schema) => absenceOf(schema).absence === "required";
17486
17486
  var isParamGroup = (ins) => ins.coreType === "object" && !!ins.meta.frWidget;
@@ -17587,7 +17587,7 @@ function fieldToConfigItem(name, schema) {
17587
17587
  };
17588
17588
  }
17589
17589
 
17590
- // ../../flow-extension-runner/src/v2/model/method-model.ts
17590
+ // ../../flow-extension-runner/src/model/method-model.ts
17591
17591
  function opaqueParam(name, type = "OBJECT") {
17592
17592
  return { name, required: false, description: "", type };
17593
17593
  }
@@ -17609,7 +17609,7 @@ function argsFromParams(params) {
17609
17609
  return args;
17610
17610
  }
17611
17611
 
17612
- // ../../flow-extension-runner/src/v2/model/params-model.ts
17612
+ // ../../flow-extension-runner/src/model/params-model.ts
17613
17613
  function toBodyParams(params) {
17614
17614
  const scope2 = DictionaryScope.ROOT.enter(params.keys());
17615
17615
  return params.fields().map(([name, schema]) => fieldToParam(name, schema, { scope: scope2 }));
@@ -17628,7 +17628,7 @@ function toConfigItems(config) {
17628
17628
  return config.fields().map(([name, schema]) => fieldToConfigItem(name, schema));
17629
17629
  }
17630
17630
 
17631
- // ../../flow-extension-runner/src/v2/result.ts
17631
+ // ../../flow-extension-runner/src/result.ts
17632
17632
  function inferReturnType(value) {
17633
17633
  if (Array.isArray(value)) {
17634
17634
  return "LIST";
@@ -17696,7 +17696,7 @@ var ResultSpec = class _ResultSpec {
17696
17696
  }
17697
17697
  };
17698
17698
 
17699
- // ../../flow-extension-runner/src/v2/actions/action-method.ts
17699
+ // ../../flow-extension-runner/src/actions/action-method.ts
17700
17700
  var ActionMethod = class extends ExtensionMethod {
17701
17701
  constructor(extension, props) {
17702
17702
  super(extension);
@@ -17822,7 +17822,7 @@ var ActionMethod = class extends ExtensionMethod {
17822
17822
  }
17823
17823
  };
17824
17824
 
17825
- // ../../flow-extension-runner/src/common/context-files.ts
17825
+ // ../../flow-extension-runner/src/context/files.ts
17826
17826
  var import_backendless_request = __toESM(require_lib());
17827
17827
  var FileScope = {
17828
17828
  WORKSPACE: "WORKSPACE",
@@ -17830,7 +17830,7 @@ var FileScope = {
17830
17830
  EXECUTION: "EXECUTION"
17831
17831
  };
17832
17832
 
17833
- // ../../flow-extension-runner/src/v2/context/logger.ts
17833
+ // ../../flow-extension-runner/src/context/logger.ts
17834
17834
  var defaultLogger = {
17835
17835
  debug: () => {
17836
17836
  },
@@ -17840,7 +17840,7 @@ var defaultLogger = {
17840
17840
  error: (...args) => console.error(...args)
17841
17841
  };
17842
17842
 
17843
- // ../../flow-extension-runner/src/v2/context/proxies.ts
17843
+ // ../../flow-extension-runner/src/context/proxies.ts
17844
17844
  function createThrowingProxy(feature, hint2) {
17845
17845
  const fail2 = () => {
17846
17846
  throw new FeatureNotEnabledError(feature, hint2);
@@ -17860,7 +17860,7 @@ function createThrowingProxy(feature, hint2) {
17860
17860
  );
17861
17861
  }
17862
17862
 
17863
- // ../../flow-extension-runner/src/v2/context/execution-context.ts
17863
+ // ../../flow-extension-runner/src/context/execution-context.ts
17864
17864
  var ExecutionContext = class _ExecutionContext {
17865
17865
  #extension;
17866
17866
  #options;
@@ -17962,14 +17962,14 @@ var ExecutionContext = class _ExecutionContext {
17962
17962
  }
17963
17963
  };
17964
17964
 
17965
- // ../../flow-extension-runner/src/v2/dictionaries/payload-schema.ts
17965
+ // ../../flow-extension-runner/src/dictionaries/payload-schema.ts
17966
17966
  var DictionaryPayloadSchema = z.looseObject({
17967
17967
  search: z.string().optional(),
17968
17968
  cursor: z.union([z.string(), z.number()]).nullish(),
17969
17969
  criteria: z.record(z.string(), z.unknown()).optional()
17970
17970
  });
17971
17971
 
17972
- // ../../flow-extension-runner/src/v2/dictionaries/dictionary-method.ts
17972
+ // ../../flow-extension-runner/src/dictionaries/dictionary-method.ts
17973
17973
  var isBlank2 = (value) => value === void 0 || value === null || value === "";
17974
17974
  var DictionaryMethod = class extends ExtensionMethod {
17975
17975
  constructor(extension, props) {
@@ -18114,7 +18114,7 @@ var DictionaryMethod = class extends ExtensionMethod {
18114
18114
  };
18115
18115
  }
18116
18116
  // Describe the full payload shape so the method advertises a complete, labelled input scheme (nested
18117
- // props inline their own labels — mirroring the v1 jsdoc-parser layout).
18117
+ // props inline their own labels — mirroring the layout the v1 JSDoc parser established).
18118
18118
  #payloadParam() {
18119
18119
  const properties = [
18120
18120
  { name: "search", required: false, description: "Optional search string to filter results.", type: "STRING", label: "Search" },
@@ -18140,12 +18140,12 @@ var DictionaryMethod = class extends ExtensionMethod {
18140
18140
  }
18141
18141
  };
18142
18142
 
18143
- // ../../flow-extension-runner/src/v2/loaders/payload-schema.ts
18143
+ // ../../flow-extension-runner/src/loaders/payload-schema.ts
18144
18144
  var LoaderPayloadSchema = z.looseObject({
18145
18145
  criteria: z.record(z.string(), z.unknown()).optional()
18146
18146
  });
18147
18147
 
18148
- // ../../flow-extension-runner/src/v2/loaders/loader-method.ts
18148
+ // ../../flow-extension-runner/src/loaders/loader-method.ts
18149
18149
  var LoaderMethod = class extends ExtensionMethod {
18150
18150
  constructor(extension, owner) {
18151
18151
  super(extension);
@@ -18299,17 +18299,17 @@ var DynamicPropsLoaderMethod = class extends ParamsLoaderMethod {
18299
18299
  }
18300
18300
  };
18301
18301
 
18302
- // ../../flow-extension-runner/src/v2/oauth/oauth2.ts
18302
+ // ../../flow-extension-runner/src/oauth/oauth2.ts
18303
18303
  var import_crypto = __toESM(require("crypto"));
18304
18304
 
18305
- // ../../flow-extension-runner/src/v2/oauth/method-names.ts
18305
+ // ../../flow-extension-runner/src/oauth/method-names.ts
18306
18306
  var OAUTH_SYSTEM_METHODS = {
18307
18307
  CONNECTION_URL: "getOAuth2ConnectionURL",
18308
18308
  EXECUTE_CALLBACK: "executeCallback",
18309
18309
  REFRESH_TOKEN: "refreshToken"
18310
18310
  };
18311
18311
 
18312
- // ../../flow-extension-runner/src/v2/oauth/system-params.ts
18312
+ // ../../flow-extension-runner/src/oauth/system-params.ts
18313
18313
  var OAuthCallbackObjectSchema = z.looseObject({
18314
18314
  code: z.string().optional(),
18315
18315
  redirectURI: z.string().optional(),
@@ -18318,7 +18318,7 @@ var OAuthCallbackObjectSchema = z.looseObject({
18318
18318
  });
18319
18319
  var RefreshTokenSchema = z.string().min(1);
18320
18320
 
18321
- // ../../flow-extension-runner/src/v2/oauth/oauth2.ts
18321
+ // ../../flow-extension-runner/src/oauth/oauth2.ts
18322
18322
  var OAuth2 = class {
18323
18323
  constructor(extension, props) {
18324
18324
  this.extension = extension;
@@ -18463,10 +18463,10 @@ function userDataOf(token) {
18463
18463
  return token && typeof token === "object" ? token.userData : void 0;
18464
18464
  }
18465
18465
 
18466
- // ../../flow-extension-runner/src/v2/polling-triggers/method-names.ts
18466
+ // ../../flow-extension-runner/src/polling-triggers/method-names.ts
18467
18467
  var POLLING_SYSTEM_METHOD = "handleTriggerPollingForEvent";
18468
18468
 
18469
- // ../../flow-extension-runner/src/v2/polling-triggers/system-params.ts
18469
+ // ../../flow-extension-runner/src/polling-triggers/system-params.ts
18470
18470
  var PollingInvocationSchema = z.looseObject({
18471
18471
  eventName: z.string().min(1),
18472
18472
  // The trigger instance's configured params — validated against the trigger's own schema separately.
@@ -18476,7 +18476,7 @@ var PollingInvocationSchema = z.looseObject({
18476
18476
  connectionId: z.string().nullish()
18477
18477
  });
18478
18478
 
18479
- // ../../flow-extension-runner/src/v2/polling-triggers/polling-triggers.ts
18479
+ // ../../flow-extension-runner/src/polling-triggers/polling-triggers.ts
18480
18480
  var PollingTriggers = class {
18481
18481
  constructor(extension) {
18482
18482
  this.extension = extension;
@@ -18515,15 +18515,15 @@ var PollingTriggers = class {
18515
18515
  }
18516
18516
  };
18517
18517
 
18518
- // ../../flow-extension-runner/src/v2/path.ts
18519
- function getPath(source, path19) {
18520
- return path19.split(".").reduce(
18518
+ // ../../flow-extension-runner/src/path.ts
18519
+ function getPath(source, path18) {
18520
+ return path18.split(".").reduce(
18521
18521
  (acc, key) => acc == null ? acc : acc[key],
18522
18522
  source
18523
18523
  );
18524
18524
  }
18525
18525
 
18526
- // ../../flow-extension-runner/src/v2/polling-triggers/mechanisms.ts
18526
+ // ../../flow-extension-runner/src/polling-triggers/mechanisms.ts
18527
18527
  var PollingMechanism = class {
18528
18528
  /**
18529
18529
  * Pick the strategy an author declared, rejecting the combinations that cannot work. Runs at REGISTRATION
@@ -18657,7 +18657,7 @@ var WatermarkMechanism = class extends FetchingMechanism {
18657
18657
  }
18658
18658
  };
18659
18659
 
18660
- // ../../flow-extension-runner/src/v2/polling-triggers/trigger-method.ts
18660
+ // ../../flow-extension-runner/src/polling-triggers/trigger-method.ts
18661
18661
  var PollingTriggerMethod = class extends ExtensionMethod {
18662
18662
  constructor(extension, props) {
18663
18663
  super(extension);
@@ -18727,7 +18727,7 @@ var PollingTriggerMethod = class extends ExtensionMethod {
18727
18727
  }
18728
18728
  };
18729
18729
 
18730
- // ../../flow-extension-runner/src/v2/realtime-triggers/method-names.ts
18730
+ // ../../flow-extension-runner/src/realtime-triggers/method-names.ts
18731
18731
  var REALTIME_SYSTEM_METHODS = {
18732
18732
  UPSERT: "handleTriggerUpsertWebhook",
18733
18733
  RESOLVE: "handleTriggerResolveEvents",
@@ -18736,7 +18736,7 @@ var REALTIME_SYSTEM_METHODS = {
18736
18736
  REFRESH: "handleTriggerRefreshWebhook"
18737
18737
  };
18738
18738
 
18739
- // ../../flow-extension-runner/src/v2/realtime-triggers/system-params.ts
18739
+ // ../../flow-extension-runner/src/realtime-triggers/system-params.ts
18740
18740
  var anyRecord = () => z.record(z.string(), z.unknown());
18741
18741
  var SubscriptionEventSchema = z.looseObject({
18742
18742
  name: z.string().min(1),
@@ -18772,7 +18772,7 @@ var RealtimeSelectInvocationSchema = z.looseObject({
18772
18772
  })).default([])
18773
18773
  });
18774
18774
 
18775
- // ../../flow-extension-runner/src/v2/realtime-triggers/verify.ts
18775
+ // ../../flow-extension-runner/src/realtime-triggers/verify.ts
18776
18776
  function verifyDeclarative(verify, rawBody, headers, config, webhookData) {
18777
18777
  const secret = verify.secret(config, { webhookData });
18778
18778
  if (!secret) {
@@ -18795,7 +18795,7 @@ function verifyDeclarative(verify, rawBody, headers, config, webhookData) {
18795
18795
  return true;
18796
18796
  }
18797
18797
 
18798
- // ../../flow-extension-runner/src/v2/realtime-triggers/realtime-setup.ts
18798
+ // ../../flow-extension-runner/src/realtime-triggers/realtime-setup.ts
18799
18799
  function readExtract(extract, body) {
18800
18800
  if (typeof extract === "function") {
18801
18801
  return extract({ requestBody: body });
@@ -19091,7 +19091,7 @@ var RealtimeSetup = class {
19091
19091
  }
19092
19092
  };
19093
19093
 
19094
- // ../../flow-extension-runner/src/v2/realtime-triggers/trigger-method.ts
19094
+ // ../../flow-extension-runner/src/realtime-triggers/trigger-method.ts
19095
19095
  function isFilled(value) {
19096
19096
  return value != null && value !== "";
19097
19097
  }
@@ -19187,12 +19187,12 @@ var RealtimeTriggerMethod = class extends ExtensionMethod {
19187
19187
  if (typeof match === "function") {
19188
19188
  return !!await match({ params, providerEventData, webhookData });
19189
19189
  }
19190
- for (const [paramKey, path19] of Object.entries(match)) {
19190
+ for (const [paramKey, path18] of Object.entries(match)) {
19191
19191
  const paramValue = params[paramKey];
19192
19192
  if (!isFilled(paramValue)) {
19193
19193
  continue;
19194
19194
  }
19195
- if (`${paramValue}` !== `${getPath(providerEventData, path19)}`) {
19195
+ if (`${paramValue}` !== `${getPath(providerEventData, path18)}`) {
19196
19196
  return false;
19197
19197
  }
19198
19198
  }
@@ -19228,7 +19228,7 @@ var RealtimeTriggerMethod = class extends ExtensionMethod {
19228
19228
  }
19229
19229
  };
19230
19230
 
19231
- // ../../flow-extension-runner/src/v2/system-method.ts
19231
+ // ../../flow-extension-runner/src/system-method.ts
19232
19232
  var SystemMethod = class extends ExtensionMethod {
19233
19233
  constructor(extension, spec) {
19234
19234
  super(extension);
@@ -19285,7 +19285,7 @@ var SystemMethod = class extends ExtensionMethod {
19285
19285
  }
19286
19286
  };
19287
19287
 
19288
- // ../../flow-extension-runner/src/v2/extension.ts
19288
+ // ../../flow-extension-runner/src/extension.ts
19289
19289
  var Extension = class {
19290
19290
  #props;
19291
19291
  #config;
@@ -19441,8 +19441,8 @@ var Extension = class {
19441
19441
  };
19442
19442
  }
19443
19443
  /**
19444
- * The published model — the v2 analogue of jsdoc-parser's `parseJsDocToServiceJson`, and the same
19445
- * `{ serviceInfo, methodsMap }` shape the console consumes for a v1 service.
19444
+ * The published model — the `{ serviceInfo, methodsMap }` shape the console consumes, the same one the
19445
+ * removed v1 JSDoc parser produced.
19446
19446
  *
19447
19447
  * Every method describes itself, so this is one pass with no per-kind branches: what a service publishes
19448
19448
  * is exactly what it registered.
@@ -19455,8 +19455,6 @@ var Extension = class {
19455
19455
  }
19456
19456
  }
19457
19457
  return {
19458
- runnerVersion: "v2",
19459
- //TODO: temp
19460
19458
  serviceInfo: this.toServiceInfo(),
19461
19459
  methodsMap,
19462
19460
  configSchema: encodeParams(this.config.scheme)
@@ -19496,7 +19494,7 @@ var Extension = class {
19496
19494
  }
19497
19495
  };
19498
19496
 
19499
- // ../../flow-extension-runner/src/v2/registry.ts
19497
+ // ../../flow-extension-runner/src/registry.ts
19500
19498
  var ExtensionRegistry = class {
19501
19499
  #extensions = /* @__PURE__ */ new Map();
19502
19500
  register(extension) {
@@ -19516,15 +19514,19 @@ var ExtensionRegistry = class {
19516
19514
  * which imports it.
19517
19515
  */
19518
19516
  load(id, entryPointPath) {
19519
- if (!this.get(id)) {
19520
- require(entryPointPath);
19521
- }
19522
- const extension = this.get(id);
19517
+ const extension = this.tryLoad(id, entryPointPath);
19523
19518
  if (!extension) {
19524
19519
  throw new ExtensionNotRegisteredError(id, entryPointPath);
19525
19520
  }
19526
19521
  return extension;
19527
19522
  }
19523
+ /** As `load`, but `undefined` instead of throwing when the module registers no extension under `id`. */
19524
+ tryLoad(id, entryPointPath) {
19525
+ if (!this.get(id)) {
19526
+ require(entryPointPath);
19527
+ }
19528
+ return this.get(id);
19529
+ }
19528
19530
  // Test-only: clear the registry between isolated cases.
19529
19531
  reset() {
19530
19532
  this.#extensions.clear();
@@ -19535,7 +19537,7 @@ function getExtension(id) {
19535
19537
  return registry.get(id);
19536
19538
  }
19537
19539
 
19538
- // ../../flow-extension-runner/src/v2/create-extension.ts
19540
+ // ../../flow-extension-runner/src/create-extension.ts
19539
19541
  function createExtension(props) {
19540
19542
  const extension = new Extension(props);
19541
19543
  const api = {
@@ -19563,7 +19565,7 @@ function createExtension(props) {
19563
19565
  return api;
19564
19566
  }
19565
19567
 
19566
- // ../../flow-extension-runner/src/v2/crypto.ts
19568
+ // ../../flow-extension-runner/src/crypto.ts
19567
19569
  var import_crypto2 = __toESM(require("crypto"));
19568
19570
  var crypto2 = {
19569
19571
  hmac(algo, key, data, encoding = "hex") {
@@ -19599,689 +19601,99 @@ var flowrunnerRuntime = {
19599
19601
  z,
19600
19602
  crypto: crypto2,
19601
19603
  createExtension,
19602
- getExtension,
19603
- ServerCode: null
19604
+ getExtension
19604
19605
  };
19605
19606
  global.Flowrunner = flowrunnerRuntime;
19606
19607
 
19607
- // ../../flow-extension-runner/src/common/config.ts
19608
- var ConfigValueAdapters = {
19609
- [ServiceConfigItemTypes.BOOL]: {
19610
- deserialize: (value) => typeof value === "string" ? value === "true" : !!value,
19611
- isEmpty: (value) => typeof value !== "boolean"
19612
- },
19613
- default: {
19614
- deserialize: (value) => value,
19615
- isEmpty: (value) => !value
19616
- }
19617
- };
19618
-
19619
- // ../../flow-extension-runner/src/v1/config.ts
19620
- function normalizeConfigItems(sourceConfigItems) {
19621
- return sourceConfigItems?.map((item) => ({
19622
- name: item.name,
19623
- type: item.type || ServiceConfigItemTypes.STRING,
19624
- shared: !!item.shared,
19625
- required: !!item.required,
19626
- description: item.description || item.hint || "",
19627
- label: item.label || item.displayName || item.name,
19628
- defaultValue: item.defaultValue,
19629
- options: item.options || []
19630
- })) || [];
19631
- }
19632
-
19633
- // ../../flow-extension-runner/src/v1/namespace.ts
19634
- var services = /* @__PURE__ */ new Map();
19635
- function createFlowrunnerSandboxV1(serviceId, cb) {
19636
- global.Flowrunner.ServerCode = {
19637
- addService(ServiceClass, sourceConfigItems) {
19638
- services.set(serviceId, {
19639
- ServiceClass,
19640
- configItems: normalizeConfigItems(sourceConfigItems)
19641
- });
19642
- },
19643
- ConfigItems: {
19644
- TYPES: ServiceConfigItemTypes
19645
- }
19646
- };
19647
- try {
19648
- cb();
19649
- } finally {
19650
- global.Flowrunner.ServerCode = null;
19651
- }
19652
- return services.get(serviceId);
19653
- }
19654
-
19655
- // ../../flow-extension-runner/src/v1/service.ts
19656
- function requireService(serviceId, serviceEntryPointPath) {
19657
- const registered = createFlowrunnerSandboxV1(serviceId, () => {
19658
- require(serviceEntryPointPath);
19659
- });
19660
- if (!registered?.ServiceClass) {
19661
- throw new Error(`There is no registered ServiceClass serviceEntryPointPath="${serviceEntryPointPath}"`);
19662
- }
19663
- return registered;
19664
- }
19608
+ // ../../flow-extension-runner/src/index.ts
19665
19609
  function getServiceConfigs(serviceId, serviceEntryPointPath) {
19666
- const { configItems } = requireService(serviceId, serviceEntryPointPath);
19667
- return configItems;
19668
- }
19669
-
19670
- // ../../flow-extension-runner/src/v2/index.ts
19671
- function getServiceConfigs2(serviceId, serviceEntryPointPath) {
19672
19610
  return registry.load(serviceId, serviceEntryPointPath).toConfigItems();
19673
19611
  }
19674
19612
  function buildServiceDefinition(serviceId, serviceEntryPointPath) {
19675
- return registry.load(serviceId, serviceEntryPointPath).toDefinition();
19676
- }
19677
-
19678
- // ../../flow-extension-runner/src/index.ts
19679
- function detectVersion(serviceId, serviceEntryPointPath) {
19680
- createFlowrunnerSandboxV1(serviceId, () => {
19681
- require(serviceEntryPointPath);
19682
- });
19683
- return getExtension(serviceId) ? "v2" : "v1";
19684
- }
19685
- function getServiceConfigs3(serviceId, serviceEntryPointPath) {
19686
- return detectVersion(serviceId, serviceEntryPointPath) === "v2" ? getServiceConfigs2(serviceId, serviceEntryPointPath) : getServiceConfigs(serviceId, serviceEntryPointPath);
19687
- }
19688
- function buildServiceDefinition2(serviceId, serviceEntryPointPath) {
19689
- return detectVersion(serviceId, serviceEntryPointPath) === "v2" ? buildServiceDefinition(serviceId, serviceEntryPointPath) : null;
19690
- }
19691
-
19692
- // ../../jsdoc-parser/src/custom-type-defs/files.ts
19693
- var SCOPE_FIELD = {
19694
- name: "scope",
19695
- type: "String",
19696
- required: false,
19697
- label: "Scope",
19698
- description: "Storage scope: WORKSPACE (shared across flows), FLOW (this flow only), EXECUTION (this run only)",
19699
- uiComponent: { type: "DROPDOWN", options: { values: ["WORKSPACE", "FLOW", "EXECUTION"] } },
19700
- defaultValue: "FLOW"
19701
- };
19702
- var filesTypeDefs = {
19703
- FilesUploadOptions: [
19704
- SCOPE_FIELD,
19705
- {
19706
- name: "filename",
19707
- type: "String",
19708
- required: false,
19709
- label: "Filename",
19710
- description: "Custom filename (defaults to the original name if omitted)",
19711
- uiComponent: { type: "SINGLE_LINE_TEXT" }
19712
- },
19713
- {
19714
- name: "ttl",
19715
- type: "Number",
19716
- required: false,
19717
- label: "URL TTL (seconds)",
19718
- description: "How long the download URL remains valid",
19719
- uiComponent: { type: "NUMERIC" }
19720
- },
19721
- {
19722
- name: "objectTtl",
19723
- type: "Number",
19724
- required: false,
19725
- label: "File TTL (seconds)",
19726
- description: "How long the file is kept in storage (omit for permanent storage)",
19727
- uiComponent: { type: "NUMERIC" }
19728
- },
19729
- {
19730
- name: "overwrite",
19731
- type: "Boolean",
19732
- required: false,
19733
- label: "Overwrite existing",
19734
- description: "Replace the file if one with the same name already exists",
19735
- uiComponent: { type: "TOGGLE" }
19736
- },
19737
- {
19738
- name: "generateUrl",
19739
- type: "Boolean",
19740
- required: false,
19741
- label: "Generate download URL",
19742
- description: "Include a pre-signed download URL in the response",
19743
- uiComponent: { type: "TOGGLE" },
19744
- defaultValue: true
19745
- }
19746
- ],
19747
- FilesListOptions: [
19748
- SCOPE_FIELD,
19749
- {
19750
- name: "limit",
19751
- type: "Number",
19752
- required: false,
19753
- label: "Limit",
19754
- description: "Maximum number of files to return",
19755
- uiComponent: { type: "NUMERIC" }
19756
- },
19757
- {
19758
- name: "ttl",
19759
- type: "Number",
19760
- required: false,
19761
- label: "URL TTL (seconds)",
19762
- description: "How long the download URLs remain valid",
19763
- uiComponent: { type: "NUMERIC" }
19764
- },
19765
- {
19766
- name: "generateUrl",
19767
- type: "Boolean",
19768
- required: false,
19769
- label: "Generate download URLs",
19770
- description: "Include pre-signed download URLs in the response",
19771
- uiComponent: { type: "TOGGLE" },
19772
- defaultValue: true
19773
- },
19774
- {
19775
- name: "cursor",
19776
- type: "String",
19777
- required: false,
19778
- label: "Cursor",
19779
- description: "Pagination cursor from a previous response",
19780
- uiComponent: { type: "SINGLE_LINE_TEXT" }
19781
- }
19782
- ],
19783
- FilesGetOptions: [
19784
- SCOPE_FIELD,
19785
- {
19786
- name: "ttl",
19787
- type: "Number",
19788
- required: false,
19789
- label: "URL TTL (seconds)",
19790
- description: "How long the download URL remains valid",
19791
- uiComponent: { type: "NUMERIC" }
19792
- },
19793
- {
19794
- name: "generateUrl",
19795
- type: "Boolean",
19796
- required: false,
19797
- label: "Generate download URL",
19798
- description: "Include a pre-signed download URL in the response",
19799
- uiComponent: { type: "TOGGLE" },
19800
- defaultValue: true
19801
- }
19802
- ],
19803
- FilesDeleteOptions: [
19804
- SCOPE_FIELD
19805
- ]
19806
- };
19807
-
19808
- // ../../jsdoc-parser/src/lib.ts
19809
- var import_fs3 = __toESM(require("fs"));
19810
- var import_path6 = __toESM(require("path"));
19811
- function resolveJSDocPath() {
19812
- const jsDocHolders = require.resolve.paths("jsdoc/lib") || [];
19813
- const jsDocPaths = jsDocHolders.map((p) => import_path6.default.join(p, "jsdoc/lib"));
19814
- for (let i = 0; i < jsDocPaths.length; i++) {
19815
- if (import_fs3.default.existsSync(jsDocPaths[i])) {
19816
- return jsDocPaths[i];
19817
- }
19818
- }
19819
- throw new Error("Can not resolve path to JSDoc module.");
19820
- }
19821
- var jsdocPath = resolveJSDocPath();
19822
- var jsdocModulePath = (mod) => import_path6.default.join(jsdocPath, ...mod.split("/"));
19823
- var _jsdocRequire;
19824
- var jsdocRequire = (modulePath) => {
19825
- if (!_jsdocRequire) {
19826
- _jsdocRequire = require("requizzle")({
19827
- infect: true,
19828
- requirePaths: { before: [jsdocPath] }
19829
- });
19830
- const Config = _jsdocRequire(jsdocModulePath("jsdoc/config"));
19831
- const env = _jsdocRequire(jsdocModulePath("jsdoc/env"));
19832
- env.conf = new Config().get();
19833
- }
19834
- return _jsdocRequire(jsdocModulePath(modulePath));
19835
- };
19836
- function parseJSDoc(filePath) {
19837
- const parser = jsdocRequire("jsdoc/src/parser").createParser();
19838
- const handlers = jsdocRequire("jsdoc/src/handlers");
19839
- handlers.attachTo(parser);
19840
- return parser.parse([filePath]);
19841
- }
19842
-
19843
- // ../../jsdoc-parser/src/index.ts
19844
- var customTypeDef = {
19845
- FilesUploadOptions: filesTypeDefs.FilesUploadOptions,
19846
- FilesListOptions: filesTypeDefs.FilesListOptions,
19847
- FilesGetOptions: filesTypeDefs.FilesGetOptions,
19848
- FilesDeleteOptions: filesTypeDefs.FilesDeleteOptions
19849
- };
19850
- function findServiceClassName(doclets) {
19851
- const withIntegration = doclets.find((d) => {
19852
- if (d.kind === "class" && d.tags) {
19853
- return d.tags.find((t) => t.originalTitle === "integrationName");
19854
- }
19855
- });
19856
- if (withIntegration) {
19857
- return withIntegration.name;
19858
- }
19859
- return null;
19860
- }
19861
- function parseJSDocs(filePath) {
19862
- const doclets = parseJSDoc(filePath);
19863
- const className = findServiceClassName(doclets);
19864
- let serviceInfo = null;
19865
- const methods = [];
19866
- const typedefsMap = {};
19867
- doclets.forEach((d) => {
19868
- if (d.kind === "class" && d.name === className) {
19869
- serviceInfo = composeServiceInfo(d);
19870
- } else if (d.kind === "function" && d.memberof === className && d.scope === "instance") {
19871
- methods.push(composeMethod(d));
19872
- } else if (d.kind === "typedef") {
19873
- const typedefParams = collectTypedef(d);
19874
- if (typedefParams) {
19875
- typedefsMap[d.name] = typedefParams;
19876
- }
19877
- }
19878
- });
19879
- return {
19880
- serviceInfo,
19881
- methods,
19882
- // Extension-defined typedefs override built-ins so authors can customise if needed
19883
- typedefsMap: { ...customTypeDef, ...typedefsMap }
19884
- };
19885
- }
19886
- var ServiceInfoTagsProcessors = {
19887
- integrationName: (serviceInfo, tagValue) => {
19888
- serviceInfo.integrationName = tagValue || void 0;
19889
- },
19890
- integrationIcon: (serviceInfo, tagValue) => {
19891
- serviceInfo.integrationIcon = tagValue || null;
19892
- },
19893
- requireOAuth: (serviceInfo) => {
19894
- serviceInfo.requireOAuth = true;
19895
- },
19896
- integrationTriggersScope: (serviceInfo, tagValue) => {
19897
- serviceInfo.integrationTriggersScope = tagValue || null;
19898
- }
19899
- };
19900
- function composeServiceInfo(d) {
19901
- const serviceInfo = {
19902
- serviceClassName: d.name,
19903
- integrationName: d.name,
19904
- integrationIcon: null,
19905
- requireOAuth: void 0,
19906
- integrationTriggersScope: null
19907
- };
19908
- iterateTags(d.tags, (tagName, tagValue) => {
19909
- if (ServiceInfoTagsProcessors[tagName]) {
19910
- ServiceInfoTagsProcessors[tagName](serviceInfo, tagValue);
19911
- }
19912
- });
19913
- return serviceInfo;
19914
- }
19915
- function iterateTags(tags, cb) {
19916
- if (tags) {
19917
- tags.forEach((tag) => {
19918
- const title = tag.originalTitle;
19919
- const value = tag.value || tag.text || "";
19920
- cb(title, value, tag);
19921
- });
19922
- }
19923
- }
19924
- var MethodTagsProcessors = {
19925
- paramDef: (methodInfo, tagValue) => {
19926
- if (tagValue) {
19927
- const parsedValue = parseJSON(tagValue);
19928
- if (parsedValue) {
19929
- methodInfo.paramDefs.push(parsedValue);
19930
- }
19931
- }
19932
- },
19933
- route: (methodInfo, tagValue) => {
19934
- if (tagValue) {
19935
- methodInfo.route = tagValue;
19936
- }
19937
- },
19938
- registerAs: (methodInfo, tagValue) => {
19939
- if (tagValue) {
19940
- methodInfo.registerAs = tagValue;
19941
- }
19942
- },
19943
- operationName: (methodInfo, tagValue) => {
19944
- if (tagValue) {
19945
- methodInfo.operationName = tagValue;
19946
- }
19947
- },
19948
- customIcon: (methodInfo, tagValue) => {
19949
- if (tagValue) {
19950
- methodInfo.customIcon = tagValue;
19951
- }
19952
- },
19953
- category: (methodInfo, tagValue) => {
19954
- if (tagValue) {
19955
- methodInfo.category = tagValue;
19956
- }
19957
- },
19958
- description: (methodInfo, tagValue) => {
19959
- if (tagValue) {
19960
- methodInfo.description = tagValue;
19961
- }
19962
- },
19963
- appearanceColor: (methodInfo, tagValue) => {
19964
- if (tagValue) {
19965
- const colors = extractColors(tagValue);
19966
- methodInfo.colorStart = colors.colorStart;
19967
- methodInfo.colorEnd = colors.colorEnd;
19968
- }
19969
- },
19970
- private: (methodInfo) => {
19971
- methodInfo.private = true;
19972
- },
19973
- sampleResult: (methodInfo, tagValue) => {
19974
- if (tagValue) {
19975
- methodInfo.sampleResult = parseJSON(tagValue);
19976
- }
19977
- },
19978
- sampleResultLoader: (methodInfo, tagValue) => {
19979
- if (tagValue) {
19980
- methodInfo.sampleResultLoader = parseJSON(tagValue);
19981
- }
19982
- }
19983
- };
19984
- function composeMethod(m) {
19985
- const methodInfo = {
19986
- name: m.name,
19987
- description: m.description || "",
19988
- returnType: mapReturnType(m.returns?.[0].type?.names?.[0]),
19989
- registerAs: "",
19990
- colorStart: "",
19991
- colorEnd: "",
19992
- private: m.access === "private",
19993
- operationName: m.name,
19994
- customIcon: "",
19995
- category: "",
19996
- sampleResult: null,
19997
- sampleResultLoader: null,
19998
- routeStr: "",
19999
- paramDefs: []
20000
- };
20001
- if (m.params) {
20002
- m.params.forEach((p) => {
20003
- methodInfo.paramDefs.push({
20004
- name: p.name,
20005
- type: p.type?.names?.[0] || "String",
20006
- required: !p.optional
20007
- });
20008
- });
20009
- }
20010
- iterateTags(m.tags, (tagName, tagValue) => {
20011
- if (MethodTagsProcessors[tagName]) {
20012
- MethodTagsProcessors[tagName](methodInfo, tagValue);
20013
- }
20014
- });
20015
- return methodInfo;
20016
- }
20017
- var PRIMITIVES = ["String", "Object", "Boolean", "Number"];
20018
- var ParamTypesMap = {
20019
- String: "STRING",
20020
- Object: "OBJECT",
20021
- Boolean: "BOOLEAN",
20022
- Number: "NUMBER"
20023
- };
20024
- function mapParamType(type) {
20025
- if (!type) {
20026
- return "STRING";
20027
- }
20028
- if (type.startsWith("Array")) {
20029
- return "LIST";
20030
- }
20031
- return ParamTypesMap[type] || "STRING";
20032
- }
20033
- function mapReturnType(type) {
20034
- if (type) {
20035
- if (type === "Array" || type.startsWith("Array.") || type.startsWith("Array<")) return "LIST";
20036
- if (type === "Object") return "OBJECT";
20037
- if (type === "String") return "STRING";
20038
- }
20039
- return "VOID";
20040
- }
20041
- function collectTypedef(d) {
20042
- const defs = [];
20043
- iterateTags(d.tags, (title, value) => {
20044
- if (title === "paramDef") {
20045
- const parsedValue = parseJSON(value);
20046
- if (parsedValue) {
20047
- defs.push(parsedValue);
20048
- }
20049
- }
20050
- });
20051
- if (d.properties) {
20052
- d.properties.forEach((property) => {
20053
- const type = property?.type?.names?.[0];
20054
- defs.push({
20055
- name: property.name,
20056
- required: !property.optional,
20057
- description: property.description,
20058
- type
20059
- });
20060
- });
20061
- }
20062
- if (defs.length > 0) {
20063
- return defs;
20064
- }
20065
- }
20066
- function buildParam(paramDef, typedefsMap, nested = false) {
20067
- const isCustomType = !nested && paramDef.type && !PRIMITIVES.includes(paramDef.type) && !paramDef.type.startsWith("Array");
20068
- let properties;
20069
- if (isCustomType && typedefsMap[paramDef.type]) {
20070
- let subDefs = typedefsMap[paramDef.type];
20071
- if (paramDef.include?.length) {
20072
- const includeSet = new Set(paramDef.include);
20073
- subDefs = subDefs.filter((sd) => includeSet.has(sd.name));
20074
- }
20075
- if (subDefs.length > 0) {
20076
- properties = subDefs.map((sp) => buildParam(sp, typedefsMap, true));
20077
- }
20078
- }
20079
- const param = {
20080
- name: paramDef.name,
20081
- required: paramDef.required || false,
20082
- description: paramDef.description || "",
20083
- type: isCustomType ? "OBJECT" : mapParamType(paramDef.type)
20084
- };
20085
- if (nested) {
20086
- if (paramDef.label !== void 0) {
20087
- param.label = paramDef.label;
20088
- }
20089
- if (paramDef.uiComponent !== void 0) {
20090
- param.uiComponent = paramDef.uiComponent;
20091
- }
20092
- if (paramDef.dependsOn !== void 0) {
20093
- param.dependsOn = paramDef.dependsOn;
20094
- }
20095
- if (paramDef.dictionary !== void 0) {
20096
- param.dictionary = paramDef.dictionary;
20097
- }
20098
- if (paramDef.defaultValue !== void 0) {
20099
- param.defaultValue = paramDef.defaultValue;
20100
- }
20101
- }
20102
- if (properties && properties.length > 0) {
20103
- param.properties = properties;
20104
- }
20105
- if (param.type === "LIST") {
20106
- param.items = { type: "OBJECT" };
20107
- }
20108
- return param;
20109
- }
20110
- function buildMetaInfoArgs(paramDefs, typedefsMap) {
20111
- const args = {};
20112
- for (const pd of paramDefs) {
20113
- const isCustomType = pd.type && !PRIMITIVES.includes(pd.type) && !pd.type.startsWith("Array");
20114
- if (isCustomType && typedefsMap[pd.type]) {
20115
- const entry2 = {};
20116
- if (pd.label) entry2.label = pd.label;
20117
- args[pd.name] = entry2;
20118
- continue;
20119
- }
20120
- const entry = {};
20121
- if (pd.label) entry.label = pd.label;
20122
- if (pd.dictionary) entry.dictionary = pd.dictionary;
20123
- if (pd.dependsOn && pd.dependsOn.length > 0) entry.dependsOn = pd.dependsOn;
20124
- if (pd.uiComponent) entry.uiComponent = pd.uiComponent;
20125
- args[pd.name] = entry;
20126
- }
20127
- return args;
20128
- }
20129
- function extractColors(colorStr) {
20130
- if (!colorStr) {
20131
- return { colorStart: "", colorEnd: "" };
20132
- }
20133
- const colors = colorStr.split(/[,\s]+/).map((c) => c.trim()).filter(Boolean);
20134
- return {
20135
- colorStart: colors[0] || "",
20136
- colorEnd: colors[1] || colors[0] || ""
20137
- };
20138
- }
20139
- function parseJSON(str) {
20140
- try {
20141
- return JSON.parse(str);
20142
- } catch {
20143
- return null;
20144
- }
20145
- }
20146
- function parseJsDocToServiceJson(entryPoint) {
20147
- const { serviceInfo, methods, typedefsMap } = parseJSDocs(entryPoint);
20148
- const methodsMap = {};
20149
- for (const method of methods) {
20150
- if (method.private) {
20151
- continue;
20152
- }
20153
- const {
20154
- name,
20155
- route,
20156
- registerAs,
20157
- colorStart,
20158
- colorEnd,
20159
- operationName,
20160
- customIcon,
20161
- category,
20162
- description,
20163
- sampleResult,
20164
- sampleResultLoader,
20165
- paramDefs,
20166
- returnType
20167
- } = method;
20168
- const isSystem = registerAs === "SYSTEM";
20169
- const httpMethod = route ? route.split(/\s+/)[0].toUpperCase() : name.startsWith("get") ? "GET" : "POST";
20170
- const isQueryPlacement = httpMethod === "GET";
20171
- const params = paramDefs.map((pd) => buildParam(pd, typedefsMap));
20172
- const queryParams = isQueryPlacement ? params : [];
20173
- const bodyParams = isQueryPlacement ? [] : params;
20174
- const metaInfoArgs = paramDefs.length > 0 ? buildMetaInfoArgs(paramDefs, typedefsMap) : {};
20175
- methodsMap[name] = {
20176
- colorStart,
20177
- colorEnd,
20178
- queryParams,
20179
- // todo remove me
20180
- bodyParams,
20181
- customIcon: isSystem ? void 0 : customIcon,
20182
- registerAs,
20183
- category,
20184
- metaInfo: {
20185
- args: metaInfoArgs,
20186
- sampleResult: isSystem ? void 0 : sampleResult,
20187
- sampleResultLoader: isSystem ? void 0 : sampleResultLoader
20188
- },
20189
- returnType,
20190
- description,
20191
- operationName,
20192
- name
20193
- };
20194
- }
20195
- return {
20196
- runnerVersion: "v1",
20197
- //TODO: temp
20198
- methodsMap,
20199
- serviceInfo
20200
- };
19613
+ return registry.tryLoad(serviceId, serviceEntryPointPath)?.toDefinition() ?? null;
20201
19614
  }
20202
19615
 
20203
19616
  // src/operations/deploy/discover-services.ts
20204
19617
  function discoverServices(projectRoot = process.cwd()) {
20205
- const servicesDir = import_path7.default.resolve(projectRoot, "services");
20206
- if (!import_fs4.default.existsSync(servicesDir)) {
19618
+ const servicesDir = import_path6.default.resolve(projectRoot, "services");
19619
+ if (!import_fs3.default.existsSync(servicesDir)) {
20207
19620
  return { services: [], skipped: [] };
20208
19621
  }
20209
- const serviceIds = import_fs4.default.readdirSync(servicesDir, { withFileTypes: true }).filter((file) => file.isDirectory()).map((file) => file.name);
20210
- const services2 = [];
19622
+ const serviceIds = import_fs3.default.readdirSync(servicesDir, { withFileTypes: true }).filter((file) => file.isDirectory()).map((file) => file.name);
19623
+ const services = [];
20211
19624
  const skipped = [];
20212
19625
  for (const serviceId of serviceIds) {
20213
- const serviceDir = import_path7.default.resolve(servicesDir, serviceId);
20214
- const serviceDISTEntryPoint = import_path7.default.resolve(serviceDir, "./dist/index.js");
20215
- const serviceSRCEntryPoint = import_path7.default.resolve(serviceDir, "./src/index.js");
19626
+ const serviceDir = import_path6.default.resolve(servicesDir, serviceId);
19627
+ const serviceDISTEntryPoint = import_path6.default.resolve(serviceDir, "./dist/index.js");
19628
+ const serviceSRCEntryPoint = import_path6.default.resolve(serviceDir, "./src/index.js");
20216
19629
  let serviceFilePath = null;
20217
19630
  try {
20218
- if (import_fs4.default.existsSync(serviceDISTEntryPoint)) {
19631
+ if (import_fs3.default.existsSync(serviceDISTEntryPoint)) {
20219
19632
  serviceFilePath = serviceDISTEntryPoint;
20220
- } else if (import_fs4.default.existsSync(serviceSRCEntryPoint)) {
19633
+ } else if (import_fs3.default.existsSync(serviceSRCEntryPoint)) {
20221
19634
  serviceFilePath = serviceSRCEntryPoint;
20222
19635
  }
20223
19636
  if (!serviceFilePath) {
20224
19637
  skipped.push({ serviceId, reason: "it has neither a dist/index.js nor a src/index.js" });
20225
19638
  continue;
20226
19639
  }
20227
- const v2Definition = buildServiceDefinition2(serviceId, serviceFilePath);
20228
- const { methodsMap, serviceInfo } = v2Definition ?? parseJsDocToServiceJson(serviceFilePath);
20229
- if (!serviceInfo || !v2Definition && !serviceInfo.serviceClassName) {
20230
- skipped.push({ serviceId, reason: "its entry point does not define a service" });
19640
+ const definition = buildServiceDefinition(serviceId, serviceFilePath);
19641
+ if (!definition?.serviceInfo) {
19642
+ skipped.push({ serviceId, reason: "its entry point does not define a service with createExtension" });
20231
19643
  continue;
20232
19644
  }
19645
+ const { methodsMap, serviceInfo } = definition;
20233
19646
  let configDescriptions = [];
20234
19647
  try {
20235
- configDescriptions = getServiceConfigs3(serviceId, serviceFilePath);
19648
+ configDescriptions = getServiceConfigs(serviceId, serviceFilePath);
20236
19649
  } catch (error) {
20237
19650
  skipped.push({
20238
19651
  serviceId,
20239
19652
  reason: `its config items could not be read (${error.message}) \u2014 deployed without them`
20240
19653
  });
20241
19654
  }
20242
- services2.push({
19655
+ services.push({
20243
19656
  // Relative to the service, because the deployed archive's root IS the service.
20244
- serviceFilePath: import_path7.default.relative(serviceDir, serviceFilePath),
19657
+ serviceFilePath: import_path6.default.relative(serviceDir, serviceFilePath),
20245
19658
  serviceId,
20246
19659
  serviceInfo,
20247
19660
  methodsMap,
20248
19661
  configDescriptions,
20249
- // v2 only. The console renders a v2 config dialog from the schema itself rather than from the
19662
+ // The console renders the config dialog from the schema itself rather than from the
20250
19663
  // `configDescriptions` projection, so both travel: the schema for the new path, the projection for
20251
19664
  // every consumer that predates it.
20252
- runnerVersion: v2Definition ? "v2" : "v1",
20253
- configSchema: v2Definition?.configSchema ?? null
19665
+ configSchema: definition.configSchema ?? null
20254
19666
  });
20255
19667
  } catch (error) {
20256
19668
  skipped.push({ serviceId, reason: error.message });
20257
19669
  }
20258
19670
  }
20259
- return { services: services2, skipped };
19671
+ return { services, skipped };
20260
19672
  }
20261
19673
 
20262
19674
  // src/operations/deploy/hash.ts
20263
19675
  var import_crypto4 = require("crypto");
20264
- var import_fs5 = __toESM(require("fs"));
20265
- var import_path8 = __toESM(require("path"));
19676
+ var import_fs4 = __toESM(require("fs"));
19677
+ var import_path7 = __toESM(require("path"));
20266
19678
  async function computeServiceHash(projectRoot, serviceId) {
20267
19679
  const hash = (0, import_crypto4.createHash)("sha256");
20268
- const serviceDir = import_path8.default.resolve(projectRoot, "services", serviceId);
19680
+ const serviceDir = import_path7.default.resolve(projectRoot, "services", serviceId);
20269
19681
  const files = [];
20270
19682
  collectFiles(serviceDir, "", files);
20271
19683
  files.sort();
20272
19684
  for (const file of files) {
20273
19685
  hash.update(file);
20274
- hash.update(import_fs5.default.readFileSync(import_path8.default.resolve(serviceDir, file)));
19686
+ hash.update(import_fs4.default.readFileSync(import_path7.default.resolve(serviceDir, file)));
20275
19687
  }
20276
19688
  return hash.digest("hex");
20277
19689
  }
20278
19690
  function collectFiles(serviceDir, relativeDir, files) {
20279
- const entries = import_fs5.default.readdirSync(import_path8.default.resolve(serviceDir, relativeDir), { withFileTypes: true });
19691
+ const entries = import_fs4.default.readdirSync(import_path7.default.resolve(serviceDir, relativeDir), { withFileTypes: true });
20280
19692
  for (const entry of entries) {
20281
19693
  if (HASH_EXCLUDED_FOLDERS.includes(entry.name)) {
20282
19694
  continue;
20283
19695
  }
20284
- const relativePath = relativeDir ? import_path8.default.join(relativeDir, entry.name) : entry.name;
19696
+ const relativePath = relativeDir ? import_path7.default.join(relativeDir, entry.name) : entry.name;
20285
19697
  if (!entry.isSymbolicLink()) {
20286
19698
  if (entry.isDirectory()) {
20287
19699
  collectFiles(serviceDir, relativePath, files);
@@ -20293,14 +19705,14 @@ function collectFiles(serviceDir, relativeDir, files) {
20293
19705
  }
20294
19706
 
20295
19707
  // src/operations/deploy/public-files.ts
20296
- var import_fs6 = __toESM(require("fs"));
20297
- var import_path9 = __toESM(require("path"));
20298
- function collectPublicFiles(services2, projectRoot = process.cwd()) {
19708
+ var import_fs5 = __toESM(require("fs"));
19709
+ var import_path8 = __toESM(require("path"));
19710
+ function collectPublicFiles(services, projectRoot = process.cwd()) {
20299
19711
  const files = [];
20300
19712
  const missing = [];
20301
- for (const service of services2) {
20302
- const servicePublicDir = import_path9.default.resolve(projectRoot, "services", service.serviceId, "public");
20303
- if (!import_fs6.default.existsSync(servicePublicDir)) {
19713
+ for (const service of services) {
19714
+ const servicePublicDir = import_path8.default.resolve(projectRoot, "services", service.serviceId, "public");
19715
+ if (!import_fs5.default.existsSync(servicePublicDir)) {
20304
19716
  continue;
20305
19717
  }
20306
19718
  const iconPath = service.serviceInfo.integrationIcon;
@@ -20308,18 +19720,18 @@ function collectPublicFiles(services2, projectRoot = process.cwd()) {
20308
19720
  continue;
20309
19721
  }
20310
19722
  const relativePath = iconPath.replace(/^\//, "");
20311
- const fullPath = import_path9.default.resolve(servicePublicDir, relativePath);
20312
- if (!fullPath.startsWith(servicePublicDir + import_path9.default.sep)) {
19723
+ const fullPath = import_path8.default.resolve(servicePublicDir, relativePath);
19724
+ if (!fullPath.startsWith(servicePublicDir + import_path8.default.sep)) {
20313
19725
  continue;
20314
19726
  }
20315
- if (!import_fs6.default.existsSync(fullPath)) {
19727
+ if (!import_fs5.default.existsSync(fullPath)) {
20316
19728
  missing.push({ serviceId: service.serviceId, relativePath });
20317
19729
  continue;
20318
19730
  }
20319
19731
  files.push({
20320
19732
  relativePath,
20321
19733
  serviceId: service.serviceId,
20322
- buffer: import_fs6.default.readFileSync(fullPath)
19734
+ buffer: import_fs5.default.readFileSync(fullPath)
20323
19735
  });
20324
19736
  }
20325
19737
  return { files, missing };
@@ -20345,7 +19757,7 @@ function selectServices(available, selection = {}) {
20345
19757
 
20346
19758
  // src/operations/deploy/zip.ts
20347
19759
  var import_archiver = __toESM(require("archiver"));
20348
- var import_path10 = __toESM(require("path"));
19760
+ var import_path9 = __toESM(require("path"));
20349
19761
  async function createServiceZip(definition, projectRoot, serviceId) {
20350
19762
  return new Promise((resolve, reject) => {
20351
19763
  const archive = (0, import_archiver.default)("zip", { zlib: { level: 9 } });
@@ -20353,7 +19765,7 @@ async function createServiceZip(definition, projectRoot, serviceId) {
20353
19765
  archive.on("data", (chunk) => chunks.push(chunk));
20354
19766
  archive.on("end", () => resolve(Buffer.concat(chunks)));
20355
19767
  archive.on("error", reject);
20356
- archive.directory(`${import_path10.default.resolve(projectRoot, "services", serviceId)}/`, "package");
19768
+ archive.directory(`${import_path9.default.resolve(projectRoot, "services", serviceId)}/`, "package");
20357
19769
  archive.append(JSON.stringify(definition, null, 2), { name: "definition.json" });
20358
19770
  archive.finalize();
20359
19771
  });
@@ -20386,7 +19798,7 @@ async function deploy(options = {}) {
20386
19798
  const { serverUrl, workspaceId, workspaceName, deployToken } = await resolveAuth(projectRoot, options.onAuthRequired);
20387
19799
  const credentials = { serverUrl, workspaceId, deployToken };
20388
19800
  const workspace = { workspaceId, workspaceName };
20389
- if (!import_fs7.default.existsSync(import_path11.default.resolve(projectRoot, "services"))) {
19801
+ if (!import_fs6.default.existsSync(import_path10.default.resolve(projectRoot, "services"))) {
20390
19802
  throw new NoServicesDirectoryError();
20391
19803
  }
20392
19804
  emit({ type: "connecting", serverUrl, workspace });
@@ -20463,27 +19875,27 @@ async function guarded(call) {
20463
19875
 
20464
19876
  // src/operations/init/index.ts
20465
19877
  var import_child_process = require("child_process");
20466
- var import_fs13 = __toESM(require("fs"));
20467
- var import_path18 = __toESM(require("path"));
19878
+ var import_fs12 = __toESM(require("fs"));
19879
+ var import_path17 = __toESM(require("path"));
20468
19880
 
20469
19881
  // src/templates/package-root.ts
20470
- var import_fs8 = __toESM(require("fs"));
20471
- var import_path12 = __toESM(require("path"));
19882
+ var import_fs7 = __toESM(require("fs"));
19883
+ var import_path11 = __toESM(require("path"));
20472
19884
  var PACKAGE_NAMES = ["@flowrunner/cli", "flowrunner-cli"];
20473
19885
  var cached = null;
20474
19886
  function findPackageRoot() {
20475
19887
  let dir = __dirname;
20476
19888
  while (true) {
20477
- const manifest = import_path12.default.join(dir, "package.json");
20478
- if (import_fs8.default.existsSync(manifest)) {
19889
+ const manifest = import_path11.default.join(dir, "package.json");
19890
+ if (import_fs7.default.existsSync(manifest)) {
20479
19891
  try {
20480
- if (PACKAGE_NAMES.includes(JSON.parse(import_fs8.default.readFileSync(manifest, "utf-8")).name)) {
19892
+ if (PACKAGE_NAMES.includes(JSON.parse(import_fs7.default.readFileSync(manifest, "utf-8")).name)) {
20481
19893
  return dir;
20482
19894
  }
20483
19895
  } catch {
20484
19896
  }
20485
19897
  }
20486
- const parent = import_path12.default.dirname(dir);
19898
+ const parent = import_path11.default.dirname(dir);
20487
19899
  if (parent === dir) {
20488
19900
  throw new Error(`Could not locate the "${PACKAGE_NAMES[0]}" package root above ${__dirname}`);
20489
19901
  }
@@ -20495,7 +19907,7 @@ function packageRoot() {
20495
19907
  return cached;
20496
19908
  }
20497
19909
  function templatesRoot() {
20498
- return import_path12.default.join(packageRoot(), "templates");
19910
+ return import_path11.default.join(packageRoot(), "templates");
20499
19911
  }
20500
19912
 
20501
19913
  // src/utils/invocation.ts
@@ -20523,24 +19935,24 @@ function resolveServerTarget(target) {
20523
19935
  }
20524
19936
 
20525
19937
  // src/operations/init/create-service.ts
20526
- var import_path16 = __toESM(require("path"));
19938
+ var import_path15 = __toESM(require("path"));
20527
19939
 
20528
19940
  // src/templates/registry.ts
20529
- var import_fs10 = __toESM(require("fs"));
20530
- var import_path14 = __toESM(require("path"));
19941
+ var import_fs9 = __toESM(require("fs"));
19942
+ var import_path13 = __toESM(require("path"));
20531
19943
 
20532
19944
  // src/templates/manifest.ts
20533
- var import_fs9 = __toESM(require("fs"));
19945
+ var import_fs8 = __toESM(require("fs"));
20534
19946
  var import_zod5 = require("zod");
20535
19947
 
20536
19948
  // src/templates/paths.ts
20537
- var import_path13 = __toESM(require("path"));
19949
+ var import_path12 = __toESM(require("path"));
20538
19950
  var SERVICES_DIRECTORY = "services";
20539
19951
  function servicesDirectory(projectRoot = process.cwd()) {
20540
- return import_path13.default.join(projectRoot, SERVICES_DIRECTORY);
19952
+ return import_path12.default.join(projectRoot, SERVICES_DIRECTORY);
20541
19953
  }
20542
19954
  function serviceDirectory(serviceId, projectRoot = process.cwd()) {
20543
- return import_path13.default.join(servicesDirectory(projectRoot), serviceId);
19955
+ return import_path12.default.join(servicesDirectory(projectRoot), serviceId);
20544
19956
  }
20545
19957
 
20546
19958
  // src/templates/manifest.ts
@@ -20550,7 +19962,7 @@ function toServiceId(value) {
20550
19962
  }
20551
19963
  function availableServiceId(id, projectRoot) {
20552
19964
  let candidate = id;
20553
- for (let suffix = 2; import_fs9.default.existsSync(serviceDirectory(candidate, projectRoot)); suffix++) {
19965
+ for (let suffix = 2; import_fs8.default.existsSync(serviceDirectory(candidate, projectRoot)); suffix++) {
20554
19966
  candidate = `${id}-${suffix}`;
20555
19967
  }
20556
19968
  return candidate;
@@ -20562,7 +19974,7 @@ var VALIDATORS = {
20562
19974
  if (!SERVICE_ID_PATTERN.test(value)) {
20563
19975
  return "must start with a lowercase letter and contain only lowercase letters, digits and dashes \u2014 it becomes the folder name and the service id, which is frozen once deployed";
20564
19976
  }
20565
- if (import_fs9.default.existsSync(serviceDirectory(value, context.projectRoot))) {
19977
+ if (import_fs8.default.existsSync(serviceDirectory(value, context.projectRoot))) {
20566
19978
  return `is already taken \u2014 services/${value} exists in this project`;
20567
19979
  }
20568
19980
  return null;
@@ -20633,10 +20045,10 @@ var MANIFEST_FILE = "template.json";
20633
20045
  var DEFAULT_TEMPLATE_ID = "demo-todo-list";
20634
20046
  var DEFAULT_TEMPLATE_ALIAS = "demo";
20635
20047
  function loadTemplate(directory) {
20636
- const manifestPath = import_path14.default.join(directory, MANIFEST_FILE);
20048
+ const manifestPath = import_path13.default.join(directory, MANIFEST_FILE);
20637
20049
  let raw;
20638
20050
  try {
20639
- raw = JSON.parse(import_fs10.default.readFileSync(manifestPath, "utf-8"));
20051
+ raw = JSON.parse(import_fs9.default.readFileSync(manifestPath, "utf-8"));
20640
20052
  } catch (error) {
20641
20053
  throw new Error(`Template manifest ${manifestPath} is not readable JSON: ${error.message}`);
20642
20054
  }
@@ -20647,7 +20059,7 @@ function loadTemplate(directory) {
20647
20059
  ${issues}`);
20648
20060
  }
20649
20061
  const manifest = parsed.data;
20650
- if (manifest.id !== import_path14.default.basename(directory)) {
20062
+ if (manifest.id !== import_path13.default.basename(directory)) {
20651
20063
  throw new Error(`Template in ${directory} declares id "${manifest.id}" \u2014 it must match the folder name`);
20652
20064
  }
20653
20065
  for (const prompt of manifest.prompts) {
@@ -20655,17 +20067,17 @@ ${issues}`);
20655
20067
  throw new Error(`Template "${manifest.id}" prompt "${prompt.name}" defaults to "${prompt.default}", which is not one of its options (${prompt.options.map((option) => option.value).join(", ")})`);
20656
20068
  }
20657
20069
  }
20658
- const filesRoot = import_path14.default.join(directory, "files");
20070
+ const filesRoot = import_path13.default.join(directory, "files");
20659
20071
  for (const file of manifest.files) {
20660
- const source = import_path14.default.resolve(filesRoot, file.from);
20661
- if (!source.startsWith(filesRoot + import_path14.default.sep)) {
20072
+ const source = import_path13.default.resolve(filesRoot, file.from);
20073
+ if (!source.startsWith(filesRoot + import_path13.default.sep)) {
20662
20074
  throw new Error(`Template "${manifest.id}" declares a source outside files/: ${file.from}`);
20663
20075
  }
20664
- if (!import_fs10.default.existsSync(source)) {
20076
+ if (!import_fs9.default.existsSync(source)) {
20665
20077
  throw new Error(`Template "${manifest.id}" declares a missing source file: files/${file.from}`);
20666
20078
  }
20667
- const destination = import_path14.default.normalize(file.to);
20668
- if (import_path14.default.isAbsolute(destination) || destination.split(/[\\/]/).includes("..")) {
20079
+ const destination = import_path13.default.normalize(file.to);
20080
+ if (import_path13.default.isAbsolute(destination) || destination.split(/[\\/]/).includes("..")) {
20669
20081
  throw new Error(`Template "${manifest.id}" declares a destination outside the service folder: ${file.to}`);
20670
20082
  }
20671
20083
  const gate = file.when && (manifest.prompts.some((prompt) => prompt.type === "boolean" && prompt.name === file.when) || typeof manifest.values[file.when] === "boolean");
@@ -20677,10 +20089,10 @@ ${issues}`);
20677
20089
  }
20678
20090
  function listTemplates() {
20679
20091
  const root = templatesRoot();
20680
- if (!import_fs10.default.existsSync(root)) {
20092
+ if (!import_fs9.default.existsSync(root)) {
20681
20093
  return [];
20682
20094
  }
20683
- const templates = import_fs10.default.readdirSync(root, { withFileTypes: true }).filter((entry) => entry.isDirectory() && import_fs10.default.existsSync(import_path14.default.join(root, entry.name, MANIFEST_FILE))).map((entry) => loadTemplate(import_path14.default.join(root, entry.name)));
20095
+ const templates = import_fs9.default.readdirSync(root, { withFileTypes: true }).filter((entry) => entry.isDirectory() && import_fs9.default.existsSync(import_path13.default.join(root, entry.name, MANIFEST_FILE))).map((entry) => loadTemplate(import_path13.default.join(root, entry.name)));
20684
20096
  if (templates.length > 0 && !templates.some((template) => template.isDefault)) {
20685
20097
  throw new Error(`DEFAULT_TEMPLATE_ID is "${DEFAULT_TEMPLATE_ID}", but no template with that id is bundled`);
20686
20098
  }
@@ -20699,8 +20111,8 @@ function findTemplate(id) {
20699
20111
  }
20700
20112
 
20701
20113
  // src/templates/scaffold.ts
20702
- var import_fs11 = __toESM(require("fs"));
20703
- var import_path15 = __toESM(require("path"));
20114
+ var import_fs10 = __toESM(require("fs"));
20115
+ var import_path14 = __toESM(require("path"));
20704
20116
 
20705
20117
  // src/templates/render.ts
20706
20118
  var PLACEHOLDER = /\{\{\s*([a-zA-Z0-9_]+)\s*(?:\|\s*([a-zA-Z0-9_]+)\s*)?\}\}/g;
@@ -20768,19 +20180,19 @@ function render(source, answers, origin) {
20768
20180
  // src/templates/scaffold.ts
20769
20181
  var BINARY_EXTENSIONS = /* @__PURE__ */ new Set([".png", ".jpg", ".jpeg", ".gif", ".webp", ".ico", ".zip", ".woff", ".woff2"]);
20770
20182
  function renderTemplate(template, answers) {
20771
- const filesRoot = import_path15.default.join(template.directory, "files");
20183
+ const filesRoot = import_path14.default.join(template.directory, "files");
20772
20184
  const rendered = [];
20773
20185
  for (const file of template.manifest.files) {
20774
20186
  if (file.when && !answers[file.when]) {
20775
20187
  continue;
20776
20188
  }
20777
- const source = import_path15.default.join(filesRoot, file.from);
20189
+ const source = import_path14.default.join(filesRoot, file.from);
20778
20190
  const relativePath = render(file.to, answers, `destination of ${file.from}`);
20779
- if (BINARY_EXTENSIONS.has(import_path15.default.extname(file.from).toLowerCase())) {
20780
- rendered.push({ relativePath, contents: import_fs11.default.readFileSync(source) });
20191
+ if (BINARY_EXTENSIONS.has(import_path14.default.extname(file.from).toLowerCase())) {
20192
+ rendered.push({ relativePath, contents: import_fs10.default.readFileSync(source) });
20781
20193
  continue;
20782
20194
  }
20783
- const contents = render(import_fs11.default.readFileSync(source, "utf-8"), answers, `${template.manifest.id}/files/${file.from}`);
20195
+ const contents = render(import_fs10.default.readFileSync(source, "utf-8"), answers, `${template.manifest.id}/files/${file.from}`);
20784
20196
  rendered.push({ relativePath, contents: Buffer.from(contents, "utf-8") });
20785
20197
  }
20786
20198
  return rendered;
@@ -20789,20 +20201,20 @@ function scaffoldService(template, answers, serviceId, projectRoot = process.cwd
20789
20201
  const files = renderTemplate(template, answers);
20790
20202
  const servicesRoot = servicesDirectory(projectRoot);
20791
20203
  const serviceDirectory2 = serviceDirectory(serviceId, projectRoot);
20792
- if (import_fs11.default.existsSync(serviceDirectory2)) {
20204
+ if (import_fs10.default.existsSync(serviceDirectory2)) {
20793
20205
  throw new Error(`services/${serviceId} already exists \u2014 pick another service id, or remove it first.`);
20794
20206
  }
20795
20207
  for (const file of files) {
20796
- const target = import_path15.default.resolve(serviceDirectory2, file.relativePath);
20797
- if (target !== serviceDirectory2 && !target.startsWith(serviceDirectory2 + import_path15.default.sep)) {
20208
+ const target = import_path14.default.resolve(serviceDirectory2, file.relativePath);
20209
+ if (target !== serviceDirectory2 && !target.startsWith(serviceDirectory2 + import_path14.default.sep)) {
20798
20210
  throw new Error(`Template "${template.manifest.id}" resolved a path outside the service folder: ${file.relativePath}`);
20799
20211
  }
20800
20212
  }
20801
- const createdServicesDirectory = !import_fs11.default.existsSync(servicesRoot);
20213
+ const createdServicesDirectory = !import_fs10.default.existsSync(servicesRoot);
20802
20214
  for (const file of files) {
20803
- const target = import_path15.default.join(serviceDirectory2, file.relativePath);
20804
- import_fs11.default.mkdirSync(import_path15.default.dirname(target), { recursive: true });
20805
- import_fs11.default.writeFileSync(target, file.contents);
20215
+ const target = import_path14.default.join(serviceDirectory2, file.relativePath);
20216
+ import_fs10.default.mkdirSync(import_path14.default.dirname(target), { recursive: true });
20217
+ import_fs10.default.writeFileSync(target, file.contents);
20806
20218
  }
20807
20219
  return { serviceDirectory: serviceDirectory2, files, createdServicesDirectory };
20808
20220
  }
@@ -20955,7 +20367,7 @@ async function scaffoldFromTemplate(template, options = {}, projectRoot = option
20955
20367
  });
20956
20368
  const serviceId = String(answers.id);
20957
20369
  const { serviceDirectory: serviceDirectory2, files, createdServicesDirectory } = scaffoldService(template, answers, serviceId, projectRoot);
20958
- const relativePath = import_path16.default.relative(projectRoot, serviceDirectory2) || serviceDirectory2;
20370
+ const relativePath = import_path15.default.relative(projectRoot, serviceDirectory2) || serviceDirectory2;
20959
20371
  const written = files.map((file) => file.relativePath);
20960
20372
  if (createdServicesDirectory) {
20961
20373
  emit({ type: "created-services-directory" });
@@ -20968,24 +20380,24 @@ async function createService(templateId, options = {}) {
20968
20380
  }
20969
20381
 
20970
20382
  // src/operations/init/testing.ts
20971
- var import_fs12 = __toESM(require("fs"));
20972
- var import_path17 = __toESM(require("path"));
20383
+ var import_fs11 = __toESM(require("fs"));
20384
+ var import_path16 = __toESM(require("path"));
20973
20385
  function testingFilesDirectory() {
20974
- return import_path17.default.join(packageRoot(), PROJECT_FILES_DIRECTORY);
20386
+ return import_path16.default.join(packageRoot(), PROJECT_FILES_DIRECTORY);
20975
20387
  }
20976
20388
  function writeTestingFiles(projectRoot) {
20977
20389
  const source = testingFilesDirectory();
20978
20390
  const created = [];
20979
20391
  const skipped = [];
20980
20392
  for (const file of TESTING_FILES) {
20981
- const target = import_path17.default.join(projectRoot, file);
20982
- if (import_fs12.default.existsSync(target)) {
20393
+ const target = import_path16.default.join(projectRoot, file);
20394
+ if (import_fs11.default.existsSync(target)) {
20983
20395
  skipped.push(file);
20984
20396
  continue;
20985
20397
  }
20986
- const contents = import_fs12.default.readFileSync(import_path17.default.join(source, file));
20987
- import_fs12.default.mkdirSync(import_path17.default.dirname(target), { recursive: true });
20988
- import_fs12.default.writeFileSync(target, contents);
20398
+ const contents = import_fs11.default.readFileSync(import_path16.default.join(source, file));
20399
+ import_fs11.default.mkdirSync(import_path16.default.dirname(target), { recursive: true });
20400
+ import_fs11.default.writeFileSync(target, contents);
20989
20401
  created.push(file);
20990
20402
  }
20991
20403
  return { created, skipped };
@@ -20996,10 +20408,10 @@ var GITIGNORE_ENTRIES = ["node_modules/", `${TOKEN_DIR}/`, ...TEST_GITIGNORE_ENT
20996
20408
  var CLI_PACKAGE = "@flowrunner/cli";
20997
20409
  var CLI_PACKAGE_NAMES = [CLI_PACKAGE, "flowrunner-cli"];
20998
20410
  function cliVersion() {
20999
- return JSON.parse(import_fs13.default.readFileSync(import_path18.default.join(packageRoot(), "package.json"), "utf-8")).version;
20411
+ return JSON.parse(import_fs12.default.readFileSync(import_path17.default.join(packageRoot(), "package.json"), "utf-8")).version;
21000
20412
  }
21001
20413
  function packageNameFrom(directory) {
21002
- const name = import_path18.default.basename(import_path18.default.resolve(directory)).toLowerCase().replace(/[^a-z0-9._-]+/g, "-").replace(/^[._-]+|[-._]+$/g, "");
20414
+ const name = import_path17.default.basename(import_path17.default.resolve(directory)).toLowerCase().replace(/[^a-z0-9._-]+/g, "-").replace(/^[._-]+|[-._]+$/g, "");
21003
20415
  return name || "flowrunner-extensions";
21004
20416
  }
21005
20417
  function addMissing(section, additions, placeholders = {}) {
@@ -21013,11 +20425,11 @@ function addMissing(section, additions, placeholders = {}) {
21013
20425
  return changed;
21014
20426
  }
21015
20427
  function writePackageJson(projectRoot, tests) {
21016
- const fullPath = import_path18.default.join(projectRoot, "package.json");
20428
+ const fullPath = import_path17.default.join(projectRoot, "package.json");
21017
20429
  const version = cliVersion();
21018
20430
  const devDependencies = { [CLI_PACKAGE]: version, ...tests ? TEST_DEV_DEPENDENCIES : {} };
21019
20431
  const scripts = { deploy: "flowrunner deploy --all", ...tests ? TEST_SCRIPTS : {} };
21020
- if (!import_fs13.default.existsSync(fullPath)) {
20432
+ if (!import_fs12.default.existsSync(fullPath)) {
21021
20433
  const manifest2 = {
21022
20434
  name: packageNameFrom(projectRoot),
21023
20435
  version: "0.0.1",
@@ -21026,10 +20438,10 @@ function writePackageJson(projectRoot, tests) {
21026
20438
  scripts,
21027
20439
  devDependencies
21028
20440
  };
21029
- import_fs13.default.writeFileSync(fullPath, JSON.stringify(manifest2, null, 2) + "\n", "utf-8");
20441
+ import_fs12.default.writeFileSync(fullPath, JSON.stringify(manifest2, null, 2) + "\n", "utf-8");
21030
20442
  return "created";
21031
20443
  }
21032
- const manifest = JSON.parse(import_fs13.default.readFileSync(fullPath, "utf-8"));
20444
+ const manifest = JSON.parse(import_fs12.default.readFileSync(fullPath, "utf-8"));
21033
20445
  const alreadyDeclared = CLI_PACKAGE_NAMES.some((name) => manifest.dependencies?.[name] || manifest.devDependencies?.[name]);
21034
20446
  const additions = alreadyDeclared ? Object.fromEntries(Object.entries(devDependencies).filter(([name]) => name !== CLI_PACKAGE)) : devDependencies;
21035
20447
  manifest.devDependencies ??= {};
@@ -21041,22 +20453,22 @@ function writePackageJson(projectRoot, tests) {
21041
20453
  if (!changed) {
21042
20454
  return "skipped";
21043
20455
  }
21044
- import_fs13.default.writeFileSync(fullPath, JSON.stringify(manifest, null, 2) + "\n", "utf-8");
20456
+ import_fs12.default.writeFileSync(fullPath, JSON.stringify(manifest, null, 2) + "\n", "utf-8");
21045
20457
  return "updated";
21046
20458
  }
21047
20459
  function writeGitignore(projectRoot) {
21048
- const fullPath = import_path18.default.join(projectRoot, ".gitignore");
21049
- if (!import_fs13.default.existsSync(fullPath)) {
21050
- import_fs13.default.writeFileSync(fullPath, GITIGNORE_ENTRIES.join("\n") + "\n", "utf-8");
20460
+ const fullPath = import_path17.default.join(projectRoot, ".gitignore");
20461
+ if (!import_fs12.default.existsSync(fullPath)) {
20462
+ import_fs12.default.writeFileSync(fullPath, GITIGNORE_ENTRIES.join("\n") + "\n", "utf-8");
21051
20463
  return "created";
21052
20464
  }
21053
- const content = import_fs13.default.readFileSync(fullPath, "utf-8");
20465
+ const content = import_fs12.default.readFileSync(fullPath, "utf-8");
21054
20466
  const lines = content.split("\n").map((line) => line.trim());
21055
20467
  const missing = GITIGNORE_ENTRIES.filter((entry) => !lines.includes(entry) && !lines.includes(entry.replace(/\/$/, "")));
21056
20468
  if (missing.length === 0) {
21057
20469
  return "skipped";
21058
20470
  }
21059
- import_fs13.default.appendFileSync(fullPath, `${content.endsWith("\n") ? "" : "\n"}${missing.join("\n")}
20471
+ import_fs12.default.appendFileSync(fullPath, `${content.endsWith("\n") ? "" : "\n"}${missing.join("\n")}
21060
20472
  `);
21061
20473
  return "updated";
21062
20474
  }
@@ -21104,11 +20516,11 @@ The authoring reference the CLI ships lives in
21104
20516
  \`.flowrunner/token\` is the deploy token and must not.
21105
20517
  `;
21106
20518
  function writeReadme(projectRoot) {
21107
- const fullPath = import_path18.default.join(projectRoot, "README.md");
21108
- if (import_fs13.default.existsSync(fullPath)) {
20519
+ const fullPath = import_path17.default.join(projectRoot, "README.md");
20520
+ if (import_fs12.default.existsSync(fullPath)) {
21109
20521
  return "skipped";
21110
20522
  }
21111
- import_fs13.default.writeFileSync(fullPath, README(packageNameFrom(projectRoot)), "utf-8");
20523
+ import_fs12.default.writeFileSync(fullPath, README(packageNameFrom(projectRoot)), "utf-8");
21112
20524
  return "created";
21113
20525
  }
21114
20526
  var JSCONFIG = {
@@ -21120,11 +20532,11 @@ var JSCONFIG = {
21120
20532
  include: ["services/*/src/**/*.js"]
21121
20533
  };
21122
20534
  function writeJsconfig(projectRoot) {
21123
- const fullPath = import_path18.default.join(projectRoot, "jsconfig.json");
21124
- if (import_fs13.default.existsSync(fullPath)) {
20535
+ const fullPath = import_path17.default.join(projectRoot, "jsconfig.json");
20536
+ if (import_fs12.default.existsSync(fullPath)) {
21125
20537
  return "skipped";
21126
20538
  }
21127
- import_fs13.default.writeFileSync(fullPath, JSON.stringify(JSCONFIG, null, 2) + "\n", "utf-8");
20539
+ import_fs12.default.writeFileSync(fullPath, JSON.stringify(JSCONFIG, null, 2) + "\n", "utf-8");
21128
20540
  return "created";
21129
20541
  }
21130
20542
  function git(projectRoot, args) {
@@ -21175,13 +20587,13 @@ function npmInstall(projectRoot, warn) {
21175
20587
  }
21176
20588
  }
21177
20589
  function describeTarget(projectRoot) {
21178
- if (!import_fs13.default.existsSync(projectRoot)) {
20590
+ if (!import_fs12.default.existsSync(projectRoot)) {
21179
20591
  return { projectRoot, lines: ["a new directory"], defaultYes: true };
21180
20592
  }
21181
- if (!import_fs13.default.statSync(projectRoot).isDirectory()) {
20593
+ if (!import_fs12.default.statSync(projectRoot).isDirectory()) {
21182
20594
  return { projectRoot, lines: ["not a directory"], defaultYes: false };
21183
20595
  }
21184
- const entries = import_fs13.default.readdirSync(projectRoot).filter((entry) => entry !== ".git");
20596
+ const entries = import_fs12.default.readdirSync(projectRoot).filter((entry) => entry !== ".git");
21185
20597
  if (entries.length === 0) {
21186
20598
  return { projectRoot, lines: ["an empty directory"], defaultYes: true };
21187
20599
  }
@@ -21198,7 +20610,7 @@ function describeTarget(projectRoot) {
21198
20610
  return { projectRoot, lines, defaultYes: false };
21199
20611
  }
21200
20612
  async function init(options = {}) {
21201
- const projectRoot = import_path18.default.resolve(options.cwd ?? ".");
20613
+ const projectRoot = import_path17.default.resolve(options.cwd ?? ".");
21202
20614
  const emit = emitter(options);
21203
20615
  const warn = (message) => emit({ type: "warning", message });
21204
20616
  const template = options.template ? resolveTemplateId(options.template) : null;
@@ -21225,10 +20637,10 @@ async function init(options = {}) {
21225
20637
  committed: false
21226
20638
  };
21227
20639
  }
21228
- if (!import_fs13.default.existsSync(projectRoot)) {
21229
- import_fs13.default.mkdirSync(projectRoot, { recursive: true });
20640
+ if (!import_fs12.default.existsSync(projectRoot)) {
20641
+ import_fs12.default.mkdirSync(projectRoot, { recursive: true });
21230
20642
  }
21231
- if (!import_fs13.default.statSync(projectRoot).isDirectory()) {
20643
+ if (!import_fs12.default.statSync(projectRoot).isDirectory()) {
21232
20644
  throw new PromptAbortedError(`${projectRoot} is not a directory.`);
21233
20645
  }
21234
20646
  const created = [];
@@ -21269,8 +20681,8 @@ async function init(options = {}) {
21269
20681
  }
21270
20682
 
21271
20683
  // src/operations/init-claude/index.ts
21272
- var import_fs14 = __toESM(require("fs"));
21273
- var import_path19 = __toESM(require("path"));
20684
+ var import_fs13 = __toESM(require("fs"));
20685
+ var import_path18 = __toESM(require("path"));
21274
20686
 
21275
20687
  // src/operations/init-claude/segment.ts
21276
20688
  var BEGIN_MARKER = "<!-- flowrunner-cli:ai:start -->";
@@ -21305,16 +20717,16 @@ function mergeSegment(current, segment, file) {
21305
20717
 
21306
20718
  // src/operations/init-claude/index.ts
21307
20719
  function providerDirectory(provider = CLAUDE_PROVIDER) {
21308
- return import_path19.default.join(packageRoot(), AI_PROVIDERS_DIRECTORY, provider);
20720
+ return import_path18.default.join(packageRoot(), AI_PROVIDERS_DIRECTORY, provider);
21309
20721
  }
21310
20722
  function packedAgents(directory) {
21311
- if (!import_fs14.default.existsSync(directory)) {
20723
+ if (!import_fs13.default.existsSync(directory)) {
21312
20724
  return [];
21313
20725
  }
21314
- return import_fs14.default.readdirSync(directory, { withFileTypes: true }).filter((entry) => entry.isFile() && entry.name.endsWith(".md")).map((entry) => entry.name).sort();
20726
+ return import_fs13.default.readdirSync(directory, { withFileTypes: true }).filter((entry) => entry.isFile() && entry.name.endsWith(".md")).map((entry) => entry.name).sort();
21315
20727
  }
21316
20728
  function writeAgents(sourceDirectory, projectRoot, layout) {
21317
- const directory = import_path19.default.join(projectRoot, layout.agentsDirectory);
20729
+ const directory = import_path18.default.join(projectRoot, layout.agentsDirectory);
21318
20730
  const agents = packedAgents(sourceDirectory);
21319
20731
  const created = [];
21320
20732
  const updated = [];
@@ -21324,59 +20736,59 @@ function writeAgents(sourceDirectory, projectRoot, layout) {
21324
20736
  warnings.push(`The installed CLI ships no agent definitions in ${PROVIDER_AGENTS_DIRECTORY}/ \u2014 none were written.`);
21325
20737
  return { directory, created, updated, unchanged, warnings };
21326
20738
  }
21327
- import_fs14.default.mkdirSync(directory, { recursive: true });
20739
+ import_fs13.default.mkdirSync(directory, { recursive: true });
21328
20740
  for (const agent of agents) {
21329
- const contents = import_fs14.default.readFileSync(import_path19.default.join(sourceDirectory, agent), "utf-8");
21330
- const target = import_path19.default.join(directory, agent);
20741
+ const contents = import_fs13.default.readFileSync(import_path18.default.join(sourceDirectory, agent), "utf-8");
20742
+ const target = import_path18.default.join(directory, agent);
21331
20743
  if (contents.length === 0) {
21332
20744
  warnings.push(`${agent} is empty in the installed CLI \u2014 written as an empty file.`);
21333
20745
  }
21334
- if (!import_fs14.default.existsSync(target)) {
21335
- import_fs14.default.writeFileSync(target, contents, "utf-8");
20746
+ if (!import_fs13.default.existsSync(target)) {
20747
+ import_fs13.default.writeFileSync(target, contents, "utf-8");
21336
20748
  created.push(agent);
21337
20749
  continue;
21338
20750
  }
21339
- if (import_fs14.default.readFileSync(target, "utf-8") === contents) {
20751
+ if (import_fs13.default.readFileSync(target, "utf-8") === contents) {
21340
20752
  unchanged.push(agent);
21341
20753
  continue;
21342
20754
  }
21343
- import_fs14.default.writeFileSync(target, contents, "utf-8");
20755
+ import_fs13.default.writeFileSync(target, contents, "utf-8");
21344
20756
  updated.push(agent);
21345
20757
  }
21346
20758
  return { directory, created, updated, unchanged, warnings };
21347
20759
  }
21348
20760
  function writeSegment(sourceDirectory, projectRoot, layout) {
21349
- const file = import_path19.default.join(projectRoot, layout.instructionsFile);
21350
- const source = import_path19.default.join(sourceDirectory, ORCHESTRATOR_SEGMENT_FILE);
20761
+ const file = import_path18.default.join(projectRoot, layout.instructionsFile);
20762
+ const source = import_path18.default.join(sourceDirectory, ORCHESTRATOR_SEGMENT_FILE);
21351
20763
  const warnings = [];
21352
- if (!import_fs14.default.existsSync(source)) {
20764
+ if (!import_fs13.default.existsSync(source)) {
21353
20765
  warnings.push(`The installed CLI ships no ${ORCHESTRATOR_SEGMENT_FILE} \u2014 ${layout.instructionsFile} was left alone.`);
21354
20766
  return { file, outcome: "unchanged", warnings };
21355
20767
  }
21356
- const segment = import_fs14.default.readFileSync(source, "utf-8");
20768
+ const segment = import_fs13.default.readFileSync(source, "utf-8");
21357
20769
  if (segment.trim().length === 0) {
21358
20770
  warnings.push(`${ORCHESTRATOR_SEGMENT_FILE} is empty in the installed CLI \u2014 the marked block is empty.`);
21359
20771
  }
21360
- const current = import_fs14.default.existsSync(file) ? import_fs14.default.readFileSync(file, "utf-8") : null;
20772
+ const current = import_fs13.default.existsSync(file) ? import_fs13.default.readFileSync(file, "utf-8") : null;
21361
20773
  const merged = mergeSegment(current, segment, layout.instructionsFile);
21362
20774
  if (merged.outcome !== "unchanged") {
21363
- import_fs14.default.writeFileSync(file, merged.contents, "utf-8");
20775
+ import_fs13.default.writeFileSync(file, merged.contents, "utf-8");
21364
20776
  }
21365
20777
  return { file, outcome: merged.outcome, warnings };
21366
20778
  }
21367
20779
  async function initClaude(options = {}) {
21368
- const projectRoot = import_path19.default.resolve(options.cwd ?? ".");
20780
+ const projectRoot = import_path18.default.resolve(options.cwd ?? ".");
21369
20781
  const emit = emitter(options);
21370
20782
  const warnAll = (messages) => messages.forEach((message) => emit({ type: "warning", message }));
21371
20783
  const layout = PROVIDERS[CLAUDE_PROVIDER];
21372
20784
  const sourceDirectory = providerDirectory(layout.id);
21373
- if (!import_fs14.default.existsSync(sourceDirectory)) {
21374
- throw new AiDocsMissingError(import_path19.default.join(AI_PROVIDERS_DIRECTORY, CLAUDE_PROVIDER));
20785
+ if (!import_fs13.default.existsSync(sourceDirectory)) {
20786
+ throw new AiDocsMissingError(import_path18.default.join(AI_PROVIDERS_DIRECTORY, CLAUDE_PROVIDER));
21375
20787
  }
21376
- if (!import_fs14.default.existsSync(projectRoot)) {
21377
- import_fs14.default.mkdirSync(projectRoot, { recursive: true });
20788
+ if (!import_fs13.default.existsSync(projectRoot)) {
20789
+ import_fs13.default.mkdirSync(projectRoot, { recursive: true });
21378
20790
  }
21379
- const agents = writeAgents(import_path19.default.join(sourceDirectory, PROVIDER_AGENTS_DIRECTORY), projectRoot, layout);
20791
+ const agents = writeAgents(import_path18.default.join(sourceDirectory, PROVIDER_AGENTS_DIRECTORY), projectRoot, layout);
21380
20792
  emit({
21381
20793
  type: "agents",
21382
20794
  directory: agents.directory,
@@ -21440,7 +20852,7 @@ var ERROR_HTML = (error) => `<!DOCTYPE html>
21440
20852
  </body></html>`;
21441
20853
 
21442
20854
  // src/server/routes/callback.ts
21443
- function callbackRoute(path19 = "/callback") {
20855
+ function callbackRoute(path18 = "/callback") {
21444
20856
  let resolveCode = null;
21445
20857
  let rejectCode = null;
21446
20858
  const respond = (route2, html) => {
@@ -21449,7 +20861,7 @@ function callbackRoute(path19 = "/callback") {
21449
20861
  };
21450
20862
  const route = {
21451
20863
  method: "GET",
21452
- path: path19,
20864
+ path: path18,
21453
20865
  handle: (context) => {
21454
20866
  const code = context.url.searchParams.get("code");
21455
20867
  const error = context.url.searchParams.get("error");
@@ -21573,12 +20985,12 @@ async function logout(options = {}) {
21573
20985
 
21574
20986
  // src/operations/pull/index.ts
21575
20987
  var import_adm_zip = __toESM(require_adm_zip());
21576
- var import_fs16 = __toESM(require("fs"));
21577
- var import_path21 = __toESM(require("path"));
21578
-
21579
- // src/operations/pull/extract.ts
21580
20988
  var import_fs15 = __toESM(require("fs"));
21581
20989
  var import_path20 = __toESM(require("path"));
20990
+
20991
+ // src/operations/pull/extract.ts
20992
+ var import_fs14 = __toESM(require("fs"));
20993
+ var import_path19 = __toESM(require("path"));
21582
20994
  var PACKAGE_PREFIX = "package/";
21583
20995
  var SAFE_SERVICE_ID = /^[A-Za-z0-9][A-Za-z0-9._-]*$/;
21584
20996
  function isSafeServiceId(serviceId) {
@@ -21597,12 +21009,12 @@ function extractService(archive, directory) {
21597
21009
  let written = 0;
21598
21010
  for (const entry of serviceEntries(archive)) {
21599
21011
  const relativePath = entry.entryName.slice(PACKAGE_PREFIX.length);
21600
- const target = import_path20.default.resolve(directory, relativePath);
21601
- if (target !== directory && !target.startsWith(directory + import_path20.default.sep)) {
21012
+ const target = import_path19.default.resolve(directory, relativePath);
21013
+ if (target !== directory && !target.startsWith(directory + import_path19.default.sep)) {
21602
21014
  continue;
21603
21015
  }
21604
- import_fs15.default.mkdirSync(import_path20.default.dirname(target), { recursive: true });
21605
- import_fs15.default.writeFileSync(target, entry.getData());
21016
+ import_fs14.default.mkdirSync(import_path19.default.dirname(target), { recursive: true });
21017
+ import_fs14.default.writeFileSync(target, entry.getData());
21606
21018
  written++;
21607
21019
  }
21608
21020
  return written;
@@ -21622,7 +21034,7 @@ function declaredDependencies(archive) {
21622
21034
 
21623
21035
  // src/operations/pull/index.ts
21624
21036
  async function localState(projectRoot, service) {
21625
- if (!import_fs16.default.existsSync(import_path21.default.resolve(projectRoot, "services", service.serviceId))) {
21037
+ if (!import_fs15.default.existsSync(import_path20.default.resolve(projectRoot, "services", service.serviceId))) {
21626
21038
  return "absent";
21627
21039
  }
21628
21040
  try {
@@ -21667,7 +21079,7 @@ async function pull(options = {}) {
21667
21079
  emit({ type: "skipped", serviceId: service.serviceId, reason });
21668
21080
  continue;
21669
21081
  }
21670
- const directory = import_path21.default.resolve(projectRoot, "services", service.serviceId);
21082
+ const directory = import_path20.default.resolve(projectRoot, "services", service.serviceId);
21671
21083
  const state = await localState(projectRoot, service);
21672
21084
  if (state === "same") {
21673
21085
  upToDate.push({
@@ -21688,7 +21100,7 @@ async function pull(options = {}) {
21688
21100
  const zipBuffer = await guard(() => downloadRemoteService(credentials, service.serviceId));
21689
21101
  const archive = new import_adm_zip.default(zipBuffer);
21690
21102
  if (exists) {
21691
- import_fs16.default.rmSync(directory, { recursive: true, force: true });
21103
+ import_fs15.default.rmSync(directory, { recursive: true, force: true });
21692
21104
  }
21693
21105
  const files = extractService(archive, directory);
21694
21106
  const dependencies = declaredDependencies(archive);
@@ -21745,10 +21157,10 @@ async function guard(call) {
21745
21157
  }
21746
21158
 
21747
21159
  // src/operations/use-server.ts
21748
- var import_fs17 = __toESM(require("fs"));
21160
+ var import_fs16 = __toESM(require("fs"));
21749
21161
  function useServer(target, options = {}) {
21750
21162
  const projectRoot = options.cwd ?? process.cwd();
21751
- if (!import_fs17.default.existsSync(configPath(projectRoot))) {
21163
+ if (!import_fs16.default.existsSync(configPath(projectRoot))) {
21752
21164
  throw new NotAProjectError();
21753
21165
  }
21754
21166
  const serverUrl = resolveServerTarget(target);