@vertesia/workflow 1.2.0 → 1.3.0-dev.20260620.091720Z
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/README.md +1 -2
- package/lib/{types/activities → activities}/advanced/createDocumentTypeFromInteractionRun.d.ts +2 -2
- package/lib/activities/advanced/createDocumentTypeFromInteractionRun.d.ts.map +1 -0
- package/lib/{esm/activities → activities}/advanced/createDocumentTypeFromInteractionRun.js +9 -9
- package/lib/activities/advanced/createDocumentTypeFromInteractionRun.js.map +1 -0
- package/lib/{types/activities → activities}/advanced/createOrUpdateDocumentFromInteractionRun.d.ts +2 -2
- package/lib/activities/advanced/createOrUpdateDocumentFromInteractionRun.d.ts.map +1 -0
- package/lib/{esm/activities → activities}/advanced/createOrUpdateDocumentFromInteractionRun.js +29 -22
- package/lib/activities/advanced/createOrUpdateDocumentFromInteractionRun.js.map +1 -0
- package/lib/{types/activities → activities}/advanced/updateDocumentFromInteractionRun.d.ts +1 -1
- package/lib/activities/advanced/updateDocumentFromInteractionRun.d.ts.map +1 -0
- package/lib/activities/advanced/updateDocumentFromInteractionRun.js +16 -0
- package/lib/activities/advanced/updateDocumentFromInteractionRun.js.map +1 -0
- package/lib/{types/activities → activities}/chunkDocument.d.ts +3 -3
- package/lib/activities/chunkDocument.d.ts.map +1 -0
- package/lib/{esm/activities → activities}/chunkDocument.js +38 -33
- package/lib/activities/chunkDocument.js.map +1 -0
- package/lib/{types/activities → activities}/createDocumentFromOther.d.ts +1 -1
- package/lib/activities/createDocumentFromOther.d.ts.map +1 -0
- package/lib/{esm/activities → activities}/createDocumentFromOther.js +15 -13
- package/lib/activities/createDocumentFromOther.js.map +1 -0
- package/lib/{types/activities → activities}/executeInteraction.d.ts +19 -10
- package/lib/activities/executeInteraction.d.ts.map +1 -0
- package/lib/{esm/activities → activities}/executeInteraction.js +97 -78
- package/lib/activities/executeInteraction.js.map +1 -0
- package/lib/{types/activities → activities}/executeRemoteActivity.d.ts +4 -4
- package/lib/activities/executeRemoteActivity.d.ts.map +1 -0
- package/lib/{esm/activities → activities}/executeRemoteActivity.js +48 -23
- package/lib/activities/executeRemoteActivity.js.map +1 -0
- package/lib/{types/activities → activities}/extractDocumentText.d.ts +3 -3
- package/lib/activities/extractDocumentText.d.ts.map +1 -0
- package/lib/{esm/activities → activities}/extractDocumentText.js +65 -52
- package/lib/activities/extractDocumentText.js.map +1 -0
- package/lib/{types/activities → activities}/generateDocumentProperties.d.ts +4 -4
- package/lib/activities/generateDocumentProperties.d.ts.map +1 -0
- package/lib/{esm/activities → activities}/generateDocumentProperties.js +37 -33
- package/lib/activities/generateDocumentProperties.js.map +1 -0
- package/lib/{types/activities → activities}/generateEmbeddings.d.ts +3 -3
- package/lib/activities/generateEmbeddings.d.ts.map +1 -0
- package/lib/{esm/activities → activities}/generateEmbeddings.js +80 -80
- package/lib/activities/generateEmbeddings.js.map +1 -0
- package/lib/{types/activities → activities}/generateOrAssignContentType.d.ts +4 -4
- package/lib/activities/generateOrAssignContentType.d.ts.map +1 -0
- package/lib/{esm/activities → activities}/generateOrAssignContentType.js +51 -49
- package/lib/activities/generateOrAssignContentType.js.map +1 -0
- package/lib/{types/activities → activities}/getObjectFromStore.d.ts +1 -1
- package/lib/activities/getObjectFromStore.d.ts.map +1 -0
- package/lib/{esm/activities → activities}/getObjectFromStore.js +4 -3
- package/lib/activities/getObjectFromStore.js.map +1 -0
- package/lib/{types/activities → activities}/handleError.d.ts +1 -1
- package/lib/activities/handleError.d.ts.map +1 -0
- package/lib/activities/handleError.js +37 -0
- package/lib/activities/handleError.js.map +1 -0
- package/lib/activities/index-dsl.d.ts +31 -0
- package/lib/activities/index-dsl.d.ts.map +1 -0
- package/lib/activities/index-dsl.js +29 -0
- package/lib/activities/index-dsl.js.map +1 -0
- package/lib/{types/activities → activities}/index.d.ts +1 -1
- package/lib/activities/index.d.ts.map +1 -0
- package/lib/{esm/activities → activities}/index.js +1 -1
- package/lib/activities/index.js.map +1 -0
- package/lib/{types/activities → activities}/loadChildWorkflowSpec.d.ts +1 -1
- package/lib/activities/loadChildWorkflowSpec.d.ts.map +1 -0
- package/lib/{esm/activities → activities}/loadChildWorkflowSpec.js +4 -2
- package/lib/activities/loadChildWorkflowSpec.js.map +1 -0
- package/lib/{types/activities → activities}/media/prepareAudio.d.ts +1 -1
- package/lib/activities/media/prepareAudio.d.ts.map +1 -0
- package/lib/{esm/activities → activities}/media/prepareAudio.js +27 -23
- package/lib/activities/media/prepareAudio.js.map +1 -0
- package/lib/{types/activities → activities}/media/prepareVideo.d.ts +2 -2
- package/lib/activities/media/prepareVideo.d.ts.map +1 -0
- package/lib/{esm/activities → activities}/media/prepareVideo.js +72 -54
- package/lib/activities/media/prepareVideo.js.map +1 -0
- package/lib/{types/activities → activities}/media/probeMediaStreams.d.ts +2 -3
- package/lib/activities/media/probeMediaStreams.d.ts.map +1 -0
- package/lib/{esm/activities → activities}/media/probeMediaStreams.js +7 -5
- package/lib/activities/media/probeMediaStreams.js.map +1 -0
- package/lib/{types/activities → activities}/media/processPdfWithTextract.d.ts +3 -3
- package/lib/activities/media/processPdfWithTextract.d.ts.map +1 -0
- package/lib/{esm/activities → activities}/media/processPdfWithTextract.js +43 -26
- package/lib/activities/media/processPdfWithTextract.js.map +1 -0
- package/lib/{types/activities → activities}/media/saveGladiaTranscription.d.ts +2 -2
- package/lib/activities/media/saveGladiaTranscription.d.ts.map +1 -0
- package/lib/{esm/activities → activities}/media/saveGladiaTranscription.js +35 -25
- package/lib/activities/media/saveGladiaTranscription.js.map +1 -0
- package/lib/{types/activities → activities}/media/transcribeMediaWithGladia.d.ts +2 -2
- package/lib/activities/media/transcribeMediaWithGladia.d.ts.map +1 -0
- package/lib/{esm/activities → activities}/media/transcribeMediaWithGladia.js +26 -21
- package/lib/activities/media/transcribeMediaWithGladia.js.map +1 -0
- package/lib/{types/activities → activities}/mergeChildArtifacts.d.ts +1 -1
- package/lib/activities/mergeChildArtifacts.d.ts.map +1 -0
- package/lib/{esm/activities → activities}/mergeChildArtifacts.js +27 -26
- package/lib/activities/mergeChildArtifacts.js.map +1 -0
- package/lib/{types/activities → activities}/notifyWebhook.d.ts +6 -5
- package/lib/activities/notifyWebhook.d.ts.map +1 -0
- package/lib/{esm/activities → activities}/notifyWebhook.js +20 -17
- package/lib/activities/notifyWebhook.js.map +1 -0
- package/lib/{types/activities → activities}/rateLimiter.d.ts +1 -1
- package/lib/activities/rateLimiter.d.ts.map +1 -0
- package/lib/{esm/activities → activities}/rateLimiter.js +4 -3
- package/lib/activities/rateLimiter.js.map +1 -0
- package/lib/{types/activities → activities}/renditions/generateImageRendition.d.ts +3 -3
- package/lib/activities/renditions/generateImageRendition.d.ts.map +1 -0
- package/lib/activities/renditions/generateImageRendition.js +75 -0
- package/lib/activities/renditions/generateImageRendition.js.map +1 -0
- package/lib/{types/activities → activities}/renditions/generateVideoRendition.d.ts +3 -3
- package/lib/activities/renditions/generateVideoRendition.d.ts.map +1 -0
- package/lib/{esm/activities → activities}/renditions/generateVideoRendition.js +51 -54
- package/lib/activities/renditions/generateVideoRendition.js.map +1 -0
- package/lib/{types/activities → activities}/resolveRemoteActivities.d.ts +3 -4
- package/lib/activities/resolveRemoteActivities.d.ts.map +1 -0
- package/lib/{esm/activities → activities}/resolveRemoteActivities.js +16 -15
- package/lib/activities/resolveRemoteActivities.js.map +1 -0
- package/lib/{types/activities → activities}/setDocumentStatus.d.ts +1 -1
- package/lib/activities/setDocumentStatus.d.ts.map +1 -0
- package/lib/{esm/activities → activities}/setDocumentStatus.js +5 -3
- package/lib/activities/setDocumentStatus.js.map +1 -0
- package/lib/{types/bulk-import.d.ts → bulk-import.d.ts} +10 -1
- package/lib/bulk-import.d.ts.map +1 -0
- package/lib/bulk-import.js.map +1 -0
- package/lib/{types/conversion → conversion}/TextractProcessor.d.ts +7 -4
- package/lib/conversion/TextractProcessor.d.ts.map +1 -0
- package/lib/{esm/conversion → conversion}/TextractProcessor.js +38 -38
- package/lib/conversion/TextractProcessor.js.map +1 -0
- package/lib/conversion/image.d.ts.map +1 -0
- package/lib/{esm/conversion → conversion}/image.js +35 -35
- package/lib/conversion/image.js.map +1 -0
- package/lib/conversion/markitdown.d.ts.map +1 -0
- package/lib/{esm/conversion → conversion}/markitdown.js +11 -11
- package/lib/conversion/markitdown.js.map +1 -0
- package/lib/conversion/mutool.d.ts.map +1 -0
- package/lib/{esm/conversion → conversion}/mutool.js +19 -24
- package/lib/conversion/mutool.js.map +1 -0
- package/lib/conversion/pandoc.d.ts.map +1 -0
- package/lib/{esm/conversion → conversion}/pandoc.js +11 -11
- package/lib/conversion/pandoc.js.map +1 -0
- package/lib/dsl/conditions.d.ts +2 -0
- package/lib/dsl/conditions.d.ts.map +1 -0
- package/lib/dsl/conditions.js +90 -0
- package/lib/dsl/conditions.js.map +1 -0
- package/lib/{types/dsl → dsl}/dsl-workflow.d.ts +2 -2
- package/lib/dsl/dsl-workflow.d.ts.map +1 -0
- package/lib/{esm/dsl → dsl}/dsl-workflow.js +93 -65
- package/lib/dsl/dsl-workflow.js.map +1 -0
- package/lib/dsl/dslProxyActivities.d.ts +7 -0
- package/lib/dsl/dslProxyActivities.d.ts.map +1 -0
- package/lib/{esm/dsl → dsl}/dslProxyActivities.js +10 -1
- package/lib/dsl/dslProxyActivities.js.map +1 -0
- package/lib/dsl/projections.d.ts +4 -0
- package/lib/dsl/projections.d.ts.map +1 -0
- package/lib/{esm/dsl → dsl}/projections.js +22 -8
- package/lib/dsl/projections.js.map +1 -0
- package/lib/{types/dsl → dsl}/setup/ActivityContext.d.ts +4 -4
- package/lib/dsl/setup/ActivityContext.d.ts.map +1 -0
- package/lib/{esm/dsl → dsl}/setup/ActivityContext.js +24 -27
- package/lib/dsl/setup/ActivityContext.js.map +1 -0
- package/lib/{types/dsl → dsl}/setup/fetch/DataProvider.d.ts +3 -3
- package/lib/dsl/setup/fetch/DataProvider.d.ts.map +1 -0
- package/lib/{esm/dsl → dsl}/setup/fetch/DataProvider.js +2 -1
- package/lib/dsl/setup/fetch/DataProvider.js.map +1 -0
- package/lib/dsl/setup/fetch/index.d.ts +6 -0
- package/lib/dsl/setup/fetch/index.d.ts.map +1 -0
- package/lib/{esm/dsl → dsl}/setup/fetch/index.js +1 -1
- package/lib/dsl/setup/fetch/index.js.map +1 -0
- package/lib/{types/dsl → dsl}/setup/fetch/providers.d.ts +6 -6
- package/lib/dsl/setup/fetch/providers.d.ts.map +1 -0
- package/lib/{esm/dsl → dsl}/setup/fetch/providers.js +30 -16
- package/lib/dsl/setup/fetch/providers.js.map +1 -0
- package/lib/dsl/test/test-child-workflow.d.ts +4 -0
- package/lib/dsl/test/test-child-workflow.d.ts.map +1 -0
- package/lib/{esm/dsl → dsl}/test/test-child-workflow.js +1 -1
- package/lib/dsl/test/test-child-workflow.js.map +1 -0
- package/lib/{types/dsl → dsl}/validation.d.ts +1 -1
- package/lib/dsl/validation.d.ts.map +1 -0
- package/lib/{esm/dsl → dsl}/validation.js +8 -8
- package/lib/dsl/validation.js.map +1 -0
- package/lib/{types/dsl → dsl}/vars.d.ts +16 -16
- package/lib/dsl/vars.d.ts.map +1 -0
- package/lib/{esm/dsl → dsl}/vars.js +20 -15
- package/lib/dsl/vars.js.map +1 -0
- package/lib/dsl/walk.d.ts +18 -0
- package/lib/dsl/walk.d.ts.map +1 -0
- package/lib/{esm/dsl → dsl}/walk.js +37 -16
- package/lib/dsl/walk.js.map +1 -0
- package/lib/dsl.d.ts +4 -0
- package/lib/dsl.d.ts.map +1 -0
- package/lib/dsl.js +4 -0
- package/lib/dsl.js.map +1 -0
- package/lib/{types/errors.d.ts → errors.d.ts} +2 -2
- package/lib/errors.d.ts.map +1 -0
- package/lib/{esm/errors.js → errors.js} +22 -17
- package/lib/errors.js.map +1 -0
- package/lib/index.d.ts +36 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +37 -0
- package/lib/index.js.map +1 -0
- package/lib/result-types.d.ts.map +1 -0
- package/lib/result-types.js.map +1 -0
- package/lib/security/ssrf.d.ts.map +1 -0
- package/lib/security/ssrf.js.map +1 -0
- package/lib/system/notifyWebhookWorkflow.d.ts +8 -0
- package/lib/system/notifyWebhookWorkflow.d.ts.map +1 -0
- package/lib/{esm/system → system}/notifyWebhookWorkflow.js +13 -12
- package/lib/system/notifyWebhookWorkflow.js.map +1 -0
- package/lib/{types/system → system}/recalculateEmbeddingsWorkflow.d.ts +1 -1
- package/lib/system/recalculateEmbeddingsWorkflow.d.ts.map +1 -0
- package/lib/{esm/system → system}/recalculateEmbeddingsWorkflow.js +7 -7
- package/lib/system/recalculateEmbeddingsWorkflow.js.map +1 -0
- package/lib/utils/activity-info.d.ts +12 -0
- package/lib/utils/activity-info.d.ts.map +1 -0
- package/lib/utils/activity-info.js +15 -0
- package/lib/utils/activity-info.js.map +1 -0
- package/lib/{types/utils → utils}/auth.d.ts +1 -1
- package/lib/utils/auth.d.ts.map +1 -0
- package/lib/utils/auth.js.map +1 -0
- package/lib/{types/utils → utils}/blobs.d.ts +1 -1
- package/lib/utils/blobs.d.ts.map +1 -0
- package/lib/{esm/utils → utils}/blobs.js +17 -16
- package/lib/utils/blobs.js.map +1 -0
- package/lib/utils/chunks.d.ts.map +1 -0
- package/lib/{esm/utils → utils}/chunks.js +1 -1
- package/lib/utils/chunks.js.map +1 -0
- package/lib/utils/client.d.ts +8 -0
- package/lib/utils/client.d.ts.map +1 -0
- package/lib/utils/client.js +57 -0
- package/lib/utils/client.js.map +1 -0
- package/lib/{types/utils → utils}/expand-vars.d.ts +1 -1
- package/lib/utils/expand-vars.d.ts.map +1 -0
- package/lib/{esm/utils → utils}/expand-vars.js +4 -1
- package/lib/utils/expand-vars.js.map +1 -0
- package/lib/{types/utils → utils}/renditions.d.ts +2 -2
- package/lib/utils/renditions.d.ts.map +1 -0
- package/lib/{esm/utils → utils}/renditions.js +29 -18
- package/lib/utils/renditions.js.map +1 -0
- package/lib/{types/utils → utils}/storage.d.ts +2 -2
- package/lib/utils/storage.d.ts.map +1 -0
- package/lib/{esm/utils → utils}/storage.js +13 -12
- package/lib/utils/storage.js.map +1 -0
- package/lib/{types/utils → utils}/text-preview-utils.d.ts +2 -2
- package/lib/utils/text-preview-utils.d.ts.map +1 -0
- package/lib/{esm/utils → utils}/text-preview-utils.js +4 -4
- package/lib/utils/text-preview-utils.js.map +1 -0
- package/lib/{types/utils → utils}/tokens.d.ts +1 -1
- package/lib/utils/tokens.d.ts.map +1 -0
- package/lib/{esm/utils → utils}/tokens.js +3 -3
- package/lib/utils/tokens.js.map +1 -0
- package/lib/vars.d.ts +3 -0
- package/lib/vars.d.ts.map +1 -0
- package/lib/vars.js +4 -0
- package/lib/vars.js.map +1 -0
- package/lib/workflows-bundle.js +6201 -3026
- package/lib/workflows.d.ts +7 -0
- package/lib/workflows.d.ts.map +1 -0
- package/lib/workflows.js +7 -0
- package/lib/workflows.js.map +1 -0
- package/package.json +49 -89
- package/src/activities/advanced/createDocumentTypeFromInteractionRun.ts +30 -17
- package/src/activities/advanced/createOrUpdateDocumentFromInteractionRun.ts +51 -37
- package/src/activities/advanced/updateDocumentFromInteractionRun.ts +12 -11
- package/src/activities/chunkDocument.ts +87 -77
- package/src/activities/createDocumentFromOther.ts +19 -25
- package/src/activities/executeInteraction.test.ts +81 -8
- package/src/activities/executeInteraction.ts +147 -102
- package/src/activities/executeRemoteActivity.test.ts +61 -67
- package/src/activities/executeRemoteActivity.ts +56 -29
- package/src/activities/extractDocumentText.ts +75 -64
- package/src/activities/generateDocumentProperties.ts +69 -50
- package/src/activities/generateEmbeddings.test.ts +114 -0
- package/src/activities/generateEmbeddings.ts +113 -141
- package/src/activities/generateOrAssignContentType.ts +219 -231
- package/src/activities/getObjectFromStore.ts +11 -10
- package/src/activities/handleError.ts +23 -11
- package/src/activities/index-dsl.ts +30 -30
- package/src/activities/index.ts +1 -1
- package/src/activities/loadChildWorkflowSpec.ts +8 -3
- package/src/activities/media/prepareAudio.ts +47 -56
- package/src/activities/media/prepareVideo.ts +107 -122
- package/src/activities/media/probeMediaStreams.test.ts +11 -13
- package/src/activities/media/probeMediaStreams.ts +13 -15
- package/src/activities/media/processPdfWithTextract.ts +65 -46
- package/src/activities/media/saveGladiaTranscription.test.ts +122 -121
- package/src/activities/media/saveGladiaTranscription.ts +52 -26
- package/src/activities/media/transcribeMediaWithGladia.test.ts +173 -165
- package/src/activities/media/transcribeMediaWithGladia.ts +44 -28
- package/src/activities/mergeChildArtifacts.ts +36 -38
- package/src/activities/notifyWebhook.test.ts +223 -217
- package/src/activities/notifyWebhook.ts +67 -40
- package/src/activities/rateLimiter.ts +31 -30
- package/src/activities/renditions/generateImageRendition.ts +54 -64
- package/src/activities/renditions/generateVideoRendition.ts +87 -141
- package/src/activities/resolveRemoteActivities.test.ts +96 -88
- package/src/activities/resolveRemoteActivities.ts +32 -23
- package/src/activities/setDocumentStatus.ts +11 -7
- package/src/bulk-import.ts +11 -5
- package/src/conversion/TextractProcessor.ts +69 -71
- package/src/conversion/image.test.ts +31 -31
- package/src/conversion/image.ts +41 -38
- package/src/conversion/markitdown.ts +11 -11
- package/src/conversion/mutool.test.ts +77 -62
- package/src/conversion/mutool.ts +27 -49
- package/src/conversion/pandoc.test.ts +5 -6
- package/src/conversion/pandoc.ts +11 -11
- package/src/dsl/conditions.ts +35 -17
- package/src/dsl/dsl-workflow.test.ts +49 -39
- package/src/dsl/dsl-workflow.ts +200 -112
- package/src/dsl/dslProxyActivities.test.ts +23 -0
- package/src/dsl/dslProxyActivities.ts +46 -26
- package/src/dsl/ms.d.ts +34 -3
- package/src/dsl/projections.test.ts +108 -100
- package/src/dsl/projections.ts +46 -26
- package/src/dsl/setup/ActivityContext.test.ts +22 -23
- package/src/dsl/setup/ActivityContext.ts +41 -84
- package/src/dsl/setup/fetch/DataProvider.ts +11 -8
- package/src/dsl/setup/fetch/index.ts +6 -8
- package/src/dsl/setup/fetch/providers.ts +38 -24
- package/src/dsl/test/test-child-workflow.ts +3 -2
- package/src/dsl/validation.test.ts +232 -213
- package/src/dsl/validation.ts +17 -12
- package/src/dsl/vars.test.ts +143 -140
- package/src/dsl/vars.ts +61 -54
- package/src/dsl/walk.test.ts +61 -56
- package/src/dsl/walk.ts +61 -35
- package/src/dsl/workflow-exec-child.test.ts +77 -61
- package/src/dsl/workflow-fetch.test.ts +40 -38
- package/src/dsl/workflow-import.test.ts +27 -27
- package/src/dsl/workflow.test.ts +34 -33
- package/src/dsl.ts +3 -4
- package/src/errors.ts +31 -23
- package/src/index.ts +28 -33
- package/src/result-types.ts +6 -9
- package/src/system/notifyWebhookWorkflow.ts +23 -23
- package/src/system/recalculateEmbeddingsWorkflow.ts +14 -17
- package/src/utils/activity-info.ts +15 -0
- package/src/utils/auth.ts +1 -1
- package/src/utils/blobs.ts +19 -18
- package/src/utils/chunks.ts +7 -8
- package/src/utils/client.ts +45 -17
- package/src/utils/expand-vars.ts +9 -6
- package/src/utils/renditions.ts +68 -72
- package/src/utils/storage.ts +18 -22
- package/src/utils/text-preview-utils.ts +9 -19
- package/src/utils/tokens.ts +9 -11
- package/src/vars.ts +2 -2
- package/src/workflows.ts +3 -4
- package/lib/cjs/activities/advanced/createDocumentTypeFromInteractionRun.js +0 -33
- package/lib/cjs/activities/advanced/createDocumentTypeFromInteractionRun.js.map +0 -1
- package/lib/cjs/activities/advanced/createOrUpdateDocumentFromInteractionRun.js +0 -73
- package/lib/cjs/activities/advanced/createOrUpdateDocumentFromInteractionRun.js.map +0 -1
- package/lib/cjs/activities/advanced/updateDocumentFromInteractionRun.js +0 -19
- package/lib/cjs/activities/advanced/updateDocumentFromInteractionRun.js.map +0 -1
- package/lib/cjs/activities/chunkDocument.js +0 -111
- package/lib/cjs/activities/chunkDocument.js.map +0 -1
- package/lib/cjs/activities/createDocumentFromOther.js +0 -64
- package/lib/cjs/activities/createDocumentFromOther.js.map +0 -1
- package/lib/cjs/activities/executeInteraction.js +0 -241
- package/lib/cjs/activities/executeInteraction.js.map +0 -1
- package/lib/cjs/activities/executeRemoteActivity.js +0 -126
- package/lib/cjs/activities/executeRemoteActivity.js.map +0 -1
- package/lib/cjs/activities/extractDocumentText.js +0 -196
- package/lib/cjs/activities/extractDocumentText.js.map +0 -1
- package/lib/cjs/activities/generateDocumentProperties.js +0 -109
- package/lib/cjs/activities/generateDocumentProperties.js.map +0 -1
- package/lib/cjs/activities/generateEmbeddings.js +0 -269
- package/lib/cjs/activities/generateEmbeddings.js.map +0 -1
- package/lib/cjs/activities/generateOrAssignContentType.js +0 -173
- package/lib/cjs/activities/generateOrAssignContentType.js.map +0 -1
- package/lib/cjs/activities/getObjectFromStore.js +0 -31
- package/lib/cjs/activities/getObjectFromStore.js.map +0 -1
- package/lib/cjs/activities/handleError.js +0 -29
- package/lib/cjs/activities/handleError.js.map +0 -1
- package/lib/cjs/activities/index-dsl.js +0 -59
- package/lib/cjs/activities/index-dsl.js.map +0 -1
- package/lib/cjs/activities/index.js +0 -21
- package/lib/cjs/activities/index.js.map +0 -1
- package/lib/cjs/activities/loadChildWorkflowSpec.js +0 -15
- package/lib/cjs/activities/loadChildWorkflowSpec.js.map +0 -1
- package/lib/cjs/activities/media/prepareAudio.js +0 -240
- package/lib/cjs/activities/media/prepareAudio.js.map +0 -1
- package/lib/cjs/activities/media/prepareVideo.js +0 -432
- package/lib/cjs/activities/media/prepareVideo.js.map +0 -1
- package/lib/cjs/activities/media/probeMediaStreams.js +0 -49
- package/lib/cjs/activities/media/probeMediaStreams.js.map +0 -1
- package/lib/cjs/activities/media/processPdfWithTextract.js +0 -103
- package/lib/cjs/activities/media/processPdfWithTextract.js.map +0 -1
- package/lib/cjs/activities/media/saveGladiaTranscription.js +0 -103
- package/lib/cjs/activities/media/saveGladiaTranscription.js.map +0 -1
- package/lib/cjs/activities/media/transcribeMediaWithGladia.js +0 -107
- package/lib/cjs/activities/media/transcribeMediaWithGladia.js.map +0 -1
- package/lib/cjs/activities/mergeChildArtifacts.js +0 -150
- package/lib/cjs/activities/mergeChildArtifacts.js.map +0 -1
- package/lib/cjs/activities/notifyWebhook.js +0 -167
- package/lib/cjs/activities/notifyWebhook.js.map +0 -1
- package/lib/cjs/activities/rateLimiter.js +0 -30
- package/lib/cjs/activities/rateLimiter.js.map +0 -1
- package/lib/cjs/activities/renditions/generateImageRendition.js +0 -66
- package/lib/cjs/activities/renditions/generateImageRendition.js.map +0 -1
- package/lib/cjs/activities/renditions/generateVideoRendition.js +0 -200
- package/lib/cjs/activities/renditions/generateVideoRendition.js.map +0 -1
- package/lib/cjs/activities/resolveRemoteActivities.js +0 -133
- package/lib/cjs/activities/resolveRemoteActivities.js.map +0 -1
- package/lib/cjs/activities/setDocumentStatus.js +0 -26
- package/lib/cjs/activities/setDocumentStatus.js.map +0 -1
- package/lib/cjs/bulk-import.js +0 -12
- package/lib/cjs/bulk-import.js.map +0 -1
- package/lib/cjs/conversion/TextractProcessor.js +0 -417
- package/lib/cjs/conversion/TextractProcessor.js.map +0 -1
- package/lib/cjs/conversion/image.js +0 -149
- package/lib/cjs/conversion/image.js.map +0 -1
- package/lib/cjs/conversion/markitdown.js +0 -42
- package/lib/cjs/conversion/markitdown.js.map +0 -1
- package/lib/cjs/conversion/mutool.js +0 -147
- package/lib/cjs/conversion/mutool.js.map +0 -1
- package/lib/cjs/conversion/pandoc.js +0 -39
- package/lib/cjs/conversion/pandoc.js.map +0 -1
- package/lib/cjs/dsl/conditions.js +0 -81
- package/lib/cjs/dsl/conditions.js.map +0 -1
- package/lib/cjs/dsl/dsl-workflow.js +0 -458
- package/lib/cjs/dsl/dsl-workflow.js.map +0 -1
- package/lib/cjs/dsl/dslProxyActivities.js +0 -23
- package/lib/cjs/dsl/dslProxyActivities.js.map +0 -1
- package/lib/cjs/dsl/projections.js +0 -59
- package/lib/cjs/dsl/projections.js.map +0 -1
- package/lib/cjs/dsl/setup/ActivityContext.js +0 -188
- package/lib/cjs/dsl/setup/ActivityContext.js.map +0 -1
- package/lib/cjs/dsl/setup/fetch/DataProvider.js +0 -51
- package/lib/cjs/dsl/setup/fetch/DataProvider.js.map +0 -1
- package/lib/cjs/dsl/setup/fetch/index.js +0 -16
- package/lib/cjs/dsl/setup/fetch/index.js.map +0 -1
- package/lib/cjs/dsl/setup/fetch/providers.js +0 -67
- package/lib/cjs/dsl/setup/fetch/providers.js.map +0 -1
- package/lib/cjs/dsl/test/test-child-workflow.js +0 -10
- package/lib/cjs/dsl/test/test-child-workflow.js.map +0 -1
- package/lib/cjs/dsl/validation.js +0 -122
- package/lib/cjs/dsl/validation.js.map +0 -1
- package/lib/cjs/dsl/vars.js +0 -341
- package/lib/cjs/dsl/vars.js.map +0 -1
- package/lib/cjs/dsl/walk.js +0 -100
- package/lib/cjs/dsl/walk.js.map +0 -1
- package/lib/cjs/dsl.js +0 -20
- package/lib/cjs/dsl.js.map +0 -1
- package/lib/cjs/errors.js +0 -89
- package/lib/cjs/errors.js.map +0 -1
- package/lib/cjs/index.js +0 -57
- package/lib/cjs/index.js.map +0 -1
- package/lib/cjs/iterative-generation/activities/extractToc.js +0 -47
- package/lib/cjs/iterative-generation/activities/extractToc.js.map +0 -1
- package/lib/cjs/iterative-generation/activities/finalizeOutput.js +0 -72
- package/lib/cjs/iterative-generation/activities/finalizeOutput.js.map +0 -1
- package/lib/cjs/iterative-generation/activities/generatePart.js +0 -78
- package/lib/cjs/iterative-generation/activities/generatePart.js.map +0 -1
- package/lib/cjs/iterative-generation/activities/generateToc.js +0 -86
- package/lib/cjs/iterative-generation/activities/generateToc.js.map +0 -1
- package/lib/cjs/iterative-generation/activities/index.js +0 -12
- package/lib/cjs/iterative-generation/activities/index.js.map +0 -1
- package/lib/cjs/iterative-generation/iterativeGenerationWorkflow.js +0 -56
- package/lib/cjs/iterative-generation/iterativeGenerationWorkflow.js.map +0 -1
- package/lib/cjs/iterative-generation/types.js +0 -5
- package/lib/cjs/iterative-generation/types.js.map +0 -1
- package/lib/cjs/iterative-generation/utils.js +0 -121
- package/lib/cjs/iterative-generation/utils.js.map +0 -1
- package/lib/cjs/package.json +0 -3
- package/lib/cjs/result-types.js +0 -10
- package/lib/cjs/result-types.js.map +0 -1
- package/lib/cjs/security/ssrf.js +0 -34
- package/lib/cjs/security/ssrf.js.map +0 -1
- package/lib/cjs/system/notifyWebhookWorkflow.js +0 -53
- package/lib/cjs/system/notifyWebhookWorkflow.js.map +0 -1
- package/lib/cjs/system/recalculateEmbeddingsWorkflow.js +0 -33
- package/lib/cjs/system/recalculateEmbeddingsWorkflow.js.map +0 -1
- package/lib/cjs/utils/auth.js +0 -15
- package/lib/cjs/utils/auth.js.map +0 -1
- package/lib/cjs/utils/blobs.js +0 -64
- package/lib/cjs/utils/blobs.js.map +0 -1
- package/lib/cjs/utils/chunks.js +0 -14
- package/lib/cjs/utils/chunks.js.map +0 -1
- package/lib/cjs/utils/client.js +0 -31
- package/lib/cjs/utils/client.js.map +0 -1
- package/lib/cjs/utils/expand-vars.js +0 -33
- package/lib/cjs/utils/expand-vars.js.map +0 -1
- package/lib/cjs/utils/memory.js +0 -65
- package/lib/cjs/utils/memory.js.map +0 -1
- package/lib/cjs/utils/renditions.js +0 -92
- package/lib/cjs/utils/renditions.js.map +0 -1
- package/lib/cjs/utils/storage.js +0 -54
- package/lib/cjs/utils/storage.js.map +0 -1
- package/lib/cjs/utils/text-preview-utils.js +0 -43
- package/lib/cjs/utils/text-preview-utils.js.map +0 -1
- package/lib/cjs/utils/tokens.js +0 -38
- package/lib/cjs/utils/tokens.js.map +0 -1
- package/lib/cjs/vars.js +0 -20
- package/lib/cjs/vars.js.map +0 -1
- package/lib/cjs/workflows.js +0 -15
- package/lib/cjs/workflows.js.map +0 -1
- package/lib/esm/activities/advanced/createDocumentTypeFromInteractionRun.js.map +0 -1
- package/lib/esm/activities/advanced/createOrUpdateDocumentFromInteractionRun.js.map +0 -1
- package/lib/esm/activities/advanced/updateDocumentFromInteractionRun.js +0 -16
- package/lib/esm/activities/advanced/updateDocumentFromInteractionRun.js.map +0 -1
- package/lib/esm/activities/chunkDocument.js.map +0 -1
- package/lib/esm/activities/createDocumentFromOther.js.map +0 -1
- package/lib/esm/activities/executeInteraction.js.map +0 -1
- package/lib/esm/activities/executeRemoteActivity.js.map +0 -1
- package/lib/esm/activities/extractDocumentText.js.map +0 -1
- package/lib/esm/activities/generateDocumentProperties.js.map +0 -1
- package/lib/esm/activities/generateEmbeddings.js.map +0 -1
- package/lib/esm/activities/generateOrAssignContentType.js.map +0 -1
- package/lib/esm/activities/getObjectFromStore.js.map +0 -1
- package/lib/esm/activities/handleError.js +0 -26
- package/lib/esm/activities/handleError.js.map +0 -1
- package/lib/esm/activities/index-dsl.js +0 -29
- package/lib/esm/activities/index-dsl.js.map +0 -1
- package/lib/esm/activities/index.js.map +0 -1
- package/lib/esm/activities/loadChildWorkflowSpec.js.map +0 -1
- package/lib/esm/activities/media/prepareAudio.js.map +0 -1
- package/lib/esm/activities/media/prepareVideo.js.map +0 -1
- package/lib/esm/activities/media/probeMediaStreams.js.map +0 -1
- package/lib/esm/activities/media/processPdfWithTextract.js.map +0 -1
- package/lib/esm/activities/media/saveGladiaTranscription.js.map +0 -1
- package/lib/esm/activities/media/transcribeMediaWithGladia.js.map +0 -1
- package/lib/esm/activities/mergeChildArtifacts.js.map +0 -1
- package/lib/esm/activities/notifyWebhook.js.map +0 -1
- package/lib/esm/activities/rateLimiter.js.map +0 -1
- package/lib/esm/activities/renditions/generateImageRendition.js +0 -63
- package/lib/esm/activities/renditions/generateImageRendition.js.map +0 -1
- package/lib/esm/activities/renditions/generateVideoRendition.js.map +0 -1
- package/lib/esm/activities/resolveRemoteActivities.js.map +0 -1
- package/lib/esm/activities/setDocumentStatus.js.map +0 -1
- package/lib/esm/bulk-import.js.map +0 -1
- package/lib/esm/conversion/TextractProcessor.js.map +0 -1
- package/lib/esm/conversion/image.js.map +0 -1
- package/lib/esm/conversion/markitdown.js.map +0 -1
- package/lib/esm/conversion/mutool.js.map +0 -1
- package/lib/esm/conversion/pandoc.js.map +0 -1
- package/lib/esm/dsl/conditions.js +0 -75
- package/lib/esm/dsl/conditions.js.map +0 -1
- package/lib/esm/dsl/dsl-workflow.js.map +0 -1
- package/lib/esm/dsl/dslProxyActivities.js.map +0 -1
- package/lib/esm/dsl/projections.js.map +0 -1
- package/lib/esm/dsl/setup/ActivityContext.js.map +0 -1
- package/lib/esm/dsl/setup/fetch/DataProvider.js.map +0 -1
- package/lib/esm/dsl/setup/fetch/index.js.map +0 -1
- package/lib/esm/dsl/setup/fetch/providers.js.map +0 -1
- package/lib/esm/dsl/test/test-child-workflow.js.map +0 -1
- package/lib/esm/dsl/validation.js.map +0 -1
- package/lib/esm/dsl/vars.js.map +0 -1
- package/lib/esm/dsl/walk.js.map +0 -1
- package/lib/esm/dsl.js +0 -4
- package/lib/esm/dsl.js.map +0 -1
- package/lib/esm/errors.js.map +0 -1
- package/lib/esm/index.js +0 -39
- package/lib/esm/index.js.map +0 -1
- package/lib/esm/iterative-generation/activities/extractToc.js +0 -44
- package/lib/esm/iterative-generation/activities/extractToc.js.map +0 -1
- package/lib/esm/iterative-generation/activities/finalizeOutput.js +0 -69
- package/lib/esm/iterative-generation/activities/finalizeOutput.js.map +0 -1
- package/lib/esm/iterative-generation/activities/generatePart.js +0 -75
- package/lib/esm/iterative-generation/activities/generatePart.js.map +0 -1
- package/lib/esm/iterative-generation/activities/generateToc.js +0 -83
- package/lib/esm/iterative-generation/activities/generateToc.js.map +0 -1
- package/lib/esm/iterative-generation/activities/index.js +0 -5
- package/lib/esm/iterative-generation/activities/index.js.map +0 -1
- package/lib/esm/iterative-generation/iterativeGenerationWorkflow.js +0 -53
- package/lib/esm/iterative-generation/iterativeGenerationWorkflow.js.map +0 -1
- package/lib/esm/iterative-generation/types.js +0 -2
- package/lib/esm/iterative-generation/types.js.map +0 -1
- package/lib/esm/iterative-generation/utils.js +0 -112
- package/lib/esm/iterative-generation/utils.js.map +0 -1
- package/lib/esm/result-types.js.map +0 -1
- package/lib/esm/security/ssrf.js.map +0 -1
- package/lib/esm/system/notifyWebhookWorkflow.js.map +0 -1
- package/lib/esm/system/recalculateEmbeddingsWorkflow.js.map +0 -1
- package/lib/esm/utils/auth.js.map +0 -1
- package/lib/esm/utils/blobs.js.map +0 -1
- package/lib/esm/utils/chunks.js.map +0 -1
- package/lib/esm/utils/client.js +0 -27
- package/lib/esm/utils/client.js.map +0 -1
- package/lib/esm/utils/expand-vars.js.map +0 -1
- package/lib/esm/utils/memory.js +0 -55
- package/lib/esm/utils/memory.js.map +0 -1
- package/lib/esm/utils/renditions.js.map +0 -1
- package/lib/esm/utils/storage.js.map +0 -1
- package/lib/esm/utils/text-preview-utils.js.map +0 -1
- package/lib/esm/utils/tokens.js.map +0 -1
- package/lib/esm/vars.js +0 -4
- package/lib/esm/vars.js.map +0 -1
- package/lib/esm/workflows.js +0 -8
- package/lib/esm/workflows.js.map +0 -1
- package/lib/tsconfig.tsbuildinfo +0 -1
- package/lib/types/activities/advanced/createDocumentTypeFromInteractionRun.d.ts.map +0 -1
- package/lib/types/activities/advanced/createOrUpdateDocumentFromInteractionRun.d.ts.map +0 -1
- package/lib/types/activities/advanced/updateDocumentFromInteractionRun.d.ts.map +0 -1
- package/lib/types/activities/chunkDocument.d.ts.map +0 -1
- package/lib/types/activities/createDocumentFromOther.d.ts.map +0 -1
- package/lib/types/activities/executeInteraction.d.ts.map +0 -1
- package/lib/types/activities/executeRemoteActivity.d.ts.map +0 -1
- package/lib/types/activities/extractDocumentText.d.ts.map +0 -1
- package/lib/types/activities/generateDocumentProperties.d.ts.map +0 -1
- package/lib/types/activities/generateEmbeddings.d.ts.map +0 -1
- package/lib/types/activities/generateOrAssignContentType.d.ts.map +0 -1
- package/lib/types/activities/getObjectFromStore.d.ts.map +0 -1
- package/lib/types/activities/handleError.d.ts.map +0 -1
- package/lib/types/activities/index-dsl.d.ts +0 -31
- package/lib/types/activities/index-dsl.d.ts.map +0 -1
- package/lib/types/activities/index.d.ts.map +0 -1
- package/lib/types/activities/loadChildWorkflowSpec.d.ts.map +0 -1
- package/lib/types/activities/media/prepareAudio.d.ts.map +0 -1
- package/lib/types/activities/media/prepareVideo.d.ts.map +0 -1
- package/lib/types/activities/media/probeMediaStreams.d.ts.map +0 -1
- package/lib/types/activities/media/processPdfWithTextract.d.ts.map +0 -1
- package/lib/types/activities/media/saveGladiaTranscription.d.ts.map +0 -1
- package/lib/types/activities/media/transcribeMediaWithGladia.d.ts.map +0 -1
- package/lib/types/activities/mergeChildArtifacts.d.ts.map +0 -1
- package/lib/types/activities/notifyWebhook.d.ts.map +0 -1
- package/lib/types/activities/rateLimiter.d.ts.map +0 -1
- package/lib/types/activities/renditions/generateImageRendition.d.ts.map +0 -1
- package/lib/types/activities/renditions/generateVideoRendition.d.ts.map +0 -1
- package/lib/types/activities/resolveRemoteActivities.d.ts.map +0 -1
- package/lib/types/activities/setDocumentStatus.d.ts.map +0 -1
- package/lib/types/bulk-import.d.ts.map +0 -1
- package/lib/types/conversion/TextractProcessor.d.ts.map +0 -1
- package/lib/types/conversion/image.d.ts.map +0 -1
- package/lib/types/conversion/markitdown.d.ts.map +0 -1
- package/lib/types/conversion/mutool.d.ts.map +0 -1
- package/lib/types/conversion/pandoc.d.ts.map +0 -1
- package/lib/types/dsl/conditions.d.ts +0 -2
- package/lib/types/dsl/conditions.d.ts.map +0 -1
- package/lib/types/dsl/dsl-workflow.d.ts.map +0 -1
- package/lib/types/dsl/dslProxyActivities.d.ts +0 -10
- package/lib/types/dsl/dslProxyActivities.d.ts.map +0 -1
- package/lib/types/dsl/projections.d.ts +0 -4
- package/lib/types/dsl/projections.d.ts.map +0 -1
- package/lib/types/dsl/setup/ActivityContext.d.ts.map +0 -1
- package/lib/types/dsl/setup/fetch/DataProvider.d.ts.map +0 -1
- package/lib/types/dsl/setup/fetch/index.d.ts +0 -6
- package/lib/types/dsl/setup/fetch/index.d.ts.map +0 -1
- package/lib/types/dsl/setup/fetch/providers.d.ts.map +0 -1
- package/lib/types/dsl/test/test-child-workflow.d.ts +0 -4
- package/lib/types/dsl/test/test-child-workflow.d.ts.map +0 -1
- package/lib/types/dsl/validation.d.ts.map +0 -1
- package/lib/types/dsl/vars.d.ts.map +0 -1
- package/lib/types/dsl/walk.d.ts +0 -18
- package/lib/types/dsl/walk.d.ts.map +0 -1
- package/lib/types/dsl.d.ts +0 -4
- package/lib/types/dsl.d.ts.map +0 -1
- package/lib/types/errors.d.ts.map +0 -1
- package/lib/types/index.d.ts +0 -38
- package/lib/types/index.d.ts.map +0 -1
- package/lib/types/iterative-generation/activities/extractToc.d.ts +0 -10
- package/lib/types/iterative-generation/activities/extractToc.d.ts.map +0 -1
- package/lib/types/iterative-generation/activities/finalizeOutput.d.ts +0 -3
- package/lib/types/iterative-generation/activities/finalizeOutput.d.ts.map +0 -1
- package/lib/types/iterative-generation/activities/generatePart.d.ts +0 -3
- package/lib/types/iterative-generation/activities/generatePart.d.ts.map +0 -1
- package/lib/types/iterative-generation/activities/generateToc.d.ts +0 -4
- package/lib/types/iterative-generation/activities/generateToc.d.ts.map +0 -1
- package/lib/types/iterative-generation/activities/index.d.ts +0 -5
- package/lib/types/iterative-generation/activities/index.d.ts.map +0 -1
- package/lib/types/iterative-generation/iterativeGenerationWorkflow.d.ts +0 -3
- package/lib/types/iterative-generation/iterativeGenerationWorkflow.d.ts.map +0 -1
- package/lib/types/iterative-generation/types.d.ts +0 -79
- package/lib/types/iterative-generation/types.d.ts.map +0 -1
- package/lib/types/iterative-generation/utils.d.ts +0 -26
- package/lib/types/iterative-generation/utils.d.ts.map +0 -1
- package/lib/types/result-types.d.ts.map +0 -1
- package/lib/types/security/ssrf.d.ts.map +0 -1
- package/lib/types/system/notifyWebhookWorkflow.d.ts +0 -8
- package/lib/types/system/notifyWebhookWorkflow.d.ts.map +0 -1
- package/lib/types/system/recalculateEmbeddingsWorkflow.d.ts.map +0 -1
- package/lib/types/utils/auth.d.ts.map +0 -1
- package/lib/types/utils/blobs.d.ts.map +0 -1
- package/lib/types/utils/chunks.d.ts.map +0 -1
- package/lib/types/utils/client.d.ts +0 -8
- package/lib/types/utils/client.d.ts.map +0 -1
- package/lib/types/utils/expand-vars.d.ts.map +0 -1
- package/lib/types/utils/memory.d.ts +0 -8
- package/lib/types/utils/memory.d.ts.map +0 -1
- package/lib/types/utils/renditions.d.ts.map +0 -1
- package/lib/types/utils/storage.d.ts.map +0 -1
- package/lib/types/utils/text-preview-utils.d.ts.map +0 -1
- package/lib/types/utils/tokens.d.ts.map +0 -1
- package/lib/types/vars.d.ts +0 -3
- package/lib/types/vars.d.ts.map +0 -1
- package/lib/types/workflows.d.ts +0 -8
- package/lib/types/workflows.d.ts.map +0 -1
- package/src/iterative-generation/activities/extractToc.ts +0 -63
- package/src/iterative-generation/activities/finalizeOutput.ts +0 -100
- package/src/iterative-generation/activities/generatePart.ts +0 -123
- package/src/iterative-generation/activities/generateToc.ts +0 -116
- package/src/iterative-generation/activities/index.ts +0 -4
- package/src/iterative-generation/iterativeGenerationWorkflow.ts +0 -68
- package/src/iterative-generation/types.ts +0 -99
- package/src/iterative-generation/utils.ts +0 -126
- package/src/utils/memory.ts +0 -61
- /package/lib/{esm/bulk-import.js → bulk-import.js} +0 -0
- /package/lib/{types/conversion → conversion}/image.d.ts +0 -0
- /package/lib/{types/conversion → conversion}/markitdown.d.ts +0 -0
- /package/lib/{types/conversion → conversion}/mutool.d.ts +0 -0
- /package/lib/{types/conversion → conversion}/pandoc.d.ts +0 -0
- /package/lib/{types/result-types.d.ts → result-types.d.ts} +0 -0
- /package/lib/{esm/result-types.js → result-types.js} +0 -0
- /package/lib/{types/security → security}/ssrf.d.ts +0 -0
- /package/lib/{esm/security → security}/ssrf.js +0 -0
- /package/lib/{esm/utils → utils}/auth.js +0 -0
- /package/lib/{types/utils → utils}/chunks.d.ts +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../../../src/utils/auth.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAGhE,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG,gBAAgB,CAE/D;AAED,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,MAAM,GAAG,UAAU,GAAG,SAAS,CAEzE"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"blobs.d.ts","sourceRoot":"","sources":["../../../src/utils/blobs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAUlD,wBAAsB,iBAAiB,CAAC,MAAM,EAAE,cAAc,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC,UAAU,CAAC,CAAC,CAapH;AACD,wBAAsB,iBAAiB,CAAC,MAAM,EAAE,cAAc,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAOhG;AAED,wBAAsB,iBAAiB,CAAC,MAAM,EAAE,cAAc,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAGhG;AAWD,wBAAsB,kBAAkB,CAAC,MAAM,EAAE,cAAc,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAOnH;AAED,wBAAgB,GAAG,CAAC,QAAQ,EAAE,MAAM,UAEnC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"chunks.d.ts","sourceRoot":"","sources":["../../../src/utils/chunks.ts"],"names":[],"mappings":"AACA,MAAM,WAAW,OAAO;IACpB,iBAAiB,EAAE,MAAM,CAAA;IACzB,eAAe,EAAE,MAAM,CAAA;IACvB,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,MAAM,CAAA;CACf;AAED,eAAO,MAAM,cAAc,GAAI,SAAS,MAAM,EAAE,MAAM,OAAO,KAAG,MAI/D,CAAA;AAED,eAAO,MAAM,eAAe,GAAI,SAAS,MAAM,EAAE,OAAO,OAAO,EAAE,KAAG,MAAM,EAEzE,CAAA"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* get a zeno client for a given token
|
|
3
|
-
*/
|
|
4
|
-
import { VertesiaClient, VertesiaClientProps } from "@vertesia/client";
|
|
5
|
-
import { WorkflowExecutionBaseParams } from "@vertesia/common";
|
|
6
|
-
export declare function getVertesiaClient(payload: WorkflowExecutionBaseParams): VertesiaClient;
|
|
7
|
-
export declare function getVertesiaClientOptions(payload: WorkflowExecutionBaseParams): VertesiaClientProps;
|
|
8
|
-
//# sourceMappingURL=client.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../../src/utils/client.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAEH,cAAc,EACd,mBAAmB,EACtB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,2BAA2B,EAAE,MAAM,kBAAkB,CAAC;AAG/D,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,2BAA2B,kBAErE;AAED,wBAAgB,wBAAwB,CACpC,OAAO,EAAE,2BAA2B,GACrC,mBAAmB,CA2BrB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"expand-vars.d.ts","sourceRoot":"","sources":["../../../src/utils/expand-vars.ts"],"names":[],"mappings":"AAGA;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,UAUjE"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { VertesiaClient } from "@vertesia/client";
|
|
2
|
-
import { Commands, MemoryPack } from "@vertesia/memory";
|
|
3
|
-
export declare function publishMemoryPack(client: VertesiaClient, file: string, name: string): Promise<void>;
|
|
4
|
-
export declare function buildMemoryPack(recipeFn: (commands: Commands) => Promise<Record<string, any>>): Promise<string>;
|
|
5
|
-
export declare function buildAndPublishMemoryPack(client: VertesiaClient, name: string, recipeFn: (commands: Commands) => Promise<Record<string, any>>): Promise<void>;
|
|
6
|
-
export declare function fetchMemoryPack(client: VertesiaClient, name: string): Promise<string>;
|
|
7
|
-
export declare function loadMemoryPack(client: VertesiaClient, name: string): Promise<MemoryPack>;
|
|
8
|
-
//# sourceMappingURL=memory.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"memory.d.ts","sourceRoot":"","sources":["../../../src/utils/memory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD,OAAO,EAAE,QAAQ,EAAE,UAAU,EAA0E,MAAM,kBAAkB,CAAC;AAYhI,wBAAsB,iBAAiB,CAAC,MAAM,EAAE,cAAc,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CASzG;AAED,wBAAsB,eAAe,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE,QAAQ,KAAK,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC,CASrH;AAED,wBAAsB,yBAAyB,CAAC,MAAM,EAAE,cAAc,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,QAAQ,EAAE,QAAQ,KAAK,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAOnK;AAED,wBAAsB,eAAe,CAAC,MAAM,EAAE,cAAc,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAW3F;AAED,wBAAgB,cAAc,CAAC,MAAM,EAAE,cAAc,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC,CAExF"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"renditions.d.ts","sourceRoot":"","sources":["../../../src/utils/renditions.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD,OAAO,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAKxD,MAAM,WAAW,oBAAoB;IACjC,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,oBAAoB,CAAC;IAC7B,6FAA6F;IAC7F,UAAU,CAAC,EAAE,MAAM,CAAC;CACvB;AAED;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAC7B,WAAW,EAAE,MAAM,EACnB,MAAM,EAAE,oBAAoB,UAI/B;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAChC,WAAW,EAAE,MAAM,EACnB,MAAM,EAAE,oBAAoB,EAC5B,UAAU,GAAE,MAAM,GAAG,MAAU,UASlC;AAED;;GAEG;AACH,wBAAsB,oBAAoB,CACtC,MAAM,EAAE,cAAc,EACtB,WAAW,EAAE,MAAM,EACnB,KAAK,EAAE,MAAM,EAAE,EACf,MAAM,EAAE,oBAAoB,EAC5B,WAAW,CAAC,EAAE,MAAM,qBA6EvB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"storage.d.ts","sourceRoot":"","sources":["../../../src/utils/storage.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAGlD,OAAO,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAKlC,eAAO,MAAM,gBAAgB,GAAI,OAAO,MAAM,WAAsB,CAAC;AAErE;;;;;;;;;GASG;AACH,wBAAsB,iBAAiB,CACnC,MAAM,EAAE,cAAc,EACtB,IAAI,EAAE,MAAM,EACZ,WAAW,EAAE,QAAQ,EACrB,QAAQ,GAAE,MAA2B,EACrC,SAAS,CAAC,EAAE,MAAM,mBA2BrB;AAED,wBAAsB,kBAAkB,CAAC,MAAM,EAAE,cAAc,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM,oCAIhG"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"text-preview-utils.d.ts","sourceRoot":"","sources":["../../../src/utils/text-preview-utils.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAGlD,OAAO,EAAE,oBAAoB,EAAwB,MAAM,oBAAoB,CAAC;AAEhF;;GAEG;AACH,wBAAsB,0BAA0B,CAC5C,QAAQ,EAAE,cAAc,EACxB,IAAI,EAAE,MAAM,EACZ,WAAW,EAAE,MAAM,EACnB,QAAQ,EAAE,MAAM,GACjB,OAAO,CAAC,MAAM,CAAC,CAajB;AAED;;GAEG;AACH,wBAAgB,sBAAsB,CAClC,SAAS,EAAE,MAAM,EACjB,WAAW,EAAE,MAAM,EACnB,IAAI,EAAE,MAAM,GAAG,IAAI,GACpB,oBAAoB,CAStB;AAED;;GAEG;AACH,wBAAsB,gBAAgB,CAClC,QAAQ,EAAE,cAAc,EACxB,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,MAAM,GACb,OAAO,CAAC,IAAI,CAAC,CAOf"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"tokens.d.ts","sourceRoot":"","sources":["../../../src/utils/tokens.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAgB,MAAM,UAAU,CAAC;AAG1D,MAAM,MAAM,YAAY,GAAG,MAAM,GAAG;IAChC,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,gBAAgB,CAAC;CAC/B,CAAA;AAED,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE,EAAE,YAAY,UAkBjE;AAED,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,GAAE,gBAAgC;;;EAcnF"}
|
package/lib/types/vars.d.ts
DELETED
package/lib/types/vars.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"vars.d.ts","sourceRoot":"","sources":["../../src/vars.ts"],"names":[],"mappings":"AACA,cAAc,qBAAqB,CAAC;AACpC,cAAc,eAAe,CAAC"}
|
package/lib/types/workflows.d.ts
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Export workflows to be registered on temporal workers
|
|
3
|
-
*/
|
|
4
|
-
export { dslWorkflow } from "./dsl/dsl-workflow.js";
|
|
5
|
-
export { iterativeGenerationWorkflow } from "./iterative-generation/iterativeGenerationWorkflow.js";
|
|
6
|
-
export { notifyWebhookWorkflow } from "./system/notifyWebhookWorkflow.js";
|
|
7
|
-
export { recalculateEmbeddingsWorkflow } from "./system/recalculateEmbeddingsWorkflow.js";
|
|
8
|
-
//# sourceMappingURL=workflows.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"workflows.d.ts","sourceRoot":"","sources":["../../src/workflows.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,2BAA2B,EAAE,MAAM,uDAAuD,CAAC;AACpG,OAAO,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAC;AAC1E,OAAO,EAAE,6BAA6B,EAAE,MAAM,2CAA2C,CAAC"}
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
import { log } from "@temporalio/activity";
|
|
2
|
-
import { WorkflowExecutionPayload } from "@vertesia/common";
|
|
3
|
-
import { parse as parseYaml } from "yaml";
|
|
4
|
-
import { getVertesiaClient } from "../../utils/client.js";
|
|
5
|
-
import {
|
|
6
|
-
buildAndPublishMemoryPack,
|
|
7
|
-
loadMemoryPack,
|
|
8
|
-
} from "../../utils/memory.js";
|
|
9
|
-
import {
|
|
10
|
-
IterativeGenerationPayload,
|
|
11
|
-
OutputMemoryMeta,
|
|
12
|
-
Toc,
|
|
13
|
-
TocIndex,
|
|
14
|
-
} from "../types.js";
|
|
15
|
-
import { tocIndex } from "../utils.js";
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* This activity is called if the toc was provided in the payload. Otherwise
|
|
19
|
-
* the generateToc is called.
|
|
20
|
-
*
|
|
21
|
-
* @param payload
|
|
22
|
-
*/
|
|
23
|
-
export async function it_gen_extractToc(
|
|
24
|
-
payload: WorkflowExecutionPayload,
|
|
25
|
-
): Promise<TocIndex | null> {
|
|
26
|
-
const vars = payload.vars as IterativeGenerationPayload;
|
|
27
|
-
const memory = vars.memory;
|
|
28
|
-
const client = await getVertesiaClient(payload);
|
|
29
|
-
|
|
30
|
-
const inMemory = await loadMemoryPack(client, `${memory}/input`);
|
|
31
|
-
let tocJson: string | null = null;
|
|
32
|
-
let tocYaml: string | null = null;
|
|
33
|
-
let toc: any;
|
|
34
|
-
tocJson = await inMemory.getEntryText("toc.json");
|
|
35
|
-
if (!tocJson) {
|
|
36
|
-
tocYaml = await inMemory.getEntryText("toc.yaml");
|
|
37
|
-
if (tocYaml) {
|
|
38
|
-
toc = parseYaml(tocYaml) as Toc;
|
|
39
|
-
}
|
|
40
|
-
} else {
|
|
41
|
-
toc = JSON.parse(tocJson) as Toc;
|
|
42
|
-
}
|
|
43
|
-
if (!toc) {
|
|
44
|
-
log.info(`Nothing to extract: no TOC found in the input memory pack.`);
|
|
45
|
-
return null; // no toc found
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
log.info(`Found a TOC in the input memory pack`);
|
|
49
|
-
|
|
50
|
-
await buildAndPublishMemoryPack(
|
|
51
|
-
client,
|
|
52
|
-
`${vars.memory}/output`,
|
|
53
|
-
async () => {
|
|
54
|
-
return {
|
|
55
|
-
toc,
|
|
56
|
-
lastProcessedPart: undefined, // the part index (a number array)
|
|
57
|
-
previouslyGenerated: "",
|
|
58
|
-
} as OutputMemoryMeta;
|
|
59
|
-
},
|
|
60
|
-
);
|
|
61
|
-
|
|
62
|
-
return tocIndex(toc);
|
|
63
|
-
}
|
|
@@ -1,100 +0,0 @@
|
|
|
1
|
-
import { log } from "@temporalio/activity";
|
|
2
|
-
import { WorkflowExecutionPayload } from "@vertesia/common";
|
|
3
|
-
import { getVertesiaClient } from "../../utils/client.js";
|
|
4
|
-
import { expandVars } from "../../utils/expand-vars.js";
|
|
5
|
-
import {
|
|
6
|
-
buildAndPublishMemoryPack,
|
|
7
|
-
loadMemoryPack,
|
|
8
|
-
} from "../../utils/memory.js";
|
|
9
|
-
import {
|
|
10
|
-
IterativeGenerationPayload,
|
|
11
|
-
Section,
|
|
12
|
-
SECTION_ID_PLACEHOLDER,
|
|
13
|
-
TocSection,
|
|
14
|
-
} from "../types.js";
|
|
15
|
-
|
|
16
|
-
export async function it_gen_finalizeOutput(
|
|
17
|
-
payload: WorkflowExecutionPayload,
|
|
18
|
-
): Promise<string> {
|
|
19
|
-
const vars = payload.vars as IterativeGenerationPayload;
|
|
20
|
-
|
|
21
|
-
const memory = vars.memory;
|
|
22
|
-
const client = await getVertesiaClient(payload);
|
|
23
|
-
const inMemory = await loadMemoryPack(client, `${memory}/input`);
|
|
24
|
-
const outMemory = await loadMemoryPack(client, `${memory}/output`);
|
|
25
|
-
|
|
26
|
-
const content = await outMemory.getEntryText("content.json");
|
|
27
|
-
if (!content) {
|
|
28
|
-
log.info(`Nothing to do. No content.json file found`);
|
|
29
|
-
return "No content.json file found";
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
log.info(`Creating the final output memory pack.`);
|
|
33
|
-
|
|
34
|
-
const inMeta = await inMemory.getMetadata();
|
|
35
|
-
let tocName = "toc.json";
|
|
36
|
-
let toc = await inMemory.getEntryText(tocName);
|
|
37
|
-
if (!toc) {
|
|
38
|
-
tocName = "toc.yaml";
|
|
39
|
-
toc = await inMemory.getEntryText(tocName);
|
|
40
|
-
}
|
|
41
|
-
if (!toc) {
|
|
42
|
-
const outMeta = await outMemory.getMetadata();
|
|
43
|
-
tocName = "toc.json";
|
|
44
|
-
toc = JSON.stringify(outMeta.toc);
|
|
45
|
-
}
|
|
46
|
-
const sections = JSON.parse(content) as Section[];
|
|
47
|
-
|
|
48
|
-
await buildAndPublishMemoryPack(
|
|
49
|
-
client,
|
|
50
|
-
`${memory}/output`,
|
|
51
|
-
async ({ copyText }) => {
|
|
52
|
-
// copy the input toc file if any
|
|
53
|
-
if (toc) {
|
|
54
|
-
copyText(toc, tocName);
|
|
55
|
-
}
|
|
56
|
-
// copy the raw JSON content
|
|
57
|
-
copyText(content, "content.json");
|
|
58
|
-
if (vars.section_file_pattern) {
|
|
59
|
-
log.info(
|
|
60
|
-
`Saving sections to files using pattern: ${vars.section_file_pattern}`,
|
|
61
|
-
);
|
|
62
|
-
// save sections to files
|
|
63
|
-
for (const section of sections) {
|
|
64
|
-
let content = section.content;
|
|
65
|
-
if (vars.section_file_header) {
|
|
66
|
-
content =
|
|
67
|
-
getSectionFileHeader(
|
|
68
|
-
section,
|
|
69
|
-
vars.section_file_header,
|
|
70
|
-
) +
|
|
71
|
-
"\n\n" +
|
|
72
|
-
content;
|
|
73
|
-
}
|
|
74
|
-
copyText(
|
|
75
|
-
content,
|
|
76
|
-
getSectionFileName(section, vars.section_file_pattern),
|
|
77
|
-
);
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
return {
|
|
81
|
-
...inMeta,
|
|
82
|
-
vars,
|
|
83
|
-
};
|
|
84
|
-
},
|
|
85
|
-
);
|
|
86
|
-
|
|
87
|
-
return `Processing done. Extracted files to: ${vars.section_file_pattern}`;
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
function getSectionFileHeader(section: TocSection, header: string): string {
|
|
91
|
-
const date = new Date().toISOString();
|
|
92
|
-
return expandVars(header, {
|
|
93
|
-
section,
|
|
94
|
-
date,
|
|
95
|
-
});
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
function getSectionFileName(section: TocSection, pattern: string): string {
|
|
99
|
-
return pattern.replace(SECTION_ID_PLACEHOLDER, section.id);
|
|
100
|
-
}
|
|
@@ -1,123 +0,0 @@
|
|
|
1
|
-
import { ApplicationFailure } from "@temporalio/workflow";
|
|
2
|
-
import { WorkflowExecutionPayload } from "@vertesia/common";
|
|
3
|
-
import { MemoryPack } from "@vertesia/memory";
|
|
4
|
-
import { getVertesiaClient } from "../../utils/client.js";
|
|
5
|
-
import {
|
|
6
|
-
buildAndPublishMemoryPack,
|
|
7
|
-
loadMemoryPack,
|
|
8
|
-
} from "../../utils/memory.js";
|
|
9
|
-
import {
|
|
10
|
-
IterativeGenerationPayload,
|
|
11
|
-
OutputMemoryMeta,
|
|
12
|
-
Section,
|
|
13
|
-
TocPart,
|
|
14
|
-
TocSection,
|
|
15
|
-
} from "../types.js";
|
|
16
|
-
import { executeWithVars, expectMemoryIsConsistent } from "../utils.js";
|
|
17
|
-
|
|
18
|
-
export async function it_gen_generatePart(
|
|
19
|
-
payload: WorkflowExecutionPayload,
|
|
20
|
-
path: number[],
|
|
21
|
-
) {
|
|
22
|
-
const vars = payload.vars as IterativeGenerationPayload;
|
|
23
|
-
const client = await getVertesiaClient(payload);
|
|
24
|
-
const memory = vars.memory;
|
|
25
|
-
|
|
26
|
-
const [sectionIndex, partIndex] = path;
|
|
27
|
-
const outMemory = await loadMemoryPack(client, `${memory}/output`);
|
|
28
|
-
const meta = (await outMemory.getMetadata()) as OutputMemoryMeta;
|
|
29
|
-
|
|
30
|
-
// the section we build is the section at the given index
|
|
31
|
-
const section: TocSection = meta.toc.sections[sectionIndex];
|
|
32
|
-
if (!section) {
|
|
33
|
-
throw ApplicationFailure.nonRetryable(
|
|
34
|
-
"Section not found in the TOC",
|
|
35
|
-
"SectionNotFound",
|
|
36
|
-
{ memory, path },
|
|
37
|
-
);
|
|
38
|
-
}
|
|
39
|
-
let part: TocPart | undefined;
|
|
40
|
-
if (partIndex !== undefined) {
|
|
41
|
-
part = section.parts?.[partIndex];
|
|
42
|
-
if (!part) {
|
|
43
|
-
throw ApplicationFailure.nonRetryable(
|
|
44
|
-
"Part not found in the TOC section",
|
|
45
|
-
"PartNotFound",
|
|
46
|
-
{ memory, path },
|
|
47
|
-
);
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
expectMemoryIsConsistent(meta, path);
|
|
52
|
-
|
|
53
|
-
const content = await loadGeneratedContent(outMemory);
|
|
54
|
-
|
|
55
|
-
let previously_generated = getPreviouslyGeneratedContent(
|
|
56
|
-
content,
|
|
57
|
-
!part,
|
|
58
|
-
vars.remembrance_strategy,
|
|
59
|
-
);
|
|
60
|
-
|
|
61
|
-
if (!part) {
|
|
62
|
-
// a new section
|
|
63
|
-
content.push({
|
|
64
|
-
id: section.id,
|
|
65
|
-
name: section.name,
|
|
66
|
-
description: section.description,
|
|
67
|
-
content: "",
|
|
68
|
-
});
|
|
69
|
-
} else if (!content.length) {
|
|
70
|
-
throw ApplicationFailure.nonRetryable(
|
|
71
|
-
"content.json is empty while generating a part",
|
|
72
|
-
"InvalidIterationState",
|
|
73
|
-
{ memory, path },
|
|
74
|
-
);
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
const interaction = vars.iterative_interaction || vars.interaction;
|
|
78
|
-
const r = await executeWithVars(client, interaction, vars, {
|
|
79
|
-
iteration: {
|
|
80
|
-
toc: meta.toc,
|
|
81
|
-
previously_generated,
|
|
82
|
-
section: section.name,
|
|
83
|
-
part: part?.name,
|
|
84
|
-
path: path,
|
|
85
|
-
},
|
|
86
|
-
});
|
|
87
|
-
|
|
88
|
-
const result = r.result.text();
|
|
89
|
-
content[content.length - 1].content += result;
|
|
90
|
-
meta.lastProcessedPart = path;
|
|
91
|
-
await buildAndPublishMemoryPack(
|
|
92
|
-
client,
|
|
93
|
-
`${memory}/output`,
|
|
94
|
-
async ({ copyText }) => {
|
|
95
|
-
copyText(JSON.stringify(content, null, 2), "content.json");
|
|
96
|
-
return meta;
|
|
97
|
-
},
|
|
98
|
-
);
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
async function loadGeneratedContent(memory: MemoryPack): Promise<Section[]> {
|
|
102
|
-
const content = await memory.getEntryText("content.json");
|
|
103
|
-
return content ? JSON.parse(content) : [];
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
function getPreviouslyGeneratedContent(
|
|
107
|
-
sections: Section[],
|
|
108
|
-
isNewSection: boolean,
|
|
109
|
-
strategy?: "document" | "section" | "none",
|
|
110
|
-
): string {
|
|
111
|
-
switch (strategy) {
|
|
112
|
-
case "document":
|
|
113
|
-
return sections
|
|
114
|
-
.map((section: Section) => section.content || "")
|
|
115
|
-
.join("\n\n");
|
|
116
|
-
case "none":
|
|
117
|
-
return "";
|
|
118
|
-
default:
|
|
119
|
-
return isNewSection
|
|
120
|
-
? ""
|
|
121
|
-
: sections[sections.length - 1]?.content || "";
|
|
122
|
-
}
|
|
123
|
-
}
|
|
@@ -1,116 +0,0 @@
|
|
|
1
|
-
import { WorkflowExecutionPayload } from "@vertesia/common";
|
|
2
|
-
import { getVertesiaClient } from "../../utils/client.js";
|
|
3
|
-
import { buildAndPublishMemoryPack } from "../../utils/memory.js";
|
|
4
|
-
import {
|
|
5
|
-
IterativeGenerationPayload,
|
|
6
|
-
OutputMemoryMeta,
|
|
7
|
-
Toc,
|
|
8
|
-
TocIndex,
|
|
9
|
-
} from "../types.js";
|
|
10
|
-
import { executeWithVars, tocIndex } from "../utils.js";
|
|
11
|
-
|
|
12
|
-
const defaultTocSchema = {
|
|
13
|
-
type: "object",
|
|
14
|
-
properties: {
|
|
15
|
-
sections: {
|
|
16
|
-
type: "array",
|
|
17
|
-
items: {
|
|
18
|
-
type: "object",
|
|
19
|
-
properties: {
|
|
20
|
-
id: {
|
|
21
|
-
type: "string",
|
|
22
|
-
description:
|
|
23
|
-
"the id of the section, can be a filename if working on a file, a slug if working on a document or path, or a unique identifier if working on a model.",
|
|
24
|
-
},
|
|
25
|
-
operation: {
|
|
26
|
-
type: "string",
|
|
27
|
-
enum: ["create", "update", "delete"],
|
|
28
|
-
description:
|
|
29
|
-
"The operation to perform on the section, create, update or delete. If update, you will be requested later to provide the list of change operation to perform.",
|
|
30
|
-
},
|
|
31
|
-
name: {
|
|
32
|
-
type: "string",
|
|
33
|
-
description:
|
|
34
|
-
"The name or title of the section, should be the path in the OpenAPI spec, of the title of the section/part.",
|
|
35
|
-
},
|
|
36
|
-
description: {
|
|
37
|
-
type: "string",
|
|
38
|
-
},
|
|
39
|
-
instructions: {
|
|
40
|
-
type: "string",
|
|
41
|
-
},
|
|
42
|
-
parts: {
|
|
43
|
-
type: "array",
|
|
44
|
-
description:
|
|
45
|
-
"when the section is too large, you can split it into parts, each part should have a title and description. Use it to split the section into subsection. When doing an API documentation, you can do one part for each path. When generating code, you can do one part for each method. When generating an OpenAPI spec, you can do one part for each operation.",
|
|
46
|
-
items: {
|
|
47
|
-
type: "object",
|
|
48
|
-
properties: {
|
|
49
|
-
id: {
|
|
50
|
-
type: "string",
|
|
51
|
-
description:
|
|
52
|
-
"the id of the part, can be a filename if working on a file, a slug if working on a document or path, or a unique identifier if working on a model.",
|
|
53
|
-
},
|
|
54
|
-
name: {
|
|
55
|
-
type: "string",
|
|
56
|
-
description:
|
|
57
|
-
"The name or title of the part, should be the path in the OpenAPI spec, of the title of the section/part.",
|
|
58
|
-
},
|
|
59
|
-
/*
|
|
60
|
-
"description": {
|
|
61
|
-
"type": "string"
|
|
62
|
-
},
|
|
63
|
-
*/
|
|
64
|
-
instructions: {
|
|
65
|
-
type: "string",
|
|
66
|
-
},
|
|
67
|
-
},
|
|
68
|
-
required: ["id", "name"],
|
|
69
|
-
},
|
|
70
|
-
},
|
|
71
|
-
},
|
|
72
|
-
required: ["id", "name", "operation"],
|
|
73
|
-
},
|
|
74
|
-
},
|
|
75
|
-
},
|
|
76
|
-
required: ["sections"],
|
|
77
|
-
};
|
|
78
|
-
|
|
79
|
-
export async function it_gen_generateToc(
|
|
80
|
-
payload: WorkflowExecutionPayload,
|
|
81
|
-
): Promise<TocIndex> {
|
|
82
|
-
const vars = payload.vars as IterativeGenerationPayload;
|
|
83
|
-
|
|
84
|
-
const schema = vars.toc_schema || defaultTocSchema;
|
|
85
|
-
|
|
86
|
-
const client = await getVertesiaClient(payload);
|
|
87
|
-
|
|
88
|
-
const run = await executeWithVars(
|
|
89
|
-
client,
|
|
90
|
-
vars.interaction,
|
|
91
|
-
vars,
|
|
92
|
-
undefined,
|
|
93
|
-
schema,
|
|
94
|
-
);
|
|
95
|
-
|
|
96
|
-
//Parse the CompletionResult[] to get a Toc object
|
|
97
|
-
const jsonResults = run.result.object();
|
|
98
|
-
|
|
99
|
-
const toc: Toc = {
|
|
100
|
-
sections: jsonResults.sections
|
|
101
|
-
};
|
|
102
|
-
|
|
103
|
-
await buildAndPublishMemoryPack(
|
|
104
|
-
client,
|
|
105
|
-
`${vars.memory}/output`,
|
|
106
|
-
async () => {
|
|
107
|
-
return {
|
|
108
|
-
toc,
|
|
109
|
-
lastProcessedPart: undefined, // the part index (a number array)
|
|
110
|
-
previouslyGenerated: "",
|
|
111
|
-
} satisfies OutputMemoryMeta;
|
|
112
|
-
},
|
|
113
|
-
);
|
|
114
|
-
|
|
115
|
-
return tocIndex(toc);
|
|
116
|
-
}
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
import { WorkflowExecutionPayload } from "@vertesia/common";
|
|
2
|
-
|
|
3
|
-
import { log, proxyActivities } from "@temporalio/workflow";
|
|
4
|
-
import { WF_NON_RETRYABLE_ERRORS } from "../errors.js";
|
|
5
|
-
import * as activities from "./activities/index.js";
|
|
6
|
-
import { IterativeGenerationPayload, PartIndex, SECTION_ID_PLACEHOLDER } from "./types.js";
|
|
7
|
-
|
|
8
|
-
const {
|
|
9
|
-
it_gen_extractToc,
|
|
10
|
-
it_gen_generateToc,
|
|
11
|
-
it_gen_generatePart,
|
|
12
|
-
it_gen_finalizeOutput
|
|
13
|
-
} = proxyActivities<typeof activities>({
|
|
14
|
-
startToCloseTimeout: "15 minute",
|
|
15
|
-
retry: {
|
|
16
|
-
initialInterval: '30s',
|
|
17
|
-
backoffCoefficient: 2,
|
|
18
|
-
maximumAttempts: 20,
|
|
19
|
-
maximumInterval: 100 * 30 * 1000, //ms
|
|
20
|
-
nonRetryableErrorTypes: WF_NON_RETRYABLE_ERRORS,
|
|
21
|
-
},
|
|
22
|
-
});
|
|
23
|
-
|
|
24
|
-
export async function iterativeGenerationWorkflow(payload: WorkflowExecutionPayload) {
|
|
25
|
-
log.info(`Executing Iterative generation workflow.`);
|
|
26
|
-
|
|
27
|
-
const vars = payload.vars as IterativeGenerationPayload;
|
|
28
|
-
if (vars.section_file_pattern && !vars.section_file_pattern.includes(SECTION_ID_PLACEHOLDER)) {
|
|
29
|
-
throw new Error(`Invalid section_file_pattern: ${vars.section_file_pattern}. It must include the ${SECTION_ID_PLACEHOLDER} placeholder.`);
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
// extractToc tries to extract the toc from the input memory pack (toc.json or toc.yaml)
|
|
33
|
-
// the generateToc activity is returning the toc hierarchy.
|
|
34
|
-
// It doesn't include extra TOC details like description etc.
|
|
35
|
-
// To minimize the payload size only the hierarchy and the section/part names are returned
|
|
36
|
-
let toc = await it_gen_extractToc(payload);
|
|
37
|
-
if (!toc) {
|
|
38
|
-
log.info(`No TOC was specified in the input memory pack. Generating one.`);
|
|
39
|
-
toc = await it_gen_generateToc(payload);
|
|
40
|
-
} else {
|
|
41
|
-
log.info(`Using the TOC specified in the input memory pack.`);
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
if (toc.sections.length === 0) {
|
|
45
|
-
//TODO how to handle this case?
|
|
46
|
-
throw new Error("Nothing to generate: TOC is empty");
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
for (const section of toc.sections) {
|
|
50
|
-
log.info(`Generating section: ${formatPath(section)}`);
|
|
51
|
-
await it_gen_generatePart(payload, section.path);
|
|
52
|
-
|
|
53
|
-
if (section.parts) {
|
|
54
|
-
for (const part of section.parts) {
|
|
55
|
-
log.info(`Generating part: ${formatPath(part)}`);
|
|
56
|
-
await it_gen_generatePart(payload, part.path);
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
log.info(`Post-processing output memory pack`);
|
|
62
|
-
await it_gen_finalizeOutput(payload);
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
function formatPath(node: PartIndex) {
|
|
66
|
-
// we print 1 based indexes
|
|
67
|
-
return node.path.map(i => i + 1).join('.') + ' ' + node.name;
|
|
68
|
-
}
|
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
export const SECTION_ID_PLACEHOLDER = '%id';
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* An iterative generation workflow uses 2 memory packs one for input and the other for output.
|
|
6
|
-
* The input memory packs must be available in the project blobs bucket at `${tenant_id/memories/${memory_name}/input.tar.gz`.
|
|
7
|
-
* The output memory pack will be generated at `${tenant_id/memories/${memory_name}/output.tar.gz`.
|
|
8
|
-
* Each iteration is overwriting the output memory pack with the new generated content.
|
|
9
|
-
* The complete name of the input and output memory packs are: "${name}/input" and "${name}/output" where name is the base memory name.
|
|
10
|
-
*/
|
|
11
|
-
export interface IterativeGenerationPayload {
|
|
12
|
-
// the main interaction to execute. If iterative_generation is defined
|
|
13
|
-
// the main interaction will only be used to prepare the iteration (to generate the TOC)
|
|
14
|
-
// otherwise it will be used for the iterative generation too.
|
|
15
|
-
interaction: string;
|
|
16
|
-
// if defined this will be used for the iterative interaction which will generate parts.
|
|
17
|
-
// otherwise the main interaction will be used for iterative generation.
|
|
18
|
-
iterative_interaction?: string;
|
|
19
|
-
// the environment to use
|
|
20
|
-
environment?: string;
|
|
21
|
-
// the model to use
|
|
22
|
-
model?: string;
|
|
23
|
-
// A custom max tokens
|
|
24
|
-
max_tokens?: number;
|
|
25
|
-
// A custom temperature
|
|
26
|
-
temperature?: number;
|
|
27
|
-
// the memory pack group name
|
|
28
|
-
memory: string;
|
|
29
|
-
// the input memory pack mapping
|
|
30
|
-
input_mapping?: Record<string, string>;
|
|
31
|
-
// custom toc schema if any TODO remove this
|
|
32
|
-
toc_schema?: Record<string, any>
|
|
33
|
-
/**
|
|
34
|
-
* If not set to "none" the previously generated content will be passed to the iteration.
|
|
35
|
-
* If not set at all defaults to "section".
|
|
36
|
-
* If "section" is used only the section content previously generated will be passed to the next iteration.
|
|
37
|
-
* If "document" is used the whole previously generated document content will be passed to the next iteration.
|
|
38
|
-
* Defaults to section.
|
|
39
|
-
*/
|
|
40
|
-
remembrance_strategy?: "document" | "section" | "none";
|
|
41
|
-
/**
|
|
42
|
-
* If present will save sections in files using the pattern
|
|
43
|
-
* The pattern must include a placeholder for the section id: %id.
|
|
44
|
-
* Examples: `sections/%id.md`, `%id/page.mdx` etc.
|
|
45
|
-
* @see SECTION_ID_PLACEHOLDER
|
|
46
|
-
*/
|
|
47
|
-
section_file_pattern?: string;
|
|
48
|
-
/**
|
|
49
|
-
* An optional header to prepend to the section files.
|
|
50
|
-
* The header can contain the following variables:
|
|
51
|
-
* - ${section} - the section object
|
|
52
|
-
* - ${date} - the date when the file was generated
|
|
53
|
-
*/
|
|
54
|
-
section_file_header?: string;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
export interface TocPart {
|
|
58
|
-
id: string;
|
|
59
|
-
name: string;
|
|
60
|
-
description?: string;
|
|
61
|
-
instructions?: string;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
export interface TocSection {
|
|
65
|
-
id: string;
|
|
66
|
-
name: string;
|
|
67
|
-
description?: string;
|
|
68
|
-
instructions?: string;
|
|
69
|
-
parts?: TocPart[];
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
export interface Toc {
|
|
73
|
-
sections: TocSection[];
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
export interface SectionIndex extends PartIndex {
|
|
78
|
-
parts?: PartIndex[];
|
|
79
|
-
}
|
|
80
|
-
export interface PartIndex {
|
|
81
|
-
path: number[];
|
|
82
|
-
name: string;
|
|
83
|
-
}
|
|
84
|
-
export interface TocIndex {
|
|
85
|
-
sections: SectionIndex[];
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
export interface OutputMemoryMeta {
|
|
89
|
-
toc: Toc;
|
|
90
|
-
previouslyGenerated: string;
|
|
91
|
-
lastProcessedPart?: number[] | undefined;
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
export interface Section {
|
|
95
|
-
id: string;
|
|
96
|
-
name: string;
|
|
97
|
-
description?: string;
|
|
98
|
-
content: string;
|
|
99
|
-
}
|