@nodetool-ai/websocket 0.8.2 → 0.8.4-a24.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/README.md +5 -0
- package/dist/.nodetool-build-stamp +1 -1
- package/dist/agent/run-node-tool.d.ts.map +1 -1
- package/dist/agent/run-node-tool.js +11 -1
- package/dist/agent/run-node-tool.js.map +1 -1
- package/dist/chat-prediction-forwarder.d.ts +5 -3
- package/dist/chat-prediction-forwarder.d.ts.map +1 -1
- package/dist/chat-prediction-forwarder.js +6 -4
- package/dist/chat-prediction-forwarder.js.map +1 -1
- package/dist/chat-turn-registry.d.ts +2 -1
- package/dist/chat-turn-registry.d.ts.map +1 -1
- package/dist/chat-turn-registry.js +8 -1
- package/dist/chat-turn-registry.js.map +1 -1
- package/dist/collection-api.d.ts.map +1 -1
- package/dist/collection-api.js +3 -5
- package/dist/collection-api.js.map +1 -1
- package/dist/custom-providers.d.ts.map +1 -1
- package/dist/custom-providers.js +6 -1
- package/dist/custom-providers.js.map +1 -1
- package/dist/e2e-server.js +1 -1
- package/dist/e2e-server.js.map +1 -1
- package/dist/example-workflows.d.ts.map +1 -1
- package/dist/example-workflows.js +7 -1
- package/dist/example-workflows.js.map +1 -1
- package/dist/fake-runtime.d.ts +54 -8
- package/dist/fake-runtime.d.ts.map +1 -1
- package/dist/fake-runtime.js +228 -15
- package/dist/fake-runtime.js.map +1 -1
- package/dist/file-api.d.ts.map +1 -1
- package/dist/file-api.js +6 -8
- package/dist/file-api.js.map +1 -1
- package/dist/generation-recovery.d.ts.map +1 -1
- package/dist/generation-recovery.js +7 -4
- package/dist/generation-recovery.js.map +1 -1
- package/dist/headless-job-runner.d.ts.map +1 -1
- package/dist/headless-job-runner.js +8 -2
- package/dist/headless-job-runner.js.map +1 -1
- package/dist/http-api.d.ts +4 -2
- package/dist/http-api.d.ts.map +1 -1
- package/dist/http-api.js +67 -16
- package/dist/http-api.js.map +1 -1
- package/dist/http-body-schemas.d.ts +2 -0
- package/dist/http-body-schemas.d.ts.map +1 -1
- package/dist/http-body-schemas.js +8 -1
- package/dist/http-body-schemas.js.map +1 -1
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -1
- package/dist/job-control.d.ts +8 -0
- package/dist/job-control.d.ts.map +1 -1
- package/dist/job-control.js +12 -0
- package/dist/job-control.js.map +1 -1
- package/dist/lib/admin.d.ts +7 -0
- package/dist/lib/admin.d.ts.map +1 -0
- package/dist/lib/admin.js +19 -0
- package/dist/lib/admin.js.map +1 -0
- package/dist/lib/app-instances-service.d.ts +35 -0
- package/dist/lib/app-instances-service.d.ts.map +1 -1
- package/dist/lib/app-instances-service.js +3 -4
- package/dist/lib/app-instances-service.js.map +1 -1
- package/dist/lib/app-project-export.d.ts +12 -0
- package/dist/lib/app-project-export.d.ts.map +1 -0
- package/dist/lib/app-project-export.js +42 -0
- package/dist/lib/app-project-export.js.map +1 -0
- package/dist/lib/applications-service.d.ts.map +1 -1
- package/dist/lib/applications-service.js +7 -2
- package/dist/lib/applications-service.js.map +1 -1
- package/dist/lib/asset-export.d.ts +7 -3
- package/dist/lib/asset-export.d.ts.map +1 -1
- package/dist/lib/asset-export.js +16 -8
- package/dist/lib/asset-export.js.map +1 -1
- package/dist/lib/asset-paths.d.ts +1 -1
- package/dist/lib/asset-paths.js +1 -1
- package/dist/lib/asset-response.d.ts.map +1 -1
- package/dist/lib/asset-response.js +13 -6
- package/dist/lib/asset-response.js.map +1 -1
- package/dist/lib/cloud-profile.d.ts +10 -0
- package/dist/lib/cloud-profile.d.ts.map +1 -0
- package/dist/lib/cloud-profile.js +13 -0
- package/dist/lib/cloud-profile.js.map +1 -0
- package/dist/lib/example-apps.d.ts +3 -0
- package/dist/lib/example-apps.d.ts.map +1 -1
- package/dist/lib/example-apps.js +3 -2
- package/dist/lib/example-apps.js.map +1 -1
- package/dist/lib/http-user-id.d.ts +2 -0
- package/dist/lib/http-user-id.d.ts.map +1 -0
- package/dist/lib/http-user-id.js +4 -0
- package/dist/lib/http-user-id.js.map +1 -0
- package/dist/lib/json-body.d.ts +11 -0
- package/dist/lib/json-body.d.ts.map +1 -0
- package/dist/lib/json-body.js +13 -0
- package/dist/lib/json-body.js.map +1 -0
- package/dist/lib/project-archive-host.d.ts +14 -0
- package/dist/lib/project-archive-host.d.ts.map +1 -0
- package/dist/lib/project-archive-host.js +24 -0
- package/dist/lib/project-archive-host.js.map +1 -0
- package/dist/lib/project-archive.d.ts +103 -0
- package/dist/lib/project-archive.d.ts.map +1 -0
- package/dist/lib/project-archive.js +610 -0
- package/dist/lib/project-archive.js.map +1 -0
- package/dist/lib/public-routes.d.ts +15 -0
- package/dist/lib/public-routes.d.ts.map +1 -1
- package/dist/lib/public-routes.js +27 -0
- package/dist/lib/public-routes.js.map +1 -1
- package/dist/lib/public-workflow-share.d.ts +12 -1
- package/dist/lib/public-workflow-share.d.ts.map +1 -1
- package/dist/lib/public-workflow-share.js +45 -2
- package/dist/lib/public-workflow-share.js.map +1 -1
- package/dist/lib/python-metadata-roots.d.ts +27 -0
- package/dist/lib/python-metadata-roots.d.ts.map +1 -0
- package/dist/lib/python-metadata-roots.js +92 -0
- package/dist/lib/python-metadata-roots.js.map +1 -0
- package/dist/lib/runtime-detection.d.ts +1 -1
- package/dist/lib/runtime-detection.d.ts.map +1 -1
- package/dist/lib/runtime-detection.js +2 -1
- package/dist/lib/runtime-detection.js.map +1 -1
- package/dist/lib/server-auth-token.d.ts +18 -0
- package/dist/lib/server-auth-token.d.ts.map +1 -0
- package/dist/lib/server-auth-token.js +28 -0
- package/dist/lib/server-auth-token.js.map +1 -0
- package/dist/lib/thumbnail.d.ts.map +1 -1
- package/dist/lib/thumbnail.js +3 -1
- package/dist/lib/thumbnail.js.map +1 -1
- package/dist/lib/timeline-bundle.d.ts +70 -0
- package/dist/lib/timeline-bundle.d.ts.map +1 -1
- package/dist/lib/timeline-bundle.js +28 -10
- package/dist/lib/timeline-bundle.js.map +1 -1
- package/dist/lib/timeline-media-export.d.ts +18 -0
- package/dist/lib/timeline-media-export.d.ts.map +1 -0
- package/dist/lib/timeline-media-export.js +66 -0
- package/dist/lib/timeline-media-export.js.map +1 -0
- package/dist/lib/timeline-premiere-import.d.ts +24 -0
- package/dist/lib/timeline-premiere-import.d.ts.map +1 -0
- package/dist/lib/timeline-premiere-import.js +112 -0
- package/dist/lib/timeline-premiere-import.js.map +1 -0
- package/dist/lib/timeline-premiere.d.ts +38 -0
- package/dist/lib/timeline-premiere.d.ts.map +1 -0
- package/dist/lib/timeline-premiere.js +87 -0
- package/dist/lib/timeline-premiere.js.map +1 -0
- package/dist/lib/zip-stream.d.ts +3 -0
- package/dist/lib/zip-stream.d.ts.map +1 -1
- package/dist/lib/zip-stream.js +6 -0
- package/dist/lib/zip-stream.js.map +1 -1
- package/dist/mcp-agent-tools.d.ts +48 -0
- package/dist/mcp-agent-tools.d.ts.map +1 -1
- package/dist/mcp-agent-tools.js +15 -2
- package/dist/mcp-agent-tools.js.map +1 -1
- package/dist/mcp-server.d.ts +7 -0
- package/dist/mcp-server.d.ts.map +1 -1
- package/dist/mcp-server.js +163 -16
- package/dist/mcp-server.js.map +1 -1
- package/dist/mcp-skill-prompts.d.ts +23 -0
- package/dist/mcp-skill-prompts.d.ts.map +1 -0
- package/dist/mcp-skill-prompts.js +91 -0
- package/dist/mcp-skill-prompts.js.map +1 -0
- package/dist/mcp-tool-deps.d.ts.map +1 -1
- package/dist/mcp-tool-deps.js +8 -1
- package/dist/mcp-tool-deps.js.map +1 -1
- package/dist/model-download-runtime.d.ts.map +1 -1
- package/dist/model-download-runtime.js +2 -1
- package/dist/model-download-runtime.js.map +1 -1
- package/dist/models-api.d.ts.map +1 -1
- package/dist/models-api.js +6 -2
- package/dist/models-api.js.map +1 -1
- package/dist/node-registry-setup.d.ts +8 -5
- package/dist/node-registry-setup.d.ts.map +1 -1
- package/dist/node-registry-setup.js +22 -10
- package/dist/node-registry-setup.js.map +1 -1
- package/dist/oauth-api.d.ts.map +1 -1
- package/dist/oauth-api.js +45 -23
- package/dist/oauth-api.js.map +1 -1
- package/dist/openai-api.d.ts.map +1 -1
- package/dist/openai-api.js +10 -2
- package/dist/openai-api.js.map +1 -1
- package/dist/pack-source.d.ts +15 -0
- package/dist/pack-source.d.ts.map +1 -0
- package/dist/pack-source.js +85 -0
- package/dist/pack-source.js.map +1 -0
- package/dist/plugins/websocket.d.ts.map +1 -1
- package/dist/plugins/websocket.js +31 -5
- package/dist/plugins/websocket.js.map +1 -1
- package/dist/routes/applications.d.ts +1 -0
- package/dist/routes/applications.d.ts.map +1 -1
- package/dist/routes/applications.js +24 -0
- package/dist/routes/applications.js.map +1 -1
- package/dist/routes/assets.d.ts.map +1 -1
- package/dist/routes/assets.js +31 -41
- package/dist/routes/assets.js.map +1 -1
- package/dist/routes/config.d.ts.map +1 -1
- package/dist/routes/config.js +6 -0
- package/dist/routes/config.js.map +1 -1
- package/dist/routes/documents.d.ts.map +1 -1
- package/dist/routes/documents.js +32 -1
- package/dist/routes/documents.js.map +1 -1
- package/dist/routes/fal-pricing-estimate.d.ts.map +1 -1
- package/dist/routes/fal-pricing-estimate.js +2 -0
- package/dist/routes/fal-pricing-estimate.js.map +1 -1
- package/dist/routes/files.d.ts.map +1 -1
- package/dist/routes/files.js +2 -0
- package/dist/routes/files.js.map +1 -1
- package/dist/routes/games.d.ts +38 -0
- package/dist/routes/games.d.ts.map +1 -0
- package/dist/routes/games.js +159 -0
- package/dist/routes/games.js.map +1 -0
- package/dist/routes/integrations.d.ts.map +1 -1
- package/dist/routes/integrations.js +22 -26
- package/dist/routes/integrations.js.map +1 -1
- package/dist/routes/js-scripts.d.ts +1 -1
- package/dist/routes/js-scripts.d.ts.map +1 -1
- package/dist/routes/js-scripts.js +1 -1
- package/dist/routes/js-scripts.js.map +1 -1
- package/dist/routes/kie-pricing.js +1 -1
- package/dist/routes/kie-pricing.js.map +1 -1
- package/dist/routes/nodes.d.ts.map +1 -1
- package/dist/routes/nodes.js +13 -1
- package/dist/routes/nodes.js.map +1 -1
- package/dist/routes/project-archive.d.ts +18 -0
- package/dist/routes/project-archive.d.ts.map +1 -0
- package/dist/routes/project-archive.js +98 -0
- package/dist/routes/project-archive.js.map +1 -0
- package/dist/routes/storage.d.ts.map +1 -1
- package/dist/routes/storage.js +2 -0
- package/dist/routes/storage.js.map +1 -1
- package/dist/routes/storyboards.d.ts.map +1 -1
- package/dist/routes/storyboards.js +6 -3
- package/dist/routes/storyboards.js.map +1 -1
- package/dist/routes/timelines.d.ts +8 -4
- package/dist/routes/timelines.d.ts.map +1 -1
- package/dist/routes/timelines.js +209 -16
- package/dist/routes/timelines.js.map +1 -1
- package/dist/screenshot-docs-seed.d.ts +24 -0
- package/dist/screenshot-docs-seed.d.ts.map +1 -0
- package/dist/screenshot-docs-seed.js +421 -0
- package/dist/screenshot-docs-seed.js.map +1 -0
- package/dist/screenshot-projects.d.ts.map +1 -1
- package/dist/screenshot-projects.js +9 -9
- package/dist/screenshot-projects.js.map +1 -1
- package/dist/screenshot-server.js +274 -17
- package/dist/screenshot-server.js.map +1 -1
- package/dist/sdk/sdk-node-type-inventory-service.d.ts +1 -1
- package/dist/sdk/sdk-node-type-inventory-service.d.ts.map +1 -1
- package/dist/sdk/sdk-node-type-inventory-service.js +4 -4
- package/dist/sdk/sdk-node-type-inventory-service.js.map +1 -1
- package/dist/sdk/sdk-v1-service.js +1 -1
- package/dist/sdk/sdk-v1-service.js.map +1 -1
- package/dist/server.d.ts +7 -1
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +1482 -1487
- package/dist/server.js.map +1 -1
- package/dist/session/chat-prompt.d.ts.map +1 -1
- package/dist/session/chat-prompt.js +6 -0
- package/dist/session/chat-prompt.js.map +1 -1
- package/dist/session/chat-turn.d.ts +10 -0
- package/dist/session/chat-turn.d.ts.map +1 -1
- package/dist/session/chat-turn.js +103 -20
- package/dist/session/chat-turn.js.map +1 -1
- package/dist/session/client-tool-gate.d.ts +23 -0
- package/dist/session/client-tool-gate.d.ts.map +1 -0
- package/dist/session/client-tool-gate.js +59 -0
- package/dist/session/client-tool-gate.js.map +1 -0
- package/dist/session/commands.d.ts +14 -0
- package/dist/session/commands.d.ts.map +1 -1
- package/dist/session/commands.js +113 -14
- package/dist/session/commands.js.map +1 -1
- package/dist/session/inference.d.ts +25 -2
- package/dist/session/inference.d.ts.map +1 -1
- package/dist/session/inference.js +105 -21
- package/dist/session/inference.js.map +1 -1
- package/dist/session/job-execution.d.ts +0 -1
- package/dist/session/job-execution.d.ts.map +1 -1
- package/dist/session/job-execution.js +43 -39
- package/dist/session/job-execution.js.map +1 -1
- package/dist/storage-api.d.ts +0 -4
- package/dist/storage-api.d.ts.map +1 -1
- package/dist/storage-api.js +3 -26
- package/dist/storage-api.js.map +1 -1
- package/dist/test-ui-server.d.ts +15 -3
- package/dist/test-ui-server.d.ts.map +1 -1
- package/dist/test-ui-server.js +74 -12
- package/dist/test-ui-server.js.map +1 -1
- package/dist/triggers/dispatcher.d.ts.map +1 -1
- package/dist/triggers/dispatcher.js +24 -4
- package/dist/triggers/dispatcher.js.map +1 -1
- package/dist/triggers/file-watch.d.ts +2 -2
- package/dist/triggers/file-watch.d.ts.map +1 -1
- package/dist/triggers/file-watch.js +44 -21
- package/dist/triggers/file-watch.js.map +1 -1
- package/dist/triggers/scheduler.d.ts.map +1 -1
- package/dist/triggers/scheduler.js +7 -5
- package/dist/triggers/scheduler.js.map +1 -1
- package/dist/trpc/error-formatter.d.ts.map +1 -1
- package/dist/trpc/error-formatter.js +2 -1
- package/dist/trpc/error-formatter.js.map +1 -1
- package/dist/trpc/routers/app-instances.d.ts +63 -0
- package/dist/trpc/routers/app-instances.d.ts.map +1 -1
- package/dist/trpc/routers/app-runs.d.ts +28 -0
- package/dist/trpc/routers/app-runs.d.ts.map +1 -1
- package/dist/trpc/routers/applications.d.ts +7 -0
- package/dist/trpc/routers/applications.d.ts.map +1 -1
- package/dist/trpc/routers/assets.d.ts +8 -0
- package/dist/trpc/routers/assets.d.ts.map +1 -1
- package/dist/trpc/routers/assets.js +16 -5
- package/dist/trpc/routers/assets.js.map +1 -1
- package/dist/trpc/routers/collections.d.ts.map +1 -1
- package/dist/trpc/routers/collections.js +16 -10
- package/dist/trpc/routers/collections.js.map +1 -1
- package/dist/trpc/routers/credits.d.ts.map +1 -1
- package/dist/trpc/routers/credits.js +11 -1
- package/dist/trpc/routers/credits.js.map +1 -1
- package/dist/trpc/routers/extension.d.ts +17 -3
- package/dist/trpc/routers/extension.d.ts.map +1 -1
- package/dist/trpc/routers/extension.js +40 -7
- package/dist/trpc/routers/extension.js.map +1 -1
- package/dist/trpc/routers/gameDraftHistory.d.ts +1 -2
- package/dist/trpc/routers/gameDraftHistory.d.ts.map +1 -1
- package/dist/trpc/routers/gameDraftHistory.js +1 -1
- package/dist/trpc/routers/gameDraftHistory.js.map +1 -1
- package/dist/trpc/routers/games.d.ts +20478 -24667
- package/dist/trpc/routers/games.d.ts.map +1 -1
- package/dist/trpc/routers/games.js +325 -143
- package/dist/trpc/routers/games.js.map +1 -1
- package/dist/trpc/routers/jobs.d.ts +7 -0
- package/dist/trpc/routers/jobs.d.ts.map +1 -1
- package/dist/trpc/routers/jobs.js +10 -3
- package/dist/trpc/routers/jobs.js.map +1 -1
- package/dist/trpc/routers/js-scripts.d.ts.map +1 -1
- package/dist/trpc/routers/js-scripts.js +18 -2
- package/dist/trpc/routers/js-scripts.js.map +1 -1
- package/dist/trpc/routers/messages.d.ts +10 -0
- package/dist/trpc/routers/messages.d.ts.map +1 -1
- package/dist/trpc/routers/messages.js +16 -2
- package/dist/trpc/routers/messages.js.map +1 -1
- package/dist/trpc/routers/models.d.ts.map +1 -1
- package/dist/trpc/routers/models.js +58 -37
- package/dist/trpc/routers/models.js.map +1 -1
- package/dist/trpc/routers/packs.d.ts.map +1 -1
- package/dist/trpc/routers/packs.js +19 -5
- package/dist/trpc/routers/packs.js.map +1 -1
- package/dist/trpc/routers/projects.d.ts +66 -2
- package/dist/trpc/routers/projects.d.ts.map +1 -1
- package/dist/trpc/routers/projects.js +19 -2
- package/dist/trpc/routers/projects.js.map +1 -1
- package/dist/trpc/routers/settings.d.ts.map +1 -1
- package/dist/trpc/routers/settings.js +30 -5
- package/dist/trpc/routers/settings.js.map +1 -1
- package/dist/trpc/routers/sketch.d.ts +30 -0
- package/dist/trpc/routers/sketch.d.ts.map +1 -1
- package/dist/trpc/routers/sketch.js +2 -2
- package/dist/trpc/routers/sketch.js.map +1 -1
- package/dist/trpc/routers/storyboards.d.ts +171 -1
- package/dist/trpc/routers/storyboards.d.ts.map +1 -1
- package/dist/trpc/routers/storyboards.js +8 -5
- package/dist/trpc/routers/storyboards.js.map +1 -1
- package/dist/trpc/routers/threads.d.ts.map +1 -1
- package/dist/trpc/routers/threads.js +11 -2
- package/dist/trpc/routers/threads.js.map +1 -1
- package/dist/trpc/routers/timeline.d.ts +379 -0
- package/dist/trpc/routers/timeline.d.ts.map +1 -1
- package/dist/trpc/routers/timeline.js +15 -2
- package/dist/trpc/routers/timeline.js.map +1 -1
- package/dist/trpc/routers/triggers.d.ts.map +1 -1
- package/dist/trpc/routers/triggers.js +18 -3
- package/dist/trpc/routers/triggers.js.map +1 -1
- package/dist/trpc/routers/users.d.ts +3 -2
- package/dist/trpc/routers/users.d.ts.map +1 -1
- package/dist/trpc/routers/users.js +25 -27
- package/dist/trpc/routers/users.js.map +1 -1
- package/dist/trpc/routers/worker.d.ts.map +1 -1
- package/dist/trpc/routers/worker.js +37 -14
- package/dist/trpc/routers/worker.js.map +1 -1
- package/dist/trpc/routers/workflows.d.ts +190 -0
- package/dist/trpc/routers/workflows.d.ts.map +1 -1
- package/dist/trpc/routers/workflows.js +56 -15
- package/dist/trpc/routers/workflows.js.map +1 -1
- package/dist/trpc/sandbox-coverage.d.ts.map +1 -1
- package/dist/trpc/sandbox-coverage.js +34 -0
- package/dist/trpc/sandbox-coverage.js.map +1 -1
- package/dist/websocket-client-session.d.ts +2 -2
- package/dist/websocket-client-session.d.ts.map +1 -1
- package/dist/websocket-client-session.js +9 -3
- package/dist/websocket-client-session.js.map +1 -1
- package/dist/worker-settings-env.d.ts +23 -0
- package/dist/worker-settings-env.d.ts.map +1 -0
- package/dist/worker-settings-env.js +47 -0
- package/dist/worker-settings-env.js.map +1 -0
- package/dist/workflow-interface-service.d.ts +7 -0
- package/dist/workflow-interface-service.d.ts.map +1 -1
- package/package.json +51 -46
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
* - recipes (shipped chains of examples)
|
|
12
12
|
* - public (list + get) — publicProcedure (no auth required)
|
|
13
13
|
* - versions (list, create, restore, delete)
|
|
14
|
+
* - exportScript (workflow → sandbox or Node.js script)
|
|
14
15
|
*
|
|
15
16
|
* Auth note:
|
|
16
17
|
* - `public.*` endpoints use publicProcedure — no auth required, matches
|
|
@@ -66,6 +67,13 @@ export declare const workflowsRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
66
67
|
ui_properties?: Record<string, string> | null | undefined;
|
|
67
68
|
edge_type?: string | undefined;
|
|
68
69
|
}[];
|
|
70
|
+
links?: {
|
|
71
|
+
id: string;
|
|
72
|
+
source: string;
|
|
73
|
+
target: string;
|
|
74
|
+
label?: string | null | undefined;
|
|
75
|
+
kind?: string | null | undefined;
|
|
76
|
+
}[] | undefined;
|
|
69
77
|
} | null | undefined;
|
|
70
78
|
input_schema: unknown;
|
|
71
79
|
output_schema: unknown;
|
|
@@ -76,6 +84,10 @@ export declare const workflowsRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
76
84
|
workspace_id: string | null;
|
|
77
85
|
required_providers: unknown;
|
|
78
86
|
required_models: unknown;
|
|
87
|
+
needs?: {
|
|
88
|
+
modelKinds: string[];
|
|
89
|
+
requiredSettings: string[];
|
|
90
|
+
} | null | undefined;
|
|
79
91
|
html_app: string | null;
|
|
80
92
|
app_doc?: Record<string, unknown> | null | undefined;
|
|
81
93
|
etag: string | null;
|
|
@@ -121,6 +133,13 @@ export declare const workflowsRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
121
133
|
ui_properties?: Record<string, string> | null | undefined;
|
|
122
134
|
edge_type?: string | undefined;
|
|
123
135
|
}[];
|
|
136
|
+
links?: {
|
|
137
|
+
id: string;
|
|
138
|
+
source: string;
|
|
139
|
+
target: string;
|
|
140
|
+
label?: string | null | undefined;
|
|
141
|
+
kind?: string | null | undefined;
|
|
142
|
+
}[] | undefined;
|
|
124
143
|
} | null | undefined;
|
|
125
144
|
input_schema: unknown;
|
|
126
145
|
output_schema: unknown;
|
|
@@ -131,6 +150,10 @@ export declare const workflowsRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
131
150
|
workspace_id: string | null;
|
|
132
151
|
required_providers: unknown;
|
|
133
152
|
required_models: unknown;
|
|
153
|
+
needs?: {
|
|
154
|
+
modelKinds: string[];
|
|
155
|
+
requiredSettings: string[];
|
|
156
|
+
} | null | undefined;
|
|
134
157
|
html_app: string | null;
|
|
135
158
|
app_doc?: Record<string, unknown> | null | undefined;
|
|
136
159
|
etag: string | null;
|
|
@@ -169,6 +192,13 @@ export declare const workflowsRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
169
192
|
ui_properties?: Record<string, string> | null | undefined;
|
|
170
193
|
edge_type?: string | undefined;
|
|
171
194
|
}[];
|
|
195
|
+
links?: {
|
|
196
|
+
id: string;
|
|
197
|
+
source: string;
|
|
198
|
+
target: string;
|
|
199
|
+
label?: string | null | undefined;
|
|
200
|
+
kind?: string | null | undefined;
|
|
201
|
+
}[] | undefined;
|
|
172
202
|
} | null | undefined;
|
|
173
203
|
settings?: Record<string, unknown> | null | undefined;
|
|
174
204
|
run_mode?: string | null | undefined;
|
|
@@ -212,6 +242,13 @@ export declare const workflowsRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
212
242
|
ui_properties?: Record<string, string> | null | undefined;
|
|
213
243
|
edge_type?: string | undefined;
|
|
214
244
|
}[];
|
|
245
|
+
links?: {
|
|
246
|
+
id: string;
|
|
247
|
+
source: string;
|
|
248
|
+
target: string;
|
|
249
|
+
label?: string | null | undefined;
|
|
250
|
+
kind?: string | null | undefined;
|
|
251
|
+
}[] | undefined;
|
|
215
252
|
} | null | undefined;
|
|
216
253
|
input_schema: unknown;
|
|
217
254
|
output_schema: unknown;
|
|
@@ -222,6 +259,10 @@ export declare const workflowsRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
222
259
|
workspace_id: string | null;
|
|
223
260
|
required_providers: unknown;
|
|
224
261
|
required_models: unknown;
|
|
262
|
+
needs?: {
|
|
263
|
+
modelKinds: string[];
|
|
264
|
+
requiredSettings: string[];
|
|
265
|
+
} | null | undefined;
|
|
225
266
|
html_app: string | null;
|
|
226
267
|
app_doc?: Record<string, unknown> | null | undefined;
|
|
227
268
|
etag: string | null;
|
|
@@ -261,6 +302,13 @@ export declare const workflowsRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
261
302
|
ui_properties?: Record<string, string> | null | undefined;
|
|
262
303
|
edge_type?: string | undefined;
|
|
263
304
|
}[];
|
|
305
|
+
links?: {
|
|
306
|
+
id: string;
|
|
307
|
+
source: string;
|
|
308
|
+
target: string;
|
|
309
|
+
label?: string | null | undefined;
|
|
310
|
+
kind?: string | null | undefined;
|
|
311
|
+
}[] | undefined;
|
|
264
312
|
} | null | undefined;
|
|
265
313
|
settings?: Record<string, unknown> | null | undefined;
|
|
266
314
|
run_mode?: string | null | undefined;
|
|
@@ -303,6 +351,13 @@ export declare const workflowsRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
303
351
|
ui_properties?: Record<string, string> | null | undefined;
|
|
304
352
|
edge_type?: string | undefined;
|
|
305
353
|
}[];
|
|
354
|
+
links?: {
|
|
355
|
+
id: string;
|
|
356
|
+
source: string;
|
|
357
|
+
target: string;
|
|
358
|
+
label?: string | null | undefined;
|
|
359
|
+
kind?: string | null | undefined;
|
|
360
|
+
}[] | undefined;
|
|
306
361
|
} | null | undefined;
|
|
307
362
|
input_schema: unknown;
|
|
308
363
|
output_schema: unknown;
|
|
@@ -313,6 +368,10 @@ export declare const workflowsRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
313
368
|
workspace_id: string | null;
|
|
314
369
|
required_providers: unknown;
|
|
315
370
|
required_models: unknown;
|
|
371
|
+
needs?: {
|
|
372
|
+
modelKinds: string[];
|
|
373
|
+
requiredSettings: string[];
|
|
374
|
+
} | null | undefined;
|
|
316
375
|
html_app: string | null;
|
|
317
376
|
app_doc?: Record<string, unknown> | null | undefined;
|
|
318
377
|
etag: string | null;
|
|
@@ -352,6 +411,13 @@ export declare const workflowsRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
352
411
|
ui_properties?: Record<string, string> | null | undefined;
|
|
353
412
|
edge_type?: string | undefined;
|
|
354
413
|
}[];
|
|
414
|
+
links?: {
|
|
415
|
+
id: string;
|
|
416
|
+
source: string;
|
|
417
|
+
target: string;
|
|
418
|
+
label?: string | null | undefined;
|
|
419
|
+
kind?: string | null | undefined;
|
|
420
|
+
}[] | undefined;
|
|
355
421
|
};
|
|
356
422
|
name?: string | undefined;
|
|
357
423
|
description?: string | undefined;
|
|
@@ -373,6 +439,7 @@ export declare const workflowsRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
373
439
|
message: string;
|
|
374
440
|
skipped: boolean;
|
|
375
441
|
updated_at: string | null;
|
|
442
|
+
etag?: string | null | undefined;
|
|
376
443
|
};
|
|
377
444
|
meta: object;
|
|
378
445
|
}>;
|
|
@@ -405,6 +472,10 @@ export declare const workflowsRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
405
472
|
workflows: string[];
|
|
406
473
|
operationCount: number;
|
|
407
474
|
thumbnailUrl: string | null;
|
|
475
|
+
needs?: {
|
|
476
|
+
modelKinds: string[];
|
|
477
|
+
requiredSettings: string[];
|
|
478
|
+
} | undefined;
|
|
408
479
|
role: string;
|
|
409
480
|
}[];
|
|
410
481
|
steps: {
|
|
@@ -475,6 +546,13 @@ export declare const workflowsRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
475
546
|
ui_properties?: Record<string, string> | null | undefined;
|
|
476
547
|
edge_type?: string | undefined;
|
|
477
548
|
}[];
|
|
549
|
+
links?: {
|
|
550
|
+
id: string;
|
|
551
|
+
source: string;
|
|
552
|
+
target: string;
|
|
553
|
+
label?: string | null | undefined;
|
|
554
|
+
kind?: string | null | undefined;
|
|
555
|
+
}[] | undefined;
|
|
478
556
|
} | null | undefined;
|
|
479
557
|
input_schema: unknown;
|
|
480
558
|
output_schema: unknown;
|
|
@@ -485,6 +563,10 @@ export declare const workflowsRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
485
563
|
workspace_id: string | null;
|
|
486
564
|
required_providers: unknown;
|
|
487
565
|
required_models: unknown;
|
|
566
|
+
needs?: {
|
|
567
|
+
modelKinds: string[];
|
|
568
|
+
requiredSettings: string[];
|
|
569
|
+
} | null | undefined;
|
|
488
570
|
html_app: string | null;
|
|
489
571
|
app_doc?: Record<string, unknown> | null | undefined;
|
|
490
572
|
etag: string | null;
|
|
@@ -530,6 +612,13 @@ export declare const workflowsRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
530
612
|
ui_properties?: Record<string, string> | null | undefined;
|
|
531
613
|
edge_type?: string | undefined;
|
|
532
614
|
}[];
|
|
615
|
+
links?: {
|
|
616
|
+
id: string;
|
|
617
|
+
source: string;
|
|
618
|
+
target: string;
|
|
619
|
+
label?: string | null | undefined;
|
|
620
|
+
kind?: string | null | undefined;
|
|
621
|
+
}[] | undefined;
|
|
533
622
|
} | null | undefined;
|
|
534
623
|
input_schema: unknown;
|
|
535
624
|
output_schema: unknown;
|
|
@@ -540,6 +629,10 @@ export declare const workflowsRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
540
629
|
workspace_id: string | null;
|
|
541
630
|
required_providers: unknown;
|
|
542
631
|
required_models: unknown;
|
|
632
|
+
needs?: {
|
|
633
|
+
modelKinds: string[];
|
|
634
|
+
requiredSettings: string[];
|
|
635
|
+
} | null | undefined;
|
|
543
636
|
html_app: string | null;
|
|
544
637
|
app_doc?: Record<string, unknown> | null | undefined;
|
|
545
638
|
etag: string | null;
|
|
@@ -561,6 +654,59 @@ export declare const workflowsRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
561
654
|
};
|
|
562
655
|
meta: object;
|
|
563
656
|
}>;
|
|
657
|
+
exportScript: import("@trpc/server").TRPCMutationProcedure<{
|
|
658
|
+
input: {
|
|
659
|
+
id: string;
|
|
660
|
+
target: "node" | "sandbox";
|
|
661
|
+
graph?: {
|
|
662
|
+
nodes: {
|
|
663
|
+
[x: string]: unknown;
|
|
664
|
+
id: string;
|
|
665
|
+
type: string;
|
|
666
|
+
parent_id?: string | null | undefined;
|
|
667
|
+
data?: unknown;
|
|
668
|
+
ui_properties?: unknown;
|
|
669
|
+
dynamic_properties?: Record<string, unknown> | undefined;
|
|
670
|
+
dynamic_outputs?: Record<string, unknown> | undefined;
|
|
671
|
+
}[];
|
|
672
|
+
edges: {
|
|
673
|
+
[x: string]: unknown;
|
|
674
|
+
id?: string | null | undefined;
|
|
675
|
+
source: string;
|
|
676
|
+
sourceHandle: string;
|
|
677
|
+
target: string;
|
|
678
|
+
targetHandle: string;
|
|
679
|
+
ui_properties?: Record<string, string> | null | undefined;
|
|
680
|
+
edge_type?: string | undefined;
|
|
681
|
+
}[];
|
|
682
|
+
links?: {
|
|
683
|
+
id: string;
|
|
684
|
+
source: string;
|
|
685
|
+
target: string;
|
|
686
|
+
label?: string | null | undefined;
|
|
687
|
+
kind?: string | null | undefined;
|
|
688
|
+
}[] | undefined;
|
|
689
|
+
} | undefined;
|
|
690
|
+
};
|
|
691
|
+
output: {
|
|
692
|
+
code: string;
|
|
693
|
+
filename: string;
|
|
694
|
+
inputs: {
|
|
695
|
+
name: string;
|
|
696
|
+
type: string;
|
|
697
|
+
}[];
|
|
698
|
+
outputs: {
|
|
699
|
+
name: string;
|
|
700
|
+
type: string;
|
|
701
|
+
}[];
|
|
702
|
+
unsupported: {
|
|
703
|
+
node_id: string;
|
|
704
|
+
node_type: string;
|
|
705
|
+
message: string;
|
|
706
|
+
}[];
|
|
707
|
+
};
|
|
708
|
+
meta: object;
|
|
709
|
+
}>;
|
|
564
710
|
versions: import("@trpc/server").TRPCBuiltRouter<{
|
|
565
711
|
ctx: import("../context.js").Context;
|
|
566
712
|
meta: object;
|
|
@@ -646,6 +792,13 @@ export declare const workflowsRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
646
792
|
ui_properties?: Record<string, string> | null | undefined;
|
|
647
793
|
edge_type?: string | undefined;
|
|
648
794
|
}[];
|
|
795
|
+
links?: {
|
|
796
|
+
id: string;
|
|
797
|
+
source: string;
|
|
798
|
+
target: string;
|
|
799
|
+
label?: string | null | undefined;
|
|
800
|
+
kind?: string | null | undefined;
|
|
801
|
+
}[] | undefined;
|
|
649
802
|
} | null | undefined;
|
|
650
803
|
input_schema: unknown;
|
|
651
804
|
output_schema: unknown;
|
|
@@ -656,6 +809,10 @@ export declare const workflowsRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
656
809
|
workspace_id: string | null;
|
|
657
810
|
required_providers: unknown;
|
|
658
811
|
required_models: unknown;
|
|
812
|
+
needs?: {
|
|
813
|
+
modelKinds: string[];
|
|
814
|
+
requiredSettings: string[];
|
|
815
|
+
} | null | undefined;
|
|
659
816
|
html_app: string | null;
|
|
660
817
|
app_doc?: Record<string, unknown> | null | undefined;
|
|
661
818
|
etag: string | null;
|
|
@@ -790,6 +947,13 @@ export declare const workflowsRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
790
947
|
ui_properties?: Record<string, string> | null | undefined;
|
|
791
948
|
edge_type?: string | undefined;
|
|
792
949
|
}[];
|
|
950
|
+
links?: {
|
|
951
|
+
id: string;
|
|
952
|
+
source: string;
|
|
953
|
+
target: string;
|
|
954
|
+
label?: string | null | undefined;
|
|
955
|
+
kind?: string | null | undefined;
|
|
956
|
+
}[] | undefined;
|
|
793
957
|
} | null | undefined;
|
|
794
958
|
input_schema: unknown;
|
|
795
959
|
output_schema: unknown;
|
|
@@ -800,6 +964,10 @@ export declare const workflowsRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
800
964
|
workspace_id: string | null;
|
|
801
965
|
required_providers: unknown;
|
|
802
966
|
required_models: unknown;
|
|
967
|
+
needs?: {
|
|
968
|
+
modelKinds: string[];
|
|
969
|
+
requiredSettings: string[];
|
|
970
|
+
} | null | undefined;
|
|
803
971
|
html_app: string | null;
|
|
804
972
|
app_doc?: Record<string, unknown> | null | undefined;
|
|
805
973
|
etag: string | null;
|
|
@@ -845,6 +1013,13 @@ export declare const workflowsRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
845
1013
|
ui_properties?: Record<string, string> | null | undefined;
|
|
846
1014
|
edge_type?: string | undefined;
|
|
847
1015
|
}[];
|
|
1016
|
+
links?: {
|
|
1017
|
+
id: string;
|
|
1018
|
+
source: string;
|
|
1019
|
+
target: string;
|
|
1020
|
+
label?: string | null | undefined;
|
|
1021
|
+
kind?: string | null | undefined;
|
|
1022
|
+
}[] | undefined;
|
|
848
1023
|
} | null | undefined;
|
|
849
1024
|
input_schema: unknown;
|
|
850
1025
|
output_schema: unknown;
|
|
@@ -855,6 +1030,10 @@ export declare const workflowsRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
855
1030
|
workspace_id: string | null;
|
|
856
1031
|
required_providers: unknown;
|
|
857
1032
|
required_models: unknown;
|
|
1033
|
+
needs?: {
|
|
1034
|
+
modelKinds: string[];
|
|
1035
|
+
requiredSettings: string[];
|
|
1036
|
+
} | null | undefined;
|
|
858
1037
|
html_app: string | null;
|
|
859
1038
|
app_doc?: Record<string, unknown> | null | undefined;
|
|
860
1039
|
etag: string | null;
|
|
@@ -899,6 +1078,13 @@ export declare const workflowsRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
899
1078
|
ui_properties?: Record<string, string> | null | undefined;
|
|
900
1079
|
edge_type?: string | undefined;
|
|
901
1080
|
}[];
|
|
1081
|
+
links?: {
|
|
1082
|
+
id: string;
|
|
1083
|
+
source: string;
|
|
1084
|
+
target: string;
|
|
1085
|
+
label?: string | null | undefined;
|
|
1086
|
+
kind?: string | null | undefined;
|
|
1087
|
+
}[] | undefined;
|
|
902
1088
|
} | null | undefined;
|
|
903
1089
|
input_schema: unknown;
|
|
904
1090
|
output_schema: unknown;
|
|
@@ -909,6 +1095,10 @@ export declare const workflowsRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
909
1095
|
workspace_id: string | null;
|
|
910
1096
|
required_providers: unknown;
|
|
911
1097
|
required_models: unknown;
|
|
1098
|
+
needs?: {
|
|
1099
|
+
modelKinds: string[];
|
|
1100
|
+
requiredSettings: string[];
|
|
1101
|
+
} | null | undefined;
|
|
912
1102
|
html_app: string | null;
|
|
913
1103
|
app_doc?: Record<string, unknown> | null | undefined;
|
|
914
1104
|
etag: string | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workflows.d.ts","sourceRoot":"","sources":["../../../src/trpc/routers/workflows.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"workflows.d.ts","sourceRoot":"","sources":["../../../src/trpc/routers/workflows.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AA8bH,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0jB1B,CAAC"}
|
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
* - recipes (shipped chains of examples)
|
|
12
12
|
* - public (list + get) — publicProcedure (no auth required)
|
|
13
13
|
* - versions (list, create, restore, delete)
|
|
14
|
+
* - exportScript (workflow → sandbox or Node.js script)
|
|
14
15
|
*
|
|
15
16
|
* Auth note:
|
|
16
17
|
* - `public.*` endpoints use publicProcedure — no auth required, matches
|
|
@@ -23,6 +24,8 @@ import { z } from "zod";
|
|
|
23
24
|
import { withCacheBuster } from "../../lib/example-thumbnail.js";
|
|
24
25
|
import { Workflow, WorkflowVersion, WorkflowCollaborator, WorkflowShare } from "@nodetool-ai/models";
|
|
25
26
|
import { loadPythonPackageMetadata } from "@nodetool-ai/node-sdk";
|
|
27
|
+
import { scanExampleNeeds } from "@nodetool-ai/protocol";
|
|
28
|
+
import { workflowToScript } from "@nodetool-ai/dsl";
|
|
26
29
|
import { createLogger } from "@nodetool-ai/config";
|
|
27
30
|
import { deriveExampleAssetsDir } from "../../example-workflows.js";
|
|
28
31
|
import { exampleRecipeSummary } from "@nodetool-ai/protocol/api-schemas/recipes.js";
|
|
@@ -32,10 +35,10 @@ import { router, publicProcedure } from "../index.js";
|
|
|
32
35
|
import { protectedProcedure } from "../middleware.js";
|
|
33
36
|
import { throwApiError } from "../error-formatter.js";
|
|
34
37
|
import { createWorkflow, deleteWorkflow, syncTriggerRegistrations, updateWorkflow, WorkflowServiceError } from "../../lib/workflow-service.js";
|
|
35
|
-
import { listInput, listOutput, getInput, createInput, updateInput, deleteInput, deleteOutput, autosaveInput, autosaveOutput, examplesInput, examplesOutput, publicListInput, publicListOutput, publicGetInput, versionsListInput, versionsListOutput, versionCreateInput, versionResponse, versionRestoreInput, versionDeleteInput, versionDeleteOutput, terminalOutputsInput, terminalOutputsOutput, workflowResponse, graph as graphSchema, sharingGetInput, sharingGetOutput, sharingCreateLinkInput, sharingRevokeLinkInput, sharingSetRoleInput, sharingRemoveCollaboratorInput, sharingOkOutput, sharingAcceptInput, sharingAcceptOutput, sharingPublicTokenInput, shareItem, collaboratorItem, sharedWithMeInput, sharedWithMeOutput } from "@nodetool-ai/protocol/api-schemas/workflows.js";
|
|
38
|
+
import { listInput, listOutput, getInput, createInput, updateInput, deleteInput, deleteOutput, autosaveInput, autosaveOutput, examplesInput, examplesOutput, publicListInput, publicListOutput, publicGetInput, versionsListInput, versionsListOutput, versionCreateInput, versionResponse, versionRestoreInput, versionDeleteInput, versionDeleteOutput, terminalOutputsInput, terminalOutputsOutput, exportScriptInput, exportScriptOutput, workflowResponse, graph as graphSchema, sharingGetInput, sharingGetOutput, sharingCreateLinkInput, sharingRevokeLinkInput, sharingSetRoleInput, sharingRemoveCollaboratorInput, sharingOkOutput, sharingAcceptInput, sharingAcceptOutput, sharingPublicTokenInput, shareItem, collaboratorItem, sharedWithMeInput, sharedWithMeOutput } from "@nodetool-ai/protocol/api-schemas/workflows.js";
|
|
36
39
|
import { isString } from "../../lib/wire-values.js";
|
|
37
40
|
import { getStorageRetentionSettings } from "../../storage-retention.js";
|
|
38
|
-
import { loadPublicShareWorkflow } from "../../lib/public-workflow-share.js";
|
|
41
|
+
import { loadPublicShareWorkflow, parseSharedGraph } from "../../lib/public-workflow-share.js";
|
|
39
42
|
const log = createLogger("nodetool.websocket.trpc.workflows");
|
|
40
43
|
/** Map a `workflow-service` failure onto this router's tRPC error shape. */
|
|
41
44
|
async function runWorkflowService(run) {
|
|
@@ -199,7 +202,7 @@ function toShareItem(share) {
|
|
|
199
202
|
}
|
|
200
203
|
// ── Example workflow helpers ────────────────────────────────────────────────
|
|
201
204
|
const EXAMPLES_THUMBNAILS_PREFIX = "/api/workflows/examples/thumbnails/";
|
|
202
|
-
function buildExamplesFromDir(examplesDir, examplesAssetsFallbackDir) {
|
|
205
|
+
function buildExamplesFromDir(examplesDir, examplesAssetsFallbackDir, registry) {
|
|
203
206
|
if (!existsSync(examplesDir))
|
|
204
207
|
return [];
|
|
205
208
|
const assetsDir = deriveExampleAssetsDir(examplesDir, examplesAssetsFallbackDir);
|
|
@@ -253,6 +256,7 @@ function buildExamplesFromDir(examplesDir, examplesAssetsFallbackDir) {
|
|
|
253
256
|
workspace_id: null,
|
|
254
257
|
required_providers: null,
|
|
255
258
|
required_models: null,
|
|
259
|
+
needs: scanExampleNeeds(parsed.graph, (nodeType) => registry?.getMetadata(nodeType)?.required_settings),
|
|
256
260
|
html_app: null,
|
|
257
261
|
app_doc: null,
|
|
258
262
|
etag: null
|
|
@@ -266,7 +270,7 @@ function buildExamplesFromDir(examplesDir, examplesAssetsFallbackDir) {
|
|
|
266
270
|
}
|
|
267
271
|
function buildExampleWorkflows(apiOptions) {
|
|
268
272
|
if (apiOptions.examplesDir) {
|
|
269
|
-
return buildExamplesFromDir(apiOptions.examplesDir, apiOptions.examplesAssetsFallbackDir);
|
|
273
|
+
return buildExamplesFromDir(apiOptions.examplesDir, apiOptions.examplesAssetsFallbackDir, apiOptions.registry);
|
|
270
274
|
}
|
|
271
275
|
const loaded = loadPythonPackageMetadata({
|
|
272
276
|
roots: apiOptions.metadataRoots,
|
|
@@ -389,7 +393,8 @@ export const workflowsRouter = router({
|
|
|
389
393
|
version: null,
|
|
390
394
|
message: "Autosave skipped (rate limited)",
|
|
391
395
|
skipped: true,
|
|
392
|
-
updated_at: workflow.updated_at ?? null
|
|
396
|
+
updated_at: workflow.updated_at ?? null,
|
|
397
|
+
etag: workflow.getEtag()
|
|
393
398
|
};
|
|
394
399
|
}
|
|
395
400
|
}
|
|
@@ -398,8 +403,8 @@ export const workflowsRouter = router({
|
|
|
398
403
|
};
|
|
399
404
|
if (input.name !== undefined)
|
|
400
405
|
fields.name = input.name;
|
|
401
|
-
|
|
402
|
-
|
|
406
|
+
// `description` and `save_type` describe the version row this autosave
|
|
407
|
+
// creates (e.g. "Before execution" on a checkpoint), never the workflow.
|
|
403
408
|
// Only the owner can change visibility; editors keep it as-is.
|
|
404
409
|
if (role === "owner" &&
|
|
405
410
|
(input.access === "public" || input.access === "private"))
|
|
@@ -410,6 +415,7 @@ export const workflowsRouter = router({
|
|
|
410
415
|
}
|
|
411
416
|
await syncTriggerRegistrations(savedWorkflow);
|
|
412
417
|
recordAutosave(input.id, Date.now());
|
|
418
|
+
const saveType = input.save_type === "checkpoint" ? "checkpoint" : "autosave";
|
|
413
419
|
let version = null;
|
|
414
420
|
try {
|
|
415
421
|
const nextVer = await WorkflowVersion.nextVersion(input.id);
|
|
@@ -418,16 +424,16 @@ export const workflowsRouter = router({
|
|
|
418
424
|
user_id: ctx.userId,
|
|
419
425
|
graph: input.graph,
|
|
420
426
|
version: nextVer,
|
|
421
|
-
save_type:
|
|
427
|
+
save_type: saveType,
|
|
422
428
|
name: savedWorkflow.name,
|
|
423
|
-
description: savedWorkflow.description
|
|
429
|
+
description: input.description ?? savedWorkflow.description
|
|
424
430
|
});
|
|
425
431
|
await wv.save();
|
|
426
432
|
version = {
|
|
427
433
|
id: wv.id,
|
|
428
434
|
version: wv.version,
|
|
429
435
|
workflow_id: wv.workflow_id,
|
|
430
|
-
save_type: wv.save_type ??
|
|
436
|
+
save_type: wv.save_type ?? saveType,
|
|
431
437
|
created_at: wv.created_at ?? null
|
|
432
438
|
};
|
|
433
439
|
await WorkflowVersion.pruneOldAutosaves(input.id, maxVersions);
|
|
@@ -439,7 +445,8 @@ export const workflowsRouter = router({
|
|
|
439
445
|
version,
|
|
440
446
|
message: "Autosaved successfully",
|
|
441
447
|
skipped: false,
|
|
442
|
-
updated_at: savedWorkflow.updated_at ?? null
|
|
448
|
+
updated_at: savedWorkflow.updated_at ?? null,
|
|
449
|
+
etag: savedWorkflow.getEtag()
|
|
443
450
|
};
|
|
444
451
|
}),
|
|
445
452
|
// ── examples (GET /api/workflows/examples) ────────────────────────────────
|
|
@@ -514,6 +521,34 @@ export const workflowsRouter = router({
|
|
|
514
521
|
}));
|
|
515
522
|
return { outputs };
|
|
516
523
|
}),
|
|
524
|
+
// ── exportScript ──────────────────────────────────────────────────────────
|
|
525
|
+
// The editor's graph when sent (unsaved edits included), else the saved one.
|
|
526
|
+
exportScript: protectedProcedure
|
|
527
|
+
.input(exportScriptInput)
|
|
528
|
+
.output(exportScriptOutput)
|
|
529
|
+
.mutation(async ({ ctx, input }) => {
|
|
530
|
+
const { workflow } = await requireWorkflowRole(input.id, ctx.userId, "viewer");
|
|
531
|
+
const graph = input.graph ?? workflow.graph;
|
|
532
|
+
if (!graph) {
|
|
533
|
+
throwApiError(ApiErrorCode.INVALID_INPUT, "Workflow has no graph");
|
|
534
|
+
}
|
|
535
|
+
try {
|
|
536
|
+
const script = workflowToScript(graph, {
|
|
537
|
+
target: input.target,
|
|
538
|
+
workflowName: workflow.name,
|
|
539
|
+
getMetadata: (nodeType) => ctx.registry.getMetadata(nodeType)
|
|
540
|
+
});
|
|
541
|
+
const base = (workflow.name ?? "").replace(/[^A-Za-z0-9._-]+/g, "_") ||
|
|
542
|
+
"workflow";
|
|
543
|
+
return {
|
|
544
|
+
...script,
|
|
545
|
+
filename: `${base}.${input.target === "node" ? "mjs" : "js"}`
|
|
546
|
+
};
|
|
547
|
+
}
|
|
548
|
+
catch (error) {
|
|
549
|
+
throwApiError(ApiErrorCode.INVALID_INPUT, error instanceof Error ? error.message : String(error));
|
|
550
|
+
}
|
|
551
|
+
}),
|
|
517
552
|
// ── versions ──────────────────────────────────────────────────────────────
|
|
518
553
|
versions: router({
|
|
519
554
|
// GET /api/workflows/:id/versions
|
|
@@ -554,9 +589,15 @@ export const workflowsRouter = router({
|
|
|
554
589
|
const version = await WorkflowVersion.findByVersion(input.id, input.version);
|
|
555
590
|
if (!version)
|
|
556
591
|
throwApiError(ApiErrorCode.NOT_FOUND, "Version not found");
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
592
|
+
// Same write path as autosave: a whole-row save would overwrite a
|
|
593
|
+
// concurrent edit, and the restored graph's trigger nodes must be
|
|
594
|
+
// armed or disarmed like any other graph change.
|
|
595
|
+
const restored = await Workflow.updateFieldsIfUnchanged(input.id, workflow.updated_at, { graph: version.graph });
|
|
596
|
+
if (!restored) {
|
|
597
|
+
throwApiError(ApiErrorCode.ALREADY_EXISTS, "Workflow was modified since last read (optimistic concurrency conflict)");
|
|
598
|
+
}
|
|
599
|
+
await syncTriggerRegistrations(restored);
|
|
600
|
+
return toWorkflowResponse(restored);
|
|
560
601
|
}),
|
|
561
602
|
// DELETE /api/workflows/:id/versions/:versionId
|
|
562
603
|
delete: protectedProcedure
|
|
@@ -693,7 +734,7 @@ export const workflowsRouter = router({
|
|
|
693
734
|
description: source.description,
|
|
694
735
|
tags: source.tags,
|
|
695
736
|
access: "private",
|
|
696
|
-
graph:
|
|
737
|
+
graph: parseSharedGraph(source.graph),
|
|
697
738
|
settings: source.settings,
|
|
698
739
|
run_mode: source.run_mode
|
|
699
740
|
}));
|