@flowrunner/cli 0.1.0

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 (460) hide show
  1. package/README.md +148 -0
  2. package/ai-docs/instructions/service-code-format/01-service-structure.md +180 -0
  3. package/ai-docs/instructions/service-code-format/02-zod-types.md +260 -0
  4. package/ai-docs/instructions/service-code-format/03-parameters.md +193 -0
  5. package/ai-docs/instructions/service-code-format/04-http-requests.md +257 -0
  6. package/ai-docs/instructions/service-code-format/05-dictionaries.md +103 -0
  7. package/ai-docs/instructions/service-code-format/06-oauth2.md +42 -0
  8. package/ai-docs/instructions/service-code-format/07-actions.md +171 -0
  9. package/ai-docs/instructions/service-code-format/08-polling-triggers.md +54 -0
  10. package/ai-docs/instructions/service-code-format/09-realtime-triggers.md +269 -0
  11. package/ai-docs/instructions/service-code-format/10-files-api.md +148 -0
  12. package/ai-docs/instructions/service-code-format/11-output-model.md +142 -0
  13. package/ai-docs/instructions/service-code-format/12-service-readme.md +69 -0
  14. package/ai-docs/instructions/service-code-format/13-runtime-contracts.md +193 -0
  15. package/ai-docs/instructions/service-code-format/14-reference-service.md +341 -0
  16. package/ai-docs/instructions/service-code-format/15-unit-tests.md +361 -0
  17. package/ai-docs/instructions/service-code-format/16-gotchas.md +201 -0
  18. package/ai-docs/instructions/service-code-format/17-client-certificates.md +162 -0
  19. package/ai-docs/instructions/service-code-format/18-test-recipes.md +160 -0
  20. package/ai-docs/instructions/service-code-format/README.md +120 -0
  21. package/ai-docs/providers/claude/agents/flowrunner-service-code-engineer.md +139 -0
  22. package/ai-docs/providers/claude/agents/flowrunner-service-test-engineer.md +497 -0
  23. package/ai-docs/providers/claude/main-orchestrator-segment.md +51 -0
  24. package/bin/flowrunner.js +66 -0
  25. package/bin/resolve-local.js +98 -0
  26. package/dist/cli.js +10972 -0
  27. package/dist/cli.js.map +7 -0
  28. package/dist/index.d.ts +2 -0
  29. package/dist/index.js +10131 -0
  30. package/dist/index.js.map +7 -0
  31. package/dist/types/flow-extension-runner/src/common/config.d.ts +12 -0
  32. package/dist/types/flow-extension-runner/src/common/constants.d.ts +9 -0
  33. package/dist/types/flow-extension-runner/src/common/context-files.d.ts +107 -0
  34. package/dist/types/flow-extension-runner/src/common/context.d.ts +6 -0
  35. package/dist/types/flow-extension-runner/src/common/types.d.ts +11 -0
  36. package/dist/types/flow-extension-runner/src/errors/base.d.ts +17 -0
  37. package/dist/types/flow-extension-runner/src/errors/codes.d.ts +17 -0
  38. package/dist/types/flow-extension-runner/src/errors/errors.d.ts +48 -0
  39. package/dist/types/flow-extension-runner/src/errors/index.d.ts +3 -0
  40. package/dist/types/flow-extension-runner/src/global.d.ts +34 -0
  41. package/dist/types/flow-extension-runner/src/index.d.ts +15 -0
  42. package/dist/types/flow-extension-runner/src/namespace.d.ts +3 -0
  43. package/dist/types/flow-extension-runner/src/v1/config.d.ts +3 -0
  44. package/dist/types/flow-extension-runner/src/v1/constants.d.ts +4 -0
  45. package/dist/types/flow-extension-runner/src/v1/index.d.ts +11 -0
  46. package/dist/types/flow-extension-runner/src/v1/namespace.d.ts +9 -0
  47. package/dist/types/flow-extension-runner/src/v1/service.d.ts +29 -0
  48. package/dist/types/flow-extension-runner/src/v1/types.d.ts +13 -0
  49. package/dist/types/flow-extension-runner/src/v2/actions/action-method.d.ts +34 -0
  50. package/dist/types/flow-extension-runner/src/v2/context/execution-context.d.ts +25 -0
  51. package/dist/types/flow-extension-runner/src/v2/context/logger.d.ts +2 -0
  52. package/dist/types/flow-extension-runner/src/v2/context/method-input.d.ts +27 -0
  53. package/dist/types/flow-extension-runner/src/v2/context/proxies.d.ts +1 -0
  54. package/dist/types/flow-extension-runner/src/v2/create-extension.d.ts +2 -0
  55. package/dist/types/flow-extension-runner/src/v2/crypto.d.ts +6 -0
  56. package/dist/types/flow-extension-runner/src/v2/dictionaries/dictionary-method.d.ts +24 -0
  57. package/dist/types/flow-extension-runner/src/v2/dictionaries/payload-schema.d.ts +10 -0
  58. package/dist/types/flow-extension-runner/src/v2/extension.d.ts +51 -0
  59. package/dist/types/flow-extension-runner/src/v2/index.d.ts +39 -0
  60. package/dist/types/flow-extension-runner/src/v2/loaders/loader-method.d.ts +31 -0
  61. package/dist/types/flow-extension-runner/src/v2/loaders/loader-owner.d.ts +17 -0
  62. package/dist/types/flow-extension-runner/src/v2/loaders/payload-schema.d.ts +3 -0
  63. package/dist/types/flow-extension-runner/src/v2/method.d.ts +22 -0
  64. package/dist/types/flow-extension-runner/src/v2/model/field-mapper.d.ts +10 -0
  65. package/dist/types/flow-extension-runner/src/v2/model/method-model.d.ts +3 -0
  66. package/dist/types/flow-extension-runner/src/v2/model/model-types.d.ts +70 -0
  67. package/dist/types/flow-extension-runner/src/v2/model/params-model.d.ts +16 -0
  68. package/dist/types/flow-extension-runner/src/v2/oauth/method-names.d.ts +5 -0
  69. package/dist/types/flow-extension-runner/src/v2/oauth/oauth2.d.ts +9 -0
  70. package/dist/types/flow-extension-runner/src/v2/oauth/system-params.d.ts +6 -0
  71. package/dist/types/flow-extension-runner/src/v2/oauth/types.d.ts +54 -0
  72. package/dist/types/flow-extension-runner/src/v2/params/config-params.d.ts +14 -0
  73. package/dist/types/flow-extension-runner/src/v2/params/files-options.d.ts +58 -0
  74. package/dist/types/flow-extension-runner/src/v2/params/index.d.ts +19 -0
  75. package/dist/types/flow-extension-runner/src/v2/params/json/checks.d.ts +26 -0
  76. package/dist/types/flow-extension-runner/src/v2/params/json/decode.d.ts +24 -0
  77. package/dist/types/flow-extension-runner/src/v2/params/json/encode.d.ts +20 -0
  78. package/dist/types/flow-extension-runner/src/v2/params/json/types.d.ts +86 -0
  79. package/dist/types/flow-extension-runner/src/v2/params/json/values.d.ts +5 -0
  80. package/dist/types/flow-extension-runner/src/v2/params/method-params.d.ts +17 -0
  81. package/dist/types/flow-extension-runner/src/v2/params/params.d.ts +26 -0
  82. package/dist/types/flow-extension-runner/src/v2/params/schema/assert-object-schema.d.ts +6 -0
  83. package/dist/types/flow-extension-runner/src/v2/params/schema/assert-supported-schema.d.ts +8 -0
  84. package/dist/types/flow-extension-runner/src/v2/params/schema/coerce.d.ts +54 -0
  85. package/dist/types/flow-extension-runner/src/v2/params/schema/dates.d.ts +40 -0
  86. package/dist/types/flow-extension-runner/src/v2/params/schema/defaults.d.ts +36 -0
  87. package/dist/types/flow-extension-runner/src/v2/params/schema/field-plan.d.ts +33 -0
  88. package/dist/types/flow-extension-runner/src/v2/params/schema/introspect.d.ts +58 -0
  89. package/dist/types/flow-extension-runner/src/v2/params/schema/labels.d.ts +3 -0
  90. package/dist/types/flow-extension-runner/src/v2/params/schema/messages.d.ts +16 -0
  91. package/dist/types/flow-extension-runner/src/v2/params/schema/normalize.d.ts +8 -0
  92. package/dist/types/flow-extension-runner/src/v2/params/schema/parse.d.ts +7 -0
  93. package/dist/types/flow-extension-runner/src/v2/params/types.d.ts +29 -0
  94. package/dist/types/flow-extension-runner/src/v2/params/widget-types.d.ts +40 -0
  95. package/dist/types/flow-extension-runner/src/v2/params/zod.d.ts +86 -0
  96. package/dist/types/flow-extension-runner/src/v2/path.d.ts +1 -0
  97. package/dist/types/flow-extension-runner/src/v2/polling-triggers/mechanisms.d.ts +19 -0
  98. package/dist/types/flow-extension-runner/src/v2/polling-triggers/method-names.d.ts +1 -0
  99. package/dist/types/flow-extension-runner/src/v2/polling-triggers/polling-triggers.d.ts +11 -0
  100. package/dist/types/flow-extension-runner/src/v2/polling-triggers/system-params.d.ts +7 -0
  101. package/dist/types/flow-extension-runner/src/v2/polling-triggers/trigger-method.d.ts +25 -0
  102. package/dist/types/flow-extension-runner/src/v2/polling-triggers/types.d.ts +46 -0
  103. package/dist/types/flow-extension-runner/src/v2/realtime-triggers/method-names.d.ts +7 -0
  104. package/dist/types/flow-extension-runner/src/v2/realtime-triggers/realtime-setup.d.ts +10 -0
  105. package/dist/types/flow-extension-runner/src/v2/realtime-triggers/system-params.d.ts +29 -0
  106. package/dist/types/flow-extension-runner/src/v2/realtime-triggers/trigger-method.d.ts +33 -0
  107. package/dist/types/flow-extension-runner/src/v2/realtime-triggers/types.d.ts +147 -0
  108. package/dist/types/flow-extension-runner/src/v2/realtime-triggers/verify.d.ts +2 -0
  109. package/dist/types/flow-extension-runner/src/v2/registry.d.ts +20 -0
  110. package/dist/types/flow-extension-runner/src/v2/result.d.ts +13 -0
  111. package/dist/types/flow-extension-runner/src/v2/system-method.d.ts +41 -0
  112. package/dist/types/flow-extension-runner/src/v2/types.d.ts +126 -0
  113. package/dist/types/jsdoc-parser/src/custom-type-defs/files.d.ts +2 -0
  114. package/dist/types/jsdoc-parser/src/index.d.ts +2 -0
  115. package/dist/types/jsdoc-parser/src/lib.d.ts +42 -0
  116. package/dist/types/jsdoc-parser/src/types.d.ts +2 -0
  117. package/dist/types/packages/cli/src/api/console-client.d.ts +69 -0
  118. package/dist/types/packages/cli/src/constants/index.d.ts +5 -0
  119. package/dist/types/packages/cli/src/constants/packaging.d.ts +7 -0
  120. package/dist/types/packages/cli/src/constants/project.d.ts +9 -0
  121. package/dist/types/packages/cli/src/constants/providers.d.ts +30 -0
  122. package/dist/types/packages/cli/src/constants/server.d.ts +29 -0
  123. package/dist/types/packages/cli/src/constants/testing.d.ts +32 -0
  124. package/dist/types/packages/cli/src/errors.d.ts +131 -0
  125. package/dist/types/packages/cli/src/index.d.ts +29 -0
  126. package/dist/types/packages/cli/src/operations/deploy/discover-services.d.ts +26 -0
  127. package/dist/types/packages/cli/src/operations/deploy/hash.d.ts +1 -0
  128. package/dist/types/packages/cli/src/operations/deploy/index.d.ts +94 -0
  129. package/dist/types/packages/cli/src/operations/deploy/public-files.d.ts +20 -0
  130. package/dist/types/packages/cli/src/operations/deploy/select.d.ts +9 -0
  131. package/dist/types/packages/cli/src/operations/deploy/zip.d.ts +1 -0
  132. package/dist/types/packages/cli/src/operations/init/answers.d.ts +35 -0
  133. package/dist/types/packages/cli/src/operations/init/create-service.d.ts +39 -0
  134. package/dist/types/packages/cli/src/operations/init/index.d.ts +79 -0
  135. package/dist/types/packages/cli/src/operations/init/testing.d.ts +13 -0
  136. package/dist/types/packages/cli/src/operations/init-claude/index.d.ts +40 -0
  137. package/dist/types/packages/cli/src/operations/init-claude/segment.d.ts +25 -0
  138. package/dist/types/packages/cli/src/operations/login.d.ts +38 -0
  139. package/dist/types/packages/cli/src/operations/logout.d.ts +19 -0
  140. package/dist/types/packages/cli/src/operations/pull/extract.d.ts +23 -0
  141. package/dist/types/packages/cli/src/operations/pull/index.d.ts +87 -0
  142. package/dist/types/packages/cli/src/operations/server-target.d.ts +14 -0
  143. package/dist/types/packages/cli/src/operations/types.d.ts +20 -0
  144. package/dist/types/packages/cli/src/operations/use-server.d.ts +17 -0
  145. package/dist/types/packages/cli/src/project/auth.d.ts +41 -0
  146. package/dist/types/packages/cli/src/project/config.d.ts +31 -0
  147. package/dist/types/packages/cli/src/project/token.d.ts +5 -0
  148. package/dist/types/packages/cli/src/server/index.d.ts +14 -0
  149. package/dist/types/packages/cli/src/server/pages.d.ts +2 -0
  150. package/dist/types/packages/cli/src/server/routes/callback.d.ts +6 -0
  151. package/dist/types/packages/cli/src/server/types.d.ts +12 -0
  152. package/dist/types/packages/cli/src/templates/index.d.ts +8 -0
  153. package/dist/types/packages/cli/src/templates/manifest.d.ts +97 -0
  154. package/dist/types/packages/cli/src/templates/package-root.d.ts +3 -0
  155. package/dist/types/packages/cli/src/templates/paths.d.ts +3 -0
  156. package/dist/types/packages/cli/src/templates/registry.d.ts +13 -0
  157. package/dist/types/packages/cli/src/templates/render.d.ts +13 -0
  158. package/dist/types/packages/cli/src/templates/scaffold.d.ts +25 -0
  159. package/dist/types/packages/cli/src/utils/invocation.d.ts +28 -0
  160. package/dist/types/packages/cli/src/utils/open-browser.d.ts +2 -0
  161. package/dist/types/shared/src/constants/ai-agent-tools.d.ts +20 -0
  162. package/dist/types/shared/src/constants/ai.d.ts +11 -0
  163. package/dist/types/shared/src/constants/api-keys.d.ts +1 -0
  164. package/dist/types/shared/src/constants/app.d.ts +58 -0
  165. package/dist/types/shared/src/constants/billing.d.ts +16 -0
  166. package/dist/types/shared/src/constants/compliances.d.ts +3 -0
  167. package/dist/types/shared/src/constants/data-types.d.ts +26 -0
  168. package/dist/types/shared/src/constants/error-codes.d.ts +16 -0
  169. package/dist/types/shared/src/constants/flow.d.ts +12 -0
  170. package/dist/types/shared/src/constants/index.d.ts +16 -0
  171. package/dist/types/shared/src/constants/knowledge-base.d.ts +13 -0
  172. package/dist/types/shared/src/constants/notification-types.d.ts +985 -0
  173. package/dist/types/shared/src/constants/notifications.d.ts +10 -0
  174. package/dist/types/shared/src/constants/patterns.d.ts +28 -0
  175. package/dist/types/shared/src/constants/retry-policy.d.ts +30 -0
  176. package/dist/types/shared/src/constants/severity.d.ts +9 -0
  177. package/dist/types/shared/src/constants/shared-extensions-search.d.ts +6 -0
  178. package/dist/types/shared/src/constants/shared-extensions.d.ts +35 -0
  179. package/dist/types/shared/src/constants/zod.d.ts +2 -0
  180. package/dist/types/shared/src/errors/api.d.ts +4 -0
  181. package/dist/types/shared/src/errors/base.d.ts +38 -0
  182. package/dist/types/shared/src/errors/common.d.ts +39 -0
  183. package/dist/types/shared/src/errors/index.d.ts +13 -0
  184. package/dist/types/shared/src/errors/k8s.d.ts +4 -0
  185. package/dist/types/shared/src/errors/message.d.ts +48 -0
  186. package/dist/types/shared/src/errors/open-search.d.ts +4 -0
  187. package/dist/types/shared/src/errors/s3.d.ts +11 -0
  188. package/dist/types/shared/src/extensions/zod.d.ts +25 -0
  189. package/dist/types/shared/src/scheme/account/dto.d.ts +60 -0
  190. package/dist/types/shared/src/scheme/account/index.d.ts +1 -0
  191. package/dist/types/shared/src/scheme/ai-agent-tools/dto.d.ts +69 -0
  192. package/dist/types/shared/src/scheme/ai-agent-tools/index.d.ts +2 -0
  193. package/dist/types/shared/src/scheme/ai-agent-tools/parameters.d.ts +7 -0
  194. package/dist/types/shared/src/scheme/ai-router/dto.d.ts +23 -0
  195. package/dist/types/shared/src/scheme/ai-router/index.d.ts +2 -0
  196. package/dist/types/shared/src/scheme/api-keys/dto.d.ts +28 -0
  197. package/dist/types/shared/src/scheme/api-keys/index.d.ts +2 -0
  198. package/dist/types/shared/src/scheme/app/index.d.ts +1 -0
  199. package/dist/types/shared/src/scheme/app/java.dto.d.ts +6 -0
  200. package/dist/types/shared/src/scheme/billing/index.d.ts +1 -0
  201. package/dist/types/shared/src/scheme/billing/java.dto.d.ts +163 -0
  202. package/dist/types/shared/src/scheme/crm/billing.d.ts +149 -0
  203. package/dist/types/shared/src/scheme/crm/dto.d.ts +212 -0
  204. package/dist/types/shared/src/scheme/crm/index.d.ts +3 -0
  205. package/dist/types/shared/src/scheme/data-types/index.d.ts +1 -0
  206. package/dist/types/shared/src/scheme/data-types/java.dto.d.ts +23 -0
  207. package/dist/types/shared/src/scheme/dynamic-forms/dto.d.ts +30 -0
  208. package/dist/types/shared/src/scheme/dynamic-forms/index.d.ts +2 -0
  209. package/dist/types/shared/src/scheme/extensions/index.d.ts +1 -0
  210. package/dist/types/shared/src/scheme/extensions/params-to-zod.d.ts +14 -0
  211. package/dist/types/shared/src/scheme/flowrunner/custom-elements.d.ts +368 -0
  212. package/dist/types/shared/src/scheme/flowrunner/index.d.ts +3 -0
  213. package/dist/types/shared/src/scheme/flowrunner/java.dto.d.ts +628 -0
  214. package/dist/types/shared/src/scheme/index.d.ts +19 -0
  215. package/dist/types/shared/src/scheme/integration-connection/dto.d.ts +81 -0
  216. package/dist/types/shared/src/scheme/integration-connection/index.d.ts +2 -0
  217. package/dist/types/shared/src/scheme/knowledge-base/dto.d.ts +540 -0
  218. package/dist/types/shared/src/scheme/knowledge-base/index.d.ts +2 -0
  219. package/dist/types/shared/src/scheme/mcp-oauth/dto.d.ts +7 -0
  220. package/dist/types/shared/src/scheme/mcp-oauth/index.d.ts +2 -0
  221. package/dist/types/shared/src/scheme/notifications/dto.d.ts +111 -0
  222. package/dist/types/shared/src/scheme/notifications/index.d.ts +3 -0
  223. package/dist/types/shared/src/scheme/notifications/rest.d.ts +148 -0
  224. package/dist/types/shared/src/scheme/properties/account.d.ts +3 -0
  225. package/dist/types/shared/src/scheme/properties/app.d.ts +5 -0
  226. package/dist/types/shared/src/scheme/properties/billing.d.ts +12 -0
  227. package/dist/types/shared/src/scheme/properties/common.d.ts +2 -0
  228. package/dist/types/shared/src/scheme/properties/db.d.ts +8 -0
  229. package/dist/types/shared/src/scheme/properties/flow-extensions.d.ts +7 -0
  230. package/dist/types/shared/src/scheme/properties/index.d.ts +7 -0
  231. package/dist/types/shared/src/scheme/remote-mcp-server/dto.d.ts +278 -0
  232. package/dist/types/shared/src/scheme/remote-mcp-server/index.d.ts +2 -0
  233. package/dist/types/shared/src/scheme/shared-extensions/base.d.ts +56 -0
  234. package/dist/types/shared/src/scheme/shared-extensions/config.d.ts +96 -0
  235. package/dist/types/shared/src/scheme/shared-extensions/custom-extensions.d.ts +485 -0
  236. package/dist/types/shared/src/scheme/shared-extensions/extension.d.ts +387 -0
  237. package/dist/types/shared/src/scheme/shared-extensions/flow-extensions.d.ts +64 -0
  238. package/dist/types/shared/src/scheme/shared-extensions/index.d.ts +15 -0
  239. package/dist/types/shared/src/scheme/shared-extensions/light.d.ts +38 -0
  240. package/dist/types/shared/src/scheme/shared-extensions/logs.d.ts +21 -0
  241. package/dist/types/shared/src/scheme/shared-extensions/methods.d.ts +80 -0
  242. package/dist/types/shared/src/scheme/shared-extensions/params-schema.d.ts +47 -0
  243. package/dist/types/shared/src/scheme/shared-extensions/popular-pool.d.ts +11 -0
  244. package/dist/types/shared/src/scheme/shared-extensions/resolve.d.ts +364 -0
  245. package/dist/types/shared/src/scheme/shared-extensions/rest.d.ts +9 -0
  246. package/dist/types/shared/src/scheme/shared-extensions/search.d.ts +177 -0
  247. package/dist/types/shared/src/scheme/shared-extensions/service-identity.d.ts +10 -0
  248. package/dist/types/shared/src/scheme/shared-extensions/service-info.d.ts +15 -0
  249. package/dist/types/shared/src/scheme/workspace/dto.d.ts +40 -0
  250. package/dist/types/shared/src/scheme/workspace/index.d.ts +1 -0
  251. package/dist/types/shared/src/utils/object.d.ts +8 -0
  252. package/dist/types/shared/src/utils/uuid.d.ts +5 -0
  253. package/dist/types/shared/src/utils/versions.d.ts +4 -0
  254. package/dist/types/types/backendless-request.d.ts +40 -0
  255. package/package.json +66 -0
  256. package/project-files/jest.config.js +38 -0
  257. package/project-files/jest.setup.js +24 -0
  258. package/project-files/sandbox/files-mock.js +654 -0
  259. package/project-files/sandbox/index.js +32 -0
  260. package/project-files/sandbox/nock-mock.js +600 -0
  261. package/project-files/sandbox/service.js +145 -0
  262. package/runtime/index.d.ts +2 -0
  263. package/runtime/index.js +5665 -0
  264. package/runtime/index.js.map +7 -0
  265. package/runtime/types/flow-extension-runner/src/common/config.d.ts +12 -0
  266. package/runtime/types/flow-extension-runner/src/common/constants.d.ts +9 -0
  267. package/runtime/types/flow-extension-runner/src/common/context-files.d.ts +107 -0
  268. package/runtime/types/flow-extension-runner/src/common/context.d.ts +6 -0
  269. package/runtime/types/flow-extension-runner/src/common/types.d.ts +11 -0
  270. package/runtime/types/flow-extension-runner/src/errors/base.d.ts +17 -0
  271. package/runtime/types/flow-extension-runner/src/errors/codes.d.ts +17 -0
  272. package/runtime/types/flow-extension-runner/src/errors/errors.d.ts +48 -0
  273. package/runtime/types/flow-extension-runner/src/errors/index.d.ts +3 -0
  274. package/runtime/types/flow-extension-runner/src/global.d.ts +34 -0
  275. package/runtime/types/flow-extension-runner/src/index.d.ts +15 -0
  276. package/runtime/types/flow-extension-runner/src/namespace.d.ts +3 -0
  277. package/runtime/types/flow-extension-runner/src/v1/config.d.ts +3 -0
  278. package/runtime/types/flow-extension-runner/src/v1/constants.d.ts +4 -0
  279. package/runtime/types/flow-extension-runner/src/v1/index.d.ts +11 -0
  280. package/runtime/types/flow-extension-runner/src/v1/namespace.d.ts +9 -0
  281. package/runtime/types/flow-extension-runner/src/v1/service.d.ts +29 -0
  282. package/runtime/types/flow-extension-runner/src/v1/types.d.ts +13 -0
  283. package/runtime/types/flow-extension-runner/src/v2/actions/action-method.d.ts +34 -0
  284. package/runtime/types/flow-extension-runner/src/v2/context/execution-context.d.ts +25 -0
  285. package/runtime/types/flow-extension-runner/src/v2/context/logger.d.ts +2 -0
  286. package/runtime/types/flow-extension-runner/src/v2/context/method-input.d.ts +27 -0
  287. package/runtime/types/flow-extension-runner/src/v2/context/proxies.d.ts +1 -0
  288. package/runtime/types/flow-extension-runner/src/v2/create-extension.d.ts +2 -0
  289. package/runtime/types/flow-extension-runner/src/v2/crypto.d.ts +6 -0
  290. package/runtime/types/flow-extension-runner/src/v2/dictionaries/dictionary-method.d.ts +24 -0
  291. package/runtime/types/flow-extension-runner/src/v2/dictionaries/payload-schema.d.ts +10 -0
  292. package/runtime/types/flow-extension-runner/src/v2/extension.d.ts +51 -0
  293. package/runtime/types/flow-extension-runner/src/v2/index.d.ts +39 -0
  294. package/runtime/types/flow-extension-runner/src/v2/loaders/loader-method.d.ts +31 -0
  295. package/runtime/types/flow-extension-runner/src/v2/loaders/loader-owner.d.ts +17 -0
  296. package/runtime/types/flow-extension-runner/src/v2/loaders/payload-schema.d.ts +3 -0
  297. package/runtime/types/flow-extension-runner/src/v2/method.d.ts +22 -0
  298. package/runtime/types/flow-extension-runner/src/v2/model/field-mapper.d.ts +10 -0
  299. package/runtime/types/flow-extension-runner/src/v2/model/method-model.d.ts +3 -0
  300. package/runtime/types/flow-extension-runner/src/v2/model/model-types.d.ts +70 -0
  301. package/runtime/types/flow-extension-runner/src/v2/model/params-model.d.ts +16 -0
  302. package/runtime/types/flow-extension-runner/src/v2/oauth/method-names.d.ts +5 -0
  303. package/runtime/types/flow-extension-runner/src/v2/oauth/oauth2.d.ts +9 -0
  304. package/runtime/types/flow-extension-runner/src/v2/oauth/system-params.d.ts +6 -0
  305. package/runtime/types/flow-extension-runner/src/v2/oauth/types.d.ts +54 -0
  306. package/runtime/types/flow-extension-runner/src/v2/params/config-params.d.ts +14 -0
  307. package/runtime/types/flow-extension-runner/src/v2/params/files-options.d.ts +58 -0
  308. package/runtime/types/flow-extension-runner/src/v2/params/index.d.ts +19 -0
  309. package/runtime/types/flow-extension-runner/src/v2/params/json/checks.d.ts +26 -0
  310. package/runtime/types/flow-extension-runner/src/v2/params/json/decode.d.ts +24 -0
  311. package/runtime/types/flow-extension-runner/src/v2/params/json/encode.d.ts +20 -0
  312. package/runtime/types/flow-extension-runner/src/v2/params/json/types.d.ts +86 -0
  313. package/runtime/types/flow-extension-runner/src/v2/params/json/values.d.ts +5 -0
  314. package/runtime/types/flow-extension-runner/src/v2/params/method-params.d.ts +17 -0
  315. package/runtime/types/flow-extension-runner/src/v2/params/params.d.ts +26 -0
  316. package/runtime/types/flow-extension-runner/src/v2/params/schema/assert-object-schema.d.ts +6 -0
  317. package/runtime/types/flow-extension-runner/src/v2/params/schema/assert-supported-schema.d.ts +8 -0
  318. package/runtime/types/flow-extension-runner/src/v2/params/schema/coerce.d.ts +54 -0
  319. package/runtime/types/flow-extension-runner/src/v2/params/schema/dates.d.ts +40 -0
  320. package/runtime/types/flow-extension-runner/src/v2/params/schema/defaults.d.ts +36 -0
  321. package/runtime/types/flow-extension-runner/src/v2/params/schema/field-plan.d.ts +33 -0
  322. package/runtime/types/flow-extension-runner/src/v2/params/schema/introspect.d.ts +58 -0
  323. package/runtime/types/flow-extension-runner/src/v2/params/schema/labels.d.ts +3 -0
  324. package/runtime/types/flow-extension-runner/src/v2/params/schema/messages.d.ts +16 -0
  325. package/runtime/types/flow-extension-runner/src/v2/params/schema/normalize.d.ts +8 -0
  326. package/runtime/types/flow-extension-runner/src/v2/params/schema/parse.d.ts +7 -0
  327. package/runtime/types/flow-extension-runner/src/v2/params/types.d.ts +29 -0
  328. package/runtime/types/flow-extension-runner/src/v2/params/widget-types.d.ts +40 -0
  329. package/runtime/types/flow-extension-runner/src/v2/params/zod.d.ts +86 -0
  330. package/runtime/types/flow-extension-runner/src/v2/path.d.ts +1 -0
  331. package/runtime/types/flow-extension-runner/src/v2/polling-triggers/mechanisms.d.ts +19 -0
  332. package/runtime/types/flow-extension-runner/src/v2/polling-triggers/method-names.d.ts +1 -0
  333. package/runtime/types/flow-extension-runner/src/v2/polling-triggers/polling-triggers.d.ts +11 -0
  334. package/runtime/types/flow-extension-runner/src/v2/polling-triggers/system-params.d.ts +7 -0
  335. package/runtime/types/flow-extension-runner/src/v2/polling-triggers/trigger-method.d.ts +25 -0
  336. package/runtime/types/flow-extension-runner/src/v2/polling-triggers/types.d.ts +46 -0
  337. package/runtime/types/flow-extension-runner/src/v2/realtime-triggers/method-names.d.ts +7 -0
  338. package/runtime/types/flow-extension-runner/src/v2/realtime-triggers/realtime-setup.d.ts +10 -0
  339. package/runtime/types/flow-extension-runner/src/v2/realtime-triggers/system-params.d.ts +29 -0
  340. package/runtime/types/flow-extension-runner/src/v2/realtime-triggers/trigger-method.d.ts +33 -0
  341. package/runtime/types/flow-extension-runner/src/v2/realtime-triggers/types.d.ts +147 -0
  342. package/runtime/types/flow-extension-runner/src/v2/realtime-triggers/verify.d.ts +2 -0
  343. package/runtime/types/flow-extension-runner/src/v2/registry.d.ts +20 -0
  344. package/runtime/types/flow-extension-runner/src/v2/result.d.ts +13 -0
  345. package/runtime/types/flow-extension-runner/src/v2/system-method.d.ts +41 -0
  346. package/runtime/types/flow-extension-runner/src/v2/types.d.ts +126 -0
  347. package/runtime/types/jsdoc-parser/src/custom-type-defs/files.d.ts +2 -0
  348. package/runtime/types/jsdoc-parser/src/index.d.ts +2 -0
  349. package/runtime/types/jsdoc-parser/src/lib.d.ts +42 -0
  350. package/runtime/types/jsdoc-parser/src/types.d.ts +2 -0
  351. package/runtime/types/packages/cli/src/runtime/index.d.ts +5 -0
  352. package/runtime/types/shared/src/constants/ai-agent-tools.d.ts +20 -0
  353. package/runtime/types/shared/src/constants/ai.d.ts +11 -0
  354. package/runtime/types/shared/src/constants/api-keys.d.ts +1 -0
  355. package/runtime/types/shared/src/constants/app.d.ts +58 -0
  356. package/runtime/types/shared/src/constants/billing.d.ts +16 -0
  357. package/runtime/types/shared/src/constants/compliances.d.ts +3 -0
  358. package/runtime/types/shared/src/constants/data-types.d.ts +26 -0
  359. package/runtime/types/shared/src/constants/error-codes.d.ts +16 -0
  360. package/runtime/types/shared/src/constants/flow.d.ts +12 -0
  361. package/runtime/types/shared/src/constants/index.d.ts +16 -0
  362. package/runtime/types/shared/src/constants/knowledge-base.d.ts +13 -0
  363. package/runtime/types/shared/src/constants/notification-types.d.ts +985 -0
  364. package/runtime/types/shared/src/constants/notifications.d.ts +10 -0
  365. package/runtime/types/shared/src/constants/patterns.d.ts +28 -0
  366. package/runtime/types/shared/src/constants/retry-policy.d.ts +30 -0
  367. package/runtime/types/shared/src/constants/severity.d.ts +9 -0
  368. package/runtime/types/shared/src/constants/shared-extensions-search.d.ts +6 -0
  369. package/runtime/types/shared/src/constants/shared-extensions.d.ts +35 -0
  370. package/runtime/types/shared/src/constants/zod.d.ts +2 -0
  371. package/runtime/types/shared/src/errors/api.d.ts +4 -0
  372. package/runtime/types/shared/src/errors/base.d.ts +38 -0
  373. package/runtime/types/shared/src/errors/common.d.ts +39 -0
  374. package/runtime/types/shared/src/errors/index.d.ts +13 -0
  375. package/runtime/types/shared/src/errors/k8s.d.ts +4 -0
  376. package/runtime/types/shared/src/errors/message.d.ts +48 -0
  377. package/runtime/types/shared/src/errors/open-search.d.ts +4 -0
  378. package/runtime/types/shared/src/errors/s3.d.ts +11 -0
  379. package/runtime/types/shared/src/extensions/zod.d.ts +25 -0
  380. package/runtime/types/shared/src/scheme/account/dto.d.ts +60 -0
  381. package/runtime/types/shared/src/scheme/account/index.d.ts +1 -0
  382. package/runtime/types/shared/src/scheme/ai-agent-tools/dto.d.ts +69 -0
  383. package/runtime/types/shared/src/scheme/ai-agent-tools/index.d.ts +2 -0
  384. package/runtime/types/shared/src/scheme/ai-agent-tools/parameters.d.ts +7 -0
  385. package/runtime/types/shared/src/scheme/ai-router/dto.d.ts +23 -0
  386. package/runtime/types/shared/src/scheme/ai-router/index.d.ts +2 -0
  387. package/runtime/types/shared/src/scheme/api-keys/dto.d.ts +28 -0
  388. package/runtime/types/shared/src/scheme/api-keys/index.d.ts +2 -0
  389. package/runtime/types/shared/src/scheme/app/index.d.ts +1 -0
  390. package/runtime/types/shared/src/scheme/app/java.dto.d.ts +6 -0
  391. package/runtime/types/shared/src/scheme/billing/index.d.ts +1 -0
  392. package/runtime/types/shared/src/scheme/billing/java.dto.d.ts +163 -0
  393. package/runtime/types/shared/src/scheme/crm/billing.d.ts +149 -0
  394. package/runtime/types/shared/src/scheme/crm/dto.d.ts +212 -0
  395. package/runtime/types/shared/src/scheme/crm/index.d.ts +3 -0
  396. package/runtime/types/shared/src/scheme/data-types/index.d.ts +1 -0
  397. package/runtime/types/shared/src/scheme/data-types/java.dto.d.ts +23 -0
  398. package/runtime/types/shared/src/scheme/dynamic-forms/dto.d.ts +30 -0
  399. package/runtime/types/shared/src/scheme/dynamic-forms/index.d.ts +2 -0
  400. package/runtime/types/shared/src/scheme/extensions/index.d.ts +1 -0
  401. package/runtime/types/shared/src/scheme/extensions/params-to-zod.d.ts +14 -0
  402. package/runtime/types/shared/src/scheme/flowrunner/custom-elements.d.ts +368 -0
  403. package/runtime/types/shared/src/scheme/flowrunner/index.d.ts +3 -0
  404. package/runtime/types/shared/src/scheme/flowrunner/java.dto.d.ts +628 -0
  405. package/runtime/types/shared/src/scheme/index.d.ts +19 -0
  406. package/runtime/types/shared/src/scheme/integration-connection/dto.d.ts +81 -0
  407. package/runtime/types/shared/src/scheme/integration-connection/index.d.ts +2 -0
  408. package/runtime/types/shared/src/scheme/knowledge-base/dto.d.ts +540 -0
  409. package/runtime/types/shared/src/scheme/knowledge-base/index.d.ts +2 -0
  410. package/runtime/types/shared/src/scheme/mcp-oauth/dto.d.ts +7 -0
  411. package/runtime/types/shared/src/scheme/mcp-oauth/index.d.ts +2 -0
  412. package/runtime/types/shared/src/scheme/notifications/dto.d.ts +111 -0
  413. package/runtime/types/shared/src/scheme/notifications/index.d.ts +3 -0
  414. package/runtime/types/shared/src/scheme/notifications/rest.d.ts +148 -0
  415. package/runtime/types/shared/src/scheme/properties/account.d.ts +3 -0
  416. package/runtime/types/shared/src/scheme/properties/app.d.ts +5 -0
  417. package/runtime/types/shared/src/scheme/properties/billing.d.ts +12 -0
  418. package/runtime/types/shared/src/scheme/properties/common.d.ts +2 -0
  419. package/runtime/types/shared/src/scheme/properties/db.d.ts +8 -0
  420. package/runtime/types/shared/src/scheme/properties/flow-extensions.d.ts +7 -0
  421. package/runtime/types/shared/src/scheme/properties/index.d.ts +7 -0
  422. package/runtime/types/shared/src/scheme/remote-mcp-server/dto.d.ts +278 -0
  423. package/runtime/types/shared/src/scheme/remote-mcp-server/index.d.ts +2 -0
  424. package/runtime/types/shared/src/scheme/shared-extensions/base.d.ts +56 -0
  425. package/runtime/types/shared/src/scheme/shared-extensions/config.d.ts +96 -0
  426. package/runtime/types/shared/src/scheme/shared-extensions/custom-extensions.d.ts +485 -0
  427. package/runtime/types/shared/src/scheme/shared-extensions/extension.d.ts +387 -0
  428. package/runtime/types/shared/src/scheme/shared-extensions/flow-extensions.d.ts +64 -0
  429. package/runtime/types/shared/src/scheme/shared-extensions/index.d.ts +15 -0
  430. package/runtime/types/shared/src/scheme/shared-extensions/light.d.ts +38 -0
  431. package/runtime/types/shared/src/scheme/shared-extensions/logs.d.ts +21 -0
  432. package/runtime/types/shared/src/scheme/shared-extensions/methods.d.ts +80 -0
  433. package/runtime/types/shared/src/scheme/shared-extensions/params-schema.d.ts +47 -0
  434. package/runtime/types/shared/src/scheme/shared-extensions/popular-pool.d.ts +11 -0
  435. package/runtime/types/shared/src/scheme/shared-extensions/resolve.d.ts +364 -0
  436. package/runtime/types/shared/src/scheme/shared-extensions/rest.d.ts +9 -0
  437. package/runtime/types/shared/src/scheme/shared-extensions/search.d.ts +177 -0
  438. package/runtime/types/shared/src/scheme/shared-extensions/service-identity.d.ts +10 -0
  439. package/runtime/types/shared/src/scheme/shared-extensions/service-info.d.ts +15 -0
  440. package/runtime/types/shared/src/scheme/workspace/dto.d.ts +40 -0
  441. package/runtime/types/shared/src/scheme/workspace/index.d.ts +1 -0
  442. package/runtime/types/shared/src/utils/object.d.ts +8 -0
  443. package/runtime/types/shared/src/utils/uuid.d.ts +5 -0
  444. package/runtime/types/shared/src/utils/versions.d.ts +4 -0
  445. package/runtime/types/types/backendless-request.d.ts +40 -0
  446. package/templates/blank/files/README.md +28 -0
  447. package/templates/blank/files/package.json +8 -0
  448. package/templates/blank/files/public/icon.svg +5 -0
  449. package/templates/blank/files/src/index.js +130 -0
  450. package/templates/blank/template.json +61 -0
  451. package/templates/demo-todo-list/files/README.md +54 -0
  452. package/templates/demo-todo-list/files/package.json +8 -0
  453. package/templates/demo-todo-list/files/public/icon.svg +8 -0
  454. package/templates/demo-todo-list/files/src/index.js +590 -0
  455. package/templates/demo-todo-list/template.json +44 -0
  456. package/templates/qa-test/files/README.md +88 -0
  457. package/templates/qa-test/files/package.json +8 -0
  458. package/templates/qa-test/files/public/icon.svg +8 -0
  459. package/templates/qa-test/files/src/index.js +755 -0
  460. package/templates/qa-test/template.json +62 -0
