@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,469 @@
|
|
|
1
|
+
import { DatabaseError } from "../../types/common/errors.types.js";
|
|
2
|
+
import { DatabaseConnectionFactory } from "../../database/connection.js";
|
|
3
|
+
import { CORE_SCHEMA } from "../../database/core-schema.js";
|
|
4
|
+
import { verifySchema } from "../../database/schema-verification.js";
|
|
5
|
+
import { FlowRunsModel } from "../flow-runs/flow-runs.model.js";
|
|
6
|
+
import { FlowsModel } from "../flows/flows.model.js";
|
|
7
|
+
import { BatchJobsModel } from "../batch-jobs/batch-jobs.model.js";
|
|
8
|
+
import { FlowVersionsModel } from "../flow-versions/flow-versions.model.js";
|
|
9
|
+
import { NodeExecutionsModel } from "../node-executions/node-executions.model.js";
|
|
10
|
+
import { AgentToolExecutionsModel } from "../agent-tool-executions/agent-tool-executions.model.js";
|
|
11
|
+
import { FlowTriggersModel } from "../triggers/flow-triggers.model.js";
|
|
12
|
+
import { ChatMessagesModel } from "../chat/chat-messages.model.js";
|
|
13
|
+
import { createAdapterFromConnection } from "../../database/adapters/connection-bridge.js";
|
|
14
|
+
//#region src/services/database/database.service.ts
|
|
15
|
+
/**
|
|
16
|
+
* Core database service implementation
|
|
17
|
+
*/
|
|
18
|
+
var DatabaseService = class DatabaseService {
|
|
19
|
+
connection = null;
|
|
20
|
+
_database = null;
|
|
21
|
+
_adapter = null;
|
|
22
|
+
schemaVerificationOptions;
|
|
23
|
+
pluginTableRequirements = [];
|
|
24
|
+
constructor(hostDbConfig, logger = console, schemaVerification, plugins) {
|
|
25
|
+
this.hostDbConfig = hostDbConfig;
|
|
26
|
+
this.logger = logger;
|
|
27
|
+
this.schemaVerificationOptions = schemaVerification;
|
|
28
|
+
this.pluginTableRequirements = DatabaseService.extractPluginTableRequirements(plugins ?? []);
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Get the Database instance with all model classes
|
|
32
|
+
*/
|
|
33
|
+
get database() {
|
|
34
|
+
if (!this._database) throw new DatabaseError("Database not initialized - call initialize() first");
|
|
35
|
+
return this._database;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Get the InvectAdapter instance for direct adapter access
|
|
39
|
+
*/
|
|
40
|
+
get adapter() {
|
|
41
|
+
if (!this._adapter) throw new DatabaseError("Database not initialized - call initialize() first");
|
|
42
|
+
return this._adapter;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Direct access to flows model
|
|
46
|
+
*/
|
|
47
|
+
get flows() {
|
|
48
|
+
return this.database.flows;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Direct access to flow versions model
|
|
52
|
+
*/
|
|
53
|
+
get flowVersions() {
|
|
54
|
+
return this.database.flowVersions;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Direct access to flow executions model
|
|
58
|
+
*/
|
|
59
|
+
get flowRuns() {
|
|
60
|
+
return this.database.flowRuns;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Direct access to execution traces model
|
|
64
|
+
*/
|
|
65
|
+
get nodeExecutions() {
|
|
66
|
+
return this.database.executionTraces;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Direct access to batch jobs model
|
|
70
|
+
*/
|
|
71
|
+
get batchJobs() {
|
|
72
|
+
return this.database.batchJobs;
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Direct access to agent tool executions model
|
|
76
|
+
*/
|
|
77
|
+
get agentToolExecutions() {
|
|
78
|
+
return this.database.agentToolExecutions;
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Direct access to flow triggers model
|
|
82
|
+
*/
|
|
83
|
+
get flowTriggers() {
|
|
84
|
+
return this.database.flowTriggers;
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Direct access to chat messages model
|
|
88
|
+
*/
|
|
89
|
+
get chatMessages() {
|
|
90
|
+
return this.database.chatMessages;
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Initialize the database connection and models
|
|
94
|
+
*/
|
|
95
|
+
async initialize() {
|
|
96
|
+
if (this.connection) {
|
|
97
|
+
this.logger.debug("Database connection already initialized");
|
|
98
|
+
return;
|
|
99
|
+
}
|
|
100
|
+
try {
|
|
101
|
+
this.connection = await DatabaseConnectionFactory.createHostDBConnection(this.hostDbConfig, this.logger);
|
|
102
|
+
} catch (error) {
|
|
103
|
+
this.logConnectionError(error);
|
|
104
|
+
throw new DatabaseError(`Failed to connect to the database: ${error instanceof Error ? error.message : error}`, {
|
|
105
|
+
error,
|
|
106
|
+
originalStack: error instanceof Error ? error.stack : void 0
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
try {
|
|
110
|
+
await this.runConnectivityCheck(this.connection);
|
|
111
|
+
} catch (error) {
|
|
112
|
+
this.logConnectivityError(error);
|
|
113
|
+
throw new DatabaseError(`Database connectivity check failed: ${error instanceof Error ? error.message : error}`, { error });
|
|
114
|
+
}
|
|
115
|
+
await this.runCoreTableCheck(this.connection);
|
|
116
|
+
await this.runPluginTableChecks(this.connection);
|
|
117
|
+
this._adapter = createAdapterFromConnection(this.connection);
|
|
118
|
+
this._database = new Database(this.connection, this.logger, this._adapter);
|
|
119
|
+
if (this.schemaVerificationOptions) await verifySchema(this.connection, this.logger, this.schemaVerificationOptions);
|
|
120
|
+
this.logger.info("Database service initialized successfully");
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* Get the database connection for sharing with other services
|
|
124
|
+
*/
|
|
125
|
+
getConnection() {
|
|
126
|
+
if (!this.connection) throw new DatabaseError("Database not initialized - call initialize() first");
|
|
127
|
+
return this.connection;
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* Execute a SQL query on a provided queryDatabase
|
|
131
|
+
*/
|
|
132
|
+
async executeQuery(query, queryDBConfig) {
|
|
133
|
+
try {
|
|
134
|
+
this.logger.debug("Executing query on external database", {
|
|
135
|
+
query,
|
|
136
|
+
dbType: queryDBConfig.type,
|
|
137
|
+
dbId: queryDBConfig.id
|
|
138
|
+
});
|
|
139
|
+
const queryConnection = await DatabaseConnectionFactory.createQueryDbConnection(queryDBConfig, this.logger);
|
|
140
|
+
let result = [];
|
|
141
|
+
switch (queryDBConfig.type) {
|
|
142
|
+
case "postgresql": {
|
|
143
|
+
const client = queryConnection.db.$client;
|
|
144
|
+
result = await client(query);
|
|
145
|
+
break;
|
|
146
|
+
}
|
|
147
|
+
case "sqlite":
|
|
148
|
+
result = queryConnection.db.$client.prepare(query).all();
|
|
149
|
+
break;
|
|
150
|
+
case "mysql": {
|
|
151
|
+
const [rows] = await queryConnection.db.$client.execute(query);
|
|
152
|
+
result = Array.isArray(rows) ? rows : [];
|
|
153
|
+
break;
|
|
154
|
+
}
|
|
155
|
+
default: throw new DatabaseError(`Unsupported database type: ${queryDBConfig.type}`);
|
|
156
|
+
}
|
|
157
|
+
this.logger.debug("Query executed successfully", {
|
|
158
|
+
rowCount: Array.isArray(result) ? result.length : "unknown",
|
|
159
|
+
dbType: queryDBConfig.type,
|
|
160
|
+
dbId: queryDBConfig.id
|
|
161
|
+
});
|
|
162
|
+
return result;
|
|
163
|
+
} catch (error) {
|
|
164
|
+
this.logger.error("Failed to execute query on external database", {
|
|
165
|
+
error: error instanceof Error ? error.message : error,
|
|
166
|
+
query,
|
|
167
|
+
dbType: queryDBConfig.type,
|
|
168
|
+
dbId: queryDBConfig.id,
|
|
169
|
+
stack: error instanceof Error ? error.stack : void 0
|
|
170
|
+
});
|
|
171
|
+
throw new DatabaseError(`Query execution failed on ${queryDBConfig.type} database (${queryDBConfig.id}): ${error instanceof Error ? error.message : error}`, {
|
|
172
|
+
error,
|
|
173
|
+
query,
|
|
174
|
+
dbConfig: queryDBConfig,
|
|
175
|
+
originalStack: error instanceof Error ? error.stack : void 0
|
|
176
|
+
});
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
/**
|
|
180
|
+
* Health check method
|
|
181
|
+
*/
|
|
182
|
+
async healthCheck() {
|
|
183
|
+
this.logger.debug("Performing database health check");
|
|
184
|
+
if (!this.connection) throw new DatabaseError("Database not initialized - call initialize() first");
|
|
185
|
+
try {
|
|
186
|
+
switch (this.connection.type) {
|
|
187
|
+
case "postgresql":
|
|
188
|
+
await this.connection.db.$client`SELECT 1 as health`;
|
|
189
|
+
break;
|
|
190
|
+
case "sqlite":
|
|
191
|
+
this.connection.db.$client.prepare("SELECT 1 as health").get();
|
|
192
|
+
break;
|
|
193
|
+
case "mysql":
|
|
194
|
+
await this.connection.db.$client.execute("SELECT 1 as health");
|
|
195
|
+
break;
|
|
196
|
+
default: throw new DatabaseError("Unsupported database type for health check");
|
|
197
|
+
}
|
|
198
|
+
this.logger.debug("Database health check passed");
|
|
199
|
+
} catch (error) {
|
|
200
|
+
this.logger.error("Database health check failed", error);
|
|
201
|
+
throw new DatabaseError("Database health check failed", { error });
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
/**
|
|
205
|
+
* Close the database connection
|
|
206
|
+
*/
|
|
207
|
+
async close() {
|
|
208
|
+
if (this.connection) {
|
|
209
|
+
this.logger.debug("Closing database connection");
|
|
210
|
+
this.connection = null;
|
|
211
|
+
this._database = null;
|
|
212
|
+
this.logger.info("Database connection closed");
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
/**
|
|
216
|
+
* Extract table requirements from plugin declarations.
|
|
217
|
+
*
|
|
218
|
+
* A plugin can declare required tables via:
|
|
219
|
+
* 1. `requiredTables: string[]` — explicit list (preferred)
|
|
220
|
+
* 2. `schema: { tableName: ... }` — inferred from abstract schema definitions
|
|
221
|
+
*
|
|
222
|
+
* If both are present, `requiredTables` takes precedence.
|
|
223
|
+
*/
|
|
224
|
+
static extractPluginTableRequirements(plugins) {
|
|
225
|
+
const requirements = [];
|
|
226
|
+
for (const plugin of plugins) {
|
|
227
|
+
let tables = [];
|
|
228
|
+
if (plugin.requiredTables && plugin.requiredTables.length > 0) tables = [...plugin.requiredTables];
|
|
229
|
+
else if (plugin.schema) for (const [key, def] of Object.entries(plugin.schema)) {
|
|
230
|
+
const tableName = def.tableName ?? key;
|
|
231
|
+
if (!def.disableMigration) tables.push(tableName);
|
|
232
|
+
}
|
|
233
|
+
if (tables.length > 0) requirements.push({
|
|
234
|
+
pluginId: plugin.id,
|
|
235
|
+
pluginName: plugin.name ?? plugin.id,
|
|
236
|
+
tables,
|
|
237
|
+
setupInstructions: plugin.setupInstructions
|
|
238
|
+
});
|
|
239
|
+
}
|
|
240
|
+
return requirements;
|
|
241
|
+
}
|
|
242
|
+
/**
|
|
243
|
+
* Run a simple `SELECT 1` query to verify the database is reachable.
|
|
244
|
+
*/
|
|
245
|
+
async runConnectivityCheck(connection) {
|
|
246
|
+
switch (connection.type) {
|
|
247
|
+
case "postgresql":
|
|
248
|
+
await connection.db.$client`SELECT 1 as health`;
|
|
249
|
+
break;
|
|
250
|
+
case "sqlite":
|
|
251
|
+
connection.db.$client.prepare("SELECT 1 as health").get();
|
|
252
|
+
break;
|
|
253
|
+
case "mysql":
|
|
254
|
+
await connection.db.$client.execute("SELECT 1 as health");
|
|
255
|
+
break;
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
/**
|
|
259
|
+
* Check that the essential Invect tables exist in the database.
|
|
260
|
+
* This catches the most common developer mistake: running the app
|
|
261
|
+
* before applying the database schema.
|
|
262
|
+
*
|
|
263
|
+
* Only checks for table *existence*, not column correctness (that's
|
|
264
|
+
* what the opt-in `schemaVerification` does).
|
|
265
|
+
*/
|
|
266
|
+
async runCoreTableCheck(connection) {
|
|
267
|
+
const expectedTables = [];
|
|
268
|
+
for (const def of Object.values(CORE_SCHEMA)) {
|
|
269
|
+
const tableDef = def;
|
|
270
|
+
if (tableDef.disableMigration) continue;
|
|
271
|
+
if (tableDef.tableName) expectedTables.push(tableDef.tableName);
|
|
272
|
+
}
|
|
273
|
+
let actualTableNames;
|
|
274
|
+
try {
|
|
275
|
+
actualTableNames = await this.listTableNames(connection);
|
|
276
|
+
} catch (error) {
|
|
277
|
+
this.logger.warn("Could not introspect database tables. Skipping startup table check.", { error: error instanceof Error ? error.message : error });
|
|
278
|
+
return;
|
|
279
|
+
}
|
|
280
|
+
const missingTables = expectedTables.filter((t) => !actualTableNames.has(t));
|
|
281
|
+
if (missingTables.length === 0) {
|
|
282
|
+
this.logger.debug("Core table check passed", { tablesFound: expectedTables.length });
|
|
283
|
+
return;
|
|
284
|
+
}
|
|
285
|
+
const allMissing = missingTables.length === expectedTables.length;
|
|
286
|
+
const lines = [
|
|
287
|
+
"",
|
|
288
|
+
"╔══════════════════════════════════════════════════════════════╗",
|
|
289
|
+
"║ ⚠ INVECT — DATABASE NOT READY ⚠ ║",
|
|
290
|
+
"╚══════════════════════════════════════════════════════════════╝",
|
|
291
|
+
""
|
|
292
|
+
];
|
|
293
|
+
if (allMissing) lines.push("Your database exists but has no Invect tables.", "This usually means you haven't pushed the schema yet.");
|
|
294
|
+
else lines.push(`Your database is missing ${missingTables.length} of ${expectedTables.length} required Invect tables:`, ` Missing: ${missingTables.join(", ")}`, "", "This usually means your schema is out of date.");
|
|
295
|
+
lines.push("");
|
|
296
|
+
lines.push("To fix this, run:", "", " npx invect generate # generate schema files (core + plugins)", " npx drizzle-kit push # push schema to the database", "", "Or if you use migrations:", "", " npx invect generate # generate schema files", " npx drizzle-kit generate", " npx invect migrate # apply migrations", "", "The Invect CLI reads your invect.config.ts to discover installed", "plugins and generates the correct schema for all of them.", "");
|
|
297
|
+
const message = lines.join("\n");
|
|
298
|
+
this.logger.error(message);
|
|
299
|
+
throw new DatabaseError(`Database is missing ${allMissing ? "all" : missingTables.length} required Invect table(s). Run schema migrations before starting the server. See logs above for instructions.`, { missingTables });
|
|
300
|
+
}
|
|
301
|
+
/**
|
|
302
|
+
* Check that tables required by plugins exist in the database.
|
|
303
|
+
*
|
|
304
|
+
* Each plugin can declare `requiredTables` (explicit list) or have them
|
|
305
|
+
* inferred from its `schema` definition. This method checks all of them
|
|
306
|
+
* in a single pass and produces a clear, attributed error message so the
|
|
307
|
+
* developer knows exactly which plugin needs which tables.
|
|
308
|
+
*/
|
|
309
|
+
async runPluginTableChecks(connection) {
|
|
310
|
+
if (this.pluginTableRequirements.length === 0) return;
|
|
311
|
+
let actualTableNames;
|
|
312
|
+
try {
|
|
313
|
+
actualTableNames = await this.listTableNames(connection);
|
|
314
|
+
} catch {
|
|
315
|
+
return;
|
|
316
|
+
}
|
|
317
|
+
const pluginsWithMissing = [];
|
|
318
|
+
for (const req of this.pluginTableRequirements) {
|
|
319
|
+
const missing = req.tables.filter((t) => !actualTableNames.has(t));
|
|
320
|
+
if (missing.length > 0) pluginsWithMissing.push({
|
|
321
|
+
pluginId: req.pluginId,
|
|
322
|
+
pluginName: req.pluginName,
|
|
323
|
+
missingTables: missing,
|
|
324
|
+
setupInstructions: req.setupInstructions
|
|
325
|
+
});
|
|
326
|
+
}
|
|
327
|
+
if (pluginsWithMissing.length === 0) {
|
|
328
|
+
const totalTables = this.pluginTableRequirements.reduce((sum, r) => sum + r.tables.length, 0);
|
|
329
|
+
this.logger.debug("Plugin table check passed", {
|
|
330
|
+
plugins: this.pluginTableRequirements.length,
|
|
331
|
+
tablesChecked: totalTables
|
|
332
|
+
});
|
|
333
|
+
return;
|
|
334
|
+
}
|
|
335
|
+
const totalMissing = pluginsWithMissing.reduce((sum, p) => sum + p.missingTables.length, 0);
|
|
336
|
+
const lines = [
|
|
337
|
+
"",
|
|
338
|
+
"╔══════════════════════════════════════════════════════════════╗",
|
|
339
|
+
"║ ⚠ INVECT — PLUGIN TABLES MISSING ⚠ ║",
|
|
340
|
+
"╚══════════════════════════════════════════════════════════════╝",
|
|
341
|
+
"",
|
|
342
|
+
`${totalMissing} table(s) required by ${pluginsWithMissing.length} plugin(s) are missing from the database:`,
|
|
343
|
+
""
|
|
344
|
+
];
|
|
345
|
+
for (const plugin of pluginsWithMissing) {
|
|
346
|
+
lines.push(` Plugin: ${plugin.pluginName} (${plugin.pluginId})`, ` Missing tables: ${plugin.missingTables.join(", ")}`);
|
|
347
|
+
if (plugin.setupInstructions) lines.push(` Fix: ${plugin.setupInstructions}`);
|
|
348
|
+
lines.push("");
|
|
349
|
+
}
|
|
350
|
+
if (!pluginsWithMissing.some((p) => p.setupInstructions)) lines.push("To fix this, run:", "", " npx invect generate # generate schema files (core + plugins)", " npx drizzle-kit push # push schema to the database", "", "The Invect CLI reads your invect.config.ts, discovers all plugins", "and their required tables, and generates the complete schema.");
|
|
351
|
+
lines.push("", "If a plugin defines a schema, `npx invect generate` will include it", "automatically. For plugins with externally-managed tables, see the", "plugin's README for additional schema setup instructions.", "");
|
|
352
|
+
const message = lines.join("\n");
|
|
353
|
+
this.logger.error(message);
|
|
354
|
+
throw new DatabaseError(`Database is missing ${totalMissing} table(s) required by plugin(s): ` + pluginsWithMissing.map((p) => `${p.pluginName} (${p.missingTables.join(", ")})`).join("; ") + `. Push the schema before starting the server. See logs above for instructions.`, { pluginsWithMissing: pluginsWithMissing.map((p) => ({
|
|
355
|
+
pluginId: p.pluginId,
|
|
356
|
+
missingTables: p.missingTables
|
|
357
|
+
})) });
|
|
358
|
+
}
|
|
359
|
+
/**
|
|
360
|
+
* Get a set of table names from the database.
|
|
361
|
+
*/
|
|
362
|
+
async listTableNames(connection) {
|
|
363
|
+
const names = /* @__PURE__ */ new Set();
|
|
364
|
+
switch (connection.type) {
|
|
365
|
+
case "sqlite": {
|
|
366
|
+
const rows = connection.db.$client.prepare(`SELECT name FROM sqlite_master WHERE type='table' AND name NOT LIKE 'sqlite\\_%' ESCAPE '\\' AND name NOT LIKE '\\_\\_%' ESCAPE '\\'`).all();
|
|
367
|
+
for (const row of rows) names.add(row.name);
|
|
368
|
+
break;
|
|
369
|
+
}
|
|
370
|
+
case "postgresql": {
|
|
371
|
+
const rows = await connection.db.$client`
|
|
372
|
+
SELECT table_name FROM information_schema.tables
|
|
373
|
+
WHERE table_schema = 'public' AND table_type = 'BASE TABLE'
|
|
374
|
+
`;
|
|
375
|
+
for (const row of rows) names.add(row.table_name);
|
|
376
|
+
break;
|
|
377
|
+
}
|
|
378
|
+
case "mysql": {
|
|
379
|
+
const [rows] = await connection.db.$client.execute(`SELECT TABLE_NAME FROM information_schema.TABLES WHERE TABLE_SCHEMA = DATABASE() AND TABLE_TYPE = 'BASE TABLE'`);
|
|
380
|
+
for (const row of rows) names.add(row["TABLE_NAME"]);
|
|
381
|
+
break;
|
|
382
|
+
}
|
|
383
|
+
}
|
|
384
|
+
return names;
|
|
385
|
+
}
|
|
386
|
+
/**
|
|
387
|
+
* Log a helpful error when the database connection itself fails.
|
|
388
|
+
*/
|
|
389
|
+
logConnectionError(error) {
|
|
390
|
+
const msg = error instanceof Error ? error.message : String(error);
|
|
391
|
+
const dbType = this.hostDbConfig.type;
|
|
392
|
+
const connStr = this.hostDbConfig.connectionString;
|
|
393
|
+
const lines = [
|
|
394
|
+
"",
|
|
395
|
+
"╔══════════════════════════════════════════════════════════════╗",
|
|
396
|
+
"║ ⚠ INVECT — DATABASE CONNECTION FAILED ⚠ ║",
|
|
397
|
+
"╚══════════════════════════════════════════════════════════════╝",
|
|
398
|
+
"",
|
|
399
|
+
`Database type: ${dbType}`,
|
|
400
|
+
`Connection string: ${this.redactConnectionString(connStr)}`,
|
|
401
|
+
`Error: ${msg}`,
|
|
402
|
+
""
|
|
403
|
+
];
|
|
404
|
+
if (dbType === "sqlite") if (msg.includes("SQLITE_CANTOPEN") || msg.includes("unable to open")) lines.push("The SQLite database file could not be opened.", "Check that the path is correct and the directory exists.", "", ` Configured path: ${connStr}`);
|
|
405
|
+
else lines.push("Could not connect to the SQLite database.", "Make sure the connection string in your config is valid.", "", "Common formats:", " file:./dev.db (relative path)", " file:/absolute/path.db (absolute path)");
|
|
406
|
+
else if (dbType === "postgresql") if (msg.includes("ECONNREFUSED") || msg.includes("connect")) lines.push("Could not reach the PostgreSQL server.", "Make sure PostgreSQL is running and the connection string is correct.", "", "Common causes:", " • PostgreSQL is not running (start with: pg_ctl start)", " • Wrong host/port in connection string", " • Firewall blocking the connection");
|
|
407
|
+
else if (msg.includes("authentication") || msg.includes("password")) lines.push("PostgreSQL authentication failed.", "Check that the username and password in your connection string are correct.");
|
|
408
|
+
else if (msg.includes("does not exist")) lines.push("The PostgreSQL database does not exist.", "Create it with: createdb <database_name>");
|
|
409
|
+
else lines.push("Could not connect to PostgreSQL. Verify your DATABASE_URL is correct.");
|
|
410
|
+
else if (dbType === "mysql") if (msg.includes("ECONNREFUSED") || msg.includes("connect")) lines.push("Could not reach the MySQL server.", "Make sure MySQL is running and the connection string is correct.");
|
|
411
|
+
else lines.push("Could not connect to MySQL. Verify your connection string.");
|
|
412
|
+
lines.push("");
|
|
413
|
+
this.logger.error(lines.join("\n"));
|
|
414
|
+
}
|
|
415
|
+
/**
|
|
416
|
+
* Log a helpful error when the connectivity probe (SELECT 1) fails.
|
|
417
|
+
*/
|
|
418
|
+
logConnectivityError(error) {
|
|
419
|
+
const lines = [
|
|
420
|
+
"",
|
|
421
|
+
"╔══════════════════════════════════════════════════════════════╗",
|
|
422
|
+
"║ ⚠ INVECT — DATABASE CONNECTIVITY CHECK FAILED ⚠ ║",
|
|
423
|
+
"╚══════════════════════════════════════════════════════════════╝",
|
|
424
|
+
"",
|
|
425
|
+
"A connection was established but a simple SELECT query failed.",
|
|
426
|
+
`Error: ${error instanceof Error ? error.message : String(error)}`,
|
|
427
|
+
"",
|
|
428
|
+
"This may indicate:",
|
|
429
|
+
" • The database server dropped the connection",
|
|
430
|
+
" • Insufficient permissions for the database user",
|
|
431
|
+
" • The database file is corrupted (SQLite)",
|
|
432
|
+
""
|
|
433
|
+
];
|
|
434
|
+
this.logger.error(lines.join("\n"));
|
|
435
|
+
}
|
|
436
|
+
/**
|
|
437
|
+
* Redact credentials from a connection string for safe logging.
|
|
438
|
+
*/
|
|
439
|
+
redactConnectionString(connStr) {
|
|
440
|
+
return connStr.replace(/:([^/:@]+)@/, ":***@");
|
|
441
|
+
}
|
|
442
|
+
};
|
|
443
|
+
/**
|
|
444
|
+
* Database Models Factory - Creates all model instances with shared connection and logger
|
|
445
|
+
*/
|
|
446
|
+
var Database = class {
|
|
447
|
+
flows;
|
|
448
|
+
flowVersions;
|
|
449
|
+
flowRuns;
|
|
450
|
+
executionTraces;
|
|
451
|
+
batchJobs;
|
|
452
|
+
agentToolExecutions;
|
|
453
|
+
flowTriggers;
|
|
454
|
+
chatMessages;
|
|
455
|
+
constructor(_connection, logger, adapter) {
|
|
456
|
+
this.flows = new FlowsModel(adapter, logger);
|
|
457
|
+
this.flowVersions = new FlowVersionsModel(adapter, logger);
|
|
458
|
+
this.flowRuns = new FlowRunsModel(adapter, logger);
|
|
459
|
+
this.executionTraces = new NodeExecutionsModel(adapter, logger);
|
|
460
|
+
this.batchJobs = new BatchJobsModel(adapter, logger);
|
|
461
|
+
this.agentToolExecutions = new AgentToolExecutionsModel(adapter, logger);
|
|
462
|
+
this.flowTriggers = new FlowTriggersModel(adapter, logger);
|
|
463
|
+
this.chatMessages = new ChatMessagesModel(adapter, logger);
|
|
464
|
+
}
|
|
465
|
+
};
|
|
466
|
+
//#endregion
|
|
467
|
+
export { DatabaseService };
|
|
468
|
+
|
|
469
|
+
//# sourceMappingURL=database.service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"database.service.js","names":[],"sources":["../../../src/services/database/database.service.ts"],"sourcesContent":["// Framework-agnostic Database Service for Invect core\n\nimport { DatabaseConnectionFactory, type DatabaseConnection } from '../../database/connection';\nimport { verifySchema, type SchemaVerificationOptions } from '../../database/schema-verification';\nimport { CORE_SCHEMA } from '../../database/core-schema';\nimport { DatabaseError } from 'src/types/common/errors.types';\nimport { FlowRunsModel } from '../flow-runs/flow-runs.model';\nimport { FlowsModel } from '../flows/flows.model';\nimport { BatchJobsModel } from '../batch-jobs/batch-jobs.model';\nimport { FlowVersionsModel } from '../flow-versions/flow-versions.model';\nimport { NodeExecutionsModel } from '../node-executions/node-executions.model';\nimport { AgentToolExecutionsModel } from '../agent-tool-executions/agent-tool-executions.model';\nimport { FlowTriggersModel } from '../triggers/flow-triggers.model';\nimport { ChatMessagesModel } from '../chat/chat-messages.model';\nimport { InvectDatabaseConfig, Logger } from 'src/types/schemas';\nimport type { InvectPlugin } from 'src/types/plugin.types';\nimport type { InvectAdapter } from '../../database/adapter';\nimport { createAdapterFromConnection } from '../../database/adapters/connection-bridge';\n\ntype PostgreSqlClientLike = {\n <T = Record<string, unknown>>(query: string): Promise<T[]>;\n (strings: TemplateStringsArray, ...values: unknown[]): Promise<unknown[]>;\n};\n\ntype SqliteClientLike = {\n prepare(sql: string): {\n all(...params: unknown[]): Record<string, unknown>[];\n run(...params: unknown[]): { changes: number };\n get(...params: unknown[]): Record<string, unknown> | undefined;\n };\n exec(sql: string): void;\n};\n\ntype MysqlClientLike = {\n execute<T = Record<string, unknown>>(\n query: string,\n params?: unknown[],\n ): Promise<[T[] | unknown, unknown]>;\n};\n\ntype PostgreSqlDbLike = {\n $client: PostgreSqlClientLike;\n};\n\ntype SqliteDbLike = {\n $client: SqliteClientLike;\n};\n\ntype MysqlDbLike = {\n $client: MysqlClientLike;\n};\n\n/**\n * Describes tables that a plugin needs checked at startup.\n */\nexport interface PluginTableRequirement {\n pluginId: string;\n pluginName: string;\n tables: string[];\n setupInstructions?: string;\n}\n\n/**\n * Core database service implementation\n */\nexport class DatabaseService {\n private connection: DatabaseConnection | null = null;\n private _database: Database | null = null;\n private _adapter: InvectAdapter | null = null;\n private schemaVerificationOptions?: SchemaVerificationOptions;\n private pluginTableRequirements: PluginTableRequirement[] = [];\n\n constructor(\n private readonly hostDbConfig: InvectDatabaseConfig,\n private readonly logger: Logger = console,\n schemaVerification?: SchemaVerificationOptions,\n plugins?: InvectPlugin[],\n ) {\n this.schemaVerificationOptions = schemaVerification;\n this.pluginTableRequirements = DatabaseService.extractPluginTableRequirements(plugins ?? []);\n }\n\n /**\n * Get the Database instance with all model classes\n */\n get database(): Database {\n if (!this._database) {\n throw new DatabaseError('Database not initialized - call initialize() first');\n }\n return this._database;\n }\n\n /**\n * Get the InvectAdapter instance for direct adapter access\n */\n get adapter(): InvectAdapter {\n if (!this._adapter) {\n throw new DatabaseError('Database not initialized - call initialize() first');\n }\n return this._adapter;\n }\n\n /**\n * Direct access to flows model\n */\n get flows() {\n return this.database.flows;\n }\n\n /**\n * Direct access to flow versions model\n */\n get flowVersions() {\n return this.database.flowVersions;\n }\n\n /**\n * Direct access to flow executions model\n */\n get flowRuns() {\n return this.database.flowRuns;\n }\n\n /**\n * Direct access to execution traces model\n */\n get nodeExecutions() {\n return this.database.executionTraces;\n }\n\n /**\n * Direct access to batch jobs model\n */\n get batchJobs() {\n return this.database.batchJobs;\n }\n\n /**\n * Direct access to agent tool executions model\n */\n get agentToolExecutions() {\n return this.database.agentToolExecutions;\n }\n\n /**\n * Direct access to flow triggers model\n */\n get flowTriggers() {\n return this.database.flowTriggers;\n }\n\n /**\n * Direct access to chat messages model\n */\n get chatMessages() {\n return this.database.chatMessages;\n }\n\n /**\n * Initialize the database connection and models\n */\n async initialize(): Promise<void> {\n if (this.connection) {\n this.logger.debug('Database connection already initialized');\n return;\n }\n\n // --- Step 1: Establish the database connection ---\n try {\n this.connection = await DatabaseConnectionFactory.createHostDBConnection(\n this.hostDbConfig,\n this.logger,\n );\n } catch (error) {\n this.logConnectionError(error);\n throw new DatabaseError(\n `Failed to connect to the database: ${error instanceof Error ? error.message : error}`,\n { error, originalStack: error instanceof Error ? error.stack : undefined },\n );\n }\n\n // --- Step 2: Verify connectivity with a simple query ---\n try {\n await this.runConnectivityCheck(this.connection);\n } catch (error) {\n this.logConnectivityError(error);\n throw new DatabaseError(\n `Database connectivity check failed: ${error instanceof Error ? error.message : error}`,\n { error },\n );\n }\n\n // --- Step 3: Check that core Invect tables exist ---\n // This always runs (regardless of schemaVerification config) to catch\n // the common case of a fresh database that hasn't had migrations applied.\n await this.runCoreTableCheck(this.connection);\n\n // --- Step 3b: Check that plugin-required tables exist ---\n // Each plugin can declare requiredTables to get a clear error at startup\n // instead of a cryptic runtime crash when a table is missing.\n await this.runPluginTableChecks(this.connection);\n\n // --- Step 4: Initialize the database models ---\n this._adapter = createAdapterFromConnection(this.connection);\n this._database = new Database(this.connection, this.logger, this._adapter);\n\n // --- Step 5: Run detailed schema verification (opt-in) ---\n // This checks columns, not just tables. Controlled by config.schemaVerification.\n if (this.schemaVerificationOptions) {\n await verifySchema(this.connection, this.logger, this.schemaVerificationOptions);\n }\n\n this.logger.info('Database service initialized successfully');\n }\n\n /**\n * Get the database connection for sharing with other services\n */\n getConnection(): DatabaseConnection {\n if (!this.connection) {\n throw new DatabaseError('Database not initialized - call initialize() first');\n }\n return this.connection;\n }\n\n /**\n * Execute a SQL query on a provided queryDatabase\n */\n async executeQuery(\n query: string,\n queryDBConfig: InvectDatabaseConfig,\n ): Promise<Record<string, unknown>[]> {\n try {\n this.logger.debug('Executing query on external database', {\n query,\n dbType: queryDBConfig.type,\n dbId: queryDBConfig.id,\n });\n\n // Create or get existing query database connection\n const queryConnection = await DatabaseConnectionFactory.createQueryDbConnection(\n queryDBConfig,\n this.logger,\n );\n\n // Execute the query based on database type and return results\n let result: Record<string, unknown>[] = [];\n\n switch (queryDBConfig.type) {\n case 'postgresql': {\n // PostgreSQL query execution using postgres.js client directly\n const client = (queryConnection.db as unknown as PostgreSqlDbLike).$client;\n result = await client<Record<string, unknown>>(query);\n break;\n }\n case 'sqlite': {\n // SQLite query execution using better-sqlite3 synchronous API\n const sqliteClient = (queryConnection.db as unknown as SqliteDbLike).$client;\n result = sqliteClient.prepare(query).all() as Record<string, unknown>[];\n break;\n }\n case 'mysql': {\n // MySQL query execution using mysql2 client directly\n const client = (queryConnection.db as unknown as MysqlDbLike).$client;\n const [rows] = await client.execute<Record<string, unknown>>(query);\n result = Array.isArray(rows) ? rows : [];\n break;\n }\n default:\n throw new DatabaseError(`Unsupported database type: ${queryDBConfig.type}`);\n }\n\n this.logger.debug('Query executed successfully', {\n rowCount: Array.isArray(result) ? result.length : 'unknown',\n dbType: queryDBConfig.type,\n dbId: queryDBConfig.id,\n });\n\n return result;\n } catch (error) {\n this.logger.error('Failed to execute query on external database', {\n error: error instanceof Error ? error.message : error,\n query,\n dbType: queryDBConfig.type,\n dbId: queryDBConfig.id,\n stack: error instanceof Error ? error.stack : undefined,\n });\n\n throw new DatabaseError(\n `Query execution failed on ${queryDBConfig.type} database (${queryDBConfig.id}): ${\n error instanceof Error ? error.message : error\n }`,\n {\n error,\n query,\n dbConfig: queryDBConfig,\n originalStack: error instanceof Error ? error.stack : undefined,\n },\n );\n }\n }\n\n /**\n * Health check method\n */\n async healthCheck(): Promise<void> {\n this.logger.debug('Performing database health check');\n\n if (!this.connection) {\n throw new DatabaseError('Database not initialized - call initialize() first');\n }\n\n try {\n // Simple connectivity test using host database connection\n switch (this.connection.type) {\n case 'postgresql': {\n const client = (this.connection.db as unknown as PostgreSqlDbLike).$client;\n await client`SELECT 1 as health`;\n break;\n }\n case 'sqlite': {\n const client = (this.connection.db as unknown as SqliteDbLike).$client;\n client.prepare('SELECT 1 as health').get();\n break;\n }\n case 'mysql': {\n const client = (this.connection.db as unknown as MysqlDbLike).$client;\n await client.execute('SELECT 1 as health');\n break;\n }\n default:\n throw new DatabaseError('Unsupported database type for health check');\n }\n\n this.logger.debug('Database health check passed');\n } catch (error) {\n this.logger.error('Database health check failed', error);\n throw new DatabaseError('Database health check failed', { error });\n }\n }\n\n /**\n * Close the database connection\n */\n async close(): Promise<void> {\n if (this.connection) {\n this.logger.debug('Closing database connection');\n this.connection = null;\n this._database = null;\n this.logger.info('Database connection closed');\n }\n }\n\n // ===========================================================================\n // Plugin table requirement extraction\n // ===========================================================================\n\n /**\n * Extract table requirements from plugin declarations.\n *\n * A plugin can declare required tables via:\n * 1. `requiredTables: string[]` — explicit list (preferred)\n * 2. `schema: { tableName: ... }` — inferred from abstract schema definitions\n *\n * If both are present, `requiredTables` takes precedence.\n */\n static extractPluginTableRequirements(plugins: InvectPlugin[]): PluginTableRequirement[] {\n const requirements: PluginTableRequirement[] = [];\n\n for (const plugin of plugins) {\n let tables: string[] = [];\n\n if (plugin.requiredTables && plugin.requiredTables.length > 0) {\n // Explicit declaration takes priority\n tables = [...plugin.requiredTables];\n } else if (plugin.schema) {\n // Infer from abstract schema — each entry's tableName (or snake_case key)\n for (const [key, def] of Object.entries(plugin.schema)) {\n const tableName = (def as { tableName?: string }).tableName ?? key;\n const disabled = (def as { disableMigration?: boolean }).disableMigration;\n if (!disabled) {\n tables.push(tableName);\n }\n }\n }\n\n if (tables.length > 0) {\n requirements.push({\n pluginId: plugin.id,\n pluginName: plugin.name ?? plugin.id,\n tables,\n setupInstructions: plugin.setupInstructions,\n });\n }\n }\n\n return requirements;\n }\n\n // ===========================================================================\n // Startup check helpers\n // ===========================================================================\n\n /**\n * Run a simple `SELECT 1` query to verify the database is reachable.\n */\n private async runConnectivityCheck(connection: DatabaseConnection): Promise<void> {\n switch (connection.type) {\n case 'postgresql': {\n const client = (connection.db as unknown as PostgreSqlDbLike).$client;\n await client`SELECT 1 as health`;\n break;\n }\n case 'sqlite': {\n const client = (connection.db as unknown as SqliteDbLike).$client;\n client.prepare('SELECT 1 as health').get();\n break;\n }\n case 'mysql': {\n const client = (connection.db as unknown as MysqlDbLike).$client;\n await client.execute('SELECT 1 as health');\n break;\n }\n }\n }\n\n /**\n * Check that the essential Invect tables exist in the database.\n * This catches the most common developer mistake: running the app\n * before applying the database schema.\n *\n * Only checks for table *existence*, not column correctness (that's\n * what the opt-in `schemaVerification` does).\n */\n private async runCoreTableCheck(connection: DatabaseConnection): Promise<void> {\n // Collect the expected core table names from the abstract schema\n const expectedTables: string[] = [];\n for (const def of Object.values(CORE_SCHEMA)) {\n const tableDef = def as { tableName?: string; disableMigration?: boolean };\n if (tableDef.disableMigration) {\n continue;\n }\n if (tableDef.tableName) {\n expectedTables.push(tableDef.tableName);\n }\n }\n\n // Get actual table names from the database\n let actualTableNames: Set<string>;\n try {\n actualTableNames = await this.listTableNames(connection);\n } catch (error) {\n // If we can't even list tables, the database is probably unreachable\n // or misconfigured — the connectivity check should have caught this,\n // but log and proceed gracefully.\n this.logger.warn('Could not introspect database tables. Skipping startup table check.', {\n error: error instanceof Error ? error.message : error,\n });\n return;\n }\n\n const missingTables = expectedTables.filter((t) => !actualTableNames.has(t));\n\n if (missingTables.length === 0) {\n this.logger.debug('Core table check passed', {\n tablesFound: expectedTables.length,\n });\n return;\n }\n\n // --- Build a helpful error message ---\n const allMissing = missingTables.length === expectedTables.length;\n\n const lines: string[] = [\n '',\n '╔══════════════════════════════════════════════════════════════╗',\n '║ ⚠ INVECT — DATABASE NOT READY ⚠ ║',\n '╚══════════════════════════════════════════════════════════════╝',\n '',\n ];\n\n if (allMissing) {\n lines.push(\n 'Your database exists but has no Invect tables.',\n \"This usually means you haven't pushed the schema yet.\",\n );\n } else {\n lines.push(\n `Your database is missing ${missingTables.length} of ${expectedTables.length} required Invect tables:`,\n ` Missing: ${missingTables.join(', ')}`,\n '',\n 'This usually means your schema is out of date.',\n );\n }\n\n lines.push('');\n\n // Fix instructions — point users to the Invect CLI\n lines.push(\n 'To fix this, run:',\n '',\n ' npx invect generate # generate schema files (core + plugins)',\n ' npx drizzle-kit push # push schema to the database',\n '',\n 'Or if you use migrations:',\n '',\n ' npx invect generate # generate schema files',\n ' npx drizzle-kit generate',\n ' npx invect migrate # apply migrations',\n '',\n 'The Invect CLI reads your invect.config.ts to discover installed',\n 'plugins and generates the correct schema for all of them.',\n '',\n );\n\n const message = lines.join('\\n');\n this.logger.error(message);\n\n throw new DatabaseError(\n `Database is missing ${allMissing ? 'all' : missingTables.length} required Invect table(s). ` +\n `Run schema migrations before starting the server. See logs above for instructions.`,\n { missingTables },\n );\n }\n\n /**\n * Check that tables required by plugins exist in the database.\n *\n * Each plugin can declare `requiredTables` (explicit list) or have them\n * inferred from its `schema` definition. This method checks all of them\n * in a single pass and produces a clear, attributed error message so the\n * developer knows exactly which plugin needs which tables.\n */\n private async runPluginTableChecks(connection: DatabaseConnection): Promise<void> {\n if (this.pluginTableRequirements.length === 0) {\n return; // No plugins declared required tables\n }\n\n // Get actual table names from the database\n let actualTableNames: Set<string>;\n try {\n actualTableNames = await this.listTableNames(connection);\n } catch {\n // If introspection fails, skip gracefully (core check already warned)\n return;\n }\n\n // Collect all missing tables grouped by plugin\n const pluginsWithMissing: Array<{\n pluginId: string;\n pluginName: string;\n missingTables: string[];\n setupInstructions?: string;\n }> = [];\n\n for (const req of this.pluginTableRequirements) {\n const missing = req.tables.filter((t) => !actualTableNames.has(t));\n if (missing.length > 0) {\n pluginsWithMissing.push({\n pluginId: req.pluginId,\n pluginName: req.pluginName,\n missingTables: missing,\n setupInstructions: req.setupInstructions,\n });\n }\n }\n\n if (pluginsWithMissing.length === 0) {\n const totalTables = this.pluginTableRequirements.reduce((sum, r) => sum + r.tables.length, 0);\n this.logger.debug('Plugin table check passed', {\n plugins: this.pluginTableRequirements.length,\n tablesChecked: totalTables,\n });\n return;\n }\n\n // --- Build a helpful, plugin-attributed error message ---\n const totalMissing = pluginsWithMissing.reduce((sum, p) => sum + p.missingTables.length, 0);\n\n const lines: string[] = [\n '',\n '╔══════════════════════════════════════════════════════════════╗',\n '║ ⚠ INVECT — PLUGIN TABLES MISSING ⚠ ║',\n '╚══════════════════════════════════════════════════════════════╝',\n '',\n `${totalMissing} table(s) required by ${pluginsWithMissing.length} plugin(s) are missing from the database:`,\n '',\n ];\n\n for (const plugin of pluginsWithMissing) {\n lines.push(\n ` Plugin: ${plugin.pluginName} (${plugin.pluginId})`,\n ` Missing tables: ${plugin.missingTables.join(', ')}`,\n );\n\n if (plugin.setupInstructions) {\n lines.push(` Fix: ${plugin.setupInstructions}`);\n }\n\n lines.push('');\n }\n\n // Check if any plugin provided custom instructions\n const hasCustomInstructions = pluginsWithMissing.some((p) => p.setupInstructions);\n\n if (!hasCustomInstructions) {\n // Generic fix instructions — point to the CLI\n lines.push(\n 'To fix this, run:',\n '',\n ' npx invect generate # generate schema files (core + plugins)',\n ' npx drizzle-kit push # push schema to the database',\n '',\n 'The Invect CLI reads your invect.config.ts, discovers all plugins',\n 'and their required tables, and generates the complete schema.',\n );\n }\n\n lines.push(\n '',\n 'If a plugin defines a schema, `npx invect generate` will include it',\n 'automatically. For plugins with externally-managed tables, see the',\n \"plugin's README for additional schema setup instructions.\",\n '',\n );\n\n const message = lines.join('\\n');\n this.logger.error(message);\n\n throw new DatabaseError(\n `Database is missing ${totalMissing} table(s) required by plugin(s): ` +\n pluginsWithMissing\n .map((p) => `${p.pluginName} (${p.missingTables.join(', ')})`)\n .join('; ') +\n `. Push the schema before starting the server. See logs above for instructions.`,\n {\n pluginsWithMissing: pluginsWithMissing.map((p) => ({\n pluginId: p.pluginId,\n missingTables: p.missingTables,\n })),\n },\n );\n }\n\n /**\n * Get a set of table names from the database.\n */\n private async listTableNames(connection: DatabaseConnection): Promise<Set<string>> {\n const names = new Set<string>();\n\n switch (connection.type) {\n case 'sqlite': {\n const db = connection.db as unknown as SqliteDbLike;\n // Note: In SQL LIKE, '_' is a single-char wildcard. We must escape it\n // with ESCAPE '\\' so 'sqlite\\_%' matches literal 'sqlite_*' and\n // '\\\\_\\\\_%' matches literal names starting with '__'.\n const query = `SELECT name FROM sqlite_master WHERE type='table' AND name NOT LIKE 'sqlite\\\\_%' ESCAPE '\\\\' AND name NOT LIKE '\\\\_\\\\_%' ESCAPE '\\\\'`;\n const rows = db.$client.prepare(query).all() as Array<{ name: string }>;\n for (const row of rows) {\n names.add(row.name);\n }\n break;\n }\n case 'postgresql': {\n const db = connection.db as unknown as PostgreSqlDbLike;\n const rows = (await db.$client`\n SELECT table_name FROM information_schema.tables\n WHERE table_schema = 'public' AND table_type = 'BASE TABLE'\n `) as Array<{ table_name: string }>;\n for (const row of rows) {\n names.add(row.table_name);\n }\n break;\n }\n case 'mysql': {\n const db = connection.db as unknown as MysqlDbLike;\n const [rows] = await db.$client.execute(\n `SELECT TABLE_NAME FROM information_schema.TABLES WHERE TABLE_SCHEMA = DATABASE() AND TABLE_TYPE = 'BASE TABLE'`,\n );\n for (const row of rows as Array<Record<string, string>>) {\n names.add(row['TABLE_NAME']);\n }\n break;\n }\n }\n\n return names;\n }\n\n /**\n * Log a helpful error when the database connection itself fails.\n */\n private logConnectionError(error: unknown): void {\n const msg = error instanceof Error ? error.message : String(error);\n const dbType = this.hostDbConfig.type;\n const connStr = this.hostDbConfig.connectionString;\n\n const lines: string[] = [\n '',\n '╔══════════════════════════════════════════════════════════════╗',\n '║ ⚠ INVECT — DATABASE CONNECTION FAILED ⚠ ║',\n '╚══════════════════════════════════════════════════════════════╝',\n '',\n `Database type: ${dbType}`,\n `Connection string: ${this.redactConnectionString(connStr)}`,\n `Error: ${msg}`,\n '',\n ];\n\n if (dbType === 'sqlite') {\n if (msg.includes('SQLITE_CANTOPEN') || msg.includes('unable to open')) {\n lines.push(\n 'The SQLite database file could not be opened.',\n 'Check that the path is correct and the directory exists.',\n '',\n ` Configured path: ${connStr}`,\n );\n } else {\n lines.push(\n 'Could not connect to the SQLite database.',\n 'Make sure the connection string in your config is valid.',\n '',\n 'Common formats:',\n ' file:./dev.db (relative path)',\n ' file:/absolute/path.db (absolute path)',\n );\n }\n } else if (dbType === 'postgresql') {\n if (msg.includes('ECONNREFUSED') || msg.includes('connect')) {\n lines.push(\n 'Could not reach the PostgreSQL server.',\n 'Make sure PostgreSQL is running and the connection string is correct.',\n '',\n 'Common causes:',\n ' • PostgreSQL is not running (start with: pg_ctl start)',\n ' • Wrong host/port in connection string',\n ' • Firewall blocking the connection',\n );\n } else if (msg.includes('authentication') || msg.includes('password')) {\n lines.push(\n 'PostgreSQL authentication failed.',\n 'Check that the username and password in your connection string are correct.',\n );\n } else if (msg.includes('does not exist')) {\n lines.push(\n 'The PostgreSQL database does not exist.',\n 'Create it with: createdb <database_name>',\n );\n } else {\n lines.push('Could not connect to PostgreSQL. Verify your DATABASE_URL is correct.');\n }\n } else if (dbType === 'mysql') {\n if (msg.includes('ECONNREFUSED') || msg.includes('connect')) {\n lines.push(\n 'Could not reach the MySQL server.',\n 'Make sure MySQL is running and the connection string is correct.',\n );\n } else {\n lines.push('Could not connect to MySQL. Verify your connection string.');\n }\n }\n\n lines.push('');\n this.logger.error(lines.join('\\n'));\n }\n\n /**\n * Log a helpful error when the connectivity probe (SELECT 1) fails.\n */\n private logConnectivityError(error: unknown): void {\n const msg = error instanceof Error ? error.message : String(error);\n\n const lines: string[] = [\n '',\n '╔══════════════════════════════════════════════════════════════╗',\n '║ ⚠ INVECT — DATABASE CONNECTIVITY CHECK FAILED ⚠ ║',\n '╚══════════════════════════════════════════════════════════════╝',\n '',\n 'A connection was established but a simple SELECT query failed.',\n `Error: ${msg}`,\n '',\n 'This may indicate:',\n ' • The database server dropped the connection',\n ' • Insufficient permissions for the database user',\n ' • The database file is corrupted (SQLite)',\n '',\n ];\n\n this.logger.error(lines.join('\\n'));\n }\n\n /**\n * Redact credentials from a connection string for safe logging.\n */\n private redactConnectionString(connStr: string): string {\n // Hide passwords in postgres/mysql URLs: postgres://user:PASS@host → postgres://user:***@host\n return connStr.replace(/:([^/:@]+)@/, ':***@');\n }\n}\n\n/**\n * Database Models Factory - Creates all model instances with shared connection and logger\n */\nclass Database {\n public readonly flows: FlowsModel;\n public readonly flowVersions: FlowVersionsModel;\n public readonly flowRuns: FlowRunsModel;\n public readonly executionTraces: NodeExecutionsModel;\n public readonly batchJobs: BatchJobsModel;\n public readonly agentToolExecutions: AgentToolExecutionsModel;\n public readonly flowTriggers: FlowTriggersModel;\n public readonly chatMessages: ChatMessagesModel;\n\n constructor(_connection: DatabaseConnection, logger: Logger, adapter: InvectAdapter) {\n this.flows = new FlowsModel(adapter, logger);\n this.flowVersions = new FlowVersionsModel(adapter, logger);\n this.flowRuns = new FlowRunsModel(adapter, logger);\n this.executionTraces = new NodeExecutionsModel(adapter, logger);\n this.batchJobs = new BatchJobsModel(adapter, logger);\n this.agentToolExecutions = new AgentToolExecutionsModel(adapter, logger);\n this.flowTriggers = new FlowTriggersModel(adapter, logger);\n this.chatMessages = new ChatMessagesModel(adapter, logger);\n }\n}\n"],"mappings":"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"}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
require("../_virtual/_rolldown/runtime.cjs");
|
|
2
|
+
let events = require("events");
|
|
3
|
+
//#region src/services/execution-event-bus.ts
|
|
4
|
+
/**
|
|
5
|
+
* Execution Event Bus
|
|
6
|
+
*
|
|
7
|
+
* In-process pub/sub for flow-run and node-execution state changes.
|
|
8
|
+
* Services emit events when they write to the database; SSE endpoints
|
|
9
|
+
* subscribe per flow-run ID and forward events to connected clients.
|
|
10
|
+
*/
|
|
11
|
+
/**
|
|
12
|
+
* Lightweight event bus scoped to flow-run IDs.
|
|
13
|
+
*
|
|
14
|
+
* Consumers call `subscribe(flowRunId, callback)` and receive all events for
|
|
15
|
+
* that run. Producers call `emitFlowRunUpdate`, `emitNodeExecutionCreate`, etc.
|
|
16
|
+
*/
|
|
17
|
+
var ExecutionEventBus = class {
|
|
18
|
+
emitter = new events.EventEmitter();
|
|
19
|
+
constructor() {
|
|
20
|
+
this.emitter.setMaxListeners(0);
|
|
21
|
+
}
|
|
22
|
+
emitFlowRunUpdate(flowRun) {
|
|
23
|
+
const event = {
|
|
24
|
+
type: "flow_run.updated",
|
|
25
|
+
flowRun
|
|
26
|
+
};
|
|
27
|
+
this.emitter.emit(`run:${flowRun.id}`, event);
|
|
28
|
+
this.emitter.emit(`flow:${flowRun.flowId}`, event);
|
|
29
|
+
}
|
|
30
|
+
emitNodeExecutionCreate(nodeExecution) {
|
|
31
|
+
const event = {
|
|
32
|
+
type: "node_execution.created",
|
|
33
|
+
nodeExecution
|
|
34
|
+
};
|
|
35
|
+
this.emitter.emit(`run:${nodeExecution.flowRunId}`, event);
|
|
36
|
+
}
|
|
37
|
+
emitNodeExecutionUpdate(nodeExecution) {
|
|
38
|
+
const event = {
|
|
39
|
+
type: "node_execution.updated",
|
|
40
|
+
nodeExecution
|
|
41
|
+
};
|
|
42
|
+
this.emitter.emit(`run:${nodeExecution.flowRunId}`, event);
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Subscribe to events for a specific flow run.
|
|
46
|
+
* Returns an unsubscribe function.
|
|
47
|
+
*/
|
|
48
|
+
subscribe(flowRunId, callback) {
|
|
49
|
+
const channel = `run:${flowRunId}`;
|
|
50
|
+
this.emitter.on(channel, callback);
|
|
51
|
+
return () => {
|
|
52
|
+
this.emitter.off(channel, callback);
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Subscribe to all run-level events for a specific flow (e.g. runs list updates).
|
|
57
|
+
*/
|
|
58
|
+
subscribeFlow(flowId, callback) {
|
|
59
|
+
const channel = `flow:${flowId}`;
|
|
60
|
+
this.emitter.on(channel, callback);
|
|
61
|
+
return () => {
|
|
62
|
+
this.emitter.off(channel, callback);
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
let globalBus = null;
|
|
67
|
+
function getExecutionEventBus() {
|
|
68
|
+
if (!globalBus) globalBus = new ExecutionEventBus();
|
|
69
|
+
return globalBus;
|
|
70
|
+
}
|
|
71
|
+
/** Reset for tests */
|
|
72
|
+
function resetExecutionEventBus() {
|
|
73
|
+
globalBus = null;
|
|
74
|
+
}
|
|
75
|
+
//#endregion
|
|
76
|
+
exports.ExecutionEventBus = ExecutionEventBus;
|
|
77
|
+
exports.getExecutionEventBus = getExecutionEventBus;
|
|
78
|
+
exports.resetExecutionEventBus = resetExecutionEventBus;
|
|
79
|
+
|
|
80
|
+
//# sourceMappingURL=execution-event-bus.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"execution-event-bus.cjs","names":["EventEmitter"],"sources":["../../src/services/execution-event-bus.ts"],"sourcesContent":["/**\n * Execution Event Bus\n *\n * In-process pub/sub for flow-run and node-execution state changes.\n * Services emit events when they write to the database; SSE endpoints\n * subscribe per flow-run ID and forward events to connected clients.\n */\nimport { EventEmitter } from 'events';\nimport type { FlowRun } from './flow-runs/flow-runs.model';\nimport type { NodeExecution } from './node-executions/node-executions.model';\n\n// ---------------------------------------------------------------------------\n// Event types\n// ---------------------------------------------------------------------------\n\nexport type ExecutionSnapshotEvent = {\n type: 'snapshot';\n flowRun: FlowRun;\n nodeExecutions: NodeExecution[];\n};\n\nexport type FlowRunUpdatedEvent = {\n type: 'flow_run.updated';\n flowRun: FlowRun;\n};\n\nexport type NodeExecutionCreatedEvent = {\n type: 'node_execution.created';\n nodeExecution: NodeExecution;\n};\n\nexport type NodeExecutionUpdatedEvent = {\n type: 'node_execution.updated';\n nodeExecution: NodeExecution;\n};\n\nexport type HeartbeatEvent = {\n type: 'heartbeat';\n};\n\nexport type EndEvent = {\n type: 'end';\n flowRun: FlowRun;\n};\n\nexport type ExecutionStreamEvent =\n | ExecutionSnapshotEvent\n | FlowRunUpdatedEvent\n | NodeExecutionCreatedEvent\n | NodeExecutionUpdatedEvent\n | HeartbeatEvent\n | EndEvent;\n\n// ---------------------------------------------------------------------------\n// Bus implementation\n// ---------------------------------------------------------------------------\n\n/**\n * Lightweight event bus scoped to flow-run IDs.\n *\n * Consumers call `subscribe(flowRunId, callback)` and receive all events for\n * that run. Producers call `emitFlowRunUpdate`, `emitNodeExecutionCreate`, etc.\n */\nexport class ExecutionEventBus {\n private emitter = new EventEmitter();\n\n constructor() {\n // Allow many concurrent SSE listeners per flow-run\n this.emitter.setMaxListeners(0);\n }\n\n // ---- emit helpers -------------------------------------------------------\n\n emitFlowRunUpdate(flowRun: FlowRun): void {\n const event: FlowRunUpdatedEvent = { type: 'flow_run.updated', flowRun };\n this.emitter.emit(`run:${flowRun.id}`, event);\n\n // Also emit on the flow-level channel so the runs-list can update\n this.emitter.emit(`flow:${flowRun.flowId}`, event);\n }\n\n emitNodeExecutionCreate(nodeExecution: NodeExecution): void {\n const event: NodeExecutionCreatedEvent = {\n type: 'node_execution.created',\n nodeExecution,\n };\n this.emitter.emit(`run:${nodeExecution.flowRunId}`, event);\n }\n\n emitNodeExecutionUpdate(nodeExecution: NodeExecution): void {\n const event: NodeExecutionUpdatedEvent = {\n type: 'node_execution.updated',\n nodeExecution,\n };\n this.emitter.emit(`run:${nodeExecution.flowRunId}`, event);\n }\n\n // ---- subscription -------------------------------------------------------\n\n /**\n * Subscribe to events for a specific flow run.\n * Returns an unsubscribe function.\n */\n subscribe(flowRunId: string, callback: (event: ExecutionStreamEvent) => void): () => void {\n const channel = `run:${flowRunId}`;\n this.emitter.on(channel, callback);\n return () => {\n this.emitter.off(channel, callback);\n };\n }\n\n /**\n * Subscribe to all run-level events for a specific flow (e.g. runs list updates).\n */\n subscribeFlow(flowId: string, callback: (event: ExecutionStreamEvent) => void): () => void {\n const channel = `flow:${flowId}`;\n this.emitter.on(channel, callback);\n return () => {\n this.emitter.off(channel, callback);\n };\n }\n}\n\n// ---------------------------------------------------------------------------\n// Singleton\n// ---------------------------------------------------------------------------\n\nlet globalBus: ExecutionEventBus | null = null;\n\nexport function getExecutionEventBus(): ExecutionEventBus {\n if (!globalBus) {\n globalBus = new ExecutionEventBus();\n }\n return globalBus;\n}\n\n/** Reset for tests */\nexport function resetExecutionEventBus(): void {\n globalBus = null;\n}\n"],"mappings":";;;;;;;;;;;;;;;;AA+DA,IAAa,oBAAb,MAA+B;CAC7B,UAAkB,IAAIA,OAAAA,cAAc;CAEpC,cAAc;AAEZ,OAAK,QAAQ,gBAAgB,EAAE;;CAKjC,kBAAkB,SAAwB;EACxC,MAAM,QAA6B;GAAE,MAAM;GAAoB;GAAS;AACxE,OAAK,QAAQ,KAAK,OAAO,QAAQ,MAAM,MAAM;AAG7C,OAAK,QAAQ,KAAK,QAAQ,QAAQ,UAAU,MAAM;;CAGpD,wBAAwB,eAAoC;EAC1D,MAAM,QAAmC;GACvC,MAAM;GACN;GACD;AACD,OAAK,QAAQ,KAAK,OAAO,cAAc,aAAa,MAAM;;CAG5D,wBAAwB,eAAoC;EAC1D,MAAM,QAAmC;GACvC,MAAM;GACN;GACD;AACD,OAAK,QAAQ,KAAK,OAAO,cAAc,aAAa,MAAM;;;;;;CAS5D,UAAU,WAAmB,UAA6D;EACxF,MAAM,UAAU,OAAO;AACvB,OAAK,QAAQ,GAAG,SAAS,SAAS;AAClC,eAAa;AACX,QAAK,QAAQ,IAAI,SAAS,SAAS;;;;;;CAOvC,cAAc,QAAgB,UAA6D;EACzF,MAAM,UAAU,QAAQ;AACxB,OAAK,QAAQ,GAAG,SAAS,SAAS;AAClC,eAAa;AACX,QAAK,QAAQ,IAAI,SAAS,SAAS;;;;AASzC,IAAI,YAAsC;AAE1C,SAAgB,uBAA0C;AACxD,KAAI,CAAC,UACH,aAAY,IAAI,mBAAmB;AAErC,QAAO;;;AAIT,SAAgB,yBAA+B;AAC7C,aAAY"}
|