@invect/core 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +103 -0
- package/dist/_virtual/_rolldown/runtime.cjs +33 -0
- package/dist/_virtual/_rolldown/runtime.js +13 -0
- package/dist/actions/action-executor.cjs +166 -0
- package/dist/actions/action-executor.cjs.map +1 -0
- package/dist/actions/action-executor.d.cts +33 -0
- package/dist/actions/action-executor.d.cts.map +1 -0
- package/dist/actions/action-executor.d.ts +33 -0
- package/dist/actions/action-executor.d.ts.map +1 -0
- package/dist/actions/action-executor.js +164 -0
- package/dist/actions/action-executor.js.map +1 -0
- package/dist/actions/action-registry.cjs +236 -0
- package/dist/actions/action-registry.cjs.map +1 -0
- package/dist/actions/action-registry.d.cts +58 -0
- package/dist/actions/action-registry.d.cts.map +1 -0
- package/dist/actions/action-registry.d.ts +58 -0
- package/dist/actions/action-registry.d.ts.map +1 -0
- package/dist/actions/action-registry.js +233 -0
- package/dist/actions/action-registry.js.map +1 -0
- package/dist/actions/core/if-else.cjs +111 -0
- package/dist/actions/core/if-else.cjs.map +1 -0
- package/dist/actions/core/if-else.d.cts +1 -0
- package/dist/actions/core/if-else.d.ts +1 -0
- package/dist/actions/core/if-else.js +98 -0
- package/dist/actions/core/if-else.js.map +1 -0
- package/dist/actions/core/index.cjs +20 -0
- package/dist/actions/core/index.cjs.map +1 -0
- package/dist/actions/core/index.d.cts +7 -0
- package/dist/actions/core/index.d.cts.map +1 -0
- package/dist/actions/core/index.d.ts +7 -0
- package/dist/actions/core/index.d.ts.map +1 -0
- package/dist/actions/core/index.js +20 -0
- package/dist/actions/core/index.js.map +1 -0
- package/dist/actions/core/input.cjs +73 -0
- package/dist/actions/core/input.cjs.map +1 -0
- package/dist/actions/core/input.d.cts +1 -0
- package/dist/actions/core/input.d.ts +1 -0
- package/dist/actions/core/input.js +72 -0
- package/dist/actions/core/input.js.map +1 -0
- package/dist/actions/core/javascript.cjs +77 -0
- package/dist/actions/core/javascript.cjs.map +1 -0
- package/dist/actions/core/javascript.d.cts +1 -0
- package/dist/actions/core/javascript.d.ts +1 -0
- package/dist/actions/core/javascript.js +62 -0
- package/dist/actions/core/javascript.js.map +1 -0
- package/dist/actions/core/model.cjs +285 -0
- package/dist/actions/core/model.cjs.map +1 -0
- package/dist/actions/core/model.d.cts +1 -0
- package/dist/actions/core/model.d.ts +1 -0
- package/dist/actions/core/model.js +276 -0
- package/dist/actions/core/model.js.map +1 -0
- package/dist/actions/core/output.cjs +66 -0
- package/dist/actions/core/output.cjs.map +1 -0
- package/dist/actions/core/output.d.cts +1 -0
- package/dist/actions/core/output.d.ts +1 -0
- package/dist/actions/core/output.js +57 -0
- package/dist/actions/core/output.js.map +1 -0
- package/dist/actions/core/template-string.cjs +85 -0
- package/dist/actions/core/template-string.cjs.map +1 -0
- package/dist/actions/core/template-string.d.cts +1 -0
- package/dist/actions/core/template-string.d.ts +1 -0
- package/dist/actions/core/template-string.js +76 -0
- package/dist/actions/core/template-string.js.map +1 -0
- package/dist/actions/define-action.cjs +14 -0
- package/dist/actions/define-action.cjs.map +1 -0
- package/dist/actions/define-action.d.cts +13 -0
- package/dist/actions/define-action.d.cts.map +1 -0
- package/dist/actions/define-action.d.ts +13 -0
- package/dist/actions/define-action.d.ts.map +1 -0
- package/dist/actions/define-action.js +14 -0
- package/dist/actions/define-action.js.map +1 -0
- package/dist/actions/github/add-issue-comment.cjs +152 -0
- package/dist/actions/github/add-issue-comment.cjs.map +1 -0
- package/dist/actions/github/add-issue-comment.d.cts +1 -0
- package/dist/actions/github/add-issue-comment.d.ts +1 -0
- package/dist/actions/github/add-issue-comment.js +150 -0
- package/dist/actions/github/add-issue-comment.js.map +1 -0
- package/dist/actions/github/create-branch.cjs +201 -0
- package/dist/actions/github/create-branch.cjs.map +1 -0
- package/dist/actions/github/create-branch.d.cts +1 -0
- package/dist/actions/github/create-branch.d.ts +1 -0
- package/dist/actions/github/create-branch.js +199 -0
- package/dist/actions/github/create-branch.js.map +1 -0
- package/dist/actions/github/create-issue.cjs +190 -0
- package/dist/actions/github/create-issue.cjs.map +1 -0
- package/dist/actions/github/create-issue.d.cts +1 -0
- package/dist/actions/github/create-issue.d.ts +1 -0
- package/dist/actions/github/create-issue.js +188 -0
- package/dist/actions/github/create-issue.js.map +1 -0
- package/dist/actions/github/create-or-update-file.cjs +216 -0
- package/dist/actions/github/create-or-update-file.cjs.map +1 -0
- package/dist/actions/github/create-or-update-file.d.cts +1 -0
- package/dist/actions/github/create-or-update-file.d.ts +1 -0
- package/dist/actions/github/create-or-update-file.js +214 -0
- package/dist/actions/github/create-or-update-file.js.map +1 -0
- package/dist/actions/github/create-pull-request.cjs +206 -0
- package/dist/actions/github/create-pull-request.cjs.map +1 -0
- package/dist/actions/github/create-pull-request.d.cts +1 -0
- package/dist/actions/github/create-pull-request.d.ts +1 -0
- package/dist/actions/github/create-pull-request.js +204 -0
- package/dist/actions/github/create-pull-request.js.map +1 -0
- package/dist/actions/github/create-release.cjs +218 -0
- package/dist/actions/github/create-release.cjs.map +1 -0
- package/dist/actions/github/create-release.d.cts +1 -0
- package/dist/actions/github/create-release.d.ts +1 -0
- package/dist/actions/github/create-release.js +216 -0
- package/dist/actions/github/create-release.js.map +1 -0
- package/dist/actions/github/get-file-content.cjs +164 -0
- package/dist/actions/github/get-file-content.cjs.map +1 -0
- package/dist/actions/github/get-file-content.d.cts +1 -0
- package/dist/actions/github/get-file-content.d.ts +1 -0
- package/dist/actions/github/get-file-content.js +162 -0
- package/dist/actions/github/get-file-content.js.map +1 -0
- package/dist/actions/github/get-issue.cjs +149 -0
- package/dist/actions/github/get-issue.cjs.map +1 -0
- package/dist/actions/github/get-issue.d.cts +1 -0
- package/dist/actions/github/get-issue.d.ts +1 -0
- package/dist/actions/github/get-issue.js +147 -0
- package/dist/actions/github/get-issue.js.map +1 -0
- package/dist/actions/github/get-pull-request.cjs +160 -0
- package/dist/actions/github/get-pull-request.cjs.map +1 -0
- package/dist/actions/github/get-pull-request.d.cts +1 -0
- package/dist/actions/github/get-pull-request.d.ts +1 -0
- package/dist/actions/github/get-pull-request.js +158 -0
- package/dist/actions/github/get-pull-request.js.map +1 -0
- package/dist/actions/github/get-repo.cjs +144 -0
- package/dist/actions/github/get-repo.cjs.map +1 -0
- package/dist/actions/github/get-repo.d.cts +1 -0
- package/dist/actions/github/get-repo.d.ts +1 -0
- package/dist/actions/github/get-repo.js +142 -0
- package/dist/actions/github/get-repo.js.map +1 -0
- package/dist/actions/github/index.cjs +48 -0
- package/dist/actions/github/index.cjs.map +1 -0
- package/dist/actions/github/index.d.cts +7 -0
- package/dist/actions/github/index.d.cts.map +1 -0
- package/dist/actions/github/index.d.ts +7 -0
- package/dist/actions/github/index.d.ts.map +1 -0
- package/dist/actions/github/index.js +48 -0
- package/dist/actions/github/index.js.map +1 -0
- package/dist/actions/github/list-branches.cjs +149 -0
- package/dist/actions/github/list-branches.cjs.map +1 -0
- package/dist/actions/github/list-branches.d.cts +1 -0
- package/dist/actions/github/list-branches.d.ts +1 -0
- package/dist/actions/github/list-branches.js +147 -0
- package/dist/actions/github/list-branches.js.map +1 -0
- package/dist/actions/github/list-commits.cjs +200 -0
- package/dist/actions/github/list-commits.cjs.map +1 -0
- package/dist/actions/github/list-commits.d.cts +1 -0
- package/dist/actions/github/list-commits.d.ts +1 -0
- package/dist/actions/github/list-commits.js +198 -0
- package/dist/actions/github/list-commits.js.map +1 -0
- package/dist/actions/github/list-issue-comments.cjs +153 -0
- package/dist/actions/github/list-issue-comments.cjs.map +1 -0
- package/dist/actions/github/list-issue-comments.d.cts +1 -0
- package/dist/actions/github/list-issue-comments.d.ts +1 -0
- package/dist/actions/github/list-issue-comments.js +151 -0
- package/dist/actions/github/list-issue-comments.js.map +1 -0
- package/dist/actions/github/list-issues.cjs +244 -0
- package/dist/actions/github/list-issues.cjs.map +1 -0
- package/dist/actions/github/list-issues.d.cts +1 -0
- package/dist/actions/github/list-issues.d.ts +1 -0
- package/dist/actions/github/list-issues.js +242 -0
- package/dist/actions/github/list-issues.js.map +1 -0
- package/dist/actions/github/list-pull-requests.cjs +252 -0
- package/dist/actions/github/list-pull-requests.cjs.map +1 -0
- package/dist/actions/github/list-pull-requests.d.cts +1 -0
- package/dist/actions/github/list-pull-requests.d.ts +1 -0
- package/dist/actions/github/list-pull-requests.js +250 -0
- package/dist/actions/github/list-pull-requests.js.map +1 -0
- package/dist/actions/github/list-releases.cjs +152 -0
- package/dist/actions/github/list-releases.cjs.map +1 -0
- package/dist/actions/github/list-releases.d.cts +1 -0
- package/dist/actions/github/list-releases.d.ts +1 -0
- package/dist/actions/github/list-releases.js +150 -0
- package/dist/actions/github/list-releases.js.map +1 -0
- package/dist/actions/github/list-repos.cjs +227 -0
- package/dist/actions/github/list-repos.cjs.map +1 -0
- package/dist/actions/github/list-repos.d.cts +1 -0
- package/dist/actions/github/list-repos.d.ts +1 -0
- package/dist/actions/github/list-repos.js +225 -0
- package/dist/actions/github/list-repos.js.map +1 -0
- package/dist/actions/github/merge-pull-request.cjs +204 -0
- package/dist/actions/github/merge-pull-request.cjs.map +1 -0
- package/dist/actions/github/merge-pull-request.d.cts +1 -0
- package/dist/actions/github/merge-pull-request.d.ts +1 -0
- package/dist/actions/github/merge-pull-request.js +202 -0
- package/dist/actions/github/merge-pull-request.js.map +1 -0
- package/dist/actions/github/search-issues.cjs +200 -0
- package/dist/actions/github/search-issues.cjs.map +1 -0
- package/dist/actions/github/search-issues.d.cts +1 -0
- package/dist/actions/github/search-issues.d.ts +1 -0
- package/dist/actions/github/search-issues.js +198 -0
- package/dist/actions/github/search-issues.js.map +1 -0
- package/dist/actions/github/update-issue.cjs +243 -0
- package/dist/actions/github/update-issue.cjs.map +1 -0
- package/dist/actions/github/update-issue.d.cts +1 -0
- package/dist/actions/github/update-issue.d.ts +1 -0
- package/dist/actions/github/update-issue.js +241 -0
- package/dist/actions/github/update-issue.js.map +1 -0
- package/dist/actions/gmail/create-draft.cjs +228 -0
- package/dist/actions/gmail/create-draft.cjs.map +1 -0
- package/dist/actions/gmail/create-draft.d.cts +1 -0
- package/dist/actions/gmail/create-draft.d.ts +1 -0
- package/dist/actions/gmail/create-draft.js +226 -0
- package/dist/actions/gmail/create-draft.js.map +1 -0
- package/dist/actions/gmail/get-message.cjs +205 -0
- package/dist/actions/gmail/get-message.cjs.map +1 -0
- package/dist/actions/gmail/get-message.d.cts +1 -0
- package/dist/actions/gmail/get-message.d.ts +1 -0
- package/dist/actions/gmail/get-message.js +203 -0
- package/dist/actions/gmail/get-message.js.map +1 -0
- package/dist/actions/gmail/index.cjs +18 -0
- package/dist/actions/gmail/index.cjs.map +1 -0
- package/dist/actions/gmail/index.d.cts +7 -0
- package/dist/actions/gmail/index.d.cts.map +1 -0
- package/dist/actions/gmail/index.d.ts +7 -0
- package/dist/actions/gmail/index.d.ts.map +1 -0
- package/dist/actions/gmail/index.js +18 -0
- package/dist/actions/gmail/index.js.map +1 -0
- package/dist/actions/gmail/list-messages.cjs +195 -0
- package/dist/actions/gmail/list-messages.cjs.map +1 -0
- package/dist/actions/gmail/list-messages.d.cts +1 -0
- package/dist/actions/gmail/list-messages.d.ts +1 -0
- package/dist/actions/gmail/list-messages.js +193 -0
- package/dist/actions/gmail/list-messages.js.map +1 -0
- package/dist/actions/gmail/modify-labels.cjs +163 -0
- package/dist/actions/gmail/modify-labels.cjs.map +1 -0
- package/dist/actions/gmail/modify-labels.d.cts +1 -0
- package/dist/actions/gmail/modify-labels.d.ts +1 -0
- package/dist/actions/gmail/modify-labels.js +161 -0
- package/dist/actions/gmail/modify-labels.js.map +1 -0
- package/dist/actions/gmail/send-message.cjs +233 -0
- package/dist/actions/gmail/send-message.cjs.map +1 -0
- package/dist/actions/gmail/send-message.d.cts +1 -0
- package/dist/actions/gmail/send-message.d.ts +1 -0
- package/dist/actions/gmail/send-message.js +231 -0
- package/dist/actions/gmail/send-message.js.map +1 -0
- package/dist/actions/google-calendar/create-event.cjs +274 -0
- package/dist/actions/google-calendar/create-event.cjs.map +1 -0
- package/dist/actions/google-calendar/create-event.d.cts +1 -0
- package/dist/actions/google-calendar/create-event.d.ts +1 -0
- package/dist/actions/google-calendar/create-event.js +272 -0
- package/dist/actions/google-calendar/create-event.js.map +1 -0
- package/dist/actions/google-calendar/delete-event.cjs +145 -0
- package/dist/actions/google-calendar/delete-event.cjs.map +1 -0
- package/dist/actions/google-calendar/delete-event.d.cts +1 -0
- package/dist/actions/google-calendar/delete-event.d.ts +1 -0
- package/dist/actions/google-calendar/delete-event.js +143 -0
- package/dist/actions/google-calendar/delete-event.js.map +1 -0
- package/dist/actions/google-calendar/get-event.cjs +128 -0
- package/dist/actions/google-calendar/get-event.cjs.map +1 -0
- package/dist/actions/google-calendar/get-event.d.cts +1 -0
- package/dist/actions/google-calendar/get-event.d.ts +1 -0
- package/dist/actions/google-calendar/get-event.js +126 -0
- package/dist/actions/google-calendar/get-event.js.map +1 -0
- package/dist/actions/google-calendar/index.cjs +20 -0
- package/dist/actions/google-calendar/index.cjs.map +1 -0
- package/dist/actions/google-calendar/index.d.cts +7 -0
- package/dist/actions/google-calendar/index.d.cts.map +1 -0
- package/dist/actions/google-calendar/index.d.ts +7 -0
- package/dist/actions/google-calendar/index.d.ts.map +1 -0
- package/dist/actions/google-calendar/index.js +20 -0
- package/dist/actions/google-calendar/index.js.map +1 -0
- package/dist/actions/google-calendar/list-events.cjs +193 -0
- package/dist/actions/google-calendar/list-events.cjs.map +1 -0
- package/dist/actions/google-calendar/list-events.d.cts +1 -0
- package/dist/actions/google-calendar/list-events.d.ts +1 -0
- package/dist/actions/google-calendar/list-events.js +191 -0
- package/dist/actions/google-calendar/list-events.js.map +1 -0
- package/dist/actions/google-calendar/query-freebusy.cjs +160 -0
- package/dist/actions/google-calendar/query-freebusy.cjs.map +1 -0
- package/dist/actions/google-calendar/query-freebusy.d.cts +1 -0
- package/dist/actions/google-calendar/query-freebusy.d.ts +1 -0
- package/dist/actions/google-calendar/query-freebusy.js +158 -0
- package/dist/actions/google-calendar/query-freebusy.js.map +1 -0
- package/dist/actions/google-calendar/update-event.cjs +221 -0
- package/dist/actions/google-calendar/update-event.cjs.map +1 -0
- package/dist/actions/google-calendar/update-event.d.cts +1 -0
- package/dist/actions/google-calendar/update-event.d.ts +1 -0
- package/dist/actions/google-calendar/update-event.js +219 -0
- package/dist/actions/google-calendar/update-event.js.map +1 -0
- package/dist/actions/google-docs/append-text.cjs +138 -0
- package/dist/actions/google-docs/append-text.cjs.map +1 -0
- package/dist/actions/google-docs/append-text.d.cts +1 -0
- package/dist/actions/google-docs/append-text.d.ts +1 -0
- package/dist/actions/google-docs/append-text.js +136 -0
- package/dist/actions/google-docs/append-text.js.map +1 -0
- package/dist/actions/google-docs/create-document.cjs +138 -0
- package/dist/actions/google-docs/create-document.cjs.map +1 -0
- package/dist/actions/google-docs/create-document.d.cts +1 -0
- package/dist/actions/google-docs/create-document.d.ts +1 -0
- package/dist/actions/google-docs/create-document.js +136 -0
- package/dist/actions/google-docs/create-document.js.map +1 -0
- package/dist/actions/google-docs/get-document.cjs +118 -0
- package/dist/actions/google-docs/get-document.cjs.map +1 -0
- package/dist/actions/google-docs/get-document.d.cts +1 -0
- package/dist/actions/google-docs/get-document.d.ts +1 -0
- package/dist/actions/google-docs/get-document.js +116 -0
- package/dist/actions/google-docs/get-document.js.map +1 -0
- package/dist/actions/google-docs/index.cjs +18 -0
- package/dist/actions/google-docs/index.cjs.map +1 -0
- package/dist/actions/google-docs/index.d.cts +7 -0
- package/dist/actions/google-docs/index.d.cts.map +1 -0
- package/dist/actions/google-docs/index.d.ts +7 -0
- package/dist/actions/google-docs/index.d.ts.map +1 -0
- package/dist/actions/google-docs/index.js +18 -0
- package/dist/actions/google-docs/index.js.map +1 -0
- package/dist/actions/google-docs/insert-text.cjs +136 -0
- package/dist/actions/google-docs/insert-text.cjs.map +1 -0
- package/dist/actions/google-docs/insert-text.d.cts +1 -0
- package/dist/actions/google-docs/insert-text.d.ts +1 -0
- package/dist/actions/google-docs/insert-text.js +134 -0
- package/dist/actions/google-docs/insert-text.js.map +1 -0
- package/dist/actions/google-docs/replace-text.cjs +152 -0
- package/dist/actions/google-docs/replace-text.cjs.map +1 -0
- package/dist/actions/google-docs/replace-text.d.cts +1 -0
- package/dist/actions/google-docs/replace-text.d.ts +1 -0
- package/dist/actions/google-docs/replace-text.js +150 -0
- package/dist/actions/google-docs/replace-text.js.map +1 -0
- package/dist/actions/google-drive/create-file.cjs +155 -0
- package/dist/actions/google-drive/create-file.cjs.map +1 -0
- package/dist/actions/google-drive/create-file.d.cts +1 -0
- package/dist/actions/google-drive/create-file.d.ts +1 -0
- package/dist/actions/google-drive/create-file.js +153 -0
- package/dist/actions/google-drive/create-file.js.map +1 -0
- package/dist/actions/google-drive/create-folder.cjs +130 -0
- package/dist/actions/google-drive/create-folder.cjs.map +1 -0
- package/dist/actions/google-drive/create-folder.d.cts +1 -0
- package/dist/actions/google-drive/create-folder.d.ts +1 -0
- package/dist/actions/google-drive/create-folder.js +128 -0
- package/dist/actions/google-drive/create-folder.js.map +1 -0
- package/dist/actions/google-drive/delete-file.cjs +98 -0
- package/dist/actions/google-drive/delete-file.cjs.map +1 -0
- package/dist/actions/google-drive/delete-file.d.cts +1 -0
- package/dist/actions/google-drive/delete-file.d.ts +1 -0
- package/dist/actions/google-drive/delete-file.js +96 -0
- package/dist/actions/google-drive/delete-file.js.map +1 -0
- package/dist/actions/google-drive/get-file.cjs +103 -0
- package/dist/actions/google-drive/get-file.cjs.map +1 -0
- package/dist/actions/google-drive/get-file.d.cts +1 -0
- package/dist/actions/google-drive/get-file.d.ts +1 -0
- package/dist/actions/google-drive/get-file.js +101 -0
- package/dist/actions/google-drive/get-file.js.map +1 -0
- package/dist/actions/google-drive/index.cjs +22 -0
- package/dist/actions/google-drive/index.cjs.map +1 -0
- package/dist/actions/google-drive/index.d.cts +7 -0
- package/dist/actions/google-drive/index.d.cts.map +1 -0
- package/dist/actions/google-drive/index.d.ts +7 -0
- package/dist/actions/google-drive/index.d.ts.map +1 -0
- package/dist/actions/google-drive/index.js +22 -0
- package/dist/actions/google-drive/index.js.map +1 -0
- package/dist/actions/google-drive/list-files.cjs +156 -0
- package/dist/actions/google-drive/list-files.cjs.map +1 -0
- package/dist/actions/google-drive/list-files.d.cts +1 -0
- package/dist/actions/google-drive/list-files.d.ts +1 -0
- package/dist/actions/google-drive/list-files.js +154 -0
- package/dist/actions/google-drive/list-files.js.map +1 -0
- package/dist/actions/google-drive/search-files.cjs +138 -0
- package/dist/actions/google-drive/search-files.cjs.map +1 -0
- package/dist/actions/google-drive/search-files.d.cts +1 -0
- package/dist/actions/google-drive/search-files.d.ts +1 -0
- package/dist/actions/google-drive/search-files.js +136 -0
- package/dist/actions/google-drive/search-files.js.map +1 -0
- package/dist/actions/google-drive/share-file.cjs +226 -0
- package/dist/actions/google-drive/share-file.cjs.map +1 -0
- package/dist/actions/google-drive/share-file.d.cts +1 -0
- package/dist/actions/google-drive/share-file.d.ts +1 -0
- package/dist/actions/google-drive/share-file.js +224 -0
- package/dist/actions/google-drive/share-file.js.map +1 -0
- package/dist/actions/google-sheets/append-values.cjs +175 -0
- package/dist/actions/google-sheets/append-values.cjs.map +1 -0
- package/dist/actions/google-sheets/append-values.d.cts +1 -0
- package/dist/actions/google-sheets/append-values.d.ts +1 -0
- package/dist/actions/google-sheets/append-values.js +173 -0
- package/dist/actions/google-sheets/append-values.js.map +1 -0
- package/dist/actions/google-sheets/clear-values.cjs +118 -0
- package/dist/actions/google-sheets/clear-values.cjs.map +1 -0
- package/dist/actions/google-sheets/clear-values.d.cts +1 -0
- package/dist/actions/google-sheets/clear-values.d.ts +1 -0
- package/dist/actions/google-sheets/clear-values.js +116 -0
- package/dist/actions/google-sheets/clear-values.js.map +1 -0
- package/dist/actions/google-sheets/create-spreadsheet.cjs +128 -0
- package/dist/actions/google-sheets/create-spreadsheet.cjs.map +1 -0
- package/dist/actions/google-sheets/create-spreadsheet.d.cts +1 -0
- package/dist/actions/google-sheets/create-spreadsheet.d.ts +1 -0
- package/dist/actions/google-sheets/create-spreadsheet.js +126 -0
- package/dist/actions/google-sheets/create-spreadsheet.js.map +1 -0
- package/dist/actions/google-sheets/get-values.cjs +168 -0
- package/dist/actions/google-sheets/get-values.cjs.map +1 -0
- package/dist/actions/google-sheets/get-values.d.cts +1 -0
- package/dist/actions/google-sheets/get-values.d.ts +1 -0
- package/dist/actions/google-sheets/get-values.js +166 -0
- package/dist/actions/google-sheets/get-values.js.map +1 -0
- package/dist/actions/google-sheets/index.cjs +18 -0
- package/dist/actions/google-sheets/index.cjs.map +1 -0
- package/dist/actions/google-sheets/index.d.cts +7 -0
- package/dist/actions/google-sheets/index.d.cts.map +1 -0
- package/dist/actions/google-sheets/index.d.ts +7 -0
- package/dist/actions/google-sheets/index.d.ts.map +1 -0
- package/dist/actions/google-sheets/index.js +18 -0
- package/dist/actions/google-sheets/index.js.map +1 -0
- package/dist/actions/google-sheets/update-values.cjs +158 -0
- package/dist/actions/google-sheets/update-values.cjs.map +1 -0
- package/dist/actions/google-sheets/update-values.d.cts +1 -0
- package/dist/actions/google-sheets/update-values.d.ts +1 -0
- package/dist/actions/google-sheets/update-values.js +156 -0
- package/dist/actions/google-sheets/update-values.js.map +1 -0
- package/dist/actions/http/index.cjs +7 -0
- package/dist/actions/http/index.cjs.map +1 -0
- package/dist/actions/http/index.d.cts +7 -0
- package/dist/actions/http/index.d.cts.map +1 -0
- package/dist/actions/http/index.d.ts +7 -0
- package/dist/actions/http/index.d.ts.map +1 -0
- package/dist/actions/http/index.js +8 -0
- package/dist/actions/http/index.js.map +1 -0
- package/dist/actions/http/request.cjs +223 -0
- package/dist/actions/http/request.cjs.map +1 -0
- package/dist/actions/http/request.d.cts +1 -0
- package/dist/actions/http/request.d.ts +1 -0
- package/dist/actions/http/request.js +222 -0
- package/dist/actions/http/request.js.map +1 -0
- package/dist/actions/index.cjs +46 -0
- package/dist/actions/index.cjs.map +1 -0
- package/dist/actions/index.d.cts +27 -0
- package/dist/actions/index.d.cts.map +1 -0
- package/dist/actions/index.d.ts +27 -0
- package/dist/actions/index.d.ts.map +1 -0
- package/dist/actions/index.js +45 -0
- package/dist/actions/index.js.map +1 -0
- package/dist/actions/linear/create-issue.cjs +296 -0
- package/dist/actions/linear/create-issue.cjs.map +1 -0
- package/dist/actions/linear/create-issue.d.cts +1 -0
- package/dist/actions/linear/create-issue.d.ts +1 -0
- package/dist/actions/linear/create-issue.js +294 -0
- package/dist/actions/linear/create-issue.js.map +1 -0
- package/dist/actions/linear/index.cjs +16 -0
- package/dist/actions/linear/index.cjs.map +1 -0
- package/dist/actions/linear/index.d.cts +7 -0
- package/dist/actions/linear/index.d.cts.map +1 -0
- package/dist/actions/linear/index.d.ts +7 -0
- package/dist/actions/linear/index.d.ts.map +1 -0
- package/dist/actions/linear/index.js +16 -0
- package/dist/actions/linear/index.js.map +1 -0
- package/dist/actions/linear/list-issues.cjs +239 -0
- package/dist/actions/linear/list-issues.cjs.map +1 -0
- package/dist/actions/linear/list-issues.d.cts +1 -0
- package/dist/actions/linear/list-issues.d.ts +1 -0
- package/dist/actions/linear/list-issues.js +237 -0
- package/dist/actions/linear/list-issues.js.map +1 -0
- package/dist/actions/linear/list-teams.cjs +183 -0
- package/dist/actions/linear/list-teams.cjs.map +1 -0
- package/dist/actions/linear/list-teams.d.cts +1 -0
- package/dist/actions/linear/list-teams.d.ts +1 -0
- package/dist/actions/linear/list-teams.js +181 -0
- package/dist/actions/linear/list-teams.js.map +1 -0
- package/dist/actions/linear/update-issue.cjs +282 -0
- package/dist/actions/linear/update-issue.cjs.map +1 -0
- package/dist/actions/linear/update-issue.d.cts +1 -0
- package/dist/actions/linear/update-issue.d.ts +1 -0
- package/dist/actions/linear/update-issue.js +280 -0
- package/dist/actions/linear/update-issue.js.map +1 -0
- package/dist/actions/microsoft/get-calendar-event.cjs +139 -0
- package/dist/actions/microsoft/get-calendar-event.cjs.map +1 -0
- package/dist/actions/microsoft/get-calendar-event.d.cts +1 -0
- package/dist/actions/microsoft/get-calendar-event.d.ts +1 -0
- package/dist/actions/microsoft/get-calendar-event.js +137 -0
- package/dist/actions/microsoft/get-calendar-event.js.map +1 -0
- package/dist/actions/microsoft/get-meeting-transcript.cjs +221 -0
- package/dist/actions/microsoft/get-meeting-transcript.cjs.map +1 -0
- package/dist/actions/microsoft/get-meeting-transcript.d.cts +1 -0
- package/dist/actions/microsoft/get-meeting-transcript.d.ts +1 -0
- package/dist/actions/microsoft/get-meeting-transcript.js +219 -0
- package/dist/actions/microsoft/get-meeting-transcript.js.map +1 -0
- package/dist/actions/microsoft/get-message.cjs +173 -0
- package/dist/actions/microsoft/get-message.cjs.map +1 -0
- package/dist/actions/microsoft/get-message.d.cts +1 -0
- package/dist/actions/microsoft/get-message.d.ts +1 -0
- package/dist/actions/microsoft/get-message.js +171 -0
- package/dist/actions/microsoft/get-message.js.map +1 -0
- package/dist/actions/microsoft/index.cjs +22 -0
- package/dist/actions/microsoft/index.cjs.map +1 -0
- package/dist/actions/microsoft/index.d.cts +1 -0
- package/dist/actions/microsoft/index.d.ts +1 -0
- package/dist/actions/microsoft/index.js +22 -0
- package/dist/actions/microsoft/index.js.map +1 -0
- package/dist/actions/microsoft/list-calendar-events.cjs +202 -0
- package/dist/actions/microsoft/list-calendar-events.cjs.map +1 -0
- package/dist/actions/microsoft/list-calendar-events.d.cts +1 -0
- package/dist/actions/microsoft/list-calendar-events.d.ts +1 -0
- package/dist/actions/microsoft/list-calendar-events.js +200 -0
- package/dist/actions/microsoft/list-calendar-events.js.map +1 -0
- package/dist/actions/microsoft/list-calendars.cjs +99 -0
- package/dist/actions/microsoft/list-calendars.cjs.map +1 -0
- package/dist/actions/microsoft/list-calendars.d.cts +1 -0
- package/dist/actions/microsoft/list-calendars.d.ts +1 -0
- package/dist/actions/microsoft/list-calendars.js +97 -0
- package/dist/actions/microsoft/list-calendars.js.map +1 -0
- package/dist/actions/microsoft/list-messages.cjs +223 -0
- package/dist/actions/microsoft/list-messages.cjs.map +1 -0
- package/dist/actions/microsoft/list-messages.d.cts +1 -0
- package/dist/actions/microsoft/list-messages.d.ts +1 -0
- package/dist/actions/microsoft/list-messages.js +221 -0
- package/dist/actions/microsoft/list-messages.js.map +1 -0
- package/dist/actions/microsoft/list-online-meetings.cjs +132 -0
- package/dist/actions/microsoft/list-online-meetings.cjs.map +1 -0
- package/dist/actions/microsoft/list-online-meetings.d.cts +1 -0
- package/dist/actions/microsoft/list-online-meetings.d.ts +1 -0
- package/dist/actions/microsoft/list-online-meetings.js +130 -0
- package/dist/actions/microsoft/list-online-meetings.js.map +1 -0
- package/dist/actions/postgres/describe-table.cjs +175 -0
- package/dist/actions/postgres/describe-table.cjs.map +1 -0
- package/dist/actions/postgres/describe-table.d.cts +1 -0
- package/dist/actions/postgres/describe-table.d.ts +1 -0
- package/dist/actions/postgres/describe-table.js +165 -0
- package/dist/actions/postgres/describe-table.js.map +1 -0
- package/dist/actions/postgres/execute-query.cjs +120 -0
- package/dist/actions/postgres/execute-query.cjs.map +1 -0
- package/dist/actions/postgres/execute-query.d.cts +1 -0
- package/dist/actions/postgres/execute-query.d.ts +1 -0
- package/dist/actions/postgres/execute-query.js +110 -0
- package/dist/actions/postgres/execute-query.js.map +1 -0
- package/dist/actions/postgres/index.cjs +16 -0
- package/dist/actions/postgres/index.cjs.map +1 -0
- package/dist/actions/postgres/index.d.cts +7 -0
- package/dist/actions/postgres/index.d.cts.map +1 -0
- package/dist/actions/postgres/index.d.ts +7 -0
- package/dist/actions/postgres/index.d.ts.map +1 -0
- package/dist/actions/postgres/index.js +16 -0
- package/dist/actions/postgres/index.js.map +1 -0
- package/dist/actions/postgres/insert-rows.cjs +168 -0
- package/dist/actions/postgres/insert-rows.cjs.map +1 -0
- package/dist/actions/postgres/insert-rows.d.cts +1 -0
- package/dist/actions/postgres/insert-rows.d.ts +1 -0
- package/dist/actions/postgres/insert-rows.js +158 -0
- package/dist/actions/postgres/insert-rows.js.map +1 -0
- package/dist/actions/postgres/list-tables.cjs +133 -0
- package/dist/actions/postgres/list-tables.cjs.map +1 -0
- package/dist/actions/postgres/list-tables.d.cts +1 -0
- package/dist/actions/postgres/list-tables.d.ts +1 -0
- package/dist/actions/postgres/list-tables.js +123 -0
- package/dist/actions/postgres/list-tables.js.map +1 -0
- package/dist/actions/providers.cjs +128 -0
- package/dist/actions/providers.cjs.map +1 -0
- package/dist/actions/providers.d.cts +22 -0
- package/dist/actions/providers.d.cts.map +1 -0
- package/dist/actions/providers.d.ts +22 -0
- package/dist/actions/providers.d.ts.map +1 -0
- package/dist/actions/providers.js +116 -0
- package/dist/actions/providers.js.map +1 -0
- package/dist/actions/slack/index.cjs +9 -0
- package/dist/actions/slack/index.cjs.map +1 -0
- package/dist/actions/slack/index.d.cts +7 -0
- package/dist/actions/slack/index.d.cts.map +1 -0
- package/dist/actions/slack/index.d.ts +7 -0
- package/dist/actions/slack/index.d.ts.map +1 -0
- package/dist/actions/slack/index.js +9 -0
- package/dist/actions/slack/index.js.map +1 -0
- package/dist/actions/slack/list-channels.cjs +157 -0
- package/dist/actions/slack/list-channels.cjs.map +1 -0
- package/dist/actions/slack/list-channels.d.cts +1 -0
- package/dist/actions/slack/list-channels.d.ts +1 -0
- package/dist/actions/slack/list-channels.js +155 -0
- package/dist/actions/slack/list-channels.js.map +1 -0
- package/dist/actions/slack/send-message.cjs +157 -0
- package/dist/actions/slack/send-message.cjs.map +1 -0
- package/dist/actions/slack/send-message.d.cts +1 -0
- package/dist/actions/slack/send-message.d.ts +1 -0
- package/dist/actions/slack/send-message.js +155 -0
- package/dist/actions/slack/send-message.js.map +1 -0
- package/dist/actions/triggers/cron.cjs +95 -0
- package/dist/actions/triggers/cron.cjs.map +1 -0
- package/dist/actions/triggers/cron.d.cts +1 -0
- package/dist/actions/triggers/cron.d.ts +1 -0
- package/dist/actions/triggers/cron.js +83 -0
- package/dist/actions/triggers/cron.js.map +1 -0
- package/dist/actions/triggers/index.cjs +9 -0
- package/dist/actions/triggers/index.cjs.map +1 -0
- package/dist/actions/triggers/index.d.cts +1 -0
- package/dist/actions/triggers/index.d.ts +1 -0
- package/dist/actions/triggers/index.js +9 -0
- package/dist/actions/triggers/index.js.map +1 -0
- package/dist/actions/triggers/manual.cjs +105 -0
- package/dist/actions/triggers/manual.cjs.map +1 -0
- package/dist/actions/triggers/manual.d.cts +1 -0
- package/dist/actions/triggers/manual.d.ts +1 -0
- package/dist/actions/triggers/manual.js +103 -0
- package/dist/actions/triggers/manual.js.map +1 -0
- package/dist/actions/types.d.cts +373 -0
- package/dist/actions/types.d.cts.map +1 -0
- package/dist/actions/types.d.ts +373 -0
- package/dist/actions/types.d.ts.map +1 -0
- package/dist/database/adapter-factory.cjs +188 -0
- package/dist/database/adapter-factory.cjs.map +1 -0
- package/dist/database/adapter-factory.js +187 -0
- package/dist/database/adapter-factory.js.map +1 -0
- package/dist/database/adapter.cjs +33 -0
- package/dist/database/adapter.cjs.map +1 -0
- package/dist/database/adapter.d.cts +76 -0
- package/dist/database/adapter.d.cts.map +1 -0
- package/dist/database/adapter.d.ts +76 -0
- package/dist/database/adapter.d.ts.map +1 -0
- package/dist/database/adapter.js +33 -0
- package/dist/database/adapter.js.map +1 -0
- package/dist/database/adapters/connection-bridge.cjs +119 -0
- package/dist/database/adapters/connection-bridge.cjs.map +1 -0
- package/dist/database/adapters/connection-bridge.js +118 -0
- package/dist/database/adapters/connection-bridge.js.map +1 -0
- package/dist/database/adapters/kysely-adapter.cjs +138 -0
- package/dist/database/adapters/kysely-adapter.cjs.map +1 -0
- package/dist/database/adapters/kysely-adapter.js +137 -0
- package/dist/database/adapters/kysely-adapter.js.map +1 -0
- package/dist/database/connection.cjs +277 -0
- package/dist/database/connection.cjs.map +1 -0
- package/dist/database/connection.d.cts +115 -0
- package/dist/database/connection.d.cts.map +1 -0
- package/dist/database/connection.d.ts +115 -0
- package/dist/database/connection.d.ts.map +1 -0
- package/dist/database/connection.js +271 -0
- package/dist/database/connection.js.map +1 -0
- package/dist/database/core-schema.cjs +644 -0
- package/dist/database/core-schema.cjs.map +1 -0
- package/dist/database/core-schema.d.cts +22 -0
- package/dist/database/core-schema.d.cts.map +1 -0
- package/dist/database/core-schema.d.ts +22 -0
- package/dist/database/core-schema.d.ts.map +1 -0
- package/dist/database/core-schema.js +642 -0
- package/dist/database/core-schema.js.map +1 -0
- package/dist/database/index.cjs +4 -0
- package/dist/database/index.d.cts +10 -0
- package/dist/database/index.d.cts.map +1 -0
- package/dist/database/index.d.ts +10 -0
- package/dist/database/index.d.ts.map +1 -0
- package/dist/database/index.js +5 -0
- package/dist/database/prisma-schema-generator.cjs +219 -0
- package/dist/database/prisma-schema-generator.cjs.map +1 -0
- package/dist/database/prisma-schema-generator.d.cts +19 -0
- package/dist/database/prisma-schema-generator.d.cts.map +1 -0
- package/dist/database/prisma-schema-generator.d.ts +19 -0
- package/dist/database/prisma-schema-generator.d.ts.map +1 -0
- package/dist/database/prisma-schema-generator.js +218 -0
- package/dist/database/prisma-schema-generator.js.map +1 -0
- package/dist/database/schema-generator.cjs +576 -0
- package/dist/database/schema-generator.cjs.map +1 -0
- package/dist/database/schema-generator.d.cts +18 -0
- package/dist/database/schema-generator.d.cts.map +1 -0
- package/dist/database/schema-generator.d.ts +18 -0
- package/dist/database/schema-generator.d.ts.map +1 -0
- package/dist/database/schema-generator.js +571 -0
- package/dist/database/schema-generator.js.map +1 -0
- package/dist/database/schema-merger.cjs +153 -0
- package/dist/database/schema-merger.cjs.map +1 -0
- package/dist/database/schema-merger.d.cts +53 -0
- package/dist/database/schema-merger.d.cts.map +1 -0
- package/dist/database/schema-merger.d.ts +53 -0
- package/dist/database/schema-merger.d.ts.map +1 -0
- package/dist/database/schema-merger.js +152 -0
- package/dist/database/schema-merger.js.map +1 -0
- package/dist/database/schema-metadata.cjs +98 -0
- package/dist/database/schema-metadata.cjs.map +1 -0
- package/dist/database/schema-metadata.js +98 -0
- package/dist/database/schema-metadata.js.map +1 -0
- package/dist/database/schema-mysql.cjs +288 -0
- package/dist/database/schema-mysql.cjs.map +1 -0
- package/dist/database/schema-mysql.d.cts +2117 -0
- package/dist/database/schema-mysql.d.cts.map +1 -0
- package/dist/database/schema-mysql.d.ts +2117 -0
- package/dist/database/schema-mysql.d.ts.map +1 -0
- package/dist/database/schema-mysql.js +263 -0
- package/dist/database/schema-mysql.js.map +1 -0
- package/dist/database/schema-postgres.cjs +312 -0
- package/dist/database/schema-postgres.cjs.map +1 -0
- package/dist/database/schema-postgres.d.cts +2127 -0
- package/dist/database/schema-postgres.d.cts.map +1 -0
- package/dist/database/schema-postgres.d.ts +2127 -0
- package/dist/database/schema-postgres.d.ts.map +1 -0
- package/dist/database/schema-postgres.js +280 -0
- package/dist/database/schema-postgres.js.map +1 -0
- package/dist/database/schema-sqlite.cjs +247 -0
- package/dist/database/schema-sqlite.cjs.map +1 -0
- package/dist/database/schema-sqlite.d.cts +2294 -0
- package/dist/database/schema-sqlite.d.cts.map +1 -0
- package/dist/database/schema-sqlite.d.ts +2294 -0
- package/dist/database/schema-sqlite.d.ts.map +1 -0
- package/dist/database/schema-sqlite.js +222 -0
- package/dist/database/schema-sqlite.js.map +1 -0
- package/dist/database/schema-verification.cjs +123 -0
- package/dist/database/schema-verification.cjs.map +1 -0
- package/dist/database/schema-verification.d.cts +40 -0
- package/dist/database/schema-verification.d.cts.map +1 -0
- package/dist/database/schema-verification.d.ts +40 -0
- package/dist/database/schema-verification.d.ts.map +1 -0
- package/dist/database/schema-verification.js +123 -0
- package/dist/database/schema-verification.js.map +1 -0
- package/dist/database/schema.cjs +3 -0
- package/dist/database/schema.d.cts +3 -0
- package/dist/database/schema.d.ts +3 -0
- package/dist/database/schema.js +4 -0
- package/dist/index.cjs +199 -0
- package/dist/index.d.cts +70 -0
- package/dist/index.d.ts +70 -0
- package/dist/index.js +56 -0
- package/dist/invect-core.cjs +1688 -0
- package/dist/invect-core.cjs.map +1 -0
- package/dist/invect-core.d.cts +846 -0
- package/dist/invect-core.d.cts.map +1 -0
- package/dist/invect-core.d.ts +846 -0
- package/dist/invect-core.d.ts.map +1 -0
- package/dist/invect-core.js +1688 -0
- package/dist/invect-core.js.map +1 -0
- package/dist/nodes/agent-executor.cjs +881 -0
- package/dist/nodes/agent-executor.cjs.map +1 -0
- package/dist/nodes/agent-executor.d.cts +243 -0
- package/dist/nodes/agent-executor.d.cts.map +1 -0
- package/dist/nodes/agent-executor.d.ts +243 -0
- package/dist/nodes/agent-executor.d.ts.map +1 -0
- package/dist/nodes/agent-executor.js +877 -0
- package/dist/nodes/agent-executor.js.map +1 -0
- package/dist/nodes/base-node.cjs +174 -0
- package/dist/nodes/base-node.cjs.map +1 -0
- package/dist/nodes/base-node.d.cts +125 -0
- package/dist/nodes/base-node.d.cts.map +1 -0
- package/dist/nodes/base-node.d.ts +125 -0
- package/dist/nodes/base-node.d.ts.map +1 -0
- package/dist/nodes/base-node.js +170 -0
- package/dist/nodes/base-node.js.map +1 -0
- package/dist/nodes/executor-registry.cjs +46 -0
- package/dist/nodes/executor-registry.cjs.map +1 -0
- package/dist/nodes/executor-registry.d.cts +18 -0
- package/dist/nodes/executor-registry.d.cts.map +1 -0
- package/dist/nodes/executor-registry.d.ts +18 -0
- package/dist/nodes/executor-registry.d.ts.map +1 -0
- package/dist/nodes/executor-registry.js +46 -0
- package/dist/nodes/executor-registry.js.map +1 -0
- package/dist/nodes/index.cjs +2 -0
- package/dist/nodes/index.d.cts +3 -0
- package/dist/nodes/index.d.ts +3 -0
- package/dist/nodes/index.js +3 -0
- package/dist/services/agent-tool-executions/agent-tool-execution.service.cjs +110 -0
- package/dist/services/agent-tool-executions/agent-tool-execution.service.cjs.map +1 -0
- package/dist/services/agent-tool-executions/agent-tool-execution.service.d.cts +42 -0
- package/dist/services/agent-tool-executions/agent-tool-execution.service.d.cts.map +1 -0
- package/dist/services/agent-tool-executions/agent-tool-execution.service.d.ts +42 -0
- package/dist/services/agent-tool-executions/agent-tool-execution.service.d.ts.map +1 -0
- package/dist/services/agent-tool-executions/agent-tool-execution.service.js +110 -0
- package/dist/services/agent-tool-executions/agent-tool-execution.service.js.map +1 -0
- package/dist/services/agent-tool-executions/agent-tool-executions.model.cjs +152 -0
- package/dist/services/agent-tool-executions/agent-tool-executions.model.cjs.map +1 -0
- package/dist/services/agent-tool-executions/agent-tool-executions.model.d.cts +71 -0
- package/dist/services/agent-tool-executions/agent-tool-executions.model.d.cts.map +1 -0
- package/dist/services/agent-tool-executions/agent-tool-executions.model.d.ts +71 -0
- package/dist/services/agent-tool-executions/agent-tool-executions.model.d.ts.map +1 -0
- package/dist/services/agent-tool-executions/agent-tool-executions.model.js +152 -0
- package/dist/services/agent-tool-executions/agent-tool-executions.model.js.map +1 -0
- package/dist/services/agent-tools/agent-tool-registry.cjs +101 -0
- package/dist/services/agent-tools/agent-tool-registry.cjs.map +1 -0
- package/dist/services/agent-tools/agent-tool-registry.d.cts +51 -0
- package/dist/services/agent-tools/agent-tool-registry.d.cts.map +1 -0
- package/dist/services/agent-tools/agent-tool-registry.d.ts +51 -0
- package/dist/services/agent-tools/agent-tool-registry.d.ts.map +1 -0
- package/dist/services/agent-tools/agent-tool-registry.js +98 -0
- package/dist/services/agent-tools/agent-tool-registry.js.map +1 -0
- package/dist/services/agent-tools/builtin/index.cjs +17 -0
- package/dist/services/agent-tools/builtin/index.cjs.map +1 -0
- package/dist/services/agent-tools/builtin/index.js +17 -0
- package/dist/services/agent-tools/builtin/index.js.map +1 -0
- package/dist/services/agent-tools/builtin/json-logic-tool.cjs +73 -0
- package/dist/services/agent-tools/builtin/json-logic-tool.cjs.map +1 -0
- package/dist/services/agent-tools/builtin/json-logic-tool.js +70 -0
- package/dist/services/agent-tools/builtin/json-logic-tool.js.map +1 -0
- package/dist/services/agent-tools/builtin/math-tool.cjs +117 -0
- package/dist/services/agent-tools/builtin/math-tool.cjs.map +1 -0
- package/dist/services/agent-tools/builtin/math-tool.js +116 -0
- package/dist/services/agent-tools/builtin/math-tool.js.map +1 -0
- package/dist/services/agent-tools/index.cjs +2 -0
- package/dist/services/agent-tools/index.js +3 -0
- package/dist/services/ai/ai-types.cjs +37 -0
- package/dist/services/ai/ai-types.cjs.map +1 -0
- package/dist/services/ai/ai-types.d.cts +105 -0
- package/dist/services/ai/ai-types.d.cts.map +1 -0
- package/dist/services/ai/ai-types.d.ts +105 -0
- package/dist/services/ai/ai-types.d.ts.map +1 -0
- package/dist/services/ai/ai-types.js +35 -0
- package/dist/services/ai/ai-types.js.map +1 -0
- package/dist/services/ai/anthropic-adapter.cjs +411 -0
- package/dist/services/ai/anthropic-adapter.cjs.map +1 -0
- package/dist/services/ai/anthropic-adapter.d.cts +1 -0
- package/dist/services/ai/anthropic-adapter.d.ts +1 -0
- package/dist/services/ai/anthropic-adapter.js +409 -0
- package/dist/services/ai/anthropic-adapter.js.map +1 -0
- package/dist/services/ai/base-client.cjs +345 -0
- package/dist/services/ai/base-client.cjs.map +1 -0
- package/dist/services/ai/base-client.d.cts +138 -0
- package/dist/services/ai/base-client.d.cts.map +1 -0
- package/dist/services/ai/base-client.d.ts +138 -0
- package/dist/services/ai/base-client.d.ts.map +1 -0
- package/dist/services/ai/base-client.js +345 -0
- package/dist/services/ai/base-client.js.map +1 -0
- package/dist/services/ai/openai-adapter.cjs +460 -0
- package/dist/services/ai/openai-adapter.cjs.map +1 -0
- package/dist/services/ai/openai-adapter.d.cts +1 -0
- package/dist/services/ai/openai-adapter.d.ts +1 -0
- package/dist/services/ai/openai-adapter.js +458 -0
- package/dist/services/ai/openai-adapter.js.map +1 -0
- package/dist/services/ai/openrouter-adapter.cjs +124 -0
- package/dist/services/ai/openrouter-adapter.cjs.map +1 -0
- package/dist/services/ai/openrouter-adapter.d.cts +1 -0
- package/dist/services/ai/openrouter-adapter.d.ts +1 -0
- package/dist/services/ai/openrouter-adapter.js +122 -0
- package/dist/services/ai/openrouter-adapter.js.map +1 -0
- package/dist/services/ai/provider-adapter.cjs +72 -0
- package/dist/services/ai/provider-adapter.cjs.map +1 -0
- package/dist/services/ai/provider-adapter.d.cts +81 -0
- package/dist/services/ai/provider-adapter.d.cts.map +1 -0
- package/dist/services/ai/provider-adapter.d.ts +81 -0
- package/dist/services/ai/provider-adapter.d.ts.map +1 -0
- package/dist/services/ai/provider-adapter.js +72 -0
- package/dist/services/ai/provider-adapter.js.map +1 -0
- package/dist/services/auth/authorization.service.cjs +259 -0
- package/dist/services/auth/authorization.service.cjs.map +1 -0
- package/dist/services/auth/authorization.service.d.cts +102 -0
- package/dist/services/auth/authorization.service.d.cts.map +1 -0
- package/dist/services/auth/authorization.service.d.ts +102 -0
- package/dist/services/auth/authorization.service.d.ts.map +1 -0
- package/dist/services/auth/authorization.service.js +257 -0
- package/dist/services/auth/authorization.service.js.map +1 -0
- package/dist/services/auth/flow-access.service.cjs +259 -0
- package/dist/services/auth/flow-access.service.cjs.map +1 -0
- package/dist/services/auth/flow-access.service.d.cts +89 -0
- package/dist/services/auth/flow-access.service.d.cts.map +1 -0
- package/dist/services/auth/flow-access.service.d.ts +89 -0
- package/dist/services/auth/flow-access.service.d.ts.map +1 -0
- package/dist/services/auth/flow-access.service.js +259 -0
- package/dist/services/auth/flow-access.service.js.map +1 -0
- package/dist/services/auth/index.d.ts +2 -0
- package/dist/services/batch-jobs/batch-jobs.model.cjs +213 -0
- package/dist/services/batch-jobs/batch-jobs.model.cjs.map +1 -0
- package/dist/services/batch-jobs/batch-jobs.model.d.cts +79 -0
- package/dist/services/batch-jobs/batch-jobs.model.d.cts.map +1 -0
- package/dist/services/batch-jobs/batch-jobs.model.d.ts +79 -0
- package/dist/services/batch-jobs/batch-jobs.model.d.ts.map +1 -0
- package/dist/services/batch-jobs/batch-jobs.model.js +213 -0
- package/dist/services/batch-jobs/batch-jobs.model.js.map +1 -0
- package/dist/services/batch-jobs/batch-jobs.service.cjs +178 -0
- package/dist/services/batch-jobs/batch-jobs.service.cjs.map +1 -0
- package/dist/services/batch-jobs/batch-jobs.service.d.cts +83 -0
- package/dist/services/batch-jobs/batch-jobs.service.d.cts.map +1 -0
- package/dist/services/batch-jobs/batch-jobs.service.d.ts +83 -0
- package/dist/services/batch-jobs/batch-jobs.service.d.ts.map +1 -0
- package/dist/services/batch-jobs/batch-jobs.service.js +178 -0
- package/dist/services/batch-jobs/batch-jobs.service.js.map +1 -0
- package/dist/services/chat/chat-messages.model.cjs +143 -0
- package/dist/services/chat/chat-messages.model.cjs.map +1 -0
- package/dist/services/chat/chat-messages.model.d.cts +43 -0
- package/dist/services/chat/chat-messages.model.d.cts.map +1 -0
- package/dist/services/chat/chat-messages.model.d.ts +43 -0
- package/dist/services/chat/chat-messages.model.d.ts.map +1 -0
- package/dist/services/chat/chat-messages.model.js +142 -0
- package/dist/services/chat/chat-messages.model.js.map +1 -0
- package/dist/services/chat/chat-stream-session.cjs +181 -0
- package/dist/services/chat/chat-stream-session.cjs.map +1 -0
- package/dist/services/chat/chat-stream-session.d.cts +1 -0
- package/dist/services/chat/chat-stream-session.d.ts +1 -0
- package/dist/services/chat/chat-stream-session.js +181 -0
- package/dist/services/chat/chat-stream-session.js.map +1 -0
- package/dist/services/chat/chat-stream.service.cjs +205 -0
- package/dist/services/chat/chat-stream.service.cjs.map +1 -0
- package/dist/services/chat/chat-stream.service.d.cts +84 -0
- package/dist/services/chat/chat-stream.service.d.cts.map +1 -0
- package/dist/services/chat/chat-stream.service.d.ts +84 -0
- package/dist/services/chat/chat-stream.service.d.ts.map +1 -0
- package/dist/services/chat/chat-stream.service.js +205 -0
- package/dist/services/chat/chat-stream.service.js.map +1 -0
- package/dist/services/chat/chat-toolkit.cjs +125 -0
- package/dist/services/chat/chat-toolkit.cjs.map +1 -0
- package/dist/services/chat/chat-toolkit.d.cts +58 -0
- package/dist/services/chat/chat-toolkit.d.cts.map +1 -0
- package/dist/services/chat/chat-toolkit.d.ts +58 -0
- package/dist/services/chat/chat-toolkit.d.ts.map +1 -0
- package/dist/services/chat/chat-toolkit.js +124 -0
- package/dist/services/chat/chat-toolkit.js.map +1 -0
- package/dist/services/chat/chat-types.cjs +24 -0
- package/dist/services/chat/chat-types.cjs.map +1 -0
- package/dist/services/chat/chat-types.d.cts +134 -0
- package/dist/services/chat/chat-types.d.cts.map +1 -0
- package/dist/services/chat/chat-types.d.ts +134 -0
- package/dist/services/chat/chat-types.d.ts.map +1 -0
- package/dist/services/chat/chat-types.js +23 -0
- package/dist/services/chat/chat-types.js.map +1 -0
- package/dist/services/chat/index.cjs +5 -0
- package/dist/services/chat/index.d.cts +3 -0
- package/dist/services/chat/index.d.ts +3 -0
- package/dist/services/chat/index.js +6 -0
- package/dist/services/chat/system-prompt.cjs +223 -0
- package/dist/services/chat/system-prompt.cjs.map +1 -0
- package/dist/services/chat/system-prompt.d.cts +1 -0
- package/dist/services/chat/system-prompt.d.ts +1 -0
- package/dist/services/chat/system-prompt.js +223 -0
- package/dist/services/chat/system-prompt.js.map +1 -0
- package/dist/services/chat/tools/agent-tools.cjs +472 -0
- package/dist/services/chat/tools/agent-tools.cjs.map +1 -0
- package/dist/services/chat/tools/agent-tools.js +471 -0
- package/dist/services/chat/tools/agent-tools.js.map +1 -0
- package/dist/services/chat/tools/context-tools.cjs +252 -0
- package/dist/services/chat/tools/context-tools.cjs.map +1 -0
- package/dist/services/chat/tools/context-tools.js +251 -0
- package/dist/services/chat/tools/context-tools.js.map +1 -0
- package/dist/services/chat/tools/flow-tools.cjs +244 -0
- package/dist/services/chat/tools/flow-tools.cjs.map +1 -0
- package/dist/services/chat/tools/flow-tools.js +243 -0
- package/dist/services/chat/tools/flow-tools.js.map +1 -0
- package/dist/services/chat/tools/index.cjs +22 -0
- package/dist/services/chat/tools/index.cjs.map +1 -0
- package/dist/services/chat/tools/index.js +22 -0
- package/dist/services/chat/tools/index.js.map +1 -0
- package/dist/services/chat/tools/node-tools.cjs +323 -0
- package/dist/services/chat/tools/node-tools.cjs.map +1 -0
- package/dist/services/chat/tools/node-tools.js +322 -0
- package/dist/services/chat/tools/node-tools.js.map +1 -0
- package/dist/services/chat/tools/plan-tools.cjs +94 -0
- package/dist/services/chat/tools/plan-tools.cjs.map +1 -0
- package/dist/services/chat/tools/plan-tools.js +93 -0
- package/dist/services/chat/tools/plan-tools.js.map +1 -0
- package/dist/services/chat/tools/run-tools.cjs +121 -0
- package/dist/services/chat/tools/run-tools.cjs.map +1 -0
- package/dist/services/chat/tools/run-tools.js +120 -0
- package/dist/services/chat/tools/run-tools.js.map +1 -0
- package/dist/services/credentials/credentials.model.cjs +313 -0
- package/dist/services/credentials/credentials.model.cjs.map +1 -0
- package/dist/services/credentials/credentials.model.d.cts +27 -0
- package/dist/services/credentials/credentials.model.d.cts.map +1 -0
- package/dist/services/credentials/credentials.model.d.ts +27 -0
- package/dist/services/credentials/credentials.model.d.ts.map +1 -0
- package/dist/services/credentials/credentials.model.js +312 -0
- package/dist/services/credentials/credentials.model.js.map +1 -0
- package/dist/services/credentials/credentials.service.cjs +358 -0
- package/dist/services/credentials/credentials.service.cjs.map +1 -0
- package/dist/services/credentials/credentials.service.d.cts +156 -0
- package/dist/services/credentials/credentials.service.d.cts.map +1 -0
- package/dist/services/credentials/credentials.service.d.ts +156 -0
- package/dist/services/credentials/credentials.service.d.ts.map +1 -0
- package/dist/services/credentials/credentials.service.js +357 -0
- package/dist/services/credentials/credentials.service.js.map +1 -0
- package/dist/services/credentials/encryption.service.cjs +121 -0
- package/dist/services/credentials/encryption.service.cjs.map +1 -0
- package/dist/services/credentials/encryption.service.d.cts +70 -0
- package/dist/services/credentials/encryption.service.d.cts.map +1 -0
- package/dist/services/credentials/encryption.service.d.ts +70 -0
- package/dist/services/credentials/encryption.service.d.ts.map +1 -0
- package/dist/services/credentials/encryption.service.js +119 -0
- package/dist/services/credentials/encryption.service.js.map +1 -0
- package/dist/services/credentials/index.d.cts +4 -0
- package/dist/services/credentials/index.d.ts +4 -0
- package/dist/services/credentials/oauth2-providers.cjs +668 -0
- package/dist/services/credentials/oauth2-providers.cjs.map +1 -0
- package/dist/services/credentials/oauth2-providers.d.cts +39 -0
- package/dist/services/credentials/oauth2-providers.d.cts.map +1 -0
- package/dist/services/credentials/oauth2-providers.d.ts +39 -0
- package/dist/services/credentials/oauth2-providers.d.ts.map +1 -0
- package/dist/services/credentials/oauth2-providers.js +667 -0
- package/dist/services/credentials/oauth2-providers.js.map +1 -0
- package/dist/services/credentials/oauth2.service.cjs +252 -0
- package/dist/services/credentials/oauth2.service.cjs.map +1 -0
- package/dist/services/credentials/oauth2.service.d.cts +132 -0
- package/dist/services/credentials/oauth2.service.d.cts.map +1 -0
- package/dist/services/credentials/oauth2.service.d.ts +132 -0
- package/dist/services/credentials/oauth2.service.d.ts.map +1 -0
- package/dist/services/credentials/oauth2.service.js +251 -0
- package/dist/services/credentials/oauth2.service.js.map +1 -0
- package/dist/services/database/database.service.cjs +469 -0
- package/dist/services/database/database.service.cjs.map +1 -0
- package/dist/services/database/database.service.d.cts +162 -0
- package/dist/services/database/database.service.d.cts.map +1 -0
- package/dist/services/database/database.service.d.ts +162 -0
- package/dist/services/database/database.service.d.ts.map +1 -0
- package/dist/services/database/database.service.js +469 -0
- package/dist/services/database/database.service.js.map +1 -0
- package/dist/services/execution-event-bus.cjs +80 -0
- package/dist/services/execution-event-bus.cjs.map +1 -0
- package/dist/services/execution-event-bus.d.cts +57 -0
- package/dist/services/execution-event-bus.d.cts.map +1 -0
- package/dist/services/execution-event-bus.d.ts +57 -0
- package/dist/services/execution-event-bus.d.ts.map +1 -0
- package/dist/services/execution-event-bus.js +77 -0
- package/dist/services/execution-event-bus.js.map +1 -0
- package/dist/services/flow-orchestration/flow-run-coordinator.cjs +499 -0
- package/dist/services/flow-orchestration/flow-run-coordinator.cjs.map +1 -0
- package/dist/services/flow-orchestration/flow-run-coordinator.js +499 -0
- package/dist/services/flow-orchestration/flow-run-coordinator.js.map +1 -0
- package/dist/services/flow-orchestration/node-execution-coordinator.cjs +657 -0
- package/dist/services/flow-orchestration/node-execution-coordinator.cjs.map +1 -0
- package/dist/services/flow-orchestration/node-execution-coordinator.js +657 -0
- package/dist/services/flow-orchestration/node-execution-coordinator.js.map +1 -0
- package/dist/services/flow-orchestration.service.cjs +493 -0
- package/dist/services/flow-orchestration.service.cjs.map +1 -0
- package/dist/services/flow-orchestration.service.d.cts +149 -0
- package/dist/services/flow-orchestration.service.d.cts.map +1 -0
- package/dist/services/flow-orchestration.service.d.ts +149 -0
- package/dist/services/flow-orchestration.service.d.ts.map +1 -0
- package/dist/services/flow-orchestration.service.js +493 -0
- package/dist/services/flow-orchestration.service.js.map +1 -0
- package/dist/services/flow-runs/flow-runs.model.cjs +403 -0
- package/dist/services/flow-runs/flow-runs.model.cjs.map +1 -0
- package/dist/services/flow-runs/flow-runs.model.d.cts +113 -0
- package/dist/services/flow-runs/flow-runs.model.d.cts.map +1 -0
- package/dist/services/flow-runs/flow-runs.model.d.ts +113 -0
- package/dist/services/flow-runs/flow-runs.model.d.ts.map +1 -0
- package/dist/services/flow-runs/flow-runs.model.js +403 -0
- package/dist/services/flow-runs/flow-runs.model.js.map +1 -0
- package/dist/services/flow-runs/flow-runs.service.cjs +273 -0
- package/dist/services/flow-runs/flow-runs.service.cjs.map +1 -0
- package/dist/services/flow-runs/flow-runs.service.d.cts +129 -0
- package/dist/services/flow-runs/flow-runs.service.d.cts.map +1 -0
- package/dist/services/flow-runs/flow-runs.service.d.ts +129 -0
- package/dist/services/flow-runs/flow-runs.service.d.ts.map +1 -0
- package/dist/services/flow-runs/flow-runs.service.js +273 -0
- package/dist/services/flow-runs/flow-runs.service.js.map +1 -0
- package/dist/services/flow-validator.cjs +149 -0
- package/dist/services/flow-validator.cjs.map +1 -0
- package/dist/services/flow-validator.js +149 -0
- package/dist/services/flow-validator.js.map +1 -0
- package/dist/services/flow-versions/flow-versions.model.cjs +231 -0
- package/dist/services/flow-versions/flow-versions.model.cjs.map +1 -0
- package/dist/services/flow-versions/flow-versions.model.d.cts +55 -0
- package/dist/services/flow-versions/flow-versions.model.d.cts.map +1 -0
- package/dist/services/flow-versions/flow-versions.model.d.ts +55 -0
- package/dist/services/flow-versions/flow-versions.model.d.ts.map +1 -0
- package/dist/services/flow-versions/flow-versions.model.js +231 -0
- package/dist/services/flow-versions/flow-versions.model.js.map +1 -0
- package/dist/services/flow-versions/flow-versions.service.cjs +72 -0
- package/dist/services/flow-versions/flow-versions.service.cjs.map +1 -0
- package/dist/services/flow-versions/flow-versions.service.d.cts +63 -0
- package/dist/services/flow-versions/flow-versions.service.d.cts.map +1 -0
- package/dist/services/flow-versions/flow-versions.service.d.ts +63 -0
- package/dist/services/flow-versions/flow-versions.service.d.ts.map +1 -0
- package/dist/services/flow-versions/flow-versions.service.js +72 -0
- package/dist/services/flow-versions/flow-versions.service.js.map +1 -0
- package/dist/services/flow-versions/schemas-fresh.cjs +90 -0
- package/dist/services/flow-versions/schemas-fresh.cjs.map +1 -0
- package/dist/services/flow-versions/schemas-fresh.d.cts +201 -0
- package/dist/services/flow-versions/schemas-fresh.d.cts.map +1 -0
- package/dist/services/flow-versions/schemas-fresh.d.ts +201 -0
- package/dist/services/flow-versions/schemas-fresh.d.ts.map +1 -0
- package/dist/services/flow-versions/schemas-fresh.js +85 -0
- package/dist/services/flow-versions/schemas-fresh.js.map +1 -0
- package/dist/services/flows/flows.model.cjs +273 -0
- package/dist/services/flows/flows.model.cjs.map +1 -0
- package/dist/services/flows/flows.model.d.cts +105 -0
- package/dist/services/flows/flows.model.d.cts.map +1 -0
- package/dist/services/flows/flows.model.d.ts +105 -0
- package/dist/services/flows/flows.model.d.ts.map +1 -0
- package/dist/services/flows/flows.model.js +273 -0
- package/dist/services/flows/flows.model.js.map +1 -0
- package/dist/services/flows/flows.service.cjs +134 -0
- package/dist/services/flows/flows.service.cjs.map +1 -0
- package/dist/services/flows/flows.service.d.cts +105 -0
- package/dist/services/flows/flows.service.d.cts.map +1 -0
- package/dist/services/flows/flows.service.d.ts +105 -0
- package/dist/services/flows/flows.service.d.ts.map +1 -0
- package/dist/services/flows/flows.service.js +134 -0
- package/dist/services/flows/flows.service.js.map +1 -0
- package/dist/services/graph.service.cjs +375 -0
- package/dist/services/graph.service.cjs.map +1 -0
- package/dist/services/graph.service.d.cts +90 -0
- package/dist/services/graph.service.d.cts.map +1 -0
- package/dist/services/graph.service.d.ts +90 -0
- package/dist/services/graph.service.d.ts.map +1 -0
- package/dist/services/graph.service.js +375 -0
- package/dist/services/graph.service.js.map +1 -0
- package/dist/services/node-data.service.cjs +232 -0
- package/dist/services/node-data.service.cjs.map +1 -0
- package/dist/services/node-data.service.d.cts +119 -0
- package/dist/services/node-data.service.d.cts.map +1 -0
- package/dist/services/node-data.service.d.ts +119 -0
- package/dist/services/node-data.service.d.ts.map +1 -0
- package/dist/services/node-data.service.js +230 -0
- package/dist/services/node-data.service.js.map +1 -0
- package/dist/services/node-executions/node-execution.service.cjs +236 -0
- package/dist/services/node-executions/node-execution.service.cjs.map +1 -0
- package/dist/services/node-executions/node-execution.service.d.cts +126 -0
- package/dist/services/node-executions/node-execution.service.d.cts.map +1 -0
- package/dist/services/node-executions/node-execution.service.d.ts +126 -0
- package/dist/services/node-executions/node-execution.service.d.ts.map +1 -0
- package/dist/services/node-executions/node-execution.service.js +236 -0
- package/dist/services/node-executions/node-execution.service.js.map +1 -0
- package/dist/services/node-executions/node-executions.model.cjs +300 -0
- package/dist/services/node-executions/node-executions.model.cjs.map +1 -0
- package/dist/services/node-executions/node-executions.model.d.cts +102 -0
- package/dist/services/node-executions/node-executions.model.d.cts.map +1 -0
- package/dist/services/node-executions/node-executions.model.d.ts +102 -0
- package/dist/services/node-executions/node-executions.model.d.ts.map +1 -0
- package/dist/services/node-executions/node-executions.model.js +300 -0
- package/dist/services/node-executions/node-executions.model.js.map +1 -0
- package/dist/services/plugin-manager.cjs +205 -0
- package/dist/services/plugin-manager.cjs.map +1 -0
- package/dist/services/plugin-manager.js +205 -0
- package/dist/services/plugin-manager.js.map +1 -0
- package/dist/services/react-flow-renderer.service.cjs +236 -0
- package/dist/services/react-flow-renderer.service.cjs.map +1 -0
- package/dist/services/react-flow-renderer.service.d.cts +149 -0
- package/dist/services/react-flow-renderer.service.d.cts.map +1 -0
- package/dist/services/react-flow-renderer.service.d.ts +149 -0
- package/dist/services/react-flow-renderer.service.d.ts.map +1 -0
- package/dist/services/react-flow-renderer.service.js +235 -0
- package/dist/services/react-flow-renderer.service.js.map +1 -0
- package/dist/services/service-factory.cjs +301 -0
- package/dist/services/service-factory.cjs.map +1 -0
- package/dist/services/service-factory.d.cts +172 -0
- package/dist/services/service-factory.d.cts.map +1 -0
- package/dist/services/service-factory.d.ts +172 -0
- package/dist/services/service-factory.d.ts.map +1 -0
- package/dist/services/service-factory.js +301 -0
- package/dist/services/service-factory.js.map +1 -0
- package/dist/services/templating/index.cjs +2 -0
- package/dist/services/templating/index.d.ts +2 -0
- package/dist/services/templating/index.js +3 -0
- package/dist/services/templating/js-expression.service.cjs +148 -0
- package/dist/services/templating/js-expression.service.cjs.map +1 -0
- package/dist/services/templating/js-expression.service.d.cts +61 -0
- package/dist/services/templating/js-expression.service.d.cts.map +1 -0
- package/dist/services/templating/js-expression.service.d.ts +60 -0
- package/dist/services/templating/js-expression.service.d.ts.map +1 -0
- package/dist/services/templating/js-expression.service.js +143 -0
- package/dist/services/templating/js-expression.service.js.map +1 -0
- package/dist/services/templating/template.service.cjs +182 -0
- package/dist/services/templating/template.service.cjs.map +1 -0
- package/dist/services/templating/template.service.d.cts +62 -0
- package/dist/services/templating/template.service.d.cts.map +1 -0
- package/dist/services/templating/template.service.d.ts +62 -0
- package/dist/services/templating/template.service.d.ts.map +1 -0
- package/dist/services/templating/template.service.js +180 -0
- package/dist/services/templating/template.service.js.map +1 -0
- package/dist/services/triggers/cron-scheduler.service.cjs +141 -0
- package/dist/services/triggers/cron-scheduler.service.cjs.map +1 -0
- package/dist/services/triggers/cron-scheduler.service.d.cts +36 -0
- package/dist/services/triggers/cron-scheduler.service.d.cts.map +1 -0
- package/dist/services/triggers/cron-scheduler.service.d.ts +36 -0
- package/dist/services/triggers/cron-scheduler.service.d.ts.map +1 -0
- package/dist/services/triggers/cron-scheduler.service.js +140 -0
- package/dist/services/triggers/cron-scheduler.service.js.map +1 -0
- package/dist/services/triggers/flow-triggers.model.cjs +241 -0
- package/dist/services/triggers/flow-triggers.model.cjs.map +1 -0
- package/dist/services/triggers/flow-triggers.model.d.cts +53 -0
- package/dist/services/triggers/flow-triggers.model.d.cts.map +1 -0
- package/dist/services/triggers/flow-triggers.model.d.ts +53 -0
- package/dist/services/triggers/flow-triggers.model.d.ts.map +1 -0
- package/dist/services/triggers/flow-triggers.model.js +241 -0
- package/dist/services/triggers/flow-triggers.model.js.map +1 -0
- package/dist/services/triggers/flow-triggers.service.cjs +218 -0
- package/dist/services/triggers/flow-triggers.service.cjs.map +1 -0
- package/dist/services/triggers/flow-triggers.service.d.cts +77 -0
- package/dist/services/triggers/flow-triggers.service.d.cts.map +1 -0
- package/dist/services/triggers/flow-triggers.service.d.ts +77 -0
- package/dist/services/triggers/flow-triggers.service.d.ts.map +1 -0
- package/dist/services/triggers/flow-triggers.service.js +217 -0
- package/dist/services/triggers/flow-triggers.service.js.map +1 -0
- package/dist/services/triggers/index.cjs +3 -0
- package/dist/services/triggers/index.d.cts +4 -0
- package/dist/services/triggers/index.d.ts +4 -0
- package/dist/services/triggers/index.js +4 -0
- package/dist/services/triggers/trigger.types.d.cts +63 -0
- package/dist/services/triggers/trigger.types.d.cts.map +1 -0
- package/dist/services/triggers/trigger.types.d.ts +63 -0
- package/dist/services/triggers/trigger.types.d.ts.map +1 -0
- package/dist/types/agent-tool.types.cjs +20 -0
- package/dist/types/agent-tool.types.cjs.map +1 -0
- package/dist/types/agent-tool.types.d.cts +211 -0
- package/dist/types/agent-tool.types.d.cts.map +1 -0
- package/dist/types/agent-tool.types.d.ts +211 -0
- package/dist/types/agent-tool.types.d.ts.map +1 -0
- package/dist/types/agent-tool.types.js +18 -0
- package/dist/types/agent-tool.types.js.map +1 -0
- package/dist/types/auth.types.cjs +76 -0
- package/dist/types/auth.types.cjs.map +1 -0
- package/dist/types/auth.types.d.cts +235 -0
- package/dist/types/auth.types.d.cts.map +1 -0
- package/dist/types/auth.types.d.ts +235 -0
- package/dist/types/auth.types.d.ts.map +1 -0
- package/dist/types/auth.types.js +75 -0
- package/dist/types/auth.types.js.map +1 -0
- package/dist/types/base.cjs +25 -0
- package/dist/types/base.cjs.map +1 -0
- package/dist/types/base.d.cts +21 -0
- package/dist/types/base.d.cts.map +1 -0
- package/dist/types/base.d.ts +21 -0
- package/dist/types/base.d.ts.map +1 -0
- package/dist/types/base.js +24 -0
- package/dist/types/base.js.map +1 -0
- package/dist/types/common/errors.types.cjs +46 -0
- package/dist/types/common/errors.types.cjs.map +1 -0
- package/dist/types/common/errors.types.js +44 -0
- package/dist/types/common/errors.types.js.map +1 -0
- package/dist/types/graph-node-types.cjs +46 -0
- package/dist/types/graph-node-types.cjs.map +1 -0
- package/dist/types/graph-node-types.d.cts +32 -0
- package/dist/types/graph-node-types.d.cts.map +1 -0
- package/dist/types/graph-node-types.d.ts +32 -0
- package/dist/types/graph-node-types.d.ts.map +1 -0
- package/dist/types/graph-node-types.js +45 -0
- package/dist/types/graph-node-types.js.map +1 -0
- package/dist/types/node-config-update.types.d.cts +33 -0
- package/dist/types/node-config-update.types.d.cts.map +1 -0
- package/dist/types/node-config-update.types.d.ts +33 -0
- package/dist/types/node-config-update.types.d.ts.map +1 -0
- package/dist/types/node-definition.types.d.cts +88 -0
- package/dist/types/node-definition.types.d.cts.map +1 -0
- package/dist/types/node-definition.types.d.ts +88 -0
- package/dist/types/node-definition.types.d.ts.map +1 -0
- package/dist/types/node-execution.types.d.cts +39 -0
- package/dist/types/node-execution.types.d.cts.map +1 -0
- package/dist/types/node-execution.types.d.ts +39 -0
- package/dist/types/node-execution.types.d.ts.map +1 -0
- package/dist/types/node-io-types.cjs +19 -0
- package/dist/types/node-io-types.cjs.map +1 -0
- package/dist/types/node-io-types.d.cts +65 -0
- package/dist/types/node-io-types.d.cts.map +1 -0
- package/dist/types/node-io-types.d.ts +65 -0
- package/dist/types/node-io-types.d.ts.map +1 -0
- package/dist/types/node-io-types.js +18 -0
- package/dist/types/node-io-types.js.map +1 -0
- package/dist/types/node-output-schemas.cjs +51 -0
- package/dist/types/node-output-schemas.cjs.map +1 -0
- package/dist/types/node-output-schemas.js +50 -0
- package/dist/types/node-output-schemas.js.map +1 -0
- package/dist/types/plugin.types.d.cts +654 -0
- package/dist/types/plugin.types.d.cts.map +1 -0
- package/dist/types/plugin.types.d.ts +654 -0
- package/dist/types/plugin.types.d.ts.map +1 -0
- package/dist/types/schemas/flow/create-flow-version.schema.cjs +1 -0
- package/dist/types/schemas/flow/create-flow-version.schema.d.ts +1 -0
- package/dist/types/schemas/flow/create-flow-version.schema.js +2 -0
- package/dist/types/schemas/flow/create-flow.schema.cjs +9 -0
- package/dist/types/schemas/flow/create-flow.schema.cjs.map +1 -0
- package/dist/types/schemas/flow/create-flow.schema.d.cts +14 -0
- package/dist/types/schemas/flow/create-flow.schema.d.cts.map +1 -0
- package/dist/types/schemas/flow/create-flow.schema.d.ts +14 -0
- package/dist/types/schemas/flow/create-flow.schema.d.ts.map +1 -0
- package/dist/types/schemas/flow/create-flow.schema.js +10 -0
- package/dist/types/schemas/flow/create-flow.schema.js.map +1 -0
- package/dist/types/schemas/flow/delete-flow.schema.cjs +11 -0
- package/dist/types/schemas/flow/delete-flow.schema.cjs.map +1 -0
- package/dist/types/schemas/flow/delete-flow.schema.d.ts +1 -0
- package/dist/types/schemas/flow/delete-flow.schema.js +11 -0
- package/dist/types/schemas/flow/delete-flow.schema.js.map +1 -0
- package/dist/types/schemas/flow/flow-executions.schema.cjs +36 -0
- package/dist/types/schemas/flow/flow-executions.schema.cjs.map +1 -0
- package/dist/types/schemas/flow/flow-executions.schema.d.ts +1 -0
- package/dist/types/schemas/flow/flow-executions.schema.js +35 -0
- package/dist/types/schemas/flow/flow-executions.schema.js.map +1 -0
- package/dist/types/schemas/flow/get-flow-by-id-response.schema.cjs +7 -0
- package/dist/types/schemas/flow/get-flow-by-id-response.schema.cjs.map +1 -0
- package/dist/types/schemas/flow/get-flow-by-id-response.schema.d.ts +1 -0
- package/dist/types/schemas/flow/get-flow-by-id-response.schema.js +7 -0
- package/dist/types/schemas/flow/get-flow-by-id-response.schema.js.map +1 -0
- package/dist/types/schemas/flow/get-flow-versions-response.schema.cjs +1 -0
- package/dist/types/schemas/flow/get-flow-versions-response.schema.d.ts +1 -0
- package/dist/types/schemas/flow/get-flow-versions-response.schema.js +2 -0
- package/dist/types/schemas/flow/get-flows-response.schema.cjs +6 -0
- package/dist/types/schemas/flow/get-flows-response.schema.cjs.map +1 -0
- package/dist/types/schemas/flow/get-flows-response.schema.d.ts +1 -0
- package/dist/types/schemas/flow/get-flows-response.schema.js +7 -0
- package/dist/types/schemas/flow/get-flows-response.schema.js.map +1 -0
- package/dist/types/schemas/flow/index.cjs +9 -0
- package/dist/types/schemas/flow/index.d.ts +1 -0
- package/dist/types/schemas/flow/index.js +10 -0
- package/dist/types/schemas/flow/update-flow.schema.cjs +1 -0
- package/dist/types/schemas/flow/update-flow.schema.d.ts +1 -0
- package/dist/types/schemas/flow/update-flow.schema.js +2 -0
- package/dist/types/schemas/flow/validate-flow.schema.cjs +19 -0
- package/dist/types/schemas/flow/validate-flow.schema.cjs.map +1 -0
- package/dist/types/schemas/flow/validate-flow.schema.d.ts +1 -0
- package/dist/types/schemas/flow/validate-flow.schema.js +19 -0
- package/dist/types/schemas/flow/validate-flow.schema.js.map +1 -0
- package/dist/types/schemas/index.cjs +3 -0
- package/dist/types/schemas/index.d.ts +2 -0
- package/dist/types/schemas/index.js +4 -0
- package/dist/types/schemas/pagination-sort-filter.cjs +56 -0
- package/dist/types/schemas/pagination-sort-filter.cjs.map +1 -0
- package/dist/types/schemas/pagination-sort-filter.d.cts +38 -0
- package/dist/types/schemas/pagination-sort-filter.d.cts.map +1 -0
- package/dist/types/schemas/pagination-sort-filter.d.ts +38 -0
- package/dist/types/schemas/pagination-sort-filter.d.ts.map +1 -0
- package/dist/types/schemas/pagination-sort-filter.js +50 -0
- package/dist/types/schemas/pagination-sort-filter.js.map +1 -0
- package/dist/types/schemas-fresh/invect-config.cjs +181 -0
- package/dist/types/schemas-fresh/invect-config.cjs.map +1 -0
- package/dist/types/schemas-fresh/invect-config.d.cts +207 -0
- package/dist/types/schemas-fresh/invect-config.d.cts.map +1 -0
- package/dist/types/schemas-fresh/invect-config.d.ts +207 -0
- package/dist/types/schemas-fresh/invect-config.d.ts.map +1 -0
- package/dist/types/schemas-fresh/invect-config.js +174 -0
- package/dist/types/schemas-fresh/invect-config.js.map +1 -0
- package/dist/types/validation/common.schemas.cjs +41 -0
- package/dist/types/validation/common.schemas.cjs.map +1 -0
- package/dist/types/validation/common.schemas.js +39 -0
- package/dist/types/validation/common.schemas.js.map +1 -0
- package/dist/types/validation/flow.schemas.cjs +49 -0
- package/dist/types/validation/flow.schemas.cjs.map +1 -0
- package/dist/types/validation/flow.schemas.js +46 -0
- package/dist/types/validation/flow.schemas.js.map +1 -0
- package/dist/types/validation.cjs +49 -0
- package/dist/types/validation.cjs.map +1 -0
- package/dist/types/validation.d.cts +49 -0
- package/dist/types/validation.d.cts.map +1 -0
- package/dist/types/validation.d.ts +49 -0
- package/dist/types/validation.d.ts.map +1 -0
- package/dist/types/validation.js +48 -0
- package/dist/types/validation.js.map +1 -0
- package/dist/types-export.cjs +11 -0
- package/dist/types-export.d.cts +25 -0
- package/dist/types-export.d.ts +25 -0
- package/dist/types-export.js +5 -0
- package/dist/types-fresh.cjs +9 -0
- package/dist/types-fresh.cjs.map +1 -0
- package/dist/types-fresh.d.cts +129 -0
- package/dist/types-fresh.d.cts.map +1 -0
- package/dist/types-fresh.d.ts +129 -0
- package/dist/types-fresh.d.ts.map +1 -0
- package/dist/types-fresh.js +8 -0
- package/dist/types-fresh.js.map +1 -0
- package/dist/utils/id-generator.cjs +34 -0
- package/dist/utils/id-generator.cjs.map +1 -0
- package/dist/utils/id-generator.js +34 -0
- package/dist/utils/id-generator.js.map +1 -0
- package/dist/utils/logger.cjs +285 -0
- package/dist/utils/logger.cjs.map +1 -0
- package/dist/utils/logger.d.cts +161 -0
- package/dist/utils/logger.d.cts.map +1 -0
- package/dist/utils/logger.d.ts +160 -0
- package/dist/utils/logger.d.ts.map +1 -0
- package/dist/utils/logger.js +282 -0
- package/dist/utils/logger.js.map +1 -0
- package/dist/utils/node-slug.cjs +13 -0
- package/dist/utils/node-slug.cjs.map +1 -0
- package/dist/utils/node-slug.d.cts +8 -0
- package/dist/utils/node-slug.d.cts.map +1 -0
- package/dist/utils/node-slug.d.ts +8 -0
- package/dist/utils/node-slug.d.ts.map +1 -0
- package/dist/utils/node-slug.js +13 -0
- package/dist/utils/node-slug.js.map +1 -0
- package/dist/utils/provider-detection.cjs +72 -0
- package/dist/utils/provider-detection.cjs.map +1 -0
- package/dist/utils/provider-detection.js +72 -0
- package/dist/utils/provider-detection.js.map +1 -0
- package/dist/utils/url-safe-id.cjs +52 -0
- package/dist/utils/url-safe-id.cjs.map +1 -0
- package/dist/utils/url-safe-id.js +52 -0
- package/dist/utils/url-safe-id.js.map +1 -0
- package/package.json +121 -0
|
@@ -0,0 +1,1688 @@
|
|
|
1
|
+
import { DatabaseError, ValidationError } from "./types/common/errors.types.js";
|
|
2
|
+
import { FlowRunStatus, NodeExecutionStatus } from "./types/base.js";
|
|
3
|
+
import { BatchProvider } from "./services/ai/ai-types.js";
|
|
4
|
+
import "./services/ai/base-client.js";
|
|
5
|
+
import { GraphNodeType } from "./types/graph-node-types.js";
|
|
6
|
+
import "./types-fresh.js";
|
|
7
|
+
import { detectProviderFromCredential } from "./utils/provider-detection.js";
|
|
8
|
+
import { getTemplateService } from "./services/templating/template.service.js";
|
|
9
|
+
import { JsExpressionService } from "./services/templating/js-expression.service.js";
|
|
10
|
+
import { initializeGlobalActionRegistry } from "./actions/action-registry.js";
|
|
11
|
+
import { createToolExecutorForAction } from "./actions/action-executor.js";
|
|
12
|
+
import { LoggerManager } from "./utils/logger.js";
|
|
13
|
+
import { QueryOptionsSchema } from "./types/schemas/pagination-sort-filter.js";
|
|
14
|
+
import { createFlowVersionRequestSchema, invectDefinitionSchema } from "./services/flow-versions/schemas-fresh.js";
|
|
15
|
+
import { createFlowRequestSchema } from "./types/schemas/flow/create-flow.schema.js";
|
|
16
|
+
import { FlowIdParamsSchema } from "./types/schemas/flow/flow-executions.schema.js";
|
|
17
|
+
import { InvectConfigSchema } from "./types/schemas-fresh/invect-config.js";
|
|
18
|
+
import "./types/schemas/index.js";
|
|
19
|
+
import { ServiceFactory } from "./services/service-factory.js";
|
|
20
|
+
import { getGlobalToolRegistry, initializeGlobalToolRegistry } from "./services/agent-tools/agent-tool-registry.js";
|
|
21
|
+
import { DefaultNodeRegistryFactory } from "./nodes/executor-registry.js";
|
|
22
|
+
import { FlowValidator } from "./services/flow-validator.js";
|
|
23
|
+
import "./services/templating/index.js";
|
|
24
|
+
import "./services/agent-tools/index.js";
|
|
25
|
+
import { PluginManager } from "./services/plugin-manager.js";
|
|
26
|
+
import { registerBuiltinActions } from "./actions/index.js";
|
|
27
|
+
import { createAuthorizationService } from "./services/auth/authorization.service.js";
|
|
28
|
+
//#region src/invect-core.ts
|
|
29
|
+
function createPluginDatabaseApi(connection) {
|
|
30
|
+
const normalizeSql = (statement) => {
|
|
31
|
+
if (connection.type !== "postgresql") return statement;
|
|
32
|
+
let index = 0;
|
|
33
|
+
return statement.replace(/\?/g, () => `$${++index}`);
|
|
34
|
+
};
|
|
35
|
+
const query = async (statement, params = []) => {
|
|
36
|
+
switch (connection.type) {
|
|
37
|
+
case "postgresql": return connection.db.$client.unsafe(normalizeSql(statement), params);
|
|
38
|
+
case "sqlite": return connection.db.$client.prepare(statement).all(...params);
|
|
39
|
+
case "mysql": {
|
|
40
|
+
const [rows] = await connection.db.$client.execute(statement, params);
|
|
41
|
+
return Array.isArray(rows) ? rows : [];
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
return {
|
|
46
|
+
type: connection.type,
|
|
47
|
+
query,
|
|
48
|
+
async execute(statement, params = []) {
|
|
49
|
+
switch (connection.type) {
|
|
50
|
+
case "postgresql":
|
|
51
|
+
await connection.db.$client.unsafe(normalizeSql(statement), params);
|
|
52
|
+
return;
|
|
53
|
+
case "sqlite": {
|
|
54
|
+
const client = connection.db.$client;
|
|
55
|
+
const coerced = params.map((param) => typeof param === "boolean" ? param ? 1 : 0 : param);
|
|
56
|
+
client.prepare(statement).run(...coerced);
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
case "mysql":
|
|
60
|
+
await connection.db.$client.execute(statement, params);
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
GraphNodeType.GMAIL;
|
|
67
|
+
/**
|
|
68
|
+
* Main Invect Core class
|
|
69
|
+
*
|
|
70
|
+
* Provides a high-level API for flow operations with comprehensive lifecycle management.
|
|
71
|
+
* This class orchestrates all flow-related operations including:
|
|
72
|
+
* - Flow and flow version management
|
|
73
|
+
* - Flow execution and monitoring
|
|
74
|
+
* - Node execution tracking
|
|
75
|
+
* - AI batch operations
|
|
76
|
+
* - Testing and development utilities
|
|
77
|
+
*
|
|
78
|
+
* @example
|
|
79
|
+
* ```typescript
|
|
80
|
+
* const invect = new Invect(config);
|
|
81
|
+
* await invect.initialize();
|
|
82
|
+
*
|
|
83
|
+
* const flow = await invect.createFlow({ name: "My Flow", description: "..." });
|
|
84
|
+
* const result = await invect.startFlowRun(flow.id, inputs);
|
|
85
|
+
*
|
|
86
|
+
* await invect.shutdown();
|
|
87
|
+
* ```
|
|
88
|
+
*/
|
|
89
|
+
var Invect = class {
|
|
90
|
+
serviceFactory = null;
|
|
91
|
+
nodeRegistry = null;
|
|
92
|
+
actionRegistry = null;
|
|
93
|
+
jsExpressionService = null;
|
|
94
|
+
templateService = null;
|
|
95
|
+
pluginManager;
|
|
96
|
+
initialized = false;
|
|
97
|
+
loggerManager;
|
|
98
|
+
authService;
|
|
99
|
+
/**
|
|
100
|
+
* Creates a new Invect instance
|
|
101
|
+
*
|
|
102
|
+
* @param config - Invect configuration object
|
|
103
|
+
*/
|
|
104
|
+
constructor(config) {
|
|
105
|
+
this.config = config;
|
|
106
|
+
this.config = InvectConfigSchema.parse(config);
|
|
107
|
+
this.loggerManager = new LoggerManager({
|
|
108
|
+
level: this.config.logging?.level || "info",
|
|
109
|
+
scopes: this.config.logging?.scopes
|
|
110
|
+
});
|
|
111
|
+
this.config.logger = this.loggerManager.getBasicLogger();
|
|
112
|
+
this.authService = createAuthorizationService({
|
|
113
|
+
config: this.config.auth,
|
|
114
|
+
logger: this.config.logger
|
|
115
|
+
});
|
|
116
|
+
this.pluginManager = new PluginManager(this.config.plugins ?? []);
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* Authorize an action for an identity.
|
|
120
|
+
*
|
|
121
|
+
* This is the main entry point for authorization checks. Framework adapters
|
|
122
|
+
* (Express, NestJS, Next.js) should call this method to check permissions.
|
|
123
|
+
*
|
|
124
|
+
* @param context - Authorization context with identity, action, and optional resource
|
|
125
|
+
* @returns Authorization result with allowed flag and optional reason
|
|
126
|
+
*
|
|
127
|
+
* @example
|
|
128
|
+
* ```typescript
|
|
129
|
+
* const result = await invect.authorize({
|
|
130
|
+
* identity: { id: 'user_123', role: 'editor' },
|
|
131
|
+
* action: 'flow:create',
|
|
132
|
+
* });
|
|
133
|
+
*
|
|
134
|
+
* if (!result.allowed) {
|
|
135
|
+
* throw new ForbiddenError(result.reason);
|
|
136
|
+
* }
|
|
137
|
+
* ```
|
|
138
|
+
*/
|
|
139
|
+
async authorize(context) {
|
|
140
|
+
const hookResult = await this.pluginManager.runOnAuthorize({
|
|
141
|
+
...context,
|
|
142
|
+
database: this.serviceFactory ? createPluginDatabaseApi(this.serviceFactory.getDatabaseService().getConnection()) : void 0
|
|
143
|
+
});
|
|
144
|
+
if (hookResult) return hookResult;
|
|
145
|
+
return this.authService.authorize(context);
|
|
146
|
+
}
|
|
147
|
+
/**
|
|
148
|
+
* Check if a specific identity has a permission.
|
|
149
|
+
* Convenience method that wraps authorize().
|
|
150
|
+
*/
|
|
151
|
+
hasPermission(identity, permission) {
|
|
152
|
+
return this.authService.hasPermission(identity, permission);
|
|
153
|
+
}
|
|
154
|
+
/**
|
|
155
|
+
* Get all permissions for an identity.
|
|
156
|
+
*/
|
|
157
|
+
getPermissions(identity) {
|
|
158
|
+
return this.authService.getPermissions(identity);
|
|
159
|
+
}
|
|
160
|
+
/**
|
|
161
|
+
* Check if a plugin is registered by ID.
|
|
162
|
+
*/
|
|
163
|
+
hasPlugin(pluginId) {
|
|
164
|
+
return this.pluginManager.hasPlugin(pluginId);
|
|
165
|
+
}
|
|
166
|
+
/**
|
|
167
|
+
* Get a registered plugin by ID.
|
|
168
|
+
*/
|
|
169
|
+
getPlugin(pluginId) {
|
|
170
|
+
return this.pluginManager.getPlugin(pluginId);
|
|
171
|
+
}
|
|
172
|
+
/**
|
|
173
|
+
* Get all registered plugins.
|
|
174
|
+
*/
|
|
175
|
+
getPlugins() {
|
|
176
|
+
return this.pluginManager.getPlugins();
|
|
177
|
+
}
|
|
178
|
+
/**
|
|
179
|
+
* Get all plugin-defined API endpoints.
|
|
180
|
+
* Framework adapters use this to mount plugin routes.
|
|
181
|
+
*/
|
|
182
|
+
getPluginEndpoints() {
|
|
183
|
+
return this.pluginManager.getPluginEndpoints();
|
|
184
|
+
}
|
|
185
|
+
/**
|
|
186
|
+
* Get the plugin hook runner for framework adapters.
|
|
187
|
+
* Used to run onRequest/onResponse/onAuthorize hooks.
|
|
188
|
+
*/
|
|
189
|
+
getPluginHookRunner() {
|
|
190
|
+
return this.pluginManager;
|
|
191
|
+
}
|
|
192
|
+
/**
|
|
193
|
+
* Get the initialized host database connection.
|
|
194
|
+
* Framework adapters use this to expose a narrow database API to plugins.
|
|
195
|
+
*/
|
|
196
|
+
getDatabaseConnection() {
|
|
197
|
+
if (!this.serviceFactory) throw new Error("ServiceFactory not initialized");
|
|
198
|
+
return this.serviceFactory.getDatabaseService().getConnection();
|
|
199
|
+
}
|
|
200
|
+
/**
|
|
201
|
+
* Check if authentication is enabled.
|
|
202
|
+
*/
|
|
203
|
+
isAuthEnabled() {
|
|
204
|
+
return this.authService.isEnabled();
|
|
205
|
+
}
|
|
206
|
+
/**
|
|
207
|
+
* Check if a route is public (no auth required).
|
|
208
|
+
*/
|
|
209
|
+
isPublicRoute(path) {
|
|
210
|
+
return this.authService.isPublicRoute(path);
|
|
211
|
+
}
|
|
212
|
+
/**
|
|
213
|
+
* Get the authorization service for advanced use cases.
|
|
214
|
+
* The service extends EventEmitter and emits auth events.
|
|
215
|
+
*/
|
|
216
|
+
getAuthService() {
|
|
217
|
+
return this.authService;
|
|
218
|
+
}
|
|
219
|
+
/**
|
|
220
|
+
* Get available roles and their permissions.
|
|
221
|
+
* Useful for admin UIs to show role options.
|
|
222
|
+
*/
|
|
223
|
+
getAvailableRoles() {
|
|
224
|
+
return this.authService.getAvailableRoles();
|
|
225
|
+
}
|
|
226
|
+
/**
|
|
227
|
+
* Subscribe to auth events for audit logging.
|
|
228
|
+
*
|
|
229
|
+
* @example
|
|
230
|
+
* ```typescript
|
|
231
|
+
* invect.onAuthEvent('auth:forbidden', (event) => {
|
|
232
|
+
* auditLogger.warn('Access denied', event);
|
|
233
|
+
* });
|
|
234
|
+
* ```
|
|
235
|
+
*/
|
|
236
|
+
onAuthEvent(event, listener) {
|
|
237
|
+
this.authService.on(event, listener);
|
|
238
|
+
}
|
|
239
|
+
/**
|
|
240
|
+
* Check if flow access table is enabled.
|
|
241
|
+
*/
|
|
242
|
+
isFlowAccessTableEnabled() {
|
|
243
|
+
return !!this.config.auth?.useFlowAccessTable;
|
|
244
|
+
}
|
|
245
|
+
/**
|
|
246
|
+
* Grant access to a flow for a user or team.
|
|
247
|
+
* Requires useFlowAccessTable: true in config.
|
|
248
|
+
*
|
|
249
|
+
* @example
|
|
250
|
+
* ```typescript
|
|
251
|
+
* // Grant editor access to a user
|
|
252
|
+
* await invect.grantFlowAccess({
|
|
253
|
+
* flowId: 'flow_123',
|
|
254
|
+
* userId: 'user_456',
|
|
255
|
+
* permission: 'editor',
|
|
256
|
+
* grantedBy: currentUser.id,
|
|
257
|
+
* });
|
|
258
|
+
*
|
|
259
|
+
* // Grant viewer access to a team
|
|
260
|
+
* await invect.grantFlowAccess({
|
|
261
|
+
* flowId: 'flow_123',
|
|
262
|
+
* teamId: 'team_abc',
|
|
263
|
+
* permission: 'viewer',
|
|
264
|
+
* });
|
|
265
|
+
* ```
|
|
266
|
+
*/
|
|
267
|
+
async grantFlowAccess(input) {
|
|
268
|
+
this.ensureInitialized();
|
|
269
|
+
const flowAccessService = this.serviceFactory.getFlowAccessService();
|
|
270
|
+
if (!flowAccessService) throw new Error("Flow access table not enabled. Set auth.useFlowAccessTable: true in config.");
|
|
271
|
+
return flowAccessService.grantAccess(input);
|
|
272
|
+
}
|
|
273
|
+
/**
|
|
274
|
+
* Revoke a specific flow access record.
|
|
275
|
+
* Requires useFlowAccessTable: true in config.
|
|
276
|
+
*/
|
|
277
|
+
async revokeFlowAccess(accessId) {
|
|
278
|
+
this.ensureInitialized();
|
|
279
|
+
const flowAccessService = this.serviceFactory.getFlowAccessService();
|
|
280
|
+
if (!flowAccessService) throw new Error("Flow access table not enabled. Set auth.useFlowAccessTable: true in config.");
|
|
281
|
+
return flowAccessService.revokeAccess(accessId);
|
|
282
|
+
}
|
|
283
|
+
/**
|
|
284
|
+
* Revoke all access to a flow for a specific user or team.
|
|
285
|
+
* Requires useFlowAccessTable: true in config.
|
|
286
|
+
*/
|
|
287
|
+
async revokeFlowAccessForUserOrTeam(flowId, userId, teamId) {
|
|
288
|
+
this.ensureInitialized();
|
|
289
|
+
const flowAccessService = this.serviceFactory.getFlowAccessService();
|
|
290
|
+
if (!flowAccessService) throw new Error("Flow access table not enabled. Set auth.useFlowAccessTable: true in config.");
|
|
291
|
+
return flowAccessService.revokeAccessForUserOrTeam(flowId, userId, teamId);
|
|
292
|
+
}
|
|
293
|
+
/**
|
|
294
|
+
* List all access records for a flow.
|
|
295
|
+
* Requires useFlowAccessTable: true in config.
|
|
296
|
+
*/
|
|
297
|
+
async listFlowAccess(flowId) {
|
|
298
|
+
this.ensureInitialized();
|
|
299
|
+
const flowAccessService = this.serviceFactory.getFlowAccessService();
|
|
300
|
+
if (!flowAccessService) throw new Error("Flow access table not enabled. Set auth.useFlowAccessTable: true in config.");
|
|
301
|
+
return flowAccessService.listFlowAccess(flowId);
|
|
302
|
+
}
|
|
303
|
+
/**
|
|
304
|
+
* Get all flows a user has access to (directly or via teams).
|
|
305
|
+
* Requires useFlowAccessTable: true in config.
|
|
306
|
+
*/
|
|
307
|
+
async getAccessibleFlowIds(userId, teamIds = []) {
|
|
308
|
+
this.ensureInitialized();
|
|
309
|
+
const flowAccessService = this.serviceFactory.getFlowAccessService();
|
|
310
|
+
if (!flowAccessService) throw new Error("Flow access table not enabled. Set auth.useFlowAccessTable: true in config.");
|
|
311
|
+
return flowAccessService.getAccessibleFlowIds(userId, teamIds);
|
|
312
|
+
}
|
|
313
|
+
/**
|
|
314
|
+
* Check if a user has access to a flow with at least the required permission.
|
|
315
|
+
* Requires useFlowAccessTable: true in config.
|
|
316
|
+
*/
|
|
317
|
+
async hasFlowAccess(flowId, userId, teamIds = [], requiredPermission = "viewer") {
|
|
318
|
+
this.ensureInitialized();
|
|
319
|
+
const flowAccessService = this.serviceFactory.getFlowAccessService();
|
|
320
|
+
if (!flowAccessService) throw new Error("Flow access table not enabled. Set auth.useFlowAccessTable: true in config.");
|
|
321
|
+
return flowAccessService.hasFlowAccess(flowId, userId, teamIds, requiredPermission);
|
|
322
|
+
}
|
|
323
|
+
/**
|
|
324
|
+
* Get the highest permission level a user has for a flow.
|
|
325
|
+
* Requires useFlowAccessTable: true in config.
|
|
326
|
+
*/
|
|
327
|
+
async getFlowPermission(flowId, userId, teamIds = []) {
|
|
328
|
+
this.ensureInitialized();
|
|
329
|
+
const flowAccessService = this.serviceFactory.getFlowAccessService();
|
|
330
|
+
if (!flowAccessService) throw new Error("Flow access table not enabled. Set auth.useFlowAccessTable: true in config.");
|
|
331
|
+
return flowAccessService.getFlowPermission(flowId, userId, teamIds);
|
|
332
|
+
}
|
|
333
|
+
/**
|
|
334
|
+
* Get a scoped logger for a specific feature area.
|
|
335
|
+
*
|
|
336
|
+
* Scoped loggers have independent log levels that can be configured
|
|
337
|
+
* per scope via the logging.scopes configuration.
|
|
338
|
+
*
|
|
339
|
+
* @param scope - The scope/feature area (use LogScope constants)
|
|
340
|
+
* @param context - Optional additional context (e.g., class name)
|
|
341
|
+
* @returns A ScopedLogger instance
|
|
342
|
+
*
|
|
343
|
+
* @example
|
|
344
|
+
* ```typescript
|
|
345
|
+
* const logger = invect.getLogger('execution', 'MyService');
|
|
346
|
+
* logger.debug('Starting execution'); // Only logs if execution scope is 'debug'
|
|
347
|
+
* ```
|
|
348
|
+
*/
|
|
349
|
+
getLogger(scope, context) {
|
|
350
|
+
return this.loggerManager.getLogger(scope, context);
|
|
351
|
+
}
|
|
352
|
+
/**
|
|
353
|
+
* Get the logger manager for advanced logging configuration
|
|
354
|
+
*/
|
|
355
|
+
getLoggerManager() {
|
|
356
|
+
return this.loggerManager;
|
|
357
|
+
}
|
|
358
|
+
/**
|
|
359
|
+
* Update the log level for a specific scope at runtime
|
|
360
|
+
*
|
|
361
|
+
* @example
|
|
362
|
+
* ```typescript
|
|
363
|
+
* // Enable debug logging for execution during troubleshooting
|
|
364
|
+
* invect.setLogLevel('execution', 'debug');
|
|
365
|
+
* ```
|
|
366
|
+
*/
|
|
367
|
+
setLogLevel(scope, level) {
|
|
368
|
+
this.loggerManager.setLogLevel(scope, level);
|
|
369
|
+
}
|
|
370
|
+
/**
|
|
371
|
+
* Initialize Invect Core
|
|
372
|
+
*/
|
|
373
|
+
async initialize() {
|
|
374
|
+
if (this.initialized) {
|
|
375
|
+
this.config.logger.debug("Invect Core already initialized");
|
|
376
|
+
return;
|
|
377
|
+
}
|
|
378
|
+
if (this.isBuildTime()) {
|
|
379
|
+
this.config.logger.info("Skipping Invect Core initialization during build time");
|
|
380
|
+
throw new DatabaseError("Invect Core initialization skipped during build", {
|
|
381
|
+
reason: "build_time_skip",
|
|
382
|
+
phase: process.env.NEXT_PHASE || "unknown"
|
|
383
|
+
});
|
|
384
|
+
}
|
|
385
|
+
this.config.logger.info("Initializing Invect Core...");
|
|
386
|
+
try {
|
|
387
|
+
this.actionRegistry = initializeGlobalActionRegistry(this.config.logger);
|
|
388
|
+
registerBuiltinActions(this.actionRegistry);
|
|
389
|
+
this.config.logger.info(`Registered ${this.actionRegistry.size} built-in actions from ${this.actionRegistry.getProviders().length} providers`);
|
|
390
|
+
const actionRegistry = this.actionRegistry;
|
|
391
|
+
await this.pluginManager.initializePlugins({
|
|
392
|
+
config: this.config,
|
|
393
|
+
logger: this.config.logger,
|
|
394
|
+
registerAction: (action) => {
|
|
395
|
+
actionRegistry.register(action);
|
|
396
|
+
}
|
|
397
|
+
});
|
|
398
|
+
if (this.pluginManager.getPlugins().length > 0) this.config.logger.info(`Initialized ${this.pluginManager.getPlugins().length} plugin(s): ${this.pluginManager.getPlugins().map((p) => p.id).join(", ")}`);
|
|
399
|
+
this.nodeRegistry = await this.initializeNodes();
|
|
400
|
+
try {
|
|
401
|
+
this.jsExpressionService = new JsExpressionService({}, this.config.logger);
|
|
402
|
+
await this.jsExpressionService.initialize();
|
|
403
|
+
this.templateService = getTemplateService(this.jsExpressionService, this.config.logger);
|
|
404
|
+
this.config.logger.debug("JS expression engine + template service initialized");
|
|
405
|
+
} catch (error) {
|
|
406
|
+
this.jsExpressionService = null;
|
|
407
|
+
this.templateService = null;
|
|
408
|
+
this.config.logger.warn("JS expression engine unavailable; continuing without data mapper and template expression support", { error: error instanceof Error ? error.stack ?? error.message : String(error) });
|
|
409
|
+
}
|
|
410
|
+
this.registerActionsAsTools();
|
|
411
|
+
await this.initializeServices(this.nodeRegistry);
|
|
412
|
+
this.initialized = true;
|
|
413
|
+
if (this.config.defaultCredentials?.length) this.ensureDefaultCredentials().catch((err) => {
|
|
414
|
+
this.config.logger.error("Default credential seeding failed", err);
|
|
415
|
+
});
|
|
416
|
+
} catch (error) {
|
|
417
|
+
if (error instanceof DatabaseError) throw error;
|
|
418
|
+
this.config.logger.error("Failed to initialize Invect Core", error);
|
|
419
|
+
throw new DatabaseError("Invect Core initialization failed", { error });
|
|
420
|
+
}
|
|
421
|
+
}
|
|
422
|
+
/**
|
|
423
|
+
* Check if we're in a build-time environment where database connections should be avoided
|
|
424
|
+
*/
|
|
425
|
+
isBuildTime() {
|
|
426
|
+
if (process.env.NEXT_PHASE === "phase-production-build") return true;
|
|
427
|
+
if (process.env.VERCEL_ENV && process.env.CI) return true;
|
|
428
|
+
if (process.env.CI && (process.env.NODE_ENV === "production" || process.env.BUILD_PHASE || process.argv.includes("build"))) return true;
|
|
429
|
+
return false;
|
|
430
|
+
}
|
|
431
|
+
/**
|
|
432
|
+
* Gracefully shutdown Invect Core.
|
|
433
|
+
* Marks any in-progress flow runs as FAILED before closing services.
|
|
434
|
+
*/
|
|
435
|
+
async shutdown() {
|
|
436
|
+
this.config.logger.info("Shutting down Invect Core...");
|
|
437
|
+
try {
|
|
438
|
+
if (this.serviceFactory?.isInitialized()) try {
|
|
439
|
+
const failedCount = await this.serviceFactory.getFlowRunsService().failStaleRuns(0);
|
|
440
|
+
if (failedCount > 0) this.config.logger.warn(`Graceful shutdown: marked ${failedCount} in-progress flow run(s) as FAILED`);
|
|
441
|
+
} catch (error) {
|
|
442
|
+
this.config.logger.error("Failed to mark in-progress runs during shutdown", error);
|
|
443
|
+
}
|
|
444
|
+
await this.pluginManager.shutdownPlugins(this.config.logger);
|
|
445
|
+
if (this.serviceFactory) {
|
|
446
|
+
await this.serviceFactory.close();
|
|
447
|
+
this.serviceFactory = null;
|
|
448
|
+
}
|
|
449
|
+
this.nodeRegistry = null;
|
|
450
|
+
this.actionRegistry = null;
|
|
451
|
+
if (this.jsExpressionService) {
|
|
452
|
+
this.jsExpressionService.dispose();
|
|
453
|
+
this.jsExpressionService = null;
|
|
454
|
+
}
|
|
455
|
+
this.templateService = null;
|
|
456
|
+
this.initialized = false;
|
|
457
|
+
this.config.logger.info("Invect Core shutdown completed");
|
|
458
|
+
} catch (error) {
|
|
459
|
+
this.config.logger.error("Error during Invect Core shutdown", error);
|
|
460
|
+
throw new DatabaseError("Invect Core shutdown failed", { error });
|
|
461
|
+
}
|
|
462
|
+
}
|
|
463
|
+
/**
|
|
464
|
+
* Check if core is initialized
|
|
465
|
+
*/
|
|
466
|
+
isInitialized() {
|
|
467
|
+
return this.initialized;
|
|
468
|
+
}
|
|
469
|
+
/**
|
|
470
|
+
* Run health check on all services
|
|
471
|
+
*/
|
|
472
|
+
async healthCheck() {
|
|
473
|
+
this.ensureInitialized();
|
|
474
|
+
return (await this.serviceFactory.healthCheck()).services;
|
|
475
|
+
}
|
|
476
|
+
/**
|
|
477
|
+
* Create a new flow
|
|
478
|
+
*/
|
|
479
|
+
async createFlow(flowData) {
|
|
480
|
+
this.config.logger.debug("createFlow called with arguments:", JSON.stringify(flowData, null, 2));
|
|
481
|
+
const data = createFlowRequestSchema.parse(flowData);
|
|
482
|
+
return this.flowService.createFlow(data);
|
|
483
|
+
}
|
|
484
|
+
/**
|
|
485
|
+
* Get all flows with optional filtering, sorting, and pagination
|
|
486
|
+
*/
|
|
487
|
+
async listFlows(options) {
|
|
488
|
+
this.config.logger.debug("listFlows called with arguments:", JSON.stringify(options, null, 2));
|
|
489
|
+
if (options) QueryOptionsSchema.parse(options);
|
|
490
|
+
return await this.flowService.listFlows(options);
|
|
491
|
+
}
|
|
492
|
+
/**
|
|
493
|
+
* Get flow by ID
|
|
494
|
+
*/
|
|
495
|
+
async getFlow(flowId) {
|
|
496
|
+
this.config.logger.debug("getFlow called with arguments:", JSON.stringify({ flowId }, null, 2));
|
|
497
|
+
const validatedParams = FlowIdParamsSchema.parse({ flowId });
|
|
498
|
+
return this.flowService.getFlowById(validatedParams.flowId);
|
|
499
|
+
}
|
|
500
|
+
/**
|
|
501
|
+
* Update an existing flow
|
|
502
|
+
*/
|
|
503
|
+
async updateFlow(flowId, updateData) {
|
|
504
|
+
this.config.logger.debug("updateFlow called with arguments:", JSON.stringify({
|
|
505
|
+
flowId,
|
|
506
|
+
updateData
|
|
507
|
+
}, null, 2));
|
|
508
|
+
const validatedParams = FlowIdParamsSchema.parse({ flowId });
|
|
509
|
+
return this.flowService.updateFlow(validatedParams.flowId, updateData);
|
|
510
|
+
}
|
|
511
|
+
/**
|
|
512
|
+
* Delete a flow
|
|
513
|
+
*/
|
|
514
|
+
async deleteFlow(flowId) {
|
|
515
|
+
this.config.logger.debug("deleteFlow called with arguments:", JSON.stringify({ flowId }, null, 2));
|
|
516
|
+
const validatedParams = FlowIdParamsSchema.parse({ flowId });
|
|
517
|
+
return this.flowService.deleteFlow(validatedParams.flowId);
|
|
518
|
+
}
|
|
519
|
+
/**
|
|
520
|
+
* Validate flow definition
|
|
521
|
+
*/
|
|
522
|
+
async validateFlowDefinition(flowId, flowDefinition) {
|
|
523
|
+
this.config.logger.debug("validateFlowDefinition called with arguments:", JSON.stringify({
|
|
524
|
+
flowId,
|
|
525
|
+
flowDefinition
|
|
526
|
+
}, null, 2));
|
|
527
|
+
this.ensureInitialized();
|
|
528
|
+
const validatedParams = FlowIdParamsSchema.parse({ flowId });
|
|
529
|
+
const typedDefinition = invectDefinitionSchema.parse(flowDefinition);
|
|
530
|
+
this.config.logger.debug("Validating flow definition", { flowId: validatedParams.flowId });
|
|
531
|
+
try {
|
|
532
|
+
const validationResult = FlowValidator.validateFlowDefinition(typedDefinition);
|
|
533
|
+
this.config.logger.debug("Flow validation completed", validationResult);
|
|
534
|
+
return validationResult;
|
|
535
|
+
} catch (error) {
|
|
536
|
+
this.config.logger.error("Flow validation failed", {
|
|
537
|
+
flowId: validatedParams.flowId,
|
|
538
|
+
error
|
|
539
|
+
});
|
|
540
|
+
throw error;
|
|
541
|
+
}
|
|
542
|
+
}
|
|
543
|
+
/**
|
|
544
|
+
* Create flow version and sync trigger registrations (D3: sync on publish)
|
|
545
|
+
*/
|
|
546
|
+
async createFlowVersion(flowId, versionData) {
|
|
547
|
+
this.config.logger.debug("createFlowVersion called with arguments:", JSON.stringify({
|
|
548
|
+
flowId,
|
|
549
|
+
versionData
|
|
550
|
+
}, null, 2));
|
|
551
|
+
const validatedParams = FlowIdParamsSchema.parse({ flowId });
|
|
552
|
+
const data = createFlowVersionRequestSchema.parse(versionData);
|
|
553
|
+
const version = await this.flowVersionsService.createFlowVersion(validatedParams.flowId, data);
|
|
554
|
+
try {
|
|
555
|
+
if (data.invectDefinition?.nodes) {
|
|
556
|
+
await this.triggersService.syncTriggersForFlow(validatedParams.flowId, data.invectDefinition);
|
|
557
|
+
this.config.logger.debug("Trigger registrations synced after version creation", {
|
|
558
|
+
flowId: validatedParams.flowId,
|
|
559
|
+
versionNumber: version.version
|
|
560
|
+
});
|
|
561
|
+
}
|
|
562
|
+
} catch (error) {
|
|
563
|
+
this.config.logger.error("Failed to sync triggers after version creation", {
|
|
564
|
+
flowId: validatedParams.flowId,
|
|
565
|
+
error
|
|
566
|
+
});
|
|
567
|
+
}
|
|
568
|
+
return version;
|
|
569
|
+
}
|
|
570
|
+
/**
|
|
571
|
+
* Get flow versions with optional filtering, sorting, and pagination
|
|
572
|
+
*/
|
|
573
|
+
async listFlowVersions(flowId, options) {
|
|
574
|
+
this.config.logger.debug("listFlowVersions called with arguments:", JSON.stringify({
|
|
575
|
+
flowId,
|
|
576
|
+
options
|
|
577
|
+
}, null, 2));
|
|
578
|
+
const validatedParams = FlowIdParamsSchema.parse({ flowId });
|
|
579
|
+
return await this.flowVersionsService.listFlowVersionsByFlowId(validatedParams.flowId, options);
|
|
580
|
+
}
|
|
581
|
+
/**
|
|
582
|
+
* Get specific flow version by version number or 'latest'
|
|
583
|
+
*/
|
|
584
|
+
async getFlowVersion(flowId, version) {
|
|
585
|
+
this.config.logger.debug("getFlowVersion called with arguments:", JSON.stringify({
|
|
586
|
+
flowId,
|
|
587
|
+
version
|
|
588
|
+
}, null, 2));
|
|
589
|
+
const validatedParams = FlowIdParamsSchema.parse({ flowId });
|
|
590
|
+
return await this.flowVersionsService.getFlowVersion(validatedParams.flowId, version);
|
|
591
|
+
}
|
|
592
|
+
/**
|
|
593
|
+
* Execute a flow (synchronous - waits for completion)
|
|
594
|
+
*/
|
|
595
|
+
async startFlowRun(flowId, inputs = {}, options) {
|
|
596
|
+
this.config.logger.debug("startFlowRun called with arguments:", JSON.stringify({
|
|
597
|
+
flowId,
|
|
598
|
+
inputs,
|
|
599
|
+
options
|
|
600
|
+
}, null, 2));
|
|
601
|
+
return this.orchestrationService.executeFlow(flowId, inputs, options);
|
|
602
|
+
}
|
|
603
|
+
/**
|
|
604
|
+
* Start a flow execution asynchronously - returns immediately with flow run ID.
|
|
605
|
+
* The flow executes in the background. Use this for UI-initiated runs where
|
|
606
|
+
* you want to redirect the user immediately without waiting for completion.
|
|
607
|
+
*/
|
|
608
|
+
async startFlowRunAsync(flowId, inputs = {}, options) {
|
|
609
|
+
this.config.logger.debug("startFlowRunAsync called with arguments:", JSON.stringify({
|
|
610
|
+
flowId,
|
|
611
|
+
inputs,
|
|
612
|
+
options
|
|
613
|
+
}, null, 2));
|
|
614
|
+
return this.orchestrationService.executeFlowAsync(flowId, inputs, options);
|
|
615
|
+
}
|
|
616
|
+
/**
|
|
617
|
+
* Execute a flow up to a specific target node.
|
|
618
|
+
* Only executes the upstream nodes required to produce output for the target node.
|
|
619
|
+
* This is useful for testing a specific node with its real upstream dependencies.
|
|
620
|
+
*
|
|
621
|
+
* @param flowId - The flow to execute
|
|
622
|
+
* @param targetNodeId - The node to execute up to (this node will also be executed)
|
|
623
|
+
* @param inputs - Flow-level inputs
|
|
624
|
+
* @param options - Execution options (version, batch processing, etc.)
|
|
625
|
+
* @returns The flow run result with the target node's output
|
|
626
|
+
*/
|
|
627
|
+
async executeFlowToNode(flowId, targetNodeId, inputs = {}, options) {
|
|
628
|
+
this.config.logger.debug("executeFlowToNode called with arguments:", JSON.stringify({
|
|
629
|
+
flowId,
|
|
630
|
+
targetNodeId,
|
|
631
|
+
inputs,
|
|
632
|
+
options
|
|
633
|
+
}, null, 2));
|
|
634
|
+
return this.orchestrationService.executeFlowToNode(flowId, targetNodeId, inputs, options);
|
|
635
|
+
}
|
|
636
|
+
/**
|
|
637
|
+
* Resume execution
|
|
638
|
+
*/
|
|
639
|
+
async resumeExecution(executionId) {
|
|
640
|
+
this.config.logger.debug("resumeExecution called with arguments:", JSON.stringify({ executionId }, null, 2));
|
|
641
|
+
return this.flowRunsService.resumeRun(executionId);
|
|
642
|
+
}
|
|
643
|
+
/**
|
|
644
|
+
* Get all Flow Runs
|
|
645
|
+
*/
|
|
646
|
+
async listFlowRuns(options) {
|
|
647
|
+
this.config.logger.debug("listFlowRuns called with arguments:", JSON.stringify(options, null, 2));
|
|
648
|
+
return await this.flowRunsService.listRuns(options);
|
|
649
|
+
}
|
|
650
|
+
/**
|
|
651
|
+
* Get flow executions for a specific flow
|
|
652
|
+
*/
|
|
653
|
+
async listFlowRunsByFlowId(flowId) {
|
|
654
|
+
this.config.logger.debug("listFlowRunsByFlowId called with arguments:", JSON.stringify({ flowId }, null, 2));
|
|
655
|
+
const validatedParams = FlowIdParamsSchema.parse({ flowId });
|
|
656
|
+
return this.flowRunsService.listRuns({ filter: { flowId: [validatedParams.flowId] } });
|
|
657
|
+
}
|
|
658
|
+
/**
|
|
659
|
+
* Get a specific flow run by ID
|
|
660
|
+
*/
|
|
661
|
+
async getFlowRunById(flowRunId) {
|
|
662
|
+
this.config.logger.debug("getFlowRunById called with arguments:", JSON.stringify({ flowRunId }, null, 2));
|
|
663
|
+
return this.flowRunsService.getRunById(flowRunId);
|
|
664
|
+
}
|
|
665
|
+
/**
|
|
666
|
+
* Cancel a flow run
|
|
667
|
+
*/
|
|
668
|
+
async cancelFlowRun(flowRunId) {
|
|
669
|
+
this.config.logger.debug("cancelFlowRun called with arguments:", JSON.stringify({ flowRunId }, null, 2));
|
|
670
|
+
return this.flowRunsService.cancelRun(flowRunId);
|
|
671
|
+
}
|
|
672
|
+
/**
|
|
673
|
+
* Pause a flow run
|
|
674
|
+
*/
|
|
675
|
+
async pauseFlowRun(flowRunId, reason) {
|
|
676
|
+
this.config.logger.debug("pauseFlowRun called with arguments:", JSON.stringify({
|
|
677
|
+
flowRunId,
|
|
678
|
+
reason
|
|
679
|
+
}, null, 2));
|
|
680
|
+
return this.flowRunsService.pauseRun(flowRunId, reason);
|
|
681
|
+
}
|
|
682
|
+
/**
|
|
683
|
+
* Get dashboard statistics: flow counts, run counts by status, recent activity.
|
|
684
|
+
*/
|
|
685
|
+
async getDashboardStats() {
|
|
686
|
+
this.config.logger.debug("getDashboardStats called");
|
|
687
|
+
const [flowsResponse, runStats, recentRunsResponse] = await Promise.all([
|
|
688
|
+
this.flowService.listFlows({ pagination: {
|
|
689
|
+
page: 1,
|
|
690
|
+
limit: 1
|
|
691
|
+
} }),
|
|
692
|
+
this.flowRunsService.getStats(),
|
|
693
|
+
this.flowRunsService.listRuns({
|
|
694
|
+
pagination: {
|
|
695
|
+
page: 1,
|
|
696
|
+
limit: 10
|
|
697
|
+
},
|
|
698
|
+
sort: {
|
|
699
|
+
sortBy: "startedAt",
|
|
700
|
+
sortOrder: "desc"
|
|
701
|
+
}
|
|
702
|
+
})
|
|
703
|
+
]);
|
|
704
|
+
const totalRunsAll = Object.values(runStats.totalRuns).reduce((sum, c) => sum + c, 0);
|
|
705
|
+
const totalSuccess = runStats.totalRuns[FlowRunStatus.SUCCESS] ?? 0;
|
|
706
|
+
const successRate = totalRunsAll > 0 ? Math.round(totalSuccess / totalRunsAll * 100) : 0;
|
|
707
|
+
const activeCount = (runStats.totalRuns[FlowRunStatus.RUNNING] ?? 0) + (runStats.totalRuns[FlowRunStatus.PENDING] ?? 0) + (runStats.totalRuns[FlowRunStatus.PAUSED_FOR_BATCH] ?? 0);
|
|
708
|
+
const recentRunsAll = Object.values(runStats.recentRuns).reduce((sum, c) => sum + c, 0);
|
|
709
|
+
return {
|
|
710
|
+
totalFlows: flowsResponse.pagination.totalPages,
|
|
711
|
+
totalRuns: totalRunsAll,
|
|
712
|
+
runsLast24h: recentRunsAll,
|
|
713
|
+
activeRuns: activeCount,
|
|
714
|
+
successRate,
|
|
715
|
+
failedRunsLast24h: runStats.recentRuns[FlowRunStatus.FAILED] ?? 0,
|
|
716
|
+
runsByStatus: runStats.totalRuns,
|
|
717
|
+
recentRuns: recentRunsResponse.data
|
|
718
|
+
};
|
|
719
|
+
}
|
|
720
|
+
/**
|
|
721
|
+
* Create a credential
|
|
722
|
+
*/
|
|
723
|
+
async createCredential(input) {
|
|
724
|
+
this.config.logger.debug("createCredential called");
|
|
725
|
+
return this.credentialsService.create(input);
|
|
726
|
+
}
|
|
727
|
+
/**
|
|
728
|
+
* List credentials with optional filters
|
|
729
|
+
*/
|
|
730
|
+
async listCredentials(filters) {
|
|
731
|
+
this.config.logger.debug("listCredentials called", { filters });
|
|
732
|
+
return this.credentialsService.list(filters);
|
|
733
|
+
}
|
|
734
|
+
/**
|
|
735
|
+
* Retrieve a credential by id
|
|
736
|
+
*/
|
|
737
|
+
async getCredential(id) {
|
|
738
|
+
this.config.logger.debug("getCredential called", { id });
|
|
739
|
+
return this.credentialsService.get(id);
|
|
740
|
+
}
|
|
741
|
+
/**
|
|
742
|
+
* Update credential
|
|
743
|
+
*/
|
|
744
|
+
async updateCredential(id, input) {
|
|
745
|
+
this.config.logger.debug("updateCredential called", { id });
|
|
746
|
+
return this.credentialsService.update(id, input);
|
|
747
|
+
}
|
|
748
|
+
/**
|
|
749
|
+
* Delete credential
|
|
750
|
+
*/
|
|
751
|
+
async deleteCredential(id) {
|
|
752
|
+
this.config.logger.debug("deleteCredential called", { id });
|
|
753
|
+
return this.credentialsService.delete(id);
|
|
754
|
+
}
|
|
755
|
+
/**
|
|
756
|
+
* Test credential validity
|
|
757
|
+
*/
|
|
758
|
+
async testCredential(id) {
|
|
759
|
+
this.config.logger.debug("testCredential called", { id });
|
|
760
|
+
return this.credentialsService.test(id);
|
|
761
|
+
}
|
|
762
|
+
/**
|
|
763
|
+
* Update credential last used timestamp
|
|
764
|
+
*/
|
|
765
|
+
async updateCredentialLastUsed(id) {
|
|
766
|
+
this.config.logger.debug("updateCredentialLastUsed called", { id });
|
|
767
|
+
return this.credentialsService.updateLastUsed(id);
|
|
768
|
+
}
|
|
769
|
+
/**
|
|
770
|
+
* Get expiring credentials helper
|
|
771
|
+
*/
|
|
772
|
+
async getExpiringCredentials(daysUntilExpiry) {
|
|
773
|
+
this.config.logger.debug("getExpiringCredentials called", { daysUntilExpiry });
|
|
774
|
+
return this.credentialsService.getExpiringCredentials(daysUntilExpiry);
|
|
775
|
+
}
|
|
776
|
+
/**
|
|
777
|
+
* Get node executions by flow run ID
|
|
778
|
+
*/
|
|
779
|
+
async getNodeExecutionsByRunId(flowRunId) {
|
|
780
|
+
this.config.logger.debug("getNodeExecutionsByRunId called with arguments:", JSON.stringify({ flowRunId }, null, 2));
|
|
781
|
+
return this.nodeExecutionsService.listNodeExecutionsByFlowRunId(flowRunId);
|
|
782
|
+
}
|
|
783
|
+
/**
|
|
784
|
+
* Get all node executions with optional filtering, sorting, and pagination
|
|
785
|
+
*/
|
|
786
|
+
async listNodeExecutions(options) {
|
|
787
|
+
this.config.logger.debug("listNodeExecutions called with arguments:", JSON.stringify(options, null, 2));
|
|
788
|
+
return await this.nodeExecutionsService.listNodeExecutions(options);
|
|
789
|
+
}
|
|
790
|
+
/**
|
|
791
|
+
* Create an async iterable that yields execution events for a flow run.
|
|
792
|
+
*
|
|
793
|
+
* The first event is always a "snapshot" with the current FlowRun and all
|
|
794
|
+
* NodeExecutions. Subsequent events are incremental updates. The stream
|
|
795
|
+
* ends automatically when the flow run reaches a terminal status.
|
|
796
|
+
*
|
|
797
|
+
* Consumers (Express/NestJS/Next.js adapters) iterate this with
|
|
798
|
+
* `for await (const event of stream)` and write SSE frames.
|
|
799
|
+
*/
|
|
800
|
+
async *createFlowRunEventStream(flowRunId) {
|
|
801
|
+
const bus = this.serviceFactory?.getExecutionEventBus();
|
|
802
|
+
if (!bus) throw new Error("ServiceFactory not initialized");
|
|
803
|
+
const flowRun = await this.flowRunsService.getRunById(flowRunId);
|
|
804
|
+
yield {
|
|
805
|
+
type: "snapshot",
|
|
806
|
+
flowRun,
|
|
807
|
+
nodeExecutions: await this.nodeExecutionsService.listNodeExecutionsByFlowRunId(flowRunId)
|
|
808
|
+
};
|
|
809
|
+
const terminalStatuses = new Set([
|
|
810
|
+
FlowRunStatus.SUCCESS,
|
|
811
|
+
FlowRunStatus.FAILED,
|
|
812
|
+
FlowRunStatus.CANCELLED
|
|
813
|
+
]);
|
|
814
|
+
if (terminalStatuses.has(flowRun.status)) {
|
|
815
|
+
yield {
|
|
816
|
+
type: "end",
|
|
817
|
+
flowRun
|
|
818
|
+
};
|
|
819
|
+
return;
|
|
820
|
+
}
|
|
821
|
+
const queue = [];
|
|
822
|
+
let resolve = null;
|
|
823
|
+
let done = false;
|
|
824
|
+
const unsubscribe = bus.subscribe(flowRunId, (event) => {
|
|
825
|
+
queue.push(event);
|
|
826
|
+
if (event.type === "flow_run.updated" && terminalStatuses.has(event.flowRun.status)) {
|
|
827
|
+
queue.push({
|
|
828
|
+
type: "end",
|
|
829
|
+
flowRun: event.flowRun
|
|
830
|
+
});
|
|
831
|
+
done = true;
|
|
832
|
+
}
|
|
833
|
+
const wakeUp = resolve;
|
|
834
|
+
if (wakeUp) {
|
|
835
|
+
resolve = null;
|
|
836
|
+
wakeUp();
|
|
837
|
+
}
|
|
838
|
+
});
|
|
839
|
+
const heartbeatTimer = setInterval(() => {
|
|
840
|
+
queue.push({ type: "heartbeat" });
|
|
841
|
+
if (resolve) {
|
|
842
|
+
resolve();
|
|
843
|
+
resolve = null;
|
|
844
|
+
}
|
|
845
|
+
}, 15e3);
|
|
846
|
+
try {
|
|
847
|
+
while (!done) {
|
|
848
|
+
while (queue.length > 0) {
|
|
849
|
+
const event = queue.shift();
|
|
850
|
+
yield event;
|
|
851
|
+
if (event.type === "end") return;
|
|
852
|
+
}
|
|
853
|
+
await new Promise((r) => {
|
|
854
|
+
resolve = r;
|
|
855
|
+
});
|
|
856
|
+
}
|
|
857
|
+
} finally {
|
|
858
|
+
clearInterval(heartbeatTimer);
|
|
859
|
+
unsubscribe();
|
|
860
|
+
}
|
|
861
|
+
}
|
|
862
|
+
/**
|
|
863
|
+
* Start batch polling for automatic batch completion handling
|
|
864
|
+
*/
|
|
865
|
+
async startBatchPolling() {
|
|
866
|
+
await this.baseAIClient.startBatchPolling();
|
|
867
|
+
}
|
|
868
|
+
/**
|
|
869
|
+
* Stop batch polling
|
|
870
|
+
*/
|
|
871
|
+
async stopBatchPolling() {
|
|
872
|
+
await this.baseAIClient.stopBatchPolling();
|
|
873
|
+
}
|
|
874
|
+
/**
|
|
875
|
+
* Start the cron scheduler for automatic cron trigger execution.
|
|
876
|
+
* Call after initialize() — typically in your server startup code.
|
|
877
|
+
* If cronEnabled is false in InvectConfig.triggers, this is a no-op.
|
|
878
|
+
*/
|
|
879
|
+
async startCronScheduler() {
|
|
880
|
+
if (!(this.config.triggers?.cronEnabled ?? true)) {
|
|
881
|
+
this.config.logger.info("Cron scheduler disabled via config");
|
|
882
|
+
return;
|
|
883
|
+
}
|
|
884
|
+
this.config.logger.info("Starting cron scheduler");
|
|
885
|
+
const scheduler = this.serviceFactory?.getCronScheduler();
|
|
886
|
+
if (!scheduler) throw new Error("ServiceFactory not initialized");
|
|
887
|
+
await scheduler.start();
|
|
888
|
+
}
|
|
889
|
+
/**
|
|
890
|
+
* Stop the cron scheduler. Call during graceful shutdown.
|
|
891
|
+
*/
|
|
892
|
+
stopCronScheduler() {
|
|
893
|
+
this.config.logger.info("Stopping cron scheduler");
|
|
894
|
+
const scheduler = this.serviceFactory?.getCronScheduler();
|
|
895
|
+
if (!scheduler) throw new Error("ServiceFactory not initialized");
|
|
896
|
+
scheduler.stop();
|
|
897
|
+
}
|
|
898
|
+
/**
|
|
899
|
+
* Refresh cron jobs from the database (e.g. after trigger registrations change).
|
|
900
|
+
*/
|
|
901
|
+
async refreshCronScheduler() {
|
|
902
|
+
const scheduler = this.serviceFactory?.getCronScheduler();
|
|
903
|
+
if (!scheduler) throw new Error("ServiceFactory not initialized");
|
|
904
|
+
await scheduler.refresh();
|
|
905
|
+
}
|
|
906
|
+
/**
|
|
907
|
+
* Execute a SQL query for node testing purposes
|
|
908
|
+
*/
|
|
909
|
+
async executeSqlQuery(request) {
|
|
910
|
+
this.config.logger.debug("executeSqlQuery called with arguments:", JSON.stringify(request, null, 2));
|
|
911
|
+
return this.nodeDataService.runSqlQuery(request);
|
|
912
|
+
}
|
|
913
|
+
/**
|
|
914
|
+
* Test a JS expression in the QuickJS sandbox.
|
|
915
|
+
* Used by the frontend data mapper preview.
|
|
916
|
+
*/
|
|
917
|
+
async testJsExpression(request) {
|
|
918
|
+
this.ensureInitialized();
|
|
919
|
+
if (!this.jsExpressionService) return {
|
|
920
|
+
success: false,
|
|
921
|
+
error: "JS expression engine not initialized"
|
|
922
|
+
};
|
|
923
|
+
try {
|
|
924
|
+
return {
|
|
925
|
+
success: true,
|
|
926
|
+
result: this.jsExpressionService.evaluate(request.expression, request.context)
|
|
927
|
+
};
|
|
928
|
+
} catch (e) {
|
|
929
|
+
return {
|
|
930
|
+
success: false,
|
|
931
|
+
error: e instanceof Error ? e.message : String(e)
|
|
932
|
+
};
|
|
933
|
+
}
|
|
934
|
+
}
|
|
935
|
+
/**
|
|
936
|
+
* Test a mapper expression — returns the result plus metadata about how
|
|
937
|
+
* the node would behave (iterate vs single, item count).
|
|
938
|
+
* Used by the frontend Data Mapper pane live preview.
|
|
939
|
+
*/
|
|
940
|
+
async testMapper(request) {
|
|
941
|
+
this.ensureInitialized();
|
|
942
|
+
if (!this.jsExpressionService) return {
|
|
943
|
+
success: false,
|
|
944
|
+
error: "JS expression engine not initialized"
|
|
945
|
+
};
|
|
946
|
+
try {
|
|
947
|
+
const result = this.jsExpressionService.evaluate(request.expression, request.incomingData);
|
|
948
|
+
const mode = request.mode ?? "auto";
|
|
949
|
+
const isArray = Array.isArray(result);
|
|
950
|
+
let resultType;
|
|
951
|
+
if (isArray) resultType = "array";
|
|
952
|
+
else if (result !== null && typeof result === "object") resultType = "object";
|
|
953
|
+
else resultType = "primitive";
|
|
954
|
+
if (mode === "iterate" && !isArray) return {
|
|
955
|
+
success: false,
|
|
956
|
+
error: `Mode is "iterate" but expression returned ${resultType}, not an array`
|
|
957
|
+
};
|
|
958
|
+
return {
|
|
959
|
+
success: true,
|
|
960
|
+
result,
|
|
961
|
+
resultType,
|
|
962
|
+
itemCount: isArray ? result.length : void 0
|
|
963
|
+
};
|
|
964
|
+
} catch (e) {
|
|
965
|
+
return {
|
|
966
|
+
success: false,
|
|
967
|
+
error: e instanceof Error ? e.message : String(e)
|
|
968
|
+
};
|
|
969
|
+
}
|
|
970
|
+
}
|
|
971
|
+
/**
|
|
972
|
+
* Test a model prompt
|
|
973
|
+
*/
|
|
974
|
+
async testModelPrompt(request) {
|
|
975
|
+
this.config.logger.debug("testModelPrompt called with arguments:", JSON.stringify(request, null, 2));
|
|
976
|
+
if (request.credentialId) await this.ensureAdapterForCredential(request.credentialId, request.provider);
|
|
977
|
+
return this.baseAIClient.executePrompt(request);
|
|
978
|
+
}
|
|
979
|
+
/**
|
|
980
|
+
* Get available AI models
|
|
981
|
+
*/
|
|
982
|
+
async getAvailableModels() {
|
|
983
|
+
return this.nodeDataService.getAvailableModels();
|
|
984
|
+
}
|
|
985
|
+
/**
|
|
986
|
+
* Get models for a specific provider
|
|
987
|
+
*/
|
|
988
|
+
async getModelsForProvider(provider) {
|
|
989
|
+
if (!provider) throw new ValidationError("Provider is required to list models");
|
|
990
|
+
return {
|
|
991
|
+
provider,
|
|
992
|
+
...await this.nodeDataService.getModelsForProvider(provider)
|
|
993
|
+
};
|
|
994
|
+
}
|
|
995
|
+
/**
|
|
996
|
+
* Get models for a credential by detecting its provider
|
|
997
|
+
*/
|
|
998
|
+
async getModelsForCredential(credentialId) {
|
|
999
|
+
if (!credentialId) throw new ValidationError("credentialId is required to list models");
|
|
1000
|
+
const provider = detectProviderFromCredential(await this.credentialsService.get(credentialId));
|
|
1001
|
+
if (!provider) throw new ValidationError("Unable to detect provider from credential. Ensure the credential has an API URL or provider hint.");
|
|
1002
|
+
return {
|
|
1003
|
+
provider,
|
|
1004
|
+
...await this.nodeDataService.getModelsForProvider(provider)
|
|
1005
|
+
};
|
|
1006
|
+
}
|
|
1007
|
+
/**
|
|
1008
|
+
* Get available databases
|
|
1009
|
+
*/
|
|
1010
|
+
getAvailableDatabases() {
|
|
1011
|
+
return this.nodeDataService.getAvailableDatabases();
|
|
1012
|
+
}
|
|
1013
|
+
/**
|
|
1014
|
+
* Get definitions for all available nodes.
|
|
1015
|
+
* Returns both legacy node definitions and action-based node definitions.
|
|
1016
|
+
*/
|
|
1017
|
+
getAvailableNodes() {
|
|
1018
|
+
this.ensureInitialized();
|
|
1019
|
+
const actionDefs = this.actionRegistry ? this.actionRegistry.getAllNodeDefinitions() : [];
|
|
1020
|
+
const actionTypes = new Set(actionDefs.map((d) => d.type));
|
|
1021
|
+
const legacyDefs = this.nodeRegistry.getAllDefinitions().filter((d) => !actionTypes.has(d.type));
|
|
1022
|
+
const allDefs = [...actionDefs, ...legacyDefs];
|
|
1023
|
+
for (const def of allDefs) if (!def.provider) def.provider = {
|
|
1024
|
+
id: "core",
|
|
1025
|
+
name: "Invect Core",
|
|
1026
|
+
icon: "Blocks"
|
|
1027
|
+
};
|
|
1028
|
+
return allDefs;
|
|
1029
|
+
}
|
|
1030
|
+
/** Get the TemplateService or throw if not initialized. */
|
|
1031
|
+
getTemplateServiceOrThrow() {
|
|
1032
|
+
if (!this.templateService) throw new Error("TemplateService not available — JS expression engine failed to initialize");
|
|
1033
|
+
return this.templateService;
|
|
1034
|
+
}
|
|
1035
|
+
/**
|
|
1036
|
+
* Resolve {{ expression }} templates in params using the provided context.
|
|
1037
|
+
* Used for test node execution where we need to resolve templates before running.
|
|
1038
|
+
*
|
|
1039
|
+
* @param params - The node parameters to resolve
|
|
1040
|
+
* @param context - The context to use for template resolution
|
|
1041
|
+
* @param skipKeys - Keys to skip (their values should not be resolved as templates)
|
|
1042
|
+
*/
|
|
1043
|
+
resolveTemplateParams(params, context, skipKeys = []) {
|
|
1044
|
+
const templateService = this.getTemplateServiceOrThrow();
|
|
1045
|
+
const resolved = {};
|
|
1046
|
+
for (const [key, value] of Object.entries(params)) {
|
|
1047
|
+
if (skipKeys.includes(key)) {
|
|
1048
|
+
resolved[key] = value;
|
|
1049
|
+
continue;
|
|
1050
|
+
}
|
|
1051
|
+
if (typeof value === "string" && templateService.isTemplate(value)) try {
|
|
1052
|
+
const renderedValue = templateService.render(value, context);
|
|
1053
|
+
resolved[key] = renderedValue;
|
|
1054
|
+
this.config.logger.debug("Resolved template param for test", {
|
|
1055
|
+
param: key,
|
|
1056
|
+
template: value,
|
|
1057
|
+
resolved: renderedValue
|
|
1058
|
+
});
|
|
1059
|
+
} catch (error) {
|
|
1060
|
+
this.config.logger.warn("Failed to resolve template param for test", {
|
|
1061
|
+
param: key,
|
|
1062
|
+
template: value,
|
|
1063
|
+
error: error instanceof Error ? error.message : String(error)
|
|
1064
|
+
});
|
|
1065
|
+
resolved[key] = value;
|
|
1066
|
+
}
|
|
1067
|
+
else resolved[key] = value;
|
|
1068
|
+
}
|
|
1069
|
+
return resolved;
|
|
1070
|
+
}
|
|
1071
|
+
/**
|
|
1072
|
+
* Test/execute a single node with the provided params and input data.
|
|
1073
|
+
* This is useful for testing node configuration in isolation.
|
|
1074
|
+
*
|
|
1075
|
+
* Templates in params (e.g., {{ some_input.data.variables.output.value }})
|
|
1076
|
+
* are resolved using the inputData as context before execution.
|
|
1077
|
+
*
|
|
1078
|
+
* @param nodeType - The type of node to execute
|
|
1079
|
+
* @param params - The node's configuration parameters (may contain {{ }} templates)
|
|
1080
|
+
* @param inputData - Mock input data used both as node inputs and as template context
|
|
1081
|
+
* @returns The node execution result
|
|
1082
|
+
*/
|
|
1083
|
+
async testNode(nodeType, params, inputData = {}) {
|
|
1084
|
+
this.ensureInitialized();
|
|
1085
|
+
const executor = this.nodeRegistry.get(nodeType);
|
|
1086
|
+
const action = !executor && this.actionRegistry ? this.actionRegistry.get(nodeType) : void 0;
|
|
1087
|
+
if (!executor && !action) throw new ValidationError(`Unknown node type: ${nodeType}`);
|
|
1088
|
+
let defaultParams = {};
|
|
1089
|
+
if (executor) defaultParams = executor.getDefinition().defaultParams ?? {};
|
|
1090
|
+
else if (action) defaultParams = Object.fromEntries((action.params.fields ?? []).filter((f) => f.defaultValue !== void 0).map((f) => [f.name, f.defaultValue]));
|
|
1091
|
+
const mergedParams = {
|
|
1092
|
+
...defaultParams,
|
|
1093
|
+
...params
|
|
1094
|
+
};
|
|
1095
|
+
const skipTemplateResolutionKeys = [];
|
|
1096
|
+
if (nodeType === GraphNodeType.TEMPLATE_STRING || nodeType === "core.template_string") skipTemplateResolutionKeys.push("template");
|
|
1097
|
+
const resolvedParams = this.resolveTemplateParams(mergedParams, inputData, skipTemplateResolutionKeys);
|
|
1098
|
+
this.config.logger.debug("Test node with resolved params", {
|
|
1099
|
+
nodeType,
|
|
1100
|
+
defaultParams,
|
|
1101
|
+
originalParams: params,
|
|
1102
|
+
mergedParams,
|
|
1103
|
+
resolvedParams,
|
|
1104
|
+
inputDataKeys: Object.keys(inputData)
|
|
1105
|
+
});
|
|
1106
|
+
try {
|
|
1107
|
+
if (action) {
|
|
1108
|
+
const { executeActionAsNode } = await import("./actions/action-executor.js");
|
|
1109
|
+
const result = await executeActionAsNode(action, resolvedParams, {
|
|
1110
|
+
nodeId: `test-${Date.now()}`,
|
|
1111
|
+
flowRunId: `test-run-${Date.now()}`,
|
|
1112
|
+
logger: this.config.logger,
|
|
1113
|
+
globalConfig: {},
|
|
1114
|
+
flowInputs: {},
|
|
1115
|
+
flowParams: { useBatchProcessing: false },
|
|
1116
|
+
incomingData: inputData,
|
|
1117
|
+
functions: {
|
|
1118
|
+
markDownstreamNodesAsSkipped: () => {},
|
|
1119
|
+
runTemplateReplacement: (template, variables) => this.nodeDataService.runTemplateReplacement(template, variables),
|
|
1120
|
+
submitPrompt: async (request) => this.baseAIClient.executePrompt(request),
|
|
1121
|
+
getCredential: async (credentialId) => this.credentialsService.get(credentialId)
|
|
1122
|
+
},
|
|
1123
|
+
allNodeOutputs: /* @__PURE__ */ new Map()
|
|
1124
|
+
});
|
|
1125
|
+
if (result.state === NodeExecutionStatus.SUCCESS) {
|
|
1126
|
+
let output;
|
|
1127
|
+
if (result.output?.data?.variables) output = Object.fromEntries(Object.entries(result.output.data.variables).map(([k, v]) => [k, v.value]));
|
|
1128
|
+
else if (result.output) output = result.output;
|
|
1129
|
+
return {
|
|
1130
|
+
success: true,
|
|
1131
|
+
output
|
|
1132
|
+
};
|
|
1133
|
+
} else if (result.state === NodeExecutionStatus.FAILED) return {
|
|
1134
|
+
success: false,
|
|
1135
|
+
error: result.errors?.join(", ") || "Node execution failed"
|
|
1136
|
+
};
|
|
1137
|
+
else return {
|
|
1138
|
+
success: true,
|
|
1139
|
+
output: { status: "pending" }
|
|
1140
|
+
};
|
|
1141
|
+
}
|
|
1142
|
+
const mockNode = {
|
|
1143
|
+
id: `test-${Date.now()}`,
|
|
1144
|
+
type: nodeType,
|
|
1145
|
+
params: resolvedParams,
|
|
1146
|
+
position: {
|
|
1147
|
+
x: 0,
|
|
1148
|
+
y: 0
|
|
1149
|
+
}
|
|
1150
|
+
};
|
|
1151
|
+
const context = {
|
|
1152
|
+
nodeId: mockNode.id,
|
|
1153
|
+
flowRunId: `test-run-${Date.now()}`,
|
|
1154
|
+
logger: this.config.logger,
|
|
1155
|
+
globalConfig: {},
|
|
1156
|
+
flowInputs: {},
|
|
1157
|
+
flowParams: { useBatchProcessing: false },
|
|
1158
|
+
incomingData: inputData,
|
|
1159
|
+
functions: {
|
|
1160
|
+
markDownstreamNodesAsSkipped: () => {},
|
|
1161
|
+
testJsonLogic: (conditionLogic, evaluationData) => {
|
|
1162
|
+
return this.nodeDataService.testJsonLogic(conditionLogic, evaluationData);
|
|
1163
|
+
},
|
|
1164
|
+
runSqlQuery: (request) => {
|
|
1165
|
+
return this.nodeDataService.runSqlQuery(request);
|
|
1166
|
+
},
|
|
1167
|
+
runTemplateReplacement: (template, variables) => {
|
|
1168
|
+
return this.nodeDataService.runTemplateReplacement(template, variables);
|
|
1169
|
+
},
|
|
1170
|
+
submitPrompt: async (request) => {
|
|
1171
|
+
this.config.logger.debug("Test node submitting prompt", { request });
|
|
1172
|
+
return this.baseAIClient.executePrompt(request);
|
|
1173
|
+
},
|
|
1174
|
+
getCredential: async (credentialId) => {
|
|
1175
|
+
return this.credentialsService.get(credentialId);
|
|
1176
|
+
}
|
|
1177
|
+
},
|
|
1178
|
+
allNodeOutputs: /* @__PURE__ */ new Map()
|
|
1179
|
+
};
|
|
1180
|
+
const effectiveInputs = { ...inputData };
|
|
1181
|
+
const result = await executor.execute(effectiveInputs, mockNode, context);
|
|
1182
|
+
if (result.state === NodeExecutionStatus.SUCCESS) {
|
|
1183
|
+
let output;
|
|
1184
|
+
if (result.output?.data?.variables) output = Object.fromEntries(Object.entries(result.output.data.variables).map(([k, v]) => [k, v.value]));
|
|
1185
|
+
else if (result.output) output = result.output;
|
|
1186
|
+
return {
|
|
1187
|
+
success: true,
|
|
1188
|
+
output
|
|
1189
|
+
};
|
|
1190
|
+
} else if (result.state === NodeExecutionStatus.FAILED) return {
|
|
1191
|
+
success: false,
|
|
1192
|
+
error: result.errors?.join(", ") || "Node execution failed"
|
|
1193
|
+
};
|
|
1194
|
+
else return {
|
|
1195
|
+
success: true,
|
|
1196
|
+
output: { status: "pending" }
|
|
1197
|
+
};
|
|
1198
|
+
} catch (error) {
|
|
1199
|
+
this.config.logger.error("Test node execution failed", {
|
|
1200
|
+
error,
|
|
1201
|
+
nodeType
|
|
1202
|
+
});
|
|
1203
|
+
return {
|
|
1204
|
+
success: false,
|
|
1205
|
+
error: error instanceof Error ? error.message : String(error)
|
|
1206
|
+
};
|
|
1207
|
+
}
|
|
1208
|
+
}
|
|
1209
|
+
/**
|
|
1210
|
+
* Handle node configuration update events coming from the frontend.
|
|
1211
|
+
* Supports both legacy executors (AGENT) and action-based nodes.
|
|
1212
|
+
*/
|
|
1213
|
+
async handleNodeConfigUpdate(event) {
|
|
1214
|
+
this.ensureInitialized();
|
|
1215
|
+
if (!event?.nodeType) throw new ValidationError("nodeType is required for node config updates");
|
|
1216
|
+
if (!event.params || typeof event.params !== "object") event.params = {};
|
|
1217
|
+
const configContext = {
|
|
1218
|
+
logger: this.config.logger,
|
|
1219
|
+
services: {
|
|
1220
|
+
credentials: this.credentialsService,
|
|
1221
|
+
baseAIClient: this.baseAIClient
|
|
1222
|
+
}
|
|
1223
|
+
};
|
|
1224
|
+
const executor = this.nodeRegistry.get(event.nodeType);
|
|
1225
|
+
if (executor) try {
|
|
1226
|
+
return await executor.handleConfigUpdate(event, configContext);
|
|
1227
|
+
} catch (error) {
|
|
1228
|
+
this.config.logger.error("Node config update handler failed", {
|
|
1229
|
+
error,
|
|
1230
|
+
nodeType: event.nodeType,
|
|
1231
|
+
nodeId: event.nodeId
|
|
1232
|
+
});
|
|
1233
|
+
throw error;
|
|
1234
|
+
}
|
|
1235
|
+
const nodeTypeStr = event.nodeType;
|
|
1236
|
+
const action = this.actionRegistry?.get(nodeTypeStr);
|
|
1237
|
+
if (action) {
|
|
1238
|
+
if (action.onConfigUpdate) try {
|
|
1239
|
+
return await action.onConfigUpdate({
|
|
1240
|
+
...event,
|
|
1241
|
+
nodeType: nodeTypeStr
|
|
1242
|
+
}, configContext);
|
|
1243
|
+
} catch (error) {
|
|
1244
|
+
this.config.logger.error("Action config update handler failed", {
|
|
1245
|
+
error,
|
|
1246
|
+
nodeType: nodeTypeStr,
|
|
1247
|
+
nodeId: event.nodeId
|
|
1248
|
+
});
|
|
1249
|
+
throw error;
|
|
1250
|
+
}
|
|
1251
|
+
const definition = this.actionRegistry.toNodeDefinition(nodeTypeStr);
|
|
1252
|
+
if (definition) return {
|
|
1253
|
+
definition,
|
|
1254
|
+
params: event.params
|
|
1255
|
+
};
|
|
1256
|
+
}
|
|
1257
|
+
throw new ValidationError(`Unknown node type '${event.nodeType}' for config update`);
|
|
1258
|
+
}
|
|
1259
|
+
/**
|
|
1260
|
+
* Resolve dynamic options for a specific field on an action.
|
|
1261
|
+
*
|
|
1262
|
+
* Called by: `GET /actions/:actionId/fields/:fieldName/options?deps={...}`
|
|
1263
|
+
*
|
|
1264
|
+
* The action's `ParamField.loadOptions.handler` is invoked server-side with
|
|
1265
|
+
* the dependency values and returns an options list + optional default value.
|
|
1266
|
+
*/
|
|
1267
|
+
async resolveFieldOptions(actionId, fieldName, dependencyValues) {
|
|
1268
|
+
this.ensureInitialized();
|
|
1269
|
+
if (!this.actionRegistry) throw new ValidationError("Action registry not initialised");
|
|
1270
|
+
const context = {
|
|
1271
|
+
logger: this.config.logger,
|
|
1272
|
+
services: { credentials: this.credentialsService }
|
|
1273
|
+
};
|
|
1274
|
+
return this.actionRegistry.resolveFieldOptions(actionId, fieldName, dependencyValues, context);
|
|
1275
|
+
}
|
|
1276
|
+
/**
|
|
1277
|
+
* Render flow to React Flow format
|
|
1278
|
+
*/
|
|
1279
|
+
async renderToReactFlow(flowId, options) {
|
|
1280
|
+
this.config.logger.debug("renderToReactFlow called with arguments:", JSON.stringify({
|
|
1281
|
+
flowId,
|
|
1282
|
+
options
|
|
1283
|
+
}, null, 2));
|
|
1284
|
+
return this.reactFlowRendererService.renderToReactFlow(flowId, options);
|
|
1285
|
+
}
|
|
1286
|
+
/**
|
|
1287
|
+
* Get flow service with initialization check
|
|
1288
|
+
*/
|
|
1289
|
+
get flowService() {
|
|
1290
|
+
this.ensureInitialized();
|
|
1291
|
+
return this.serviceFactory.getFlowService();
|
|
1292
|
+
}
|
|
1293
|
+
/**
|
|
1294
|
+
* Get flow versions service with initialization check
|
|
1295
|
+
*/
|
|
1296
|
+
get flowVersionsService() {
|
|
1297
|
+
this.ensureInitialized();
|
|
1298
|
+
return this.serviceFactory.getFlowVersionsService();
|
|
1299
|
+
}
|
|
1300
|
+
/**
|
|
1301
|
+
* Get flow runs service with initialization check
|
|
1302
|
+
*/
|
|
1303
|
+
get flowRunsService() {
|
|
1304
|
+
this.ensureInitialized();
|
|
1305
|
+
return this.serviceFactory.getFlowRunsService();
|
|
1306
|
+
}
|
|
1307
|
+
/**
|
|
1308
|
+
* Get orchestration service with initialization check
|
|
1309
|
+
*/
|
|
1310
|
+
get orchestrationService() {
|
|
1311
|
+
this.ensureInitialized();
|
|
1312
|
+
return this.serviceFactory.getOrchestrationService();
|
|
1313
|
+
}
|
|
1314
|
+
/**
|
|
1315
|
+
* Get node executions service with initialization check
|
|
1316
|
+
*/
|
|
1317
|
+
get nodeExecutionsService() {
|
|
1318
|
+
this.ensureInitialized();
|
|
1319
|
+
return this.serviceFactory.getNodeExecutionsService();
|
|
1320
|
+
}
|
|
1321
|
+
/**
|
|
1322
|
+
* Get node data service with initialization check
|
|
1323
|
+
*/
|
|
1324
|
+
get nodeDataService() {
|
|
1325
|
+
this.ensureInitialized();
|
|
1326
|
+
return this.serviceFactory.getNodeDataService();
|
|
1327
|
+
}
|
|
1328
|
+
/**
|
|
1329
|
+
* Get base AI client with initialization check
|
|
1330
|
+
*/
|
|
1331
|
+
get baseAIClient() {
|
|
1332
|
+
this.ensureInitialized();
|
|
1333
|
+
return this.serviceFactory.getBaseAIClient();
|
|
1334
|
+
}
|
|
1335
|
+
/**
|
|
1336
|
+
* Ensure a provider adapter is registered for the given credential.
|
|
1337
|
+
* Resolves the credential, extracts the API key, detects the provider,
|
|
1338
|
+
* and calls registerAdapter() if not already present.
|
|
1339
|
+
*/
|
|
1340
|
+
async ensureAdapterForCredential(credentialId, providerHint) {
|
|
1341
|
+
const client = this.baseAIClient;
|
|
1342
|
+
if (providerHint && client.hasAdapter(providerHint)) return;
|
|
1343
|
+
const credential = await this.credentialsService.getDecryptedWithRefresh(credentialId);
|
|
1344
|
+
const apiKey = credential.config?.apiKey;
|
|
1345
|
+
if (!apiKey) throw new Error(`Credential "${credentialId}" does not contain an apiKey.`);
|
|
1346
|
+
const detected = detectProviderFromCredential(credential);
|
|
1347
|
+
if (!detected) throw new Error(`Unable to detect AI provider from credential "${credentialId}".`);
|
|
1348
|
+
if (client.hasAdapter(detected)) return;
|
|
1349
|
+
const label = detected === BatchProvider.OPENAI ? "OPENAI" : detected === BatchProvider.ANTHROPIC ? "ANTHROPIC" : "OPENROUTER";
|
|
1350
|
+
client.registerAdapter(label, apiKey);
|
|
1351
|
+
}
|
|
1352
|
+
/**
|
|
1353
|
+
* Get React Flow renderer service with initialization check
|
|
1354
|
+
*/
|
|
1355
|
+
get reactFlowRendererService() {
|
|
1356
|
+
this.ensureInitialized();
|
|
1357
|
+
return this.serviceFactory.getReactFlowRendererService();
|
|
1358
|
+
}
|
|
1359
|
+
/**
|
|
1360
|
+
* Get credentials service with initialization check
|
|
1361
|
+
*/
|
|
1362
|
+
get credentialsService() {
|
|
1363
|
+
this.ensureInitialized();
|
|
1364
|
+
return this.serviceFactory.getCredentialsService();
|
|
1365
|
+
}
|
|
1366
|
+
/**
|
|
1367
|
+
* Get triggers service with initialization check
|
|
1368
|
+
*/
|
|
1369
|
+
get triggersService() {
|
|
1370
|
+
this.ensureInitialized();
|
|
1371
|
+
return this.serviceFactory.getTriggersService();
|
|
1372
|
+
}
|
|
1373
|
+
/**
|
|
1374
|
+
* Get credentials service (public accessor)
|
|
1375
|
+
*/
|
|
1376
|
+
getCredentialsService() {
|
|
1377
|
+
return this.credentialsService;
|
|
1378
|
+
}
|
|
1379
|
+
/**
|
|
1380
|
+
* Ensure default credentials exist.
|
|
1381
|
+
* Runs once after initialization completes — skips any that already exist by name.
|
|
1382
|
+
*/
|
|
1383
|
+
async ensureDefaultCredentials() {
|
|
1384
|
+
const seeds = this.config.defaultCredentials;
|
|
1385
|
+
if (!seeds?.length) return;
|
|
1386
|
+
const existing = await this.listCredentials();
|
|
1387
|
+
const existingNames = new Set(existing.map((c) => c.name));
|
|
1388
|
+
for (const seed of seeds) {
|
|
1389
|
+
if (existingNames.has(seed.name)) {
|
|
1390
|
+
this.config.logger.debug(`Seed credential "${seed.name}" already exists — skipping`);
|
|
1391
|
+
continue;
|
|
1392
|
+
}
|
|
1393
|
+
try {
|
|
1394
|
+
const created = await this.createCredential(seed);
|
|
1395
|
+
console.log(`🔐 Seeded credential: ${created.name} (${created.id})`);
|
|
1396
|
+
} catch (error) {
|
|
1397
|
+
this.config.logger.warn(`Failed to seed credential "${seed.name}"`, error);
|
|
1398
|
+
}
|
|
1399
|
+
}
|
|
1400
|
+
}
|
|
1401
|
+
/**
|
|
1402
|
+
* Initialize services
|
|
1403
|
+
*/
|
|
1404
|
+
async initializeServices(nodeRegistry) {
|
|
1405
|
+
this.config.logger.debug("Initializing service factory...");
|
|
1406
|
+
this.serviceFactory = new ServiceFactory(this.config, nodeRegistry, this, this.actionRegistry, this.pluginManager, this.jsExpressionService ?? void 0, this.templateService ?? void 0);
|
|
1407
|
+
await this.serviceFactory.initialize();
|
|
1408
|
+
}
|
|
1409
|
+
/**
|
|
1410
|
+
* Initialize node registry with tool registry
|
|
1411
|
+
*/
|
|
1412
|
+
async initializeNodes() {
|
|
1413
|
+
this.config.logger.debug("Initializing node registry...");
|
|
1414
|
+
const nodeRegistry = await DefaultNodeRegistryFactory.createDefault(this.config.logger);
|
|
1415
|
+
const toolRegistry = await initializeGlobalToolRegistry(this.config.logger);
|
|
1416
|
+
this.config.logger.debug(`Initialized agent tool registry with ${toolRegistry.size} tools`);
|
|
1417
|
+
const agentExecutor = nodeRegistry.get(GraphNodeType.AGENT);
|
|
1418
|
+
if (agentExecutor && "setToolRegistry" in agentExecutor) agentExecutor.setToolRegistry(toolRegistry);
|
|
1419
|
+
return nodeRegistry;
|
|
1420
|
+
}
|
|
1421
|
+
/**
|
|
1422
|
+
* Register all actions in the ActionRegistry as agent tools.
|
|
1423
|
+
*/
|
|
1424
|
+
registerActionsAsTools() {
|
|
1425
|
+
if (!this.actionRegistry) return;
|
|
1426
|
+
let toolRegistry;
|
|
1427
|
+
try {
|
|
1428
|
+
toolRegistry = getGlobalToolRegistry();
|
|
1429
|
+
} catch {
|
|
1430
|
+
return;
|
|
1431
|
+
}
|
|
1432
|
+
for (const action of this.actionRegistry.getAll()) {
|
|
1433
|
+
const toolDef = this.actionRegistry.toAgentToolDefinition(action.id);
|
|
1434
|
+
if (toolDef && !toolRegistry.has(toolDef.id)) toolRegistry.register(toolDef, createToolExecutorForAction(action));
|
|
1435
|
+
}
|
|
1436
|
+
}
|
|
1437
|
+
/**
|
|
1438
|
+
* Ensure core is initialized
|
|
1439
|
+
*/
|
|
1440
|
+
ensureInitialized() {
|
|
1441
|
+
if (!this.initialized || !this.serviceFactory || !this.nodeRegistry) throw new DatabaseError("Invect Core not initialized. Call initialize() first.");
|
|
1442
|
+
}
|
|
1443
|
+
/**
|
|
1444
|
+
* Get the action registry.
|
|
1445
|
+
*/
|
|
1446
|
+
getActionRegistry() {
|
|
1447
|
+
this.ensureInitialized();
|
|
1448
|
+
if (!this.actionRegistry) throw new DatabaseError("Action registry not initialized");
|
|
1449
|
+
return this.actionRegistry;
|
|
1450
|
+
}
|
|
1451
|
+
/**
|
|
1452
|
+
* Register an action at runtime (e.g. from a plugin or external package).
|
|
1453
|
+
*/
|
|
1454
|
+
registerAction(action) {
|
|
1455
|
+
this.ensureInitialized();
|
|
1456
|
+
if (!this.actionRegistry) throw new DatabaseError("Action registry not initialized");
|
|
1457
|
+
this.actionRegistry.register(action);
|
|
1458
|
+
const toolDef = this.actionRegistry.toAgentToolDefinition(action.id);
|
|
1459
|
+
if (toolDef) getGlobalToolRegistry().register(toolDef, createToolExecutorForAction(action));
|
|
1460
|
+
}
|
|
1461
|
+
/**
|
|
1462
|
+
* Get all registered providers.
|
|
1463
|
+
*/
|
|
1464
|
+
getProviders() {
|
|
1465
|
+
this.ensureInitialized();
|
|
1466
|
+
if (!this.actionRegistry) return [];
|
|
1467
|
+
return this.actionRegistry.getProviders();
|
|
1468
|
+
}
|
|
1469
|
+
/**
|
|
1470
|
+
* Get all actions for a specific provider.
|
|
1471
|
+
*/
|
|
1472
|
+
getActionsForProvider(providerId) {
|
|
1473
|
+
this.ensureInitialized();
|
|
1474
|
+
if (!this.actionRegistry) return [];
|
|
1475
|
+
return this.actionRegistry.getActionsForProvider(providerId);
|
|
1476
|
+
}
|
|
1477
|
+
/**
|
|
1478
|
+
* Get all available agent tools
|
|
1479
|
+
*/
|
|
1480
|
+
getAgentTools() {
|
|
1481
|
+
this.ensureInitialized();
|
|
1482
|
+
return getGlobalToolRegistry().getDefinitions();
|
|
1483
|
+
}
|
|
1484
|
+
/**
|
|
1485
|
+
* Execute agent prompt with tools
|
|
1486
|
+
*/
|
|
1487
|
+
async submitAgentPrompt(request) {
|
|
1488
|
+
this.ensureInitialized();
|
|
1489
|
+
await this.ensureAdapterForCredential(request.credentialId, request.provider);
|
|
1490
|
+
return await this.baseAIClient.runAgentPrompt(request, request.provider);
|
|
1491
|
+
}
|
|
1492
|
+
/**
|
|
1493
|
+
* Create a streaming chat session.
|
|
1494
|
+
*
|
|
1495
|
+
* Returns an AsyncGenerator<ChatStreamEvent> that framework adapters
|
|
1496
|
+
* serialize to SSE. The generator handles the full LLM loop including
|
|
1497
|
+
* tool calls.
|
|
1498
|
+
*
|
|
1499
|
+
* @example
|
|
1500
|
+
* ```typescript
|
|
1501
|
+
* const stream = await invect.createChatStream({
|
|
1502
|
+
* messages: [{ role: 'user', content: 'Add a Gmail node' }],
|
|
1503
|
+
* context: { flowId: 'flow_123' },
|
|
1504
|
+
* });
|
|
1505
|
+
*
|
|
1506
|
+
* for await (const event of stream) {
|
|
1507
|
+
* // event.type: 'text_delta' | 'tool_call_start' | 'tool_call_result' | 'done' | 'error'
|
|
1508
|
+
* }
|
|
1509
|
+
* ```
|
|
1510
|
+
*/
|
|
1511
|
+
async createChatStream(options) {
|
|
1512
|
+
this.ensureInitialized();
|
|
1513
|
+
return this.serviceFactory.getChatStreamService().createStream({
|
|
1514
|
+
messages: options.messages,
|
|
1515
|
+
context: options.context,
|
|
1516
|
+
identity: options.identity
|
|
1517
|
+
});
|
|
1518
|
+
}
|
|
1519
|
+
/**
|
|
1520
|
+
* Check if the chat assistant feature is enabled and configured.
|
|
1521
|
+
*/
|
|
1522
|
+
isChatEnabled() {
|
|
1523
|
+
this.ensureInitialized();
|
|
1524
|
+
return this.serviceFactory.getChatStreamService().isEnabled();
|
|
1525
|
+
}
|
|
1526
|
+
/**
|
|
1527
|
+
* Get all persisted chat messages for a flow (ordered by creation time).
|
|
1528
|
+
*/
|
|
1529
|
+
async getChatMessages(flowId) {
|
|
1530
|
+
this.ensureInitialized();
|
|
1531
|
+
return this.serviceFactory.getDatabaseService().chatMessages.getByFlowId(flowId);
|
|
1532
|
+
}
|
|
1533
|
+
/**
|
|
1534
|
+
* Save chat messages for a flow (replaces existing messages).
|
|
1535
|
+
*/
|
|
1536
|
+
async saveChatMessages(flowId, messages) {
|
|
1537
|
+
this.ensureInitialized();
|
|
1538
|
+
const db = this.serviceFactory.getDatabaseService();
|
|
1539
|
+
await db.chatMessages.deleteByFlowId(flowId);
|
|
1540
|
+
return db.chatMessages.createMany(messages.map((m) => ({
|
|
1541
|
+
flowId,
|
|
1542
|
+
role: m.role,
|
|
1543
|
+
content: m.content,
|
|
1544
|
+
toolMeta: m.toolMeta
|
|
1545
|
+
})));
|
|
1546
|
+
}
|
|
1547
|
+
/**
|
|
1548
|
+
* Delete all chat messages for a flow.
|
|
1549
|
+
*/
|
|
1550
|
+
async deleteChatMessages(flowId) {
|
|
1551
|
+
this.ensureInitialized();
|
|
1552
|
+
await this.serviceFactory.getDatabaseService().chatMessages.deleteByFlowId(flowId);
|
|
1553
|
+
}
|
|
1554
|
+
/**
|
|
1555
|
+
* List all trigger registrations for a flow.
|
|
1556
|
+
*/
|
|
1557
|
+
async listTriggersForFlow(flowId) {
|
|
1558
|
+
this.config.logger.debug("listTriggersForFlow called", { flowId });
|
|
1559
|
+
return this.triggersService.listTriggersForFlow(flowId);
|
|
1560
|
+
}
|
|
1561
|
+
/**
|
|
1562
|
+
* Get a single trigger registration by ID.
|
|
1563
|
+
*/
|
|
1564
|
+
async getTrigger(triggerId) {
|
|
1565
|
+
this.config.logger.debug("getTrigger called", { triggerId });
|
|
1566
|
+
return this.triggersService.getTrigger(triggerId);
|
|
1567
|
+
}
|
|
1568
|
+
/**
|
|
1569
|
+
* Create a trigger registration.
|
|
1570
|
+
*/
|
|
1571
|
+
async createTrigger(input) {
|
|
1572
|
+
this.config.logger.debug("createTrigger called", {
|
|
1573
|
+
flowId: input.flowId,
|
|
1574
|
+
type: input.type
|
|
1575
|
+
});
|
|
1576
|
+
return this.triggersService.createTrigger(input);
|
|
1577
|
+
}
|
|
1578
|
+
/**
|
|
1579
|
+
* Update a trigger registration.
|
|
1580
|
+
*/
|
|
1581
|
+
async updateTrigger(triggerId, input) {
|
|
1582
|
+
this.config.logger.debug("updateTrigger called", { triggerId });
|
|
1583
|
+
return this.triggersService.updateTrigger(triggerId, input);
|
|
1584
|
+
}
|
|
1585
|
+
/**
|
|
1586
|
+
* Delete a trigger registration.
|
|
1587
|
+
*/
|
|
1588
|
+
async deleteTrigger(triggerId) {
|
|
1589
|
+
this.config.logger.debug("deleteTrigger called", { triggerId });
|
|
1590
|
+
return this.triggersService.deleteTrigger(triggerId);
|
|
1591
|
+
}
|
|
1592
|
+
/**
|
|
1593
|
+
* Sync trigger registrations for a flow from its definition.
|
|
1594
|
+
* Call this after publishing a new flow version. Also refreshes
|
|
1595
|
+
* the cron scheduler if any cron triggers were changed.
|
|
1596
|
+
*/
|
|
1597
|
+
async syncTriggersForFlow(flowId, definition) {
|
|
1598
|
+
this.config.logger.debug("syncTriggersForFlow called", { flowId });
|
|
1599
|
+
const result = await this.triggersService.syncTriggersForFlow(flowId, definition);
|
|
1600
|
+
try {
|
|
1601
|
+
const scheduler = this.serviceFactory?.getCronScheduler();
|
|
1602
|
+
if (scheduler?.isRunning()) await scheduler.refresh();
|
|
1603
|
+
} catch {}
|
|
1604
|
+
return result;
|
|
1605
|
+
}
|
|
1606
|
+
/**
|
|
1607
|
+
* Get all enabled cron triggers (for scheduler initialization).
|
|
1608
|
+
*/
|
|
1609
|
+
async getEnabledCronTriggers() {
|
|
1610
|
+
this.config.logger.debug("getEnabledCronTriggers called");
|
|
1611
|
+
return this.triggersService.getEnabledCronTriggers();
|
|
1612
|
+
}
|
|
1613
|
+
/**
|
|
1614
|
+
* Execute a cron trigger (called by the cron scheduler).
|
|
1615
|
+
*/
|
|
1616
|
+
async executeCronTrigger(triggerId) {
|
|
1617
|
+
this.config.logger.debug("executeCronTrigger called", { triggerId });
|
|
1618
|
+
return this.triggersService.executeCronTrigger(triggerId);
|
|
1619
|
+
}
|
|
1620
|
+
/**
|
|
1621
|
+
* Get all available OAuth2 providers
|
|
1622
|
+
*/
|
|
1623
|
+
getOAuth2Providers() {
|
|
1624
|
+
this.ensureInitialized();
|
|
1625
|
+
return this.serviceFactory.getCredentialsService().getOAuth2Service().getProviders();
|
|
1626
|
+
}
|
|
1627
|
+
/**
|
|
1628
|
+
* Get a specific OAuth2 provider by ID
|
|
1629
|
+
*/
|
|
1630
|
+
getOAuth2Provider(providerId) {
|
|
1631
|
+
this.ensureInitialized();
|
|
1632
|
+
return this.serviceFactory.getCredentialsService().getOAuth2Service().getProvider(providerId);
|
|
1633
|
+
}
|
|
1634
|
+
/**
|
|
1635
|
+
* Start an OAuth2 authorization flow
|
|
1636
|
+
* Returns the authorization URL and state to redirect the user to
|
|
1637
|
+
*/
|
|
1638
|
+
startOAuth2Flow(providerId, appConfig, options) {
|
|
1639
|
+
this.ensureInitialized();
|
|
1640
|
+
return this.serviceFactory.getCredentialsService().getOAuth2Service().startAuthorizationFlow(providerId, appConfig, options);
|
|
1641
|
+
}
|
|
1642
|
+
/**
|
|
1643
|
+
* Get pending OAuth2 state (for verifying callback)
|
|
1644
|
+
*/
|
|
1645
|
+
getOAuth2PendingState(state) {
|
|
1646
|
+
this.ensureInitialized();
|
|
1647
|
+
return this.serviceFactory.getCredentialsService().getOAuth2Service().getPendingState(state);
|
|
1648
|
+
}
|
|
1649
|
+
/**
|
|
1650
|
+
* Handle OAuth2 callback - exchange code for tokens and create credential
|
|
1651
|
+
*/
|
|
1652
|
+
async handleOAuth2Callback(code, state, appConfig) {
|
|
1653
|
+
this.ensureInitialized();
|
|
1654
|
+
const credentialsService = this.serviceFactory.getCredentialsService();
|
|
1655
|
+
const oauth2Service = credentialsService.getOAuth2Service();
|
|
1656
|
+
const { tokens, pendingState } = await oauth2Service.exchangeCodeForTokens(code, state, appConfig);
|
|
1657
|
+
const provider = oauth2Service.getProvider(pendingState.providerId);
|
|
1658
|
+
if (!provider) throw new Error(`Unknown OAuth2 provider: ${pendingState.providerId}`);
|
|
1659
|
+
const config = oauth2Service.buildCredentialConfig(tokens, pendingState.providerId, appConfig);
|
|
1660
|
+
const credential = await credentialsService.create({
|
|
1661
|
+
name: pendingState.credentialName || provider.name,
|
|
1662
|
+
type: "http-api",
|
|
1663
|
+
authType: "oauth2",
|
|
1664
|
+
config,
|
|
1665
|
+
description: `OAuth2 credential for ${provider.name}`,
|
|
1666
|
+
metadata: {
|
|
1667
|
+
oauth2Provider: pendingState.providerId,
|
|
1668
|
+
scopes: tokens.scope?.split(" ") || provider.defaultScopes
|
|
1669
|
+
}
|
|
1670
|
+
});
|
|
1671
|
+
this.loggerManager.getBasicLogger().info("Created OAuth2 credential", {
|
|
1672
|
+
credentialId: credential.id,
|
|
1673
|
+
providerId: pendingState.providerId
|
|
1674
|
+
});
|
|
1675
|
+
return credential;
|
|
1676
|
+
}
|
|
1677
|
+
/**
|
|
1678
|
+
* Refresh an OAuth2 credential's access token
|
|
1679
|
+
*/
|
|
1680
|
+
async refreshOAuth2Credential(credentialId) {
|
|
1681
|
+
this.ensureInitialized();
|
|
1682
|
+
return this.serviceFactory.getCredentialsService().getDecryptedWithRefresh(credentialId);
|
|
1683
|
+
}
|
|
1684
|
+
};
|
|
1685
|
+
//#endregion
|
|
1686
|
+
export { Invect };
|
|
1687
|
+
|
|
1688
|
+
//# sourceMappingURL=invect-core.js.map
|