@@ -0,0 +1,147 @@
1
+ import type { AnySchema, AnyShape, ExtensionShape, HandlerBag, Infer, ProviderPayload, SampleResult } from '../types';
2
+ export interface RealtimeSubTrigger {
3
+ id: string;
4
+ params: Record<string, unknown>;
5
+ providerEventName?: string;
6
+ }
7
+ export interface RealtimeSubscribeResult {
8
+ webhookData?: unknown;
9
+ eventScopeId?: string;
10
+ refreshIntervalInSeconds?: number;
11
+ }
12
+ export interface ResponseToWebhook {
13
+ httpStatus?: number;
14
+ headers?: Record<string, string>;
15
+ body?: unknown;
16
+ rawBody?: string;
17
+ }
18
+ export interface RealtimeResolveResult {
19
+ events?: {
20
+ id: string;
21
+ providerEventData: unknown;
22
+ }[];
23
+ eventScopeId?: string;
24
+ handshake?: boolean;
25
+ responseToWebhook?: ResponseToWebhook;
26
+ /**
27
+ * @deprecated Use `responseToWebhook.rawBody` (a String, sent as raw text/plain) or `.body` (JSON).
28
+ * Still accepted and still forwarded to the platform untouched — nothing is translated, so an existing
29
+ * service keeps working — but new code should declare the response through `responseToWebhook`.
30
+ */
31
+ responseToExternalService?: unknown;
32
+ /** @deprecated Use `responseToWebhook.headers`. Still accepted and forwarded untouched. */
33
+ responseHeaders?: Record<string, unknown>;
34
+ }
35
+ export interface RealtimeVerify<TShape extends ExtensionShape = AnyShape> {
36
+ header: string;
37
+ algo: string;
38
+ encoding: 'hex' | 'base64';
39
+ secret: (config: TShape['config']) => string;
40
+ freshness?: number;
41
+ timestampHeader?: string;
42
+ }
43
+ type InboundBag<TShape extends ExtensionShape = AnyShape> = HandlerBag<TShape> & {
44
+ rawBody?: string;
45
+ headers: Record<string, unknown>;
46
+ };
47
+ export interface HandshakeResult {
48
+ responseToWebhook?: ResponseToWebhook;
49
+ /** @deprecated Use `responseToWebhook.rawBody` / `.body` — see RealtimeResolveResult. */
50
+ responseToExternalService?: unknown;
51
+ /** @deprecated Use `responseToWebhook.headers`. */
52
+ responseHeaders?: Record<string, unknown>;
53
+ }
54
+ export interface RealtimeSetupProps<TShape extends ExtensionShape = AnyShape> {
55
+ scope: 'SINGLE_APP' | 'ALL_APPS';
56
+ extractProviderEventName?: string | ((bag: {
57
+ requestBody: ProviderPayload;
58
+ }) => string | null);
59
+ extractProviderEventData?: string | ((bag: {
60
+ requestBody: ProviderPayload;
61
+ }) => unknown);
62
+ scopeAt?: string;
63
+ verify?: RealtimeVerify<TShape>;
64
+ handshake?: (bag: InboundBag<TShape> & {
65
+ requestBody: ProviderPayload;
66
+ }) => HandshakeResult | void | Promise<HandshakeResult | void>;
67
+ subscribe: (bag: HandlerBag<TShape> & {
68
+ callbackUrl: string;
69
+ triggers: RealtimeSubTrigger[];
70
+ webhookData: ProviderPayload;
71
+ connectionId?: string;
72
+ }) => RealtimeSubscribeResult | Promise<RealtimeSubscribeResult>;
73
+ unsubscribe: (bag: HandlerBag<TShape> & {
74
+ callbackUrl?: string;
75
+ webhookData: ProviderPayload;
76
+ connectionId?: string;
77
+ }) => {
78
+ webhookData?: unknown;
79
+ } | Promise<{
80
+ webhookData?: unknown;
81
+ }>;
82
+ refresh?: (bag: HandlerBag<TShape> & {
83
+ callbackUrl: string;
84
+ triggers: RealtimeSubTrigger[];
85
+ webhookData: ProviderPayload;
86
+ }) => {
87
+ webhookData?: unknown;
88
+ refreshIntervalInSeconds?: number;
89
+ } | Promise<{
90
+ webhookData?: unknown;
91
+ refreshIntervalInSeconds?: number;
92
+ }>;
93
+ resolveEvents?: (bag: InboundBag<TShape> & {
94
+ query: Record<string, unknown>;
95
+ body: ProviderPayload;
96
+ connectionId?: string;
97
+ }) => RealtimeResolveResult | Promise<RealtimeResolveResult>;
98
+ verifyRequest?: (bag: InboundBag<TShape> & {
99
+ config: TShape['config'];
100
+ }) => boolean | Promise<boolean>;
101
+ }
102
+ export interface RealtimeTriggerProps<TShape extends ExtensionShape = AnyShape, TParams extends AnySchema = AnySchema> {
103
+ category: string;
104
+ id: string;
105
+ label: string;
106
+ description: string;
107
+ providerEventName?: string | string[] | ((bag: {
108
+ params: Infer<TParams>;
109
+ }) => string[]);
110
+ params?: TParams;
111
+ result: SampleResult<TShape, TParams>;
112
+ extendEventData?: (bag: {
113
+ requestBody: ProviderPayload;
114
+ providerEventData: ProviderPayload;
115
+ }) => Record<string, unknown>;
116
+ match?: Record<string, string> | ((bag: {
117
+ params: Infer<TParams>;
118
+ providerEventData: ProviderPayload;
119
+ }) => boolean);
120
+ extendResult?: (bag: HandlerBag<TShape> & {
121
+ providerEventData: ProviderPayload;
122
+ }) => unknown;
123
+ oauth2Scopes?: string[];
124
+ logo?: string;
125
+ appearanceColors?: [string, string];
126
+ }
127
+ export interface RealtimeInvocation {
128
+ callbackUrl?: string;
129
+ events?: {
130
+ name: string;
131
+ triggerData?: Record<string, unknown>;
132
+ }[];
133
+ webhookData?: unknown;
134
+ connectionId?: string;
135
+ headers?: Record<string, unknown>;
136
+ queryParams?: Record<string, unknown>;
137
+ body?: unknown;
138
+ rawBody?: string;
139
+ triggers?: {
140
+ id: string;
141
+ data?: Record<string, unknown>;
142
+ }[];
143
+ eventName?: string;
144
+ eventData?: unknown;
145
+ }
146
+ export type RealtimeTriggerDefinition = RealtimeTriggerProps;
147
+ export {};
@@ -0,0 +1,2 @@
1
+ import type { RealtimeVerify } from './types';
2
+ export declare function verifyDeclarative(verify: RealtimeVerify, rawBody: string | undefined, headers: Record<string, unknown>, config: Record<string, unknown>): boolean;
@@ -0,0 +1,20 @@
1
+ import type { Extension } from './extension';
2
+ export declare class ExtensionRegistry {
3
+ #private;
4
+ register(extension: Extension): void;
5
+ get(id: string): Extension | undefined;
6
+ all(): Extension[];
7
+ /**
8
+ * The extension for `id`, requiring its module first if it hasn't registered yet. Registration is a
9
+ * require-time side effect and the require cache is shared, so this is a no-op once loaded.
10
+ *
11
+ * The shared namespace must already be installed (../namespace) — callers reach here via ../index.ts,
12
+ * which imports it.
13
+ */
14
+ load(id: string, entryPointPath: string): Extension;
15
+ reset(): void;
16
+ }
17
+ export declare const registry: ExtensionRegistry;
18
+ export declare function getExtension(id: string): Extension | undefined;
19
+ export declare function getAllExtensions(): Extension[];
20
+ export declare function resetRegistry(): void;
@@ -0,0 +1,13 @@
1
+ import type { SharedExtensionMetaInfo } from './model/model-types';
2
+ import type { MethodParams } from './params';
3
+ export declare class ResultSpec {
4
+ #private;
5
+ private readonly declared;
6
+ static from(result: unknown): ResultSpec;
7
+ private constructor();
8
+ get isLoader(): boolean;
9
+ get returnType(): string;
10
+ get isDeclared(): boolean;
11
+ toMetaInfo(ownerId: string, params: MethodParams): Pick<SharedExtensionMetaInfo, 'sampleResult' | 'sampleResultLoader'>;
12
+ runLoader(bag: object): Promise<unknown>;
13
+ }
@@ -0,0 +1,41 @@
1
+ import type { ExecutionContext } from './context/execution-context';
2
+ import type { Extension } from './extension';
3
+ import { ExtensionMethod } from './method';
4
+ import type { SharedExtensionMethod } from './model/model-types';
5
+ import { MethodParams } from './params';
6
+ import type { AnySchema } from './types';
7
+ export interface SystemMethodSpec {
8
+ name: string;
9
+ /**
10
+ * The params this method takes, as a normal z.object. Today every SYSTEM method happens to declare
11
+ * exactly ONE property (`invocation` / `callbackObject` / `refreshToken`) — but that is a fact about the
12
+ * current seam, not a constraint of the machinery: a second property needs no change here. Omit entirely
13
+ * for a method that takes no input (getOAuth2ConnectionURL).
14
+ */
15
+ scheme?: AnySchema;
16
+ returnType?: string;
17
+ published?: boolean;
18
+ run: (params: Record<string, unknown>, ctx: ExecutionContext) => unknown;
19
+ }
20
+ export declare class SystemMethod extends ExtensionMethod {
21
+ private readonly spec;
22
+ readonly params: MethodParams;
23
+ constructor(extension: Extension, spec: SystemMethodSpec);
24
+ get name(): string;
25
+ get registerAs(): string;
26
+ get published(): boolean;
27
+ /**
28
+ * FIELD-BY-FIELD validation: every declared param is required, then checked against its OWN schema. The
29
+ * input here is a wrapper carrying named params rather than the params themselves — `{ invocation }` /
30
+ * `{ callbackObject }` / `{ refreshToken }` are separate method params.
31
+ *
32
+ * Deliberately not one `parse(methodData)` over the whole object, because two failures must stay
33
+ * distinguishable: an ABSENT param is a malformed call (MissingMethodParamError naming the param), while a
34
+ * bad VALUE is a malformed value (InvalidMethodInputError whose issue paths are relative to that param,
35
+ * not to `methodData`). A whole-object parse would flatten both into the second, with `invocation.` in
36
+ * front of every path.
37
+ */
38
+ validate(methodData: Record<string, unknown>): Record<string, unknown>;
39
+ execute(params: Record<string, unknown>, ctx: ExecutionContext): unknown;
40
+ toModel(): SharedExtensionMethod;
41
+ }
@@ -0,0 +1,126 @@
1
+ import type { z } from 'zod';
2
+ import type { FilesApi, FileScopes } from '../common/context-files';
3
+ import type { Extension } from './extension';
4
+ import type { OAuth2Props, OAuthBag } from './oauth/types';
5
+ import type { DictionaryRef } from './params';
6
+ import type { PollingTriggerProps } from './polling-triggers/types';
7
+ import type { RealtimeSetupProps, RealtimeTriggerProps } from './realtime-triggers/types';
8
+ export type { ZodIssue, ZodSchema } from './params';
9
+ import type { ZodSchema } from './params';
10
+ export type AnySchema = z.ZodType;
11
+ export type Infer<TSchema, TFallback = Record<string, unknown>> = TSchema extends z.ZodType ? (unknown extends z.infer<TSchema> ? TFallback : z.infer<TSchema>) : TFallback;
12
+ export interface Logger {
13
+ debug: (...args: unknown[]) => void;
14
+ info: (...args: unknown[]) => void;
15
+ warn: (...args: unknown[]) => void;
16
+ error: (...args: unknown[]) => void;
17
+ }
18
+ export type ApiRequestFn = (arg: never) => unknown;
19
+ export type ProviderPayload = any;
20
+ type InjectedApiRequestArgs = 'context' | 'logger';
21
+ export type BoundApiRequest<TApiRequest> = TApiRequest extends (arg: infer TArg) => infer TResult ? (arg: Omit<TArg, InjectedApiRequestArgs>) => TResult : (arg: Record<string, unknown>) => unknown;
22
+ export interface ExtensionShape {
23
+ config: unknown;
24
+ context: unknown;
25
+ helpers: unknown;
26
+ apiRequest: unknown;
27
+ }
28
+ export interface HandlerBag<TShape extends ExtensionShape = AnyShape> {
29
+ config: TShape['config'];
30
+ context: TShape['context'];
31
+ helpers: TShape['helpers'];
32
+ apiRequest: BoundApiRequest<TShape['apiRequest']>;
33
+ oauth: OAuthBag;
34
+ files: FilesApi;
35
+ filesScope: FileScopes;
36
+ logger: Logger;
37
+ }
38
+ export type BagWithParams<TShape extends ExtensionShape, TSchema> = HandlerBag<TShape> & {
39
+ params: Infer<TSchema>;
40
+ };
41
+ export type SampleResult<TShape extends ExtensionShape, TSchema> = Record<string, unknown> | unknown[] | string | number | boolean | null | AnySchema | ((bag: BagWithParams<TShape, TSchema>) => unknown);
42
+ export interface ExtensionProps<TConfigSchema extends AnySchema = AnySchema, TContext = unknown, THelpers = Record<string, unknown>, TApiRequest extends ApiRequestFn = ApiRequestFn> {
43
+ id: string;
44
+ name: string;
45
+ description: string;
46
+ logo: string;
47
+ appearanceColors?: [string, string];
48
+ usesFileStorage?: boolean;
49
+ configItems?: TConfigSchema;
50
+ initContext?: (bag: {
51
+ config: Infer<TConfigSchema>;
52
+ oauth: OAuthBag;
53
+ }) => TContext;
54
+ apiRequest?: TApiRequest;
55
+ helpers?: (bag: Omit<HandlerBag<{
56
+ config: Infer<TConfigSchema>;
57
+ context: TContext;
58
+ helpers: never;
59
+ apiRequest: TApiRequest;
60
+ }>, 'helpers'>) => THelpers;
61
+ }
62
+ export type ShapeOf<TConfigSchema extends AnySchema, TContext, THelpers, TApiRequest extends ApiRequestFn> = {
63
+ config: Infer<TConfigSchema>;
64
+ context: TContext;
65
+ helpers: THelpers;
66
+ apiRequest: TApiRequest;
67
+ };
68
+ export interface DictionaryResultItem {
69
+ value: string | number | boolean | null;
70
+ label: string;
71
+ note?: string;
72
+ }
73
+ export type DictionaryResultItems = DictionaryResultItem[];
74
+ export interface DictionaryResult {
75
+ cursor?: string;
76
+ items: DictionaryResultItems;
77
+ }
78
+ export interface DictionaryProps<TShape extends ExtensionShape = AnyShape, TCriteria extends AnySchema = AnySchema> {
79
+ id: string;
80
+ category?: string;
81
+ label?: string;
82
+ description?: string;
83
+ criteria?: TCriteria;
84
+ result?: unknown;
85
+ oauth2Scopes?: string[];
86
+ execute: (bag: HandlerBag<TShape> & {
87
+ search?: string;
88
+ cursor?: unknown;
89
+ criteria: Infer<TCriteria>;
90
+ }) => DictionaryResult | DictionaryResultItems | Promise<DictionaryResult | DictionaryResultItems>;
91
+ }
92
+ export interface DynamicParamsDef<TShape extends ExtensionShape = AnyShape, TCriteria extends AnySchema = AnySchema> {
93
+ criteria: TCriteria;
94
+ resolve: (bag: HandlerBag<TShape> & {
95
+ criteria: Infer<TCriteria>;
96
+ }) => AnySchema | Promise<AnySchema>;
97
+ }
98
+ export interface ActionProps<TShape extends ExtensionShape = AnyShape, TParams extends AnySchema = AnySchema, TDynamicCriteria extends AnySchema = AnySchema> {
99
+ category: string;
100
+ id: string;
101
+ label: string;
102
+ description: string;
103
+ params?: TParams;
104
+ dynamicParams?: DynamicParamsDef<TShape, TDynamicCriteria>;
105
+ result: SampleResult<TShape, TParams>;
106
+ logo?: string;
107
+ appearanceColors?: [string, string];
108
+ oauth2Scopes?: string[];
109
+ execute: (bag: BagWithParams<TShape, TParams>) => unknown;
110
+ }
111
+ export interface ExtensionApi<TShape extends ExtensionShape = AnyShape> {
112
+ dictionary<TCriteria extends AnySchema = AnySchema>(props: DictionaryProps<TShape, TCriteria>): DictionaryRef;
113
+ addAction<TParams extends AnySchema = AnySchema, TDynamicCriteria extends AnySchema = AnySchema>(props: ActionProps<TShape, TParams, TDynamicCriteria>): void;
114
+ addPollingTrigger<TParams extends AnySchema = AnySchema>(props: PollingTriggerProps<TShape, TParams>): void;
115
+ setupRealtimeTriggers(props: RealtimeSetupProps<TShape>): void;
116
+ addRealtimeTrigger<TParams extends AnySchema = AnySchema>(props: RealtimeTriggerProps<TShape, TParams>): void;
117
+ setupOauth2<TToken = unknown>(props: OAuth2Props<TShape, TToken>): void;
118
+ readonly extension: Extension;
119
+ }
120
+ export interface AnyShape extends ExtensionShape {
121
+ config: Record<string, unknown>;
122
+ context: any;
123
+ helpers: any;
124
+ apiRequest: (arg: Record<string, unknown>) => unknown;
125
+ }
126
+ export declare const asRuntimeSchema: (schema?: AnySchema) => ZodSchema | undefined;
@@ -0,0 +1,2 @@
1
+ import type { TypedefsMap } from '../types';
2
+ export declare const filesTypeDefs: TypedefsMap;
@@ -0,0 +1,2 @@
1
+ import { type SharedExtensionDefinition } from '../../shared/src/scheme/index';
2
+ export declare function parseJsDocToServiceJson(entryPoint: string): SharedExtensionDefinition;
@@ -0,0 +1,42 @@
1
+ export interface DocletTag {
2
+ originalTitle: string;
3
+ value?: string;
4
+ text?: string;
5
+ }
6
+ interface DocletParam {
7
+ name: string;
8
+ type?: {
9
+ names?: string[];
10
+ };
11
+ optional?: boolean;
12
+ description?: string;
13
+ }
14
+ interface DocletProperty {
15
+ name: string;
16
+ type?: {
17
+ names?: string[];
18
+ };
19
+ optional?: boolean;
20
+ description?: string;
21
+ }
22
+ export interface Doclet {
23
+ kind: string;
24
+ name: string;
25
+ memberof?: string;
26
+ scope?: string;
27
+ description?: string;
28
+ tags?: DocletTag[];
29
+ params?: DocletParam[];
30
+ properties?: DocletProperty[];
31
+ returns?: {
32
+ type?: {
33
+ names?: string[];
34
+ };
35
+ }[];
36
+ access?: string;
37
+ }
38
+ /**
39
+ * Parse a JS file using jsdoc programmatically and return the doclets array.
40
+ */
41
+ export declare function parseJSDoc(filePath: string): Doclet[];
42
+ export {};
@@ -0,0 +1,2 @@
1
+ import { type SharedExtensionMethodParam } from '../../shared/src/scheme/index';
2
+ export type TypedefsMap = Record<string, SharedExtensionMethodParam[]>;
@@ -0,0 +1,69 @@
1
+ export interface ExchangeResult {
2
+ token: string;
3
+ workspaceId: string;
4
+ /** Absent from an older console; the CLI falls back to showing the id alone. */
5
+ workspaceName?: string;
6
+ }
7
+ /**
8
+ * Where to send the user to authorize the CLI and choose a workspace.
9
+ *
10
+ * Built here rather than at the call site because the query string is the console's contract — `appId`
11
+ * included — and this module is where that vocabulary is allowed to live.
12
+ */
13
+ export declare function authorizeUrl({ serverUrl, callbackUrl, workspaceId }: {
14
+ serverUrl: string;
15
+ callbackUrl: string;
16
+ workspaceId?: string;
17
+ }): string;
18
+ /**
19
+ * Where a workspace's custom extensions live in the console.
20
+ *
21
+ * The path segment is the workspace *name*: `/app/:appName/…` is the console's own route shape, and this
22
+ * module is where that vocabulary is allowed to live.
23
+ *
24
+ * Builds unconditionally. Whether there is a name worth linking to is the caller's question — a project with
25
+ * none recorded has nothing to put in that slot, and an id there would not resolve.
26
+ */
27
+ export declare function customExtensionsUrl(serverUrl: string, workspaceName: string): string;
28
+ export declare function exchangeCodeForToken(serverUrl: string, code: string): Promise<ExchangeResult>;
29
+ export declare function revokeToken(serverUrl: string, token: string): Promise<void>;
30
+ export interface DeployCredentials {
31
+ serverUrl: string;
32
+ workspaceId: string;
33
+ deployToken: string;
34
+ }
35
+ /**
36
+ * A file uploaded alongside the package — today the icons a service declares.
37
+ *
38
+ * Declared here rather than imported from `operations/deploy`: this layer knows how to send bytes with a
39
+ * name attached, and nothing about what makes a file worth sending.
40
+ */
41
+ export interface UploadFile {
42
+ serviceId: string;
43
+ relativePath: string;
44
+ buffer: Buffer;
45
+ }
46
+ export interface UploadResult {
47
+ packageId: string;
48
+ serviceId: string;
49
+ serviceName: string;
50
+ sourceHash: string;
51
+ }
52
+ /** One service in the workspace, as `flowrunner pull` sees it. */
53
+ export interface RemoteService {
54
+ serviceId: string;
55
+ serviceName: string;
56
+ /** The version, and — because it covers the service folder and nothing else — comparable to a local copy. */
57
+ sourceHash: string;
58
+ }
59
+ /**
60
+ * Upload one service: its zip, its definition, and any icons it declares.
61
+ *
62
+ * One service per request — the server activates exactly what it receives and leaves every other service in
63
+ * the workspace alone, which is what lets several projects deploy into the same workspace.
64
+ */
65
+ export declare function uploadService(credentials: DeployCredentials, zipBuffer: Buffer, definition: object, publicFiles?: UploadFile[]): Promise<UploadResult>;
66
+ /** The workspace's active services — one entry per service, whichever project deployed it. */
67
+ export declare function listRemoteServices(credentials: DeployCredentials): Promise<RemoteService[]>;
68
+ /** The zip of a service's active version. */
69
+ export declare function downloadRemoteService(credentials: DeployCredentials, serviceId: string): Promise<Buffer>;
@@ -0,0 +1,5 @@
1
+ export * from './packaging';
2
+ export * from './project';
3
+ export * from './providers';
4
+ export * from './server';
5
+ export * from './testing';
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Packed, but left out of the source hash.
3
+ *
4
+ * `node_modules` has to ship — the pod installs nothing — but hashing it would mean walking thousands of
5
+ * generated files on every deploy to learn what the service's own `package-lock.json` already says.
6
+ */
7
+ export declare const HASH_EXCLUDED_FOLDERS: string[];
@@ -0,0 +1,9 @@
1
+ export declare const CONFIG_FILE = "flowrunner.json";
2
+ export declare const TOKEN_DIR = ".flowrunner";
3
+ export declare const TOKEN_FILE = ".flowrunner/token";
4
+ /** Where the CLI ships instructions written for an AI agent, relative to the installed package. */
5
+ export declare const AI_DOCS_DIRECTORY = "ai-docs";
6
+ /** The one shared authoring reference — how to write a service. Provider-independent. */
7
+ export declare const AI_INSTRUCTIONS_DIRECTORY = "ai-docs/instructions/service-code-format";
8
+ /** Per-provider glue: agent definitions and the segment for that provider's instructions file. */
9
+ export declare const AI_PROVIDERS_DIRECTORY = "ai-docs/providers";
@@ -0,0 +1,30 @@
1
+ /** The orchestrator segment, inside `ai-docs/providers/<id>/`. */
2
+ export declare const ORCHESTRATOR_SEGMENT_FILE = "main-orchestrator-segment.md";
3
+ /** The agent definitions, inside `ai-docs/providers/<id>/`. */
4
+ export declare const PROVIDER_AGENTS_DIRECTORY = "agents";
5
+ export interface ProviderLayout {
6
+ /** Directory name under `ai-docs/providers/`, and the CLI's name for the provider. */
7
+ id: string;
8
+ /** How the provider is named in output written for a human. */
9
+ label: string;
10
+ /**
11
+ * The provider's own project-instructions file, relative to the project root.
12
+ *
13
+ * The CLI never owns this file — it owns only the region between its markers inside it.
14
+ */
15
+ instructionsFile: string;
16
+ /**
17
+ * Where the provider looks for subagent definitions, relative to the project root.
18
+ *
19
+ * These files *are* CLI-owned and are overwritten on every run.
20
+ */
21
+ agentsDirectory: string;
22
+ }
23
+ /**
24
+ * Claude Code.
25
+ *
26
+ * It reads `CLAUDE.md` and specifically **not** `AGENTS.md` — the cross-vendor convention is invisible to it,
27
+ * which is the whole reason provider wiring cannot be one shared file written by `init`.
28
+ */
29
+ export declare const CLAUDE_PROVIDER = "claude";
30
+ export declare const PROVIDERS: Record<string, ProviderLayout>;
@@ -0,0 +1,29 @@
1
+ /**
2
+ * The Flowrunner clusters, by short name.
3
+ *
4
+ * A named table rather than free-form URLs so that `flowrunner use dev` is a typo-proof way to move a
5
+ * project between them: a name that is not in here is refused, where a mistyped URL would be accepted and
6
+ * only fail later, against a server that does not exist.
7
+ */
8
+ export declare const CLUSTERS: {
9
+ readonly prod: "https://app.flowrunner.ai";
10
+ readonly dev: "https://dev.flowrunner.ai";
11
+ readonly local: "http://localhost:3000";
12
+ };
13
+ export type ClusterName = keyof typeof CLUSTERS;
14
+ /**
15
+ * The cluster a fresh project points at.
16
+ *
17
+ * One line, deliberately: moving the default from local to dev to prod as the product ships should not mean
18
+ * hunting for a URL literal in half a dozen places.
19
+ */
20
+ export declare const DEFAULT_CLUSTER: ClusterName;
21
+ /**
22
+ * The console a project talks to when it has not been told otherwise.
23
+ *
24
+ * A fresh project must be able to run `login` before anything has written `flowrunner.json` — asking the
25
+ * user for a URL they have no way of knowing is the one thing a first run cannot afford.
26
+ */
27
+ export declare const DEFAULT_SERVER_URL: string;
28
+ /** Overrides the default without editing the project file — how you point the CLI at a local console. */
29
+ export declare const SERVER_URL_ENV = "FLOWRUNNER_SERVER_URL";
@@ -0,0 +1,32 @@
1
+ /** Files shipped inside this package for copying into a project, relative to the package root. */
2
+ export declare const PROJECT_FILES_DIRECTORY = "project-files";
3
+ /** Where the harness lands in the project. Test suites reach it as `require('../../../sandbox')`. */
4
+ export declare const SANDBOX_DIRECTORY = "sandbox";
5
+ /**
6
+ * What `init` copies, as paths relative to both `project-files/` and the project root.
7
+ *
8
+ * An explicit list rather than a directory walk: a file that ships in this package but is not meant to
9
+ * land in a customer's project should not do so by being added to a folder.
10
+ */
11
+ export declare const TESTING_FILES: string[];
12
+ /**
13
+ * What the harness needs installed, pinned to the majors it was written against.
14
+ *
15
+ * `query-string` is the sharp one: v8 is ESM-only, so a CommonJS `require` of it fails outright, and
16
+ * `nock-mock.js` depends on its `parseNumbers` / `parseBooleans` options to put JS types back on a
17
+ * query string that carries none. `nock` 14 is the first version that intercepts `fetch` as well as
18
+ * `http`, which is what makes the mock work for a service using a bundled SDK.
19
+ */
20
+ export declare const TEST_DEV_DEPENDENCIES: Record<string, string>;
21
+ /** Added to `scripts`, and only where the project has no script of that name already. */
22
+ export declare const TEST_SCRIPTS: Record<string, string>;
23
+ /**
24
+ * Script values that count as absent — `npm init -y` writes this one, and it is not a decision anybody made.
25
+ *
26
+ * Without it the extremely common `npm init -y` → `flowrunner init` → `npm test` ends at
27
+ * *Error: no test specified*, with a jest config and a sandbox sitting right there unused. Matched on the
28
+ * exact string, so a project that has written its own `test` script keeps it whatever it says.
29
+ */
30
+ export declare const PLACEHOLDER_SCRIPTS: Record<string, string>;
31
+ /** Both are produced by a test run: coverage reports, and the Files sandbox's blob storage. */
32
+ export declare const TEST_GITIGNORE_ENTRIES: string[];